Built motion from commit d62f9d50.|2.5.35
authorAndrea Cuccaro <andrea.cuccaro@xcally.com>
Thu, 30 Sep 2021 10:52:28 +0000 (12:52 +0200)
committerAndrea Cuccaro <andrea.cuccaro@xcally.com>
Thu, 30 Sep 2021 10:52:28 +0000 (12:52 +0200)
1151 files changed:
apidoc/api_project.js
apidoc/api_project.json
server/api/action/action.attributes.js
server/api/action/action.controller.js
server/api/action/action.model.js
server/api/action/action.rpc.js
server/api/action/index.js
server/api/analyticCustomReport/analyticCustomReport.attributes.js
server/api/analyticCustomReport/analyticCustomReport.controller.js
server/api/analyticCustomReport/analyticCustomReport.model.js
server/api/analyticCustomReport/analyticCustomReport.rpc.js
server/api/analyticCustomReport/index.js
server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
server/api/analyticDefaultReport/analyticDefaultReport.controller.js
server/api/analyticDefaultReport/analyticDefaultReport.model.js
server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
server/api/analyticDefaultReport/index.js
server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
server/api/analyticExtractedReport/analyticExtractedReport.controller.js
server/api/analyticExtractedReport/analyticExtractedReport.model.js
server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
server/api/analyticExtractedReport/index.js
server/api/analyticFieldReport/analyticFieldReport.attributes.js
server/api/analyticFieldReport/analyticFieldReport.controller.js
server/api/analyticFieldReport/analyticFieldReport.model.js
server/api/analyticFieldReport/analyticFieldReport.rpc.js
server/api/analyticFieldReport/index.js
server/api/analyticMetric/analyticMetric.attributes.js
server/api/analyticMetric/analyticMetric.controller.js
server/api/analyticMetric/analyticMetric.model.js
server/api/analyticMetric/analyticMetric.rpc.js
server/api/analyticMetric/index.js
server/api/analyticTreeReport/analyticTreeReport.attributes.js
server/api/analyticTreeReport/analyticTreeReport.controller.js
server/api/analyticTreeReport/analyticTreeReport.model.js
server/api/analyticTreeReport/analyticTreeReport.rpc.js
server/api/analyticTreeReport/index.js
server/api/attachment/attachment.attributes.js
server/api/attachment/attachment.controller.js
server/api/attachment/attachment.model.js
server/api/attachment/attachment.rpc.js
server/api/attachment/index.js
server/api/authGoogle/authGoogle.controller.js
server/api/authGoogle/index.js
server/api/authLocal/authLocal.controller.js
server/api/authLocal/index.js
server/api/automation/automation.attributes.js
server/api/automation/automation.controller.js
server/api/automation/automation.model.js
server/api/automation/automation.rpc.js
server/api/automation/index.js
server/api/campaign/campaign.attributes.js
server/api/campaign/campaign.controller.js
server/api/campaign/campaign.model.js
server/api/campaign/campaign.rpc.js
server/api/campaign/index.js
server/api/cannedAnswer/cannedAnswer.attributes.js
server/api/cannedAnswer/cannedAnswer.controller.js
server/api/cannedAnswer/cannedAnswer.model.js
server/api/cannedAnswer/cannedAnswer.rpc.js
server/api/cannedAnswer/index.js
server/api/cdr/cdr.attributes.js
server/api/cdr/cdr.controller.js
server/api/cdr/cdr.model.js
server/api/cdr/cdr.rpc.js
server/api/cdr/index.js
server/api/chatApplication/chatApplication.attributes.js
server/api/chatApplication/chatApplication.controller.js
server/api/chatApplication/chatApplication.model.js
server/api/chatApplication/chatApplication.rpc.js
server/api/chatApplication/index.js
server/api/chatGroup/chatGroup.attributes.js
server/api/chatGroup/chatGroup.controller.js
server/api/chatGroup/chatGroup.events.js
server/api/chatGroup/chatGroup.model.js
server/api/chatGroup/chatGroup.rpc.js
server/api/chatGroup/chatGroup.socket.js
server/api/chatGroup/index.js
server/api/chatInteraction/chatInteraction.attributes.js
server/api/chatInteraction/chatInteraction.controller.js
server/api/chatInteraction/chatInteraction.events.js
server/api/chatInteraction/chatInteraction.model.js
server/api/chatInteraction/chatInteraction.rpc.js
server/api/chatInteraction/chatInteraction.socket.js
server/api/chatInteraction/index.js
server/api/chatInternalMessage/chatInternalMessage.attributes.js
server/api/chatInternalMessage/chatInternalMessage.controller.js
server/api/chatInternalMessage/chatInternalMessage.events.js
server/api/chatInternalMessage/chatInternalMessage.model.js
server/api/chatInternalMessage/chatInternalMessage.rpc.js
server/api/chatInternalMessage/chatInternalMessage.socket.js
server/api/chatInternalMessage/index.js
server/api/chatMessage/chatMessage.attributes.js
server/api/chatMessage/chatMessage.controller.js
server/api/chatMessage/chatMessage.events.js
server/api/chatMessage/chatMessage.model.js
server/api/chatMessage/chatMessage.rpc.js
server/api/chatMessage/chatMessage.socket.js
server/api/chatMessage/index.js
server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
server/api/chatOfflineMessage/chatOfflineMessage.controller.js
server/api/chatOfflineMessage/chatOfflineMessage.model.js
server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
server/api/chatOfflineMessage/index.js
server/api/chatProactiveAction/chatProactiveAction.attributes.js
server/api/chatProactiveAction/chatProactiveAction.controller.js
server/api/chatProactiveAction/chatProactiveAction.model.js
server/api/chatProactiveAction/chatProactiveAction.rpc.js
server/api/chatProactiveAction/index.js
server/api/chatQueue/chatQueue.attributes.js
server/api/chatQueue/chatQueue.controller.js
server/api/chatQueue/chatQueue.events.js
server/api/chatQueue/chatQueue.model.js
server/api/chatQueue/chatQueue.rpc.js
server/api/chatQueue/chatQueue.socket.js
server/api/chatQueue/index.js
server/api/chatQueueReport/chatQueueReport.attributes.js
server/api/chatQueueReport/chatQueueReport.controller.js
server/api/chatQueueReport/chatQueueReport.model.js
server/api/chatQueueReport/chatQueueReport.rpc.js
server/api/chatQueueReport/index.js
server/api/chatTransferReport/chatTransferReport.attributes.js
server/api/chatTransferReport/chatTransferReport.controller.js
server/api/chatTransferReport/chatTransferReport.model.js
server/api/chatTransferReport/chatTransferReport.rpc.js
server/api/chatTransferReport/index.js
server/api/chatWebsite/chatWebsite.attributes.js
server/api/chatWebsite/chatWebsite.controller.js
server/api/chatWebsite/chatWebsite.events.js
server/api/chatWebsite/chatWebsite.model.js
server/api/chatWebsite/chatWebsite.rpc.js
server/api/chatWebsite/chatWebsite.socket.js
server/api/chatWebsite/index.js
server/api/cloudProvider/cloudProvider.attributes.js
server/api/cloudProvider/cloudProvider.controller.js
server/api/cloudProvider/cloudProvider.model.js
server/api/cloudProvider/cloudProvider.rpc.js
server/api/cloudProvider/index.js
server/api/cmCompany/cmCompany.attributes.js
server/api/cmCompany/cmCompany.controller.js
server/api/cmCompany/cmCompany.model.js
server/api/cmCompany/cmCompany.rpc.js
server/api/cmCompany/index.js
server/api/cmContact/cmContact.attributes.js
server/api/cmContact/cmContact.controller.js
server/api/cmContact/cmContact.events.js
server/api/cmContact/cmContact.model.js
server/api/cmContact/cmContact.rpc.js
server/api/cmContact/cmContact.socket.js
server/api/cmContact/index.js
server/api/cmCustomField/cmCustomField.attributes.js
server/api/cmCustomField/cmCustomField.controller.js
server/api/cmCustomField/cmCustomField.model.js
server/api/cmCustomField/cmCustomField.rpc.js
server/api/cmCustomField/index.js
server/api/cmHopper/cmHopper.attributes.js
server/api/cmHopper/cmHopper.controller.js
server/api/cmHopper/cmHopper.model.js
server/api/cmHopper/cmHopper.rpc.js
server/api/cmHopper/index.js
server/api/cmHopperBlack/cmHopperBlack.attributes.js
server/api/cmHopperBlack/cmHopperBlack.controller.js
server/api/cmHopperBlack/cmHopperBlack.model.js
server/api/cmHopperBlack/cmHopperBlack.rpc.js
server/api/cmHopperBlack/index.js
server/api/cmHopperFinal/cmHopperFinal.attributes.js
server/api/cmHopperFinal/cmHopperFinal.controller.js
server/api/cmHopperFinal/cmHopperFinal.model.js
server/api/cmHopperFinal/cmHopperFinal.rpc.js
server/api/cmHopperFinal/index.js
server/api/cmHopperHistory/cmHopperHistory.attributes.js
server/api/cmHopperHistory/cmHopperHistory.controller.js
server/api/cmHopperHistory/cmHopperHistory.model.js
server/api/cmHopperHistory/cmHopperHistory.rpc.js
server/api/cmHopperHistory/index.js
server/api/cmList/cmList.attributes.js
server/api/cmList/cmList.controller.js
server/api/cmList/cmList.events.js
server/api/cmList/cmList.model.js
server/api/cmList/cmList.rpc.js
server/api/cmList/cmList.socket.js
server/api/cmList/index.js
server/api/condition/condition.attributes.js
server/api/condition/condition.controller.js
server/api/condition/condition.model.js
server/api/condition/condition.rpc.js
server/api/condition/index.js
server/api/dashboard/dashboard.attributes.js
server/api/dashboard/dashboard.controller.js
server/api/dashboard/dashboard.events.js
server/api/dashboard/dashboard.model.js
server/api/dashboard/dashboard.rpc.js
server/api/dashboard/dashboard.socket.js
server/api/dashboard/index.js
server/api/dashboardItem/dashboardItem.attributes.js
server/api/dashboardItem/dashboardItem.controller.js
server/api/dashboardItem/dashboardItem.events.js
server/api/dashboardItem/dashboardItem.model.js
server/api/dashboardItem/dashboardItem.rpc.js
server/api/dashboardItem/dashboardItem.socket.js
server/api/dashboardItem/index.js
server/api/disposition/disposition.attributes.js
server/api/disposition/disposition.controller.js
server/api/disposition/disposition.model.js
server/api/disposition/disposition.rpc.js
server/api/disposition/index.js
server/api/faxAccount/faxAccount.attributes.js
server/api/faxAccount/faxAccount.controller.js
server/api/faxAccount/faxAccount.events.js
server/api/faxAccount/faxAccount.model.js
server/api/faxAccount/faxAccount.rpc.js
server/api/faxAccount/faxAccount.socket.js
server/api/faxAccount/index.js
server/api/faxApplication/faxApplication.attributes.js
server/api/faxApplication/faxApplication.controller.js
server/api/faxApplication/faxApplication.model.js
server/api/faxApplication/faxApplication.rpc.js
server/api/faxApplication/index.js
server/api/faxInteraction/faxInteraction.attributes.js
server/api/faxInteraction/faxInteraction.controller.js
server/api/faxInteraction/faxInteraction.events.js
server/api/faxInteraction/faxInteraction.model.js
server/api/faxInteraction/faxInteraction.rpc.js
server/api/faxInteraction/faxInteraction.socket.js
server/api/faxInteraction/index.js
server/api/faxMessage/faxMessage.attributes.js
server/api/faxMessage/faxMessage.controller.js
server/api/faxMessage/faxMessage.events.js
server/api/faxMessage/faxMessage.model.js
server/api/faxMessage/faxMessage.rpc.js
server/api/faxMessage/faxMessage.socket.js
server/api/faxMessage/index.js
server/api/faxQueue/faxQueue.attributes.js
server/api/faxQueue/faxQueue.controller.js
server/api/faxQueue/faxQueue.events.js
server/api/faxQueue/faxQueue.model.js
server/api/faxQueue/faxQueue.rpc.js
server/api/faxQueue/faxQueue.socket.js
server/api/faxQueue/index.js
server/api/faxQueueReport/faxQueueReport.attributes.js
server/api/faxQueueReport/faxQueueReport.controller.js
server/api/faxQueueReport/faxQueueReport.model.js
server/api/faxQueueReport/faxQueueReport.rpc.js
server/api/faxQueueReport/index.js
server/api/faxTransferReport/faxTransferReport.attributes.js
server/api/faxTransferReport/faxTransferReport.controller.js
server/api/faxTransferReport/faxTransferReport.model.js
server/api/faxTransferReport/faxTransferReport.rpc.js
server/api/faxTransferReport/index.js
server/api/intDeskAccount/index.js
server/api/intDeskAccount/intDeskAccount.attributes.js
server/api/intDeskAccount/intDeskAccount.controller.js
server/api/intDeskAccount/intDeskAccount.model.js
server/api/intDeskAccount/intDeskAccount.rpc.js
server/api/intDeskConfiguration/index.js
server/api/intDeskConfiguration/intDeskConfiguration.attributes.js
server/api/intDeskConfiguration/intDeskConfiguration.controller.js
server/api/intDeskConfiguration/intDeskConfiguration.model.js
server/api/intDeskConfiguration/intDeskConfiguration.rpc.js
server/api/intDeskField/index.js
server/api/intDeskField/intDeskField.attributes.js
server/api/intDeskField/intDeskField.controller.js
server/api/intDeskField/intDeskField.model.js
server/api/intDeskField/intDeskField.rpc.js
server/api/intDynamics365Account/index.js
server/api/intDynamics365Account/intDynamics365Account.attributes.js
server/api/intDynamics365Account/intDynamics365Account.controller.js
server/api/intDynamics365Account/intDynamics365Account.model.js
server/api/intDynamics365Account/intDynamics365Account.rpc.js
server/api/intDynamics365Configuration/index.js
server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js
server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js
server/api/intDynamics365Configuration/intDynamics365Configuration.model.js
server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js
server/api/intDynamics365Field/index.js
server/api/intDynamics365Field/intDynamics365Field.attributes.js
server/api/intDynamics365Field/intDynamics365Field.controller.js
server/api/intDynamics365Field/intDynamics365Field.model.js
server/api/intDynamics365Field/intDynamics365Field.rpc.js
server/api/intFreshdeskAccount/index.js
server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js
server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js
server/api/intFreshdeskAccount/intFreshdeskAccount.model.js
server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js
server/api/intFreshdeskConfiguration/index.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js
server/api/intFreshdeskField/index.js
server/api/intFreshdeskField/intFreshdeskField.attributes.js
server/api/intFreshdeskField/intFreshdeskField.controller.js
server/api/intFreshdeskField/intFreshdeskField.model.js
server/api/intFreshdeskField/intFreshdeskField.rpc.js
server/api/intFreshsalesAccount/index.js
server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js
server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js
server/api/intFreshsalesAccount/intFreshsalesAccount.model.js
server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js
server/api/intFreshsalesConfiguration/index.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js
server/api/intFreshsalesField/index.js
server/api/intFreshsalesField/intFreshsalesField.attributes.js
server/api/intFreshsalesField/intFreshsalesField.controller.js
server/api/intFreshsalesField/intFreshsalesField.model.js
server/api/intFreshsalesField/intFreshsalesField.rpc.js
server/api/intSalesforceAccount/index.js
server/api/intSalesforceAccount/intSalesforceAccount.attributes.js
server/api/intSalesforceAccount/intSalesforceAccount.controller.js
server/api/intSalesforceAccount/intSalesforceAccount.model.js
server/api/intSalesforceAccount/intSalesforceAccount.rpc.js
server/api/intSalesforceConfiguration/index.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js
server/api/intSalesforceField/index.js
server/api/intSalesforceField/intSalesforceField.attributes.js
server/api/intSalesforceField/intSalesforceField.controller.js
server/api/intSalesforceField/intSalesforceField.model.js
server/api/intSalesforceField/intSalesforceField.rpc.js
server/api/intServicenowAccount/index.js
server/api/intServicenowAccount/intServicenowAccount.attributes.js
server/api/intServicenowAccount/intServicenowAccount.controller.js
server/api/intServicenowAccount/intServicenowAccount.model.js
server/api/intServicenowAccount/intServicenowAccount.rpc.js
server/api/intServicenowConfiguration/index.js
server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js
server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js
server/api/intServicenowConfiguration/intServicenowConfiguration.model.js
server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js
server/api/intServicenowField/index.js
server/api/intServicenowField/intServicenowField.attributes.js
server/api/intServicenowField/intServicenowField.controller.js
server/api/intServicenowField/intServicenowField.model.js
server/api/intServicenowField/intServicenowField.rpc.js
server/api/intSugarcrmAccount/index.js
server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js
server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js
server/api/intSugarcrmAccount/intSugarcrmAccount.model.js
server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js
server/api/intSugarcrmConfiguration/index.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js
server/api/intSugarcrmField/index.js
server/api/intSugarcrmField/intSugarcrmField.attributes.js
server/api/intSugarcrmField/intSugarcrmField.controller.js
server/api/intSugarcrmField/intSugarcrmField.model.js
server/api/intSugarcrmField/intSugarcrmField.rpc.js
server/api/intVtigerAccount/index.js
server/api/intVtigerAccount/intVtigerAccount.attributes.js
server/api/intVtigerAccount/intVtigerAccount.controller.js
server/api/intVtigerAccount/intVtigerAccount.model.js
server/api/intVtigerAccount/intVtigerAccount.rpc.js
server/api/intVtigerConfiguration/index.js
server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js
server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js
server/api/intVtigerConfiguration/intVtigerConfiguration.model.js
server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js
server/api/intVtigerField/index.js
server/api/intVtigerField/intVtigerField.attributes.js
server/api/intVtigerField/intVtigerField.controller.js
server/api/intVtigerField/intVtigerField.model.js
server/api/intVtigerField/intVtigerField.rpc.js
server/api/intZendeskAccount/index.js
server/api/intZendeskAccount/intZendeskAccount.attributes.js
server/api/intZendeskAccount/intZendeskAccount.controller.js
server/api/intZendeskAccount/intZendeskAccount.model.js
server/api/intZendeskAccount/intZendeskAccount.rpc.js
server/api/intZendeskConfiguration/index.js
server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js
server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js
server/api/intZendeskConfiguration/intZendeskConfiguration.model.js
server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js
server/api/intZendeskField/index.js
server/api/intZendeskField/intZendeskField.attributes.js
server/api/intZendeskField/intZendeskField.controller.js
server/api/intZendeskField/intZendeskField.model.js
server/api/intZendeskField/intZendeskField.rpc.js
server/api/intZohoAccount/index.js
server/api/intZohoAccount/intZohoAccount.attributes.js
server/api/intZohoAccount/intZohoAccount.controller.js
server/api/intZohoAccount/intZohoAccount.model.js
server/api/intZohoAccount/intZohoAccount.rpc.js
server/api/intZohoConfiguration/index.js
server/api/intZohoConfiguration/intZohoConfiguration.attributes.js
server/api/intZohoConfiguration/intZohoConfiguration.controller.js
server/api/intZohoConfiguration/intZohoConfiguration.model.js
server/api/intZohoConfiguration/intZohoConfiguration.rpc.js
server/api/intZohoField/index.js
server/api/intZohoField/intZohoField.attributes.js
server/api/intZohoField/intZohoField.controller.js
server/api/intZohoField/intZohoField.model.js
server/api/intZohoField/intZohoField.rpc.js
server/api/integration/index.js
server/api/integration/integration.attributes.js
server/api/integration/integration.controller.js
server/api/integration/integration.model.js
server/api/integration/integration.rpc.js
server/api/integrationReport/index.js
server/api/integrationReport/integrationReport.attributes.js
server/api/integrationReport/integrationReport.controller.js
server/api/integrationReport/integrationReport.model.js
server/api/integrationReport/integrationReport.rpc.js
server/api/interval/index.js
server/api/interval/interval.attributes.js
server/api/interval/interval.controller.js
server/api/interval/interval.model.js
server/api/interval/interval.rpc.js
server/api/jira/index.js
server/api/jira/jira.controller.js
server/api/jscriptyAnswerReport/index.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js
server/api/jscriptyProject/index.js
server/api/jscriptyProject/jscriptyProject.attributes.js
server/api/jscriptyProject/jscriptyProject.controller.js
server/api/jscriptyProject/jscriptyProject.model.js
server/api/jscriptyProject/jscriptyProject.rpc.js
server/api/jscriptyQuestionReport/index.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js
server/api/jscriptySessionReport/index.js
server/api/jscriptySessionReport/jscriptySessionReport.attributes.js
server/api/jscriptySessionReport/jscriptySessionReport.controller.js
server/api/jscriptySessionReport/jscriptySessionReport.model.js
server/api/jscriptySessionReport/jscriptySessionReport.rpc.js
server/api/license/index.js
server/api/license/license.attributes.js
server/api/license/license.controller.js
server/api/license/license.model.js
server/api/license/license.rpc.js
server/api/mailAccount/index.js
server/api/mailAccount/mailAccount.attributes.js
server/api/mailAccount/mailAccount.controller.js
server/api/mailAccount/mailAccount.events.js
server/api/mailAccount/mailAccount.model.js
server/api/mailAccount/mailAccount.rpc.js
server/api/mailAccount/mailAccount.socket.js
server/api/mailApplication/index.js
server/api/mailApplication/mailApplication.attributes.js
server/api/mailApplication/mailApplication.controller.js
server/api/mailApplication/mailApplication.model.js
server/api/mailApplication/mailApplication.rpc.js
server/api/mailInteraction/index.js
server/api/mailInteraction/mailInteraction.attributes.js
server/api/mailInteraction/mailInteraction.controller.js
server/api/mailInteraction/mailInteraction.events.js
server/api/mailInteraction/mailInteraction.model.js
server/api/mailInteraction/mailInteraction.rpc.js
server/api/mailInteraction/mailInteraction.socket.js
server/api/mailMessage/index.js
server/api/mailMessage/mailMessage.attributes.js
server/api/mailMessage/mailMessage.controller.js
server/api/mailMessage/mailMessage.events.js
server/api/mailMessage/mailMessage.model.js
server/api/mailMessage/mailMessage.rpc.js
server/api/mailMessage/mailMessage.socket.js
server/api/mailQueue/index.js
server/api/mailQueue/mailQueue.attributes.js
server/api/mailQueue/mailQueue.controller.js
server/api/mailQueue/mailQueue.events.js
server/api/mailQueue/mailQueue.model.js
server/api/mailQueue/mailQueue.rpc.js
server/api/mailQueue/mailQueue.socket.js
server/api/mailQueueReport/index.js
server/api/mailQueueReport/mailQueueReport.attributes.js
server/api/mailQueueReport/mailQueueReport.controller.js
server/api/mailQueueReport/mailQueueReport.model.js
server/api/mailQueueReport/mailQueueReport.rpc.js
server/api/mailServerIn/index.js
server/api/mailServerIn/mailServerIn.attributes.js
server/api/mailServerIn/mailServerIn.model.js
server/api/mailServerIn/mailServerIn.rpc.js
server/api/mailServerOut/index.js
server/api/mailServerOut/mailServerOut.attributes.js
server/api/mailServerOut/mailServerOut.controller.js
server/api/mailServerOut/mailServerOut.model.js
server/api/mailServerOut/mailServerOut.rpc.js
server/api/mailSubstatus/index.js
server/api/mailSubstatus/mailSubstatus.attributes.js
server/api/mailSubstatus/mailSubstatus.controller.js
server/api/mailSubstatus/mailSubstatus.model.js
server/api/mailSubstatus/mailSubstatus.rpc.js
server/api/mailTransferReport/index.js
server/api/mailTransferReport/mailTransferReport.attributes.js
server/api/mailTransferReport/mailTransferReport.controller.js
server/api/mailTransferReport/mailTransferReport.model.js
server/api/mailTransferReport/mailTransferReport.rpc.js
server/api/memberReport/index.js
server/api/memberReport/memberReport.attributes.js
server/api/memberReport/memberReport.controller.js
server/api/memberReport/memberReport.model.js
server/api/memberReport/memberReport.rpc.js
server/api/migration/index.js
server/api/migration/migration.attributes.js
server/api/migration/migration.controller.js
server/api/migration/migration.model.js
server/api/migration/migration.rpc.js
server/api/network/index.js
server/api/network/network.attributes.js
server/api/network/network.controller.js
server/api/network/network.model.js
server/api/network/network.rpc.js
server/api/openchannelAccount/index.js
server/api/openchannelAccount/openchannelAccount.attributes.js
server/api/openchannelAccount/openchannelAccount.controller.js
server/api/openchannelAccount/openchannelAccount.events.js
server/api/openchannelAccount/openchannelAccount.model.js
server/api/openchannelAccount/openchannelAccount.rpc.js
server/api/openchannelAccount/openchannelAccount.socket.js
server/api/openchannelApplication/index.js
server/api/openchannelApplication/openchannelApplication.attributes.js
server/api/openchannelApplication/openchannelApplication.controller.js
server/api/openchannelApplication/openchannelApplication.model.js
server/api/openchannelApplication/openchannelApplication.rpc.js
server/api/openchannelInteraction/index.js
server/api/openchannelInteraction/openchannelInteraction.attributes.js
server/api/openchannelInteraction/openchannelInteraction.controller.js
server/api/openchannelInteraction/openchannelInteraction.events.js
server/api/openchannelInteraction/openchannelInteraction.model.js
server/api/openchannelInteraction/openchannelInteraction.rpc.js
server/api/openchannelInteraction/openchannelInteraction.socket.js
server/api/openchannelMessage/index.js
server/api/openchannelMessage/openchannelMessage.attributes.js
server/api/openchannelMessage/openchannelMessage.controller.js
server/api/openchannelMessage/openchannelMessage.events.js
server/api/openchannelMessage/openchannelMessage.model.js
server/api/openchannelMessage/openchannelMessage.rpc.js
server/api/openchannelMessage/openchannelMessage.socket.js
server/api/openchannelQueue/index.js
server/api/openchannelQueue/openchannelQueue.attributes.js
server/api/openchannelQueue/openchannelQueue.controller.js
server/api/openchannelQueue/openchannelQueue.events.js
server/api/openchannelQueue/openchannelQueue.model.js
server/api/openchannelQueue/openchannelQueue.rpc.js
server/api/openchannelQueue/openchannelQueue.socket.js
server/api/openchannelQueueReport/index.js
server/api/openchannelQueueReport/openchannelQueueReport.attributes.js
server/api/openchannelQueueReport/openchannelQueueReport.controller.js
server/api/openchannelQueueReport/openchannelQueueReport.model.js
server/api/openchannelQueueReport/openchannelQueueReport.rpc.js
server/api/openchannelTransferReport/index.js
server/api/openchannelTransferReport/openchannelTransferReport.attributes.js
server/api/openchannelTransferReport/openchannelTransferReport.controller.js
server/api/openchannelTransferReport/openchannelTransferReport.model.js
server/api/openchannelTransferReport/openchannelTransferReport.rpc.js
server/api/pause/index.js
server/api/pause/pause.attributes.js
server/api/pause/pause.controller.js
server/api/pause/pause.model.js
server/api/pause/pause.rpc.js
server/api/plugin/index.js
server/api/plugin/plugin.attributes.js
server/api/plugin/plugin.controller.js
server/api/plugin/plugin.events.js
server/api/plugin/plugin.model.js
server/api/plugin/plugin.rpc.js
server/api/plugin/plugin.socket.js
server/api/pm2/index.js
server/api/pm2/pm2.controller.js
server/api/realtime/index.js
server/api/realtime/realtime.controller.js
server/api/reportAgentPreview/index.js
server/api/reportAgentPreview/reportAgentPreview.attributes.js
server/api/reportAgentPreview/reportAgentPreview.model.js
server/api/reportAgentPreview/reportAgentPreview.rpc.js
server/api/rpc/index.js
server/api/rpc/rpc.controller.js
server/api/schedule/index.js
server/api/schedule/schedule.attributes.js
server/api/schedule/schedule.controller.js
server/api/schedule/schedule.model.js
server/api/schedule/schedule.rpc.js
server/api/screenRecording/index.js
server/api/screenRecording/screenRecording.attributes.js
server/api/screenRecording/screenRecording.controller.js
server/api/screenRecording/screenRecording.model.js
server/api/screenRecording/screenRecording.rpc.js
server/api/setting/index.js
server/api/setting/setting.attributes.js
server/api/setting/setting.controller.js
server/api/setting/setting.model.js
server/api/setting/setting.rpc.js
server/api/smsAccount/index.js
server/api/smsAccount/smsAccount.attributes.js
server/api/smsAccount/smsAccount.controller.js
server/api/smsAccount/smsAccount.events.js
server/api/smsAccount/smsAccount.model.js
server/api/smsAccount/smsAccount.rpc.js
server/api/smsAccount/smsAccount.socket.js
server/api/smsApplication/index.js
server/api/smsApplication/smsApplication.attributes.js
server/api/smsApplication/smsApplication.controller.js
server/api/smsApplication/smsApplication.model.js
server/api/smsApplication/smsApplication.rpc.js
server/api/smsInteraction/index.js
server/api/smsInteraction/smsInteraction.attributes.js
server/api/smsInteraction/smsInteraction.controller.js
server/api/smsInteraction/smsInteraction.events.js
server/api/smsInteraction/smsInteraction.model.js
server/api/smsInteraction/smsInteraction.rpc.js
server/api/smsInteraction/smsInteraction.socket.js
server/api/smsMessage/index.js
server/api/smsMessage/smsMessage.attributes.js
server/api/smsMessage/smsMessage.controller.js
server/api/smsMessage/smsMessage.events.js
server/api/smsMessage/smsMessage.model.js
server/api/smsMessage/smsMessage.rpc.js
server/api/smsMessage/smsMessage.socket.js
server/api/smsQueue/index.js
server/api/smsQueue/smsQueue.attributes.js
server/api/smsQueue/smsQueue.controller.js
server/api/smsQueue/smsQueue.events.js
server/api/smsQueue/smsQueue.model.js
server/api/smsQueue/smsQueue.rpc.js
server/api/smsQueue/smsQueue.socket.js
server/api/smsQueueReport/index.js
server/api/smsQueueReport/smsQueueReport.attributes.js
server/api/smsQueueReport/smsQueueReport.controller.js
server/api/smsQueueReport/smsQueueReport.model.js
server/api/smsQueueReport/smsQueueReport.rpc.js
server/api/smsTransferReport/index.js
server/api/smsTransferReport/smsTransferReport.attributes.js
server/api/smsTransferReport/smsTransferReport.controller.js
server/api/smsTransferReport/smsTransferReport.model.js
server/api/smsTransferReport/smsTransferReport.rpc.js
server/api/sound/index.js
server/api/sound/sound.attributes.js
server/api/sound/sound.controller.js
server/api/sound/sound.model.js
server/api/sound/sound.rpc.js
server/api/squareMessage/index.js
server/api/squareMessage/squareMessage.attributes.js
server/api/squareMessage/squareMessage.controller.js
server/api/squareMessage/squareMessage.model.js
server/api/squareMessage/squareMessage.rpc.js
server/api/squareOdbc/index.js
server/api/squareOdbc/squareOdbc.attributes.js
server/api/squareOdbc/squareOdbc.controller.js
server/api/squareOdbc/squareOdbc.model.js
server/api/squareOdbc/squareOdbc.rpc.js
server/api/squareProject/index.js
server/api/squareProject/squareProject.attributes.js
server/api/squareProject/squareProject.controller.js
server/api/squareProject/squareProject.events.js
server/api/squareProject/squareProject.model.js
server/api/squareProject/squareProject.rpc.js
server/api/squareProject/squareProject.socket.js
server/api/squareRecording/index.js
server/api/squareRecording/squareRecording.attributes.js
server/api/squareRecording/squareRecording.controller.js
server/api/squareRecording/squareRecording.model.js
server/api/squareRecording/squareRecording.rpc.js
server/api/squareReport/index.js
server/api/squareReport/squareReport.attributes.js
server/api/squareReport/squareReport.controller.js
server/api/squareReport/squareReport.model.js
server/api/squareReport/squareReport.rpc.js
server/api/squareReportDetail/index.js
server/api/squareReportDetail/squareReportDetail.attributes.js
server/api/squareReportDetail/squareReportDetail.controller.js
server/api/squareReportDetail/squareReportDetail.model.js
server/api/squareReportDetail/squareReportDetail.rpc.js
server/api/system/index.js
server/api/system/system.controller.js
server/api/tag/index.js
server/api/tag/tag.attributes.js
server/api/tag/tag.controller.js
server/api/tag/tag.model.js
server/api/tag/tag.rpc.js
server/api/team/index.js
server/api/team/team.attributes.js
server/api/team/team.controller.js
server/api/team/team.events.js
server/api/team/team.model.js
server/api/team/team.rpc.js
server/api/team/team.socket.js
server/api/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 bb7c429..66b72cd 100644 (file)
@@ -17,7 +17,7 @@ define({
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2021-09-30T09:44:15.318Z",
+    "time": "2021-09-30T10:43:46.011Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index e51665b..95347cc 100644 (file)
@@ -17,7 +17,7 @@
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2021-09-30T09:44:15.318Z",
+    "time": "2021-09-30T10:43:46.011Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index 324589a..144609c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc75=['TEXT','urlForward[body]','sequelize','VIRTUAL','getDataValue','action','integration','motionbar','jscripty','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','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],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xbc75,0xad));var _0x5bc7=function(_0x5c5479,_0x3c8617){_0x5c5479=_0x5c5479-0x0;var _0xff9413=_0xbc75[_0x5c5479];return _0xff9413;};'use strict';var Sequelize=require(_0x5bc7('0x0'));module['exports']={'name':{'type':Sequelize[_0x5bc7('0x1')],'get':function(_0x16a00d){return this[_0x5bc7('0x2')](_0x5bc7('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x5bc7('0x4'),_0x5bc7('0x5'),_0x5bc7('0x6'),'urlForward',_0x5bc7('0x7'),_0x5bc7('0x8'),_0x5bc7('0x9')]],'msg':_0x5bc7('0xa')}},'comment':_0x5bc7('0xa')},'data1':{'type':Sequelize['STRING'](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[_0x5bc7('0xb')](0x1000),'comment':_0x5bc7('0xc')},'data3':{'type':Sequelize[_0x5bc7('0xb')](0x1000),'comment':_0x5bc7('0xd')},'data4':{'type':Sequelize[_0x5bc7('0xb')](0x1000),'comments':_0x5bc7('0xe')},'data5':{'type':Sequelize[_0x5bc7('0xb')](0x1000),'comments':_0x5bc7('0xf')},'data6':{'type':Sequelize[_0x5bc7('0xb')],'comments':_0x5bc7('0x10')},'data7':{'type':Sequelize[_0x5bc7('0x11')],'comments':_0x5bc7('0x12')}};
\ No newline at end of file
+var _0x5255=['contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','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)]'];(function(_0xbda849,_0x2dcb1a){var _0x2d3e9d=function(_0x2c8f10){while(--_0x2c8f10){_0xbda849['push'](_0xbda849['shift']());}};_0x2d3e9d(++_0x2dcb1a);}(_0x5255,0xad));var _0x5525=function(_0x209510,_0x13f7f1){_0x209510=_0x209510-0x0;var _0x3fc7af=_0x5255[_0x209510];return _0x3fc7af;};'use strict';var Sequelize=require(_0x5525('0x0'));module[_0x5525('0x1')]={'name':{'type':Sequelize[_0x5525('0x2')],'get':function(_0x53d45d){return this[_0x5525('0x3')](_0x5525('0x4'));}},'action':{'type':Sequelize[_0x5525('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x5525('0x6'),_0x5525('0x7'),_0x5525('0x8'),_0x5525('0x9'),_0x5525('0xa'),_0x5525('0xb'),_0x5525('0xc'),_0x5525('0xd')]],'msg':_0x5525('0xe')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x5525('0xf')},'data2':{'type':Sequelize[_0x5525('0x5')](0x1000),'comment':_0x5525('0x10')},'data3':{'type':Sequelize[_0x5525('0x5')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x5525('0x5')](0x1000),'comments':_0x5525('0x11')},'data5':{'type':Sequelize[_0x5525('0x5')](0x1000),'comments':_0x5525('0x12')},'data6':{'type':Sequelize[_0x5525('0x5')],'comments':_0x5525('0x13')},'data7':{'type':Sequelize['TEXT'],'comments':_0x5525('0x14')}};
\ No newline at end of file
index 33114db..409b313 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac6b=['request-promise','moment','bluebird','mustache','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','reject','save','then','destroy','end','error','stack','name','send','update','body','Action','find','params','catch','eml-format','zip-dir'];(function(_0xbb14db,_0x3ee8c6){var _0x36bed7=function(_0x16c478){while(--_0x16c478){_0xbb14db['push'](_0xbb14db['shift']());}};_0x36bed7(++_0x3ee8c6);}(_0xac6b,0x181));var _0xbac6=function(_0x438f87,_0x545cc6){_0x438f87=_0x438f87-0x0;var _0x13ff7d=_0xac6b[_0x438f87];return _0x13ff7d;};'use strict';var emlformat=require(_0xbac6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbac6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbac6('0x2'));var moment=require(_0xbac6('0x3'));var BPromise=require(_0xbac6('0x4'));var Mustache=require(_0xbac6('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xbac6('0x6'));var ejs=require(_0xbac6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbac6('0x8'));var crypto=require(_0xbac6('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xbac6('0xa'));var toCsv=require('to-csv');var querystring=require(_0xbac6('0xb'));var Papa=require(_0xbac6('0xc'));var Redis=require(_0xbac6('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xbac6('0xe'));var as=require(_0xbac6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbac6('0x10'))(_0xbac6('0x11'));var utils=require('../../config/utils');var config=require(_0xbac6('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xbac6('0x13'))['db'];function respondWithStatusCode(_0x5e17cf,_0x50de4c){_0x50de4c=_0x50de4c||0xcc;return function(_0x15666b){if(_0x15666b){return _0x5e17cf[_0xbac6('0x14')](_0x50de4c);}return _0x5e17cf[_0xbac6('0x15')](_0x50de4c)['end']();};}function respondWithResult(_0x1c1cef,_0x13ad0){_0x13ad0=_0x13ad0||0xc8;return function(_0xb09d2c){if(_0xb09d2c){return _0x1c1cef[_0xbac6('0x15')](_0x13ad0)['json'](_0xb09d2c);}};}function respondWithFilteredResult(_0x48eabe,_0x5c3739){return function(_0xed785e){if(_0xed785e){var _0xdc357f=typeof _0x5c3739[_0xbac6('0x16')]===_0xbac6('0x17')&&typeof _0x5c3739['limit']==='undefined';var _0x2cb573=_0xed785e[_0xbac6('0x18')];var _0x3fa9ab=_0xdc357f?0x0:_0x5c3739[_0xbac6('0x16')];var _0x3083aa=_0xdc357f?_0xed785e['count']:_0x5c3739[_0xbac6('0x16')]+_0x5c3739[_0xbac6('0x19')];var _0x5e0023;if(_0x3083aa>=_0x2cb573){_0x3083aa=_0x2cb573;_0x5e0023=0xc8;}else{_0x5e0023=0xce;}_0x48eabe['status'](_0x5e0023);return _0x48eabe[_0xbac6('0x1a')](_0xbac6('0x1b'),_0x3fa9ab+'-'+_0x3083aa+'/'+_0x2cb573)['json'](_0xed785e);}return null;};}function patchUpdates(_0x56b427){return function(_0x37f366){try{jsonpatch['apply'](_0x37f366,_0x56b427,!![]);}catch(_0x4b6be4){return BPromise[_0xbac6('0x1c')](_0x4b6be4);}return _0x37f366[_0xbac6('0x1d')]();};}function saveUpdates(_0x1e712d,_0x526382){return function(_0x1c3d84){if(_0x1c3d84){return _0x1c3d84['update'](_0x1e712d)[_0xbac6('0x1e')](function(_0x411622){return _0x411622;});}return null;};}function removeEntity(_0x487d11,_0x43de21){return function(_0x5364d3){if(_0x5364d3){return _0x5364d3[_0xbac6('0x1f')]()[_0xbac6('0x1e')](function(){_0x487d11[_0xbac6('0x15')](0xcc)[_0xbac6('0x20')]();});}};}function handleEntityNotFound(_0x1c4ea2,_0x5e76af){return function(_0x75ebbc){if(!_0x75ebbc){_0x1c4ea2[_0xbac6('0x14')](0x194);}return _0x75ebbc;};}function handleError(_0xecc2ba,_0x20c145){_0x20c145=_0x20c145||0x1f4;return function(_0x5ee747){logger[_0xbac6('0x21')](_0x5ee747[_0xbac6('0x22')]);if(_0x5ee747[_0xbac6('0x23')]){delete _0x5ee747['name'];}_0xecc2ba['status'](_0x20c145)[_0xbac6('0x24')](_0x5ee747);};}exports[_0xbac6('0x25')]=function(_0x1f7be4,_0x560488){if(_0x1f7be4['body']['id']){delete _0x1f7be4[_0xbac6('0x26')]['id'];}return db[_0xbac6('0x27')][_0xbac6('0x28')]({'where':{'id':_0x1f7be4[_0xbac6('0x29')]['id']}})[_0xbac6('0x1e')](handleEntityNotFound(_0x560488,null))['then'](saveUpdates(_0x1f7be4['body'],null))[_0xbac6('0x1e')](respondWithResult(_0x560488,null))[_0xbac6('0x2a')](handleError(_0x560488,null));};exports[_0xbac6('0x1f')]=function(_0x122969,_0x5ac9bc){return db[_0xbac6('0x27')][_0xbac6('0x28')]({'where':{'id':_0x122969[_0xbac6('0x29')]['id']}})[_0xbac6('0x1e')](handleEntityNotFound(_0x5ac9bc,null))[_0xbac6('0x1e')](removeEntity(_0x5ac9bc,null))['catch'](handleError(_0x5ac9bc,null));};
\ No newline at end of file
+var _0x54fb=['desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','save','destroy','end','error','name','send','body','Action','find','params','then','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x54fb,0x159));var _0xb54f=function(_0x5d2810,_0x2d30e7){_0x5d2810=_0x5d2810-0x0;var _0x169653=_0x54fb[_0x5d2810];return _0x169653;};'use strict';var emlformat=require(_0xb54f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb54f('0x1'));var jsonpatch=require(_0xb54f('0x2'));var rp=require(_0xb54f('0x3'));var moment=require(_0xb54f('0x4'));var BPromise=require(_0xb54f('0x5'));var Mustache=require(_0xb54f('0x6'));var util=require('util');var path=require('path');var sox=require(_0xb54f('0x7'));var csv=require(_0xb54f('0x8'));var ejs=require(_0xb54f('0x9'));var fs=require('fs');var fs_extra=require(_0xb54f('0xa'));var _=require(_0xb54f('0xb'));var squel=require(_0xb54f('0xc'));var crypto=require(_0xb54f('0xd'));var jsforce=require(_0xb54f('0xe'));var deskjs=require(_0xb54f('0xf'));var toCsv=require(_0xb54f('0x8'));var querystring=require(_0xb54f('0x10'));var Papa=require('papaparse');var Redis=require(_0xb54f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb54f('0x12'));var as=require(_0xb54f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb54f('0x14'))('api');var utils=require(_0xb54f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb54f('0x16'));var db=require(_0xb54f('0x17'))['db'];function respondWithStatusCode(_0x44a51b,_0x582657){_0x582657=_0x582657||0xcc;return function(_0x191f66){if(_0x191f66){return _0x44a51b[_0xb54f('0x18')](_0x582657);}return _0x44a51b[_0xb54f('0x19')](_0x582657)['end']();};}function respondWithResult(_0x47857f,_0x48bbb4){_0x48bbb4=_0x48bbb4||0xc8;return function(_0x29f58c){if(_0x29f58c){return _0x47857f[_0xb54f('0x19')](_0x48bbb4)[_0xb54f('0x1a')](_0x29f58c);}};}function respondWithFilteredResult(_0x581e71,_0x322afe){return function(_0x2fe6b6){if(_0x2fe6b6){var _0xde5058=typeof _0x322afe[_0xb54f('0x1b')]==='undefined'&&typeof _0x322afe['limit']===_0xb54f('0x1c');var _0x359f93=_0x2fe6b6['count'];var _0x5e7ac7=_0xde5058?0x0:_0x322afe[_0xb54f('0x1b')];var _0x37a5da=_0xde5058?_0x2fe6b6[_0xb54f('0x1d')]:_0x322afe['offset']+_0x322afe[_0xb54f('0x1e')];var _0x48c12d;if(_0x37a5da>=_0x359f93){_0x37a5da=_0x359f93;_0x48c12d=0xc8;}else{_0x48c12d=0xce;}_0x581e71[_0xb54f('0x19')](_0x48c12d);return _0x581e71[_0xb54f('0x1f')]('Content-Range',_0x5e7ac7+'-'+_0x37a5da+'/'+_0x359f93)['json'](_0x2fe6b6);}return null;};}function patchUpdates(_0x215433){return function(_0x19882c){try{jsonpatch[_0xb54f('0x20')](_0x19882c,_0x215433,!![]);}catch(_0x172d3c){return BPromise['reject'](_0x172d3c);}return _0x19882c[_0xb54f('0x21')]();};}function saveUpdates(_0x1f2651,_0x3fcfe9){return function(_0x575f3b){if(_0x575f3b){return _0x575f3b['update'](_0x1f2651)['then'](function(_0x23f249){return _0x23f249;});}return null;};}function removeEntity(_0x5b1c6f,_0x447b4e){return function(_0x216ea1){if(_0x216ea1){return _0x216ea1[_0xb54f('0x22')]()['then'](function(){_0x5b1c6f[_0xb54f('0x19')](0xcc)[_0xb54f('0x23')]();});}};}function handleEntityNotFound(_0x4605bf,_0xf069ac){return function(_0x33d671){if(!_0x33d671){_0x4605bf[_0xb54f('0x18')](0x194);}return _0x33d671;};}function handleError(_0x2c459,_0x3ad3b3){_0x3ad3b3=_0x3ad3b3||0x1f4;return function(_0x554654){logger[_0xb54f('0x24')](_0x554654['stack']);if(_0x554654[_0xb54f('0x25')]){delete _0x554654[_0xb54f('0x25')];}_0x2c459[_0xb54f('0x19')](_0x3ad3b3)[_0xb54f('0x26')](_0x554654);};}exports['update']=function(_0x38c77b,_0x1c47a3){if(_0x38c77b[_0xb54f('0x27')]['id']){delete _0x38c77b[_0xb54f('0x27')]['id'];}return db[_0xb54f('0x28')][_0xb54f('0x29')]({'where':{'id':_0x38c77b[_0xb54f('0x2a')]['id']}})['then'](handleEntityNotFound(_0x1c47a3,null))[_0xb54f('0x2b')](saveUpdates(_0x38c77b[_0xb54f('0x27')],null))['then'](respondWithResult(_0x1c47a3,null))[_0xb54f('0x2c')](handleError(_0x1c47a3,null));};exports[_0xb54f('0x22')]=function(_0x4c004b,_0x387cc6){return db[_0xb54f('0x28')][_0xb54f('0x29')]({'where':{'id':_0x4c004b[_0xb54f('0x2a')]['id']}})['then'](handleEntityNotFound(_0x387cc6,null))['then'](removeEntity(_0x387cc6,null))[_0xb54f('0x2c')](handleError(_0x387cc6,null));};
\ No newline at end of file
index 3367ddc..1d13df3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe924=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','define','Action','tools_actions','lodash'];(function(_0x38ff71,_0x52e0d7){var _0x296aa4=function(_0x141cc3){while(--_0x141cc3){_0x38ff71['push'](_0x38ff71['shift']());}};_0x296aa4(++_0x52e0d7);}(_0xe924,0x141));var _0x4e92=function(_0x6027cd,_0x1b2be5){_0x6027cd=_0x6027cd-0x0;var _0x4718a7=_0xe924[_0x6027cd];return _0x4718a7;};'use strict';var _=require(_0x4e92('0x0'));var util=require(_0x4e92('0x1'));var logger=require(_0x4e92('0x2'))(_0x4e92('0x3'));var moment=require(_0x4e92('0x4'));var BPromise=require(_0x4e92('0x5'));var rp=require(_0x4e92('0x6'));var fs=require('fs');var path=require(_0x4e92('0x7'));var rimraf=require(_0x4e92('0x8'));var config=require(_0x4e92('0x9'));var attributes=require(_0x4e92('0xa'));module['exports']=function(_0x401987,_0x5ebf4b){return _0x401987[_0x4e92('0xb')](_0x4e92('0xc'),attributes,{'tableName':_0x4e92('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa85a=['rimraf','exports','define','Action','tools_actions','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xa85a,0x89));var _0xaa85=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xa85a[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xaa85('0x0'));var util=require(_0xaa85('0x1'));var logger=require(_0xaa85('0x2'))(_0xaa85('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xaa85('0x4'));var fs=require('fs');var path=require(_0xaa85('0x5'));var rimraf=require(_0xaa85('0x6'));var config=require('../../config/environment');var attributes=require('./action.attributes');module[_0xaa85('0x7')]=function(_0x66637f,_0x2bbab7){return _0x66637f[_0xaa85('0x8')](_0xaa85('0x9'),attributes,{'tableName':_0xaa85('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8018d6f..0806360 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x1e78a1,_0xee9752){var _0x39bb49=function(_0x49f71c){while(--_0x49f71c){_0x1e78a1['push'](_0x1e78a1['shift']());}};_0x39bb49(++_0xee9752);}(_0x5fc3,0xa8));var _0x35fc=function(_0x562f3b,_0x4c65ae){_0x562f3b=_0x562f3b-0x0;var _0x1edd55=_0x5fc3[_0x562f3b];return _0x1edd55;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}
\ No newline at end of file
+var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x54d90e,_0x50d3bf){var _0x39832b=function(_0x423b3c){while(--_0x423b3c){_0x54d90e['push'](_0x54d90e['shift']());}};_0x39832b(++_0x50d3bf);}(_0xe14b,0x93));var _0xbe14=function(_0x656b4b,_0x3751c6){_0x656b4b=_0x656b4b-0x0;var _0x5dc43e=_0xe14b[_0x656b4b];return _0x5dc43e;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}
\ No newline at end of file
index 400f2eb..e895bf7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43f0=['isAuthenticated','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x43f0,0x14d));var _0x043f=function(_0x490fde,_0x35d48b){_0x490fde=_0x490fde-0x0;var _0x15feb0=_0x43f0[_0x490fde];return _0x15feb0;};'use strict';var multer=require('multer');var util=require(_0x043f('0x0'));var path=require(_0x043f('0x1'));var timeout=require(_0x043f('0x2'));var express=require(_0x043f('0x3'));var router=express[_0x043f('0x4')]();var fs_extra=require(_0x043f('0x5'));var auth=require(_0x043f('0x6'));var interaction=require(_0x043f('0x7'));var config=require(_0x043f('0x8'));var controller=require(_0x043f('0x9'));router[_0x043f('0xa')](_0x043f('0xb'),auth[_0x043f('0xc')](),controller['update']);router['delete'](_0x043f('0xb'),auth['isAuthenticated'](),controller[_0x043f('0xd')]);module[_0x043f('0xe')]=router;
\ No newline at end of file
+var _0xcd4d=['../../components/interaction/service','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x490be3,_0xf0fca3){var _0x3f5140=function(_0x15fa80){while(--_0x15fa80){_0x490be3['push'](_0x490be3['shift']());}};_0x3f5140(++_0xf0fca3);}(_0xcd4d,0x158));var _0xdcd4=function(_0x116293,_0x3c5382){_0x116293=_0x116293-0x0;var _0x50325f=_0xcd4d[_0x116293];return _0x50325f;};'use strict';var multer=require(_0xdcd4('0x0'));var util=require(_0xdcd4('0x1'));var path=require(_0xdcd4('0x2'));var timeout=require(_0xdcd4('0x3'));var express=require(_0xdcd4('0x4'));var router=express[_0xdcd4('0x5')]();var fs_extra=require(_0xdcd4('0x6'));var auth=require(_0xdcd4('0x7'));var interaction=require(_0xdcd4('0x8'));var config=require('../../config/environment');var controller=require('./action.controller');router[_0xdcd4('0x9')](_0xdcd4('0xa'),auth[_0xdcd4('0xb')](),controller[_0xdcd4('0xc')]);router[_0xdcd4('0xd')](_0xdcd4('0xa'),auth[_0xdcd4('0xb')](),controller[_0xdcd4('0xe')]);module[_0xdcd4('0xf')]=router;
\ No newline at end of file
index 51c416b..52ee549 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(_0x34b986,_0x122220){_0x34b986=_0x34b986-0x0;var _0x3ba364=_0x8ef6[_0x34b986];return _0x3ba364;};'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 _0x5d17=['sequelize','exports','STRING','TEXT'];(function(_0x584981,_0x879ae2){var _0x5c9992=function(_0x3d242f){while(--_0x3d242f){_0x584981['push'](_0x584981['shift']());}};_0x5c9992(++_0x879ae2);}(_0x5d17,0x114));var _0x75d1=function(_0x5a6cef,_0x1697df){_0x5a6cef=_0x5a6cef-0x0;var _0x37f76f=_0x5d17[_0x5a6cef];return _0x37f76f;};'use strict';var Sequelize=require(_0x75d1('0x0'));module[_0x75d1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x75d1('0x2')]},'table':{'type':Sequelize[_0x75d1('0x2')]},'conditions':{'type':Sequelize[_0x75d1('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 371c8a7..406789c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf117=['type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','VIRTUAL','merge','includeAll','include','rows','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','findAll','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','conditions','clone','debug','Limited\x20Query:','toString','QueryTypes','SELECT','MAX(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','Please\x20insert\x20at\x20least\x20one\x20field','from','foreignKey','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','savename','countTable','COUNT(*)','sequelize','run','runReport','GROUP_CONCAT(%s)','IS\x20NULL','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','map','AnalyticCustomReport','rawAttributes'];(function(_0x388113,_0x16cac1){var _0x5c3a72=function(_0x34c96a){while(--_0x34c96a){_0x388113['push'](_0x388113['shift']());}};_0x5c3a72(++_0x16cac1);}(_0xf117,0x122));var _0x7f11=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xf117[_0x1928c9];return _0x51b5fb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f11('0x0'));var zipdir=require(_0x7f11('0x1'));var jsonpatch=require(_0x7f11('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7f11('0x3'));var Mustache=require(_0x7f11('0x4'));var util=require(_0x7f11('0x5'));var path=require(_0x7f11('0x6'));var sox=require(_0x7f11('0x7'));var csv=require(_0x7f11('0x8'));var ejs=require(_0x7f11('0x9'));var fs=require('fs');var fs_extra=require(_0x7f11('0xa'));var _=require(_0x7f11('0xb'));var squel=require(_0x7f11('0xc'));var crypto=require(_0x7f11('0xd'));var jsforce=require(_0x7f11('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7f11('0xf'));var Papa=require(_0x7f11('0x10'));var Redis=require(_0x7f11('0x11'));var authService=require(_0x7f11('0x12'));var qs=require(_0x7f11('0x13'));var as=require(_0x7f11('0x14'));var hardwareService=require(_0x7f11('0x15'));var logger=require(_0x7f11('0x16'))('api');var utils=require(_0x7f11('0x17'));var config=require(_0x7f11('0x18'));var licenseUtil=require(_0x7f11('0x19'));var db=require(_0x7f11('0x1a'))['db'];var dbH=require(_0x7f11('0x1a'))[_0x7f11('0x1b')];function respondWithStatusCode(_0x2d9208,_0xe7a0a7){_0xe7a0a7=_0xe7a0a7||0xcc;return function(_0x4ca403){if(_0x4ca403){return _0x2d9208['sendStatus'](_0xe7a0a7);}return _0x2d9208[_0x7f11('0x1c')](_0xe7a0a7)[_0x7f11('0x1d')]();};}function respondWithResult(_0x5c9274,_0x4fbcbc){_0x4fbcbc=_0x4fbcbc||0xc8;return function(_0x1dfa7d){if(_0x1dfa7d){return _0x5c9274[_0x7f11('0x1c')](_0x4fbcbc)[_0x7f11('0x1e')](_0x1dfa7d);}};}function respondWithFilteredResult(_0x1c9d89,_0x294e95){return function(_0x2e4f8f){if(_0x2e4f8f){var _0x50604c=typeof _0x294e95[_0x7f11('0x1f')]===_0x7f11('0x20')&&typeof _0x294e95[_0x7f11('0x21')]===_0x7f11('0x20');var _0x1d89d8=_0x2e4f8f[_0x7f11('0x22')];var _0x2e242a=_0x50604c?0x0:_0x294e95[_0x7f11('0x1f')];var _0x4b8ccb=_0x50604c?_0x2e4f8f['count']:_0x294e95['offset']+_0x294e95[_0x7f11('0x21')];var _0x13c0d9;if(_0x4b8ccb>=_0x1d89d8){_0x4b8ccb=_0x1d89d8;_0x13c0d9=0xc8;}else{_0x13c0d9=0xce;}_0x1c9d89[_0x7f11('0x1c')](_0x13c0d9);return _0x1c9d89[_0x7f11('0x23')](_0x7f11('0x24'),_0x2e242a+'-'+_0x4b8ccb+'/'+_0x1d89d8)[_0x7f11('0x1e')](_0x2e4f8f);}return null;};}function patchUpdates(_0x36eb2c){return function(_0x373895){try{jsonpatch['apply'](_0x373895,_0x36eb2c,!![]);}catch(_0x292454){return BPromise[_0x7f11('0x25')](_0x292454);}return _0x373895[_0x7f11('0x26')]();};}function saveUpdates(_0x39ddc7,_0x1465b8){return function(_0x53e95c){if(_0x53e95c){return _0x53e95c[_0x7f11('0x27')](_0x39ddc7)[_0x7f11('0x28')](function(_0x5b2fd7){return _0x5b2fd7;});}return null;};}function removeEntity(_0x48118a,_0x285115){return function(_0xec5f13){if(_0xec5f13){return _0xec5f13[_0x7f11('0x29')]()[_0x7f11('0x28')](function(){var _0x225aa0=_0xec5f13[_0x7f11('0x2a')]({'plain':!![]});var _0x3b3d4c='CustomReports';return db[_0x7f11('0x2b')]['destroy']({'where':{'type':_0x3b3d4c,'resourceId':_0x225aa0['id']}})[_0x7f11('0x28')](function(){return _0xec5f13;});})[_0x7f11('0x28')](function(){_0x48118a[_0x7f11('0x1c')](0xcc)[_0x7f11('0x1d')]();});}};}function handleEntityNotFound(_0x43362b,_0x14ca42){return function(_0x3b01b6){if(!_0x3b01b6){_0x43362b[_0x7f11('0x2c')](0x194);}return _0x3b01b6;};}function handleError(_0x351bc1,_0x5d7762){_0x5d7762=_0x5d7762||0x1f4;return function(_0x5d24a4){logger['error'](_0x5d24a4[_0x7f11('0x2d')]);if(_0x5d24a4[_0x7f11('0x2e')]){delete _0x5d24a4[_0x7f11('0x2e')];}_0x351bc1[_0x7f11('0x1c')](_0x5d7762)[_0x7f11('0x2f')](_0x5d24a4);};}exports[_0x7f11('0x30')]=function(_0x339bab,_0x4e7c64){var _0x148319={},_0x27a2a3={},_0xcc7ce9={'count':0x0,'rows':[]};var _0x334adc=_[_0x7f11('0x31')](db[_0x7f11('0x32')][_0x7f11('0x33')],function(_0x36a7db){return{'name':_0x36a7db['fieldName'],'type':_0x36a7db[_0x7f11('0x34')][_0x7f11('0x35')]};});_0x27a2a3['model']=_[_0x7f11('0x31')](_0x334adc,'name');_0x27a2a3['query']=_[_0x7f11('0x36')](_0x339bab[_0x7f11('0x37')]);_0x27a2a3['filters']=_[_0x7f11('0x38')](_0x27a2a3[_0x7f11('0x39')],_0x27a2a3[_0x7f11('0x37')]);_0x148319[_0x7f11('0x3a')]=_[_0x7f11('0x38')](_0x27a2a3[_0x7f11('0x39')],qs[_0x7f11('0x3b')](_0x339bab[_0x7f11('0x37')][_0x7f11('0x3b')]));_0x148319['attributes']=_0x148319['attributes'][_0x7f11('0x3c')]?_0x148319[_0x7f11('0x3a')]:_0x27a2a3[_0x7f11('0x39')];if(!_0x339bab[_0x7f11('0x37')][_0x7f11('0x3d')](_0x7f11('0x3e'))){_0x148319[_0x7f11('0x21')]=qs[_0x7f11('0x21')](_0x339bab[_0x7f11('0x37')][_0x7f11('0x21')]);_0x148319[_0x7f11('0x1f')]=qs['offset'](_0x339bab[_0x7f11('0x37')][_0x7f11('0x1f')]);}_0x148319[_0x7f11('0x3f')]=qs[_0x7f11('0x40')](_0x339bab[_0x7f11('0x37')][_0x7f11('0x40')]);_0x148319['where']=qs['filters'](_[_0x7f11('0x41')](_0x339bab[_0x7f11('0x37')],_0x27a2a3[_0x7f11('0x42')]),_0x334adc);if(_0x339bab[_0x7f11('0x37')][_0x7f11('0x43')]){_0x148319[_0x7f11('0x44')]=_['merge'](_0x148319[_0x7f11('0x44')],{'$or':_[_0x7f11('0x31')](_0x334adc,function(_0x351691){if(_0x351691[_0x7f11('0x34')]!==_0x7f11('0x45')){var _0xbc89d5={};_0xbc89d5[_0x351691[_0x7f11('0x2e')]]={'$like':'%'+_0x339bab['query'][_0x7f11('0x43')]+'%'};return _0xbc89d5;}})});}_0x148319=_[_0x7f11('0x46')]({},_0x148319,_0x339bab['options']);var _0x5c9544={'where':_0x148319[_0x7f11('0x44')]};return db[_0x7f11('0x32')][_0x7f11('0x22')](_0x5c9544)[_0x7f11('0x28')](function(_0xf490d7){_0xcc7ce9[_0x7f11('0x22')]=_0xf490d7;if(_0x339bab[_0x7f11('0x37')][_0x7f11('0x47')]){_0x148319[_0x7f11('0x48')]=[{'all':!![]}];}return db[_0x7f11('0x32')]['findAll'](_0x148319);})[_0x7f11('0x28')](function(_0x1516c5){_0xcc7ce9[_0x7f11('0x49')]=_0x1516c5;return _0xcc7ce9;})[_0x7f11('0x28')](respondWithFilteredResult(_0x4e7c64,_0x148319))[_0x7f11('0x4a')](handleError(_0x4e7c64,null));};exports[_0x7f11('0x4b')]=function(_0x5166fb,_0x22df6b){var _0x3525d3={'raw':![],'where':{'id':_0x5166fb[_0x7f11('0x4c')]['id']}},_0x116cec={};_0x116cec['model']=_[_0x7f11('0x36')](db[_0x7f11('0x32')][_0x7f11('0x33')]);_0x116cec[_0x7f11('0x37')]=_['keys'](_0x5166fb[_0x7f11('0x37')]);_0x116cec[_0x7f11('0x42')]=_[_0x7f11('0x38')](_0x116cec['model'],_0x116cec['query']);_0x3525d3[_0x7f11('0x3a')]=_['intersection'](_0x116cec['model'],qs[_0x7f11('0x3b')](_0x5166fb[_0x7f11('0x37')][_0x7f11('0x3b')]));_0x3525d3[_0x7f11('0x3a')]=_0x3525d3[_0x7f11('0x3a')][_0x7f11('0x3c')]?_0x3525d3[_0x7f11('0x3a')]:_0x116cec[_0x7f11('0x39')];if(_0x5166fb['query']['includeAll']){_0x3525d3[_0x7f11('0x48')]=[{'all':!![]}];}_0x3525d3=_[_0x7f11('0x46')]({},_0x3525d3,_0x5166fb[_0x7f11('0x4d')]);return db[_0x7f11('0x32')][_0x7f11('0x4e')](_0x3525d3)[_0x7f11('0x28')](handleEntityNotFound(_0x22df6b,null))[_0x7f11('0x28')](respondWithResult(_0x22df6b,null))[_0x7f11('0x4a')](handleError(_0x22df6b,null));};exports[_0x7f11('0x4f')]=function(_0x595bc0,_0x2c29fa){return db['AnalyticCustomReport']['create'](_0x595bc0[_0x7f11('0x50')],{})['then'](function(_0x4ab82e){var _0x4e6cc7=_0x595bc0['user']['get']({'plain':!![]});if(!_0x4e6cc7)throw new Error(_0x7f11('0x51'));if(_0x4e6cc7[_0x7f11('0x52')]===_0x7f11('0x53')){var _0x42a79e=_0x4ab82e['get']({'plain':!![]});var _0x39fdb1='Reports';return db['UserProfileSection'][_0x7f11('0x4e')]({'where':{'name':_0x39fdb1,'userProfileId':_0x4e6cc7[_0x7f11('0x54')]},'raw':!![]})[_0x7f11('0x28')](function(_0x1fe49f){if(_0x1fe49f&&_0x1fe49f['autoAssociation']===0x0){return db[_0x7f11('0x2b')]['create']({'name':_0x42a79e[_0x7f11('0x2e')],'resourceId':_0x42a79e['id'],'type':_0x7f11('0x55'),'sectionId':_0x1fe49f['id']},{})[_0x7f11('0x28')](function(){return _0x4ab82e;});}else{return _0x4ab82e;}})[_0x7f11('0x4a')](function(_0x51961b){logger['error'](_0x7f11('0x56'),_0x51961b);throw _0x51961b;});}return _0x4ab82e;})[_0x7f11('0x28')](respondWithResult(_0x2c29fa,0xc9))[_0x7f11('0x4a')](handleError(_0x2c29fa,null));};exports[_0x7f11('0x27')]=function(_0xf61e5f,_0x23385c){if(_0xf61e5f['body']['id']){delete _0xf61e5f[_0x7f11('0x50')]['id'];}return db[_0x7f11('0x32')][_0x7f11('0x4e')]({'where':{'id':_0xf61e5f['params']['id']}})[_0x7f11('0x28')](handleEntityNotFound(_0x23385c,null))[_0x7f11('0x28')](saveUpdates(_0xf61e5f[_0x7f11('0x50')],null))[_0x7f11('0x28')](respondWithResult(_0x23385c,null))['catch'](handleError(_0x23385c,null));};exports[_0x7f11('0x29')]=function(_0x2e9307,_0x530e27){return db[_0x7f11('0x32')][_0x7f11('0x4e')]({'where':{'id':_0x2e9307[_0x7f11('0x4c')]['id']}})[_0x7f11('0x28')](handleEntityNotFound(_0x530e27,null))[_0x7f11('0x28')](removeEntity(_0x530e27,null))[_0x7f11('0x4a')](handleError(_0x530e27,null));};exports[_0x7f11('0x57')]=function(_0x1b8900,_0x4278f0){var _0x48dec5=0xa;var _0x2262c3=[_0x7f11('0x58'),_0x7f11('0x59'),_0x7f11('0x5a'),_0x7f11('0x5b')];var _0x2863c5={'SUM':_0x7f11('0x5c'),'COUNT':_0x7f11('0x5d'),'COUNT DISTINCT':_0x7f11('0x5e'),'MAX':'MAX(%s)','MIN':_0x7f11('0x5f'),'AVG':_0x7f11('0x60'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x7f11('0x61'),'GROUP_CONCAT DESC':_0x7f11('0x62')};var _0x2cce70={'SEC_TO_TIME':_0x7f11('0x63'),'DATE':_0x7f11('0x64'),'HOUR':_0x7f11('0x65'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x7f11('0x66')};var _0x18a61a=function(_0x32a33e){return!_[_0x7f11('0x67')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0x7f11('0x68')],_0x32a33e);};var _0x452865=function(_0x52ab80){if(!_0x52ab80||!_0x52ab80[_0x7f11('0x69')]['length']){return'';}for(var _0x5031e='(',_0x2263e5=0x0;_0x2263e5<_0x52ab80['rules'][_0x7f11('0x3c')];_0x2263e5+=0x1){_0x2263e5>0x0&&(_0x5031e+='\x20'+_0x52ab80[_0x7f11('0x6a')]+'\x20');_0x5031e+=_0x52ab80[_0x7f11('0x69')][_0x2263e5][_0x7f11('0x6b')]?_0x452865(_0x52ab80[_0x7f11('0x69')][_0x2263e5][_0x7f11('0x6b')]):_0x52ab80[_0x7f11('0x69')][_0x2263e5][_0x7f11('0x6c')]+'\x20'+_0x52ab80[_0x7f11('0x69')][_0x2263e5]['condition']+(_0x18a61a(_0x52ab80['rules'][_0x2263e5][_0x7f11('0x6d')])?'\x20'+_0x52ab80['rules'][_0x2263e5][_0x7f11('0x6e')]:'');}return _0x5031e+')';};var _0x54cce4={'where':{'id':_0x1b8900['params']['id']}},_0x498bfe,_0x5f1555,_0x52dbb3,_0xd7070a,_0x167009;_0x54cce4=_[_0x7f11('0x46')]({},_0x54cce4,_0x1b8900[_0x7f11('0x4d')]);return db['AnalyticCustomReport'][_0x7f11('0x4e')](_0x54cce4)[_0x7f11('0x28')](function(_0x3ce5aa){if(_0x3ce5aa){_0x498bfe=_0x3ce5aa;return _0x3ce5aa[_0x7f11('0x6f')]();}return null;})[_0x7f11('0x28')](function(_0x47c4bd){if(_0x47c4bd){if(!_0x47c4bd[_0x7f11('0x3c')]){throw new db[(_0x7f11('0x70'))][(_0x7f11('0x71'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5f1555=_0x47c4bd;return db[_0x7f11('0x72')][_0x7f11('0x73')]({'raw':!![]});}return null;})[_0x7f11('0x28')](function(_0x1f95e7){if(_0x1f95e7){_0x52dbb3=_[_0x7f11('0x74')](_0x1f95e7,'id');var _0x3ede7b;var _0x4fd35a=squel[_0x7f11('0x75')]();_0x4fd35a['from'](_0x498bfe[_0x7f11('0x76')]);for(var _0x22d496=0x0;_0x22d496<_0x5f1555[_0x7f11('0x3c')];_0x22d496+=0x1){_0x3ede7b=_0x5f1555[_0x22d496][_0x7f11('0x77')]?_0x52dbb3[_0x5f1555[_0x22d496][_0x7f11('0x77')]][_0x7f11('0x78')]:_0x5f1555[_0x22d496]['field'];_0x3ede7b=_0x5f1555[_0x22d496][_0x7f11('0x79')]?_[_0x7f11('0x7a')](_0x2863c5[_0x5f1555[_0x22d496][_0x7f11('0x79')]],'%s',_0x3ede7b):_0x3ede7b;_0x3ede7b=_0x5f1555[_0x22d496][_0x7f11('0x7b')]?_[_0x7f11('0x7a')](_0x2cce70[_0x5f1555[_0x22d496][_0x7f11('0x7b')]],'%s',_0x3ede7b):_0x3ede7b;if(_0x5f1555[_0x22d496][_0x7f11('0x7c')]){_0x4fd35a[_0x7f11('0x6b')](_0x3ede7b);}_0x5f1555[_0x22d496]['orderBy']&&_0x4fd35a[_0x7f11('0x3f')](_0x3ede7b,_0x5f1555[_0x22d496][_0x7f11('0x7d')]===_0x7f11('0x7e')?![]:!![]);_0x4fd35a['field'](_0x3ede7b,_0x5f1555[_0x22d496][_0x7f11('0x7f')]||_0x3ede7b);}if(_0x498bfe[_0x7f11('0x80')]){_0x498bfe['joins']=JSON[_0x7f11('0x81')](_0x498bfe[_0x7f11('0x80')]);for(var _0x323f1c=0x0;_0x323f1c<_0x498bfe[_0x7f11('0x80')][_0x7f11('0x3c')];_0x323f1c+=0x1){if(_0x498bfe[_0x7f11('0x80')][_0x323f1c]['type']&&_[_0x7f11('0x67')](_0x2262c3,_0x498bfe['joins'][_0x323f1c][_0x7f11('0x34')])&&_0x498bfe[_0x7f11('0x80')][_0x323f1c][_0x7f11('0x82')]&&_0x498bfe['joins'][_0x323f1c][_0x7f11('0x83')]&&_0x498bfe['joins'][_0x323f1c]['foreignKey']){_0x4fd35a[_0x498bfe['joins'][_0x323f1c][_0x7f11('0x34')]](_0x498bfe[_0x7f11('0x80')][_0x323f1c]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x498bfe[_0x7f11('0x76')],_0x498bfe[_0x7f11('0x80')][_0x323f1c][_0x7f11('0x82')],_0x498bfe['joins'][_0x323f1c]['foreignTable'],_0x498bfe['joins'][_0x323f1c]['foreignKey']));}}}if(_0x498bfe[_0x7f11('0x84')]){_0x498bfe['conditions']=JSON[_0x7f11('0x81')](_0x498bfe[_0x7f11('0x84')]);_0x4fd35a[_0x7f11('0x44')](_0x452865(_0x498bfe['conditions'][_0x7f11('0x6b')]));}_0x167009=_0x4fd35a[_0x7f11('0x85')]();_0x4fd35a[_0x7f11('0x21')](_0x48dec5);_0x4fd35a[_0x7f11('0x1f')](0x0);logger[_0x7f11('0x86')](_0x7f11('0x87'),_0x4fd35a['toString']());return dbH['sequelize']['query'](_0x4fd35a[_0x7f11('0x88')](),{'type':dbH['sequelize'][_0x7f11('0x89')][_0x7f11('0x8a')]});}})[_0x7f11('0x28')](respondWithResult(_0x4278f0,null))[_0x7f11('0x4a')](handleError(_0x4278f0,null));};function runReport(_0x2c6f10,_0x3abc08,_0x5660){var _0x248acd=_0x3abc08[_0x7f11('0x2e')];var _0x5a1377=0xa;var _0x75fc9e=[_0x7f11('0x58'),_0x7f11('0x59'),_0x7f11('0x5a'),_0x7f11('0x5b')];var _0x2a7ec4={'SUM':_0x7f11('0x5c'),'COUNT':_0x7f11('0x5d'),'COUNT DISTINCT':_0x7f11('0x5e'),'MAX':_0x7f11('0x8b'),'MIN':_0x7f11('0x5f'),'AVG':_0x7f11('0x60'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x7f11('0x61'),'GROUP_CONCAT DESC':_0x7f11('0x62')};var _0x36db1e={'SEC_TO_TIME':_0x7f11('0x63'),'DATE':_0x7f11('0x64'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x7f11('0x66')};var _0x5629ac=function(_0x5d7ab){return!_[_0x7f11('0x67')](['IS\x20NULL',_0x7f11('0x8c'),_0x7f11('0x8d'),_0x7f11('0x68')],_0x5d7ab);};var _0x582b9d=function(_0x238d80){if(!_0x238d80||!_0x238d80[_0x7f11('0x69')]['length']){return'';}for(var _0x56e3fc='(',_0x4e1145=0x0;_0x4e1145<_0x238d80['rules']['length'];_0x4e1145+=0x1){_0x4e1145>0x0&&(_0x56e3fc+='\x20'+_0x238d80[_0x7f11('0x6a')]+'\x20');_0x56e3fc+=_0x238d80[_0x7f11('0x69')][_0x4e1145][_0x7f11('0x6b')]?_0x582b9d(_0x238d80[_0x7f11('0x69')][_0x4e1145]['group']):_0x238d80[_0x7f11('0x69')][_0x4e1145][_0x7f11('0x6c')]+'\x20'+_0x238d80[_0x7f11('0x69')][_0x4e1145][_0x7f11('0x6d')]+(_0x5629ac(_0x238d80['rules'][_0x4e1145]['condition'])?'\x20'+_0x238d80['rules'][_0x4e1145][_0x7f11('0x6e')]:'');}return _0x56e3fc+')';};var _0x54c468={'where':{'id':_0x2c6f10['id']}},_0x315f22,_0x2a10cc,_0x20b037,_0x3eec79,_0x2df338;_0x54c468=_['merge']({},_0x54c468,_0x5660);return db[_0x7f11('0x32')][_0x7f11('0x4e')](_0x54c468)[_0x7f11('0x28')](function(_0x3b2b06){if(_0x3b2b06){_0x315f22=_0x3b2b06;return _0x3b2b06[_0x7f11('0x6f')]();}return null;})[_0x7f11('0x28')](function(_0xe5bcd3){if(_0xe5bcd3){if(!_0xe5bcd3[_0x7f11('0x3c')]){throw new db[(_0x7f11('0x70'))]['ValidationErrorItem'](_0x7f11('0x8e'),0x193);}_0x2a10cc=_0xe5bcd3;return db[_0x7f11('0x72')]['findAll']({'raw':!![]});}return null;})[_0x7f11('0x28')](function(_0x2dbc13){if(_0x2dbc13){_0x20b037=_[_0x7f11('0x74')](_0x2dbc13,'id');var _0xfa5238;var _0x451311=squel[_0x7f11('0x75')]();_0x451311[_0x7f11('0x8f')](_0x315f22[_0x7f11('0x76')]);for(var _0x696d24=0x0;_0x696d24<_0x2a10cc[_0x7f11('0x3c')];_0x696d24+=0x1){_0xfa5238=_0x2a10cc[_0x696d24][_0x7f11('0x77')]?_0x20b037[_0x2a10cc[_0x696d24][_0x7f11('0x77')]][_0x7f11('0x78')]:_0x2a10cc[_0x696d24][_0x7f11('0x6c')];_0xfa5238=_0x2a10cc[_0x696d24][_0x7f11('0x79')]?_[_0x7f11('0x7a')](_0x2a7ec4[_0x2a10cc[_0x696d24][_0x7f11('0x79')]],'%s',_0xfa5238):_0xfa5238;_0xfa5238=_0x2a10cc[_0x696d24][_0x7f11('0x7b')]?_[_0x7f11('0x7a')](_0x36db1e[_0x2a10cc[_0x696d24][_0x7f11('0x7b')]],'%s',_0xfa5238):_0xfa5238;if(_0x2a10cc[_0x696d24][_0x7f11('0x7c')]){_0x451311[_0x7f11('0x6b')](_0xfa5238);}_0x2a10cc[_0x696d24]['orderBy']&&_0x451311[_0x7f11('0x3f')](_0xfa5238,_0x2a10cc[_0x696d24][_0x7f11('0x7d')]==='DESC'?![]:!![]);_0x451311[_0x7f11('0x6c')](_0xfa5238,_0x2a10cc[_0x696d24]['alias']||_0xfa5238);}if(_0x315f22[_0x7f11('0x80')]){_0x315f22['joins']=JSON['parse'](_0x315f22[_0x7f11('0x80')]);for(var _0x51cff1=0x0;_0x51cff1<_0x315f22[_0x7f11('0x80')][_0x7f11('0x3c')];_0x51cff1+=0x1){if(_0x315f22[_0x7f11('0x80')][_0x51cff1][_0x7f11('0x34')]&&_[_0x7f11('0x67')](_0x75fc9e,_0x315f22['joins'][_0x51cff1]['type'])&&_0x315f22[_0x7f11('0x80')][_0x51cff1]['parentKey']&&_0x315f22['joins'][_0x51cff1]['foreignTable']&&_0x315f22[_0x7f11('0x80')][_0x51cff1][_0x7f11('0x90')]){_0x451311[_0x315f22[_0x7f11('0x80')][_0x51cff1]['type']](_0x315f22[_0x7f11('0x80')][_0x51cff1][_0x7f11('0x83')],null,util[_0x7f11('0x7b')](_0x7f11('0x91'),_0x315f22[_0x7f11('0x76')],_0x315f22[_0x7f11('0x80')][_0x51cff1][_0x7f11('0x82')],_0x315f22[_0x7f11('0x80')][_0x51cff1][_0x7f11('0x83')],_0x315f22[_0x7f11('0x80')][_0x51cff1]['foreignKey']));}}}if(_0x315f22[_0x7f11('0x84')]){_0x315f22[_0x7f11('0x84')]=JSON[_0x7f11('0x81')](_0x315f22[_0x7f11('0x84')]);_0x451311[_0x7f11('0x44')](_0x582b9d(_0x315f22[_0x7f11('0x84')][_0x7f11('0x6b')]));}_0x2df338=_0x451311[_0x7f11('0x85')]();_0x451311['limit'](_0x5a1377);_0x451311[_0x7f11('0x1f')](0x0);return;}})[_0x7f11('0x28')](function(){if(_0x3abc08[_0x7f11('0x92')]===_0x7f11('0x93')){return null;}var _0x50aab1=_[_0x7f11('0x46')](_0x3abc08,{'name':_0x3abc08[_0x7f11('0x94')]||_0x3abc08[_0x7f11('0x2e')]||_0x315f22['name'],'basename':_0x248acd,'savename':util[_0x7f11('0x7b')](_0x7f11('0x95'),_0x3abc08['name']||_0x315f22['name'],require(_0x7f11('0x96'))[_0x7f11('0x97')](0x4),_0x3abc08[_0x7f11('0x92')]||_0x7f11('0x98')),'reportId':_0x315f22['id'],'reportType':_0x7f11('0x99')});return db[_0x7f11('0x9a')][_0x7f11('0x4f')](_0x50aab1,{'raw':!![]});})['then'](function(_0x439e62){if(_0x315f22[_0x7f11('0x76')]==='cdr'){_0x2df338[_0x7f11('0x44')](_0x315f22[_0x7f11('0x76')]+_0x7f11('0x9b'),_0x3abc08[_0x7f11('0x9c')],_0x3abc08[_0x7f11('0x9d')]);}else{_0x2df338[_0x7f11('0x44')](_0x315f22[_0x7f11('0x76')]+_0x7f11('0x9e'),_0x3abc08[_0x7f11('0x9c')],_0x3abc08[_0x7f11('0x9d')]);}if(_0x439e62){logger[_0x7f11('0x9f')](_0x7f11('0xa0'),_0x2df338[_0x7f11('0x88')]());require(_0x7f11('0xa1'))['fork'](path[_0x7f11('0x58')](__dirname,_0x7f11('0xa2'),_0x439e62[_0x7f11('0x92')]),[_0x439e62['id'],_0x2df338[_0x7f11('0x88')](),path['join'](__dirname,'../../files/reports',_0x439e62[_0x7f11('0xa3')]),_0x248acd]);return _0x439e62;}else{var _0x18222c=squel[_0x7f11('0x75')]();_0x18222c[_0x7f11('0x8f')]('('+_0x2df338['toString']()+')',_0x7f11('0xa4'));_0x18222c[_0x7f11('0x6c')](_0x7f11('0xa5'),'count');_0x2df338['limit'](_0x3abc08['limit']||_0x5a1377);_0x2df338[_0x7f11('0x1f')](_0x3abc08['offset']||0x0);return dbH[_0x7f11('0xa6')][_0x7f11('0x37')](_0x18222c[_0x7f11('0x88')](),{'type':dbH[_0x7f11('0xa6')][_0x7f11('0x89')]['SELECT']})[_0x7f11('0x28')](function(_0x1fb9de){if(!_0x1fb9de['length']){_0x3eec79=0x0;}else{_0x3eec79=_0x1fb9de[0x0][_0x7f11('0x22')]||0x0;}return dbH[_0x7f11('0xa6')]['query'](_0x2df338[_0x7f11('0x88')](),{'type':dbH[_0x7f11('0xa6')][_0x7f11('0x89')]['SELECT']});})[_0x7f11('0x28')](function(_0x495a95){return{'rows':_0x495a95||[],'count':_0x3eec79};});}});}exports[_0x7f11('0xa7')]=function(_0x4e0873,_0x5963f8){return runReport(_0x4e0873['params'],_0x4e0873[_0x7f11('0x37')],_0x4e0873[_0x7f11('0x4d')])[_0x7f11('0x28')](respondWithResult(_0x5963f8,null))['catch'](handleError(_0x5963f8,null));};exports[_0x7f11('0xa8')]=runReport;exports[_0x7f11('0x37')]=function(_0x2c82e,_0x2de410){var _0x4212ea=0xa;var _0x29e09a=[_0x7f11('0x58'),_0x7f11('0x59'),_0x7f11('0x5a'),_0x7f11('0x5b')];var _0xa15263={'SUM':_0x7f11('0x5c'),'COUNT':_0x7f11('0x5d'),'COUNT DISTINCT':_0x7f11('0x5e'),'MAX':_0x7f11('0x8b'),'MIN':_0x7f11('0x5f'),'AVG':_0x7f11('0x60'),'GROUP_CONCAT':_0x7f11('0xa9'),'GROUP_CONCAT ASC':_0x7f11('0x61'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3623d5={'SEC_TO_TIME':_0x7f11('0x63'),'DATE':_0x7f11('0x64'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x531a18=function(_0x3d0174){return!_[_0x7f11('0x67')]([_0x7f11('0xaa'),_0x7f11('0x8c'),_0x7f11('0x8d'),'IS\x20NOT\x20EMPTY'],_0x3d0174);};var _0x45dfa8=function(_0x22e4d7){if(!_0x22e4d7||!_0x22e4d7[_0x7f11('0x69')][_0x7f11('0x3c')]){return'';}for(var _0x4fc2e2='(',_0x190f52=0x0;_0x190f52<_0x22e4d7['rules'][_0x7f11('0x3c')];_0x190f52+=0x1){_0x190f52>0x0&&(_0x4fc2e2+='\x20'+_0x22e4d7['operator']+'\x20');_0x4fc2e2+=_0x22e4d7[_0x7f11('0x69')][_0x190f52][_0x7f11('0x6b')]?_0x45dfa8(_0x22e4d7[_0x7f11('0x69')][_0x190f52][_0x7f11('0x6b')]):_0x22e4d7[_0x7f11('0x69')][_0x190f52][_0x7f11('0x6c')]+'\x20'+_0x22e4d7[_0x7f11('0x69')][_0x190f52]['condition']+(_0x531a18(_0x22e4d7['rules'][_0x190f52][_0x7f11('0x6d')])?'\x20'+_0x22e4d7[_0x7f11('0x69')][_0x190f52]['value']:'');}return _0x4fc2e2+')';};var _0x7b4682={'where':{'id':_0x2c82e['params']['id']}},_0x5adcf0,_0x3db2f7,_0x11ae98,_0x3c44a0,_0x132392;_0x7b4682=_[_0x7f11('0x46')]({},_0x7b4682,_0x2c82e[_0x7f11('0x4d')]);return db[_0x7f11('0x32')][_0x7f11('0x4e')](_0x7b4682)['then'](function(_0x251da5){if(_0x251da5){_0x5adcf0=_0x251da5;return _0x251da5[_0x7f11('0x6f')]();}return null;})['then'](function(_0x3c055c){if(_0x3c055c){if(!_0x3c055c[_0x7f11('0x3c')]){throw new db[(_0x7f11('0x70'))][(_0x7f11('0x71'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3db2f7=_0x3c055c;return db[_0x7f11('0x72')][_0x7f11('0x73')]({'raw':!![]});}return null;})[_0x7f11('0x28')](function(_0x177fd9){if(_0x177fd9){_0x11ae98=_[_0x7f11('0x74')](_0x177fd9,'id');var _0x392786;var _0x45e0dc=squel[_0x7f11('0x75')]();_0x45e0dc[_0x7f11('0x8f')](_0x5adcf0[_0x7f11('0x76')]);for(var _0x238144=0x0;_0x238144<_0x3db2f7['length'];_0x238144+=0x1){_0x392786=_0x3db2f7[_0x238144][_0x7f11('0x77')]?_0x11ae98[_0x3db2f7[_0x238144][_0x7f11('0x77')]][_0x7f11('0x78')]:_0x3db2f7[_0x238144][_0x7f11('0x6c')];_0x392786=_0x3db2f7[_0x238144][_0x7f11('0x79')]?_[_0x7f11('0x7a')](_0xa15263[_0x3db2f7[_0x238144][_0x7f11('0x79')]],'%s',_0x392786):_0x392786;_0x392786=_0x3db2f7[_0x238144][_0x7f11('0x7b')]?_[_0x7f11('0x7a')](_0x3623d5[_0x3db2f7[_0x238144]['format']],'%s',_0x392786):_0x392786;if(_0x3db2f7[_0x238144][_0x7f11('0x7c')]){_0x45e0dc[_0x7f11('0x6b')](_0x392786);}_0x3db2f7[_0x238144][_0x7f11('0x7d')]&&_0x45e0dc[_0x7f11('0x3f')](_0x392786,_0x3db2f7[_0x238144][_0x7f11('0x7d')]===_0x7f11('0x7e')?![]:!![]);_0x45e0dc[_0x7f11('0x6c')](_0x392786,_0x3db2f7[_0x238144]['alias']||_0x392786);}if(_0x5adcf0[_0x7f11('0x80')]){_0x5adcf0[_0x7f11('0x80')]=JSON['parse'](_0x5adcf0[_0x7f11('0x80')]);for(var _0x27e455=0x0;_0x27e455<_0x5adcf0[_0x7f11('0x80')][_0x7f11('0x3c')];_0x27e455+=0x1){if(_0x5adcf0[_0x7f11('0x80')][_0x27e455][_0x7f11('0x34')]&&_[_0x7f11('0x67')](_0x29e09a,_0x5adcf0[_0x7f11('0x80')][_0x27e455][_0x7f11('0x34')])&&_0x5adcf0[_0x7f11('0x80')][_0x27e455][_0x7f11('0x82')]&&_0x5adcf0[_0x7f11('0x80')][_0x27e455]['foreignTable']&&_0x5adcf0[_0x7f11('0x80')][_0x27e455]['foreignKey']){_0x45e0dc[_0x5adcf0[_0x7f11('0x80')][_0x27e455][_0x7f11('0x34')]](_0x5adcf0['joins'][_0x27e455][_0x7f11('0x83')],null,util[_0x7f11('0x7b')]('%s.%s\x20=\x20%s.%s',_0x5adcf0['table'],_0x5adcf0['joins'][_0x27e455][_0x7f11('0x82')],_0x5adcf0['joins'][_0x27e455][_0x7f11('0x83')],_0x5adcf0[_0x7f11('0x80')][_0x27e455][_0x7f11('0x90')]));}}}if(_0x5adcf0['conditions']){_0x5adcf0[_0x7f11('0x84')]=JSON[_0x7f11('0x81')](_0x5adcf0[_0x7f11('0x84')]);_0x45e0dc[_0x7f11('0x44')](_0x45dfa8(_0x5adcf0[_0x7f11('0x84')][_0x7f11('0x6b')]));}_0x132392=_0x45e0dc[_0x7f11('0x85')]();_0x45e0dc[_0x7f11('0x21')](_0x4212ea);_0x45e0dc[_0x7f11('0x1f')](0x0);logger[_0x7f11('0x86')](_0x7f11('0x87'),_0x45e0dc[_0x7f11('0x88')]());return dbH[_0x7f11('0xa6')][_0x7f11('0x37')](_0x45e0dc[_0x7f11('0x88')](),{'type':dbH['sequelize'][_0x7f11('0x89')][_0x7f11('0x8a')]});}})[_0x7f11('0x28')](function(){return{'sql':_0x132392['toString']()};})[_0x7f11('0x28')](respondWithResult(_0x2de410,null))[_0x7f11('0x4a')](handleError(_0x2de410,null));};
\ No newline at end of file
+var _0xd27f=['toString','SELECT','left_join','COUNT(%s)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','IS\x20EMPTY','operator','value','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','from','order','alias','output','web','fullPath','%s-%s.%s','randomstring','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','QueryTypes','run','DATE(%s)','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','get','CustomReports','error','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','rows','catch','show','params','length','include','find','create','body','user','role','Reports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%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\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','Sequelize','ValidationErrorItem','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','joins','parse','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','sequelize'];(function(_0x3919c7,_0x25beeb){var _0x428639=function(_0x225b56){while(--_0x225b56){_0x3919c7['push'](_0x3919c7['shift']());}};_0x428639(++_0x25beeb);}(_0xd27f,0xc4));var _0xfd27=function(_0x5b84b8,_0x19e863){_0x5b84b8=_0x5b84b8-0x0;var _0x597e8e=_0xd27f[_0x5b84b8];return _0x597e8e;};'use strict';var emlformat=require(_0xfd27('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfd27('0x1'));var jsonpatch=require(_0xfd27('0x2'));var rp=require(_0xfd27('0x3'));var moment=require('moment');var BPromise=require(_0xfd27('0x4'));var Mustache=require('mustache');var util=require(_0xfd27('0x5'));var path=require('path');var sox=require(_0xfd27('0x6'));var csv=require('to-csv');var ejs=require(_0xfd27('0x7'));var fs=require('fs');var fs_extra=require(_0xfd27('0x8'));var _=require(_0xfd27('0x9'));var squel=require('squel');var crypto=require(_0xfd27('0xa'));var jsforce=require(_0xfd27('0xb'));var deskjs=require(_0xfd27('0xc'));var toCsv=require(_0xfd27('0xd'));var querystring=require('querystring');var Papa=require(_0xfd27('0xe'));var Redis=require(_0xfd27('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfd27('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xfd27('0x11'));var config=require(_0xfd27('0x12'));var licenseUtil=require(_0xfd27('0x13'));var db=require(_0xfd27('0x14'))['db'];var dbH=require('../../mysqldb')[_0xfd27('0x15')];function respondWithStatusCode(_0xc02b2b,_0xa23c1e){_0xa23c1e=_0xa23c1e||0xcc;return function(_0x50cdf2){if(_0x50cdf2){return _0xc02b2b[_0xfd27('0x16')](_0xa23c1e);}return _0xc02b2b['status'](_0xa23c1e)[_0xfd27('0x17')]();};}function respondWithResult(_0x20f9ff,_0x5c6499){_0x5c6499=_0x5c6499||0xc8;return function(_0x119c53){if(_0x119c53){return _0x20f9ff[_0xfd27('0x18')](_0x5c6499)[_0xfd27('0x19')](_0x119c53);}};}function respondWithFilteredResult(_0x313652,_0x58cb9a){return function(_0x2a1a03){if(_0x2a1a03){var _0x4577ac=typeof _0x58cb9a[_0xfd27('0x1a')]===_0xfd27('0x1b')&&typeof _0x58cb9a[_0xfd27('0x1c')]===_0xfd27('0x1b');var _0x15301f=_0x2a1a03['count'];var _0x370a02=_0x4577ac?0x0:_0x58cb9a[_0xfd27('0x1a')];var _0x31937a=_0x4577ac?_0x2a1a03[_0xfd27('0x1d')]:_0x58cb9a[_0xfd27('0x1a')]+_0x58cb9a[_0xfd27('0x1c')];var _0x3ad1e1;if(_0x31937a>=_0x15301f){_0x31937a=_0x15301f;_0x3ad1e1=0xc8;}else{_0x3ad1e1=0xce;}_0x313652[_0xfd27('0x18')](_0x3ad1e1);return _0x313652[_0xfd27('0x1e')](_0xfd27('0x1f'),_0x370a02+'-'+_0x31937a+'/'+_0x15301f)[_0xfd27('0x19')](_0x2a1a03);}return null;};}function patchUpdates(_0x14f300){return function(_0x26eab4){try{jsonpatch['apply'](_0x26eab4,_0x14f300,!![]);}catch(_0x359ffb){return BPromise[_0xfd27('0x20')](_0x359ffb);}return _0x26eab4['save']();};}function saveUpdates(_0x2bb673,_0x254342){return function(_0x184c9c){if(_0x184c9c){return _0x184c9c[_0xfd27('0x21')](_0x2bb673)['then'](function(_0x422eff){return _0x422eff;});}return null;};}function removeEntity(_0x21eace,_0x45d317){return function(_0x9eb8d4){if(_0x9eb8d4){return _0x9eb8d4[_0xfd27('0x22')]()[_0xfd27('0x23')](function(){var _0x53ffe6=_0x9eb8d4[_0xfd27('0x24')]({'plain':!![]});var _0x2ff1a4=_0xfd27('0x25');return db['UserProfileResource'][_0xfd27('0x22')]({'where':{'type':_0x2ff1a4,'resourceId':_0x53ffe6['id']}})[_0xfd27('0x23')](function(){return _0x9eb8d4;});})['then'](function(){_0x21eace['status'](0xcc)[_0xfd27('0x17')]();});}};}function handleEntityNotFound(_0x34753c,_0xefac5){return function(_0x1bf7d0){if(!_0x1bf7d0){_0x34753c['sendStatus'](0x194);}return _0x1bf7d0;};}function handleError(_0x9e3012,_0x2b7c44){_0x2b7c44=_0x2b7c44||0x1f4;return function(_0x1a474e){logger[_0xfd27('0x26')](_0x1a474e['stack']);if(_0x1a474e[_0xfd27('0x27')]){delete _0x1a474e['name'];}_0x9e3012['status'](_0x2b7c44)[_0xfd27('0x28')](_0x1a474e);};}exports[_0xfd27('0x29')]=function(_0x12d36c,_0x5ae9cf){var _0x4e07de={},_0x289974={},_0x5ea939={'count':0x0,'rows':[]};var _0x2123e9=_[_0xfd27('0x2a')](db[_0xfd27('0x2b')][_0xfd27('0x2c')],function(_0x4beb3f){return{'name':_0x4beb3f[_0xfd27('0x2d')],'type':_0x4beb3f[_0xfd27('0x2e')][_0xfd27('0x2f')]};});_0x289974[_0xfd27('0x30')]=_[_0xfd27('0x2a')](_0x2123e9,_0xfd27('0x27'));_0x289974[_0xfd27('0x31')]=_[_0xfd27('0x32')](_0x12d36c['query']);_0x289974['filters']=_[_0xfd27('0x33')](_0x289974[_0xfd27('0x30')],_0x289974['query']);_0x4e07de[_0xfd27('0x34')]=_[_0xfd27('0x33')](_0x289974[_0xfd27('0x30')],qs[_0xfd27('0x35')](_0x12d36c['query'][_0xfd27('0x35')]));_0x4e07de[_0xfd27('0x34')]=_0x4e07de[_0xfd27('0x34')]['length']?_0x4e07de[_0xfd27('0x34')]:_0x289974[_0xfd27('0x30')];if(!_0x12d36c['query']['hasOwnProperty'](_0xfd27('0x36'))){_0x4e07de[_0xfd27('0x1c')]=qs['limit'](_0x12d36c[_0xfd27('0x31')]['limit']);_0x4e07de[_0xfd27('0x1a')]=qs[_0xfd27('0x1a')](_0x12d36c[_0xfd27('0x31')]['offset']);}_0x4e07de['order']=qs['sort'](_0x12d36c['query'][_0xfd27('0x37')]);_0x4e07de[_0xfd27('0x38')]=qs[_0xfd27('0x39')](_[_0xfd27('0x3a')](_0x12d36c[_0xfd27('0x31')],_0x289974['filters']),_0x2123e9);if(_0x12d36c[_0xfd27('0x31')][_0xfd27('0x3b')]){_0x4e07de['where']=_[_0xfd27('0x3c')](_0x4e07de[_0xfd27('0x38')],{'$or':_[_0xfd27('0x2a')](_0x2123e9,function(_0x39daec){if(_0x39daec['type']!=='VIRTUAL'){var _0x1306b6={};_0x1306b6[_0x39daec['name']]={'$like':'%'+_0x12d36c[_0xfd27('0x31')][_0xfd27('0x3b')]+'%'};return _0x1306b6;}})});}_0x4e07de=_[_0xfd27('0x3c')]({},_0x4e07de,_0x12d36c[_0xfd27('0x3d')]);var _0x4a86eb={'where':_0x4e07de[_0xfd27('0x38')]};return db['AnalyticCustomReport'][_0xfd27('0x1d')](_0x4a86eb)[_0xfd27('0x23')](function(_0x587c96){_0x5ea939[_0xfd27('0x1d')]=_0x587c96;if(_0x12d36c[_0xfd27('0x31')][_0xfd27('0x3e')]){_0x4e07de['include']=[{'all':!![]}];}return db[_0xfd27('0x2b')]['findAll'](_0x4e07de);})[_0xfd27('0x23')](function(_0x55f94b){_0x5ea939[_0xfd27('0x3f')]=_0x55f94b;return _0x5ea939;})['then'](respondWithFilteredResult(_0x5ae9cf,_0x4e07de))[_0xfd27('0x40')](handleError(_0x5ae9cf,null));};exports[_0xfd27('0x41')]=function(_0x260b17,_0x1288c4){var _0x12b312={'raw':![],'where':{'id':_0x260b17[_0xfd27('0x42')]['id']}},_0x493b87={};_0x493b87['model']=_[_0xfd27('0x32')](db[_0xfd27('0x2b')]['rawAttributes']);_0x493b87[_0xfd27('0x31')]=_[_0xfd27('0x32')](_0x260b17['query']);_0x493b87[_0xfd27('0x39')]=_[_0xfd27('0x33')](_0x493b87[_0xfd27('0x30')],_0x493b87[_0xfd27('0x31')]);_0x12b312[_0xfd27('0x34')]=_['intersection'](_0x493b87['model'],qs['fields'](_0x260b17[_0xfd27('0x31')][_0xfd27('0x35')]));_0x12b312['attributes']=_0x12b312[_0xfd27('0x34')][_0xfd27('0x43')]?_0x12b312[_0xfd27('0x34')]:_0x493b87[_0xfd27('0x30')];if(_0x260b17[_0xfd27('0x31')][_0xfd27('0x3e')]){_0x12b312[_0xfd27('0x44')]=[{'all':!![]}];}_0x12b312=_[_0xfd27('0x3c')]({},_0x12b312,_0x260b17[_0xfd27('0x3d')]);return db['AnalyticCustomReport'][_0xfd27('0x45')](_0x12b312)[_0xfd27('0x23')](handleEntityNotFound(_0x1288c4,null))[_0xfd27('0x23')](respondWithResult(_0x1288c4,null))['catch'](handleError(_0x1288c4,null));};exports[_0xfd27('0x46')]=function(_0x953bf,_0x53dba6){return db['AnalyticCustomReport'][_0xfd27('0x46')](_0x953bf[_0xfd27('0x47')],{})['then'](function(_0x3f3e58){var _0x5a1994=_0x953bf[_0xfd27('0x48')][_0xfd27('0x24')]({'plain':!![]});if(!_0x5a1994)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a1994[_0xfd27('0x49')]===_0xfd27('0x48')){var _0x14668d=_0x3f3e58[_0xfd27('0x24')]({'plain':!![]});var _0x4e9720=_0xfd27('0x4a');return db[_0xfd27('0x4b')]['find']({'where':{'name':_0x4e9720,'userProfileId':_0x5a1994[_0xfd27('0x4c')]},'raw':!![]})[_0xfd27('0x23')](function(_0x23cabd){if(_0x23cabd&&_0x23cabd[_0xfd27('0x4d')]===0x0){return db[_0xfd27('0x4e')][_0xfd27('0x46')]({'name':_0x14668d['name'],'resourceId':_0x14668d['id'],'type':_0xfd27('0x25'),'sectionId':_0x23cabd['id']},{})[_0xfd27('0x23')](function(){return _0x3f3e58;});}else{return _0x3f3e58;}})[_0xfd27('0x40')](function(_0x1ee2bc){logger[_0xfd27('0x26')](_0xfd27('0x4f'),_0x1ee2bc);throw _0x1ee2bc;});}return _0x3f3e58;})[_0xfd27('0x23')](respondWithResult(_0x53dba6,0xc9))[_0xfd27('0x40')](handleError(_0x53dba6,null));};exports[_0xfd27('0x21')]=function(_0x237ef5,_0x5eff8e){if(_0x237ef5[_0xfd27('0x47')]['id']){delete _0x237ef5[_0xfd27('0x47')]['id'];}return db['AnalyticCustomReport'][_0xfd27('0x45')]({'where':{'id':_0x237ef5[_0xfd27('0x42')]['id']}})[_0xfd27('0x23')](handleEntityNotFound(_0x5eff8e,null))['then'](saveUpdates(_0x237ef5[_0xfd27('0x47')],null))[_0xfd27('0x23')](respondWithResult(_0x5eff8e,null))[_0xfd27('0x40')](handleError(_0x5eff8e,null));};exports[_0xfd27('0x22')]=function(_0x493d5f,_0x4128a7){return db[_0xfd27('0x2b')][_0xfd27('0x45')]({'where':{'id':_0x493d5f[_0xfd27('0x42')]['id']}})[_0xfd27('0x23')](handleEntityNotFound(_0x4128a7,null))[_0xfd27('0x23')](removeEntity(_0x4128a7,null))[_0xfd27('0x40')](handleError(_0x4128a7,null));};exports[_0xfd27('0x50')]=function(_0x551c19,_0x45ef83){var _0x1cfadb=0xa;var _0x55e102=[_0xfd27('0x51'),'left_join',_0xfd27('0x52'),_0xfd27('0x53')];var _0x3e38ef={'SUM':_0xfd27('0x54'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xfd27('0x55'),'MAX':_0xfd27('0x56'),'MIN':_0xfd27('0x57'),'AVG':_0xfd27('0x58'),'GROUP_CONCAT':_0xfd27('0x59'),'GROUP_CONCAT ASC':_0xfd27('0x5a'),'GROUP_CONCAT DESC':_0xfd27('0x5b')};var _0x383fd0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xfd27('0x5c')};var _0x4e8582=function(_0x2df875){return!_[_0xfd27('0x5d')]([_0xfd27('0x5e'),_0xfd27('0x5f'),'IS\x20EMPTY',_0xfd27('0x60')],_0x2df875);};var _0x21ed08=function(_0xcb740f){if(!_0xcb740f||!_0xcb740f[_0xfd27('0x61')][_0xfd27('0x43')]){return'';}for(var _0x53b105='(',_0xa058fc=0x0;_0xa058fc<_0xcb740f[_0xfd27('0x61')][_0xfd27('0x43')];_0xa058fc+=0x1){_0xa058fc>0x0&&(_0x53b105+='\x20'+_0xcb740f['operator']+'\x20');_0x53b105+=_0xcb740f[_0xfd27('0x61')][_0xa058fc][_0xfd27('0x62')]?_0x21ed08(_0xcb740f[_0xfd27('0x61')][_0xa058fc]['group']):_0xcb740f[_0xfd27('0x61')][_0xa058fc][_0xfd27('0x63')]+'\x20'+_0xcb740f['rules'][_0xa058fc][_0xfd27('0x64')]+(_0x4e8582(_0xcb740f[_0xfd27('0x61')][_0xa058fc][_0xfd27('0x64')])?'\x20'+_0xcb740f[_0xfd27('0x61')][_0xa058fc]['value']:'');}return _0x53b105+')';};var _0x30a4e2={'where':{'id':_0x551c19[_0xfd27('0x42')]['id']}},_0x3b8f3e,_0x268b6e,_0x38c777,_0x560916,_0x1a622e;_0x30a4e2=_[_0xfd27('0x3c')]({},_0x30a4e2,_0x551c19[_0xfd27('0x3d')]);return db[_0xfd27('0x2b')][_0xfd27('0x45')](_0x30a4e2)[_0xfd27('0x23')](function(_0x1d6200){if(_0x1d6200){_0x3b8f3e=_0x1d6200;return _0x1d6200[_0xfd27('0x65')]();}return null;})[_0xfd27('0x23')](function(_0x2007a6){if(_0x2007a6){if(!_0x2007a6[_0xfd27('0x43')]){throw new db[(_0xfd27('0x66'))][(_0xfd27('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x268b6e=_0x2007a6;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xfd27('0x23')](function(_0x3e6a0d){if(_0x3e6a0d){_0x38c777=_[_0xfd27('0x68')](_0x3e6a0d,'id');var _0x2d1519;var _0x2407c0=squel[_0xfd27('0x69')]();_0x2407c0['from'](_0x3b8f3e[_0xfd27('0x6a')]);for(var _0x556211=0x0;_0x556211<_0x268b6e['length'];_0x556211+=0x1){_0x2d1519=_0x268b6e[_0x556211][_0xfd27('0x6b')]?_0x38c777[_0x268b6e[_0x556211][_0xfd27('0x6b')]][_0xfd27('0x6c')]:_0x268b6e[_0x556211][_0xfd27('0x63')];_0x2d1519=_0x268b6e[_0x556211][_0xfd27('0x6d')]?_[_0xfd27('0x6e')](_0x3e38ef[_0x268b6e[_0x556211]['function']],'%s',_0x2d1519):_0x2d1519;_0x2d1519=_0x268b6e[_0x556211][_0xfd27('0x6f')]?_[_0xfd27('0x6e')](_0x383fd0[_0x268b6e[_0x556211][_0xfd27('0x6f')]],'%s',_0x2d1519):_0x2d1519;if(_0x268b6e[_0x556211][_0xfd27('0x70')]){_0x2407c0[_0xfd27('0x62')](_0x2d1519);}_0x268b6e[_0x556211][_0xfd27('0x71')]&&_0x2407c0['order'](_0x2d1519,_0x268b6e[_0x556211]['orderBy']===_0xfd27('0x72')?![]:!![]);_0x2407c0[_0xfd27('0x63')](_0x2d1519,_0x268b6e[_0x556211]['alias']||_0x2d1519);}if(_0x3b8f3e[_0xfd27('0x73')]){_0x3b8f3e[_0xfd27('0x73')]=JSON[_0xfd27('0x74')](_0x3b8f3e[_0xfd27('0x73')]);for(var _0x2cffdf=0x0;_0x2cffdf<_0x3b8f3e['joins'][_0xfd27('0x43')];_0x2cffdf+=0x1){if(_0x3b8f3e['joins'][_0x2cffdf][_0xfd27('0x2e')]&&_[_0xfd27('0x5d')](_0x55e102,_0x3b8f3e[_0xfd27('0x73')][_0x2cffdf]['type'])&&_0x3b8f3e['joins'][_0x2cffdf]['parentKey']&&_0x3b8f3e[_0xfd27('0x73')][_0x2cffdf]['foreignTable']&&_0x3b8f3e[_0xfd27('0x73')][_0x2cffdf][_0xfd27('0x75')]){_0x2407c0[_0x3b8f3e[_0xfd27('0x73')][_0x2cffdf]['type']](_0x3b8f3e[_0xfd27('0x73')][_0x2cffdf][_0xfd27('0x76')],null,util['format'](_0xfd27('0x77'),_0x3b8f3e[_0xfd27('0x6a')],_0x3b8f3e['joins'][_0x2cffdf][_0xfd27('0x78')],_0x3b8f3e['joins'][_0x2cffdf]['foreignTable'],_0x3b8f3e[_0xfd27('0x73')][_0x2cffdf][_0xfd27('0x75')]));}}}if(_0x3b8f3e['conditions']){_0x3b8f3e[_0xfd27('0x79')]=JSON[_0xfd27('0x74')](_0x3b8f3e[_0xfd27('0x79')]);_0x2407c0['where'](_0x21ed08(_0x3b8f3e[_0xfd27('0x79')][_0xfd27('0x62')]));}_0x1a622e=_0x2407c0[_0xfd27('0x7a')]();_0x2407c0[_0xfd27('0x1c')](_0x1cfadb);_0x2407c0['offset'](0x0);logger[_0xfd27('0x7b')](_0xfd27('0x7c'),_0x2407c0['toString']());return dbH[_0xfd27('0x7d')][_0xfd27('0x31')](_0x2407c0[_0xfd27('0x7e')](),{'type':dbH[_0xfd27('0x7d')]['QueryTypes'][_0xfd27('0x7f')]});}})['then'](respondWithResult(_0x45ef83,null))['catch'](handleError(_0x45ef83,null));};function runReport(_0x55cefb,_0x264be1,_0x1d4d52){var _0x15eb9a=_0x264be1[_0xfd27('0x27')];var _0x26ec90=0xa;var _0x4ea491=[_0xfd27('0x51'),_0xfd27('0x80'),_0xfd27('0x52'),_0xfd27('0x53')];var _0x2a237b={'SUM':'SUM(%s)','COUNT':_0xfd27('0x81'),'COUNT DISTINCT':_0xfd27('0x55'),'MAX':_0xfd27('0x56'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xfd27('0x59'),'GROUP_CONCAT ASC':_0xfd27('0x5a'),'GROUP_CONCAT DESC':_0xfd27('0x5b')};var _0x590a57={'SEC_TO_TIME':_0xfd27('0x82'),'DATE':'DATE(%s)','HOUR':_0xfd27('0x83'),'ROUND':_0xfd27('0x84'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x11134d=function(_0x258ac6){return!_[_0xfd27('0x5d')]([_0xfd27('0x5e'),_0xfd27('0x5f'),_0xfd27('0x85'),_0xfd27('0x60')],_0x258ac6);};var _0x304a8d=function(_0x5b9e31){if(!_0x5b9e31||!_0x5b9e31[_0xfd27('0x61')][_0xfd27('0x43')]){return'';}for(var _0x5d9a8f='(',_0x5c47b3=0x0;_0x5c47b3<_0x5b9e31[_0xfd27('0x61')]['length'];_0x5c47b3+=0x1){_0x5c47b3>0x0&&(_0x5d9a8f+='\x20'+_0x5b9e31[_0xfd27('0x86')]+'\x20');_0x5d9a8f+=_0x5b9e31[_0xfd27('0x61')][_0x5c47b3][_0xfd27('0x62')]?_0x304a8d(_0x5b9e31['rules'][_0x5c47b3][_0xfd27('0x62')]):_0x5b9e31[_0xfd27('0x61')][_0x5c47b3]['field']+'\x20'+_0x5b9e31[_0xfd27('0x61')][_0x5c47b3][_0xfd27('0x64')]+(_0x11134d(_0x5b9e31[_0xfd27('0x61')][_0x5c47b3][_0xfd27('0x64')])?'\x20'+_0x5b9e31[_0xfd27('0x61')][_0x5c47b3][_0xfd27('0x87')]:'');}return _0x5d9a8f+')';};var _0x523a1d={'where':{'id':_0x55cefb['id']}},_0x36f34e,_0x393334,_0x39232d,_0x4fbe46,_0x3179e9;_0x523a1d=_[_0xfd27('0x3c')]({},_0x523a1d,_0x1d4d52);return db[_0xfd27('0x2b')]['find'](_0x523a1d)[_0xfd27('0x23')](function(_0x5916b7){if(_0x5916b7){_0x36f34e=_0x5916b7;return _0x5916b7[_0xfd27('0x65')]();}return null;})[_0xfd27('0x23')](function(_0x53478a){if(_0x53478a){if(!_0x53478a[_0xfd27('0x43')]){throw new db['Sequelize'][(_0xfd27('0x67'))](_0xfd27('0x88'),0x193);}_0x393334=_0x53478a;return db[_0xfd27('0x89')][_0xfd27('0x8a')]({'raw':!![]});}return null;})['then'](function(_0x3e03e1){if(_0x3e03e1){_0x39232d=_[_0xfd27('0x68')](_0x3e03e1,'id');var _0x5182d8;var _0x20819f=squel[_0xfd27('0x69')]();_0x20819f[_0xfd27('0x8b')](_0x36f34e[_0xfd27('0x6a')]);for(var _0x1ba349=0x0;_0x1ba349<_0x393334[_0xfd27('0x43')];_0x1ba349+=0x1){_0x5182d8=_0x393334[_0x1ba349][_0xfd27('0x6b')]?_0x39232d[_0x393334[_0x1ba349][_0xfd27('0x6b')]][_0xfd27('0x6c')]:_0x393334[_0x1ba349][_0xfd27('0x63')];_0x5182d8=_0x393334[_0x1ba349][_0xfd27('0x6d')]?_['replace'](_0x2a237b[_0x393334[_0x1ba349][_0xfd27('0x6d')]],'%s',_0x5182d8):_0x5182d8;_0x5182d8=_0x393334[_0x1ba349][_0xfd27('0x6f')]?_[_0xfd27('0x6e')](_0x590a57[_0x393334[_0x1ba349][_0xfd27('0x6f')]],'%s',_0x5182d8):_0x5182d8;if(_0x393334[_0x1ba349][_0xfd27('0x70')]){_0x20819f[_0xfd27('0x62')](_0x5182d8);}_0x393334[_0x1ba349][_0xfd27('0x71')]&&_0x20819f[_0xfd27('0x8c')](_0x5182d8,_0x393334[_0x1ba349][_0xfd27('0x71')]===_0xfd27('0x72')?![]:!![]);_0x20819f[_0xfd27('0x63')](_0x5182d8,_0x393334[_0x1ba349][_0xfd27('0x8d')]||_0x5182d8);}if(_0x36f34e[_0xfd27('0x73')]){_0x36f34e['joins']=JSON[_0xfd27('0x74')](_0x36f34e['joins']);for(var _0x3b11ad=0x0;_0x3b11ad<_0x36f34e[_0xfd27('0x73')][_0xfd27('0x43')];_0x3b11ad+=0x1){if(_0x36f34e[_0xfd27('0x73')][_0x3b11ad][_0xfd27('0x2e')]&&_[_0xfd27('0x5d')](_0x4ea491,_0x36f34e[_0xfd27('0x73')][_0x3b11ad]['type'])&&_0x36f34e[_0xfd27('0x73')][_0x3b11ad][_0xfd27('0x78')]&&_0x36f34e[_0xfd27('0x73')][_0x3b11ad][_0xfd27('0x76')]&&_0x36f34e[_0xfd27('0x73')][_0x3b11ad][_0xfd27('0x75')]){_0x20819f[_0x36f34e[_0xfd27('0x73')][_0x3b11ad][_0xfd27('0x2e')]](_0x36f34e[_0xfd27('0x73')][_0x3b11ad][_0xfd27('0x76')],null,util[_0xfd27('0x6f')](_0xfd27('0x77'),_0x36f34e['table'],_0x36f34e[_0xfd27('0x73')][_0x3b11ad][_0xfd27('0x78')],_0x36f34e[_0xfd27('0x73')][_0x3b11ad][_0xfd27('0x76')],_0x36f34e[_0xfd27('0x73')][_0x3b11ad][_0xfd27('0x75')]));}}}if(_0x36f34e[_0xfd27('0x79')]){_0x36f34e[_0xfd27('0x79')]=JSON[_0xfd27('0x74')](_0x36f34e[_0xfd27('0x79')]);_0x20819f[_0xfd27('0x38')](_0x304a8d(_0x36f34e['conditions']['group']));}_0x3179e9=_0x20819f['clone']();_0x20819f[_0xfd27('0x1c')](_0x26ec90);_0x20819f['offset'](0x0);return;}})[_0xfd27('0x23')](function(){if(_0x264be1[_0xfd27('0x8e')]===_0xfd27('0x8f')){return null;}var _0x1b5af4=_['merge'](_0x264be1,{'name':_0x264be1[_0xfd27('0x90')]||_0x264be1[_0xfd27('0x27')]||_0x36f34e['name'],'basename':_0x15eb9a,'savename':util['format'](_0xfd27('0x91'),_0x264be1['name']||_0x36f34e[_0xfd27('0x27')],require(_0xfd27('0x92'))['generate'](0x4),_0x264be1[_0xfd27('0x8e')]||'csv'),'reportId':_0x36f34e['id'],'reportType':_0xfd27('0x93')});return db[_0xfd27('0x94')][_0xfd27('0x46')](_0x1b5af4,{'raw':!![]});})[_0xfd27('0x23')](function(_0x47431e){if(_0x36f34e[_0xfd27('0x6a')]==='cdr'){_0x3179e9[_0xfd27('0x38')](_0x36f34e[_0xfd27('0x6a')]+_0xfd27('0x95'),_0x264be1[_0xfd27('0x96')],_0x264be1[_0xfd27('0x97')]);}else{_0x3179e9['where'](_0x36f34e[_0xfd27('0x6a')]+_0xfd27('0x98'),_0x264be1[_0xfd27('0x96')],_0x264be1[_0xfd27('0x97')]);}if(_0x47431e){logger[_0xfd27('0x99')](_0xfd27('0x9a'),_0x3179e9[_0xfd27('0x7e')]());require(_0xfd27('0x9b'))[_0xfd27('0x9c')](path[_0xfd27('0x51')](__dirname,_0xfd27('0x9d'),_0x47431e[_0xfd27('0x8e')]),[_0x47431e['id'],_0x3179e9[_0xfd27('0x7e')](),path['join'](__dirname,'../../files/reports',_0x47431e['savename']),_0x15eb9a]);return _0x47431e;}else{var _0x301bd=squel['select']();_0x301bd[_0xfd27('0x8b')]('('+_0x3179e9[_0xfd27('0x7e')]()+')','countTable');_0x301bd[_0xfd27('0x63')]('COUNT(*)',_0xfd27('0x1d'));_0x3179e9['limit'](_0x264be1[_0xfd27('0x1c')]||_0x26ec90);_0x3179e9['offset'](_0x264be1[_0xfd27('0x1a')]||0x0);return dbH['sequelize'][_0xfd27('0x31')](_0x301bd[_0xfd27('0x7e')](),{'type':dbH['sequelize'][_0xfd27('0x9e')]['SELECT']})['then'](function(_0x3fb92f){if(!_0x3fb92f[_0xfd27('0x43')]){_0x4fbe46=0x0;}else{_0x4fbe46=_0x3fb92f[0x0][_0xfd27('0x1d')]||0x0;}return dbH[_0xfd27('0x7d')][_0xfd27('0x31')](_0x3179e9[_0xfd27('0x7e')](),{'type':dbH[_0xfd27('0x7d')][_0xfd27('0x9e')][_0xfd27('0x7f')]});})['then'](function(_0x25e87f){return{'rows':_0x25e87f||[],'count':_0x4fbe46};});}});}exports[_0xfd27('0x9f')]=function(_0x3b1b8d,_0x46c444){return runReport(_0x3b1b8d['params'],_0x3b1b8d[_0xfd27('0x31')],_0x3b1b8d[_0xfd27('0x3d')])[_0xfd27('0x23')](respondWithResult(_0x46c444,null))[_0xfd27('0x40')](handleError(_0x46c444,null));};exports['runReport']=runReport;exports[_0xfd27('0x31')]=function(_0x101819,_0x3e1efc){var _0x58e9ed=0xa;var _0x18fc3b=[_0xfd27('0x51'),_0xfd27('0x80'),_0xfd27('0x52'),'cross_join'];var _0xaa3632={'SUM':'SUM(%s)','COUNT':_0xfd27('0x81'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xfd27('0x56'),'MIN':'MIN(%s)','AVG':_0xfd27('0x58'),'GROUP_CONCAT':_0xfd27('0x59'),'GROUP_CONCAT ASC':_0xfd27('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2efa6f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xfd27('0xa0'),'HOUR':_0xfd27('0x83'),'ROUND':_0xfd27('0x84'),'UNIX_TIMESTAMP':_0xfd27('0x5c')};var _0x4a9e5a=function(_0x512e82){return!_[_0xfd27('0x5d')](['IS\x20NULL',_0xfd27('0x5f'),_0xfd27('0x85'),_0xfd27('0x60')],_0x512e82);};var _0x4cc4df=function(_0x396537){if(!_0x396537||!_0x396537[_0xfd27('0x61')][_0xfd27('0x43')]){return'';}for(var _0x5b741a='(',_0x2c6ff6=0x0;_0x2c6ff6<_0x396537[_0xfd27('0x61')][_0xfd27('0x43')];_0x2c6ff6+=0x1){_0x2c6ff6>0x0&&(_0x5b741a+='\x20'+_0x396537['operator']+'\x20');_0x5b741a+=_0x396537[_0xfd27('0x61')][_0x2c6ff6][_0xfd27('0x62')]?_0x4cc4df(_0x396537[_0xfd27('0x61')][_0x2c6ff6][_0xfd27('0x62')]):_0x396537[_0xfd27('0x61')][_0x2c6ff6][_0xfd27('0x63')]+'\x20'+_0x396537[_0xfd27('0x61')][_0x2c6ff6][_0xfd27('0x64')]+(_0x4a9e5a(_0x396537[_0xfd27('0x61')][_0x2c6ff6]['condition'])?'\x20'+_0x396537[_0xfd27('0x61')][_0x2c6ff6]['value']:'');}return _0x5b741a+')';};var _0x50dfdb={'where':{'id':_0x101819['params']['id']}},_0x568ceb,_0x48a55a,_0x14e472,_0x164fda,_0x24e708;_0x50dfdb=_[_0xfd27('0x3c')]({},_0x50dfdb,_0x101819[_0xfd27('0x3d')]);return db[_0xfd27('0x2b')]['find'](_0x50dfdb)['then'](function(_0x313673){if(_0x313673){_0x568ceb=_0x313673;return _0x313673['getFields']();}return null;})[_0xfd27('0x23')](function(_0x497202){if(_0x497202){if(!_0x497202[_0xfd27('0x43')]){throw new db['Sequelize'][(_0xfd27('0x67'))](_0xfd27('0x88'),0x193);}_0x48a55a=_0x497202;return db['AnalyticMetric'][_0xfd27('0x8a')]({'raw':!![]});}return null;})[_0xfd27('0x23')](function(_0xbc2e6d){if(_0xbc2e6d){_0x14e472=_[_0xfd27('0x68')](_0xbc2e6d,'id');var _0x400024;var _0x1c27be=squel['select']();_0x1c27be['from'](_0x568ceb[_0xfd27('0x6a')]);for(var _0x5e5ad2=0x0;_0x5e5ad2<_0x48a55a[_0xfd27('0x43')];_0x5e5ad2+=0x1){_0x400024=_0x48a55a[_0x5e5ad2]['MetricId']?_0x14e472[_0x48a55a[_0x5e5ad2]['MetricId']][_0xfd27('0x6c')]:_0x48a55a[_0x5e5ad2]['field'];_0x400024=_0x48a55a[_0x5e5ad2][_0xfd27('0x6d')]?_[_0xfd27('0x6e')](_0xaa3632[_0x48a55a[_0x5e5ad2][_0xfd27('0x6d')]],'%s',_0x400024):_0x400024;_0x400024=_0x48a55a[_0x5e5ad2][_0xfd27('0x6f')]?_[_0xfd27('0x6e')](_0x2efa6f[_0x48a55a[_0x5e5ad2]['format']],'%s',_0x400024):_0x400024;if(_0x48a55a[_0x5e5ad2]['groupBy']){_0x1c27be[_0xfd27('0x62')](_0x400024);}_0x48a55a[_0x5e5ad2][_0xfd27('0x71')]&&_0x1c27be[_0xfd27('0x8c')](_0x400024,_0x48a55a[_0x5e5ad2][_0xfd27('0x71')]===_0xfd27('0x72')?![]:!![]);_0x1c27be['field'](_0x400024,_0x48a55a[_0x5e5ad2][_0xfd27('0x8d')]||_0x400024);}if(_0x568ceb[_0xfd27('0x73')]){_0x568ceb[_0xfd27('0x73')]=JSON[_0xfd27('0x74')](_0x568ceb['joins']);for(var _0x482293=0x0;_0x482293<_0x568ceb[_0xfd27('0x73')][_0xfd27('0x43')];_0x482293+=0x1){if(_0x568ceb[_0xfd27('0x73')][_0x482293][_0xfd27('0x2e')]&&_['includes'](_0x18fc3b,_0x568ceb[_0xfd27('0x73')][_0x482293][_0xfd27('0x2e')])&&_0x568ceb[_0xfd27('0x73')][_0x482293][_0xfd27('0x78')]&&_0x568ceb[_0xfd27('0x73')][_0x482293][_0xfd27('0x76')]&&_0x568ceb[_0xfd27('0x73')][_0x482293][_0xfd27('0x75')]){_0x1c27be[_0x568ceb[_0xfd27('0x73')][_0x482293]['type']](_0x568ceb[_0xfd27('0x73')][_0x482293][_0xfd27('0x76')],null,util[_0xfd27('0x6f')](_0xfd27('0x77'),_0x568ceb[_0xfd27('0x6a')],_0x568ceb[_0xfd27('0x73')][_0x482293][_0xfd27('0x78')],_0x568ceb[_0xfd27('0x73')][_0x482293][_0xfd27('0x76')],_0x568ceb[_0xfd27('0x73')][_0x482293][_0xfd27('0x75')]));}}}if(_0x568ceb[_0xfd27('0x79')]){_0x568ceb[_0xfd27('0x79')]=JSON[_0xfd27('0x74')](_0x568ceb[_0xfd27('0x79')]);_0x1c27be[_0xfd27('0x38')](_0x4cc4df(_0x568ceb[_0xfd27('0x79')][_0xfd27('0x62')]));}_0x24e708=_0x1c27be['clone']();_0x1c27be[_0xfd27('0x1c')](_0x58e9ed);_0x1c27be['offset'](0x0);logger[_0xfd27('0x7b')](_0xfd27('0x7c'),_0x1c27be['toString']());return dbH[_0xfd27('0x7d')][_0xfd27('0x31')](_0x1c27be[_0xfd27('0x7e')](),{'type':dbH[_0xfd27('0x7d')][_0xfd27('0x9e')][_0xfd27('0x7f')]});}})[_0xfd27('0x23')](function(){return{'sql':_0x24e708[_0xfd27('0x7e')]()};})[_0xfd27('0x23')](respondWithResult(_0x3e1efc,null))[_0xfd27('0x40')](handleError(_0x3e1efc,null));};
\ No newline at end of file
index 9f0c8fa..604453f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8ce=['analytics_custom_reports','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x306626,_0x425e93){var _0x466728=function(_0x3b3478){while(--_0x3b3478){_0x306626['push'](_0x306626['shift']());}};_0x466728(++_0x425e93);}(_0xf8ce,0x1da));var _0xef8c=function(_0x41d9a8,_0x386c27){_0x41d9a8=_0x41d9a8-0x0;var _0x146498=_0xf8ce[_0x41d9a8];return _0x146498;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xef8c('0x0'))(_0xef8c('0x1'));var moment=require(_0xef8c('0x2'));var BPromise=require(_0xef8c('0x3'));var rp=require(_0xef8c('0x4'));var fs=require('fs');var path=require(_0xef8c('0x5'));var rimraf=require(_0xef8c('0x6'));var config=require(_0xef8c('0x7'));var attributes=require('./analyticCustomReport.attributes');module[_0xef8c('0x8')]=function(_0x56149c,_0x57e0fd){return _0x56149c[_0xef8c('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0xef8c('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6cfa=['request-promise','path','rimraf','../../config/environment','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x6cfa,0x1c2));var _0xa6cf=function(_0x382c73,_0x199cab){_0x382c73=_0x382c73-0x0;var _0x1dd0bf=_0x6cfa[_0x382c73];return _0x1dd0bf;};'use strict';var _=require(_0xa6cf('0x0'));var util=require(_0xa6cf('0x1'));var logger=require(_0xa6cf('0x2'))('api');var moment=require(_0xa6cf('0x3'));var BPromise=require(_0xa6cf('0x4'));var rp=require(_0xa6cf('0x5'));var fs=require('fs');var path=require(_0xa6cf('0x6'));var rimraf=require(_0xa6cf('0x7'));var config=require(_0xa6cf('0x8'));var attributes=require('./analyticCustomReport.attributes');module[_0xa6cf('0x9')]=function(_0x466087,_0x5d8084){return _0x466087[_0xa6cf('0xa')](_0xa6cf('0xb'),attributes,{'tableName':_0xa6cf('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 71753d6..3ff132b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1872=['then','info','request\x20sent','debug','stringify','code','error','AnalyticCustomReport,\x20%s,\x20%s','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x3a7189,_0x429f51){var _0x47f36b=function(_0x19781b){while(--_0x19781b){_0x3a7189['push'](_0x3a7189['shift']());}};_0x47f36b(++_0x429f51);}(_0x1872,0xa3));var _0x2187=function(_0x3b8ed6,_0x3b5bb6){_0x3b8ed6=_0x3b8ed6-0x0;var _0x2e6223=_0x1872[_0x3b8ed6];return _0x2e6223;};'use strict';var _=require(_0x2187('0x0'));var util=require(_0x2187('0x1'));var moment=require(_0x2187('0x2'));var BPromise=require(_0x2187('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2187('0x4'));var db=require(_0x2187('0x5'))['db'];var utils=require(_0x2187('0x6'));var logger=require(_0x2187('0x7'))(_0x2187('0x8'));var config=require(_0x2187('0x9'));var jayson=require(_0x2187('0xa'));var client=jayson['client'][_0x2187('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xec26ed,_0xa25c54,_0x3a9fb6){return new BPromise(function(_0x15d738,_0x400650){return client[_0x2187('0xc')](_0xec26ed,_0x3a9fb6)[_0x2187('0xd')](function(_0x2c7c2b){logger[_0x2187('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0xa25c54,_0x2187('0xf'));logger[_0x2187('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0xa25c54,_0x2187('0xf'),JSON[_0x2187('0x11')](_0x2c7c2b));if(_0x2c7c2b['error']){if(_0x2c7c2b['error'][_0x2187('0x12')]===0x1f4){logger[_0x2187('0x13')](_0x2187('0x14'),_0xa25c54,_0x2c7c2b[_0x2187('0x13')]['message']);return _0x400650(_0x2c7c2b['error'][_0x2187('0x15')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0xa25c54,_0x2c7c2b[_0x2187('0x13')]['message']);return _0x15d738(_0x2c7c2b[_0x2187('0x13')]['message']);}else{logger[_0x2187('0xe')](_0x2187('0x14'),_0xa25c54,_0x2187('0xf'));_0x15d738(_0x2c7c2b['result']['message']);}})['catch'](function(_0x126e90){logger[_0x2187('0x13')](_0x2187('0x14'),_0xa25c54,_0x126e90);_0x400650(_0x126e90);});});}
\ No newline at end of file
+var _0xae2a=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0xae2a,0x18a));var _0xaae2=function(_0x2d9a8d,_0x21b8ea){_0x2d9a8d=_0x2d9a8d-0x0;var _0x11039e=_0xae2a[_0x2d9a8d];return _0x11039e;};'use strict';var _=require('lodash');var util=require(_0xaae2('0x0'));var moment=require(_0xaae2('0x1'));var BPromise=require(_0xaae2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaae2('0x3'));var db=require(_0xaae2('0x4'))['db'];var utils=require(_0xaae2('0x5'));var logger=require(_0xaae2('0x6'))(_0xaae2('0x7'));var config=require(_0xaae2('0x8'));var jayson=require(_0xaae2('0x9'));var client=jayson['client'][_0xaae2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5410ae,_0x50abf7,_0x5c738c){return new BPromise(function(_0x4ca7c5,_0x3f8412){return client[_0xaae2('0xb')](_0x5410ae,_0x5c738c)[_0xaae2('0xc')](function(_0x52fafc){logger[_0xaae2('0xd')](_0xaae2('0xe'),_0x50abf7,_0xaae2('0xf'));logger[_0xaae2('0x10')](_0xaae2('0x11'),_0x50abf7,'request\x20sent',JSON['stringify'](_0x52fafc));if(_0x52fafc[_0xaae2('0x12')]){if(_0x52fafc[_0xaae2('0x12')]['code']===0x1f4){logger[_0xaae2('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x50abf7,_0x52fafc['error'][_0xaae2('0x13')]);return _0x3f8412(_0x52fafc['error']['message']);}logger['error'](_0xaae2('0xe'),_0x50abf7,_0x52fafc[_0xaae2('0x12')]['message']);return _0x4ca7c5(_0x52fafc['error'][_0xaae2('0x13')]);}else{logger['info'](_0xaae2('0xe'),_0x50abf7,'request\x20sent');_0x4ca7c5(_0x52fafc[_0xaae2('0x14')]['message']);}})[_0xaae2('0x15')](function(_0x3488a3){logger[_0xaae2('0x12')](_0xaae2('0xe'),_0x50abf7,_0x3488a3);_0x3f8412(_0x3488a3);});});}
\ No newline at end of file
index 13ac362..085d271 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x926a=['update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','show','/:id/preview','isAuthenticated','preview','/:id/run','query','post','create','put'];(function(_0x44dce7,_0x32e89e){var _0x4ee56e=function(_0x285afb){while(--_0x285afb){_0x44dce7['push'](_0x44dce7['shift']());}};_0x4ee56e(++_0x32e89e);}(_0x926a,0x146));var _0xa926=function(_0xe06035,_0x22a4f9){_0xe06035=_0xe06035-0x0;var _0x352a58=_0x926a[_0xe06035];return _0x352a58;};'use strict';var multer=require(_0xa926('0x0'));var util=require(_0xa926('0x1'));var path=require(_0xa926('0x2'));var timeout=require('connect-timeout');var express=require(_0xa926('0x3'));var router=express['Router']();var fs_extra=require(_0xa926('0x4'));var auth=require(_0xa926('0x5'));var interaction=require(_0xa926('0x6'));var config=require(_0xa926('0x7'));var controller=require('./analyticCustomReport.controller');router[_0xa926('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa926('0x8')](_0xa926('0x9'),auth['isAuthenticated'](),controller[_0xa926('0xa')]);router['get'](_0xa926('0xb'),auth[_0xa926('0xc')](),controller[_0xa926('0xd')]);router[_0xa926('0x8')](_0xa926('0xe'),auth[_0xa926('0xc')](),controller['run']);router[_0xa926('0x8')]('/:id/query',auth[_0xa926('0xc')](),controller[_0xa926('0xf')]);router[_0xa926('0x10')]('/',auth[_0xa926('0xc')](),controller[_0xa926('0x11')]);router[_0xa926('0x12')](_0xa926('0x9'),auth[_0xa926('0xc')](),controller[_0xa926('0x13')]);router[_0xa926('0x14')](_0xa926('0x9'),auth['isAuthenticated'](),controller[_0xa926('0x15')]);module[_0xa926('0x16')]=router;
\ No newline at end of file
+var _0xb0e8=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/:id','show','isAuthenticated','preview','get','/:id/run','run','/:id/query','query','post','create','put','delete','exports','util','path'];(function(_0x3e9a33,_0x1463e9){var _0x586459=function(_0x5ba81c){while(--_0x5ba81c){_0x3e9a33['push'](_0x3e9a33['shift']());}};_0x586459(++_0x1463e9);}(_0xb0e8,0x1ae));var _0x8b0e=function(_0x788a54,_0x12450b){_0x788a54=_0x788a54-0x0;var _0x8b73a4=_0xb0e8[_0x788a54];return _0x8b73a4;};'use strict';var multer=require('multer');var util=require(_0x8b0e('0x0'));var path=require(_0x8b0e('0x1'));var timeout=require(_0x8b0e('0x2'));var express=require(_0x8b0e('0x3'));var router=express[_0x8b0e('0x4')]();var fs_extra=require(_0x8b0e('0x5'));var auth=require(_0x8b0e('0x6'));var interaction=require(_0x8b0e('0x7'));var config=require(_0x8b0e('0x8'));var controller=require('./analyticCustomReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x8b0e('0x9')]);router['get'](_0x8b0e('0xa'),auth['isAuthenticated'](),controller[_0x8b0e('0xb')]);router['get']('/:id/preview',auth[_0x8b0e('0xc')](),controller[_0x8b0e('0xd')]);router[_0x8b0e('0xe')](_0x8b0e('0xf'),auth[_0x8b0e('0xc')](),controller[_0x8b0e('0x10')]);router[_0x8b0e('0xe')](_0x8b0e('0x11'),auth['isAuthenticated'](),controller[_0x8b0e('0x12')]);router[_0x8b0e('0x13')]('/',auth[_0x8b0e('0xc')](),controller[_0x8b0e('0x14')]);router[_0x8b0e('0x15')]('/:id',auth[_0x8b0e('0xc')](),controller['update']);router[_0x8b0e('0x16')](_0x8b0e('0xa'),auth[_0x8b0e('0xc')](),controller['destroy']);module[_0x8b0e('0x17')]=router;
\ No newline at end of file
index e2053e3..c740d19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee14=['STRING','TEXT'];(function(_0x459367,_0x45609c){var _0x7a0561=function(_0x53a812){while(--_0x53a812){_0x459367['push'](_0x459367['shift']());}};_0x7a0561(++_0x45609c);}(_0xee14,0x13a));var _0x4ee1=function(_0x554e00,_0x2d1b2e){_0x554e00=_0x554e00-0x0;var _0x5165f6=_0xee14[_0x554e00];return _0x5165f6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4ee1('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x4ee1('0x0')]},'parent':{'type':Sequelize[_0x4ee1('0x0')]},'table':{'type':Sequelize[_0x4ee1('0x0')]},'conditions':{'type':Sequelize[_0x4ee1('0x1')]},'joins':{'type':Sequelize[_0x4ee1('0x1')]}};
\ No newline at end of file
+var _0x2675=['sequelize','STRING','TEXT'];(function(_0x20aae1,_0x51efd4){var _0x510601=function(_0x20895f){while(--_0x20895f){_0x20aae1['push'](_0x20aae1['shift']());}};_0x510601(++_0x51efd4);}(_0x2675,0x75));var _0x5267=function(_0x27218f,_0x44b3f7){_0x27218f=_0x27218f-0x0;var _0x1949f9=_0x2675[_0x27218f];return _0x1949f9;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}};
\ No newline at end of file
index 8fccb2f..1a46c13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cb9=['runReport','left_join','SEC_TO_TIME(%s)','IS\x20NULL','clone','debug','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','apply','reject','then','destroy','get','UserProfileResource','stack','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','body','user','role','autoAssociation','create','DefaultReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','order','DESC','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','COUNT(%s)','GROUP_CONCAT(%s)','HOUR(%s)','value','groupBy','alias','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)'];(function(_0x8f123d,_0x232ae9){var _0x54cc18=function(_0x4c24a0){while(--_0x4c24a0){_0x8f123d['push'](_0x8f123d['shift']());}};_0x54cc18(++_0x232ae9);}(_0x1cb9,0x14e));var _0x91cb=function(_0x14c9c2,_0x35a467){_0x14c9c2=_0x14c9c2-0x0;var _0x1dc7b4=_0x1cb9[_0x14c9c2];return _0x1dc7b4;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];var dbH=require(_0x91cb('0x18'))['dbH'];function respondWithStatusCode(_0x20e6e0,_0x3ea707){_0x3ea707=_0x3ea707||0xcc;return function(_0x44f2e9){if(_0x44f2e9){return _0x20e6e0[_0x91cb('0x19')](_0x3ea707);}return _0x20e6e0['status'](_0x3ea707)['end']();};}function respondWithResult(_0x4aae25,_0x3d22b7){_0x3d22b7=_0x3d22b7||0xc8;return function(_0x585470){if(_0x585470){return _0x4aae25['status'](_0x3d22b7)[_0x91cb('0x1a')](_0x585470);}};}function respondWithFilteredResult(_0xc3629e,_0x347980){return function(_0x5ea796){if(_0x5ea796){var _0x238f11=typeof _0x347980[_0x91cb('0x1b')]==='undefined'&&typeof _0x347980[_0x91cb('0x1c')]===_0x91cb('0x1d');var _0x1cd34b=_0x5ea796[_0x91cb('0x1e')];var _0x5cc1c3=_0x238f11?0x0:_0x347980[_0x91cb('0x1b')];var _0x7dcf60=_0x238f11?_0x5ea796['count']:_0x347980[_0x91cb('0x1b')]+_0x347980['limit'];var _0x55042a;if(_0x7dcf60>=_0x1cd34b){_0x7dcf60=_0x1cd34b;_0x55042a=0xc8;}else{_0x55042a=0xce;}_0xc3629e[_0x91cb('0x1f')](_0x55042a);return _0xc3629e[_0x91cb('0x20')]('Content-Range',_0x5cc1c3+'-'+_0x7dcf60+'/'+_0x1cd34b)['json'](_0x5ea796);}return null;};}function patchUpdates(_0x5b385a){return function(_0x438162){try{jsonpatch[_0x91cb('0x21')](_0x438162,_0x5b385a,!![]);}catch(_0x20aff5){return BPromise[_0x91cb('0x22')](_0x20aff5);}return _0x438162['save']();};}function saveUpdates(_0x45c4b3,_0x43881c){return function(_0x1fa837){if(_0x1fa837){return _0x1fa837['update'](_0x45c4b3)[_0x91cb('0x23')](function(_0x1a7a54){return _0x1a7a54;});}return null;};}function removeEntity(_0x2447e7,_0x422d14){return function(_0x3ca500){if(_0x3ca500){return _0x3ca500[_0x91cb('0x24')]()[_0x91cb('0x23')](function(){var _0x423c4f=_0x3ca500[_0x91cb('0x25')]({'plain':!![]});var _0x4c8438='DefaultReports';return db[_0x91cb('0x26')]['destroy']({'where':{'type':_0x4c8438,'resourceId':_0x423c4f['id']}})[_0x91cb('0x23')](function(){return _0x3ca500;});})[_0x91cb('0x23')](function(){_0x2447e7[_0x91cb('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9b26a6,_0x4f5a7b){return function(_0x4572f6){if(!_0x4572f6){_0x9b26a6[_0x91cb('0x19')](0x194);}return _0x4572f6;};}function handleError(_0x3b3ee6,_0x2fb473){_0x2fb473=_0x2fb473||0x1f4;return function(_0x468908){logger['error'](_0x468908[_0x91cb('0x27')]);if(_0x468908['name']){delete _0x468908[_0x91cb('0x28')];}_0x3b3ee6[_0x91cb('0x1f')](_0x2fb473)[_0x91cb('0x29')](_0x468908);};}exports['index']=function(_0x775c25,_0x146e1f){var _0x25bbf9={},_0x361e4c={},_0xf296bc={'count':0x0,'rows':[]};var _0x3dab18=_[_0x91cb('0x2a')](db[_0x91cb('0x2b')][_0x91cb('0x2c')],function(_0x5e6ed3){return{'name':_0x5e6ed3[_0x91cb('0x2d')],'type':_0x5e6ed3[_0x91cb('0x2e')][_0x91cb('0x2f')]};});_0x361e4c[_0x91cb('0x30')]=_[_0x91cb('0x2a')](_0x3dab18,'name');_0x361e4c[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x775c25[_0x91cb('0x31')]);_0x361e4c[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0x361e4c['model'],_0x361e4c[_0x91cb('0x31')]);_0x25bbf9['attributes']=_['intersection'](_0x361e4c['model'],qs[_0x91cb('0x35')](_0x775c25['query'][_0x91cb('0x35')]));_0x25bbf9['attributes']=_0x25bbf9['attributes'][_0x91cb('0x36')]?_0x25bbf9[_0x91cb('0x37')]:_0x361e4c[_0x91cb('0x30')];if(!_0x775c25[_0x91cb('0x31')][_0x91cb('0x38')]('nolimit')){_0x25bbf9[_0x91cb('0x1c')]=qs[_0x91cb('0x1c')](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1c')]);_0x25bbf9['offset']=qs['offset'](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1b')]);}_0x25bbf9['order']=qs[_0x91cb('0x39')](_0x775c25[_0x91cb('0x31')]['sort']);_0x25bbf9[_0x91cb('0x3a')]=qs[_0x91cb('0x33')](_['pick'](_0x775c25[_0x91cb('0x31')],_0x361e4c['filters']),_0x3dab18);if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3b')]){_0x25bbf9[_0x91cb('0x3a')]=_[_0x91cb('0x3c')](_0x25bbf9[_0x91cb('0x3a')],{'$or':_[_0x91cb('0x2a')](_0x3dab18,function(_0x5d0e37){if(_0x5d0e37[_0x91cb('0x2e')]!==_0x91cb('0x3d')){var _0x4e5b4b={};_0x4e5b4b[_0x5d0e37[_0x91cb('0x28')]]={'$like':'%'+_0x775c25['query'][_0x91cb('0x3b')]+'%'};return _0x4e5b4b;}})});}_0x25bbf9=_[_0x91cb('0x3c')]({},_0x25bbf9,_0x775c25[_0x91cb('0x3e')]);var _0x174794={'where':_0x25bbf9['where']};return db[_0x91cb('0x2b')][_0x91cb('0x1e')](_0x174794)[_0x91cb('0x23')](function(_0x37e777){_0xf296bc[_0x91cb('0x1e')]=_0x37e777;if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3f')]){_0x25bbf9[_0x91cb('0x40')]=[{'all':!![]}];}return db[_0x91cb('0x2b')][_0x91cb('0x41')](_0x25bbf9);})['then'](function(_0x16993f){_0xf296bc['rows']=_0x16993f;return _0xf296bc;})[_0x91cb('0x23')](respondWithFilteredResult(_0x146e1f,_0x25bbf9))['catch'](handleError(_0x146e1f,null));};exports[_0x91cb('0x42')]=function(_0x52e82c,_0x138f48){var _0x477131={'raw':!![],'where':{'id':_0x52e82c[_0x91cb('0x43')]['id']}},_0xba99ce={};_0xba99ce['model']=_[_0x91cb('0x32')](db[_0x91cb('0x2b')]['rawAttributes']);_0xba99ce[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x52e82c[_0x91cb('0x31')]);_0xba99ce[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0xba99ce[_0x91cb('0x30')],_0xba99ce[_0x91cb('0x31')]);_0x477131[_0x91cb('0x37')]=_[_0x91cb('0x34')](_0xba99ce['model'],qs[_0x91cb('0x35')](_0x52e82c[_0x91cb('0x31')][_0x91cb('0x35')]));_0x477131[_0x91cb('0x37')]=_0x477131[_0x91cb('0x37')][_0x91cb('0x36')]?_0x477131[_0x91cb('0x37')]:_0xba99ce[_0x91cb('0x30')];if(_0x52e82c['query'][_0x91cb('0x3f')]){_0x477131[_0x91cb('0x40')]=[{'all':!![]}];}_0x477131=_[_0x91cb('0x3c')]({},_0x477131,_0x52e82c[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x477131)[_0x91cb('0x23')](handleEntityNotFound(_0x138f48,null))['then'](respondWithResult(_0x138f48,null))[_0x91cb('0x45')](handleError(_0x138f48,null));};exports['create']=function(_0x2c419b,_0x4c0acd){return db['AnalyticDefaultReport']['create'](_0x2c419b[_0x91cb('0x46')],{})[_0x91cb('0x23')](function(_0x3d62c4){var _0x2f8384=_0x2c419b[_0x91cb('0x47')]['get']({'plain':!![]});if(!_0x2f8384)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f8384[_0x91cb('0x48')]===_0x91cb('0x47')){var _0x140994=_0x3d62c4[_0x91cb('0x25')]({'plain':!![]});var _0x57adff='Reports';return db['UserProfileSection'][_0x91cb('0x44')]({'where':{'name':_0x57adff,'userProfileId':_0x2f8384['userProfileId']},'raw':!![]})[_0x91cb('0x23')](function(_0x4aa670){if(_0x4aa670&&_0x4aa670[_0x91cb('0x49')]===0x0){return db[_0x91cb('0x26')][_0x91cb('0x4a')]({'name':_0x140994[_0x91cb('0x28')],'resourceId':_0x140994['id'],'type':_0x91cb('0x4b'),'sectionId':_0x4aa670['id']},{})[_0x91cb('0x23')](function(){return _0x3d62c4;});}else{return _0x3d62c4;}})[_0x91cb('0x45')](function(_0x30fd4e){logger[_0x91cb('0x4c')](_0x91cb('0x4d'),_0x30fd4e);throw _0x30fd4e;});}return _0x3d62c4;})[_0x91cb('0x23')](respondWithResult(_0x4c0acd,0xc9))['catch'](handleError(_0x4c0acd,null));};exports[_0x91cb('0x4e')]=function(_0x1fa45a,_0x4d7a34){if(_0x1fa45a[_0x91cb('0x46')]['id']){delete _0x1fa45a[_0x91cb('0x46')]['id'];}return db['AnalyticDefaultReport'][_0x91cb('0x44')]({'where':{'id':_0x1fa45a[_0x91cb('0x43')]['id']}})[_0x91cb('0x23')](handleEntityNotFound(_0x4d7a34,null))[_0x91cb('0x23')](saveUpdates(_0x1fa45a[_0x91cb('0x46')],null))[_0x91cb('0x23')](respondWithResult(_0x4d7a34,null))[_0x91cb('0x45')](handleError(_0x4d7a34,null));};exports[_0x91cb('0x24')]=function(_0x3320bd,_0x93ef52){return db[_0x91cb('0x2b')]['find']({'where':{'id':_0x3320bd[_0x91cb('0x43')]['id']}})['then'](handleEntityNotFound(_0x93ef52,null))[_0x91cb('0x23')](removeEntity(_0x93ef52,null))['catch'](handleError(_0x93ef52,null));};exports[_0x91cb('0x4f')]=function(_0x1b2fec,_0x1986d7){var _0x47a6cd=0xa;var _0xe49d42=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),_0x91cb('0x52')];var _0x365afd={'SUM':_0x91cb('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x5c2c01={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x91cb('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':_0x91cb('0x5c')};var _0x5ae0d2=function(_0x4f19c8){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4f19c8);};var _0x551836=function(_0x22fea8){if(!_0x22fea8||!_0x22fea8['rules'][_0x91cb('0x36')]){return'';}for(var _0xe08233='(',_0xd7be15=0x0;_0xd7be15<_0x22fea8[_0x91cb('0x61')]['length'];_0xd7be15+=0x1){_0xd7be15>0x0&&(_0xe08233+='\x20'+_0x22fea8[_0x91cb('0x62')]+'\x20');_0xe08233+=_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]?_0x551836(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]):_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x64')]+'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')]+(_0x5ae0d2(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')])?'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15]['value']:'');}return _0xe08233+')';};var _0x2cf4d0={'where':{'id':_0x1b2fec[_0x91cb('0x43')]['id']}},_0x2e301a,_0x474682,_0x51ab8a,_0x21c890,_0xca33a2;_0x2cf4d0=_['merge']({},_0x2cf4d0,_0x1b2fec[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x2cf4d0)[_0x91cb('0x23')](function(_0x80fcc6){if(_0x80fcc6){_0x2e301a=_0x80fcc6;return _0x80fcc6[_0x91cb('0x66')]();}return null;})['then'](function(_0x1c0b66){if(_0x1c0b66){if(!_0x1c0b66[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x474682=_0x1c0b66;return db[_0x91cb('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x28bfe5){if(_0x28bfe5){_0x51ab8a=_[_0x91cb('0x6b')](_0x28bfe5,'id');var _0x1f0ba2;var _0x891569=squel[_0x91cb('0x6c')]();_0x891569[_0x91cb('0x6d')](_0x2e301a[_0x91cb('0x6e')]);for(var _0x43629b=0x0;_0x43629b<_0x474682[_0x91cb('0x36')];_0x43629b+=0x1){_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x6f')]?_0x51ab8a[_0x474682[_0x43629b][_0x91cb('0x6f')]][_0x91cb('0x70')]:_0x474682[_0x43629b][_0x91cb('0x64')];_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x365afd[_0x474682[_0x43629b][_0x91cb('0x71')]],'%s',_0x1f0ba2):_0x1f0ba2;_0x1f0ba2=_0x474682[_0x43629b]['format']?_[_0x91cb('0x72')](_0x5c2c01[_0x474682[_0x43629b][_0x91cb('0x73')]],'%s',_0x1f0ba2):_0x1f0ba2;if(_0x474682[_0x43629b]['groupBy']){_0x891569[_0x91cb('0x63')](_0x1f0ba2);}_0x474682[_0x43629b][_0x91cb('0x74')]&&_0x891569[_0x91cb('0x75')](_0x1f0ba2,_0x474682[_0x43629b]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x891569[_0x91cb('0x64')](_0x1f0ba2,_0x474682[_0x43629b]['alias']||_0x1f0ba2);}if(_0x2e301a['joins']){_0x2e301a[_0x91cb('0x77')]=JSON['parse'](_0x2e301a[_0x91cb('0x77')]);for(var _0x376f56=0x0;_0x376f56<_0x2e301a['joins'][_0x91cb('0x36')];_0x376f56+=0x1){if(_0x2e301a['joins'][_0x376f56][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0xe49d42,_0x2e301a['joins'][_0x376f56]['type'])&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')]&&_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignTable']&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x79')]){_0x891569[_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x2e')]](_0x2e301a['joins'][_0x376f56][_0x91cb('0x7a')],null,util['format'](_0x91cb('0x7b'),_0x2e301a[_0x91cb('0x6e')],_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')],_0x2e301a['joins'][_0x376f56]['foreignTable'],_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignKey']));}}}if(_0x2e301a[_0x91cb('0x7c')]){_0x2e301a[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2e301a[_0x91cb('0x7c')]);_0x891569[_0x91cb('0x3a')](_0x551836(_0x2e301a[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0xca33a2=_0x891569['clone']();_0x891569[_0x91cb('0x1c')](_0x47a6cd);_0x891569[_0x91cb('0x1b')](0x0);logger['debug'](_0x91cb('0x7e'),_0x891569['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x891569[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});}})[_0x91cb('0x23')](respondWithResult(_0x1986d7,null))[_0x91cb('0x45')](handleError(_0x1986d7,null));};function runReport(_0x23380a,_0x14cad8,_0x20a64f){var _0x11411d=_0x14cad8[_0x91cb('0x28')];var _0x14882d=0xa;var _0x22ba54=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),'cross_join'];var _0x1235c0={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':_0x91cb('0x84'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x91cb('0x59')};var _0xdee7f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x91cb('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x95f2de=function(_0x4d777a){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d777a);};var _0x443c01=function(_0x4e899c){if(!_0x4e899c||!_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x42d07b='(',_0x427afd=0x0;_0x427afd<_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')];_0x427afd+=0x1){_0x427afd>0x0&&(_0x42d07b+='\x20'+_0x4e899c[_0x91cb('0x62')]+'\x20');_0x42d07b+=_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]?_0x443c01(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]):_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x64')]+'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')]+(_0x95f2de(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')])?'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x86')]:'');}return _0x42d07b+')';};var _0x39b5bd={'where':{'id':_0x23380a['id']}},_0x315518,_0x3d944d,_0x43b96c,_0xe4d946,_0x32d426;_0x39b5bd=_['merge']({},_0x39b5bd,_0x20a64f);return db[_0x91cb('0x2b')][_0x91cb('0x44')](_0x39b5bd)[_0x91cb('0x23')](function(_0x1a654b){if(_0x1a654b){_0x315518=_0x1a654b;return _0x1a654b[_0x91cb('0x66')]();}return null;})[_0x91cb('0x23')](function(_0x404457){if(_0x404457){if(!_0x404457[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x3d944d=_0x404457;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})['then'](function(_0x5689ea){if(_0x5689ea){_0x43b96c=_[_0x91cb('0x6b')](_0x5689ea,'id');var _0x265ffb;var _0x4f66f=squel[_0x91cb('0x6c')]();_0x4f66f[_0x91cb('0x6d')](_0x315518[_0x91cb('0x6e')]);for(var _0x210b46=0x0;_0x210b46<_0x3d944d[_0x91cb('0x36')];_0x210b46+=0x1){_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x6f')]?_0x43b96c[_0x3d944d[_0x210b46][_0x91cb('0x6f')]]['metric']:_0x3d944d[_0x210b46][_0x91cb('0x64')];_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x71')]?_['replace'](_0x1235c0[_0x3d944d[_0x210b46][_0x91cb('0x71')]],'%s',_0x265ffb):_0x265ffb;_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x73')]?_['replace'](_0xdee7f[_0x3d944d[_0x210b46][_0x91cb('0x73')]],'%s',_0x265ffb):_0x265ffb;if(_0x3d944d[_0x210b46][_0x91cb('0x87')]){_0x4f66f[_0x91cb('0x63')](_0x265ffb);}_0x3d944d[_0x210b46][_0x91cb('0x74')]&&_0x4f66f[_0x91cb('0x75')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x74')]===_0x91cb('0x76')?![]:!![]);_0x4f66f[_0x91cb('0x64')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x88')]||_0x265ffb);}if(_0x315518[_0x91cb('0x77')]){_0x315518[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x315518['joins']);for(var _0x5c0725=0x0;_0x5c0725<_0x315518[_0x91cb('0x77')][_0x91cb('0x36')];_0x5c0725+=0x1){if(_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0x22ba54,_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')])&&_0x315518['joins'][_0x5c0725][_0x91cb('0x78')]&&_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')]&&_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]){_0x4f66f[_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]](_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')],null,util[_0x91cb('0x73')](_0x91cb('0x7b'),_0x315518[_0x91cb('0x6e')],_0x315518[_0x91cb('0x77')][_0x5c0725]['parentKey'],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x7a')],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]));}}}if(_0x315518['conditions']){_0x315518['conditions']=JSON['parse'](_0x315518[_0x91cb('0x7c')]);_0x4f66f[_0x91cb('0x3a')](_0x443c01(_0x315518[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0x32d426=_0x4f66f['clone']();_0x4f66f[_0x91cb('0x1c')](_0x14882d);_0x4f66f[_0x91cb('0x1b')](0x0);return;}})[_0x91cb('0x23')](function(){if(_0x14cad8[_0x91cb('0x89')]==='web'){return null;}var _0x4bf7c7=_[_0x91cb('0x3c')](_0x14cad8,{'name':_0x14cad8[_0x91cb('0x8a')]||_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],'basename':_0x11411d,'savename':util[_0x91cb('0x73')](_0x91cb('0x8b'),_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],require(_0x91cb('0x8c'))[_0x91cb('0x8d')](0x4),_0x14cad8[_0x91cb('0x89')]||_0x91cb('0x8e')),'reportId':_0x315518['id'],'reportType':_0x91cb('0x8f')});return db['AnalyticExtractedReport']['create'](_0x4bf7c7,{'raw':!![]});})[_0x91cb('0x23')](function(_0x48a910){if(_0x315518[_0x91cb('0x6e')]===_0x91cb('0x90')){_0x32d426[_0x91cb('0x3a')](_0x315518[_0x91cb('0x6e')]+_0x91cb('0x91'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}else{_0x32d426[_0x91cb('0x3a')](_0x315518['table']+_0x91cb('0x94'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}if(_0x48a910){logger[_0x91cb('0x95')](_0x91cb('0x96'),_0x32d426['toString']());require(_0x91cb('0x97'))[_0x91cb('0x98')](path[_0x91cb('0x50')](__dirname,_0x91cb('0x99'),_0x48a910[_0x91cb('0x89')]),[_0x48a910['id'],_0x32d426['toString'](),path[_0x91cb('0x50')](__dirname,_0x91cb('0x9a'),_0x48a910[_0x91cb('0x9b')]),_0x11411d]);return _0x48a910;}else{var _0x22b6d3=squel[_0x91cb('0x6c')]();_0x22b6d3[_0x91cb('0x6d')]('('+_0x32d426[_0x91cb('0x80')]()+')',_0x91cb('0x9c'));_0x22b6d3[_0x91cb('0x64')](_0x91cb('0x9d'),_0x91cb('0x1e'));_0x32d426[_0x91cb('0x1c')](_0x14cad8[_0x91cb('0x1c')]||_0x14882d);_0x32d426[_0x91cb('0x1b')](_0x14cad8[_0x91cb('0x1b')]||0x0);return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x22b6d3[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]})[_0x91cb('0x23')](function(_0x275c80){if(!_0x275c80[_0x91cb('0x36')]){_0xe4d946=0x0;}else{_0xe4d946=_0x275c80[0x0][_0x91cb('0x1e')]||0x0;}return dbH[_0x91cb('0x7f')]['query'](_0x32d426[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});})[_0x91cb('0x23')](function(_0x5ca377){return{'rows':_0x5ca377||[],'count':_0xe4d946};});}});}exports['run']=function(_0x552490,_0x5174ac){return runReport(_0x552490['params'],_0x552490[_0x91cb('0x31')],_0x552490[_0x91cb('0x3e')])[_0x91cb('0x23')](respondWithResult(_0x5174ac,null))[_0x91cb('0x45')](handleError(_0x5174ac,null));};exports[_0x91cb('0x9e')]=runReport;exports[_0x91cb('0x31')]=function(_0x3462c5,_0x146346){var _0xe3d97f=0xa;var _0x3b93c3=['join',_0x91cb('0x9f'),_0x91cb('0x51'),'cross_join'];var _0x154e6a={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x2a05af={'SEC_TO_TIME':_0x91cb('0xa0'),'DATE':_0x91cb('0x5a'),'HOUR':_0x91cb('0x85'),'ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x34c1f2=function(_0x4d82b4){return!_[_0x91cb('0x5d')]([_0x91cb('0xa1'),_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d82b4);};var _0x432099=function(_0x344c95){if(!_0x344c95||!_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x570cf0='(',_0xb3a6c4=0x0;_0xb3a6c4<_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')];_0xb3a6c4+=0x1){_0xb3a6c4>0x0&&(_0x570cf0+='\x20'+_0x344c95[_0x91cb('0x62')]+'\x20');_0x570cf0+=_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]?_0x432099(_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]):_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x64')]+'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x65')]+(_0x34c1f2(_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['condition'])?'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['value']:'');}return _0x570cf0+')';};var _0x39ba62={'where':{'id':_0x3462c5[_0x91cb('0x43')]['id']}},_0x2ab5a3,_0x10a9f6,_0x43ad75,_0x1382ba,_0x12da14;_0x39ba62=_[_0x91cb('0x3c')]({},_0x39ba62,_0x3462c5['options']);return db[_0x91cb('0x2b')]['find'](_0x39ba62)[_0x91cb('0x23')](function(_0x2f7387){if(_0x2f7387){_0x2ab5a3=_0x2f7387;return _0x2f7387[_0x91cb('0x66')]();}return null;})['then'](function(_0x1f2ef8){if(_0x1f2ef8){if(!_0x1f2ef8[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x10a9f6=_0x1f2ef8;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x3ac830){if(_0x3ac830){_0x43ad75=_['keyBy'](_0x3ac830,'id');var _0x469e62;var _0x1e9441=squel[_0x91cb('0x6c')]();_0x1e9441[_0x91cb('0x6d')](_0x2ab5a3[_0x91cb('0x6e')]);for(var _0x416390=0x0;_0x416390<_0x10a9f6[_0x91cb('0x36')];_0x416390+=0x1){_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x6f')]?_0x43ad75[_0x10a9f6[_0x416390]['MetricId']][_0x91cb('0x70')]:_0x10a9f6[_0x416390][_0x91cb('0x64')];_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x154e6a[_0x10a9f6[_0x416390]['function']],'%s',_0x469e62):_0x469e62;_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x73')]?_['replace'](_0x2a05af[_0x10a9f6[_0x416390][_0x91cb('0x73')]],'%s',_0x469e62):_0x469e62;if(_0x10a9f6[_0x416390][_0x91cb('0x87')]){_0x1e9441[_0x91cb('0x63')](_0x469e62);}_0x10a9f6[_0x416390][_0x91cb('0x74')]&&_0x1e9441[_0x91cb('0x75')](_0x469e62,_0x10a9f6[_0x416390]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x1e9441['field'](_0x469e62,_0x10a9f6[_0x416390]['alias']||_0x469e62);}if(_0x2ab5a3[_0x91cb('0x77')]){_0x2ab5a3[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x77')]);for(var _0x286ed7=0x0;_0x286ed7<_0x2ab5a3[_0x91cb('0x77')][_0x91cb('0x36')];_0x286ed7+=0x1){if(_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['type']&&_[_0x91cb('0x5d')](_0x3b93c3,_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x2e')])&&_0x2ab5a3['joins'][_0x286ed7]['parentKey']&&_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x7a')]&&_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x79')]){_0x1e9441[_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x2e')]](_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],null,util[_0x91cb('0x73')]('%s.%s\x20=\x20%s.%s',_0x2ab5a3[_0x91cb('0x6e')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x78')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['foreignKey']));}}}if(_0x2ab5a3[_0x91cb('0x7c')]){_0x2ab5a3[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x7c')]);_0x1e9441[_0x91cb('0x3a')](_0x432099(_0x2ab5a3['conditions'][_0x91cb('0x63')]));}_0x12da14=_0x1e9441[_0x91cb('0xa2')]();_0x1e9441[_0x91cb('0x1c')](_0xe3d97f);_0x1e9441[_0x91cb('0x1b')](0x0);logger[_0x91cb('0xa3')](_0x91cb('0x7e'),_0x1e9441['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x1e9441[_0x91cb('0x80')](),{'type':dbH['sequelize'][_0x91cb('0x81')]['SELECT']});}})[_0x91cb('0x23')](function(){return{'sql':_0x12da14[_0x91cb('0x80')]()};})[_0x91cb('0x23')](respondWithResult(_0x146346,null))[_0x91cb('0x45')](handleError(_0x146346,null));};
\ No newline at end of file
+var _0xe2fe=['set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','groupBy','orderBy','alias','joins','parse','type','foreignTable','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','SEC_TO_TIME(%s)','ROUND(%s)','IS\x20EMPTY','getFields','format','foreignKey','web','%s-%s.%s','randomstring','generate','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20EMPTY','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','api','../../mysqldb','dbH','status','json','offset','limit','undefined','count'];(function(_0x6b57b5,_0x6386ca){var _0x127d96=function(_0x24abc8){while(--_0x24abc8){_0x6b57b5['push'](_0x6b57b5['shift']());}};_0x127d96(++_0x6386ca);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xee2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xee2f('0x1'));var rp=require('request-promise');var moment=require(_0xee2f('0x2'));var BPromise=require(_0xee2f('0x3'));var Mustache=require(_0xee2f('0x4'));var util=require(_0xee2f('0x5'));var path=require(_0xee2f('0x6'));var sox=require('sox');var csv=require(_0xee2f('0x7'));var ejs=require(_0xee2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee2f('0x9'));var squel=require(_0xee2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xee2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xee2f('0x7'));var querystring=require(_0xee2f('0xc'));var Papa=require('papaparse');var Redis=require(_0xee2f('0xd'));var authService=require(_0xee2f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xee2f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee2f('0x10'))['db'];var dbH=require(_0xee2f('0x10'))[_0xee2f('0x11')];function respondWithStatusCode(_0x100449,_0x131874){_0x131874=_0x131874||0xcc;return function(_0x3ab91f){if(_0x3ab91f){return _0x100449['sendStatus'](_0x131874);}return _0x100449[_0xee2f('0x12')](_0x131874)['end']();};}function respondWithResult(_0x36db10,_0x271c1d){_0x271c1d=_0x271c1d||0xc8;return function(_0x48b30c){if(_0x48b30c){return _0x36db10[_0xee2f('0x12')](_0x271c1d)[_0xee2f('0x13')](_0x48b30c);}};}function respondWithFilteredResult(_0x28b614,_0x1bbf7d){return function(_0x390c2c){if(_0x390c2c){var _0x58f42a=typeof _0x1bbf7d[_0xee2f('0x14')]==='undefined'&&typeof _0x1bbf7d[_0xee2f('0x15')]===_0xee2f('0x16');var _0x502eb6=_0x390c2c['count'];var _0x40b5bc=_0x58f42a?0x0:_0x1bbf7d['offset'];var _0x69db88=_0x58f42a?_0x390c2c[_0xee2f('0x17')]:_0x1bbf7d[_0xee2f('0x14')]+_0x1bbf7d['limit'];var _0x35e1a4;if(_0x69db88>=_0x502eb6){_0x69db88=_0x502eb6;_0x35e1a4=0xc8;}else{_0x35e1a4=0xce;}_0x28b614[_0xee2f('0x12')](_0x35e1a4);return _0x28b614[_0xee2f('0x18')](_0xee2f('0x19'),_0x40b5bc+'-'+_0x69db88+'/'+_0x502eb6)[_0xee2f('0x13')](_0x390c2c);}return null;};}function patchUpdates(_0x5d36d4){return function(_0x5e73ad){try{jsonpatch[_0xee2f('0x1a')](_0x5e73ad,_0x5d36d4,!![]);}catch(_0x3a1852){return BPromise[_0xee2f('0x1b')](_0x3a1852);}return _0x5e73ad[_0xee2f('0x1c')]();};}function saveUpdates(_0x472e3b,_0xf278cc){return function(_0x39a39c){if(_0x39a39c){return _0x39a39c['update'](_0x472e3b)[_0xee2f('0x1d')](function(_0x2c47c5){return _0x2c47c5;});}return null;};}function removeEntity(_0x15ceda,_0x70e308){return function(_0x820101){if(_0x820101){return _0x820101[_0xee2f('0x1e')]()[_0xee2f('0x1d')](function(){var _0x13013f=_0x820101[_0xee2f('0x1f')]({'plain':!![]});var _0x1e394f=_0xee2f('0x20');return db[_0xee2f('0x21')][_0xee2f('0x1e')]({'where':{'type':_0x1e394f,'resourceId':_0x13013f['id']}})[_0xee2f('0x1d')](function(){return _0x820101;});})['then'](function(){_0x15ceda['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18bdbb,_0x18ff19){return function(_0x2cb0cb){if(!_0x2cb0cb){_0x18bdbb[_0xee2f('0x22')](0x194);}return _0x2cb0cb;};}function handleError(_0x892a4e,_0x3737fd){_0x3737fd=_0x3737fd||0x1f4;return function(_0x4d8398){logger[_0xee2f('0x23')](_0x4d8398['stack']);if(_0x4d8398[_0xee2f('0x24')]){delete _0x4d8398[_0xee2f('0x24')];}_0x892a4e[_0xee2f('0x12')](_0x3737fd)[_0xee2f('0x25')](_0x4d8398);};}exports[_0xee2f('0x26')]=function(_0x47d5a6,_0x310c0b){var _0xd16e35={},_0x56706e={},_0x4ee0e1={'count':0x0,'rows':[]};var _0xd1aaac=_['map'](db[_0xee2f('0x27')][_0xee2f('0x28')],function(_0x53d9b7){return{'name':_0x53d9b7[_0xee2f('0x29')],'type':_0x53d9b7['type']['key']};});_0x56706e['model']=_[_0xee2f('0x2a')](_0xd1aaac,_0xee2f('0x24'));_0x56706e['query']=_[_0xee2f('0x2b')](_0x47d5a6[_0xee2f('0x2c')]);_0x56706e[_0xee2f('0x2d')]=_[_0xee2f('0x2e')](_0x56706e[_0xee2f('0x2f')],_0x56706e['query']);_0xd16e35[_0xee2f('0x30')]=_['intersection'](_0x56706e[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x47d5a6[_0xee2f('0x2c')]['fields']));_0xd16e35[_0xee2f('0x30')]=_0xd16e35['attributes'][_0xee2f('0x32')]?_0xd16e35['attributes']:_0x56706e[_0xee2f('0x2f')];if(!_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x33')](_0xee2f('0x34'))){_0xd16e35[_0xee2f('0x15')]=qs[_0xee2f('0x15')](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x15')]);_0xd16e35[_0xee2f('0x14')]=qs[_0xee2f('0x14')](_0x47d5a6[_0xee2f('0x2c')]['offset']);}_0xd16e35[_0xee2f('0x35')]=qs['sort'](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x36')]);_0xd16e35[_0xee2f('0x37')]=qs[_0xee2f('0x2d')](_[_0xee2f('0x38')](_0x47d5a6[_0xee2f('0x2c')],_0x56706e[_0xee2f('0x2d')]),_0xd1aaac);if(_0x47d5a6[_0xee2f('0x2c')]['filter']){_0xd16e35['where']=_['merge'](_0xd16e35[_0xee2f('0x37')],{'$or':_['map'](_0xd1aaac,function(_0x4501c4){if(_0x4501c4['type']!=='VIRTUAL'){var _0x5027a6={};_0x5027a6[_0x4501c4['name']]={'$like':'%'+_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x39')]+'%'};return _0x5027a6;}})});}_0xd16e35=_[_0xee2f('0x3a')]({},_0xd16e35,_0x47d5a6[_0xee2f('0x3b')]);var _0x4823a7={'where':_0xd16e35['where']};return db[_0xee2f('0x27')]['count'](_0x4823a7)['then'](function(_0x8204dc){_0x4ee0e1[_0xee2f('0x17')]=_0x8204dc;if(_0x47d5a6[_0xee2f('0x2c')]['includeAll']){_0xd16e35[_0xee2f('0x3c')]=[{'all':!![]}];}return db[_0xee2f('0x27')][_0xee2f('0x3d')](_0xd16e35);})['then'](function(_0x5896f6){_0x4ee0e1[_0xee2f('0x3e')]=_0x5896f6;return _0x4ee0e1;})[_0xee2f('0x1d')](respondWithFilteredResult(_0x310c0b,_0xd16e35))[_0xee2f('0x3f')](handleError(_0x310c0b,null));};exports[_0xee2f('0x40')]=function(_0x541fa0,_0x20697e){var _0x1df63d={'raw':!![],'where':{'id':_0x541fa0[_0xee2f('0x41')]['id']}},_0x242e91={};_0x242e91[_0xee2f('0x2f')]=_[_0xee2f('0x2b')](db[_0xee2f('0x27')][_0xee2f('0x28')]);_0x242e91[_0xee2f('0x2c')]=_[_0xee2f('0x2b')](_0x541fa0['query']);_0x242e91['filters']=_['intersection'](_0x242e91['model'],_0x242e91[_0xee2f('0x2c')]);_0x1df63d[_0xee2f('0x30')]=_[_0xee2f('0x2e')](_0x242e91[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x541fa0['query'][_0xee2f('0x31')]));_0x1df63d[_0xee2f('0x30')]=_0x1df63d[_0xee2f('0x30')][_0xee2f('0x32')]?_0x1df63d['attributes']:_0x242e91['model'];if(_0x541fa0['query'][_0xee2f('0x42')]){_0x1df63d['include']=[{'all':!![]}];}_0x1df63d=_['merge']({},_0x1df63d,_0x541fa0['options']);return db['AnalyticDefaultReport'][_0xee2f('0x43')](_0x1df63d)[_0xee2f('0x1d')](handleEntityNotFound(_0x20697e,null))[_0xee2f('0x1d')](respondWithResult(_0x20697e,null))['catch'](handleError(_0x20697e,null));};exports[_0xee2f('0x44')]=function(_0x57f65d,_0x3d95b8){return db[_0xee2f('0x27')][_0xee2f('0x44')](_0x57f65d[_0xee2f('0x45')],{})[_0xee2f('0x1d')](function(_0x4978eb){var _0x533ad0=_0x57f65d[_0xee2f('0x46')]['get']({'plain':!![]});if(!_0x533ad0)throw new Error(_0xee2f('0x47'));if(_0x533ad0[_0xee2f('0x48')]===_0xee2f('0x46')){var _0x88e683=_0x4978eb['get']({'plain':!![]});var _0x5df503=_0xee2f('0x49');return db[_0xee2f('0x4a')][_0xee2f('0x43')]({'where':{'name':_0x5df503,'userProfileId':_0x533ad0[_0xee2f('0x4b')]},'raw':!![]})[_0xee2f('0x1d')](function(_0x2a450f){if(_0x2a450f&&_0x2a450f[_0xee2f('0x4c')]===0x0){return db[_0xee2f('0x21')][_0xee2f('0x44')]({'name':_0x88e683[_0xee2f('0x24')],'resourceId':_0x88e683['id'],'type':_0xee2f('0x20'),'sectionId':_0x2a450f['id']},{})[_0xee2f('0x1d')](function(){return _0x4978eb;});}else{return _0x4978eb;}})['catch'](function(_0x34cb51){logger[_0xee2f('0x23')](_0xee2f('0x4d'),_0x34cb51);throw _0x34cb51;});}return _0x4978eb;})[_0xee2f('0x1d')](respondWithResult(_0x3d95b8,0xc9))['catch'](handleError(_0x3d95b8,null));};exports[_0xee2f('0x4e')]=function(_0xb3bf3f,_0x3a476f){if(_0xb3bf3f[_0xee2f('0x45')]['id']){delete _0xb3bf3f[_0xee2f('0x45')]['id'];}return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0xb3bf3f['params']['id']}})['then'](handleEntityNotFound(_0x3a476f,null))[_0xee2f('0x1d')](saveUpdates(_0xb3bf3f[_0xee2f('0x45')],null))[_0xee2f('0x1d')](respondWithResult(_0x3a476f,null))[_0xee2f('0x3f')](handleError(_0x3a476f,null));};exports[_0xee2f('0x1e')]=function(_0x101e09,_0x20aaca){return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0x101e09[_0xee2f('0x41')]['id']}})[_0xee2f('0x1d')](handleEntityNotFound(_0x20aaca,null))[_0xee2f('0x1d')](removeEntity(_0x20aaca,null))[_0xee2f('0x3f')](handleError(_0x20aaca,null));};exports[_0xee2f('0x4f')]=function(_0xcba6fc,_0x2b9636){var _0x1373a1=0xa;var _0x5d6c40=[_0xee2f('0x50'),'left_join',_0xee2f('0x51'),_0xee2f('0x52')];var _0x1dbbf2={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':_0xee2f('0x56'),'AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4fb159={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x1421da=function(_0xd967e9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),_0xee2f('0x5d'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xd967e9);};var _0x1708c5=function(_0x58e464){if(!_0x58e464||!_0x58e464[_0xee2f('0x5e')]['length']){return'';}for(var _0x7167f9='(',_0x59af84=0x0;_0x59af84<_0x58e464[_0xee2f('0x5e')][_0xee2f('0x32')];_0x59af84+=0x1){_0x59af84>0x0&&(_0x7167f9+='\x20'+_0x58e464[_0xee2f('0x5f')]+'\x20');_0x7167f9+=_0x58e464['rules'][_0x59af84][_0xee2f('0x60')]?_0x1708c5(_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x60')]):_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x61')]+'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x62')]+(_0x1421da(_0x58e464['rules'][_0x59af84][_0xee2f('0x62')])?'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x63')]:'');}return _0x7167f9+')';};var _0x353bd9={'where':{'id':_0xcba6fc[_0xee2f('0x41')]['id']}},_0x5280c7,_0x3c9d47,_0x8ccc9d,_0x15c7ff,_0x191af8;_0x353bd9=_[_0xee2f('0x3a')]({},_0x353bd9,_0xcba6fc['options']);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x353bd9)['then'](function(_0x9252e3){if(_0x9252e3){_0x5280c7=_0x9252e3;return _0x9252e3['getFields']();}return null;})[_0xee2f('0x1d')](function(_0x4ed7c9){if(_0x4ed7c9){if(!_0x4ed7c9['length']){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x3c9d47=_0x4ed7c9;return db[_0xee2f('0x67')][_0xee2f('0x3d')]({'raw':!![]});}return null;})['then'](function(_0x238e7d){if(_0x238e7d){_0x8ccc9d=_[_0xee2f('0x68')](_0x238e7d,'id');var _0x42fae8;var _0x5d4fe8=squel[_0xee2f('0x69')]();_0x5d4fe8[_0xee2f('0x6a')](_0x5280c7['table']);for(var _0x1f1c55=0x0;_0x1f1c55<_0x3c9d47[_0xee2f('0x32')];_0x1f1c55+=0x1){_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]?_0x8ccc9d[_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x3c9d47[_0x1f1c55][_0xee2f('0x61')];_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x1dbbf2[_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]],'%s',_0x42fae8):_0x42fae8;_0x42fae8=_0x3c9d47[_0x1f1c55]['format']?_['replace'](_0x4fb159[_0x3c9d47[_0x1f1c55]['format']],'%s',_0x42fae8):_0x42fae8;if(_0x3c9d47[_0x1f1c55][_0xee2f('0x6f')]){_0x5d4fe8[_0xee2f('0x60')](_0x42fae8);}_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]&&_0x5d4fe8[_0xee2f('0x35')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x5d4fe8[_0xee2f('0x61')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x71')]||_0x42fae8);}if(_0x5280c7['joins']){_0x5280c7[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x72')]);for(var _0x5a7b6c=0x0;_0x5a7b6c<_0x5280c7[_0xee2f('0x72')]['length'];_0x5a7b6c+=0x1){if(_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]&&_['includes'](_0x5d6c40,_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')])&&_0x5280c7['joins'][_0x5a7b6c]['parentKey']&&_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')]&&_0x5280c7['joins'][_0x5a7b6c]['foreignKey']){_0x5d4fe8[_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]](_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')],null,util['format'](_0xee2f('0x76'),_0x5280c7[_0xee2f('0x77')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x78')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x75')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c]['foreignKey']));}}}if(_0x5280c7[_0xee2f('0x79')]){_0x5280c7[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x79')]);_0x5d4fe8[_0xee2f('0x37')](_0x1708c5(_0x5280c7['conditions'][_0xee2f('0x60')]));}_0x191af8=_0x5d4fe8[_0xee2f('0x7a')]();_0x5d4fe8[_0xee2f('0x15')](_0x1373a1);_0x5d4fe8[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x5d4fe8['toString']());return dbH['sequelize'][_0xee2f('0x2c')](_0x5d4fe8[_0xee2f('0x7d')](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](respondWithResult(_0x2b9636,null))[_0xee2f('0x3f')](handleError(_0x2b9636,null));};function runReport(_0x58c49e,_0x5b7b55,_0x2ad26d){var _0x27eabc=_0x5b7b55[_0xee2f('0x24')];var _0xc92046=0xa;var _0x38ee46=[_0xee2f('0x50'),_0xee2f('0x81'),_0xee2f('0x51'),_0xee2f('0x52')];var _0x21ac2d={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xee2f('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2ea31f={'SEC_TO_TIME':_0xee2f('0x82'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x18e191=function(_0x4fad8f){return!_['includes']([_0xee2f('0x5c'),_0xee2f('0x5d'),_0xee2f('0x84'),'IS\x20NOT\x20EMPTY'],_0x4fad8f);};var _0xd7c8f8=function(_0x4b0611){if(!_0x4b0611||!_0x4b0611[_0xee2f('0x5e')]['length']){return'';}for(var _0x378fc9='(',_0x25a3b9=0x0;_0x25a3b9<_0x4b0611[_0xee2f('0x5e')]['length'];_0x25a3b9+=0x1){_0x25a3b9>0x0&&(_0x378fc9+='\x20'+_0x4b0611['operator']+'\x20');_0x378fc9+=_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x60')]?_0xd7c8f8(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9]['group']):_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x61')]+'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')]+(_0x18e191(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')])?'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x63')]:'');}return _0x378fc9+')';};var _0x449656={'where':{'id':_0x58c49e['id']}},_0x1db0b5,_0x9f06f9,_0x659080,_0x28bde7,_0x214f94;_0x449656=_['merge']({},_0x449656,_0x2ad26d);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x449656)[_0xee2f('0x1d')](function(_0x2f5ed7){if(_0x2f5ed7){_0x1db0b5=_0x2f5ed7;return _0x2f5ed7[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x34cd09){if(_0x34cd09){if(!_0x34cd09[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x9f06f9=_0x34cd09;return db['AnalyticMetric'][_0xee2f('0x3d')]({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x1422e9){if(_0x1422e9){_0x659080=_[_0xee2f('0x68')](_0x1422e9,'id');var _0x53d769;var _0x15ca4e=squel[_0xee2f('0x69')]();_0x15ca4e[_0xee2f('0x6a')](_0x1db0b5['table']);for(var _0x4f02aa=0x0;_0x4f02aa<_0x9f06f9[_0xee2f('0x32')];_0x4f02aa+=0x1){_0x53d769=_0x9f06f9[_0x4f02aa]['MetricId']?_0x659080[_0x9f06f9[_0x4f02aa]['MetricId']]['metric']:_0x9f06f9[_0x4f02aa][_0xee2f('0x61')];_0x53d769=_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x21ac2d[_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]],'%s',_0x53d769):_0x53d769;_0x53d769=_0x9f06f9[_0x4f02aa]['format']?_[_0xee2f('0x6e')](_0x2ea31f[_0x9f06f9[_0x4f02aa][_0xee2f('0x86')]],'%s',_0x53d769):_0x53d769;if(_0x9f06f9[_0x4f02aa][_0xee2f('0x6f')]){_0x15ca4e['group'](_0x53d769);}_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]&&_0x15ca4e['order'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x15ca4e['field'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x71')]||_0x53d769);}if(_0x1db0b5['joins']){_0x1db0b5[_0xee2f('0x72')]=JSON['parse'](_0x1db0b5['joins']);for(var _0x149d7f=0x0;_0x149d7f<_0x1db0b5[_0xee2f('0x72')]['length'];_0x149d7f+=0x1){if(_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x74')]&&_['includes'](_0x38ee46,_0x1db0b5['joins'][_0x149d7f][_0xee2f('0x74')])&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['parentKey']&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')]&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]){_0x15ca4e[_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['type']](_0x1db0b5['joins'][_0x149d7f]['foreignTable'],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x1db0b5[_0xee2f('0x77')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x78')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]));}}}if(_0x1db0b5[_0xee2f('0x79')]){_0x1db0b5[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x1db0b5[_0xee2f('0x79')]);_0x15ca4e[_0xee2f('0x37')](_0xd7c8f8(_0x1db0b5[_0xee2f('0x79')][_0xee2f('0x60')]));}_0x214f94=_0x15ca4e['clone']();_0x15ca4e['limit'](_0xc92046);_0x15ca4e[_0xee2f('0x14')](0x0);return;}})[_0xee2f('0x1d')](function(){if(_0x5b7b55['output']===_0xee2f('0x88')){return null;}var _0x444c39=_[_0xee2f('0x3a')](_0x5b7b55,{'name':_0x5b7b55['fullPath']||_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],'basename':_0x27eabc,'savename':util[_0xee2f('0x86')](_0xee2f('0x89'),_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],require(_0xee2f('0x8a'))[_0xee2f('0x8b')](0x4),_0x5b7b55[_0xee2f('0x8c')]||'csv'),'reportId':_0x1db0b5['id'],'reportType':_0xee2f('0x8d')});return db[_0xee2f('0x8e')][_0xee2f('0x44')](_0x444c39,{'raw':!![]});})[_0xee2f('0x1d')](function(_0xe7e196){if(_0x1db0b5[_0xee2f('0x77')]===_0xee2f('0x8f')){_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+_0xee2f('0x90'),_0x5b7b55[_0xee2f('0x91')],_0x5b7b55['endDate']);}else{_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b7b55[_0xee2f('0x91')],_0x5b7b55[_0xee2f('0x92')]);}if(_0xe7e196){logger[_0xee2f('0x93')](_0xee2f('0x94'),_0x214f94[_0xee2f('0x7d')]());require(_0xee2f('0x95'))['fork'](path[_0xee2f('0x50')](__dirname,_0xee2f('0x96'),_0xe7e196['output']),[_0xe7e196['id'],_0x214f94[_0xee2f('0x7d')](),path[_0xee2f('0x50')](__dirname,'../../files/reports',_0xe7e196[_0xee2f('0x97')]),_0x27eabc]);return _0xe7e196;}else{var _0x26dd6c=squel[_0xee2f('0x69')]();_0x26dd6c[_0xee2f('0x6a')]('('+_0x214f94[_0xee2f('0x7d')]()+')',_0xee2f('0x98'));_0x26dd6c[_0xee2f('0x61')](_0xee2f('0x99'),_0xee2f('0x17'));_0x214f94[_0xee2f('0x15')](_0x5b7b55[_0xee2f('0x15')]||_0xc92046);_0x214f94[_0xee2f('0x14')](_0x5b7b55['offset']||0x0);return dbH[_0xee2f('0x7e')]['query'](_0x26dd6c['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')]['SELECT']})[_0xee2f('0x1d')](function(_0x472f83){if(!_0x472f83[_0xee2f('0x32')]){_0x28bde7=0x0;}else{_0x28bde7=_0x472f83[0x0]['count']||0x0;}return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x214f94['toString'](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});})[_0xee2f('0x1d')](function(_0x121a34){return{'rows':_0x121a34||[],'count':_0x28bde7};});}});}exports[_0xee2f('0x9a')]=function(_0x3d8c56,_0x5c8550){return runReport(_0x3d8c56[_0xee2f('0x41')],_0x3d8c56[_0xee2f('0x2c')],_0x3d8c56['options'])[_0xee2f('0x1d')](respondWithResult(_0x5c8550,null))[_0xee2f('0x3f')](handleError(_0x5c8550,null));};exports[_0xee2f('0x9b')]=runReport;exports['query']=function(_0x40fa57,_0x1fafcc){var _0x1163f1=0xa;var _0x162014=[_0xee2f('0x50'),_0xee2f('0x81'),'right_join',_0xee2f('0x52')];var _0xb93091={'SUM':_0xee2f('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':'MIN(%s)','AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xee2f('0x9c')};var _0x39922f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1c9f70=function(_0xa93dc9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),'IS\x20NOT\x20NULL',_0xee2f('0x84'),_0xee2f('0x9d')],_0xa93dc9);};var _0x44b06b=function(_0x541ac7){if(!_0x541ac7||!_0x541ac7[_0xee2f('0x5e')][_0xee2f('0x32')]){return'';}for(var _0xa89897='(',_0x2def5c=0x0;_0x2def5c<_0x541ac7['rules']['length'];_0x2def5c+=0x1){_0x2def5c>0x0&&(_0xa89897+='\x20'+_0x541ac7[_0xee2f('0x5f')]+'\x20');_0xa89897+=_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x60')]?_0x44b06b(_0x541ac7['rules'][_0x2def5c][_0xee2f('0x60')]):_0x541ac7[_0xee2f('0x5e')][_0x2def5c]['field']+'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')]+(_0x1c9f70(_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')])?'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x63')]:'');}return _0xa89897+')';};var _0x3f9188={'where':{'id':_0x40fa57['params']['id']}},_0x236b63,_0x4ad336,_0x3370de,_0x3c8c20,_0xc9228;_0x3f9188=_[_0xee2f('0x3a')]({},_0x3f9188,_0x40fa57[_0xee2f('0x3b')]);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x3f9188)[_0xee2f('0x1d')](function(_0xa0dfdd){if(_0xa0dfdd){_0x236b63=_0xa0dfdd;return _0xa0dfdd[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x298dfa){if(_0x298dfa){if(!_0x298dfa[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4ad336=_0x298dfa;return db[_0xee2f('0x67')]['findAll']({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x35a1c9){if(_0x35a1c9){_0x3370de=_['keyBy'](_0x35a1c9,'id');var _0x464e9e;var _0x738f35=squel[_0xee2f('0x69')]();_0x738f35[_0xee2f('0x6a')](_0x236b63[_0xee2f('0x77')]);for(var _0xe24a8a=0x0;_0xe24a8a<_0x4ad336['length'];_0xe24a8a+=0x1){_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]?_0x3370de[_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x4ad336[_0xe24a8a][_0xee2f('0x61')];_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0xb93091[_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]],'%s',_0x464e9e):_0x464e9e;_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x86')]?_[_0xee2f('0x6e')](_0x39922f[_0x4ad336[_0xe24a8a][_0xee2f('0x86')]],'%s',_0x464e9e):_0x464e9e;if(_0x4ad336[_0xe24a8a]['groupBy']){_0x738f35[_0xee2f('0x60')](_0x464e9e);}_0x4ad336[_0xe24a8a][_0xee2f('0x70')]&&_0x738f35[_0xee2f('0x35')](_0x464e9e,_0x4ad336[_0xe24a8a]['orderBy']==='DESC'?![]:!![]);_0x738f35[_0xee2f('0x61')](_0x464e9e,_0x4ad336[_0xe24a8a][_0xee2f('0x71')]||_0x464e9e);}if(_0x236b63[_0xee2f('0x72')]){_0x236b63[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x236b63['joins']);for(var _0x1cee16=0x0;_0x1cee16<_0x236b63[_0xee2f('0x72')]['length'];_0x1cee16+=0x1){if(_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]&&_[_0xee2f('0x5b')](_0x162014,_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')])&&_0x236b63[_0xee2f('0x72')][_0x1cee16]['parentKey']&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')]&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]){_0x738f35[_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]](_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x236b63[_0xee2f('0x77')],_0x236b63['joins'][_0x1cee16][_0xee2f('0x78')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]));}}}if(_0x236b63[_0xee2f('0x79')]){_0x236b63['conditions']=JSON[_0xee2f('0x73')](_0x236b63[_0xee2f('0x79')]);_0x738f35[_0xee2f('0x37')](_0x44b06b(_0x236b63[_0xee2f('0x79')]['group']));}_0xc9228=_0x738f35[_0xee2f('0x7a')]();_0x738f35[_0xee2f('0x15')](_0x1163f1);_0x738f35[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x738f35[_0xee2f('0x7d')]());return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x738f35['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](function(){return{'sql':_0xc9228['toString']()};})[_0xee2f('0x1d')](respondWithResult(_0x1fafcc,null))['catch'](handleError(_0x1fafcc,null));};
\ No newline at end of file
index 60fcdf5..0eb9de8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa51e=['define','analytics_default_reports','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports'];(function(_0x30433e,_0x37960c){var _0xb59e95=function(_0x58fc82){while(--_0x58fc82){_0x30433e['push'](_0x30433e['shift']());}};_0xb59e95(++_0x37960c);}(_0xa51e,0x176));var _0xea51=function(_0x1439e6,_0x2634b8){_0x1439e6=_0x1439e6-0x0;var _0x1101a9=_0xa51e[_0x1439e6];return _0x1101a9;};'use strict';var _=require('lodash');var util=require(_0xea51('0x0'));var logger=require('../../config/logger')(_0xea51('0x1'));var moment=require(_0xea51('0x2'));var BPromise=require(_0xea51('0x3'));var rp=require(_0xea51('0x4'));var fs=require('fs');var path=require(_0xea51('0x5'));var rimraf=require(_0xea51('0x6'));var config=require(_0xea51('0x7'));var attributes=require(_0xea51('0x8'));module[_0xea51('0x9')]=function(_0x439266,_0xaf9b90){return _0x439266[_0xea51('0xa')]('AnalyticDefaultReport',attributes,{'tableName':_0xea51('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x06da=['../../config/environment','define','AnalyticDefaultReport','analytics_default_reports','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xd93834,_0x86798a){var _0x22dd47=function(_0xa5f866){while(--_0xa5f866){_0xd93834['push'](_0xd93834['shift']());}};_0x22dd47(++_0x86798a);}(_0x06da,0x7d));var _0xa06d=function(_0x3ae5f8,_0x26c8bc){_0x3ae5f8=_0x3ae5f8-0x0;var _0x205b12=_0x06da[_0x3ae5f8];return _0x205b12;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa06d('0x0'))(_0xa06d('0x1'));var moment=require(_0xa06d('0x2'));var BPromise=require(_0xa06d('0x3'));var rp=require(_0xa06d('0x4'));var fs=require('fs');var path=require(_0xa06d('0x5'));var rimraf=require(_0xa06d('0x6'));var config=require(_0xa06d('0x7'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x3b3b37,_0x43a2c9){return _0x3b3b37[_0xa06d('0x8')](_0xa06d('0x9'),attributes,{'tableName':_0xa06d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7239c63..dca9445 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec38=['catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xec38,0x15a));var _0x8ec3=function(_0x4ff120,_0x30ee0b){_0x4ff120=_0x4ff120-0x0;var _0x1a8437=_0xec38[_0x4ff120];return _0x1a8437;};'use strict';var _=require(_0x8ec3('0x0'));var util=require('util');var moment=require(_0x8ec3('0x1'));var BPromise=require(_0x8ec3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8ec3('0x3'));var db=require(_0x8ec3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8ec3('0x5'))(_0x8ec3('0x6'));var config=require('../../config/environment');var jayson=require(_0x8ec3('0x7'));var client=jayson[_0x8ec3('0x8')][_0x8ec3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x180ccf,_0x11ad19,_0x53619f){return new BPromise(function(_0x3cab6b,_0x3cc7c9){return client[_0x8ec3('0xa')](_0x180ccf,_0x53619f)[_0x8ec3('0xb')](function(_0x595c5e){logger[_0x8ec3('0xc')](_0x8ec3('0xd'),_0x11ad19,'request\x20sent');logger[_0x8ec3('0xe')](_0x8ec3('0xf'),_0x11ad19,_0x8ec3('0x10'),JSON[_0x8ec3('0x11')](_0x595c5e));if(_0x595c5e[_0x8ec3('0x12')]){if(_0x595c5e[_0x8ec3('0x12')][_0x8ec3('0x13')]===0x1f4){logger[_0x8ec3('0x12')](_0x8ec3('0xd'),_0x11ad19,_0x595c5e['error'][_0x8ec3('0x14')]);return _0x3cc7c9(_0x595c5e[_0x8ec3('0x12')][_0x8ec3('0x14')]);}logger['error'](_0x8ec3('0xd'),_0x11ad19,_0x595c5e[_0x8ec3('0x12')]['message']);return _0x3cab6b(_0x595c5e[_0x8ec3('0x12')][_0x8ec3('0x14')]);}else{logger[_0x8ec3('0xc')](_0x8ec3('0xd'),_0x11ad19,_0x8ec3('0x10'));_0x3cab6b(_0x595c5e[_0x8ec3('0x15')][_0x8ec3('0x14')]);}})[_0x8ec3('0x16')](function(_0x11e826){logger[_0x8ec3('0x12')](_0x8ec3('0xd'),_0x11ad19,_0x11e826);_0x3cc7c9(_0x11e826);});});}
\ No newline at end of file
+var _0x5cb5=['AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5cb5,0x7a));var _0x55cb=function(_0x211530,_0x3ea767){_0x211530=_0x211530-0x0;var _0x3b5427=_0x5cb5[_0x211530];return _0x3b5427;};'use strict';var _=require(_0x55cb('0x0'));var util=require(_0x55cb('0x1'));var moment=require(_0x55cb('0x2'));var BPromise=require(_0x55cb('0x3'));var rs=require(_0x55cb('0x4'));var fs=require('fs');var Redis=require(_0x55cb('0x5'));var db=require(_0x55cb('0x6'))['db'];var utils=require(_0x55cb('0x7'));var logger=require(_0x55cb('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x55cb('0x9'));var client=jayson[_0x55cb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f986c,_0x526023,_0x1c5427){return new BPromise(function(_0x12eebb,_0x21a3ba){return client[_0x55cb('0xb')](_0x1f986c,_0x1c5427)[_0x55cb('0xc')](function(_0x56ef01){logger[_0x55cb('0xd')](_0x55cb('0xe'),_0x526023,'request\x20sent');logger[_0x55cb('0xf')](_0x55cb('0x10'),_0x526023,'request\x20sent',JSON[_0x55cb('0x11')](_0x56ef01));if(_0x56ef01[_0x55cb('0x12')]){if(_0x56ef01[_0x55cb('0x12')][_0x55cb('0x13')]===0x1f4){logger[_0x55cb('0x12')](_0x55cb('0xe'),_0x526023,_0x56ef01['error'][_0x55cb('0x14')]);return _0x21a3ba(_0x56ef01[_0x55cb('0x12')][_0x55cb('0x14')]);}logger[_0x55cb('0x12')](_0x55cb('0xe'),_0x526023,_0x56ef01[_0x55cb('0x12')][_0x55cb('0x14')]);return _0x12eebb(_0x56ef01['error'][_0x55cb('0x14')]);}else{logger[_0x55cb('0xd')](_0x55cb('0xe'),_0x526023,_0x55cb('0x15'));_0x12eebb(_0x56ef01['result'][_0x55cb('0x14')]);}})[_0x55cb('0x16')](function(_0x1c53bd){logger['error'](_0x55cb('0xe'),_0x526023,_0x1c53bd);_0x21a3ba(_0x1c53bd);});});}
\ No newline at end of file
index 28d35f3..4ce900c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf097=['delete','/:id','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put'];(function(_0x47458a,_0x494317){var _0x11955e=function(_0x35acd3){while(--_0x35acd3){_0x47458a['push'](_0x47458a['shift']());}};_0x11955e(++_0x494317);}(_0xf097,0x10c));var _0x7f09=function(_0x45cd76,_0x2e2a5b){_0x45cd76=_0x45cd76-0x0;var _0x55918d=_0xf097[_0x45cd76];return _0x55918d;};'use strict';var multer=require(_0x7f09('0x0'));var util=require('util');var path=require(_0x7f09('0x1'));var timeout=require(_0x7f09('0x2'));var express=require('express');var router=express[_0x7f09('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7f09('0x4'));var interaction=require(_0x7f09('0x5'));var config=require(_0x7f09('0x6'));var controller=require(_0x7f09('0x7'));router[_0x7f09('0x8')]('/',auth[_0x7f09('0x9')](),controller[_0x7f09('0xa')]);router[_0x7f09('0x8')]('/:id',auth[_0x7f09('0x9')](),controller[_0x7f09('0xb')]);router[_0x7f09('0x8')](_0x7f09('0xc'),auth['isAuthenticated'](),controller[_0x7f09('0xd')]);router[_0x7f09('0x8')](_0x7f09('0xe'),auth['isAuthenticated'](),controller[_0x7f09('0xf')]);router[_0x7f09('0x8')](_0x7f09('0x10'),auth[_0x7f09('0x9')](),controller[_0x7f09('0x11')]);router[_0x7f09('0x12')]('/',auth[_0x7f09('0x9')](),controller['create']);router[_0x7f09('0x13')]('/:id',auth[_0x7f09('0x9')](),controller['update']);router[_0x7f09('0x14')](_0x7f09('0x15'),auth[_0x7f09('0x9')](),controller[_0x7f09('0x16')]);module[_0x7f09('0x17')]=router;
\ No newline at end of file
+var _0x2471=['../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','preview','/:id/run','run','/:id/query','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4b8a30,_0x425c5f){var _0x4edde5=function(_0x2a098d){while(--_0x2a098d){_0x4b8a30['push'](_0x4b8a30['shift']());}};_0x4edde5(++_0x425c5f);}(_0x2471,0x70));var _0x1247=function(_0x8d13fa,_0x2a7e7b){_0x8d13fa=_0x8d13fa-0x0;var _0x3d207b=_0x2471[_0x8d13fa];return _0x3d207b;};'use strict';var multer=require('multer');var util=require(_0x1247('0x0'));var path=require(_0x1247('0x1'));var timeout=require(_0x1247('0x2'));var express=require(_0x1247('0x3'));var router=express[_0x1247('0x4')]();var fs_extra=require(_0x1247('0x5'));var auth=require(_0x1247('0x6'));var interaction=require(_0x1247('0x7'));var config=require(_0x1247('0x8'));var controller=require(_0x1247('0x9'));router[_0x1247('0xa')]('/',auth[_0x1247('0xb')](),controller[_0x1247('0xc')]);router[_0x1247('0xa')](_0x1247('0xd'),auth[_0x1247('0xb')](),controller['show']);router[_0x1247('0xa')]('/:id/preview',auth[_0x1247('0xb')](),controller[_0x1247('0xe')]);router[_0x1247('0xa')](_0x1247('0xf'),auth['isAuthenticated'](),controller[_0x1247('0x10')]);router['get'](_0x1247('0x11'),auth['isAuthenticated'](),controller['query']);router[_0x1247('0x12')]('/',auth[_0x1247('0xb')](),controller[_0x1247('0x13')]);router['put']('/:id',auth[_0x1247('0xb')](),controller[_0x1247('0x14')]);router[_0x1247('0x15')](_0x1247('0xd'),auth['isAuthenticated'](),controller[_0x1247('0x16')]);module[_0x1247('0x17')]=router;
\ No newline at end of file
index 03bf9c6..36baf10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x727d=['Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','exports','STRING','ENUM','pdf','xlsx','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x727d,0xad));var _0xd727=function(_0x1acb96,_0x108216){_0x1acb96=_0x1acb96-0x0;var _0x5da6cf=_0x727d[_0x1acb96];return _0x5da6cf;};'use strict';var Sequelize=require(_0xd727('0x0'));var moment=require('moment');module[_0xd727('0x1')]={'name':{'type':Sequelize[_0xd727('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xd727('0x3')]('csv',_0xd727('0x4'),_0xd727('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xd727('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xd727('0x6')]},'endDate':{'type':Sequelize[_0xd727('0x6')]},'status':{'type':Sequelize[_0xd727('0x2')],'defaultValue':_0xd727('0x7')},'type':{'type':Sequelize[_0xd727('0x3')](_0xd727('0x8'),_0xd727('0x9')),'allowNull':![],'defaultValue':_0xd727('0x8')},'reportId':{'type':Sequelize[_0xd727('0xa')](0xb)[_0xd727('0xb')]},'reportType':{'type':Sequelize[_0xd727('0x2')]}};
\ No newline at end of file
+var _0x9b55=['DATE','Loading','ENUM','manual','scheduled','INTEGER','moment','STRING','csv','xlsx'];(function(_0x1c324d,_0x2daa7c){var _0x33347f=function(_0x438dc6){while(--_0x438dc6){_0x1c324d['push'](_0x1c324d['shift']());}};_0x33347f(++_0x2daa7c);}(_0x9b55,0x114));var _0x59b5=function(_0x55c831,_0x104040){_0x55c831=_0x55c831-0x0;var _0x2f96ef=_0x9b55[_0x55c831];return _0x2f96ef;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x59b5('0x0'));module['exports']={'name':{'type':Sequelize[_0x59b5('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0x59b5('0x1')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x59b5('0x2'),'pdf',_0x59b5('0x3')),'allowNull':![],'defaultValue':_0x59b5('0x2')},'savename':{'type':Sequelize[_0x59b5('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x59b5('0x4')]},'endDate':{'type':Sequelize[_0x59b5('0x4')]},'status':{'type':Sequelize[_0x59b5('0x1')],'defaultValue':_0x59b5('0x5')},'type':{'type':Sequelize[_0x59b5('0x6')](_0x59b5('0x7'),_0x59b5('0x8')),'allowNull':![],'defaultValue':_0x59b5('0x7')},'reportId':{'type':Sequelize[_0x59b5('0x9')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 5307886..3001d40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb544=['bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','update','then','get','ExtractedReports','UserProfileResource','destroy','error','stack','name','index','map','AnalyticExtractedReport','fieldName','type','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','catch','keys','rawAttributes','fields','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','params','basename','savename','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','root','%s.%s','toLowerCase','eml-format','zip-dir','fast-json-patch','moment'];(function(_0x350a95,_0x30a22a){var _0x47616d=function(_0x156304){while(--_0x156304){_0x350a95['push'](_0x350a95['shift']());}};_0x47616d(++_0x30a22a);}(_0xb544,0x160));var _0x4b54=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xb544[_0x3d42d8];return _0x27fc41;};'use strict';var emlformat=require(_0x4b54('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4b54('0x1'));var jsonpatch=require(_0x4b54('0x2'));var rp=require('request-promise');var moment=require(_0x4b54('0x3'));var BPromise=require(_0x4b54('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4b54('0x5'));var sox=require(_0x4b54('0x6'));var csv=require(_0x4b54('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4b54('0x8'));var _=require(_0x4b54('0x9'));var squel=require(_0x4b54('0xa'));var crypto=require(_0x4b54('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4b54('0xc'));var toCsv=require(_0x4b54('0x7'));var querystring=require('querystring');var Papa=require(_0x4b54('0xd'));var Redis=require(_0x4b54('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4b54('0xf'));var as=require(_0x4b54('0x10'));var hardwareService=require(_0x4b54('0x11'));var logger=require(_0x4b54('0x12'))(_0x4b54('0x13'));var utils=require(_0x4b54('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4b54('0x15'))['db'];function respondWithStatusCode(_0x1894b2,_0x16513d){_0x16513d=_0x16513d||0xcc;return function(_0x2c5cf3){if(_0x2c5cf3){return _0x1894b2[_0x4b54('0x16')](_0x16513d);}return _0x1894b2['status'](_0x16513d)[_0x4b54('0x17')]();};}function respondWithResult(_0x3afcb4,_0x3633f5){_0x3633f5=_0x3633f5||0xc8;return function(_0x1da7b0){if(_0x1da7b0){return _0x3afcb4[_0x4b54('0x18')](_0x3633f5)[_0x4b54('0x19')](_0x1da7b0);}};}function respondWithFilteredResult(_0x2bb23b,_0x7af3b3){return function(_0x11218f){if(_0x11218f){var _0x40eb4c=typeof _0x7af3b3[_0x4b54('0x1a')]===_0x4b54('0x1b')&&typeof _0x7af3b3[_0x4b54('0x1c')]===_0x4b54('0x1b');var _0x59a7ec=_0x11218f[_0x4b54('0x1d')];var _0x1e4c19=_0x40eb4c?0x0:_0x7af3b3[_0x4b54('0x1a')];var _0x1a08e2=_0x40eb4c?_0x11218f[_0x4b54('0x1d')]:_0x7af3b3[_0x4b54('0x1a')]+_0x7af3b3[_0x4b54('0x1c')];var _0x109cbf;if(_0x1a08e2>=_0x59a7ec){_0x1a08e2=_0x59a7ec;_0x109cbf=0xc8;}else{_0x109cbf=0xce;}_0x2bb23b[_0x4b54('0x18')](_0x109cbf);return _0x2bb23b[_0x4b54('0x1e')]('Content-Range',_0x1e4c19+'-'+_0x1a08e2+'/'+_0x59a7ec)['json'](_0x11218f);}return null;};}function patchUpdates(_0x46d0fe){return function(_0x58a9de){try{jsonpatch['apply'](_0x58a9de,_0x46d0fe,!![]);}catch(_0x5bd741){return BPromise[_0x4b54('0x1f')](_0x5bd741);}return _0x58a9de[_0x4b54('0x20')]();};}function saveUpdates(_0x5c1b8b,_0x29b28b){return function(_0x3a0792){if(_0x3a0792){return _0x3a0792[_0x4b54('0x21')](_0x5c1b8b)[_0x4b54('0x22')](function(_0x54a339){return _0x54a339;});}return null;};}function removeEntity(_0x2a16c8,_0x288182){return function(_0x468883){if(_0x468883){return _0x468883['destroy']()['then'](function(){var _0x1f0d15=_0x468883[_0x4b54('0x23')]({'plain':!![]});var _0x45bfa2=_0x4b54('0x24');return db[_0x4b54('0x25')][_0x4b54('0x26')]({'where':{'type':_0x45bfa2,'resourceId':_0x1f0d15['id']}})[_0x4b54('0x22')](function(){return _0x468883;});})[_0x4b54('0x22')](function(){_0x2a16c8[_0x4b54('0x18')](0xcc)[_0x4b54('0x17')]();});}};}function handleEntityNotFound(_0x3d8d4f,_0x2ba4ce){return function(_0x10618e){if(!_0x10618e){_0x3d8d4f[_0x4b54('0x16')](0x194);}return _0x10618e;};}function handleError(_0x2d7ff9,_0x126be0){_0x126be0=_0x126be0||0x1f4;return function(_0x108fec){logger[_0x4b54('0x27')](_0x108fec[_0x4b54('0x28')]);if(_0x108fec[_0x4b54('0x29')]){delete _0x108fec[_0x4b54('0x29')];}_0x2d7ff9[_0x4b54('0x18')](_0x126be0)['send'](_0x108fec);};}exports[_0x4b54('0x2a')]=function(_0x53b8dc,_0x1fc775){var _0x12f210={},_0x274344={},_0x10e10e={'count':0x0,'rows':[]};var _0x3f80b6=_[_0x4b54('0x2b')](db[_0x4b54('0x2c')]['rawAttributes'],function(_0xd98f3a){return{'name':_0xd98f3a[_0x4b54('0x2d')],'type':_0xd98f3a[_0x4b54('0x2e')]['key']};});_0x274344[_0x4b54('0x2f')]=_[_0x4b54('0x2b')](_0x3f80b6,_0x4b54('0x29'));_0x274344[_0x4b54('0x30')]=_['keys'](_0x53b8dc['query']);_0x274344[_0x4b54('0x31')]=_[_0x4b54('0x32')](_0x274344[_0x4b54('0x2f')],_0x274344[_0x4b54('0x30')]);_0x12f210[_0x4b54('0x33')]=_[_0x4b54('0x32')](_0x274344['model'],qs['fields'](_0x53b8dc[_0x4b54('0x30')]['fields']));_0x12f210[_0x4b54('0x33')]=_0x12f210[_0x4b54('0x33')]['length']?_0x12f210['attributes']:_0x274344[_0x4b54('0x2f')];if(!_0x53b8dc['query'][_0x4b54('0x34')](_0x4b54('0x35'))){_0x12f210[_0x4b54('0x1c')]=qs[_0x4b54('0x1c')](_0x53b8dc[_0x4b54('0x30')]['limit']);_0x12f210[_0x4b54('0x1a')]=qs['offset'](_0x53b8dc['query']['offset']);}_0x12f210[_0x4b54('0x36')]=qs[_0x4b54('0x37')](_0x53b8dc[_0x4b54('0x30')][_0x4b54('0x37')]);_0x12f210[_0x4b54('0x38')]=qs[_0x4b54('0x31')](_[_0x4b54('0x39')](_0x53b8dc[_0x4b54('0x30')],_0x274344['filters']),_0x3f80b6);if(_0x53b8dc[_0x4b54('0x30')]['filter']){_0x12f210[_0x4b54('0x38')]=_[_0x4b54('0x3a')](_0x12f210[_0x4b54('0x38')],{'$or':_[_0x4b54('0x2b')](_0x3f80b6,function(_0x3e92e5){if(_0x3e92e5[_0x4b54('0x2e')]!==_0x4b54('0x3b')){var _0x554b2a={};_0x554b2a[_0x3e92e5['name']]={'$like':'%'+_0x53b8dc[_0x4b54('0x30')][_0x4b54('0x3c')]+'%'};return _0x554b2a;}})});}_0x12f210=_[_0x4b54('0x3a')]({},_0x12f210,_0x53b8dc[_0x4b54('0x3d')]);var _0x3af63c={'where':_0x12f210['where']};return db[_0x4b54('0x2c')][_0x4b54('0x1d')](_0x3af63c)[_0x4b54('0x22')](function(_0xbecb34){_0x10e10e[_0x4b54('0x1d')]=_0xbecb34;if(_0x53b8dc['query'][_0x4b54('0x3e')]){_0x12f210['include']=[{'all':!![]}];}return db[_0x4b54('0x2c')]['findAll'](_0x12f210);})['then'](function(_0x117bdb){_0x10e10e['rows']=_0x117bdb;return _0x10e10e;})[_0x4b54('0x22')](respondWithFilteredResult(_0x1fc775,_0x12f210))[_0x4b54('0x3f')](handleError(_0x1fc775,null));};exports['show']=function(_0x153315,_0x3bdeb7){var _0x5bfef7={'raw':!![],'where':{'id':_0x153315['params']['id']}},_0x43ce55={};_0x43ce55[_0x4b54('0x2f')]=_[_0x4b54('0x40')](db[_0x4b54('0x2c')][_0x4b54('0x41')]);_0x43ce55[_0x4b54('0x30')]=_[_0x4b54('0x40')](_0x153315['query']);_0x43ce55[_0x4b54('0x31')]=_['intersection'](_0x43ce55[_0x4b54('0x2f')],_0x43ce55[_0x4b54('0x30')]);_0x5bfef7[_0x4b54('0x33')]=_[_0x4b54('0x32')](_0x43ce55['model'],qs[_0x4b54('0x42')](_0x153315[_0x4b54('0x30')]['fields']));_0x5bfef7['attributes']=_0x5bfef7['attributes']['length']?_0x5bfef7[_0x4b54('0x33')]:_0x43ce55[_0x4b54('0x2f')];if(_0x153315[_0x4b54('0x30')][_0x4b54('0x3e')]){_0x5bfef7[_0x4b54('0x43')]=[{'all':!![]}];}_0x5bfef7=_[_0x4b54('0x3a')]({},_0x5bfef7,_0x153315[_0x4b54('0x3d')]);return db[_0x4b54('0x2c')][_0x4b54('0x44')](_0x5bfef7)[_0x4b54('0x22')](handleEntityNotFound(_0x3bdeb7,null))[_0x4b54('0x22')](respondWithResult(_0x3bdeb7,null))[_0x4b54('0x3f')](handleError(_0x3bdeb7,null));};exports[_0x4b54('0x45')]=function(_0x29e9b8,_0x43b916){return db[_0x4b54('0x2c')][_0x4b54('0x45')](_0x29e9b8[_0x4b54('0x46')],{})[_0x4b54('0x22')](function(_0x59c4da){var _0x4d1ee5=_0x29e9b8[_0x4b54('0x47')][_0x4b54('0x23')]({'plain':!![]});if(!_0x4d1ee5)throw new Error(_0x4b54('0x48'));if(_0x4d1ee5[_0x4b54('0x49')]===_0x4b54('0x47')){var _0x3160d4=_0x59c4da['get']({'plain':!![]});var _0x28f78c=_0x4b54('0x24');return db[_0x4b54('0x4a')][_0x4b54('0x44')]({'where':{'name':_0x28f78c,'userProfileId':_0x4d1ee5['userProfileId']},'raw':!![]})[_0x4b54('0x22')](function(_0x16da97){if(_0x16da97&&_0x16da97['autoAssociation']===0x0){return db[_0x4b54('0x25')][_0x4b54('0x45')]({'name':_0x3160d4[_0x4b54('0x29')],'resourceId':_0x3160d4['id'],'type':_0x16da97[_0x4b54('0x29')],'sectionId':_0x16da97['id']},{})[_0x4b54('0x22')](function(){return _0x59c4da;});}else{return _0x59c4da;}})[_0x4b54('0x3f')](function(_0x4b431a){logger[_0x4b54('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b431a);throw _0x4b431a;});}return _0x59c4da;})[_0x4b54('0x22')](respondWithResult(_0x43b916,0xc9))[_0x4b54('0x3f')](handleError(_0x43b916,null));};exports['update']=function(_0xe844a6,_0x432fbd){if(_0xe844a6[_0x4b54('0x46')]['id']){delete _0xe844a6[_0x4b54('0x46')]['id'];}return db[_0x4b54('0x2c')][_0x4b54('0x44')]({'where':{'id':_0xe844a6['params']['id']}})[_0x4b54('0x22')](handleEntityNotFound(_0x432fbd,null))['then'](saveUpdates(_0xe844a6[_0x4b54('0x46')],null))[_0x4b54('0x22')](respondWithResult(_0x432fbd,null))[_0x4b54('0x3f')](handleError(_0x432fbd,null));};exports[_0x4b54('0x26')]=function(_0x3e9958,_0x23093b){return db['AnalyticExtractedReport'][_0x4b54('0x44')]({'where':{'id':_0x3e9958['params']['id']}})['then'](handleEntityNotFound(_0x23093b,null))['then'](removeEntity(_0x23093b,null))[_0x4b54('0x3f')](handleError(_0x23093b,null));};exports['download']=function(_0x175a18,_0x3894ed,_0x1aa544){return db['AnalyticExtractedReport'][_0x4b54('0x44')]({'where':{'id':_0x175a18[_0x4b54('0x4b')]['id']},'attributes':[_0x4b54('0x29'),_0x4b54('0x4c'),_0x4b54('0x4d'),'output'],'raw':!![]})[_0x4b54('0x22')](handleEntityNotFound(_0x3894ed,null))[_0x4b54('0x22')](function(_0x533c3b){if(_0x533c3b){if(!fs[_0x4b54('0x4e')](path[_0x4b54('0x4f')](config['root'],_0x4b54('0x50'),_0x533c3b[_0x4b54('0x4d')]))){throw new db[(_0x4b54('0x51'))][(_0x4b54('0x52'))](_0x4b54('0x53'));}if(_0x175a18['query'][_0x4b54('0x54')]){return _0x3894ed['sendStatus'](0xc8);}return _0x3894ed[_0x4b54('0x55')](path[_0x4b54('0x4f')](config[_0x4b54('0x56')],_0x4b54('0x50'),_0x533c3b['savename']),util['format'](_0x4b54('0x57'),_0x533c3b[_0x4b54('0x4c')]||_0x533c3b[_0x4b54('0x29')],_0x533c3b['output'][_0x4b54('0x58')]()));}})[_0x4b54('0x3f')](handleError(_0x3894ed,null));};
\ No newline at end of file
+var _0x5050=['rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','sendStatus','status','end','json','undefined','count','offset','apply','save','destroy','then','get','ExtractedReports','UserProfileResource','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','VIRTUAL','filter','AnalyticExtractedReport','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','output','existsSync','join','server/files/reports','savename','Sequelize','ValidationError','exists','root','format','%s.%s','toLowerCase'];(function(_0x5799fa,_0x42b294){var _0x52deab=function(_0x268eb9){while(--_0x268eb9){_0x5799fa['push'](_0x5799fa['shift']());}};_0x52deab(++_0x42b294);}(_0x5050,0x10e));var _0x0505=function(_0x3b5970,_0x4ad259){_0x3b5970=_0x3b5970-0x0;var _0x5e4979=_0x5050[_0x3b5970];return _0x5e4979;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0505('0x0'));var zipdir=require(_0x0505('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0505('0x2'));var moment=require('moment');var BPromise=require(_0x0505('0x3'));var Mustache=require(_0x0505('0x4'));var util=require('util');var path=require(_0x0505('0x5'));var sox=require(_0x0505('0x6'));var csv=require(_0x0505('0x7'));var ejs=require(_0x0505('0x8'));var fs=require('fs');var fs_extra=require(_0x0505('0x9'));var _=require('lodash');var squel=require(_0x0505('0xa'));var crypto=require('crypto');var jsforce=require(_0x0505('0xb'));var deskjs=require(_0x0505('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0505('0xd'));var Redis=require(_0x0505('0xe'));var authService=require(_0x0505('0xf'));var qs=require(_0x0505('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0505('0x11'));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('../../mysqldb')['db'];function respondWithStatusCode(_0xd15727,_0xd4e261){_0xd4e261=_0xd4e261||0xcc;return function(_0xfa0070){if(_0xfa0070){return _0xd15727[_0x0505('0x12')](_0xd4e261);}return _0xd15727[_0x0505('0x13')](_0xd4e261)[_0x0505('0x14')]();};}function respondWithResult(_0xc062,_0x420bf2){_0x420bf2=_0x420bf2||0xc8;return function(_0x155459){if(_0x155459){return _0xc062[_0x0505('0x13')](_0x420bf2)[_0x0505('0x15')](_0x155459);}};}function respondWithFilteredResult(_0x398c5a,_0x427624){return function(_0x570f73){if(_0x570f73){var _0x13de00=typeof _0x427624['offset']===_0x0505('0x16')&&typeof _0x427624['limit']===_0x0505('0x16');var _0x135b81=_0x570f73[_0x0505('0x17')];var _0x1a8204=_0x13de00?0x0:_0x427624[_0x0505('0x18')];var _0x100139=_0x13de00?_0x570f73[_0x0505('0x17')]:_0x427624[_0x0505('0x18')]+_0x427624['limit'];var _0x43aa66;if(_0x100139>=_0x135b81){_0x100139=_0x135b81;_0x43aa66=0xc8;}else{_0x43aa66=0xce;}_0x398c5a[_0x0505('0x13')](_0x43aa66);return _0x398c5a['set']('Content-Range',_0x1a8204+'-'+_0x100139+'/'+_0x135b81)[_0x0505('0x15')](_0x570f73);}return null;};}function patchUpdates(_0x3481b0){return function(_0x560f86){try{jsonpatch[_0x0505('0x19')](_0x560f86,_0x3481b0,!![]);}catch(_0x121437){return BPromise['reject'](_0x121437);}return _0x560f86[_0x0505('0x1a')]();};}function saveUpdates(_0x4b8d16,_0x25cdc9){return function(_0x433972){if(_0x433972){return _0x433972['update'](_0x4b8d16)['then'](function(_0x5a976d){return _0x5a976d;});}return null;};}function removeEntity(_0x118586,_0x1c6b3f){return function(_0x4ba494){if(_0x4ba494){return _0x4ba494[_0x0505('0x1b')]()[_0x0505('0x1c')](function(){var _0x5c593c=_0x4ba494[_0x0505('0x1d')]({'plain':!![]});var _0x4fe910=_0x0505('0x1e');return db[_0x0505('0x1f')]['destroy']({'where':{'type':_0x4fe910,'resourceId':_0x5c593c['id']}})[_0x0505('0x1c')](function(){return _0x4ba494;});})[_0x0505('0x1c')](function(){_0x118586[_0x0505('0x13')](0xcc)[_0x0505('0x14')]();});}};}function handleEntityNotFound(_0x172259,_0x1168e1){return function(_0xa9fb20){if(!_0xa9fb20){_0x172259['sendStatus'](0x194);}return _0xa9fb20;};}function handleError(_0x220a3b,_0x2a6038){_0x2a6038=_0x2a6038||0x1f4;return function(_0x3941a0){logger['error'](_0x3941a0['stack']);if(_0x3941a0[_0x0505('0x20')]){delete _0x3941a0[_0x0505('0x20')];}_0x220a3b[_0x0505('0x13')](_0x2a6038)[_0x0505('0x21')](_0x3941a0);};}exports[_0x0505('0x22')]=function(_0x30d6d7,_0x5eb43e){var _0xe2ec49={},_0x21b87d={},_0x3928fe={'count':0x0,'rows':[]};var _0x4067bd=_['map'](db['AnalyticExtractedReport'][_0x0505('0x23')],function(_0x381931){return{'name':_0x381931[_0x0505('0x24')],'type':_0x381931[_0x0505('0x25')][_0x0505('0x26')]};});_0x21b87d[_0x0505('0x27')]=_[_0x0505('0x28')](_0x4067bd,_0x0505('0x20'));_0x21b87d['query']=_[_0x0505('0x29')](_0x30d6d7[_0x0505('0x2a')]);_0x21b87d['filters']=_[_0x0505('0x2b')](_0x21b87d['model'],_0x21b87d[_0x0505('0x2a')]);_0xe2ec49['attributes']=_[_0x0505('0x2b')](_0x21b87d['model'],qs[_0x0505('0x2c')](_0x30d6d7[_0x0505('0x2a')][_0x0505('0x2c')]));_0xe2ec49[_0x0505('0x2d')]=_0xe2ec49['attributes']['length']?_0xe2ec49['attributes']:_0x21b87d[_0x0505('0x27')];if(!_0x30d6d7['query'][_0x0505('0x2e')](_0x0505('0x2f'))){_0xe2ec49[_0x0505('0x30')]=qs[_0x0505('0x30')](_0x30d6d7[_0x0505('0x2a')][_0x0505('0x30')]);_0xe2ec49['offset']=qs['offset'](_0x30d6d7['query'][_0x0505('0x18')]);}_0xe2ec49[_0x0505('0x31')]=qs['sort'](_0x30d6d7[_0x0505('0x2a')][_0x0505('0x32')]);_0xe2ec49[_0x0505('0x33')]=qs[_0x0505('0x34')](_[_0x0505('0x35')](_0x30d6d7['query'],_0x21b87d[_0x0505('0x34')]),_0x4067bd);if(_0x30d6d7['query']['filter']){_0xe2ec49[_0x0505('0x33')]=_[_0x0505('0x36')](_0xe2ec49['where'],{'$or':_[_0x0505('0x28')](_0x4067bd,function(_0x5357ee){if(_0x5357ee['type']!==_0x0505('0x37')){var _0x25e0fe={};_0x25e0fe[_0x5357ee['name']]={'$like':'%'+_0x30d6d7[_0x0505('0x2a')][_0x0505('0x38')]+'%'};return _0x25e0fe;}})});}_0xe2ec49=_[_0x0505('0x36')]({},_0xe2ec49,_0x30d6d7['options']);var _0x310069={'where':_0xe2ec49[_0x0505('0x33')]};return db[_0x0505('0x39')][_0x0505('0x17')](_0x310069)[_0x0505('0x1c')](function(_0x88551d){_0x3928fe[_0x0505('0x17')]=_0x88551d;if(_0x30d6d7[_0x0505('0x2a')][_0x0505('0x3a')]){_0xe2ec49['include']=[{'all':!![]}];}return db[_0x0505('0x39')][_0x0505('0x3b')](_0xe2ec49);})['then'](function(_0x4ab59d){_0x3928fe[_0x0505('0x3c')]=_0x4ab59d;return _0x3928fe;})[_0x0505('0x1c')](respondWithFilteredResult(_0x5eb43e,_0xe2ec49))[_0x0505('0x3d')](handleError(_0x5eb43e,null));};exports[_0x0505('0x3e')]=function(_0x2a4504,_0x500a92){var _0xeb92e={'raw':!![],'where':{'id':_0x2a4504[_0x0505('0x3f')]['id']}},_0x1d191a={};_0x1d191a['model']=_[_0x0505('0x29')](db[_0x0505('0x39')]['rawAttributes']);_0x1d191a['query']=_[_0x0505('0x29')](_0x2a4504[_0x0505('0x2a')]);_0x1d191a[_0x0505('0x34')]=_[_0x0505('0x2b')](_0x1d191a[_0x0505('0x27')],_0x1d191a[_0x0505('0x2a')]);_0xeb92e[_0x0505('0x2d')]=_['intersection'](_0x1d191a[_0x0505('0x27')],qs[_0x0505('0x2c')](_0x2a4504[_0x0505('0x2a')][_0x0505('0x2c')]));_0xeb92e['attributes']=_0xeb92e[_0x0505('0x2d')]['length']?_0xeb92e['attributes']:_0x1d191a['model'];if(_0x2a4504[_0x0505('0x2a')]['includeAll']){_0xeb92e[_0x0505('0x40')]=[{'all':!![]}];}_0xeb92e=_['merge']({},_0xeb92e,_0x2a4504[_0x0505('0x41')]);return db['AnalyticExtractedReport'][_0x0505('0x42')](_0xeb92e)['then'](handleEntityNotFound(_0x500a92,null))[_0x0505('0x1c')](respondWithResult(_0x500a92,null))[_0x0505('0x3d')](handleError(_0x500a92,null));};exports['create']=function(_0x3eec99,_0x272312){return db[_0x0505('0x39')][_0x0505('0x43')](_0x3eec99[_0x0505('0x44')],{})[_0x0505('0x1c')](function(_0x586513){var _0x785cbd=_0x3eec99['user'][_0x0505('0x1d')]({'plain':!![]});if(!_0x785cbd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x785cbd[_0x0505('0x45')]===_0x0505('0x46')){var _0x2991bd=_0x586513[_0x0505('0x1d')]({'plain':!![]});var _0x3743d1='ExtractedReports';return db[_0x0505('0x47')][_0x0505('0x42')]({'where':{'name':_0x3743d1,'userProfileId':_0x785cbd[_0x0505('0x48')]},'raw':!![]})['then'](function(_0x61d6f1){if(_0x61d6f1&&_0x61d6f1[_0x0505('0x49')]===0x0){return db[_0x0505('0x1f')][_0x0505('0x43')]({'name':_0x2991bd['name'],'resourceId':_0x2991bd['id'],'type':_0x61d6f1['name'],'sectionId':_0x61d6f1['id']},{})[_0x0505('0x1c')](function(){return _0x586513;});}else{return _0x586513;}})[_0x0505('0x3d')](function(_0x46aaf6){logger['error'](_0x0505('0x4a'),_0x46aaf6);throw _0x46aaf6;});}return _0x586513;})['then'](respondWithResult(_0x272312,0xc9))[_0x0505('0x3d')](handleError(_0x272312,null));};exports[_0x0505('0x4b')]=function(_0x8600b4,_0xc2e1d1){if(_0x8600b4[_0x0505('0x44')]['id']){delete _0x8600b4[_0x0505('0x44')]['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x8600b4[_0x0505('0x3f')]['id']}})[_0x0505('0x1c')](handleEntityNotFound(_0xc2e1d1,null))[_0x0505('0x1c')](saveUpdates(_0x8600b4[_0x0505('0x44')],null))[_0x0505('0x1c')](respondWithResult(_0xc2e1d1,null))['catch'](handleError(_0xc2e1d1,null));};exports[_0x0505('0x1b')]=function(_0x35ed16,_0x44fcd1){return db[_0x0505('0x39')]['find']({'where':{'id':_0x35ed16['params']['id']}})[_0x0505('0x1c')](handleEntityNotFound(_0x44fcd1,null))[_0x0505('0x1c')](removeEntity(_0x44fcd1,null))[_0x0505('0x3d')](handleError(_0x44fcd1,null));};exports[_0x0505('0x4c')]=function(_0x9e0de7,_0x7cbf34,_0x1859c6){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x9e0de7['params']['id']},'attributes':[_0x0505('0x20'),_0x0505('0x4d'),'savename',_0x0505('0x4e')],'raw':!![]})[_0x0505('0x1c')](handleEntityNotFound(_0x7cbf34,null))[_0x0505('0x1c')](function(_0x4b0787){if(_0x4b0787){if(!fs[_0x0505('0x4f')](path[_0x0505('0x50')](config['root'],_0x0505('0x51'),_0x4b0787[_0x0505('0x52')]))){throw new db[(_0x0505('0x53'))][(_0x0505('0x54'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x9e0de7[_0x0505('0x2a')][_0x0505('0x55')]){return _0x7cbf34[_0x0505('0x12')](0xc8);}return _0x7cbf34[_0x0505('0x4c')](path[_0x0505('0x50')](config[_0x0505('0x56')],_0x0505('0x51'),_0x4b0787[_0x0505('0x52')]),util[_0x0505('0x57')](_0x0505('0x58'),_0x4b0787[_0x0505('0x4d')]||_0x4b0787['name'],_0x4b0787[_0x0505('0x4e')][_0x0505('0x59')]()));}})[_0x0505('0x3d')](handleError(_0x7cbf34,null));};
\ No newline at end of file
index 0b60943..e2e9e59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed54=['request-promise','path','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xed54,0xcc));var _0x4ed5=function(_0x36121d,_0x59afab){_0x36121d=_0x36121d-0x0;var _0x4455ab=_0xed54[_0x36121d];return _0x4455ab;};'use strict';var _=require(_0x4ed5('0x0'));var util=require(_0x4ed5('0x1'));var logger=require(_0x4ed5('0x2'))('api');var moment=require(_0x4ed5('0x3'));var BPromise=require(_0x4ed5('0x4'));var rp=require(_0x4ed5('0x5'));var fs=require('fs');var path=require(_0x4ed5('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4ed5('0x7'));module[_0x4ed5('0x8')]=function(_0xab49d7,_0x24ee1d){return _0xab49d7[_0x4ed5('0x9')](_0x4ed5('0xa'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf554=['rimraf','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x52d753,_0x360501){var _0x3675a7=function(_0x27bf3a){while(--_0x27bf3a){_0x52d753['push'](_0x52d753['shift']());}};_0x3675a7(++_0x360501);}(_0xf554,0x179));var _0x4f55=function(_0x4a9089,_0x21689c){_0x4a9089=_0x4a9089-0x0;var _0x1ec4dd=_0xf554[_0x4a9089];return _0x1ec4dd;};'use strict';var _=require(_0x4f55('0x0'));var util=require(_0x4f55('0x1'));var logger=require(_0x4f55('0x2'))(_0x4f55('0x3'));var moment=require(_0x4f55('0x4'));var BPromise=require(_0x4f55('0x5'));var rp=require(_0x4f55('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4f55('0x7'));var config=require('../../config/environment');var attributes=require(_0x4f55('0x8'));module['exports']=function(_0x25cab8,_0x2577b0){return _0x25cab8[_0x4f55('0x9')](_0x4f55('0xa'),attributes,{'tableName':_0x4f55('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6ad91b0..8405ead 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc88f=['AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x148351,_0x440979){var _0x1852bc=function(_0x50ef94){while(--_0x50ef94){_0x148351['push'](_0x148351['shift']());}};_0x1852bc(++_0x440979);}(_0xc88f,0xed));var _0xfc88=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc88f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfc88('0x0'));var util=require('util');var moment=require(_0xfc88('0x1'));var BPromise=require(_0xfc88('0x2'));var rs=require(_0xfc88('0x3'));var fs=require('fs');var Redis=require(_0xfc88('0x4'));var db=require(_0xfc88('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfc88('0x6'))(_0xfc88('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfc88('0x8')][_0xfc88('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b9c25,_0x3e9000,_0x14052f){return new BPromise(function(_0xeb143,_0x15ffb0){return client[_0xfc88('0xa')](_0x3b9c25,_0x14052f)[_0xfc88('0xb')](function(_0x2eec35){logger['info'](_0xfc88('0xc'),_0x3e9000,_0xfc88('0xd'));logger[_0xfc88('0xe')](_0xfc88('0xf'),_0x3e9000,_0xfc88('0xd'),JSON[_0xfc88('0x10')](_0x2eec35));if(_0x2eec35[_0xfc88('0x11')]){if(_0x2eec35['error']['code']===0x1f4){logger['error'](_0xfc88('0xc'),_0x3e9000,_0x2eec35[_0xfc88('0x11')][_0xfc88('0x12')]);return _0x15ffb0(_0x2eec35[_0xfc88('0x11')][_0xfc88('0x12')]);}logger['error'](_0xfc88('0xc'),_0x3e9000,_0x2eec35[_0xfc88('0x11')][_0xfc88('0x12')]);return _0xeb143(_0x2eec35['error'][_0xfc88('0x12')]);}else{logger[_0xfc88('0x13')](_0xfc88('0xc'),_0x3e9000,_0xfc88('0xd'));_0xeb143(_0x2eec35['result'][_0xfc88('0x12')]);}})[_0xfc88('0x14')](function(_0x35e178){logger[_0xfc88('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3e9000,_0x35e178);_0x15ffb0(_0x35e178);});});}
\ No newline at end of file
+var _0x0dd7=['request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s'];(function(_0x508c13,_0x55c30a){var _0x3b694a=function(_0x4f1147){while(--_0x4f1147){_0x508c13['push'](_0x508c13['shift']());}};_0x3b694a(++_0x55c30a);}(_0x0dd7,0x1eb));var _0x70dd=function(_0x295a3d,_0x56d487){_0x295a3d=_0x295a3d-0x0;var _0x23a732=_0x0dd7[_0x295a3d];return _0x23a732;};'use strict';var _=require('lodash');var util=require(_0x70dd('0x0'));var moment=require(_0x70dd('0x1'));var BPromise=require(_0x70dd('0x2'));var rs=require(_0x70dd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x70dd('0x4'))(_0x70dd('0x5'));var config=require('../../config/environment');var jayson=require(_0x70dd('0x6'));var client=jayson[_0x70dd('0x7')][_0x70dd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4f2428,_0x58acd2,_0x47fb84){return new BPromise(function(_0x1b2785,_0x1c89c9){return client[_0x70dd('0x9')](_0x4f2428,_0x47fb84)[_0x70dd('0xa')](function(_0xda1823){logger[_0x70dd('0xb')](_0x70dd('0xc'),_0x58acd2,_0x70dd('0xd'));logger[_0x70dd('0xe')](_0x70dd('0xf'),_0x58acd2,'request\x20sent',JSON[_0x70dd('0x10')](_0xda1823));if(_0xda1823['error']){if(_0xda1823[_0x70dd('0x11')]['code']===0x1f4){logger['error'](_0x70dd('0xc'),_0x58acd2,_0xda1823[_0x70dd('0x11')][_0x70dd('0x12')]);return _0x1c89c9(_0xda1823[_0x70dd('0x11')][_0x70dd('0x12')]);}logger[_0x70dd('0x11')](_0x70dd('0xc'),_0x58acd2,_0xda1823[_0x70dd('0x11')][_0x70dd('0x12')]);return _0x1b2785(_0xda1823[_0x70dd('0x11')][_0x70dd('0x12')]);}else{logger['info'](_0x70dd('0xc'),_0x58acd2,'request\x20sent');_0x1b2785(_0xda1823[_0x70dd('0x13')][_0x70dd('0x12')]);}})[_0x70dd('0x14')](function(_0x42142b){logger[_0x70dd('0x11')](_0x70dd('0xc'),_0x58acd2,_0x42142b);_0x1c89c9(_0x42142b);});});}
\ No newline at end of file
index 406f329..76afee9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76d1=['update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','/:id/download','download','post','put'];(function(_0x47c5bf,_0x45977e){var _0x11b779=function(_0x1bd585){while(--_0x1bd585){_0x47c5bf['push'](_0x47c5bf['shift']());}};_0x11b779(++_0x45977e);}(_0x76d1,0xdf));var _0x176d=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x76d1[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x176d('0x0'));var util=require('util');var path=require(_0x176d('0x1'));var timeout=require(_0x176d('0x2'));var express=require(_0x176d('0x3'));var router=express[_0x176d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x176d('0x5'));var interaction=require(_0x176d('0x6'));var config=require(_0x176d('0x7'));var controller=require(_0x176d('0x8'));router[_0x176d('0x9')]('/',auth[_0x176d('0xa')](),controller[_0x176d('0xb')]);router['get'](_0x176d('0xc'),auth[_0x176d('0xa')](),controller['show']);router[_0x176d('0x9')](_0x176d('0xd'),auth[_0x176d('0xa')](),controller[_0x176d('0xe')]);router[_0x176d('0xf')]('/',auth[_0x176d('0xa')](),controller['create']);router[_0x176d('0x10')]('/:id',auth[_0x176d('0xa')](),controller[_0x176d('0x11')]);router['delete'](_0x176d('0xc'),auth[_0x176d('0xa')](),controller[_0x176d('0x12')]);module[_0x176d('0x13')]=router;
\ No newline at end of file
+var _0x1919=['isAuthenticated','index','download','post','create','put','/:id','delete','exports','multer','util','path','express','fs-extra','../../components/interaction/service','./analyticExtractedReport.controller','get'];(function(_0x31adf9,_0x511868){var _0x4412b5=function(_0x192d84){while(--_0x192d84){_0x31adf9['push'](_0x31adf9['shift']());}};_0x4412b5(++_0x511868);}(_0x1919,0xe6));var _0x9191=function(_0x2c57e6,_0x3d81b0){_0x2c57e6=_0x2c57e6-0x0;var _0x2a0e49=_0x1919[_0x2c57e6];return _0x2a0e49;};'use strict';var multer=require(_0x9191('0x0'));var util=require(_0x9191('0x1'));var path=require(_0x9191('0x2'));var timeout=require('connect-timeout');var express=require(_0x9191('0x3'));var router=express['Router']();var fs_extra=require(_0x9191('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9191('0x5'));var config=require('../../config/environment');var controller=require(_0x9191('0x6'));router[_0x9191('0x7')]('/',auth[_0x9191('0x8')](),controller[_0x9191('0x9')]);router[_0x9191('0x7')]('/:id',auth[_0x9191('0x8')](),controller['show']);router[_0x9191('0x7')]('/:id/download',auth[_0x9191('0x8')](),controller[_0x9191('0xa')]);router[_0x9191('0xb')]('/',auth[_0x9191('0x8')](),controller[_0x9191('0xc')]);router[_0x9191('0xd')](_0x9191('0xe'),auth[_0x9191('0x8')](),controller['update']);router[_0x9191('0xf')](_0x9191('0xe'),auth[_0x9191('0x8')](),controller['destroy']);module[_0x9191('0x10')]=router;
\ No newline at end of file
index bc3350e..0c2a1f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6a6=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xb6a6,0x179));var _0x6b6a=function(_0x34683e,_0x46427f){_0x34683e=_0x34683e-0x0;var _0x33c7f8=_0xb6a6[_0x34683e];return _0x33c7f8;};'use strict';var Sequelize=require(_0x6b6a('0x0'));module[_0x6b6a('0x1')]={'field':{'type':Sequelize[_0x6b6a('0x2')]},'alias':{'type':Sequelize[_0x6b6a('0x3')]},'function':{'type':Sequelize[_0x6b6a('0x3')]},'format':{'type':Sequelize[_0x6b6a('0x3')]},'groupBy':{'type':Sequelize[_0x6b6a('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x6b6a('0x3')]},'custom':{'type':Sequelize[_0x6b6a('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x9f4b=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x5ba53d,_0x4ccc51){var _0x5636d4=function(_0xa18adb){while(--_0xa18adb){_0x5ba53d['push'](_0x5ba53d['shift']());}};_0x5636d4(++_0x4ccc51);}(_0x9f4b,0x1dd));var _0xb9f4=function(_0x17ad94,_0x726a31){_0x17ad94=_0x17ad94-0x0;var _0x914400=_0x9f4b[_0x17ad94];return _0x914400;};'use strict';var Sequelize=require(_0xb9f4('0x0'));module[_0xb9f4('0x1')]={'field':{'type':Sequelize[_0xb9f4('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xb9f4('0x3')]},'format':{'type':Sequelize[_0xb9f4('0x3')]},'groupBy':{'type':Sequelize[_0xb9f4('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xb9f4('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 7a20651..95fa70b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf419=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','count','limit','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','AnalyticFieldReport','fieldName','type','key','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','rawAttributes','options','find','create','body','bulkCreate','params','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','rimraf','fast-json-patch','moment','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring'];(function(_0x1b2462,_0x6bcef5){var _0x39b174=function(_0x1b1e9e){while(--_0x1b1e9e){_0x1b2462['push'](_0x1b2462['shift']());}};_0x39b174(++_0x6bcef5);}(_0xf419,0x185));var _0x9f41=function(_0x2ea44c,_0x5e145f){_0x2ea44c=_0x2ea44c-0x0;var _0x4e9346=_0xf419[_0x2ea44c];return _0x4e9346;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9f41('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9f41('0x1'));var rp=require('request-promise');var moment=require(_0x9f41('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9f41('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0x9f41('0x4'));var ejs=require(_0x9f41('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9f41('0x6'));var squel=require(_0x9f41('0x7'));var crypto=require(_0x9f41('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x9f41('0x9'));var toCsv=require(_0x9f41('0x4'));var querystring=require(_0x9f41('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9f41('0xb'));var qs=require(_0x9f41('0xc'));var as=require(_0x9f41('0xd'));var hardwareService=require(_0x9f41('0xe'));var logger=require('../../config/logger')(_0x9f41('0xf'));var utils=require(_0x9f41('0x10'));var config=require(_0x9f41('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x9f41('0x12'))['db'];function respondWithStatusCode(_0x5bb505,_0x35d0f3){_0x35d0f3=_0x35d0f3||0xcc;return function(_0xf0af6c){if(_0xf0af6c){return _0x5bb505['sendStatus'](_0x35d0f3);}return _0x5bb505['status'](_0x35d0f3)[_0x9f41('0x13')]();};}function respondWithResult(_0x7525a8,_0x14332c){_0x14332c=_0x14332c||0xc8;return function(_0x3119c0){if(_0x3119c0){return _0x7525a8[_0x9f41('0x14')](_0x14332c)[_0x9f41('0x15')](_0x3119c0);}};}function respondWithFilteredResult(_0x1c9db7,_0x51af4b){return function(_0x4ecb76){if(_0x4ecb76){var _0x569a97=typeof _0x51af4b[_0x9f41('0x16')]==='undefined'&&typeof _0x51af4b['limit']==='undefined';var _0x3e4a51=_0x4ecb76['count'];var _0x30c54a=_0x569a97?0x0:_0x51af4b['offset'];var _0x192653=_0x569a97?_0x4ecb76[_0x9f41('0x17')]:_0x51af4b[_0x9f41('0x16')]+_0x51af4b[_0x9f41('0x18')];var _0x24c8f8;if(_0x192653>=_0x3e4a51){_0x192653=_0x3e4a51;_0x24c8f8=0xc8;}else{_0x24c8f8=0xce;}_0x1c9db7[_0x9f41('0x14')](_0x24c8f8);return _0x1c9db7[_0x9f41('0x19')](_0x9f41('0x1a'),_0x30c54a+'-'+_0x192653+'/'+_0x3e4a51)[_0x9f41('0x15')](_0x4ecb76);}return null;};}function patchUpdates(_0x1b89e8){return function(_0x1956be){try{jsonpatch['apply'](_0x1956be,_0x1b89e8,!![]);}catch(_0x3471eb){return BPromise[_0x9f41('0x1b')](_0x3471eb);}return _0x1956be[_0x9f41('0x1c')]();};}function saveUpdates(_0x4a80aa,_0x1db57a){return function(_0x600909){if(_0x600909){return _0x600909[_0x9f41('0x1d')](_0x4a80aa)[_0x9f41('0x1e')](function(_0x4e4313){return _0x4e4313;});}return null;};}function removeEntity(_0xa2d66e,_0x342ef9){return function(_0x34552b){if(_0x34552b){return _0x34552b[_0x9f41('0x1f')]()['then'](function(){_0xa2d66e[_0x9f41('0x14')](0xcc)[_0x9f41('0x13')]();});}};}function handleEntityNotFound(_0x58dc98,_0x47084){return function(_0x4119db){if(!_0x4119db){_0x58dc98[_0x9f41('0x20')](0x194);}return _0x4119db;};}function handleError(_0x4de18f,_0x32bff7){_0x32bff7=_0x32bff7||0x1f4;return function(_0x5b7df6){logger[_0x9f41('0x21')](_0x5b7df6[_0x9f41('0x22')]);if(_0x5b7df6[_0x9f41('0x23')]){delete _0x5b7df6[_0x9f41('0x23')];}_0x4de18f[_0x9f41('0x14')](_0x32bff7)[_0x9f41('0x24')](_0x5b7df6);};}exports[_0x9f41('0x25')]=function(_0x3d7cd5,_0x547b83){var _0x3876a8={},_0x74e721={},_0x546bef={'count':0x0,'rows':[]};var _0xf1048b=_[_0x9f41('0x26')](db[_0x9f41('0x27')]['rawAttributes'],function(_0x15746a){return{'name':_0x15746a[_0x9f41('0x28')],'type':_0x15746a[_0x9f41('0x29')][_0x9f41('0x2a')]};});_0x74e721['model']=_[_0x9f41('0x26')](_0xf1048b,_0x9f41('0x23'));_0x74e721['query']=_[_0x9f41('0x2b')](_0x3d7cd5[_0x9f41('0x2c')]);_0x74e721[_0x9f41('0x2d')]=_['intersection'](_0x74e721[_0x9f41('0x2e')],_0x74e721['query']);_0x3876a8['attributes']=_[_0x9f41('0x2f')](_0x74e721[_0x9f41('0x2e')],qs[_0x9f41('0x30')](_0x3d7cd5[_0x9f41('0x2c')][_0x9f41('0x30')]));_0x3876a8[_0x9f41('0x31')]=_0x3876a8[_0x9f41('0x31')][_0x9f41('0x32')]?_0x3876a8['attributes']:_0x74e721['model'];if(!_0x3d7cd5[_0x9f41('0x2c')][_0x9f41('0x33')](_0x9f41('0x34'))){_0x3876a8[_0x9f41('0x18')]=qs['limit'](_0x3d7cd5[_0x9f41('0x2c')][_0x9f41('0x18')]);_0x3876a8[_0x9f41('0x16')]=qs[_0x9f41('0x16')](_0x3d7cd5[_0x9f41('0x2c')][_0x9f41('0x16')]);}_0x3876a8[_0x9f41('0x35')]=qs[_0x9f41('0x36')](_0x3d7cd5[_0x9f41('0x2c')][_0x9f41('0x36')]);_0x3876a8['where']=qs[_0x9f41('0x2d')](_[_0x9f41('0x37')](_0x3d7cd5['query'],_0x74e721[_0x9f41('0x2d')]),_0xf1048b);if(_0x3d7cd5[_0x9f41('0x2c')][_0x9f41('0x38')]){_0x3876a8[_0x9f41('0x39')]=_[_0x9f41('0x3a')](_0x3876a8[_0x9f41('0x39')],{'$or':_['map'](_0xf1048b,function(_0x590a6f){if(_0x590a6f['type']!==_0x9f41('0x3b')){var _0x241e8c={};_0x241e8c[_0x590a6f[_0x9f41('0x23')]]={'$like':'%'+_0x3d7cd5[_0x9f41('0x2c')][_0x9f41('0x38')]+'%'};return _0x241e8c;}})});}_0x3876a8=_[_0x9f41('0x3a')]({},_0x3876a8,_0x3d7cd5['options']);var _0x2fa0c3={'where':_0x3876a8['where']};return db[_0x9f41('0x27')][_0x9f41('0x17')](_0x2fa0c3)[_0x9f41('0x1e')](function(_0x4c0ddd){_0x546bef[_0x9f41('0x17')]=_0x4c0ddd;if(_0x3d7cd5[_0x9f41('0x2c')][_0x9f41('0x3c')]){_0x3876a8[_0x9f41('0x3d')]=[{'all':!![]}];}return db[_0x9f41('0x27')][_0x9f41('0x3e')](_0x3876a8);})['then'](function(_0x3ad523){_0x546bef[_0x9f41('0x3f')]=_0x3ad523;return _0x546bef;})[_0x9f41('0x1e')](respondWithFilteredResult(_0x547b83,_0x3876a8))[_0x9f41('0x40')](handleError(_0x547b83,null));};exports[_0x9f41('0x41')]=function(_0x39ba40,_0x4ad188){var _0x52cf62={'raw':![],'where':{'id':_0x39ba40['params']['id']}},_0x50a8c0={};_0x50a8c0[_0x9f41('0x2e')]=_[_0x9f41('0x2b')](db[_0x9f41('0x27')][_0x9f41('0x42')]);_0x50a8c0['query']=_['keys'](_0x39ba40['query']);_0x50a8c0['filters']=_['intersection'](_0x50a8c0[_0x9f41('0x2e')],_0x50a8c0['query']);_0x52cf62[_0x9f41('0x31')]=_['intersection'](_0x50a8c0['model'],qs[_0x9f41('0x30')](_0x39ba40[_0x9f41('0x2c')][_0x9f41('0x30')]));_0x52cf62[_0x9f41('0x31')]=_0x52cf62[_0x9f41('0x31')][_0x9f41('0x32')]?_0x52cf62[_0x9f41('0x31')]:_0x50a8c0[_0x9f41('0x2e')];if(_0x39ba40['query'][_0x9f41('0x3c')]){_0x52cf62[_0x9f41('0x3d')]=[{'all':!![]}];}_0x52cf62=_[_0x9f41('0x3a')]({},_0x52cf62,_0x39ba40[_0x9f41('0x43')]);return db[_0x9f41('0x27')][_0x9f41('0x44')](_0x52cf62)[_0x9f41('0x1e')](handleEntityNotFound(_0x4ad188,null))[_0x9f41('0x1e')](respondWithResult(_0x4ad188,null))[_0x9f41('0x40')](handleError(_0x4ad188,null));};exports[_0x9f41('0x45')]=function(_0x30d5f7,_0x39ffe9){return db[_0x9f41('0x27')]['create'](_0x30d5f7[_0x9f41('0x46')],{})[_0x9f41('0x1e')](respondWithResult(_0x39ffe9,0xc9))['catch'](handleError(_0x39ffe9,null));};exports['bulkCreate']=function(_0x26a801,_0x1f7ec2){return db[_0x9f41('0x27')][_0x9f41('0x47')](_0x26a801['body'],{'raw':![],'individualHooks':!![]})[_0x9f41('0x1e')](respondWithResult(_0x1f7ec2,0xc9))['catch'](handleError(_0x1f7ec2,null));};exports[_0x9f41('0x1d')]=function(_0x17d1f6,_0x4b2a28){if(_0x17d1f6[_0x9f41('0x46')]['id']){delete _0x17d1f6['body']['id'];}return db[_0x9f41('0x27')][_0x9f41('0x44')]({'where':{'id':_0x17d1f6[_0x9f41('0x48')]['id']}})['then'](handleEntityNotFound(_0x4b2a28,null))[_0x9f41('0x1e')](saveUpdates(_0x17d1f6[_0x9f41('0x46')],null))[_0x9f41('0x1e')](respondWithResult(_0x4b2a28,null))[_0x9f41('0x40')](handleError(_0x4b2a28,null));};exports[_0x9f41('0x1f')]=function(_0x2c83f6,_0x57d64f){return db[_0x9f41('0x27')]['find']({'where':{'id':_0x2c83f6['params']['id']}})[_0x9f41('0x1e')](handleEntityNotFound(_0x57d64f,null))[_0x9f41('0x1e')](removeEntity(_0x57d64f,null))[_0x9f41('0x40')](handleError(_0x57d64f,null));};exports[_0x9f41('0x49')]=function(_0xceac6c,_0x526c96){return db['AnalyticFieldReport'][_0x9f41('0x1f')]({'where':{'id':_0xceac6c[_0x9f41('0x2c')][_0x9f41('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x9f41('0x1e')](respondWithResult(_0x526c96,0xcc))[_0x9f41('0x40')](handleError(_0x526c96,null));};exports[_0x9f41('0x4b')]=function(_0x2fee9d,_0x3209bc,_0x2bfdeb){return db[_0x9f41('0x4c')][_0x9f41('0x4d')]({'where':{'id':_0x2fee9d[_0x9f41('0x48')]['id']}})['then'](handleEntityNotFound(_0x3209bc,null))[_0x9f41('0x1e')](function(_0x230d39){if(_0x230d39){return db['sequelize'][_0x9f41('0x4e')](function(_0x54eb3e){return db[_0x9f41('0x27')][_0x9f41('0x1f')]({'where':{'CustomReportId':_0x2fee9d['params']['id']},'transaction':_0x54eb3e})[_0x9f41('0x1e')](function(_0x3ba64c){var _0x33b8af=_['map'](_0x2fee9d['body'],function(_0x11ed40){delete _0x11ed40['id'];_0x11ed40[_0x9f41('0x4f')]=_0x2fee9d[_0x9f41('0x48')]['id'];return _0x11ed40;});return db['AnalyticFieldReport']['bulkCreate'](_0x33b8af,{'transaction':_0x54eb3e});});})[_0x9f41('0x1e')](function(){return db[_0x9f41('0x27')][_0x9f41('0x3e')]({'where':{'CustomReportId':_0x2fee9d[_0x9f41('0x48')]['id']}});});}})['then'](respondWithResult(_0x3209bc,null))[_0x9f41('0x40')](handleError(_0x3209bc,null));};
\ No newline at end of file
+var _0xe7be=['../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','apply','reject','save','update','then','end','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','bulkCreate','destroy','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','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','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x310514,_0x36e0d8){var _0x61c6a9=function(_0x25509e){while(--_0x25509e){_0x310514['push'](_0x310514['shift']());}};_0x61c6a9(++_0x36e0d8);}(_0xe7be,0x144));var _0xee7b=function(_0x26b1b8,_0x35bfd4){_0x26b1b8=_0x26b1b8-0x0;var _0x401762=_0xe7be[_0x26b1b8];return _0x401762;};'use strict';var emlformat=require(_0xee7b('0x0'));var rimraf=require(_0xee7b('0x1'));var zipdir=require(_0xee7b('0x2'));var jsonpatch=require(_0xee7b('0x3'));var rp=require(_0xee7b('0x4'));var moment=require(_0xee7b('0x5'));var BPromise=require(_0xee7b('0x6'));var Mustache=require(_0xee7b('0x7'));var util=require(_0xee7b('0x8'));var path=require(_0xee7b('0x9'));var sox=require(_0xee7b('0xa'));var csv=require(_0xee7b('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xee7b('0xc'));var _=require(_0xee7b('0xd'));var squel=require('squel');var crypto=require(_0xee7b('0xe'));var jsforce=require(_0xee7b('0xf'));var deskjs=require(_0xee7b('0x10'));var toCsv=require(_0xee7b('0xb'));var querystring=require(_0xee7b('0x11'));var Papa=require(_0xee7b('0x12'));var Redis=require(_0xee7b('0x13'));var authService=require(_0xee7b('0x14'));var qs=require(_0xee7b('0x15'));var as=require(_0xee7b('0x16'));var hardwareService=require(_0xee7b('0x17'));var logger=require(_0xee7b('0x18'))(_0xee7b('0x19'));var utils=require('../../config/utils');var config=require(_0xee7b('0x1a'));var licenseUtil=require(_0xee7b('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x247b06,_0x3914e6){_0x3914e6=_0x3914e6||0xcc;return function(_0x19da8f){if(_0x19da8f){return _0x247b06[_0xee7b('0x1c')](_0x3914e6);}return _0x247b06[_0xee7b('0x1d')](_0x3914e6)['end']();};}function respondWithResult(_0x501ede,_0x23e465){_0x23e465=_0x23e465||0xc8;return function(_0x258137){if(_0x258137){return _0x501ede[_0xee7b('0x1d')](_0x23e465)['json'](_0x258137);}};}function respondWithFilteredResult(_0x3fd048,_0x131bb2){return function(_0x542ce2){if(_0x542ce2){var _0x19c5af=typeof _0x131bb2[_0xee7b('0x1e')]===_0xee7b('0x1f')&&typeof _0x131bb2[_0xee7b('0x20')]==='undefined';var _0x11460d=_0x542ce2['count'];var _0x184041=_0x19c5af?0x0:_0x131bb2['offset'];var _0x218c8d=_0x19c5af?_0x542ce2[_0xee7b('0x21')]:_0x131bb2['offset']+_0x131bb2[_0xee7b('0x20')];var _0x272720;if(_0x218c8d>=_0x11460d){_0x218c8d=_0x11460d;_0x272720=0xc8;}else{_0x272720=0xce;}_0x3fd048['status'](_0x272720);return _0x3fd048[_0xee7b('0x22')]('Content-Range',_0x184041+'-'+_0x218c8d+'/'+_0x11460d)['json'](_0x542ce2);}return null;};}function patchUpdates(_0x286919){return function(_0x55f637){try{jsonpatch[_0xee7b('0x23')](_0x55f637,_0x286919,!![]);}catch(_0x57776c){return BPromise[_0xee7b('0x24')](_0x57776c);}return _0x55f637[_0xee7b('0x25')]();};}function saveUpdates(_0x1d9c41,_0x10b917){return function(_0x11b0cc){if(_0x11b0cc){return _0x11b0cc[_0xee7b('0x26')](_0x1d9c41)[_0xee7b('0x27')](function(_0x283e51){return _0x283e51;});}return null;};}function removeEntity(_0x3132a7,_0x3b0b5c){return function(_0x3527c6){if(_0x3527c6){return _0x3527c6['destroy']()[_0xee7b('0x27')](function(){_0x3132a7['status'](0xcc)[_0xee7b('0x28')]();});}};}function handleEntityNotFound(_0x5bd76c,_0x123bae){return function(_0x38db7b){if(!_0x38db7b){_0x5bd76c[_0xee7b('0x1c')](0x194);}return _0x38db7b;};}function handleError(_0x1dbee9,_0x413e4c){_0x413e4c=_0x413e4c||0x1f4;return function(_0x25f913){logger[_0xee7b('0x29')](_0x25f913[_0xee7b('0x2a')]);if(_0x25f913[_0xee7b('0x2b')]){delete _0x25f913[_0xee7b('0x2b')];}_0x1dbee9['status'](_0x413e4c)[_0xee7b('0x2c')](_0x25f913);};}exports[_0xee7b('0x2d')]=function(_0x40ea00,_0x5451e6){var _0x1d1055={},_0x45fa88={},_0x9525e7={'count':0x0,'rows':[]};var _0xd64897=_[_0xee7b('0x2e')](db[_0xee7b('0x2f')][_0xee7b('0x30')],function(_0x57e289){return{'name':_0x57e289['fieldName'],'type':_0x57e289[_0xee7b('0x31')][_0xee7b('0x32')]};});_0x45fa88[_0xee7b('0x33')]=_[_0xee7b('0x2e')](_0xd64897,_0xee7b('0x2b'));_0x45fa88[_0xee7b('0x34')]=_[_0xee7b('0x35')](_0x40ea00[_0xee7b('0x34')]);_0x45fa88[_0xee7b('0x36')]=_[_0xee7b('0x37')](_0x45fa88['model'],_0x45fa88['query']);_0x1d1055['attributes']=_['intersection'](_0x45fa88[_0xee7b('0x33')],qs[_0xee7b('0x38')](_0x40ea00[_0xee7b('0x34')][_0xee7b('0x38')]));_0x1d1055[_0xee7b('0x39')]=_0x1d1055['attributes'][_0xee7b('0x3a')]?_0x1d1055[_0xee7b('0x39')]:_0x45fa88[_0xee7b('0x33')];if(!_0x40ea00[_0xee7b('0x34')][_0xee7b('0x3b')](_0xee7b('0x3c'))){_0x1d1055['limit']=qs[_0xee7b('0x20')](_0x40ea00[_0xee7b('0x34')][_0xee7b('0x20')]);_0x1d1055[_0xee7b('0x1e')]=qs[_0xee7b('0x1e')](_0x40ea00[_0xee7b('0x34')][_0xee7b('0x1e')]);}_0x1d1055['order']=qs['sort'](_0x40ea00[_0xee7b('0x34')][_0xee7b('0x3d')]);_0x1d1055['where']=qs[_0xee7b('0x36')](_[_0xee7b('0x3e')](_0x40ea00[_0xee7b('0x34')],_0x45fa88[_0xee7b('0x36')]),_0xd64897);if(_0x40ea00[_0xee7b('0x34')][_0xee7b('0x3f')]){_0x1d1055[_0xee7b('0x40')]=_['merge'](_0x1d1055[_0xee7b('0x40')],{'$or':_[_0xee7b('0x2e')](_0xd64897,function(_0x3f1a3f){if(_0x3f1a3f[_0xee7b('0x31')]!==_0xee7b('0x41')){var _0x316b20={};_0x316b20[_0x3f1a3f[_0xee7b('0x2b')]]={'$like':'%'+_0x40ea00[_0xee7b('0x34')][_0xee7b('0x3f')]+'%'};return _0x316b20;}})});}_0x1d1055=_[_0xee7b('0x42')]({},_0x1d1055,_0x40ea00[_0xee7b('0x43')]);var _0x2050b1={'where':_0x1d1055[_0xee7b('0x40')]};return db[_0xee7b('0x2f')][_0xee7b('0x21')](_0x2050b1)['then'](function(_0x10e119){_0x9525e7[_0xee7b('0x21')]=_0x10e119;if(_0x40ea00['query'][_0xee7b('0x44')]){_0x1d1055[_0xee7b('0x45')]=[{'all':!![]}];}return db[_0xee7b('0x2f')][_0xee7b('0x46')](_0x1d1055);})[_0xee7b('0x27')](function(_0x349ae9){_0x9525e7[_0xee7b('0x47')]=_0x349ae9;return _0x9525e7;})['then'](respondWithFilteredResult(_0x5451e6,_0x1d1055))[_0xee7b('0x48')](handleError(_0x5451e6,null));};exports[_0xee7b('0x49')]=function(_0x293afd,_0x2e200f){var _0x3367c0={'raw':![],'where':{'id':_0x293afd[_0xee7b('0x4a')]['id']}},_0x46ffbe={};_0x46ffbe[_0xee7b('0x33')]=_['keys'](db[_0xee7b('0x2f')]['rawAttributes']);_0x46ffbe[_0xee7b('0x34')]=_[_0xee7b('0x35')](_0x293afd[_0xee7b('0x34')]);_0x46ffbe[_0xee7b('0x36')]=_['intersection'](_0x46ffbe[_0xee7b('0x33')],_0x46ffbe[_0xee7b('0x34')]);_0x3367c0[_0xee7b('0x39')]=_[_0xee7b('0x37')](_0x46ffbe[_0xee7b('0x33')],qs[_0xee7b('0x38')](_0x293afd['query']['fields']));_0x3367c0['attributes']=_0x3367c0[_0xee7b('0x39')]['length']?_0x3367c0[_0xee7b('0x39')]:_0x46ffbe[_0xee7b('0x33')];if(_0x293afd[_0xee7b('0x34')][_0xee7b('0x44')]){_0x3367c0['include']=[{'all':!![]}];}_0x3367c0=_[_0xee7b('0x42')]({},_0x3367c0,_0x293afd[_0xee7b('0x43')]);return db[_0xee7b('0x2f')][_0xee7b('0x4b')](_0x3367c0)[_0xee7b('0x27')](handleEntityNotFound(_0x2e200f,null))[_0xee7b('0x27')](respondWithResult(_0x2e200f,null))[_0xee7b('0x48')](handleError(_0x2e200f,null));};exports[_0xee7b('0x4c')]=function(_0x43fb3c,_0x3f5ce5){return db[_0xee7b('0x2f')][_0xee7b('0x4c')](_0x43fb3c[_0xee7b('0x4d')],{})['then'](respondWithResult(_0x3f5ce5,0xc9))[_0xee7b('0x48')](handleError(_0x3f5ce5,null));};exports[_0xee7b('0x4e')]=function(_0x6491b6,_0x24a88b){return db['AnalyticFieldReport']['bulkCreate'](_0x6491b6[_0xee7b('0x4d')],{'raw':![],'individualHooks':!![]})[_0xee7b('0x27')](respondWithResult(_0x24a88b,0xc9))['catch'](handleError(_0x24a88b,null));};exports['update']=function(_0x561f05,_0x50b5ba){if(_0x561f05[_0xee7b('0x4d')]['id']){delete _0x561f05[_0xee7b('0x4d')]['id'];}return db['AnalyticFieldReport'][_0xee7b('0x4b')]({'where':{'id':_0x561f05[_0xee7b('0x4a')]['id']}})[_0xee7b('0x27')](handleEntityNotFound(_0x50b5ba,null))[_0xee7b('0x27')](saveUpdates(_0x561f05[_0xee7b('0x4d')],null))['then'](respondWithResult(_0x50b5ba,null))[_0xee7b('0x48')](handleError(_0x50b5ba,null));};exports[_0xee7b('0x4f')]=function(_0x248849,_0xa94594){return db[_0xee7b('0x2f')][_0xee7b('0x4b')]({'where':{'id':_0x248849[_0xee7b('0x4a')]['id']}})['then'](handleEntityNotFound(_0xa94594,null))['then'](removeEntity(_0xa94594,null))['catch'](handleError(_0xa94594,null));};exports[_0xee7b('0x50')]=function(_0x56fb34,_0x51ba53){return db[_0xee7b('0x2f')][_0xee7b('0x4f')]({'where':{'id':_0x56fb34[_0xee7b('0x34')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xee7b('0x27')](respondWithResult(_0x51ba53,0xcc))[_0xee7b('0x48')](handleError(_0x51ba53,null));};exports[_0xee7b('0x51')]=function(_0x470182,_0x219310,_0x12fa28){return db[_0xee7b('0x52')][_0xee7b('0x53')]({'where':{'id':_0x470182[_0xee7b('0x4a')]['id']}})[_0xee7b('0x27')](handleEntityNotFound(_0x219310,null))[_0xee7b('0x27')](function(_0x4a6f79){if(_0x4a6f79){return db[_0xee7b('0x54')][_0xee7b('0x55')](function(_0x35d4d7){return db[_0xee7b('0x2f')][_0xee7b('0x4f')]({'where':{'CustomReportId':_0x470182[_0xee7b('0x4a')]['id']},'transaction':_0x35d4d7})[_0xee7b('0x27')](function(_0x310fb0){var _0x54a0ca=_[_0xee7b('0x2e')](_0x470182['body'],function(_0x2a0275){delete _0x2a0275['id'];_0x2a0275[_0xee7b('0x56')]=_0x470182['params']['id'];return _0x2a0275;});return db['AnalyticFieldReport'][_0xee7b('0x4e')](_0x54a0ca,{'transaction':_0x35d4d7});});})[_0xee7b('0x27')](function(){return db['AnalyticFieldReport'][_0xee7b('0x46')]({'where':{'CustomReportId':_0x470182[_0xee7b('0x4a')]['id']}});});}})[_0xee7b('0x27')](respondWithResult(_0x219310,null))[_0xee7b('0x48')](handleError(_0x219310,null));};
\ No newline at end of file
index cef3202..0b04f50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43a3=['moment','bluebird','request-promise','path','rimraf','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','api'];(function(_0x36abc8,_0x354a28){var _0x4626ad=function(_0x5c0bfe){while(--_0x5c0bfe){_0x36abc8['push'](_0x36abc8['shift']());}};_0x4626ad(++_0x354a28);}(_0x43a3,0x1c4));var _0x343a=function(_0x40a410,_0x54a561){_0x40a410=_0x40a410-0x0;var _0x4e0d8b=_0x43a3[_0x40a410];return _0x4e0d8b;};'use strict';var _=require('lodash');var util=require(_0x343a('0x0'));var logger=require(_0x343a('0x1'))(_0x343a('0x2'));var moment=require(_0x343a('0x3'));var BPromise=require(_0x343a('0x4'));var rp=require(_0x343a('0x5'));var fs=require('fs');var path=require(_0x343a('0x6'));var rimraf=require(_0x343a('0x7'));var config=require('../../config/environment');var attributes=require(_0x343a('0x8'));module[_0x343a('0x9')]=function(_0x245180,_0x15a6fd){return _0x245180[_0x343a('0xa')](_0x343a('0xb'),attributes,{'tableName':_0x343a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbd66=['exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./analyticFieldReport.attributes'];(function(_0x2c54db,_0x4decb4){var _0x40c4e4=function(_0x22acbc){while(--_0x22acbc){_0x2c54db['push'](_0x2c54db['shift']());}};_0x40c4e4(++_0x4decb4);}(_0xbd66,0x1a4));var _0x6bd6=function(_0x565cc0,_0x21eda8){_0x565cc0=_0x565cc0-0x0;var _0x38a572=_0xbd66[_0x565cc0];return _0x38a572;};'use strict';var _=require(_0x6bd6('0x0'));var util=require(_0x6bd6('0x1'));var logger=require(_0x6bd6('0x2'))(_0x6bd6('0x3'));var moment=require(_0x6bd6('0x4'));var BPromise=require('bluebird');var rp=require(_0x6bd6('0x5'));var fs=require('fs');var path=require(_0x6bd6('0x6'));var rimraf=require(_0x6bd6('0x7'));var config=require('../../config/environment');var attributes=require(_0x6bd6('0x8'));module[_0x6bd6('0x9')]=function(_0x4a433d,_0x204124){return _0x4a433d[_0x6bd6('0xa')](_0x6bd6('0xb'),attributes,{'tableName':_0x6bd6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b558952..fde5a93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0235=['../../config/logger','../../config/environment','jayson/promise','http','info','AnalyticFieldReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x3d00db,_0x3692b3){var _0x41f115=function(_0x3c94fd){while(--_0x3c94fd){_0x3d00db['push'](_0x3d00db['shift']());}};_0x41f115(++_0x3692b3);}(_0x0235,0x77));var _0x5023=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x0235[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x5023('0x0'));var util=require(_0x5023('0x1'));var moment=require(_0x5023('0x2'));var BPromise=require(_0x5023('0x3'));var rs=require(_0x5023('0x4'));var fs=require('fs');var Redis=require(_0x5023('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5023('0x6'));var logger=require(_0x5023('0x7'))('rpc');var config=require(_0x5023('0x8'));var jayson=require(_0x5023('0x9'));var client=jayson['client'][_0x5023('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16fddd,_0x54832a,_0x6a7aef){return new BPromise(function(_0x5079b6,_0x5b1b7c){return client['request'](_0x16fddd,_0x6a7aef)['then'](function(_0x3dc4b9){logger[_0x5023('0xb')](_0x5023('0xc'),_0x54832a,'request\x20sent');logger[_0x5023('0xd')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x54832a,_0x5023('0xe'),JSON[_0x5023('0xf')](_0x3dc4b9));if(_0x3dc4b9[_0x5023('0x10')]){if(_0x3dc4b9[_0x5023('0x10')][_0x5023('0x11')]===0x1f4){logger[_0x5023('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x54832a,_0x3dc4b9[_0x5023('0x10')][_0x5023('0x12')]);return _0x5b1b7c(_0x3dc4b9['error'][_0x5023('0x12')]);}logger[_0x5023('0x10')](_0x5023('0xc'),_0x54832a,_0x3dc4b9[_0x5023('0x10')][_0x5023('0x12')]);return _0x5079b6(_0x3dc4b9[_0x5023('0x10')][_0x5023('0x12')]);}else{logger[_0x5023('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x54832a,_0x5023('0xe'));_0x5079b6(_0x3dc4b9[_0x5023('0x13')][_0x5023('0x12')]);}})[_0x5023('0x14')](function(_0x1c7574){logger[_0x5023('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x54832a,_0x1c7574);_0x5b1b7c(_0x1c7574);});});}
\ No newline at end of file
+var _0x31a2=['info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','then'];(function(_0x2a3922,_0x225dd2){var _0x3ccc8c=function(_0x3d972a){while(--_0x3d972a){_0x2a3922['push'](_0x2a3922['shift']());}};_0x3ccc8c(++_0x225dd2);}(_0x31a2,0x74));var _0x231a=function(_0x4578ec,_0x3ffc5f){_0x4578ec=_0x4578ec-0x0;var _0x20d678=_0x31a2[_0x4578ec];return _0x20d678;};'use strict';var _=require(_0x231a('0x0'));var util=require('util');var moment=require(_0x231a('0x1'));var BPromise=require('bluebird');var rs=require(_0x231a('0x2'));var fs=require('fs');var Redis=require(_0x231a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x231a('0x4'));var logger=require(_0x231a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x231a('0x6'));var client=jayson[_0x231a('0x7')][_0x231a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bf137,_0x24e71d,_0x2fbf8f){return new BPromise(function(_0x2bb4c4,_0x3e2a4d){return client['request'](_0x1bf137,_0x2fbf8f)[_0x231a('0x9')](function(_0x11fc14){logger[_0x231a('0xa')]('AnalyticFieldReport,\x20%s,\x20%s',_0x24e71d,_0x231a('0xb'));logger[_0x231a('0xc')](_0x231a('0xd'),_0x24e71d,_0x231a('0xb'),JSON[_0x231a('0xe')](_0x11fc14));if(_0x11fc14['error']){if(_0x11fc14[_0x231a('0xf')][_0x231a('0x10')]===0x1f4){logger['error'](_0x231a('0x11'),_0x24e71d,_0x11fc14['error'][_0x231a('0x12')]);return _0x3e2a4d(_0x11fc14[_0x231a('0xf')][_0x231a('0x12')]);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x24e71d,_0x11fc14[_0x231a('0xf')]['message']);return _0x2bb4c4(_0x11fc14['error'][_0x231a('0x12')]);}else{logger[_0x231a('0xa')](_0x231a('0x11'),_0x24e71d,'request\x20sent');_0x2bb4c4(_0x11fc14[_0x231a('0x13')][_0x231a('0x12')]);}})[_0x231a('0x14')](function(_0x2c4c43){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x24e71d,_0x2c4c43);_0x3e2a4d(_0x2c4c43);});});}
\ No newline at end of file
index ccbc85f..c268212 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(_0x3dd4fc,_0x1f7812){var _0x3e7f83=function(_0x23b249){while(--_0x23b249){_0x3dd4fc['push'](_0x3dd4fc['shift']());}};_0x3e7f83(++_0x1f7812);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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(_0x3314fc,_0x458af5){var _0xe4b348=function(_0x51fd7b){while(--_0x51fd7b){_0x3314fc['push'](_0x3314fc['shift']());}};_0xe4b348(++_0x458af5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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 39b14bd..818932e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x570f=['STRING','TEXT','sequelize','exports'];(function(_0x5ca2fe,_0x20e1fd){var _0x206e0f=function(_0x16b9fa){while(--_0x16b9fa){_0x5ca2fe['push'](_0x5ca2fe['shift']());}};_0x206e0f(++_0x20e1fd);}(_0x570f,0x152));var _0xf570=function(_0x4e26b8,_0x1a3c12){_0x4e26b8=_0x4e26b8-0x0;var _0x10a6f0=_0x570f[_0x4e26b8];return _0x10a6f0;};'use strict';var Sequelize=require(_0xf570('0x0'));module[_0xf570('0x1')]={'name':{'type':Sequelize[_0xf570('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xf570('0x3')]},'description':{'type':Sequelize[_0xf570('0x2')]}};
\ No newline at end of file
+var _0x4517=['TEXT','exports','STRING'];(function(_0x346392,_0x32b724){var _0xd76262=function(_0x9d1a6d){while(--_0x9d1a6d){_0x346392['push'](_0x346392['shift']());}};_0xd76262(++_0x32b724);}(_0x4517,0x112));var _0x7451=function(_0x4b7d89,_0x5bc779){_0x4b7d89=_0x4b7d89-0x0;var _0x32e3f5=_0x4517[_0x4b7d89];return _0x32e3f5;};'use strict';var Sequelize=require('sequelize');module[_0x7451('0x0')]={'name':{'type':Sequelize[_0x7451('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x7451('0x1')]},'metric':{'type':Sequelize[_0x7451('0x2')]},'description':{'type':Sequelize[_0x7451('0x1')]}};
\ No newline at end of file
index 6875a26..7864ae7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81bd=['filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','AnalyticMetric','includeAll','include','findAll','rows','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','Metrics','stack','name','send','index','map','fieldName','query','keys'];(function(_0x43d753,_0x3f297d){var _0x1958e9=function(_0xb48c3b){while(--_0xb48c3b){_0x43d753['push'](_0x43d753['shift']());}};_0x1958e9(++_0x3f297d);}(_0x81bd,0x7c));var _0xd81b=function(_0x5617e2,_0x1ffcd7){_0x5617e2=_0x5617e2-0x0;var _0x27b60d=_0x81bd[_0x5617e2];return _0x27b60d;};'use strict';var emlformat=require(_0xd81b('0x0'));var rimraf=require(_0xd81b('0x1'));var zipdir=require(_0xd81b('0x2'));var jsonpatch=require(_0xd81b('0x3'));var rp=require(_0xd81b('0x4'));var moment=require(_0xd81b('0x5'));var BPromise=require(_0xd81b('0x6'));var Mustache=require('mustache');var util=require(_0xd81b('0x7'));var path=require(_0xd81b('0x8'));var sox=require(_0xd81b('0x9'));var csv=require('to-csv');var ejs=require(_0xd81b('0xa'));var fs=require('fs');var fs_extra=require(_0xd81b('0xb'));var _=require(_0xd81b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd81b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd81b('0xe'));var querystring=require(_0xd81b('0xf'));var Papa=require(_0xd81b('0x10'));var Redis=require(_0xd81b('0x11'));var authService=require(_0xd81b('0x12'));var qs=require(_0xd81b('0x13'));var as=require(_0xd81b('0x14'));var hardwareService=require(_0xd81b('0x15'));var logger=require(_0xd81b('0x16'))(_0xd81b('0x17'));var utils=require(_0xd81b('0x18'));var config=require(_0xd81b('0x19'));var licenseUtil=require(_0xd81b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21dfff,_0x57f71d){_0x57f71d=_0x57f71d||0xcc;return function(_0x3f2405){if(_0x3f2405){return _0x21dfff[_0xd81b('0x1b')](_0x57f71d);}return _0x21dfff['status'](_0x57f71d)[_0xd81b('0x1c')]();};}function respondWithResult(_0x47dd04,_0x13dd00){_0x13dd00=_0x13dd00||0xc8;return function(_0x41bf7a){if(_0x41bf7a){return _0x47dd04[_0xd81b('0x1d')](_0x13dd00)[_0xd81b('0x1e')](_0x41bf7a);}};}function respondWithFilteredResult(_0x128162,_0x552215){return function(_0x1c620d){if(_0x1c620d){var _0x27b7a0=typeof _0x552215['offset']===_0xd81b('0x1f')&&typeof _0x552215[_0xd81b('0x20')]===_0xd81b('0x1f');var _0x15e860=_0x1c620d[_0xd81b('0x21')];var _0xc49b8d=_0x27b7a0?0x0:_0x552215[_0xd81b('0x22')];var _0x3d4d34=_0x27b7a0?_0x1c620d[_0xd81b('0x21')]:_0x552215[_0xd81b('0x22')]+_0x552215[_0xd81b('0x20')];var _0x453952;if(_0x3d4d34>=_0x15e860){_0x3d4d34=_0x15e860;_0x453952=0xc8;}else{_0x453952=0xce;}_0x128162[_0xd81b('0x1d')](_0x453952);return _0x128162[_0xd81b('0x23')](_0xd81b('0x24'),_0xc49b8d+'-'+_0x3d4d34+'/'+_0x15e860)[_0xd81b('0x1e')](_0x1c620d);}return null;};}function patchUpdates(_0x5f101a){return function(_0x4d566e){try{jsonpatch[_0xd81b('0x25')](_0x4d566e,_0x5f101a,!![]);}catch(_0x1b7876){return BPromise[_0xd81b('0x26')](_0x1b7876);}return _0x4d566e['save']();};}function saveUpdates(_0x19ed0e,_0x6571a6){return function(_0x542ee2){if(_0x542ee2){return _0x542ee2[_0xd81b('0x27')](_0x19ed0e)[_0xd81b('0x28')](function(_0x1670cd){return _0x1670cd;});}return null;};}function removeEntity(_0x1ad65c,_0x279176){return function(_0xcb4f91){if(_0xcb4f91){return _0xcb4f91[_0xd81b('0x29')]()[_0xd81b('0x28')](function(){var _0x341aec=_0xcb4f91[_0xd81b('0x2a')]({'plain':!![]});var _0x2ccedf=_0xd81b('0x2b');return db['UserProfileResource'][_0xd81b('0x29')]({'where':{'type':_0x2ccedf,'resourceId':_0x341aec['id']}})[_0xd81b('0x28')](function(){return _0xcb4f91;});})[_0xd81b('0x28')](function(){_0x1ad65c[_0xd81b('0x1d')](0xcc)[_0xd81b('0x1c')]();});}};}function handleEntityNotFound(_0x2d0d02,_0x3e28dd){return function(_0x73dc09){if(!_0x73dc09){_0x2d0d02[_0xd81b('0x1b')](0x194);}return _0x73dc09;};}function handleError(_0x483a3d,_0x469cc4){_0x469cc4=_0x469cc4||0x1f4;return function(_0x4e2eff){logger['error'](_0x4e2eff[_0xd81b('0x2c')]);if(_0x4e2eff[_0xd81b('0x2d')]){delete _0x4e2eff['name'];}_0x483a3d['status'](_0x469cc4)[_0xd81b('0x2e')](_0x4e2eff);};}exports[_0xd81b('0x2f')]=function(_0x1b1434,_0x289f54){var _0x1a1572={},_0x4654ba={},_0x5527ed={'count':0x0,'rows':[]};var _0x37d381=_[_0xd81b('0x30')](db['AnalyticMetric']['rawAttributes'],function(_0x165892){return{'name':_0x165892[_0xd81b('0x31')],'type':_0x165892['type']['key']};});_0x4654ba['model']=_[_0xd81b('0x30')](_0x37d381,_0xd81b('0x2d'));_0x4654ba[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x1b1434[_0xd81b('0x32')]);_0x4654ba[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x4654ba['model'],_0x4654ba[_0xd81b('0x32')]);_0x1a1572['attributes']=_[_0xd81b('0x35')](_0x4654ba[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x37')]));_0x1a1572[_0xd81b('0x38')]=_0x1a1572[_0xd81b('0x38')][_0xd81b('0x39')]?_0x1a1572[_0xd81b('0x38')]:_0x4654ba[_0xd81b('0x36')];if(!_0x1b1434[_0xd81b('0x32')][_0xd81b('0x3a')](_0xd81b('0x3b'))){_0x1a1572['limit']=qs['limit'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x20')]);_0x1a1572[_0xd81b('0x22')]=qs['offset'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x22')]);}_0x1a1572['order']=qs[_0xd81b('0x3c')](_0x1b1434[_0xd81b('0x32')]['sort']);_0x1a1572[_0xd81b('0x3d')]=qs['filters'](_[_0xd81b('0x3e')](_0x1b1434[_0xd81b('0x32')],_0x4654ba[_0xd81b('0x34')]),_0x37d381);if(_0x1b1434[_0xd81b('0x32')]['filter']){_0x1a1572[_0xd81b('0x3d')]=_[_0xd81b('0x3f')](_0x1a1572[_0xd81b('0x3d')],{'$or':_[_0xd81b('0x30')](_0x37d381,function(_0x3abd60){if(_0x3abd60[_0xd81b('0x40')]!==_0xd81b('0x41')){var _0x532ada={};_0x532ada[_0x3abd60[_0xd81b('0x2d')]]={'$like':'%'+_0x1b1434[_0xd81b('0x32')][_0xd81b('0x42')]+'%'};return _0x532ada;}})});}_0x1a1572=_['merge']({},_0x1a1572,_0x1b1434[_0xd81b('0x43')]);var _0x3a05f4={'where':_0x1a1572[_0xd81b('0x3d')]};return db[_0xd81b('0x44')][_0xd81b('0x21')](_0x3a05f4)['then'](function(_0x3dfba7){_0x5527ed[_0xd81b('0x21')]=_0x3dfba7;if(_0x1b1434[_0xd81b('0x32')][_0xd81b('0x45')]){_0x1a1572[_0xd81b('0x46')]=[{'all':!![]}];}return db[_0xd81b('0x44')][_0xd81b('0x47')](_0x1a1572);})[_0xd81b('0x28')](function(_0x4405a8){_0x5527ed[_0xd81b('0x48')]=_0x4405a8;return _0x5527ed;})[_0xd81b('0x28')](respondWithFilteredResult(_0x289f54,_0x1a1572))['catch'](handleError(_0x289f54,null));};exports[_0xd81b('0x49')]=function(_0x2778b3,_0x25824e){var _0xa5e391={'raw':!![],'where':{'id':_0x2778b3[_0xd81b('0x4a')]['id']}},_0x1e6654={};_0x1e6654[_0xd81b('0x36')]=_[_0xd81b('0x33')](db['AnalyticMetric']['rawAttributes']);_0x1e6654[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x2778b3[_0xd81b('0x32')]);_0x1e6654[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],_0x1e6654[_0xd81b('0x32')]);_0xa5e391[_0xd81b('0x38')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x2778b3[_0xd81b('0x32')]['fields']));_0xa5e391[_0xd81b('0x38')]=_0xa5e391[_0xd81b('0x38')][_0xd81b('0x39')]?_0xa5e391[_0xd81b('0x38')]:_0x1e6654[_0xd81b('0x36')];if(_0x2778b3[_0xd81b('0x32')][_0xd81b('0x45')]){_0xa5e391[_0xd81b('0x46')]=[{'all':!![]}];}_0xa5e391=_[_0xd81b('0x3f')]({},_0xa5e391,_0x2778b3['options']);return db[_0xd81b('0x44')][_0xd81b('0x4b')](_0xa5e391)[_0xd81b('0x28')](handleEntityNotFound(_0x25824e,null))[_0xd81b('0x28')](respondWithResult(_0x25824e,null))['catch'](handleError(_0x25824e,null));};exports[_0xd81b('0x4c')]=function(_0x151127,_0x15030b){return db[_0xd81b('0x44')][_0xd81b('0x4c')](_0x151127[_0xd81b('0x4d')],{})[_0xd81b('0x28')](function(_0x43d7ce){var _0x133a76=_0x151127['user']['get']({'plain':!![]});if(!_0x133a76)throw new Error(_0xd81b('0x4e'));if(_0x133a76[_0xd81b('0x4f')]===_0xd81b('0x50')){var _0x4da281=_0x43d7ce[_0xd81b('0x2a')]({'plain':!![]});var _0x3d6ab3=_0xd81b('0x2b');return db[_0xd81b('0x51')]['find']({'where':{'name':_0x3d6ab3,'userProfileId':_0x133a76[_0xd81b('0x52')]},'raw':!![]})[_0xd81b('0x28')](function(_0x1b523c){if(_0x1b523c&&_0x1b523c[_0xd81b('0x53')]===0x0){return db[_0xd81b('0x54')]['create']({'name':_0x4da281[_0xd81b('0x2d')],'resourceId':_0x4da281['id'],'type':_0x1b523c[_0xd81b('0x2d')],'sectionId':_0x1b523c['id']},{})['then'](function(){return _0x43d7ce;});}else{return _0x43d7ce;}})[_0xd81b('0x55')](function(_0x315bd5){logger[_0xd81b('0x56')](_0xd81b('0x57'),_0x315bd5);throw _0x315bd5;});}return _0x43d7ce;})[_0xd81b('0x28')](respondWithResult(_0x15030b,0xc9))[_0xd81b('0x55')](handleError(_0x15030b,null));};exports[_0xd81b('0x27')]=function(_0x22f588,_0x3ed626){if(_0x22f588[_0xd81b('0x4d')]['id']){delete _0x22f588[_0xd81b('0x4d')]['id'];}return db['AnalyticMetric'][_0xd81b('0x4b')]({'where':{'id':_0x22f588['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x3ed626,null))[_0xd81b('0x28')](saveUpdates(_0x22f588[_0xd81b('0x4d')],null))[_0xd81b('0x28')](respondWithResult(_0x3ed626,null))[_0xd81b('0x55')](handleError(_0x3ed626,null));};exports[_0xd81b('0x29')]=function(_0x5c196a,_0x2d978d){return db[_0xd81b('0x44')]['find']({'where':{'id':_0x5c196a['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x2d978d,null))['then'](removeEntity(_0x2d978d,null))[_0xd81b('0x55')](handleError(_0x2d978d,null));};
\ No newline at end of file
+var _0x8ef6=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','index','map','fieldName','key','model','keys','query','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','type','VIRTUAL','options','AnalyticMetric','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x57a071,_0x3bdfec){var _0x25173b=function(_0x4127a1){while(--_0x4127a1){_0x57a071['push'](_0x57a071['shift']());}};_0x25173b(++_0x3bdfec);}(_0x8ef6,0xf2));var _0x68ef=function(_0x22e1a1,_0x5495bf){_0x22e1a1=_0x22e1a1-0x0;var _0x591c52=_0x8ef6[_0x22e1a1];return _0x591c52;};'use strict';var emlformat=require(_0x68ef('0x0'));var rimraf=require(_0x68ef('0x1'));var zipdir=require(_0x68ef('0x2'));var jsonpatch=require(_0x68ef('0x3'));var rp=require(_0x68ef('0x4'));var moment=require(_0x68ef('0x5'));var BPromise=require(_0x68ef('0x6'));var Mustache=require('mustache');var util=require(_0x68ef('0x7'));var path=require(_0x68ef('0x8'));var sox=require(_0x68ef('0x9'));var csv=require(_0x68ef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68ef('0xb'));var squel=require(_0x68ef('0xc'));var crypto=require(_0x68ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x68ef('0xe'));var toCsv=require(_0x68ef('0xa'));var querystring=require(_0x68ef('0xf'));var Papa=require(_0x68ef('0x10'));var Redis=require(_0x68ef('0x11'));var authService=require(_0x68ef('0x12'));var qs=require(_0x68ef('0x13'));var as=require(_0x68ef('0x14'));var hardwareService=require(_0x68ef('0x15'));var logger=require(_0x68ef('0x16'))(_0x68ef('0x17'));var utils=require(_0x68ef('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x68ef('0x19'));var db=require(_0x68ef('0x1a'))['db'];function respondWithStatusCode(_0x1e117a,_0x454ef4){_0x454ef4=_0x454ef4||0xcc;return function(_0x40f253){if(_0x40f253){return _0x1e117a[_0x68ef('0x1b')](_0x454ef4);}return _0x1e117a['status'](_0x454ef4)[_0x68ef('0x1c')]();};}function respondWithResult(_0xc50cce,_0x2657c5){_0x2657c5=_0x2657c5||0xc8;return function(_0x47fbb5){if(_0x47fbb5){return _0xc50cce[_0x68ef('0x1d')](_0x2657c5)[_0x68ef('0x1e')](_0x47fbb5);}};}function respondWithFilteredResult(_0x24682d,_0x5005ba){return function(_0x35493d){if(_0x35493d){var _0x37c4cc=typeof _0x5005ba[_0x68ef('0x1f')]===_0x68ef('0x20')&&typeof _0x5005ba['limit']===_0x68ef('0x20');var _0x54139e=_0x35493d['count'];var _0x2633c1=_0x37c4cc?0x0:_0x5005ba[_0x68ef('0x1f')];var _0x4ade0d=_0x37c4cc?_0x35493d['count']:_0x5005ba[_0x68ef('0x1f')]+_0x5005ba[_0x68ef('0x21')];var _0x318514;if(_0x4ade0d>=_0x54139e){_0x4ade0d=_0x54139e;_0x318514=0xc8;}else{_0x318514=0xce;}_0x24682d['status'](_0x318514);return _0x24682d[_0x68ef('0x22')](_0x68ef('0x23'),_0x2633c1+'-'+_0x4ade0d+'/'+_0x54139e)[_0x68ef('0x1e')](_0x35493d);}return null;};}function patchUpdates(_0x5b246b){return function(_0x3c46d4){try{jsonpatch[_0x68ef('0x24')](_0x3c46d4,_0x5b246b,!![]);}catch(_0x5af19f){return BPromise[_0x68ef('0x25')](_0x5af19f);}return _0x3c46d4[_0x68ef('0x26')]();};}function saveUpdates(_0x19aa3d,_0x5ddec7){return function(_0x59723c){if(_0x59723c){return _0x59723c['update'](_0x19aa3d)[_0x68ef('0x27')](function(_0x2023f2){return _0x2023f2;});}return null;};}function removeEntity(_0x312cc9,_0x2e6e39){return function(_0x438b4c){if(_0x438b4c){return _0x438b4c[_0x68ef('0x28')]()[_0x68ef('0x27')](function(){var _0x49374f=_0x438b4c[_0x68ef('0x29')]({'plain':!![]});var _0x13280b='Metrics';return db[_0x68ef('0x2a')]['destroy']({'where':{'type':_0x13280b,'resourceId':_0x49374f['id']}})['then'](function(){return _0x438b4c;});})['then'](function(){_0x312cc9[_0x68ef('0x1d')](0xcc)[_0x68ef('0x1c')]();});}};}function handleEntityNotFound(_0x123041,_0x29518e){return function(_0x52e67e){if(!_0x52e67e){_0x123041['sendStatus'](0x194);}return _0x52e67e;};}function handleError(_0x1cbe4f,_0x28907a){_0x28907a=_0x28907a||0x1f4;return function(_0x7bf96){logger[_0x68ef('0x2b')](_0x7bf96[_0x68ef('0x2c')]);if(_0x7bf96[_0x68ef('0x2d')]){delete _0x7bf96[_0x68ef('0x2d')];}_0x1cbe4f[_0x68ef('0x1d')](_0x28907a)['send'](_0x7bf96);};}exports[_0x68ef('0x2e')]=function(_0x4314bd,_0x132d9e){var _0x4c25aa={},_0x370a8f={},_0x523120={'count':0x0,'rows':[]};var _0x133788=_[_0x68ef('0x2f')](db['AnalyticMetric']['rawAttributes'],function(_0x159395){return{'name':_0x159395[_0x68ef('0x30')],'type':_0x159395['type'][_0x68ef('0x31')]};});_0x370a8f[_0x68ef('0x32')]=_[_0x68ef('0x2f')](_0x133788,_0x68ef('0x2d'));_0x370a8f['query']=_[_0x68ef('0x33')](_0x4314bd[_0x68ef('0x34')]);_0x370a8f['filters']=_[_0x68ef('0x35')](_0x370a8f['model'],_0x370a8f[_0x68ef('0x34')]);_0x4c25aa[_0x68ef('0x36')]=_['intersection'](_0x370a8f[_0x68ef('0x32')],qs['fields'](_0x4314bd[_0x68ef('0x34')]['fields']));_0x4c25aa[_0x68ef('0x36')]=_0x4c25aa[_0x68ef('0x36')][_0x68ef('0x37')]?_0x4c25aa['attributes']:_0x370a8f[_0x68ef('0x32')];if(!_0x4314bd['query'][_0x68ef('0x38')]('nolimit')){_0x4c25aa[_0x68ef('0x21')]=qs[_0x68ef('0x21')](_0x4314bd[_0x68ef('0x34')][_0x68ef('0x21')]);_0x4c25aa[_0x68ef('0x1f')]=qs[_0x68ef('0x1f')](_0x4314bd['query'][_0x68ef('0x1f')]);}_0x4c25aa[_0x68ef('0x39')]=qs[_0x68ef('0x3a')](_0x4314bd['query'][_0x68ef('0x3a')]);_0x4c25aa[_0x68ef('0x3b')]=qs[_0x68ef('0x3c')](_['pick'](_0x4314bd['query'],_0x370a8f[_0x68ef('0x3c')]),_0x133788);if(_0x4314bd[_0x68ef('0x34')][_0x68ef('0x3d')]){_0x4c25aa[_0x68ef('0x3b')]=_[_0x68ef('0x3e')](_0x4c25aa[_0x68ef('0x3b')],{'$or':_[_0x68ef('0x2f')](_0x133788,function(_0x5b1246){if(_0x5b1246[_0x68ef('0x3f')]!==_0x68ef('0x40')){var _0x2f6ee0={};_0x2f6ee0[_0x5b1246[_0x68ef('0x2d')]]={'$like':'%'+_0x4314bd['query'][_0x68ef('0x3d')]+'%'};return _0x2f6ee0;}})});}_0x4c25aa=_[_0x68ef('0x3e')]({},_0x4c25aa,_0x4314bd[_0x68ef('0x41')]);var _0x410c10={'where':_0x4c25aa[_0x68ef('0x3b')]};return db[_0x68ef('0x42')]['count'](_0x410c10)[_0x68ef('0x27')](function(_0x3f7699){_0x523120[_0x68ef('0x43')]=_0x3f7699;if(_0x4314bd[_0x68ef('0x34')][_0x68ef('0x44')]){_0x4c25aa[_0x68ef('0x45')]=[{'all':!![]}];}return db[_0x68ef('0x42')][_0x68ef('0x46')](_0x4c25aa);})[_0x68ef('0x27')](function(_0x531096){_0x523120[_0x68ef('0x47')]=_0x531096;return _0x523120;})[_0x68ef('0x27')](respondWithFilteredResult(_0x132d9e,_0x4c25aa))[_0x68ef('0x48')](handleError(_0x132d9e,null));};exports[_0x68ef('0x49')]=function(_0xdeacf2,_0x183377){var _0xcac58f={'raw':!![],'where':{'id':_0xdeacf2[_0x68ef('0x4a')]['id']}},_0x576767={};_0x576767['model']=_[_0x68ef('0x33')](db[_0x68ef('0x42')][_0x68ef('0x4b')]);_0x576767[_0x68ef('0x34')]=_['keys'](_0xdeacf2[_0x68ef('0x34')]);_0x576767['filters']=_[_0x68ef('0x35')](_0x576767['model'],_0x576767[_0x68ef('0x34')]);_0xcac58f[_0x68ef('0x36')]=_[_0x68ef('0x35')](_0x576767['model'],qs['fields'](_0xdeacf2[_0x68ef('0x34')][_0x68ef('0x4c')]));_0xcac58f['attributes']=_0xcac58f['attributes']['length']?_0xcac58f[_0x68ef('0x36')]:_0x576767[_0x68ef('0x32')];if(_0xdeacf2[_0x68ef('0x34')][_0x68ef('0x44')]){_0xcac58f[_0x68ef('0x45')]=[{'all':!![]}];}_0xcac58f=_['merge']({},_0xcac58f,_0xdeacf2['options']);return db[_0x68ef('0x42')][_0x68ef('0x4d')](_0xcac58f)[_0x68ef('0x27')](handleEntityNotFound(_0x183377,null))[_0x68ef('0x27')](respondWithResult(_0x183377,null))['catch'](handleError(_0x183377,null));};exports[_0x68ef('0x4e')]=function(_0x474e5a,_0x1c9b6f){return db[_0x68ef('0x42')]['create'](_0x474e5a['body'],{})[_0x68ef('0x27')](function(_0x3c3074){var _0x566e7c=_0x474e5a[_0x68ef('0x4f')][_0x68ef('0x29')]({'plain':!![]});if(!_0x566e7c)throw new Error(_0x68ef('0x50'));if(_0x566e7c[_0x68ef('0x51')]===_0x68ef('0x4f')){var _0x4f0f77=_0x3c3074[_0x68ef('0x29')]({'plain':!![]});var _0x3984ca=_0x68ef('0x52');return db['UserProfileSection'][_0x68ef('0x4d')]({'where':{'name':_0x3984ca,'userProfileId':_0x566e7c[_0x68ef('0x53')]},'raw':!![]})[_0x68ef('0x27')](function(_0x50ef1f){if(_0x50ef1f&&_0x50ef1f[_0x68ef('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x4f0f77[_0x68ef('0x2d')],'resourceId':_0x4f0f77['id'],'type':_0x50ef1f['name'],'sectionId':_0x50ef1f['id']},{})[_0x68ef('0x27')](function(){return _0x3c3074;});}else{return _0x3c3074;}})[_0x68ef('0x48')](function(_0x53ebd){logger[_0x68ef('0x2b')](_0x68ef('0x55'),_0x53ebd);throw _0x53ebd;});}return _0x3c3074;})[_0x68ef('0x27')](respondWithResult(_0x1c9b6f,0xc9))[_0x68ef('0x48')](handleError(_0x1c9b6f,null));};exports[_0x68ef('0x56')]=function(_0x2b35f4,_0x247915){if(_0x2b35f4['body']['id']){delete _0x2b35f4['body']['id'];}return db[_0x68ef('0x42')][_0x68ef('0x4d')]({'where':{'id':_0x2b35f4[_0x68ef('0x4a')]['id']}})[_0x68ef('0x27')](handleEntityNotFound(_0x247915,null))[_0x68ef('0x27')](saveUpdates(_0x2b35f4[_0x68ef('0x57')],null))[_0x68ef('0x27')](respondWithResult(_0x247915,null))[_0x68ef('0x48')](handleError(_0x247915,null));};exports[_0x68ef('0x28')]=function(_0x4c2e9c,_0x5685bb){return db[_0x68ef('0x42')]['find']({'where':{'id':_0x4c2e9c[_0x68ef('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5685bb,null))[_0x68ef('0x27')](removeEntity(_0x5685bb,null))[_0x68ef('0x48')](handleError(_0x5685bb,null));};
\ No newline at end of file
index 0dd4a20..eb07b37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbcba=['util','api','moment','bluebird','request-promise','path','rimraf','exports','AnalyticMetric','analytics_metrics','lodash'];(function(_0x5b0c7d,_0x4ad3e2){var _0x42aab8=function(_0x5dce29){while(--_0x5dce29){_0x5b0c7d['push'](_0x5b0c7d['shift']());}};_0x42aab8(++_0x4ad3e2);}(_0xbcba,0x6d));var _0xabcb=function(_0x331f71,_0x5a0cf8){_0x331f71=_0x331f71-0x0;var _0x43e0f5=_0xbcba[_0x331f71];return _0x43e0f5;};'use strict';var _=require(_0xabcb('0x0'));var util=require(_0xabcb('0x1'));var logger=require('../../config/logger')(_0xabcb('0x2'));var moment=require(_0xabcb('0x3'));var BPromise=require(_0xabcb('0x4'));var rp=require(_0xabcb('0x5'));var fs=require('fs');var path=require(_0xabcb('0x6'));var rimraf=require(_0xabcb('0x7'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0xabcb('0x8')]=function(_0x1290b2,_0x5c706e){return _0x1290b2['define'](_0xabcb('0x9'),attributes,{'tableName':_0xabcb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc949=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','./analyticMetric.attributes','exports','AnalyticMetric','analytics_metrics'];(function(_0x108b48,_0x831aa4){var _0x50cb8a=function(_0x50facc){while(--_0x50facc){_0x108b48['push'](_0x108b48['shift']());}};_0x50cb8a(++_0x831aa4);}(_0xc949,0x181));var _0x9c94=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xc949[_0x4ea69d];return _0x5318e0;};'use strict';var _=require(_0x9c94('0x0'));var util=require('util');var logger=require(_0x9c94('0x1'))(_0x9c94('0x2'));var moment=require(_0x9c94('0x3'));var BPromise=require(_0x9c94('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c94('0x5'));var rimraf=require(_0x9c94('0x6'));var config=require('../../config/environment');var attributes=require(_0x9c94('0x7'));module[_0x9c94('0x8')]=function(_0x46d560,_0x1357ac){return _0x46d560['define'](_0x9c94('0x9'),attributes,{'tableName':_0x9c94('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index aa588b7..daf9808 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e24=['code','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x568363,_0x2e79a7){var _0x47f0ed=function(_0x7d922b){while(--_0x7d922b){_0x568363['push'](_0x568363['shift']());}};_0x47f0ed(++_0x2e79a7);}(_0x5e24,0x1bd));var _0x45e2=function(_0x47fc6c,_0x2455ce){_0x47fc6c=_0x47fc6c-0x0;var _0x1ec6e6=_0x5e24[_0x47fc6c];return _0x1ec6e6;};'use strict';var _=require(_0x45e2('0x0'));var util=require('util');var moment=require(_0x45e2('0x1'));var BPromise=require(_0x45e2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x45e2('0x3'));var db=require(_0x45e2('0x4'))['db'];var utils=require(_0x45e2('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x45e2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x45e2('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16fa93,_0x4d63a5,_0x3873da){return new BPromise(function(_0x143f14,_0x3cf3f8){return client['request'](_0x16fa93,_0x3873da)['then'](function(_0x10ea43){logger[_0x45e2('0x8')](_0x45e2('0x9'),_0x4d63a5,_0x45e2('0xa'));logger[_0x45e2('0xb')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x4d63a5,_0x45e2('0xa'),JSON[_0x45e2('0xc')](_0x10ea43));if(_0x10ea43[_0x45e2('0xd')]){if(_0x10ea43[_0x45e2('0xd')][_0x45e2('0xe')]===0x1f4){logger[_0x45e2('0xd')](_0x45e2('0x9'),_0x4d63a5,_0x10ea43['error'][_0x45e2('0xf')]);return _0x3cf3f8(_0x10ea43[_0x45e2('0xd')][_0x45e2('0xf')]);}logger[_0x45e2('0xd')](_0x45e2('0x9'),_0x4d63a5,_0x10ea43['error'][_0x45e2('0xf')]);return _0x143f14(_0x10ea43['error'][_0x45e2('0xf')]);}else{logger[_0x45e2('0x8')]('AnalyticMetric,\x20%s,\x20%s',_0x4d63a5,_0x45e2('0xa'));_0x143f14(_0x10ea43['result'][_0x45e2('0xf')]);}})[_0x45e2('0x10')](function(_0x1109c3){logger['error'](_0x45e2('0x9'),_0x4d63a5,_0x1109c3);_0x3cf3f8(_0x1109c3);});});}
\ No newline at end of file
+var _0x5124=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x51986b,_0x264a62){var _0x290fec=function(_0x4ebeed){while(--_0x4ebeed){_0x51986b['push'](_0x51986b['shift']());}};_0x290fec(++_0x264a62);}(_0x5124,0x19e));var _0x4512=function(_0x1bb949,_0x440e54){_0x1bb949=_0x1bb949-0x0;var _0x2fee3f=_0x5124[_0x1bb949];return _0x2fee3f;};'use strict';var _=require(_0x4512('0x0'));var util=require(_0x4512('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4512('0x2'));var fs=require('fs');var Redis=require(_0x4512('0x3'));var db=require(_0x4512('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4512('0x5'))(_0x4512('0x6'));var config=require(_0x4512('0x7'));var jayson=require(_0x4512('0x8'));var client=jayson[_0x4512('0x9')][_0x4512('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51bed9,_0x524eaa,_0x431ce2){return new BPromise(function(_0x5641e0,_0x2ea6f1){return client[_0x4512('0xb')](_0x51bed9,_0x431ce2)[_0x4512('0xc')](function(_0x3eb169){logger[_0x4512('0xd')](_0x4512('0xe'),_0x524eaa,_0x4512('0xf'));logger[_0x4512('0x10')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x524eaa,'request\x20sent',JSON[_0x4512('0x11')](_0x3eb169));if(_0x3eb169[_0x4512('0x12')]){if(_0x3eb169['error'][_0x4512('0x13')]===0x1f4){logger[_0x4512('0x12')](_0x4512('0xe'),_0x524eaa,_0x3eb169[_0x4512('0x12')][_0x4512('0x14')]);return _0x2ea6f1(_0x3eb169['error'][_0x4512('0x14')]);}logger['error'](_0x4512('0xe'),_0x524eaa,_0x3eb169['error'][_0x4512('0x14')]);return _0x5641e0(_0x3eb169[_0x4512('0x12')][_0x4512('0x14')]);}else{logger[_0x4512('0xd')](_0x4512('0xe'),_0x524eaa,'request\x20sent');_0x5641e0(_0x3eb169[_0x4512('0x15')][_0x4512('0x14')]);}})[_0x4512('0x16')](function(_0x1adac6){logger[_0x4512('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x524eaa,_0x1adac6);_0x2ea6f1(_0x1adac6);});});}
\ No newline at end of file
index b324b1d..f57eef0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34aa=['index','/:id','show','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated'];(function(_0x402b19,_0x224241){var _0x13da47=function(_0x34cb5b){while(--_0x34cb5b){_0x402b19['push'](_0x402b19['shift']());}};_0x13da47(++_0x224241);}(_0x34aa,0x171));var _0xa34a=function(_0xa45395,_0x5579e6){_0xa45395=_0xa45395-0x0;var _0x3c83d2=_0x34aa[_0xa45395];return _0x3c83d2;};'use strict';var multer=require(_0xa34a('0x0'));var util=require('util');var path=require(_0xa34a('0x1'));var timeout=require(_0xa34a('0x2'));var express=require(_0xa34a('0x3'));var router=express[_0xa34a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa34a('0x5'));var interaction=require(_0xa34a('0x6'));var config=require(_0xa34a('0x7'));var controller=require(_0xa34a('0x8'));router[_0xa34a('0x9')]('/',auth[_0xa34a('0xa')](),controller[_0xa34a('0xb')]);router[_0xa34a('0x9')](_0xa34a('0xc'),auth[_0xa34a('0xa')](),controller[_0xa34a('0xd')]);router['post']('/',auth[_0xa34a('0xa')](),controller[_0xa34a('0xe')]);router[_0xa34a('0xf')](_0xa34a('0xc'),auth[_0xa34a('0xa')](),controller['update']);router[_0xa34a('0x10')](_0xa34a('0xc'),auth[_0xa34a('0xa')](),controller[_0xa34a('0x11')]);module[_0xa34a('0x12')]=router;
\ No newline at end of file
+var _0x85d0=['../../components/interaction/service','../../config/environment','get','index','/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','express','Router','fs-extra','../../components/auth/service'];(function(_0x4624d7,_0x3240a9){var _0x47c4a6=function(_0x77cd61){while(--_0x77cd61){_0x4624d7['push'](_0x4624d7['shift']());}};_0x47c4a6(++_0x3240a9);}(_0x85d0,0x164));var _0x085d=function(_0x31d211,_0x1228b6){_0x31d211=_0x31d211-0x0;var _0x51d5d3=_0x85d0[_0x31d211];return _0x51d5d3;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x085d('0x0'));var router=express[_0x085d('0x1')]();var fs_extra=require(_0x085d('0x2'));var auth=require(_0x085d('0x3'));var interaction=require(_0x085d('0x4'));var config=require(_0x085d('0x5'));var controller=require('./analyticMetric.controller');router[_0x085d('0x6')]('/',auth['isAuthenticated'](),controller[_0x085d('0x7')]);router[_0x085d('0x6')](_0x085d('0x8'),auth['isAuthenticated'](),controller[_0x085d('0x9')]);router[_0x085d('0xa')]('/',auth[_0x085d('0xb')](),controller[_0x085d('0xc')]);router[_0x085d('0xd')](_0x085d('0x8'),auth[_0x085d('0xb')](),controller[_0x085d('0xe')]);router[_0x085d('0xf')]('/:id',auth[_0x085d('0xb')](),controller[_0x085d('0x10')]);module[_0x085d('0x11')]=router;
\ No newline at end of file
index f65b0da..5a23cf0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8cd9=['sequelize','exports','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8cd9,0x186));var _0x98cd=function(_0x4daadc,_0x52e09b){_0x4daadc=_0x4daadc-0x0;var _0x191b4d=_0x8cd9[_0x4daadc];return _0x191b4d;};'use strict';var Sequelize=require(_0x98cd('0x0'));module[_0x98cd('0x1')]={'tree':{'type':Sequelize[_0x98cd('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x79b6=['TEXT','sequelize'];(function(_0x4e39ad,_0x5516de){var _0x127035=function(_0x5a95db){while(--_0x5a95db){_0x4e39ad['push'](_0x4e39ad['shift']());}};_0x127035(++_0x5516de);}(_0x79b6,0x103));var _0x679b=function(_0x2a3d48,_0x5202fe){_0x2a3d48=_0x2a3d48-0x0;var _0xfc12=_0x79b6[_0x2a3d48];return _0xfc12;};'use strict';var Sequelize=require(_0x679b('0x0'));module['exports']={'tree':{'type':Sequelize[_0x679b('0x1')],'allowNull':![]}};
\ No newline at end of file
index 84700f1..a1d8cc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8bc4=['crypto','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','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','AnalyticTreeReport','fieldName','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x1e9612,_0x5ce781){var _0x3f5f24=function(_0x1de34d){while(--_0x1de34d){_0x1e9612['push'](_0x1e9612['shift']());}};_0x3f5f24(++_0x5ce781);}(_0x8bc4,0xd7));var _0x48bc=function(_0x48791f,_0x1f44eb){_0x48791f=_0x48791f-0x0;var _0x249d1c=_0x8bc4[_0x48791f];return _0x249d1c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x48bc('0x0'));var zipdir=require(_0x48bc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x48bc('0x2'));var moment=require(_0x48bc('0x3'));var BPromise=require(_0x48bc('0x4'));var Mustache=require(_0x48bc('0x5'));var util=require('util');var path=require(_0x48bc('0x6'));var sox=require(_0x48bc('0x7'));var csv=require(_0x48bc('0x8'));var ejs=require(_0x48bc('0x9'));var fs=require('fs');var fs_extra=require(_0x48bc('0xa'));var _=require(_0x48bc('0xb'));var squel=require(_0x48bc('0xc'));var crypto=require(_0x48bc('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x48bc('0x8'));var querystring=require(_0x48bc('0xe'));var Papa=require('papaparse');var Redis=require(_0x48bc('0xf'));var authService=require(_0x48bc('0x10'));var qs=require(_0x48bc('0x11'));var as=require(_0x48bc('0x12'));var hardwareService=require(_0x48bc('0x13'));var logger=require(_0x48bc('0x14'))(_0x48bc('0x15'));var utils=require(_0x48bc('0x16'));var config=require(_0x48bc('0x17'));var licenseUtil=require(_0x48bc('0x18'));var db=require(_0x48bc('0x19'))['db'];function respondWithStatusCode(_0x327b90,_0xf7e5f){_0xf7e5f=_0xf7e5f||0xcc;return function(_0x53170e){if(_0x53170e){return _0x327b90[_0x48bc('0x1a')](_0xf7e5f);}return _0x327b90[_0x48bc('0x1b')](_0xf7e5f)[_0x48bc('0x1c')]();};}function respondWithResult(_0x3bec05,_0x11b2a6){_0x11b2a6=_0x11b2a6||0xc8;return function(_0x8ca33b){if(_0x8ca33b){return _0x3bec05['status'](_0x11b2a6)[_0x48bc('0x1d')](_0x8ca33b);}};}function respondWithFilteredResult(_0xca3e1e,_0x59f4f0){return function(_0x38eae7){if(_0x38eae7){var _0x52bcc3=typeof _0x59f4f0['offset']==='undefined'&&typeof _0x59f4f0[_0x48bc('0x1e')]===_0x48bc('0x1f');var _0x2aefb1=_0x38eae7[_0x48bc('0x20')];var _0x2a106b=_0x52bcc3?0x0:_0x59f4f0['offset'];var _0x2cd87a=_0x52bcc3?_0x38eae7[_0x48bc('0x20')]:_0x59f4f0[_0x48bc('0x21')]+_0x59f4f0['limit'];var _0x2366cd;if(_0x2cd87a>=_0x2aefb1){_0x2cd87a=_0x2aefb1;_0x2366cd=0xc8;}else{_0x2366cd=0xce;}_0xca3e1e['status'](_0x2366cd);return _0xca3e1e[_0x48bc('0x22')](_0x48bc('0x23'),_0x2a106b+'-'+_0x2cd87a+'/'+_0x2aefb1)[_0x48bc('0x1d')](_0x38eae7);}return null;};}function patchUpdates(_0x509ebb){return function(_0x303b05){try{jsonpatch[_0x48bc('0x24')](_0x303b05,_0x509ebb,!![]);}catch(_0x5b5e07){return BPromise[_0x48bc('0x25')](_0x5b5e07);}return _0x303b05[_0x48bc('0x26')]();};}function saveUpdates(_0x28d91f,_0x4b566e){return function(_0x1cc73c){if(_0x1cc73c){return _0x1cc73c[_0x48bc('0x27')](_0x28d91f)[_0x48bc('0x28')](function(_0x4a5d81){return _0x4a5d81;});}return null;};}function removeEntity(_0x536a06,_0x4d31b9){return function(_0x93572f){if(_0x93572f){return _0x93572f[_0x48bc('0x29')]()['then'](function(){_0x536a06['status'](0xcc)[_0x48bc('0x1c')]();});}};}function handleEntityNotFound(_0x538971,_0x490264){return function(_0x392950){if(!_0x392950){_0x538971[_0x48bc('0x1a')](0x194);}return _0x392950;};}function handleError(_0x57ec83,_0x4a53ed){_0x4a53ed=_0x4a53ed||0x1f4;return function(_0x4c0cbf){logger[_0x48bc('0x2a')](_0x4c0cbf['stack']);if(_0x4c0cbf[_0x48bc('0x2b')]){delete _0x4c0cbf[_0x48bc('0x2b')];}_0x57ec83['status'](_0x4a53ed)['send'](_0x4c0cbf);};}exports[_0x48bc('0x2c')]=function(_0x5df323,_0x5e923b){var _0x52beb5={},_0x299945={},_0x38cdca={'count':0x0,'rows':[]};var _0x1d695e=_[_0x48bc('0x2d')](db[_0x48bc('0x2e')]['rawAttributes'],function(_0x1473e9){return{'name':_0x1473e9[_0x48bc('0x2f')],'type':_0x1473e9['type']['key']};});_0x299945['model']=_['map'](_0x1d695e,_0x48bc('0x2b'));_0x299945[_0x48bc('0x30')]=_[_0x48bc('0x31')](_0x5df323['query']);_0x299945[_0x48bc('0x32')]=_[_0x48bc('0x33')](_0x299945['model'],_0x299945[_0x48bc('0x30')]);_0x52beb5[_0x48bc('0x34')]=_[_0x48bc('0x33')](_0x299945[_0x48bc('0x35')],qs[_0x48bc('0x36')](_0x5df323[_0x48bc('0x30')]['fields']));_0x52beb5[_0x48bc('0x34')]=_0x52beb5[_0x48bc('0x34')][_0x48bc('0x37')]?_0x52beb5[_0x48bc('0x34')]:_0x299945[_0x48bc('0x35')];if(!_0x5df323[_0x48bc('0x30')][_0x48bc('0x38')](_0x48bc('0x39'))){_0x52beb5['limit']=qs[_0x48bc('0x1e')](_0x5df323['query'][_0x48bc('0x1e')]);_0x52beb5[_0x48bc('0x21')]=qs['offset'](_0x5df323['query'][_0x48bc('0x21')]);}_0x52beb5[_0x48bc('0x3a')]=qs[_0x48bc('0x3b')](_0x5df323[_0x48bc('0x30')][_0x48bc('0x3b')]);_0x52beb5[_0x48bc('0x3c')]=qs[_0x48bc('0x32')](_['pick'](_0x5df323[_0x48bc('0x30')],_0x299945[_0x48bc('0x32')]),_0x1d695e);if(_0x5df323[_0x48bc('0x30')]['filter']){_0x52beb5[_0x48bc('0x3c')]=_[_0x48bc('0x3d')](_0x52beb5[_0x48bc('0x3c')],{'$or':_[_0x48bc('0x2d')](_0x1d695e,function(_0x2590cf){if(_0x2590cf['type']!==_0x48bc('0x3e')){var _0x5e73bb={};_0x5e73bb[_0x2590cf[_0x48bc('0x2b')]]={'$like':'%'+_0x5df323[_0x48bc('0x30')][_0x48bc('0x3f')]+'%'};return _0x5e73bb;}})});}_0x52beb5=_[_0x48bc('0x3d')]({},_0x52beb5,_0x5df323[_0x48bc('0x40')]);var _0x28aa49={'where':_0x52beb5[_0x48bc('0x3c')]};return db[_0x48bc('0x2e')][_0x48bc('0x20')](_0x28aa49)[_0x48bc('0x28')](function(_0x48b7cc){_0x38cdca[_0x48bc('0x20')]=_0x48b7cc;if(_0x5df323['query'][_0x48bc('0x41')]){_0x52beb5[_0x48bc('0x42')]=[{'all':!![]}];}return db[_0x48bc('0x2e')][_0x48bc('0x43')](_0x52beb5);})['then'](function(_0x35f2fa){_0x38cdca[_0x48bc('0x44')]=_0x35f2fa;return _0x38cdca;})[_0x48bc('0x28')](respondWithFilteredResult(_0x5e923b,_0x52beb5))[_0x48bc('0x45')](handleError(_0x5e923b,null));};exports[_0x48bc('0x46')]=function(_0x2131a2,_0x47df06){var _0x28fde1={'raw':!![],'where':{'id':_0x2131a2[_0x48bc('0x47')]['id']}},_0x43a9b0={};_0x43a9b0['model']=_[_0x48bc('0x31')](db[_0x48bc('0x2e')][_0x48bc('0x48')]);_0x43a9b0[_0x48bc('0x30')]=_['keys'](_0x2131a2['query']);_0x43a9b0[_0x48bc('0x32')]=_[_0x48bc('0x33')](_0x43a9b0[_0x48bc('0x35')],_0x43a9b0[_0x48bc('0x30')]);_0x28fde1['attributes']=_['intersection'](_0x43a9b0[_0x48bc('0x35')],qs['fields'](_0x2131a2[_0x48bc('0x30')][_0x48bc('0x36')]));_0x28fde1['attributes']=_0x28fde1[_0x48bc('0x34')][_0x48bc('0x37')]?_0x28fde1[_0x48bc('0x34')]:_0x43a9b0[_0x48bc('0x35')];if(_0x2131a2[_0x48bc('0x30')][_0x48bc('0x41')]){_0x28fde1[_0x48bc('0x42')]=[{'all':!![]}];}_0x28fde1=_[_0x48bc('0x3d')]({},_0x28fde1,_0x2131a2[_0x48bc('0x40')]);return db[_0x48bc('0x2e')][_0x48bc('0x49')](_0x28fde1)[_0x48bc('0x28')](handleEntityNotFound(_0x47df06,null))[_0x48bc('0x28')](respondWithResult(_0x47df06,null))[_0x48bc('0x45')](handleError(_0x47df06,null));};exports['create']=function(_0x43f5d0,_0x53738e){return db[_0x48bc('0x2e')][_0x48bc('0x4a')](_0x43f5d0[_0x48bc('0x4b')],{})[_0x48bc('0x28')](respondWithResult(_0x53738e,0xc9))[_0x48bc('0x45')](handleError(_0x53738e,null));};exports['update']=function(_0x30cf66,_0x14fb93){if(_0x30cf66[_0x48bc('0x4b')]['id']){delete _0x30cf66[_0x48bc('0x4b')]['id'];}return db[_0x48bc('0x2e')][_0x48bc('0x49')]({'where':{'id':_0x30cf66['params']['id']}})[_0x48bc('0x28')](handleEntityNotFound(_0x14fb93,null))[_0x48bc('0x28')](saveUpdates(_0x30cf66['body'],null))[_0x48bc('0x28')](respondWithResult(_0x14fb93,null))[_0x48bc('0x45')](handleError(_0x14fb93,null));};exports['destroy']=function(_0x28f793,_0xd1352){return db['AnalyticTreeReport'][_0x48bc('0x49')]({'where':{'id':_0x28f793[_0x48bc('0x47')]['id']}})['then'](handleEntityNotFound(_0xd1352,null))[_0x48bc('0x28')](removeEntity(_0xd1352,null))['catch'](handleError(_0xd1352,null));};
\ No newline at end of file
+var _0xb2a4=['sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','options','create','body','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','sendStatus','stack','name','send','index','map','AnalyticTreeReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order'];(function(_0xc525c7,_0x75f8b8){var _0x2cf314=function(_0x3c0463){while(--_0x3c0463){_0xc525c7['push'](_0xc525c7['shift']());}};_0x2cf314(++_0x75f8b8);}(_0xb2a4,0x13e));var _0x4b2a=function(_0xae7acf,_0x5913eb){_0xae7acf=_0xae7acf-0x0;var _0x260263=_0xb2a4[_0xae7acf];return _0x260263;};'use strict';var emlformat=require(_0x4b2a('0x0'));var rimraf=require(_0x4b2a('0x1'));var zipdir=require(_0x4b2a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4b2a('0x3'));var moment=require('moment');var BPromise=require(_0x4b2a('0x4'));var Mustache=require('mustache');var util=require(_0x4b2a('0x5'));var path=require(_0x4b2a('0x6'));var sox=require('sox');var csv=require(_0x4b2a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4b2a('0x8'));var _=require('lodash');var squel=require(_0x4b2a('0x9'));var crypto=require(_0x4b2a('0xa'));var jsforce=require(_0x4b2a('0xb'));var deskjs=require(_0x4b2a('0xc'));var toCsv=require(_0x4b2a('0x7'));var querystring=require(_0x4b2a('0xd'));var Papa=require(_0x4b2a('0xe'));var Redis=require(_0x4b2a('0xf'));var authService=require(_0x4b2a('0x10'));var qs=require(_0x4b2a('0x11'));var as=require(_0x4b2a('0x12'));var hardwareService=require(_0x4b2a('0x13'));var logger=require(_0x4b2a('0x14'))('api');var utils=require(_0x4b2a('0x15'));var config=require(_0x4b2a('0x16'));var licenseUtil=require(_0x4b2a('0x17'));var db=require(_0x4b2a('0x18'))['db'];function respondWithStatusCode(_0x2281f2,_0x22dbb5){_0x22dbb5=_0x22dbb5||0xcc;return function(_0x3e555c){if(_0x3e555c){return _0x2281f2['sendStatus'](_0x22dbb5);}return _0x2281f2[_0x4b2a('0x19')](_0x22dbb5)[_0x4b2a('0x1a')]();};}function respondWithResult(_0x55483e,_0x2fde5c){_0x2fde5c=_0x2fde5c||0xc8;return function(_0x2185ea){if(_0x2185ea){return _0x55483e['status'](_0x2fde5c)[_0x4b2a('0x1b')](_0x2185ea);}};}function respondWithFilteredResult(_0x4ac727,_0x5aa4a0){return function(_0x822bdb){if(_0x822bdb){var _0x130610=typeof _0x5aa4a0[_0x4b2a('0x1c')]==='undefined'&&typeof _0x5aa4a0['limit']===_0x4b2a('0x1d');var _0x188d6c=_0x822bdb[_0x4b2a('0x1e')];var _0x1b1a42=_0x130610?0x0:_0x5aa4a0['offset'];var _0x2b0c12=_0x130610?_0x822bdb[_0x4b2a('0x1e')]:_0x5aa4a0['offset']+_0x5aa4a0[_0x4b2a('0x1f')];var _0x55e430;if(_0x2b0c12>=_0x188d6c){_0x2b0c12=_0x188d6c;_0x55e430=0xc8;}else{_0x55e430=0xce;}_0x4ac727['status'](_0x55e430);return _0x4ac727[_0x4b2a('0x20')](_0x4b2a('0x21'),_0x1b1a42+'-'+_0x2b0c12+'/'+_0x188d6c)['json'](_0x822bdb);}return null;};}function patchUpdates(_0x541a83){return function(_0x10986f){try{jsonpatch['apply'](_0x10986f,_0x541a83,!![]);}catch(_0x2baf67){return BPromise[_0x4b2a('0x22')](_0x2baf67);}return _0x10986f[_0x4b2a('0x23')]();};}function saveUpdates(_0x271733,_0x2fff8b){return function(_0x290da8){if(_0x290da8){return _0x290da8[_0x4b2a('0x24')](_0x271733)['then'](function(_0x3009a9){return _0x3009a9;});}return null;};}function removeEntity(_0x257140,_0xa3b344){return function(_0xf2b7f0){if(_0xf2b7f0){return _0xf2b7f0[_0x4b2a('0x25')]()[_0x4b2a('0x26')](function(){_0x257140[_0x4b2a('0x19')](0xcc)[_0x4b2a('0x1a')]();});}};}function handleEntityNotFound(_0x3c3a92,_0x575bed){return function(_0x1a9354){if(!_0x1a9354){_0x3c3a92[_0x4b2a('0x27')](0x194);}return _0x1a9354;};}function handleError(_0x4fe633,_0x1ba199){_0x1ba199=_0x1ba199||0x1f4;return function(_0x2dc68c){logger['error'](_0x2dc68c[_0x4b2a('0x28')]);if(_0x2dc68c[_0x4b2a('0x29')]){delete _0x2dc68c[_0x4b2a('0x29')];}_0x4fe633[_0x4b2a('0x19')](_0x1ba199)[_0x4b2a('0x2a')](_0x2dc68c);};}exports[_0x4b2a('0x2b')]=function(_0x4c908d,_0x561140){var _0x2dcc4f={},_0x4a9c73={},_0x1396ab={'count':0x0,'rows':[]};var _0x10c124=_[_0x4b2a('0x2c')](db[_0x4b2a('0x2d')]['rawAttributes'],function(_0x59b9b2){return{'name':_0x59b9b2[_0x4b2a('0x2e')],'type':_0x59b9b2[_0x4b2a('0x2f')]['key']};});_0x4a9c73[_0x4b2a('0x30')]=_[_0x4b2a('0x2c')](_0x10c124,_0x4b2a('0x29'));_0x4a9c73[_0x4b2a('0x31')]=_[_0x4b2a('0x32')](_0x4c908d[_0x4b2a('0x31')]);_0x4a9c73[_0x4b2a('0x33')]=_[_0x4b2a('0x34')](_0x4a9c73['model'],_0x4a9c73['query']);_0x2dcc4f[_0x4b2a('0x35')]=_['intersection'](_0x4a9c73[_0x4b2a('0x30')],qs[_0x4b2a('0x36')](_0x4c908d[_0x4b2a('0x31')][_0x4b2a('0x36')]));_0x2dcc4f[_0x4b2a('0x35')]=_0x2dcc4f[_0x4b2a('0x35')]['length']?_0x2dcc4f[_0x4b2a('0x35')]:_0x4a9c73['model'];if(!_0x4c908d['query'][_0x4b2a('0x37')]('nolimit')){_0x2dcc4f[_0x4b2a('0x1f')]=qs[_0x4b2a('0x1f')](_0x4c908d['query']['limit']);_0x2dcc4f[_0x4b2a('0x1c')]=qs[_0x4b2a('0x1c')](_0x4c908d[_0x4b2a('0x31')]['offset']);}_0x2dcc4f[_0x4b2a('0x38')]=qs[_0x4b2a('0x39')](_0x4c908d[_0x4b2a('0x31')][_0x4b2a('0x39')]);_0x2dcc4f[_0x4b2a('0x3a')]=qs[_0x4b2a('0x33')](_[_0x4b2a('0x3b')](_0x4c908d[_0x4b2a('0x31')],_0x4a9c73[_0x4b2a('0x33')]),_0x10c124);if(_0x4c908d['query'][_0x4b2a('0x3c')]){_0x2dcc4f[_0x4b2a('0x3a')]=_['merge'](_0x2dcc4f[_0x4b2a('0x3a')],{'$or':_['map'](_0x10c124,function(_0x3add48){if(_0x3add48[_0x4b2a('0x2f')]!==_0x4b2a('0x3d')){var _0xd0f2f1={};_0xd0f2f1[_0x3add48['name']]={'$like':'%'+_0x4c908d[_0x4b2a('0x31')]['filter']+'%'};return _0xd0f2f1;}})});}_0x2dcc4f=_[_0x4b2a('0x3e')]({},_0x2dcc4f,_0x4c908d['options']);var _0x1776da={'where':_0x2dcc4f['where']};return db[_0x4b2a('0x2d')][_0x4b2a('0x1e')](_0x1776da)['then'](function(_0x39e0ff){_0x1396ab[_0x4b2a('0x1e')]=_0x39e0ff;if(_0x4c908d['query'][_0x4b2a('0x3f')]){_0x2dcc4f[_0x4b2a('0x40')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x4b2a('0x41')](_0x2dcc4f);})[_0x4b2a('0x26')](function(_0x2c67c6){_0x1396ab[_0x4b2a('0x42')]=_0x2c67c6;return _0x1396ab;})[_0x4b2a('0x26')](respondWithFilteredResult(_0x561140,_0x2dcc4f))[_0x4b2a('0x43')](handleError(_0x561140,null));};exports[_0x4b2a('0x44')]=function(_0x5ba740,_0x5c9ef8){var _0x3266b5={'raw':!![],'where':{'id':_0x5ba740[_0x4b2a('0x45')]['id']}},_0x5ddfc8={};_0x5ddfc8[_0x4b2a('0x30')]=_[_0x4b2a('0x32')](db[_0x4b2a('0x2d')][_0x4b2a('0x46')]);_0x5ddfc8[_0x4b2a('0x31')]=_[_0x4b2a('0x32')](_0x5ba740['query']);_0x5ddfc8[_0x4b2a('0x33')]=_['intersection'](_0x5ddfc8[_0x4b2a('0x30')],_0x5ddfc8[_0x4b2a('0x31')]);_0x3266b5[_0x4b2a('0x35')]=_[_0x4b2a('0x34')](_0x5ddfc8[_0x4b2a('0x30')],qs[_0x4b2a('0x36')](_0x5ba740['query'][_0x4b2a('0x36')]));_0x3266b5[_0x4b2a('0x35')]=_0x3266b5['attributes'][_0x4b2a('0x47')]?_0x3266b5['attributes']:_0x5ddfc8[_0x4b2a('0x30')];if(_0x5ba740[_0x4b2a('0x31')]['includeAll']){_0x3266b5['include']=[{'all':!![]}];}_0x3266b5=_['merge']({},_0x3266b5,_0x5ba740[_0x4b2a('0x48')]);return db[_0x4b2a('0x2d')]['find'](_0x3266b5)[_0x4b2a('0x26')](handleEntityNotFound(_0x5c9ef8,null))[_0x4b2a('0x26')](respondWithResult(_0x5c9ef8,null))['catch'](handleError(_0x5c9ef8,null));};exports[_0x4b2a('0x49')]=function(_0x22c2a9,_0x504fcf){return db[_0x4b2a('0x2d')]['create'](_0x22c2a9[_0x4b2a('0x4a')],{})['then'](respondWithResult(_0x504fcf,0xc9))['catch'](handleError(_0x504fcf,null));};exports[_0x4b2a('0x24')]=function(_0x16714f,_0x3c9d79){if(_0x16714f[_0x4b2a('0x4a')]['id']){delete _0x16714f['body']['id'];}return db[_0x4b2a('0x2d')]['find']({'where':{'id':_0x16714f[_0x4b2a('0x45')]['id']}})[_0x4b2a('0x26')](handleEntityNotFound(_0x3c9d79,null))[_0x4b2a('0x26')](saveUpdates(_0x16714f['body'],null))[_0x4b2a('0x26')](respondWithResult(_0x3c9d79,null))[_0x4b2a('0x43')](handleError(_0x3c9d79,null));};exports[_0x4b2a('0x25')]=function(_0x1105f0,_0x57175b){return db[_0x4b2a('0x2d')]['find']({'where':{'id':_0x1105f0[_0x4b2a('0x45')]['id']}})['then'](handleEntityNotFound(_0x57175b,null))[_0x4b2a('0x26')](removeEntity(_0x57175b,null))[_0x4b2a('0x43')](handleError(_0x57175b,null));};
\ No newline at end of file
index b853b73..9d98ae5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x858d=['api','moment','path','../../config/environment','exports','define','AnalyticTreeReport','lodash','util','../../config/logger'];(function(_0x382028,_0x37b799){var _0x5ae64c=function(_0x2e1b74){while(--_0x2e1b74){_0x382028['push'](_0x382028['shift']());}};_0x5ae64c(++_0x37b799);}(_0x858d,0x18d));var _0xd858=function(_0x1d50ec,_0x5aef15){_0x1d50ec=_0x1d50ec-0x0;var _0x2e970d=_0x858d[_0x1d50ec];return _0x2e970d;};'use strict';var _=require(_0xd858('0x0'));var util=require(_0xd858('0x1'));var logger=require(_0xd858('0x2'))(_0xd858('0x3'));var moment=require(_0xd858('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd858('0x5'));var rimraf=require('rimraf');var config=require(_0xd858('0x6'));var attributes=require('./analyticTreeReport.attributes');module[_0xd858('0x7')]=function(_0x39c167,_0x138106){return _0x39c167[_0xd858('0x8')](_0xd858('0x9'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7dac=['moment','bluebird','request-promise','path','rimraf','./analyticTreeReport.attributes','define','lodash','util','../../config/logger'];(function(_0x187ff5,_0x5d4344){var _0x2f1541=function(_0x28b74b){while(--_0x28b74b){_0x187ff5['push'](_0x187ff5['shift']());}};_0x2f1541(++_0x5d4344);}(_0x7dac,0x197));var _0xc7da=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x7dac[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xc7da('0x0'));var util=require(_0xc7da('0x1'));var logger=require(_0xc7da('0x2'))('api');var moment=require(_0xc7da('0x3'));var BPromise=require(_0xc7da('0x4'));var rp=require(_0xc7da('0x5'));var fs=require('fs');var path=require(_0xc7da('0x6'));var rimraf=require(_0xc7da('0x7'));var config=require('../../config/environment');var attributes=require(_0xc7da('0x8'));module['exports']=function(_0x17f945,_0x32fbdc){return _0x17f945[_0xc7da('0x9')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9ef43b4..f7502cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x29fb63,_0xdd2860){var _0x1c8876=function(_0x4042f5){while(--_0x4042f5){_0x29fb63['push'](_0x29fb63['shift']());}};_0x1c8876(++_0xdd2860);}(_0x1261,0x144));var _0x1126=function(_0x5be8ab,_0x4000a6){_0x5be8ab=_0x5be8ab-0x0;var _0x35914d=_0x1261[_0x5be8ab];return _0x35914d;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x25fe20,_0x5c4098){var _0x5684d0=function(_0x221f80){while(--_0x221f80){_0x25fe20['push'](_0x25fe20['shift']());}};_0x5684d0(++_0x5c4098);}(_0xadb5,0xad));var _0x5adb=function(_0x72620c,_0x6f8efc){_0x72620c=_0x72620c-0x0;var _0x4bbce3=_0xadb5[_0x72620c];return _0x4bbce3;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
index 50d398e..a1d4e1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb421=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','index','isAuthenticated','show','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xb421,0x6e));var _0x1b42=function(_0x6784a1,_0x2792fb){_0x6784a1=_0x6784a1-0x0;var _0x4a629e=_0xb421[_0x6784a1];return _0x4a629e;};'use strict';var multer=require(_0x1b42('0x0'));var util=require(_0x1b42('0x1'));var path=require(_0x1b42('0x2'));var timeout=require(_0x1b42('0x3'));var express=require(_0x1b42('0x4'));var router=express[_0x1b42('0x5')]();var fs_extra=require(_0x1b42('0x6'));var auth=require(_0x1b42('0x7'));var interaction=require(_0x1b42('0x8'));var config=require(_0x1b42('0x9'));var controller=require(_0x1b42('0xa'));router[_0x1b42('0xb')]('/',auth['isAuthenticated'](),controller[_0x1b42('0xc')]);router['get']('/:id',auth[_0x1b42('0xd')](),controller[_0x1b42('0xe')]);router[_0x1b42('0xf')]('/',auth[_0x1b42('0xd')](),controller[_0x1b42('0x10')]);router[_0x1b42('0x11')]('/:id',auth[_0x1b42('0xd')](),controller[_0x1b42('0x12')]);router[_0x1b42('0x13')](_0x1b42('0x14'),auth[_0x1b42('0xd')](),controller[_0x1b42('0x15')]);module[_0x1b42('0x16')]=router;
\ No newline at end of file
+var _0xb175=['destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','create','update','delete'];(function(_0x28208d,_0x341c35){var _0x479c64=function(_0x4f7320){while(--_0x4f7320){_0x28208d['push'](_0x28208d['shift']());}};_0x479c64(++_0x341c35);}(_0xb175,0xce));var _0x5b17=function(_0x4d905a,_0x20e963){_0x4d905a=_0x4d905a-0x0;var _0x13fc18=_0xb175[_0x4d905a];return _0x13fc18;};'use strict';var multer=require(_0x5b17('0x0'));var util=require('util');var path=require(_0x5b17('0x1'));var timeout=require(_0x5b17('0x2'));var express=require('express');var router=express[_0x5b17('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5b17('0x4'));var interaction=require(_0x5b17('0x5'));var config=require(_0x5b17('0x6'));var controller=require(_0x5b17('0x7'));router[_0x5b17('0x8')]('/',auth[_0x5b17('0x9')](),controller[_0x5b17('0xa')]);router['get'](_0x5b17('0xb'),auth[_0x5b17('0x9')](),controller['show']);router['post']('/',auth[_0x5b17('0x9')](),controller[_0x5b17('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x5b17('0xd')]);router[_0x5b17('0xe')](_0x5b17('0xb'),auth[_0x5b17('0x9')](),controller[_0x5b17('0xf')]);module[_0x5b17('0x10')]=router;
\ No newline at end of file
index e6ea23b..51ff96d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6737=['exports','STRING'];(function(_0x513203,_0x53ad55){var _0x5b3c8b=function(_0x275b28){while(--_0x275b28){_0x513203['push'](_0x513203['shift']());}};_0x5b3c8b(++_0x53ad55);}(_0x6737,0xe2));var _0x7673=function(_0x279e17,_0x49f85a){_0x279e17=_0x279e17-0x0;var _0x1f159a=_0x6737[_0x279e17];return _0x1f159a;};'use strict';var Sequelize=require('sequelize');module[_0x7673('0x0')]={'name':{'type':Sequelize[_0x7673('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x7673('0x1')]}};
\ No newline at end of file
+var _0x02ef=['sequelize','STRING'];(function(_0x529632,_0x11f931){var _0x3c6745=function(_0x4023af){while(--_0x4023af){_0x529632['push'](_0x529632['shift']());}};_0x3c6745(++_0x11f931);}(_0x02ef,0x11a));var _0xf02e=function(_0x5bae5f,_0x3dee66){_0x5bae5f=_0x5bae5f-0x0;var _0x1742e1=_0x02ef[_0x5bae5f];return _0x1742e1;};'use strict';var Sequelize=require(_0xf02e('0x0'));module['exports']={'name':{'type':Sequelize[_0xf02e('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf02e('0x1')]}};
\ No newline at end of file
index 7d6b43f..d10249e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d5e=['rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','save','update','destroy','error','name','send','map','Attachment','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','show','params','clone','rawAttributes','find','get','omit','updatedAt','body','createdAt','create','catch','originalname','basename','file','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','eml-format'];(function(_0x416586,_0xbdf0b1){var _0x5cbb10=function(_0x274854){while(--_0x274854){_0x416586['push'](_0x416586['shift']());}};_0x5cbb10(++_0xbdf0b1);}(_0x5d5e,0x104));var _0xe5d5=function(_0x467698,_0x1b7e8f){_0x467698=_0x467698-0x0;var _0x89f21b=_0x5d5e[_0x467698];return _0x89f21b;};'use strict';var emlformat=require(_0xe5d5('0x0'));var rimraf=require(_0xe5d5('0x1'));var zipdir=require(_0xe5d5('0x2'));var jsonpatch=require(_0xe5d5('0x3'));var rp=require('request-promise');var moment=require(_0xe5d5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe5d5('0x5'));var util=require(_0xe5d5('0x6'));var path=require(_0xe5d5('0x7'));var sox=require(_0xe5d5('0x8'));var csv=require(_0xe5d5('0x9'));var ejs=require(_0xe5d5('0xa'));var fs=require('fs');var fs_extra=require(_0xe5d5('0xb'));var _=require(_0xe5d5('0xc'));var squel=require(_0xe5d5('0xd'));var crypto=require(_0xe5d5('0xe'));var jsforce=require(_0xe5d5('0xf'));var deskjs=require(_0xe5d5('0x10'));var toCsv=require('to-csv');var querystring=require(_0xe5d5('0x11'));var Papa=require('papaparse');var Redis=require(_0xe5d5('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe5d5('0x13'));var hardwareService=require(_0xe5d5('0x14'));var logger=require('../../config/logger')(_0xe5d5('0x15'));var utils=require(_0xe5d5('0x16'));var config=require(_0xe5d5('0x17'));var licenseUtil=require(_0xe5d5('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e331d,_0x28cb5d){_0x28cb5d=_0x28cb5d||0xcc;return function(_0x4e1cdf){if(_0x4e1cdf){return _0x4e331d[_0xe5d5('0x19')](_0x28cb5d);}return _0x4e331d[_0xe5d5('0x1a')](_0x28cb5d)[_0xe5d5('0x1b')]();};}function respondWithResult(_0x23df93,_0x248c0f){_0x248c0f=_0x248c0f||0xc8;return function(_0x4ba4fc){if(_0x4ba4fc){return _0x23df93[_0xe5d5('0x1a')](_0x248c0f)[_0xe5d5('0x1c')](_0x4ba4fc);}};}function respondWithFilteredResult(_0xf53458,_0x278411){return function(_0xf5b6bd){if(_0xf5b6bd){var _0x3f4491=typeof _0x278411['offset']===_0xe5d5('0x1d')&&typeof _0x278411['limit']==='undefined';var _0x583a9e=_0xf5b6bd[_0xe5d5('0x1e')];var _0x5bab59=_0x3f4491?0x0:_0x278411[_0xe5d5('0x1f')];var _0xf33c37=_0x3f4491?_0xf5b6bd[_0xe5d5('0x1e')]:_0x278411[_0xe5d5('0x1f')]+_0x278411['limit'];var _0x1d07ab;if(_0xf33c37>=_0x583a9e){_0xf33c37=_0x583a9e;_0x1d07ab=0xc8;}else{_0x1d07ab=0xce;}_0xf53458[_0xe5d5('0x1a')](_0x1d07ab);return _0xf53458[_0xe5d5('0x20')](_0xe5d5('0x21'),_0x5bab59+'-'+_0xf33c37+'/'+_0x583a9e)[_0xe5d5('0x1c')](_0xf5b6bd);}return null;};}function patchUpdates(_0x36dc84){return function(_0x287199){try{jsonpatch['apply'](_0x287199,_0x36dc84,!![]);}catch(_0x5555af){return BPromise['reject'](_0x5555af);}return _0x287199[_0xe5d5('0x22')]();};}function saveUpdates(_0x39be17,_0x1dae40){return function(_0x44dbb9){if(_0x44dbb9){return _0x44dbb9[_0xe5d5('0x23')](_0x39be17)['then'](function(_0x25a906){return _0x25a906;});}return null;};}function removeEntity(_0x55d44f,_0x3f3ec7){return function(_0x1b989e){if(_0x1b989e){return _0x1b989e[_0xe5d5('0x24')]()['then'](function(){_0x55d44f[_0xe5d5('0x1a')](0xcc)[_0xe5d5('0x1b')]();});}};}function handleEntityNotFound(_0x485508,_0x42b7d1){return function(_0x3aaf1b){if(!_0x3aaf1b){_0x485508[_0xe5d5('0x19')](0x194);}return _0x3aaf1b;};}function handleError(_0x8d6fa4,_0x81aab0){_0x81aab0=_0x81aab0||0x1f4;return function(_0x1e0f8f){logger[_0xe5d5('0x25')](_0x1e0f8f['stack']);if(_0x1e0f8f[_0xe5d5('0x26')]){delete _0x1e0f8f[_0xe5d5('0x26')];}_0x8d6fa4[_0xe5d5('0x1a')](_0x81aab0)[_0xe5d5('0x27')](_0x1e0f8f);};}exports['index']=function(_0x570333,_0x11b622){var _0x3b0cb9={},_0x3af9c9={},_0x2b384a={'count':0x0,'rows':[]};var _0x55b978=_[_0xe5d5('0x28')](db[_0xe5d5('0x29')]['rawAttributes'],function(_0xc6830f){return{'name':_0xc6830f[_0xe5d5('0x2a')],'type':_0xc6830f[_0xe5d5('0x2b')][_0xe5d5('0x2c')]};});_0x3af9c9['model']=_[_0xe5d5('0x28')](_0x55b978,_0xe5d5('0x26'));_0x3af9c9['query']=_[_0xe5d5('0x2d')](_0x570333[_0xe5d5('0x2e')]);_0x3af9c9[_0xe5d5('0x2f')]=_[_0xe5d5('0x30')](_0x3af9c9[_0xe5d5('0x31')],_0x3af9c9[_0xe5d5('0x2e')]);_0x3b0cb9[_0xe5d5('0x32')]=_[_0xe5d5('0x30')](_0x3af9c9[_0xe5d5('0x31')],qs[_0xe5d5('0x33')](_0x570333[_0xe5d5('0x2e')][_0xe5d5('0x33')]));_0x3b0cb9['attributes']=_0x3b0cb9[_0xe5d5('0x32')]['length']?_0x3b0cb9[_0xe5d5('0x32')]:_0x3af9c9['model'];if(!_0x570333['query'][_0xe5d5('0x34')](_0xe5d5('0x35'))){_0x3b0cb9['limit']=qs[_0xe5d5('0x36')](_0x570333['query']['limit']);_0x3b0cb9[_0xe5d5('0x1f')]=qs[_0xe5d5('0x1f')](_0x570333[_0xe5d5('0x2e')][_0xe5d5('0x1f')]);}_0x3b0cb9[_0xe5d5('0x37')]=qs[_0xe5d5('0x38')](_0x570333[_0xe5d5('0x2e')][_0xe5d5('0x38')]);_0x3b0cb9[_0xe5d5('0x39')]=qs['filters'](_['pick'](_0x570333[_0xe5d5('0x2e')],_0x3af9c9[_0xe5d5('0x2f')]),_0x55b978);if(_0x570333['query']['filter']){_0x3b0cb9[_0xe5d5('0x39')]=_[_0xe5d5('0x3a')](_0x3b0cb9[_0xe5d5('0x39')],{'$or':_[_0xe5d5('0x28')](_0x55b978,function(_0x465043){if(_0x465043[_0xe5d5('0x2b')]!==_0xe5d5('0x3b')){var _0x108990={};_0x108990[_0x465043['name']]={'$like':'%'+_0x570333[_0xe5d5('0x2e')]['filter']+'%'};return _0x108990;}})});}_0x3b0cb9=_[_0xe5d5('0x3a')]({},_0x3b0cb9,_0x570333[_0xe5d5('0x3c')]);var _0x421940={'where':_0x3b0cb9['where']};return db[_0xe5d5('0x29')][_0xe5d5('0x1e')](_0x421940)[_0xe5d5('0x3d')](function(_0x556c15){_0x2b384a['count']=_0x556c15;if(_0x570333[_0xe5d5('0x2e')][_0xe5d5('0x3e')]){_0x3b0cb9[_0xe5d5('0x3f')]=[{'all':!![]}];}return db[_0xe5d5('0x29')][_0xe5d5('0x40')](_0x3b0cb9);})[_0xe5d5('0x3d')](function(_0x24dd19){_0x2b384a[_0xe5d5('0x41')]=_0x24dd19;return _0x2b384a;})[_0xe5d5('0x3d')](respondWithFilteredResult(_0x11b622,_0x3b0cb9))['catch'](handleError(_0x11b622,null));};exports[_0xe5d5('0x42')]=function(_0x20a46d,_0x22fe09){var _0x2db585={'raw':!![],'where':{'id':_0x20a46d[_0xe5d5('0x43')]['id']}},_0x3a32a2={};_0x3a32a2[_0xe5d5('0x31')]=_['keys'](db[_0xe5d5('0x29')]['rawAttributes']);_0x3a32a2[_0xe5d5('0x2e')]=_['keys'](_0x20a46d[_0xe5d5('0x2e')]);_0x3a32a2[_0xe5d5('0x2f')]=_[_0xe5d5('0x30')](_0x3a32a2[_0xe5d5('0x31')],_0x3a32a2['query']);_0x2db585[_0xe5d5('0x32')]=_[_0xe5d5('0x30')](_0x3a32a2[_0xe5d5('0x31')],qs[_0xe5d5('0x33')](_0x20a46d[_0xe5d5('0x2e')]['fields']));_0x2db585['attributes']=_0x2db585['attributes']['length']?_0x2db585['attributes']:_0x3a32a2[_0xe5d5('0x31')];if(_0x20a46d['query'][_0xe5d5('0x3e')]){_0x2db585[_0xe5d5('0x3f')]=[{'all':!![]}];}_0x2db585=_['merge']({},_0x2db585,_0x20a46d[_0xe5d5('0x3c')]);return db[_0xe5d5('0x29')]['find'](_0x2db585)[_0xe5d5('0x3d')](handleEntityNotFound(_0x22fe09,null))[_0xe5d5('0x3d')](respondWithResult(_0x22fe09,null))['catch'](handleError(_0x22fe09,null));};exports[_0xe5d5('0x44')]=function(_0x4672e9,_0x2087c2){var _0x3ecdc9={'where':{'id':_0x4672e9[_0xe5d5('0x43')]['id']}},_0x59f872={};_0x59f872[_0xe5d5('0x31')]=_[_0xe5d5('0x2d')](db[_0xe5d5('0x29')][_0xe5d5('0x45')]);_0x3ecdc9[_0xe5d5('0x32')]=_[_0xe5d5('0x30')](_0x59f872[_0xe5d5('0x31')],qs[_0xe5d5('0x33')](_0x4672e9['query'][_0xe5d5('0x33')]));_0x3ecdc9[_0xe5d5('0x32')]=_0x3ecdc9['attributes']['length']?_0x3ecdc9[_0xe5d5('0x32')]:_0x59f872[_0xe5d5('0x31')];if(_0x4672e9[_0xe5d5('0x2e')]['includeAll']){_0x3ecdc9[_0xe5d5('0x3f')]=[{'all':!![]}];}_0x3ecdc9=_[_0xe5d5('0x3a')]({},_0x3ecdc9,_0x4672e9[_0xe5d5('0x3c')]);return db[_0xe5d5('0x29')][_0xe5d5('0x46')](_0x3ecdc9)[_0xe5d5('0x3d')](handleEntityNotFound(_0x2087c2,null))[_0xe5d5('0x3d')](function(_0x5e982e){if(_0x5e982e){var _0x1dd6f9=_0x5e982e[_0xe5d5('0x47')]({'plain':!![]});_0x1dd6f9=qs[_0xe5d5('0x48')](_0x1dd6f9,['id','createdAt',_0xe5d5('0x49')]);_0x4672e9[_0xe5d5('0x4a')]=_[_0xe5d5('0x48')](_0x4672e9['body'],['id',_0xe5d5('0x4b'),_0xe5d5('0x49')]);return db[_0xe5d5('0x29')][_0xe5d5('0x4c')](_[_0xe5d5('0x3a')](_0x1dd6f9,_0x4672e9['body']),{'include':_0x4672e9[_0xe5d5('0x2e')][_0xe5d5('0x3e')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x2087c2,0xc9))[_0xe5d5('0x4d')](handleError(_0x2087c2,null));};exports['update']=function(_0x3caf55,_0x40e159){if(_0x3caf55['body']['id']){delete _0x3caf55[_0xe5d5('0x4a')]['id'];}return db[_0xe5d5('0x29')][_0xe5d5('0x46')]({'where':{'id':_0x3caf55['params']['id']}})[_0xe5d5('0x3d')](handleEntityNotFound(_0x40e159,null))[_0xe5d5('0x3d')](saveUpdates(_0x3caf55[_0xe5d5('0x4a')],null))[_0xe5d5('0x3d')](respondWithResult(_0x40e159,null))[_0xe5d5('0x4d')](handleError(_0x40e159,null));};exports[_0xe5d5('0x24')]=function(_0x34315d,_0x42dd12){return db[_0xe5d5('0x29')][_0xe5d5('0x46')]({'where':{'id':_0x34315d['params']['id']}})[_0xe5d5('0x3d')](handleEntityNotFound(_0x42dd12,null))[_0xe5d5('0x3d')](removeEntity(_0x42dd12,null))[_0xe5d5('0x4d')](handleError(_0x42dd12,null));};exports[_0xe5d5('0x4c')]=function(_0xdaff12,_0x2f684c,_0x2d3738){_0xdaff12[_0xe5d5('0x4a')]['name']=_0xdaff12['file'][_0xe5d5('0x4e')];_0xdaff12['body'][_0xe5d5('0x4f')]=_0xdaff12[_0xe5d5('0x50')]['filename'];_0xdaff12[_0xe5d5('0x4a')][_0xe5d5('0x2b')]=_0xdaff12['file']['mimetype'];return db[_0xe5d5('0x29')][_0xe5d5('0x4c')](_0xdaff12[_0xe5d5('0x4a')])[_0xe5d5('0x3d')](respondWithResult(_0x2f684c,0xc9))[_0xe5d5('0x4d')](handleError(_0x2f684c,null));};exports['download']=function(_0x3aed51,_0x5405a0,_0x348d48){return db[_0xe5d5('0x29')][_0xe5d5('0x51')]({'where':{'id':_0x3aed51[_0xe5d5('0x43')]['id']},'raw':!![]})[_0xe5d5('0x3d')](handleEntityNotFound(_0x5405a0,null))[_0xe5d5('0x3d')](function(_0x5460af){if(_0x5460af){var _0x4026ad=_0x5460af[_0xe5d5('0x52')]!==null;var _0x5d5351=path['join'](config[_0xe5d5('0x53')],_0xe5d5('0x54'));if(_0x4026ad){_0x5d5351=path[_0xe5d5('0x55')](_0x5d5351,_0xe5d5('0x56'));}var _0x8e78e0=path[_0xe5d5('0x55')](_0x5d5351,_0x5460af[_0xe5d5('0x4f')]);return _0x5405a0['download'](_0x8e78e0);}})[_0xe5d5('0x4d')](handleError(_0x5405a0,null));};
\ No newline at end of file
+var _0xf350=['../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','stack','index','map','Attachment','rawAttributes','type','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','clone','createdAt','updatedAt','omit','body','create','file','originalname','basename','filename','mimetype','download','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xf350,0x151));var _0x0f35=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf350[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0x0f35('0x0'));var rimraf=require(_0x0f35('0x1'));var zipdir=require(_0x0f35('0x2'));var jsonpatch=require(_0x0f35('0x3'));var rp=require('request-promise');var moment=require(_0x0f35('0x4'));var BPromise=require(_0x0f35('0x5'));var Mustache=require(_0x0f35('0x6'));var util=require('util');var path=require(_0x0f35('0x7'));var sox=require(_0x0f35('0x8'));var csv=require(_0x0f35('0x9'));var ejs=require(_0x0f35('0xa'));var fs=require('fs');var fs_extra=require(_0x0f35('0xb'));var _=require(_0x0f35('0xc'));var squel=require('squel');var crypto=require(_0x0f35('0xd'));var jsforce=require(_0x0f35('0xe'));var deskjs=require(_0x0f35('0xf'));var toCsv=require(_0x0f35('0x9'));var querystring=require(_0x0f35('0x10'));var Papa=require('papaparse');var Redis=require(_0x0f35('0x11'));var authService=require(_0x0f35('0x12'));var qs=require(_0x0f35('0x13'));var as=require(_0x0f35('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0f35('0x15'))('api');var utils=require(_0x0f35('0x16'));var config=require(_0x0f35('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0f35('0x18'))['db'];function respondWithStatusCode(_0x39b7d4,_0xe0c757){_0xe0c757=_0xe0c757||0xcc;return function(_0x4133e2){if(_0x4133e2){return _0x39b7d4[_0x0f35('0x19')](_0xe0c757);}return _0x39b7d4[_0x0f35('0x1a')](_0xe0c757)[_0x0f35('0x1b')]();};}function respondWithResult(_0x125d96,_0x326fa6){_0x326fa6=_0x326fa6||0xc8;return function(_0x3afe18){if(_0x3afe18){return _0x125d96[_0x0f35('0x1a')](_0x326fa6)[_0x0f35('0x1c')](_0x3afe18);}};}function respondWithFilteredResult(_0x2c39dd,_0x342168){return function(_0x48289d){if(_0x48289d){var _0x209602=typeof _0x342168['offset']===_0x0f35('0x1d')&&typeof _0x342168[_0x0f35('0x1e')]===_0x0f35('0x1d');var _0x4ce798=_0x48289d[_0x0f35('0x1f')];var _0x1a86d2=_0x209602?0x0:_0x342168[_0x0f35('0x20')];var _0x24d09a=_0x209602?_0x48289d[_0x0f35('0x1f')]:_0x342168[_0x0f35('0x20')]+_0x342168[_0x0f35('0x1e')];var _0xd26d6f;if(_0x24d09a>=_0x4ce798){_0x24d09a=_0x4ce798;_0xd26d6f=0xc8;}else{_0xd26d6f=0xce;}_0x2c39dd[_0x0f35('0x1a')](_0xd26d6f);return _0x2c39dd[_0x0f35('0x21')]('Content-Range',_0x1a86d2+'-'+_0x24d09a+'/'+_0x4ce798)['json'](_0x48289d);}return null;};}function patchUpdates(_0x51ff6e){return function(_0x50cf9f){try{jsonpatch[_0x0f35('0x22')](_0x50cf9f,_0x51ff6e,!![]);}catch(_0x51e699){return BPromise[_0x0f35('0x23')](_0x51e699);}return _0x50cf9f[_0x0f35('0x24')]();};}function saveUpdates(_0x116740,_0x239a4e){return function(_0x4e2a32){if(_0x4e2a32){return _0x4e2a32[_0x0f35('0x25')](_0x116740)[_0x0f35('0x26')](function(_0x139c8d){return _0x139c8d;});}return null;};}function removeEntity(_0x2d3ce4,_0x443d32){return function(_0x3f3cdd){if(_0x3f3cdd){return _0x3f3cdd[_0x0f35('0x27')]()[_0x0f35('0x26')](function(){_0x2d3ce4[_0x0f35('0x1a')](0xcc)[_0x0f35('0x1b')]();});}};}function handleEntityNotFound(_0x2d1072,_0xdd8cfc){return function(_0x13bc79){if(!_0x13bc79){_0x2d1072[_0x0f35('0x19')](0x194);}return _0x13bc79;};}function handleError(_0x23940c,_0x42b1f7){_0x42b1f7=_0x42b1f7||0x1f4;return function(_0x1d5745){logger[_0x0f35('0x28')](_0x1d5745[_0x0f35('0x29')]);if(_0x1d5745['name']){delete _0x1d5745['name'];}_0x23940c['status'](_0x42b1f7)['send'](_0x1d5745);};}exports[_0x0f35('0x2a')]=function(_0x13698e,_0x4d8a65){var _0x95381c={},_0x3e36de={},_0x3ed822={'count':0x0,'rows':[]};var _0x1f348d=_[_0x0f35('0x2b')](db[_0x0f35('0x2c')][_0x0f35('0x2d')],function(_0x21161d){return{'name':_0x21161d['fieldName'],'type':_0x21161d[_0x0f35('0x2e')][_0x0f35('0x2f')]};});_0x3e36de[_0x0f35('0x30')]=_[_0x0f35('0x2b')](_0x1f348d,_0x0f35('0x31'));_0x3e36de[_0x0f35('0x32')]=_[_0x0f35('0x33')](_0x13698e[_0x0f35('0x32')]);_0x3e36de[_0x0f35('0x34')]=_[_0x0f35('0x35')](_0x3e36de[_0x0f35('0x30')],_0x3e36de[_0x0f35('0x32')]);_0x95381c[_0x0f35('0x36')]=_[_0x0f35('0x35')](_0x3e36de[_0x0f35('0x30')],qs['fields'](_0x13698e[_0x0f35('0x32')][_0x0f35('0x37')]));_0x95381c[_0x0f35('0x36')]=_0x95381c[_0x0f35('0x36')]['length']?_0x95381c[_0x0f35('0x36')]:_0x3e36de['model'];if(!_0x13698e[_0x0f35('0x32')][_0x0f35('0x38')](_0x0f35('0x39'))){_0x95381c['limit']=qs['limit'](_0x13698e[_0x0f35('0x32')][_0x0f35('0x1e')]);_0x95381c[_0x0f35('0x20')]=qs['offset'](_0x13698e['query']['offset']);}_0x95381c[_0x0f35('0x3a')]=qs['sort'](_0x13698e[_0x0f35('0x32')]['sort']);_0x95381c[_0x0f35('0x3b')]=qs[_0x0f35('0x34')](_['pick'](_0x13698e['query'],_0x3e36de[_0x0f35('0x34')]),_0x1f348d);if(_0x13698e[_0x0f35('0x32')]['filter']){_0x95381c[_0x0f35('0x3b')]=_[_0x0f35('0x3c')](_0x95381c['where'],{'$or':_[_0x0f35('0x2b')](_0x1f348d,function(_0x56ed29){if(_0x56ed29[_0x0f35('0x2e')]!==_0x0f35('0x3d')){var _0x441202={};_0x441202[_0x56ed29['name']]={'$like':'%'+_0x13698e[_0x0f35('0x32')][_0x0f35('0x3e')]+'%'};return _0x441202;}})});}_0x95381c=_[_0x0f35('0x3c')]({},_0x95381c,_0x13698e[_0x0f35('0x3f')]);var _0x19b90f={'where':_0x95381c[_0x0f35('0x3b')]};return db['Attachment']['count'](_0x19b90f)[_0x0f35('0x26')](function(_0x5c3a02){_0x3ed822[_0x0f35('0x1f')]=_0x5c3a02;if(_0x13698e[_0x0f35('0x32')][_0x0f35('0x40')]){_0x95381c[_0x0f35('0x41')]=[{'all':!![]}];}return db[_0x0f35('0x2c')][_0x0f35('0x42')](_0x95381c);})['then'](function(_0x130bdb){_0x3ed822[_0x0f35('0x43')]=_0x130bdb;return _0x3ed822;})[_0x0f35('0x26')](respondWithFilteredResult(_0x4d8a65,_0x95381c))[_0x0f35('0x44')](handleError(_0x4d8a65,null));};exports[_0x0f35('0x45')]=function(_0x337063,_0x4cf3e8){var _0x3b3067={'raw':!![],'where':{'id':_0x337063[_0x0f35('0x46')]['id']}},_0x538971={};_0x538971[_0x0f35('0x30')]=_['keys'](db[_0x0f35('0x2c')][_0x0f35('0x2d')]);_0x538971[_0x0f35('0x32')]=_[_0x0f35('0x33')](_0x337063['query']);_0x538971['filters']=_['intersection'](_0x538971['model'],_0x538971[_0x0f35('0x32')]);_0x3b3067['attributes']=_[_0x0f35('0x35')](_0x538971[_0x0f35('0x30')],qs['fields'](_0x337063[_0x0f35('0x32')][_0x0f35('0x37')]));_0x3b3067['attributes']=_0x3b3067[_0x0f35('0x36')][_0x0f35('0x47')]?_0x3b3067[_0x0f35('0x36')]:_0x538971['model'];if(_0x337063['query'][_0x0f35('0x40')]){_0x3b3067[_0x0f35('0x41')]=[{'all':!![]}];}_0x3b3067=_[_0x0f35('0x3c')]({},_0x3b3067,_0x337063[_0x0f35('0x3f')]);return db['Attachment'][_0x0f35('0x48')](_0x3b3067)[_0x0f35('0x26')](handleEntityNotFound(_0x4cf3e8,null))['then'](respondWithResult(_0x4cf3e8,null))[_0x0f35('0x44')](handleError(_0x4cf3e8,null));};exports[_0x0f35('0x49')]=function(_0x1ca91f,_0x1acc21){var _0x26157d={'where':{'id':_0x1ca91f[_0x0f35('0x46')]['id']}},_0x1fb495={};_0x1fb495[_0x0f35('0x30')]=_[_0x0f35('0x33')](db[_0x0f35('0x2c')][_0x0f35('0x2d')]);_0x26157d['attributes']=_[_0x0f35('0x35')](_0x1fb495[_0x0f35('0x30')],qs[_0x0f35('0x37')](_0x1ca91f['query'][_0x0f35('0x37')]));_0x26157d[_0x0f35('0x36')]=_0x26157d[_0x0f35('0x36')]['length']?_0x26157d[_0x0f35('0x36')]:_0x1fb495[_0x0f35('0x30')];if(_0x1ca91f[_0x0f35('0x32')]['includeAll']){_0x26157d[_0x0f35('0x41')]=[{'all':!![]}];}_0x26157d=_[_0x0f35('0x3c')]({},_0x26157d,_0x1ca91f['options']);return db[_0x0f35('0x2c')]['find'](_0x26157d)['then'](handleEntityNotFound(_0x1acc21,null))['then'](function(_0x2b3025){if(_0x2b3025){var _0x144bff=_0x2b3025['get']({'plain':!![]});_0x144bff=qs['omit'](_0x144bff,['id',_0x0f35('0x4a'),_0x0f35('0x4b')]);_0x1ca91f['body']=_[_0x0f35('0x4c')](_0x1ca91f[_0x0f35('0x4d')],['id',_0x0f35('0x4a'),_0x0f35('0x4b')]);return db[_0x0f35('0x2c')][_0x0f35('0x4e')](_[_0x0f35('0x3c')](_0x144bff,_0x1ca91f['body']),{'include':_0x1ca91f['query'][_0x0f35('0x40')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x1acc21,0xc9))[_0x0f35('0x44')](handleError(_0x1acc21,null));};exports[_0x0f35('0x25')]=function(_0x44b13f,_0x4fc013){if(_0x44b13f[_0x0f35('0x4d')]['id']){delete _0x44b13f[_0x0f35('0x4d')]['id'];}return db['Attachment'][_0x0f35('0x48')]({'where':{'id':_0x44b13f[_0x0f35('0x46')]['id']}})[_0x0f35('0x26')](handleEntityNotFound(_0x4fc013,null))['then'](saveUpdates(_0x44b13f[_0x0f35('0x4d')],null))['then'](respondWithResult(_0x4fc013,null))['catch'](handleError(_0x4fc013,null));};exports[_0x0f35('0x27')]=function(_0x36945c,_0xaef879){return db[_0x0f35('0x2c')][_0x0f35('0x48')]({'where':{'id':_0x36945c[_0x0f35('0x46')]['id']}})['then'](handleEntityNotFound(_0xaef879,null))[_0x0f35('0x26')](removeEntity(_0xaef879,null))[_0x0f35('0x44')](handleError(_0xaef879,null));};exports['create']=function(_0x46ac26,_0x126160,_0x6311fe){_0x46ac26[_0x0f35('0x4d')]['name']=_0x46ac26[_0x0f35('0x4f')][_0x0f35('0x50')];_0x46ac26['body'][_0x0f35('0x51')]=_0x46ac26[_0x0f35('0x4f')][_0x0f35('0x52')];_0x46ac26[_0x0f35('0x4d')][_0x0f35('0x2e')]=_0x46ac26['file'][_0x0f35('0x53')];return db['Attachment'][_0x0f35('0x4e')](_0x46ac26[_0x0f35('0x4d')])[_0x0f35('0x26')](respondWithResult(_0x126160,0xc9))[_0x0f35('0x44')](handleError(_0x126160,null));};exports[_0x0f35('0x54')]=function(_0x4f0a22,_0x325d52,_0x4f7581){return db['Attachment']['findOne']({'where':{'id':_0x4f0a22['params']['id']},'raw':!![]})[_0x0f35('0x26')](handleEntityNotFound(_0x325d52,null))[_0x0f35('0x26')](function(_0x93c1e7){if(_0x93c1e7){var _0x519cba=_0x93c1e7[_0x0f35('0x55')]!==null;var _0x1a5c7c=path[_0x0f35('0x56')](config[_0x0f35('0x57')],_0x0f35('0x58'));if(_0x519cba){_0x1a5c7c=path[_0x0f35('0x56')](_0x1a5c7c,_0x0f35('0x59'));}var _0x3df38f=path[_0x0f35('0x56')](_0x1a5c7c,_0x93c1e7[_0x0f35('0x51')]);return _0x325d52['download'](_0x3df38f);}})[_0x0f35('0x44')](handleError(_0x325d52,null));};
\ No newline at end of file
index a1c381f..84f956a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72de=['Attachment','attachments','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./attachment.attributes','exports'];(function(_0x590a3a,_0xd9db9){var _0x49017f=function(_0x1d92e9){while(--_0x1d92e9){_0x590a3a['push'](_0x590a3a['shift']());}};_0x49017f(++_0xd9db9);}(_0x72de,0x1e6));var _0xe72d=function(_0x17b203,_0x5a2205){_0x17b203=_0x17b203-0x0;var _0x153741=_0x72de[_0x17b203];return _0x153741;};'use strict';var _=require(_0xe72d('0x0'));var util=require(_0xe72d('0x1'));var logger=require(_0xe72d('0x2'))(_0xe72d('0x3'));var moment=require(_0xe72d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe72d('0x5'));var config=require(_0xe72d('0x6'));var attributes=require(_0xe72d('0x7'));module[_0xe72d('0x8')]=function(_0x30858e,_0x312cdb){return _0x30858e['define'](_0xe72d('0x9'),attributes,{'tableName':_0xe72d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7c6=['define','Attachment','attachments','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','exports'];(function(_0x4a5760,_0x134c15){var _0x2994b=function(_0x9c3df8){while(--_0x9c3df8){_0x4a5760['push'](_0x4a5760['shift']());}};_0x2994b(++_0x134c15);}(_0xb7c6,0x158));var _0x6b7c=function(_0x4b7a2f,_0x314f8d){_0x4b7a2f=_0x4b7a2f-0x0;var _0x33d71a=_0xb7c6[_0x4b7a2f];return _0x33d71a;};'use strict';var _=require(_0x6b7c('0x0'));var util=require(_0x6b7c('0x1'));var logger=require(_0x6b7c('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6b7c('0x3'));var rp=require(_0x6b7c('0x4'));var fs=require('fs');var path=require(_0x6b7c('0x5'));var rimraf=require(_0x6b7c('0x6'));var config=require('../../config/environment');var attributes=require('./attachment.attributes');module[_0x6b7c('0x7')]=function(_0x5f8b2f,_0x3dbd0c){return _0x5f8b2f[_0x6b7c('0x8')](_0x6b7c('0x9'),attributes,{'tableName':_0x6b7c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b482d66..655b064 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa74f=['then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateAttachment','Attachment','body','options','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0xa74f,0x9a));var _0xfa74=function(_0x29bf80,_0x4af855){_0x29bf80=_0x29bf80-0x0;var _0x932096=_0xa74f[_0x29bf80];return _0x932096;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfa74('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa74('0x1'));var db=require(_0xfa74('0x2'))['db'];var utils=require(_0xfa74('0x3'));var logger=require(_0xfa74('0x4'))('rpc');var config=require(_0xfa74('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfa74('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x9ddbd2,_0x3ac32e,_0x2d9fa9){return new BPromise(function(_0x287921,_0x344e04){return client['request'](_0x9ddbd2,_0x2d9fa9)[_0xfa74('0x7')](function(_0x37d4d8){logger[_0xfa74('0x8')](_0xfa74('0x9'),_0x3ac32e,'request\x20sent');logger[_0xfa74('0xa')](_0xfa74('0xb'),_0x3ac32e,'request\x20sent',JSON[_0xfa74('0xc')](_0x37d4d8));if(_0x37d4d8[_0xfa74('0xd')]){if(_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xe')]===0x1f4){logger['error'](_0xfa74('0x9'),_0x3ac32e,_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xf')]);return _0x344e04(_0x37d4d8[_0xfa74('0xd')]['message']);}logger[_0xfa74('0xd')](_0xfa74('0x9'),_0x3ac32e,_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xf')]);return _0x287921(_0x37d4d8[_0xfa74('0xd')]['message']);}else{logger[_0xfa74('0x8')](_0xfa74('0x9'),_0x3ac32e,_0xfa74('0x10'));_0x287921(_0x37d4d8[_0xfa74('0x11')][_0xfa74('0xf')]);}})[_0xfa74('0x12')](function(_0x3b9e32){logger['error'](_0xfa74('0x9'),_0x3ac32e,_0x3b9e32);_0x344e04(_0x3b9e32);});});}exports[_0xfa74('0x13')]=function(_0x51dda1){var _0x4928b6=this;return new Promise(function(_0x31d3c1,_0x25a36b){return db[_0xfa74('0x14')]['create'](_0x51dda1[_0xfa74('0x15')],{'raw':_0x51dda1[_0xfa74('0x16')]?_0x51dda1[_0xfa74('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xfa74('0x7')](function(_0x302eb4){logger[_0xfa74('0x8')]('CreateAttachment',_0x51dda1);logger['debug'](_0xfa74('0x13'),_0x51dda1,JSON[_0xfa74('0xc')](_0x302eb4));_0x31d3c1(_0x302eb4);})[_0xfa74('0x12')](function(_0xeaaa19){logger[_0xfa74('0xd')]('CreateAttachment',_0xeaaa19['message'],_0x51dda1);_0x25a36b(_0x4928b6[_0xfa74('0xd')](0x1f4,_0xeaaa19['message']));});});};
\ No newline at end of file
+var _0x4d46=['debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Attachment,\x20%s,\x20%s','info','result','catch','Attachment','create','body','options','raw','then','CreateAttachment','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request\x20sent'];(function(_0x3a218d,_0x340ffa){var _0x23580d=function(_0x2c4dbb){while(--_0x2c4dbb){_0x3a218d['push'](_0x3a218d['shift']());}};_0x23580d(++_0x340ffa);}(_0x4d46,0x197));var _0x64d4=function(_0x62d15,_0x34a398){_0x62d15=_0x62d15-0x0;var _0x45bbe9=_0x4d46[_0x62d15];return _0x45bbe9;};'use strict';var _=require(_0x64d4('0x0'));var util=require(_0x64d4('0x1'));var moment=require(_0x64d4('0x2'));var BPromise=require(_0x64d4('0x3'));var rs=require(_0x64d4('0x4'));var fs=require('fs');var Redis=require(_0x64d4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x64d4('0x6'));var logger=require(_0x64d4('0x7'))(_0x64d4('0x8'));var config=require(_0x64d4('0x9'));var jayson=require(_0x64d4('0xa'));var client=jayson[_0x64d4('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x321a51,_0x33b72d,_0x51faf7){return new BPromise(function(_0x45158d,_0x34d00a){return client['request'](_0x321a51,_0x51faf7)['then'](function(_0x4d9e23){logger['info']('Attachment,\x20%s,\x20%s',_0x33b72d,_0x64d4('0xc'));logger[_0x64d4('0xd')](_0x64d4('0xe'),_0x33b72d,_0x64d4('0xc'),JSON[_0x64d4('0xf')](_0x4d9e23));if(_0x4d9e23[_0x64d4('0x10')]){if(_0x4d9e23[_0x64d4('0x10')][_0x64d4('0x11')]===0x1f4){logger[_0x64d4('0x10')]('Attachment,\x20%s,\x20%s',_0x33b72d,_0x4d9e23[_0x64d4('0x10')]['message']);return _0x34d00a(_0x4d9e23[_0x64d4('0x10')][_0x64d4('0x12')]);}logger[_0x64d4('0x10')](_0x64d4('0x13'),_0x33b72d,_0x4d9e23[_0x64d4('0x10')][_0x64d4('0x12')]);return _0x45158d(_0x4d9e23['error'][_0x64d4('0x12')]);}else{logger[_0x64d4('0x14')](_0x64d4('0x13'),_0x33b72d,_0x64d4('0xc'));_0x45158d(_0x4d9e23[_0x64d4('0x15')][_0x64d4('0x12')]);}})[_0x64d4('0x16')](function(_0x4b3335){logger[_0x64d4('0x10')](_0x64d4('0x13'),_0x33b72d,_0x4b3335);_0x34d00a(_0x4b3335);});});}exports['CreateAttachment']=function(_0x1bbaf0){var _0x155b60=this;return new Promise(function(_0x13900e,_0xe79978){return db[_0x64d4('0x17')][_0x64d4('0x18')](_0x1bbaf0[_0x64d4('0x19')],{'raw':_0x1bbaf0[_0x64d4('0x1a')]?_0x1bbaf0['options'][_0x64d4('0x1b')]===undefined?!![]:![]:!![]})[_0x64d4('0x1c')](function(_0x35ee04){logger[_0x64d4('0x14')]('CreateAttachment',_0x1bbaf0);logger['debug'](_0x64d4('0x1d'),_0x1bbaf0,JSON[_0x64d4('0xf')](_0x35ee04));_0x13900e(_0x35ee04);})[_0x64d4('0x16')](function(_0x4c0b0b){logger[_0x64d4('0x10')](_0x64d4('0x1d'),_0x4c0b0b[_0x64d4('0x12')],_0x1bbaf0);_0xe79978(_0x155b60[_0x64d4('0x10')](0x1f4,_0x4c0b0b[_0x64d4('0x12')]));});});};
\ No newline at end of file
index eca446b..b96c4ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x5e4146,_0x306610){var _0x1b0344=function(_0x4fb8a5){while(--_0x4fb8a5){_0x5e4146['push'](_0x5e4146['shift']());}};_0x1b0344(++_0x306610);}(_0x5f2f,0x73));var _0xf5f2=function(_0x56d776,_0x252211){_0x56d776=_0x56d776-0x0;var _0x2be469=_0x5f2f[_0x56d776];return _0x2be469;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
+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(_0x52befc,_0x4423c6){var _0x1c5ccd=function(_0xc2330f){while(--_0xc2330f){_0x52befc['push'](_0x52befc['shift']());}};_0x1c5ccd(++_0x4423c6);}(_0x2032,0xd9));var _0x2203=function(_0x3a8f25,_0x3f9776){_0x3a8f25=_0x3a8f25-0x0;var _0x2be387=_0x2032[_0x3a8f25];return _0x2be387;};'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 5361acc..0ec8959 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ce6=['map','emails','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','catch','passport','passport-google-oauth20','moment','../../mysqldb','../../config/environment','../../components/auth/service','login','google','profile','callback','authenticate','/login','use','clientID','secret','Setting','findOne','allowedLoginAttempts','blockDuration','then','User','find'];(function(_0x43f528,_0x3471f2){var _0x309445=function(_0x45b43e){while(--_0x45b43e){_0x43f528['push'](_0x43f528['shift']());}};_0x309445(++_0x3471f2);}(_0x4ce6,0x1be));var _0x64ce=function(_0x2eb3db,_0x4a32c0){_0x2eb3db=_0x2eb3db-0x0;var _0x358f33=_0x4ce6[_0x2eb3db];return _0x358f33;};'use strict';var _=require('lodash');var passport=require(_0x64ce('0x0'));var GoogleStrategy=require(_0x64ce('0x1'))['Strategy'];var moment=require(_0x64ce('0x2'));var db=require(_0x64ce('0x3'))['db'];var config=require(_0x64ce('0x4'));var signToken=require(_0x64ce('0x5'))['signToken'];var utils=require('../../config/utils');exports[_0x64ce('0x6')]=passport['authenticate'](_0x64ce('0x7'),{'failureRedirect':'/login','scope':[_0x64ce('0x8'),'email'],'session':![]});exports[_0x64ce('0x9')]=passport[_0x64ce('0xa')]('google',{'failureRedirect':_0x64ce('0xb'),'session':![]});passport[_0x64ce('0xc')](new GoogleStrategy({'clientID':config[_0x64ce('0x7')]?config['google'][_0x64ce('0xd')]:'id','clientSecret':config[_0x64ce('0x7')]?config[_0x64ce('0x7')]['clientSecret']:_0x64ce('0xe'),'callbackURL':config[_0x64ce('0x7')]?config[_0x64ce('0x7')]['callbackURL']:''},function(_0x417db7,_0x28fc6c,_0x1ce40c,_0x319a58){var _0xbcd998,_0x35bbca;return db[_0x64ce('0xf')][_0x64ce('0x10')]({'where':{'id':0x1},'attributes':[_0x64ce('0x11'),_0x64ce('0x12')],'raw':!![]})[_0x64ce('0x13')](function(_0x334cdb){_0xbcd998=_0x334cdb;return db[_0x64ce('0x14')][_0x64ce('0x15')]({'where':{'email':_[_0x64ce('0x16')](_0x1ce40c[_0x64ce('0x17')],'value'),'role':{'$or':[_0x64ce('0x18'),_0x64ce('0x19'),_0x64ce('0x1a')]}}});})['then'](function(_0x59e85d){_0x35bbca=_0x59e85d;if(_0x35bbca){if(_0x35bbca[_0x64ce('0x1b')]){return _0x319a58(_0x64ce('0x1c'));}else if(_0xbcd998['blockDuration']>0x0){if(_0x35bbca[_0x64ce('0x1d')]){if(moment(_0x35bbca[_0x64ce('0x1e')])[_0x64ce('0x1f')](_0xbcd998[_0x64ce('0x12')],_0x64ce('0x20'))>moment()){return _0x319a58(_0x64ce('0x1c'));}else{return utils[_0x64ce('0x21')](_0x35bbca,0x0,![],null)[_0x64ce('0x13')](function(){return utils[_0x64ce('0x22')](_0x35bbca);})[_0x64ce('0x13')](function(){return _0x319a58(null,_0x35bbca);});}}else{return utils[_0x64ce('0x22')](_0x35bbca)[_0x64ce('0x13')](function(){return _0x319a58(null,_0x35bbca);});}}else{return utils['getLicense'](_0x35bbca)['then'](function(){return _0x319a58(null,_0x35bbca);});}}return _0x319a58(_0x64ce('0x1c'));})[_0x64ce('0x23')](function(_0x501990){_0x319a58(_0x501990);});}));
\ No newline at end of file
+var _0x7f74=['blocked','blockDuration','minutes','clearBlockUser','getLicense','lodash','passport','passport-google-oauth20','moment','../../config/environment','../../components/auth/service','signToken','login','authenticate','google','profile','callback','/login','clientID','allowedLoginAttempts','then','User','find','map','emails','admin','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x1b402c,_0x11fe62){var _0x4ba066=function(_0xdc977d){while(--_0xdc977d){_0x1b402c['push'](_0x1b402c['shift']());}};_0x4ba066(++_0x11fe62);}(_0x7f74,0x17e));var _0x47f7=function(_0x597aaf,_0x3f4538){_0x597aaf=_0x597aaf-0x0;var _0x53c251=_0x7f74[_0x597aaf];return _0x53c251;};'use strict';var _=require(_0x47f7('0x0'));var passport=require(_0x47f7('0x1'));var GoogleStrategy=require(_0x47f7('0x2'))['Strategy'];var moment=require(_0x47f7('0x3'));var db=require('../../mysqldb')['db'];var config=require(_0x47f7('0x4'));var signToken=require(_0x47f7('0x5'))[_0x47f7('0x6')];var utils=require('../../config/utils');exports[_0x47f7('0x7')]=passport[_0x47f7('0x8')](_0x47f7('0x9'),{'failureRedirect':'/login','scope':[_0x47f7('0xa'),'email'],'session':![]});exports[_0x47f7('0xb')]=passport[_0x47f7('0x8')](_0x47f7('0x9'),{'failureRedirect':_0x47f7('0xc'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x47f7('0x9')]?config['google'][_0x47f7('0xd')]:'id','clientSecret':config[_0x47f7('0x9')]?config[_0x47f7('0x9')]['clientSecret']:'secret','callbackURL':config[_0x47f7('0x9')]?config[_0x47f7('0x9')]['callbackURL']:''},function(_0x369970,_0xdf3f4c,_0x2f3404,_0x4c85ab){var _0x28789a,_0x20f89f;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x47f7('0xe'),'blockDuration'],'raw':!![]})[_0x47f7('0xf')](function(_0x7cc0a1){_0x28789a=_0x7cc0a1;return db[_0x47f7('0x10')][_0x47f7('0x11')]({'where':{'email':_[_0x47f7('0x12')](_0x2f3404[_0x47f7('0x13')],'value'),'role':{'$or':[_0x47f7('0x14'),'user',_0x47f7('0x15')]}}});})[_0x47f7('0xf')](function(_0x45983e){_0x20f89f=_0x45983e;if(_0x20f89f){if(_0x20f89f[_0x47f7('0x16')]){return _0x4c85ab(_0x47f7('0x17'));}else if(_0x28789a['blockDuration']>0x0){if(_0x20f89f[_0x47f7('0x18')]){if(moment(_0x20f89f['blockedAt'])['add'](_0x28789a[_0x47f7('0x19')],_0x47f7('0x1a'))>moment()){return _0x4c85ab(_0x47f7('0x17'));}else{return utils[_0x47f7('0x1b')](_0x20f89f,0x0,![],null)[_0x47f7('0xf')](function(){return utils[_0x47f7('0x1c')](_0x20f89f);})[_0x47f7('0xf')](function(){return _0x4c85ab(null,_0x20f89f);});}}else{return utils[_0x47f7('0x1c')](_0x20f89f)[_0x47f7('0xf')](function(){return _0x4c85ab(null,_0x20f89f);});}}else{return utils[_0x47f7('0x1c')](_0x20f89f)[_0x47f7('0xf')](function(){return _0x4c85ab(null,_0x20f89f);});}}return _0x4c85ab(_0x47f7('0x17'));})['catch'](function(_0x4936fe){_0x4c85ab(_0x4936fe);});}));
\ No newline at end of file
index b2de5fb..19319ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7604=['express','passport','Router','./authGoogle.controller','get','login','callback','isMiddleware','setTokenCookie','exports'];(function(_0x39a1cf,_0x42875c){var _0x58a94f=function(_0x16f4b6){while(--_0x16f4b6){_0x39a1cf['push'](_0x39a1cf['shift']());}};_0x58a94f(++_0x42875c);}(_0x7604,0xd2));var _0x4760=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x7604[_0x4565bf];return _0x5610ba;};'use strict';var express=require(_0x4760('0x0'));var passport=require(_0x4760('0x1'));var router=express[_0x4760('0x2')]();var controller=require(_0x4760('0x3'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0x4760('0x4')]('/',controller[_0x4760('0x5')]);router[_0x4760('0x4')]('/callback',controller[_0x4760('0x6')],authService[_0x4760('0x7')],userController['login'],authService[_0x4760('0x8')]);module[_0x4760('0x9')]=router;
\ No newline at end of file
+var _0x9400=['express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login','get','/callback','callback','isMiddleware','setTokenCookie','exports'];(function(_0x47501c,_0x76443c){var _0xc930e5=function(_0x752e7e){while(--_0x752e7e){_0x47501c['push'](_0x47501c['shift']());}};_0xc930e5(++_0x76443c);}(_0x9400,0x152));var _0x0940=function(_0x379caf,_0x2f2e4e){_0x379caf=_0x379caf-0x0;var _0xd45786=_0x9400[_0x379caf];return _0xd45786;};'use strict';var express=require(_0x0940('0x0'));var passport=require(_0x0940('0x1'));var router=express[_0x0940('0x2')]();var controller=require(_0x0940('0x3'));var userController=require(_0x0940('0x4'));var authService=require(_0x0940('0x5'));router['get']('/',controller[_0x0940('0x6')]);router[_0x0940('0x7')](_0x0940('0x8'),controller[_0x0940('0x9')],authService[_0x0940('0xa')],userController[_0x0940('0x6')],authService[_0x0940('0xb')]);module[_0x0940('0xc')]=router;
\ No newline at end of file
index 7c27d3b..ea9de95 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd53=['admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','blockDuration','minutes','clearBlockUser','add','catch','getLicense','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','merge','format','\x22%s\x22\x20<%s>','error','stringify','status','send','message','authenticate','local','signToken','json','body','Email\x20parameter\x20is\x20missing','generate','findOne','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','params','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','use','passport-local','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts'];(function(_0xc97b2e,_0x146ff1){var _0x17f120=function(_0x8638d){while(--_0x8638d){_0xc97b2e['push'](_0xc97b2e['shift']());}};_0x17f120(++_0x146ff1);}(_0xcd53,0x8e));var _0x3cd5=function(_0x3d5f84,_0x569548){_0x3d5f84=_0x3d5f84-0x0;var _0x1981b8=_0xcd53[_0x3d5f84];return _0x1981b8;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require(_0x3cd5('0x0'))[_0x3cd5('0x1')];var jayson=require(_0x3cd5('0x2'));var _=require(_0x3cd5('0x3'));var rs=require('randomstring');var moment=require(_0x3cd5('0x4'));var db=require(_0x3cd5('0x5'))['db'];var authService=require(_0x3cd5('0x6'));var utils=require(_0x3cd5('0x7'));var client=jayson[_0x3cd5('0x8')][_0x3cd5('0x9')]({'port':0x232b});function localAuthenticate(_0x530022,_0xd2196f,_0x1b9ecd,_0x426cd0){var _0x46f29e,_0xbd200a;return db[_0x3cd5('0xa')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x3cd5('0xb')](function(_0x4e544c){_0x46f29e=_0x4e544c;return _0x530022['findOne']({'attributes':['id',_0x3cd5('0xc'),_0x3cd5('0xd'),_0x3cd5('0xe'),_0x3cd5('0xf'),_0x3cd5('0x10'),_0x3cd5('0x11'),_0x3cd5('0x12'),_0x3cd5('0x13')],'where':{'name':_0xd2196f,'role':{'$or':[_0x3cd5('0x14'),_0x3cd5('0x15'),_0x3cd5('0x16')]}}});})[_0x3cd5('0xb')](function(_0x5bd98a){if(!_0x5bd98a||_0x5bd98a&&_0x5bd98a[_0x3cd5('0xc')]!==_0xd2196f){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0xbd200a=_0x5bd98a;return _0xbd200a;}})[_0x3cd5('0xb')](function(){_0xbd200a['authenticate'](_0x1b9ecd,function(_0x3cf624,_0x3def28){var _0x631939=_0xbd200a['loginAttempts']+0x1;if(_0x3cf624){return _0x426cd0(_0x3cf624);}else if(!_0x3def28){if(_0xbd200a['disabled']){return _0x426cd0(null,![],{'message':_0x3cd5('0x17')});}else if(_0x46f29e[_0x3cd5('0x18')]>0x0){if(_0xbd200a[_0x3cd5('0x11')]){if(_0x46f29e[_0x3cd5('0x19')]>0x0){if(moment(_0xbd200a[_0x3cd5('0x12')])['add'](_0x46f29e[_0x3cd5('0x19')],_0x3cd5('0x1a'))>moment()){return _0x426cd0(null,![],{'message':_0x3cd5('0x17')});}else{return utils[_0x3cd5('0x1b')](_0xbd200a,_0x631939,![],null)[_0x3cd5('0xb')](function(){return _0x426cd0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x426cd0(null,![],{'message':_0x3cd5('0x17')});}}else{if(_0x631939>=_0x46f29e[_0x3cd5('0x18')]){return utils[_0x3cd5('0x1b')](_0xbd200a,0x0,!![],moment())['then'](function(){return _0x426cd0(null,![],{'message':_0x3cd5('0x17')});});}else{return utils[_0x3cd5('0x1b')](_0xbd200a,_0x631939,![],null)[_0x3cd5('0xb')](function(){return _0x426cd0(null,![],{'message':_0x3cd5('0x17')});});}}}else{return _0x426cd0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0xbd200a[_0x3cd5('0x10')]){return _0x426cd0(null,![],{'message':_0x3cd5('0x17')});}else if(_0x46f29e[_0x3cd5('0x18')]>0x0){if(_0xbd200a[_0x3cd5('0x11')]){if(_0x46f29e[_0x3cd5('0x19')]>0x0){if(moment(_0xbd200a[_0x3cd5('0x12')])[_0x3cd5('0x1c')](_0x46f29e[_0x3cd5('0x19')],_0x3cd5('0x1a'))>moment()){return _0x426cd0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x3cd5('0x1b')](_0xbd200a,0x0,![],null)[_0x3cd5('0xb')](function(){return utils['getLicense'](_0xbd200a);})[_0x3cd5('0xb')](function(){return _0x426cd0(null,_0xbd200a);});}}else{return _0x426cd0(null,![],{'message':_0x3cd5('0x17')});}}else{return utils[_0x3cd5('0x1b')](_0xbd200a,0x0,![],null)[_0x3cd5('0xb')](function(){return utils['getLicense'](_0xbd200a);})['then'](function(){return _0x426cd0(null,_0xbd200a);})[_0x3cd5('0x1d')](function(_0x43ef9e){return _0x426cd0(null,![],_0x43ef9e);});}}else{if(_0xbd200a[_0x3cd5('0x11')]){return _0x426cd0(null,![],{'message':_0x3cd5('0x17')});}else{return utils[_0x3cd5('0x1e')](_0xbd200a)[_0x3cd5('0xb')](function(){return _0x426cd0(null,_0xbd200a);});}}}});})[_0x3cd5('0x1d')](function(_0x1ffc98){return _0x426cd0(null,![],_0x1ffc98);});}function sendServiceMail(_0x27219f){return db[_0x3cd5('0x1f')][_0x3cd5('0x20')]({'where':{'service':!![]},'attributes':['id','name',_0x3cd5('0x21')],'include':[{'model':db[_0x3cd5('0x22')],'as':_0x3cd5('0x23')}]})[_0x3cd5('0xb')](function(_0x3549d0){if(!_0x3549d0){throw new Error(_0x3cd5('0x24'));}var _0x55274f={'tls':{'rejectUnauthorized':![]}};if(_0x3549d0[_0x3cd5('0x23')][_0x3cd5('0x25')]){_0x55274f[_0x3cd5('0x25')]=_0x3549d0['Smtp']['service'];}else{_0x55274f['host']=_0x3549d0['Smtp'][_0x3cd5('0x26')];_0x55274f[_0x3cd5('0x27')]=_0x3549d0[_0x3cd5('0x23')]['port'];_0x55274f[_0x3cd5('0x28')]=_0x3549d0['Smtp'][_0x3cd5('0x28')];}if(_0x3549d0['Smtp'][_0x3cd5('0x29')]){_0x55274f[_0x3cd5('0x2a')]={'user':_0x3549d0[_0x3cd5('0x23')][_0x3cd5('0x15')],'pass':_0x3549d0[_0x3cd5('0x23')]['pass']};}var _0xb2538e={'account':_0x55274f,'message':_[_0x3cd5('0x2b')]({'from':util[_0x3cd5('0x2c')](_0x3cd5('0x2d'),_0x3549d0[_0x3cd5('0xc')],_0x3549d0[_0x3cd5('0x21')]||_0x3549d0[_0x3cd5('0x23')][_0x3cd5('0x15')])},_0x27219f)};return client['request']('SendMail',_0xb2538e);})[_0x3cd5('0xb')](function(_0x30d7d7){if(_0x30d7d7[_0x3cd5('0x2e')]){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x30d7d7[_0x3cd5('0x2e')]['message']||JSON[_0x3cd5('0x2f')](_0x30d7d7[_0x3cd5('0x2e')])));}return!![];});}function handleError(_0x4666ab,_0x349667,_0x52cb64){return _0x4666ab[_0x3cd5('0x30')](_0x349667||0x1f4)[_0x3cd5('0x31')]({'message':_0x52cb64?_0x52cb64[_0x3cd5('0x32')]||_0x52cb64:''});}exports['login']=function(_0x12ff87,_0x4b3f55,_0x54658f){passport[_0x3cd5('0x33')](_0x3cd5('0x34'),function(_0x43bf03,_0x176bd3,_0x10cea3){var _0x1b16aa=_0x43bf03||_0x10cea3;if(_0x1b16aa){return handleError(_0x4b3f55,0x191,_0x1b16aa);}if(!_0x176bd3){return handleError(_0x4b3f55,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x3f390c={'payload':{'id':_0x176bd3['id'],'role':_0x176bd3[_0x3cd5('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x3cd5('0x35')](_0x3f390c)[_0x3cd5('0xb')](function(_0x191713){_0x4b3f55[_0x3cd5('0x36')]({'id':_0x176bd3['id'],'token':_0x191713,'statusCall':'','isAlreadyLogged':_0x176bd3['online']});});}})(_0x12ff87,_0x4b3f55,_0x54658f);};exports['forgot']=function(_0x6cbc1a,_0x4cd753,_0x586c09){if(!_0x6cbc1a[_0x3cd5('0x37')][_0x3cd5('0x21')]){return handleError(_0x4cd753,0x1f4,{'message':_0x3cd5('0x38')});}var _0x389094=rs[_0x3cd5('0x39')]();_0x6cbc1a[_0x3cd5('0x37')][_0x3cd5('0x21')]=_0x6cbc1a[_0x3cd5('0x37')][_0x3cd5('0x21')]['trim']()['toLowerCase']();var _0x5ea2fe;return db[_0x3cd5('0xa')][_0x3cd5('0x3a')]({'where':{'id':0x1},'attributes':[_0x3cd5('0x18'),_0x3cd5('0x19')],'raw':!![]})[_0x3cd5('0xb')](function(_0x537a6f){_0x5ea2fe=_0x537a6f;return db[_0x3cd5('0x3b')][_0x3cd5('0x20')]({'where':{'email':_0x6cbc1a[_0x3cd5('0x37')]['email']}});})[_0x3cd5('0xb')](function(_0x5db986){if(!_0x5db986){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x5db986['disabled']){throw new Error(_0x3cd5('0x3c'));}if(_0x5db986[_0x3cd5('0x11')]){if(moment(_0x5db986[_0x3cd5('0x12')])['add'](_0x5ea2fe[_0x3cd5('0x19')],_0x3cd5('0x1a'))>moment()){throw new Error(_0x3cd5('0x3d'));}else{_0x5db986[_0x3cd5('0x11')]=![];_0x5db986[_0x3cd5('0x12')]=null;}}_0x5db986[_0x3cd5('0x3e')]=_0x389094;_0x5db986['resetPasswordExpires']=Date[_0x3cd5('0x3f')]()+0x36ee80;return _0x5db986[_0x3cd5('0x40')]();})[_0x3cd5('0xb')](function(){return sendServiceMail({'to':_0x6cbc1a[_0x3cd5('0x37')][_0x3cd5('0x21')],'subject':_0x3cd5('0x41'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x3cd5('0x42')+'https://'+_0x6cbc1a['headers'][_0x3cd5('0x26')]+_0x3cd5('0x43')+_0x389094+'\x0a\x0a'+_0x3cd5('0x44')});})['then'](function(){_0x4cd753[_0x3cd5('0x30')](0xc8)[_0x3cd5('0x31')]({'message':_0x3cd5('0x45')});})['catch'](function(_0x2ff758){return handleError(_0x4cd753,0x1f4,_0x2ff758);});};exports['reset']=function(_0x136e4f,_0xd13c15,_0x4d8d23){return db[_0x3cd5('0x3b')][_0x3cd5('0x20')]({'where':{'resetPasswordToken':_0x136e4f[_0x3cd5('0x46')][_0x3cd5('0x47')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x3cd5('0xb')](function(_0xeba605){if(!_0xeba605){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x3cd5('0xa')][_0x3cd5('0x3a')]({'attributes':['id',_0x3cd5('0x48'),_0x3cd5('0x49'),_0x3cd5('0x4a')]})['then'](function(_0x290c3f){if(_0x290c3f['securePassword'])authService[_0x3cd5('0x4b')](_0x136e4f[_0x3cd5('0x37')][_0x3cd5('0xd')]);if(!_0x290c3f[_0x3cd5('0x49')]||!_0xeba605[_0x3cd5('0x4c')])return _0xeba605;authService[_0x3cd5('0x4d')](_0x136e4f[_0x3cd5('0x37')]['password'],_0xeba605[_0x3cd5('0x4c')],_0x290c3f[_0x3cd5('0x4a')]);return _0xeba605;})[_0x3cd5('0xb')](function(){_0xeba605[_0x3cd5('0xd')]=_0x136e4f[_0x3cd5('0x37')][_0x3cd5('0xd')];_0xeba605['resetPasswordToken']=null;_0xeba605[_0x3cd5('0x4e')]=null;return _0xeba605[_0x3cd5('0x40')]();});})['then'](function(){_0xd13c15[_0x3cd5('0x30')](0xc8)[_0x3cd5('0x31')]({'message':_0x3cd5('0x4f')});})[_0x3cd5('0x1d')](function(_0x5323a0){return handleError(_0xd13c15,0x1f4,_0x5323a0);});};passport[_0x3cd5('0x50')](new LocalStrategy({'usernameField':_0x3cd5('0xc'),'passwordField':_0x3cd5('0xd')},function(_0x593f81,_0x218226,_0x4e2dab){return localAuthenticate(db[_0x3cd5('0x3b')],_0x593f81,_0x218226,_0x4e2dab);}));
\ No newline at end of file
+var _0x1157=['validatePasswordHistory','passwordHistoryLimit','Password\x20reset!','use','util','passport-local','Strategy','lodash','../../config/utils','client','http','Setting','findOne','blockDuration','then','name','password','salt','role','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','disabled','allowedLoginAttempts','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','send','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','User','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','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','status','Reset\x20Email\x20sent!','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','previousPasswords'];(function(_0x2b355e,_0x5d2107){var _0x1543fc=function(_0x4ff175){while(--_0x4ff175){_0x2b355e['push'](_0x2b355e['shift']());}};_0x1543fc(++_0x5d2107);}(_0x1157,0x1a8));var _0x7115=function(_0x1102d4,_0x144af5){_0x1102d4=_0x1102d4-0x0;var _0x120f26=_0x1157[_0x1102d4];return _0x120f26;};'use strict';var util=require(_0x7115('0x0'));var passport=require('passport');var LocalStrategy=require(_0x7115('0x1'))[_0x7115('0x2')];var jayson=require('jayson/promise');var _=require(_0x7115('0x3'));var rs=require('randomstring');var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x7115('0x4'));var client=jayson[_0x7115('0x5')][_0x7115('0x6')]({'port':0x232b});function localAuthenticate(_0x4b33a5,_0x532682,_0x4e6c50,_0x471244){var _0x4a3524,_0x127997;return db[_0x7115('0x7')][_0x7115('0x8')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x7115('0x9')],'raw':!![]})[_0x7115('0xa')](function(_0x3dd03c){_0x4a3524=_0x3dd03c;return _0x4b33a5['findOne']({'attributes':['id',_0x7115('0xb'),_0x7115('0xc'),_0x7115('0xd'),_0x7115('0xe'),'disabled',_0x7115('0xf'),_0x7115('0x10'),_0x7115('0x11')],'where':{'name':_0x532682,'role':{'$or':[_0x7115('0x12'),_0x7115('0x13'),_0x7115('0x14')]}}});})[_0x7115('0xa')](function(_0x48730e){if(!_0x48730e||_0x48730e&&_0x48730e[_0x7115('0xb')]!==_0x532682){throw new Error(_0x7115('0x15'));}else{_0x127997=_0x48730e;return _0x127997;}})[_0x7115('0xa')](function(){_0x127997['authenticate'](_0x4e6c50,function(_0x6d8d84,_0x434d56){var _0x55f01b=_0x127997['loginAttempts']+0x1;if(_0x6d8d84){return _0x471244(_0x6d8d84);}else if(!_0x434d56){if(_0x127997[_0x7115('0x16')]){return _0x471244(null,![],{'message':_0x7115('0x15')});}else if(_0x4a3524[_0x7115('0x17')]>0x0){if(_0x127997['blocked']){if(_0x4a3524[_0x7115('0x9')]>0x0){if(moment(_0x127997[_0x7115('0x10')])[_0x7115('0x18')](_0x4a3524[_0x7115('0x9')],_0x7115('0x19'))>moment()){return _0x471244(null,![],{'message':_0x7115('0x15')});}else{return utils['clearBlockUser'](_0x127997,_0x55f01b,![],null)[_0x7115('0xa')](function(){return _0x471244(null,![],{'message':_0x7115('0x15')});});}}else{return _0x471244(null,![],{'message':_0x7115('0x15')});}}else{if(_0x55f01b>=_0x4a3524[_0x7115('0x17')]){return utils['clearBlockUser'](_0x127997,0x0,!![],moment())[_0x7115('0xa')](function(){return _0x471244(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x7115('0x1a')](_0x127997,_0x55f01b,![],null)['then'](function(){return _0x471244(null,![],{'message':_0x7115('0x15')});});}}}else{return _0x471244(null,![],{'message':_0x7115('0x15')});}}else{if(_0x127997[_0x7115('0x16')]){return _0x471244(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x4a3524[_0x7115('0x17')]>0x0){if(_0x127997[_0x7115('0xf')]){if(_0x4a3524[_0x7115('0x9')]>0x0){if(moment(_0x127997[_0x7115('0x10')])[_0x7115('0x18')](_0x4a3524[_0x7115('0x9')],_0x7115('0x19'))>moment()){return _0x471244(null,![],{'message':_0x7115('0x15')});}else{return utils[_0x7115('0x1a')](_0x127997,0x0,![],null)[_0x7115('0xa')](function(){return utils[_0x7115('0x1b')](_0x127997);})['then'](function(){return _0x471244(null,_0x127997);});}}else{return _0x471244(null,![],{'message':_0x7115('0x15')});}}else{return utils['clearBlockUser'](_0x127997,0x0,![],null)[_0x7115('0xa')](function(){return utils[_0x7115('0x1b')](_0x127997);})[_0x7115('0xa')](function(){return _0x471244(null,_0x127997);})[_0x7115('0x1c')](function(_0x53e942){return _0x471244(null,![],_0x53e942);});}}else{if(_0x127997[_0x7115('0xf')]){return _0x471244(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x127997)[_0x7115('0xa')](function(){return _0x471244(null,_0x127997);});}}}});})['catch'](function(_0x1e1ae0){return _0x471244(null,![],_0x1e1ae0);});}function sendServiceMail(_0x1488c0){return db[_0x7115('0x1d')][_0x7115('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x7115('0xb'),_0x7115('0x1f')],'include':[{'model':db[_0x7115('0x20')],'as':_0x7115('0x21')}]})[_0x7115('0xa')](function(_0x3550ab){if(!_0x3550ab){throw new Error(_0x7115('0x22'));}var _0x2fa810={'tls':{'rejectUnauthorized':![]}};if(_0x3550ab[_0x7115('0x21')][_0x7115('0x23')]){_0x2fa810['service']=_0x3550ab[_0x7115('0x21')][_0x7115('0x23')];}else{_0x2fa810[_0x7115('0x24')]=_0x3550ab[_0x7115('0x21')][_0x7115('0x24')];_0x2fa810[_0x7115('0x25')]=_0x3550ab['Smtp']['port'];_0x2fa810[_0x7115('0x26')]=_0x3550ab[_0x7115('0x21')][_0x7115('0x26')];}if(_0x3550ab['Smtp'][_0x7115('0x27')]){_0x2fa810[_0x7115('0x28')]={'user':_0x3550ab['Smtp'][_0x7115('0x13')],'pass':_0x3550ab[_0x7115('0x21')]['pass']};}var _0x50a2c1={'account':_0x2fa810,'message':_[_0x7115('0x29')]({'from':util[_0x7115('0x2a')](_0x7115('0x2b'),_0x3550ab[_0x7115('0xb')],_0x3550ab[_0x7115('0x1f')]||_0x3550ab[_0x7115('0x21')][_0x7115('0x13')])},_0x1488c0)};return client[_0x7115('0x2c')](_0x7115('0x2d'),_0x50a2c1);})[_0x7115('0xa')](function(_0x531d01){if(_0x531d01[_0x7115('0x2e')]){throw new Error(util[_0x7115('0x2a')](_0x7115('0x2f'),_0x531d01[_0x7115('0x2e')][_0x7115('0x30')]||JSON['stringify'](_0x531d01[_0x7115('0x2e')])));}return!![];});}function handleError(_0x2ddd4d,_0x17c0cd,_0x218887){return _0x2ddd4d['status'](_0x17c0cd||0x1f4)[_0x7115('0x31')]({'message':_0x218887?_0x218887[_0x7115('0x30')]||_0x218887:''});}exports['login']=function(_0x4414f2,_0x50fe67,_0x2fb724){passport[_0x7115('0x32')]('local',function(_0x3e3250,_0x54d663,_0x15278e){var _0x18f7c4=_0x3e3250||_0x15278e;if(_0x18f7c4){return handleError(_0x50fe67,0x191,_0x18f7c4);}if(!_0x54d663){return handleError(_0x50fe67,0x194,{'message':_0x7115('0x33')});}else{var _0x36488b={'payload':{'id':_0x54d663['id'],'role':_0x54d663[_0x7115('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0x7115('0x34')](_0x36488b)['then'](function(_0x5cedf8){_0x50fe67[_0x7115('0x35')]({'id':_0x54d663['id'],'token':_0x5cedf8,'statusCall':'','isAlreadyLogged':_0x54d663[_0x7115('0x36')]});});}})(_0x4414f2,_0x50fe67,_0x2fb724);};exports[_0x7115('0x37')]=function(_0x4cc6fa,_0x3a15ea,_0x394dce){if(!_0x4cc6fa[_0x7115('0x38')][_0x7115('0x1f')]){return handleError(_0x3a15ea,0x1f4,{'message':_0x7115('0x39')});}var _0x12b6c6=rs[_0x7115('0x3a')]();_0x4cc6fa['body'][_0x7115('0x1f')]=_0x4cc6fa[_0x7115('0x38')][_0x7115('0x1f')][_0x7115('0x3b')]()['toLowerCase']();var _0x1d9c0a;return db['Setting'][_0x7115('0x8')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x7115('0x9')],'raw':!![]})[_0x7115('0xa')](function(_0x585143){_0x1d9c0a=_0x585143;return db[_0x7115('0x3c')][_0x7115('0x1e')]({'where':{'email':_0x4cc6fa['body'][_0x7115('0x1f')]}});})[_0x7115('0xa')](function(_0x1e6afc){if(!_0x1e6afc){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x1e6afc[_0x7115('0x16')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x1e6afc['blocked']){if(moment(_0x1e6afc[_0x7115('0x10')])[_0x7115('0x18')](_0x1d9c0a[_0x7115('0x9')],_0x7115('0x19'))>moment()){throw new Error(_0x7115('0x3d'));}else{_0x1e6afc[_0x7115('0xf')]=![];_0x1e6afc['blockedAt']=null;}}_0x1e6afc[_0x7115('0x3e')]=_0x12b6c6;_0x1e6afc[_0x7115('0x3f')]=Date['now']()+0x36ee80;return _0x1e6afc[_0x7115('0x40')]();})[_0x7115('0xa')](function(){return sendServiceMail({'to':_0x4cc6fa[_0x7115('0x38')][_0x7115('0x1f')],'subject':_0x7115('0x41'),'text':_0x7115('0x42')+_0x7115('0x43')+_0x7115('0x44')+_0x4cc6fa[_0x7115('0x45')][_0x7115('0x24')]+'/reset/'+_0x12b6c6+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})['then'](function(){_0x3a15ea[_0x7115('0x46')](0xc8)[_0x7115('0x31')]({'message':_0x7115('0x47')});})['catch'](function(_0x25d108){return handleError(_0x3a15ea,0x1f4,_0x25d108);});};exports['reset']=function(_0x1132c9,_0x1b8328,_0xd5b8c1){return db['User'][_0x7115('0x1e')]({'where':{'resetPasswordToken':_0x1132c9[_0x7115('0x48')][_0x7115('0x49')],'resetPasswordExpires':{'$gt':Date[_0x7115('0x4a')]()}}})['then'](function(_0x5cab2f){if(!_0x5cab2f){throw new Error(_0x7115('0x4b'));}return db[_0x7115('0x7')][_0x7115('0x8')]({'attributes':['id',_0x7115('0x4c'),_0x7115('0x4d'),'passwordHistoryLimit']})[_0x7115('0xa')](function(_0x515be4){if(_0x515be4[_0x7115('0x4c')])authService[_0x7115('0x4e')](_0x1132c9[_0x7115('0x38')][_0x7115('0xc')]);if(!_0x515be4[_0x7115('0x4d')]||!_0x5cab2f[_0x7115('0x4f')])return _0x5cab2f;authService[_0x7115('0x50')](_0x1132c9[_0x7115('0x38')][_0x7115('0xc')],_0x5cab2f[_0x7115('0x4f')],_0x515be4[_0x7115('0x51')]);return _0x5cab2f;})[_0x7115('0xa')](function(){_0x5cab2f[_0x7115('0xc')]=_0x1132c9[_0x7115('0x38')][_0x7115('0xc')];_0x5cab2f[_0x7115('0x3e')]=null;_0x5cab2f[_0x7115('0x3f')]=null;return _0x5cab2f[_0x7115('0x40')]();});})[_0x7115('0xa')](function(){_0x1b8328[_0x7115('0x46')](0xc8)[_0x7115('0x31')]({'message':_0x7115('0x52')});})[_0x7115('0x1c')](function(_0x390bff){return handleError(_0x1b8328,0x1f4,_0x390bff);});};passport[_0x7115('0x53')](new LocalStrategy({'usernameField':_0x7115('0xb'),'passwordField':_0x7115('0xc')},function(_0x14c207,_0x1ec478,_0x21b492){return localAuthenticate(db['User'],_0x14c207,_0x1ec478,_0x21b492);}));
\ No newline at end of file
index de3f997..88c64bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e3f=['post','login','forgot','/reset/:token','reset','exports','express','Router','./authLocal.controller'];(function(_0x17770f,_0x1cc11b){var _0x4dba75=function(_0x4aa697){while(--_0x4aa697){_0x17770f['push'](_0x17770f['shift']());}};_0x4dba75(++_0x1cc11b);}(_0x7e3f,0x96));var _0xf7e3=function(_0x29bfdc,_0x45b3ba){_0x29bfdc=_0x29bfdc-0x0;var _0x30eb0d=_0x7e3f[_0x29bfdc];return _0x30eb0d;};'use strict';var express=require(_0xf7e3('0x0'));var router=express[_0xf7e3('0x1')]();var controller=require(_0xf7e3('0x2'));router[_0xf7e3('0x3')]('/',controller[_0xf7e3('0x4')]);router[_0xf7e3('0x3')]('/forgot',controller[_0xf7e3('0x5')]);router['post'](_0xf7e3('0x6'),controller[_0xf7e3('0x7')]);module[_0xf7e3('0x8')]=router;
\ No newline at end of file
+var _0xe775=['/reset/:token','reset','exports','express','Router','post','login','/forgot','forgot'];(function(_0x335928,_0xded82b){var _0x59003f=function(_0x9ddb8c){while(--_0x9ddb8c){_0x335928['push'](_0x335928['shift']());}};_0x59003f(++_0xded82b);}(_0xe775,0xf6));var _0x5e77=function(_0x39cd3c,_0xa21102){_0x39cd3c=_0x39cd3c-0x0;var _0x47a0ae=_0xe775[_0x39cd3c];return _0x47a0ae;};'use strict';var express=require(_0x5e77('0x0'));var router=express[_0x5e77('0x1')]();var controller=require('./authLocal.controller');router[_0x5e77('0x2')]('/',controller[_0x5e77('0x3')]);router[_0x5e77('0x2')](_0x5e77('0x4'),controller[_0x5e77('0x5')]);router[_0x5e77('0x2')](_0x5e77('0x6'),controller[_0x5e77('0x7')]);module[_0x5e77('0x8')]=router;
\ No newline at end of file
index a4729db..c4ae32e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e5d=['sequelize','exports','STRING','BOOLEAN'];(function(_0x2736e4,_0x538134){var _0x46dfc9=function(_0x2f87aa){while(--_0x2f87aa){_0x2736e4['push'](_0x2736e4['shift']());}};_0x46dfc9(++_0x538134);}(_0x5e5d,0x1e0));var _0xd5e5=function(_0x3a3489,_0x39e658){_0x3a3489=_0x3a3489-0x0;var _0x17509f=_0x5e5d[_0x3a3489];return _0x17509f;};'use strict';var Sequelize=require(_0xd5e5('0x0'));module[_0xd5e5('0x1')]={'name':{'type':Sequelize[_0xd5e5('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xd5e5('0x2')]},'description':{'type':Sequelize[_0xd5e5('0x2')]},'status':{'type':Sequelize[_0xd5e5('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0x8b1c=['INTEGER','sequelize','STRING'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x8b1c,0x1ba));var _0xc8b1=function(_0x11cf2d,_0x1d80f5){_0x11cf2d=_0x11cf2d-0x0;var _0x4a4491=_0x8b1c[_0x11cf2d];return _0x4a4491;};'use strict';var Sequelize=require(_0xc8b1('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xc8b1('0x1')]},'description':{'type':Sequelize[_0xc8b1('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xc8b1('0x2')],'defaultValue':0xa}};
\ No newline at end of file
index cbbc532..e9aa115 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95d4=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','Automation','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','length','find','create','body','addConditions','Condition','findOne','getConditions','hasOwnProperty','addActions','Action','ids','getActions','eml-format'];(function(_0x21f3bf,_0xfb0f59){var _0x249d08=function(_0x37e6c2){while(--_0x37e6c2){_0x21f3bf['push'](_0x21f3bf['shift']());}};_0x249d08(++_0xfb0f59);}(_0x95d4,0x1e5));var _0x495d=function(_0x52dfa5,_0x3908fd){_0x52dfa5=_0x52dfa5-0x0;var _0x1eaf0b=_0x95d4[_0x52dfa5];return _0x1eaf0b;};'use strict';var emlformat=require(_0x495d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x495d('0x1'));var jsonpatch=require(_0x495d('0x2'));var rp=require(_0x495d('0x3'));var moment=require(_0x495d('0x4'));var BPromise=require(_0x495d('0x5'));var Mustache=require(_0x495d('0x6'));var util=require('util');var path=require(_0x495d('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x495d('0x8'));var _=require(_0x495d('0x9'));var squel=require(_0x495d('0xa'));var crypto=require(_0x495d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x495d('0xc'));var toCsv=require(_0x495d('0xd'));var querystring=require(_0x495d('0xe'));var Papa=require(_0x495d('0xf'));var Redis=require(_0x495d('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x495d('0x11'));var hardwareService=require(_0x495d('0x12'));var logger=require('../../config/logger')(_0x495d('0x13'));var utils=require(_0x495d('0x14'));var config=require(_0x495d('0x15'));var licenseUtil=require(_0x495d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a284d,_0x101459){_0x101459=_0x101459||0xcc;return function(_0x189ac4){if(_0x189ac4){return _0x3a284d['sendStatus'](_0x101459);}return _0x3a284d[_0x495d('0x17')](_0x101459)['end']();};}function respondWithResult(_0x269961,_0x193e0d){_0x193e0d=_0x193e0d||0xc8;return function(_0x5aacb1){if(_0x5aacb1){return _0x269961[_0x495d('0x17')](_0x193e0d)['json'](_0x5aacb1);}};}function respondWithFilteredResult(_0x3f513f,_0x1e81e3){return function(_0x346f84){if(_0x346f84){var _0xdfe913=typeof _0x1e81e3['offset']===_0x495d('0x18')&&typeof _0x1e81e3['limit']==='undefined';var _0xaa335b=_0x346f84[_0x495d('0x19')];var _0x2a524e=_0xdfe913?0x0:_0x1e81e3[_0x495d('0x1a')];var _0x12cd06=_0xdfe913?_0x346f84[_0x495d('0x19')]:_0x1e81e3[_0x495d('0x1a')]+_0x1e81e3['limit'];var _0x4beced;if(_0x12cd06>=_0xaa335b){_0x12cd06=_0xaa335b;_0x4beced=0xc8;}else{_0x4beced=0xce;}_0x3f513f[_0x495d('0x17')](_0x4beced);return _0x3f513f[_0x495d('0x1b')](_0x495d('0x1c'),_0x2a524e+'-'+_0x12cd06+'/'+_0xaa335b)['json'](_0x346f84);}return null;};}function patchUpdates(_0xb69183){return function(_0x1dade7){try{jsonpatch[_0x495d('0x1d')](_0x1dade7,_0xb69183,!![]);}catch(_0x4fc5a3){return BPromise[_0x495d('0x1e')](_0x4fc5a3);}return _0x1dade7[_0x495d('0x1f')]();};}function saveUpdates(_0x294530,_0x36c5ff){return function(_0x31f2a3){if(_0x31f2a3){return _0x31f2a3[_0x495d('0x20')](_0x294530)[_0x495d('0x21')](function(_0x3e3321){return _0x3e3321;});}return null;};}function removeEntity(_0x13d2da,_0x48dfe3){return function(_0x53789e){if(_0x53789e){return _0x53789e[_0x495d('0x22')]()['then'](function(){_0x13d2da[_0x495d('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fd2e4,_0x344986){return function(_0x153ea6){if(!_0x153ea6){_0x2fd2e4[_0x495d('0x23')](0x194);}return _0x153ea6;};}function handleError(_0x589348,_0x2e3ac4){_0x2e3ac4=_0x2e3ac4||0x1f4;return function(_0xc33034){logger[_0x495d('0x24')](_0xc33034[_0x495d('0x25')]);if(_0xc33034[_0x495d('0x26')]){delete _0xc33034[_0x495d('0x26')];}_0x589348[_0x495d('0x17')](_0x2e3ac4)['send'](_0xc33034);};}exports[_0x495d('0x27')]=function(_0x25e69e,_0x44f25c){var _0x1ea8bf={},_0x34129f={},_0x6d08f5={'count':0x0,'rows':[]};var _0xd94213=_[_0x495d('0x28')](db[_0x495d('0x29')][_0x495d('0x2a')],function(_0x108bc0){return{'name':_0x108bc0['fieldName'],'type':_0x108bc0[_0x495d('0x2b')][_0x495d('0x2c')]};});_0x34129f[_0x495d('0x2d')]=_[_0x495d('0x28')](_0xd94213,_0x495d('0x26'));_0x34129f[_0x495d('0x2e')]=_[_0x495d('0x2f')](_0x25e69e[_0x495d('0x2e')]);_0x34129f[_0x495d('0x30')]=_[_0x495d('0x31')](_0x34129f[_0x495d('0x2d')],_0x34129f[_0x495d('0x2e')]);_0x1ea8bf[_0x495d('0x32')]=_[_0x495d('0x31')](_0x34129f[_0x495d('0x2d')],qs[_0x495d('0x33')](_0x25e69e['query']['fields']));_0x1ea8bf[_0x495d('0x32')]=_0x1ea8bf[_0x495d('0x32')]['length']?_0x1ea8bf[_0x495d('0x32')]:_0x34129f['model'];if(!_0x25e69e[_0x495d('0x2e')]['hasOwnProperty'](_0x495d('0x34'))){_0x1ea8bf[_0x495d('0x35')]=qs[_0x495d('0x35')](_0x25e69e[_0x495d('0x2e')][_0x495d('0x35')]);_0x1ea8bf[_0x495d('0x1a')]=qs[_0x495d('0x1a')](_0x25e69e['query']['offset']);}_0x1ea8bf[_0x495d('0x36')]=qs[_0x495d('0x37')](_0x25e69e[_0x495d('0x2e')][_0x495d('0x37')]);_0x1ea8bf[_0x495d('0x38')]=qs[_0x495d('0x30')](_[_0x495d('0x39')](_0x25e69e[_0x495d('0x2e')],_0x34129f['filters']),_0xd94213);if(_0x25e69e[_0x495d('0x2e')][_0x495d('0x3a')]){_0x1ea8bf[_0x495d('0x38')]=_['merge'](_0x1ea8bf[_0x495d('0x38')],{'$or':_['map'](_0xd94213,function(_0x59c851){if(_0x59c851[_0x495d('0x2b')]!==_0x495d('0x3b')){var _0x36da17={};_0x36da17[_0x59c851[_0x495d('0x26')]]={'$like':'%'+_0x25e69e[_0x495d('0x2e')]['filter']+'%'};return _0x36da17;}})});}_0x1ea8bf=_[_0x495d('0x3c')]({},_0x1ea8bf,_0x25e69e[_0x495d('0x3d')]);var _0x30a790={'where':_0x1ea8bf[_0x495d('0x38')]};return db[_0x495d('0x29')][_0x495d('0x19')](_0x30a790)[_0x495d('0x21')](function(_0x588aae){_0x6d08f5[_0x495d('0x19')]=_0x588aae;if(_0x25e69e[_0x495d('0x2e')][_0x495d('0x3e')]){_0x1ea8bf[_0x495d('0x3f')]=[{'all':!![]}];}return db[_0x495d('0x29')]['findAll'](_0x1ea8bf);})[_0x495d('0x21')](function(_0x127c73){_0x6d08f5[_0x495d('0x40')]=_0x127c73;return _0x6d08f5;})[_0x495d('0x21')](respondWithFilteredResult(_0x44f25c,_0x1ea8bf))[_0x495d('0x41')](handleError(_0x44f25c,null));};exports[_0x495d('0x42')]=function(_0x46a8dd,_0x242e0d){var _0x4273b={'raw':![],'where':{'id':_0x46a8dd[_0x495d('0x43')]['id']}},_0x1e0669={};_0x1e0669[_0x495d('0x2d')]=_[_0x495d('0x2f')](db[_0x495d('0x29')][_0x495d('0x2a')]);_0x1e0669[_0x495d('0x2e')]=_['keys'](_0x46a8dd[_0x495d('0x2e')]);_0x1e0669[_0x495d('0x30')]=_[_0x495d('0x31')](_0x1e0669[_0x495d('0x2d')],_0x1e0669[_0x495d('0x2e')]);_0x4273b[_0x495d('0x32')]=_[_0x495d('0x31')](_0x1e0669['model'],qs[_0x495d('0x33')](_0x46a8dd[_0x495d('0x2e')][_0x495d('0x33')]));_0x4273b['attributes']=_0x4273b[_0x495d('0x32')][_0x495d('0x44')]?_0x4273b[_0x495d('0x32')]:_0x1e0669[_0x495d('0x2d')];if(_0x46a8dd[_0x495d('0x2e')][_0x495d('0x3e')]){_0x4273b[_0x495d('0x3f')]=[{'all':!![]}];}_0x4273b=_[_0x495d('0x3c')]({},_0x4273b,_0x46a8dd['options']);return db[_0x495d('0x29')][_0x495d('0x45')](_0x4273b)[_0x495d('0x21')](handleEntityNotFound(_0x242e0d,null))['then'](respondWithResult(_0x242e0d,null))[_0x495d('0x41')](handleError(_0x242e0d,null));};exports[_0x495d('0x46')]=function(_0x5b60a3,_0x51f6c9){return db[_0x495d('0x29')]['create'](_0x5b60a3[_0x495d('0x47')],{})[_0x495d('0x21')](respondWithResult(_0x51f6c9,0xc9))[_0x495d('0x41')](handleError(_0x51f6c9,null));};exports['update']=function(_0x38c950,_0x43c815){if(_0x38c950[_0x495d('0x47')]['id']){delete _0x38c950[_0x495d('0x47')]['id'];}return db[_0x495d('0x29')]['find']({'where':{'id':_0x38c950[_0x495d('0x43')]['id']}})[_0x495d('0x21')](handleEntityNotFound(_0x43c815,null))[_0x495d('0x21')](saveUpdates(_0x38c950[_0x495d('0x47')],null))[_0x495d('0x21')](respondWithResult(_0x43c815,null))['catch'](handleError(_0x43c815,null));};exports['destroy']=function(_0x272615,_0x29e1ed){return db[_0x495d('0x29')][_0x495d('0x45')]({'where':{'id':_0x272615['params']['id']}})['then'](handleEntityNotFound(_0x29e1ed,null))[_0x495d('0x21')](removeEntity(_0x29e1ed,null))[_0x495d('0x41')](handleError(_0x29e1ed,null));};exports[_0x495d('0x48')]=function(_0x2ca00d,_0x4624b3,_0x43dcc1){return db[_0x495d('0x49')][_0x495d('0x45')]({'where':{'id':_0x2ca00d[_0x495d('0x43')]['id']}})[_0x495d('0x21')](handleEntityNotFound(_0x4624b3,null))[_0x495d('0x21')](function(_0x204a0b){if(_0x204a0b){return _0x204a0b[_0x495d('0x48')](_0x2ca00d[_0x495d('0x47')]['ids'],_['omit'](_0x2ca00d[_0x495d('0x47')],['ids','id'])||{});}})[_0x495d('0x21')](respondWithResult(_0x4624b3,null))[_0x495d('0x41')](handleError(_0x4624b3,null));};exports['getConditions']=function(_0x2544e6,_0x40c549,_0x28e756){var _0x5e9f5c={};var _0x5ab855={};var _0x5e1d8b;var _0x217767;return db[_0x495d('0x29')][_0x495d('0x4a')]({'where':{'id':_0x2544e6['params']['id']}})['then'](handleEntityNotFound(_0x40c549,null))[_0x495d('0x21')](function(_0x340158){if(_0x340158){_0x5e1d8b=_0x340158;_0x5ab855[_0x495d('0x2d')]=_[_0x495d('0x2f')](db[_0x495d('0x49')][_0x495d('0x2a')]);_0x5ab855[_0x495d('0x2e')]=_[_0x495d('0x2f')](_0x2544e6[_0x495d('0x2e')]);_0x5ab855[_0x495d('0x30')]=_[_0x495d('0x31')](_0x5ab855[_0x495d('0x2d')],_0x5ab855[_0x495d('0x2e')]);_0x5e9f5c[_0x495d('0x32')]=_['intersection'](_0x5ab855['model'],qs['fields'](_0x2544e6[_0x495d('0x2e')][_0x495d('0x33')]));_0x5e9f5c[_0x495d('0x32')]=_0x5e9f5c[_0x495d('0x32')][_0x495d('0x44')]?_0x5e9f5c[_0x495d('0x32')]:_0x5ab855[_0x495d('0x2d')];_0x5e9f5c[_0x495d('0x36')]=qs[_0x495d('0x37')](_0x2544e6['query'][_0x495d('0x37')]);_0x5e9f5c[_0x495d('0x38')]=qs['filters'](_[_0x495d('0x39')](_0x2544e6['query'],_0x5ab855[_0x495d('0x30')]));if(_0x2544e6[_0x495d('0x2e')][_0x495d('0x3a')]){_0x5e9f5c['where']=_['merge'](_0x5e9f5c[_0x495d('0x38')],{'$or':_[_0x495d('0x28')](_0x5e9f5c[_0x495d('0x32')],function(_0x1ed53b){var _0x1851a8={};_0x1851a8[_0x1ed53b]={'$like':'%'+_0x2544e6[_0x495d('0x2e')]['filter']+'%'};return _0x1851a8;})});}_0x5e9f5c=_[_0x495d('0x3c')]({},_0x5e9f5c,_0x2544e6[_0x495d('0x3d')]);return _0x5e1d8b[_0x495d('0x4b')](_0x5e9f5c);}})[_0x495d('0x21')](function(_0x5dbf7b){if(_0x5dbf7b){_0x217767=_0x5dbf7b[_0x495d('0x44')];if(!_0x2544e6[_0x495d('0x2e')][_0x495d('0x4c')]('nolimit')){_0x5e9f5c[_0x495d('0x35')]=qs[_0x495d('0x35')](_0x2544e6[_0x495d('0x2e')][_0x495d('0x35')]);_0x5e9f5c[_0x495d('0x1a')]=qs[_0x495d('0x1a')](_0x2544e6[_0x495d('0x2e')][_0x495d('0x1a')]);}return _0x5e1d8b[_0x495d('0x4b')](_0x5e9f5c);}})['then'](function(_0x1df59a){if(_0x1df59a){return _0x1df59a?{'count':_0x217767,'rows':_0x1df59a}:null;}})[_0x495d('0x21')](respondWithResult(_0x40c549,null))[_0x495d('0x41')](handleError(_0x40c549,null));};exports[_0x495d('0x4d')]=function(_0x195427,_0x149d46,_0x1cadd2){return db[_0x495d('0x4e')][_0x495d('0x45')]({'where':{'id':_0x195427[_0x495d('0x43')]['id']}})[_0x495d('0x21')](handleEntityNotFound(_0x149d46,null))['then'](function(_0x3cfd4f){if(_0x3cfd4f){return _0x3cfd4f[_0x495d('0x4d')](_0x195427[_0x495d('0x47')]['ids'],_['omit'](_0x195427[_0x495d('0x47')],[_0x495d('0x4f'),'id'])||{});}})[_0x495d('0x21')](respondWithResult(_0x149d46,null))['catch'](handleError(_0x149d46,null));};exports[_0x495d('0x50')]=function(_0x2719e1,_0x4bf044,_0x49fd66){var _0x33d8b1={};var _0x1f25a0={};var _0xa5b976;var _0x4da161;return db[_0x495d('0x29')][_0x495d('0x4a')]({'where':{'id':_0x2719e1[_0x495d('0x43')]['id']}})[_0x495d('0x21')](handleEntityNotFound(_0x4bf044,null))[_0x495d('0x21')](function(_0x4a2506){if(_0x4a2506){_0xa5b976=_0x4a2506;_0x1f25a0['model']=_['keys'](db['Action'][_0x495d('0x2a')]);_0x1f25a0[_0x495d('0x2e')]=_[_0x495d('0x2f')](_0x2719e1[_0x495d('0x2e')]);_0x1f25a0[_0x495d('0x30')]=_['intersection'](_0x1f25a0[_0x495d('0x2d')],_0x1f25a0[_0x495d('0x2e')]);_0x33d8b1[_0x495d('0x32')]=_[_0x495d('0x31')](_0x1f25a0[_0x495d('0x2d')],qs[_0x495d('0x33')](_0x2719e1['query'][_0x495d('0x33')]));_0x33d8b1['attributes']=_0x33d8b1[_0x495d('0x32')]['length']?_0x33d8b1[_0x495d('0x32')]:_0x1f25a0[_0x495d('0x2d')];_0x33d8b1[_0x495d('0x36')]=qs['sort'](_0x2719e1['query'][_0x495d('0x37')]);_0x33d8b1[_0x495d('0x38')]=qs[_0x495d('0x30')](_['pick'](_0x2719e1[_0x495d('0x2e')],_0x1f25a0[_0x495d('0x30')]));if(_0x2719e1[_0x495d('0x2e')][_0x495d('0x3a')]){_0x33d8b1[_0x495d('0x38')]=_[_0x495d('0x3c')](_0x33d8b1['where'],{'$or':_[_0x495d('0x28')](_0x33d8b1[_0x495d('0x32')],function(_0x2835c7){var _0x12cf10={};_0x12cf10[_0x2835c7]={'$like':'%'+_0x2719e1['query'][_0x495d('0x3a')]+'%'};return _0x12cf10;})});}_0x33d8b1=_[_0x495d('0x3c')]({},_0x33d8b1,_0x2719e1[_0x495d('0x3d')]);return _0xa5b976['getActions'](_0x33d8b1);}})[_0x495d('0x21')](function(_0x1fcbeb){if(_0x1fcbeb){_0x4da161=_0x1fcbeb['length'];if(!_0x2719e1[_0x495d('0x2e')][_0x495d('0x4c')](_0x495d('0x34'))){_0x33d8b1[_0x495d('0x35')]=qs[_0x495d('0x35')](_0x2719e1[_0x495d('0x2e')]['limit']);_0x33d8b1['offset']=qs[_0x495d('0x1a')](_0x2719e1['query']['offset']);}return _0xa5b976['getActions'](_0x33d8b1);}})[_0x495d('0x21')](function(_0x1082c3){if(_0x1082c3){return _0x1082c3?{'count':_0x4da161,'rows':_0x1082c3}:null;}})[_0x495d('0x21')](respondWithResult(_0x4bf044,null))[_0x495d('0x41')](handleError(_0x4bf044,null));};
\ No newline at end of file
+var _0x7f50=['getActions','findOne','Action','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','json','reject','then','destroy','stack','name','map','Automation','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','addConditions','Condition','ids','omit','getConditions','order','addActions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7f50,0xa6));var _0x07f5=function(_0x4f083f,_0x57653a){_0x4f083f=_0x4f083f-0x0;var _0x5a52ea=_0x7f50[_0x4f083f];return _0x5a52ea;};'use strict';var emlformat=require(_0x07f5('0x0'));var rimraf=require(_0x07f5('0x1'));var zipdir=require(_0x07f5('0x2'));var jsonpatch=require(_0x07f5('0x3'));var rp=require(_0x07f5('0x4'));var moment=require(_0x07f5('0x5'));var BPromise=require(_0x07f5('0x6'));var Mustache=require(_0x07f5('0x7'));var util=require('util');var path=require(_0x07f5('0x8'));var sox=require(_0x07f5('0x9'));var csv=require(_0x07f5('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x07f5('0xb'));var _=require(_0x07f5('0xc'));var squel=require(_0x07f5('0xd'));var crypto=require(_0x07f5('0xe'));var jsforce=require(_0x07f5('0xf'));var deskjs=require(_0x07f5('0x10'));var toCsv=require(_0x07f5('0xa'));var querystring=require(_0x07f5('0x11'));var Papa=require('papaparse');var Redis=require(_0x07f5('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x07f5('0x13'));var as=require(_0x07f5('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x07f5('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x07f5('0x16'));var licenseUtil=require(_0x07f5('0x17'));var db=require(_0x07f5('0x18'))['db'];function respondWithStatusCode(_0x37289e,_0x23b195){_0x23b195=_0x23b195||0xcc;return function(_0x4485ae){if(_0x4485ae){return _0x37289e['sendStatus'](_0x23b195);}return _0x37289e[_0x07f5('0x19')](_0x23b195)[_0x07f5('0x1a')]();};}function respondWithResult(_0x3ff44c,_0x166594){_0x166594=_0x166594||0xc8;return function(_0x3fd4c8){if(_0x3fd4c8){return _0x3ff44c[_0x07f5('0x19')](_0x166594)['json'](_0x3fd4c8);}};}function respondWithFilteredResult(_0x357333,_0x4e1c46){return function(_0x2dca26){if(_0x2dca26){var _0xd7dd2=typeof _0x4e1c46[_0x07f5('0x1b')]===_0x07f5('0x1c')&&typeof _0x4e1c46[_0x07f5('0x1d')]===_0x07f5('0x1c');var _0x5457e8=_0x2dca26[_0x07f5('0x1e')];var _0x471055=_0xd7dd2?0x0:_0x4e1c46[_0x07f5('0x1b')];var _0x1b1e2d=_0xd7dd2?_0x2dca26[_0x07f5('0x1e')]:_0x4e1c46[_0x07f5('0x1b')]+_0x4e1c46[_0x07f5('0x1d')];var _0x5b22da;if(_0x1b1e2d>=_0x5457e8){_0x1b1e2d=_0x5457e8;_0x5b22da=0xc8;}else{_0x5b22da=0xce;}_0x357333[_0x07f5('0x19')](_0x5b22da);return _0x357333[_0x07f5('0x1f')]('Content-Range',_0x471055+'-'+_0x1b1e2d+'/'+_0x5457e8)[_0x07f5('0x20')](_0x2dca26);}return null;};}function patchUpdates(_0x4bf616){return function(_0x3d3594){try{jsonpatch['apply'](_0x3d3594,_0x4bf616,!![]);}catch(_0x713b97){return BPromise[_0x07f5('0x21')](_0x713b97);}return _0x3d3594['save']();};}function saveUpdates(_0xd60d0e,_0x2fac65){return function(_0x1f7590){if(_0x1f7590){return _0x1f7590['update'](_0xd60d0e)[_0x07f5('0x22')](function(_0x5a7f9f){return _0x5a7f9f;});}return null;};}function removeEntity(_0x3c9575,_0x3c59bd){return function(_0x310b10){if(_0x310b10){return _0x310b10[_0x07f5('0x23')]()[_0x07f5('0x22')](function(){_0x3c9575[_0x07f5('0x19')](0xcc)[_0x07f5('0x1a')]();});}};}function handleEntityNotFound(_0x2b7381,_0x6b4610){return function(_0x11cd8e){if(!_0x11cd8e){_0x2b7381['sendStatus'](0x194);}return _0x11cd8e;};}function handleError(_0x33fe2c,_0x285f2a){_0x285f2a=_0x285f2a||0x1f4;return function(_0xcca770){logger['error'](_0xcca770[_0x07f5('0x24')]);if(_0xcca770[_0x07f5('0x25')]){delete _0xcca770['name'];}_0x33fe2c[_0x07f5('0x19')](_0x285f2a)['send'](_0xcca770);};}exports['index']=function(_0x116155,_0x33589d){var _0x457d8a={},_0x17bbad={},_0x1b6cd2={'count':0x0,'rows':[]};var _0x51989d=_[_0x07f5('0x26')](db[_0x07f5('0x27')]['rawAttributes'],function(_0x513876){return{'name':_0x513876[_0x07f5('0x28')],'type':_0x513876[_0x07f5('0x29')][_0x07f5('0x2a')]};});_0x17bbad[_0x07f5('0x2b')]=_['map'](_0x51989d,_0x07f5('0x25'));_0x17bbad[_0x07f5('0x2c')]=_[_0x07f5('0x2d')](_0x116155[_0x07f5('0x2c')]);_0x17bbad['filters']=_[_0x07f5('0x2e')](_0x17bbad[_0x07f5('0x2b')],_0x17bbad[_0x07f5('0x2c')]);_0x457d8a[_0x07f5('0x2f')]=_[_0x07f5('0x2e')](_0x17bbad['model'],qs['fields'](_0x116155['query'][_0x07f5('0x30')]));_0x457d8a[_0x07f5('0x2f')]=_0x457d8a[_0x07f5('0x2f')][_0x07f5('0x31')]?_0x457d8a['attributes']:_0x17bbad[_0x07f5('0x2b')];if(!_0x116155[_0x07f5('0x2c')][_0x07f5('0x32')](_0x07f5('0x33'))){_0x457d8a['limit']=qs[_0x07f5('0x1d')](_0x116155[_0x07f5('0x2c')][_0x07f5('0x1d')]);_0x457d8a[_0x07f5('0x1b')]=qs[_0x07f5('0x1b')](_0x116155[_0x07f5('0x2c')][_0x07f5('0x1b')]);}_0x457d8a['order']=qs[_0x07f5('0x34')](_0x116155[_0x07f5('0x2c')][_0x07f5('0x34')]);_0x457d8a[_0x07f5('0x35')]=qs[_0x07f5('0x36')](_['pick'](_0x116155[_0x07f5('0x2c')],_0x17bbad['filters']),_0x51989d);if(_0x116155[_0x07f5('0x2c')][_0x07f5('0x37')]){_0x457d8a[_0x07f5('0x35')]=_[_0x07f5('0x38')](_0x457d8a[_0x07f5('0x35')],{'$or':_[_0x07f5('0x26')](_0x51989d,function(_0x5828fb){if(_0x5828fb['type']!==_0x07f5('0x39')){var _0x547774={};_0x547774[_0x5828fb[_0x07f5('0x25')]]={'$like':'%'+_0x116155[_0x07f5('0x2c')][_0x07f5('0x37')]+'%'};return _0x547774;}})});}_0x457d8a=_[_0x07f5('0x38')]({},_0x457d8a,_0x116155[_0x07f5('0x3a')]);var _0x536a44={'where':_0x457d8a[_0x07f5('0x35')]};return db[_0x07f5('0x27')]['count'](_0x536a44)[_0x07f5('0x22')](function(_0x2c7a1a){_0x1b6cd2[_0x07f5('0x1e')]=_0x2c7a1a;if(_0x116155[_0x07f5('0x2c')][_0x07f5('0x3b')]){_0x457d8a[_0x07f5('0x3c')]=[{'all':!![]}];}return db[_0x07f5('0x27')][_0x07f5('0x3d')](_0x457d8a);})[_0x07f5('0x22')](function(_0x377bb8){_0x1b6cd2[_0x07f5('0x3e')]=_0x377bb8;return _0x1b6cd2;})[_0x07f5('0x22')](respondWithFilteredResult(_0x33589d,_0x457d8a))[_0x07f5('0x3f')](handleError(_0x33589d,null));};exports[_0x07f5('0x40')]=function(_0x441de9,_0x192597){var _0x5ab51d={'raw':![],'where':{'id':_0x441de9[_0x07f5('0x41')]['id']}},_0x8adb86={};_0x8adb86[_0x07f5('0x2b')]=_['keys'](db[_0x07f5('0x27')][_0x07f5('0x42')]);_0x8adb86['query']=_[_0x07f5('0x2d')](_0x441de9[_0x07f5('0x2c')]);_0x8adb86[_0x07f5('0x36')]=_[_0x07f5('0x2e')](_0x8adb86[_0x07f5('0x2b')],_0x8adb86[_0x07f5('0x2c')]);_0x5ab51d['attributes']=_['intersection'](_0x8adb86['model'],qs[_0x07f5('0x30')](_0x441de9['query'][_0x07f5('0x30')]));_0x5ab51d['attributes']=_0x5ab51d['attributes'][_0x07f5('0x31')]?_0x5ab51d[_0x07f5('0x2f')]:_0x8adb86[_0x07f5('0x2b')];if(_0x441de9['query'][_0x07f5('0x3b')]){_0x5ab51d['include']=[{'all':!![]}];}_0x5ab51d=_[_0x07f5('0x38')]({},_0x5ab51d,_0x441de9['options']);return db[_0x07f5('0x27')][_0x07f5('0x43')](_0x5ab51d)['then'](handleEntityNotFound(_0x192597,null))[_0x07f5('0x22')](respondWithResult(_0x192597,null))['catch'](handleError(_0x192597,null));};exports[_0x07f5('0x44')]=function(_0x239bb6,_0xabf5a0){return db[_0x07f5('0x27')]['create'](_0x239bb6['body'],{})[_0x07f5('0x22')](respondWithResult(_0xabf5a0,0xc9))[_0x07f5('0x3f')](handleError(_0xabf5a0,null));};exports['update']=function(_0x513275,_0x582a61){if(_0x513275[_0x07f5('0x45')]['id']){delete _0x513275[_0x07f5('0x45')]['id'];}return db[_0x07f5('0x27')]['find']({'where':{'id':_0x513275[_0x07f5('0x41')]['id']}})['then'](handleEntityNotFound(_0x582a61,null))[_0x07f5('0x22')](saveUpdates(_0x513275[_0x07f5('0x45')],null))['then'](respondWithResult(_0x582a61,null))[_0x07f5('0x3f')](handleError(_0x582a61,null));};exports['destroy']=function(_0x391e15,_0x13a5f8){return db['Automation'][_0x07f5('0x43')]({'where':{'id':_0x391e15[_0x07f5('0x41')]['id']}})[_0x07f5('0x22')](handleEntityNotFound(_0x13a5f8,null))[_0x07f5('0x22')](removeEntity(_0x13a5f8,null))['catch'](handleError(_0x13a5f8,null));};exports[_0x07f5('0x46')]=function(_0x494705,_0x815b58,_0x17c703){return db[_0x07f5('0x47')][_0x07f5('0x43')]({'where':{'id':_0x494705[_0x07f5('0x41')]['id']}})['then'](handleEntityNotFound(_0x815b58,null))[_0x07f5('0x22')](function(_0x28ca95){if(_0x28ca95){return _0x28ca95[_0x07f5('0x46')](_0x494705[_0x07f5('0x45')][_0x07f5('0x48')],_[_0x07f5('0x49')](_0x494705[_0x07f5('0x45')],[_0x07f5('0x48'),'id'])||{});}})[_0x07f5('0x22')](respondWithResult(_0x815b58,null))[_0x07f5('0x3f')](handleError(_0x815b58,null));};exports[_0x07f5('0x4a')]=function(_0x37fa51,_0x5e3274,_0x4bc791){var _0x13a55b={};var _0x3f7aea={};var _0x44f935;var _0x349dac;return db[_0x07f5('0x27')]['findOne']({'where':{'id':_0x37fa51['params']['id']}})[_0x07f5('0x22')](handleEntityNotFound(_0x5e3274,null))[_0x07f5('0x22')](function(_0x5e2bdc){if(_0x5e2bdc){_0x44f935=_0x5e2bdc;_0x3f7aea[_0x07f5('0x2b')]=_[_0x07f5('0x2d')](db[_0x07f5('0x47')][_0x07f5('0x42')]);_0x3f7aea['query']=_[_0x07f5('0x2d')](_0x37fa51[_0x07f5('0x2c')]);_0x3f7aea[_0x07f5('0x36')]=_[_0x07f5('0x2e')](_0x3f7aea[_0x07f5('0x2b')],_0x3f7aea[_0x07f5('0x2c')]);_0x13a55b[_0x07f5('0x2f')]=_[_0x07f5('0x2e')](_0x3f7aea[_0x07f5('0x2b')],qs[_0x07f5('0x30')](_0x37fa51[_0x07f5('0x2c')][_0x07f5('0x30')]));_0x13a55b[_0x07f5('0x2f')]=_0x13a55b['attributes'][_0x07f5('0x31')]?_0x13a55b[_0x07f5('0x2f')]:_0x3f7aea['model'];_0x13a55b[_0x07f5('0x4b')]=qs[_0x07f5('0x34')](_0x37fa51['query'][_0x07f5('0x34')]);_0x13a55b[_0x07f5('0x35')]=qs[_0x07f5('0x36')](_['pick'](_0x37fa51[_0x07f5('0x2c')],_0x3f7aea[_0x07f5('0x36')]));if(_0x37fa51[_0x07f5('0x2c')][_0x07f5('0x37')]){_0x13a55b['where']=_[_0x07f5('0x38')](_0x13a55b['where'],{'$or':_['map'](_0x13a55b['attributes'],function(_0x58eadd){var _0x58f327={};_0x58f327[_0x58eadd]={'$like':'%'+_0x37fa51[_0x07f5('0x2c')][_0x07f5('0x37')]+'%'};return _0x58f327;})});}_0x13a55b=_[_0x07f5('0x38')]({},_0x13a55b,_0x37fa51[_0x07f5('0x3a')]);return _0x44f935[_0x07f5('0x4a')](_0x13a55b);}})['then'](function(_0x52554e){if(_0x52554e){_0x349dac=_0x52554e['length'];if(!_0x37fa51[_0x07f5('0x2c')][_0x07f5('0x32')](_0x07f5('0x33'))){_0x13a55b[_0x07f5('0x1d')]=qs[_0x07f5('0x1d')](_0x37fa51[_0x07f5('0x2c')][_0x07f5('0x1d')]);_0x13a55b['offset']=qs[_0x07f5('0x1b')](_0x37fa51['query'][_0x07f5('0x1b')]);}return _0x44f935[_0x07f5('0x4a')](_0x13a55b);}})['then'](function(_0x53493f){if(_0x53493f){return _0x53493f?{'count':_0x349dac,'rows':_0x53493f}:null;}})[_0x07f5('0x22')](respondWithResult(_0x5e3274,null))[_0x07f5('0x3f')](handleError(_0x5e3274,null));};exports[_0x07f5('0x4c')]=function(_0x2da9ff,_0x28b968,_0x58abdb){return db['Action']['find']({'where':{'id':_0x2da9ff[_0x07f5('0x41')]['id']}})[_0x07f5('0x22')](handleEntityNotFound(_0x28b968,null))[_0x07f5('0x22')](function(_0x39a24c){if(_0x39a24c){return _0x39a24c[_0x07f5('0x4c')](_0x2da9ff[_0x07f5('0x45')]['ids'],_[_0x07f5('0x49')](_0x2da9ff[_0x07f5('0x45')],[_0x07f5('0x48'),'id'])||{});}})['then'](respondWithResult(_0x28b968,null))[_0x07f5('0x3f')](handleError(_0x28b968,null));};exports[_0x07f5('0x4d')]=function(_0xd41944,_0x42d356,_0xf4ec6b){var _0x279cff={};var _0x12d6e1={};var _0x1d0ed1;var _0x3efdae;return db[_0x07f5('0x27')][_0x07f5('0x4e')]({'where':{'id':_0xd41944[_0x07f5('0x41')]['id']}})[_0x07f5('0x22')](handleEntityNotFound(_0x42d356,null))[_0x07f5('0x22')](function(_0x4b01df){if(_0x4b01df){_0x1d0ed1=_0x4b01df;_0x12d6e1[_0x07f5('0x2b')]=_[_0x07f5('0x2d')](db[_0x07f5('0x4f')][_0x07f5('0x42')]);_0x12d6e1['query']=_[_0x07f5('0x2d')](_0xd41944[_0x07f5('0x2c')]);_0x12d6e1['filters']=_[_0x07f5('0x2e')](_0x12d6e1['model'],_0x12d6e1[_0x07f5('0x2c')]);_0x279cff[_0x07f5('0x2f')]=_[_0x07f5('0x2e')](_0x12d6e1[_0x07f5('0x2b')],qs['fields'](_0xd41944[_0x07f5('0x2c')]['fields']));_0x279cff[_0x07f5('0x2f')]=_0x279cff[_0x07f5('0x2f')][_0x07f5('0x31')]?_0x279cff[_0x07f5('0x2f')]:_0x12d6e1[_0x07f5('0x2b')];_0x279cff[_0x07f5('0x4b')]=qs[_0x07f5('0x34')](_0xd41944['query'][_0x07f5('0x34')]);_0x279cff[_0x07f5('0x35')]=qs[_0x07f5('0x36')](_[_0x07f5('0x50')](_0xd41944[_0x07f5('0x2c')],_0x12d6e1[_0x07f5('0x36')]));if(_0xd41944[_0x07f5('0x2c')][_0x07f5('0x37')]){_0x279cff[_0x07f5('0x35')]=_[_0x07f5('0x38')](_0x279cff[_0x07f5('0x35')],{'$or':_['map'](_0x279cff['attributes'],function(_0x362cd4){var _0x140768={};_0x140768[_0x362cd4]={'$like':'%'+_0xd41944[_0x07f5('0x2c')][_0x07f5('0x37')]+'%'};return _0x140768;})});}_0x279cff=_[_0x07f5('0x38')]({},_0x279cff,_0xd41944[_0x07f5('0x3a')]);return _0x1d0ed1[_0x07f5('0x4d')](_0x279cff);}})['then'](function(_0x332204){if(_0x332204){_0x3efdae=_0x332204[_0x07f5('0x31')];if(!_0xd41944['query']['hasOwnProperty']('nolimit')){_0x279cff[_0x07f5('0x1d')]=qs[_0x07f5('0x1d')](_0xd41944[_0x07f5('0x2c')][_0x07f5('0x1d')]);_0x279cff[_0x07f5('0x1b')]=qs[_0x07f5('0x1b')](_0xd41944[_0x07f5('0x2c')][_0x07f5('0x1b')]);}return _0x1d0ed1[_0x07f5('0x4d')](_0x279cff);}})['then'](function(_0x21f47d){if(_0x21f47d){return _0x21f47d?{'count':_0x3efdae,'rows':_0x21f47d}:null;}})[_0x07f5('0x22')](respondWithResult(_0x42d356,null))[_0x07f5('0x3f')](handleError(_0x42d356,null));};
\ No newline at end of file
index 9e27ed5..0e4f31c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6edc=['rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x2d2a8d,_0x596fd6){var _0x4de305=function(_0x5c3e69){while(--_0x5c3e69){_0x2d2a8d['push'](_0x2d2a8d['shift']());}};_0x4de305(++_0x596fd6);}(_0x6edc,0xbd));var _0xc6ed=function(_0x1340a2,_0x26b995){_0x1340a2=_0x1340a2-0x0;var _0x550fc1=_0x6edc[_0x1340a2];return _0x550fc1;};'use strict';var _=require(_0xc6ed('0x0'));var util=require('util');var logger=require(_0xc6ed('0x1'))(_0xc6ed('0x2'));var moment=require(_0xc6ed('0x3'));var BPromise=require('bluebird');var rp=require(_0xc6ed('0x4'));var fs=require('fs');var path=require(_0xc6ed('0x5'));var rimraf=require(_0xc6ed('0x6'));var config=require(_0xc6ed('0x7'));var attributes=require(_0xc6ed('0x8'));module[_0xc6ed('0x9')]=function(_0x1979c8,_0x20030a){return _0x1979c8[_0xc6ed('0xa')](_0xc6ed('0xb'),attributes,{'tableName':_0xc6ed('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x89c7=['request-promise','path','rimraf','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','../../config/logger','api','bluebird'];(function(_0x34daef,_0xc94fd2){var _0x50a193=function(_0x1c8956){while(--_0x1c8956){_0x34daef['push'](_0x34daef['shift']());}};_0x50a193(++_0xc94fd2);}(_0x89c7,0x19b));var _0x789c=function(_0x385eee,_0x270cca){_0x385eee=_0x385eee-0x0;var _0x41fd49=_0x89c7[_0x385eee];return _0x41fd49;};'use strict';var _=require(_0x789c('0x0'));var util=require(_0x789c('0x1'));var logger=require(_0x789c('0x2'))(_0x789c('0x3'));var moment=require('moment');var BPromise=require(_0x789c('0x4'));var rp=require(_0x789c('0x5'));var fs=require('fs');var path=require(_0x789c('0x6'));var rimraf=require(_0x789c('0x7'));var config=require('../../config/environment');var attributes=require(_0x789c('0x8'));module[_0x789c('0x9')]=function(_0xd73693,_0x1bfb09){return _0xd73693[_0x789c('0xa')](_0x789c('0xb'),attributes,{'tableName':_0x789c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 46ac400..43aaec2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72a1=['jayson/promise','http','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x72a1,0x1ce));var _0x172a=function(_0x19c1ce,_0x15b196){_0x19c1ce=_0x19c1ce-0x0;var _0x3a7f6e=_0x72a1[_0x19c1ce];return _0x3a7f6e;};'use strict';var _=require('lodash');var util=require(_0x172a('0x0'));var moment=require('moment');var BPromise=require(_0x172a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x172a('0x2'));var db=require(_0x172a('0x3'))['db'];var utils=require(_0x172a('0x4'));var logger=require('../../config/logger')(_0x172a('0x5'));var config=require('../../config/environment');var jayson=require(_0x172a('0x6'));var client=jayson['client'][_0x172a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4859e1,_0x15e050,_0x5bf691){return new BPromise(function(_0x1164c1,_0x3efa61){return client['request'](_0x4859e1,_0x5bf691)[_0x172a('0x8')](function(_0x4928a6){logger[_0x172a('0x9')](_0x172a('0xa'),_0x15e050,_0x172a('0xb'));logger['debug'](_0x172a('0xc'),_0x15e050,_0x172a('0xb'),JSON[_0x172a('0xd')](_0x4928a6));if(_0x4928a6[_0x172a('0xe')]){if(_0x4928a6[_0x172a('0xe')]['code']===0x1f4){logger[_0x172a('0xe')](_0x172a('0xa'),_0x15e050,_0x4928a6[_0x172a('0xe')][_0x172a('0xf')]);return _0x3efa61(_0x4928a6['error'][_0x172a('0xf')]);}logger[_0x172a('0xe')](_0x172a('0xa'),_0x15e050,_0x4928a6['error'][_0x172a('0xf')]);return _0x1164c1(_0x4928a6[_0x172a('0xe')][_0x172a('0xf')]);}else{logger[_0x172a('0x9')]('Automation,\x20%s,\x20%s',_0x15e050,_0x172a('0xb'));_0x1164c1(_0x4928a6[_0x172a('0x10')]['message']);}})[_0x172a('0x11')](function(_0x489d1c){logger[_0x172a('0xe')](_0x172a('0xa'),_0x15e050,_0x489d1c);_0x3efa61(_0x489d1c);});});}
\ No newline at end of file
+var _0xbee0=['http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client'];(function(_0x3e478c,_0x152670){var _0x29ef89=function(_0x3d0d77){while(--_0x3d0d77){_0x3e478c['push'](_0x3e478c['shift']());}};_0x29ef89(++_0x152670);}(_0xbee0,0x147));var _0x0bee=function(_0x2a4a83,_0x5874a2){_0x2a4a83=_0x2a4a83-0x0;var _0x2934d3=_0xbee0[_0x2a4a83];return _0x2934d3;};'use strict';var _=require('lodash');var util=require(_0x0bee('0x0'));var moment=require(_0x0bee('0x1'));var BPromise=require(_0x0bee('0x2'));var rs=require(_0x0bee('0x3'));var fs=require('fs');var Redis=require(_0x0bee('0x4'));var db=require(_0x0bee('0x5'))['db'];var utils=require(_0x0bee('0x6'));var logger=require(_0x0bee('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0bee('0x8')][_0x0bee('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e499b,_0x430f89,_0x498d63){return new BPromise(function(_0x163a08,_0x123424){return client[_0x0bee('0xa')](_0x3e499b,_0x498d63)[_0x0bee('0xb')](function(_0x53a9af){logger[_0x0bee('0xc')](_0x0bee('0xd'),_0x430f89,_0x0bee('0xe'));logger[_0x0bee('0xf')](_0x0bee('0x10'),_0x430f89,_0x0bee('0xe'),JSON[_0x0bee('0x11')](_0x53a9af));if(_0x53a9af['error']){if(_0x53a9af[_0x0bee('0x12')]['code']===0x1f4){logger[_0x0bee('0x12')](_0x0bee('0xd'),_0x430f89,_0x53a9af[_0x0bee('0x12')][_0x0bee('0x13')]);return _0x123424(_0x53a9af[_0x0bee('0x12')][_0x0bee('0x13')]);}logger['error']('Automation,\x20%s,\x20%s',_0x430f89,_0x53a9af['error'][_0x0bee('0x13')]);return _0x163a08(_0x53a9af[_0x0bee('0x12')][_0x0bee('0x13')]);}else{logger[_0x0bee('0xc')]('Automation,\x20%s,\x20%s',_0x430f89,'request\x20sent');_0x163a08(_0x53a9af['result'][_0x0bee('0x13')]);}})[_0x0bee('0x14')](function(_0x50786a){logger[_0x0bee('0x12')](_0x0bee('0xd'),_0x430f89,_0x50786a);_0x123424(_0x50786a);});});}
\ No newline at end of file
index b57e9c6..fce36ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5cd7=['../../config/environment','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','update','delete','/:id','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1e1279,_0x3dd8ca){var _0x175c1a=function(_0x109386){while(--_0x109386){_0x1e1279['push'](_0x1e1279['shift']());}};_0x175c1a(++_0x3dd8ca);}(_0x5cd7,0x102));var _0x75cd=function(_0x46f1a6,_0xc7a582){_0x46f1a6=_0x46f1a6-0x0;var _0x38429a=_0x5cd7[_0x46f1a6];return _0x38429a;};'use strict';var multer=require(_0x75cd('0x0'));var util=require('util');var path=require(_0x75cd('0x1'));var timeout=require(_0x75cd('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x75cd('0x3'));var auth=require(_0x75cd('0x4'));var interaction=require(_0x75cd('0x5'));var config=require(_0x75cd('0x6'));var controller=require(_0x75cd('0x7'));router[_0x75cd('0x8')]('/',auth[_0x75cd('0x9')](),controller[_0x75cd('0xa')]);router[_0x75cd('0x8')]('/:id',auth[_0x75cd('0x9')](),controller[_0x75cd('0xb')]);router[_0x75cd('0x8')](_0x75cd('0xc'),auth[_0x75cd('0x9')](),controller[_0x75cd('0xd')]);router[_0x75cd('0x8')](_0x75cd('0xe'),auth[_0x75cd('0x9')](),controller[_0x75cd('0xf')]);router['post']('/',auth[_0x75cd('0x9')](),controller['create']);router[_0x75cd('0x10')]('/:id/conditions',auth['isAuthenticated'](),controller[_0x75cd('0x11')]);router['post'](_0x75cd('0xe'),auth[_0x75cd('0x9')](),controller[_0x75cd('0x12')]);router['put']('/:id',auth[_0x75cd('0x9')](),controller[_0x75cd('0x13')]);router[_0x75cd('0x14')](_0x75cd('0x15'),auth['isAuthenticated'](),controller[_0x75cd('0x16')]);module[_0x75cd('0x17')]=router;
\ No newline at end of file
+var _0x861c=['show','/:id/conditions','getConditions','/:id/actions','getActions','create','post','addConditions','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','index','/:id','isAuthenticated'];(function(_0x3fb03e,_0x42bb53){var _0x55e681=function(_0x252f30){while(--_0x252f30){_0x3fb03e['push'](_0x3fb03e['shift']());}};_0x55e681(++_0x42bb53);}(_0x861c,0xdb));var _0xc861=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x861c[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0xc861('0x0'));var util=require(_0xc861('0x1'));var path=require(_0xc861('0x2'));var timeout=require(_0xc861('0x3'));var express=require(_0xc861('0x4'));var router=express[_0xc861('0x5')]();var fs_extra=require(_0xc861('0x6'));var auth=require(_0xc861('0x7'));var interaction=require(_0xc861('0x8'));var config=require(_0xc861('0x9'));var controller=require(_0xc861('0xa'));router[_0xc861('0xb')]('/',auth['isAuthenticated'](),controller[_0xc861('0xc')]);router[_0xc861('0xb')](_0xc861('0xd'),auth[_0xc861('0xe')](),controller[_0xc861('0xf')]);router[_0xc861('0xb')](_0xc861('0x10'),auth[_0xc861('0xe')](),controller[_0xc861('0x11')]);router[_0xc861('0xb')](_0xc861('0x12'),auth[_0xc861('0xe')](),controller[_0xc861('0x13')]);router['post']('/',auth[_0xc861('0xe')](),controller[_0xc861('0x14')]);router[_0xc861('0x15')](_0xc861('0x10'),auth['isAuthenticated'](),controller[_0xc861('0x16')]);router[_0xc861('0x15')](_0xc861('0x12'),auth[_0xc861('0xe')](),controller['addActions']);router['put'](_0xc861('0xd'),auth[_0xc861('0xe')](),controller['update']);router[_0xc861('0x17')](_0xc861('0xd'),auth['isAuthenticated'](),controller[_0xc861('0x18')]);module[_0xc861('0x19')]=router;
\ No newline at end of file
index c799d85..aeff1e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52a4=['#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','ENUM','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name','ivr','STRING','BOOLEAN','INTEGER','UNSIGNED'];(function(_0x1bb9e4,_0x15bc58){var _0xe362b1=function(_0xc5c0aa){while(--_0xc5c0aa){_0x1bb9e4['push'](_0x1bb9e4['shift']());}};_0xe362b1(++_0x15bc58);}(_0x52a4,0xe6));var _0x452a=function(_0x1e342f,_0x22bbe5){_0x1e342f=_0x1e342f-0x0;var _0x40551a=_0x52a4[_0x1e342f];return _0x40551a;};'use strict';var Sequelize=require(_0x452a('0x0'));module[_0x452a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x452a('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x452a('0x3')),'allowNull':![],'defaultValue':_0x452a('0x3')},'description':{'type':Sequelize[_0x452a('0x4')]},'active':{'type':Sequelize[_0x452a('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x452a('0x6')](0x4)[_0x452a('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x452a('0x4')]},'dialOriginateTimeout':{'type':Sequelize[_0x452a('0x6')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x452a('0x6')](0x3)[_0x452a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x452a('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x452a('0x6')](0x5)[_0x452a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x452a('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0x452a('0x6')](0x3)[_0x452a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x452a('0x6')](0x5)[_0x452a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x452a('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x452a('0x6')](0x3)[_0x452a('0x7')],'defaultValue':0x3,'comment':_0x452a('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x452a('0x6')](0x5)[_0x452a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x452a('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0x452a('0x6')](0x3)[_0x452a('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x452a('0xd')},'dialTimezone':{'type':Sequelize[_0x452a('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x452a('0x4')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x452a('0xe')](_0x452a('0xf'),'never','onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x452a('0x5')],'defaultValue':0x0,'comment':_0x452a('0x10')},'dialAMDInitialSilence':{'type':Sequelize[_0x452a('0x6')](0x9)[_0x452a('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x452a('0x11')},'dialAMDGreeting':{'type':Sequelize[_0x452a('0x6')](0x9)[_0x452a('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x452a('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x452a('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x452a('0x6')](0x9)[_0x452a('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x452a('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0x452a('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x452a('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x452a('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x452a('0x6')](0x9)[_0x452a('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x452a('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x452a('0x6')](0x5)[_0x452a('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x452a('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x452a('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x452a('0xe')](_0x452a('0x18'),_0x452a('0x19')),'defaultValue':_0x452a('0x18')},'dialPrefix':{'type':Sequelize[_0x452a('0x4')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x452a('0x6')](0x3)[_0x452a('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x452a('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x452a('0x6')](0x5)[_0x452a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x452a('0x1b')},'dialDropMaxRetry':{'type':Sequelize[_0x452a('0x6')](0x3)[_0x452a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x452a('0x1c')},'dialDropRetryFrequency':{'type':Sequelize[_0x452a('0x6')](0x5)[_0x452a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x452a('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x452a('0x6')](0x3)[_0x452a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x452a('0x6')](0x5)[_0x452a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x452a('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0x452a('0x6')](0x3)[_0x452a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x452a('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x452a('0x1f')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x452a('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x452a('0x20')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x452a('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x452a('0x21')}};
\ No newline at end of file
+var _0xd70e=['#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)','sequelize','name','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','#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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\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)'];(function(_0x4b8b59,_0x31988f){var _0x4f7c8b=function(_0x1b9cfb){while(--_0x1b9cfb){_0x4b8b59['push'](_0x4b8b59['shift']());}};_0x4f7c8b(++_0x31988f);}(_0xd70e,0x157));var _0xed70=function(_0x27ffb5,_0x454d2a){_0x27ffb5=_0x27ffb5-0x0;var _0x5d3f31=_0xd70e[_0x27ffb5];return _0x5d3f31;};'use strict';var Sequelize=require(_0xed70('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xed70('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xed70('0x2')](_0xed70('0x3')),'allowNull':![],'defaultValue':_0xed70('0x3')},'description':{'type':Sequelize[_0xed70('0x4')]},'active':{'type':Sequelize[_0xed70('0x5')],'defaultValue':0x0,'comment':_0xed70('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xed70('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xed70('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xed70('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xed70('0x4')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xed70('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xed70('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xed70('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xed70('0x9')](0x5)[_0xed70('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xed70('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xed70('0x9')](0x3)[_0xed70('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xed70('0x9')](0x5)[_0xed70('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xed70('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xed70('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xed70('0x9')](0x5)[_0xed70('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xed70('0x9')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xed70('0xd')},'dialTimezone':{'type':Sequelize[_0xed70('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xed70('0x4')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xed70('0x2')](_0xed70('0xe'),'never',_0xed70('0xf')),'defaultValue':_0xed70('0xe')},'dialAMDActive':{'type':Sequelize[_0xed70('0x5')],'defaultValue':0x0,'comment':_0xed70('0x10')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xed70('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xed70('0x11')},'dialAMDGreeting':{'type':Sequelize[_0xed70('0x9')](0x9)[_0xed70('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xed70('0x9')](0x9)[_0xed70('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xed70('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xed70('0x9')](0x9)[_0xed70('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xed70('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0xed70('0x9')](0x9)[_0xed70('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xed70('0x9')](0x9)[_0xed70('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xed70('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xed70('0x14')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xed70('0x15')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xed70('0x9')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xed70('0x16'),'ASC'),'defaultValue':_0xed70('0x16')},'dialPrefix':{'type':Sequelize[_0xed70('0x4')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xed70('0x9')](0x3)[_0xed70('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xed70('0x17')},'dialCutDigit':{'type':Sequelize[_0xed70('0x9')](0x3)[_0xed70('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xed70('0x18')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xed70('0x9')](0x3)[_0xed70('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xed70('0x19')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xed70('0x9')](0x5)[_0xed70('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xed70('0x1a')},'dialDropMaxRetry':{'type':Sequelize[_0xed70('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xed70('0x1b')},'dialDropRetryFrequency':{'type':Sequelize[_0xed70('0x9')](0x5)[_0xed70('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xed70('0x1c')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xed70('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xed70('0x1e')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xed70('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xed70('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0xed70('0x9')](0x5)[_0xed70('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xed70('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xed70('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xed70('0x9')](0x5)[_0xed70('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xed70('0x21')}};
\ No newline at end of file
index b423845..5bc14fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e7f=['send','index','map','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','Campaign','include','findAll','rows','catch','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','params','merge','omit','createdAt','updatedAt','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','hasOwnProperty','order','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','select','field','scheduledAt','CmListId','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','removeLists','getBlackLists','addBlackLists','cm_hopper_black','push','sequelize','removeBlackLists','eml-format','rimraf','zip-dir','mustache','path','to-csv','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x4e7f,0x1df));var _0xf4e7=function(_0x1591d4,_0x4ea3bd){_0x1591d4=_0x1591d4-0x0;var _0x4c46bb=_0x4e7f[_0x1591d4];return _0x4c46bb;};'use strict';var emlformat=require(_0xf4e7('0x0'));var rimraf=require(_0xf4e7('0x1'));var zipdir=require(_0xf4e7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf4e7('0x3'));var util=require('util');var path=require(_0xf4e7('0x4'));var sox=require('sox');var csv=require(_0xf4e7('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf4e7('0x6'));var crypto=require(_0xf4e7('0x7'));var jsforce=require(_0xf4e7('0x8'));var deskjs=require(_0xf4e7('0x9'));var toCsv=require(_0xf4e7('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf4e7('0xa'));var authService=require(_0xf4e7('0xb'));var qs=require(_0xf4e7('0xc'));var as=require(_0xf4e7('0xd'));var hardwareService=require(_0xf4e7('0xe'));var logger=require(_0xf4e7('0xf'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf4e7('0x10'));var db=require(_0xf4e7('0x11'))['db'];function respondWithStatusCode(_0x5b24ef,_0x316652){_0x316652=_0x316652||0xcc;return function(_0x50bb16){if(_0x50bb16){return _0x5b24ef[_0xf4e7('0x12')](_0x316652);}return _0x5b24ef['status'](_0x316652)[_0xf4e7('0x13')]();};}function respondWithResult(_0x5c6378,_0x249357){_0x249357=_0x249357||0xc8;return function(_0x597164){if(_0x597164){return _0x5c6378[_0xf4e7('0x14')](_0x249357)[_0xf4e7('0x15')](_0x597164);}};}function respondWithFilteredResult(_0x3a2ea7,_0xe1a127){return function(_0x198dc0){if(_0x198dc0){var _0x2fc150=typeof _0xe1a127[_0xf4e7('0x16')]===_0xf4e7('0x17')&&typeof _0xe1a127[_0xf4e7('0x18')]===_0xf4e7('0x17');var _0x118885=_0x198dc0[_0xf4e7('0x19')];var _0x118aeb=_0x2fc150?0x0:_0xe1a127[_0xf4e7('0x16')];var _0x529de1=_0x2fc150?_0x198dc0[_0xf4e7('0x19')]:_0xe1a127[_0xf4e7('0x16')]+_0xe1a127['limit'];var _0x3acfe0;if(_0x529de1>=_0x118885){_0x529de1=_0x118885;_0x3acfe0=0xc8;}else{_0x3acfe0=0xce;}_0x3a2ea7[_0xf4e7('0x14')](_0x3acfe0);return _0x3a2ea7[_0xf4e7('0x1a')](_0xf4e7('0x1b'),_0x118aeb+'-'+_0x529de1+'/'+_0x118885)['json'](_0x198dc0);}return null;};}function patchUpdates(_0x456d30){return function(_0x19260b){try{jsonpatch[_0xf4e7('0x1c')](_0x19260b,_0x456d30,!![]);}catch(_0x524a6c){return BPromise['reject'](_0x524a6c);}return _0x19260b[_0xf4e7('0x1d')]();};}function saveUpdates(_0x5efd89,_0x51aae7){return function(_0x1cfd83){if(_0x1cfd83){return _0x1cfd83[_0xf4e7('0x1e')](_0x5efd89)[_0xf4e7('0x1f')](function(_0x145c96){return _0x145c96;});}return null;};}function removeEntity(_0x5b2743,_0x3b7d37){return function(_0x5a53b2){if(_0x5a53b2){return _0x5a53b2[_0xf4e7('0x20')]()[_0xf4e7('0x1f')](function(){var _0x2f9873=_0x5a53b2[_0xf4e7('0x21')]({'plain':!![]});var _0x4badc4=_0xf4e7('0x22');return db[_0xf4e7('0x23')][_0xf4e7('0x20')]({'where':{'type':_0x4badc4,'resourceId':_0x2f9873['id']}})[_0xf4e7('0x1f')](function(){return _0x5a53b2;});})[_0xf4e7('0x1f')](function(){_0x5b2743['status'](0xcc)[_0xf4e7('0x13')]();});}};}function handleEntityNotFound(_0x43cb2d,_0x562866){return function(_0x23f18f){if(!_0x23f18f){_0x43cb2d[_0xf4e7('0x12')](0x194);}return _0x23f18f;};}function handleError(_0x959613,_0x26812c){_0x26812c=_0x26812c||0x1f4;return function(_0x35d74b){logger[_0xf4e7('0x24')](_0x35d74b['stack']);if(_0x35d74b['name']){delete _0x35d74b['name'];}_0x959613[_0xf4e7('0x14')](_0x26812c)[_0xf4e7('0x25')](_0x35d74b);};}exports[_0xf4e7('0x26')]=function(_0x3a94c6,_0x23058c){var _0x38dd7e={},_0x313f0a={},_0x4f4ada={'count':0x0,'rows':[]};var _0x55f592=_[_0xf4e7('0x27')](db['Campaign'][_0xf4e7('0x28')],function(_0x287833){return{'name':_0x287833[_0xf4e7('0x29')],'type':_0x287833[_0xf4e7('0x2a')][_0xf4e7('0x2b')]};});_0x313f0a[_0xf4e7('0x2c')]=_[_0xf4e7('0x27')](_0x55f592,_0xf4e7('0x2d'));_0x313f0a[_0xf4e7('0x2e')]=_[_0xf4e7('0x2f')](_0x3a94c6[_0xf4e7('0x2e')]);_0x313f0a[_0xf4e7('0x30')]=_[_0xf4e7('0x31')](_0x313f0a[_0xf4e7('0x2c')],_0x313f0a['query']);_0x38dd7e['attributes']=_['intersection'](_0x313f0a['model'],qs['fields'](_0x3a94c6[_0xf4e7('0x2e')][_0xf4e7('0x32')]));_0x38dd7e['attributes']=_0x38dd7e[_0xf4e7('0x33')][_0xf4e7('0x34')]?_0x38dd7e['attributes']:_0x313f0a[_0xf4e7('0x2c')];if(!_0x3a94c6['query']['hasOwnProperty'](_0xf4e7('0x35'))){_0x38dd7e[_0xf4e7('0x18')]=qs[_0xf4e7('0x18')](_0x3a94c6[_0xf4e7('0x2e')]['limit']);_0x38dd7e[_0xf4e7('0x16')]=qs[_0xf4e7('0x16')](_0x3a94c6['query'][_0xf4e7('0x16')]);}_0x38dd7e['order']=qs[_0xf4e7('0x36')](_0x3a94c6[_0xf4e7('0x2e')][_0xf4e7('0x36')]);_0x38dd7e[_0xf4e7('0x37')]=qs[_0xf4e7('0x30')](_[_0xf4e7('0x38')](_0x3a94c6[_0xf4e7('0x2e')],_0x313f0a[_0xf4e7('0x30')]),_0x55f592);if(_0x3a94c6['query'][_0xf4e7('0x39')]){_0x38dd7e[_0xf4e7('0x37')]=_['merge'](_0x38dd7e[_0xf4e7('0x37')],{'$or':_[_0xf4e7('0x27')](_0x55f592,function(_0x4ffc97){if(_0x4ffc97[_0xf4e7('0x2a')]!==_0xf4e7('0x3a')){var _0x2161e4={};_0x2161e4[_0x4ffc97['name']]={'$like':'%'+_0x3a94c6['query'][_0xf4e7('0x39')]+'%'};return _0x2161e4;}})});}_0x38dd7e=_['merge']({},_0x38dd7e,_0x3a94c6['options']);var _0x28ad1f={'where':_0x38dd7e[_0xf4e7('0x37')]};return db[_0xf4e7('0x3b')]['count'](_0x28ad1f)[_0xf4e7('0x1f')](function(_0x256ce4){_0x4f4ada[_0xf4e7('0x19')]=_0x256ce4;if(_0x3a94c6[_0xf4e7('0x2e')]['includeAll']){_0x38dd7e[_0xf4e7('0x3c')]=[{'all':!![]}];}return db['Campaign'][_0xf4e7('0x3d')](_0x38dd7e);})[_0xf4e7('0x1f')](function(_0x551ed3){_0x4f4ada[_0xf4e7('0x3e')]=_0x551ed3;return _0x4f4ada;})[_0xf4e7('0x1f')](respondWithFilteredResult(_0x23058c,_0x38dd7e))[_0xf4e7('0x3f')](handleError(_0x23058c,null));};exports['show']=function(_0x387c00,_0x371af3){var _0x133844={'raw':![],'where':{'id':_0x387c00['params']['id']}},_0x26136b={};_0x26136b[_0xf4e7('0x2c')]=_['keys'](db[_0xf4e7('0x3b')][_0xf4e7('0x28')]);_0x26136b[_0xf4e7('0x2e')]=_[_0xf4e7('0x2f')](_0x387c00[_0xf4e7('0x2e')]);_0x26136b[_0xf4e7('0x30')]=_[_0xf4e7('0x31')](_0x26136b[_0xf4e7('0x2c')],_0x26136b[_0xf4e7('0x2e')]);_0x133844['attributes']=_[_0xf4e7('0x31')](_0x26136b[_0xf4e7('0x2c')],qs[_0xf4e7('0x32')](_0x387c00['query'][_0xf4e7('0x32')]));_0x133844[_0xf4e7('0x33')]=_0x133844[_0xf4e7('0x33')]['length']?_0x133844['attributes']:_0x26136b['model'];if(_0x387c00[_0xf4e7('0x2e')][_0xf4e7('0x40')]){_0x133844['include']=[{'all':!![]}];}_0x133844=_['merge']({},_0x133844,_0x387c00[_0xf4e7('0x41')]);return db[_0xf4e7('0x3b')][_0xf4e7('0x42')](_0x133844)[_0xf4e7('0x1f')](handleEntityNotFound(_0x371af3,null))['then'](respondWithResult(_0x371af3,null))[_0xf4e7('0x3f')](handleError(_0x371af3,null));};exports['create']=function(_0x32027a,_0x30814b){return db[_0xf4e7('0x3b')][_0xf4e7('0x43')](_0x32027a[_0xf4e7('0x44')],{})[_0xf4e7('0x1f')](function(_0x37a7b3){var _0x4d9248=_0x32027a[_0xf4e7('0x45')][_0xf4e7('0x21')]({'plain':!![]});if(!_0x4d9248)throw new Error(_0xf4e7('0x46'));if(_0x4d9248[_0xf4e7('0x47')]===_0xf4e7('0x45')){var _0x2cb0fb=_0x37a7b3[_0xf4e7('0x21')]({'plain':!![]});var _0x2381f3=_0xf4e7('0x22');return db['UserProfileSection']['find']({'where':{'name':_0x2381f3,'userProfileId':_0x4d9248[_0xf4e7('0x48')]},'raw':!![]})[_0xf4e7('0x1f')](function(_0x4a1c58){if(_0x4a1c58&&_0x4a1c58[_0xf4e7('0x49')]===0x0){return db[_0xf4e7('0x23')][_0xf4e7('0x43')]({'name':_0x2cb0fb[_0xf4e7('0x2d')],'resourceId':_0x2cb0fb['id'],'type':_0x4a1c58[_0xf4e7('0x2d')],'sectionId':_0x4a1c58['id']},{})[_0xf4e7('0x1f')](function(){return _0x37a7b3;});}else{return _0x37a7b3;}})['catch'](function(_0x14beb1){logger[_0xf4e7('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14beb1);throw _0x14beb1;});}return _0x37a7b3;})['then'](respondWithResult(_0x30814b,0xc9))[_0xf4e7('0x3f')](handleError(_0x30814b,null));};exports['clone']=function(_0x15c76c,_0x3c0d26){var _0x28ee07={'where':{'id':_0x15c76c[_0xf4e7('0x4a')]['id']}},_0x22c0dc={};_0x22c0dc[_0xf4e7('0x2c')]=_[_0xf4e7('0x2f')](db[_0xf4e7('0x3b')][_0xf4e7('0x28')]);_0x28ee07[_0xf4e7('0x33')]=_[_0xf4e7('0x31')](_0x22c0dc[_0xf4e7('0x2c')],qs[_0xf4e7('0x32')](_0x15c76c[_0xf4e7('0x2e')][_0xf4e7('0x32')]));_0x28ee07[_0xf4e7('0x33')]=_0x28ee07[_0xf4e7('0x33')][_0xf4e7('0x34')]?_0x28ee07[_0xf4e7('0x33')]:_0x22c0dc[_0xf4e7('0x2c')];if(_0x15c76c[_0xf4e7('0x2e')][_0xf4e7('0x40')]){_0x28ee07[_0xf4e7('0x3c')]=[{'all':!![]}];}_0x28ee07=_[_0xf4e7('0x4b')]({},_0x28ee07,_0x15c76c[_0xf4e7('0x41')]);return db[_0xf4e7('0x3b')][_0xf4e7('0x42')](_0x28ee07)[_0xf4e7('0x1f')](handleEntityNotFound(_0x3c0d26,null))['then'](function(_0x1ba960){if(_0x1ba960){var _0x6660b4=_0x1ba960[_0xf4e7('0x21')]({'plain':!![]});_0x6660b4=qs[_0xf4e7('0x4c')](_0x6660b4,['id',_0xf4e7('0x4d'),_0xf4e7('0x4e')]);_0x15c76c[_0xf4e7('0x44')]=_[_0xf4e7('0x4c')](_0x15c76c[_0xf4e7('0x44')],['id',_0xf4e7('0x4d'),_0xf4e7('0x4e')]);return db[_0xf4e7('0x3b')][_0xf4e7('0x43')](_[_0xf4e7('0x4b')](_0x6660b4,_0x15c76c['body']),{'include':_0x15c76c[_0xf4e7('0x2e')][_0xf4e7('0x40')]?[{'all':!![]}]:undefined})[_0xf4e7('0x1f')](function(_0x3a5bd5){var _0x3ffb08=_0x15c76c[_0xf4e7('0x45')][_0xf4e7('0x21')]({'plain':!![]});if(!_0x3ffb08)throw new Error(_0xf4e7('0x46'));if(_0x3ffb08[_0xf4e7('0x47')]===_0xf4e7('0x45')){var _0x53ba9d=_0x3a5bd5[_0xf4e7('0x21')]({'plain':!![]});var _0x55479e=_0xf4e7('0x22');return db[_0xf4e7('0x4f')][_0xf4e7('0x42')]({'where':{'name':_0x55479e,'userProfileId':_0x3ffb08[_0xf4e7('0x48')]},'raw':!![]})[_0xf4e7('0x1f')](function(_0x1c86a){if(_0x1c86a&&_0x1c86a['autoAssociation']===0x0){return db[_0xf4e7('0x23')][_0xf4e7('0x43')]({'name':_0x53ba9d['name'],'resourceId':_0x53ba9d['id'],'type':_0x1c86a[_0xf4e7('0x2d')],'sectionId':_0x1c86a['id']},{})[_0xf4e7('0x1f')](function(){return _0x3a5bd5;});}else{return _0x3a5bd5;}})[_0xf4e7('0x3f')](function(_0x2e7e7c){logger[_0xf4e7('0x24')](_0xf4e7('0x50'),_0x2e7e7c);throw _0x2e7e7c;});}return _0x3a5bd5;});}})[_0xf4e7('0x1f')](respondWithResult(_0x3c0d26,0xc9))[_0xf4e7('0x3f')](handleError(_0x3c0d26,null));};exports[_0xf4e7('0x1e')]=function(_0x3f5a82,_0x4ac213){if(_0x3f5a82[_0xf4e7('0x44')]['id']){delete _0x3f5a82[_0xf4e7('0x44')]['id'];}return db[_0xf4e7('0x3b')]['find']({'where':{'id':_0x3f5a82['params']['id']}})[_0xf4e7('0x1f')](handleEntityNotFound(_0x4ac213,null))[_0xf4e7('0x1f')](saveUpdates(_0x3f5a82['body'],null))[_0xf4e7('0x1f')](respondWithResult(_0x4ac213,null))[_0xf4e7('0x3f')](handleError(_0x4ac213,null));};exports[_0xf4e7('0x20')]=function(_0x4c9249,_0xe53c75){return db['Campaign'][_0xf4e7('0x42')]({'where':{'id':_0x4c9249[_0xf4e7('0x4a')]['id']}})[_0xf4e7('0x1f')](handleEntityNotFound(_0xe53c75,null))[_0xf4e7('0x1f')](removeEntity(_0xe53c75,null))[_0xf4e7('0x3f')](handleError(_0xe53c75,null));};exports[_0xf4e7('0x51')]=function(_0x45fe2e,_0x282070,_0x1eab05){var _0x553cfc={'raw':!![],'where':{}};var _0x3f0b62={};var _0x2bb2a4={'count':0x0,'rows':[]};return db[_0xf4e7('0x3b')][_0xf4e7('0x52')]({'where':{'id':_0x45fe2e[_0xf4e7('0x4a')]['id']}})[_0xf4e7('0x1f')](handleEntityNotFound(_0x282070,null))[_0xf4e7('0x1f')](function(_0x39dd04){if(_0x39dd04){_0x3f0b62[_0xf4e7('0x2c')]=_['keys'](db[_0xf4e7('0x53')][_0xf4e7('0x28')]);_0x3f0b62[_0xf4e7('0x2e')]=_['keys'](_0x45fe2e[_0xf4e7('0x2e')]);_0x3f0b62[_0xf4e7('0x30')]=_[_0xf4e7('0x31')](_0x3f0b62[_0xf4e7('0x2c')],_0x3f0b62[_0xf4e7('0x2e')]);_0x553cfc[_0xf4e7('0x33')]=_[_0xf4e7('0x31')](_0x3f0b62[_0xf4e7('0x2c')],qs[_0xf4e7('0x32')](_0x45fe2e['query']['fields']));_0x553cfc[_0xf4e7('0x33')]=_0x553cfc[_0xf4e7('0x33')]['length']?_0x553cfc[_0xf4e7('0x33')]:_0x3f0b62[_0xf4e7('0x2c')];if(!_0x45fe2e[_0xf4e7('0x2e')][_0xf4e7('0x54')]('nolimit')){_0x553cfc[_0xf4e7('0x18')]=qs[_0xf4e7('0x18')](_0x45fe2e[_0xf4e7('0x2e')][_0xf4e7('0x18')]);_0x553cfc[_0xf4e7('0x16')]=qs[_0xf4e7('0x16')](_0x45fe2e[_0xf4e7('0x2e')][_0xf4e7('0x16')]);}_0x553cfc[_0xf4e7('0x55')]=qs[_0xf4e7('0x36')](_0x45fe2e[_0xf4e7('0x2e')]['sort']);_0x553cfc[_0xf4e7('0x37')]=qs[_0xf4e7('0x30')](_[_0xf4e7('0x38')](_0x45fe2e['query'],_0x3f0b62['filters']));_0x553cfc['where'][_0xf4e7('0x56')]=_0x39dd04['id'];if(_0x45fe2e[_0xf4e7('0x2e')][_0xf4e7('0x39')]){_0x553cfc['where']=_[_0xf4e7('0x4b')](_0x553cfc[_0xf4e7('0x37')],{'$or':_[_0xf4e7('0x27')](_0x553cfc['attributes'],function(_0x5c5605){var _0x53d3b1={};_0x53d3b1[_0x5c5605]={'$like':'%'+_0x45fe2e['query']['filter']+'%'};return _0x53d3b1;})});}_0x553cfc=_[_0xf4e7('0x4b')]({},_0x553cfc,_0x45fe2e['options']);return db[_0xf4e7('0x53')][_0xf4e7('0x19')]({'where':_0x553cfc['where']})[_0xf4e7('0x1f')](function(_0x386849){_0x2bb2a4[_0xf4e7('0x19')]=_0x386849;if(_0x45fe2e[_0xf4e7('0x2e')]['includeAll']){_0x553cfc[_0xf4e7('0x3c')]=[{'all':!![]}];}return db[_0xf4e7('0x53')]['findAll'](_0x553cfc);})['then'](function(_0x93e024){_0x2bb2a4[_0xf4e7('0x3e')]=_0x93e024;return _0x2bb2a4;});}})['then'](respondWithFilteredResult(_0x282070,_0x553cfc))[_0xf4e7('0x3f')](handleError(_0x282070,null));};exports[_0xf4e7('0x57')]=function(_0x4e0829,_0x32d975,_0x1fbed6){var _0x58ccf2={'raw':!![],'where':{}};var _0x29d4ae={};var _0x5517f1={'count':0x0,'rows':[]};return db[_0xf4e7('0x3b')][_0xf4e7('0x52')]({'where':{'id':_0x4e0829[_0xf4e7('0x4a')]['id']}})['then'](handleEntityNotFound(_0x32d975,null))['then'](function(_0x4c0c4b){if(_0x4c0c4b){_0x29d4ae['model']=_[_0xf4e7('0x2f')](db[_0xf4e7('0x58')]['rawAttributes']);_0x29d4ae[_0xf4e7('0x2e')]=_[_0xf4e7('0x2f')](_0x4e0829['query']);_0x29d4ae[_0xf4e7('0x30')]=_[_0xf4e7('0x31')](_0x29d4ae[_0xf4e7('0x2c')],_0x29d4ae[_0xf4e7('0x2e')]);_0x58ccf2[_0xf4e7('0x33')]=_['intersection'](_0x29d4ae[_0xf4e7('0x2c')],qs[_0xf4e7('0x32')](_0x4e0829[_0xf4e7('0x2e')][_0xf4e7('0x32')]));_0x58ccf2[_0xf4e7('0x33')]=_0x58ccf2['attributes']['length']?_0x58ccf2[_0xf4e7('0x33')]:_0x29d4ae[_0xf4e7('0x2c')];if(!_0x4e0829[_0xf4e7('0x2e')][_0xf4e7('0x54')]('nolimit')){_0x58ccf2[_0xf4e7('0x18')]=qs['limit'](_0x4e0829[_0xf4e7('0x2e')][_0xf4e7('0x18')]);_0x58ccf2[_0xf4e7('0x16')]=qs[_0xf4e7('0x16')](_0x4e0829['query'][_0xf4e7('0x16')]);}_0x58ccf2[_0xf4e7('0x55')]=qs[_0xf4e7('0x36')](_0x4e0829['query'][_0xf4e7('0x36')]);_0x58ccf2[_0xf4e7('0x37')]=qs[_0xf4e7('0x30')](_[_0xf4e7('0x38')](_0x4e0829[_0xf4e7('0x2e')],_0x29d4ae[_0xf4e7('0x30')]));_0x58ccf2[_0xf4e7('0x37')][_0xf4e7('0x56')]=_0x4c0c4b['id'];if(_0x4e0829[_0xf4e7('0x2e')][_0xf4e7('0x39')]){_0x58ccf2[_0xf4e7('0x37')]=_[_0xf4e7('0x4b')](_0x58ccf2[_0xf4e7('0x37')],{'$or':_[_0xf4e7('0x27')](_0x58ccf2['attributes'],function(_0x4fc67d){var _0x4c44d6={};_0x4c44d6[_0x4fc67d]={'$like':'%'+_0x4e0829[_0xf4e7('0x2e')][_0xf4e7('0x39')]+'%'};return _0x4c44d6;})});}_0x58ccf2=_[_0xf4e7('0x4b')]({},_0x58ccf2,_0x4e0829[_0xf4e7('0x41')]);return db[_0xf4e7('0x58')]['count']({'where':_0x58ccf2[_0xf4e7('0x37')]})[_0xf4e7('0x1f')](function(_0x5d8caa){_0x5517f1['count']=_0x5d8caa;if(_0x4e0829[_0xf4e7('0x2e')][_0xf4e7('0x40')]){_0x58ccf2['include']=[{'all':!![]}];}return db[_0xf4e7('0x58')][_0xf4e7('0x3d')](_0x58ccf2);})[_0xf4e7('0x1f')](function(_0x412dfe){_0x5517f1[_0xf4e7('0x3e')]=_0x412dfe;return _0x5517f1;});}})[_0xf4e7('0x1f')](respondWithFilteredResult(_0x32d975,_0x58ccf2))[_0xf4e7('0x3f')](handleError(_0x32d975,null));};exports[_0xf4e7('0x59')]=function(_0x1437b6,_0x52aca0,_0xf76238){var _0x3dcabd={'raw':!![],'where':{}};var _0x3c6c75={};var _0x15d808={'count':0x0,'rows':[]};return db[_0xf4e7('0x3b')][_0xf4e7('0x52')]({'where':{'id':_0x1437b6[_0xf4e7('0x4a')]['id']}})[_0xf4e7('0x1f')](handleEntityNotFound(_0x52aca0,null))[_0xf4e7('0x1f')](function(_0x54d487){if(_0x54d487){_0x3c6c75['model']=_[_0xf4e7('0x2f')](db['CmHopperFinal'][_0xf4e7('0x28')]);_0x3c6c75[_0xf4e7('0x2e')]=_[_0xf4e7('0x2f')](_0x1437b6[_0xf4e7('0x2e')]);_0x3c6c75[_0xf4e7('0x30')]=_[_0xf4e7('0x31')](_0x3c6c75[_0xf4e7('0x2c')],_0x3c6c75[_0xf4e7('0x2e')]);_0x3dcabd['attributes']=_['intersection'](_0x3c6c75['model'],qs[_0xf4e7('0x32')](_0x1437b6['query'][_0xf4e7('0x32')]));_0x3dcabd[_0xf4e7('0x33')]=_0x3dcabd['attributes'][_0xf4e7('0x34')]?_0x3dcabd[_0xf4e7('0x33')]:_0x3c6c75['model'];if(!_0x1437b6['query']['hasOwnProperty']('nolimit')){_0x3dcabd[_0xf4e7('0x18')]=qs[_0xf4e7('0x18')](_0x1437b6['query'][_0xf4e7('0x18')]);_0x3dcabd[_0xf4e7('0x16')]=qs['offset'](_0x1437b6['query'][_0xf4e7('0x16')]);}_0x3dcabd[_0xf4e7('0x55')]=qs[_0xf4e7('0x36')](_0x1437b6['query'][_0xf4e7('0x36')]);_0x3dcabd[_0xf4e7('0x37')]=qs['filters'](_[_0xf4e7('0x38')](_0x1437b6[_0xf4e7('0x2e')],_0x3c6c75[_0xf4e7('0x30')]));_0x3dcabd[_0xf4e7('0x37')][_0xf4e7('0x56')]=_0x54d487['id'];if(_0x1437b6[_0xf4e7('0x2e')]['filter']){_0x3dcabd[_0xf4e7('0x37')]=_[_0xf4e7('0x4b')](_0x3dcabd[_0xf4e7('0x37')],{'$or':_[_0xf4e7('0x27')](_0x3dcabd['attributes'],function(_0x41bdb4){var _0x4bfe66={};_0x4bfe66[_0x41bdb4]={'$like':'%'+_0x1437b6[_0xf4e7('0x2e')][_0xf4e7('0x39')]+'%'};return _0x4bfe66;})});}_0x3dcabd=_[_0xf4e7('0x4b')]({},_0x3dcabd,_0x1437b6[_0xf4e7('0x41')]);return db['CmHopperFinal'][_0xf4e7('0x19')]({'where':_0x3dcabd[_0xf4e7('0x37')]})[_0xf4e7('0x1f')](function(_0x4516cd){_0x15d808[_0xf4e7('0x19')]=_0x4516cd;if(_0x1437b6[_0xf4e7('0x2e')][_0xf4e7('0x40')]){_0x3dcabd[_0xf4e7('0x3c')]=[{'all':!![]}];}return db[_0xf4e7('0x5a')][_0xf4e7('0x3d')](_0x3dcabd);})[_0xf4e7('0x1f')](function(_0x5f2c06){_0x15d808['rows']=_0x5f2c06;return _0x15d808;});}})[_0xf4e7('0x1f')](respondWithFilteredResult(_0x52aca0,_0x3dcabd))[_0xf4e7('0x3f')](handleError(_0x52aca0,null));};exports['getHopperBlacks']=function(_0x2fa7ed,_0x16b2c3,_0x46ab86){var _0x45b883={'raw':!![],'where':{}};var _0xd2548e={};var _0x102ed5={'count':0x0,'rows':[]};return db['Campaign'][_0xf4e7('0x52')]({'where':{'id':_0x2fa7ed[_0xf4e7('0x4a')]['id']}})['then'](handleEntityNotFound(_0x16b2c3,null))[_0xf4e7('0x1f')](function(_0x45a09a){if(_0x45a09a){_0xd2548e[_0xf4e7('0x2c')]=_[_0xf4e7('0x2f')](db['CmHopperBlack'][_0xf4e7('0x28')]);_0xd2548e[_0xf4e7('0x2e')]=_[_0xf4e7('0x2f')](_0x2fa7ed[_0xf4e7('0x2e')]);_0xd2548e[_0xf4e7('0x30')]=_[_0xf4e7('0x31')](_0xd2548e['model'],_0xd2548e[_0xf4e7('0x2e')]);_0x45b883['attributes']=_[_0xf4e7('0x31')](_0xd2548e[_0xf4e7('0x2c')],qs[_0xf4e7('0x32')](_0x2fa7ed[_0xf4e7('0x2e')]['fields']));_0x45b883[_0xf4e7('0x33')]=_0x45b883[_0xf4e7('0x33')][_0xf4e7('0x34')]?_0x45b883[_0xf4e7('0x33')]:_0xd2548e['model'];if(!_0x2fa7ed[_0xf4e7('0x2e')][_0xf4e7('0x54')](_0xf4e7('0x35'))){_0x45b883[_0xf4e7('0x18')]=qs[_0xf4e7('0x18')](_0x2fa7ed[_0xf4e7('0x2e')]['limit']);_0x45b883['offset']=qs[_0xf4e7('0x16')](_0x2fa7ed['query'][_0xf4e7('0x16')]);}_0x45b883[_0xf4e7('0x55')]=qs[_0xf4e7('0x36')](_0x2fa7ed[_0xf4e7('0x2e')][_0xf4e7('0x36')]);_0x45b883[_0xf4e7('0x37')]=qs[_0xf4e7('0x30')](_['pick'](_0x2fa7ed[_0xf4e7('0x2e')],_0xd2548e[_0xf4e7('0x30')]));_0x45b883[_0xf4e7('0x37')][_0xf4e7('0x56')]=_0x45a09a['id'];if(_0x2fa7ed[_0xf4e7('0x2e')]['filter']){_0x45b883[_0xf4e7('0x37')]=_[_0xf4e7('0x4b')](_0x45b883['where'],{'$or':_[_0xf4e7('0x27')](_0x45b883['attributes'],function(_0xec097b){var _0x3d49cf={};_0x3d49cf[_0xec097b]={'$like':'%'+_0x2fa7ed['query'][_0xf4e7('0x39')]+'%'};return _0x3d49cf;})});}_0x45b883=_[_0xf4e7('0x4b')]({},_0x45b883,_0x2fa7ed[_0xf4e7('0x41')]);return db[_0xf4e7('0x5b')][_0xf4e7('0x19')]({'where':_0x45b883[_0xf4e7('0x37')]})[_0xf4e7('0x1f')](function(_0x4d682b){_0x102ed5[_0xf4e7('0x19')]=_0x4d682b;if(_0x2fa7ed['query'][_0xf4e7('0x40')]){_0x45b883[_0xf4e7('0x3c')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x45b883);})[_0xf4e7('0x1f')](function(_0x48ad82){_0x102ed5[_0xf4e7('0x3e')]=_0x48ad82;return _0x102ed5;});}})[_0xf4e7('0x1f')](respondWithFilteredResult(_0x16b2c3,_0x45b883))[_0xf4e7('0x3f')](handleError(_0x16b2c3,null));};exports[_0xf4e7('0x5c')]=function(_0x35c5d8,_0x28c48c,_0x5bc22d){var _0x47fd8e={};var _0x47c08a={};var _0x3b8170;var _0x57a6dd;return db['Campaign']['findOne']({'where':{'id':_0x35c5d8['params']['id']}})['then'](handleEntityNotFound(_0x28c48c,null))[_0xf4e7('0x1f')](function(_0x23b249){if(_0x23b249){_0x3b8170=_0x23b249;_0x47c08a[_0xf4e7('0x2c')]=_[_0xf4e7('0x2f')](db[_0xf4e7('0x5d')][_0xf4e7('0x28')]);_0x47c08a[_0xf4e7('0x2e')]=_[_0xf4e7('0x2f')](_0x35c5d8[_0xf4e7('0x2e')]);_0x47c08a['filters']=_[_0xf4e7('0x31')](_0x47c08a['model'],_0x47c08a[_0xf4e7('0x2e')]);_0x47fd8e['attributes']=_[_0xf4e7('0x31')](_0x47c08a[_0xf4e7('0x2c')],qs[_0xf4e7('0x32')](_0x35c5d8[_0xf4e7('0x2e')][_0xf4e7('0x32')]));_0x47fd8e[_0xf4e7('0x33')]=_0x47fd8e['attributes'][_0xf4e7('0x34')]?_0x47fd8e[_0xf4e7('0x33')]:_0x47c08a[_0xf4e7('0x2c')];_0x47fd8e[_0xf4e7('0x55')]=qs[_0xf4e7('0x36')](_0x35c5d8[_0xf4e7('0x2e')][_0xf4e7('0x36')]);_0x47fd8e[_0xf4e7('0x37')]=qs['filters'](_[_0xf4e7('0x38')](_0x35c5d8[_0xf4e7('0x2e')],_0x47c08a[_0xf4e7('0x30')]));if(_0x35c5d8['query'][_0xf4e7('0x39')]){_0x47fd8e[_0xf4e7('0x37')]=_[_0xf4e7('0x4b')](_0x47fd8e[_0xf4e7('0x37')],{'$or':_[_0xf4e7('0x27')](_0x47fd8e[_0xf4e7('0x33')],function(_0x27cb64){var _0x650668={};_0x650668[_0x27cb64]={'$like':'%'+_0x35c5d8[_0xf4e7('0x2e')][_0xf4e7('0x39')]+'%'};return _0x650668;})});}_0x47fd8e=_[_0xf4e7('0x4b')]({},_0x47fd8e,_0x35c5d8[_0xf4e7('0x41')]);return _0x3b8170['getLists'](_0x47fd8e);}})['then'](function(_0x1df9ef){if(_0x1df9ef){_0x57a6dd=_0x1df9ef['length'];if(!_0x35c5d8[_0xf4e7('0x2e')][_0xf4e7('0x54')](_0xf4e7('0x35'))){_0x47fd8e[_0xf4e7('0x18')]=qs[_0xf4e7('0x18')](_0x35c5d8['query'][_0xf4e7('0x18')]);_0x47fd8e[_0xf4e7('0x16')]=qs[_0xf4e7('0x16')](_0x35c5d8['query'][_0xf4e7('0x16')]);}return _0x3b8170[_0xf4e7('0x5c')](_0x47fd8e);}})[_0xf4e7('0x1f')](function(_0x27db3d){if(_0x27db3d){return _0x27db3d?{'count':_0x57a6dd,'rows':_0x27db3d}:null;}})[_0xf4e7('0x1f')](respondWithResult(_0x28c48c,null))[_0xf4e7('0x3f')](handleError(_0x28c48c,null));};exports[_0xf4e7('0x5e')]=function(_0x298f72,_0x5a5610,_0x4c9d2a){var _0x4b6d7f,_0x3e2421;return db[_0xf4e7('0x3b')][_0xf4e7('0x42')]({'where':{'id':_0x298f72[_0xf4e7('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5a5610,null))[_0xf4e7('0x1f')](function(_0x24fe8a){if(_0x24fe8a){_0x3e2421=_0x24fe8a;return _0x24fe8a[_0xf4e7('0x5e')](_0x298f72[_0xf4e7('0x44')]['ids'],_[_0xf4e7('0x4c')](_0x298f72[_0xf4e7('0x44')],[_0xf4e7('0x5f'),'id'])||{});}return null;})[_0xf4e7('0x60')](function(_0x2114a8){var _0xfe2a56;_0x4b6d7f=_0x2114a8||[];var _0x31e981=[];if(_0x2114a8){for(var _0x50ab11=0x0;_0x50ab11<_0x2114a8[_0xf4e7('0x34')];_0x50ab11+=0x1){var _0x2bba4d=_0x2114a8[_0x50ab11][_0xf4e7('0x21')]({'plain':!![]});_0x3e2421[_0xf4e7('0x61')]=_0x298f72[_0xf4e7('0x44')][_0xf4e7('0x61')]?_0x298f72['body'][_0xf4e7('0x61')]:_0x3e2421[_0xf4e7('0x61')];switch(_0x3e2421[_0xf4e7('0x61')]){case _0xf4e7('0x62'):_0xfe2a56=squel[_0xf4e7('0x63')]()[_0xf4e7('0x64')](_0xf4e7('0x65'))[_0xf4e7('0x66')]([_0xf4e7('0x67'),'scheduledAt',_0xf4e7('0x68'),_0xf4e7('0x69'),_0xf4e7('0x56'),_0xf4e7('0x4d'),'updatedAt'],squel[_0xf4e7('0x6a')]()[_0xf4e7('0x6b')](_0xf4e7('0x67'),'phone')[_0xf4e7('0x6b')]('NOW()',_0xf4e7('0x6c'))[_0xf4e7('0x6b')]('id','ContactId')[_0xf4e7('0x6b')](_0x2bba4d[_0xf4e7('0x6d')][_0xf4e7('0x6e')](),'ListId')[_0xf4e7('0x6b')](_0x298f72[_0xf4e7('0x4a')]['id'][_0xf4e7('0x6e')](),_0xf4e7('0x56'))[_0xf4e7('0x6b')](_0xf4e7('0x6f'),'createdAt')[_0xf4e7('0x6b')](_0xf4e7('0x6f'),_0xf4e7('0x4e'))[_0xf4e7('0x70')](_0xf4e7('0x71'))[_0xf4e7('0x37')](_0xf4e7('0x72'))['where'](_0xf4e7('0x73'),_0x2bba4d[_0xf4e7('0x6d')][_0xf4e7('0x6e')]())[_0xf4e7('0x37')](_0xf4e7('0x74'))['where'](_0xf4e7('0x75'),squel[_0xf4e7('0x6a')]()['field'](_0xf4e7('0x76'))[_0xf4e7('0x70')](_0xf4e7('0x77'))[_0xf4e7('0x37')](_0xf4e7('0x78'),_0x298f72[_0xf4e7('0x4a')]['id'][_0xf4e7('0x6e')]()))['where'](_0xf4e7('0x75'),squel[_0xf4e7('0x6a')]()[_0xf4e7('0x6b')]('COALESCE(phone,\x27\x27)')[_0xf4e7('0x70')](_0xf4e7('0x65'))[_0xf4e7('0x37')](_0xf4e7('0x78'),_0x298f72[_0xf4e7('0x4a')]['id'][_0xf4e7('0x6e')]())))[_0xf4e7('0x6e')]();break;case'onlyIfOpen':_0xfe2a56=squel['insert']()[_0xf4e7('0x64')](_0xf4e7('0x65'))['fromQuery']([_0xf4e7('0x67'),_0xf4e7('0x6c'),_0xf4e7('0x68'),_0xf4e7('0x69'),'CampaignId',_0xf4e7('0x4d'),_0xf4e7('0x4e')],squel[_0xf4e7('0x6a')]()[_0xf4e7('0x6b')](_0xf4e7('0x67'),'phone')[_0xf4e7('0x6b')](_0xf4e7('0x6f'),'scheduledAt')[_0xf4e7('0x6b')]('id',_0xf4e7('0x68'))[_0xf4e7('0x6b')](_0x2bba4d['CmListId'][_0xf4e7('0x6e')](),'ListId')[_0xf4e7('0x6b')](_0x298f72[_0xf4e7('0x4a')]['id'][_0xf4e7('0x6e')](),'CampaignId')[_0xf4e7('0x6b')](_0xf4e7('0x6f'),'createdAt')[_0xf4e7('0x6b')](_0xf4e7('0x6f'),_0xf4e7('0x4e'))[_0xf4e7('0x70')](_0xf4e7('0x71'))['where'](_0xf4e7('0x72'))[_0xf4e7('0x37')]('ListId\x20=\x20?',_0x2bba4d[_0xf4e7('0x6d')][_0xf4e7('0x6e')]())[_0xf4e7('0x37')](_0xf4e7('0x74'))[_0xf4e7('0x37')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf4e7('0x6a')]()[_0xf4e7('0x6b')](_0xf4e7('0x79'))[_0xf4e7('0x70')](_0xf4e7('0x65'))[_0xf4e7('0x37')](_0xf4e7('0x78'),_0x298f72[_0xf4e7('0x4a')]['id']['toString']())))[_0xf4e7('0x6e')]();break;default:_0xfe2a56=squel[_0xf4e7('0x63')]()[_0xf4e7('0x64')]('cm_hopper')[_0xf4e7('0x66')]([_0xf4e7('0x67'),'scheduledAt','ContactId',_0xf4e7('0x69'),_0xf4e7('0x56'),'createdAt',_0xf4e7('0x4e')],squel[_0xf4e7('0x6a')]()[_0xf4e7('0x6b')](_0xf4e7('0x67'),_0xf4e7('0x67'))[_0xf4e7('0x6b')](_0xf4e7('0x6f'),'scheduledAt')['field']('id',_0xf4e7('0x68'))['field'](_0x2bba4d[_0xf4e7('0x6d')][_0xf4e7('0x6e')](),_0xf4e7('0x69'))[_0xf4e7('0x6b')](_0x298f72[_0xf4e7('0x4a')]['id'][_0xf4e7('0x6e')](),_0xf4e7('0x56'))['field'](_0xf4e7('0x6f'),_0xf4e7('0x4d'))[_0xf4e7('0x6b')]('NOW()',_0xf4e7('0x4e'))[_0xf4e7('0x70')]('cm_contacts')[_0xf4e7('0x37')]('deletedAt\x20IS\x20NULL')[_0xf4e7('0x37')]('ListId\x20=\x20?',_0x2bba4d[_0xf4e7('0x6d')]['toString']())[_0xf4e7('0x37')](_0xf4e7('0x74')))[_0xf4e7('0x6e')]();}_0x31e981['push'](db['sequelize'][_0xf4e7('0x2e')](_0xfe2a56));}return BPromise['all'](_0x31e981);}})[_0xf4e7('0x1f')](function(){return _0x4b6d7f;})[_0xf4e7('0x1f')](respondWithResult(_0x5a5610,null))[_0xf4e7('0x3f')](handleError(_0x5a5610,null));};exports['removeLists']=function(_0x5c51a0,_0x5b100b,_0x50cbf3){return db[_0xf4e7('0x3b')][_0xf4e7('0x42')]({'where':{'id':_0x5c51a0[_0xf4e7('0x4a')]['id']}})[_0xf4e7('0x1f')](handleEntityNotFound(_0x5b100b,null))['then'](function(_0x21813a){if(_0x21813a){return _0x21813a[_0xf4e7('0x7a')](_0x5c51a0[_0xf4e7('0x2e')][_0xf4e7('0x5f')]);}})[_0xf4e7('0x1f')](function(_0x2342fb){if(_0x2342fb){return db['CmHopper'][_0xf4e7('0x20')]({'where':{'ListId':_0x5c51a0[_0xf4e7('0x2e')]['ids'],'CampaignId':_0x5c51a0['params']['id']}})['then'](function(){return _0x2342fb;});}})[_0xf4e7('0x1f')](respondWithStatusCode(_0x5b100b,null))[_0xf4e7('0x3f')](handleError(_0x5b100b,null));};exports[_0xf4e7('0x7b')]=function(_0x105c66,_0x3ff03a,_0xa1a61e){var _0x2961db={};var _0xc98288={};var _0x549018;var _0x59c2b2;return db[_0xf4e7('0x3b')][_0xf4e7('0x52')]({'where':{'id':_0x105c66[_0xf4e7('0x4a')]['id']}})[_0xf4e7('0x1f')](handleEntityNotFound(_0x3ff03a,null))[_0xf4e7('0x1f')](function(_0x612d43){if(_0x612d43){_0x549018=_0x612d43;_0xc98288[_0xf4e7('0x2c')]=_[_0xf4e7('0x2f')](db[_0xf4e7('0x5d')][_0xf4e7('0x28')]);_0xc98288[_0xf4e7('0x2e')]=_[_0xf4e7('0x2f')](_0x105c66[_0xf4e7('0x2e')]);_0xc98288[_0xf4e7('0x30')]=_[_0xf4e7('0x31')](_0xc98288[_0xf4e7('0x2c')],_0xc98288[_0xf4e7('0x2e')]);_0x2961db[_0xf4e7('0x33')]=_[_0xf4e7('0x31')](_0xc98288[_0xf4e7('0x2c')],qs[_0xf4e7('0x32')](_0x105c66[_0xf4e7('0x2e')]['fields']));_0x2961db['attributes']=_0x2961db['attributes'][_0xf4e7('0x34')]?_0x2961db[_0xf4e7('0x33')]:_0xc98288[_0xf4e7('0x2c')];_0x2961db['order']=qs[_0xf4e7('0x36')](_0x105c66[_0xf4e7('0x2e')][_0xf4e7('0x36')]);_0x2961db[_0xf4e7('0x37')]=qs[_0xf4e7('0x30')](_['pick'](_0x105c66[_0xf4e7('0x2e')],_0xc98288[_0xf4e7('0x30')]));if(_0x105c66[_0xf4e7('0x2e')][_0xf4e7('0x39')]){_0x2961db[_0xf4e7('0x37')]=_[_0xf4e7('0x4b')](_0x2961db['where'],{'$or':_[_0xf4e7('0x27')](_0x2961db[_0xf4e7('0x33')],function(_0x530d1b){var _0x1059b6={};_0x1059b6[_0x530d1b]={'$like':'%'+_0x105c66[_0xf4e7('0x2e')][_0xf4e7('0x39')]+'%'};return _0x1059b6;})});}_0x2961db=_[_0xf4e7('0x4b')]({},_0x2961db,_0x105c66[_0xf4e7('0x41')]);return _0x549018[_0xf4e7('0x7b')](_0x2961db);}})[_0xf4e7('0x1f')](function(_0x461957){if(_0x461957){_0x59c2b2=_0x461957['length'];if(!_0x105c66[_0xf4e7('0x2e')][_0xf4e7('0x54')](_0xf4e7('0x35'))){_0x2961db[_0xf4e7('0x18')]=qs['limit'](_0x105c66[_0xf4e7('0x2e')][_0xf4e7('0x18')]);_0x2961db[_0xf4e7('0x16')]=qs['offset'](_0x105c66[_0xf4e7('0x2e')][_0xf4e7('0x16')]);}return _0x549018[_0xf4e7('0x7b')](_0x2961db);}})[_0xf4e7('0x1f')](function(_0x42082f){if(_0x42082f){return _0x42082f?{'count':_0x59c2b2,'rows':_0x42082f}:null;}})[_0xf4e7('0x1f')](respondWithResult(_0x3ff03a,null))[_0xf4e7('0x3f')](handleError(_0x3ff03a,null));};exports[_0xf4e7('0x7c')]=function(_0x2135fb,_0x395d0c,_0x3f1f53){var _0x49970a,_0x5f04f0;return db[_0xf4e7('0x3b')][_0xf4e7('0x42')]({'where':{'id':_0x2135fb[_0xf4e7('0x4a')]['id']}})[_0xf4e7('0x1f')](handleEntityNotFound(_0x395d0c,null))[_0xf4e7('0x1f')](function(_0x5c05f0){if(_0x5c05f0){_0x5f04f0=_0x5c05f0;return _0x5c05f0['addBlackLists'](_0x2135fb['body'][_0xf4e7('0x5f')],_[_0xf4e7('0x4c')](_0x2135fb[_0xf4e7('0x44')],[_0xf4e7('0x5f'),'id'])||{});}return null;})[_0xf4e7('0x60')](function(_0x4c3d4c){var _0xc85f72;_0x49970a=_0x4c3d4c||[];var _0xc0013d=[];if(_0x4c3d4c){for(var _0x5f5109=0x0;_0x5f5109<_0x4c3d4c['length'];_0x5f5109+=0x1){var _0x27c58a=_0x4c3d4c[_0x5f5109][_0xf4e7('0x21')]({'plain':!![]});_0xc85f72=squel[_0xf4e7('0x63')]()[_0xf4e7('0x64')](_0xf4e7('0x7d'))[_0xf4e7('0x66')]([_0xf4e7('0x67'),'ContactId',_0xf4e7('0x69'),_0xf4e7('0x56'),_0xf4e7('0x4d'),'updatedAt'],squel['select']()['field'](_0xf4e7('0x67'),_0xf4e7('0x67'))[_0xf4e7('0x6b')]('id','ContactId')[_0xf4e7('0x6b')](_0x27c58a[_0xf4e7('0x6d')]['toString'](),_0xf4e7('0x69'))[_0xf4e7('0x6b')](_0x2135fb[_0xf4e7('0x4a')]['id'][_0xf4e7('0x6e')](),_0xf4e7('0x56'))[_0xf4e7('0x6b')]('NOW()',_0xf4e7('0x4d'))[_0xf4e7('0x6b')](_0xf4e7('0x6f'),_0xf4e7('0x4e'))['from'](_0xf4e7('0x71'))[_0xf4e7('0x37')]('deletedAt\x20IS\x20NULL')[_0xf4e7('0x37')](_0xf4e7('0x73'),_0x27c58a[_0xf4e7('0x6d')]['toString']())['where'](_0xf4e7('0x74')))[_0xf4e7('0x6e')]();_0xc0013d[_0xf4e7('0x7e')](db[_0xf4e7('0x7f')][_0xf4e7('0x2e')](_0xc85f72));}return BPromise['all'](_0xc0013d);}})[_0xf4e7('0x1f')](function(){return _0x49970a;})[_0xf4e7('0x1f')](respondWithResult(_0x395d0c,null))[_0xf4e7('0x3f')](handleError(_0x395d0c,null));};exports[_0xf4e7('0x80')]=function(_0x2f9850,_0x5d32c3,_0x487ef5){return db[_0xf4e7('0x3b')]['find']({'where':{'id':_0x2f9850['params']['id']}})[_0xf4e7('0x1f')](handleEntityNotFound(_0x5d32c3,null))[_0xf4e7('0x1f')](function(_0x44d717){if(_0x44d717){return _0x44d717['removeBlackLists'](_0x2f9850[_0xf4e7('0x2e')][_0xf4e7('0x5f')]);}})[_0xf4e7('0x1f')](function(_0x285c32){if(_0x285c32){return db[_0xf4e7('0x5b')][_0xf4e7('0x20')]({'where':{'ListId':_0x2f9850[_0xf4e7('0x2e')][_0xf4e7('0x5f')],'CampaignId':_0x2f9850[_0xf4e7('0x4a')]['id']}})['then'](function(){return _0x285c32;});}})[_0xf4e7('0x1f')](respondWithStatusCode(_0x5d32c3,null))[_0xf4e7('0x3f')](handleError(_0x5d32c3,null));};
\ No newline at end of file
+var _0xf1d0=['UserProfileSection','autoAssociation','clone','omit','updatedAt','body','createdAt','userProfileId','update','getHoppers','findOne','CmHopper','sort','CampaignId','getHopperHistories','CmHopperHistory','hasOwnProperty','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','phone\x20IS\x20NOT\x20NULL','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','UserProfileResource','error','name','send','index','map','Campaign','rawAttributes','fieldName','query','keys','filters','intersection','attributes','length','model','nolimit','order','pick','filter','merge','type','VIRTUAL','options','where','includeAll','include','findAll','rows','catch','show','params','fields','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns'];(function(_0x15e0f2,_0x6cedd7){var _0x4fe6a8=function(_0x3b20ee){while(--_0x3b20ee){_0x15e0f2['push'](_0x15e0f2['shift']());}};_0x4fe6a8(++_0x6cedd7);}(_0xf1d0,0x14e));var _0x0f1d=function(_0x49a811,_0x190495){_0x49a811=_0x49a811-0x0;var _0xd8ff9d=_0xf1d0[_0x49a811];return _0xd8ff9d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0f1d('0x0'));var zipdir=require(_0x0f1d('0x1'));var jsonpatch=require(_0x0f1d('0x2'));var rp=require(_0x0f1d('0x3'));var moment=require(_0x0f1d('0x4'));var BPromise=require(_0x0f1d('0x5'));var Mustache=require('mustache');var util=require(_0x0f1d('0x6'));var path=require(_0x0f1d('0x7'));var sox=require(_0x0f1d('0x8'));var csv=require(_0x0f1d('0x9'));var ejs=require(_0x0f1d('0xa'));var fs=require('fs');var fs_extra=require(_0x0f1d('0xb'));var _=require(_0x0f1d('0xc'));var squel=require(_0x0f1d('0xd'));var crypto=require(_0x0f1d('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0f1d('0xf'));var toCsv=require(_0x0f1d('0x9'));var querystring=require(_0x0f1d('0x10'));var Papa=require(_0x0f1d('0x11'));var Redis=require(_0x0f1d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0f1d('0x13'));var as=require(_0x0f1d('0x14'));var hardwareService=require(_0x0f1d('0x15'));var logger=require(_0x0f1d('0x16'))('api');var utils=require(_0x0f1d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0f1d('0x18'));var db=require(_0x0f1d('0x19'))['db'];function respondWithStatusCode(_0xe97674,_0xae51ce){_0xae51ce=_0xae51ce||0xcc;return function(_0x588911){if(_0x588911){return _0xe97674['sendStatus'](_0xae51ce);}return _0xe97674[_0x0f1d('0x1a')](_0xae51ce)[_0x0f1d('0x1b')]();};}function respondWithResult(_0x110fe9,_0x4e8a30){_0x4e8a30=_0x4e8a30||0xc8;return function(_0x4c777a){if(_0x4c777a){return _0x110fe9[_0x0f1d('0x1a')](_0x4e8a30)[_0x0f1d('0x1c')](_0x4c777a);}};}function respondWithFilteredResult(_0x5c754e,_0x2d0c35){return function(_0x437515){if(_0x437515){var _0x15dd24=typeof _0x2d0c35[_0x0f1d('0x1d')]===_0x0f1d('0x1e')&&typeof _0x2d0c35[_0x0f1d('0x1f')]===_0x0f1d('0x1e');var _0x359efa=_0x437515[_0x0f1d('0x20')];var _0x2d2090=_0x15dd24?0x0:_0x2d0c35[_0x0f1d('0x1d')];var _0x1d7318=_0x15dd24?_0x437515[_0x0f1d('0x20')]:_0x2d0c35[_0x0f1d('0x1d')]+_0x2d0c35[_0x0f1d('0x1f')];var _0x5d6b9f;if(_0x1d7318>=_0x359efa){_0x1d7318=_0x359efa;_0x5d6b9f=0xc8;}else{_0x5d6b9f=0xce;}_0x5c754e[_0x0f1d('0x1a')](_0x5d6b9f);return _0x5c754e[_0x0f1d('0x21')](_0x0f1d('0x22'),_0x2d2090+'-'+_0x1d7318+'/'+_0x359efa)[_0x0f1d('0x1c')](_0x437515);}return null;};}function patchUpdates(_0x3aa54f){return function(_0x34def9){try{jsonpatch[_0x0f1d('0x23')](_0x34def9,_0x3aa54f,!![]);}catch(_0x4fd625){return BPromise[_0x0f1d('0x24')](_0x4fd625);}return _0x34def9[_0x0f1d('0x25')]();};}function saveUpdates(_0x431ebf,_0x332217){return function(_0xec17bc){if(_0xec17bc){return _0xec17bc['update'](_0x431ebf)[_0x0f1d('0x26')](function(_0x118d79){return _0x118d79;});}return null;};}function removeEntity(_0x366524,_0x410bc7){return function(_0x2b8f58){if(_0x2b8f58){return _0x2b8f58[_0x0f1d('0x27')]()[_0x0f1d('0x26')](function(){var _0x463b3d=_0x2b8f58['get']({'plain':!![]});var _0x2cfef6='IvrCampaigns';return db[_0x0f1d('0x28')][_0x0f1d('0x27')]({'where':{'type':_0x2cfef6,'resourceId':_0x463b3d['id']}})[_0x0f1d('0x26')](function(){return _0x2b8f58;});})['then'](function(){_0x366524[_0x0f1d('0x1a')](0xcc)[_0x0f1d('0x1b')]();});}};}function handleEntityNotFound(_0x5dd3ae,_0x3e4b55){return function(_0x4484c2){if(!_0x4484c2){_0x5dd3ae['sendStatus'](0x194);}return _0x4484c2;};}function handleError(_0x1eb399,_0xce6962){_0xce6962=_0xce6962||0x1f4;return function(_0x16a6cd){logger[_0x0f1d('0x29')](_0x16a6cd['stack']);if(_0x16a6cd[_0x0f1d('0x2a')]){delete _0x16a6cd[_0x0f1d('0x2a')];}_0x1eb399['status'](_0xce6962)[_0x0f1d('0x2b')](_0x16a6cd);};}exports[_0x0f1d('0x2c')]=function(_0x5b132c,_0x28d627){var _0x124e6b={},_0x249da2={},_0x1278a3={'count':0x0,'rows':[]};var _0x5653c0=_[_0x0f1d('0x2d')](db[_0x0f1d('0x2e')][_0x0f1d('0x2f')],function(_0x392251){return{'name':_0x392251[_0x0f1d('0x30')],'type':_0x392251['type']['key']};});_0x249da2['model']=_['map'](_0x5653c0,_0x0f1d('0x2a'));_0x249da2[_0x0f1d('0x31')]=_[_0x0f1d('0x32')](_0x5b132c[_0x0f1d('0x31')]);_0x249da2[_0x0f1d('0x33')]=_[_0x0f1d('0x34')](_0x249da2['model'],_0x249da2[_0x0f1d('0x31')]);_0x124e6b[_0x0f1d('0x35')]=_[_0x0f1d('0x34')](_0x249da2['model'],qs['fields'](_0x5b132c[_0x0f1d('0x31')]['fields']));_0x124e6b[_0x0f1d('0x35')]=_0x124e6b[_0x0f1d('0x35')][_0x0f1d('0x36')]?_0x124e6b[_0x0f1d('0x35')]:_0x249da2[_0x0f1d('0x37')];if(!_0x5b132c[_0x0f1d('0x31')]['hasOwnProperty'](_0x0f1d('0x38'))){_0x124e6b[_0x0f1d('0x1f')]=qs[_0x0f1d('0x1f')](_0x5b132c[_0x0f1d('0x31')]['limit']);_0x124e6b['offset']=qs[_0x0f1d('0x1d')](_0x5b132c['query'][_0x0f1d('0x1d')]);}_0x124e6b[_0x0f1d('0x39')]=qs['sort'](_0x5b132c['query']['sort']);_0x124e6b['where']=qs[_0x0f1d('0x33')](_[_0x0f1d('0x3a')](_0x5b132c['query'],_0x249da2[_0x0f1d('0x33')]),_0x5653c0);if(_0x5b132c[_0x0f1d('0x31')][_0x0f1d('0x3b')]){_0x124e6b['where']=_[_0x0f1d('0x3c')](_0x124e6b['where'],{'$or':_[_0x0f1d('0x2d')](_0x5653c0,function(_0x5ecf4b){if(_0x5ecf4b[_0x0f1d('0x3d')]!==_0x0f1d('0x3e')){var _0x5ed744={};_0x5ed744[_0x5ecf4b[_0x0f1d('0x2a')]]={'$like':'%'+_0x5b132c[_0x0f1d('0x31')][_0x0f1d('0x3b')]+'%'};return _0x5ed744;}})});}_0x124e6b=_['merge']({},_0x124e6b,_0x5b132c[_0x0f1d('0x3f')]);var _0x1452de={'where':_0x124e6b[_0x0f1d('0x40')]};return db[_0x0f1d('0x2e')][_0x0f1d('0x20')](_0x1452de)[_0x0f1d('0x26')](function(_0xcac3f7){_0x1278a3[_0x0f1d('0x20')]=_0xcac3f7;if(_0x5b132c[_0x0f1d('0x31')][_0x0f1d('0x41')]){_0x124e6b[_0x0f1d('0x42')]=[{'all':!![]}];}return db[_0x0f1d('0x2e')][_0x0f1d('0x43')](_0x124e6b);})[_0x0f1d('0x26')](function(_0x236ea6){_0x1278a3[_0x0f1d('0x44')]=_0x236ea6;return _0x1278a3;})[_0x0f1d('0x26')](respondWithFilteredResult(_0x28d627,_0x124e6b))[_0x0f1d('0x45')](handleError(_0x28d627,null));};exports[_0x0f1d('0x46')]=function(_0x55712d,_0x510cdc){var _0x1771c6={'raw':![],'where':{'id':_0x55712d[_0x0f1d('0x47')]['id']}},_0x35aab3={};_0x35aab3[_0x0f1d('0x37')]=_[_0x0f1d('0x32')](db['Campaign'][_0x0f1d('0x2f')]);_0x35aab3[_0x0f1d('0x31')]=_[_0x0f1d('0x32')](_0x55712d[_0x0f1d('0x31')]);_0x35aab3['filters']=_['intersection'](_0x35aab3['model'],_0x35aab3[_0x0f1d('0x31')]);_0x1771c6[_0x0f1d('0x35')]=_[_0x0f1d('0x34')](_0x35aab3[_0x0f1d('0x37')],qs[_0x0f1d('0x48')](_0x55712d['query'][_0x0f1d('0x48')]));_0x1771c6[_0x0f1d('0x35')]=_0x1771c6[_0x0f1d('0x35')][_0x0f1d('0x36')]?_0x1771c6[_0x0f1d('0x35')]:_0x35aab3[_0x0f1d('0x37')];if(_0x55712d[_0x0f1d('0x31')][_0x0f1d('0x41')]){_0x1771c6['include']=[{'all':!![]}];}_0x1771c6=_[_0x0f1d('0x3c')]({},_0x1771c6,_0x55712d[_0x0f1d('0x3f')]);return db[_0x0f1d('0x2e')][_0x0f1d('0x49')](_0x1771c6)['then'](handleEntityNotFound(_0x510cdc,null))[_0x0f1d('0x26')](respondWithResult(_0x510cdc,null))[_0x0f1d('0x45')](handleError(_0x510cdc,null));};exports[_0x0f1d('0x4a')]=function(_0x136f15,_0x217eaf){return db[_0x0f1d('0x2e')][_0x0f1d('0x4a')](_0x136f15['body'],{})[_0x0f1d('0x26')](function(_0x2fa8a2){var _0x2d89ed=_0x136f15[_0x0f1d('0x4b')][_0x0f1d('0x4c')]({'plain':!![]});if(!_0x2d89ed)throw new Error(_0x0f1d('0x4d'));if(_0x2d89ed[_0x0f1d('0x4e')]==='user'){var _0x236ab1=_0x2fa8a2[_0x0f1d('0x4c')]({'plain':!![]});var _0x8307d3=_0x0f1d('0x4f');return db[_0x0f1d('0x50')]['find']({'where':{'name':_0x8307d3,'userProfileId':_0x2d89ed['userProfileId']},'raw':!![]})[_0x0f1d('0x26')](function(_0x5e2405){if(_0x5e2405&&_0x5e2405[_0x0f1d('0x51')]===0x0){return db[_0x0f1d('0x28')][_0x0f1d('0x4a')]({'name':_0x236ab1['name'],'resourceId':_0x236ab1['id'],'type':_0x5e2405[_0x0f1d('0x2a')],'sectionId':_0x5e2405['id']},{})[_0x0f1d('0x26')](function(){return _0x2fa8a2;});}else{return _0x2fa8a2;}})[_0x0f1d('0x45')](function(_0x211d61){logger[_0x0f1d('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x211d61);throw _0x211d61;});}return _0x2fa8a2;})[_0x0f1d('0x26')](respondWithResult(_0x217eaf,0xc9))[_0x0f1d('0x45')](handleError(_0x217eaf,null));};exports[_0x0f1d('0x52')]=function(_0x2d7aa8,_0x332d4c){var _0x474942={'where':{'id':_0x2d7aa8[_0x0f1d('0x47')]['id']}},_0x3e9c6e={};_0x3e9c6e[_0x0f1d('0x37')]=_['keys'](db[_0x0f1d('0x2e')][_0x0f1d('0x2f')]);_0x474942[_0x0f1d('0x35')]=_[_0x0f1d('0x34')](_0x3e9c6e[_0x0f1d('0x37')],qs[_0x0f1d('0x48')](_0x2d7aa8[_0x0f1d('0x31')][_0x0f1d('0x48')]));_0x474942[_0x0f1d('0x35')]=_0x474942[_0x0f1d('0x35')]['length']?_0x474942[_0x0f1d('0x35')]:_0x3e9c6e['model'];if(_0x2d7aa8[_0x0f1d('0x31')][_0x0f1d('0x41')]){_0x474942[_0x0f1d('0x42')]=[{'all':!![]}];}_0x474942=_[_0x0f1d('0x3c')]({},_0x474942,_0x2d7aa8[_0x0f1d('0x3f')]);return db[_0x0f1d('0x2e')][_0x0f1d('0x49')](_0x474942)[_0x0f1d('0x26')](handleEntityNotFound(_0x332d4c,null))[_0x0f1d('0x26')](function(_0x11b44b){if(_0x11b44b){var _0x3696de=_0x11b44b['get']({'plain':!![]});_0x3696de=qs[_0x0f1d('0x53')](_0x3696de,['id','createdAt',_0x0f1d('0x54')]);_0x2d7aa8[_0x0f1d('0x55')]=_[_0x0f1d('0x53')](_0x2d7aa8[_0x0f1d('0x55')],['id',_0x0f1d('0x56'),_0x0f1d('0x54')]);return db[_0x0f1d('0x2e')]['create'](_[_0x0f1d('0x3c')](_0x3696de,_0x2d7aa8[_0x0f1d('0x55')]),{'include':_0x2d7aa8[_0x0f1d('0x31')][_0x0f1d('0x41')]?[{'all':!![]}]:undefined})[_0x0f1d('0x26')](function(_0x294798){var _0x3456d3=_0x2d7aa8['user'][_0x0f1d('0x4c')]({'plain':!![]});if(!_0x3456d3)throw new Error(_0x0f1d('0x4d'));if(_0x3456d3[_0x0f1d('0x4e')]===_0x0f1d('0x4b')){var _0xd20992=_0x294798[_0x0f1d('0x4c')]({'plain':!![]});var _0x518dd4=_0x0f1d('0x4f');return db[_0x0f1d('0x50')][_0x0f1d('0x49')]({'where':{'name':_0x518dd4,'userProfileId':_0x3456d3[_0x0f1d('0x57')]},'raw':!![]})[_0x0f1d('0x26')](function(_0xda5fa0){if(_0xda5fa0&&_0xda5fa0[_0x0f1d('0x51')]===0x0){return db[_0x0f1d('0x28')]['create']({'name':_0xd20992[_0x0f1d('0x2a')],'resourceId':_0xd20992['id'],'type':_0xda5fa0[_0x0f1d('0x2a')],'sectionId':_0xda5fa0['id']},{})[_0x0f1d('0x26')](function(){return _0x294798;});}else{return _0x294798;}})[_0x0f1d('0x45')](function(_0x2847ab){logger[_0x0f1d('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2847ab);throw _0x2847ab;});}return _0x294798;});}})[_0x0f1d('0x26')](respondWithResult(_0x332d4c,0xc9))['catch'](handleError(_0x332d4c,null));};exports[_0x0f1d('0x58')]=function(_0x44c696,_0x3dc8c0){if(_0x44c696['body']['id']){delete _0x44c696[_0x0f1d('0x55')]['id'];}return db['Campaign']['find']({'where':{'id':_0x44c696['params']['id']}})[_0x0f1d('0x26')](handleEntityNotFound(_0x3dc8c0,null))[_0x0f1d('0x26')](saveUpdates(_0x44c696[_0x0f1d('0x55')],null))['then'](respondWithResult(_0x3dc8c0,null))[_0x0f1d('0x45')](handleError(_0x3dc8c0,null));};exports[_0x0f1d('0x27')]=function(_0x40e270,_0x1228a9){return db[_0x0f1d('0x2e')][_0x0f1d('0x49')]({'where':{'id':_0x40e270[_0x0f1d('0x47')]['id']}})[_0x0f1d('0x26')](handleEntityNotFound(_0x1228a9,null))['then'](removeEntity(_0x1228a9,null))['catch'](handleError(_0x1228a9,null));};exports[_0x0f1d('0x59')]=function(_0x546f14,_0xffa600,_0x138a1d){var _0x44b358={'raw':!![],'where':{}};var _0x7560d1={};var _0xd8bcd1={'count':0x0,'rows':[]};return db[_0x0f1d('0x2e')][_0x0f1d('0x5a')]({'where':{'id':_0x546f14[_0x0f1d('0x47')]['id']}})[_0x0f1d('0x26')](handleEntityNotFound(_0xffa600,null))[_0x0f1d('0x26')](function(_0x1ebb37){if(_0x1ebb37){_0x7560d1[_0x0f1d('0x37')]=_[_0x0f1d('0x32')](db[_0x0f1d('0x5b')][_0x0f1d('0x2f')]);_0x7560d1[_0x0f1d('0x31')]=_[_0x0f1d('0x32')](_0x546f14[_0x0f1d('0x31')]);_0x7560d1[_0x0f1d('0x33')]=_[_0x0f1d('0x34')](_0x7560d1[_0x0f1d('0x37')],_0x7560d1[_0x0f1d('0x31')]);_0x44b358[_0x0f1d('0x35')]=_[_0x0f1d('0x34')](_0x7560d1[_0x0f1d('0x37')],qs['fields'](_0x546f14['query'][_0x0f1d('0x48')]));_0x44b358[_0x0f1d('0x35')]=_0x44b358[_0x0f1d('0x35')][_0x0f1d('0x36')]?_0x44b358['attributes']:_0x7560d1[_0x0f1d('0x37')];if(!_0x546f14['query']['hasOwnProperty'](_0x0f1d('0x38'))){_0x44b358[_0x0f1d('0x1f')]=qs[_0x0f1d('0x1f')](_0x546f14['query'][_0x0f1d('0x1f')]);_0x44b358['offset']=qs[_0x0f1d('0x1d')](_0x546f14[_0x0f1d('0x31')][_0x0f1d('0x1d')]);}_0x44b358[_0x0f1d('0x39')]=qs[_0x0f1d('0x5c')](_0x546f14[_0x0f1d('0x31')][_0x0f1d('0x5c')]);_0x44b358['where']=qs[_0x0f1d('0x33')](_[_0x0f1d('0x3a')](_0x546f14[_0x0f1d('0x31')],_0x7560d1[_0x0f1d('0x33')]));_0x44b358[_0x0f1d('0x40')][_0x0f1d('0x5d')]=_0x1ebb37['id'];if(_0x546f14[_0x0f1d('0x31')][_0x0f1d('0x3b')]){_0x44b358[_0x0f1d('0x40')]=_[_0x0f1d('0x3c')](_0x44b358['where'],{'$or':_[_0x0f1d('0x2d')](_0x44b358[_0x0f1d('0x35')],function(_0xcaee3c){var _0x244ae3={};_0x244ae3[_0xcaee3c]={'$like':'%'+_0x546f14[_0x0f1d('0x31')]['filter']+'%'};return _0x244ae3;})});}_0x44b358=_[_0x0f1d('0x3c')]({},_0x44b358,_0x546f14['options']);return db[_0x0f1d('0x5b')]['count']({'where':_0x44b358['where']})[_0x0f1d('0x26')](function(_0x1bd4c1){_0xd8bcd1['count']=_0x1bd4c1;if(_0x546f14[_0x0f1d('0x31')]['includeAll']){_0x44b358[_0x0f1d('0x42')]=[{'all':!![]}];}return db[_0x0f1d('0x5b')][_0x0f1d('0x43')](_0x44b358);})[_0x0f1d('0x26')](function(_0x6ca121){_0xd8bcd1[_0x0f1d('0x44')]=_0x6ca121;return _0xd8bcd1;});}})[_0x0f1d('0x26')](respondWithFilteredResult(_0xffa600,_0x44b358))[_0x0f1d('0x45')](handleError(_0xffa600,null));};exports[_0x0f1d('0x5e')]=function(_0x4540b4,_0x4f506c,_0x33c165){var _0x589c90={'raw':!![],'where':{}};var _0xc5c44={};var _0x757647={'count':0x0,'rows':[]};return db[_0x0f1d('0x2e')][_0x0f1d('0x5a')]({'where':{'id':_0x4540b4[_0x0f1d('0x47')]['id']}})[_0x0f1d('0x26')](handleEntityNotFound(_0x4f506c,null))['then'](function(_0x2430b7){if(_0x2430b7){_0xc5c44[_0x0f1d('0x37')]=_['keys'](db[_0x0f1d('0x5f')][_0x0f1d('0x2f')]);_0xc5c44[_0x0f1d('0x31')]=_[_0x0f1d('0x32')](_0x4540b4[_0x0f1d('0x31')]);_0xc5c44[_0x0f1d('0x33')]=_['intersection'](_0xc5c44[_0x0f1d('0x37')],_0xc5c44['query']);_0x589c90[_0x0f1d('0x35')]=_['intersection'](_0xc5c44[_0x0f1d('0x37')],qs[_0x0f1d('0x48')](_0x4540b4['query'][_0x0f1d('0x48')]));_0x589c90[_0x0f1d('0x35')]=_0x589c90[_0x0f1d('0x35')][_0x0f1d('0x36')]?_0x589c90[_0x0f1d('0x35')]:_0xc5c44[_0x0f1d('0x37')];if(!_0x4540b4[_0x0f1d('0x31')][_0x0f1d('0x60')](_0x0f1d('0x38'))){_0x589c90[_0x0f1d('0x1f')]=qs['limit'](_0x4540b4[_0x0f1d('0x31')]['limit']);_0x589c90[_0x0f1d('0x1d')]=qs[_0x0f1d('0x1d')](_0x4540b4[_0x0f1d('0x31')]['offset']);}_0x589c90[_0x0f1d('0x39')]=qs['sort'](_0x4540b4['query'][_0x0f1d('0x5c')]);_0x589c90[_0x0f1d('0x40')]=qs[_0x0f1d('0x33')](_[_0x0f1d('0x3a')](_0x4540b4[_0x0f1d('0x31')],_0xc5c44[_0x0f1d('0x33')]));_0x589c90[_0x0f1d('0x40')]['CampaignId']=_0x2430b7['id'];if(_0x4540b4[_0x0f1d('0x31')][_0x0f1d('0x3b')]){_0x589c90[_0x0f1d('0x40')]=_[_0x0f1d('0x3c')](_0x589c90[_0x0f1d('0x40')],{'$or':_[_0x0f1d('0x2d')](_0x589c90['attributes'],function(_0x3ce615){var _0x1c7a3c={};_0x1c7a3c[_0x3ce615]={'$like':'%'+_0x4540b4[_0x0f1d('0x31')][_0x0f1d('0x3b')]+'%'};return _0x1c7a3c;})});}_0x589c90=_['merge']({},_0x589c90,_0x4540b4[_0x0f1d('0x3f')]);return db[_0x0f1d('0x5f')][_0x0f1d('0x20')]({'where':_0x589c90['where']})[_0x0f1d('0x26')](function(_0x9a251a){_0x757647['count']=_0x9a251a;if(_0x4540b4[_0x0f1d('0x31')][_0x0f1d('0x41')]){_0x589c90[_0x0f1d('0x42')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x0f1d('0x43')](_0x589c90);})[_0x0f1d('0x26')](function(_0x17472e){_0x757647['rows']=_0x17472e;return _0x757647;});}})[_0x0f1d('0x26')](respondWithFilteredResult(_0x4f506c,_0x589c90))[_0x0f1d('0x45')](handleError(_0x4f506c,null));};exports[_0x0f1d('0x61')]=function(_0xb4f8a1,_0xe42d28,_0x5af229){var _0x3d0ea9={'raw':!![],'where':{}};var _0x5272f9={};var _0xefe68a={'count':0x0,'rows':[]};return db['Campaign'][_0x0f1d('0x5a')]({'where':{'id':_0xb4f8a1['params']['id']}})[_0x0f1d('0x26')](handleEntityNotFound(_0xe42d28,null))['then'](function(_0x1b8926){if(_0x1b8926){_0x5272f9['model']=_['keys'](db[_0x0f1d('0x62')]['rawAttributes']);_0x5272f9[_0x0f1d('0x31')]=_[_0x0f1d('0x32')](_0xb4f8a1[_0x0f1d('0x31')]);_0x5272f9[_0x0f1d('0x33')]=_[_0x0f1d('0x34')](_0x5272f9[_0x0f1d('0x37')],_0x5272f9[_0x0f1d('0x31')]);_0x3d0ea9[_0x0f1d('0x35')]=_[_0x0f1d('0x34')](_0x5272f9[_0x0f1d('0x37')],qs['fields'](_0xb4f8a1[_0x0f1d('0x31')][_0x0f1d('0x48')]));_0x3d0ea9[_0x0f1d('0x35')]=_0x3d0ea9[_0x0f1d('0x35')]['length']?_0x3d0ea9[_0x0f1d('0x35')]:_0x5272f9[_0x0f1d('0x37')];if(!_0xb4f8a1[_0x0f1d('0x31')][_0x0f1d('0x60')](_0x0f1d('0x38'))){_0x3d0ea9['limit']=qs[_0x0f1d('0x1f')](_0xb4f8a1['query'][_0x0f1d('0x1f')]);_0x3d0ea9[_0x0f1d('0x1d')]=qs[_0x0f1d('0x1d')](_0xb4f8a1[_0x0f1d('0x31')][_0x0f1d('0x1d')]);}_0x3d0ea9[_0x0f1d('0x39')]=qs[_0x0f1d('0x5c')](_0xb4f8a1[_0x0f1d('0x31')][_0x0f1d('0x5c')]);_0x3d0ea9[_0x0f1d('0x40')]=qs[_0x0f1d('0x33')](_['pick'](_0xb4f8a1[_0x0f1d('0x31')],_0x5272f9[_0x0f1d('0x33')]));_0x3d0ea9[_0x0f1d('0x40')][_0x0f1d('0x5d')]=_0x1b8926['id'];if(_0xb4f8a1[_0x0f1d('0x31')][_0x0f1d('0x3b')]){_0x3d0ea9['where']=_['merge'](_0x3d0ea9[_0x0f1d('0x40')],{'$or':_[_0x0f1d('0x2d')](_0x3d0ea9[_0x0f1d('0x35')],function(_0x5dd310){var _0x145d4c={};_0x145d4c[_0x5dd310]={'$like':'%'+_0xb4f8a1[_0x0f1d('0x31')]['filter']+'%'};return _0x145d4c;})});}_0x3d0ea9=_[_0x0f1d('0x3c')]({},_0x3d0ea9,_0xb4f8a1['options']);return db[_0x0f1d('0x62')][_0x0f1d('0x20')]({'where':_0x3d0ea9[_0x0f1d('0x40')]})['then'](function(_0xf50775){_0xefe68a[_0x0f1d('0x20')]=_0xf50775;if(_0xb4f8a1[_0x0f1d('0x31')][_0x0f1d('0x41')]){_0x3d0ea9[_0x0f1d('0x42')]=[{'all':!![]}];}return db[_0x0f1d('0x62')][_0x0f1d('0x43')](_0x3d0ea9);})[_0x0f1d('0x26')](function(_0x2c863d){_0xefe68a[_0x0f1d('0x44')]=_0x2c863d;return _0xefe68a;});}})[_0x0f1d('0x26')](respondWithFilteredResult(_0xe42d28,_0x3d0ea9))[_0x0f1d('0x45')](handleError(_0xe42d28,null));};exports[_0x0f1d('0x63')]=function(_0x3ca8a8,_0x50049c,_0x4d4070){var _0x5a68a6={'raw':!![],'where':{}};var _0x6b3321={};var _0x1911f4={'count':0x0,'rows':[]};return db[_0x0f1d('0x2e')][_0x0f1d('0x5a')]({'where':{'id':_0x3ca8a8['params']['id']}})['then'](handleEntityNotFound(_0x50049c,null))[_0x0f1d('0x26')](function(_0x50bb67){if(_0x50bb67){_0x6b3321['model']=_['keys'](db['CmHopperBlack'][_0x0f1d('0x2f')]);_0x6b3321[_0x0f1d('0x31')]=_[_0x0f1d('0x32')](_0x3ca8a8[_0x0f1d('0x31')]);_0x6b3321[_0x0f1d('0x33')]=_['intersection'](_0x6b3321[_0x0f1d('0x37')],_0x6b3321[_0x0f1d('0x31')]);_0x5a68a6[_0x0f1d('0x35')]=_['intersection'](_0x6b3321[_0x0f1d('0x37')],qs[_0x0f1d('0x48')](_0x3ca8a8[_0x0f1d('0x31')]['fields']));_0x5a68a6[_0x0f1d('0x35')]=_0x5a68a6['attributes'][_0x0f1d('0x36')]?_0x5a68a6[_0x0f1d('0x35')]:_0x6b3321[_0x0f1d('0x37')];if(!_0x3ca8a8[_0x0f1d('0x31')]['hasOwnProperty'](_0x0f1d('0x38'))){_0x5a68a6[_0x0f1d('0x1f')]=qs[_0x0f1d('0x1f')](_0x3ca8a8['query'][_0x0f1d('0x1f')]);_0x5a68a6[_0x0f1d('0x1d')]=qs[_0x0f1d('0x1d')](_0x3ca8a8[_0x0f1d('0x31')][_0x0f1d('0x1d')]);}_0x5a68a6[_0x0f1d('0x39')]=qs[_0x0f1d('0x5c')](_0x3ca8a8[_0x0f1d('0x31')][_0x0f1d('0x5c')]);_0x5a68a6[_0x0f1d('0x40')]=qs['filters'](_['pick'](_0x3ca8a8['query'],_0x6b3321[_0x0f1d('0x33')]));_0x5a68a6[_0x0f1d('0x40')]['CampaignId']=_0x50bb67['id'];if(_0x3ca8a8[_0x0f1d('0x31')]['filter']){_0x5a68a6[_0x0f1d('0x40')]=_['merge'](_0x5a68a6[_0x0f1d('0x40')],{'$or':_['map'](_0x5a68a6[_0x0f1d('0x35')],function(_0x5def1a){var _0x21e5bf={};_0x21e5bf[_0x5def1a]={'$like':'%'+_0x3ca8a8['query']['filter']+'%'};return _0x21e5bf;})});}_0x5a68a6=_[_0x0f1d('0x3c')]({},_0x5a68a6,_0x3ca8a8['options']);return db[_0x0f1d('0x64')]['count']({'where':_0x5a68a6[_0x0f1d('0x40')]})[_0x0f1d('0x26')](function(_0x34acfe){_0x1911f4[_0x0f1d('0x20')]=_0x34acfe;if(_0x3ca8a8[_0x0f1d('0x31')][_0x0f1d('0x41')]){_0x5a68a6[_0x0f1d('0x42')]=[{'all':!![]}];}return db[_0x0f1d('0x64')]['findAll'](_0x5a68a6);})[_0x0f1d('0x26')](function(_0x279497){_0x1911f4[_0x0f1d('0x44')]=_0x279497;return _0x1911f4;});}})[_0x0f1d('0x26')](respondWithFilteredResult(_0x50049c,_0x5a68a6))[_0x0f1d('0x45')](handleError(_0x50049c,null));};exports['getLists']=function(_0x2bd770,_0x5d5433,_0x5ccb46){var _0x2c910b={};var _0x147c0f={};var _0x1db61f;var _0x201075;return db[_0x0f1d('0x2e')]['findOne']({'where':{'id':_0x2bd770[_0x0f1d('0x47')]['id']}})['then'](handleEntityNotFound(_0x5d5433,null))[_0x0f1d('0x26')](function(_0x1aeaa0){if(_0x1aeaa0){_0x1db61f=_0x1aeaa0;_0x147c0f['model']=_[_0x0f1d('0x32')](db['CmList'][_0x0f1d('0x2f')]);_0x147c0f[_0x0f1d('0x31')]=_[_0x0f1d('0x32')](_0x2bd770[_0x0f1d('0x31')]);_0x147c0f[_0x0f1d('0x33')]=_[_0x0f1d('0x34')](_0x147c0f[_0x0f1d('0x37')],_0x147c0f[_0x0f1d('0x31')]);_0x2c910b['attributes']=_['intersection'](_0x147c0f[_0x0f1d('0x37')],qs[_0x0f1d('0x48')](_0x2bd770[_0x0f1d('0x31')][_0x0f1d('0x48')]));_0x2c910b[_0x0f1d('0x35')]=_0x2c910b[_0x0f1d('0x35')]['length']?_0x2c910b['attributes']:_0x147c0f['model'];_0x2c910b[_0x0f1d('0x39')]=qs[_0x0f1d('0x5c')](_0x2bd770[_0x0f1d('0x31')][_0x0f1d('0x5c')]);_0x2c910b[_0x0f1d('0x40')]=qs[_0x0f1d('0x33')](_[_0x0f1d('0x3a')](_0x2bd770[_0x0f1d('0x31')],_0x147c0f[_0x0f1d('0x33')]));if(_0x2bd770[_0x0f1d('0x31')][_0x0f1d('0x3b')]){_0x2c910b['where']=_[_0x0f1d('0x3c')](_0x2c910b[_0x0f1d('0x40')],{'$or':_[_0x0f1d('0x2d')](_0x2c910b[_0x0f1d('0x35')],function(_0x4eec68){var _0x496288={};_0x496288[_0x4eec68]={'$like':'%'+_0x2bd770[_0x0f1d('0x31')][_0x0f1d('0x3b')]+'%'};return _0x496288;})});}_0x2c910b=_['merge']({},_0x2c910b,_0x2bd770[_0x0f1d('0x3f')]);return _0x1db61f[_0x0f1d('0x65')](_0x2c910b);}})[_0x0f1d('0x26')](function(_0x27fb3d){if(_0x27fb3d){_0x201075=_0x27fb3d[_0x0f1d('0x36')];if(!_0x2bd770[_0x0f1d('0x31')]['hasOwnProperty'](_0x0f1d('0x38'))){_0x2c910b['limit']=qs[_0x0f1d('0x1f')](_0x2bd770['query'][_0x0f1d('0x1f')]);_0x2c910b['offset']=qs[_0x0f1d('0x1d')](_0x2bd770[_0x0f1d('0x31')]['offset']);}return _0x1db61f[_0x0f1d('0x65')](_0x2c910b);}})[_0x0f1d('0x26')](function(_0x1bac02){if(_0x1bac02){return _0x1bac02?{'count':_0x201075,'rows':_0x1bac02}:null;}})[_0x0f1d('0x26')](respondWithResult(_0x5d5433,null))[_0x0f1d('0x45')](handleError(_0x5d5433,null));};exports[_0x0f1d('0x66')]=function(_0x34c8eb,_0x16008b,_0x21056f){var _0x5ece51,_0x235e64;return db[_0x0f1d('0x2e')]['find']({'where':{'id':_0x34c8eb[_0x0f1d('0x47')]['id']}})[_0x0f1d('0x26')](handleEntityNotFound(_0x16008b,null))[_0x0f1d('0x26')](function(_0x34704a){if(_0x34704a){_0x235e64=_0x34704a;return _0x34704a[_0x0f1d('0x66')](_0x34c8eb[_0x0f1d('0x55')]['ids'],_[_0x0f1d('0x53')](_0x34c8eb['body'],[_0x0f1d('0x67'),'id'])||{});}return null;})[_0x0f1d('0x68')](function(_0x2a3910){var _0x3d2ea2;_0x5ece51=_0x2a3910||[];var _0x2c8be0=[];if(_0x2a3910){for(var _0x36d0f9=0x0;_0x36d0f9<_0x2a3910['length'];_0x36d0f9+=0x1){var _0x392d98=_0x2a3910[_0x36d0f9][_0x0f1d('0x4c')]({'plain':!![]});_0x235e64[_0x0f1d('0x69')]=_0x34c8eb[_0x0f1d('0x55')][_0x0f1d('0x69')]?_0x34c8eb['body'][_0x0f1d('0x69')]:_0x235e64[_0x0f1d('0x69')];switch(_0x235e64[_0x0f1d('0x69')]){case _0x0f1d('0x6a'):_0x3d2ea2=squel[_0x0f1d('0x6b')]()[_0x0f1d('0x6c')](_0x0f1d('0x6d'))[_0x0f1d('0x6e')]([_0x0f1d('0x6f'),_0x0f1d('0x70'),_0x0f1d('0x71'),_0x0f1d('0x72'),_0x0f1d('0x5d'),_0x0f1d('0x56'),_0x0f1d('0x54')],squel[_0x0f1d('0x73')]()[_0x0f1d('0x74')](_0x0f1d('0x6f'),'phone')['field'](_0x0f1d('0x75'),_0x0f1d('0x70'))['field']('id',_0x0f1d('0x71'))['field'](_0x392d98[_0x0f1d('0x76')][_0x0f1d('0x77')](),_0x0f1d('0x72'))[_0x0f1d('0x74')](_0x34c8eb['params']['id'][_0x0f1d('0x77')](),_0x0f1d('0x5d'))[_0x0f1d('0x74')]('NOW()',_0x0f1d('0x56'))[_0x0f1d('0x74')]('NOW()','updatedAt')[_0x0f1d('0x78')](_0x0f1d('0x79'))[_0x0f1d('0x40')](_0x0f1d('0x7a'))[_0x0f1d('0x40')](_0x0f1d('0x7b'),_0x392d98[_0x0f1d('0x76')]['toString']())[_0x0f1d('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0x0f1d('0x40')](_0x0f1d('0x7c'),squel[_0x0f1d('0x73')]()['field'](_0x0f1d('0x7d'))['from'](_0x0f1d('0x7e'))[_0x0f1d('0x40')](_0x0f1d('0x7f'),_0x34c8eb['params']['id'][_0x0f1d('0x77')]()))[_0x0f1d('0x40')](_0x0f1d('0x7c'),squel[_0x0f1d('0x73')]()['field'](_0x0f1d('0x80'))['from'](_0x0f1d('0x6d'))[_0x0f1d('0x40')]('CampaignId\x20=\x20?',_0x34c8eb['params']['id'][_0x0f1d('0x77')]())))[_0x0f1d('0x77')]();break;case'onlyIfOpen':_0x3d2ea2=squel[_0x0f1d('0x6b')]()['into']('cm_hopper')['fromQuery']([_0x0f1d('0x6f'),'scheduledAt',_0x0f1d('0x71'),_0x0f1d('0x72'),_0x0f1d('0x5d'),_0x0f1d('0x56'),'updatedAt'],squel[_0x0f1d('0x73')]()['field'](_0x0f1d('0x6f'),_0x0f1d('0x6f'))[_0x0f1d('0x74')](_0x0f1d('0x75'),_0x0f1d('0x70'))[_0x0f1d('0x74')]('id',_0x0f1d('0x71'))[_0x0f1d('0x74')](_0x392d98['CmListId']['toString'](),_0x0f1d('0x72'))[_0x0f1d('0x74')](_0x34c8eb[_0x0f1d('0x47')]['id'][_0x0f1d('0x77')](),_0x0f1d('0x5d'))['field'](_0x0f1d('0x75'),_0x0f1d('0x56'))[_0x0f1d('0x74')](_0x0f1d('0x75'),_0x0f1d('0x54'))[_0x0f1d('0x78')]('cm_contacts')[_0x0f1d('0x40')](_0x0f1d('0x7a'))[_0x0f1d('0x40')](_0x0f1d('0x7b'),_0x392d98[_0x0f1d('0x76')][_0x0f1d('0x77')]())['where'](_0x0f1d('0x81'))[_0x0f1d('0x40')](_0x0f1d('0x7c'),squel[_0x0f1d('0x73')]()[_0x0f1d('0x74')](_0x0f1d('0x80'))[_0x0f1d('0x78')](_0x0f1d('0x6d'))[_0x0f1d('0x40')](_0x0f1d('0x7f'),_0x34c8eb[_0x0f1d('0x47')]['id'][_0x0f1d('0x77')]())))[_0x0f1d('0x77')]();break;default:_0x3d2ea2=squel[_0x0f1d('0x6b')]()[_0x0f1d('0x6c')](_0x0f1d('0x6d'))[_0x0f1d('0x6e')]([_0x0f1d('0x6f'),_0x0f1d('0x70'),_0x0f1d('0x71'),_0x0f1d('0x72'),_0x0f1d('0x5d'),_0x0f1d('0x56'),'updatedAt'],squel[_0x0f1d('0x73')]()[_0x0f1d('0x74')](_0x0f1d('0x6f'),_0x0f1d('0x6f'))[_0x0f1d('0x74')](_0x0f1d('0x75'),_0x0f1d('0x70'))[_0x0f1d('0x74')]('id',_0x0f1d('0x71'))[_0x0f1d('0x74')](_0x392d98[_0x0f1d('0x76')][_0x0f1d('0x77')](),_0x0f1d('0x72'))[_0x0f1d('0x74')](_0x34c8eb[_0x0f1d('0x47')]['id']['toString'](),_0x0f1d('0x5d'))[_0x0f1d('0x74')](_0x0f1d('0x75'),_0x0f1d('0x56'))['field'](_0x0f1d('0x75'),_0x0f1d('0x54'))[_0x0f1d('0x78')]('cm_contacts')[_0x0f1d('0x40')]('deletedAt\x20IS\x20NULL')[_0x0f1d('0x40')]('ListId\x20=\x20?',_0x392d98[_0x0f1d('0x76')][_0x0f1d('0x77')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x0f1d('0x77')]();}_0x2c8be0[_0x0f1d('0x82')](db[_0x0f1d('0x83')][_0x0f1d('0x31')](_0x3d2ea2));}return BPromise[_0x0f1d('0x84')](_0x2c8be0);}})[_0x0f1d('0x26')](function(){return _0x5ece51;})[_0x0f1d('0x26')](respondWithResult(_0x16008b,null))['catch'](handleError(_0x16008b,null));};exports[_0x0f1d('0x85')]=function(_0x41d26a,_0x741c37,_0x26c998){return db[_0x0f1d('0x2e')][_0x0f1d('0x49')]({'where':{'id':_0x41d26a[_0x0f1d('0x47')]['id']}})[_0x0f1d('0x26')](handleEntityNotFound(_0x741c37,null))[_0x0f1d('0x26')](function(_0x42539a){if(_0x42539a){return _0x42539a['removeLists'](_0x41d26a[_0x0f1d('0x31')]['ids']);}})[_0x0f1d('0x26')](function(_0xfea660){if(_0xfea660){return db[_0x0f1d('0x5b')][_0x0f1d('0x27')]({'where':{'ListId':_0x41d26a['query'][_0x0f1d('0x67')],'CampaignId':_0x41d26a[_0x0f1d('0x47')]['id']}})[_0x0f1d('0x26')](function(){return _0xfea660;});}})[_0x0f1d('0x26')](respondWithStatusCode(_0x741c37,null))[_0x0f1d('0x45')](handleError(_0x741c37,null));};exports[_0x0f1d('0x86')]=function(_0x49766a,_0x27cff1,_0x13ef10){var _0x3feab8={};var _0x9f1d0a={};var _0x18d46f;var _0xf906e6;return db[_0x0f1d('0x2e')][_0x0f1d('0x5a')]({'where':{'id':_0x49766a[_0x0f1d('0x47')]['id']}})['then'](handleEntityNotFound(_0x27cff1,null))[_0x0f1d('0x26')](function(_0x5a8b0e){if(_0x5a8b0e){_0x18d46f=_0x5a8b0e;_0x9f1d0a[_0x0f1d('0x37')]=_['keys'](db[_0x0f1d('0x87')][_0x0f1d('0x2f')]);_0x9f1d0a[_0x0f1d('0x31')]=_[_0x0f1d('0x32')](_0x49766a['query']);_0x9f1d0a[_0x0f1d('0x33')]=_[_0x0f1d('0x34')](_0x9f1d0a['model'],_0x9f1d0a[_0x0f1d('0x31')]);_0x3feab8[_0x0f1d('0x35')]=_[_0x0f1d('0x34')](_0x9f1d0a[_0x0f1d('0x37')],qs[_0x0f1d('0x48')](_0x49766a['query'][_0x0f1d('0x48')]));_0x3feab8[_0x0f1d('0x35')]=_0x3feab8[_0x0f1d('0x35')][_0x0f1d('0x36')]?_0x3feab8[_0x0f1d('0x35')]:_0x9f1d0a[_0x0f1d('0x37')];_0x3feab8[_0x0f1d('0x39')]=qs[_0x0f1d('0x5c')](_0x49766a['query'][_0x0f1d('0x5c')]);_0x3feab8[_0x0f1d('0x40')]=qs[_0x0f1d('0x33')](_[_0x0f1d('0x3a')](_0x49766a[_0x0f1d('0x31')],_0x9f1d0a[_0x0f1d('0x33')]));if(_0x49766a['query'][_0x0f1d('0x3b')]){_0x3feab8[_0x0f1d('0x40')]=_[_0x0f1d('0x3c')](_0x3feab8['where'],{'$or':_[_0x0f1d('0x2d')](_0x3feab8['attributes'],function(_0x569cf7){var _0x2008e0={};_0x2008e0[_0x569cf7]={'$like':'%'+_0x49766a[_0x0f1d('0x31')]['filter']+'%'};return _0x2008e0;})});}_0x3feab8=_[_0x0f1d('0x3c')]({},_0x3feab8,_0x49766a[_0x0f1d('0x3f')]);return _0x18d46f['getBlackLists'](_0x3feab8);}})[_0x0f1d('0x26')](function(_0x4ae2a1){if(_0x4ae2a1){_0xf906e6=_0x4ae2a1[_0x0f1d('0x36')];if(!_0x49766a[_0x0f1d('0x31')]['hasOwnProperty']('nolimit')){_0x3feab8[_0x0f1d('0x1f')]=qs[_0x0f1d('0x1f')](_0x49766a[_0x0f1d('0x31')][_0x0f1d('0x1f')]);_0x3feab8[_0x0f1d('0x1d')]=qs[_0x0f1d('0x1d')](_0x49766a[_0x0f1d('0x31')][_0x0f1d('0x1d')]);}return _0x18d46f['getBlackLists'](_0x3feab8);}})[_0x0f1d('0x26')](function(_0x1fe2d1){if(_0x1fe2d1){return _0x1fe2d1?{'count':_0xf906e6,'rows':_0x1fe2d1}:null;}})[_0x0f1d('0x26')](respondWithResult(_0x27cff1,null))[_0x0f1d('0x45')](handleError(_0x27cff1,null));};exports[_0x0f1d('0x88')]=function(_0x37a03c,_0x3916a3,_0x2be678){var _0x35e251,_0x2e9ab3;return db[_0x0f1d('0x2e')][_0x0f1d('0x49')]({'where':{'id':_0x37a03c[_0x0f1d('0x47')]['id']}})[_0x0f1d('0x26')](handleEntityNotFound(_0x3916a3,null))[_0x0f1d('0x26')](function(_0x50493d){if(_0x50493d){_0x2e9ab3=_0x50493d;return _0x50493d[_0x0f1d('0x88')](_0x37a03c[_0x0f1d('0x55')]['ids'],_[_0x0f1d('0x53')](_0x37a03c[_0x0f1d('0x55')],[_0x0f1d('0x67'),'id'])||{});}return null;})['spread'](function(_0x4eab12){var _0x80f96e;_0x35e251=_0x4eab12||[];var _0x2a8ff7=[];if(_0x4eab12){for(var _0x44d86b=0x0;_0x44d86b<_0x4eab12[_0x0f1d('0x36')];_0x44d86b+=0x1){var _0x3b15ac=_0x4eab12[_0x44d86b][_0x0f1d('0x4c')]({'plain':!![]});_0x80f96e=squel[_0x0f1d('0x6b')]()['into']('cm_hopper_black')[_0x0f1d('0x6e')]([_0x0f1d('0x6f'),_0x0f1d('0x71'),'ListId',_0x0f1d('0x5d'),_0x0f1d('0x56'),_0x0f1d('0x54')],squel[_0x0f1d('0x73')]()[_0x0f1d('0x74')](_0x0f1d('0x6f'),_0x0f1d('0x6f'))['field']('id','ContactId')['field'](_0x3b15ac['CmListId'][_0x0f1d('0x77')](),_0x0f1d('0x72'))[_0x0f1d('0x74')](_0x37a03c[_0x0f1d('0x47')]['id'][_0x0f1d('0x77')](),_0x0f1d('0x5d'))[_0x0f1d('0x74')](_0x0f1d('0x75'),_0x0f1d('0x56'))['field']('NOW()',_0x0f1d('0x54'))['from'](_0x0f1d('0x79'))[_0x0f1d('0x40')](_0x0f1d('0x7a'))[_0x0f1d('0x40')](_0x0f1d('0x7b'),_0x3b15ac[_0x0f1d('0x76')]['toString']())[_0x0f1d('0x40')](_0x0f1d('0x81')))['toString']();_0x2a8ff7[_0x0f1d('0x82')](db['sequelize'][_0x0f1d('0x31')](_0x80f96e));}return BPromise[_0x0f1d('0x84')](_0x2a8ff7);}})[_0x0f1d('0x26')](function(){return _0x35e251;})['then'](respondWithResult(_0x3916a3,null))[_0x0f1d('0x45')](handleError(_0x3916a3,null));};exports[_0x0f1d('0x89')]=function(_0x336fdb,_0x1ab2ce,_0x4f8c41){return db[_0x0f1d('0x2e')][_0x0f1d('0x49')]({'where':{'id':_0x336fdb[_0x0f1d('0x47')]['id']}})[_0x0f1d('0x26')](handleEntityNotFound(_0x1ab2ce,null))[_0x0f1d('0x26')](function(_0x557c07){if(_0x557c07){return _0x557c07[_0x0f1d('0x89')](_0x336fdb[_0x0f1d('0x31')][_0x0f1d('0x67')]);}})[_0x0f1d('0x26')](function(_0x367852){if(_0x367852){return db['CmHopperBlack'][_0x0f1d('0x27')]({'where':{'ListId':_0x336fdb[_0x0f1d('0x31')][_0x0f1d('0x67')],'CampaignId':_0x336fdb[_0x0f1d('0x47')]['id']}})[_0x0f1d('0x26')](function(){return _0x367852;});}})[_0x0f1d('0x26')](respondWithStatusCode(_0x1ab2ce,null))[_0x0f1d('0x45')](handleError(_0x1ab2ce,null));};
\ No newline at end of file
index cf677b2..9f180d5 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(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_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':'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(_0x99682f,_0x471920){var _0x58bebd=function(_0x4bb66f){while(--_0x4bb66f){_0x99682f['push'](_0x99682f['shift']());}};_0x58bebd(++_0x471920);}(_0x7a54,0x106));var _0x47a5=function(_0x156659,_0x2b90b1){_0x156659=_0x156659-0x0;var _0x1ea875=_0x7a54[_0x156659];return _0x1ea875;};'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 81c26b4..0da1501 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2cb=['code','message','result','catch','GetCampaign','findAll','options','raw','where','attributes','map','include','model','then','util','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xe9ce81,_0x4d48bb){var _0x27c089=function(_0x27a214){while(--_0x27a214){_0xe9ce81['push'](_0xe9ce81['shift']());}};_0x27c089(++_0x4d48bb);}(_0xf2cb,0x130));var _0xbf2c=function(_0x1b2978,_0x2bfc85){_0x1b2978=_0x1b2978-0x0;var _0x73cc34=_0xf2cb[_0x1b2978];return _0x73cc34;};'use strict';var _=require('lodash');var util=require(_0xbf2c('0x0'));var moment=require('moment');var BPromise=require(_0xbf2c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf2c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf2c('0x3'));var logger=require(_0xbf2c('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbf2c('0x5'));var client=jayson[_0xbf2c('0x6')][_0xbf2c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xaacd25,_0x516715,_0x16cf35){return new BPromise(function(_0x584a08,_0x25d0a6){return client['request'](_0xaacd25,_0x16cf35)['then'](function(_0x1601d5){logger[_0xbf2c('0x8')](_0xbf2c('0x9'),_0x516715,'request\x20sent');logger[_0xbf2c('0xa')](_0xbf2c('0xb'),_0x516715,_0xbf2c('0xc'),JSON[_0xbf2c('0xd')](_0x1601d5));if(_0x1601d5[_0xbf2c('0xe')]){if(_0x1601d5[_0xbf2c('0xe')][_0xbf2c('0xf')]===0x1f4){logger[_0xbf2c('0xe')]('Campaign,\x20%s,\x20%s',_0x516715,_0x1601d5[_0xbf2c('0xe')][_0xbf2c('0x10')]);return _0x25d0a6(_0x1601d5[_0xbf2c('0xe')][_0xbf2c('0x10')]);}logger['error'](_0xbf2c('0x9'),_0x516715,_0x1601d5['error']['message']);return _0x584a08(_0x1601d5[_0xbf2c('0xe')]['message']);}else{logger['info'](_0xbf2c('0x9'),_0x516715,_0xbf2c('0xc'));_0x584a08(_0x1601d5[_0xbf2c('0x11')][_0xbf2c('0x10')]);}})[_0xbf2c('0x12')](function(_0x537084){logger[_0xbf2c('0xe')]('Campaign,\x20%s,\x20%s',_0x516715,_0x537084);_0x25d0a6(_0x537084);});});}exports[_0xbf2c('0x13')]=function(_0x1df2ab){var _0x298329=this;return new Promise(function(_0x32a44d,_0x266035){return db['Campaign'][_0xbf2c('0x14')]({'raw':_0x1df2ab[_0xbf2c('0x15')]?_0x1df2ab[_0xbf2c('0x15')][_0xbf2c('0x16')]===undefined?!![]:![]:!![],'where':_0x1df2ab[_0xbf2c('0x15')]?_0x1df2ab[_0xbf2c('0x15')][_0xbf2c('0x17')]||null:null,'attributes':_0x1df2ab['options']?_0x1df2ab[_0xbf2c('0x15')][_0xbf2c('0x18')]||null:null,'limit':_0x1df2ab[_0xbf2c('0x15')]?_0x1df2ab[_0xbf2c('0x15')]['limit']||null:null,'include':_0x1df2ab[_0xbf2c('0x15')]?_0x1df2ab[_0xbf2c('0x15')]['include']?_[_0xbf2c('0x19')](_0x1df2ab[_0xbf2c('0x15')][_0xbf2c('0x1a')],function(_0x52ecb4){return{'model':db[_0x52ecb4['model']],'as':_0x52ecb4['as'],'attributes':_0x52ecb4[_0xbf2c('0x18')],'include':_0x52ecb4[_0xbf2c('0x1a')]?_[_0xbf2c('0x19')](_0x52ecb4[_0xbf2c('0x1a')],function(_0x108aa8){return{'model':db[_0x108aa8[_0xbf2c('0x1b')]],'as':_0x108aa8['as'],'attributes':_0x108aa8[_0xbf2c('0x18')],'include':_0x108aa8['include']?_['map'](_0x108aa8[_0xbf2c('0x1a')],function(_0xcbd882){return{'model':db[_0xcbd882[_0xbf2c('0x1b')]],'as':_0xcbd882['as'],'attributes':_0xcbd882[_0xbf2c('0x18')]};}):[]};}):[]};}):[]:[]})[_0xbf2c('0x1c')](function(_0x4a0257){logger[_0xbf2c('0x8')](_0xbf2c('0x13'),_0x1df2ab);logger[_0xbf2c('0xa')]('GetCampaign',_0x1df2ab,JSON[_0xbf2c('0xd')](_0x4a0257));_0x32a44d(_0x4a0257);})['catch'](function(_0x3a9130){logger[_0xbf2c('0xe')](_0xbf2c('0x13'),_0x3a9130[_0xbf2c('0x10')],_0x1df2ab);_0x266035(_0x298329[_0xbf2c('0xe')](0x1f4,_0x3a9130['message']));});});};
\ No newline at end of file
+var _0xb2ff=['result','catch','Campaign','findAll','options','include','map','model','attributes','GetCampaign','debug','lodash','util','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','Campaign,\x20%s,\x20%s','message'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb2ff,0x123));var _0xfb2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb2ff[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfb2f('0x0'));var util=require(_0xfb2f('0x1'));var moment=require('moment');var BPromise=require(_0xfb2f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfb2f('0x3'));var logger=require('../../config/logger')(_0xfb2f('0x4'));var config=require(_0xfb2f('0x5'));var jayson=require(_0xfb2f('0x6'));var client=jayson[_0xfb2f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a0fd7,_0x28cb13,_0x4ff2df){return new BPromise(function(_0x34c04e,_0x4588d6){return client[_0xfb2f('0x8')](_0x4a0fd7,_0x4ff2df)[_0xfb2f('0x9')](function(_0x5abcdb){logger[_0xfb2f('0xa')]('Campaign,\x20%s,\x20%s',_0x28cb13,_0xfb2f('0xb'));logger['debug'](_0xfb2f('0xc'),_0x28cb13,_0xfb2f('0xb'),JSON[_0xfb2f('0xd')](_0x5abcdb));if(_0x5abcdb[_0xfb2f('0xe')]){if(_0x5abcdb[_0xfb2f('0xe')]['code']===0x1f4){logger[_0xfb2f('0xe')](_0xfb2f('0xf'),_0x28cb13,_0x5abcdb[_0xfb2f('0xe')][_0xfb2f('0x10')]);return _0x4588d6(_0x5abcdb[_0xfb2f('0xe')][_0xfb2f('0x10')]);}logger[_0xfb2f('0xe')](_0xfb2f('0xf'),_0x28cb13,_0x5abcdb['error'][_0xfb2f('0x10')]);return _0x34c04e(_0x5abcdb[_0xfb2f('0xe')][_0xfb2f('0x10')]);}else{logger[_0xfb2f('0xa')](_0xfb2f('0xf'),_0x28cb13,'request\x20sent');_0x34c04e(_0x5abcdb[_0xfb2f('0x11')][_0xfb2f('0x10')]);}})[_0xfb2f('0x12')](function(_0x240b79){logger[_0xfb2f('0xe')](_0xfb2f('0xf'),_0x28cb13,_0x240b79);_0x4588d6(_0x240b79);});});}exports['GetCampaign']=function(_0x1d28e7){var _0x239a88=this;return new Promise(function(_0x507caa,_0x28bb16){return db[_0xfb2f('0x13')][_0xfb2f('0x14')]({'raw':_0x1d28e7[_0xfb2f('0x15')]?_0x1d28e7[_0xfb2f('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x1d28e7['options']?_0x1d28e7[_0xfb2f('0x15')]['where']||null:null,'attributes':_0x1d28e7[_0xfb2f('0x15')]?_0x1d28e7['options']['attributes']||null:null,'limit':_0x1d28e7[_0xfb2f('0x15')]?_0x1d28e7[_0xfb2f('0x15')]['limit']||null:null,'include':_0x1d28e7[_0xfb2f('0x15')]?_0x1d28e7[_0xfb2f('0x15')][_0xfb2f('0x16')]?_[_0xfb2f('0x17')](_0x1d28e7[_0xfb2f('0x15')]['include'],function(_0x3ed758){return{'model':db[_0x3ed758[_0xfb2f('0x18')]],'as':_0x3ed758['as'],'attributes':_0x3ed758['attributes'],'include':_0x3ed758[_0xfb2f('0x16')]?_['map'](_0x3ed758[_0xfb2f('0x16')],function(_0x5d612b){return{'model':db[_0x5d612b[_0xfb2f('0x18')]],'as':_0x5d612b['as'],'attributes':_0x5d612b[_0xfb2f('0x19')],'include':_0x5d612b[_0xfb2f('0x16')]?_['map'](_0x5d612b[_0xfb2f('0x16')],function(_0xed4b47){return{'model':db[_0xed4b47[_0xfb2f('0x18')]],'as':_0xed4b47['as'],'attributes':_0xed4b47[_0xfb2f('0x19')]};}):[]};}):[]};}):[]:[]})[_0xfb2f('0x9')](function(_0x1d1ad4){logger['info'](_0xfb2f('0x1a'),_0x1d28e7);logger[_0xfb2f('0x1b')](_0xfb2f('0x1a'),_0x1d28e7,JSON[_0xfb2f('0xd')](_0x1d1ad4));_0x507caa(_0x1d1ad4);})['catch'](function(_0x53a728){logger[_0xfb2f('0xe')](_0xfb2f('0x1a'),_0x53a728[_0xfb2f('0x10')],_0x1d28e7);_0x28bb16(_0x239a88['error'](0x1f4,_0x53a728[_0xfb2f('0x10')]));});});};
\ No newline at end of file
index e86a006..ed0e6a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcfd2=['getBlackLists','create','/:id/clone','post','addBlackLists','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','/:id','show','get','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/lists','getLists','/:id/blacklists'];(function(_0x53b53e,_0x498437){var _0xbb6179=function(_0x3975eb){while(--_0x3975eb){_0x53b53e['push'](_0x53b53e['shift']());}};_0xbb6179(++_0x498437);}(_0xcfd2,0xe9));var _0x2cfd=function(_0x4542d4,_0x4e304b){_0x4542d4=_0x4542d4-0x0;var _0x2f4e1c=_0xcfd2[_0x4542d4];return _0x2f4e1c;};'use strict';var multer=require(_0x2cfd('0x0'));var util=require(_0x2cfd('0x1'));var path=require(_0x2cfd('0x2'));var timeout=require(_0x2cfd('0x3'));var express=require(_0x2cfd('0x4'));var router=express[_0x2cfd('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2cfd('0x6'));var interaction=require(_0x2cfd('0x7'));var config=require(_0x2cfd('0x8'));var controller=require(_0x2cfd('0x9'));router['get']('/',auth[_0x2cfd('0xa')](),controller[_0x2cfd('0xb')]);router['get'](_0x2cfd('0xc'),auth['isAuthenticated'](),controller[_0x2cfd('0xd')]);router[_0x2cfd('0xe')]('/:id/hoppers',auth[_0x2cfd('0xa')](),controller[_0x2cfd('0xf')]);router[_0x2cfd('0xe')](_0x2cfd('0x10'),auth[_0x2cfd('0xa')](),controller[_0x2cfd('0x11')]);router[_0x2cfd('0xe')](_0x2cfd('0x12'),auth['isAuthenticated'](),controller[_0x2cfd('0x13')]);router[_0x2cfd('0xe')]('/:id/hopper_black',auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0x2cfd('0xe')](_0x2cfd('0x14'),auth[_0x2cfd('0xa')](),controller[_0x2cfd('0x15')]);router['get'](_0x2cfd('0x16'),auth[_0x2cfd('0xa')](),controller[_0x2cfd('0x17')]);router['post']('/',auth[_0x2cfd('0xa')](),controller[_0x2cfd('0x18')]);router['post'](_0x2cfd('0x19'),auth[_0x2cfd('0xa')](),controller['clone']);router['post'](_0x2cfd('0x14'),auth[_0x2cfd('0xa')](),controller['addLists']);router[_0x2cfd('0x1a')](_0x2cfd('0x16'),auth[_0x2cfd('0xa')](),controller[_0x2cfd('0x1b')]);router[_0x2cfd('0x1c')](_0x2cfd('0xc'),auth[_0x2cfd('0xa')](),controller[_0x2cfd('0x1d')]);router['delete'](_0x2cfd('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0x2cfd('0x1e')](_0x2cfd('0x14'),auth['isAuthenticated'](),controller['removeLists']);router['delete'](_0x2cfd('0x16'),auth[_0x2cfd('0xa')](),controller['removeBlackLists']);module[_0x2cfd('0x1f')]=router;
\ No newline at end of file
+var _0x6d0b=['getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getLists','/:id/blacklists','getBlackLists','create','post','clone','/:id/lists','addBlackLists','update','delete','destroy','removeLists','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','/:id','show','/:id/hoppers'];(function(_0x2db153,_0x3ed67d){var _0x169607=function(_0x54ffc9){while(--_0x54ffc9){_0x2db153['push'](_0x2db153['shift']());}};_0x169607(++_0x3ed67d);}(_0x6d0b,0x71));var _0xb6d0=function(_0x40664c,_0x1d90f8){_0x40664c=_0x40664c-0x0;var _0x6f1edd=_0x6d0b[_0x40664c];return _0x6f1edd;};'use strict';var multer=require(_0xb6d0('0x0'));var util=require('util');var path=require(_0xb6d0('0x1'));var timeout=require('connect-timeout');var express=require(_0xb6d0('0x2'));var router=express[_0xb6d0('0x3')]();var fs_extra=require(_0xb6d0('0x4'));var auth=require(_0xb6d0('0x5'));var interaction=require(_0xb6d0('0x6'));var config=require(_0xb6d0('0x7'));var controller=require(_0xb6d0('0x8'));router['get']('/',auth[_0xb6d0('0x9')](),controller[_0xb6d0('0xa')]);router[_0xb6d0('0xb')](_0xb6d0('0xc'),auth[_0xb6d0('0x9')](),controller[_0xb6d0('0xd')]);router[_0xb6d0('0xb')](_0xb6d0('0xe'),auth[_0xb6d0('0x9')](),controller[_0xb6d0('0xf')]);router[_0xb6d0('0xb')](_0xb6d0('0x10'),auth['isAuthenticated'](),controller[_0xb6d0('0x11')]);router['get'](_0xb6d0('0x12'),auth[_0xb6d0('0x9')](),controller['getHopperFinals']);router['get']('/:id/hopper_black',auth[_0xb6d0('0x9')](),controller['getHopperBlacks']);router['get']('/:id/lists',auth['isAuthenticated'](),controller[_0xb6d0('0x13')]);router[_0xb6d0('0xb')](_0xb6d0('0x14'),auth[_0xb6d0('0x9')](),controller[_0xb6d0('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb6d0('0x16')]);router[_0xb6d0('0x17')]('/:id/clone',auth[_0xb6d0('0x9')](),controller[_0xb6d0('0x18')]);router[_0xb6d0('0x17')](_0xb6d0('0x19'),auth[_0xb6d0('0x9')](),controller['addLists']);router['post'](_0xb6d0('0x14'),auth[_0xb6d0('0x9')](),controller[_0xb6d0('0x1a')]);router['put'](_0xb6d0('0xc'),auth[_0xb6d0('0x9')](),controller[_0xb6d0('0x1b')]);router[_0xb6d0('0x1c')](_0xb6d0('0xc'),auth[_0xb6d0('0x9')](),controller[_0xb6d0('0x1d')]);router[_0xb6d0('0x1c')]('/:id/lists',auth['isAuthenticated'](),controller[_0xb6d0('0x1e')]);router[_0xb6d0('0x1c')]('/:id/blacklists',auth[_0xb6d0('0x9')](),controller['removeBlackLists']);module[_0xb6d0('0x1f')]=router;
\ No newline at end of file
index d8f34ac..e696c44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01d2=['sequelize','exports','STRING','TEXT','VIRTUAL','getDataValue','key'];(function(_0x3121ee,_0x1fb011){var _0x55b96c=function(_0x1b5a95){while(--_0x1b5a95){_0x3121ee['push'](_0x3121ee['shift']());}};_0x55b96c(++_0x1fb011);}(_0x01d2,0x165));var _0x201d=function(_0x25c2ba,_0x22e11b){_0x25c2ba=_0x25c2ba-0x0;var _0x4e339d=_0x01d2[_0x25c2ba];return _0x4e339d;};'use strict';var Sequelize=require(_0x201d('0x0'));module[_0x201d('0x1')]={'key':{'type':Sequelize[_0x201d('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x201d('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x201d('0x2')]},'name':{'type':Sequelize[_0x201d('0x4')],'get':function(){return this[_0x201d('0x5')](_0x201d('0x6'));}}};
\ No newline at end of file
+var _0x6c0f=['TEXT','getDataValue','key','sequelize','exports','STRING'];(function(_0x1d0a88,_0x4f873a){var _0x4e0cd1=function(_0x21d221){while(--_0x21d221){_0x1d0a88['push'](_0x1d0a88['shift']());}};_0x4e0cd1(++_0x4f873a);}(_0x6c0f,0x13b));var _0xf6c0=function(_0x20fca6,_0xf01e94){_0x20fca6=_0x20fca6-0x0;var _0x4dc6c2=_0x6c0f[_0x20fca6];return _0x4dc6c2;};'use strict';var Sequelize=require(_0xf6c0('0x0'));module[_0xf6c0('0x1')]={'key':{'type':Sequelize[_0xf6c0('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xf6c0('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xf6c0('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xf6c0('0x4')](_0xf6c0('0x5'));}}};
\ No newline at end of file
index 01fbe51..249adb7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f72=['ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','error','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','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','end','json','offset','undefined','count','limit','status','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','then','stack','name','send','CannedAnswer','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId'];(function(_0x51dd2c,_0x2a2345){var _0x41c678=function(_0xa14c31){while(--_0xa14c31){_0x51dd2c['push'](_0x51dd2c['shift']());}};_0x41c678(++_0x2a2345);}(_0x9f72,0xc4));var _0x29f7=function(_0x10f754,_0x51e252){_0x10f754=_0x10f754-0x0;var _0x273708=_0x9f72[_0x10f754];return _0x273708;};'use strict';var emlformat=require(_0x29f7('0x0'));var rimraf=require(_0x29f7('0x1'));var zipdir=require(_0x29f7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x29f7('0x3'));var moment=require(_0x29f7('0x4'));var BPromise=require(_0x29f7('0x5'));var Mustache=require('mustache');var util=require(_0x29f7('0x6'));var path=require(_0x29f7('0x7'));var sox=require(_0x29f7('0x8'));var csv=require('to-csv');var ejs=require(_0x29f7('0x9'));var fs=require('fs');var fs_extra=require(_0x29f7('0xa'));var _=require(_0x29f7('0xb'));var squel=require('squel');var crypto=require(_0x29f7('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x29f7('0xd'));var toCsv=require(_0x29f7('0xe'));var querystring=require(_0x29f7('0xf'));var Papa=require(_0x29f7('0x10'));var Redis=require(_0x29f7('0x11'));var authService=require(_0x29f7('0x12'));var qs=require(_0x29f7('0x13'));var as=require(_0x29f7('0x14'));var hardwareService=require(_0x29f7('0x15'));var logger=require(_0x29f7('0x16'))('api');var utils=require(_0x29f7('0x17'));var config=require(_0x29f7('0x18'));var licenseUtil=require(_0x29f7('0x19'));var db=require(_0x29f7('0x1a'))['db'];function respondWithStatusCode(_0x1ddad4,_0x139682){_0x139682=_0x139682||0xcc;return function(_0x115002){if(_0x115002){return _0x1ddad4[_0x29f7('0x1b')](_0x139682);}return _0x1ddad4['status'](_0x139682)[_0x29f7('0x1c')]();};}function respondWithResult(_0x2e1c46,_0x7def93){_0x7def93=_0x7def93||0xc8;return function(_0x2050c9){if(_0x2050c9){return _0x2e1c46['status'](_0x7def93)[_0x29f7('0x1d')](_0x2050c9);}};}function respondWithFilteredResult(_0x2e665b,_0x3a882c){return function(_0x1c7dcc){if(_0x1c7dcc){var _0xd12de1=typeof _0x3a882c[_0x29f7('0x1e')]===_0x29f7('0x1f')&&typeof _0x3a882c['limit']==='undefined';var _0x461453=_0x1c7dcc[_0x29f7('0x20')];var _0x435785=_0xd12de1?0x0:_0x3a882c[_0x29f7('0x1e')];var _0x475722=_0xd12de1?_0x1c7dcc[_0x29f7('0x20')]:_0x3a882c[_0x29f7('0x1e')]+_0x3a882c[_0x29f7('0x21')];var _0x17cbf4;if(_0x475722>=_0x461453){_0x475722=_0x461453;_0x17cbf4=0xc8;}else{_0x17cbf4=0xce;}_0x2e665b[_0x29f7('0x22')](_0x17cbf4);return _0x2e665b['set'](_0x29f7('0x23'),_0x435785+'-'+_0x475722+'/'+_0x461453)[_0x29f7('0x1d')](_0x1c7dcc);}return null;};}function patchUpdates(_0x4dc033){return function(_0x2a4423){try{jsonpatch[_0x29f7('0x24')](_0x2a4423,_0x4dc033,!![]);}catch(_0x1c9271){return BPromise[_0x29f7('0x25')](_0x1c9271);}return _0x2a4423[_0x29f7('0x26')]();};}function saveUpdates(_0x30705c,_0x3240db){return function(_0x266085){if(_0x266085){return _0x266085[_0x29f7('0x27')](_0x30705c)['then'](function(_0x4ccda3){return _0x4ccda3;});}return null;};}function removeEntity(_0x160d49,_0x290b77){return function(_0x4294ee){if(_0x4294ee){return _0x4294ee[_0x29f7('0x28')]()['then'](function(){var _0x4490e7=_0x4294ee[_0x29f7('0x29')]({'plain':!![]});var _0x4cae48='CannedAnswers';return db[_0x29f7('0x2a')][_0x29f7('0x28')]({'where':{'type':_0x4cae48,'resourceId':_0x4490e7['id']}})['then'](function(){return _0x4294ee;});})[_0x29f7('0x2b')](function(){_0x160d49[_0x29f7('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36950a,_0x2a7b52){return function(_0x4e9a3a){if(!_0x4e9a3a){_0x36950a[_0x29f7('0x1b')](0x194);}return _0x4e9a3a;};}function handleError(_0x2f8655,_0x20506e){_0x20506e=_0x20506e||0x1f4;return function(_0x445ae4){logger['error'](_0x445ae4[_0x29f7('0x2c')]);if(_0x445ae4['name']){delete _0x445ae4[_0x29f7('0x2d')];}_0x2f8655[_0x29f7('0x22')](_0x20506e)[_0x29f7('0x2e')](_0x445ae4);};}exports['index']=function(_0x552cc5,_0x5318db){var _0x56cdc7={},_0x3368b0={},_0x3349c3={'count':0x0,'rows':[]};var _0x2859c8=_['map'](db[_0x29f7('0x2f')]['rawAttributes'],function(_0x3a9028){return{'name':_0x3a9028[_0x29f7('0x30')],'type':_0x3a9028[_0x29f7('0x31')][_0x29f7('0x32')]};});_0x3368b0[_0x29f7('0x33')]=_[_0x29f7('0x34')](_0x2859c8,_0x29f7('0x2d'));_0x3368b0[_0x29f7('0x35')]=_[_0x29f7('0x36')](_0x552cc5['query']);_0x3368b0[_0x29f7('0x37')]=_[_0x29f7('0x38')](_0x3368b0['model'],_0x3368b0[_0x29f7('0x35')]);_0x56cdc7[_0x29f7('0x39')]=_['intersection'](_0x3368b0[_0x29f7('0x33')],qs[_0x29f7('0x3a')](_0x552cc5[_0x29f7('0x35')]['fields']));_0x56cdc7['attributes']=_0x56cdc7[_0x29f7('0x39')]['length']?_0x56cdc7[_0x29f7('0x39')]:_0x3368b0[_0x29f7('0x33')];if(!_0x552cc5['query'][_0x29f7('0x3b')](_0x29f7('0x3c'))){_0x56cdc7[_0x29f7('0x21')]=qs[_0x29f7('0x21')](_0x552cc5[_0x29f7('0x35')]['limit']);_0x56cdc7[_0x29f7('0x1e')]=qs['offset'](_0x552cc5[_0x29f7('0x35')][_0x29f7('0x1e')]);}_0x56cdc7['order']=qs[_0x29f7('0x3d')](_0x552cc5[_0x29f7('0x35')]['sort']);_0x56cdc7['where']=qs[_0x29f7('0x37')](_[_0x29f7('0x3e')](_0x552cc5['query'],_0x3368b0['filters']),_0x2859c8);if(_0x552cc5[_0x29f7('0x35')][_0x29f7('0x3f')]){_0x56cdc7[_0x29f7('0x40')]=_['merge'](_0x56cdc7[_0x29f7('0x40')],{'$or':[{'key':{'$like':'%'+_0x552cc5[_0x29f7('0x35')][_0x29f7('0x3f')]+'%'}},{'value':{'$like':'%'+_0x552cc5['query'][_0x29f7('0x3f')]+'%'}}]});}_0x56cdc7=_[_0x29f7('0x41')]({},_0x56cdc7,_0x552cc5[_0x29f7('0x42')]);var _0x25dd19={'where':_0x56cdc7[_0x29f7('0x40')]};return db[_0x29f7('0x2f')][_0x29f7('0x20')](_0x25dd19)[_0x29f7('0x2b')](function(_0x412719){_0x3349c3[_0x29f7('0x20')]=_0x412719;if(_0x552cc5['query']['includeAll']){_0x56cdc7[_0x29f7('0x43')]=[{'all':!![]}];}return db[_0x29f7('0x2f')][_0x29f7('0x44')](_0x56cdc7);})[_0x29f7('0x2b')](function(_0x16f4c7){_0x3349c3[_0x29f7('0x45')]=_0x16f4c7;return _0x3349c3;})['then'](respondWithFilteredResult(_0x5318db,_0x56cdc7))[_0x29f7('0x46')](handleError(_0x5318db,null));};exports[_0x29f7('0x47')]=function(_0x412388,_0x465199){var _0x967154={'raw':!![],'where':{'id':_0x412388[_0x29f7('0x48')]['id']}},_0x1f4f1={};_0x1f4f1[_0x29f7('0x33')]=_[_0x29f7('0x36')](db['CannedAnswer'][_0x29f7('0x49')]);_0x1f4f1[_0x29f7('0x35')]=_[_0x29f7('0x36')](_0x412388['query']);_0x1f4f1['filters']=_[_0x29f7('0x38')](_0x1f4f1[_0x29f7('0x33')],_0x1f4f1[_0x29f7('0x35')]);_0x967154[_0x29f7('0x39')]=_[_0x29f7('0x38')](_0x1f4f1[_0x29f7('0x33')],qs[_0x29f7('0x3a')](_0x412388[_0x29f7('0x35')]['fields']));_0x967154[_0x29f7('0x39')]=_0x967154[_0x29f7('0x39')]['length']?_0x967154[_0x29f7('0x39')]:_0x1f4f1[_0x29f7('0x33')];if(_0x412388[_0x29f7('0x35')][_0x29f7('0x4a')]){_0x967154['include']=[{'all':!![]}];}_0x967154=_[_0x29f7('0x41')]({},_0x967154,_0x412388[_0x29f7('0x42')]);return db[_0x29f7('0x2f')][_0x29f7('0x4b')](_0x967154)[_0x29f7('0x2b')](handleEntityNotFound(_0x465199,null))['then'](respondWithResult(_0x465199,null))[_0x29f7('0x46')](handleError(_0x465199,null));};exports[_0x29f7('0x27')]=function(_0x42fada,_0x3a4571){if(_0x42fada[_0x29f7('0x4c')]['id']){delete _0x42fada[_0x29f7('0x4c')]['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x42fada['params']['id']}})[_0x29f7('0x2b')](handleEntityNotFound(_0x3a4571,null))['then'](saveUpdates(_0x42fada[_0x29f7('0x4c')],null))[_0x29f7('0x2b')](respondWithResult(_0x3a4571,null))[_0x29f7('0x46')](handleError(_0x3a4571,null));};exports['destroy']=function(_0x5aa0a0,_0x43e6f7){return db[_0x29f7('0x2f')]['find']({'where':{'id':_0x5aa0a0[_0x29f7('0x48')]['id']}})['then'](handleEntityNotFound(_0x43e6f7,null))[_0x29f7('0x2b')](removeEntity(_0x43e6f7,null))[_0x29f7('0x46')](handleError(_0x43e6f7,null));};exports['create']=function(_0x294a8d,_0x509e51){var _0x40999c={'key':_0x294a8d[_0x29f7('0x4c')][_0x29f7('0x32')]};if(_0x294a8d[_0x29f7('0x4c')]['MailAccountId']){_0x40999c[_0x29f7('0x4d')]=_0x294a8d[_0x29f7('0x4c')]['MailAccountId'];}else if(_0x294a8d[_0x29f7('0x4c')][_0x29f7('0x4e')]){_0x40999c[_0x29f7('0x4e')]=_0x294a8d[_0x29f7('0x4c')][_0x29f7('0x4e')];}else if(_0x294a8d['body'][_0x29f7('0x4f')]){_0x40999c['OpenchannelAccountId']=_0x294a8d[_0x29f7('0x4c')][_0x29f7('0x4f')];}else if(_0x294a8d[_0x29f7('0x4c')][_0x29f7('0x50')]){_0x40999c[_0x29f7('0x50')]=_0x294a8d['body'][_0x29f7('0x50')];}return db[_0x29f7('0x2f')]['find']({'where':_0x40999c})[_0x29f7('0x2b')](function(_0x3e4a05){if(_0x3e4a05){throw new db['Sequelize'][(_0x29f7('0x51'))](_0x29f7('0x52'));}return db[_0x29f7('0x2f')][_0x29f7('0x53')](_0x294a8d[_0x29f7('0x4c')]);})[_0x29f7('0x2b')](function(_0x59fe7c){var _0x21a1b4=_0x294a8d[_0x29f7('0x54')][_0x29f7('0x29')]({'plain':!![]});if(!_0x21a1b4)throw new Error(_0x29f7('0x55'));if(_0x21a1b4[_0x29f7('0x56')]===_0x29f7('0x54')){var _0x71e024=_0x59fe7c['get']({'plain':!![]});return db[_0x29f7('0x57')][_0x29f7('0x4b')]({'where':{'name':_0x29f7('0x58'),'userProfileId':_0x21a1b4[_0x29f7('0x59')]},'raw':!![]})[_0x29f7('0x2b')](function(_0x23e8a9){if(_0x23e8a9&&_0x23e8a9[_0x29f7('0x5a')]===0x0){return db['UserProfileResource'][_0x29f7('0x53')]({'name':_0x71e024[_0x29f7('0x2d')],'resourceId':_0x71e024['id'],'type':_0x23e8a9[_0x29f7('0x2d')],'sectionId':_0x23e8a9['id']},{})[_0x29f7('0x2b')](function(){return _0x59fe7c;});}else{return _0x59fe7c;}})['catch'](function(_0x4fddf9){logger[_0x29f7('0x5b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4fddf9);throw _0x4fddf9;});}return _0x59fe7c;})[_0x29f7('0x2b')](respondWithResult(_0x509e51,0xc9))[_0x29f7('0x46')](handleError(_0x509e51,null));};
\ No newline at end of file
+var _0x0dd5=['rows','catch','show','params','rawAttributes','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','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','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','CannedAnswers','destroy','stack','name','send','index','map','CannedAnswer','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','options','includeAll','findAll'];(function(_0x1bfde0,_0x341ac8){var _0x5d195e=function(_0x4cd72d){while(--_0x4cd72d){_0x1bfde0['push'](_0x1bfde0['shift']());}};_0x5d195e(++_0x341ac8);}(_0x0dd5,0x122));var _0x50dd=function(_0x5ae343,_0x576870){_0x5ae343=_0x5ae343-0x0;var _0xda6a54=_0x0dd5[_0x5ae343];return _0xda6a54;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x50dd('0x0'));var zipdir=require(_0x50dd('0x1'));var jsonpatch=require(_0x50dd('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x50dd('0x3'));var util=require(_0x50dd('0x4'));var path=require(_0x50dd('0x5'));var sox=require('sox');var csv=require(_0x50dd('0x6'));var ejs=require(_0x50dd('0x7'));var fs=require('fs');var fs_extra=require(_0x50dd('0x8'));var _=require(_0x50dd('0x9'));var squel=require(_0x50dd('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x50dd('0xb'));var toCsv=require(_0x50dd('0x6'));var querystring=require(_0x50dd('0xc'));var Papa=require('papaparse');var Redis=require(_0x50dd('0xd'));var authService=require(_0x50dd('0xe'));var qs=require(_0x50dd('0xf'));var as=require(_0x50dd('0x10'));var hardwareService=require(_0x50dd('0x11'));var logger=require(_0x50dd('0x12'))(_0x50dd('0x13'));var utils=require(_0x50dd('0x14'));var config=require(_0x50dd('0x15'));var licenseUtil=require(_0x50dd('0x16'));var db=require(_0x50dd('0x17'))['db'];function respondWithStatusCode(_0x37d300,_0x5bee97){_0x5bee97=_0x5bee97||0xcc;return function(_0x596b03){if(_0x596b03){return _0x37d300[_0x50dd('0x18')](_0x5bee97);}return _0x37d300[_0x50dd('0x19')](_0x5bee97)[_0x50dd('0x1a')]();};}function respondWithResult(_0x3a642f,_0x290f00){_0x290f00=_0x290f00||0xc8;return function(_0x157185){if(_0x157185){return _0x3a642f[_0x50dd('0x19')](_0x290f00)[_0x50dd('0x1b')](_0x157185);}};}function respondWithFilteredResult(_0x14bbdc,_0x57a269){return function(_0x47a85d){if(_0x47a85d){var _0x412669=typeof _0x57a269[_0x50dd('0x1c')]===_0x50dd('0x1d')&&typeof _0x57a269[_0x50dd('0x1e')]==='undefined';var _0x178741=_0x47a85d[_0x50dd('0x1f')];var _0x13cf7d=_0x412669?0x0:_0x57a269['offset'];var _0x3f071e=_0x412669?_0x47a85d[_0x50dd('0x1f')]:_0x57a269[_0x50dd('0x1c')]+_0x57a269[_0x50dd('0x1e')];var _0x21b791;if(_0x3f071e>=_0x178741){_0x3f071e=_0x178741;_0x21b791=0xc8;}else{_0x21b791=0xce;}_0x14bbdc[_0x50dd('0x19')](_0x21b791);return _0x14bbdc[_0x50dd('0x20')](_0x50dd('0x21'),_0x13cf7d+'-'+_0x3f071e+'/'+_0x178741)['json'](_0x47a85d);}return null;};}function patchUpdates(_0x472da1){return function(_0x2daff3){try{jsonpatch['apply'](_0x2daff3,_0x472da1,!![]);}catch(_0x39b454){return BPromise[_0x50dd('0x22')](_0x39b454);}return _0x2daff3[_0x50dd('0x23')]();};}function saveUpdates(_0x20ce9a,_0x29f91e){return function(_0x885a4c){if(_0x885a4c){return _0x885a4c[_0x50dd('0x24')](_0x20ce9a)[_0x50dd('0x25')](function(_0x1f12ab){return _0x1f12ab;});}return null;};}function removeEntity(_0x556c79,_0x4060ab){return function(_0x11a91a){if(_0x11a91a){return _0x11a91a['destroy']()[_0x50dd('0x25')](function(){var _0x425b63=_0x11a91a['get']({'plain':!![]});var _0x255437=_0x50dd('0x26');return db['UserProfileResource'][_0x50dd('0x27')]({'where':{'type':_0x255437,'resourceId':_0x425b63['id']}})[_0x50dd('0x25')](function(){return _0x11a91a;});})[_0x50dd('0x25')](function(){_0x556c79[_0x50dd('0x19')](0xcc)[_0x50dd('0x1a')]();});}};}function handleEntityNotFound(_0x1c6132,_0x4a9c07){return function(_0x325419){if(!_0x325419){_0x1c6132['sendStatus'](0x194);}return _0x325419;};}function handleError(_0x5c6197,_0xeade77){_0xeade77=_0xeade77||0x1f4;return function(_0x209bd8){logger['error'](_0x209bd8[_0x50dd('0x28')]);if(_0x209bd8[_0x50dd('0x29')]){delete _0x209bd8[_0x50dd('0x29')];}_0x5c6197['status'](_0xeade77)[_0x50dd('0x2a')](_0x209bd8);};}exports[_0x50dd('0x2b')]=function(_0x389bae,_0x2feb99){var _0x1f88fb={},_0xc8d045={},_0x3c0df1={'count':0x0,'rows':[]};var _0x5a9674=_[_0x50dd('0x2c')](db[_0x50dd('0x2d')]['rawAttributes'],function(_0x387be1){return{'name':_0x387be1[_0x50dd('0x2e')],'type':_0x387be1[_0x50dd('0x2f')][_0x50dd('0x30')]};});_0xc8d045['model']=_[_0x50dd('0x2c')](_0x5a9674,'name');_0xc8d045[_0x50dd('0x31')]=_[_0x50dd('0x32')](_0x389bae[_0x50dd('0x31')]);_0xc8d045[_0x50dd('0x33')]=_[_0x50dd('0x34')](_0xc8d045[_0x50dd('0x35')],_0xc8d045[_0x50dd('0x31')]);_0x1f88fb['attributes']=_[_0x50dd('0x34')](_0xc8d045[_0x50dd('0x35')],qs['fields'](_0x389bae['query'][_0x50dd('0x36')]));_0x1f88fb['attributes']=_0x1f88fb[_0x50dd('0x37')][_0x50dd('0x38')]?_0x1f88fb[_0x50dd('0x37')]:_0xc8d045[_0x50dd('0x35')];if(!_0x389bae[_0x50dd('0x31')][_0x50dd('0x39')](_0x50dd('0x3a'))){_0x1f88fb[_0x50dd('0x1e')]=qs['limit'](_0x389bae[_0x50dd('0x31')][_0x50dd('0x1e')]);_0x1f88fb['offset']=qs['offset'](_0x389bae['query'][_0x50dd('0x1c')]);}_0x1f88fb['order']=qs['sort'](_0x389bae[_0x50dd('0x31')]['sort']);_0x1f88fb[_0x50dd('0x3b')]=qs[_0x50dd('0x33')](_[_0x50dd('0x3c')](_0x389bae[_0x50dd('0x31')],_0xc8d045[_0x50dd('0x33')]),_0x5a9674);if(_0x389bae['query'][_0x50dd('0x3d')]){_0x1f88fb[_0x50dd('0x3b')]=_[_0x50dd('0x3e')](_0x1f88fb['where'],{'$or':[{'key':{'$like':'%'+_0x389bae['query'][_0x50dd('0x3d')]+'%'}},{'value':{'$like':'%'+_0x389bae[_0x50dd('0x31')]['filter']+'%'}}]});}_0x1f88fb=_['merge']({},_0x1f88fb,_0x389bae[_0x50dd('0x3f')]);var _0x51b031={'where':_0x1f88fb[_0x50dd('0x3b')]};return db[_0x50dd('0x2d')][_0x50dd('0x1f')](_0x51b031)[_0x50dd('0x25')](function(_0x38d157){_0x3c0df1[_0x50dd('0x1f')]=_0x38d157;if(_0x389bae[_0x50dd('0x31')][_0x50dd('0x40')]){_0x1f88fb['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x50dd('0x41')](_0x1f88fb);})[_0x50dd('0x25')](function(_0x3b903a){_0x3c0df1[_0x50dd('0x42')]=_0x3b903a;return _0x3c0df1;})[_0x50dd('0x25')](respondWithFilteredResult(_0x2feb99,_0x1f88fb))[_0x50dd('0x43')](handleError(_0x2feb99,null));};exports[_0x50dd('0x44')]=function(_0x4f52f1,_0x5a934e){var _0x342074={'raw':!![],'where':{'id':_0x4f52f1[_0x50dd('0x45')]['id']}},_0x11686a={};_0x11686a[_0x50dd('0x35')]=_['keys'](db[_0x50dd('0x2d')][_0x50dd('0x46')]);_0x11686a['query']=_['keys'](_0x4f52f1[_0x50dd('0x31')]);_0x11686a[_0x50dd('0x33')]=_[_0x50dd('0x34')](_0x11686a[_0x50dd('0x35')],_0x11686a['query']);_0x342074[_0x50dd('0x37')]=_[_0x50dd('0x34')](_0x11686a['model'],qs['fields'](_0x4f52f1[_0x50dd('0x31')]['fields']));_0x342074[_0x50dd('0x37')]=_0x342074[_0x50dd('0x37')][_0x50dd('0x38')]?_0x342074[_0x50dd('0x37')]:_0x11686a[_0x50dd('0x35')];if(_0x4f52f1[_0x50dd('0x31')][_0x50dd('0x40')]){_0x342074['include']=[{'all':!![]}];}_0x342074=_['merge']({},_0x342074,_0x4f52f1[_0x50dd('0x3f')]);return db[_0x50dd('0x2d')][_0x50dd('0x47')](_0x342074)['then'](handleEntityNotFound(_0x5a934e,null))['then'](respondWithResult(_0x5a934e,null))[_0x50dd('0x43')](handleError(_0x5a934e,null));};exports[_0x50dd('0x24')]=function(_0x24a83a,_0x3bc08f){if(_0x24a83a[_0x50dd('0x48')]['id']){delete _0x24a83a[_0x50dd('0x48')]['id'];}return db['CannedAnswer'][_0x50dd('0x47')]({'where':{'id':_0x24a83a[_0x50dd('0x45')]['id']}})[_0x50dd('0x25')](handleEntityNotFound(_0x3bc08f,null))[_0x50dd('0x25')](saveUpdates(_0x24a83a[_0x50dd('0x48')],null))[_0x50dd('0x25')](respondWithResult(_0x3bc08f,null))[_0x50dd('0x43')](handleError(_0x3bc08f,null));};exports[_0x50dd('0x27')]=function(_0x2ba821,_0x26d241){return db[_0x50dd('0x2d')]['find']({'where':{'id':_0x2ba821[_0x50dd('0x45')]['id']}})['then'](handleEntityNotFound(_0x26d241,null))[_0x50dd('0x25')](removeEntity(_0x26d241,null))[_0x50dd('0x43')](handleError(_0x26d241,null));};exports['create']=function(_0x4da6ff,_0x5bf068){var _0x2d88b9={'key':_0x4da6ff[_0x50dd('0x48')][_0x50dd('0x30')]};if(_0x4da6ff['body'][_0x50dd('0x49')]){_0x2d88b9['MailAccountId']=_0x4da6ff[_0x50dd('0x48')][_0x50dd('0x49')];}else if(_0x4da6ff['body'][_0x50dd('0x4a')]){_0x2d88b9[_0x50dd('0x4a')]=_0x4da6ff[_0x50dd('0x48')]['SmsAccountId'];}else if(_0x4da6ff['body'][_0x50dd('0x4b')]){_0x2d88b9['OpenchannelAccountId']=_0x4da6ff[_0x50dd('0x48')][_0x50dd('0x4b')];}else if(_0x4da6ff[_0x50dd('0x48')][_0x50dd('0x4c')]){_0x2d88b9[_0x50dd('0x4c')]=_0x4da6ff[_0x50dd('0x48')][_0x50dd('0x4c')];}return db[_0x50dd('0x2d')]['find']({'where':_0x2d88b9})[_0x50dd('0x25')](function(_0x494be3){if(_0x494be3){throw new db[(_0x50dd('0x4d'))]['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db['CannedAnswer']['create'](_0x4da6ff['body']);})[_0x50dd('0x25')](function(_0x9641f7){var _0x85e829=_0x4da6ff[_0x50dd('0x4e')][_0x50dd('0x4f')]({'plain':!![]});if(!_0x85e829)throw new Error(_0x50dd('0x50'));if(_0x85e829[_0x50dd('0x51')]===_0x50dd('0x4e')){var _0x48f38f=_0x9641f7[_0x50dd('0x4f')]({'plain':!![]});return db[_0x50dd('0x52')][_0x50dd('0x47')]({'where':{'name':_0x50dd('0x26'),'userProfileId':_0x85e829[_0x50dd('0x53')]},'raw':!![]})[_0x50dd('0x25')](function(_0x2c054e){if(_0x2c054e&&_0x2c054e[_0x50dd('0x54')]===0x0){return db[_0x50dd('0x55')][_0x50dd('0x56')]({'name':_0x48f38f[_0x50dd('0x29')],'resourceId':_0x48f38f['id'],'type':_0x2c054e['name'],'sectionId':_0x2c054e['id']},{})[_0x50dd('0x25')](function(){return _0x9641f7;});}else{return _0x9641f7;}})[_0x50dd('0x43')](function(_0x4bdb0b){logger[_0x50dd('0x57')](_0x50dd('0x58'),_0x4bdb0b);throw _0x4bdb0b;});}return _0x9641f7;})[_0x50dd('0x25')](respondWithResult(_0x5bf068,0xc9))[_0x50dd('0x43')](handleError(_0x5bf068,null));};
\ No newline at end of file
index 7b1e8be..8396647 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa647=['tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa647,0x11a));var _0x7a64=function(_0x481906,_0x24f326){_0x481906=_0x481906-0x0;var _0x41a55d=_0xa647[_0x481906];return _0x41a55d;};'use strict';var _=require(_0x7a64('0x0'));var util=require(_0x7a64('0x1'));var logger=require(_0x7a64('0x2'))(_0x7a64('0x3'));var moment=require(_0x7a64('0x4'));var BPromise=require(_0x7a64('0x5'));var rp=require(_0x7a64('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7a64('0x7'));var config=require('../../config/environment');var attributes=require(_0x7a64('0x8'));module[_0x7a64('0x9')]=function(_0x5e0e6d,_0x49f987){return _0x5e0e6d[_0x7a64('0xa')](_0x7a64('0xb'),attributes,{'tableName':_0x7a64('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x7a64('0xd')});};
\ No newline at end of file
+var _0x453b=['define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports'];(function(_0x1a4668,_0x582e9c){var _0x336697=function(_0x101e12){while(--_0x101e12){_0x1a4668['push'](_0x1a4668['shift']());}};_0x336697(++_0x582e9c);}(_0x453b,0x164));var _0xb453=function(_0x392f82,_0x4dc713){_0x392f82=_0x392f82-0x0;var _0x3ad0b8=_0x453b[_0x392f82];return _0x3ad0b8;};'use strict';var _=require(_0xb453('0x0'));var util=require(_0xb453('0x1'));var logger=require(_0xb453('0x2'))(_0xb453('0x3'));var moment=require(_0xb453('0x4'));var BPromise=require(_0xb453('0x5'));var rp=require(_0xb453('0x6'));var fs=require('fs');var path=require(_0xb453('0x7'));var rimraf=require(_0xb453('0x8'));var config=require(_0xb453('0x9'));var attributes=require(_0xb453('0xa'));module[_0xb453('0xb')]=function(_0x434695,_0x4d7c1e){return _0x434695[_0xb453('0xc')](_0xb453('0xd'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb453('0xe'),'collate':_0xb453('0xf')});};
\ No newline at end of file
index 2460dc0..9e8e9d2 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(_0x4bf954,_0x4482f8){var _0x2746d0=function(_0x561c7a){while(--_0x561c7a){_0x4bf954['push'](_0x4bf954['shift']());}};_0x2746d0(++_0x4482f8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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(_0x402b9a,_0x2193bb){var _0x17baa3=function(_0x136c14){while(--_0x136c14){_0x402b9a['push'](_0x402b9a['shift']());}};_0x17baa3(++_0x2193bb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
index 0a00af5..eba3a08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28e2=['./cannedAnswer.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x12eb43,_0x4254c4){var _0x264af7=function(_0x567d05){while(--_0x567d05){_0x12eb43['push'](_0x12eb43['shift']());}};_0x264af7(++_0x4254c4);}(_0x28e2,0x1e7));var _0x228e=function(_0x4b0427,_0x8650c2){_0x4b0427=_0x4b0427-0x0;var _0x148d32=_0x28e2[_0x4b0427];return _0x148d32;};'use strict';var multer=require(_0x228e('0x0'));var util=require('util');var path=require(_0x228e('0x1'));var timeout=require(_0x228e('0x2'));var express=require(_0x228e('0x3'));var router=express['Router']();var fs_extra=require(_0x228e('0x4'));var auth=require(_0x228e('0x5'));var interaction=require(_0x228e('0x6'));var config=require('../../config/environment');var controller=require(_0x228e('0x7'));router[_0x228e('0x8')]('/',auth['isAuthenticated'](),controller[_0x228e('0x9')]);router[_0x228e('0x8')](_0x228e('0xa'),auth[_0x228e('0xb')](),controller[_0x228e('0xc')]);router[_0x228e('0xd')]('/',auth[_0x228e('0xb')](),controller[_0x228e('0xe')]);router[_0x228e('0xf')](_0x228e('0xa'),auth[_0x228e('0xb')](),controller[_0x228e('0x10')]);router[_0x228e('0x11')](_0x228e('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x228e('0x12')]=router;
\ No newline at end of file
+var _0x62da=['/:id','show','post','put','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x152bb4,_0x451113){var _0x3cb897=function(_0x55863b){while(--_0x55863b){_0x152bb4['push'](_0x152bb4['shift']());}};_0x3cb897(++_0x451113);}(_0x62da,0x1d6));var _0xa62d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x62da[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xa62d('0x0'));var util=require(_0xa62d('0x1'));var path=require(_0xa62d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa62d('0x3')]();var fs_extra=require(_0xa62d('0x4'));var auth=require(_0xa62d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa62d('0x6'));var controller=require('./cannedAnswer.controller');router[_0xa62d('0x7')]('/',auth[_0xa62d('0x8')](),controller[_0xa62d('0x9')]);router[_0xa62d('0x7')](_0xa62d('0xa'),auth[_0xa62d('0x8')](),controller[_0xa62d('0xb')]);router[_0xa62d('0xc')]('/',auth[_0xa62d('0x8')](),controller['create']);router[_0xa62d('0xd')](_0xa62d('0xa'),auth[_0xa62d('0x8')](),controller['update']);router[_0xa62d('0xe')](_0xa62d('0xa'),auth[_0xa62d('0x8')](),controller[_0xa62d('0xf')]);module['exports']=router;
\ No newline at end of file
index 3b442a7..0958799 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc285=['INTEGER','sequelize','exports','1970-01-01\x2000:00:01','STRING'];(function(_0x306ddc,_0x9c4d60){var _0x11767f=function(_0x35183e){while(--_0x35183e){_0x306ddc['push'](_0x306ddc['shift']());}};_0x11767f(++_0x9c4d60);}(_0xc285,0xd8));var _0x5c28=function(_0x4c9173,_0x54c378){_0x4c9173=_0x4c9173-0x0;var _0x48bf57=_0xc285[_0x4c9173];return _0x48bf57;};'use strict';var Sequelize=require(_0x5c28('0x0'));module[_0x5c28('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x5c28('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x5c28('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x5c28('0x3')]},'channel':{'type':Sequelize[_0x5c28('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x5c28('0x3')]},'lastdata':{'type':Sequelize[_0x5c28('0x3')]},'duration':{'type':Sequelize[_0x5c28('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x5c28('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5c28('0x3')]},'amaflags':{'type':Sequelize[_0x5c28('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x5c28('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x5c28('0x3')]},'linkedid':{'type':Sequelize[_0x5c28('0x3')]},'sequence':{'type':Sequelize[_0x5c28('0x3')]},'peeraccount':{'type':Sequelize[_0x5c28('0x3')]},'type':{'type':Sequelize[_0x5c28('0x3')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x3c8e=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x4de877,_0x340170){var _0xb2cfeb=function(_0x488634){while(--_0x488634){_0x4de877['push'](_0x4de877['shift']());}};_0xb2cfeb(++_0x340170);}(_0x3c8e,0x65));var _0xe3c8=function(_0x35ac80,_0x51ecd6){_0x35ac80=_0x35ac80-0x0;var _0x3faa82=_0x3c8e[_0x35ac80];return _0x3faa82;};'use strict';var Sequelize=require(_0xe3c8('0x0'));module[_0xe3c8('0x1')]={'calldate':{'type':Sequelize[_0xe3c8('0x2')],'allowNull':![],'defaultValue':_0xe3c8('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xe3c8('0x4')]},'dcontext':{'type':Sequelize[_0xe3c8('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xe3c8('0x4')]},'duration':{'type':Sequelize[_0xe3c8('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xe3c8('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe3c8('0x4')]},'amaflags':{'type':Sequelize[_0xe3c8('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xe3c8('0x4')]},'uniqueid':{'type':Sequelize[_0xe3c8('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xe3c8('0x4')]},'peeraccount':{'type':Sequelize[_0xe3c8('0x4')]},'type':{'type':Sequelize[_0xe3c8('0x4')]},'tag':{'type':Sequelize[_0xe3c8('0x4')]}};
\ No newline at end of file
index 0fae817..dbeafe2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc949=['eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','Cdr','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','findAll','catch','rawAttributes','intersection','include','find','create','body','params','describe'];(function(_0x38c4e6,_0x6fe10a){var _0x3af923=function(_0x2f8755){while(--_0x2f8755){_0x38c4e6['push'](_0x38c4e6['shift']());}};_0x3af923(++_0x6fe10a);}(_0xc949,0x181));var _0x9c94=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xc949[_0x4dbaad];return _0x226c72;};'use strict';var emlformat=require(_0x9c94('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9c94('0x1'));var jsonpatch=require(_0x9c94('0x2'));var rp=require(_0x9c94('0x3'));var moment=require(_0x9c94('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9c94('0x5'));var util=require(_0x9c94('0x6'));var path=require('path');var sox=require(_0x9c94('0x7'));var csv=require(_0x9c94('0x8'));var ejs=require(_0x9c94('0x9'));var fs=require('fs');var fs_extra=require(_0x9c94('0xa'));var _=require('lodash');var squel=require(_0x9c94('0xb'));var crypto=require(_0x9c94('0xc'));var jsforce=require(_0x9c94('0xd'));var deskjs=require(_0x9c94('0xe'));var toCsv=require(_0x9c94('0x8'));var querystring=require(_0x9c94('0xf'));var Papa=require(_0x9c94('0x10'));var Redis=require(_0x9c94('0x11'));var authService=require(_0x9c94('0x12'));var qs=require(_0x9c94('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c94('0x14'));var logger=require(_0x9c94('0x15'))(_0x9c94('0x16'));var utils=require(_0x9c94('0x17'));var config=require(_0x9c94('0x18'));var licenseUtil=require(_0x9c94('0x19'));var db=require(_0x9c94('0x1a'))['db'];function respondWithStatusCode(_0x423adb,_0x30f64e){_0x30f64e=_0x30f64e||0xcc;return function(_0x1e326f){if(_0x1e326f){return _0x423adb[_0x9c94('0x1b')](_0x30f64e);}return _0x423adb[_0x9c94('0x1c')](_0x30f64e)[_0x9c94('0x1d')]();};}function respondWithResult(_0x15c51c,_0x54d956){_0x54d956=_0x54d956||0xc8;return function(_0x9789bc){if(_0x9789bc){return _0x15c51c['status'](_0x54d956)[_0x9c94('0x1e')](_0x9789bc);}};}function respondWithFilteredResult(_0x26e629,_0x4f0013){return function(_0xe52641){if(_0xe52641){var _0x4d6308=typeof _0x4f0013['offset']===_0x9c94('0x1f')&&typeof _0x4f0013['limit']===_0x9c94('0x1f');var _0x33bd19=_0xe52641['count'];var _0x201e04=_0x4d6308?0x0:_0x4f0013[_0x9c94('0x20')];var _0x412804=_0x4d6308?_0xe52641[_0x9c94('0x21')]:_0x4f0013[_0x9c94('0x20')]+_0x4f0013[_0x9c94('0x22')];var _0x3e361c;if(_0x412804>=_0x33bd19){_0x412804=_0x33bd19;_0x3e361c=0xc8;}else{_0x3e361c=0xce;}_0x26e629['status'](_0x3e361c);return _0x26e629[_0x9c94('0x23')](_0x9c94('0x24'),_0x201e04+'-'+_0x412804+'/'+_0x33bd19)['json'](_0xe52641);}return null;};}function patchUpdates(_0x141801){return function(_0x845304){try{jsonpatch[_0x9c94('0x25')](_0x845304,_0x141801,!![]);}catch(_0x326b38){return BPromise[_0x9c94('0x26')](_0x326b38);}return _0x845304[_0x9c94('0x27')]();};}function saveUpdates(_0xadab16,_0x23cdf5){return function(_0x8fe4fb){if(_0x8fe4fb){return _0x8fe4fb[_0x9c94('0x28')](_0xadab16)[_0x9c94('0x29')](function(_0xe9280a){return _0xe9280a;});}return null;};}function removeEntity(_0x44d732,_0x8c0b7f){return function(_0x5b1020){if(_0x5b1020){return _0x5b1020[_0x9c94('0x2a')]()[_0x9c94('0x29')](function(){_0x44d732['status'](0xcc)[_0x9c94('0x1d')]();});}};}function handleEntityNotFound(_0x2c3d25,_0x4795bb){return function(_0x335184){if(!_0x335184){_0x2c3d25[_0x9c94('0x1b')](0x194);}return _0x335184;};}function handleError(_0x4dd38e,_0xc18230){_0xc18230=_0xc18230||0x1f4;return function(_0x45cf4d){logger['error'](_0x45cf4d[_0x9c94('0x2b')]);if(_0x45cf4d['name']){delete _0x45cf4d[_0x9c94('0x2c')];}_0x4dd38e[_0x9c94('0x1c')](_0xc18230)[_0x9c94('0x2d')](_0x45cf4d);};}exports[_0x9c94('0x2e')]=function(_0x1581c0,_0x3f2622){var _0xf30dd1={},_0x561fdc={},_0x5a6b1c={'count':0x0,'rows':[]};var _0xc4a819=_[_0x9c94('0x2f')](db[_0x9c94('0x30')]['rawAttributes'],function(_0x25a6b9){return{'name':_0x25a6b9['fieldName'],'type':_0x25a6b9[_0x9c94('0x31')][_0x9c94('0x32')]};});_0x561fdc[_0x9c94('0x33')]=_['map'](_0xc4a819,'name');_0x561fdc[_0x9c94('0x34')]=_[_0x9c94('0x35')](_0x1581c0[_0x9c94('0x34')]);_0x561fdc['filters']=_['intersection'](_0x561fdc['model'],_0x561fdc['query']);_0xf30dd1[_0x9c94('0x36')]=_['intersection'](_0x561fdc[_0x9c94('0x33')],qs[_0x9c94('0x37')](_0x1581c0['query']['fields']));_0xf30dd1[_0x9c94('0x36')]=_0xf30dd1[_0x9c94('0x36')][_0x9c94('0x38')]?_0xf30dd1[_0x9c94('0x36')]:_0x561fdc[_0x9c94('0x33')];if(!_0x1581c0[_0x9c94('0x34')][_0x9c94('0x39')](_0x9c94('0x3a'))){_0xf30dd1[_0x9c94('0x22')]=qs[_0x9c94('0x22')](_0x1581c0[_0x9c94('0x34')][_0x9c94('0x22')]);_0xf30dd1[_0x9c94('0x20')]=qs[_0x9c94('0x20')](_0x1581c0[_0x9c94('0x34')][_0x9c94('0x20')]);}_0xf30dd1[_0x9c94('0x3b')]=qs[_0x9c94('0x3c')](_0x1581c0['query'][_0x9c94('0x3c')]);_0xf30dd1[_0x9c94('0x3d')]=qs[_0x9c94('0x3e')](_[_0x9c94('0x3f')](_0x1581c0[_0x9c94('0x34')],_0x561fdc[_0x9c94('0x3e')]),_0xc4a819);if(_0x1581c0[_0x9c94('0x34')]['filter']){_0xf30dd1[_0x9c94('0x3d')]=_['merge'](_0xf30dd1[_0x9c94('0x3d')],{'$or':_[_0x9c94('0x2f')](_0xc4a819,function(_0x442d46){if(_0x442d46[_0x9c94('0x31')]!=='VIRTUAL'){var _0x245278={};_0x245278[_0x442d46['name']]={'$like':'%'+_0x1581c0[_0x9c94('0x34')][_0x9c94('0x40')]+'%'};return _0x245278;}})});}_0xf30dd1=_[_0x9c94('0x41')]({},_0xf30dd1,_0x1581c0['options']);var _0x21e9f7={'where':_0xf30dd1['where']};return db[_0x9c94('0x30')]['count'](_0x21e9f7)['then'](function(_0x9a75f0){_0x5a6b1c[_0x9c94('0x21')]=_0x9a75f0;if(_0x1581c0[_0x9c94('0x34')][_0x9c94('0x42')]){_0xf30dd1['include']=[{'all':!![]}];}return db[_0x9c94('0x30')][_0x9c94('0x43')](_0xf30dd1);})[_0x9c94('0x29')](function(_0x360960){_0x5a6b1c['rows']=_0x360960;return _0x5a6b1c;})[_0x9c94('0x29')](respondWithFilteredResult(_0x3f2622,_0xf30dd1))[_0x9c94('0x44')](handleError(_0x3f2622,null));};exports['show']=function(_0x24e74c,_0x3d8b31){var _0x2a5bd5={'raw':!![],'where':{'id':_0x24e74c['params']['id']}},_0x5e6a90={};_0x5e6a90[_0x9c94('0x33')]=_[_0x9c94('0x35')](db[_0x9c94('0x30')][_0x9c94('0x45')]);_0x5e6a90[_0x9c94('0x34')]=_[_0x9c94('0x35')](_0x24e74c[_0x9c94('0x34')]);_0x5e6a90[_0x9c94('0x3e')]=_[_0x9c94('0x46')](_0x5e6a90[_0x9c94('0x33')],_0x5e6a90[_0x9c94('0x34')]);_0x2a5bd5['attributes']=_[_0x9c94('0x46')](_0x5e6a90['model'],qs[_0x9c94('0x37')](_0x24e74c[_0x9c94('0x34')][_0x9c94('0x37')]));_0x2a5bd5[_0x9c94('0x36')]=_0x2a5bd5[_0x9c94('0x36')][_0x9c94('0x38')]?_0x2a5bd5[_0x9c94('0x36')]:_0x5e6a90['model'];if(_0x24e74c['query'][_0x9c94('0x42')]){_0x2a5bd5[_0x9c94('0x47')]=[{'all':!![]}];}_0x2a5bd5=_[_0x9c94('0x41')]({},_0x2a5bd5,_0x24e74c['options']);return db[_0x9c94('0x30')][_0x9c94('0x48')](_0x2a5bd5)['then'](handleEntityNotFound(_0x3d8b31,null))['then'](respondWithResult(_0x3d8b31,null))['catch'](handleError(_0x3d8b31,null));};exports['create']=function(_0x2b94e0,_0x5362f4){return db['Cdr'][_0x9c94('0x49')](_0x2b94e0['body'],{})[_0x9c94('0x29')](respondWithResult(_0x5362f4,0xc9))[_0x9c94('0x44')](handleError(_0x5362f4,null));};exports[_0x9c94('0x28')]=function(_0x205f51,_0x22eaa4){if(_0x205f51['body']['id']){delete _0x205f51[_0x9c94('0x4a')]['id'];}return db[_0x9c94('0x30')][_0x9c94('0x48')]({'where':{'id':_0x205f51[_0x9c94('0x4b')]['id']}})[_0x9c94('0x29')](handleEntityNotFound(_0x22eaa4,null))[_0x9c94('0x29')](saveUpdates(_0x205f51['body'],null))[_0x9c94('0x29')](respondWithResult(_0x22eaa4,null))['catch'](handleError(_0x22eaa4,null));};exports[_0x9c94('0x2a')]=function(_0x38bb48,_0x426c0f){return db['Cdr'][_0x9c94('0x48')]({'where':{'id':_0x38bb48[_0x9c94('0x4b')]['id']}})['then'](handleEntityNotFound(_0x426c0f,null))[_0x9c94('0x29')](removeEntity(_0x426c0f,null))['catch'](handleError(_0x426c0f,null));};exports[_0x9c94('0x4c')]=function(_0x3aa1dd,_0x537c78){return db['Cdr'][_0x9c94('0x4c')]()['then'](respondWithResult(_0x537c78,null))[_0x9c94('0x44')](handleError(_0x537c78,null));};
\ No newline at end of file
+var _0x31af=['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','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Cdr','includeAll','include','findAll','rows','catch','params','create','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','ejs'];(function(_0xba44ff,_0x2b3b1f){var _0x482616=function(_0x500a76){while(--_0x500a76){_0xba44ff['push'](_0xba44ff['shift']());}};_0x482616(++_0x2b3b1f);}(_0x31af,0xde));var _0xf31a=function(_0x353ffb,_0x2f216d){_0x353ffb=_0x353ffb-0x0;var _0x3c6d79=_0x31af[_0x353ffb];return _0x3c6d79;};'use strict';var emlformat=require(_0xf31a('0x0'));var rimraf=require(_0xf31a('0x1'));var zipdir=require(_0xf31a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf31a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf31a('0x4'));var util=require(_0xf31a('0x5'));var path=require(_0xf31a('0x6'));var sox=require(_0xf31a('0x7'));var csv=require('to-csv');var ejs=require(_0xf31a('0x8'));var fs=require('fs');var fs_extra=require(_0xf31a('0x9'));var _=require(_0xf31a('0xa'));var squel=require(_0xf31a('0xb'));var crypto=require('crypto');var jsforce=require(_0xf31a('0xc'));var deskjs=require(_0xf31a('0xd'));var toCsv=require(_0xf31a('0xe'));var querystring=require(_0xf31a('0xf'));var Papa=require('papaparse');var Redis=require(_0xf31a('0x10'));var authService=require(_0xf31a('0x11'));var qs=require(_0xf31a('0x12'));var as=require(_0xf31a('0x13'));var hardwareService=require(_0xf31a('0x14'));var logger=require('../../config/logger')(_0xf31a('0x15'));var utils=require(_0xf31a('0x16'));var config=require(_0xf31a('0x17'));var licenseUtil=require(_0xf31a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b662,_0x26b85e){_0x26b85e=_0x26b85e||0xcc;return function(_0x57ed2f){if(_0x57ed2f){return _0x4b662[_0xf31a('0x19')](_0x26b85e);}return _0x4b662[_0xf31a('0x1a')](_0x26b85e)[_0xf31a('0x1b')]();};}function respondWithResult(_0x18d266,_0x451107){_0x451107=_0x451107||0xc8;return function(_0x203031){if(_0x203031){return _0x18d266[_0xf31a('0x1a')](_0x451107)[_0xf31a('0x1c')](_0x203031);}};}function respondWithFilteredResult(_0x3f7c35,_0x22522c){return function(_0x6ea6f1){if(_0x6ea6f1){var _0x1da226=typeof _0x22522c[_0xf31a('0x1d')]===_0xf31a('0x1e')&&typeof _0x22522c[_0xf31a('0x1f')]==='undefined';var _0x454836=_0x6ea6f1[_0xf31a('0x20')];var _0x251ca7=_0x1da226?0x0:_0x22522c[_0xf31a('0x1d')];var _0x4c3589=_0x1da226?_0x6ea6f1[_0xf31a('0x20')]:_0x22522c[_0xf31a('0x1d')]+_0x22522c[_0xf31a('0x1f')];var _0x208da3;if(_0x4c3589>=_0x454836){_0x4c3589=_0x454836;_0x208da3=0xc8;}else{_0x208da3=0xce;}_0x3f7c35[_0xf31a('0x1a')](_0x208da3);return _0x3f7c35['set'](_0xf31a('0x21'),_0x251ca7+'-'+_0x4c3589+'/'+_0x454836)[_0xf31a('0x1c')](_0x6ea6f1);}return null;};}function patchUpdates(_0x5861df){return function(_0x22c9c3){try{jsonpatch[_0xf31a('0x22')](_0x22c9c3,_0x5861df,!![]);}catch(_0x55da11){return BPromise[_0xf31a('0x23')](_0x55da11);}return _0x22c9c3[_0xf31a('0x24')]();};}function saveUpdates(_0x54f9b5,_0x5724b3){return function(_0x534317){if(_0x534317){return _0x534317[_0xf31a('0x25')](_0x54f9b5)[_0xf31a('0x26')](function(_0x5c23db){return _0x5c23db;});}return null;};}function removeEntity(_0x41d359,_0x2a8a22){return function(_0x5d08ee){if(_0x5d08ee){return _0x5d08ee[_0xf31a('0x27')]()['then'](function(){_0x41d359['status'](0xcc)[_0xf31a('0x1b')]();});}};}function handleEntityNotFound(_0x714292,_0x54ad77){return function(_0x4e115c){if(!_0x4e115c){_0x714292['sendStatus'](0x194);}return _0x4e115c;};}function handleError(_0x531179,_0x14c82e){_0x14c82e=_0x14c82e||0x1f4;return function(_0x45df36){logger[_0xf31a('0x28')](_0x45df36['stack']);if(_0x45df36[_0xf31a('0x29')]){delete _0x45df36[_0xf31a('0x29')];}_0x531179[_0xf31a('0x1a')](_0x14c82e)[_0xf31a('0x2a')](_0x45df36);};}exports[_0xf31a('0x2b')]=function(_0x5a55c6,_0xed9bfd){var _0x2ebc27={},_0x52f8aa={},_0x52da7d={'count':0x0,'rows':[]};var _0x203f28=_[_0xf31a('0x2c')](db['Cdr'][_0xf31a('0x2d')],function(_0x221048){return{'name':_0x221048[_0xf31a('0x2e')],'type':_0x221048['type'][_0xf31a('0x2f')]};});_0x52f8aa[_0xf31a('0x30')]=_[_0xf31a('0x2c')](_0x203f28,_0xf31a('0x29'));_0x52f8aa[_0xf31a('0x31')]=_[_0xf31a('0x32')](_0x5a55c6['query']);_0x52f8aa[_0xf31a('0x33')]=_[_0xf31a('0x34')](_0x52f8aa[_0xf31a('0x30')],_0x52f8aa[_0xf31a('0x31')]);_0x2ebc27[_0xf31a('0x35')]=_[_0xf31a('0x34')](_0x52f8aa[_0xf31a('0x30')],qs[_0xf31a('0x36')](_0x5a55c6[_0xf31a('0x31')][_0xf31a('0x36')]));_0x2ebc27[_0xf31a('0x35')]=_0x2ebc27[_0xf31a('0x35')][_0xf31a('0x37')]?_0x2ebc27[_0xf31a('0x35')]:_0x52f8aa[_0xf31a('0x30')];if(!_0x5a55c6[_0xf31a('0x31')][_0xf31a('0x38')](_0xf31a('0x39'))){_0x2ebc27[_0xf31a('0x1f')]=qs['limit'](_0x5a55c6[_0xf31a('0x31')][_0xf31a('0x1f')]);_0x2ebc27[_0xf31a('0x1d')]=qs[_0xf31a('0x1d')](_0x5a55c6[_0xf31a('0x31')]['offset']);}_0x2ebc27[_0xf31a('0x3a')]=qs[_0xf31a('0x3b')](_0x5a55c6[_0xf31a('0x31')]['sort']);_0x2ebc27[_0xf31a('0x3c')]=qs[_0xf31a('0x33')](_[_0xf31a('0x3d')](_0x5a55c6[_0xf31a('0x31')],_0x52f8aa[_0xf31a('0x33')]),_0x203f28);if(_0x5a55c6['query'][_0xf31a('0x3e')]){_0x2ebc27['where']=_[_0xf31a('0x3f')](_0x2ebc27[_0xf31a('0x3c')],{'$or':_['map'](_0x203f28,function(_0x35d5b6){if(_0x35d5b6[_0xf31a('0x40')]!==_0xf31a('0x41')){var _0x481d92={};_0x481d92[_0x35d5b6[_0xf31a('0x29')]]={'$like':'%'+_0x5a55c6[_0xf31a('0x31')][_0xf31a('0x3e')]+'%'};return _0x481d92;}})});}_0x2ebc27=_[_0xf31a('0x3f')]({},_0x2ebc27,_0x5a55c6[_0xf31a('0x42')]);var _0x2a240d={'where':_0x2ebc27[_0xf31a('0x3c')]};return db[_0xf31a('0x43')][_0xf31a('0x20')](_0x2a240d)['then'](function(_0x3b4aef){_0x52da7d[_0xf31a('0x20')]=_0x3b4aef;if(_0x5a55c6['query'][_0xf31a('0x44')]){_0x2ebc27[_0xf31a('0x45')]=[{'all':!![]}];}return db[_0xf31a('0x43')][_0xf31a('0x46')](_0x2ebc27);})['then'](function(_0x21b871){_0x52da7d[_0xf31a('0x47')]=_0x21b871;return _0x52da7d;})[_0xf31a('0x26')](respondWithFilteredResult(_0xed9bfd,_0x2ebc27))[_0xf31a('0x48')](handleError(_0xed9bfd,null));};exports['show']=function(_0x234e1a,_0x58163c){var _0x303066={'raw':!![],'where':{'id':_0x234e1a[_0xf31a('0x49')]['id']}},_0x172e1c={};_0x172e1c['model']=_[_0xf31a('0x32')](db['Cdr'][_0xf31a('0x2d')]);_0x172e1c[_0xf31a('0x31')]=_[_0xf31a('0x32')](_0x234e1a[_0xf31a('0x31')]);_0x172e1c[_0xf31a('0x33')]=_[_0xf31a('0x34')](_0x172e1c[_0xf31a('0x30')],_0x172e1c[_0xf31a('0x31')]);_0x303066[_0xf31a('0x35')]=_['intersection'](_0x172e1c[_0xf31a('0x30')],qs[_0xf31a('0x36')](_0x234e1a[_0xf31a('0x31')][_0xf31a('0x36')]));_0x303066[_0xf31a('0x35')]=_0x303066[_0xf31a('0x35')][_0xf31a('0x37')]?_0x303066['attributes']:_0x172e1c['model'];if(_0x234e1a[_0xf31a('0x31')][_0xf31a('0x44')]){_0x303066[_0xf31a('0x45')]=[{'all':!![]}];}_0x303066=_[_0xf31a('0x3f')]({},_0x303066,_0x234e1a[_0xf31a('0x42')]);return db[_0xf31a('0x43')]['find'](_0x303066)[_0xf31a('0x26')](handleEntityNotFound(_0x58163c,null))[_0xf31a('0x26')](respondWithResult(_0x58163c,null))[_0xf31a('0x48')](handleError(_0x58163c,null));};exports[_0xf31a('0x4a')]=function(_0x45b8ed,_0x287bc1){return db['Cdr'][_0xf31a('0x4a')](_0x45b8ed[_0xf31a('0x4b')],{})[_0xf31a('0x26')](respondWithResult(_0x287bc1,0xc9))[_0xf31a('0x48')](handleError(_0x287bc1,null));};exports[_0xf31a('0x25')]=function(_0x111f08,_0x20bd0c){if(_0x111f08[_0xf31a('0x4b')]['id']){delete _0x111f08[_0xf31a('0x4b')]['id'];}return db[_0xf31a('0x43')]['find']({'where':{'id':_0x111f08[_0xf31a('0x49')]['id']}})['then'](handleEntityNotFound(_0x20bd0c,null))[_0xf31a('0x26')](saveUpdates(_0x111f08[_0xf31a('0x4b')],null))[_0xf31a('0x26')](respondWithResult(_0x20bd0c,null))[_0xf31a('0x48')](handleError(_0x20bd0c,null));};exports[_0xf31a('0x27')]=function(_0x3a1a26,_0x25ad3d){return db[_0xf31a('0x43')]['find']({'where':{'id':_0x3a1a26[_0xf31a('0x49')]['id']}})[_0xf31a('0x26')](handleEntityNotFound(_0x25ad3d,null))[_0xf31a('0x26')](removeEntity(_0x25ad3d,null))[_0xf31a('0x48')](handleError(_0x25ad3d,null));};exports[_0xf31a('0x4c')]=function(_0x8c6795,_0x4d21ed){return db[_0xf31a('0x43')][_0xf31a('0x4c')]()[_0xf31a('0x26')](respondWithResult(_0x4d21ed,null))[_0xf31a('0x48')](handleError(_0x4d21ed,null));};
\ No newline at end of file
index 9201392..cead21b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x58344f,_0x668799){var _0x14a048=function(_0x48cf5a){while(--_0x48cf5a){_0x58344f['push'](_0x58344f['shift']());}};_0x14a048(++_0x668799);}(_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
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x553ea0,_0x1ece5e){var _0x5889c6=function(_0xedbe0a){while(--_0xedbe0a){_0x553ea0['push'](_0x553ea0['shift']());}};_0x5889c6(++_0x1ece5e);}(_0x7a54,0x106));var _0x47a5=function(_0x5cc2ed,_0x37258d){_0x5cc2ed=_0x5cc2ed-0x0;var _0x5bd8fe=_0x7a54[_0x5cc2ed];return _0x5bd8fe;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
index 6e32b2c..41e38d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c7a=['Cdr,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2bbd69,_0x25aa38){var _0x12b5f7=function(_0x2c4993){while(--_0x2c4993){_0x2bbd69['push'](_0x2bbd69['shift']());}};_0x12b5f7(++_0x25aa38);}(_0x1c7a,0xb4));var _0xa1c7=function(_0x69862a,_0x3e36a3){_0x69862a=_0x69862a-0x0;var _0xfde71b=_0x1c7a[_0x69862a];return _0xfde71b;};'use strict';var _=require(_0xa1c7('0x0'));var util=require(_0xa1c7('0x1'));var moment=require(_0xa1c7('0x2'));var BPromise=require(_0xa1c7('0x3'));var rs=require(_0xa1c7('0x4'));var fs=require('fs');var Redis=require(_0xa1c7('0x5'));var db=require(_0xa1c7('0x6'))['db'];var utils=require(_0xa1c7('0x7'));var logger=require(_0xa1c7('0x8'))(_0xa1c7('0x9'));var config=require(_0xa1c7('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xa1c7('0xb')][_0xa1c7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x33f780,_0x51b7af,_0x51d53d){return new BPromise(function(_0x294a9a,_0x51c68f){return client['request'](_0x33f780,_0x51d53d)['then'](function(_0x597e85){logger['info']('Cdr,\x20%s,\x20%s',_0x51b7af,_0xa1c7('0xd'));logger[_0xa1c7('0xe')](_0xa1c7('0xf'),_0x51b7af,'request\x20sent',JSON[_0xa1c7('0x10')](_0x597e85));if(_0x597e85[_0xa1c7('0x11')]){if(_0x597e85['error']['code']===0x1f4){logger['error'](_0xa1c7('0x12'),_0x51b7af,_0x597e85[_0xa1c7('0x11')][_0xa1c7('0x13')]);return _0x51c68f(_0x597e85[_0xa1c7('0x11')][_0xa1c7('0x13')]);}logger[_0xa1c7('0x11')](_0xa1c7('0x12'),_0x51b7af,_0x597e85['error'][_0xa1c7('0x13')]);return _0x294a9a(_0x597e85['error'][_0xa1c7('0x13')]);}else{logger['info'](_0xa1c7('0x12'),_0x51b7af,_0xa1c7('0xd'));_0x294a9a(_0x597e85[_0xa1c7('0x14')][_0xa1c7('0x13')]);}})[_0xa1c7('0x15')](function(_0x5abe81){logger[_0xa1c7('0x11')](_0xa1c7('0x12'),_0x51b7af,_0x5abe81);_0x51c68f(_0x5abe81);});});}
\ No newline at end of file
+var _0xacd2=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','moment','randomstring','ioredis'];(function(_0x31a37b,_0x826249){var _0x49ae16=function(_0x2e8d52){while(--_0x2e8d52){_0x31a37b['push'](_0x31a37b['shift']());}};_0x49ae16(++_0x826249);}(_0xacd2,0x1e9));var _0x2acd=function(_0x3eefe3,_0x2157e2){_0x3eefe3=_0x3eefe3-0x0;var _0x1ec665=_0xacd2[_0x3eefe3];return _0x1ec665;};'use strict';var _=require(_0x2acd('0x0'));var util=require(_0x2acd('0x1'));var moment=require(_0x2acd('0x2'));var BPromise=require('bluebird');var rs=require(_0x2acd('0x3'));var fs=require('fs');var Redis=require(_0x2acd('0x4'));var db=require(_0x2acd('0x5'))['db'];var utils=require(_0x2acd('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x2acd('0x7'));var jayson=require(_0x2acd('0x8'));var client=jayson[_0x2acd('0x9')][_0x2acd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30ef04,_0x474a81,_0x8db95){return new BPromise(function(_0x44ecb7,_0x5d90f6){return client['request'](_0x30ef04,_0x8db95)['then'](function(_0x18bee8){logger[_0x2acd('0xb')](_0x2acd('0xc'),_0x474a81,_0x2acd('0xd'));logger[_0x2acd('0xe')]('Cdr,\x20%s,\x20%s,\x20%s',_0x474a81,_0x2acd('0xd'),JSON[_0x2acd('0xf')](_0x18bee8));if(_0x18bee8[_0x2acd('0x10')]){if(_0x18bee8[_0x2acd('0x10')]['code']===0x1f4){logger['error'](_0x2acd('0xc'),_0x474a81,_0x18bee8[_0x2acd('0x10')][_0x2acd('0x11')]);return _0x5d90f6(_0x18bee8['error']['message']);}logger['error'](_0x2acd('0xc'),_0x474a81,_0x18bee8['error']['message']);return _0x44ecb7(_0x18bee8['error'][_0x2acd('0x11')]);}else{logger[_0x2acd('0xb')](_0x2acd('0xc'),_0x474a81,'request\x20sent');_0x44ecb7(_0x18bee8[_0x2acd('0x12')][_0x2acd('0x11')]);}})['catch'](function(_0x49d05e){logger[_0x2acd('0x10')](_0x2acd('0xc'),_0x474a81,_0x49d05e);_0x5d90f6(_0x49d05e);});});}
\ No newline at end of file
index 0ae06b8..1d6d0e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x1a8518,_0x4fde78){var _0x1ac19c=function(_0x31106f){while(--_0x31106f){_0x1a8518['push'](_0x1a8518['shift']());}};_0x1ac19c(++_0x4fde78);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _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(_0x1fb788,_0x32164b){var _0x167cc0=function(_0x2d56e9){while(--_0x2d56e9){_0x1fb788['push'](_0x1fb788['shift']());}};_0x167cc0(++_0x32164b);}(_0xb10b,0x12a));var _0xbb10=function(_0x28b02a,_0x4bda86){_0x28b02a=_0x28b02a-0x0;var _0x1212ca=_0xb10b[_0x28b02a];return _0x1212ca;};'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
index 6403172..2228420 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf96=['INTEGER','STRING','sequelize','exports'];(function(_0x5e649f,_0x16bdb2){var _0x29a25c=function(_0x1cda9d){while(--_0x1cda9d){_0x5e649f['push'](_0x5e649f['shift']());}};_0x29a25c(++_0x16bdb2);}(_0xbf96,0x1e2));var _0x6bf9=function(_0x2a9a45,_0x1eb664){_0x2a9a45=_0x2a9a45-0x0;var _0x4cd571=_0xbf96[_0x2a9a45];return _0x4cd571;};'use strict';var Sequelize=require(_0x6bf9('0x0'));module[_0x6bf9('0x1')]={'priority':{'type':Sequelize[_0x6bf9('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6bf9('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x6bf9('0x3')]},'interval':{'type':Sequelize[_0x6bf9('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x7ff8=['noop','TEXT','exports','INTEGER','STRING'];(function(_0x420516,_0x5ce5ca){var _0x16484e=function(_0x18775b){while(--_0x18775b){_0x420516['push'](_0x420516['shift']());}};_0x16484e(++_0x5ce5ca);}(_0x7ff8,0x15b));var _0x87ff=function(_0x40911a,_0x55ec99){_0x40911a=_0x40911a-0x0;var _0x27e8e3=_0x7ff8[_0x40911a];return _0x27e8e3;};'use strict';var Sequelize=require('sequelize');module[_0x87ff('0x0')]={'priority':{'type':Sequelize[_0x87ff('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x87ff('0x2')],'allowNull':![],'defaultValue':_0x87ff('0x3')},'appdata':{'type':Sequelize[_0x87ff('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x87ff('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index ca36691..61bf625 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22dd=['find','catch','body','ChatApplication','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','undefined','limit','offset','set','Content-Range','reject','save','update','then','error','stack','name','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','options'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0x22dd,0xe4));var _0xd22d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x22dd[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd22d('0x0'));var rimraf=require(_0xd22d('0x1'));var zipdir=require(_0xd22d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd22d('0x3'));var BPromise=require(_0xd22d('0x4'));var Mustache=require(_0xd22d('0x5'));var util=require(_0xd22d('0x6'));var path=require(_0xd22d('0x7'));var sox=require(_0xd22d('0x8'));var csv=require(_0xd22d('0x9'));var ejs=require(_0xd22d('0xa'));var fs=require('fs');var fs_extra=require(_0xd22d('0xb'));var _=require(_0xd22d('0xc'));var squel=require('squel');var crypto=require(_0xd22d('0xd'));var jsforce=require(_0xd22d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd22d('0x9'));var querystring=require('querystring');var Papa=require(_0xd22d('0xf'));var Redis=require('ioredis');var authService=require(_0xd22d('0x10'));var qs=require(_0xd22d('0x11'));var as=require(_0xd22d('0x12'));var hardwareService=require(_0xd22d('0x13'));var logger=require(_0xd22d('0x14'))(_0xd22d('0x15'));var utils=require(_0xd22d('0x16'));var config=require(_0xd22d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xd22d('0x18'))['db'];function respondWithStatusCode(_0x46f164,_0x51a8ea){_0x51a8ea=_0x51a8ea||0xcc;return function(_0x38978b){if(_0x38978b){return _0x46f164[_0xd22d('0x19')](_0x51a8ea);}return _0x46f164['status'](_0x51a8ea)['end']();};}function respondWithResult(_0x5994fe,_0x156546){_0x156546=_0x156546||0xc8;return function(_0x5dc338){if(_0x5dc338){return _0x5994fe[_0xd22d('0x1a')](_0x156546)['json'](_0x5dc338);}};}function respondWithFilteredResult(_0x78d93e,_0x5b91bd){return function(_0x5027d){if(_0x5027d){var _0x377e75=typeof _0x5b91bd['offset']===_0xd22d('0x1b')&&typeof _0x5b91bd[_0xd22d('0x1c')]===_0xd22d('0x1b');var _0x11c410=_0x5027d['count'];var _0x5c516a=_0x377e75?0x0:_0x5b91bd[_0xd22d('0x1d')];var _0x5a0a0b=_0x377e75?_0x5027d['count']:_0x5b91bd['offset']+_0x5b91bd[_0xd22d('0x1c')];var _0x46f8b6;if(_0x5a0a0b>=_0x11c410){_0x5a0a0b=_0x11c410;_0x46f8b6=0xc8;}else{_0x46f8b6=0xce;}_0x78d93e[_0xd22d('0x1a')](_0x46f8b6);return _0x78d93e[_0xd22d('0x1e')](_0xd22d('0x1f'),_0x5c516a+'-'+_0x5a0a0b+'/'+_0x11c410)['json'](_0x5027d);}return null;};}function patchUpdates(_0x2bfc84){return function(_0x4e18f5){try{jsonpatch['apply'](_0x4e18f5,_0x2bfc84,!![]);}catch(_0x478c1f){return BPromise[_0xd22d('0x20')](_0x478c1f);}return _0x4e18f5[_0xd22d('0x21')]();};}function saveUpdates(_0x1ecab6,_0x420836){return function(_0x1be46f){if(_0x1be46f){return _0x1be46f[_0xd22d('0x22')](_0x1ecab6)[_0xd22d('0x23')](function(_0x52039a){return _0x52039a;});}return null;};}function removeEntity(_0x3b07b3,_0x8340e5){return function(_0x55bce9){if(_0x55bce9){return _0x55bce9['destroy']()[_0xd22d('0x23')](function(){_0x3b07b3[_0xd22d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b0959,_0x370902){return function(_0xee8f2){if(!_0xee8f2){_0x2b0959[_0xd22d('0x19')](0x194);}return _0xee8f2;};}function handleError(_0x2b47c2,_0x2c7b5a){_0x2c7b5a=_0x2c7b5a||0x1f4;return function(_0x2d45ab){logger[_0xd22d('0x24')](_0x2d45ab[_0xd22d('0x25')]);if(_0x2d45ab['name']){delete _0x2d45ab[_0xd22d('0x26')];}_0x2b47c2[_0xd22d('0x1a')](_0x2c7b5a)['send'](_0x2d45ab);};}exports[_0xd22d('0x27')]=function(_0x5f00f9,_0x5381a8){var _0x2d377d={'raw':!![],'where':{'id':_0x5f00f9[_0xd22d('0x28')]['id']}},_0x96a17e={};_0x96a17e[_0xd22d('0x29')]=_[_0xd22d('0x2a')](db['ChatApplication'][_0xd22d('0x2b')]);_0x96a17e['query']=_[_0xd22d('0x2a')](_0x5f00f9[_0xd22d('0x2c')]);_0x96a17e[_0xd22d('0x2d')]=_[_0xd22d('0x2e')](_0x96a17e[_0xd22d('0x29')],_0x96a17e['query']);_0x2d377d[_0xd22d('0x2f')]=_[_0xd22d('0x2e')](_0x96a17e['model'],qs[_0xd22d('0x30')](_0x5f00f9['query'][_0xd22d('0x30')]));_0x2d377d[_0xd22d('0x2f')]=_0x2d377d['attributes'][_0xd22d('0x31')]?_0x2d377d[_0xd22d('0x2f')]:_0x96a17e[_0xd22d('0x29')];if(_0x5f00f9['query'][_0xd22d('0x32')]){_0x2d377d['include']=[{'all':!![]}];}_0x2d377d=_['merge']({},_0x2d377d,_0x5f00f9[_0xd22d('0x33')]);return db['ChatApplication'][_0xd22d('0x34')](_0x2d377d)['then'](handleEntityNotFound(_0x5381a8,null))[_0xd22d('0x23')](respondWithResult(_0x5381a8,null))[_0xd22d('0x35')](handleError(_0x5381a8,null));};exports['update']=function(_0x5b5516,_0x25554b){if(_0x5b5516[_0xd22d('0x36')]['id']){delete _0x5b5516[_0xd22d('0x36')]['id'];}return db[_0xd22d('0x37')][_0xd22d('0x34')]({'where':{'id':_0x5b5516[_0xd22d('0x28')]['id']}})[_0xd22d('0x23')](handleEntityNotFound(_0x25554b,null))['then'](saveUpdates(_0x5b5516['body'],null))[_0xd22d('0x23')](respondWithResult(_0x25554b,null))[_0xd22d('0x35')](handleError(_0x25554b,null));};exports['destroy']=function(_0xfbc831,_0x326507){return db['ChatApplication']['find']({'where':{'id':_0xfbc831['params']['id']}})[_0xd22d('0x23')](handleEntityNotFound(_0x326507,null))[_0xd22d('0x23')](removeEntity(_0x326507,null))[_0xd22d('0x35')](handleError(_0x326507,null));};
\ No newline at end of file
+var _0x74fd=['reject','save','destroy','then','name','send','show','params','model','keys','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','ChatApplication','catch','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set'];(function(_0x484d32,_0x40a4f1){var _0xb6a25c=function(_0x551520){while(--_0x551520){_0x484d32['push'](_0x484d32['shift']());}};_0xb6a25c(++_0x40a4f1);}(_0x74fd,0x8f));var _0xd74f=function(_0x4ca6a4,_0x5e9694){_0x4ca6a4=_0x4ca6a4-0x0;var _0x120555=_0x74fd[_0x4ca6a4];return _0x120555;};'use strict';var emlformat=require(_0xd74f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd74f('0x1'));var jsonpatch=require(_0xd74f('0x2'));var rp=require(_0xd74f('0x3'));var moment=require(_0xd74f('0x4'));var BPromise=require(_0xd74f('0x5'));var Mustache=require(_0xd74f('0x6'));var util=require(_0xd74f('0x7'));var path=require(_0xd74f('0x8'));var sox=require(_0xd74f('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd74f('0xa'));var _=require(_0xd74f('0xb'));var squel=require('squel');var crypto=require(_0xd74f('0xc'));var jsforce=require(_0xd74f('0xd'));var deskjs=require(_0xd74f('0xe'));var toCsv=require(_0xd74f('0xf'));var querystring=require(_0xd74f('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd74f('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd74f('0x12'));var logger=require(_0xd74f('0x13'))(_0xd74f('0x14'));var utils=require(_0xd74f('0x15'));var config=require(_0xd74f('0x16'));var licenseUtil=require(_0xd74f('0x17'));var db=require(_0xd74f('0x18'))['db'];function respondWithStatusCode(_0x29d351,_0x3f985c){_0x3f985c=_0x3f985c||0xcc;return function(_0x59998d){if(_0x59998d){return _0x29d351[_0xd74f('0x19')](_0x3f985c);}return _0x29d351[_0xd74f('0x1a')](_0x3f985c)[_0xd74f('0x1b')]();};}function respondWithResult(_0x1a0d70,_0x629925){_0x629925=_0x629925||0xc8;return function(_0x509ad5){if(_0x509ad5){return _0x1a0d70[_0xd74f('0x1a')](_0x629925)[_0xd74f('0x1c')](_0x509ad5);}};}function respondWithFilteredResult(_0x1bc6d9,_0x53207a){return function(_0x267d4d){if(_0x267d4d){var _0x297477=typeof _0x53207a['offset']===_0xd74f('0x1d')&&typeof _0x53207a[_0xd74f('0x1e')]===_0xd74f('0x1d');var _0x2be0c4=_0x267d4d[_0xd74f('0x1f')];var _0x8ce3f2=_0x297477?0x0:_0x53207a[_0xd74f('0x20')];var _0x535c4a=_0x297477?_0x267d4d[_0xd74f('0x1f')]:_0x53207a[_0xd74f('0x20')]+_0x53207a['limit'];var _0x893907;if(_0x535c4a>=_0x2be0c4){_0x535c4a=_0x2be0c4;_0x893907=0xc8;}else{_0x893907=0xce;}_0x1bc6d9[_0xd74f('0x1a')](_0x893907);return _0x1bc6d9[_0xd74f('0x21')]('Content-Range',_0x8ce3f2+'-'+_0x535c4a+'/'+_0x2be0c4)['json'](_0x267d4d);}return null;};}function patchUpdates(_0x586a75){return function(_0x46139b){try{jsonpatch['apply'](_0x46139b,_0x586a75,!![]);}catch(_0x5c0d80){return BPromise[_0xd74f('0x22')](_0x5c0d80);}return _0x46139b[_0xd74f('0x23')]();};}function saveUpdates(_0x51dcfc,_0x1ec24b){return function(_0x341585){if(_0x341585){return _0x341585['update'](_0x51dcfc)['then'](function(_0x313285){return _0x313285;});}return null;};}function removeEntity(_0x2406a7,_0x15a863){return function(_0x14bb84){if(_0x14bb84){return _0x14bb84[_0xd74f('0x24')]()[_0xd74f('0x25')](function(){_0x2406a7[_0xd74f('0x1a')](0xcc)[_0xd74f('0x1b')]();});}};}function handleEntityNotFound(_0x409536,_0x40a089){return function(_0x1abb89){if(!_0x1abb89){_0x409536[_0xd74f('0x19')](0x194);}return _0x1abb89;};}function handleError(_0x176169,_0x394443){_0x394443=_0x394443||0x1f4;return function(_0xd5dca0){logger['error'](_0xd5dca0['stack']);if(_0xd5dca0['name']){delete _0xd5dca0[_0xd74f('0x26')];}_0x176169[_0xd74f('0x1a')](_0x394443)[_0xd74f('0x27')](_0xd5dca0);};}exports[_0xd74f('0x28')]=function(_0x175c36,_0x256878){var _0x10ac39={'raw':!![],'where':{'id':_0x175c36[_0xd74f('0x29')]['id']}},_0xc39b90={};_0xc39b90[_0xd74f('0x2a')]=_[_0xd74f('0x2b')](db['ChatApplication'][_0xd74f('0x2c')]);_0xc39b90[_0xd74f('0x2d')]=_[_0xd74f('0x2b')](_0x175c36[_0xd74f('0x2d')]);_0xc39b90[_0xd74f('0x2e')]=_['intersection'](_0xc39b90[_0xd74f('0x2a')],_0xc39b90[_0xd74f('0x2d')]);_0x10ac39[_0xd74f('0x2f')]=_[_0xd74f('0x30')](_0xc39b90[_0xd74f('0x2a')],qs[_0xd74f('0x31')](_0x175c36[_0xd74f('0x2d')]['fields']));_0x10ac39[_0xd74f('0x2f')]=_0x10ac39[_0xd74f('0x2f')][_0xd74f('0x32')]?_0x10ac39[_0xd74f('0x2f')]:_0xc39b90['model'];if(_0x175c36['query'][_0xd74f('0x33')]){_0x10ac39[_0xd74f('0x34')]=[{'all':!![]}];}_0x10ac39=_[_0xd74f('0x35')]({},_0x10ac39,_0x175c36[_0xd74f('0x36')]);return db[_0xd74f('0x37')]['find'](_0x10ac39)[_0xd74f('0x25')](handleEntityNotFound(_0x256878,null))['then'](respondWithResult(_0x256878,null))[_0xd74f('0x38')](handleError(_0x256878,null));};exports['update']=function(_0x50ee8c,_0x2f8a33){if(_0x50ee8c[_0xd74f('0x39')]['id']){delete _0x50ee8c[_0xd74f('0x39')]['id'];}return db['ChatApplication'][_0xd74f('0x3a')]({'where':{'id':_0x50ee8c[_0xd74f('0x29')]['id']}})[_0xd74f('0x25')](handleEntityNotFound(_0x2f8a33,null))[_0xd74f('0x25')](saveUpdates(_0x50ee8c[_0xd74f('0x39')],null))[_0xd74f('0x25')](respondWithResult(_0x2f8a33,null))[_0xd74f('0x38')](handleError(_0x2f8a33,null));};exports[_0xd74f('0x24')]=function(_0x23fa3f,_0x3aa915){return db[_0xd74f('0x37')][_0xd74f('0x3a')]({'where':{'id':_0x23fa3f[_0xd74f('0x29')]['id']}})[_0xd74f('0x25')](handleEntityNotFound(_0x3aa915,null))[_0xd74f('0x25')](removeEntity(_0x3aa915,null))[_0xd74f('0x38')](handleError(_0x3aa915,null));};
\ No newline at end of file
index ae319d8..54fdc91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c70=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatApplication'];(function(_0x2c6120,_0x1f3e60){var _0x5fb114=function(_0x45a72d){while(--_0x45a72d){_0x2c6120['push'](_0x2c6120['shift']());}};_0x5fb114(++_0x1f3e60);}(_0x3c70,0x10c));var _0x03c7=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x3c70[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0x03c7('0x0'));var util=require(_0x03c7('0x1'));var logger=require(_0x03c7('0x2'))('api');var moment=require(_0x03c7('0x3'));var BPromise=require(_0x03c7('0x4'));var rp=require(_0x03c7('0x5'));var fs=require('fs');var path=require(_0x03c7('0x6'));var rimraf=require(_0x03c7('0x7'));var config=require(_0x03c7('0x8'));var attributes=require('./chatApplication.attributes');module[_0x03c7('0x9')]=function(_0x4f774e,_0x5b6c32){return _0x4f774e[_0x03c7('0xa')](_0x03c7('0xb'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x03c7('0xc'),'collate':_0x03c7('0xd')});};
\ No newline at end of file
+var _0xb9c6=['./chatApplication.attributes','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xb9c6,0x1d8));var _0x6b9c=function(_0x495f66,_0x3b27fe){_0x495f66=_0x495f66-0x0;var _0x54a2bb=_0xb9c6[_0x495f66];return _0x54a2bb;};'use strict';var _=require(_0x6b9c('0x0'));var util=require(_0x6b9c('0x1'));var logger=require(_0x6b9c('0x2'))(_0x6b9c('0x3'));var moment=require(_0x6b9c('0x4'));var BPromise=require(_0x6b9c('0x5'));var rp=require(_0x6b9c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6b9c('0x7'));var attributes=require(_0x6b9c('0x8'));module['exports']=function(_0x5670f5,_0x4312d4){return _0x5670f5['define'](_0x6b9c('0x9'),attributes,{'tableName':_0x6b9c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x6b9c('0xb')});};
\ No newline at end of file
index 24cb664..4d2c2d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2232=['error','message','result','catch','randomstring','ioredis','../../config/utils','../../config/environment','client','http','request','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s'];(function(_0x5bd337,_0x537448){var _0x287f5f=function(_0x6cecde){while(--_0x6cecde){_0x5bd337['push'](_0x5bd337['shift']());}};_0x287f5f(++_0x537448);}(_0x2232,0x1b4));var _0x2223=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2232[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2223('0x0'));var fs=require('fs');var Redis=require(_0x2223('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x2223('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0x2223('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x2223('0x4')][_0x2223('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x5397f3,_0x1d4336,_0x339451){return new BPromise(function(_0x57a6e0,_0x32a106){return client[_0x2223('0x6')](_0x5397f3,_0x339451)[_0x2223('0x7')](function(_0x2aedfd){logger[_0x2223('0x8')]('ChatApplication,\x20%s,\x20%s',_0x1d4336,_0x2223('0x9'));logger[_0x2223('0xa')](_0x2223('0xb'),_0x1d4336,_0x2223('0x9'),JSON['stringify'](_0x2aedfd));if(_0x2aedfd[_0x2223('0xc')]){if(_0x2aedfd[_0x2223('0xc')]['code']===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x1d4336,_0x2aedfd['error'][_0x2223('0xd')]);return _0x32a106(_0x2aedfd[_0x2223('0xc')][_0x2223('0xd')]);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x1d4336,_0x2aedfd[_0x2223('0xc')]['message']);return _0x57a6e0(_0x2aedfd[_0x2223('0xc')][_0x2223('0xd')]);}else{logger[_0x2223('0x8')]('ChatApplication,\x20%s,\x20%s',_0x1d4336,'request\x20sent');_0x57a6e0(_0x2aedfd[_0x2223('0xe')]['message']);}})[_0x2223('0xf')](function(_0x2157b1){logger[_0x2223('0xc')]('ChatApplication,\x20%s,\x20%s',_0x1d4336,_0x2157b1);_0x32a106(_0x2157b1);});});}
\ No newline at end of file
+var _0x2274=['code','message','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','info','ChatApplication,\x20%s,\x20%s','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4124b8,_0x39a5fb){var _0xdd927=function(_0x2fb8ab){while(--_0x2fb8ab){_0x4124b8['push'](_0x4124b8['shift']());}};_0xdd927(++_0x39a5fb);}(_0x2274,0x111));var _0x4227=function(_0x15dea9,_0x163d52){_0x15dea9=_0x15dea9-0x0;var _0x1b0cf0=_0x2274[_0x15dea9];return _0x1b0cf0;};'use strict';var _=require('lodash');var util=require(_0x4227('0x0'));var moment=require('moment');var BPromise=require(_0x4227('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4227('0x2'));var db=require(_0x4227('0x3'))['db'];var utils=require(_0x4227('0x4'));var logger=require('../../config/logger')(_0x4227('0x5'));var config=require(_0x4227('0x6'));var jayson=require(_0x4227('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x16c8b5,_0x4244f2,_0x45a6a3){return new BPromise(function(_0x1930c5,_0x57b860){return client[_0x4227('0x8')](_0x16c8b5,_0x45a6a3)['then'](function(_0x4044c1){logger[_0x4227('0x9')](_0x4227('0xa'),_0x4244f2,'request\x20sent');logger['debug'](_0x4227('0xb'),_0x4244f2,_0x4227('0xc'),JSON[_0x4227('0xd')](_0x4044c1));if(_0x4044c1[_0x4227('0xe')]){if(_0x4044c1[_0x4227('0xe')][_0x4227('0xf')]===0x1f4){logger[_0x4227('0xe')](_0x4227('0xa'),_0x4244f2,_0x4044c1[_0x4227('0xe')][_0x4227('0x10')]);return _0x57b860(_0x4044c1['error'][_0x4227('0x10')]);}logger[_0x4227('0xe')](_0x4227('0xa'),_0x4244f2,_0x4044c1['error'][_0x4227('0x10')]);return _0x1930c5(_0x4044c1['error'][_0x4227('0x10')]);}else{logger[_0x4227('0x9')]('ChatApplication,\x20%s,\x20%s',_0x4244f2,_0x4227('0xc'));_0x1930c5(_0x4044c1['result'][_0x4227('0x10')]);}})[_0x4227('0x11')](function(_0x16469b){logger[_0x4227('0xe')](_0x4227('0xa'),_0x4244f2,_0x16469b);_0x57b860(_0x16469b);});});}
\ No newline at end of file
index 1ec576b..498844a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12a7=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','update','delete','destroy','multer'];(function(_0x2b737c,_0x274adf){var _0x466ed5=function(_0x593124){while(--_0x593124){_0x2b737c['push'](_0x2b737c['shift']());}};_0x466ed5(++_0x274adf);}(_0x12a7,0x1db));var _0x712a=function(_0x2d5482,_0x309995){_0x2d5482=_0x2d5482-0x0;var _0x5d0cb1=_0x12a7[_0x2d5482];return _0x5d0cb1;};'use strict';var multer=require(_0x712a('0x0'));var util=require('util');var path=require(_0x712a('0x1'));var timeout=require(_0x712a('0x2'));var express=require(_0x712a('0x3'));var router=express[_0x712a('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x712a('0x5'));var config=require(_0x712a('0x6'));var controller=require('./chatApplication.controller');router[_0x712a('0x7')](_0x712a('0x8'),auth[_0x712a('0x9')](),controller[_0x712a('0xa')]);router['put'](_0x712a('0x8'),auth[_0x712a('0x9')](),controller[_0x712a('0xb')]);router[_0x712a('0xc')](_0x712a('0x8'),auth[_0x712a('0x9')](),controller[_0x712a('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0xab45=['isAuthenticated','show','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller'];(function(_0x32a0b4,_0x21e432){var _0x2f1523=function(_0x16fc69){while(--_0x16fc69){_0x32a0b4['push'](_0x32a0b4['shift']());}};_0x2f1523(++_0x21e432);}(_0xab45,0x74));var _0x5ab4=function(_0x515343,_0xe470f1){_0x515343=_0x515343-0x0;var _0x1ee29e=_0xab45[_0x515343];return _0x1ee29e;};'use strict';var multer=require(_0x5ab4('0x0'));var util=require(_0x5ab4('0x1'));var path=require(_0x5ab4('0x2'));var timeout=require(_0x5ab4('0x3'));var express=require('express');var router=express[_0x5ab4('0x4')]();var fs_extra=require(_0x5ab4('0x5'));var auth=require(_0x5ab4('0x6'));var interaction=require(_0x5ab4('0x7'));var config=require(_0x5ab4('0x8'));var controller=require(_0x5ab4('0x9'));router['get']('/:id',auth[_0x5ab4('0xa')](),controller[_0x5ab4('0xb')]);router[_0x5ab4('0xc')](_0x5ab4('0xd'),auth[_0x5ab4('0xa')](),controller[_0x5ab4('0xe')]);router[_0x5ab4('0xf')](_0x5ab4('0xd'),auth[_0x5ab4('0xa')](),controller[_0x5ab4('0x10')]);module[_0x5ab4('0x11')]=router;
\ No newline at end of file
index e28418a..b5106ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfce5=['STRING','sequelize','exports'];(function(_0x38614a,_0x222bc3){var _0x59acf9=function(_0x376734){while(--_0x376734){_0x38614a['push'](_0x38614a['shift']());}};_0x59acf9(++_0x222bc3);}(_0xfce5,0x1d5));var _0x5fce=function(_0x3e7653,_0x414e83){_0x3e7653=_0x3e7653-0x0;var _0x2d518d=_0xfce5[_0x3e7653];return _0x2d518d;};'use strict';var Sequelize=require(_0x5fce('0x0'));module[_0x5fce('0x1')]={'name':{'type':Sequelize[_0x5fce('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5fce('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xb9f9=['STRING','BOOLEAN'];(function(_0x47a5bd,_0x508329){var _0x5c2184=function(_0x40ddea){while(--_0x40ddea){_0x47a5bd['push'](_0x47a5bd['shift']());}};_0x5c2184(++_0x508329);}(_0xb9f9,0x12c));var _0x9b9f=function(_0x193fae,_0x10a0fe){_0x193fae=_0x193fae-0x0;var _0x27595a=_0xb9f9[_0x193fae];return _0x27595a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x9b9f('0x0')]},'write':{'type':Sequelize[_0x9b9f('0x1')],'defaultValue':!![]}};
\ No newline at end of file
index 63fdbb4..c24cb69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8ce=['then','destroy','error','stack','name','map','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','ChatGroup','rawAttributes','keys','find','create','body','getUnread','ChatInternalMessage','toInteger','getMembers','findOne','User','options','length','removeMembers','ids','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update'];(function(_0x321cff,_0x271a66){var _0x331c4=function(_0x3846e8){while(--_0x3846e8){_0x321cff['push'](_0x321cff['shift']());}};_0x331c4(++_0x271a66);}(_0xf8ce,0x190));var _0xef8c=function(_0x2998fd,_0x32f00e){_0x2998fd=_0x2998fd-0x0;var _0x212def=_0xf8ce[_0x2998fd];return _0x212def;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xef8c('0x0'));var zipdir=require(_0xef8c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xef8c('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xef8c('0x3'));var sox=require(_0xef8c('0x4'));var csv=require(_0xef8c('0x5'));var ejs=require(_0xef8c('0x6'));var fs=require('fs');var fs_extra=require(_0xef8c('0x7'));var _=require(_0xef8c('0x8'));var squel=require(_0xef8c('0x9'));var crypto=require('crypto');var jsforce=require(_0xef8c('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xef8c('0x5'));var querystring=require('querystring');var Papa=require(_0xef8c('0xb'));var Redis=require(_0xef8c('0xc'));var authService=require(_0xef8c('0xd'));var qs=require(_0xef8c('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xef8c('0xf'))(_0xef8c('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xef8c('0x11'))['db'];config[_0xef8c('0x12')]=_['defaults'](config[_0xef8c('0x12')],{'host':_0xef8c('0x13'),'port':0x18eb});var socket=require(_0xef8c('0x14'))(new Redis(config[_0xef8c('0x12')]));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x1edd86,_0x526a89){_0x526a89=_0x526a89||0xcc;return function(_0x51f305){if(_0x51f305){return _0x1edd86[_0xef8c('0x15')](_0x526a89);}return _0x1edd86[_0xef8c('0x16')](_0x526a89)[_0xef8c('0x17')]();};}function respondWithResult(_0x3c8fc0,_0x385339){_0x385339=_0x385339||0xc8;return function(_0x35b2ce){if(_0x35b2ce){return _0x3c8fc0[_0xef8c('0x16')](_0x385339)[_0xef8c('0x18')](_0x35b2ce);}};}function respondWithFilteredResult(_0x314f5c,_0x230364){return function(_0x37c5b2){if(_0x37c5b2){var _0x387be3=typeof _0x230364[_0xef8c('0x19')]===_0xef8c('0x1a')&&typeof _0x230364[_0xef8c('0x1b')]===_0xef8c('0x1a');var _0x53e757=_0x37c5b2[_0xef8c('0x1c')];var _0x36e75d=_0x387be3?0x0:_0x230364['offset'];var _0x39205f=_0x387be3?_0x37c5b2[_0xef8c('0x1c')]:_0x230364['offset']+_0x230364[_0xef8c('0x1b')];var _0x94bb1a;if(_0x39205f>=_0x53e757){_0x39205f=_0x53e757;_0x94bb1a=0xc8;}else{_0x94bb1a=0xce;}_0x314f5c[_0xef8c('0x16')](_0x94bb1a);return _0x314f5c[_0xef8c('0x1d')](_0xef8c('0x1e'),_0x36e75d+'-'+_0x39205f+'/'+_0x53e757)['json'](_0x37c5b2);}return null;};}function patchUpdates(_0x1cad71){return function(_0x123c0f){try{jsonpatch[_0xef8c('0x1f')](_0x123c0f,_0x1cad71,!![]);}catch(_0x2d7641){return BPromise[_0xef8c('0x20')](_0x2d7641);}return _0x123c0f[_0xef8c('0x21')]();};}function saveUpdates(_0x3c9055,_0x63e447){return function(_0x27174d){if(_0x27174d){return _0x27174d[_0xef8c('0x22')](_0x3c9055)[_0xef8c('0x23')](function(_0x2ccccd){return _0x2ccccd;});}return null;};}function removeEntity(_0x3a1cd6,_0x3bd602){return function(_0x472358){if(_0x472358){return _0x472358[_0xef8c('0x24')]()[_0xef8c('0x23')](function(){_0x3a1cd6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16d4b9,_0x6079d4){return function(_0x54f07b){if(!_0x54f07b){_0x16d4b9[_0xef8c('0x15')](0x194);}return _0x54f07b;};}function handleError(_0x40adbf,_0x583698){_0x583698=_0x583698||0x1f4;return function(_0x11994d){logger[_0xef8c('0x25')](_0x11994d[_0xef8c('0x26')]);if(_0x11994d['name']){delete _0x11994d[_0xef8c('0x27')];}_0x40adbf['status'](_0x583698)['send'](_0x11994d);};}exports['index']=function(_0x24cd34,_0x44de5b){var _0x166ac5={},_0x5ece73={},_0x2fbd13={'count':0x0,'rows':[]};var _0x160499=_[_0xef8c('0x28')](db['ChatGroup']['rawAttributes'],function(_0x127d67){return{'name':_0x127d67['fieldName'],'type':_0x127d67['type']['key']};});_0x5ece73[_0xef8c('0x29')]=_[_0xef8c('0x28')](_0x160499,_0xef8c('0x27'));_0x5ece73[_0xef8c('0x2a')]=_['keys'](_0x24cd34[_0xef8c('0x2a')]);_0x5ece73[_0xef8c('0x2b')]=_[_0xef8c('0x2c')](_0x5ece73[_0xef8c('0x29')],_0x5ece73[_0xef8c('0x2a')]);_0x166ac5[_0xef8c('0x2d')]=_[_0xef8c('0x2c')](_0x5ece73[_0xef8c('0x29')],qs[_0xef8c('0x2e')](_0x24cd34[_0xef8c('0x2a')][_0xef8c('0x2e')]));_0x166ac5[_0xef8c('0x2d')]=_0x166ac5['attributes']['length']?_0x166ac5['attributes']:_0x5ece73['model'];if(!_0x24cd34['query'][_0xef8c('0x2f')](_0xef8c('0x30'))){_0x166ac5[_0xef8c('0x1b')]=qs[_0xef8c('0x1b')](_0x24cd34[_0xef8c('0x2a')][_0xef8c('0x1b')]);_0x166ac5['offset']=qs[_0xef8c('0x19')](_0x24cd34[_0xef8c('0x2a')][_0xef8c('0x19')]);}_0x166ac5[_0xef8c('0x31')]=qs[_0xef8c('0x32')](_0x24cd34[_0xef8c('0x2a')][_0xef8c('0x32')]);_0x166ac5[_0xef8c('0x33')]=qs[_0xef8c('0x2b')](_[_0xef8c('0x34')](_0x24cd34[_0xef8c('0x2a')],_0x5ece73['filters']),_0x160499);if(_0x24cd34[_0xef8c('0x2a')][_0xef8c('0x35')]){_0x166ac5[_0xef8c('0x33')]=_[_0xef8c('0x36')](_0x166ac5['where'],{'$or':_[_0xef8c('0x28')](_0x160499,function(_0x28fa9c){if(_0x28fa9c[_0xef8c('0x37')]!==_0xef8c('0x38')){var _0x2bdc50={};_0x2bdc50[_0x28fa9c[_0xef8c('0x27')]]={'$like':'%'+_0x24cd34['query'][_0xef8c('0x35')]+'%'};return _0x2bdc50;}})});}_0x166ac5=_['merge']({},_0x166ac5,_0x24cd34['options']);var _0x2869a1={'where':_0x166ac5[_0xef8c('0x33')]};return db['ChatGroup']['count'](_0x2869a1)[_0xef8c('0x23')](function(_0x15936e){_0x2fbd13['count']=_0x15936e;if(_0x24cd34[_0xef8c('0x2a')][_0xef8c('0x39')]){_0x166ac5[_0xef8c('0x3a')]=[{'all':!![]}];}return db['ChatGroup'][_0xef8c('0x3b')](_0x166ac5);})['then'](function(_0x3eaa25){_0x2fbd13[_0xef8c('0x3c')]=_0x3eaa25;return _0x2fbd13;})['then'](respondWithFilteredResult(_0x44de5b,_0x166ac5))[_0xef8c('0x3d')](handleError(_0x44de5b,null));};exports[_0xef8c('0x3e')]=function(_0x81ec7d,_0x138a20){var _0x290a8c={'raw':!![],'where':{'id':_0x81ec7d[_0xef8c('0x3f')]['id']}},_0x202710={};_0x202710['model']=_['keys'](db[_0xef8c('0x40')][_0xef8c('0x41')]);_0x202710[_0xef8c('0x2a')]=_[_0xef8c('0x42')](_0x81ec7d[_0xef8c('0x2a')]);_0x202710['filters']=_[_0xef8c('0x2c')](_0x202710[_0xef8c('0x29')],_0x202710['query']);_0x290a8c[_0xef8c('0x2d')]=_[_0xef8c('0x2c')](_0x202710[_0xef8c('0x29')],qs[_0xef8c('0x2e')](_0x81ec7d['query'][_0xef8c('0x2e')]));_0x290a8c[_0xef8c('0x2d')]=_0x290a8c[_0xef8c('0x2d')]['length']?_0x290a8c[_0xef8c('0x2d')]:_0x202710['model'];if(_0x81ec7d[_0xef8c('0x2a')][_0xef8c('0x39')]){_0x290a8c['include']=[{'all':!![]}];}_0x290a8c=_[_0xef8c('0x36')]({},_0x290a8c,_0x81ec7d['options']);return db['ChatGroup'][_0xef8c('0x43')](_0x290a8c)[_0xef8c('0x23')](handleEntityNotFound(_0x138a20,null))[_0xef8c('0x23')](respondWithResult(_0x138a20,null))['catch'](handleError(_0x138a20,null));};exports[_0xef8c('0x44')]=function(_0x15699c,_0x18b1c5){return db[_0xef8c('0x40')][_0xef8c('0x44')](_0x15699c[_0xef8c('0x45')],{})[_0xef8c('0x23')](respondWithResult(_0x18b1c5,0xc9))[_0xef8c('0x3d')](handleError(_0x18b1c5,null));};exports[_0xef8c('0x22')]=function(_0x452ae3,_0x3f3fe9){if(_0x452ae3[_0xef8c('0x45')]['id']){delete _0x452ae3[_0xef8c('0x45')]['id'];}return db[_0xef8c('0x40')][_0xef8c('0x43')]({'where':{'id':_0x452ae3['params']['id']}})['then'](handleEntityNotFound(_0x3f3fe9,null))['then'](saveUpdates(_0x452ae3['body'],null))[_0xef8c('0x23')](respondWithResult(_0x3f3fe9,null))['catch'](handleError(_0x3f3fe9,null));};exports['destroy']=function(_0x31bf65,_0x473104){return db['ChatGroup'][_0xef8c('0x43')]({'where':{'id':_0x31bf65[_0xef8c('0x3f')]['id']}})['then'](handleEntityNotFound(_0x473104,null))['then'](removeEntity(_0x473104,null))[_0xef8c('0x3d')](handleError(_0x473104,null));};exports['describe']=function(_0x2ed52c,_0x38dd30){return db[_0xef8c('0x40')]['describe']()['then'](respondWithResult(_0x38dd30,null))[_0xef8c('0x3d')](handleError(_0x38dd30,null));};exports[_0xef8c('0x46')]=function(_0x459291,_0x4a2331,_0x19ed7e){return db[_0xef8c('0x47')][_0xef8c('0x1c')]({'where':{'ChatGroupId':_0x459291[_0xef8c('0x3f')]['id'],'ToId':_0x459291['user']['id'],'read':![]}})[_0xef8c('0x23')](function(_0x1b221a){return{'id':_[_0xef8c('0x48')](_0x459291[_0xef8c('0x3f')]['id']),'count':_0x1b221a};})['then'](respondWithResult(_0x4a2331,null))[_0xef8c('0x3d')](handleError(_0x4a2331,null));};exports['addMembers']=function(_0x554534,_0x32f9c7,_0x5dd0fc){return db['ChatGroup'][_0xef8c('0x43')]({'where':{'id':_0x554534[_0xef8c('0x3f')]['id']}})[_0xef8c('0x23')](handleEntityNotFound(_0x32f9c7,null))['then'](function(_0x393d8b){if(_0x393d8b){return _0x393d8b['addMembers'](_0x554534['body']['ids'],_['omit'](_0x554534[_0xef8c('0x45')],['ids','id'])||{});}})['then'](respondWithResult(_0x32f9c7,null))['catch'](handleError(_0x32f9c7,null));};exports[_0xef8c('0x49')]=function(_0x2137ad,_0x4a56d6,_0x4e3c50){var _0x179b21={};var _0xce07b7={};var _0x44f917;var _0x1a7a19;return db[_0xef8c('0x40')][_0xef8c('0x4a')]({'where':{'id':_0x2137ad[_0xef8c('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4a56d6,null))['then'](function(_0x5af429){if(_0x5af429){_0x44f917=_0x5af429;_0xce07b7['model']=_[_0xef8c('0x42')](db[_0xef8c('0x4b')][_0xef8c('0x41')]);_0xce07b7[_0xef8c('0x2a')]=_[_0xef8c('0x42')](_0x2137ad[_0xef8c('0x2a')]);_0xce07b7[_0xef8c('0x2b')]=_['intersection'](_0xce07b7['model'],_0xce07b7[_0xef8c('0x2a')]);_0x179b21[_0xef8c('0x2d')]=_['intersection'](_0xce07b7[_0xef8c('0x29')],qs['fields'](_0x2137ad[_0xef8c('0x2a')][_0xef8c('0x2e')]));_0x179b21[_0xef8c('0x2d')]=_0x179b21['attributes']['length']?_0x179b21[_0xef8c('0x2d')]:_0xce07b7[_0xef8c('0x29')];_0x179b21[_0xef8c('0x31')]=qs[_0xef8c('0x32')](_0x2137ad[_0xef8c('0x2a')][_0xef8c('0x32')]);_0x179b21[_0xef8c('0x33')]=qs['filters'](_[_0xef8c('0x34')](_0x2137ad[_0xef8c('0x2a')],_0xce07b7[_0xef8c('0x2b')]));if(_0x2137ad[_0xef8c('0x2a')][_0xef8c('0x35')]){_0x179b21[_0xef8c('0x33')]=_[_0xef8c('0x36')](_0x179b21[_0xef8c('0x33')],{'$or':_[_0xef8c('0x28')](_0x179b21[_0xef8c('0x2d')],function(_0x27ef19){var _0x52cfe9={};_0x52cfe9[_0x27ef19]={'$like':'%'+_0x2137ad[_0xef8c('0x2a')][_0xef8c('0x35')]+'%'};return _0x52cfe9;})});}_0x179b21=_[_0xef8c('0x36')]({},_0x179b21,_0x2137ad[_0xef8c('0x4c')]);return _0x44f917[_0xef8c('0x49')](_0x179b21);}})[_0xef8c('0x23')](function(_0x3cb8d8){if(_0x3cb8d8){_0x1a7a19=_0x3cb8d8[_0xef8c('0x4d')];if(!_0x2137ad[_0xef8c('0x2a')][_0xef8c('0x2f')]('nolimit')){_0x179b21[_0xef8c('0x1b')]=qs[_0xef8c('0x1b')](_0x2137ad[_0xef8c('0x2a')][_0xef8c('0x1b')]);_0x179b21[_0xef8c('0x19')]=qs[_0xef8c('0x19')](_0x2137ad[_0xef8c('0x2a')][_0xef8c('0x19')]);}return _0x44f917['getMembers'](_0x179b21);}})[_0xef8c('0x23')](function(_0x47f35b){if(_0x47f35b){return _0x47f35b?{'count':_0x1a7a19,'rows':_0x47f35b}:null;}})[_0xef8c('0x23')](respondWithResult(_0x4a56d6,null))[_0xef8c('0x3d')](handleError(_0x4a56d6,null));};exports[_0xef8c('0x4e')]=function(_0x20cc4e,_0x4ca08a,_0x3ada07){return db[_0xef8c('0x40')][_0xef8c('0x43')]({'where':{'id':_0x20cc4e['params']['id']}})[_0xef8c('0x23')](handleEntityNotFound(_0x4ca08a,null))[_0xef8c('0x23')](function(_0x27ad10){if(_0x27ad10){return _0x27ad10['removeMembers'](_0x20cc4e[_0xef8c('0x2a')][_0xef8c('0x4f')]);}})[_0xef8c('0x23')](respondWithStatusCode(_0x4ca08a,null))[_0xef8c('0x3d')](handleError(_0x4ca08a,null));};exports[_0xef8c('0x50')]=function(_0x4447e3,_0x53df13,_0xc2f61e){if(_0x4447e3['body']['id']){delete _0x4447e3[_0xef8c('0x45')]['id'];}return db['ChatGroup'][_0xef8c('0x43')]({'where':{'id':_0x4447e3['params']['id']}})[_0xef8c('0x23')](handleEntityNotFound(_0x53df13,null))[_0xef8c('0x23')](function(_0x40a083){if(_0x40a083){_0x4447e3[_0xef8c('0x45')][_0xef8c('0x51')]=_0x40a083['id'];return db['ChatInternalMessage'][_0xef8c('0x44')](_0x4447e3['body']);}})[_0xef8c('0x23')](respondWithResult(_0x53df13,null))[_0xef8c('0x3d')](handleError(_0x53df13,null));};exports[_0xef8c('0x52')]=function(_0x66cc2,_0x43ace3,_0x12870b){var _0x19be11={};var _0xc83512={};var _0x4fd9a7;var _0x5045e9;return db[_0xef8c('0x40')]['findOne']({'where':{'id':_0x66cc2[_0xef8c('0x3f')]['id']}})[_0xef8c('0x23')](handleEntityNotFound(_0x43ace3,null))['then'](function(_0x1f4cf3){if(_0x1f4cf3){_0x4fd9a7=_0x1f4cf3;_0xc83512['model']=_[_0xef8c('0x42')](db['ChatInternalMessage'][_0xef8c('0x41')]);_0xc83512[_0xef8c('0x2a')]=_[_0xef8c('0x42')](_0x66cc2[_0xef8c('0x2a')]);_0xc83512[_0xef8c('0x2b')]=_[_0xef8c('0x2c')](_0xc83512[_0xef8c('0x29')],_0xc83512[_0xef8c('0x2a')]);_0x19be11[_0xef8c('0x2d')]=_['intersection'](_0xc83512[_0xef8c('0x29')],qs[_0xef8c('0x2e')](_0x66cc2['query'][_0xef8c('0x2e')]));_0x19be11[_0xef8c('0x2d')]=_0x19be11[_0xef8c('0x2d')][_0xef8c('0x4d')]?_0x19be11[_0xef8c('0x2d')]:_0xc83512['model'];_0x19be11[_0xef8c('0x31')]=qs[_0xef8c('0x32')](_0x66cc2[_0xef8c('0x2a')][_0xef8c('0x32')]);_0x19be11['where']=qs['filters'](_['pick'](_0x66cc2['query'],_0xc83512[_0xef8c('0x2b')]));if(_0x66cc2[_0xef8c('0x2a')][_0xef8c('0x35')]){_0x19be11['where']=_['merge'](_0x19be11[_0xef8c('0x33')],{'$or':_[_0xef8c('0x28')](_0x19be11[_0xef8c('0x2d')],function(_0x2a11f6){var _0x32e96a={};_0x32e96a[_0x2a11f6]={'$like':'%'+_0x66cc2[_0xef8c('0x2a')][_0xef8c('0x35')]+'%'};return _0x32e96a;})});}if(_0x66cc2[_0xef8c('0x2a')][_0xef8c('0x53')]){var _0x324013=_0x66cc2[_0xef8c('0x2a')][_0xef8c('0x53')][_0xef8c('0x54')](',');var _0x201a40={};_0x201a40[_0x324013[0x0]]={'$gte':moment(_0x324013[0x1])[_0xef8c('0x55')](_0xef8c('0x56'))};_0x19be11[_0xef8c('0x33')]=_[_0xef8c('0x36')](_0x19be11[_0xef8c('0x33')],_0x201a40);}_0x19be11=_[_0xef8c('0x36')]({},_0x19be11,_0x66cc2[_0xef8c('0x4c')]);return _0x4fd9a7[_0xef8c('0x52')](_0x19be11);}})[_0xef8c('0x23')](function(_0x3dd41c){if(_0x3dd41c){_0x5045e9=_0x3dd41c['length'];if(!_0x66cc2['query']['hasOwnProperty'](_0xef8c('0x30'))){_0x19be11['limit']=qs[_0xef8c('0x1b')](_0x66cc2[_0xef8c('0x2a')]['limit']);_0x19be11[_0xef8c('0x19')]=qs[_0xef8c('0x19')](_0x66cc2['query']['offset']);}return _0x4fd9a7['getMessages'](_0x19be11);}})[_0xef8c('0x23')](function(_0x1cead1){if(_0x1cead1){return _0x1cead1?{'count':_0x5045e9,'rows':_0x1cead1}:null;}})[_0xef8c('0x23')](respondWithResult(_0x43ace3,null))['catch'](handleError(_0x43ace3,null));};
\ No newline at end of file
+var _0xf5f3=['set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','rawAttributes','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','VIRTUAL','options','where','include','ChatGroup','rows','catch','show','params','find','create','body','describe','ChatInternalMessage','user','omit','ids','getMembers','findOne','pick','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x53378f,_0x454e2d){var _0x46f24d=function(_0x56d707){while(--_0x56d707){_0x53378f['push'](_0x53378f['shift']());}};_0x46f24d(++_0x454e2d);}(_0xf5f3,0x103));var _0x3f5f=function(_0x3144c3,_0x10fad7){_0x3144c3=_0x3144c3-0x0;var _0x48b358=_0xf5f3[_0x3144c3];return _0x48b358;};'use strict';var emlformat=require(_0x3f5f('0x0'));var rimraf=require(_0x3f5f('0x1'));var zipdir=require(_0x3f5f('0x2'));var jsonpatch=require(_0x3f5f('0x3'));var rp=require(_0x3f5f('0x4'));var moment=require(_0x3f5f('0x5'));var BPromise=require(_0x3f5f('0x6'));var Mustache=require(_0x3f5f('0x7'));var util=require('util');var path=require('path');var sox=require(_0x3f5f('0x8'));var csv=require(_0x3f5f('0x9'));var ejs=require(_0x3f5f('0xa'));var fs=require('fs');var fs_extra=require(_0x3f5f('0xb'));var _=require(_0x3f5f('0xc'));var squel=require(_0x3f5f('0xd'));var crypto=require('crypto');var jsforce=require(_0x3f5f('0xe'));var deskjs=require(_0x3f5f('0xf'));var toCsv=require(_0x3f5f('0x9'));var querystring=require(_0x3f5f('0x10'));var Papa=require(_0x3f5f('0x11'));var Redis=require('ioredis');var authService=require(_0x3f5f('0x12'));var qs=require(_0x3f5f('0x13'));var as=require(_0x3f5f('0x14'));var hardwareService=require(_0x3f5f('0x15'));var logger=require(_0x3f5f('0x16'))(_0x3f5f('0x17'));var utils=require(_0x3f5f('0x18'));var config=require(_0x3f5f('0x19'));var licenseUtil=require(_0x3f5f('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x3f5f('0x1b')](config[_0x3f5f('0x1c')],{'host':_0x3f5f('0x1d'),'port':0x18eb});var socket=require(_0x3f5f('0x1e'))(new Redis(config[_0x3f5f('0x1c')]));require(_0x3f5f('0x1f'))[_0x3f5f('0x20')](socket);function respondWithStatusCode(_0x169c4e,_0x3324c6){_0x3324c6=_0x3324c6||0xcc;return function(_0x17c42c){if(_0x17c42c){return _0x169c4e[_0x3f5f('0x21')](_0x3324c6);}return _0x169c4e[_0x3f5f('0x22')](_0x3324c6)[_0x3f5f('0x23')]();};}function respondWithResult(_0x5eb8d9,_0x4cb085){_0x4cb085=_0x4cb085||0xc8;return function(_0x46b95b){if(_0x46b95b){return _0x5eb8d9[_0x3f5f('0x22')](_0x4cb085)[_0x3f5f('0x24')](_0x46b95b);}};}function respondWithFilteredResult(_0x70db4a,_0x230295){return function(_0x3f7de0){if(_0x3f7de0){var _0x5875d8=typeof _0x230295[_0x3f5f('0x25')]===_0x3f5f('0x26')&&typeof _0x230295[_0x3f5f('0x27')]===_0x3f5f('0x26');var _0x4ce717=_0x3f7de0[_0x3f5f('0x28')];var _0x2b538f=_0x5875d8?0x0:_0x230295[_0x3f5f('0x25')];var _0xdc24f8=_0x5875d8?_0x3f7de0[_0x3f5f('0x28')]:_0x230295[_0x3f5f('0x25')]+_0x230295['limit'];var _0x2bc593;if(_0xdc24f8>=_0x4ce717){_0xdc24f8=_0x4ce717;_0x2bc593=0xc8;}else{_0x2bc593=0xce;}_0x70db4a['status'](_0x2bc593);return _0x70db4a[_0x3f5f('0x29')](_0x3f5f('0x2a'),_0x2b538f+'-'+_0xdc24f8+'/'+_0x4ce717)[_0x3f5f('0x24')](_0x3f7de0);}return null;};}function patchUpdates(_0x563477){return function(_0x5d7369){try{jsonpatch[_0x3f5f('0x2b')](_0x5d7369,_0x563477,!![]);}catch(_0x2cabd7){return BPromise[_0x3f5f('0x2c')](_0x2cabd7);}return _0x5d7369[_0x3f5f('0x2d')]();};}function saveUpdates(_0x280d61,_0x4d05d3){return function(_0x9e4b){if(_0x9e4b){return _0x9e4b[_0x3f5f('0x2e')](_0x280d61)[_0x3f5f('0x2f')](function(_0x17caf2){return _0x17caf2;});}return null;};}function removeEntity(_0x31c1b4,_0x23fa45){return function(_0x3f432f){if(_0x3f432f){return _0x3f432f[_0x3f5f('0x30')]()['then'](function(){_0x31c1b4[_0x3f5f('0x22')](0xcc)[_0x3f5f('0x23')]();});}};}function handleEntityNotFound(_0x6d4c2b,_0x1d20dd){return function(_0x27931d){if(!_0x27931d){_0x6d4c2b[_0x3f5f('0x21')](0x194);}return _0x27931d;};}function handleError(_0x3183e5,_0x406f7a){_0x406f7a=_0x406f7a||0x1f4;return function(_0x3f9323){logger[_0x3f5f('0x31')](_0x3f9323[_0x3f5f('0x32')]);if(_0x3f9323['name']){delete _0x3f9323['name'];}_0x3183e5[_0x3f5f('0x22')](_0x406f7a)[_0x3f5f('0x33')](_0x3f9323);};}exports[_0x3f5f('0x34')]=function(_0x2bcebc,_0x183254){var _0x126222={},_0x1bc230={},_0x17b93e={'count':0x0,'rows':[]};var _0x1b3e76=_['map'](db['ChatGroup'][_0x3f5f('0x35')],function(_0x239add){return{'name':_0x239add['fieldName'],'type':_0x239add[_0x3f5f('0x36')][_0x3f5f('0x37')]};});_0x1bc230[_0x3f5f('0x38')]=_[_0x3f5f('0x39')](_0x1b3e76,_0x3f5f('0x3a'));_0x1bc230[_0x3f5f('0x3b')]=_[_0x3f5f('0x3c')](_0x2bcebc[_0x3f5f('0x3b')]);_0x1bc230[_0x3f5f('0x3d')]=_[_0x3f5f('0x3e')](_0x1bc230[_0x3f5f('0x38')],_0x1bc230[_0x3f5f('0x3b')]);_0x126222[_0x3f5f('0x3f')]=_[_0x3f5f('0x3e')](_0x1bc230['model'],qs[_0x3f5f('0x40')](_0x2bcebc[_0x3f5f('0x3b')]['fields']));_0x126222[_0x3f5f('0x3f')]=_0x126222[_0x3f5f('0x3f')][_0x3f5f('0x41')]?_0x126222[_0x3f5f('0x3f')]:_0x1bc230['model'];if(!_0x2bcebc[_0x3f5f('0x3b')][_0x3f5f('0x42')](_0x3f5f('0x43'))){_0x126222[_0x3f5f('0x27')]=qs[_0x3f5f('0x27')](_0x2bcebc[_0x3f5f('0x3b')][_0x3f5f('0x27')]);_0x126222[_0x3f5f('0x25')]=qs['offset'](_0x2bcebc[_0x3f5f('0x3b')][_0x3f5f('0x25')]);}_0x126222[_0x3f5f('0x44')]=qs[_0x3f5f('0x45')](_0x2bcebc[_0x3f5f('0x3b')][_0x3f5f('0x45')]);_0x126222['where']=qs['filters'](_['pick'](_0x2bcebc['query'],_0x1bc230[_0x3f5f('0x3d')]),_0x1b3e76);if(_0x2bcebc[_0x3f5f('0x3b')][_0x3f5f('0x46')]){_0x126222['where']=_[_0x3f5f('0x47')](_0x126222['where'],{'$or':_[_0x3f5f('0x39')](_0x1b3e76,function(_0x113cb6){if(_0x113cb6[_0x3f5f('0x36')]!==_0x3f5f('0x48')){var _0x516f70={};_0x516f70[_0x113cb6[_0x3f5f('0x3a')]]={'$like':'%'+_0x2bcebc[_0x3f5f('0x3b')]['filter']+'%'};return _0x516f70;}})});}_0x126222=_[_0x3f5f('0x47')]({},_0x126222,_0x2bcebc[_0x3f5f('0x49')]);var _0x1010a6={'where':_0x126222[_0x3f5f('0x4a')]};return db['ChatGroup'][_0x3f5f('0x28')](_0x1010a6)[_0x3f5f('0x2f')](function(_0xa5f550){_0x17b93e['count']=_0xa5f550;if(_0x2bcebc['query']['includeAll']){_0x126222[_0x3f5f('0x4b')]=[{'all':!![]}];}return db[_0x3f5f('0x4c')]['findAll'](_0x126222);})[_0x3f5f('0x2f')](function(_0xd1aaf3){_0x17b93e[_0x3f5f('0x4d')]=_0xd1aaf3;return _0x17b93e;})[_0x3f5f('0x2f')](respondWithFilteredResult(_0x183254,_0x126222))[_0x3f5f('0x4e')](handleError(_0x183254,null));};exports[_0x3f5f('0x4f')]=function(_0x1c2355,_0x34cab6){var _0x5ad731={'raw':!![],'where':{'id':_0x1c2355[_0x3f5f('0x50')]['id']}},_0x18d187={};_0x18d187[_0x3f5f('0x38')]=_[_0x3f5f('0x3c')](db[_0x3f5f('0x4c')][_0x3f5f('0x35')]);_0x18d187[_0x3f5f('0x3b')]=_[_0x3f5f('0x3c')](_0x1c2355[_0x3f5f('0x3b')]);_0x18d187[_0x3f5f('0x3d')]=_[_0x3f5f('0x3e')](_0x18d187[_0x3f5f('0x38')],_0x18d187[_0x3f5f('0x3b')]);_0x5ad731[_0x3f5f('0x3f')]=_[_0x3f5f('0x3e')](_0x18d187[_0x3f5f('0x38')],qs[_0x3f5f('0x40')](_0x1c2355['query'][_0x3f5f('0x40')]));_0x5ad731[_0x3f5f('0x3f')]=_0x5ad731[_0x3f5f('0x3f')][_0x3f5f('0x41')]?_0x5ad731[_0x3f5f('0x3f')]:_0x18d187[_0x3f5f('0x38')];if(_0x1c2355[_0x3f5f('0x3b')]['includeAll']){_0x5ad731[_0x3f5f('0x4b')]=[{'all':!![]}];}_0x5ad731=_[_0x3f5f('0x47')]({},_0x5ad731,_0x1c2355['options']);return db[_0x3f5f('0x4c')][_0x3f5f('0x51')](_0x5ad731)[_0x3f5f('0x2f')](handleEntityNotFound(_0x34cab6,null))[_0x3f5f('0x2f')](respondWithResult(_0x34cab6,null))[_0x3f5f('0x4e')](handleError(_0x34cab6,null));};exports[_0x3f5f('0x52')]=function(_0x1d207f,_0x372958){return db[_0x3f5f('0x4c')][_0x3f5f('0x52')](_0x1d207f[_0x3f5f('0x53')],{})['then'](respondWithResult(_0x372958,0xc9))['catch'](handleError(_0x372958,null));};exports[_0x3f5f('0x2e')]=function(_0x51b04d,_0x3549a4){if(_0x51b04d[_0x3f5f('0x53')]['id']){delete _0x51b04d[_0x3f5f('0x53')]['id'];}return db[_0x3f5f('0x4c')]['find']({'where':{'id':_0x51b04d['params']['id']}})[_0x3f5f('0x2f')](handleEntityNotFound(_0x3549a4,null))['then'](saveUpdates(_0x51b04d['body'],null))[_0x3f5f('0x2f')](respondWithResult(_0x3549a4,null))['catch'](handleError(_0x3549a4,null));};exports[_0x3f5f('0x30')]=function(_0x7a3ba6,_0x91dc9e){return db[_0x3f5f('0x4c')]['find']({'where':{'id':_0x7a3ba6[_0x3f5f('0x50')]['id']}})[_0x3f5f('0x2f')](handleEntityNotFound(_0x91dc9e,null))[_0x3f5f('0x2f')](removeEntity(_0x91dc9e,null))[_0x3f5f('0x4e')](handleError(_0x91dc9e,null));};exports[_0x3f5f('0x54')]=function(_0x10a848,_0x2a075a){return db[_0x3f5f('0x4c')][_0x3f5f('0x54')]()['then'](respondWithResult(_0x2a075a,null))[_0x3f5f('0x4e')](handleError(_0x2a075a,null));};exports['getUnread']=function(_0x53fcb6,_0x43f71d,_0x1afe3d){return db[_0x3f5f('0x55')]['count']({'where':{'ChatGroupId':_0x53fcb6[_0x3f5f('0x50')]['id'],'ToId':_0x53fcb6[_0x3f5f('0x56')]['id'],'read':![]}})[_0x3f5f('0x2f')](function(_0x1f82c1){return{'id':_['toInteger'](_0x53fcb6[_0x3f5f('0x50')]['id']),'count':_0x1f82c1};})[_0x3f5f('0x2f')](respondWithResult(_0x43f71d,null))['catch'](handleError(_0x43f71d,null));};exports['addMembers']=function(_0xdabfa7,_0x43a505,_0x542d7b){return db[_0x3f5f('0x4c')][_0x3f5f('0x51')]({'where':{'id':_0xdabfa7[_0x3f5f('0x50')]['id']}})[_0x3f5f('0x2f')](handleEntityNotFound(_0x43a505,null))[_0x3f5f('0x2f')](function(_0x11e42e){if(_0x11e42e){return _0x11e42e['addMembers'](_0xdabfa7['body']['ids'],_[_0x3f5f('0x57')](_0xdabfa7[_0x3f5f('0x53')],[_0x3f5f('0x58'),'id'])||{});}})[_0x3f5f('0x2f')](respondWithResult(_0x43a505,null))[_0x3f5f('0x4e')](handleError(_0x43a505,null));};exports[_0x3f5f('0x59')]=function(_0x1c0633,_0x16eb7d,_0x460ae1){var _0x549b13={};var _0x59b43d={};var _0x343acb;var _0x502416;return db[_0x3f5f('0x4c')][_0x3f5f('0x5a')]({'where':{'id':_0x1c0633[_0x3f5f('0x50')]['id']}})[_0x3f5f('0x2f')](handleEntityNotFound(_0x16eb7d,null))[_0x3f5f('0x2f')](function(_0x1fb4bc){if(_0x1fb4bc){_0x343acb=_0x1fb4bc;_0x59b43d[_0x3f5f('0x38')]=_[_0x3f5f('0x3c')](db['User'][_0x3f5f('0x35')]);_0x59b43d[_0x3f5f('0x3b')]=_[_0x3f5f('0x3c')](_0x1c0633['query']);_0x59b43d[_0x3f5f('0x3d')]=_['intersection'](_0x59b43d['model'],_0x59b43d[_0x3f5f('0x3b')]);_0x549b13[_0x3f5f('0x3f')]=_['intersection'](_0x59b43d[_0x3f5f('0x38')],qs[_0x3f5f('0x40')](_0x1c0633[_0x3f5f('0x3b')][_0x3f5f('0x40')]));_0x549b13[_0x3f5f('0x3f')]=_0x549b13['attributes'][_0x3f5f('0x41')]?_0x549b13[_0x3f5f('0x3f')]:_0x59b43d[_0x3f5f('0x38')];_0x549b13['order']=qs[_0x3f5f('0x45')](_0x1c0633['query']['sort']);_0x549b13['where']=qs[_0x3f5f('0x3d')](_[_0x3f5f('0x5b')](_0x1c0633['query'],_0x59b43d[_0x3f5f('0x3d')]));if(_0x1c0633[_0x3f5f('0x3b')][_0x3f5f('0x46')]){_0x549b13[_0x3f5f('0x4a')]=_[_0x3f5f('0x47')](_0x549b13['where'],{'$or':_[_0x3f5f('0x39')](_0x549b13[_0x3f5f('0x3f')],function(_0x410c80){var _0x3bd391={};_0x3bd391[_0x410c80]={'$like':'%'+_0x1c0633[_0x3f5f('0x3b')][_0x3f5f('0x46')]+'%'};return _0x3bd391;})});}_0x549b13=_['merge']({},_0x549b13,_0x1c0633['options']);return _0x343acb[_0x3f5f('0x59')](_0x549b13);}})[_0x3f5f('0x2f')](function(_0x131b23){if(_0x131b23){_0x502416=_0x131b23[_0x3f5f('0x41')];if(!_0x1c0633[_0x3f5f('0x3b')]['hasOwnProperty'](_0x3f5f('0x43'))){_0x549b13[_0x3f5f('0x27')]=qs[_0x3f5f('0x27')](_0x1c0633[_0x3f5f('0x3b')][_0x3f5f('0x27')]);_0x549b13[_0x3f5f('0x25')]=qs['offset'](_0x1c0633[_0x3f5f('0x3b')]['offset']);}return _0x343acb[_0x3f5f('0x59')](_0x549b13);}})[_0x3f5f('0x2f')](function(_0x353cf8){if(_0x353cf8){return _0x353cf8?{'count':_0x502416,'rows':_0x353cf8}:null;}})[_0x3f5f('0x2f')](respondWithResult(_0x16eb7d,null))['catch'](handleError(_0x16eb7d,null));};exports[_0x3f5f('0x5c')]=function(_0x21e696,_0x330bc2,_0x36952d){return db[_0x3f5f('0x4c')][_0x3f5f('0x51')]({'where':{'id':_0x21e696[_0x3f5f('0x50')]['id']}})[_0x3f5f('0x2f')](handleEntityNotFound(_0x330bc2,null))[_0x3f5f('0x2f')](function(_0x358f16){if(_0x358f16){return _0x358f16[_0x3f5f('0x5c')](_0x21e696['query'][_0x3f5f('0x58')]);}})[_0x3f5f('0x2f')](respondWithStatusCode(_0x330bc2,null))[_0x3f5f('0x4e')](handleError(_0x330bc2,null));};exports[_0x3f5f('0x5d')]=function(_0x56319f,_0x20d648,_0x448b4d){if(_0x56319f[_0x3f5f('0x53')]['id']){delete _0x56319f[_0x3f5f('0x53')]['id'];}return db['ChatGroup'][_0x3f5f('0x51')]({'where':{'id':_0x56319f[_0x3f5f('0x50')]['id']}})[_0x3f5f('0x2f')](handleEntityNotFound(_0x20d648,null))['then'](function(_0x5792c9){if(_0x5792c9){_0x56319f[_0x3f5f('0x53')][_0x3f5f('0x5e')]=_0x5792c9['id'];return db[_0x3f5f('0x55')]['create'](_0x56319f[_0x3f5f('0x53')]);}})[_0x3f5f('0x2f')](respondWithResult(_0x20d648,null))['catch'](handleError(_0x20d648,null));};exports[_0x3f5f('0x5f')]=function(_0x276e2e,_0x4a290c,_0x55b193){var _0x5bcc41={};var _0x5267d7={};var _0x50af4a;var _0xee38a3;return db[_0x3f5f('0x4c')][_0x3f5f('0x5a')]({'where':{'id':_0x276e2e['params']['id']}})['then'](handleEntityNotFound(_0x4a290c,null))[_0x3f5f('0x2f')](function(_0x27823a){if(_0x27823a){_0x50af4a=_0x27823a;_0x5267d7[_0x3f5f('0x38')]=_[_0x3f5f('0x3c')](db[_0x3f5f('0x55')][_0x3f5f('0x35')]);_0x5267d7[_0x3f5f('0x3b')]=_[_0x3f5f('0x3c')](_0x276e2e[_0x3f5f('0x3b')]);_0x5267d7[_0x3f5f('0x3d')]=_[_0x3f5f('0x3e')](_0x5267d7[_0x3f5f('0x38')],_0x5267d7['query']);_0x5bcc41[_0x3f5f('0x3f')]=_[_0x3f5f('0x3e')](_0x5267d7[_0x3f5f('0x38')],qs[_0x3f5f('0x40')](_0x276e2e[_0x3f5f('0x3b')][_0x3f5f('0x40')]));_0x5bcc41['attributes']=_0x5bcc41[_0x3f5f('0x3f')][_0x3f5f('0x41')]?_0x5bcc41[_0x3f5f('0x3f')]:_0x5267d7[_0x3f5f('0x38')];_0x5bcc41[_0x3f5f('0x44')]=qs[_0x3f5f('0x45')](_0x276e2e[_0x3f5f('0x3b')]['sort']);_0x5bcc41[_0x3f5f('0x4a')]=qs[_0x3f5f('0x3d')](_[_0x3f5f('0x5b')](_0x276e2e['query'],_0x5267d7['filters']));if(_0x276e2e['query'][_0x3f5f('0x46')]){_0x5bcc41[_0x3f5f('0x4a')]=_['merge'](_0x5bcc41[_0x3f5f('0x4a')],{'$or':_[_0x3f5f('0x39')](_0x5bcc41['attributes'],function(_0x544c07){var _0x30db18={};_0x30db18[_0x544c07]={'$like':'%'+_0x276e2e['query'][_0x3f5f('0x46')]+'%'};return _0x30db18;})});}if(_0x276e2e['query'][_0x3f5f('0x60')]){var _0x24e0d9=_0x276e2e[_0x3f5f('0x3b')]['$gte'][_0x3f5f('0x61')](',');var _0x5dca77={};_0x5dca77[_0x24e0d9[0x0]]={'$gte':moment(_0x24e0d9[0x1])[_0x3f5f('0x62')](_0x3f5f('0x63'))};_0x5bcc41[_0x3f5f('0x4a')]=_[_0x3f5f('0x47')](_0x5bcc41[_0x3f5f('0x4a')],_0x5dca77);}_0x5bcc41=_['merge']({},_0x5bcc41,_0x276e2e[_0x3f5f('0x49')]);return _0x50af4a['getMessages'](_0x5bcc41);}})[_0x3f5f('0x2f')](function(_0x4882c1){if(_0x4882c1){_0xee38a3=_0x4882c1[_0x3f5f('0x41')];if(!_0x276e2e[_0x3f5f('0x3b')][_0x3f5f('0x42')](_0x3f5f('0x43'))){_0x5bcc41['limit']=qs[_0x3f5f('0x27')](_0x276e2e[_0x3f5f('0x3b')]['limit']);_0x5bcc41[_0x3f5f('0x25')]=qs['offset'](_0x276e2e[_0x3f5f('0x3b')]['offset']);}return _0x50af4a[_0x3f5f('0x5f')](_0x5bcc41);}})[_0x3f5f('0x2f')](function(_0x15b51d){if(_0x15b51d){return _0x15b51d?{'count':_0xee38a3,'rows':_0x15b51d}:null;}})[_0x3f5f('0x2f')](respondWithResult(_0x4a290c,null))[_0x3f5f('0x4e')](handleError(_0x4a290c,null));};
\ No newline at end of file
index 5adca32..1da8274 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35a5=['save','update','emit','exports','setMaxListeners'];(function(_0x12a37e,_0x83815f){var _0x244a0f=function(_0xa251d1){while(--_0xa251d1){_0x12a37e['push'](_0x12a37e['shift']());}};_0x244a0f(++_0x83815f);}(_0x35a5,0x1b7));var _0x535a=function(_0x971a7d,_0x1d8235){_0x971a7d=_0x971a7d-0x0;var _0xc7b4a3=_0x35a5[_0x971a7d];return _0xc7b4a3;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x535a('0x0')](0x0);var events={'afterCreate':_0x535a('0x1'),'afterUpdate':_0x535a('0x2'),'afterDestroy':'remove'};function emitEvent(_0x3b1c34){return function(_0x5bb039,_0x955000,_0x3b0cbd){ChatGroupEvents[_0x535a('0x3')](_0x3b1c34+':'+_0x5bb039['id'],_0x5bb039);ChatGroupEvents['emit'](_0x3b1c34,_0x5bb039);_0x3b0cbd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x535a('0x4')]=ChatGroupEvents;
\ No newline at end of file
+var _0xb89c=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','update','remove'];(function(_0xf1603b,_0x257c11){var _0x298fab=function(_0x5a96fd){while(--_0x5a96fd){_0xf1603b['push'](_0xf1603b['shift']());}};_0x298fab(++_0x257c11);}(_0xb89c,0x198));var _0xcb89=function(_0x175d5b,_0xed7d1a){_0x175d5b=_0x175d5b-0x0;var _0x8ace7e=_0xb89c[_0x175d5b];return _0x8ace7e;};'use strict';var EventEmitter=require(_0xcb89('0x0'));var ChatGroup=require(_0xcb89('0x1'))['db'][_0xcb89('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xcb89('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcb89('0x4'),'afterDestroy':_0xcb89('0x5')};function emitEvent(_0x57c08c){return function(_0x387b27,_0x777f33,_0x49bdbe){ChatGroupEvents['emit'](_0x57c08c+':'+_0x387b27['id'],_0x387b27);ChatGroupEvents['emit'](_0x57c08c,_0x387b27);_0x49bdbe(null);};}for(var e in events){if(events[_0xcb89('0x6')](e)){var event=events[e];ChatGroup[_0xcb89('0x7')](e,emitEvent(event));}}module[_0xcb89('0x8')]=ChatGroupEvents;
\ No newline at end of file
index 41950ac..9ff1622 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['path','rimraf','../../config/environment','exports','define','ChatGroup','chat_groups','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4996a7,_0x41b1c5){var _0x5b0895=function(_0x46e7a6){while(--_0x46e7a6){_0x4996a7['push'](_0x4996a7['shift']());}};_0x5b0895(++_0x41b1c5);}(_0xbaf0,0x1e8));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x0baf('0x0'));var util=require('util');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(_0x0baf('0x6'));var rimraf=require(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var attributes=require('./chatGroup.attributes');module[_0x0baf('0x9')]=function(_0x5eb85c,_0x4eb914){return _0x5eb85c[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9a1=['define','ChatGroup','chat_groups','util','api','moment','bluebird','request-promise','path','../../config/environment','./chatGroup.attributes','exports'];(function(_0x39658b,_0xf72a7f){var _0xa37442=function(_0x2edfaf){while(--_0x2edfaf){_0x39658b['push'](_0x39658b['shift']());}};_0xa37442(++_0xf72a7f);}(_0xa9a1,0xcf));var _0x1a9a=function(_0xada965,_0x1a2235){_0xada965=_0xada965-0x0;var _0x59ef3a=_0xa9a1[_0xada965];return _0x59ef3a;};'use strict';var _=require('lodash');var util=require(_0x1a9a('0x0'));var logger=require('../../config/logger')(_0x1a9a('0x1'));var moment=require(_0x1a9a('0x2'));var BPromise=require(_0x1a9a('0x3'));var rp=require(_0x1a9a('0x4'));var fs=require('fs');var path=require(_0x1a9a('0x5'));var rimraf=require('rimraf');var config=require(_0x1a9a('0x6'));var attributes=require(_0x1a9a('0x7'));module[_0x1a9a('0x8')]=function(_0x2bca53,_0x2cc3e9){return _0x2bca53[_0x1a9a('0x9')](_0x1a9a('0xa'),attributes,{'tableName':_0x1a9a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 398ffa5..2c36939 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff96=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','localhost','socket.io-emitter','redis','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0xff96,0x179));var _0x6ff9=function(_0x383dbb,_0x17d41b){_0x383dbb=_0x383dbb-0x0;var _0x6e8bde=_0xff96[_0x383dbb];return _0x6e8bde;};'use strict';var _=require(_0x6ff9('0x0'));var util=require(_0x6ff9('0x1'));var moment=require(_0x6ff9('0x2'));var BPromise=require(_0x6ff9('0x3'));var rs=require(_0x6ff9('0x4'));var fs=require('fs');var Redis=require(_0x6ff9('0x5'));var db=require(_0x6ff9('0x6'))['db'];var utils=require(_0x6ff9('0x7'));var logger=require(_0x6ff9('0x8'))(_0x6ff9('0x9'));var config=require(_0x6ff9('0xa'));var jayson=require(_0x6ff9('0xb'));var client=jayson['client'][_0x6ff9('0xc')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x6ff9('0xd'),'port':0x18eb});var socket=require(_0x6ff9('0xe'))(new Redis(config[_0x6ff9('0xf')]));require(_0x6ff9('0x10'))[_0x6ff9('0x11')](socket);function respondWithRpcPromise(_0x40d18c,_0x5e81cd,_0x27aab4){return new BPromise(function(_0x1e8a6d,_0x2cbf11){return client[_0x6ff9('0x12')](_0x40d18c,_0x27aab4)[_0x6ff9('0x13')](function(_0x153757){logger[_0x6ff9('0x14')](_0x6ff9('0x15'),_0x5e81cd,_0x6ff9('0x16'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x5e81cd,_0x6ff9('0x16'),JSON['stringify'](_0x153757));if(_0x153757[_0x6ff9('0x17')]){if(_0x153757[_0x6ff9('0x17')][_0x6ff9('0x18')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x5e81cd,_0x153757[_0x6ff9('0x17')][_0x6ff9('0x19')]);return _0x2cbf11(_0x153757[_0x6ff9('0x17')][_0x6ff9('0x19')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x5e81cd,_0x153757[_0x6ff9('0x17')][_0x6ff9('0x19')]);return _0x1e8a6d(_0x153757[_0x6ff9('0x17')][_0x6ff9('0x19')]);}else{logger[_0x6ff9('0x14')]('ChatGroup,\x20%s,\x20%s',_0x5e81cd,_0x6ff9('0x16'));_0x1e8a6d(_0x153757[_0x6ff9('0x1a')][_0x6ff9('0x19')]);}})['catch'](function(_0x48269e){logger['error'](_0x6ff9('0x15'),_0x5e81cd,_0x48269e);_0x2cbf11(_0x48269e);});});}
\ No newline at end of file
+var _0xdb13=['request\x20sent','stringify','error','message','ChatGroup,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s'];(function(_0x185629,_0x31ee6e){var _0x409e70=function(_0x5a4224){while(--_0x5a4224){_0x185629['push'](_0x185629['shift']());}};_0x409e70(++_0x31ee6e);}(_0xdb13,0x10c));var _0x3db1=function(_0x2adccd,_0x3d9c38){_0x2adccd=_0x2adccd-0x0;var _0x2fa4ee=_0xdb13[_0x2adccd];return _0x2fa4ee;};'use strict';var _=require('lodash');var util=require(_0x3db1('0x0'));var moment=require(_0x3db1('0x1'));var BPromise=require(_0x3db1('0x2'));var rs=require(_0x3db1('0x3'));var fs=require('fs');var Redis=require(_0x3db1('0x4'));var db=require(_0x3db1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3db1('0x6'))(_0x3db1('0x7'));var config=require(_0x3db1('0x8'));var jayson=require(_0x3db1('0x9'));var client=jayson[_0x3db1('0xa')]['http']({'port':0x232a});config[_0x3db1('0xb')]=_[_0x3db1('0xc')](config[_0x3db1('0xb')],{'host':_0x3db1('0xd'),'port':0x18eb});var socket=require(_0x3db1('0xe'))(new Redis(config[_0x3db1('0xb')]));require(_0x3db1('0xf'))[_0x3db1('0x10')](socket);function respondWithRpcPromise(_0x2261bb,_0xe67f4b,_0x46f340){return new BPromise(function(_0xfd358f,_0x51d421){return client[_0x3db1('0x11')](_0x2261bb,_0x46f340)[_0x3db1('0x12')](function(_0x2bab87){logger[_0x3db1('0x13')]('ChatGroup,\x20%s,\x20%s',_0xe67f4b,'request\x20sent');logger[_0x3db1('0x14')](_0x3db1('0x15'),_0xe67f4b,_0x3db1('0x16'),JSON[_0x3db1('0x17')](_0x2bab87));if(_0x2bab87[_0x3db1('0x18')]){if(_0x2bab87['error']['code']===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0xe67f4b,_0x2bab87[_0x3db1('0x18')][_0x3db1('0x19')]);return _0x51d421(_0x2bab87[_0x3db1('0x18')][_0x3db1('0x19')]);}logger[_0x3db1('0x18')](_0x3db1('0x1a'),_0xe67f4b,_0x2bab87['error'][_0x3db1('0x19')]);return _0xfd358f(_0x2bab87[_0x3db1('0x18')]['message']);}else{logger[_0x3db1('0x13')](_0x3db1('0x1a'),_0xe67f4b,'request\x20sent');_0xfd358f(_0x2bab87[_0x3db1('0x1b')]['message']);}})[_0x3db1('0x1c')](function(_0x475208){logger[_0x3db1('0x18')](_0x3db1('0x1a'),_0xe67f4b,_0x475208);_0x51d421(_0x475208);});});}
\ No newline at end of file
index 5a17f92..4eff647 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6d9=['update','emit','register','length','save','remove'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc6d9,0xd0));var _0x9c6d=function(_0x946cc6,_0x18f910){_0x946cc6=_0x946cc6-0x0;var _0x2a72e7=_0xc6d9[_0x946cc6];return _0x2a72e7;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x9c6d('0x0'),_0x9c6d('0x1'),_0x9c6d('0x2')];function createListener(_0x1345d5,_0x1207c8){return function(_0x5eee3c){_0x1207c8[_0x9c6d('0x3')](_0x1345d5,_0x5eee3c);};}function removeListener(_0x169d64,_0x38ac2a){return function(){ChatGroupEvents['removeListener'](_0x169d64,_0x38ac2a);};}exports[_0x9c6d('0x4')]=function(_0x3426cd){for(var _0x330796=0x0,_0x1e952c=events[_0x9c6d('0x5')];_0x330796<_0x1e952c;_0x330796++){var _0x2c1e06=events[_0x330796];var _0x11d56c=createListener('chatGroup:'+_0x2c1e06,_0x3426cd);ChatGroupEvents['on'](_0x2c1e06,_0x11d56c);}};
\ No newline at end of file
+var _0x32cb=['update','removeListener','register','length','./chatGroup.events','save','remove'];(function(_0xaa620e,_0x645b8e){var _0x380150=function(_0x1f5029){while(--_0x1f5029){_0xaa620e['push'](_0xaa620e['shift']());}};_0x380150(++_0x645b8e);}(_0x32cb,0x177));var _0xb32c=function(_0x482cf5,_0x2bb93a){_0x482cf5=_0x482cf5-0x0;var _0xf06074=_0x32cb[_0x482cf5];return _0xf06074;};'use strict';var ChatGroupEvents=require(_0xb32c('0x0'));var events=[_0xb32c('0x1'),_0xb32c('0x2'),_0xb32c('0x3')];function createListener(_0x306515,_0x52d671){return function(_0x1237b2){_0x52d671['emit'](_0x306515,_0x1237b2);};}function removeListener(_0xf934c8,_0x5788cf){return function(){ChatGroupEvents[_0xb32c('0x4')](_0xf934c8,_0x5788cf);};}exports[_0xb32c('0x5')]=function(_0x53cd15){for(var _0xcb4e65=0x0,_0x509ef2=events[_0xb32c('0x6')];_0xcb4e65<_0x509ef2;_0xcb4e65++){var _0x4a8af0=events[_0xcb4e65];var _0x2f04cf=createListener('chatGroup:'+_0x4a8af0,_0x53cd15);ChatGroupEvents['on'](_0x4a8af0,_0x2f04cf);}};
\ No newline at end of file
index 5507858..4b70efc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47d6=['post','create','addMessage','put','update','delete','destroy','removeMembers','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/unread','/:id/members','getMembers','getMessages'];(function(_0x29d762,_0x2fe851){var _0x2b1c63=function(_0xc55c15){while(--_0xc55c15){_0x29d762['push'](_0x29d762['shift']());}};_0x2b1c63(++_0x2fe851);}(_0x47d6,0xd4));var _0x647d=function(_0x1fb01e,_0x2dbcc9){_0x1fb01e=_0x1fb01e-0x0;var _0x1a88d2=_0x47d6[_0x1fb01e];return _0x1a88d2;};'use strict';var multer=require(_0x647d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x647d('0x1'));var express=require(_0x647d('0x2'));var router=express[_0x647d('0x3')]();var fs_extra=require(_0x647d('0x4'));var auth=require(_0x647d('0x5'));var interaction=require(_0x647d('0x6'));var config=require(_0x647d('0x7'));var controller=require(_0x647d('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x647d('0x9')]);router[_0x647d('0xa')](_0x647d('0xb'),auth[_0x647d('0xc')](),controller[_0x647d('0xd')]);router['get'](_0x647d('0xe'),auth[_0x647d('0xc')](),controller[_0x647d('0xf')]);router[_0x647d('0xa')](_0x647d('0x10'),auth['isAuthenticated'](),controller['getUnread']);router[_0x647d('0xa')](_0x647d('0x11'),auth[_0x647d('0xc')](),controller[_0x647d('0x12')]);router[_0x647d('0xa')]('/:id/messages',auth[_0x647d('0xc')](),controller[_0x647d('0x13')]);router[_0x647d('0x14')]('/',auth[_0x647d('0xc')](),controller[_0x647d('0x15')]);router['post'](_0x647d('0x11'),auth[_0x647d('0xc')](),controller['addMembers']);router[_0x647d('0x14')]('/:id/messages',auth[_0x647d('0xc')](),controller[_0x647d('0x16')]);router[_0x647d('0x17')](_0x647d('0xe'),auth['isAuthenticated'](),controller[_0x647d('0x18')]);router[_0x647d('0x19')](_0x647d('0xe'),auth[_0x647d('0xc')](),controller[_0x647d('0x1a')]);router[_0x647d('0x19')](_0x647d('0x11'),auth[_0x647d('0xc')](),controller[_0x647d('0x1b')]);module[_0x647d('0x1c')]=router;
\ No newline at end of file
+var _0xee96=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','getUnread','getMembers','/:id/messages','getMessages','post','create','/:id/members','addMembers','addMessage','update','delete','destroy','removeMembers','multer','express'];(function(_0x5c69fb,_0x3fb8d4){var _0xf252f8=function(_0x3a85c4){while(--_0x3a85c4){_0x5c69fb['push'](_0x5c69fb['shift']());}};_0xf252f8(++_0x3fb8d4);}(_0xee96,0x66));var _0x6ee9=function(_0x1753aa,_0x3432c4){_0x1753aa=_0x1753aa-0x0;var _0x394463=_0xee96[_0x1753aa];return _0x394463;};'use strict';var multer=require(_0x6ee9('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6ee9('0x1'));var router=express[_0x6ee9('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6ee9('0x3'));var interaction=require(_0x6ee9('0x4'));var config=require(_0x6ee9('0x5'));var controller=require('./chatGroup.controller');router['get']('/',auth[_0x6ee9('0x6')](),controller[_0x6ee9('0x7')]);router[_0x6ee9('0x8')](_0x6ee9('0x9'),auth['isAuthenticated'](),controller[_0x6ee9('0xa')]);router[_0x6ee9('0x8')](_0x6ee9('0xb'),auth[_0x6ee9('0x6')](),controller[_0x6ee9('0xc')]);router[_0x6ee9('0x8')]('/:id/unread',auth[_0x6ee9('0x6')](),controller[_0x6ee9('0xd')]);router[_0x6ee9('0x8')]('/:id/members',auth['isAuthenticated'](),controller[_0x6ee9('0xe')]);router[_0x6ee9('0x8')](_0x6ee9('0xf'),auth['isAuthenticated'](),controller[_0x6ee9('0x10')]);router[_0x6ee9('0x11')]('/',auth[_0x6ee9('0x6')](),controller[_0x6ee9('0x12')]);router[_0x6ee9('0x11')](_0x6ee9('0x13'),auth[_0x6ee9('0x6')](),controller[_0x6ee9('0x14')]);router['post'](_0x6ee9('0xf'),auth['isAuthenticated'](),controller[_0x6ee9('0x15')]);router['put'](_0x6ee9('0xb'),auth[_0x6ee9('0x6')](),controller[_0x6ee9('0x16')]);router[_0x6ee9('0x17')](_0x6ee9('0xb'),auth[_0x6ee9('0x6')](),controller[_0x6ee9('0x18')]);router[_0x6ee9('0x17')](_0x6ee9('0x13'),auth['isAuthenticated'](),controller[_0x6ee9('0x19')]);module['exports']=router;
\ No newline at end of file
index a963800..d09c4f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9563=['thumb','TEXT','DATE','STRING','long','out','BOOLEAN','sequelize','exports','INTEGER','ENUM','star'];(function(_0x35a4a3,_0x282840){var _0x56c301=function(_0x64677c){while(--_0x64677c){_0x35a4a3['push'](_0x35a4a3['shift']());}};_0x56c301(++_0x282840);}(_0x9563,0x1e7));var _0x3956=function(_0x2a308c,_0x4e64ec){_0x2a308c=_0x2a308c-0x0;var _0x21c60f=_0x9563[_0x2a308c];return _0x21c60f;};'use strict';var Sequelize=require(_0x3956('0x0'));module[_0x3956('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x3956('0x2')]},'ratingType':{'type':Sequelize[_0x3956('0x3')](_0x3956('0x4'),_0x3956('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x3956('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x3956('0x7')]},'disposition':{'type':Sequelize[_0x3956('0x8')]},'secondDisposition':{'type':Sequelize[_0x3956('0x8')]},'thirdDisposition':{'type':Sequelize[_0x3956('0x8')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x3956('0x8')]},'browserVersion':{'type':Sequelize[_0x3956('0x8')]},'osName':{'type':Sequelize[_0x3956('0x8')]},'osVersion':{'type':Sequelize[_0x3956('0x8')]},'deviceModel':{'type':Sequelize[_0x3956('0x8')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x3956('0x6')]},'customerIp':{'type':Sequelize[_0x3956('0x8')]},'formData':{'type':Sequelize[_0x3956('0x6')](_0x3956('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x3956('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x3956('0x3')]('in',_0x3956('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x3956('0x8')]},'customerPort':{'type':Sequelize[_0x3956('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x3956('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x3956('0xb')],'defaultValue':![]}};
\ No newline at end of file
+var _0xfff0=['STRING','long','DATE','ENUM','out','exports','BOOLEAN','INTEGER','star','thumb','TEXT'];(function(_0x157aed,_0x4a9ea9){var _0x4eb49c=function(_0x164ca2){while(--_0x164ca2){_0x157aed['push'](_0x157aed['shift']());}};_0x4eb49c(++_0x4a9ea9);}(_0xfff0,0x139));var _0x0fff=function(_0x228666,_0x9319a1){_0x228666=_0x228666-0x0;var _0x66d005=_0xfff0[_0x228666];return _0x66d005;};'use strict';var Sequelize=require('sequelize');module[_0x0fff('0x0')]={'closed':{'type':Sequelize[_0x0fff('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x0fff('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x0fff('0x3'),_0x0fff('0x4')),'defaultValue':_0x0fff('0x3')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x0fff('0x5')]},'mailTranscript':{'type':Sequelize[_0x0fff('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0fff('0x6')]},'secondDisposition':{'type':Sequelize[_0x0fff('0x6')]},'thirdDisposition':{'type':Sequelize[_0x0fff('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x0fff('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x0fff('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x0fff('0x6')]},'deviceVendor':{'type':Sequelize[_0x0fff('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x0fff('0x5')]},'customerIp':{'type':Sequelize[_0x0fff('0x6')]},'formData':{'type':Sequelize[_0x0fff('0x5')](_0x0fff('0x7'))},'read1stAt':{'type':Sequelize[_0x0fff('0x8')]},'lastMsgAt':{'type':Sequelize[_0x0fff('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x0fff('0x9')]('in',_0x0fff('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x0fff('0x6')]},'customerPort':{'type':Sequelize[_0x0fff('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x0fff('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 3a48779..e66832a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14a0=['t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','toString','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ChatInteractionId','rows','show','params','intersection','includeAll','include','options','create','describe','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','metadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','customUpdate','CmContact','Contact','abandon','closed','disposition','AbandonInteraction','file','originalname','basename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','join','root','server/files/attachments/','offline-chat/','download','server/files/chat/upload/','transcript-%s.txt','now','ChatMessage','Messages','format','agentAlias','System','customer','agentIdentifier','%s%d','agent_alias','alias','agent_fullname','createdAt','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','pick','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','addTags','omit','spread','chatInteractionTags:save','removeTags','files','server','attachments','firstName','lastName','Account','get','Chat','Owner','N.A.','closedAt','osName','referer','customerPort','existsSync','createReadStream','pipe','out','views','transcript-','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','merge','contact','agent','interaction','account','Users','map','fullname','Tags','TagIds','split','forEach','push','ChatInteraction','rawAttributes','type','key','model','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','select','color','tools_tags','field','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','length','getFullTextValue','ContactId','buildExpression','text','start','union','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','some','isEmpty','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','DESC'];(function(_0x24875d,_0x4fb24d){var _0x181471=function(_0x4ecd6d){while(--_0x4ecd6d){_0x24875d['push'](_0x24875d['shift']());}};_0x181471(++_0x4fb24d);}(_0x14a0,0x8e));var _0x014a=function(_0x541399,_0x16175c){_0x541399=_0x541399-0x0;var _0x3f98b9=_0x14a0[_0x541399];return _0x3f98b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x014a('0x0'));var zipdir=require(_0x014a('0x1'));var jsonpatch=require(_0x014a('0x2'));var rp=require(_0x014a('0x3'));var moment=require(_0x014a('0x4'));var BPromise=require(_0x014a('0x5'));var Mustache=require(_0x014a('0x6'));var util=require('util');var path=require('path');var sox=require(_0x014a('0x7'));var csv=require(_0x014a('0x8'));var ejs=require(_0x014a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x014a('0xa'));var crypto=require(_0x014a('0xb'));var jsforce=require(_0x014a('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x014a('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x014a('0xe'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x014a('0xf'));var logger=require(_0x014a('0x10'))('api');var utils=require(_0x014a('0x11'));var config=require(_0x014a('0x12'));var licenseUtil=require(_0x014a('0x13'));var db=require(_0x014a('0x14'))['db'];config[_0x014a('0x15')]=_[_0x014a('0x16')](config[_0x014a('0x15')],{'host':_0x014a('0x17'),'port':0x18eb});var socket=require(_0x014a('0x18'))(new Redis(config[_0x014a('0x15')]));require(_0x014a('0x19'))[_0x014a('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x014a('0x1b')][_0x014a('0x1c')]({'port':0x232b});var client9004=jayson['client'][_0x014a('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x128c46,_0x59a4ea,_0x16e6fc,_0x17e4be){return new BPromise(function(_0x20f148,_0x12da95){var _0x2c26ac=_0x17e4be||client;return _0x2c26ac[_0x014a('0x1d')](_0x128c46,_0x16e6fc)[_0x014a('0x1e')](function(_0x263b07){logger[_0x014a('0x1f')](_0x014a('0x20'),_0x59a4ea,_0x014a('0x21'));logger[_0x014a('0x22')](_0x014a('0x23'),_0x59a4ea,_0x014a('0x21'),JSON['stringify'](_0x263b07));if(_0x263b07[_0x014a('0x24')]){if(_0x263b07[_0x014a('0x24')][_0x014a('0x25')]===0x1f4){logger[_0x014a('0x24')](_0x014a('0x20'),_0x59a4ea,_0x263b07[_0x014a('0x24')][_0x014a('0x26')]);return _0x12da95(_0x263b07[_0x014a('0x24')][_0x014a('0x26')]);}logger['error'](_0x014a('0x20'),_0x59a4ea,_0x263b07['error'][_0x014a('0x26')]);return _0x20f148(_0x263b07[_0x014a('0x24')][_0x014a('0x26')]);}else{logger[_0x014a('0x1f')](_0x014a('0x20'),_0x59a4ea,_0x014a('0x21'));_0x20f148(_0x263b07[_0x014a('0x27')][_0x014a('0x26')]);}})[_0x014a('0x28')](function(_0x4c2627){logger[_0x014a('0x24')]('ChatInteraction,\x20%s,\x20%s',_0x59a4ea,_0x4c2627);_0x12da95(_0x4c2627);});});}function respondWithStatusCode(_0x39a432,_0x28701e){_0x28701e=_0x28701e||0xcc;return function(_0x4f1c44){if(_0x4f1c44){return _0x39a432['sendStatus'](_0x28701e);}return _0x39a432[_0x014a('0x29')](_0x28701e)[_0x014a('0x2a')]();};}function respondWithResult(_0x143346,_0x5ed71b){_0x5ed71b=_0x5ed71b||0xc8;return function(_0x183f19){if(_0x183f19){return _0x143346[_0x014a('0x29')](_0x5ed71b)['json'](_0x183f19);}};}function respondWithFilteredResult(_0x31dc95,_0x2560a6){return function(_0x496040){if(_0x496040){var _0x4f9c1c=typeof _0x2560a6[_0x014a('0x2b')]===_0x014a('0x2c')&&typeof _0x2560a6[_0x014a('0x2d')]===_0x014a('0x2c');var _0x4ea00c=_0x496040[_0x014a('0x2e')];var _0x147e7e=_0x4f9c1c?0x0:_0x2560a6[_0x014a('0x2b')];var _0x402d3b=_0x4f9c1c?_0x496040[_0x014a('0x2e')]:_0x2560a6[_0x014a('0x2b')]+_0x2560a6[_0x014a('0x2d')];var _0x1dae8e;if(_0x402d3b>=_0x4ea00c){_0x402d3b=_0x4ea00c;_0x1dae8e=0xc8;}else{_0x1dae8e=0xce;}_0x31dc95[_0x014a('0x29')](_0x1dae8e);return _0x31dc95[_0x014a('0x2f')](_0x014a('0x30'),_0x147e7e+'-'+_0x402d3b+'/'+_0x4ea00c)['json'](_0x496040);}return null;};}function patchUpdates(_0x105d4a){return function(_0x41ead8){try{jsonpatch[_0x014a('0x31')](_0x41ead8,_0x105d4a,!![]);}catch(_0x457883){return BPromise[_0x014a('0x32')](_0x457883);}return _0x41ead8[_0x014a('0x33')]();};}function saveUpdates(_0x211d18,_0x4dd025){return function(_0x116a24){if(_0x116a24){return _0x116a24[_0x014a('0x34')](_0x211d18)['then'](function(_0x415f83){return _0x415f83;});}return null;};}function removeEntity(_0x12de94,_0x40738f){return function(_0x467032){if(_0x467032){return _0x467032[_0x014a('0x35')]()[_0x014a('0x1e')](function(){_0x12de94[_0x014a('0x29')](0xcc)[_0x014a('0x2a')]();});}};}function handleEntityNotFound(_0x5e37e4,_0x19cee1){return function(_0x1dfe6e){if(!_0x1dfe6e){_0x5e37e4[_0x014a('0x36')](0x194);}return _0x1dfe6e;};}function handleError(_0x1f31c8,_0x5127f3){_0x5127f3=_0x5127f3||0x1f4;return function(_0x427c7a){logger[_0x014a('0x24')](_0x427c7a[_0x014a('0x37')]);if(_0x427c7a[_0x014a('0x38')]){delete _0x427c7a[_0x014a('0x38')];}_0x1f31c8[_0x014a('0x29')](_0x5127f3)[_0x014a('0x39')](_0x427c7a);};}function getMustacheRender(_0x36187b,_0x1ec350){return Mustache['render'](_0x36187b,_[_0x014a('0x3a')](_0x1ec350['body'],{'contact':_0x1ec350[_0x014a('0x3b')],'message':_0x1ec350[_0x014a('0x26')],'agent':_0x1ec350[_0x014a('0x3c')],'interaction':_0x1ec350[_0x014a('0x3d')],'account':_0x1ec350[_0x014a('0x3e')]}))||'';}function getInteractionUsers(_0x55126d,_0x1c6f6f){return new BPromise(function(_0x3f4a61,_0x51dca8){try{if(_0x1c6f6f[_0x55126d['id']]){_0x55126d[_0x014a('0x3f')]=_[_0x014a('0x40')](_0x1c6f6f[_0x55126d['id']],function(_0x3e5ecf){return{'id':_0x3e5ecf['id'],'fullname':_0x3e5ecf[_0x014a('0x41')]};});}}catch(_0x3788d6){_0x51dca8(_0x3788d6);}_0x3f4a61(_0x55126d);});}function getInteractionTags(_0x313eb8,_0x17b1b6){return new BPromise(function(_0x764fbe,_0x2beddc){try{if(_0x313eb8['TagIds']){_0x313eb8[_0x014a('0x42')]=[];_0x313eb8[_0x014a('0x43')][_0x014a('0x44')](',')[_0x014a('0x45')](function(_0x5f1a91){_0x313eb8[_0x014a('0x42')][_0x014a('0x46')](_0x17b1b6[_0x5f1a91]);});}delete _0x313eb8[_0x014a('0x43')];}catch(_0x1355dd){_0x2beddc(_0x1355dd);}_0x764fbe(_0x313eb8);});}function updateChatInteraction(_0x1dc647,_0x430a56,_0x5f2969){return new BPromise(function(_0x361866,_0x2830e1){return getInteractionUsers(_0x1dc647,_0x5f2969)['then'](function(_0xc086b3){return getInteractionTags(_0xc086b3,_0x430a56);})[_0x014a('0x1e')](function(_0x2c45f1){_0x361866(_0x2c45f1);})['catch'](function(_0x5bcf8){_0x2830e1(_0x5bcf8);});});}exports['index']=function(_0x5ab5e8,_0x67b30f){var _0x29c9ca={},_0x5aa496={},_0x1557ad={'count':0x0,'rows':[]};var _0x11c0d5=_[_0x014a('0x40')](db[_0x014a('0x47')][_0x014a('0x48')],function(_0xbaf8c6){return{'name':_0xbaf8c6['fieldName'],'type':_0xbaf8c6[_0x014a('0x49')][_0x014a('0x4a')]};});_0x5aa496[_0x014a('0x4b')]=_['map'](_0x11c0d5,'name');_0x5aa496[_0x014a('0x4c')]=_['keys'](_0x5ab5e8['query']);_0x5aa496[_0x014a('0x4d')]=_['intersection'](_0x5aa496[_0x014a('0x4b')],_0x5aa496[_0x014a('0x4c')]);_0x29c9ca[_0x014a('0x4e')]=_['intersection'](_0x5aa496[_0x014a('0x4b')],qs[_0x014a('0x4f')](_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x4f')]));_0x29c9ca[_0x014a('0x4e')]=_0x29c9ca[_0x014a('0x4e')]['length']?_0x29c9ca[_0x014a('0x4e')]:_0x5aa496[_0x014a('0x4b')];if(!_0x5ab5e8['query'][_0x014a('0x50')](_0x014a('0x51'))){_0x29c9ca[_0x014a('0x2d')]=qs[_0x014a('0x2d')](_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x2d')]);_0x29c9ca[_0x014a('0x2b')]=qs[_0x014a('0x2b')](_0x5ab5e8['query'][_0x014a('0x2b')]);}_0x29c9ca[_0x014a('0x52')]=qs[_0x014a('0x53')](_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x53')]);_0x29c9ca['where']=qs[_0x014a('0x4d')](_['pick'](_0x5ab5e8[_0x014a('0x4c')],_0x5aa496[_0x014a('0x4d')]),_0x11c0d5);var _0x40e02b=[];var _0x479dc0=squel[_0x014a('0x54')]()['field']('id')['field']('name')['field'](_0x014a('0x55'))['from'](_0x014a('0x56'));var _0x5b5318=squel['select']()[_0x014a('0x57')]('u.id')[_0x014a('0x57')](_0x014a('0x58'))[_0x014a('0x57')](_0x014a('0x59'))[_0x014a('0x5a')](_0x014a('0x5b'),'ui')[_0x014a('0x5c')](_0x014a('0x5d'),'u',_0x014a('0x5e'));var _0x3fc9ab=squel['select']()['from'](_0x014a('0x5f'),'i')[_0x014a('0x5c')](_0x014a('0x60'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x014a('0x5d'),'o','o.id\x20=\x20i.UserId')[_0x014a('0x5c')](_0x014a('0x61'),'a',_0x014a('0x62'))[_0x014a('0x5c')]('chat_messages','me',_0x014a('0x63'))[_0x014a('0x5c')](_0x014a('0x64'),'it','it.ChatInteractionId\x20=\x20i.id')[_0x014a('0x5c')]('tools_tags','t',_0x014a('0x65'));var _0x47074f=squel[_0x014a('0x66')]();var _0x24d433=[];var _0xd0334a=squel[_0x014a('0x66')]();var _0x4e9260;if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x67')]){_0x4e9260=as[_0x014a('0x68')](_0x5ab5e8['query'][_0x014a('0x67')]);var _0x17f9d7=_0x4e9260[_0x014a('0x69')];for(var _0xa4fd8d=0x0;_0xa4fd8d<_0x4e9260[_0x014a('0x6a')]['length'];_0xa4fd8d++){var _0x8ac9cd=_0x4e9260[_0x014a('0x6a')][_0xa4fd8d];var _0x63c341='i';var _0x37a7b8=_[_0x014a('0x6b')](_0x11c0d5,[_0x014a('0x38'),_0x8ac9cd[_0x014a('0x57')]]);if(!_0x37a7b8){switch(_0x8ac9cd[_0x014a('0x57')]){case _0x014a('0x6c'):if(_0x8ac9cd[_0x014a('0x6d')]==0x1){_0x3fc9ab[_0x014a('0x6e')]('`'+_0x8ac9cd[_0x014a('0x57')]+'`\x20=\x200');}else{_0x3fc9ab[_0x014a('0x6e')]('`'+_0x8ac9cd['field']+'`\x20>\x200');}break;case'Contact':if(_0x8ac9cd['operator']==='$substring'){if(_0x8ac9cd[_0x014a('0x6d')][_0x014a('0x44')]('\x20')[_0x014a('0x6f')]>0x1){_0x47074f[_0x17f9d7]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x014a('0x70')](_0x8ac9cd[_0x014a('0x6d')]),null);}else{var _0x3071c8='%'+_0x8ac9cd[_0x014a('0x6d')]+'%';_0x47074f[_0x17f9d7]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x3071c8,_0x3071c8,_0x3071c8);}}else{_0x37a7b8=_['find'](_0x11c0d5,[_0x014a('0x38'),_0x014a('0x71')]);_0x8ac9cd[_0x014a('0x57')]=_0x014a('0x71');_0x58e087=as[_0x014a('0x72')](_0x63c341,_0x37a7b8[_0x014a('0x49')],_0x8ac9cd);_0x47074f[_0x17f9d7](_0x58e087[_0x014a('0x73')],_0x58e087[_0x014a('0x6d')][_0x014a('0x74')],_0x58e087[_0x014a('0x6d')][_0x014a('0x2a')]);}break;case'Tag':var _0x2d87e3=_0x8ac9cd[_0x014a('0x6d')]['split'](',')[_0x014a('0x40')](function(_0x3e39c9){return Number(_0x3e39c9);});_0x2d87e3['forEach'](function(_0x14f2e2){_0xd0334a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x14f2e2+',%');});_0x24d433=_[_0x014a('0x75')](_0x24d433,_0x2d87e3);break;case _0x014a('0x76'):if(_0x8ac9cd[_0x014a('0x77')]===_0x014a('0x78')){_0x47074f[_0x17f9d7](_0x014a('0x79'),'%'+_0x8ac9cd['value']+'%',null);}else{_0x37a7b8=_[_0x014a('0x6b')](_0x11c0d5,[_0x014a('0x38'),_0x014a('0x7a')]);_0x8ac9cd[_0x014a('0x57')]=_0x014a('0x7a');_0x58e087=as['buildExpression'](_0x63c341,_0x37a7b8[_0x014a('0x49')],_0x8ac9cd);_0x47074f[_0x17f9d7](_0x58e087[_0x014a('0x73')],_0x58e087[_0x014a('0x6d')]['start'],_0x58e087[_0x014a('0x6d')]['end']);}break;case _0x014a('0x7b'):_0x58e087=as[_0x014a('0x72')]('me',null,_0x8ac9cd);_0x47074f[_0x17f9d7](_0x58e087[_0x014a('0x73')],_0x58e087[_0x014a('0x6d')][_0x014a('0x74')],_0x58e087[_0x014a('0x6d')][_0x014a('0x2a')]);break;}}else{var _0x58e087=as['buildExpression'](_0x63c341,_0x37a7b8[_0x014a('0x49')],_0x8ac9cd);_0x47074f[_0x17f9d7](_0x58e087['text'],_0x58e087[_0x014a('0x6d')]['start'],_0x58e087[_0x014a('0x6d')][_0x014a('0x2a')]);}}}else{var _0x55bca3=_(_0x5ab5e8['query'])[_0x014a('0x7c')]()[_0x014a('0x40')](function(_0x5f391d){return _[_0x014a('0x7d')](_0x11c0d5,[_0x014a('0x38'),_0x5f391d])?_0x5f391d:undefined;})['compact']()['value']();if(!_[_0x014a('0x7e')](_0x55bca3)){_0x55bca3[_0x014a('0x45')](function(_0x1ee130){if(_0x1ee130===_0x014a('0x7f')){_0x3fc9ab[_0x014a('0x80')](_0x014a('0x81'),[]['concat'](_0x5ab5e8[_0x014a('0x4c')][_0x1ee130]));}else if(_0x1ee130==='createdAt'){var _0x5a8351=JSON[_0x014a('0x82')](_0x5ab5e8[_0x014a('0x4c')][_0x1ee130])['$gte'];var _0x27e363=JSON[_0x014a('0x82')](_0x5ab5e8[_0x014a('0x4c')][_0x1ee130])[_0x014a('0x83')];_0x3fc9ab[_0x014a('0x80')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5a8351,_0x27e363);}else{if(_0x5ab5e8[_0x014a('0x4c')][_0x1ee130]===_0x014a('0x84')){_0x3fc9ab[_0x014a('0x80')]('i.'+_0x1ee130+_0x014a('0x85'));}else{_0x3fc9ab['where']('i.'+_0x1ee130+_0x014a('0x86'),_0x5ab5e8['query'][_0x1ee130]);}}});}if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x87')]){if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x87')]==0x1){_0x3fc9ab[_0x014a('0x6e')](_0x014a('0x88'));}else{_0x3fc9ab['having'](_0x014a('0x89'));}}if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8a')]){_0x24d433=_[_0x014a('0x8b')](_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8a')])?_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8a')]:new Array(_0x5ab5e8['query'][_0x014a('0x8a')]);_0x24d433[_0x014a('0x45')](function(_0x3c2a39){_0xd0334a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3c2a39+',%');});}if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8c')]){var _0x1cdfa5=_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8c')][_0x014a('0x8d')]('\x5c','\x5c\x5c')[_0x014a('0x8d')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x1cdfa5)){_0x47074f['or']('i.id\x20LIKE\x20?',_0x1cdfa5+'%');}else{_0x47074f['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x1cdfa5))['or'](_0x014a('0x8e'),_0x1cdfa5+'%');}}}_0x3fc9ab[_0x014a('0x80')](_0x47074f);_0x3fc9ab[_0x014a('0x8f')](_0x014a('0x90'));var _0xe1b5ed={'type':db[_0x014a('0x91')][_0x014a('0x92')]['SELECT'],'raw':!![]};var _0x24ffb0=_0x3fc9ab[_0x014a('0x93')]();_0x24ffb0[_0x014a('0x57')](_0x014a('0x90'));_0x24ffb0['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x014a('0x6c'));if(_0x29c9ca[_0x014a('0x52')]){_0x29c9ca['order']['forEach'](function(_0x9aa04b){var _0x5bcaf9=_0x9aa04b[0x0]==='contactName'?_0x9aa04b[0x0]:'i.'+_0x9aa04b[0x0];_0x3fc9ab[_0x014a('0x52')](_0x5bcaf9,_0x9aa04b[0x1]===_0x014a('0x94')?![]:!![]);});}if(!_['isEmpty'](_0x24d433)){_0x3fc9ab[_0x014a('0x6e')](_0xd0334a);_0x24ffb0[_0x014a('0x80')](_0x014a('0x95'),_0x24d433);}BPromise[_0x014a('0x96')]()[_0x014a('0x1e')](function(){if(!_0x4e9260){if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x7f')])return;_0x24ffb0[_0x014a('0x80')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x3fc9ab['where'](_0x014a('0x97'));return;}if(_0x5ab5e8['user']['role']!=='agent')return;return _0x5ab5e8[_0x014a('0x98')][_0x014a('0x99')]({'attributes':['id'],'raw':!![]})[_0x014a('0x1e')](function(_0x55408f){if(_[_0x014a('0x7e')](_0x55408f)){_0x24ffb0[_0x014a('0x80')](_0x014a('0x9a'));_0x3fc9ab[_0x014a('0x80')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x24ffb0[_0x014a('0x80')](_0x014a('0x81'),_[_0x014a('0x40')](_0x55408f,'id'));_0x3fc9ab['where'](_0x014a('0x81'),_[_0x014a('0x40')](_0x55408f,'id'));}});})['then'](function(){if(_0x5ab5e8[_0x014a('0x98')][_0x014a('0x9b')]===_0x014a('0x3c')&&!_0x4e9260&&!_0x5ab5e8['query'][_0x014a('0x7f')])return[];return db[_0x014a('0x9c')]['query'](_0x24ffb0[_0x014a('0x9d')](),_0xe1b5ed);})[_0x014a('0x1e')](function(_0x317df3){_0x1557ad[_0x014a('0x2e')]=_0x317df3[_0x014a('0x6f')];if(_0x1557ad[_0x014a('0x2e')]===0x0)return[];return db[_0x014a('0x9c')][_0x014a('0x4c')](_0x479dc0['toString'](),_0xe1b5ed)[_0x014a('0x1e')](function(_0x1806d0){_0x40e02b=_['keyBy'](_0x1806d0,'id');_0xe1b5ed=_['merge'](_0xe1b5ed,{'model':db[_0x014a('0x47')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5ab5e8[_0x014a('0x4c')]['fields']){_0x29c9ca[_0x014a('0x4e')][_0x014a('0x45')](function(_0x216b27){_0x3fc9ab['field']('i.'+_0x216b27);});}else{_0x3fc9ab[_0x014a('0x57')](_0x014a('0x9e'),'unreadMessages');_0x3fc9ab['field'](_0x014a('0x9f'),'Account.key');_0x3fc9ab[_0x014a('0x57')]('a.mandatoryDisposition',_0x014a('0xa0'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xa1'),_0x014a('0xa2'));_0x3fc9ab[_0x014a('0x57')]('i.*');_0x3fc9ab[_0x014a('0x57')](_0x014a('0xa3'),_0x014a('0xa4'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xa5'),_0x014a('0xa6'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xa7'),'Contact.email');_0x3fc9ab[_0x014a('0x57')]('c.phone',_0x014a('0xa8'));_0x3fc9ab['field']('c.mobile','Contact.mobile');_0x3fc9ab['field'](_0x014a('0xa9'),_0x014a('0xaa'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xab'),_0x014a('0xac'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xad'),_0x014a('0xae'));_0x3fc9ab['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x014a('0x43'));}if(_0x29c9ca[_0x014a('0x2d')])_0x3fc9ab[_0x014a('0x2d')](_0x29c9ca[_0x014a('0x2d')]);if(_0x29c9ca[_0x014a('0x2b')])_0x3fc9ab[_0x014a('0x2b')](_0x29c9ca[_0x014a('0x2b')]);return db[_0x014a('0x9c')]['query'](_0x3fc9ab[_0x014a('0x9d')](),_0xe1b5ed);})[_0x014a('0x1e')](function(_0x3a2752){if(_0x3a2752[_0x014a('0x6f')]>0x0)_0x5b5318[_0x014a('0x80')]('ui.ChatInteractionId\x20IN\x20?',_[_0x014a('0x40')](_0x3a2752,'id'));return db[_0x014a('0x9c')][_0x014a('0x4c')](_0x5b5318[_0x014a('0x9d')](),_0xe1b5ed)[_0x014a('0x1e')](function(_0x567357){var _0x3036e4=_['groupBy'](_0x567357,_0x014a('0xaf'));var _0x5a83ab=[];_0x3a2752['forEach'](function(_0x1667c8){_0x5a83ab[_0x014a('0x46')](updateChatInteraction(_0x1667c8,_0x40e02b,_0x3036e4));});return BPromise['all'](_0x5a83ab);});});})[_0x014a('0x1e')](function(_0x3199b9){_0x1557ad[_0x014a('0xb0')]=_0x3199b9;return _0x1557ad;})['then'](respondWithFilteredResult(_0x67b30f,_0x29c9ca))[_0x014a('0x28')](handleError(_0x67b30f,null));};exports[_0x014a('0xb1')]=function(_0x2feb8a,_0x336bcf){var _0x2f7969={'raw':![],'where':{'id':_0x2feb8a[_0x014a('0xb2')]['id']}},_0x263212={};_0x263212[_0x014a('0x4b')]=_[_0x014a('0x7c')](db['ChatInteraction']['rawAttributes']);_0x263212[_0x014a('0x4c')]=_[_0x014a('0x7c')](_0x2feb8a[_0x014a('0x4c')]);_0x263212['filters']=_[_0x014a('0xb3')](_0x263212[_0x014a('0x4b')],_0x263212[_0x014a('0x4c')]);_0x2f7969[_0x014a('0x4e')]=_[_0x014a('0xb3')](_0x263212[_0x014a('0x4b')],qs['fields'](_0x2feb8a[_0x014a('0x4c')][_0x014a('0x4f')]));_0x2f7969[_0x014a('0x4e')]=_0x2f7969[_0x014a('0x4e')]['length']?_0x2f7969[_0x014a('0x4e')]:_0x263212[_0x014a('0x4b')];if(_0x2feb8a[_0x014a('0x4c')][_0x014a('0xb4')]){_0x2f7969[_0x014a('0xb5')]=[{'all':!![]}];}_0x2f7969=_['merge']({},_0x2f7969,_0x2feb8a[_0x014a('0xb6')]);return db['ChatInteraction']['find'](_0x2f7969)[_0x014a('0x1e')](handleEntityNotFound(_0x336bcf,null))[_0x014a('0x1e')](respondWithResult(_0x336bcf,null))[_0x014a('0x28')](handleError(_0x336bcf,null));};exports[_0x014a('0xb7')]=function(_0x3646b8,_0x243fd9){return db[_0x014a('0x47')][_0x014a('0xb7')](_0x3646b8[_0x014a('0x7b')],{})[_0x014a('0x1e')](respondWithResult(_0x243fd9,0xc9))[_0x014a('0x28')](handleError(_0x243fd9,null));};exports[_0x014a('0x34')]=function(_0x383bd8,_0x175c12){if(_0x383bd8[_0x014a('0x7b')]['id']){delete _0x383bd8[_0x014a('0x7b')]['id'];}return db['ChatInteraction'][_0x014a('0x6b')]({'where':{'id':_0x383bd8[_0x014a('0xb2')]['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x175c12,null))['then'](saveUpdates(_0x383bd8[_0x014a('0x7b')],null))[_0x014a('0x1e')](respondWithResult(_0x175c12,null))[_0x014a('0x28')](handleError(_0x175c12,null));};exports[_0x014a('0x35')]=function(_0x116631,_0xbfd7f8){return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x116631[_0x014a('0xb2')]['id']}})['then'](handleEntityNotFound(_0xbfd7f8,null))[_0x014a('0x1e')](removeEntity(_0xbfd7f8,null))[_0x014a('0x28')](handleError(_0xbfd7f8,null));};exports[_0x014a('0xb8')]=function(_0x11aab3,_0x4f91f1){return db[_0x014a('0x47')]['describe']()['then'](respondWithResult(_0x4f91f1,null))[_0x014a('0x28')](handleError(_0x4f91f1,null));};exports['createVidaooSession']=function(_0x2de457,_0x2ca658){var _0x4ee77b=_0x2de457[_0x014a('0xb2')]['id'];var _0x4e75e4;var _0x172210;var _0x8cc35d;return db['ChatInteraction'][_0x014a('0xb9')]({'where':{'id':_0x4ee77b}})[_0x014a('0x1e')](function(_0x50a129){_0x4e75e4=_0x50a129;return db[_0x014a('0xba')][_0x014a('0xb9')]({'where':{'id':_0x50a129[_0x014a('0x7f')]},'attributes':['id',_0x014a('0xbb'),_0x014a('0xbc'),_0x014a('0xbd'),_0x014a('0xbe'),_0x014a('0xbf')],'raw':!![]});})[_0x014a('0x1e')](function(_0x38df6c){if(_0x38df6c&&_0x38df6c[_0x014a('0xbb')]&&_0x38df6c[_0x014a('0xbc')]){_0x172210=_0x38df6c;var _0x4e0c1a={'interaction':{'id':_0x4ee77b},'agent':{'id':_0x2de457[_0x014a('0x98')]['id'],'name':_0x2de457[_0x014a('0x98')][_0x014a('0x38')],'fullname':_0x2de457[_0x014a('0x98')][_0x014a('0x41')],'email':_0x2de457[_0x014a('0x98')][_0x014a('0xc0')]},'contact':_0x2de457[_0x014a('0x7b')]['contact'],'account':_0x2de457[_0x014a('0x7b')][_0x014a('0x3e')]};var _0x2b3dc0={'rejectUnauthorized':![],'method':_0x014a('0xc1'),'url':_0x014a('0xc2'),'headers':{'X-APIKEY':_0x38df6c[_0x014a('0xbb')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2de457['user'][_0x014a('0xc0')]],'buttons':null,'topic':_0x172210[_0x014a('0xbd')],'note':_[_0x014a('0xc3')](_0x172210['vidaooNote'])?null:getMustacheRender(_0x172210['vidaooNote'],_0x4e0c1a),'metadata':null},'redirect':_0x014a('0xc4'),'json':!![]};try{if(!_[_0x014a('0xc3')](_0x172210[_0x014a('0xbf')])){var _0x31e65e=getMustacheRender(_0x172210[_0x014a('0xbf')],_0x4e0c1a);var _0x537353=JSON[_0x014a('0x82')](_0x31e65e);_0x2b3dc0[_0x014a('0x7b')][_0x014a('0xc5')]=_0x537353;}}catch(_0x5dd7a5){throw new db[(_0x014a('0x91'))][(_0x014a('0xc6'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x2b3dc0);}else{throw new db[(_0x014a('0x91'))]['ValidationError'](_0x014a('0xc7'));}})['then'](function(_0x57d852){_0x8cc35d=_0x57d852;if(_0x8cc35d['id']){var _0x581c3a={'body':_0x8cc35d[_0x014a('0xc8')],'ChatWebsiteId':_0x172210['id'],'ChatInteractionId':_0x4e75e4['id'],'direction':'out','UserId':_0x2de457[_0x014a('0x98')]['id']};return db['ChatMessage'][_0x014a('0xb7')](_0x581c3a,{});}else{throw new db[(_0x014a('0x91'))][(_0x014a('0xc6'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x014a('0x1e')](function(){return _0x4e75e4['updateAttributes']({'vidaooSessionId':_0x8cc35d['id']});})[_0x014a('0x1e')](respondWithResult(_0x2ca658,null))[_0x014a('0x28')](handleError(_0x2ca658,null));};exports[_0x014a('0xc9')]=function(_0x533371,_0x57b53b){if(_0x533371[_0x014a('0x7b')]['id']){delete _0x533371[_0x014a('0x7b')]['id'];}return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x533371[_0x014a('0xb2')]['id']},'include':[{'model':db[_0x014a('0xca')],'as':_0x014a('0xcb')}]})[_0x014a('0x1e')](handleEntityNotFound(_0x57b53b,null))[_0x014a('0x1e')](saveUpdates(_0x533371[_0x014a('0x7b')],null))[_0x014a('0x1e')](respondWithResult(_0x57b53b,null))[_0x014a('0x28')](handleError(_0x57b53b,null));};exports[_0x014a('0xcc')]=function(_0x4adbd2,_0x55a4bb,_0x38807c){if(_0x4adbd2[_0x014a('0x7b')]['id']){delete _0x4adbd2['body']['id'];}return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x4adbd2['params']['id']}})['then'](function(_0xf01aa6){if(!_0xf01aa6){logger[_0x014a('0x24')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x014a('0xcc'),0x194,'entity\x20not\x20found');_0x55a4bb[_0x014a('0x36')](0x194);}else{if(_0xf01aa6[_0x014a('0x7a')]){throw new db[(_0x014a('0x91'))][(_0x014a('0xc6'))]('Interaction\x20already\x20assigned');}}return _0xf01aa6;})['then'](function(_0x5db9d1){if(_0x5db9d1){return _0x5db9d1['update']({'closed':_0x4adbd2[_0x014a('0x7b')][_0x014a('0xcd')],'disposition':_0x4adbd2[_0x014a('0x7b')][_0x014a('0xce')]})[_0x014a('0x1e')](function(_0x3e19c0){return _0x3e19c0;});}})[_0x014a('0x1e')](function(_0x3546e7){return respondWithRpcPromise(_0x014a('0xcf'),_0x014a('0xcc'),_0x4adbd2[_0x014a('0x7b')],client9004);})['then'](respondWithResult(_0x55a4bb,null))['catch'](handleError(_0x55a4bb,null));};exports['attachmentUpload']=function(_0x190839,_0x28f011,_0x4da4a1){_0x190839[_0x014a('0x7b')][_0x014a('0x38')]=_0x190839[_0x014a('0xd0')][_0x014a('0xd1')];_0x190839['body'][_0x014a('0xd2')]=_0x190839[_0x014a('0xd0')]['filename'];_0x190839[_0x014a('0x7b')][_0x014a('0x49')]=_0x190839['file'][_0x014a('0xd3')];return db[_0x014a('0xd4')][_0x014a('0xb7')](_0x190839[_0x014a('0x7b')])[_0x014a('0x1e')](respondWithResult(_0x28f011,0xc9))[_0x014a('0x28')](handleError(_0x28f011,null));};exports[_0x014a('0xd5')]=function(_0xd50ab0,_0x4cee0b,_0x129deb){return db[_0x014a('0x47')][_0x014a('0xb9')]({'where':{'id':_0xd50ab0[_0x014a('0xb2')]['id']},'raw':!![]})[_0x014a('0x1e')](handleEntityNotFound(_0x4cee0b,null))[_0x014a('0x1e')](function(_0x2573bd){if(_0x2573bd){if(_0x2573bd[_0x014a('0xcd')]){return _0x4cee0b[_0x014a('0x29')](0x193)['json']({'status':0x193,'message':_0x014a('0xd6')});}return db['Attachment'][_0x014a('0xb9')]({'where':{'id':_0xd50ab0[_0x014a('0x4c')][_0x014a('0xd7')]},'raw':!![]})['then'](handleEntityNotFound(_0x4cee0b,null));}})['then'](function(_0x293ee3){if(_0x293ee3){var _0x4ce807=_0x293ee3['ChatOfflineMessageId']!==null;var _0x5c002b=path[_0x014a('0xd8')](config[_0x014a('0xd9')],_0x014a('0xda'));if(_0x4ce807){_0x5c002b=path['join'](_0x5c002b,_0x014a('0xdb'));}var _0x19a2ed=path['join'](_0x5c002b,_0x293ee3[_0x014a('0xd2')]);return _0x4cee0b[_0x014a('0xdc')](_0x19a2ed);}})[_0x014a('0x28')](handleError(_0x4cee0b,null));};exports['close']=function(_0x5b82f2,_0x2b622f){var _0x24e9d7=null;var _0x344adb=null;var _0x1441ed=null;var _0x34b528=null;if(_0x5b82f2[_0x014a('0x7b')]['id']){delete _0x5b82f2['body']['id'];}if(_0x5b82f2['body']['mailTranscript']){_0x34b528=path[_0x014a('0xd8')](config[_0x014a('0xd9')],_0x014a('0xdd'),util['format'](_0x014a('0xde'),Date[_0x014a('0xdf')]()));_0x5b82f2[_0x014a('0x7b')]['pathTranscript']=_0x34b528;}return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x5b82f2[_0x014a('0xb2')]['id']},'include':[{'model':db[_0x014a('0xe0')],'as':'Messages','include':[{'model':db[_0x014a('0x76')],'as':'User'}]}]})[_0x014a('0x1e')](handleEntityNotFound(_0x2b622f,null))[_0x014a('0x1e')](saveUpdates(_0x5b82f2[_0x014a('0x7b')],null))['then'](function(_0xdd63f){if(_0xdd63f){_0x24e9d7=_0xdd63f;return db[_0x014a('0xba')][_0x014a('0x6b')]({'where':{'id':_0x24e9d7[_0x014a('0x7f')]}});}})[_0x014a('0x1e')](function(_0x49a1eb){if(_0x49a1eb){_0x1441ed=_0x49a1eb;return db[_0x014a('0xca')][_0x014a('0x6b')]({'where':{'id':_0x24e9d7[_0x014a('0x71')]}});}})[_0x014a('0x1e')](function(_0x2432ac){if(_0x2432ac){_0x344adb=_0x2432ac;if(_0x34b528){var _0xb91589=null;for(var _0x53260c=0x1;_0x53260c<_0x24e9d7[_0x014a('0xe1')][_0x014a('0x6f')];++_0x53260c){_0xb91589=_0x24e9d7['Messages'][_0x53260c];var _0x1b5b25=_0xb91589['UserId']?util[_0x014a('0xe2')]('%s%d',_0x1441ed[_0x014a('0xe3')],_0xb91589[_0x014a('0x7a')]):_0x014a('0xe4');var _0x10b3c5=_0x5b82f2[_0x014a('0x7b')][_0x014a('0xe5')]||util[_0x014a('0xe2')]('%s%d','Visitor',_0xb91589[_0x014a('0x71')]);switch(_0x1441ed[_0x014a('0xe6')]){case'website_alias':_0x1b5b25=_0xb91589[_0x014a('0x7a')]?util[_0x014a('0xe2')](_0x014a('0xe7'),_0x1441ed[_0x014a('0xe3')],_0xb91589[_0x014a('0x7a')]):'System';break;case _0x014a('0xe8'):_0x1b5b25=_0xb91589[_0x014a('0x7a')]?_0xb91589[_0x014a('0x76')][_0x014a('0xe9')]||_0xb91589['User'][_0x014a('0x41')]:'System';break;case _0x014a('0xea'):_0x1b5b25=_0xb91589[_0x014a('0x7a')]?_0xb91589[_0x014a('0x76')][_0x014a('0x41')]:_0x014a('0xe4');break;default:_0x1b5b25=_0xb91589[_0x014a('0x7a')]?util[_0x014a('0xe2')]('%s%d',_0x1441ed[_0x014a('0xe3')],_0xb91589[_0x014a('0x7a')]):_0x014a('0xe4');}var _0x343b5e=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0xb91589[_0x014a('0xeb')])[_0x014a('0xe2')]('MM/DD/YYYY\x20HH:mm:ss'),_0xb91589[_0x014a('0xec')]==='in'?_0x10b3c5:_0x1b5b25,_0xb91589[_0x014a('0x7b')]);if(!_0xb91589[_0x014a('0xed')]){fs[_0x014a('0xee')](_0x34b528,_0x343b5e);}}return db[_0x014a('0xef')][_0x014a('0xb9')]({'where':{'service':!![]},'include':[{'model':db[_0x014a('0xf0')],'as':_0x014a('0xf1'),'raw':!![]}]});}}})[_0x014a('0x1e')](function(_0x4ad0c6){if(_0x4ad0c6&&_0x4ad0c6[_0x014a('0xf1')]&&_0x5b82f2['body']){var _0x5f8d5b={'tls':{'rejectUnauthorized':![]}};if(_0x4ad0c6[_0x014a('0xf1')]['service']){_0x5f8d5b[_0x014a('0xf2')]=_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf2')];}else{_0x5f8d5b[_0x014a('0xf3')]=_0x4ad0c6[_0x014a('0xf1')]['host'];_0x5f8d5b[_0x014a('0xf4')]=_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf4')];_0x5f8d5b[_0x014a('0xf5')]=_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf5')];}if(_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf6')]){_0x5f8d5b['auth']={'user':_0x4ad0c6[_0x014a('0xf1')]['user'],'pass':_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf7')]};}return respondWithRpcPromise(_0x014a('0xf8'),_0x014a('0xf9'),{'account':_0x5f8d5b,'message':{'from':util[_0x014a('0xe2')](_0x014a('0xfa'),_0x4ad0c6['name'],_0x4ad0c6[_0x014a('0xc0')]||_0x4ad0c6['Smtp'][_0x014a('0x98')]),'to':_0x5b82f2[_0x014a('0x7b')][_0x014a('0xfb')],'subject':_0x014a('0xfc'),'text':util[_0x014a('0xe2')](_0x014a('0xfd'),_0x5b82f2[_0x014a('0x7b')][_0x014a('0xfb')]),'attachments':[{'path':_0x34b528}]}})['then'](function(){return _0x24e9d7;})['catch'](function(_0xac886c){console[_0x014a('0x24')](_0xac886c);});}else{return _0x24e9d7;}})[_0x014a('0x1e')](respondWithStatusCode(_0x2b622f,0xc8))[_0x014a('0x28')](handleError(_0x2b622f,null));};exports[_0x014a('0xfe')]=function(_0x30aa7b,_0x451579,_0x3858a1){return db[_0x014a('0xe0')][_0x014a('0x6b')]({'where':{'id':_0x30aa7b[_0x014a('0xb2')]['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x451579,null))[_0x014a('0x1e')](function(_0x57bd30){if(_0x57bd30){return _0x57bd30[_0x014a('0xfe')](_0x30aa7b[_0x014a('0x7b')][_0x014a('0xff')],_['omit'](_0x30aa7b[_0x014a('0x7b')],[_0x014a('0xff'),'id'])||{});}})[_0x014a('0x1e')](respondWithResult(_0x451579,null))[_0x014a('0x28')](handleError(_0x451579,null));};exports[_0x014a('0x100')]=function(_0x36c94d,_0x44cb05,_0x30a903){var _0x3bb1f={'raw':![],'where':{}};var _0x4775a4={};var _0x13ec10={'count':0x0,'rows':[]};return db[_0x014a('0x47')]['findOne']({'where':{'id':_0x36c94d['params']['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x44cb05,null))[_0x014a('0x1e')](function(_0x4a361b){if(_0x4a361b){_0x4775a4[_0x014a('0x4b')]=_[_0x014a('0x7c')](db[_0x014a('0xe0')][_0x014a('0x48')]);_0x4775a4[_0x014a('0x4c')]=_[_0x014a('0x7c')](_0x36c94d[_0x014a('0x4c')]);_0x4775a4[_0x014a('0x4d')]=_['intersection'](_0x4775a4[_0x014a('0x4b')],_0x4775a4[_0x014a('0x4c')]);_0x3bb1f[_0x014a('0x4e')]=_[_0x014a('0xb3')](_0x4775a4['model'],qs[_0x014a('0x4f')](_0x36c94d[_0x014a('0x4c')][_0x014a('0x4f')]));_0x3bb1f['attributes']=_0x3bb1f[_0x014a('0x4e')][_0x014a('0x6f')]?_0x3bb1f['attributes']:_0x4775a4[_0x014a('0x4b')];if(!_0x36c94d[_0x014a('0x4c')][_0x014a('0x50')]('nolimit')){_0x3bb1f[_0x014a('0x2d')]=qs[_0x014a('0x2d')](_0x36c94d[_0x014a('0x4c')]['limit']);_0x3bb1f[_0x014a('0x2b')]=qs['offset'](_0x36c94d[_0x014a('0x4c')]['offset']);}_0x3bb1f[_0x014a('0x52')]=qs[_0x014a('0x53')](_0x36c94d['query'][_0x014a('0x53')]);_0x3bb1f['where']=qs[_0x014a('0x4d')](_[_0x014a('0x101')](_0x36c94d[_0x014a('0x4c')],_0x4775a4[_0x014a('0x4d')]));_0x3bb1f[_0x014a('0x80')]['ChatInteractionId']=_0x4a361b['id'];if(_0x36c94d[_0x014a('0x4c')][_0x014a('0x8c')]){_0x3bb1f[_0x014a('0x80')]=_['merge'](_0x3bb1f[_0x014a('0x80')],{'$or':_[_0x014a('0x40')](_0x3bb1f['attributes'],function(_0x565da5){var _0x309858={};_0x309858[_0x565da5]={'$like':'%'+_0x36c94d[_0x014a('0x4c')]['filter']+'%'};return _0x309858;})});}if(_0x36c94d[_0x014a('0x4c')]['$gte']){var _0x56bfaf=_0x36c94d[_0x014a('0x4c')][_0x014a('0x102')]['split'](',');var _0x5f14e4={};_0x5f14e4[_0x56bfaf[0x0]]={'$gte':moment(_0x56bfaf[0x1])['format'](_0x014a('0x103'))};_0x3bb1f[_0x014a('0x80')]=_[_0x014a('0x3a')](_0x3bb1f['where'],_0x5f14e4);}_0x3bb1f=_['merge']({},_0x3bb1f,_0x36c94d[_0x014a('0xb6')]);return db['ChatMessage'][_0x014a('0x2e')]({'where':_0x3bb1f[_0x014a('0x80')]})['then'](function(_0x4acfe9){_0x13ec10[_0x014a('0x2e')]=_0x4acfe9;if(_0x36c94d[_0x014a('0x4c')]['includeAll']){_0x3bb1f[_0x014a('0xb5')]=[{'all':!![]}];}return db['ChatMessage'][_0x014a('0x104')](_0x3bb1f);})['then'](function(_0x8c21a7){_0x13ec10[_0x014a('0xb0')]=_0x8c21a7;return _0x13ec10;});}})[_0x014a('0x1e')](respondWithFilteredResult(_0x44cb05,_0x3bb1f))[_0x014a('0x28')](handleError(_0x44cb05,null));};exports[_0x014a('0x105')]=function(_0x260f79,_0x68de07,_0x4126a3){var _0x4f1f23={'where':{}},_0x1ef9b0={},_0x11d0e9={'count':0x0,'rows':[]};return db[_0x014a('0x47')][_0x014a('0xb9')]({'where':{'id':_0x260f79[_0x014a('0xb2')]['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x68de07,null))[_0x014a('0x1e')](function(_0x4f7960){if(_0x4f7960){_0x1ef9b0['model']=_[_0x014a('0x7c')](db[_0x014a('0xe0')][_0x014a('0x48')]);_0x1ef9b0[_0x014a('0x4c')]=_[_0x014a('0x7c')](_0x260f79[_0x014a('0x4c')]);_0x1ef9b0[_0x014a('0x4d')]=_[_0x014a('0xb3')](_0x1ef9b0[_0x014a('0x4b')],_0x1ef9b0[_0x014a('0x4c')]);_0x4f1f23[_0x014a('0x4e')]=_['intersection'](_0x1ef9b0[_0x014a('0x4b')],qs[_0x014a('0x4f')](_0x260f79[_0x014a('0x4c')][_0x014a('0x4f')]));_0x4f1f23[_0x014a('0x4e')]=_0x4f1f23[_0x014a('0x4e')][_0x014a('0x6f')]?_0x4f1f23['attributes']:_0x1ef9b0['model'];if(!_0x260f79[_0x014a('0x4c')][_0x014a('0x50')](_0x014a('0x51'))){_0x4f1f23[_0x014a('0x2d')]=qs[_0x014a('0x2d')](_0x260f79['query'][_0x014a('0x2d')]);_0x4f1f23[_0x014a('0x2b')]=qs['offset'](_0x260f79[_0x014a('0x4c')][_0x014a('0x2b')]);}_0x4f1f23[_0x014a('0x52')]=qs['sort'](_0x260f79[_0x014a('0x4c')][_0x014a('0x53')]);_0x4f1f23[_0x014a('0x80')]=qs['filters'](_[_0x014a('0x101')](_0x260f79[_0x014a('0x4c')],_0x1ef9b0['filters']));_0x4f1f23[_0x014a('0x80')][_0x014a('0xaf')]=_0x4f7960['id'];if(_0x260f79[_0x014a('0x4c')]['filter']){_0x4f1f23[_0x014a('0x80')]=_['merge'](_0x4f1f23['where'],{'$or':_['map'](_0x4f1f23['attributes'],function(_0xf3e4fb){var _0x126084={};_0x126084[_0xf3e4fb]={'$like':'%'+_0x260f79[_0x014a('0x4c')][_0x014a('0x8c')]+'%'};return _0x126084;})});}_0x4f1f23[_0x014a('0x80')][_0x014a('0xed')]=![];if(_0x260f79[_0x014a('0x4c')]['id']){_0x4f1f23['where']['id']={'$gt':_0x260f79[_0x014a('0x4c')]['id']};}_0x4f1f23=_['merge']({},_0x4f1f23,_0x260f79[_0x014a('0xb6')]);return db[_0x014a('0xe0')][_0x014a('0x2e')]({'where':_0x4f1f23['where']})[_0x014a('0x1e')](function(_0x58421d){_0x11d0e9['count']=_0x58421d;_0x4f1f23[_0x014a('0xb5')]=[];if(_0x260f79[_0x014a('0x4c')][_0x014a('0x106')]){_0x4f1f23['include']['push']({'model':db[_0x014a('0x76')],'as':_0x014a('0x76'),'attributes':['id',_0x014a('0x41'),_0x014a('0xe9')]});}if(_0x260f79[_0x014a('0x4c')][_0x014a('0xb4')]){_0x4f1f23['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x4f1f23);})[_0x014a('0x1e')](function(_0x40a47f){_0x11d0e9[_0x014a('0xb0')]=_0x40a47f;return _0x11d0e9;});}})['then'](respondWithFilteredResult(_0x68de07,_0x4f1f23))[_0x014a('0x28')](handleError(_0x68de07,null));};exports[_0x014a('0x107')]=function(_0x8a099,_0x81208d,_0x320be9){return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x8a099[_0x014a('0xb2')]['id']}})['then'](handleEntityNotFound(_0x81208d,null))[_0x014a('0x1e')](function(_0x46a2c5){if(_0x46a2c5){return _0x46a2c5['setTags'](_0x8a099[_0x014a('0x7b')][_0x014a('0xff')],_[_0x014a('0x108')](_0x8a099['body'],[_0x014a('0xff'),'id'])||{})[_0x014a('0x109')](function(){return db['Tag'][_0x014a('0x104')]({'attributes':['id','name',_0x014a('0x55')],'where':{'id':_0x8a099[_0x014a('0x7b')][_0x014a('0xff')]}});})[_0x014a('0x1e')](function(_0x4f56a9){socket['emit'](_0x014a('0x10a'),{'id':Number(_0x8a099[_0x014a('0xb2')]['id']),'tags':_0x4f56a9||[]});return{'id':Number(_0x8a099[_0x014a('0xb2')]['id']),'tags':_0x4f56a9||[]};});}})[_0x014a('0x1e')](respondWithResult(_0x81208d,null))[_0x014a('0x28')](handleError(_0x81208d,null));};exports[_0x014a('0x10b')]=function(_0x32ba5d,_0x120047,_0x570898){return db['ChatInteraction']['find']({'where':{'id':_0x32ba5d[_0x014a('0xb2')]['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x120047,null))[_0x014a('0x1e')](function(_0x47cd44){if(_0x47cd44){return _0x47cd44[_0x014a('0x10b')](_0x32ba5d[_0x014a('0x4c')][_0x014a('0xff')]);}})['then'](respondWithStatusCode(_0x120047,null))[_0x014a('0x28')](handleError(_0x120047,null));};exports['download']=function(_0x546af7,_0x4c492f){var _0x331ba9=moment()['unix']()[_0x014a('0x9d')]();var _0x3e7923=path['join'](config[_0x014a('0xd9')],'server',_0x014a('0x10c'),'tmp');var _0x387e49=path[_0x014a('0xd8')](config[_0x014a('0xd9')],_0x014a('0x10d'),_0x014a('0x10c'),_0x014a('0x10e'));var _0x1c5606=path['join'](_0x3e7923,_0x331ba9);var _0x4b4336=util[_0x014a('0xe2')]('transcript-%d-%s.zip',_0x546af7[_0x014a('0xb2')]['id'],_0x331ba9);var _0x1b3f4d=path[_0x014a('0xd8')](_0x3e7923,_0x4b4336);var _0x5f58bd=[];_0x5f58bd[_0x014a('0x46')]({'model':db[_0x014a('0x76')],'as':'User','attributes':['id',_0x014a('0x41')],'raw':!![]});_0x5f58bd[_0x014a('0x46')]({'model':db[_0x014a('0xca')],'as':_0x014a('0xcb'),'attributes':['id',_0x014a('0x10f'),_0x014a('0x110')],'raw':!![]});if(_0x546af7[_0x014a('0x4c')]['attachments']){_0x5f58bd[_0x014a('0x46')]({'model':db[_0x014a('0xd4')],'as':'Attachment','raw':!![]});}var _0x5104b1=[{'model':db[_0x014a('0xe0')],'as':_0x014a('0xe1'),'attributes':['id',_0x014a('0x7b'),_0x014a('0xeb'),'direction',_0x014a('0xed'),_0x014a('0x87')],'include':_0x5f58bd}];_0x5104b1[_0x014a('0x46')]({'model':db[_0x014a('0xba')],'as':_0x014a('0x111'),'attributes':['id',_0x014a('0x38')]});_0x5104b1['push']({'model':db['User'],'as':'Owner','attributes':['id',_0x014a('0x41')]});return db['ChatInteraction'][_0x014a('0x6b')]({'where':{'id':_0x546af7[_0x014a('0xb2')]['id']},'include':_0x5104b1})[_0x014a('0x1e')](handleEntityNotFound(_0x4c492f,null))['then'](function(_0x501d05){if(_0x501d05){var _0x48c669=_0x501d05[_0x014a('0x112')]({'plain':!![]});fs['mkdirSync'](_0x1c5606);var _0x5d4bae={'channel':_0x014a('0x113'),'account':_0x48c669[_0x014a('0x111')][_0x014a('0x38')],'agent':_0x48c669[_0x014a('0x114')]?_0x48c669[_0x014a('0x114')][_0x014a('0x41')]:_0x014a('0x115'),'createdAt':moment(_0x48c669[_0x014a('0xeb')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x48c669['closed']?moment(_0x48c669[_0x014a('0x116')])[_0x014a('0xe2')](_0x014a('0x103'))[_0x014a('0x9d')]():'','disposition':_0x48c669[_0x014a('0xce')],'chatInfo':{'browser':_0x48c669['browserName'],'os':_0x48c669[_0x014a('0x117')],'referer':_0x48c669[_0x014a('0x118')],'customerIp':_0x48c669['customerIp'],'customerPort':_0x48c669[_0x014a('0x119')]?_0x48c669[_0x014a('0x119')]:_0x014a('0x115')},'messages':_(_0x48c669[_0x014a('0xe1')])['tail']()[_0x014a('0x8c')]({'secret':![]})[_0x014a('0x40')](function(_0x5afb91){if(_0x5afb91[_0x014a('0xd4')]){var _0x172440=path[_0x014a('0xd8')](_0x387e49,_0x5afb91[_0x014a('0xd4')][_0x014a('0xd2')]);if(fs[_0x014a('0x11a')](_0x172440)){fs[_0x014a('0x11b')](_0x172440)[_0x014a('0x11c')](fs['createWriteStream'](path[_0x014a('0xd8')](_0x1c5606,_0x5afb91[_0x014a('0xd4')][_0x014a('0xd2')])));}}return{'date':moment(_0x5afb91['createdAt'])['format'](_0x014a('0x103'))[_0x014a('0x9d')](),'sender':_0x5afb91[_0x014a('0xec')]==='out'?_0x5afb91[_0x014a('0x76')]?_0x5afb91[_0x014a('0x76')][_0x014a('0x41')]:_0x014a('0xe4'):_0x5afb91[_0x014a('0xcb')][_0x014a('0x10f')]+(_0x5afb91[_0x014a('0xcb')][_0x014a('0x110')]?'\x20'+_0x5afb91[_0x014a('0xcb')][_0x014a('0x110')]:''),'body':_0x5afb91[_0x014a('0xd4')]?_0x5afb91[_0x014a('0xd4')][_0x014a('0xd2')]:_0x5afb91[_0x014a('0x7b')],'direction':_0x5afb91[_0x014a('0xec')]===_0x014a('0x11d')?'A':'C','secret':_0x5afb91[_0x014a('0xed')],'read':_0x5afb91['read'],'attachment':_0x5afb91[_0x014a('0xd4')]};})[_0x014a('0x6d')]()};return ejs['renderFile'](path['join'](config['root'],_0x014a('0x10d'),_0x014a('0x11e'),'downloadInteraction.ejs'),{'interaction':_0x5d4bae})['then'](function(_0x374e3d){var _0x2d9178=path['join'](_0x1c5606,_0x014a('0x11f')+_0x48c669['id']+'-'+_0x331ba9+'.pdf');var _0x30c604={'path':_0x2d9178,'channel':'Chat','interactionId':_0x48c669['id']};return pdf['createPdfFromHTML'](_0x374e3d,_0x30c604);})[_0x014a('0x1e')](function(){return new BPromise(function(_0x321a17,_0x2f20e7){zipdir(_0x1c5606,{'saveTo':_0x1b3f4d},function(_0x18edd1,_0xcad1af){if(_0x18edd1)return _0x2f20e7(_0x18edd1);return _0x321a17(_0xcad1af);});})['then'](function(){return new BPromise(function(_0x42cd23,_0x82d77b){rimraf(_0x1c5606,function(_0x48bcec){if(_0x48bcec)_0x82d77b(_0x48bcec);return _0x42cd23();});});})[_0x014a('0x1e')](function(){return _0x4c492f[_0x014a('0xdc')](_0x1b3f4d,_0x4b4336,function(_0x1d8179){if(_0x1d8179){console[_0x014a('0x120')](_0x014a('0x121'),_0x1d8179);}else{fs[_0x014a('0x122')](_0x1b3f4d);}});});});}else{return _0x4c492f[_0x014a('0x36')](0xc8);}})['catch'](handleError(_0x4c492f,null));};
\ No newline at end of file
+var _0x7880=['parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','ChatWebsiteId','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','agent','sequelize','toString','keyBy','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','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.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','params','include','options','create','destroy','describe','createVidaooSession','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','update','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','findOne','attachId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','transcript-%s.txt','now','Messages','%s%d','agentAlias','customer','format','website_alias','System','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','appendFileSync','MailServerOut','Smtp','service','host','port','secure','pass','SendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','nolimit','pick','YYYY-MM-DD\x20HH:mm:ss','includeAll','getMyMessages','secret','includeAgent','findAll','addTags','spread','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Owner','get','mkdirSync','Account','closedAt','browserName','customerPort','N.A.','tail','createReadStream','createWriteStream','direction','renderFile','downloadInteraction.ejs','transcript-','.pdf','Chat','createPdfFromHTML','err','unlinkSync','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','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','http','client','then','info','request\x20sent','debug','error','code','ChatInteraction,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','name','send','merge','contact','interaction','account','fullname','Tags','TagIds','split','forEach','push','index','map','ChatInteraction','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','select','field','color','from','tools_tags','u.id','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','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','isEmpty','concat','createdAt'];(function(_0x32bdc3,_0x4a6165){var _0x57ccb7=function(_0x4e5a22){while(--_0x4e5a22){_0x32bdc3['push'](_0x32bdc3['shift']());}};_0x57ccb7(++_0x4a6165);}(_0x7880,0x1f4));var _0x0788=function(_0xf237f7,_0xb11ac){_0xf237f7=_0xf237f7-0x0;var _0x2c183b=_0x7880[_0xf237f7];return _0x2c183b;};'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 pdf=require(_0x0788('0x14'));var hardwareService=require(_0x0788('0x15'));var logger=require('../../config/logger')(_0x0788('0x16'));var utils=require(_0x0788('0x17'));var config=require(_0x0788('0x18'));var licenseUtil=require(_0x0788('0x19'));var db=require(_0x0788('0x1a'))['db'];config[_0x0788('0x1b')]=_[_0x0788('0x1c')](config['redis'],{'host':_0x0788('0x1d'),'port':0x18eb});var socket=require(_0x0788('0x1e'))(new Redis(config[_0x0788('0x1b')]));require(_0x0788('0x1f'))['register'](socket);var jayson=require(_0x0788('0x20'));var client=jayson['client'][_0x0788('0x21')]({'port':0x232b});var client9004=jayson[_0x0788('0x22')][_0x0788('0x21')]({'port':0x232c});function respondWithRpcPromise(_0xb406fb,_0x2ddd1a,_0x430e34,_0x5e1a29){return new BPromise(function(_0x573822,_0x17d805){var _0x461d9d=_0x5e1a29||client;return _0x461d9d['request'](_0xb406fb,_0x430e34)[_0x0788('0x23')](function(_0x415f19){logger[_0x0788('0x24')]('ChatInteraction,\x20%s,\x20%s',_0x2ddd1a,_0x0788('0x25'));logger[_0x0788('0x26')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2ddd1a,_0x0788('0x25'),JSON['stringify'](_0x415f19));if(_0x415f19[_0x0788('0x27')]){if(_0x415f19['error'][_0x0788('0x28')]===0x1f4){logger[_0x0788('0x27')](_0x0788('0x29'),_0x2ddd1a,_0x415f19[_0x0788('0x27')][_0x0788('0x2a')]);return _0x17d805(_0x415f19['error']['message']);}logger[_0x0788('0x27')](_0x0788('0x29'),_0x2ddd1a,_0x415f19[_0x0788('0x27')][_0x0788('0x2a')]);return _0x573822(_0x415f19['error']['message']);}else{logger[_0x0788('0x24')](_0x0788('0x29'),_0x2ddd1a,_0x0788('0x25'));_0x573822(_0x415f19['result']['message']);}})[_0x0788('0x2b')](function(_0xa1f7dc){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x2ddd1a,_0xa1f7dc);_0x17d805(_0xa1f7dc);});});}function respondWithStatusCode(_0x5a54a5,_0x44798c){_0x44798c=_0x44798c||0xcc;return function(_0x57fda1){if(_0x57fda1){return _0x5a54a5[_0x0788('0x2c')](_0x44798c);}return _0x5a54a5[_0x0788('0x2d')](_0x44798c)[_0x0788('0x2e')]();};}function respondWithResult(_0x18fc0e,_0xf9ba32){_0xf9ba32=_0xf9ba32||0xc8;return function(_0xb2f4a5){if(_0xb2f4a5){return _0x18fc0e[_0x0788('0x2d')](_0xf9ba32)[_0x0788('0x2f')](_0xb2f4a5);}};}function respondWithFilteredResult(_0x5b7594,_0x5a5178){return function(_0x3c5246){if(_0x3c5246){var _0x40d345=typeof _0x5a5178['offset']==='undefined'&&typeof _0x5a5178[_0x0788('0x30')]===_0x0788('0x31');var _0x20fcd8=_0x3c5246[_0x0788('0x32')];var _0x44cbfb=_0x40d345?0x0:_0x5a5178[_0x0788('0x33')];var _0x327d67=_0x40d345?_0x3c5246[_0x0788('0x32')]:_0x5a5178[_0x0788('0x33')]+_0x5a5178[_0x0788('0x30')];var _0x5ec0ed;if(_0x327d67>=_0x20fcd8){_0x327d67=_0x20fcd8;_0x5ec0ed=0xc8;}else{_0x5ec0ed=0xce;}_0x5b7594[_0x0788('0x2d')](_0x5ec0ed);return _0x5b7594[_0x0788('0x34')](_0x0788('0x35'),_0x44cbfb+'-'+_0x327d67+'/'+_0x20fcd8)[_0x0788('0x2f')](_0x3c5246);}return null;};}function patchUpdates(_0xce4534){return function(_0x458193){try{jsonpatch[_0x0788('0x36')](_0x458193,_0xce4534,!![]);}catch(_0x15d67a){return BPromise[_0x0788('0x37')](_0x15d67a);}return _0x458193[_0x0788('0x38')]();};}function saveUpdates(_0x4fa055,_0x4ae132){return function(_0x5947d3){if(_0x5947d3){return _0x5947d3['update'](_0x4fa055)['then'](function(_0x586a06){return _0x586a06;});}return null;};}function removeEntity(_0x208a89,_0x38a4ae){return function(_0x2130e3){if(_0x2130e3){return _0x2130e3['destroy']()[_0x0788('0x23')](function(){_0x208a89[_0x0788('0x2d')](0xcc)[_0x0788('0x2e')]();});}};}function handleEntityNotFound(_0xaea11d,_0x57c4d8){return function(_0x2ed940){if(!_0x2ed940){_0xaea11d['sendStatus'](0x194);}return _0x2ed940;};}function handleError(_0x322465,_0x4fcde3){_0x4fcde3=_0x4fcde3||0x1f4;return function(_0x9d1edb){logger[_0x0788('0x27')](_0x9d1edb['stack']);if(_0x9d1edb[_0x0788('0x39')]){delete _0x9d1edb[_0x0788('0x39')];}_0x322465['status'](_0x4fcde3)[_0x0788('0x3a')](_0x9d1edb);};}function getMustacheRender(_0x5eb693,_0x295024){return Mustache['render'](_0x5eb693,_[_0x0788('0x3b')](_0x295024['body'],{'contact':_0x295024[_0x0788('0x3c')],'message':_0x295024['message'],'agent':_0x295024['agent'],'interaction':_0x295024[_0x0788('0x3d')],'account':_0x295024[_0x0788('0x3e')]}))||'';}function getInteractionUsers(_0x2e48cf,_0x2d17b0){return new BPromise(function(_0x8cfffc,_0x53da74){try{if(_0x2d17b0[_0x2e48cf['id']]){_0x2e48cf['Users']=_['map'](_0x2d17b0[_0x2e48cf['id']],function(_0x4d539a){return{'id':_0x4d539a['id'],'fullname':_0x4d539a[_0x0788('0x3f')]};});}}catch(_0x1202c4){_0x53da74(_0x1202c4);}_0x8cfffc(_0x2e48cf);});}function getInteractionTags(_0x45b247,_0x358a22){return new BPromise(function(_0x362c49,_0x5993ad){try{if(_0x45b247['TagIds']){_0x45b247[_0x0788('0x40')]=[];_0x45b247[_0x0788('0x41')][_0x0788('0x42')](',')[_0x0788('0x43')](function(_0x236b63){_0x45b247[_0x0788('0x40')][_0x0788('0x44')](_0x358a22[_0x236b63]);});}delete _0x45b247[_0x0788('0x41')];}catch(_0x347984){_0x5993ad(_0x347984);}_0x362c49(_0x45b247);});}function updateChatInteraction(_0x50e8f5,_0x5581e6,_0x441aec){return new BPromise(function(_0x1d579d,_0x9e8ee){return getInteractionUsers(_0x50e8f5,_0x441aec)['then'](function(_0x5ab353){return getInteractionTags(_0x5ab353,_0x5581e6);})['then'](function(_0x172424){_0x1d579d(_0x172424);})[_0x0788('0x2b')](function(_0x25501b){_0x9e8ee(_0x25501b);});});}exports[_0x0788('0x45')]=function(_0x2737d8,_0x1928f3){var _0x1ab634={},_0x15b90c={},_0x4bd0d9={'count':0x0,'rows':[]};var _0x15c618=_[_0x0788('0x46')](db[_0x0788('0x47')][_0x0788('0x48')],function(_0x58eb04){return{'name':_0x58eb04[_0x0788('0x49')],'type':_0x58eb04[_0x0788('0x4a')]['key']};});_0x15b90c['model']=_['map'](_0x15c618,_0x0788('0x39'));_0x15b90c['query']=_[_0x0788('0x4b')](_0x2737d8[_0x0788('0x4c')]);_0x15b90c[_0x0788('0x4d')]=_[_0x0788('0x4e')](_0x15b90c[_0x0788('0x4f')],_0x15b90c[_0x0788('0x4c')]);_0x1ab634[_0x0788('0x50')]=_[_0x0788('0x4e')](_0x15b90c['model'],qs['fields'](_0x2737d8[_0x0788('0x4c')][_0x0788('0x51')]));_0x1ab634[_0x0788('0x50')]=_0x1ab634['attributes'][_0x0788('0x52')]?_0x1ab634[_0x0788('0x50')]:_0x15b90c[_0x0788('0x4f')];if(!_0x2737d8[_0x0788('0x4c')][_0x0788('0x53')]('nolimit')){_0x1ab634['limit']=qs[_0x0788('0x30')](_0x2737d8[_0x0788('0x4c')]['limit']);_0x1ab634[_0x0788('0x33')]=qs['offset'](_0x2737d8[_0x0788('0x4c')][_0x0788('0x33')]);}_0x1ab634[_0x0788('0x54')]=qs[_0x0788('0x55')](_0x2737d8[_0x0788('0x4c')][_0x0788('0x55')]);_0x1ab634[_0x0788('0x56')]=qs[_0x0788('0x4d')](_['pick'](_0x2737d8[_0x0788('0x4c')],_0x15b90c[_0x0788('0x4d')]),_0x15c618);var _0x3f2f1b=[];var _0x5ef557=squel[_0x0788('0x57')]()[_0x0788('0x58')]('id')['field'](_0x0788('0x39'))[_0x0788('0x58')](_0x0788('0x59'))[_0x0788('0x5a')](_0x0788('0x5b'));var _0x347cc8=squel['select']()['field'](_0x0788('0x5c'))[_0x0788('0x58')]('u.fullname')[_0x0788('0x58')](_0x0788('0x5d'))[_0x0788('0x5a')](_0x0788('0x5e'),'ui')[_0x0788('0x5f')](_0x0788('0x60'),'u',_0x0788('0x61'));var _0xeedd30=squel[_0x0788('0x57')]()[_0x0788('0x5a')](_0x0788('0x62'),'i')[_0x0788('0x5f')]('cm_contacts','c',_0x0788('0x63'))[_0x0788('0x5f')](_0x0788('0x60'),'o','o.id\x20=\x20i.UserId')[_0x0788('0x5f')](_0x0788('0x64'),'a','a.id\x20=\x20i.ChatWebsiteId')['left_join'](_0x0788('0x65'),'me',_0x0788('0x66'))[_0x0788('0x5f')](_0x0788('0x67'),'it',_0x0788('0x68'))[_0x0788('0x5f')]('tools_tags','t',_0x0788('0x69'));var _0x3be076=squel[_0x0788('0x6a')]();var _0x47be71=[];var _0x533f71=squel[_0x0788('0x6a')]();var _0x5419d9;if(_0x2737d8[_0x0788('0x4c')][_0x0788('0x6b')]){_0x5419d9=as[_0x0788('0x6c')](_0x2737d8[_0x0788('0x4c')][_0x0788('0x6b')]);var _0x348d25=_0x5419d9[_0x0788('0x6d')];for(var _0x29c912=0x0;_0x29c912<_0x5419d9[_0x0788('0x6e')][_0x0788('0x52')];_0x29c912++){var _0x59fcbc=_0x5419d9[_0x0788('0x6e')][_0x29c912];var _0x446170='i';var _0x602e3b=_[_0x0788('0x6f')](_0x15c618,['name',_0x59fcbc[_0x0788('0x58')]]);if(!_0x602e3b){switch(_0x59fcbc[_0x0788('0x58')]){case _0x0788('0x70'):if(_0x59fcbc[_0x0788('0x71')]==0x1){_0xeedd30[_0x0788('0x72')]('`'+_0x59fcbc['field']+_0x0788('0x73'));}else{_0xeedd30['having']('`'+_0x59fcbc[_0x0788('0x58')]+_0x0788('0x74'));}break;case _0x0788('0x75'):if(_0x59fcbc[_0x0788('0x76')]===_0x0788('0x77')){if(_0x59fcbc[_0x0788('0x71')][_0x0788('0x42')]('\x20')[_0x0788('0x52')]>0x1){_0x3be076[_0x348d25](_0x0788('0x78'),qs['getFullTextValue'](_0x59fcbc[_0x0788('0x71')]),null);}else{var _0x2dea6c='%'+_0x59fcbc[_0x0788('0x71')]+'%';_0x3be076[_0x348d25]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2dea6c,_0x2dea6c,_0x2dea6c);}}else{_0x602e3b=_['find'](_0x15c618,[_0x0788('0x39'),_0x0788('0x79')]);_0x59fcbc[_0x0788('0x58')]='ContactId';_0x35c612=as[_0x0788('0x7a')](_0x446170,_0x602e3b[_0x0788('0x4a')],_0x59fcbc);_0x3be076[_0x348d25](_0x35c612[_0x0788('0x7b')],_0x35c612[_0x0788('0x71')]['start'],_0x35c612['value']['end']);}break;case _0x0788('0x7c'):var _0x2a55f2=_0x59fcbc[_0x0788('0x71')]['split'](',')['map'](function(_0xaa2d4d){return Number(_0xaa2d4d);});_0x2a55f2['forEach'](function(_0x955bfa){_0x533f71['or'](_0x0788('0x7d'),'%,'+_0x955bfa+',%');});_0x47be71=_[_0x0788('0x7e')](_0x47be71,_0x2a55f2);break;case _0x0788('0x7f'):if(_0x59fcbc[_0x0788('0x76')]===_0x0788('0x77')){_0x3be076[_0x348d25](_0x0788('0x80'),'%'+_0x59fcbc[_0x0788('0x71')]+'%',null);}else{_0x602e3b=_[_0x0788('0x6f')](_0x15c618,[_0x0788('0x39'),'UserId']);_0x59fcbc[_0x0788('0x58')]=_0x0788('0x81');_0x35c612=as['buildExpression'](_0x446170,_0x602e3b['type'],_0x59fcbc);_0x3be076[_0x348d25](_0x35c612[_0x0788('0x7b')],_0x35c612[_0x0788('0x71')][_0x0788('0x82')],_0x35c612[_0x0788('0x71')][_0x0788('0x2e')]);}break;case _0x0788('0x83'):_0x35c612=as['buildExpression']('me',null,_0x59fcbc);_0x3be076[_0x348d25](_0x35c612[_0x0788('0x7b')],_0x35c612[_0x0788('0x71')][_0x0788('0x82')],_0x35c612[_0x0788('0x71')]['end']);break;}}else{var _0x35c612=as[_0x0788('0x7a')](_0x446170,_0x602e3b[_0x0788('0x4a')],_0x59fcbc);_0x3be076[_0x348d25](_0x35c612[_0x0788('0x7b')],_0x35c612['value']['start'],_0x35c612[_0x0788('0x71')][_0x0788('0x2e')]);}}}else{var _0x5513f7=_(_0x2737d8[_0x0788('0x4c')])[_0x0788('0x4b')]()[_0x0788('0x46')](function(_0x2b10fe){return _[_0x0788('0x84')](_0x15c618,[_0x0788('0x39'),_0x2b10fe])?_0x2b10fe:undefined;})['compact']()[_0x0788('0x71')]();if(!_[_0x0788('0x85')](_0x5513f7)){_0x5513f7[_0x0788('0x43')](function(_0x515dd8){if(_0x515dd8==='ChatWebsiteId'){_0xeedd30[_0x0788('0x56')]('i.ChatWebsiteId\x20IN\x20?',[][_0x0788('0x86')](_0x2737d8[_0x0788('0x4c')][_0x515dd8]));}else if(_0x515dd8===_0x0788('0x87')){var _0xa4b3f8=JSON[_0x0788('0x88')](_0x2737d8[_0x0788('0x4c')][_0x515dd8])[_0x0788('0x89')];var _0x216ea9=JSON[_0x0788('0x88')](_0x2737d8['query'][_0x515dd8])[_0x0788('0x8a')];_0xeedd30[_0x0788('0x56')](_0x0788('0x8b'),_0xa4b3f8,_0x216ea9);}else{if(_0x2737d8['query'][_0x515dd8]===_0x0788('0x8c')){_0xeedd30[_0x0788('0x56')]('i.'+_0x515dd8+_0x0788('0x8d'));}else{_0xeedd30['where']('i.'+_0x515dd8+_0x0788('0x8e'),_0x2737d8[_0x0788('0x4c')][_0x515dd8]);}}});}if(_0x2737d8[_0x0788('0x4c')][_0x0788('0x8f')]){if(_0x2737d8[_0x0788('0x4c')][_0x0788('0x8f')]==0x1){_0xeedd30[_0x0788('0x72')](_0x0788('0x90'));}else{_0xeedd30[_0x0788('0x72')]('`unreadMessages`\x20>\x200');}}if(_0x2737d8[_0x0788('0x4c')][_0x0788('0x91')]){_0x47be71=_[_0x0788('0x92')](_0x2737d8[_0x0788('0x4c')][_0x0788('0x91')])?_0x2737d8['query'][_0x0788('0x91')]:new Array(_0x2737d8[_0x0788('0x4c')][_0x0788('0x91')]);_0x47be71['forEach'](function(_0x1788d1){_0x533f71['or'](_0x0788('0x7d'),'%,'+_0x1788d1+',%');});}if(_0x2737d8[_0x0788('0x4c')][_0x0788('0x93')]){var _0x2b74df=_0x2737d8['query'][_0x0788('0x93')][_0x0788('0x94')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x0788('0x95')](_0x2b74df)){_0x3be076['or'](_0x0788('0x96'),_0x2b74df+'%');}else{_0x3be076['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0788('0x97')](_0x2b74df))['or'](_0x0788('0x98'),_0x2b74df+'%');}}}_0xeedd30[_0x0788('0x56')](_0x3be076);_0xeedd30['group'](_0x0788('0x99'));var _0x42c537={'type':db[_0x0788('0x9a')]['QueryTypes'][_0x0788('0x9b')],'raw':!![]};var _0x1b3046=_0xeedd30[_0x0788('0x9c')]();_0x1b3046[_0x0788('0x58')](_0x0788('0x99'));_0x1b3046[_0x0788('0x58')](_0x0788('0x9d'),_0x0788('0x70'));if(_0x1ab634['order']){_0x1ab634[_0x0788('0x54')][_0x0788('0x43')](function(_0x121f1d){var _0x31c921=_0x121f1d[0x0]==='contactName'?_0x121f1d[0x0]:'i.'+_0x121f1d[0x0];_0xeedd30['order'](_0x31c921,_0x121f1d[0x1]===_0x0788('0x9e')?![]:!![]);});}if(!_[_0x0788('0x85')](_0x47be71)){_0xeedd30['having'](_0x533f71);_0x1b3046[_0x0788('0x56')](_0x0788('0x9f'),_0x47be71);}BPromise[_0x0788('0xa0')]()['then'](function(){if(!_0x5419d9){if(_0x2737d8['query'][_0x0788('0xa1')])return;_0x1b3046[_0x0788('0x56')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0xeedd30['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x2737d8[_0x0788('0xa2')][_0x0788('0xa3')]!=='agent')return;return _0x2737d8[_0x0788('0xa2')][_0x0788('0xa4')]({'attributes':['id'],'raw':!![]})[_0x0788('0x23')](function(_0x41fe7a){if(_[_0x0788('0x85')](_0x41fe7a)){_0x1b3046['where'](_0x0788('0xa5'));_0xeedd30['where'](_0x0788('0xa5'));}else{_0x1b3046['where'](_0x0788('0xa6'),_[_0x0788('0x46')](_0x41fe7a,'id'));_0xeedd30[_0x0788('0x56')](_0x0788('0xa6'),_[_0x0788('0x46')](_0x41fe7a,'id'));}});})[_0x0788('0x23')](function(){if(_0x2737d8[_0x0788('0xa2')][_0x0788('0xa3')]===_0x0788('0xa7')&&!_0x5419d9&&!_0x2737d8[_0x0788('0x4c')][_0x0788('0xa1')])return[];return db[_0x0788('0xa8')][_0x0788('0x4c')](_0x1b3046['toString'](),_0x42c537);})['then'](function(_0x50363e){_0x4bd0d9[_0x0788('0x32')]=_0x50363e[_0x0788('0x52')];if(_0x4bd0d9[_0x0788('0x32')]===0x0)return[];return db[_0x0788('0xa8')][_0x0788('0x4c')](_0x5ef557[_0x0788('0xa9')](),_0x42c537)[_0x0788('0x23')](function(_0x16838d){_0x3f2f1b=_[_0x0788('0xaa')](_0x16838d,'id');_0x42c537=_[_0x0788('0x3b')](_0x42c537,{'model':db[_0x0788('0x47')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2737d8['query']['fields']){_0x1ab634[_0x0788('0x50')][_0x0788('0x43')](function(_0x104a70){_0xeedd30[_0x0788('0x58')]('i.'+_0x104a70);});}else{_0xeedd30[_0x0788('0x58')](_0x0788('0x9d'),_0x0788('0x70'));_0xeedd30[_0x0788('0x58')]('a.key','Account.key');_0xeedd30[_0x0788('0x58')](_0x0788('0xab'),_0x0788('0xac'));_0xeedd30[_0x0788('0x58')](_0x0788('0xad'),_0x0788('0xae'));_0xeedd30['field'](_0x0788('0xaf'));_0xeedd30[_0x0788('0x58')](_0x0788('0xb0'),_0x0788('0xb1'));_0xeedd30[_0x0788('0x58')](_0x0788('0xb2'),_0x0788('0xb3'));_0xeedd30[_0x0788('0x58')](_0x0788('0xb4'),'Contact.email');_0xeedd30[_0x0788('0x58')](_0x0788('0xb5'),_0x0788('0xb6'));_0xeedd30[_0x0788('0x58')](_0x0788('0xb7'),_0x0788('0xb8'));_0xeedd30['field'](_0x0788('0xb9'),_0x0788('0xba'));_0xeedd30[_0x0788('0x58')](_0x0788('0xbb'),_0x0788('0xbc'));_0xeedd30[_0x0788('0x58')](_0x0788('0xbd'),_0x0788('0xbe'));_0xeedd30[_0x0788('0x58')](_0x0788('0xbf'),'TagIds');}if(_0x1ab634[_0x0788('0x30')])_0xeedd30['limit'](_0x1ab634[_0x0788('0x30')]);if(_0x1ab634['offset'])_0xeedd30[_0x0788('0x33')](_0x1ab634['offset']);return db[_0x0788('0xa8')][_0x0788('0x4c')](_0xeedd30[_0x0788('0xa9')](),_0x42c537);})[_0x0788('0x23')](function(_0x5242eb){if(_0x5242eb[_0x0788('0x52')]>0x0)_0x347cc8[_0x0788('0x56')](_0x0788('0xc0'),_['map'](_0x5242eb,'id'));return db[_0x0788('0xa8')][_0x0788('0x4c')](_0x347cc8['toString'](),_0x42c537)[_0x0788('0x23')](function(_0x4645aa){var _0x37e9a9=_[_0x0788('0xc1')](_0x4645aa,_0x0788('0xc2'));var _0xab471b=[];_0x5242eb[_0x0788('0x43')](function(_0x563533){_0xab471b[_0x0788('0x44')](updateChatInteraction(_0x563533,_0x3f2f1b,_0x37e9a9));});return BPromise[_0x0788('0xc3')](_0xab471b);});});})[_0x0788('0x23')](function(_0x3f3e06){_0x4bd0d9[_0x0788('0xc4')]=_0x3f3e06;return _0x4bd0d9;})[_0x0788('0x23')](respondWithFilteredResult(_0x1928f3,_0x1ab634))[_0x0788('0x2b')](handleError(_0x1928f3,null));};exports[_0x0788('0xc5')]=function(_0x5761b1,_0x5130c4){var _0x26233b={'raw':![],'where':{'id':_0x5761b1[_0x0788('0xc6')]['id']}},_0x42f6df={};_0x42f6df[_0x0788('0x4f')]=_[_0x0788('0x4b')](db[_0x0788('0x47')][_0x0788('0x48')]);_0x42f6df['query']=_[_0x0788('0x4b')](_0x5761b1['query']);_0x42f6df['filters']=_[_0x0788('0x4e')](_0x42f6df[_0x0788('0x4f')],_0x42f6df['query']);_0x26233b[_0x0788('0x50')]=_[_0x0788('0x4e')](_0x42f6df[_0x0788('0x4f')],qs[_0x0788('0x51')](_0x5761b1[_0x0788('0x4c')][_0x0788('0x51')]));_0x26233b['attributes']=_0x26233b[_0x0788('0x50')][_0x0788('0x52')]?_0x26233b['attributes']:_0x42f6df[_0x0788('0x4f')];if(_0x5761b1[_0x0788('0x4c')]['includeAll']){_0x26233b[_0x0788('0xc7')]=[{'all':!![]}];}_0x26233b=_[_0x0788('0x3b')]({},_0x26233b,_0x5761b1[_0x0788('0xc8')]);return db[_0x0788('0x47')][_0x0788('0x6f')](_0x26233b)[_0x0788('0x23')](handleEntityNotFound(_0x5130c4,null))[_0x0788('0x23')](respondWithResult(_0x5130c4,null))['catch'](handleError(_0x5130c4,null));};exports[_0x0788('0xc9')]=function(_0x2e0529,_0x1f9944){return db[_0x0788('0x47')]['create'](_0x2e0529[_0x0788('0x83')],{})[_0x0788('0x23')](respondWithResult(_0x1f9944,0xc9))['catch'](handleError(_0x1f9944,null));};exports['update']=function(_0x691225,_0x15a70b){if(_0x691225[_0x0788('0x83')]['id']){delete _0x691225[_0x0788('0x83')]['id'];}return db[_0x0788('0x47')][_0x0788('0x6f')]({'where':{'id':_0x691225['params']['id']}})[_0x0788('0x23')](handleEntityNotFound(_0x15a70b,null))[_0x0788('0x23')](saveUpdates(_0x691225[_0x0788('0x83')],null))[_0x0788('0x23')](respondWithResult(_0x15a70b,null))[_0x0788('0x2b')](handleError(_0x15a70b,null));};exports[_0x0788('0xca')]=function(_0xc5e64a,_0x3539d4){return db[_0x0788('0x47')][_0x0788('0x6f')]({'where':{'id':_0xc5e64a[_0x0788('0xc6')]['id']}})[_0x0788('0x23')](handleEntityNotFound(_0x3539d4,null))[_0x0788('0x23')](removeEntity(_0x3539d4,null))[_0x0788('0x2b')](handleError(_0x3539d4,null));};exports[_0x0788('0xcb')]=function(_0x150a05,_0x1e0fb7){return db['ChatInteraction'][_0x0788('0xcb')]()[_0x0788('0x23')](respondWithResult(_0x1e0fb7,null))[_0x0788('0x2b')](handleError(_0x1e0fb7,null));};exports[_0x0788('0xcc')]=function(_0x57b44e,_0x191e15){var _0x5d0919=_0x57b44e[_0x0788('0xc6')]['id'];var _0x563e4c;var _0x51da2c;var _0x34a12a;return db[_0x0788('0x47')]['findOne']({'where':{'id':_0x5d0919}})[_0x0788('0x23')](function(_0x522e02){_0x563e4c=_0x522e02;return db[_0x0788('0xcd')]['findOne']({'where':{'id':_0x522e02[_0x0788('0xa1')]},'attributes':['id',_0x0788('0xce'),_0x0788('0xcf'),_0x0788('0xd0'),_0x0788('0xd1'),_0x0788('0xd2')],'raw':!![]});})['then'](function(_0x473491){if(_0x473491&&_0x473491['vidaooApiKey']&&_0x473491[_0x0788('0xcf')]){_0x51da2c=_0x473491;var _0x1222f8={'interaction':{'id':_0x5d0919},'agent':{'id':_0x57b44e['user']['id'],'name':_0x57b44e['user']['name'],'fullname':_0x57b44e[_0x0788('0xa2')]['fullname'],'email':_0x57b44e['user']['email']},'contact':_0x57b44e['body']['contact'],'account':_0x57b44e['body'][_0x0788('0x3e')]};var _0x3c2aa3={'rejectUnauthorized':![],'method':'POST','url':_0x0788('0xd3'),'headers':{'X-APIKEY':_0x473491['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x57b44e[_0x0788('0xa2')]['email']],'buttons':null,'topic':_0x51da2c[_0x0788('0xd0')],'note':_[_0x0788('0xd4')](_0x51da2c[_0x0788('0xd1')])?null:getMustacheRender(_0x51da2c[_0x0788('0xd1')],_0x1222f8),'metadata':null},'redirect':_0x0788('0xd5'),'json':!![]};try{if(!_[_0x0788('0xd4')](_0x51da2c[_0x0788('0xd2')])){var _0x37439f=getMustacheRender(_0x51da2c[_0x0788('0xd2')],_0x1222f8);var _0xf87649=JSON['parse'](_0x37439f);_0x3c2aa3[_0x0788('0x83')]['metadata']=_0xf87649;}}catch(_0x3bd7f3){throw new db['Sequelize']['ValidationError'](_0x0788('0xd6'));}return rp(_0x3c2aa3);}else{throw new db[(_0x0788('0x9a'))][(_0x0788('0xd7'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x0788('0x23')](function(_0x1b52f6){_0x34a12a=_0x1b52f6;if(_0x34a12a['id']){var _0x5be647={'body':_0x34a12a['join_url'],'ChatWebsiteId':_0x51da2c['id'],'ChatInteractionId':_0x563e4c['id'],'direction':_0x0788('0xd8'),'UserId':_0x57b44e[_0x0788('0xa2')]['id']};return db[_0x0788('0xd9')]['create'](_0x5be647,{});}else{throw new db['Sequelize'][(_0x0788('0xd7'))](_0x0788('0xda'));}})[_0x0788('0x23')](function(){return _0x563e4c[_0x0788('0xdb')]({'vidaooSessionId':_0x34a12a['id']});})[_0x0788('0x23')](respondWithResult(_0x191e15,null))[_0x0788('0x2b')](handleError(_0x191e15,null));};exports[_0x0788('0xdc')]=function(_0x252780,_0x3d3272){if(_0x252780['body']['id']){delete _0x252780[_0x0788('0x83')]['id'];}return db['ChatInteraction'][_0x0788('0x6f')]({'where':{'id':_0x252780[_0x0788('0xc6')]['id']},'include':[{'model':db[_0x0788('0xdd')],'as':_0x0788('0x75')}]})[_0x0788('0x23')](handleEntityNotFound(_0x3d3272,null))['then'](saveUpdates(_0x252780[_0x0788('0x83')],null))[_0x0788('0x23')](respondWithResult(_0x3d3272,null))['catch'](handleError(_0x3d3272,null));};exports[_0x0788('0xde')]=function(_0x881d27,_0x47ce3c,_0x1c9b6f){if(_0x881d27['body']['id']){delete _0x881d27[_0x0788('0x83')]['id'];}return db[_0x0788('0x47')]['find']({'where':{'id':_0x881d27[_0x0788('0xc6')]['id']}})[_0x0788('0x23')](function(_0x207b55){if(!_0x207b55){logger[_0x0788('0x27')](_0x0788('0xdf'),_0x0788('0xde'),0x194,_0x0788('0xe0'));_0x47ce3c[_0x0788('0x2c')](0x194);}else{if(_0x207b55['UserId']){throw new db[(_0x0788('0x9a'))][(_0x0788('0xd7'))](_0x0788('0xe1'));}}return _0x207b55;})['then'](function(_0x5ac0bc){if(_0x5ac0bc){return _0x5ac0bc[_0x0788('0xe2')]({'closed':_0x881d27[_0x0788('0x83')][_0x0788('0xe3')],'disposition':_0x881d27[_0x0788('0x83')][_0x0788('0xe4')]})[_0x0788('0x23')](function(_0x48e56d){return _0x48e56d;});}})[_0x0788('0x23')](function(_0x227eaf){return respondWithRpcPromise(_0x0788('0xe5'),_0x0788('0xde'),_0x881d27[_0x0788('0x83')],client9004);})[_0x0788('0x23')](respondWithResult(_0x47ce3c,null))[_0x0788('0x2b')](handleError(_0x47ce3c,null));};exports[_0x0788('0xe6')]=function(_0x1fc335,_0x27c428,_0x1ce4f2){_0x1fc335[_0x0788('0x83')][_0x0788('0x39')]=_0x1fc335[_0x0788('0xe7')][_0x0788('0xe8')];_0x1fc335[_0x0788('0x83')][_0x0788('0xe9')]=_0x1fc335[_0x0788('0xe7')][_0x0788('0xea')];_0x1fc335[_0x0788('0x83')][_0x0788('0x4a')]=_0x1fc335['file'][_0x0788('0xeb')];return db[_0x0788('0xec')][_0x0788('0xc9')](_0x1fc335[_0x0788('0x83')])['then'](respondWithResult(_0x27c428,0xc9))[_0x0788('0x2b')](handleError(_0x27c428,null));};exports[_0x0788('0xed')]=function(_0x5eb3f1,_0xb63553,_0x4a34e2){return db['ChatInteraction']['findOne']({'where':{'id':_0x5eb3f1['params']['id']},'raw':!![]})[_0x0788('0x23')](handleEntityNotFound(_0xb63553,null))[_0x0788('0x23')](function(_0x4cc536){if(_0x4cc536){if(_0x4cc536[_0x0788('0xe3')]){return _0xb63553[_0x0788('0x2d')](0x193)[_0x0788('0x2f')]({'status':0x193,'message':_0x0788('0xee')});}return db[_0x0788('0xec')][_0x0788('0xef')]({'where':{'id':_0x5eb3f1[_0x0788('0x4c')][_0x0788('0xf0')]},'raw':!![]})[_0x0788('0x23')](handleEntityNotFound(_0xb63553,null));}})['then'](function(_0x2047bc){if(_0x2047bc){var _0x38fd71=_0x2047bc['ChatOfflineMessageId']!==null;var _0x224ef9=path[_0x0788('0xf1')](config[_0x0788('0xf2')],_0x0788('0xf3'));if(_0x38fd71){_0x224ef9=path[_0x0788('0xf1')](_0x224ef9,_0x0788('0xf4'));}var _0x2399b9=path[_0x0788('0xf1')](_0x224ef9,_0x2047bc[_0x0788('0xe9')]);return _0xb63553[_0x0788('0xf5')](_0x2399b9);}})[_0x0788('0x2b')](handleError(_0xb63553,null));};exports[_0x0788('0xf6')]=function(_0x31c746,_0x4f696c){var _0x11de9c=null;var _0xf690e0=null;var _0x4a492c=null;var _0x523faa=null;if(_0x31c746[_0x0788('0x83')]['id']){delete _0x31c746[_0x0788('0x83')]['id'];}if(_0x31c746['body'][_0x0788('0xf7')]){_0x523faa=path[_0x0788('0xf1')](config[_0x0788('0xf2')],'server/files/chat/upload/',util['format'](_0x0788('0xf8'),Date[_0x0788('0xf9')]()));_0x31c746['body']['pathTranscript']=_0x523faa;}return db[_0x0788('0x47')][_0x0788('0x6f')]({'where':{'id':_0x31c746['params']['id']},'include':[{'model':db['ChatMessage'],'as':_0x0788('0xfa'),'include':[{'model':db[_0x0788('0x7f')],'as':'User'}]}]})[_0x0788('0x23')](handleEntityNotFound(_0x4f696c,null))[_0x0788('0x23')](saveUpdates(_0x31c746['body'],null))[_0x0788('0x23')](function(_0x21be45){if(_0x21be45){_0x11de9c=_0x21be45;return db[_0x0788('0xcd')][_0x0788('0x6f')]({'where':{'id':_0x11de9c[_0x0788('0xa1')]}});}})['then'](function(_0x36acad){if(_0x36acad){_0x4a492c=_0x36acad;return db[_0x0788('0xdd')][_0x0788('0x6f')]({'where':{'id':_0x11de9c[_0x0788('0x79')]}});}})[_0x0788('0x23')](function(_0x569b4d){if(_0x569b4d){_0xf690e0=_0x569b4d;if(_0x523faa){var _0x31ffc7=null;for(var _0x59aece=0x1;_0x59aece<_0x11de9c['Messages'][_0x0788('0x52')];++_0x59aece){_0x31ffc7=_0x11de9c[_0x0788('0xfa')][_0x59aece];var _0x3787d3=_0x31ffc7[_0x0788('0x81')]?util['format'](_0x0788('0xfb'),_0x4a492c[_0x0788('0xfc')],_0x31ffc7[_0x0788('0x81')]):'System';var _0x3ea229=_0x31c746[_0x0788('0x83')][_0x0788('0xfd')]||util[_0x0788('0xfe')](_0x0788('0xfb'),'Visitor',_0x31ffc7[_0x0788('0x79')]);switch(_0x4a492c['agentIdentifier']){case _0x0788('0xff'):_0x3787d3=_0x31ffc7[_0x0788('0x81')]?util[_0x0788('0xfe')](_0x0788('0xfb'),_0x4a492c[_0x0788('0xfc')],_0x31ffc7['UserId']):_0x0788('0x100');break;case'agent_alias':_0x3787d3=_0x31ffc7[_0x0788('0x81')]?_0x31ffc7['User'][_0x0788('0x101')]||_0x31ffc7[_0x0788('0x7f')]['fullname']:_0x0788('0x100');break;case _0x0788('0x102'):_0x3787d3=_0x31ffc7[_0x0788('0x81')]?_0x31ffc7[_0x0788('0x7f')][_0x0788('0x3f')]:_0x0788('0x100');break;default:_0x3787d3=_0x31ffc7[_0x0788('0x81')]?util[_0x0788('0xfe')](_0x0788('0xfb'),_0x4a492c[_0x0788('0xfc')],_0x31ffc7[_0x0788('0x81')]):'System';}var _0x303d5=util['format'](_0x0788('0x103'),moment(_0x31ffc7['createdAt'])[_0x0788('0xfe')](_0x0788('0x104')),_0x31ffc7['direction']==='in'?_0x3ea229:_0x3787d3,_0x31ffc7['body']);if(!_0x31ffc7['secret']){fs[_0x0788('0x105')](_0x523faa,_0x303d5);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x0788('0x106')],'as':_0x0788('0x107'),'raw':!![]}]});}}})[_0x0788('0x23')](function(_0x5c5464){if(_0x5c5464&&_0x5c5464[_0x0788('0x107')]&&_0x31c746[_0x0788('0x83')]){var _0x14420b={'tls':{'rejectUnauthorized':![]}};if(_0x5c5464['Smtp']['service']){_0x14420b[_0x0788('0x108')]=_0x5c5464[_0x0788('0x107')][_0x0788('0x108')];}else{_0x14420b['host']=_0x5c5464[_0x0788('0x107')][_0x0788('0x109')];_0x14420b[_0x0788('0x10a')]=_0x5c5464['Smtp']['port'];_0x14420b[_0x0788('0x10b')]=_0x5c5464['Smtp'][_0x0788('0x10b')];}if(_0x5c5464[_0x0788('0x107')]['authentication']){_0x14420b['auth']={'user':_0x5c5464[_0x0788('0x107')][_0x0788('0xa2')],'pass':_0x5c5464['Smtp'][_0x0788('0x10c')]};}return respondWithRpcPromise(_0x0788('0x10d'),'sendMail',{'account':_0x14420b,'message':{'from':util[_0x0788('0xfe')](_0x0788('0x10e'),_0x5c5464[_0x0788('0x39')],_0x5c5464[_0x0788('0x10f')]||_0x5c5464['Smtp'][_0x0788('0xa2')]),'to':_0x31c746[_0x0788('0x83')][_0x0788('0xf7')],'subject':_0x0788('0x110'),'text':util[_0x0788('0xfe')](_0x0788('0x111'),_0x31c746[_0x0788('0x83')][_0x0788('0xf7')]),'attachments':[{'path':_0x523faa}]}})[_0x0788('0x23')](function(){return _0x11de9c;})['catch'](function(_0x1b5b80){console[_0x0788('0x27')](_0x1b5b80);});}else{return _0x11de9c;}})['then'](respondWithStatusCode(_0x4f696c,0xc8))[_0x0788('0x2b')](handleError(_0x4f696c,null));};exports[_0x0788('0x112')]=function(_0x5522e3,_0x5f1a46,_0x248f60){return db[_0x0788('0xd9')][_0x0788('0x6f')]({'where':{'id':_0x5522e3['params']['id']}})[_0x0788('0x23')](handleEntityNotFound(_0x5f1a46,null))[_0x0788('0x23')](function(_0x36d7f9){if(_0x36d7f9){return _0x36d7f9['addMessage'](_0x5522e3[_0x0788('0x83')][_0x0788('0x113')],_['omit'](_0x5522e3['body'],['ids','id'])||{});}})[_0x0788('0x23')](respondWithResult(_0x5f1a46,null))[_0x0788('0x2b')](handleError(_0x5f1a46,null));};exports[_0x0788('0x114')]=function(_0x20f429,_0x364f26,_0x351665){var _0x1ba9fb={'raw':![],'where':{}};var _0x56b11c={};var _0x4f36bd={'count':0x0,'rows':[]};return db[_0x0788('0x47')][_0x0788('0xef')]({'where':{'id':_0x20f429[_0x0788('0xc6')]['id']}})['then'](handleEntityNotFound(_0x364f26,null))[_0x0788('0x23')](function(_0x1c7980){if(_0x1c7980){_0x56b11c[_0x0788('0x4f')]=_[_0x0788('0x4b')](db['ChatMessage']['rawAttributes']);_0x56b11c[_0x0788('0x4c')]=_[_0x0788('0x4b')](_0x20f429[_0x0788('0x4c')]);_0x56b11c[_0x0788('0x4d')]=_[_0x0788('0x4e')](_0x56b11c[_0x0788('0x4f')],_0x56b11c[_0x0788('0x4c')]);_0x1ba9fb[_0x0788('0x50')]=_[_0x0788('0x4e')](_0x56b11c['model'],qs[_0x0788('0x51')](_0x20f429[_0x0788('0x4c')][_0x0788('0x51')]));_0x1ba9fb[_0x0788('0x50')]=_0x1ba9fb[_0x0788('0x50')][_0x0788('0x52')]?_0x1ba9fb[_0x0788('0x50')]:_0x56b11c['model'];if(!_0x20f429[_0x0788('0x4c')][_0x0788('0x53')](_0x0788('0x115'))){_0x1ba9fb['limit']=qs[_0x0788('0x30')](_0x20f429[_0x0788('0x4c')][_0x0788('0x30')]);_0x1ba9fb[_0x0788('0x33')]=qs[_0x0788('0x33')](_0x20f429['query']['offset']);}_0x1ba9fb['order']=qs[_0x0788('0x55')](_0x20f429[_0x0788('0x4c')][_0x0788('0x55')]);_0x1ba9fb[_0x0788('0x56')]=qs[_0x0788('0x4d')](_[_0x0788('0x116')](_0x20f429[_0x0788('0x4c')],_0x56b11c['filters']));_0x1ba9fb[_0x0788('0x56')][_0x0788('0xc2')]=_0x1c7980['id'];if(_0x20f429[_0x0788('0x4c')][_0x0788('0x93')]){_0x1ba9fb['where']=_[_0x0788('0x3b')](_0x1ba9fb[_0x0788('0x56')],{'$or':_[_0x0788('0x46')](_0x1ba9fb[_0x0788('0x50')],function(_0xccb2e6){var _0x4cc769={};_0x4cc769[_0xccb2e6]={'$like':'%'+_0x20f429[_0x0788('0x4c')][_0x0788('0x93')]+'%'};return _0x4cc769;})});}if(_0x20f429[_0x0788('0x4c')][_0x0788('0x89')]){var _0x4785ac=_0x20f429[_0x0788('0x4c')][_0x0788('0x89')][_0x0788('0x42')](',');var _0x4455dc={};_0x4455dc[_0x4785ac[0x0]]={'$gte':moment(_0x4785ac[0x1])['format'](_0x0788('0x117'))};_0x1ba9fb['where']=_[_0x0788('0x3b')](_0x1ba9fb[_0x0788('0x56')],_0x4455dc);}_0x1ba9fb=_[_0x0788('0x3b')]({},_0x1ba9fb,_0x20f429[_0x0788('0xc8')]);return db[_0x0788('0xd9')][_0x0788('0x32')]({'where':_0x1ba9fb[_0x0788('0x56')]})['then'](function(_0x3eb474){_0x4f36bd[_0x0788('0x32')]=_0x3eb474;if(_0x20f429['query'][_0x0788('0x118')]){_0x1ba9fb[_0x0788('0xc7')]=[{'all':!![]}];}return db[_0x0788('0xd9')]['findAll'](_0x1ba9fb);})['then'](function(_0x1aa86f){_0x4f36bd[_0x0788('0xc4')]=_0x1aa86f;return _0x4f36bd;});}})['then'](respondWithFilteredResult(_0x364f26,_0x1ba9fb))['catch'](handleError(_0x364f26,null));};exports[_0x0788('0x119')]=function(_0x4d6a60,_0x114658,_0x4b11b9){var _0x9af662={'where':{}},_0x257e1c={},_0x35a6bc={'count':0x0,'rows':[]};return db[_0x0788('0x47')]['findOne']({'where':{'id':_0x4d6a60['params']['id']}})[_0x0788('0x23')](handleEntityNotFound(_0x114658,null))[_0x0788('0x23')](function(_0x278a6f){if(_0x278a6f){_0x257e1c[_0x0788('0x4f')]=_['keys'](db[_0x0788('0xd9')][_0x0788('0x48')]);_0x257e1c[_0x0788('0x4c')]=_[_0x0788('0x4b')](_0x4d6a60['query']);_0x257e1c[_0x0788('0x4d')]=_[_0x0788('0x4e')](_0x257e1c['model'],_0x257e1c[_0x0788('0x4c')]);_0x9af662[_0x0788('0x50')]=_[_0x0788('0x4e')](_0x257e1c[_0x0788('0x4f')],qs[_0x0788('0x51')](_0x4d6a60[_0x0788('0x4c')]['fields']));_0x9af662[_0x0788('0x50')]=_0x9af662[_0x0788('0x50')][_0x0788('0x52')]?_0x9af662[_0x0788('0x50')]:_0x257e1c['model'];if(!_0x4d6a60[_0x0788('0x4c')]['hasOwnProperty'](_0x0788('0x115'))){_0x9af662['limit']=qs['limit'](_0x4d6a60[_0x0788('0x4c')][_0x0788('0x30')]);_0x9af662[_0x0788('0x33')]=qs[_0x0788('0x33')](_0x4d6a60[_0x0788('0x4c')][_0x0788('0x33')]);}_0x9af662[_0x0788('0x54')]=qs[_0x0788('0x55')](_0x4d6a60[_0x0788('0x4c')][_0x0788('0x55')]);_0x9af662['where']=qs['filters'](_['pick'](_0x4d6a60[_0x0788('0x4c')],_0x257e1c[_0x0788('0x4d')]));_0x9af662[_0x0788('0x56')][_0x0788('0xc2')]=_0x278a6f['id'];if(_0x4d6a60[_0x0788('0x4c')][_0x0788('0x93')]){_0x9af662[_0x0788('0x56')]=_[_0x0788('0x3b')](_0x9af662['where'],{'$or':_[_0x0788('0x46')](_0x9af662[_0x0788('0x50')],function(_0x4a4297){var _0x1fb846={};_0x1fb846[_0x4a4297]={'$like':'%'+_0x4d6a60[_0x0788('0x4c')][_0x0788('0x93')]+'%'};return _0x1fb846;})});}_0x9af662['where'][_0x0788('0x11a')]=![];if(_0x4d6a60[_0x0788('0x4c')]['id']){_0x9af662[_0x0788('0x56')]['id']={'$gt':_0x4d6a60[_0x0788('0x4c')]['id']};}_0x9af662=_[_0x0788('0x3b')]({},_0x9af662,_0x4d6a60[_0x0788('0xc8')]);return db[_0x0788('0xd9')][_0x0788('0x32')]({'where':_0x9af662[_0x0788('0x56')]})[_0x0788('0x23')](function(_0x292d07){_0x35a6bc[_0x0788('0x32')]=_0x292d07;_0x9af662[_0x0788('0xc7')]=[];if(_0x4d6a60[_0x0788('0x4c')][_0x0788('0x11b')]){_0x9af662['include'][_0x0788('0x44')]({'model':db[_0x0788('0x7f')],'as':_0x0788('0x7f'),'attributes':['id','fullname',_0x0788('0x101')]});}if(_0x4d6a60[_0x0788('0x4c')][_0x0788('0x118')]){_0x9af662['include']=[{'all':!![]}];}return db[_0x0788('0xd9')][_0x0788('0x11c')](_0x9af662);})['then'](function(_0xa44dc3){_0x35a6bc[_0x0788('0xc4')]=_0xa44dc3;return _0x35a6bc;});}})[_0x0788('0x23')](respondWithFilteredResult(_0x114658,_0x9af662))['catch'](handleError(_0x114658,null));};exports[_0x0788('0x11d')]=function(_0x5b0417,_0x4d5e94,_0x1fb141){return db[_0x0788('0x47')][_0x0788('0x6f')]({'where':{'id':_0x5b0417[_0x0788('0xc6')]['id']}})['then'](handleEntityNotFound(_0x4d5e94,null))[_0x0788('0x23')](function(_0x5bf415){if(_0x5bf415){return _0x5bf415['setTags'](_0x5b0417['body'][_0x0788('0x113')],_['omit'](_0x5b0417['body'],['ids','id'])||{})[_0x0788('0x11e')](function(){return db[_0x0788('0x7c')][_0x0788('0x11c')]({'attributes':['id',_0x0788('0x39'),_0x0788('0x59')],'where':{'id':_0x5b0417[_0x0788('0x83')][_0x0788('0x113')]}});})[_0x0788('0x23')](function(_0x109d90){socket[_0x0788('0x11f')](_0x0788('0x120'),{'id':Number(_0x5b0417[_0x0788('0xc6')]['id']),'tags':_0x109d90||[]});return{'id':Number(_0x5b0417[_0x0788('0xc6')]['id']),'tags':_0x109d90||[]};});}})['then'](respondWithResult(_0x4d5e94,null))[_0x0788('0x2b')](handleError(_0x4d5e94,null));};exports['removeTags']=function(_0x26343c,_0x30334c,_0x1d18bc){return db[_0x0788('0x47')][_0x0788('0x6f')]({'where':{'id':_0x26343c[_0x0788('0xc6')]['id']}})['then'](handleEntityNotFound(_0x30334c,null))[_0x0788('0x23')](function(_0x10266b){if(_0x10266b){return _0x10266b[_0x0788('0x121')](_0x26343c[_0x0788('0x4c')][_0x0788('0x113')]);}})[_0x0788('0x23')](respondWithStatusCode(_0x30334c,null))['catch'](handleError(_0x30334c,null));};exports['download']=function(_0x1fb76f,_0x17ca71){var _0xbae24f=moment()[_0x0788('0x122')]()[_0x0788('0xa9')]();var _0x525754=path['join'](config['root'],_0x0788('0x123'),_0x0788('0x124'),_0x0788('0x125'));var _0x2d51ef=path[_0x0788('0xf1')](config[_0x0788('0xf2')],_0x0788('0x123'),_0x0788('0x124'),_0x0788('0x126'));var _0x5ecd59=path['join'](_0x525754,_0xbae24f);var _0xf63471=util[_0x0788('0xfe')](_0x0788('0x127'),_0x1fb76f[_0x0788('0xc6')]['id'],_0xbae24f);var _0x390cdf=path[_0x0788('0xf1')](_0x525754,_0xf63471);var _0x40a75d=[];_0x40a75d[_0x0788('0x44')]({'model':db[_0x0788('0x7f')],'as':_0x0788('0x7f'),'attributes':['id',_0x0788('0x3f')],'raw':!![]});_0x40a75d[_0x0788('0x44')]({'model':db[_0x0788('0xdd')],'as':'Contact','attributes':['id',_0x0788('0x128'),_0x0788('0x129')],'raw':!![]});if(_0x1fb76f[_0x0788('0x4c')][_0x0788('0x126')]){_0x40a75d[_0x0788('0x44')]({'model':db[_0x0788('0xec')],'as':_0x0788('0xec'),'raw':!![]});}var _0x4cf323=[{'model':db[_0x0788('0xd9')],'as':_0x0788('0xfa'),'attributes':['id','body',_0x0788('0x87'),'direction',_0x0788('0x11a'),_0x0788('0x8f')],'include':_0x40a75d}];_0x4cf323['push']({'model':db[_0x0788('0xcd')],'as':'Account','attributes':['id',_0x0788('0x39')]});_0x4cf323[_0x0788('0x44')]({'model':db[_0x0788('0x7f')],'as':_0x0788('0x12a'),'attributes':['id',_0x0788('0x3f')]});return db['ChatInteraction'][_0x0788('0x6f')]({'where':{'id':_0x1fb76f['params']['id']},'include':_0x4cf323})['then'](handleEntityNotFound(_0x17ca71,null))[_0x0788('0x23')](function(_0x1fa39f){if(_0x1fa39f){var _0x19b030=_0x1fa39f[_0x0788('0x12b')]({'plain':!![]});fs[_0x0788('0x12c')](_0x5ecd59);var _0x35fc5b={'channel':'Chat','account':_0x19b030[_0x0788('0x12d')]['name'],'agent':_0x19b030[_0x0788('0x12a')]?_0x19b030[_0x0788('0x12a')][_0x0788('0x3f')]:'N.A.','createdAt':moment(_0x19b030['createdAt'])[_0x0788('0xfe')](_0x0788('0x117'))['toString'](),'closedAt':_0x19b030[_0x0788('0xe3')]?moment(_0x19b030[_0x0788('0x12e')])[_0x0788('0xfe')](_0x0788('0x117'))[_0x0788('0xa9')]():'','disposition':_0x19b030[_0x0788('0xe4')],'chatInfo':{'browser':_0x19b030[_0x0788('0x12f')],'os':_0x19b030['osName'],'referer':_0x19b030['referer'],'customerIp':_0x19b030['customerIp'],'customerPort':_0x19b030[_0x0788('0x130')]?_0x19b030['customerPort']:_0x0788('0x131')},'messages':_(_0x19b030[_0x0788('0xfa')])[_0x0788('0x132')]()[_0x0788('0x93')]({'secret':![]})[_0x0788('0x46')](function(_0x3ff416){if(_0x3ff416[_0x0788('0xec')]){var _0x7d6cf9=path[_0x0788('0xf1')](_0x2d51ef,_0x3ff416[_0x0788('0xec')][_0x0788('0xe9')]);if(fs['existsSync'](_0x7d6cf9)){fs[_0x0788('0x133')](_0x7d6cf9)['pipe'](fs[_0x0788('0x134')](path[_0x0788('0xf1')](_0x5ecd59,_0x3ff416[_0x0788('0xec')][_0x0788('0xe9')])));}}return{'date':moment(_0x3ff416[_0x0788('0x87')])[_0x0788('0xfe')](_0x0788('0x117'))[_0x0788('0xa9')](),'sender':_0x3ff416[_0x0788('0x135')]===_0x0788('0xd8')?_0x3ff416['User']?_0x3ff416[_0x0788('0x7f')][_0x0788('0x3f')]:_0x0788('0x100'):_0x3ff416[_0x0788('0x75')]['firstName']+(_0x3ff416[_0x0788('0x75')][_0x0788('0x129')]?'\x20'+_0x3ff416['Contact'][_0x0788('0x129')]:''),'body':_0x3ff416['Attachment']?_0x3ff416[_0x0788('0xec')]['basename']:_0x3ff416[_0x0788('0x83')],'direction':_0x3ff416[_0x0788('0x135')]===_0x0788('0xd8')?'A':'C','secret':_0x3ff416['secret'],'read':_0x3ff416[_0x0788('0x8f')],'attachment':_0x3ff416['Attachment']};})[_0x0788('0x71')]()};return ejs[_0x0788('0x136')](path[_0x0788('0xf1')](config[_0x0788('0xf2')],'server','views',_0x0788('0x137')),{'interaction':_0x35fc5b})['then'](function(_0x45962d){var _0x4cc133=path[_0x0788('0xf1')](_0x5ecd59,_0x0788('0x138')+_0x19b030['id']+'-'+_0xbae24f+_0x0788('0x139'));var _0x52452f={'path':_0x4cc133,'channel':_0x0788('0x13a'),'interactionId':_0x19b030['id']};return pdf[_0x0788('0x13b')](_0x45962d,_0x52452f);})[_0x0788('0x23')](function(){return new BPromise(function(_0xe2d72d,_0x5401a8){zipdir(_0x5ecd59,{'saveTo':_0x390cdf},function(_0x5b289e,_0x4191b4){if(_0x5b289e)return _0x5401a8(_0x5b289e);return _0xe2d72d(_0x4191b4);});})[_0x0788('0x23')](function(){return new BPromise(function(_0x5440c6,_0x2dbb74){rimraf(_0x5ecd59,function(_0x8a89c0){if(_0x8a89c0)_0x2dbb74(_0x8a89c0);return _0x5440c6();});});})['then'](function(){return _0x17ca71['download'](_0x390cdf,_0xf63471,function(_0x2487db){if(_0x2487db){console['log'](_0x0788('0x13c'),_0x2487db);}else{fs[_0x0788('0x13d')](_0x390cdf);}});});});}else{return _0x17ca71[_0x0788('0x2c')](0xc8);}})['catch'](handleError(_0x17ca71,null));};
\ No newline at end of file
index ee50445..3d39866 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdef4=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','save','update','getUsers','then','setDataValue','map','unreadMessages'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xdef4,0x18a));var _0x4def=function(_0x14eb9e,_0x29fe9e){_0x14eb9e=_0x14eb9e-0x0;var _0x4c59c4=_0xdef4[_0x14eb9e];return _0x4c59c4;};'use strict';var EventEmitter=require(_0x4def('0x0'));var ChatInteraction=require(_0x4def('0x1'))['db'][_0x4def('0x2')];var ChatMessage=require(_0x4def('0x1'))['db'][_0x4def('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4def('0x4'),'afterUpdate':_0x4def('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4c57ea){return function(_0x4a720f,_0x1c8dfd,_0x41feaa){_0x4a720f[_0x4def('0x6')]({'attributes':['id'],'raw':!![]})[_0x4def('0x7')](function(_0x515727){_0x4a720f[_0x4def('0x8')]('Users',_0x515727[_0x4def('0x9')](function(_0x21c129){return{'id':_0x21c129['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x4a720f['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x43a03f){_0x4a720f['setDataValue'](_0x4def('0xa'),_0x43a03f['length']);ChatInteractionEvents[_0x4def('0xb')](_0x4c57ea+':'+_0x4a720f['id'],_0x4a720f);ChatInteractionEvents[_0x4def('0xb')](_0x4c57ea,_0x4a720f);_0x41feaa(null);})['catch'](_0x41feaa(null));};}for(var e in events){if(events[_0x4def('0xc')](e)){var event=events[e];ChatInteraction[_0x4def('0xd')](e,emitEvent(event));}}module[_0x4def('0xe')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xf1fa=['map','findAll','then','unreadMessages','emit','catch','hasOwnProperty','hook','exports','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save','remove','setDataValue','Users'];(function(_0x5d303d,_0x4775b2){var _0x525013=function(_0x4bd0b5){while(--_0x4bd0b5){_0x5d303d['push'](_0x5d303d['shift']());}};_0x525013(++_0x4775b2);}(_0xf1fa,0x6f));var _0xaf1f=function(_0x1be311,_0x358d12){_0x1be311=_0x1be311-0x0;var _0x30559f=_0xf1fa[_0x1be311];return _0x30559f;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0xaf1f('0x0')];var ChatMessage=require(_0xaf1f('0x1'))['db'][_0xaf1f('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xaf1f('0x3')](0x0);var events={'afterCreate':_0xaf1f('0x4'),'afterUpdate':'update','afterDestroy':_0xaf1f('0x5')};function emitEvent(_0x4d0be8){return function(_0x3483ad,_0x154f3f,_0x1f430d){_0x3483ad['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x5e0a4a){_0x3483ad[_0xaf1f('0x6')](_0xaf1f('0x7'),_0x5e0a4a[_0xaf1f('0x8')](function(_0x2c4064){return{'id':_0x2c4064['id']};}));return ChatMessage[_0xaf1f('0x9')]({'where':{'ChatInteractionId':_0x3483ad['id'],'direction':'in','read':![]},'raw':!![]});})[_0xaf1f('0xa')](function(_0xe0f3d5){_0x3483ad[_0xaf1f('0x6')](_0xaf1f('0xb'),_0xe0f3d5['length']);ChatInteractionEvents[_0xaf1f('0xc')](_0x4d0be8+':'+_0x3483ad['id'],_0x3483ad);ChatInteractionEvents[_0xaf1f('0xc')](_0x4d0be8,_0x3483ad);_0x1f430d(null);})[_0xaf1f('0xd')](_0x1f430d(null));};}for(var e in events){if(events[_0xaf1f('0xe')](e)){var event=events[e];ChatInteraction[_0xaf1f('0xf')](e,emitEvent(event));}}module[_0xaf1f('0x10')]=ChatInteractionEvents;
\ No newline at end of file
index d387005..db47f94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e3d=['define','ChatInteraction','chat_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports'];(function(_0x5edd2f,_0x245dcd){var _0x37b39e=function(_0x42c1e7){while(--_0x42c1e7){_0x5edd2f['push'](_0x5edd2f['shift']());}};_0x37b39e(++_0x245dcd);}(_0x9e3d,0x1e9));var _0xd9e3=function(_0x55850c,_0x229051){_0x55850c=_0x55850c-0x0;var _0x32d952=_0x9e3d[_0x55850c];return _0x32d952;};'use strict';var _=require(_0xd9e3('0x0'));var util=require(_0xd9e3('0x1'));var logger=require('../../config/logger')(_0xd9e3('0x2'));var moment=require(_0xd9e3('0x3'));var BPromise=require(_0xd9e3('0x4'));var rp=require(_0xd9e3('0x5'));var fs=require('fs');var path=require(_0xd9e3('0x6'));var rimraf=require(_0xd9e3('0x7'));var config=require(_0xd9e3('0x8'));var attributes=require(_0xd9e3('0x9'));module[_0xd9e3('0xa')]=function(_0x41cc79,_0x2d2fb9){return _0x41cc79[_0xd9e3('0xb')](_0xd9e3('0xc'),attributes,{'tableName':_0xd9e3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2c8308,_0x50da69,_0x1ce0d0){if(_0x2c8308[_0xd9e3('0xe')]('closed')){_0x2c8308[_0xd9e3('0xf')]=moment()[_0xd9e3('0x10')](_0xd9e3('0x11'));}_0x1ce0d0(null,_0x2c8308);}},'charset':_0xd9e3('0x12'),'collate':_0xd9e3('0x13')});};
\ No newline at end of file
+var _0xe115=['../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise'];(function(_0x2d1b2e,_0x4a8299){var _0x583426=function(_0x3040e1){while(--_0x3040e1){_0x2d1b2e['push'](_0x2d1b2e['shift']());}};_0x583426(++_0x4a8299);}(_0xe115,0x160));var _0x5e11=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xe115[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require('lodash');var util=require(_0x5e11('0x0'));var logger=require(_0x5e11('0x1'))(_0x5e11('0x2'));var moment=require('moment');var BPromise=require(_0x5e11('0x3'));var rp=require(_0x5e11('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5e11('0x5'));var attributes=require(_0x5e11('0x6'));module[_0x5e11('0x7')]=function(_0x42a993,_0x9723d6){return _0x42a993[_0x5e11('0x8')](_0x5e11('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3e52c1,_0x3a4a4c,_0x5b322e){if(_0x3e52c1[_0x5e11('0xa')](_0x5e11('0xb'))){_0x3e52c1[_0x5e11('0xc')]=moment()[_0x5e11('0xd')](_0x5e11('0xe'));}_0x5b322e(null,_0x3e52c1);}},'charset':_0x5e11('0xf'),'collate':_0x5e11('0x10')});};
\ No newline at end of file
index 334716a..d9b723e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xecf5=['where','attributes','limit','UpdateChatInteraction','stringify','find','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','socket.io-emitter','redis','register','request','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','ChatInteraction','update','body','options','raw'];(function(_0x5275b8,_0x51e5dd){var _0x568a9b=function(_0x583a71){while(--_0x583a71){_0x5275b8['push'](_0x5275b8['shift']());}};_0x568a9b(++_0x51e5dd);}(_0xecf5,0x17b));var _0x5ecf=function(_0x372fa3,_0x1c49aa){_0x372fa3=_0x372fa3-0x0;var _0x49e830=_0xecf5[_0x372fa3];return _0x49e830;};'use strict';var _=require(_0x5ecf('0x0'));var util=require(_0x5ecf('0x1'));var moment=require(_0x5ecf('0x2'));var BPromise=require(_0x5ecf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ecf('0x4'));var db=require(_0x5ecf('0x5'))['db'];var utils=require(_0x5ecf('0x6'));var logger=require(_0x5ecf('0x7'))(_0x5ecf('0x8'));var config=require(_0x5ecf('0x9'));var jayson=require(_0x5ecf('0xa'));var client=jayson['client'][_0x5ecf('0xb')]({'port':0x232a});config['redis']=_[_0x5ecf('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5ecf('0xd'))(new Redis(config[_0x5ecf('0xe')]));require('./chatInteraction.socket')[_0x5ecf('0xf')](socket);function respondWithRpcPromise(_0x251a04,_0x3ddfb6,_0x5e0f19){return new BPromise(function(_0x1fa6a5,_0x2cc906){return client[_0x5ecf('0x10')](_0x251a04,_0x5e0f19)[_0x5ecf('0x11')](function(_0x433a14){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x3ddfb6,_0x5ecf('0x12'));logger[_0x5ecf('0x13')](_0x5ecf('0x14'),_0x3ddfb6,_0x5ecf('0x12'),JSON['stringify'](_0x433a14));if(_0x433a14[_0x5ecf('0x15')]){if(_0x433a14[_0x5ecf('0x15')]['code']===0x1f4){logger['error'](_0x5ecf('0x16'),_0x3ddfb6,_0x433a14[_0x5ecf('0x15')][_0x5ecf('0x17')]);return _0x2cc906(_0x433a14[_0x5ecf('0x15')]['message']);}logger[_0x5ecf('0x15')](_0x5ecf('0x16'),_0x3ddfb6,_0x433a14[_0x5ecf('0x15')][_0x5ecf('0x17')]);return _0x1fa6a5(_0x433a14[_0x5ecf('0x15')]['message']);}else{logger['info'](_0x5ecf('0x16'),_0x3ddfb6,_0x5ecf('0x12'));_0x1fa6a5(_0x433a14[_0x5ecf('0x18')][_0x5ecf('0x17')]);}})[_0x5ecf('0x19')](function(_0x28c824){logger[_0x5ecf('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x3ddfb6,_0x28c824);_0x2cc906(_0x28c824);});});}exports['UpdateChatInteraction']=function(_0x48fca8){var _0x155534=this;return new Promise(function(_0x465c5e,_0x17bd18){return db[_0x5ecf('0x1a')][_0x5ecf('0x1b')](_0x48fca8[_0x5ecf('0x1c')],{'raw':_0x48fca8[_0x5ecf('0x1d')]?_0x48fca8[_0x5ecf('0x1d')][_0x5ecf('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48fca8[_0x5ecf('0x1d')]?_0x48fca8[_0x5ecf('0x1d')][_0x5ecf('0x1f')]||null:null,'attributes':_0x48fca8[_0x5ecf('0x1d')]?_0x48fca8[_0x5ecf('0x1d')][_0x5ecf('0x20')]||null:null,'limit':_0x48fca8['options']?_0x48fca8[_0x5ecf('0x1d')][_0x5ecf('0x21')]||null:null})[_0x5ecf('0x11')](function(_0x3613de){logger['info'](_0x5ecf('0x22'),_0x48fca8);logger[_0x5ecf('0x13')]('UpdateChatInteraction',_0x48fca8,JSON[_0x5ecf('0x23')](_0x3613de));_0x465c5e(_0x3613de);})[_0x5ecf('0x19')](function(_0x593b84){logger[_0x5ecf('0x15')]('UpdateChatInteraction',_0x593b84[_0x5ecf('0x17')],_0x48fca8);_0x17bd18(_0x155534['error'](0x1f4,_0x593b84['message']));});});};exports['AddTagsToChatInteraction']=function(_0x172714){return new Promise(function(_0x4773fb,_0x4d1ac3){return db[_0x5ecf('0x1a')][_0x5ecf('0x24')]({'where':_0x172714[_0x5ecf('0x1d')]?_0x172714[_0x5ecf('0x1d')][_0x5ecf('0x1f')]||null:null})['then'](function(_0x56dfbe){if(_0x56dfbe){return _0x56dfbe['addTags'](_0x172714[_0x5ecf('0x1c')][_0x5ecf('0x25')],_[_0x5ecf('0x26')](_0x172714[_0x5ecf('0x1c')],[_0x5ecf('0x25'),'id'])||{});}})[_0x5ecf('0x27')](function(_0x1b52cc){logger['info'](_0x5ecf('0x28'),_0x172714);logger[_0x5ecf('0x13')](_0x5ecf('0x28'),_0x172714,JSON['stringify'](_0x1b52cc));_0x4773fb(_0x1b52cc);})['catch'](function(_0x5d0650){logger['error']('AddTags',_0x5d0650[_0x5ecf('0x17')],_0x172714);_0x4d1ac3(_this[_0x5ecf('0x15')](0x1f4,_0x5d0650[_0x5ecf('0x17')]));});});};
\ No newline at end of file
+var _0xa86e=['info','result','UpdateChatInteraction','ChatInteraction','body','options','attributes','limit','catch','AddTagsToChatInteraction','then','addTags','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','localhost','redis','./chatInteraction.socket','register','request','debug','request\x20sent','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message'];(function(_0x25288c,_0x18e487){var _0x13bc9a=function(_0x50c971){while(--_0x50c971){_0x25288c['push'](_0x25288c['shift']());}};_0x13bc9a(++_0x18e487);}(_0xa86e,0x194));var _0xea86=function(_0xb3c825,_0x48ef68){_0xb3c825=_0xb3c825-0x0;var _0x2e0ddf=_0xa86e[_0xb3c825];return _0x2e0ddf;};'use strict';var _=require(_0xea86('0x0'));var util=require(_0xea86('0x1'));var moment=require(_0xea86('0x2'));var BPromise=require(_0xea86('0x3'));var rs=require(_0xea86('0x4'));var fs=require('fs');var Redis=require(_0xea86('0x5'));var db=require(_0xea86('0x6'))['db'];var utils=require(_0xea86('0x7'));var logger=require(_0xea86('0x8'))(_0xea86('0x9'));var config=require(_0xea86('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xea86('0xb')]['http']({'port':0x232a});config['redis']=_[_0xea86('0xc')](config['redis'],{'host':_0xea86('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xea86('0xe')]));require(_0xea86('0xf'))[_0xea86('0x10')](socket);function respondWithRpcPromise(_0x21d618,_0x20e8a0,_0x2b5d33){return new BPromise(function(_0x526e0f,_0x455737){return client[_0xea86('0x11')](_0x21d618,_0x2b5d33)['then'](function(_0x3aec0c){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x20e8a0,'request\x20sent');logger[_0xea86('0x12')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x20e8a0,_0xea86('0x13'),JSON[_0xea86('0x14')](_0x3aec0c));if(_0x3aec0c[_0xea86('0x15')]){if(_0x3aec0c[_0xea86('0x15')][_0xea86('0x16')]===0x1f4){logger[_0xea86('0x15')](_0xea86('0x17'),_0x20e8a0,_0x3aec0c[_0xea86('0x15')]['message']);return _0x455737(_0x3aec0c[_0xea86('0x15')][_0xea86('0x18')]);}logger[_0xea86('0x15')](_0xea86('0x17'),_0x20e8a0,_0x3aec0c['error'][_0xea86('0x18')]);return _0x526e0f(_0x3aec0c['error'][_0xea86('0x18')]);}else{logger[_0xea86('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x20e8a0,_0xea86('0x13'));_0x526e0f(_0x3aec0c[_0xea86('0x1a')]['message']);}})['catch'](function(_0x15c8f8){logger[_0xea86('0x15')](_0xea86('0x17'),_0x20e8a0,_0x15c8f8);_0x455737(_0x15c8f8);});});}exports[_0xea86('0x1b')]=function(_0x78a43d){var _0x2ec70c=this;return new Promise(function(_0x1d187b,_0x565a95){return db[_0xea86('0x1c')]['update'](_0x78a43d[_0xea86('0x1d')],{'raw':_0x78a43d[_0xea86('0x1e')]?_0x78a43d[_0xea86('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x78a43d['options']?_0x78a43d['options']['where']||null:null,'attributes':_0x78a43d['options']?_0x78a43d[_0xea86('0x1e')][_0xea86('0x1f')]||null:null,'limit':_0x78a43d['options']?_0x78a43d[_0xea86('0x1e')][_0xea86('0x20')]||null:null})['then'](function(_0x2b22e4){logger[_0xea86('0x19')]('UpdateChatInteraction',_0x78a43d);logger[_0xea86('0x12')](_0xea86('0x1b'),_0x78a43d,JSON[_0xea86('0x14')](_0x2b22e4));_0x1d187b(_0x2b22e4);})[_0xea86('0x21')](function(_0x255dc3){logger[_0xea86('0x15')](_0xea86('0x1b'),_0x255dc3[_0xea86('0x18')],_0x78a43d);_0x565a95(_0x2ec70c[_0xea86('0x15')](0x1f4,_0x255dc3['message']));});});};exports[_0xea86('0x22')]=function(_0xcce430){return new Promise(function(_0x576615,_0xd4936d){return db[_0xea86('0x1c')]['find']({'where':_0xcce430[_0xea86('0x1e')]?_0xcce430['options']['where']||null:null})[_0xea86('0x23')](function(_0x1cb49a){if(_0x1cb49a){return _0x1cb49a[_0xea86('0x24')](_0xcce430[_0xea86('0x1d')][_0xea86('0x25')],_['omit'](_0xcce430[_0xea86('0x1d')],[_0xea86('0x25'),'id'])||{});}})['spread'](function(_0x395cf9){logger[_0xea86('0x19')](_0xea86('0x26'),_0xcce430);logger[_0xea86('0x12')]('AddTags',_0xcce430,JSON[_0xea86('0x14')](_0x395cf9));_0x576615(_0x395cf9);})['catch'](function(_0x5b2f69){logger[_0xea86('0x15')](_0xea86('0x26'),_0x5b2f69[_0xea86('0x18')],_0xcce430);_0xd4936d(_this[_0xea86('0x15')](0x1f4,_0x5b2f69[_0xea86('0x18')]));});});};
\ No newline at end of file
index 056300f..670d1d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa553=['./chatInteraction.events','save','remove','update','removeListener','register','length','chatInteraction:'];(function(_0x585133,_0x2412a1){var _0x18254a=function(_0x4c8aaf){while(--_0x4c8aaf){_0x585133['push'](_0x585133['shift']());}};_0x18254a(++_0x2412a1);}(_0xa553,0x158));var _0x3a55=function(_0x342c40,_0x8174ef){_0x342c40=_0x342c40-0x0;var _0x4cb218=_0xa553[_0x342c40];return _0x4cb218;};'use strict';var ChatInteractionEvents=require(_0x3a55('0x0'));var events=[_0x3a55('0x1'),_0x3a55('0x2'),_0x3a55('0x3')];function createListener(_0x7d0b52,_0x41dd31){return function(_0x1636ba){_0x41dd31['emit'](_0x7d0b52,_0x1636ba);};}function removeListener(_0x287402,_0xfc35ae){return function(){ChatInteractionEvents[_0x3a55('0x4')](_0x287402,_0xfc35ae);};}exports[_0x3a55('0x5')]=function(_0x285fb3){for(var _0x488937=0x0,_0x4fd97a=events[_0x3a55('0x6')];_0x488937<_0x4fd97a;_0x488937++){var _0x17a451=events[_0x488937];var _0x218ccb=createListener(_0x3a55('0x7')+_0x17a451,_0x285fb3);ChatInteractionEvents['on'](_0x17a451,_0x218ccb);}};
\ No newline at end of file
+var _0x70f3=['emit','removeListener','register','length','chatInteraction:','save','remove','update'];(function(_0x5a7bb7,_0x3964f2){var _0x557b7f=function(_0x38facb){while(--_0x38facb){_0x5a7bb7['push'](_0x5a7bb7['shift']());}};_0x557b7f(++_0x3964f2);}(_0x70f3,0x1d5));var _0x370f=function(_0x48dc9d,_0x3fe9d0){_0x48dc9d=_0x48dc9d-0x0;var _0x3fca5a=_0x70f3[_0x48dc9d];return _0x3fca5a;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x370f('0x0'),_0x370f('0x1'),_0x370f('0x2')];function createListener(_0x24debf,_0x5e37da){return function(_0x2911b5){_0x5e37da[_0x370f('0x3')](_0x24debf,_0x2911b5);};}function removeListener(_0x33282e,_0x4c4b37){return function(){ChatInteractionEvents[_0x370f('0x4')](_0x33282e,_0x4c4b37);};}exports[_0x370f('0x5')]=function(_0xe9904e){for(var _0x141691=0x0,_0x7e0ad9=events[_0x370f('0x6')];_0x141691<_0x7e0ad9;_0x141691++){var _0x5d72e7=events[_0x141691];var _0x4d98c4=createListener(_0x370f('0x7')+_0x5d72e7,_0xe9904e);ChatInteractionEvents['on'](_0x5d72e7,_0x4d98c4);}};
\ No newline at end of file
index 8165339..c674cb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54b6=['addTags','put','/:id/custom_update','customUpdate','abandon','chatinteraction:destroy','delete','removeTags','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','post','createVidaooSession','diskStorage','root','server/files/attachments/','%s-%s','now','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat'];(function(_0x3abd49,_0x5ec0ec){var _0x5f5677=function(_0x29478a){while(--_0x29478a){_0x3abd49['push'](_0x3abd49['shift']());}};_0x5f5677(++_0x5ec0ec);}(_0x54b6,0x144));var _0x654b=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x54b6[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x654b('0x0'));var timeout=require(_0x654b('0x1'));var express=require(_0x654b('0x2'));var router=express[_0x654b('0x3')]();var fs_extra=require(_0x654b('0x4'));var auth=require(_0x654b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x654b('0x6'));var controller=require(_0x654b('0x7'));router[_0x654b('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x654b('0x9')](),controller['describe']);router[_0x654b('0x8')](_0x654b('0xa'),auth[_0x654b('0xb')](),controller[_0x654b('0xc')]);router[_0x654b('0x8')](_0x654b('0xd'),auth[_0x654b('0xb')](),controller[_0x654b('0xe')]);router[_0x654b('0x8')](_0x654b('0xf'),auth[_0x654b('0x9')](),controller['getMessages']);router['get'](_0x654b('0x10'),auth[_0x654b('0xb')](),controller[_0x654b('0x11')]);router['get'](_0x654b('0x12'),auth[_0x654b('0x9')](),controller[_0x654b('0x13')]);router[_0x654b('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x654b('0x14')]('/:id/vidaoo',auth[_0x654b('0x9')](),controller[_0x654b('0x15')]);var upload=multer({'storage':multer[_0x654b('0x16')]({'destination':function(_0x54b4d6,_0x1b0467,_0x26e860){_0x26e860(null,path['join'](config[_0x654b('0x17')],_0x654b('0x18')));},'filename':function(_0x1949eb,_0x232432,_0xc1cdf3){_0xc1cdf3(null,util['format'](_0x654b('0x19'),Date[_0x654b('0x1a')](),_0x232432['originalname'][_0x654b('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x654b('0x14')](_0x654b('0x1c'),upload[_0x654b('0x1d')](_0x654b('0x1e')),controller[_0x654b('0x1f')]);router[_0x654b('0x14')](_0x654b('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x654b('0x20')]);router['post'](_0x654b('0x21'),auth[_0x654b('0x9')](),interaction[_0x654b('0x22')](_0x654b('0x23'),'chatinteraction:addtags'),controller[_0x654b('0x24')]);router[_0x654b('0x25')](_0x654b('0xa'),auth['isAuthenticated'](),interaction['tracked']('chat','chatinteraction:update'),controller['update']);router[_0x654b('0x25')](_0x654b('0x26'),controller[_0x654b('0x27')]);router[_0x654b('0x25')]('/:id/abandon',auth[_0x654b('0xb')](),controller[_0x654b('0x28')]);router[_0x654b('0x25')]('/:id/close',controller['close']);router['delete'](_0x654b('0xa'),auth[_0x654b('0x9')](),interaction['tracked']('chat',_0x654b('0x29')),controller['destroy']);router[_0x654b('0x2a')](_0x654b('0x21'),auth[_0x654b('0x9')](),controller[_0x654b('0x2b')]);module[_0x654b('0x2c')]=router;
\ No newline at end of file
+var _0xa73e=['removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','isAuthenticated','index','get','/describe','describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','createVidaooSession','diskStorage','join','root','server/files/attachments/','%s-%s','now','originalname','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','put','/:id','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy'];(function(_0x2ae8b5,_0x2a2cb6){var _0x29def1=function(_0x2a03a3){while(--_0x2a03a3){_0x2ae8b5['push'](_0x2ae8b5['shift']());}};_0x29def1(++_0x2a2cb6);}(_0xa73e,0xde));var _0xea73=function(_0x5c17c8,_0x472eb8){_0x5c17c8=_0x5c17c8-0x0;var _0x3afe0e=_0xa73e[_0x5c17c8];return _0x3afe0e;};'use strict';var multer=require(_0xea73('0x0'));var util=require(_0xea73('0x1'));var path=require(_0xea73('0x2'));var timeout=require(_0xea73('0x3'));var express=require(_0xea73('0x4'));var router=express[_0xea73('0x5')]();var fs_extra=require(_0xea73('0x6'));var auth=require(_0xea73('0x7'));var interaction=require(_0xea73('0x8'));var config=require('../../config/environment');var controller=require(_0xea73('0x9'));router['get']('/',auth[_0xea73('0xa')](),controller[_0xea73('0xb')]);router[_0xea73('0xc')](_0xea73('0xd'),auth[_0xea73('0xa')](),controller[_0xea73('0xe')]);router[_0xea73('0xc')]('/:id',auth[_0xea73('0xf')](),controller[_0xea73('0x10')]);router[_0xea73('0xc')](_0xea73('0x11'),auth[_0xea73('0xf')](),controller[_0xea73('0x12')]);router[_0xea73('0xc')](_0xea73('0x13'),auth[_0xea73('0xa')](),controller[_0xea73('0x14')]);router[_0xea73('0xc')](_0xea73('0x15'),auth[_0xea73('0xf')](),controller[_0xea73('0x16')]);router['get'](_0xea73('0x17'),auth['isAuthenticated'](),controller[_0xea73('0x18')]);router[_0xea73('0x19')]('/',auth[_0xea73('0xa')](),controller['create']);router[_0xea73('0x19')]('/:id/vidaoo',auth[_0xea73('0xa')](),controller[_0xea73('0x1a')]);var upload=multer({'storage':multer[_0xea73('0x1b')]({'destination':function(_0x480adf,_0x3438ec,_0x4830b8){_0x4830b8(null,path[_0xea73('0x1c')](config[_0xea73('0x1d')],_0xea73('0x1e')));},'filename':function(_0x10a128,_0x59006c,_0x3fe812){_0x3fe812(null,util['format'](_0xea73('0x1f'),Date[_0xea73('0x20')](),_0x59006c[_0xea73('0x21')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xea73('0x19')]('/:id/attachment_upload',upload['single'](_0xea73('0x22')),controller[_0xea73('0x23')]);router[_0xea73('0x19')](_0xea73('0x13'),auth['isChatInteractionAuthorized'](),controller[_0xea73('0x24')]);router[_0xea73('0x19')](_0xea73('0x25'),auth[_0xea73('0xa')](),interaction[_0xea73('0x26')](_0xea73('0x27'),_0xea73('0x28')),controller['addTags']);router[_0xea73('0x29')](_0xea73('0x2a'),auth[_0xea73('0xa')](),interaction[_0xea73('0x26')](_0xea73('0x27'),_0xea73('0x2b')),controller[_0xea73('0x2c')]);router[_0xea73('0x29')](_0xea73('0x2d'),controller[_0xea73('0x2e')]);router[_0xea73('0x29')](_0xea73('0x2f'),auth[_0xea73('0xf')](),controller[_0xea73('0x30')]);router[_0xea73('0x29')](_0xea73('0x31'),controller['close']);router[_0xea73('0x32')](_0xea73('0x2a'),auth['isAuthenticated'](),interaction[_0xea73('0x26')]('chat',_0xea73('0x33')),controller[_0xea73('0x34')]);router[_0xea73('0x32')](_0xea73('0x25'),auth['isAuthenticated'](),controller[_0xea73('0x35')]);module[_0xea73('0x36')]=router;
\ No newline at end of file
index 88231dc..90282d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c38=['sequelize','medium','BOOLEAN'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x4c38,0x14a));var _0x84c3=function(_0x21a7aa,_0x2248dc){_0x21a7aa=_0x21a7aa-0x0;var _0x20c622=_0x4c38[_0x21a7aa];return _0x20c622;};'use strict';var Sequelize=require(_0x84c3('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x84c3('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x84c3('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xb90d=['BOOLEAN','INTEGER','sequelize','exports','TEXT','medium'];(function(_0x3d2944,_0x410c3e){var _0x370d7b=function(_0x2c283d){while(--_0x2c283d){_0x3d2944['push'](_0x3d2944['shift']());}};_0x370d7b(++_0x410c3e);}(_0xb90d,0x8c));var _0xdb90=function(_0x1ca7ed,_0x2cccb4){_0x1ca7ed=_0x1ca7ed-0x0;var _0x5d706a=_0xb90d[_0x1ca7ed];return _0x5d706a;};'use strict';var Sequelize=require(_0xdb90('0x0'));module[_0xdb90('0x1')]={'body':{'type':Sequelize[_0xdb90('0x2')](_0xdb90('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xdb90('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xdb90('0x5')]}};
\ No newline at end of file
index 8e554e5..a040761 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa957=['eml-format','rimraf','fast-json-patch','request-promise','moment','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','./chatInternalMessage.socket','sendStatus','status','offset','limit','Content-Range','json','apply','save','then','destroy','end','error','stack','name','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','count','includeAll','include','findAll','rows','catch','options','find','create','body','update','params','describe','messages','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','admin','user','fullname','role','userpic','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','push','FromId','read','-createdAt','all'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xa957,0x141));var _0x7a95=function(_0x2386c7,_0x6330c){_0x2386c7=_0x2386c7-0x0;var _0x5f388a=_0xa957[_0x2386c7];return _0x5f388a;};'use strict';var emlformat=require(_0x7a95('0x0'));var rimraf=require(_0x7a95('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7a95('0x2'));var rp=require(_0x7a95('0x3'));var moment=require(_0x7a95('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x7a95('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7a95('0x6'));var fs=require('fs');var fs_extra=require(_0x7a95('0x7'));var _=require(_0x7a95('0x8'));var squel=require('squel');var crypto=require(_0x7a95('0x9'));var jsforce=require(_0x7a95('0xa'));var deskjs=require(_0x7a95('0xb'));var toCsv=require(_0x7a95('0xc'));var querystring=require(_0x7a95('0xd'));var Papa=require(_0x7a95('0xe'));var Redis=require('ioredis');var authService=require(_0x7a95('0xf'));var qs=require(_0x7a95('0x10'));var as=require(_0x7a95('0x11'));var hardwareService=require(_0x7a95('0x12'));var logger=require(_0x7a95('0x13'))(_0x7a95('0x14'));var utils=require(_0x7a95('0x15'));var config=require(_0x7a95('0x16'));var licenseUtil=require(_0x7a95('0x17'));var db=require(_0x7a95('0x18'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x7a95('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7a95('0x1a'))['register'](socket);function respondWithStatusCode(_0x3a62e3,_0x30d682){_0x30d682=_0x30d682||0xcc;return function(_0x3c2e76){if(_0x3c2e76){return _0x3a62e3[_0x7a95('0x1b')](_0x30d682);}return _0x3a62e3[_0x7a95('0x1c')](_0x30d682)['end']();};}function respondWithResult(_0x1b1d18,_0x14dfd8){_0x14dfd8=_0x14dfd8||0xc8;return function(_0x33ce16){if(_0x33ce16){return _0x1b1d18[_0x7a95('0x1c')](_0x14dfd8)['json'](_0x33ce16);}};}function respondWithFilteredResult(_0x4fd2d8,_0x54b447){return function(_0x3da5e9){if(_0x3da5e9){var _0x120b9d=typeof _0x54b447['offset']==='undefined'&&typeof _0x54b447['limit']==='undefined';var _0x5536ce=_0x3da5e9['count'];var _0x21f80f=_0x120b9d?0x0:_0x54b447['offset'];var _0x19f6c0=_0x120b9d?_0x3da5e9['count']:_0x54b447[_0x7a95('0x1d')]+_0x54b447[_0x7a95('0x1e')];var _0x590e9c;if(_0x19f6c0>=_0x5536ce){_0x19f6c0=_0x5536ce;_0x590e9c=0xc8;}else{_0x590e9c=0xce;}_0x4fd2d8['status'](_0x590e9c);return _0x4fd2d8['set'](_0x7a95('0x1f'),_0x21f80f+'-'+_0x19f6c0+'/'+_0x5536ce)[_0x7a95('0x20')](_0x3da5e9);}return null;};}function patchUpdates(_0x2abef9){return function(_0xc9bb9){try{jsonpatch[_0x7a95('0x21')](_0xc9bb9,_0x2abef9,!![]);}catch(_0x50b863){return BPromise['reject'](_0x50b863);}return _0xc9bb9[_0x7a95('0x22')]();};}function saveUpdates(_0x3ec5cb,_0x452c6c){return function(_0x4cf784){if(_0x4cf784){return _0x4cf784['update'](_0x3ec5cb)[_0x7a95('0x23')](function(_0xccbdcb){return _0xccbdcb;});}return null;};}function removeEntity(_0x22a9bb,_0x22be51){return function(_0x45cab9){if(_0x45cab9){return _0x45cab9[_0x7a95('0x24')]()[_0x7a95('0x23')](function(){_0x22a9bb[_0x7a95('0x1c')](0xcc)[_0x7a95('0x25')]();});}};}function handleEntityNotFound(_0xea6e32,_0x2ff421){return function(_0x4d3a17){if(!_0x4d3a17){_0xea6e32[_0x7a95('0x1b')](0x194);}return _0x4d3a17;};}function handleError(_0x271d37,_0x361cde){_0x361cde=_0x361cde||0x1f4;return function(_0x38ece2){logger[_0x7a95('0x26')](_0x38ece2[_0x7a95('0x27')]);if(_0x38ece2['name']){delete _0x38ece2[_0x7a95('0x28')];}_0x271d37[_0x7a95('0x1c')](_0x361cde)['send'](_0x38ece2);};}exports[_0x7a95('0x29')]=function(_0x4951cb,_0x53dc11){var _0x232fa8={},_0x4bc01b={},_0x146c78={'count':0x0,'rows':[]};var _0x4984cd=_[_0x7a95('0x2a')](db[_0x7a95('0x2b')][_0x7a95('0x2c')],function(_0x51d198){return{'name':_0x51d198[_0x7a95('0x2d')],'type':_0x51d198[_0x7a95('0x2e')][_0x7a95('0x2f')]};});_0x4bc01b[_0x7a95('0x30')]=_[_0x7a95('0x2a')](_0x4984cd,_0x7a95('0x28'));_0x4bc01b['query']=_[_0x7a95('0x31')](_0x4951cb[_0x7a95('0x32')]);_0x4bc01b['filters']=_[_0x7a95('0x33')](_0x4bc01b[_0x7a95('0x30')],_0x4bc01b[_0x7a95('0x32')]);_0x232fa8[_0x7a95('0x34')]=_['intersection'](_0x4bc01b[_0x7a95('0x30')],qs[_0x7a95('0x35')](_0x4951cb[_0x7a95('0x32')]['fields']));_0x232fa8[_0x7a95('0x34')]=_0x232fa8[_0x7a95('0x34')][_0x7a95('0x36')]?_0x232fa8[_0x7a95('0x34')]:_0x4bc01b[_0x7a95('0x30')];if(!_0x4951cb['query'][_0x7a95('0x37')](_0x7a95('0x38'))){_0x232fa8[_0x7a95('0x1e')]=qs[_0x7a95('0x1e')](_0x4951cb[_0x7a95('0x32')][_0x7a95('0x1e')]);_0x232fa8[_0x7a95('0x1d')]=qs[_0x7a95('0x1d')](_0x4951cb[_0x7a95('0x32')][_0x7a95('0x1d')]);}_0x232fa8[_0x7a95('0x39')]=qs[_0x7a95('0x3a')](_0x4951cb['query'][_0x7a95('0x3a')]);_0x232fa8[_0x7a95('0x3b')]=qs['filters'](_['pick'](_0x4951cb[_0x7a95('0x32')],_0x4bc01b[_0x7a95('0x3c')]),_0x4984cd);if(_0x4951cb[_0x7a95('0x32')][_0x7a95('0x3d')]){_0x232fa8['where']=_['merge'](_0x232fa8['where'],{'$or':_[_0x7a95('0x2a')](_0x4984cd,function(_0x374792){if(_0x374792[_0x7a95('0x2e')]!==_0x7a95('0x3e')){var _0x1bca09={};_0x1bca09[_0x374792[_0x7a95('0x28')]]={'$like':'%'+_0x4951cb['query'][_0x7a95('0x3d')]+'%'};return _0x1bca09;}})});}_0x232fa8=_[_0x7a95('0x3f')]({},_0x232fa8,_0x4951cb['options']);var _0x87e711={'where':_0x232fa8[_0x7a95('0x3b')]};return db[_0x7a95('0x2b')][_0x7a95('0x40')](_0x87e711)[_0x7a95('0x23')](function(_0x1d7c41){_0x146c78['count']=_0x1d7c41;if(_0x4951cb['query'][_0x7a95('0x41')]){_0x232fa8[_0x7a95('0x42')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x7a95('0x43')](_0x232fa8);})[_0x7a95('0x23')](function(_0x1e880a){_0x146c78[_0x7a95('0x44')]=_0x1e880a;return _0x146c78;})[_0x7a95('0x23')](respondWithFilteredResult(_0x53dc11,_0x232fa8))[_0x7a95('0x45')](handleError(_0x53dc11,null));};exports['show']=function(_0x2c6544,_0x2f5482){var _0x4d26d5={'raw':!![],'where':{'id':_0x2c6544['params']['id']}},_0x27b170={};_0x27b170[_0x7a95('0x30')]=_[_0x7a95('0x31')](db[_0x7a95('0x2b')][_0x7a95('0x2c')]);_0x27b170[_0x7a95('0x32')]=_[_0x7a95('0x31')](_0x2c6544[_0x7a95('0x32')]);_0x27b170[_0x7a95('0x3c')]=_[_0x7a95('0x33')](_0x27b170[_0x7a95('0x30')],_0x27b170[_0x7a95('0x32')]);_0x4d26d5[_0x7a95('0x34')]=_['intersection'](_0x27b170[_0x7a95('0x30')],qs['fields'](_0x2c6544[_0x7a95('0x32')][_0x7a95('0x35')]));_0x4d26d5[_0x7a95('0x34')]=_0x4d26d5[_0x7a95('0x34')][_0x7a95('0x36')]?_0x4d26d5[_0x7a95('0x34')]:_0x27b170[_0x7a95('0x30')];if(_0x2c6544[_0x7a95('0x32')][_0x7a95('0x41')]){_0x4d26d5[_0x7a95('0x42')]=[{'all':!![]}];}_0x4d26d5=_[_0x7a95('0x3f')]({},_0x4d26d5,_0x2c6544[_0x7a95('0x46')]);return db[_0x7a95('0x2b')][_0x7a95('0x47')](_0x4d26d5)[_0x7a95('0x23')](handleEntityNotFound(_0x2f5482,null))[_0x7a95('0x23')](respondWithResult(_0x2f5482,null))['catch'](handleError(_0x2f5482,null));};exports[_0x7a95('0x48')]=function(_0x1d50da,_0x326d7c){return db['ChatInternalMessage']['create'](_0x1d50da[_0x7a95('0x49')],{})[_0x7a95('0x23')](respondWithResult(_0x326d7c,0xc9))[_0x7a95('0x45')](handleError(_0x326d7c,null));};exports[_0x7a95('0x4a')]=function(_0x2e6196,_0x4ea155){if(_0x2e6196[_0x7a95('0x49')]['id']){delete _0x2e6196[_0x7a95('0x49')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x2e6196[_0x7a95('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4ea155,null))['then'](saveUpdates(_0x2e6196[_0x7a95('0x49')],null))['then'](respondWithResult(_0x4ea155,null))[_0x7a95('0x45')](handleError(_0x4ea155,null));};exports[_0x7a95('0x24')]=function(_0x281940,_0x52319f){return db[_0x7a95('0x2b')][_0x7a95('0x47')]({'where':{'id':_0x281940[_0x7a95('0x4b')]['id']}})[_0x7a95('0x23')](handleEntityNotFound(_0x52319f,null))['then'](removeEntity(_0x52319f,null))[_0x7a95('0x45')](handleError(_0x52319f,null));};exports[_0x7a95('0x4c')]=function(_0x4c25e0,_0x5469e0){return db[_0x7a95('0x2b')][_0x7a95('0x4c')]()[_0x7a95('0x23')](respondWithResult(_0x5469e0,null))['catch'](handleError(_0x5469e0,null));};function wrapUser(_0x508f91){return function(_0x392907){var _0x532439=_0x508f91['get']({'plain':!![]});_0x532439[_0x7a95('0x4d')]=[];if(_0x392907){_0x532439['lastMessageAt']=_0x392907[_0x7a95('0x4e')];_0x532439['lastMessage']=_0x392907;}else{_0x532439['lastMessageAt']=moment(0x0)[_0x7a95('0x4f')](_0x7a95('0x50'));_0x532439['lastMessage']={};}return _0x532439;};}exports[_0x7a95('0x51')]=function(_0x2e2c59,_0x5e65ed,_0x4d6983){var _0x5d9cb0=[];return db['User'][_0x7a95('0x43')]({'where':{'role':['agent',_0x7a95('0x52'),_0x7a95('0x53')]},'attributes':['id',_0x7a95('0x54'),_0x7a95('0x28'),_0x7a95('0x55'),_0x7a95('0x56'),'internal',_0x7a95('0x57'),_0x7a95('0x58'),_0x7a95('0x59'),_0x7a95('0x5a')],'order':qs[_0x7a95('0x3a')](_0x7a95('0x5b')),'include':[{'model':db['VoiceQueue'],'as':_0x7a95('0x5c'),'attributes':['id',_0x7a95('0x28'),_0x7a95('0x2e')],'through':{'attributes':[]}}]})['then'](function(_0x4c90dc){if(_0x4c90dc){var _0x11e47f=_0x2e2c59[_0x7a95('0x53')][_0x7a95('0x5d')]({'plain':!![]});if(!_0x11e47f)throw new Error(_0x7a95('0x5e'));if(_0x11e47f[_0x7a95('0x55')]===_0x7a95('0x53')){return db[_0x7a95('0x5f')][_0x7a95('0x47')]({'where':{'name':_0x7a95('0x60'),'userProfileId':_0x11e47f[_0x7a95('0x61')]},'raw':!![]})[_0x7a95('0x23')](function(_0x39b5ab){if(_0x39b5ab){if(_0x39b5ab[_0x7a95('0x62')]===0x0){return db[_0x7a95('0x63')][_0x7a95('0x43')]({'where':{'sectionId':_0x39b5ab['id']},'raw':!![]})['then'](function(_0x414ac7){var _0x248ac0=[];if(_[_0x7a95('0x64')](_0x414ac7)){_0x248ac0=_[_0x7a95('0x3d')](_0x4c90dc,function(_0x1dd6a2){if(_0x1dd6a2['role']!==_0x7a95('0x65')){return _0x1dd6a2;}});return _0x248ac0;}else{for(var _0x35ad70=0x0;_0x35ad70<_0x4c90dc[_0x7a95('0x36')];_0x35ad70++){var _0x19158e=_0x4c90dc[_0x35ad70];if(_0x19158e[_0x7a95('0x55')]===_0x7a95('0x65')){var _0x2cf9ed=_[_0x7a95('0x47')](_0x414ac7,function(_0x209fe5){return _0x209fe5['resourceId']===_0x19158e['id'];});if(_0x2cf9ed)_0x248ac0['push'](_0x19158e);}else{_0x248ac0['push'](_0x19158e);}}return _0x248ac0;}});}else{return _0x4c90dc;}}else{var _0x987159=_[_0x7a95('0x3d')](_0x4c90dc,function(_0x2942b7){if(_0x2942b7['role']!==_0x7a95('0x65')){return _0x2942b7;}});return _0x987159;}});}else{return _0x4c90dc;}}})['then'](function(_0x213680){var _0x7d41ff=[];if(_0x213680){_0x5d9cb0=_0x213680;for(var _0x4e327a=0x0;_0x4e327a<_0x213680[_0x7a95('0x36')];_0x4e327a+=0x1){_0x5d9cb0[_0x4e327a]['messages']=[];_0x7d41ff[_0x7a95('0x66')](db['ChatInternalMessage'][_0x7a95('0x47')]({'where':{'FromId':[_0x2e2c59['user']['id'],_0x213680[_0x4e327a]['id']],'ToId':[_0x2e2c59['user']['id'],_0x213680[_0x4e327a]['id']],'ChatGroupId':null},'attributes':['id',_0x7a95('0x4e'),_0x7a95('0x67'),'ToId',_0x7a95('0x68'),_0x7a95('0x49')],'order':qs[_0x7a95('0x3a')](_0x7a95('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7a95('0x23')](wrapUser(_0x213680[_0x4e327a])));}return BPromise[_0x7a95('0x6a')](_0x7d41ff);}return[];})['then'](function(_0x10491e){return{'rows':_0x10491e,'count':_0x10491e[_0x7a95('0x36')]};})['then'](respondWithResult(_0x5e65ed,null))[_0x7a95('0x45')](handleError(_0x5e65ed,null));};
\ No newline at end of file
+var _0xe520=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','destroy','then','stack','name','send','index','map','ChatInternalMessage','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','options','includeAll','rows','catch','show','params','rawAttributes','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','findAll','agent','admin','user','fullname','userpic','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','-createdAt','all','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring'];(function(_0x15ce2a,_0x1345e3){var _0xd9cbbf=function(_0x45ac52){while(--_0x45ac52){_0x15ce2a['push'](_0x15ce2a['shift']());}};_0xd9cbbf(++_0x1345e3);}(_0xe520,0x140));var _0x0e52=function(_0xa465a2,_0x3a4590){_0xa465a2=_0xa465a2-0x0;var _0x4a6c16=_0xe520[_0xa465a2];return _0x4a6c16;};'use strict';var emlformat=require(_0x0e52('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0e52('0x1'));var jsonpatch=require(_0x0e52('0x2'));var rp=require(_0x0e52('0x3'));var moment=require('moment');var BPromise=require(_0x0e52('0x4'));var Mustache=require(_0x0e52('0x5'));var util=require(_0x0e52('0x6'));var path=require('path');var sox=require(_0x0e52('0x7'));var csv=require(_0x0e52('0x8'));var ejs=require(_0x0e52('0x9'));var fs=require('fs');var fs_extra=require(_0x0e52('0xa'));var _=require(_0x0e52('0xb'));var squel=require(_0x0e52('0xc'));var crypto=require(_0x0e52('0xd'));var jsforce=require(_0x0e52('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0e52('0x8'));var querystring=require(_0x0e52('0xf'));var Papa=require(_0x0e52('0x10'));var Redis=require(_0x0e52('0x11'));var authService=require(_0x0e52('0x12'));var qs=require(_0x0e52('0x13'));var as=require(_0x0e52('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0e52('0x15'))(_0x0e52('0x16'));var utils=require(_0x0e52('0x17'));var config=require(_0x0e52('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0e52('0x19'))['db'];config[_0x0e52('0x1a')]=_[_0x0e52('0x1b')](config[_0x0e52('0x1a')],{'host':_0x0e52('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0e52('0x1a')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x55a2c5,_0x545f54){_0x545f54=_0x545f54||0xcc;return function(_0x403a8f){if(_0x403a8f){return _0x55a2c5[_0x0e52('0x1d')](_0x545f54);}return _0x55a2c5[_0x0e52('0x1e')](_0x545f54)[_0x0e52('0x1f')]();};}function respondWithResult(_0x2ba2a2,_0x30681f){_0x30681f=_0x30681f||0xc8;return function(_0x23dd37){if(_0x23dd37){return _0x2ba2a2[_0x0e52('0x1e')](_0x30681f)[_0x0e52('0x20')](_0x23dd37);}};}function respondWithFilteredResult(_0x32bec8,_0x2f68c6){return function(_0x50b7f2){if(_0x50b7f2){var _0x13aeb2=typeof _0x2f68c6['offset']===_0x0e52('0x21')&&typeof _0x2f68c6[_0x0e52('0x22')]===_0x0e52('0x21');var _0x4c389a=_0x50b7f2['count'];var _0x230f9f=_0x13aeb2?0x0:_0x2f68c6[_0x0e52('0x23')];var _0x2e5697=_0x13aeb2?_0x50b7f2[_0x0e52('0x24')]:_0x2f68c6[_0x0e52('0x23')]+_0x2f68c6[_0x0e52('0x22')];var _0x2f18d8;if(_0x2e5697>=_0x4c389a){_0x2e5697=_0x4c389a;_0x2f18d8=0xc8;}else{_0x2f18d8=0xce;}_0x32bec8[_0x0e52('0x1e')](_0x2f18d8);return _0x32bec8[_0x0e52('0x25')](_0x0e52('0x26'),_0x230f9f+'-'+_0x2e5697+'/'+_0x4c389a)[_0x0e52('0x20')](_0x50b7f2);}return null;};}function patchUpdates(_0x4234b3){return function(_0x5d8154){try{jsonpatch[_0x0e52('0x27')](_0x5d8154,_0x4234b3,!![]);}catch(_0x9aafa3){return BPromise['reject'](_0x9aafa3);}return _0x5d8154[_0x0e52('0x28')]();};}function saveUpdates(_0x276e1b,_0x599d38){return function(_0x21e9df){if(_0x21e9df){return _0x21e9df[_0x0e52('0x29')](_0x276e1b)['then'](function(_0x2dff92){return _0x2dff92;});}return null;};}function removeEntity(_0x521234,_0x5a7a5e){return function(_0x5f4651){if(_0x5f4651){return _0x5f4651[_0x0e52('0x2a')]()[_0x0e52('0x2b')](function(){_0x521234['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x39bf01,_0x120a25){return function(_0x37e2ea){if(!_0x37e2ea){_0x39bf01[_0x0e52('0x1d')](0x194);}return _0x37e2ea;};}function handleError(_0x553527,_0x332210){_0x332210=_0x332210||0x1f4;return function(_0x1907e4){logger['error'](_0x1907e4[_0x0e52('0x2c')]);if(_0x1907e4[_0x0e52('0x2d')]){delete _0x1907e4[_0x0e52('0x2d')];}_0x553527[_0x0e52('0x1e')](_0x332210)[_0x0e52('0x2e')](_0x1907e4);};}exports[_0x0e52('0x2f')]=function(_0xb5aa93,_0x3236b6){var _0x3693fe={},_0x7bfd64={},_0x12f276={'count':0x0,'rows':[]};var _0x4a7d35=_[_0x0e52('0x30')](db[_0x0e52('0x31')]['rawAttributes'],function(_0x51e036){return{'name':_0x51e036[_0x0e52('0x32')],'type':_0x51e036[_0x0e52('0x33')][_0x0e52('0x34')]};});_0x7bfd64[_0x0e52('0x35')]=_[_0x0e52('0x30')](_0x4a7d35,_0x0e52('0x2d'));_0x7bfd64[_0x0e52('0x36')]=_[_0x0e52('0x37')](_0xb5aa93[_0x0e52('0x36')]);_0x7bfd64['filters']=_[_0x0e52('0x38')](_0x7bfd64[_0x0e52('0x35')],_0x7bfd64[_0x0e52('0x36')]);_0x3693fe[_0x0e52('0x39')]=_[_0x0e52('0x38')](_0x7bfd64[_0x0e52('0x35')],qs['fields'](_0xb5aa93[_0x0e52('0x36')][_0x0e52('0x3a')]));_0x3693fe[_0x0e52('0x39')]=_0x3693fe[_0x0e52('0x39')][_0x0e52('0x3b')]?_0x3693fe[_0x0e52('0x39')]:_0x7bfd64['model'];if(!_0xb5aa93[_0x0e52('0x36')][_0x0e52('0x3c')](_0x0e52('0x3d'))){_0x3693fe[_0x0e52('0x22')]=qs['limit'](_0xb5aa93[_0x0e52('0x36')][_0x0e52('0x22')]);_0x3693fe['offset']=qs[_0x0e52('0x23')](_0xb5aa93['query'][_0x0e52('0x23')]);}_0x3693fe['order']=qs[_0x0e52('0x3e')](_0xb5aa93['query'][_0x0e52('0x3e')]);_0x3693fe[_0x0e52('0x3f')]=qs[_0x0e52('0x40')](_['pick'](_0xb5aa93[_0x0e52('0x36')],_0x7bfd64[_0x0e52('0x40')]),_0x4a7d35);if(_0xb5aa93[_0x0e52('0x36')][_0x0e52('0x41')]){_0x3693fe[_0x0e52('0x3f')]=_[_0x0e52('0x42')](_0x3693fe['where'],{'$or':_['map'](_0x4a7d35,function(_0x407dc4){if(_0x407dc4[_0x0e52('0x33')]!=='VIRTUAL'){var _0x400aee={};_0x400aee[_0x407dc4[_0x0e52('0x2d')]]={'$like':'%'+_0xb5aa93[_0x0e52('0x36')][_0x0e52('0x41')]+'%'};return _0x400aee;}})});}_0x3693fe=_[_0x0e52('0x42')]({},_0x3693fe,_0xb5aa93[_0x0e52('0x43')]);var _0x5e2c5a={'where':_0x3693fe[_0x0e52('0x3f')]};return db[_0x0e52('0x31')][_0x0e52('0x24')](_0x5e2c5a)[_0x0e52('0x2b')](function(_0x336548){_0x12f276[_0x0e52('0x24')]=_0x336548;if(_0xb5aa93[_0x0e52('0x36')][_0x0e52('0x44')]){_0x3693fe['include']=[{'all':!![]}];}return db[_0x0e52('0x31')]['findAll'](_0x3693fe);})[_0x0e52('0x2b')](function(_0xa943b3){_0x12f276[_0x0e52('0x45')]=_0xa943b3;return _0x12f276;})['then'](respondWithFilteredResult(_0x3236b6,_0x3693fe))[_0x0e52('0x46')](handleError(_0x3236b6,null));};exports[_0x0e52('0x47')]=function(_0x38b108,_0x1068a6){var _0xe56009={'raw':!![],'where':{'id':_0x38b108[_0x0e52('0x48')]['id']}},_0x31f69a={};_0x31f69a['model']=_[_0x0e52('0x37')](db[_0x0e52('0x31')][_0x0e52('0x49')]);_0x31f69a[_0x0e52('0x36')]=_[_0x0e52('0x37')](_0x38b108[_0x0e52('0x36')]);_0x31f69a[_0x0e52('0x40')]=_['intersection'](_0x31f69a[_0x0e52('0x35')],_0x31f69a[_0x0e52('0x36')]);_0xe56009['attributes']=_[_0x0e52('0x38')](_0x31f69a[_0x0e52('0x35')],qs[_0x0e52('0x3a')](_0x38b108[_0x0e52('0x36')]['fields']));_0xe56009[_0x0e52('0x39')]=_0xe56009[_0x0e52('0x39')][_0x0e52('0x3b')]?_0xe56009[_0x0e52('0x39')]:_0x31f69a['model'];if(_0x38b108[_0x0e52('0x36')]['includeAll']){_0xe56009['include']=[{'all':!![]}];}_0xe56009=_[_0x0e52('0x42')]({},_0xe56009,_0x38b108['options']);return db['ChatInternalMessage'][_0x0e52('0x4a')](_0xe56009)['then'](handleEntityNotFound(_0x1068a6,null))['then'](respondWithResult(_0x1068a6,null))[_0x0e52('0x46')](handleError(_0x1068a6,null));};exports['create']=function(_0x3506fb,_0x645930){return db['ChatInternalMessage'][_0x0e52('0x4b')](_0x3506fb[_0x0e52('0x4c')],{})['then'](respondWithResult(_0x645930,0xc9))[_0x0e52('0x46')](handleError(_0x645930,null));};exports[_0x0e52('0x29')]=function(_0x233420,_0x54d32b){if(_0x233420['body']['id']){delete _0x233420[_0x0e52('0x4c')]['id'];}return db[_0x0e52('0x31')][_0x0e52('0x4a')]({'where':{'id':_0x233420['params']['id']}})[_0x0e52('0x2b')](handleEntityNotFound(_0x54d32b,null))['then'](saveUpdates(_0x233420[_0x0e52('0x4c')],null))[_0x0e52('0x2b')](respondWithResult(_0x54d32b,null))[_0x0e52('0x46')](handleError(_0x54d32b,null));};exports[_0x0e52('0x2a')]=function(_0x54b7a8,_0x50c8f9){return db['ChatInternalMessage'][_0x0e52('0x4a')]({'where':{'id':_0x54b7a8[_0x0e52('0x48')]['id']}})[_0x0e52('0x2b')](handleEntityNotFound(_0x50c8f9,null))['then'](removeEntity(_0x50c8f9,null))[_0x0e52('0x46')](handleError(_0x50c8f9,null));};exports[_0x0e52('0x4d')]=function(_0x5ad842,_0xc496c7){return db['ChatInternalMessage']['describe']()[_0x0e52('0x2b')](respondWithResult(_0xc496c7,null))[_0x0e52('0x46')](handleError(_0xc496c7,null));};function wrapUser(_0x4616d0){return function(_0x1b20b8){var _0x181fb8=_0x4616d0[_0x0e52('0x4e')]({'plain':!![]});_0x181fb8[_0x0e52('0x4f')]=[];if(_0x1b20b8){_0x181fb8[_0x0e52('0x50')]=_0x1b20b8[_0x0e52('0x51')];_0x181fb8[_0x0e52('0x52')]=_0x1b20b8;}else{_0x181fb8[_0x0e52('0x50')]=moment(0x0)[_0x0e52('0x53')](_0x0e52('0x54'));_0x181fb8[_0x0e52('0x52')]={};}return _0x181fb8;};}exports[_0x0e52('0x55')]=function(_0x1c4ea7,_0x5bcb68,_0x23d069){var _0x1e1705=[];return db['User'][_0x0e52('0x56')]({'where':{'role':[_0x0e52('0x57'),_0x0e52('0x58'),_0x0e52('0x59')]},'attributes':['id',_0x0e52('0x5a'),'name','role',_0x0e52('0x5b'),_0x0e52('0x5c'),_0x0e52('0x5d'),_0x0e52('0x5e'),_0x0e52('0x5f'),'showWebBar'],'order':qs[_0x0e52('0x3e')](_0x0e52('0x60')),'include':[{'model':db[_0x0e52('0x61')],'as':_0x0e52('0x62'),'attributes':['id',_0x0e52('0x2d'),_0x0e52('0x33')],'through':{'attributes':[]}}]})[_0x0e52('0x2b')](function(_0x5c20cc){if(_0x5c20cc){var _0xb03d4=_0x1c4ea7[_0x0e52('0x59')][_0x0e52('0x4e')]({'plain':!![]});if(!_0xb03d4)throw new Error(_0x0e52('0x63'));if(_0xb03d4[_0x0e52('0x64')]==='user'){return db[_0x0e52('0x65')][_0x0e52('0x4a')]({'where':{'name':'Agents','userProfileId':_0xb03d4[_0x0e52('0x66')]},'raw':!![]})[_0x0e52('0x2b')](function(_0x3aafa8){if(_0x3aafa8){if(_0x3aafa8[_0x0e52('0x67')]===0x0){return db[_0x0e52('0x68')][_0x0e52('0x56')]({'where':{'sectionId':_0x3aafa8['id']},'raw':!![]})[_0x0e52('0x2b')](function(_0x1789ab){var _0x5c7f8a=[];if(_[_0x0e52('0x69')](_0x1789ab)){_0x5c7f8a=_[_0x0e52('0x41')](_0x5c20cc,function(_0x26e21b){if(_0x26e21b[_0x0e52('0x64')]!=='agent'){return _0x26e21b;}});return _0x5c7f8a;}else{for(var _0x11a817=0x0;_0x11a817<_0x5c20cc[_0x0e52('0x3b')];_0x11a817++){var _0x2f7ede=_0x5c20cc[_0x11a817];if(_0x2f7ede[_0x0e52('0x64')]==='agent'){var _0x264671=_[_0x0e52('0x4a')](_0x1789ab,function(_0x37eb04){return _0x37eb04[_0x0e52('0x6a')]===_0x2f7ede['id'];});if(_0x264671)_0x5c7f8a[_0x0e52('0x6b')](_0x2f7ede);}else{_0x5c7f8a[_0x0e52('0x6b')](_0x2f7ede);}}return _0x5c7f8a;}});}else{return _0x5c20cc;}}else{var _0x3788af=_['filter'](_0x5c20cc,function(_0x407e27){if(_0x407e27[_0x0e52('0x64')]!=='agent'){return _0x407e27;}});return _0x3788af;}});}else{return _0x5c20cc;}}})[_0x0e52('0x2b')](function(_0x11f807){var _0x5857a6=[];if(_0x11f807){_0x1e1705=_0x11f807;for(var _0x6683fe=0x0;_0x6683fe<_0x11f807[_0x0e52('0x3b')];_0x6683fe+=0x1){_0x1e1705[_0x6683fe]['messages']=[];_0x5857a6['push'](db[_0x0e52('0x31')][_0x0e52('0x4a')]({'where':{'FromId':[_0x1c4ea7[_0x0e52('0x59')]['id'],_0x11f807[_0x6683fe]['id']],'ToId':[_0x1c4ea7[_0x0e52('0x59')]['id'],_0x11f807[_0x6683fe]['id']],'ChatGroupId':null},'attributes':['id',_0x0e52('0x51'),_0x0e52('0x6c'),_0x0e52('0x6d'),'read',_0x0e52('0x4c')],'order':qs['sort'](_0x0e52('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x0e52('0x2b')](wrapUser(_0x11f807[_0x6683fe])));}return BPromise[_0x0e52('0x6f')](_0x5857a6);}return[];})['then'](function(_0x9f55c8){return{'rows':_0x9f55c8,'count':_0x9f55c8[_0x0e52('0x3b')]};})[_0x0e52('0x2b')](respondWithResult(_0x5bcb68,null))[_0x0e52('0x46')](handleError(_0x5bcb68,null));};
\ No newline at end of file
index 1d1f930..f1679c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x137b=['exports','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x360d0c,_0x5ea257){var _0x419c20=function(_0x36cd39){while(--_0x36cd39){_0x360d0c['push'](_0x360d0c['shift']());}};_0x419c20(++_0x5ea257);}(_0x137b,0xac));var _0xb137=function(_0x47c6b9,_0x210b3c){_0x47c6b9=_0x47c6b9-0x0;var _0x34f34d=_0x137b[_0x47c6b9];return _0x34f34d;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0xb137('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb137('0x1')](0x0);var events={'afterCreate':_0xb137('0x2'),'afterUpdate':_0xb137('0x3'),'afterDestroy':_0xb137('0x4')};function emitEvent(_0x5b4a51){return function(_0x45db83,_0x198c24,_0x3519d8){ChatInternalMessageEvents[_0xb137('0x5')](_0x5b4a51+':'+_0x45db83['id'],_0x45db83);ChatInternalMessageEvents['emit'](_0x5b4a51,_0x45db83);_0x3519d8(null);};}for(var e in events){if(events[_0xb137('0x6')](e)){var event=events[e];ChatInternalMessage[_0xb137('0x7')](e,emitEvent(event));}}module[_0xb137('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xfd5b=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xfd5b,0x15a));var _0xbfd5=function(_0x5078ab,_0x4422ca){_0x5078ab=_0x5078ab-0x0;var _0x248e42=_0xfd5b[_0x5078ab];return _0x248e42;};'use strict';var EventEmitter=require(_0xbfd5('0x0'));var ChatInternalMessage=require(_0xbfd5('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xbfd5('0x2')](0x0);var events={'afterCreate':_0xbfd5('0x3'),'afterUpdate':_0xbfd5('0x4'),'afterDestroy':_0xbfd5('0x5')};function emitEvent(_0x154a10){return function(_0x37c974,_0x1fb6ba,_0x16738b){ChatInternalMessageEvents[_0xbfd5('0x6')](_0x154a10+':'+_0x37c974['id'],_0x37c974);ChatInternalMessageEvents[_0xbfd5('0x6')](_0x154a10,_0x37c974);_0x16738b(null);};}for(var e in events){if(events[_0xbfd5('0x7')](e)){var event=events[e];ChatInternalMessage[_0xbfd5('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
index 2a1238b..da696ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94f1=['utf8mb4','lodash','util','api','moment','path','rimraf','./chatInternalMessage.attributes','exports','ChatInternalMessage','chat_internal_messages'];(function(_0x4dbe47,_0x325ef7){var _0x2fe4c5=function(_0x1f2fc8){while(--_0x1f2fc8){_0x4dbe47['push'](_0x4dbe47['shift']());}};_0x2fe4c5(++_0x325ef7);}(_0x94f1,0x7a));var _0x194f=function(_0x380c37,_0x57d3d1){_0x380c37=_0x380c37-0x0;var _0x47d664=_0x94f1[_0x380c37];return _0x47d664;};'use strict';var _=require(_0x194f('0x0'));var util=require(_0x194f('0x1'));var logger=require('../../config/logger')(_0x194f('0x2'));var moment=require(_0x194f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x194f('0x4'));var rimraf=require(_0x194f('0x5'));var config=require('../../config/environment');var attributes=require(_0x194f('0x6'));module[_0x194f('0x7')]=function(_0x55bd8b,_0x2db490){return _0x55bd8b['define'](_0x194f('0x8'),attributes,{'tableName':_0x194f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x194f('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x0c45=['ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes','exports','define'];(function(_0x248170,_0x2caf89){var _0x401039=function(_0xf55a0a){while(--_0xf55a0a){_0x248170['push'](_0x248170['shift']());}};_0x401039(++_0x2caf89);}(_0x0c45,0x114));var _0x50c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c45[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x50c4('0x0'));var util=require(_0x50c4('0x1'));var logger=require(_0x50c4('0x2'))(_0x50c4('0x3'));var moment=require(_0x50c4('0x4'));var BPromise=require(_0x50c4('0x5'));var rp=require(_0x50c4('0x6'));var fs=require('fs');var path=require(_0x50c4('0x7'));var rimraf=require('rimraf');var config=require(_0x50c4('0x8'));var attributes=require(_0x50c4('0x9'));module[_0x50c4('0xa')]=function(_0x5869af,_0x266633){return _0x5869af[_0x50c4('0xb')](_0x50c4('0xc'),attributes,{'tableName':_0x50c4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x50c4('0xe'),'collate':_0x50c4('0xf')});};
\ No newline at end of file
index 1a8de02..6186b55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x209f=['code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x1024a7,_0x4fd745){var _0x30b2b2=function(_0x258595){while(--_0x258595){_0x1024a7['push'](_0x1024a7['shift']());}};_0x30b2b2(++_0x4fd745);}(_0x209f,0x199));var _0xf209=function(_0x1958f0,_0x15ab19){_0x1958f0=_0x1958f0-0x0;var _0x252936=_0x209f[_0x1958f0];return _0x252936;};'use strict';var _=require(_0xf209('0x0'));var util=require('util');var moment=require(_0xf209('0x1'));var BPromise=require(_0xf209('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf209('0x3'));var db=require(_0xf209('0x4'))['db'];var utils=require(_0xf209('0x5'));var logger=require('../../config/logger')(_0xf209('0x6'));var config=require(_0xf209('0x7'));var jayson=require(_0xf209('0x8'));var client=jayson[_0xf209('0x9')][_0xf209('0xa')]({'port':0x232a});config['redis']=_[_0xf209('0xb')](config[_0xf209('0xc')],{'host':_0xf209('0xd'),'port':0x18eb});var socket=require(_0xf209('0xe'))(new Redis(config[_0xf209('0xc')]));require(_0xf209('0xf'))['register'](socket);function respondWithRpcPromise(_0x212cdd,_0x13e491,_0x471736){return new BPromise(function(_0x19a62a,_0x517aa4){return client[_0xf209('0x10')](_0x212cdd,_0x471736)[_0xf209('0x11')](function(_0x6eb857){logger[_0xf209('0x12')](_0xf209('0x13'),_0x13e491,_0xf209('0x14'));logger[_0xf209('0x15')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x13e491,'request\x20sent',JSON['stringify'](_0x6eb857));if(_0x6eb857[_0xf209('0x16')]){if(_0x6eb857[_0xf209('0x16')][_0xf209('0x17')]===0x1f4){logger['error'](_0xf209('0x13'),_0x13e491,_0x6eb857[_0xf209('0x16')][_0xf209('0x18')]);return _0x517aa4(_0x6eb857['error']['message']);}logger[_0xf209('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x13e491,_0x6eb857[_0xf209('0x16')][_0xf209('0x18')]);return _0x19a62a(_0x6eb857['error']['message']);}else{logger[_0xf209('0x12')](_0xf209('0x13'),_0x13e491,_0xf209('0x14'));_0x19a62a(_0x6eb857[_0xf209('0x19')][_0xf209('0x18')]);}})[_0xf209('0x1a')](function(_0x3fc4fa){logger[_0xf209('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x13e491,_0x3fc4fa);_0x517aa4(_0x3fc4fa);});});}
\ No newline at end of file
+var _0x9b08=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring'];(function(_0x3a223a,_0x303433){var _0xb6ac7d=function(_0x4a076d){while(--_0x4a076d){_0x3a223a['push'](_0x3a223a['shift']());}};_0xb6ac7d(++_0x303433);}(_0x9b08,0x1ea));var _0x89b0=function(_0xd7b0a4,_0x53c7d3){_0xd7b0a4=_0xd7b0a4-0x0;var _0x184e9e=_0x9b08[_0xd7b0a4];return _0x184e9e;};'use strict';var _=require(_0x89b0('0x0'));var util=require(_0x89b0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x89b0('0x2'));var fs=require('fs');var Redis=require(_0x89b0('0x3'));var db=require(_0x89b0('0x4'))['db'];var utils=require(_0x89b0('0x5'));var logger=require(_0x89b0('0x6'))(_0x89b0('0x7'));var config=require(_0x89b0('0x8'));var jayson=require(_0x89b0('0x9'));var client=jayson['client'][_0x89b0('0xa')]({'port':0x232a});config[_0x89b0('0xb')]=_[_0x89b0('0xc')](config[_0x89b0('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x89b0('0xd'))(new Redis(config[_0x89b0('0xb')]));require(_0x89b0('0xe'))[_0x89b0('0xf')](socket);function respondWithRpcPromise(_0xa79c19,_0x204524,_0x4d3484){return new BPromise(function(_0x164c91,_0x50c267){return client[_0x89b0('0x10')](_0xa79c19,_0x4d3484)[_0x89b0('0x11')](function(_0x5f797){logger[_0x89b0('0x12')](_0x89b0('0x13'),_0x204524,_0x89b0('0x14'));logger[_0x89b0('0x15')](_0x89b0('0x16'),_0x204524,_0x89b0('0x14'),JSON[_0x89b0('0x17')](_0x5f797));if(_0x5f797[_0x89b0('0x18')]){if(_0x5f797[_0x89b0('0x18')][_0x89b0('0x19')]===0x1f4){logger[_0x89b0('0x18')](_0x89b0('0x13'),_0x204524,_0x5f797[_0x89b0('0x18')][_0x89b0('0x1a')]);return _0x50c267(_0x5f797[_0x89b0('0x18')]['message']);}logger[_0x89b0('0x18')](_0x89b0('0x13'),_0x204524,_0x5f797[_0x89b0('0x18')][_0x89b0('0x1a')]);return _0x164c91(_0x5f797['error'][_0x89b0('0x1a')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x204524,_0x89b0('0x14'));_0x164c91(_0x5f797[_0x89b0('0x1b')][_0x89b0('0x1a')]);}})[_0x89b0('0x1c')](function(_0x125000){logger[_0x89b0('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x204524,_0x125000);_0x50c267(_0x125000);});});}
\ No newline at end of file
index 82665ee..b303f58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04ba=['./chatInternalMessage.events','remove','register','length'];(function(_0x5b9231,_0x2181c6){var _0x1f7959=function(_0xa1620d){while(--_0xa1620d){_0x5b9231['push'](_0x5b9231['shift']());}};_0x1f7959(++_0x2181c6);}(_0x04ba,0x14c));var _0xa04b=function(_0x270485,_0x455f1e){_0x270485=_0x270485-0x0;var _0x20fa79=_0x04ba[_0x270485];return _0x20fa79;};'use strict';var ChatInternalMessageEvents=require(_0xa04b('0x0'));var events=['save',_0xa04b('0x1'),'update'];function createListener(_0x1025dc,_0x35ed23){return function(_0x10fa3f){_0x35ed23['emit'](_0x1025dc,_0x10fa3f);};}function removeListener(_0x33276b,_0x33d4d3){return function(){ChatInternalMessageEvents['removeListener'](_0x33276b,_0x33d4d3);};}exports[_0xa04b('0x2')]=function(_0x3bc9be){for(var _0x2cd468=0x0,_0x331e81=events[_0xa04b('0x3')];_0x2cd468<_0x331e81;_0x2cd468++){var _0xe1c3d8=events[_0x2cd468];var _0x523a9e=createListener('chatInternalMessage:'+_0xe1c3d8,_0x3bc9be);ChatInternalMessageEvents['on'](_0xe1c3d8,_0x523a9e);}};
\ No newline at end of file
+var _0xd5b3=['length','chatInternalMessage:','./chatInternalMessage.events','save','update','emit','removeListener','register'];(function(_0x372515,_0xdd11f){var _0xa3bf4e=function(_0x212cc8){while(--_0x212cc8){_0x372515['push'](_0x372515['shift']());}};_0xa3bf4e(++_0xdd11f);}(_0xd5b3,0x1c2));var _0x3d5b=function(_0x385314,_0x23ec21){_0x385314=_0x385314-0x0;var _0x5ed4e4=_0xd5b3[_0x385314];return _0x5ed4e4;};'use strict';var ChatInternalMessageEvents=require(_0x3d5b('0x0'));var events=[_0x3d5b('0x1'),'remove',_0x3d5b('0x2')];function createListener(_0x24e27f,_0x1e4241){return function(_0x168bc3){_0x1e4241[_0x3d5b('0x3')](_0x24e27f,_0x168bc3);};}function removeListener(_0x2bf06b,_0x47c029){return function(){ChatInternalMessageEvents[_0x3d5b('0x4')](_0x2bf06b,_0x47c029);};}exports[_0x3d5b('0x5')]=function(_0x342936){for(var _0x28a9bb=0x0,_0x175c8d=events[_0x3d5b('0x6')];_0x28a9bb<_0x175c8d;_0x28a9bb++){var _0x33cce5=events[_0x28a9bb];var _0x50971d=createListener(_0x3d5b('0x7')+_0x33cce5,_0x342936);ChatInternalMessageEvents['on'](_0x33cce5,_0x50971d);}};
\ No newline at end of file
index f5f2fc2..8a6ba56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb88=['getUsers','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xcb88,0x1ea));var _0x8cb8=function(_0x204728,_0x200843){_0x204728=_0x204728-0x0;var _0x36c979=_0xcb88[_0x204728];return _0x36c979;};'use strict';var multer=require(_0x8cb8('0x0'));var util=require(_0x8cb8('0x1'));var path=require(_0x8cb8('0x2'));var timeout=require(_0x8cb8('0x3'));var express=require(_0x8cb8('0x4'));var router=express[_0x8cb8('0x5')]();var fs_extra=require(_0x8cb8('0x6'));var auth=require(_0x8cb8('0x7'));var interaction=require(_0x8cb8('0x8'));var config=require(_0x8cb8('0x9'));var controller=require('./chatInternalMessage.controller');router[_0x8cb8('0xa')]('/',auth[_0x8cb8('0xb')](),controller[_0x8cb8('0xc')]);router['get'](_0x8cb8('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x8cb8('0xa')]('/users',auth['isAuthenticated'](),controller[_0x8cb8('0xe')]);router[_0x8cb8('0xa')](_0x8cb8('0xf'),auth[_0x8cb8('0xb')](),controller[_0x8cb8('0x10')]);router[_0x8cb8('0x11')]('/',auth['isAuthenticated'](),controller[_0x8cb8('0x12')]);router[_0x8cb8('0x13')](_0x8cb8('0xf'),controller[_0x8cb8('0x14')]);router[_0x8cb8('0x15')](_0x8cb8('0xf'),auth['isAuthenticated'](),controller[_0x8cb8('0x16')]);module[_0x8cb8('0x17')]=router;
\ No newline at end of file
+var _0x1bdd=['index','/describe','getUsers','show','post','create','put','/:id','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated'];(function(_0x4e1a49,_0x4da738){var _0x136aae=function(_0x3ffd93){while(--_0x3ffd93){_0x4e1a49['push'](_0x4e1a49['shift']());}};_0x136aae(++_0x4da738);}(_0x1bdd,0x129));var _0xd1bd=function(_0x1654fc,_0x2a775d){_0x1654fc=_0x1654fc-0x0;var _0x2db2eb=_0x1bdd[_0x1654fc];return _0x2db2eb;};'use strict';var multer=require('multer');var util=require(_0xd1bd('0x0'));var path=require(_0xd1bd('0x1'));var timeout=require('connect-timeout');var express=require(_0xd1bd('0x2'));var router=express[_0xd1bd('0x3')]();var fs_extra=require(_0xd1bd('0x4'));var auth=require(_0xd1bd('0x5'));var interaction=require(_0xd1bd('0x6'));var config=require(_0xd1bd('0x7'));var controller=require(_0xd1bd('0x8'));router[_0xd1bd('0x9')]('/',auth[_0xd1bd('0xa')](),controller[_0xd1bd('0xb')]);router[_0xd1bd('0x9')](_0xd1bd('0xc'),auth[_0xd1bd('0xa')](),controller['describe']);router[_0xd1bd('0x9')]('/users',auth[_0xd1bd('0xa')](),controller[_0xd1bd('0xd')]);router[_0xd1bd('0x9')]('/:id',auth[_0xd1bd('0xa')](),controller[_0xd1bd('0xe')]);router[_0xd1bd('0xf')]('/',auth[_0xd1bd('0xa')](),controller[_0xd1bd('0x10')]);router[_0xd1bd('0x11')](_0xd1bd('0x12'),controller['update']);router[_0xd1bd('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xd1bd('0x14')]);module[_0xd1bd('0x15')]=router;
\ No newline at end of file
index 1bb62e1..6230a8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b17=['STRING','sequelize','TEXT','BOOLEAN','out'];(function(_0x2d4946,_0x422382){var _0x1905a1=function(_0x19e1c5){while(--_0x19e1c5){_0x2d4946['push'](_0x2d4946['shift']());}};_0x1905a1(++_0x422382);}(_0x4b17,0x10f));var _0x74b1=function(_0x545bed,_0x221e96){_0x545bed=_0x545bed-0x0;var _0x16c79c=_0x4b17[_0x545bed];return _0x16c79c;};'use strict';var Sequelize=require(_0x74b1('0x0'));module['exports']={'body':{'type':Sequelize[_0x74b1('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x74b1('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x74b1('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x74b1('0x3')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x74b1('0x4')]},'providerResponse':{'type':Sequelize[_0x74b1('0x1')]}};
\ No newline at end of file
+var _0x253d=['out','DATE','TEXT','sequelize','BOOLEAN','ENUM'];(function(_0x403c00,_0x14a828){var _0x57985c=function(_0xdd59e8){while(--_0xdd59e8){_0x403c00['push'](_0x403c00['shift']());}};_0x57985c(++_0x14a828);}(_0x253d,0x1b3));var _0xd253=function(_0x44e240,_0x4357a4){_0x44e240=_0x44e240-0x0;var _0x5670cf=_0x253d[_0x44e240];return _0x5670cf;};'use strict';var Sequelize=require(_0xd253('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xd253('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd253('0x2')]('in',_0xd253('0x3')),'defaultValue':_0xd253('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd253('0x4')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xd253('0x5')]}};
\ No newline at end of file
index e15c3ee..ce9ebdc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57f8=['ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','params','find','create','body','describe','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteraction','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','sequelize','QueryTypes','contact','User','fullname','email','internal','manual','interface','SIP/%s','user','channel','motionChannel','EventManager','parse','formData','chat-interactions','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','SELECT','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','http','client','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x47d3ce,_0x41ac2c){var _0xb7d1db=function(_0x13c8be){while(--_0x13c8be){_0x47d3ce['push'](_0x47d3ce['shift']());}};_0xb7d1db(++_0x41ac2c);}(_0x57f8,0x1e3));var _0x857f=function(_0xb31b62,_0x309405){_0xb31b62=_0xb31b62-0x0;var _0x3928ed=_0x57f8[_0xb31b62];return _0x3928ed;};'use strict';var emlformat=require(_0x857f('0x0'));var rimraf=require(_0x857f('0x1'));var zipdir=require(_0x857f('0x2'));var jsonpatch=require(_0x857f('0x3'));var rp=require(_0x857f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x857f('0x5'));var util=require(_0x857f('0x6'));var path=require(_0x857f('0x7'));var sox=require(_0x857f('0x8'));var csv=require('to-csv');var ejs=require(_0x857f('0x9'));var fs=require('fs');var fs_extra=require(_0x857f('0xa'));var _=require(_0x857f('0xb'));var squel=require(_0x857f('0xc'));var crypto=require(_0x857f('0xd'));var jsforce=require(_0x857f('0xe'));var deskjs=require(_0x857f('0xf'));var toCsv=require(_0x857f('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x857f('0x11'));var as=require(_0x857f('0x12'));var hardwareService=require(_0x857f('0x13'));var logger=require(_0x857f('0x14'))(_0x857f('0x15'));var utils=require(_0x857f('0x16'));var config=require(_0x857f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x857f('0x18'))['db'];config[_0x857f('0x19')]=_[_0x857f('0x1a')](config[_0x857f('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x857f('0x1b'))(new Redis(config[_0x857f('0x19')]));require('./chatMessage.socket')[_0x857f('0x1c')](socket);var jayson=require(_0x857f('0x1d'));var client=jayson['client'][_0x857f('0x1e')]({'port':0x232c});var client9002=jayson[_0x857f('0x1f')][_0x857f('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x138297,_0x370133,_0x12cae0,_0x578738){return new BPromise(function(_0x3324ec,_0x32ef3c){var _0x1d300e=_0x578738||client;return _0x1d300e['request'](_0x138297,_0x12cae0)[_0x857f('0x20')](function(_0x3cf807){logger[_0x857f('0x21')](_0x857f('0x22'),_0x370133,_0x857f('0x23'));logger[_0x857f('0x24')](_0x857f('0x25'),_0x370133,_0x857f('0x23'),JSON['stringify'](_0x3cf807));if(_0x3cf807[_0x857f('0x26')]){if(_0x3cf807[_0x857f('0x26')][_0x857f('0x27')]===0x1f4){logger[_0x857f('0x26')]('ChatMessage,\x20%s,\x20%s',_0x370133,_0x3cf807['error']['message']);return _0x32ef3c(_0x3cf807['error'][_0x857f('0x28')]);}logger[_0x857f('0x26')](_0x857f('0x22'),_0x370133,_0x3cf807[_0x857f('0x26')][_0x857f('0x28')]);return _0x3324ec(_0x3cf807[_0x857f('0x26')]['message']);}else{logger[_0x857f('0x21')](_0x857f('0x22'),_0x370133,_0x857f('0x23'));_0x3324ec(_0x3cf807[_0x857f('0x29')]['message']);}})[_0x857f('0x2a')](function(_0x79cd87){logger['error'](_0x857f('0x22'),_0x370133,_0x79cd87);_0x32ef3c(_0x79cd87);});});}function respondWithStatusCode(_0x5a3ba0,_0x33f220){_0x33f220=_0x33f220||0xcc;return function(_0x4b9dcc){if(_0x4b9dcc){return _0x5a3ba0[_0x857f('0x2b')](_0x33f220);}return _0x5a3ba0[_0x857f('0x2c')](_0x33f220)[_0x857f('0x2d')]();};}function respondWithResult(_0x36200b,_0x18edac){_0x18edac=_0x18edac||0xc8;return function(_0x347439){if(_0x347439){return _0x36200b['status'](_0x18edac)[_0x857f('0x2e')](_0x347439);}};}function respondWithFilteredResult(_0x4bb6e2,_0x377d40){return function(_0x13ec0e){if(_0x13ec0e){var _0x5e8c0f=typeof _0x377d40[_0x857f('0x2f')]==='undefined'&&typeof _0x377d40[_0x857f('0x30')]==='undefined';var _0x1cd2cd=_0x13ec0e[_0x857f('0x31')];var _0x57c6e2=_0x5e8c0f?0x0:_0x377d40[_0x857f('0x2f')];var _0x4342a3=_0x5e8c0f?_0x13ec0e['count']:_0x377d40[_0x857f('0x2f')]+_0x377d40['limit'];var _0x476ec5;if(_0x4342a3>=_0x1cd2cd){_0x4342a3=_0x1cd2cd;_0x476ec5=0xc8;}else{_0x476ec5=0xce;}_0x4bb6e2[_0x857f('0x2c')](_0x476ec5);return _0x4bb6e2[_0x857f('0x32')]('Content-Range',_0x57c6e2+'-'+_0x4342a3+'/'+_0x1cd2cd)[_0x857f('0x2e')](_0x13ec0e);}return null;};}function patchUpdates(_0x4989a6){return function(_0x4e574c){try{jsonpatch[_0x857f('0x33')](_0x4e574c,_0x4989a6,!![]);}catch(_0x5c8b2d){return BPromise[_0x857f('0x34')](_0x5c8b2d);}return _0x4e574c[_0x857f('0x35')]();};}function saveUpdates(_0x358320,_0x1b801b){return function(_0xc2c464){if(_0xc2c464){return _0xc2c464[_0x857f('0x36')](_0x358320)[_0x857f('0x20')](function(_0x4344b2){return _0x4344b2;});}return null;};}function removeEntity(_0x4a26cf,_0x245507){return function(_0x55c2bb){if(_0x55c2bb){return _0x55c2bb[_0x857f('0x37')]()[_0x857f('0x20')](function(){_0x4a26cf[_0x857f('0x2c')](0xcc)[_0x857f('0x2d')]();});}};}function handleEntityNotFound(_0x5d4c5c,_0x4177ef){return function(_0xf2ba3d){if(!_0xf2ba3d){_0x5d4c5c[_0x857f('0x2b')](0x194);}return _0xf2ba3d;};}function handleError(_0x1cdfed,_0x312935){_0x312935=_0x312935||0x1f4;return function(_0x3b5977){logger[_0x857f('0x26')](_0x3b5977[_0x857f('0x38')]);if(_0x3b5977['name']){delete _0x3b5977[_0x857f('0x39')];}_0x1cdfed[_0x857f('0x2c')](_0x312935)[_0x857f('0x3a')](_0x3b5977);};}exports[_0x857f('0x3b')]=function(_0x2e3626,_0x150871){var _0x190887={},_0x4b7931={},_0x14ec3c={'count':0x0,'rows':[]};var _0x178c69=_[_0x857f('0x3c')](db[_0x857f('0x3d')][_0x857f('0x3e')],function(_0x4212d2){return{'name':_0x4212d2[_0x857f('0x3f')],'type':_0x4212d2[_0x857f('0x40')][_0x857f('0x41')]};});_0x4b7931['model']=_[_0x857f('0x3c')](_0x178c69,_0x857f('0x39'));_0x4b7931[_0x857f('0x42')]=_[_0x857f('0x43')](_0x2e3626[_0x857f('0x42')]);_0x4b7931['filters']=_[_0x857f('0x44')](_0x4b7931[_0x857f('0x45')],_0x4b7931['query']);_0x190887[_0x857f('0x46')]=_[_0x857f('0x44')](_0x4b7931[_0x857f('0x45')],qs[_0x857f('0x47')](_0x2e3626[_0x857f('0x42')][_0x857f('0x47')]));_0x190887[_0x857f('0x46')]=_0x190887[_0x857f('0x46')][_0x857f('0x48')]?_0x190887[_0x857f('0x46')]:_0x4b7931[_0x857f('0x45')];if(!_0x2e3626[_0x857f('0x42')]['hasOwnProperty']('nolimit')){_0x190887[_0x857f('0x30')]=qs['limit'](_0x2e3626[_0x857f('0x42')][_0x857f('0x30')]);_0x190887[_0x857f('0x2f')]=qs['offset'](_0x2e3626[_0x857f('0x42')][_0x857f('0x2f')]);}_0x190887[_0x857f('0x49')]=qs[_0x857f('0x4a')](_0x2e3626['query'][_0x857f('0x4a')]);_0x190887[_0x857f('0x4b')]=qs[_0x857f('0x4c')](_[_0x857f('0x4d')](_0x2e3626['query'],_0x4b7931['filters']),_0x178c69);if(_0x2e3626['query'][_0x857f('0x4e')]){_0x190887[_0x857f('0x4b')]=_[_0x857f('0x4f')](_0x190887[_0x857f('0x4b')],{'$or':_[_0x857f('0x3c')](_0x178c69,function(_0x5c59c1){if(_0x5c59c1[_0x857f('0x40')]!==_0x857f('0x50')){var _0x4fb23e={};_0x4fb23e[_0x5c59c1[_0x857f('0x39')]]={'$like':'%'+_0x2e3626[_0x857f('0x42')][_0x857f('0x4e')]+'%'};return _0x4fb23e;}})});}_0x190887=_['merge']({},_0x190887,_0x2e3626[_0x857f('0x51')]);var _0x2a4112={'where':_0x190887[_0x857f('0x4b')]};return db[_0x857f('0x3d')][_0x857f('0x31')](_0x2a4112)[_0x857f('0x20')](function(_0x1b5317){_0x14ec3c[_0x857f('0x31')]=_0x1b5317;if(_0x2e3626[_0x857f('0x42')]['includeAll']){_0x190887[_0x857f('0x52')]=[{'all':!![]}];}return db[_0x857f('0x3d')]['findAll'](_0x190887);})[_0x857f('0x20')](function(_0x34380d){_0x14ec3c[_0x857f('0x53')]=_0x34380d;return _0x14ec3c;})[_0x857f('0x20')](respondWithFilteredResult(_0x150871,_0x190887))[_0x857f('0x2a')](handleError(_0x150871,null));};exports['show']=function(_0x42b2fc,_0x4a9c4e){var _0x1bac3c={'raw':!![],'where':{'id':_0x42b2fc[_0x857f('0x54')]['id']}},_0x430de6={};_0x430de6[_0x857f('0x45')]=_[_0x857f('0x43')](db['ChatMessage'][_0x857f('0x3e')]);_0x430de6[_0x857f('0x42')]=_['keys'](_0x42b2fc[_0x857f('0x42')]);_0x430de6[_0x857f('0x4c')]=_[_0x857f('0x44')](_0x430de6[_0x857f('0x45')],_0x430de6[_0x857f('0x42')]);_0x1bac3c[_0x857f('0x46')]=_[_0x857f('0x44')](_0x430de6['model'],qs[_0x857f('0x47')](_0x42b2fc['query'][_0x857f('0x47')]));_0x1bac3c[_0x857f('0x46')]=_0x1bac3c['attributes'][_0x857f('0x48')]?_0x1bac3c[_0x857f('0x46')]:_0x430de6[_0x857f('0x45')];if(_0x42b2fc['query']['includeAll']){_0x1bac3c[_0x857f('0x52')]=[{'all':!![]}];}_0x1bac3c=_[_0x857f('0x4f')]({},_0x1bac3c,_0x42b2fc[_0x857f('0x51')]);return db[_0x857f('0x3d')][_0x857f('0x55')](_0x1bac3c)[_0x857f('0x20')](handleEntityNotFound(_0x4a9c4e,null))[_0x857f('0x20')](respondWithResult(_0x4a9c4e,null))[_0x857f('0x2a')](handleError(_0x4a9c4e,null));};exports[_0x857f('0x56')]=function(_0x50e645,_0x1bd0aa){return db[_0x857f('0x3d')]['create'](_0x50e645[_0x857f('0x57')],{})['then'](respondWithResult(_0x1bd0aa,0xc9))[_0x857f('0x2a')](handleError(_0x1bd0aa,null));};exports[_0x857f('0x36')]=function(_0x4db953,_0x1ae91d){if(_0x4db953[_0x857f('0x57')]['id']){delete _0x4db953[_0x857f('0x57')]['id'];}return db[_0x857f('0x3d')][_0x857f('0x55')]({'where':{'id':_0x4db953[_0x857f('0x54')]['id']}})[_0x857f('0x20')](handleEntityNotFound(_0x1ae91d,null))[_0x857f('0x20')](saveUpdates(_0x4db953[_0x857f('0x57')],null))[_0x857f('0x20')](respondWithResult(_0x1ae91d,null))[_0x857f('0x2a')](handleError(_0x1ae91d,null));};exports['destroy']=function(_0x419d85,_0x361f6d){return db['ChatMessage'][_0x857f('0x55')]({'where':{'id':_0x419d85[_0x857f('0x54')]['id']}})['then'](handleEntityNotFound(_0x361f6d,null))[_0x857f('0x20')](removeEntity(_0x361f6d,null))[_0x857f('0x2a')](handleError(_0x361f6d,null));};exports['describe']=function(_0x1e00dd,_0x1dcc94){return db[_0x857f('0x3d')][_0x857f('0x58')]()[_0x857f('0x20')](respondWithResult(_0x1dcc94,null))[_0x857f('0x2a')](handleError(_0x1dcc94,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports['accept']=function(_0x21c6b1,_0x34fc5f,_0x21bbcb){var _0x39d5a5={'agent':{},'channel':_0x857f('0x59')};if(_0x21c6b1['body']['id']){delete _0x21c6b1[_0x857f('0x57')]['id'];}_0x21c6b1[_0x857f('0x57')][_0x857f('0x5a')]=!![];_0x21c6b1[_0x857f('0x57')][_0x857f('0x5b')]=moment()['format'](_0x857f('0x5c'));_0x21c6b1[_0x857f('0x57')][_0x857f('0x5d')]=_0x21c6b1['body'][_0x857f('0x5d')]||_0x21c6b1['user']['id'];_0x39d5a5[_0x857f('0x5e')]['id']=_0x21c6b1['body'][_0x857f('0x5d')];return db[_0x857f('0x3d')][_0x857f('0x55')]({'where':{'id':_0x21c6b1[_0x857f('0x54')]['id'],'UserId':null}})[_0x857f('0x20')](handleEntityNotFound(_0x34fc5f,null))[_0x857f('0x20')](saveUpdates(_0x21c6b1[_0x857f('0x57')],null))[_0x857f('0x20')](function(_0x1975b4){if(_0x1975b4){_0x39d5a5[_0x857f('0x28')]=_0x1975b4[_0x857f('0x5f')]({'plain':!![]});return db[_0x857f('0x60')][_0x857f('0x55')]({'where':{'id':_0x1975b4['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x34fc5f,null))[_0x857f('0x20')](function(_0x3997b4){if(_0x3997b4){return _0x3997b4[_0x857f('0x36')]({'UserId':_0x21c6b1[_0x857f('0x57')][_0x857f('0x5d')],'read1stAt':_['isNil'](_0x3997b4['read1stAt'])?moment()[_0x857f('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x857f('0x20')](function(_0x2fc80a){if(_0x2fc80a){_0x39d5a5[_0x857f('0x62')]=_0x2fc80a['get']({'plain':!![]});interaction_log['info'](_0x857f('0x63'),_0x21c6b1['user']['id'],_0x21c6b1['user'][_0x857f('0x39')],_0x21c6b1['user'][_0x857f('0x64')],_0x39d5a5[_0x857f('0x62')]['id'],_0x21c6b1['body']?JSON[_0x857f('0x65')](_0x21c6b1[_0x857f('0x57')]):_0x857f('0x66'));return respondWithRpcPromise(_0x857f('0x67'),_0x857f('0x68'),_0x39d5a5);}return null;})[_0x857f('0x20')](function(_0x732a1d){var _0x45fa9f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x732a1d['message']['ContactId'];return db[_0x857f('0x69')][_0x857f('0x42')](_0x45fa9f,{'type':db['Sequelize'][_0x857f('0x6a')]['SELECT'],'raw':!![]})[_0x857f('0x20')](function(_0x497d7b){return _0x497d7b;});})[_0x857f('0x20')](function(_0x250b7b){if(_0x250b7b){_0x39d5a5[_0x857f('0x28')][_0x857f('0x6b')]=_0x250b7b[0x0];if(!_0x21c6b1[_0x857f('0x57')][_0x857f('0x5d')])return;return db[_0x857f('0x6c')][_0x857f('0x55')]({'where':{'id':_0x21c6b1['body'][_0x857f('0x5d')],'role':_0x857f('0x5e')},'attributes':['id','name',_0x857f('0x6d'),_0x857f('0x6e'),_0x857f('0x6f')],'raw':!![]});}return null;})[_0x857f('0x20')](function(_0x1c417d){if(!_0x1c417d)return null;_0x39d5a5['message']['agent']=_0x1c417d;return _0x39d5a5;})[_0x857f('0x20')](function(_0x1f964d){if(_0x1f964d){if(_0x21c6b1[_0x857f('0x57')][_0x857f('0x70')]){_0x39d5a5['message'][_0x857f('0x71')]=util['format'](_0x857f('0x72'),_0x21c6b1[_0x857f('0x73')][_0x857f('0x39')]);_0x39d5a5[_0x857f('0x28')]['channel']=_0x39d5a5[_0x857f('0x74')];_0x39d5a5[_0x857f('0x28')][_0x857f('0x75')]=_0x39d5a5[_0x857f('0x74')];_0x39d5a5[_0x857f('0x28')]['event']='accept';return respondWithRpcPromise(_0x857f('0x76'),_0x857f('0x76'),{'event':'acceptmessage','message':_[_0x857f('0x4f')](_0x39d5a5[_0x857f('0x28')],JSON[_0x857f('0x77')](_0x39d5a5[_0x857f('0x62')][_0x857f('0x78')]))},client9002)['then'](function(){return _0x39d5a5;});}return _0x39d5a5;}return null;})[_0x857f('0x20')](respondWithResult(_0x34fc5f,null))[_0x857f('0x2a')](handleError(_0x34fc5f,null));};var interaction_log=require(_0x857f('0x14'))(_0x857f('0x79'));exports[_0x857f('0x34')]=function(_0x44126f,_0x27fc9e,_0x3eaaf5){var _0x46b0e4={'agent':{},'channel':'chat'};if(_0x44126f[_0x857f('0x57')]['id']){delete _0x44126f[_0x857f('0x57')]['id'];}_0x44126f[_0x857f('0x57')]['UserId']=_0x44126f[_0x857f('0x57')][_0x857f('0x5d')]||_0x44126f[_0x857f('0x73')]['id'];_0x46b0e4['agent']['id']=_0x44126f[_0x857f('0x57')][_0x857f('0x5d')];return db[_0x857f('0x3d')][_0x857f('0x55')]({'where':{'id':_0x44126f[_0x857f('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x27fc9e,null))[_0x857f('0x20')](function(_0x16074a){if(_0x16074a){_0x46b0e4[_0x857f('0x28')]=_0x16074a['get']({'plain':!![]});return db[_0x857f('0x60')]['find']({'where':{'id':_0x16074a[_0x857f('0x7a')]}});}return null;})['then'](handleEntityNotFound(_0x27fc9e,null))[_0x857f('0x20')](function(_0x11703d){if(_0x11703d){_0x46b0e4['interaction']=_0x11703d[_0x857f('0x5f')]({'plain':!![]});interaction_log[_0x857f('0x21')](_0x857f('0x7b'),_0x44126f[_0x857f('0x73')]['id'],_0x44126f['user'][_0x857f('0x39')],_0x44126f[_0x857f('0x73')][_0x857f('0x64')],_0x46b0e4[_0x857f('0x62')]['id'],_0x44126f['body']?JSON[_0x857f('0x65')](_0x44126f['body']):_0x857f('0x66'));return respondWithRpcPromise(_0x857f('0x7c'),_0x857f('0x7d'),_0x46b0e4);}return null;})[_0x857f('0x20')](function(_0x23fb85){var _0x341a9d=_0x857f('0x7e')+_0x23fb85[_0x857f('0x28')]['ContactId'];return db[_0x857f('0x69')][_0x857f('0x42')](_0x341a9d,{'type':db[_0x857f('0x7f')][_0x857f('0x6a')][_0x857f('0x80')],'raw':!![]})[_0x857f('0x20')](function(_0x7ae6f4){return _0x7ae6f4;});})['then'](function(_0x20e078){if(_0x20e078){_0x46b0e4['message']['contact']=_0x20e078[0x0];if(!_0x44126f[_0x857f('0x57')][_0x857f('0x5d')])return;return db['User'][_0x857f('0x55')]({'where':{'id':_0x44126f['body'][_0x857f('0x5d')],'role':_0x857f('0x5e')},'attributes':['id',_0x857f('0x39'),_0x857f('0x6d'),'email',_0x857f('0x6f')],'raw':!![]});}return null;})['then'](function(_0x2ea1f5){if(!_0x2ea1f5)return null;_0x46b0e4['message'][_0x857f('0x5e')]=_0x2ea1f5;return _0x46b0e4;})[_0x857f('0x20')](function(_0x2f522f){if(_0x2f522f){_0x2f522f[_0x857f('0x28')][_0x857f('0x71')]=util[_0x857f('0x61')]('SIP/%s',_0x44126f['user'][_0x857f('0x39')]);_0x2f522f['message']['channel']=_0x46b0e4[_0x857f('0x74')];_0x2f522f[_0x857f('0x28')][_0x857f('0x75')]=_0x46b0e4['channel'];_0x2f522f[_0x857f('0x28')]['event']=_0x857f('0x34');respondWithRpcPromise('EventManager',_0x857f('0x76'),{'event':_0x857f('0x81'),'message':_[_0x857f('0x4f')](_0x46b0e4['message'],JSON[_0x857f('0x77')](_0x46b0e4[_0x857f('0x62')][_0x857f('0x78')]))},client9002);return _0x46b0e4;}return null;})[_0x857f('0x20')](respondWithResult(_0x27fc9e,null))[_0x857f('0x2a')](handleError(_0x27fc9e,null));};
\ No newline at end of file
+var _0x41ff=['./chatMessage.socket','jayson/promise','client','http','request','info','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','destroy','then','stack','name','send','map','ChatMessage','rawAttributes','fieldName','key','model','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','merge','type','VIRTUAL','filter','include','findAll','rows','catch','show','keys','includeAll','options','find','create','body','params','describe','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','User','fullname','manual','interface','SIP/%s','channel','EventManager','acceptmessage','parse','formData','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes','contact','email','internal','reject','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','defaults','socket.io-emitter','redis'];(function(_0x47f8cb,_0x44459e){var _0x24a7d6=function(_0x33aa4e){while(--_0x33aa4e){_0x47f8cb['push'](_0x47f8cb['shift']());}};_0x24a7d6(++_0x44459e);}(_0x41ff,0x16c));var _0xf41f=function(_0x16c387,_0x19538a){_0x16c387=_0x16c387-0x0;var _0x45b8d6=_0x41ff[_0x16c387];return _0x45b8d6;};'use strict';var emlformat=require(_0xf41f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf41f('0x1'));var jsonpatch=require(_0xf41f('0x2'));var rp=require(_0xf41f('0x3'));var moment=require(_0xf41f('0x4'));var BPromise=require(_0xf41f('0x5'));var Mustache=require('mustache');var util=require(_0xf41f('0x6'));var path=require('path');var sox=require(_0xf41f('0x7'));var csv=require('to-csv');var ejs=require(_0xf41f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf41f('0x9'));var squel=require(_0xf41f('0xa'));var crypto=require(_0xf41f('0xb'));var jsforce=require(_0xf41f('0xc'));var deskjs=require(_0xf41f('0xd'));var toCsv=require(_0xf41f('0xe'));var querystring=require(_0xf41f('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf41f('0x10'));var qs=require(_0xf41f('0x11'));var as=require(_0xf41f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf41f('0x13'))(_0xf41f('0x14'));var utils=require(_0xf41f('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf41f('0x16'))['db'];config['redis']=_[_0xf41f('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf41f('0x18'))(new Redis(config[_0xf41f('0x19')]));require(_0xf41f('0x1a'))['register'](socket);var jayson=require(_0xf41f('0x1b'));var client=jayson[_0xf41f('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0xf41f('0x1c')][_0xf41f('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x249b9b,_0x48ea42,_0x24abaf,_0x2e28e3){return new BPromise(function(_0x5035f0,_0x2eda3e){var _0x1d0324=_0x2e28e3||client;return _0x1d0324[_0xf41f('0x1e')](_0x249b9b,_0x24abaf)['then'](function(_0x3b53fc){logger[_0xf41f('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x48ea42,'request\x20sent');logger[_0xf41f('0x20')](_0xf41f('0x21'),_0x48ea42,_0xf41f('0x22'),JSON[_0xf41f('0x23')](_0x3b53fc));if(_0x3b53fc[_0xf41f('0x24')]){if(_0x3b53fc[_0xf41f('0x24')][_0xf41f('0x25')]===0x1f4){logger[_0xf41f('0x24')](_0xf41f('0x26'),_0x48ea42,_0x3b53fc[_0xf41f('0x24')][_0xf41f('0x27')]);return _0x2eda3e(_0x3b53fc[_0xf41f('0x24')][_0xf41f('0x27')]);}logger[_0xf41f('0x24')](_0xf41f('0x26'),_0x48ea42,_0x3b53fc[_0xf41f('0x24')][_0xf41f('0x27')]);return _0x5035f0(_0x3b53fc[_0xf41f('0x24')][_0xf41f('0x27')]);}else{logger[_0xf41f('0x1f')](_0xf41f('0x26'),_0x48ea42,_0xf41f('0x22'));_0x5035f0(_0x3b53fc[_0xf41f('0x28')][_0xf41f('0x27')]);}})['catch'](function(_0x19ef37){logger[_0xf41f('0x24')](_0xf41f('0x26'),_0x48ea42,_0x19ef37);_0x2eda3e(_0x19ef37);});});}function respondWithStatusCode(_0x99e029,_0x2db363){_0x2db363=_0x2db363||0xcc;return function(_0x3ba9bd){if(_0x3ba9bd){return _0x99e029[_0xf41f('0x29')](_0x2db363);}return _0x99e029[_0xf41f('0x2a')](_0x2db363)[_0xf41f('0x2b')]();};}function respondWithResult(_0x4ce728,_0x20ff8b){_0x20ff8b=_0x20ff8b||0xc8;return function(_0x54b3ae){if(_0x54b3ae){return _0x4ce728[_0xf41f('0x2a')](_0x20ff8b)[_0xf41f('0x2c')](_0x54b3ae);}};}function respondWithFilteredResult(_0x44d229,_0x212e55){return function(_0x4ff8b4){if(_0x4ff8b4){var _0x1b3ded=typeof _0x212e55['offset']==='undefined'&&typeof _0x212e55['limit']==='undefined';var _0x37a15d=_0x4ff8b4[_0xf41f('0x2d')];var _0x37f1ea=_0x1b3ded?0x0:_0x212e55[_0xf41f('0x2e')];var _0x4ef722=_0x1b3ded?_0x4ff8b4[_0xf41f('0x2d')]:_0x212e55[_0xf41f('0x2e')]+_0x212e55[_0xf41f('0x2f')];var _0x2cce8;if(_0x4ef722>=_0x37a15d){_0x4ef722=_0x37a15d;_0x2cce8=0xc8;}else{_0x2cce8=0xce;}_0x44d229['status'](_0x2cce8);return _0x44d229[_0xf41f('0x30')]('Content-Range',_0x37f1ea+'-'+_0x4ef722+'/'+_0x37a15d)['json'](_0x4ff8b4);}return null;};}function patchUpdates(_0x1af579){return function(_0x4de2a8){try{jsonpatch[_0xf41f('0x31')](_0x4de2a8,_0x1af579,!![]);}catch(_0x304302){return BPromise['reject'](_0x304302);}return _0x4de2a8[_0xf41f('0x32')]();};}function saveUpdates(_0xcf1c9d,_0x5297c1){return function(_0x19d979){if(_0x19d979){return _0x19d979[_0xf41f('0x33')](_0xcf1c9d)['then'](function(_0x4a46c2){return _0x4a46c2;});}return null;};}function removeEntity(_0x2d8ed6,_0x558c62){return function(_0x7aebb){if(_0x7aebb){return _0x7aebb[_0xf41f('0x34')]()[_0xf41f('0x35')](function(){_0x2d8ed6[_0xf41f('0x2a')](0xcc)[_0xf41f('0x2b')]();});}};}function handleEntityNotFound(_0x295ce6,_0x6321d0){return function(_0x425796){if(!_0x425796){_0x295ce6[_0xf41f('0x29')](0x194);}return _0x425796;};}function handleError(_0x45e65f,_0x366aba){_0x366aba=_0x366aba||0x1f4;return function(_0x4d5535){logger[_0xf41f('0x24')](_0x4d5535[_0xf41f('0x36')]);if(_0x4d5535[_0xf41f('0x37')]){delete _0x4d5535[_0xf41f('0x37')];}_0x45e65f['status'](_0x366aba)[_0xf41f('0x38')](_0x4d5535);};}exports['index']=function(_0x1da223,_0x39df75){var _0x2c5b6b={},_0x192f00={},_0xe0105a={'count':0x0,'rows':[]};var _0x8d7dec=_[_0xf41f('0x39')](db[_0xf41f('0x3a')][_0xf41f('0x3b')],function(_0x359822){return{'name':_0x359822[_0xf41f('0x3c')],'type':_0x359822['type'][_0xf41f('0x3d')]};});_0x192f00[_0xf41f('0x3e')]=_[_0xf41f('0x39')](_0x8d7dec,_0xf41f('0x37'));_0x192f00[_0xf41f('0x3f')]=_['keys'](_0x1da223['query']);_0x192f00['filters']=_['intersection'](_0x192f00[_0xf41f('0x3e')],_0x192f00['query']);_0x2c5b6b[_0xf41f('0x40')]=_[_0xf41f('0x41')](_0x192f00[_0xf41f('0x3e')],qs[_0xf41f('0x42')](_0x1da223[_0xf41f('0x3f')][_0xf41f('0x42')]));_0x2c5b6b['attributes']=_0x2c5b6b[_0xf41f('0x40')][_0xf41f('0x43')]?_0x2c5b6b['attributes']:_0x192f00['model'];if(!_0x1da223[_0xf41f('0x3f')][_0xf41f('0x44')]('nolimit')){_0x2c5b6b[_0xf41f('0x2f')]=qs[_0xf41f('0x2f')](_0x1da223[_0xf41f('0x3f')]['limit']);_0x2c5b6b[_0xf41f('0x2e')]=qs[_0xf41f('0x2e')](_0x1da223[_0xf41f('0x3f')][_0xf41f('0x2e')]);}_0x2c5b6b[_0xf41f('0x45')]=qs[_0xf41f('0x46')](_0x1da223[_0xf41f('0x3f')]['sort']);_0x2c5b6b[_0xf41f('0x47')]=qs[_0xf41f('0x48')](_['pick'](_0x1da223[_0xf41f('0x3f')],_0x192f00[_0xf41f('0x48')]),_0x8d7dec);if(_0x1da223[_0xf41f('0x3f')]['filter']){_0x2c5b6b[_0xf41f('0x47')]=_[_0xf41f('0x49')](_0x2c5b6b[_0xf41f('0x47')],{'$or':_[_0xf41f('0x39')](_0x8d7dec,function(_0x4e55f){if(_0x4e55f[_0xf41f('0x4a')]!==_0xf41f('0x4b')){var _0x1349a5={};_0x1349a5[_0x4e55f['name']]={'$like':'%'+_0x1da223['query'][_0xf41f('0x4c')]+'%'};return _0x1349a5;}})});}_0x2c5b6b=_[_0xf41f('0x49')]({},_0x2c5b6b,_0x1da223['options']);var _0x3c3750={'where':_0x2c5b6b[_0xf41f('0x47')]};return db[_0xf41f('0x3a')][_0xf41f('0x2d')](_0x3c3750)[_0xf41f('0x35')](function(_0x4f9f8e){_0xe0105a[_0xf41f('0x2d')]=_0x4f9f8e;if(_0x1da223[_0xf41f('0x3f')]['includeAll']){_0x2c5b6b[_0xf41f('0x4d')]=[{'all':!![]}];}return db['ChatMessage'][_0xf41f('0x4e')](_0x2c5b6b);})[_0xf41f('0x35')](function(_0x3404dc){_0xe0105a[_0xf41f('0x4f')]=_0x3404dc;return _0xe0105a;})['then'](respondWithFilteredResult(_0x39df75,_0x2c5b6b))[_0xf41f('0x50')](handleError(_0x39df75,null));};exports[_0xf41f('0x51')]=function(_0x37bc28,_0x1eb9e8){var _0x12dd47={'raw':!![],'where':{'id':_0x37bc28['params']['id']}},_0x494863={};_0x494863[_0xf41f('0x3e')]=_[_0xf41f('0x52')](db[_0xf41f('0x3a')][_0xf41f('0x3b')]);_0x494863[_0xf41f('0x3f')]=_[_0xf41f('0x52')](_0x37bc28[_0xf41f('0x3f')]);_0x494863['filters']=_['intersection'](_0x494863[_0xf41f('0x3e')],_0x494863[_0xf41f('0x3f')]);_0x12dd47[_0xf41f('0x40')]=_[_0xf41f('0x41')](_0x494863['model'],qs[_0xf41f('0x42')](_0x37bc28['query'][_0xf41f('0x42')]));_0x12dd47['attributes']=_0x12dd47[_0xf41f('0x40')][_0xf41f('0x43')]?_0x12dd47[_0xf41f('0x40')]:_0x494863[_0xf41f('0x3e')];if(_0x37bc28[_0xf41f('0x3f')][_0xf41f('0x53')]){_0x12dd47[_0xf41f('0x4d')]=[{'all':!![]}];}_0x12dd47=_['merge']({},_0x12dd47,_0x37bc28[_0xf41f('0x54')]);return db['ChatMessage'][_0xf41f('0x55')](_0x12dd47)[_0xf41f('0x35')](handleEntityNotFound(_0x1eb9e8,null))['then'](respondWithResult(_0x1eb9e8,null))[_0xf41f('0x50')](handleError(_0x1eb9e8,null));};exports[_0xf41f('0x56')]=function(_0x54d3e5,_0x5d067c){return db[_0xf41f('0x3a')][_0xf41f('0x56')](_0x54d3e5[_0xf41f('0x57')],{})['then'](respondWithResult(_0x5d067c,0xc9))[_0xf41f('0x50')](handleError(_0x5d067c,null));};exports[_0xf41f('0x33')]=function(_0x4218a4,_0x15e6d6){if(_0x4218a4['body']['id']){delete _0x4218a4[_0xf41f('0x57')]['id'];}return db[_0xf41f('0x3a')][_0xf41f('0x55')]({'where':{'id':_0x4218a4[_0xf41f('0x58')]['id']}})[_0xf41f('0x35')](handleEntityNotFound(_0x15e6d6,null))[_0xf41f('0x35')](saveUpdates(_0x4218a4[_0xf41f('0x57')],null))['then'](respondWithResult(_0x15e6d6,null))[_0xf41f('0x50')](handleError(_0x15e6d6,null));};exports[_0xf41f('0x34')]=function(_0x54b073,_0x3797cb){return db['ChatMessage'][_0xf41f('0x55')]({'where':{'id':_0x54b073['params']['id']}})['then'](handleEntityNotFound(_0x3797cb,null))['then'](removeEntity(_0x3797cb,null))[_0xf41f('0x50')](handleError(_0x3797cb,null));};exports[_0xf41f('0x59')]=function(_0x883eb7,_0x57b8c1){return db[_0xf41f('0x3a')][_0xf41f('0x59')]()[_0xf41f('0x35')](respondWithResult(_0x57b8c1,null))[_0xf41f('0x50')](handleError(_0x57b8c1,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0xf41f('0x5a')]=function(_0x3fc4c7,_0x5f15f4,_0x1106eb){var _0x40a198={'agent':{},'channel':_0xf41f('0x5b')};if(_0x3fc4c7[_0xf41f('0x57')]['id']){delete _0x3fc4c7[_0xf41f('0x57')]['id'];}_0x3fc4c7[_0xf41f('0x57')][_0xf41f('0x5c')]=!![];_0x3fc4c7[_0xf41f('0x57')]['readAt']=moment()[_0xf41f('0x5d')](_0xf41f('0x5e'));_0x3fc4c7[_0xf41f('0x57')][_0xf41f('0x5f')]=_0x3fc4c7[_0xf41f('0x57')][_0xf41f('0x5f')]||_0x3fc4c7[_0xf41f('0x60')]['id'];_0x40a198[_0xf41f('0x61')]['id']=_0x3fc4c7[_0xf41f('0x57')]['UserId'];return db[_0xf41f('0x3a')][_0xf41f('0x55')]({'where':{'id':_0x3fc4c7[_0xf41f('0x58')]['id'],'UserId':null}})[_0xf41f('0x35')](handleEntityNotFound(_0x5f15f4,null))['then'](saveUpdates(_0x3fc4c7['body'],null))[_0xf41f('0x35')](function(_0x22b6b8){if(_0x22b6b8){_0x40a198[_0xf41f('0x27')]=_0x22b6b8[_0xf41f('0x62')]({'plain':!![]});return db[_0xf41f('0x63')][_0xf41f('0x55')]({'where':{'id':_0x22b6b8['ChatInteractionId']}});}return null;})[_0xf41f('0x35')](handleEntityNotFound(_0x5f15f4,null))['then'](function(_0x589d3a){if(_0x589d3a){return _0x589d3a[_0xf41f('0x33')]({'UserId':_0x3fc4c7['body'][_0xf41f('0x5f')],'read1stAt':_['isNil'](_0x589d3a['read1stAt'])?moment()[_0xf41f('0x5d')](_0xf41f('0x5e')):undefined});}return null;})[_0xf41f('0x35')](function(_0x41c72d){if(_0x41c72d){_0x40a198[_0xf41f('0x64')]=_0x41c72d[_0xf41f('0x62')]({'plain':!![]});interaction_log['info'](_0xf41f('0x65'),_0x3fc4c7[_0xf41f('0x60')]['id'],_0x3fc4c7['user'][_0xf41f('0x37')],_0x3fc4c7['user'][_0xf41f('0x66')],_0x40a198['interaction']['id'],_0x3fc4c7['body']?JSON['stringify'](_0x3fc4c7[_0xf41f('0x57')]):_0xf41f('0x67'));return respondWithRpcPromise('AcceptMessage',_0xf41f('0x68'),_0x40a198);}return null;})[_0xf41f('0x35')](function(_0x16a598){var _0x538cee=_0xf41f('0x69')+_0x16a598['message'][_0xf41f('0x6a')];return db[_0xf41f('0x6b')][_0xf41f('0x3f')](_0x538cee,{'type':db[_0xf41f('0x6c')]['QueryTypes'][_0xf41f('0x6d')],'raw':!![]})[_0xf41f('0x35')](function(_0xf778e6){return _0xf778e6;});})[_0xf41f('0x35')](function(_0x58eeb6){if(_0x58eeb6){_0x40a198[_0xf41f('0x27')]['contact']=_0x58eeb6[0x0];if(!_0x3fc4c7[_0xf41f('0x57')][_0xf41f('0x5f')])return;return db[_0xf41f('0x6e')][_0xf41f('0x55')]({'where':{'id':_0x3fc4c7[_0xf41f('0x57')]['UserId'],'role':_0xf41f('0x61')},'attributes':['id',_0xf41f('0x37'),_0xf41f('0x6f'),'email','internal'],'raw':!![]});}return null;})[_0xf41f('0x35')](function(_0x5ec29a){if(!_0x5ec29a)return null;_0x40a198[_0xf41f('0x27')]['agent']=_0x5ec29a;return _0x40a198;})[_0xf41f('0x35')](function(_0x246533){if(_0x246533){if(_0x3fc4c7['body'][_0xf41f('0x70')]){_0x40a198['message'][_0xf41f('0x71')]=util['format'](_0xf41f('0x72'),_0x3fc4c7[_0xf41f('0x60')][_0xf41f('0x37')]);_0x40a198['message'][_0xf41f('0x73')]=_0x40a198[_0xf41f('0x73')];_0x40a198[_0xf41f('0x27')]['motionChannel']=_0x40a198[_0xf41f('0x73')];_0x40a198['message']['event']=_0xf41f('0x5a');return respondWithRpcPromise('EventManager',_0xf41f('0x74'),{'event':_0xf41f('0x75'),'message':_[_0xf41f('0x49')](_0x40a198['message'],JSON[_0xf41f('0x76')](_0x40a198[_0xf41f('0x64')][_0xf41f('0x77')]))},client9002)['then'](function(){return _0x40a198;});}return _0x40a198;}return null;})[_0xf41f('0x35')](respondWithResult(_0x5f15f4,null))[_0xf41f('0x50')](handleError(_0x5f15f4,null));};var interaction_log=require(_0xf41f('0x13'))('chat-interactions');exports['reject']=function(_0x2da32a,_0x48deb0,_0x503212){var _0x4729be={'agent':{},'channel':_0xf41f('0x5b')};if(_0x2da32a[_0xf41f('0x57')]['id']){delete _0x2da32a[_0xf41f('0x57')]['id'];}_0x2da32a[_0xf41f('0x57')][_0xf41f('0x5f')]=_0x2da32a[_0xf41f('0x57')][_0xf41f('0x5f')]||_0x2da32a[_0xf41f('0x60')]['id'];_0x4729be[_0xf41f('0x61')]['id']=_0x2da32a[_0xf41f('0x57')][_0xf41f('0x5f')];return db['ChatMessage']['find']({'where':{'id':_0x2da32a[_0xf41f('0x58')]['id'],'UserId':null}})[_0xf41f('0x35')](handleEntityNotFound(_0x48deb0,null))[_0xf41f('0x35')](function(_0x22e7f5){if(_0x22e7f5){_0x4729be['message']=_0x22e7f5['get']({'plain':!![]});return db[_0xf41f('0x63')][_0xf41f('0x55')]({'where':{'id':_0x22e7f5[_0xf41f('0x78')]}});}return null;})['then'](handleEntityNotFound(_0x48deb0,null))[_0xf41f('0x35')](function(_0x1b38bb){if(_0x1b38bb){_0x4729be[_0xf41f('0x64')]=_0x1b38bb['get']({'plain':!![]});interaction_log['info'](_0xf41f('0x79'),_0x2da32a['user']['id'],_0x2da32a[_0xf41f('0x60')][_0xf41f('0x37')],_0x2da32a[_0xf41f('0x60')][_0xf41f('0x66')],_0x4729be[_0xf41f('0x64')]['id'],_0x2da32a[_0xf41f('0x57')]?JSON[_0xf41f('0x23')](_0x2da32a[_0xf41f('0x57')]):_0xf41f('0x67'));return respondWithRpcPromise(_0xf41f('0x7a'),_0xf41f('0x7b'),_0x4729be);}return null;})['then'](function(_0x4a48e6){var _0x58d2fc='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4a48e6[_0xf41f('0x27')][_0xf41f('0x6a')];return db['sequelize'][_0xf41f('0x3f')](_0x58d2fc,{'type':db['Sequelize'][_0xf41f('0x7c')][_0xf41f('0x6d')],'raw':!![]})[_0xf41f('0x35')](function(_0x26c990){return _0x26c990;});})[_0xf41f('0x35')](function(_0x243133){if(_0x243133){_0x4729be[_0xf41f('0x27')][_0xf41f('0x7d')]=_0x243133[0x0];if(!_0x2da32a['body']['UserId'])return;return db[_0xf41f('0x6e')]['find']({'where':{'id':_0x2da32a[_0xf41f('0x57')]['UserId'],'role':_0xf41f('0x61')},'attributes':['id',_0xf41f('0x37'),_0xf41f('0x6f'),_0xf41f('0x7e'),_0xf41f('0x7f')],'raw':!![]});}return null;})[_0xf41f('0x35')](function(_0x2915ac){if(!_0x2915ac)return null;_0x4729be[_0xf41f('0x27')][_0xf41f('0x61')]=_0x2915ac;return _0x4729be;})[_0xf41f('0x35')](function(_0x3503b5){if(_0x3503b5){_0x3503b5[_0xf41f('0x27')]['interface']=util[_0xf41f('0x5d')](_0xf41f('0x72'),_0x2da32a['user'][_0xf41f('0x37')]);_0x3503b5[_0xf41f('0x27')]['channel']=_0x4729be[_0xf41f('0x73')];_0x3503b5[_0xf41f('0x27')]['motionChannel']=_0x4729be[_0xf41f('0x73')];_0x3503b5[_0xf41f('0x27')]['event']=_0xf41f('0x80');respondWithRpcPromise(_0xf41f('0x74'),_0xf41f('0x74'),{'event':_0xf41f('0x81'),'message':_['merge'](_0x4729be['message'],JSON[_0xf41f('0x76')](_0x4729be[_0xf41f('0x64')]['formData']))},client9002);return _0x4729be;}return null;})[_0xf41f('0x35')](respondWithResult(_0x48deb0,null))['catch'](handleError(_0x48deb0,null));};
\ No newline at end of file
index 75e6270..2d8df85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x446a=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save'];(function(_0x2ff7eb,_0x1564c0){var _0x4fbd3a=function(_0x53ab7f){while(--_0x53ab7f){_0x2ff7eb['push'](_0x2ff7eb['shift']());}};_0x4fbd3a(++_0x1564c0);}(_0x446a,0x145));var _0xa446=function(_0x5d56c5,_0x5899f5){_0x5d56c5=_0x5d56c5-0x0;var _0x1ae496=_0x446a[_0x5d56c5];return _0x1ae496;};'use strict';var EventEmitter=require(_0xa446('0x0'));var ChatMessage=require(_0xa446('0x1'))['db'][_0xa446('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xa446('0x3')](0x0);var events={'afterCreate':_0xa446('0x4'),'afterUpdate':_0xa446('0x5'),'afterDestroy':_0xa446('0x6')};function emitEvent(_0x59c7f9){return function(_0x2c52dd,_0x57a898,_0x582a99){ChatMessageEvents[_0xa446('0x7')](_0x59c7f9+':'+_0x2c52dd['id'],_0x2c52dd);ChatMessageEvents[_0xa446('0x7')](_0x59c7f9,_0x2c52dd);_0x582a99(null);};}for(var e in events){if(events[_0xa446('0x8')](e)){var event=events[e];ChatMessage[_0xa446('0x9')](e,emitEvent(event));}}module[_0xa446('0xa')]=ChatMessageEvents;
\ No newline at end of file
+var _0x6265=['hook','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit'];(function(_0x5d9c37,_0x518b93){var _0x1ba9eb=function(_0xae2d11){while(--_0xae2d11){_0x5d9c37['push'](_0x5d9c37['shift']());}};_0x1ba9eb(++_0x518b93);}(_0x6265,0x88));var _0x5626=function(_0x5cca84,_0x3889cd){_0x5cca84=_0x5cca84-0x0;var _0x129dad=_0x6265[_0x5cca84];return _0x129dad;};'use strict';var EventEmitter=require(_0x5626('0x0'));var ChatMessage=require(_0x5626('0x1'))['db'][_0x5626('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x5626('0x3')](0x0);var events={'afterCreate':_0x5626('0x4'),'afterUpdate':_0x5626('0x5'),'afterDestroy':_0x5626('0x6')};function emitEvent(_0x6a6bda){return function(_0x42a202,_0x7bb7d3,_0x55daa2){ChatMessageEvents[_0x5626('0x7')](_0x6a6bda+':'+_0x42a202['id'],_0x42a202);ChatMessageEvents[_0x5626('0x7')](_0x6a6bda,_0x42a202);_0x55daa2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x5626('0x8')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
index c72325f..c821171 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4740=['body','FULLTEXT','models','get','direction','toLowerCase','UserId','ChatInteraction','then','update','catch','utf8mb4','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','fti_chat_messages'];(function(_0x435e2f,_0x43f39d){var _0x4f128e=function(_0x51840c){while(--_0x51840c){_0x435e2f['push'](_0x435e2f['shift']());}};_0x4f128e(++_0x43f39d);}(_0x4740,0x1b5));var _0x0474=function(_0x3a9b94,_0x526b54){_0x3a9b94=_0x3a9b94-0x0;var _0x155e6d=_0x4740[_0x3a9b94];return _0x155e6d;};'use strict';var _=require(_0x0474('0x0'));var util=require(_0x0474('0x1'));var logger=require(_0x0474('0x2'))(_0x0474('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0474('0x4'));var fs=require('fs');var path=require(_0x0474('0x5'));var rimraf=require(_0x0474('0x6'));var config=require(_0x0474('0x7'));var attributes=require('./chatMessage.attributes');module[_0x0474('0x8')]=function(_0x20ac37,_0x36441d){return _0x20ac37[_0x0474('0x9')](_0x0474('0xa'),attributes,{'tableName':_0x0474('0xb'),'paranoid':![],'indexes':[{'name':_0x0474('0xc'),'fields':[_0x0474('0xd')],'type':_0x0474('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x330906,_0x35ccbc,_0x504778){var _0x4d58e2=_0x20ac37[_0x0474('0xf')];var _0xec2803=_0x330906[_0x0474('0x10')]({'plain':!![]});if(_0xec2803[_0x0474('0x11')][_0x0474('0x12')]()==='in'||_0xec2803[_0x0474('0x11')][_0x0474('0x12')]()==='out'&&!_0xec2803['secret']&&!_['isNil'](_0xec2803[_0x0474('0x13')])){_0x4d58e2[_0x0474('0x14')]['findOne']({'where':{'id':_0xec2803['ChatInteractionId']}})[_0x0474('0x15')](function(_0x122829){if(_0x122829){_0x122829[_0x0474('0x16')]({'lastMsgAt':_0xec2803['createdAt'],'lastMsgDirection':_0xec2803[_0x0474('0x11')]['toLowerCase']()});}})[_0x0474('0x17')](function(_0x52f62c){console['error'](_0x52f62c);});}_0x504778();}},'charset':_0x0474('0x18'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xd9c6=['api','bluebird','request-promise','path','./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','direction','toLowerCase','secret','isNil','ChatInteraction','findOne','ChatInteractionId','then','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x3e5a96,_0x26eb95){var _0x3ffb85=function(_0x5731a2){while(--_0x5731a2){_0x3e5a96['push'](_0x3e5a96['shift']());}};_0x3ffb85(++_0x26eb95);}(_0xd9c6,0x99));var _0x6d9c=function(_0x5193c8,_0x2baa95){_0x5193c8=_0x5193c8-0x0;var _0x895c20=_0xd9c6[_0x5193c8];return _0x895c20;};'use strict';var _=require(_0x6d9c('0x0'));var util=require(_0x6d9c('0x1'));var logger=require(_0x6d9c('0x2'))(_0x6d9c('0x3'));var moment=require('moment');var BPromise=require(_0x6d9c('0x4'));var rp=require(_0x6d9c('0x5'));var fs=require('fs');var path=require(_0x6d9c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6d9c('0x7'));module['exports']=function(_0x37f03e,_0x5e00ab){return _0x37f03e[_0x6d9c('0x8')](_0x6d9c('0x9'),attributes,{'tableName':_0x6d9c('0xa'),'paranoid':![],'indexes':[{'name':_0x6d9c('0xb'),'fields':[_0x6d9c('0xc')],'type':_0x6d9c('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x12df36,_0x45318d,_0x1e61af){var _0x37a7a5=_0x37f03e['models'];var _0x72200=_0x12df36['get']({'plain':!![]});if(_0x72200[_0x6d9c('0xe')][_0x6d9c('0xf')]()==='in'||_0x72200['direction'][_0x6d9c('0xf')]()==='out'&&!_0x72200[_0x6d9c('0x10')]&&!_[_0x6d9c('0x11')](_0x72200['UserId'])){_0x37a7a5[_0x6d9c('0x12')][_0x6d9c('0x13')]({'where':{'id':_0x72200[_0x6d9c('0x14')]}})[_0x6d9c('0x15')](function(_0x3ab250){if(_0x3ab250){_0x3ab250['update']({'lastMsgAt':_0x72200[_0x6d9c('0x16')],'lastMsgDirection':_0x72200[_0x6d9c('0xe')][_0x6d9c('0xf')]()});}})[_0x6d9c('0x17')](function(_0x2393fd){console['error'](_0x2393fd);});}_0x1e61af();}},'charset':_0x6d9c('0x18'),'collate':_0x6d9c('0x19')});};
\ No newline at end of file
index b8e5b3e..76a3a6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa925=['debug','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','request\x20sent','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','CreateChatMessage','ChatMessage','create','body','options','raw'];(function(_0x2a56ad,_0x2b94bf){var _0x425175=function(_0x342f20){while(--_0x342f20){_0x2a56ad['push'](_0x2a56ad['shift']());}};_0x425175(++_0x2b94bf);}(_0xa925,0x134));var _0x5a92=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa925[_0x297fd3];return _0x2af381;};'use strict';var _=require('lodash');var util=require(_0x5a92('0x0'));var moment=require(_0x5a92('0x1'));var BPromise=require(_0x5a92('0x2'));var rs=require(_0x5a92('0x3'));var fs=require('fs');var Redis=require(_0x5a92('0x4'));var db=require(_0x5a92('0x5'))['db'];var utils=require(_0x5a92('0x6'));var logger=require(_0x5a92('0x7'))(_0x5a92('0x8'));var config=require('../../config/environment');var jayson=require(_0x5a92('0x9'));var client=jayson['client'][_0x5a92('0xa')]({'port':0x232a});config['redis']=_[_0x5a92('0xb')](config[_0x5a92('0xc')],{'host':_0x5a92('0xd'),'port':0x18eb});var socket=require(_0x5a92('0xe'))(new Redis(config['redis']));require(_0x5a92('0xf'))[_0x5a92('0x10')](socket);function respondWithRpcPromise(_0x53373f,_0x275ccb,_0x4266ba){return new BPromise(function(_0x42b226,_0xfc11e6){return client[_0x5a92('0x11')](_0x53373f,_0x4266ba)[_0x5a92('0x12')](function(_0x4ab6c8){logger[_0x5a92('0x13')]('ChatMessage,\x20%s,\x20%s',_0x275ccb,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x275ccb,_0x5a92('0x14'),JSON[_0x5a92('0x15')](_0x4ab6c8));if(_0x4ab6c8[_0x5a92('0x16')]){if(_0x4ab6c8[_0x5a92('0x16')][_0x5a92('0x17')]===0x1f4){logger[_0x5a92('0x16')]('ChatMessage,\x20%s,\x20%s',_0x275ccb,_0x4ab6c8[_0x5a92('0x16')]['message']);return _0xfc11e6(_0x4ab6c8['error'][_0x5a92('0x18')]);}logger[_0x5a92('0x16')](_0x5a92('0x19'),_0x275ccb,_0x4ab6c8['error'][_0x5a92('0x18')]);return _0x42b226(_0x4ab6c8['error'][_0x5a92('0x18')]);}else{logger['info'](_0x5a92('0x19'),_0x275ccb,_0x5a92('0x14'));_0x42b226(_0x4ab6c8['result'][_0x5a92('0x18')]);}})['catch'](function(_0x108a13){logger[_0x5a92('0x16')](_0x5a92('0x19'),_0x275ccb,_0x108a13);_0xfc11e6(_0x108a13);});});}exports[_0x5a92('0x1a')]=function(_0x2c7033){var _0x2d7817=this;return new Promise(function(_0x55fdd9,_0x1ccb14){return db[_0x5a92('0x1b')][_0x5a92('0x1c')](_0x2c7033[_0x5a92('0x1d')],{'raw':_0x2c7033[_0x5a92('0x1e')]?_0x2c7033[_0x5a92('0x1e')][_0x5a92('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x377c92){logger[_0x5a92('0x13')]('CreateChatMessage',_0x2c7033);logger[_0x5a92('0x20')]('CreateChatMessage',_0x2c7033,JSON[_0x5a92('0x15')](_0x377c92));_0x55fdd9(_0x377c92);})[_0x5a92('0x21')](function(_0x4ab4a7){logger[_0x5a92('0x16')](_0x5a92('0x1a'),_0x4ab4a7[_0x5a92('0x18')],_0x2c7033);_0x1ccb14(_0x2d7817[_0x5a92('0x16')](0x1f4,_0x4ab4a7[_0x5a92('0x18')]));});});};
\ No newline at end of file
+var _0x0880=['localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','raw','CreateChatMessage','lodash','moment','randomstring','../../config/logger','redis','defaults'];(function(_0x163cc2,_0x553c3d){var _0x58541d=function(_0xe9a17d){while(--_0xe9a17d){_0x163cc2['push'](_0x163cc2['shift']());}};_0x58541d(++_0x553c3d);}(_0x0880,0x7c));var _0x0088=function(_0x540dcb,_0x4eacb6){_0x540dcb=_0x540dcb-0x0;var _0x49353c=_0x0880[_0x540dcb];return _0x49353c;};'use strict';var _=require(_0x0088('0x0'));var util=require('util');var moment=require(_0x0088('0x1'));var BPromise=require('bluebird');var rs=require(_0x0088('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0088('0x3'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x0088('0x4')]=_[_0x0088('0x5')](config[_0x0088('0x4')],{'host':_0x0088('0x6'),'port':0x18eb});var socket=require(_0x0088('0x7'))(new Redis(config['redis']));require(_0x0088('0x8'))[_0x0088('0x9')](socket);function respondWithRpcPromise(_0x55d37d,_0x7c0c4a,_0x209b3d){return new BPromise(function(_0x5c3bb7,_0x57ada2){return client[_0x0088('0xa')](_0x55d37d,_0x209b3d)[_0x0088('0xb')](function(_0x11b395){logger[_0x0088('0xc')](_0x0088('0xd'),_0x7c0c4a,_0x0088('0xe'));logger[_0x0088('0xf')](_0x0088('0x10'),_0x7c0c4a,_0x0088('0xe'),JSON[_0x0088('0x11')](_0x11b395));if(_0x11b395[_0x0088('0x12')]){if(_0x11b395[_0x0088('0x12')][_0x0088('0x13')]===0x1f4){logger[_0x0088('0x12')](_0x0088('0xd'),_0x7c0c4a,_0x11b395[_0x0088('0x12')][_0x0088('0x14')]);return _0x57ada2(_0x11b395[_0x0088('0x12')][_0x0088('0x14')]);}logger['error'](_0x0088('0xd'),_0x7c0c4a,_0x11b395['error'][_0x0088('0x14')]);return _0x5c3bb7(_0x11b395['error'][_0x0088('0x14')]);}else{logger[_0x0088('0xc')](_0x0088('0xd'),_0x7c0c4a,_0x0088('0xe'));_0x5c3bb7(_0x11b395[_0x0088('0x15')][_0x0088('0x14')]);}})[_0x0088('0x16')](function(_0x10128b){logger[_0x0088('0x12')]('ChatMessage,\x20%s,\x20%s',_0x7c0c4a,_0x10128b);_0x57ada2(_0x10128b);});});}exports['CreateChatMessage']=function(_0x3dbc35){var _0x46f764=this;return new Promise(function(_0x69d1c7,_0x9447f){return db['ChatMessage']['create'](_0x3dbc35['body'],{'raw':_0x3dbc35[_0x0088('0x17')]?_0x3dbc35['options'][_0x0088('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x33aa1b){logger[_0x0088('0xc')](_0x0088('0x19'),_0x3dbc35);logger[_0x0088('0xf')](_0x0088('0x19'),_0x3dbc35,JSON[_0x0088('0x11')](_0x33aa1b));_0x69d1c7(_0x33aa1b);})[_0x0088('0x16')](function(_0x393b0d){logger[_0x0088('0x12')](_0x0088('0x19'),_0x393b0d[_0x0088('0x14')],_0x3dbc35);_0x9447f(_0x46f764[_0x0088('0x12')](0x1f4,_0x393b0d[_0x0088('0x14')]));});});};
\ No newline at end of file
index b70b716..549f259 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27c5=['update','emit','removeListener','register','chatMessage:','remove'];(function(_0x592109,_0x10d79a){var _0x328ecd=function(_0x320091){while(--_0x320091){_0x592109['push'](_0x592109['shift']());}};_0x328ecd(++_0x10d79a);}(_0x27c5,0x173));var _0x527c=function(_0x3c49b2,_0x285e48){_0x3c49b2=_0x3c49b2-0x0;var _0x2d9203=_0x27c5[_0x3c49b2];return _0x2d9203;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0x527c('0x0'),_0x527c('0x1')];function createListener(_0xd193d0,_0x5771e6){return function(_0x1a35ed){_0x5771e6[_0x527c('0x2')](_0xd193d0,_0x1a35ed);};}function removeListener(_0x371ae5,_0x45478a){return function(){ChatMessageEvents[_0x527c('0x3')](_0x371ae5,_0x45478a);};}exports[_0x527c('0x4')]=function(_0x37bd95){for(var _0x552d9b=0x0,_0x18c413=events['length'];_0x552d9b<_0x18c413;_0x552d9b++){var _0x2db820=events[_0x552d9b];var _0x5e07ba=createListener(_0x527c('0x5')+_0x2db820,_0x37bd95);ChatMessageEvents['on'](_0x2db820,_0x5e07ba);}};
\ No newline at end of file
+var _0x1224=['update','emit','register','length','chatMessage:','./chatMessage.events','save','remove'];(function(_0x1950b7,_0x297593){var _0x38a95a=function(_0x2f519c){while(--_0x2f519c){_0x1950b7['push'](_0x1950b7['shift']());}};_0x38a95a(++_0x297593);}(_0x1224,0x10d));var _0x4122=function(_0xda0001,_0x5d3e28){_0xda0001=_0xda0001-0x0;var _0x3c1c06=_0x1224[_0xda0001];return _0x3c1c06;};'use strict';var ChatMessageEvents=require(_0x4122('0x0'));var events=[_0x4122('0x1'),_0x4122('0x2'),_0x4122('0x3')];function createListener(_0x488f55,_0x3d42a9){return function(_0x51632b){_0x3d42a9[_0x4122('0x4')](_0x488f55,_0x51632b);};}function removeListener(_0x1f1533,_0x2f506b){return function(){ChatMessageEvents['removeListener'](_0x1f1533,_0x2f506b);};}exports[_0x4122('0x5')]=function(_0x76278c){for(var _0xc6dfaf=0x0,_0x40b5e4=events[_0x4122('0x6')];_0xc6dfaf<_0x40b5e4;_0xc6dfaf++){var _0x431470=events[_0xc6dfaf];var _0x2444a3=createListener(_0x4122('0x7')+_0x431470,_0x76278c);ChatMessageEvents['on'](_0x431470,_0x2444a3);}};
\ No newline at end of file
index e9822e6..3bd29b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b02=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','/describe','describe','/:id','isAuthenticated','show','tracked','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x32c012,_0xe3c576){var _0x48562e=function(_0x505228){while(--_0x505228){_0x32c012['push'](_0x32c012['shift']());}};_0x48562e(++_0xe3c576);}(_0x1b02,0xe2));var _0x21b0=function(_0x49dd26,_0x9e5a5d){_0x49dd26=_0x49dd26-0x0;var _0x45f549=_0x1b02[_0x49dd26];return _0x45f549;};'use strict';var multer=require(_0x21b0('0x0'));var util=require(_0x21b0('0x1'));var path=require(_0x21b0('0x2'));var timeout=require(_0x21b0('0x3'));var express=require(_0x21b0('0x4'));var router=express[_0x21b0('0x5')]();var fs_extra=require(_0x21b0('0x6'));var auth=require(_0x21b0('0x7'));var interaction=require(_0x21b0('0x8'));var config=require(_0x21b0('0x9'));var controller=require(_0x21b0('0xa'));router[_0x21b0('0xb')]('/',auth['isAuthenticated'](),controller[_0x21b0('0xc')]);router[_0x21b0('0xb')](_0x21b0('0xd'),auth['isAuthenticated'](),controller[_0x21b0('0xe')]);router[_0x21b0('0xb')](_0x21b0('0xf'),auth[_0x21b0('0x10')](),controller[_0x21b0('0x11')]);router['post']('/',auth[_0x21b0('0x10')](),interaction[_0x21b0('0x12')]('chat',_0x21b0('0x13')),controller[_0x21b0('0x14')]);router[_0x21b0('0x15')]('/:id',controller[_0x21b0('0x16')]);router[_0x21b0('0x15')](_0x21b0('0x17'),auth[_0x21b0('0x10')](),controller[_0x21b0('0x18')]);router['put'](_0x21b0('0x19'),auth['isAuthenticated'](),controller['reject']);router[_0x21b0('0x1a')]('/:id',auth[_0x21b0('0x10')](),controller[_0x21b0('0x1b')]);module[_0x21b0('0x1c')]=router;
\ No newline at end of file
+var _0xf415=['chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','destroy','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','tracked'];(function(_0x45a53f,_0x306600){var _0x17da07=function(_0xe0fba9){while(--_0xe0fba9){_0x45a53f['push'](_0x45a53f['shift']());}};_0x17da07(++_0x306600);}(_0xf415,0x11d));var _0x5f41=function(_0x2035a8,_0x3792f4){_0x2035a8=_0x2035a8-0x0;var _0x5ec3dd=_0xf415[_0x2035a8];return _0x5ec3dd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5f41('0x0'));var timeout=require(_0x5f41('0x1'));var express=require(_0x5f41('0x2'));var router=express['Router']();var fs_extra=require(_0x5f41('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5f41('0x4'));var config=require(_0x5f41('0x5'));var controller=require(_0x5f41('0x6'));router[_0x5f41('0x7')]('/',auth['isAuthenticated'](),controller[_0x5f41('0x8')]);router['get'](_0x5f41('0x9'),auth[_0x5f41('0xa')](),controller[_0x5f41('0xb')]);router[_0x5f41('0x7')](_0x5f41('0xc'),auth['isAuthenticated'](),controller[_0x5f41('0xd')]);router['post']('/',auth[_0x5f41('0xa')](),interaction[_0x5f41('0xe')](_0x5f41('0xf'),_0x5f41('0x10')),controller[_0x5f41('0x11')]);router[_0x5f41('0x12')]('/:id',controller[_0x5f41('0x13')]);router[_0x5f41('0x12')](_0x5f41('0x14'),auth['isAuthenticated'](),controller[_0x5f41('0x15')]);router['put'](_0x5f41('0x16'),auth[_0x5f41('0xa')](),controller[_0x5f41('0x17')]);router['delete'](_0x5f41('0xc'),auth[_0x5f41('0xa')](),controller[_0x5f41('0x18')]);module['exports']=router;
\ No newline at end of file
index 3a215d8..20486d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x976c=['exports','TEXT','medium'];(function(_0x464597,_0x4b3ab0){var _0x227f22=function(_0x4ec014){while(--_0x4ec014){_0x464597['push'](_0x464597['shift']());}};_0x227f22(++_0x4b3ab0);}(_0x976c,0x72));var _0xc976=function(_0x5b47e1,_0x159b15){_0x5b47e1=_0x5b47e1-0x0;var _0x572a56=_0x976c[_0x5b47e1];return _0x572a56;};'use strict';var Sequelize=require('sequelize');module[_0xc976('0x0')]={'body':{'type':Sequelize[_0xc976('0x1')](_0xc976('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0x2f7a=['medium','sequelize','exports'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x2f7a,0x124));var _0xa2f7=function(_0x830109,_0x5d4f7a){_0x830109=_0x830109-0x0;var _0x54963a=_0x2f7a[_0x830109];return _0x54963a;};'use strict';var Sequelize=require(_0xa2f7('0x0'));module[_0xa2f7('0x1')]={'body':{'type':Sequelize['TEXT'](_0xa2f7('0x2')),'allowNull':![]}};
\ No newline at end of file
index 48d24e9..f61d3df 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(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x7a54,0x106));var _0x47a5=function(_0x21ff2d,_0x375e29){_0x21ff2d=_0x21ff2d-0x0;var _0x495eae=_0x7a54[_0x21ff2d];return _0x495eae;};'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(_0x130405,_0x21dfa4){var _0x3c4c1a=function(_0x4a5bdb){while(--_0x4a5bdb){_0x130405['push'](_0x130405['shift']());}};_0x3c4c1a(++_0x21dfa4);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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 9d9c0a0..730b77e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x949b=['ChatOfflineMessage','lodash','api','bluebird','path','../../config/environment','./chatOfflineMessage.attributes','exports','define'];(function(_0x4dbda8,_0xbce830){var _0x1149ed=function(_0x299a39){while(--_0x299a39){_0x4dbda8['push'](_0x4dbda8['shift']());}};_0x1149ed(++_0xbce830);}(_0x949b,0x88));var _0xb949=function(_0x8c4b43,_0xd43984){_0x8c4b43=_0x8c4b43-0x0;var _0x56cf12=_0x949b[_0x8c4b43];return _0x56cf12;};'use strict';var _=require(_0xb949('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb949('0x1'));var moment=require('moment');var BPromise=require(_0xb949('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb949('0x3'));var rimraf=require('rimraf');var config=require(_0xb949('0x4'));var attributes=require(_0xb949('0x5'));module[_0xb949('0x6')]=function(_0x18dbc9,_0x3f200f){return _0x18dbc9[_0xb949('0x7')](_0xb949('0x8'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x0ba8=['util','api','bluebird','request-promise','path','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','lodash'];(function(_0x5d7925,_0x5d7914){var _0xb487ab=function(_0x3f051c){while(--_0x3f051c){_0x5d7925['push'](_0x5d7925['shift']());}};_0xb487ab(++_0x5d7914);}(_0x0ba8,0x1b7));var _0x80ba=function(_0x4ac76c,_0x305b70){_0x4ac76c=_0x4ac76c-0x0;var _0x24d3f1=_0x0ba8[_0x4ac76c];return _0x24d3f1;};'use strict';var _=require(_0x80ba('0x0'));var util=require(_0x80ba('0x1'));var logger=require('../../config/logger')(_0x80ba('0x2'));var moment=require('moment');var BPromise=require(_0x80ba('0x3'));var rp=require(_0x80ba('0x4'));var fs=require('fs');var path=require(_0x80ba('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatOfflineMessage.attributes');module[_0x80ba('0x6')]=function(_0x58e076,_0x5a1b0d){return _0x58e076[_0x80ba('0x7')](_0x80ba('0x8'),attributes,{'tableName':_0x80ba('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x80ba('0xa')});};
\ No newline at end of file
index 4a1d666..62373fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02df=['debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x4da447,_0x201307){var _0x11c06f=function(_0x79f49e){while(--_0x79f49e){_0x4da447['push'](_0x4da447['shift']());}};_0x11c06f(++_0x201307);}(_0x02df,0x128));var _0xf02d=function(_0x23010f,_0x8fe0e1){_0x23010f=_0x23010f-0x0;var _0x2a445e=_0x02df[_0x23010f];return _0x2a445e;};'use strict';var _=require(_0xf02d('0x0'));var util=require(_0xf02d('0x1'));var moment=require(_0xf02d('0x2'));var BPromise=require('bluebird');var rs=require(_0xf02d('0x3'));var fs=require('fs');var Redis=require(_0xf02d('0x4'));var db=require(_0xf02d('0x5'))['db'];var utils=require(_0xf02d('0x6'));var logger=require(_0xf02d('0x7'))(_0xf02d('0x8'));var config=require(_0xf02d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf02d('0xa')][_0xf02d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe72fc1,_0x446feb,_0x189612){return new BPromise(function(_0x3ae48b,_0x47217e){return client['request'](_0xe72fc1,_0x189612)[_0xf02d('0xc')](function(_0x13e0fb){logger[_0xf02d('0xd')](_0xf02d('0xe'),_0x446feb,_0xf02d('0xf'));logger[_0xf02d('0x10')](_0xf02d('0x11'),_0x446feb,_0xf02d('0xf'),JSON[_0xf02d('0x12')](_0x13e0fb));if(_0x13e0fb[_0xf02d('0x13')]){if(_0x13e0fb[_0xf02d('0x13')][_0xf02d('0x14')]===0x1f4){logger[_0xf02d('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x446feb,_0x13e0fb[_0xf02d('0x13')]['message']);return _0x47217e(_0x13e0fb[_0xf02d('0x13')][_0xf02d('0x15')]);}logger[_0xf02d('0x13')](_0xf02d('0xe'),_0x446feb,_0x13e0fb[_0xf02d('0x13')][_0xf02d('0x15')]);return _0x3ae48b(_0x13e0fb['error'][_0xf02d('0x15')]);}else{logger[_0xf02d('0xd')](_0xf02d('0xe'),_0x446feb,'request\x20sent');_0x3ae48b(_0x13e0fb[_0xf02d('0x16')][_0xf02d('0x15')]);}})[_0xf02d('0x17')](function(_0x36142e){logger['error'](_0xf02d('0xe'),_0x446feb,_0x36142e);_0x47217e(_0x36142e);});});}
\ No newline at end of file
+var _0x8147=['randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','request','info','ChatOfflineMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x53899e,_0x37d676){var _0x3fee35=function(_0x400314){while(--_0x400314){_0x53899e['push'](_0x53899e['shift']());}};_0x3fee35(++_0x37d676);}(_0x8147,0x179));var _0x7814=function(_0x599410,_0x3dcc3f){_0x599410=_0x599410-0x0;var _0x36566a=_0x8147[_0x599410];return _0x36566a;};'use strict';var _=require(_0x7814('0x0'));var util=require(_0x7814('0x1'));var moment=require('moment');var BPromise=require(_0x7814('0x2'));var rs=require(_0x7814('0x3'));var fs=require('fs');var Redis=require(_0x7814('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7814('0x5'));var logger=require(_0x7814('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7814('0x7'));var client=jayson[_0x7814('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x499b1a,_0x41e3db,_0xa96628){return new BPromise(function(_0x4239e8,_0x50bd29){return client[_0x7814('0x9')](_0x499b1a,_0xa96628)['then'](function(_0x398b3a){logger[_0x7814('0xa')](_0x7814('0xb'),_0x41e3db,'request\x20sent');logger[_0x7814('0xc')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x41e3db,_0x7814('0xd'),JSON[_0x7814('0xe')](_0x398b3a));if(_0x398b3a['error']){if(_0x398b3a[_0x7814('0xf')][_0x7814('0x10')]===0x1f4){logger[_0x7814('0xf')](_0x7814('0xb'),_0x41e3db,_0x398b3a['error'][_0x7814('0x11')]);return _0x50bd29(_0x398b3a[_0x7814('0xf')][_0x7814('0x11')]);}logger[_0x7814('0xf')](_0x7814('0xb'),_0x41e3db,_0x398b3a[_0x7814('0xf')]['message']);return _0x4239e8(_0x398b3a[_0x7814('0xf')][_0x7814('0x11')]);}else{logger[_0x7814('0xa')]('ChatOfflineMessage,\x20%s,\x20%s',_0x41e3db,_0x7814('0xd'));_0x4239e8(_0x398b3a[_0x7814('0x12')][_0x7814('0x11')]);}})[_0x7814('0x13')](function(_0x28451f){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x41e3db,_0x28451f);_0x50bd29(_0x28451f);});});}
\ No newline at end of file
index c9899e4..794ecf1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59c3=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','describe','show','post','/:id','destroy'];(function(_0x5e7095,_0x3418ac){var _0x3f4f9e=function(_0x258627){while(--_0x258627){_0x5e7095['push'](_0x5e7095['shift']());}};_0x3f4f9e(++_0x3418ac);}(_0x59c3,0x120));var _0x359c=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x59c3[_0x2160a9];return _0xa88cf7;};'use strict';var multer=require('multer');var util=require(_0x359c('0x0'));var path=require(_0x359c('0x1'));var timeout=require('connect-timeout');var express=require(_0x359c('0x2'));var router=express[_0x359c('0x3')]();var fs_extra=require(_0x359c('0x4'));var auth=require(_0x359c('0x5'));var interaction=require(_0x359c('0x6'));var config=require(_0x359c('0x7'));var controller=require(_0x359c('0x8'));router[_0x359c('0x9')]('/',auth[_0x359c('0xa')](),controller['index']);router['get']('/describe',auth[_0x359c('0xa')](),controller[_0x359c('0xb')]);router[_0x359c('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x359c('0xc')]);router[_0x359c('0xd')]('/',auth[_0x359c('0xa')](),controller['create']);router['put']('/:id',auth[_0x359c('0xa')](),controller['update']);router['delete'](_0x359c('0xe'),auth[_0x359c('0xa')](),controller[_0x359c('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x30f9=['create','/:id','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index','describe','isAuthenticated'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x30f9,0x134));var _0x930f=function(_0x5e07a7,_0x1438b3){_0x5e07a7=_0x5e07a7-0x0;var _0x22ced5=_0x30f9[_0x5e07a7];return _0x22ced5;};'use strict';var multer=require(_0x930f('0x0'));var util=require(_0x930f('0x1'));var path=require(_0x930f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x930f('0x3')]();var fs_extra=require(_0x930f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x930f('0x5'));var config=require(_0x930f('0x6'));var controller=require(_0x930f('0x7'));router[_0x930f('0x8')]('/',auth['isAuthenticated'](),controller[_0x930f('0x9')]);router[_0x930f('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x930f('0xa')]);router[_0x930f('0x8')]('/:id',auth[_0x930f('0xb')](),controller['show']);router['post']('/',auth[_0x930f('0xb')](),controller[_0x930f('0xc')]);router['put'](_0x930f('0xd'),auth[_0x930f('0xb')](),controller['update']);router['delete'](_0x930f('0xd'),auth[_0x930f('0xb')](),controller[_0x930f('0xe')]);module[_0x930f('0xf')]=router;
\ No newline at end of file
index ed60fc7..2b07f94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x935e=['ENUM','mouseOver','timeout','INTEGER','sequelize','exports','STRING'];(function(_0x1034bb,_0x4e20b3){var _0x453fdb=function(_0x455356){while(--_0x455356){_0x1034bb['push'](_0x1034bb['shift']());}};_0x453fdb(++_0x4e20b3);}(_0x935e,0xac));var _0xe935=function(_0x1230e5,_0x1a98be){_0x1230e5=_0x1230e5-0x0;var _0x564c99=_0x935e[_0x1230e5];return _0x564c99;};'use strict';var Sequelize=require(_0xe935('0x0'));module[_0xe935('0x1')]={'name':{'type':Sequelize[_0xe935('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe935('0x3')](_0xe935('0x4'),_0xe935('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xe935('0x2')]},'timeout':{'type':Sequelize[_0xe935('0x6')]}};
\ No newline at end of file
+var _0xe682=['mouseOver','timeout','sequelize','STRING'];(function(_0x1b7782,_0x3b69f9){var _0x344d17=function(_0x3de04c){while(--_0x3de04c){_0x1b7782['push'](_0x1b7782['shift']());}};_0x344d17(++_0x3b69f9);}(_0xe682,0x1ae));var _0x2e68=function(_0x56e672,_0x588aba){_0x56e672=_0x56e672-0x0;var _0x56f540=_0xe682[_0x56e672];return _0x56f540;};'use strict';var Sequelize=require(_0x2e68('0x0'));module['exports']={'name':{'type':Sequelize[_0x2e68('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x2e68('0x2'),_0x2e68('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x2e68('0x1')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index 794dd2c..1c03f7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf776=['include','merge','ChatProactiveAction','catch','create','body','find','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','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','status','end','offset','limit','undefined','count','Content-Range','json','reject','update','then','destroy','error','stack','name','show','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll'];(function(_0x272bf3,_0x2226b6){var _0x33c087=function(_0x4b9467){while(--_0x4b9467){_0x272bf3['push'](_0x272bf3['shift']());}};_0x33c087(++_0x2226b6);}(_0xf776,0x169));var _0x6f77=function(_0x4100e5,_0x4656a1){_0x4100e5=_0x4100e5-0x0;var _0x5663cf=_0xf776[_0x4100e5];return _0x5663cf;};'use strict';var emlformat=require(_0x6f77('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6f77('0x1'));var jsonpatch=require(_0x6f77('0x2'));var rp=require('request-promise');var moment=require(_0x6f77('0x3'));var BPromise=require(_0x6f77('0x4'));var Mustache=require(_0x6f77('0x5'));var util=require(_0x6f77('0x6'));var path=require('path');var sox=require(_0x6f77('0x7'));var csv=require('to-csv');var ejs=require(_0x6f77('0x8'));var fs=require('fs');var fs_extra=require(_0x6f77('0x9'));var _=require(_0x6f77('0xa'));var squel=require(_0x6f77('0xb'));var crypto=require('crypto');var jsforce=require(_0x6f77('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6f77('0xd'));var querystring=require(_0x6f77('0xe'));var Papa=require(_0x6f77('0xf'));var Redis=require(_0x6f77('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6f77('0x11'));var as=require(_0x6f77('0x12'));var hardwareService=require(_0x6f77('0x13'));var logger=require(_0x6f77('0x14'))(_0x6f77('0x15'));var utils=require(_0x6f77('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6f77('0x17'));var db=require(_0x6f77('0x18'))['db'];function respondWithStatusCode(_0x150260,_0x17fda5){_0x17fda5=_0x17fda5||0xcc;return function(_0x413e19){if(_0x413e19){return _0x150260[_0x6f77('0x19')](_0x17fda5);}return _0x150260[_0x6f77('0x1a')](_0x17fda5)[_0x6f77('0x1b')]();};}function respondWithResult(_0x34547,_0x28e354){_0x28e354=_0x28e354||0xc8;return function(_0x386c51){if(_0x386c51){return _0x34547[_0x6f77('0x1a')](_0x28e354)['json'](_0x386c51);}};}function respondWithFilteredResult(_0x48c26c,_0x17c0a5){return function(_0x2b9b87){if(_0x2b9b87){var _0x5cf3b9=typeof _0x17c0a5[_0x6f77('0x1c')]==='undefined'&&typeof _0x17c0a5[_0x6f77('0x1d')]===_0x6f77('0x1e');var _0x531908=_0x2b9b87['count'];var _0x42f774=_0x5cf3b9?0x0:_0x17c0a5[_0x6f77('0x1c')];var _0x128e84=_0x5cf3b9?_0x2b9b87[_0x6f77('0x1f')]:_0x17c0a5[_0x6f77('0x1c')]+_0x17c0a5[_0x6f77('0x1d')];var _0x3f9943;if(_0x128e84>=_0x531908){_0x128e84=_0x531908;_0x3f9943=0xc8;}else{_0x3f9943=0xce;}_0x48c26c[_0x6f77('0x1a')](_0x3f9943);return _0x48c26c['set'](_0x6f77('0x20'),_0x42f774+'-'+_0x128e84+'/'+_0x531908)[_0x6f77('0x21')](_0x2b9b87);}return null;};}function patchUpdates(_0x3ce6ad){return function(_0x5298e2){try{jsonpatch['apply'](_0x5298e2,_0x3ce6ad,!![]);}catch(_0x499678){return BPromise[_0x6f77('0x22')](_0x499678);}return _0x5298e2['save']();};}function saveUpdates(_0x142416,_0x2d7970){return function(_0x494765){if(_0x494765){return _0x494765[_0x6f77('0x23')](_0x142416)[_0x6f77('0x24')](function(_0x2df95d){return _0x2df95d;});}return null;};}function removeEntity(_0x292ddc,_0x2c0cb2){return function(_0x5e09d6){if(_0x5e09d6){return _0x5e09d6[_0x6f77('0x25')]()[_0x6f77('0x24')](function(){_0x292ddc[_0x6f77('0x1a')](0xcc)[_0x6f77('0x1b')]();});}};}function handleEntityNotFound(_0x2a8a41,_0x12c392){return function(_0x2a907d){if(!_0x2a907d){_0x2a8a41['sendStatus'](0x194);}return _0x2a907d;};}function handleError(_0x4a35d0,_0x1f4af8){_0x1f4af8=_0x1f4af8||0x1f4;return function(_0x1e503c){logger[_0x6f77('0x26')](_0x1e503c[_0x6f77('0x27')]);if(_0x1e503c[_0x6f77('0x28')]){delete _0x1e503c[_0x6f77('0x28')];}_0x4a35d0['status'](_0x1f4af8)['send'](_0x1e503c);};}exports[_0x6f77('0x29')]=function(_0x3904f9,_0x1d08de){var _0x2f2b23={'raw':!![],'where':{'id':_0x3904f9[_0x6f77('0x2a')]['id']}},_0x1381af={};_0x1381af[_0x6f77('0x2b')]=_[_0x6f77('0x2c')](db['ChatProactiveAction']['rawAttributes']);_0x1381af[_0x6f77('0x2d')]=_[_0x6f77('0x2c')](_0x3904f9[_0x6f77('0x2d')]);_0x1381af[_0x6f77('0x2e')]=_[_0x6f77('0x2f')](_0x1381af['model'],_0x1381af[_0x6f77('0x2d')]);_0x2f2b23[_0x6f77('0x30')]=_[_0x6f77('0x2f')](_0x1381af['model'],qs[_0x6f77('0x31')](_0x3904f9['query']['fields']));_0x2f2b23[_0x6f77('0x30')]=_0x2f2b23[_0x6f77('0x30')][_0x6f77('0x32')]?_0x2f2b23[_0x6f77('0x30')]:_0x1381af[_0x6f77('0x2b')];if(_0x3904f9[_0x6f77('0x2d')][_0x6f77('0x33')]){_0x2f2b23[_0x6f77('0x34')]=[{'all':!![]}];}_0x2f2b23=_[_0x6f77('0x35')]({},_0x2f2b23,_0x3904f9['options']);return db[_0x6f77('0x36')]['find'](_0x2f2b23)[_0x6f77('0x24')](handleEntityNotFound(_0x1d08de,null))['then'](respondWithResult(_0x1d08de,null))[_0x6f77('0x37')](handleError(_0x1d08de,null));};exports[_0x6f77('0x38')]=function(_0x5d6cff,_0xe00f94){return db[_0x6f77('0x36')][_0x6f77('0x38')](_0x5d6cff[_0x6f77('0x39')],{})[_0x6f77('0x24')](respondWithResult(_0xe00f94,0xc9))['catch'](handleError(_0xe00f94,null));};exports[_0x6f77('0x23')]=function(_0x347d37,_0x28dcff){if(_0x347d37[_0x6f77('0x39')]['id']){delete _0x347d37[_0x6f77('0x39')]['id'];}return db['ChatProactiveAction'][_0x6f77('0x3a')]({'where':{'id':_0x347d37[_0x6f77('0x2a')]['id']}})[_0x6f77('0x24')](handleEntityNotFound(_0x28dcff,null))[_0x6f77('0x24')](saveUpdates(_0x347d37[_0x6f77('0x39')],null))['then'](respondWithResult(_0x28dcff,null))[_0x6f77('0x37')](handleError(_0x28dcff,null));};exports['destroy']=function(_0x2445c6,_0x21b4aa){return db[_0x6f77('0x36')][_0x6f77('0x3a')]({'where':{'id':_0x2445c6[_0x6f77('0x2a')]['id']}})['then'](handleEntityNotFound(_0x21b4aa,null))[_0x6f77('0x24')](removeEntity(_0x21b4aa,null))[_0x6f77('0x37')](handleError(_0x21b4aa,null));};
\ No newline at end of file
+var _0xd67b=['save','update','then','destroy','error','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','attributes','fields','merge','options','find','create','catch','body','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject'];(function(_0x4ab9d8,_0x211196){var _0x2b7b2e=function(_0x3fb0a8){while(--_0x3fb0a8){_0x4ab9d8['push'](_0x4ab9d8['shift']());}};_0x2b7b2e(++_0x211196);}(_0xd67b,0x133));var _0xbd67=function(_0x28c658,_0x20ab45){_0x28c658=_0x28c658-0x0;var _0x10c7a3=_0xd67b[_0x28c658];return _0x10c7a3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbd67('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbd67('0x1'));var rp=require(_0xbd67('0x2'));var moment=require(_0xbd67('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbd67('0x4'));var util=require('util');var path=require(_0xbd67('0x5'));var sox=require('sox');var csv=require(_0xbd67('0x6'));var ejs=require(_0xbd67('0x7'));var fs=require('fs');var fs_extra=require(_0xbd67('0x8'));var _=require(_0xbd67('0x9'));var squel=require(_0xbd67('0xa'));var crypto=require(_0xbd67('0xb'));var jsforce=require(_0xbd67('0xc'));var deskjs=require(_0xbd67('0xd'));var toCsv=require(_0xbd67('0x6'));var querystring=require(_0xbd67('0xe'));var Papa=require(_0xbd67('0xf'));var Redis=require(_0xbd67('0x10'));var authService=require(_0xbd67('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd67('0x12'));var logger=require('../../config/logger')(_0xbd67('0x13'));var utils=require(_0xbd67('0x14'));var config=require(_0xbd67('0x15'));var licenseUtil=require(_0xbd67('0x16'));var db=require(_0xbd67('0x17'))['db'];function respondWithStatusCode(_0xb05237,_0x3621ad){_0x3621ad=_0x3621ad||0xcc;return function(_0x32bd81){if(_0x32bd81){return _0xb05237[_0xbd67('0x18')](_0x3621ad);}return _0xb05237[_0xbd67('0x19')](_0x3621ad)['end']();};}function respondWithResult(_0xbe923c,_0x46d881){_0x46d881=_0x46d881||0xc8;return function(_0x2a5efd){if(_0x2a5efd){return _0xbe923c[_0xbd67('0x19')](_0x46d881)[_0xbd67('0x1a')](_0x2a5efd);}};}function respondWithFilteredResult(_0x23b626,_0x44c025){return function(_0xbdd027){if(_0xbdd027){var _0xa45c76=typeof _0x44c025[_0xbd67('0x1b')]==='undefined'&&typeof _0x44c025['limit']===_0xbd67('0x1c');var _0x475e36=_0xbdd027[_0xbd67('0x1d')];var _0x47d066=_0xa45c76?0x0:_0x44c025[_0xbd67('0x1b')];var _0x2e0e21=_0xa45c76?_0xbdd027[_0xbd67('0x1d')]:_0x44c025['offset']+_0x44c025[_0xbd67('0x1e')];var _0x5ceb31;if(_0x2e0e21>=_0x475e36){_0x2e0e21=_0x475e36;_0x5ceb31=0xc8;}else{_0x5ceb31=0xce;}_0x23b626[_0xbd67('0x19')](_0x5ceb31);return _0x23b626[_0xbd67('0x1f')](_0xbd67('0x20'),_0x47d066+'-'+_0x2e0e21+'/'+_0x475e36)['json'](_0xbdd027);}return null;};}function patchUpdates(_0x3c4102){return function(_0x40ec96){try{jsonpatch[_0xbd67('0x21')](_0x40ec96,_0x3c4102,!![]);}catch(_0x32037f){return BPromise[_0xbd67('0x22')](_0x32037f);}return _0x40ec96[_0xbd67('0x23')]();};}function saveUpdates(_0x5a95b6,_0x3ee2f1){return function(_0x36a634){if(_0x36a634){return _0x36a634[_0xbd67('0x24')](_0x5a95b6)[_0xbd67('0x25')](function(_0x8a7174){return _0x8a7174;});}return null;};}function removeEntity(_0x33fd8c,_0x46c519){return function(_0x922df8){if(_0x922df8){return _0x922df8[_0xbd67('0x26')]()[_0xbd67('0x25')](function(){_0x33fd8c[_0xbd67('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b75dc,_0x5a5227){return function(_0x25bf7a){if(!_0x25bf7a){_0x3b75dc[_0xbd67('0x18')](0x194);}return _0x25bf7a;};}function handleError(_0x144b89,_0x4bbee7){_0x4bbee7=_0x4bbee7||0x1f4;return function(_0x14f5c3){logger[_0xbd67('0x27')](_0x14f5c3['stack']);if(_0x14f5c3[_0xbd67('0x28')]){delete _0x14f5c3[_0xbd67('0x28')];}_0x144b89[_0xbd67('0x19')](_0x4bbee7)[_0xbd67('0x29')](_0x14f5c3);};}exports[_0xbd67('0x2a')]=function(_0x55c2d4,_0x5975dc){var _0x41856b={'raw':!![],'where':{'id':_0x55c2d4[_0xbd67('0x2b')]['id']}},_0x310d21={};_0x310d21[_0xbd67('0x2c')]=_[_0xbd67('0x2d')](db[_0xbd67('0x2e')][_0xbd67('0x2f')]);_0x310d21[_0xbd67('0x30')]=_[_0xbd67('0x2d')](_0x55c2d4[_0xbd67('0x30')]);_0x310d21['filters']=_['intersection'](_0x310d21[_0xbd67('0x2c')],_0x310d21[_0xbd67('0x30')]);_0x41856b[_0xbd67('0x31')]=_['intersection'](_0x310d21[_0xbd67('0x2c')],qs[_0xbd67('0x32')](_0x55c2d4[_0xbd67('0x30')][_0xbd67('0x32')]));_0x41856b['attributes']=_0x41856b['attributes']['length']?_0x41856b[_0xbd67('0x31')]:_0x310d21[_0xbd67('0x2c')];if(_0x55c2d4[_0xbd67('0x30')]['includeAll']){_0x41856b['include']=[{'all':!![]}];}_0x41856b=_[_0xbd67('0x33')]({},_0x41856b,_0x55c2d4[_0xbd67('0x34')]);return db[_0xbd67('0x2e')][_0xbd67('0x35')](_0x41856b)[_0xbd67('0x25')](handleEntityNotFound(_0x5975dc,null))[_0xbd67('0x25')](respondWithResult(_0x5975dc,null))['catch'](handleError(_0x5975dc,null));};exports[_0xbd67('0x36')]=function(_0xba97cf,_0x443d45){return db['ChatProactiveAction'][_0xbd67('0x36')](_0xba97cf['body'],{})[_0xbd67('0x25')](respondWithResult(_0x443d45,0xc9))[_0xbd67('0x37')](handleError(_0x443d45,null));};exports['update']=function(_0x3b7775,_0x126514){if(_0x3b7775[_0xbd67('0x38')]['id']){delete _0x3b7775[_0xbd67('0x38')]['id'];}return db[_0xbd67('0x2e')][_0xbd67('0x35')]({'where':{'id':_0x3b7775['params']['id']}})[_0xbd67('0x25')](handleEntityNotFound(_0x126514,null))[_0xbd67('0x25')](saveUpdates(_0x3b7775[_0xbd67('0x38')],null))[_0xbd67('0x25')](respondWithResult(_0x126514,null))[_0xbd67('0x37')](handleError(_0x126514,null));};exports['destroy']=function(_0x4b7e65,_0x363cbe){return db[_0xbd67('0x2e')][_0xbd67('0x35')]({'where':{'id':_0x4b7e65['params']['id']}})[_0xbd67('0x25')](handleEntityNotFound(_0x363cbe,null))[_0xbd67('0x25')](removeEntity(_0x363cbe,null))[_0xbd67('0x37')](handleError(_0x363cbe,null));};
\ No newline at end of file
index a634578..3604b37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4839=['../../config/environment','./chatProactiveAction.attributes','chat_proactive_actions','lodash','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x2386dd,_0x3777a1){var _0x195648=function(_0x411c1e){while(--_0x411c1e){_0x2386dd['push'](_0x2386dd['shift']());}};_0x195648(++_0x3777a1);}(_0x4839,0x12f));var _0x9483=function(_0x6ef16f,_0x1722ae){_0x6ef16f=_0x6ef16f-0x0;var _0x484cc5=_0x4839[_0x6ef16f];return _0x484cc5;};'use strict';var _=require(_0x9483('0x0'));var util=require(_0x9483('0x1'));var logger=require(_0x9483('0x2'))(_0x9483('0x3'));var moment=require(_0x9483('0x4'));var BPromise=require('bluebird');var rp=require(_0x9483('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9483('0x6'));var config=require(_0x9483('0x7'));var attributes=require(_0x9483('0x8'));module['exports']=function(_0x39b4be,_0x1287a7){return _0x39b4be['define']('ChatProactiveAction',attributes,{'tableName':_0x9483('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd738=['./chatProactiveAction.attributes','exports','define','ChatProactiveAction','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x195951,_0x2a0dac){var _0x463d54=function(_0x422b9f){while(--_0x422b9f){_0x195951['push'](_0x195951['shift']());}};_0x463d54(++_0x2a0dac);}(_0xd738,0x86));var _0x8d73=function(_0x3e1f16,_0x58c9a5){_0x3e1f16=_0x3e1f16-0x0;var _0x1345a1=_0xd738[_0x3e1f16];return _0x1345a1;};'use strict';var _=require(_0x8d73('0x0'));var util=require(_0x8d73('0x1'));var logger=require(_0x8d73('0x2'))(_0x8d73('0x3'));var moment=require(_0x8d73('0x4'));var BPromise=require(_0x8d73('0x5'));var rp=require(_0x8d73('0x6'));var fs=require('fs');var path=require(_0x8d73('0x7'));var rimraf=require('rimraf');var config=require(_0x8d73('0x8'));var attributes=require(_0x8d73('0x9'));module[_0x8d73('0xa')]=function(_0x37ea9a,_0x2ac70e){return _0x37ea9a[_0x8d73('0xb')](_0x8d73('0xc'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 32305d0..adee792 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd095=['../../config/environment','jayson/promise','client','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x137e04,_0x3c0799){var _0x4c6762=function(_0x45f489){while(--_0x45f489){_0x137e04['push'](_0x137e04['shift']());}};_0x4c6762(++_0x3c0799);}(_0xd095,0xd5));var _0x5d09=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0xd095[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require(_0x5d09('0x0'));var util=require('util');var moment=require(_0x5d09('0x1'));var BPromise=require(_0x5d09('0x2'));var rs=require(_0x5d09('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5d09('0x4'))['db'];var utils=require(_0x5d09('0x5'));var logger=require('../../config/logger')(_0x5d09('0x6'));var config=require(_0x5d09('0x7'));var jayson=require(_0x5d09('0x8'));var client=jayson[_0x5d09('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b1515,_0x44b475,_0x26dd0e){return new BPromise(function(_0x113be2,_0x214744){return client['request'](_0x3b1515,_0x26dd0e)[_0x5d09('0xa')](function(_0x2bccfc){logger['info'](_0x5d09('0xb'),_0x44b475,_0x5d09('0xc'));logger[_0x5d09('0xd')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x44b475,'request\x20sent',JSON[_0x5d09('0xe')](_0x2bccfc));if(_0x2bccfc[_0x5d09('0xf')]){if(_0x2bccfc[_0x5d09('0xf')][_0x5d09('0x10')]===0x1f4){logger[_0x5d09('0xf')](_0x5d09('0xb'),_0x44b475,_0x2bccfc[_0x5d09('0xf')][_0x5d09('0x11')]);return _0x214744(_0x2bccfc['error'][_0x5d09('0x11')]);}logger[_0x5d09('0xf')](_0x5d09('0xb'),_0x44b475,_0x2bccfc['error']['message']);return _0x113be2(_0x2bccfc[_0x5d09('0xf')][_0x5d09('0x11')]);}else{logger[_0x5d09('0x12')](_0x5d09('0xb'),_0x44b475,_0x5d09('0xc'));_0x113be2(_0x2bccfc['result'][_0x5d09('0x11')]);}})[_0x5d09('0x13')](function(_0x496873){logger['error'](_0x5d09('0xb'),_0x44b475,_0x496873);_0x214744(_0x496873);});});}
\ No newline at end of file
+var _0x65ae=['request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','request','info','ChatProactiveAction,\x20%s,\x20%s'];(function(_0x2093f0,_0x1f903c){var _0x37829f=function(_0x27d3bc){while(--_0x27d3bc){_0x2093f0['push'](_0x2093f0['shift']());}};_0x37829f(++_0x1f903c);}(_0x65ae,0x12e));var _0xe65a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x65ae[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xe65a('0x0'));var util=require(_0xe65a('0x1'));var moment=require(_0xe65a('0x2'));var BPromise=require(_0xe65a('0x3'));var rs=require(_0xe65a('0x4'));var fs=require('fs');var Redis=require(_0xe65a('0x5'));var db=require(_0xe65a('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe65a('0x7'));var config=require(_0xe65a('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe65a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e4eff,_0x25adc9,_0x4e2b09){return new BPromise(function(_0x41094d,_0x3383ab){return client[_0xe65a('0xa')](_0x3e4eff,_0x4e2b09)['then'](function(_0x1e77ec){logger[_0xe65a('0xb')](_0xe65a('0xc'),_0x25adc9,_0xe65a('0xd'));logger[_0xe65a('0xe')](_0xe65a('0xf'),_0x25adc9,_0xe65a('0xd'),JSON[_0xe65a('0x10')](_0x1e77ec));if(_0x1e77ec[_0xe65a('0x11')]){if(_0x1e77ec['error'][_0xe65a('0x12')]===0x1f4){logger[_0xe65a('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x25adc9,_0x1e77ec[_0xe65a('0x11')][_0xe65a('0x13')]);return _0x3383ab(_0x1e77ec['error'][_0xe65a('0x13')]);}logger[_0xe65a('0x11')](_0xe65a('0xc'),_0x25adc9,_0x1e77ec[_0xe65a('0x11')][_0xe65a('0x13')]);return _0x41094d(_0x1e77ec[_0xe65a('0x11')][_0xe65a('0x13')]);}else{logger[_0xe65a('0xb')](_0xe65a('0xc'),_0x25adc9,_0xe65a('0xd'));_0x41094d(_0x1e77ec[_0xe65a('0x14')]['message']);}})['catch'](function(_0x1d98a9){logger[_0xe65a('0x11')](_0xe65a('0xc'),_0x25adc9,_0x1d98a9);_0x3383ab(_0x1d98a9);});});}
\ No newline at end of file
index 51bfbbd..37ea993 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x207c=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','show','post','create','put','/:id','update','delete'];(function(_0x3bbacb,_0x3a554a){var _0x1ea059=function(_0x32a962){while(--_0x32a962){_0x3bbacb['push'](_0x3bbacb['shift']());}};_0x1ea059(++_0x3a554a);}(_0x207c,0x1e8));var _0xc207=function(_0x497641,_0x5d4f64){_0x497641=_0x497641-0x0;var _0x3c355e=_0x207c[_0x497641];return _0x3c355e;};'use strict';var multer=require('multer');var util=require(_0xc207('0x0'));var path=require(_0xc207('0x1'));var timeout=require(_0xc207('0x2'));var express=require(_0xc207('0x3'));var router=express[_0xc207('0x4')]();var fs_extra=require(_0xc207('0x5'));var auth=require(_0xc207('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc207('0x7'));var controller=require('./chatProactiveAction.controller');router['get']('/:id',auth[_0xc207('0x8')](),controller[_0xc207('0x9')]);router[_0xc207('0xa')]('/',auth['isAuthenticated'](),controller[_0xc207('0xb')]);router[_0xc207('0xc')](_0xc207('0xd'),auth['isAuthenticated'](),controller[_0xc207('0xe')]);router[_0xc207('0xf')](_0xc207('0xd'),auth[_0xc207('0x8')](),controller[_0xc207('0x10')]);module[_0xc207('0x11')]=router;
\ No newline at end of file
+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(_0x39b24a,_0x2ce1c4){var _0x29e2be=function(_0x26af83){while(--_0x26af83){_0x39b24a['push'](_0x39b24a['shift']());}};_0x29e2be(++_0x2ce1c4);}(_0xa630,0xbe));var _0x0a63=function(_0x55b10f,_0x216487){_0x55b10f=_0x55b10f-0x0;var _0x1727a3=_0xa630[_0x55b10f];return _0x1727a3;};'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
index c885d50..c74a51e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5942=['roundrobin','sequelize','exports','INTEGER','ENUM','rrmemory'];(function(_0x45ea9d,_0x2e2a68){var _0x367e67=function(_0x5243ca){while(--_0x5243ca){_0x45ea9d['push'](_0x45ea9d['shift']());}};_0x367e67(++_0x2e2a68);}(_0x5942,0xaf));var _0x2594=function(_0x3b4979,_0x29bd1b){_0x3b4979=_0x3b4979-0x0;var _0x52aa62=_0x5942[_0x3b4979];return _0x52aa62;};'use strict';var Sequelize=require(_0x2594('0x0'));module[_0x2594('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x2594('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2594('0x3')](_0x2594('0x4'),'beepall',_0x2594('0x5'))}};
\ No newline at end of file
+var _0xbfd7=['sequelize','exports','STRING','INTEGER','rrmemory','beepall'];(function(_0x4c8a17,_0x50544a){var _0x557dd7=function(_0xc30491){while(--_0xc30491){_0x4c8a17['push'](_0x4c8a17['shift']());}};_0x557dd7(++_0x50544a);}(_0xbfd7,0xae));var _0x7bfd=function(_0x519b40,_0x36cbab){_0x519b40=_0x519b40-0x0;var _0x169b06=_0xbfd7[_0x519b40];return _0x169b06;};'use strict';var Sequelize=require(_0x7bfd('0x0'));module[_0x7bfd('0x1')]={'name':{'type':Sequelize[_0x7bfd('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x7bfd('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x7bfd('0x4'),_0x7bfd('0x5'),'roundrobin')}};
\ No newline at end of file
index 29887d9..53b5628 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x453f=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','ChatQueueId','User','agent','chatPause','updatedAt','createdAt','%s/%s','Team','getTeams','Agents','online','voicePause','interface','flatMap','transaction','addTeams','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','team_has_chat_queues','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','removeAgents','userChatQueue:remove','addAgents','ids','omit','spread','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','keys','intersection','find'];(function(_0xea7072,_0xf4f740){var _0x5487c1=function(_0x4bce83){while(--_0x4bce83){_0xea7072['push'](_0xea7072['shift']());}};_0x5487c1(++_0xf4f740);}(_0x453f,0xd4));var _0xf453=function(_0xd63b78,_0x17cb52){_0xd63b78=_0xd63b78-0x0;var _0x169180=_0x453f[_0xd63b78];return _0x169180;};'use strict';var emlformat=require(_0xf453('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf453('0x1'));var jsonpatch=require(_0xf453('0x2'));var rp=require(_0xf453('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf453('0x4'));var util=require(_0xf453('0x5'));var path=require('path');var sox=require(_0xf453('0x6'));var csv=require(_0xf453('0x7'));var ejs=require(_0xf453('0x8'));var fs=require('fs');var fs_extra=require(_0xf453('0x9'));var _=require('lodash');var squel=require(_0xf453('0xa'));var crypto=require(_0xf453('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf453('0xc'));var toCsv=require(_0xf453('0x7'));var querystring=require(_0xf453('0xd'));var Papa=require(_0xf453('0xe'));var Redis=require(_0xf453('0xf'));var authService=require(_0xf453('0x10'));var qs=require(_0xf453('0x11'));var as=require(_0xf453('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf453('0x13'))(_0xf453('0x14'));var utils=require(_0xf453('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf453('0x16'));var db=require(_0xf453('0x17'))['db'];config['redis']=_[_0xf453('0x18')](config[_0xf453('0x19')],{'host':_0xf453('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf453('0x1b'))[_0xf453('0x1c')](socket);var jayson=require(_0xf453('0x1d'));var client=jayson[_0xf453('0x1e')][_0xf453('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x154aab,_0xd07df3,_0x4381c0,_0x62db02){return new BPromise(function(_0x29668d,_0x51985d){var _0x557600=_0x62db02||client;return _0x557600[_0xf453('0x20')](_0x154aab,_0x4381c0)[_0xf453('0x21')](function(_0x3aa431){logger[_0xf453('0x22')](_0xf453('0x23'),_0xd07df3,_0xf453('0x24'));logger['debug'](_0xf453('0x25'),_0xd07df3,_0xf453('0x24'),JSON[_0xf453('0x26')](_0x3aa431));if(_0x3aa431['error']){if(_0x3aa431[_0xf453('0x27')][_0xf453('0x28')]===0x1f4){logger[_0xf453('0x27')](_0xf453('0x23'),_0xd07df3,_0x3aa431[_0xf453('0x27')][_0xf453('0x29')]);return _0x51985d(_0x3aa431['error'][_0xf453('0x29')]);}logger[_0xf453('0x27')](_0xf453('0x23'),_0xd07df3,_0x3aa431[_0xf453('0x27')][_0xf453('0x29')]);return _0x29668d(_0x3aa431['error'][_0xf453('0x29')]);}else{logger[_0xf453('0x22')](_0xf453('0x23'),_0xd07df3,_0xf453('0x24'));_0x29668d(_0x3aa431[_0xf453('0x2a')]['message']);}})[_0xf453('0x2b')](function(_0x502775){logger[_0xf453('0x27')](_0xf453('0x23'),_0xd07df3,_0x502775);_0x51985d(_0x502775);});});}function respondWithStatusCode(_0x2bce69,_0x484cc2){_0x484cc2=_0x484cc2||0xcc;return function(_0x31aa67){if(_0x31aa67){return _0x2bce69[_0xf453('0x2c')](_0x484cc2);}return _0x2bce69[_0xf453('0x2d')](_0x484cc2)['end']();};}function respondWithResult(_0xd288c9,_0x259683){_0x259683=_0x259683||0xc8;return function(_0x42cc39){if(_0x42cc39){return _0xd288c9[_0xf453('0x2d')](_0x259683)['json'](_0x42cc39);}};}function respondWithFilteredResult(_0x768a9e,_0xdb40f6){return function(_0x537836){if(_0x537836){var _0x469e83=typeof _0xdb40f6[_0xf453('0x2e')]===_0xf453('0x2f')&&typeof _0xdb40f6[_0xf453('0x30')]===_0xf453('0x2f');var _0x7c2ba=_0x537836[_0xf453('0x31')];var _0x4ec60b=_0x469e83?0x0:_0xdb40f6['offset'];var _0x302620=_0x469e83?_0x537836[_0xf453('0x31')]:_0xdb40f6['offset']+_0xdb40f6[_0xf453('0x30')];var _0x1e5ba6;if(_0x302620>=_0x7c2ba){_0x302620=_0x7c2ba;_0x1e5ba6=0xc8;}else{_0x1e5ba6=0xce;}_0x768a9e[_0xf453('0x2d')](_0x1e5ba6);return _0x768a9e[_0xf453('0x32')](_0xf453('0x33'),_0x4ec60b+'-'+_0x302620+'/'+_0x7c2ba)[_0xf453('0x34')](_0x537836);}return null;};}function patchUpdates(_0x58fa92){return function(_0x4642fd){try{jsonpatch[_0xf453('0x35')](_0x4642fd,_0x58fa92,!![]);}catch(_0x54738e){return BPromise[_0xf453('0x36')](_0x54738e);}return _0x4642fd[_0xf453('0x37')]();};}function saveUpdates(_0x101100,_0x427012){return function(_0x532b8a){if(_0x532b8a){return _0x532b8a[_0xf453('0x38')](_0x101100)[_0xf453('0x21')](function(_0x1059df){return _0x1059df;});}return null;};}function removeEntity(_0x18e2f8,_0x1c4e1c){return function(_0x1fb4bc){if(_0x1fb4bc){return _0x1fb4bc[_0xf453('0x39')]()[_0xf453('0x21')](function(){var _0x23cabf=_0x1fb4bc[_0xf453('0x3a')]({'plain':!![]});var _0x4870d1=_0xf453('0x3b');return db[_0xf453('0x3c')][_0xf453('0x39')]({'where':{'type':_0x4870d1,'resourceId':_0x23cabf['id']}})['then'](function(){return _0x1fb4bc;});})[_0xf453('0x21')](function(){_0x18e2f8[_0xf453('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x331941,_0x31f74a){return function(_0x4ea64e){if(!_0x4ea64e){_0x331941[_0xf453('0x2c')](0x194);}return _0x4ea64e;};}function handleError(_0x2abccb,_0x2e0d85){_0x2e0d85=_0x2e0d85||0x1f4;return function(_0x29f88b){logger[_0xf453('0x27')](_0x29f88b[_0xf453('0x3d')]);if(_0x29f88b[_0xf453('0x3e')]){delete _0x29f88b[_0xf453('0x3e')];}_0x2abccb[_0xf453('0x2d')](_0x2e0d85)[_0xf453('0x3f')](_0x29f88b);};}exports[_0xf453('0x40')]=function(_0x292dfa,_0x4a7f9e){var _0x261d28={},_0x37cf71={},_0x45aab8={'count':0x0,'rows':[]};var _0x1bf473=_[_0xf453('0x41')](db[_0xf453('0x42')][_0xf453('0x43')],function(_0x46d624){return{'name':_0x46d624[_0xf453('0x44')],'type':_0x46d624[_0xf453('0x45')][_0xf453('0x46')]};});_0x37cf71[_0xf453('0x47')]=_['map'](_0x1bf473,_0xf453('0x3e'));_0x37cf71[_0xf453('0x48')]=_['keys'](_0x292dfa['query']);_0x37cf71['filters']=_['intersection'](_0x37cf71[_0xf453('0x47')],_0x37cf71[_0xf453('0x48')]);_0x261d28[_0xf453('0x49')]=_['intersection'](_0x37cf71['model'],qs[_0xf453('0x4a')](_0x292dfa[_0xf453('0x48')]['fields']));_0x261d28['attributes']=_0x261d28[_0xf453('0x49')][_0xf453('0x4b')]?_0x261d28[_0xf453('0x49')]:_0x37cf71[_0xf453('0x47')];if(!_0x292dfa['query'][_0xf453('0x4c')](_0xf453('0x4d'))){_0x261d28[_0xf453('0x30')]=qs[_0xf453('0x30')](_0x292dfa[_0xf453('0x48')][_0xf453('0x30')]);_0x261d28[_0xf453('0x2e')]=qs[_0xf453('0x2e')](_0x292dfa[_0xf453('0x48')][_0xf453('0x2e')]);}_0x261d28[_0xf453('0x4e')]=qs[_0xf453('0x4f')](_0x292dfa['query'][_0xf453('0x4f')]);_0x261d28[_0xf453('0x50')]=qs[_0xf453('0x51')](_[_0xf453('0x52')](_0x292dfa['query'],_0x37cf71[_0xf453('0x51')]),_0x1bf473);if(_0x292dfa[_0xf453('0x48')]['filter']){_0x261d28['where']=_[_0xf453('0x53')](_0x261d28[_0xf453('0x50')],{'$or':_[_0xf453('0x41')](_0x1bf473,function(_0x6a60ea){if(_0x6a60ea[_0xf453('0x45')]!==_0xf453('0x54')){var _0x587dad={};_0x587dad[_0x6a60ea[_0xf453('0x3e')]]={'$like':'%'+_0x292dfa[_0xf453('0x48')][_0xf453('0x55')]+'%'};return _0x587dad;}})});}_0x261d28=_[_0xf453('0x53')]({},_0x261d28,_0x292dfa[_0xf453('0x56')]);var _0x3a4146={'where':_0x261d28['where']};return db['ChatQueue'][_0xf453('0x31')](_0x3a4146)[_0xf453('0x21')](function(_0x5da753){_0x45aab8[_0xf453('0x31')]=_0x5da753;if(_0x292dfa[_0xf453('0x48')][_0xf453('0x57')]){_0x261d28[_0xf453('0x58')]=[{'all':!![]}];}return db[_0xf453('0x42')][_0xf453('0x59')](_0x261d28);})[_0xf453('0x21')](function(_0x5d6235){_0x45aab8[_0xf453('0x5a')]=_0x5d6235;return _0x45aab8;})[_0xf453('0x21')](respondWithFilteredResult(_0x4a7f9e,_0x261d28))[_0xf453('0x2b')](handleError(_0x4a7f9e,null));};exports[_0xf453('0x5b')]=function(_0x58d8f6,_0x31cb65){var _0x32ae03={'raw':!![],'where':{'id':_0x58d8f6[_0xf453('0x5c')]['id']}},_0x51a848={};_0x51a848[_0xf453('0x47')]=_[_0xf453('0x5d')](db['ChatQueue'][_0xf453('0x43')]);_0x51a848[_0xf453('0x48')]=_[_0xf453('0x5d')](_0x58d8f6['query']);_0x51a848['filters']=_[_0xf453('0x5e')](_0x51a848['model'],_0x51a848[_0xf453('0x48')]);_0x32ae03[_0xf453('0x49')]=_[_0xf453('0x5e')](_0x51a848['model'],qs['fields'](_0x58d8f6[_0xf453('0x48')][_0xf453('0x4a')]));_0x32ae03[_0xf453('0x49')]=_0x32ae03[_0xf453('0x49')][_0xf453('0x4b')]?_0x32ae03[_0xf453('0x49')]:_0x51a848['model'];if(_0x58d8f6[_0xf453('0x48')][_0xf453('0x57')]){_0x32ae03['include']=[{'all':!![]}];}_0x32ae03=_[_0xf453('0x53')]({},_0x32ae03,_0x58d8f6[_0xf453('0x56')]);return db[_0xf453('0x42')][_0xf453('0x5f')](_0x32ae03)[_0xf453('0x21')](handleEntityNotFound(_0x31cb65,null))[_0xf453('0x21')](respondWithResult(_0x31cb65,null))[_0xf453('0x2b')](handleError(_0x31cb65,null));};exports[_0xf453('0x60')]=function(_0x41319b,_0x518330){return db[_0xf453('0x42')][_0xf453('0x60')](_0x41319b[_0xf453('0x61')],{})[_0xf453('0x21')](function(_0x29d51c){var _0x473bf9=_0x41319b[_0xf453('0x62')][_0xf453('0x3a')]({'plain':!![]});if(!_0x473bf9)throw new Error(_0xf453('0x63'));if(_0x473bf9[_0xf453('0x64')]===_0xf453('0x62')){var _0x1a5aca=_0x29d51c['get']({'plain':!![]});var _0x26c54b=_0xf453('0x3b');return db['UserProfileSection'][_0xf453('0x5f')]({'where':{'name':_0x26c54b,'userProfileId':_0x473bf9[_0xf453('0x65')]},'raw':!![]})[_0xf453('0x21')](function(_0x24aaab){if(_0x24aaab&&_0x24aaab[_0xf453('0x66')]===0x0){return db[_0xf453('0x3c')][_0xf453('0x60')]({'name':_0x1a5aca['name'],'resourceId':_0x1a5aca['id'],'type':_0x24aaab[_0xf453('0x3e')],'sectionId':_0x24aaab['id']},{})[_0xf453('0x21')](function(){return _0x29d51c;});}else{return _0x29d51c;}})['catch'](function(_0x1ff00c){logger[_0xf453('0x27')](_0xf453('0x67'),_0x1ff00c);throw _0x1ff00c;});}return _0x29d51c;})['then'](respondWithResult(_0x518330,0xc9))['catch'](handleError(_0x518330,null));};exports['update']=function(_0xcf1d20,_0xa68f3b){if(_0xcf1d20['body']['id']){delete _0xcf1d20['body']['id'];}return db[_0xf453('0x42')][_0xf453('0x5f')]({'where':{'id':_0xcf1d20[_0xf453('0x5c')]['id']}})[_0xf453('0x21')](handleEntityNotFound(_0xa68f3b,null))[_0xf453('0x21')](saveUpdates(_0xcf1d20['body'],null))[_0xf453('0x21')](respondWithResult(_0xa68f3b,null))['catch'](handleError(_0xa68f3b,null));};exports[_0xf453('0x39')]=function(_0x4dff78,_0x4d015e){return db['ChatQueue']['find']({'where':{'id':_0x4dff78[_0xf453('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4d015e,null))[_0xf453('0x21')](removeEntity(_0x4d015e,null))[_0xf453('0x2b')](handleError(_0x4d015e,null));};exports['describe']=function(_0x1fa18f,_0x467b3d){return db[_0xf453('0x42')][_0xf453('0x68')]()['then'](respondWithResult(_0x467b3d,null))[_0xf453('0x2b')](handleError(_0x467b3d,null));};exports[_0xf453('0x69')]=function(_0x40ef05,_0x4b1166,_0x302597){var _0xcaf2e0={'raw':!![],'where':{}},_0x444f58={},_0x5f45bd;return db[_0xf453('0x42')][_0xf453('0x6a')]({'where':{'id':_0x40ef05[_0xf453('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4b1166,null))[_0xf453('0x21')](function(_0x282f7e){if(_0x282f7e){_0x5f45bd=_0x282f7e['get']({'plain':!![]});_0x444f58[_0xf453('0x47')]=_[_0xf453('0x5d')](db[_0xf453('0x6b')][_0xf453('0x43')]);_0x444f58[_0xf453('0x48')]=_[_0xf453('0x5d')](_0x40ef05[_0xf453('0x48')]);_0x444f58[_0xf453('0x51')]=_[_0xf453('0x5e')](_0x444f58[_0xf453('0x47')],_0x444f58[_0xf453('0x48')]);_0xcaf2e0[_0xf453('0x49')]=_[_0xf453('0x5e')](_0x444f58[_0xf453('0x47')],qs[_0xf453('0x4a')](_0x40ef05['query'][_0xf453('0x4a')]));_0xcaf2e0['attributes']=_0xcaf2e0['attributes'][_0xf453('0x4b')]?_0xcaf2e0['attributes']:_0x444f58['model'];if(!_0x40ef05[_0xf453('0x48')][_0xf453('0x4c')](_0xf453('0x4d'))){_0xcaf2e0['limit']=qs['limit'](_0x40ef05['query'][_0xf453('0x30')]);_0xcaf2e0[_0xf453('0x2e')]=qs[_0xf453('0x2e')](_0x40ef05['query'][_0xf453('0x2e')]);}_0xcaf2e0['order']=qs[_0xf453('0x4f')](_0x40ef05[_0xf453('0x48')][_0xf453('0x4f')]);_0xcaf2e0[_0xf453('0x50')]=qs[_0xf453('0x51')](_[_0xf453('0x52')](_0x40ef05[_0xf453('0x48')],_0x444f58['filters']));_0xcaf2e0['where'][_0xf453('0x6c')]=_0x282f7e['id'];if(_0x40ef05['query'][_0xf453('0x55')]){_0xcaf2e0[_0xf453('0x50')]=_[_0xf453('0x53')](_0xcaf2e0[_0xf453('0x50')],{'$or':_[_0xf453('0x41')](_0xcaf2e0[_0xf453('0x49')],function(_0x2f1a78){var _0x2b36cd={};_0x2b36cd[_0x2f1a78]={'$like':'%'+_0x40ef05['query']['filter']+'%'};return _0x2b36cd;})});}_0xcaf2e0=_[_0xf453('0x53')]({},_0xcaf2e0,_0x40ef05[_0xf453('0x56')]);return db[_0xf453('0x6b')][_0xf453('0x59')](_0xcaf2e0);}})[_0xf453('0x21')](function(_0x47078e){if(_0x47078e){return db[_0xf453('0x6d')]['findAndCountAll']({'where':{'id':_['map'](_0x47078e,'UserId'),'role':_0xf453('0x6e')},'attributes':['id',_0xf453('0x3e'),_0xf453('0x6f'),_0xf453('0x70'),_0xf453('0x71')]});}})[_0xf453('0x21')](function(_0x251647){if(_0x251647){return{'count':_0x251647['count'],'rows':_[_0xf453('0x41')](_0x251647[_0xf453('0x5a')],function(_0x2a0490){return{'membername':_0x2a0490[_0xf453('0x3e')],'UserId':_0x2a0490['id'],'queue_name':_0x5f45bd[_0xf453('0x3e')],'ChatQueueId':_0x5f45bd['id'],'interface':util['format'](_0xf453('0x72'),'SIP',_0x2a0490[_0xf453('0x3e')]),'penalty':0x0,'paused':_0x2a0490[_0xf453('0x6f')],'createdAt':_0x2a0490['createdAt'],'updatedAt':_0x2a0490['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xf453('0x21')](respondWithFilteredResult(_0x4b1166,_0xcaf2e0))[_0xf453('0x2b')](handleError(_0x4b1166,null));};exports['getTeams']=function(_0x478a90,_0x3020d1,_0x263ca5){var _0x200a0c={};var _0x2e51f0={};var _0x4478d8;var _0x5897d9;return db[_0xf453('0x42')]['findOne']({'where':{'id':_0x478a90[_0xf453('0x5c')]['id']}})[_0xf453('0x21')](handleEntityNotFound(_0x3020d1,null))[_0xf453('0x21')](function(_0x1ca998){if(_0x1ca998){_0x4478d8=_0x1ca998;_0x2e51f0[_0xf453('0x47')]=_[_0xf453('0x5d')](db[_0xf453('0x73')][_0xf453('0x43')]);_0x2e51f0[_0xf453('0x48')]=_[_0xf453('0x5d')](_0x478a90[_0xf453('0x48')]);_0x2e51f0['filters']=_[_0xf453('0x5e')](_0x2e51f0[_0xf453('0x47')],_0x2e51f0[_0xf453('0x48')]);_0x200a0c[_0xf453('0x49')]=_[_0xf453('0x5e')](_0x2e51f0['model'],qs[_0xf453('0x4a')](_0x478a90['query']['fields']));_0x200a0c[_0xf453('0x49')]=_0x200a0c['attributes']['length']?_0x200a0c[_0xf453('0x49')]:_0x2e51f0[_0xf453('0x47')];_0x200a0c[_0xf453('0x4e')]=qs[_0xf453('0x4f')](_0x478a90[_0xf453('0x48')][_0xf453('0x4f')]);_0x200a0c[_0xf453('0x50')]=qs[_0xf453('0x51')](_[_0xf453('0x52')](_0x478a90[_0xf453('0x48')],_0x2e51f0[_0xf453('0x51')]));if(_0x478a90[_0xf453('0x48')][_0xf453('0x55')]){_0x200a0c[_0xf453('0x50')]=_[_0xf453('0x53')](_0x200a0c[_0xf453('0x50')],{'$or':_[_0xf453('0x41')](_0x200a0c[_0xf453('0x49')],function(_0xef085f){var _0x25e1ea={};_0x25e1ea[_0xef085f]={'$like':'%'+_0x478a90[_0xf453('0x48')][_0xf453('0x55')]+'%'};return _0x25e1ea;})});}_0x200a0c=_[_0xf453('0x53')]({},_0x200a0c,_0x478a90[_0xf453('0x56')]);return _0x4478d8[_0xf453('0x74')](_0x200a0c);}})[_0xf453('0x21')](function(_0x183109){if(_0x183109){_0x5897d9=_0x183109[_0xf453('0x4b')];if(!_0x478a90[_0xf453('0x48')][_0xf453('0x4c')](_0xf453('0x4d'))){_0x200a0c['limit']=qs[_0xf453('0x30')](_0x478a90[_0xf453('0x48')][_0xf453('0x30')]);_0x200a0c['offset']=qs[_0xf453('0x2e')](_0x478a90[_0xf453('0x48')]['offset']);}return _0x4478d8[_0xf453('0x74')](_0x200a0c);}})[_0xf453('0x21')](function(_0x4c4e56){if(_0x4c4e56){return _0x4c4e56?{'count':_0x5897d9,'rows':_0x4c4e56}:null;}})[_0xf453('0x21')](respondWithResult(_0x3020d1,null))[_0xf453('0x2b')](handleError(_0x3020d1,null));};exports['addTeams']=function(_0x47ea0b,_0x3fe343,_0x3983bb){var _0x282d7c=_0x47ea0b[_0xf453('0x61')]['ids'];return db[_0xf453('0x73')][_0xf453('0x59')]({'where':{'id':_0x282d7c},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf453('0x75'),'attributes':['id',_0xf453('0x3e'),_0xf453('0x76'),_0xf453('0x77'),_0xf453('0x78')],'raw':!![]}]})[_0xf453('0x21')](function(_0x5405e7){if(_0x5405e7){var _0x20f2f6=_[_0xf453('0x79')](_0x5405e7,function(_0x5ac073){var _0x2f414e=_0x5ac073[_0xf453('0x3a')]({'plain':!![]});return _0x2f414e[_0xf453('0x75')];});return db['ChatQueue'][_0xf453('0x5f')]({'where':{'id':_0x47ea0b['params']['id']}})[_0xf453('0x21')](function(_0x14e8fa){return db['sequelize'][_0xf453('0x7a')](function(_0x26afba){return _0x14e8fa[_0xf453('0x7b')](_0x282d7c,{'transaction':_0x26afba})[_0xf453('0x21')](function(){return BPromise[_0xf453('0x7c')](_0x20f2f6,function(_0x499d71){return db[_0xf453('0x6b')][_0xf453('0x7d')]({'where':{'UserId':_0x499d71['id'],'ChatQueueId':_0x47ea0b[_0xf453('0x5c')]['id']},'transaction':_0x26afba});});})[_0xf453('0x21')](function(){_0x20f2f6[_0xf453('0x7e')](function(_0x1b2151){socket[_0xf453('0x7f')](_0xf453('0x80'),{'UserId':_0x1b2151['id'],'ChatQueueId':_0x14e8fa['id']});});});});});}})[_0xf453('0x21')](respondWithStatusCode(_0x3fe343,null))[_0xf453('0x2b')](handleError(_0x3fe343,null));};exports[_0xf453('0x81')]=function(_0x1cc4ac,_0x3702f7,_0x44be19){return db['Team']['findAll']({'where':{'id':_0x1cc4ac[_0xf453('0x48')]['ids']},'attributes':['id'],'include':[{'model':db[_0xf453('0x6d')],'as':_0xf453('0x75'),'attributes':['id'],'raw':!![]}]})[_0xf453('0x21')](handleEntityNotFound(_0x3702f7,null))[_0xf453('0x21')](function(_0x27385d){var _0x12f34c=_['map'](_0x27385d,'id');var _0x263b13=[];var _0x1f3e8e=[];var _0x406e6f=squel['select']();_0x406e6f[_0xf453('0x82')](_0xf453('0x83'))['from'](_0xf453('0x84'),'tq')['join']('user_has_teams','ut',_0xf453('0x85'))[_0xf453('0x50')](_0xf453('0x86'),_0x1cc4ac[_0xf453('0x5c')]['id']);for(var _0x172b25=0x0;_0x172b25<_0x27385d[_0xf453('0x4b')];_0x172b25+=0x1){let _0x41a049=_0x27385d[_0x172b25];for(var _0x2d729f=0x0;_0x2d729f<_0x41a049[_0xf453('0x75')][_0xf453('0x4b')];_0x2d729f+=0x1){let _0x163459=_0x41a049[_0xf453('0x75')][_0x2d729f];var _0x5c7d6a=_0x406e6f[_0xf453('0x87')]();_0x5c7d6a[_0xf453('0x50')]('ut.UserId\x20=\x20?',_0x163459['id']);_0x1f3e8e[_0xf453('0x88')](db[_0xf453('0x89')][_0xf453('0x48')](_0x5c7d6a[_0xf453('0x8a')](),{'type':db['sequelize'][_0xf453('0x8b')][_0xf453('0x8c')]})[_0xf453('0x21')](function(_0x46158d){if(_0x46158d['length']===0x1){return _0x163459['id'];}else{var _0x338532=_[_0xf453('0x8d')](_['map'](_0x46158d,_0xf453('0x8e')),function(_0xb7f8f5){return _['includes'](_0x12f34c,_0xb7f8f5);});if(_0x338532){return _0x163459['id'];}}}));}}return BPromise[_0xf453('0x8f')](_0x1f3e8e)[_0xf453('0x21')](function(_0x5d1d4d){_0x263b13=_(_0x263b13)[_0xf453('0x90')](_0x5d1d4d)[_0xf453('0x91')]()[_0xf453('0x92')]();return db['ChatQueue'][_0xf453('0x5f')]({'where':{'id':_0x1cc4ac[_0xf453('0x5c')]['id']}})[_0xf453('0x21')](function(_0x358ac2){return db[_0xf453('0x89')][_0xf453('0x7a')](function(_0x2320b1){return _0x358ac2['removeTeams'](_0x1cc4ac[_0xf453('0x48')]['ids'],{'transaction':_0x2320b1})[_0xf453('0x21')](function(){if(!_['isEmpty'](_0x263b13)){return _0x358ac2[_0xf453('0x93')](_0x263b13,{'transaction':_0x2320b1});}})[_0xf453('0x21')](function(){_0x263b13[_0xf453('0x7e')](function(_0x3e8646){socket[_0xf453('0x7f')](_0xf453('0x94'),{'UserId':_0x3e8646,'ChatQueueId':_0x358ac2['id']});});});});});});})['then'](respondWithStatusCode(_0x3702f7,null))[_0xf453('0x2b')](handleError(_0x3702f7,null));};exports[_0xf453('0x95')]=function(_0x4708cf,_0x4dc14b,_0x3e5d4f){return db[_0xf453('0x42')][_0xf453('0x5f')]({'where':{'id':_0x4708cf[_0xf453('0x5c')]['id']}})[_0xf453('0x21')](handleEntityNotFound(_0x4dc14b,null))[_0xf453('0x21')](function(_0x380336){if(_0x380336){return _0x380336['addAgents'](_0x4708cf[_0xf453('0x61')][_0xf453('0x96')],_[_0xf453('0x97')](_0x4708cf['body'],[_0xf453('0x96'),'id'])||{})[_0xf453('0x98')](function(_0xda95cb){for(var _0x42ad51=0x0;_0x42ad51<_0x4708cf['body'][_0xf453('0x96')][_0xf453('0x4b')];_0x42ad51+=0x1){socket[_0xf453('0x7f')]('userChatQueue:save',{'UserId':Number(_0x4708cf[_0xf453('0x61')]['ids'][_0x42ad51]),'ChatQueueId':Number(_0x4708cf['params']['id'])});}return _0xda95cb;});}})[_0xf453('0x21')](respondWithResult(_0x4dc14b,null))[_0xf453('0x2b')](handleError(_0x4dc14b,null));};exports[_0xf453('0x93')]=function(_0x32ebf5,_0x1e2434,_0x19be79){return db['ChatQueue']['find']({'where':{'id':_0x32ebf5[_0xf453('0x5c')]['id']}})[_0xf453('0x21')](handleEntityNotFound(_0x1e2434,null))[_0xf453('0x21')](function(_0x5a4eea){if(_0x5a4eea){return _0x5a4eea[_0xf453('0x93')](_0x32ebf5[_0xf453('0x48')][_0xf453('0x96')])['then'](function(){if(_['isArray'](_0x32ebf5[_0xf453('0x48')]['ids'])){for(var _0x163a6c=0x0;_0x163a6c<_0x32ebf5[_0xf453('0x48')][_0xf453('0x96')][_0xf453('0x4b')];_0x163a6c+=0x1){socket[_0xf453('0x7f')](_0xf453('0x94'),{'UserId':Number(_0x32ebf5[_0xf453('0x48')][_0xf453('0x96')][_0x163a6c]),'ChatQueueId':Number(_0x32ebf5[_0xf453('0x5c')]['id'])});}}else{socket['emit'](_0xf453('0x94'),{'UserId':Number(_0x32ebf5['query'][_0xf453('0x96')]),'ChatQueueId':Number(_0x32ebf5['params']['id'])});}});}})[_0xf453('0x21')](respondWithStatusCode(_0x1e2434,null))[_0xf453('0x2b')](handleError(_0x1e2434,null));};exports[_0xf453('0x99')]=function(_0x40f408,_0x3298cc,_0x318aaf){var _0x474796={};var _0x1e88df={};var _0x231acf;var _0x4735d3;return db[_0xf453('0x42')]['findOne']({'where':{'id':_0x40f408[_0xf453('0x5c')]['id']}})[_0xf453('0x21')](handleEntityNotFound(_0x3298cc,null))['then'](function(_0xfd656b){if(_0xfd656b){_0x231acf=_0xfd656b;_0x1e88df[_0xf453('0x47')]=_[_0xf453('0x5d')](db['User'][_0xf453('0x43')]);_0x1e88df['query']=_[_0xf453('0x5d')](_0x40f408['query']);_0x1e88df[_0xf453('0x51')]=_[_0xf453('0x5e')](_0x1e88df[_0xf453('0x47')],_0x1e88df['query']);_0x474796['attributes']=_['intersection'](_0x1e88df['model'],qs[_0xf453('0x4a')](_0x40f408['query'][_0xf453('0x4a')]));_0x474796[_0xf453('0x49')]=_0x474796[_0xf453('0x49')]['length']?_0x474796[_0xf453('0x49')]:_0x1e88df['model'];_0x474796[_0xf453('0x4e')]=qs[_0xf453('0x4f')](_0x40f408[_0xf453('0x48')][_0xf453('0x4f')]);_0x474796[_0xf453('0x50')]=qs[_0xf453('0x51')](_['pick'](_0x40f408[_0xf453('0x48')],_0x1e88df[_0xf453('0x51')]));if(_0x40f408[_0xf453('0x48')][_0xf453('0x55')]){_0x474796['where']=_[_0xf453('0x53')](_0x474796['where'],{'$or':_[_0xf453('0x41')](_0x474796[_0xf453('0x49')],function(_0xbe8e97){var _0x201326={};_0x201326[_0xbe8e97]={'$like':'%'+_0x40f408['query']['filter']+'%'};return _0x201326;})});}_0x474796=_[_0xf453('0x53')]({},_0x474796,_0x40f408[_0xf453('0x56')]);return _0x231acf['getAgents'](_0x474796);}})['then'](function(_0x27eff1){if(_0x27eff1){_0x4735d3=_0x27eff1['length'];if(!_0x40f408['query'][_0xf453('0x4c')](_0xf453('0x4d'))){_0x474796['limit']=qs[_0xf453('0x30')](_0x40f408[_0xf453('0x48')]['limit']);_0x474796[_0xf453('0x2e')]=qs[_0xf453('0x2e')](_0x40f408[_0xf453('0x48')]['offset']);}return _0x231acf['getAgents'](_0x474796);}})[_0xf453('0x21')](function(_0x6f418a){if(_0x6f418a){return _0x6f418a?{'count':_0x4735d3,'rows':_0x6f418a}:null;}})[_0xf453('0x21')](respondWithResult(_0x3298cc,null))['catch'](handleError(_0x3298cc,null));};
\ No newline at end of file
+var _0xf377=['interface','sequelize','transaction','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','team_has_chat_queues','user_has_teams','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','includes','all','compact','removeAgents','userChatQueue:remove','addAgents','omit','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','undefined','count','offset','set','json','reject','update','ChatQueues','destroy','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserChatQueue','order','ChatQueueId','findAndCountAll','UserId','chatPause','updatedAt','createdAt','SIP','Team','getTeams','addTeams','ids','User','Agents','online','voicePause'];(function(_0x2e8b53,_0x52f25f){var _0x3194f6=function(_0x256977){while(--_0x256977){_0x2e8b53['push'](_0x2e8b53['shift']());}};_0x3194f6(++_0x52f25f);}(_0xf377,0xaa));var _0x7f37=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0xf377[_0x5416db];return _0x243e35;};'use strict';var emlformat=require(_0x7f37('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7f37('0x1'));var jsonpatch=require(_0x7f37('0x2'));var rp=require(_0x7f37('0x3'));var moment=require(_0x7f37('0x4'));var BPromise=require(_0x7f37('0x5'));var Mustache=require(_0x7f37('0x6'));var util=require(_0x7f37('0x7'));var path=require(_0x7f37('0x8'));var sox=require(_0x7f37('0x9'));var csv=require(_0x7f37('0xa'));var ejs=require(_0x7f37('0xb'));var fs=require('fs');var fs_extra=require(_0x7f37('0xc'));var _=require(_0x7f37('0xd'));var squel=require(_0x7f37('0xe'));var crypto=require(_0x7f37('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7f37('0xa'));var querystring=require(_0x7f37('0x10'));var Papa=require('papaparse');var Redis=require(_0x7f37('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7f37('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7f37('0x13'));var logger=require(_0x7f37('0x14'))(_0x7f37('0x15'));var utils=require(_0x7f37('0x16'));var config=require(_0x7f37('0x17'));var licenseUtil=require(_0x7f37('0x18'));var db=require('../../mysqldb')['db'];config[_0x7f37('0x19')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7f37('0x1a'))(new Redis(config[_0x7f37('0x19')]));require(_0x7f37('0x1b'))[_0x7f37('0x1c')](socket);var jayson=require(_0x7f37('0x1d'));var client=jayson[_0x7f37('0x1e')][_0x7f37('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x33bc17,_0x23d433,_0x3aa4e0,_0x6c0030){return new BPromise(function(_0x547ad0,_0x4a5310){var _0x423155=_0x6c0030||client;return _0x423155['request'](_0x33bc17,_0x3aa4e0)[_0x7f37('0x20')](function(_0x35a645){logger[_0x7f37('0x21')](_0x7f37('0x22'),_0x23d433,_0x7f37('0x23'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x23d433,_0x7f37('0x23'),JSON['stringify'](_0x35a645));if(_0x35a645[_0x7f37('0x24')]){if(_0x35a645[_0x7f37('0x24')][_0x7f37('0x25')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x23d433,_0x35a645[_0x7f37('0x24')]['message']);return _0x4a5310(_0x35a645[_0x7f37('0x24')]['message']);}logger['error'](_0x7f37('0x22'),_0x23d433,_0x35a645[_0x7f37('0x24')][_0x7f37('0x26')]);return _0x547ad0(_0x35a645[_0x7f37('0x24')][_0x7f37('0x26')]);}else{logger[_0x7f37('0x21')](_0x7f37('0x22'),_0x23d433,_0x7f37('0x23'));_0x547ad0(_0x35a645[_0x7f37('0x27')]['message']);}})[_0x7f37('0x28')](function(_0xe54f27){logger[_0x7f37('0x24')]('ChatQueue,\x20%s,\x20%s',_0x23d433,_0xe54f27);_0x4a5310(_0xe54f27);});});}function respondWithStatusCode(_0x31b578,_0x34d344){_0x34d344=_0x34d344||0xcc;return function(_0x518dee){if(_0x518dee){return _0x31b578[_0x7f37('0x29')](_0x34d344);}return _0x31b578[_0x7f37('0x2a')](_0x34d344)[_0x7f37('0x2b')]();};}function respondWithResult(_0x3eeabf,_0x3b3def){_0x3b3def=_0x3b3def||0xc8;return function(_0x48221a){if(_0x48221a){return _0x3eeabf[_0x7f37('0x2a')](_0x3b3def)['json'](_0x48221a);}};}function respondWithFilteredResult(_0x11c0ef,_0x3597cc){return function(_0x2822ce){if(_0x2822ce){var _0x224132=typeof _0x3597cc['offset']==='undefined'&&typeof _0x3597cc['limit']===_0x7f37('0x2c');var _0x456985=_0x2822ce[_0x7f37('0x2d')];var _0x282bc7=_0x224132?0x0:_0x3597cc[_0x7f37('0x2e')];var _0x10ead2=_0x224132?_0x2822ce['count']:_0x3597cc['offset']+_0x3597cc['limit'];var _0x2084bb;if(_0x10ead2>=_0x456985){_0x10ead2=_0x456985;_0x2084bb=0xc8;}else{_0x2084bb=0xce;}_0x11c0ef[_0x7f37('0x2a')](_0x2084bb);return _0x11c0ef[_0x7f37('0x2f')]('Content-Range',_0x282bc7+'-'+_0x10ead2+'/'+_0x456985)[_0x7f37('0x30')](_0x2822ce);}return null;};}function patchUpdates(_0x5552a7){return function(_0x5560a6){try{jsonpatch['apply'](_0x5560a6,_0x5552a7,!![]);}catch(_0x465561){return BPromise[_0x7f37('0x31')](_0x465561);}return _0x5560a6['save']();};}function saveUpdates(_0x294dd6,_0x606bf7){return function(_0x2ab5a2){if(_0x2ab5a2){return _0x2ab5a2[_0x7f37('0x32')](_0x294dd6)['then'](function(_0x122c0f){return _0x122c0f;});}return null;};}function removeEntity(_0x16b961,_0x1c4b3f){return function(_0x93de9c){if(_0x93de9c){return _0x93de9c['destroy']()['then'](function(){var _0x13aaab=_0x93de9c['get']({'plain':!![]});var _0xee7281=_0x7f37('0x33');return db['UserProfileResource'][_0x7f37('0x34')]({'where':{'type':_0xee7281,'resourceId':_0x13aaab['id']}})[_0x7f37('0x20')](function(){return _0x93de9c;});})['then'](function(){_0x16b961['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xf388b1,_0x5c0be3){return function(_0x27551b){if(!_0x27551b){_0xf388b1[_0x7f37('0x29')](0x194);}return _0x27551b;};}function handleError(_0x22d981,_0x2ff868){_0x2ff868=_0x2ff868||0x1f4;return function(_0x5c10d4){logger[_0x7f37('0x24')](_0x5c10d4[_0x7f37('0x35')]);if(_0x5c10d4[_0x7f37('0x36')]){delete _0x5c10d4[_0x7f37('0x36')];}_0x22d981[_0x7f37('0x2a')](_0x2ff868)[_0x7f37('0x37')](_0x5c10d4);};}exports[_0x7f37('0x38')]=function(_0x44077d,_0x11bc99){var _0xe5face={},_0x41c636={},_0x95c5ff={'count':0x0,'rows':[]};var _0x2781af=_[_0x7f37('0x39')](db[_0x7f37('0x3a')][_0x7f37('0x3b')],function(_0x47b78a){return{'name':_0x47b78a[_0x7f37('0x3c')],'type':_0x47b78a[_0x7f37('0x3d')][_0x7f37('0x3e')]};});_0x41c636[_0x7f37('0x3f')]=_[_0x7f37('0x39')](_0x2781af,_0x7f37('0x36'));_0x41c636['query']=_[_0x7f37('0x40')](_0x44077d[_0x7f37('0x41')]);_0x41c636[_0x7f37('0x42')]=_['intersection'](_0x41c636[_0x7f37('0x3f')],_0x41c636[_0x7f37('0x41')]);_0xe5face[_0x7f37('0x43')]=_[_0x7f37('0x44')](_0x41c636['model'],qs[_0x7f37('0x45')](_0x44077d[_0x7f37('0x41')][_0x7f37('0x45')]));_0xe5face[_0x7f37('0x43')]=_0xe5face['attributes'][_0x7f37('0x46')]?_0xe5face[_0x7f37('0x43')]:_0x41c636[_0x7f37('0x3f')];if(!_0x44077d[_0x7f37('0x41')][_0x7f37('0x47')](_0x7f37('0x48'))){_0xe5face[_0x7f37('0x49')]=qs['limit'](_0x44077d[_0x7f37('0x41')][_0x7f37('0x49')]);_0xe5face['offset']=qs[_0x7f37('0x2e')](_0x44077d['query'][_0x7f37('0x2e')]);}_0xe5face['order']=qs[_0x7f37('0x4a')](_0x44077d[_0x7f37('0x41')][_0x7f37('0x4a')]);_0xe5face[_0x7f37('0x4b')]=qs['filters'](_[_0x7f37('0x4c')](_0x44077d[_0x7f37('0x41')],_0x41c636['filters']),_0x2781af);if(_0x44077d['query'][_0x7f37('0x4d')]){_0xe5face[_0x7f37('0x4b')]=_['merge'](_0xe5face[_0x7f37('0x4b')],{'$or':_[_0x7f37('0x39')](_0x2781af,function(_0x570017){if(_0x570017['type']!==_0x7f37('0x4e')){var _0x50d59e={};_0x50d59e[_0x570017[_0x7f37('0x36')]]={'$like':'%'+_0x44077d[_0x7f37('0x41')][_0x7f37('0x4d')]+'%'};return _0x50d59e;}})});}_0xe5face=_[_0x7f37('0x4f')]({},_0xe5face,_0x44077d[_0x7f37('0x50')]);var _0x3e8520={'where':_0xe5face['where']};return db[_0x7f37('0x3a')][_0x7f37('0x2d')](_0x3e8520)[_0x7f37('0x20')](function(_0x7dea97){_0x95c5ff[_0x7f37('0x2d')]=_0x7dea97;if(_0x44077d[_0x7f37('0x41')][_0x7f37('0x51')]){_0xe5face[_0x7f37('0x52')]=[{'all':!![]}];}return db[_0x7f37('0x3a')][_0x7f37('0x53')](_0xe5face);})[_0x7f37('0x20')](function(_0x3c9de1){_0x95c5ff[_0x7f37('0x54')]=_0x3c9de1;return _0x95c5ff;})[_0x7f37('0x20')](respondWithFilteredResult(_0x11bc99,_0xe5face))[_0x7f37('0x28')](handleError(_0x11bc99,null));};exports['show']=function(_0x395d1b,_0x1c584f){var _0xf3779f={'raw':!![],'where':{'id':_0x395d1b[_0x7f37('0x55')]['id']}},_0x2fdeea={};_0x2fdeea[_0x7f37('0x3f')]=_[_0x7f37('0x40')](db['ChatQueue'][_0x7f37('0x3b')]);_0x2fdeea[_0x7f37('0x41')]=_[_0x7f37('0x40')](_0x395d1b['query']);_0x2fdeea[_0x7f37('0x42')]=_[_0x7f37('0x44')](_0x2fdeea[_0x7f37('0x3f')],_0x2fdeea[_0x7f37('0x41')]);_0xf3779f['attributes']=_[_0x7f37('0x44')](_0x2fdeea[_0x7f37('0x3f')],qs[_0x7f37('0x45')](_0x395d1b[_0x7f37('0x41')][_0x7f37('0x45')]));_0xf3779f['attributes']=_0xf3779f['attributes']['length']?_0xf3779f[_0x7f37('0x43')]:_0x2fdeea[_0x7f37('0x3f')];if(_0x395d1b['query'][_0x7f37('0x51')]){_0xf3779f[_0x7f37('0x52')]=[{'all':!![]}];}_0xf3779f=_[_0x7f37('0x4f')]({},_0xf3779f,_0x395d1b[_0x7f37('0x50')]);return db[_0x7f37('0x3a')][_0x7f37('0x56')](_0xf3779f)[_0x7f37('0x20')](handleEntityNotFound(_0x1c584f,null))[_0x7f37('0x20')](respondWithResult(_0x1c584f,null))[_0x7f37('0x28')](handleError(_0x1c584f,null));};exports['create']=function(_0x4a68b7,_0x35dac7){return db[_0x7f37('0x3a')][_0x7f37('0x57')](_0x4a68b7[_0x7f37('0x58')],{})[_0x7f37('0x20')](function(_0x2c54e3){var _0x213598=_0x4a68b7['user'][_0x7f37('0x59')]({'plain':!![]});if(!_0x213598)throw new Error(_0x7f37('0x5a'));if(_0x213598[_0x7f37('0x5b')]===_0x7f37('0x5c')){var _0x1bab22=_0x2c54e3['get']({'plain':!![]});var _0x1b9398=_0x7f37('0x33');return db['UserProfileSection'][_0x7f37('0x56')]({'where':{'name':_0x1b9398,'userProfileId':_0x213598[_0x7f37('0x5d')]},'raw':!![]})['then'](function(_0x2bba91){if(_0x2bba91&&_0x2bba91[_0x7f37('0x5e')]===0x0){return db[_0x7f37('0x5f')][_0x7f37('0x57')]({'name':_0x1bab22[_0x7f37('0x36')],'resourceId':_0x1bab22['id'],'type':_0x2bba91[_0x7f37('0x36')],'sectionId':_0x2bba91['id']},{})[_0x7f37('0x20')](function(){return _0x2c54e3;});}else{return _0x2c54e3;}})['catch'](function(_0x4c1880){logger[_0x7f37('0x24')](_0x7f37('0x60'),_0x4c1880);throw _0x4c1880;});}return _0x2c54e3;})[_0x7f37('0x20')](respondWithResult(_0x35dac7,0xc9))[_0x7f37('0x28')](handleError(_0x35dac7,null));};exports[_0x7f37('0x32')]=function(_0x329463,_0x1adce1){if(_0x329463['body']['id']){delete _0x329463['body']['id'];}return db[_0x7f37('0x3a')][_0x7f37('0x56')]({'where':{'id':_0x329463[_0x7f37('0x55')]['id']}})[_0x7f37('0x20')](handleEntityNotFound(_0x1adce1,null))[_0x7f37('0x20')](saveUpdates(_0x329463[_0x7f37('0x58')],null))['then'](respondWithResult(_0x1adce1,null))[_0x7f37('0x28')](handleError(_0x1adce1,null));};exports[_0x7f37('0x34')]=function(_0x4620fa,_0x1e114d){return db[_0x7f37('0x3a')]['find']({'where':{'id':_0x4620fa[_0x7f37('0x55')]['id']}})['then'](handleEntityNotFound(_0x1e114d,null))[_0x7f37('0x20')](removeEntity(_0x1e114d,null))[_0x7f37('0x28')](handleError(_0x1e114d,null));};exports[_0x7f37('0x61')]=function(_0x387b84,_0x56e67c){return db['ChatQueue'][_0x7f37('0x61')]()['then'](respondWithResult(_0x56e67c,null))[_0x7f37('0x28')](handleError(_0x56e67c,null));};exports['getMembers']=function(_0x31dbf7,_0x5d476e,_0x33101b){var _0x3c1057={'raw':!![],'where':{}},_0x4ad849={},_0x22a17b;return db[_0x7f37('0x3a')][_0x7f37('0x62')]({'where':{'id':_0x31dbf7[_0x7f37('0x55')]['id']}})[_0x7f37('0x20')](handleEntityNotFound(_0x5d476e,null))['then'](function(_0x2b60c5){if(_0x2b60c5){_0x22a17b=_0x2b60c5[_0x7f37('0x59')]({'plain':!![]});_0x4ad849[_0x7f37('0x3f')]=_[_0x7f37('0x40')](db[_0x7f37('0x63')]['rawAttributes']);_0x4ad849[_0x7f37('0x41')]=_['keys'](_0x31dbf7[_0x7f37('0x41')]);_0x4ad849['filters']=_[_0x7f37('0x44')](_0x4ad849[_0x7f37('0x3f')],_0x4ad849[_0x7f37('0x41')]);_0x3c1057['attributes']=_['intersection'](_0x4ad849[_0x7f37('0x3f')],qs['fields'](_0x31dbf7['query'][_0x7f37('0x45')]));_0x3c1057[_0x7f37('0x43')]=_0x3c1057[_0x7f37('0x43')][_0x7f37('0x46')]?_0x3c1057[_0x7f37('0x43')]:_0x4ad849[_0x7f37('0x3f')];if(!_0x31dbf7['query'][_0x7f37('0x47')](_0x7f37('0x48'))){_0x3c1057[_0x7f37('0x49')]=qs[_0x7f37('0x49')](_0x31dbf7[_0x7f37('0x41')]['limit']);_0x3c1057['offset']=qs[_0x7f37('0x2e')](_0x31dbf7[_0x7f37('0x41')]['offset']);}_0x3c1057[_0x7f37('0x64')]=qs[_0x7f37('0x4a')](_0x31dbf7['query'][_0x7f37('0x4a')]);_0x3c1057[_0x7f37('0x4b')]=qs['filters'](_[_0x7f37('0x4c')](_0x31dbf7[_0x7f37('0x41')],_0x4ad849[_0x7f37('0x42')]));_0x3c1057['where'][_0x7f37('0x65')]=_0x2b60c5['id'];if(_0x31dbf7['query'][_0x7f37('0x4d')]){_0x3c1057[_0x7f37('0x4b')]=_['merge'](_0x3c1057[_0x7f37('0x4b')],{'$or':_[_0x7f37('0x39')](_0x3c1057['attributes'],function(_0x5ebc94){var _0x53dc2f={};_0x53dc2f[_0x5ebc94]={'$like':'%'+_0x31dbf7[_0x7f37('0x41')][_0x7f37('0x4d')]+'%'};return _0x53dc2f;})});}_0x3c1057=_[_0x7f37('0x4f')]({},_0x3c1057,_0x31dbf7[_0x7f37('0x50')]);return db[_0x7f37('0x63')][_0x7f37('0x53')](_0x3c1057);}})['then'](function(_0x548077){if(_0x548077){return db['User'][_0x7f37('0x66')]({'where':{'id':_['map'](_0x548077,_0x7f37('0x67')),'role':'agent'},'attributes':['id',_0x7f37('0x36'),_0x7f37('0x68'),_0x7f37('0x69'),_0x7f37('0x6a')]});}})['then'](function(_0x27152f){if(_0x27152f){return{'count':_0x27152f[_0x7f37('0x2d')],'rows':_[_0x7f37('0x39')](_0x27152f[_0x7f37('0x54')],function(_0x515f7d){return{'membername':_0x515f7d['name'],'UserId':_0x515f7d['id'],'queue_name':_0x22a17b[_0x7f37('0x36')],'ChatQueueId':_0x22a17b['id'],'interface':util['format']('%s/%s',_0x7f37('0x6b'),_0x515f7d[_0x7f37('0x36')]),'penalty':0x0,'paused':_0x515f7d[_0x7f37('0x68')],'createdAt':_0x515f7d['createdAt'],'updatedAt':_0x515f7d['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x7f37('0x20')](respondWithFilteredResult(_0x5d476e,_0x3c1057))['catch'](handleError(_0x5d476e,null));};exports['getTeams']=function(_0x108dfa,_0x3b5dbb,_0x3a4327){var _0x283a04={};var _0x18de91={};var _0x2e4db3;var _0x33951e;return db[_0x7f37('0x3a')]['findOne']({'where':{'id':_0x108dfa[_0x7f37('0x55')]['id']}})[_0x7f37('0x20')](handleEntityNotFound(_0x3b5dbb,null))[_0x7f37('0x20')](function(_0x1ac5cd){if(_0x1ac5cd){_0x2e4db3=_0x1ac5cd;_0x18de91['model']=_[_0x7f37('0x40')](db[_0x7f37('0x6c')][_0x7f37('0x3b')]);_0x18de91[_0x7f37('0x41')]=_[_0x7f37('0x40')](_0x108dfa['query']);_0x18de91[_0x7f37('0x42')]=_[_0x7f37('0x44')](_0x18de91['model'],_0x18de91[_0x7f37('0x41')]);_0x283a04[_0x7f37('0x43')]=_['intersection'](_0x18de91[_0x7f37('0x3f')],qs[_0x7f37('0x45')](_0x108dfa[_0x7f37('0x41')]['fields']));_0x283a04[_0x7f37('0x43')]=_0x283a04['attributes'][_0x7f37('0x46')]?_0x283a04['attributes']:_0x18de91[_0x7f37('0x3f')];_0x283a04[_0x7f37('0x64')]=qs[_0x7f37('0x4a')](_0x108dfa['query'][_0x7f37('0x4a')]);_0x283a04[_0x7f37('0x4b')]=qs[_0x7f37('0x42')](_['pick'](_0x108dfa[_0x7f37('0x41')],_0x18de91[_0x7f37('0x42')]));if(_0x108dfa[_0x7f37('0x41')][_0x7f37('0x4d')]){_0x283a04[_0x7f37('0x4b')]=_[_0x7f37('0x4f')](_0x283a04[_0x7f37('0x4b')],{'$or':_[_0x7f37('0x39')](_0x283a04['attributes'],function(_0xe48ebc){var _0x228b72={};_0x228b72[_0xe48ebc]={'$like':'%'+_0x108dfa['query']['filter']+'%'};return _0x228b72;})});}_0x283a04=_['merge']({},_0x283a04,_0x108dfa['options']);return _0x2e4db3['getTeams'](_0x283a04);}})[_0x7f37('0x20')](function(_0x325e49){if(_0x325e49){_0x33951e=_0x325e49[_0x7f37('0x46')];if(!_0x108dfa[_0x7f37('0x41')][_0x7f37('0x47')]('nolimit')){_0x283a04[_0x7f37('0x49')]=qs[_0x7f37('0x49')](_0x108dfa['query'][_0x7f37('0x49')]);_0x283a04[_0x7f37('0x2e')]=qs[_0x7f37('0x2e')](_0x108dfa['query'][_0x7f37('0x2e')]);}return _0x2e4db3[_0x7f37('0x6d')](_0x283a04);}})[_0x7f37('0x20')](function(_0x8e8e05){if(_0x8e8e05){return _0x8e8e05?{'count':_0x33951e,'rows':_0x8e8e05}:null;}})['then'](respondWithResult(_0x3b5dbb,null))[_0x7f37('0x28')](handleError(_0x3b5dbb,null));};exports[_0x7f37('0x6e')]=function(_0x21775e,_0x1ded50,_0x6b5eca){var _0x49f572=_0x21775e[_0x7f37('0x58')][_0x7f37('0x6f')];return db[_0x7f37('0x6c')][_0x7f37('0x53')]({'where':{'id':_0x49f572},'attributes':['id'],'include':[{'model':db[_0x7f37('0x70')],'as':_0x7f37('0x71'),'attributes':['id',_0x7f37('0x36'),_0x7f37('0x72'),_0x7f37('0x73'),_0x7f37('0x74')],'raw':!![]}]})['then'](function(_0x4d6b88){if(_0x4d6b88){var _0x55b843=_['flatMap'](_0x4d6b88,function(_0x4d45b2){var _0x4d81ce=_0x4d45b2[_0x7f37('0x59')]({'plain':!![]});return _0x4d81ce['Agents'];});return db[_0x7f37('0x3a')][_0x7f37('0x56')]({'where':{'id':_0x21775e['params']['id']}})[_0x7f37('0x20')](function(_0x3698ee){return db[_0x7f37('0x75')][_0x7f37('0x76')](function(_0x284c73){return _0x3698ee[_0x7f37('0x6e')](_0x49f572,{'transaction':_0x284c73})[_0x7f37('0x20')](function(){return BPromise['each'](_0x55b843,function(_0x472bd4){return db[_0x7f37('0x63')]['findOrCreate']({'where':{'UserId':_0x472bd4['id'],'ChatQueueId':_0x21775e[_0x7f37('0x55')]['id']},'transaction':_0x284c73});});})['then'](function(){_0x55b843[_0x7f37('0x77')](function(_0x24e14f){socket[_0x7f37('0x78')](_0x7f37('0x79'),{'UserId':_0x24e14f['id'],'ChatQueueId':_0x3698ee['id']});});});});});}})[_0x7f37('0x20')](respondWithStatusCode(_0x1ded50,null))[_0x7f37('0x28')](handleError(_0x1ded50,null));};exports[_0x7f37('0x7a')]=function(_0x3ae460,_0x19e44f,_0x212788){return db['Team'][_0x7f37('0x53')]({'where':{'id':_0x3ae460[_0x7f37('0x41')]['ids']},'attributes':['id'],'include':[{'model':db[_0x7f37('0x70')],'as':_0x7f37('0x71'),'attributes':['id'],'raw':!![]}]})[_0x7f37('0x20')](handleEntityNotFound(_0x19e44f,null))['then'](function(_0x12c96e){var _0x21477b=_[_0x7f37('0x39')](_0x12c96e,'id');var _0x478252=[];var _0x489303=[];var _0x1324d9=squel[_0x7f37('0x7b')]();_0x1324d9[_0x7f37('0x7c')](_0x7f37('0x7d'))['from'](_0x7f37('0x7e'),'tq')['join'](_0x7f37('0x7f'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x7f37('0x4b')]('ChatQueueId\x20=\x20?',_0x3ae460['params']['id']);for(var _0x17e4e8=0x0;_0x17e4e8<_0x12c96e['length'];_0x17e4e8+=0x1){let _0x2fb8a0=_0x12c96e[_0x17e4e8];for(var _0x2dee4c=0x0;_0x2dee4c<_0x2fb8a0[_0x7f37('0x71')]['length'];_0x2dee4c+=0x1){let _0x3fd537=_0x2fb8a0[_0x7f37('0x71')][_0x2dee4c];var _0x8014e9=_0x1324d9[_0x7f37('0x80')]();_0x8014e9['where'](_0x7f37('0x81'),_0x3fd537['id']);_0x489303[_0x7f37('0x82')](db[_0x7f37('0x75')]['query'](_0x8014e9['toString'](),{'type':db[_0x7f37('0x75')][_0x7f37('0x83')][_0x7f37('0x84')]})['then'](function(_0x377420){if(_0x377420['length']===0x1){return _0x3fd537['id'];}else{var _0x5d194e=_[_0x7f37('0x85')](_['map'](_0x377420,'TeamId'),function(_0x33da49){return _[_0x7f37('0x86')](_0x21477b,_0x33da49);});if(_0x5d194e){return _0x3fd537['id'];}}}));}}return BPromise[_0x7f37('0x87')](_0x489303)[_0x7f37('0x20')](function(_0x4e2ce0){_0x478252=_(_0x478252)['union'](_0x4e2ce0)[_0x7f37('0x88')]()['value']();return db[_0x7f37('0x3a')][_0x7f37('0x56')]({'where':{'id':_0x3ae460['params']['id']}})[_0x7f37('0x20')](function(_0x116bd1){return db[_0x7f37('0x75')]['transaction'](function(_0x58abc2){return _0x116bd1['removeTeams'](_0x3ae460[_0x7f37('0x41')]['ids'],{'transaction':_0x58abc2})[_0x7f37('0x20')](function(){if(!_['isEmpty'](_0x478252)){return _0x116bd1[_0x7f37('0x89')](_0x478252,{'transaction':_0x58abc2});}})[_0x7f37('0x20')](function(){_0x478252['forEach'](function(_0x57d337){socket[_0x7f37('0x78')](_0x7f37('0x8a'),{'UserId':_0x57d337,'ChatQueueId':_0x116bd1['id']});});});});});});})[_0x7f37('0x20')](respondWithStatusCode(_0x19e44f,null))[_0x7f37('0x28')](handleError(_0x19e44f,null));};exports[_0x7f37('0x8b')]=function(_0x595d54,_0x28aace,_0x3f421f){return db[_0x7f37('0x3a')]['find']({'where':{'id':_0x595d54[_0x7f37('0x55')]['id']}})['then'](handleEntityNotFound(_0x28aace,null))[_0x7f37('0x20')](function(_0x229aab){if(_0x229aab){return _0x229aab[_0x7f37('0x8b')](_0x595d54[_0x7f37('0x58')][_0x7f37('0x6f')],_[_0x7f37('0x8c')](_0x595d54[_0x7f37('0x58')],[_0x7f37('0x6f'),'id'])||{})['spread'](function(_0x15a827){for(var _0x21d71b=0x0;_0x21d71b<_0x595d54[_0x7f37('0x58')][_0x7f37('0x6f')][_0x7f37('0x46')];_0x21d71b+=0x1){socket[_0x7f37('0x78')](_0x7f37('0x79'),{'UserId':Number(_0x595d54[_0x7f37('0x58')]['ids'][_0x21d71b]),'ChatQueueId':Number(_0x595d54['params']['id'])});}return _0x15a827;});}})[_0x7f37('0x20')](respondWithResult(_0x28aace,null))[_0x7f37('0x28')](handleError(_0x28aace,null));};exports['removeAgents']=function(_0xce0528,_0x32e5b2,_0x2aff33){return db['ChatQueue'][_0x7f37('0x56')]({'where':{'id':_0xce0528[_0x7f37('0x55')]['id']}})[_0x7f37('0x20')](handleEntityNotFound(_0x32e5b2,null))[_0x7f37('0x20')](function(_0x1368fa){if(_0x1368fa){return _0x1368fa[_0x7f37('0x89')](_0xce0528[_0x7f37('0x41')]['ids'])['then'](function(){if(_[_0x7f37('0x8d')](_0xce0528[_0x7f37('0x41')][_0x7f37('0x6f')])){for(var _0x530ea6=0x0;_0x530ea6<_0xce0528[_0x7f37('0x41')]['ids']['length'];_0x530ea6+=0x1){socket[_0x7f37('0x78')](_0x7f37('0x8a'),{'UserId':Number(_0xce0528['query'][_0x7f37('0x6f')][_0x530ea6]),'ChatQueueId':Number(_0xce0528[_0x7f37('0x55')]['id'])});}}else{socket['emit'](_0x7f37('0x8a'),{'UserId':Number(_0xce0528[_0x7f37('0x41')][_0x7f37('0x6f')]),'ChatQueueId':Number(_0xce0528[_0x7f37('0x55')]['id'])});}});}})[_0x7f37('0x20')](respondWithStatusCode(_0x32e5b2,null))[_0x7f37('0x28')](handleError(_0x32e5b2,null));};exports['getAgents']=function(_0x3dd6de,_0x42bbbf,_0x52bcb8){var _0x82034e={};var _0x361875={};var _0x4d20a1;var _0x25dac6;return db[_0x7f37('0x3a')][_0x7f37('0x62')]({'where':{'id':_0x3dd6de[_0x7f37('0x55')]['id']}})[_0x7f37('0x20')](handleEntityNotFound(_0x42bbbf,null))[_0x7f37('0x20')](function(_0x1d5ea1){if(_0x1d5ea1){_0x4d20a1=_0x1d5ea1;_0x361875[_0x7f37('0x3f')]=_[_0x7f37('0x40')](db[_0x7f37('0x70')]['rawAttributes']);_0x361875['query']=_[_0x7f37('0x40')](_0x3dd6de['query']);_0x361875[_0x7f37('0x42')]=_[_0x7f37('0x44')](_0x361875[_0x7f37('0x3f')],_0x361875[_0x7f37('0x41')]);_0x82034e[_0x7f37('0x43')]=_[_0x7f37('0x44')](_0x361875[_0x7f37('0x3f')],qs[_0x7f37('0x45')](_0x3dd6de[_0x7f37('0x41')][_0x7f37('0x45')]));_0x82034e[_0x7f37('0x43')]=_0x82034e[_0x7f37('0x43')]['length']?_0x82034e[_0x7f37('0x43')]:_0x361875['model'];_0x82034e[_0x7f37('0x64')]=qs[_0x7f37('0x4a')](_0x3dd6de['query'][_0x7f37('0x4a')]);_0x82034e[_0x7f37('0x4b')]=qs[_0x7f37('0x42')](_[_0x7f37('0x4c')](_0x3dd6de[_0x7f37('0x41')],_0x361875[_0x7f37('0x42')]));if(_0x3dd6de[_0x7f37('0x41')][_0x7f37('0x4d')]){_0x82034e['where']=_[_0x7f37('0x4f')](_0x82034e[_0x7f37('0x4b')],{'$or':_[_0x7f37('0x39')](_0x82034e[_0x7f37('0x43')],function(_0x439950){var _0x12d4c0={};_0x12d4c0[_0x439950]={'$like':'%'+_0x3dd6de['query'][_0x7f37('0x4d')]+'%'};return _0x12d4c0;})});}_0x82034e=_[_0x7f37('0x4f')]({},_0x82034e,_0x3dd6de[_0x7f37('0x50')]);return _0x4d20a1[_0x7f37('0x8e')](_0x82034e);}})[_0x7f37('0x20')](function(_0x343039){if(_0x343039){_0x25dac6=_0x343039[_0x7f37('0x46')];if(!_0x3dd6de['query'][_0x7f37('0x47')](_0x7f37('0x48'))){_0x82034e[_0x7f37('0x49')]=qs[_0x7f37('0x49')](_0x3dd6de[_0x7f37('0x41')][_0x7f37('0x49')]);_0x82034e['offset']=qs[_0x7f37('0x2e')](_0x3dd6de[_0x7f37('0x41')][_0x7f37('0x2e')]);}return _0x4d20a1[_0x7f37('0x8e')](_0x82034e);}})['then'](function(_0x390466){if(_0x390466){return _0x390466?{'count':_0x25dac6,'rows':_0x390466}:null;}})[_0x7f37('0x20')](respondWithResult(_0x42bbbf,null))[_0x7f37('0x28')](handleError(_0x42bbbf,null));};
\ No newline at end of file
index 7c759f8..3808a45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7aaf=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','remove'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x7aaf,0x1dc));var _0xf7aa=function(_0x3b30ec,_0x451311){_0x3b30ec=_0x3b30ec-0x0;var _0x4130e=_0x7aaf[_0x3b30ec];return _0x4130e;};'use strict';var EventEmitter=require(_0xf7aa('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf7aa('0x1')](0x0);var events={'afterCreate':_0xf7aa('0x2'),'afterUpdate':'update','afterDestroy':_0xf7aa('0x3')};function emitEvent(_0x3918a0){return function(_0x122c4a,_0x81d283,_0x21482c){ChatQueueEvents[_0xf7aa('0x4')](_0x3918a0+':'+_0x122c4a['id'],_0x122c4a);ChatQueueEvents['emit'](_0x3918a0,_0x122c4a);_0x21482c(null);};}for(var e in events){if(events[_0xf7aa('0x5')](e)){var event=events[e];ChatQueue[_0xf7aa('0x6')](e,emitEvent(event));}}module[_0xf7aa('0x7')]=ChatQueueEvents;
\ No newline at end of file
+var _0xe7f9=['emit','hasOwnProperty','hook','exports','../../mysqldb','ChatQueue','setMaxListeners','save','remove'];(function(_0x70fd53,_0x2a95a6){var _0x4b71c5=function(_0x4b349d){while(--_0x4b349d){_0x70fd53['push'](_0x70fd53['shift']());}};_0x4b71c5(++_0x2a95a6);}(_0xe7f9,0x124));var _0x9e7f=function(_0x4733d3,_0x454290){_0x4733d3=_0x4733d3-0x0;var _0x1b9a44=_0xe7f9[_0x4733d3];return _0x1b9a44;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x9e7f('0x0'))['db'][_0x9e7f('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x9e7f('0x2')](0x0);var events={'afterCreate':_0x9e7f('0x3'),'afterUpdate':'update','afterDestroy':_0x9e7f('0x4')};function emitEvent(_0x4d5d7a){return function(_0x52fc82,_0x275e1b,_0x210566){ChatQueueEvents['emit'](_0x4d5d7a+':'+_0x52fc82['id'],_0x52fc82);ChatQueueEvents[_0x9e7f('0x5')](_0x4d5d7a,_0x52fc82);_0x210566(null);};}for(var e in events){if(events[_0x9e7f('0x6')](e)){var event=events[e];ChatQueue[_0x9e7f('0x7')](e,emitEvent(event));}}module[_0x9e7f('0x8')]=ChatQueueEvents;
\ No newline at end of file
index 7561f65..4470c8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14dd=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./chatQueue.attributes','exports','define','chat_queues','lodash','util'];(function(_0x469f66,_0x2daba6){var _0x442f79=function(_0x320cc7){while(--_0x320cc7){_0x469f66['push'](_0x469f66['shift']());}};_0x442f79(++_0x2daba6);}(_0x14dd,0x172));var _0xd14d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x14dd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd14d('0x0'));var util=require(_0xd14d('0x1'));var logger=require(_0xd14d('0x2'))(_0xd14d('0x3'));var moment=require('moment');var BPromise=require(_0xd14d('0x4'));var rp=require(_0xd14d('0x5'));var fs=require('fs');var path=require(_0xd14d('0x6'));var rimraf=require('rimraf');var config=require(_0xd14d('0x7'));var attributes=require(_0xd14d('0x8'));module[_0xd14d('0x9')]=function(_0x4d4436,_0x12fb59){return _0x4d4436[_0xd14d('0xa')]('ChatQueue',attributes,{'tableName':_0xd14d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9817=['exports','define','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x44989e,_0x4deafe){var _0xf67dab=function(_0xf142e5){while(--_0xf142e5){_0x44989e['push'](_0x44989e['shift']());}};_0xf67dab(++_0x4deafe);}(_0x9817,0xf5));var _0x7981=function(_0xa128a2,_0x1b4283){_0xa128a2=_0xa128a2-0x0;var _0x50492b=_0x9817[_0xa128a2];return _0x50492b;};'use strict';var _=require(_0x7981('0x0'));var util=require('util');var logger=require(_0x7981('0x1'))(_0x7981('0x2'));var moment=require(_0x7981('0x3'));var BPromise=require(_0x7981('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7981('0x5'));var config=require(_0x7981('0x6'));var attributes=require('./chatQueue.attributes');module[_0x7981('0x7')]=function(_0xc75acd,_0x4ac030){return _0xc75acd[_0x7981('0x8')]('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f1d7fe3..bf944ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1aab=['../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetChatQueue','findAll','options','raw','where','attributes','include','map','model','ShowChatQueue','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x28ea86,_0x7402c6){var _0x25a519=function(_0x5edafb){while(--_0x5edafb){_0x28ea86['push'](_0x28ea86['shift']());}};_0x25a519(++_0x7402c6);}(_0x1aab,0x122));var _0xb1aa=function(_0x56f75c,_0x32b053){_0x56f75c=_0x56f75c-0x0;var _0x34ba47=_0x1aab[_0x56f75c];return _0x34ba47;};'use strict';var _=require(_0xb1aa('0x0'));var util=require(_0xb1aa('0x1'));var moment=require(_0xb1aa('0x2'));var BPromise=require('bluebird');var rs=require(_0xb1aa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb1aa('0x4'))['db'];var utils=require(_0xb1aa('0x5'));var logger=require(_0xb1aa('0x6'))(_0xb1aa('0x7'));var config=require(_0xb1aa('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb1aa('0x9')]({'port':0x232a});config[_0xb1aa('0xa')]=_[_0xb1aa('0xb')](config[_0xb1aa('0xa')],{'host':_0xb1aa('0xc'),'port':0x18eb});var socket=require(_0xb1aa('0xd'))(new Redis(config[_0xb1aa('0xa')]));require('./chatQueue.socket')[_0xb1aa('0xe')](socket);function respondWithRpcPromise(_0x3ad2cf,_0x4ecea1,_0x16af92){return new BPromise(function(_0x14f02f,_0x7525e6){return client[_0xb1aa('0xf')](_0x3ad2cf,_0x16af92)[_0xb1aa('0x10')](function(_0x317da5){logger[_0xb1aa('0x11')](_0xb1aa('0x12'),_0x4ecea1,_0xb1aa('0x13'));logger[_0xb1aa('0x14')](_0xb1aa('0x15'),_0x4ecea1,_0xb1aa('0x13'),JSON[_0xb1aa('0x16')](_0x317da5));if(_0x317da5[_0xb1aa('0x17')]){if(_0x317da5[_0xb1aa('0x17')]['code']===0x1f4){logger['error'](_0xb1aa('0x12'),_0x4ecea1,_0x317da5['error'][_0xb1aa('0x18')]);return _0x7525e6(_0x317da5['error'][_0xb1aa('0x18')]);}logger['error'](_0xb1aa('0x12'),_0x4ecea1,_0x317da5['error'][_0xb1aa('0x18')]);return _0x14f02f(_0x317da5[_0xb1aa('0x17')]['message']);}else{logger[_0xb1aa('0x11')](_0xb1aa('0x12'),_0x4ecea1,_0xb1aa('0x13'));_0x14f02f(_0x317da5[_0xb1aa('0x19')][_0xb1aa('0x18')]);}})[_0xb1aa('0x1a')](function(_0x40c985){logger[_0xb1aa('0x17')](_0xb1aa('0x12'),_0x4ecea1,_0x40c985);_0x7525e6(_0x40c985);});});}exports[_0xb1aa('0x1b')]=function(_0x142c6d){var _0x346858=this;return new Promise(function(_0x452e6b,_0x5ca191){return db['ChatQueue'][_0xb1aa('0x1c')]({'raw':_0x142c6d[_0xb1aa('0x1d')]?_0x142c6d[_0xb1aa('0x1d')][_0xb1aa('0x1e')]===undefined?!![]:![]:!![],'where':_0x142c6d['options']?_0x142c6d[_0xb1aa('0x1d')][_0xb1aa('0x1f')]||null:null,'attributes':_0x142c6d['options']?_0x142c6d[_0xb1aa('0x1d')][_0xb1aa('0x20')]||null:null,'limit':_0x142c6d[_0xb1aa('0x1d')]?_0x142c6d['options']['limit']||null:null,'include':_0x142c6d[_0xb1aa('0x1d')]?_0x142c6d[_0xb1aa('0x1d')][_0xb1aa('0x21')]?_[_0xb1aa('0x22')](_0x142c6d[_0xb1aa('0x1d')][_0xb1aa('0x21')],function(_0x26ec21){return{'model':db[_0x26ec21[_0xb1aa('0x23')]],'as':_0x26ec21['as'],'attributes':_0x26ec21[_0xb1aa('0x20')],'include':_0x26ec21[_0xb1aa('0x21')]?_[_0xb1aa('0x22')](_0x26ec21[_0xb1aa('0x21')],function(_0x34b5e8){return{'model':db[_0x34b5e8[_0xb1aa('0x23')]],'as':_0x34b5e8['as'],'attributes':_0x34b5e8[_0xb1aa('0x20')],'include':_0x34b5e8['include']?_[_0xb1aa('0x22')](_0x34b5e8[_0xb1aa('0x21')],function(_0x3c1b92){return{'model':db[_0x3c1b92[_0xb1aa('0x23')]],'as':_0x3c1b92['as'],'attributes':_0x3c1b92['attributes']};}):[]};}):[]};}):[]:[]})[_0xb1aa('0x10')](function(_0x44ac69){logger['info'](_0xb1aa('0x1b'),_0x142c6d);logger[_0xb1aa('0x14')](_0xb1aa('0x1b'),_0x142c6d,JSON['stringify'](_0x44ac69));_0x452e6b(_0x44ac69);})[_0xb1aa('0x1a')](function(_0x120cc3){logger['error']('GetChatQueue',_0x120cc3[_0xb1aa('0x18')],_0x142c6d);_0x5ca191(_0x346858[_0xb1aa('0x17')](0x1f4,_0x120cc3[_0xb1aa('0x18')]));});});};exports[_0xb1aa('0x24')]=function(_0x28ad9a){var _0x1d0f05=this;return new Promise(function(_0x51000f,_0x42ff4a){return db['ChatQueue']['find']({'raw':_0x28ad9a['options']?_0x28ad9a[_0xb1aa('0x1d')][_0xb1aa('0x1e')]===undefined?!![]:![]:!![],'where':_0x28ad9a[_0xb1aa('0x1d')]?_0x28ad9a[_0xb1aa('0x1d')][_0xb1aa('0x1f')]||null:null,'attributes':_0x28ad9a['options']?_0x28ad9a[_0xb1aa('0x1d')][_0xb1aa('0x20')]||null:null,'include':_0x28ad9a[_0xb1aa('0x1d')]?_0x28ad9a['options']['include']?_['map'](_0x28ad9a[_0xb1aa('0x1d')][_0xb1aa('0x21')],function(_0x2b49d6){return{'model':db[_0x2b49d6[_0xb1aa('0x23')]],'as':_0x2b49d6['as'],'attributes':_0x2b49d6['attributes'],'include':_0x2b49d6[_0xb1aa('0x21')]?_[_0xb1aa('0x22')](_0x2b49d6[_0xb1aa('0x21')],function(_0x30cee3){return{'model':db[_0x30cee3['model']],'as':_0x30cee3['as'],'attributes':_0x30cee3[_0xb1aa('0x20')],'include':_0x30cee3[_0xb1aa('0x21')]?_[_0xb1aa('0x22')](_0x30cee3['include'],function(_0xf2ed78){return{'model':db[_0xf2ed78[_0xb1aa('0x23')]],'as':_0xf2ed78['as'],'attributes':_0xf2ed78[_0xb1aa('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb1aa('0x10')](function(_0x2f8443){logger[_0xb1aa('0x11')](_0xb1aa('0x24'),_0x28ad9a);logger[_0xb1aa('0x14')](_0xb1aa('0x24'),_0x28ad9a,JSON['stringify'](_0x2f8443));_0x51000f(_0x2f8443);})[_0xb1aa('0x1a')](function(_0x4a6ce0){logger[_0xb1aa('0x17')](_0xb1aa('0x24'),_0x4a6ce0[_0xb1aa('0x18')],_0x28ad9a);_0x42ff4a(_0x1d0f05[_0xb1aa('0x17')](0x1f4,_0x4a6ce0['message']));});});};
\ No newline at end of file
+var _0x945a=['where','attributes','limit','include','map','model','GetChatQueue','stringify','ShowChatQueue','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','ChatQueue','options','raw'];(function(_0x5cc770,_0x58999a){var _0x4a775a=function(_0x4ed439){while(--_0x4ed439){_0x5cc770['push'](_0x5cc770['shift']());}};_0x4a775a(++_0x58999a);}(_0x945a,0x1d2));var _0xa945=function(_0x3b1567,_0x24e7d4){_0x3b1567=_0x3b1567-0x0;var _0x595e8b=_0x945a[_0x3b1567];return _0x595e8b;};'use strict';var _=require('lodash');var util=require(_0xa945('0x0'));var moment=require(_0xa945('0x1'));var BPromise=require(_0xa945('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa945('0x3'));var db=require(_0xa945('0x4'))['db'];var utils=require(_0xa945('0x5'));var logger=require(_0xa945('0x6'))('rpc');var config=require(_0xa945('0x7'));var jayson=require(_0xa945('0x8'));var client=jayson[_0xa945('0x9')][_0xa945('0xa')]({'port':0x232a});config[_0xa945('0xb')]=_[_0xa945('0xc')](config['redis'],{'host':_0xa945('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa945('0xb')]));require(_0xa945('0xe'))['register'](socket);function respondWithRpcPromise(_0xb5ea9d,_0xdf6472,_0x2542dc){return new BPromise(function(_0xf72320,_0x1848f0){return client[_0xa945('0xf')](_0xb5ea9d,_0x2542dc)[_0xa945('0x10')](function(_0x5c852f){logger[_0xa945('0x11')](_0xa945('0x12'),_0xdf6472,_0xa945('0x13'));logger[_0xa945('0x14')](_0xa945('0x15'),_0xdf6472,_0xa945('0x13'),JSON['stringify'](_0x5c852f));if(_0x5c852f['error']){if(_0x5c852f[_0xa945('0x16')][_0xa945('0x17')]===0x1f4){logger[_0xa945('0x16')]('ChatQueue,\x20%s,\x20%s',_0xdf6472,_0x5c852f[_0xa945('0x16')]['message']);return _0x1848f0(_0x5c852f[_0xa945('0x16')]['message']);}logger[_0xa945('0x16')]('ChatQueue,\x20%s,\x20%s',_0xdf6472,_0x5c852f['error']['message']);return _0xf72320(_0x5c852f[_0xa945('0x16')]['message']);}else{logger[_0xa945('0x11')](_0xa945('0x12'),_0xdf6472,_0xa945('0x13'));_0xf72320(_0x5c852f['result'][_0xa945('0x18')]);}})['catch'](function(_0x573135){logger[_0xa945('0x16')]('ChatQueue,\x20%s,\x20%s',_0xdf6472,_0x573135);_0x1848f0(_0x573135);});});}exports['GetChatQueue']=function(_0x1097ed){var _0x7215df=this;return new Promise(function(_0x3d5b6e,_0x56561b){return db[_0xa945('0x19')]['findAll']({'raw':_0x1097ed[_0xa945('0x1a')]?_0x1097ed[_0xa945('0x1a')][_0xa945('0x1b')]===undefined?!![]:![]:!![],'where':_0x1097ed[_0xa945('0x1a')]?_0x1097ed[_0xa945('0x1a')][_0xa945('0x1c')]||null:null,'attributes':_0x1097ed[_0xa945('0x1a')]?_0x1097ed[_0xa945('0x1a')][_0xa945('0x1d')]||null:null,'limit':_0x1097ed[_0xa945('0x1a')]?_0x1097ed['options'][_0xa945('0x1e')]||null:null,'include':_0x1097ed[_0xa945('0x1a')]?_0x1097ed[_0xa945('0x1a')][_0xa945('0x1f')]?_[_0xa945('0x20')](_0x1097ed[_0xa945('0x1a')][_0xa945('0x1f')],function(_0x2d6f87){return{'model':db[_0x2d6f87[_0xa945('0x21')]],'as':_0x2d6f87['as'],'attributes':_0x2d6f87['attributes'],'include':_0x2d6f87[_0xa945('0x1f')]?_[_0xa945('0x20')](_0x2d6f87[_0xa945('0x1f')],function(_0x3c5439){return{'model':db[_0x3c5439['model']],'as':_0x3c5439['as'],'attributes':_0x3c5439['attributes'],'include':_0x3c5439['include']?_[_0xa945('0x20')](_0x3c5439[_0xa945('0x1f')],function(_0x1f5253){return{'model':db[_0x1f5253[_0xa945('0x21')]],'as':_0x1f5253['as'],'attributes':_0x1f5253['attributes']};}):[]};}):[]};}):[]:[]})[_0xa945('0x10')](function(_0xbff8af){logger[_0xa945('0x11')](_0xa945('0x22'),_0x1097ed);logger[_0xa945('0x14')](_0xa945('0x22'),_0x1097ed,JSON[_0xa945('0x23')](_0xbff8af));_0x3d5b6e(_0xbff8af);})['catch'](function(_0x17ba5b){logger[_0xa945('0x16')]('GetChatQueue',_0x17ba5b[_0xa945('0x18')],_0x1097ed);_0x56561b(_0x7215df[_0xa945('0x16')](0x1f4,_0x17ba5b[_0xa945('0x18')]));});});};exports[_0xa945('0x24')]=function(_0x268542){var _0x4b5e65=this;return new Promise(function(_0x10cd29,_0x25e992){return db[_0xa945('0x19')]['find']({'raw':_0x268542[_0xa945('0x1a')]?_0x268542[_0xa945('0x1a')][_0xa945('0x1b')]===undefined?!![]:![]:!![],'where':_0x268542[_0xa945('0x1a')]?_0x268542['options'][_0xa945('0x1c')]||null:null,'attributes':_0x268542[_0xa945('0x1a')]?_0x268542[_0xa945('0x1a')][_0xa945('0x1d')]||null:null,'include':_0x268542['options']?_0x268542['options'][_0xa945('0x1f')]?_[_0xa945('0x20')](_0x268542['options'][_0xa945('0x1f')],function(_0x4a8de6){return{'model':db[_0x4a8de6[_0xa945('0x21')]],'as':_0x4a8de6['as'],'attributes':_0x4a8de6[_0xa945('0x1d')],'include':_0x4a8de6['include']?_[_0xa945('0x20')](_0x4a8de6[_0xa945('0x1f')],function(_0x4efa6d){return{'model':db[_0x4efa6d[_0xa945('0x21')]],'as':_0x4efa6d['as'],'attributes':_0x4efa6d[_0xa945('0x1d')],'include':_0x4efa6d[_0xa945('0x1f')]?_[_0xa945('0x20')](_0x4efa6d[_0xa945('0x1f')],function(_0x48d979){return{'model':db[_0x48d979['model']],'as':_0x48d979['as'],'attributes':_0x48d979[_0xa945('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fede7){logger[_0xa945('0x11')](_0xa945('0x24'),_0x268542);logger['debug'](_0xa945('0x24'),_0x268542,JSON['stringify'](_0x2fede7));_0x10cd29(_0x2fede7);})[_0xa945('0x25')](function(_0x1689ed){logger[_0xa945('0x16')](_0xa945('0x24'),_0x1689ed[_0xa945('0x18')],_0x268542);_0x25e992(_0x4b5e65['error'](0x1f4,_0x1689ed[_0xa945('0x18')]));});});};
\ No newline at end of file
index a7a5744..000b121 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bde=['chatQueue:','save','update','emit','removeListener','register','length'];(function(_0x571a17,_0x63fb3d){var _0x3ef337=function(_0x12096b){while(--_0x12096b){_0x571a17['push'](_0x571a17['shift']());}};_0x3ef337(++_0x63fb3d);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5eb2bf,_0x3929ec){_0x5eb2bf=_0x5eb2bf-0x0;var _0x1ce48e=_0x9bde[_0x5eb2bf];return _0x1ce48e;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xe9bd('0x0'),'remove',_0xe9bd('0x1')];function createListener(_0x4c63ca,_0x51786f){return function(_0x3005aa){_0x51786f[_0xe9bd('0x2')](_0x4c63ca,_0x3005aa);};}function removeListener(_0x1c1b34,_0x10822d){return function(){ChatQueueEvents[_0xe9bd('0x3')](_0x1c1b34,_0x10822d);};}exports[_0xe9bd('0x4')]=function(_0x4fd7b8){for(var _0x4763e9=0x0,_0x5f18fe=events[_0xe9bd('0x5')];_0x4763e9<_0x5f18fe;_0x4763e9++){var _0xa66ae2=events[_0x4763e9];var _0x2d5c75=createListener(_0xe9bd('0x6')+_0xa66ae2,_0x4fd7b8);ChatQueueEvents['on'](_0xa66ae2,_0x2d5c75);}};
\ No newline at end of file
+var _0x57d4=['length','./chatQueue.events','save','update','emit','removeListener','register'];(function(_0x52042e,_0x5be829){var _0x98e4da=function(_0x472342){while(--_0x472342){_0x52042e['push'](_0x52042e['shift']());}};_0x98e4da(++_0x5be829);}(_0x57d4,0x78));var _0x457d=function(_0x2532d4,_0x4327e1){_0x2532d4=_0x2532d4-0x0;var _0x2e936b=_0x57d4[_0x2532d4];return _0x2e936b;};'use strict';var ChatQueueEvents=require(_0x457d('0x0'));var events=[_0x457d('0x1'),'remove',_0x457d('0x2')];function createListener(_0xa408c8,_0x1e26ab){return function(_0x30a25c){_0x1e26ab[_0x457d('0x3')](_0xa408c8,_0x30a25c);};}function removeListener(_0x3c89b2,_0x3e2239){return function(){ChatQueueEvents[_0x457d('0x4')](_0x3c89b2,_0x3e2239);};}exports[_0x457d('0x5')]=function(_0x247ec7){for(var _0x3fd867=0x0,_0x5c6816=events[_0x457d('0x6')];_0x3fd867<_0x5c6816;_0x3fd867++){var _0x381e22=events[_0x3fd867];var _0x4e32c0=createListener('chatQueue:'+_0x381e22,_0x247ec7);ChatQueueEvents['on'](_0x381e22,_0x4e32c0);}};
\ No newline at end of file
index 41db94c..87d877e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x55893f,_0x3edced){var _0xded9b=function(_0x3c43ef){while(--_0x3c43ef){_0x55893f['push'](_0x55893f['shift']());}};_0xded9b(++_0x3edced);}(_0x008c,0x188));var _0xc008=function(_0x5e9c3a,_0x13acc2){_0x5e9c3a=_0x5e9c3a-0x0;var _0x12ccb4=_0x008c[_0x5e9c3a];return _0x12ccb4;};'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
+var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x35d4e9,_0x298c61){var _0x5c2770=function(_0x2f326a){while(--_0x2f326a){_0x35d4e9['push'](_0x35d4e9['shift']());}};_0x5c2770(++_0x298c61);}(_0x55ca,0x126));var _0xa55c=function(_0x33154d,_0x854047){_0x33154d=_0x33154d-0x0;var _0x3b2f03=_0x55ca[_0x33154d];return _0x3b2f03;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
index 34d565d..383ea2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa57=['moment','sequelize','exports','STRING','DATE'];(function(_0x260511,_0x336f67){var _0x507f2=function(_0x46ceb7){while(--_0x46ceb7){_0x260511['push'](_0x260511['shift']());}};_0x507f2(++_0x336f67);}(_0xfa57,0xe6));var _0x7fa5=function(_0x4aa8ef,_0x3d922a){_0x4aa8ef=_0x4aa8ef-0x0;var _0x2f1c74=_0xfa57[_0x4aa8ef];return _0x2f1c74;};'use strict';var moment=require(_0x7fa5('0x0'));var Sequelize=require(_0x7fa5('0x1'));module[_0x7fa5('0x2')]={'uniqueid':{'type':Sequelize[_0x7fa5('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x7fa5('0x3')]},'joinAt':{'type':Sequelize[_0x7fa5('0x4')]},'leaveAt':{'type':Sequelize[_0x7fa5('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x7fa5('0x4')]},'reason':{'type':Sequelize[_0x7fa5('0x3')]}};
\ No newline at end of file
+var _0xfd7b=['exports','STRING','DATE','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfd7b,0x1b3));var _0xbfd7=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xfd7b[_0x4b7b62];return _0x2280df;};'use strict';var moment=require('moment');var Sequelize=require(_0xbfd7('0x0'));module[_0xbfd7('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xbfd7('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xbfd7('0x3')]},'acceptAt':{'type':Sequelize[_0xbfd7('0x3')]},'exitAt':{'type':Sequelize[_0xbfd7('0x3')]},'reason':{'type':Sequelize[_0xbfd7('0x2')]}};
\ No newline at end of file
index 0d44195..866db0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c09=['map','ChatQueueReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index'];(function(_0x5bf172,_0x50b1c4){var _0x824c0c=function(_0x379459){while(--_0x379459){_0x5bf172['push'](_0x5bf172['shift']());}};_0x824c0c(++_0x50b1c4);}(_0x7c09,0x102));var _0x97c0=function(_0x4e267d,_0x18c2b7){_0x4e267d=_0x4e267d-0x0;var _0x4ae1b2=_0x7c09[_0x4e267d];return _0x4ae1b2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x97c0('0x0'));var zipdir=require(_0x97c0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x97c0('0x2'));var moment=require(_0x97c0('0x3'));var BPromise=require(_0x97c0('0x4'));var Mustache=require(_0x97c0('0x5'));var util=require(_0x97c0('0x6'));var path=require(_0x97c0('0x7'));var sox=require(_0x97c0('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x97c0('0x9'));var squel=require(_0x97c0('0xa'));var crypto=require(_0x97c0('0xb'));var jsforce=require(_0x97c0('0xc'));var deskjs=require(_0x97c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x97c0('0xe'));var Papa=require('papaparse');var Redis=require(_0x97c0('0xf'));var authService=require(_0x97c0('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x97c0('0x11'));var logger=require(_0x97c0('0x12'))(_0x97c0('0x13'));var utils=require(_0x97c0('0x14'));var config=require(_0x97c0('0x15'));var licenseUtil=require(_0x97c0('0x16'));var db=require(_0x97c0('0x17'))['db'];function respondWithStatusCode(_0x39a3b4,_0x9ca3c1){_0x9ca3c1=_0x9ca3c1||0xcc;return function(_0x2ecf34){if(_0x2ecf34){return _0x39a3b4[_0x97c0('0x18')](_0x9ca3c1);}return _0x39a3b4[_0x97c0('0x19')](_0x9ca3c1)[_0x97c0('0x1a')]();};}function respondWithResult(_0x514782,_0x3f2fc2){_0x3f2fc2=_0x3f2fc2||0xc8;return function(_0x15b336){if(_0x15b336){return _0x514782[_0x97c0('0x19')](_0x3f2fc2)['json'](_0x15b336);}};}function respondWithFilteredResult(_0x42027d,_0x9ca6a8){return function(_0x379951){if(_0x379951){var _0x21e5f7=typeof _0x9ca6a8[_0x97c0('0x1b')]===_0x97c0('0x1c')&&typeof _0x9ca6a8['limit']===_0x97c0('0x1c');var _0x3ae7c4=_0x379951['count'];var _0x560ac0=_0x21e5f7?0x0:_0x9ca6a8[_0x97c0('0x1b')];var _0x179d43=_0x21e5f7?_0x379951[_0x97c0('0x1d')]:_0x9ca6a8[_0x97c0('0x1b')]+_0x9ca6a8[_0x97c0('0x1e')];var _0x4fed42;if(_0x179d43>=_0x3ae7c4){_0x179d43=_0x3ae7c4;_0x4fed42=0xc8;}else{_0x4fed42=0xce;}_0x42027d[_0x97c0('0x19')](_0x4fed42);return _0x42027d[_0x97c0('0x1f')](_0x97c0('0x20'),_0x560ac0+'-'+_0x179d43+'/'+_0x3ae7c4)['json'](_0x379951);}return null;};}function patchUpdates(_0x554122){return function(_0x2b74a2){try{jsonpatch[_0x97c0('0x21')](_0x2b74a2,_0x554122,!![]);}catch(_0x169f19){return BPromise['reject'](_0x169f19);}return _0x2b74a2[_0x97c0('0x22')]();};}function saveUpdates(_0x20bc4c,_0x31ffb7){return function(_0x272314){if(_0x272314){return _0x272314[_0x97c0('0x23')](_0x20bc4c)[_0x97c0('0x24')](function(_0x9dff60){return _0x9dff60;});}return null;};}function removeEntity(_0x5ac457,_0x60ab00){return function(_0x29b3aa){if(_0x29b3aa){return _0x29b3aa[_0x97c0('0x25')]()[_0x97c0('0x24')](function(){_0x5ac457['status'](0xcc)[_0x97c0('0x1a')]();});}};}function handleEntityNotFound(_0x14cada,_0x52a429){return function(_0x2ec9d6){if(!_0x2ec9d6){_0x14cada[_0x97c0('0x18')](0x194);}return _0x2ec9d6;};}function handleError(_0x447316,_0x4af5a5){_0x4af5a5=_0x4af5a5||0x1f4;return function(_0x4f11ba){logger['error'](_0x4f11ba[_0x97c0('0x26')]);if(_0x4f11ba[_0x97c0('0x27')]){delete _0x4f11ba[_0x97c0('0x27')];}_0x447316[_0x97c0('0x19')](_0x4af5a5)[_0x97c0('0x28')](_0x4f11ba);};}exports[_0x97c0('0x29')]=function(_0x4a3645,_0x10e47e){var _0x1c183f={},_0x325090={},_0x4ad645={'count':0x0,'rows':[]};var _0x14617c=_[_0x97c0('0x2a')](db[_0x97c0('0x2b')][_0x97c0('0x2c')],function(_0x2a7b2b){return{'name':_0x2a7b2b['fieldName'],'type':_0x2a7b2b['type'][_0x97c0('0x2d')]};});_0x325090[_0x97c0('0x2e')]=_[_0x97c0('0x2a')](_0x14617c,'name');_0x325090[_0x97c0('0x2f')]=_[_0x97c0('0x30')](_0x4a3645['query']);_0x325090[_0x97c0('0x31')]=_[_0x97c0('0x32')](_0x325090[_0x97c0('0x2e')],_0x325090[_0x97c0('0x2f')]);_0x1c183f[_0x97c0('0x33')]=_[_0x97c0('0x32')](_0x325090[_0x97c0('0x2e')],qs[_0x97c0('0x34')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x34')]));_0x1c183f[_0x97c0('0x33')]=_0x1c183f[_0x97c0('0x33')][_0x97c0('0x35')]?_0x1c183f[_0x97c0('0x33')]:_0x325090[_0x97c0('0x2e')];if(!_0x4a3645['query'][_0x97c0('0x36')](_0x97c0('0x37'))){_0x1c183f[_0x97c0('0x1e')]=qs[_0x97c0('0x1e')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x1e')]);_0x1c183f[_0x97c0('0x1b')]=qs[_0x97c0('0x1b')](_0x4a3645['query'][_0x97c0('0x1b')]);}_0x1c183f['order']=qs[_0x97c0('0x38')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x38')]);_0x1c183f[_0x97c0('0x39')]=qs[_0x97c0('0x31')](_[_0x97c0('0x3a')](_0x4a3645[_0x97c0('0x2f')],_0x325090[_0x97c0('0x31')]),_0x14617c);if(_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x3b')]){_0x1c183f[_0x97c0('0x39')]=_['merge'](_0x1c183f[_0x97c0('0x39')],{'$or':_[_0x97c0('0x2a')](_0x14617c,function(_0x4d47b1){if(_0x4d47b1[_0x97c0('0x3c')]!==_0x97c0('0x3d')){var _0x2aeffc={};_0x2aeffc[_0x4d47b1[_0x97c0('0x27')]]={'$like':'%'+_0x4a3645['query'][_0x97c0('0x3b')]+'%'};return _0x2aeffc;}})});}_0x1c183f=_['merge']({},_0x1c183f,_0x4a3645[_0x97c0('0x3e')]);var _0x64cfcd={'where':_0x1c183f['where']};return db[_0x97c0('0x2b')][_0x97c0('0x1d')](_0x64cfcd)[_0x97c0('0x24')](function(_0xb13649){_0x4ad645[_0x97c0('0x1d')]=_0xb13649;if(_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x3f')]){_0x1c183f[_0x97c0('0x40')]=[{'all':!![]}];}return db[_0x97c0('0x2b')][_0x97c0('0x41')](_0x1c183f);})[_0x97c0('0x24')](function(_0x2cca4c){_0x4ad645[_0x97c0('0x42')]=_0x2cca4c;return _0x4ad645;})['then'](respondWithFilteredResult(_0x10e47e,_0x1c183f))[_0x97c0('0x43')](handleError(_0x10e47e,null));};exports[_0x97c0('0x44')]=function(_0x1dc6ff,_0x142421){var _0x312fce={'raw':!![],'where':{'id':_0x1dc6ff[_0x97c0('0x45')]['id']}},_0x375ebc={};_0x375ebc['model']=_['keys'](db[_0x97c0('0x2b')][_0x97c0('0x2c')]);_0x375ebc[_0x97c0('0x2f')]=_[_0x97c0('0x30')](_0x1dc6ff[_0x97c0('0x2f')]);_0x375ebc['filters']=_['intersection'](_0x375ebc['model'],_0x375ebc[_0x97c0('0x2f')]);_0x312fce['attributes']=_['intersection'](_0x375ebc[_0x97c0('0x2e')],qs[_0x97c0('0x34')](_0x1dc6ff[_0x97c0('0x2f')][_0x97c0('0x34')]));_0x312fce[_0x97c0('0x33')]=_0x312fce['attributes'][_0x97c0('0x35')]?_0x312fce[_0x97c0('0x33')]:_0x375ebc[_0x97c0('0x2e')];if(_0x1dc6ff[_0x97c0('0x2f')][_0x97c0('0x3f')]){_0x312fce[_0x97c0('0x40')]=[{'all':!![]}];}_0x312fce=_[_0x97c0('0x46')]({},_0x312fce,_0x1dc6ff[_0x97c0('0x3e')]);return db[_0x97c0('0x2b')][_0x97c0('0x47')](_0x312fce)['then'](handleEntityNotFound(_0x142421,null))[_0x97c0('0x24')](respondWithResult(_0x142421,null))[_0x97c0('0x43')](handleError(_0x142421,null));};exports[_0x97c0('0x48')]=function(_0x276c98,_0x4ff0a5){return db['ChatQueueReport'][_0x97c0('0x48')](_0x276c98[_0x97c0('0x49')],{})[_0x97c0('0x24')](respondWithResult(_0x4ff0a5,0xc9))['catch'](handleError(_0x4ff0a5,null));};exports[_0x97c0('0x23')]=function(_0xac56ac,_0x240f68){if(_0xac56ac[_0x97c0('0x49')]['id']){delete _0xac56ac[_0x97c0('0x49')]['id'];}return db['ChatQueueReport'][_0x97c0('0x47')]({'where':{'id':_0xac56ac[_0x97c0('0x45')]['id']}})[_0x97c0('0x24')](handleEntityNotFound(_0x240f68,null))['then'](saveUpdates(_0xac56ac['body'],null))[_0x97c0('0x24')](respondWithResult(_0x240f68,null))['catch'](handleError(_0x240f68,null));};exports['destroy']=function(_0x473b63,_0x20e2a5){return db[_0x97c0('0x2b')]['find']({'where':{'id':_0x473b63['params']['id']}})['then'](handleEntityNotFound(_0x20e2a5,null))[_0x97c0('0x24')](removeEntity(_0x20e2a5,null))[_0x97c0('0x43')](handleError(_0x20e2a5,null));};exports[_0x97c0('0x4a')]=function(_0xdb2767,_0x397065){return db[_0x97c0('0x2b')][_0x97c0('0x4a')]()['then'](respondWithResult(_0x397065,null))[_0x97c0('0x43')](handleError(_0x397065,null));};
\ No newline at end of file
+var _0x7a2f=['describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','rawAttributes','fieldName','type','key','map','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','options','ChatQueueReport','includeAll','include','findAll','rows','catch','params','create','body','find'];(function(_0x59ea1c,_0x4be6c3){var _0x2736d3=function(_0x2a173c){while(--_0x2a173c){_0x59ea1c['push'](_0x59ea1c['shift']());}};_0x2736d3(++_0x4be6c3);}(_0x7a2f,0x99));var _0xf7a2=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7a2f[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0xf7a2('0x0'));var rimraf=require(_0xf7a2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf7a2('0x2'));var rp=require(_0xf7a2('0x3'));var moment=require(_0xf7a2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf7a2('0x5'));var util=require(_0xf7a2('0x6'));var path=require(_0xf7a2('0x7'));var sox=require(_0xf7a2('0x8'));var csv=require(_0xf7a2('0x9'));var ejs=require(_0xf7a2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf7a2('0xb'));var squel=require(_0xf7a2('0xc'));var crypto=require(_0xf7a2('0xd'));var jsforce=require(_0xf7a2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf7a2('0x9'));var querystring=require(_0xf7a2('0xf'));var Papa=require(_0xf7a2('0x10'));var Redis=require(_0xf7a2('0x11'));var authService=require(_0xf7a2('0x12'));var qs=require(_0xf7a2('0x13'));var as=require(_0xf7a2('0x14'));var hardwareService=require(_0xf7a2('0x15'));var logger=require('../../config/logger')(_0xf7a2('0x16'));var utils=require(_0xf7a2('0x17'));var config=require(_0xf7a2('0x18'));var licenseUtil=require(_0xf7a2('0x19'));var db=require(_0xf7a2('0x1a'))['db'];function respondWithStatusCode(_0x4f960f,_0x4bf293){_0x4bf293=_0x4bf293||0xcc;return function(_0x4d01db){if(_0x4d01db){return _0x4f960f[_0xf7a2('0x1b')](_0x4bf293);}return _0x4f960f[_0xf7a2('0x1c')](_0x4bf293)[_0xf7a2('0x1d')]();};}function respondWithResult(_0x35a006,_0x3b46f1){_0x3b46f1=_0x3b46f1||0xc8;return function(_0x1de4ef){if(_0x1de4ef){return _0x35a006[_0xf7a2('0x1c')](_0x3b46f1)['json'](_0x1de4ef);}};}function respondWithFilteredResult(_0x4eedb3,_0x53c32e){return function(_0x16b0dc){if(_0x16b0dc){var _0x5ef0aa=typeof _0x53c32e['offset']===_0xf7a2('0x1e')&&typeof _0x53c32e[_0xf7a2('0x1f')]===_0xf7a2('0x1e');var _0x3147b2=_0x16b0dc[_0xf7a2('0x20')];var _0x5f2147=_0x5ef0aa?0x0:_0x53c32e['offset'];var _0x5de0f1=_0x5ef0aa?_0x16b0dc[_0xf7a2('0x20')]:_0x53c32e[_0xf7a2('0x21')]+_0x53c32e[_0xf7a2('0x1f')];var _0x2a3fef;if(_0x5de0f1>=_0x3147b2){_0x5de0f1=_0x3147b2;_0x2a3fef=0xc8;}else{_0x2a3fef=0xce;}_0x4eedb3[_0xf7a2('0x1c')](_0x2a3fef);return _0x4eedb3['set'](_0xf7a2('0x22'),_0x5f2147+'-'+_0x5de0f1+'/'+_0x3147b2)['json'](_0x16b0dc);}return null;};}function patchUpdates(_0x1f2b26){return function(_0x3a0334){try{jsonpatch[_0xf7a2('0x23')](_0x3a0334,_0x1f2b26,!![]);}catch(_0x1ade67){return BPromise[_0xf7a2('0x24')](_0x1ade67);}return _0x3a0334[_0xf7a2('0x25')]();};}function saveUpdates(_0x39c941,_0x5265e0){return function(_0x4b1a06){if(_0x4b1a06){return _0x4b1a06[_0xf7a2('0x26')](_0x39c941)[_0xf7a2('0x27')](function(_0x59217f){return _0x59217f;});}return null;};}function removeEntity(_0x31349c,_0x2bbffd){return function(_0x3592ba){if(_0x3592ba){return _0x3592ba[_0xf7a2('0x28')]()[_0xf7a2('0x27')](function(){_0x31349c['status'](0xcc)[_0xf7a2('0x1d')]();});}};}function handleEntityNotFound(_0x484874,_0x30ec1e){return function(_0x143895){if(!_0x143895){_0x484874[_0xf7a2('0x1b')](0x194);}return _0x143895;};}function handleError(_0x48a4d8,_0x34af9b){_0x34af9b=_0x34af9b||0x1f4;return function(_0x5c53fb){logger[_0xf7a2('0x29')](_0x5c53fb['stack']);if(_0x5c53fb[_0xf7a2('0x2a')]){delete _0x5c53fb[_0xf7a2('0x2a')];}_0x48a4d8[_0xf7a2('0x1c')](_0x34af9b)[_0xf7a2('0x2b')](_0x5c53fb);};}exports[_0xf7a2('0x2c')]=function(_0x234359,_0xe7d318){var _0x5d64d1={},_0x1c764b={},_0x154ee5={'count':0x0,'rows':[]};var _0x481007=_['map'](db['ChatQueueReport'][_0xf7a2('0x2d')],function(_0x25551f){return{'name':_0x25551f[_0xf7a2('0x2e')],'type':_0x25551f[_0xf7a2('0x2f')][_0xf7a2('0x30')]};});_0x1c764b['model']=_[_0xf7a2('0x31')](_0x481007,_0xf7a2('0x2a'));_0x1c764b['query']=_['keys'](_0x234359[_0xf7a2('0x32')]);_0x1c764b[_0xf7a2('0x33')]=_[_0xf7a2('0x34')](_0x1c764b['model'],_0x1c764b[_0xf7a2('0x32')]);_0x5d64d1[_0xf7a2('0x35')]=_[_0xf7a2('0x34')](_0x1c764b[_0xf7a2('0x36')],qs[_0xf7a2('0x37')](_0x234359[_0xf7a2('0x32')][_0xf7a2('0x37')]));_0x5d64d1[_0xf7a2('0x35')]=_0x5d64d1[_0xf7a2('0x35')][_0xf7a2('0x38')]?_0x5d64d1[_0xf7a2('0x35')]:_0x1c764b[_0xf7a2('0x36')];if(!_0x234359[_0xf7a2('0x32')][_0xf7a2('0x39')](_0xf7a2('0x3a'))){_0x5d64d1[_0xf7a2('0x1f')]=qs[_0xf7a2('0x1f')](_0x234359['query']['limit']);_0x5d64d1[_0xf7a2('0x21')]=qs[_0xf7a2('0x21')](_0x234359[_0xf7a2('0x32')][_0xf7a2('0x21')]);}_0x5d64d1['order']=qs[_0xf7a2('0x3b')](_0x234359[_0xf7a2('0x32')][_0xf7a2('0x3b')]);_0x5d64d1['where']=qs[_0xf7a2('0x33')](_[_0xf7a2('0x3c')](_0x234359['query'],_0x1c764b['filters']),_0x481007);if(_0x234359[_0xf7a2('0x32')]['filter']){_0x5d64d1[_0xf7a2('0x3d')]=_[_0xf7a2('0x3e')](_0x5d64d1['where'],{'$or':_['map'](_0x481007,function(_0x1a220d){if(_0x1a220d['type']!==_0xf7a2('0x3f')){var _0x211f29={};_0x211f29[_0x1a220d[_0xf7a2('0x2a')]]={'$like':'%'+_0x234359['query']['filter']+'%'};return _0x211f29;}})});}_0x5d64d1=_[_0xf7a2('0x3e')]({},_0x5d64d1,_0x234359[_0xf7a2('0x40')]);var _0x46b06c={'where':_0x5d64d1['where']};return db[_0xf7a2('0x41')]['count'](_0x46b06c)['then'](function(_0x4a42d3){_0x154ee5[_0xf7a2('0x20')]=_0x4a42d3;if(_0x234359['query'][_0xf7a2('0x42')]){_0x5d64d1[_0xf7a2('0x43')]=[{'all':!![]}];}return db[_0xf7a2('0x41')][_0xf7a2('0x44')](_0x5d64d1);})[_0xf7a2('0x27')](function(_0xca3996){_0x154ee5[_0xf7a2('0x45')]=_0xca3996;return _0x154ee5;})[_0xf7a2('0x27')](respondWithFilteredResult(_0xe7d318,_0x5d64d1))[_0xf7a2('0x46')](handleError(_0xe7d318,null));};exports['show']=function(_0x499a01,_0x46f0f9){var _0x12c562={'raw':!![],'where':{'id':_0x499a01[_0xf7a2('0x47')]['id']}},_0x12f13e={};_0x12f13e['model']=_['keys'](db['ChatQueueReport']['rawAttributes']);_0x12f13e['query']=_['keys'](_0x499a01[_0xf7a2('0x32')]);_0x12f13e[_0xf7a2('0x33')]=_[_0xf7a2('0x34')](_0x12f13e[_0xf7a2('0x36')],_0x12f13e[_0xf7a2('0x32')]);_0x12c562['attributes']=_[_0xf7a2('0x34')](_0x12f13e['model'],qs[_0xf7a2('0x37')](_0x499a01[_0xf7a2('0x32')][_0xf7a2('0x37')]));_0x12c562[_0xf7a2('0x35')]=_0x12c562['attributes'][_0xf7a2('0x38')]?_0x12c562[_0xf7a2('0x35')]:_0x12f13e[_0xf7a2('0x36')];if(_0x499a01[_0xf7a2('0x32')][_0xf7a2('0x42')]){_0x12c562[_0xf7a2('0x43')]=[{'all':!![]}];}_0x12c562=_[_0xf7a2('0x3e')]({},_0x12c562,_0x499a01[_0xf7a2('0x40')]);return db[_0xf7a2('0x41')]['find'](_0x12c562)['then'](handleEntityNotFound(_0x46f0f9,null))['then'](respondWithResult(_0x46f0f9,null))[_0xf7a2('0x46')](handleError(_0x46f0f9,null));};exports[_0xf7a2('0x48')]=function(_0x1b8ce0,_0x2e4dac){return db[_0xf7a2('0x41')]['create'](_0x1b8ce0[_0xf7a2('0x49')],{})['then'](respondWithResult(_0x2e4dac,0xc9))[_0xf7a2('0x46')](handleError(_0x2e4dac,null));};exports[_0xf7a2('0x26')]=function(_0x401948,_0x4d40ba){if(_0x401948['body']['id']){delete _0x401948[_0xf7a2('0x49')]['id'];}return db[_0xf7a2('0x41')][_0xf7a2('0x4a')]({'where':{'id':_0x401948[_0xf7a2('0x47')]['id']}})[_0xf7a2('0x27')](handleEntityNotFound(_0x4d40ba,null))[_0xf7a2('0x27')](saveUpdates(_0x401948[_0xf7a2('0x49')],null))[_0xf7a2('0x27')](respondWithResult(_0x4d40ba,null))[_0xf7a2('0x46')](handleError(_0x4d40ba,null));};exports[_0xf7a2('0x28')]=function(_0x588d30,_0x3e8cbe){return db['ChatQueueReport'][_0xf7a2('0x4a')]({'where':{'id':_0x588d30[_0xf7a2('0x47')]['id']}})[_0xf7a2('0x27')](handleEntityNotFound(_0x3e8cbe,null))[_0xf7a2('0x27')](removeEntity(_0x3e8cbe,null))[_0xf7a2('0x46')](handleError(_0x3e8cbe,null));};exports[_0xf7a2('0x4b')]=function(_0x4ae537,_0x5a544e){return db[_0xf7a2('0x41')][_0xf7a2('0x4b')]()[_0xf7a2('0x27')](respondWithResult(_0x5a544e,null))[_0xf7a2('0x46')](handleError(_0x5a544e,null));};
\ No newline at end of file
index cdc6a08..cb22493 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x187536,_0x330504){var _0x5d1f13=function(_0xdbcf0e){while(--_0xdbcf0e){_0x187536['push'](_0x187536['shift']());}};_0x5d1f13(++_0x330504);}(_0xb7e7,0x121));var _0x7b7e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xb7e7[_0x187ee1];return _0x388160;};'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_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0xc3212e,_0x30e7ec){var _0x2fc81e=function(_0x380980){while(--_0x380980){_0xc3212e['push'](_0xc3212e['shift']());}};_0x2fc81e(++_0x30e7ec);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0xb7e7[_0x1cb18a];return _0x22442e;};'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_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index e6cc9a0..a2a9a02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79d3=['options','CreateChatQueueReport','UpdateChatQueueReport','raw','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','ChatQueueReport','body'];(function(_0x56f0ed,_0x431d41){var _0x218285=function(_0x16c4b5){while(--_0x16c4b5){_0x56f0ed['push'](_0x56f0ed['shift']());}};_0x218285(++_0x431d41);}(_0x79d3,0x1c6));var _0x379d=function(_0x523cc7,_0x34b3d0){_0x523cc7=_0x523cc7-0x0;var _0x268b8b=_0x79d3[_0x523cc7];return _0x268b8b;};'use strict';var _=require(_0x379d('0x0'));var util=require(_0x379d('0x1'));var moment=require(_0x379d('0x2'));var BPromise=require(_0x379d('0x3'));var rs=require(_0x379d('0x4'));var fs=require('fs');var Redis=require(_0x379d('0x5'));var db=require(_0x379d('0x6'))['db'];var utils=require(_0x379d('0x7'));var logger=require('../../config/logger')(_0x379d('0x8'));var config=require(_0x379d('0x9'));var jayson=require(_0x379d('0xa'));var client=jayson[_0x379d('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16155a,_0x8aee7c,_0x3d1905){return new BPromise(function(_0x20e8b4,_0x4a0de6){return client['request'](_0x16155a,_0x3d1905)[_0x379d('0xc')](function(_0x160db2){logger[_0x379d('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x8aee7c,_0x379d('0xe'));logger[_0x379d('0xf')](_0x379d('0x10'),_0x8aee7c,'request\x20sent',JSON[_0x379d('0x11')](_0x160db2));if(_0x160db2[_0x379d('0x12')]){if(_0x160db2[_0x379d('0x12')][_0x379d('0x13')]===0x1f4){logger['error'](_0x379d('0x14'),_0x8aee7c,_0x160db2['error'][_0x379d('0x15')]);return _0x4a0de6(_0x160db2[_0x379d('0x12')][_0x379d('0x15')]);}logger[_0x379d('0x12')](_0x379d('0x14'),_0x8aee7c,_0x160db2[_0x379d('0x12')][_0x379d('0x15')]);return _0x20e8b4(_0x160db2[_0x379d('0x12')]['message']);}else{logger[_0x379d('0xd')](_0x379d('0x14'),_0x8aee7c,_0x379d('0xe'));_0x20e8b4(_0x160db2[_0x379d('0x16')][_0x379d('0x15')]);}})[_0x379d('0x17')](function(_0x2e768f){logger[_0x379d('0x12')](_0x379d('0x14'),_0x8aee7c,_0x2e768f);_0x4a0de6(_0x2e768f);});});}exports['CreateChatQueueReport']=function(_0x4708b3){var _0x191083=this;return new Promise(function(_0x247da8,_0x81c1d5){return db[_0x379d('0x18')]['create'](_0x4708b3[_0x379d('0x19')],{'raw':_0x4708b3[_0x379d('0x1a')]?_0x4708b3[_0x379d('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x379d('0xc')](function(_0x46ed45){logger[_0x379d('0xd')](_0x379d('0x1b'),_0x4708b3);logger['debug'](_0x379d('0x1b'),_0x4708b3,JSON[_0x379d('0x11')](_0x46ed45));_0x247da8(_0x46ed45);})[_0x379d('0x17')](function(_0x4678f6){logger['error'](_0x379d('0x1b'),_0x4678f6[_0x379d('0x15')],_0x4708b3);_0x81c1d5(_0x191083[_0x379d('0x12')](0x1f4,_0x4678f6['message']));});});};exports[_0x379d('0x1c')]=function(_0x181b6c){var _0x57058c=this;return new Promise(function(_0x480480,_0x495bda){return db[_0x379d('0x18')]['update'](_0x181b6c['body'],{'raw':_0x181b6c[_0x379d('0x1a')]?_0x181b6c[_0x379d('0x1a')][_0x379d('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x181b6c['options']?_0x181b6c[_0x379d('0x1a')][_0x379d('0x1e')]||null:null,'attributes':_0x181b6c['options']?_0x181b6c[_0x379d('0x1a')][_0x379d('0x1f')]||null:null,'limit':_0x181b6c['options']?_0x181b6c[_0x379d('0x1a')]['limit']||null:null})['then'](function(_0x2be3bc){logger[_0x379d('0xd')](_0x379d('0x1c'),_0x181b6c);logger['debug'](_0x379d('0x1c'),_0x181b6c,JSON[_0x379d('0x11')](_0x2be3bc));_0x480480(_0x2be3bc);})[_0x379d('0x17')](function(_0x931d5e){logger['error'](_0x379d('0x1c'),_0x931d5e[_0x379d('0x15')],_0x181b6c);_0x495bda(_0x57058c['error'](0x1f4,_0x931d5e[_0x379d('0x15')]));});});};
\ No newline at end of file
+var _0xf63e=['moment','bluebird','../../mysqldb','../../config/utils','rpc','client','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','update','limit','then','lodash','util'];(function(_0x29df2a,_0x421ad2){var _0x16d077=function(_0x5378c1){while(--_0x5378c1){_0x29df2a['push'](_0x29df2a['shift']());}};_0x16d077(++_0x421ad2);}(_0xf63e,0x103));var _0xef63=function(_0x441c2f,_0x563d27){_0x441c2f=_0x441c2f-0x0;var _0xd016c2=_0xf63e[_0x441c2f];return _0xd016c2;};'use strict';var _=require(_0xef63('0x0'));var util=require(_0xef63('0x1'));var moment=require(_0xef63('0x2'));var BPromise=require(_0xef63('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xef63('0x4'))['db'];var utils=require(_0xef63('0x5'));var logger=require('../../config/logger')(_0xef63('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xef63('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa7c873,_0x4998a1,_0x24e7ac){return new BPromise(function(_0xd19c1e,_0x59d5c4){return client['request'](_0xa7c873,_0x24e7ac)['then'](function(_0x5247e9){logger[_0xef63('0x8')](_0xef63('0x9'),_0x4998a1,_0xef63('0xa'));logger[_0xef63('0xb')](_0xef63('0xc'),_0x4998a1,_0xef63('0xa'),JSON[_0xef63('0xd')](_0x5247e9));if(_0x5247e9['error']){if(_0x5247e9[_0xef63('0xe')][_0xef63('0xf')]===0x1f4){logger[_0xef63('0xe')](_0xef63('0x9'),_0x4998a1,_0x5247e9['error'][_0xef63('0x10')]);return _0x59d5c4(_0x5247e9[_0xef63('0xe')]['message']);}logger['error'](_0xef63('0x9'),_0x4998a1,_0x5247e9[_0xef63('0xe')][_0xef63('0x10')]);return _0xd19c1e(_0x5247e9[_0xef63('0xe')][_0xef63('0x10')]);}else{logger[_0xef63('0x8')](_0xef63('0x9'),_0x4998a1,'request\x20sent');_0xd19c1e(_0x5247e9[_0xef63('0x11')]['message']);}})[_0xef63('0x12')](function(_0x163e87){logger[_0xef63('0xe')](_0xef63('0x9'),_0x4998a1,_0x163e87);_0x59d5c4(_0x163e87);});});}exports[_0xef63('0x13')]=function(_0x430bfc){var _0x2b294e=this;return new Promise(function(_0xb37e4e,_0x24f4cb){return db[_0xef63('0x14')][_0xef63('0x15')](_0x430bfc[_0xef63('0x16')],{'raw':_0x430bfc['options']?_0x430bfc[_0xef63('0x17')][_0xef63('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x1c9c4c){logger[_0xef63('0x8')]('CreateChatQueueReport',_0x430bfc);logger[_0xef63('0xb')](_0xef63('0x13'),_0x430bfc,JSON['stringify'](_0x1c9c4c));_0xb37e4e(_0x1c9c4c);})[_0xef63('0x12')](function(_0x701b5c){logger[_0xef63('0xe')]('CreateChatQueueReport',_0x701b5c['message'],_0x430bfc);_0x24f4cb(_0x2b294e[_0xef63('0xe')](0x1f4,_0x701b5c[_0xef63('0x10')]));});});};exports[_0xef63('0x19')]=function(_0x10a573){var _0xa63ced=this;return new Promise(function(_0x270256,_0x5497e5){return db['ChatQueueReport'][_0xef63('0x1a')](_0x10a573[_0xef63('0x16')],{'raw':_0x10a573['options']?_0x10a573[_0xef63('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10a573[_0xef63('0x17')]?_0x10a573['options']['where']||null:null,'attributes':_0x10a573[_0xef63('0x17')]?_0x10a573[_0xef63('0x17')]['attributes']||null:null,'limit':_0x10a573['options']?_0x10a573[_0xef63('0x17')][_0xef63('0x1b')]||null:null})[_0xef63('0x1c')](function(_0x1ce3f8){logger[_0xef63('0x8')](_0xef63('0x19'),_0x10a573);logger[_0xef63('0xb')](_0xef63('0x19'),_0x10a573,JSON[_0xef63('0xd')](_0x1ce3f8));_0x270256(_0x1ce3f8);})[_0xef63('0x12')](function(_0x4f913b){logger[_0xef63('0xe')](_0xef63('0x19'),_0x4f913b[_0xef63('0x10')],_0x10a573);_0x5497e5(_0xa63ced[_0xef63('0xe')](0x1f4,_0x4f913b[_0xef63('0x10')]));});});};
\ No newline at end of file
index 26dd3ca..6c01491 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab90=['/:id','show','post','create','put','update','destroy','exports','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','get','/describe','describe'];(function(_0x14de91,_0x18abe0){var _0x46fee0=function(_0x535e04){while(--_0x535e04){_0x14de91['push'](_0x14de91['shift']());}};_0x46fee0(++_0x18abe0);}(_0xab90,0xb3));var _0x0ab9=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xab90[_0xa148b7];return _0x51efd3;};'use strict';var multer=require(_0x0ab9('0x0'));var util=require(_0x0ab9('0x1'));var path=require('path');var timeout=require(_0x0ab9('0x2'));var express=require('express');var router=express[_0x0ab9('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0ab9('0x4'));var config=require(_0x0ab9('0x5'));var controller=require(_0x0ab9('0x6'));router['get']('/',auth[_0x0ab9('0x7')](),controller['index']);router[_0x0ab9('0x8')](_0x0ab9('0x9'),auth['isAuthenticated'](),controller[_0x0ab9('0xa')]);router[_0x0ab9('0x8')](_0x0ab9('0xb'),auth[_0x0ab9('0x7')](),controller[_0x0ab9('0xc')]);router[_0x0ab9('0xd')]('/',auth[_0x0ab9('0x7')](),controller[_0x0ab9('0xe')]);router[_0x0ab9('0xf')](_0x0ab9('0xb'),auth['isAuthenticated'](),controller[_0x0ab9('0x10')]);router['delete'](_0x0ab9('0xb'),auth[_0x0ab9('0x7')](),controller[_0x0ab9('0x11')]);module[_0x0ab9('0x12')]=router;
\ No newline at end of file
+var _0x9906=['put','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','create'];(function(_0x55d143,_0x4836e2){var _0x29c2f7=function(_0xa65606){while(--_0xa65606){_0x55d143['push'](_0x55d143['shift']());}};_0x29c2f7(++_0x4836e2);}(_0x9906,0x11c));var _0x6990=function(_0x15fdf2,_0x172680){_0x15fdf2=_0x15fdf2-0x0;var _0x1eff96=_0x9906[_0x15fdf2];return _0x1eff96;};'use strict';var multer=require(_0x6990('0x0'));var util=require('util');var path=require(_0x6990('0x1'));var timeout=require('connect-timeout');var express=require(_0x6990('0x2'));var router=express[_0x6990('0x3')]();var fs_extra=require(_0x6990('0x4'));var auth=require(_0x6990('0x5'));var interaction=require(_0x6990('0x6'));var config=require(_0x6990('0x7'));var controller=require(_0x6990('0x8'));router[_0x6990('0x9')]('/',auth[_0x6990('0xa')](),controller[_0x6990('0xb')]);router[_0x6990('0x9')](_0x6990('0xc'),auth['isAuthenticated'](),controller[_0x6990('0xd')]);router[_0x6990('0x9')](_0x6990('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x6990('0xa')](),controller[_0x6990('0xf')]);router[_0x6990('0x10')]('/:id',auth[_0x6990('0xa')](),controller[_0x6990('0x11')]);router[_0x6990('0x12')](_0x6990('0xe'),auth['isAuthenticated'](),controller[_0x6990('0x13')]);module['exports']=router;
\ No newline at end of file
index f2eb3ad..e669b1e 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(_0x2fe767,_0x2d37e4){var _0x341e44=function(_0x32aa7f){while(--_0x32aa7f){_0x2fe767['push'](_0x2fe767['shift']());}};_0x341e44(++_0x2d37e4);}(_0xedd9,0xfc));var _0x9edd=function(_0x56092a,_0x291ce5){_0x56092a=_0x56092a-0x0;var _0x1c9558=_0xedd9[_0x56092a];return _0x1c9558;};'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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x16fdcb,_0x46f499){var _0x42cd8c=function(_0xff5574){while(--_0xff5574){_0x16fdcb['push'](_0x16fdcb['shift']());}};_0x42cd8c(++_0x46f499);}(_0x00bb,0x1d8));var _0xb00b=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x00bb[_0x433a86];return _0x23000c;};'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
index 786db5e..46d643c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0472=['lodash','squel','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','ChatTransferReport','rawAttributes','fieldName','type','map','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','filter','options','include','rows','show','params','includeAll','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra'];(function(_0x48a366,_0x66ca83){var _0x5664f0=function(_0xeada7d){while(--_0xeada7d){_0x48a366['push'](_0x48a366['shift']());}};_0x5664f0(++_0x66ca83);}(_0x0472,0x1a5));var _0x2047=function(_0x1addc8,_0x3061e9){_0x1addc8=_0x1addc8-0x0;var _0x1ecfa7=_0x0472[_0x1addc8];return _0x1ecfa7;};'use strict';var emlformat=require(_0x2047('0x0'));var rimraf=require(_0x2047('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2047('0x2'));var rp=require(_0x2047('0x3'));var moment=require(_0x2047('0x4'));var BPromise=require(_0x2047('0x5'));var Mustache=require(_0x2047('0x6'));var util=require(_0x2047('0x7'));var path=require(_0x2047('0x8'));var sox=require(_0x2047('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2047('0xa'));var _=require(_0x2047('0xb'));var squel=require(_0x2047('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2047('0xd'));var querystring=require(_0x2047('0xe'));var Papa=require(_0x2047('0xf'));var Redis=require(_0x2047('0x10'));var authService=require(_0x2047('0x11'));var qs=require(_0x2047('0x12'));var as=require(_0x2047('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2047('0x14'))(_0x2047('0x15'));var utils=require(_0x2047('0x16'));var config=require(_0x2047('0x17'));var licenseUtil=require(_0x2047('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x272842,_0x749e95){_0x749e95=_0x749e95||0xcc;return function(_0x361fde){if(_0x361fde){return _0x272842[_0x2047('0x19')](_0x749e95);}return _0x272842[_0x2047('0x1a')](_0x749e95)['end']();};}function respondWithResult(_0x38a45e,_0x539d1e){_0x539d1e=_0x539d1e||0xc8;return function(_0x32d748){if(_0x32d748){return _0x38a45e[_0x2047('0x1a')](_0x539d1e)[_0x2047('0x1b')](_0x32d748);}};}function respondWithFilteredResult(_0x6ec360,_0x1c2d2f){return function(_0x2aa88e){if(_0x2aa88e){var _0x53941d=typeof _0x1c2d2f[_0x2047('0x1c')]===_0x2047('0x1d')&&typeof _0x1c2d2f[_0x2047('0x1e')]===_0x2047('0x1d');var _0x4b283e=_0x2aa88e[_0x2047('0x1f')];var _0x51dae5=_0x53941d?0x0:_0x1c2d2f[_0x2047('0x1c')];var _0x2a08ce=_0x53941d?_0x2aa88e[_0x2047('0x1f')]:_0x1c2d2f['offset']+_0x1c2d2f[_0x2047('0x1e')];var _0x3abe75;if(_0x2a08ce>=_0x4b283e){_0x2a08ce=_0x4b283e;_0x3abe75=0xc8;}else{_0x3abe75=0xce;}_0x6ec360[_0x2047('0x1a')](_0x3abe75);return _0x6ec360[_0x2047('0x20')](_0x2047('0x21'),_0x51dae5+'-'+_0x2a08ce+'/'+_0x4b283e)[_0x2047('0x1b')](_0x2aa88e);}return null;};}function patchUpdates(_0x51f361){return function(_0x16b2a1){try{jsonpatch[_0x2047('0x22')](_0x16b2a1,_0x51f361,!![]);}catch(_0x1f36d2){return BPromise[_0x2047('0x23')](_0x1f36d2);}return _0x16b2a1[_0x2047('0x24')]();};}function saveUpdates(_0x11487e,_0x32c094){return function(_0x8bb2de){if(_0x8bb2de){return _0x8bb2de[_0x2047('0x25')](_0x11487e)[_0x2047('0x26')](function(_0x4e029d){return _0x4e029d;});}return null;};}function removeEntity(_0x2f3395,_0x25cb14){return function(_0x180e21){if(_0x180e21){return _0x180e21['destroy']()[_0x2047('0x26')](function(){_0x2f3395['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x202bd4,_0x32aee4){return function(_0x56840f){if(!_0x56840f){_0x202bd4['sendStatus'](0x194);}return _0x56840f;};}function handleError(_0x17b85c,_0x4ba1d2){_0x4ba1d2=_0x4ba1d2||0x1f4;return function(_0x544673){logger[_0x2047('0x27')](_0x544673['stack']);if(_0x544673[_0x2047('0x28')]){delete _0x544673['name'];}_0x17b85c['status'](_0x4ba1d2)['send'](_0x544673);};}exports['index']=function(_0x20a61f,_0x145d3d){var _0x491f8a={},_0x464e5b={},_0x5c9ce1={'count':0x0,'rows':[]};var _0x1de0f2=_['map'](db[_0x2047('0x29')][_0x2047('0x2a')],function(_0x56f18f){return{'name':_0x56f18f[_0x2047('0x2b')],'type':_0x56f18f[_0x2047('0x2c')]['key']};});_0x464e5b['model']=_[_0x2047('0x2d')](_0x1de0f2,'name');_0x464e5b[_0x2047('0x2e')]=_[_0x2047('0x2f')](_0x20a61f[_0x2047('0x2e')]);_0x464e5b['filters']=_['intersection'](_0x464e5b[_0x2047('0x30')],_0x464e5b['query']);_0x491f8a[_0x2047('0x31')]=_[_0x2047('0x32')](_0x464e5b['model'],qs[_0x2047('0x33')](_0x20a61f['query']['fields']));_0x491f8a['attributes']=_0x491f8a['attributes'][_0x2047('0x34')]?_0x491f8a['attributes']:_0x464e5b[_0x2047('0x30')];if(!_0x20a61f[_0x2047('0x2e')][_0x2047('0x35')](_0x2047('0x36'))){_0x491f8a[_0x2047('0x1e')]=qs[_0x2047('0x1e')](_0x20a61f[_0x2047('0x2e')][_0x2047('0x1e')]);_0x491f8a[_0x2047('0x1c')]=qs[_0x2047('0x1c')](_0x20a61f[_0x2047('0x2e')][_0x2047('0x1c')]);}_0x491f8a[_0x2047('0x37')]=qs[_0x2047('0x38')](_0x20a61f['query'][_0x2047('0x38')]);_0x491f8a[_0x2047('0x39')]=qs[_0x2047('0x3a')](_['pick'](_0x20a61f[_0x2047('0x2e')],_0x464e5b[_0x2047('0x3a')]),_0x1de0f2);if(_0x20a61f[_0x2047('0x2e')]['filter']){_0x491f8a['where']=_[_0x2047('0x3b')](_0x491f8a[_0x2047('0x39')],{'$or':_[_0x2047('0x2d')](_0x1de0f2,function(_0x23b048){if(_0x23b048[_0x2047('0x2c')]!=='VIRTUAL'){var _0x2689be={};_0x2689be[_0x23b048[_0x2047('0x28')]]={'$like':'%'+_0x20a61f[_0x2047('0x2e')][_0x2047('0x3c')]+'%'};return _0x2689be;}})});}_0x491f8a=_[_0x2047('0x3b')]({},_0x491f8a,_0x20a61f[_0x2047('0x3d')]);var _0x2ee205={'where':_0x491f8a[_0x2047('0x39')]};return db[_0x2047('0x29')][_0x2047('0x1f')](_0x2ee205)[_0x2047('0x26')](function(_0x25b0c0){_0x5c9ce1[_0x2047('0x1f')]=_0x25b0c0;if(_0x20a61f[_0x2047('0x2e')]['includeAll']){_0x491f8a[_0x2047('0x3e')]=[{'all':!![]}];}return db[_0x2047('0x29')]['findAll'](_0x491f8a);})[_0x2047('0x26')](function(_0xf28300){_0x5c9ce1[_0x2047('0x3f')]=_0xf28300;return _0x5c9ce1;})[_0x2047('0x26')](respondWithFilteredResult(_0x145d3d,_0x491f8a))['catch'](handleError(_0x145d3d,null));};exports[_0x2047('0x40')]=function(_0x2e36e2,_0xc77543){var _0xe5f2a1={'raw':!![],'where':{'id':_0x2e36e2[_0x2047('0x41')]['id']}},_0x111113={};_0x111113[_0x2047('0x30')]=_[_0x2047('0x2f')](db[_0x2047('0x29')][_0x2047('0x2a')]);_0x111113[_0x2047('0x2e')]=_[_0x2047('0x2f')](_0x2e36e2[_0x2047('0x2e')]);_0x111113[_0x2047('0x3a')]=_[_0x2047('0x32')](_0x111113['model'],_0x111113[_0x2047('0x2e')]);_0xe5f2a1[_0x2047('0x31')]=_['intersection'](_0x111113['model'],qs[_0x2047('0x33')](_0x2e36e2[_0x2047('0x2e')]['fields']));_0xe5f2a1['attributes']=_0xe5f2a1[_0x2047('0x31')][_0x2047('0x34')]?_0xe5f2a1[_0x2047('0x31')]:_0x111113[_0x2047('0x30')];if(_0x2e36e2['query'][_0x2047('0x42')]){_0xe5f2a1[_0x2047('0x3e')]=[{'all':!![]}];}_0xe5f2a1=_[_0x2047('0x3b')]({},_0xe5f2a1,_0x2e36e2['options']);return db[_0x2047('0x29')][_0x2047('0x43')](_0xe5f2a1)['then'](handleEntityNotFound(_0xc77543,null))[_0x2047('0x26')](respondWithResult(_0xc77543,null))[_0x2047('0x44')](handleError(_0xc77543,null));};exports[_0x2047('0x45')]=function(_0x200090,_0x273705){return db[_0x2047('0x29')][_0x2047('0x45')](_0x200090[_0x2047('0x46')],{})['then'](respondWithResult(_0x273705,0xc9))[_0x2047('0x44')](handleError(_0x273705,null));};exports[_0x2047('0x25')]=function(_0x3da4ce,_0x5a9821){if(_0x3da4ce[_0x2047('0x46')]['id']){delete _0x3da4ce[_0x2047('0x46')]['id'];}return db[_0x2047('0x29')][_0x2047('0x43')]({'where':{'id':_0x3da4ce[_0x2047('0x41')]['id']}})[_0x2047('0x26')](handleEntityNotFound(_0x5a9821,null))[_0x2047('0x26')](saveUpdates(_0x3da4ce[_0x2047('0x46')],null))[_0x2047('0x26')](respondWithResult(_0x5a9821,null))[_0x2047('0x44')](handleError(_0x5a9821,null));};exports['destroy']=function(_0x414e22,_0x1621a5){return db[_0x2047('0x29')][_0x2047('0x43')]({'where':{'id':_0x414e22[_0x2047('0x41')]['id']}})[_0x2047('0x26')](handleEntityNotFound(_0x1621a5,null))['then'](removeEntity(_0x1621a5,null))[_0x2047('0x44')](handleError(_0x1621a5,null));};exports['describe']=function(_0x1e14ac,_0x12ae2f){return db[_0x2047('0x29')][_0x2047('0x47')]()[_0x2047('0x26')](respondWithResult(_0x12ae2f,null))[_0x2047('0x44')](handleError(_0x12ae2f,null));};
\ No newline at end of file
+var _0x40ce=['includeAll','find','create','body','describe','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','index','map','ChatTransferReport','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x40ce,0x1a3));var _0xe40c=function(_0x1d011f,_0x40f24e){_0x1d011f=_0x1d011f-0x0;var _0x27068c=_0x40ce[_0x1d011f];return _0x27068c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe40c('0x0'));var zipdir=require(_0xe40c('0x1'));var jsonpatch=require(_0xe40c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe40c('0x3'));var util=require(_0xe40c('0x4'));var path=require('path');var sox=require(_0xe40c('0x5'));var csv=require(_0xe40c('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe40c('0x7'));var _=require('lodash');var squel=require(_0xe40c('0x8'));var crypto=require(_0xe40c('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe40c('0xa'));var Papa=require(_0xe40c('0xb'));var Redis=require(_0xe40c('0xc'));var authService=require(_0xe40c('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xe40c('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe40c('0xf'))('api');var utils=require(_0xe40c('0x10'));var config=require(_0xe40c('0x11'));var licenseUtil=require(_0xe40c('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4bdb6c,_0x1bfa50){_0x1bfa50=_0x1bfa50||0xcc;return function(_0x2f3c2e){if(_0x2f3c2e){return _0x4bdb6c[_0xe40c('0x13')](_0x1bfa50);}return _0x4bdb6c[_0xe40c('0x14')](_0x1bfa50)['end']();};}function respondWithResult(_0x306328,_0x14f86a){_0x14f86a=_0x14f86a||0xc8;return function(_0x103e1e){if(_0x103e1e){return _0x306328[_0xe40c('0x14')](_0x14f86a)[_0xe40c('0x15')](_0x103e1e);}};}function respondWithFilteredResult(_0x4f8cb2,_0x10f36){return function(_0x24954e){if(_0x24954e){var _0x92f9b5=typeof _0x10f36['offset']===_0xe40c('0x16')&&typeof _0x10f36[_0xe40c('0x17')]===_0xe40c('0x16');var _0x29d706=_0x24954e['count'];var _0xe6d121=_0x92f9b5?0x0:_0x10f36['offset'];var _0x2728fc=_0x92f9b5?_0x24954e[_0xe40c('0x18')]:_0x10f36[_0xe40c('0x19')]+_0x10f36[_0xe40c('0x17')];var _0x373a2f;if(_0x2728fc>=_0x29d706){_0x2728fc=_0x29d706;_0x373a2f=0xc8;}else{_0x373a2f=0xce;}_0x4f8cb2[_0xe40c('0x14')](_0x373a2f);return _0x4f8cb2[_0xe40c('0x1a')](_0xe40c('0x1b'),_0xe6d121+'-'+_0x2728fc+'/'+_0x29d706)[_0xe40c('0x15')](_0x24954e);}return null;};}function patchUpdates(_0x5578af){return function(_0x116ec7){try{jsonpatch[_0xe40c('0x1c')](_0x116ec7,_0x5578af,!![]);}catch(_0x26faf8){return BPromise['reject'](_0x26faf8);}return _0x116ec7[_0xe40c('0x1d')]();};}function saveUpdates(_0x23ee03,_0x9f08cf){return function(_0x217cf5){if(_0x217cf5){return _0x217cf5[_0xe40c('0x1e')](_0x23ee03)[_0xe40c('0x1f')](function(_0x87685a){return _0x87685a;});}return null;};}function removeEntity(_0x1219c2,_0x13afb3){return function(_0x3231d1){if(_0x3231d1){return _0x3231d1[_0xe40c('0x20')]()['then'](function(){_0x1219c2[_0xe40c('0x14')](0xcc)[_0xe40c('0x21')]();});}};}function handleEntityNotFound(_0x32b87e,_0x623dfd){return function(_0x27a44f){if(!_0x27a44f){_0x32b87e[_0xe40c('0x13')](0x194);}return _0x27a44f;};}function handleError(_0x1b1e89,_0x2c3d2c){_0x2c3d2c=_0x2c3d2c||0x1f4;return function(_0x3cdd4a){logger[_0xe40c('0x22')](_0x3cdd4a[_0xe40c('0x23')]);if(_0x3cdd4a['name']){delete _0x3cdd4a[_0xe40c('0x24')];}_0x1b1e89[_0xe40c('0x14')](_0x2c3d2c)['send'](_0x3cdd4a);};}exports[_0xe40c('0x25')]=function(_0x4f97b3,_0x1af1b4){var _0x1d2a0a={},_0x1559e0={},_0x4c68f4={'count':0x0,'rows':[]};var _0x25e2b8=_[_0xe40c('0x26')](db[_0xe40c('0x27')]['rawAttributes'],function(_0x383677){return{'name':_0x383677[_0xe40c('0x28')],'type':_0x383677['type']['key']};});_0x1559e0[_0xe40c('0x29')]=_[_0xe40c('0x26')](_0x25e2b8,_0xe40c('0x24'));_0x1559e0[_0xe40c('0x2a')]=_['keys'](_0x4f97b3[_0xe40c('0x2a')]);_0x1559e0['filters']=_[_0xe40c('0x2b')](_0x1559e0[_0xe40c('0x29')],_0x1559e0[_0xe40c('0x2a')]);_0x1d2a0a[_0xe40c('0x2c')]=_[_0xe40c('0x2b')](_0x1559e0[_0xe40c('0x29')],qs[_0xe40c('0x2d')](_0x4f97b3['query']['fields']));_0x1d2a0a[_0xe40c('0x2c')]=_0x1d2a0a['attributes'][_0xe40c('0x2e')]?_0x1d2a0a[_0xe40c('0x2c')]:_0x1559e0['model'];if(!_0x4f97b3['query'][_0xe40c('0x2f')](_0xe40c('0x30'))){_0x1d2a0a[_0xe40c('0x17')]=qs[_0xe40c('0x17')](_0x4f97b3[_0xe40c('0x2a')][_0xe40c('0x17')]);_0x1d2a0a['offset']=qs['offset'](_0x4f97b3['query'][_0xe40c('0x19')]);}_0x1d2a0a['order']=qs[_0xe40c('0x31')](_0x4f97b3['query'][_0xe40c('0x31')]);_0x1d2a0a[_0xe40c('0x32')]=qs[_0xe40c('0x33')](_[_0xe40c('0x34')](_0x4f97b3['query'],_0x1559e0[_0xe40c('0x33')]),_0x25e2b8);if(_0x4f97b3[_0xe40c('0x2a')][_0xe40c('0x35')]){_0x1d2a0a[_0xe40c('0x32')]=_[_0xe40c('0x36')](_0x1d2a0a[_0xe40c('0x32')],{'$or':_[_0xe40c('0x26')](_0x25e2b8,function(_0x2f8271){if(_0x2f8271['type']!==_0xe40c('0x37')){var _0x4efcd2={};_0x4efcd2[_0x2f8271[_0xe40c('0x24')]]={'$like':'%'+_0x4f97b3['query'][_0xe40c('0x35')]+'%'};return _0x4efcd2;}})});}_0x1d2a0a=_[_0xe40c('0x36')]({},_0x1d2a0a,_0x4f97b3[_0xe40c('0x38')]);var _0x4b0f4f={'where':_0x1d2a0a[_0xe40c('0x32')]};return db[_0xe40c('0x27')][_0xe40c('0x18')](_0x4b0f4f)[_0xe40c('0x1f')](function(_0x3f396f){_0x4c68f4[_0xe40c('0x18')]=_0x3f396f;if(_0x4f97b3[_0xe40c('0x2a')]['includeAll']){_0x1d2a0a[_0xe40c('0x39')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xe40c('0x3a')](_0x1d2a0a);})[_0xe40c('0x1f')](function(_0x3e69cc){_0x4c68f4[_0xe40c('0x3b')]=_0x3e69cc;return _0x4c68f4;})[_0xe40c('0x1f')](respondWithFilteredResult(_0x1af1b4,_0x1d2a0a))[_0xe40c('0x3c')](handleError(_0x1af1b4,null));};exports[_0xe40c('0x3d')]=function(_0x1e3c2f,_0x4b85b4){var _0x5e6d03={'raw':!![],'where':{'id':_0x1e3c2f[_0xe40c('0x3e')]['id']}},_0x468566={};_0x468566['model']=_[_0xe40c('0x3f')](db[_0xe40c('0x27')]['rawAttributes']);_0x468566['query']=_[_0xe40c('0x3f')](_0x1e3c2f[_0xe40c('0x2a')]);_0x468566['filters']=_[_0xe40c('0x2b')](_0x468566['model'],_0x468566[_0xe40c('0x2a')]);_0x5e6d03['attributes']=_[_0xe40c('0x2b')](_0x468566[_0xe40c('0x29')],qs[_0xe40c('0x2d')](_0x1e3c2f[_0xe40c('0x2a')][_0xe40c('0x2d')]));_0x5e6d03['attributes']=_0x5e6d03['attributes']['length']?_0x5e6d03[_0xe40c('0x2c')]:_0x468566[_0xe40c('0x29')];if(_0x1e3c2f[_0xe40c('0x2a')][_0xe40c('0x40')]){_0x5e6d03[_0xe40c('0x39')]=[{'all':!![]}];}_0x5e6d03=_['merge']({},_0x5e6d03,_0x1e3c2f['options']);return db[_0xe40c('0x27')][_0xe40c('0x41')](_0x5e6d03)[_0xe40c('0x1f')](handleEntityNotFound(_0x4b85b4,null))[_0xe40c('0x1f')](respondWithResult(_0x4b85b4,null))[_0xe40c('0x3c')](handleError(_0x4b85b4,null));};exports[_0xe40c('0x42')]=function(_0x505159,_0x51aebd){return db['ChatTransferReport'][_0xe40c('0x42')](_0x505159[_0xe40c('0x43')],{})[_0xe40c('0x1f')](respondWithResult(_0x51aebd,0xc9))['catch'](handleError(_0x51aebd,null));};exports[_0xe40c('0x1e')]=function(_0x120ada,_0x4be3d4){if(_0x120ada[_0xe40c('0x43')]['id']){delete _0x120ada[_0xe40c('0x43')]['id'];}return db[_0xe40c('0x27')]['find']({'where':{'id':_0x120ada['params']['id']}})[_0xe40c('0x1f')](handleEntityNotFound(_0x4be3d4,null))['then'](saveUpdates(_0x120ada[_0xe40c('0x43')],null))[_0xe40c('0x1f')](respondWithResult(_0x4be3d4,null))[_0xe40c('0x3c')](handleError(_0x4be3d4,null));};exports[_0xe40c('0x20')]=function(_0x287f28,_0x61eff9){return db[_0xe40c('0x27')][_0xe40c('0x41')]({'where':{'id':_0x287f28[_0xe40c('0x3e')]['id']}})[_0xe40c('0x1f')](handleEntityNotFound(_0x61eff9,null))[_0xe40c('0x1f')](removeEntity(_0x61eff9,null))[_0xe40c('0x3c')](handleError(_0x61eff9,null));};exports[_0xe40c('0x44')]=function(_0x3dc67c,_0x3be907){return db[_0xe40c('0x27')]['describe']()[_0xe40c('0x1f')](respondWithResult(_0x3be907,null))[_0xe40c('0x3c')](handleError(_0x3be907,null));};
\ No newline at end of file
index 7b32a80..54210cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4921=['exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','request-promise','path','rimraf','./chatTransferReport.attributes'];(function(_0x1d81ef,_0x5e02f0){var _0x2931ba=function(_0x1f8473){while(--_0x1f8473){_0x1d81ef['push'](_0x1d81ef['shift']());}};_0x2931ba(++_0x5e02f0);}(_0x4921,0xa0));var _0x1492=function(_0x2daef6,_0xcac228){_0x2daef6=_0x2daef6-0x0;var _0x62d030=_0x4921[_0x2daef6];return _0x62d030;};'use strict';var _=require(_0x1492('0x0'));var util=require(_0x1492('0x1'));var logger=require(_0x1492('0x2'))(_0x1492('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1492('0x4'));var fs=require('fs');var path=require(_0x1492('0x5'));var rimraf=require(_0x1492('0x6'));var config=require('../../config/environment');var attributes=require(_0x1492('0x7'));module[_0x1492('0x8')]=function(_0x321385,_0x52e02c){return _0x321385['define'](_0x1492('0x9'),attributes,{'tableName':_0x1492('0xa'),'paranoid':![],'indexes':[{'name':_0x1492('0xb'),'fields':[_0x1492('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x47d0=['moment','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger','api'];(function(_0x5496ce,_0x1e672b){var _0x2f4057=function(_0x38b925){while(--_0x38b925){_0x5496ce['push'](_0x5496ce['shift']());}};_0x2f4057(++_0x1e672b);}(_0x47d0,0x1cb));var _0x047d=function(_0x484c14,_0x137a08){_0x484c14=_0x484c14-0x0;var _0x2d5bb9=_0x47d0[_0x484c14];return _0x2d5bb9;};'use strict';var _=require('lodash');var util=require(_0x047d('0x0'));var logger=require(_0x047d('0x1'))(_0x047d('0x2'));var moment=require(_0x047d('0x3'));var BPromise=require('bluebird');var rp=require(_0x047d('0x4'));var fs=require('fs');var path=require(_0x047d('0x5'));var rimraf=require(_0x047d('0x6'));var config=require(_0x047d('0x7'));var attributes=require(_0x047d('0x8'));module[_0x047d('0x9')]=function(_0x388f83,_0x3d118d){return _0x388f83[_0x047d('0xa')](_0x047d('0xb'),attributes,{'tableName':_0x047d('0xc'),'paranoid':![],'indexes':[{'name':_0x047d('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 078f884..1e2fd0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4253=['message','ChatTransferReport,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code'];(function(_0xf0f6c7,_0x1de992){var _0x3ba4b3=function(_0x41a0de){while(--_0x41a0de){_0xf0f6c7['push'](_0xf0f6c7['shift']());}};_0x3ba4b3(++_0x1de992);}(_0x4253,0x7a));var _0x3425=function(_0x2cc5ae,_0x4f1bc1){_0x2cc5ae=_0x2cc5ae-0x0;var _0xdffed7=_0x4253[_0x2cc5ae];return _0xdffed7;};'use strict';var _=require(_0x3425('0x0'));var util=require(_0x3425('0x1'));var moment=require(_0x3425('0x2'));var BPromise=require(_0x3425('0x3'));var rs=require(_0x3425('0x4'));var fs=require('fs');var Redis=require(_0x3425('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3425('0x6'))(_0x3425('0x7'));var config=require('../../config/environment');var jayson=require(_0x3425('0x8'));var client=jayson[_0x3425('0x9')][_0x3425('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x297486,_0xc10fad,_0xe4de64){return new BPromise(function(_0x3f0521,_0xd89b22){return client[_0x3425('0xb')](_0x297486,_0xe4de64)[_0x3425('0xc')](function(_0x3df6d8){logger[_0x3425('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0xc10fad,_0x3425('0xe'));logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0xc10fad,'request\x20sent',JSON[_0x3425('0xf')](_0x3df6d8));if(_0x3df6d8[_0x3425('0x10')]){if(_0x3df6d8['error'][_0x3425('0x11')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0xc10fad,_0x3df6d8[_0x3425('0x10')]['message']);return _0xd89b22(_0x3df6d8[_0x3425('0x10')][_0x3425('0x12')]);}logger[_0x3425('0x10')](_0x3425('0x13'),_0xc10fad,_0x3df6d8['error'][_0x3425('0x12')]);return _0x3f0521(_0x3df6d8['error']['message']);}else{logger['info'](_0x3425('0x13'),_0xc10fad,_0x3425('0xe'));_0x3f0521(_0x3df6d8['result'][_0x3425('0x12')]);}})['catch'](function(_0x53df9a){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0xc10fad,_0x53df9a);_0xd89b22(_0x53df9a);});});}
\ No newline at end of file
+var _0x9092=['client','http','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x9092,0xf3));var _0x2909=function(_0x2a1f15,_0x22b8bb){_0x2a1f15=_0x2a1f15-0x0;var _0xc61205=_0x9092[_0x2a1f15];return _0xc61205;};'use strict';var _=require(_0x2909('0x0'));var util=require(_0x2909('0x1'));var moment=require('moment');var BPromise=require(_0x2909('0x2'));var rs=require(_0x2909('0x3'));var fs=require('fs');var Redis=require(_0x2909('0x4'));var db=require(_0x2909('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2909('0x6'))(_0x2909('0x7'));var config=require('../../config/environment');var jayson=require(_0x2909('0x8'));var client=jayson[_0x2909('0x9')][_0x2909('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30d692,_0x470a39,_0x1972d2){return new BPromise(function(_0x5bd198,_0x1cd242){return client['request'](_0x30d692,_0x1972d2)[_0x2909('0xb')](function(_0x5bb118){logger['info'](_0x2909('0xc'),_0x470a39,_0x2909('0xd'));logger[_0x2909('0xe')](_0x2909('0xf'),_0x470a39,_0x2909('0xd'),JSON[_0x2909('0x10')](_0x5bb118));if(_0x5bb118[_0x2909('0x11')]){if(_0x5bb118[_0x2909('0x11')]['code']===0x1f4){logger[_0x2909('0x11')](_0x2909('0xc'),_0x470a39,_0x5bb118[_0x2909('0x11')][_0x2909('0x12')]);return _0x1cd242(_0x5bb118[_0x2909('0x11')][_0x2909('0x12')]);}logger[_0x2909('0x11')](_0x2909('0xc'),_0x470a39,_0x5bb118[_0x2909('0x11')][_0x2909('0x12')]);return _0x5bd198(_0x5bb118[_0x2909('0x11')][_0x2909('0x12')]);}else{logger['info'](_0x2909('0xc'),_0x470a39,_0x2909('0xd'));_0x5bd198(_0x5bb118[_0x2909('0x13')][_0x2909('0x12')]);}})[_0x2909('0x14')](function(_0x2eb0ab){logger[_0x2909('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x470a39,_0x2eb0ab);_0x1cd242(_0x2eb0ab);});});}
\ No newline at end of file
index b80a66b..6faaf27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c03=['./chatTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x1676dc,_0x1a027b){var _0x3659d7=function(_0x5ace7f){while(--_0x5ace7f){_0x1676dc['push'](_0x1676dc['shift']());}};_0x3659d7(++_0x1a027b);}(_0x3c03,0xcb));var _0x33c0=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x3c03[_0x49ca18];return _0x145d54;};'use strict';var multer=require('multer');var util=require(_0x33c0('0x0'));var path=require('path');var timeout=require(_0x33c0('0x1'));var express=require(_0x33c0('0x2'));var router=express['Router']();var fs_extra=require(_0x33c0('0x3'));var auth=require(_0x33c0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x33c0('0x5'));var controller=require(_0x33c0('0x6'));router[_0x33c0('0x7')]('/',auth[_0x33c0('0x8')](),controller[_0x33c0('0x9')]);router[_0x33c0('0x7')](_0x33c0('0xa'),auth[_0x33c0('0x8')](),controller['describe']);router[_0x33c0('0x7')](_0x33c0('0xb'),auth[_0x33c0('0x8')](),controller[_0x33c0('0xc')]);router[_0x33c0('0xd')]('/',auth[_0x33c0('0x8')](),controller[_0x33c0('0xe')]);router[_0x33c0('0xf')](_0x33c0('0xb'),auth[_0x33c0('0x8')](),controller['update']);router[_0x33c0('0x10')](_0x33c0('0xb'),auth[_0x33c0('0x8')](),controller[_0x33c0('0x11')]);module[_0x33c0('0x12')]=router;
\ No newline at end of file
+var _0x4d07=['isAuthenticated','post','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','/describe','describe','/:id'];(function(_0x1df926,_0x2e903b){var _0x2aee5d=function(_0x3c09ef){while(--_0x3c09ef){_0x1df926['push'](_0x1df926['shift']());}};_0x2aee5d(++_0x2e903b);}(_0x4d07,0x1e2));var _0x74d0=function(_0x1256f7,_0x3e93fe){_0x1256f7=_0x1256f7-0x0;var _0x450597=_0x4d07[_0x1256f7];return _0x450597;};'use strict';var multer=require('multer');var util=require(_0x74d0('0x0'));var path=require(_0x74d0('0x1'));var timeout=require('connect-timeout');var express=require(_0x74d0('0x2'));var router=express[_0x74d0('0x3')]();var fs_extra=require(_0x74d0('0x4'));var auth=require(_0x74d0('0x5'));var interaction=require(_0x74d0('0x6'));var config=require('../../config/environment');var controller=require(_0x74d0('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x74d0('0x8')](_0x74d0('0x9'),auth['isAuthenticated'](),controller[_0x74d0('0xa')]);router['get'](_0x74d0('0xb'),auth[_0x74d0('0xc')](),controller['show']);router[_0x74d0('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x74d0('0xe')]('/:id',auth[_0x74d0('0xc')](),controller[_0x74d0('0xf')]);router[_0x74d0('0x10')](_0x74d0('0xb'),auth[_0x74d0('0xc')](),controller[_0x74d0('0x11')]);module[_0x74d0('0x12')]=router;
\ No newline at end of file
index 1e179e4..0afc066 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1429=['#fafafa','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','rounded','Chat','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','input','name','text','onlineForm','parse','stringify','Comments','Leave\x20your\x20comments','getDataValue','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right'];(function(_0x59676f,_0x205f4a){var _0x355160=function(_0x4b1e94){while(--_0x4b1e94){_0x59676f['push'](_0x59676f['shift']());}};_0x355160(++_0x205f4a);}(_0x1429,0xcf));var _0x9142=function(_0x113124,_0x2d3bc6){_0x113124=_0x113124-0x0;var _0x205781=_0x1429[_0x113124];return _0x205781;};'use strict';var Sequelize=require(_0x9142('0x0'));var rs=require(_0x9142('0x1'));module[_0x9142('0x2')]={'name':{'type':Sequelize[_0x9142('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x9142('0x3')],'allowNull':![],'unique':_0x9142('0x4')},'description':{'type':Sequelize[_0x9142('0x3')]},'mapKey':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0x5')},'mapKeyOffline':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0x5')},'key':{'type':Sequelize[_0x9142('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x9142('0x3')],'allowNull':![],'defaultValue':_0x9142('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x9142('0x3')],'allowNull':![],'defaultValue':_0x9142('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9142('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x9142('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x9142('0xa')](_0x9142('0xb'),'squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x9142('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x9142('0xc')},'offline_chat_button':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0xd')},'header_offline':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0xe')},'download_transcript':{'type':Sequelize[_0x9142('0xf')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x9142('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x9142('0xf')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x9142('0x11')]},'closingQuestion':{'type':Sequelize[_0x9142('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9142('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x9142('0x13')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0x14')},'closingMessageButton':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0xd')},'skipMessageButton':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0x15')},'conditionAgreement':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x9142('0x16')},'ratingType':{'type':Sequelize['ENUM'](_0x9142('0x17'),_0x9142('0x18')),'defaultValue':_0x9142('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x9142('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x9142('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x9142('0x19'),'variable':null,'config':{'placeholder':_0x9142('0x1a'),'type':_0x9142('0x1b'),'required':!![]},'props':{'title':_0x9142('0x1a'),'helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x9142('0x5'),'type':_0x9142('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x9142('0x1c'))?JSON[_0x9142('0x1d')](this['getDataValue'](_0x9142('0x1c'))):{};},'set':function(_0x25ca11){return this['setDataValue']('onlineForm',JSON[_0x9142('0x1e')](_0x25ca11));}},'offlineForm':{'type':Sequelize[_0x9142('0x11')],'defaultValue':function(){return JSON[_0x9142('0x1e')]({'items':[{'type':_0x9142('0x19'),'props':{'title':_0x9142('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x9142('0x5'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0x9142('0x1f'),'helpText':_0x9142('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x9142('0x21')](_0x9142('0x22'))?JSON['parse'](this['getDataValue'](_0x9142('0x22'))):{};},'set':function(_0x2d5d28){return this['setDataValue'](_0x9142('0x22'),JSON[_0x9142('0x1e')](_0x2d5d28));}},'token':{'type':Sequelize[_0x9142('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x9142('0xf')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x9142('0x3')]},'forwardOffline':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x9142('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x9142('0x23')},'waitingMessage':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0x25')},'offlineMessageBody':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x9142('0xf')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0x27')},'skipUnmanaged':{'type':Sequelize[_0x9142('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x9142('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x9142('0x3')]},'notificationTemplate':{'type':Sequelize[_0x9142('0x11')],'defaultValue':function(){return _0x9142('0x28');}},'notificationSound':{'type':Sequelize[_0x9142('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0x29')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x9142('0x2a')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x9142('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x9142('0x11')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x9142('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x9142('0x3')],'allowNull':![],'defaultValue':_0x9142('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9142('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9142('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x9142('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9142('0x9')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![],'comment':_0x9142('0x2c'),'set':function(_0x2e3312){if(!_0x2e3312)this['setDataValue'](_0x9142('0x2d'),null);this[_0x9142('0x2e')](_0x9142('0x2f'),_0x2e3312);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x9142('0x3')],'allowNull':![],'defaultValue':_0x9142('0x30')},'vidaooNote':{'type':Sequelize[_0x9142('0x3')],'defaultValue':function(){return _0x9142('0x31');}},'vidaooMetadata':{'type':Sequelize[_0x9142('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x9142('0x11')]}};
\ No newline at end of file
+var _0x556d=['mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','BOOLEAN','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Skip','Feedback','thumb','star','input','name','text','getDataValue','onlineForm','setDataValue','stringify','Comments','Leave\x20your\x20comments','offlineForm','parse','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','Your\x20request\x20has\x20not\x20been\x20processed.','Send','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId'];(function(_0x113696,_0x1843cc){var _0x1fb234=function(_0x5f1185){while(--_0x5f1185){_0x113696['push'](_0x113696['shift']());}};_0x1fb234(++_0x1843cc);}(_0x556d,0x17d));var _0xd556=function(_0x4a7f34,_0x21c40a){_0x4a7f34=_0x4a7f34-0x0;var _0x542ed1=_0x556d[_0x4a7f34];return _0x542ed1;};'use strict';var Sequelize=require(_0xd556('0x0'));var rs=require(_0xd556('0x1'));module[_0xd556('0x2')]={'name':{'type':Sequelize[_0xd556('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xd556('0x3')],'allowNull':![],'unique':_0xd556('0x4')},'description':{'type':Sequelize[_0xd556('0x3')]},'mapKey':{'type':Sequelize[_0xd556('0x3')],'defaultValue':_0xd556('0x5')},'mapKeyOffline':{'type':Sequelize[_0xd556('0x3')],'defaultValue':_0xd556('0x5')},'key':{'type':Sequelize[_0xd556('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xd556('0x6')},'customerAlias':{'type':Sequelize[_0xd556('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xd556('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xd556('0x3')],'allowNull':![],'defaultValue':_0xd556('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd556('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xd556('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xd556('0x9')](_0xd556('0xa'),_0xd556('0xb')),'defaultValue':_0xd556('0xa')},'header_online':{'type':Sequelize[_0xd556('0x3')],'defaultValue':_0xd556('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xd556('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xd556('0xe')},'download_transcript':{'type':Sequelize[_0xd556('0xf')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xd556('0x10')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xd556('0x3')],'defaultValue':_0xd556('0x11')},'defaultWhiteLabel':{'type':Sequelize[_0xd556('0xf')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xd556('0x12')]},'closingQuestion':{'type':Sequelize[_0xd556('0x3')],'defaultValue':_0xd556('0x13')},'formSubmitSuccessMessage':{'type':Sequelize[_0xd556('0x3')],'defaultValue':_0xd556('0x14')},'formSubmitFailureMessage':{'type':Sequelize[_0xd556('0x3')],'defaultValue':_0xd556('0x15')},'noteTitle':{'type':Sequelize[_0xd556('0x3')],'defaultValue':_0xd556('0x16')},'placeholderMessage':{'type':Sequelize[_0xd556('0x3')],'defaultValue':_0xd556('0x17')},'closingMessage':{'type':Sequelize[_0xd556('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xd556('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xd556('0x3')],'defaultValue':_0xd556('0x18')},'conditionAgreement':{'type':Sequelize[_0xd556('0xf')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xd556('0xf')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xd556('0xf')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xd556('0xf')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xd556('0x19')},'ratingType':{'type':Sequelize[_0xd556('0x9')]('star',_0xd556('0x1a')),'defaultValue':_0xd556('0x1b')},'ratingStarsNumber':{'type':Sequelize[_0xd556('0x10')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xd556('0x12')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xd556('0x1c'),'variable':null,'config':{'placeholder':_0xd556('0x1d'),'type':_0xd556('0x1e'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':_0xd556('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xd556('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xd556('0x1f')]('onlineForm')?JSON['parse'](this[_0xd556('0x1f')](_0xd556('0x20'))):{};},'set':function(_0x2f9610){return this[_0xd556('0x21')](_0xd556('0x20'),JSON['stringify'](_0x2f9610));}},'offlineForm':{'type':Sequelize[_0xd556('0x12')],'defaultValue':function(){return JSON[_0xd556('0x22')]({'items':[{'type':_0xd556('0x1c'),'props':{'title':_0xd556('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xd556('0x5'),'type':_0xd556('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0xd556('0x23')},'props':{'title':'Comments','helpText':_0xd556('0x24')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xd556('0x25'))?JSON[_0xd556('0x26')](this['getDataValue'](_0xd556('0x25'))):{};},'set':function(_0x503c23){return this['setDataValue']('offlineForm',JSON[_0xd556('0x22')](_0x503c23));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xd556('0x27')]();}},'autoclose':{'type':Sequelize[_0xd556('0xf')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xd556('0xf')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xd556('0x3')]},'forwardOffline':{'type':Sequelize[_0xd556('0xf')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xd556('0x3')],'defaultValue':_0xd556('0x28')},'waitingMessage':{'type':Sequelize[_0xd556('0x3')],'defaultValue':_0xd556('0x29')},'offlineMessageSubject':{'type':Sequelize[_0xd556('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xd556('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xd556('0x3')],'defaultValue':_0xd556('0x2a')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xd556('0x3')],'defaultValue':_0xd556('0x2b')},'enableCustomerAttachment':{'type':Sequelize[_0xd556('0xf')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xd556('0x12')]},'showAgentAvatar':{'type':Sequelize[_0xd556('0xf')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xd556('0x3')]},'notificationTemplate':{'type':Sequelize[_0xd556('0x12')],'defaultValue':function(){return _0xd556('0x2c');}},'notificationSound':{'type':Sequelize[_0xd556('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd556('0xf')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xd556('0xf')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0xd556('0x2d')},'waitForTheAssignedAgent':{'type':Sequelize[_0xd556('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xd556('0x2e')},'verticalAlignment':{'type':Sequelize[_0xd556('0x10')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xd556('0x2f')},'defaultTitle':{'type':Sequelize[_0xd556('0x3')]},'customerAvatar':{'type':Sequelize[_0xd556('0x12')]},'showCustomerAvatar':{'type':Sequelize[_0xd556('0xf')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xd556('0x10')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xd556('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd556('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd556('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd556('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xd556('0x3')],'defaultValue':_0xd556('0x30')},'systemAvatar':{'type':Sequelize[_0xd556('0x12')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd556('0x10')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xd556('0xf')],'defaultValue':![],'comment':_0xd556('0x31'),'set':function(_0x5ec3f5){if(!_0x5ec3f5)this[_0xd556('0x21')](_0xd556('0x32'),null);this[_0xd556('0x21')](_0xd556('0x33'),_0x5ec3f5);}},'vidaooEscalation':{'type':Sequelize[_0xd556('0xf')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xd556('0x3')]},'vidaooTopic':{'type':Sequelize[_0xd556('0x3')],'allowNull':![],'defaultValue':_0xd556('0x34')},'vidaooNote':{'type':Sequelize[_0xd556('0x3')],'defaultValue':function(){return _0xd556('0x35');}},'vidaooMetadata':{'type':Sequelize[_0xd556('0x12')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xd556('0x12')]}};
\ No newline at end of file
index 6d7b848..b700298 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcbcd=['addAvatar','addCustomerAvatar','customerAvatar','filename','addSystemAvatar','systemAvatar','file','join','root','getLicense','custom','existsSync','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','isNil','agentAvatar','server/files/images/avatars/','download','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','chat','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','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','Contacts','DESC','ChatApplication','Applications','account','list','applications','orderBy','asc','defaults','CmContact','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','close','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','CompanyId','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','subjectOffline','toPairsIn','mapValues','firstName','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','fullname','Tag','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','License','chatLicenseExceeded','push','x-real-ip','connection','remoteAddress','alignment','verticalAlignment','color','textColor','color_button','addApplications','findAndCountAll','priority','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','userChatWebsite:save','removeAgents','emit','userChatWebsite:remove','getAgents','eml-format','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/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','save','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','ChatWebsite','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','ChatWebsiteId','Disposition','getDispositions','findOne','include','removeDispositions','ids','getAnswers','CannedAnswer','order','removeAnswers','addLogo','sitepic'];(function(_0x257794,_0x38561d){var _0x2d3c13=function(_0x535307){while(--_0x535307){_0x257794['push'](_0x257794['shift']());}};_0x2d3c13(++_0x38561d);}(_0xcbcd,0x1f2));var _0xdcbc=function(_0x149ca0,_0x2ac7f5){_0x149ca0=_0x149ca0-0x0;var _0x56b6b9=_0xcbcd[_0x149ca0];return _0x56b6b9;};'use strict';var emlformat=require(_0xdcbc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdcbc('0x1'));var jsonpatch=require(_0xdcbc('0x2'));var rp=require(_0xdcbc('0x3'));var moment=require(_0xdcbc('0x4'));var BPromise=require(_0xdcbc('0x5'));var Mustache=require(_0xdcbc('0x6'));var util=require(_0xdcbc('0x7'));var path=require(_0xdcbc('0x8'));var sox=require(_0xdcbc('0x9'));var csv=require(_0xdcbc('0xa'));var ejs=require(_0xdcbc('0xb'));var fs=require('fs');var fs_extra=require(_0xdcbc('0xc'));var _=require('lodash');var squel=require(_0xdcbc('0xd'));var crypto=require(_0xdcbc('0xe'));var jsforce=require(_0xdcbc('0xf'));var deskjs=require(_0xdcbc('0x10'));var toCsv=require(_0xdcbc('0xa'));var querystring=require(_0xdcbc('0x11'));var Papa=require(_0xdcbc('0x12'));var Redis=require(_0xdcbc('0x13'));var authService=require(_0xdcbc('0x14'));var qs=require(_0xdcbc('0x15'));var as=require(_0xdcbc('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdcbc('0x17'))('api');var utils=require(_0xdcbc('0x18'));var config=require(_0xdcbc('0x19'));var licenseUtil=require(_0xdcbc('0x1a'));var db=require('../../mysqldb')['db'];config[_0xdcbc('0x1b')]=_['defaults'](config[_0xdcbc('0x1b')],{'host':_0xdcbc('0x1c'),'port':0x18eb});var socket=require(_0xdcbc('0x1d'))(new Redis(config['redis']));require(_0xdcbc('0x1e'))[_0xdcbc('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0xdcbc('0x20')][_0xdcbc('0x21')]({'port':0x232c});var client9002=jayson[_0xdcbc('0x20')][_0xdcbc('0x21')]({'port':0x232a});var client9003=jayson[_0xdcbc('0x20')][_0xdcbc('0x21')]({'port':0x232b});var client9001=jayson[_0xdcbc('0x20')]['http']({'port':0x2329});function respondWithRpcPromise(_0xbdb1d7,_0x3aa1eb,_0x14169b,_0x3f760d){return new BPromise(function(_0x9b79e9,_0x2e355a){var _0x1a8dd6=_0x3f760d||client;return _0x1a8dd6[_0xdcbc('0x22')](_0xbdb1d7,_0x14169b)[_0xdcbc('0x23')](function(_0x141816){logger['info'](_0xdcbc('0x24'),_0x3aa1eb,_0xdcbc('0x25'));logger[_0xdcbc('0x26')](_0xdcbc('0x27'),_0x3aa1eb,_0xdcbc('0x25'),JSON[_0xdcbc('0x28')](_0x141816));if(_0x141816['error']){if(_0x141816['error'][_0xdcbc('0x29')]===0x1f4){logger[_0xdcbc('0x2a')](_0xdcbc('0x24'),_0x3aa1eb,_0x141816[_0xdcbc('0x2a')][_0xdcbc('0x2b')]);return _0x2e355a(_0x141816['error']['message']);}logger['error'](_0xdcbc('0x24'),_0x3aa1eb,_0x141816[_0xdcbc('0x2a')]['message']);return _0x9b79e9(_0x141816['error'][_0xdcbc('0x2b')]);}else{logger[_0xdcbc('0x2c')](_0xdcbc('0x24'),_0x3aa1eb,_0xdcbc('0x25'));_0x9b79e9(_0x141816['result'][_0xdcbc('0x2b')]);}})['catch'](function(_0x2275d1){logger[_0xdcbc('0x2a')](_0xdcbc('0x24'),_0x3aa1eb,_0x2275d1);_0x2e355a(_0x2275d1);});});}function respondWithStatusCode(_0x4f5edc,_0x2bda34){_0x2bda34=_0x2bda34||0xcc;return function(_0x21c0e3){if(_0x21c0e3){return _0x4f5edc[_0xdcbc('0x2d')](_0x2bda34);}return _0x4f5edc[_0xdcbc('0x2e')](_0x2bda34)[_0xdcbc('0x2f')]();};}function respondWithResult(_0x31b7bc,_0x3d5e57){_0x3d5e57=_0x3d5e57||0xc8;return function(_0x43c79b){if(_0x43c79b){return _0x31b7bc[_0xdcbc('0x2e')](_0x3d5e57)['json'](_0x43c79b);}};}function respondWithFilteredResult(_0x2ea5ec,_0x5487ab){return function(_0x364796){if(_0x364796){var _0x431e9e=typeof _0x5487ab[_0xdcbc('0x30')]==='undefined'&&typeof _0x5487ab[_0xdcbc('0x31')]===_0xdcbc('0x32');var _0x16230b=_0x364796[_0xdcbc('0x33')];var _0x1893f1=_0x431e9e?0x0:_0x5487ab[_0xdcbc('0x30')];var _0x4c5e76=_0x431e9e?_0x364796['count']:_0x5487ab['offset']+_0x5487ab[_0xdcbc('0x31')];var _0x2f7e9e;if(_0x4c5e76>=_0x16230b){_0x4c5e76=_0x16230b;_0x2f7e9e=0xc8;}else{_0x2f7e9e=0xce;}_0x2ea5ec[_0xdcbc('0x2e')](_0x2f7e9e);return _0x2ea5ec[_0xdcbc('0x34')]('Content-Range',_0x1893f1+'-'+_0x4c5e76+'/'+_0x16230b)[_0xdcbc('0x35')](_0x364796);}return null;};}function patchUpdates(_0x270cb8){return function(_0xe374be){try{jsonpatch[_0xdcbc('0x36')](_0xe374be,_0x270cb8,!![]);}catch(_0x327816){return BPromise['reject'](_0x327816);}return _0xe374be[_0xdcbc('0x37')]();};}function saveUpdates(_0x2a6202,_0x51e6b0){return function(_0x68f2b9){if(_0x68f2b9){return _0x68f2b9[_0xdcbc('0x38')](_0x2a6202)[_0xdcbc('0x23')](function(_0x873ec6){return _0x873ec6;});}return null;};}function removeEntity(_0x8844e4,_0x5ef776){return function(_0x6706b8){if(_0x6706b8){return _0x6706b8[_0xdcbc('0x39')]()[_0xdcbc('0x23')](function(){var _0x4d0faa=_0x6706b8[_0xdcbc('0x3a')]({'plain':!![]});var _0x50bb42=_0xdcbc('0x3b');return db[_0xdcbc('0x3c')][_0xdcbc('0x39')]({'where':{'type':_0x50bb42,'resourceId':_0x4d0faa['id']}})['then'](function(){return _0x6706b8;});})['then'](function(){_0x8844e4[_0xdcbc('0x2e')](0xcc)[_0xdcbc('0x2f')]();});}};}function handleEntityNotFound(_0x35d94e,_0x514731){return function(_0x5bbd5c){if(!_0x5bbd5c){_0x35d94e[_0xdcbc('0x2d')](0x194);}return _0x5bbd5c;};}function handleError(_0x565c04,_0x2bd97c){_0x2bd97c=_0x2bd97c||0x1f4;return function(_0x44cb89){logger[_0xdcbc('0x2a')](_0x44cb89[_0xdcbc('0x3d')]);if(_0x44cb89[_0xdcbc('0x3e')]){delete _0x44cb89[_0xdcbc('0x3e')];}_0x565c04[_0xdcbc('0x2e')](_0x2bd97c)['send'](_0x44cb89);};}exports[_0xdcbc('0x3f')]=function(_0x53dd84,_0x52e4a2){var _0x471a87={'include':[{'model':db[_0xdcbc('0x40')],'as':_0xdcbc('0x41')}]},_0x4e75f3={},_0x2df4c8={'count':0x0,'rows':[]};var _0x281a46=_[_0xdcbc('0x42')](db['ChatWebsite']['rawAttributes'],function(_0x3434a3){return{'name':_0x3434a3['fieldName'],'type':_0x3434a3[_0xdcbc('0x43')]['key']};});_0x4e75f3[_0xdcbc('0x44')]=_[_0xdcbc('0x42')](_0x281a46,_0xdcbc('0x3e'));_0x4e75f3[_0xdcbc('0x45')]=_['keys'](_0x53dd84[_0xdcbc('0x45')]);_0x4e75f3[_0xdcbc('0x46')]=_[_0xdcbc('0x47')](_0x4e75f3[_0xdcbc('0x44')],_0x4e75f3[_0xdcbc('0x45')]);_0x471a87[_0xdcbc('0x48')]=_[_0xdcbc('0x47')](_0x4e75f3[_0xdcbc('0x44')],qs[_0xdcbc('0x49')](_0x53dd84[_0xdcbc('0x45')]['fields']));_0x471a87[_0xdcbc('0x48')]=_0x471a87['attributes'][_0xdcbc('0x4a')]?_0x471a87[_0xdcbc('0x48')]:_0x4e75f3[_0xdcbc('0x44')];if(!_0x53dd84['query'][_0xdcbc('0x4b')](_0xdcbc('0x4c'))){_0x471a87[_0xdcbc('0x31')]=qs[_0xdcbc('0x31')](_0x53dd84['query'][_0xdcbc('0x31')]);_0x471a87[_0xdcbc('0x30')]=qs['offset'](_0x53dd84[_0xdcbc('0x45')][_0xdcbc('0x30')]);}_0x471a87['order']=qs[_0xdcbc('0x4d')](_0x53dd84[_0xdcbc('0x45')][_0xdcbc('0x4d')]);_0x471a87['where']=qs[_0xdcbc('0x46')](_[_0xdcbc('0x4e')](_0x53dd84['query'],_0x4e75f3[_0xdcbc('0x46')]),_0x281a46);if(_0x53dd84['query'][_0xdcbc('0x4f')]){_0x471a87['where']=_[_0xdcbc('0x50')](_0x471a87[_0xdcbc('0x51')],{'$or':_[_0xdcbc('0x42')](_0x281a46,function(_0x5cc56d){if(_0x5cc56d['type']!==_0xdcbc('0x52')){var _0x5176d6={};_0x5176d6[_0x5cc56d['name']]={'$like':'%'+_0x53dd84[_0xdcbc('0x45')][_0xdcbc('0x4f')]+'%'};return _0x5176d6;}})});}_0x471a87=_[_0xdcbc('0x50')]({},_0x471a87,_0x53dd84[_0xdcbc('0x53')]);var _0xad0781={'where':_0x471a87[_0xdcbc('0x51')]};return db['ChatWebsite'][_0xdcbc('0x33')](_0xad0781)['then'](function(_0x406a73){_0x2df4c8[_0xdcbc('0x33')]=_0x406a73;if(_0x53dd84[_0xdcbc('0x45')][_0xdcbc('0x54')]){_0x471a87['include']=[{'all':!![]}];}return db[_0xdcbc('0x55')][_0xdcbc('0x56')](_0x471a87);})[_0xdcbc('0x23')](function(_0x48a79f){_0x2df4c8[_0xdcbc('0x57')]=_0x48a79f;return _0x2df4c8;})[_0xdcbc('0x23')](respondWithFilteredResult(_0x52e4a2,_0x471a87))[_0xdcbc('0x58')](handleError(_0x52e4a2,null));};exports[_0xdcbc('0x59')]=function(_0x10e22e,_0x4aa135){var _0x2601e8={'raw':![],'where':{'id':_0x10e22e[_0xdcbc('0x5a')]['id']},'include':[{'model':db[_0xdcbc('0x40')],'as':_0xdcbc('0x41')}]},_0x1581a8={};_0x1581a8[_0xdcbc('0x44')]=_[_0xdcbc('0x5b')](db[_0xdcbc('0x55')][_0xdcbc('0x5c')]);_0x1581a8[_0xdcbc('0x45')]=_[_0xdcbc('0x5b')](_0x10e22e[_0xdcbc('0x45')]);_0x1581a8[_0xdcbc('0x46')]=_['intersection'](_0x1581a8[_0xdcbc('0x44')],_0x1581a8['query']);_0x2601e8[_0xdcbc('0x48')]=_[_0xdcbc('0x47')](_0x1581a8['model'],qs[_0xdcbc('0x49')](_0x10e22e[_0xdcbc('0x45')][_0xdcbc('0x49')]));_0x2601e8[_0xdcbc('0x48')]=_0x2601e8[_0xdcbc('0x48')]['length']?_0x2601e8[_0xdcbc('0x48')]:_0x1581a8[_0xdcbc('0x44')];if(_0x10e22e[_0xdcbc('0x45')][_0xdcbc('0x54')]){_0x2601e8['include']=[{'all':!![]}];}_0x2601e8=_[_0xdcbc('0x50')]({},_0x2601e8,_0x10e22e[_0xdcbc('0x53')]);return db[_0xdcbc('0x55')][_0xdcbc('0x5d')](_0x2601e8)[_0xdcbc('0x23')](handleEntityNotFound(_0x4aa135,null))[_0xdcbc('0x23')](respondWithResult(_0x4aa135,null))[_0xdcbc('0x58')](handleError(_0x4aa135,null));};exports[_0xdcbc('0x5e')]=function(_0x79dc31,_0x3229a8){return db[_0xdcbc('0x55')][_0xdcbc('0x5e')](_0x79dc31[_0xdcbc('0x5f')],{})['then'](function(_0x28ff89){var _0x3ef259=_0x79dc31[_0xdcbc('0x60')][_0xdcbc('0x3a')]({'plain':!![]});if(!_0x3ef259)throw new Error(_0xdcbc('0x61'));if(_0x3ef259[_0xdcbc('0x62')]===_0xdcbc('0x60')){var _0xbc91b3=_0x28ff89['get']({'plain':!![]});var _0x3451fe=_0xdcbc('0x3b');return db[_0xdcbc('0x63')][_0xdcbc('0x5d')]({'where':{'name':_0x3451fe,'userProfileId':_0x3ef259[_0xdcbc('0x64')]},'raw':!![]})[_0xdcbc('0x23')](function(_0x32a5ed){if(_0x32a5ed&&_0x32a5ed[_0xdcbc('0x65')]===0x0){return db['UserProfileResource']['create']({'name':_0xbc91b3['name'],'resourceId':_0xbc91b3['id'],'type':_0x32a5ed[_0xdcbc('0x3e')],'sectionId':_0x32a5ed['id']},{})[_0xdcbc('0x23')](function(){return _0x28ff89;});}else{return _0x28ff89;}})[_0xdcbc('0x58')](function(_0x426fcc){logger[_0xdcbc('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x426fcc);throw _0x426fcc;});}return _0x28ff89;})[_0xdcbc('0x23')](respondWithResult(_0x3229a8,0xc9))[_0xdcbc('0x58')](handleError(_0x3229a8,null));};exports[_0xdcbc('0x38')]=function(_0xefe450,_0x57f6ac){if(_0xefe450[_0xdcbc('0x5f')]['id']){delete _0xefe450[_0xdcbc('0x5f')]['id'];}return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0xefe450[_0xdcbc('0x5a')]['id']},'include':[{'model':db[_0xdcbc('0x40')],'as':_0xdcbc('0x41')}]})[_0xdcbc('0x23')](handleEntityNotFound(_0x57f6ac,null))['then'](saveUpdates(_0xefe450['body'],null))[_0xdcbc('0x23')](respondWithResult(_0x57f6ac,null))[_0xdcbc('0x58')](handleError(_0x57f6ac,null));};exports[_0xdcbc('0x39')]=function(_0x3e84ba,_0x1a7b96){return db['ChatWebsite'][_0xdcbc('0x5d')]({'where':{'id':_0x3e84ba[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x1a7b96,null))[_0xdcbc('0x23')](removeEntity(_0x1a7b96,null))[_0xdcbc('0x58')](handleError(_0x1a7b96,null));};exports[_0xdcbc('0x66')]=function(_0x4fcb54,_0x599c42){return db[_0xdcbc('0x55')][_0xdcbc('0x66')]()['then'](respondWithResult(_0x599c42,null))[_0xdcbc('0x58')](handleError(_0x599c42,null));};exports['addDisposition']=function(_0x499b7e,_0x238ebf,_0x395f4e){if(_0x499b7e[_0xdcbc('0x5f')]['id']){delete _0x499b7e[_0xdcbc('0x5f')]['id'];}return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0x499b7e[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x238ebf,null))['then'](function(_0x4ccdef){if(_0x4ccdef){_0x499b7e['body'][_0xdcbc('0x67')]=_0x4ccdef['id'];return db[_0xdcbc('0x68')][_0xdcbc('0x5e')](_0x499b7e[_0xdcbc('0x5f')]);}})[_0xdcbc('0x23')](respondWithResult(_0x238ebf,null))[_0xdcbc('0x58')](handleError(_0x238ebf,null));};exports[_0xdcbc('0x69')]=function(_0x5a7b7a,_0x85bfb6,_0x19d08a){var _0x5ac0c0={'raw':![],'where':{}};var _0xf5af29={};var _0x11348f={'count':0x0,'rows':[]};return db[_0xdcbc('0x55')][_0xdcbc('0x6a')]({'where':{'id':_0x5a7b7a[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x85bfb6,null))['then'](function(_0x35c493){if(_0x35c493){_0xf5af29[_0xdcbc('0x44')]=_['keys'](db[_0xdcbc('0x68')][_0xdcbc('0x5c')]);_0xf5af29[_0xdcbc('0x45')]=_[_0xdcbc('0x5b')](_0x5a7b7a[_0xdcbc('0x45')]);_0xf5af29[_0xdcbc('0x46')]=_[_0xdcbc('0x47')](_0xf5af29['model'],_0xf5af29[_0xdcbc('0x45')]);_0x5ac0c0[_0xdcbc('0x48')]=_[_0xdcbc('0x47')](_0xf5af29['model'],qs[_0xdcbc('0x49')](_0x5a7b7a[_0xdcbc('0x45')][_0xdcbc('0x49')]));_0x5ac0c0[_0xdcbc('0x48')]=_0x5ac0c0[_0xdcbc('0x48')][_0xdcbc('0x4a')]?_0x5ac0c0[_0xdcbc('0x48')]:_0xf5af29[_0xdcbc('0x44')];if(!_0x5a7b7a[_0xdcbc('0x45')][_0xdcbc('0x4b')](_0xdcbc('0x4c'))){_0x5ac0c0[_0xdcbc('0x31')]=qs['limit'](_0x5a7b7a[_0xdcbc('0x45')]['limit']);_0x5ac0c0['offset']=qs[_0xdcbc('0x30')](_0x5a7b7a[_0xdcbc('0x45')][_0xdcbc('0x30')]);}_0x5ac0c0['order']=qs[_0xdcbc('0x4d')](_0x5a7b7a[_0xdcbc('0x45')][_0xdcbc('0x4d')]);_0x5ac0c0['where']=qs[_0xdcbc('0x46')](_[_0xdcbc('0x4e')](_0x5a7b7a[_0xdcbc('0x45')],_0xf5af29[_0xdcbc('0x46')]));_0x5ac0c0['where'][_0xdcbc('0x67')]=_0x35c493['id'];if(_0x5a7b7a[_0xdcbc('0x45')]['filter']){_0x5ac0c0[_0xdcbc('0x51')]=_[_0xdcbc('0x50')](_0x5ac0c0[_0xdcbc('0x51')],{'$or':_[_0xdcbc('0x42')](_0x5ac0c0[_0xdcbc('0x48')],function(_0x3bb8aa){var _0x152894={};_0x152894[_0x3bb8aa]={'$like':'%'+_0x5a7b7a[_0xdcbc('0x45')][_0xdcbc('0x4f')]+'%'};return _0x152894;})});}_0x5ac0c0=_['merge']({},_0x5ac0c0,_0x5a7b7a['options']);return db['Disposition'][_0xdcbc('0x33')]({'where':_0x5ac0c0[_0xdcbc('0x51')]})[_0xdcbc('0x23')](function(_0x12378e){_0x11348f[_0xdcbc('0x33')]=_0x12378e;if(_0x5a7b7a['query'][_0xdcbc('0x54')]){_0x5ac0c0[_0xdcbc('0x6b')]=[{'all':!![]}];}return db['Disposition'][_0xdcbc('0x56')](_0x5ac0c0);})[_0xdcbc('0x23')](function(_0x2e4e7e){_0x11348f[_0xdcbc('0x57')]=_0x2e4e7e;return _0x11348f;});}})[_0xdcbc('0x23')](respondWithFilteredResult(_0x85bfb6,_0x5ac0c0))['catch'](handleError(_0x85bfb6,null));};exports[_0xdcbc('0x6c')]=function(_0x4f9bef,_0x3289bd,_0x5a492a){return db[_0xdcbc('0x55')]['find']({'where':{'id':_0x4f9bef[_0xdcbc('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3289bd,null))[_0xdcbc('0x23')](function(_0x2f3260){if(_0x2f3260){return _0x2f3260[_0xdcbc('0x6c')](_0x4f9bef[_0xdcbc('0x45')][_0xdcbc('0x6d')]);}})[_0xdcbc('0x23')](respondWithStatusCode(_0x3289bd,null))[_0xdcbc('0x58')](handleError(_0x3289bd,null));};exports['addAnswer']=function(_0x3d548a,_0x54dde5,_0x5a45fa){if(_0x3d548a[_0xdcbc('0x5f')]['id']){delete _0x3d548a[_0xdcbc('0x5f')]['id'];}return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0x3d548a[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x54dde5,null))[_0xdcbc('0x23')](function(_0x4aade2){if(_0x4aade2){_0x3d548a[_0xdcbc('0x5f')][_0xdcbc('0x67')]=_0x4aade2['id'];return db['CannedAnswer']['create'](_0x3d548a[_0xdcbc('0x5f')]);}})['then'](respondWithResult(_0x54dde5,null))[_0xdcbc('0x58')](handleError(_0x54dde5,null));};exports[_0xdcbc('0x6e')]=function(_0x115d7f,_0x53f98f,_0x2c8d4c){var _0x48e23f={'raw':![],'where':{}};var _0x3c71d6={};var _0x25102f={'count':0x0,'rows':[]};return db[_0xdcbc('0x55')][_0xdcbc('0x6a')]({'where':{'id':_0x115d7f[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x53f98f,null))[_0xdcbc('0x23')](function(_0xf3f066){if(_0xf3f066){_0x3c71d6['model']=_[_0xdcbc('0x5b')](db[_0xdcbc('0x6f')][_0xdcbc('0x5c')]);_0x3c71d6[_0xdcbc('0x45')]=_[_0xdcbc('0x5b')](_0x115d7f['query']);_0x3c71d6[_0xdcbc('0x46')]=_[_0xdcbc('0x47')](_0x3c71d6[_0xdcbc('0x44')],_0x3c71d6['query']);_0x48e23f[_0xdcbc('0x48')]=_[_0xdcbc('0x47')](_0x3c71d6[_0xdcbc('0x44')],qs[_0xdcbc('0x49')](_0x115d7f[_0xdcbc('0x45')][_0xdcbc('0x49')]));_0x48e23f[_0xdcbc('0x48')]=_0x48e23f['attributes'][_0xdcbc('0x4a')]?_0x48e23f[_0xdcbc('0x48')]:_0x3c71d6[_0xdcbc('0x44')];if(!_0x115d7f['query'][_0xdcbc('0x4b')]('nolimit')){_0x48e23f['limit']=qs[_0xdcbc('0x31')](_0x115d7f[_0xdcbc('0x45')][_0xdcbc('0x31')]);_0x48e23f[_0xdcbc('0x30')]=qs['offset'](_0x115d7f['query'][_0xdcbc('0x30')]);}_0x48e23f[_0xdcbc('0x70')]=qs[_0xdcbc('0x4d')](_0x115d7f[_0xdcbc('0x45')][_0xdcbc('0x4d')]);_0x48e23f[_0xdcbc('0x51')]=qs['filters'](_[_0xdcbc('0x4e')](_0x115d7f[_0xdcbc('0x45')],_0x3c71d6[_0xdcbc('0x46')]));_0x48e23f[_0xdcbc('0x51')][_0xdcbc('0x67')]=_0xf3f066['id'];if(_0x115d7f[_0xdcbc('0x45')]['filter']){_0x48e23f[_0xdcbc('0x51')]=_[_0xdcbc('0x50')](_0x48e23f[_0xdcbc('0x51')],{'$or':_[_0xdcbc('0x42')](_0x48e23f[_0xdcbc('0x48')],function(_0x5509f7){var _0x218227={};_0x218227[_0x5509f7]={'$like':'%'+_0x115d7f[_0xdcbc('0x45')][_0xdcbc('0x4f')]+'%'};return _0x218227;})});}_0x48e23f=_[_0xdcbc('0x50')]({},_0x48e23f,_0x115d7f[_0xdcbc('0x53')]);return db[_0xdcbc('0x6f')][_0xdcbc('0x33')]({'where':_0x48e23f['where']})[_0xdcbc('0x23')](function(_0x276464){_0x25102f['count']=_0x276464;if(_0x115d7f['query'][_0xdcbc('0x54')]){_0x48e23f[_0xdcbc('0x6b')]=[{'all':!![]}];}return db[_0xdcbc('0x6f')][_0xdcbc('0x56')](_0x48e23f);})[_0xdcbc('0x23')](function(_0x4828dc){_0x25102f[_0xdcbc('0x57')]=_0x4828dc;return _0x25102f;});}})[_0xdcbc('0x23')](respondWithFilteredResult(_0x53f98f,_0x48e23f))[_0xdcbc('0x58')](handleError(_0x53f98f,null));};exports[_0xdcbc('0x71')]=function(_0x292478,_0xcc908a,_0xf48165){return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0x292478[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0xcc908a,null))[_0xdcbc('0x23')](function(_0x58c449){if(_0x58c449){return _0x58c449[_0xdcbc('0x71')](_0x292478[_0xdcbc('0x45')][_0xdcbc('0x6d')]);}})[_0xdcbc('0x23')](respondWithStatusCode(_0xcc908a,null))[_0xdcbc('0x58')](handleError(_0xcc908a,null));};exports[_0xdcbc('0x72')]=function(_0x4d27f0,_0x4d1fd7,_0x26cdf5){_0x4d27f0['body'][_0xdcbc('0x73')]=_0x4d27f0['file']['filename'];return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0x4d27f0[_0xdcbc('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4d1fd7,null))[_0xdcbc('0x23')](saveUpdates(_0x4d27f0[_0xdcbc('0x5f')],null))[_0xdcbc('0x23')](respondWithResult(_0x4d1fd7,null))[_0xdcbc('0x58')](handleError(_0x4d1fd7,null));};exports[_0xdcbc('0x74')]=function(_0x1cb941,_0x245304,_0x1e362f){_0x1cb941['body']['agentAvatar']=_0x1cb941['file']['filename'];return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0x1cb941['params']['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x245304,null))[_0xdcbc('0x23')](saveUpdates(_0x1cb941['body'],null))[_0xdcbc('0x23')](respondWithResult(_0x245304,null))[_0xdcbc('0x58')](handleError(_0x245304,null));};exports[_0xdcbc('0x75')]=function(_0x3fd0f5,_0x28c391,_0x2046a2){_0x3fd0f5['body'][_0xdcbc('0x76')]=_0x3fd0f5['file'][_0xdcbc('0x77')];return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0x3fd0f5[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x28c391,null))['then'](saveUpdates(_0x3fd0f5[_0xdcbc('0x5f')],null))[_0xdcbc('0x23')](respondWithResult(_0x28c391,null))['catch'](handleError(_0x28c391,null));};exports[_0xdcbc('0x78')]=function(_0x4a6b30,_0xa6bfec,_0x3feeaf){_0x4a6b30[_0xdcbc('0x5f')][_0xdcbc('0x79')]=_0x4a6b30[_0xdcbc('0x7a')][_0xdcbc('0x77')];return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0x4a6b30[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0xa6bfec,null))[_0xdcbc('0x23')](saveUpdates(_0x4a6b30[_0xdcbc('0x5f')],null))['then'](respondWithResult(_0xa6bfec,null))['catch'](handleError(_0xa6bfec,null));};exports['getLogo']=function(_0xea29be,_0x512c7c,_0x18e71a){var _0x558e9f=path[_0xdcbc('0x7b')](config[_0xdcbc('0x7c')],'server/files/images/logos/default_logo.svg');var _0x248353={'where':{'id':_0xea29be[_0xdcbc('0x5a')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x4c7e39=![];return require('../../config/license/util')[_0xdcbc('0x7d')]()[_0xdcbc('0x23')](function(_0x366a4c){if(_0x366a4c){_0x4c7e39=_0x366a4c[_0xdcbc('0x7e')];}})[_0xdcbc('0x23')](function(){return db[_0xdcbc('0x55')][_0xdcbc('0x5d')](_0x248353);})[_0xdcbc('0x23')](handleEntityNotFound(_0x512c7c,null))[_0xdcbc('0x23')](function(_0x23ba43){if(_0x23ba43){if(!_['isNil'](_0x23ba43[_0xdcbc('0x73')])){if(fs[_0xdcbc('0x7f')](path['join'](config[_0xdcbc('0x7c')],_0xdcbc('0x80'),_0x23ba43[_0xdcbc('0x73')]))&&_0x4c7e39){_0x558e9f=path[_0xdcbc('0x7b')](config[_0xdcbc('0x7c')],_0xdcbc('0x80'),_0x23ba43['sitepic']);}}return _0x512c7c['download'](_0x558e9f);}})[_0xdcbc('0x58')](handleError(_0x512c7c,null));};exports[_0xdcbc('0x81')]=function(_0x290eb9,_0x43595f,_0x236ca9){var _0x460269=path[_0xdcbc('0x7b')](config[_0xdcbc('0x7c')],_0xdcbc('0x82'));var _0x16eba6={'where':{'id':_0x290eb9[_0xdcbc('0x5a')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xdcbc('0x55')][_0xdcbc('0x5d')](_0x16eba6)['then'](handleEntityNotFound(_0x43595f,null))['then'](function(_0x27fa93){if(_0x27fa93){if(!_[_0xdcbc('0x83')](_0x27fa93[_0xdcbc('0x84')])){if(fs[_0xdcbc('0x7f')](path[_0xdcbc('0x7b')](config[_0xdcbc('0x7c')],_0xdcbc('0x85'),_0x27fa93[_0xdcbc('0x84')]))){_0x460269=path['join'](config['root'],_0xdcbc('0x85'),_0x27fa93[_0xdcbc('0x84')]);}}return _0x43595f[_0xdcbc('0x86')](_0x460269);}})['catch'](handleError(_0x43595f,null));};exports[_0xdcbc('0x87')]=function(_0x3d8a41,_0x24ac6b,_0x372e51){var _0xf56360=path['join'](config[_0xdcbc('0x7c')],'server/files/images/avatars/customer_avatar.png');var _0x4c77f1={'where':{'id':_0x3d8a41[_0xdcbc('0x5a')]['id']},'attributes':['id',_0xdcbc('0x76'),_0xdcbc('0x88')],'raw':!![]};return db['ChatWebsite']['find'](_0x4c77f1)[_0xdcbc('0x23')](handleEntityNotFound(_0x24ac6b,null))['then'](function(_0x15acd2){if(_0x15acd2){if(!_[_0xdcbc('0x83')](_0x15acd2[_0xdcbc('0x76')])){if(fs['existsSync'](path['join'](config['root'],_0xdcbc('0x85'),_0x15acd2[_0xdcbc('0x76')]))&&_0x15acd2[_0xdcbc('0x88')]){_0xf56360=path['join'](config[_0xdcbc('0x7c')],_0xdcbc('0x85'),_0x15acd2[_0xdcbc('0x76')]);}}return _0x24ac6b[_0xdcbc('0x86')](_0xf56360);}})[_0xdcbc('0x58')](handleError(_0x24ac6b,null));};exports[_0xdcbc('0x89')]=function(_0x1f06c0,_0x5832d1,_0x11b3ca){var _0x5ad96f=path[_0xdcbc('0x7b')](config[_0xdcbc('0x7c')],_0xdcbc('0x8a'));var _0x10abe7={'where':{'id':_0x1f06c0['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xdcbc('0x55')]['find'](_0x10abe7)['then'](handleEntityNotFound(_0x5832d1,null))[_0xdcbc('0x23')](function(_0x1ce5f1){if(_0x1ce5f1){if(!_[_0xdcbc('0x83')](_0x1ce5f1[_0xdcbc('0x79')])){if(fs[_0xdcbc('0x7f')](path[_0xdcbc('0x7b')](config[_0xdcbc('0x7c')],_0xdcbc('0x85'),_0x1ce5f1['systemAvatar']))){_0x5ad96f=path[_0xdcbc('0x7b')](config[_0xdcbc('0x7c')],_0xdcbc('0x85'),_0x1ce5f1[_0xdcbc('0x79')]);}}return _0x5832d1['download'](_0x5ad96f);}})[_0xdcbc('0x58')](handleError(_0x5832d1,null));};exports[_0xdcbc('0x8b')]=function(_0x5d6352,_0xcd971a,_0x2f8689){var _0x441082=require(_0xdcbc('0x8c'));var _0x26b0a4=new _0x441082();var _0x594fce=_0x26b0a4[_0xdcbc('0x8d')](_0x5d6352[_0xdcbc('0x8e')]['user-agent'])['getResult']();var _0x16b597={'body':_0x5d6352['body'],'channel':_0xdcbc('0x8f')};var _0x3cfe62=[];var _0x46388c=[];var _0x51fb8d={};var _0x3f8f59=![];return db['CmContact']['describe']()['then'](function(_0x5cfc9d){if(!_0x5cfc9d){throw new db[(_0xdcbc('0x90'))][(_0xdcbc('0x91'))](_0xdcbc('0x92'));}_0x3cfe62=_['difference'](_[_0xdcbc('0x5b')](_0x5cfc9d),['createdAt',_0xdcbc('0x93')]);_0x46388c=_[_0xdcbc('0x94')](_[_0xdcbc('0x5b')](_0x5cfc9d),[_0xdcbc('0x95'),_0xdcbc('0x93'),'CompanyId',_0xdcbc('0x96')]);if(_0x5d6352[_0xdcbc('0x5f')]['id']){delete _0x5d6352[_0xdcbc('0x5f')]['id'];}if(_['isNil'](_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0x97')])){throw new db[(_0xdcbc('0x90'))]['ValidationError'](_0xdcbc('0x98'));}if(_['isNil'](_0x5d6352['body'][_0xdcbc('0x5f')])||_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0x5f')]===''){throw new db['Sequelize']['ValidationError'](_0xdcbc('0x99'));}if(_[_0xdcbc('0x83')](_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0x9a')])){throw new db[(_0xdcbc('0x90'))]['ValidationError'](_0xdcbc('0x9b')+_0x46388c);}if(!_[_0xdcbc('0x9c')](_0x46388c,_0x5d6352['body'][_0xdcbc('0x9a')])){throw new db['Sequelize'][(_0xdcbc('0x91'))](_0xdcbc('0x9d')+_0x46388c);}_0x51fb8d[_0x5d6352['body'][_0xdcbc('0x9a')]]=_0x5d6352['body'][_0xdcbc('0x97')];})[_0xdcbc('0x23')](function(){return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0x5d6352[_0xdcbc('0x5a')]['id']},'include':[{'model':db[_0xdcbc('0x9e')],'as':_0xdcbc('0x9f'),'include':[{'model':db['CmContact'],'as':_0xdcbc('0xa0'),'where':_0x51fb8d,'limit':0x1,'order':[[_0xdcbc('0x93'),_0xdcbc('0xa1')]]}]},{'model':db[_0xdcbc('0xa2')],'as':_0xdcbc('0xa3')}]});})['then'](handleEntityNotFound(_0xcd971a,null))[_0xdcbc('0x23')](function(_0x4673b0){if(_0x4673b0&&_0x4673b0[_0xdcbc('0x9f')]){_0x16b597[_0xdcbc('0xa4')]=_0x4673b0;_0x16b597['applications']=_0x4673b0[_0xdcbc('0xa3')];_0x16b597[_0xdcbc('0xa5')]=_0x4673b0[_0xdcbc('0x9f')];_0x16b597[_0xdcbc('0xa6')]=_[_0xdcbc('0xa7')](_0x16b597[_0xdcbc('0xa6')],['priority'],[_0xdcbc('0xa8')]);if(_0x16b597['account'][_0xdcbc('0xa3')]){delete _0x16b597[_0xdcbc('0xa4')][_0xdcbc('0xa3')];}if(_0x16b597[_0xdcbc('0xa4')][_0xdcbc('0x9f')]&&_0x16b597[_0xdcbc('0xa4')][_0xdcbc('0x9f')][_0xdcbc('0xa0')][_0xdcbc('0x4a')]){return _0x16b597[_0xdcbc('0xa4')]['List'][_0xdcbc('0xa0')][0x0];}var _0x331d96=_[_0xdcbc('0xa9')](_0x5d6352['body'],{'firstName':_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0x97')],'ListId':_0x4673b0['ListId']});_0x331d96[_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0x9a')]]=_0x5d6352[_0xdcbc('0x5f')]['from'];return db[_0xdcbc('0xaa')][_0xdcbc('0x5e')](_0x331d96,{'fields':_0x3cfe62,'raw':!![]});}})[_0xdcbc('0x23')](handleEntityNotFound(_0xcd971a,null))[_0xdcbc('0x23')](function(_0x3165a1){_0x16b597[_0xdcbc('0xab')]=_0x3165a1;var _0x301b5d=_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0xac')];if(_0x5d6352['headers'][_0xdcbc('0xad')]){_0x301b5d=_0x5d6352[_0xdcbc('0x8e')][_0xdcbc('0xad')];}else if(_0x5d6352[_0xdcbc('0x8e')][_0xdcbc('0xae')]){_0x301b5d=_[_0xdcbc('0xaf')](_0x5d6352[_0xdcbc('0x8e')][_0xdcbc('0xae')][_0xdcbc('0xb0')](','));}if(_0x3165a1){var _0x6b2109={'ContactId':_0x3165a1['id'],'ChatWebsiteId':_0x5d6352[_0xdcbc('0x5a')]['id'],'from':(_0x3165a1['firstName']||'')+'\x20'+(_0x3165a1['lastName']||''),'customerIp':_0x301b5d,'customerPort':_0x5d6352[_0xdcbc('0x8e')][_0xdcbc('0xb1')]?_0x5d6352['headers'][_0xdcbc('0xb1')]:null,'referer':_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0xb2')],'browserName':_0x594fce[_0xdcbc('0xb3')]['name']&&_0x594fce[_0xdcbc('0xb3')][_0xdcbc('0xb4')]?util[_0xdcbc('0xb5')](_0xdcbc('0xb6'),_0x594fce[_0xdcbc('0xb3')][_0xdcbc('0x3e')],_0x594fce[_0xdcbc('0xb3')][_0xdcbc('0xb4')]):'unknown','browserVersion':_0x594fce['browser'][_0xdcbc('0xb4')]||_0xdcbc('0xb7'),'osName':util['format']('%s\x20%s',_0x594fce['os'][_0xdcbc('0x3e')],_0x594fce['os'][_0xdcbc('0xb4')]),'osVersion':_0x594fce['os'][_0xdcbc('0xb4')],'deviceModel':_0x594fce['device'][_0xdcbc('0x44')]&&_0x594fce[_0xdcbc('0xb8')]['vendor']?util['format'](_0xdcbc('0xb9'),_0x594fce[_0xdcbc('0xb8')][_0xdcbc('0x44')],_0x594fce[_0xdcbc('0xb8')][_0xdcbc('0xba')],_0x594fce['device']['type']):null,'deviceVendor':_0x594fce[_0xdcbc('0xb8')][_0xdcbc('0xba')],'deviceType':_0x594fce[_0xdcbc('0xb8')][_0xdcbc('0x43')],'formData':JSON['stringify'](_0x5d6352[_0xdcbc('0x5f')])};var _0x5097ef={'ChatWebsiteId':_0x5d6352[_0xdcbc('0x5a')]['id'],'closed':![]};if(_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0xbb')]){_0x5097ef[_0xdcbc('0xbb')]=_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0xbb')];return db[_0xdcbc('0xbc')]['find']({'where':_0x5097ef})[_0xdcbc('0x23')](function(_0x3e610f){if(_0x3e610f){return[_0x3e610f,![]];}_0x6b2109[_0xdcbc('0xbb')]=_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0xbb')];_0x6b2109[_0xdcbc('0xbd')]=_0x5d6352['body'][_0xdcbc('0xbd')];return db[_0xdcbc('0xbc')]['create'](_0x6b2109)[_0xdcbc('0x23')](function(_0x5acb28){return[_0x5acb28,!![]];});});}_0x5097ef['ContactId']=_0x3165a1['id'];if(_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0xbe')]&&_0x5d6352[_0xdcbc('0x5f')]['interaction']['id']){_0x5097ef['id']=_0x5d6352[_0xdcbc('0x5f')]['interaction']['id'];return db['ChatInteraction'][_0xdcbc('0x5d')]({'where':_0x5097ef})[_0xdcbc('0x23')](function(_0x20753c){if(_0x20753c){return[_0x20753c,![]];}return db['ChatInteraction'][_0xdcbc('0x5e')](_0x6b2109)[_0xdcbc('0x23')](function(_0x5c0fa6){return[_0x5c0fa6,!![]];});});}return db[_0xdcbc('0xbc')][_0xdcbc('0x5e')](_0x6b2109)['then'](function(_0x4f998c){return[_0x4f998c,!![]];});}})[_0xdcbc('0xbf')](function(_0x66ba22,_0x10da11){if(_0x66ba22){_0x3f8f59=_0x10da11;if(!_0x10da11){var _0x181741={'from':(_0x16b597[_0xdcbc('0xab')]['firstName']||'')+'\x20'+(_0x16b597[_0xdcbc('0xab')]['lastName']||'')};if(_0x5d6352['body']['threadId']&&_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0xc0')]&&_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0xbb')]!=_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0xc0')]){_0x181741[_0xdcbc('0xbb')]=_0x5d6352['body'][_0xdcbc('0xc0')];}return _0x66ba22[_0xdcbc('0x38')](_0x181741);}else{return _0x66ba22;}}})[_0xdcbc('0x23')](function(_0x24800f){_0x16b597[_0xdcbc('0xbe')]=_0x24800f[_0xdcbc('0x3a')]({'plain':!![]});_0x16b597['interaction'][_0xdcbc('0xc1')]=_0x3f8f59;if(_0x16b597[_0xdcbc('0xbe')][_0xdcbc('0xc1')]){if(_0x16b597[_0xdcbc('0xa4')]['autoclose']){_0x16b597[_0xdcbc('0xa6')]['push']({'id':0x0,'priority':_0x16b597[_0xdcbc('0xa6')]['length']+0x1,'app':_0xdcbc('0xc2'),'appdata':_0xdcbc('0xc3'),'interval':'*,*,*,*'});}}return db[_0xdcbc('0xc4')][_0xdcbc('0x5e')]({'body':_0x5d6352[_0xdcbc('0x5f')]['body'],'ChatWebsiteId':_0x5d6352[_0xdcbc('0x5a')]['id'],'ChatInteractionId':_0x24800f['id'],'direction':'in','ContactId':_0x16b597[_0xdcbc('0xab')]['id'],'AttachmentId':_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0xc5')]});})['then'](function(_0x1fcfb1){_0x16b597['message']=_0x1fcfb1;if(_0x16b597[_0xdcbc('0xbe')][_0xdcbc('0xc6')]){return db[_0xdcbc('0xc7')]['find']({'attributes':['id',_0xdcbc('0x3e')],'where':{'id':_0x16b597[_0xdcbc('0xbe')][_0xdcbc('0xc6')]}})[_0xdcbc('0x23')](function(_0x2f3683){if(_0x2f3683){_0x16b597[_0xdcbc('0xa6')][_0xdcbc('0xc8')]({'id':0x0,'priority':0x0,'app':_0xdcbc('0xc9'),'appdata':_0x2f3683[_0xdcbc('0x3e')]+','+(_0x16b597[_0xdcbc('0xa4')][_0xdcbc('0xca')]||0xa),'interval':'*,*,*,*'});_0x16b597[_0xdcbc('0xcb')]=!![];}return respondWithRpcPromise(_0xdcbc('0xcc'),_0xdcbc('0xcd'),_0x16b597);});}return respondWithRpcPromise('Start',_0xdcbc('0xcd'),_0x16b597);})[_0xdcbc('0x23')](function(_0x53bca8){respondWithRpcPromise('EventManager',_0xdcbc('0xce'),{'event':_0xdcbc('0x8b'),'message':_0x53bca8},client9002);return _0x53bca8;})[_0xdcbc('0x23')](respondWithResult(_0xcd971a,null))[_0xdcbc('0x58')](handleError(_0xcd971a,null));};exports[_0xdcbc('0xcf')]=function(_0x41837a,_0x52a4e8,_0x297249){var _0x2460ca,_0x9f0067,_0xfb5e7b;var _0x586c47=[];var _0x3d58b5=[];var _0x1d3d00={};var _0x25f014=_0x41837a[_0xdcbc('0xd0')]||[];var _0x357332=[];var _0x5e7fe1;return db[_0xdcbc('0xaa')][_0xdcbc('0x66')]()[_0xdcbc('0x23')](function(_0x11d210){if(!_0x11d210){throw new db[(_0xdcbc('0x90'))][(_0xdcbc('0x91'))](_0xdcbc('0x92'));}_0x3d58b5=_[_0xdcbc('0x94')](_[_0xdcbc('0x5b')](_0x11d210),['createdAt','updatedAt']);_0x586c47=_[_0xdcbc('0x94')](_[_0xdcbc('0x5b')](_0x11d210),[_0xdcbc('0x95'),_0xdcbc('0x93'),_0xdcbc('0xd1'),_0xdcbc('0x96')]);if(_0x41837a[_0xdcbc('0x5f')]['id']){delete _0x41837a[_0xdcbc('0x5f')]['id'];}if(_['isNil'](_0x41837a[_0xdcbc('0x5f')]['from'])){throw _0x52a4e8['status'](0x1f4)[_0xdcbc('0xd2')](new db[(_0xdcbc('0x90'))]['ValidationError'](_0xdcbc('0x98')));}if(_[_0xdcbc('0x83')](_0x41837a[_0xdcbc('0x5f')]['body'])||_0x41837a[_0xdcbc('0x5f')]['body']===''){throw _0x52a4e8['status'](0x1f4)[_0xdcbc('0xd2')](new db[(_0xdcbc('0x90'))][(_0xdcbc('0x91'))](_0xdcbc('0x99')));}if(_[_0xdcbc('0x83')](_0x41837a[_0xdcbc('0x5f')][_0xdcbc('0xd3')])){throw _0x52a4e8['status'](0x1f4)['send'](new db['Sequelize'][(_0xdcbc('0x91'))](_0xdcbc('0xd4')+_0x586c47));}if(!_[_0xdcbc('0x9c')](_0x586c47,_0x41837a[_0xdcbc('0x5f')][_0xdcbc('0xd3')])){throw _0x52a4e8[_0xdcbc('0x2e')](0x1f4)['send'](new db[(_0xdcbc('0x90'))][(_0xdcbc('0x91'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x586c47));}_0x1d3d00[_0x41837a[_0xdcbc('0x5f')][_0xdcbc('0xd3')]]=_0x41837a[_0xdcbc('0x5f')][_0xdcbc('0x97')];})['then'](function(){return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0x41837a['params']['id']},'include':[{'model':db[_0xdcbc('0x9e')],'as':_0xdcbc('0x9f')},{'model':db[_0xdcbc('0xd5')],'as':'MailAccount'}]});})[_0xdcbc('0x23')](handleEntityNotFound(_0x52a4e8,null))[_0xdcbc('0x23')](function(_0x460805){if(_0x460805&&_0x460805['List']){_0x9f0067=_0x460805;var _0x1fa520=_['defaults'](_0x41837a[_0xdcbc('0x5f')],{'firstName':_0x41837a[_0xdcbc('0x5f')]['from'],'phone':_0x41837a['body'][_0xdcbc('0x97')],'ListId':_0x460805[_0xdcbc('0x96')]});_0x1fa520[_0x41837a[_0xdcbc('0x5f')][_0xdcbc('0xd3')]]=_0x41837a[_0xdcbc('0x5f')][_0xdcbc('0x97')];return db[_0xdcbc('0xaa')][_0xdcbc('0xd6')]({'where':_0x1d3d00,'defaults':_0x1fa520});}})[_0xdcbc('0xbf')](function(_0x4b8a3f){if(_0x4b8a3f){_0xfb5e7b=_0x4b8a3f;var _0x1caa40=fs[_0xdcbc('0xd7')](path[_0xdcbc('0x7b')](config[_0xdcbc('0x7c')],'server/files/templates/chatOfflineMessage.ejs'),_0xdcbc('0xd8'));var _0x202851=ejs[_0xdcbc('0xd9')](_0x1caa40,{'body':_[_0xdcbc('0xda')](_0x41837a[_0xdcbc('0x5f')][_0xdcbc('0x5f')]),'bodyTitle':_0x9f0067[_0xdcbc('0xdb')]});return db[_0xdcbc('0xdc')][_0xdcbc('0x5e')]({'body':_0x202851,'ContactId':_0x4b8a3f['id'],'ChatWebsiteId':_0x9f0067['id']});}})[_0xdcbc('0x23')](function(_0x167637){_0x5e7fe1=_0x167637;if(_0x25f014[_0xdcbc('0x4a')]){var _0x206214=_0x25f014[_0xdcbc('0x42')](function(_0x4f6b80){return{'name':_0x4f6b80[_0xdcbc('0xdd')],'basename':_0x4f6b80['filename'],'type':_0x4f6b80[_0xdcbc('0xde')],'ChatOfflineMessageId':_0x167637['id']};});_0x357332=_0x206214['map'](_0x4b6916=>{var _0x35a93b={'filename':_0x4b6916['name'],'path':path[_0xdcbc('0x7b')](config['root'],_0xdcbc('0xdf'),_0xdcbc('0xd0'),_0xdcbc('0xe0'),_0xdcbc('0xe1'),_0x4b6916[_0xdcbc('0xe2')])};return _0x35a93b;});if(!_0x9f0067[_0xdcbc('0xe3')]){return db[_0xdcbc('0xe4')][_0xdcbc('0xe5')](function(_0x3c7971){return db[_0xdcbc('0xe6')][_0xdcbc('0xe7')](_0x206214,{'transaction':_0x3c7971});});}}})[_0xdcbc('0x23')](function(){if(_0x5e7fe1){_0x2460ca=_0x5e7fe1;return db[_0xdcbc('0xd5')][_0xdcbc('0x6a')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}})['then'](function(_0x3430c2){if(_0x3430c2&&_0x3430c2[_0xdcbc('0xe8')]&&_0x9f0067[_0xdcbc('0xe9')]&&_0x9f0067[_0xdcbc('0xea')]){var _0x4b1af7={'tls':{'rejectUnauthorized':![]}};if(_0x3430c2['Smtp'][_0xdcbc('0xeb')]){_0x4b1af7[_0xdcbc('0xeb')]=_0x3430c2[_0xdcbc('0xe8')][_0xdcbc('0xeb')];}else{_0x4b1af7['host']=_0x3430c2['Smtp'][_0xdcbc('0xec')];_0x4b1af7[_0xdcbc('0xed')]=_0x3430c2[_0xdcbc('0xe8')][_0xdcbc('0xed')];_0x4b1af7[_0xdcbc('0xee')]=_0x3430c2['Smtp'][_0xdcbc('0xee')];}if(_0x3430c2['Smtp'][_0xdcbc('0xef')]){_0x4b1af7['auth']={'user':_0x3430c2[_0xdcbc('0xe8')][_0xdcbc('0x60')],'pass':_0x3430c2[_0xdcbc('0xe8')][_0xdcbc('0xf0')]};}return respondWithRpcPromise(_0xdcbc('0xf1'),_0xdcbc('0xf2'),{'account':_0x4b1af7,'message':{'from':util['format'](_0xdcbc('0xf3'),_0x3430c2[_0xdcbc('0x3e')],_0x3430c2[_0xdcbc('0xf4')]||_0x3430c2[_0xdcbc('0xe8')][_0xdcbc('0x60')]),'to':_0x9f0067[_0xdcbc('0xea')],'subject':_0x9f0067[_0xdcbc('0xf5')],'html':_0x2460ca[_0xdcbc('0x5f')],'attachments':_0x357332}},client9003)[_0xdcbc('0x23')](function(){return _0x2460ca;})[_0xdcbc('0x58')](function(_0x5a159e){console[_0xdcbc('0x2a')](_0x5a159e);});}})[_0xdcbc('0x23')](function(){if(_0x9f0067&&_0x9f0067[_0xdcbc('0xe3')]&&_0x9f0067['MailAccountId']){var _0x5a52db=[];if(_0x25f014[_0xdcbc('0x4a')]){_0x5a52db=_0x25f014[_0xdcbc('0x42')](function(_0x88828f){return{'name':_0x88828f[_0xdcbc('0xdd')],'basename':_0x88828f['filename'],'type':_0x88828f['mimetype'],'ChatOfflineMessageId':_0x5e7fe1['id']};});}var _0xac9478;if(!_[_0xdcbc('0x83')](_0x9f0067[_0xdcbc('0xf6')])){var _0x1ad03d=_['map'](_0x41837a['body'],function(_0x5be47c){return _0x5be47c;});var _0x33ec6b=_[_0xdcbc('0xf7')](_0x1ad03d)[0x0];var _0x2a22cd=_[_0xdcbc('0xf8')](_0x33ec6b,function(_0x442568){return _0x442568;});_0xac9478=_0x2a22cd[0x1][_0x9f0067[_0xdcbc('0xf6')]];}var _0x249579={'from':_0xfb5e7b[_0xdcbc('0xf4')],'firstName':_0xfb5e7b[_0xdcbc('0xf9')],'lastName':_0xfb5e7b['lastName'],'mapKey':_0xdcbc('0xf4'),'message':{'from':_0xfb5e7b[_0xdcbc('0xf4')],'to':_0x9f0067[_0xdcbc('0xd5')][_0xdcbc('0xf4')],'cc':'','subject':_[_0xdcbc('0x83')](_0xac9478)?_0x9f0067[_0xdcbc('0xf5')]:_0xac9478,'messageId':'','sentAt':new Date(),'attach':_0x5a52db[_0xdcbc('0x4a')],'attachments':_0x5a52db,'originChannel':_0xdcbc('0xfa'),'ChatWebsiteId':_0x9f0067['id'],'ChatOfflineMessageId':_0x2460ca['id'],'originTo':_0x9f0067[_0xdcbc('0xd5')][_0xdcbc('0xf4')]},'body':_0x2460ca['body']};var _0x1ca6c7={'account':{'id':_0x9f0067['MailAccountId']},'body':_0x249579,'log':_0xdcbc('0xfb')};return respondWithRpcPromise('NotifyMailAccount',_0xdcbc('0xfc'),_0x1ca6c7,client9001)['then'](function(){return _0x2460ca;})['catch'](function(_0x5568a1){console[_0xdcbc('0x2a')](_0x5568a1);});}return;})[_0xdcbc('0x23')](function(){if(_0x2460ca){return _0x2460ca;}})['then'](respondWithResult(_0x52a4e8,null))[_0xdcbc('0x58')](function(_0xd3c3b1){console[_0xdcbc('0x2a')]('catch',_0xd3c3b1);for(var _0x44020d of _0x25f014){var _0x53a9a2=path[_0xdcbc('0x7b')](config[_0xdcbc('0x7c')],'server',_0xdcbc('0xd0'),'attachments',_0xdcbc('0xe1'),_0x44020d['filename']);fs_extra[_0xdcbc('0xfd')](_0x53a9a2)[_0xdcbc('0x58')](function(_0x5dcf96){console[_0xdcbc('0x2a')](_0xdcbc('0xfe'),_0x53a9a2,_0x5dcf96);});}});};exports[_0xdcbc('0xff')]=function(_0x3aa884,_0xe67977,_0x28d84e){return db[_0xdcbc('0xbc')][_0xdcbc('0x5d')]({'where':{'id':_0x3aa884[_0xdcbc('0x5a')]['id']}})['then'](handleEntityNotFound(_0xe67977,null))[_0xdcbc('0x23')](function(_0x451dc9){if(_0x451dc9){return _0x451dc9['addInteraction'](_0x3aa884[_0xdcbc('0x5f')][_0xdcbc('0x6d')],_[_0xdcbc('0x100')](_0x3aa884['body'],[_0xdcbc('0x6d'),'id'])||{});}})[_0xdcbc('0x23')](respondWithResult(_0xe67977,null))['catch'](handleError(_0xe67977,null));};exports['getInteractions']=function(_0x4d9567,_0xf1f092,_0x2da46a){var _0x150bb4={'raw':![],'where':{}};var _0xeee135={};var _0x117a34={'count':0x0,'rows':[]};return db[_0xdcbc('0x55')]['findOne']({'where':{'id':_0x4d9567[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0xf1f092,null))[_0xdcbc('0x23')](function(_0x930085){if(_0x930085){_0xeee135[_0xdcbc('0x44')]=_[_0xdcbc('0x5b')](db[_0xdcbc('0xbc')][_0xdcbc('0x5c')]);_0xeee135[_0xdcbc('0x45')]=_[_0xdcbc('0x5b')](_0x4d9567[_0xdcbc('0x45')]);_0xeee135['filters']=_[_0xdcbc('0x47')](_0xeee135['model'],_0xeee135[_0xdcbc('0x45')]);_0x150bb4[_0xdcbc('0x48')]=_['intersection'](_0xeee135[_0xdcbc('0x44')],qs['fields'](_0x4d9567[_0xdcbc('0x45')][_0xdcbc('0x49')]));_0x150bb4['attributes']=_0x150bb4[_0xdcbc('0x48')][_0xdcbc('0x4a')]?_0x150bb4[_0xdcbc('0x48')]:_0xeee135[_0xdcbc('0x44')];if(!_0x4d9567[_0xdcbc('0x45')]['hasOwnProperty'](_0xdcbc('0x4c'))){_0x150bb4[_0xdcbc('0x31')]=qs['limit'](_0x4d9567[_0xdcbc('0x45')]['limit']);_0x150bb4[_0xdcbc('0x30')]=qs['offset'](_0x4d9567[_0xdcbc('0x45')][_0xdcbc('0x30')]);}_0x150bb4[_0xdcbc('0x70')]=qs[_0xdcbc('0x4d')](_0x4d9567[_0xdcbc('0x45')][_0xdcbc('0x4d')]);_0x150bb4[_0xdcbc('0x51')]=qs['filters'](_[_0xdcbc('0x4e')](_0x4d9567['query'],_0xeee135['filters']));_0x150bb4[_0xdcbc('0x51')][_0xdcbc('0x67')]=_0x930085['id'];if(_0x4d9567[_0xdcbc('0x45')][_0xdcbc('0x4f')]){_0x150bb4[_0xdcbc('0x51')]=_[_0xdcbc('0x50')](_0x150bb4[_0xdcbc('0x51')],{'$or':_[_0xdcbc('0x42')](_0x150bb4[_0xdcbc('0x48')],function(_0x5d3fb8){var _0x3d7561={};_0x3d7561[_0x5d3fb8]={'$like':'%'+_0x4d9567[_0xdcbc('0x45')]['filter']+'%'};return _0x3d7561;})});}_0x150bb4=_[_0xdcbc('0x50')]({},_0x150bb4,_0x4d9567['options']);return db[_0xdcbc('0xbc')]['count']({'where':_0x150bb4[_0xdcbc('0x51')]})[_0xdcbc('0x23')](function(_0x354ba9){_0x117a34[_0xdcbc('0x33')]=_0x354ba9;if(_0x4d9567[_0xdcbc('0x45')]['includeAll']){_0x150bb4[_0xdcbc('0x6b')]=[{'model':db[_0xdcbc('0xaa')],'as':_0xdcbc('0x101'),'required':![]},{'model':db[_0xdcbc('0xc7')],'as':'Owner','attributes':[_0xdcbc('0x3e'),_0xdcbc('0x102'),'internal'],'required':![]},{'model':db[_0xdcbc('0x103')],'as':'Tags','attributes':['id',_0xdcbc('0x3e'),'color'],'where':_0x4d9567[_0xdcbc('0x45')]['tag']?{'id':_0x4d9567['query'][_0xdcbc('0x104')]}:undefined,'required':_0x4d9567[_0xdcbc('0x45')][_0xdcbc('0x104')]?!![]:![]}];}return db[_0xdcbc('0xbc')]['findAll'](_0x150bb4);})['then'](function(_0x2d978d){_0x117a34[_0xdcbc('0x57')]=_0x2d978d;return _0x117a34;});}})[_0xdcbc('0x23')](respondWithFilteredResult(_0xf1f092,_0x150bb4))[_0xdcbc('0x58')](handleError(_0xf1f092,null));};function iftimePromise(_0x9c26dc,_0x5f5148){return respondWithRpcPromise(_0xdcbc('0x105'),_0xdcbc('0x106'),{'command':_0x5f5148['timezone']?util[_0xdcbc('0xb5')](_0xdcbc('0x107'),_0x9c26dc[_0xdcbc('0x108')],_0x5f5148[_0xdcbc('0x109')]):util[_0xdcbc('0xb5')](_0xdcbc('0x10a'),_0x9c26dc['interval'])},client9002)['then'](function(_0x2fffff){var _0x429446=_0x2fffff&&_0x2fffff[_0xdcbc('0x10b')](_0xdcbc('0x10c'))>=0x0?!![]:![];logger[_0xdcbc('0x2c')](_0xdcbc('0x10d'),_0x5f5148['id'],_0x9c26dc['id'],_0x9c26dc[_0xdcbc('0x108')],_0x429446?_0xdcbc('0x10e'):'OFFLINE',_0x5f5148[_0xdcbc('0x109')]?_0x5f5148['timezone']:_0xdcbc('0x10f'));return _0x429446;})[_0xdcbc('0x58')](function(_0x11fe78){logger[_0xdcbc('0x2a')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x5f5148['id'],_0x9c26dc['id'],_0x9c26dc[_0xdcbc('0x108')],util[_0xdcbc('0x110')](_0x11fe78,{'showHidden':![],'depth':null}),_0x5f5148[_0xdcbc('0x109')]?_0x5f5148[_0xdcbc('0x109')]:_0xdcbc('0x10f'));return![];});}exports[_0xdcbc('0x106')]=function(_0xa3f780,_0x3508b9,_0x2ae507){var _0x3b5247=0x0;var _0x4d7789=0x0;var _0x72756e=![];var _0x2d92c2;var _0x191c5;return db['ChatWebsite'][_0xdcbc('0x5d')]({'where':{'id':_0xa3f780['params']['id']},'include':[{'model':db[_0xdcbc('0x111')],'as':_0xdcbc('0x111'),'include':[{'model':db[_0xdcbc('0x111')],'as':_0xdcbc('0x112'),'attributes':['id',_0xdcbc('0x108')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x3508b9,null))[_0xdcbc('0x23')](function(_0x10d979){if(_0x10d979){_0x2d92c2=_0x10d979;return _0x10d979[_0xdcbc('0x113')]({'raw':!![]});}})[_0xdcbc('0x23')](function(_0x1c7e35){if(_0x2d92c2){if(_0x1c7e35){_0x191c5=_0x1c7e35;}}return require(_0xdcbc('0x1a'))[_0xdcbc('0x7d')]();})[_0xdcbc('0x23')](function(_0x310369){if(_0x310369){_0x4d7789=_0x310369['virtual'];_0x72756e=_0x310369['custom'];}})['then'](function(){return db[_0xdcbc('0xbc')][_0xdcbc('0x33')]({'where':{'closed':![]}});})[_0xdcbc('0x23')](function(_0x4e0707){_0x3b5247=_0x4e0707;if(_0x4d7789&&_0x4e0707>_0x4d7789){return db[_0xdcbc('0x114')]['findOne']({'where':{'id':0x1}})[_0xdcbc('0x23')](function(_0x36616d){if(_0x36616d){_0x36616d['increment'](_0xdcbc('0x115'));}});}})[_0xdcbc('0x23')](function(){if(_0x2d92c2[_0xdcbc('0x111')]&&_0x2d92c2['Interval'][_0xdcbc('0x112')]){var _0x418299=[];for(var _0x16fb7a=0x0;_0x16fb7a<_0x2d92c2['Interval']['Intervals']['length'];_0x16fb7a++){var _0x463798=_0x2d92c2['Interval'][_0xdcbc('0x112')][_0x16fb7a][_0xdcbc('0x3a')]({'plain':!![]});_0x418299[_0xdcbc('0x116')](iftimePromise(_0x463798,_0x2d92c2));}return BPromise['all'](_0x418299)['then'](function(_0xfe0304){return _['some'](_0xfe0304);});}else{return!![];}})[_0xdcbc('0x23')](function(_0x2ec9e5){var _0x230226=fs[_0xdcbc('0xd7')](path[_0xdcbc('0x7b')](config[_0xdcbc('0x7c')],'server/files/chat/iframe.ejs'),_0xdcbc('0xd8'));var _0x25c7a5={'remote':_0x2d92c2['remote'],'query':querystring[_0xdcbc('0x28')](_[_0xdcbc('0x50')](_0x2d92c2['get']({'plain':!![]}),{'customerIp':_0xa3f780[_0xdcbc('0x8e')][_0xdcbc('0xae')]||_0xa3f780[_0xdcbc('0x8e')][_0xdcbc('0x117')]||_0xa3f780[_0xdcbc('0x118')][_0xdcbc('0x119')]||_0xa3f780['ip'],'referer':_0xa3f780['headers'][_0xdcbc('0xb2')],'openedInteractions':_0x3b5247,'maxInteractions':_0x4d7789,'virtual':_0x72756e['virtual'],'online':_0x2ec9e5,'custom':_0x72756e}))['replace'](/'/g,'\x5c\x27')};_0x3508b9[_0xdcbc('0xd2')](ejs[_0xdcbc('0xd9')](Mustache[_0xdcbc('0xd9')](_0x230226,_0x25c7a5),{'proactiveActions':_0x191c5,'alignment':_0x2d92c2[_0xdcbc('0x11a')],'verticalAlignment':_0x2d92c2[_0xdcbc('0x11b')],'div_color':_0x2d92c2[_0xdcbc('0x11c')],'text_color':_0x2d92c2[_0xdcbc('0x11d')],'button_color':_0x2d92c2[_0xdcbc('0x11e')],'background_color':_0x2d92c2['backgroundColor']}));})['catch'](handleError(_0x3508b9,null));};exports[_0xdcbc('0x11f')]=function(_0x5784f4,_0x579b92,_0x2c8acb){return db['ChatWebsite'][_0xdcbc('0x6a')]({'where':{'id':_0x5784f4['params']['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x579b92,null))[_0xdcbc('0x23')](function(_0x730713){if(_0x730713){return db['sequelize'][_0xdcbc('0xe5')](function(_0x4a147a){return db[_0xdcbc('0xa2')][_0xdcbc('0x39')]({'where':{'ChatWebsiteId':_0x5784f4[_0xdcbc('0x5a')]['id']},'transaction':_0x4a147a})[_0xdcbc('0x23')](function(_0x34830c){var _0x4445f2=_[_0xdcbc('0x42')](_0x5784f4['body'],function(_0x105fc8){_0x105fc8[_0xdcbc('0x67')]=_0x5784f4[_0xdcbc('0x5a')]['id'];return _0x105fc8;});return db[_0xdcbc('0xa2')][_0xdcbc('0xe7')](_0x4445f2,{'transaction':_0x4a147a});});})['then'](function(){return db[_0xdcbc('0xa2')][_0xdcbc('0x120')]({'where':{'ChatWebsiteId':_0x5784f4[_0xdcbc('0x5a')]['id']},'order':_0xdcbc('0x121')});});}})[_0xdcbc('0x23')](respondWithResult(_0x579b92,null))['catch'](handleError(_0x579b92,null));};exports[_0xdcbc('0x122')]=function(_0x117edb,_0x8d865c,_0x512df9){var _0x5567f8={};var _0xa6c89b={};var _0x9ec2c8;var _0x3802da;return db['ChatWebsite'][_0xdcbc('0x6a')]({'where':{'id':_0x117edb[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x8d865c,null))[_0xdcbc('0x23')](function(_0x44eba8){if(_0x44eba8){_0x9ec2c8=_0x44eba8;_0xa6c89b[_0xdcbc('0x44')]=_[_0xdcbc('0x5b')](db[_0xdcbc('0xa2')][_0xdcbc('0x5c')]);_0xa6c89b[_0xdcbc('0x45')]=_[_0xdcbc('0x5b')](_0x117edb['query']);_0xa6c89b[_0xdcbc('0x46')]=_[_0xdcbc('0x47')](_0xa6c89b['model'],_0xa6c89b[_0xdcbc('0x45')]);_0x5567f8[_0xdcbc('0x48')]=_[_0xdcbc('0x47')](_0xa6c89b[_0xdcbc('0x44')],qs[_0xdcbc('0x49')](_0x117edb['query']['fields']));_0x5567f8[_0xdcbc('0x48')]=_0x5567f8[_0xdcbc('0x48')]['length']?_0x5567f8[_0xdcbc('0x48')]:_0xa6c89b['model'];_0x5567f8[_0xdcbc('0x70')]=qs[_0xdcbc('0x4d')](_0x117edb[_0xdcbc('0x45')][_0xdcbc('0x4d')]);_0x5567f8[_0xdcbc('0x51')]=qs[_0xdcbc('0x46')](_[_0xdcbc('0x4e')](_0x117edb[_0xdcbc('0x45')],_0xa6c89b[_0xdcbc('0x46')]));if(_0x117edb[_0xdcbc('0x45')][_0xdcbc('0x4f')]){_0x5567f8[_0xdcbc('0x51')]=_[_0xdcbc('0x50')](_0x5567f8[_0xdcbc('0x51')],{'$or':_['map'](_0x5567f8[_0xdcbc('0x48')],function(_0x2875df){var _0x57c6fb={};_0x57c6fb[_0x2875df]={'$like':'%'+_0x117edb[_0xdcbc('0x45')][_0xdcbc('0x4f')]+'%'};return _0x57c6fb;})});}_0x5567f8=_[_0xdcbc('0x50')]({},_0x5567f8,_0x117edb['options']);return _0x9ec2c8['getApplications'](_0x5567f8);}})[_0xdcbc('0x23')](function(_0xcb6986){if(_0xcb6986){_0x3802da=_0xcb6986[_0xdcbc('0x4a')];if(!_0x117edb[_0xdcbc('0x45')][_0xdcbc('0x4b')](_0xdcbc('0x4c'))){_0x5567f8[_0xdcbc('0x31')]=qs[_0xdcbc('0x31')](_0x117edb[_0xdcbc('0x45')][_0xdcbc('0x31')]);_0x5567f8[_0xdcbc('0x30')]=qs['offset'](_0x117edb['query'][_0xdcbc('0x30')]);}return _0x9ec2c8['getApplications'](_0x5567f8);}})[_0xdcbc('0x23')](function(_0x14e7ae){if(_0x14e7ae){return _0x14e7ae?{'count':_0x3802da,'rows':_0x14e7ae}:null;}})[_0xdcbc('0x23')](respondWithResult(_0x8d865c,null))[_0xdcbc('0x58')](handleError(_0x8d865c,null));};exports['addProactiveActions']=function(_0xe3329f,_0x1a11a1,_0x1b0844){return db[_0xdcbc('0x123')][_0xdcbc('0x5d')]({'where':{'id':_0xe3329f[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x1a11a1,null))[_0xdcbc('0x23')](function(_0x44382f){if(_0x44382f){return _0x44382f[_0xdcbc('0x124')](_0xe3329f[_0xdcbc('0x5f')][_0xdcbc('0x6d')],_[_0xdcbc('0x100')](_0xe3329f[_0xdcbc('0x5f')],[_0xdcbc('0x6d'),'id'])||{});}})[_0xdcbc('0x23')](respondWithResult(_0x1a11a1,null))[_0xdcbc('0x58')](handleError(_0x1a11a1,null));};exports[_0xdcbc('0x113')]=function(_0x111a47,_0x473642,_0x580845){var _0x123db5={};var _0x23f710={};var _0x86db36;var _0x21877a;return db['ChatWebsite'][_0xdcbc('0x6a')]({'where':{'id':_0x111a47['params']['id']}})['then'](handleEntityNotFound(_0x473642,null))[_0xdcbc('0x23')](function(_0x278d5f){if(_0x278d5f){_0x86db36=_0x278d5f;_0x23f710[_0xdcbc('0x44')]=_[_0xdcbc('0x5b')](db[_0xdcbc('0x125')][_0xdcbc('0x5c')]);_0x23f710[_0xdcbc('0x45')]=_[_0xdcbc('0x5b')](_0x111a47[_0xdcbc('0x45')]);_0x23f710[_0xdcbc('0x46')]=_[_0xdcbc('0x47')](_0x23f710[_0xdcbc('0x44')],_0x23f710['query']);_0x123db5[_0xdcbc('0x48')]=_['intersection'](_0x23f710[_0xdcbc('0x44')],qs[_0xdcbc('0x49')](_0x111a47[_0xdcbc('0x45')][_0xdcbc('0x49')]));_0x123db5[_0xdcbc('0x48')]=_0x123db5[_0xdcbc('0x48')][_0xdcbc('0x4a')]?_0x123db5[_0xdcbc('0x48')]:_0x23f710[_0xdcbc('0x44')];_0x123db5[_0xdcbc('0x70')]=qs[_0xdcbc('0x4d')](_0x111a47['query'][_0xdcbc('0x4d')]);_0x123db5[_0xdcbc('0x51')]=qs[_0xdcbc('0x46')](_[_0xdcbc('0x4e')](_0x111a47[_0xdcbc('0x45')],_0x23f710[_0xdcbc('0x46')]));if(_0x111a47[_0xdcbc('0x45')][_0xdcbc('0x4f')]){_0x123db5[_0xdcbc('0x51')]=_['merge'](_0x123db5[_0xdcbc('0x51')],{'$or':_[_0xdcbc('0x42')](_0x123db5['attributes'],function(_0x432da2){var _0x164e6e={};_0x164e6e[_0x432da2]={'$like':'%'+_0x111a47[_0xdcbc('0x45')][_0xdcbc('0x4f')]+'%'};return _0x164e6e;})});}_0x123db5=_[_0xdcbc('0x50')]({},_0x123db5,_0x111a47[_0xdcbc('0x53')]);return _0x86db36[_0xdcbc('0x113')](_0x123db5);}})[_0xdcbc('0x23')](function(_0x3a8bec){if(_0x3a8bec){_0x21877a=_0x3a8bec[_0xdcbc('0x4a')];if(!_0x111a47[_0xdcbc('0x45')][_0xdcbc('0x4b')](_0xdcbc('0x4c'))){_0x123db5[_0xdcbc('0x31')]=qs[_0xdcbc('0x31')](_0x111a47[_0xdcbc('0x45')]['limit']);_0x123db5['offset']=qs[_0xdcbc('0x30')](_0x111a47['query'][_0xdcbc('0x30')]);}return _0x86db36[_0xdcbc('0x113')](_0x123db5);}})[_0xdcbc('0x23')](function(_0x2af3c6){if(_0x2af3c6){return _0x2af3c6?{'count':_0x21877a,'rows':_0x2af3c6}:null;}})[_0xdcbc('0x23')](respondWithResult(_0x473642,null))[_0xdcbc('0x58')](handleError(_0x473642,null));};exports[_0xdcbc('0x126')]=function(_0x4167c1,_0xdd6dba,_0x4b6884){var _0x1a7ab7=_0x4167c1['query'][_0xdcbc('0x127')]===_0xdcbc('0x128')?_0xdcbc('0x129'):'onlineForm';return db['ChatWebsite']['find']({'attributes':['id',_0x1a7ab7],'where':{'id':_0x4167c1[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0xdd6dba,null))[_0xdcbc('0x23')](function(_0x5b36e3){if(_0x5b36e3){var _0x42a7a7=_0x5b36e3[_0x1a7ab7];var _0x294be7=_0x42a7a7&&_0x42a7a7[_0xdcbc('0x12a')]?_0x42a7a7[_0xdcbc('0x12a')]:[];_0xdd6dba[_0xdcbc('0xd2')]({'fromKey':_[_0xdcbc('0x83')](_0x42a7a7[_0xdcbc('0x12b')])?undefined:_0x42a7a7[_0xdcbc('0x12b')],'count':_0x294be7[_0xdcbc('0x4a')],'rows':_0x294be7});}})[_0xdcbc('0x58')](handleError(_0xdd6dba,null));};exports[_0xdcbc('0x12c')]=function(_0x120679,_0x5d47c2,_0x27f1be){var _0x19598a={'raw':![],'where':{}};var _0x154094={};var _0x4c88bc={'count':0x0,'rows':[]};return db[_0xdcbc('0x55')][_0xdcbc('0x6a')]({'where':{'id':_0x120679[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x5d47c2,null))[_0xdcbc('0x23')](function(_0x2e65d8){if(_0x2e65d8){_0x154094[_0xdcbc('0x44')]=_['keys'](db[_0xdcbc('0xdc')][_0xdcbc('0x5c')]);_0x154094[_0xdcbc('0x45')]=_[_0xdcbc('0x5b')](_0x120679[_0xdcbc('0x45')]);_0x154094[_0xdcbc('0x46')]=_[_0xdcbc('0x47')](_0x154094[_0xdcbc('0x44')],_0x154094[_0xdcbc('0x45')]);_0x19598a[_0xdcbc('0x48')]=_[_0xdcbc('0x47')](_0x154094['model'],qs[_0xdcbc('0x49')](_0x120679[_0xdcbc('0x45')][_0xdcbc('0x49')]));_0x19598a[_0xdcbc('0x48')]=_0x19598a[_0xdcbc('0x48')][_0xdcbc('0x4a')]?_0x19598a[_0xdcbc('0x48')]:_0x154094[_0xdcbc('0x44')];if(!_0x120679[_0xdcbc('0x45')][_0xdcbc('0x4b')](_0xdcbc('0x4c'))){_0x19598a[_0xdcbc('0x31')]=qs[_0xdcbc('0x31')](_0x120679[_0xdcbc('0x45')][_0xdcbc('0x31')]);_0x19598a['offset']=qs['offset'](_0x120679['query'][_0xdcbc('0x30')]);}_0x19598a[_0xdcbc('0x70')]=qs[_0xdcbc('0x4d')](_0x120679[_0xdcbc('0x45')][_0xdcbc('0x4d')]);_0x19598a['where']=qs[_0xdcbc('0x46')](_[_0xdcbc('0x4e')](_0x120679[_0xdcbc('0x45')],_0x154094['filters']));_0x19598a['where'][_0xdcbc('0x67')]=_0x2e65d8['id'];if(_0x120679['query']['filter']){_0x19598a[_0xdcbc('0x51')]=_[_0xdcbc('0x50')](_0x19598a[_0xdcbc('0x51')],{'$or':_[_0xdcbc('0x42')](_0x19598a['attributes'],function(_0x3ba46a){var _0x49bd66={};_0x49bd66[_0x3ba46a]={'$like':'%'+_0x120679[_0xdcbc('0x45')]['filter']+'%'};return _0x49bd66;})});}_0x19598a=_[_0xdcbc('0x50')]({},_0x19598a,_0x120679['options']);return db[_0xdcbc('0xdc')]['count']({'where':_0x19598a[_0xdcbc('0x51')]})[_0xdcbc('0x23')](function(_0x4560c1){_0x4c88bc[_0xdcbc('0x33')]=_0x4560c1;if(_0x120679['query'][_0xdcbc('0x54')]){_0x19598a[_0xdcbc('0x6b')]=[{'all':!![]}];}else{_0x19598a[_0xdcbc('0x6b')]=[{'model':db[_0xdcbc('0xaa')],'as':_0xdcbc('0x101'),'required':![]},{'model':db[_0xdcbc('0xe6')],'as':_0xdcbc('0x12d'),'required':![]}];}return db[_0xdcbc('0xdc')][_0xdcbc('0x56')](_0x19598a);})[_0xdcbc('0x23')](function(_0x3f1199){_0x4c88bc[_0xdcbc('0x57')]=_0x3f1199;return _0x4c88bc;});}})[_0xdcbc('0x23')](respondWithFilteredResult(_0x5d47c2,_0x19598a))[_0xdcbc('0x58')](handleError(_0x5d47c2,null));};exports['addAgents']=function(_0x17f605,_0x445460,_0x2c4b67){return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0x17f605[_0xdcbc('0x5a')]['id']}})['then'](handleEntityNotFound(_0x445460,null))[_0xdcbc('0x23')](function(_0x356db6){if(_0x356db6){return _0x356db6['addAgents'](_0x17f605['body'][_0xdcbc('0x6d')],_[_0xdcbc('0x100')](_0x17f605['body'],[_0xdcbc('0x6d'),'id'])||{})[_0xdcbc('0xbf')](function(_0x9eb906){for(var _0x425271=0x0;_0x425271<_0x17f605[_0xdcbc('0x5f')][_0xdcbc('0x6d')][_0xdcbc('0x4a')];_0x425271+=0x1){socket['emit'](_0xdcbc('0x12e'),{'UserId':Number(_0x17f605[_0xdcbc('0x5f')][_0xdcbc('0x6d')][_0x425271]),'ChatWebsiteId':Number(_0x17f605[_0xdcbc('0x5a')]['id'])});}return _0x9eb906;});}})['then'](respondWithResult(_0x445460,null))[_0xdcbc('0x58')](handleError(_0x445460,null));};exports[_0xdcbc('0x12f')]=function(_0x2e0005,_0x400a00,_0x1d2ab0){return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0x2e0005['params']['id']}})['then'](handleEntityNotFound(_0x400a00,null))['then'](function(_0x3e6776){if(_0x3e6776){return _0x3e6776[_0xdcbc('0x12f')](_0x2e0005[_0xdcbc('0x45')]['ids'])[_0xdcbc('0x23')](function(){if(_['isArray'](_0x2e0005[_0xdcbc('0x45')][_0xdcbc('0x6d')])){for(var _0x4d8f09=0x0;_0x4d8f09<_0x2e0005[_0xdcbc('0x45')][_0xdcbc('0x6d')]['length'];_0x4d8f09+=0x1){socket[_0xdcbc('0x130')](_0xdcbc('0x131'),{'UserId':Number(_0x2e0005['query'][_0xdcbc('0x6d')][_0x4d8f09]),'ChatWebsiteId':Number(_0x2e0005[_0xdcbc('0x5a')]['id'])});}}else{socket[_0xdcbc('0x130')](_0xdcbc('0x131'),{'UserId':Number(_0x2e0005[_0xdcbc('0x45')][_0xdcbc('0x6d')]),'ChatWebsiteId':Number(_0x2e0005[_0xdcbc('0x5a')]['id'])});}});}})[_0xdcbc('0x23')](respondWithStatusCode(_0x400a00,null))['catch'](handleError(_0x400a00,null));};exports[_0xdcbc('0x132')]=function(_0x15ccc1,_0x2ee409,_0xe9259d){var _0x520850={};var _0x295304={};var _0x543d33;var _0x8eff12;return db['ChatWebsite'][_0xdcbc('0x6a')]({'where':{'id':_0x15ccc1[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x2ee409,null))[_0xdcbc('0x23')](function(_0x1f42f4){if(_0x1f42f4){_0x543d33=_0x1f42f4;_0x295304[_0xdcbc('0x44')]=_[_0xdcbc('0x5b')](db[_0xdcbc('0xc7')][_0xdcbc('0x5c')]);_0x295304[_0xdcbc('0x45')]=_['keys'](_0x15ccc1[_0xdcbc('0x45')]);_0x295304[_0xdcbc('0x46')]=_[_0xdcbc('0x47')](_0x295304[_0xdcbc('0x44')],_0x295304['query']);_0x520850['attributes']=_[_0xdcbc('0x47')](_0x295304[_0xdcbc('0x44')],qs[_0xdcbc('0x49')](_0x15ccc1[_0xdcbc('0x45')]['fields']));_0x520850[_0xdcbc('0x48')]=_0x520850[_0xdcbc('0x48')][_0xdcbc('0x4a')]?_0x520850[_0xdcbc('0x48')]:_0x295304['model'];_0x520850[_0xdcbc('0x70')]=qs[_0xdcbc('0x4d')](_0x15ccc1[_0xdcbc('0x45')][_0xdcbc('0x4d')]);_0x520850[_0xdcbc('0x51')]=qs[_0xdcbc('0x46')](_[_0xdcbc('0x4e')](_0x15ccc1[_0xdcbc('0x45')],_0x295304[_0xdcbc('0x46')]));if(_0x15ccc1[_0xdcbc('0x45')][_0xdcbc('0x4f')]){_0x520850['where']=_[_0xdcbc('0x50')](_0x520850[_0xdcbc('0x51')],{'$or':_[_0xdcbc('0x42')](_0x520850['attributes'],function(_0x5523e3){var _0x5b1098={};_0x5b1098[_0x5523e3]={'$like':'%'+_0x15ccc1[_0xdcbc('0x45')]['filter']+'%'};return _0x5b1098;})});}_0x520850=_[_0xdcbc('0x50')]({},_0x520850,_0x15ccc1[_0xdcbc('0x53')]);return _0x543d33[_0xdcbc('0x132')](_0x520850);}})[_0xdcbc('0x23')](function(_0x369447){if(_0x369447){_0x8eff12=_0x369447['length'];if(!_0x15ccc1[_0xdcbc('0x45')][_0xdcbc('0x4b')]('nolimit')){_0x520850[_0xdcbc('0x31')]=qs[_0xdcbc('0x31')](_0x15ccc1[_0xdcbc('0x45')]['limit']);_0x520850[_0xdcbc('0x30')]=qs['offset'](_0x15ccc1[_0xdcbc('0x45')][_0xdcbc('0x30')]);}return _0x543d33[_0xdcbc('0x132')](_0x520850);}})[_0xdcbc('0x23')](function(_0x4f6f1b){if(_0x4f6f1b){return _0x4f6f1b?{'count':_0x8eff12,'rows':_0x4f6f1b}:null;}})[_0xdcbc('0x23')](respondWithResult(_0x2ee409,null))[_0xdcbc('0x58')](handleError(_0x2ee409,null));};
\ No newline at end of file
+var _0x5a8c=['info','debug','stringify','error','message','ChatWebsite,\x20%s,\x20%s','request\x20sent','result','catch','status','end','undefined','limit','count','apply','reject','save','then','destroy','ChatWebsites','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','offset','sort','where','pick','filter','merge','map','VIRTUAL','options','ChatWebsite','includeAll','findAll','show','params','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','update','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','order','rows','removeDispositions','ids','CannedAnswer','getAnswers','findOne','addLogo','sitepic','file','filename','addAvatar','agentAvatar','customerAvatar','addSystemAvatar','systemAvatar','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','server/files/images/logos/','join','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','existsSync','getSystemAvatar','notify','setUA','headers','user-agent','getResult','chat','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','Applications','account','applications','list','orderBy','priority','asc','defaults','ListId','CmContact','customerIp','cf-connecting-ip','first','x-forwarded-for','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','firstName','contact','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','toPairs','ChatOfflineMessage','originalname','mimetype','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','toPairsIn','mapValues','subjectOffline','offlineMessageSubject','NotifyMailAccount','notifyMail','server','remove','addInteraction','omit','getInteractions','hasOwnProperty','Contact','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','indexOf','true','ONLINE','OFFLINE','timezone','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','utf8','x-real-ip','referer','virtual','render','textColor','color_button','backgroundColor','ChatApplication','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','spread','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request'];(function(_0x673722,_0x275d7e){var _0x21249c=function(_0x25b4e7){while(--_0x25b4e7){_0x673722['push'](_0x673722['shift']());}};_0x21249c(++_0x275d7e);}(_0x5a8c,0x116));var _0xc5a8=function(_0x34198b,_0x237ae9){_0x34198b=_0x34198b-0x0;var _0x1cd59=_0x5a8c[_0x34198b];return _0x1cd59;};'use strict';var emlformat=require(_0xc5a8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc5a8('0x1'));var jsonpatch=require(_0xc5a8('0x2'));var rp=require('request-promise');var moment=require(_0xc5a8('0x3'));var BPromise=require(_0xc5a8('0x4'));var Mustache=require(_0xc5a8('0x5'));var util=require('util');var path=require(_0xc5a8('0x6'));var sox=require(_0xc5a8('0x7'));var csv=require(_0xc5a8('0x8'));var ejs=require(_0xc5a8('0x9'));var fs=require('fs');var fs_extra=require(_0xc5a8('0xa'));var _=require(_0xc5a8('0xb'));var squel=require(_0xc5a8('0xc'));var crypto=require(_0xc5a8('0xd'));var jsforce=require(_0xc5a8('0xe'));var deskjs=require(_0xc5a8('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc5a8('0x10'));var Papa=require(_0xc5a8('0x11'));var Redis=require(_0xc5a8('0x12'));var authService=require(_0xc5a8('0x13'));var qs=require(_0xc5a8('0x14'));var as=require(_0xc5a8('0x15'));var hardwareService=require(_0xc5a8('0x16'));var logger=require(_0xc5a8('0x17'))(_0xc5a8('0x18'));var utils=require(_0xc5a8('0x19'));var config=require(_0xc5a8('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xc5a8('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xc5a8('0x1c'))(new Redis(config[_0xc5a8('0x1b')]));require(_0xc5a8('0x1d'))[_0xc5a8('0x1e')](socket);var jayson=require(_0xc5a8('0x1f'));var client=jayson[_0xc5a8('0x20')]['http']({'port':0x232c});var client9002=jayson[_0xc5a8('0x20')][_0xc5a8('0x21')]({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson[_0xc5a8('0x20')][_0xc5a8('0x21')]({'port':0x2329});function respondWithRpcPromise(_0x5e7f8b,_0x5e7945,_0x1a0121,_0x48dd4c){return new BPromise(function(_0xfd3ddb,_0x12ce9c){var _0x5f0816=_0x48dd4c||client;return _0x5f0816[_0xc5a8('0x22')](_0x5e7f8b,_0x1a0121)['then'](function(_0x416a14){logger[_0xc5a8('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x5e7945,'request\x20sent');logger[_0xc5a8('0x24')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5e7945,'request\x20sent',JSON[_0xc5a8('0x25')](_0x416a14));if(_0x416a14[_0xc5a8('0x26')]){if(_0x416a14[_0xc5a8('0x26')]['code']===0x1f4){logger[_0xc5a8('0x26')]('ChatWebsite,\x20%s,\x20%s',_0x5e7945,_0x416a14[_0xc5a8('0x26')][_0xc5a8('0x27')]);return _0x12ce9c(_0x416a14[_0xc5a8('0x26')]['message']);}logger[_0xc5a8('0x26')]('ChatWebsite,\x20%s,\x20%s',_0x5e7945,_0x416a14[_0xc5a8('0x26')]['message']);return _0xfd3ddb(_0x416a14[_0xc5a8('0x26')]['message']);}else{logger[_0xc5a8('0x23')](_0xc5a8('0x28'),_0x5e7945,_0xc5a8('0x29'));_0xfd3ddb(_0x416a14[_0xc5a8('0x2a')][_0xc5a8('0x27')]);}})[_0xc5a8('0x2b')](function(_0x1a0c4c){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x5e7945,_0x1a0c4c);_0x12ce9c(_0x1a0c4c);});});}function respondWithStatusCode(_0x1badf6,_0x484ebc){_0x484ebc=_0x484ebc||0xcc;return function(_0x336fa0){if(_0x336fa0){return _0x1badf6['sendStatus'](_0x484ebc);}return _0x1badf6[_0xc5a8('0x2c')](_0x484ebc)[_0xc5a8('0x2d')]();};}function respondWithResult(_0xa38638,_0x4bae8a){_0x4bae8a=_0x4bae8a||0xc8;return function(_0x16f807){if(_0x16f807){return _0xa38638[_0xc5a8('0x2c')](_0x4bae8a)['json'](_0x16f807);}};}function respondWithFilteredResult(_0x5041c0,_0x56e898){return function(_0x59f39f){if(_0x59f39f){var _0x83fcfc=typeof _0x56e898['offset']===_0xc5a8('0x2e')&&typeof _0x56e898[_0xc5a8('0x2f')]==='undefined';var _0x469817=_0x59f39f['count'];var _0x3c9988=_0x83fcfc?0x0:_0x56e898['offset'];var _0xe86052=_0x83fcfc?_0x59f39f[_0xc5a8('0x30')]:_0x56e898['offset']+_0x56e898['limit'];var _0x201619;if(_0xe86052>=_0x469817){_0xe86052=_0x469817;_0x201619=0xc8;}else{_0x201619=0xce;}_0x5041c0[_0xc5a8('0x2c')](_0x201619);return _0x5041c0['set']('Content-Range',_0x3c9988+'-'+_0xe86052+'/'+_0x469817)['json'](_0x59f39f);}return null;};}function patchUpdates(_0x138417){return function(_0x3154b7){try{jsonpatch[_0xc5a8('0x31')](_0x3154b7,_0x138417,!![]);}catch(_0x29a570){return BPromise[_0xc5a8('0x32')](_0x29a570);}return _0x3154b7[_0xc5a8('0x33')]();};}function saveUpdates(_0x178c5e,_0x4b589e){return function(_0x7389de){if(_0x7389de){return _0x7389de['update'](_0x178c5e)[_0xc5a8('0x34')](function(_0x5b06b9){return _0x5b06b9;});}return null;};}function removeEntity(_0x491302,_0x39645e){return function(_0x47148d){if(_0x47148d){return _0x47148d[_0xc5a8('0x35')]()[_0xc5a8('0x34')](function(){var _0x3be15c=_0x47148d['get']({'plain':!![]});var _0x38f2c8=_0xc5a8('0x36');return db[_0xc5a8('0x37')][_0xc5a8('0x35')]({'where':{'type':_0x38f2c8,'resourceId':_0x3be15c['id']}})[_0xc5a8('0x34')](function(){return _0x47148d;});})[_0xc5a8('0x34')](function(){_0x491302['status'](0xcc)[_0xc5a8('0x2d')]();});}};}function handleEntityNotFound(_0x4d62cc,_0xeeac22){return function(_0x29c0c1){if(!_0x29c0c1){_0x4d62cc[_0xc5a8('0x38')](0x194);}return _0x29c0c1;};}function handleError(_0x4a8ac4,_0xaaa1fc){_0xaaa1fc=_0xaaa1fc||0x1f4;return function(_0x5013d6){logger[_0xc5a8('0x26')](_0x5013d6[_0xc5a8('0x39')]);if(_0x5013d6['name']){delete _0x5013d6[_0xc5a8('0x3a')];}_0x4a8ac4[_0xc5a8('0x2c')](_0xaaa1fc)[_0xc5a8('0x3b')](_0x5013d6);};}exports[_0xc5a8('0x3c')]=function(_0x1330e6,_0x39e663){var _0x4933d9={'include':[{'model':db[_0xc5a8('0x3d')],'as':_0xc5a8('0x3e')}]},_0x9dd4ec={},_0xa19066={'count':0x0,'rows':[]};var _0x5ef3e6=_['map'](db['ChatWebsite'][_0xc5a8('0x3f')],function(_0x4cdbe0){return{'name':_0x4cdbe0['fieldName'],'type':_0x4cdbe0[_0xc5a8('0x40')]['key']};});_0x9dd4ec[_0xc5a8('0x41')]=_['map'](_0x5ef3e6,_0xc5a8('0x3a'));_0x9dd4ec[_0xc5a8('0x42')]=_[_0xc5a8('0x43')](_0x1330e6[_0xc5a8('0x42')]);_0x9dd4ec[_0xc5a8('0x44')]=_['intersection'](_0x9dd4ec['model'],_0x9dd4ec['query']);_0x4933d9[_0xc5a8('0x45')]=_[_0xc5a8('0x46')](_0x9dd4ec['model'],qs[_0xc5a8('0x47')](_0x1330e6['query'][_0xc5a8('0x47')]));_0x4933d9[_0xc5a8('0x45')]=_0x4933d9[_0xc5a8('0x45')][_0xc5a8('0x48')]?_0x4933d9[_0xc5a8('0x45')]:_0x9dd4ec[_0xc5a8('0x41')];if(!_0x1330e6[_0xc5a8('0x42')]['hasOwnProperty'](_0xc5a8('0x49'))){_0x4933d9['limit']=qs[_0xc5a8('0x2f')](_0x1330e6['query'][_0xc5a8('0x2f')]);_0x4933d9[_0xc5a8('0x4a')]=qs[_0xc5a8('0x4a')](_0x1330e6[_0xc5a8('0x42')][_0xc5a8('0x4a')]);}_0x4933d9['order']=qs['sort'](_0x1330e6[_0xc5a8('0x42')][_0xc5a8('0x4b')]);_0x4933d9[_0xc5a8('0x4c')]=qs[_0xc5a8('0x44')](_[_0xc5a8('0x4d')](_0x1330e6[_0xc5a8('0x42')],_0x9dd4ec[_0xc5a8('0x44')]),_0x5ef3e6);if(_0x1330e6[_0xc5a8('0x42')][_0xc5a8('0x4e')]){_0x4933d9[_0xc5a8('0x4c')]=_[_0xc5a8('0x4f')](_0x4933d9[_0xc5a8('0x4c')],{'$or':_[_0xc5a8('0x50')](_0x5ef3e6,function(_0x3b8c84){if(_0x3b8c84[_0xc5a8('0x40')]!==_0xc5a8('0x51')){var _0x495edf={};_0x495edf[_0x3b8c84['name']]={'$like':'%'+_0x1330e6['query']['filter']+'%'};return _0x495edf;}})});}_0x4933d9=_[_0xc5a8('0x4f')]({},_0x4933d9,_0x1330e6[_0xc5a8('0x52')]);var _0x437073={'where':_0x4933d9[_0xc5a8('0x4c')]};return db[_0xc5a8('0x53')][_0xc5a8('0x30')](_0x437073)[_0xc5a8('0x34')](function(_0x842bcd){_0xa19066[_0xc5a8('0x30')]=_0x842bcd;if(_0x1330e6['query'][_0xc5a8('0x54')]){_0x4933d9['include']=[{'all':!![]}];}return db[_0xc5a8('0x53')][_0xc5a8('0x55')](_0x4933d9);})[_0xc5a8('0x34')](function(_0x3b8112){_0xa19066['rows']=_0x3b8112;return _0xa19066;})[_0xc5a8('0x34')](respondWithFilteredResult(_0x39e663,_0x4933d9))['catch'](handleError(_0x39e663,null));};exports[_0xc5a8('0x56')]=function(_0xf0f4d,_0x320ff7){var _0x5bd427={'raw':![],'where':{'id':_0xf0f4d[_0xc5a8('0x57')]['id']},'include':[{'model':db[_0xc5a8('0x3d')],'as':_0xc5a8('0x3e')}]},_0x1d646b={};_0x1d646b[_0xc5a8('0x41')]=_[_0xc5a8('0x43')](db[_0xc5a8('0x53')][_0xc5a8('0x3f')]);_0x1d646b[_0xc5a8('0x42')]=_[_0xc5a8('0x43')](_0xf0f4d[_0xc5a8('0x42')]);_0x1d646b['filters']=_[_0xc5a8('0x46')](_0x1d646b[_0xc5a8('0x41')],_0x1d646b[_0xc5a8('0x42')]);_0x5bd427[_0xc5a8('0x45')]=_[_0xc5a8('0x46')](_0x1d646b[_0xc5a8('0x41')],qs[_0xc5a8('0x47')](_0xf0f4d[_0xc5a8('0x42')]['fields']));_0x5bd427['attributes']=_0x5bd427[_0xc5a8('0x45')]['length']?_0x5bd427['attributes']:_0x1d646b[_0xc5a8('0x41')];if(_0xf0f4d['query'][_0xc5a8('0x54')]){_0x5bd427[_0xc5a8('0x58')]=[{'all':!![]}];}_0x5bd427=_[_0xc5a8('0x4f')]({},_0x5bd427,_0xf0f4d['options']);return db[_0xc5a8('0x53')][_0xc5a8('0x59')](_0x5bd427)[_0xc5a8('0x34')](handleEntityNotFound(_0x320ff7,null))[_0xc5a8('0x34')](respondWithResult(_0x320ff7,null))[_0xc5a8('0x2b')](handleError(_0x320ff7,null));};exports[_0xc5a8('0x5a')]=function(_0xbfc753,_0x533609){return db[_0xc5a8('0x53')][_0xc5a8('0x5a')](_0xbfc753[_0xc5a8('0x5b')],{})[_0xc5a8('0x34')](function(_0x5cfadc){var _0x501a6e=_0xbfc753['user'][_0xc5a8('0x5c')]({'plain':!![]});if(!_0x501a6e)throw new Error(_0xc5a8('0x5d'));if(_0x501a6e[_0xc5a8('0x5e')]===_0xc5a8('0x5f')){var _0x3d5576=_0x5cfadc[_0xc5a8('0x5c')]({'plain':!![]});var _0x1fea9d=_0xc5a8('0x36');return db[_0xc5a8('0x60')][_0xc5a8('0x59')]({'where':{'name':_0x1fea9d,'userProfileId':_0x501a6e['userProfileId']},'raw':!![]})[_0xc5a8('0x34')](function(_0x5bdb58){if(_0x5bdb58&&_0x5bdb58[_0xc5a8('0x61')]===0x0){return db[_0xc5a8('0x37')]['create']({'name':_0x3d5576['name'],'resourceId':_0x3d5576['id'],'type':_0x5bdb58['name'],'sectionId':_0x5bdb58['id']},{})[_0xc5a8('0x34')](function(){return _0x5cfadc;});}else{return _0x5cfadc;}})[_0xc5a8('0x2b')](function(_0x2e3365){logger[_0xc5a8('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e3365);throw _0x2e3365;});}return _0x5cfadc;})[_0xc5a8('0x34')](respondWithResult(_0x533609,0xc9))[_0xc5a8('0x2b')](handleError(_0x533609,null));};exports[_0xc5a8('0x62')]=function(_0x28f103,_0x2c4529){if(_0x28f103['body']['id']){delete _0x28f103[_0xc5a8('0x5b')]['id'];}return db[_0xc5a8('0x53')][_0xc5a8('0x59')]({'where':{'id':_0x28f103[_0xc5a8('0x57')]['id']},'include':[{'model':db[_0xc5a8('0x3d')],'as':_0xc5a8('0x3e')}]})['then'](handleEntityNotFound(_0x2c4529,null))[_0xc5a8('0x34')](saveUpdates(_0x28f103['body'],null))[_0xc5a8('0x34')](respondWithResult(_0x2c4529,null))[_0xc5a8('0x2b')](handleError(_0x2c4529,null));};exports[_0xc5a8('0x35')]=function(_0x428aad,_0x410131){return db[_0xc5a8('0x53')]['find']({'where':{'id':_0x428aad[_0xc5a8('0x57')]['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0x410131,null))[_0xc5a8('0x34')](removeEntity(_0x410131,null))[_0xc5a8('0x2b')](handleError(_0x410131,null));};exports['describe']=function(_0x31bf8b,_0x1e3bbe){return db[_0xc5a8('0x53')][_0xc5a8('0x63')]()[_0xc5a8('0x34')](respondWithResult(_0x1e3bbe,null))[_0xc5a8('0x2b')](handleError(_0x1e3bbe,null));};exports[_0xc5a8('0x64')]=function(_0x441faf,_0x50b5f0,_0x484ff8){if(_0x441faf[_0xc5a8('0x5b')]['id']){delete _0x441faf['body']['id'];}return db[_0xc5a8('0x53')][_0xc5a8('0x59')]({'where':{'id':_0x441faf[_0xc5a8('0x57')]['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0x50b5f0,null))[_0xc5a8('0x34')](function(_0x5c7f8a){if(_0x5c7f8a){_0x441faf[_0xc5a8('0x5b')][_0xc5a8('0x65')]=_0x5c7f8a['id'];return db[_0xc5a8('0x66')][_0xc5a8('0x5a')](_0x441faf[_0xc5a8('0x5b')]);}})['then'](respondWithResult(_0x50b5f0,null))[_0xc5a8('0x2b')](handleError(_0x50b5f0,null));};exports[_0xc5a8('0x67')]=function(_0x55d2e6,_0x930e5b,_0xe6e144){var _0x34b7b7={'raw':![],'where':{}};var _0x599cb4={};var _0x26af97={'count':0x0,'rows':[]};return db[_0xc5a8('0x53')]['findOne']({'where':{'id':_0x55d2e6['params']['id']}})['then'](handleEntityNotFound(_0x930e5b,null))[_0xc5a8('0x34')](function(_0x31e1aa){if(_0x31e1aa){_0x599cb4[_0xc5a8('0x41')]=_[_0xc5a8('0x43')](db[_0xc5a8('0x66')][_0xc5a8('0x3f')]);_0x599cb4[_0xc5a8('0x42')]=_[_0xc5a8('0x43')](_0x55d2e6['query']);_0x599cb4[_0xc5a8('0x44')]=_[_0xc5a8('0x46')](_0x599cb4[_0xc5a8('0x41')],_0x599cb4[_0xc5a8('0x42')]);_0x34b7b7['attributes']=_[_0xc5a8('0x46')](_0x599cb4[_0xc5a8('0x41')],qs[_0xc5a8('0x47')](_0x55d2e6[_0xc5a8('0x42')][_0xc5a8('0x47')]));_0x34b7b7['attributes']=_0x34b7b7[_0xc5a8('0x45')]['length']?_0x34b7b7[_0xc5a8('0x45')]:_0x599cb4[_0xc5a8('0x41')];if(!_0x55d2e6[_0xc5a8('0x42')]['hasOwnProperty'](_0xc5a8('0x49'))){_0x34b7b7[_0xc5a8('0x2f')]=qs[_0xc5a8('0x2f')](_0x55d2e6[_0xc5a8('0x42')][_0xc5a8('0x2f')]);_0x34b7b7[_0xc5a8('0x4a')]=qs[_0xc5a8('0x4a')](_0x55d2e6[_0xc5a8('0x42')]['offset']);}_0x34b7b7[_0xc5a8('0x68')]=qs[_0xc5a8('0x4b')](_0x55d2e6['query'][_0xc5a8('0x4b')]);_0x34b7b7[_0xc5a8('0x4c')]=qs[_0xc5a8('0x44')](_[_0xc5a8('0x4d')](_0x55d2e6[_0xc5a8('0x42')],_0x599cb4[_0xc5a8('0x44')]));_0x34b7b7[_0xc5a8('0x4c')][_0xc5a8('0x65')]=_0x31e1aa['id'];if(_0x55d2e6[_0xc5a8('0x42')]['filter']){_0x34b7b7[_0xc5a8('0x4c')]=_[_0xc5a8('0x4f')](_0x34b7b7['where'],{'$or':_['map'](_0x34b7b7[_0xc5a8('0x45')],function(_0x107835){var _0x468df8={};_0x468df8[_0x107835]={'$like':'%'+_0x55d2e6[_0xc5a8('0x42')][_0xc5a8('0x4e')]+'%'};return _0x468df8;})});}_0x34b7b7=_[_0xc5a8('0x4f')]({},_0x34b7b7,_0x55d2e6['options']);return db[_0xc5a8('0x66')][_0xc5a8('0x30')]({'where':_0x34b7b7['where']})[_0xc5a8('0x34')](function(_0x105bd3){_0x26af97[_0xc5a8('0x30')]=_0x105bd3;if(_0x55d2e6['query'][_0xc5a8('0x54')]){_0x34b7b7[_0xc5a8('0x58')]=[{'all':!![]}];}return db[_0xc5a8('0x66')][_0xc5a8('0x55')](_0x34b7b7);})[_0xc5a8('0x34')](function(_0x4b629a){_0x26af97[_0xc5a8('0x69')]=_0x4b629a;return _0x26af97;});}})[_0xc5a8('0x34')](respondWithFilteredResult(_0x930e5b,_0x34b7b7))[_0xc5a8('0x2b')](handleError(_0x930e5b,null));};exports[_0xc5a8('0x6a')]=function(_0x42e70d,_0x10ace0,_0x263911){return db['ChatWebsite']['find']({'where':{'id':_0x42e70d[_0xc5a8('0x57')]['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0x10ace0,null))[_0xc5a8('0x34')](function(_0x12adf7){if(_0x12adf7){return _0x12adf7[_0xc5a8('0x6a')](_0x42e70d[_0xc5a8('0x42')][_0xc5a8('0x6b')]);}})[_0xc5a8('0x34')](respondWithStatusCode(_0x10ace0,null))[_0xc5a8('0x2b')](handleError(_0x10ace0,null));};exports['addAnswer']=function(_0x29a6a0,_0x3e7745,_0x2e771c){if(_0x29a6a0['body']['id']){delete _0x29a6a0[_0xc5a8('0x5b')]['id'];}return db[_0xc5a8('0x53')][_0xc5a8('0x59')]({'where':{'id':_0x29a6a0[_0xc5a8('0x57')]['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0x3e7745,null))[_0xc5a8('0x34')](function(_0x2c984b){if(_0x2c984b){_0x29a6a0[_0xc5a8('0x5b')][_0xc5a8('0x65')]=_0x2c984b['id'];return db[_0xc5a8('0x6c')]['create'](_0x29a6a0['body']);}})[_0xc5a8('0x34')](respondWithResult(_0x3e7745,null))[_0xc5a8('0x2b')](handleError(_0x3e7745,null));};exports[_0xc5a8('0x6d')]=function(_0x38cbda,_0x587e7b,_0x34a63d){var _0x4ef396={'raw':![],'where':{}};var _0x477f83={};var _0x430585={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xc5a8('0x6e')]({'where':{'id':_0x38cbda[_0xc5a8('0x57')]['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0x587e7b,null))['then'](function(_0x5ad964){if(_0x5ad964){_0x477f83[_0xc5a8('0x41')]=_[_0xc5a8('0x43')](db['CannedAnswer'][_0xc5a8('0x3f')]);_0x477f83['query']=_[_0xc5a8('0x43')](_0x38cbda[_0xc5a8('0x42')]);_0x477f83['filters']=_[_0xc5a8('0x46')](_0x477f83[_0xc5a8('0x41')],_0x477f83[_0xc5a8('0x42')]);_0x4ef396[_0xc5a8('0x45')]=_[_0xc5a8('0x46')](_0x477f83[_0xc5a8('0x41')],qs[_0xc5a8('0x47')](_0x38cbda[_0xc5a8('0x42')][_0xc5a8('0x47')]));_0x4ef396[_0xc5a8('0x45')]=_0x4ef396[_0xc5a8('0x45')]['length']?_0x4ef396['attributes']:_0x477f83[_0xc5a8('0x41')];if(!_0x38cbda[_0xc5a8('0x42')]['hasOwnProperty'](_0xc5a8('0x49'))){_0x4ef396[_0xc5a8('0x2f')]=qs[_0xc5a8('0x2f')](_0x38cbda[_0xc5a8('0x42')]['limit']);_0x4ef396[_0xc5a8('0x4a')]=qs[_0xc5a8('0x4a')](_0x38cbda['query'][_0xc5a8('0x4a')]);}_0x4ef396[_0xc5a8('0x68')]=qs[_0xc5a8('0x4b')](_0x38cbda[_0xc5a8('0x42')][_0xc5a8('0x4b')]);_0x4ef396['where']=qs[_0xc5a8('0x44')](_[_0xc5a8('0x4d')](_0x38cbda[_0xc5a8('0x42')],_0x477f83['filters']));_0x4ef396[_0xc5a8('0x4c')][_0xc5a8('0x65')]=_0x5ad964['id'];if(_0x38cbda[_0xc5a8('0x42')]['filter']){_0x4ef396['where']=_[_0xc5a8('0x4f')](_0x4ef396['where'],{'$or':_[_0xc5a8('0x50')](_0x4ef396[_0xc5a8('0x45')],function(_0x39f035){var _0x7d36df={};_0x7d36df[_0x39f035]={'$like':'%'+_0x38cbda[_0xc5a8('0x42')]['filter']+'%'};return _0x7d36df;})});}_0x4ef396=_[_0xc5a8('0x4f')]({},_0x4ef396,_0x38cbda[_0xc5a8('0x52')]);return db[_0xc5a8('0x6c')][_0xc5a8('0x30')]({'where':_0x4ef396[_0xc5a8('0x4c')]})[_0xc5a8('0x34')](function(_0x26ed43){_0x430585['count']=_0x26ed43;if(_0x38cbda['query']['includeAll']){_0x4ef396['include']=[{'all':!![]}];}return db[_0xc5a8('0x6c')]['findAll'](_0x4ef396);})[_0xc5a8('0x34')](function(_0x127b14){_0x430585[_0xc5a8('0x69')]=_0x127b14;return _0x430585;});}})[_0xc5a8('0x34')](respondWithFilteredResult(_0x587e7b,_0x4ef396))[_0xc5a8('0x2b')](handleError(_0x587e7b,null));};exports['removeAnswers']=function(_0x2133e7,_0x7f48cc,_0x218383){return db[_0xc5a8('0x53')]['find']({'where':{'id':_0x2133e7['params']['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0x7f48cc,null))['then'](function(_0x416470){if(_0x416470){return _0x416470['removeAnswers'](_0x2133e7[_0xc5a8('0x42')][_0xc5a8('0x6b')]);}})[_0xc5a8('0x34')](respondWithStatusCode(_0x7f48cc,null))[_0xc5a8('0x2b')](handleError(_0x7f48cc,null));};exports[_0xc5a8('0x6f')]=function(_0x1ac031,_0x5b134a,_0x3e1a48){_0x1ac031[_0xc5a8('0x5b')][_0xc5a8('0x70')]=_0x1ac031[_0xc5a8('0x71')][_0xc5a8('0x72')];return db[_0xc5a8('0x53')]['find']({'where':{'id':_0x1ac031[_0xc5a8('0x57')]['id']}})['then'](handleEntityNotFound(_0x5b134a,null))['then'](saveUpdates(_0x1ac031['body'],null))[_0xc5a8('0x34')](respondWithResult(_0x5b134a,null))[_0xc5a8('0x2b')](handleError(_0x5b134a,null));};exports[_0xc5a8('0x73')]=function(_0x445356,_0x471c14,_0x51803d){_0x445356[_0xc5a8('0x5b')][_0xc5a8('0x74')]=_0x445356['file'][_0xc5a8('0x72')];return db[_0xc5a8('0x53')][_0xc5a8('0x59')]({'where':{'id':_0x445356[_0xc5a8('0x57')]['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0x471c14,null))['then'](saveUpdates(_0x445356[_0xc5a8('0x5b')],null))[_0xc5a8('0x34')](respondWithResult(_0x471c14,null))[_0xc5a8('0x2b')](handleError(_0x471c14,null));};exports['addCustomerAvatar']=function(_0x518aae,_0x5688cd,_0x5723b2){_0x518aae[_0xc5a8('0x5b')][_0xc5a8('0x75')]=_0x518aae['file'][_0xc5a8('0x72')];return db[_0xc5a8('0x53')]['find']({'where':{'id':_0x518aae[_0xc5a8('0x57')]['id']}})['then'](handleEntityNotFound(_0x5688cd,null))[_0xc5a8('0x34')](saveUpdates(_0x518aae[_0xc5a8('0x5b')],null))[_0xc5a8('0x34')](respondWithResult(_0x5688cd,null))[_0xc5a8('0x2b')](handleError(_0x5688cd,null));};exports[_0xc5a8('0x76')]=function(_0x1063bf,_0x16c389,_0x46c382){_0x1063bf['body'][_0xc5a8('0x77')]=_0x1063bf[_0xc5a8('0x71')][_0xc5a8('0x72')];return db[_0xc5a8('0x53')][_0xc5a8('0x59')]({'where':{'id':_0x1063bf[_0xc5a8('0x57')]['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0x16c389,null))[_0xc5a8('0x34')](saveUpdates(_0x1063bf[_0xc5a8('0x5b')],null))[_0xc5a8('0x34')](respondWithResult(_0x16c389,null))[_0xc5a8('0x2b')](handleError(_0x16c389,null));};exports['getLogo']=function(_0x539157,_0x3c4608,_0x1632c6){var _0x1ea4c2=path['join'](config[_0xc5a8('0x78')],_0xc5a8('0x79'));var _0x4e37a1={'where':{'id':_0x539157[_0xc5a8('0x57')]['id']},'attributes':['id',_0xc5a8('0x70')],'raw':!![]};var _0x3653ff=![];return require(_0xc5a8('0x7a'))[_0xc5a8('0x7b')]()['then'](function(_0x4aa046){if(_0x4aa046){_0x3653ff=_0x4aa046[_0xc5a8('0x7c')];}})[_0xc5a8('0x34')](function(){return db[_0xc5a8('0x53')][_0xc5a8('0x59')](_0x4e37a1);})['then'](handleEntityNotFound(_0x3c4608,null))['then'](function(_0x32ceb8){if(_0x32ceb8){if(!_[_0xc5a8('0x7d')](_0x32ceb8[_0xc5a8('0x70')])){if(fs['existsSync'](path['join'](config[_0xc5a8('0x78')],_0xc5a8('0x7e'),_0x32ceb8[_0xc5a8('0x70')]))&&_0x3653ff){_0x1ea4c2=path[_0xc5a8('0x7f')](config['root'],_0xc5a8('0x7e'),_0x32ceb8[_0xc5a8('0x70')]);}}return _0x3c4608[_0xc5a8('0x80')](_0x1ea4c2);}})['catch'](handleError(_0x3c4608,null));};exports[_0xc5a8('0x81')]=function(_0x50c5af,_0xa2a510,_0x21424d){var _0xe4fc08=path['join'](config[_0xc5a8('0x78')],_0xc5a8('0x82'));var _0x597443={'where':{'id':_0x50c5af[_0xc5a8('0x57')]['id']},'attributes':['id',_0xc5a8('0x74')],'raw':!![]};return db[_0xc5a8('0x53')][_0xc5a8('0x59')](_0x597443)[_0xc5a8('0x34')](handleEntityNotFound(_0xa2a510,null))[_0xc5a8('0x34')](function(_0x252e5a){if(_0x252e5a){if(!_[_0xc5a8('0x7d')](_0x252e5a['agentAvatar'])){if(fs['existsSync'](path[_0xc5a8('0x7f')](config[_0xc5a8('0x78')],_0xc5a8('0x83'),_0x252e5a[_0xc5a8('0x74')]))){_0xe4fc08=path['join'](config['root'],_0xc5a8('0x83'),_0x252e5a[_0xc5a8('0x74')]);}}return _0xa2a510['download'](_0xe4fc08);}})[_0xc5a8('0x2b')](handleError(_0xa2a510,null));};exports[_0xc5a8('0x84')]=function(_0x91bd31,_0x4d40d1,_0x11d2b4){var _0x5c87c5=path[_0xc5a8('0x7f')](config[_0xc5a8('0x78')],_0xc5a8('0x85'));var _0x3ef62a={'where':{'id':_0x91bd31[_0xc5a8('0x57')]['id']},'attributes':['id',_0xc5a8('0x75'),_0xc5a8('0x86')],'raw':!![]};return db[_0xc5a8('0x53')][_0xc5a8('0x59')](_0x3ef62a)['then'](handleEntityNotFound(_0x4d40d1,null))[_0xc5a8('0x34')](function(_0x203652){if(_0x203652){if(!_[_0xc5a8('0x7d')](_0x203652['customerAvatar'])){if(fs[_0xc5a8('0x87')](path['join'](config[_0xc5a8('0x78')],_0xc5a8('0x83'),_0x203652[_0xc5a8('0x75')]))&&_0x203652[_0xc5a8('0x86')]){_0x5c87c5=path[_0xc5a8('0x7f')](config[_0xc5a8('0x78')],'server/files/images/avatars/',_0x203652['customerAvatar']);}}return _0x4d40d1[_0xc5a8('0x80')](_0x5c87c5);}})[_0xc5a8('0x2b')](handleError(_0x4d40d1,null));};exports[_0xc5a8('0x88')]=function(_0x2b81ba,_0x2ba954,_0x10fcd0){var _0x1ad5aa=path['join'](config[_0xc5a8('0x78')],'server/files/images/avatars/system_avatar.png');var _0x3b5779={'where':{'id':_0x2b81ba[_0xc5a8('0x57')]['id']},'attributes':['id',_0xc5a8('0x77')],'raw':!![]};return db[_0xc5a8('0x53')]['find'](_0x3b5779)['then'](handleEntityNotFound(_0x2ba954,null))['then'](function(_0xec53){if(_0xec53){if(!_[_0xc5a8('0x7d')](_0xec53[_0xc5a8('0x77')])){if(fs[_0xc5a8('0x87')](path['join'](config['root'],_0xc5a8('0x83'),_0xec53[_0xc5a8('0x77')]))){_0x1ad5aa=path['join'](config[_0xc5a8('0x78')],_0xc5a8('0x83'),_0xec53[_0xc5a8('0x77')]);}}return _0x2ba954[_0xc5a8('0x80')](_0x1ad5aa);}})[_0xc5a8('0x2b')](handleError(_0x2ba954,null));};exports[_0xc5a8('0x89')]=function(_0x448379,_0x4e034c,_0x338c99){var _0x3f7bd6=require('user-agent-parser');var _0x3879b5=new _0x3f7bd6();var _0x1ad5bf=_0x3879b5[_0xc5a8('0x8a')](_0x448379[_0xc5a8('0x8b')][_0xc5a8('0x8c')])[_0xc5a8('0x8d')]();var _0x1e0b37={'body':_0x448379['body'],'channel':_0xc5a8('0x8e')};var _0xcb490b=[];var _0x588c00=[];var _0x5170f1={};var _0x131767=![];return db['CmContact'][_0xc5a8('0x63')]()[_0xc5a8('0x34')](function(_0x238383){if(!_0x238383){throw new db['Sequelize'][(_0xc5a8('0x8f'))](_0xc5a8('0x90'));}_0xcb490b=_[_0xc5a8('0x91')](_[_0xc5a8('0x43')](_0x238383),[_0xc5a8('0x92'),_0xc5a8('0x93')]);_0x588c00=_[_0xc5a8('0x91')](_[_0xc5a8('0x43')](_0x238383),[_0xc5a8('0x92'),_0xc5a8('0x93'),_0xc5a8('0x94'),'ListId']);if(_0x448379['body']['id']){delete _0x448379[_0xc5a8('0x5b')]['id'];}if(_[_0xc5a8('0x7d')](_0x448379[_0xc5a8('0x5b')][_0xc5a8('0x95')])){throw new db[(_0xc5a8('0x96'))][(_0xc5a8('0x8f'))]('from\x20is\x20mandatory');}if(_[_0xc5a8('0x7d')](_0x448379['body'][_0xc5a8('0x5b')])||_0x448379[_0xc5a8('0x5b')][_0xc5a8('0x5b')]===''){throw new db[(_0xc5a8('0x96'))]['ValidationError'](_0xc5a8('0x97'));}if(_[_0xc5a8('0x7d')](_0x448379[_0xc5a8('0x5b')][_0xc5a8('0x98')])){throw new db[(_0xc5a8('0x96'))][(_0xc5a8('0x8f'))](_0xc5a8('0x99')+_0x588c00);}if(!_[_0xc5a8('0x9a')](_0x588c00,_0x448379[_0xc5a8('0x5b')][_0xc5a8('0x98')])){throw new db[(_0xc5a8('0x96'))]['ValidationError'](_0xc5a8('0x9b')+_0x588c00);}_0x5170f1[_0x448379[_0xc5a8('0x5b')][_0xc5a8('0x98')]]=_0x448379[_0xc5a8('0x5b')]['from'];})[_0xc5a8('0x34')](function(){return db[_0xc5a8('0x53')][_0xc5a8('0x59')]({'where':{'id':_0x448379[_0xc5a8('0x57')]['id']},'include':[{'model':db[_0xc5a8('0x9c')],'as':_0xc5a8('0x9d'),'include':[{'model':db['CmContact'],'as':_0xc5a8('0x9e'),'where':_0x5170f1,'limit':0x1,'order':[[_0xc5a8('0x93'),_0xc5a8('0x9f')]]}]},{'model':db['ChatApplication'],'as':_0xc5a8('0xa0')}]});})[_0xc5a8('0x34')](handleEntityNotFound(_0x4e034c,null))['then'](function(_0x208f4f){if(_0x208f4f&&_0x208f4f[_0xc5a8('0x9d')]){_0x1e0b37[_0xc5a8('0xa1')]=_0x208f4f;_0x1e0b37[_0xc5a8('0xa2')]=_0x208f4f[_0xc5a8('0xa0')];_0x1e0b37[_0xc5a8('0xa3')]=_0x208f4f[_0xc5a8('0x9d')];_0x1e0b37['applications']=_[_0xc5a8('0xa4')](_0x1e0b37['applications'],[_0xc5a8('0xa5')],[_0xc5a8('0xa6')]);if(_0x1e0b37[_0xc5a8('0xa1')][_0xc5a8('0xa0')]){delete _0x1e0b37[_0xc5a8('0xa1')][_0xc5a8('0xa0')];}if(_0x1e0b37[_0xc5a8('0xa1')][_0xc5a8('0x9d')]&&_0x1e0b37['account'][_0xc5a8('0x9d')][_0xc5a8('0x9e')][_0xc5a8('0x48')]){return _0x1e0b37[_0xc5a8('0xa1')]['List'][_0xc5a8('0x9e')][0x0];}var _0x25d53e=_[_0xc5a8('0xa7')](_0x448379['body'],{'firstName':_0x448379['body'][_0xc5a8('0x95')],'ListId':_0x208f4f[_0xc5a8('0xa8')]});_0x25d53e[_0x448379[_0xc5a8('0x5b')][_0xc5a8('0x98')]]=_0x448379[_0xc5a8('0x5b')][_0xc5a8('0x95')];return db[_0xc5a8('0xa9')][_0xc5a8('0x5a')](_0x25d53e,{'fields':_0xcb490b,'raw':!![]});}})['then'](handleEntityNotFound(_0x4e034c,null))['then'](function(_0x3e1943){_0x1e0b37['contact']=_0x3e1943;var _0x3b8b9f=_0x448379[_0xc5a8('0x5b')][_0xc5a8('0xaa')];if(_0x448379[_0xc5a8('0x8b')][_0xc5a8('0xab')]){_0x3b8b9f=_0x448379[_0xc5a8('0x8b')]['cf-connecting-ip'];}else if(_0x448379[_0xc5a8('0x8b')]['x-forwarded-for']){_0x3b8b9f=_[_0xc5a8('0xac')](_0x448379[_0xc5a8('0x8b')][_0xc5a8('0xad')]['split'](','));}if(_0x3e1943){var _0x4f245e={'ContactId':_0x3e1943['id'],'ChatWebsiteId':_0x448379[_0xc5a8('0x57')]['id'],'from':(_0x3e1943['firstName']||'')+'\x20'+(_0x3e1943[_0xc5a8('0xae')]||''),'customerIp':_0x3b8b9f,'customerPort':_0x448379[_0xc5a8('0x8b')][_0xc5a8('0xaf')]?_0x448379[_0xc5a8('0x8b')][_0xc5a8('0xaf')]:null,'referer':_0x448379[_0xc5a8('0x5b')]['referer'],'browserName':_0x1ad5bf[_0xc5a8('0xb0')][_0xc5a8('0x3a')]&&_0x1ad5bf[_0xc5a8('0xb0')][_0xc5a8('0xb1')]?util[_0xc5a8('0xb2')](_0xc5a8('0xb3'),_0x1ad5bf['browser']['name'],_0x1ad5bf['browser'][_0xc5a8('0xb1')]):_0xc5a8('0xb4'),'browserVersion':_0x1ad5bf[_0xc5a8('0xb0')][_0xc5a8('0xb1')]||_0xc5a8('0xb4'),'osName':util[_0xc5a8('0xb2')]('%s\x20%s',_0x1ad5bf['os'][_0xc5a8('0x3a')],_0x1ad5bf['os'][_0xc5a8('0xb1')]),'osVersion':_0x1ad5bf['os'][_0xc5a8('0xb1')],'deviceModel':_0x1ad5bf[_0xc5a8('0xb5')][_0xc5a8('0x41')]&&_0x1ad5bf[_0xc5a8('0xb5')]['vendor']?util['format'](_0xc5a8('0xb6'),_0x1ad5bf['device'][_0xc5a8('0x41')],_0x1ad5bf[_0xc5a8('0xb5')][_0xc5a8('0xb7')],_0x1ad5bf['device'][_0xc5a8('0x40')]):null,'deviceVendor':_0x1ad5bf['device'][_0xc5a8('0xb7')],'deviceType':_0x1ad5bf[_0xc5a8('0xb5')][_0xc5a8('0x40')],'formData':JSON[_0xc5a8('0x25')](_0x448379[_0xc5a8('0x5b')])};var _0x49522b={'ChatWebsiteId':_0x448379['params']['id'],'closed':![]};if(_0x448379['body']['threadId']){_0x49522b[_0xc5a8('0xb8')]=_0x448379[_0xc5a8('0x5b')][_0xc5a8('0xb8')];return db[_0xc5a8('0xb9')][_0xc5a8('0x59')]({'where':_0x49522b})[_0xc5a8('0x34')](function(_0x3db08d){if(_0x3db08d){return[_0x3db08d,![]];}_0x4f245e[_0xc5a8('0xb8')]=_0x448379[_0xc5a8('0x5b')]['threadId'];_0x4f245e[_0xc5a8('0xba')]=_0x448379[_0xc5a8('0x5b')]['externalUrl'];return db[_0xc5a8('0xb9')]['create'](_0x4f245e)[_0xc5a8('0x34')](function(_0x2ae98a){return[_0x2ae98a,!![]];});});}_0x49522b[_0xc5a8('0xbb')]=_0x3e1943['id'];if(_0x448379[_0xc5a8('0x5b')][_0xc5a8('0xbc')]&&_0x448379[_0xc5a8('0x5b')][_0xc5a8('0xbc')]['id']){_0x49522b['id']=_0x448379[_0xc5a8('0x5b')][_0xc5a8('0xbc')]['id'];return db[_0xc5a8('0xb9')][_0xc5a8('0x59')]({'where':_0x49522b})[_0xc5a8('0x34')](function(_0x409387){if(_0x409387){return[_0x409387,![]];}return db['ChatInteraction'][_0xc5a8('0x5a')](_0x4f245e)[_0xc5a8('0x34')](function(_0x5a437e){return[_0x5a437e,!![]];});});}return db['ChatInteraction'][_0xc5a8('0x5a')](_0x4f245e)[_0xc5a8('0x34')](function(_0x526539){return[_0x526539,!![]];});}})['spread'](function(_0x757ebd,_0x4cbeed){if(_0x757ebd){_0x131767=_0x4cbeed;if(!_0x4cbeed){var _0x548f92={'from':(_0x1e0b37['contact'][_0xc5a8('0xbd')]||'')+'\x20'+(_0x1e0b37[_0xc5a8('0xbe')][_0xc5a8('0xae')]||'')};if(_0x448379[_0xc5a8('0x5b')][_0xc5a8('0xb8')]&&_0x448379['body'][_0xc5a8('0xbf')]&&_0x448379[_0xc5a8('0x5b')]['threadId']!=_0x448379[_0xc5a8('0x5b')][_0xc5a8('0xbf')]){_0x548f92[_0xc5a8('0xb8')]=_0x448379[_0xc5a8('0x5b')]['messageId'];}return _0x757ebd[_0xc5a8('0x62')](_0x548f92);}else{return _0x757ebd;}}})[_0xc5a8('0x34')](function(_0x534bd2){_0x1e0b37[_0xc5a8('0xbc')]=_0x534bd2['get']({'plain':!![]});_0x1e0b37['interaction'][_0xc5a8('0xc0')]=_0x131767;if(_0x1e0b37[_0xc5a8('0xbc')][_0xc5a8('0xc0')]){if(_0x1e0b37['account'][_0xc5a8('0xc1')]){_0x1e0b37['applications'][_0xc5a8('0xc2')]({'id':0x0,'priority':_0x1e0b37[_0xc5a8('0xa2')][_0xc5a8('0x48')]+0x1,'app':_0xc5a8('0xc3'),'appdata':_0xc5a8('0xc4'),'interval':_0xc5a8('0xc5')});}}return db[_0xc5a8('0xc6')][_0xc5a8('0x5a')]({'body':_0x448379[_0xc5a8('0x5b')]['body'],'ChatWebsiteId':_0x448379[_0xc5a8('0x57')]['id'],'ChatInteractionId':_0x534bd2['id'],'direction':'in','ContactId':_0x1e0b37[_0xc5a8('0xbe')]['id'],'AttachmentId':_0x448379['body']['AttachmentId']});})[_0xc5a8('0x34')](function(_0x726eaa){_0x1e0b37[_0xc5a8('0x27')]=_0x726eaa;if(_0x1e0b37[_0xc5a8('0xbc')][_0xc5a8('0xc7')]){return db[_0xc5a8('0xc8')]['find']({'attributes':['id',_0xc5a8('0x3a')],'where':{'id':_0x1e0b37['interaction']['UserId']}})[_0xc5a8('0x34')](function(_0x5859e5){if(_0x5859e5){_0x1e0b37[_0xc5a8('0xa2')][_0xc5a8('0xc9')]({'id':0x0,'priority':0x0,'app':_0xc5a8('0xca'),'appdata':_0x5859e5[_0xc5a8('0x3a')]+','+(_0x1e0b37['account'][_0xc5a8('0xcb')]||0xa),'interval':_0xc5a8('0xc5')});_0x1e0b37[_0xc5a8('0xcc')]=!![];}return respondWithRpcPromise('Start',_0xc5a8('0xcd'),_0x1e0b37);});}return respondWithRpcPromise(_0xc5a8('0xce'),_0xc5a8('0xcd'),_0x1e0b37);})[_0xc5a8('0x34')](function(_0x15f7b4){respondWithRpcPromise('EventManager','EventManager',{'event':_0xc5a8('0x89'),'message':_0x15f7b4},client9002);return _0x15f7b4;})['then'](respondWithResult(_0x4e034c,null))[_0xc5a8('0x2b')](handleError(_0x4e034c,null));};exports[_0xc5a8('0xcf')]=function(_0x52d081,_0x8a24a2,_0x47fbc7){var _0x415b51,_0x584920,_0x220393;var _0x6981db=[];var _0xd9e10d=[];var _0x10a0bf={};var _0x237438=_0x52d081[_0xc5a8('0xd0')]||[];var _0x47b092=[];var _0xeea48;return db[_0xc5a8('0xa9')][_0xc5a8('0x63')]()[_0xc5a8('0x34')](function(_0x15f4c9){if(!_0x15f4c9){throw new db[(_0xc5a8('0x96'))][(_0xc5a8('0x8f'))](_0xc5a8('0x90'));}_0xd9e10d=_[_0xc5a8('0x91')](_[_0xc5a8('0x43')](_0x15f4c9),['createdAt',_0xc5a8('0x93')]);_0x6981db=_[_0xc5a8('0x91')](_['keys'](_0x15f4c9),[_0xc5a8('0x92'),_0xc5a8('0x93'),'CompanyId',_0xc5a8('0xa8')]);if(_0x52d081[_0xc5a8('0x5b')]['id']){delete _0x52d081[_0xc5a8('0x5b')]['id'];}if(_['isNil'](_0x52d081[_0xc5a8('0x5b')][_0xc5a8('0x95')])){throw _0x8a24a2[_0xc5a8('0x2c')](0x1f4)[_0xc5a8('0x3b')](new db[(_0xc5a8('0x96'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0xc5a8('0x7d')](_0x52d081[_0xc5a8('0x5b')][_0xc5a8('0x5b')])||_0x52d081[_0xc5a8('0x5b')]['body']===''){throw _0x8a24a2[_0xc5a8('0x2c')](0x1f4)[_0xc5a8('0x3b')](new db[(_0xc5a8('0x96'))][(_0xc5a8('0x8f'))](_0xc5a8('0x97')));}if(_[_0xc5a8('0x7d')](_0x52d081['body'][_0xc5a8('0xd1')])){throw _0x8a24a2[_0xc5a8('0x2c')](0x1f4)[_0xc5a8('0x3b')](new db['Sequelize']['ValidationError'](_0xc5a8('0xd2')+_0x6981db));}if(!_[_0xc5a8('0x9a')](_0x6981db,_0x52d081[_0xc5a8('0x5b')][_0xc5a8('0xd1')])){throw _0x8a24a2[_0xc5a8('0x2c')](0x1f4)[_0xc5a8('0x3b')](new db[(_0xc5a8('0x96'))][(_0xc5a8('0x8f'))](_0xc5a8('0xd3')+_0x6981db));}_0x10a0bf[_0x52d081[_0xc5a8('0x5b')][_0xc5a8('0xd1')]]=_0x52d081['body'][_0xc5a8('0x95')];})['then'](function(){return db[_0xc5a8('0x53')][_0xc5a8('0x59')]({'where':{'id':_0x52d081[_0xc5a8('0x57')]['id']},'include':[{'model':db['CmList'],'as':_0xc5a8('0x9d')},{'model':db[_0xc5a8('0xd4')],'as':_0xc5a8('0xd4')}]});})['then'](handleEntityNotFound(_0x8a24a2,null))[_0xc5a8('0x34')](function(_0x17459d){if(_0x17459d&&_0x17459d[_0xc5a8('0x9d')]){_0x584920=_0x17459d;var _0x13f4e2=_[_0xc5a8('0xa7')](_0x52d081[_0xc5a8('0x5b')],{'firstName':_0x52d081['body'][_0xc5a8('0x95')],'phone':_0x52d081[_0xc5a8('0x5b')]['from'],'ListId':_0x17459d[_0xc5a8('0xa8')]});_0x13f4e2[_0x52d081['body'][_0xc5a8('0xd1')]]=_0x52d081['body'][_0xc5a8('0x95')];return db[_0xc5a8('0xa9')][_0xc5a8('0xd5')]({'where':_0x10a0bf,'defaults':_0x13f4e2});}})['spread'](function(_0x317cc1){if(_0x317cc1){_0x220393=_0x317cc1;var _0x5bf8fe=fs[_0xc5a8('0xd6')](path[_0xc5a8('0x7f')](config[_0xc5a8('0x78')],_0xc5a8('0xd7')),'utf8');var _0x45ff65=ejs['render'](_0x5bf8fe,{'body':_[_0xc5a8('0xd8')](_0x52d081[_0xc5a8('0x5b')][_0xc5a8('0x5b')]),'bodyTitle':_0x584920['offlineMessageBody']});return db[_0xc5a8('0xd9')]['create']({'body':_0x45ff65,'ContactId':_0x317cc1['id'],'ChatWebsiteId':_0x584920['id']});}})['then'](function(_0x1d5734){_0xeea48=_0x1d5734;if(_0x237438[_0xc5a8('0x48')]){var _0x451513=_0x237438[_0xc5a8('0x50')](function(_0x409e66){return{'name':_0x409e66[_0xc5a8('0xda')],'basename':_0x409e66[_0xc5a8('0x72')],'type':_0x409e66[_0xc5a8('0xdb')],'ChatOfflineMessageId':_0x1d5734['id']};});_0x47b092=_0x451513[_0xc5a8('0x50')](_0x471e48=>{var _0x5ecaa1={'filename':_0x471e48['name'],'path':path[_0xc5a8('0x7f')](config[_0xc5a8('0x78')],'server','files','attachments',_0xc5a8('0xdc'),_0x471e48[_0xc5a8('0xdd')])};return _0x5ecaa1;});if(!_0x584920[_0xc5a8('0xde')]){return db[_0xc5a8('0xdf')][_0xc5a8('0xe0')](function(_0xefa1c){return db[_0xc5a8('0xe1')][_0xc5a8('0xe2')](_0x451513,{'transaction':_0xefa1c});});}}})[_0xc5a8('0x34')](function(){if(_0xeea48){_0x415b51=_0xeea48;return db['MailAccount'][_0xc5a8('0x6e')]({'where':{'active':!![]},'include':[{'model':db[_0xc5a8('0xe3')],'as':_0xc5a8('0xe4'),'raw':!![]}]});}})[_0xc5a8('0x34')](function(_0x422a26){if(_0x422a26&&_0x422a26[_0xc5a8('0xe4')]&&_0x584920[_0xc5a8('0xe5')]&&_0x584920[_0xc5a8('0xe6')]){var _0x3accab={'tls':{'rejectUnauthorized':![]}};if(_0x422a26['Smtp']['service']){_0x3accab[_0xc5a8('0xe7')]=_0x422a26['Smtp']['service'];}else{_0x3accab[_0xc5a8('0xe8')]=_0x422a26[_0xc5a8('0xe4')][_0xc5a8('0xe8')];_0x3accab[_0xc5a8('0xe9')]=_0x422a26['Smtp'][_0xc5a8('0xe9')];_0x3accab['secure']=_0x422a26[_0xc5a8('0xe4')][_0xc5a8('0xea')];}if(_0x422a26[_0xc5a8('0xe4')][_0xc5a8('0xeb')]){_0x3accab[_0xc5a8('0xec')]={'user':_0x422a26[_0xc5a8('0xe4')][_0xc5a8('0x5f')],'pass':_0x422a26[_0xc5a8('0xe4')][_0xc5a8('0xed')]};}return respondWithRpcPromise(_0xc5a8('0xee'),_0xc5a8('0xef'),{'account':_0x3accab,'message':{'from':util['format'](_0xc5a8('0xf0'),_0x422a26['name'],_0x422a26[_0xc5a8('0xf1')]||_0x422a26['Smtp'][_0xc5a8('0x5f')]),'to':_0x584920[_0xc5a8('0xe6')],'subject':_0x584920['offlineMessageSubject'],'html':_0x415b51[_0xc5a8('0x5b')],'attachments':_0x47b092}},client9003)['then'](function(){return _0x415b51;})[_0xc5a8('0x2b')](function(_0x327585){console[_0xc5a8('0x26')](_0x327585);});}})['then'](function(){if(_0x584920&&_0x584920['openNewInteraction']&&_0x584920[_0xc5a8('0xf2')]){var _0x1d3f1d=[];if(_0x237438['length']){_0x1d3f1d=_0x237438[_0xc5a8('0x50')](function(_0x50a566){return{'name':_0x50a566['originalname'],'basename':_0x50a566['filename'],'type':_0x50a566[_0xc5a8('0xdb')],'ChatOfflineMessageId':_0xeea48['id']};});}var _0xc0c6b2;if(!_[_0xc5a8('0x7d')](_0x584920['subjectOffline'])){var _0x41cc37=_[_0xc5a8('0x50')](_0x52d081[_0xc5a8('0x5b')],function(_0x50f2cc){return _0x50f2cc;});var _0x1ff035=_[_0xc5a8('0xf3')](_0x41cc37)[0x0];var _0x1e9d35=_[_0xc5a8('0xf4')](_0x1ff035,function(_0x26e7ba){return _0x26e7ba;});_0xc0c6b2=_0x1e9d35[0x1][_0x584920[_0xc5a8('0xf5')]];}var _0x116298={'from':_0x220393['email'],'firstName':_0x220393[_0xc5a8('0xbd')],'lastName':_0x220393[_0xc5a8('0xae')],'mapKey':'email','message':{'from':_0x220393[_0xc5a8('0xf1')],'to':_0x584920[_0xc5a8('0xd4')][_0xc5a8('0xf1')],'cc':'','subject':_[_0xc5a8('0x7d')](_0xc0c6b2)?_0x584920[_0xc5a8('0xf6')]:_0xc0c6b2,'messageId':'','sentAt':new Date(),'attach':_0x1d3f1d['length'],'attachments':_0x1d3f1d,'originChannel':'Chat','ChatWebsiteId':_0x584920['id'],'ChatOfflineMessageId':_0x415b51['id'],'originTo':_0x584920[_0xc5a8('0xd4')]['email']},'body':_0x415b51[_0xc5a8('0x5b')]};var _0x32ecf8={'account':{'id':_0x584920[_0xc5a8('0xf2')]},'body':_0x116298,'log':_0xc5a8('0xf7')};return respondWithRpcPromise(_0xc5a8('0xf7'),_0xc5a8('0xf8'),_0x32ecf8,client9001)[_0xc5a8('0x34')](function(){return _0x415b51;})[_0xc5a8('0x2b')](function(_0x2b2db1){console['error'](_0x2b2db1);});}return;})[_0xc5a8('0x34')](function(){if(_0x415b51){return _0x415b51;}})['then'](respondWithResult(_0x8a24a2,null))[_0xc5a8('0x2b')](function(_0x5839d2){console[_0xc5a8('0x26')](_0xc5a8('0x2b'),_0x5839d2);for(var _0x2659bb of _0x237438){var _0x33ad3f=path['join'](config[_0xc5a8('0x78')],_0xc5a8('0xf9'),_0xc5a8('0xd0'),'attachments',_0xc5a8('0xdc'),_0x2659bb['filename']);fs_extra[_0xc5a8('0xfa')](_0x33ad3f)['catch'](function(_0x32bad5){console[_0xc5a8('0x26')]('Could\x20not\x20remove\x20attachment\x20file',_0x33ad3f,_0x32bad5);});}});};exports[_0xc5a8('0xfb')]=function(_0x3d0979,_0x167b4c,_0x403ffd){return db[_0xc5a8('0xb9')][_0xc5a8('0x59')]({'where':{'id':_0x3d0979['params']['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0x167b4c,null))[_0xc5a8('0x34')](function(_0x18f9e5){if(_0x18f9e5){return _0x18f9e5['addInteraction'](_0x3d0979[_0xc5a8('0x5b')][_0xc5a8('0x6b')],_[_0xc5a8('0xfc')](_0x3d0979[_0xc5a8('0x5b')],['ids','id'])||{});}})[_0xc5a8('0x34')](respondWithResult(_0x167b4c,null))[_0xc5a8('0x2b')](handleError(_0x167b4c,null));};exports[_0xc5a8('0xfd')]=function(_0x292a79,_0xf36d85,_0x1d8d68){var _0xaa0c6b={'raw':![],'where':{}};var _0x4df2f5={};var _0x5c02d2={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xc5a8('0x6e')]({'where':{'id':_0x292a79['params']['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0xf36d85,null))[_0xc5a8('0x34')](function(_0x36dfaf){if(_0x36dfaf){_0x4df2f5[_0xc5a8('0x41')]=_[_0xc5a8('0x43')](db[_0xc5a8('0xb9')][_0xc5a8('0x3f')]);_0x4df2f5[_0xc5a8('0x42')]=_[_0xc5a8('0x43')](_0x292a79[_0xc5a8('0x42')]);_0x4df2f5[_0xc5a8('0x44')]=_[_0xc5a8('0x46')](_0x4df2f5['model'],_0x4df2f5[_0xc5a8('0x42')]);_0xaa0c6b[_0xc5a8('0x45')]=_[_0xc5a8('0x46')](_0x4df2f5[_0xc5a8('0x41')],qs[_0xc5a8('0x47')](_0x292a79['query'][_0xc5a8('0x47')]));_0xaa0c6b['attributes']=_0xaa0c6b['attributes'][_0xc5a8('0x48')]?_0xaa0c6b[_0xc5a8('0x45')]:_0x4df2f5[_0xc5a8('0x41')];if(!_0x292a79[_0xc5a8('0x42')][_0xc5a8('0xfe')](_0xc5a8('0x49'))){_0xaa0c6b['limit']=qs['limit'](_0x292a79[_0xc5a8('0x42')][_0xc5a8('0x2f')]);_0xaa0c6b['offset']=qs['offset'](_0x292a79[_0xc5a8('0x42')][_0xc5a8('0x4a')]);}_0xaa0c6b[_0xc5a8('0x68')]=qs[_0xc5a8('0x4b')](_0x292a79[_0xc5a8('0x42')][_0xc5a8('0x4b')]);_0xaa0c6b[_0xc5a8('0x4c')]=qs[_0xc5a8('0x44')](_['pick'](_0x292a79[_0xc5a8('0x42')],_0x4df2f5[_0xc5a8('0x44')]));_0xaa0c6b['where']['ChatWebsiteId']=_0x36dfaf['id'];if(_0x292a79[_0xc5a8('0x42')][_0xc5a8('0x4e')]){_0xaa0c6b['where']=_[_0xc5a8('0x4f')](_0xaa0c6b[_0xc5a8('0x4c')],{'$or':_['map'](_0xaa0c6b[_0xc5a8('0x45')],function(_0x41d811){var _0x59d419={};_0x59d419[_0x41d811]={'$like':'%'+_0x292a79['query'][_0xc5a8('0x4e')]+'%'};return _0x59d419;})});}_0xaa0c6b=_[_0xc5a8('0x4f')]({},_0xaa0c6b,_0x292a79[_0xc5a8('0x52')]);return db['ChatInteraction'][_0xc5a8('0x30')]({'where':_0xaa0c6b[_0xc5a8('0x4c')]})[_0xc5a8('0x34')](function(_0x110fa6){_0x5c02d2[_0xc5a8('0x30')]=_0x110fa6;if(_0x292a79[_0xc5a8('0x42')][_0xc5a8('0x54')]){_0xaa0c6b[_0xc5a8('0x58')]=[{'model':db[_0xc5a8('0xa9')],'as':_0xc5a8('0xff'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0xc5a8('0x3a'),_0xc5a8('0x100'),_0xc5a8('0x101')],'required':![]},{'model':db[_0xc5a8('0x102')],'as':_0xc5a8('0x103'),'attributes':['id',_0xc5a8('0x3a'),_0xc5a8('0x104')],'where':_0x292a79[_0xc5a8('0x42')][_0xc5a8('0x105')]?{'id':_0x292a79[_0xc5a8('0x42')][_0xc5a8('0x105')]}:undefined,'required':_0x292a79[_0xc5a8('0x42')][_0xc5a8('0x105')]?!![]:![]}];}return db[_0xc5a8('0xb9')][_0xc5a8('0x55')](_0xaa0c6b);})[_0xc5a8('0x34')](function(_0x47f8da){_0x5c02d2['rows']=_0x47f8da;return _0x5c02d2;});}})[_0xc5a8('0x34')](respondWithFilteredResult(_0xf36d85,_0xaa0c6b))['catch'](handleError(_0xf36d85,null));};function iftimePromise(_0x1c4382,_0x6ea44c){return respondWithRpcPromise(_0xc5a8('0x106'),_0xc5a8('0x107'),{'command':_0x6ea44c['timezone']?util[_0xc5a8('0xb2')](_0xc5a8('0x108'),_0x1c4382[_0xc5a8('0x109')],_0x6ea44c['timezone']):util[_0xc5a8('0xb2')]('iftime\x20%s',_0x1c4382['interval'])},client9002)[_0xc5a8('0x34')](function(_0x483bff){var _0x3ccea9=_0x483bff&&_0x483bff[_0xc5a8('0x10a')](_0xc5a8('0x10b'))>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x6ea44c['id'],_0x1c4382['id'],_0x1c4382[_0xc5a8('0x109')],_0x3ccea9?_0xc5a8('0x10c'):_0xc5a8('0x10d'),_0x6ea44c[_0xc5a8('0x10e')]?_0x6ea44c['timezone']:_0xc5a8('0x10f'));return _0x3ccea9;})[_0xc5a8('0x2b')](function(_0x342a7d){logger['error'](_0xc5a8('0x110'),_0x6ea44c['id'],_0x1c4382['id'],_0x1c4382['interval'],util[_0xc5a8('0x111')](_0x342a7d,{'showHidden':![],'depth':null}),_0x6ea44c['timezone']?_0x6ea44c[_0xc5a8('0x10e')]:_0xc5a8('0x10f'));return![];});}exports[_0xc5a8('0x107')]=function(_0x3876f8,_0x9fd6f2,_0x1d482c){var _0xf454b5=0x0;var _0xf96dc8=0x0;var _0x302333=![];var _0x15de74;var _0x52239f;return db['ChatWebsite'][_0xc5a8('0x59')]({'where':{'id':_0x3876f8[_0xc5a8('0x57')]['id']},'include':[{'model':db[_0xc5a8('0x112')],'as':'Interval','include':[{'model':db[_0xc5a8('0x112')],'as':_0xc5a8('0x113'),'attributes':['id',_0xc5a8('0x109')],'raw':!![]}]}]})[_0xc5a8('0x34')](handleEntityNotFound(_0x9fd6f2,null))[_0xc5a8('0x34')](function(_0x4daeff){if(_0x4daeff){_0x15de74=_0x4daeff;return _0x4daeff['getProactiveActions']({'raw':!![]});}})[_0xc5a8('0x34')](function(_0x59d18c){if(_0x15de74){if(_0x59d18c){_0x52239f=_0x59d18c;}}return require(_0xc5a8('0x7a'))[_0xc5a8('0x7b')]();})[_0xc5a8('0x34')](function(_0x34eb0f){if(_0x34eb0f){_0xf96dc8=_0x34eb0f['virtual'];_0x302333=_0x34eb0f[_0xc5a8('0x7c')];}})[_0xc5a8('0x34')](function(){return db[_0xc5a8('0xb9')][_0xc5a8('0x30')]({'where':{'closed':![]}});})[_0xc5a8('0x34')](function(_0x4e8cd1){_0xf454b5=_0x4e8cd1;if(_0xf96dc8&&_0x4e8cd1>_0xf96dc8){return db[_0xc5a8('0x114')][_0xc5a8('0x6e')]({'where':{'id':0x1}})[_0xc5a8('0x34')](function(_0x80cefb){if(_0x80cefb){_0x80cefb[_0xc5a8('0x115')](_0xc5a8('0x116'));}});}})[_0xc5a8('0x34')](function(){if(_0x15de74[_0xc5a8('0x112')]&&_0x15de74[_0xc5a8('0x112')]['Intervals']){var _0x4a3214=[];for(var _0x5b2f68=0x0;_0x5b2f68<_0x15de74[_0xc5a8('0x112')]['Intervals'][_0xc5a8('0x48')];_0x5b2f68++){var _0x501dcf=_0x15de74[_0xc5a8('0x112')][_0xc5a8('0x113')][_0x5b2f68][_0xc5a8('0x5c')]({'plain':!![]});_0x4a3214[_0xc5a8('0xc2')](iftimePromise(_0x501dcf,_0x15de74));}return BPromise[_0xc5a8('0x117')](_0x4a3214)[_0xc5a8('0x34')](function(_0x3e4e5f){return _[_0xc5a8('0x118')](_0x3e4e5f);});}else{return!![];}})[_0xc5a8('0x34')](function(_0x2bb2b2){var _0x5903be=fs[_0xc5a8('0xd6')](path[_0xc5a8('0x7f')](config['root'],_0xc5a8('0x119')),_0xc5a8('0x11a'));var _0x55680e={'remote':_0x15de74['remote'],'query':querystring[_0xc5a8('0x25')](_['merge'](_0x15de74['get']({'plain':!![]}),{'customerIp':_0x3876f8[_0xc5a8('0x8b')][_0xc5a8('0xad')]||_0x3876f8[_0xc5a8('0x8b')][_0xc5a8('0x11b')]||_0x3876f8['connection']['remoteAddress']||_0x3876f8['ip'],'referer':_0x3876f8['headers'][_0xc5a8('0x11c')],'openedInteractions':_0xf454b5,'maxInteractions':_0xf96dc8,'virtual':_0x302333[_0xc5a8('0x11d')],'online':_0x2bb2b2,'custom':_0x302333}))['replace'](/'/g,'\x5c\x27')};_0x9fd6f2[_0xc5a8('0x3b')](ejs[_0xc5a8('0x11e')](Mustache[_0xc5a8('0x11e')](_0x5903be,_0x55680e),{'proactiveActions':_0x52239f,'alignment':_0x15de74['alignment'],'verticalAlignment':_0x15de74['verticalAlignment'],'div_color':_0x15de74['color'],'text_color':_0x15de74[_0xc5a8('0x11f')],'button_color':_0x15de74[_0xc5a8('0x120')],'background_color':_0x15de74[_0xc5a8('0x121')]}));})[_0xc5a8('0x2b')](handleError(_0x9fd6f2,null));};exports['addApplications']=function(_0x58f01c,_0x25d6b4,_0x172cde){return db[_0xc5a8('0x53')]['findOne']({'where':{'id':_0x58f01c['params']['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0x25d6b4,null))['then'](function(_0x35809f){if(_0x35809f){return db[_0xc5a8('0xdf')]['transaction'](function(_0x429059){return db[_0xc5a8('0x122')][_0xc5a8('0x35')]({'where':{'ChatWebsiteId':_0x58f01c[_0xc5a8('0x57')]['id']},'transaction':_0x429059})[_0xc5a8('0x34')](function(_0xd81997){var _0x412ef6=_[_0xc5a8('0x50')](_0x58f01c['body'],function(_0x5ebf26){_0x5ebf26[_0xc5a8('0x65')]=_0x58f01c[_0xc5a8('0x57')]['id'];return _0x5ebf26;});return db['ChatApplication'][_0xc5a8('0xe2')](_0x412ef6,{'transaction':_0x429059});});})[_0xc5a8('0x34')](function(){return db[_0xc5a8('0x122')][_0xc5a8('0x123')]({'where':{'ChatWebsiteId':_0x58f01c[_0xc5a8('0x57')]['id']},'order':_0xc5a8('0xa5')});});}})[_0xc5a8('0x34')](respondWithResult(_0x25d6b4,null))[_0xc5a8('0x2b')](handleError(_0x25d6b4,null));};exports[_0xc5a8('0x124')]=function(_0x20ed33,_0xc26ee6,_0x47b320){var _0x4a366f={};var _0x19a28d={};var _0x2aec45;var _0x382880;return db[_0xc5a8('0x53')][_0xc5a8('0x6e')]({'where':{'id':_0x20ed33[_0xc5a8('0x57')]['id']}})['then'](handleEntityNotFound(_0xc26ee6,null))[_0xc5a8('0x34')](function(_0x318982){if(_0x318982){_0x2aec45=_0x318982;_0x19a28d[_0xc5a8('0x41')]=_[_0xc5a8('0x43')](db[_0xc5a8('0x122')][_0xc5a8('0x3f')]);_0x19a28d[_0xc5a8('0x42')]=_[_0xc5a8('0x43')](_0x20ed33[_0xc5a8('0x42')]);_0x19a28d['filters']=_[_0xc5a8('0x46')](_0x19a28d[_0xc5a8('0x41')],_0x19a28d[_0xc5a8('0x42')]);_0x4a366f[_0xc5a8('0x45')]=_[_0xc5a8('0x46')](_0x19a28d[_0xc5a8('0x41')],qs[_0xc5a8('0x47')](_0x20ed33[_0xc5a8('0x42')][_0xc5a8('0x47')]));_0x4a366f['attributes']=_0x4a366f['attributes'][_0xc5a8('0x48')]?_0x4a366f['attributes']:_0x19a28d['model'];_0x4a366f[_0xc5a8('0x68')]=qs['sort'](_0x20ed33[_0xc5a8('0x42')][_0xc5a8('0x4b')]);_0x4a366f[_0xc5a8('0x4c')]=qs[_0xc5a8('0x44')](_['pick'](_0x20ed33[_0xc5a8('0x42')],_0x19a28d[_0xc5a8('0x44')]));if(_0x20ed33[_0xc5a8('0x42')][_0xc5a8('0x4e')]){_0x4a366f['where']=_[_0xc5a8('0x4f')](_0x4a366f['where'],{'$or':_['map'](_0x4a366f[_0xc5a8('0x45')],function(_0x1d95d1){var _0x257fa3={};_0x257fa3[_0x1d95d1]={'$like':'%'+_0x20ed33[_0xc5a8('0x42')][_0xc5a8('0x4e')]+'%'};return _0x257fa3;})});}_0x4a366f=_[_0xc5a8('0x4f')]({},_0x4a366f,_0x20ed33[_0xc5a8('0x52')]);return _0x2aec45[_0xc5a8('0x124')](_0x4a366f);}})[_0xc5a8('0x34')](function(_0x41ffd8){if(_0x41ffd8){_0x382880=_0x41ffd8['length'];if(!_0x20ed33[_0xc5a8('0x42')][_0xc5a8('0xfe')](_0xc5a8('0x49'))){_0x4a366f[_0xc5a8('0x2f')]=qs[_0xc5a8('0x2f')](_0x20ed33[_0xc5a8('0x42')][_0xc5a8('0x2f')]);_0x4a366f[_0xc5a8('0x4a')]=qs[_0xc5a8('0x4a')](_0x20ed33['query'][_0xc5a8('0x4a')]);}return _0x2aec45[_0xc5a8('0x124')](_0x4a366f);}})[_0xc5a8('0x34')](function(_0x37044d){if(_0x37044d){return _0x37044d?{'count':_0x382880,'rows':_0x37044d}:null;}})[_0xc5a8('0x34')](respondWithResult(_0xc26ee6,null))[_0xc5a8('0x2b')](handleError(_0xc26ee6,null));};exports[_0xc5a8('0x125')]=function(_0xbb0436,_0x1c8a34,_0xefb1ba){return db[_0xc5a8('0x126')][_0xc5a8('0x59')]({'where':{'id':_0xbb0436[_0xc5a8('0x57')]['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0x1c8a34,null))[_0xc5a8('0x34')](function(_0x2da250){if(_0x2da250){return _0x2da250[_0xc5a8('0x125')](_0xbb0436[_0xc5a8('0x5b')][_0xc5a8('0x6b')],_['omit'](_0xbb0436[_0xc5a8('0x5b')],[_0xc5a8('0x6b'),'id'])||{});}})['then'](respondWithResult(_0x1c8a34,null))[_0xc5a8('0x2b')](handleError(_0x1c8a34,null));};exports[_0xc5a8('0x127')]=function(_0x180678,_0x8097b7,_0x2fdfc2){var _0x4e60b0={};var _0x2bbad6={};var _0xe4b41f;var _0x507ee5;return db[_0xc5a8('0x53')][_0xc5a8('0x6e')]({'where':{'id':_0x180678[_0xc5a8('0x57')]['id']}})['then'](handleEntityNotFound(_0x8097b7,null))[_0xc5a8('0x34')](function(_0x8910e6){if(_0x8910e6){_0xe4b41f=_0x8910e6;_0x2bbad6['model']=_[_0xc5a8('0x43')](db[_0xc5a8('0x128')][_0xc5a8('0x3f')]);_0x2bbad6[_0xc5a8('0x42')]=_[_0xc5a8('0x43')](_0x180678[_0xc5a8('0x42')]);_0x2bbad6['filters']=_['intersection'](_0x2bbad6['model'],_0x2bbad6['query']);_0x4e60b0[_0xc5a8('0x45')]=_[_0xc5a8('0x46')](_0x2bbad6[_0xc5a8('0x41')],qs[_0xc5a8('0x47')](_0x180678[_0xc5a8('0x42')][_0xc5a8('0x47')]));_0x4e60b0['attributes']=_0x4e60b0[_0xc5a8('0x45')][_0xc5a8('0x48')]?_0x4e60b0[_0xc5a8('0x45')]:_0x2bbad6[_0xc5a8('0x41')];_0x4e60b0['order']=qs[_0xc5a8('0x4b')](_0x180678[_0xc5a8('0x42')][_0xc5a8('0x4b')]);_0x4e60b0[_0xc5a8('0x4c')]=qs[_0xc5a8('0x44')](_['pick'](_0x180678[_0xc5a8('0x42')],_0x2bbad6[_0xc5a8('0x44')]));if(_0x180678[_0xc5a8('0x42')][_0xc5a8('0x4e')]){_0x4e60b0['where']=_[_0xc5a8('0x4f')](_0x4e60b0[_0xc5a8('0x4c')],{'$or':_[_0xc5a8('0x50')](_0x4e60b0[_0xc5a8('0x45')],function(_0x47b849){var _0x3180bf={};_0x3180bf[_0x47b849]={'$like':'%'+_0x180678[_0xc5a8('0x42')][_0xc5a8('0x4e')]+'%'};return _0x3180bf;})});}_0x4e60b0=_[_0xc5a8('0x4f')]({},_0x4e60b0,_0x180678[_0xc5a8('0x52')]);return _0xe4b41f[_0xc5a8('0x127')](_0x4e60b0);}})['then'](function(_0x1fc6ce){if(_0x1fc6ce){_0x507ee5=_0x1fc6ce[_0xc5a8('0x48')];if(!_0x180678[_0xc5a8('0x42')][_0xc5a8('0xfe')](_0xc5a8('0x49'))){_0x4e60b0[_0xc5a8('0x2f')]=qs[_0xc5a8('0x2f')](_0x180678['query']['limit']);_0x4e60b0[_0xc5a8('0x4a')]=qs[_0xc5a8('0x4a')](_0x180678[_0xc5a8('0x42')][_0xc5a8('0x4a')]);}return _0xe4b41f['getProactiveActions'](_0x4e60b0);}})[_0xc5a8('0x34')](function(_0x2f0b09){if(_0x2f0b09){return _0x2f0b09?{'count':_0x507ee5,'rows':_0x2f0b09}:null;}})[_0xc5a8('0x34')](respondWithResult(_0x8097b7,null))[_0xc5a8('0x2b')](handleError(_0x8097b7,null));};exports[_0xc5a8('0x129')]=function(_0x143d5b,_0x183f80,_0x13c5a6){var _0x98e31d=_0x143d5b[_0xc5a8('0x42')][_0xc5a8('0x12a')]===_0xc5a8('0x12b')?_0xc5a8('0x12c'):_0xc5a8('0x12d');return db[_0xc5a8('0x53')][_0xc5a8('0x59')]({'attributes':['id',_0x98e31d],'where':{'id':_0x143d5b[_0xc5a8('0x57')]['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0x183f80,null))['then'](function(_0x24a61a){if(_0x24a61a){var _0x4639e0=_0x24a61a[_0x98e31d];var _0x2eaa8a=_0x4639e0&&_0x4639e0[_0xc5a8('0x12e')]?_0x4639e0[_0xc5a8('0x12e')]:[];_0x183f80[_0xc5a8('0x3b')]({'fromKey':_[_0xc5a8('0x7d')](_0x4639e0[_0xc5a8('0x12f')])?undefined:_0x4639e0[_0xc5a8('0x12f')],'count':_0x2eaa8a[_0xc5a8('0x48')],'rows':_0x2eaa8a});}})[_0xc5a8('0x2b')](handleError(_0x183f80,null));};exports[_0xc5a8('0x130')]=function(_0x49b92d,_0x3d35cb,_0x581904){var _0x3ae47a={'raw':![],'where':{}};var _0x1ed2fd={};var _0xed2ec8={'count':0x0,'rows':[]};return db[_0xc5a8('0x53')][_0xc5a8('0x6e')]({'where':{'id':_0x49b92d[_0xc5a8('0x57')]['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0x3d35cb,null))[_0xc5a8('0x34')](function(_0x4c59de){if(_0x4c59de){_0x1ed2fd[_0xc5a8('0x41')]=_['keys'](db[_0xc5a8('0xd9')][_0xc5a8('0x3f')]);_0x1ed2fd[_0xc5a8('0x42')]=_['keys'](_0x49b92d[_0xc5a8('0x42')]);_0x1ed2fd[_0xc5a8('0x44')]=_[_0xc5a8('0x46')](_0x1ed2fd['model'],_0x1ed2fd['query']);_0x3ae47a[_0xc5a8('0x45')]=_[_0xc5a8('0x46')](_0x1ed2fd[_0xc5a8('0x41')],qs[_0xc5a8('0x47')](_0x49b92d[_0xc5a8('0x42')][_0xc5a8('0x47')]));_0x3ae47a[_0xc5a8('0x45')]=_0x3ae47a['attributes']['length']?_0x3ae47a[_0xc5a8('0x45')]:_0x1ed2fd[_0xc5a8('0x41')];if(!_0x49b92d['query'][_0xc5a8('0xfe')](_0xc5a8('0x49'))){_0x3ae47a[_0xc5a8('0x2f')]=qs[_0xc5a8('0x2f')](_0x49b92d['query'][_0xc5a8('0x2f')]);_0x3ae47a[_0xc5a8('0x4a')]=qs['offset'](_0x49b92d[_0xc5a8('0x42')][_0xc5a8('0x4a')]);}_0x3ae47a['order']=qs[_0xc5a8('0x4b')](_0x49b92d[_0xc5a8('0x42')]['sort']);_0x3ae47a[_0xc5a8('0x4c')]=qs['filters'](_['pick'](_0x49b92d['query'],_0x1ed2fd[_0xc5a8('0x44')]));_0x3ae47a['where'][_0xc5a8('0x65')]=_0x4c59de['id'];if(_0x49b92d[_0xc5a8('0x42')]['filter']){_0x3ae47a[_0xc5a8('0x4c')]=_[_0xc5a8('0x4f')](_0x3ae47a[_0xc5a8('0x4c')],{'$or':_['map'](_0x3ae47a['attributes'],function(_0x5f4c67){var _0x34a651={};_0x34a651[_0x5f4c67]={'$like':'%'+_0x49b92d[_0xc5a8('0x42')][_0xc5a8('0x4e')]+'%'};return _0x34a651;})});}_0x3ae47a=_[_0xc5a8('0x4f')]({},_0x3ae47a,_0x49b92d[_0xc5a8('0x52')]);return db['ChatOfflineMessage'][_0xc5a8('0x30')]({'where':_0x3ae47a[_0xc5a8('0x4c')]})[_0xc5a8('0x34')](function(_0xaae80e){_0xed2ec8[_0xc5a8('0x30')]=_0xaae80e;if(_0x49b92d[_0xc5a8('0x42')][_0xc5a8('0x54')]){_0x3ae47a[_0xc5a8('0x58')]=[{'all':!![]}];}else{_0x3ae47a[_0xc5a8('0x58')]=[{'model':db[_0xc5a8('0xa9')],'as':'Contact','required':![]},{'model':db[_0xc5a8('0xe1')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x3ae47a);})[_0xc5a8('0x34')](function(_0x3e0282){_0xed2ec8[_0xc5a8('0x69')]=_0x3e0282;return _0xed2ec8;});}})[_0xc5a8('0x34')](respondWithFilteredResult(_0x3d35cb,_0x3ae47a))['catch'](handleError(_0x3d35cb,null));};exports[_0xc5a8('0x131')]=function(_0xf47d84,_0xeeafeb,_0x392297){return db['ChatWebsite']['find']({'where':{'id':_0xf47d84['params']['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0xeeafeb,null))[_0xc5a8('0x34')](function(_0x44a909){if(_0x44a909){return _0x44a909[_0xc5a8('0x131')](_0xf47d84[_0xc5a8('0x5b')][_0xc5a8('0x6b')],_[_0xc5a8('0xfc')](_0xf47d84['body'],[_0xc5a8('0x6b'),'id'])||{})[_0xc5a8('0x132')](function(_0x3ccd7e){for(var _0x5bbc2b=0x0;_0x5bbc2b<_0xf47d84[_0xc5a8('0x5b')]['ids']['length'];_0x5bbc2b+=0x1){socket[_0xc5a8('0x133')](_0xc5a8('0x134'),{'UserId':Number(_0xf47d84[_0xc5a8('0x5b')]['ids'][_0x5bbc2b]),'ChatWebsiteId':Number(_0xf47d84[_0xc5a8('0x57')]['id'])});}return _0x3ccd7e;});}})[_0xc5a8('0x34')](respondWithResult(_0xeeafeb,null))[_0xc5a8('0x2b')](handleError(_0xeeafeb,null));};exports[_0xc5a8('0x135')]=function(_0x27675b,_0x4a1019,_0x332bdd){return db[_0xc5a8('0x53')][_0xc5a8('0x59')]({'where':{'id':_0x27675b[_0xc5a8('0x57')]['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0x4a1019,null))[_0xc5a8('0x34')](function(_0x3c4a1a){if(_0x3c4a1a){return _0x3c4a1a[_0xc5a8('0x135')](_0x27675b[_0xc5a8('0x42')]['ids'])[_0xc5a8('0x34')](function(){if(_[_0xc5a8('0x136')](_0x27675b[_0xc5a8('0x42')][_0xc5a8('0x6b')])){for(var _0x58d6ef=0x0;_0x58d6ef<_0x27675b['query'][_0xc5a8('0x6b')][_0xc5a8('0x48')];_0x58d6ef+=0x1){socket[_0xc5a8('0x133')]('userChatWebsite:remove',{'UserId':Number(_0x27675b[_0xc5a8('0x42')][_0xc5a8('0x6b')][_0x58d6ef]),'ChatWebsiteId':Number(_0x27675b[_0xc5a8('0x57')]['id'])});}}else{socket['emit'](_0xc5a8('0x137'),{'UserId':Number(_0x27675b['query']['ids']),'ChatWebsiteId':Number(_0x27675b['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4a1019,null))['catch'](handleError(_0x4a1019,null));};exports['getAgents']=function(_0x5c75fc,_0x9796e8,_0x2ba712){var _0x149924={};var _0x368f63={};var _0x56ff61;var _0x496cd2;return db[_0xc5a8('0x53')][_0xc5a8('0x6e')]({'where':{'id':_0x5c75fc[_0xc5a8('0x57')]['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0x9796e8,null))['then'](function(_0xf58d9a){if(_0xf58d9a){_0x56ff61=_0xf58d9a;_0x368f63[_0xc5a8('0x41')]=_['keys'](db[_0xc5a8('0xc8')][_0xc5a8('0x3f')]);_0x368f63[_0xc5a8('0x42')]=_[_0xc5a8('0x43')](_0x5c75fc[_0xc5a8('0x42')]);_0x368f63[_0xc5a8('0x44')]=_[_0xc5a8('0x46')](_0x368f63[_0xc5a8('0x41')],_0x368f63[_0xc5a8('0x42')]);_0x149924['attributes']=_['intersection'](_0x368f63['model'],qs[_0xc5a8('0x47')](_0x5c75fc[_0xc5a8('0x42')][_0xc5a8('0x47')]));_0x149924[_0xc5a8('0x45')]=_0x149924[_0xc5a8('0x45')][_0xc5a8('0x48')]?_0x149924[_0xc5a8('0x45')]:_0x368f63[_0xc5a8('0x41')];_0x149924[_0xc5a8('0x68')]=qs['sort'](_0x5c75fc[_0xc5a8('0x42')]['sort']);_0x149924['where']=qs['filters'](_[_0xc5a8('0x4d')](_0x5c75fc['query'],_0x368f63['filters']));if(_0x5c75fc['query'][_0xc5a8('0x4e')]){_0x149924[_0xc5a8('0x4c')]=_['merge'](_0x149924[_0xc5a8('0x4c')],{'$or':_[_0xc5a8('0x50')](_0x149924[_0xc5a8('0x45')],function(_0x1070b0){var _0x302ab5={};_0x302ab5[_0x1070b0]={'$like':'%'+_0x5c75fc[_0xc5a8('0x42')]['filter']+'%'};return _0x302ab5;})});}_0x149924=_[_0xc5a8('0x4f')]({},_0x149924,_0x5c75fc['options']);return _0x56ff61[_0xc5a8('0x138')](_0x149924);}})[_0xc5a8('0x34')](function(_0x3b3bb1){if(_0x3b3bb1){_0x496cd2=_0x3b3bb1[_0xc5a8('0x48')];if(!_0x5c75fc[_0xc5a8('0x42')][_0xc5a8('0xfe')]('nolimit')){_0x149924['limit']=qs[_0xc5a8('0x2f')](_0x5c75fc[_0xc5a8('0x42')][_0xc5a8('0x2f')]);_0x149924[_0xc5a8('0x4a')]=qs[_0xc5a8('0x4a')](_0x5c75fc['query'][_0xc5a8('0x4a')]);}return _0x56ff61[_0xc5a8('0x138')](_0x149924);}})[_0xc5a8('0x34')](function(_0x3b9418){if(_0x3b9418){return _0x3b9418?{'count':_0x496cd2,'rows':_0x3b9418}:null;}})[_0xc5a8('0x34')](respondWithResult(_0x9796e8,null))[_0xc5a8('0x2b')](handleError(_0x9796e8,null));};
\ No newline at end of file
index fc4a26c..a4813c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a01=['../../mysqldb','ChatWebsite','update','remove','hasOwnProperty','hook','exports','events'];(function(_0x5adcee,_0xfdda97){var _0x1beaa3=function(_0x948152){while(--_0x948152){_0x5adcee['push'](_0x5adcee['shift']());}};_0x1beaa3(++_0xfdda97);}(_0x5a01,0x1af));var _0x15a0=function(_0x50f6e5,_0x151ccb){_0x50f6e5=_0x50f6e5-0x0;var _0x5988c5=_0x5a01[_0x50f6e5];return _0x5988c5;};'use strict';var EventEmitter=require(_0x15a0('0x0'));var ChatWebsite=require(_0x15a0('0x1'))['db'][_0x15a0('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x15a0('0x3'),'afterDestroy':_0x15a0('0x4')};function emitEvent(_0x4c7c75){return function(_0x1c83a1,_0x12ae6b,_0x1751ed){ChatWebsiteEvents['emit'](_0x4c7c75+':'+_0x1c83a1['id'],_0x1c83a1);ChatWebsiteEvents['emit'](_0x4c7c75,_0x1c83a1);_0x1751ed(null);};}for(var e in events){if(events[_0x15a0('0x5')](e)){var event=events[e];ChatWebsite[_0x15a0('0x6')](e,emitEvent(event));}}module[_0x15a0('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x6183=['emit','hasOwnProperty','hook','../../mysqldb','ChatWebsite','setMaxListeners','update','remove'];(function(_0x3ee33e,_0x2f0a2b){var _0x369fbd=function(_0x467b7d){while(--_0x467b7d){_0x3ee33e['push'](_0x3ee33e['shift']());}};_0x369fbd(++_0x2f0a2b);}(_0x6183,0x19b));var _0x3618=function(_0x1597e2,_0x388d3e){_0x1597e2=_0x1597e2-0x0;var _0x4c8c0a=_0x6183[_0x1597e2];return _0x4c8c0a;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x3618('0x0'))['db'][_0x3618('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x3618('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3618('0x3'),'afterDestroy':_0x3618('0x4')};function emitEvent(_0x176f61){return function(_0x2d62a7,_0x21af62,_0x10918c){ChatWebsiteEvents[_0x3618('0x5')](_0x176f61+':'+_0x2d62a7['id'],_0x2d62a7);ChatWebsiteEvents[_0x3618('0x5')](_0x176f61,_0x2d62a7);_0x10918c(null);};}for(var e in events){if(events[_0x3618('0x6')](e)){var event=events[e];ChatWebsite[_0x3618('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
index 684f6b6..4f54701 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd154=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','api'];(function(_0x2c4bc3,_0x34f08b){var _0x31ca59=function(_0x2190f0){while(--_0x2190f0){_0x2c4bc3['push'](_0x2c4bc3['shift']());}};_0x31ca59(++_0x34f08b);}(_0xd154,0x177));var _0x4d15=function(_0x564820,_0x344e99){_0x564820=_0x564820-0x0;var _0x1f8ab3=_0xd154[_0x564820];return _0x1f8ab3;};'use strict';var _=require(_0x4d15('0x0'));var util=require(_0x4d15('0x1'));var logger=require('../../config/logger')(_0x4d15('0x2'));var moment=require(_0x4d15('0x3'));var BPromise=require(_0x4d15('0x4'));var rp=require(_0x4d15('0x5'));var fs=require('fs');var path=require(_0x4d15('0x6'));var rimraf=require(_0x4d15('0x7'));var config=require(_0x4d15('0x8'));var attributes=require(_0x4d15('0x9'));module[_0x4d15('0xa')]=function(_0x6963e4,_0xf58fda){return _0x6963e4[_0x4d15('0xb')](_0x4d15('0xc'),attributes,{'tableName':_0x4d15('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6d4f=['api','bluebird','request-promise','path','rimraf','exports','define','chat_websites','lodash','../../config/logger'];(function(_0x3b7260,_0x1d2636){var _0x3cfa8e=function(_0x569b2a){while(--_0x569b2a){_0x3b7260['push'](_0x3b7260['shift']());}};_0x3cfa8e(++_0x1d2636);}(_0x6d4f,0x1c0));var _0xf6d4=function(_0x1f7a00,_0x341591){_0x1f7a00=_0x1f7a00-0x0;var _0x4b151c=_0x6d4f[_0x1f7a00];return _0x4b151c;};'use strict';var _=require(_0xf6d4('0x0'));var util=require('util');var logger=require(_0xf6d4('0x1'))(_0xf6d4('0x2'));var moment=require('moment');var BPromise=require(_0xf6d4('0x3'));var rp=require(_0xf6d4('0x4'));var fs=require('fs');var path=require(_0xf6d4('0x5'));var rimraf=require(_0xf6d4('0x6'));var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module[_0xf6d4('0x7')]=function(_0x1d6d9e,_0x5397dc){return _0x1d6d9e[_0xf6d4('0x8')]('ChatWebsite',attributes,{'tableName':_0xf6d4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6e5c3dd..1cf23af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02c2=['message','result','catch','lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x158ab3,_0x4b5908){var _0x302830=function(_0x19fa14){while(--_0x19fa14){_0x158ab3['push'](_0x158ab3['shift']());}};_0x302830(++_0x4b5908);}(_0x02c2,0x14d));var _0x202c=function(_0x548fe7,_0xd82e3d){_0x548fe7=_0x548fe7-0x0;var _0x3a1e53=_0x02c2[_0x548fe7];return _0x3a1e53;};'use strict';var _=require(_0x202c('0x0'));var util=require(_0x202c('0x1'));var moment=require(_0x202c('0x2'));var BPromise=require('bluebird');var rs=require(_0x202c('0x3'));var fs=require('fs');var Redis=require(_0x202c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x202c('0x5'));var config=require(_0x202c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x202c('0x7')][_0x202c('0x8')]({'port':0x232a});config[_0x202c('0x9')]=_[_0x202c('0xa')](config['redis'],{'host':_0x202c('0xb'),'port':0x18eb});var socket=require(_0x202c('0xc'))(new Redis(config['redis']));require(_0x202c('0xd'))['register'](socket);function respondWithRpcPromise(_0x54f610,_0x107cda,_0x273a51){return new BPromise(function(_0x3180f9,_0x2490de){return client['request'](_0x54f610,_0x273a51)['then'](function(_0x82b89){logger[_0x202c('0xe')](_0x202c('0xf'),_0x107cda,_0x202c('0x10'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x107cda,_0x202c('0x10'),JSON[_0x202c('0x11')](_0x82b89));if(_0x82b89['error']){if(_0x82b89[_0x202c('0x12')]['code']===0x1f4){logger[_0x202c('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x107cda,_0x82b89[_0x202c('0x12')][_0x202c('0x13')]);return _0x2490de(_0x82b89[_0x202c('0x12')][_0x202c('0x13')]);}logger[_0x202c('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x107cda,_0x82b89['error'][_0x202c('0x13')]);return _0x3180f9(_0x82b89[_0x202c('0x12')][_0x202c('0x13')]);}else{logger[_0x202c('0xe')](_0x202c('0xf'),_0x107cda,'request\x20sent');_0x3180f9(_0x82b89[_0x202c('0x14')][_0x202c('0x13')]);}})[_0x202c('0x15')](function(_0x38da67){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x107cda,_0x38da67);_0x2490de(_0x38da67);});});}
\ No newline at end of file
+var _0x507e=['jayson/promise','client','http','defaults','redis','localhost','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc'];(function(_0x17c731,_0x5af764){var _0x1a4ac2=function(_0x354582){while(--_0x354582){_0x17c731['push'](_0x17c731['shift']());}};_0x1a4ac2(++_0x5af764);}(_0x507e,0x191));var _0xe507=function(_0x5b34c0,_0x3ad403){_0x5b34c0=_0x5b34c0-0x0;var _0x242bd3=_0x507e[_0x5b34c0];return _0x242bd3;};'use strict';var _=require(_0xe507('0x0'));var util=require(_0xe507('0x1'));var moment=require(_0xe507('0x2'));var BPromise=require(_0xe507('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe507('0x4'));var db=require(_0xe507('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe507('0x6'));var config=require('../../config/environment');var jayson=require(_0xe507('0x7'));var client=jayson[_0xe507('0x8')][_0xe507('0x9')]({'port':0x232a});config['redis']=_[_0xe507('0xa')](config[_0xe507('0xb')],{'host':_0xe507('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe507('0xb')]));require(_0xe507('0xd'))['register'](socket);function respondWithRpcPromise(_0x4ca94d,_0x45adc9,_0x7ff2cd){return new BPromise(function(_0x2d2181,_0x5daf19){return client[_0xe507('0xe')](_0x4ca94d,_0x7ff2cd)[_0xe507('0xf')](function(_0x36f71f){logger[_0xe507('0x10')](_0xe507('0x11'),_0x45adc9,'request\x20sent');logger['debug'](_0xe507('0x12'),_0x45adc9,_0xe507('0x13'),JSON['stringify'](_0x36f71f));if(_0x36f71f['error']){if(_0x36f71f['error']['code']===0x1f4){logger[_0xe507('0x14')](_0xe507('0x11'),_0x45adc9,_0x36f71f[_0xe507('0x14')][_0xe507('0x15')]);return _0x5daf19(_0x36f71f[_0xe507('0x14')][_0xe507('0x15')]);}logger[_0xe507('0x14')](_0xe507('0x11'),_0x45adc9,_0x36f71f['error'][_0xe507('0x15')]);return _0x2d2181(_0x36f71f[_0xe507('0x14')][_0xe507('0x15')]);}else{logger[_0xe507('0x10')](_0xe507('0x11'),_0x45adc9,'request\x20sent');_0x2d2181(_0x36f71f[_0xe507('0x16')]['message']);}})[_0xe507('0x17')](function(_0x4efe20){logger[_0xe507('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x45adc9,_0x4efe20);_0x5daf19(_0x4efe20);});});}
\ No newline at end of file
index eb1d01d..72ceaac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x198d=['removeListener','register','length','save','remove','update','emit'];(function(_0x21d5f9,_0x11e8f2){var _0xb9a560=function(_0x232214){while(--_0x232214){_0x21d5f9['push'](_0x21d5f9['shift']());}};_0xb9a560(++_0x11e8f2);}(_0x198d,0x88));var _0xd198=function(_0x1923d4,_0x5c968b){_0x1923d4=_0x1923d4-0x0;var _0x5d8474=_0x198d[_0x1923d4];return _0x5d8474;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xd198('0x0'),_0xd198('0x1'),_0xd198('0x2')];function createListener(_0x6f6671,_0x51cdcc){return function(_0x480c21){_0x51cdcc[_0xd198('0x3')](_0x6f6671,_0x480c21);};}function removeListener(_0xdc4825,_0x1d8464){return function(){ChatWebsiteEvents[_0xd198('0x4')](_0xdc4825,_0x1d8464);};}exports[_0xd198('0x5')]=function(_0x5ce33b){for(var _0x390d6d=0x0,_0x4ac82f=events[_0xd198('0x6')];_0x390d6d<_0x4ac82f;_0x390d6d++){var _0x577e98=events[_0x390d6d];var _0x1c2747=createListener('chatWebsite:'+_0x577e98,_0x5ce33b);ChatWebsiteEvents['on'](_0x577e98,_0x1c2747);}};
\ No newline at end of file
+var _0x9bbf=['emit','removeListener','register','length','./chatWebsite.events','save','remove','update'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x9bbf,0x164));var _0xf9bb=function(_0x5c28c1,_0x5b4296){_0x5c28c1=_0x5c28c1-0x0;var _0x284229=_0x9bbf[_0x5c28c1];return _0x284229;};'use strict';var ChatWebsiteEvents=require(_0xf9bb('0x0'));var events=[_0xf9bb('0x1'),_0xf9bb('0x2'),_0xf9bb('0x3')];function createListener(_0x360c80,_0xa7b2f8){return function(_0x49efad){_0xa7b2f8[_0xf9bb('0x4')](_0x360c80,_0x49efad);};}function removeListener(_0x15d3ac,_0x12e5bd){return function(){ChatWebsiteEvents[_0xf9bb('0x5')](_0x15d3ac,_0x12e5bd);};}exports[_0xf9bb('0x6')]=function(_0x52bcac){for(var _0x5e92a8=0x0,_0x4468f7=events[_0xf9bb('0x7')];_0x5e92a8<_0x4468f7;_0x5e92a8++){var _0x5487c1=events[_0x5e92a8];var _0x4cc8ad=createListener('chatWebsite:'+_0x5487c1,_0x52bcac);ChatWebsiteEvents['on'](_0x5487c1,_0x4cc8ad);}};
\ No newline at end of file
index 6b1d50f..fbc4b39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc84d=['Router','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','/:id/dispositions','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','file','addLogo','server/files/images/avatars/','now','/:id/avatar','addAvatar','single','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','offline','addApplications','delete','destroy','removeDispositions','removeAnswers','multer','util','connect-timeout','express'];(function(_0x56f937,_0x58d121){var _0x297fad=function(_0x5456a5){while(--_0x5456a5){_0x56f937['push'](_0x56f937['shift']());}};_0x297fad(++_0x58d121);}(_0xc84d,0x114));var _0xdc84=function(_0x1d757a,_0xf81a72){_0x1d757a=_0x1d757a-0x0;var _0x1d3ed7=_0xc84d[_0x1d757a];return _0x1d3ed7;};'use strict';var multer=require(_0xdc84('0x0'));var util=require(_0xdc84('0x1'));var path=require('path');var timeout=require(_0xdc84('0x2'));var express=require(_0xdc84('0x3'));var router=express[_0xdc84('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdc84('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdc84('0x6'));var controller=require(_0xdc84('0x7'));router[_0xdc84('0x8')]('/',auth[_0xdc84('0x9')](),controller[_0xdc84('0xa')]);router[_0xdc84('0x8')](_0xdc84('0xb'),auth[_0xdc84('0x9')](),controller[_0xdc84('0xc')]);router[_0xdc84('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xdc84('0xd')]);router[_0xdc84('0x8')]('/:id/dispositions',auth[_0xdc84('0x9')](),controller[_0xdc84('0xe')]);router[_0xdc84('0x8')](_0xdc84('0xf'),auth[_0xdc84('0x9')](),controller[_0xdc84('0x10')]);router[_0xdc84('0x8')](_0xdc84('0x11'),controller[_0xdc84('0x12')]);router[_0xdc84('0x8')]('/:id/avatar',controller[_0xdc84('0x13')]);router['get'](_0xdc84('0x14'),controller['getCustomerAvatar']);router[_0xdc84('0x8')](_0xdc84('0x15'),controller[_0xdc84('0x16')]);router['get'](_0xdc84('0x17'),auth[_0xdc84('0x9')](),controller[_0xdc84('0x18')]);router['get'](_0xdc84('0x19'),controller['getSnippet']);router['get'](_0xdc84('0x1a'),auth[_0xdc84('0x9')](),controller[_0xdc84('0x1b')]);router[_0xdc84('0x8')](_0xdc84('0x1c'),auth[_0xdc84('0x9')](),controller[_0xdc84('0x1d')]);router['get'](_0xdc84('0x1e'),controller[_0xdc84('0x1f')]);router[_0xdc84('0x8')](_0xdc84('0x20'),auth[_0xdc84('0x9')](),controller[_0xdc84('0x21')]);router['get'](_0xdc84('0x22'),auth[_0xdc84('0x9')](),controller['getAgents']);router[_0xdc84('0x23')]('/',auth[_0xdc84('0x9')](),controller[_0xdc84('0x24')]);router[_0xdc84('0x23')](_0xdc84('0x25'),auth[_0xdc84('0x9')](),controller[_0xdc84('0x26')]);router['post'](_0xdc84('0xf'),auth['isAuthenticated'](),controller[_0xdc84('0x27')]);var upload=multer({'storage':multer[_0xdc84('0x28')]({'destination':function(_0x26dee3,_0x393e87,_0x5ec070){_0x5ec070(null,path[_0xdc84('0x29')](config[_0xdc84('0x2a')],_0xdc84('0x2b')));},'filename':function(_0x56d843,_0x5c307c,_0x3587c1){_0x3587c1(null,util[_0xdc84('0x2c')](_0xdc84('0x2d'),Date['now'](),_0x5c307c[_0xdc84('0x2e')]));}})});router[_0xdc84('0x23')](_0xdc84('0x11'),upload['single'](_0xdc84('0x2f')),controller[_0xdc84('0x30')]);var upload=multer({'storage':multer[_0xdc84('0x28')]({'destination':function(_0x120624,_0x5184f0,_0x468caa){_0x468caa(null,path[_0xdc84('0x29')](config[_0xdc84('0x2a')],_0xdc84('0x31')));},'filename':function(_0x29f0e3,_0x5c9fd7,_0x4637f5){_0x4637f5(null,util[_0xdc84('0x2c')](_0xdc84('0x2d'),Date[_0xdc84('0x32')](),_0x5c9fd7[_0xdc84('0x2e')]));}})});router[_0xdc84('0x23')](_0xdc84('0x33'),upload['single'](_0xdc84('0x2f')),controller[_0xdc84('0x34')]);var upload=multer({'storage':multer[_0xdc84('0x28')]({'destination':function(_0x38af6f,_0x4a4105,_0x2aba01){_0x2aba01(null,path['join'](config['root'],_0xdc84('0x31')));},'filename':function(_0xd1a1c7,_0x31c351,_0x2eb6c7){_0x2eb6c7(null,util[_0xdc84('0x2c')]('%s-%s',Date[_0xdc84('0x32')](),_0x31c351['originalname']));}})});router['post'](_0xdc84('0x14'),upload[_0xdc84('0x35')](_0xdc84('0x2f')),controller[_0xdc84('0x36')]);var upload=multer({'storage':multer[_0xdc84('0x28')]({'destination':function(_0x1a21a4,_0x5bb167,_0x38df93){_0x38df93(null,path[_0xdc84('0x29')](config[_0xdc84('0x2a')],_0xdc84('0x31')));},'filename':function(_0x555dac,_0x341b5e,_0x19e799){_0x19e799(null,util['format'](_0xdc84('0x2d'),Date[_0xdc84('0x32')](),_0x341b5e[_0xdc84('0x2e')]));}})});router[_0xdc84('0x23')](_0xdc84('0x15'),upload['single'](_0xdc84('0x2f')),controller[_0xdc84('0x37')]);router[_0xdc84('0x23')](_0xdc84('0x38'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xdc84('0x28')]({'destination':function(_0x219b44,_0x4d40f1,_0x33710f){const _0x74e6e6=path[_0xdc84('0x29')](config['root'],_0xdc84('0x39'),_0xdc84('0x3a'),_0xdc84('0x3b'));fs_extra[_0xdc84('0x3c')](_0x74e6e6,function(){_0x33710f(null,_0x74e6e6);});},'filename':function(_0x428aae,_0xdd78d9,_0x7aa21d){const _0x49c4d8=_0xdd78d9[_0xdc84('0x2e')][_0xdc84('0x3d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5b94c1=path[_0xdc84('0x3e')](_0x49c4d8);const _0x4c244b=Date[_0xdc84('0x32')]()+'-'+_0x49c4d8['replace'](_0x5b94c1,'')+_0x5b94c1;_0x7aa21d(null,_0x4c244b);}})});router['post'](_0xdc84('0x3f'),offlineUploadMulter['any'](),controller[_0xdc84('0x40')]);router[_0xdc84('0x23')](_0xdc84('0x17'),auth['isAuthenticated'](),controller['addInteraction']);router[_0xdc84('0x23')](_0xdc84('0x1a'),auth['isAuthenticated'](),controller[_0xdc84('0x41')]);router[_0xdc84('0x23')](_0xdc84('0x1c'),auth[_0xdc84('0x9')](),controller['addProactiveActions']);router[_0xdc84('0x23')](_0xdc84('0x22'),auth[_0xdc84('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0xdc84('0x9')](),controller['update']);router[_0xdc84('0x42')]('/:id',auth[_0xdc84('0x9')](),controller[_0xdc84('0x43')]);router[_0xdc84('0x42')]('/:id/dispositions',auth[_0xdc84('0x9')](),controller[_0xdc84('0x44')]);router[_0xdc84('0x42')](_0xdc84('0xf'),auth[_0xdc84('0x9')](),controller[_0xdc84('0x45')]);router[_0xdc84('0x42')](_0xdc84('0x22'),auth[_0xdc84('0x9')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x0a38=['post','create','addDisposition','/:id/canned_answers','diskStorage','join','root','format','%s-%s','originalname','server/files/images/avatars/','now','single','file','addAvatar','addCustomerAvatar','/:id/notify','server/files','attachments','offline-chat','ensureDir','extname','replace','/:id/offline','addInteraction','/:id/applications','addProactiveActions','addAgents','put','delete','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents'];(function(_0x30428d,_0xa5efd4){var _0x1dd91f=function(_0x4e6ec9){while(--_0x4e6ec9){_0x30428d['push'](_0x30428d['shift']());}};_0x1dd91f(++_0xa5efd4);}(_0x0a38,0x18a));var _0x80a3=function(_0x30747b,_0x4f391a){_0x30747b=_0x30747b-0x0;var _0x240ee8=_0x0a38[_0x30747b];return _0x240ee8;};'use strict';var multer=require('multer');var util=require(_0x80a3('0x0'));var path=require(_0x80a3('0x1'));var timeout=require(_0x80a3('0x2'));var express=require('express');var router=express[_0x80a3('0x3')]();var fs_extra=require(_0x80a3('0x4'));var auth=require(_0x80a3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x80a3('0x6'));var controller=require(_0x80a3('0x7'));router['get']('/',auth[_0x80a3('0x8')](),controller[_0x80a3('0x9')]);router[_0x80a3('0xa')](_0x80a3('0xb'),auth['isAuthenticated'](),controller[_0x80a3('0xc')]);router[_0x80a3('0xa')](_0x80a3('0xd'),auth[_0x80a3('0x8')](),controller[_0x80a3('0xe')]);router[_0x80a3('0xa')](_0x80a3('0xf'),auth[_0x80a3('0x8')](),controller[_0x80a3('0x10')]);router['get']('/:id/canned_answers',auth[_0x80a3('0x8')](),controller[_0x80a3('0x11')]);router[_0x80a3('0xa')](_0x80a3('0x12'),controller[_0x80a3('0x13')]);router[_0x80a3('0xa')](_0x80a3('0x14'),controller[_0x80a3('0x15')]);router['get'](_0x80a3('0x16'),controller[_0x80a3('0x17')]);router[_0x80a3('0xa')](_0x80a3('0x18'),controller['getSystemAvatar']);router[_0x80a3('0xa')](_0x80a3('0x19'),auth[_0x80a3('0x8')](),controller[_0x80a3('0x1a')]);router[_0x80a3('0xa')](_0x80a3('0x1b'),controller[_0x80a3('0x1c')]);router[_0x80a3('0xa')]('/:id/applications',auth[_0x80a3('0x8')](),controller[_0x80a3('0x1d')]);router['get'](_0x80a3('0x1e'),auth[_0x80a3('0x8')](),controller[_0x80a3('0x1f')]);router[_0x80a3('0xa')](_0x80a3('0x20'),controller[_0x80a3('0x21')]);router[_0x80a3('0xa')](_0x80a3('0x22'),auth['isAuthenticated'](),controller[_0x80a3('0x23')]);router[_0x80a3('0xa')](_0x80a3('0x24'),auth['isAuthenticated'](),controller[_0x80a3('0x25')]);router[_0x80a3('0x26')]('/',auth[_0x80a3('0x8')](),controller[_0x80a3('0x27')]);router[_0x80a3('0x26')]('/:id/dispositions',auth[_0x80a3('0x8')](),controller[_0x80a3('0x28')]);router['post'](_0x80a3('0x29'),auth[_0x80a3('0x8')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x80a3('0x2a')]({'destination':function(_0x27f990,_0x264731,_0x54c02a){_0x54c02a(null,path[_0x80a3('0x2b')](config[_0x80a3('0x2c')],'server/files/images/logos/'));},'filename':function(_0xf1abbc,_0x2cf6a1,_0x2e713b){_0x2e713b(null,util[_0x80a3('0x2d')](_0x80a3('0x2e'),Date['now'](),_0x2cf6a1[_0x80a3('0x2f')]));}})});router[_0x80a3('0x26')](_0x80a3('0x12'),upload['single']('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x80a3('0x2a')]({'destination':function(_0x1271bf,_0x3ce520,_0x4ee2be){_0x4ee2be(null,path[_0x80a3('0x2b')](config[_0x80a3('0x2c')],_0x80a3('0x30')));},'filename':function(_0x2f187d,_0x54d7a3,_0x426f1d){_0x426f1d(null,util['format'](_0x80a3('0x2e'),Date[_0x80a3('0x31')](),_0x54d7a3['originalname']));}})});router['post'](_0x80a3('0x14'),upload[_0x80a3('0x32')](_0x80a3('0x33')),controller[_0x80a3('0x34')]);var upload=multer({'storage':multer[_0x80a3('0x2a')]({'destination':function(_0x55dee3,_0x555dbf,_0x5196c0){_0x5196c0(null,path[_0x80a3('0x2b')](config[_0x80a3('0x2c')],_0x80a3('0x30')));},'filename':function(_0x440d69,_0x12287a,_0x4bc1d6){_0x4bc1d6(null,util[_0x80a3('0x2d')]('%s-%s',Date[_0x80a3('0x31')](),_0x12287a['originalname']));}})});router['post'](_0x80a3('0x16'),upload[_0x80a3('0x32')](_0x80a3('0x33')),controller[_0x80a3('0x35')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1894ae,_0x5c7b30,_0xce3f21){_0xce3f21(null,path[_0x80a3('0x2b')](config[_0x80a3('0x2c')],_0x80a3('0x30')));},'filename':function(_0x3767fc,_0xf0f349,_0x5c802b){_0x5c802b(null,util[_0x80a3('0x2d')](_0x80a3('0x2e'),Date['now'](),_0xf0f349[_0x80a3('0x2f')]));}})});router[_0x80a3('0x26')](_0x80a3('0x18'),upload[_0x80a3('0x32')]('file'),controller['addSystemAvatar']);router[_0x80a3('0x26')](_0x80a3('0x36'),controller['notify']);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x5e6226,_0x2f6884,_0xbbae41){const _0x3972b4=path[_0x80a3('0x2b')](config[_0x80a3('0x2c')],_0x80a3('0x37'),_0x80a3('0x38'),_0x80a3('0x39'));fs_extra[_0x80a3('0x3a')](_0x3972b4,function(){_0xbbae41(null,_0x3972b4);});},'filename':function(_0x873070,_0x20cc3e,_0x3aea4a){const _0x5586e5=_0x20cc3e[_0x80a3('0x2f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x192372=path[_0x80a3('0x3b')](_0x5586e5);const _0x1840d1=Date['now']()+'-'+_0x5586e5[_0x80a3('0x3c')](_0x192372,'')+_0x192372;_0x3aea4a(null,_0x1840d1);}})});router[_0x80a3('0x26')](_0x80a3('0x3d'),offlineUploadMulter['any'](),controller['offline']);router['post'](_0x80a3('0x19'),auth[_0x80a3('0x8')](),controller[_0x80a3('0x3e')]);router['post'](_0x80a3('0x3f'),auth[_0x80a3('0x8')](),controller['addApplications']);router['post']('/:id/proactive_actions',auth[_0x80a3('0x8')](),controller[_0x80a3('0x40')]);router[_0x80a3('0x26')]('/:id/users',auth[_0x80a3('0x8')](),controller[_0x80a3('0x41')]);router[_0x80a3('0x42')](_0x80a3('0xd'),auth[_0x80a3('0x8')](),controller['update']);router[_0x80a3('0x43')](_0x80a3('0xd'),auth[_0x80a3('0x8')](),controller['destroy']);router[_0x80a3('0x43')](_0x80a3('0xf'),auth['isAuthenticated'](),controller[_0x80a3('0x44')]);router[_0x80a3('0x43')](_0x80a3('0x29'),auth[_0x80a3('0x8')](),controller[_0x80a3('0x45')]);router[_0x80a3('0x43')](_0x80a3('0x24'),auth[_0x80a3('0x8')](),controller[_0x80a3('0x46')]);module[_0x80a3('0x47')]=router;
\ No newline at end of file
index f6874d5..5b952ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x038b=['exports','STRING','ENUM','Google'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x038b,0x114));var _0xb038=function(_0x32d626,_0x3e794b){_0x32d626=_0x32d626-0x0;var _0x5099b5=_0x038b[_0x32d626];return _0x5099b5;};'use strict';var Sequelize=require('sequelize');module[_0xb038('0x0')]={'name':{'type':Sequelize[_0xb038('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xb038('0x2')]('AmazonAWS',_0xb038('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xb038('0x1')]}};
\ No newline at end of file
+var _0xd1f9=['STRING','ENUM','AmazonAWS','Google'];(function(_0xe910c9,_0x50dd2d){var _0x500749=function(_0x385cc3){while(--_0x385cc3){_0xe910c9['push'](_0xe910c9['shift']());}};_0x500749(++_0x50dd2d);}(_0xd1f9,0x88));var _0x9d1f=function(_0x77773a,_0x5a7026){_0x77773a=_0x77773a-0x0;var _0x1091a2=_0xd1f9[_0x77773a];return _0x1091a2;};'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 60074f4..8c8a704 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(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3ac2ed,_0x60b800){_0x3ac2ed=_0x3ac2ed-0x0;var _0x56b758=_0x5f2f[_0x3ac2ed];return _0x56b758;};'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(_0x233414,_0x1bfcdc){var _0xd18a80=function(_0x3654ca){while(--_0x3654ca){_0x233414['push'](_0x233414['shift']());}};_0xd18a80(++_0x1bfcdc);}(_0xdb28,0x106));var _0x8db2=function(_0x3bb66d,_0x2fc61c){_0x3bb66d=_0x3bb66d-0x0;var _0x8446ef=_0xdb28[_0x3bb66d];return _0x8446ef;};'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 0a91bbb..e1f949d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc17=['path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','lodash','../../config/logger','api','request-promise'];(function(_0x321283,_0x4aa366){var _0xf8a248=function(_0x234762){while(--_0x234762){_0x321283['push'](_0x321283['shift']());}};_0xf8a248(++_0x4aa366);}(_0xfc17,0x1b4));var _0x7fc1=function(_0x35239e,_0x5463a1){_0x35239e=_0x35239e-0x0;var _0x265c79=_0xfc17[_0x35239e];return _0x265c79;};'use strict';var _=require(_0x7fc1('0x0'));var util=require('util');var logger=require(_0x7fc1('0x1'))(_0x7fc1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7fc1('0x3'));var fs=require('fs');var path=require(_0x7fc1('0x4'));var rimraf=require(_0x7fc1('0x5'));var config=require(_0x7fc1('0x6'));var attributes=require(_0x7fc1('0x7'));module[_0x7fc1('0x8')]=function(_0x33c6d9,_0x17d8a3){return _0x33c6d9[_0x7fc1('0x9')](_0x7fc1('0xa'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4893=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','cloud_providers','lodash'];(function(_0x47fbfb,_0x391da4){var _0x45b620=function(_0x31273d){while(--_0x31273d){_0x47fbfb['push'](_0x47fbfb['shift']());}};_0x45b620(++_0x391da4);}(_0x4893,0x153));var _0x3489=function(_0x27beea,_0x3bc9f4){_0x27beea=_0x27beea-0x0;var _0x122645=_0x4893[_0x27beea];return _0x122645;};'use strict';var _=require(_0x3489('0x0'));var util=require(_0x3489('0x1'));var logger=require('../../config/logger')(_0x3489('0x2'));var moment=require(_0x3489('0x3'));var BPromise=require(_0x3489('0x4'));var rp=require(_0x3489('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3489('0x6'));var config=require(_0x3489('0x7'));var attributes=require('./cloudProvider.attributes');module['exports']=function(_0xd2394,_0x12b66e){return _0xd2394[_0x3489('0x8')]('CloudProvider',attributes,{'tableName':_0x3489('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 32284f0..cad5f2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13cc=['../../config/environment','client','request','then','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','CloudProvider,\x20%s,\x20%s','info','result','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x253141,_0x396c1e){var _0x4472f3=function(_0x28b591){while(--_0x28b591){_0x253141['push'](_0x253141['shift']());}};_0x4472f3(++_0x396c1e);}(_0x13cc,0x161));var _0xc13c=function(_0x2e7f71,_0xb8d20c){_0x2e7f71=_0x2e7f71-0x0;var _0x145b93=_0x13cc[_0x2e7f71];return _0x145b93;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc13c('0x0'));var BPromise=require(_0xc13c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc13c('0x2'));var db=require(_0xc13c('0x3'))['db'];var utils=require(_0xc13c('0x4'));var logger=require(_0xc13c('0x5'))(_0xc13c('0x6'));var config=require(_0xc13c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc13c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18b0b4,_0x41b41b,_0x4889d6){return new BPromise(function(_0x318eab,_0x3570f3){return client[_0xc13c('0x9')](_0x18b0b4,_0x4889d6)[_0xc13c('0xa')](function(_0x5ee2aa){logger['info']('CloudProvider,\x20%s,\x20%s',_0x41b41b,_0xc13c('0xb'));logger[_0xc13c('0xc')](_0xc13c('0xd'),_0x41b41b,_0xc13c('0xb'),JSON[_0xc13c('0xe')](_0x5ee2aa));if(_0x5ee2aa['error']){if(_0x5ee2aa[_0xc13c('0xf')]['code']===0x1f4){logger[_0xc13c('0xf')]('CloudProvider,\x20%s,\x20%s',_0x41b41b,_0x5ee2aa['error'][_0xc13c('0x10')]);return _0x3570f3(_0x5ee2aa[_0xc13c('0xf')][_0xc13c('0x10')]);}logger[_0xc13c('0xf')](_0xc13c('0x11'),_0x41b41b,_0x5ee2aa[_0xc13c('0xf')][_0xc13c('0x10')]);return _0x318eab(_0x5ee2aa[_0xc13c('0xf')][_0xc13c('0x10')]);}else{logger[_0xc13c('0x12')]('CloudProvider,\x20%s,\x20%s',_0x41b41b,_0xc13c('0xb'));_0x318eab(_0x5ee2aa[_0xc13c('0x13')][_0xc13c('0x10')]);}})['catch'](function(_0x93cb3b){logger[_0xc13c('0xf')](_0xc13c('0x11'),_0x41b41b,_0x93cb3b);_0x3570f3(_0x93cb3b);});});}
\ No newline at end of file
+var _0xbcae=['../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xbcae,0xa9));var _0xebca=function(_0x5d0fe3,_0x385ac0){_0x5d0fe3=_0x5d0fe3-0x0;var _0x52c998=_0xbcae[_0x5d0fe3];return _0x52c998;};'use strict';var _=require(_0xebca('0x0'));var util=require(_0xebca('0x1'));var moment=require(_0xebca('0x2'));var BPromise=require(_0xebca('0x3'));var rs=require(_0xebca('0x4'));var fs=require('fs');var Redis=require(_0xebca('0x5'));var db=require(_0xebca('0x6'))['db'];var utils=require(_0xebca('0x7'));var logger=require(_0xebca('0x8'))(_0xebca('0x9'));var config=require('../../config/environment');var jayson=require(_0xebca('0xa'));var client=jayson[_0xebca('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x331ef7,_0x3781e0,_0x3830a6){return new BPromise(function(_0x49cea1,_0x27bf87){return client[_0xebca('0xc')](_0x331ef7,_0x3830a6)[_0xebca('0xd')](function(_0x1a371f){logger[_0xebca('0xe')](_0xebca('0xf'),_0x3781e0,'request\x20sent');logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x3781e0,_0xebca('0x10'),JSON[_0xebca('0x11')](_0x1a371f));if(_0x1a371f[_0xebca('0x12')]){if(_0x1a371f[_0xebca('0x12')][_0xebca('0x13')]===0x1f4){logger['error'](_0xebca('0xf'),_0x3781e0,_0x1a371f[_0xebca('0x12')][_0xebca('0x14')]);return _0x27bf87(_0x1a371f[_0xebca('0x12')][_0xebca('0x14')]);}logger[_0xebca('0x12')](_0xebca('0xf'),_0x3781e0,_0x1a371f[_0xebca('0x12')]['message']);return _0x49cea1(_0x1a371f['error'][_0xebca('0x14')]);}else{logger['info'](_0xebca('0xf'),_0x3781e0,_0xebca('0x10'));_0x49cea1(_0x1a371f[_0xebca('0x15')][_0xebca('0x14')]);}})['catch'](function(_0x33f471){logger[_0xebca('0x12')](_0xebca('0xf'),_0x3781e0,_0x33f471);_0x27bf87(_0x33f471);});});}
\ No newline at end of file
index 200ecb6..d547c81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa2c=['index','/:id','show','post','create','put','update','delete','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfa2c,0xda));var _0xcfa2=function(_0x2c8bee,_0xbdef90){_0x2c8bee=_0x2c8bee-0x0;var _0xd6335e=_0xfa2c[_0x2c8bee];return _0xd6335e;};'use strict';var multer=require(_0xcfa2('0x0'));var util=require(_0xcfa2('0x1'));var path=require(_0xcfa2('0x2'));var timeout=require('connect-timeout');var express=require(_0xcfa2('0x3'));var router=express[_0xcfa2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcfa2('0x5'));var config=require(_0xcfa2('0x6'));var controller=require(_0xcfa2('0x7'));router[_0xcfa2('0x8')]('/',auth[_0xcfa2('0x9')](),controller[_0xcfa2('0xa')]);router[_0xcfa2('0x8')](_0xcfa2('0xb'),auth[_0xcfa2('0x9')](),controller[_0xcfa2('0xc')]);router[_0xcfa2('0xd')]('/',auth[_0xcfa2('0x9')](),controller[_0xcfa2('0xe')]);router[_0xcfa2('0xf')](_0xcfa2('0xb'),auth['isAuthenticated'](),controller[_0xcfa2('0x10')]);router[_0xcfa2('0x11')](_0xcfa2('0xb'),auth[_0xcfa2('0x9')](),controller['destroy']);module[_0xcfa2('0x12')]=router;
\ No newline at end of file
+var _0x87f9=['create','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x134387,_0x3bff4b){var _0x34b800=function(_0x522c8b){while(--_0x522c8b){_0x134387['push'](_0x134387['shift']());}};_0x34b800(++_0x3bff4b);}(_0x87f9,0x1a2));var _0x987f=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0x87f9[_0x1ddedd];return _0xa3e1ac;};'use strict';var multer=require('multer');var util=require(_0x987f('0x0'));var path=require(_0x987f('0x1'));var timeout=require(_0x987f('0x2'));var express=require(_0x987f('0x3'));var router=express[_0x987f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x987f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x987f('0x6'));var controller=require(_0x987f('0x7'));router[_0x987f('0x8')]('/',auth[_0x987f('0x9')](),controller[_0x987f('0xa')]);router[_0x987f('0x8')](_0x987f('0xb'),auth[_0x987f('0x9')](),controller[_0x987f('0xc')]);router[_0x987f('0xd')]('/',auth[_0x987f('0x9')](),controller[_0x987f('0xe')]);router['put']('/:id',auth[_0x987f('0x9')](),controller[_0x987f('0xf')]);router[_0x987f('0x10')](_0x987f('0xb'),auth[_0x987f('0x9')](),controller[_0x987f('0x11')]);module['exports']=router;
\ No newline at end of file
index 4c5c5a8..f9ddd60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43ce=['exports','STRING','name','sequelize'];(function(_0x5eb584,_0x8fbc2d){var _0x5f4a0f=function(_0x565a1d){while(--_0x565a1d){_0x5eb584['push'](_0x5eb584['shift']());}};_0x5f4a0f(++_0x8fbc2d);}(_0x43ce,0x14b));var _0xe43c=function(_0x31f2be,_0xf21d6b){_0x31f2be=_0x31f2be-0x0;var _0x1ccae0=_0x43ce[_0x31f2be];return _0x1ccae0;};'use strict';var Sequelize=require(_0xe43c('0x0'));module[_0xe43c('0x1')]={'name':{'type':Sequelize[_0xe43c('0x2')],'unique':_0xe43c('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xe43c('0x2')]},'companyId':{'type':Sequelize[_0xe43c('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xe43c('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xe43c('0x2')]},'postalCode':{'type':Sequelize[_0xe43c('0x2')]},'city':{'type':Sequelize[_0xe43c('0x2')]},'country':{'type':Sequelize[_0xe43c('0x2')]},'email':{'type':Sequelize[_0xe43c('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xe43c('0x2')]},'sStreet':{'type':Sequelize[_0xe43c('0x2')]},'sPostalCode':{'type':Sequelize[_0xe43c('0x2')]},'sCity':{'type':Sequelize[_0xe43c('0x2')]},'sCountry':{'type':Sequelize[_0xe43c('0x2')]},'description':{'type':Sequelize[_0xe43c('0x2')]}};
\ No newline at end of file
+var _0x76aa=['exports','STRING','name'];(function(_0x58f477,_0x1d7d99){var _0x276381=function(_0x1bcf30){while(--_0x1bcf30){_0x58f477['push'](_0x58f477['shift']());}};_0x276381(++_0x1d7d99);}(_0x76aa,0xc0));var _0xa76a=function(_0x30c0e8,_0x14e4cc){_0x30c0e8=_0x30c0e8-0x0;var _0x2c0abb=_0x76aa[_0x30c0e8];return _0x2c0abb;};'use strict';var Sequelize=require('sequelize');module[_0xa76a('0x0')]={'name':{'type':Sequelize[_0xa76a('0x1')],'unique':_0xa76a('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa76a('0x1')]},'companyId':{'type':Sequelize[_0xa76a('0x1')]},'website':{'type':Sequelize[_0xa76a('0x1')]},'phone':{'type':Sequelize[_0xa76a('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa76a('0x1')]},'street':{'type':Sequelize[_0xa76a('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xa76a('0x1')]},'country':{'type':Sequelize[_0xa76a('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa76a('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xa76a('0x1')]},'sCountry':{'type':Sequelize[_0xa76a('0x1')]},'description':{'type':Sequelize[_0xa76a('0x1')]}};
\ No newline at end of file
index 95276ee..0c77131 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x756a=['order','sort','where','filter','merge','map','options','CmCompany','includeAll','include','rows','catch','params','rawAttributes','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','create','addContacts','CmContact','ids','omit','getContacts','pick','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','count','limit','Content-Range','json','apply','save','update','then','destroy','get','Companies','UserProfileResource','end','stack','name','send','index','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x26f954,_0x406ad6){var _0x5360f7=function(_0x78abd9){while(--_0x78abd9){_0x26f954['push'](_0x26f954['shift']());}};_0x5360f7(++_0x406ad6);}(_0x756a,0x1c0));var _0xa756=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x756a[_0x1a36a5];return _0x746243;};'use strict';var emlformat=require(_0xa756('0x0'));var rimraf=require(_0xa756('0x1'));var zipdir=require(_0xa756('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa756('0x3'));var moment=require(_0xa756('0x4'));var BPromise=require(_0xa756('0x5'));var Mustache=require(_0xa756('0x6'));var util=require(_0xa756('0x7'));var path=require(_0xa756('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa756('0x9'));var fs=require('fs');var fs_extra=require(_0xa756('0xa'));var _=require(_0xa756('0xb'));var squel=require(_0xa756('0xc'));var crypto=require(_0xa756('0xd'));var jsforce=require(_0xa756('0xe'));var deskjs=require(_0xa756('0xf'));var toCsv=require(_0xa756('0x10'));var querystring=require(_0xa756('0x11'));var Papa=require('papaparse');var Redis=require(_0xa756('0x12'));var authService=require(_0xa756('0x13'));var qs=require(_0xa756('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa756('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xa756('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa756('0x17'))['db'];function respondWithStatusCode(_0x32e650,_0x13cbea){_0x13cbea=_0x13cbea||0xcc;return function(_0x80ce5e){if(_0x80ce5e){return _0x32e650[_0xa756('0x18')](_0x13cbea);}return _0x32e650[_0xa756('0x19')](_0x13cbea)['end']();};}function respondWithResult(_0x2d1190,_0x36d3ae){_0x36d3ae=_0x36d3ae||0xc8;return function(_0x15aabf){if(_0x15aabf){return _0x2d1190[_0xa756('0x19')](_0x36d3ae)['json'](_0x15aabf);}};}function respondWithFilteredResult(_0x2e8631,_0x1a590b){return function(_0x341c3f){if(_0x341c3f){var _0x5e4bf8=typeof _0x1a590b[_0xa756('0x1a')]===_0xa756('0x1b')&&typeof _0x1a590b['limit']===_0xa756('0x1b');var _0x50492f=_0x341c3f[_0xa756('0x1c')];var _0x5421e4=_0x5e4bf8?0x0:_0x1a590b[_0xa756('0x1a')];var _0x4340d3=_0x5e4bf8?_0x341c3f[_0xa756('0x1c')]:_0x1a590b[_0xa756('0x1a')]+_0x1a590b[_0xa756('0x1d')];var _0x795302;if(_0x4340d3>=_0x50492f){_0x4340d3=_0x50492f;_0x795302=0xc8;}else{_0x795302=0xce;}_0x2e8631[_0xa756('0x19')](_0x795302);return _0x2e8631['set'](_0xa756('0x1e'),_0x5421e4+'-'+_0x4340d3+'/'+_0x50492f)[_0xa756('0x1f')](_0x341c3f);}return null;};}function patchUpdates(_0x3098b3){return function(_0x186c80){try{jsonpatch[_0xa756('0x20')](_0x186c80,_0x3098b3,!![]);}catch(_0x443230){return BPromise['reject'](_0x443230);}return _0x186c80[_0xa756('0x21')]();};}function saveUpdates(_0x184af5,_0x107142){return function(_0x5d31d6){if(_0x5d31d6){return _0x5d31d6[_0xa756('0x22')](_0x184af5)[_0xa756('0x23')](function(_0xa4522c){return _0xa4522c;});}return null;};}function removeEntity(_0x471ddc,_0x3dd77d){return function(_0x3c1694){if(_0x3c1694){return _0x3c1694[_0xa756('0x24')]()['then'](function(){var _0x61a0ab=_0x3c1694[_0xa756('0x25')]({'plain':!![]});var _0x30fd83=_0xa756('0x26');return db[_0xa756('0x27')][_0xa756('0x24')]({'where':{'type':_0x30fd83,'resourceId':_0x61a0ab['id']}})[_0xa756('0x23')](function(){return _0x3c1694;});})['then'](function(){_0x471ddc[_0xa756('0x19')](0xcc)[_0xa756('0x28')]();});}};}function handleEntityNotFound(_0x460de6,_0x43865d){return function(_0x410449){if(!_0x410449){_0x460de6[_0xa756('0x18')](0x194);}return _0x410449;};}function handleError(_0x38fd5e,_0x38c903){_0x38c903=_0x38c903||0x1f4;return function(_0x234778){logger['error'](_0x234778[_0xa756('0x29')]);if(_0x234778[_0xa756('0x2a')]){delete _0x234778[_0xa756('0x2a')];}_0x38fd5e[_0xa756('0x19')](_0x38c903)[_0xa756('0x2b')](_0x234778);};}exports[_0xa756('0x2c')]=function(_0x22d8b7,_0x1603fc){var _0x1d98ba={},_0x4a3371={},_0x2edfcf={'count':0x0,'rows':[]};return db['CmCompany'][_0xa756('0x2d')]()['then'](function(_0x528334){_0x4a3371[_0xa756('0x2e')]=_[_0xa756('0x2f')](_0x528334);_0x4a3371[_0xa756('0x30')]=_[_0xa756('0x2f')](_0x22d8b7[_0xa756('0x30')]);_0x4a3371[_0xa756('0x31')]=_[_0xa756('0x32')](_0x4a3371['model'],_0x4a3371[_0xa756('0x30')]);_0x1d98ba[_0xa756('0x33')]=_[_0xa756('0x32')](_0x4a3371[_0xa756('0x2e')],qs[_0xa756('0x34')](_0x22d8b7['query'][_0xa756('0x34')]));_0x1d98ba[_0xa756('0x33')]=_0x1d98ba[_0xa756('0x33')][_0xa756('0x35')]?_0x1d98ba[_0xa756('0x33')]:_0x4a3371[_0xa756('0x2e')];if(!_0x22d8b7['query'][_0xa756('0x36')](_0xa756('0x37'))){_0x1d98ba[_0xa756('0x1d')]=qs[_0xa756('0x1d')](_0x22d8b7[_0xa756('0x30')][_0xa756('0x1d')]);_0x1d98ba[_0xa756('0x1a')]=qs['offset'](_0x22d8b7[_0xa756('0x30')][_0xa756('0x1a')]);}_0x1d98ba[_0xa756('0x38')]=qs[_0xa756('0x39')](_0x22d8b7['query']['sort']);_0x1d98ba[_0xa756('0x3a')]=qs[_0xa756('0x31')](_['pick'](_0x22d8b7[_0xa756('0x30')],_0x4a3371[_0xa756('0x31')]),_0x528334);if(_0x22d8b7[_0xa756('0x30')][_0xa756('0x3b')]){_0x1d98ba[_0xa756('0x3a')]=_[_0xa756('0x3c')](_0x1d98ba['where'],{'$or':_[_0xa756('0x3d')](_0x1d98ba[_0xa756('0x33')],function(_0x57a07b){var _0x118834={};_0x118834[_0x57a07b]={'$like':'%'+_0x22d8b7['query']['filter']+'%'};return _0x118834;})});}_0x1d98ba=_['merge']({},_0x1d98ba,_0x22d8b7[_0xa756('0x3e')]);var _0xb89578={'where':_0x1d98ba[_0xa756('0x3a')]};return db[_0xa756('0x3f')][_0xa756('0x1c')](_0xb89578)[_0xa756('0x23')](function(_0x518f83){_0x2edfcf[_0xa756('0x1c')]=_0x518f83;if(_0x22d8b7[_0xa756('0x30')][_0xa756('0x40')]){_0x1d98ba[_0xa756('0x41')]=[{'all':!![]}];}return db[_0xa756('0x3f')]['findAll'](_0x1d98ba);})[_0xa756('0x23')](function(_0x36f31f){_0x2edfcf[_0xa756('0x42')]=_0x36f31f;return _0x2edfcf;})['then'](respondWithFilteredResult(_0x1603fc,_0x1d98ba))[_0xa756('0x43')](handleError(_0x1603fc,null));})[_0xa756('0x43')](handleError(_0x1603fc,null));};exports['show']=function(_0x2dee7a,_0x10558f){var _0x1e5028={'raw':![],'where':{'id':_0x2dee7a[_0xa756('0x44')]['id']}},_0x15ed13={};_0x15ed13[_0xa756('0x2e')]=_[_0xa756('0x2f')](db['CmCompany'][_0xa756('0x45')]);_0x15ed13[_0xa756('0x30')]=_[_0xa756('0x2f')](_0x2dee7a[_0xa756('0x30')]);_0x15ed13[_0xa756('0x31')]=_['intersection'](_0x15ed13[_0xa756('0x2e')],_0x15ed13['query']);_0x1e5028[_0xa756('0x33')]=_['intersection'](_0x15ed13['model'],qs[_0xa756('0x34')](_0x2dee7a[_0xa756('0x30')]['fields']));_0x1e5028[_0xa756('0x33')]=_0x1e5028[_0xa756('0x33')][_0xa756('0x35')]?_0x1e5028[_0xa756('0x33')]:_0x15ed13[_0xa756('0x2e')];if(_0x2dee7a[_0xa756('0x30')][_0xa756('0x40')]){_0x1e5028['include']=[{'all':!![]}];}_0x1e5028=_[_0xa756('0x3c')]({},_0x1e5028,_0x2dee7a['options']);return db[_0xa756('0x3f')][_0xa756('0x46')](_0x1e5028)['then'](handleEntityNotFound(_0x10558f,null))[_0xa756('0x23')](respondWithResult(_0x10558f,null))[_0xa756('0x43')](handleError(_0x10558f,null));};exports['create']=function(_0x4cede4,_0x224b3d){return db[_0xa756('0x3f')]['create'](_0x4cede4[_0xa756('0x47')],{})[_0xa756('0x23')](function(_0x22f3f6){var _0xf3ac50=_0x4cede4[_0xa756('0x48')][_0xa756('0x25')]({'plain':!![]});if(!_0xf3ac50)throw new Error(_0xa756('0x49'));if(_0xf3ac50[_0xa756('0x4a')]===_0xa756('0x48')){var _0x5794c4=_0x22f3f6[_0xa756('0x25')]({'plain':!![]});var _0x5dc8f4=_0xa756('0x26');return db[_0xa756('0x4b')]['find']({'where':{'name':_0x5dc8f4,'userProfileId':_0xf3ac50['userProfileId']},'raw':!![]})[_0xa756('0x23')](function(_0xe107ae){if(_0xe107ae&&_0xe107ae[_0xa756('0x4c')]===0x0){return db['UserProfileResource'][_0xa756('0x4d')]({'name':_0x5794c4[_0xa756('0x2a')],'resourceId':_0x5794c4['id'],'type':_0xe107ae[_0xa756('0x2a')],'sectionId':_0xe107ae['id']},{})[_0xa756('0x23')](function(){return _0x22f3f6;});}else{return _0x22f3f6;}})[_0xa756('0x43')](function(_0x496afd){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x496afd);throw _0x496afd;});}return _0x22f3f6;})[_0xa756('0x23')](respondWithResult(_0x224b3d,0xc9))[_0xa756('0x43')](handleError(_0x224b3d,null));};exports['update']=function(_0x1bd498,_0x5e38b7){if(_0x1bd498[_0xa756('0x47')]['id']){delete _0x1bd498['body']['id'];}return db['CmCompany'][_0xa756('0x46')]({'where':{'id':_0x1bd498[_0xa756('0x44')]['id']}})['then'](handleEntityNotFound(_0x5e38b7,null))[_0xa756('0x23')](saveUpdates(_0x1bd498[_0xa756('0x47')],null))[_0xa756('0x23')](respondWithResult(_0x5e38b7,null))[_0xa756('0x43')](handleError(_0x5e38b7,null));};exports[_0xa756('0x24')]=function(_0x5ce106,_0x4a8558){return db[_0xa756('0x3f')][_0xa756('0x46')]({'where':{'id':_0x5ce106[_0xa756('0x44')]['id']}})['then'](handleEntityNotFound(_0x4a8558,null))[_0xa756('0x23')](removeEntity(_0x4a8558,null))[_0xa756('0x43')](handleError(_0x4a8558,null));};exports['describe']=function(_0x66a5c3,_0x325875){return db[_0xa756('0x3f')][_0xa756('0x2d')]()[_0xa756('0x23')](respondWithResult(_0x325875,null))[_0xa756('0x43')](handleError(_0x325875,null));};exports[_0xa756('0x4e')]=function(_0x40b149,_0x57c090,_0x2b750c){return db[_0xa756('0x4f')][_0xa756('0x46')]({'where':{'id':_0x40b149[_0xa756('0x44')]['id']}})[_0xa756('0x23')](handleEntityNotFound(_0x57c090,null))[_0xa756('0x23')](function(_0x494dad){if(_0x494dad){return _0x494dad[_0xa756('0x4e')](_0x40b149[_0xa756('0x47')][_0xa756('0x50')],_[_0xa756('0x51')](_0x40b149[_0xa756('0x47')],[_0xa756('0x50'),'id'])||{});}})[_0xa756('0x23')](respondWithResult(_0x57c090,null))[_0xa756('0x43')](handleError(_0x57c090,null));};exports[_0xa756('0x52')]=function(_0x3180f4,_0x29e7e9,_0x4064da){var _0x510194={};var _0x243464={};var _0x3cdc33;var _0x8602a8;return db['CmCompany']['findOne']({'where':{'id':_0x3180f4[_0xa756('0x44')]['id']}})[_0xa756('0x23')](handleEntityNotFound(_0x29e7e9,null))[_0xa756('0x23')](function(_0x467be7){if(_0x467be7){_0x3cdc33=_0x467be7;_0x243464[_0xa756('0x2e')]=_[_0xa756('0x2f')](db[_0xa756('0x4f')][_0xa756('0x45')]);_0x243464['query']=_[_0xa756('0x2f')](_0x3180f4['query']);_0x243464[_0xa756('0x31')]=_[_0xa756('0x32')](_0x243464[_0xa756('0x2e')],_0x243464[_0xa756('0x30')]);_0x510194[_0xa756('0x33')]=_[_0xa756('0x32')](_0x243464[_0xa756('0x2e')],qs[_0xa756('0x34')](_0x3180f4['query'][_0xa756('0x34')]));_0x510194['attributes']=_0x510194['attributes'][_0xa756('0x35')]?_0x510194[_0xa756('0x33')]:_0x243464['model'];_0x510194[_0xa756('0x38')]=qs[_0xa756('0x39')](_0x3180f4['query'][_0xa756('0x39')]);_0x510194[_0xa756('0x3a')]=qs[_0xa756('0x31')](_[_0xa756('0x53')](_0x3180f4[_0xa756('0x30')],_0x243464[_0xa756('0x31')]));if(_0x3180f4[_0xa756('0x30')][_0xa756('0x3b')]){_0x510194['where']=_['merge'](_0x510194[_0xa756('0x3a')],{'$or':_[_0xa756('0x3d')](_0x510194[_0xa756('0x33')],function(_0x25825c){var _0x120ca6={};_0x120ca6[_0x25825c]={'$like':'%'+_0x3180f4[_0xa756('0x30')][_0xa756('0x3b')]+'%'};return _0x120ca6;})});}_0x510194=_[_0xa756('0x3c')]({},_0x510194,_0x3180f4[_0xa756('0x3e')]);return _0x3cdc33['getContacts'](_0x510194);}})[_0xa756('0x23')](function(_0x470b34){if(_0x470b34){_0x8602a8=_0x470b34[_0xa756('0x35')];if(!_0x3180f4[_0xa756('0x30')][_0xa756('0x36')](_0xa756('0x37'))){_0x510194[_0xa756('0x1d')]=qs[_0xa756('0x1d')](_0x3180f4[_0xa756('0x30')]['limit']);_0x510194[_0xa756('0x1a')]=qs['offset'](_0x3180f4[_0xa756('0x30')]['offset']);}return _0x3cdc33[_0xa756('0x52')](_0x510194);}})[_0xa756('0x23')](function(_0x47ad9b){if(_0x47ad9b){return _0x47ad9b?{'count':_0x8602a8,'rows':_0x47ad9b}:null;}})[_0xa756('0x23')](respondWithResult(_0x29e7e9,null))[_0xa756('0x43')](handleError(_0x29e7e9,null));};
\ No newline at end of file
+var _0x24ef=['../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','get','Companies','UserProfileResource','stack','name','send','index','CmCompany','describe','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','filters','filter','where','merge','map','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','omit','getContacts','findOne','CmContact','order','sort','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x5d8424,_0x4c4b47){var _0x39b72c=function(_0x1ec701){while(--_0x1ec701){_0x5d8424['push'](_0x5d8424['shift']());}};_0x39b72c(++_0x4c4b47);}(_0x24ef,0x142));var _0xf24e=function(_0x59b731,_0x52f8b3){_0x59b731=_0x59b731-0x0;var _0x23e313=_0x24ef[_0x59b731];return _0x23e313;};'use strict';var emlformat=require(_0xf24e('0x0'));var rimraf=require(_0xf24e('0x1'));var zipdir=require(_0xf24e('0x2'));var jsonpatch=require(_0xf24e('0x3'));var rp=require(_0xf24e('0x4'));var moment=require(_0xf24e('0x5'));var BPromise=require(_0xf24e('0x6'));var Mustache=require('mustache');var util=require(_0xf24e('0x7'));var path=require(_0xf24e('0x8'));var sox=require(_0xf24e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf24e('0xa'));var crypto=require(_0xf24e('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf24e('0xc'));var querystring=require('querystring');var Papa=require(_0xf24e('0xd'));var Redis=require(_0xf24e('0xe'));var authService=require(_0xf24e('0xf'));var qs=require(_0xf24e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf24e('0x11'))(_0xf24e('0x12'));var utils=require(_0xf24e('0x13'));var config=require(_0xf24e('0x14'));var licenseUtil=require(_0xf24e('0x15'));var db=require(_0xf24e('0x16'))['db'];function respondWithStatusCode(_0x40f124,_0x51af54){_0x51af54=_0x51af54||0xcc;return function(_0x5474bd){if(_0x5474bd){return _0x40f124[_0xf24e('0x17')](_0x51af54);}return _0x40f124[_0xf24e('0x18')](_0x51af54)[_0xf24e('0x19')]();};}function respondWithResult(_0x203475,_0x584c8e){_0x584c8e=_0x584c8e||0xc8;return function(_0x55c920){if(_0x55c920){return _0x203475['status'](_0x584c8e)[_0xf24e('0x1a')](_0x55c920);}};}function respondWithFilteredResult(_0xf43f92,_0xca31e7){return function(_0x46d493){if(_0x46d493){var _0x2b2594=typeof _0xca31e7['offset']===_0xf24e('0x1b')&&typeof _0xca31e7[_0xf24e('0x1c')]===_0xf24e('0x1b');var _0x255352=_0x46d493[_0xf24e('0x1d')];var _0x58d5af=_0x2b2594?0x0:_0xca31e7[_0xf24e('0x1e')];var _0xb42ccb=_0x2b2594?_0x46d493['count']:_0xca31e7['offset']+_0xca31e7['limit'];var _0x12bc99;if(_0xb42ccb>=_0x255352){_0xb42ccb=_0x255352;_0x12bc99=0xc8;}else{_0x12bc99=0xce;}_0xf43f92[_0xf24e('0x18')](_0x12bc99);return _0xf43f92[_0xf24e('0x1f')](_0xf24e('0x20'),_0x58d5af+'-'+_0xb42ccb+'/'+_0x255352)['json'](_0x46d493);}return null;};}function patchUpdates(_0x54e56e){return function(_0x11622a){try{jsonpatch['apply'](_0x11622a,_0x54e56e,!![]);}catch(_0xdd0eda){return BPromise[_0xf24e('0x21')](_0xdd0eda);}return _0x11622a[_0xf24e('0x22')]();};}function saveUpdates(_0x22e9e4,_0x159bb6){return function(_0x2824ba){if(_0x2824ba){return _0x2824ba[_0xf24e('0x23')](_0x22e9e4)[_0xf24e('0x24')](function(_0x40b501){return _0x40b501;});}return null;};}function removeEntity(_0x4e47fc,_0x14335f){return function(_0x2be65a){if(_0x2be65a){return _0x2be65a[_0xf24e('0x25')]()[_0xf24e('0x24')](function(){var _0x462ee0=_0x2be65a[_0xf24e('0x26')]({'plain':!![]});var _0x42ce97=_0xf24e('0x27');return db[_0xf24e('0x28')]['destroy']({'where':{'type':_0x42ce97,'resourceId':_0x462ee0['id']}})[_0xf24e('0x24')](function(){return _0x2be65a;});})['then'](function(){_0x4e47fc['status'](0xcc)[_0xf24e('0x19')]();});}};}function handleEntityNotFound(_0x2faaed,_0x16d0de){return function(_0x50f91f){if(!_0x50f91f){_0x2faaed[_0xf24e('0x17')](0x194);}return _0x50f91f;};}function handleError(_0x3afdfb,_0x29034b){_0x29034b=_0x29034b||0x1f4;return function(_0x3f5798){logger['error'](_0x3f5798[_0xf24e('0x29')]);if(_0x3f5798[_0xf24e('0x2a')]){delete _0x3f5798[_0xf24e('0x2a')];}_0x3afdfb[_0xf24e('0x18')](_0x29034b)[_0xf24e('0x2b')](_0x3f5798);};}exports[_0xf24e('0x2c')]=function(_0x13d37e,_0x54af4a){var _0x973708={},_0x4cca11={},_0x44874d={'count':0x0,'rows':[]};return db[_0xf24e('0x2d')][_0xf24e('0x2e')]()[_0xf24e('0x24')](function(_0x53dcf3){_0x4cca11['model']=_[_0xf24e('0x2f')](_0x53dcf3);_0x4cca11[_0xf24e('0x30')]=_[_0xf24e('0x2f')](_0x13d37e['query']);_0x4cca11['filters']=_['intersection'](_0x4cca11[_0xf24e('0x31')],_0x4cca11[_0xf24e('0x30')]);_0x973708[_0xf24e('0x32')]=_[_0xf24e('0x33')](_0x4cca11[_0xf24e('0x31')],qs['fields'](_0x13d37e[_0xf24e('0x30')][_0xf24e('0x34')]));_0x973708[_0xf24e('0x32')]=_0x973708[_0xf24e('0x32')][_0xf24e('0x35')]?_0x973708[_0xf24e('0x32')]:_0x4cca11[_0xf24e('0x31')];if(!_0x13d37e[_0xf24e('0x30')][_0xf24e('0x36')]('nolimit')){_0x973708[_0xf24e('0x1c')]=qs[_0xf24e('0x1c')](_0x13d37e['query'][_0xf24e('0x1c')]);_0x973708[_0xf24e('0x1e')]=qs['offset'](_0x13d37e[_0xf24e('0x30')][_0xf24e('0x1e')]);}_0x973708['order']=qs['sort'](_0x13d37e[_0xf24e('0x30')]['sort']);_0x973708['where']=qs[_0xf24e('0x37')](_['pick'](_0x13d37e[_0xf24e('0x30')],_0x4cca11[_0xf24e('0x37')]),_0x53dcf3);if(_0x13d37e[_0xf24e('0x30')][_0xf24e('0x38')]){_0x973708[_0xf24e('0x39')]=_[_0xf24e('0x3a')](_0x973708[_0xf24e('0x39')],{'$or':_[_0xf24e('0x3b')](_0x973708[_0xf24e('0x32')],function(_0x40feb0){var _0x370852={};_0x370852[_0x40feb0]={'$like':'%'+_0x13d37e[_0xf24e('0x30')][_0xf24e('0x38')]+'%'};return _0x370852;})});}_0x973708=_['merge']({},_0x973708,_0x13d37e[_0xf24e('0x3c')]);var _0x46ebac={'where':_0x973708[_0xf24e('0x39')]};return db[_0xf24e('0x2d')][_0xf24e('0x1d')](_0x46ebac)[_0xf24e('0x24')](function(_0x18b3fd){_0x44874d['count']=_0x18b3fd;if(_0x13d37e[_0xf24e('0x30')][_0xf24e('0x3d')]){_0x973708[_0xf24e('0x3e')]=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x973708);})['then'](function(_0x2f622e){_0x44874d[_0xf24e('0x3f')]=_0x2f622e;return _0x44874d;})[_0xf24e('0x24')](respondWithFilteredResult(_0x54af4a,_0x973708))[_0xf24e('0x40')](handleError(_0x54af4a,null));})[_0xf24e('0x40')](handleError(_0x54af4a,null));};exports[_0xf24e('0x41')]=function(_0x92ecca,_0x4c2f83){var _0x21136a={'raw':![],'where':{'id':_0x92ecca[_0xf24e('0x42')]['id']}},_0x37e011={};_0x37e011[_0xf24e('0x31')]=_['keys'](db[_0xf24e('0x2d')][_0xf24e('0x43')]);_0x37e011[_0xf24e('0x30')]=_['keys'](_0x92ecca['query']);_0x37e011[_0xf24e('0x37')]=_[_0xf24e('0x33')](_0x37e011[_0xf24e('0x31')],_0x37e011['query']);_0x21136a[_0xf24e('0x32')]=_[_0xf24e('0x33')](_0x37e011[_0xf24e('0x31')],qs[_0xf24e('0x34')](_0x92ecca[_0xf24e('0x30')]['fields']));_0x21136a[_0xf24e('0x32')]=_0x21136a[_0xf24e('0x32')]['length']?_0x21136a[_0xf24e('0x32')]:_0x37e011[_0xf24e('0x31')];if(_0x92ecca['query'][_0xf24e('0x3d')]){_0x21136a['include']=[{'all':!![]}];}_0x21136a=_['merge']({},_0x21136a,_0x92ecca[_0xf24e('0x3c')]);return db[_0xf24e('0x2d')][_0xf24e('0x44')](_0x21136a)[_0xf24e('0x24')](handleEntityNotFound(_0x4c2f83,null))[_0xf24e('0x24')](respondWithResult(_0x4c2f83,null))[_0xf24e('0x40')](handleError(_0x4c2f83,null));};exports[_0xf24e('0x45')]=function(_0x439d8d,_0x114f36){return db[_0xf24e('0x2d')][_0xf24e('0x45')](_0x439d8d[_0xf24e('0x46')],{})['then'](function(_0xbc3d44){var _0x58cc25=_0x439d8d[_0xf24e('0x47')][_0xf24e('0x26')]({'plain':!![]});if(!_0x58cc25)throw new Error(_0xf24e('0x48'));if(_0x58cc25[_0xf24e('0x49')]===_0xf24e('0x47')){var _0xf3e402=_0xbc3d44[_0xf24e('0x26')]({'plain':!![]});var _0x3a694a=_0xf24e('0x27');return db[_0xf24e('0x4a')][_0xf24e('0x44')]({'where':{'name':_0x3a694a,'userProfileId':_0x58cc25[_0xf24e('0x4b')]},'raw':!![]})['then'](function(_0x4d6838){if(_0x4d6838&&_0x4d6838['autoAssociation']===0x0){return db[_0xf24e('0x28')][_0xf24e('0x45')]({'name':_0xf3e402[_0xf24e('0x2a')],'resourceId':_0xf3e402['id'],'type':_0x4d6838['name'],'sectionId':_0x4d6838['id']},{})[_0xf24e('0x24')](function(){return _0xbc3d44;});}else{return _0xbc3d44;}})['catch'](function(_0x11f66f){logger[_0xf24e('0x4c')](_0xf24e('0x4d'),_0x11f66f);throw _0x11f66f;});}return _0xbc3d44;})[_0xf24e('0x24')](respondWithResult(_0x114f36,0xc9))['catch'](handleError(_0x114f36,null));};exports[_0xf24e('0x23')]=function(_0x4550e7,_0x9a6253){if(_0x4550e7['body']['id']){delete _0x4550e7['body']['id'];}return db[_0xf24e('0x2d')][_0xf24e('0x44')]({'where':{'id':_0x4550e7[_0xf24e('0x42')]['id']}})['then'](handleEntityNotFound(_0x9a6253,null))[_0xf24e('0x24')](saveUpdates(_0x4550e7['body'],null))[_0xf24e('0x24')](respondWithResult(_0x9a6253,null))['catch'](handleError(_0x9a6253,null));};exports['destroy']=function(_0x46bd96,_0x575a5b){return db[_0xf24e('0x2d')][_0xf24e('0x44')]({'where':{'id':_0x46bd96[_0xf24e('0x42')]['id']}})['then'](handleEntityNotFound(_0x575a5b,null))[_0xf24e('0x24')](removeEntity(_0x575a5b,null))[_0xf24e('0x40')](handleError(_0x575a5b,null));};exports['describe']=function(_0x39a32d,_0x2c0b72){return db[_0xf24e('0x2d')][_0xf24e('0x2e')]()[_0xf24e('0x24')](respondWithResult(_0x2c0b72,null))[_0xf24e('0x40')](handleError(_0x2c0b72,null));};exports[_0xf24e('0x4e')]=function(_0x8dfe64,_0x34596a,_0x5fbff4){return db['CmContact'][_0xf24e('0x44')]({'where':{'id':_0x8dfe64[_0xf24e('0x42')]['id']}})[_0xf24e('0x24')](handleEntityNotFound(_0x34596a,null))[_0xf24e('0x24')](function(_0x6e15d8){if(_0x6e15d8){return _0x6e15d8['addContacts'](_0x8dfe64[_0xf24e('0x46')]['ids'],_[_0xf24e('0x4f')](_0x8dfe64[_0xf24e('0x46')],['ids','id'])||{});}})[_0xf24e('0x24')](respondWithResult(_0x34596a,null))['catch'](handleError(_0x34596a,null));};exports[_0xf24e('0x50')]=function(_0x18d134,_0x3319ee,_0x305392){var _0x357c12={};var _0x5b5385={};var _0x3c4f16;var _0x4dd4e7;return db['CmCompany'][_0xf24e('0x51')]({'where':{'id':_0x18d134[_0xf24e('0x42')]['id']}})[_0xf24e('0x24')](handleEntityNotFound(_0x3319ee,null))[_0xf24e('0x24')](function(_0xa364f1){if(_0xa364f1){_0x3c4f16=_0xa364f1;_0x5b5385[_0xf24e('0x31')]=_[_0xf24e('0x2f')](db[_0xf24e('0x52')][_0xf24e('0x43')]);_0x5b5385['query']=_[_0xf24e('0x2f')](_0x18d134['query']);_0x5b5385[_0xf24e('0x37')]=_[_0xf24e('0x33')](_0x5b5385['model'],_0x5b5385[_0xf24e('0x30')]);_0x357c12[_0xf24e('0x32')]=_[_0xf24e('0x33')](_0x5b5385[_0xf24e('0x31')],qs[_0xf24e('0x34')](_0x18d134[_0xf24e('0x30')]['fields']));_0x357c12[_0xf24e('0x32')]=_0x357c12[_0xf24e('0x32')][_0xf24e('0x35')]?_0x357c12['attributes']:_0x5b5385['model'];_0x357c12[_0xf24e('0x53')]=qs[_0xf24e('0x54')](_0x18d134['query'][_0xf24e('0x54')]);_0x357c12['where']=qs[_0xf24e('0x37')](_['pick'](_0x18d134[_0xf24e('0x30')],_0x5b5385[_0xf24e('0x37')]));if(_0x18d134[_0xf24e('0x30')][_0xf24e('0x38')]){_0x357c12[_0xf24e('0x39')]=_[_0xf24e('0x3a')](_0x357c12[_0xf24e('0x39')],{'$or':_[_0xf24e('0x3b')](_0x357c12[_0xf24e('0x32')],function(_0x1cbf53){var _0x251228={};_0x251228[_0x1cbf53]={'$like':'%'+_0x18d134[_0xf24e('0x30')][_0xf24e('0x38')]+'%'};return _0x251228;})});}_0x357c12=_[_0xf24e('0x3a')]({},_0x357c12,_0x18d134[_0xf24e('0x3c')]);return _0x3c4f16[_0xf24e('0x50')](_0x357c12);}})[_0xf24e('0x24')](function(_0x3b0584){if(_0x3b0584){_0x4dd4e7=_0x3b0584[_0xf24e('0x35')];if(!_0x18d134['query']['hasOwnProperty'](_0xf24e('0x55'))){_0x357c12[_0xf24e('0x1c')]=qs[_0xf24e('0x1c')](_0x18d134[_0xf24e('0x30')][_0xf24e('0x1c')]);_0x357c12[_0xf24e('0x1e')]=qs[_0xf24e('0x1e')](_0x18d134['query'][_0xf24e('0x1e')]);}return _0x3c4f16['getContacts'](_0x357c12);}})[_0xf24e('0x24')](function(_0x17152d){if(_0x17152d){return _0x17152d?{'count':_0x4dd4e7,'rows':_0x17152d}:null;}})['then'](respondWithResult(_0x3319ee,null))[_0xf24e('0x40')](handleError(_0x3319ee,null));};
\ No newline at end of file
index d172d69..b8b93b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d59=['moment','bluebird','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','util','../../config/logger'];(function(_0x588fa9,_0x39e9b3){var _0x2fc217=function(_0x123ca3){while(--_0x123ca3){_0x588fa9['push'](_0x588fa9['shift']());}};_0x2fc217(++_0x39e9b3);}(_0x7d59,0xce));var _0x97d5=function(_0x3f3a47,_0x28f84b){_0x3f3a47=_0x3f3a47-0x0;var _0x57a682=_0x7d59[_0x3f3a47];return _0x57a682;};'use strict';var _=require(_0x97d5('0x0'));var util=require(_0x97d5('0x1'));var logger=require(_0x97d5('0x2'))('api');var moment=require(_0x97d5('0x3'));var BPromise=require(_0x97d5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x97d5('0x5'));var config=require(_0x97d5('0x6'));var attributes=require(_0x97d5('0x7'));module['exports']=function(_0x7b392e,_0x1f5049){return _0x7b392e[_0x97d5('0x8')](_0x97d5('0x9'),attributes,{'tableName':_0x97d5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x55bc=['lodash','util','api','moment','bluebird','path','../../config/environment','exports','define','CmCompany'];(function(_0x112439,_0x17560a){var _0x4e8140=function(_0x4ce95b){while(--_0x4ce95b){_0x112439['push'](_0x112439['shift']());}};_0x4e8140(++_0x17560a);}(_0x55bc,0x15e));var _0xc55b=function(_0x3cbe29,_0x9fc9ec){_0x3cbe29=_0x3cbe29-0x0;var _0x4ae129=_0x55bc[_0x3cbe29];return _0x4ae129;};'use strict';var _=require(_0xc55b('0x0'));var util=require(_0xc55b('0x1'));var logger=require('../../config/logger')(_0xc55b('0x2'));var moment=require(_0xc55b('0x3'));var BPromise=require(_0xc55b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc55b('0x5'));var rimraf=require('rimraf');var config=require(_0xc55b('0x6'));var attributes=require('./cmCompany.attributes');module[_0xc55b('0x7')]=function(_0x3dcbfe,_0x4b2d1b){return _0x3dcbfe[_0xc55b('0x8')](_0xc55b('0x9'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f85b207..0680d38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33e7=['CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmCompany,\x20%s,\x20%s','info','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','request\x20sent'];(function(_0x537928,_0x4444f1){var _0x26c016=function(_0x4f7e95){while(--_0x4f7e95){_0x537928['push'](_0x537928['shift']());}};_0x26c016(++_0x4444f1);}(_0x33e7,0x1ac));var _0x733e=function(_0x142d65,_0x36cff7){_0x142d65=_0x142d65-0x0;var _0x4b3054=_0x33e7[_0x142d65];return _0x4b3054;};'use strict';var _=require(_0x733e('0x0'));var util=require(_0x733e('0x1'));var moment=require('moment');var BPromise=require(_0x733e('0x2'));var rs=require(_0x733e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x733e('0x4'))['db'];var utils=require(_0x733e('0x5'));var logger=require(_0x733e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x733e('0x7')][_0x733e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x322cdf,_0x7159a4,_0x43df8d){return new BPromise(function(_0x221009,_0x848787){return client[_0x733e('0x9')](_0x322cdf,_0x43df8d)[_0x733e('0xa')](function(_0x5855c6){logger['info']('CmCompany,\x20%s,\x20%s',_0x7159a4,_0x733e('0xb'));logger['debug'](_0x733e('0xc'),_0x7159a4,_0x733e('0xb'),JSON[_0x733e('0xd')](_0x5855c6));if(_0x5855c6[_0x733e('0xe')]){if(_0x5855c6[_0x733e('0xe')][_0x733e('0xf')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x7159a4,_0x5855c6['error'][_0x733e('0x10')]);return _0x848787(_0x5855c6[_0x733e('0xe')][_0x733e('0x10')]);}logger[_0x733e('0xe')](_0x733e('0x11'),_0x7159a4,_0x5855c6[_0x733e('0xe')][_0x733e('0x10')]);return _0x221009(_0x5855c6[_0x733e('0xe')]['message']);}else{logger[_0x733e('0x12')]('CmCompany,\x20%s,\x20%s',_0x7159a4,_0x733e('0xb'));_0x221009(_0x5855c6['result']['message']);}})[_0x733e('0x13')](function(_0x564883){logger[_0x733e('0xe')](_0x733e('0x11'),_0x7159a4,_0x564883);_0x848787(_0x564883);});});}
\ No newline at end of file
+var _0xa210=['message','info','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x587ba2,_0x42eb40){var _0x50ec73=function(_0x2f32e3){while(--_0x2f32e3){_0x587ba2['push'](_0x587ba2['shift']());}};_0x50ec73(++_0x42eb40);}(_0xa210,0xa5));var _0x0a21=function(_0x5ec75a,_0x4e1a09){_0x5ec75a=_0x5ec75a-0x0;var _0x10add9=_0xa210[_0x5ec75a];return _0x10add9;};'use strict';var _=require(_0x0a21('0x0'));var util=require(_0x0a21('0x1'));var moment=require(_0x0a21('0x2'));var BPromise=require(_0x0a21('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0a21('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a21('0x5'))('rpc');var config=require(_0x0a21('0x6'));var jayson=require(_0x0a21('0x7'));var client=jayson['client'][_0x0a21('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ca52a,_0x5834fa,_0x3294ac){return new BPromise(function(_0x46b61f,_0x4903e4){return client['request'](_0x4ca52a,_0x3294ac)[_0x0a21('0x9')](function(_0x4cfc24){logger['info'](_0x0a21('0xa'),_0x5834fa,_0x0a21('0xb'));logger[_0x0a21('0xc')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x5834fa,_0x0a21('0xb'),JSON['stringify'](_0x4cfc24));if(_0x4cfc24[_0x0a21('0xd')]){if(_0x4cfc24['error'][_0x0a21('0xe')]===0x1f4){logger[_0x0a21('0xd')]('CmCompany,\x20%s,\x20%s',_0x5834fa,_0x4cfc24['error']['message']);return _0x4903e4(_0x4cfc24[_0x0a21('0xd')][_0x0a21('0xf')]);}logger[_0x0a21('0xd')](_0x0a21('0xa'),_0x5834fa,_0x4cfc24[_0x0a21('0xd')]['message']);return _0x46b61f(_0x4cfc24['error'][_0x0a21('0xf')]);}else{logger[_0x0a21('0x10')](_0x0a21('0xa'),_0x5834fa,'request\x20sent');_0x46b61f(_0x4cfc24['result'][_0x0a21('0xf')]);}})[_0x0a21('0x11')](function(_0x2e307a){logger[_0x0a21('0xd')](_0x0a21('0xa'),_0x5834fa,_0x2e307a);_0x4903e4(_0x2e307a);});});}
\ No newline at end of file
index ad9c321..078f55a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35cf=['getContacts','create','post','/:id/contacts','addContacts','/:id','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','show'];(function(_0x8a30cf,_0x40f19b){var _0x20f439=function(_0x157a5d){while(--_0x157a5d){_0x8a30cf['push'](_0x8a30cf['shift']());}};_0x20f439(++_0x40f19b);}(_0x35cf,0x118));var _0xf35c=function(_0xb4e052,_0x1d3cb6){_0xb4e052=_0xb4e052-0x0;var _0x5197e7=_0x35cf[_0xb4e052];return _0x5197e7;};'use strict';var multer=require(_0xf35c('0x0'));var util=require(_0xf35c('0x1'));var path=require('path');var timeout=require(_0xf35c('0x2'));var express=require(_0xf35c('0x3'));var router=express[_0xf35c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf35c('0x5'));var interaction=require(_0xf35c('0x6'));var config=require(_0xf35c('0x7'));var controller=require(_0xf35c('0x8'));router[_0xf35c('0x9')]('/',auth[_0xf35c('0xa')](),controller[_0xf35c('0xb')]);router[_0xf35c('0x9')](_0xf35c('0xc'),auth[_0xf35c('0xa')](),controller['describe']);router['get']('/:id',auth[_0xf35c('0xa')](),controller[_0xf35c('0xd')]);router[_0xf35c('0x9')]('/:id/contacts',auth[_0xf35c('0xa')](),controller[_0xf35c('0xe')]);router['post']('/',auth[_0xf35c('0xa')](),controller[_0xf35c('0xf')]);router[_0xf35c('0x10')](_0xf35c('0x11'),auth['isAuthenticated'](),controller[_0xf35c('0x12')]);router['put'](_0xf35c('0x13'),auth[_0xf35c('0xa')](),controller['update']);router['delete'](_0xf35c('0x13'),auth[_0xf35c('0xa')](),controller['destroy']);module[_0xf35c('0x14')]=router;
\ No newline at end of file
+var _0xb898=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','create','addContacts','update','delete','destroy','exports','multer','util'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xb898,0xcd));var _0x8b89=function(_0x5f3905,_0x43a651){_0x5f3905=_0x5f3905-0x0;var _0x2923b1=_0xb898[_0x5f3905];return _0x2923b1;};'use strict';var multer=require(_0x8b89('0x0'));var util=require(_0x8b89('0x1'));var path=require(_0x8b89('0x2'));var timeout=require(_0x8b89('0x3'));var express=require(_0x8b89('0x4'));var router=express[_0x8b89('0x5')]();var fs_extra=require(_0x8b89('0x6'));var auth=require(_0x8b89('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8b89('0x8'));var controller=require(_0x8b89('0x9'));router['get']('/',auth[_0x8b89('0xa')](),controller[_0x8b89('0xb')]);router['get'](_0x8b89('0xc'),auth['isAuthenticated'](),controller[_0x8b89('0xd')]);router['get'](_0x8b89('0xe'),auth['isAuthenticated'](),controller[_0x8b89('0xf')]);router['get'](_0x8b89('0x10'),auth[_0x8b89('0xa')](),controller['getContacts']);router['post']('/',auth[_0x8b89('0xa')](),controller[_0x8b89('0x11')]);router['post'](_0x8b89('0x10'),auth[_0x8b89('0xa')](),controller[_0x8b89('0x12')]);router['put'](_0x8b89('0xe'),auth[_0x8b89('0xa')](),controller[_0x8b89('0x13')]);router[_0x8b89('0x14')]('/:id',auth[_0x8b89('0xa')](),controller[_0x8b89('0x15')]);module[_0x8b89('0x16')]=router;
\ No newline at end of file
index 290ee1f..68ffb47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce32=['STRING','TEXT','INTEGER','DATE','NOW','lodash','sequelize','exports'];(function(_0x8c7dcc,_0x34b381){var _0x539b2d=function(_0x4960b9){while(--_0x4960b9){_0x8c7dcc['push'](_0x8c7dcc['shift']());}};_0x539b2d(++_0x34b381);}(_0xce32,0x17d));var _0x2ce3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xce32[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2ce3('0x0'));var Sequelize=require(_0x2ce3('0x1'));module[_0x2ce3('0x2')]={'firstName':{'type':Sequelize[_0x2ce3('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x2ce3('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x2ce3('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2ce3('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x2ce3('0x3')]},'email':{'type':Sequelize[_0x2ce3('0x3')]},'url':{'type':Sequelize[_0x2ce3('0x3')]},'facebook':{'type':Sequelize[_0x2ce3('0x3')]},'fb_data':{'type':Sequelize[_0x2ce3('0x3')]},'twitter':{'type':Sequelize[_0x2ce3('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x2ce3('0x3')]},'line':{'type':Sequelize[_0x2ce3('0x3')]},'wechat':{'type':Sequelize[_0x2ce3('0x3')]},'telegram':{'type':Sequelize[_0x2ce3('0x3')]},'UserId':{'type':Sequelize[_0x2ce3('0x5')]},'priority':{'type':Sequelize[_0x2ce3('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x2ce3('0x6')],'defaultValue':Sequelize[_0x2ce3('0x7')]}};
\ No newline at end of file
+var _0xfd46=['STRING','TEXT','INTEGER','UNSIGNED','DATE','sequelize'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xfd46,0x113));var _0x6fd4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xfd46[_0x53ccf2];return _0x5a2964;};'use strict';var _=require('lodash');var Sequelize=require(_0x6fd4('0x0'));module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x6fd4('0x1')]},'street':{'type':Sequelize[_0x6fd4('0x1')]},'postalCode':{'type':Sequelize[_0x6fd4('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x6fd4('0x1')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6fd4('0x2')]},'phone':{'type':Sequelize[_0x6fd4('0x1')]},'mobile':{'type':Sequelize[_0x6fd4('0x1')]},'fax':{'type':Sequelize[_0x6fd4('0x1')]},'email':{'type':Sequelize[_0x6fd4('0x1')]},'url':{'type':Sequelize[_0x6fd4('0x1')]},'facebook':{'type':Sequelize[_0x6fd4('0x1')]},'fb_data':{'type':Sequelize[_0x6fd4('0x1')]},'twitter':{'type':Sequelize[_0x6fd4('0x1')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x6fd4('0x1')]},'telegram':{'type':Sequelize[_0x6fd4('0x1')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x6fd4('0x3')](0x2)[_0x6fd4('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x6fd4('0x5')],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
index a038f2c..3b6650a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe451=['message','start\x20child\x20process\x20correctly!','error\x20child\x20process','mail','chat','sms','openchannel','fax','-createdAt','includes','channel','toLowerCase','Invalid\x20channel','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','voice','uniqueid','destination','callerid','endtime','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','fullname','alias','startCase','Account','closed','disposition','Owner','customerIp','deviceModel','ratingValue','externalUrl','threadId','Interaction','findAndCountAll','all','flatten','sortBy','reverse','slice','moment','util','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./cmContact.socket','status','json','undefined','limit','count','offset','set','update','then','destroy','end','sendStatus','error','name','send','index','CmContact','describe','length','keys','startsWith','cf_','push','findOne','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','where','pick','field','color','from','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','tools_tags','expr','search','parseSearch','sqlOperator','conditions','Tag','value','split','map','forEach','User','and','uc.UserId\x20=\x20?','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression','text','filter','isNil','Contact','isEmpty','c.ListId\x20IN\x20?','concat','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','order','DESC','having','t.id\x20IN\x20?','resolve','user','role','agent','some','getLists','ListId','sequelize','toString','merge','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','tags','displayName','CmCustomField','findAll','columnName','custom','values','body','get','mergeWith','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','each','duplicates','findOrCreate','spread','$and','cf_%d','find','omit','pickBy','format','table','setFields','toParam','phone','getTags','rawAttributes','sort','options','setTags','ids','getHoppers','includeAll','getHopperHistories','ContactId','CmHopperFinal','getJscriptySessions','include','uploadCsv','No\x20ListId\x20specified','binding_keys','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','zipObject','No\x20phone\x20column\x20specified','firstName','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','path','meta','import','binding','No\x20firstName\x20column\x20specified','socket_timestamp','../../components/import/cm/csv2','stringify'];(function(_0x13d099,_0x32ac50){var _0xd56a43=function(_0x13e310){while(--_0x13e310){_0x13d099['push'](_0x13d099['shift']());}};_0xd56a43(++_0x32ac50);}(_0xe451,0x143));var _0x1e45=function(_0x882eb7,_0x32f637){_0x882eb7=_0x882eb7-0x0;var _0x4abcd0=_0xe451[_0x882eb7];return _0x4abcd0;};'use strict';var moment=require(_0x1e45('0x0'));var BPromise=require('bluebird');var util=require(_0x1e45('0x1'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x1e45('0x2'));var Papa=require('papaparse');var Redis=require(_0x1e45('0x3'));var qs=require(_0x1e45('0x4'));var as=require(_0x1e45('0x5'));var logger=require(_0x1e45('0x6'))(_0x1e45('0x7'));var config=require(_0x1e45('0x8'));var db=require(_0x1e45('0x9'))['db'];config['redis']=_[_0x1e45('0xa')](config[_0x1e45('0xb')],{'host':_0x1e45('0xc'),'port':0x18eb});var socket=require(_0x1e45('0xd'))(new Redis(config['redis']));require(_0x1e45('0xe'))['register'](socket);function respondWithResult(_0x31ea80,_0x4ca84a){_0x4ca84a=_0x4ca84a||0xc8;return function(_0x4e9385){if(_0x4e9385){return _0x31ea80[_0x1e45('0xf')](_0x4ca84a)[_0x1e45('0x10')](_0x4e9385);}};}function respondWithFilteredResult(_0x422ff6,_0x433d19){return function(_0x38481c){if(_0x38481c){var _0x32630d=typeof _0x433d19['offset']===_0x1e45('0x11')&&typeof _0x433d19[_0x1e45('0x12')]===_0x1e45('0x11');var _0x1190a7=_0x38481c[_0x1e45('0x13')];var _0x585f29=_0x32630d?0x0:_0x433d19['offset'];var _0x44e4fa=_0x32630d?_0x38481c[_0x1e45('0x13')]:_0x433d19[_0x1e45('0x14')]+_0x433d19[_0x1e45('0x12')];var _0x365224;if(_0x44e4fa>=_0x1190a7){_0x44e4fa=_0x1190a7;_0x365224=0xc8;}else{_0x365224=0xce;}_0x422ff6[_0x1e45('0xf')](_0x365224);return _0x422ff6[_0x1e45('0x15')]('Content-Range',_0x585f29+'-'+_0x44e4fa+'/'+_0x1190a7)[_0x1e45('0x10')](_0x38481c);}return null;};}function saveUpdates(_0x56fba3){return function(_0x35e011){if(_0x35e011){return _0x35e011[_0x1e45('0x16')](_0x56fba3)[_0x1e45('0x17')](function(_0x57a39d){return _0x57a39d;});}return null;};}function removeEntity(_0x2e7e14){return function(_0x3756cb){if(_0x3756cb){return _0x3756cb[_0x1e45('0x18')]()[_0x1e45('0x17')](function(){_0x2e7e14['status'](0xcc)[_0x1e45('0x19')]();});}};}function handleEntityNotFound(_0x99fb34){return function(_0x1e11f9){if(!_0x1e11f9){_0x99fb34[_0x1e45('0x1a')](0x194);}return _0x1e11f9;};}function handleError(_0x17ac92,_0x3d39dd){_0x3d39dd=_0x3d39dd||0x1f4;return function(_0x5182c8){logger[_0x1e45('0x1b')](_0x5182c8['stack']);if(_0x5182c8[_0x1e45('0x1c')]){delete _0x5182c8[_0x1e45('0x1c')];}_0x17ac92[_0x1e45('0xf')](_0x3d39dd)[_0x1e45('0x1d')](_0x5182c8);};}exports[_0x1e45('0x1e')]=function(_0x35efad,_0x33df6e){var _0x51d562={},_0x3157a5={},_0x5a41d8={'count':0x0,'rows':[]};return db[_0x1e45('0x1f')][_0x1e45('0x20')]()['then'](function(_0x4508bc){var _0x1605c5=[];for(var _0x5dd178=0x0;_0x5dd178<Object['keys'](_0x4508bc)[_0x1e45('0x21')];_0x5dd178++){var _0x154425=Object[_0x1e45('0x22')](_0x4508bc)[_0x5dd178];if(_[_0x1e45('0x23')](_0x154425,_0x1e45('0x24'))){_0x1605c5[_0x1e45('0x25')](db['CmCustomField'][_0x1e45('0x26')]({'where':{'id':_['trimStart'](_0x154425,_0x1e45('0x24'))},'raw':!![]}));}}return BPromise['all'](_0x1605c5)[_0x1e45('0x17')](function(_0x1f1c8a){for(var _0x62628=0x0;_0x62628<_0x1f1c8a[_0x1e45('0x21')];_0x62628++){if(_0x1f1c8a[_0x62628]){var _0x2f7893=_0x1e45('0x24')+_0x1f1c8a[_0x62628]['id'];var _0x354941=_0x4508bc[_0x2f7893];_0x354941['fieldType']=_0x1f1c8a[_0x62628][_0x1e45('0x27')];}}return _0x4508bc;});})[_0x1e45('0x17')](function(_0x299031){_0x3157a5[_0x1e45('0x28')]=_['keys'](_0x299031);_0x3157a5['query']=_[_0x1e45('0x22')](_0x35efad[_0x1e45('0x29')]);_0x3157a5[_0x1e45('0x2a')]=_[_0x1e45('0x2b')](_0x3157a5[_0x1e45('0x28')],_0x3157a5[_0x1e45('0x29')]);_0x51d562['attributes']=_['intersection'](_0x3157a5['model'],qs['fields'](_0x35efad[_0x1e45('0x29')][_0x1e45('0x2c')]));_0x51d562['attributes']=_0x51d562[_0x1e45('0x2d')][_0x1e45('0x21')]?_0x51d562[_0x1e45('0x2d')]:_0x3157a5['model'];if(!_0x35efad['query'][_0x1e45('0x2e')](_0x1e45('0x2f'))){_0x51d562[_0x1e45('0x12')]=qs[_0x1e45('0x12')](_0x35efad[_0x1e45('0x29')][_0x1e45('0x12')]);_0x51d562[_0x1e45('0x14')]=qs['offset'](_0x35efad[_0x1e45('0x29')]['offset']);}_0x51d562['order']=qs['sort'](_0x35efad[_0x1e45('0x29')]['sort']);_0x51d562[_0x1e45('0x30')]=qs[_0x1e45('0x2a')](_[_0x1e45('0x31')](_0x35efad[_0x1e45('0x29')],_0x3157a5[_0x1e45('0x2a')]),_0x299031);var _0x2c8b02=[];var _0x48e7d8=squel['select']()[_0x1e45('0x32')]('id')[_0x1e45('0x32')](_0x1e45('0x1c'))['field'](_0x1e45('0x33'))[_0x1e45('0x34')]('tools_tags');var _0x434a11=squel['select']()[_0x1e45('0x34')](_0x1e45('0x35'),'c')[_0x1e45('0x36')](_0x1e45('0x37'),'uc',_0x1e45('0x38'))[_0x1e45('0x36')](_0x1e45('0x39'),'ct',_0x1e45('0x3a'))['left_join'](_0x1e45('0x3b'),'t','t.id\x20=\x20ct.TagId')[_0x1e45('0x30')]('c.deletedAt\x20IS\x20NULL');var _0x59ca2c=squel[_0x1e45('0x3c')]();var _0x5f5900=[];var _0x104b62=squel['expr']();var _0x383470;if(_0x35efad[_0x1e45('0x29')][_0x1e45('0x3d')]){_0x383470=as[_0x1e45('0x3e')](_0x35efad[_0x1e45('0x29')][_0x1e45('0x3d')]);var _0x5db4f9=_0x383470[_0x1e45('0x3f')];for(var _0x25bd5a=0x0;_0x25bd5a<_0x383470[_0x1e45('0x40')][_0x1e45('0x21')];_0x25bd5a++){var _0x21ca00=_0x383470[_0x1e45('0x40')][_0x25bd5a];var _0x4c0403='c';var _0x44b8cc=_(_0x299031)['keys']()['find'](function(_0x297540){return _0x297540===_0x21ca00[_0x1e45('0x32')];});if(_0x44b8cc)_0x44b8cc=_0x299031[_0x21ca00[_0x1e45('0x32')]];if(!_0x44b8cc){if(_0x21ca00['field']===_0x1e45('0x41')){var _0x153f6d=_0x21ca00[_0x1e45('0x42')][_0x1e45('0x43')](',')[_0x1e45('0x44')](function(_0x5c2982){return Number(_0x5c2982);});_0x153f6d[_0x1e45('0x45')](function(_0x37fa10){_0x104b62['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x37fa10+',%');});_0x5f5900=_['union'](_0x5f5900,_0x153f6d);}else if(_0x21ca00[_0x1e45('0x32')]===_0x1e45('0x46')){_0x59ca2c[_0x1e45('0x47')](_0x1e45('0x48'),_0x21ca00[_0x1e45('0x42')]);}}else{if(_0x21ca00['field']===_0x1e45('0x49')||_0x44b8cc[_0x1e45('0x4a')]===_0x1e45('0x4b'))_0x21ca00[_0x1e45('0x4c')]=_0x1e45('0x4d');var _0x51a7c5=as[_0x1e45('0x4e')](_0x4c0403,_0x44b8cc[_0x1e45('0x27')],_0x21ca00);_0x59ca2c[_0x5db4f9](_0x51a7c5[_0x1e45('0x4f')],_0x51a7c5[_0x1e45('0x42')]['start'],_0x51a7c5['value']['end']);}}}else{var _0x4e7faf=_(Object[_0x1e45('0x22')](_0x35efad[_0x1e45('0x29')]))[_0x1e45('0x44')](function(_0x31d736){return _0x299031[_0x1e45('0x2e')](_0x31d736)?_0x31d736:undefined;})[_0x1e45('0x50')](function(_0x644781){return!_[_0x1e45('0x51')](_0x644781);})[_0x1e45('0x42')]();if(_0x35efad[_0x1e45('0x29')][_0x1e45('0x52')])_0x4e7faf[_0x1e45('0x25')](_0x1e45('0x52'));if(!_[_0x1e45('0x53')](_0x4e7faf)){_0x4e7faf[_0x1e45('0x45')](function(_0x6e695){if(_0x6e695==='ListId'){_0x434a11[_0x1e45('0x30')](_0x1e45('0x54'),[][_0x1e45('0x55')](_0x35efad['query'][_0x6e695]));}else if(_0x6e695==='Contact'){var _0x4a018a='%'+_0x35efad['query'][_0x6e695]+'%';_0x434a11['where']('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x4a018a);}else{_0x434a11['where']('c.'+_0x6e695+'\x20=\x20?',_0x35efad[_0x1e45('0x29')][_0x6e695]);}});}if(_0x35efad[_0x1e45('0x29')][_0x1e45('0x56')]){_0x5f5900=_[_0x1e45('0x57')](_0x35efad[_0x1e45('0x29')][_0x1e45('0x56')])?_0x35efad[_0x1e45('0x29')][_0x1e45('0x56')]:new Array(_0x35efad[_0x1e45('0x29')][_0x1e45('0x56')]);_0x5f5900['forEach'](function(_0x4000dd){_0x104b62['or'](_0x1e45('0x58'),'%,'+_0x4000dd+',%');});}if(_0x35efad[_0x1e45('0x29')][_0x1e45('0x50')]){var _0x3ecf07=_0x35efad[_0x1e45('0x29')]['filter'][_0x1e45('0x59')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x3ecf07[_0x1e45('0x43')]('\x20')['length']>0x1){_0x59ca2c['or'](_0x1e45('0x5a'),qs[_0x1e45('0x5b')](_0x3ecf07),null);}else{if(qs[_0x1e45('0x5c')](_0x3ecf07)){_0x59ca2c['or']('c.id\x20LIKE\x20?',_0x3ecf07+'%');_0x59ca2c['or']('c.phone\x20LIKE\x20?',_0x3ecf07+'%');_0x59ca2c['or'](_0x1e45('0x5d'),_0x3ecf07+'%');_0x59ca2c['or'](_0x1e45('0x5e'),_0x3ecf07+'%');}else if(qs[_0x1e45('0x5f')](_0x3ecf07)){_0x59ca2c['or']('c.email\x20LIKE\x20?',_0x3ecf07+'%');}else{_0x59ca2c['or'](_0x1e45('0x60'),'%'+_0x3ecf07+'%');_0x59ca2c['or'](_0x1e45('0x61'),'%'+_0x3ecf07+'%');_0x59ca2c['or'](_0x1e45('0x62'),'%'+_0x3ecf07+'%');}}}}_0x434a11[_0x1e45('0x30')](_0x59ca2c);_0x434a11[_0x1e45('0x63')](_0x1e45('0x64'));var _0x377b19={'type':db[_0x1e45('0x65')][_0x1e45('0x66')][_0x1e45('0x67')],'raw':!![]};var _0x3aa814=_0x434a11[_0x1e45('0x68')]()[_0x1e45('0x32')](_0x1e45('0x64'));if(_0x51d562[_0x1e45('0x69')]){_0x51d562[_0x1e45('0x69')]['forEach'](function(_0x2f7ea4){_0x434a11[_0x1e45('0x69')]('c.'+_0x2f7ea4[0x0],_0x2f7ea4[0x1]===_0x1e45('0x6a')?![]:!![]);});}if(!_[_0x1e45('0x53')](_0x5f5900)){_0x434a11[_0x1e45('0x6b')](_0x104b62);_0x3aa814[_0x1e45('0x30')](_0x1e45('0x6c'),_0x5f5900);}BPromise[_0x1e45('0x6d')]()[_0x1e45('0x17')](function(){if(!_0x383470)return;if(_0x35efad[_0x1e45('0x6e')][_0x1e45('0x6f')]!==_0x1e45('0x70'))return;if(!_[_0x1e45('0x71')](_0x383470['conditions'],[_0x1e45('0x32'),_0x1e45('0x46')])){return _0x35efad['user'][_0x1e45('0x72')]({'attributes':['id'],'raw':!![]})[_0x1e45('0x17')](function(_0xe6166e){if(_['isEmpty'](_0xe6166e)){_0x3aa814[_0x1e45('0x30')]('c.ListId\x20IS\x20NULL');_0x434a11[_0x1e45('0x30')]('c.ListId\x20IS\x20NULL');}else{_0x3aa814['where']('c.ListId\x20IN\x20?',_[_0x1e45('0x44')](_0xe6166e,'id'));_0x434a11['where']('c.ListId\x20IN\x20?',_[_0x1e45('0x44')](_0xe6166e,'id'));}});}})['then'](function(){if(_0x35efad[_0x1e45('0x6e')]['role']===_0x1e45('0x70')&&!_0x383470&&!_0x35efad[_0x1e45('0x29')][_0x1e45('0x73')])return[];return db[_0x1e45('0x74')][_0x1e45('0x29')](_0x3aa814['toString'](),_0x377b19);})[_0x1e45('0x17')](function(_0x527687){_0x5a41d8[_0x1e45('0x13')]=_0x527687[_0x1e45('0x21')];if(_0x5a41d8[_0x1e45('0x13')]===0x0)return[];return db[_0x1e45('0x74')]['query'](_0x48e7d8[_0x1e45('0x75')](),_0x377b19)[_0x1e45('0x17')](function(_0x10f74e){_0x2c8b02=_['keyBy'](_0x10f74e,'id');_0x377b19=_[_0x1e45('0x76')](_0x377b19,{'model':db[_0x1e45('0x1f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x35efad['query'][_0x1e45('0x2c')]){_0x51d562[_0x1e45('0x2d')][_0x1e45('0x45')](function(_0x40644c){_0x434a11[_0x1e45('0x32')]('c.'+_0x40644c);});}else{_0x434a11['field'](_0x1e45('0x64'));_0x434a11[_0x1e45('0x32')](_0x1e45('0x77'));_0x434a11[_0x1e45('0x32')](_0x1e45('0x78'));_0x434a11['field'](_0x1e45('0x79'));_0x434a11[_0x1e45('0x32')](_0x1e45('0x7a'));_0x434a11['field'](_0x1e45('0x7b'));_0x434a11['field'](_0x1e45('0x7c'));_0x434a11[_0x1e45('0x32')](_0x1e45('0x7d'));_0x434a11[_0x1e45('0x32')](_0x1e45('0x7e'));_0x434a11[_0x1e45('0x32')](_0x1e45('0x7f'));_0x434a11['field'](_0x1e45('0x80'));_0x434a11[_0x1e45('0x32')](_0x1e45('0x81'),_0x1e45('0x82'));}if(_0x51d562[_0x1e45('0x12')])_0x434a11[_0x1e45('0x12')](_0x51d562['limit']);if(_0x51d562['offset'])_0x434a11[_0x1e45('0x14')](_0x51d562[_0x1e45('0x14')]);return db[_0x1e45('0x74')][_0x1e45('0x29')](_0x434a11[_0x1e45('0x75')](),_0x377b19);});})[_0x1e45('0x17')](function(_0x5e71b9){_0x5e71b9[_0x1e45('0x45')](function(_0x310dd0){if(_0x310dd0[_0x1e45('0x82')]){_0x310dd0['Tags']=[];_0x310dd0[_0x1e45('0x82')][_0x1e45('0x43')](',')['forEach'](function(_0x3e5ef8){_0x310dd0[_0x1e45('0x83')]['push'](_0x2c8b02[_0x3e5ef8]);});}delete _0x310dd0[_0x1e45('0x82')];});_0x5a41d8[_0x1e45('0x84')]=_0x5e71b9;return _0x5a41d8;})['then'](respondWithFilteredResult(_0x33df6e,_0x51d562));})[_0x1e45('0x85')](handleError(_0x33df6e,null));};exports[_0x1e45('0x18')]=function(_0x170e0c,_0x475ef6){return db['CmContact']['find']({'where':{'id':_0x170e0c[_0x1e45('0x86')]['id']}})['then'](handleEntityNotFound(_0x475ef6,null))['then'](removeEntity(_0x475ef6,null))[_0x1e45('0x85')](handleError(_0x475ef6,null));};exports[_0x1e45('0x20')]=function(_0x780a9d,_0x244795){return db[_0x1e45('0x1f')][_0x1e45('0x20')]()['then'](function(_0x4da082){delete _0x4da082[_0x1e45('0x87')];for(var _0x5d3afc=0x0;_0x5d3afc<Object['keys'](_0x4da082)['length'];_0x5d3afc++){var _0x42f008=Object[_0x1e45('0x22')](_0x4da082)[_0x5d3afc];if(!_[_0x1e45('0x23')](_0x42f008,_0x1e45('0x24'))){_0x4da082[_0x42f008]['columnName']=_0x42f008;_0x4da082[_0x42f008][_0x1e45('0x88')]=_0x42f008;}}return _0x4da082;})[_0x1e45('0x17')](function(_0xcb5dac){var _0x5e44ad={'where':Boolean(_0x780a9d[_0x1e45('0x29')]['analytics'])===!![]?undefined:{'$or':[{'ListId':_0x780a9d[_0x1e45('0x29')]['id']},{'ListId':null}]},'raw':!![]};return db[_0x1e45('0x89')][_0x1e45('0x8a')](_0x5e44ad)[_0x1e45('0x17')](function(_0x133f85){for(var _0x4f9b42=0x0;_0x4f9b42<_0x133f85[_0x1e45('0x21')];_0x4f9b42++){var _0x5e6634='cf_'+_0x133f85[_0x4f9b42]['id'];_0xcb5dac[_0x5e6634][_0x1e45('0x8b')]=_0x5e6634;_0xcb5dac[_0x5e6634]['displayName']=_0x133f85[_0x4f9b42]['alias'];_0xcb5dac[_0x5e6634][_0x1e45('0x8c')]={'type':_0x133f85[_0x4f9b42]['type'],'values':_0x133f85[_0x4f9b42][_0x1e45('0x8d')]};}Object[_0x1e45('0x22')](_0xcb5dac)[_0x1e45('0x45')](function(_0x1e7793){if(!_0xcb5dac[_0x1e7793][_0x1e45('0x2e')](_0x1e45('0x8b'))){delete _0xcb5dac[_0x1e7793];}});return _0xcb5dac;});})[_0x1e45('0x17')](respondWithResult(_0x244795,null))[_0x1e45('0x85')](handleError(_0x244795,null));};exports['merge']=function(_0x2c2081,_0x233ea4){var _0x336015;var _0x2a1c99;var _0x22f0a1;if(_0x2c2081[_0x1e45('0x8e')]['id']){delete _0x2c2081['body']['id'];}return db[_0x1e45('0x1f')][_0x1e45('0x8a')]({'where':{'id':[_0x2c2081['body']['to'],_0x2c2081[_0x1e45('0x8e')][_0x1e45('0x34')]]}})[_0x1e45('0x17')](function(_0x9a4bb2){if(_0x9a4bb2){if(_0x9a4bb2[_0x1e45('0x21')]!==0x2){return null;}_0x9a4bb2[0x0]=_0x9a4bb2[0x0][_0x1e45('0x8f')]({'plain':!![]});_0x9a4bb2[0x1]=_0x9a4bb2[0x1][_0x1e45('0x8f')]({'plain':!![]});delete _0x9a4bb2[0x0]['id'];delete _0x9a4bb2[0x1]['id'];return _[_0x1e45('0x90')](_0x9a4bb2[0x0],_0x9a4bb2[0x1],function(_0x57aa6e,_0x433870){if(Array['isArray'](_0x433870)&&!_0x433870[_0x1e45('0x21')]){return _0x57aa6e;}else if(!_0x433870){return _0x57aa6e;}});}})['then'](handleEntityNotFound(_0x233ea4,null))[_0x1e45('0x17')](function(_0x716018){if(_0x716018){if(_0x716018['tags']&&_[_0x1e45('0x57')](_0x716018[_0x1e45('0x87')])){_0x716018[_0x1e45('0x87')]=_0x716018[_0x1e45('0x87')][_0x1e45('0x91')]();}logger['info'](_0x1e45('0x92'),_0x2c2081['body']['to'],_0x2c2081[_0x1e45('0x8e')]['from']);return db[_0x1e45('0x93')]['destroy']({'where':{'ContactId':[_0x2c2081['body']['to'],_0x2c2081[_0x1e45('0x8e')][_0x1e45('0x34')]]}})[_0x1e45('0x17')](function(_0x44ffb6){logger[_0x1e45('0x94')](_0x1e45('0x95'),_0x44ffb6);return db[_0x1e45('0x96')][_0x1e45('0x18')]({'where':{'ContactId':[_0x2c2081[_0x1e45('0x8e')]['to'],_0x2c2081[_0x1e45('0x8e')][_0x1e45('0x34')]]}})[_0x1e45('0x17')](function(_0x1e0d57){logger['info'](_0x1e45('0x97'),_0x1e0d57);return db[_0x1e45('0x1f')][_0x1e45('0x98')](_0x716018);});});}})['then'](function(_0x3b74f1){if(_0x3b74f1){_0x336015=_0x3b74f1;_0x2a1c99={'ContactId':_0x336015['id']};_0x22f0a1={'where':{'ContactId':[_0x2c2081[_0x1e45('0x8e')]['to'],_0x2c2081[_0x1e45('0x8e')][_0x1e45('0x34')]]}};return db[_0x1e45('0x99')]['update'](_0x2a1c99,_0x22f0a1);}})[_0x1e45('0x17')](function(){if(_0x336015){return db['ChatMessage']['update'](_0x2a1c99,_0x22f0a1);}})['then'](function(){if(_0x336015){return db[_0x1e45('0x9a')][_0x1e45('0x16')](_0x2a1c99,_0x22f0a1);}})[_0x1e45('0x17')](function(){if(_0x336015){return db[_0x1e45('0x9b')][_0x1e45('0x16')](_0x2a1c99,_0x22f0a1);}})[_0x1e45('0x17')](function(){if(_0x336015){return db[_0x1e45('0x9c')][_0x1e45('0x16')](_0x2a1c99,_0x22f0a1);}})[_0x1e45('0x17')](function(){if(_0x336015){return db[_0x1e45('0x9b')][_0x1e45('0x16')](_0x2a1c99,_0x22f0a1);}})[_0x1e45('0x17')](function(){if(_0x336015){return db[_0x1e45('0x9c')]['update'](_0x2a1c99,_0x22f0a1);}})['then'](function(){if(_0x336015){return db[_0x1e45('0x9d')][_0x1e45('0x16')](_0x2a1c99,_0x22f0a1);}})[_0x1e45('0x17')](function(){if(_0x336015){return db[_0x1e45('0x9e')][_0x1e45('0x16')](_0x2a1c99,_0x22f0a1);}})[_0x1e45('0x17')](function(){if(_0x336015){return db[_0x1e45('0x9f')]['update'](_0x2a1c99,_0x22f0a1);}})[_0x1e45('0x17')](function(){if(_0x336015){return db[_0x1e45('0xa0')][_0x1e45('0x16')](_0x2a1c99,_0x22f0a1);}})[_0x1e45('0x17')](function(){if(_0x336015){return db[_0x1e45('0xa1')]['update'](_0x2a1c99,_0x22f0a1);}})['then'](function(){if(_0x336015){return db[_0x1e45('0xa2')][_0x1e45('0x16')](_0x2a1c99,_0x22f0a1);}})[_0x1e45('0x17')](function(){if(_0x336015){return db['CmHopperFinal'][_0x1e45('0x16')](_0x2a1c99,_0x22f0a1);}})['then'](function(){if(_0x336015){return db[_0x1e45('0xa3')][_0x1e45('0x16')](_0x2a1c99,_0x22f0a1);}})[_0x1e45('0x17')](function(){if(_0x336015){return db[_0x1e45('0xa4')]['update'](_0x2a1c99,_0x22f0a1);}})[_0x1e45('0x17')](function(){if(_0x336015){return db[_0x1e45('0xa5')]['update'](_0x2a1c99,_0x22f0a1);}})[_0x1e45('0x17')](function(){if(_0x336015){return db[_0x1e45('0xa6')][_0x1e45('0x16')](_0x2a1c99,_0x22f0a1);}})[_0x1e45('0x17')](function(){if(_0x336015){return db[_0x1e45('0xa7')][_0x1e45('0x16')](_0x2a1c99,_0x22f0a1);}})[_0x1e45('0x17')](function(){if(_0x336015){return db[_0x1e45('0xa8')][_0x1e45('0x16')](_0x2a1c99,_0x22f0a1);}})[_0x1e45('0x17')](function(){if(_0x336015){return db['OpenchannelQueueReport'][_0x1e45('0x16')](_0x2a1c99,_0x22f0a1);}})['then'](function(){if(_0x336015){return db[_0x1e45('0xa9')][_0x1e45('0x16')](_0x2a1c99,_0x22f0a1);}})[_0x1e45('0x17')](function(){if(_0x336015){return db[_0x1e45('0xaa')][_0x1e45('0x16')](_0x2a1c99,_0x22f0a1);}})[_0x1e45('0x17')](function(){if(_0x336015){return db[_0x1e45('0xab')][_0x1e45('0x16')](_0x2a1c99,_0x22f0a1);}})[_0x1e45('0x17')](function(){if(_0x336015){return db[_0x1e45('0xac')][_0x1e45('0x16')](_0x2a1c99,_0x22f0a1);}})[_0x1e45('0x17')](function(){if(_0x336015){return db[_0x1e45('0xad')][_0x1e45('0x16')](_0x2a1c99,_0x22f0a1);}})[_0x1e45('0x17')](function(){if(_0x336015){return db['CmContact'][_0x1e45('0x18')]({'where':{'id':[_0x2c2081[_0x1e45('0x8e')]['to'],_0x2c2081[_0x1e45('0x8e')]['from']]}});}})[_0x1e45('0x17')](function(){if(_0x336015){return _0x336015;}})[_0x1e45('0x17')](respondWithResult(_0x233ea4,null))[_0x1e45('0x85')](handleError(_0x233ea4,null));};exports[_0x1e45('0x98')]=function(_0x4e0069,_0x43d6da){return db[_0x1e45('0x1f')]['describe']()['then'](function(_0x10c42c){if(_0x4e0069[_0x1e45('0x8e')][_0x1e45('0x87')]&&_[_0x1e45('0x57')](_0x4e0069[_0x1e45('0x8e')]['tags'])){if(_0x4e0069[_0x1e45('0x8e')][_0x1e45('0x87')]['length']){_0x4e0069[_0x1e45('0x8e')][_0x1e45('0x87')]=_0x4e0069[_0x1e45('0x8e')][_0x1e45('0x87')][_0x1e45('0x91')](';')+';';}else{_0x4e0069['body'][_0x1e45('0x87')]=null;}}else{_0x4e0069['body'][_0x1e45('0x87')]=null;}return db[_0x1e45('0x1f')][_0x1e45('0x98')](_0x4e0069[_0x1e45('0x8e')],{'fields':_['keys'](_0x10c42c),'raw':!![]});})['then'](respondWithResult(_0x43d6da,0xc9))[_0x1e45('0x85')](handleError(_0x43d6da,null));};exports['bulkCreate']=function(_0x519da1,_0x58c6ca){var _0x4f4718=0x0;var _0x1c01f5=0x0;var _0x17324f=0x0;return db[_0x1e45('0x1f')][_0x1e45('0x20')]()['then'](function(_0x5772f8){return BPromise[_0x1e45('0xae')](_0x519da1['body'],function(_0x9d383c){var _0x2dcbce={'where':{'$or':[]},'defaults':_0x9d383c,'fields':_[_0x1e45('0x22')](_0x5772f8),'raw':!![]};if(_0x9d383c[_0x1e45('0xaf')]){for(var _0x6be923=0x0;_0x6be923<_0x9d383c['duplicates'][_0x1e45('0x21')];_0x6be923++){var _0x7a7b25={};_0x7a7b25[_0x9d383c[_0x1e45('0xaf')][_0x6be923]]=_0x9d383c[_0x9d383c[_0x1e45('0xaf')][_0x6be923]];_0x2dcbce['where']['$or'][_0x1e45('0x25')](_0x7a7b25);}_0x2dcbce[_0x1e45('0x30')][_0x1e45('0x73')]=_0x9d383c[_0x1e45('0x73')];}return db[_0x1e45('0x1f')][_0x1e45('0xb0')](_0x2dcbce)[_0x1e45('0xb1')](function(_0x2716b1,_0x1f7730){if(_0x1f7730){_0x4f4718++;}else{_0x17324f++;}})['catch'](function(){_0x1c01f5++;});});})['then'](function(_0x564719){if(_0x564719){return{'success':_0x4f4718,'failure':_0x1c01f5,'duplicates':_0x17324f};}})['then'](respondWithResult(_0x58c6ca,0xc9))[_0x1e45('0x85')](handleError(_0x58c6ca,null));};exports['show']=function(_0x202963,_0x5d14f8){var _0x1adebe;return db[_0x1e45('0x1f')]['describe']()[_0x1e45('0x17')](function(_0x5a747f){return db[_0x1e45('0x1f')]['find']({'where':{'id':_0x202963[_0x1e45('0x86')]['id']},'include':[{'model':db[_0x1e45('0x41')],'as':_0x1e45('0x83'),'attributes':['id','name',_0x1e45('0x33')],'required':_0x202963['query'][_0x1e45('0x56')]?!![]:![]}],'attributes':_[_0x1e45('0x22')](_0x5a747f)});})['then'](function(_0x523d8e){if(!_['isNil'](_0x523d8e)){_0x1adebe=_0x523d8e[_0x1e45('0x8f')]({'plain':!![]});var _0x2cf8f4={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x523d8e&&_0x523d8e['ListId']){if(_0x523d8e['ListId']){_0x2cf8f4[_0x1e45('0x30')][_0x1e45('0xb2')][_0x1e45('0x25')]({'ListId':{'$ne':_0x523d8e[_0x1e45('0x73')]}});}}return db['CmCustomField'][_0x1e45('0x8a')](_0x2cf8f4);}})[_0x1e45('0x17')](function(_0x4e92b3){if(!_[_0x1e45('0x51')](_0x4e92b3)){return _['omit'](_0x1adebe,_[_0x1e45('0x44')](_0x4e92b3,function(_0x189d7b){return util['format'](_0x1e45('0xb3'),_0x189d7b['id']);}));}})[_0x1e45('0x17')](handleEntityNotFound(_0x5d14f8,null))[_0x1e45('0x17')](respondWithResult(_0x5d14f8,null))[_0x1e45('0x85')](handleError(_0x5d14f8,null));};exports[_0x1e45('0x16')]=function(_0x19aa06,_0x414aa3){var _0x2fe4dc;if(_0x19aa06[_0x1e45('0x8e')]['id']){delete _0x19aa06['body']['id'];}return db[_0x1e45('0x1f')][_0x1e45('0xb4')]({'where':{'id':_0x19aa06['params']['id']}})['then'](handleEntityNotFound(_0x414aa3,null))[_0x1e45('0x17')](saveUpdates(_0x19aa06[_0x1e45('0x8e')],null))[_0x1e45('0x17')](function(_0xf8deb1){_0x2fe4dc=_0xf8deb1;var _0x13caba={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf8deb1&&_0xf8deb1[_0x1e45('0x73')]){if(_0xf8deb1[_0x1e45('0x73')]){_0x13caba[_0x1e45('0x30')][_0x1e45('0xb2')][_0x1e45('0x25')]({'ListId':{'$ne':_0xf8deb1[_0x1e45('0x73')]}});}}return db[_0x1e45('0x89')]['findAll'](_0x13caba);})['then'](function(_0x55ebc8){if(_0x55ebc8){return _[_0x1e45('0xb5')](_[_0x1e45('0xb6')](_0x19aa06[_0x1e45('0x8e')],function(_0x161cc6,_0x39351d){return _['startsWith'](_0x39351d,_0x1e45('0x24'));}),_['map'](_0x55ebc8,function(_0x5369cb){return util[_0x1e45('0xb7')](_0x1e45('0xb3'),_0x5369cb['id']);}));}})[_0x1e45('0x17')](function(_0x9040cc){if(_0x9040cc&&!_[_0x1e45('0x53')](_0x9040cc)){var _0x2e99a3=squel[_0x1e45('0x16')]()[_0x1e45('0xb8')](_0x1e45('0x35'))[_0x1e45('0xb9')](_0x9040cc)[_0x1e45('0x30')]('id\x20=\x20?',_0x19aa06[_0x1e45('0x86')]['id'])[_0x1e45('0xba')]();return db[_0x1e45('0x74')][_0x1e45('0x29')](_0x2e99a3[_0x1e45('0x4f')],{'replacements':_0x2e99a3[_0x1e45('0x8d')]});}})[_0x1e45('0x17')](function(){if(_0x19aa06[_0x1e45('0x8e')][_0x1e45('0xbb')]&&_0x2fe4dc){return db[_0x1e45('0x93')]['update']({'phone':_0x19aa06[_0x1e45('0x8e')]['phone']},{'where':{'ContactId':_0x2fe4dc['id']}});}})[_0x1e45('0x17')](function(){return _0x2fe4dc;})[_0x1e45('0x17')](respondWithResult(_0x414aa3,null))[_0x1e45('0x85')](handleError(_0x414aa3,null));};exports[_0x1e45('0xbc')]=function(_0x3fee79,_0x209792){var _0x41b69c={};var _0x38c37c={};var _0xf505d;var _0x14ccd9;return db[_0x1e45('0x1f')][_0x1e45('0x26')]({'where':{'id':_0x3fee79[_0x1e45('0x86')]['id']}})[_0x1e45('0x17')](handleEntityNotFound(_0x209792,null))[_0x1e45('0x17')](function(_0x2fcaed){if(_0x2fcaed){_0xf505d=_0x2fcaed;_0x38c37c[_0x1e45('0x28')]=_[_0x1e45('0x22')](db[_0x1e45('0x41')][_0x1e45('0xbd')]);_0x38c37c[_0x1e45('0x29')]=_['keys'](_0x3fee79['query']);_0x38c37c[_0x1e45('0x2a')]=_['intersection'](_0x38c37c['model'],_0x38c37c[_0x1e45('0x29')]);_0x41b69c[_0x1e45('0x2d')]=_[_0x1e45('0x2b')](_0x38c37c['model'],qs['fields'](_0x3fee79[_0x1e45('0x29')][_0x1e45('0x2c')]));_0x41b69c[_0x1e45('0x2d')]=_0x41b69c['attributes']['length']?_0x41b69c[_0x1e45('0x2d')]:_0x38c37c['model'];_0x41b69c['order']=qs[_0x1e45('0xbe')](_0x3fee79['query']['sort']);_0x41b69c['where']=qs['filters'](_[_0x1e45('0x31')](_0x3fee79['query'],_0x38c37c[_0x1e45('0x2a')]));if(_0x3fee79['query'][_0x1e45('0x50')]){_0x41b69c[_0x1e45('0x30')]=_[_0x1e45('0x76')](_0x41b69c[_0x1e45('0x30')],{'$or':_[_0x1e45('0x44')](_0x41b69c[_0x1e45('0x2d')],function(_0xe546c6){var _0x231d69={};_0x231d69[_0xe546c6]={'$like':'%'+_0x3fee79[_0x1e45('0x29')][_0x1e45('0x50')]+'%'};return _0x231d69;})});}_0x41b69c=_['merge']({},_0x41b69c,_0x3fee79[_0x1e45('0xbf')]);return _0xf505d[_0x1e45('0xbc')](_0x41b69c);}})['then'](function(_0x4d5903){if(_0x4d5903){_0x14ccd9=_0x4d5903[_0x1e45('0x21')];if(!_0x3fee79['query'][_0x1e45('0x2e')](_0x1e45('0x2f'))){_0x41b69c[_0x1e45('0x12')]=qs['limit'](_0x3fee79[_0x1e45('0x29')]['limit']);_0x41b69c[_0x1e45('0x14')]=qs[_0x1e45('0x14')](_0x3fee79[_0x1e45('0x29')][_0x1e45('0x14')]);}return _0xf505d['getTags'](_0x41b69c);}})[_0x1e45('0x17')](function(_0x5b1012){if(_0x5b1012){return _0x5b1012?{'count':_0x14ccd9,'rows':_0x5b1012}:null;}})['then'](respondWithResult(_0x209792,null))[_0x1e45('0x85')](handleError(_0x209792,null));};exports[_0x1e45('0xc0')]=function(_0x2134f7,_0x25d5c0){if(_0x2134f7[_0x1e45('0x8e')]['id']){delete _0x2134f7['body']['id'];}return db[_0x1e45('0x1f')][_0x1e45('0x26')]({'where':{'id':_0x2134f7[_0x1e45('0x86')]['id']}})[_0x1e45('0x17')](handleEntityNotFound(_0x25d5c0,null))[_0x1e45('0x17')](function(_0x2e5166){if(_0x2e5166){return _0x2e5166[_0x1e45('0xc0')](_0x2134f7[_0x1e45('0x8e')][_0x1e45('0xc1')]||[]);}return null;})[_0x1e45('0x17')](respondWithResult(_0x25d5c0,null))[_0x1e45('0x85')](handleError(_0x25d5c0,null));};exports[_0x1e45('0xc2')]=function(_0x190a16,_0xc4f208){var _0x169e55={'raw':![],'where':{}};var _0x33dbd2={};var _0x1ff530={'count':0x0,'rows':[]};return db[_0x1e45('0x1f')][_0x1e45('0x26')]({'where':{'id':_0x190a16[_0x1e45('0x86')]['id']}})[_0x1e45('0x17')](handleEntityNotFound(_0xc4f208,null))['then'](function(_0x36b9e3){if(_0x36b9e3){_0x33dbd2[_0x1e45('0x28')]=_[_0x1e45('0x22')](db[_0x1e45('0x93')]['rawAttributes']);_0x33dbd2[_0x1e45('0x29')]=_[_0x1e45('0x22')](_0x190a16[_0x1e45('0x29')]);_0x33dbd2[_0x1e45('0x2a')]=_[_0x1e45('0x2b')](_0x33dbd2[_0x1e45('0x28')],_0x33dbd2[_0x1e45('0x29')]);_0x169e55[_0x1e45('0x2d')]=_[_0x1e45('0x2b')](_0x33dbd2['model'],qs[_0x1e45('0x2c')](_0x190a16[_0x1e45('0x29')][_0x1e45('0x2c')]));_0x169e55[_0x1e45('0x2d')]=_0x169e55[_0x1e45('0x2d')][_0x1e45('0x21')]?_0x169e55[_0x1e45('0x2d')]:_0x33dbd2[_0x1e45('0x28')];if(!_0x190a16[_0x1e45('0x29')][_0x1e45('0x2e')]('nolimit')){_0x169e55[_0x1e45('0x12')]=qs['limit'](_0x190a16['query'][_0x1e45('0x12')]);_0x169e55[_0x1e45('0x14')]=qs[_0x1e45('0x14')](_0x190a16[_0x1e45('0x29')][_0x1e45('0x14')]);}_0x169e55[_0x1e45('0x69')]=qs[_0x1e45('0xbe')](_0x190a16[_0x1e45('0x29')][_0x1e45('0xbe')]);_0x169e55[_0x1e45('0x30')]=qs[_0x1e45('0x2a')](_['pick'](_0x190a16[_0x1e45('0x29')],_0x33dbd2[_0x1e45('0x2a')]));_0x169e55['where']['ContactId']=_0x36b9e3['id'];if(_0x190a16[_0x1e45('0x29')]['filter']){_0x169e55[_0x1e45('0x30')]=_[_0x1e45('0x76')](_0x169e55[_0x1e45('0x30')],{'$or':_['map'](_0x169e55[_0x1e45('0x2d')],function(_0x5754d1){var _0x544642={};_0x544642[_0x5754d1]={'$like':'%'+_0x190a16[_0x1e45('0x29')][_0x1e45('0x50')]+'%'};return _0x544642;})});}_0x169e55=_['merge']({},_0x169e55,_0x190a16[_0x1e45('0xbf')]);return db[_0x1e45('0x93')][_0x1e45('0x13')]({'where':_0x169e55['where']})[_0x1e45('0x17')](function(_0x4a2a2b){_0x1ff530[_0x1e45('0x13')]=_0x4a2a2b;if(_0x190a16[_0x1e45('0x29')][_0x1e45('0xc3')]){_0x169e55['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x169e55);})['then'](function(_0x5be15c){_0x1ff530[_0x1e45('0x84')]=_0x5be15c;return _0x1ff530;});}})[_0x1e45('0x17')](respondWithFilteredResult(_0xc4f208,_0x169e55))[_0x1e45('0x85')](handleError(_0xc4f208,null));};exports[_0x1e45('0xc4')]=function(_0x348716,_0x7f75f9){var _0x3a5e95={'raw':!![],'where':{}};var _0x298808={};var _0x47cdaf={'count':0x0,'rows':[]};return db['CmContact'][_0x1e45('0x26')]({'where':{'id':_0x348716[_0x1e45('0x86')]['id']}})[_0x1e45('0x17')](handleEntityNotFound(_0x7f75f9,null))['then'](function(_0x505462){if(_0x505462){_0x298808['model']=_[_0x1e45('0x22')](db[_0x1e45('0xa3')][_0x1e45('0xbd')]);_0x298808[_0x1e45('0x29')]=_[_0x1e45('0x22')](_0x348716[_0x1e45('0x29')]);_0x298808[_0x1e45('0x2a')]=_[_0x1e45('0x2b')](_0x298808[_0x1e45('0x28')],_0x298808['query']);_0x3a5e95[_0x1e45('0x2d')]=_['intersection'](_0x298808[_0x1e45('0x28')],qs[_0x1e45('0x2c')](_0x348716[_0x1e45('0x29')][_0x1e45('0x2c')]));_0x3a5e95[_0x1e45('0x2d')]=_0x3a5e95[_0x1e45('0x2d')]['length']?_0x3a5e95[_0x1e45('0x2d')]:_0x298808[_0x1e45('0x28')];if(!_0x348716[_0x1e45('0x29')][_0x1e45('0x2e')](_0x1e45('0x2f'))){_0x3a5e95['limit']=qs['limit'](_0x348716[_0x1e45('0x29')][_0x1e45('0x12')]);_0x3a5e95[_0x1e45('0x14')]=qs[_0x1e45('0x14')](_0x348716['query'][_0x1e45('0x14')]);}_0x3a5e95[_0x1e45('0x69')]=qs[_0x1e45('0xbe')](_0x348716['query'][_0x1e45('0xbe')]);_0x3a5e95[_0x1e45('0x30')]=qs[_0x1e45('0x2a')](_['pick'](_0x348716[_0x1e45('0x29')],_0x298808[_0x1e45('0x2a')]));_0x3a5e95['where'][_0x1e45('0xc5')]=_0x505462['id'];if(_0x348716['query'][_0x1e45('0x50')]){_0x3a5e95[_0x1e45('0x30')]=_[_0x1e45('0x76')](_0x3a5e95['where'],{'$or':_[_0x1e45('0x44')](_0x3a5e95[_0x1e45('0x2d')],function(_0x5c0f37){var _0x45fd6c={};_0x45fd6c[_0x5c0f37]={'$like':'%'+_0x348716[_0x1e45('0x29')][_0x1e45('0x50')]+'%'};return _0x45fd6c;})});}_0x3a5e95=_[_0x1e45('0x76')]({},_0x3a5e95,_0x348716[_0x1e45('0xbf')]);return db['CmHopperHistory'][_0x1e45('0x13')]({'where':_0x3a5e95[_0x1e45('0x30')]})['then'](function(_0x27251a){_0x47cdaf[_0x1e45('0x13')]=_0x27251a;if(_0x348716['query'][_0x1e45('0xc3')]){_0x3a5e95['include']=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x3a5e95);})[_0x1e45('0x17')](function(_0x19190e){_0x47cdaf[_0x1e45('0x84')]=_0x19190e;return _0x47cdaf;});}})[_0x1e45('0x17')](respondWithFilteredResult(_0x7f75f9,_0x3a5e95))[_0x1e45('0x85')](handleError(_0x7f75f9,null));};exports['getHopperFinals']=function(_0x34a39a,_0x4d11f3){var _0x43cddc={'raw':!![],'where':{}};var _0x2b6b23={};var _0xd04389={'count':0x0,'rows':[]};return db[_0x1e45('0x1f')]['findOne']({'where':{'id':_0x34a39a[_0x1e45('0x86')]['id']}})[_0x1e45('0x17')](handleEntityNotFound(_0x4d11f3,null))['then'](function(_0x5894f1){if(_0x5894f1){_0x2b6b23['model']=_[_0x1e45('0x22')](db[_0x1e45('0xc6')][_0x1e45('0xbd')]);_0x2b6b23['query']=_['keys'](_0x34a39a[_0x1e45('0x29')]);_0x2b6b23['filters']=_[_0x1e45('0x2b')](_0x2b6b23[_0x1e45('0x28')],_0x2b6b23['query']);_0x43cddc[_0x1e45('0x2d')]=_[_0x1e45('0x2b')](_0x2b6b23[_0x1e45('0x28')],qs[_0x1e45('0x2c')](_0x34a39a['query'][_0x1e45('0x2c')]));_0x43cddc[_0x1e45('0x2d')]=_0x43cddc[_0x1e45('0x2d')]['length']?_0x43cddc[_0x1e45('0x2d')]:_0x2b6b23[_0x1e45('0x28')];if(!_0x34a39a[_0x1e45('0x29')][_0x1e45('0x2e')](_0x1e45('0x2f'))){_0x43cddc[_0x1e45('0x12')]=qs['limit'](_0x34a39a[_0x1e45('0x29')][_0x1e45('0x12')]);_0x43cddc[_0x1e45('0x14')]=qs[_0x1e45('0x14')](_0x34a39a[_0x1e45('0x29')][_0x1e45('0x14')]);}_0x43cddc[_0x1e45('0x69')]=qs[_0x1e45('0xbe')](_0x34a39a[_0x1e45('0x29')]['sort']);_0x43cddc['where']=qs[_0x1e45('0x2a')](_[_0x1e45('0x31')](_0x34a39a['query'],_0x2b6b23['filters']));_0x43cddc[_0x1e45('0x30')][_0x1e45('0xc5')]=_0x5894f1['id'];if(_0x34a39a[_0x1e45('0x29')]['filter']){_0x43cddc[_0x1e45('0x30')]=_[_0x1e45('0x76')](_0x43cddc[_0x1e45('0x30')],{'$or':_['map'](_0x43cddc[_0x1e45('0x2d')],function(_0x4fafe6){var _0x587756={};_0x587756[_0x4fafe6]={'$like':'%'+_0x34a39a[_0x1e45('0x29')][_0x1e45('0x50')]+'%'};return _0x587756;})});}_0x43cddc=_[_0x1e45('0x76')]({},_0x43cddc,_0x34a39a['options']);return db[_0x1e45('0xc6')][_0x1e45('0x13')]({'where':_0x43cddc[_0x1e45('0x30')]})['then'](function(_0x3d536e){_0xd04389[_0x1e45('0x13')]=_0x3d536e;if(_0x34a39a['query'][_0x1e45('0xc3')]){_0x43cddc['include']=[{'all':!![]}];}return db[_0x1e45('0xc6')][_0x1e45('0x8a')](_0x43cddc);})['then'](function(_0x55d430){_0xd04389[_0x1e45('0x84')]=_0x55d430;return _0xd04389;});}})['then'](respondWithFilteredResult(_0x4d11f3,_0x43cddc))[_0x1e45('0x85')](handleError(_0x4d11f3,null));};exports[_0x1e45('0xc7')]=function(_0x31c4fa,_0x2dc48c){var _0x5f1e10={'raw':!![],'where':{}};var _0x12e1eb={};var _0x15cbbb={'count':0x0,'rows':[]};return db[_0x1e45('0x1f')][_0x1e45('0x26')]({'where':{'id':_0x31c4fa[_0x1e45('0x86')]['id']}})[_0x1e45('0x17')](handleEntityNotFound(_0x2dc48c,null))[_0x1e45('0x17')](function(_0x499c6a){if(_0x499c6a){_0x12e1eb['model']=_[_0x1e45('0x22')](db[_0x1e45('0xaa')]['rawAttributes']);_0x12e1eb['query']=_[_0x1e45('0x22')](_0x31c4fa[_0x1e45('0x29')]);_0x12e1eb[_0x1e45('0x2a')]=_[_0x1e45('0x2b')](_0x12e1eb[_0x1e45('0x28')],_0x12e1eb[_0x1e45('0x29')]);_0x5f1e10[_0x1e45('0x2d')]=_[_0x1e45('0x2b')](_0x12e1eb[_0x1e45('0x28')],qs[_0x1e45('0x2c')](_0x31c4fa[_0x1e45('0x29')][_0x1e45('0x2c')]));_0x5f1e10[_0x1e45('0x2d')]=_0x5f1e10[_0x1e45('0x2d')][_0x1e45('0x21')]?_0x5f1e10['attributes']:_0x12e1eb[_0x1e45('0x28')];if(!_0x31c4fa['query'][_0x1e45('0x2e')](_0x1e45('0x2f'))){_0x5f1e10[_0x1e45('0x12')]=qs[_0x1e45('0x12')](_0x31c4fa['query']['limit']);_0x5f1e10[_0x1e45('0x14')]=qs['offset'](_0x31c4fa[_0x1e45('0x29')]['offset']);}_0x5f1e10['order']=qs['sort'](_0x31c4fa[_0x1e45('0x29')]['sort']);_0x5f1e10[_0x1e45('0x30')]=qs[_0x1e45('0x2a')](_[_0x1e45('0x31')](_0x31c4fa['query'],_0x12e1eb['filters']));_0x5f1e10[_0x1e45('0x30')][_0x1e45('0xc5')]=_0x499c6a['id'];if(_0x31c4fa[_0x1e45('0x29')][_0x1e45('0x50')]){_0x5f1e10[_0x1e45('0x30')]=_[_0x1e45('0x76')](_0x5f1e10[_0x1e45('0x30')],{'$or':_[_0x1e45('0x44')](_0x5f1e10[_0x1e45('0x2d')],function(_0x170693){var _0x43cee3={};_0x43cee3[_0x170693]={'$like':'%'+_0x31c4fa[_0x1e45('0x29')][_0x1e45('0x50')]+'%'};return _0x43cee3;})});}_0x5f1e10=_[_0x1e45('0x76')]({},_0x5f1e10,_0x31c4fa[_0x1e45('0xbf')]);return db['JscriptySessionReport'][_0x1e45('0x13')]({'where':_0x5f1e10[_0x1e45('0x30')]})['then'](function(_0x2ff9f2){_0x15cbbb[_0x1e45('0x13')]=_0x2ff9f2;if(_0x31c4fa[_0x1e45('0x29')][_0x1e45('0xc3')]){_0x5f1e10[_0x1e45('0xc8')]=[{'all':!![]}];}return db[_0x1e45('0xaa')][_0x1e45('0x8a')](_0x5f1e10);})[_0x1e45('0x17')](function(_0x151820){_0x15cbbb[_0x1e45('0x84')]=_0x151820;return _0x15cbbb;});}})[_0x1e45('0x17')](respondWithFilteredResult(_0x2dc48c,_0x5f1e10))[_0x1e45('0x85')](handleError(_0x2dc48c,null));};exports[_0x1e45('0xc9')]=function(_0x22fad9,_0x331129){try{if(!_0x22fad9['body']['ListId']){throw new Error(_0x1e45('0xca'));}if(!_0x22fad9[_0x1e45('0x8e')][_0x1e45('0xcb')]){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x22fad9['body'][_0x1e45('0xcc')]){throw new Error(_0x1e45('0xcd'));}if(!_0x22fad9[_0x1e45('0x8e')]['socket_timestamp']){throw new Error(_0x1e45('0xce'));}var _0x55891b=_0x22fad9[_0x1e45('0x8e')][_0x1e45('0xcb')][_0x1e45('0x43')](',');var _0x4c3d25=_0x22fad9['body'][_0x1e45('0xcc')]['split'](',');if(!_0x55891b[_0x1e45('0x21')]||!_0x4c3d25[_0x1e45('0x21')]||_0x55891b[_0x1e45('0x21')]!==_0x4c3d25['length']){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x22fad9['body']['fields']=_[_0x1e45('0xcf')](_0x55891b,_0x4c3d25);if(!_0x22fad9['body'][_0x1e45('0x2c')]['phone']){throw new Error(_0x1e45('0xd0'));}if(!_0x22fad9['body']['fields'][_0x1e45('0xd1')]){throw new Error('No\x20firstName\x20column\x20specified');}var _0x51e2c1=path[_0x1e45('0x91')](config['root'],_0x1e45('0xd2'),_0x22fad9[_0x1e45('0xd3')][_0x1e45('0xd4')]);fs[_0x1e45('0xd5')](_0x51e2c1,parseInt(_0x1e45('0xd6'),0x8));var _0x2cc493=require(_0x1e45('0xd7'))[_0x1e45('0xd8')](path[_0x1e45('0x91')](__dirname,_0x1e45('0xd9')),[_0x51e2c1,_0x22fad9[_0x1e45('0x8e')]['binding_keys'],_0x22fad9[_0x1e45('0x8e')]['binding_values'],_0x22fad9[_0x1e45('0x8e')][_0x1e45('0x73')],_0x22fad9[_0x1e45('0x8e')][_0x1e45('0xda')],_0x22fad9['body']['duplicates'],_0x22fad9[_0x1e45('0x8e')]['socket_timestamp']]);return _0x331129[_0x1e45('0xf')](0xc8)[_0x1e45('0x10')]({'message':_0x1e45('0xdb'),'pid':_0x2cc493[_0x1e45('0xdc')]});}catch(_0x2128aa){return _0x331129[_0x1e45('0xf')](0x1f4)[_0x1e45('0x1d')](_0x2128aa);}};exports[_0x1e45('0xdd')]=function(_0x22efa,_0x3aab59){var _0x3c3184=fs[_0x1e45('0xde')](_0x22efa[_0x1e45('0xd3')][_0x1e45('0xdf')]);Papa['parse'](_0x3c3184,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x25fdad){return _0x3aab59[_0x1e45('0xf')](0xc8)[_0x1e45('0x10')]({'file':_0x22efa[_0x1e45('0xd3')],'fields':_0x25fdad[_0x1e45('0xe0')]['fields']});}});};exports[_0x1e45('0xe1')]=function(_0x4c5f5c,_0x2997f7){return db[_0x1e45('0x46')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x1e45('0x70')}})[_0x1e45('0x17')](function(_0x4b8b62){var _0x4de34b=![];if(!_0x4c5f5c[_0x1e45('0x8e')][_0x1e45('0x73')]){throw new Error(_0x1e45('0xca'));}if(!_0x4c5f5c[_0x1e45('0x8e')][_0x1e45('0xe2')][_0x1e45('0xbb')]){throw new Error(_0x1e45('0xd0'));}if(!_0x4c5f5c['body'][_0x1e45('0xe2')][_0x1e45('0xd1')]){throw new Error(_0x1e45('0xe3'));}if(!_0x4c5f5c[_0x1e45('0x8e')][_0x1e45('0xe4')]){throw new Error(_0x1e45('0xce'));}var _0x4cc08c=require(_0x1e45('0xd7'))[_0x1e45('0xd8')](path[_0x1e45('0x91')](__dirname,_0x1e45('0xe5')),[_0x4c5f5c[_0x1e45('0x86')]['id'],JSON[_0x1e45('0xe6')](_0x4c5f5c[_0x1e45('0x8e')]),JSON[_0x1e45('0xe6')](_0x4b8b62)]);_0x4cc08c['on'](_0x1e45('0xe7'),function(){_0x4de34b=!![];return _0x2997f7['status'](0xc8)[_0x1e45('0x10')]({'message':_0x1e45('0xe8'),'pid':_0x4cc08c[_0x1e45('0xdc')]});});_0x4cc08c['on']('exit',function(_0x445622){if(_0x445622&&!_0x4de34b){return _0x2997f7[_0x1e45('0xf')](0x1f4)[_0x1e45('0x10')]({'message':_0x1e45('0xe9'),'pid':_0x4cc08c[_0x1e45('0xdc')]});}});})[_0x1e45('0x85')](handleError(_0x2997f7,null));};exports['getJourney']=function(_0x454145,_0x39bcab){var _0x8e2848=[_0x1e45('0xea'),_0x1e45('0xeb'),_0x1e45('0xec'),_0x1e45('0xed'),_0x1e45('0xee'),'whatsapp','voice'];var _0x1f804b={'offset':0x0,'order':qs[_0x1e45('0xbe')](_0x1e45('0xef'))},_0x590eae={'count':0x0,'rows':[]};Promise[_0x1e45('0x6d')]()[_0x1e45('0x17')](function(){if(_0x454145[_0x1e45('0x29')]['channel']){if(!_[_0x1e45('0xf0')](_0x8e2848,_0x454145[_0x1e45('0x29')][_0x1e45('0xf1')][_0x1e45('0xf2')]())){throw new Error(_0x1e45('0xf3'));}_0x8e2848=[_0x454145[_0x1e45('0x29')][_0x1e45('0xf1')][_0x1e45('0xf2')]()];}if(_0x454145[_0x1e45('0x29')][_0x1e45('0xf4')]){try{var _0x13077e=JSON['parse'](_0x454145[_0x1e45('0x29')][_0x1e45('0xf4')]);if(!moment(_0x13077e[_0x1e45('0x34')])['isValid']()){throw new Error(_0x1e45('0xf5'));}if(!moment(_0x13077e['to'])[_0x1e45('0xf6')]()){throw new Error(_0x1e45('0xf7'));}}catch(_0x28503c){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x454145['query'][_0x1e45('0x2e')](_0x1e45('0x2f'))){_0x1f804b[_0x1e45('0x12')]=qs[_0x1e45('0x12')](_0x454145[_0x1e45('0x29')][_0x1e45('0x12')]||0xa);_0x1f804b['offset']=qs[_0x1e45('0x14')](_0x454145[_0x1e45('0x29')]['offset']);}var _0x2918df=_0x8e2848[_0x1e45('0x44')](function(_0x2fbfc3){if(_0x2fbfc3===_0x1e45('0xf8')){var _0x366e09={'attributes':['id',_0x1e45('0xf9'),_0x1e45('0x27'),'source',_0x1e45('0xfa'),_0x1e45('0xfb'),'starttime',_0x1e45('0xfc'),'duration',_0x1e45('0xfd'),_0x1e45('0xfe'),_0x1e45('0xff'),_0x1e45('0x100'),_0x1e45('0x101'),'UserId'],'where':{'ContactId':_0x454145[_0x1e45('0x86')]['id']},'include':[{'model':db[_0x1e45('0x46')],'as':'User','attributes':['id','name',_0x1e45('0x102'),_0x1e45('0x103')]}],'order':[[_0x1e45('0xfe'),_0x1e45('0x6a')]]};if(_0x454145[_0x1e45('0x29')][_0x1e45('0xf4')]){_0x366e09[_0x1e45('0x30')][_0x1e45('0xfe')]={'$gte':_0x13077e[_0x1e45('0x34')],'$lte':_0x13077e['to']};}return db[_0x1e45('0xa5')]['findAndCountAll'](_0x366e09)[_0x1e45('0x17')](function(_0x1fdf13){_0x590eae[_0x1e45('0x13')]+=_0x1fdf13['count'];return _['map'](_0x1fdf13[_0x1e45('0x84')],function(_0x3c47f2){var _0x325fd7=_0x3c47f2['get']({'plain':!![]});_0x325fd7['channel']=_0x2fbfc3;if(_0x325fd7['User']){_0x325fd7[_0x1e45('0x46')]={'id':_0x325fd7['User']['id'],'name':_0x325fd7['User'][_0x1e45('0x1c')],'fullname':_0x325fd7[_0x1e45('0x46')][_0x1e45('0x102')],'alias':_0x325fd7[_0x1e45('0x46')][_0x1e45('0x103')]};}return _0x325fd7;});});}else{var _0x2b1dc3=_[_0x1e45('0x104')](_0x2fbfc3)+(_0x2fbfc3===_0x1e45('0xeb')?'Website':_0x1e45('0x105'));var _0x461fe1={'attributes':['id',_0x1e45('0x106'),'closedAt',_0x1e45('0xfe'),_0x1e45('0xfd'),_0x1e45('0x107'),'secondDisposition','thirdDisposition','UserId',_0x2b1dc3+'Id'],'where':{'ContactId':_0x454145[_0x1e45('0x86')]['id']},'include':[{'model':db[_0x2b1dc3],'as':'Account','attributes':['id',_0x1e45('0x1c'),'key']},{'model':db[_0x1e45('0x46')],'as':_0x1e45('0x108'),'attributes':['id',_0x1e45('0x1c'),_0x1e45('0x102')]},{'model':db[_0x1e45('0x41')],'as':'Tags','attributes':['id',_0x1e45('0x1c'),_0x1e45('0x33')],'through':{'attributes':[]}}],'order':[['createdAt',_0x1e45('0x6a')]]};if(_0x454145[_0x1e45('0x29')][_0x1e45('0xf4')]){_0x461fe1[_0x1e45('0x30')][_0x1e45('0xfe')]={'$gte':_0x13077e[_0x1e45('0x34')],'$lte':_0x13077e['to']};}switch(_0x2fbfc3){case _0x1e45('0xeb'):_0x461fe1[_0x1e45('0x2d')][_0x1e45('0x25')]('browserName',_0x1e45('0x109'),'customerPort',_0x1e45('0x10a'),'osName','ratingMessage','ratingType',_0x1e45('0x10b'),'referer');break;case'mail':_0x461fe1[_0x1e45('0x2d')][_0x1e45('0x25')]('subject','substatus');break;case _0x1e45('0xed'):_0x461fe1[_0x1e45('0x2d')][_0x1e45('0x25')](_0x1e45('0x10c'),_0x1e45('0x10d'));break;}return db[_[_0x1e45('0x104')](_0x2fbfc3)+_0x1e45('0x10e')][_0x1e45('0x10f')](_0x461fe1)['then'](function(_0x5c5430){_0x590eae[_0x1e45('0x13')]+=_0x5c5430[_0x1e45('0x13')];return _[_0x1e45('0x44')](_0x5c5430[_0x1e45('0x84')],function(_0x415fcf){var _0x35309=_0x415fcf['get']({'plain':!![]});_0x35309[_0x1e45('0xf1')]=_0x2fbfc3;if(_0x35309['Owner']){_0x35309[_0x1e45('0x108')]={'id':_0x35309[_0x1e45('0x108')]['id'],'name':_0x35309[_0x1e45('0x108')][_0x1e45('0x1c')],'fullname':_0x35309[_0x1e45('0x108')][_0x1e45('0x102')]};}return _0x35309;});});}});return Promise[_0x1e45('0x110')](_0x2918df);})[_0x1e45('0x17')](function(_0x476e8c){return _(_0x476e8c)[_0x1e45('0x111')]()[_0x1e45('0x112')](_0x1e45('0xfe'))[_0x1e45('0x113')]()[_0x1e45('0x42')]();})[_0x1e45('0x17')](function(_0x364988){_0x590eae['rows']=_0x1f804b['limit']?_0x364988[_0x1e45('0x114')](_0x1f804b[_0x1e45('0x14')],_0x1f804b[_0x1e45('0x14')]+_0x1f804b[_0x1e45('0x12')]):_0x364988;return _0x590eae;})[_0x1e45('0x17')](respondWithFilteredResult(_0x39bcab,_0x1f804b))[_0x1e45('0x85')](handleError(_0x39bcab,null));};
\ No newline at end of file
+var _0xe7f3=['includeAll','include','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','zipObject','No\x20firstName\x20column\x20specified','server/files/tmp','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','upload','createReadStream','file','path','meta','binding','phone','No\x20phone\x20column\x20specified','firstName','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','getJourney','mail','chat','sms','voice','channel','includes','toLowerCase','range','parse','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','source','destination','callerid','starttime','endtime','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','DESC','VoiceCallReport','startCase','closedAt','disposition','secondDisposition','thirdDisposition','key','browserName','customerPort','deviceModel','ratingMessage','ratingType','referer','subject','substatus','openchannel','externalUrl','threadId','Interaction','Owner','all','flatten','sortBy','reverse','slice','moment','util','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./cmContact.socket','status','json','undefined','limit','count','offset','set','update','then','destroy','end','sendStatus','error','stack','name','send','index','keys','length','cf_','push','CmCustomField','trimStart','fieldType','type','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','field','color','tools_tags','select','from','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','Tag','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','value','dateOfBirth','datetime','buildExpression','text','start','filter','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','\x20=\x20?','isArray','tag','replace','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','having','resolve','user','agent','some','c.ListId\x20IS\x20NULL','role','toString','sequelize','keyBy','merge','CmContact','c.firstName','c.lastName','c.phone','c.fax','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','TagIds','Tags','split','rows','catch','find','describe','tags','startsWith','columnName','displayName','findAll','alias','custom','values','body','get','mergeWith','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatMessage','ChatOfflineMessage','MailMessage','SmsMessage','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','bulkCreate','duplicates','findOrCreate','spread','show','omit','params','$and','pickBy','table','setFields','id\x20=\x20?','toParam','CmHopper','getTags','findOne','options','setTags','ids','getHoppers','ContactId','rawAttributes'];(function(_0x454018,_0x46e33a){var _0x24697d=function(_0x3ec647){while(--_0x3ec647){_0x454018['push'](_0x454018['shift']());}};_0x24697d(++_0x46e33a);}(_0xe7f3,0x16d));var _0x3e7f=function(_0x4b9465,_0x348762){_0x4b9465=_0x4b9465-0x0;var _0x11bcf3=_0xe7f3[_0x4b9465];return _0x11bcf3;};'use strict';var moment=require(_0x3e7f('0x0'));var BPromise=require('bluebird');var util=require(_0x3e7f('0x1'));var path=require('path');var fs=require('fs');var _=require(_0x3e7f('0x2'));var squel=require(_0x3e7f('0x3'));var Papa=require(_0x3e7f('0x4'));var Redis=require(_0x3e7f('0x5'));var qs=require(_0x3e7f('0x6'));var as=require(_0x3e7f('0x7'));var logger=require(_0x3e7f('0x8'))(_0x3e7f('0x9'));var config=require('../../config/environment');var db=require(_0x3e7f('0xa'))['db'];config[_0x3e7f('0xb')]=_[_0x3e7f('0xc')](config[_0x3e7f('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x3e7f('0xd'))(new Redis(config[_0x3e7f('0xb')]));require(_0x3e7f('0xe'))['register'](socket);function respondWithResult(_0x5623d4,_0x37f447){_0x37f447=_0x37f447||0xc8;return function(_0x482d38){if(_0x482d38){return _0x5623d4[_0x3e7f('0xf')](_0x37f447)[_0x3e7f('0x10')](_0x482d38);}};}function respondWithFilteredResult(_0x3f4081,_0x28936d){return function(_0x5959b3){if(_0x5959b3){var _0x223819=typeof _0x28936d['offset']===_0x3e7f('0x11')&&typeof _0x28936d[_0x3e7f('0x12')]==='undefined';var _0x4315bd=_0x5959b3[_0x3e7f('0x13')];var _0x5a36e6=_0x223819?0x0:_0x28936d[_0x3e7f('0x14')];var _0xad4e18=_0x223819?_0x5959b3['count']:_0x28936d[_0x3e7f('0x14')]+_0x28936d['limit'];var _0xf2203e;if(_0xad4e18>=_0x4315bd){_0xad4e18=_0x4315bd;_0xf2203e=0xc8;}else{_0xf2203e=0xce;}_0x3f4081[_0x3e7f('0xf')](_0xf2203e);return _0x3f4081[_0x3e7f('0x15')]('Content-Range',_0x5a36e6+'-'+_0xad4e18+'/'+_0x4315bd)[_0x3e7f('0x10')](_0x5959b3);}return null;};}function saveUpdates(_0x4a2975){return function(_0x2bb819){if(_0x2bb819){return _0x2bb819[_0x3e7f('0x16')](_0x4a2975)[_0x3e7f('0x17')](function(_0xb2dede){return _0xb2dede;});}return null;};}function removeEntity(_0x1f8abc){return function(_0x100d23){if(_0x100d23){return _0x100d23[_0x3e7f('0x18')]()['then'](function(){_0x1f8abc[_0x3e7f('0xf')](0xcc)[_0x3e7f('0x19')]();});}};}function handleEntityNotFound(_0x1347f1){return function(_0x315883){if(!_0x315883){_0x1347f1[_0x3e7f('0x1a')](0x194);}return _0x315883;};}function handleError(_0x3f56d6,_0x488738){_0x488738=_0x488738||0x1f4;return function(_0x3c788c){logger[_0x3e7f('0x1b')](_0x3c788c[_0x3e7f('0x1c')]);if(_0x3c788c[_0x3e7f('0x1d')]){delete _0x3c788c['name'];}_0x3f56d6['status'](_0x488738)[_0x3e7f('0x1e')](_0x3c788c);};}exports[_0x3e7f('0x1f')]=function(_0x318240,_0x38a392){var _0xcfdcf7={},_0x456a25={},_0xed064f={'count':0x0,'rows':[]};return db['CmContact']['describe']()[_0x3e7f('0x17')](function(_0x45fa8e){var _0x3d26df=[];for(var _0x5cc2fd=0x0;_0x5cc2fd<Object[_0x3e7f('0x20')](_0x45fa8e)[_0x3e7f('0x21')];_0x5cc2fd++){var _0x3830b4=Object[_0x3e7f('0x20')](_0x45fa8e)[_0x5cc2fd];if(_['startsWith'](_0x3830b4,_0x3e7f('0x22'))){_0x3d26df[_0x3e7f('0x23')](db[_0x3e7f('0x24')]['findOne']({'where':{'id':_[_0x3e7f('0x25')](_0x3830b4,'cf_')},'raw':!![]}));}}return BPromise['all'](_0x3d26df)[_0x3e7f('0x17')](function(_0x303e3e){for(var _0x58ba1f=0x0;_0x58ba1f<_0x303e3e['length'];_0x58ba1f++){if(_0x303e3e[_0x58ba1f]){var _0x2ffd4a=_0x3e7f('0x22')+_0x303e3e[_0x58ba1f]['id'];var _0x272492=_0x45fa8e[_0x2ffd4a];_0x272492[_0x3e7f('0x26')]=_0x303e3e[_0x58ba1f][_0x3e7f('0x27')];}}return _0x45fa8e;});})[_0x3e7f('0x17')](function(_0x2eae16){_0x456a25['model']=_[_0x3e7f('0x20')](_0x2eae16);_0x456a25[_0x3e7f('0x28')]=_[_0x3e7f('0x20')](_0x318240[_0x3e7f('0x28')]);_0x456a25[_0x3e7f('0x29')]=_[_0x3e7f('0x2a')](_0x456a25[_0x3e7f('0x2b')],_0x456a25['query']);_0xcfdcf7[_0x3e7f('0x2c')]=_[_0x3e7f('0x2a')](_0x456a25[_0x3e7f('0x2b')],qs[_0x3e7f('0x2d')](_0x318240['query'][_0x3e7f('0x2d')]));_0xcfdcf7[_0x3e7f('0x2c')]=_0xcfdcf7[_0x3e7f('0x2c')][_0x3e7f('0x21')]?_0xcfdcf7[_0x3e7f('0x2c')]:_0x456a25[_0x3e7f('0x2b')];if(!_0x318240[_0x3e7f('0x28')][_0x3e7f('0x2e')](_0x3e7f('0x2f'))){_0xcfdcf7['limit']=qs['limit'](_0x318240[_0x3e7f('0x28')]['limit']);_0xcfdcf7[_0x3e7f('0x14')]=qs[_0x3e7f('0x14')](_0x318240[_0x3e7f('0x28')][_0x3e7f('0x14')]);}_0xcfdcf7[_0x3e7f('0x30')]=qs[_0x3e7f('0x31')](_0x318240[_0x3e7f('0x28')][_0x3e7f('0x31')]);_0xcfdcf7[_0x3e7f('0x32')]=qs[_0x3e7f('0x29')](_[_0x3e7f('0x33')](_0x318240[_0x3e7f('0x28')],_0x456a25[_0x3e7f('0x29')]),_0x2eae16);var _0x40f8fe=[];var _0x5a0e82=squel['select']()['field']('id')[_0x3e7f('0x34')](_0x3e7f('0x1d'))[_0x3e7f('0x34')](_0x3e7f('0x35'))['from'](_0x3e7f('0x36'));var _0x3605a8=squel[_0x3e7f('0x37')]()[_0x3e7f('0x38')](_0x3e7f('0x39'),'c')[_0x3e7f('0x3a')](_0x3e7f('0x3b'),'uc',_0x3e7f('0x3c'))[_0x3e7f('0x3a')]('cm_contact_has_tags','ct','ct.CmContactId\x20=\x20c.id')['left_join'](_0x3e7f('0x36'),'t',_0x3e7f('0x3d'))[_0x3e7f('0x32')](_0x3e7f('0x3e'));var _0x230dba=squel[_0x3e7f('0x3f')]();var _0x2622ef=[];var _0x324cb5=squel[_0x3e7f('0x3f')]();var _0x29d004;if(_0x318240['query'][_0x3e7f('0x40')]){_0x29d004=as[_0x3e7f('0x41')](_0x318240[_0x3e7f('0x28')][_0x3e7f('0x40')]);var _0x364578=_0x29d004[_0x3e7f('0x42')];for(var _0x1658c2=0x0;_0x1658c2<_0x29d004[_0x3e7f('0x43')][_0x3e7f('0x21')];_0x1658c2++){var _0x28be50=_0x29d004[_0x3e7f('0x43')][_0x1658c2];var _0x4cb24b='c';var _0x2bf2ab=_(_0x2eae16)[_0x3e7f('0x20')]()['find'](function(_0x215b95){return _0x215b95===_0x28be50[_0x3e7f('0x34')];});if(_0x2bf2ab)_0x2bf2ab=_0x2eae16[_0x28be50[_0x3e7f('0x34')]];if(!_0x2bf2ab){if(_0x28be50[_0x3e7f('0x34')]===_0x3e7f('0x44')){var _0x3d0cef=_0x28be50['value']['split'](',')[_0x3e7f('0x45')](function(_0x3fec14){return Number(_0x3fec14);});_0x3d0cef[_0x3e7f('0x46')](function(_0x3badf7){_0x324cb5['or'](_0x3e7f('0x47'),'%,'+_0x3badf7+',%');});_0x2622ef=_[_0x3e7f('0x48')](_0x2622ef,_0x3d0cef);}else if(_0x28be50[_0x3e7f('0x34')]===_0x3e7f('0x49')){_0x230dba[_0x3e7f('0x4a')](_0x3e7f('0x4b'),_0x28be50[_0x3e7f('0x4c')]);}}else{if(_0x28be50[_0x3e7f('0x34')]===_0x3e7f('0x4d')||_0x2bf2ab[_0x3e7f('0x26')]===_0x3e7f('0x4e'))_0x28be50['castTo']='DATE';var _0x2be14b=as[_0x3e7f('0x4f')](_0x4cb24b,_0x2bf2ab[_0x3e7f('0x27')],_0x28be50);_0x230dba[_0x364578](_0x2be14b[_0x3e7f('0x50')],_0x2be14b['value'][_0x3e7f('0x51')],_0x2be14b[_0x3e7f('0x4c')]['end']);}}}else{var _0x15b227=_(Object[_0x3e7f('0x20')](_0x318240['query']))[_0x3e7f('0x45')](function(_0x33b5cc){return _0x2eae16[_0x3e7f('0x2e')](_0x33b5cc)?_0x33b5cc:undefined;})[_0x3e7f('0x52')](function(_0x16c0eb){return!_[_0x3e7f('0x53')](_0x16c0eb);})[_0x3e7f('0x4c')]();if(_0x318240[_0x3e7f('0x28')][_0x3e7f('0x54')])_0x15b227['push'](_0x3e7f('0x54'));if(!_[_0x3e7f('0x55')](_0x15b227)){_0x15b227[_0x3e7f('0x46')](function(_0xafcc3){if(_0xafcc3===_0x3e7f('0x56')){_0x3605a8[_0x3e7f('0x32')](_0x3e7f('0x57'),[]['concat'](_0x318240[_0x3e7f('0x28')][_0xafcc3]));}else if(_0xafcc3===_0x3e7f('0x54')){var _0x541414='%'+_0x318240['query'][_0xafcc3]+'%';_0x3605a8[_0x3e7f('0x32')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x541414);}else{_0x3605a8[_0x3e7f('0x32')]('c.'+_0xafcc3+_0x3e7f('0x58'),_0x318240['query'][_0xafcc3]);}});}if(_0x318240['query']['tag']){_0x2622ef=_[_0x3e7f('0x59')](_0x318240[_0x3e7f('0x28')]['tag'])?_0x318240[_0x3e7f('0x28')]['tag']:new Array(_0x318240['query'][_0x3e7f('0x5a')]);_0x2622ef[_0x3e7f('0x46')](function(_0x4d2b42){_0x324cb5['or'](_0x3e7f('0x47'),'%,'+_0x4d2b42+',%');});}if(_0x318240[_0x3e7f('0x28')]['filter']){var _0x2ba8cf=_0x318240[_0x3e7f('0x28')][_0x3e7f('0x52')]['replace']('\x5c','\x5c\x5c')[_0x3e7f('0x5b')](/'/g,'\x27\x27');if(_0x2ba8cf['split']('\x20')[_0x3e7f('0x21')]>0x1){_0x230dba['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3e7f('0x5c')](_0x2ba8cf),null);}else{if(qs[_0x3e7f('0x5d')](_0x2ba8cf)){_0x230dba['or'](_0x3e7f('0x5e'),_0x2ba8cf+'%');_0x230dba['or'](_0x3e7f('0x5f'),_0x2ba8cf+'%');_0x230dba['or'](_0x3e7f('0x60'),_0x2ba8cf+'%');_0x230dba['or']('c.fax\x20LIKE\x20?',_0x2ba8cf+'%');}else if(qs[_0x3e7f('0x61')](_0x2ba8cf)){_0x230dba['or']('c.email\x20LIKE\x20?',_0x2ba8cf+'%');}else{_0x230dba['or']('c.firstName\x20LIKE\x20?','%'+_0x2ba8cf+'%');_0x230dba['or'](_0x3e7f('0x62'),'%'+_0x2ba8cf+'%');_0x230dba['or'](_0x3e7f('0x63'),'%'+_0x2ba8cf+'%');}}}}_0x3605a8[_0x3e7f('0x32')](_0x230dba);_0x3605a8[_0x3e7f('0x64')](_0x3e7f('0x65'));var _0x898aa2={'type':db[_0x3e7f('0x66')][_0x3e7f('0x67')][_0x3e7f('0x68')],'raw':!![]};var _0x33f4b9=_0x3605a8[_0x3e7f('0x69')]()['field'](_0x3e7f('0x65'));if(_0xcfdcf7['order']){_0xcfdcf7[_0x3e7f('0x30')]['forEach'](function(_0x167e5e){_0x3605a8['order']('c.'+_0x167e5e[0x0],_0x167e5e[0x1]==='DESC'?![]:!![]);});}if(!_[_0x3e7f('0x55')](_0x2622ef)){_0x3605a8[_0x3e7f('0x6a')](_0x324cb5);_0x33f4b9['where']('t.id\x20IN\x20?',_0x2622ef);}BPromise[_0x3e7f('0x6b')]()[_0x3e7f('0x17')](function(){if(!_0x29d004)return;if(_0x318240[_0x3e7f('0x6c')]['role']!==_0x3e7f('0x6d'))return;if(!_[_0x3e7f('0x6e')](_0x29d004[_0x3e7f('0x43')],[_0x3e7f('0x34'),_0x3e7f('0x49')])){return _0x318240[_0x3e7f('0x6c')]['getLists']({'attributes':['id'],'raw':!![]})[_0x3e7f('0x17')](function(_0x1e66a3){if(_[_0x3e7f('0x55')](_0x1e66a3)){_0x33f4b9['where'](_0x3e7f('0x6f'));_0x3605a8['where'](_0x3e7f('0x6f'));}else{_0x33f4b9['where'](_0x3e7f('0x57'),_['map'](_0x1e66a3,'id'));_0x3605a8[_0x3e7f('0x32')](_0x3e7f('0x57'),_['map'](_0x1e66a3,'id'));}});}})[_0x3e7f('0x17')](function(){if(_0x318240[_0x3e7f('0x6c')][_0x3e7f('0x70')]===_0x3e7f('0x6d')&&!_0x29d004&&!_0x318240[_0x3e7f('0x28')][_0x3e7f('0x56')])return[];return db['sequelize'][_0x3e7f('0x28')](_0x33f4b9[_0x3e7f('0x71')](),_0x898aa2);})[_0x3e7f('0x17')](function(_0x579004){_0xed064f[_0x3e7f('0x13')]=_0x579004['length'];if(_0xed064f[_0x3e7f('0x13')]===0x0)return[];return db[_0x3e7f('0x72')]['query'](_0x5a0e82[_0x3e7f('0x71')](),_0x898aa2)['then'](function(_0x1da46f){_0x40f8fe=_[_0x3e7f('0x73')](_0x1da46f,'id');_0x898aa2=_[_0x3e7f('0x74')](_0x898aa2,{'model':db[_0x3e7f('0x75')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x318240[_0x3e7f('0x28')][_0x3e7f('0x2d')]){_0xcfdcf7[_0x3e7f('0x2c')][_0x3e7f('0x46')](function(_0xf3917f){_0x3605a8['field']('c.'+_0xf3917f);});}else{_0x3605a8[_0x3e7f('0x34')](_0x3e7f('0x65'));_0x3605a8[_0x3e7f('0x34')](_0x3e7f('0x76'));_0x3605a8[_0x3e7f('0x34')](_0x3e7f('0x77'));_0x3605a8['field'](_0x3e7f('0x78'));_0x3605a8[_0x3e7f('0x34')]('c.mobile');_0x3605a8[_0x3e7f('0x34')](_0x3e7f('0x79'));_0x3605a8[_0x3e7f('0x34')]('c.email');_0x3605a8['field'](_0x3e7f('0x7a'));_0x3605a8[_0x3e7f('0x34')](_0x3e7f('0x7b'));_0x3605a8[_0x3e7f('0x34')](_0x3e7f('0x7c'));_0x3605a8['field'](_0x3e7f('0x7d'));_0x3605a8[_0x3e7f('0x34')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x3e7f('0x7e'));}if(_0xcfdcf7[_0x3e7f('0x12')])_0x3605a8[_0x3e7f('0x12')](_0xcfdcf7['limit']);if(_0xcfdcf7[_0x3e7f('0x14')])_0x3605a8[_0x3e7f('0x14')](_0xcfdcf7[_0x3e7f('0x14')]);return db[_0x3e7f('0x72')][_0x3e7f('0x28')](_0x3605a8['toString'](),_0x898aa2);});})[_0x3e7f('0x17')](function(_0x2d8fde){_0x2d8fde[_0x3e7f('0x46')](function(_0x35af85){if(_0x35af85[_0x3e7f('0x7e')]){_0x35af85[_0x3e7f('0x7f')]=[];_0x35af85['TagIds'][_0x3e7f('0x80')](',')[_0x3e7f('0x46')](function(_0x51b805){_0x35af85[_0x3e7f('0x7f')][_0x3e7f('0x23')](_0x40f8fe[_0x51b805]);});}delete _0x35af85['TagIds'];});_0xed064f[_0x3e7f('0x81')]=_0x2d8fde;return _0xed064f;})[_0x3e7f('0x17')](respondWithFilteredResult(_0x38a392,_0xcfdcf7));})[_0x3e7f('0x82')](handleError(_0x38a392,null));};exports['destroy']=function(_0xa875f,_0x2c3c21){return db['CmContact'][_0x3e7f('0x83')]({'where':{'id':_0xa875f['params']['id']}})[_0x3e7f('0x17')](handleEntityNotFound(_0x2c3c21,null))['then'](removeEntity(_0x2c3c21,null))[_0x3e7f('0x82')](handleError(_0x2c3c21,null));};exports[_0x3e7f('0x84')]=function(_0x173e36,_0x5dbd92){return db[_0x3e7f('0x75')][_0x3e7f('0x84')]()[_0x3e7f('0x17')](function(_0x24ea5d){delete _0x24ea5d[_0x3e7f('0x85')];for(var _0x490e05=0x0;_0x490e05<Object['keys'](_0x24ea5d)[_0x3e7f('0x21')];_0x490e05++){var _0x208415=Object[_0x3e7f('0x20')](_0x24ea5d)[_0x490e05];if(!_[_0x3e7f('0x86')](_0x208415,_0x3e7f('0x22'))){_0x24ea5d[_0x208415][_0x3e7f('0x87')]=_0x208415;_0x24ea5d[_0x208415][_0x3e7f('0x88')]=_0x208415;}}return _0x24ea5d;})[_0x3e7f('0x17')](function(_0x1da7da){var _0x19980e={'where':Boolean(_0x173e36[_0x3e7f('0x28')]['analytics'])===!![]?undefined:{'$or':[{'ListId':_0x173e36['query']['id']},{'ListId':null}]},'raw':!![]};return db[_0x3e7f('0x24')][_0x3e7f('0x89')](_0x19980e)[_0x3e7f('0x17')](function(_0x31e56b){for(var _0x409212=0x0;_0x409212<_0x31e56b[_0x3e7f('0x21')];_0x409212++){var _0x33a667=_0x3e7f('0x22')+_0x31e56b[_0x409212]['id'];_0x1da7da[_0x33a667][_0x3e7f('0x87')]=_0x33a667;_0x1da7da[_0x33a667][_0x3e7f('0x88')]=_0x31e56b[_0x409212][_0x3e7f('0x8a')];_0x1da7da[_0x33a667][_0x3e7f('0x8b')]={'type':_0x31e56b[_0x409212][_0x3e7f('0x27')],'values':_0x31e56b[_0x409212][_0x3e7f('0x8c')]};}Object[_0x3e7f('0x20')](_0x1da7da)[_0x3e7f('0x46')](function(_0xa67d1f){if(!_0x1da7da[_0xa67d1f]['hasOwnProperty'](_0x3e7f('0x87'))){delete _0x1da7da[_0xa67d1f];}});return _0x1da7da;});})[_0x3e7f('0x17')](respondWithResult(_0x5dbd92,null))[_0x3e7f('0x82')](handleError(_0x5dbd92,null));};exports['merge']=function(_0x5f45f7,_0x295a88){var _0x24fb28;var _0x21fbe5;var _0xf25340;if(_0x5f45f7[_0x3e7f('0x8d')]['id']){delete _0x5f45f7[_0x3e7f('0x8d')]['id'];}return db[_0x3e7f('0x75')][_0x3e7f('0x89')]({'where':{'id':[_0x5f45f7[_0x3e7f('0x8d')]['to'],_0x5f45f7['body']['from']]}})[_0x3e7f('0x17')](function(_0x4ec6b9){if(_0x4ec6b9){if(_0x4ec6b9[_0x3e7f('0x21')]!==0x2){return null;}_0x4ec6b9[0x0]=_0x4ec6b9[0x0][_0x3e7f('0x8e')]({'plain':!![]});_0x4ec6b9[0x1]=_0x4ec6b9[0x1][_0x3e7f('0x8e')]({'plain':!![]});delete _0x4ec6b9[0x0]['id'];delete _0x4ec6b9[0x1]['id'];return _[_0x3e7f('0x8f')](_0x4ec6b9[0x0],_0x4ec6b9[0x1],function(_0x3ca917,_0x45a840){if(Array['isArray'](_0x45a840)&&!_0x45a840[_0x3e7f('0x21')]){return _0x3ca917;}else if(!_0x45a840){return _0x3ca917;}});}})['then'](handleEntityNotFound(_0x295a88,null))['then'](function(_0x4f6279){if(_0x4f6279){if(_0x4f6279[_0x3e7f('0x85')]&&_[_0x3e7f('0x59')](_0x4f6279[_0x3e7f('0x85')])){_0x4f6279[_0x3e7f('0x85')]=_0x4f6279[_0x3e7f('0x85')][_0x3e7f('0x90')]();}logger[_0x3e7f('0x91')](_0x3e7f('0x92'),_0x5f45f7[_0x3e7f('0x8d')]['to'],_0x5f45f7[_0x3e7f('0x8d')][_0x3e7f('0x38')]);return db['CmHopper'][_0x3e7f('0x18')]({'where':{'ContactId':[_0x5f45f7['body']['to'],_0x5f45f7[_0x3e7f('0x8d')][_0x3e7f('0x38')]]}})['then'](function(_0x439993){logger['info'](_0x3e7f('0x93'),_0x439993);return db[_0x3e7f('0x94')][_0x3e7f('0x18')]({'where':{'ContactId':[_0x5f45f7[_0x3e7f('0x8d')]['to'],_0x5f45f7[_0x3e7f('0x8d')][_0x3e7f('0x38')]]}})['then'](function(_0x37d01d){logger[_0x3e7f('0x91')](_0x3e7f('0x95'),_0x37d01d);return db['CmContact'][_0x3e7f('0x96')](_0x4f6279);});});}})[_0x3e7f('0x17')](function(_0x3b463d){if(_0x3b463d){_0x24fb28=_0x3b463d;_0x21fbe5={'ContactId':_0x24fb28['id']};_0xf25340={'where':{'ContactId':[_0x5f45f7[_0x3e7f('0x8d')]['to'],_0x5f45f7[_0x3e7f('0x8d')][_0x3e7f('0x38')]]}};return db['ChatInteraction'][_0x3e7f('0x16')](_0x21fbe5,_0xf25340);}})[_0x3e7f('0x17')](function(){if(_0x24fb28){return db[_0x3e7f('0x97')][_0x3e7f('0x16')](_0x21fbe5,_0xf25340);}})[_0x3e7f('0x17')](function(){if(_0x24fb28){return db[_0x3e7f('0x98')]['update'](_0x21fbe5,_0xf25340);}})[_0x3e7f('0x17')](function(){if(_0x24fb28){return db['MailInteraction'][_0x3e7f('0x16')](_0x21fbe5,_0xf25340);}})[_0x3e7f('0x17')](function(){if(_0x24fb28){return db[_0x3e7f('0x99')]['update'](_0x21fbe5,_0xf25340);}})[_0x3e7f('0x17')](function(){if(_0x24fb28){return db['MailInteraction'][_0x3e7f('0x16')](_0x21fbe5,_0xf25340);}})['then'](function(){if(_0x24fb28){return db[_0x3e7f('0x99')][_0x3e7f('0x16')](_0x21fbe5,_0xf25340);}})[_0x3e7f('0x17')](function(){if(_0x24fb28){return db['SmsInteraction'][_0x3e7f('0x16')](_0x21fbe5,_0xf25340);}})[_0x3e7f('0x17')](function(){if(_0x24fb28){return db[_0x3e7f('0x9a')][_0x3e7f('0x16')](_0x21fbe5,_0xf25340);}})[_0x3e7f('0x17')](function(){if(_0x24fb28){return db[_0x3e7f('0x9b')][_0x3e7f('0x16')](_0x21fbe5,_0xf25340);}})[_0x3e7f('0x17')](function(){if(_0x24fb28){return db['FaxMessage']['update'](_0x21fbe5,_0xf25340);}})['then'](function(){if(_0x24fb28){return db[_0x3e7f('0x9c')]['update'](_0x21fbe5,_0xf25340);}})[_0x3e7f('0x17')](function(){if(_0x24fb28){return db[_0x3e7f('0x9d')]['update'](_0x21fbe5,_0xf25340);}})[_0x3e7f('0x17')](function(){if(_0x24fb28){return db[_0x3e7f('0x9e')][_0x3e7f('0x16')](_0x21fbe5,_0xf25340);}})[_0x3e7f('0x17')](function(){if(_0x24fb28){return db[_0x3e7f('0x9f')][_0x3e7f('0x16')](_0x21fbe5,_0xf25340);}})[_0x3e7f('0x17')](function(){if(_0x24fb28){return db[_0x3e7f('0xa0')][_0x3e7f('0x16')](_0x21fbe5,_0xf25340);}})[_0x3e7f('0x17')](function(){if(_0x24fb28){return db['VoiceCallReport'][_0x3e7f('0x16')](_0x21fbe5,_0xf25340);}})['then'](function(){if(_0x24fb28){return db[_0x3e7f('0xa1')]['update'](_0x21fbe5,_0xf25340);}})[_0x3e7f('0x17')](function(){if(_0x24fb28){return db['FaxQueueReport'][_0x3e7f('0x16')](_0x21fbe5,_0xf25340);}})[_0x3e7f('0x17')](function(){if(_0x24fb28){return db['MailQueueReport'][_0x3e7f('0x16')](_0x21fbe5,_0xf25340);}})[_0x3e7f('0x17')](function(){if(_0x24fb28){return db[_0x3e7f('0xa2')]['update'](_0x21fbe5,_0xf25340);}})[_0x3e7f('0x17')](function(){if(_0x24fb28){return db['SmsQueueReport'][_0x3e7f('0x16')](_0x21fbe5,_0xf25340);}})[_0x3e7f('0x17')](function(){if(_0x24fb28){return db[_0x3e7f('0xa3')][_0x3e7f('0x16')](_0x21fbe5,_0xf25340);}})[_0x3e7f('0x17')](function(){if(_0x24fb28){return db[_0x3e7f('0xa4')][_0x3e7f('0x16')](_0x21fbe5,_0xf25340);}})['then'](function(){if(_0x24fb28){return db[_0x3e7f('0xa5')]['update'](_0x21fbe5,_0xf25340);}})[_0x3e7f('0x17')](function(){if(_0x24fb28){return db[_0x3e7f('0xa6')][_0x3e7f('0x16')](_0x21fbe5,_0xf25340);}})['then'](function(){if(_0x24fb28){return db['CmContact'][_0x3e7f('0x18')]({'where':{'id':[_0x5f45f7[_0x3e7f('0x8d')]['to'],_0x5f45f7[_0x3e7f('0x8d')][_0x3e7f('0x38')]]}});}})['then'](function(){if(_0x24fb28){return _0x24fb28;}})['then'](respondWithResult(_0x295a88,null))[_0x3e7f('0x82')](handleError(_0x295a88,null));};exports['create']=function(_0x4f63cb,_0x1727e1){return db[_0x3e7f('0x75')][_0x3e7f('0x84')]()['then'](function(_0x13ca4c){if(_0x4f63cb[_0x3e7f('0x8d')][_0x3e7f('0x85')]&&_['isArray'](_0x4f63cb[_0x3e7f('0x8d')][_0x3e7f('0x85')])){if(_0x4f63cb[_0x3e7f('0x8d')][_0x3e7f('0x85')]['length']){_0x4f63cb['body'][_0x3e7f('0x85')]=_0x4f63cb[_0x3e7f('0x8d')][_0x3e7f('0x85')]['join'](';')+';';}else{_0x4f63cb[_0x3e7f('0x8d')]['tags']=null;}}else{_0x4f63cb[_0x3e7f('0x8d')][_0x3e7f('0x85')]=null;}return db[_0x3e7f('0x75')][_0x3e7f('0x96')](_0x4f63cb[_0x3e7f('0x8d')],{'fields':_['keys'](_0x13ca4c),'raw':!![]});})[_0x3e7f('0x17')](respondWithResult(_0x1727e1,0xc9))[_0x3e7f('0x82')](handleError(_0x1727e1,null));};exports[_0x3e7f('0xa7')]=function(_0x2098b5,_0x8de6a2){var _0x69c42a=0x0;var _0x4f6a6b=0x0;var _0x58a13b=0x0;return db[_0x3e7f('0x75')][_0x3e7f('0x84')]()['then'](function(_0x32f204){return BPromise['each'](_0x2098b5[_0x3e7f('0x8d')],function(_0x399879){var _0x34346b={'where':{'$or':[]},'defaults':_0x399879,'fields':_[_0x3e7f('0x20')](_0x32f204),'raw':!![]};if(_0x399879[_0x3e7f('0xa8')]){for(var _0xfe3cbb=0x0;_0xfe3cbb<_0x399879[_0x3e7f('0xa8')]['length'];_0xfe3cbb++){var _0x334a5f={};_0x334a5f[_0x399879[_0x3e7f('0xa8')][_0xfe3cbb]]=_0x399879[_0x399879['duplicates'][_0xfe3cbb]];_0x34346b['where']['$or'][_0x3e7f('0x23')](_0x334a5f);}_0x34346b['where'][_0x3e7f('0x56')]=_0x399879[_0x3e7f('0x56')];}return db[_0x3e7f('0x75')][_0x3e7f('0xa9')](_0x34346b)[_0x3e7f('0xaa')](function(_0x59e2dc,_0x265d76){if(_0x265d76){_0x69c42a++;}else{_0x58a13b++;}})[_0x3e7f('0x82')](function(){_0x4f6a6b++;});});})[_0x3e7f('0x17')](function(_0x5cb7c9){if(_0x5cb7c9){return{'success':_0x69c42a,'failure':_0x4f6a6b,'duplicates':_0x58a13b};}})[_0x3e7f('0x17')](respondWithResult(_0x8de6a2,0xc9))[_0x3e7f('0x82')](handleError(_0x8de6a2,null));};exports[_0x3e7f('0xab')]=function(_0x457790,_0x13c07d){var _0x3ab973;return db['CmContact'][_0x3e7f('0x84')]()[_0x3e7f('0x17')](function(_0x3cf8ad){return db[_0x3e7f('0x75')][_0x3e7f('0x83')]({'where':{'id':_0x457790['params']['id']},'include':[{'model':db['Tag'],'as':'Tags','attributes':['id',_0x3e7f('0x1d'),_0x3e7f('0x35')],'required':_0x457790[_0x3e7f('0x28')][_0x3e7f('0x5a')]?!![]:![]}],'attributes':_['keys'](_0x3cf8ad)});})[_0x3e7f('0x17')](function(_0x309343){if(!_[_0x3e7f('0x53')](_0x309343)){_0x3ab973=_0x309343[_0x3e7f('0x8e')]({'plain':!![]});var _0x51e0f2={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x309343&&_0x309343[_0x3e7f('0x56')]){if(_0x309343[_0x3e7f('0x56')]){_0x51e0f2[_0x3e7f('0x32')]['$and'][_0x3e7f('0x23')]({'ListId':{'$ne':_0x309343[_0x3e7f('0x56')]}});}}return db['CmCustomField'][_0x3e7f('0x89')](_0x51e0f2);}})['then'](function(_0x25ceb9){if(!_['isNil'](_0x25ceb9)){return _[_0x3e7f('0xac')](_0x3ab973,_['map'](_0x25ceb9,function(_0x552c6e){return util['format']('cf_%d',_0x552c6e['id']);}));}})['then'](handleEntityNotFound(_0x13c07d,null))['then'](respondWithResult(_0x13c07d,null))[_0x3e7f('0x82')](handleError(_0x13c07d,null));};exports[_0x3e7f('0x16')]=function(_0x11dac0,_0x475e3e){var _0x2a09ce;if(_0x11dac0[_0x3e7f('0x8d')]['id']){delete _0x11dac0[_0x3e7f('0x8d')]['id'];}return db[_0x3e7f('0x75')][_0x3e7f('0x83')]({'where':{'id':_0x11dac0[_0x3e7f('0xad')]['id']}})[_0x3e7f('0x17')](handleEntityNotFound(_0x475e3e,null))[_0x3e7f('0x17')](saveUpdates(_0x11dac0[_0x3e7f('0x8d')],null))[_0x3e7f('0x17')](function(_0x3cd068){_0x2a09ce=_0x3cd068;var _0x1cec2a={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x3cd068&&_0x3cd068[_0x3e7f('0x56')]){if(_0x3cd068[_0x3e7f('0x56')]){_0x1cec2a[_0x3e7f('0x32')][_0x3e7f('0xae')][_0x3e7f('0x23')]({'ListId':{'$ne':_0x3cd068[_0x3e7f('0x56')]}});}}return db['CmCustomField']['findAll'](_0x1cec2a);})[_0x3e7f('0x17')](function(_0x2efade){if(_0x2efade){return _[_0x3e7f('0xac')](_[_0x3e7f('0xaf')](_0x11dac0['body'],function(_0x2d9121,_0x126bbb){return _[_0x3e7f('0x86')](_0x126bbb,_0x3e7f('0x22'));}),_[_0x3e7f('0x45')](_0x2efade,function(_0x5b789e){return util['format']('cf_%d',_0x5b789e['id']);}));}})[_0x3e7f('0x17')](function(_0x157734){if(_0x157734&&!_[_0x3e7f('0x55')](_0x157734)){var _0x159363=squel['update']()[_0x3e7f('0xb0')](_0x3e7f('0x39'))[_0x3e7f('0xb1')](_0x157734)[_0x3e7f('0x32')](_0x3e7f('0xb2'),_0x11dac0[_0x3e7f('0xad')]['id'])[_0x3e7f('0xb3')]();return db[_0x3e7f('0x72')][_0x3e7f('0x28')](_0x159363[_0x3e7f('0x50')],{'replacements':_0x159363[_0x3e7f('0x8c')]});}})[_0x3e7f('0x17')](function(){if(_0x11dac0[_0x3e7f('0x8d')]['phone']&&_0x2a09ce){return db[_0x3e7f('0xb4')]['update']({'phone':_0x11dac0['body']['phone']},{'where':{'ContactId':_0x2a09ce['id']}});}})[_0x3e7f('0x17')](function(){return _0x2a09ce;})[_0x3e7f('0x17')](respondWithResult(_0x475e3e,null))[_0x3e7f('0x82')](handleError(_0x475e3e,null));};exports[_0x3e7f('0xb5')]=function(_0x1f804f,_0x3fb97a){var _0x3f2eae={};var _0x30b6c8={};var _0x573e3a;var _0x43292d;return db[_0x3e7f('0x75')][_0x3e7f('0xb6')]({'where':{'id':_0x1f804f['params']['id']}})['then'](handleEntityNotFound(_0x3fb97a,null))[_0x3e7f('0x17')](function(_0x39ec3c){if(_0x39ec3c){_0x573e3a=_0x39ec3c;_0x30b6c8[_0x3e7f('0x2b')]=_[_0x3e7f('0x20')](db[_0x3e7f('0x44')]['rawAttributes']);_0x30b6c8['query']=_[_0x3e7f('0x20')](_0x1f804f[_0x3e7f('0x28')]);_0x30b6c8[_0x3e7f('0x29')]=_['intersection'](_0x30b6c8[_0x3e7f('0x2b')],_0x30b6c8[_0x3e7f('0x28')]);_0x3f2eae['attributes']=_['intersection'](_0x30b6c8[_0x3e7f('0x2b')],qs[_0x3e7f('0x2d')](_0x1f804f[_0x3e7f('0x28')][_0x3e7f('0x2d')]));_0x3f2eae[_0x3e7f('0x2c')]=_0x3f2eae[_0x3e7f('0x2c')][_0x3e7f('0x21')]?_0x3f2eae[_0x3e7f('0x2c')]:_0x30b6c8['model'];_0x3f2eae['order']=qs[_0x3e7f('0x31')](_0x1f804f[_0x3e7f('0x28')]['sort']);_0x3f2eae['where']=qs[_0x3e7f('0x29')](_[_0x3e7f('0x33')](_0x1f804f[_0x3e7f('0x28')],_0x30b6c8[_0x3e7f('0x29')]));if(_0x1f804f['query'][_0x3e7f('0x52')]){_0x3f2eae[_0x3e7f('0x32')]=_[_0x3e7f('0x74')](_0x3f2eae[_0x3e7f('0x32')],{'$or':_[_0x3e7f('0x45')](_0x3f2eae[_0x3e7f('0x2c')],function(_0x41eb83){var _0x39a6f7={};_0x39a6f7[_0x41eb83]={'$like':'%'+_0x1f804f[_0x3e7f('0x28')][_0x3e7f('0x52')]+'%'};return _0x39a6f7;})});}_0x3f2eae=_[_0x3e7f('0x74')]({},_0x3f2eae,_0x1f804f[_0x3e7f('0xb7')]);return _0x573e3a[_0x3e7f('0xb5')](_0x3f2eae);}})[_0x3e7f('0x17')](function(_0x1485c4){if(_0x1485c4){_0x43292d=_0x1485c4[_0x3e7f('0x21')];if(!_0x1f804f[_0x3e7f('0x28')][_0x3e7f('0x2e')](_0x3e7f('0x2f'))){_0x3f2eae[_0x3e7f('0x12')]=qs[_0x3e7f('0x12')](_0x1f804f[_0x3e7f('0x28')][_0x3e7f('0x12')]);_0x3f2eae[_0x3e7f('0x14')]=qs[_0x3e7f('0x14')](_0x1f804f['query'][_0x3e7f('0x14')]);}return _0x573e3a['getTags'](_0x3f2eae);}})[_0x3e7f('0x17')](function(_0x4d0e9c){if(_0x4d0e9c){return _0x4d0e9c?{'count':_0x43292d,'rows':_0x4d0e9c}:null;}})[_0x3e7f('0x17')](respondWithResult(_0x3fb97a,null))[_0x3e7f('0x82')](handleError(_0x3fb97a,null));};exports[_0x3e7f('0xb8')]=function(_0x8b7e42,_0x5aec4e){if(_0x8b7e42['body']['id']){delete _0x8b7e42[_0x3e7f('0x8d')]['id'];}return db[_0x3e7f('0x75')]['findOne']({'where':{'id':_0x8b7e42['params']['id']}})[_0x3e7f('0x17')](handleEntityNotFound(_0x5aec4e,null))[_0x3e7f('0x17')](function(_0x2cf377){if(_0x2cf377){return _0x2cf377['setTags'](_0x8b7e42[_0x3e7f('0x8d')][_0x3e7f('0xb9')]||[]);}return null;})[_0x3e7f('0x17')](respondWithResult(_0x5aec4e,null))[_0x3e7f('0x82')](handleError(_0x5aec4e,null));};exports[_0x3e7f('0xba')]=function(_0x33bacc,_0x2c2859){var _0x133e89={'raw':![],'where':{}};var _0x5edf1e={};var _0x4f8795={'count':0x0,'rows':[]};return db[_0x3e7f('0x75')][_0x3e7f('0xb6')]({'where':{'id':_0x33bacc[_0x3e7f('0xad')]['id']}})[_0x3e7f('0x17')](handleEntityNotFound(_0x2c2859,null))['then'](function(_0x4fdc9b){if(_0x4fdc9b){_0x5edf1e[_0x3e7f('0x2b')]=_[_0x3e7f('0x20')](db[_0x3e7f('0xb4')]['rawAttributes']);_0x5edf1e[_0x3e7f('0x28')]=_['keys'](_0x33bacc[_0x3e7f('0x28')]);_0x5edf1e[_0x3e7f('0x29')]=_[_0x3e7f('0x2a')](_0x5edf1e[_0x3e7f('0x2b')],_0x5edf1e[_0x3e7f('0x28')]);_0x133e89['attributes']=_[_0x3e7f('0x2a')](_0x5edf1e[_0x3e7f('0x2b')],qs[_0x3e7f('0x2d')](_0x33bacc['query'][_0x3e7f('0x2d')]));_0x133e89[_0x3e7f('0x2c')]=_0x133e89['attributes'][_0x3e7f('0x21')]?_0x133e89[_0x3e7f('0x2c')]:_0x5edf1e['model'];if(!_0x33bacc['query']['hasOwnProperty']('nolimit')){_0x133e89[_0x3e7f('0x12')]=qs['limit'](_0x33bacc[_0x3e7f('0x28')]['limit']);_0x133e89[_0x3e7f('0x14')]=qs[_0x3e7f('0x14')](_0x33bacc['query'][_0x3e7f('0x14')]);}_0x133e89[_0x3e7f('0x30')]=qs[_0x3e7f('0x31')](_0x33bacc[_0x3e7f('0x28')]['sort']);_0x133e89[_0x3e7f('0x32')]=qs[_0x3e7f('0x29')](_[_0x3e7f('0x33')](_0x33bacc[_0x3e7f('0x28')],_0x5edf1e['filters']));_0x133e89['where'][_0x3e7f('0xbb')]=_0x4fdc9b['id'];if(_0x33bacc[_0x3e7f('0x28')][_0x3e7f('0x52')]){_0x133e89[_0x3e7f('0x32')]=_[_0x3e7f('0x74')](_0x133e89[_0x3e7f('0x32')],{'$or':_['map'](_0x133e89[_0x3e7f('0x2c')],function(_0x43fe3a){var _0x14fb01={};_0x14fb01[_0x43fe3a]={'$like':'%'+_0x33bacc[_0x3e7f('0x28')][_0x3e7f('0x52')]+'%'};return _0x14fb01;})});}_0x133e89=_[_0x3e7f('0x74')]({},_0x133e89,_0x33bacc[_0x3e7f('0xb7')]);return db[_0x3e7f('0xb4')][_0x3e7f('0x13')]({'where':_0x133e89[_0x3e7f('0x32')]})[_0x3e7f('0x17')](function(_0xa4fce8){_0x4f8795[_0x3e7f('0x13')]=_0xa4fce8;if(_0x33bacc[_0x3e7f('0x28')]['includeAll']){_0x133e89['include']=[{'all':!![]}];}return db[_0x3e7f('0xb4')][_0x3e7f('0x89')](_0x133e89);})['then'](function(_0x5e419d){_0x4f8795[_0x3e7f('0x81')]=_0x5e419d;return _0x4f8795;});}})[_0x3e7f('0x17')](respondWithFilteredResult(_0x2c2859,_0x133e89))[_0x3e7f('0x82')](handleError(_0x2c2859,null));};exports['getHopperHistories']=function(_0x3d499d,_0xfdcc75){var _0x259256={'raw':!![],'where':{}};var _0x1e082f={};var _0x165e7c={'count':0x0,'rows':[]};return db[_0x3e7f('0x75')][_0x3e7f('0xb6')]({'where':{'id':_0x3d499d[_0x3e7f('0xad')]['id']}})[_0x3e7f('0x17')](handleEntityNotFound(_0xfdcc75,null))[_0x3e7f('0x17')](function(_0x3c3377){if(_0x3c3377){_0x1e082f[_0x3e7f('0x2b')]=_['keys'](db['CmHopperHistory'][_0x3e7f('0xbc')]);_0x1e082f['query']=_[_0x3e7f('0x20')](_0x3d499d[_0x3e7f('0x28')]);_0x1e082f['filters']=_[_0x3e7f('0x2a')](_0x1e082f[_0x3e7f('0x2b')],_0x1e082f[_0x3e7f('0x28')]);_0x259256[_0x3e7f('0x2c')]=_['intersection'](_0x1e082f[_0x3e7f('0x2b')],qs[_0x3e7f('0x2d')](_0x3d499d['query'][_0x3e7f('0x2d')]));_0x259256['attributes']=_0x259256[_0x3e7f('0x2c')][_0x3e7f('0x21')]?_0x259256[_0x3e7f('0x2c')]:_0x1e082f[_0x3e7f('0x2b')];if(!_0x3d499d[_0x3e7f('0x28')][_0x3e7f('0x2e')]('nolimit')){_0x259256[_0x3e7f('0x12')]=qs[_0x3e7f('0x12')](_0x3d499d[_0x3e7f('0x28')][_0x3e7f('0x12')]);_0x259256[_0x3e7f('0x14')]=qs['offset'](_0x3d499d[_0x3e7f('0x28')][_0x3e7f('0x14')]);}_0x259256[_0x3e7f('0x30')]=qs[_0x3e7f('0x31')](_0x3d499d[_0x3e7f('0x28')][_0x3e7f('0x31')]);_0x259256['where']=qs[_0x3e7f('0x29')](_[_0x3e7f('0x33')](_0x3d499d[_0x3e7f('0x28')],_0x1e082f[_0x3e7f('0x29')]));_0x259256[_0x3e7f('0x32')][_0x3e7f('0xbb')]=_0x3c3377['id'];if(_0x3d499d[_0x3e7f('0x28')][_0x3e7f('0x52')]){_0x259256['where']=_[_0x3e7f('0x74')](_0x259256[_0x3e7f('0x32')],{'$or':_['map'](_0x259256[_0x3e7f('0x2c')],function(_0x53bc13){var _0x246c29={};_0x246c29[_0x53bc13]={'$like':'%'+_0x3d499d[_0x3e7f('0x28')][_0x3e7f('0x52')]+'%'};return _0x246c29;})});}_0x259256=_['merge']({},_0x259256,_0x3d499d[_0x3e7f('0xb7')]);return db['CmHopperHistory']['count']({'where':_0x259256[_0x3e7f('0x32')]})[_0x3e7f('0x17')](function(_0x1def13){_0x165e7c['count']=_0x1def13;if(_0x3d499d['query'][_0x3e7f('0xbd')]){_0x259256[_0x3e7f('0xbe')]=[{'all':!![]}];}return db[_0x3e7f('0x9f')]['findAll'](_0x259256);})[_0x3e7f('0x17')](function(_0x4006b4){_0x165e7c['rows']=_0x4006b4;return _0x165e7c;});}})[_0x3e7f('0x17')](respondWithFilteredResult(_0xfdcc75,_0x259256))[_0x3e7f('0x82')](handleError(_0xfdcc75,null));};exports[_0x3e7f('0xbf')]=function(_0x14a985,_0x5c5229){var _0x52f2f2={'raw':!![],'where':{}};var _0x490384={};var _0x575c38={'count':0x0,'rows':[]};return db[_0x3e7f('0x75')]['findOne']({'where':{'id':_0x14a985[_0x3e7f('0xad')]['id']}})[_0x3e7f('0x17')](handleEntityNotFound(_0x5c5229,null))[_0x3e7f('0x17')](function(_0x5835d8){if(_0x5835d8){_0x490384[_0x3e7f('0x2b')]=_[_0x3e7f('0x20')](db[_0x3e7f('0x9e')][_0x3e7f('0xbc')]);_0x490384[_0x3e7f('0x28')]=_['keys'](_0x14a985['query']);_0x490384[_0x3e7f('0x29')]=_[_0x3e7f('0x2a')](_0x490384[_0x3e7f('0x2b')],_0x490384[_0x3e7f('0x28')]);_0x52f2f2[_0x3e7f('0x2c')]=_[_0x3e7f('0x2a')](_0x490384[_0x3e7f('0x2b')],qs['fields'](_0x14a985['query'][_0x3e7f('0x2d')]));_0x52f2f2[_0x3e7f('0x2c')]=_0x52f2f2[_0x3e7f('0x2c')]['length']?_0x52f2f2[_0x3e7f('0x2c')]:_0x490384[_0x3e7f('0x2b')];if(!_0x14a985[_0x3e7f('0x28')][_0x3e7f('0x2e')]('nolimit')){_0x52f2f2[_0x3e7f('0x12')]=qs[_0x3e7f('0x12')](_0x14a985[_0x3e7f('0x28')]['limit']);_0x52f2f2[_0x3e7f('0x14')]=qs['offset'](_0x14a985[_0x3e7f('0x28')][_0x3e7f('0x14')]);}_0x52f2f2['order']=qs['sort'](_0x14a985[_0x3e7f('0x28')]['sort']);_0x52f2f2[_0x3e7f('0x32')]=qs[_0x3e7f('0x29')](_[_0x3e7f('0x33')](_0x14a985['query'],_0x490384[_0x3e7f('0x29')]));_0x52f2f2['where'][_0x3e7f('0xbb')]=_0x5835d8['id'];if(_0x14a985[_0x3e7f('0x28')][_0x3e7f('0x52')]){_0x52f2f2[_0x3e7f('0x32')]=_[_0x3e7f('0x74')](_0x52f2f2[_0x3e7f('0x32')],{'$or':_['map'](_0x52f2f2['attributes'],function(_0x50e0b7){var _0x10cdb6={};_0x10cdb6[_0x50e0b7]={'$like':'%'+_0x14a985[_0x3e7f('0x28')][_0x3e7f('0x52')]+'%'};return _0x10cdb6;})});}_0x52f2f2=_[_0x3e7f('0x74')]({},_0x52f2f2,_0x14a985[_0x3e7f('0xb7')]);return db[_0x3e7f('0x9e')][_0x3e7f('0x13')]({'where':_0x52f2f2[_0x3e7f('0x32')]})[_0x3e7f('0x17')](function(_0x566cbb){_0x575c38[_0x3e7f('0x13')]=_0x566cbb;if(_0x14a985[_0x3e7f('0x28')]['includeAll']){_0x52f2f2[_0x3e7f('0xbe')]=[{'all':!![]}];}return db[_0x3e7f('0x9e')][_0x3e7f('0x89')](_0x52f2f2);})[_0x3e7f('0x17')](function(_0x3f22cd){_0x575c38[_0x3e7f('0x81')]=_0x3f22cd;return _0x575c38;});}})[_0x3e7f('0x17')](respondWithFilteredResult(_0x5c5229,_0x52f2f2))['catch'](handleError(_0x5c5229,null));};exports[_0x3e7f('0xc0')]=function(_0x282c34,_0x13f85b){var _0x3bc275={'raw':!![],'where':{}};var _0x22fc94={};var _0x13eb31={'count':0x0,'rows':[]};return db[_0x3e7f('0x75')]['findOne']({'where':{'id':_0x282c34['params']['id']}})['then'](handleEntityNotFound(_0x13f85b,null))[_0x3e7f('0x17')](function(_0x4e57f8){if(_0x4e57f8){_0x22fc94[_0x3e7f('0x2b')]=_[_0x3e7f('0x20')](db[_0x3e7f('0xa3')]['rawAttributes']);_0x22fc94[_0x3e7f('0x28')]=_[_0x3e7f('0x20')](_0x282c34[_0x3e7f('0x28')]);_0x22fc94[_0x3e7f('0x29')]=_[_0x3e7f('0x2a')](_0x22fc94[_0x3e7f('0x2b')],_0x22fc94[_0x3e7f('0x28')]);_0x3bc275['attributes']=_[_0x3e7f('0x2a')](_0x22fc94['model'],qs[_0x3e7f('0x2d')](_0x282c34['query'][_0x3e7f('0x2d')]));_0x3bc275[_0x3e7f('0x2c')]=_0x3bc275[_0x3e7f('0x2c')][_0x3e7f('0x21')]?_0x3bc275[_0x3e7f('0x2c')]:_0x22fc94['model'];if(!_0x282c34['query'][_0x3e7f('0x2e')](_0x3e7f('0x2f'))){_0x3bc275[_0x3e7f('0x12')]=qs[_0x3e7f('0x12')](_0x282c34['query'][_0x3e7f('0x12')]);_0x3bc275[_0x3e7f('0x14')]=qs[_0x3e7f('0x14')](_0x282c34['query'][_0x3e7f('0x14')]);}_0x3bc275[_0x3e7f('0x30')]=qs[_0x3e7f('0x31')](_0x282c34['query'][_0x3e7f('0x31')]);_0x3bc275[_0x3e7f('0x32')]=qs['filters'](_[_0x3e7f('0x33')](_0x282c34[_0x3e7f('0x28')],_0x22fc94[_0x3e7f('0x29')]));_0x3bc275[_0x3e7f('0x32')][_0x3e7f('0xbb')]=_0x4e57f8['id'];if(_0x282c34[_0x3e7f('0x28')][_0x3e7f('0x52')]){_0x3bc275[_0x3e7f('0x32')]=_[_0x3e7f('0x74')](_0x3bc275[_0x3e7f('0x32')],{'$or':_['map'](_0x3bc275['attributes'],function(_0xc7b222){var _0x49b303={};_0x49b303[_0xc7b222]={'$like':'%'+_0x282c34[_0x3e7f('0x28')]['filter']+'%'};return _0x49b303;})});}_0x3bc275=_['merge']({},_0x3bc275,_0x282c34[_0x3e7f('0xb7')]);return db[_0x3e7f('0xa3')]['count']({'where':_0x3bc275[_0x3e7f('0x32')]})[_0x3e7f('0x17')](function(_0x2e1adf){_0x13eb31[_0x3e7f('0x13')]=_0x2e1adf;if(_0x282c34[_0x3e7f('0x28')]['includeAll']){_0x3bc275[_0x3e7f('0xbe')]=[{'all':!![]}];}return db[_0x3e7f('0xa3')][_0x3e7f('0x89')](_0x3bc275);})[_0x3e7f('0x17')](function(_0x25b59d){_0x13eb31[_0x3e7f('0x81')]=_0x25b59d;return _0x13eb31;});}})[_0x3e7f('0x17')](respondWithFilteredResult(_0x13f85b,_0x3bc275))[_0x3e7f('0x82')](handleError(_0x13f85b,null));};exports[_0x3e7f('0xc1')]=function(_0x44189f,_0x42c757){try{if(!_0x44189f['body']['ListId']){throw new Error(_0x3e7f('0xc2'));}if(!_0x44189f[_0x3e7f('0x8d')][_0x3e7f('0xc3')]){throw new Error(_0x3e7f('0xc4'));}if(!_0x44189f['body'][_0x3e7f('0xc5')]){throw new Error(_0x3e7f('0xc6'));}if(!_0x44189f['body'][_0x3e7f('0xc7')]){throw new Error(_0x3e7f('0xc8'));}var _0x449cc5=_0x44189f[_0x3e7f('0x8d')][_0x3e7f('0xc3')]['split'](',');var _0xe35ff7=_0x44189f[_0x3e7f('0x8d')][_0x3e7f('0xc5')]['split'](',');if(!_0x449cc5[_0x3e7f('0x21')]||!_0xe35ff7[_0x3e7f('0x21')]||_0x449cc5[_0x3e7f('0x21')]!==_0xe35ff7[_0x3e7f('0x21')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x44189f[_0x3e7f('0x8d')][_0x3e7f('0x2d')]=_[_0x3e7f('0xc9')](_0x449cc5,_0xe35ff7);if(!_0x44189f[_0x3e7f('0x8d')]['fields']['phone']){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x44189f['body']['fields']['firstName']){throw new Error(_0x3e7f('0xca'));}var _0xa0573a=path[_0x3e7f('0x90')](config['root'],_0x3e7f('0xcb'),_0x44189f['file'][_0x3e7f('0xcc')]);fs[_0x3e7f('0xcd')](_0xa0573a,parseInt(_0x3e7f('0xce'),0x8));var _0x2b9840=require(_0x3e7f('0xcf'))[_0x3e7f('0xd0')](path['join'](__dirname,_0x3e7f('0xd1')),[_0xa0573a,_0x44189f[_0x3e7f('0x8d')][_0x3e7f('0xc3')],_0x44189f['body'][_0x3e7f('0xc5')],_0x44189f[_0x3e7f('0x8d')]['ListId'],_0x44189f[_0x3e7f('0x8d')]['CompanyId'],_0x44189f[_0x3e7f('0x8d')]['duplicates'],_0x44189f[_0x3e7f('0x8d')]['socket_timestamp']]);return _0x42c757[_0x3e7f('0xf')](0xc8)[_0x3e7f('0x10')]({'message':_0x3e7f('0xd2'),'pid':_0x2b9840[_0x3e7f('0xd3')]});}catch(_0x28961f){return _0x42c757['status'](0x1f4)[_0x3e7f('0x1e')](_0x28961f);}};exports[_0x3e7f('0xd4')]=function(_0x1a3ade,_0x3530ea){var _0x3190af=fs[_0x3e7f('0xd5')](_0x1a3ade[_0x3e7f('0xd6')][_0x3e7f('0xd7')]);Papa['parse'](_0x3190af,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x39f93e){return _0x3530ea[_0x3e7f('0xf')](0xc8)['json']({'file':_0x1a3ade[_0x3e7f('0xd6')],'fields':_0x39f93e[_0x3e7f('0xd8')]['fields']});}});};exports['import']=function(_0x1ccdff,_0x490565){return db[_0x3e7f('0x49')][_0x3e7f('0x89')]({'raw':!![],'attributes':['id'],'where':{'role':_0x3e7f('0x6d')}})['then'](function(_0x428f0d){var _0x26318a=![];if(!_0x1ccdff[_0x3e7f('0x8d')][_0x3e7f('0x56')]){throw new Error(_0x3e7f('0xc2'));}if(!_0x1ccdff['body'][_0x3e7f('0xd9')][_0x3e7f('0xda')]){throw new Error(_0x3e7f('0xdb'));}if(!_0x1ccdff[_0x3e7f('0x8d')][_0x3e7f('0xd9')][_0x3e7f('0xdc')]){throw new Error(_0x3e7f('0xca'));}if(!_0x1ccdff['body'][_0x3e7f('0xc7')]){throw new Error(_0x3e7f('0xc8'));}var _0x310195=require(_0x3e7f('0xcf'))[_0x3e7f('0xd0')](path[_0x3e7f('0x90')](__dirname,_0x3e7f('0xdd')),[_0x1ccdff[_0x3e7f('0xad')]['id'],JSON[_0x3e7f('0xde')](_0x1ccdff[_0x3e7f('0x8d')]),JSON['stringify'](_0x428f0d)]);_0x310195['on'](_0x3e7f('0xdf'),function(){_0x26318a=!![];return _0x490565['status'](0xc8)[_0x3e7f('0x10')]({'message':_0x3e7f('0xe0'),'pid':_0x310195[_0x3e7f('0xd3')]});});_0x310195['on']('exit',function(_0x2ed53a){if(_0x2ed53a&&!_0x26318a){return _0x490565[_0x3e7f('0xf')](0x1f4)['json']({'message':'error\x20child\x20process','pid':_0x310195['pid']});}});})[_0x3e7f('0x82')](handleError(_0x490565,null));};exports[_0x3e7f('0xe1')]=function(_0x508286,_0x23c4a1){var _0x3ef3ea=[_0x3e7f('0xe2'),_0x3e7f('0xe3'),_0x3e7f('0xe4'),'openchannel','fax','whatsapp',_0x3e7f('0xe5')];var _0x432e90={'offset':0x0,'order':qs[_0x3e7f('0x31')]('-createdAt')},_0x845502={'count':0x0,'rows':[]};Promise[_0x3e7f('0x6b')]()[_0x3e7f('0x17')](function(){if(_0x508286[_0x3e7f('0x28')][_0x3e7f('0xe6')]){if(!_[_0x3e7f('0xe7')](_0x3ef3ea,_0x508286[_0x3e7f('0x28')][_0x3e7f('0xe6')][_0x3e7f('0xe8')]())){throw new Error('Invalid\x20channel');}_0x3ef3ea=[_0x508286[_0x3e7f('0x28')][_0x3e7f('0xe6')][_0x3e7f('0xe8')]()];}if(_0x508286[_0x3e7f('0x28')][_0x3e7f('0xe9')]){try{var _0x554dd3=JSON[_0x3e7f('0xea')](_0x508286[_0x3e7f('0x28')][_0x3e7f('0xe9')]);if(!moment(_0x554dd3[_0x3e7f('0x38')])[_0x3e7f('0xeb')]()){throw new Error(_0x3e7f('0xec'));}if(!moment(_0x554dd3['to'])[_0x3e7f('0xeb')]()){throw new Error(_0x3e7f('0xed'));}}catch(_0x866baa){throw new Error(_0x3e7f('0xee'));}}if(!_0x508286['query'][_0x3e7f('0x2e')](_0x3e7f('0x2f'))){_0x432e90[_0x3e7f('0x12')]=qs[_0x3e7f('0x12')](_0x508286[_0x3e7f('0x28')][_0x3e7f('0x12')]||0xa);_0x432e90['offset']=qs['offset'](_0x508286[_0x3e7f('0x28')][_0x3e7f('0x14')]);}var _0x49e9fd=_0x3ef3ea['map'](function(_0x48543b){if(_0x48543b===_0x3e7f('0xe5')){var _0xb9a03b={'attributes':['id','uniqueid',_0x3e7f('0x27'),_0x3e7f('0xef'),_0x3e7f('0xf0'),_0x3e7f('0xf1'),_0x3e7f('0xf2'),_0x3e7f('0xf3'),'duration',_0x3e7f('0xf4'),_0x3e7f('0xf5'),_0x3e7f('0xf6'),_0x3e7f('0xf7'),_0x3e7f('0xf8'),_0x3e7f('0xf9')],'where':{'ContactId':_0x508286[_0x3e7f('0xad')]['id']},'include':[{'model':db['User'],'as':_0x3e7f('0x49'),'attributes':['id',_0x3e7f('0x1d'),_0x3e7f('0xfa'),_0x3e7f('0x8a')]}],'order':[[_0x3e7f('0xf5'),_0x3e7f('0xfb')]]};if(_0x508286[_0x3e7f('0x28')]['range']){_0xb9a03b['where'][_0x3e7f('0xf5')]={'$gte':_0x554dd3[_0x3e7f('0x38')],'$lte':_0x554dd3['to']};}return db[_0x3e7f('0xfc')]['findAndCountAll'](_0xb9a03b)[_0x3e7f('0x17')](function(_0x171ae5){_0x845502[_0x3e7f('0x13')]+=_0x171ae5[_0x3e7f('0x13')];return _[_0x3e7f('0x45')](_0x171ae5[_0x3e7f('0x81')],function(_0x33ff5a){var _0xc488e0=_0x33ff5a[_0x3e7f('0x8e')]({'plain':!![]});_0xc488e0[_0x3e7f('0xe6')]=_0x48543b;if(_0xc488e0[_0x3e7f('0x49')]){_0xc488e0[_0x3e7f('0x49')]={'id':_0xc488e0[_0x3e7f('0x49')]['id'],'name':_0xc488e0['User']['name'],'fullname':_0xc488e0[_0x3e7f('0x49')][_0x3e7f('0xfa')],'alias':_0xc488e0['User']['alias']};}return _0xc488e0;});});}else{var _0x44078e=_[_0x3e7f('0xfd')](_0x48543b)+(_0x48543b===_0x3e7f('0xe3')?'Website':'Account');var _0x3635e3={'attributes':['id','closed',_0x3e7f('0xfe'),_0x3e7f('0xf5'),_0x3e7f('0xf4'),_0x3e7f('0xff'),_0x3e7f('0x100'),_0x3e7f('0x101'),'UserId',_0x44078e+'Id'],'where':{'ContactId':_0x508286[_0x3e7f('0xad')]['id']},'include':[{'model':db[_0x44078e],'as':'Account','attributes':['id',_0x3e7f('0x1d'),_0x3e7f('0x102')]},{'model':db['User'],'as':'Owner','attributes':['id','name','fullname']},{'model':db[_0x3e7f('0x44')],'as':_0x3e7f('0x7f'),'attributes':['id','name',_0x3e7f('0x35')],'through':{'attributes':[]}}],'order':[[_0x3e7f('0xf5'),_0x3e7f('0xfb')]]};if(_0x508286[_0x3e7f('0x28')][_0x3e7f('0xe9')]){_0x3635e3[_0x3e7f('0x32')][_0x3e7f('0xf5')]={'$gte':_0x554dd3[_0x3e7f('0x38')],'$lte':_0x554dd3['to']};}switch(_0x48543b){case _0x3e7f('0xe3'):_0x3635e3['attributes']['push'](_0x3e7f('0x103'),'customerIp',_0x3e7f('0x104'),_0x3e7f('0x105'),'osName',_0x3e7f('0x106'),_0x3e7f('0x107'),'ratingValue',_0x3e7f('0x108'));break;case _0x3e7f('0xe2'):_0x3635e3[_0x3e7f('0x2c')][_0x3e7f('0x23')](_0x3e7f('0x109'),_0x3e7f('0x10a'));break;case _0x3e7f('0x10b'):_0x3635e3[_0x3e7f('0x2c')][_0x3e7f('0x23')](_0x3e7f('0x10c'),_0x3e7f('0x10d'));break;}return db[_['startCase'](_0x48543b)+_0x3e7f('0x10e')]['findAndCountAll'](_0x3635e3)['then'](function(_0x4e9a1a){_0x845502[_0x3e7f('0x13')]+=_0x4e9a1a[_0x3e7f('0x13')];return _[_0x3e7f('0x45')](_0x4e9a1a[_0x3e7f('0x81')],function(_0x1c897d){var _0x899fa9=_0x1c897d[_0x3e7f('0x8e')]({'plain':!![]});_0x899fa9[_0x3e7f('0xe6')]=_0x48543b;if(_0x899fa9[_0x3e7f('0x10f')]){_0x899fa9[_0x3e7f('0x10f')]={'id':_0x899fa9[_0x3e7f('0x10f')]['id'],'name':_0x899fa9[_0x3e7f('0x10f')][_0x3e7f('0x1d')],'fullname':_0x899fa9[_0x3e7f('0x10f')]['fullname']};}return _0x899fa9;});});}});return Promise[_0x3e7f('0x110')](_0x49e9fd);})[_0x3e7f('0x17')](function(_0x36ee4e){return _(_0x36ee4e)[_0x3e7f('0x111')]()[_0x3e7f('0x112')](_0x3e7f('0xf5'))[_0x3e7f('0x113')]()['value']();})['then'](function(_0x443a11){_0x845502[_0x3e7f('0x81')]=_0x432e90[_0x3e7f('0x12')]?_0x443a11[_0x3e7f('0x114')](_0x432e90['offset'],_0x432e90['offset']+_0x432e90[_0x3e7f('0x12')]):_0x443a11;return _0x845502;})[_0x3e7f('0x17')](respondWithFilteredResult(_0x23c4a1,_0x432e90))[_0x3e7f('0x82')](handleError(_0x23c4a1,null));};
\ No newline at end of file
index 0217ec6..a1c7d6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6bf=['CmContact','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1892f2,_0x1cb5f7){var _0x5a8d75=function(_0x140028){while(--_0x140028){_0x1892f2['push'](_0x1892f2['shift']());}};_0x5a8d75(++_0x1cb5f7);}(_0xb6bf,0x17a));var _0xfb6b=function(_0x62b70f,_0x1c6f1e){_0x62b70f=_0x62b70f-0x0;var _0xe4b1e1=_0xb6bf[_0x62b70f];return _0xe4b1e1;};'use strict';var EventEmitter=require(_0xfb6b('0x0'));var CmContact=require(_0xfb6b('0x1'))['db'][_0xfb6b('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xfb6b('0x3')](0x0);var events={'afterCreate':_0xfb6b('0x4'),'afterUpdate':'update','afterDestroy':_0xfb6b('0x5')};function emitEvent(_0x3ca9c9){return function(_0x75ca88,_0x177e98,_0xae5299){CmContactEvents[_0xfb6b('0x6')](_0x3ca9c9+':'+_0x75ca88['id'],_0x75ca88);CmContactEvents[_0xfb6b('0x6')](_0x3ca9c9,_0x75ca88);_0xae5299(null);};}for(var e in events){if(events[_0xfb6b('0x7')](e)){var event=events[e];CmContact[_0xfb6b('0x8')](e,emitEvent(event));}}module[_0xfb6b('0x9')]=CmContactEvents;
\ No newline at end of file
+var _0x5928=['exports','events','../../mysqldb','CmContact','save','emit','hook'];(function(_0x24c239,_0xe76faa){var _0x1b342c=function(_0x33dfb8){while(--_0x33dfb8){_0x24c239['push'](_0x24c239['shift']());}};_0x1b342c(++_0xe76faa);}(_0x5928,0xc5));var _0x8592=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5928[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x8592('0x0'));var CmContact=require(_0x8592('0x1'))['db'][_0x8592('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8592('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x245e68){return function(_0x4a890f,_0x1a02e9,_0x438dfc){CmContactEvents['emit'](_0x245e68+':'+_0x4a890f['id'],_0x4a890f);CmContactEvents[_0x8592('0x4')](_0x245e68,_0x4a890f);_0x438dfc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0x8592('0x5')](e,emitEvent(event));}}module[_0x8592('0x6')]=CmContactEvents;
\ No newline at end of file
index e377fc9..4ad74fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c64=['request-promise','../../config/environment','./cmContact.attributes','exports','CmContact','cm_contacts','phone','fti_cm_contacts','lastName','mobile','email','FULLTEXT','utf8mb4_unicode_ci','models','error','cmContact','afterCreate','inspect','CmHopper','findOne','then','isNil','cmContact,\x20afterCreate\x20','create','ListId','priority','scheduledat','YYYY-MM-DD\x20HH:mm:ss','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','format','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','Lists','length','get','always','onlyIfOpen','VoiceQueue','BlackLists','message','Campaign','CmList','cmContact,\x20%s,\x20%s','List\x20not\x20found','isEmpty','destroy','VoiceQueueId','CampaignId','all','info','[CmContact][afterDestroy][Error]','lodash','util','api','moment','bluebird'];(function(_0x41ee16,_0xfa94c3){var _0x1f60de=function(_0x1c8ffc){while(--_0x1c8ffc){_0x41ee16['push'](_0x41ee16['shift']());}};_0x1f60de(++_0xfa94c3);}(_0x2c64,0x181));var _0x42c6=function(_0x30033a,_0x5ce4a6){_0x30033a=_0x30033a-0x0;var _0x5e3518=_0x2c64[_0x30033a];return _0x5e3518;};'use strict';var _=require(_0x42c6('0x0'));var util=require(_0x42c6('0x1'));var logger=require('../../config/logger')(_0x42c6('0x2'));var moment=require(_0x42c6('0x3'));var BPromise=require(_0x42c6('0x4'));var rp=require(_0x42c6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x42c6('0x6'));var attributes=require(_0x42c6('0x7'));module[_0x42c6('0x8')]=function(_0x56b317,_0x553bd9){return _0x56b317['define'](_0x42c6('0x9'),attributes,{'tableName':_0x42c6('0xa'),'paranoid':!![],'indexes':[{'name':_0x42c6('0xb'),'fields':[_0x42c6('0xb')]},{'name':_0x42c6('0xc'),'fields':['firstName',_0x42c6('0xd'),_0x42c6('0xb'),_0x42c6('0xe'),'fax',_0x42c6('0xf')],'type':_0x42c6('0x10')}],'timestamps':!![],'charset':'utf8mb4','collate':_0x42c6('0x11'),'hooks':{'afterCreate':function(_0x227a87,_0x10c00a,_0x1e69e2){var _0x427671=_0x56b317[_0x42c6('0x12')];var _0x14b490=_0x227a87['get']({'plain':!![]});function _0x9de7a1(){return function(_0x1e9287){logger[_0x42c6('0x13')](_0x42c6('0x14'),_0x42c6('0x15'),util[_0x42c6('0x16')](_0x1e9287,{'showHidden':![],'depth':null}));};}var _0x373598=function(_0x51a06c){return new BPromise(function(_0x376d62,_0x1a2863){_0x427671[_0x42c6('0x17')][_0x42c6('0x18')]({'where':{'phone':_0x14b490['phone'],'VoiceQueueId':_0x51a06c['id']}})[_0x42c6('0x19')](function(_0x4ee7e2){if(!_[_0x42c6('0x1a')](_0x4ee7e2)){throw new Error(_0x42c6('0x1b')+_0x14b490[_0x42c6('0xb')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x51a06c['id']);}return _0x427671[_0x42c6('0x17')][_0x42c6('0x1c')]({'phone':_0x14b490[_0x42c6('0xb')],'ContactId':_0x14b490['id'],'ListId':_0x14b490[_0x42c6('0x1d')],'priority':_0x14b490[_0x42c6('0x1e')]?_0x14b490[_0x42c6('0x1e')]:0x2,'scheduledat':_0x14b490[_0x42c6('0x1f')]?_0x14b490['scheduledat']:moment()['format'](_0x42c6('0x20')),'callback':_0x14b490[_0x42c6('0x21')]?!![]:![],'callbackuniqueid':_0x14b490[_0x42c6('0x21')]?_0x14b490[_0x42c6('0x21')]:undefined,'callbackat':_0x14b490['callbackUniqueid']?moment()['format'](_0x42c6('0x20')):undefined,'VoiceQueueId':_0x51a06c['id']});})[_0x42c6('0x22')](function(_0x4c2762){_0x1a2863(_0x4c2762);});});};var _0x95891e=function(_0x4cfc03){return new BPromise(function(_0x128d69,_0x18c809){_0x427671[_0x42c6('0x17')][_0x42c6('0x18')]({'where':{'phone':_0x14b490[_0x42c6('0xb')],'VoiceQueueId':_0x4cfc03['id']}})[_0x42c6('0x19')](function(_0x57dedd){if(!_[_0x42c6('0x1a')](_0x57dedd)){throw new Error(_0x42c6('0x1b')+_0x14b490[_0x42c6('0xb')]+_0x42c6('0x23')+_0x4cfc03['id']);}return _0x427671[_0x42c6('0x24')]['findOne']({'where':{'calleridnum':_0x14b490[_0x42c6('0xb')],'VoiceQueueId':_0x4cfc03['id']}});})[_0x42c6('0x19')](function(_0x1d9c11){if(!_[_0x42c6('0x1a')](_0x1d9c11)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x14b490[_0x42c6('0xb')]+_0x42c6('0x25')+_0x4cfc03['id']);}return _0x427671[_0x42c6('0x17')]['create']({'phone':_0x14b490[_0x42c6('0xb')],'ContactId':_0x14b490['id'],'ListId':_0x14b490['ListId'],'priority':_0x14b490[_0x42c6('0x1e')]?_0x14b490[_0x42c6('0x1e')]:0x2,'scheduledat':_0x14b490[_0x42c6('0x1f')]?_0x14b490[_0x42c6('0x1f')]:moment()[_0x42c6('0x26')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x14b490['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x14b490['callbackUniqueid']?_0x14b490[_0x42c6('0x21')]:undefined,'callbackat':_0x14b490[_0x42c6('0x21')]?moment()[_0x42c6('0x26')](_0x42c6('0x20')):undefined,'VoiceQueueId':_0x4cfc03['id']});})['catch'](function(_0x22de16){_0x18c809(_0x22de16);});});};function _0xe6d817(){return function(_0x522d14){logger[_0x42c6('0x13')]('cmContact',_0x42c6('0x15'),util['inspect'](_0x522d14,{'showHidden':![],'depth':null}));};}var _0xd7a969=function(_0x1896fb){return new BPromise(function(_0x43e4cd,_0xa4b57){_0x427671[_0x42c6('0x17')][_0x42c6('0x18')]({'where':{'phone':_0x14b490[_0x42c6('0xb')],'CampaignId':_0x1896fb['id']}})['then'](function(_0x27bb6e){if(!_[_0x42c6('0x1a')](_0x27bb6e)){throw new Error(_0x42c6('0x1b')+_0x14b490[_0x42c6('0xb')]+_0x42c6('0x27')+_0x1896fb['id']);}return _0x427671[_0x42c6('0x17')][_0x42c6('0x1c')]({'phone':_0x14b490[_0x42c6('0xb')],'ContactId':_0x14b490['id'],'ListId':_0x14b490[_0x42c6('0x1d')],'priority':_0x14b490[_0x42c6('0x1e')]?_0x14b490['priority']:0x2,'scheduledat':_0x14b490[_0x42c6('0x1f')]?_0x14b490[_0x42c6('0x1f')]:moment()[_0x42c6('0x26')](_0x42c6('0x20')),'callback':_0x14b490[_0x42c6('0x21')]?!![]:![],'callbackuniqueid':_0x14b490['callbackUniqueid']?_0x14b490[_0x42c6('0x21')]:undefined,'callbackat':_0x14b490[_0x42c6('0x21')]?moment()['format'](_0x42c6('0x20')):undefined,'CampaignId':_0x1896fb['id']});})['catch'](function(_0x3ec1c4){_0xa4b57(_0x3ec1c4);});});};var _0x5c00eb=function(_0x478748){return new BPromise(function(_0x22b137,_0x5e537a){_0x427671[_0x42c6('0x17')][_0x42c6('0x18')]({'where':{'phone':_0x14b490[_0x42c6('0xb')],'CampaignId':_0x478748['id']}})['then'](function(_0x328a66){if(!_[_0x42c6('0x1a')](_0x328a66)){throw new Error(_0x42c6('0x1b')+_0x14b490['phone']+_0x42c6('0x28')+_0x478748['id']);}return _0x427671[_0x42c6('0x24')][_0x42c6('0x18')]({'where':{'calleridnum':_0x14b490['phone'],'CampaignId':_0x478748['id']}});})[_0x42c6('0x19')](function(_0x2c96ac){if(!_[_0x42c6('0x1a')](_0x2c96ac)){throw new Error(_0x42c6('0x29')+_0x14b490['phone']+_0x42c6('0x2a')+_0x478748['id']);}return _0x427671[_0x42c6('0x17')]['create']({'phone':_0x14b490[_0x42c6('0xb')],'ContactId':_0x14b490['id'],'ListId':_0x14b490[_0x42c6('0x1d')],'priority':_0x14b490[_0x42c6('0x1e')]?_0x14b490[_0x42c6('0x1e')]:0x2,'scheduledat':_0x14b490[_0x42c6('0x1f')]?_0x14b490[_0x42c6('0x1f')]:moment()[_0x42c6('0x26')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x14b490[_0x42c6('0x21')]?!![]:![],'callbackuniqueid':_0x14b490[_0x42c6('0x21')]?_0x14b490['callbackUniqueid']:undefined,'callbackat':_0x14b490[_0x42c6('0x21')]?moment()[_0x42c6('0x26')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x478748['id']});})[_0x42c6('0x22')](function(_0x5ba6cf){_0x5e537a(_0x5ba6cf);});});};if(_0x14b490[_0x42c6('0x1d')]){_0x427671['VoiceQueue'][_0x42c6('0x2b')]({'where':{'type':_0x42c6('0x2c')},'attributes':['id',_0x42c6('0x2d')],'include':[{'model':_0x427671['CmList'],'as':_0x42c6('0x2e'),'where':{'id':_0x14b490[_0x42c6('0x1d')]}}]})[_0x42c6('0x19')](function(_0x36faac){if(_0x36faac){var _0x500219=[];for(var _0x4292b1=0x0,_0x3a0984;_0x4292b1<_0x36faac[_0x42c6('0x2f')];_0x4292b1+=0x1){_0x3a0984=_0x36faac[_0x4292b1][_0x42c6('0x30')]({'plain':!![]});switch(_0x3a0984[_0x42c6('0x2d')]){case _0x42c6('0x31'):_0x95891e(_0x3a0984)[_0x42c6('0x22')](_0x9de7a1());break;case _0x42c6('0x32'):_0x373598(_0x3a0984)[_0x42c6('0x22')](_0x9de7a1());break;default:_0x427671[_0x42c6('0x17')][_0x42c6('0x1c')]({'phone':_0x14b490[_0x42c6('0xb')],'ContactId':_0x14b490['id'],'ListId':_0x14b490[_0x42c6('0x1d')],'scheduledat':_0x14b490['scheduledat']?_0x14b490[_0x42c6('0x1f')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x14b490[_0x42c6('0x1e')]?_0x14b490[_0x42c6('0x1e')]:0x2,'callback':_0x14b490[_0x42c6('0x21')]?!![]:![],'callbackuniqueid':_0x14b490[_0x42c6('0x21')]?_0x14b490['callbackUniqueid']:undefined,'callbackat':_0x14b490[_0x42c6('0x21')]?moment()[_0x42c6('0x26')](_0x42c6('0x20')):undefined,'VoiceQueueId':_0x3a0984['id']})['catch'](_0x9de7a1());}}}})[_0x42c6('0x19')](function(){return _0x427671[_0x42c6('0x33')][_0x42c6('0x2b')]({'where':{'type':_0x42c6('0x2c')},'attributes':['id'],'include':[{'model':_0x427671['CmList'],'as':_0x42c6('0x34'),'where':{'id':_0x14b490[_0x42c6('0x1d')]}}]})['then'](function(_0x450c6a){if(_0x450c6a){var _0x45e6e8=[];for(var _0x207192=0x0,_0x36a6c7;_0x207192<_0x450c6a[_0x42c6('0x2f')];_0x207192+=0x1){_0x36a6c7=_0x450c6a[_0x207192][_0x42c6('0x30')]({'plain':!![]});_0x427671['CmHopperBlack']['create']({'phone':_0x14b490[_0x42c6('0xb')],'ContactId':_0x14b490['id'],'ListId':_0x14b490[_0x42c6('0x1d')],'VoiceQueueId':_0x36a6c7['id']})[_0x42c6('0x22')](function(_0x4d1096){logger['error']('cmContact,\x20%s,\x20%s','afterCreate',_0x4d1096[_0x42c6('0x35')]);});}}});})[_0x42c6('0x19')](function(){return _0x427671[_0x42c6('0x36')][_0x42c6('0x2b')]({'attributes':['id',_0x42c6('0x2d')],'include':[{'model':_0x427671['CmList'],'as':'Lists','where':{'id':_0x14b490[_0x42c6('0x1d')]}}]})['then'](function(_0x5b192f){if(_0x5b192f){var _0xb327cf=[];for(var _0x16cfa5=0x0,_0x105f49;_0x16cfa5<_0x5b192f[_0x42c6('0x2f')];_0x16cfa5+=0x1){_0x105f49=_0x5b192f[_0x16cfa5][_0x42c6('0x30')]({'plain':!![]});switch(_0x105f49[_0x42c6('0x2d')]){case _0x42c6('0x31'):_0x5c00eb(_0x105f49)[_0x42c6('0x22')](_0xe6d817());break;case _0x42c6('0x32'):_0xd7a969(_0x105f49)['catch'](_0xe6d817());break;default:_0x427671[_0x42c6('0x17')][_0x42c6('0x1c')]({'phone':_0x14b490[_0x42c6('0xb')],'ContactId':_0x14b490['id'],'ListId':_0x14b490[_0x42c6('0x1d')],'scheduledat':_0x14b490['scheduledat']?_0x14b490['scheduledat']:moment()[_0x42c6('0x26')](_0x42c6('0x20')),'priority':_0x14b490[_0x42c6('0x1e')]?_0x14b490['priority']:0x2,'callback':_0x14b490[_0x42c6('0x21')]?!![]:![],'callbackuniqueid':_0x14b490[_0x42c6('0x21')]?_0x14b490[_0x42c6('0x21')]:undefined,'callbackat':_0x14b490[_0x42c6('0x21')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x105f49['id']})[_0x42c6('0x22')](_0xe6d817());}}}});})[_0x42c6('0x19')](function(){return _0x427671[_0x42c6('0x36')]['findAll']({'attributes':['id'],'include':[{'model':_0x427671[_0x42c6('0x37')],'as':_0x42c6('0x34'),'where':{'id':_0x14b490[_0x42c6('0x1d')]}}]})[_0x42c6('0x19')](function(_0x400620){if(_0x400620){var _0x50a8e5=[];for(var _0x56af9c=0x0,_0x4d640c;_0x56af9c<_0x400620[_0x42c6('0x2f')];_0x56af9c+=0x1){_0x4d640c=_0x400620[_0x56af9c][_0x42c6('0x30')]({'plain':!![]});_0x427671['CmHopperBlack'][_0x42c6('0x1c')]({'phone':_0x14b490[_0x42c6('0xb')],'ContactId':_0x14b490['id'],'ListId':_0x14b490['ListId'],'CampaignId':_0x4d640c['id']})[_0x42c6('0x22')](function(_0x345f17){logger['error'](_0x42c6('0x38'),_0x42c6('0x15'),_0x345f17[_0x42c6('0x35')]);});}}});})[_0x42c6('0x19')](function(){_0x1e69e2();})[_0x42c6('0x22')](function(_0x3d0a86){logger[_0x42c6('0x13')](_0x42c6('0x38'),_0x42c6('0x15'),_0x3d0a86[_0x42c6('0x35')]);_0x1e69e2(_0x3d0a86);});}else{_0x1e69e2(new Error(_0x42c6('0x39')));}},'afterDestroy':function(_0x297310,_0x39d1de,_0x149aa6){var _0x5a2751=_0x56b317['models'];var _0x466b3b=_0x297310[_0x42c6('0x30')]({'plain':!![]});return _0x5a2751['CmHopper'][_0x42c6('0x2b')]({'raw':!![],'where':{'ListId':_0x466b3b[_0x42c6('0x1d')],'ContactId':_0x466b3b['id']}})[_0x42c6('0x19')](function(_0x46d703){if(!_[_0x42c6('0x3a')](_0x46d703)){var _0x3dfe62=[];for(var _0x573875=0x0;_0x573875<_0x46d703['length'];_0x573875+=0x1){var _0x11f76c=_0x5a2751[_0x42c6('0x17')][_0x42c6('0x3b')]({'where':{'ListId':_0x46d703[_0x573875][_0x42c6('0x1d')],'ContactId':_0x46d703[_0x573875]['ContactId'],'VoiceQueueId':_0x46d703[_0x573875][_0x42c6('0x3c')],'CampaignId':_0x46d703[_0x573875][_0x42c6('0x3d')]}});_0x3dfe62['push'](_0x11f76c);}return BPromise[_0x42c6('0x3e')](_0x3dfe62);}})[_0x42c6('0x19')](function(_0x37f3e6){logger[_0x42c6('0x3f')]('[CmContact][afterDestroy][Succesfull]',util[_0x42c6('0x16')](_0x37f3e6,{'showHidden':![],'depth':null}));_0x149aa6();})[_0x42c6('0x22')](function(_0x5cd1c0){logger[_0x42c6('0x13')](_0x42c6('0x40'),util[_0x42c6('0x16')](_0x5cd1c0,{'showHidden':![],'depth':null}));_0x149aa6(_0x5cd1c0);});}}});};
\ No newline at end of file
+var _0xf7d9=['CmList','Lists','length','get','always','onlyIfOpen','BlackLists','cmContact,\x20%s,\x20%s','message','Campaign','findAll','CmHopperBlack','List\x20not\x20found','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','push','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./cmContact.attributes','exports','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','mobile','email','FULLTEXT','utf8mb4','models','error','cmContact','inspect','CmHopper','findOne','isNil','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','scheduledat','callbackUniqueid','YYYY-MM-DD\x20HH:mm:ss','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','format','afterCreate','then','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','VoiceQueue','dialCheckDuplicateType'];(function(_0x13ef4f,_0x268dae){var _0x568fa4=function(_0x166586){while(--_0x166586){_0x13ef4f['push'](_0x13ef4f['shift']());}};_0x568fa4(++_0x268dae);}(_0xf7d9,0x122));var _0x9f7d=function(_0x258ec4,_0x14240e){_0x258ec4=_0x258ec4-0x0;var _0x4b01b9=_0xf7d9[_0x258ec4];return _0x4b01b9;};'use strict';var _=require(_0x9f7d('0x0'));var util=require(_0x9f7d('0x1'));var logger=require(_0x9f7d('0x2'))(_0x9f7d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9f7d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9f7d('0x5'));var config=require(_0x9f7d('0x6'));var attributes=require(_0x9f7d('0x7'));module[_0x9f7d('0x8')]=function(_0x3cb3b8,_0x513f73){return _0x3cb3b8['define'](_0x9f7d('0x9'),attributes,{'tableName':_0x9f7d('0xa'),'paranoid':!![],'indexes':[{'name':_0x9f7d('0xb'),'fields':[_0x9f7d('0xb')]},{'name':_0x9f7d('0xc'),'fields':[_0x9f7d('0xd'),'lastName',_0x9f7d('0xb'),_0x9f7d('0xe'),'fax',_0x9f7d('0xf')],'type':_0x9f7d('0x10')}],'timestamps':!![],'charset':_0x9f7d('0x11'),'collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x43a48e,_0x26e026,_0x1c10e4){var _0x55737b=_0x3cb3b8[_0x9f7d('0x12')];var _0x3acdbc=_0x43a48e['get']({'plain':!![]});function _0x1cee74(){return function(_0x10987d){logger[_0x9f7d('0x13')](_0x9f7d('0x14'),'afterCreate',util[_0x9f7d('0x15')](_0x10987d,{'showHidden':![],'depth':null}));};}var _0x35d138=function(_0x1e0dc6){return new BPromise(function(_0x1714f5,_0xebe449){_0x55737b[_0x9f7d('0x16')][_0x9f7d('0x17')]({'where':{'phone':_0x3acdbc['phone'],'VoiceQueueId':_0x1e0dc6['id']}})['then'](function(_0x402609){if(!_[_0x9f7d('0x18')](_0x402609)){throw new Error(_0x9f7d('0x19')+_0x3acdbc[_0x9f7d('0xb')]+_0x9f7d('0x1a')+_0x1e0dc6['id']);}return _0x55737b[_0x9f7d('0x16')][_0x9f7d('0x1b')]({'phone':_0x3acdbc[_0x9f7d('0xb')],'ContactId':_0x3acdbc['id'],'ListId':_0x3acdbc[_0x9f7d('0x1c')],'priority':_0x3acdbc['priority']?_0x3acdbc[_0x9f7d('0x1d')]:0x2,'scheduledat':_0x3acdbc[_0x9f7d('0x1e')]?_0x3acdbc['scheduledat']:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x3acdbc[_0x9f7d('0x1f')]?!![]:![],'callbackuniqueid':_0x3acdbc[_0x9f7d('0x1f')]?_0x3acdbc[_0x9f7d('0x1f')]:undefined,'callbackat':_0x3acdbc['callbackUniqueid']?moment()['format'](_0x9f7d('0x20')):undefined,'VoiceQueueId':_0x1e0dc6['id']});})[_0x9f7d('0x21')](function(_0xfe757d){_0xebe449(_0xfe757d);});});};var _0x1d0717=function(_0x3e045c){return new BPromise(function(_0x13b125,_0x5f4dca){_0x55737b[_0x9f7d('0x16')]['findOne']({'where':{'phone':_0x3acdbc[_0x9f7d('0xb')],'VoiceQueueId':_0x3e045c['id']}})['then'](function(_0x4b0607){if(!_[_0x9f7d('0x18')](_0x4b0607)){throw new Error('cmContact,\x20afterCreate\x20'+_0x3acdbc['phone']+_0x9f7d('0x22')+_0x3e045c['id']);}return _0x55737b[_0x9f7d('0x23')][_0x9f7d('0x17')]({'where':{'calleridnum':_0x3acdbc[_0x9f7d('0xb')],'VoiceQueueId':_0x3e045c['id']}});})['then'](function(_0x48ea1b){if(!_[_0x9f7d('0x18')](_0x48ea1b)){throw new Error(_0x9f7d('0x24')+_0x3acdbc[_0x9f7d('0xb')]+_0x9f7d('0x25')+_0x3e045c['id']);}return _0x55737b['CmHopper'][_0x9f7d('0x1b')]({'phone':_0x3acdbc[_0x9f7d('0xb')],'ContactId':_0x3acdbc['id'],'ListId':_0x3acdbc[_0x9f7d('0x1c')],'priority':_0x3acdbc[_0x9f7d('0x1d')]?_0x3acdbc[_0x9f7d('0x1d')]:0x2,'scheduledat':_0x3acdbc[_0x9f7d('0x1e')]?_0x3acdbc[_0x9f7d('0x1e')]:moment()[_0x9f7d('0x26')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x3acdbc['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x3acdbc[_0x9f7d('0x1f')]?_0x3acdbc[_0x9f7d('0x1f')]:undefined,'callbackat':_0x3acdbc[_0x9f7d('0x1f')]?moment()[_0x9f7d('0x26')](_0x9f7d('0x20')):undefined,'VoiceQueueId':_0x3e045c['id']});})[_0x9f7d('0x21')](function(_0xf73bf6){_0x5f4dca(_0xf73bf6);});});};function _0xe33e96(){return function(_0x4c024f){logger[_0x9f7d('0x13')](_0x9f7d('0x14'),_0x9f7d('0x27'),util['inspect'](_0x4c024f,{'showHidden':![],'depth':null}));};}var _0x2c27fd=function(_0x34170e){return new BPromise(function(_0x3c6df7,_0x5a37e3){_0x55737b[_0x9f7d('0x16')][_0x9f7d('0x17')]({'where':{'phone':_0x3acdbc['phone'],'CampaignId':_0x34170e['id']}})[_0x9f7d('0x28')](function(_0x3fe022){if(!_[_0x9f7d('0x18')](_0x3fe022)){throw new Error('cmContact,\x20afterCreate\x20'+_0x3acdbc['phone']+_0x9f7d('0x29')+_0x34170e['id']);}return _0x55737b[_0x9f7d('0x16')][_0x9f7d('0x1b')]({'phone':_0x3acdbc[_0x9f7d('0xb')],'ContactId':_0x3acdbc['id'],'ListId':_0x3acdbc[_0x9f7d('0x1c')],'priority':_0x3acdbc[_0x9f7d('0x1d')]?_0x3acdbc['priority']:0x2,'scheduledat':_0x3acdbc['scheduledat']?_0x3acdbc[_0x9f7d('0x1e')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x3acdbc[_0x9f7d('0x1f')]?!![]:![],'callbackuniqueid':_0x3acdbc[_0x9f7d('0x1f')]?_0x3acdbc[_0x9f7d('0x1f')]:undefined,'callbackat':_0x3acdbc[_0x9f7d('0x1f')]?moment()['format'](_0x9f7d('0x20')):undefined,'CampaignId':_0x34170e['id']});})['catch'](function(_0x1ef808){_0x5a37e3(_0x1ef808);});});};var _0x46e15d=function(_0x9df2d0){return new BPromise(function(_0x3ef0ba,_0x4bb270){_0x55737b[_0x9f7d('0x16')][_0x9f7d('0x17')]({'where':{'phone':_0x3acdbc[_0x9f7d('0xb')],'CampaignId':_0x9df2d0['id']}})[_0x9f7d('0x28')](function(_0x503948){if(!_[_0x9f7d('0x18')](_0x503948)){throw new Error(_0x9f7d('0x19')+_0x3acdbc[_0x9f7d('0xb')]+_0x9f7d('0x2a')+_0x9df2d0['id']);}return _0x55737b[_0x9f7d('0x23')][_0x9f7d('0x17')]({'where':{'calleridnum':_0x3acdbc[_0x9f7d('0xb')],'CampaignId':_0x9df2d0['id']}});})[_0x9f7d('0x28')](function(_0x360b94){if(!_[_0x9f7d('0x18')](_0x360b94)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x3acdbc[_0x9f7d('0xb')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x9df2d0['id']);}return _0x55737b['CmHopper'][_0x9f7d('0x1b')]({'phone':_0x3acdbc[_0x9f7d('0xb')],'ContactId':_0x3acdbc['id'],'ListId':_0x3acdbc['ListId'],'priority':_0x3acdbc[_0x9f7d('0x1d')]?_0x3acdbc[_0x9f7d('0x1d')]:0x2,'scheduledat':_0x3acdbc['scheduledat']?_0x3acdbc[_0x9f7d('0x1e')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x3acdbc[_0x9f7d('0x1f')]?!![]:![],'callbackuniqueid':_0x3acdbc[_0x9f7d('0x1f')]?_0x3acdbc[_0x9f7d('0x1f')]:undefined,'callbackat':_0x3acdbc[_0x9f7d('0x1f')]?moment()[_0x9f7d('0x26')](_0x9f7d('0x20')):undefined,'CampaignId':_0x9df2d0['id']});})['catch'](function(_0x300dff){_0x4bb270(_0x300dff);});});};if(_0x3acdbc[_0x9f7d('0x1c')]){_0x55737b[_0x9f7d('0x2b')]['findAll']({'where':{'type':'outbound'},'attributes':['id',_0x9f7d('0x2c')],'include':[{'model':_0x55737b[_0x9f7d('0x2d')],'as':_0x9f7d('0x2e'),'where':{'id':_0x3acdbc[_0x9f7d('0x1c')]}}]})[_0x9f7d('0x28')](function(_0x23ddc7){if(_0x23ddc7){var _0x428cac=[];for(var _0x4250ea=0x0,_0x59aaac;_0x4250ea<_0x23ddc7[_0x9f7d('0x2f')];_0x4250ea+=0x1){_0x59aaac=_0x23ddc7[_0x4250ea][_0x9f7d('0x30')]({'plain':!![]});switch(_0x59aaac[_0x9f7d('0x2c')]){case _0x9f7d('0x31'):_0x1d0717(_0x59aaac)[_0x9f7d('0x21')](_0x1cee74());break;case _0x9f7d('0x32'):_0x35d138(_0x59aaac)[_0x9f7d('0x21')](_0x1cee74());break;default:_0x55737b['CmHopper'][_0x9f7d('0x1b')]({'phone':_0x3acdbc['phone'],'ContactId':_0x3acdbc['id'],'ListId':_0x3acdbc[_0x9f7d('0x1c')],'scheduledat':_0x3acdbc[_0x9f7d('0x1e')]?_0x3acdbc[_0x9f7d('0x1e')]:moment()['format'](_0x9f7d('0x20')),'priority':_0x3acdbc['priority']?_0x3acdbc[_0x9f7d('0x1d')]:0x2,'callback':_0x3acdbc[_0x9f7d('0x1f')]?!![]:![],'callbackuniqueid':_0x3acdbc[_0x9f7d('0x1f')]?_0x3acdbc[_0x9f7d('0x1f')]:undefined,'callbackat':_0x3acdbc[_0x9f7d('0x1f')]?moment()[_0x9f7d('0x26')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x59aaac['id']})[_0x9f7d('0x21')](_0x1cee74());}}}})[_0x9f7d('0x28')](function(){return _0x55737b[_0x9f7d('0x2b')]['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x55737b[_0x9f7d('0x2d')],'as':_0x9f7d('0x33'),'where':{'id':_0x3acdbc['ListId']}}]})[_0x9f7d('0x28')](function(_0x53f980){if(_0x53f980){var _0x1de1e0=[];for(var _0x1f9221=0x0,_0x45bdc9;_0x1f9221<_0x53f980[_0x9f7d('0x2f')];_0x1f9221+=0x1){_0x45bdc9=_0x53f980[_0x1f9221][_0x9f7d('0x30')]({'plain':!![]});_0x55737b['CmHopperBlack'][_0x9f7d('0x1b')]({'phone':_0x3acdbc['phone'],'ContactId':_0x3acdbc['id'],'ListId':_0x3acdbc[_0x9f7d('0x1c')],'VoiceQueueId':_0x45bdc9['id']})[_0x9f7d('0x21')](function(_0x8d8a72){logger[_0x9f7d('0x13')](_0x9f7d('0x34'),_0x9f7d('0x27'),_0x8d8a72[_0x9f7d('0x35')]);});}}});})[_0x9f7d('0x28')](function(){return _0x55737b[_0x9f7d('0x36')]['findAll']({'attributes':['id',_0x9f7d('0x2c')],'include':[{'model':_0x55737b['CmList'],'as':_0x9f7d('0x2e'),'where':{'id':_0x3acdbc[_0x9f7d('0x1c')]}}]})['then'](function(_0x3c158a){if(_0x3c158a){var _0x39424d=[];for(var _0x465406=0x0,_0x55c075;_0x465406<_0x3c158a[_0x9f7d('0x2f')];_0x465406+=0x1){_0x55c075=_0x3c158a[_0x465406][_0x9f7d('0x30')]({'plain':!![]});switch(_0x55c075[_0x9f7d('0x2c')]){case _0x9f7d('0x31'):_0x46e15d(_0x55c075)[_0x9f7d('0x21')](_0xe33e96());break;case _0x9f7d('0x32'):_0x2c27fd(_0x55c075)[_0x9f7d('0x21')](_0xe33e96());break;default:_0x55737b[_0x9f7d('0x16')][_0x9f7d('0x1b')]({'phone':_0x3acdbc[_0x9f7d('0xb')],'ContactId':_0x3acdbc['id'],'ListId':_0x3acdbc['ListId'],'scheduledat':_0x3acdbc[_0x9f7d('0x1e')]?_0x3acdbc[_0x9f7d('0x1e')]:moment()[_0x9f7d('0x26')](_0x9f7d('0x20')),'priority':_0x3acdbc['priority']?_0x3acdbc[_0x9f7d('0x1d')]:0x2,'callback':_0x3acdbc[_0x9f7d('0x1f')]?!![]:![],'callbackuniqueid':_0x3acdbc[_0x9f7d('0x1f')]?_0x3acdbc[_0x9f7d('0x1f')]:undefined,'callbackat':_0x3acdbc[_0x9f7d('0x1f')]?moment()[_0x9f7d('0x26')](_0x9f7d('0x20')):undefined,'CampaignId':_0x55c075['id']})['catch'](_0xe33e96());}}}});})[_0x9f7d('0x28')](function(){return _0x55737b[_0x9f7d('0x36')][_0x9f7d('0x37')]({'attributes':['id'],'include':[{'model':_0x55737b[_0x9f7d('0x2d')],'as':'BlackLists','where':{'id':_0x3acdbc[_0x9f7d('0x1c')]}}]})['then'](function(_0x4bb78a){if(_0x4bb78a){var _0x34e20b=[];for(var _0x4e7db3=0x0,_0xda3d71;_0x4e7db3<_0x4bb78a[_0x9f7d('0x2f')];_0x4e7db3+=0x1){_0xda3d71=_0x4bb78a[_0x4e7db3][_0x9f7d('0x30')]({'plain':!![]});_0x55737b[_0x9f7d('0x38')][_0x9f7d('0x1b')]({'phone':_0x3acdbc[_0x9f7d('0xb')],'ContactId':_0x3acdbc['id'],'ListId':_0x3acdbc[_0x9f7d('0x1c')],'CampaignId':_0xda3d71['id']})['catch'](function(_0x34cc37){logger[_0x9f7d('0x13')]('cmContact,\x20%s,\x20%s',_0x9f7d('0x27'),_0x34cc37[_0x9f7d('0x35')]);});}}});})[_0x9f7d('0x28')](function(){_0x1c10e4();})[_0x9f7d('0x21')](function(_0x19ae2e){logger['error'](_0x9f7d('0x34'),'afterCreate',_0x19ae2e[_0x9f7d('0x35')]);_0x1c10e4(_0x19ae2e);});}else{_0x1c10e4(new Error(_0x9f7d('0x39')));}},'afterDestroy':function(_0x29792a,_0x2bb6da,_0x5dbe50){var _0x27fe57=_0x3cb3b8['models'];var _0x521090=_0x29792a['get']({'plain':!![]});return _0x27fe57[_0x9f7d('0x16')][_0x9f7d('0x37')]({'raw':!![],'where':{'ListId':_0x521090['ListId'],'ContactId':_0x521090['id']}})[_0x9f7d('0x28')](function(_0x503fd5){if(!_[_0x9f7d('0x3a')](_0x503fd5)){var _0x173c9e=[];for(var _0xd6e01c=0x0;_0xd6e01c<_0x503fd5[_0x9f7d('0x2f')];_0xd6e01c+=0x1){var _0x103a5b=_0x27fe57[_0x9f7d('0x16')][_0x9f7d('0x3b')]({'where':{'ListId':_0x503fd5[_0xd6e01c][_0x9f7d('0x1c')],'ContactId':_0x503fd5[_0xd6e01c][_0x9f7d('0x3c')],'VoiceQueueId':_0x503fd5[_0xd6e01c][_0x9f7d('0x3d')],'CampaignId':_0x503fd5[_0xd6e01c][_0x9f7d('0x3e')]}});_0x173c9e[_0x9f7d('0x3f')](_0x103a5b);}return BPromise['all'](_0x173c9e);}})[_0x9f7d('0x28')](function(_0x2af20a){logger[_0x9f7d('0x40')](_0x9f7d('0x41'),util['inspect'](_0x2af20a,{'showHidden':![],'depth':null}));_0x5dbe50();})[_0x9f7d('0x21')](function(_0x5ca34a){logger[_0x9f7d('0x13')](_0x9f7d('0x42'),util['inspect'](_0x5ca34a,{'showHidden':![],'depth':null}));_0x5dbe50(_0x5ca34a);});}}});};
\ No newline at end of file
index 6096f8e..88aa03a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x828e=['create','body','then','keys','length','startsWith','cf_','table','cm_contacts','set','sequelize','query','lodash','moment','bluebird','randomstring','ioredis','squel','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','defaults','redis','localhost','register','request','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CmContact','options','raw','where','include','model','attributes','map','GetCmContact','CreateCmContact'];(function(_0x57a1bb,_0x16af78){var _0x380772=function(_0x2d231d){while(--_0x2d231d){_0x57a1bb['push'](_0x57a1bb['shift']());}};_0x380772(++_0x16af78);}(_0x828e,0x1c5));var _0xe828=function(_0x4f2dde,_0x412023){_0x4f2dde=_0x4f2dde-0x0;var _0x4dc8c1=_0x828e[_0x4f2dde];return _0x4dc8c1;};'use strict';var _=require(_0xe828('0x0'));var util=require('util');var moment=require(_0xe828('0x1'));var BPromise=require(_0xe828('0x2'));var rs=require(_0xe828('0x3'));var fs=require('fs');var Redis=require(_0xe828('0x4'));var squel=require(_0xe828('0x5'));var db=require(_0xe828('0x6'))['db'];var utils=require(_0xe828('0x7'));var logger=require(_0xe828('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe828('0x9'));var client=jayson[_0xe828('0xa')][_0xe828('0xb')]({'port':0x232a});config['redis']=_[_0xe828('0xc')](config[_0xe828('0xd')],{'host':_0xe828('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe828('0xd')]));require('./cmContact.socket')[_0xe828('0xf')](socket);function respondWithRpcPromise(_0x538388,_0x17b954,_0x58810a){return new BPromise(function(_0x34d6d2,_0x490768){return client[_0xe828('0x10')](_0x538388,_0x58810a)['then'](function(_0x14c8d4){logger['info'](_0xe828('0x11'),_0x17b954,_0xe828('0x12'));logger[_0xe828('0x13')](_0xe828('0x14'),_0x17b954,_0xe828('0x12'),JSON[_0xe828('0x15')](_0x14c8d4));if(_0x14c8d4['error']){if(_0x14c8d4[_0xe828('0x16')][_0xe828('0x17')]===0x1f4){logger[_0xe828('0x16')](_0xe828('0x11'),_0x17b954,_0x14c8d4[_0xe828('0x16')][_0xe828('0x18')]);return _0x490768(_0x14c8d4['error'][_0xe828('0x18')]);}logger[_0xe828('0x16')](_0xe828('0x11'),_0x17b954,_0x14c8d4['error']['message']);return _0x34d6d2(_0x14c8d4[_0xe828('0x16')][_0xe828('0x18')]);}else{logger[_0xe828('0x19')](_0xe828('0x11'),_0x17b954,_0xe828('0x12'));_0x34d6d2(_0x14c8d4['result'][_0xe828('0x18')]);}})[_0xe828('0x1a')](function(_0xed5538){logger[_0xe828('0x16')](_0xe828('0x11'),_0x17b954,_0xed5538);_0x490768(_0xed5538);});});}exports['GetCmContact']=function(_0x2cee4e){var _0xde5b2b=this;return new Promise(function(_0x5cc180,_0x36d689){return db[_0xe828('0x1b')]['findAll']({'raw':_0x2cee4e['options']?_0x2cee4e[_0xe828('0x1c')][_0xe828('0x1d')]===undefined?!![]:![]:!![],'where':_0x2cee4e['options']?_0x2cee4e[_0xe828('0x1c')][_0xe828('0x1e')]||null:null,'attributes':_0x2cee4e['options']?_0x2cee4e[_0xe828('0x1c')]['attributes']||null:null,'limit':_0x2cee4e[_0xe828('0x1c')]?_0x2cee4e[_0xe828('0x1c')]['limit']||null:null,'include':_0x2cee4e[_0xe828('0x1c')]?_0x2cee4e[_0xe828('0x1c')][_0xe828('0x1f')]?_['map'](_0x2cee4e[_0xe828('0x1c')][_0xe828('0x1f')],function(_0x3b6715){return{'model':db[_0x3b6715[_0xe828('0x20')]],'as':_0x3b6715['as'],'attributes':_0x3b6715[_0xe828('0x21')],'include':_0x3b6715[_0xe828('0x1f')]?_[_0xe828('0x22')](_0x3b6715[_0xe828('0x1f')],function(_0x79e38f){return{'model':db[_0x79e38f[_0xe828('0x20')]],'as':_0x79e38f['as'],'attributes':_0x79e38f['attributes'],'include':_0x79e38f[_0xe828('0x1f')]?_[_0xe828('0x22')](_0x79e38f[_0xe828('0x1f')],function(_0x434a95){return{'model':db[_0x434a95[_0xe828('0x20')]],'as':_0x434a95['as'],'attributes':_0x434a95['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f12c5){logger[_0xe828('0x19')](_0xe828('0x23'),_0x2cee4e);logger[_0xe828('0x13')](_0xe828('0x23'),_0x2cee4e,JSON[_0xe828('0x15')](_0x3f12c5));_0x5cc180(_0x3f12c5);})[_0xe828('0x1a')](function(_0x29a91c){logger[_0xe828('0x16')](_0xe828('0x23'),_0x29a91c[_0xe828('0x18')],_0x2cee4e);_0x36d689(_0xde5b2b['error'](0x1f4,_0x29a91c['message']));});});};exports[_0xe828('0x24')]=function(_0x2a14db){var _0x5e6410=this;return new Promise(function(_0x1f4896,_0x4cfcd4){return db[_0xe828('0x1b')][_0xe828('0x25')](_0x2a14db[_0xe828('0x26')],{'raw':_0x2a14db['options']?_0x2a14db[_0xe828('0x1c')][_0xe828('0x1d')]===undefined?!![]:![]:!![]})[_0xe828('0x27')](function(_0x64c967){var _0x5ae8cb;for(var _0x49c94c=0x0;_0x49c94c<Object[_0xe828('0x28')](_0x2a14db[_0xe828('0x26')])[_0xe828('0x29')];_0x49c94c++){var _0x47b057=Object['keys'](_0x2a14db[_0xe828('0x26')])[_0x49c94c];if(_0x47b057[_0xe828('0x2a')](_0xe828('0x2b'))){_0x5ae8cb=squel['update']()[_0xe828('0x2c')](_0xe828('0x2d'))[_0xe828('0x2e')](_0x47b057,_0x2a14db[_0xe828('0x26')][_0x47b057])[_0xe828('0x1e')]('id\x20=\x20?',_0x64c967['id'])['toString']();break;}}if(!_0x5ae8cb)return _0x64c967;return db[_0xe828('0x2f')][_0xe828('0x30')](_0x5ae8cb)[_0xe828('0x27')](function(){return _0x64c967;});})[_0xe828('0x27')](function(_0x4acc43){logger[_0xe828('0x19')]('CreateCmContact',_0x2a14db);logger[_0xe828('0x13')](_0xe828('0x24'),_0x2a14db,JSON[_0xe828('0x15')](_0x4acc43));_0x1f4896(_0x4acc43);})[_0xe828('0x1a')](function(_0x51a4db){logger[_0xe828('0x16')](_0xe828('0x24'),_0x51a4db[_0xe828('0x18')],_0x2a14db);_0x4cfcd4(_0x5e6410[_0xe828('0x16')](0x1f4,_0x51a4db[_0xe828('0x18')]));});});};
\ No newline at end of file
+var _0x778a=['raw','attributes','limit','include','model','map','debug','catch','CreateCmContact','create','keys','body','startsWith','cf_','update','table','toString','sequelize','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','defaults','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetCmContact','CmContact','findAll','options'];(function(_0x39772f,_0x5605cb){var _0xc9edbf=function(_0x106a39){while(--_0x106a39){_0x39772f['push'](_0x39772f['shift']());}};_0xc9edbf(++_0x5605cb);}(_0x778a,0x96));var _0xa778=function(_0x6fb7ec,_0x2cc36f){_0x6fb7ec=_0x6fb7ec-0x0;var _0x243017=_0x778a[_0x6fb7ec];return _0x243017;};'use strict';var _=require(_0xa778('0x0'));var util=require(_0xa778('0x1'));var moment=require(_0xa778('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa778('0x3'));var squel=require('squel');var db=require(_0xa778('0x4'))['db'];var utils=require(_0xa778('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa778('0x6'));var client=jayson[_0xa778('0x7')][_0xa778('0x8')]({'port':0x232a});config[_0xa778('0x9')]=_[_0xa778('0xa')](config[_0xa778('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa778('0x9')]));require('./cmContact.socket')[_0xa778('0xb')](socket);function respondWithRpcPromise(_0x3d05ac,_0x334a60,_0x2ee732){return new BPromise(function(_0x1b2445,_0x2c02f3){return client[_0xa778('0xc')](_0x3d05ac,_0x2ee732)[_0xa778('0xd')](function(_0x40a142){logger[_0xa778('0xe')](_0xa778('0xf'),_0x334a60,_0xa778('0x10'));logger['debug']('CmContact,\x20%s,\x20%s,\x20%s',_0x334a60,_0xa778('0x10'),JSON[_0xa778('0x11')](_0x40a142));if(_0x40a142['error']){if(_0x40a142[_0xa778('0x12')][_0xa778('0x13')]===0x1f4){logger[_0xa778('0x12')](_0xa778('0xf'),_0x334a60,_0x40a142['error'][_0xa778('0x14')]);return _0x2c02f3(_0x40a142[_0xa778('0x12')][_0xa778('0x14')]);}logger[_0xa778('0x12')]('CmContact,\x20%s,\x20%s',_0x334a60,_0x40a142['error'][_0xa778('0x14')]);return _0x1b2445(_0x40a142['error'][_0xa778('0x14')]);}else{logger[_0xa778('0xe')](_0xa778('0xf'),_0x334a60,'request\x20sent');_0x1b2445(_0x40a142[_0xa778('0x15')][_0xa778('0x14')]);}})['catch'](function(_0x296316){logger[_0xa778('0x12')]('CmContact,\x20%s,\x20%s',_0x334a60,_0x296316);_0x2c02f3(_0x296316);});});}exports[_0xa778('0x16')]=function(_0x22cb54){var _0x2c2a69=this;return new Promise(function(_0x2037d2,_0x1e7a28){return db[_0xa778('0x17')][_0xa778('0x18')]({'raw':_0x22cb54['options']?_0x22cb54[_0xa778('0x19')][_0xa778('0x1a')]===undefined?!![]:![]:!![],'where':_0x22cb54[_0xa778('0x19')]?_0x22cb54[_0xa778('0x19')]['where']||null:null,'attributes':_0x22cb54[_0xa778('0x19')]?_0x22cb54['options'][_0xa778('0x1b')]||null:null,'limit':_0x22cb54[_0xa778('0x19')]?_0x22cb54[_0xa778('0x19')][_0xa778('0x1c')]||null:null,'include':_0x22cb54['options']?_0x22cb54[_0xa778('0x19')]['include']?_['map'](_0x22cb54[_0xa778('0x19')][_0xa778('0x1d')],function(_0x51bb98){return{'model':db[_0x51bb98[_0xa778('0x1e')]],'as':_0x51bb98['as'],'attributes':_0x51bb98[_0xa778('0x1b')],'include':_0x51bb98[_0xa778('0x1d')]?_[_0xa778('0x1f')](_0x51bb98[_0xa778('0x1d')],function(_0x2d5450){return{'model':db[_0x2d5450['model']],'as':_0x2d5450['as'],'attributes':_0x2d5450['attributes'],'include':_0x2d5450[_0xa778('0x1d')]?_[_0xa778('0x1f')](_0x2d5450[_0xa778('0x1d')],function(_0x136c41){return{'model':db[_0x136c41[_0xa778('0x1e')]],'as':_0x136c41['as'],'attributes':_0x136c41['attributes']};}):[]};}):[]};}):[]:[]})[_0xa778('0xd')](function(_0x11939c){logger[_0xa778('0xe')](_0xa778('0x16'),_0x22cb54);logger[_0xa778('0x20')](_0xa778('0x16'),_0x22cb54,JSON[_0xa778('0x11')](_0x11939c));_0x2037d2(_0x11939c);})[_0xa778('0x21')](function(_0x131868){logger['error'](_0xa778('0x16'),_0x131868['message'],_0x22cb54);_0x1e7a28(_0x2c2a69[_0xa778('0x12')](0x1f4,_0x131868['message']));});});};exports[_0xa778('0x22')]=function(_0x4a3e61){var _0x1b0477=this;return new Promise(function(_0x5cc80c,_0x4de23d){return db[_0xa778('0x17')][_0xa778('0x23')](_0x4a3e61['body'],{'raw':_0x4a3e61[_0xa778('0x19')]?_0x4a3e61[_0xa778('0x19')][_0xa778('0x1a')]===undefined?!![]:![]:!![]})[_0xa778('0xd')](function(_0x2b9f02){var _0x5cb932;for(var _0x16edb0=0x0;_0x16edb0<Object[_0xa778('0x24')](_0x4a3e61[_0xa778('0x25')])['length'];_0x16edb0++){var _0x4a6e8c=Object['keys'](_0x4a3e61['body'])[_0x16edb0];if(_0x4a6e8c[_0xa778('0x26')](_0xa778('0x27'))){_0x5cb932=squel[_0xa778('0x28')]()[_0xa778('0x29')]('cm_contacts')['set'](_0x4a6e8c,_0x4a3e61[_0xa778('0x25')][_0x4a6e8c])['where']('id\x20=\x20?',_0x2b9f02['id'])[_0xa778('0x2a')]();break;}}if(!_0x5cb932)return _0x2b9f02;return db[_0xa778('0x2b')]['query'](_0x5cb932)['then'](function(){return _0x2b9f02;});})['then'](function(_0xe1e845){logger[_0xa778('0xe')](_0xa778('0x22'),_0x4a3e61);logger[_0xa778('0x20')](_0xa778('0x22'),_0x4a3e61,JSON['stringify'](_0xe1e845));_0x5cc80c(_0xe1e845);})[_0xa778('0x21')](function(_0x3241ea){logger[_0xa778('0x12')]('CreateCmContact',_0x3241ea[_0xa778('0x14')],_0x4a3e61);_0x4de23d(_0x1b0477[_0xa778('0x12')](0x1f4,_0x3241ea['message']));});});};
\ No newline at end of file
index 4dc2612..06e6135 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'use strict';var CmContactEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){CmContactEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);CmContactEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0xa9e0=['register','length','cmContact:','./cmContact.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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 b553981..e88542d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b7c=['/merge','merge','create','/create_many','setTags','root','originalname','format','%s-%s%s','basename','extname','/csv','single','file','diskStorage','join','server/files/tmp','replace','now','/upload','/upload/:id','import','put','update','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','isAuthenticated','describe','/:id','show','/:id/tags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','post'];(function(_0x1cb5fe,_0x4e714e){var _0x428df6=function(_0x35e1ef){while(--_0x35e1ef){_0x1cb5fe['push'](_0x1cb5fe['shift']());}};_0x428df6(++_0x4e714e);}(_0x6b7c,0x119));var _0xc6b7=function(_0x550ac4,_0x1f0436){_0x550ac4=_0x550ac4-0x0;var _0x3b1091=_0x6b7c[_0x550ac4];return _0x3b1091;};'use strict';var multer=require(_0xc6b7('0x0'));var util=require(_0xc6b7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc6b7('0x2'));var router=express[_0xc6b7('0x3')]();var fs_extra=require(_0xc6b7('0x4'));var auth=require(_0xc6b7('0x5'));var interaction=require(_0xc6b7('0x6'));var config=require(_0xc6b7('0x7'));var controller=require(_0xc6b7('0x8'));router[_0xc6b7('0x9')]('/',auth['isAuthenticated'](),controller[_0xc6b7('0xa')]);router[_0xc6b7('0x9')]('/describe',auth[_0xc6b7('0xb')](),controller[_0xc6b7('0xc')]);router[_0xc6b7('0x9')](_0xc6b7('0xd'),auth[_0xc6b7('0xb')](),controller[_0xc6b7('0xe')]);router[_0xc6b7('0x9')](_0xc6b7('0xf'),auth[_0xc6b7('0xb')](),controller['getTags']);router[_0xc6b7('0x9')](_0xc6b7('0x10'),auth[_0xc6b7('0xb')](),controller[_0xc6b7('0x11')]);router[_0xc6b7('0x9')](_0xc6b7('0x12'),auth[_0xc6b7('0xb')](),controller[_0xc6b7('0x13')]);router['get'](_0xc6b7('0x14'),auth[_0xc6b7('0xb')](),controller['getHopperFinals']);router['get'](_0xc6b7('0x15'),auth['isAuthenticated'](),controller[_0xc6b7('0x16')]);router[_0xc6b7('0x9')](_0xc6b7('0x17'),auth['isAuthenticated'](),controller['getJourney']);router[_0xc6b7('0x18')](_0xc6b7('0x19'),auth[_0xc6b7('0xb')](),controller[_0xc6b7('0x1a')]);router[_0xc6b7('0x18')]('/',auth[_0xc6b7('0xb')](),controller[_0xc6b7('0x1b')]);router[_0xc6b7('0x18')](_0xc6b7('0x1c'),auth[_0xc6b7('0xb')](),controller['bulkCreate']);router[_0xc6b7('0x18')](_0xc6b7('0xf'),auth['isAuthenticated'](),controller[_0xc6b7('0x1d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2a6027,_0x280056,_0x158cf8){_0x158cf8(null,path['join'](config[_0xc6b7('0x1e')],'server/files/tmp'));},'filename':function(_0x127b51,_0x4896e9,_0x11544b){_0x4896e9['originalname']=_0x4896e9[_0xc6b7('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x11544b(null,util[_0xc6b7('0x20')](_0xc6b7('0x21'),path[_0xc6b7('0x22')](_0x4896e9[_0xc6b7('0x1f')],path[_0xc6b7('0x23')](_0x4896e9[_0xc6b7('0x1f')])),Date['now'](),path[_0xc6b7('0x23')](_0x4896e9[_0xc6b7('0x1f')])));}})});router['post'](_0xc6b7('0x24'),upload[_0xc6b7('0x25')](_0xc6b7('0x26')),controller['uploadCsv']);var upload=multer({'storage':multer[_0xc6b7('0x27')]({'destination':function(_0x2ed6fd,_0x1a323e,_0x157064){_0x157064(null,path[_0xc6b7('0x28')](config[_0xc6b7('0x1e')],_0xc6b7('0x29')));},'filename':function(_0x20f19d,_0x1b5fbe,_0x7eace5){_0x1b5fbe[_0xc6b7('0x1f')]=_0x1b5fbe['originalname'][_0xc6b7('0x2a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x7eace5(null,util[_0xc6b7('0x20')](_0xc6b7('0x21'),path[_0xc6b7('0x22')](_0x1b5fbe[_0xc6b7('0x1f')],path[_0xc6b7('0x23')](_0x1b5fbe[_0xc6b7('0x1f')])),Date[_0xc6b7('0x2b')](),path[_0xc6b7('0x23')](_0x1b5fbe[_0xc6b7('0x1f')])));}})});router[_0xc6b7('0x18')](_0xc6b7('0x2c'),upload[_0xc6b7('0x25')](_0xc6b7('0x26')),controller['upload']);router[_0xc6b7('0x18')](_0xc6b7('0x2d'),auth['isAuthenticated'](),controller[_0xc6b7('0x2e')]);router[_0xc6b7('0x2f')](_0xc6b7('0xd'),auth['isAuthenticated'](),controller[_0xc6b7('0x30')]);router[_0xc6b7('0x31')](_0xc6b7('0xd'),auth[_0xc6b7('0xb')](),controller['destroy']);module[_0xc6b7('0x32')]=router;
\ No newline at end of file
+var _0x4805=['post','/merge','create','bulkCreate','setTags','diskStorage','join','server/files/tmp','originalname','format','basename','now','extname','single','file','uploadCsv','root','replace','/upload','upload','/upload/:id','put','update','delete','destroy','exports','multer','path','Router','fs-extra','../../config/environment','./cmContact.controller','get','/describe','describe','/:id','isAuthenticated','/:id/tags','getTags','/:id/hoppers','getHoppers','getHopperHistories','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','getJourney'];(function(_0x391dcf,_0x3ae1ce){var _0x5c304a=function(_0x3d6d5d){while(--_0x3d6d5d){_0x391dcf['push'](_0x391dcf['shift']());}};_0x5c304a(++_0x3ae1ce);}(_0x4805,0x76));var _0x5480=function(_0x235c20,_0x261aca){_0x235c20=_0x235c20-0x0;var _0x44360f=_0x4805[_0x235c20];return _0x44360f;};'use strict';var multer=require(_0x5480('0x0'));var util=require('util');var path=require(_0x5480('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5480('0x2')]();var fs_extra=require(_0x5480('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5480('0x4'));var controller=require(_0x5480('0x5'));router[_0x5480('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5480('0x6')](_0x5480('0x7'),auth['isAuthenticated'](),controller[_0x5480('0x8')]);router[_0x5480('0x6')](_0x5480('0x9'),auth[_0x5480('0xa')](),controller['show']);router['get'](_0x5480('0xb'),auth[_0x5480('0xa')](),controller[_0x5480('0xc')]);router['get'](_0x5480('0xd'),auth[_0x5480('0xa')](),controller[_0x5480('0xe')]);router[_0x5480('0x6')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0x5480('0xf')]);router[_0x5480('0x6')]('/:id/hopper_finals',auth[_0x5480('0xa')](),controller[_0x5480('0x10')]);router[_0x5480('0x6')](_0x5480('0x11'),auth[_0x5480('0xa')](),controller[_0x5480('0x12')]);router[_0x5480('0x6')]('/:id/journey',auth['isAuthenticated'](),controller[_0x5480('0x13')]);router[_0x5480('0x14')](_0x5480('0x15'),auth[_0x5480('0xa')](),controller['merge']);router['post']('/',auth[_0x5480('0xa')](),controller[_0x5480('0x16')]);router[_0x5480('0x14')]('/create_many',auth[_0x5480('0xa')](),controller[_0x5480('0x17')]);router[_0x5480('0x14')]('/:id/tags',auth[_0x5480('0xa')](),controller[_0x5480('0x18')]);var upload=multer({'storage':multer[_0x5480('0x19')]({'destination':function(_0x3c09e4,_0x41f3bc,_0x17d5b9){_0x17d5b9(null,path[_0x5480('0x1a')](config['root'],_0x5480('0x1b')));},'filename':function(_0x4721fd,_0x34acd7,_0x311b9e){_0x34acd7[_0x5480('0x1c')]=_0x34acd7[_0x5480('0x1c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x311b9e(null,util[_0x5480('0x1d')]('%s-%s%s',path[_0x5480('0x1e')](_0x34acd7['originalname'],path['extname'](_0x34acd7[_0x5480('0x1c')])),Date[_0x5480('0x1f')](),path[_0x5480('0x20')](_0x34acd7[_0x5480('0x1c')])));}})});router[_0x5480('0x14')]('/csv',upload[_0x5480('0x21')](_0x5480('0x22')),controller[_0x5480('0x23')]);var upload=multer({'storage':multer[_0x5480('0x19')]({'destination':function(_0x1760b,_0x2a7d79,_0xff69be){_0xff69be(null,path[_0x5480('0x1a')](config[_0x5480('0x24')],_0x5480('0x1b')));},'filename':function(_0x5c93c4,_0x27b256,_0x579e81){_0x27b256['originalname']=_0x27b256['originalname'][_0x5480('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x579e81(null,util[_0x5480('0x1d')]('%s-%s%s',path[_0x5480('0x1e')](_0x27b256['originalname'],path[_0x5480('0x20')](_0x27b256['originalname'])),Date[_0x5480('0x1f')](),path[_0x5480('0x20')](_0x27b256[_0x5480('0x1c')])));}})});router[_0x5480('0x14')](_0x5480('0x26'),upload[_0x5480('0x21')](_0x5480('0x22')),controller[_0x5480('0x27')]);router[_0x5480('0x14')](_0x5480('0x28'),auth[_0x5480('0xa')](),controller['import']);router[_0x5480('0x29')](_0x5480('0x9'),auth[_0x5480('0xa')](),controller[_0x5480('0x2a')]);router[_0x5480('0x2b')]('/:id',auth[_0x5480('0xa')](),controller[_0x5480('0x2c')]);module[_0x5480('0x2d')]=router;
\ No newline at end of file
index c1f8447..632c3ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb90b=['values','isArray','stringify','BOOLEAN','ENUM','voice','sequelize','exports','VIRTUAL','getDataValue','alias','setDataValue','name','STRING','TEXT','long','type','select','parse'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb90b,0x1a8));var _0xbb90=function(_0x405538,_0x1c4c8d){_0x405538=_0x405538-0x0;var _0x281c78=_0xb90b[_0x405538];return _0x281c78;};'use strict';var Sequelize=require(_0xbb90('0x0'));var _=require('lodash');module[_0xbb90('0x1')]={'name':{'type':Sequelize[_0xbb90('0x2')],'get':function(_0x117b01){return this[_0xbb90('0x3')](_0xbb90('0x4'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x470504){this[_0xbb90('0x5')]('alias',_0x470504?_0x470504:this[_0xbb90('0x3')](_0xbb90('0x6')));}},'type':{'type':Sequelize[_0xbb90('0x7')],'allowNull':![]},'values':{'type':Sequelize[_0xbb90('0x8')](_0xbb90('0x9')),'get':function(){if(this[_0xbb90('0x3')](_0xbb90('0xa'))===_0xbb90('0xb')){return JSON[_0xbb90('0xc')](this[_0xbb90('0x3')](_0xbb90('0xd')));}else{return this[_0xbb90('0x3')](_0xbb90('0xd'));}},'set':function(_0xe7e616){if(Array[_0xbb90('0xe')](_0xe7e616)){this[_0xbb90('0x5')](_0xbb90('0xd'),JSON[_0xbb90('0xf')](_0xe7e616));}else{this['setDataValue'](_0xbb90('0xd'),_0xe7e616);}}},'required':{'type':Sequelize[_0xbb90('0x10')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xbb90('0x10')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xbb90('0x11')](_0xbb90('0x12'))}};
\ No newline at end of file
+var _0xe803=['parse','values','isArray','ENUM','voice','lodash','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','TEXT','select'];(function(_0x47c1f4,_0x4847a5){var _0x3e17b3=function(_0x437145){while(--_0x437145){_0x47c1f4['push'](_0x47c1f4['shift']());}};_0x3e17b3(++_0x4847a5);}(_0xe803,0x1d6));var _0x3e80=function(_0x119347,_0x343ef2){_0x119347=_0x119347-0x0;var _0x5932e2=_0xe803[_0x119347];return _0x5932e2;};'use strict';var Sequelize=require('sequelize');var _=require(_0x3e80('0x0'));module[_0x3e80('0x1')]={'name':{'type':Sequelize[_0x3e80('0x2')],'get':function(_0x41e70d){return this[_0x3e80('0x3')](_0x3e80('0x4'));}},'alias':{'type':Sequelize[_0x3e80('0x5')],'allowNull':![],'set':function(_0x5632d1){this[_0x3e80('0x6')](_0x3e80('0x4'),_0x5632d1?_0x5632d1:this[_0x3e80('0x3')](_0x3e80('0x7')));}},'type':{'type':Sequelize[_0x3e80('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x3e80('0x8')]('long'),'get':function(){if(this[_0x3e80('0x3')]('type')===_0x3e80('0x9')){return JSON[_0x3e80('0xa')](this['getDataValue'](_0x3e80('0xb')));}else{return this[_0x3e80('0x3')]('values');}},'set':function(_0x1920ad){if(Array[_0x3e80('0xc')](_0x1920ad)){this[_0x3e80('0x6')](_0x3e80('0xb'),JSON['stringify'](_0x1920ad));}else{this[_0x3e80('0x6')](_0x3e80('0xb'),_0x1920ad);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x3e80('0xd')](_0x3e80('0xe'))}};
\ No newline at end of file
index 16cfef3..59be67b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5732=['key','differenceBy','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','body','params','sequelize','create','Sequelize','TEXT','number','switch','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','end','stack','name','send','index','CmCustomField','fieldName','type'];(function(_0x2f14db,_0x5b73d1){var _0x452eea=function(_0x432dc9){while(--_0x432dc9){_0x2f14db['push'](_0x2f14db['shift']());}};_0x452eea(++_0x5b73d1);}(_0x5732,0x177));var _0x2573=function(_0xb490a7,_0x3fa11e){_0xb490a7=_0xb490a7-0x0;var _0x34ac2c=_0x5732[_0xb490a7];return _0x34ac2c;};'use strict';var emlformat=require(_0x2573('0x0'));var rimraf=require(_0x2573('0x1'));var zipdir=require(_0x2573('0x2'));var jsonpatch=require(_0x2573('0x3'));var rp=require(_0x2573('0x4'));var moment=require('moment');var BPromise=require(_0x2573('0x5'));var Mustache=require(_0x2573('0x6'));var util=require('util');var path=require(_0x2573('0x7'));var sox=require(_0x2573('0x8'));var csv=require(_0x2573('0x9'));var ejs=require(_0x2573('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2573('0xb'));var squel=require(_0x2573('0xc'));var crypto=require(_0x2573('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2573('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2573('0xf'));var Papa=require(_0x2573('0x10'));var Redis=require(_0x2573('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2573('0x12'));var logger=require(_0x2573('0x13'))(_0x2573('0x14'));var utils=require(_0x2573('0x15'));var config=require(_0x2573('0x16'));var licenseUtil=require(_0x2573('0x17'));var db=require(_0x2573('0x18'))['db'];function respondWithStatusCode(_0x350538,_0x1e2b4a){_0x1e2b4a=_0x1e2b4a||0xcc;return function(_0x2d9495){if(_0x2d9495){return _0x350538[_0x2573('0x19')](_0x1e2b4a);}return _0x350538[_0x2573('0x1a')](_0x1e2b4a)['end']();};}function respondWithResult(_0x143c65,_0x1541af){_0x1541af=_0x1541af||0xc8;return function(_0x314c24){if(_0x314c24){return _0x143c65[_0x2573('0x1a')](_0x1541af)['json'](_0x314c24);}};}function respondWithFilteredResult(_0x389fd2,_0x4637bc){return function(_0x513a6d){if(_0x513a6d){var _0x306dbe=typeof _0x4637bc[_0x2573('0x1b')]===_0x2573('0x1c')&&typeof _0x4637bc[_0x2573('0x1d')]===_0x2573('0x1c');var _0x3dee4a=_0x513a6d[_0x2573('0x1e')];var _0x32d354=_0x306dbe?0x0:_0x4637bc[_0x2573('0x1b')];var _0x5ac87c=_0x306dbe?_0x513a6d[_0x2573('0x1e')]:_0x4637bc['offset']+_0x4637bc[_0x2573('0x1d')];var _0x4a73d1;if(_0x5ac87c>=_0x3dee4a){_0x5ac87c=_0x3dee4a;_0x4a73d1=0xc8;}else{_0x4a73d1=0xce;}_0x389fd2[_0x2573('0x1a')](_0x4a73d1);return _0x389fd2['set'](_0x2573('0x1f'),_0x32d354+'-'+_0x5ac87c+'/'+_0x3dee4a)['json'](_0x513a6d);}return null;};}function patchUpdates(_0x55fa4e){return function(_0x7e63f3){try{jsonpatch[_0x2573('0x20')](_0x7e63f3,_0x55fa4e,!![]);}catch(_0x293383){return BPromise[_0x2573('0x21')](_0x293383);}return _0x7e63f3[_0x2573('0x22')]();};}function saveUpdates(_0x41e001,_0x26974b){return function(_0x277e5e){if(_0x277e5e){return _0x277e5e[_0x2573('0x23')](_0x41e001)['then'](function(_0x2d8460){return _0x2d8460;});}return null;};}function removeEntity(_0x28186f,_0x25e632){return function(_0x465abf){if(_0x465abf){return _0x465abf['destroy']()[_0x2573('0x24')](function(){_0x28186f[_0x2573('0x1a')](0xcc)[_0x2573('0x25')]();});}};}function handleEntityNotFound(_0x2749b8,_0x150ddb){return function(_0x28ebcd){if(!_0x28ebcd){_0x2749b8[_0x2573('0x19')](0x194);}return _0x28ebcd;};}function handleError(_0x5f5614,_0xec5cc){_0xec5cc=_0xec5cc||0x1f4;return function(_0x378271){logger['error'](_0x378271[_0x2573('0x26')]);if(_0x378271[_0x2573('0x27')]){delete _0x378271[_0x2573('0x27')];}_0x5f5614['status'](_0xec5cc)[_0x2573('0x28')](_0x378271);};}exports[_0x2573('0x29')]=function(_0x1c51d7,_0x46352a){var _0xefc956={},_0x66357d={},_0xe45164={'count':0x0,'rows':[]};var _0x3ee232=_['map'](db[_0x2573('0x2a')]['rawAttributes'],function(_0x5e2193){return{'name':_0x5e2193[_0x2573('0x2b')],'type':_0x5e2193[_0x2573('0x2c')][_0x2573('0x2d')]};});_0x66357d['model']=_[_0x2573('0x2e')](_[_0x2573('0x2f')](_0x3ee232,_0x2573('0x27')),['name']);_0x66357d[_0x2573('0x30')]=_[_0x2573('0x31')](_0x1c51d7[_0x2573('0x30')]);_0x66357d[_0x2573('0x32')]=_[_0x2573('0x33')](_0x66357d[_0x2573('0x34')],_0x66357d[_0x2573('0x30')]);_0xefc956[_0x2573('0x35')]=_[_0x2573('0x33')](_0x66357d[_0x2573('0x34')],qs[_0x2573('0x36')](_0x1c51d7[_0x2573('0x30')]['fields']));_0xefc956['attributes']=_0xefc956[_0x2573('0x35')][_0x2573('0x37')]?_0xefc956[_0x2573('0x35')]:_0x66357d[_0x2573('0x34')];if(!_0x1c51d7[_0x2573('0x30')]['hasOwnProperty'](_0x2573('0x38'))){_0xefc956[_0x2573('0x1d')]=qs['limit'](_0x1c51d7['query'][_0x2573('0x1d')]);_0xefc956[_0x2573('0x1b')]=qs[_0x2573('0x1b')](_0x1c51d7[_0x2573('0x30')][_0x2573('0x1b')]);}_0xefc956['order']=qs['sort'](_0x1c51d7['query'][_0x2573('0x39')]);_0xefc956[_0x2573('0x3a')]=qs[_0x2573('0x32')](_[_0x2573('0x3b')](_0x1c51d7['query'],_0x66357d[_0x2573('0x32')]),_0x3ee232);if(_0x1c51d7[_0x2573('0x30')]['filter']){_0xefc956[_0x2573('0x3a')]=_[_0x2573('0x3c')](_0xefc956[_0x2573('0x3a')],{'$or':_[_0x2573('0x2f')](_0x3ee232,function(_0x248006){if(_0x248006[_0x2573('0x2c')]!==_0x2573('0x3d')){var _0x1b15ad={};_0x1b15ad[_0x248006[_0x2573('0x27')]]={'$like':'%'+_0x1c51d7[_0x2573('0x30')][_0x2573('0x3e')]+'%'};return _0x1b15ad;}})});}_0xefc956=_['merge']({},_0xefc956,_0x1c51d7[_0x2573('0x3f')]);var _0x117612={'where':_0xefc956[_0x2573('0x3a')]};return db[_0x2573('0x2a')]['count'](_0x117612)[_0x2573('0x24')](function(_0x45fbf4){_0xe45164['count']=_0x45fbf4;if(_0x1c51d7[_0x2573('0x30')][_0x2573('0x40')]){_0xefc956[_0x2573('0x41')]=[{'all':!![]}];}return db[_0x2573('0x2a')][_0x2573('0x42')](_0xefc956);})[_0x2573('0x24')](function(_0x4e8146){_0xe45164[_0x2573('0x43')]=_0x4e8146;return _0xe45164;})['then'](respondWithFilteredResult(_0x46352a,_0xefc956))[_0x2573('0x44')](handleError(_0x46352a,null));};exports[_0x2573('0x45')]=function(_0x4aa8db,_0x201dbc){var _0x395645={'raw':!![],'where':{'id':_0x4aa8db['params']['id']}},_0x41654e={};_0x41654e[_0x2573('0x34')]=_[_0x2573('0x31')](db[_0x2573('0x2a')][_0x2573('0x46')]);_0x41654e[_0x2573('0x30')]=_[_0x2573('0x31')](_0x4aa8db['query']);_0x41654e['filters']=_[_0x2573('0x33')](_0x41654e[_0x2573('0x34')],_0x41654e[_0x2573('0x30')]);_0x395645['attributes']=_[_0x2573('0x33')](_0x41654e[_0x2573('0x34')],qs[_0x2573('0x36')](_0x4aa8db[_0x2573('0x30')][_0x2573('0x36')]));_0x395645[_0x2573('0x35')]=_0x395645[_0x2573('0x35')][_0x2573('0x37')]?_0x395645[_0x2573('0x35')]:_0x41654e[_0x2573('0x34')];if(_0x4aa8db['query'][_0x2573('0x40')]){_0x395645[_0x2573('0x41')]=[{'all':!![]}];}_0x395645=_['merge']({},_0x395645,_0x4aa8db['options']);return db['CmCustomField'][_0x2573('0x47')](_0x395645)['then'](handleEntityNotFound(_0x201dbc,null))[_0x2573('0x24')](respondWithResult(_0x201dbc,null))[_0x2573('0x44')](handleError(_0x201dbc,null));};exports['update']=function(_0x1aa4e8,_0x23c8ae){if(_0x1aa4e8['body']['id']){delete _0x1aa4e8[_0x2573('0x48')]['id'];}return db[_0x2573('0x2a')][_0x2573('0x47')]({'where':{'id':_0x1aa4e8[_0x2573('0x49')]['id']}})[_0x2573('0x24')](handleEntityNotFound(_0x23c8ae,null))[_0x2573('0x24')](saveUpdates(_0x1aa4e8[_0x2573('0x48')],null))[_0x2573('0x24')](respondWithResult(_0x23c8ae,null))['catch'](handleError(_0x23c8ae,null));};exports['destroy']=function(_0x1b1194,_0x2faa34){return db['CmCustomField']['find']({'where':{'id':_0x1b1194[_0x2573('0x49')]['id']}})[_0x2573('0x24')](handleEntityNotFound(_0x2faa34,null))[_0x2573('0x24')](removeEntity(_0x2faa34,null))[_0x2573('0x44')](handleError(_0x2faa34,null));};exports['create']=function(_0xc0532d,_0x1d5c48){var _0x260d1f;return db[_0x2573('0x4a')]['transaction'](function(_0x199843){return db[_0x2573('0x2a')][_0x2573('0x4b')](_0xc0532d[_0x2573('0x48')],{'transaction':_0x199843})[_0x2573('0x24')](function(_0x229360){_0x260d1f=_0x229360;var _0x393a9a={'type':db[_0x2573('0x4c')][_0x2573('0x4d')],'transaction':_0x199843};switch(_0xc0532d['body'][_0x2573('0x2c')]){case'text':_0x393a9a['type']=db['Sequelize'][_0x2573('0x4d')];break;case _0x2573('0x4e'):_0x393a9a[_0x2573('0x2c')]=db[_0x2573('0x4c')]['INTEGER'];break;case _0x2573('0x4f'):_0x393a9a['type']=db[_0x2573('0x4c')]['BOOLEAN'];_0x393a9a['defaultValue']=![];break;default:}return db['sequelize']['queryInterface'][_0x2573('0x50')](_0x2573('0x51'),util[_0x2573('0x52')](_0x2573('0x53'),_0x260d1f['id']),_0x393a9a);})[_0x2573('0x24')](function(){return _0x260d1f;});})[_0x2573('0x24')](respondWithResult(_0x1d5c48,0xc9))['catch'](handleError(_0x1d5c48,null));};
\ No newline at end of file
+var _0x53b3=['count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','model','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','pick','merge','VIRTUAL','options','includeAll','catch','show','keys','length','include','find','body','params','sequelize','transaction','create','Sequelize','text','TEXT','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined'];(function(_0x413792,_0x27a8e2){var _0x3f5bcd=function(_0x182738){while(--_0x182738){_0x413792['push'](_0x413792['shift']());}};_0x3f5bcd(++_0x27a8e2);}(_0x53b3,0x8f));var _0x353b=function(_0x2f04a5,_0x29fb54){_0x2f04a5=_0x2f04a5-0x0;var _0x48016a=_0x53b3[_0x2f04a5];return _0x48016a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x353b('0x0'));var jsonpatch=require(_0x353b('0x1'));var rp=require(_0x353b('0x2'));var moment=require(_0x353b('0x3'));var BPromise=require(_0x353b('0x4'));var Mustache=require(_0x353b('0x5'));var util=require('util');var path=require(_0x353b('0x6'));var sox=require(_0x353b('0x7'));var csv=require(_0x353b('0x8'));var ejs=require(_0x353b('0x9'));var fs=require('fs');var fs_extra=require(_0x353b('0xa'));var _=require(_0x353b('0xb'));var squel=require(_0x353b('0xc'));var crypto=require('crypto');var jsforce=require(_0x353b('0xd'));var deskjs=require(_0x353b('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x353b('0xf'));var Redis=require(_0x353b('0x10'));var authService=require(_0x353b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x353b('0x12'));var hardwareService=require(_0x353b('0x13'));var logger=require(_0x353b('0x14'))('api');var utils=require(_0x353b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x353b('0x16'));var db=require(_0x353b('0x17'))['db'];function respondWithStatusCode(_0xda0cc8,_0x3d965c){_0x3d965c=_0x3d965c||0xcc;return function(_0x135bc3){if(_0x135bc3){return _0xda0cc8[_0x353b('0x18')](_0x3d965c);}return _0xda0cc8[_0x353b('0x19')](_0x3d965c)[_0x353b('0x1a')]();};}function respondWithResult(_0x28401d,_0x362194){_0x362194=_0x362194||0xc8;return function(_0x703411){if(_0x703411){return _0x28401d['status'](_0x362194)['json'](_0x703411);}};}function respondWithFilteredResult(_0x352fae,_0x2119e1){return function(_0x340fa0){if(_0x340fa0){var _0x569f4c=typeof _0x2119e1[_0x353b('0x1b')]===_0x353b('0x1c')&&typeof _0x2119e1['limit']===_0x353b('0x1c');var _0x5068a1=_0x340fa0[_0x353b('0x1d')];var _0x38113c=_0x569f4c?0x0:_0x2119e1[_0x353b('0x1b')];var _0x1271d4=_0x569f4c?_0x340fa0[_0x353b('0x1d')]:_0x2119e1[_0x353b('0x1b')]+_0x2119e1['limit'];var _0x1b15d6;if(_0x1271d4>=_0x5068a1){_0x1271d4=_0x5068a1;_0x1b15d6=0xc8;}else{_0x1b15d6=0xce;}_0x352fae[_0x353b('0x19')](_0x1b15d6);return _0x352fae[_0x353b('0x1e')](_0x353b('0x1f'),_0x38113c+'-'+_0x1271d4+'/'+_0x5068a1)[_0x353b('0x20')](_0x340fa0);}return null;};}function patchUpdates(_0x176c2e){return function(_0x3c1193){try{jsonpatch[_0x353b('0x21')](_0x3c1193,_0x176c2e,!![]);}catch(_0x3d1da6){return BPromise[_0x353b('0x22')](_0x3d1da6);}return _0x3c1193[_0x353b('0x23')]();};}function saveUpdates(_0xd4181,_0x376d31){return function(_0x5db0f4){if(_0x5db0f4){return _0x5db0f4[_0x353b('0x24')](_0xd4181)['then'](function(_0x3a9c94){return _0x3a9c94;});}return null;};}function removeEntity(_0x387bfe,_0x7ee64f){return function(_0x63f2ab){if(_0x63f2ab){return _0x63f2ab[_0x353b('0x25')]()[_0x353b('0x26')](function(){_0x387bfe[_0x353b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d2633,_0x4364da){return function(_0x254b1d){if(!_0x254b1d){_0x2d2633[_0x353b('0x18')](0x194);}return _0x254b1d;};}function handleError(_0x1cc856,_0x23afff){_0x23afff=_0x23afff||0x1f4;return function(_0x15b8c5){logger[_0x353b('0x27')](_0x15b8c5[_0x353b('0x28')]);if(_0x15b8c5[_0x353b('0x29')]){delete _0x15b8c5['name'];}_0x1cc856[_0x353b('0x19')](_0x23afff)[_0x353b('0x2a')](_0x15b8c5);};}exports[_0x353b('0x2b')]=function(_0x146705,_0x30ac20){var _0x2da2a1={},_0xa91656={},_0x1335d0={'count':0x0,'rows':[]};var _0x5dee08=_[_0x353b('0x2c')](db[_0x353b('0x2d')][_0x353b('0x2e')],function(_0x16782a){return{'name':_0x16782a[_0x353b('0x2f')],'type':_0x16782a[_0x353b('0x30')]['key']};});_0xa91656[_0x353b('0x31')]=_['differenceBy'](_[_0x353b('0x2c')](_0x5dee08,_0x353b('0x29')),[_0x353b('0x29')]);_0xa91656['query']=_['keys'](_0x146705['query']);_0xa91656[_0x353b('0x32')]=_[_0x353b('0x33')](_0xa91656['model'],_0xa91656[_0x353b('0x34')]);_0x2da2a1[_0x353b('0x35')]=_[_0x353b('0x33')](_0xa91656[_0x353b('0x31')],qs['fields'](_0x146705[_0x353b('0x34')][_0x353b('0x36')]));_0x2da2a1[_0x353b('0x35')]=_0x2da2a1[_0x353b('0x35')]['length']?_0x2da2a1[_0x353b('0x35')]:_0xa91656['model'];if(!_0x146705[_0x353b('0x34')][_0x353b('0x37')](_0x353b('0x38'))){_0x2da2a1[_0x353b('0x39')]=qs['limit'](_0x146705[_0x353b('0x34')][_0x353b('0x39')]);_0x2da2a1[_0x353b('0x1b')]=qs[_0x353b('0x1b')](_0x146705[_0x353b('0x34')]['offset']);}_0x2da2a1['order']=qs[_0x353b('0x3a')](_0x146705[_0x353b('0x34')][_0x353b('0x3a')]);_0x2da2a1[_0x353b('0x3b')]=qs['filters'](_[_0x353b('0x3c')](_0x146705[_0x353b('0x34')],_0xa91656[_0x353b('0x32')]),_0x5dee08);if(_0x146705['query']['filter']){_0x2da2a1[_0x353b('0x3b')]=_[_0x353b('0x3d')](_0x2da2a1['where'],{'$or':_['map'](_0x5dee08,function(_0x1879bd){if(_0x1879bd[_0x353b('0x30')]!==_0x353b('0x3e')){var _0x495c28={};_0x495c28[_0x1879bd[_0x353b('0x29')]]={'$like':'%'+_0x146705[_0x353b('0x34')]['filter']+'%'};return _0x495c28;}})});}_0x2da2a1=_['merge']({},_0x2da2a1,_0x146705[_0x353b('0x3f')]);var _0x3a5f62={'where':_0x2da2a1[_0x353b('0x3b')]};return db[_0x353b('0x2d')]['count'](_0x3a5f62)[_0x353b('0x26')](function(_0x2e69be){_0x1335d0[_0x353b('0x1d')]=_0x2e69be;if(_0x146705['query'][_0x353b('0x40')]){_0x2da2a1['include']=[{'all':!![]}];}return db['CmCustomField']['findAll'](_0x2da2a1);})[_0x353b('0x26')](function(_0x439fec){_0x1335d0['rows']=_0x439fec;return _0x1335d0;})[_0x353b('0x26')](respondWithFilteredResult(_0x30ac20,_0x2da2a1))[_0x353b('0x41')](handleError(_0x30ac20,null));};exports[_0x353b('0x42')]=function(_0x2628b7,_0x2c8bee){var _0x38e1f8={'raw':!![],'where':{'id':_0x2628b7['params']['id']}},_0x31a53e={};_0x31a53e[_0x353b('0x31')]=_[_0x353b('0x43')](db[_0x353b('0x2d')]['rawAttributes']);_0x31a53e[_0x353b('0x34')]=_[_0x353b('0x43')](_0x2628b7[_0x353b('0x34')]);_0x31a53e[_0x353b('0x32')]=_[_0x353b('0x33')](_0x31a53e[_0x353b('0x31')],_0x31a53e['query']);_0x38e1f8[_0x353b('0x35')]=_[_0x353b('0x33')](_0x31a53e['model'],qs[_0x353b('0x36')](_0x2628b7['query'][_0x353b('0x36')]));_0x38e1f8['attributes']=_0x38e1f8[_0x353b('0x35')][_0x353b('0x44')]?_0x38e1f8['attributes']:_0x31a53e['model'];if(_0x2628b7['query'][_0x353b('0x40')]){_0x38e1f8[_0x353b('0x45')]=[{'all':!![]}];}_0x38e1f8=_[_0x353b('0x3d')]({},_0x38e1f8,_0x2628b7[_0x353b('0x3f')]);return db[_0x353b('0x2d')][_0x353b('0x46')](_0x38e1f8)[_0x353b('0x26')](handleEntityNotFound(_0x2c8bee,null))[_0x353b('0x26')](respondWithResult(_0x2c8bee,null))[_0x353b('0x41')](handleError(_0x2c8bee,null));};exports[_0x353b('0x24')]=function(_0x1f699b,_0x569123){if(_0x1f699b['body']['id']){delete _0x1f699b[_0x353b('0x47')]['id'];}return db[_0x353b('0x2d')][_0x353b('0x46')]({'where':{'id':_0x1f699b[_0x353b('0x48')]['id']}})['then'](handleEntityNotFound(_0x569123,null))['then'](saveUpdates(_0x1f699b[_0x353b('0x47')],null))['then'](respondWithResult(_0x569123,null))[_0x353b('0x41')](handleError(_0x569123,null));};exports[_0x353b('0x25')]=function(_0x12d91f,_0x1e466a){return db[_0x353b('0x2d')][_0x353b('0x46')]({'where':{'id':_0x12d91f[_0x353b('0x48')]['id']}})[_0x353b('0x26')](handleEntityNotFound(_0x1e466a,null))['then'](removeEntity(_0x1e466a,null))[_0x353b('0x41')](handleError(_0x1e466a,null));};exports['create']=function(_0xac634d,_0x269979){var _0x5e6255;return db[_0x353b('0x49')][_0x353b('0x4a')](function(_0x3990c9){return db[_0x353b('0x2d')][_0x353b('0x4b')](_0xac634d[_0x353b('0x47')],{'transaction':_0x3990c9})[_0x353b('0x26')](function(_0x313d2f){_0x5e6255=_0x313d2f;var _0x477c3b={'type':db[_0x353b('0x4c')]['TEXT'],'transaction':_0x3990c9};switch(_0xac634d[_0x353b('0x47')][_0x353b('0x30')]){case _0x353b('0x4d'):_0x477c3b['type']=db['Sequelize'][_0x353b('0x4e')];break;case'number':_0x477c3b[_0x353b('0x30')]=db[_0x353b('0x4c')][_0x353b('0x4f')];break;case _0x353b('0x50'):_0x477c3b[_0x353b('0x30')]=db['Sequelize'][_0x353b('0x51')];_0x477c3b[_0x353b('0x52')]=![];break;default:}return db[_0x353b('0x49')][_0x353b('0x53')][_0x353b('0x54')](_0x353b('0x55'),util['format']('cf_%d',_0x5e6255['id']),_0x477c3b);})[_0x353b('0x26')](function(){return _0x5e6255;});})[_0x353b('0x26')](respondWithResult(_0x269979,0xc9))['catch'](handleError(_0x269979,null));};
\ No newline at end of file
index d1a3016..448595f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x157e=['cm_custom_fields','api','moment','bluebird','path','rimraf','../../config/environment','./cmCustomField.attributes','define','CmCustomField'];(function(_0x5d4f12,_0x11e67c){var _0x4eb577=function(_0x4d7a2d){while(--_0x4d7a2d){_0x5d4f12['push'](_0x5d4f12['shift']());}};_0x4eb577(++_0x11e67c);}(_0x157e,0xd3));var _0xe157=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x157e[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xe157('0x0'));var moment=require(_0xe157('0x1'));var BPromise=require(_0xe157('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe157('0x3'));var rimraf=require(_0xe157('0x4'));var config=require(_0xe157('0x5'));var attributes=require(_0xe157('0x6'));module['exports']=function(_0x3777cb,_0x4cf062){return _0x3777cb[_0xe157('0x7')](_0xe157('0x8'),attributes,{'tableName':_0xe157('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7820=['util','api','moment','bluebird','path','./cmCustomField.attributes','define','cm_custom_fields'];(function(_0x2511aa,_0x587296){var _0x325080=function(_0x32b543){while(--_0x32b543){_0x2511aa['push'](_0x2511aa['shift']());}};_0x325080(++_0x587296);}(_0x7820,0xd8));var _0x0782=function(_0x13556f,_0x35b410){_0x13556f=_0x13556f-0x0;var _0x43b023=_0x7820[_0x13556f];return _0x43b023;};'use strict';var _=require('lodash');var util=require(_0x0782('0x0'));var logger=require('../../config/logger')(_0x0782('0x1'));var moment=require(_0x0782('0x2'));var BPromise=require(_0x0782('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0782('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0782('0x5'));module['exports']=function(_0x2a0c57,_0x638120){return _0x2a0c57[_0x0782('0x6')]('CmCustomField',attributes,{'tableName':_0x0782('0x7'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0483c1c..49297c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5246=['../../config/logger','rpc','client','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','bluebird','ioredis','../../mysqldb'];(function(_0x1deee5,_0x1d4485){var _0x1d6c3a=function(_0x433abf){while(--_0x433abf){_0x1deee5['push'](_0x1deee5['shift']());}};_0x1d6c3a(++_0x1d4485);}(_0x5246,0x84));var _0x6524=function(_0x4775ad,_0x1efbfb){_0x4775ad=_0x4775ad-0x0;var _0x154fca=_0x5246[_0x4775ad];return _0x154fca;};'use strict';var _=require('lodash');var util=require(_0x6524('0x0'));var moment=require('moment');var BPromise=require(_0x6524('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6524('0x2'));var db=require(_0x6524('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6524('0x4'))(_0x6524('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6524('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a643e,_0x39d6cf,_0x5f249e){return new BPromise(function(_0x329bbb,_0x333160){return client['request'](_0x2a643e,_0x5f249e)[_0x6524('0x7')](function(_0x31bed9){logger[_0x6524('0x8')](_0x6524('0x9'),_0x39d6cf,_0x6524('0xa'));logger[_0x6524('0xb')](_0x6524('0xc'),_0x39d6cf,_0x6524('0xa'),JSON[_0x6524('0xd')](_0x31bed9));if(_0x31bed9[_0x6524('0xe')]){if(_0x31bed9[_0x6524('0xe')]['code']===0x1f4){logger[_0x6524('0xe')](_0x6524('0x9'),_0x39d6cf,_0x31bed9['error']['message']);return _0x333160(_0x31bed9[_0x6524('0xe')][_0x6524('0xf')]);}logger[_0x6524('0xe')](_0x6524('0x9'),_0x39d6cf,_0x31bed9[_0x6524('0xe')][_0x6524('0xf')]);return _0x329bbb(_0x31bed9[_0x6524('0xe')][_0x6524('0xf')]);}else{logger[_0x6524('0x8')](_0x6524('0x9'),_0x39d6cf,_0x6524('0xa'));_0x329bbb(_0x31bed9[_0x6524('0x10')][_0x6524('0xf')]);}})['catch'](function(_0x2954a1){logger[_0x6524('0xe')]('CmCustomField,\x20%s,\x20%s',_0x39d6cf,_0x2954a1);_0x333160(_0x2954a1);});});}
\ No newline at end of file
+var _0x98a3=['ioredis','../../config/logger','jayson/promise','request','then','info','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','moment','randomstring'];(function(_0x4a06e6,_0x5e81ef){var _0x1bdc90=function(_0xd07deb){while(--_0xd07deb){_0x4a06e6['push'](_0x4a06e6['shift']());}};_0x1bdc90(++_0x5e81ef);}(_0x98a3,0x18a));var _0x398a=function(_0x3c1d5b,_0xecd477){_0x3c1d5b=_0x3c1d5b-0x0;var _0x249fff=_0x98a3[_0x3c1d5b];return _0x249fff;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x398a('0x0'));var BPromise=require('bluebird');var rs=require(_0x398a('0x1'));var fs=require('fs');var Redis=require(_0x398a('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x398a('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0x398a('0x4'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4bb170,_0x119af7,_0xfd1dcb){return new BPromise(function(_0x176219,_0x1cbb8d){return client[_0x398a('0x5')](_0x4bb170,_0xfd1dcb)[_0x398a('0x6')](function(_0x5a56be){logger[_0x398a('0x7')](_0x398a('0x8'),_0x119af7,'request\x20sent');logger[_0x398a('0x9')](_0x398a('0xa'),_0x119af7,_0x398a('0xb'),JSON[_0x398a('0xc')](_0x5a56be));if(_0x5a56be[_0x398a('0xd')]){if(_0x5a56be[_0x398a('0xd')][_0x398a('0xe')]===0x1f4){logger[_0x398a('0xd')]('CmCustomField,\x20%s,\x20%s',_0x119af7,_0x5a56be[_0x398a('0xd')]['message']);return _0x1cbb8d(_0x5a56be[_0x398a('0xd')][_0x398a('0xf')]);}logger[_0x398a('0xd')](_0x398a('0x8'),_0x119af7,_0x5a56be[_0x398a('0xd')]['message']);return _0x176219(_0x5a56be[_0x398a('0xd')][_0x398a('0xf')]);}else{logger[_0x398a('0x7')](_0x398a('0x8'),_0x119af7,'request\x20sent');_0x176219(_0x5a56be[_0x398a('0x10')][_0x398a('0xf')]);}})[_0x398a('0x11')](function(_0x3de348){logger['error'](_0x398a('0x8'),_0x119af7,_0x3de348);_0x1cbb8d(_0x3de348);});});}
\ No newline at end of file
index 3aa2e25..d54f71b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34f8=['../../components/auth/service','../../components/interaction/service','./cmCustomField.controller','get','isAuthenticated','index','show','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x235b7b,_0x18c190){var _0x4b2a87=function(_0x50c837){while(--_0x50c837){_0x235b7b['push'](_0x235b7b['shift']());}};_0x4b2a87(++_0x18c190);}(_0x34f8,0x80));var _0x834f=function(_0x31f77e,_0x64cd4d){_0x31f77e=_0x31f77e-0x0;var _0x3bf479=_0x34f8[_0x31f77e];return _0x3bf479;};'use strict';var multer=require(_0x834f('0x0'));var util=require(_0x834f('0x1'));var path=require(_0x834f('0x2'));var timeout=require(_0x834f('0x3'));var express=require(_0x834f('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x834f('0x5'));var interaction=require(_0x834f('0x6'));var config=require('../../config/environment');var controller=require(_0x834f('0x7'));router[_0x834f('0x8')]('/',auth[_0x834f('0x9')](),controller[_0x834f('0xa')]);router['get']('/:id',auth[_0x834f('0x9')](),controller[_0x834f('0xb')]);router[_0x834f('0xc')]('/',auth[_0x834f('0x9')](),controller['create']);router[_0x834f('0xd')](_0x834f('0xe'),auth['isAuthenticated'](),controller[_0x834f('0xf')]);router[_0x834f('0x10')](_0x834f('0xe'),auth[_0x834f('0x9')](),controller[_0x834f('0x11')]);module[_0x834f('0x12')]=router;
\ No newline at end of file
+var _0xff3c=['util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','/:id','show','create','put','update','delete','destroy','exports','multer'];(function(_0x10e983,_0x2f4eda){var _0x324138=function(_0x17a377){while(--_0x17a377){_0x10e983['push'](_0x10e983['shift']());}};_0x324138(++_0x2f4eda);}(_0xff3c,0x179));var _0xcff3=function(_0x5b83e5,_0xb0f98a){_0x5b83e5=_0x5b83e5-0x0;var _0x1c75b9=_0xff3c[_0x5b83e5];return _0x1c75b9;};'use strict';var multer=require(_0xcff3('0x0'));var util=require(_0xcff3('0x1'));var path=require('path');var timeout=require(_0xcff3('0x2'));var express=require(_0xcff3('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcff3('0x4'));var interaction=require(_0xcff3('0x5'));var config=require(_0xcff3('0x6'));var controller=require(_0xcff3('0x7'));router[_0xcff3('0x8')]('/',auth[_0xcff3('0x9')](),controller['index']);router['get'](_0xcff3('0xa'),auth['isAuthenticated'](),controller[_0xcff3('0xb')]);router['post']('/',auth[_0xcff3('0x9')](),controller[_0xcff3('0xc')]);router[_0xcff3('0xd')](_0xcff3('0xa'),auth[_0xcff3('0x9')](),controller[_0xcff3('0xe')]);router[_0xcff3('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xcff3('0x10')]);module[_0xcff3('0x11')]=router;
\ No newline at end of file
index 5cef190..20f384f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6605=['BOOLEAN','format','INTEGER','DATE','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0x6605,0x1be));var _0x5660=function(_0x34b863,_0x46e0a4){_0x34b863=_0x34b863-0x0;var _0x20cabb=_0x6605[_0x34b863];return _0x20cabb;};'use strict';var moment=require(_0x5660('0x0'));var Sequelize=require(_0x5660('0x1'));module[_0x5660('0x2')]={'phone':{'type':Sequelize[_0x5660('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x5660('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x5660('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5660('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x5660('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5660('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5660('0x7')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x5660('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x5660('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x5660('0x6')],'unique':_0x5660('0x9')},'ListId':{'type':Sequelize[_0x5660('0x6')],'unique':_0x5660('0x9')},'UserId':{'type':Sequelize[_0x5660('0x6')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x5660('0x9')},'CampaignId':{'type':Sequelize[_0x5660('0x6')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5660('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5660('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x05ca=['moment','sequelize','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN','contactListQueue'];(function(_0x87eb24,_0x19556a){var _0x2527f3=function(_0xa56b77){while(--_0xa56b77){_0x87eb24['push'](_0x87eb24['shift']());}};_0x2527f3(++_0x19556a);}(_0x05ca,0x7e));var _0xa05c=function(_0x2ef09f,_0x56290b){_0x2ef09f=_0x2ef09f-0x0;var _0x1a6d36=_0x05ca[_0x2ef09f];return _0x1a6d36;};'use strict';var moment=require(_0xa05c('0x0'));var Sequelize=require(_0xa05c('0x1'));module['exports']={'phone':{'type':Sequelize[_0xa05c('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xa05c('0x3')],'defaultValue':moment()[_0xa05c('0x4')](_0xa05c('0x5'))},'countbusyretry':{'type':Sequelize[_0xa05c('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0xa05c('0x7')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa05c('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa05c('0x3')]},'priority':{'type':Sequelize[_0xa05c('0x6')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xa05c('0x7')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xa05c('0x6')],'unique':_0xa05c('0x8')},'ListId':{'type':Sequelize[_0xa05c('0x6')],'unique':_0xa05c('0x8')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0xa05c('0x6')],'unique':_0xa05c('0x8')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0xa05c('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa05c('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa05c('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa05c('0x6')],'defaultValue':0x0}};
\ No newline at end of file
index 298d79f..ed4d23c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc442=['catch','show','keys','create','body','find','params','describe','destroy','VoiceQueueId','CampaignId','Campaign','omit','dataValues','updatedAt','state','deleted','campaign','user','UserId','deletedat','calleridnum','phone','queue','ivr','CmContact','ContactId','firstName','isNil','calleridname','lastName','finally','CmHopperFinal','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','format','direction','prev','hopperIds','priority','ASC','scheduledAt','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','scheduledat','LOCK','UPDATE','Contact','Company','CmList','List','Queue','getOpenContacts','preview','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','sendStatus','error','stack','name','send','index','CmHopper','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','concat','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$in','$like','$notLike','$overlap','$contains','$contained','$any','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0x3eca88,_0x34268e){var _0x5f58a4=function(_0xe7a331){while(--_0xe7a331){_0x3eca88['push'](_0x3eca88['shift']());}};_0x5f58a4(++_0x34268e);}(_0xc442,0x165));var _0x2c44=function(_0x1903dd,_0x25136f){_0x1903dd=_0x1903dd-0x0;var _0x2a4e4c=_0xc442[_0x1903dd];return _0x2a4e4c;};'use strict';var emlformat=require(_0x2c44('0x0'));var rimraf=require(_0x2c44('0x1'));var zipdir=require(_0x2c44('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2c44('0x3'));var moment=require(_0x2c44('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2c44('0x5'));var util=require(_0x2c44('0x6'));var path=require(_0x2c44('0x7'));var sox=require(_0x2c44('0x8'));var csv=require(_0x2c44('0x9'));var ejs=require(_0x2c44('0xa'));var fs=require('fs');var fs_extra=require(_0x2c44('0xb'));var _=require(_0x2c44('0xc'));var squel=require(_0x2c44('0xd'));var crypto=require(_0x2c44('0xe'));var jsforce=require(_0x2c44('0xf'));var deskjs=require(_0x2c44('0x10'));var toCsv=require(_0x2c44('0x9'));var querystring=require(_0x2c44('0x11'));var Papa=require(_0x2c44('0x12'));var Redis=require(_0x2c44('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x2c44('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2c44('0x15'))('api');var utils=require(_0x2c44('0x16'));var config=require(_0x2c44('0x17'));var licenseUtil=require(_0x2c44('0x18'));var db=require(_0x2c44('0x19'))['db'];function respondWithStatusCode(_0x4ac875,_0x3a27ab){_0x3a27ab=_0x3a27ab||0xcc;return function(_0x509851){if(_0x509851){return _0x4ac875['sendStatus'](_0x3a27ab);}return _0x4ac875[_0x2c44('0x1a')](_0x3a27ab)[_0x2c44('0x1b')]();};}function respondWithResult(_0x3f0be6,_0x3a5978){_0x3a5978=_0x3a5978||0xc8;return function(_0x2b125a){if(_0x2b125a){return _0x3f0be6[_0x2c44('0x1a')](_0x3a5978)[_0x2c44('0x1c')](_0x2b125a);}};}function respondWithFilteredResult(_0x22f050,_0x5188a9){return function(_0x5b1f81){if(_0x5b1f81){var _0x1d9ae9=typeof _0x5188a9['offset']===_0x2c44('0x1d')&&typeof _0x5188a9[_0x2c44('0x1e')]==='undefined';var _0x463b77=_0x5b1f81[_0x2c44('0x1f')];var _0x143f10=_0x1d9ae9?0x0:_0x5188a9['offset'];var _0x46dafc=_0x1d9ae9?_0x5b1f81['count']:_0x5188a9[_0x2c44('0x20')]+_0x5188a9[_0x2c44('0x1e')];var _0x3d9979;if(_0x46dafc>=_0x463b77){_0x46dafc=_0x463b77;_0x3d9979=0xc8;}else{_0x3d9979=0xce;}_0x22f050[_0x2c44('0x1a')](_0x3d9979);return _0x22f050['set'](_0x2c44('0x21'),_0x143f10+'-'+_0x46dafc+'/'+_0x463b77)[_0x2c44('0x1c')](_0x5b1f81);}return null;};}function patchUpdates(_0x2dc291){return function(_0x152140){try{jsonpatch['apply'](_0x152140,_0x2dc291,!![]);}catch(_0x4735c5){return BPromise[_0x2c44('0x22')](_0x4735c5);}return _0x152140[_0x2c44('0x23')]();};}function saveUpdates(_0xd464d5,_0x2857ec){return function(_0x41d4a6){if(_0x41d4a6){return _0x41d4a6[_0x2c44('0x24')](_0xd464d5)[_0x2c44('0x25')](function(_0x5706b7){return _0x5706b7;});}return null;};}function removeEntity(_0x2a1fad,_0x195060){return function(_0x451a32){if(_0x451a32){return _0x451a32['destroy']()[_0x2c44('0x25')](function(){_0x2a1fad['status'](0xcc)[_0x2c44('0x1b')]();});}};}function handleEntityNotFound(_0x5f4015,_0x2bb992){return function(_0x2f1c68){if(!_0x2f1c68){_0x5f4015[_0x2c44('0x26')](0x194);}return _0x2f1c68;};}function handleError(_0x38806a,_0x3e3425){_0x3e3425=_0x3e3425||0x1f4;return function(_0x4cadd1){logger[_0x2c44('0x27')](_0x4cadd1[_0x2c44('0x28')]);if(_0x4cadd1[_0x2c44('0x29')]){delete _0x4cadd1[_0x2c44('0x29')];}_0x38806a[_0x2c44('0x1a')](_0x3e3425)[_0x2c44('0x2a')](_0x4cadd1);};}exports[_0x2c44('0x2b')]=function(_0xb19f33,_0x370073){var _0x193483={},_0x1d1cfc={},_0x156458={'count':0x0,'rows':[]};var _0x2ec119=_['map'](db[_0x2c44('0x2c')][_0x2c44('0x2d')],function(_0x2ed36b){return{'name':_0x2ed36b[_0x2c44('0x2e')],'type':_0x2ed36b[_0x2c44('0x2f')][_0x2c44('0x30')]};});_0x1d1cfc[_0x2c44('0x31')]=_[_0x2c44('0x32')](_0x2ec119,_0x2c44('0x29'));_0x1d1cfc[_0x2c44('0x33')]=_['keys'](_0xb19f33[_0x2c44('0x33')]);_0x1d1cfc[_0x2c44('0x34')]=_[_0x2c44('0x35')](_0x1d1cfc['model'],_0x1d1cfc[_0x2c44('0x33')]);_0x1d1cfc['filters']=_[_0x2c44('0x36')](_0x1d1cfc[_0x2c44('0x34')],['$and','$or',_0x2c44('0x37'),_0x2c44('0x38'),_0x2c44('0x39'),_0x2c44('0x3a'),_0x2c44('0x3b'),_0x2c44('0x3c'),_0x2c44('0x3d'),_0x2c44('0x3e'),'$notBetween',_0x2c44('0x3f'),'$notIn',_0x2c44('0x40'),_0x2c44('0x41'),'$iLike','$notILike','$like',_0x2c44('0x42'),_0x2c44('0x43'),_0x2c44('0x44'),_0x2c44('0x45')]);_0x193483['attributes']=_['intersection'](_0x1d1cfc['model'],qs['fields'](_0xb19f33[_0x2c44('0x33')][_0x2c44('0x46')]));_0x193483[_0x2c44('0x47')]=_0x193483['attributes'][_0x2c44('0x48')]?_0x193483[_0x2c44('0x47')]:_0x1d1cfc[_0x2c44('0x31')];if(!_0xb19f33[_0x2c44('0x33')][_0x2c44('0x49')](_0x2c44('0x4a'))){_0x193483[_0x2c44('0x1e')]=qs[_0x2c44('0x1e')](_0xb19f33['query'][_0x2c44('0x1e')]);_0x193483['offset']=qs[_0x2c44('0x20')](_0xb19f33['query']['offset']);}_0x193483[_0x2c44('0x4b')]=qs[_0x2c44('0x4c')](_0xb19f33[_0x2c44('0x33')][_0x2c44('0x4c')]);_0x193483[_0x2c44('0x4d')]=qs[_0x2c44('0x34')](_[_0x2c44('0x4e')](_0xb19f33[_0x2c44('0x33')],_0x1d1cfc['filters']),_0x2ec119);if(_0xb19f33[_0x2c44('0x33')][_0x2c44('0x4f')]){_0x193483[_0x2c44('0x4d')]=_[_0x2c44('0x50')](_0x193483[_0x2c44('0x4d')],{'$or':_[_0x2c44('0x32')](_0x2ec119,function(_0x1c505b){if(_0x1c505b[_0x2c44('0x2f')]!==_0x2c44('0x51')){var _0x3e152c={};_0x3e152c[_0x1c505b[_0x2c44('0x29')]]={'$like':'%'+_0xb19f33[_0x2c44('0x33')][_0x2c44('0x4f')]+'%'};return _0x3e152c;}})});}_0x193483=_[_0x2c44('0x50')]({},_0x193483,_0xb19f33[_0x2c44('0x52')]);var _0x3d1aad={'where':_0x193483[_0x2c44('0x4d')]};return db[_0x2c44('0x2c')][_0x2c44('0x1f')](_0x3d1aad)[_0x2c44('0x25')](function(_0x32cb1f){_0x156458[_0x2c44('0x1f')]=_0x32cb1f;if(_0xb19f33[_0x2c44('0x33')][_0x2c44('0x53')]){_0x193483[_0x2c44('0x54')]=[{'all':!![]}];}return db[_0x2c44('0x2c')][_0x2c44('0x55')](_0x193483);})[_0x2c44('0x25')](function(_0x1b5b20){_0x156458[_0x2c44('0x56')]=_0x1b5b20;return _0x156458;})['then'](respondWithFilteredResult(_0x370073,_0x193483))[_0x2c44('0x57')](handleError(_0x370073,null));};exports[_0x2c44('0x58')]=function(_0x4f4039,_0x212969){var _0x2b7ad6={'raw':!![],'where':{'id':_0x4f4039['params']['id']}},_0x3e66b5={};_0x3e66b5[_0x2c44('0x31')]=_[_0x2c44('0x59')](db[_0x2c44('0x2c')]['rawAttributes']);_0x3e66b5[_0x2c44('0x33')]=_[_0x2c44('0x59')](_0x4f4039['query']);_0x3e66b5[_0x2c44('0x34')]=_[_0x2c44('0x35')](_0x3e66b5[_0x2c44('0x31')],_0x3e66b5[_0x2c44('0x33')]);_0x2b7ad6[_0x2c44('0x47')]=_[_0x2c44('0x35')](_0x3e66b5[_0x2c44('0x31')],qs[_0x2c44('0x46')](_0x4f4039['query'][_0x2c44('0x46')]));_0x2b7ad6[_0x2c44('0x47')]=_0x2b7ad6[_0x2c44('0x47')][_0x2c44('0x48')]?_0x2b7ad6[_0x2c44('0x47')]:_0x3e66b5['model'];if(_0x4f4039[_0x2c44('0x33')][_0x2c44('0x53')]){_0x2b7ad6[_0x2c44('0x54')]=[{'all':!![]}];}_0x2b7ad6=_[_0x2c44('0x50')]({},_0x2b7ad6,_0x4f4039[_0x2c44('0x52')]);return db['CmHopper']['find'](_0x2b7ad6)['then'](handleEntityNotFound(_0x212969,null))[_0x2c44('0x25')](respondWithResult(_0x212969,null))[_0x2c44('0x57')](handleError(_0x212969,null));};exports[_0x2c44('0x5a')]=function(_0x41f97e,_0x4a87be){return db['CmHopper'][_0x2c44('0x5a')](_0x41f97e[_0x2c44('0x5b')],{})[_0x2c44('0x25')](respondWithResult(_0x4a87be,0xc9))[_0x2c44('0x57')](handleError(_0x4a87be,null));};exports[_0x2c44('0x24')]=function(_0x204467,_0x14aa21){if(_0x204467[_0x2c44('0x5b')]['id']){delete _0x204467[_0x2c44('0x5b')]['id'];}return db[_0x2c44('0x2c')][_0x2c44('0x5c')]({'where':{'id':_0x204467[_0x2c44('0x5d')]['id']}})[_0x2c44('0x25')](handleEntityNotFound(_0x14aa21,null))[_0x2c44('0x25')](saveUpdates(_0x204467['body'],null))[_0x2c44('0x25')](respondWithResult(_0x14aa21,null))['catch'](handleError(_0x14aa21,null));};exports[_0x2c44('0x5e')]=function(_0x1c8271,_0x3dd624){return db[_0x2c44('0x2c')]['describe']()[_0x2c44('0x25')](respondWithResult(_0x3dd624,null))[_0x2c44('0x57')](handleError(_0x3dd624,null));};exports['destroy']=function(_0xae5d47,_0x3b484a){var _0x5762c8;return db[_0x2c44('0x2c')][_0x2c44('0x5c')]({'where':{'id':_0xae5d47[_0x2c44('0x5d')]['id']}})[_0x2c44('0x25')](handleEntityNotFound(_0x3b484a,null))['then'](function(_0x4083af){if(_0x4083af){return _0x4083af[_0x2c44('0x5f')]()['then'](function(_0x42e4ba){return _0x42e4ba;});}})[_0x2c44('0x25')](function(_0x4fc443){_0x5762c8=_0x4fc443;if(_0x4fc443){if(_0x4fc443[_0x2c44('0x60')]||_0x4fc443[_0x2c44('0x61')]){return db[_0x4fc443[_0x2c44('0x60')]?'VoiceQueue':_0x2c44('0x62')]['find']({'where':{'id':_0x4fc443['VoiceQueueId']?_0x4fc443[_0x2c44('0x60')]:_0x4fc443[_0x2c44('0x61')]},'attributes':['id',_0x2c44('0x29')],'raw':!![]});}}})[_0x2c44('0x25')](function(_0x68c09d){var _0x4cbaea={};if(_0x68c09d){_[_0x2c44('0x50')](_0x4cbaea,_[_0x2c44('0x63')](_0x5762c8[_0x2c44('0x64')],['createdAt',_0x2c44('0x65'),'id']));_0x4cbaea[_0x2c44('0x66')]=0x15;_0x4cbaea['statedesc']=_0x2c44('0x67');_0x4cbaea[_0x2c44('0x68')]=_0x68c09d[_0x2c44('0x29')];_0x4cbaea['membername']=_0xae5d47[_0x2c44('0x69')][_0x2c44('0x29')];_0x4cbaea[_0x2c44('0x6a')]=_0xae5d47['user']['id'];_0x4cbaea[_0x2c44('0x67')]=!![];_0x4cbaea[_0x2c44('0x6b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4cbaea[_0x2c44('0x6c')]=_0x5762c8[_0x2c44('0x6d')];_0x4cbaea['campaigntype']=_0x5762c8[_0x2c44('0x60')]?_0x2c44('0x6e'):_0x2c44('0x6f');return db[_0x2c44('0x70')][_0x2c44('0x5c')]({'where':{'id':_0x4cbaea[_0x2c44('0x71')]},'attributes':[_0x2c44('0x72'),'lastName']})['then'](function(_0x332caa){if(!_[_0x2c44('0x73')](_0x3b484a)&&!_[_0x2c44('0x73')](_0x332caa[_0x2c44('0x72')])){_0x4cbaea[_0x2c44('0x74')]=_0x332caa[_0x2c44('0x72')];if(!_['isNil'](_0x332caa[_0x2c44('0x75')])){_0x4cbaea[_0x2c44('0x74')]+='\x20'+_0x332caa[_0x2c44('0x75')];}}})[_0x2c44('0x76')](function(){return db[_0x2c44('0x77')]['create'](_0x4cbaea);});}})['then'](function(){return _0x3b484a['status'](0xcc)[_0x2c44('0x1b')]();})[_0x2c44('0x57')](handleError(_0x3b484a,null));};exports[_0x2c44('0x78')]=function(_0x158eba,_0x375fc1,_0x56389c){var _0x44b032=[];return db['CmContact'][_0x2c44('0x5e')]()[_0x2c44('0x25')](function(_0x3a85fb){_0x44b032=_['keys'](_0x3a85fb);return _0x158eba[_0x2c44('0x69')][_0x2c44('0x79')]({'where':{'type':_0x2c44('0x7a'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x2c44('0x7b')],'raw':!![]});})[_0x2c44('0x25')](function(_0x2d801d){if(_0x2d801d&&_0x2d801d['length']){return db['sequelize']['transaction'](function(_0x2dc8d9){var _0x29062b={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x2c44('0x7c')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x2c44('0x32')](_0x2d801d,'id')},'$or':[{'UserId':null},{'UserId':_0x158eba[_0x2c44('0x69')]['id']}]};var _0x5e284a=[];if(_0x158eba[_0x2c44('0x5b')][_0x2c44('0x7d')]&&_0x158eba[_0x2c44('0x5b')][_0x2c44('0x7d')]===_0x2c44('0x7e')){if(!_['isEmpty'](_0x158eba[_0x2c44('0x5b')][_0x2c44('0x7f')])){_0x29062b['id']={'$in':_0x158eba[_0x2c44('0x5b')][_0x2c44('0x7f')]};}_0x5e284a=[[_0x2c44('0x80'),_0x2c44('0x81')],[_0x2c44('0x82'),_0x2d801d[0x0][_0x2c44('0x7b')]===_0x2c44('0x81')?_0x2c44('0x83'):_0x2c44('0x81')],db[_0x2c44('0x84')][_0x2c44('0x85')](_0x2c44('0x86')),['id','DESC']];}else{if(!_[_0x2c44('0x87')](_0x158eba[_0x2c44('0x5b')][_0x2c44('0x7f')])){_0x29062b['id']={'$notIn':_0x158eba['body'][_0x2c44('0x7f')]};}_0x5e284a=[[_0x2c44('0x80'),_0x2c44('0x83')],[_0x2c44('0x82'),_0x2d801d[0x0]['dialOrderByScheduledAt']],db[_0x2c44('0x84')][_0x2c44('0x85')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id','ASC']];}return db['CmHopper']['findOne']({'attributes':['id',_0x2c44('0x88')],'where':_0x29062b,'order':_0x5e284a,'transaction':_0x2dc8d9,'lock':_0x2dc8d9[_0x2c44('0x89')][_0x2c44('0x8a')],'include':[{'model':db[_0x2c44('0x70')],'as':_0x2c44('0x8b'),'attributes':_0x44b032,'include':[{'model':db['CmCompany'],'as':_0x2c44('0x8c'),'attributes':['id','name']}]},{'model':db[_0x2c44('0x8d')],'as':_0x2c44('0x8e'),'attributes':['id',_0x2c44('0x29')]},{'model':db['VoiceQueue'],'as':_0x2c44('0x8f'),'attributes':['id',_0x2c44('0x29'),'dialActive']}]})[_0x2c44('0x25')](function(_0x48f71a){if(_0x48f71a){return _0x48f71a[_0x2c44('0x24')]({'UserId':_0x158eba['user']['id']},{'transaction':_0x2dc8d9});}});});}})['then'](handleEntityNotFound(_0x375fc1,null))[_0x2c44('0x25')](respondWithResult(_0x375fc1,null))[_0x2c44('0x57')](handleError(_0x375fc1,null));};exports[_0x2c44('0x90')]=function(_0x2774a6,_0x309a5a,_0x49a182){return _0x2774a6[_0x2c44('0x69')][_0x2c44('0x79')]({'where':{'type':_0x2c44('0x7a'),'dialActive':!![],'dialMethod':_0x2c44('0x91')},'attributes':['id'],'raw':!![]})[_0x2c44('0x25')](function(_0x12120d){if(_0x12120d&&_0x12120d['length']){return db[_0x2c44('0x2c')][_0x2c44('0x1f')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x2c44('0x7c')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x2c44('0x32')](_0x12120d,'id')},'$or':[{'UserId':null},{'UserId':_0x2774a6['user']['id']}]}});}return 0x0;})[_0x2c44('0x25')](function(_0x1381ca){if(!_[_0x2c44('0x73')](_0x1381ca)&&_['isNumber'](_0x1381ca)){return _0x309a5a['status'](0xc8)['json']({'contacts':_0x1381ca});}else{logger[_0x2c44('0x27')](_0x2c44('0x92'),_0x2c44('0x90'),0x194,_0x2c44('0x93'));_0x309a5a[_0x2c44('0x26')](0x194);}})['catch'](handleError(_0x309a5a,null));};
\ No newline at end of file
+var _0x4c88=['scheduledAt','ASC','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','literal','findOne','LOCK','UPDATE','CmCompany','Company','CmList','List','dialActive','getOpenContacts','outbound','entity\x20not\x20found','zip-dir','fast-json-patch','moment','bluebird','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/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','apply','reject','update','destroy','error','stack','name','map','CmHopper','rawAttributes','fieldName','type','key','model','query','keys','filters','concat','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notLike','$iLike','$notILike','$overlap','$any','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','rows','show','params','find','catch','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','deleted','campaign','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','lastName','isNil','calleridname','finally','CmHopperFinal','getPreview','getVoiceQueues','preview','dialOrderByScheduledAt','sequelize','prev','hopperIds','priority'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x4c88,0x12b));var _0x84c8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4c88[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x84c8('0x0'));var jsonpatch=require(_0x84c8('0x1'));var rp=require('request-promise');var moment=require(_0x84c8('0x2'));var BPromise=require(_0x84c8('0x3'));var Mustache=require('mustache');var util=require(_0x84c8('0x4'));var path=require(_0x84c8('0x5'));var sox=require(_0x84c8('0x6'));var csv=require(_0x84c8('0x7'));var ejs=require(_0x84c8('0x8'));var fs=require('fs');var fs_extra=require(_0x84c8('0x9'));var _=require('lodash');var squel=require(_0x84c8('0xa'));var crypto=require(_0x84c8('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x84c8('0xc'));var toCsv=require(_0x84c8('0x7'));var querystring=require(_0x84c8('0xd'));var Papa=require(_0x84c8('0xe'));var Redis=require(_0x84c8('0xf'));var authService=require(_0x84c8('0x10'));var qs=require(_0x84c8('0x11'));var as=require(_0x84c8('0x12'));var hardwareService=require(_0x84c8('0x13'));var logger=require('../../config/logger')(_0x84c8('0x14'));var utils=require(_0x84c8('0x15'));var config=require(_0x84c8('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x84c8('0x17'))['db'];function respondWithStatusCode(_0x544f05,_0x16886e){_0x16886e=_0x16886e||0xcc;return function(_0x1f6051){if(_0x1f6051){return _0x544f05[_0x84c8('0x18')](_0x16886e);}return _0x544f05['status'](_0x16886e)[_0x84c8('0x19')]();};}function respondWithResult(_0x10fa02,_0x1b18d3){_0x1b18d3=_0x1b18d3||0xc8;return function(_0x44585c){if(_0x44585c){return _0x10fa02[_0x84c8('0x1a')](_0x1b18d3)[_0x84c8('0x1b')](_0x44585c);}};}function respondWithFilteredResult(_0x28069e,_0x5a221f){return function(_0x2b76d0){if(_0x2b76d0){var _0x206211=typeof _0x5a221f[_0x84c8('0x1c')]==='undefined'&&typeof _0x5a221f[_0x84c8('0x1d')]==='undefined';var _0x166d06=_0x2b76d0[_0x84c8('0x1e')];var _0xfad9a3=_0x206211?0x0:_0x5a221f[_0x84c8('0x1c')];var _0x4a4f27=_0x206211?_0x2b76d0['count']:_0x5a221f['offset']+_0x5a221f[_0x84c8('0x1d')];var _0x1612df;if(_0x4a4f27>=_0x166d06){_0x4a4f27=_0x166d06;_0x1612df=0xc8;}else{_0x1612df=0xce;}_0x28069e['status'](_0x1612df);return _0x28069e[_0x84c8('0x1f')]('Content-Range',_0xfad9a3+'-'+_0x4a4f27+'/'+_0x166d06)['json'](_0x2b76d0);}return null;};}function patchUpdates(_0x5cba62){return function(_0x3f1fbd){try{jsonpatch[_0x84c8('0x20')](_0x3f1fbd,_0x5cba62,!![]);}catch(_0x4530d1){return BPromise[_0x84c8('0x21')](_0x4530d1);}return _0x3f1fbd['save']();};}function saveUpdates(_0x29677c,_0xe819fa){return function(_0x144aa4){if(_0x144aa4){return _0x144aa4[_0x84c8('0x22')](_0x29677c)['then'](function(_0x153dc8){return _0x153dc8;});}return null;};}function removeEntity(_0x26b9d0,_0x1da55b){return function(_0x2603db){if(_0x2603db){return _0x2603db[_0x84c8('0x23')]()['then'](function(){_0x26b9d0[_0x84c8('0x1a')](0xcc)[_0x84c8('0x19')]();});}};}function handleEntityNotFound(_0x425e6b,_0x2e4ef2){return function(_0x1324bf){if(!_0x1324bf){_0x425e6b[_0x84c8('0x18')](0x194);}return _0x1324bf;};}function handleError(_0x1d4fdc,_0x35bef3){_0x35bef3=_0x35bef3||0x1f4;return function(_0x80beb4){logger[_0x84c8('0x24')](_0x80beb4[_0x84c8('0x25')]);if(_0x80beb4[_0x84c8('0x26')]){delete _0x80beb4[_0x84c8('0x26')];}_0x1d4fdc[_0x84c8('0x1a')](_0x35bef3)['send'](_0x80beb4);};}exports['index']=function(_0x31acbf,_0x25b115){var _0x277b72={},_0x494484={},_0x50f4f2={'count':0x0,'rows':[]};var _0x56474e=_[_0x84c8('0x27')](db[_0x84c8('0x28')][_0x84c8('0x29')],function(_0x437cbb){return{'name':_0x437cbb[_0x84c8('0x2a')],'type':_0x437cbb[_0x84c8('0x2b')][_0x84c8('0x2c')]};});_0x494484[_0x84c8('0x2d')]=_['map'](_0x56474e,_0x84c8('0x26'));_0x494484[_0x84c8('0x2e')]=_[_0x84c8('0x2f')](_0x31acbf['query']);_0x494484['filters']=_['intersection'](_0x494484[_0x84c8('0x2d')],_0x494484[_0x84c8('0x2e')]);_0x494484[_0x84c8('0x30')]=_[_0x84c8('0x31')](_0x494484[_0x84c8('0x30')],['$and',_0x84c8('0x32'),_0x84c8('0x33'),_0x84c8('0x34'),_0x84c8('0x35'),_0x84c8('0x36'),_0x84c8('0x37'),_0x84c8('0x38'),_0x84c8('0x39'),_0x84c8('0x3a'),_0x84c8('0x3b'),_0x84c8('0x3c'),'$notIn','$like',_0x84c8('0x3d'),_0x84c8('0x3e'),_0x84c8('0x3f'),'$like',_0x84c8('0x40'),'$contains','$contained',_0x84c8('0x41')]);_0x277b72['attributes']=_[_0x84c8('0x42')](_0x494484['model'],qs[_0x84c8('0x43')](_0x31acbf[_0x84c8('0x2e')][_0x84c8('0x43')]));_0x277b72['attributes']=_0x277b72[_0x84c8('0x44')][_0x84c8('0x45')]?_0x277b72[_0x84c8('0x44')]:_0x494484['model'];if(!_0x31acbf[_0x84c8('0x2e')]['hasOwnProperty'](_0x84c8('0x46'))){_0x277b72['limit']=qs[_0x84c8('0x1d')](_0x31acbf['query'][_0x84c8('0x1d')]);_0x277b72[_0x84c8('0x1c')]=qs[_0x84c8('0x1c')](_0x31acbf[_0x84c8('0x2e')][_0x84c8('0x1c')]);}_0x277b72[_0x84c8('0x47')]=qs[_0x84c8('0x48')](_0x31acbf[_0x84c8('0x2e')][_0x84c8('0x48')]);_0x277b72[_0x84c8('0x49')]=qs[_0x84c8('0x30')](_[_0x84c8('0x4a')](_0x31acbf[_0x84c8('0x2e')],_0x494484[_0x84c8('0x30')]),_0x56474e);if(_0x31acbf[_0x84c8('0x2e')][_0x84c8('0x4b')]){_0x277b72['where']=_[_0x84c8('0x4c')](_0x277b72[_0x84c8('0x49')],{'$or':_[_0x84c8('0x27')](_0x56474e,function(_0x303294){if(_0x303294[_0x84c8('0x2b')]!==_0x84c8('0x4d')){var _0x196dec={};_0x196dec[_0x303294[_0x84c8('0x26')]]={'$like':'%'+_0x31acbf[_0x84c8('0x2e')][_0x84c8('0x4b')]+'%'};return _0x196dec;}})});}_0x277b72=_[_0x84c8('0x4c')]({},_0x277b72,_0x31acbf[_0x84c8('0x4e')]);var _0x1294de={'where':_0x277b72['where']};return db[_0x84c8('0x28')][_0x84c8('0x1e')](_0x1294de)[_0x84c8('0x4f')](function(_0x27b225){_0x50f4f2[_0x84c8('0x1e')]=_0x27b225;if(_0x31acbf[_0x84c8('0x2e')][_0x84c8('0x50')]){_0x277b72[_0x84c8('0x51')]=[{'all':!![]}];}return db[_0x84c8('0x28')]['findAll'](_0x277b72);})[_0x84c8('0x4f')](function(_0x932f98){_0x50f4f2[_0x84c8('0x52')]=_0x932f98;return _0x50f4f2;})[_0x84c8('0x4f')](respondWithFilteredResult(_0x25b115,_0x277b72))['catch'](handleError(_0x25b115,null));};exports[_0x84c8('0x53')]=function(_0x1a1ac8,_0x46c858){var _0x388605={'raw':!![],'where':{'id':_0x1a1ac8[_0x84c8('0x54')]['id']}},_0x102070={};_0x102070[_0x84c8('0x2d')]=_[_0x84c8('0x2f')](db[_0x84c8('0x28')][_0x84c8('0x29')]);_0x102070[_0x84c8('0x2e')]=_['keys'](_0x1a1ac8[_0x84c8('0x2e')]);_0x102070['filters']=_[_0x84c8('0x42')](_0x102070[_0x84c8('0x2d')],_0x102070[_0x84c8('0x2e')]);_0x388605['attributes']=_[_0x84c8('0x42')](_0x102070[_0x84c8('0x2d')],qs['fields'](_0x1a1ac8[_0x84c8('0x2e')][_0x84c8('0x43')]));_0x388605[_0x84c8('0x44')]=_0x388605[_0x84c8('0x44')][_0x84c8('0x45')]?_0x388605[_0x84c8('0x44')]:_0x102070['model'];if(_0x1a1ac8[_0x84c8('0x2e')][_0x84c8('0x50')]){_0x388605[_0x84c8('0x51')]=[{'all':!![]}];}_0x388605=_['merge']({},_0x388605,_0x1a1ac8[_0x84c8('0x4e')]);return db['CmHopper'][_0x84c8('0x55')](_0x388605)[_0x84c8('0x4f')](handleEntityNotFound(_0x46c858,null))[_0x84c8('0x4f')](respondWithResult(_0x46c858,null))[_0x84c8('0x56')](handleError(_0x46c858,null));};exports[_0x84c8('0x57')]=function(_0x48c6bc,_0x29127a){return db[_0x84c8('0x28')][_0x84c8('0x57')](_0x48c6bc[_0x84c8('0x58')],{})[_0x84c8('0x4f')](respondWithResult(_0x29127a,0xc9))[_0x84c8('0x56')](handleError(_0x29127a,null));};exports[_0x84c8('0x22')]=function(_0xa696c9,_0x5aa322){if(_0xa696c9[_0x84c8('0x58')]['id']){delete _0xa696c9['body']['id'];}return db[_0x84c8('0x28')]['find']({'where':{'id':_0xa696c9[_0x84c8('0x54')]['id']}})['then'](handleEntityNotFound(_0x5aa322,null))[_0x84c8('0x4f')](saveUpdates(_0xa696c9['body'],null))['then'](respondWithResult(_0x5aa322,null))[_0x84c8('0x56')](handleError(_0x5aa322,null));};exports[_0x84c8('0x59')]=function(_0x5c4405,_0x3463d4){return db[_0x84c8('0x28')]['describe']()[_0x84c8('0x4f')](respondWithResult(_0x3463d4,null))[_0x84c8('0x56')](handleError(_0x3463d4,null));};exports['destroy']=function(_0x42c7f4,_0x4ede5b){var _0x3c55e8;return db[_0x84c8('0x28')][_0x84c8('0x55')]({'where':{'id':_0x42c7f4['params']['id']}})['then'](handleEntityNotFound(_0x4ede5b,null))['then'](function(_0x1b51e8){if(_0x1b51e8){return _0x1b51e8['destroy']()[_0x84c8('0x4f')](function(_0x43da67){return _0x43da67;});}})['then'](function(_0x3e8d16){_0x3c55e8=_0x3e8d16;if(_0x3e8d16){if(_0x3e8d16[_0x84c8('0x5a')]||_0x3e8d16[_0x84c8('0x5b')]){return db[_0x3e8d16[_0x84c8('0x5a')]?_0x84c8('0x5c'):_0x84c8('0x5d')][_0x84c8('0x55')]({'where':{'id':_0x3e8d16['VoiceQueueId']?_0x3e8d16[_0x84c8('0x5a')]:_0x3e8d16[_0x84c8('0x5b')]},'attributes':['id',_0x84c8('0x26')],'raw':!![]});}}})[_0x84c8('0x4f')](function(_0x2973ef){var _0x598b8d={};if(_0x2973ef){_['merge'](_0x598b8d,_[_0x84c8('0x5e')](_0x3c55e8[_0x84c8('0x5f')],[_0x84c8('0x60'),_0x84c8('0x61'),'id']));_0x598b8d['state']=0x15;_0x598b8d['statedesc']=_0x84c8('0x62');_0x598b8d[_0x84c8('0x63')]=_0x2973ef[_0x84c8('0x26')];_0x598b8d['membername']=_0x42c7f4[_0x84c8('0x64')][_0x84c8('0x26')];_0x598b8d[_0x84c8('0x65')]=_0x42c7f4[_0x84c8('0x64')]['id'];_0x598b8d[_0x84c8('0x62')]=!![];_0x598b8d['deletedat']=moment()[_0x84c8('0x66')](_0x84c8('0x67'));_0x598b8d[_0x84c8('0x68')]=_0x3c55e8[_0x84c8('0x69')];_0x598b8d[_0x84c8('0x6a')]=_0x3c55e8[_0x84c8('0x5a')]?_0x84c8('0x6b'):_0x84c8('0x6c');return db[_0x84c8('0x6d')][_0x84c8('0x55')]({'where':{'id':_0x598b8d[_0x84c8('0x6e')]},'attributes':['firstName',_0x84c8('0x6f')]})[_0x84c8('0x4f')](function(_0x506b3f){if(!_[_0x84c8('0x70')](_0x4ede5b)&&!_['isNil'](_0x506b3f['firstName'])){_0x598b8d[_0x84c8('0x71')]=_0x506b3f['firstName'];if(!_[_0x84c8('0x70')](_0x506b3f[_0x84c8('0x6f')])){_0x598b8d[_0x84c8('0x71')]+='\x20'+_0x506b3f[_0x84c8('0x6f')];}}})[_0x84c8('0x72')](function(){return db[_0x84c8('0x73')]['create'](_0x598b8d);});}})['then'](function(){return _0x4ede5b['status'](0xcc)[_0x84c8('0x19')]();})[_0x84c8('0x56')](handleError(_0x4ede5b,null));};exports[_0x84c8('0x74')]=function(_0x23597a,_0x19f3f6,_0x21e833){var _0xd7962d=[];return db[_0x84c8('0x6d')][_0x84c8('0x59')]()[_0x84c8('0x4f')](function(_0x1a9b69){_0xd7962d=_[_0x84c8('0x2f')](_0x1a9b69);return _0x23597a[_0x84c8('0x64')][_0x84c8('0x75')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x84c8('0x76')},'attributes':['id',_0x84c8('0x77')],'raw':!![]});})[_0x84c8('0x4f')](function(_0xcef22c){if(_0xcef22c&&_0xcef22c['length']){return db[_0x84c8('0x78')]['transaction'](function(_0x5e5a40){var _0x52ed65={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x84c8('0x66')](_0x84c8('0x67'))},'VoiceQueueId':{'$in':_[_0x84c8('0x27')](_0xcef22c,'id')},'$or':[{'UserId':null},{'UserId':_0x23597a[_0x84c8('0x64')]['id']}]};var _0x5446af=[];if(_0x23597a['body']['direction']&&_0x23597a['body']['direction']===_0x84c8('0x79')){if(!_['isEmpty'](_0x23597a[_0x84c8('0x58')][_0x84c8('0x7a')])){_0x52ed65['id']={'$in':_0x23597a[_0x84c8('0x58')]['hopperIds']};}_0x5446af=[[_0x84c8('0x7b'),'ASC'],[_0x84c8('0x7c'),_0xcef22c[0x0][_0x84c8('0x77')]===_0x84c8('0x7d')?_0x84c8('0x7e'):_0x84c8('0x7d')],db['sequelize']['literal'](_0x84c8('0x7f')),['id','DESC']];}else{if(!_[_0x84c8('0x80')](_0x23597a[_0x84c8('0x58')][_0x84c8('0x7a')])){_0x52ed65['id']={'$notIn':_0x23597a[_0x84c8('0x58')][_0x84c8('0x7a')]};}_0x5446af=[[_0x84c8('0x7b'),_0x84c8('0x7e')],[_0x84c8('0x7c'),_0xcef22c[0x0][_0x84c8('0x77')]],db[_0x84c8('0x78')][_0x84c8('0x81')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x84c8('0x7d')]];}return db[_0x84c8('0x28')][_0x84c8('0x82')]({'attributes':['id','scheduledat'],'where':_0x52ed65,'order':_0x5446af,'transaction':_0x5e5a40,'lock':_0x5e5a40[_0x84c8('0x83')][_0x84c8('0x84')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0xd7962d,'include':[{'model':db[_0x84c8('0x85')],'as':_0x84c8('0x86'),'attributes':['id',_0x84c8('0x26')]}]},{'model':db[_0x84c8('0x87')],'as':_0x84c8('0x88'),'attributes':['id','name']},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id',_0x84c8('0x26'),_0x84c8('0x89')]}]})[_0x84c8('0x4f')](function(_0xb3889){if(_0xb3889){return _0xb3889[_0x84c8('0x22')]({'UserId':_0x23597a[_0x84c8('0x64')]['id']},{'transaction':_0x5e5a40});}});});}})[_0x84c8('0x4f')](handleEntityNotFound(_0x19f3f6,null))[_0x84c8('0x4f')](respondWithResult(_0x19f3f6,null))[_0x84c8('0x56')](handleError(_0x19f3f6,null));};exports[_0x84c8('0x8a')]=function(_0x1a17d3,_0xf5b0e9,_0x1e72ac){return _0x1a17d3['user'][_0x84c8('0x75')]({'where':{'type':_0x84c8('0x8b'),'dialActive':!![],'dialMethod':_0x84c8('0x76')},'attributes':['id'],'raw':!![]})[_0x84c8('0x4f')](function(_0x1922a9){if(_0x1922a9&&_0x1922a9[_0x84c8('0x45')]){return db[_0x84c8('0x28')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x84c8('0x66')](_0x84c8('0x67'))},'VoiceQueueId':{'$in':_[_0x84c8('0x27')](_0x1922a9,'id')},'$or':[{'UserId':null},{'UserId':_0x1a17d3[_0x84c8('0x64')]['id']}]}});}return 0x0;})[_0x84c8('0x4f')](function(_0x4f30d7){if(!_['isNil'](_0x4f30d7)&&_['isNumber'](_0x4f30d7)){return _0xf5b0e9['status'](0xc8)[_0x84c8('0x1b')]({'contacts':_0x4f30d7});}else{logger['error']('CmHopper,\x20%s,\x20%s,\x20%s',_0x84c8('0x8a'),0x194,_0x84c8('0x8c'));_0xf5b0e9['sendStatus'](0x194);}})[_0x84c8('0x56')](handleError(_0xf5b0e9,null));};
\ No newline at end of file
index 14e14b2..2e5c33a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46ed=['lodash','util','api','moment','bluebird','path','rimraf','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority'];(function(_0x2776d9,_0x133bfe){var _0x4334be=function(_0x2247b1){while(--_0x2247b1){_0x2776d9['push'](_0x2776d9['shift']());}};_0x4334be(++_0x133bfe);}(_0x46ed,0x168));var _0xd46e=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x46ed[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var logger=require('../../config/logger')(_0xd46e('0x2'));var moment=require(_0xd46e('0x3'));var BPromise=require(_0xd46e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd46e('0x5'));var rimraf=require(_0xd46e('0x6'));var config=require('../../config/environment');var attributes=require(_0xd46e('0x7'));module[_0xd46e('0x8')]=function(_0x160bcf,_0x25cf78){return _0x160bcf[_0xd46e('0x9')](_0xd46e('0xa'),attributes,{'tableName':_0xd46e('0xb'),'paranoid':![],'indexes':[{'name':_0xd46e('0xc'),'fields':[_0xd46e('0xc')]},{'name':_0xd46e('0xd'),'fields':[_0xd46e('0xd')]},{'name':'priority','fields':[_0xd46e('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2ef3=['path','rimraf','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x29379a,_0x16b64f){var _0x125b52=function(_0xea6150){while(--_0xea6150){_0x29379a['push'](_0x29379a['shift']());}};_0x125b52(++_0x16b64f);}(_0x2ef3,0xba));var _0x32ef=function(_0x4d7a5d,_0x37741c){_0x4d7a5d=_0x4d7a5d-0x0;var _0x6dcc6=_0x2ef3[_0x4d7a5d];return _0x6dcc6;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var logger=require(_0x32ef('0x2'))(_0x32ef('0x3'));var moment=require(_0x32ef('0x4'));var BPromise=require(_0x32ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x32ef('0x6'));var rimraf=require(_0x32ef('0x7'));var config=require('../../config/environment');var attributes=require(_0x32ef('0x8'));module[_0x32ef('0x9')]=function(_0x4c8104,_0x5dfa09){return _0x4c8104[_0x32ef('0xa')](_0x32ef('0xb'),attributes,{'tableName':_0x32ef('0xc'),'paranoid':![],'indexes':[{'name':_0x32ef('0xd'),'fields':[_0x32ef('0xd')]},{'name':_0x32ef('0xe'),'fields':[_0x32ef('0xe')]},{'name':_0x32ef('0xf'),'fields':[_0x32ef('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
index e2d9697..353edde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ad8=['attributes','limit','map','include','model','GetCmHopper','catch','ShowCmHopper','CmHopper','find','stringify','CreateCmHopper','body','UpdateCmHopper','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','transaction','findAll','order','UPDATE','Contact','User','Agent','name','voicePause','length','UserId','push','includes','all','sequelize','CmHopperFinal','create','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','GetContactRecallMe','LOCK','update','GetCmHopperPreview','keys','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','code','error','message','result','options','raw','where'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x9ad8,0x1a4));var _0x89ad=function(_0x1bfa31,_0x131b5b){_0x1bfa31=_0x1bfa31-0x0;var _0x32f67c=_0x9ad8[_0x1bfa31];return _0x32f67c;};'use strict';var _=require('lodash');var util=require(_0x89ad('0x0'));var moment=require(_0x89ad('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x89ad('0x2'));var db=require(_0x89ad('0x3'))['db'];var utils=require(_0x89ad('0x4'));var logger=require('../../config/logger')(_0x89ad('0x5'));var config=require(_0x89ad('0x6'));var jayson=require(_0x89ad('0x7'));var client=jayson[_0x89ad('0x8')][_0x89ad('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x584837,_0x1a3bdd,_0x273283){return new BPromise(function(_0x68e0c8,_0x172ad7){return client[_0x89ad('0xa')](_0x584837,_0x273283)[_0x89ad('0xb')](function(_0x51bc61){logger[_0x89ad('0xc')](_0x89ad('0xd'),_0x1a3bdd,_0x89ad('0xe'));logger[_0x89ad('0xf')](_0x89ad('0x10'),_0x1a3bdd,_0x89ad('0xe'),JSON['stringify'](_0x51bc61));if(_0x51bc61['error']){if(_0x51bc61['error'][_0x89ad('0x11')]===0x1f4){logger[_0x89ad('0x12')]('CmHopper,\x20%s,\x20%s',_0x1a3bdd,_0x51bc61[_0x89ad('0x12')][_0x89ad('0x13')]);return _0x172ad7(_0x51bc61[_0x89ad('0x12')][_0x89ad('0x13')]);}logger['error'](_0x89ad('0xd'),_0x1a3bdd,_0x51bc61[_0x89ad('0x12')][_0x89ad('0x13')]);return _0x68e0c8(_0x51bc61[_0x89ad('0x12')][_0x89ad('0x13')]);}else{logger[_0x89ad('0xc')](_0x89ad('0xd'),_0x1a3bdd,_0x89ad('0xe'));_0x68e0c8(_0x51bc61[_0x89ad('0x14')]['message']);}})['catch'](function(_0x110337){logger[_0x89ad('0x12')](_0x89ad('0xd'),_0x1a3bdd,_0x110337);_0x172ad7(_0x110337);});});}exports['GetCmHopper']=function(_0x1edb13){var _0x108a97=this;return new Promise(function(_0x8aaec3,_0xbc1875){return db['CmHopper']['findAll']({'raw':_0x1edb13[_0x89ad('0x15')]?_0x1edb13[_0x89ad('0x15')][_0x89ad('0x16')]===undefined?!![]:![]:!![],'where':_0x1edb13['options']?_0x1edb13['options'][_0x89ad('0x17')]||null:null,'attributes':_0x1edb13['options']?_0x1edb13[_0x89ad('0x15')][_0x89ad('0x18')]||null:null,'limit':_0x1edb13['options']?_0x1edb13[_0x89ad('0x15')][_0x89ad('0x19')]||null:null,'include':_0x1edb13[_0x89ad('0x15')]?_0x1edb13['options']['include']?_[_0x89ad('0x1a')](_0x1edb13[_0x89ad('0x15')][_0x89ad('0x1b')],function(_0x7d8086){return{'model':db[_0x7d8086[_0x89ad('0x1c')]],'as':_0x7d8086['as'],'attributes':_0x7d8086[_0x89ad('0x18')],'include':_0x7d8086[_0x89ad('0x1b')]?_[_0x89ad('0x1a')](_0x7d8086[_0x89ad('0x1b')],function(_0x235ade){return{'model':db[_0x235ade[_0x89ad('0x1c')]],'as':_0x235ade['as'],'attributes':_0x235ade[_0x89ad('0x18')],'include':_0x235ade[_0x89ad('0x1b')]?_[_0x89ad('0x1a')](_0x235ade[_0x89ad('0x1b')],function(_0x5dcbda){return{'model':db[_0x5dcbda[_0x89ad('0x1c')]],'as':_0x5dcbda['as'],'attributes':_0x5dcbda['attributes']};}):[]};}):[]};}):[]:[]})[_0x89ad('0xb')](function(_0xa7e237){logger[_0x89ad('0xc')]('GetCmHopper',_0x1edb13);logger['debug'](_0x89ad('0x1d'),_0x1edb13,JSON['stringify'](_0xa7e237));_0x8aaec3(_0xa7e237);})[_0x89ad('0x1e')](function(_0x19828c){logger['error'](_0x89ad('0x1d'),_0x19828c['message'],_0x1edb13);_0xbc1875(_0x108a97[_0x89ad('0x12')](0x1f4,_0x19828c[_0x89ad('0x13')]));});});};exports[_0x89ad('0x1f')]=function(_0x4c6fc){var _0x1495b4=this;return new Promise(function(_0x5e3665,_0x48d099){return db[_0x89ad('0x20')][_0x89ad('0x21')]({'raw':_0x4c6fc[_0x89ad('0x15')]?_0x4c6fc[_0x89ad('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x4c6fc[_0x89ad('0x15')]?_0x4c6fc['options'][_0x89ad('0x17')]||null:null,'attributes':_0x4c6fc[_0x89ad('0x15')]?_0x4c6fc['options']['attributes']||null:null,'include':_0x4c6fc[_0x89ad('0x15')]?_0x4c6fc[_0x89ad('0x15')][_0x89ad('0x1b')]?_[_0x89ad('0x1a')](_0x4c6fc['options'][_0x89ad('0x1b')],function(_0x374e5b){return{'model':db[_0x374e5b[_0x89ad('0x1c')]],'as':_0x374e5b['as'],'attributes':_0x374e5b[_0x89ad('0x18')],'include':_0x374e5b[_0x89ad('0x1b')]?_[_0x89ad('0x1a')](_0x374e5b[_0x89ad('0x1b')],function(_0x13cb70){return{'model':db[_0x13cb70[_0x89ad('0x1c')]],'as':_0x13cb70['as'],'attributes':_0x13cb70[_0x89ad('0x18')],'include':_0x13cb70[_0x89ad('0x1b')]?_[_0x89ad('0x1a')](_0x13cb70[_0x89ad('0x1b')],function(_0x4c1120){return{'model':db[_0x4c1120[_0x89ad('0x1c')]],'as':_0x4c1120['as'],'attributes':_0x4c1120[_0x89ad('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd5a363){logger[_0x89ad('0xc')](_0x89ad('0x1f'),_0x4c6fc);logger['debug'](_0x89ad('0x1f'),_0x4c6fc,JSON[_0x89ad('0x22')](_0xd5a363));_0x5e3665(_0xd5a363);})['catch'](function(_0x3c1015){logger[_0x89ad('0x12')](_0x89ad('0x1f'),_0x3c1015[_0x89ad('0x13')],_0x4c6fc);_0x48d099(_0x1495b4['error'](0x1f4,_0x3c1015[_0x89ad('0x13')]));});});};exports[_0x89ad('0x23')]=function(_0x3a0378){var _0x673019=this;return new Promise(function(_0x484c86,_0x293d55){return db[_0x89ad('0x20')]['create'](_0x3a0378[_0x89ad('0x24')],{'raw':_0x3a0378['options']?_0x3a0378['options'][_0x89ad('0x16')]===undefined?!![]:![]:!![]})[_0x89ad('0xb')](function(_0x39b5aa){logger['info'](_0x89ad('0x23'),_0x3a0378);logger[_0x89ad('0xf')](_0x89ad('0x23'),_0x3a0378,JSON['stringify'](_0x39b5aa));_0x484c86(_0x39b5aa);})['catch'](function(_0x5884b2){logger[_0x89ad('0x12')](_0x89ad('0x23'),_0x5884b2['message'],_0x3a0378);_0x293d55(_0x673019[_0x89ad('0x12')](0x1f4,_0x5884b2['message']));});});};exports['UpdateCmHopper']=function(_0x5a3e86){var _0x3e4a88=this;return new Promise(function(_0x4e8429,_0xf8c3f){return db[_0x89ad('0x20')]['update'](_0x5a3e86['body'],{'raw':_0x5a3e86[_0x89ad('0x15')]?_0x5a3e86['options'][_0x89ad('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a3e86[_0x89ad('0x15')]?_0x5a3e86['options'][_0x89ad('0x17')]||null:null,'attributes':_0x5a3e86[_0x89ad('0x15')]?_0x5a3e86[_0x89ad('0x15')]['attributes']||null:null,'limit':_0x5a3e86[_0x89ad('0x15')]?_0x5a3e86[_0x89ad('0x15')][_0x89ad('0x19')]||null:null})[_0x89ad('0xb')](function(_0x21efd3){logger[_0x89ad('0xc')](_0x89ad('0x25'),_0x5a3e86);logger['debug'](_0x89ad('0x25'),_0x5a3e86,JSON['stringify'](_0x21efd3));_0x4e8429(_0x21efd3);})[_0x89ad('0x1e')](function(_0x24e2c0){logger[_0x89ad('0x12')](_0x89ad('0x25'),_0x24e2c0[_0x89ad('0x13')],_0x5a3e86);_0xf8c3f(_0x3e4a88['error'](0x1f4,_0x24e2c0[_0x89ad('0x13')]));});});};exports['DestroyCmHopper']=function(_0x3129be){var _0xb5d4a0=this;return new Promise(function(_0x45ad61,_0x8c851e){return db[_0x89ad('0x20')][_0x89ad('0x26')]({'where':_0x3129be[_0x89ad('0x15')]?_0x3129be[_0x89ad('0x15')][_0x89ad('0x17')]||null:null})[_0x89ad('0xb')](function(_0x30345a){logger[_0x89ad('0xc')](_0x89ad('0x27'),_0x3129be);logger[_0x89ad('0xf')](_0x89ad('0x27'),_0x3129be,JSON[_0x89ad('0x22')](_0x30345a));_0x45ad61(_0x30345a);})['catch'](function(_0x1bfa1d){logger['error'](_0x89ad('0x27'),_0x1bfa1d[_0x89ad('0x13')],_0x3129be);_0x8c851e(_0xb5d4a0[_0x89ad('0x12')](0x1f4,_0x1bfa1d[_0x89ad('0x13')]));});});};exports[_0x89ad('0x28')]=function(_0x3b11e9){var _0x4be5a6=this;return new Promise(function(_0x3e7697,_0x49dfa4){return db[_0x89ad('0x29')][_0x89ad('0x2a')]()[_0x89ad('0xb')](function(_0x59573f){return db['sequelize'][_0x89ad('0x2b')](function(_0x492c85){return db[_0x89ad('0x20')][_0x89ad('0x2c')]({'where':_0x3b11e9['options']?_0x3b11e9[_0x89ad('0x15')]['where']||null:null,'attributes':_0x3b11e9[_0x89ad('0x15')]?_0x3b11e9[_0x89ad('0x15')]['attributes']||null:null,'limit':_0x3b11e9['options']?_0x3b11e9[_0x89ad('0x15')][_0x89ad('0x19')]||null:null,'order':_0x3b11e9[_0x89ad('0x15')]?_0x3b11e9[_0x89ad('0x15')][_0x89ad('0x2d')]||null:null,'transaction':_0x492c85,'lock':_0x492c85['LOCK'][_0x89ad('0x2e')],'include':[{'model':db['CmContact'],'as':_0x89ad('0x2f'),'attributes':_['keys'](_0x59573f)},{'model':db[_0x89ad('0x30')],'as':_0x89ad('0x31'),'attributes':['id',_0x89ad('0x32'),_0x89ad('0x33')]}]})[_0x89ad('0xb')](function(_0x5a3ba6){var _0x3ffbbe=[];var _0x245508=[];for(var _0x4fc231=0x0;_0x4fc231<_0x5a3ba6[_0x89ad('0x34')];_0x4fc231+=0x1){var _0x14f520=_0x5a3ba6[_0x4fc231][_0x89ad('0x35')];if(_0x14f520===null){_0x3ffbbe[_0x89ad('0x36')](_0x5a3ba6[_0x4fc231]['update'](_0x3b11e9[_0x89ad('0x24')],{'transaction':_0x492c85}));}else if(!_0x245508[_0x89ad('0x37')](_0x14f520)){_0x245508[_0x89ad('0x36')](_0x14f520);_0x3ffbbe['push'](_0x5a3ba6[_0x4fc231]['update'](_0x3b11e9[_0x89ad('0x24')],{'transaction':_0x492c85}));}}return BPromise[_0x89ad('0x38')](_0x3ffbbe);});})['then'](function(_0x5eb52b){logger['info'](_0x89ad('0x28'),_0x3b11e9);logger[_0x89ad('0xf')](_0x89ad('0x28'),_0x3b11e9,JSON[_0x89ad('0x22')](_0x5eb52b));_0x3e7697(_0x5eb52b);})[_0x89ad('0x1e')](function(_0x5546ee){logger['error'](_0x89ad('0x28'),_0x5546ee[_0x89ad('0x13')],_0x3b11e9);_0x49dfa4(_0x4be5a6[_0x89ad('0x12')](0x1f4,_0x5546ee[_0x89ad('0x13')]));});});});};exports['MoveContactManagedDialer']=function(_0x5227a2){var _0x5a657c=this;return new Promise(function(_0x8c0202,_0x244596){return db[_0x89ad('0x39')][_0x89ad('0x2b')](function(_0x50b564){return db[_0x89ad('0x3a')][_0x89ad('0x3b')](_0x5227a2[_0x89ad('0x24')],{'raw':_0x5227a2[_0x89ad('0x15')]?_0x5227a2[_0x89ad('0x15')][_0x89ad('0x16')]===undefined?!![]:![]:!![],'transaction':_0x50b564})[_0x89ad('0xb')](function(){return db[_0x89ad('0x20')]['destroy']({'where':_0x5227a2[_0x89ad('0x15')]?_0x5227a2[_0x89ad('0x15')][_0x89ad('0x17')]||null:null,'transaction':_0x50b564});});})['then'](function(_0x595f55){logger['info'](_0x89ad('0x3c'),_0x5227a2);logger[_0x89ad('0xf')](_0x89ad('0x3c'),_0x5227a2,JSON[_0x89ad('0x22')](_0x595f55));_0x8c0202(_0x595f55);})[_0x89ad('0x1e')](function(_0x4bdac4){logger[_0x89ad('0x12')](_0x89ad('0x3c'),_0x4bdac4['message'],_0x5227a2);_0x244596(_0x5a657c['error'](0x1f4,_0x4bdac4['message']));});});};exports[_0x89ad('0x3d')]=function(_0xdda8d4){var _0x536ec3=this;return new Promise(function(_0x215311,_0x45e415){return db['CmHopper'][_0x89ad('0x2c')]({'raw':_0xdda8d4[_0x89ad('0x15')]?_0xdda8d4[_0x89ad('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0xdda8d4[_0x89ad('0x15')]?_0xdda8d4[_0x89ad('0x15')][_0x89ad('0x17')]||null:null,'attributes':[[db['sequelize']['fn'](_0x89ad('0x3e'),db[_0x89ad('0x39')]['fn']('IF',db['sequelize'][_0x89ad('0x3f')](_0x89ad('0x40')+util['format'](_0x89ad('0x41'),moment()[_0x89ad('0x42')](_0x89ad('0x43')))+_0x89ad('0x44')))),'contactsRescheduled']]})[_0x89ad('0xb')](function(_0x153536){logger[_0x89ad('0xc')](_0x89ad('0x3d'),_0xdda8d4);logger['debug']('CountReScheduled',_0xdda8d4,JSON[_0x89ad('0x22')](_0x153536));_0x215311(_0x153536);})[_0x89ad('0x1e')](function(_0x367ec9){logger[_0x89ad('0x12')](_0x89ad('0x3d'),_0x367ec9['message'],_0xdda8d4);_0x45e415(_0x536ec3[_0x89ad('0x12')](0x1f4,_0x367ec9[_0x89ad('0x13')]));});});};exports[_0x89ad('0x45')]=function(_0x43ba2e){var _0x521e91=this;return new Promise(function(_0x14df3f,_0x3cee9a){return db['CmContact']['describe']()[_0x89ad('0xb')](function(_0x1ae0be){return db[_0x89ad('0x39')]['transaction'](function(_0x12f170){return db[_0x89ad('0x20')][_0x89ad('0x2c')]({'where':_0x43ba2e['options']?_0x43ba2e['options']['where']||null:null,'attributes':_0x43ba2e[_0x89ad('0x15')]?_0x43ba2e[_0x89ad('0x15')][_0x89ad('0x18')]||null:null,'limit':0x1,'order':_0x43ba2e[_0x89ad('0x15')]?_0x43ba2e[_0x89ad('0x15')][_0x89ad('0x2d')]||null:null,'group':db['CmHopper'][_0x89ad('0x35')],'transaction':_0x12f170,'lock':_0x12f170[_0x89ad('0x46')][_0x89ad('0x2e')],'include':_0x43ba2e[_0x89ad('0x15')]?_0x43ba2e[_0x89ad('0x15')]['include']?_[_0x89ad('0x1a')](_0x43ba2e['options']['include'],function(_0x104a77){return{'model':db[_0x104a77['model']],'as':_0x104a77['as'],'attributes':_0x104a77['attributes'],'include':_0x104a77[_0x89ad('0x1b')]?_[_0x89ad('0x1a')](_0x104a77[_0x89ad('0x1b')],function(_0x5ba9af){return{'model':db[_0x5ba9af[_0x89ad('0x1c')]],'as':_0x5ba9af['as'],'attributes':_0x5ba9af[_0x89ad('0x18')],'include':_0x5ba9af[_0x89ad('0x1b')]?_[_0x89ad('0x1a')](_0x5ba9af['include'],function(_0x308f11){return{'model':db[_0x308f11['model']],'as':_0x308f11['as'],'attributes':_0x308f11[_0x89ad('0x18')]};}):[]};}):[]};}):[]:[]})[_0x89ad('0xb')](function(_0xd0e2f1){var _0x86bad7=[];for(var _0x3c396a=0x0;_0x3c396a<_0xd0e2f1['length'];_0x3c396a+=0x1){_0x86bad7[_0x89ad('0x36')](_0xd0e2f1[_0x3c396a][_0x89ad('0x47')](_0x43ba2e['body'],{'transaction':_0x12f170}));}return BPromise[_0x89ad('0x38')](_0x86bad7);});})[_0x89ad('0xb')](function(_0x4edac5){logger[_0x89ad('0xc')](_0x89ad('0x45'),_0x43ba2e);logger[_0x89ad('0xf')](_0x89ad('0x45'),_0x43ba2e,JSON['stringify'](_0x4edac5));_0x14df3f(_0x4edac5);})[_0x89ad('0x1e')](function(_0x486949){logger['error']('GetContactRecallMe',_0x486949[_0x89ad('0x13')],_0x43ba2e);_0x3cee9a(_0x521e91[_0x89ad('0x12')](0x1f4,_0x486949['message']));});});});};exports[_0x89ad('0x48')]=function(_0x3e3ca7){var _0xa7d231=this;return new Promise(function(_0x4ae8b8,_0x2cd4b2){db[_0x89ad('0x29')][_0x89ad('0x2a')]()[_0x89ad('0xb')](function(_0x363ad0){return db[_0x89ad('0x20')]['findAll']({'raw':_0x3e3ca7[_0x89ad('0x15')]?_0x3e3ca7[_0x89ad('0x15')][_0x89ad('0x16')]===undefined?!![]:![]:!![],'where':_0x3e3ca7[_0x89ad('0x15')]?_0x3e3ca7[_0x89ad('0x15')][_0x89ad('0x17')]||null:null,'attributes':_0x3e3ca7[_0x89ad('0x15')]?_0x3e3ca7['options'][_0x89ad('0x18')]||null:null,'limit':_0x3e3ca7[_0x89ad('0x15')]?_0x3e3ca7['options'][_0x89ad('0x19')]||null:null,'include':_0x3e3ca7[_0x89ad('0x15')]?_0x3e3ca7[_0x89ad('0x15')]['include']?_[_0x89ad('0x1a')](_0x3e3ca7[_0x89ad('0x15')][_0x89ad('0x1b')],function(_0xf4e5bb){return{'model':db[_0xf4e5bb[_0x89ad('0x1c')]],'as':_0xf4e5bb['as'],'attributes':_0xf4e5bb['as']==='Contact'?_[_0x89ad('0x49')](_0x363ad0):_0xf4e5bb[_0x89ad('0x18')],'include':_0xf4e5bb[_0x89ad('0x1b')]?_['map'](_0xf4e5bb[_0x89ad('0x1b')],function(_0x527e6e){return{'model':db[_0x527e6e['model']],'as':_0x527e6e['as'],'attributes':_0x527e6e[_0x89ad('0x18')],'include':_0x527e6e[_0x89ad('0x1b')]?_[_0x89ad('0x1a')](_0x527e6e[_0x89ad('0x1b')],function(_0x180fff){return{'model':db[_0x180fff[_0x89ad('0x1c')]],'as':_0x180fff['as'],'attributes':_0x180fff[_0x89ad('0x18')]};}):[]};}):[]};}):[]:[]})[_0x89ad('0xb')](function(_0x524eb6){logger['info'](_0x89ad('0x1d'),_0x3e3ca7);logger[_0x89ad('0xf')]('GetCmHopper',_0x3e3ca7,JSON['stringify'](_0x524eb6));_0x4ae8b8(_0x524eb6);})[_0x89ad('0x1e')](function(_0x32fad3){logger[_0x89ad('0x12')]('GetCmHopper',_0x32fad3['message'],_0x3e3ca7);_0x2cd4b2(_0xa7d231['error'](0x1f4,_0x32fad3[_0x89ad('0x13')]));});});});};
\ No newline at end of file
+var _0x4593=['LOCK','UPDATE','Contact','User','Agent','name','voicePause','length','UserId','update','push','all','transaction','CmHopperFinal','destroy','MoveContactManagedDialer','CountReScheduled','COUNT','literal','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','keys','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CmHopper','findAll','options','raw','where','attributes','include','model','map','then','GetCmHopper','ShowCmHopper','CreateCmHopper','body','UpdateCmHopper','limit','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','order'];(function(_0x2719c5,_0x4296c7){var _0xcee795=function(_0x26e8a1){while(--_0x26e8a1){_0x2719c5['push'](_0x2719c5['shift']());}};_0xcee795(++_0x4296c7);}(_0x4593,0x1b2));var _0x3459=function(_0x2077c2,_0x275ab5){_0x2077c2=_0x2077c2-0x0;var _0x312f9f=_0x4593[_0x2077c2];return _0x312f9f;};'use strict';var _=require('lodash');var util=require(_0x3459('0x0'));var moment=require(_0x3459('0x1'));var BPromise=require(_0x3459('0x2'));var rs=require(_0x3459('0x3'));var fs=require('fs');var Redis=require(_0x3459('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3459('0x5'));var logger=require(_0x3459('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3459('0x7'));var client=jayson[_0x3459('0x8')][_0x3459('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21d908,_0x1c43ec,_0x527b9b){return new BPromise(function(_0x52a46e,_0x5c6d8d){return client['request'](_0x21d908,_0x527b9b)['then'](function(_0x2467a6){logger[_0x3459('0xa')](_0x3459('0xb'),_0x1c43ec,_0x3459('0xc'));logger[_0x3459('0xd')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x1c43ec,_0x3459('0xc'),JSON[_0x3459('0xe')](_0x2467a6));if(_0x2467a6[_0x3459('0xf')]){if(_0x2467a6['error'][_0x3459('0x10')]===0x1f4){logger[_0x3459('0xf')](_0x3459('0xb'),_0x1c43ec,_0x2467a6[_0x3459('0xf')][_0x3459('0x11')]);return _0x5c6d8d(_0x2467a6['error'][_0x3459('0x11')]);}logger['error'](_0x3459('0xb'),_0x1c43ec,_0x2467a6['error']['message']);return _0x52a46e(_0x2467a6[_0x3459('0xf')][_0x3459('0x11')]);}else{logger[_0x3459('0xa')](_0x3459('0xb'),_0x1c43ec,'request\x20sent');_0x52a46e(_0x2467a6[_0x3459('0x12')]['message']);}})[_0x3459('0x13')](function(_0x56517f){logger[_0x3459('0xf')](_0x3459('0xb'),_0x1c43ec,_0x56517f);_0x5c6d8d(_0x56517f);});});}exports['GetCmHopper']=function(_0x1b25a6){var _0x5bfe75=this;return new Promise(function(_0x5969c1,_0x479f99){return db[_0x3459('0x14')][_0x3459('0x15')]({'raw':_0x1b25a6[_0x3459('0x16')]?_0x1b25a6[_0x3459('0x16')][_0x3459('0x17')]===undefined?!![]:![]:!![],'where':_0x1b25a6[_0x3459('0x16')]?_0x1b25a6[_0x3459('0x16')][_0x3459('0x18')]||null:null,'attributes':_0x1b25a6['options']?_0x1b25a6[_0x3459('0x16')][_0x3459('0x19')]||null:null,'limit':_0x1b25a6[_0x3459('0x16')]?_0x1b25a6[_0x3459('0x16')]['limit']||null:null,'include':_0x1b25a6[_0x3459('0x16')]?_0x1b25a6[_0x3459('0x16')][_0x3459('0x1a')]?_['map'](_0x1b25a6['options'][_0x3459('0x1a')],function(_0x234e31){return{'model':db[_0x234e31[_0x3459('0x1b')]],'as':_0x234e31['as'],'attributes':_0x234e31[_0x3459('0x19')],'include':_0x234e31[_0x3459('0x1a')]?_[_0x3459('0x1c')](_0x234e31[_0x3459('0x1a')],function(_0x5a69cb){return{'model':db[_0x5a69cb[_0x3459('0x1b')]],'as':_0x5a69cb['as'],'attributes':_0x5a69cb[_0x3459('0x19')],'include':_0x5a69cb[_0x3459('0x1a')]?_[_0x3459('0x1c')](_0x5a69cb['include'],function(_0x28b7ec){return{'model':db[_0x28b7ec['model']],'as':_0x28b7ec['as'],'attributes':_0x28b7ec[_0x3459('0x19')]};}):[]};}):[]};}):[]:[]})[_0x3459('0x1d')](function(_0x363cbd){logger[_0x3459('0xa')]('GetCmHopper',_0x1b25a6);logger[_0x3459('0xd')](_0x3459('0x1e'),_0x1b25a6,JSON[_0x3459('0xe')](_0x363cbd));_0x5969c1(_0x363cbd);})[_0x3459('0x13')](function(_0x542c77){logger[_0x3459('0xf')](_0x3459('0x1e'),_0x542c77['message'],_0x1b25a6);_0x479f99(_0x5bfe75[_0x3459('0xf')](0x1f4,_0x542c77[_0x3459('0x11')]));});});};exports[_0x3459('0x1f')]=function(_0xde02fa){var _0x488241=this;return new Promise(function(_0x47ec2f,_0x321259){return db[_0x3459('0x14')]['find']({'raw':_0xde02fa[_0x3459('0x16')]?_0xde02fa[_0x3459('0x16')][_0x3459('0x17')]===undefined?!![]:![]:!![],'where':_0xde02fa['options']?_0xde02fa[_0x3459('0x16')][_0x3459('0x18')]||null:null,'attributes':_0xde02fa[_0x3459('0x16')]?_0xde02fa['options'][_0x3459('0x19')]||null:null,'include':_0xde02fa[_0x3459('0x16')]?_0xde02fa[_0x3459('0x16')][_0x3459('0x1a')]?_[_0x3459('0x1c')](_0xde02fa[_0x3459('0x16')][_0x3459('0x1a')],function(_0x271323){return{'model':db[_0x271323[_0x3459('0x1b')]],'as':_0x271323['as'],'attributes':_0x271323[_0x3459('0x19')],'include':_0x271323[_0x3459('0x1a')]?_[_0x3459('0x1c')](_0x271323[_0x3459('0x1a')],function(_0x56d624){return{'model':db[_0x56d624[_0x3459('0x1b')]],'as':_0x56d624['as'],'attributes':_0x56d624[_0x3459('0x19')],'include':_0x56d624[_0x3459('0x1a')]?_[_0x3459('0x1c')](_0x56d624['include'],function(_0x2bc2cd){return{'model':db[_0x2bc2cd[_0x3459('0x1b')]],'as':_0x2bc2cd['as'],'attributes':_0x2bc2cd[_0x3459('0x19')]};}):[]};}):[]};}):[]:[]})[_0x3459('0x1d')](function(_0x3a4ec7){logger[_0x3459('0xa')](_0x3459('0x1f'),_0xde02fa);logger[_0x3459('0xd')](_0x3459('0x1f'),_0xde02fa,JSON[_0x3459('0xe')](_0x3a4ec7));_0x47ec2f(_0x3a4ec7);})[_0x3459('0x13')](function(_0x5d0a12){logger[_0x3459('0xf')]('ShowCmHopper',_0x5d0a12['message'],_0xde02fa);_0x321259(_0x488241['error'](0x1f4,_0x5d0a12[_0x3459('0x11')]));});});};exports[_0x3459('0x20')]=function(_0x5d762a){var _0xa97449=this;return new Promise(function(_0x1f43d2,_0x4a7e44){return db['CmHopper']['create'](_0x5d762a[_0x3459('0x21')],{'raw':_0x5d762a[_0x3459('0x16')]?_0x5d762a['options'][_0x3459('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x14629d){logger['info'](_0x3459('0x20'),_0x5d762a);logger[_0x3459('0xd')](_0x3459('0x20'),_0x5d762a,JSON[_0x3459('0xe')](_0x14629d));_0x1f43d2(_0x14629d);})[_0x3459('0x13')](function(_0x37d1e3){logger['error'](_0x3459('0x20'),_0x37d1e3[_0x3459('0x11')],_0x5d762a);_0x4a7e44(_0xa97449['error'](0x1f4,_0x37d1e3['message']));});});};exports[_0x3459('0x22')]=function(_0x3feb72){var _0x44bc6e=this;return new Promise(function(_0x2444a3,_0x7a094f){return db[_0x3459('0x14')]['update'](_0x3feb72['body'],{'raw':_0x3feb72[_0x3459('0x16')]?_0x3feb72[_0x3459('0x16')][_0x3459('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3feb72[_0x3459('0x16')]?_0x3feb72[_0x3459('0x16')][_0x3459('0x18')]||null:null,'attributes':_0x3feb72[_0x3459('0x16')]?_0x3feb72[_0x3459('0x16')][_0x3459('0x19')]||null:null,'limit':_0x3feb72[_0x3459('0x16')]?_0x3feb72[_0x3459('0x16')][_0x3459('0x23')]||null:null})[_0x3459('0x1d')](function(_0xf974c1){logger[_0x3459('0xa')](_0x3459('0x22'),_0x3feb72);logger[_0x3459('0xd')](_0x3459('0x22'),_0x3feb72,JSON[_0x3459('0xe')](_0xf974c1));_0x2444a3(_0xf974c1);})[_0x3459('0x13')](function(_0xbd13f2){logger['error'](_0x3459('0x22'),_0xbd13f2[_0x3459('0x11')],_0x3feb72);_0x7a094f(_0x44bc6e[_0x3459('0xf')](0x1f4,_0xbd13f2[_0x3459('0x11')]));});});};exports[_0x3459('0x24')]=function(_0x413c93){var _0x2d9c74=this;return new Promise(function(_0x540abb,_0x11b399){return db[_0x3459('0x14')]['destroy']({'where':_0x413c93[_0x3459('0x16')]?_0x413c93['options']['where']||null:null})['then'](function(_0x2aa5ab){logger[_0x3459('0xa')](_0x3459('0x24'),_0x413c93);logger[_0x3459('0xd')]('DestroyCmHopper',_0x413c93,JSON[_0x3459('0xe')](_0x2aa5ab));_0x540abb(_0x2aa5ab);})[_0x3459('0x13')](function(_0x427788){logger[_0x3459('0xf')](_0x3459('0x24'),_0x427788['message'],_0x413c93);_0x11b399(_0x2d9c74[_0x3459('0xf')](0x1f4,_0x427788[_0x3459('0x11')]));});});};exports[_0x3459('0x25')]=function(_0x1d428f){var _0x238457=this;return new Promise(function(_0x57ef01,_0x13c1f7){return db[_0x3459('0x26')][_0x3459('0x27')]()['then'](function(_0x3fd255){return db[_0x3459('0x28')]['transaction'](function(_0x377a07){return db['CmHopper'][_0x3459('0x15')]({'where':_0x1d428f['options']?_0x1d428f[_0x3459('0x16')][_0x3459('0x18')]||null:null,'attributes':_0x1d428f[_0x3459('0x16')]?_0x1d428f[_0x3459('0x16')][_0x3459('0x19')]||null:null,'limit':_0x1d428f[_0x3459('0x16')]?_0x1d428f[_0x3459('0x16')][_0x3459('0x23')]||null:null,'order':_0x1d428f[_0x3459('0x16')]?_0x1d428f[_0x3459('0x16')][_0x3459('0x29')]||null:null,'transaction':_0x377a07,'lock':_0x377a07[_0x3459('0x2a')][_0x3459('0x2b')],'include':[{'model':db[_0x3459('0x26')],'as':_0x3459('0x2c'),'attributes':_['keys'](_0x3fd255)},{'model':db[_0x3459('0x2d')],'as':_0x3459('0x2e'),'attributes':['id',_0x3459('0x2f'),_0x3459('0x30')]}]})[_0x3459('0x1d')](function(_0x4601a7){var _0x2e61c2=[];var _0x570117=[];for(var _0x3ba80c=0x0;_0x3ba80c<_0x4601a7[_0x3459('0x31')];_0x3ba80c+=0x1){var _0x3974b7=_0x4601a7[_0x3ba80c][_0x3459('0x32')];if(_0x3974b7===null){_0x2e61c2['push'](_0x4601a7[_0x3ba80c][_0x3459('0x33')](_0x1d428f['body'],{'transaction':_0x377a07}));}else if(!_0x570117['includes'](_0x3974b7)){_0x570117[_0x3459('0x34')](_0x3974b7);_0x2e61c2[_0x3459('0x34')](_0x4601a7[_0x3ba80c][_0x3459('0x33')](_0x1d428f[_0x3459('0x21')],{'transaction':_0x377a07}));}}return BPromise[_0x3459('0x35')](_0x2e61c2);});})[_0x3459('0x1d')](function(_0x19072c){logger[_0x3459('0xa')](_0x3459('0x25'),_0x1d428f);logger['debug'](_0x3459('0x25'),_0x1d428f,JSON[_0x3459('0xe')](_0x19072c));_0x57ef01(_0x19072c);})[_0x3459('0x13')](function(_0x371bd3){logger[_0x3459('0xf')](_0x3459('0x25'),_0x371bd3[_0x3459('0x11')],_0x1d428f);_0x13c1f7(_0x238457['error'](0x1f4,_0x371bd3[_0x3459('0x11')]));});});});};exports['MoveContactManagedDialer']=function(_0x25714f){var _0xa5d25d=this;return new Promise(function(_0x3a0242,_0x53c76e){return db[_0x3459('0x28')][_0x3459('0x36')](function(_0x5c39ba){return db[_0x3459('0x37')]['create'](_0x25714f[_0x3459('0x21')],{'raw':_0x25714f[_0x3459('0x16')]?_0x25714f[_0x3459('0x16')][_0x3459('0x17')]===undefined?!![]:![]:!![],'transaction':_0x5c39ba})[_0x3459('0x1d')](function(){return db[_0x3459('0x14')][_0x3459('0x38')]({'where':_0x25714f[_0x3459('0x16')]?_0x25714f['options'][_0x3459('0x18')]||null:null,'transaction':_0x5c39ba});});})['then'](function(_0x111b2d){logger['info'](_0x3459('0x39'),_0x25714f);logger[_0x3459('0xd')](_0x3459('0x39'),_0x25714f,JSON[_0x3459('0xe')](_0x111b2d));_0x3a0242(_0x111b2d);})['catch'](function(_0x3c9a54){logger[_0x3459('0xf')](_0x3459('0x39'),_0x3c9a54['message'],_0x25714f);_0x53c76e(_0xa5d25d[_0x3459('0xf')](0x1f4,_0x3c9a54[_0x3459('0x11')]));});});};exports[_0x3459('0x3a')]=function(_0x6ec00a){var _0x94e2c9=this;return new Promise(function(_0x1345c5,_0x52ab30){return db[_0x3459('0x14')][_0x3459('0x15')]({'raw':_0x6ec00a['options']?_0x6ec00a['options'][_0x3459('0x17')]===undefined?!![]:![]:!![],'where':_0x6ec00a[_0x3459('0x16')]?_0x6ec00a[_0x3459('0x16')][_0x3459('0x18')]||null:null,'attributes':[[db[_0x3459('0x28')]['fn'](_0x3459('0x3b'),db[_0x3459('0x28')]['fn']('IF',db[_0x3459('0x28')][_0x3459('0x3c')]('`scheduledat`\x20>=\x20'+util['format'](_0x3459('0x3d'),moment()['format'](_0x3459('0x3e')))+_0x3459('0x3f')))),_0x3459('0x40')]]})[_0x3459('0x1d')](function(_0x4893cb){logger[_0x3459('0xa')](_0x3459('0x3a'),_0x6ec00a);logger[_0x3459('0xd')](_0x3459('0x3a'),_0x6ec00a,JSON[_0x3459('0xe')](_0x4893cb));_0x1345c5(_0x4893cb);})[_0x3459('0x13')](function(_0x4bcd80){logger['error'](_0x3459('0x3a'),_0x4bcd80[_0x3459('0x11')],_0x6ec00a);_0x52ab30(_0x94e2c9[_0x3459('0xf')](0x1f4,_0x4bcd80[_0x3459('0x11')]));});});};exports[_0x3459('0x41')]=function(_0x29f71a){var _0x4b165c=this;return new Promise(function(_0x2e1248,_0x195476){return db[_0x3459('0x26')][_0x3459('0x27')]()[_0x3459('0x1d')](function(_0x4e683a){return db[_0x3459('0x28')]['transaction'](function(_0x22e385){return db[_0x3459('0x14')][_0x3459('0x15')]({'where':_0x29f71a['options']?_0x29f71a[_0x3459('0x16')][_0x3459('0x18')]||null:null,'attributes':_0x29f71a[_0x3459('0x16')]?_0x29f71a['options'][_0x3459('0x19')]||null:null,'limit':0x1,'order':_0x29f71a['options']?_0x29f71a['options'][_0x3459('0x29')]||null:null,'group':db[_0x3459('0x14')][_0x3459('0x32')],'transaction':_0x22e385,'lock':_0x22e385[_0x3459('0x2a')][_0x3459('0x2b')],'include':_0x29f71a[_0x3459('0x16')]?_0x29f71a[_0x3459('0x16')][_0x3459('0x1a')]?_[_0x3459('0x1c')](_0x29f71a[_0x3459('0x16')][_0x3459('0x1a')],function(_0x534cf2){return{'model':db[_0x534cf2[_0x3459('0x1b')]],'as':_0x534cf2['as'],'attributes':_0x534cf2[_0x3459('0x19')],'include':_0x534cf2['include']?_['map'](_0x534cf2[_0x3459('0x1a')],function(_0xae5ae7){return{'model':db[_0xae5ae7[_0x3459('0x1b')]],'as':_0xae5ae7['as'],'attributes':_0xae5ae7[_0x3459('0x19')],'include':_0xae5ae7[_0x3459('0x1a')]?_['map'](_0xae5ae7[_0x3459('0x1a')],function(_0x1827e0){return{'model':db[_0x1827e0[_0x3459('0x1b')]],'as':_0x1827e0['as'],'attributes':_0x1827e0['attributes']};}):[]};}):[]};}):[]:[]})[_0x3459('0x1d')](function(_0x47a362){var _0x478091=[];for(var _0x199fb9=0x0;_0x199fb9<_0x47a362['length'];_0x199fb9+=0x1){_0x478091[_0x3459('0x34')](_0x47a362[_0x199fb9]['update'](_0x29f71a['body'],{'transaction':_0x22e385}));}return BPromise[_0x3459('0x35')](_0x478091);});})[_0x3459('0x1d')](function(_0x531aa4){logger[_0x3459('0xa')]('GetContactRecallMe',_0x29f71a);logger[_0x3459('0xd')](_0x3459('0x41'),_0x29f71a,JSON[_0x3459('0xe')](_0x531aa4));_0x2e1248(_0x531aa4);})[_0x3459('0x13')](function(_0x12caa3){logger[_0x3459('0xf')](_0x3459('0x41'),_0x12caa3[_0x3459('0x11')],_0x29f71a);_0x195476(_0x4b165c[_0x3459('0xf')](0x1f4,_0x12caa3['message']));});});});};exports[_0x3459('0x42')]=function(_0x3a09e4){var _0x42f88e=this;return new Promise(function(_0x587bee,_0x12b798){db['CmContact'][_0x3459('0x27')]()[_0x3459('0x1d')](function(_0x263890){return db[_0x3459('0x14')][_0x3459('0x15')]({'raw':_0x3a09e4[_0x3459('0x16')]?_0x3a09e4['options'][_0x3459('0x17')]===undefined?!![]:![]:!![],'where':_0x3a09e4[_0x3459('0x16')]?_0x3a09e4['options'][_0x3459('0x18')]||null:null,'attributes':_0x3a09e4[_0x3459('0x16')]?_0x3a09e4['options'][_0x3459('0x19')]||null:null,'limit':_0x3a09e4[_0x3459('0x16')]?_0x3a09e4['options']['limit']||null:null,'include':_0x3a09e4[_0x3459('0x16')]?_0x3a09e4['options'][_0x3459('0x1a')]?_[_0x3459('0x1c')](_0x3a09e4[_0x3459('0x16')][_0x3459('0x1a')],function(_0x40910d){return{'model':db[_0x40910d[_0x3459('0x1b')]],'as':_0x40910d['as'],'attributes':_0x40910d['as']===_0x3459('0x2c')?_[_0x3459('0x43')](_0x263890):_0x40910d['attributes'],'include':_0x40910d[_0x3459('0x1a')]?_['map'](_0x40910d[_0x3459('0x1a')],function(_0xfdb14c){return{'model':db[_0xfdb14c[_0x3459('0x1b')]],'as':_0xfdb14c['as'],'attributes':_0xfdb14c[_0x3459('0x19')],'include':_0xfdb14c[_0x3459('0x1a')]?_[_0x3459('0x1c')](_0xfdb14c[_0x3459('0x1a')],function(_0x5828f9){return{'model':db[_0x5828f9[_0x3459('0x1b')]],'as':_0x5828f9['as'],'attributes':_0x5828f9[_0x3459('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5702e6){logger['info'](_0x3459('0x1e'),_0x3a09e4);logger[_0x3459('0xd')]('GetCmHopper',_0x3a09e4,JSON[_0x3459('0xe')](_0x5702e6));_0x587bee(_0x5702e6);})['catch'](function(_0x14d0ef){logger[_0x3459('0xf')]('GetCmHopper',_0x14d0ef['message'],_0x3a09e4);_0x12b798(_0x42f88e[_0x3459('0xf')](0x1f4,_0x14d0ef[_0x3459('0x11')]));});});});};
\ No newline at end of file
index 7a32cd6..36cb674 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3f3=['connect-timeout','express','Router','../../components/interaction/service','./cmHopper.controller','get','isAuthenticated','/describe','describe','/opencontacts','/:id','show','create','getPreview','put','update','delete','destroy','exports','multer','util','path'];(function(_0x592863,_0x5584a2){var _0x274186=function(_0x5b49ec){while(--_0x5b49ec){_0x592863['push'](_0x592863['shift']());}};_0x274186(++_0x5584a2);}(_0xb3f3,0x1cb));var _0x3b3f=function(_0x3eef60,_0x9eb279){_0x3eef60=_0x3eef60-0x0;var _0x569efe=_0xb3f3[_0x3eef60];return _0x569efe;};'use strict';var multer=require(_0x3b3f('0x0'));var util=require(_0x3b3f('0x1'));var path=require(_0x3b3f('0x2'));var timeout=require(_0x3b3f('0x3'));var express=require(_0x3b3f('0x4'));var router=express[_0x3b3f('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3b3f('0x6'));var config=require('../../config/environment');var controller=require(_0x3b3f('0x7'));router[_0x3b3f('0x8')]('/',auth[_0x3b3f('0x9')](),controller['index']);router[_0x3b3f('0x8')](_0x3b3f('0xa'),auth[_0x3b3f('0x9')](),controller[_0x3b3f('0xb')]);router[_0x3b3f('0x8')](_0x3b3f('0xc'),auth['isAuthenticated'](),controller['getOpenContacts']);router[_0x3b3f('0x8')](_0x3b3f('0xd'),auth[_0x3b3f('0x9')](),controller[_0x3b3f('0xe')]);router['post']('/',auth[_0x3b3f('0x9')](),controller[_0x3b3f('0xf')]);router['post']('/preview',auth[_0x3b3f('0x9')](),controller[_0x3b3f('0x10')]);router[_0x3b3f('0x11')]('/:id',auth[_0x3b3f('0x9')](),controller[_0x3b3f('0x12')]);router[_0x3b3f('0x13')]('/:id',auth[_0x3b3f('0x9')](),controller[_0x3b3f('0x14')]);module[_0x3b3f('0x15')]=router;
\ No newline at end of file
+var _0x89ea=['create','post','/preview','getPreview','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','getOpenContacts','show'];(function(_0x20c0f4,_0xf354e6){var _0x30e21d=function(_0x374959){while(--_0x374959){_0x20c0f4['push'](_0x20c0f4['shift']());}};_0x30e21d(++_0xf354e6);}(_0x89ea,0x180));var _0xa89e=function(_0x4cbdb7,_0x1b82f6){_0x4cbdb7=_0x4cbdb7-0x0;var _0x4ecb18=_0x89ea[_0x4cbdb7];return _0x4ecb18;};'use strict';var multer=require('multer');var util=require(_0xa89e('0x0'));var path=require(_0xa89e('0x1'));var timeout=require(_0xa89e('0x2'));var express=require(_0xa89e('0x3'));var router=express['Router']();var fs_extra=require(_0xa89e('0x4'));var auth=require(_0xa89e('0x5'));var interaction=require(_0xa89e('0x6'));var config=require(_0xa89e('0x7'));var controller=require(_0xa89e('0x8'));router[_0xa89e('0x9')]('/',auth[_0xa89e('0xa')](),controller[_0xa89e('0xb')]);router['get'](_0xa89e('0xc'),auth['isAuthenticated'](),controller[_0xa89e('0xd')]);router[_0xa89e('0x9')]('/opencontacts',auth[_0xa89e('0xa')](),controller[_0xa89e('0xe')]);router[_0xa89e('0x9')]('/:id',auth[_0xa89e('0xa')](),controller[_0xa89e('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa89e('0x10')]);router[_0xa89e('0x11')](_0xa89e('0x12'),auth[_0xa89e('0xa')](),controller[_0xa89e('0x13')]);router['put'](_0xa89e('0x14'),auth['isAuthenticated'](),controller[_0xa89e('0x15')]);router[_0xa89e('0x16')](_0xa89e('0x14'),auth[_0xa89e('0xa')](),controller[_0xa89e('0x17')]);module[_0xa89e('0x18')]=router;
\ No newline at end of file
index 56ee833..5f0ea84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x433a=['INTEGER','contactListQueue','moment','sequelize','exports'];(function(_0x4f0a61,_0x1df9a7){var _0x447ea6=function(_0x22577e){while(--_0x22577e){_0x4f0a61['push'](_0x4f0a61['shift']());}};_0x447ea6(++_0x1df9a7);}(_0x433a,0x14c));var _0xa433=function(_0x55f502,_0x5c0e22){_0x55f502=_0x55f502-0x0;var _0x108e6e=_0x433a[_0x55f502];return _0x108e6e;};'use strict';var moment=require(_0xa433('0x0'));var Sequelize=require(_0xa433('0x1'));module[_0xa433('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xa433('0x3')],'unique':_0xa433('0x4')},'ListId':{'type':Sequelize[_0xa433('0x3')],'unique':_0xa433('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xa433('0x4')}};
\ No newline at end of file
+var _0x46e1=['sequelize','exports','STRING','INTEGER','contactListQueue','moment'];(function(_0x548f15,_0x35f960){var _0x4dad27=function(_0x3e204f){while(--_0x3e204f){_0x548f15['push'](_0x548f15['shift']());}};_0x4dad27(++_0x35f960);}(_0x46e1,0x155));var _0x146e=function(_0x3a073b,_0x589c34){_0x3a073b=_0x3a073b-0x0;var _0x3ad1fd=_0x46e1[_0x3a073b];return _0x3ad1fd;};'use strict';var moment=require(_0x146e('0x0'));var Sequelize=require(_0x146e('0x1'));module[_0x146e('0x2')]={'phone':{'type':Sequelize[_0x146e('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x146e('0x4')],'unique':_0x146e('0x5')},'ListId':{'type':Sequelize[_0x146e('0x4')],'unique':_0x146e('0x5')},'VoiceQueueId':{'type':Sequelize[_0x146e('0x4')],'unique':_0x146e('0x5')}};
\ No newline at end of file
index fa4f880..3c9ed6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67a2=['nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','then','includeAll','include','rows','show','params','catch','update','find','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','ejs','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','error','name','index','CmHopperBlack','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','fields','length','attributes'];(function(_0xb4ce16,_0x2bd30c){var _0x14055c=function(_0x16909e){while(--_0x16909e){_0xb4ce16['push'](_0xb4ce16['shift']());}};_0x14055c(++_0x2bd30c);}(_0x67a2,0xf4));var _0x267a=function(_0x3caae9,_0x2c9e39){_0x3caae9=_0x3caae9-0x0;var _0x115d3d=_0x67a2[_0x3caae9];return _0x115d3d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x267a('0x0'));var zipdir=require(_0x267a('0x1'));var jsonpatch=require(_0x267a('0x2'));var rp=require(_0x267a('0x3'));var moment=require(_0x267a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x267a('0x5'));var util=require('util');var path=require('path');var sox=require(_0x267a('0x6'));var csv=require('to-csv');var ejs=require(_0x267a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x267a('0x8'));var crypto=require('crypto');var jsforce=require(_0x267a('0x9'));var deskjs=require(_0x267a('0xa'));var toCsv=require(_0x267a('0xb'));var querystring=require(_0x267a('0xc'));var Papa=require(_0x267a('0xd'));var Redis=require(_0x267a('0xe'));var authService=require(_0x267a('0xf'));var qs=require(_0x267a('0x10'));var as=require(_0x267a('0x11'));var hardwareService=require(_0x267a('0x12'));var logger=require('../../config/logger')(_0x267a('0x13'));var utils=require(_0x267a('0x14'));var config=require(_0x267a('0x15'));var licenseUtil=require(_0x267a('0x16'));var db=require(_0x267a('0x17'))['db'];function respondWithStatusCode(_0x208531,_0x4c2192){_0x4c2192=_0x4c2192||0xcc;return function(_0x4b7c35){if(_0x4b7c35){return _0x208531[_0x267a('0x18')](_0x4c2192);}return _0x208531[_0x267a('0x19')](_0x4c2192)[_0x267a('0x1a')]();};}function respondWithResult(_0x151d2c,_0x1bf58c){_0x1bf58c=_0x1bf58c||0xc8;return function(_0x3d0177){if(_0x3d0177){return _0x151d2c[_0x267a('0x19')](_0x1bf58c)[_0x267a('0x1b')](_0x3d0177);}};}function respondWithFilteredResult(_0x9413e5,_0x4e0495){return function(_0xe00a46){if(_0xe00a46){var _0x1d3ba4=typeof _0x4e0495[_0x267a('0x1c')]===_0x267a('0x1d')&&typeof _0x4e0495[_0x267a('0x1e')]===_0x267a('0x1d');var _0x689a1f=_0xe00a46['count'];var _0x376631=_0x1d3ba4?0x0:_0x4e0495[_0x267a('0x1c')];var _0x455e57=_0x1d3ba4?_0xe00a46[_0x267a('0x1f')]:_0x4e0495['offset']+_0x4e0495[_0x267a('0x1e')];var _0x6bd6d8;if(_0x455e57>=_0x689a1f){_0x455e57=_0x689a1f;_0x6bd6d8=0xc8;}else{_0x6bd6d8=0xce;}_0x9413e5['status'](_0x6bd6d8);return _0x9413e5[_0x267a('0x20')]('Content-Range',_0x376631+'-'+_0x455e57+'/'+_0x689a1f)['json'](_0xe00a46);}return null;};}function patchUpdates(_0x5ddf4b){return function(_0x178cb3){try{jsonpatch[_0x267a('0x21')](_0x178cb3,_0x5ddf4b,!![]);}catch(_0x107a8e){return BPromise[_0x267a('0x22')](_0x107a8e);}return _0x178cb3[_0x267a('0x23')]();};}function saveUpdates(_0x5a0ee3,_0x143c17){return function(_0x16cd2a){if(_0x16cd2a){return _0x16cd2a['update'](_0x5a0ee3)['then'](function(_0x44116f){return _0x44116f;});}return null;};}function removeEntity(_0x24c6ad,_0x534b3d){return function(_0xb1103d){if(_0xb1103d){return _0xb1103d['destroy']()['then'](function(){_0x24c6ad[_0x267a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x575830,_0x70a0b3){return function(_0x40b7a7){if(!_0x40b7a7){_0x575830[_0x267a('0x18')](0x194);}return _0x40b7a7;};}function handleError(_0x17fc2b,_0x5b93f4){_0x5b93f4=_0x5b93f4||0x1f4;return function(_0x203fab){logger[_0x267a('0x24')](_0x203fab['stack']);if(_0x203fab['name']){delete _0x203fab[_0x267a('0x25')];}_0x17fc2b[_0x267a('0x19')](_0x5b93f4)['send'](_0x203fab);};}exports[_0x267a('0x26')]=function(_0xebec9e,_0x1f42b9){var _0x268db8={},_0x24f549={},_0x5ea173={'count':0x0,'rows':[]};var _0x469038=_['map'](db[_0x267a('0x27')][_0x267a('0x28')],function(_0x3ebb2f){return{'name':_0x3ebb2f[_0x267a('0x29')],'type':_0x3ebb2f['type'][_0x267a('0x2a')]};});_0x24f549['model']=_[_0x267a('0x2b')](_0x469038,_0x267a('0x25'));_0x24f549[_0x267a('0x2c')]=_[_0x267a('0x2d')](_0xebec9e[_0x267a('0x2c')]);_0x24f549[_0x267a('0x2e')]=_[_0x267a('0x2f')](_0x24f549[_0x267a('0x30')],_0x24f549[_0x267a('0x2c')]);_0x268db8['attributes']=_[_0x267a('0x2f')](_0x24f549[_0x267a('0x30')],qs['fields'](_0xebec9e[_0x267a('0x2c')][_0x267a('0x31')]));_0x268db8['attributes']=_0x268db8['attributes'][_0x267a('0x32')]?_0x268db8[_0x267a('0x33')]:_0x24f549[_0x267a('0x30')];if(!_0xebec9e[_0x267a('0x2c')]['hasOwnProperty'](_0x267a('0x34'))){_0x268db8[_0x267a('0x1e')]=qs[_0x267a('0x1e')](_0xebec9e[_0x267a('0x2c')][_0x267a('0x1e')]);_0x268db8[_0x267a('0x1c')]=qs['offset'](_0xebec9e[_0x267a('0x2c')][_0x267a('0x1c')]);}_0x268db8[_0x267a('0x35')]=qs[_0x267a('0x36')](_0xebec9e['query'][_0x267a('0x36')]);_0x268db8['where']=qs[_0x267a('0x2e')](_[_0x267a('0x37')](_0xebec9e[_0x267a('0x2c')],_0x24f549[_0x267a('0x2e')]),_0x469038);if(_0xebec9e[_0x267a('0x2c')][_0x267a('0x38')]){_0x268db8[_0x267a('0x39')]=_[_0x267a('0x3a')](_0x268db8[_0x267a('0x39')],{'$or':_[_0x267a('0x2b')](_0x469038,function(_0x5cb691){if(_0x5cb691[_0x267a('0x3b')]!==_0x267a('0x3c')){var _0x5c7ffd={};_0x5c7ffd[_0x5cb691['name']]={'$like':'%'+_0xebec9e[_0x267a('0x2c')]['filter']+'%'};return _0x5c7ffd;}})});}_0x268db8=_['merge']({},_0x268db8,_0xebec9e[_0x267a('0x3d')]);var _0x53cf98={'where':_0x268db8[_0x267a('0x39')]};return db[_0x267a('0x27')]['count'](_0x53cf98)[_0x267a('0x3e')](function(_0x37f9f8){_0x5ea173[_0x267a('0x1f')]=_0x37f9f8;if(_0xebec9e[_0x267a('0x2c')][_0x267a('0x3f')]){_0x268db8[_0x267a('0x40')]=[{'all':!![]}];}return db[_0x267a('0x27')]['findAll'](_0x268db8);})[_0x267a('0x3e')](function(_0x10e308){_0x5ea173[_0x267a('0x41')]=_0x10e308;return _0x5ea173;})['then'](respondWithFilteredResult(_0x1f42b9,_0x268db8))['catch'](handleError(_0x1f42b9,null));};exports[_0x267a('0x42')]=function(_0x3dd3cb,_0x14f6aa){var _0xbd067b={'raw':!![],'where':{'id':_0x3dd3cb[_0x267a('0x43')]['id']}},_0x218abc={};_0x218abc['model']=_[_0x267a('0x2d')](db[_0x267a('0x27')][_0x267a('0x28')]);_0x218abc['query']=_['keys'](_0x3dd3cb[_0x267a('0x2c')]);_0x218abc[_0x267a('0x2e')]=_[_0x267a('0x2f')](_0x218abc[_0x267a('0x30')],_0x218abc[_0x267a('0x2c')]);_0xbd067b[_0x267a('0x33')]=_[_0x267a('0x2f')](_0x218abc[_0x267a('0x30')],qs['fields'](_0x3dd3cb[_0x267a('0x2c')][_0x267a('0x31')]));_0xbd067b['attributes']=_0xbd067b[_0x267a('0x33')][_0x267a('0x32')]?_0xbd067b[_0x267a('0x33')]:_0x218abc[_0x267a('0x30')];if(_0x3dd3cb[_0x267a('0x2c')][_0x267a('0x3f')]){_0xbd067b[_0x267a('0x40')]=[{'all':!![]}];}_0xbd067b=_[_0x267a('0x3a')]({},_0xbd067b,_0x3dd3cb['options']);return db[_0x267a('0x27')]['find'](_0xbd067b)[_0x267a('0x3e')](handleEntityNotFound(_0x14f6aa,null))['then'](respondWithResult(_0x14f6aa,null))[_0x267a('0x44')](handleError(_0x14f6aa,null));};exports[_0x267a('0x45')]=function(_0x296a75,_0x23b71a){if(_0x296a75['body']['id']){delete _0x296a75['body']['id'];}return db[_0x267a('0x27')][_0x267a('0x46')]({'where':{'id':_0x296a75[_0x267a('0x43')]['id']}})[_0x267a('0x3e')](handleEntityNotFound(_0x23b71a,null))['then'](saveUpdates(_0x296a75[_0x267a('0x47')],null))[_0x267a('0x3e')](respondWithResult(_0x23b71a,null))[_0x267a('0x44')](handleError(_0x23b71a,null));};exports[_0x267a('0x48')]=function(_0x209f15,_0x19a238){return db[_0x267a('0x27')][_0x267a('0x46')]({'where':{'id':_0x209f15[_0x267a('0x43')]['id']}})[_0x267a('0x3e')](handleEntityNotFound(_0x19a238,null))['then'](removeEntity(_0x19a238,null))[_0x267a('0x44')](handleError(_0x19a238,null));};exports['describe']=function(_0x3a498a,_0x32bd7e){return db['CmHopperBlack'][_0x267a('0x49')]()['then'](respondWithResult(_0x32bd7e,null))[_0x267a('0x44')](handleError(_0x32bd7e,null));};
\ No newline at end of file
+var _0x9300=['squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','update','then','destroy','end','error','stack','name','send','index','map','CmHopperBlack','key','query','keys','filters','attributes','intersection','model','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x9300,0x153));var _0x0930=function(_0x3881bf,_0x1b016){_0x3881bf=_0x3881bf-0x0;var _0x539015=_0x9300[_0x3881bf];return _0x539015;};'use strict';var emlformat=require(_0x0930('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0930('0x1'));var rp=require(_0x0930('0x2'));var moment=require(_0x0930('0x3'));var BPromise=require(_0x0930('0x4'));var Mustache=require(_0x0930('0x5'));var util=require('util');var path=require(_0x0930('0x6'));var sox=require(_0x0930('0x7'));var csv=require('to-csv');var ejs=require(_0x0930('0x8'));var fs=require('fs');var fs_extra=require(_0x0930('0x9'));var _=require(_0x0930('0xa'));var squel=require(_0x0930('0xb'));var crypto=require(_0x0930('0xc'));var jsforce=require(_0x0930('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0930('0xe'));var Papa=require('papaparse');var Redis=require(_0x0930('0xf'));var authService=require(_0x0930('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0930('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0930('0x12'));var utils=require(_0x0930('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0930('0x14'))['db'];function respondWithStatusCode(_0x354fb1,_0x2020f0){_0x2020f0=_0x2020f0||0xcc;return function(_0x3ac35b){if(_0x3ac35b){return _0x354fb1[_0x0930('0x15')](_0x2020f0);}return _0x354fb1[_0x0930('0x16')](_0x2020f0)['end']();};}function respondWithResult(_0x5cf362,_0x53f425){_0x53f425=_0x53f425||0xc8;return function(_0x1b3e72){if(_0x1b3e72){return _0x5cf362['status'](_0x53f425)[_0x0930('0x17')](_0x1b3e72);}};}function respondWithFilteredResult(_0x2a496f,_0x255988){return function(_0x3af83f){if(_0x3af83f){var _0x37b0c5=typeof _0x255988[_0x0930('0x18')]==='undefined'&&typeof _0x255988[_0x0930('0x19')]===_0x0930('0x1a');var _0x4d26a9=_0x3af83f['count'];var _0x87318c=_0x37b0c5?0x0:_0x255988[_0x0930('0x18')];var _0x469be7=_0x37b0c5?_0x3af83f[_0x0930('0x1b')]:_0x255988[_0x0930('0x18')]+_0x255988['limit'];var _0x19b4e4;if(_0x469be7>=_0x4d26a9){_0x469be7=_0x4d26a9;_0x19b4e4=0xc8;}else{_0x19b4e4=0xce;}_0x2a496f[_0x0930('0x16')](_0x19b4e4);return _0x2a496f['set'](_0x0930('0x1c'),_0x87318c+'-'+_0x469be7+'/'+_0x4d26a9)[_0x0930('0x17')](_0x3af83f);}return null;};}function patchUpdates(_0xfc9eaf){return function(_0x284bb7){try{jsonpatch[_0x0930('0x1d')](_0x284bb7,_0xfc9eaf,!![]);}catch(_0xea7c6c){return BPromise['reject'](_0xea7c6c);}return _0x284bb7['save']();};}function saveUpdates(_0x3dbabe,_0x5061a5){return function(_0xd9a9df){if(_0xd9a9df){return _0xd9a9df[_0x0930('0x1e')](_0x3dbabe)[_0x0930('0x1f')](function(_0x4aac18){return _0x4aac18;});}return null;};}function removeEntity(_0x37e243,_0x48bdf5){return function(_0x6e9f46){if(_0x6e9f46){return _0x6e9f46[_0x0930('0x20')]()['then'](function(){_0x37e243['status'](0xcc)[_0x0930('0x21')]();});}};}function handleEntityNotFound(_0x8f676a,_0x413878){return function(_0x2eb598){if(!_0x2eb598){_0x8f676a[_0x0930('0x15')](0x194);}return _0x2eb598;};}function handleError(_0x8662a7,_0x50fae8){_0x50fae8=_0x50fae8||0x1f4;return function(_0x191333){logger[_0x0930('0x22')](_0x191333[_0x0930('0x23')]);if(_0x191333[_0x0930('0x24')]){delete _0x191333[_0x0930('0x24')];}_0x8662a7[_0x0930('0x16')](_0x50fae8)[_0x0930('0x25')](_0x191333);};}exports[_0x0930('0x26')]=function(_0x260bf1,_0x224074){var _0x4aa903={},_0x2a47f2={},_0x597851={'count':0x0,'rows':[]};var _0x421a95=_[_0x0930('0x27')](db[_0x0930('0x28')]['rawAttributes'],function(_0x15a81b){return{'name':_0x15a81b['fieldName'],'type':_0x15a81b['type'][_0x0930('0x29')]};});_0x2a47f2['model']=_[_0x0930('0x27')](_0x421a95,_0x0930('0x24'));_0x2a47f2[_0x0930('0x2a')]=_[_0x0930('0x2b')](_0x260bf1[_0x0930('0x2a')]);_0x2a47f2[_0x0930('0x2c')]=_['intersection'](_0x2a47f2['model'],_0x2a47f2[_0x0930('0x2a')]);_0x4aa903[_0x0930('0x2d')]=_[_0x0930('0x2e')](_0x2a47f2[_0x0930('0x2f')],qs[_0x0930('0x30')](_0x260bf1[_0x0930('0x2a')][_0x0930('0x30')]));_0x4aa903[_0x0930('0x2d')]=_0x4aa903['attributes'][_0x0930('0x31')]?_0x4aa903[_0x0930('0x2d')]:_0x2a47f2[_0x0930('0x2f')];if(!_0x260bf1[_0x0930('0x2a')]['hasOwnProperty'](_0x0930('0x32'))){_0x4aa903[_0x0930('0x19')]=qs[_0x0930('0x19')](_0x260bf1[_0x0930('0x2a')][_0x0930('0x19')]);_0x4aa903['offset']=qs['offset'](_0x260bf1[_0x0930('0x2a')][_0x0930('0x18')]);}_0x4aa903[_0x0930('0x33')]=qs[_0x0930('0x34')](_0x260bf1[_0x0930('0x2a')][_0x0930('0x34')]);_0x4aa903[_0x0930('0x35')]=qs[_0x0930('0x2c')](_[_0x0930('0x36')](_0x260bf1['query'],_0x2a47f2[_0x0930('0x2c')]),_0x421a95);if(_0x260bf1[_0x0930('0x2a')][_0x0930('0x37')]){_0x4aa903[_0x0930('0x35')]=_[_0x0930('0x38')](_0x4aa903[_0x0930('0x35')],{'$or':_[_0x0930('0x27')](_0x421a95,function(_0x35f988){if(_0x35f988[_0x0930('0x39')]!==_0x0930('0x3a')){var _0x1e237e={};_0x1e237e[_0x35f988[_0x0930('0x24')]]={'$like':'%'+_0x260bf1[_0x0930('0x2a')][_0x0930('0x37')]+'%'};return _0x1e237e;}})});}_0x4aa903=_[_0x0930('0x38')]({},_0x4aa903,_0x260bf1[_0x0930('0x3b')]);var _0x4a6e8b={'where':_0x4aa903['where']};return db['CmHopperBlack'][_0x0930('0x1b')](_0x4a6e8b)[_0x0930('0x1f')](function(_0x458dca){_0x597851[_0x0930('0x1b')]=_0x458dca;if(_0x260bf1[_0x0930('0x2a')][_0x0930('0x3c')]){_0x4aa903[_0x0930('0x3d')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x0930('0x3e')](_0x4aa903);})[_0x0930('0x1f')](function(_0x3476f8){_0x597851[_0x0930('0x3f')]=_0x3476f8;return _0x597851;})[_0x0930('0x1f')](respondWithFilteredResult(_0x224074,_0x4aa903))['catch'](handleError(_0x224074,null));};exports[_0x0930('0x40')]=function(_0x4f1e65,_0x23dbf9){var _0x33805a={'raw':!![],'where':{'id':_0x4f1e65[_0x0930('0x41')]['id']}},_0x4938fe={};_0x4938fe[_0x0930('0x2f')]=_[_0x0930('0x2b')](db[_0x0930('0x28')]['rawAttributes']);_0x4938fe[_0x0930('0x2a')]=_[_0x0930('0x2b')](_0x4f1e65['query']);_0x4938fe[_0x0930('0x2c')]=_[_0x0930('0x2e')](_0x4938fe[_0x0930('0x2f')],_0x4938fe['query']);_0x33805a[_0x0930('0x2d')]=_[_0x0930('0x2e')](_0x4938fe[_0x0930('0x2f')],qs[_0x0930('0x30')](_0x4f1e65[_0x0930('0x2a')][_0x0930('0x30')]));_0x33805a[_0x0930('0x2d')]=_0x33805a['attributes']['length']?_0x33805a[_0x0930('0x2d')]:_0x4938fe[_0x0930('0x2f')];if(_0x4f1e65['query'][_0x0930('0x3c')]){_0x33805a[_0x0930('0x3d')]=[{'all':!![]}];}_0x33805a=_[_0x0930('0x38')]({},_0x33805a,_0x4f1e65[_0x0930('0x3b')]);return db['CmHopperBlack'][_0x0930('0x42')](_0x33805a)['then'](handleEntityNotFound(_0x23dbf9,null))[_0x0930('0x1f')](respondWithResult(_0x23dbf9,null))[_0x0930('0x43')](handleError(_0x23dbf9,null));};exports[_0x0930('0x1e')]=function(_0x1d5645,_0x1539b5){if(_0x1d5645[_0x0930('0x44')]['id']){delete _0x1d5645[_0x0930('0x44')]['id'];}return db[_0x0930('0x28')][_0x0930('0x42')]({'where':{'id':_0x1d5645[_0x0930('0x41')]['id']}})[_0x0930('0x1f')](handleEntityNotFound(_0x1539b5,null))[_0x0930('0x1f')](saveUpdates(_0x1d5645[_0x0930('0x44')],null))[_0x0930('0x1f')](respondWithResult(_0x1539b5,null))[_0x0930('0x43')](handleError(_0x1539b5,null));};exports[_0x0930('0x20')]=function(_0x46568f,_0x4d7c69){return db[_0x0930('0x28')]['find']({'where':{'id':_0x46568f[_0x0930('0x41')]['id']}})['then'](handleEntityNotFound(_0x4d7c69,null))[_0x0930('0x1f')](removeEntity(_0x4d7c69,null))[_0x0930('0x43')](handleError(_0x4d7c69,null));};exports['describe']=function(_0x3880ae,_0x1a455c){return db[_0x0930('0x28')][_0x0930('0x45')]()[_0x0930('0x1f')](respondWithResult(_0x1a455c,null))['catch'](handleError(_0x1a455c,null));};
\ No newline at end of file
index 94cbb34..8410b9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b5b=['api','moment','bluebird','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger'];(function(_0x4a7843,_0x24f6d1){var _0x2c57fe=function(_0x37fbc9){while(--_0x37fbc9){_0x4a7843['push'](_0x4a7843['shift']());}};_0x2c57fe(++_0x24f6d1);}(_0x2b5b,0x190));var _0xb2b5=function(_0x597c20,_0x22aad1){_0x597c20=_0x597c20-0x0;var _0x5b5e8f=_0x2b5b[_0x597c20];return _0x5b5e8f;};'use strict';var _=require(_0xb2b5('0x0'));var util=require(_0xb2b5('0x1'));var logger=require(_0xb2b5('0x2'))(_0xb2b5('0x3'));var moment=require(_0xb2b5('0x4'));var BPromise=require(_0xb2b5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb2b5('0x6'));var rimraf=require(_0xb2b5('0x7'));var config=require(_0xb2b5('0x8'));var attributes=require(_0xb2b5('0x9'));module[_0xb2b5('0xa')]=function(_0x2e5b2b,_0x167bdb){return _0x2e5b2b['define'](_0xb2b5('0xb'),attributes,{'tableName':_0xb2b5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb386=['rimraf','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','moment','bluebird','path'];(function(_0x10a28a,_0x1a49f7){var _0x10e391=function(_0x3e98ae){while(--_0x3e98ae){_0x10a28a['push'](_0x10a28a['shift']());}};_0x10e391(++_0x1a49f7);}(_0xb386,0x119));var _0x6b38=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0xb386[_0x485b5a];return _0xd2b34d;};'use strict';var _=require(_0x6b38('0x0'));var util=require(_0x6b38('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6b38('0x2'));var BPromise=require(_0x6b38('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6b38('0x4'));var rimraf=require(_0x6b38('0x5'));var config=require('../../config/environment');var attributes=require(_0x6b38('0x6'));module[_0x6b38('0x7')]=function(_0x222d78,_0x157066){return _0x222d78[_0x6b38('0x8')](_0x6b38('0x9'),attributes,{'tableName':_0x6b38('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9893e06..be56965 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf08a=['map','model','UpdateCmHopperBlack','limit','DestroyCmHopperBlack','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCmHopperBlack','CmHopperBlack','options','raw','where','attributes','include'];(function(_0x30c8e0,_0x215b56){var _0x50e2b5=function(_0x1f4074){while(--_0x1f4074){_0x30c8e0['push'](_0x30c8e0['shift']());}};_0x50e2b5(++_0x215b56);}(_0xf08a,0xb4));var _0xaf08=function(_0x593c0c,_0x233604){_0x593c0c=_0x593c0c-0x0;var _0x14878e=_0xf08a[_0x593c0c];return _0x14878e;};'use strict';var _=require(_0xaf08('0x0'));var util=require(_0xaf08('0x1'));var moment=require('moment');var BPromise=require(_0xaf08('0x2'));var rs=require(_0xaf08('0x3'));var fs=require('fs');var Redis=require(_0xaf08('0x4'));var db=require(_0xaf08('0x5'))['db'];var utils=require(_0xaf08('0x6'));var logger=require(_0xaf08('0x7'))(_0xaf08('0x8'));var config=require('../../config/environment');var jayson=require(_0xaf08('0x9'));var client=jayson[_0xaf08('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x218312,_0x32ad19,_0x1e07fc){return new BPromise(function(_0x553791,_0x5062e5){return client[_0xaf08('0xb')](_0x218312,_0x1e07fc)[_0xaf08('0xc')](function(_0x138215){logger[_0xaf08('0xd')](_0xaf08('0xe'),_0x32ad19,_0xaf08('0xf'));logger[_0xaf08('0x10')](_0xaf08('0x11'),_0x32ad19,_0xaf08('0xf'),JSON[_0xaf08('0x12')](_0x138215));if(_0x138215[_0xaf08('0x13')]){if(_0x138215[_0xaf08('0x13')]['code']===0x1f4){logger[_0xaf08('0x13')](_0xaf08('0xe'),_0x32ad19,_0x138215['error']['message']);return _0x5062e5(_0x138215[_0xaf08('0x13')][_0xaf08('0x14')]);}logger[_0xaf08('0x13')](_0xaf08('0xe'),_0x32ad19,_0x138215[_0xaf08('0x13')]['message']);return _0x553791(_0x138215[_0xaf08('0x13')][_0xaf08('0x14')]);}else{logger['info'](_0xaf08('0xe'),_0x32ad19,_0xaf08('0xf'));_0x553791(_0x138215[_0xaf08('0x15')][_0xaf08('0x14')]);}})[_0xaf08('0x16')](function(_0x45c31b){logger['error'](_0xaf08('0xe'),_0x32ad19,_0x45c31b);_0x5062e5(_0x45c31b);});});}exports[_0xaf08('0x17')]=function(_0x12fafa){var _0x44d67b=this;return new Promise(function(_0x3d8239,_0x3a5b06){return db[_0xaf08('0x18')]['findAll']({'raw':_0x12fafa[_0xaf08('0x19')]?_0x12fafa[_0xaf08('0x19')][_0xaf08('0x1a')]===undefined?!![]:![]:!![],'where':_0x12fafa[_0xaf08('0x19')]?_0x12fafa[_0xaf08('0x19')][_0xaf08('0x1b')]||null:null,'attributes':_0x12fafa[_0xaf08('0x19')]?_0x12fafa[_0xaf08('0x19')][_0xaf08('0x1c')]||null:null,'limit':_0x12fafa['options']?_0x12fafa[_0xaf08('0x19')]['limit']||null:null,'include':_0x12fafa[_0xaf08('0x19')]?_0x12fafa[_0xaf08('0x19')][_0xaf08('0x1d')]?_[_0xaf08('0x1e')](_0x12fafa[_0xaf08('0x19')][_0xaf08('0x1d')],function(_0x54aa8e){return{'model':db[_0x54aa8e[_0xaf08('0x1f')]],'as':_0x54aa8e['as'],'attributes':_0x54aa8e[_0xaf08('0x1c')],'include':_0x54aa8e['include']?_[_0xaf08('0x1e')](_0x54aa8e[_0xaf08('0x1d')],function(_0x794d83){return{'model':db[_0x794d83[_0xaf08('0x1f')]],'as':_0x794d83['as'],'attributes':_0x794d83[_0xaf08('0x1c')],'include':_0x794d83[_0xaf08('0x1d')]?_['map'](_0x794d83[_0xaf08('0x1d')],function(_0x517c99){return{'model':db[_0x517c99['model']],'as':_0x517c99['as'],'attributes':_0x517c99['attributes']};}):[]};}):[]};}):[]:[]})[_0xaf08('0xc')](function(_0x1cfbf2){logger['info'](_0xaf08('0x17'),_0x12fafa);logger[_0xaf08('0x10')](_0xaf08('0x17'),_0x12fafa,JSON[_0xaf08('0x12')](_0x1cfbf2));_0x3d8239(_0x1cfbf2);})[_0xaf08('0x16')](function(_0x3852c5){logger[_0xaf08('0x13')]('GetCmHopperBlack',_0x3852c5[_0xaf08('0x14')],_0x12fafa);_0x3a5b06(_0x44d67b['error'](0x1f4,_0x3852c5['message']));});});};exports[_0xaf08('0x20')]=function(_0x4a2ff7){var _0x2c81a2=this;return new Promise(function(_0x4886d,_0x3f2ef7){return db['CmHopperBlack']['update'](_0x4a2ff7['body'],{'raw':_0x4a2ff7['options']?_0x4a2ff7[_0xaf08('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a2ff7[_0xaf08('0x19')]?_0x4a2ff7[_0xaf08('0x19')]['where']||null:null,'attributes':_0x4a2ff7[_0xaf08('0x19')]?_0x4a2ff7[_0xaf08('0x19')][_0xaf08('0x1c')]||null:null,'limit':_0x4a2ff7[_0xaf08('0x19')]?_0x4a2ff7[_0xaf08('0x19')][_0xaf08('0x21')]||null:null})[_0xaf08('0xc')](function(_0x4e40f9){logger['info'](_0xaf08('0x20'),_0x4a2ff7);logger['debug'](_0xaf08('0x20'),_0x4a2ff7,JSON[_0xaf08('0x12')](_0x4e40f9));_0x4886d(_0x4e40f9);})[_0xaf08('0x16')](function(_0x3d2264){logger[_0xaf08('0x13')]('UpdateCmHopperBlack',_0x3d2264[_0xaf08('0x14')],_0x4a2ff7);_0x3f2ef7(_0x2c81a2[_0xaf08('0x13')](0x1f4,_0x3d2264[_0xaf08('0x14')]));});});};exports[_0xaf08('0x22')]=function(_0x55a23a){var _0x2dee8d=this;return new Promise(function(_0x3c87b8,_0x27368d){return db['CmHopperBlack']['destroy']({'where':_0x55a23a['options']?_0x55a23a[_0xaf08('0x19')]['where']||null:null})[_0xaf08('0xc')](function(_0x1edb7a){logger[_0xaf08('0xd')](_0xaf08('0x22'),_0x55a23a);logger[_0xaf08('0x10')]('DestroyCmHopperBlack',_0x55a23a,JSON['stringify'](_0x1edb7a));_0x3c87b8(_0x1edb7a);})[_0xaf08('0x16')](function(_0x52408a){logger[_0xaf08('0x13')]('DestroyCmHopperBlack',_0x52408a[_0xaf08('0x14')],_0x55a23a);_0x27368d(_0x2dee8d['error'](0x1f4,_0x52408a[_0xaf08('0x14')]));});});};
\ No newline at end of file
+var _0x41e4=['lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetCmHopperBlack','CmHopperBlack','options','raw','where','attributes','map','include','model','UpdateCmHopperBlack','update','body','limit','then','DestroyCmHopperBlack','destroy'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x41e4,0xcc));var _0x441e=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x41e4[_0x273c39];return _0x46d6b5;};'use strict';var _=require(_0x441e('0x0'));var util=require(_0x441e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x441e('0x2'));var db=require(_0x441e('0x3'))['db'];var utils=require(_0x441e('0x4'));var logger=require('../../config/logger')(_0x441e('0x5'));var config=require(_0x441e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x441e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2169fe,_0x3203ee,_0x47a7ef){return new BPromise(function(_0x3573d0,_0x19f9af){return client[_0x441e('0x8')](_0x2169fe,_0x47a7ef)['then'](function(_0x968d9){logger[_0x441e('0x9')](_0x441e('0xa'),_0x3203ee,_0x441e('0xb'));logger[_0x441e('0xc')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x3203ee,_0x441e('0xb'),JSON[_0x441e('0xd')](_0x968d9));if(_0x968d9[_0x441e('0xe')]){if(_0x968d9[_0x441e('0xe')][_0x441e('0xf')]===0x1f4){logger[_0x441e('0xe')](_0x441e('0xa'),_0x3203ee,_0x968d9['error'][_0x441e('0x10')]);return _0x19f9af(_0x968d9[_0x441e('0xe')]['message']);}logger[_0x441e('0xe')](_0x441e('0xa'),_0x3203ee,_0x968d9['error'][_0x441e('0x10')]);return _0x3573d0(_0x968d9[_0x441e('0xe')][_0x441e('0x10')]);}else{logger[_0x441e('0x9')](_0x441e('0xa'),_0x3203ee,_0x441e('0xb'));_0x3573d0(_0x968d9['result']['message']);}})[_0x441e('0x11')](function(_0x30cf3a){logger['error'](_0x441e('0xa'),_0x3203ee,_0x30cf3a);_0x19f9af(_0x30cf3a);});});}exports[_0x441e('0x12')]=function(_0x7c108){var _0x173298=this;return new Promise(function(_0x37d975,_0x1690f6){return db[_0x441e('0x13')]['findAll']({'raw':_0x7c108[_0x441e('0x14')]?_0x7c108[_0x441e('0x14')][_0x441e('0x15')]===undefined?!![]:![]:!![],'where':_0x7c108[_0x441e('0x14')]?_0x7c108[_0x441e('0x14')][_0x441e('0x16')]||null:null,'attributes':_0x7c108[_0x441e('0x14')]?_0x7c108[_0x441e('0x14')][_0x441e('0x17')]||null:null,'limit':_0x7c108[_0x441e('0x14')]?_0x7c108[_0x441e('0x14')]['limit']||null:null,'include':_0x7c108['options']?_0x7c108[_0x441e('0x14')]['include']?_[_0x441e('0x18')](_0x7c108[_0x441e('0x14')][_0x441e('0x19')],function(_0x1bb5d1){return{'model':db[_0x1bb5d1['model']],'as':_0x1bb5d1['as'],'attributes':_0x1bb5d1[_0x441e('0x17')],'include':_0x1bb5d1[_0x441e('0x19')]?_[_0x441e('0x18')](_0x1bb5d1[_0x441e('0x19')],function(_0x34e639){return{'model':db[_0x34e639[_0x441e('0x1a')]],'as':_0x34e639['as'],'attributes':_0x34e639[_0x441e('0x17')],'include':_0x34e639['include']?_[_0x441e('0x18')](_0x34e639[_0x441e('0x19')],function(_0x3e48c7){return{'model':db[_0x3e48c7[_0x441e('0x1a')]],'as':_0x3e48c7['as'],'attributes':_0x3e48c7[_0x441e('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45331e){logger[_0x441e('0x9')](_0x441e('0x12'),_0x7c108);logger[_0x441e('0xc')](_0x441e('0x12'),_0x7c108,JSON[_0x441e('0xd')](_0x45331e));_0x37d975(_0x45331e);})[_0x441e('0x11')](function(_0x34ae55){logger[_0x441e('0xe')](_0x441e('0x12'),_0x34ae55[_0x441e('0x10')],_0x7c108);_0x1690f6(_0x173298[_0x441e('0xe')](0x1f4,_0x34ae55[_0x441e('0x10')]));});});};exports[_0x441e('0x1b')]=function(_0x21bcdc){var _0x324061=this;return new Promise(function(_0x5141a1,_0x3e8b94){return db['CmHopperBlack'][_0x441e('0x1c')](_0x21bcdc[_0x441e('0x1d')],{'raw':_0x21bcdc['options']?_0x21bcdc['options'][_0x441e('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21bcdc[_0x441e('0x14')]?_0x21bcdc[_0x441e('0x14')][_0x441e('0x16')]||null:null,'attributes':_0x21bcdc[_0x441e('0x14')]?_0x21bcdc[_0x441e('0x14')][_0x441e('0x17')]||null:null,'limit':_0x21bcdc[_0x441e('0x14')]?_0x21bcdc[_0x441e('0x14')][_0x441e('0x1e')]||null:null})[_0x441e('0x1f')](function(_0x54a929){logger[_0x441e('0x9')]('UpdateCmHopperBlack',_0x21bcdc);logger[_0x441e('0xc')](_0x441e('0x1b'),_0x21bcdc,JSON[_0x441e('0xd')](_0x54a929));_0x5141a1(_0x54a929);})[_0x441e('0x11')](function(_0x532263){logger[_0x441e('0xe')](_0x441e('0x1b'),_0x532263[_0x441e('0x10')],_0x21bcdc);_0x3e8b94(_0x324061[_0x441e('0xe')](0x1f4,_0x532263['message']));});});};exports[_0x441e('0x20')]=function(_0x4960c9){var _0x4efcc3=this;return new Promise(function(_0x1955bb,_0x161ee6){return db['CmHopperBlack'][_0x441e('0x21')]({'where':_0x4960c9[_0x441e('0x14')]?_0x4960c9[_0x441e('0x14')][_0x441e('0x16')]||null:null})[_0x441e('0x1f')](function(_0x3be802){logger[_0x441e('0x9')]('DestroyCmHopperBlack',_0x4960c9);logger[_0x441e('0xc')](_0x441e('0x20'),_0x4960c9,JSON[_0x441e('0xd')](_0x3be802));_0x1955bb(_0x3be802);})[_0x441e('0x11')](function(_0x3be834){logger['error'](_0x441e('0x20'),_0x3be834[_0x441e('0x10')],_0x4960c9);_0x161ee6(_0x4efcc3[_0x441e('0xe')](0x1f4,_0x3be834[_0x441e('0x10')]));});});};
\ No newline at end of file
index 3c110e1..16073cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x323f=['../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','/describe','describe','/:id','show','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4c2679,_0x2c0a2f){var _0x1e6555=function(_0x55d162){while(--_0x55d162){_0x4c2679['push'](_0x4c2679['shift']());}};_0x1e6555(++_0x2c0a2f);}(_0x323f,0x1ee));var _0xf323=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x323f[_0x42245d];return _0x4b211a;};'use strict';var multer=require('multer');var util=require(_0xf323('0x0'));var path=require('path');var timeout=require(_0xf323('0x1'));var express=require(_0xf323('0x2'));var router=express[_0xf323('0x3')]();var fs_extra=require(_0xf323('0x4'));var auth=require(_0xf323('0x5'));var interaction=require(_0xf323('0x6'));var config=require(_0xf323('0x7'));var controller=require(_0xf323('0x8'));router[_0xf323('0x9')]('/',auth[_0xf323('0xa')](),controller['index']);router[_0xf323('0x9')](_0xf323('0xb'),auth[_0xf323('0xa')](),controller[_0xf323('0xc')]);router[_0xf323('0x9')](_0xf323('0xd'),auth[_0xf323('0xa')](),controller[_0xf323('0xe')]);router[_0xf323('0xf')](_0xf323('0xd'),auth[_0xf323('0xa')](),controller[_0xf323('0x10')]);router[_0xf323('0x11')](_0xf323('0xd'),auth[_0xf323('0xa')](),controller[_0xf323('0x12')]);module[_0xf323('0x13')]=router;
\ No newline at end of file
+var _0xd046=['isAuthenticated','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','./cmHopperBlack.controller','index','get','describe','show','/:id'];(function(_0x52684f,_0xff73fc){var _0x4a55f0=function(_0x8ce37c){while(--_0x8ce37c){_0x52684f['push'](_0x52684f['shift']());}};_0x4a55f0(++_0xff73fc);}(_0xd046,0x129));var _0x6d04=function(_0x53cd3e,_0x2e4195){_0x53cd3e=_0x53cd3e-0x0;var _0x3feed8=_0xd046[_0x53cd3e];return _0x3feed8;};'use strict';var multer=require('multer');var util=require(_0x6d04('0x0'));var path=require(_0x6d04('0x1'));var timeout=require(_0x6d04('0x2'));var express=require('express');var router=express[_0x6d04('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6d04('0x4'));var config=require('../../config/environment');var controller=require(_0x6d04('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x6d04('0x6')]);router[_0x6d04('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x6d04('0x8')]);router[_0x6d04('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x6d04('0x9')]);router['put'](_0x6d04('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x6d04('0xa'),auth[_0x6d04('0xb')](),controller[_0x6d04('0xc')]);module[_0x6d04('0xd')]=router;
\ No newline at end of file
index 6d71e1d..07def56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57c9=['dispositionat','BOOLEAN','moment','exports','STRING','INTEGER','DATE','setDataValue','followuptime','diff','seconds'];(function(_0x5c9865,_0x1a299a){var _0x54c22b=function(_0x538537){while(--_0x538537){_0x5c9865['push'](_0x5c9865['shift']());}};_0x54c22b(++_0x1a299a);}(_0x57c9,0xbd));var _0x957c=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x57c9[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x957c('0x0'));module[_0x957c('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x957c('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x957c('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x957c('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x957c('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x957c('0x2')]},'originatecalleridname':{'type':Sequelize[_0x957c('0x2')]},'calleridnum':{'type':Sequelize[_0x957c('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x957c('0x4')]},'responsetime':{'type':Sequelize[_0x957c('0x4')]},'answertime':{'type':Sequelize[_0x957c('0x4')]},'droptime':{'type':Sequelize[_0x957c('0x4')]},'endtime':{'type':Sequelize[_0x957c('0x4')]},'ringtime':{'type':Sequelize[_0x957c('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x957c('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x957c('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x957c('0x2')]},'reason':{'type':Sequelize[_0x957c('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x957c('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x957c('0x4')],'set':function(_0x2855fa){var _0x57cd04=this['getDataValue']('endtime');if(_0x57cd04&&_0x2855fa){this[_0x957c('0x5')](_0x957c('0x6'),moment(_0x2855fa)[_0x957c('0x7')](moment(_0x57cd04),_0x957c('0x8')));}return this[_0x957c('0x5')](_0x957c('0x9'),_0x2855fa);}},'amd':{'type':Sequelize[_0x957c('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0x957c('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x957c('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x957c('0x4')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x957c('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x957c('0x4')]},'deleted':{'type':Sequelize[_0x957c('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x957c('0x4')]},'recallme':{'type':Sequelize[_0x957c('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x957c('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x957c('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x957c('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x957c('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x957c('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x957c('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x3d7a=['STRING','setDataValue','followuptime','diff','seconds','BOOLEAN','sequelize','moment','exports','DATE','INTEGER'];(function(_0x503481,_0x2c0dfc){var _0x4b8897=function(_0x3704ec){while(--_0x3704ec){_0x503481['push'](_0x503481['shift']());}};_0x4b8897(++_0x2c0dfc);}(_0x3d7a,0x10e));var _0xa3d7=function(_0x47f4c2,_0x134e7b){_0x47f4c2=_0x47f4c2-0x0;var _0x22c63e=_0x3d7a[_0x47f4c2];return _0x22c63e;};'use strict';var Sequelize=require(_0xa3d7('0x0'));var moment=require(_0xa3d7('0x1'));module[_0xa3d7('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xa3d7('0x3')]},'countbusyretry':{'type':Sequelize[_0xa3d7('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa3d7('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa3d7('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xa3d7('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xa3d7('0x5')]},'originatecalleridnum':{'type':Sequelize[_0xa3d7('0x5')]},'originatecalleridname':{'type':Sequelize[_0xa3d7('0x5')]},'calleridnum':{'type':Sequelize[_0xa3d7('0x5')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xa3d7('0x3')]},'responsetime':{'type':Sequelize[_0xa3d7('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xa3d7('0x3')]},'endtime':{'type':Sequelize[_0xa3d7('0x3')]},'ringtime':{'type':Sequelize[_0xa3d7('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xa3d7('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xa3d7('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xa3d7('0x5')]},'campaign':{'type':Sequelize[_0xa3d7('0x5')]},'campaigntype':{'type':Sequelize[_0xa3d7('0x5')]},'membername':{'type':Sequelize[_0xa3d7('0x5')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xa3d7('0x5')]},'thirdDisposition':{'type':Sequelize[_0xa3d7('0x5')]},'dispositionat':{'type':Sequelize[_0xa3d7('0x3')],'set':function(_0x53eb31){var _0x4162bb=this['getDataValue']('endtime');if(_0x4162bb&&_0x53eb31){this[_0xa3d7('0x6')](_0xa3d7('0x7'),moment(_0x53eb31)[_0xa3d7('0x8')](moment(_0x4162bb),_0xa3d7('0x9')));}return this[_0xa3d7('0x6')]('dispositionat',_0x53eb31);}},'amd':{'type':Sequelize[_0xa3d7('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0xa3d7('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xa3d7('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xa3d7('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xa3d7('0x3')]},'callback':{'type':Sequelize[_0xa3d7('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa3d7('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0xa3d7('0x5')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xa3d7('0x3')]},'recallme':{'type':Sequelize[_0xa3d7('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xa3d7('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0xa3d7('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa3d7('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa3d7('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa3d7('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa3d7('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index bee85de..24526e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fab=['json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','includeAll','include','findAll','then','rows','show','params','intersection','fields','options','find','catch','describe','body','countContactsQueueCampaignHopperFinal','COUNT','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','dropContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','select','field','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','NOW()','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','Campaign','insert','CampaignId','createdAt','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0xb92ba3,_0x1acc40){var _0x27ed96=function(_0x1f1174){while(--_0x1f1174){_0xb92ba3['push'](_0xb92ba3['shift']());}};_0x27ed96(++_0x1acc40);}(_0x5fab,0x177));var _0xb5fa=function(_0x163bc9,_0x4b6796){_0x163bc9=_0x163bc9-0x0;var _0xb94e42=_0x5fab[_0x163bc9];return _0xb94e42;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];function respondWithStatusCode(_0x4d3576,_0x2ad830){_0x2ad830=_0x2ad830||0xcc;return function(_0x3dad4d){if(_0x3dad4d){return _0x4d3576['sendStatus'](_0x2ad830);}return _0x4d3576[_0xb5fa('0x1a')](_0x2ad830)['end']();};}function respondWithResult(_0x265992,_0x3fc372){_0x3fc372=_0x3fc372||0xc8;return function(_0x40c914){if(_0x40c914){return _0x265992[_0xb5fa('0x1a')](_0x3fc372)[_0xb5fa('0x1b')](_0x40c914);}};}function respondWithFilteredResult(_0x5371cf,_0x567f31){return function(_0x38e964){if(_0x38e964){var _0x587043=typeof _0x567f31[_0xb5fa('0x1c')]===_0xb5fa('0x1d')&&typeof _0x567f31['limit']==='undefined';var _0x451a55=_0x38e964[_0xb5fa('0x1e')];var _0x32e9e5=_0x587043?0x0:_0x567f31[_0xb5fa('0x1c')];var _0x324ba5=_0x587043?_0x38e964[_0xb5fa('0x1e')]:_0x567f31[_0xb5fa('0x1c')]+_0x567f31[_0xb5fa('0x1f')];var _0xc14dc4;if(_0x324ba5>=_0x451a55){_0x324ba5=_0x451a55;_0xc14dc4=0xc8;}else{_0xc14dc4=0xce;}_0x5371cf[_0xb5fa('0x1a')](_0xc14dc4);return _0x5371cf[_0xb5fa('0x20')](_0xb5fa('0x21'),_0x32e9e5+'-'+_0x324ba5+'/'+_0x451a55)['json'](_0x38e964);}return null;};}function patchUpdates(_0x432bfa){return function(_0x519e20){try{jsonpatch[_0xb5fa('0x22')](_0x519e20,_0x432bfa,!![]);}catch(_0x4a6c04){return BPromise[_0xb5fa('0x23')](_0x4a6c04);}return _0x519e20[_0xb5fa('0x24')]();};}function saveUpdates(_0x4e05c0,_0x40dfdf){return function(_0x3a2ab9){if(_0x3a2ab9){return _0x3a2ab9[_0xb5fa('0x25')](_0x4e05c0)['then'](function(_0x32a85c){return _0x32a85c;});}return null;};}function removeEntity(_0xec108f,_0x444237){return function(_0x542348){if(_0x542348){return _0x542348[_0xb5fa('0x26')]()['then'](function(){_0xec108f[_0xb5fa('0x1a')](0xcc)[_0xb5fa('0x27')]();});}};}function handleEntityNotFound(_0x11053a,_0x543edf){return function(_0x2dbd22){if(!_0x2dbd22){_0x11053a[_0xb5fa('0x28')](0x194);}return _0x2dbd22;};}function handleError(_0x6a455c,_0x20d649){_0x20d649=_0x20d649||0x1f4;return function(_0x568870){logger['error'](_0x568870['stack']);if(_0x568870['name']){delete _0x568870[_0xb5fa('0x29')];}_0x6a455c[_0xb5fa('0x1a')](_0x20d649)[_0xb5fa('0x2a')](_0x568870);};}exports[_0xb5fa('0x2b')]=function(_0x534884,_0x3506a4){var _0x358549={},_0x353314={},_0x409af9={'count':0x0,'rows':[]};var _0x2a5690=_[_0xb5fa('0x2c')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')],function(_0x1f4380){return{'name':_0x1f4380[_0xb5fa('0x2f')],'type':_0x1f4380[_0xb5fa('0x30')][_0xb5fa('0x31')]};});_0x353314[_0xb5fa('0x32')]=_[_0xb5fa('0x2c')](_0x2a5690,_0xb5fa('0x29'));_0x353314[_0xb5fa('0x33')]=_[_0xb5fa('0x34')](_0x534884[_0xb5fa('0x33')]);_0x353314[_0xb5fa('0x35')]=_['intersection'](_0x353314[_0xb5fa('0x32')],_0x353314['query']);_0x358549['attributes']=_['intersection'](_0x353314[_0xb5fa('0x32')],qs['fields'](_0x534884[_0xb5fa('0x33')]['fields']));_0x358549['attributes']=_0x358549[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x358549['attributes']:_0x353314['model'];if(!_0x534884[_0xb5fa('0x33')][_0xb5fa('0x38')](_0xb5fa('0x39'))){_0x358549['limit']=qs[_0xb5fa('0x1f')](_0x534884[_0xb5fa('0x33')]['limit']);_0x358549[_0xb5fa('0x1c')]=qs[_0xb5fa('0x1c')](_0x534884[_0xb5fa('0x33')]['offset']);}_0x358549[_0xb5fa('0x3a')]=qs[_0xb5fa('0x3b')](_0x534884[_0xb5fa('0x33')]['sort']);_0x358549[_0xb5fa('0x3c')]=qs[_0xb5fa('0x35')](_[_0xb5fa('0x3d')](_0x534884[_0xb5fa('0x33')],_0x353314['filters']),_0x2a5690);if(_0x534884['query']['filter']){_0x358549['where']=_['merge'](_0x358549['where'],{'$or':_[_0xb5fa('0x2c')](_0x2a5690,function(_0x4c0a4d){if(_0x4c0a4d[_0xb5fa('0x30')]!==_0xb5fa('0x3e')){var _0x36db1a={};_0x36db1a[_0x4c0a4d[_0xb5fa('0x29')]]={'$like':'%'+_0x534884[_0xb5fa('0x33')][_0xb5fa('0x3f')]+'%'};return _0x36db1a;}})});}_0x358549=_['merge']({},_0x358549,_0x534884['options']);var _0x4c4bf0={'where':_0x358549[_0xb5fa('0x3c')]};return db['CmHopperFinal'][_0xb5fa('0x1e')](_0x4c4bf0)['then'](function(_0x58aa97){_0x409af9[_0xb5fa('0x1e')]=_0x58aa97;if(_0x534884[_0xb5fa('0x33')][_0xb5fa('0x40')]){_0x358549[_0xb5fa('0x41')]=[{'all':!![]}];}return db[_0xb5fa('0x2d')][_0xb5fa('0x42')](_0x358549);})[_0xb5fa('0x43')](function(_0x83df0b){_0x409af9[_0xb5fa('0x44')]=_0x83df0b;return _0x409af9;})[_0xb5fa('0x43')](respondWithFilteredResult(_0x3506a4,_0x358549))['catch'](handleError(_0x3506a4,null));};exports[_0xb5fa('0x45')]=function(_0x4bc9df,_0x233f90){var _0x39aac3={'raw':!![],'where':{'id':_0x4bc9df[_0xb5fa('0x46')]['id']}},_0x2c7c5f={};_0x2c7c5f[_0xb5fa('0x32')]=_[_0xb5fa('0x34')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')]);_0x2c7c5f['query']=_[_0xb5fa('0x34')](_0x4bc9df[_0xb5fa('0x33')]);_0x2c7c5f['filters']=_[_0xb5fa('0x47')](_0x2c7c5f['model'],_0x2c7c5f[_0xb5fa('0x33')]);_0x39aac3[_0xb5fa('0x36')]=_['intersection'](_0x2c7c5f['model'],qs[_0xb5fa('0x48')](_0x4bc9df[_0xb5fa('0x33')][_0xb5fa('0x48')]));_0x39aac3[_0xb5fa('0x36')]=_0x39aac3[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x39aac3[_0xb5fa('0x36')]:_0x2c7c5f[_0xb5fa('0x32')];if(_0x4bc9df['query'][_0xb5fa('0x40')]){_0x39aac3[_0xb5fa('0x41')]=[{'all':!![]}];}_0x39aac3=_['merge']({},_0x39aac3,_0x4bc9df[_0xb5fa('0x49')]);return db[_0xb5fa('0x2d')][_0xb5fa('0x4a')](_0x39aac3)[_0xb5fa('0x43')](handleEntityNotFound(_0x233f90,null))[_0xb5fa('0x43')](respondWithResult(_0x233f90,null))[_0xb5fa('0x4b')](handleError(_0x233f90,null));};exports[_0xb5fa('0x4c')]=function(_0x33eb2c,_0x20f5f5){return db[_0xb5fa('0x2d')][_0xb5fa('0x4c')]()[_0xb5fa('0x43')](respondWithResult(_0x20f5f5,null))[_0xb5fa('0x4b')](handleError(_0x20f5f5,null));};exports[_0xb5fa('0x25')]=function(_0x42a359,_0x3a39f2){if(_0x42a359['body']['uniqueid']){delete _0x42a359[_0xb5fa('0x4d')]['uniqueid'];}return db[_0xb5fa('0x2d')][_0xb5fa('0x4a')]({'where':{'uniqueid':_0x42a359['params']['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x3a39f2,null))[_0xb5fa('0x43')](saveUpdates(_0x42a359[_0xb5fa('0x4d')],null))[_0xb5fa('0x43')](respondWithResult(_0x3a39f2,null))[_0xb5fa('0x4b')](handleError(_0x3a39f2,null));};exports[_0xb5fa('0x4e')]=function(_0x51d5f7,_0x27a651,_0x4fd5bf){return db[_0xb5fa('0x2d')][_0xb5fa('0x42')]({'raw':![],'where':{'VoiceQueueId':_0x51d5f7[_0xb5fa('0x46')]['id']},'attributes':[[db['sequelize']['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db['sequelize']['literal'](_0xb5fa('0x51')))),_0xb5fa('0x52')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x54')))),_0xb5fa('0x55')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x56')))),_0xb5fa('0x57')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db['sequelize']['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x58')))),_0xb5fa('0x59')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x5a')))),'dropContacts'],[db['sequelize']['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')]['literal'](_0xb5fa('0x5b')))),_0xb5fa('0x5c')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')]('`state`\x20=\x2022,\x201,\x20null'))),_0xb5fa('0x5d')],[db[_0xb5fa('0x50')]['fn']('COUNT',db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')]['literal'](_0xb5fa('0x5e')))),_0xb5fa('0x5f')]]})[_0xb5fa('0x43')](handleEntityNotFound(_0x27a651,null))[_0xb5fa('0x43')](respondWithResult(_0x27a651,null))[_0xb5fa('0x4b')](handleError(_0x27a651,null));};exports[_0xb5fa('0x60')]=function(_0x18cde9,_0x40d7d5,_0xd2ba4e){return db[_0xb5fa('0x2d')][_0xb5fa('0x42')]({'raw':![],'where':{'CampaignId':_0x18cde9[_0xb5fa('0x46')]['id']},'attributes':[[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x51')))),_0xb5fa('0x52')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db['sequelize'][_0xb5fa('0x53')](_0xb5fa('0x54')))),_0xb5fa('0x55')],[db['sequelize']['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db['sequelize'][_0xb5fa('0x53')](_0xb5fa('0x56')))),_0xb5fa('0x57')],[db['sequelize']['fn']('COUNT',db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')]('`state`\x20=\x208,\x201,\x20null'))),_0xb5fa('0x59')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xb5fa('0x61')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db['sequelize']['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x5b')))),_0xb5fa('0x5c')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x62')))),_0xb5fa('0x5d')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')]['literal'](_0xb5fa('0x5e')))),'answeringMachine']]})[_0xb5fa('0x43')](handleEntityNotFound(_0x40d7d5,null))[_0xb5fa('0x43')](respondWithResult(_0x40d7d5,null))[_0xb5fa('0x4b')](handleError(_0x40d7d5,null));};exports[_0xb5fa('0x63')]=function(_0x339dfb,_0x56e6b0,_0x1585cd){return db['VoiceQueue'][_0xb5fa('0x4a')]({'where':{'id':_0x339dfb[_0xb5fa('0x46')]['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x56e6b0,null))[_0xb5fa('0x43')](function(_0x5e44d8){var _0x4d1117;if(_0x5e44d8){_0x4d1117=squel['insert']()[_0xb5fa('0x64')](_0xb5fa('0x65'))[_0xb5fa('0x66')]([_0xb5fa('0x67'),_0xb5fa('0x68'),_0xb5fa('0x69'),'ListId',_0xb5fa('0x6a'),'createdAt','updatedAt'],squel[_0xb5fa('0x6b')]()['field']('ANY_VALUE(calleridnum)','phone')[_0xb5fa('0x6c')]('NOW()',_0xb5fa('0x68'))[_0xb5fa('0x6c')](_0xb5fa('0x6d'),'ContactId')['field'](_0xb5fa('0x6e'),_0xb5fa('0x6f'))['field'](_0xb5fa('0x70'),_0xb5fa('0x6a'))[_0xb5fa('0x6c')](_0xb5fa('0x71'),'createdAt')[_0xb5fa('0x6c')](_0xb5fa('0x71'),_0xb5fa('0x72'))[_0xb5fa('0x73')](_0xb5fa('0x74'))[_0xb5fa('0x3c')](_0xb5fa('0x75'),_0x339dfb['params']['id'][_0xb5fa('0x76')]())['where'](_0xb5fa('0x77'),_0x339dfb[_0xb5fa('0x4d')]['state'][_0xb5fa('0x76')]())[_0xb5fa('0x3c')](_0xb5fa('0x78'))[_0xb5fa('0x3c')](_0xb5fa('0x79'),squel[_0xb5fa('0x6b')]()[_0xb5fa('0x6c')](_0xb5fa('0x67'))['from'](_0xb5fa('0x65'))[_0xb5fa('0x3c')](_0xb5fa('0x75'),_0x339dfb[_0xb5fa('0x46')]['id']['toString']()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0xb5fa('0x6c')](_0xb5fa('0x7a'))[_0xb5fa('0x73')](_0xb5fa('0x74'))['where']('VoiceQueueId\x20=\x20?',_0x339dfb[_0xb5fa('0x46')]['id']['toString']())[_0xb5fa('0x3c')](_0xb5fa('0x7b')))[_0xb5fa('0x7c')](_0xb5fa('0x69')))['toString']();return db[_0xb5fa('0x50')]['query'](_0x4d1117);}return[];})[_0xb5fa('0x43')](respondWithResult(_0x56e6b0,null))[_0xb5fa('0x4b')](handleError(_0x56e6b0,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x5e6852,_0x391412,_0x3150ac){return db[_0xb5fa('0x7d')][_0xb5fa('0x4a')]({'where':{'id':_0x5e6852[_0xb5fa('0x46')]['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x391412,null))[_0xb5fa('0x43')](function(_0x25b278){var _0x1a0255;if(_0x25b278){_0x1a0255=squel[_0xb5fa('0x7e')]()[_0xb5fa('0x64')](_0xb5fa('0x65'))[_0xb5fa('0x66')](['phone','scheduledAt',_0xb5fa('0x69'),'ListId',_0xb5fa('0x7f'),_0xb5fa('0x80'),'updatedAt'],squel[_0xb5fa('0x6b')]()[_0xb5fa('0x6c')]('ANY_VALUE(calleridnum)',_0xb5fa('0x67'))[_0xb5fa('0x6c')]('NOW()',_0xb5fa('0x68'))[_0xb5fa('0x6c')](_0xb5fa('0x6d'),'ContactId')['field'](_0xb5fa('0x6e'),_0xb5fa('0x6f'))[_0xb5fa('0x6c')](_0xb5fa('0x81'),_0xb5fa('0x7f'))[_0xb5fa('0x6c')](_0xb5fa('0x71'),_0xb5fa('0x80'))[_0xb5fa('0x6c')](_0xb5fa('0x71'),'updatedAt')['from'](_0xb5fa('0x74'))[_0xb5fa('0x3c')](_0xb5fa('0x82'),_0x5e6852[_0xb5fa('0x46')]['id']['toString']())[_0xb5fa('0x3c')](_0xb5fa('0x77'),_0x5e6852[_0xb5fa('0x4d')]['state'][_0xb5fa('0x76')]())[_0xb5fa('0x3c')](_0xb5fa('0x78'))[_0xb5fa('0x3c')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb5fa('0x6b')]()[_0xb5fa('0x6c')](_0xb5fa('0x67'))[_0xb5fa('0x73')](_0xb5fa('0x65'))[_0xb5fa('0x3c')](_0xb5fa('0x82'),_0x5e6852[_0xb5fa('0x46')]['id'][_0xb5fa('0x76')]()))[_0xb5fa('0x3c')](_0xb5fa('0x79'),squel[_0xb5fa('0x6b')]()[_0xb5fa('0x6c')](_0xb5fa('0x7a'))[_0xb5fa('0x73')]('cm_hopper_final')[_0xb5fa('0x3c')](_0xb5fa('0x82'),_0x5e6852[_0xb5fa('0x46')]['id'][_0xb5fa('0x76')]())[_0xb5fa('0x3c')](_0xb5fa('0x7b')))[_0xb5fa('0x7c')](_0xb5fa('0x69')))['toString']();return db['sequelize'][_0xb5fa('0x33')](_0x1a0255);}return[];})['then'](respondWithResult(_0x391412,null))['catch'](handleError(_0x391412,null));};exports[_0xb5fa('0x83')]=function(_0x27dbe8,_0x2faf23,_0x4d607d){return db[_0xb5fa('0x84')][_0xb5fa('0x85')]({'where':{'VoiceQueueId':_0x27dbe8[_0xb5fa('0x4d')]['VoiceQueueId'],'CampaignId':_0x27dbe8[_0xb5fa('0x4d')][_0xb5fa('0x7f')],'ContactId':_0x27dbe8['body'][_0xb5fa('0x69')]}})[_0xb5fa('0x43')](handleEntityNotFound(_0x2faf23,null))[_0xb5fa('0x43')](function(_0xf15d5c){if(_0xf15d5c){return _0xf15d5c;}return null;})[_0xb5fa('0x43')](respondWithResult(_0x2faf23,null))[_0xb5fa('0x4b')](handleError(_0x2faf23,null));};
\ No newline at end of file
+var _0xeda8=['calleridnum','state\x20=\x204','group','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','stack','name','send','index','map','CmHopperFinal','rawAttributes','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','includeAll','include','rows','catch','show','params','keys','options','find','body','uniqueid','countContactsQueueCampaignHopperFinal','findAll','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','congestionContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','VoiceQueue','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','select'];(function(_0x462999,_0x24d200){var _0x4b1366=function(_0x1fa353){while(--_0x1fa353){_0x462999['push'](_0x462999['shift']());}};_0x4b1366(++_0x24d200);}(_0xeda8,0x104));var _0x8eda=function(_0x101a1e,_0x5ebf70){_0x101a1e=_0x101a1e-0x0;var _0xa9836=_0xeda8[_0x101a1e];return _0xa9836;};'use strict';var emlformat=require(_0x8eda('0x0'));var rimraf=require(_0x8eda('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8eda('0x2'));var rp=require(_0x8eda('0x3'));var moment=require(_0x8eda('0x4'));var BPromise=require(_0x8eda('0x5'));var Mustache=require(_0x8eda('0x6'));var util=require(_0x8eda('0x7'));var path=require(_0x8eda('0x8'));var sox=require(_0x8eda('0x9'));var csv=require(_0x8eda('0xa'));var ejs=require(_0x8eda('0xb'));var fs=require('fs');var fs_extra=require(_0x8eda('0xc'));var _=require(_0x8eda('0xd'));var squel=require('squel');var crypto=require(_0x8eda('0xe'));var jsforce=require(_0x8eda('0xf'));var deskjs=require(_0x8eda('0x10'));var toCsv=require(_0x8eda('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8eda('0x11'));var as=require(_0x8eda('0x12'));var hardwareService=require(_0x8eda('0x13'));var logger=require('../../config/logger')(_0x8eda('0x14'));var utils=require('../../config/utils');var config=require(_0x8eda('0x15'));var licenseUtil=require(_0x8eda('0x16'));var db=require(_0x8eda('0x17'))['db'];function respondWithStatusCode(_0x1ad3df,_0x337573){_0x337573=_0x337573||0xcc;return function(_0x3af00c){if(_0x3af00c){return _0x1ad3df[_0x8eda('0x18')](_0x337573);}return _0x1ad3df[_0x8eda('0x19')](_0x337573)['end']();};}function respondWithResult(_0x500bd4,_0xe04d90){_0xe04d90=_0xe04d90||0xc8;return function(_0x223dcf){if(_0x223dcf){return _0x500bd4['status'](_0xe04d90)[_0x8eda('0x1a')](_0x223dcf);}};}function respondWithFilteredResult(_0x34b1ee,_0x123905){return function(_0x56ff8a){if(_0x56ff8a){var _0x3f2925=typeof _0x123905['offset']===_0x8eda('0x1b')&&typeof _0x123905['limit']===_0x8eda('0x1b');var _0x58023b=_0x56ff8a[_0x8eda('0x1c')];var _0x2a4d2b=_0x3f2925?0x0:_0x123905['offset'];var _0x5e44b7=_0x3f2925?_0x56ff8a[_0x8eda('0x1c')]:_0x123905[_0x8eda('0x1d')]+_0x123905[_0x8eda('0x1e')];var _0x41abfa;if(_0x5e44b7>=_0x58023b){_0x5e44b7=_0x58023b;_0x41abfa=0xc8;}else{_0x41abfa=0xce;}_0x34b1ee[_0x8eda('0x19')](_0x41abfa);return _0x34b1ee[_0x8eda('0x1f')](_0x8eda('0x20'),_0x2a4d2b+'-'+_0x5e44b7+'/'+_0x58023b)[_0x8eda('0x1a')](_0x56ff8a);}return null;};}function patchUpdates(_0x850cce){return function(_0x232786){try{jsonpatch[_0x8eda('0x21')](_0x232786,_0x850cce,!![]);}catch(_0x57f336){return BPromise[_0x8eda('0x22')](_0x57f336);}return _0x232786['save']();};}function saveUpdates(_0x45517e,_0x5183bc){return function(_0x1033d6){if(_0x1033d6){return _0x1033d6[_0x8eda('0x23')](_0x45517e)['then'](function(_0x58e54b){return _0x58e54b;});}return null;};}function removeEntity(_0x56dba4,_0x2a4c99){return function(_0x17cae8){if(_0x17cae8){return _0x17cae8['destroy']()[_0x8eda('0x24')](function(){_0x56dba4[_0x8eda('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25e955,_0xfa57ca){return function(_0x24b1e1){if(!_0x24b1e1){_0x25e955[_0x8eda('0x18')](0x194);}return _0x24b1e1;};}function handleError(_0x2e42e4,_0x5c8488){_0x5c8488=_0x5c8488||0x1f4;return function(_0x41b5a9){logger['error'](_0x41b5a9[_0x8eda('0x25')]);if(_0x41b5a9[_0x8eda('0x26')]){delete _0x41b5a9[_0x8eda('0x26')];}_0x2e42e4['status'](_0x5c8488)[_0x8eda('0x27')](_0x41b5a9);};}exports[_0x8eda('0x28')]=function(_0x1dd12,_0x4cdd2e){var _0x1616ea={},_0x11a999={},_0x5dd315={'count':0x0,'rows':[]};var _0x27d2ce=_[_0x8eda('0x29')](db[_0x8eda('0x2a')][_0x8eda('0x2b')],function(_0x53274e){return{'name':_0x53274e['fieldName'],'type':_0x53274e['type'][_0x8eda('0x2c')]};});_0x11a999[_0x8eda('0x2d')]=_[_0x8eda('0x29')](_0x27d2ce,'name');_0x11a999['query']=_['keys'](_0x1dd12[_0x8eda('0x2e')]);_0x11a999[_0x8eda('0x2f')]=_[_0x8eda('0x30')](_0x11a999['model'],_0x11a999['query']);_0x1616ea['attributes']=_[_0x8eda('0x30')](_0x11a999[_0x8eda('0x2d')],qs[_0x8eda('0x31')](_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x31')]));_0x1616ea[_0x8eda('0x32')]=_0x1616ea[_0x8eda('0x32')][_0x8eda('0x33')]?_0x1616ea[_0x8eda('0x32')]:_0x11a999[_0x8eda('0x2d')];if(!_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x34')](_0x8eda('0x35'))){_0x1616ea[_0x8eda('0x1e')]=qs['limit'](_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x1e')]);_0x1616ea[_0x8eda('0x1d')]=qs['offset'](_0x1dd12['query'][_0x8eda('0x1d')]);}_0x1616ea[_0x8eda('0x36')]=qs[_0x8eda('0x37')](_0x1dd12[_0x8eda('0x2e')]['sort']);_0x1616ea[_0x8eda('0x38')]=qs[_0x8eda('0x2f')](_[_0x8eda('0x39')](_0x1dd12[_0x8eda('0x2e')],_0x11a999[_0x8eda('0x2f')]),_0x27d2ce);if(_0x1dd12[_0x8eda('0x2e')]['filter']){_0x1616ea[_0x8eda('0x38')]=_[_0x8eda('0x3a')](_0x1616ea[_0x8eda('0x38')],{'$or':_[_0x8eda('0x29')](_0x27d2ce,function(_0x261e12){if(_0x261e12[_0x8eda('0x3b')]!=='VIRTUAL'){var _0x1067eb={};_0x1067eb[_0x261e12[_0x8eda('0x26')]]={'$like':'%'+_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x3c')]+'%'};return _0x1067eb;}})});}_0x1616ea=_[_0x8eda('0x3a')]({},_0x1616ea,_0x1dd12['options']);var _0x17ee80={'where':_0x1616ea[_0x8eda('0x38')]};return db[_0x8eda('0x2a')]['count'](_0x17ee80)[_0x8eda('0x24')](function(_0x5d361e){_0x5dd315[_0x8eda('0x1c')]=_0x5d361e;if(_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x3d')]){_0x1616ea[_0x8eda('0x3e')]=[{'all':!![]}];}return db[_0x8eda('0x2a')]['findAll'](_0x1616ea);})['then'](function(_0xbf14a1){_0x5dd315[_0x8eda('0x3f')]=_0xbf14a1;return _0x5dd315;})[_0x8eda('0x24')](respondWithFilteredResult(_0x4cdd2e,_0x1616ea))[_0x8eda('0x40')](handleError(_0x4cdd2e,null));};exports[_0x8eda('0x41')]=function(_0x13b3bc,_0x18b043){var _0xcb6164={'raw':!![],'where':{'id':_0x13b3bc[_0x8eda('0x42')]['id']}},_0x184590={};_0x184590[_0x8eda('0x2d')]=_[_0x8eda('0x43')](db[_0x8eda('0x2a')][_0x8eda('0x2b')]);_0x184590[_0x8eda('0x2e')]=_[_0x8eda('0x43')](_0x13b3bc[_0x8eda('0x2e')]);_0x184590[_0x8eda('0x2f')]=_[_0x8eda('0x30')](_0x184590['model'],_0x184590[_0x8eda('0x2e')]);_0xcb6164[_0x8eda('0x32')]=_['intersection'](_0x184590[_0x8eda('0x2d')],qs[_0x8eda('0x31')](_0x13b3bc['query'][_0x8eda('0x31')]));_0xcb6164[_0x8eda('0x32')]=_0xcb6164['attributes'][_0x8eda('0x33')]?_0xcb6164[_0x8eda('0x32')]:_0x184590[_0x8eda('0x2d')];if(_0x13b3bc['query'][_0x8eda('0x3d')]){_0xcb6164[_0x8eda('0x3e')]=[{'all':!![]}];}_0xcb6164=_[_0x8eda('0x3a')]({},_0xcb6164,_0x13b3bc[_0x8eda('0x44')]);return db[_0x8eda('0x2a')][_0x8eda('0x45')](_0xcb6164)[_0x8eda('0x24')](handleEntityNotFound(_0x18b043,null))['then'](respondWithResult(_0x18b043,null))[_0x8eda('0x40')](handleError(_0x18b043,null));};exports['describe']=function(_0xcde3e,_0x52b026){return db[_0x8eda('0x2a')]['describe']()[_0x8eda('0x24')](respondWithResult(_0x52b026,null))['catch'](handleError(_0x52b026,null));};exports[_0x8eda('0x23')]=function(_0x3aca19,_0xf445){if(_0x3aca19[_0x8eda('0x46')][_0x8eda('0x47')]){delete _0x3aca19[_0x8eda('0x46')][_0x8eda('0x47')];}return db[_0x8eda('0x2a')][_0x8eda('0x45')]({'where':{'uniqueid':_0x3aca19[_0x8eda('0x42')]['id']}})[_0x8eda('0x24')](handleEntityNotFound(_0xf445,null))[_0x8eda('0x24')](saveUpdates(_0x3aca19['body'],null))[_0x8eda('0x24')](respondWithResult(_0xf445,null))[_0x8eda('0x40')](handleError(_0xf445,null));};exports[_0x8eda('0x48')]=function(_0x3259de,_0x33ba39,_0x389399){return db[_0x8eda('0x2a')][_0x8eda('0x49')]({'raw':![],'where':{'VoiceQueueId':_0x3259de[_0x8eda('0x42')]['id']},'attributes':[[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x4d')))),'noSuchContacts'],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x4e')))),'noAnswerContacts'],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db['sequelize'][_0x8eda('0x4c')]('`state`\x20=\x205,\x201,\x20null'))),_0x8eda('0x4f')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db['sequelize']['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x50')))),'congestionContacts'],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x51')))),_0x8eda('0x52')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db['sequelize'][_0x8eda('0x4c')](_0x8eda('0x53')))),'abandonedContacts'],[db[_0x8eda('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2022,\x201,\x20null'))),_0x8eda('0x54')],[db['sequelize']['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x55')))),_0x8eda('0x56')]]})[_0x8eda('0x24')](handleEntityNotFound(_0x33ba39,null))['then'](respondWithResult(_0x33ba39,null))[_0x8eda('0x40')](handleError(_0x33ba39,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0xdd71ce,_0x4ba827,_0xfb98bf){return db['CmHopperFinal'][_0x8eda('0x49')]({'raw':![],'where':{'CampaignId':_0xdd71ce[_0x8eda('0x42')]['id']},'attributes':[[db[_0x8eda('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x8eda('0x4c')](_0x8eda('0x4d')))),'noSuchContacts'],[db[_0x8eda('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x4e')))),_0x8eda('0x57')],[db['sequelize']['fn']('COUNT',db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x58')))),'busyContacts'],[db[_0x8eda('0x4a')]['fn']('COUNT',db[_0x8eda('0x4a')]['fn']('IF',db['sequelize'][_0x8eda('0x4c')]('`state`\x20=\x208,\x201,\x20null'))),_0x8eda('0x59')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x51')))),_0x8eda('0x52')],[db[_0x8eda('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x8eda('0x4a')]['literal'](_0x8eda('0x53')))),_0x8eda('0x5a')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db['sequelize']['literal'](_0x8eda('0x5b')))),_0x8eda('0x54')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')]('`state`\x20=\x2019,\x201,\x20null'))),_0x8eda('0x56')]]})[_0x8eda('0x24')](handleEntityNotFound(_0x4ba827,null))['then'](respondWithResult(_0x4ba827,null))[_0x8eda('0x40')](handleError(_0x4ba827,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x47f57c,_0x49d1a1,_0x5e66cd){return db[_0x8eda('0x5c')][_0x8eda('0x45')]({'where':{'id':_0x47f57c[_0x8eda('0x42')]['id']}})[_0x8eda('0x24')](handleEntityNotFound(_0x49d1a1,null))[_0x8eda('0x24')](function(_0xe5d324){var _0x589c2f;if(_0xe5d324){_0x589c2f=squel[_0x8eda('0x5d')]()[_0x8eda('0x5e')](_0x8eda('0x5f'))[_0x8eda('0x60')](['phone',_0x8eda('0x61'),_0x8eda('0x62'),_0x8eda('0x63'),_0x8eda('0x64'),_0x8eda('0x65'),_0x8eda('0x66')],squel['select']()[_0x8eda('0x67')](_0x8eda('0x68'),_0x8eda('0x69'))[_0x8eda('0x67')](_0x8eda('0x6a'),_0x8eda('0x61'))[_0x8eda('0x67')](_0x8eda('0x6b'),_0x8eda('0x62'))[_0x8eda('0x67')](_0x8eda('0x6c'),_0x8eda('0x63'))[_0x8eda('0x67')](_0x8eda('0x6d'),'VoiceQueueId')['field'](_0x8eda('0x6a'),_0x8eda('0x65'))[_0x8eda('0x67')](_0x8eda('0x6a'),'updatedAt')[_0x8eda('0x6e')](_0x8eda('0x6f'))['where'](_0x8eda('0x70'),_0x47f57c['params']['id'][_0x8eda('0x71')]())[_0x8eda('0x38')](_0x8eda('0x72'),_0x47f57c['body'][_0x8eda('0x73')][_0x8eda('0x71')]())[_0x8eda('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x8eda('0x38')](_0x8eda('0x74'),squel[_0x8eda('0x75')]()[_0x8eda('0x67')]('phone')['from'](_0x8eda('0x5f'))[_0x8eda('0x38')](_0x8eda('0x70'),_0x47f57c[_0x8eda('0x42')]['id']['toString']()))[_0x8eda('0x38')](_0x8eda('0x74'),squel[_0x8eda('0x75')]()[_0x8eda('0x67')](_0x8eda('0x76'))['from'](_0x8eda('0x6f'))[_0x8eda('0x38')](_0x8eda('0x70'),_0x47f57c['params']['id']['toString']())['where'](_0x8eda('0x77')))[_0x8eda('0x78')](_0x8eda('0x62')))[_0x8eda('0x71')]();return db[_0x8eda('0x4a')][_0x8eda('0x2e')](_0x589c2f);}return[];})[_0x8eda('0x24')](respondWithResult(_0x49d1a1,null))[_0x8eda('0x40')](handleError(_0x49d1a1,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x1bbe8b,_0x437c6f,_0x1006b1){return db['Campaign'][_0x8eda('0x45')]({'where':{'id':_0x1bbe8b[_0x8eda('0x42')]['id']}})[_0x8eda('0x24')](handleEntityNotFound(_0x437c6f,null))[_0x8eda('0x24')](function(_0x33350e){var _0x3e245f;if(_0x33350e){_0x3e245f=squel[_0x8eda('0x5d')]()[_0x8eda('0x5e')](_0x8eda('0x5f'))[_0x8eda('0x60')]([_0x8eda('0x69'),'scheduledAt',_0x8eda('0x62'),_0x8eda('0x63'),_0x8eda('0x79'),_0x8eda('0x65'),_0x8eda('0x66')],squel[_0x8eda('0x75')]()[_0x8eda('0x67')](_0x8eda('0x68'),_0x8eda('0x69'))[_0x8eda('0x67')](_0x8eda('0x6a'),'scheduledAt')['field']('ANY_VALUE(ContactId)',_0x8eda('0x62'))[_0x8eda('0x67')]('ANY_VALUE(ListId)',_0x8eda('0x63'))[_0x8eda('0x67')](_0x8eda('0x7a'),'CampaignId')[_0x8eda('0x67')]('NOW()',_0x8eda('0x65'))['field'](_0x8eda('0x6a'),_0x8eda('0x66'))['from'](_0x8eda('0x6f'))[_0x8eda('0x38')](_0x8eda('0x7b'),_0x1bbe8b[_0x8eda('0x42')]['id'][_0x8eda('0x71')]())[_0x8eda('0x38')](_0x8eda('0x72'),_0x1bbe8b[_0x8eda('0x46')][_0x8eda('0x73')][_0x8eda('0x71')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x8eda('0x75')]()[_0x8eda('0x67')](_0x8eda('0x69'))['from'](_0x8eda('0x5f'))[_0x8eda('0x38')](_0x8eda('0x7b'),_0x1bbe8b[_0x8eda('0x42')]['id'][_0x8eda('0x71')]()))[_0x8eda('0x38')](_0x8eda('0x74'),squel[_0x8eda('0x75')]()['field']('calleridnum')[_0x8eda('0x6e')](_0x8eda('0x6f'))['where'](_0x8eda('0x7b'),_0x1bbe8b[_0x8eda('0x42')]['id'][_0x8eda('0x71')]())['where'](_0x8eda('0x77')))[_0x8eda('0x78')](_0x8eda('0x62')))[_0x8eda('0x71')]();return db[_0x8eda('0x4a')][_0x8eda('0x2e')](_0x3e245f);}return[];})[_0x8eda('0x24')](respondWithResult(_0x437c6f,null))['catch'](handleError(_0x437c6f,null));};exports[_0x8eda('0x7c')]=function(_0x11f734,_0x4cb4e6,_0x5d8512){return db['CmHopper'][_0x8eda('0x7d')]({'where':{'VoiceQueueId':_0x11f734[_0x8eda('0x46')][_0x8eda('0x64')],'CampaignId':_0x11f734[_0x8eda('0x46')][_0x8eda('0x79')],'ContactId':_0x11f734[_0x8eda('0x46')][_0x8eda('0x62')]}})[_0x8eda('0x24')](handleEntityNotFound(_0x4cb4e6,null))[_0x8eda('0x24')](function(_0x1a3993){if(_0x1a3993){return _0x1a3993;}return null;})[_0x8eda('0x24')](respondWithResult(_0x4cb4e6,null))[_0x8eda('0x40')](handleError(_0x4cb4e6,null));};
\ No newline at end of file
index 5925e9e..86dbe13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa36a=['cm_hopper_final','calleridnum','uniqueid','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x25afaf,_0x28e3b8){var _0x115f0c=function(_0x51b2a3){while(--_0x51b2a3){_0x25afaf['push'](_0x25afaf['shift']());}};_0x115f0c(++_0x28e3b8);}(_0xa36a,0x1ef));var _0xaa36=function(_0x534701,_0x18428d){_0x534701=_0x534701-0x0;var _0x5c89da=_0xa36a[_0x534701];return _0x5c89da;};'use strict';var _=require(_0xaa36('0x0'));var util=require('util');var logger=require(_0xaa36('0x1'))('api');var moment=require(_0xaa36('0x2'));var BPromise=require(_0xaa36('0x3'));var rp=require(_0xaa36('0x4'));var fs=require('fs');var path=require(_0xaa36('0x5'));var rimraf=require(_0xaa36('0x6'));var config=require(_0xaa36('0x7'));var attributes=require('./cmHopperFinal.attributes');module[_0xaa36('0x8')]=function(_0x3157ec,_0x42d185){return _0x3157ec['define']('CmHopperFinal',attributes,{'tableName':_0xaa36('0x9'),'paranoid':![],'indexes':[{'name':_0xaa36('0xa'),'fields':[_0xaa36('0xa')]},{'name':_0xaa36('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd613=['./cmHopperFinal.attributes','exports','define','CmHopperFinal','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x4112f1,_0x159a86){var _0x54e1bf=function(_0x3a5624){while(--_0x3a5624){_0x4112f1['push'](_0x4112f1['shift']());}};_0x54e1bf(++_0x159a86);}(_0xd613,0x180));var _0x3d61=function(_0x3ee717,_0x1717bd){_0x3ee717=_0x3ee717-0x0;var _0x4b7d8a=_0xd613[_0x3ee717];return _0x4b7d8a;};'use strict';var _=require(_0x3d61('0x0'));var util=require(_0x3d61('0x1'));var logger=require(_0x3d61('0x2'))(_0x3d61('0x3'));var moment=require(_0x3d61('0x4'));var BPromise=require(_0x3d61('0x5'));var rp=require(_0x3d61('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3d61('0x7'));var config=require('../../config/environment');var attributes=require(_0x3d61('0x8'));module[_0x3d61('0x9')]=function(_0x3917c0,_0x508745){return _0x3917c0[_0x3d61('0xa')](_0x3d61('0xb'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x3d61('0xc'),'fields':['calleridnum']},{'name':_0x3d61('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index cc51d53..4d70316 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(_0x2ddfc9,_0x5a51af){var _0x15069f=function(_0x461fb9){while(--_0x461fb9){_0x2ddfc9['push'](_0x2ddfc9['shift']());}};_0x15069f(++_0x5a51af);}(_0xb10b,0x12a));var _0xbb10=function(_0x3e5d32,_0x19ce13){_0x3e5d32=_0x3e5d32-0x0;var _0x3e7822=_0xb10b[_0x3e5d32];return _0x3e7822;};'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(_0x3aad6b,_0x5913b5){var _0x3733fb=function(_0x4c9f60){while(--_0x4c9f60){_0x3aad6b['push'](_0x3aad6b['shift']());}};_0x3733fb(++_0x5913b5);}(_0x7a54,0x106));var _0x47a5=function(_0x43d0de,_0x490f32){_0x43d0de=_0x43d0de-0x0;var _0x37dc87=_0x7a54[_0x43d0de];return _0x37dc87;};'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 45ea728..430c1ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2427=['countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','update','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id'];(function(_0x231aa7,_0x5ebbf7){var _0x156043=function(_0x135430){while(--_0x135430){_0x231aa7['push'](_0x231aa7['shift']());}};_0x156043(++_0x5ebbf7);}(_0x2427,0xac));var _0x7242=function(_0x3b7416,_0x3bc146){_0x3b7416=_0x3b7416-0x0;var _0x2fb7e9=_0x2427[_0x3b7416];return _0x2fb7e9;};'use strict';var multer=require(_0x7242('0x0'));var util=require(_0x7242('0x1'));var path=require(_0x7242('0x2'));var timeout=require('connect-timeout');var express=require(_0x7242('0x3'));var router=express['Router']();var fs_extra=require(_0x7242('0x4'));var auth=require(_0x7242('0x5'));var interaction=require(_0x7242('0x6'));var config=require(_0x7242('0x7'));var controller=require('./cmHopperFinal.controller');router[_0x7242('0x8')]('/',auth[_0x7242('0x9')](),controller[_0x7242('0xa')]);router[_0x7242('0x8')](_0x7242('0xb'),auth[_0x7242('0x9')](),controller[_0x7242('0xc')]);router[_0x7242('0x8')](_0x7242('0xd'),auth[_0x7242('0x9')](),controller[_0x7242('0xe')]);router['get']('/voice/queue/countAttributes/:id',auth[_0x7242('0x9')](),controller[_0x7242('0xf')]);router[_0x7242('0x8')](_0x7242('0x10'),auth[_0x7242('0x9')](),controller[_0x7242('0x11')]);router[_0x7242('0x12')](_0x7242('0x13'),auth[_0x7242('0x9')](),controller[_0x7242('0x14')]);router[_0x7242('0x12')](_0x7242('0x15'),auth[_0x7242('0x9')](),controller[_0x7242('0x16')]);router[_0x7242('0x12')](_0x7242('0x17'),auth['isAuthenticated'](),controller[_0x7242('0x18')]);router['put'](_0x7242('0xd'),auth['isAuthenticated'](),controller[_0x7242('0x19')]);module[_0x7242('0x1a')]=router;
\ No newline at end of file
+var _0x7ea9=['/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','update','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show'];(function(_0x300776,_0x2aae33){var _0x8a9b1=function(_0x5817b2){while(--_0x5817b2){_0x300776['push'](_0x300776['shift']());}};_0x8a9b1(++_0x2aae33);}(_0x7ea9,0xec));var _0x97ea=function(_0xdd14c5,_0x178883){_0xdd14c5=_0xdd14c5-0x0;var _0x302fbf=_0x7ea9[_0xdd14c5];return _0x302fbf;};'use strict';var multer=require('multer');var util=require(_0x97ea('0x0'));var path=require(_0x97ea('0x1'));var timeout=require(_0x97ea('0x2'));var express=require(_0x97ea('0x3'));var router=express[_0x97ea('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x97ea('0x5'));var interaction=require(_0x97ea('0x6'));var config=require(_0x97ea('0x7'));var controller=require('./cmHopperFinal.controller');router[_0x97ea('0x8')]('/',auth[_0x97ea('0x9')](),controller[_0x97ea('0xa')]);router[_0x97ea('0x8')]('/describe',auth[_0x97ea('0x9')](),controller[_0x97ea('0xb')]);router['get'](_0x97ea('0xc'),auth['isAuthenticated'](),controller[_0x97ea('0xd')]);router['get'](_0x97ea('0xe'),auth[_0x97ea('0x9')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x97ea('0x8')](_0x97ea('0xf'),auth[_0x97ea('0x9')](),controller[_0x97ea('0x10')]);router[_0x97ea('0x11')](_0x97ea('0x12'),auth[_0x97ea('0x9')](),controller[_0x97ea('0x13')]);router[_0x97ea('0x11')](_0x97ea('0x14'),auth['isAuthenticated'](),controller[_0x97ea('0x15')]);router[_0x97ea('0x11')]('/checkContactHopper',auth[_0x97ea('0x9')](),controller[_0x97ea('0x16')]);router[_0x97ea('0x17')]('/:id',auth[_0x97ea('0x9')](),controller[_0x97ea('0x18')]);module['exports']=router;
\ No newline at end of file
index a645f4f..f3430db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d35=['STRING','DATE','INTEGER','BOOLEAN','sequelize'];(function(_0x525679,_0x3d5b5d){var _0x2fea4b=function(_0x366572){while(--_0x366572){_0x525679['push'](_0x525679['shift']());}};_0x2fea4b(++_0x3d5b5d);}(_0x6d35,0xf4));var _0x56d3=function(_0x5027b1,_0x1409a5){_0x5027b1=_0x5027b1-0x0;var _0x4a46cf=_0x6d35[_0x5027b1];return _0x4a46cf;};'use strict';var Sequelize=require(_0x56d3('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x56d3('0x1')]},'scheduledat':{'type':Sequelize[_0x56d3('0x2')]},'countbusyretry':{'type':Sequelize[_0x56d3('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x56d3('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x56d3('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x56d3('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x56d3('0x1')]},'originatecalleridnum':{'type':Sequelize[_0x56d3('0x1')]},'originatecalleridname':{'type':Sequelize[_0x56d3('0x1')]},'calleridnum':{'type':Sequelize[_0x56d3('0x1')]},'calleridname':{'type':Sequelize[_0x56d3('0x1')]},'starttime':{'type':Sequelize[_0x56d3('0x2')]},'responsetime':{'type':Sequelize[_0x56d3('0x2')]},'answertime':{'type':Sequelize[_0x56d3('0x2')]},'droptime':{'type':Sequelize[_0x56d3('0x2')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x56d3('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x56d3('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x56d3('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x56d3('0x1')]},'campaigntype':{'type':Sequelize[_0x56d3('0x1')]},'membername':{'type':Sequelize[_0x56d3('0x1')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x56d3('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x56d3('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x56d3('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x56d3('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x56d3('0x2')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x56d3('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x56d3('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x56d3('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x56d3('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x56d3('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xdf61=['STRING','BOOLEAN','exports','INTEGER','DATE'];(function(_0x39106e,_0x586f3d){var _0x892aec=function(_0xded1b5){while(--_0xded1b5){_0x39106e['push'](_0x39106e['shift']());}};_0x892aec(++_0x586f3d);}(_0xdf61,0x138));var _0x1df6=function(_0x43959f,_0x5892fb){_0x43959f=_0x43959f-0x0;var _0x319109=_0xdf61[_0x43959f];return _0x319109;};'use strict';var Sequelize=require('sequelize');module[_0x1df6('0x0')]={'state':{'type':Sequelize[_0x1df6('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x1df6('0x2')]},'countbusyretry':{'type':Sequelize[_0x1df6('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1df6('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1df6('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x1df6('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x1df6('0x3')]},'originatecalleridname':{'type':Sequelize[_0x1df6('0x3')]},'calleridnum':{'type':Sequelize[_0x1df6('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x1df6('0x2')]},'answertime':{'type':Sequelize[_0x1df6('0x2')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x1df6('0x2')]},'ringtime':{'type':Sequelize[_0x1df6('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x1df6('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x1df6('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x1df6('0x3')]},'campaign':{'type':Sequelize[_0x1df6('0x3')]},'campaigntype':{'type':Sequelize[_0x1df6('0x3')]},'membername':{'type':Sequelize[_0x1df6('0x3')]},'reason':{'type':Sequelize[_0x1df6('0x3')]},'amd':{'type':Sequelize[_0x1df6('0x4')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x1df6('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1df6('0x2')]},'recallme':{'type':Sequelize[_0x1df6('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x1df6('0x2')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x1df6('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1df6('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1df6('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1df6('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index c492621..54759af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8725=['body','describe','uniqueid','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','ioredis','../../components/auth/service','../../config/license/hardware','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','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','CmHopperHistory','includeAll','findAll','rows','show','include','find','catch','create'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x8725,0xe8));var _0x5872=function(_0x111e94,_0x31c837){_0x111e94=_0x111e94-0x0;var _0x3de107=_0x8725[_0x111e94];return _0x3de107;};'use strict';var emlformat=require(_0x5872('0x0'));var rimraf=require(_0x5872('0x1'));var zipdir=require(_0x5872('0x2'));var jsonpatch=require(_0x5872('0x3'));var rp=require(_0x5872('0x4'));var moment=require(_0x5872('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5872('0x6'));var util=require(_0x5872('0x7'));var path=require(_0x5872('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5872('0x9'));var fs=require('fs');var fs_extra=require(_0x5872('0xa'));var _=require(_0x5872('0xb'));var squel=require(_0x5872('0xc'));var crypto=require(_0x5872('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5872('0xe'));var authService=require(_0x5872('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5872('0x10'));var logger=require('../../config/logger')(_0x5872('0x11'));var utils=require(_0x5872('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x5872('0x13'));var db=require(_0x5872('0x14'))['db'];function respondWithStatusCode(_0x375991,_0x55fe04){_0x55fe04=_0x55fe04||0xcc;return function(_0x12d1e7){if(_0x12d1e7){return _0x375991[_0x5872('0x15')](_0x55fe04);}return _0x375991[_0x5872('0x16')](_0x55fe04)[_0x5872('0x17')]();};}function respondWithResult(_0x168e5d,_0x1df2c1){_0x1df2c1=_0x1df2c1||0xc8;return function(_0x24c508){if(_0x24c508){return _0x168e5d['status'](_0x1df2c1)[_0x5872('0x18')](_0x24c508);}};}function respondWithFilteredResult(_0x52cb8f,_0x83a1cc){return function(_0x203643){if(_0x203643){var _0x2adac0=typeof _0x83a1cc['offset']===_0x5872('0x19')&&typeof _0x83a1cc[_0x5872('0x1a')]===_0x5872('0x19');var _0x52beee=_0x203643[_0x5872('0x1b')];var _0x4c57f7=_0x2adac0?0x0:_0x83a1cc[_0x5872('0x1c')];var _0x2e2a36=_0x2adac0?_0x203643[_0x5872('0x1b')]:_0x83a1cc[_0x5872('0x1c')]+_0x83a1cc[_0x5872('0x1a')];var _0x25ad41;if(_0x2e2a36>=_0x52beee){_0x2e2a36=_0x52beee;_0x25ad41=0xc8;}else{_0x25ad41=0xce;}_0x52cb8f['status'](_0x25ad41);return _0x52cb8f[_0x5872('0x1d')](_0x5872('0x1e'),_0x4c57f7+'-'+_0x2e2a36+'/'+_0x52beee)[_0x5872('0x18')](_0x203643);}return null;};}function patchUpdates(_0x3e0182){return function(_0x26a3e4){try{jsonpatch[_0x5872('0x1f')](_0x26a3e4,_0x3e0182,!![]);}catch(_0x5f2df8){return BPromise[_0x5872('0x20')](_0x5f2df8);}return _0x26a3e4[_0x5872('0x21')]();};}function saveUpdates(_0x44c6e6,_0x4a57a2){return function(_0x3fb561){if(_0x3fb561){return _0x3fb561[_0x5872('0x22')](_0x44c6e6)[_0x5872('0x23')](function(_0x3eb7e5){return _0x3eb7e5;});}return null;};}function removeEntity(_0x23c5b9,_0x482ee2){return function(_0x2e55db){if(_0x2e55db){return _0x2e55db[_0x5872('0x24')]()['then'](function(){_0x23c5b9[_0x5872('0x16')](0xcc)[_0x5872('0x17')]();});}};}function handleEntityNotFound(_0x1d3fbe,_0x5e87c5){return function(_0xd645fa){if(!_0xd645fa){_0x1d3fbe[_0x5872('0x15')](0x194);}return _0xd645fa;};}function handleError(_0x13102a,_0x4e39f4){_0x4e39f4=_0x4e39f4||0x1f4;return function(_0x480858){logger[_0x5872('0x25')](_0x480858[_0x5872('0x26')]);if(_0x480858[_0x5872('0x27')]){delete _0x480858[_0x5872('0x27')];}_0x13102a['status'](_0x4e39f4)[_0x5872('0x28')](_0x480858);};}exports[_0x5872('0x29')]=function(_0x596d4b,_0x207496){var _0x444d46={},_0x28a74a={},_0x2478fb={'count':0x0,'rows':[]};var _0x64e226=_[_0x5872('0x2a')](db['CmHopperHistory']['rawAttributes'],function(_0x2fa2e3){return{'name':_0x2fa2e3[_0x5872('0x2b')],'type':_0x2fa2e3[_0x5872('0x2c')][_0x5872('0x2d')]};});_0x28a74a[_0x5872('0x2e')]=_[_0x5872('0x2a')](_0x64e226,'name');_0x28a74a[_0x5872('0x2f')]=_[_0x5872('0x30')](_0x596d4b[_0x5872('0x2f')]);_0x28a74a[_0x5872('0x31')]=_[_0x5872('0x32')](_0x28a74a['model'],_0x28a74a[_0x5872('0x2f')]);_0x444d46[_0x5872('0x33')]=_[_0x5872('0x32')](_0x28a74a['model'],qs[_0x5872('0x34')](_0x596d4b[_0x5872('0x2f')][_0x5872('0x34')]));_0x444d46['attributes']=_0x444d46[_0x5872('0x33')][_0x5872('0x35')]?_0x444d46[_0x5872('0x33')]:_0x28a74a[_0x5872('0x2e')];if(!_0x596d4b['query'][_0x5872('0x36')]('nolimit')){_0x444d46[_0x5872('0x1a')]=qs[_0x5872('0x1a')](_0x596d4b[_0x5872('0x2f')][_0x5872('0x1a')]);_0x444d46[_0x5872('0x1c')]=qs['offset'](_0x596d4b[_0x5872('0x2f')][_0x5872('0x1c')]);}_0x444d46[_0x5872('0x37')]=qs[_0x5872('0x38')](_0x596d4b['query'][_0x5872('0x38')]);_0x444d46[_0x5872('0x39')]=qs['filters'](_[_0x5872('0x3a')](_0x596d4b[_0x5872('0x2f')],_0x28a74a[_0x5872('0x31')]),_0x64e226);if(_0x596d4b[_0x5872('0x2f')][_0x5872('0x3b')]){_0x444d46['where']=_[_0x5872('0x3c')](_0x444d46[_0x5872('0x39')],{'$or':_[_0x5872('0x2a')](_0x64e226,function(_0x50091d){if(_0x50091d['type']!==_0x5872('0x3d')){var _0x81c5f7={};_0x81c5f7[_0x50091d[_0x5872('0x27')]]={'$like':'%'+_0x596d4b[_0x5872('0x2f')][_0x5872('0x3b')]+'%'};return _0x81c5f7;}})});}_0x444d46=_[_0x5872('0x3c')]({},_0x444d46,_0x596d4b[_0x5872('0x3e')]);var _0x59cce0={'where':_0x444d46['where']};return db[_0x5872('0x3f')][_0x5872('0x1b')](_0x59cce0)[_0x5872('0x23')](function(_0x1f4b5d){_0x2478fb[_0x5872('0x1b')]=_0x1f4b5d;if(_0x596d4b[_0x5872('0x2f')][_0x5872('0x40')]){_0x444d46['include']=[{'all':!![]}];}return db[_0x5872('0x3f')][_0x5872('0x41')](_0x444d46);})[_0x5872('0x23')](function(_0x5f54d2){_0x2478fb[_0x5872('0x42')]=_0x5f54d2;return _0x2478fb;})[_0x5872('0x23')](respondWithFilteredResult(_0x207496,_0x444d46))['catch'](handleError(_0x207496,null));};exports[_0x5872('0x43')]=function(_0x4e74ac,_0x416ec2){var _0x1d682b={'raw':!![],'where':{'id':_0x4e74ac['params']['id']}},_0x317556={};_0x317556['model']=_['keys'](db[_0x5872('0x3f')]['rawAttributes']);_0x317556['query']=_['keys'](_0x4e74ac[_0x5872('0x2f')]);_0x317556['filters']=_['intersection'](_0x317556[_0x5872('0x2e')],_0x317556[_0x5872('0x2f')]);_0x1d682b['attributes']=_[_0x5872('0x32')](_0x317556['model'],qs['fields'](_0x4e74ac[_0x5872('0x2f')][_0x5872('0x34')]));_0x1d682b['attributes']=_0x1d682b[_0x5872('0x33')][_0x5872('0x35')]?_0x1d682b[_0x5872('0x33')]:_0x317556[_0x5872('0x2e')];if(_0x4e74ac['query'][_0x5872('0x40')]){_0x1d682b[_0x5872('0x44')]=[{'all':!![]}];}_0x1d682b=_[_0x5872('0x3c')]({},_0x1d682b,_0x4e74ac[_0x5872('0x3e')]);return db[_0x5872('0x3f')][_0x5872('0x45')](_0x1d682b)[_0x5872('0x23')](handleEntityNotFound(_0x416ec2,null))[_0x5872('0x23')](respondWithResult(_0x416ec2,null))[_0x5872('0x46')](handleError(_0x416ec2,null));};exports[_0x5872('0x47')]=function(_0xefd33a,_0x5a43b3){return db[_0x5872('0x3f')][_0x5872('0x47')](_0xefd33a[_0x5872('0x48')],{})[_0x5872('0x23')](respondWithResult(_0x5a43b3,0xc9))[_0x5872('0x46')](handleError(_0x5a43b3,null));};exports[_0x5872('0x49')]=function(_0xd9b9af,_0x3a519b){return db[_0x5872('0x3f')][_0x5872('0x49')]()[_0x5872('0x23')](respondWithResult(_0x3a519b,null))[_0x5872('0x46')](handleError(_0x3a519b,null));};exports[_0x5872('0x22')]=function(_0x2eebef,_0x5ec007){if(_0x2eebef[_0x5872('0x48')][_0x5872('0x4a')]){delete _0x2eebef['body'][_0x5872('0x4a')];}return db[_0x5872('0x3f')]['find']({'where':{'uniqueid':_0x2eebef[_0x5872('0x4b')]['id']}})[_0x5872('0x23')](handleEntityNotFound(_0x5ec007,null))[_0x5872('0x23')](saveUpdates(_0x2eebef[_0x5872('0x48')],null))[_0x5872('0x23')](respondWithResult(_0x5ec007,null))[_0x5872('0x46')](handleError(_0x5ec007,null));};
\ No newline at end of file
+var _0xe5e9=['rows','catch','show','keys','find','create','describe','body','uniqueid','params','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','squel','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','end','json','limit','undefined','count','offset','status','set','reject','save','update','then','destroy','sendStatus','error','name','send','map','CmHopperHistory','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll'];(function(_0xb6384a,_0x528899){var _0x1ed7e4=function(_0x4aec89){while(--_0x4aec89){_0xb6384a['push'](_0xb6384a['shift']());}};_0x1ed7e4(++_0x528899);}(_0xe5e9,0x1c0));var _0x9e5e=function(_0x175a55,_0x4082fd){_0x175a55=_0x175a55-0x0;var _0x167adf=_0xe5e9[_0x175a55];return _0x167adf;};'use strict';var emlformat=require(_0x9e5e('0x0'));var rimraf=require(_0x9e5e('0x1'));var zipdir=require(_0x9e5e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9e5e('0x3'));var moment=require('moment');var BPromise=require(_0x9e5e('0x4'));var Mustache=require(_0x9e5e('0x5'));var util=require(_0x9e5e('0x6'));var path=require(_0x9e5e('0x7'));var sox=require(_0x9e5e('0x8'));var csv=require('to-csv');var ejs=require(_0x9e5e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9e5e('0xa'));var crypto=require('crypto');var jsforce=require(_0x9e5e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x9e5e('0xc'));var querystring=require('querystring');var Papa=require(_0x9e5e('0xd'));var Redis=require('ioredis');var authService=require(_0x9e5e('0xe'));var qs=require(_0x9e5e('0xf'));var as=require(_0x9e5e('0x10'));var hardwareService=require(_0x9e5e('0x11'));var logger=require(_0x9e5e('0x12'))('api');var utils=require(_0x9e5e('0x13'));var config=require(_0x9e5e('0x14'));var licenseUtil=require(_0x9e5e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x239c24,_0x2508de){_0x2508de=_0x2508de||0xcc;return function(_0x3de1dd){if(_0x3de1dd){return _0x239c24['sendStatus'](_0x2508de);}return _0x239c24['status'](_0x2508de)[_0x9e5e('0x16')]();};}function respondWithResult(_0x2ffba2,_0x42f1c3){_0x42f1c3=_0x42f1c3||0xc8;return function(_0x614d2f){if(_0x614d2f){return _0x2ffba2['status'](_0x42f1c3)[_0x9e5e('0x17')](_0x614d2f);}};}function respondWithFilteredResult(_0x2a92e7,_0x458ca2){return function(_0x45a2d4){if(_0x45a2d4){var _0xe96931=typeof _0x458ca2['offset']==='undefined'&&typeof _0x458ca2[_0x9e5e('0x18')]===_0x9e5e('0x19');var _0x2ce69=_0x45a2d4[_0x9e5e('0x1a')];var _0x460a5f=_0xe96931?0x0:_0x458ca2[_0x9e5e('0x1b')];var _0x2c0411=_0xe96931?_0x45a2d4[_0x9e5e('0x1a')]:_0x458ca2['offset']+_0x458ca2[_0x9e5e('0x18')];var _0x1319ac;if(_0x2c0411>=_0x2ce69){_0x2c0411=_0x2ce69;_0x1319ac=0xc8;}else{_0x1319ac=0xce;}_0x2a92e7[_0x9e5e('0x1c')](_0x1319ac);return _0x2a92e7[_0x9e5e('0x1d')]('Content-Range',_0x460a5f+'-'+_0x2c0411+'/'+_0x2ce69)['json'](_0x45a2d4);}return null;};}function patchUpdates(_0x43c772){return function(_0x26eeed){try{jsonpatch['apply'](_0x26eeed,_0x43c772,!![]);}catch(_0x356e6b){return BPromise[_0x9e5e('0x1e')](_0x356e6b);}return _0x26eeed[_0x9e5e('0x1f')]();};}function saveUpdates(_0x32044f,_0x5a5fb7){return function(_0x5bfcc1){if(_0x5bfcc1){return _0x5bfcc1[_0x9e5e('0x20')](_0x32044f)[_0x9e5e('0x21')](function(_0x3acb94){return _0x3acb94;});}return null;};}function removeEntity(_0x428254,_0x1fb93e){return function(_0x1a0c5a){if(_0x1a0c5a){return _0x1a0c5a[_0x9e5e('0x22')]()[_0x9e5e('0x21')](function(){_0x428254[_0x9e5e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b960c,_0x47b386){return function(_0x471d12){if(!_0x471d12){_0x1b960c[_0x9e5e('0x23')](0x194);}return _0x471d12;};}function handleError(_0x4ae17f,_0xec2c6a){_0xec2c6a=_0xec2c6a||0x1f4;return function(_0x25a869){logger[_0x9e5e('0x24')](_0x25a869['stack']);if(_0x25a869[_0x9e5e('0x25')]){delete _0x25a869[_0x9e5e('0x25')];}_0x4ae17f['status'](_0xec2c6a)[_0x9e5e('0x26')](_0x25a869);};}exports['index']=function(_0x24ba61,_0x466f21){var _0x271529={},_0x4cefcf={},_0x35de82={'count':0x0,'rows':[]};var _0x286a38=_[_0x9e5e('0x27')](db[_0x9e5e('0x28')]['rawAttributes'],function(_0x6ff616){return{'name':_0x6ff616[_0x9e5e('0x29')],'type':_0x6ff616[_0x9e5e('0x2a')][_0x9e5e('0x2b')]};});_0x4cefcf[_0x9e5e('0x2c')]=_[_0x9e5e('0x27')](_0x286a38,_0x9e5e('0x25'));_0x4cefcf[_0x9e5e('0x2d')]=_['keys'](_0x24ba61[_0x9e5e('0x2d')]);_0x4cefcf[_0x9e5e('0x2e')]=_[_0x9e5e('0x2f')](_0x4cefcf[_0x9e5e('0x2c')],_0x4cefcf[_0x9e5e('0x2d')]);_0x271529['attributes']=_[_0x9e5e('0x2f')](_0x4cefcf[_0x9e5e('0x2c')],qs['fields'](_0x24ba61['query'][_0x9e5e('0x30')]));_0x271529[_0x9e5e('0x31')]=_0x271529[_0x9e5e('0x31')][_0x9e5e('0x32')]?_0x271529[_0x9e5e('0x31')]:_0x4cefcf[_0x9e5e('0x2c')];if(!_0x24ba61[_0x9e5e('0x2d')][_0x9e5e('0x33')](_0x9e5e('0x34'))){_0x271529['limit']=qs[_0x9e5e('0x18')](_0x24ba61['query']['limit']);_0x271529['offset']=qs[_0x9e5e('0x1b')](_0x24ba61[_0x9e5e('0x2d')][_0x9e5e('0x1b')]);}_0x271529[_0x9e5e('0x35')]=qs[_0x9e5e('0x36')](_0x24ba61[_0x9e5e('0x2d')]['sort']);_0x271529[_0x9e5e('0x37')]=qs[_0x9e5e('0x2e')](_[_0x9e5e('0x38')](_0x24ba61[_0x9e5e('0x2d')],_0x4cefcf[_0x9e5e('0x2e')]),_0x286a38);if(_0x24ba61[_0x9e5e('0x2d')][_0x9e5e('0x39')]){_0x271529['where']=_[_0x9e5e('0x3a')](_0x271529[_0x9e5e('0x37')],{'$or':_['map'](_0x286a38,function(_0x1a379b){if(_0x1a379b[_0x9e5e('0x2a')]!=='VIRTUAL'){var _0x4e26e1={};_0x4e26e1[_0x1a379b[_0x9e5e('0x25')]]={'$like':'%'+_0x24ba61[_0x9e5e('0x2d')][_0x9e5e('0x39')]+'%'};return _0x4e26e1;}})});}_0x271529=_[_0x9e5e('0x3a')]({},_0x271529,_0x24ba61[_0x9e5e('0x3b')]);var _0x58e493={'where':_0x271529['where']};return db['CmHopperHistory'][_0x9e5e('0x1a')](_0x58e493)[_0x9e5e('0x21')](function(_0x2ab71e){_0x35de82['count']=_0x2ab71e;if(_0x24ba61['query'][_0x9e5e('0x3c')]){_0x271529[_0x9e5e('0x3d')]=[{'all':!![]}];}return db[_0x9e5e('0x28')][_0x9e5e('0x3e')](_0x271529);})[_0x9e5e('0x21')](function(_0x577b5d){_0x35de82[_0x9e5e('0x3f')]=_0x577b5d;return _0x35de82;})['then'](respondWithFilteredResult(_0x466f21,_0x271529))[_0x9e5e('0x40')](handleError(_0x466f21,null));};exports[_0x9e5e('0x41')]=function(_0x41bf11,_0x3edc0e){var _0x3ee35e={'raw':!![],'where':{'id':_0x41bf11['params']['id']}},_0x3df771={};_0x3df771[_0x9e5e('0x2c')]=_[_0x9e5e('0x42')](db[_0x9e5e('0x28')]['rawAttributes']);_0x3df771[_0x9e5e('0x2d')]=_[_0x9e5e('0x42')](_0x41bf11[_0x9e5e('0x2d')]);_0x3df771[_0x9e5e('0x2e')]=_[_0x9e5e('0x2f')](_0x3df771['model'],_0x3df771[_0x9e5e('0x2d')]);_0x3ee35e[_0x9e5e('0x31')]=_[_0x9e5e('0x2f')](_0x3df771[_0x9e5e('0x2c')],qs[_0x9e5e('0x30')](_0x41bf11[_0x9e5e('0x2d')][_0x9e5e('0x30')]));_0x3ee35e[_0x9e5e('0x31')]=_0x3ee35e[_0x9e5e('0x31')][_0x9e5e('0x32')]?_0x3ee35e['attributes']:_0x3df771[_0x9e5e('0x2c')];if(_0x41bf11[_0x9e5e('0x2d')][_0x9e5e('0x3c')]){_0x3ee35e[_0x9e5e('0x3d')]=[{'all':!![]}];}_0x3ee35e=_[_0x9e5e('0x3a')]({},_0x3ee35e,_0x41bf11['options']);return db[_0x9e5e('0x28')][_0x9e5e('0x43')](_0x3ee35e)['then'](handleEntityNotFound(_0x3edc0e,null))[_0x9e5e('0x21')](respondWithResult(_0x3edc0e,null))[_0x9e5e('0x40')](handleError(_0x3edc0e,null));};exports[_0x9e5e('0x44')]=function(_0x3f8e72,_0x7c4c08){return db[_0x9e5e('0x28')]['create'](_0x3f8e72['body'],{})['then'](respondWithResult(_0x7c4c08,0xc9))[_0x9e5e('0x40')](handleError(_0x7c4c08,null));};exports[_0x9e5e('0x45')]=function(_0x565816,_0xf3506e){return db['CmHopperHistory']['describe']()[_0x9e5e('0x21')](respondWithResult(_0xf3506e,null))[_0x9e5e('0x40')](handleError(_0xf3506e,null));};exports[_0x9e5e('0x20')]=function(_0x3111e9,_0x39aa42){if(_0x3111e9['body']['uniqueid']){delete _0x3111e9[_0x9e5e('0x46')][_0x9e5e('0x47')];}return db['CmHopperHistory'][_0x9e5e('0x43')]({'where':{'uniqueid':_0x3111e9[_0x9e5e('0x48')]['id']}})[_0x9e5e('0x21')](handleEntityNotFound(_0x39aa42,null))[_0x9e5e('0x21')](saveUpdates(_0x3111e9[_0x9e5e('0x46')],null))['then'](respondWithResult(_0x39aa42,null))['catch'](handleError(_0x39aa42,null));};
\ No newline at end of file
index 67797d7..82cc396 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf417=['../../config/logger','api','bluebird','rimraf','CmHopperHistory','cm_hopper_history','endtime','uniqueid','util'];(function(_0x393ded,_0x47c302){var _0x2d321=function(_0x4d08fb){while(--_0x4d08fb){_0x393ded['push'](_0x393ded['shift']());}};_0x2d321(++_0x47c302);}(_0xf417,0x8f));var _0x7f41=function(_0x40b003,_0x3ae3aa){_0x40b003=_0x40b003-0x0;var _0x3d0edc=_0xf417[_0x40b003];return _0x3d0edc;};'use strict';var _=require('lodash');var util=require(_0x7f41('0x0'));var logger=require(_0x7f41('0x1'))(_0x7f41('0x2'));var moment=require('moment');var BPromise=require(_0x7f41('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7f41('0x4'));var config=require('../../config/environment');var attributes=require('./cmHopperHistory.attributes');module['exports']=function(_0x5ecdb2,_0x1775d8){return _0x5ecdb2['define'](_0x7f41('0x5'),attributes,{'tableName':_0x7f41('0x6'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x7f41('0x7')]},{'name':'uniqueid','fields':[_0x7f41('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xdf5d=['exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cmHopperHistory.attributes'];(function(_0x5a8b40,_0x4e403d){var _0x478346=function(_0x513b2d){while(--_0x513b2d){_0x5a8b40['push'](_0x5a8b40['shift']());}};_0x478346(++_0x4e403d);}(_0xdf5d,0x126));var _0xddf5=function(_0x369091,_0x574725){_0x369091=_0x369091-0x0;var _0x418677=_0xdf5d[_0x369091];return _0x418677;};'use strict';var _=require(_0xddf5('0x0'));var util=require(_0xddf5('0x1'));var logger=require(_0xddf5('0x2'))(_0xddf5('0x3'));var moment=require(_0xddf5('0x4'));var BPromise=require(_0xddf5('0x5'));var rp=require(_0xddf5('0x6'));var fs=require('fs');var path=require(_0xddf5('0x7'));var rimraf=require('rimraf');var config=require(_0xddf5('0x8'));var attributes=require(_0xddf5('0x9'));module[_0xddf5('0xa')]=function(_0x3dc7dc,_0x3335b5){return _0x3dc7dc[_0xddf5('0xb')](_0xddf5('0xc'),attributes,{'tableName':_0xddf5('0xd'),'paranoid':![],'indexes':[{'name':_0xddf5('0xe'),'fields':[_0xddf5('0xe')]},{'name':_0xddf5('0xf'),'fields':[_0xddf5('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
index 6af8af5..6c03b47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x131e=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','CmHopperHistory,\x20%s,\x20%s','catch','CmHopperHistory','create','options','raw','CreateCmHopperHistory','AvgHandleTime','sequelize','COUNT','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','findAll','where','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','GetCampaignHopperHistory','col','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x43b764,_0x22af88){var _0x394e8a=function(_0x284b6a){while(--_0x284b6a){_0x43b764['push'](_0x43b764['shift']());}};_0x394e8a(++_0x22af88);}(_0x131e,0x1ec));var _0xe131=function(_0x2d7c1b,_0x374c21){_0x2d7c1b=_0x2d7c1b-0x0;var _0x4d3f0e=_0x131e[_0x2d7c1b];return _0x4d3f0e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe131('0x0'));var rs=require(_0xe131('0x1'));var fs=require('fs');var Redis=require(_0xe131('0x2'));var db=require(_0xe131('0x3'))['db'];var utils=require(_0xe131('0x4'));var logger=require(_0xe131('0x5'))('rpc');var config=require(_0xe131('0x6'));var jayson=require(_0xe131('0x7'));var client=jayson[_0xe131('0x8')][_0xe131('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1002a6,_0x48a90e,_0x5c4eb5){return new BPromise(function(_0x562617,_0x4bf386){return client[_0xe131('0xa')](_0x1002a6,_0x5c4eb5)[_0xe131('0xb')](function(_0x530ecb){logger[_0xe131('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x48a90e,_0xe131('0xd'));logger[_0xe131('0xe')](_0xe131('0xf'),_0x48a90e,_0xe131('0xd'),JSON[_0xe131('0x10')](_0x530ecb));if(_0x530ecb[_0xe131('0x11')]){if(_0x530ecb[_0xe131('0x11')]['code']===0x1f4){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x48a90e,_0x530ecb['error'][_0xe131('0x12')]);return _0x4bf386(_0x530ecb[_0xe131('0x11')][_0xe131('0x12')]);}logger[_0xe131('0x11')](_0xe131('0x13'),_0x48a90e,_0x530ecb[_0xe131('0x11')][_0xe131('0x12')]);return _0x562617(_0x530ecb[_0xe131('0x11')][_0xe131('0x12')]);}else{logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x48a90e,'request\x20sent');_0x562617(_0x530ecb['result']['message']);}})[_0xe131('0x14')](function(_0x32091b){logger[_0xe131('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x48a90e,_0x32091b);_0x4bf386(_0x32091b);});});}exports['CreateCmHopperHistory']=function(_0x400f6b){var _0x2e2bf8=this;return new Promise(function(_0x3bbca8,_0x1a1e03){return db[_0xe131('0x15')][_0xe131('0x16')](_0x400f6b['body'],{'raw':_0x400f6b[_0xe131('0x17')]?_0x400f6b[_0xe131('0x17')][_0xe131('0x18')]===undefined?!![]:![]:!![]})[_0xe131('0xb')](function(_0x2d6c6b){logger['info']('CreateCmHopperHistory',_0x400f6b);logger[_0xe131('0xe')](_0xe131('0x19'),_0x400f6b,JSON['stringify'](_0x2d6c6b));_0x3bbca8(_0x2d6c6b);})[_0xe131('0x14')](function(_0x55b0c5){logger['error'](_0xe131('0x19'),_0x55b0c5[_0xe131('0x12')],_0x400f6b);_0x1a1e03(_0x2e2bf8[_0xe131('0x11')](0x1f4,_0x55b0c5[_0xe131('0x12')]));});});};exports[_0xe131('0x1a')]=function(_0x225278){var _0x2bcb68=this;return new Promise(function(_0x52c546,_0x2be2df){return db[_0xe131('0x15')]['findAll']({'raw':_0x225278['options']?_0x225278[_0xe131('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x225278[_0xe131('0x17')]?_0x225278[_0xe131('0x17')]['where']||null:null,'attributes':[[db[_0xe131('0x1b')]['fn'](_0xe131('0x1c'),db[_0xe131('0x1b')]['col']('id')),_0xe131('0x1d')],[db[_0xe131('0x1b')]['fn'](_0xe131('0x1c'),db[_0xe131('0x1b')]['fn']('IF',db[_0xe131('0x1b')][_0xe131('0x1e')](_0xe131('0x1f')))),_0xe131('0x20')],[db[_0xe131('0x1b')]['fn'](_0xe131('0x1c'),db['sequelize']['fn']('IF',db[_0xe131('0x1b')]['literal'](_0xe131('0x21')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0xe131('0x1b')]['fn']('COUNT',db[_0xe131('0x1b')]['fn']('IF',db[_0xe131('0x1b')][_0xe131('0x1e')]('`state`\x20=\x2011,\x201,\x20null'))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0xe131('0x1b')]['fn'](_0xe131('0x22'),db[_0xe131('0x1b')]['fn']('IF',db[_0xe131('0x1b')][_0xe131('0x1e')](_0xe131('0x23')))),_0xe131('0x24')],[db[_0xe131('0x1b')]['fn']('AVG',db['sequelize']['fn']('IF',db[_0xe131('0x1b')][_0xe131('0x1e')](_0xe131('0x25')))),_0xe131('0x26')]]})[_0xe131('0xb')](function(_0x44cc9f){logger[_0xe131('0xc')]('AvgHandleTime',_0x225278);logger['debug'](_0xe131('0x1a'),_0x225278,JSON['stringify'](_0x44cc9f));_0x52c546(_0x44cc9f);})[_0xe131('0x14')](function(_0x584cc9){logger[_0xe131('0x11')]('AvgHandleTime',_0x584cc9[_0xe131('0x12')],_0x225278);_0x2be2df(_0x2bcb68['error'](0x1f4,_0x584cc9[_0xe131('0x12')]));});});};exports[_0xe131('0x27')]=function(_0x38343c){var _0x2aa2e5=this;return new Promise(function(_0x9e35ed,_0x17016b){return db['CmHopperHistory'][_0xe131('0x28')]({'raw':_0x38343c['options']?_0x38343c[_0xe131('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x38343c[_0xe131('0x17')]?_0x38343c[_0xe131('0x17')][_0xe131('0x29')]||null:null,'attributes':[[_0xe131('0x2a'),_0xe131('0x2b')],[db[_0xe131('0x1b')]['fn'](_0xe131('0x1c'),db['sequelize']['fn']('IF',db[_0xe131('0x1b')]['literal'](_0xe131('0x2c')))),_0xe131('0x2d')],[db['sequelize']['fn']('COUNT',db[_0xe131('0x1b')]['fn']('IF',db['sequelize']['literal'](_0xe131('0x2e')))),'outboundNoAnswerCallsDay'],[db[_0xe131('0x1b')]['fn'](_0xe131('0x1c'),db['sequelize']['fn']('IF',db[_0xe131('0x1b')][_0xe131('0x1e')](_0xe131('0x1f')))),_0xe131('0x2f')],[db[_0xe131('0x1b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xe131('0x1b')][_0xe131('0x1e')](_0xe131('0x30')))),'outboundBusyCallsDay'],[db[_0xe131('0x1b')]['fn'](_0xe131('0x1c'),db[_0xe131('0x1b')]['fn']('IF',db['sequelize'][_0xe131('0x1e')](_0xe131('0x31')))),_0xe131('0x32')],[db['sequelize']['fn'](_0xe131('0x1c'),db[_0xe131('0x1b')]['fn']('IF',db[_0xe131('0x1b')]['literal'](_0xe131('0x33')))),_0xe131('0x34')],[db[_0xe131('0x1b')]['fn'](_0xe131('0x1c'),db[_0xe131('0x1b')]['fn']('IF',db[_0xe131('0x1b')][_0xe131('0x1e')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'outboundDropCallsDayCallersExit'],[db[_0xe131('0x1b')]['fn'](_0xe131('0x1c'),db[_0xe131('0x1b')]['fn']('IF',db[_0xe131('0x1b')][_0xe131('0x1e')](_0xe131('0x35')))),'outboundUnknownCallsDay'],[db[_0xe131('0x1b')]['fn'](_0xe131('0x1c'),db[_0xe131('0x1b')]['fn']('IF',db[_0xe131('0x1b')][_0xe131('0x1e')](_0xe131('0x36')))),'outboundBlacklistCallsDay'],[db[_0xe131('0x1b')]['fn'](_0xe131('0x1c'),db[_0xe131('0x1b')]['fn']('IF',db[_0xe131('0x1b')][_0xe131('0x1e')](_0xe131('0x37')))),_0xe131('0x38')],[db[_0xe131('0x1b')]['fn'](_0xe131('0x1c'),db[_0xe131('0x1b')]['fn']('IF',db[_0xe131('0x1b')]['literal'](_0xe131('0x39')))),'outboundRejectCallsDay'],[db['sequelize']['fn'](_0xe131('0x1c'),db[_0xe131('0x1b')]['fn']('IF',db[_0xe131('0x1b')][_0xe131('0x1e')](_0xe131('0x3a')))),_0xe131('0x3b')],[db[_0xe131('0x1b')]['fn'](_0xe131('0x1c'),db[_0xe131('0x1b')]['fn']('IF',db[_0xe131('0x1b')][_0xe131('0x1e')]('`state`\x20=\x2020,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0xe131('0x1b')]['fn'](_0xe131('0x1c'),db['sequelize']['fn']('IF',db['sequelize'][_0xe131('0x1e')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':[_0xe131('0x2a')]})[_0xe131('0xb')](function(_0x32e45d){logger[_0xe131('0xc')](_0xe131('0x27'),_0x38343c);logger[_0xe131('0xe')]('GetVoiceQueueHopperHistory',_0x38343c,JSON['stringify'](_0x32e45d));_0x9e35ed(_0x32e45d);})[_0xe131('0x14')](function(_0xc3867d){logger['error'](_0xe131('0x27'),_0xc3867d[_0xe131('0x12')],_0x38343c);_0x17016b(_0x2aa2e5[_0xe131('0x11')](0x1f4,_0xc3867d[_0xe131('0x12')]));});});};exports[_0xe131('0x3c')]=function(_0x1338f3){var _0x4a9ad6=this;return new Promise(function(_0x23d880,_0x544b14){return db['CmHopperHistory'][_0xe131('0x28')]({'raw':_0x1338f3[_0xe131('0x17')]?_0x1338f3['options']['raw']===undefined?!![]:![]:!![],'where':_0x1338f3[_0xe131('0x17')]?_0x1338f3[_0xe131('0x17')][_0xe131('0x29')]||null:null,'attributes':[['campaign',_0xe131('0x2b')],[db[_0xe131('0x1b')]['fn'](_0xe131('0x1c'),db[_0xe131('0x1b')][_0xe131('0x3d')]('id')),'ivrTotalCallsDays'],[db[_0xe131('0x1b')]['fn']('COUNT',db[_0xe131('0x1b')]['fn']('IF',db[_0xe131('0x1b')][_0xe131('0x1e')](_0xe131('0x1f')))),'ivrAnswerCallsDay']],'group':['campaign']})['then'](function(_0x44552d){logger['info'](_0xe131('0x3c'),_0x1338f3);logger[_0xe131('0xe')](_0xe131('0x3c'),_0x1338f3,JSON[_0xe131('0x10')](_0x44552d));_0x23d880(_0x44552d);})[_0xe131('0x14')](function(_0x3f8f72){logger[_0xe131('0x11')](_0xe131('0x3c'),_0x3f8f72[_0xe131('0x12')],_0x1338f3);_0x544b14(_0x4a9ad6[_0xe131('0x11')](0x1f4,_0x3f8f72['message']));});});};
\ No newline at end of file
+var _0xd957=['options','raw','stringify','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','findAll','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','GetCampaignHopperHistory','ivrAnswerCallsDay','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateCmHopperHistory','CmHopperHistory','body'];(function(_0x4214da,_0x586705){var _0x64da0=function(_0x273e00){while(--_0x273e00){_0x4214da['push'](_0x4214da['shift']());}};_0x64da0(++_0x586705);}(_0xd957,0x153));var _0x7d95=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd957[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x7d95('0x0'));var util=require(_0x7d95('0x1'));var moment=require('moment');var BPromise=require(_0x7d95('0x2'));var rs=require(_0x7d95('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7d95('0x4'))['db'];var utils=require(_0x7d95('0x5'));var logger=require(_0x7d95('0x6'))(_0x7d95('0x7'));var config=require(_0x7d95('0x8'));var jayson=require(_0x7d95('0x9'));var client=jayson[_0x7d95('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x181ca5,_0x11bb29,_0x4f10ec){return new BPromise(function(_0xfd14f6,_0x399d23){return client[_0x7d95('0xb')](_0x181ca5,_0x4f10ec)[_0x7d95('0xc')](function(_0x173838){logger['info'](_0x7d95('0xd'),_0x11bb29,_0x7d95('0xe'));logger[_0x7d95('0xf')](_0x7d95('0x10'),_0x11bb29,_0x7d95('0xe'),JSON['stringify'](_0x173838));if(_0x173838['error']){if(_0x173838[_0x7d95('0x11')][_0x7d95('0x12')]===0x1f4){logger['error'](_0x7d95('0xd'),_0x11bb29,_0x173838[_0x7d95('0x11')][_0x7d95('0x13')]);return _0x399d23(_0x173838[_0x7d95('0x11')][_0x7d95('0x13')]);}logger[_0x7d95('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x11bb29,_0x173838[_0x7d95('0x11')]['message']);return _0xfd14f6(_0x173838[_0x7d95('0x11')]['message']);}else{logger[_0x7d95('0x14')]('CmHopperHistory,\x20%s,\x20%s',_0x11bb29,_0x7d95('0xe'));_0xfd14f6(_0x173838[_0x7d95('0x15')][_0x7d95('0x13')]);}})[_0x7d95('0x16')](function(_0x5ab72e){logger['error'](_0x7d95('0xd'),_0x11bb29,_0x5ab72e);_0x399d23(_0x5ab72e);});});}exports[_0x7d95('0x17')]=function(_0x7aded7){var _0x33a7ab=this;return new Promise(function(_0x57197c,_0x1c656c){return db[_0x7d95('0x18')]['create'](_0x7aded7[_0x7d95('0x19')],{'raw':_0x7aded7[_0x7d95('0x1a')]?_0x7aded7[_0x7d95('0x1a')][_0x7d95('0x1b')]===undefined?!![]:![]:!![]})[_0x7d95('0xc')](function(_0x1a058c){logger[_0x7d95('0x14')](_0x7d95('0x17'),_0x7aded7);logger[_0x7d95('0xf')]('CreateCmHopperHistory',_0x7aded7,JSON[_0x7d95('0x1c')](_0x1a058c));_0x57197c(_0x1a058c);})['catch'](function(_0x1e2b58){logger['error']('CreateCmHopperHistory',_0x1e2b58[_0x7d95('0x13')],_0x7aded7);_0x1c656c(_0x33a7ab[_0x7d95('0x11')](0x1f4,_0x1e2b58[_0x7d95('0x13')]));});});};exports['AvgHandleTime']=function(_0x2f54c4){var _0xd7d5=this;return new Promise(function(_0x49e92f,_0x1938a5){return db['CmHopperHistory']['findAll']({'raw':_0x2f54c4['options']?_0x2f54c4[_0x7d95('0x1a')][_0x7d95('0x1b')]===undefined?!![]:![]:!![],'where':_0x2f54c4['options']?_0x2f54c4[_0x7d95('0x1a')][_0x7d95('0x1d')]||null:null,'attributes':[[db[_0x7d95('0x1e')]['fn']('COUNT',db[_0x7d95('0x1e')][_0x7d95('0x1f')]('id')),_0x7d95('0x20')],[db['sequelize']['fn'](_0x7d95('0x21'),db['sequelize']['fn']('IF',db[_0x7d95('0x1e')][_0x7d95('0x22')](_0x7d95('0x23')))),_0x7d95('0x24')],[db[_0x7d95('0x1e')]['fn'](_0x7d95('0x21'),db[_0x7d95('0x1e')]['fn']('IF',db[_0x7d95('0x1e')]['literal'](_0x7d95('0x25')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x7d95('0x1e')]['fn']('COUNT',db[_0x7d95('0x1e')]['fn']('IF',db[_0x7d95('0x1e')][_0x7d95('0x22')](_0x7d95('0x26')))),_0x7d95('0x27')],[db[_0x7d95('0x1e')]['fn']('AVG',db[_0x7d95('0x1e')]['fn']('IF',db[_0x7d95('0x1e')][_0x7d95('0x22')](_0x7d95('0x28')))),_0x7d95('0x29')],[db[_0x7d95('0x1e')]['fn']('AVG',db[_0x7d95('0x1e')]['fn']('IF',db[_0x7d95('0x1e')]['literal']('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x7d95('0x2a')]]})[_0x7d95('0xc')](function(_0x53a458){logger[_0x7d95('0x14')](_0x7d95('0x2b'),_0x2f54c4);logger[_0x7d95('0xf')](_0x7d95('0x2b'),_0x2f54c4,JSON[_0x7d95('0x1c')](_0x53a458));_0x49e92f(_0x53a458);})[_0x7d95('0x16')](function(_0x1a58e0){logger['error'](_0x7d95('0x2b'),_0x1a58e0[_0x7d95('0x13')],_0x2f54c4);_0x1938a5(_0xd7d5[_0x7d95('0x11')](0x1f4,_0x1a58e0['message']));});});};exports[_0x7d95('0x2c')]=function(_0x247ff2){var _0x5a7dc1=this;return new Promise(function(_0x22735c,_0x283e74){return db[_0x7d95('0x18')][_0x7d95('0x2d')]({'raw':_0x247ff2['options']?_0x247ff2['options']['raw']===undefined?!![]:![]:!![],'where':_0x247ff2['options']?_0x247ff2['options']['where']||null:null,'attributes':[['campaign',_0x7d95('0x2e')],[db[_0x7d95('0x1e')]['fn'](_0x7d95('0x21'),db[_0x7d95('0x1e')]['fn']('IF',db[_0x7d95('0x1e')][_0x7d95('0x22')](_0x7d95('0x2f')))),_0x7d95('0x30')],[db[_0x7d95('0x1e')]['fn'](_0x7d95('0x21'),db['sequelize']['fn']('IF',db[_0x7d95('0x1e')][_0x7d95('0x22')](_0x7d95('0x31')))),_0x7d95('0x32')],[db[_0x7d95('0x1e')]['fn'](_0x7d95('0x21'),db[_0x7d95('0x1e')]['fn']('IF',db[_0x7d95('0x1e')]['literal'](_0x7d95('0x23')))),_0x7d95('0x33')],[db['sequelize']['fn'](_0x7d95('0x21'),db[_0x7d95('0x1e')]['fn']('IF',db['sequelize'][_0x7d95('0x22')]('`state`\x20=\x205,\x201,\x20null'))),'outboundBusyCallsDay'],[db[_0x7d95('0x1e')]['fn'](_0x7d95('0x21'),db[_0x7d95('0x1e')]['fn']('IF',db[_0x7d95('0x1e')][_0x7d95('0x22')](_0x7d95('0x34')))),_0x7d95('0x35')],[db[_0x7d95('0x1e')]['fn'](_0x7d95('0x21'),db['sequelize']['fn']('IF',db[_0x7d95('0x1e')]['literal'](_0x7d95('0x36')))),_0x7d95('0x37')],[db[_0x7d95('0x1e')]['fn'](_0x7d95('0x21'),db[_0x7d95('0x1e')]['fn']('IF',db[_0x7d95('0x1e')][_0x7d95('0x22')](_0x7d95('0x38')))),_0x7d95('0x39')],[db[_0x7d95('0x1e')]['fn']('COUNT',db[_0x7d95('0x1e')]['fn']('IF',db[_0x7d95('0x1e')][_0x7d95('0x22')](_0x7d95('0x3a')))),_0x7d95('0x3b')],[db[_0x7d95('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x7d95('0x1e')][_0x7d95('0x22')]('`state`\x20=\x2013,\x201,\x20null'))),_0x7d95('0x3c')],[db[_0x7d95('0x1e')]['fn']('COUNT',db[_0x7d95('0x1e')]['fn']('IF',db[_0x7d95('0x1e')][_0x7d95('0x22')](_0x7d95('0x3d')))),_0x7d95('0x3e')],[db[_0x7d95('0x1e')]['fn'](_0x7d95('0x21'),db[_0x7d95('0x1e')]['fn']('IF',db[_0x7d95('0x1e')]['literal'](_0x7d95('0x3f')))),'outboundRejectCallsDay'],[db[_0x7d95('0x1e')]['fn']('COUNT',db[_0x7d95('0x1e')]['fn']('IF',db[_0x7d95('0x1e')][_0x7d95('0x22')](_0x7d95('0x40')))),_0x7d95('0x41')],[db[_0x7d95('0x1e')]['fn'](_0x7d95('0x21'),db[_0x7d95('0x1e')]['fn']('IF',db[_0x7d95('0x1e')]['literal'](_0x7d95('0x42')))),_0x7d95('0x43')],[db[_0x7d95('0x1e')]['fn'](_0x7d95('0x21'),db[_0x7d95('0x1e')]['fn']('IF',db[_0x7d95('0x1e')][_0x7d95('0x22')](_0x7d95('0x44')))),_0x7d95('0x45')]],'group':[_0x7d95('0x46')]})[_0x7d95('0xc')](function(_0x2e927b){logger[_0x7d95('0x14')](_0x7d95('0x2c'),_0x247ff2);logger['debug'](_0x7d95('0x2c'),_0x247ff2,JSON[_0x7d95('0x1c')](_0x2e927b));_0x22735c(_0x2e927b);})[_0x7d95('0x16')](function(_0x3b0987){logger[_0x7d95('0x11')](_0x7d95('0x2c'),_0x3b0987[_0x7d95('0x13')],_0x247ff2);_0x283e74(_0x5a7dc1[_0x7d95('0x11')](0x1f4,_0x3b0987[_0x7d95('0x13')]));});});};exports[_0x7d95('0x47')]=function(_0x29b971){var _0x280247=this;return new Promise(function(_0x194b36,_0x1534e9){return db[_0x7d95('0x18')][_0x7d95('0x2d')]({'raw':_0x29b971['options']?_0x29b971['options'][_0x7d95('0x1b')]===undefined?!![]:![]:!![],'where':_0x29b971[_0x7d95('0x1a')]?_0x29b971[_0x7d95('0x1a')]['where']||null:null,'attributes':[[_0x7d95('0x46'),_0x7d95('0x2e')],[db[_0x7d95('0x1e')]['fn'](_0x7d95('0x21'),db[_0x7d95('0x1e')][_0x7d95('0x1f')]('id')),'ivrTotalCallsDays'],[db['sequelize']['fn'](_0x7d95('0x21'),db[_0x7d95('0x1e')]['fn']('IF',db[_0x7d95('0x1e')][_0x7d95('0x22')](_0x7d95('0x23')))),_0x7d95('0x48')]],'group':['campaign']})[_0x7d95('0xc')](function(_0x5fae0a){logger[_0x7d95('0x14')](_0x7d95('0x47'),_0x29b971);logger[_0x7d95('0xf')]('GetCampaignHopperHistory',_0x29b971,JSON[_0x7d95('0x1c')](_0x5fae0a));_0x194b36(_0x5fae0a);})[_0x7d95('0x16')](function(_0x3c1a6c){logger[_0x7d95('0x11')](_0x7d95('0x47'),_0x3c1a6c[_0x7d95('0x13')],_0x29b971);_0x1534e9(_0x280247[_0x7d95('0x11')](0x1f4,_0x3c1a6c[_0x7d95('0x13')]));});});};
\ No newline at end of file
index 41e2a9c..3e2ea37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb61a=['get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','exports','multer','util','path','express','Router','../../components/interaction/service'];(function(_0x5c22a5,_0x59266a){var _0x365a7e=function(_0x21f059){while(--_0x21f059){_0x5c22a5['push'](_0x5c22a5['shift']());}};_0x365a7e(++_0x59266a);}(_0xb61a,0x71));var _0xab61=function(_0x316300,_0x2ea07a){_0x316300=_0x316300-0x0;var _0x6d6e6=_0xb61a[_0x316300];return _0x6d6e6;};'use strict';var multer=require(_0xab61('0x0'));var util=require(_0xab61('0x1'));var path=require(_0xab61('0x2'));var timeout=require('connect-timeout');var express=require(_0xab61('0x3'));var router=express[_0xab61('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xab61('0x5'));var config=require('../../config/environment');var controller=require('./cmHopperHistory.controller');router[_0xab61('0x6')]('/',auth[_0xab61('0x7')](),controller[_0xab61('0x8')]);router[_0xab61('0x6')](_0xab61('0x9'),auth['isAuthenticated'](),controller[_0xab61('0xa')]);router[_0xab61('0x6')](_0xab61('0xb'),auth[_0xab61('0x7')](),controller[_0xab61('0xc')]);router[_0xab61('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xab61('0xe')](_0xab61('0xb'),auth[_0xab61('0x7')](),controller[_0xab61('0xf')]);module[_0xab61('0x10')]=router;
\ No newline at end of file
+var _0x3bb0=['multer','util','connect-timeout','Router','fs-extra','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','exports'];(function(_0x4f83ca,_0x46f67a){var _0x1fbac3=function(_0x19e401){while(--_0x19e401){_0x4f83ca['push'](_0x4f83ca['shift']());}};_0x1fbac3(++_0x46f67a);}(_0x3bb0,0x143));var _0x03bb=function(_0x59d271,_0x4ec708){_0x59d271=_0x59d271-0x0;var _0xd413f=_0x3bb0[_0x59d271];return _0xd413f;};'use strict';var multer=require(_0x03bb('0x0'));var util=require(_0x03bb('0x1'));var path=require('path');var timeout=require(_0x03bb('0x2'));var express=require('express');var router=express[_0x03bb('0x3')]();var fs_extra=require(_0x03bb('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x03bb('0x5'));var controller=require(_0x03bb('0x6'));router[_0x03bb('0x7')]('/',auth[_0x03bb('0x8')](),controller[_0x03bb('0x9')]);router[_0x03bb('0x7')](_0x03bb('0xa'),auth[_0x03bb('0x8')](),controller[_0x03bb('0xb')]);router[_0x03bb('0x7')](_0x03bb('0xc'),auth['isAuthenticated'](),controller[_0x03bb('0xd')]);router[_0x03bb('0xe')]('/',auth[_0x03bb('0x8')](),controller['create']);router[_0x03bb('0xf')](_0x03bb('0xc'),auth[_0x03bb('0x8')](),controller['update']);module[_0x03bb('0x10')]=router;
\ No newline at end of file
index fe4ec69..f3e14c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x861c=['exports','STRING','name','sequelize'];(function(_0x56fd30,_0x3df715){var _0x745b1=function(_0x230013){while(--_0x230013){_0x56fd30['push'](_0x56fd30['shift']());}};_0x745b1(++_0x3df715);}(_0x861c,0xdb));var _0xc861=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x861c[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xc861('0x0'));module[_0xc861('0x1')]={'name':{'type':Sequelize[_0xc861('0x2')],'unique':_0xc861('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc861('0x2')]},'dialPrefix':{'type':Sequelize[_0xc861('0x2')]}};
\ No newline at end of file
+var _0xd847=['STRING','name','sequelize','exports'];(function(_0x31ea15,_0x40f11c){var _0x317e97=function(_0x306770){while(--_0x306770){_0x31ea15['push'](_0x31ea15['shift']());}};_0x317e97(++_0x40f11c);}(_0xd847,0x18a));var _0x7d84=function(_0xaab1be,_0x1ffce6){_0xaab1be=_0xaab1be-0x0;var _0xd3a4e8=_0xd847[_0xaab1be];return _0xd3a4e8;};'use strict';var Sequelize=require(_0x7d84('0x0'));module[_0x7d84('0x1')]={'name':{'type':Sequelize[_0x7d84('0x2')],'unique':_0x7d84('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 40b8c43..458383e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc55=['omit','spread','emit','removeAgents','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','Lists','error','stack','name','index','map','CmList','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','findOne','removeDispositions','ids','CmContact','tags','isArray','push','each','success','dataValues','errors','message','Malformed\x20request\x20syntax','CustomFields','concat','format','cf_%d','nolimit','getContactsCsv','CmCustomField','raw','getContacts','now','writeFileSync','setHeader','attachment;\x20filename=','Content-type','text/csv','/tmp/list_%d_%s.csv','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','type','text','number','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cf_%s','findAndCountAll','addAgents'];(function(_0x5d4f12,_0x11e67c){var _0x4eb577=function(_0x4d7a2d){while(--_0x4d7a2d){_0x5d4f12['push'](_0x5d4f12['shift']());}};_0x4eb577(++_0x11e67c);}(_0xdc55,0x123));var _0x5dc5=function(_0x475d84,_0x106eab){_0x475d84=_0x475d84-0x0;var _0x304f4f=_0xdc55[_0x475d84];return _0x304f4f;};'use strict';var emlformat=require(_0x5dc5('0x0'));var rimraf=require(_0x5dc5('0x1'));var zipdir=require(_0x5dc5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5dc5('0x3'));var moment=require(_0x5dc5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5dc5('0x5'));var util=require(_0x5dc5('0x6'));var path=require('path');var sox=require(_0x5dc5('0x7'));var csv=require(_0x5dc5('0x8'));var ejs=require(_0x5dc5('0x9'));var fs=require('fs');var fs_extra=require(_0x5dc5('0xa'));var _=require(_0x5dc5('0xb'));var squel=require(_0x5dc5('0xc'));var crypto=require(_0x5dc5('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5dc5('0xe'));var toCsv=require(_0x5dc5('0x8'));var querystring=require(_0x5dc5('0xf'));var Papa=require(_0x5dc5('0x10'));var Redis=require('ioredis');var authService=require(_0x5dc5('0x11'));var qs=require(_0x5dc5('0x12'));var as=require(_0x5dc5('0x13'));var hardwareService=require(_0x5dc5('0x14'));var logger=require('../../config/logger')(_0x5dc5('0x15'));var utils=require(_0x5dc5('0x16'));var config=require(_0x5dc5('0x17'));var licenseUtil=require(_0x5dc5('0x18'));var db=require(_0x5dc5('0x19'))['db'];config[_0x5dc5('0x1a')]=_['defaults'](config[_0x5dc5('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x5dc5('0x1b'))(new Redis(config[_0x5dc5('0x1a')]));require(_0x5dc5('0x1c'))[_0x5dc5('0x1d')](socket);function respondWithStatusCode(_0x10cc22,_0x3f7383){_0x3f7383=_0x3f7383||0xcc;return function(_0x56263a){if(_0x56263a){return _0x10cc22[_0x5dc5('0x1e')](_0x3f7383);}return _0x10cc22[_0x5dc5('0x1f')](_0x3f7383)[_0x5dc5('0x20')]();};}function respondWithResult(_0x1dcd74,_0x3387d1){_0x3387d1=_0x3387d1||0xc8;return function(_0xe556f7){if(_0xe556f7){return _0x1dcd74[_0x5dc5('0x1f')](_0x3387d1)[_0x5dc5('0x21')](_0xe556f7);}};}function respondWithFilteredResult(_0x2adbd6,_0x1a0b9b){return function(_0x2ba489){if(_0x2ba489){var _0x431362=typeof _0x1a0b9b[_0x5dc5('0x22')]===_0x5dc5('0x23')&&typeof _0x1a0b9b[_0x5dc5('0x24')]===_0x5dc5('0x23');var _0x146711=_0x2ba489['count'];var _0x5b8b8b=_0x431362?0x0:_0x1a0b9b[_0x5dc5('0x22')];var _0xc4f2dd=_0x431362?_0x2ba489[_0x5dc5('0x25')]:_0x1a0b9b[_0x5dc5('0x22')]+_0x1a0b9b[_0x5dc5('0x24')];var _0x5b0ae6;if(_0xc4f2dd>=_0x146711){_0xc4f2dd=_0x146711;_0x5b0ae6=0xc8;}else{_0x5b0ae6=0xce;}_0x2adbd6[_0x5dc5('0x1f')](_0x5b0ae6);return _0x2adbd6[_0x5dc5('0x26')]('Content-Range',_0x5b8b8b+'-'+_0xc4f2dd+'/'+_0x146711)['json'](_0x2ba489);}return null;};}function patchUpdates(_0x315f0d){return function(_0x20564a){try{jsonpatch[_0x5dc5('0x27')](_0x20564a,_0x315f0d,!![]);}catch(_0x46133e){return BPromise['reject'](_0x46133e);}return _0x20564a[_0x5dc5('0x28')]();};}function saveUpdates(_0x22cb5d,_0x52c624){return function(_0x149d7f){if(_0x149d7f){return _0x149d7f[_0x5dc5('0x29')](_0x22cb5d)[_0x5dc5('0x2a')](function(_0x4504d3){return _0x4504d3;});}return null;};}function removeEntity(_0x41570b,_0x298050){return function(_0x4a9187){if(_0x4a9187){return _0x4a9187[_0x5dc5('0x2b')]()[_0x5dc5('0x2a')](function(){var _0x5236d7=_0x4a9187[_0x5dc5('0x2c')]({'plain':!![]});var _0x253d29=_0x5dc5('0x2d');return db['UserProfileResource']['destroy']({'where':{'type':_0x253d29,'resourceId':_0x5236d7['id']}})[_0x5dc5('0x2a')](function(){return _0x4a9187;});})[_0x5dc5('0x2a')](function(){_0x41570b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d4ce1,_0x422371){return function(_0x123e9b){if(!_0x123e9b){_0x5d4ce1[_0x5dc5('0x1e')](0x194);}return _0x123e9b;};}function handleError(_0x3f5e63,_0xae2490){_0xae2490=_0xae2490||0x1f4;return function(_0x1b5196){logger[_0x5dc5('0x2e')](_0x1b5196[_0x5dc5('0x2f')]);if(_0x1b5196[_0x5dc5('0x30')]){delete _0x1b5196[_0x5dc5('0x30')];}_0x3f5e63[_0x5dc5('0x1f')](_0xae2490)['send'](_0x1b5196);};}exports[_0x5dc5('0x31')]=function(_0x4256ee,_0xb25c93){var _0x4c7c7f={},_0x35f6a1={},_0x41eda0={'count':0x0,'rows':[]};var _0x1dae41=_[_0x5dc5('0x32')](db[_0x5dc5('0x33')]['rawAttributes'],function(_0x370921){return{'name':_0x370921['fieldName'],'type':_0x370921['type'][_0x5dc5('0x34')]};});_0x35f6a1[_0x5dc5('0x35')]=_['map'](_0x1dae41,_0x5dc5('0x30'));_0x35f6a1[_0x5dc5('0x36')]=_[_0x5dc5('0x37')](_0x4256ee[_0x5dc5('0x36')]);_0x35f6a1[_0x5dc5('0x38')]=_['intersection'](_0x35f6a1[_0x5dc5('0x35')],_0x35f6a1[_0x5dc5('0x36')]);_0x4c7c7f[_0x5dc5('0x39')]=_[_0x5dc5('0x3a')](_0x35f6a1[_0x5dc5('0x35')],qs[_0x5dc5('0x3b')](_0x4256ee[_0x5dc5('0x36')][_0x5dc5('0x3b')]));_0x4c7c7f[_0x5dc5('0x39')]=_0x4c7c7f[_0x5dc5('0x39')][_0x5dc5('0x3c')]?_0x4c7c7f[_0x5dc5('0x39')]:_0x35f6a1['model'];if(!_0x4256ee[_0x5dc5('0x36')][_0x5dc5('0x3d')]('nolimit')){_0x4c7c7f[_0x5dc5('0x24')]=qs[_0x5dc5('0x24')](_0x4256ee['query'][_0x5dc5('0x24')]);_0x4c7c7f[_0x5dc5('0x22')]=qs[_0x5dc5('0x22')](_0x4256ee['query'][_0x5dc5('0x22')]);}_0x4c7c7f[_0x5dc5('0x3e')]=qs['sort'](_0x4256ee[_0x5dc5('0x36')][_0x5dc5('0x3f')]);_0x4c7c7f['where']=qs[_0x5dc5('0x38')](_[_0x5dc5('0x40')](_0x4256ee[_0x5dc5('0x36')],_0x35f6a1['filters']),_0x1dae41);if(_0x4256ee['query'][_0x5dc5('0x41')]){_0x4c7c7f[_0x5dc5('0x42')]=_[_0x5dc5('0x43')](_0x4c7c7f['where'],{'$or':_[_0x5dc5('0x32')](_0x1dae41,function(_0x59cacc){if(_0x59cacc['type']!==_0x5dc5('0x44')){var _0x1e545a={};_0x1e545a[_0x59cacc[_0x5dc5('0x30')]]={'$like':'%'+_0x4256ee[_0x5dc5('0x36')]['filter']+'%'};return _0x1e545a;}})});}_0x4c7c7f=_[_0x5dc5('0x43')]({},_0x4c7c7f,_0x4256ee[_0x5dc5('0x45')]);var _0x591ee2={'where':_0x4c7c7f['where']};return db[_0x5dc5('0x33')][_0x5dc5('0x25')](_0x591ee2)[_0x5dc5('0x2a')](function(_0x4bda32){_0x41eda0[_0x5dc5('0x25')]=_0x4bda32;if(_0x4256ee[_0x5dc5('0x36')][_0x5dc5('0x46')]){_0x4c7c7f[_0x5dc5('0x47')]=[{'all':!![]}];}return db['CmList'][_0x5dc5('0x48')](_0x4c7c7f);})[_0x5dc5('0x2a')](function(_0x1c3a63){_0x41eda0[_0x5dc5('0x49')]=_0x1c3a63;return _0x41eda0;})[_0x5dc5('0x2a')](respondWithFilteredResult(_0xb25c93,_0x4c7c7f))[_0x5dc5('0x4a')](handleError(_0xb25c93,null));};exports['show']=function(_0xd5f20c,_0x2b718e){var _0x281f90={'raw':![],'where':{'id':_0xd5f20c[_0x5dc5('0x4b')]['id']}},_0x37b0ae={};_0x37b0ae[_0x5dc5('0x35')]=_[_0x5dc5('0x37')](db[_0x5dc5('0x33')][_0x5dc5('0x4c')]);_0x37b0ae[_0x5dc5('0x36')]=_['keys'](_0xd5f20c[_0x5dc5('0x36')]);_0x37b0ae[_0x5dc5('0x38')]=_[_0x5dc5('0x3a')](_0x37b0ae[_0x5dc5('0x35')],_0x37b0ae['query']);_0x281f90[_0x5dc5('0x39')]=_[_0x5dc5('0x3a')](_0x37b0ae[_0x5dc5('0x35')],qs[_0x5dc5('0x3b')](_0xd5f20c['query']['fields']));_0x281f90[_0x5dc5('0x39')]=_0x281f90['attributes'][_0x5dc5('0x3c')]?_0x281f90['attributes']:_0x37b0ae[_0x5dc5('0x35')];if(_0xd5f20c[_0x5dc5('0x36')]['includeAll']){_0x281f90['include']=[{'all':!![]}];}_0x281f90=_[_0x5dc5('0x43')]({},_0x281f90,_0xd5f20c[_0x5dc5('0x45')]);return db[_0x5dc5('0x33')][_0x5dc5('0x4d')](_0x281f90)[_0x5dc5('0x2a')](handleEntityNotFound(_0x2b718e,null))[_0x5dc5('0x2a')](respondWithResult(_0x2b718e,null))['catch'](handleError(_0x2b718e,null));};exports[_0x5dc5('0x4e')]=function(_0x269b72,_0x1542db){return db[_0x5dc5('0x33')][_0x5dc5('0x4e')](_0x269b72[_0x5dc5('0x4f')],{})[_0x5dc5('0x2a')](function(_0x3a0195){var _0x86e36c=_0x269b72[_0x5dc5('0x50')][_0x5dc5('0x2c')]({'plain':!![]});if(!_0x86e36c)throw new Error(_0x5dc5('0x51'));if(_0x86e36c['role']===_0x5dc5('0x50')){var _0x54729e=_0x3a0195[_0x5dc5('0x2c')]({'plain':!![]});var _0x426f52=_0x5dc5('0x2d');return db['UserProfileSection'][_0x5dc5('0x4d')]({'where':{'name':_0x426f52,'userProfileId':_0x86e36c[_0x5dc5('0x52')]},'raw':!![]})[_0x5dc5('0x2a')](function(_0x5c7bcf){if(_0x5c7bcf&&_0x5c7bcf['autoAssociation']===0x0){return db[_0x5dc5('0x53')]['create']({'name':_0x54729e[_0x5dc5('0x30')],'resourceId':_0x54729e['id'],'type':_0x5c7bcf[_0x5dc5('0x30')],'sectionId':_0x5c7bcf['id']},{})[_0x5dc5('0x2a')](function(){return _0x3a0195;});}else{return _0x3a0195;}})[_0x5dc5('0x4a')](function(_0x56cc70){logger['error'](_0x5dc5('0x54'),_0x56cc70);throw _0x56cc70;});}return _0x3a0195;})[_0x5dc5('0x2a')](respondWithResult(_0x1542db,0xc9))[_0x5dc5('0x4a')](handleError(_0x1542db,null));};exports['update']=function(_0x143f4c,_0x31aedd){if(_0x143f4c[_0x5dc5('0x4f')]['id']){delete _0x143f4c[_0x5dc5('0x4f')]['id'];}return db[_0x5dc5('0x33')]['find']({'where':{'id':_0x143f4c[_0x5dc5('0x4b')]['id']}})[_0x5dc5('0x2a')](handleEntityNotFound(_0x31aedd,null))[_0x5dc5('0x2a')](saveUpdates(_0x143f4c[_0x5dc5('0x4f')],null))[_0x5dc5('0x2a')](respondWithResult(_0x31aedd,null))[_0x5dc5('0x4a')](handleError(_0x31aedd,null));};exports[_0x5dc5('0x2b')]=function(_0x11332e,_0x36ca75){return db[_0x5dc5('0x33')][_0x5dc5('0x4d')]({'where':{'id':_0x11332e[_0x5dc5('0x4b')]['id']}})[_0x5dc5('0x2a')](handleEntityNotFound(_0x36ca75,null))[_0x5dc5('0x2a')](removeEntity(_0x36ca75,null))[_0x5dc5('0x4a')](handleError(_0x36ca75,null));};exports[_0x5dc5('0x55')]=function(_0x34ded0,_0x536ad5){return db[_0x5dc5('0x33')][_0x5dc5('0x55')]()[_0x5dc5('0x2a')](respondWithResult(_0x536ad5,null))[_0x5dc5('0x4a')](handleError(_0x536ad5,null));};exports[_0x5dc5('0x56')]=function(_0x2f86c6,_0x550d0c,_0x3ea116){if(_0x2f86c6['body']['id']){delete _0x2f86c6[_0x5dc5('0x4f')]['id'];}return db[_0x5dc5('0x33')][_0x5dc5('0x4d')]({'where':{'id':_0x2f86c6[_0x5dc5('0x4b')]['id']}})[_0x5dc5('0x2a')](handleEntityNotFound(_0x550d0c,null))[_0x5dc5('0x2a')](function(_0x395d8e){if(_0x395d8e){_0x2f86c6[_0x5dc5('0x4f')][_0x5dc5('0x57')]=_0x395d8e['id'];return db[_0x5dc5('0x58')][_0x5dc5('0x4e')](_0x2f86c6[_0x5dc5('0x4f')]);}})[_0x5dc5('0x2a')](respondWithResult(_0x550d0c,null))[_0x5dc5('0x4a')](handleError(_0x550d0c,null));};exports['getDispositions']=function(_0x1b3ccf,_0x3f9fdb,_0x327c0f){var _0x23bf78={'raw':![],'where':{}};var _0x4694e3={};var _0x404f1e={'count':0x0,'rows':[]};return db[_0x5dc5('0x33')][_0x5dc5('0x59')]({'where':{'id':_0x1b3ccf[_0x5dc5('0x4b')]['id']}})[_0x5dc5('0x2a')](handleEntityNotFound(_0x3f9fdb,null))[_0x5dc5('0x2a')](function(_0x1e8e1a){if(_0x1e8e1a){_0x4694e3[_0x5dc5('0x35')]=_[_0x5dc5('0x37')](db[_0x5dc5('0x58')][_0x5dc5('0x4c')]);_0x4694e3[_0x5dc5('0x36')]=_['keys'](_0x1b3ccf[_0x5dc5('0x36')]);_0x4694e3['filters']=_[_0x5dc5('0x3a')](_0x4694e3[_0x5dc5('0x35')],_0x4694e3[_0x5dc5('0x36')]);_0x23bf78[_0x5dc5('0x39')]=_[_0x5dc5('0x3a')](_0x4694e3[_0x5dc5('0x35')],qs['fields'](_0x1b3ccf['query'][_0x5dc5('0x3b')]));_0x23bf78[_0x5dc5('0x39')]=_0x23bf78[_0x5dc5('0x39')]['length']?_0x23bf78['attributes']:_0x4694e3[_0x5dc5('0x35')];if(!_0x1b3ccf['query'][_0x5dc5('0x3d')]('nolimit')){_0x23bf78[_0x5dc5('0x24')]=qs[_0x5dc5('0x24')](_0x1b3ccf[_0x5dc5('0x36')][_0x5dc5('0x24')]);_0x23bf78[_0x5dc5('0x22')]=qs['offset'](_0x1b3ccf[_0x5dc5('0x36')][_0x5dc5('0x22')]);}_0x23bf78[_0x5dc5('0x3e')]=qs['sort'](_0x1b3ccf['query'][_0x5dc5('0x3f')]);_0x23bf78[_0x5dc5('0x42')]=qs[_0x5dc5('0x38')](_['pick'](_0x1b3ccf[_0x5dc5('0x36')],_0x4694e3[_0x5dc5('0x38')]));_0x23bf78[_0x5dc5('0x42')][_0x5dc5('0x57')]=_0x1e8e1a['id'];if(_0x1b3ccf[_0x5dc5('0x36')][_0x5dc5('0x41')]){_0x23bf78[_0x5dc5('0x42')]=_[_0x5dc5('0x43')](_0x23bf78[_0x5dc5('0x42')],{'$or':_['map'](_0x23bf78['attributes'],function(_0x4b01cc){var _0x5df7f0={};_0x5df7f0[_0x4b01cc]={'$like':'%'+_0x1b3ccf[_0x5dc5('0x36')][_0x5dc5('0x41')]+'%'};return _0x5df7f0;})});}_0x23bf78=_['merge']({},_0x23bf78,_0x1b3ccf[_0x5dc5('0x45')]);return db[_0x5dc5('0x58')][_0x5dc5('0x25')]({'where':_0x23bf78[_0x5dc5('0x42')]})[_0x5dc5('0x2a')](function(_0x4851ee){_0x404f1e['count']=_0x4851ee;if(_0x1b3ccf[_0x5dc5('0x36')][_0x5dc5('0x46')]){_0x23bf78[_0x5dc5('0x47')]=[{'all':!![]}];}return db[_0x5dc5('0x58')][_0x5dc5('0x48')](_0x23bf78);})[_0x5dc5('0x2a')](function(_0x361ab1){_0x404f1e['rows']=_0x361ab1;return _0x404f1e;});}})[_0x5dc5('0x2a')](respondWithFilteredResult(_0x3f9fdb,_0x23bf78))['catch'](handleError(_0x3f9fdb,null));};exports[_0x5dc5('0x5a')]=function(_0x53ac06,_0x55530a,_0x41cf1f){return db['CmList'][_0x5dc5('0x4d')]({'where':{'id':_0x53ac06[_0x5dc5('0x4b')]['id']}})[_0x5dc5('0x2a')](handleEntityNotFound(_0x55530a,null))['then'](function(_0x4a5c53){if(_0x4a5c53){return _0x4a5c53[_0x5dc5('0x5a')](_0x53ac06['query'][_0x5dc5('0x5b')]);}})[_0x5dc5('0x2a')](respondWithStatusCode(_0x55530a,null))[_0x5dc5('0x4a')](handleError(_0x55530a,null));};exports['addContacts']=function(_0x2a6e47,_0x45a967,_0x3c64b6){return db[_0x5dc5('0x33')]['find']({'where':{'id':_0x2a6e47[_0x5dc5('0x4b')]['id']}})[_0x5dc5('0x2a')](handleEntityNotFound(_0x45a967,null))[_0x5dc5('0x2a')](function(_0x47332f){if(_0x47332f){var _0x24de25=[];var _0x32ea03={'success':[],'errors':[]};return db[_0x5dc5('0x5c')][_0x5dc5('0x55')]()[_0x5dc5('0x2a')](function(_0x1c0aff){if(_0x2a6e47[_0x5dc5('0x4f')][_0x5dc5('0x5d')]&&_['isArray'](_0x2a6e47[_0x5dc5('0x4f')][_0x5dc5('0x5d')])){if(_0x2a6e47['body'][_0x5dc5('0x5d')][_0x5dc5('0x3c')]){_0x2a6e47[_0x5dc5('0x4f')][_0x5dc5('0x5d')]=_0x2a6e47['body'][_0x5dc5('0x5d')]['join'](';')+';';}else{_0x2a6e47[_0x5dc5('0x4f')][_0x5dc5('0x5d')]=null;}}else{_0x2a6e47['body']['tags']=null;}if(_0x2a6e47['body']&&_[_0x5dc5('0x5e')](_0x2a6e47[_0x5dc5('0x4f')])){for(var _0x1fa0c8=0x0;_0x1fa0c8<_0x2a6e47[_0x5dc5('0x4f')][_0x5dc5('0x3c')];_0x1fa0c8+=0x1){_0x2a6e47['body'][_0x1fa0c8][_0x5dc5('0x57')]=_0x2a6e47[_0x5dc5('0x4b')]['id'];_0x24de25[_0x5dc5('0x5f')](_0x2a6e47[_0x5dc5('0x4f')][_0x1fa0c8]);}return BPromise[_0x5dc5('0x60')](_0x24de25,function(_0x3e4261){return db[_0x5dc5('0x5c')][_0x5dc5('0x4e')](_['omit'](_0x3e4261,[_0x5dc5('0x5b'),'id'])||{},{'fields':_[_0x5dc5('0x37')](_0x1c0aff),'raw':!![]})[_0x5dc5('0x2a')](function(_0x35ec12){_0x32ea03[_0x5dc5('0x61')][_0x5dc5('0x5f')](_0x35ec12[_0x5dc5('0x62')]);})[_0x5dc5('0x4a')](function(_0x23a99e){_0x32ea03[_0x5dc5('0x63')][_0x5dc5('0x5f')]({'data':_0x3e4261,'error':_0x23a99e[_0x5dc5('0x64')]});});})[_0x5dc5('0x2a')](function(_0x51ee58){return _0x32ea03;})[_0x5dc5('0x4a')](function(_0x2dfed9){return _0x2dfed9;});}else{_0x45a967[_0x5dc5('0x1f')](0x190)[_0x5dc5('0x21')]({'message':_0x5dc5('0x65')});}});}})[_0x5dc5('0x2a')](respondWithResult(_0x45a967,null))[_0x5dc5('0x4a')](handleError(_0x45a967,null));};exports['getContacts']=function(_0x4aafc7,_0x5735dc,_0x574457){var _0x4070b0;return db[_0x5dc5('0x33')][_0x5dc5('0x4d')]({'where':{'id':_0x4aafc7[_0x5dc5('0x4b')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x5dc5('0x66')}]})[_0x5dc5('0x2a')](handleEntityNotFound(_0x5735dc,null))['then'](function(_0x5ebc93){if(_0x5ebc93){_0x4070b0=_0x5ebc93;return db['CmContact']['rawAttributes'];}})[_0x5dc5('0x2a')](function(_0x5c596c){if(_0x5c596c){var _0x188ead={};var _0x2574a6={};_0x2574a6['model']=_[_0x5dc5('0x67')](_[_0x5dc5('0x37')](_0x5c596c),_['map'](_0x4070b0[_0x5dc5('0x66')],function(_0x3b815c){return util[_0x5dc5('0x68')](_0x5dc5('0x69'),_0x3b815c['id']);}));_0x2574a6[_0x5dc5('0x36')]=_[_0x5dc5('0x37')](_0x4aafc7[_0x5dc5('0x36')]);_0x2574a6['filters']=_['intersection'](_0x2574a6['model'],_0x2574a6[_0x5dc5('0x36')]);_0x188ead['attributes']=_[_0x5dc5('0x3a')](_0x2574a6[_0x5dc5('0x35')],qs[_0x5dc5('0x3b')](_0x4aafc7[_0x5dc5('0x36')][_0x5dc5('0x3b')]));_0x188ead[_0x5dc5('0x39')]=_0x188ead[_0x5dc5('0x39')][_0x5dc5('0x3c')]?_0x188ead[_0x5dc5('0x39')]:_0x2574a6[_0x5dc5('0x35')];if(!_0x4aafc7['query']['hasOwnProperty'](_0x5dc5('0x6a'))){_0x188ead[_0x5dc5('0x24')]=qs['limit'](_0x4aafc7['query'][_0x5dc5('0x24')]);_0x188ead['offset']=qs['offset'](_0x4aafc7['query'][_0x5dc5('0x22')]);}_0x188ead[_0x5dc5('0x3e')]=qs[_0x5dc5('0x3f')](_0x4aafc7['query'][_0x5dc5('0x3f')]);_0x188ead[_0x5dc5('0x42')]=qs[_0x5dc5('0x38')](_['pick'](_0x4aafc7[_0x5dc5('0x36')],_0x2574a6[_0x5dc5('0x38')]));_0x188ead['raw']=!![];if(_0x4aafc7['query']['filter']){_0x188ead[_0x5dc5('0x42')]=_[_0x5dc5('0x43')](_0x188ead[_0x5dc5('0x42')],{'$or':_[_0x5dc5('0x32')](_0x188ead[_0x5dc5('0x39')],function(_0x5d59fc){var _0x2f30af={};_0x2f30af[_0x5d59fc]={'$like':'%'+_0x4aafc7[_0x5dc5('0x36')][_0x5dc5('0x41')]+'%'};return _0x2f30af;})});}_0x188ead=_[_0x5dc5('0x43')]({},_0x188ead,_0x4aafc7[_0x5dc5('0x45')]);return _0x4070b0['getContacts'](_0x188ead);}})[_0x5dc5('0x2a')](respondWithResult(_0x5735dc,null))[_0x5dc5('0x4a')](handleError(_0x5735dc,null));};exports[_0x5dc5('0x6b')]=function(_0x4dd445,_0xccf344,_0x43eb2f){var _0x78f036;return db[_0x5dc5('0x33')][_0x5dc5('0x4d')]({'where':{'id':_0x4dd445[_0x5dc5('0x4b')]['id']},'include':[{'model':db[_0x5dc5('0x6c')],'as':_0x5dc5('0x66')}]})[_0x5dc5('0x2a')](handleEntityNotFound(_0xccf344,null))['then'](function(_0x353066){if(_0x353066){_0x78f036=_0x353066;return db[_0x5dc5('0x5c')]['rawAttributes'];}})[_0x5dc5('0x2a')](function(_0x460d90){if(_0x460d90){var _0x5c3813={};var _0x1a0f6a={};_0x1a0f6a[_0x5dc5('0x35')]=_['concat'](_[_0x5dc5('0x37')](_0x460d90),_[_0x5dc5('0x32')](_0x78f036[_0x5dc5('0x66')],function(_0x4dc011){return util[_0x5dc5('0x68')](_0x5dc5('0x69'),_0x4dc011['id']);}));_0x1a0f6a['query']=_[_0x5dc5('0x37')](_0x4dd445[_0x5dc5('0x36')]);_0x1a0f6a[_0x5dc5('0x38')]=_[_0x5dc5('0x3a')](_0x1a0f6a[_0x5dc5('0x35')],_0x1a0f6a[_0x5dc5('0x36')]);_0x5c3813['attributes']=_[_0x5dc5('0x3a')](_0x1a0f6a[_0x5dc5('0x35')],qs[_0x5dc5('0x3b')](_0x4dd445[_0x5dc5('0x36')][_0x5dc5('0x3b')]));_0x5c3813['attributes']=_0x5c3813[_0x5dc5('0x39')]['length']?_0x5c3813[_0x5dc5('0x39')]:_0x1a0f6a[_0x5dc5('0x35')];if(!_0x4dd445['query'][_0x5dc5('0x3d')](_0x5dc5('0x6a'))){_0x5c3813[_0x5dc5('0x24')]=qs['limit'](_0x4dd445['query']['limit']);_0x5c3813['offset']=qs[_0x5dc5('0x22')](_0x4dd445[_0x5dc5('0x36')][_0x5dc5('0x22')]);}_0x5c3813[_0x5dc5('0x3e')]=qs[_0x5dc5('0x3f')](_0x4dd445[_0x5dc5('0x36')][_0x5dc5('0x3f')]);_0x5c3813['where']=qs[_0x5dc5('0x38')](_[_0x5dc5('0x40')](_0x4dd445[_0x5dc5('0x36')],_0x1a0f6a[_0x5dc5('0x38')]));_0x5c3813[_0x5dc5('0x6d')]=!![];if(_0x4dd445[_0x5dc5('0x36')][_0x5dc5('0x41')]){_0x5c3813['where']=_['merge'](_0x5c3813[_0x5dc5('0x42')],{'$or':_['map'](_0x5c3813[_0x5dc5('0x39')],function(_0x480d66){var _0x47b974={};_0x47b974[_0x480d66]={'$like':'%'+_0x4dd445['query'][_0x5dc5('0x41')]+'%'};return _0x47b974;})});}_0x5c3813=_['merge']({},_0x5c3813,_0x4dd445[_0x5dc5('0x45')]);return _0x78f036[_0x5dc5('0x6e')](_0x5c3813);}})['then'](function(_0x4ab455){if(!_['isEmpty'](_0x4ab455)){var _0x129a6f=toCsv(_0x4ab455);var _0x3ef645=Date[_0x5dc5('0x6f')]();fs[_0x5dc5('0x70')](util[_0x5dc5('0x68')]('/tmp/list_%d_%s.csv',_0x78f036['id'],_0x3ef645),_0x129a6f);_0xccf344[_0x5dc5('0x71')]('Content-disposition',_0x5dc5('0x72')+util[_0x5dc5('0x68')]('list_%d_%s.csv',_0x78f036['id'],_0x3ef645));_0xccf344[_0x5dc5('0x71')](_0x5dc5('0x73'),_0x5dc5('0x74'));return _0xccf344['download'](util[_0x5dc5('0x68')](_0x5dc5('0x75'),_0x78f036['id'],_0x3ef645));}else{return _0xccf344[_0x5dc5('0x1e')](0xcc);}})['catch'](handleError(_0xccf344,null));};exports[_0x5dc5('0x76')]=function(_0xb115d6,_0x3e2a1c,_0x1fd598){var _0xf4b66c;delete _0xb115d6[_0x5dc5('0x4f')]['id'];return db['CmList'][_0x5dc5('0x59')]({'where':{'id':_0xb115d6[_0x5dc5('0x4b')]['id']}})[_0x5dc5('0x2a')](handleEntityNotFound(_0x3e2a1c,null))[_0x5dc5('0x2a')](function(_0x5369f3){if(_0x5369f3){return db[_0x5dc5('0x77')][_0x5dc5('0x78')](function(_0x8c604c){return db[_0x5dc5('0x6c')][_0x5dc5('0x4e')](_0xb115d6[_0x5dc5('0x4f')],{'transaction':_0x8c604c})[_0x5dc5('0x2a')](function(_0x1307f7){_0xf4b66c=_0x1307f7;return _0x5369f3[_0x5dc5('0x79')](_0x1307f7,{'transaction':_0x8c604c});})[_0x5dc5('0x2a')](function(){var _0x52fde7={'type':db[_0x5dc5('0x7a')][_0x5dc5('0x7b')],'transaction':_0x8c604c};switch(_0xb115d6[_0x5dc5('0x4f')][_0x5dc5('0x7c')]){case _0x5dc5('0x7d'):_0x52fde7['type']=db[_0x5dc5('0x7a')]['TEXT'];break;case _0x5dc5('0x7e'):_0x52fde7[_0x5dc5('0x7c')]=db['Sequelize'][_0x5dc5('0x7f')];break;case _0x5dc5('0x80'):_0x52fde7['type']=db[_0x5dc5('0x7a')][_0x5dc5('0x81')];_0x52fde7[_0x5dc5('0x82')]=![];break;default:}return db[_0x5dc5('0x77')]['queryInterface'][_0x5dc5('0x83')]('cm_contacts',util[_0x5dc5('0x68')](_0x5dc5('0x84'),_0xf4b66c['id']),_0x52fde7);})[_0x5dc5('0x2a')](function(){return _0xf4b66c;});});}})[_0x5dc5('0x2a')](respondWithResult(_0x3e2a1c,null))['catch'](handleError(_0x3e2a1c,null));};exports['getCustomFields']=function(_0x7a5b64,_0x48c65f,_0x7e888b){var _0x2925f5={};var _0x27fe42={};var _0x59a2ba;var _0x58d8b4;return db[_0x5dc5('0x33')][_0x5dc5('0x59')]({'where':{'id':_0x7a5b64['params']['id']}})['then'](handleEntityNotFound(_0x48c65f,null))[_0x5dc5('0x2a')](function(_0x3985cf){if(_0x3985cf){_0x59a2ba=_0x3985cf;_0x27fe42[_0x5dc5('0x35')]=_['keys'](db[_0x5dc5('0x6c')][_0x5dc5('0x4c')]);_0x27fe42['query']=_[_0x5dc5('0x37')](_0x7a5b64[_0x5dc5('0x36')]);_0x27fe42[_0x5dc5('0x38')]=_[_0x5dc5('0x3a')](_0x27fe42[_0x5dc5('0x35')],_0x27fe42[_0x5dc5('0x36')]);_0x2925f5['attributes']=_[_0x5dc5('0x3a')](_0x27fe42[_0x5dc5('0x35')],qs[_0x5dc5('0x3b')](_0x7a5b64[_0x5dc5('0x36')][_0x5dc5('0x3b')]));_0x2925f5['attributes']=_0x2925f5['attributes'][_0x5dc5('0x3c')]?_0x2925f5[_0x5dc5('0x39')]:_0x27fe42[_0x5dc5('0x35')];_0x2925f5['order']=qs['sort'](_0x7a5b64['query'][_0x5dc5('0x3f')]);_0x2925f5[_0x5dc5('0x42')]=qs[_0x5dc5('0x38')](_[_0x5dc5('0x40')](_0x7a5b64['query'],_0x27fe42[_0x5dc5('0x38')]));_0x2925f5[_0x5dc5('0x42')]=_[_0x5dc5('0x43')](_0x2925f5[_0x5dc5('0x42')],{'$or':[{'ListId':_0x3985cf['id']},{'ListId':null}]});if(_0x7a5b64[_0x5dc5('0x36')][_0x5dc5('0x41')]){_0x2925f5['where']=_[_0x5dc5('0x43')](_0x2925f5[_0x5dc5('0x42')],{'$or':_[_0x5dc5('0x32')](_0x2925f5[_0x5dc5('0x39')],function(_0x3350af){var _0x17a6a4={};_0x17a6a4[_0x3350af]={'$like':'%'+_0x7a5b64[_0x5dc5('0x36')][_0x5dc5('0x41')]+'%'};return _0x17a6a4;})});}_0x2925f5=_[_0x5dc5('0x43')]({},_0x2925f5,_0x7a5b64['options']);return db[_0x5dc5('0x6c')][_0x5dc5('0x85')](_0x2925f5);}})['then'](respondWithResult(_0x48c65f,null))[_0x5dc5('0x4a')](handleError(_0x48c65f,null));};exports[_0x5dc5('0x86')]=function(_0x5da792,_0x549e45,_0x99ed69){return db[_0x5dc5('0x33')][_0x5dc5('0x4d')]({'where':{'id':_0x5da792['params']['id']}})[_0x5dc5('0x2a')](handleEntityNotFound(_0x549e45,null))[_0x5dc5('0x2a')](function(_0x3b8c2b){if(_0x3b8c2b){return _0x3b8c2b['addAgents'](_0x5da792['body'][_0x5dc5('0x5b')],_[_0x5dc5('0x87')](_0x5da792['body'],['ids','id'])||{})[_0x5dc5('0x88')](function(_0x169363){for(var _0x856c6b=0x0;_0x856c6b<_0x5da792[_0x5dc5('0x4f')]['ids']['length'];_0x856c6b+=0x1){socket[_0x5dc5('0x89')]('userCmList:save',{'UserId':Number(_0x5da792[_0x5dc5('0x4f')]['ids'][_0x856c6b]),'CmListId':Number(_0x5da792[_0x5dc5('0x4b')]['id'])});}return _0x169363;});}})[_0x5dc5('0x2a')](respondWithResult(_0x549e45,null))[_0x5dc5('0x4a')](handleError(_0x549e45,null));};exports[_0x5dc5('0x8a')]=function(_0x1cbb57,_0x58868a,_0x16105e){return db['CmList'][_0x5dc5('0x4d')]({'where':{'id':_0x1cbb57[_0x5dc5('0x4b')]['id']}})[_0x5dc5('0x2a')](handleEntityNotFound(_0x58868a,null))[_0x5dc5('0x2a')](function(_0x7e614c){if(_0x7e614c){return _0x7e614c[_0x5dc5('0x8a')](_0x1cbb57[_0x5dc5('0x36')][_0x5dc5('0x5b')])[_0x5dc5('0x2a')](function(){if(_[_0x5dc5('0x5e')](_0x1cbb57[_0x5dc5('0x36')]['ids'])){for(var _0x2c6388=0x0;_0x2c6388<_0x1cbb57[_0x5dc5('0x36')][_0x5dc5('0x5b')][_0x5dc5('0x3c')];_0x2c6388+=0x1){socket[_0x5dc5('0x89')](_0x5dc5('0x8b'),{'UserId':Number(_0x1cbb57[_0x5dc5('0x36')][_0x5dc5('0x5b')][_0x2c6388]),'CmListId':Number(_0x1cbb57[_0x5dc5('0x4b')]['id'])});}}else{socket['emit']('userCmList:remove',{'UserId':Number(_0x1cbb57[_0x5dc5('0x36')][_0x5dc5('0x5b')]),'CmListId':Number(_0x1cbb57[_0x5dc5('0x4b')]['id'])});}});}})[_0x5dc5('0x2a')](respondWithStatusCode(_0x58868a,null))['catch'](handleError(_0x58868a,null));};exports[_0x5dc5('0x8c')]=function(_0x1c55c1,_0x151303,_0x4a80fb){var _0x440d99={};var _0x97c6a7={};var _0x37e53a;var _0x2951a2;return db[_0x5dc5('0x33')][_0x5dc5('0x59')]({'where':{'id':_0x1c55c1[_0x5dc5('0x4b')]['id']}})[_0x5dc5('0x2a')](handleEntityNotFound(_0x151303,null))['then'](function(_0x48288a){if(_0x48288a){_0x37e53a=_0x48288a;_0x97c6a7[_0x5dc5('0x35')]=_['keys'](db[_0x5dc5('0x8d')][_0x5dc5('0x4c')]);_0x97c6a7[_0x5dc5('0x36')]=_[_0x5dc5('0x37')](_0x1c55c1['query']);_0x97c6a7[_0x5dc5('0x38')]=_[_0x5dc5('0x3a')](_0x97c6a7[_0x5dc5('0x35')],_0x97c6a7['query']);_0x440d99[_0x5dc5('0x39')]=_[_0x5dc5('0x3a')](_0x97c6a7[_0x5dc5('0x35')],qs[_0x5dc5('0x3b')](_0x1c55c1[_0x5dc5('0x36')]['fields']));_0x440d99[_0x5dc5('0x39')]=_0x440d99[_0x5dc5('0x39')]['length']?_0x440d99['attributes']:_0x97c6a7['model'];_0x440d99['order']=qs[_0x5dc5('0x3f')](_0x1c55c1[_0x5dc5('0x36')][_0x5dc5('0x3f')]);_0x440d99['where']=qs[_0x5dc5('0x38')](_[_0x5dc5('0x40')](_0x1c55c1[_0x5dc5('0x36')],_0x97c6a7[_0x5dc5('0x38')]));if(_0x1c55c1[_0x5dc5('0x36')][_0x5dc5('0x41')]){_0x440d99['where']=_[_0x5dc5('0x43')](_0x440d99[_0x5dc5('0x42')],{'$or':_[_0x5dc5('0x32')](_0x440d99[_0x5dc5('0x39')],function(_0x14db70){var _0x478e10={};_0x478e10[_0x14db70]={'$like':'%'+_0x1c55c1[_0x5dc5('0x36')][_0x5dc5('0x41')]+'%'};return _0x478e10;})});}_0x440d99=_[_0x5dc5('0x43')]({},_0x440d99,_0x1c55c1[_0x5dc5('0x45')]);return _0x37e53a['getAgents'](_0x440d99);}})['then'](function(_0x4f0f91){if(_0x4f0f91){_0x2951a2=_0x4f0f91[_0x5dc5('0x3c')];if(!_0x1c55c1['query'][_0x5dc5('0x3d')](_0x5dc5('0x6a'))){_0x440d99[_0x5dc5('0x24')]=qs['limit'](_0x1c55c1[_0x5dc5('0x36')]['limit']);_0x440d99[_0x5dc5('0x22')]=qs[_0x5dc5('0x22')](_0x1c55c1[_0x5dc5('0x36')][_0x5dc5('0x22')]);}return _0x37e53a[_0x5dc5('0x8c')](_0x440d99);}})[_0x5dc5('0x2a')](function(_0x5e4233){if(_0x5e4233){return _0x5e4233?{'count':_0x2951a2,'rows':_0x5e4233}:null;}})[_0x5dc5('0x2a')](respondWithResult(_0x151303,null))[_0x5dc5('0x4a')](handleError(_0x151303,null));};
\ No newline at end of file
+var _0xb59c=['defaultValue','queryInterface','cm_contacts','cf_%s','getCustomFields','addAgents','spread','emit','removeAgents','userCmList:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./cmList.socket','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Lists','error','stack','name','map','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','include','CmList','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','keys','hasOwnProperty','rows','removeDispositions','ids','addContacts','CmContact','tags','isArray','each','omit','success','push','dataValues','errors','message','CustomFields','concat','format','options','getContactsCsv','CmCustomField','cf_%d','raw','getContacts','isEmpty','now','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb59c,0x1b8));var _0xcb59=function(_0x508b25,_0x1616eb){_0x508b25=_0x508b25-0x0;var _0x3b81eb=_0xb59c[_0x508b25];return _0x3b81eb;};'use strict';var emlformat=require(_0xcb59('0x0'));var rimraf=require(_0xcb59('0x1'));var zipdir=require(_0xcb59('0x2'));var jsonpatch=require(_0xcb59('0x3'));var rp=require(_0xcb59('0x4'));var moment=require(_0xcb59('0x5'));var BPromise=require(_0xcb59('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xcb59('0x7'));var csv=require(_0xcb59('0x8'));var ejs=require(_0xcb59('0x9'));var fs=require('fs');var fs_extra=require(_0xcb59('0xa'));var _=require(_0xcb59('0xb'));var squel=require(_0xcb59('0xc'));var crypto=require('crypto');var jsforce=require(_0xcb59('0xd'));var deskjs=require(_0xcb59('0xe'));var toCsv=require(_0xcb59('0x8'));var querystring=require('querystring');var Papa=require(_0xcb59('0xf'));var Redis=require(_0xcb59('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcb59('0x11'));var as=require(_0xcb59('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcb59('0x13'))(_0xcb59('0x14'));var utils=require(_0xcb59('0x15'));var config=require(_0xcb59('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcb59('0x17'))['db'];config['redis']=_[_0xcb59('0x18')](config[_0xcb59('0x19')],{'host':_0xcb59('0x1a'),'port':0x18eb});var socket=require(_0xcb59('0x1b'))(new Redis(config['redis']));require(_0xcb59('0x1c'))['register'](socket);function respondWithStatusCode(_0x18ba52,_0xe33710){_0xe33710=_0xe33710||0xcc;return function(_0x2038e7){if(_0x2038e7){return _0x18ba52[_0xcb59('0x1d')](_0xe33710);}return _0x18ba52[_0xcb59('0x1e')](_0xe33710)[_0xcb59('0x1f')]();};}function respondWithResult(_0x41b00b,_0xaa6fd2){_0xaa6fd2=_0xaa6fd2||0xc8;return function(_0x2a6c3f){if(_0x2a6c3f){return _0x41b00b[_0xcb59('0x1e')](_0xaa6fd2)['json'](_0x2a6c3f);}};}function respondWithFilteredResult(_0x426997,_0x44475c){return function(_0x2aedd0){if(_0x2aedd0){var _0x52c8e5=typeof _0x44475c[_0xcb59('0x20')]===_0xcb59('0x21')&&typeof _0x44475c[_0xcb59('0x22')]===_0xcb59('0x21');var _0x8b8e40=_0x2aedd0[_0xcb59('0x23')];var _0x3953b3=_0x52c8e5?0x0:_0x44475c[_0xcb59('0x20')];var _0x2a56c5=_0x52c8e5?_0x2aedd0[_0xcb59('0x23')]:_0x44475c[_0xcb59('0x20')]+_0x44475c[_0xcb59('0x22')];var _0x5c2e04;if(_0x2a56c5>=_0x8b8e40){_0x2a56c5=_0x8b8e40;_0x5c2e04=0xc8;}else{_0x5c2e04=0xce;}_0x426997[_0xcb59('0x1e')](_0x5c2e04);return _0x426997[_0xcb59('0x24')](_0xcb59('0x25'),_0x3953b3+'-'+_0x2a56c5+'/'+_0x8b8e40)[_0xcb59('0x26')](_0x2aedd0);}return null;};}function patchUpdates(_0x3e4697){return function(_0x134739){try{jsonpatch[_0xcb59('0x27')](_0x134739,_0x3e4697,!![]);}catch(_0x15e7e2){return BPromise[_0xcb59('0x28')](_0x15e7e2);}return _0x134739[_0xcb59('0x29')]();};}function saveUpdates(_0x2fffff,_0x5f2364){return function(_0x4dd599){if(_0x4dd599){return _0x4dd599[_0xcb59('0x2a')](_0x2fffff)[_0xcb59('0x2b')](function(_0x182069){return _0x182069;});}return null;};}function removeEntity(_0x1c1463,_0xef2035){return function(_0x4d67e1){if(_0x4d67e1){return _0x4d67e1[_0xcb59('0x2c')]()['then'](function(){var _0x17ca9a=_0x4d67e1[_0xcb59('0x2d')]({'plain':!![]});var _0x4d2223=_0xcb59('0x2e');return db['UserProfileResource'][_0xcb59('0x2c')]({'where':{'type':_0x4d2223,'resourceId':_0x17ca9a['id']}})['then'](function(){return _0x4d67e1;});})[_0xcb59('0x2b')](function(){_0x1c1463[_0xcb59('0x1e')](0xcc)[_0xcb59('0x1f')]();});}};}function handleEntityNotFound(_0x46b40d,_0x4edb48){return function(_0x2c47ee){if(!_0x2c47ee){_0x46b40d[_0xcb59('0x1d')](0x194);}return _0x2c47ee;};}function handleError(_0x2721a5,_0x29c9cb){_0x29c9cb=_0x29c9cb||0x1f4;return function(_0x294989){logger[_0xcb59('0x2f')](_0x294989[_0xcb59('0x30')]);if(_0x294989[_0xcb59('0x31')]){delete _0x294989[_0xcb59('0x31')];}_0x2721a5[_0xcb59('0x1e')](_0x29c9cb)['send'](_0x294989);};}exports['index']=function(_0x43866c,_0x1c1eee){var _0x26dff1={},_0x454472={},_0x24889d={'count':0x0,'rows':[]};var _0x5b3387=_[_0xcb59('0x32')](db['CmList'][_0xcb59('0x33')],function(_0x3eb61d){return{'name':_0x3eb61d[_0xcb59('0x34')],'type':_0x3eb61d[_0xcb59('0x35')][_0xcb59('0x36')]};});_0x454472['model']=_[_0xcb59('0x32')](_0x5b3387,_0xcb59('0x31'));_0x454472[_0xcb59('0x37')]=_['keys'](_0x43866c[_0xcb59('0x37')]);_0x454472['filters']=_[_0xcb59('0x38')](_0x454472[_0xcb59('0x39')],_0x454472[_0xcb59('0x37')]);_0x26dff1[_0xcb59('0x3a')]=_[_0xcb59('0x38')](_0x454472['model'],qs[_0xcb59('0x3b')](_0x43866c['query'][_0xcb59('0x3b')]));_0x26dff1[_0xcb59('0x3a')]=_0x26dff1['attributes'][_0xcb59('0x3c')]?_0x26dff1[_0xcb59('0x3a')]:_0x454472[_0xcb59('0x39')];if(!_0x43866c[_0xcb59('0x37')]['hasOwnProperty'](_0xcb59('0x3d'))){_0x26dff1['limit']=qs['limit'](_0x43866c[_0xcb59('0x37')][_0xcb59('0x22')]);_0x26dff1['offset']=qs['offset'](_0x43866c[_0xcb59('0x37')]['offset']);}_0x26dff1[_0xcb59('0x3e')]=qs[_0xcb59('0x3f')](_0x43866c[_0xcb59('0x37')][_0xcb59('0x3f')]);_0x26dff1[_0xcb59('0x40')]=qs[_0xcb59('0x41')](_[_0xcb59('0x42')](_0x43866c[_0xcb59('0x37')],_0x454472[_0xcb59('0x41')]),_0x5b3387);if(_0x43866c[_0xcb59('0x37')][_0xcb59('0x43')]){_0x26dff1[_0xcb59('0x40')]=_[_0xcb59('0x44')](_0x26dff1[_0xcb59('0x40')],{'$or':_['map'](_0x5b3387,function(_0x4abb4d){if(_0x4abb4d[_0xcb59('0x35')]!=='VIRTUAL'){var _0x497824={};_0x497824[_0x4abb4d['name']]={'$like':'%'+_0x43866c[_0xcb59('0x37')][_0xcb59('0x43')]+'%'};return _0x497824;}})});}_0x26dff1=_[_0xcb59('0x44')]({},_0x26dff1,_0x43866c['options']);var _0x4f0e12={'where':_0x26dff1['where']};return db['CmList'][_0xcb59('0x23')](_0x4f0e12)['then'](function(_0x445276){_0x24889d[_0xcb59('0x23')]=_0x445276;if(_0x43866c[_0xcb59('0x37')]['includeAll']){_0x26dff1[_0xcb59('0x45')]=[{'all':!![]}];}return db[_0xcb59('0x46')][_0xcb59('0x47')](_0x26dff1);})[_0xcb59('0x2b')](function(_0x289347){_0x24889d['rows']=_0x289347;return _0x24889d;})[_0xcb59('0x2b')](respondWithFilteredResult(_0x1c1eee,_0x26dff1))[_0xcb59('0x48')](handleError(_0x1c1eee,null));};exports[_0xcb59('0x49')]=function(_0x1c2682,_0x5323ef){var _0x134f1a={'raw':![],'where':{'id':_0x1c2682[_0xcb59('0x4a')]['id']}},_0x3c829c={};_0x3c829c[_0xcb59('0x39')]=_['keys'](db['CmList'][_0xcb59('0x33')]);_0x3c829c[_0xcb59('0x37')]=_['keys'](_0x1c2682[_0xcb59('0x37')]);_0x3c829c[_0xcb59('0x41')]=_['intersection'](_0x3c829c[_0xcb59('0x39')],_0x3c829c[_0xcb59('0x37')]);_0x134f1a[_0xcb59('0x3a')]=_[_0xcb59('0x38')](_0x3c829c[_0xcb59('0x39')],qs[_0xcb59('0x3b')](_0x1c2682['query'][_0xcb59('0x3b')]));_0x134f1a[_0xcb59('0x3a')]=_0x134f1a[_0xcb59('0x3a')][_0xcb59('0x3c')]?_0x134f1a[_0xcb59('0x3a')]:_0x3c829c[_0xcb59('0x39')];if(_0x1c2682[_0xcb59('0x37')][_0xcb59('0x4b')]){_0x134f1a[_0xcb59('0x45')]=[{'all':!![]}];}_0x134f1a=_[_0xcb59('0x44')]({},_0x134f1a,_0x1c2682['options']);return db[_0xcb59('0x46')][_0xcb59('0x4c')](_0x134f1a)[_0xcb59('0x2b')](handleEntityNotFound(_0x5323ef,null))[_0xcb59('0x2b')](respondWithResult(_0x5323ef,null))[_0xcb59('0x48')](handleError(_0x5323ef,null));};exports[_0xcb59('0x4d')]=function(_0x37eae2,_0x277514){return db[_0xcb59('0x46')][_0xcb59('0x4d')](_0x37eae2[_0xcb59('0x4e')],{})[_0xcb59('0x2b')](function(_0x516688){var _0x15a33b=_0x37eae2[_0xcb59('0x4f')][_0xcb59('0x2d')]({'plain':!![]});if(!_0x15a33b)throw new Error(_0xcb59('0x50'));if(_0x15a33b[_0xcb59('0x51')]===_0xcb59('0x4f')){var _0x14ac1c=_0x516688[_0xcb59('0x2d')]({'plain':!![]});var _0x4fc03e='Lists';return db[_0xcb59('0x52')][_0xcb59('0x4c')]({'where':{'name':_0x4fc03e,'userProfileId':_0x15a33b[_0xcb59('0x53')]},'raw':!![]})['then'](function(_0x4134ba){if(_0x4134ba&&_0x4134ba['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x14ac1c['name'],'resourceId':_0x14ac1c['id'],'type':_0x4134ba[_0xcb59('0x31')],'sectionId':_0x4134ba['id']},{})[_0xcb59('0x2b')](function(){return _0x516688;});}else{return _0x516688;}})[_0xcb59('0x48')](function(_0x50ff08){logger[_0xcb59('0x2f')](_0xcb59('0x54'),_0x50ff08);throw _0x50ff08;});}return _0x516688;})[_0xcb59('0x2b')](respondWithResult(_0x277514,0xc9))[_0xcb59('0x48')](handleError(_0x277514,null));};exports[_0xcb59('0x2a')]=function(_0x2718f8,_0x5ccf0){if(_0x2718f8[_0xcb59('0x4e')]['id']){delete _0x2718f8[_0xcb59('0x4e')]['id'];}return db['CmList'][_0xcb59('0x4c')]({'where':{'id':_0x2718f8[_0xcb59('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5ccf0,null))['then'](saveUpdates(_0x2718f8[_0xcb59('0x4e')],null))['then'](respondWithResult(_0x5ccf0,null))['catch'](handleError(_0x5ccf0,null));};exports['destroy']=function(_0x2a539d,_0x5c0024){return db['CmList']['find']({'where':{'id':_0x2a539d[_0xcb59('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5c0024,null))[_0xcb59('0x2b')](removeEntity(_0x5c0024,null))[_0xcb59('0x48')](handleError(_0x5c0024,null));};exports[_0xcb59('0x55')]=function(_0x43d42e,_0x47be6d){return db[_0xcb59('0x46')]['describe']()[_0xcb59('0x2b')](respondWithResult(_0x47be6d,null))[_0xcb59('0x48')](handleError(_0x47be6d,null));};exports[_0xcb59('0x56')]=function(_0x8e7361,_0x1742a3,_0x42279c){if(_0x8e7361[_0xcb59('0x4e')]['id']){delete _0x8e7361[_0xcb59('0x4e')]['id'];}return db['CmList'][_0xcb59('0x4c')]({'where':{'id':_0x8e7361['params']['id']}})[_0xcb59('0x2b')](handleEntityNotFound(_0x1742a3,null))[_0xcb59('0x2b')](function(_0x24e707){if(_0x24e707){_0x8e7361[_0xcb59('0x4e')][_0xcb59('0x57')]=_0x24e707['id'];return db[_0xcb59('0x58')][_0xcb59('0x4d')](_0x8e7361['body']);}})[_0xcb59('0x2b')](respondWithResult(_0x1742a3,null))[_0xcb59('0x48')](handleError(_0x1742a3,null));};exports[_0xcb59('0x59')]=function(_0x27f56e,_0x5ea8f1,_0x32a5e1){var _0x3188ec={'raw':![],'where':{}};var _0x2e851f={};var _0x45e643={'count':0x0,'rows':[]};return db[_0xcb59('0x46')][_0xcb59('0x5a')]({'where':{'id':_0x27f56e[_0xcb59('0x4a')]['id']}})[_0xcb59('0x2b')](handleEntityNotFound(_0x5ea8f1,null))['then'](function(_0x9f099d){if(_0x9f099d){_0x2e851f[_0xcb59('0x39')]=_['keys'](db[_0xcb59('0x58')][_0xcb59('0x33')]);_0x2e851f[_0xcb59('0x37')]=_[_0xcb59('0x5b')](_0x27f56e[_0xcb59('0x37')]);_0x2e851f[_0xcb59('0x41')]=_[_0xcb59('0x38')](_0x2e851f[_0xcb59('0x39')],_0x2e851f[_0xcb59('0x37')]);_0x3188ec[_0xcb59('0x3a')]=_[_0xcb59('0x38')](_0x2e851f[_0xcb59('0x39')],qs[_0xcb59('0x3b')](_0x27f56e[_0xcb59('0x37')][_0xcb59('0x3b')]));_0x3188ec['attributes']=_0x3188ec['attributes'][_0xcb59('0x3c')]?_0x3188ec[_0xcb59('0x3a')]:_0x2e851f[_0xcb59('0x39')];if(!_0x27f56e['query'][_0xcb59('0x5c')](_0xcb59('0x3d'))){_0x3188ec[_0xcb59('0x22')]=qs[_0xcb59('0x22')](_0x27f56e[_0xcb59('0x37')]['limit']);_0x3188ec[_0xcb59('0x20')]=qs['offset'](_0x27f56e[_0xcb59('0x37')]['offset']);}_0x3188ec[_0xcb59('0x3e')]=qs[_0xcb59('0x3f')](_0x27f56e['query'][_0xcb59('0x3f')]);_0x3188ec[_0xcb59('0x40')]=qs[_0xcb59('0x41')](_[_0xcb59('0x42')](_0x27f56e['query'],_0x2e851f[_0xcb59('0x41')]));_0x3188ec[_0xcb59('0x40')]['ListId']=_0x9f099d['id'];if(_0x27f56e['query']['filter']){_0x3188ec[_0xcb59('0x40')]=_['merge'](_0x3188ec[_0xcb59('0x40')],{'$or':_[_0xcb59('0x32')](_0x3188ec[_0xcb59('0x3a')],function(_0x414c4a){var _0x16cf03={};_0x16cf03[_0x414c4a]={'$like':'%'+_0x27f56e[_0xcb59('0x37')][_0xcb59('0x43')]+'%'};return _0x16cf03;})});}_0x3188ec=_[_0xcb59('0x44')]({},_0x3188ec,_0x27f56e['options']);return db[_0xcb59('0x58')][_0xcb59('0x23')]({'where':_0x3188ec['where']})[_0xcb59('0x2b')](function(_0x58bb84){_0x45e643['count']=_0x58bb84;if(_0x27f56e['query'][_0xcb59('0x4b')]){_0x3188ec['include']=[{'all':!![]}];}return db[_0xcb59('0x58')][_0xcb59('0x47')](_0x3188ec);})[_0xcb59('0x2b')](function(_0x11a898){_0x45e643[_0xcb59('0x5d')]=_0x11a898;return _0x45e643;});}})[_0xcb59('0x2b')](respondWithFilteredResult(_0x5ea8f1,_0x3188ec))[_0xcb59('0x48')](handleError(_0x5ea8f1,null));};exports[_0xcb59('0x5e')]=function(_0x5b08de,_0x2fb667,_0x18fbd5){return db[_0xcb59('0x46')][_0xcb59('0x4c')]({'where':{'id':_0x5b08de[_0xcb59('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2fb667,null))[_0xcb59('0x2b')](function(_0x1a9814){if(_0x1a9814){return _0x1a9814[_0xcb59('0x5e')](_0x5b08de[_0xcb59('0x37')][_0xcb59('0x5f')]);}})[_0xcb59('0x2b')](respondWithStatusCode(_0x2fb667,null))[_0xcb59('0x48')](handleError(_0x2fb667,null));};exports[_0xcb59('0x60')]=function(_0x509502,_0x1e7dd2,_0x152b1e){return db[_0xcb59('0x46')]['find']({'where':{'id':_0x509502[_0xcb59('0x4a')]['id']}})[_0xcb59('0x2b')](handleEntityNotFound(_0x1e7dd2,null))[_0xcb59('0x2b')](function(_0x505690){if(_0x505690){var _0x11507e=[];var _0x3c98e8={'success':[],'errors':[]};return db[_0xcb59('0x61')][_0xcb59('0x55')]()[_0xcb59('0x2b')](function(_0x50e70a){if(_0x509502[_0xcb59('0x4e')]['tags']&&_['isArray'](_0x509502[_0xcb59('0x4e')][_0xcb59('0x62')])){if(_0x509502[_0xcb59('0x4e')]['tags']['length']){_0x509502[_0xcb59('0x4e')][_0xcb59('0x62')]=_0x509502[_0xcb59('0x4e')]['tags']['join'](';')+';';}else{_0x509502['body'][_0xcb59('0x62')]=null;}}else{_0x509502[_0xcb59('0x4e')][_0xcb59('0x62')]=null;}if(_0x509502[_0xcb59('0x4e')]&&_[_0xcb59('0x63')](_0x509502[_0xcb59('0x4e')])){for(var _0x1cf907=0x0;_0x1cf907<_0x509502[_0xcb59('0x4e')][_0xcb59('0x3c')];_0x1cf907+=0x1){_0x509502[_0xcb59('0x4e')][_0x1cf907]['ListId']=_0x509502[_0xcb59('0x4a')]['id'];_0x11507e['push'](_0x509502[_0xcb59('0x4e')][_0x1cf907]);}return BPromise[_0xcb59('0x64')](_0x11507e,function(_0xed7b57){return db['CmContact'][_0xcb59('0x4d')](_[_0xcb59('0x65')](_0xed7b57,['ids','id'])||{},{'fields':_['keys'](_0x50e70a),'raw':!![]})['then'](function(_0x3d22b9){_0x3c98e8[_0xcb59('0x66')][_0xcb59('0x67')](_0x3d22b9[_0xcb59('0x68')]);})[_0xcb59('0x48')](function(_0x5789c3){_0x3c98e8[_0xcb59('0x69')]['push']({'data':_0xed7b57,'error':_0x5789c3[_0xcb59('0x6a')]});});})['then'](function(_0x25385d){return _0x3c98e8;})['catch'](function(_0x100c98){return _0x100c98;});}else{_0x1e7dd2['status'](0x190)[_0xcb59('0x26')]({'message':'Malformed\x20request\x20syntax'});}});}})['then'](respondWithResult(_0x1e7dd2,null))[_0xcb59('0x48')](handleError(_0x1e7dd2,null));};exports['getContacts']=function(_0x31d9bd,_0x13b6fe,_0x3f4943){var _0x1a1ebf;return db['CmList'][_0xcb59('0x4c')]({'where':{'id':_0x31d9bd[_0xcb59('0x4a')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xcb59('0x6b')}]})[_0xcb59('0x2b')](handleEntityNotFound(_0x13b6fe,null))[_0xcb59('0x2b')](function(_0x4d1579){if(_0x4d1579){_0x1a1ebf=_0x4d1579;return db[_0xcb59('0x61')][_0xcb59('0x33')];}})[_0xcb59('0x2b')](function(_0x24b10a){if(_0x24b10a){var _0x478486={};var _0x321a81={};_0x321a81[_0xcb59('0x39')]=_[_0xcb59('0x6c')](_[_0xcb59('0x5b')](_0x24b10a),_[_0xcb59('0x32')](_0x1a1ebf[_0xcb59('0x6b')],function(_0x342dca){return util[_0xcb59('0x6d')]('cf_%d',_0x342dca['id']);}));_0x321a81['query']=_[_0xcb59('0x5b')](_0x31d9bd[_0xcb59('0x37')]);_0x321a81['filters']=_[_0xcb59('0x38')](_0x321a81[_0xcb59('0x39')],_0x321a81[_0xcb59('0x37')]);_0x478486[_0xcb59('0x3a')]=_[_0xcb59('0x38')](_0x321a81[_0xcb59('0x39')],qs[_0xcb59('0x3b')](_0x31d9bd[_0xcb59('0x37')][_0xcb59('0x3b')]));_0x478486[_0xcb59('0x3a')]=_0x478486['attributes'][_0xcb59('0x3c')]?_0x478486['attributes']:_0x321a81[_0xcb59('0x39')];if(!_0x31d9bd[_0xcb59('0x37')][_0xcb59('0x5c')]('nolimit')){_0x478486[_0xcb59('0x22')]=qs['limit'](_0x31d9bd[_0xcb59('0x37')][_0xcb59('0x22')]);_0x478486[_0xcb59('0x20')]=qs[_0xcb59('0x20')](_0x31d9bd['query'][_0xcb59('0x20')]);}_0x478486['order']=qs[_0xcb59('0x3f')](_0x31d9bd[_0xcb59('0x37')][_0xcb59('0x3f')]);_0x478486[_0xcb59('0x40')]=qs[_0xcb59('0x41')](_['pick'](_0x31d9bd[_0xcb59('0x37')],_0x321a81[_0xcb59('0x41')]));_0x478486['raw']=!![];if(_0x31d9bd[_0xcb59('0x37')][_0xcb59('0x43')]){_0x478486[_0xcb59('0x40')]=_['merge'](_0x478486[_0xcb59('0x40')],{'$or':_[_0xcb59('0x32')](_0x478486['attributes'],function(_0x1caa58){var _0x407482={};_0x407482[_0x1caa58]={'$like':'%'+_0x31d9bd[_0xcb59('0x37')][_0xcb59('0x43')]+'%'};return _0x407482;})});}_0x478486=_[_0xcb59('0x44')]({},_0x478486,_0x31d9bd[_0xcb59('0x6e')]);return _0x1a1ebf['getContacts'](_0x478486);}})[_0xcb59('0x2b')](respondWithResult(_0x13b6fe,null))[_0xcb59('0x48')](handleError(_0x13b6fe,null));};exports[_0xcb59('0x6f')]=function(_0x48a461,_0x5a3709,_0x28b2ca){var _0x3fcb9b;return db[_0xcb59('0x46')][_0xcb59('0x4c')]({'where':{'id':_0x48a461[_0xcb59('0x4a')]['id']},'include':[{'model':db[_0xcb59('0x70')],'as':_0xcb59('0x6b')}]})[_0xcb59('0x2b')](handleEntityNotFound(_0x5a3709,null))[_0xcb59('0x2b')](function(_0x50c40f){if(_0x50c40f){_0x3fcb9b=_0x50c40f;return db['CmContact']['rawAttributes'];}})['then'](function(_0x2e07f6){if(_0x2e07f6){var _0x37585e={};var _0x148e18={};_0x148e18['model']=_['concat'](_[_0xcb59('0x5b')](_0x2e07f6),_[_0xcb59('0x32')](_0x3fcb9b['CustomFields'],function(_0x552e3f){return util[_0xcb59('0x6d')](_0xcb59('0x71'),_0x552e3f['id']);}));_0x148e18[_0xcb59('0x37')]=_[_0xcb59('0x5b')](_0x48a461[_0xcb59('0x37')]);_0x148e18[_0xcb59('0x41')]=_[_0xcb59('0x38')](_0x148e18['model'],_0x148e18[_0xcb59('0x37')]);_0x37585e[_0xcb59('0x3a')]=_[_0xcb59('0x38')](_0x148e18[_0xcb59('0x39')],qs['fields'](_0x48a461['query'][_0xcb59('0x3b')]));_0x37585e['attributes']=_0x37585e[_0xcb59('0x3a')][_0xcb59('0x3c')]?_0x37585e[_0xcb59('0x3a')]:_0x148e18[_0xcb59('0x39')];if(!_0x48a461[_0xcb59('0x37')][_0xcb59('0x5c')](_0xcb59('0x3d'))){_0x37585e[_0xcb59('0x22')]=qs[_0xcb59('0x22')](_0x48a461['query'][_0xcb59('0x22')]);_0x37585e[_0xcb59('0x20')]=qs[_0xcb59('0x20')](_0x48a461[_0xcb59('0x37')][_0xcb59('0x20')]);}_0x37585e[_0xcb59('0x3e')]=qs['sort'](_0x48a461[_0xcb59('0x37')]['sort']);_0x37585e[_0xcb59('0x40')]=qs[_0xcb59('0x41')](_[_0xcb59('0x42')](_0x48a461[_0xcb59('0x37')],_0x148e18[_0xcb59('0x41')]));_0x37585e[_0xcb59('0x72')]=!![];if(_0x48a461['query']['filter']){_0x37585e[_0xcb59('0x40')]=_[_0xcb59('0x44')](_0x37585e['where'],{'$or':_['map'](_0x37585e[_0xcb59('0x3a')],function(_0x28f585){var _0x1d4166={};_0x1d4166[_0x28f585]={'$like':'%'+_0x48a461[_0xcb59('0x37')][_0xcb59('0x43')]+'%'};return _0x1d4166;})});}_0x37585e=_['merge']({},_0x37585e,_0x48a461['options']);return _0x3fcb9b[_0xcb59('0x73')](_0x37585e);}})[_0xcb59('0x2b')](function(_0x4671e3){if(!_[_0xcb59('0x74')](_0x4671e3)){var _0x39cfcd=toCsv(_0x4671e3);var _0x3cccd6=Date[_0xcb59('0x75')]();fs['writeFileSync'](util['format']('/tmp/list_%d_%s.csv',_0x3fcb9b['id'],_0x3cccd6),_0x39cfcd);_0x5a3709['setHeader']('Content-disposition','attachment;\x20filename='+util[_0xcb59('0x6d')](_0xcb59('0x76'),_0x3fcb9b['id'],_0x3cccd6));_0x5a3709['setHeader'](_0xcb59('0x77'),_0xcb59('0x78'));return _0x5a3709[_0xcb59('0x79')](util[_0xcb59('0x6d')]('/tmp/list_%d_%s.csv',_0x3fcb9b['id'],_0x3cccd6));}else{return _0x5a3709['sendStatus'](0xcc);}})[_0xcb59('0x48')](handleError(_0x5a3709,null));};exports[_0xcb59('0x7a')]=function(_0x519969,_0x213ac0,_0x2eed65){var _0xb803c1;delete _0x519969[_0xcb59('0x4e')]['id'];return db[_0xcb59('0x46')][_0xcb59('0x5a')]({'where':{'id':_0x519969[_0xcb59('0x4a')]['id']}})[_0xcb59('0x2b')](handleEntityNotFound(_0x213ac0,null))[_0xcb59('0x2b')](function(_0x4cbe51){if(_0x4cbe51){return db[_0xcb59('0x7b')][_0xcb59('0x7c')](function(_0x11503f){return db[_0xcb59('0x70')][_0xcb59('0x4d')](_0x519969[_0xcb59('0x4e')],{'transaction':_0x11503f})[_0xcb59('0x2b')](function(_0x5db787){_0xb803c1=_0x5db787;return _0x4cbe51[_0xcb59('0x7d')](_0x5db787,{'transaction':_0x11503f});})[_0xcb59('0x2b')](function(){var _0x588c12={'type':db[_0xcb59('0x7e')][_0xcb59('0x7f')],'transaction':_0x11503f};switch(_0x519969[_0xcb59('0x4e')][_0xcb59('0x35')]){case _0xcb59('0x80'):_0x588c12[_0xcb59('0x35')]=db[_0xcb59('0x7e')][_0xcb59('0x7f')];break;case _0xcb59('0x81'):_0x588c12[_0xcb59('0x35')]=db[_0xcb59('0x7e')][_0xcb59('0x82')];break;case'switch':_0x588c12[_0xcb59('0x35')]=db[_0xcb59('0x7e')][_0xcb59('0x83')];_0x588c12[_0xcb59('0x84')]=![];break;default:}return db['sequelize'][_0xcb59('0x85')]['addColumn'](_0xcb59('0x86'),util['format'](_0xcb59('0x87'),_0xb803c1['id']),_0x588c12);})[_0xcb59('0x2b')](function(){return _0xb803c1;});});}})[_0xcb59('0x2b')](respondWithResult(_0x213ac0,null))[_0xcb59('0x48')](handleError(_0x213ac0,null));};exports[_0xcb59('0x88')]=function(_0x41f581,_0x4f3368,_0x11f00a){var _0x41f9d3={};var _0xe24928={};var _0x1854d1;var _0x2e5626;return db[_0xcb59('0x46')][_0xcb59('0x5a')]({'where':{'id':_0x41f581[_0xcb59('0x4a')]['id']}})[_0xcb59('0x2b')](handleEntityNotFound(_0x4f3368,null))[_0xcb59('0x2b')](function(_0x40d798){if(_0x40d798){_0x1854d1=_0x40d798;_0xe24928[_0xcb59('0x39')]=_[_0xcb59('0x5b')](db[_0xcb59('0x70')][_0xcb59('0x33')]);_0xe24928['query']=_[_0xcb59('0x5b')](_0x41f581[_0xcb59('0x37')]);_0xe24928[_0xcb59('0x41')]=_[_0xcb59('0x38')](_0xe24928[_0xcb59('0x39')],_0xe24928[_0xcb59('0x37')]);_0x41f9d3[_0xcb59('0x3a')]=_[_0xcb59('0x38')](_0xe24928[_0xcb59('0x39')],qs['fields'](_0x41f581[_0xcb59('0x37')][_0xcb59('0x3b')]));_0x41f9d3[_0xcb59('0x3a')]=_0x41f9d3[_0xcb59('0x3a')]['length']?_0x41f9d3['attributes']:_0xe24928[_0xcb59('0x39')];_0x41f9d3[_0xcb59('0x3e')]=qs[_0xcb59('0x3f')](_0x41f581[_0xcb59('0x37')][_0xcb59('0x3f')]);_0x41f9d3[_0xcb59('0x40')]=qs[_0xcb59('0x41')](_['pick'](_0x41f581[_0xcb59('0x37')],_0xe24928[_0xcb59('0x41')]));_0x41f9d3[_0xcb59('0x40')]=_[_0xcb59('0x44')](_0x41f9d3['where'],{'$or':[{'ListId':_0x40d798['id']},{'ListId':null}]});if(_0x41f581['query'][_0xcb59('0x43')]){_0x41f9d3[_0xcb59('0x40')]=_[_0xcb59('0x44')](_0x41f9d3[_0xcb59('0x40')],{'$or':_[_0xcb59('0x32')](_0x41f9d3[_0xcb59('0x3a')],function(_0x2bc7d6){var _0x49fab9={};_0x49fab9[_0x2bc7d6]={'$like':'%'+_0x41f581['query'][_0xcb59('0x43')]+'%'};return _0x49fab9;})});}_0x41f9d3=_[_0xcb59('0x44')]({},_0x41f9d3,_0x41f581[_0xcb59('0x6e')]);return db['CmCustomField']['findAndCountAll'](_0x41f9d3);}})[_0xcb59('0x2b')](respondWithResult(_0x4f3368,null))['catch'](handleError(_0x4f3368,null));};exports[_0xcb59('0x89')]=function(_0x2f893d,_0x5651d9,_0x24c607){return db['CmList'][_0xcb59('0x4c')]({'where':{'id':_0x2f893d[_0xcb59('0x4a')]['id']}})[_0xcb59('0x2b')](handleEntityNotFound(_0x5651d9,null))['then'](function(_0x2e1e1b){if(_0x2e1e1b){return _0x2e1e1b[_0xcb59('0x89')](_0x2f893d['body'][_0xcb59('0x5f')],_[_0xcb59('0x65')](_0x2f893d['body'],[_0xcb59('0x5f'),'id'])||{})[_0xcb59('0x8a')](function(_0x1e9c76){for(var _0x2df8a6=0x0;_0x2df8a6<_0x2f893d[_0xcb59('0x4e')][_0xcb59('0x5f')][_0xcb59('0x3c')];_0x2df8a6+=0x1){socket[_0xcb59('0x8b')]('userCmList:save',{'UserId':Number(_0x2f893d[_0xcb59('0x4e')][_0xcb59('0x5f')][_0x2df8a6]),'CmListId':Number(_0x2f893d[_0xcb59('0x4a')]['id'])});}return _0x1e9c76;});}})['then'](respondWithResult(_0x5651d9,null))[_0xcb59('0x48')](handleError(_0x5651d9,null));};exports['removeAgents']=function(_0x159f6b,_0x157a29,_0x23f8c8){return db['CmList'][_0xcb59('0x4c')]({'where':{'id':_0x159f6b[_0xcb59('0x4a')]['id']}})[_0xcb59('0x2b')](handleEntityNotFound(_0x157a29,null))[_0xcb59('0x2b')](function(_0x139b2c){if(_0x139b2c){return _0x139b2c[_0xcb59('0x8c')](_0x159f6b['query'][_0xcb59('0x5f')])[_0xcb59('0x2b')](function(){if(_[_0xcb59('0x63')](_0x159f6b['query'][_0xcb59('0x5f')])){for(var _0x1be520=0x0;_0x1be520<_0x159f6b[_0xcb59('0x37')][_0xcb59('0x5f')][_0xcb59('0x3c')];_0x1be520+=0x1){socket[_0xcb59('0x8b')](_0xcb59('0x8d'),{'UserId':Number(_0x159f6b[_0xcb59('0x37')][_0xcb59('0x5f')][_0x1be520]),'CmListId':Number(_0x159f6b['params']['id'])});}}else{socket[_0xcb59('0x8b')](_0xcb59('0x8d'),{'UserId':Number(_0x159f6b[_0xcb59('0x37')]['ids']),'CmListId':Number(_0x159f6b[_0xcb59('0x4a')]['id'])});}});}})[_0xcb59('0x2b')](respondWithStatusCode(_0x157a29,null))[_0xcb59('0x48')](handleError(_0x157a29,null));};exports[_0xcb59('0x8e')]=function(_0x207c7a,_0x46047c,_0x5daca2){var _0x17faf1={};var _0x32ae4d={};var _0x1ccacc;var _0x370d73;return db['CmList'][_0xcb59('0x5a')]({'where':{'id':_0x207c7a[_0xcb59('0x4a')]['id']}})[_0xcb59('0x2b')](handleEntityNotFound(_0x46047c,null))[_0xcb59('0x2b')](function(_0x5e4060){if(_0x5e4060){_0x1ccacc=_0x5e4060;_0x32ae4d[_0xcb59('0x39')]=_[_0xcb59('0x5b')](db['User'][_0xcb59('0x33')]);_0x32ae4d[_0xcb59('0x37')]=_[_0xcb59('0x5b')](_0x207c7a['query']);_0x32ae4d[_0xcb59('0x41')]=_[_0xcb59('0x38')](_0x32ae4d[_0xcb59('0x39')],_0x32ae4d['query']);_0x17faf1['attributes']=_[_0xcb59('0x38')](_0x32ae4d[_0xcb59('0x39')],qs[_0xcb59('0x3b')](_0x207c7a[_0xcb59('0x37')][_0xcb59('0x3b')]));_0x17faf1[_0xcb59('0x3a')]=_0x17faf1[_0xcb59('0x3a')]['length']?_0x17faf1[_0xcb59('0x3a')]:_0x32ae4d[_0xcb59('0x39')];_0x17faf1[_0xcb59('0x3e')]=qs[_0xcb59('0x3f')](_0x207c7a[_0xcb59('0x37')][_0xcb59('0x3f')]);_0x17faf1[_0xcb59('0x40')]=qs[_0xcb59('0x41')](_['pick'](_0x207c7a[_0xcb59('0x37')],_0x32ae4d['filters']));if(_0x207c7a[_0xcb59('0x37')][_0xcb59('0x43')]){_0x17faf1[_0xcb59('0x40')]=_[_0xcb59('0x44')](_0x17faf1['where'],{'$or':_[_0xcb59('0x32')](_0x17faf1[_0xcb59('0x3a')],function(_0x4ab963){var _0x638284={};_0x638284[_0x4ab963]={'$like':'%'+_0x207c7a[_0xcb59('0x37')]['filter']+'%'};return _0x638284;})});}_0x17faf1=_[_0xcb59('0x44')]({},_0x17faf1,_0x207c7a['options']);return _0x1ccacc[_0xcb59('0x8e')](_0x17faf1);}})['then'](function(_0x40d8c2){if(_0x40d8c2){_0x370d73=_0x40d8c2[_0xcb59('0x3c')];if(!_0x207c7a[_0xcb59('0x37')]['hasOwnProperty'](_0xcb59('0x3d'))){_0x17faf1[_0xcb59('0x22')]=qs['limit'](_0x207c7a[_0xcb59('0x37')][_0xcb59('0x22')]);_0x17faf1[_0xcb59('0x20')]=qs[_0xcb59('0x20')](_0x207c7a[_0xcb59('0x37')][_0xcb59('0x20')]);}return _0x1ccacc['getAgents'](_0x17faf1);}})[_0xcb59('0x2b')](function(_0x2e676f){if(_0x2e676f){return _0x2e676f?{'count':_0x370d73,'rows':_0x2e676f}:null;}})['then'](respondWithResult(_0x46047c,null))[_0xcb59('0x48')](handleError(_0x46047c,null));};
\ No newline at end of file
index 6fff87a..bcd6167 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x154d1e,_0x1f705a){var _0x17568e=function(_0x2da0bb){while(--_0x2da0bb){_0x154d1e['push'](_0x154d1e['shift']());}};_0x17568e(++_0x1f705a);}(_0x7217,0x19e));var _0x7721=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x7217[_0x297fd3];return _0x2af381;};'use strict';var EventEmitter=require(_0x7721('0x0'));var CmList=require('../../mysqldb')['db'][_0x7721('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){CmListEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);CmListEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];CmList[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=CmListEvents;
\ No newline at end of file
+var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x4c06a3,_0x1e6b6f){var _0x7ff53c=function(_0x559eff){while(--_0x559eff){_0x4c06a3['push'](_0x4c06a3['shift']());}};_0x7ff53c(++_0x1e6b6f);}(_0x5fc3,0xa8));var _0x35fc=function(_0xcf4569,_0x1ce755){_0xcf4569=_0xcf4569-0x0;var _0x7fef=_0x5fc3[_0xcf4569];return _0x7fef;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents;
\ No newline at end of file
index 21051ba..de86c0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb43b=['rimraf','../../config/environment','./cmList.attributes','CmList','cm_lists','lodash','util','api','moment','bluebird','path'];(function(_0xf7be32,_0x1cd94a){var _0x4af2d3=function(_0x4b5640){while(--_0x4b5640){_0xf7be32['push'](_0xf7be32['shift']());}};_0x4af2d3(++_0x1cd94a);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1682ed,_0x3af498){_0x1682ed=_0x1682ed-0x0;var _0x2cb645=_0xb43b[_0x1682ed];return _0x2cb645;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var moment=require(_0xbb43('0x3'));var BPromise=require(_0xbb43('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb43('0x5'));var rimraf=require(_0xbb43('0x6'));var config=require(_0xbb43('0x7'));var attributes=require(_0xbb43('0x8'));module['exports']=function(_0x491fb9,_0x378df5){return _0x491fb9['define'](_0xbb43('0x9'),attributes,{'tableName':_0xbb43('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdace=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','CmList','cm_lists','lodash'];(function(_0x3ceca7,_0x50219e){var _0x34b5c0=function(_0x9af205){while(--_0x9af205){_0x3ceca7['push'](_0x3ceca7['shift']());}};_0x34b5c0(++_0x50219e);}(_0xdace,0xc5));var _0xedac=function(_0x32b122,_0x1ad490){_0x32b122=_0x32b122-0x0;var _0x4ad25a=_0xdace[_0x32b122];return _0x4ad25a;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var logger=require(_0xedac('0x1'))(_0xedac('0x2'));var moment=require(_0xedac('0x3'));var BPromise=require('bluebird');var rp=require(_0xedac('0x4'));var fs=require('fs');var path=require(_0xedac('0x5'));var rimraf=require(_0xedac('0x6'));var config=require(_0xedac('0x7'));var attributes=require('./cmList.attributes');module[_0xedac('0x8')]=function(_0x1cba89,_0x39328a){return _0x1cba89['define'](_0xedac('0x9'),attributes,{'tableName':_0xedac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3017300..ac1aa7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa6a=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','CmList,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x368587,_0x1b6554){var _0x42d33c=function(_0xfdccf){while(--_0xfdccf){_0x368587['push'](_0x368587['shift']());}};_0x42d33c(++_0x1b6554);}(_0xfa6a,0x1d9));var _0xafa6=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xfa6a[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0xafa6('0x0'));var util=require(_0xafa6('0x1'));var moment=require(_0xafa6('0x2'));var BPromise=require(_0xafa6('0x3'));var rs=require(_0xafa6('0x4'));var fs=require('fs');var Redis=require(_0xafa6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xafa6('0x6'));var logger=require('../../config/logger')(_0xafa6('0x7'));var config=require(_0xafa6('0x8'));var jayson=require(_0xafa6('0x9'));var client=jayson['client'][_0xafa6('0xa')]({'port':0x232a});config[_0xafa6('0xb')]=_[_0xafa6('0xc')](config['redis'],{'host':_0xafa6('0xd'),'port':0x18eb});var socket=require(_0xafa6('0xe'))(new Redis(config[_0xafa6('0xb')]));require('./cmList.socket')[_0xafa6('0xf')](socket);function respondWithRpcPromise(_0x513463,_0x24ad21,_0x442fa4){return new BPromise(function(_0x4b11a6,_0x215a34){return client[_0xafa6('0x10')](_0x513463,_0x442fa4)[_0xafa6('0x11')](function(_0xd7ef3f){logger[_0xafa6('0x12')](_0xafa6('0x13'),_0x24ad21,'request\x20sent');logger[_0xafa6('0x14')]('CmList,\x20%s,\x20%s,\x20%s',_0x24ad21,_0xafa6('0x15'),JSON[_0xafa6('0x16')](_0xd7ef3f));if(_0xd7ef3f[_0xafa6('0x17')]){if(_0xd7ef3f[_0xafa6('0x17')][_0xafa6('0x18')]===0x1f4){logger[_0xafa6('0x17')](_0xafa6('0x13'),_0x24ad21,_0xd7ef3f[_0xafa6('0x17')]['message']);return _0x215a34(_0xd7ef3f[_0xafa6('0x17')][_0xafa6('0x19')]);}logger[_0xafa6('0x17')](_0xafa6('0x13'),_0x24ad21,_0xd7ef3f[_0xafa6('0x17')][_0xafa6('0x19')]);return _0x4b11a6(_0xd7ef3f[_0xafa6('0x17')][_0xafa6('0x19')]);}else{logger[_0xafa6('0x12')](_0xafa6('0x13'),_0x24ad21,_0xafa6('0x15'));_0x4b11a6(_0xd7ef3f[_0xafa6('0x1a')][_0xafa6('0x19')]);}})[_0xafa6('0x1b')](function(_0x2e6612){logger[_0xafa6('0x17')](_0xafa6('0x13'),_0x24ad21,_0x2e6612);_0x215a34(_0x2e6612);});});}
\ No newline at end of file
+var _0xf1d1=['debug','stringify','error','code','CmList,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./cmList.socket','request','then','info','request\x20sent'];(function(_0x42432f,_0x3a5e3b){var _0x1f9370=function(_0xd7780b){while(--_0xd7780b){_0x42432f['push'](_0x42432f['shift']());}};_0x1f9370(++_0x3a5e3b);}(_0xf1d1,0x14d));var _0x1f1d=function(_0x589ca2,_0x544a75){_0x589ca2=_0x589ca2-0x0;var _0x258d8e=_0xf1d1[_0x589ca2];return _0x258d8e;};'use strict';var _=require(_0x1f1d('0x0'));var util=require(_0x1f1d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1f1d('0x2'));var fs=require('fs');var Redis=require(_0x1f1d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1f1d('0x4'));var logger=require(_0x1f1d('0x5'))(_0x1f1d('0x6'));var config=require(_0x1f1d('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x1f1d('0x8')]=_[_0x1f1d('0x9')](config[_0x1f1d('0x8')],{'host':_0x1f1d('0xa'),'port':0x18eb});var socket=require(_0x1f1d('0xb'))(new Redis(config[_0x1f1d('0x8')]));require(_0x1f1d('0xc'))['register'](socket);function respondWithRpcPromise(_0x4e7ab3,_0x572570,_0xdd2852){return new BPromise(function(_0x1d45e7,_0x911831){return client[_0x1f1d('0xd')](_0x4e7ab3,_0xdd2852)[_0x1f1d('0xe')](function(_0x318042){logger[_0x1f1d('0xf')]('CmList,\x20%s,\x20%s',_0x572570,_0x1f1d('0x10'));logger[_0x1f1d('0x11')]('CmList,\x20%s,\x20%s,\x20%s',_0x572570,_0x1f1d('0x10'),JSON[_0x1f1d('0x12')](_0x318042));if(_0x318042[_0x1f1d('0x13')]){if(_0x318042['error'][_0x1f1d('0x14')]===0x1f4){logger[_0x1f1d('0x13')](_0x1f1d('0x15'),_0x572570,_0x318042[_0x1f1d('0x13')]['message']);return _0x911831(_0x318042[_0x1f1d('0x13')][_0x1f1d('0x16')]);}logger[_0x1f1d('0x13')](_0x1f1d('0x15'),_0x572570,_0x318042[_0x1f1d('0x13')]['message']);return _0x1d45e7(_0x318042[_0x1f1d('0x13')]['message']);}else{logger[_0x1f1d('0xf')](_0x1f1d('0x15'),_0x572570,_0x1f1d('0x10'));_0x1d45e7(_0x318042[_0x1f1d('0x17')]['message']);}})[_0x1f1d('0x18')](function(_0x40937c){logger['error'](_0x1f1d('0x15'),_0x572570,_0x40937c);_0x911831(_0x40937c);});});}
\ No newline at end of file
index 174d0ea..f2d17a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf409=['length','./cmList.events','save','remove','update','emit'];(function(_0x1ecb80,_0x2d11eb){var _0x3ecc7=function(_0x2a0bb1){while(--_0x2a0bb1){_0x1ecb80['push'](_0x1ecb80['shift']());}};_0x3ecc7(++_0x2d11eb);}(_0xf409,0x1cf));var _0x9f40=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0xf409[_0x28d18d];return _0x470640;};'use strict';var CmListEvents=require(_0x9f40('0x0'));var events=[_0x9f40('0x1'),_0x9f40('0x2'),_0x9f40('0x3')];function createListener(_0x24f243,_0x303fc4){return function(_0x18da4f){_0x303fc4[_0x9f40('0x4')](_0x24f243,_0x18da4f);};}function removeListener(_0x491473,_0x4c1655){return function(){CmListEvents['removeListener'](_0x491473,_0x4c1655);};}exports['register']=function(_0x5d1e64){for(var _0x283e88=0x0,_0x355739=events[_0x9f40('0x5')];_0x283e88<_0x355739;_0x283e88++){var _0x16f95f=events[_0x283e88];var _0xcaf58=createListener('cmList:'+_0x16f95f,_0x5d1e64);CmListEvents['on'](_0x16f95f,_0xcaf58);}};
\ No newline at end of file
+var _0x70a0=['removeListener','register','cmList:','./cmList.events','remove','update','emit'];(function(_0x5ad18c,_0x340ac2){var _0x23d3bb=function(_0x209b82){while(--_0x209b82){_0x5ad18c['push'](_0x5ad18c['shift']());}};_0x23d3bb(++_0x340ac2);}(_0x70a0,0x7a));var _0x070a=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x70a0[_0x29d915];return _0x160f86;};'use strict';var CmListEvents=require(_0x070a('0x0'));var events=['save',_0x070a('0x1'),_0x070a('0x2')];function createListener(_0x37925b,_0x1c6a15){return function(_0x32ba23){_0x1c6a15[_0x070a('0x3')](_0x37925b,_0x32ba23);};}function removeListener(_0x3b8533,_0x2278ed){return function(){CmListEvents[_0x070a('0x4')](_0x3b8533,_0x2278ed);};}exports[_0x070a('0x5')]=function(_0x4dcbda){for(var _0x3cc31b=0x0,_0x5c9a81=events['length'];_0x3cc31b<_0x5c9a81;_0x3cc31b++){var _0x4a408b=events[_0x3cc31b];var _0x5c2103=createListener(_0x070a('0x6')+_0x4a408b,_0x4dcbda);CmListEvents['on'](_0x4a408b,_0x5c2103);}};
\ No newline at end of file
index 2bd6bb0..acf91f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77b4=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmList.controller','isAuthenticated','index','get','/describe','describe','/:id','getDispositions','/:id/contacts','getContacts','getContactsCsv','/:id/fields','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addContacts','addCustomField','put','update','delete','destroy','removeDispositions','removeAgents'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x77b4,0x15f));var _0x477b=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x77b4[_0x24237f];return _0x48298e;};'use strict';var multer=require(_0x477b('0x0'));var util=require(_0x477b('0x1'));var path=require('path');var timeout=require(_0x477b('0x2'));var express=require(_0x477b('0x3'));var router=express[_0x477b('0x4')]();var fs_extra=require(_0x477b('0x5'));var auth=require(_0x477b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x477b('0x7'));var controller=require(_0x477b('0x8'));router['get']('/',auth[_0x477b('0x9')](),controller[_0x477b('0xa')]);router[_0x477b('0xb')](_0x477b('0xc'),auth[_0x477b('0x9')](),controller[_0x477b('0xd')]);router[_0x477b('0xb')](_0x477b('0xe'),auth[_0x477b('0x9')](),controller['show']);router[_0x477b('0xb')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x477b('0xf')]);router['get'](_0x477b('0x10'),auth[_0x477b('0x9')](),controller[_0x477b('0x11')]);router[_0x477b('0xb')]('/:id/contacts/csv',auth[_0x477b('0x9')](),controller[_0x477b('0x12')]);router[_0x477b('0xb')](_0x477b('0x13'),auth['isAuthenticated'](),controller['getCustomFields']);router[_0x477b('0xb')](_0x477b('0x14'),auth[_0x477b('0x9')](),controller[_0x477b('0x15')]);router[_0x477b('0x16')]('/',auth['isAuthenticated'](),controller[_0x477b('0x17')]);router[_0x477b('0x16')](_0x477b('0x18'),auth[_0x477b('0x9')](),controller[_0x477b('0x19')]);router[_0x477b('0x16')](_0x477b('0x10'),auth[_0x477b('0x9')](),controller[_0x477b('0x1a')]);router[_0x477b('0x16')]('/:id/fields',auth[_0x477b('0x9')](),controller[_0x477b('0x1b')]);router[_0x477b('0x16')](_0x477b('0x14'),auth[_0x477b('0x9')](),controller['addAgents']);router[_0x477b('0x1c')](_0x477b('0xe'),auth[_0x477b('0x9')](),controller[_0x477b('0x1d')]);router[_0x477b('0x1e')](_0x477b('0xe'),auth['isAuthenticated'](),controller[_0x477b('0x1f')]);router['delete']('/:id/dispositions',auth[_0x477b('0x9')](),controller[_0x477b('0x20')]);router[_0x477b('0x1e')](_0x477b('0x14'),auth['isAuthenticated'](),controller[_0x477b('0x21')]);module[_0x477b('0x22')]=router;
\ No newline at end of file
+var _0x67b3=['removeAgents','exports','multer','fs-extra','../../components/interaction/service','./cmList.controller','get','index','isAuthenticated','describe','/:id','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getAgents','post','addDisposition','addContacts','addCustomField','/:id/users','addAgents','put','update','delete','destroy','removeDispositions'];(function(_0x173aca,_0x4cfe9f){var _0x5dbf81=function(_0x10c012){while(--_0x10c012){_0x173aca['push'](_0x173aca['shift']());}};_0x5dbf81(++_0x4cfe9f);}(_0x67b3,0x98));var _0x367b=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x67b3[_0x1f36bb];return _0xaf97fa;};'use strict';var multer=require(_0x367b('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x367b('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x367b('0x2'));var config=require('../../config/environment');var controller=require(_0x367b('0x3'));router[_0x367b('0x4')]('/',auth['isAuthenticated'](),controller[_0x367b('0x5')]);router[_0x367b('0x4')]('/describe',auth[_0x367b('0x6')](),controller[_0x367b('0x7')]);router[_0x367b('0x4')](_0x367b('0x8'),auth[_0x367b('0x6')](),controller['show']);router[_0x367b('0x4')](_0x367b('0x9'),auth[_0x367b('0x6')](),controller[_0x367b('0xa')]);router['get'](_0x367b('0xb'),auth[_0x367b('0x6')](),controller[_0x367b('0xc')]);router[_0x367b('0x4')](_0x367b('0xd'),auth[_0x367b('0x6')](),controller[_0x367b('0xe')]);router['get'](_0x367b('0xf'),auth[_0x367b('0x6')](),controller['getCustomFields']);router['get']('/:id/users',auth[_0x367b('0x6')](),controller[_0x367b('0x10')]);router[_0x367b('0x11')]('/',auth[_0x367b('0x6')](),controller['create']);router[_0x367b('0x11')]('/:id/dispositions',auth[_0x367b('0x6')](),controller[_0x367b('0x12')]);router[_0x367b('0x11')]('/:id/contacts',auth[_0x367b('0x6')](),controller[_0x367b('0x13')]);router['post'](_0x367b('0xf'),auth[_0x367b('0x6')](),controller[_0x367b('0x14')]);router[_0x367b('0x11')](_0x367b('0x15'),auth[_0x367b('0x6')](),controller[_0x367b('0x16')]);router[_0x367b('0x17')]('/:id',auth[_0x367b('0x6')](),controller[_0x367b('0x18')]);router[_0x367b('0x19')](_0x367b('0x8'),auth[_0x367b('0x6')](),controller[_0x367b('0x1a')]);router[_0x367b('0x19')](_0x367b('0x9'),auth[_0x367b('0x6')](),controller[_0x367b('0x1b')]);router['delete'](_0x367b('0x15'),auth[_0x367b('0x6')](),controller[_0x367b('0x1c')]);module[_0x367b('0x1d')]=router;
\ No newline at end of file
index 7cdb065..a4da964 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fa6=['STRING','sequelize','getDataValue','field'];(function(_0x2703e1,_0x5c73fd){var _0x1b9789=function(_0x1ec8cb){while(--_0x1ec8cb){_0x2703e1['push'](_0x2703e1['shift']());}};_0x1b9789(++_0x5c73fd);}(_0x0fa6,0x119));var _0x60fa=function(_0x2dae1f,_0x1e28f3){_0x2dae1f=_0x2dae1f-0x0;var _0x55ad23=_0x0fa6[_0x2dae1f];return _0x55ad23;};'use strict';var Sequelize=require(_0x60fa('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4095af){return this[_0x60fa('0x1')](_0x60fa('0x2'));}},'field':{'type':Sequelize[_0x60fa('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0x60fa('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0x60fa('0x3')],'allowNull':![]}};
\ No newline at end of file
+var _0x8460=['field','STRING','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x462945,_0x16d80d){var _0x294c0c=function(_0x1351ca){while(--_0x1351ca){_0x462945['push'](_0x462945['shift']());}};_0x294c0c(++_0x16d80d);}(_0x8460,0x1e2));var _0x0846=function(_0xf3a64b,_0x5bf08e){_0xf3a64b=_0xf3a64b-0x0;var _0x211ea6=_0x8460[_0xf3a64b];return _0x211ea6;};'use strict';var Sequelize=require(_0x0846('0x0'));module[_0x0846('0x1')]={'name':{'type':Sequelize[_0x0846('0x2')],'get':function(_0x59220f){return this[_0x0846('0x3')](_0x0846('0x4'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x0846('0x5')],'allowNull':![]},'value':{'type':Sequelize[_0x0846('0x5')],'allowNull':![]}};
\ No newline at end of file
index cd372d5..7fcae5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x23185b,_0x11b951){var _0x769759=function(_0x5348bd){while(--_0x5348bd){_0x23185b['push'](_0x23185b['shift']());}};_0x769759(++_0x11b951);}(_0x7a54,0x106));var _0x47a5=function(_0x20959f,_0x2426ec){_0x20959f=_0x20959f-0x0;var _0xa641e4=_0x7a54[_0x20959f];return _0xa641e4;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));};
\ No newline at end of file
+var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x3e8a99,_0x203ca9){var _0x379fd2=function(_0x4df5ee){while(--_0x4df5ee){_0x3e8a99['push'](_0x3e8a99['shift']());}};_0x379fd2(++_0x203ca9);}(_0x7a54,0x106));var _0x47a5=function(_0xb34a57,_0x58e3b2){_0xb34a57=_0xb34a57-0x0;var _0x46a7fe=_0x7a54[_0xb34a57];return _0x46a7fe;};'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 8211974..f22353b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08df=['Condition','tools_conditions','lodash','util','moment','request-promise','path','rimraf','./condition.attributes','define'];(function(_0x241eb9,_0x5ccc3f){var _0x4f916b=function(_0x412d98){while(--_0x412d98){_0x241eb9['push'](_0x241eb9['shift']());}};_0x4f916b(++_0x5ccc3f);}(_0x08df,0x1c4));var _0xf08d=function(_0x506d83,_0x1899e9){_0x506d83=_0x506d83-0x0;var _0x335e8b=_0x08df[_0x506d83];return _0x335e8b;};'use strict';var _=require(_0xf08d('0x0'));var util=require(_0xf08d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf08d('0x2'));var BPromise=require('bluebird');var rp=require(_0xf08d('0x3'));var fs=require('fs');var path=require(_0xf08d('0x4'));var rimraf=require(_0xf08d('0x5'));var config=require('../../config/environment');var attributes=require(_0xf08d('0x6'));module['exports']=function(_0x115351,_0x47f9a2){return _0x115351[_0xf08d('0x7')](_0xf08d('0x8'),attributes,{'tableName':_0xf08d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcfd0=['../../config/logger','bluebird','rimraf','../../config/environment','exports','define','Condition','tools_conditions','util'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xcfd0,0x194));var _0x0cfd=function(_0x4746cb,_0x4a966e){_0x4746cb=_0x4746cb-0x0;var _0x1caeeb=_0xcfd0[_0x4746cb];return _0x1caeeb;};'use strict';var _=require('lodash');var util=require(_0x0cfd('0x0'));var logger=require(_0x0cfd('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0cfd('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0cfd('0x3'));var config=require(_0x0cfd('0x4'));var attributes=require('./condition.attributes');module[_0x0cfd('0x5')]=function(_0xc05a12,_0x1b9f05){return _0xc05a12[_0x0cfd('0x6')](_0x0cfd('0x7'),attributes,{'tableName':_0x0cfd('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8dc87ce..6786729 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b79=['http','request','then','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0x0b79,0x113));var _0x90b7=function(_0x21a094,_0x2fd82f){_0x21a094=_0x21a094-0x0;var _0x308898=_0x0b79[_0x21a094];return _0x308898;};'use strict';var _=require(_0x90b7('0x0'));var util=require(_0x90b7('0x1'));var moment=require(_0x90b7('0x2'));var BPromise=require(_0x90b7('0x3'));var rs=require(_0x90b7('0x4'));var fs=require('fs');var Redis=require(_0x90b7('0x5'));var db=require(_0x90b7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x90b7('0x7'))(_0x90b7('0x8'));var config=require(_0x90b7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x90b7('0xa')][_0x90b7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52bbb1,_0x49ced7,_0x2fa2a1){return new BPromise(function(_0x25d7f5,_0x43e8b){return client[_0x90b7('0xc')](_0x52bbb1,_0x2fa2a1)[_0x90b7('0xd')](function(_0x3b8935){logger['info'](_0x90b7('0xe'),_0x49ced7,_0x90b7('0xf'));logger['debug'](_0x90b7('0x10'),_0x49ced7,_0x90b7('0xf'),JSON[_0x90b7('0x11')](_0x3b8935));if(_0x3b8935[_0x90b7('0x12')]){if(_0x3b8935[_0x90b7('0x12')]['code']===0x1f4){logger['error'](_0x90b7('0xe'),_0x49ced7,_0x3b8935[_0x90b7('0x12')][_0x90b7('0x13')]);return _0x43e8b(_0x3b8935['error']['message']);}logger[_0x90b7('0x12')](_0x90b7('0xe'),_0x49ced7,_0x3b8935[_0x90b7('0x12')][_0x90b7('0x13')]);return _0x25d7f5(_0x3b8935['error'][_0x90b7('0x13')]);}else{logger[_0x90b7('0x14')](_0x90b7('0xe'),_0x49ced7,_0x90b7('0xf'));_0x25d7f5(_0x3b8935['result'][_0x90b7('0x13')]);}})[_0x90b7('0x15')](function(_0x22b8c7){logger[_0x90b7('0x12')]('Condition,\x20%s,\x20%s',_0x49ced7,_0x22b8c7);_0x43e8b(_0x22b8c7);});});}
\ No newline at end of file
+var _0x1b9c=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','Condition,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1fa136,_0x4cc0a4){var _0x3ac511=function(_0x54f9fe){while(--_0x54f9fe){_0x1fa136['push'](_0x1fa136['shift']());}};_0x3ac511(++_0x4cc0a4);}(_0x1b9c,0x7d));var _0xc1b9=function(_0x3cc88d,_0x3aa2b1){_0x3cc88d=_0x3cc88d-0x0;var _0xccc83=_0x1b9c[_0x3cc88d];return _0xccc83;};'use strict';var _=require(_0xc1b9('0x0'));var util=require(_0xc1b9('0x1'));var moment=require(_0xc1b9('0x2'));var BPromise=require(_0xc1b9('0x3'));var rs=require(_0xc1b9('0x4'));var fs=require('fs');var Redis=require(_0xc1b9('0x5'));var db=require(_0xc1b9('0x6'))['db'];var utils=require(_0xc1b9('0x7'));var logger=require(_0xc1b9('0x8'))(_0xc1b9('0x9'));var config=require(_0xc1b9('0xa'));var jayson=require(_0xc1b9('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3649fc,_0x52c059,_0xca3e4f){return new BPromise(function(_0x315be2,_0x4449f0){return client[_0xc1b9('0xc')](_0x3649fc,_0xca3e4f)[_0xc1b9('0xd')](function(_0xc746e9){logger['info'](_0xc1b9('0xe'),_0x52c059,_0xc1b9('0xf'));logger['debug']('Condition,\x20%s,\x20%s,\x20%s',_0x52c059,_0xc1b9('0xf'),JSON[_0xc1b9('0x10')](_0xc746e9));if(_0xc746e9[_0xc1b9('0x11')]){if(_0xc746e9[_0xc1b9('0x11')][_0xc1b9('0x12')]===0x1f4){logger[_0xc1b9('0x11')](_0xc1b9('0xe'),_0x52c059,_0xc746e9[_0xc1b9('0x11')][_0xc1b9('0x13')]);return _0x4449f0(_0xc746e9[_0xc1b9('0x11')]['message']);}logger[_0xc1b9('0x11')]('Condition,\x20%s,\x20%s',_0x52c059,_0xc746e9[_0xc1b9('0x11')][_0xc1b9('0x13')]);return _0x315be2(_0xc746e9[_0xc1b9('0x11')][_0xc1b9('0x13')]);}else{logger[_0xc1b9('0x14')](_0xc1b9('0xe'),_0x52c059,_0xc1b9('0xf'));_0x315be2(_0xc746e9[_0xc1b9('0x15')][_0xc1b9('0x13')]);}})['catch'](function(_0x48f734){logger[_0xc1b9('0x11')]('Condition,\x20%s,\x20%s',_0x52c059,_0x48f734);_0x4449f0(_0x48f734);});});}
\ No newline at end of file
index 781ed2f..addc974 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91fa=['./condition.controller','put','isAuthenticated','update','delete','/:id','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x91fa,0xbe));var _0xa91f=function(_0x594670,_0x4b9fdd){_0x594670=_0x594670-0x0;var _0x36a5b7=_0x91fa[_0x594670];return _0x36a5b7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa91f('0x0'));var timeout=require(_0xa91f('0x1'));var express=require(_0xa91f('0x2'));var router=express['Router']();var fs_extra=require(_0xa91f('0x3'));var auth=require(_0xa91f('0x4'));var interaction=require(_0xa91f('0x5'));var config=require('../../config/environment');var controller=require(_0xa91f('0x6'));router[_0xa91f('0x7')]('/:id',auth[_0xa91f('0x8')](),controller[_0xa91f('0x9')]);router[_0xa91f('0xa')](_0xa91f('0xb'),auth[_0xa91f('0x8')](),controller[_0xa91f('0xc')]);module[_0xa91f('0xd')]=router;
\ No newline at end of file
+var _0xc232=['isAuthenticated','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./condition.controller'];(function(_0xa62a6b,_0x50f390){var _0x57380b=function(_0x29be07){while(--_0x29be07){_0xa62a6b['push'](_0xa62a6b['shift']());}};_0x57380b(++_0x50f390);}(_0xc232,0x68));var _0x2c23=function(_0x307cad,_0x324113){_0x307cad=_0x307cad-0x0;var _0x416850=_0xc232[_0x307cad];return _0x416850;};'use strict';var multer=require(_0x2c23('0x0'));var util=require(_0x2c23('0x1'));var path=require(_0x2c23('0x2'));var timeout=require(_0x2c23('0x3'));var express=require(_0x2c23('0x4'));var router=express['Router']();var fs_extra=require(_0x2c23('0x5'));var auth=require(_0x2c23('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2c23('0x7'));router['put']('/:id',auth[_0x2c23('0x8')](),controller[_0x2c23('0x9')]);router[_0x2c23('0xa')](_0x2c23('0xb'),auth[_0x2c23('0x8')](),controller[_0x2c23('0xc')]);module[_0x2c23('0xd')]=router;
\ No newline at end of file
index 540393d..1946417 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757a=['exports','STRING'];(function(_0x3c84e5,_0x412c4a){var _0x4dd2e9=function(_0x1f6ed6){while(--_0x1f6ed6){_0x3c84e5['push'](_0x3c84e5['shift']());}};_0x4dd2e9(++_0x412c4a);}(_0x757a,0xde));var _0xa757=function(_0x14597,_0x152ce9){_0x14597=_0x14597-0x0;var _0x5dbdbf=_0x757a[_0x14597];return _0x5dbdbf;};'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 _0x757a=['exports','STRING'];(function(_0x1e08f8,_0x40723d){var _0x9c34d=function(_0x5db273){while(--_0x5db273){_0x1e08f8['push'](_0x1e08f8['shift']());}};_0x9c34d(++_0x40723d);}(_0x757a,0xde));var _0xa757=function(_0x1c5343,_0x2e725a){_0x1c5343=_0x1c5343-0x0;var _0x5042ff=_0x757a[_0x1c5343];return _0x5042ff;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index b16366e..f2469d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4445=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','get','CustomDashboards','error','stack','name','send','map','Dashboard','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','params','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','autoAssociation','update','iframe','attrs','attrPath','clock','attrHourFormat','value','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','findOne','pick','getItems','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service'];(function(_0x904143,_0x21f98b){var _0x5f3481=function(_0x4b6d50){while(--_0x4b6d50){_0x904143['push'](_0x904143['shift']());}};_0x5f3481(++_0x21f98b);}(_0x4445,0x1c7));var _0x5444=function(_0x33a694,_0x9b6640){_0x33a694=_0x33a694-0x0;var _0x41ff01=_0x4445[_0x33a694];return _0x41ff01;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5444('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5444('0x1'));var moment=require(_0x5444('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5444('0x3'));var util=require('util');var path=require(_0x5444('0x4'));var sox=require('sox');var csv=require(_0x5444('0x5'));var ejs=require(_0x5444('0x6'));var fs=require('fs');var fs_extra=require(_0x5444('0x7'));var _=require(_0x5444('0x8'));var squel=require(_0x5444('0x9'));var crypto=require(_0x5444('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5444('0x5'));var querystring=require(_0x5444('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5444('0xc'));var qs=require(_0x5444('0xd'));var as=require(_0x5444('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5444('0xf'))(_0x5444('0x10'));var utils=require(_0x5444('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5444('0x12'))['db'];config[_0x5444('0x13')]=_[_0x5444('0x14')](config[_0x5444('0x13')],{'host':_0x5444('0x15'),'port':0x18eb});var socket=require(_0x5444('0x16'))(new Redis(config[_0x5444('0x13')]));require(_0x5444('0x17'))[_0x5444('0x18')](socket);function respondWithStatusCode(_0x3dd579,_0x374924){_0x374924=_0x374924||0xcc;return function(_0x29f471){if(_0x29f471){return _0x3dd579[_0x5444('0x19')](_0x374924);}return _0x3dd579['status'](_0x374924)[_0x5444('0x1a')]();};}function respondWithResult(_0x47c02e,_0x27a360){_0x27a360=_0x27a360||0xc8;return function(_0x324471){if(_0x324471){return _0x47c02e[_0x5444('0x1b')](_0x27a360)[_0x5444('0x1c')](_0x324471);}};}function respondWithFilteredResult(_0x163e03,_0x167268){return function(_0xbeb9a7){if(_0xbeb9a7){var _0x1323bd=typeof _0x167268[_0x5444('0x1d')]===_0x5444('0x1e')&&typeof _0x167268[_0x5444('0x1f')]===_0x5444('0x1e');var _0x1deaa6=_0xbeb9a7[_0x5444('0x20')];var _0x8bc50a=_0x1323bd?0x0:_0x167268[_0x5444('0x1d')];var _0x5a5f81=_0x1323bd?_0xbeb9a7[_0x5444('0x20')]:_0x167268['offset']+_0x167268[_0x5444('0x1f')];var _0x533468;if(_0x5a5f81>=_0x1deaa6){_0x5a5f81=_0x1deaa6;_0x533468=0xc8;}else{_0x533468=0xce;}_0x163e03[_0x5444('0x1b')](_0x533468);return _0x163e03['set'](_0x5444('0x21'),_0x8bc50a+'-'+_0x5a5f81+'/'+_0x1deaa6)[_0x5444('0x1c')](_0xbeb9a7);}return null;};}function patchUpdates(_0x377525){return function(_0x4d094c){try{jsonpatch[_0x5444('0x22')](_0x4d094c,_0x377525,!![]);}catch(_0x577d40){return BPromise[_0x5444('0x23')](_0x577d40);}return _0x4d094c['save']();};}function saveUpdates(_0x26944c,_0x465019){return function(_0x4c0279){if(_0x4c0279){return _0x4c0279['update'](_0x26944c)[_0x5444('0x24')](function(_0x295f93){return _0x295f93;});}return null;};}function removeEntity(_0x53c9e5,_0x46ab6a){return function(_0x3a46ff){if(_0x3a46ff){return _0x3a46ff[_0x5444('0x25')]()[_0x5444('0x24')](function(){var _0x3e8b8e=_0x3a46ff[_0x5444('0x26')]({'plain':!![]});var _0x861544=_0x5444('0x27');return db['UserProfileResource'][_0x5444('0x25')]({'where':{'type':_0x861544,'resourceId':_0x3e8b8e['id']}})['then'](function(){return _0x3a46ff;});})['then'](function(){_0x53c9e5[_0x5444('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2271e2,_0x3e7e8b){return function(_0x3d1c95){if(!_0x3d1c95){_0x2271e2[_0x5444('0x19')](0x194);}return _0x3d1c95;};}function handleError(_0x2f6550,_0x9f7db9){_0x9f7db9=_0x9f7db9||0x1f4;return function(_0x15c867){logger[_0x5444('0x28')](_0x15c867[_0x5444('0x29')]);if(_0x15c867[_0x5444('0x2a')]){delete _0x15c867[_0x5444('0x2a')];}_0x2f6550[_0x5444('0x1b')](_0x9f7db9)[_0x5444('0x2b')](_0x15c867);};}exports['index']=function(_0x13901c,_0x5e1bde){var _0x33d7dd={},_0x2152d3={},_0x3cdb06={'count':0x0,'rows':[]};var _0x4aa457=_[_0x5444('0x2c')](db[_0x5444('0x2d')][_0x5444('0x2e')],function(_0x876422){return{'name':_0x876422['fieldName'],'type':_0x876422[_0x5444('0x2f')][_0x5444('0x30')]};});_0x2152d3[_0x5444('0x31')]=_['map'](_0x4aa457,_0x5444('0x2a'));_0x2152d3[_0x5444('0x32')]=_[_0x5444('0x33')](_0x13901c[_0x5444('0x32')]);_0x2152d3[_0x5444('0x34')]=_[_0x5444('0x35')](_0x2152d3['model'],_0x2152d3[_0x5444('0x32')]);_0x33d7dd['attributes']=_['intersection'](_0x2152d3[_0x5444('0x31')],qs['fields'](_0x13901c[_0x5444('0x32')][_0x5444('0x36')]));_0x33d7dd[_0x5444('0x37')]=_0x33d7dd['attributes'][_0x5444('0x38')]?_0x33d7dd[_0x5444('0x37')]:_0x2152d3[_0x5444('0x31')];if(!_0x13901c[_0x5444('0x32')][_0x5444('0x39')](_0x5444('0x3a'))){_0x33d7dd[_0x5444('0x1f')]=qs[_0x5444('0x1f')](_0x13901c[_0x5444('0x32')][_0x5444('0x1f')]);_0x33d7dd[_0x5444('0x1d')]=qs[_0x5444('0x1d')](_0x13901c[_0x5444('0x32')]['offset']);}_0x33d7dd[_0x5444('0x3b')]=qs[_0x5444('0x3c')](_0x13901c[_0x5444('0x32')][_0x5444('0x3c')]);_0x33d7dd[_0x5444('0x3d')]=qs[_0x5444('0x34')](_['pick'](_0x13901c[_0x5444('0x32')],_0x2152d3['filters']),_0x4aa457);if(_0x13901c[_0x5444('0x32')][_0x5444('0x3e')]){_0x33d7dd[_0x5444('0x3d')]=_[_0x5444('0x3f')](_0x33d7dd['where'],{'$or':_[_0x5444('0x2c')](_0x4aa457,function(_0x1bab3d){if(_0x1bab3d['type']!=='VIRTUAL'){var _0x501e5c={};_0x501e5c[_0x1bab3d[_0x5444('0x2a')]]={'$like':'%'+_0x13901c[_0x5444('0x32')][_0x5444('0x3e')]+'%'};return _0x501e5c;}})});}_0x33d7dd=_[_0x5444('0x3f')]({},_0x33d7dd,_0x13901c[_0x5444('0x40')]);var _0xbd8afb={'where':_0x33d7dd[_0x5444('0x3d')]};return db[_0x5444('0x2d')][_0x5444('0x20')](_0xbd8afb)['then'](function(_0x45de1d){_0x3cdb06[_0x5444('0x20')]=_0x45de1d;if(_0x13901c[_0x5444('0x32')][_0x5444('0x41')]){_0x33d7dd[_0x5444('0x42')]=[{'all':!![]}];}return db['Dashboard'][_0x5444('0x43')](_0x33d7dd);})[_0x5444('0x24')](function(_0x597869){_0x3cdb06[_0x5444('0x44')]=_0x597869;return _0x3cdb06;})[_0x5444('0x24')](respondWithFilteredResult(_0x5e1bde,_0x33d7dd))['catch'](handleError(_0x5e1bde,null));};exports['show']=function(_0x3e3a79,_0x3b0c){var _0x116296={'raw':![],'where':{'id':_0x3e3a79[_0x5444('0x45')]['id']}},_0x53f23d={};_0x53f23d[_0x5444('0x31')]=_['keys'](db[_0x5444('0x2d')]['rawAttributes']);_0x53f23d[_0x5444('0x32')]=_[_0x5444('0x33')](_0x3e3a79[_0x5444('0x32')]);_0x53f23d[_0x5444('0x34')]=_[_0x5444('0x35')](_0x53f23d[_0x5444('0x31')],_0x53f23d[_0x5444('0x32')]);_0x116296[_0x5444('0x37')]=_['intersection'](_0x53f23d['model'],qs[_0x5444('0x36')](_0x3e3a79['query'][_0x5444('0x36')]));_0x116296[_0x5444('0x37')]=_0x116296['attributes']['length']?_0x116296[_0x5444('0x37')]:_0x53f23d[_0x5444('0x31')];if(_0x3e3a79[_0x5444('0x32')][_0x5444('0x41')]){_0x116296['include']=[{'all':!![]}];}_0x116296=_[_0x5444('0x3f')]({},_0x116296,_0x3e3a79['options']);return db['Dashboard']['find'](_0x116296)[_0x5444('0x24')](handleEntityNotFound(_0x3b0c,null))['then'](respondWithResult(_0x3b0c,null))[_0x5444('0x46')](handleError(_0x3b0c,null));};exports[_0x5444('0x47')]=function(_0x1b6804,_0x33cefc){return db[_0x5444('0x2d')]['create'](_0x1b6804[_0x5444('0x48')],{})[_0x5444('0x24')](function(_0x4f6142){var _0x427e53=_0x1b6804['user'][_0x5444('0x26')]({'plain':!![]});if(!_0x427e53)throw new Error(_0x5444('0x49'));if(_0x427e53[_0x5444('0x4a')]===_0x5444('0x4b')){var _0x3c1567=_0x4f6142[_0x5444('0x26')]({'plain':!![]});var _0x24c982=_0x5444('0x27');return db[_0x5444('0x4c')][_0x5444('0x4d')]({'where':{'name':_0x24c982,'userProfileId':_0x427e53[_0x5444('0x4e')]},'raw':!![]})[_0x5444('0x24')](function(_0x5155f9){if(_0x5155f9&&_0x5155f9['autoAssociation']===0x0){return db[_0x5444('0x4f')][_0x5444('0x47')]({'name':_0x3c1567[_0x5444('0x2a')],'resourceId':_0x3c1567['id'],'type':_0x5155f9['name'],'sectionId':_0x5155f9['id']},{})['then'](function(){return _0x4f6142;});}else{return _0x4f6142;}})['catch'](function(_0x22334e){logger['error'](_0x5444('0x50'),_0x22334e);throw _0x22334e;});}return _0x4f6142;})[_0x5444('0x24')](respondWithResult(_0x33cefc,0xc9))[_0x5444('0x46')](handleError(_0x33cefc,null));};exports[_0x5444('0x51')]=function(_0x4594c1,_0x27cff7){var _0x347cfa={'where':{'id':_0x4594c1[_0x5444('0x45')]['id']}},_0x2fe29d={};_0x2fe29d[_0x5444('0x31')]=_[_0x5444('0x33')](db['Dashboard']['rawAttributes']);_0x347cfa[_0x5444('0x37')]=_[_0x5444('0x35')](_0x2fe29d[_0x5444('0x31')],qs[_0x5444('0x36')](_0x4594c1['query'][_0x5444('0x36')]));_0x347cfa['attributes']=_0x347cfa['attributes'][_0x5444('0x38')]?_0x347cfa[_0x5444('0x37')]:_0x2fe29d[_0x5444('0x31')];if(_0x4594c1[_0x5444('0x32')]['includeAll']){_0x347cfa[_0x5444('0x42')]=[{'all':!![]}];}_0x347cfa=_[_0x5444('0x3f')]({},_0x347cfa,_0x4594c1[_0x5444('0x40')]);return db[_0x5444('0x2d')]['find'](_0x347cfa)[_0x5444('0x24')](handleEntityNotFound(_0x27cff7,null))['then'](function(_0x162ab5){if(_0x162ab5){var _0x63cca9=_0x162ab5[_0x5444('0x26')]({'plain':!![]});_0x63cca9=qs['omit'](_0x63cca9,['id',_0x5444('0x52'),_0x5444('0x53')]);_0x4594c1[_0x5444('0x48')]=_[_0x5444('0x54')](_0x4594c1[_0x5444('0x48')],['id',_0x5444('0x52'),_0x5444('0x53')]);return db['Dashboard']['create'](_['merge'](_0x63cca9,_0x4594c1[_0x5444('0x48')]),{'include':_0x4594c1[_0x5444('0x32')][_0x5444('0x41')]?[{'all':!![]}]:undefined})[_0x5444('0x24')](function(_0x4a2575){var _0x5198da=_0x4594c1[_0x5444('0x4b')]['get']({'plain':!![]});if(!_0x5198da)throw new Error(_0x5444('0x49'));if(_0x5198da['role']==='user'){var _0x2549bd=_0x4a2575[_0x5444('0x26')]({'plain':!![]});var _0x47f474=_0x5444('0x27');return db[_0x5444('0x4c')]['find']({'where':{'name':_0x47f474,'userProfileId':_0x5198da['userProfileId']},'raw':!![]})['then'](function(_0x2f7dad){if(_0x2f7dad&&_0x2f7dad[_0x5444('0x55')]===0x0){return db[_0x5444('0x4f')]['create']({'name':_0x2549bd[_0x5444('0x2a')],'resourceId':_0x2549bd['id'],'type':_0x2f7dad[_0x5444('0x2a')],'sectionId':_0x2f7dad['id']},{})[_0x5444('0x24')](function(){return _0x4a2575;});}else{return _0x4a2575;}})['catch'](function(_0x3b6551){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b6551);throw _0x3b6551;});}return _0x4a2575;});}})[_0x5444('0x24')](respondWithResult(_0x27cff7,0xc9))[_0x5444('0x46')](handleError(_0x27cff7,null));};exports[_0x5444('0x56')]=function(_0x132188,_0x157767){if(_0x132188['body']['id']){delete _0x132188[_0x5444('0x48')]['id'];}return db[_0x5444('0x2d')]['find']({'where':{'id':_0x132188[_0x5444('0x45')]['id']}})[_0x5444('0x24')](handleEntityNotFound(_0x157767,null))['then'](saveUpdates(_0x132188[_0x5444('0x48')],null))[_0x5444('0x24')](respondWithResult(_0x157767,null))[_0x5444('0x46')](handleError(_0x157767,null));};exports[_0x5444('0x25')]=function(_0x38f938,_0x5e2c1b){return db[_0x5444('0x2d')]['find']({'where':{'id':_0x38f938[_0x5444('0x45')]['id']}})['then'](handleEntityNotFound(_0x5e2c1b,null))[_0x5444('0x24')](removeEntity(_0x5e2c1b,null))['catch'](handleError(_0x5e2c1b,null));};function widgetAttributes(_0x2827ef){try{switch(_0x2827ef[_0x5444('0x2f')]){case _0x5444('0x57'):return[{'name':'attrUrl','value':_0x2827ef['attrUrl']||(_0x2827ef[_0x5444('0x58')]&&_0x2827ef[_0x5444('0x58')][0x0]?_0x2827ef['attrs'][0x0]['value']:undefined)||'https://'}];case'custom':return[{'name':_0x5444('0x59'),'value':_0x2827ef[_0x5444('0x59')]||(_0x2827ef[_0x5444('0x58')]&&_0x2827ef[_0x5444('0x58')][0x0]?_0x2827ef[_0x5444('0x58')][0x0]['value']:undefined)||''}];case _0x5444('0x5a'):return[{'name':_0x5444('0x5b'),'value':_0x2827ef[_0x5444('0x5b')]||(_0x2827ef[_0x5444('0x58')]&&_0x2827ef[_0x5444('0x58')][0x0]?_0x2827ef['attrs'][0x0][_0x5444('0x5c')]:undefined)||_0x5444('0x5d')},{'name':_0x5444('0x5e'),'value':_0x2827ef['attrTimezone']||(_0x2827ef[_0x5444('0x58')]&&_0x2827ef[_0x5444('0x58')][0x1]?_0x2827ef['attrs'][0x1][_0x5444('0x5c')]:undefined)||_0x5444('0x5f')},{'name':_0x5444('0x60'),'value':_0x2827ef[_0x5444('0x60')]||(_0x2827ef[_0x5444('0x58')]&&_0x2827ef[_0x5444('0x58')][0x2]?_0x2827ef[_0x5444('0x58')][0x2][_0x5444('0x5c')]:undefined)||0xc}];case _0x5444('0x61'):return[{'name':'attrMetric','value':_0x2827ef[_0x5444('0x62')]||(_0x2827ef[_0x5444('0x58')]&&_0x2827ef[_0x5444('0x58')][0x0]?_0x2827ef[_0x5444('0x58')][0x0][_0x5444('0x5c')]:undefined)||_0x5444('0x63')},{'name':'attrVoiceQueues','value':_0x2827ef[_0x5444('0x64')]||(_0x2827ef[_0x5444('0x58')]&&_0x2827ef[_0x5444('0x58')][0x1]?_0x2827ef[_0x5444('0x58')][0x1][_0x5444('0x5c')]:undefined)||[]},{'name':_0x5444('0x60'),'value':_0x2827ef[_0x5444('0x60')]||(_0x2827ef[_0x5444('0x58')]&&_0x2827ef[_0x5444('0x58')][0x2]?_0x2827ef[_0x5444('0x58')][0x2][_0x5444('0x5c')]:undefined)||0x14}];case _0x5444('0x65'):case _0x5444('0x66'):return[{'name':_0x5444('0x67'),'value':_0x2827ef[_0x5444('0x67')]||(_0x2827ef[_0x5444('0x58')]&&_0x2827ef[_0x5444('0x58')][0x0]?_0x2827ef[_0x5444('0x58')][0x0]['value']:undefined)||_0x5444('0x63')},{'name':_0x5444('0x68'),'value':_0x2827ef[_0x5444('0x68')]||(_0x2827ef[_0x5444('0x58')]&&_0x2827ef[_0x5444('0x58')][0x1]?_0x2827ef[_0x5444('0x58')][0x1][_0x5444('0x5c')]:undefined)||null},{'name':_0x5444('0x69'),'value':_0x2827ef[_0x5444('0x69')]||(_0x2827ef['attrs']&&_0x2827ef[_0x5444('0x58')][0x2]?_0x2827ef[_0x5444('0x58')][0x2][_0x5444('0x5c')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x2827ef[_0x5444('0x64')]||(_0x2827ef[_0x5444('0x58')]&&_0x2827ef[_0x5444('0x58')][0x3]?_0x2827ef[_0x5444('0x58')][0x3][_0x5444('0x5c')]:undefined)||[]}];case _0x5444('0x6a'):return[{'name':_0x5444('0x6b'),'type':_0x2827ef[_0x5444('0x6c')]||(_0x2827ef[_0x5444('0x58')]&&_0x2827ef[_0x5444('0x58')][0x0]?_0x2827ef['attrs'][0x0][_0x5444('0x2f')]:undefined)||null,'value':_0x2827ef['attrReport']||(_0x2827ef[_0x5444('0x58')]&&_0x2827ef[_0x5444('0x58')][0x0]?_0x2827ef[_0x5444('0x58')][0x0][_0x5444('0x5c')]:undefined)||null},{'name':_0x5444('0x6d'),'value':_0x2827ef[_0x5444('0x6d')]||(_0x2827ef['attrs']&&_0x2827ef[_0x5444('0x58')][0x1]?_0x2827ef[_0x5444('0x58')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x26232d){logger['error'](_0x5444('0x6e'),JSON['stringify'](_0x26232d));return[];}}exports[_0x5444('0x6f')]=function(_0x243012,_0x183a61,_0x34194d){if(_0x243012['body']['id']){delete _0x243012[_0x5444('0x48')]['id'];}return db['Dashboard']['find']({'where':{'id':_0x243012[_0x5444('0x45')]['id']}})[_0x5444('0x24')](handleEntityNotFound(_0x183a61,null))[_0x5444('0x24')](function(_0x20d5cd){if(_0x20d5cd){_0x243012['body'][_0x5444('0x70')]=_0x20d5cd['id'];_0x243012[_0x5444('0x48')][_0x5444('0x58')]=widgetAttributes(_0x243012[_0x5444('0x48')]);return db[_0x5444('0x71')][_0x5444('0x47')](_0x243012['body']);}})[_0x5444('0x24')](respondWithResult(_0x183a61,null))[_0x5444('0x46')](handleError(_0x183a61,null));};exports['getItems']=function(_0x38f5f8,_0x41e31c,_0x5d4d87){var _0x4a6a17={};var _0x10ed39={};var _0x13173a;var _0x5201a7;return db[_0x5444('0x2d')][_0x5444('0x72')]({'where':{'id':_0x38f5f8[_0x5444('0x45')]['id']}})[_0x5444('0x24')](handleEntityNotFound(_0x41e31c,null))[_0x5444('0x24')](function(_0x3f9120){if(_0x3f9120){_0x13173a=_0x3f9120;_0x10ed39['model']=_[_0x5444('0x33')](db[_0x5444('0x71')][_0x5444('0x2e')]);_0x10ed39[_0x5444('0x32')]=_[_0x5444('0x33')](_0x38f5f8[_0x5444('0x32')]);_0x10ed39[_0x5444('0x34')]=_['intersection'](_0x10ed39['model'],_0x10ed39[_0x5444('0x32')]);_0x4a6a17[_0x5444('0x37')]=_['intersection'](_0x10ed39['model'],qs[_0x5444('0x36')](_0x38f5f8[_0x5444('0x32')][_0x5444('0x36')]));_0x4a6a17['attributes']=_0x4a6a17['attributes'][_0x5444('0x38')]?_0x4a6a17[_0x5444('0x37')]:_0x10ed39['model'];_0x4a6a17['order']=qs['sort'](_0x38f5f8[_0x5444('0x32')][_0x5444('0x3c')]);_0x4a6a17[_0x5444('0x3d')]=qs[_0x5444('0x34')](_[_0x5444('0x73')](_0x38f5f8['query'],_0x10ed39[_0x5444('0x34')]));if(_0x38f5f8['query'][_0x5444('0x3e')]){_0x4a6a17[_0x5444('0x3d')]=_[_0x5444('0x3f')](_0x4a6a17[_0x5444('0x3d')],{'$or':_[_0x5444('0x2c')](_0x4a6a17[_0x5444('0x37')],function(_0x4d92c4){var _0x44962c={};_0x44962c[_0x4d92c4]={'$like':'%'+_0x38f5f8[_0x5444('0x32')][_0x5444('0x3e')]+'%'};return _0x44962c;})});}_0x4a6a17=_[_0x5444('0x3f')]({},_0x4a6a17,_0x38f5f8[_0x5444('0x40')]);return _0x13173a[_0x5444('0x74')](_0x4a6a17);}})[_0x5444('0x24')](function(_0x161c09){if(_0x161c09){_0x5201a7=_0x161c09[_0x5444('0x38')];if(!_0x38f5f8[_0x5444('0x32')][_0x5444('0x39')]('nolimit')){_0x4a6a17['limit']=qs[_0x5444('0x1f')](_0x38f5f8['query'][_0x5444('0x1f')]);_0x4a6a17[_0x5444('0x1d')]=qs[_0x5444('0x1d')](_0x38f5f8[_0x5444('0x32')][_0x5444('0x1d')]);}return _0x13173a[_0x5444('0x74')](_0x4a6a17);}})[_0x5444('0x24')](function(_0x5b9180){if(_0x5b9180){return _0x5b9180?{'count':_0x5201a7,'rows':_0x5b9180}:null;}})['then'](respondWithResult(_0x41e31c,null))[_0x5444('0x46')](handleError(_0x41e31c,null));};
\ No newline at end of file
+var _0x03d3=['UserProfileResource','destroy','error','name','map','Dashboard','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','attrUrl','attrs','value','https://','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','getItems','findOne','DashboardItem','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','end','status','undefined','limit','count','offset','json','apply','reject','save','update','then','get','CustomDashboards'];(function(_0x43b569,_0xf390ec){var _0x4bd963=function(_0x3c2c50){while(--_0x3c2c50){_0x43b569['push'](_0x43b569['shift']());}};_0x4bd963(++_0xf390ec);}(_0x03d3,0x1bb));var _0x303d=function(_0x4cfb82,_0x5ef436){_0x4cfb82=_0x4cfb82-0x0;var _0x5ade30=_0x03d3[_0x4cfb82];return _0x5ade30;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x303d('0x0'));var zipdir=require(_0x303d('0x1'));var jsonpatch=require(_0x303d('0x2'));var rp=require(_0x303d('0x3'));var moment=require('moment');var BPromise=require(_0x303d('0x4'));var Mustache=require(_0x303d('0x5'));var util=require(_0x303d('0x6'));var path=require(_0x303d('0x7'));var sox=require('sox');var csv=require(_0x303d('0x8'));var ejs=require(_0x303d('0x9'));var fs=require('fs');var fs_extra=require(_0x303d('0xa'));var _=require('lodash');var squel=require(_0x303d('0xb'));var crypto=require('crypto');var jsforce=require(_0x303d('0xc'));var deskjs=require(_0x303d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x303d('0xe'));var Papa=require(_0x303d('0xf'));var Redis=require(_0x303d('0x10'));var authService=require(_0x303d('0x11'));var qs=require(_0x303d('0x12'));var as=require(_0x303d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x303d('0x14'))(_0x303d('0x15'));var utils=require(_0x303d('0x16'));var config=require(_0x303d('0x17'));var licenseUtil=require(_0x303d('0x18'));var db=require(_0x303d('0x19'))['db'];config[_0x303d('0x1a')]=_[_0x303d('0x1b')](config[_0x303d('0x1a')],{'host':_0x303d('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./dashboard.socket')[_0x303d('0x1d')](socket);function respondWithStatusCode(_0x367f5c,_0x288ea7){_0x288ea7=_0x288ea7||0xcc;return function(_0x947a95){if(_0x947a95){return _0x367f5c[_0x303d('0x1e')](_0x288ea7);}return _0x367f5c['status'](_0x288ea7)[_0x303d('0x1f')]();};}function respondWithResult(_0x5cbc8c,_0x136436){_0x136436=_0x136436||0xc8;return function(_0xfe8ebc){if(_0xfe8ebc){return _0x5cbc8c[_0x303d('0x20')](_0x136436)['json'](_0xfe8ebc);}};}function respondWithFilteredResult(_0x5f4482,_0xe52152){return function(_0x3745fa){if(_0x3745fa){var _0x45e5d2=typeof _0xe52152['offset']===_0x303d('0x21')&&typeof _0xe52152[_0x303d('0x22')]===_0x303d('0x21');var _0x1ca309=_0x3745fa[_0x303d('0x23')];var _0x18877d=_0x45e5d2?0x0:_0xe52152['offset'];var _0x5d9217=_0x45e5d2?_0x3745fa[_0x303d('0x23')]:_0xe52152[_0x303d('0x24')]+_0xe52152['limit'];var _0x2c427b;if(_0x5d9217>=_0x1ca309){_0x5d9217=_0x1ca309;_0x2c427b=0xc8;}else{_0x2c427b=0xce;}_0x5f4482[_0x303d('0x20')](_0x2c427b);return _0x5f4482['set']('Content-Range',_0x18877d+'-'+_0x5d9217+'/'+_0x1ca309)[_0x303d('0x25')](_0x3745fa);}return null;};}function patchUpdates(_0x172a2f){return function(_0x32b350){try{jsonpatch[_0x303d('0x26')](_0x32b350,_0x172a2f,!![]);}catch(_0x265af0){return BPromise[_0x303d('0x27')](_0x265af0);}return _0x32b350[_0x303d('0x28')]();};}function saveUpdates(_0x3c22b2,_0x1ebd8a){return function(_0x12d5d9){if(_0x12d5d9){return _0x12d5d9[_0x303d('0x29')](_0x3c22b2)['then'](function(_0x200c0){return _0x200c0;});}return null;};}function removeEntity(_0x309855,_0x4ab233){return function(_0x12236e){if(_0x12236e){return _0x12236e['destroy']()[_0x303d('0x2a')](function(){var _0xa52e0=_0x12236e[_0x303d('0x2b')]({'plain':!![]});var _0x221478=_0x303d('0x2c');return db[_0x303d('0x2d')][_0x303d('0x2e')]({'where':{'type':_0x221478,'resourceId':_0xa52e0['id']}})[_0x303d('0x2a')](function(){return _0x12236e;});})[_0x303d('0x2a')](function(){_0x309855[_0x303d('0x20')](0xcc)[_0x303d('0x1f')]();});}};}function handleEntityNotFound(_0x52516e,_0x5508eb){return function(_0x542d51){if(!_0x542d51){_0x52516e[_0x303d('0x1e')](0x194);}return _0x542d51;};}function handleError(_0x29f13f,_0x4d675d){_0x4d675d=_0x4d675d||0x1f4;return function(_0x4b8c7f){logger[_0x303d('0x2f')](_0x4b8c7f['stack']);if(_0x4b8c7f['name']){delete _0x4b8c7f[_0x303d('0x30')];}_0x29f13f[_0x303d('0x20')](_0x4d675d)['send'](_0x4b8c7f);};}exports['index']=function(_0x142d11,_0x1d54de){var _0x191fa2={},_0x23f00d={},_0x44259f={'count':0x0,'rows':[]};var _0x1c3801=_[_0x303d('0x31')](db[_0x303d('0x32')][_0x303d('0x33')],function(_0x52def7){return{'name':_0x52def7['fieldName'],'type':_0x52def7[_0x303d('0x34')][_0x303d('0x35')]};});_0x23f00d[_0x303d('0x36')]=_['map'](_0x1c3801,_0x303d('0x30'));_0x23f00d[_0x303d('0x37')]=_[_0x303d('0x38')](_0x142d11['query']);_0x23f00d[_0x303d('0x39')]=_['intersection'](_0x23f00d[_0x303d('0x36')],_0x23f00d['query']);_0x191fa2[_0x303d('0x3a')]=_[_0x303d('0x3b')](_0x23f00d[_0x303d('0x36')],qs[_0x303d('0x3c')](_0x142d11[_0x303d('0x37')]['fields']));_0x191fa2[_0x303d('0x3a')]=_0x191fa2['attributes'][_0x303d('0x3d')]?_0x191fa2[_0x303d('0x3a')]:_0x23f00d[_0x303d('0x36')];if(!_0x142d11[_0x303d('0x37')]['hasOwnProperty'](_0x303d('0x3e'))){_0x191fa2[_0x303d('0x22')]=qs['limit'](_0x142d11[_0x303d('0x37')][_0x303d('0x22')]);_0x191fa2[_0x303d('0x24')]=qs['offset'](_0x142d11[_0x303d('0x37')][_0x303d('0x24')]);}_0x191fa2[_0x303d('0x3f')]=qs[_0x303d('0x40')](_0x142d11['query'][_0x303d('0x40')]);_0x191fa2[_0x303d('0x41')]=qs[_0x303d('0x39')](_[_0x303d('0x42')](_0x142d11['query'],_0x23f00d[_0x303d('0x39')]),_0x1c3801);if(_0x142d11[_0x303d('0x37')][_0x303d('0x43')]){_0x191fa2[_0x303d('0x41')]=_[_0x303d('0x44')](_0x191fa2[_0x303d('0x41')],{'$or':_[_0x303d('0x31')](_0x1c3801,function(_0x2ceb3d){if(_0x2ceb3d['type']!==_0x303d('0x45')){var _0x40612f={};_0x40612f[_0x2ceb3d[_0x303d('0x30')]]={'$like':'%'+_0x142d11[_0x303d('0x37')][_0x303d('0x43')]+'%'};return _0x40612f;}})});}_0x191fa2=_['merge']({},_0x191fa2,_0x142d11[_0x303d('0x46')]);var _0x2a45f5={'where':_0x191fa2[_0x303d('0x41')]};return db[_0x303d('0x32')][_0x303d('0x23')](_0x2a45f5)[_0x303d('0x2a')](function(_0x6e2b41){_0x44259f['count']=_0x6e2b41;if(_0x142d11[_0x303d('0x37')][_0x303d('0x47')]){_0x191fa2[_0x303d('0x48')]=[{'all':!![]}];}return db['Dashboard'][_0x303d('0x49')](_0x191fa2);})[_0x303d('0x2a')](function(_0x28e7ab){_0x44259f[_0x303d('0x4a')]=_0x28e7ab;return _0x44259f;})[_0x303d('0x2a')](respondWithFilteredResult(_0x1d54de,_0x191fa2))['catch'](handleError(_0x1d54de,null));};exports[_0x303d('0x4b')]=function(_0x1c0d17,_0x183ff8){var _0x2d67cf={'raw':![],'where':{'id':_0x1c0d17[_0x303d('0x4c')]['id']}},_0x2c804e={};_0x2c804e[_0x303d('0x36')]=_[_0x303d('0x38')](db[_0x303d('0x32')][_0x303d('0x33')]);_0x2c804e[_0x303d('0x37')]=_[_0x303d('0x38')](_0x1c0d17['query']);_0x2c804e[_0x303d('0x39')]=_['intersection'](_0x2c804e[_0x303d('0x36')],_0x2c804e[_0x303d('0x37')]);_0x2d67cf[_0x303d('0x3a')]=_[_0x303d('0x3b')](_0x2c804e[_0x303d('0x36')],qs[_0x303d('0x3c')](_0x1c0d17[_0x303d('0x37')][_0x303d('0x3c')]));_0x2d67cf[_0x303d('0x3a')]=_0x2d67cf[_0x303d('0x3a')][_0x303d('0x3d')]?_0x2d67cf[_0x303d('0x3a')]:_0x2c804e[_0x303d('0x36')];if(_0x1c0d17[_0x303d('0x37')]['includeAll']){_0x2d67cf[_0x303d('0x48')]=[{'all':!![]}];}_0x2d67cf=_[_0x303d('0x44')]({},_0x2d67cf,_0x1c0d17['options']);return db[_0x303d('0x32')][_0x303d('0x4d')](_0x2d67cf)[_0x303d('0x2a')](handleEntityNotFound(_0x183ff8,null))[_0x303d('0x2a')](respondWithResult(_0x183ff8,null))['catch'](handleError(_0x183ff8,null));};exports[_0x303d('0x4e')]=function(_0x3f1216,_0x48143e){return db[_0x303d('0x32')][_0x303d('0x4e')](_0x3f1216[_0x303d('0x4f')],{})['then'](function(_0x326640){var _0x544a51=_0x3f1216[_0x303d('0x50')][_0x303d('0x2b')]({'plain':!![]});if(!_0x544a51)throw new Error(_0x303d('0x51'));if(_0x544a51[_0x303d('0x52')]==='user'){var _0xe16e67=_0x326640[_0x303d('0x2b')]({'plain':!![]});var _0x2893eb='CustomDashboards';return db[_0x303d('0x53')][_0x303d('0x4d')]({'where':{'name':_0x2893eb,'userProfileId':_0x544a51[_0x303d('0x54')]},'raw':!![]})[_0x303d('0x2a')](function(_0xb838a0){if(_0xb838a0&&_0xb838a0[_0x303d('0x55')]===0x0){return db[_0x303d('0x2d')][_0x303d('0x4e')]({'name':_0xe16e67[_0x303d('0x30')],'resourceId':_0xe16e67['id'],'type':_0xb838a0['name'],'sectionId':_0xb838a0['id']},{})[_0x303d('0x2a')](function(){return _0x326640;});}else{return _0x326640;}})[_0x303d('0x56')](function(_0x249b91){logger[_0x303d('0x2f')](_0x303d('0x57'),_0x249b91);throw _0x249b91;});}return _0x326640;})[_0x303d('0x2a')](respondWithResult(_0x48143e,0xc9))[_0x303d('0x56')](handleError(_0x48143e,null));};exports[_0x303d('0x58')]=function(_0x819185,_0x2aa14){var _0x436724={'where':{'id':_0x819185[_0x303d('0x4c')]['id']}},_0x525f01={};_0x525f01['model']=_[_0x303d('0x38')](db[_0x303d('0x32')][_0x303d('0x33')]);_0x436724[_0x303d('0x3a')]=_[_0x303d('0x3b')](_0x525f01[_0x303d('0x36')],qs[_0x303d('0x3c')](_0x819185[_0x303d('0x37')][_0x303d('0x3c')]));_0x436724[_0x303d('0x3a')]=_0x436724[_0x303d('0x3a')]['length']?_0x436724[_0x303d('0x3a')]:_0x525f01[_0x303d('0x36')];if(_0x819185[_0x303d('0x37')][_0x303d('0x47')]){_0x436724['include']=[{'all':!![]}];}_0x436724=_[_0x303d('0x44')]({},_0x436724,_0x819185[_0x303d('0x46')]);return db[_0x303d('0x32')][_0x303d('0x4d')](_0x436724)[_0x303d('0x2a')](handleEntityNotFound(_0x2aa14,null))[_0x303d('0x2a')](function(_0x5856fb){if(_0x5856fb){var _0x5ed5d1=_0x5856fb[_0x303d('0x2b')]({'plain':!![]});_0x5ed5d1=qs[_0x303d('0x59')](_0x5ed5d1,['id','createdAt',_0x303d('0x5a')]);_0x819185[_0x303d('0x4f')]=_[_0x303d('0x59')](_0x819185[_0x303d('0x4f')],['id',_0x303d('0x5b'),_0x303d('0x5a')]);return db['Dashboard'][_0x303d('0x4e')](_[_0x303d('0x44')](_0x5ed5d1,_0x819185[_0x303d('0x4f')]),{'include':_0x819185[_0x303d('0x37')]['includeAll']?[{'all':!![]}]:undefined})[_0x303d('0x2a')](function(_0x252737){var _0x1e6f94=_0x819185[_0x303d('0x50')][_0x303d('0x2b')]({'plain':!![]});if(!_0x1e6f94)throw new Error(_0x303d('0x51'));if(_0x1e6f94['role']===_0x303d('0x50')){var _0x2d8212=_0x252737[_0x303d('0x2b')]({'plain':!![]});var _0x580457=_0x303d('0x2c');return db['UserProfileSection']['find']({'where':{'name':_0x580457,'userProfileId':_0x1e6f94[_0x303d('0x54')]},'raw':!![]})[_0x303d('0x2a')](function(_0x3e527a){if(_0x3e527a&&_0x3e527a[_0x303d('0x55')]===0x0){return db[_0x303d('0x2d')][_0x303d('0x4e')]({'name':_0x2d8212[_0x303d('0x30')],'resourceId':_0x2d8212['id'],'type':_0x3e527a[_0x303d('0x30')],'sectionId':_0x3e527a['id']},{})[_0x303d('0x2a')](function(){return _0x252737;});}else{return _0x252737;}})['catch'](function(_0x248681){logger[_0x303d('0x2f')](_0x303d('0x57'),_0x248681);throw _0x248681;});}return _0x252737;});}})[_0x303d('0x2a')](respondWithResult(_0x2aa14,0xc9))[_0x303d('0x56')](handleError(_0x2aa14,null));};exports['update']=function(_0x1d48ab,_0x29ac68){if(_0x1d48ab[_0x303d('0x4f')]['id']){delete _0x1d48ab[_0x303d('0x4f')]['id'];}return db[_0x303d('0x32')][_0x303d('0x4d')]({'where':{'id':_0x1d48ab[_0x303d('0x4c')]['id']}})[_0x303d('0x2a')](handleEntityNotFound(_0x29ac68,null))[_0x303d('0x2a')](saveUpdates(_0x1d48ab[_0x303d('0x4f')],null))['then'](respondWithResult(_0x29ac68,null))['catch'](handleError(_0x29ac68,null));};exports[_0x303d('0x2e')]=function(_0x6f4610,_0x51437d){return db[_0x303d('0x32')][_0x303d('0x4d')]({'where':{'id':_0x6f4610['params']['id']}})['then'](handleEntityNotFound(_0x51437d,null))[_0x303d('0x2a')](removeEntity(_0x51437d,null))[_0x303d('0x56')](handleError(_0x51437d,null));};function widgetAttributes(_0x51d85a){try{switch(_0x51d85a[_0x303d('0x34')]){case'iframe':return[{'name':_0x303d('0x5c'),'value':_0x51d85a['attrUrl']||(_0x51d85a[_0x303d('0x5d')]&&_0x51d85a[_0x303d('0x5d')][0x0]?_0x51d85a[_0x303d('0x5d')][0x0][_0x303d('0x5e')]:undefined)||_0x303d('0x5f')}];case'custom':return[{'name':'attrPath','value':_0x51d85a[_0x303d('0x60')]||(_0x51d85a[_0x303d('0x5d')]&&_0x51d85a['attrs'][0x0]?_0x51d85a[_0x303d('0x5d')][0x0][_0x303d('0x5e')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x51d85a[_0x303d('0x61')]||(_0x51d85a['attrs']&&_0x51d85a[_0x303d('0x5d')][0x0]?_0x51d85a[_0x303d('0x5d')][0x0][_0x303d('0x5e')]:undefined)||_0x303d('0x62')},{'name':_0x303d('0x63'),'value':_0x51d85a[_0x303d('0x63')]||(_0x51d85a['attrs']&&_0x51d85a[_0x303d('0x5d')][0x1]?_0x51d85a['attrs'][0x1]['value']:undefined)||_0x303d('0x64')},{'name':_0x303d('0x65'),'value':_0x51d85a['attrFontSize']||(_0x51d85a[_0x303d('0x5d')]&&_0x51d85a[_0x303d('0x5d')][0x2]?_0x51d85a[_0x303d('0x5d')][0x2]['value']:undefined)||0xc}];case _0x303d('0x66'):return[{'name':'attrMetric','value':_0x51d85a['attrMetric']||(_0x51d85a['attrs']&&_0x51d85a['attrs'][0x0]?_0x51d85a['attrs'][0x0][_0x303d('0x5e')]:undefined)||'total'},{'name':_0x303d('0x67'),'value':_0x51d85a['attrVoiceQueues']||(_0x51d85a['attrs']&&_0x51d85a[_0x303d('0x5d')][0x1]?_0x51d85a['attrs'][0x1][_0x303d('0x5e')]:undefined)||[]},{'name':_0x303d('0x65'),'value':_0x51d85a[_0x303d('0x65')]||(_0x51d85a['attrs']&&_0x51d85a[_0x303d('0x5d')][0x2]?_0x51d85a[_0x303d('0x5d')][0x2][_0x303d('0x5e')]:undefined)||0x14}];case _0x303d('0x68'):case _0x303d('0x69'):return[{'name':'attrSerie1','value':_0x51d85a[_0x303d('0x6a')]||(_0x51d85a['attrs']&&_0x51d85a[_0x303d('0x5d')][0x0]?_0x51d85a['attrs'][0x0]['value']:undefined)||_0x303d('0x6b')},{'name':_0x303d('0x6c'),'value':_0x51d85a[_0x303d('0x6c')]||(_0x51d85a[_0x303d('0x5d')]&&_0x51d85a['attrs'][0x1]?_0x51d85a[_0x303d('0x5d')][0x1][_0x303d('0x5e')]:undefined)||null},{'name':'attrSerie3','value':_0x51d85a[_0x303d('0x6d')]||(_0x51d85a[_0x303d('0x5d')]&&_0x51d85a['attrs'][0x2]?_0x51d85a[_0x303d('0x5d')][0x2][_0x303d('0x5e')]:undefined)||null},{'name':_0x303d('0x67'),'value':_0x51d85a[_0x303d('0x67')]||(_0x51d85a[_0x303d('0x5d')]&&_0x51d85a[_0x303d('0x5d')][0x3]?_0x51d85a['attrs'][0x3][_0x303d('0x5e')]:undefined)||[]}];case _0x303d('0x6e'):return[{'name':_0x303d('0x6f'),'type':_0x51d85a[_0x303d('0x70')]||(_0x51d85a[_0x303d('0x5d')]&&_0x51d85a['attrs'][0x0]?_0x51d85a['attrs'][0x0]['type']:undefined)||null,'value':_0x51d85a['attrReport']||(_0x51d85a['attrs']&&_0x51d85a[_0x303d('0x5d')][0x0]?_0x51d85a['attrs'][0x0][_0x303d('0x5e')]:undefined)||null},{'name':'attrRefresh','value':_0x51d85a[_0x303d('0x71')]||(_0x51d85a['attrs']&&_0x51d85a[_0x303d('0x5d')][0x1]?_0x51d85a[_0x303d('0x5d')][0x1][_0x303d('0x5e')]:undefined)||0x0}];default:return[];}}catch(_0x1dfdb9){logger['error'](_0x303d('0x72'),JSON[_0x303d('0x73')](_0x1dfdb9));return[];}}exports[_0x303d('0x74')]=function(_0xc6fbfd,_0x63f685,_0x6db635){if(_0xc6fbfd[_0x303d('0x4f')]['id']){delete _0xc6fbfd[_0x303d('0x4f')]['id'];}return db['Dashboard'][_0x303d('0x4d')]({'where':{'id':_0xc6fbfd[_0x303d('0x4c')]['id']}})[_0x303d('0x2a')](handleEntityNotFound(_0x63f685,null))['then'](function(_0x125673){if(_0x125673){_0xc6fbfd[_0x303d('0x4f')][_0x303d('0x75')]=_0x125673['id'];_0xc6fbfd[_0x303d('0x4f')]['attrs']=widgetAttributes(_0xc6fbfd[_0x303d('0x4f')]);return db['DashboardItem'][_0x303d('0x4e')](_0xc6fbfd[_0x303d('0x4f')]);}})[_0x303d('0x2a')](respondWithResult(_0x63f685,null))[_0x303d('0x56')](handleError(_0x63f685,null));};exports[_0x303d('0x76')]=function(_0xf1f32,_0x36ee51,_0x2b4dca){var _0x4bacbe={};var _0x329da6={};var _0x4a557d;var _0x5a41b7;return db[_0x303d('0x32')][_0x303d('0x77')]({'where':{'id':_0xf1f32[_0x303d('0x4c')]['id']}})[_0x303d('0x2a')](handleEntityNotFound(_0x36ee51,null))[_0x303d('0x2a')](function(_0x728f94){if(_0x728f94){_0x4a557d=_0x728f94;_0x329da6['model']=_[_0x303d('0x38')](db[_0x303d('0x78')][_0x303d('0x33')]);_0x329da6['query']=_['keys'](_0xf1f32[_0x303d('0x37')]);_0x329da6[_0x303d('0x39')]=_['intersection'](_0x329da6[_0x303d('0x36')],_0x329da6['query']);_0x4bacbe[_0x303d('0x3a')]=_[_0x303d('0x3b')](_0x329da6[_0x303d('0x36')],qs[_0x303d('0x3c')](_0xf1f32[_0x303d('0x37')][_0x303d('0x3c')]));_0x4bacbe[_0x303d('0x3a')]=_0x4bacbe[_0x303d('0x3a')][_0x303d('0x3d')]?_0x4bacbe[_0x303d('0x3a')]:_0x329da6[_0x303d('0x36')];_0x4bacbe[_0x303d('0x3f')]=qs[_0x303d('0x40')](_0xf1f32[_0x303d('0x37')][_0x303d('0x40')]);_0x4bacbe[_0x303d('0x41')]=qs[_0x303d('0x39')](_[_0x303d('0x42')](_0xf1f32[_0x303d('0x37')],_0x329da6[_0x303d('0x39')]));if(_0xf1f32[_0x303d('0x37')][_0x303d('0x43')]){_0x4bacbe[_0x303d('0x41')]=_[_0x303d('0x44')](_0x4bacbe[_0x303d('0x41')],{'$or':_[_0x303d('0x31')](_0x4bacbe[_0x303d('0x3a')],function(_0x330c8d){var _0x43cc4e={};_0x43cc4e[_0x330c8d]={'$like':'%'+_0xf1f32[_0x303d('0x37')][_0x303d('0x43')]+'%'};return _0x43cc4e;})});}_0x4bacbe=_[_0x303d('0x44')]({},_0x4bacbe,_0xf1f32[_0x303d('0x46')]);return _0x4a557d['getItems'](_0x4bacbe);}})['then'](function(_0x5398f3){if(_0x5398f3){_0x5a41b7=_0x5398f3[_0x303d('0x3d')];if(!_0xf1f32[_0x303d('0x37')][_0x303d('0x79')](_0x303d('0x3e'))){_0x4bacbe[_0x303d('0x22')]=qs[_0x303d('0x22')](_0xf1f32[_0x303d('0x37')][_0x303d('0x22')]);_0x4bacbe[_0x303d('0x24')]=qs[_0x303d('0x24')](_0xf1f32[_0x303d('0x37')][_0x303d('0x24')]);}return _0x4a557d[_0x303d('0x76')](_0x4bacbe);}})[_0x303d('0x2a')](function(_0x3d3383){if(_0x3d3383){return _0x3d3383?{'count':_0x5a41b7,'rows':_0x3d3383}:null;}})[_0x303d('0x2a')](respondWithResult(_0x36ee51,null))[_0x303d('0x56')](handleError(_0x36ee51,null));};
\ No newline at end of file
index 4cb6a68..dccf52a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43ef=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x43ef,0x19a));var _0xf43e=function(_0x2c82fd,_0x125b21){_0x2c82fd=_0x2c82fd-0x0;var _0x844157=_0x43ef[_0x2c82fd];return _0x844157;};'use strict';var EventEmitter=require(_0xf43e('0x0'));var Dashboard=require(_0xf43e('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0xf43e('0x2')](0x0);var events={'afterCreate':_0xf43e('0x3'),'afterUpdate':_0xf43e('0x4'),'afterDestroy':_0xf43e('0x5')};function emitEvent(_0x44e2ef){return function(_0x50d999,_0x3bd5f2,_0x5d5997){DashboardEvents[_0xf43e('0x6')](_0x44e2ef+':'+_0x50d999['id'],_0x50d999);DashboardEvents[_0xf43e('0x6')](_0x44e2ef,_0x50d999);_0x5d5997(null);};}for(var e in events){if(events[_0xf43e('0x7')](e)){var event=events[e];Dashboard[_0xf43e('0x8')](e,emitEvent(event));}}module['exports']=DashboardEvents;
\ No newline at end of file
+var _0xe16e=['update','emit','hook','events','../../mysqldb','Dashboard','save'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xe16e,0x81));var _0xee16=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0xe16e[_0x4ae829];return _0x256b31;};'use strict';var EventEmitter=require(_0xee16('0x0'));var Dashboard=require(_0xee16('0x1'))['db'][_0xee16('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xee16('0x3'),'afterUpdate':_0xee16('0x4'),'afterDestroy':'remove'};function emitEvent(_0x25b5d6){return function(_0x1928d1,_0x58eaa6,_0x3d6d03){DashboardEvents[_0xee16('0x5')](_0x25b5d6+':'+_0x1928d1['id'],_0x1928d1);DashboardEvents['emit'](_0x25b5d6,_0x1928d1);_0x3d6d03(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0xee16('0x6')](e,emitEvent(event));}}module['exports']=DashboardEvents;
\ No newline at end of file
index a0ea262..5cb33c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcefa=['../../config/environment','./dashboard.attributes','Dashboard','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x34cf0b,_0x52db28){var _0x594d84=function(_0x435b15){while(--_0x435b15){_0x34cf0b['push'](_0x34cf0b['shift']());}};_0x594d84(++_0x52db28);}(_0xcefa,0x16b));var _0xacef=function(_0x28c7a7,_0x55a356){_0x28c7a7=_0x28c7a7-0x0;var _0x50610f=_0xcefa[_0x28c7a7];return _0x50610f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xacef('0x0'))(_0xacef('0x1'));var moment=require(_0xacef('0x2'));var BPromise=require(_0xacef('0x3'));var rp=require(_0xacef('0x4'));var fs=require('fs');var path=require(_0xacef('0x5'));var rimraf=require(_0xacef('0x6'));var config=require(_0xacef('0x7'));var attributes=require(_0xacef('0x8'));module['exports']=function(_0x200357,_0x4cca40){return _0x200357['define'](_0xacef('0x9'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa3e2=['api','moment','bluebird','path','rimraf','../../config/environment','./dashboard.attributes','exports','Dashboard','lodash','../../config/logger'];(function(_0x71185f,_0x371d74){var _0x160ffe=function(_0x57feba){while(--_0x57feba){_0x71185f['push'](_0x71185f['shift']());}};_0x160ffe(++_0x371d74);}(_0xa3e2,0x1cc));var _0x2a3e=function(_0x137da3,_0xa6277a){_0x137da3=_0x137da3-0x0;var _0x1ac46c=_0xa3e2[_0x137da3];return _0x1ac46c;};'use strict';var _=require(_0x2a3e('0x0'));var util=require('util');var logger=require(_0x2a3e('0x1'))(_0x2a3e('0x2'));var moment=require(_0x2a3e('0x3'));var BPromise=require(_0x2a3e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2a3e('0x5'));var rimraf=require(_0x2a3e('0x6'));var config=require(_0x2a3e('0x7'));var attributes=require(_0x2a3e('0x8'));module[_0x2a3e('0x9')]=function(_0x440ef9,_0x58e4ea){return _0x440ef9['define'](_0x2a3e('0xa'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7cdbaad..46df6b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8946=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x14739a,_0x3ac4e5){var _0x654e91=function(_0x1d5fe6){while(--_0x1d5fe6){_0x14739a['push'](_0x14739a['shift']());}};_0x654e91(++_0x3ac4e5);}(_0x8946,0x13e));var _0x6894=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0x8946[_0x5c9307];return _0x373e29;};'use strict';var _=require(_0x6894('0x0'));var util=require(_0x6894('0x1'));var moment=require(_0x6894('0x2'));var BPromise=require('bluebird');var rs=require(_0x6894('0x3'));var fs=require('fs');var Redis=require(_0x6894('0x4'));var db=require(_0x6894('0x5'))['db'];var utils=require(_0x6894('0x6'));var logger=require(_0x6894('0x7'))(_0x6894('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6894('0x9')][_0x6894('0xa')]({'port':0x232a});config[_0x6894('0xb')]=_[_0x6894('0xc')](config[_0x6894('0xb')],{'host':_0x6894('0xd'),'port':0x18eb});var socket=require(_0x6894('0xe'))(new Redis(config['redis']));require(_0x6894('0xf'))[_0x6894('0x10')](socket);function respondWithRpcPromise(_0x40fa15,_0x4ba833,_0x3ab706){return new BPromise(function(_0x35c521,_0x3ebf01){return client['request'](_0x40fa15,_0x3ab706)[_0x6894('0x11')](function(_0x1d915a){logger[_0x6894('0x12')](_0x6894('0x13'),_0x4ba833,_0x6894('0x14'));logger[_0x6894('0x15')](_0x6894('0x16'),_0x4ba833,'request\x20sent',JSON[_0x6894('0x17')](_0x1d915a));if(_0x1d915a[_0x6894('0x18')]){if(_0x1d915a[_0x6894('0x18')][_0x6894('0x19')]===0x1f4){logger[_0x6894('0x18')](_0x6894('0x13'),_0x4ba833,_0x1d915a['error'][_0x6894('0x1a')]);return _0x3ebf01(_0x1d915a[_0x6894('0x18')][_0x6894('0x1a')]);}logger[_0x6894('0x18')](_0x6894('0x13'),_0x4ba833,_0x1d915a[_0x6894('0x18')][_0x6894('0x1a')]);return _0x35c521(_0x1d915a[_0x6894('0x18')]['message']);}else{logger[_0x6894('0x12')](_0x6894('0x13'),_0x4ba833,_0x6894('0x14'));_0x35c521(_0x1d915a[_0x6894('0x1b')]['message']);}})[_0x6894('0x1c')](function(_0x20544c){logger[_0x6894('0x18')](_0x6894('0x13'),_0x4ba833,_0x20544c);_0x3ebf01(_0x20544c);});});}
\ No newline at end of file
+var _0x9368=['then','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./dashboard.socket','register','request'];(function(_0xc4ea75,_0x273753){var _0x52ea5e=function(_0x1ee872){while(--_0x1ee872){_0xc4ea75['push'](_0xc4ea75['shift']());}};_0x52ea5e(++_0x273753);}(_0x9368,0x166));var _0x8936=function(_0x462999,_0x24d200){_0x462999=_0x462999-0x0;var _0x4b1366=_0x9368[_0x462999];return _0x4b1366;};'use strict';var _=require(_0x8936('0x0'));var util=require(_0x8936('0x1'));var moment=require(_0x8936('0x2'));var BPromise=require(_0x8936('0x3'));var rs=require(_0x8936('0x4'));var fs=require('fs');var Redis=require(_0x8936('0x5'));var db=require(_0x8936('0x6'))['db'];var utils=require(_0x8936('0x7'));var logger=require('../../config/logger')(_0x8936('0x8'));var config=require(_0x8936('0x9'));var jayson=require(_0x8936('0xa'));var client=jayson[_0x8936('0xb')][_0x8936('0xc')]({'port':0x232a});config[_0x8936('0xd')]=_[_0x8936('0xe')](config[_0x8936('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x8936('0xf'))(new Redis(config[_0x8936('0xd')]));require(_0x8936('0x10'))[_0x8936('0x11')](socket);function respondWithRpcPromise(_0x4b294c,_0x4bb512,_0x2a4e3f){return new BPromise(function(_0x239a25,_0x1136da){return client[_0x8936('0x12')](_0x4b294c,_0x2a4e3f)[_0x8936('0x13')](function(_0x54528d){logger['info'](_0x8936('0x14'),_0x4bb512,'request\x20sent');logger[_0x8936('0x15')](_0x8936('0x16'),_0x4bb512,_0x8936('0x17'),JSON[_0x8936('0x18')](_0x54528d));if(_0x54528d[_0x8936('0x19')]){if(_0x54528d[_0x8936('0x19')][_0x8936('0x1a')]===0x1f4){logger[_0x8936('0x19')](_0x8936('0x14'),_0x4bb512,_0x54528d['error']['message']);return _0x1136da(_0x54528d[_0x8936('0x19')][_0x8936('0x1b')]);}logger[_0x8936('0x19')]('Dashboard,\x20%s,\x20%s',_0x4bb512,_0x54528d[_0x8936('0x19')][_0x8936('0x1b')]);return _0x239a25(_0x54528d[_0x8936('0x19')]['message']);}else{logger[_0x8936('0x1c')](_0x8936('0x14'),_0x4bb512,_0x8936('0x17'));_0x239a25(_0x54528d['result'][_0x8936('0x1b')]);}})['catch'](function(_0x4c3b26){logger[_0x8936('0x19')](_0x8936('0x14'),_0x4bb512,_0x4c3b26);_0x1136da(_0x4c3b26);});});}
\ No newline at end of file
index f020dbe..1341288 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc131=['emit','length','dashboard:','./dashboard.events','save','remove'];(function(_0x49a3ab,_0x22d700){var _0x155ba8=function(_0x5cf86d){while(--_0x5cf86d){_0x49a3ab['push'](_0x49a3ab['shift']());}};_0x155ba8(++_0x22d700);}(_0xc131,0x153));var _0x1c13=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc131[_0x321bb2];return _0x9c12ed;};'use strict';var DashboardEvents=require(_0x1c13('0x0'));var events=[_0x1c13('0x1'),_0x1c13('0x2'),'update'];function createListener(_0x255f5a,_0x5338a1){return function(_0x2c8104){_0x5338a1[_0x1c13('0x3')](_0x255f5a,_0x2c8104);};}function removeListener(_0x2bee9e,_0x17a8bc){return function(){DashboardEvents['removeListener'](_0x2bee9e,_0x17a8bc);};}exports['register']=function(_0x1aa577){for(var _0x4fb27c=0x0,_0x5d294f=events[_0x1c13('0x4')];_0x4fb27c<_0x5d294f;_0x4fb27c++){var _0x2ebb12=events[_0x4fb27c];var _0x4615cc=createListener(_0x1c13('0x5')+_0x2ebb12,_0x1aa577);DashboardEvents['on'](_0x2ebb12,_0x4615cc);}};
\ No newline at end of file
+var _0xc8d4=['register','length','dashboard:','./dashboard.events','save','remove','update','emit'];(function(_0x565fc3,_0x5153bd){var _0x5818a6=function(_0xf535b3){while(--_0xf535b3){_0x565fc3['push'](_0x565fc3['shift']());}};_0x5818a6(++_0x5153bd);}(_0xc8d4,0x6b));var _0x4c8d=function(_0x3e83d1,_0x389b18){_0x3e83d1=_0x3e83d1-0x0;var _0x3ec321=_0xc8d4[_0x3e83d1];return _0x3ec321;};'use strict';var DashboardEvents=require(_0x4c8d('0x0'));var events=[_0x4c8d('0x1'),_0x4c8d('0x2'),_0x4c8d('0x3')];function createListener(_0x21871a,_0x322cb7){return function(_0x2f0d41){_0x322cb7[_0x4c8d('0x4')](_0x21871a,_0x2f0d41);};}function removeListener(_0x4dd581,_0x4b2c75){return function(){DashboardEvents['removeListener'](_0x4dd581,_0x4b2c75);};}exports[_0x4c8d('0x5')]=function(_0x3c5a5b){for(var _0x4a9c5b=0x0,_0x415500=events[_0x4c8d('0x6')];_0x4a9c5b<_0x415500;_0x4a9c5b++){var _0x5e7f78=events[_0x4a9c5b];var _0x1afe25=createListener(_0x4c8d('0x7')+_0x5e7f78,_0x3c5a5b);DashboardEvents['on'](_0x5e7f78,_0x1afe25);}};
\ No newline at end of file
index 0fd05a7..1f6cfb4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9433=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','index','/:id','isAuthenticated','show','getItems','post','/:id/clone','clone','/:id/items','update','delete','destroy','exports','path','connect-timeout','express','Router'];(function(_0x4953df,_0x249bd9){var _0x520bf9=function(_0x31ef4d){while(--_0x31ef4d){_0x4953df['push'](_0x4953df['shift']());}};_0x520bf9(++_0x249bd9);}(_0x9433,0x19a));var _0x3943=function(_0x13fe61,_0x257256){_0x13fe61=_0x13fe61-0x0;var _0x3c1e9f=_0x9433[_0x13fe61];return _0x3c1e9f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3943('0x0'));var timeout=require(_0x3943('0x1'));var express=require(_0x3943('0x2'));var router=express[_0x3943('0x3')]();var fs_extra=require(_0x3943('0x4'));var auth=require(_0x3943('0x5'));var interaction=require(_0x3943('0x6'));var config=require(_0x3943('0x7'));var controller=require(_0x3943('0x8'));router[_0x3943('0x9')]('/',auth['isAuthenticated'](),controller[_0x3943('0xa')]);router['get'](_0x3943('0xb'),auth[_0x3943('0xc')](),controller[_0x3943('0xd')]);router[_0x3943('0x9')]('/:id/items',auth['isAuthenticated'](),controller[_0x3943('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x3943('0xf')](_0x3943('0x10'),auth[_0x3943('0xc')](),controller[_0x3943('0x11')]);router[_0x3943('0xf')](_0x3943('0x12'),auth[_0x3943('0xc')](),controller['addItem']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3943('0x13')]);router[_0x3943('0x14')]('/:id',auth[_0x3943('0xc')](),controller[_0x3943('0x15')]);module[_0x3943('0x16')]=router;
\ No newline at end of file
+var _0xb6a3=['/:id/clone','clone','/:id/items','addItem','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./dashboard.controller','index','get','/:id','isAuthenticated','show','getItems','post'];(function(_0x522aa7,_0x5e1bba){var _0x5aa82a=function(_0x3aba28){while(--_0x3aba28){_0x522aa7['push'](_0x522aa7['shift']());}};_0x5aa82a(++_0x5e1bba);}(_0xb6a3,0x75));var _0x3b6a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb6a3[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x3b6a('0x0'));var util=require('util');var path=require(_0x3b6a('0x1'));var timeout=require(_0x3b6a('0x2'));var express=require(_0x3b6a('0x3'));var router=express[_0x3b6a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3b6a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3b6a('0x6'));var controller=require(_0x3b6a('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x3b6a('0x8')]);router[_0x3b6a('0x9')](_0x3b6a('0xa'),auth[_0x3b6a('0xb')](),controller[_0x3b6a('0xc')]);router['get']('/:id/items',auth[_0x3b6a('0xb')](),controller[_0x3b6a('0xd')]);router[_0x3b6a('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3b6a('0xe')](_0x3b6a('0xf'),auth[_0x3b6a('0xb')](),controller[_0x3b6a('0x10')]);router[_0x3b6a('0xe')](_0x3b6a('0x11'),auth[_0x3b6a('0xb')](),controller[_0x3b6a('0x12')]);router['put'](_0x3b6a('0xa'),auth[_0x3b6a('0xb')](),controller['update']);router[_0x3b6a('0x13')](_0x3b6a('0xa'),auth[_0x3b6a('0xb')](),controller[_0x3b6a('0x14')]);module[_0x3b6a('0x15')]=router;
\ No newline at end of file
index 4e545ae..5f1ff88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd51=['setDataValue','INTEGER','#ffffff','#2196f3','sequelize','lodash','exports','STRING','attrs','stringify'];(function(_0x217b70,_0x289ae3){var _0xc7b236=function(_0x3c24fc){while(--_0x3c24fc){_0x217b70['push'](_0x217b70['shift']());}};_0xc7b236(++_0x289ae3);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x466a38,_0x13e5e6){_0x466a38=_0x466a38-0x0;var _0x5cdb14=_0xbd51[_0x466a38];return _0x5cdb14;};'use strict';var Sequelize=require(_0x1bd5('0x0'));var squel=require('squel');var _=require(_0x1bd5('0x1'));module[_0x1bd5('0x2')]={'title':{'type':Sequelize[_0x1bd5('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x1bd5('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT']('long'),'get':function(){try{return JSON['parse'](this['getDataValue'](_0x1bd5('0x4')));}catch(_0x362b24){return[];}},'set':function(_0x43e6b6){try{this['setDataValue'](_0x1bd5('0x4'),JSON[_0x1bd5('0x5')](_0x43e6b6));}catch(_0x19077c){this[_0x1bd5('0x6')](_0x1bd5('0x4'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x1bd5('0x7')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x1bd5('0x7')]},'col':{'type':Sequelize[_0x1bd5('0x7')]},'background':{'type':Sequelize[_0x1bd5('0x3')],'allowNull':![],'defaultValue':_0x1bd5('0x8'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x1bd5('0x3')],'allowNull':![],'defaultValue':_0x1bd5('0x9'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0x1bd5('0x7')],'defaultValue':0xc}};
\ No newline at end of file
+var _0xe3da=['squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize'];(function(_0x57556b,_0x29e57c){var _0x501ac7=function(_0x16f2bb){while(--_0x16f2bb){_0x57556b['push'](_0x57556b['shift']());}};_0x501ac7(++_0x29e57c);}(_0xe3da,0x1cd));var _0xae3d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe3da[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0xae3d('0x0'));var squel=require(_0xae3d('0x1'));var _=require(_0xae3d('0x2'));module[_0xae3d('0x3')]={'title':{'type':Sequelize[_0xae3d('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xae3d('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xae3d('0x5')](_0xae3d('0x6')),'get':function(){try{return JSON[_0xae3d('0x7')](this[_0xae3d('0x8')](_0xae3d('0x9')));}catch(_0x26282d){return[];}},'set':function(_0xa9a1a){try{this[_0xae3d('0xa')](_0xae3d('0x9'),JSON[_0xae3d('0xb')](_0xa9a1a));}catch(_0x583b98){this[_0xae3d('0xa')](_0xae3d('0x9'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xae3d('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xae3d('0xc')]},'col':{'type':Sequelize[_0xae3d('0xc')]},'background':{'type':Sequelize[_0xae3d('0x4')],'allowNull':![],'defaultValue':_0xae3d('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xae3d('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xae3d('0x4')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}};
\ No newline at end of file
index 15b5304..15f19b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cc5=['error','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','fields','length','attributes','includeAll','include','merge','find','catch','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','update','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','offset','undefined','limit','count','set','apply','reject','save','then','destroy'];(function(_0x7f11a6,_0x19e361){var _0xe79301=function(_0x13f589){while(--_0x13f589){_0x7f11a6['push'](_0x7f11a6['shift']());}};_0xe79301(++_0x19e361);}(_0x3cc5,0x91));var _0x53cc=function(_0x164d9e,_0xcf087e){_0x164d9e=_0x164d9e-0x0;var _0x4fbc03=_0x3cc5[_0x164d9e];return _0x4fbc03;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x53cc('0x0'));var zipdir=require(_0x53cc('0x1'));var jsonpatch=require(_0x53cc('0x2'));var rp=require('request-promise');var moment=require(_0x53cc('0x3'));var BPromise=require(_0x53cc('0x4'));var Mustache=require(_0x53cc('0x5'));var util=require(_0x53cc('0x6'));var path=require(_0x53cc('0x7'));var sox=require(_0x53cc('0x8'));var csv=require(_0x53cc('0x9'));var ejs=require(_0x53cc('0xa'));var fs=require('fs');var fs_extra=require(_0x53cc('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x53cc('0xc'));var jsforce=require(_0x53cc('0xd'));var deskjs=require(_0x53cc('0xe'));var toCsv=require(_0x53cc('0x9'));var querystring=require(_0x53cc('0xf'));var Papa=require(_0x53cc('0x10'));var Redis=require(_0x53cc('0x11'));var authService=require(_0x53cc('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x53cc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x53cc('0x14'))(_0x53cc('0x15'));var utils=require(_0x53cc('0x16'));var config=require(_0x53cc('0x17'));var licenseUtil=require(_0x53cc('0x18'));var db=require(_0x53cc('0x19'))['db'];config[_0x53cc('0x1a')]=_[_0x53cc('0x1b')](config[_0x53cc('0x1a')],{'host':_0x53cc('0x1c'),'port':0x18eb});var socket=require(_0x53cc('0x1d'))(new Redis(config[_0x53cc('0x1a')]));require('./dashboardItem.socket')[_0x53cc('0x1e')](socket);function respondWithStatusCode(_0x2e4582,_0x95a5bf){_0x95a5bf=_0x95a5bf||0xcc;return function(_0xe7f174){if(_0xe7f174){return _0x2e4582[_0x53cc('0x1f')](_0x95a5bf);}return _0x2e4582[_0x53cc('0x20')](_0x95a5bf)['end']();};}function respondWithResult(_0x9febf1,_0x14b82c){_0x14b82c=_0x14b82c||0xc8;return function(_0x125a9d){if(_0x125a9d){return _0x9febf1[_0x53cc('0x20')](_0x14b82c)['json'](_0x125a9d);}};}function respondWithFilteredResult(_0x26b545,_0x23d727){return function(_0x4862a9){if(_0x4862a9){var _0x20eb11=typeof _0x23d727[_0x53cc('0x21')]===_0x53cc('0x22')&&typeof _0x23d727[_0x53cc('0x23')]===_0x53cc('0x22');var _0x29a330=_0x4862a9[_0x53cc('0x24')];var _0x3e3849=_0x20eb11?0x0:_0x23d727['offset'];var _0x4c9c26=_0x20eb11?_0x4862a9[_0x53cc('0x24')]:_0x23d727[_0x53cc('0x21')]+_0x23d727[_0x53cc('0x23')];var _0x3f9b82;if(_0x4c9c26>=_0x29a330){_0x4c9c26=_0x29a330;_0x3f9b82=0xc8;}else{_0x3f9b82=0xce;}_0x26b545['status'](_0x3f9b82);return _0x26b545[_0x53cc('0x25')]('Content-Range',_0x3e3849+'-'+_0x4c9c26+'/'+_0x29a330)['json'](_0x4862a9);}return null;};}function patchUpdates(_0x26fbb3){return function(_0x44e5a9){try{jsonpatch[_0x53cc('0x26')](_0x44e5a9,_0x26fbb3,!![]);}catch(_0x40479d){return BPromise[_0x53cc('0x27')](_0x40479d);}return _0x44e5a9[_0x53cc('0x28')]();};}function saveUpdates(_0x502d93,_0x2e4f55){return function(_0x4496bf){if(_0x4496bf){return _0x4496bf['update'](_0x502d93)[_0x53cc('0x29')](function(_0x4e8312){return _0x4e8312;});}return null;};}function removeEntity(_0x4fa28e,_0x86610f){return function(_0x265172){if(_0x265172){return _0x265172[_0x53cc('0x2a')]()[_0x53cc('0x29')](function(){_0x4fa28e[_0x53cc('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c8d9a,_0x589510){return function(_0x1fe9aa){if(!_0x1fe9aa){_0x3c8d9a[_0x53cc('0x1f')](0x194);}return _0x1fe9aa;};}function handleError(_0x1ba739,_0x1a9bf4){_0x1a9bf4=_0x1a9bf4||0x1f4;return function(_0x443faf){logger[_0x53cc('0x2b')](_0x443faf[_0x53cc('0x2c')]);if(_0x443faf[_0x53cc('0x2d')]){delete _0x443faf[_0x53cc('0x2d')];}_0x1ba739[_0x53cc('0x20')](_0x1a9bf4)[_0x53cc('0x2e')](_0x443faf);};}exports[_0x53cc('0x2f')]=function(_0x750cf5,_0x8f1f7a){var _0x2ae712={'raw':![],'where':{'id':_0x750cf5[_0x53cc('0x30')]['id']}},_0x40c858={};_0x40c858[_0x53cc('0x31')]=_[_0x53cc('0x32')](db[_0x53cc('0x33')][_0x53cc('0x34')]);_0x40c858[_0x53cc('0x35')]=_[_0x53cc('0x32')](_0x750cf5[_0x53cc('0x35')]);_0x40c858[_0x53cc('0x36')]=_['intersection'](_0x40c858[_0x53cc('0x31')],_0x40c858[_0x53cc('0x35')]);_0x2ae712['attributes']=_[_0x53cc('0x37')](_0x40c858[_0x53cc('0x31')],qs[_0x53cc('0x38')](_0x750cf5[_0x53cc('0x35')]['fields']));_0x2ae712['attributes']=_0x2ae712['attributes'][_0x53cc('0x39')]?_0x2ae712[_0x53cc('0x3a')]:_0x40c858[_0x53cc('0x31')];if(_0x750cf5[_0x53cc('0x35')][_0x53cc('0x3b')]){_0x2ae712[_0x53cc('0x3c')]=[{'all':!![]}];}_0x2ae712=_[_0x53cc('0x3d')]({},_0x2ae712,_0x750cf5['options']);return db[_0x53cc('0x33')][_0x53cc('0x3e')](_0x2ae712)['then'](handleEntityNotFound(_0x8f1f7a,null))[_0x53cc('0x29')](respondWithResult(_0x8f1f7a,null))[_0x53cc('0x3f')](handleError(_0x8f1f7a,null));};exports[_0x53cc('0x2a')]=function(_0x3e2ab8,_0x4d971f){return db[_0x53cc('0x33')][_0x53cc('0x3e')]({'where':{'id':_0x3e2ab8[_0x53cc('0x30')]['id']}})['then'](handleEntityNotFound(_0x4d971f,null))[_0x53cc('0x29')](removeEntity(_0x4d971f,null))[_0x53cc('0x3f')](handleError(_0x4d971f,null));};function widgetAttributes(_0x38735e){try{switch(_0x38735e[_0x53cc('0x40')]){case _0x53cc('0x41'):return[{'name':_0x53cc('0x42'),'value':_0x38735e[_0x53cc('0x42')]||(_0x38735e['attrs']&&_0x38735e[_0x53cc('0x43')][0x0]?_0x38735e['attrs'][0x0][_0x53cc('0x44')]:undefined)||_0x53cc('0x45')}];case _0x53cc('0x46'):return[{'name':_0x53cc('0x47'),'value':_0x38735e[_0x53cc('0x47')]||(_0x38735e[_0x53cc('0x43')]&&_0x38735e[_0x53cc('0x43')][0x0]?_0x38735e[_0x53cc('0x43')][0x0][_0x53cc('0x44')]:undefined)||''}];case _0x53cc('0x48'):return[{'name':_0x53cc('0x49'),'value':_0x38735e[_0x53cc('0x49')]||(_0x38735e[_0x53cc('0x43')]&&_0x38735e[_0x53cc('0x43')][0x0]?_0x38735e[_0x53cc('0x43')][0x0]['value']:undefined)||_0x53cc('0x4a')},{'name':_0x53cc('0x4b'),'value':_0x38735e[_0x53cc('0x4b')]||(_0x38735e[_0x53cc('0x43')]&&_0x38735e[_0x53cc('0x43')][0x1]?_0x38735e[_0x53cc('0x43')][0x1]['value']:undefined)||_0x53cc('0x4c')},{'name':'attrFontSize','value':_0x38735e[_0x53cc('0x4d')]||(_0x38735e[_0x53cc('0x43')]&&_0x38735e['attrs'][0x2]?_0x38735e['attrs'][0x2][_0x53cc('0x44')]:undefined)||0xc}];case _0x53cc('0x4e'):return[{'name':_0x53cc('0x4f'),'value':_0x38735e[_0x53cc('0x4f')]||(_0x38735e[_0x53cc('0x43')]&&_0x38735e[_0x53cc('0x43')][0x0]?_0x38735e[_0x53cc('0x43')][0x0]['value']:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x38735e[_0x53cc('0x50')]||(_0x38735e[_0x53cc('0x43')]&&_0x38735e['attrs'][0x1]?_0x38735e[_0x53cc('0x43')][0x1][_0x53cc('0x44')]:undefined)||[]},{'name':_0x53cc('0x4d'),'value':_0x38735e[_0x53cc('0x4d')]||(_0x38735e[_0x53cc('0x43')]&&_0x38735e[_0x53cc('0x43')][0x2]?_0x38735e['attrs'][0x2][_0x53cc('0x44')]:undefined)||0x14}];case _0x53cc('0x51'):case _0x53cc('0x52'):return[{'name':_0x53cc('0x53'),'value':_0x38735e[_0x53cc('0x53')]||(_0x38735e['attrs']&&_0x38735e[_0x53cc('0x43')][0x0]?_0x38735e[_0x53cc('0x43')][0x0]['value']:undefined)||_0x53cc('0x54')},{'name':_0x53cc('0x55'),'value':_0x38735e[_0x53cc('0x55')]||(_0x38735e[_0x53cc('0x43')]&&_0x38735e[_0x53cc('0x43')][0x1]?_0x38735e[_0x53cc('0x43')][0x1][_0x53cc('0x44')]:undefined)||null},{'name':'attrSerie3','value':_0x38735e[_0x53cc('0x56')]||(_0x38735e['attrs']&&_0x38735e[_0x53cc('0x43')][0x2]?_0x38735e[_0x53cc('0x43')][0x2]['value']:undefined)||null},{'name':_0x53cc('0x50'),'value':_0x38735e[_0x53cc('0x50')]||(_0x38735e[_0x53cc('0x43')]&&_0x38735e['attrs'][0x3]?_0x38735e['attrs'][0x3]['value']:undefined)||[]}];case'web-report':return[{'name':'attrReport','type':_0x38735e['reportType']||(_0x38735e[_0x53cc('0x43')]&&_0x38735e[_0x53cc('0x43')][0x0]?_0x38735e[_0x53cc('0x43')][0x0][_0x53cc('0x40')]:undefined)||null,'value':_0x38735e[_0x53cc('0x57')]||(_0x38735e['attrs']&&_0x38735e[_0x53cc('0x43')][0x0]?_0x38735e[_0x53cc('0x43')][0x0]['value']:undefined)||null},{'name':_0x53cc('0x58'),'value':_0x38735e[_0x53cc('0x58')]||(_0x38735e[_0x53cc('0x43')]&&_0x38735e[_0x53cc('0x43')][0x1]?_0x38735e[_0x53cc('0x43')][0x1][_0x53cc('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x5004b4){logger[_0x53cc('0x2b')](_0x53cc('0x59'),JSON[_0x53cc('0x5a')](_0x5004b4));return[];}}exports[_0x53cc('0x5b')]=function(_0xa72ee3,_0x1909ed){if(_0xa72ee3[_0x53cc('0x5c')]){_0xa72ee3[_0x53cc('0x5c')][_0x53cc('0x43')]=widgetAttributes(_0xa72ee3[_0x53cc('0x5c')]);}return db[_0x53cc('0x33')][_0x53cc('0x5b')](_0xa72ee3['body'],{})[_0x53cc('0x29')](respondWithResult(_0x1909ed,0xc9))['catch'](handleError(_0x1909ed,null));};exports[_0x53cc('0x5d')]=function(_0xac8be0,_0x52bfc0){if(_0xac8be0[_0x53cc('0x5c')]['id']){delete _0xac8be0[_0x53cc('0x5c')]['id'];}_0xac8be0[_0x53cc('0x5c')]['attrs']=widgetAttributes(_0xac8be0['body']);return db[_0x53cc('0x33')]['find']({'where':{'id':_0xac8be0[_0x53cc('0x30')]['id']}})[_0x53cc('0x29')](handleEntityNotFound(_0x52bfc0,null))[_0x53cc('0x29')](saveUpdates(_0xac8be0[_0x53cc('0x5c')],null))[_0x53cc('0x29')](respondWithResult(_0x52bfc0,null))['catch'](handleError(_0x52bfc0,null));};
\ No newline at end of file
+var _0x582d=['attrFontSize','counter','attrMetric','total','attrVoiceQueues','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./dashboardItem.socket','register','status','end','json','limit','undefined','count','offset','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','show','params','model','rawAttributes','query','keys','filters','intersection','fields','attributes','options','DashboardItem','find','catch','type','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x582d,0x11c));var _0xd582=function(_0x3bf1ca,_0x1dcc3d){_0x3bf1ca=_0x3bf1ca-0x0;var _0x30d550=_0x582d[_0x3bf1ca];return _0x30d550;};'use strict';var emlformat=require(_0xd582('0x0'));var rimraf=require(_0xd582('0x1'));var zipdir=require(_0xd582('0x2'));var jsonpatch=require(_0xd582('0x3'));var rp=require(_0xd582('0x4'));var moment=require(_0xd582('0x5'));var BPromise=require(_0xd582('0x6'));var Mustache=require(_0xd582('0x7'));var util=require(_0xd582('0x8'));var path=require(_0xd582('0x9'));var sox=require(_0xd582('0xa'));var csv=require(_0xd582('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd582('0xc'));var _=require(_0xd582('0xd'));var squel=require('squel');var crypto=require(_0xd582('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd582('0xb'));var querystring=require(_0xd582('0xf'));var Papa=require(_0xd582('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd582('0x11'));var as=require(_0xd582('0x12'));var hardwareService=require(_0xd582('0x13'));var logger=require(_0xd582('0x14'))(_0xd582('0x15'));var utils=require(_0xd582('0x16'));var config=require(_0xd582('0x17'));var licenseUtil=require(_0xd582('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xd582('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xd582('0x1a'))(new Redis(config[_0xd582('0x19')]));require(_0xd582('0x1b'))[_0xd582('0x1c')](socket);function respondWithStatusCode(_0x8c6bd9,_0xbe1f9c){_0xbe1f9c=_0xbe1f9c||0xcc;return function(_0x3e1a09){if(_0x3e1a09){return _0x8c6bd9['sendStatus'](_0xbe1f9c);}return _0x8c6bd9[_0xd582('0x1d')](_0xbe1f9c)[_0xd582('0x1e')]();};}function respondWithResult(_0x189e99,_0x450cc0){_0x450cc0=_0x450cc0||0xc8;return function(_0x50cbd4){if(_0x50cbd4){return _0x189e99[_0xd582('0x1d')](_0x450cc0)[_0xd582('0x1f')](_0x50cbd4);}};}function respondWithFilteredResult(_0x268418,_0x2844d4){return function(_0x197453){if(_0x197453){var _0x20ee2b=typeof _0x2844d4['offset']==='undefined'&&typeof _0x2844d4[_0xd582('0x20')]===_0xd582('0x21');var _0x57c528=_0x197453[_0xd582('0x22')];var _0x5d4422=_0x20ee2b?0x0:_0x2844d4[_0xd582('0x23')];var _0x1bb015=_0x20ee2b?_0x197453[_0xd582('0x22')]:_0x2844d4[_0xd582('0x23')]+_0x2844d4[_0xd582('0x20')];var _0x38edeb;if(_0x1bb015>=_0x57c528){_0x1bb015=_0x57c528;_0x38edeb=0xc8;}else{_0x38edeb=0xce;}_0x268418[_0xd582('0x1d')](_0x38edeb);return _0x268418['set'](_0xd582('0x24'),_0x5d4422+'-'+_0x1bb015+'/'+_0x57c528)[_0xd582('0x1f')](_0x197453);}return null;};}function patchUpdates(_0xbc0fa2){return function(_0x4a7738){try{jsonpatch[_0xd582('0x25')](_0x4a7738,_0xbc0fa2,!![]);}catch(_0x3c47ec){return BPromise['reject'](_0x3c47ec);}return _0x4a7738[_0xd582('0x26')]();};}function saveUpdates(_0x5a2316,_0xaf6d12){return function(_0xf3c224){if(_0xf3c224){return _0xf3c224['update'](_0x5a2316)[_0xd582('0x27')](function(_0x14df28){return _0x14df28;});}return null;};}function removeEntity(_0x51f89a,_0x8e8b4f){return function(_0x58b472){if(_0x58b472){return _0x58b472[_0xd582('0x28')]()[_0xd582('0x27')](function(){_0x51f89a[_0xd582('0x1d')](0xcc)[_0xd582('0x1e')]();});}};}function handleEntityNotFound(_0x251ba9,_0x46cdcc){return function(_0x36e281){if(!_0x36e281){_0x251ba9[_0xd582('0x29')](0x194);}return _0x36e281;};}function handleError(_0x39da4d,_0x183962){_0x183962=_0x183962||0x1f4;return function(_0x5cbd9a){logger[_0xd582('0x2a')](_0x5cbd9a[_0xd582('0x2b')]);if(_0x5cbd9a['name']){delete _0x5cbd9a[_0xd582('0x2c')];}_0x39da4d[_0xd582('0x1d')](_0x183962)['send'](_0x5cbd9a);};}exports[_0xd582('0x2d')]=function(_0x3c94db,_0x28d929){var _0x40195e={'raw':![],'where':{'id':_0x3c94db[_0xd582('0x2e')]['id']}},_0x5b0817={};_0x5b0817[_0xd582('0x2f')]=_['keys'](db['DashboardItem'][_0xd582('0x30')]);_0x5b0817[_0xd582('0x31')]=_[_0xd582('0x32')](_0x3c94db[_0xd582('0x31')]);_0x5b0817[_0xd582('0x33')]=_[_0xd582('0x34')](_0x5b0817[_0xd582('0x2f')],_0x5b0817[_0xd582('0x31')]);_0x40195e['attributes']=_[_0xd582('0x34')](_0x5b0817['model'],qs[_0xd582('0x35')](_0x3c94db[_0xd582('0x31')][_0xd582('0x35')]));_0x40195e[_0xd582('0x36')]=_0x40195e[_0xd582('0x36')]['length']?_0x40195e[_0xd582('0x36')]:_0x5b0817[_0xd582('0x2f')];if(_0x3c94db['query']['includeAll']){_0x40195e['include']=[{'all':!![]}];}_0x40195e=_['merge']({},_0x40195e,_0x3c94db[_0xd582('0x37')]);return db[_0xd582('0x38')][_0xd582('0x39')](_0x40195e)[_0xd582('0x27')](handleEntityNotFound(_0x28d929,null))[_0xd582('0x27')](respondWithResult(_0x28d929,null))['catch'](handleError(_0x28d929,null));};exports[_0xd582('0x28')]=function(_0x2209ce,_0x369345){return db[_0xd582('0x38')][_0xd582('0x39')]({'where':{'id':_0x2209ce['params']['id']}})[_0xd582('0x27')](handleEntityNotFound(_0x369345,null))[_0xd582('0x27')](removeEntity(_0x369345,null))[_0xd582('0x3a')](handleError(_0x369345,null));};function widgetAttributes(_0x550fb5){try{switch(_0x550fb5[_0xd582('0x3b')]){case _0xd582('0x3c'):return[{'name':_0xd582('0x3d'),'value':_0x550fb5[_0xd582('0x3d')]||(_0x550fb5[_0xd582('0x3e')]&&_0x550fb5['attrs'][0x0]?_0x550fb5[_0xd582('0x3e')][0x0]['value']:undefined)||_0xd582('0x3f')}];case _0xd582('0x40'):return[{'name':_0xd582('0x41'),'value':_0x550fb5['attrPath']||(_0x550fb5[_0xd582('0x3e')]&&_0x550fb5[_0xd582('0x3e')][0x0]?_0x550fb5[_0xd582('0x3e')][0x0][_0xd582('0x42')]:undefined)||''}];case _0xd582('0x43'):return[{'name':_0xd582('0x44'),'value':_0x550fb5[_0xd582('0x44')]||(_0x550fb5[_0xd582('0x3e')]&&_0x550fb5['attrs'][0x0]?_0x550fb5['attrs'][0x0][_0xd582('0x42')]:undefined)||_0xd582('0x45')},{'name':_0xd582('0x46'),'value':_0x550fb5['attrTimezone']||(_0x550fb5['attrs']&&_0x550fb5[_0xd582('0x3e')][0x1]?_0x550fb5[_0xd582('0x3e')][0x1][_0xd582('0x42')]:undefined)||_0xd582('0x47')},{'name':_0xd582('0x48'),'value':_0x550fb5['attrFontSize']||(_0x550fb5[_0xd582('0x3e')]&&_0x550fb5[_0xd582('0x3e')][0x2]?_0x550fb5[_0xd582('0x3e')][0x2]['value']:undefined)||0xc}];case _0xd582('0x49'):return[{'name':'attrMetric','value':_0x550fb5[_0xd582('0x4a')]||(_0x550fb5[_0xd582('0x3e')]&&_0x550fb5[_0xd582('0x3e')][0x0]?_0x550fb5[_0xd582('0x3e')][0x0][_0xd582('0x42')]:undefined)||_0xd582('0x4b')},{'name':'attrVoiceQueues','value':_0x550fb5[_0xd582('0x4c')]||(_0x550fb5[_0xd582('0x3e')]&&_0x550fb5[_0xd582('0x3e')][0x1]?_0x550fb5[_0xd582('0x3e')][0x1][_0xd582('0x42')]:undefined)||[]},{'name':_0xd582('0x48'),'value':_0x550fb5[_0xd582('0x48')]||(_0x550fb5['attrs']&&_0x550fb5[_0xd582('0x3e')][0x2]?_0x550fb5[_0xd582('0x3e')][0x2][_0xd582('0x42')]:undefined)||0x14}];case'multibar-chart':case _0xd582('0x4d'):return[{'name':_0xd582('0x4e'),'value':_0x550fb5['attrSerie1']||(_0x550fb5[_0xd582('0x3e')]&&_0x550fb5[_0xd582('0x3e')][0x0]?_0x550fb5['attrs'][0x0][_0xd582('0x42')]:undefined)||_0xd582('0x4b')},{'name':_0xd582('0x4f'),'value':_0x550fb5[_0xd582('0x4f')]||(_0x550fb5[_0xd582('0x3e')]&&_0x550fb5[_0xd582('0x3e')][0x1]?_0x550fb5[_0xd582('0x3e')][0x1][_0xd582('0x42')]:undefined)||null},{'name':_0xd582('0x50'),'value':_0x550fb5['attrSerie3']||(_0x550fb5[_0xd582('0x3e')]&&_0x550fb5[_0xd582('0x3e')][0x2]?_0x550fb5[_0xd582('0x3e')][0x2][_0xd582('0x42')]:undefined)||null},{'name':_0xd582('0x4c'),'value':_0x550fb5[_0xd582('0x4c')]||(_0x550fb5[_0xd582('0x3e')]&&_0x550fb5[_0xd582('0x3e')][0x3]?_0x550fb5['attrs'][0x3]['value']:undefined)||[]}];case _0xd582('0x51'):return[{'name':'attrReport','type':_0x550fb5[_0xd582('0x52')]||(_0x550fb5[_0xd582('0x3e')]&&_0x550fb5['attrs'][0x0]?_0x550fb5[_0xd582('0x3e')][0x0][_0xd582('0x3b')]:undefined)||null,'value':_0x550fb5[_0xd582('0x53')]||(_0x550fb5[_0xd582('0x3e')]&&_0x550fb5[_0xd582('0x3e')][0x0]?_0x550fb5[_0xd582('0x3e')][0x0][_0xd582('0x42')]:undefined)||null},{'name':_0xd582('0x54'),'value':_0x550fb5[_0xd582('0x54')]||(_0x550fb5[_0xd582('0x3e')]&&_0x550fb5[_0xd582('0x3e')][0x1]?_0x550fb5[_0xd582('0x3e')][0x1][_0xd582('0x42')]:undefined)||0x0}];default:return[];}}catch(_0x1080e9){logger[_0xd582('0x2a')](_0xd582('0x55'),JSON[_0xd582('0x56')](_0x1080e9));return[];}}exports[_0xd582('0x57')]=function(_0x1a9cb7,_0x4eaf0c){if(_0x1a9cb7['body']){_0x1a9cb7['body'][_0xd582('0x3e')]=widgetAttributes(_0x1a9cb7[_0xd582('0x58')]);}return db[_0xd582('0x38')][_0xd582('0x57')](_0x1a9cb7[_0xd582('0x58')],{})[_0xd582('0x27')](respondWithResult(_0x4eaf0c,0xc9))[_0xd582('0x3a')](handleError(_0x4eaf0c,null));};exports['update']=function(_0x3dbd4c,_0x1c3a57){if(_0x3dbd4c['body']['id']){delete _0x3dbd4c[_0xd582('0x58')]['id'];}_0x3dbd4c[_0xd582('0x58')][_0xd582('0x3e')]=widgetAttributes(_0x3dbd4c[_0xd582('0x58')]);return db[_0xd582('0x38')]['find']({'where':{'id':_0x3dbd4c[_0xd582('0x2e')]['id']}})[_0xd582('0x27')](handleEntityNotFound(_0x1c3a57,null))[_0xd582('0x27')](saveUpdates(_0x3dbd4c[_0xd582('0x58')],null))[_0xd582('0x27')](respondWithResult(_0x1c3a57,null))[_0xd582('0x3a')](handleError(_0x1c3a57,null));};
\ No newline at end of file
index 3c17265..f837ca9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe43c=['save','update','emit','hasOwnProperty','hook','events','../../mysqldb','DashboardItem'];(function(_0x5d7d6c,_0x7eefd0){var _0x3c195c=function(_0x497b7e){while(--_0x497b7e){_0x5d7d6c['push'](_0x5d7d6c['shift']());}};_0x3c195c(++_0x7eefd0);}(_0xe43c,0x175));var _0xce43=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe43c[_0x19950b];return _0x3c6b41;};'use strict';var EventEmitter=require(_0xce43('0x0'));var DashboardItem=require(_0xce43('0x1'))['db'][_0xce43('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xce43('0x3'),'afterUpdate':_0xce43('0x4'),'afterDestroy':'remove'};function emitEvent(_0x487165){return function(_0x4fd04c,_0x4f5477,_0x592d7a){DashboardItemEvents[_0xce43('0x5')](_0x487165+':'+_0x4fd04c['id'],_0x4fd04c);DashboardItemEvents[_0xce43('0x5')](_0x487165,_0x4fd04c);_0x592d7a(null);};}for(var e in events){if(events[_0xce43('0x6')](e)){var event=events[e];DashboardItem[_0xce43('0x7')](e,emitEvent(event));}}module['exports']=DashboardItemEvents;
\ No newline at end of file
+var _0x3a18=['hook','exports','events','remove','emit','hasOwnProperty'];(function(_0x293c24,_0x5ba4c7){var _0x253301=function(_0x5a1c7c){while(--_0x5a1c7c){_0x293c24['push'](_0x293c24['shift']());}};_0x253301(++_0x5ba4c7);}(_0x3a18,0x104));var _0x83a1=function(_0x16d97a,_0x2fa85e){_0x16d97a=_0x16d97a-0x0;var _0x236d86=_0x3a18[_0x16d97a];return _0x236d86;};'use strict';var EventEmitter=require(_0x83a1('0x0'));var DashboardItem=require('../../mysqldb')['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x83a1('0x1')};function emitEvent(_0xdcc271){return function(_0x4a8118,_0x9a1262,_0x37ee60){DashboardItemEvents['emit'](_0xdcc271+':'+_0x4a8118['id'],_0x4a8118);DashboardItemEvents[_0x83a1('0x2')](_0xdcc271,_0x4a8118);_0x37ee60(null);};}for(var e in events){if(events[_0x83a1('0x3')](e)){var event=events[e];DashboardItem[_0x83a1('0x4')](e,emitEvent(event));}}module[_0x83a1('0x5')]=DashboardItemEvents;
\ No newline at end of file
index 11e8f86..efa60cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4036=['./dashboardItem.attributes','exports','DashboardItem','dashboard_items','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4036,0x160));var _0x6403=function(_0x34b935,_0x1b0e16){_0x34b935=_0x34b935-0x0;var _0x4acb3c=_0x4036[_0x34b935];return _0x4acb3c;};'use strict';var _=require(_0x6403('0x0'));var util=require(_0x6403('0x1'));var logger=require(_0x6403('0x2'))(_0x6403('0x3'));var moment=require('moment');var BPromise=require(_0x6403('0x4'));var rp=require(_0x6403('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6403('0x6'));var config=require(_0x6403('0x7'));var attributes=require(_0x6403('0x8'));module[_0x6403('0x9')]=function(_0x8620d9,_0x47cb1a){return _0x8620d9['define'](_0x6403('0xa'),attributes,{'tableName':_0x6403('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3572=['../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','../../config/logger','api','moment','request-promise','path'];(function(_0x5cabfa,_0x58df7a){var _0x2a3ed9=function(_0x4bc63f){while(--_0x4bc63f){_0x5cabfa['push'](_0x5cabfa['shift']());}};_0x2a3ed9(++_0x58df7a);}(_0x3572,0x15b));var _0x2357=function(_0x2003ee,_0x4ade68){_0x2003ee=_0x2003ee-0x0;var _0xcd217d=_0x3572[_0x2003ee];return _0xcd217d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2357('0x0'))(_0x2357('0x1'));var moment=require(_0x2357('0x2'));var BPromise=require('bluebird');var rp=require(_0x2357('0x3'));var fs=require('fs');var path=require(_0x2357('0x4'));var rimraf=require('rimraf');var config=require(_0x2357('0x5'));var attributes=require(_0x2357('0x6'));module[_0x2357('0x7')]=function(_0x477842,_0x526cea){return _0x477842[_0x2357('0x8')](_0x2357('0x9'),attributes,{'tableName':_0x2357('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1b963f2..970ad11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6563=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./dashboardItem.socket','register','request','then','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x6c5e56,_0x5eac75){var _0x19552b=function(_0x490122){while(--_0x490122){_0x6c5e56['push'](_0x6c5e56['shift']());}};_0x19552b(++_0x5eac75);}(_0x6563,0x1c2));var _0x3656=function(_0x35a274,_0x98b399){_0x35a274=_0x35a274-0x0;var _0x40d905=_0x6563[_0x35a274];return _0x40d905;};'use strict';var _=require(_0x3656('0x0'));var util=require(_0x3656('0x1'));var moment=require('moment');var BPromise=require(_0x3656('0x2'));var rs=require(_0x3656('0x3'));var fs=require('fs');var Redis=require(_0x3656('0x4'));var db=require(_0x3656('0x5'))['db'];var utils=require(_0x3656('0x6'));var logger=require(_0x3656('0x7'))(_0x3656('0x8'));var config=require(_0x3656('0x9'));var jayson=require(_0x3656('0xa'));var client=jayson[_0x3656('0xb')][_0x3656('0xc')]({'port':0x232a});config[_0x3656('0xd')]=_[_0x3656('0xe')](config[_0x3656('0xd')],{'host':_0x3656('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3656('0xd')]));require(_0x3656('0x10'))[_0x3656('0x11')](socket);function respondWithRpcPromise(_0x3cb18f,_0x44e305,_0x12f53d){return new BPromise(function(_0x2ba908,_0x48add4){return client[_0x3656('0x12')](_0x3cb18f,_0x12f53d)[_0x3656('0x13')](function(_0x4dc5eb){logger['info'](_0x3656('0x14'),_0x44e305,'request\x20sent');logger[_0x3656('0x15')](_0x3656('0x16'),_0x44e305,_0x3656('0x17'),JSON[_0x3656('0x18')](_0x4dc5eb));if(_0x4dc5eb[_0x3656('0x19')]){if(_0x4dc5eb[_0x3656('0x19')][_0x3656('0x1a')]===0x1f4){logger[_0x3656('0x19')](_0x3656('0x14'),_0x44e305,_0x4dc5eb[_0x3656('0x19')]['message']);return _0x48add4(_0x4dc5eb[_0x3656('0x19')][_0x3656('0x1b')]);}logger[_0x3656('0x19')](_0x3656('0x14'),_0x44e305,_0x4dc5eb[_0x3656('0x19')][_0x3656('0x1b')]);return _0x2ba908(_0x4dc5eb[_0x3656('0x19')][_0x3656('0x1b')]);}else{logger[_0x3656('0x1c')]('DashboardItem,\x20%s,\x20%s',_0x44e305,'request\x20sent');_0x2ba908(_0x4dc5eb[_0x3656('0x1d')]['message']);}})['catch'](function(_0xb37993){logger[_0x3656('0x19')](_0x3656('0x14'),_0x44e305,_0xb37993);_0x48add4(_0xb37993);});});}
\ No newline at end of file
+var _0xd2f9=['info','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0xc28bd5,_0x214bd5){var _0x3a9de5=function(_0x5d1ff2){while(--_0x5d1ff2){_0xc28bd5['push'](_0xc28bd5['shift']());}};_0x3a9de5(++_0x214bd5);}(_0xd2f9,0xb0));var _0x9d2f=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xd2f9[_0x139a3c];return _0x2b375b;};'use strict';var _=require(_0x9d2f('0x0'));var util=require('util');var moment=require(_0x9d2f('0x1'));var BPromise=require(_0x9d2f('0x2'));var rs=require(_0x9d2f('0x3'));var fs=require('fs');var Redis=require(_0x9d2f('0x4'));var db=require(_0x9d2f('0x5'))['db'];var utils=require(_0x9d2f('0x6'));var logger=require(_0x9d2f('0x7'))(_0x9d2f('0x8'));var config=require(_0x9d2f('0x9'));var jayson=require(_0x9d2f('0xa'));var client=jayson[_0x9d2f('0xb')][_0x9d2f('0xc')]({'port':0x232a});config[_0x9d2f('0xd')]=_[_0x9d2f('0xe')](config['redis'],{'host':_0x9d2f('0xf'),'port':0x18eb});var socket=require(_0x9d2f('0x10'))(new Redis(config[_0x9d2f('0xd')]));require(_0x9d2f('0x11'))['register'](socket);function respondWithRpcPromise(_0x552439,_0x2de893,_0xb52cc0){return new BPromise(function(_0x3440b3,_0x50c656){return client['request'](_0x552439,_0xb52cc0)[_0x9d2f('0x12')](function(_0x3b192c){logger['info'](_0x9d2f('0x13'),_0x2de893,_0x9d2f('0x14'));logger[_0x9d2f('0x15')](_0x9d2f('0x16'),_0x2de893,'request\x20sent',JSON[_0x9d2f('0x17')](_0x3b192c));if(_0x3b192c['error']){if(_0x3b192c['error'][_0x9d2f('0x18')]===0x1f4){logger[_0x9d2f('0x19')]('DashboardItem,\x20%s,\x20%s',_0x2de893,_0x3b192c[_0x9d2f('0x19')][_0x9d2f('0x1a')]);return _0x50c656(_0x3b192c[_0x9d2f('0x19')][_0x9d2f('0x1a')]);}logger[_0x9d2f('0x19')](_0x9d2f('0x13'),_0x2de893,_0x3b192c[_0x9d2f('0x19')][_0x9d2f('0x1a')]);return _0x3440b3(_0x3b192c[_0x9d2f('0x19')][_0x9d2f('0x1a')]);}else{logger[_0x9d2f('0x1b')](_0x9d2f('0x13'),_0x2de893,_0x9d2f('0x14'));_0x3440b3(_0x3b192c['result'][_0x9d2f('0x1a')]);}})[_0x9d2f('0x1c')](function(_0x2f4102){logger[_0x9d2f('0x19')]('DashboardItem,\x20%s,\x20%s',_0x2de893,_0x2f4102);_0x50c656(_0x2f4102);});});}
\ No newline at end of file
index 4f99a65..24a2efe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa61f=['save','remove','update','removeListener','register','length','dashboardItem:','./dashboardItem.events'];(function(_0x116538,_0x1d9449){var _0x521263=function(_0xc68ee7){while(--_0xc68ee7){_0x116538['push'](_0x116538['shift']());}};_0x521263(++_0x1d9449);}(_0xa61f,0x1df));var _0xfa61=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xa61f[_0x8c43de];return _0xa6591b;};'use strict';var DashboardItemEvents=require(_0xfa61('0x0'));var events=[_0xfa61('0x1'),_0xfa61('0x2'),_0xfa61('0x3')];function createListener(_0xc9b3dc,_0x7114f6){return function(_0x9cded4){_0x7114f6['emit'](_0xc9b3dc,_0x9cded4);};}function removeListener(_0x20324f,_0x239853){return function(){DashboardItemEvents[_0xfa61('0x4')](_0x20324f,_0x239853);};}exports[_0xfa61('0x5')]=function(_0xc36448){for(var _0x2498fb=0x0,_0x3893b9=events[_0xfa61('0x6')];_0x2498fb<_0x3893b9;_0x2498fb++){var _0x2ff828=events[_0x2498fb];var _0x3196e1=createListener(_0xfa61('0x7')+_0x2ff828,_0xc36448);DashboardItemEvents['on'](_0x2ff828,_0x3196e1);}};
\ No newline at end of file
+var _0x357f=['save','remove','emit','removeListener','register','dashboardItem:','./dashboardItem.events'];(function(_0x81dade,_0x214864){var _0x3b7224=function(_0x1ee304){while(--_0x1ee304){_0x81dade['push'](_0x81dade['shift']());}};_0x3b7224(++_0x214864);}(_0x357f,0xfb));var _0xf357=function(_0xc84b86,_0xf8c0c1){_0xc84b86=_0xc84b86-0x0;var _0x3775fc=_0x357f[_0xc84b86];return _0x3775fc;};'use strict';var DashboardItemEvents=require(_0xf357('0x0'));var events=[_0xf357('0x1'),_0xf357('0x2'),'update'];function createListener(_0x35efbd,_0x16d6a7){return function(_0x399a60){_0x16d6a7[_0xf357('0x3')](_0x35efbd,_0x399a60);};}function removeListener(_0x360a95,_0x52bf23){return function(){DashboardItemEvents[_0xf357('0x4')](_0x360a95,_0x52bf23);};}exports[_0xf357('0x5')]=function(_0x5c01ea){for(var _0x3311f0=0x0,_0x543ea1=events['length'];_0x3311f0<_0x543ea1;_0x3311f0++){var _0x1d74af=events[_0x3311f0];var _0x135535=createListener(_0xf357('0x6')+_0x1d74af,_0x5c01ea);DashboardItemEvents['on'](_0x1d74af,_0x135535);}};
\ No newline at end of file
index be02f96..3dbbfa6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc60f=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./dashboardItem.controller','/:id','isAuthenticated','post','put','update','destroy','exports','util'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xc60f,0x1b2));var _0xfc60=function(_0x328bd3,_0x9cf5a5){_0x328bd3=_0x328bd3-0x0;var _0x458149=_0xc60f[_0x328bd3];return _0x458149;};'use strict';var multer=require('multer');var util=require(_0xfc60('0x0'));var path=require('path');var timeout=require(_0xfc60('0x1'));var express=require(_0xfc60('0x2'));var router=express[_0xfc60('0x3')]();var fs_extra=require(_0xfc60('0x4'));var auth=require(_0xfc60('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfc60('0x6'));var controller=require(_0xfc60('0x7'));router['get'](_0xfc60('0x8'),auth[_0xfc60('0x9')](),controller['show']);router[_0xfc60('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0xfc60('0xb')](_0xfc60('0x8'),auth['isAuthenticated'](),controller[_0xfc60('0xc')]);router['delete']('/:id',auth[_0xfc60('0x9')](),controller[_0xfc60('0xd')]);module[_0xfc60('0xe')]=router;
\ No newline at end of file
+var _0x9bab=['delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','create','put','update'];(function(_0x35774e,_0x288c7c){var _0x5c3b87=function(_0x30e2c6){while(--_0x30e2c6){_0x35774e['push'](_0x35774e['shift']());}};_0x5c3b87(++_0x288c7c);}(_0x9bab,0x123));var _0xb9ba=function(_0x3b0998,_0x5e528e){_0x3b0998=_0x3b0998-0x0;var _0x3af98d=_0x9bab[_0x3b0998];return _0x3af98d;};'use strict';var multer=require(_0xb9ba('0x0'));var util=require(_0xb9ba('0x1'));var path=require(_0xb9ba('0x2'));var timeout=require(_0xb9ba('0x3'));var express=require(_0xb9ba('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb9ba('0x5'));var interaction=require(_0xb9ba('0x6'));var config=require(_0xb9ba('0x7'));var controller=require(_0xb9ba('0x8'));router[_0xb9ba('0x9')](_0xb9ba('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xb9ba('0xb')](),controller[_0xb9ba('0xc')]);router[_0xb9ba('0xd')](_0xb9ba('0xa'),auth[_0xb9ba('0xb')](),controller[_0xb9ba('0xe')]);router[_0xb9ba('0xf')](_0xb9ba('0xa'),auth[_0xb9ba('0xb')](),controller[_0xb9ba('0x10')]);module['exports']=router;
\ No newline at end of file
index 698f14d..4f0a857 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfbec=['exports','STRING','ENUM','first','second','third','sequelize'];(function(_0x1fddfd,_0x153a74){var _0x595b32=function(_0x2512d4){while(--_0x2512d4){_0x1fddfd['push'](_0x1fddfd['shift']());}};_0x595b32(++_0x153a74);}(_0xfbec,0x13a));var _0xcfbe=function(_0x3735a8,_0x5ad001){_0x3735a8=_0x3735a8-0x0;var _0x516404=_0xfbec[_0x3735a8];return _0x516404;};'use strict';var Sequelize=require(_0xcfbe('0x0'));module[_0xcfbe('0x1')]={'name':{'type':Sequelize[_0xcfbe('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xcfbe('0x3')](_0xcfbe('0x4'),_0xcfbe('0x5'),_0xcfbe('0x6')),'allowNull':![],'defaultValue':_0xcfbe('0x4')},'description':{'type':Sequelize[_0xcfbe('0x2')]}};
\ No newline at end of file
+var _0x4cc2=['ENUM','second','first','sequelize','exports','STRING'];(function(_0x494d21,_0x8b676a){var _0x2076b9=function(_0x4341dc){while(--_0x4341dc){_0x494d21['push'](_0x494d21['shift']());}};_0x2076b9(++_0x8b676a);}(_0x4cc2,0xa5));var _0x24cc=function(_0x2864be,_0x3aa8b9){_0x2864be=_0x2864be-0x0;var _0xb336bc=_0x4cc2[_0x2864be];return _0xb336bc;};'use strict';var Sequelize=require(_0x24cc('0x0'));module[_0x24cc('0x1')]={'name':{'type':Sequelize[_0x24cc('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x24cc('0x3')]('first',_0x24cc('0x4'),'third'),'allowNull':![],'defaultValue':_0x24cc('0x5')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 386d33b..5f57bb5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd9ce=['ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','reject','save','update','then','Dispositions','UserProfileResource','destroy','end','error','name','send','index','Disposition','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','map','filter','merge','options','findAll','catch','show','params','length','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv'];(function(_0xc91266,_0x5091fb){var _0x39014c=function(_0x13b392){while(--_0x13b392){_0xc91266['push'](_0xc91266['shift']());}};_0x39014c(++_0x5091fb);}(_0xd9ce,0xeb));var _0xed9c=function(_0x1221e8,_0x2e7229){_0x1221e8=_0x1221e8-0x0;var _0x3f3041=_0xd9ce[_0x1221e8];return _0x3f3041;};'use strict';var emlformat=require(_0xed9c('0x0'));var rimraf=require(_0xed9c('0x1'));var zipdir=require(_0xed9c('0x2'));var jsonpatch=require(_0xed9c('0x3'));var rp=require(_0xed9c('0x4'));var moment=require(_0xed9c('0x5'));var BPromise=require(_0xed9c('0x6'));var Mustache=require(_0xed9c('0x7'));var util=require('util');var path=require(_0xed9c('0x8'));var sox=require(_0xed9c('0x9'));var csv=require(_0xed9c('0xa'));var ejs=require(_0xed9c('0xb'));var fs=require('fs');var fs_extra=require(_0xed9c('0xc'));var _=require(_0xed9c('0xd'));var squel=require('squel');var crypto=require(_0xed9c('0xe'));var jsforce=require(_0xed9c('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xed9c('0x10'));var Papa=require('papaparse');var Redis=require(_0xed9c('0x11'));var authService=require(_0xed9c('0x12'));var qs=require(_0xed9c('0x13'));var as=require(_0xed9c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xed9c('0x15'))(_0xed9c('0x16'));var utils=require(_0xed9c('0x17'));var config=require(_0xed9c('0x18'));var licenseUtil=require(_0xed9c('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52be22,_0x88a8f9){_0x88a8f9=_0x88a8f9||0xcc;return function(_0x2153be){if(_0x2153be){return _0x52be22[_0xed9c('0x1a')](_0x88a8f9);}return _0x52be22[_0xed9c('0x1b')](_0x88a8f9)['end']();};}function respondWithResult(_0x5a5d8d,_0x99a5ee){_0x99a5ee=_0x99a5ee||0xc8;return function(_0x50a934){if(_0x50a934){return _0x5a5d8d[_0xed9c('0x1b')](_0x99a5ee)[_0xed9c('0x1c')](_0x50a934);}};}function respondWithFilteredResult(_0x95f79,_0x3fd63e){return function(_0x737656){if(_0x737656){var _0x22a28d=typeof _0x3fd63e[_0xed9c('0x1d')]==='undefined'&&typeof _0x3fd63e[_0xed9c('0x1e')]===_0xed9c('0x1f');var _0x2d45d9=_0x737656['count'];var _0x485029=_0x22a28d?0x0:_0x3fd63e[_0xed9c('0x1d')];var _0x48b7b4=_0x22a28d?_0x737656[_0xed9c('0x20')]:_0x3fd63e[_0xed9c('0x1d')]+_0x3fd63e[_0xed9c('0x1e')];var _0x2d432e;if(_0x48b7b4>=_0x2d45d9){_0x48b7b4=_0x2d45d9;_0x2d432e=0xc8;}else{_0x2d432e=0xce;}_0x95f79[_0xed9c('0x1b')](_0x2d432e);return _0x95f79[_0xed9c('0x21')]('Content-Range',_0x485029+'-'+_0x48b7b4+'/'+_0x2d45d9)[_0xed9c('0x1c')](_0x737656);}return null;};}function patchUpdates(_0x32c67e){return function(_0x45dc96){try{jsonpatch['apply'](_0x45dc96,_0x32c67e,!![]);}catch(_0x129c5f){return BPromise[_0xed9c('0x22')](_0x129c5f);}return _0x45dc96[_0xed9c('0x23')]();};}function saveUpdates(_0xd5bac1,_0x55ef58){return function(_0x538a70){if(_0x538a70){return _0x538a70[_0xed9c('0x24')](_0xd5bac1)[_0xed9c('0x25')](function(_0xc7a92a){return _0xc7a92a;});}return null;};}function removeEntity(_0x2ae3ce,_0x1fd75d){return function(_0x340c6){if(_0x340c6){return _0x340c6['destroy']()[_0xed9c('0x25')](function(){var _0x5b771f=_0x340c6['get']({'plain':!![]});var _0x495055=_0xed9c('0x26');return db[_0xed9c('0x27')][_0xed9c('0x28')]({'where':{'type':_0x495055,'resourceId':_0x5b771f['id']}})[_0xed9c('0x25')](function(){return _0x340c6;});})['then'](function(){_0x2ae3ce[_0xed9c('0x1b')](0xcc)[_0xed9c('0x29')]();});}};}function handleEntityNotFound(_0x262f82,_0x519ad6){return function(_0xe3be1){if(!_0xe3be1){_0x262f82[_0xed9c('0x1a')](0x194);}return _0xe3be1;};}function handleError(_0x16396b,_0x397333){_0x397333=_0x397333||0x1f4;return function(_0x548eab){logger[_0xed9c('0x2a')](_0x548eab['stack']);if(_0x548eab[_0xed9c('0x2b')]){delete _0x548eab[_0xed9c('0x2b')];}_0x16396b[_0xed9c('0x1b')](_0x397333)[_0xed9c('0x2c')](_0x548eab);};}exports[_0xed9c('0x2d')]=function(_0x4ccb84,_0x55d27e){var _0x241372={},_0x9a2584={},_0x13d128={'count':0x0,'rows':[]};var _0xf6ddf4=_['map'](db[_0xed9c('0x2e')][_0xed9c('0x2f')],function(_0x34579c){return{'name':_0x34579c[_0xed9c('0x30')],'type':_0x34579c[_0xed9c('0x31')]['key']};});_0x9a2584[_0xed9c('0x32')]=_['map'](_0xf6ddf4,_0xed9c('0x2b'));_0x9a2584[_0xed9c('0x33')]=_[_0xed9c('0x34')](_0x4ccb84[_0xed9c('0x33')]);_0x9a2584[_0xed9c('0x35')]=_[_0xed9c('0x36')](_0x9a2584[_0xed9c('0x32')],_0x9a2584[_0xed9c('0x33')]);_0x241372[_0xed9c('0x37')]=_[_0xed9c('0x36')](_0x9a2584[_0xed9c('0x32')],qs[_0xed9c('0x38')](_0x4ccb84[_0xed9c('0x33')][_0xed9c('0x38')]));_0x241372[_0xed9c('0x37')]=_0x241372[_0xed9c('0x37')]['length']?_0x241372[_0xed9c('0x37')]:_0x9a2584[_0xed9c('0x32')];if(!_0x4ccb84[_0xed9c('0x33')][_0xed9c('0x39')]('nolimit')){_0x241372[_0xed9c('0x1e')]=qs[_0xed9c('0x1e')](_0x4ccb84[_0xed9c('0x33')][_0xed9c('0x1e')]);_0x241372[_0xed9c('0x1d')]=qs[_0xed9c('0x1d')](_0x4ccb84[_0xed9c('0x33')][_0xed9c('0x1d')]);}_0x241372[_0xed9c('0x3a')]=qs[_0xed9c('0x3b')](_0x4ccb84['query']['sort']);_0x241372[_0xed9c('0x3c')]=qs[_0xed9c('0x35')](_[_0xed9c('0x3d')](_0x4ccb84['query'],_0x9a2584[_0xed9c('0x35')]),_0xf6ddf4);if(_0x4ccb84['query']['filter']){_0x241372[_0xed9c('0x3c')]=_['merge'](_0x241372['where'],{'$or':_[_0xed9c('0x3e')](_0xf6ddf4,function(_0x4ccbbf){if(_0x4ccbbf[_0xed9c('0x31')]!=='VIRTUAL'){var _0x142634={};_0x142634[_0x4ccbbf['name']]={'$like':'%'+_0x4ccb84[_0xed9c('0x33')][_0xed9c('0x3f')]+'%'};return _0x142634;}})});}_0x241372=_[_0xed9c('0x40')]({},_0x241372,_0x4ccb84[_0xed9c('0x41')]);var _0x39ffb6={'where':_0x241372[_0xed9c('0x3c')]};return db[_0xed9c('0x2e')]['count'](_0x39ffb6)[_0xed9c('0x25')](function(_0x18918f){_0x13d128[_0xed9c('0x20')]=_0x18918f;if(_0x4ccb84['query']['includeAll']){_0x241372['include']=[{'all':!![]}];}return db['Disposition'][_0xed9c('0x42')](_0x241372);})[_0xed9c('0x25')](function(_0x30894d){_0x13d128['rows']=_0x30894d;return _0x13d128;})['then'](respondWithFilteredResult(_0x55d27e,_0x241372))[_0xed9c('0x43')](handleError(_0x55d27e,null));};exports[_0xed9c('0x44')]=function(_0x1a72a8,_0x2239ed){var _0x37f6c7={'raw':!![],'where':{'id':_0x1a72a8[_0xed9c('0x45')]['id']}},_0x15b5c1={};_0x15b5c1[_0xed9c('0x32')]=_[_0xed9c('0x34')](db[_0xed9c('0x2e')][_0xed9c('0x2f')]);_0x15b5c1[_0xed9c('0x33')]=_[_0xed9c('0x34')](_0x1a72a8['query']);_0x15b5c1['filters']=_['intersection'](_0x15b5c1['model'],_0x15b5c1[_0xed9c('0x33')]);_0x37f6c7[_0xed9c('0x37')]=_[_0xed9c('0x36')](_0x15b5c1[_0xed9c('0x32')],qs[_0xed9c('0x38')](_0x1a72a8[_0xed9c('0x33')][_0xed9c('0x38')]));_0x37f6c7['attributes']=_0x37f6c7['attributes'][_0xed9c('0x46')]?_0x37f6c7[_0xed9c('0x37')]:_0x15b5c1['model'];if(_0x1a72a8[_0xed9c('0x33')]['includeAll']){_0x37f6c7[_0xed9c('0x47')]=[{'all':!![]}];}_0x37f6c7=_[_0xed9c('0x40')]({},_0x37f6c7,_0x1a72a8[_0xed9c('0x41')]);return db[_0xed9c('0x2e')]['find'](_0x37f6c7)[_0xed9c('0x25')](handleEntityNotFound(_0x2239ed,null))[_0xed9c('0x25')](respondWithResult(_0x2239ed,null))[_0xed9c('0x43')](handleError(_0x2239ed,null));};exports[_0xed9c('0x48')]=function(_0x4b488e,_0x108c46){return db['Disposition']['create'](_0x4b488e[_0xed9c('0x49')],{})[_0xed9c('0x25')](function(_0x4c7467){var _0xa6f32a=_0x4b488e[_0xed9c('0x4a')]['get']({'plain':!![]});if(!_0xa6f32a)throw new Error(_0xed9c('0x4b'));if(_0xa6f32a[_0xed9c('0x4c')]==='user'){var _0x4f304a=_0x4c7467[_0xed9c('0x4d')]({'plain':!![]});var _0x3f6584=_0xed9c('0x26');return db[_0xed9c('0x4e')][_0xed9c('0x4f')]({'where':{'name':_0x3f6584,'userProfileId':_0xa6f32a[_0xed9c('0x50')]},'raw':!![]})[_0xed9c('0x25')](function(_0x23e3d6){if(_0x23e3d6&&_0x23e3d6['autoAssociation']===0x0){return db[_0xed9c('0x27')]['create']({'name':_0x4f304a[_0xed9c('0x2b')],'resourceId':_0x4f304a['id'],'type':_0x23e3d6['name'],'sectionId':_0x23e3d6['id']},{})['then'](function(){return _0x4c7467;});}else{return _0x4c7467;}})['catch'](function(_0x5e277a){logger[_0xed9c('0x2a')](_0xed9c('0x51'),_0x5e277a);throw _0x5e277a;});}return _0x4c7467;})['then'](respondWithResult(_0x108c46,0xc9))['catch'](handleError(_0x108c46,null));};exports[_0xed9c('0x24')]=function(_0x1aa564,_0x3b829b){if(_0x1aa564[_0xed9c('0x49')]['id']){delete _0x1aa564[_0xed9c('0x49')]['id'];}return db[_0xed9c('0x2e')][_0xed9c('0x4f')]({'where':{'id':_0x1aa564[_0xed9c('0x45')]['id']}})[_0xed9c('0x25')](handleEntityNotFound(_0x3b829b,null))[_0xed9c('0x25')](saveUpdates(_0x1aa564[_0xed9c('0x49')],null))[_0xed9c('0x25')](respondWithResult(_0x3b829b,null))[_0xed9c('0x43')](handleError(_0x3b829b,null));};exports[_0xed9c('0x28')]=function(_0x337c98,_0x2b32cb){return db['Disposition'][_0xed9c('0x4f')]({'where':{'id':_0x337c98[_0xed9c('0x45')]['id']}})['then'](handleEntityNotFound(_0x2b32cb,null))[_0xed9c('0x25')](removeEntity(_0x2b32cb,null))[_0xed9c('0x43')](handleError(_0x2b32cb,null));};
\ No newline at end of file
+var _0xe7e4=['../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','Dispositions','UserProfileResource','end','name','index','map','Disposition','fieldName','type','key','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','catch','show','params','intersection','includeAll','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x5b0dd3,_0x279520){var _0x408e8f=function(_0xbecac9){while(--_0xbecac9){_0x5b0dd3['push'](_0x5b0dd3['shift']());}};_0x408e8f(++_0x279520);}(_0xe7e4,0x1be));var _0x4e7e=function(_0x1770f3,_0x1dc21a){_0x1770f3=_0x1770f3-0x0;var _0x3aee62=_0xe7e4[_0x1770f3];return _0x3aee62;};'use strict';var emlformat=require(_0x4e7e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4e7e('0x1'));var jsonpatch=require(_0x4e7e('0x2'));var rp=require(_0x4e7e('0x3'));var moment=require('moment');var BPromise=require(_0x4e7e('0x4'));var Mustache=require(_0x4e7e('0x5'));var util=require(_0x4e7e('0x6'));var path=require('path');var sox=require(_0x4e7e('0x7'));var csv=require(_0x4e7e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4e7e('0x9'));var squel=require(_0x4e7e('0xa'));var crypto=require('crypto');var jsforce=require(_0x4e7e('0xb'));var deskjs=require(_0x4e7e('0xc'));var toCsv=require(_0x4e7e('0x8'));var querystring=require(_0x4e7e('0xd'));var Papa=require('papaparse');var Redis=require(_0x4e7e('0xe'));var authService=require(_0x4e7e('0xf'));var qs=require(_0x4e7e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4e7e('0x11'));var logger=require('../../config/logger')(_0x4e7e('0x12'));var utils=require('../../config/utils');var config=require(_0x4e7e('0x13'));var licenseUtil=require(_0x4e7e('0x14'));var db=require(_0x4e7e('0x15'))['db'];function respondWithStatusCode(_0x13b645,_0x335939){_0x335939=_0x335939||0xcc;return function(_0x344c16){if(_0x344c16){return _0x13b645[_0x4e7e('0x16')](_0x335939);}return _0x13b645[_0x4e7e('0x17')](_0x335939)['end']();};}function respondWithResult(_0x415bda,_0x2519bf){_0x2519bf=_0x2519bf||0xc8;return function(_0x4488ee){if(_0x4488ee){return _0x415bda[_0x4e7e('0x17')](_0x2519bf)[_0x4e7e('0x18')](_0x4488ee);}};}function respondWithFilteredResult(_0x460c87,_0x275363){return function(_0x172e00){if(_0x172e00){var _0xa088ed=typeof _0x275363[_0x4e7e('0x19')]===_0x4e7e('0x1a')&&typeof _0x275363[_0x4e7e('0x1b')]==='undefined';var _0x48303e=_0x172e00[_0x4e7e('0x1c')];var _0x149186=_0xa088ed?0x0:_0x275363['offset'];var _0x28b6b7=_0xa088ed?_0x172e00[_0x4e7e('0x1c')]:_0x275363[_0x4e7e('0x19')]+_0x275363['limit'];var _0xc19ea8;if(_0x28b6b7>=_0x48303e){_0x28b6b7=_0x48303e;_0xc19ea8=0xc8;}else{_0xc19ea8=0xce;}_0x460c87[_0x4e7e('0x17')](_0xc19ea8);return _0x460c87[_0x4e7e('0x1d')](_0x4e7e('0x1e'),_0x149186+'-'+_0x28b6b7+'/'+_0x48303e)['json'](_0x172e00);}return null;};}function patchUpdates(_0x5648be){return function(_0x53fabf){try{jsonpatch[_0x4e7e('0x1f')](_0x53fabf,_0x5648be,!![]);}catch(_0x82a4dc){return BPromise['reject'](_0x82a4dc);}return _0x53fabf['save']();};}function saveUpdates(_0x4b7594,_0x1b6832){return function(_0x1f89ce){if(_0x1f89ce){return _0x1f89ce[_0x4e7e('0x20')](_0x4b7594)[_0x4e7e('0x21')](function(_0x2eb3eb){return _0x2eb3eb;});}return null;};}function removeEntity(_0x305fad,_0x12fc17){return function(_0x5cab1a){if(_0x5cab1a){return _0x5cab1a[_0x4e7e('0x22')]()[_0x4e7e('0x21')](function(){var _0x22319b=_0x5cab1a[_0x4e7e('0x23')]({'plain':!![]});var _0x4043a4=_0x4e7e('0x24');return db[_0x4e7e('0x25')]['destroy']({'where':{'type':_0x4043a4,'resourceId':_0x22319b['id']}})[_0x4e7e('0x21')](function(){return _0x5cab1a;});})[_0x4e7e('0x21')](function(){_0x305fad['status'](0xcc)[_0x4e7e('0x26')]();});}};}function handleEntityNotFound(_0x2ea03b,_0x4867b8){return function(_0x2d0aa0){if(!_0x2d0aa0){_0x2ea03b[_0x4e7e('0x16')](0x194);}return _0x2d0aa0;};}function handleError(_0x495cda,_0x1f1891){_0x1f1891=_0x1f1891||0x1f4;return function(_0x4d9a26){logger['error'](_0x4d9a26['stack']);if(_0x4d9a26[_0x4e7e('0x27')]){delete _0x4d9a26[_0x4e7e('0x27')];}_0x495cda['status'](_0x1f1891)['send'](_0x4d9a26);};}exports[_0x4e7e('0x28')]=function(_0x538366,_0x162ae5){var _0x3c2964={},_0x3ccddb={},_0x3607c3={'count':0x0,'rows':[]};var _0xc4d350=_[_0x4e7e('0x29')](db[_0x4e7e('0x2a')]['rawAttributes'],function(_0x2fdca6){return{'name':_0x2fdca6[_0x4e7e('0x2b')],'type':_0x2fdca6[_0x4e7e('0x2c')][_0x4e7e('0x2d')]};});_0x3ccddb[_0x4e7e('0x2e')]=_[_0x4e7e('0x29')](_0xc4d350,_0x4e7e('0x27'));_0x3ccddb[_0x4e7e('0x2f')]=_[_0x4e7e('0x30')](_0x538366[_0x4e7e('0x2f')]);_0x3ccddb[_0x4e7e('0x31')]=_['intersection'](_0x3ccddb[_0x4e7e('0x2e')],_0x3ccddb[_0x4e7e('0x2f')]);_0x3c2964['attributes']=_['intersection'](_0x3ccddb[_0x4e7e('0x2e')],qs[_0x4e7e('0x32')](_0x538366['query'][_0x4e7e('0x32')]));_0x3c2964[_0x4e7e('0x33')]=_0x3c2964[_0x4e7e('0x33')]['length']?_0x3c2964[_0x4e7e('0x33')]:_0x3ccddb[_0x4e7e('0x2e')];if(!_0x538366[_0x4e7e('0x2f')][_0x4e7e('0x34')](_0x4e7e('0x35'))){_0x3c2964[_0x4e7e('0x1b')]=qs[_0x4e7e('0x1b')](_0x538366['query']['limit']);_0x3c2964[_0x4e7e('0x19')]=qs[_0x4e7e('0x19')](_0x538366['query']['offset']);}_0x3c2964[_0x4e7e('0x36')]=qs[_0x4e7e('0x37')](_0x538366[_0x4e7e('0x2f')][_0x4e7e('0x37')]);_0x3c2964['where']=qs['filters'](_[_0x4e7e('0x38')](_0x538366[_0x4e7e('0x2f')],_0x3ccddb[_0x4e7e('0x31')]),_0xc4d350);if(_0x538366[_0x4e7e('0x2f')][_0x4e7e('0x39')]){_0x3c2964[_0x4e7e('0x3a')]=_[_0x4e7e('0x3b')](_0x3c2964[_0x4e7e('0x3a')],{'$or':_[_0x4e7e('0x29')](_0xc4d350,function(_0x1750bf){if(_0x1750bf[_0x4e7e('0x2c')]!==_0x4e7e('0x3c')){var _0x37b820={};_0x37b820[_0x1750bf[_0x4e7e('0x27')]]={'$like':'%'+_0x538366[_0x4e7e('0x2f')][_0x4e7e('0x39')]+'%'};return _0x37b820;}})});}_0x3c2964=_[_0x4e7e('0x3b')]({},_0x3c2964,_0x538366[_0x4e7e('0x3d')]);var _0x18e67d={'where':_0x3c2964[_0x4e7e('0x3a')]};return db[_0x4e7e('0x2a')][_0x4e7e('0x1c')](_0x18e67d)['then'](function(_0x390585){_0x3607c3[_0x4e7e('0x1c')]=_0x390585;if(_0x538366[_0x4e7e('0x2f')]['includeAll']){_0x3c2964[_0x4e7e('0x3e')]=[{'all':!![]}];}return db[_0x4e7e('0x2a')]['findAll'](_0x3c2964);})[_0x4e7e('0x21')](function(_0x2955d6){_0x3607c3[_0x4e7e('0x3f')]=_0x2955d6;return _0x3607c3;})['then'](respondWithFilteredResult(_0x162ae5,_0x3c2964))[_0x4e7e('0x40')](handleError(_0x162ae5,null));};exports[_0x4e7e('0x41')]=function(_0x58ef67,_0x3b0b73){var _0x3dc3e2={'raw':!![],'where':{'id':_0x58ef67[_0x4e7e('0x42')]['id']}},_0x2306de={};_0x2306de['model']=_[_0x4e7e('0x30')](db[_0x4e7e('0x2a')]['rawAttributes']);_0x2306de['query']=_[_0x4e7e('0x30')](_0x58ef67[_0x4e7e('0x2f')]);_0x2306de[_0x4e7e('0x31')]=_[_0x4e7e('0x43')](_0x2306de['model'],_0x2306de[_0x4e7e('0x2f')]);_0x3dc3e2[_0x4e7e('0x33')]=_['intersection'](_0x2306de[_0x4e7e('0x2e')],qs[_0x4e7e('0x32')](_0x58ef67[_0x4e7e('0x2f')]['fields']));_0x3dc3e2[_0x4e7e('0x33')]=_0x3dc3e2['attributes']['length']?_0x3dc3e2[_0x4e7e('0x33')]:_0x2306de['model'];if(_0x58ef67['query'][_0x4e7e('0x44')]){_0x3dc3e2[_0x4e7e('0x3e')]=[{'all':!![]}];}_0x3dc3e2=_['merge']({},_0x3dc3e2,_0x58ef67[_0x4e7e('0x3d')]);return db[_0x4e7e('0x2a')]['find'](_0x3dc3e2)[_0x4e7e('0x21')](handleEntityNotFound(_0x3b0b73,null))['then'](respondWithResult(_0x3b0b73,null))[_0x4e7e('0x40')](handleError(_0x3b0b73,null));};exports[_0x4e7e('0x45')]=function(_0x30cda1,_0x70ef27){return db[_0x4e7e('0x2a')]['create'](_0x30cda1[_0x4e7e('0x46')],{})[_0x4e7e('0x21')](function(_0x10aaf2){var _0x9e3576=_0x30cda1[_0x4e7e('0x47')][_0x4e7e('0x23')]({'plain':!![]});if(!_0x9e3576)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x9e3576['role']==='user'){var _0x3195a1=_0x10aaf2[_0x4e7e('0x23')]({'plain':!![]});var _0x281a48=_0x4e7e('0x24');return db[_0x4e7e('0x48')][_0x4e7e('0x49')]({'where':{'name':_0x281a48,'userProfileId':_0x9e3576[_0x4e7e('0x4a')]},'raw':!![]})[_0x4e7e('0x21')](function(_0x45f499){if(_0x45f499&&_0x45f499[_0x4e7e('0x4b')]===0x0){return db[_0x4e7e('0x25')][_0x4e7e('0x45')]({'name':_0x3195a1[_0x4e7e('0x27')],'resourceId':_0x3195a1['id'],'type':_0x45f499[_0x4e7e('0x27')],'sectionId':_0x45f499['id']},{})['then'](function(){return _0x10aaf2;});}else{return _0x10aaf2;}})[_0x4e7e('0x40')](function(_0x2b5c1a){logger['error'](_0x4e7e('0x4c'),_0x2b5c1a);throw _0x2b5c1a;});}return _0x10aaf2;})[_0x4e7e('0x21')](respondWithResult(_0x70ef27,0xc9))[_0x4e7e('0x40')](handleError(_0x70ef27,null));};exports[_0x4e7e('0x20')]=function(_0x34e668,_0x3563dd){if(_0x34e668[_0x4e7e('0x46')]['id']){delete _0x34e668['body']['id'];}return db[_0x4e7e('0x2a')][_0x4e7e('0x49')]({'where':{'id':_0x34e668[_0x4e7e('0x42')]['id']}})[_0x4e7e('0x21')](handleEntityNotFound(_0x3563dd,null))[_0x4e7e('0x21')](saveUpdates(_0x34e668[_0x4e7e('0x46')],null))[_0x4e7e('0x21')](respondWithResult(_0x3563dd,null))[_0x4e7e('0x40')](handleError(_0x3563dd,null));};exports['destroy']=function(_0x2140a2,_0x3c79c3){return db['Disposition'][_0x4e7e('0x49')]({'where':{'id':_0x2140a2[_0x4e7e('0x42')]['id']}})[_0x4e7e('0x21')](handleEntityNotFound(_0x3c79c3,null))[_0x4e7e('0x21')](removeEntity(_0x3c79c3,null))[_0x4e7e('0x40')](handleError(_0x3c79c3,null));};
\ No newline at end of file
index 7a21932..6426cb5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8dfe=['FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','util','../../config/logger','api','moment','request-promise','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','name_sms'];(function(_0x2871b8,_0x13642c){var _0x201ba3=function(_0x1df301){while(--_0x1df301){_0x2871b8['push'](_0x2871b8['shift']());}};_0x201ba3(++_0x13642c);}(_0x8dfe,0x72));var _0xe8df=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8dfe[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0xe8df('0x0'));var logger=require(_0xe8df('0x1'))(_0xe8df('0x2'));var moment=require(_0xe8df('0x3'));var BPromise=require('bluebird');var rp=require(_0xe8df('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe8df('0x5'));var attributes=require(_0xe8df('0x6'));module[_0xe8df('0x7')]=function(_0x301866,_0x5954c8){return _0x301866[_0xe8df('0x8')](_0xe8df('0x9'),attributes,{'tableName':_0xe8df('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xe8df('0xb'),'fields':[_0xe8df('0xc'),_0xe8df('0xd')]},{'unique':!![],'name':_0xe8df('0xe'),'fields':[_0xe8df('0xc'),_0xe8df('0xf')]},{'unique':!![],'name':_0xe8df('0x10'),'fields':[_0xe8df('0xc'),'MailAccountId']},{'unique':!![],'name':_0xe8df('0x11'),'fields':[_0xe8df('0xc'),'SmsAccountId']},{'unique':!![],'name':'name_fax','fields':['name',_0xe8df('0x12')]},{'unique':!![],'name':_0xe8df('0x13'),'fields':['name',_0xe8df('0x14')]},{'unique':!![],'name':_0xe8df('0x15'),'fields':[_0xe8df('0xc'),'WhatsappAccountId']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9cb9=['name','name_chat','MailAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice'];(function(_0x207d20,_0x224093){var _0x453cda=function(_0x44a4e1){while(--_0x44a4e1){_0x207d20['push'](_0x207d20['shift']());}};_0x453cda(++_0x224093);}(_0x9cb9,0x7c));var _0x99cb=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x9cb9[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x99cb('0x0'));var util=require(_0x99cb('0x1'));var logger=require(_0x99cb('0x2'))('api');var moment=require(_0x99cb('0x3'));var BPromise=require(_0x99cb('0x4'));var rp=require(_0x99cb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x99cb('0x6'));var config=require(_0x99cb('0x7'));var attributes=require(_0x99cb('0x8'));module[_0x99cb('0x9')]=function(_0x2bfab0,_0x2750d5){return _0x2bfab0[_0x99cb('0xa')](_0x99cb('0xb'),attributes,{'tableName':_0x99cb('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x99cb('0xd'),'fields':[_0x99cb('0xe'),'ListId']},{'unique':!![],'name':_0x99cb('0xf'),'fields':[_0x99cb('0xe'),'ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':[_0x99cb('0xe'),_0x99cb('0x10')]},{'unique':!![],'name':'name_sms','fields':['name','SmsAccountId']},{'unique':!![],'name':_0x99cb('0x11'),'fields':[_0x99cb('0xe'),_0x99cb('0x12')]},{'unique':!![],'name':_0x99cb('0x13'),'fields':['name',_0x99cb('0x14')]},{'unique':!![],'name':_0x99cb('0x15'),'fields':['name',_0x99cb('0x16')]}],'timestamps':!![]});};
\ No newline at end of file
index 718a469..dfa78ed 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(_0xc9b778,_0x5abaaf){var _0x403bd6=function(_0x34ae83){while(--_0x34ae83){_0xc9b778['push'](_0xc9b778['shift']());}};_0x403bd6(++_0x5abaaf);}(_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);});});}
\ 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(_0x34058b,_0x5ca5ac){var _0x399bb5=function(_0x1b24b3){while(--_0x1b24b3){_0x34058b['push'](_0x34058b['shift']());}};_0x399bb5(++_0x5ca5ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 722e735..e9cf4c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0774=['./disposition.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x0774,0xb5));var _0x4077=function(_0x4d6afa,_0x145d5c){_0x4d6afa=_0x4d6afa-0x0;var _0x6e9052=_0x0774[_0x4d6afa];return _0x6e9052;};'use strict';var multer=require(_0x4077('0x0'));var util=require(_0x4077('0x1'));var path=require(_0x4077('0x2'));var timeout=require(_0x4077('0x3'));var express=require(_0x4077('0x4'));var router=express[_0x4077('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4077('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4077('0x7'));var controller=require(_0x4077('0x8'));router[_0x4077('0x9')]('/',auth[_0x4077('0xa')](),controller[_0x4077('0xb')]);router[_0x4077('0x9')](_0x4077('0xc'),auth[_0x4077('0xa')](),controller[_0x4077('0xd')]);router[_0x4077('0xe')]('/',auth[_0x4077('0xa')](),controller[_0x4077('0xf')]);router[_0x4077('0x10')]('/:id',auth[_0x4077('0xa')](),controller[_0x4077('0x11')]);router[_0x4077('0x12')](_0x4077('0xc'),auth[_0x4077('0xa')](),controller[_0x4077('0x13')]);module[_0x4077('0x14')]=router;
\ No newline at end of file
+var _0x47cf=['../../config/environment','./disposition.controller','get','index','isAuthenticated','show','post','create','put','delete','/:id','destroy','exports','util','path','connect-timeout','../../components/interaction/service'];(function(_0x4e075b,_0x26c178){var _0x5d44a7=function(_0x46e949){while(--_0x46e949){_0x4e075b['push'](_0x4e075b['shift']());}};_0x5d44a7(++_0x26c178);}(_0x47cf,0x1c7));var _0xf47c=function(_0x5b3f8d,_0x19bb0e){_0x5b3f8d=_0x5b3f8d-0x0;var _0x2da13b=_0x47cf[_0x5b3f8d];return _0x2da13b;};'use strict';var multer=require('multer');var util=require(_0xf47c('0x0'));var path=require(_0xf47c('0x1'));var timeout=require(_0xf47c('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf47c('0x3'));var config=require(_0xf47c('0x4'));var controller=require(_0xf47c('0x5'));router[_0xf47c('0x6')]('/',auth['isAuthenticated'](),controller[_0xf47c('0x7')]);router[_0xf47c('0x6')]('/:id',auth[_0xf47c('0x8')](),controller[_0xf47c('0x9')]);router[_0xf47c('0xa')]('/',auth[_0xf47c('0x8')](),controller[_0xf47c('0xb')]);router[_0xf47c('0xc')]('/:id',auth[_0xf47c('0x8')](),controller['update']);router[_0xf47c('0xd')](_0xf47c('0xe'),auth['isAuthenticated'](),controller[_0xf47c('0xf')]);module[_0xf47c('0x10')]=router;
\ No newline at end of file
index 81aa754..c95d826 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7429=['2400','12000','INTEGER','SIP','IAX','DADHI','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','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','7200','9600','14400','4800'];(function(_0x2dc3e4,_0x1e1ef4){var _0xd4bf65=function(_0x56a2ef){while(--_0x56a2ef){_0x2dc3e4['push'](_0x2dc3e4['shift']());}};_0xd4bf65(++_0x1e1ef4);}(_0x7429,0x6f));var _0x9742=function(_0x33c4ce,_0x2b3233){_0x33c4ce=_0x33c4ce-0x0;var _0x5e1890=_0x7429[_0x33c4ce];return _0x5e1890;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9742('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x9742('0x1')](_0x9742('0x2'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x9742('0x0')],'defaultValue':_0x9742('0x3')},'localstationid':{'type':Sequelize[_0x9742('0x0')],'unique':_0x9742('0x4')},'minrate':{'type':Sequelize[_0x9742('0x1')]('2400','4800',_0x9742('0x5'),_0x9742('0x6'),'12000',_0x9742('0x7')),'defaultValue':_0x9742('0x8')},'maxrate':{'type':Sequelize['ENUM'](_0x9742('0x9'),_0x9742('0x8'),_0x9742('0x5'),'9600',_0x9742('0xa'),'14400'),'defaultValue':_0x9742('0x7')},'modem':{'type':Sequelize[_0x9742('0x0')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x9742('0x0')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x9742('0x0')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x9742('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x9742('0xc'),_0x9742('0xd'),_0x9742('0xe'),'KHOMP'),'defaultValue':_0x9742('0xc')},'key':{'type':Sequelize[_0x9742('0x0')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9742('0xf');}},'notificationSound':{'type':Sequelize[_0x9742('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9742('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9742('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9742('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9742('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9742('0xb')],'allowNull':!![],'defaultValue':null,'comment':_0x9742('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x9742('0x10')],'defaultValue':![],'comment':_0x9742('0x12'),'set':function(_0x416614){if(!_0x416614)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x9742('0x13')]('mandatoryDisposition',_0x416614);}}};
\ No newline at end of file
+var _0x13f7=['localstationid','4800','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','KHOMP','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','setDataValue','mandatoryDispositionPauseId','sequelize','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax'];(function(_0x4efd3d,_0x2b9694){var _0x1293f2=function(_0x14b90f){while(--_0x14b90f){_0x4efd3d['push'](_0x4efd3d['shift']());}};_0x1293f2(++_0x2b9694);}(_0x13f7,0x151));var _0x713f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x13f7[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x713f('0x0'));module['exports']={'name':{'type':Sequelize[_0x713f('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x713f('0x1')]},'ecm':{'type':Sequelize[_0x713f('0x2')](_0x713f('0x3'),'no'),'defaultValue':_0x713f('0x3')},'headerinfo':{'type':Sequelize[_0x713f('0x1')],'defaultValue':_0x713f('0x4')},'localstationid':{'type':Sequelize[_0x713f('0x1')],'unique':_0x713f('0x5')},'minrate':{'type':Sequelize[_0x713f('0x2')]('2400',_0x713f('0x6'),'7200','9600',_0x713f('0x7'),_0x713f('0x8')),'defaultValue':_0x713f('0x6')},'maxrate':{'type':Sequelize['ENUM']('2400',_0x713f('0x6'),'7200','9600',_0x713f('0x7'),_0x713f('0x8')),'defaultValue':_0x713f('0x8')},'modem':{'type':Sequelize[_0x713f('0x1')],'defaultValue':_0x713f('0x9')},'gateway':{'type':Sequelize[_0x713f('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x713f('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x713f('0xa')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x713f('0x2')](_0x713f('0xb'),_0x713f('0xc'),'DADHI',_0x713f('0xd')),'defaultValue':_0x713f('0xb')},'key':{'type':Sequelize[_0x713f('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x713f('0xe')],'defaultValue':function(){return _0x713f('0xf');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x713f('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x713f('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x713f('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x713f('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x713f('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x713f('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x713f('0xa')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x713f('0x10')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x781c3f){if(!_0x781c3f)this[_0x713f('0x11')](_0x713f('0x12'),null);this[_0x713f('0x11')]('mandatoryDisposition',_0x781c3f);}}};
\ No newline at end of file
index 5a260eb..6685fc0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8e6=['tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','getApplications','context','localstationid','app','description','Fax\x20Extension','priority','appdata','push','Answer','CDR(type)=inbound-fax','Set','gateway','faxdetect','headerinfo','maxrate','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','tech','createdAt','TrunkId','ListId','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','List','Contacts','updatedAt','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','List\x20not\x20found','Send\x20Fax\x20failed','FaxInteraction','out','Contact\x20not\x20found','spread','filename','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','User','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','http','client','request','info','request\x20sent','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','FaxAccounts','UserProfileResource','name','send','Pause','FaxAccount','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','params','keys','includeAll','include','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','mandatoryDispositionPause','describe','addDisposition','FaxAccountId','Disposition','findOne','order','removeDispositions','ids','addAnswer','CannedAnswer','nolimit','removeAnswers','addInteraction','omit','getInteractions','CmContact','Owner','fullname','Tag'];(function(_0xf840b2,_0x5a91db){var _0xe44c74=function(_0x959a91){while(--_0x959a91){_0xf840b2['push'](_0xf840b2['shift']());}};_0xe44c74(++_0x5a91db);}(_0xc8e6,0x1bf));var _0x6c8e=function(_0x22d72b,_0x112e6d){_0x22d72b=_0x22d72b-0x0;var _0x35f65f=_0xc8e6[_0x22d72b];return _0x35f65f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6c8e('0x0'));var zipdir=require(_0x6c8e('0x1'));var jsonpatch=require(_0x6c8e('0x2'));var rp=require(_0x6c8e('0x3'));var moment=require('moment');var BPromise=require(_0x6c8e('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6c8e('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6c8e('0x6'));var fs=require('fs');var fs_extra=require(_0x6c8e('0x7'));var _=require(_0x6c8e('0x8'));var squel=require(_0x6c8e('0x9'));var crypto=require(_0x6c8e('0xa'));var jsforce=require(_0x6c8e('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6c8e('0xc'));var Redis=require(_0x6c8e('0xd'));var authService=require(_0x6c8e('0xe'));var qs=require(_0x6c8e('0xf'));var as=require(_0x6c8e('0x10'));var hardwareService=require(_0x6c8e('0x11'));var logger=require(_0x6c8e('0x12'))(_0x6c8e('0x13'));var utils=require(_0x6c8e('0x14'));var config=require(_0x6c8e('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c8e('0x16'))['db'];config[_0x6c8e('0x17')]=_[_0x6c8e('0x18')](config[_0x6c8e('0x17')],{'host':_0x6c8e('0x19'),'port':0x18eb});var socket=require(_0x6c8e('0x1a'))(new Redis(config[_0x6c8e('0x17')]));require(_0x6c8e('0x1b'))[_0x6c8e('0x1c')](socket);var jayson=require(_0x6c8e('0x1d'));var client=jayson['client'][_0x6c8e('0x1e')]({'port':0x232c});var client9002=jayson[_0x6c8e('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f9aab,_0x7d0417,_0xaab19,_0xb7ad7a){return new BPromise(function(_0x1c0eb0,_0x66433e){var _0x5dac6d=_0xb7ad7a||client;return _0x5dac6d[_0x6c8e('0x20')](_0x3f9aab,_0xaab19)['then'](function(_0x18311b){logger[_0x6c8e('0x21')]('FaxAccount,\x20%s,\x20%s',_0x7d0417,_0x6c8e('0x22'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x7d0417,_0x6c8e('0x22'),JSON[_0x6c8e('0x23')](_0x18311b));if(_0x18311b['error']){if(_0x18311b[_0x6c8e('0x24')][_0x6c8e('0x25')]===0x1f4){logger[_0x6c8e('0x24')](_0x6c8e('0x26'),_0x7d0417,_0x18311b[_0x6c8e('0x24')][_0x6c8e('0x27')]);return _0x66433e(_0x18311b[_0x6c8e('0x24')][_0x6c8e('0x27')]);}logger[_0x6c8e('0x24')]('FaxAccount,\x20%s,\x20%s',_0x7d0417,_0x18311b['error'][_0x6c8e('0x27')]);return _0x1c0eb0(_0x18311b[_0x6c8e('0x24')][_0x6c8e('0x27')]);}else{logger[_0x6c8e('0x21')](_0x6c8e('0x26'),_0x7d0417,'request\x20sent');_0x1c0eb0(_0x18311b[_0x6c8e('0x28')][_0x6c8e('0x27')]);}})[_0x6c8e('0x29')](function(_0x8eb86b){logger['error'](_0x6c8e('0x26'),_0x7d0417,_0x8eb86b);_0x66433e(_0x8eb86b);});});}function respondWithStatusCode(_0x1648f0,_0x38137b){_0x38137b=_0x38137b||0xcc;return function(_0xfb3044){if(_0xfb3044){return _0x1648f0['sendStatus'](_0x38137b);}return _0x1648f0[_0x6c8e('0x2a')](_0x38137b)[_0x6c8e('0x2b')]();};}function respondWithResult(_0x443b2d,_0x5550e2){_0x5550e2=_0x5550e2||0xc8;return function(_0x2128c1){if(_0x2128c1){return _0x443b2d[_0x6c8e('0x2a')](_0x5550e2)[_0x6c8e('0x2c')](_0x2128c1);}};}function respondWithFilteredResult(_0x47f2fe,_0x1343ae){return function(_0xb95dde){if(_0xb95dde){var _0x57cdd9=typeof _0x1343ae[_0x6c8e('0x2d')]===_0x6c8e('0x2e')&&typeof _0x1343ae[_0x6c8e('0x2f')]===_0x6c8e('0x2e');var _0x41abc5=_0xb95dde[_0x6c8e('0x30')];var _0x595199=_0x57cdd9?0x0:_0x1343ae[_0x6c8e('0x2d')];var _0x547154=_0x57cdd9?_0xb95dde[_0x6c8e('0x30')]:_0x1343ae['offset']+_0x1343ae[_0x6c8e('0x2f')];var _0x1d4266;if(_0x547154>=_0x41abc5){_0x547154=_0x41abc5;_0x1d4266=0xc8;}else{_0x1d4266=0xce;}_0x47f2fe[_0x6c8e('0x2a')](_0x1d4266);return _0x47f2fe[_0x6c8e('0x31')](_0x6c8e('0x32'),_0x595199+'-'+_0x547154+'/'+_0x41abc5)[_0x6c8e('0x2c')](_0xb95dde);}return null;};}function patchUpdates(_0x2825c7){return function(_0x136948){try{jsonpatch[_0x6c8e('0x33')](_0x136948,_0x2825c7,!![]);}catch(_0x3d732c){return BPromise['reject'](_0x3d732c);}return _0x136948[_0x6c8e('0x34')]();};}function saveUpdates(_0x4d1558,_0x179b83){return function(_0xa5a722){if(_0xa5a722){return _0xa5a722['update'](_0x4d1558)[_0x6c8e('0x35')](function(_0x45eee9){return _0x45eee9;});}return null;};}function removeEntity(_0x4af66b,_0x216fbc){return function(_0x311d83){if(_0x311d83){return _0x311d83[_0x6c8e('0x36')]()[_0x6c8e('0x35')](function(){var _0x310397=_0x311d83['get']({'plain':!![]});var _0x1465fa=_0x6c8e('0x37');return db[_0x6c8e('0x38')][_0x6c8e('0x36')]({'where':{'type':_0x1465fa,'resourceId':_0x310397['id']}})['then'](function(){return _0x311d83;});})[_0x6c8e('0x35')](function(){_0x4af66b['status'](0xcc)[_0x6c8e('0x2b')]();});}};}function handleEntityNotFound(_0x44dbad,_0xcc9dac){return function(_0x16beb0){if(!_0x16beb0){_0x44dbad['sendStatus'](0x194);}return _0x16beb0;};}function handleError(_0x50831b,_0x3aec8c){_0x3aec8c=_0x3aec8c||0x1f4;return function(_0x8e7595){logger[_0x6c8e('0x24')](_0x8e7595['stack']);if(_0x8e7595[_0x6c8e('0x39')]){delete _0x8e7595[_0x6c8e('0x39')];}_0x50831b[_0x6c8e('0x2a')](_0x3aec8c)[_0x6c8e('0x3a')](_0x8e7595);};}exports['index']=function(_0x24f6ba,_0x47aff9){var _0x54efde={'include':[{'model':db[_0x6c8e('0x3b')],'as':'mandatoryDispositionPause'}]},_0x263955={},_0x249c34={'count':0x0,'rows':[]};var _0x28be7c=_['map'](db[_0x6c8e('0x3c')][_0x6c8e('0x3d')],function(_0x438391){return{'name':_0x438391[_0x6c8e('0x3e')],'type':_0x438391[_0x6c8e('0x3f')][_0x6c8e('0x40')]};});_0x263955[_0x6c8e('0x41')]=_[_0x6c8e('0x42')](_0x28be7c,_0x6c8e('0x39'));_0x263955['query']=_['keys'](_0x24f6ba[_0x6c8e('0x43')]);_0x263955[_0x6c8e('0x44')]=_['intersection'](_0x263955[_0x6c8e('0x41')],_0x263955[_0x6c8e('0x43')]);_0x54efde[_0x6c8e('0x45')]=_[_0x6c8e('0x46')](_0x263955[_0x6c8e('0x41')],qs[_0x6c8e('0x47')](_0x24f6ba[_0x6c8e('0x43')]['fields']));_0x54efde[_0x6c8e('0x45')]=_0x54efde[_0x6c8e('0x45')][_0x6c8e('0x48')]?_0x54efde[_0x6c8e('0x45')]:_0x263955[_0x6c8e('0x41')];if(!_0x24f6ba['query'][_0x6c8e('0x49')]('nolimit')){_0x54efde[_0x6c8e('0x2f')]=qs[_0x6c8e('0x2f')](_0x24f6ba['query'][_0x6c8e('0x2f')]);_0x54efde[_0x6c8e('0x2d')]=qs['offset'](_0x24f6ba['query']['offset']);}_0x54efde['order']=qs[_0x6c8e('0x4a')](_0x24f6ba[_0x6c8e('0x43')][_0x6c8e('0x4a')]);_0x54efde[_0x6c8e('0x4b')]=qs[_0x6c8e('0x44')](_[_0x6c8e('0x4c')](_0x24f6ba[_0x6c8e('0x43')],_0x263955[_0x6c8e('0x44')]),_0x28be7c);if(_0x24f6ba[_0x6c8e('0x43')][_0x6c8e('0x4d')]){_0x54efde[_0x6c8e('0x4b')]=_[_0x6c8e('0x4e')](_0x54efde[_0x6c8e('0x4b')],{'$or':_[_0x6c8e('0x42')](_0x28be7c,function(_0x20b236){if(_0x20b236[_0x6c8e('0x3f')]!==_0x6c8e('0x4f')){var _0x4d46ed={};_0x4d46ed[_0x20b236[_0x6c8e('0x39')]]={'$like':'%'+_0x24f6ba[_0x6c8e('0x43')]['filter']+'%'};return _0x4d46ed;}})});}_0x54efde=_[_0x6c8e('0x4e')]({},_0x54efde,_0x24f6ba[_0x6c8e('0x50')]);var _0x494029={'where':_0x54efde[_0x6c8e('0x4b')]};return db[_0x6c8e('0x3c')][_0x6c8e('0x30')](_0x494029)['then'](function(_0xd06c83){_0x249c34['count']=_0xd06c83;if(_0x24f6ba[_0x6c8e('0x43')]['includeAll']){_0x54efde['include']=[{'all':!![]}];}return db[_0x6c8e('0x3c')][_0x6c8e('0x51')](_0x54efde);})[_0x6c8e('0x35')](function(_0x23f675){_0x249c34[_0x6c8e('0x52')]=_0x23f675;return _0x249c34;})[_0x6c8e('0x35')](respondWithFilteredResult(_0x47aff9,_0x54efde))['catch'](handleError(_0x47aff9,null));};exports['show']=function(_0x128f07,_0x495d9d){var _0x22f850={'raw':![],'where':{'id':_0x128f07[_0x6c8e('0x53')]['id']},'include':[{'model':db[_0x6c8e('0x3b')],'as':'mandatoryDispositionPause'}]},_0x1af843={};_0x1af843[_0x6c8e('0x41')]=_[_0x6c8e('0x54')](db[_0x6c8e('0x3c')][_0x6c8e('0x3d')]);_0x1af843[_0x6c8e('0x43')]=_[_0x6c8e('0x54')](_0x128f07[_0x6c8e('0x43')]);_0x1af843['filters']=_[_0x6c8e('0x46')](_0x1af843[_0x6c8e('0x41')],_0x1af843[_0x6c8e('0x43')]);_0x22f850[_0x6c8e('0x45')]=_['intersection'](_0x1af843['model'],qs[_0x6c8e('0x47')](_0x128f07[_0x6c8e('0x43')][_0x6c8e('0x47')]));_0x22f850[_0x6c8e('0x45')]=_0x22f850['attributes'][_0x6c8e('0x48')]?_0x22f850[_0x6c8e('0x45')]:_0x1af843[_0x6c8e('0x41')];if(_0x128f07[_0x6c8e('0x43')][_0x6c8e('0x55')]){_0x22f850[_0x6c8e('0x56')]=[{'all':!![]}];}_0x22f850=_[_0x6c8e('0x4e')]({},_0x22f850,_0x128f07[_0x6c8e('0x50')]);return db[_0x6c8e('0x3c')][_0x6c8e('0x57')](_0x22f850)[_0x6c8e('0x35')](handleEntityNotFound(_0x495d9d,null))[_0x6c8e('0x35')](respondWithResult(_0x495d9d,null))[_0x6c8e('0x29')](handleError(_0x495d9d,null));};exports['create']=function(_0x3b09f7,_0x43e48d){return db[_0x6c8e('0x3c')]['create'](_0x3b09f7[_0x6c8e('0x58')],{})[_0x6c8e('0x35')](function(_0x4fa72b){var _0x16af55=_0x3b09f7[_0x6c8e('0x59')][_0x6c8e('0x5a')]({'plain':!![]});if(!_0x16af55)throw new Error(_0x6c8e('0x5b'));if(_0x16af55[_0x6c8e('0x5c')]===_0x6c8e('0x59')){var _0x53926b=_0x4fa72b[_0x6c8e('0x5a')]({'plain':!![]});var _0x2d6438=_0x6c8e('0x37');return db['UserProfileSection'][_0x6c8e('0x57')]({'where':{'name':_0x2d6438,'userProfileId':_0x16af55['userProfileId']},'raw':!![]})[_0x6c8e('0x35')](function(_0x35b6fb){if(_0x35b6fb&&_0x35b6fb[_0x6c8e('0x5d')]===0x0){return db[_0x6c8e('0x38')][_0x6c8e('0x5e')]({'name':_0x53926b['name'],'resourceId':_0x53926b['id'],'type':_0x35b6fb[_0x6c8e('0x39')],'sectionId':_0x35b6fb['id']},{})[_0x6c8e('0x35')](function(){return _0x4fa72b;});}else{return _0x4fa72b;}})[_0x6c8e('0x29')](function(_0xd62644){logger[_0x6c8e('0x24')](_0x6c8e('0x5f'),_0xd62644);throw _0xd62644;});}return _0x4fa72b;})[_0x6c8e('0x35')](respondWithResult(_0x43e48d,0xc9))['catch'](handleError(_0x43e48d,null));};exports[_0x6c8e('0x60')]=function(_0x4697a3,_0x356334){if(_0x4697a3[_0x6c8e('0x58')]['id']){delete _0x4697a3[_0x6c8e('0x58')]['id'];}return db['FaxAccount'][_0x6c8e('0x57')]({'where':{'id':_0x4697a3[_0x6c8e('0x53')]['id']},'include':[{'model':db['Pause'],'as':_0x6c8e('0x61')}]})[_0x6c8e('0x35')](handleEntityNotFound(_0x356334,null))['then'](saveUpdates(_0x4697a3[_0x6c8e('0x58')],null))[_0x6c8e('0x35')](respondWithResult(_0x356334,null))['catch'](handleError(_0x356334,null));};exports[_0x6c8e('0x36')]=function(_0x5b0f44,_0x316153){return db['FaxAccount']['find']({'where':{'id':_0x5b0f44['params']['id']}})[_0x6c8e('0x35')](handleEntityNotFound(_0x316153,null))[_0x6c8e('0x35')](removeEntity(_0x316153,null))[_0x6c8e('0x29')](handleError(_0x316153,null));};exports[_0x6c8e('0x62')]=function(_0x412f81,_0x599f73){return db[_0x6c8e('0x3c')][_0x6c8e('0x62')]()[_0x6c8e('0x35')](respondWithResult(_0x599f73,null))['catch'](handleError(_0x599f73,null));};exports[_0x6c8e('0x63')]=function(_0x588c3f,_0x1f67b3,_0x82a27b){if(_0x588c3f[_0x6c8e('0x58')]['id']){delete _0x588c3f[_0x6c8e('0x58')]['id'];}return db[_0x6c8e('0x3c')]['find']({'where':{'id':_0x588c3f[_0x6c8e('0x53')]['id']}})[_0x6c8e('0x35')](handleEntityNotFound(_0x1f67b3,null))[_0x6c8e('0x35')](function(_0x49fbb5){if(_0x49fbb5){_0x588c3f[_0x6c8e('0x58')][_0x6c8e('0x64')]=_0x49fbb5['id'];return db[_0x6c8e('0x65')][_0x6c8e('0x5e')](_0x588c3f[_0x6c8e('0x58')]);}})['then'](respondWithResult(_0x1f67b3,null))[_0x6c8e('0x29')](handleError(_0x1f67b3,null));};exports['getDispositions']=function(_0x581fd8,_0xc986af,_0x44e821){var _0x594cfc={'raw':![],'where':{}};var _0x238a9f={};var _0x23599c={'count':0x0,'rows':[]};return db['FaxAccount'][_0x6c8e('0x66')]({'where':{'id':_0x581fd8[_0x6c8e('0x53')]['id']}})[_0x6c8e('0x35')](handleEntityNotFound(_0xc986af,null))[_0x6c8e('0x35')](function(_0x224feb){if(_0x224feb){_0x238a9f[_0x6c8e('0x41')]=_[_0x6c8e('0x54')](db[_0x6c8e('0x65')][_0x6c8e('0x3d')]);_0x238a9f[_0x6c8e('0x43')]=_['keys'](_0x581fd8['query']);_0x238a9f[_0x6c8e('0x44')]=_[_0x6c8e('0x46')](_0x238a9f[_0x6c8e('0x41')],_0x238a9f['query']);_0x594cfc[_0x6c8e('0x45')]=_[_0x6c8e('0x46')](_0x238a9f[_0x6c8e('0x41')],qs[_0x6c8e('0x47')](_0x581fd8['query']['fields']));_0x594cfc['attributes']=_0x594cfc[_0x6c8e('0x45')][_0x6c8e('0x48')]?_0x594cfc[_0x6c8e('0x45')]:_0x238a9f[_0x6c8e('0x41')];if(!_0x581fd8[_0x6c8e('0x43')][_0x6c8e('0x49')]('nolimit')){_0x594cfc[_0x6c8e('0x2f')]=qs[_0x6c8e('0x2f')](_0x581fd8[_0x6c8e('0x43')][_0x6c8e('0x2f')]);_0x594cfc[_0x6c8e('0x2d')]=qs[_0x6c8e('0x2d')](_0x581fd8[_0x6c8e('0x43')][_0x6c8e('0x2d')]);}_0x594cfc[_0x6c8e('0x67')]=qs[_0x6c8e('0x4a')](_0x581fd8[_0x6c8e('0x43')]['sort']);_0x594cfc[_0x6c8e('0x4b')]=qs[_0x6c8e('0x44')](_['pick'](_0x581fd8[_0x6c8e('0x43')],_0x238a9f[_0x6c8e('0x44')]));_0x594cfc[_0x6c8e('0x4b')][_0x6c8e('0x64')]=_0x224feb['id'];if(_0x581fd8['query'][_0x6c8e('0x4d')]){_0x594cfc['where']=_[_0x6c8e('0x4e')](_0x594cfc[_0x6c8e('0x4b')],{'$or':_[_0x6c8e('0x42')](_0x594cfc['attributes'],function(_0x4d5adc){var _0x4ff9b3={};_0x4ff9b3[_0x4d5adc]={'$like':'%'+_0x581fd8[_0x6c8e('0x43')]['filter']+'%'};return _0x4ff9b3;})});}_0x594cfc=_['merge']({},_0x594cfc,_0x581fd8[_0x6c8e('0x50')]);return db['Disposition'][_0x6c8e('0x30')]({'where':_0x594cfc[_0x6c8e('0x4b')]})['then'](function(_0x16fdb9){_0x23599c[_0x6c8e('0x30')]=_0x16fdb9;if(_0x581fd8[_0x6c8e('0x43')][_0x6c8e('0x55')]){_0x594cfc[_0x6c8e('0x56')]=[{'all':!![]}];}return db[_0x6c8e('0x65')][_0x6c8e('0x51')](_0x594cfc);})[_0x6c8e('0x35')](function(_0x3e43c1){_0x23599c['rows']=_0x3e43c1;return _0x23599c;});}})[_0x6c8e('0x35')](respondWithFilteredResult(_0xc986af,_0x594cfc))[_0x6c8e('0x29')](handleError(_0xc986af,null));};exports[_0x6c8e('0x68')]=function(_0x43bdd7,_0x2f01da,_0x3aa808){return db[_0x6c8e('0x3c')]['find']({'where':{'id':_0x43bdd7[_0x6c8e('0x53')]['id']}})[_0x6c8e('0x35')](handleEntityNotFound(_0x2f01da,null))[_0x6c8e('0x35')](function(_0x3b7ef8){if(_0x3b7ef8){return _0x3b7ef8[_0x6c8e('0x68')](_0x43bdd7[_0x6c8e('0x43')][_0x6c8e('0x69')]);}})['then'](respondWithStatusCode(_0x2f01da,null))[_0x6c8e('0x29')](handleError(_0x2f01da,null));};exports[_0x6c8e('0x6a')]=function(_0x5a18cb,_0x4b471c,_0xf0a1a6){if(_0x5a18cb['body']['id']){delete _0x5a18cb['body']['id'];}return db[_0x6c8e('0x3c')][_0x6c8e('0x57')]({'where':{'id':_0x5a18cb['params']['id']}})[_0x6c8e('0x35')](handleEntityNotFound(_0x4b471c,null))[_0x6c8e('0x35')](function(_0x70d0d1){if(_0x70d0d1){_0x5a18cb[_0x6c8e('0x58')][_0x6c8e('0x64')]=_0x70d0d1['id'];return db['CannedAnswer'][_0x6c8e('0x5e')](_0x5a18cb[_0x6c8e('0x58')]);}})['then'](respondWithResult(_0x4b471c,null))[_0x6c8e('0x29')](handleError(_0x4b471c,null));};exports['getAnswers']=function(_0x5eabcb,_0x5674a0,_0x11690c){var _0x181a94={'raw':![],'where':{}};var _0x211d58={};var _0x457101={'count':0x0,'rows':[]};return db[_0x6c8e('0x3c')]['findOne']({'where':{'id':_0x5eabcb[_0x6c8e('0x53')]['id']}})[_0x6c8e('0x35')](handleEntityNotFound(_0x5674a0,null))[_0x6c8e('0x35')](function(_0x187f7a){if(_0x187f7a){_0x211d58[_0x6c8e('0x41')]=_[_0x6c8e('0x54')](db[_0x6c8e('0x6b')][_0x6c8e('0x3d')]);_0x211d58[_0x6c8e('0x43')]=_['keys'](_0x5eabcb[_0x6c8e('0x43')]);_0x211d58[_0x6c8e('0x44')]=_[_0x6c8e('0x46')](_0x211d58[_0x6c8e('0x41')],_0x211d58[_0x6c8e('0x43')]);_0x181a94[_0x6c8e('0x45')]=_['intersection'](_0x211d58[_0x6c8e('0x41')],qs[_0x6c8e('0x47')](_0x5eabcb[_0x6c8e('0x43')]['fields']));_0x181a94[_0x6c8e('0x45')]=_0x181a94[_0x6c8e('0x45')]['length']?_0x181a94[_0x6c8e('0x45')]:_0x211d58[_0x6c8e('0x41')];if(!_0x5eabcb[_0x6c8e('0x43')][_0x6c8e('0x49')](_0x6c8e('0x6c'))){_0x181a94[_0x6c8e('0x2f')]=qs[_0x6c8e('0x2f')](_0x5eabcb['query'][_0x6c8e('0x2f')]);_0x181a94[_0x6c8e('0x2d')]=qs[_0x6c8e('0x2d')](_0x5eabcb[_0x6c8e('0x43')]['offset']);}_0x181a94[_0x6c8e('0x67')]=qs[_0x6c8e('0x4a')](_0x5eabcb[_0x6c8e('0x43')][_0x6c8e('0x4a')]);_0x181a94[_0x6c8e('0x4b')]=qs[_0x6c8e('0x44')](_[_0x6c8e('0x4c')](_0x5eabcb[_0x6c8e('0x43')],_0x211d58[_0x6c8e('0x44')]));_0x181a94[_0x6c8e('0x4b')][_0x6c8e('0x64')]=_0x187f7a['id'];if(_0x5eabcb[_0x6c8e('0x43')][_0x6c8e('0x4d')]){_0x181a94[_0x6c8e('0x4b')]=_['merge'](_0x181a94['where'],{'$or':_['map'](_0x181a94[_0x6c8e('0x45')],function(_0x37f6dc){var _0x4a91cc={};_0x4a91cc[_0x37f6dc]={'$like':'%'+_0x5eabcb[_0x6c8e('0x43')][_0x6c8e('0x4d')]+'%'};return _0x4a91cc;})});}_0x181a94=_[_0x6c8e('0x4e')]({},_0x181a94,_0x5eabcb['options']);return db[_0x6c8e('0x6b')]['count']({'where':_0x181a94['where']})['then'](function(_0x57603f){_0x457101[_0x6c8e('0x30')]=_0x57603f;if(_0x5eabcb[_0x6c8e('0x43')][_0x6c8e('0x55')]){_0x181a94[_0x6c8e('0x56')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x181a94);})[_0x6c8e('0x35')](function(_0x1fe5ab){_0x457101['rows']=_0x1fe5ab;return _0x457101;});}})[_0x6c8e('0x35')](respondWithFilteredResult(_0x5674a0,_0x181a94))['catch'](handleError(_0x5674a0,null));};exports[_0x6c8e('0x6d')]=function(_0xced51d,_0x21fca7,_0x145c4e){return db['FaxAccount'][_0x6c8e('0x57')]({'where':{'id':_0xced51d[_0x6c8e('0x53')]['id']}})[_0x6c8e('0x35')](handleEntityNotFound(_0x21fca7,null))[_0x6c8e('0x35')](function(_0x74531e){if(_0x74531e){return _0x74531e[_0x6c8e('0x6d')](_0xced51d[_0x6c8e('0x43')][_0x6c8e('0x69')]);}})[_0x6c8e('0x35')](respondWithStatusCode(_0x21fca7,null))[_0x6c8e('0x29')](handleError(_0x21fca7,null));};exports[_0x6c8e('0x6e')]=function(_0x5f189f,_0x6b4b28,_0xe35a8b){return db['FaxInteraction'][_0x6c8e('0x57')]({'where':{'id':_0x5f189f[_0x6c8e('0x53')]['id']}})['then'](handleEntityNotFound(_0x6b4b28,null))['then'](function(_0xbda0a9){if(_0xbda0a9){return _0xbda0a9[_0x6c8e('0x6e')](_0x5f189f[_0x6c8e('0x58')][_0x6c8e('0x69')],_[_0x6c8e('0x6f')](_0x5f189f[_0x6c8e('0x58')],['ids','id'])||{});}})[_0x6c8e('0x35')](respondWithResult(_0x6b4b28,null))['catch'](handleError(_0x6b4b28,null));};exports[_0x6c8e('0x70')]=function(_0x3d07ab,_0x1786a7,_0x10009a){var _0x7f6a64={'raw':![],'where':{}};var _0x1c928f={};var _0x6878f6={'count':0x0,'rows':[]};return db[_0x6c8e('0x3c')][_0x6c8e('0x66')]({'where':{'id':_0x3d07ab[_0x6c8e('0x53')]['id']}})[_0x6c8e('0x35')](handleEntityNotFound(_0x1786a7,null))[_0x6c8e('0x35')](function(_0x312707){if(_0x312707){_0x1c928f['model']=_[_0x6c8e('0x54')](db['FaxInteraction']['rawAttributes']);_0x1c928f[_0x6c8e('0x43')]=_[_0x6c8e('0x54')](_0x3d07ab[_0x6c8e('0x43')]);_0x1c928f['filters']=_[_0x6c8e('0x46')](_0x1c928f['model'],_0x1c928f[_0x6c8e('0x43')]);_0x7f6a64[_0x6c8e('0x45')]=_['intersection'](_0x1c928f[_0x6c8e('0x41')],qs[_0x6c8e('0x47')](_0x3d07ab[_0x6c8e('0x43')][_0x6c8e('0x47')]));_0x7f6a64[_0x6c8e('0x45')]=_0x7f6a64[_0x6c8e('0x45')][_0x6c8e('0x48')]?_0x7f6a64['attributes']:_0x1c928f[_0x6c8e('0x41')];if(!_0x3d07ab[_0x6c8e('0x43')]['hasOwnProperty'](_0x6c8e('0x6c'))){_0x7f6a64[_0x6c8e('0x2f')]=qs[_0x6c8e('0x2f')](_0x3d07ab[_0x6c8e('0x43')]['limit']);_0x7f6a64[_0x6c8e('0x2d')]=qs[_0x6c8e('0x2d')](_0x3d07ab[_0x6c8e('0x43')][_0x6c8e('0x2d')]);}_0x7f6a64[_0x6c8e('0x67')]=qs[_0x6c8e('0x4a')](_0x3d07ab['query'][_0x6c8e('0x4a')]);_0x7f6a64[_0x6c8e('0x4b')]=qs[_0x6c8e('0x44')](_[_0x6c8e('0x4c')](_0x3d07ab['query'],_0x1c928f[_0x6c8e('0x44')]));_0x7f6a64[_0x6c8e('0x4b')][_0x6c8e('0x64')]=_0x312707['id'];if(_0x3d07ab[_0x6c8e('0x43')][_0x6c8e('0x4d')]){_0x7f6a64[_0x6c8e('0x4b')]=_['merge'](_0x7f6a64[_0x6c8e('0x4b')],{'$or':_['map'](_0x7f6a64[_0x6c8e('0x45')],function(_0x4481bc){var _0x17a07c={};_0x17a07c[_0x4481bc]={'$like':'%'+_0x3d07ab[_0x6c8e('0x43')][_0x6c8e('0x4d')]+'%'};return _0x17a07c;})});}_0x7f6a64=_[_0x6c8e('0x4e')]({},_0x7f6a64,_0x3d07ab[_0x6c8e('0x50')]);return db['FaxInteraction']['count']({'where':_0x7f6a64[_0x6c8e('0x4b')]})[_0x6c8e('0x35')](function(_0x2b59eb){_0x6878f6['count']=_0x2b59eb;if(_0x3d07ab[_0x6c8e('0x43')][_0x6c8e('0x55')]){_0x7f6a64[_0x6c8e('0x56')]=[{'model':db[_0x6c8e('0x71')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x6c8e('0x72'),'attributes':[_0x6c8e('0x39'),_0x6c8e('0x73'),'internal'],'required':![]},{'model':db[_0x6c8e('0x74')],'as':'Tags','attributes':['id',_0x6c8e('0x39'),'color'],'where':_0x3d07ab[_0x6c8e('0x43')]['tag']?{'id':_0x3d07ab['query'][_0x6c8e('0x75')]}:undefined,'required':_0x3d07ab[_0x6c8e('0x43')]['tag']?!![]:![]}];}return db['FaxInteraction'][_0x6c8e('0x51')](_0x7f6a64);})[_0x6c8e('0x35')](function(_0x5c640d){_0x6878f6[_0x6c8e('0x52')]=_0x5c640d;return _0x6878f6;});}})[_0x6c8e('0x35')](respondWithFilteredResult(_0x1786a7,_0x7f6a64))[_0x6c8e('0x29')](handleError(_0x1786a7,null));};exports[_0x6c8e('0x76')]=function(_0xc08c89,_0x3212bd,_0x3480b5){return db[_0x6c8e('0x3c')][_0x6c8e('0x66')]({'where':{'id':_0xc08c89[_0x6c8e('0x53')]['id']}})[_0x6c8e('0x35')](handleEntityNotFound(_0x3212bd,null))['then'](function(_0x200f47){if(_0x200f47){return db[_0x6c8e('0x77')][_0x6c8e('0x78')](function(_0xaee925){return db[_0x6c8e('0x79')][_0x6c8e('0x36')]({'where':{'FaxAccountId':_0xc08c89['params']['id']},'transaction':_0xaee925})[_0x6c8e('0x35')](function(_0x318cb2){var _0x4176eb=_[_0x6c8e('0x42')](_0xc08c89[_0x6c8e('0x58')],function(_0x141230){_0x141230[_0x6c8e('0x64')]=_0xc08c89[_0x6c8e('0x53')]['id'];return _0x141230;});return db['FaxApplication'][_0x6c8e('0x7a')](_0x4176eb,{'transaction':_0xaee925});});})[_0x6c8e('0x35')](function(){return db[_0x6c8e('0x79')][_0x6c8e('0x7b')]({'where':{'FaxAccountId':_0xc08c89[_0x6c8e('0x53')]['id']},'order':'priority'});});}})[_0x6c8e('0x35')](respondWithResult(_0x3212bd,null))[_0x6c8e('0x29')](handleError(_0x3212bd,null));};exports[_0x6c8e('0x7c')]=function(_0x1e1ae9,_0x21b3b2,_0x230e25){var _0x1bfa6f={};var _0x36d1c0={};var _0x5310fe;var _0xf3bcc7;return db['FaxAccount'][_0x6c8e('0x66')]({'where':{'id':_0x1e1ae9[_0x6c8e('0x53')]['id']}})[_0x6c8e('0x35')](handleEntityNotFound(_0x21b3b2,null))[_0x6c8e('0x35')](function(_0x575bbe){if(_0x575bbe){_0x5310fe=_0x575bbe;_0x36d1c0[_0x6c8e('0x41')]=_[_0x6c8e('0x54')](db[_0x6c8e('0x79')]['rawAttributes']);_0x36d1c0[_0x6c8e('0x43')]=_['keys'](_0x1e1ae9[_0x6c8e('0x43')]);_0x36d1c0['filters']=_[_0x6c8e('0x46')](_0x36d1c0[_0x6c8e('0x41')],_0x36d1c0[_0x6c8e('0x43')]);_0x1bfa6f[_0x6c8e('0x45')]=_[_0x6c8e('0x46')](_0x36d1c0[_0x6c8e('0x41')],qs[_0x6c8e('0x47')](_0x1e1ae9[_0x6c8e('0x43')]['fields']));_0x1bfa6f['attributes']=_0x1bfa6f['attributes'][_0x6c8e('0x48')]?_0x1bfa6f['attributes']:_0x36d1c0[_0x6c8e('0x41')];_0x1bfa6f[_0x6c8e('0x67')]=qs[_0x6c8e('0x4a')](_0x1e1ae9['query'][_0x6c8e('0x4a')]);_0x1bfa6f['where']=qs[_0x6c8e('0x44')](_[_0x6c8e('0x4c')](_0x1e1ae9[_0x6c8e('0x43')],_0x36d1c0[_0x6c8e('0x44')]));if(_0x1e1ae9[_0x6c8e('0x43')]['filter']){_0x1bfa6f['where']=_['merge'](_0x1bfa6f['where'],{'$or':_[_0x6c8e('0x42')](_0x1bfa6f[_0x6c8e('0x45')],function(_0x4cdb26){var _0x3a6c08={};_0x3a6c08[_0x4cdb26]={'$like':'%'+_0x1e1ae9[_0x6c8e('0x43')][_0x6c8e('0x4d')]+'%'};return _0x3a6c08;})});}_0x1bfa6f=_[_0x6c8e('0x4e')]({},_0x1bfa6f,_0x1e1ae9[_0x6c8e('0x50')]);return _0x5310fe[_0x6c8e('0x7c')](_0x1bfa6f);}})[_0x6c8e('0x35')](function(_0x1456ce){if(_0x1456ce){_0xf3bcc7=_0x1456ce[_0x6c8e('0x48')];if(!_0x1e1ae9[_0x6c8e('0x43')][_0x6c8e('0x49')](_0x6c8e('0x6c'))){_0x1bfa6f[_0x6c8e('0x2f')]=qs[_0x6c8e('0x2f')](_0x1e1ae9['query'][_0x6c8e('0x2f')]);_0x1bfa6f[_0x6c8e('0x2d')]=qs[_0x6c8e('0x2d')](_0x1e1ae9[_0x6c8e('0x43')][_0x6c8e('0x2d')]);}return _0x5310fe[_0x6c8e('0x7c')](_0x1bfa6f);}})[_0x6c8e('0x35')](function(_0x36f4b6){if(_0x36f4b6){return _0x36f4b6?{'count':_0xf3bcc7,'rows':_0x36f4b6}:null;}})[_0x6c8e('0x35')](respondWithResult(_0x21b3b2,null))['catch'](handleError(_0x21b3b2,null));};function Extension(_0x477214,_0x350c6d,_0xfa12ba,_0x122fd7){this[_0x6c8e('0x7d')]='from-voip-provider';this['exten']=_0x477214[_0x6c8e('0x7e')];this[_0x6c8e('0x7f')]=_0x122fd7;this[_0x6c8e('0x3f')]='system';this[_0x6c8e('0x80')]=_0x6c8e('0x81');this[_0x6c8e('0x64')]=_0x477214['id'];this[_0x6c8e('0x82')]=_0x350c6d;this[_0x6c8e('0x83')]=_0xfa12ba;}function createExtensionsReciveFax(_0x54259f){var _0x25d1df=0x1;var _0xb48084=[];_0xb48084[_0x6c8e('0x84')](new Extension(_0x54259f,_0x25d1df,'',_0x6c8e('0x85')));_0x25d1df+=0x1;_0xb48084[_0x6c8e('0x84')](new Extension(_0x54259f,_0x25d1df,_0x6c8e('0x86'),_0x6c8e('0x87')));_0x25d1df+=0x1;for(var _0x1b2f0b in _0x54259f){if(_0x54259f[_0x6c8e('0x49')](_0x1b2f0b)&&(_0x1b2f0b==='ecm'||_0x1b2f0b===_0x6c8e('0x7e')||_0x1b2f0b===_0x6c8e('0x88')||_0x1b2f0b===_0x6c8e('0x89')||_0x1b2f0b===_0x6c8e('0x8a')||_0x1b2f0b===_0x6c8e('0x8b')||_0x1b2f0b==='minrate'||_0x1b2f0b==='modem'||_0x1b2f0b===_0x6c8e('0x8c'))){_0xb48084[_0x6c8e('0x84')](new Extension(_0x54259f,_0x25d1df,_0x6c8e('0x8d')+_0x1b2f0b+')='+_0x54259f[_0x1b2f0b],_0x6c8e('0x87')));_0x25d1df+=0x1;}}_0xb48084['push'](new Extension(_0x54259f,_0x25d1df,'6',_0x6c8e('0x8e')));_0x25d1df+=0x1;_0xb48084[_0x6c8e('0x84')](new Extension(_0x54259f,_0x25d1df,_0x6c8e('0x8f'),_0x6c8e('0x90')));_0x25d1df=0x0;return _0xb48084;}exports[_0x6c8e('0x91')]=function(_0xa1ad76,_0x279400,_0x26a3d1){var _0x52087a;return db[_0x6c8e('0x77')][_0x6c8e('0x78')](function(_0x5568f6){return db['FaxAccount'][_0x6c8e('0x5e')](_0xa1ad76[_0x6c8e('0x58')],{'transaction':_0x5568f6})[_0x6c8e('0x35')](function(_0xd429d2){_0x52087a=_0xd429d2['get']({'plain':!![]});return db[_0x6c8e('0x92')][_0x6c8e('0x7a')](createExtensionsReciveFax(_0x52087a),{'transaction':_0x5568f6});});})[_0x6c8e('0x35')](function(){return _0x52087a;})['then'](respondWithResult(_0x279400,null))[_0x6c8e('0x29')](handleError(_0x279400,null));};exports[_0x6c8e('0x93')]=function(_0x23fe10,_0x74232c,_0x1aa38f){var _0x18c043;return db[_0x6c8e('0x77')][_0x6c8e('0x78')](function(_0x58c3ec){return db[_0x6c8e('0x3c')]['update'](_0x23fe10[_0x6c8e('0x58')],{'where':{'id':_0x23fe10['body']['id']},'transaction':_0x58c3ec})['then'](function(_0x2a51b4){return db[_0x6c8e('0x92')][_0x6c8e('0x36')]({'where':{'FaxAccountId':_0x23fe10[_0x6c8e('0x58')]['id']},'transaction':_0x58c3ec})[_0x6c8e('0x35')](function(_0xcaca12){return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_['omit'](_0x23fe10[_0x6c8e('0x58')],[_0x6c8e('0x94'),_0x6c8e('0x40'),_0x6c8e('0x95'),'updatedAt',_0x6c8e('0x96'),_0x6c8e('0x97')])),{'transaction':_0x58c3ec});});});})[_0x6c8e('0x35')](function(){return db[_0x6c8e('0x3c')]['findById'](_0x23fe10[_0x6c8e('0x58')]['id']);})[_0x6c8e('0x35')](respondWithResult(_0x74232c,null))[_0x6c8e('0x29')](handleError(_0x74232c,null));};exports[_0x6c8e('0x98')]=function(_0x3173c,_0x4400dd,_0x21f54d){var _0x454616={'raw':!![],'where':{}};var _0x1c27f3={};var _0x22758d={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x3173c['params']['id']}})[_0x6c8e('0x35')](handleEntityNotFound(_0x4400dd,null))['then'](function(_0x462693){if(_0x462693){_0x1c27f3[_0x6c8e('0x41')]=_[_0x6c8e('0x54')](db[_0x6c8e('0x99')][_0x6c8e('0x3d')]);_0x1c27f3[_0x6c8e('0x43')]=_[_0x6c8e('0x54')](_0x3173c[_0x6c8e('0x43')]);_0x1c27f3[_0x6c8e('0x44')]=_[_0x6c8e('0x46')](_0x1c27f3[_0x6c8e('0x41')],_0x1c27f3['query']);_0x454616['attributes']=_['intersection'](_0x1c27f3[_0x6c8e('0x41')],qs[_0x6c8e('0x47')](_0x3173c[_0x6c8e('0x43')][_0x6c8e('0x47')]));_0x454616[_0x6c8e('0x45')]=_0x454616[_0x6c8e('0x45')][_0x6c8e('0x48')]?_0x454616[_0x6c8e('0x45')]:_0x1c27f3[_0x6c8e('0x41')];if(!_0x3173c[_0x6c8e('0x43')][_0x6c8e('0x49')](_0x6c8e('0x6c'))){_0x454616['limit']=qs[_0x6c8e('0x2f')](_0x3173c[_0x6c8e('0x43')]['limit']);_0x454616['offset']=qs[_0x6c8e('0x2d')](_0x3173c[_0x6c8e('0x43')][_0x6c8e('0x2d')]);}_0x454616[_0x6c8e('0x67')]=qs[_0x6c8e('0x4a')](_0x3173c['query']['sort']);_0x454616[_0x6c8e('0x4b')]=qs[_0x6c8e('0x44')](_[_0x6c8e('0x4c')](_0x3173c[_0x6c8e('0x43')],_0x1c27f3[_0x6c8e('0x44')]));_0x454616[_0x6c8e('0x4b')][_0x6c8e('0x64')]=_0x462693['id'];if(_0x3173c[_0x6c8e('0x43')][_0x6c8e('0x4d')]){_0x454616[_0x6c8e('0x4b')]=_[_0x6c8e('0x4e')](_0x454616[_0x6c8e('0x4b')],{'$or':_['map'](_0x454616[_0x6c8e('0x45')],function(_0x2faa7f){var _0x5371ed={};_0x5371ed[_0x2faa7f]={'$like':'%'+_0x3173c[_0x6c8e('0x43')][_0x6c8e('0x4d')]+'%'};return _0x5371ed;})});}if(_0x3173c[_0x6c8e('0x43')][_0x6c8e('0x9a')]){var _0x2a89f1=_0x3173c[_0x6c8e('0x43')][_0x6c8e('0x9a')][_0x6c8e('0x9b')](',');var _0x324d3d={};_0x324d3d[_0x2a89f1[0x0]]={'$gte':moment(_0x2a89f1[0x1])[_0x6c8e('0x9c')](_0x6c8e('0x9d'))};_0x454616['where']=_[_0x6c8e('0x4e')](_0x454616[_0x6c8e('0x4b')],_0x324d3d);}_0x454616=_[_0x6c8e('0x4e')]({},_0x454616,_0x3173c[_0x6c8e('0x50')]);return db['FaxMessage'][_0x6c8e('0x30')]({'where':_0x454616[_0x6c8e('0x4b')]})[_0x6c8e('0x35')](function(_0x2e5879){_0x22758d[_0x6c8e('0x30')]=_0x2e5879;if(_0x3173c[_0x6c8e('0x43')][_0x6c8e('0x55')]){_0x454616[_0x6c8e('0x56')]=[{'all':!![]}];}return db[_0x6c8e('0x99')][_0x6c8e('0x51')](_0x454616);})[_0x6c8e('0x35')](function(_0x2ce2b0){_0x22758d[_0x6c8e('0x52')]=_0x2ce2b0;return _0x22758d;});}})[_0x6c8e('0x35')](respondWithFilteredResult(_0x4400dd,_0x454616))[_0x6c8e('0x29')](handleError(_0x4400dd,null));};exports[_0x6c8e('0x3a')]=function(_0x47d24a,_0xbfdda4,_0x13ebf1){var _0x483b0d,_0x16fe15={},_0x1af9fe;if(_0x47d24a[_0x6c8e('0x58')]['to']){_0x1af9fe=_0x47d24a[_0x6c8e('0x58')]['to'][0x0];}return db['FaxAccount'][_0x6c8e('0x57')]({'where':{'id':_0x47d24a[_0x6c8e('0x53')]['id']},'include':[{'model':db['CmList'],'as':_0x6c8e('0x9e'),'include':[{'model':db[_0x6c8e('0x71')],'as':_0x6c8e('0x9f'),'where':{'fax':_0x1af9fe},'limit':0x1,'order':[[_0x6c8e('0xa0'),'DESC']]}]}]})[_0x6c8e('0x35')](handleEntityNotFound(_0xbfdda4,null))[_0x6c8e('0x35')](function(_0x943401){_0x483b0d=_0x943401;if(_0x47d24a['body']['attachments']&&_0x47d24a['body'][_0x6c8e('0xa1')][_0x6c8e('0x48')]){for(var _0x4584fa=0x0;_0x4584fa<_0x47d24a[_0x6c8e('0x58')][_0x6c8e('0xa1')][_0x6c8e('0x48')];_0x4584fa+=0x1){_0x47d24a[_0x6c8e('0x58')][_0x6c8e('0xa1')][_0x4584fa]={'filename':_0x47d24a[_0x6c8e('0x58')]['attachments'][_0x4584fa][_0x6c8e('0x39')],'id':_0x47d24a[_0x6c8e('0x58')]['attachments'][_0x4584fa]['id'],'path':path['join'](config[_0x6c8e('0xa2')],_0x6c8e('0xa3'),_0x47d24a[_0x6c8e('0x58')]['attachments'][_0x4584fa][_0x6c8e('0xa4')])};}}return respondWithRpcPromise(_0x6c8e('0xa5'),'CheckAfterSend',{'FaxAccountId':_['isNil'](_0x47d24a[_0x6c8e('0x53')]['id'])?undefined:_0x47d24a[_0x6c8e('0x53')]['id'],'path':_[_0x6c8e('0xa6')](_0x47d24a[_0x6c8e('0x58')]['attachments'][0x0][_0x6c8e('0x5')])?undefined:_0x47d24a['body']['attachments'][0x0]['path'],'fax':_[_0x6c8e('0xa6')](_0x47d24a[_0x6c8e('0x58')]['to'][0x0])?undefined:_0x47d24a['body']['to'][0x0]},client9002);})[_0x6c8e('0x35')](function(){if(_0x483b0d){if(_[_0x6c8e('0xa6')](_0x47d24a['body']['from'])){_0x47d24a[_0x6c8e('0x58')][_0x6c8e('0xa7')]=util[_0x6c8e('0x9c')](_0x6c8e('0xa8'),_0x483b0d[_0x6c8e('0x39')],_0x483b0d['fax']);}if(_0x483b0d[_0x6c8e('0x9e')]){if(_0x483b0d['List'][_0x6c8e('0x9f')][_0x6c8e('0x48')]){return _0x483b0d[_0x6c8e('0x9e')][_0x6c8e('0x9f')][0x0];}else{return db[_0x6c8e('0x71')]['create'](_[_0x6c8e('0x18')](_0x47d24a[_0x6c8e('0x58')],{'firstName':_0x47d24a['body']['to'][0x0],'phone':_0x47d24a['body']['to'][0x0],'fax':_0x47d24a[_0x6c8e('0x58')]['to'][0x0],'ListId':_0x483b0d[_0x6c8e('0x97')]}));}}else{throw new Error(_0x6c8e('0xa9'));}}else{throw new Error(_0x6c8e('0xaa'));}})[_0x6c8e('0x35')](function(_0x24a873){if(_0x24a873){return db[_0x6c8e('0xab')][_0x6c8e('0x57')]({'where':{'ContactId':_0x24a873['id'],'closed':![],'FaxAccountId':_0x483b0d['id']}})[_0x6c8e('0x35')](function(_0x4c672a){if(_0x4c672a){return[_0x4c672a,![]];}return db['FaxInteraction']['create']({'UserId':_0x47d24a[_0x6c8e('0x59')]['id'],'ContactId':_0x24a873['id'],'FaxAccountId':_0x483b0d['id'],'fax':_0x47d24a[_0x6c8e('0x58')]['to'][0x0],'firstMsgDirection':_0x6c8e('0xac'),'Messages':[_[_0x6c8e('0x4e')](_0x47d24a[_0x6c8e('0x58')],{'read':![],'body':_0x47d24a[_0x6c8e('0x58')][_0x6c8e('0xa1')][0x0]['filename'],'FaxAccountId':_0x483b0d['id'],'UserId':_0x47d24a[_0x6c8e('0x59')]['id'],'ContactId':_0x24a873['id'],'AttachmentId':_0x47d24a[_0x6c8e('0x58')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x6c8e('0x99')],'as':'Messages'}]})[_0x6c8e('0x35')](function(_0x560d14){return[_0x560d14,!![]];});});}else{throw new Error(_0x6c8e('0xad'));}})[_0x6c8e('0xae')](function(_0x4941b0,_0x51e4c1){if(_0x51e4c1){return _0x4941b0;}return db[_0x6c8e('0x99')]['create']({'direction':_0x6c8e('0xac'),'read':![],'body':_0x47d24a[_0x6c8e('0x58')][_0x6c8e('0xa1')][0x0][_0x6c8e('0xaf')],'FaxAccountId':_0x483b0d['id'],'FaxInteractionId':_0x4941b0['id'],'UserId':_0x47d24a['user']['id'],'ContactId':_0x4941b0[_0x6c8e('0xb0')],'AttachmentId':_0x47d24a[_0x6c8e('0x58')][_0x6c8e('0xa1')][0x0]['id']})[_0x6c8e('0x35')](function(_0xe300f9){_0x4941b0[_0x6c8e('0xb1')][_0x6c8e('0xb2')]=[];_0x4941b0[_0x6c8e('0xb1')][_0x6c8e('0xb2')][_0x6c8e('0x84')](_0xe300f9[_0x6c8e('0xb1')]);return _0x4941b0;});})[_0x6c8e('0x35')](function(_0x14f303){respondWithRpcPromise(_0x6c8e('0xb3'),_0x6c8e('0xb3'),{'FaxAccountId':_[_0x6c8e('0xa6')](_0x47d24a[_0x6c8e('0x53')]['id'])?undefined:_0x47d24a['params']['id'],'path':_[_0x6c8e('0xa6')](_0x47d24a[_0x6c8e('0x58')][_0x6c8e('0xa1')][0x0]['path'])?undefined:_0x47d24a[_0x6c8e('0x58')]['attachments'][0x0][_0x6c8e('0x5')],'fax':_[_0x6c8e('0xa6')](_0x47d24a[_0x6c8e('0x58')]['to'][0x0])?undefined:_0x47d24a[_0x6c8e('0x58')]['to'][0x0],'AttachmentId':_0x47d24a['body'][_0x6c8e('0xa1')][0x0]['id']},client9002)[_0x6c8e('0x35')](function(_0x16078f){logger['info'](_0x6c8e('0xb4'),_0x16078f);})[_0x6c8e('0x29')](function(_0x1a2b43){logger[_0x6c8e('0x21')](_0x6c8e('0xb4'),_0x1a2b43);});return _0x14f303;})[_0x6c8e('0x35')](respondWithResult(_0xbfdda4,null))[_0x6c8e('0x29')](handleError(_0xbfdda4,null));};exports[_0x6c8e('0xb5')]=function(_0x222a40,_0x2dca62,_0x4b5d1a){return db['FaxAccount'][_0x6c8e('0x57')]({'where':{'id':_0x222a40[_0x6c8e('0x53')]['id']}})['then'](handleEntityNotFound(_0x2dca62,null))[_0x6c8e('0x35')](function(_0x210881){if(_0x210881){return _0x210881[_0x6c8e('0xb5')](_0x222a40['body'][_0x6c8e('0x69')],_[_0x6c8e('0x6f')](_0x222a40['body'],[_0x6c8e('0x69'),'id'])||{})[_0x6c8e('0xae')](function(_0xcacb3a){for(var _0x185117=0x0;_0x185117<_0x222a40[_0x6c8e('0x58')][_0x6c8e('0x69')][_0x6c8e('0x48')];_0x185117+=0x1){socket[_0x6c8e('0xb6')](_0x6c8e('0xb7'),{'UserId':Number(_0x222a40[_0x6c8e('0x58')][_0x6c8e('0x69')][_0x185117]),'FaxAccountId':Number(_0x222a40[_0x6c8e('0x53')]['id'])});}return _0xcacb3a;});}})[_0x6c8e('0x35')](respondWithResult(_0x2dca62,null))[_0x6c8e('0x29')](handleError(_0x2dca62,null));};exports[_0x6c8e('0xb8')]=function(_0x43adf7,_0xbaf5a9,_0x1600a2){return db[_0x6c8e('0x3c')][_0x6c8e('0x57')]({'where':{'id':_0x43adf7[_0x6c8e('0x53')]['id']}})[_0x6c8e('0x35')](handleEntityNotFound(_0xbaf5a9,null))['then'](function(_0x1c27a1){if(_0x1c27a1){return _0x1c27a1['removeAgents'](_0x43adf7[_0x6c8e('0x43')][_0x6c8e('0x69')])[_0x6c8e('0x35')](function(){if(_['isArray'](_0x43adf7[_0x6c8e('0x43')][_0x6c8e('0x69')])){for(var _0x5c3b2a=0x0;_0x5c3b2a<_0x43adf7['query']['ids'][_0x6c8e('0x48')];_0x5c3b2a+=0x1){socket[_0x6c8e('0xb6')](_0x6c8e('0xb9'),{'UserId':Number(_0x43adf7[_0x6c8e('0x43')][_0x6c8e('0x69')][_0x5c3b2a]),'FaxAccountId':Number(_0x43adf7[_0x6c8e('0x53')]['id'])});}}else{socket[_0x6c8e('0xb6')](_0x6c8e('0xb9'),{'UserId':Number(_0x43adf7['query'][_0x6c8e('0x69')]),'FaxAccountId':Number(_0x43adf7[_0x6c8e('0x53')]['id'])});}});}})[_0x6c8e('0x35')](respondWithStatusCode(_0xbaf5a9,null))[_0x6c8e('0x29')](handleError(_0xbaf5a9,null));};exports[_0x6c8e('0xba')]=function(_0x501549,_0xe1f9c5,_0x437378){var _0x3b2e19={};var _0xcaeeec={};var _0x3c76da;var _0x1d5d6a;return db[_0x6c8e('0x3c')][_0x6c8e('0x66')]({'where':{'id':_0x501549['params']['id']}})[_0x6c8e('0x35')](handleEntityNotFound(_0xe1f9c5,null))[_0x6c8e('0x35')](function(_0x59067e){if(_0x59067e){_0x3c76da=_0x59067e;_0xcaeeec[_0x6c8e('0x41')]=_[_0x6c8e('0x54')](db[_0x6c8e('0xbb')][_0x6c8e('0x3d')]);_0xcaeeec[_0x6c8e('0x43')]=_[_0x6c8e('0x54')](_0x501549[_0x6c8e('0x43')]);_0xcaeeec[_0x6c8e('0x44')]=_[_0x6c8e('0x46')](_0xcaeeec[_0x6c8e('0x41')],_0xcaeeec[_0x6c8e('0x43')]);_0x3b2e19[_0x6c8e('0x45')]=_[_0x6c8e('0x46')](_0xcaeeec[_0x6c8e('0x41')],qs[_0x6c8e('0x47')](_0x501549[_0x6c8e('0x43')][_0x6c8e('0x47')]));_0x3b2e19[_0x6c8e('0x45')]=_0x3b2e19[_0x6c8e('0x45')][_0x6c8e('0x48')]?_0x3b2e19[_0x6c8e('0x45')]:_0xcaeeec[_0x6c8e('0x41')];_0x3b2e19[_0x6c8e('0x67')]=qs[_0x6c8e('0x4a')](_0x501549['query'][_0x6c8e('0x4a')]);_0x3b2e19[_0x6c8e('0x4b')]=qs[_0x6c8e('0x44')](_[_0x6c8e('0x4c')](_0x501549[_0x6c8e('0x43')],_0xcaeeec[_0x6c8e('0x44')]));if(_0x501549[_0x6c8e('0x43')][_0x6c8e('0x4d')]){_0x3b2e19[_0x6c8e('0x4b')]=_[_0x6c8e('0x4e')](_0x3b2e19[_0x6c8e('0x4b')],{'$or':_[_0x6c8e('0x42')](_0x3b2e19[_0x6c8e('0x45')],function(_0x534005){var _0x258d35={};_0x258d35[_0x534005]={'$like':'%'+_0x501549['query'][_0x6c8e('0x4d')]+'%'};return _0x258d35;})});}_0x3b2e19=_['merge']({},_0x3b2e19,_0x501549[_0x6c8e('0x50')]);return _0x3c76da[_0x6c8e('0xba')](_0x3b2e19);}})['then'](function(_0x5961a6){if(_0x5961a6){_0x1d5d6a=_0x5961a6[_0x6c8e('0x48')];if(!_0x501549[_0x6c8e('0x43')][_0x6c8e('0x49')]('nolimit')){_0x3b2e19[_0x6c8e('0x2f')]=qs[_0x6c8e('0x2f')](_0x501549['query']['limit']);_0x3b2e19[_0x6c8e('0x2d')]=qs[_0x6c8e('0x2d')](_0x501549['query'][_0x6c8e('0x2d')]);}return _0x3c76da[_0x6c8e('0xba')](_0x3b2e19);}})[_0x6c8e('0x35')](function(_0x469139){if(_0x469139){return _0x469139?{'count':_0x1d5d6a,'rows':_0x469139}:null;}})[_0x6c8e('0x35')](respondWithResult(_0xe1f9c5,null))[_0x6c8e('0x29')](handleError(_0xe1f9c5,null));};
\ No newline at end of file
+var _0x9a9c=['localstationid','app','Fax\x20Extension','priority','appdata','push','Answer','CDR(type)=inbound-fax','Set','gateway','faxdetect','headerinfo','minrate','modem','t38timeout','FAXOPT(','Wait','ReceiveFax','addAccountApplications','VoiceExtension','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','send','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','Send\x20Fax\x20failed','out','Messages','Contact\x20not\x20found','filename','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','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','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','get','FaxAccounts','UserProfileResource','destroy','name','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','type','key','model','query','keys','filters','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','intersection','length','find','create','body','user','role','userProfileId','autoAssociation','update','params','describe','FaxAccountId','Disposition','getDispositions','findOne','hasOwnProperty','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','omit','getInteractions','FaxInteraction','CmContact','Contact','User','Owner','fullname','internal','Tags','color','tag','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','getApplications','context','exten'];(function(_0x46fbc4,_0x4151bc){var _0x3d2f51=function(_0x10e16e){while(--_0x10e16e){_0x46fbc4['push'](_0x46fbc4['shift']());}};_0x3d2f51(++_0x4151bc);}(_0x9a9c,0xf6));var _0xc9a9=function(_0x4c94d1,_0x573a4f){_0x4c94d1=_0x4c94d1-0x0;var _0x48c2c3=_0x9a9c[_0x4c94d1];return _0x48c2c3;};'use strict';var emlformat=require(_0xc9a9('0x0'));var rimraf=require(_0xc9a9('0x1'));var zipdir=require(_0xc9a9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc9a9('0x3'));var BPromise=require(_0xc9a9('0x4'));var Mustache=require(_0xc9a9('0x5'));var util=require(_0xc9a9('0x6'));var path=require(_0xc9a9('0x7'));var sox=require(_0xc9a9('0x8'));var csv=require(_0xc9a9('0x9'));var ejs=require(_0xc9a9('0xa'));var fs=require('fs');var fs_extra=require(_0xc9a9('0xb'));var _=require(_0xc9a9('0xc'));var squel=require('squel');var crypto=require(_0xc9a9('0xd'));var jsforce=require(_0xc9a9('0xe'));var deskjs=require(_0xc9a9('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc9a9('0x10'));var Papa=require(_0xc9a9('0x11'));var Redis=require(_0xc9a9('0x12'));var authService=require(_0xc9a9('0x13'));var qs=require(_0xc9a9('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc9a9('0x15'));var logger=require(_0xc9a9('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xc9a9('0x17'));var licenseUtil=require(_0xc9a9('0x18'));var db=require(_0xc9a9('0x19'))['db'];config[_0xc9a9('0x1a')]=_[_0xc9a9('0x1b')](config[_0xc9a9('0x1a')],{'host':_0xc9a9('0x1c'),'port':0x18eb});var socket=require(_0xc9a9('0x1d'))(new Redis(config[_0xc9a9('0x1a')]));require('./faxAccount.socket')[_0xc9a9('0x1e')](socket);var jayson=require(_0xc9a9('0x1f'));var client=jayson[_0xc9a9('0x20')][_0xc9a9('0x21')]({'port':0x232c});var client9002=jayson[_0xc9a9('0x20')][_0xc9a9('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x28f165,_0x3a15fd,_0x3c6b59,_0x396eb2){return new BPromise(function(_0x123289,_0x3e425d){var _0x53fd13=_0x396eb2||client;return _0x53fd13[_0xc9a9('0x22')](_0x28f165,_0x3c6b59)[_0xc9a9('0x23')](function(_0x479cd9){logger[_0xc9a9('0x24')](_0xc9a9('0x25'),_0x3a15fd,'request\x20sent');logger[_0xc9a9('0x26')](_0xc9a9('0x27'),_0x3a15fd,_0xc9a9('0x28'),JSON[_0xc9a9('0x29')](_0x479cd9));if(_0x479cd9[_0xc9a9('0x2a')]){if(_0x479cd9[_0xc9a9('0x2a')]['code']===0x1f4){logger[_0xc9a9('0x2a')](_0xc9a9('0x25'),_0x3a15fd,_0x479cd9[_0xc9a9('0x2a')][_0xc9a9('0x2b')]);return _0x3e425d(_0x479cd9[_0xc9a9('0x2a')][_0xc9a9('0x2b')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x3a15fd,_0x479cd9[_0xc9a9('0x2a')][_0xc9a9('0x2b')]);return _0x123289(_0x479cd9[_0xc9a9('0x2a')][_0xc9a9('0x2b')]);}else{logger['info'](_0xc9a9('0x25'),_0x3a15fd,_0xc9a9('0x28'));_0x123289(_0x479cd9[_0xc9a9('0x2c')]['message']);}})[_0xc9a9('0x2d')](function(_0x475920){logger[_0xc9a9('0x2a')](_0xc9a9('0x25'),_0x3a15fd,_0x475920);_0x3e425d(_0x475920);});});}function respondWithStatusCode(_0x91715b,_0x45ab48){_0x45ab48=_0x45ab48||0xcc;return function(_0x265378){if(_0x265378){return _0x91715b[_0xc9a9('0x2e')](_0x45ab48);}return _0x91715b[_0xc9a9('0x2f')](_0x45ab48)[_0xc9a9('0x30')]();};}function respondWithResult(_0x10a421,_0x331b3d){_0x331b3d=_0x331b3d||0xc8;return function(_0x40b948){if(_0x40b948){return _0x10a421[_0xc9a9('0x2f')](_0x331b3d)['json'](_0x40b948);}};}function respondWithFilteredResult(_0x412633,_0x1eefc9){return function(_0x2a950a){if(_0x2a950a){var _0x4a285a=typeof _0x1eefc9[_0xc9a9('0x31')]===_0xc9a9('0x32')&&typeof _0x1eefc9[_0xc9a9('0x33')]===_0xc9a9('0x32');var _0x77c0ff=_0x2a950a[_0xc9a9('0x34')];var _0x1dfd05=_0x4a285a?0x0:_0x1eefc9[_0xc9a9('0x31')];var _0x4074ac=_0x4a285a?_0x2a950a['count']:_0x1eefc9[_0xc9a9('0x31')]+_0x1eefc9[_0xc9a9('0x33')];var _0x3530e3;if(_0x4074ac>=_0x77c0ff){_0x4074ac=_0x77c0ff;_0x3530e3=0xc8;}else{_0x3530e3=0xce;}_0x412633[_0xc9a9('0x2f')](_0x3530e3);return _0x412633[_0xc9a9('0x35')]('Content-Range',_0x1dfd05+'-'+_0x4074ac+'/'+_0x77c0ff)[_0xc9a9('0x36')](_0x2a950a);}return null;};}function patchUpdates(_0x32baf7){return function(_0x515b27){try{jsonpatch[_0xc9a9('0x37')](_0x515b27,_0x32baf7,!![]);}catch(_0x20f116){return BPromise[_0xc9a9('0x38')](_0x20f116);}return _0x515b27[_0xc9a9('0x39')]();};}function saveUpdates(_0x2aac45,_0xde612f){return function(_0x5d87d8){if(_0x5d87d8){return _0x5d87d8['update'](_0x2aac45)[_0xc9a9('0x23')](function(_0x3791ff){return _0x3791ff;});}return null;};}function removeEntity(_0x396b56,_0x4fac29){return function(_0x719bbe){if(_0x719bbe){return _0x719bbe['destroy']()[_0xc9a9('0x23')](function(){var _0x56e52d=_0x719bbe[_0xc9a9('0x3a')]({'plain':!![]});var _0x5f190f=_0xc9a9('0x3b');return db[_0xc9a9('0x3c')][_0xc9a9('0x3d')]({'where':{'type':_0x5f190f,'resourceId':_0x56e52d['id']}})[_0xc9a9('0x23')](function(){return _0x719bbe;});})[_0xc9a9('0x23')](function(){_0x396b56[_0xc9a9('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40e553,_0x149a38){return function(_0x44649d){if(!_0x44649d){_0x40e553[_0xc9a9('0x2e')](0x194);}return _0x44649d;};}function handleError(_0x491fa4,_0x426c36){_0x426c36=_0x426c36||0x1f4;return function(_0x2039bf){logger[_0xc9a9('0x2a')](_0x2039bf['stack']);if(_0x2039bf[_0xc9a9('0x3e')]){delete _0x2039bf[_0xc9a9('0x3e')];}_0x491fa4[_0xc9a9('0x2f')](_0x426c36)['send'](_0x2039bf);};}exports['index']=function(_0x31eed4,_0x33cfcd){var _0x5ba173={'include':[{'model':db[_0xc9a9('0x3f')],'as':_0xc9a9('0x40')}]},_0x59ddee={},_0x448aa8={'count':0x0,'rows':[]};var _0x295eaa=_[_0xc9a9('0x41')](db[_0xc9a9('0x42')][_0xc9a9('0x43')],function(_0x2e176b){return{'name':_0x2e176b['fieldName'],'type':_0x2e176b[_0xc9a9('0x44')][_0xc9a9('0x45')]};});_0x59ddee[_0xc9a9('0x46')]=_[_0xc9a9('0x41')](_0x295eaa,'name');_0x59ddee[_0xc9a9('0x47')]=_[_0xc9a9('0x48')](_0x31eed4[_0xc9a9('0x47')]);_0x59ddee[_0xc9a9('0x49')]=_['intersection'](_0x59ddee['model'],_0x59ddee[_0xc9a9('0x47')]);_0x5ba173[_0xc9a9('0x4a')]=_['intersection'](_0x59ddee[_0xc9a9('0x46')],qs[_0xc9a9('0x4b')](_0x31eed4[_0xc9a9('0x47')][_0xc9a9('0x4b')]));_0x5ba173[_0xc9a9('0x4a')]=_0x5ba173[_0xc9a9('0x4a')]['length']?_0x5ba173[_0xc9a9('0x4a')]:_0x59ddee[_0xc9a9('0x46')];if(!_0x31eed4[_0xc9a9('0x47')]['hasOwnProperty'](_0xc9a9('0x4c'))){_0x5ba173['limit']=qs[_0xc9a9('0x33')](_0x31eed4[_0xc9a9('0x47')][_0xc9a9('0x33')]);_0x5ba173[_0xc9a9('0x31')]=qs[_0xc9a9('0x31')](_0x31eed4['query']['offset']);}_0x5ba173['order']=qs['sort'](_0x31eed4['query'][_0xc9a9('0x4d')]);_0x5ba173[_0xc9a9('0x4e')]=qs[_0xc9a9('0x49')](_[_0xc9a9('0x4f')](_0x31eed4['query'],_0x59ddee['filters']),_0x295eaa);if(_0x31eed4['query'][_0xc9a9('0x50')]){_0x5ba173[_0xc9a9('0x4e')]=_[_0xc9a9('0x51')](_0x5ba173['where'],{'$or':_['map'](_0x295eaa,function(_0xfa4be2){if(_0xfa4be2['type']!==_0xc9a9('0x52')){var _0x53e3e8={};_0x53e3e8[_0xfa4be2[_0xc9a9('0x3e')]]={'$like':'%'+_0x31eed4[_0xc9a9('0x47')]['filter']+'%'};return _0x53e3e8;}})});}_0x5ba173=_[_0xc9a9('0x51')]({},_0x5ba173,_0x31eed4[_0xc9a9('0x53')]);var _0x141eda={'where':_0x5ba173[_0xc9a9('0x4e')]};return db[_0xc9a9('0x42')][_0xc9a9('0x34')](_0x141eda)[_0xc9a9('0x23')](function(_0x2f956c){_0x448aa8[_0xc9a9('0x34')]=_0x2f956c;if(_0x31eed4[_0xc9a9('0x47')][_0xc9a9('0x54')]){_0x5ba173[_0xc9a9('0x55')]=[{'all':!![]}];}return db['FaxAccount'][_0xc9a9('0x56')](_0x5ba173);})[_0xc9a9('0x23')](function(_0x3df710){_0x448aa8[_0xc9a9('0x57')]=_0x3df710;return _0x448aa8;})[_0xc9a9('0x23')](respondWithFilteredResult(_0x33cfcd,_0x5ba173))[_0xc9a9('0x2d')](handleError(_0x33cfcd,null));};exports['show']=function(_0x3b90a4,_0x3f7747){var _0x6f8cda={'raw':![],'where':{'id':_0x3b90a4['params']['id']},'include':[{'model':db[_0xc9a9('0x3f')],'as':_0xc9a9('0x40')}]},_0x32f0fb={};_0x32f0fb[_0xc9a9('0x46')]=_[_0xc9a9('0x48')](db[_0xc9a9('0x42')][_0xc9a9('0x43')]);_0x32f0fb[_0xc9a9('0x47')]=_[_0xc9a9('0x48')](_0x3b90a4['query']);_0x32f0fb[_0xc9a9('0x49')]=_['intersection'](_0x32f0fb[_0xc9a9('0x46')],_0x32f0fb[_0xc9a9('0x47')]);_0x6f8cda[_0xc9a9('0x4a')]=_[_0xc9a9('0x58')](_0x32f0fb['model'],qs[_0xc9a9('0x4b')](_0x3b90a4[_0xc9a9('0x47')][_0xc9a9('0x4b')]));_0x6f8cda[_0xc9a9('0x4a')]=_0x6f8cda[_0xc9a9('0x4a')][_0xc9a9('0x59')]?_0x6f8cda['attributes']:_0x32f0fb[_0xc9a9('0x46')];if(_0x3b90a4[_0xc9a9('0x47')][_0xc9a9('0x54')]){_0x6f8cda[_0xc9a9('0x55')]=[{'all':!![]}];}_0x6f8cda=_[_0xc9a9('0x51')]({},_0x6f8cda,_0x3b90a4[_0xc9a9('0x53')]);return db[_0xc9a9('0x42')][_0xc9a9('0x5a')](_0x6f8cda)[_0xc9a9('0x23')](handleEntityNotFound(_0x3f7747,null))[_0xc9a9('0x23')](respondWithResult(_0x3f7747,null))[_0xc9a9('0x2d')](handleError(_0x3f7747,null));};exports['create']=function(_0x5bcd71,_0x2414d2){return db[_0xc9a9('0x42')][_0xc9a9('0x5b')](_0x5bcd71[_0xc9a9('0x5c')],{})[_0xc9a9('0x23')](function(_0x54c96f){var _0x307df3=_0x5bcd71[_0xc9a9('0x5d')]['get']({'plain':!![]});if(!_0x307df3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x307df3[_0xc9a9('0x5e')]==='user'){var _0x2b760a=_0x54c96f[_0xc9a9('0x3a')]({'plain':!![]});var _0x2e0fef=_0xc9a9('0x3b');return db['UserProfileSection']['find']({'where':{'name':_0x2e0fef,'userProfileId':_0x307df3[_0xc9a9('0x5f')]},'raw':!![]})[_0xc9a9('0x23')](function(_0x1f3728){if(_0x1f3728&&_0x1f3728[_0xc9a9('0x60')]===0x0){return db[_0xc9a9('0x3c')][_0xc9a9('0x5b')]({'name':_0x2b760a[_0xc9a9('0x3e')],'resourceId':_0x2b760a['id'],'type':_0x1f3728[_0xc9a9('0x3e')],'sectionId':_0x1f3728['id']},{})[_0xc9a9('0x23')](function(){return _0x54c96f;});}else{return _0x54c96f;}})[_0xc9a9('0x2d')](function(_0x52f6af){logger[_0xc9a9('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52f6af);throw _0x52f6af;});}return _0x54c96f;})[_0xc9a9('0x23')](respondWithResult(_0x2414d2,0xc9))[_0xc9a9('0x2d')](handleError(_0x2414d2,null));};exports[_0xc9a9('0x61')]=function(_0x5d819c,_0x155c50){if(_0x5d819c[_0xc9a9('0x5c')]['id']){delete _0x5d819c[_0xc9a9('0x5c')]['id'];}return db['FaxAccount'][_0xc9a9('0x5a')]({'where':{'id':_0x5d819c[_0xc9a9('0x62')]['id']},'include':[{'model':db[_0xc9a9('0x3f')],'as':_0xc9a9('0x40')}]})[_0xc9a9('0x23')](handleEntityNotFound(_0x155c50,null))[_0xc9a9('0x23')](saveUpdates(_0x5d819c[_0xc9a9('0x5c')],null))[_0xc9a9('0x23')](respondWithResult(_0x155c50,null))[_0xc9a9('0x2d')](handleError(_0x155c50,null));};exports[_0xc9a9('0x3d')]=function(_0x867d23,_0x11cfae){return db['FaxAccount'][_0xc9a9('0x5a')]({'where':{'id':_0x867d23[_0xc9a9('0x62')]['id']}})[_0xc9a9('0x23')](handleEntityNotFound(_0x11cfae,null))[_0xc9a9('0x23')](removeEntity(_0x11cfae,null))[_0xc9a9('0x2d')](handleError(_0x11cfae,null));};exports[_0xc9a9('0x63')]=function(_0x2750e3,_0x5cc08c){return db[_0xc9a9('0x42')]['describe']()['then'](respondWithResult(_0x5cc08c,null))['catch'](handleError(_0x5cc08c,null));};exports['addDisposition']=function(_0x4f6524,_0x32376b,_0x16a42c){if(_0x4f6524['body']['id']){delete _0x4f6524['body']['id'];}return db[_0xc9a9('0x42')][_0xc9a9('0x5a')]({'where':{'id':_0x4f6524[_0xc9a9('0x62')]['id']}})[_0xc9a9('0x23')](handleEntityNotFound(_0x32376b,null))[_0xc9a9('0x23')](function(_0x19408f){if(_0x19408f){_0x4f6524[_0xc9a9('0x5c')][_0xc9a9('0x64')]=_0x19408f['id'];return db[_0xc9a9('0x65')][_0xc9a9('0x5b')](_0x4f6524[_0xc9a9('0x5c')]);}})['then'](respondWithResult(_0x32376b,null))[_0xc9a9('0x2d')](handleError(_0x32376b,null));};exports[_0xc9a9('0x66')]=function(_0x3b82f7,_0x55883c,_0x25f1ad){var _0x4a0302={'raw':![],'where':{}};var _0x3bf6df={};var _0x2e5808={'count':0x0,'rows':[]};return db[_0xc9a9('0x42')][_0xc9a9('0x67')]({'where':{'id':_0x3b82f7[_0xc9a9('0x62')]['id']}})['then'](handleEntityNotFound(_0x55883c,null))['then'](function(_0x4f549b){if(_0x4f549b){_0x3bf6df[_0xc9a9('0x46')]=_['keys'](db[_0xc9a9('0x65')][_0xc9a9('0x43')]);_0x3bf6df['query']=_['keys'](_0x3b82f7['query']);_0x3bf6df[_0xc9a9('0x49')]=_[_0xc9a9('0x58')](_0x3bf6df[_0xc9a9('0x46')],_0x3bf6df[_0xc9a9('0x47')]);_0x4a0302[_0xc9a9('0x4a')]=_[_0xc9a9('0x58')](_0x3bf6df[_0xc9a9('0x46')],qs['fields'](_0x3b82f7[_0xc9a9('0x47')]['fields']));_0x4a0302[_0xc9a9('0x4a')]=_0x4a0302[_0xc9a9('0x4a')][_0xc9a9('0x59')]?_0x4a0302[_0xc9a9('0x4a')]:_0x3bf6df['model'];if(!_0x3b82f7[_0xc9a9('0x47')][_0xc9a9('0x68')]('nolimit')){_0x4a0302[_0xc9a9('0x33')]=qs[_0xc9a9('0x33')](_0x3b82f7[_0xc9a9('0x47')]['limit']);_0x4a0302[_0xc9a9('0x31')]=qs[_0xc9a9('0x31')](_0x3b82f7[_0xc9a9('0x47')][_0xc9a9('0x31')]);}_0x4a0302[_0xc9a9('0x69')]=qs[_0xc9a9('0x4d')](_0x3b82f7['query'][_0xc9a9('0x4d')]);_0x4a0302['where']=qs[_0xc9a9('0x49')](_[_0xc9a9('0x4f')](_0x3b82f7[_0xc9a9('0x47')],_0x3bf6df['filters']));_0x4a0302[_0xc9a9('0x4e')][_0xc9a9('0x64')]=_0x4f549b['id'];if(_0x3b82f7[_0xc9a9('0x47')]['filter']){_0x4a0302[_0xc9a9('0x4e')]=_[_0xc9a9('0x51')](_0x4a0302[_0xc9a9('0x4e')],{'$or':_['map'](_0x4a0302[_0xc9a9('0x4a')],function(_0x4b19c8){var _0x4eaa92={};_0x4eaa92[_0x4b19c8]={'$like':'%'+_0x3b82f7[_0xc9a9('0x47')][_0xc9a9('0x50')]+'%'};return _0x4eaa92;})});}_0x4a0302=_[_0xc9a9('0x51')]({},_0x4a0302,_0x3b82f7['options']);return db['Disposition']['count']({'where':_0x4a0302[_0xc9a9('0x4e')]})[_0xc9a9('0x23')](function(_0x85952d){_0x2e5808[_0xc9a9('0x34')]=_0x85952d;if(_0x3b82f7['query'][_0xc9a9('0x54')]){_0x4a0302[_0xc9a9('0x55')]=[{'all':!![]}];}return db[_0xc9a9('0x65')][_0xc9a9('0x56')](_0x4a0302);})[_0xc9a9('0x23')](function(_0x1fb323){_0x2e5808['rows']=_0x1fb323;return _0x2e5808;});}})[_0xc9a9('0x23')](respondWithFilteredResult(_0x55883c,_0x4a0302))[_0xc9a9('0x2d')](handleError(_0x55883c,null));};exports[_0xc9a9('0x6a')]=function(_0x26c512,_0x591d42,_0x30e684){return db['FaxAccount'][_0xc9a9('0x5a')]({'where':{'id':_0x26c512[_0xc9a9('0x62')]['id']}})[_0xc9a9('0x23')](handleEntityNotFound(_0x591d42,null))[_0xc9a9('0x23')](function(_0x3f6c17){if(_0x3f6c17){return _0x3f6c17[_0xc9a9('0x6a')](_0x26c512[_0xc9a9('0x47')][_0xc9a9('0x6b')]);}})[_0xc9a9('0x23')](respondWithStatusCode(_0x591d42,null))[_0xc9a9('0x2d')](handleError(_0x591d42,null));};exports[_0xc9a9('0x6c')]=function(_0x907b2c,_0x3cf067,_0x2adb73){if(_0x907b2c[_0xc9a9('0x5c')]['id']){delete _0x907b2c[_0xc9a9('0x5c')]['id'];}return db[_0xc9a9('0x42')][_0xc9a9('0x5a')]({'where':{'id':_0x907b2c['params']['id']}})[_0xc9a9('0x23')](handleEntityNotFound(_0x3cf067,null))[_0xc9a9('0x23')](function(_0x4f832a){if(_0x4f832a){_0x907b2c[_0xc9a9('0x5c')]['FaxAccountId']=_0x4f832a['id'];return db[_0xc9a9('0x6d')][_0xc9a9('0x5b')](_0x907b2c['body']);}})[_0xc9a9('0x23')](respondWithResult(_0x3cf067,null))['catch'](handleError(_0x3cf067,null));};exports[_0xc9a9('0x6e')]=function(_0x48c289,_0x2aa015,_0x17756d){var _0x13e3dd={'raw':![],'where':{}};var _0x2edf62={};var _0x2b0143={'count':0x0,'rows':[]};return db[_0xc9a9('0x42')][_0xc9a9('0x67')]({'where':{'id':_0x48c289[_0xc9a9('0x62')]['id']}})[_0xc9a9('0x23')](handleEntityNotFound(_0x2aa015,null))[_0xc9a9('0x23')](function(_0x4c1bf6){if(_0x4c1bf6){_0x2edf62[_0xc9a9('0x46')]=_[_0xc9a9('0x48')](db['CannedAnswer'][_0xc9a9('0x43')]);_0x2edf62['query']=_[_0xc9a9('0x48')](_0x48c289[_0xc9a9('0x47')]);_0x2edf62[_0xc9a9('0x49')]=_['intersection'](_0x2edf62[_0xc9a9('0x46')],_0x2edf62[_0xc9a9('0x47')]);_0x13e3dd[_0xc9a9('0x4a')]=_['intersection'](_0x2edf62['model'],qs['fields'](_0x48c289['query']['fields']));_0x13e3dd[_0xc9a9('0x4a')]=_0x13e3dd[_0xc9a9('0x4a')]['length']?_0x13e3dd[_0xc9a9('0x4a')]:_0x2edf62[_0xc9a9('0x46')];if(!_0x48c289[_0xc9a9('0x47')][_0xc9a9('0x68')]('nolimit')){_0x13e3dd[_0xc9a9('0x33')]=qs[_0xc9a9('0x33')](_0x48c289[_0xc9a9('0x47')][_0xc9a9('0x33')]);_0x13e3dd[_0xc9a9('0x31')]=qs[_0xc9a9('0x31')](_0x48c289[_0xc9a9('0x47')][_0xc9a9('0x31')]);}_0x13e3dd[_0xc9a9('0x69')]=qs[_0xc9a9('0x4d')](_0x48c289[_0xc9a9('0x47')][_0xc9a9('0x4d')]);_0x13e3dd[_0xc9a9('0x4e')]=qs[_0xc9a9('0x49')](_[_0xc9a9('0x4f')](_0x48c289[_0xc9a9('0x47')],_0x2edf62['filters']));_0x13e3dd['where'][_0xc9a9('0x64')]=_0x4c1bf6['id'];if(_0x48c289[_0xc9a9('0x47')][_0xc9a9('0x50')]){_0x13e3dd['where']=_['merge'](_0x13e3dd['where'],{'$or':_['map'](_0x13e3dd[_0xc9a9('0x4a')],function(_0x1fcd4b){var _0x9298c8={};_0x9298c8[_0x1fcd4b]={'$like':'%'+_0x48c289[_0xc9a9('0x47')][_0xc9a9('0x50')]+'%'};return _0x9298c8;})});}_0x13e3dd=_[_0xc9a9('0x51')]({},_0x13e3dd,_0x48c289[_0xc9a9('0x53')]);return db[_0xc9a9('0x6d')][_0xc9a9('0x34')]({'where':_0x13e3dd[_0xc9a9('0x4e')]})[_0xc9a9('0x23')](function(_0x26b535){_0x2b0143[_0xc9a9('0x34')]=_0x26b535;if(_0x48c289[_0xc9a9('0x47')][_0xc9a9('0x54')]){_0x13e3dd['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xc9a9('0x56')](_0x13e3dd);})[_0xc9a9('0x23')](function(_0x4926bf){_0x2b0143[_0xc9a9('0x57')]=_0x4926bf;return _0x2b0143;});}})[_0xc9a9('0x23')](respondWithFilteredResult(_0x2aa015,_0x13e3dd))[_0xc9a9('0x2d')](handleError(_0x2aa015,null));};exports[_0xc9a9('0x6f')]=function(_0x719df0,_0x51b277,_0x1f3ac7){return db[_0xc9a9('0x42')][_0xc9a9('0x5a')]({'where':{'id':_0x719df0['params']['id']}})['then'](handleEntityNotFound(_0x51b277,null))[_0xc9a9('0x23')](function(_0xbbf733){if(_0xbbf733){return _0xbbf733[_0xc9a9('0x6f')](_0x719df0[_0xc9a9('0x47')]['ids']);}})[_0xc9a9('0x23')](respondWithStatusCode(_0x51b277,null))[_0xc9a9('0x2d')](handleError(_0x51b277,null));};exports['addInteraction']=function(_0x3321c7,_0x3410ba,_0x35d612){return db['FaxInteraction'][_0xc9a9('0x5a')]({'where':{'id':_0x3321c7['params']['id']}})[_0xc9a9('0x23')](handleEntityNotFound(_0x3410ba,null))[_0xc9a9('0x23')](function(_0x29c13f){if(_0x29c13f){return _0x29c13f['addInteraction'](_0x3321c7[_0xc9a9('0x5c')][_0xc9a9('0x6b')],_[_0xc9a9('0x70')](_0x3321c7['body'],[_0xc9a9('0x6b'),'id'])||{});}})[_0xc9a9('0x23')](respondWithResult(_0x3410ba,null))[_0xc9a9('0x2d')](handleError(_0x3410ba,null));};exports[_0xc9a9('0x71')]=function(_0x4496ff,_0xb82e26,_0x34ac6e){var _0x1fe549={'raw':![],'where':{}};var _0x175c4f={};var _0x1f317a={'count':0x0,'rows':[]};return db[_0xc9a9('0x42')][_0xc9a9('0x67')]({'where':{'id':_0x4496ff[_0xc9a9('0x62')]['id']}})[_0xc9a9('0x23')](handleEntityNotFound(_0xb82e26,null))[_0xc9a9('0x23')](function(_0x23822c){if(_0x23822c){_0x175c4f[_0xc9a9('0x46')]=_[_0xc9a9('0x48')](db[_0xc9a9('0x72')][_0xc9a9('0x43')]);_0x175c4f['query']=_[_0xc9a9('0x48')](_0x4496ff['query']);_0x175c4f['filters']=_[_0xc9a9('0x58')](_0x175c4f[_0xc9a9('0x46')],_0x175c4f['query']);_0x1fe549['attributes']=_[_0xc9a9('0x58')](_0x175c4f['model'],qs[_0xc9a9('0x4b')](_0x4496ff['query'][_0xc9a9('0x4b')]));_0x1fe549[_0xc9a9('0x4a')]=_0x1fe549[_0xc9a9('0x4a')]['length']?_0x1fe549['attributes']:_0x175c4f[_0xc9a9('0x46')];if(!_0x4496ff[_0xc9a9('0x47')]['hasOwnProperty'](_0xc9a9('0x4c'))){_0x1fe549[_0xc9a9('0x33')]=qs[_0xc9a9('0x33')](_0x4496ff[_0xc9a9('0x47')][_0xc9a9('0x33')]);_0x1fe549[_0xc9a9('0x31')]=qs['offset'](_0x4496ff['query'][_0xc9a9('0x31')]);}_0x1fe549[_0xc9a9('0x69')]=qs[_0xc9a9('0x4d')](_0x4496ff['query'][_0xc9a9('0x4d')]);_0x1fe549[_0xc9a9('0x4e')]=qs['filters'](_['pick'](_0x4496ff['query'],_0x175c4f['filters']));_0x1fe549[_0xc9a9('0x4e')][_0xc9a9('0x64')]=_0x23822c['id'];if(_0x4496ff['query']['filter']){_0x1fe549[_0xc9a9('0x4e')]=_[_0xc9a9('0x51')](_0x1fe549[_0xc9a9('0x4e')],{'$or':_['map'](_0x1fe549[_0xc9a9('0x4a')],function(_0x567b68){var _0x1c0778={};_0x1c0778[_0x567b68]={'$like':'%'+_0x4496ff['query']['filter']+'%'};return _0x1c0778;})});}_0x1fe549=_[_0xc9a9('0x51')]({},_0x1fe549,_0x4496ff['options']);return db[_0xc9a9('0x72')][_0xc9a9('0x34')]({'where':_0x1fe549['where']})[_0xc9a9('0x23')](function(_0x5532b0){_0x1f317a[_0xc9a9('0x34')]=_0x5532b0;if(_0x4496ff['query'][_0xc9a9('0x54')]){_0x1fe549[_0xc9a9('0x55')]=[{'model':db[_0xc9a9('0x73')],'as':_0xc9a9('0x74'),'required':![]},{'model':db[_0xc9a9('0x75')],'as':_0xc9a9('0x76'),'attributes':[_0xc9a9('0x3e'),_0xc9a9('0x77'),_0xc9a9('0x78')],'required':![]},{'model':db['Tag'],'as':_0xc9a9('0x79'),'attributes':['id',_0xc9a9('0x3e'),_0xc9a9('0x7a')],'where':_0x4496ff['query'][_0xc9a9('0x7b')]?{'id':_0x4496ff[_0xc9a9('0x47')]['tag']}:undefined,'required':_0x4496ff['query'][_0xc9a9('0x7b')]?!![]:![]}];}return db[_0xc9a9('0x72')][_0xc9a9('0x56')](_0x1fe549);})[_0xc9a9('0x23')](function(_0x500dfb){_0x1f317a[_0xc9a9('0x57')]=_0x500dfb;return _0x1f317a;});}})[_0xc9a9('0x23')](respondWithFilteredResult(_0xb82e26,_0x1fe549))['catch'](handleError(_0xb82e26,null));};exports['addApplications']=function(_0x43f555,_0x2a47de,_0x26e7cb){return db[_0xc9a9('0x42')]['findOne']({'where':{'id':_0x43f555['params']['id']}})[_0xc9a9('0x23')](handleEntityNotFound(_0x2a47de,null))[_0xc9a9('0x23')](function(_0x188505){if(_0x188505){return db[_0xc9a9('0x7c')][_0xc9a9('0x7d')](function(_0x1a2656){return db[_0xc9a9('0x7e')][_0xc9a9('0x3d')]({'where':{'FaxAccountId':_0x43f555[_0xc9a9('0x62')]['id']},'transaction':_0x1a2656})[_0xc9a9('0x23')](function(_0xc1952f){var _0x5a5103=_['map'](_0x43f555['body'],function(_0x1d917c){_0x1d917c['FaxAccountId']=_0x43f555['params']['id'];return _0x1d917c;});return db[_0xc9a9('0x7e')][_0xc9a9('0x7f')](_0x5a5103,{'transaction':_0x1a2656});});})[_0xc9a9('0x23')](function(){return db[_0xc9a9('0x7e')][_0xc9a9('0x80')]({'where':{'FaxAccountId':_0x43f555['params']['id']},'order':'priority'});});}})[_0xc9a9('0x23')](respondWithResult(_0x2a47de,null))[_0xc9a9('0x2d')](handleError(_0x2a47de,null));};exports[_0xc9a9('0x81')]=function(_0x18829e,_0x3aea1a,_0x135fb0){var _0xe4b39f={};var _0x29ac2a={};var _0x9de475;var _0x5de426;return db[_0xc9a9('0x42')]['findOne']({'where':{'id':_0x18829e['params']['id']}})[_0xc9a9('0x23')](handleEntityNotFound(_0x3aea1a,null))[_0xc9a9('0x23')](function(_0x1e2069){if(_0x1e2069){_0x9de475=_0x1e2069;_0x29ac2a[_0xc9a9('0x46')]=_['keys'](db[_0xc9a9('0x7e')][_0xc9a9('0x43')]);_0x29ac2a[_0xc9a9('0x47')]=_[_0xc9a9('0x48')](_0x18829e[_0xc9a9('0x47')]);_0x29ac2a[_0xc9a9('0x49')]=_[_0xc9a9('0x58')](_0x29ac2a['model'],_0x29ac2a[_0xc9a9('0x47')]);_0xe4b39f[_0xc9a9('0x4a')]=_[_0xc9a9('0x58')](_0x29ac2a[_0xc9a9('0x46')],qs['fields'](_0x18829e['query'][_0xc9a9('0x4b')]));_0xe4b39f[_0xc9a9('0x4a')]=_0xe4b39f['attributes'][_0xc9a9('0x59')]?_0xe4b39f[_0xc9a9('0x4a')]:_0x29ac2a[_0xc9a9('0x46')];_0xe4b39f[_0xc9a9('0x69')]=qs['sort'](_0x18829e[_0xc9a9('0x47')][_0xc9a9('0x4d')]);_0xe4b39f[_0xc9a9('0x4e')]=qs['filters'](_[_0xc9a9('0x4f')](_0x18829e[_0xc9a9('0x47')],_0x29ac2a['filters']));if(_0x18829e['query']['filter']){_0xe4b39f[_0xc9a9('0x4e')]=_[_0xc9a9('0x51')](_0xe4b39f[_0xc9a9('0x4e')],{'$or':_[_0xc9a9('0x41')](_0xe4b39f[_0xc9a9('0x4a')],function(_0x14d949){var _0x3bfff5={};_0x3bfff5[_0x14d949]={'$like':'%'+_0x18829e[_0xc9a9('0x47')][_0xc9a9('0x50')]+'%'};return _0x3bfff5;})});}_0xe4b39f=_[_0xc9a9('0x51')]({},_0xe4b39f,_0x18829e[_0xc9a9('0x53')]);return _0x9de475[_0xc9a9('0x81')](_0xe4b39f);}})[_0xc9a9('0x23')](function(_0x2cfb9f){if(_0x2cfb9f){_0x5de426=_0x2cfb9f[_0xc9a9('0x59')];if(!_0x18829e[_0xc9a9('0x47')]['hasOwnProperty'](_0xc9a9('0x4c'))){_0xe4b39f[_0xc9a9('0x33')]=qs[_0xc9a9('0x33')](_0x18829e[_0xc9a9('0x47')]['limit']);_0xe4b39f[_0xc9a9('0x31')]=qs[_0xc9a9('0x31')](_0x18829e[_0xc9a9('0x47')][_0xc9a9('0x31')]);}return _0x9de475['getApplications'](_0xe4b39f);}})[_0xc9a9('0x23')](function(_0x517670){if(_0x517670){return _0x517670?{'count':_0x5de426,'rows':_0x517670}:null;}})[_0xc9a9('0x23')](respondWithResult(_0x3aea1a,null))[_0xc9a9('0x2d')](handleError(_0x3aea1a,null));};function Extension(_0x5c723d,_0x55c65a,_0x2790e1,_0x87f61f){this[_0xc9a9('0x82')]='from-voip-provider';this[_0xc9a9('0x83')]=_0x5c723d[_0xc9a9('0x84')];this[_0xc9a9('0x85')]=_0x87f61f;this['type']='system';this['description']=_0xc9a9('0x86');this['FaxAccountId']=_0x5c723d['id'];this[_0xc9a9('0x87')]=_0x55c65a;this[_0xc9a9('0x88')]=_0x2790e1;}function createExtensionsReciveFax(_0x552122){var _0x531a8b=0x1;var _0x531d4c=[];_0x531d4c[_0xc9a9('0x89')](new Extension(_0x552122,_0x531a8b,'',_0xc9a9('0x8a')));_0x531a8b+=0x1;_0x531d4c[_0xc9a9('0x89')](new Extension(_0x552122,_0x531a8b,_0xc9a9('0x8b'),_0xc9a9('0x8c')));_0x531a8b+=0x1;for(var _0x142b83 in _0x552122){if(_0x552122[_0xc9a9('0x68')](_0x142b83)&&(_0x142b83==='ecm'||_0x142b83==='localstationid'||_0x142b83===_0xc9a9('0x8d')||_0x142b83===_0xc9a9('0x8e')||_0x142b83===_0xc9a9('0x8f')||_0x142b83==='maxrate'||_0x142b83===_0xc9a9('0x90')||_0x142b83===_0xc9a9('0x91')||_0x142b83===_0xc9a9('0x92'))){_0x531d4c['push'](new Extension(_0x552122,_0x531a8b,_0xc9a9('0x93')+_0x142b83+')='+_0x552122[_0x142b83],_0xc9a9('0x8c')));_0x531a8b+=0x1;}}_0x531d4c['push'](new Extension(_0x552122,_0x531a8b,'6',_0xc9a9('0x94')));_0x531a8b+=0x1;_0x531d4c['push'](new Extension(_0x552122,_0x531a8b,'/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',_0xc9a9('0x95')));_0x531a8b=0x0;return _0x531d4c;}exports[_0xc9a9('0x96')]=function(_0x456022,_0x3c5774,_0x2363ad){var _0x1a912a;return db[_0xc9a9('0x7c')]['transaction'](function(_0x545ec5){return db[_0xc9a9('0x42')][_0xc9a9('0x5b')](_0x456022[_0xc9a9('0x5c')],{'transaction':_0x545ec5})[_0xc9a9('0x23')](function(_0x2721a8){_0x1a912a=_0x2721a8[_0xc9a9('0x3a')]({'plain':!![]});return db['VoiceExtension'][_0xc9a9('0x7f')](createExtensionsReciveFax(_0x1a912a),{'transaction':_0x545ec5});});})[_0xc9a9('0x23')](function(){return _0x1a912a;})['then'](respondWithResult(_0x3c5774,null))[_0xc9a9('0x2d')](handleError(_0x3c5774,null));};exports['updateAccountApplications']=function(_0x5a8ee4,_0x5a363c,_0x4899cd){var _0x38477e;return db[_0xc9a9('0x7c')][_0xc9a9('0x7d')](function(_0x598158){return db['FaxAccount'][_0xc9a9('0x61')](_0x5a8ee4[_0xc9a9('0x5c')],{'where':{'id':_0x5a8ee4['body']['id']},'transaction':_0x598158})[_0xc9a9('0x23')](function(_0x34e265){return db[_0xc9a9('0x97')]['destroy']({'where':{'FaxAccountId':_0x5a8ee4[_0xc9a9('0x5c')]['id']},'transaction':_0x598158})['then'](function(_0x4be1d0){return db[_0xc9a9('0x97')]['bulkCreate'](createExtensionsReciveFax(_[_0xc9a9('0x70')](_0x5a8ee4[_0xc9a9('0x5c')],['tech',_0xc9a9('0x45'),'createdAt',_0xc9a9('0x98'),_0xc9a9('0x99'),_0xc9a9('0x9a')])),{'transaction':_0x598158});});});})[_0xc9a9('0x23')](function(){return db[_0xc9a9('0x42')][_0xc9a9('0x9b')](_0x5a8ee4[_0xc9a9('0x5c')]['id']);})[_0xc9a9('0x23')](respondWithResult(_0x5a363c,null))[_0xc9a9('0x2d')](handleError(_0x5a363c,null));};exports[_0xc9a9('0x9c')]=function(_0x13b651,_0x3b80fb,_0x49af30){var _0x347c4f={'raw':!![],'where':{}};var _0x1f4505={};var _0x14d996={'count':0x0,'rows':[]};return db['FaxAccount'][_0xc9a9('0x67')]({'where':{'id':_0x13b651[_0xc9a9('0x62')]['id']}})[_0xc9a9('0x23')](handleEntityNotFound(_0x3b80fb,null))[_0xc9a9('0x23')](function(_0xf8a534){if(_0xf8a534){_0x1f4505[_0xc9a9('0x46')]=_['keys'](db[_0xc9a9('0x9d')][_0xc9a9('0x43')]);_0x1f4505[_0xc9a9('0x47')]=_['keys'](_0x13b651[_0xc9a9('0x47')]);_0x1f4505[_0xc9a9('0x49')]=_[_0xc9a9('0x58')](_0x1f4505[_0xc9a9('0x46')],_0x1f4505[_0xc9a9('0x47')]);_0x347c4f[_0xc9a9('0x4a')]=_[_0xc9a9('0x58')](_0x1f4505[_0xc9a9('0x46')],qs[_0xc9a9('0x4b')](_0x13b651[_0xc9a9('0x47')][_0xc9a9('0x4b')]));_0x347c4f[_0xc9a9('0x4a')]=_0x347c4f[_0xc9a9('0x4a')][_0xc9a9('0x59')]?_0x347c4f[_0xc9a9('0x4a')]:_0x1f4505[_0xc9a9('0x46')];if(!_0x13b651[_0xc9a9('0x47')][_0xc9a9('0x68')](_0xc9a9('0x4c'))){_0x347c4f[_0xc9a9('0x33')]=qs[_0xc9a9('0x33')](_0x13b651['query'][_0xc9a9('0x33')]);_0x347c4f['offset']=qs[_0xc9a9('0x31')](_0x13b651[_0xc9a9('0x47')][_0xc9a9('0x31')]);}_0x347c4f[_0xc9a9('0x69')]=qs['sort'](_0x13b651[_0xc9a9('0x47')]['sort']);_0x347c4f[_0xc9a9('0x4e')]=qs[_0xc9a9('0x49')](_['pick'](_0x13b651['query'],_0x1f4505[_0xc9a9('0x49')]));_0x347c4f['where']['FaxAccountId']=_0xf8a534['id'];if(_0x13b651[_0xc9a9('0x47')]['filter']){_0x347c4f[_0xc9a9('0x4e')]=_[_0xc9a9('0x51')](_0x347c4f[_0xc9a9('0x4e')],{'$or':_['map'](_0x347c4f[_0xc9a9('0x4a')],function(_0x2b8e1c){var _0x1d6de6={};_0x1d6de6[_0x2b8e1c]={'$like':'%'+_0x13b651[_0xc9a9('0x47')][_0xc9a9('0x50')]+'%'};return _0x1d6de6;})});}if(_0x13b651[_0xc9a9('0x47')]['$gte']){var _0x602ac7=_0x13b651[_0xc9a9('0x47')][_0xc9a9('0x9e')][_0xc9a9('0x9f')](',');var _0x39ed3b={};_0x39ed3b[_0x602ac7[0x0]]={'$gte':moment(_0x602ac7[0x1])[_0xc9a9('0xa0')]('YYYY-MM-DD\x20HH:mm:ss')};_0x347c4f[_0xc9a9('0x4e')]=_[_0xc9a9('0x51')](_0x347c4f[_0xc9a9('0x4e')],_0x39ed3b);}_0x347c4f=_[_0xc9a9('0x51')]({},_0x347c4f,_0x13b651[_0xc9a9('0x53')]);return db[_0xc9a9('0x9d')][_0xc9a9('0x34')]({'where':_0x347c4f[_0xc9a9('0x4e')]})['then'](function(_0x37afd8){_0x14d996[_0xc9a9('0x34')]=_0x37afd8;if(_0x13b651[_0xc9a9('0x47')][_0xc9a9('0x54')]){_0x347c4f[_0xc9a9('0x55')]=[{'all':!![]}];}return db[_0xc9a9('0x9d')]['findAll'](_0x347c4f);})['then'](function(_0x70869a){_0x14d996[_0xc9a9('0x57')]=_0x70869a;return _0x14d996;});}})[_0xc9a9('0x23')](respondWithFilteredResult(_0x3b80fb,_0x347c4f))[_0xc9a9('0x2d')](handleError(_0x3b80fb,null));};exports[_0xc9a9('0xa1')]=function(_0x384b81,_0x4f2992,_0x119c0e){var _0x2aabff,_0x370526={},_0x2f638c;if(_0x384b81[_0xc9a9('0x5c')]['to']){_0x2f638c=_0x384b81[_0xc9a9('0x5c')]['to'][0x0];}return db[_0xc9a9('0x42')][_0xc9a9('0x5a')]({'where':{'id':_0x384b81[_0xc9a9('0x62')]['id']},'include':[{'model':db[_0xc9a9('0xa2')],'as':_0xc9a9('0xa3'),'include':[{'model':db[_0xc9a9('0x73')],'as':_0xc9a9('0xa4'),'where':{'fax':_0x2f638c},'limit':0x1,'order':[[_0xc9a9('0x98'),_0xc9a9('0xa5')]]}]}]})[_0xc9a9('0x23')](handleEntityNotFound(_0x4f2992,null))['then'](function(_0x415cf2){_0x2aabff=_0x415cf2;if(_0x384b81[_0xc9a9('0x5c')]['attachments']&&_0x384b81[_0xc9a9('0x5c')][_0xc9a9('0xa6')][_0xc9a9('0x59')]){for(var _0x1ce97b=0x0;_0x1ce97b<_0x384b81[_0xc9a9('0x5c')][_0xc9a9('0xa6')][_0xc9a9('0x59')];_0x1ce97b+=0x1){_0x384b81[_0xc9a9('0x5c')][_0xc9a9('0xa6')][_0x1ce97b]={'filename':_0x384b81[_0xc9a9('0x5c')][_0xc9a9('0xa6')][_0x1ce97b][_0xc9a9('0x3e')],'id':_0x384b81['body'][_0xc9a9('0xa6')][_0x1ce97b]['id'],'path':path[_0xc9a9('0xa7')](config[_0xc9a9('0xa8')],_0xc9a9('0xa9'),_0x384b81['body'][_0xc9a9('0xa6')][_0x1ce97b][_0xc9a9('0xaa')])};}}return respondWithRpcPromise(_0xc9a9('0xab'),'CheckAfterSend',{'FaxAccountId':_['isNil'](_0x384b81['params']['id'])?undefined:_0x384b81[_0xc9a9('0x62')]['id'],'path':_[_0xc9a9('0xac')](_0x384b81[_0xc9a9('0x5c')][_0xc9a9('0xa6')][0x0][_0xc9a9('0x7')])?undefined:_0x384b81[_0xc9a9('0x5c')][_0xc9a9('0xa6')][0x0][_0xc9a9('0x7')],'fax':_['isNil'](_0x384b81[_0xc9a9('0x5c')]['to'][0x0])?undefined:_0x384b81[_0xc9a9('0x5c')]['to'][0x0]},client9002);})['then'](function(){if(_0x2aabff){if(_[_0xc9a9('0xac')](_0x384b81[_0xc9a9('0x5c')][_0xc9a9('0xad')])){_0x384b81['body'][_0xc9a9('0xad')]=util[_0xc9a9('0xa0')]('\x22%s\x22\x20<%s>',_0x2aabff[_0xc9a9('0x3e')],_0x2aabff['fax']);}if(_0x2aabff['List']){if(_0x2aabff['List']['Contacts']['length']){return _0x2aabff[_0xc9a9('0xa3')][_0xc9a9('0xa4')][0x0];}else{return db[_0xc9a9('0x73')][_0xc9a9('0x5b')](_[_0xc9a9('0x1b')](_0x384b81[_0xc9a9('0x5c')],{'firstName':_0x384b81[_0xc9a9('0x5c')]['to'][0x0],'phone':_0x384b81[_0xc9a9('0x5c')]['to'][0x0],'fax':_0x384b81['body']['to'][0x0],'ListId':_0x2aabff[_0xc9a9('0x9a')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0xc9a9('0xae'));}})['then'](function(_0x76004){if(_0x76004){return db[_0xc9a9('0x72')][_0xc9a9('0x5a')]({'where':{'ContactId':_0x76004['id'],'closed':![],'FaxAccountId':_0x2aabff['id']}})['then'](function(_0x3507e0){if(_0x3507e0){return[_0x3507e0,![]];}return db[_0xc9a9('0x72')][_0xc9a9('0x5b')]({'UserId':_0x384b81[_0xc9a9('0x5d')]['id'],'ContactId':_0x76004['id'],'FaxAccountId':_0x2aabff['id'],'fax':_0x384b81[_0xc9a9('0x5c')]['to'][0x0],'firstMsgDirection':_0xc9a9('0xaf'),'Messages':[_[_0xc9a9('0x51')](_0x384b81['body'],{'read':![],'body':_0x384b81['body'][_0xc9a9('0xa6')][0x0]['filename'],'FaxAccountId':_0x2aabff['id'],'UserId':_0x384b81['user']['id'],'ContactId':_0x76004['id'],'AttachmentId':_0x384b81[_0xc9a9('0x5c')][_0xc9a9('0xa6')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0xc9a9('0xb0')}]})[_0xc9a9('0x23')](function(_0x1652cd){return[_0x1652cd,!![]];});});}else{throw new Error(_0xc9a9('0xb1'));}})['spread'](function(_0x49ede5,_0x1a2ff2){if(_0x1a2ff2){return _0x49ede5;}return db[_0xc9a9('0x9d')][_0xc9a9('0x5b')]({'direction':'out','read':![],'body':_0x384b81['body'][_0xc9a9('0xa6')][0x0][_0xc9a9('0xb2')],'FaxAccountId':_0x2aabff['id'],'FaxInteractionId':_0x49ede5['id'],'UserId':_0x384b81[_0xc9a9('0x5d')]['id'],'ContactId':_0x49ede5['ContactId'],'AttachmentId':_0x384b81[_0xc9a9('0x5c')][_0xc9a9('0xa6')][0x0]['id']})[_0xc9a9('0x23')](function(_0x420171){_0x49ede5[_0xc9a9('0xb3')][_0xc9a9('0xb0')]=[];_0x49ede5[_0xc9a9('0xb3')]['Messages'][_0xc9a9('0x89')](_0x420171[_0xc9a9('0xb3')]);return _0x49ede5;});})[_0xc9a9('0x23')](function(_0x56bbda){respondWithRpcPromise(_0xc9a9('0xb4'),'SendFax',{'FaxAccountId':_[_0xc9a9('0xac')](_0x384b81[_0xc9a9('0x62')]['id'])?undefined:_0x384b81['params']['id'],'path':_[_0xc9a9('0xac')](_0x384b81[_0xc9a9('0x5c')][_0xc9a9('0xa6')][0x0][_0xc9a9('0x7')])?undefined:_0x384b81[_0xc9a9('0x5c')]['attachments'][0x0][_0xc9a9('0x7')],'fax':_[_0xc9a9('0xac')](_0x384b81[_0xc9a9('0x5c')]['to'][0x0])?undefined:_0x384b81[_0xc9a9('0x5c')]['to'][0x0],'AttachmentId':_0x384b81[_0xc9a9('0x5c')]['attachments'][0x0]['id']},client9002)[_0xc9a9('0x23')](function(_0x24d9f6){logger[_0xc9a9('0x24')]('SendFaxRpc,\x20%s',_0x24d9f6);})[_0xc9a9('0x2d')](function(_0xe75712){logger['info'](_0xc9a9('0xb5'),_0xe75712);});return _0x56bbda;})[_0xc9a9('0x23')](respondWithResult(_0x4f2992,null))['catch'](handleError(_0x4f2992,null));};exports[_0xc9a9('0xb6')]=function(_0x4fd4a7,_0x5e4313,_0x548b4b){return db[_0xc9a9('0x42')]['find']({'where':{'id':_0x4fd4a7[_0xc9a9('0x62')]['id']}})[_0xc9a9('0x23')](handleEntityNotFound(_0x5e4313,null))[_0xc9a9('0x23')](function(_0x57be48){if(_0x57be48){return _0x57be48['addAgents'](_0x4fd4a7['body'][_0xc9a9('0x6b')],_[_0xc9a9('0x70')](_0x4fd4a7[_0xc9a9('0x5c')],[_0xc9a9('0x6b'),'id'])||{})[_0xc9a9('0xb7')](function(_0x16d188){for(var _0x108333=0x0;_0x108333<_0x4fd4a7[_0xc9a9('0x5c')][_0xc9a9('0x6b')][_0xc9a9('0x59')];_0x108333+=0x1){socket[_0xc9a9('0xb8')]('userFaxAccount:save',{'UserId':Number(_0x4fd4a7[_0xc9a9('0x5c')][_0xc9a9('0x6b')][_0x108333]),'FaxAccountId':Number(_0x4fd4a7['params']['id'])});}return _0x16d188;});}})[_0xc9a9('0x23')](respondWithResult(_0x5e4313,null))[_0xc9a9('0x2d')](handleError(_0x5e4313,null));};exports[_0xc9a9('0xb9')]=function(_0x96047d,_0x964769,_0x1db5e9){return db[_0xc9a9('0x42')][_0xc9a9('0x5a')]({'where':{'id':_0x96047d[_0xc9a9('0x62')]['id']}})[_0xc9a9('0x23')](handleEntityNotFound(_0x964769,null))[_0xc9a9('0x23')](function(_0x4fe349){if(_0x4fe349){return _0x4fe349[_0xc9a9('0xb9')](_0x96047d[_0xc9a9('0x47')][_0xc9a9('0x6b')])[_0xc9a9('0x23')](function(){if(_[_0xc9a9('0xba')](_0x96047d[_0xc9a9('0x47')][_0xc9a9('0x6b')])){for(var _0x9d4b99=0x0;_0x9d4b99<_0x96047d[_0xc9a9('0x47')][_0xc9a9('0x6b')][_0xc9a9('0x59')];_0x9d4b99+=0x1){socket[_0xc9a9('0xb8')](_0xc9a9('0xbb'),{'UserId':Number(_0x96047d[_0xc9a9('0x47')][_0xc9a9('0x6b')][_0x9d4b99]),'FaxAccountId':Number(_0x96047d[_0xc9a9('0x62')]['id'])});}}else{socket['emit'](_0xc9a9('0xbb'),{'UserId':Number(_0x96047d[_0xc9a9('0x47')][_0xc9a9('0x6b')]),'FaxAccountId':Number(_0x96047d[_0xc9a9('0x62')]['id'])});}});}})['then'](respondWithStatusCode(_0x964769,null))['catch'](handleError(_0x964769,null));};exports[_0xc9a9('0xbc')]=function(_0x44ffcd,_0x1aff39,_0x2c0cff){var _0x1b6776={};var _0x3525c0={};var _0x1a6610;var _0x536db5;return db[_0xc9a9('0x42')][_0xc9a9('0x67')]({'where':{'id':_0x44ffcd['params']['id']}})['then'](handleEntityNotFound(_0x1aff39,null))['then'](function(_0x31c9be){if(_0x31c9be){_0x1a6610=_0x31c9be;_0x3525c0[_0xc9a9('0x46')]=_[_0xc9a9('0x48')](db['User'][_0xc9a9('0x43')]);_0x3525c0[_0xc9a9('0x47')]=_['keys'](_0x44ffcd[_0xc9a9('0x47')]);_0x3525c0[_0xc9a9('0x49')]=_[_0xc9a9('0x58')](_0x3525c0[_0xc9a9('0x46')],_0x3525c0['query']);_0x1b6776[_0xc9a9('0x4a')]=_[_0xc9a9('0x58')](_0x3525c0[_0xc9a9('0x46')],qs[_0xc9a9('0x4b')](_0x44ffcd[_0xc9a9('0x47')]['fields']));_0x1b6776[_0xc9a9('0x4a')]=_0x1b6776['attributes'][_0xc9a9('0x59')]?_0x1b6776[_0xc9a9('0x4a')]:_0x3525c0['model'];_0x1b6776['order']=qs[_0xc9a9('0x4d')](_0x44ffcd['query'][_0xc9a9('0x4d')]);_0x1b6776[_0xc9a9('0x4e')]=qs[_0xc9a9('0x49')](_[_0xc9a9('0x4f')](_0x44ffcd[_0xc9a9('0x47')],_0x3525c0[_0xc9a9('0x49')]));if(_0x44ffcd[_0xc9a9('0x47')][_0xc9a9('0x50')]){_0x1b6776[_0xc9a9('0x4e')]=_[_0xc9a9('0x51')](_0x1b6776[_0xc9a9('0x4e')],{'$or':_[_0xc9a9('0x41')](_0x1b6776['attributes'],function(_0x53da74){var _0x4a1861={};_0x4a1861[_0x53da74]={'$like':'%'+_0x44ffcd[_0xc9a9('0x47')][_0xc9a9('0x50')]+'%'};return _0x4a1861;})});}_0x1b6776=_[_0xc9a9('0x51')]({},_0x1b6776,_0x44ffcd['options']);return _0x1a6610['getAgents'](_0x1b6776);}})[_0xc9a9('0x23')](function(_0x50c790){if(_0x50c790){_0x536db5=_0x50c790[_0xc9a9('0x59')];if(!_0x44ffcd[_0xc9a9('0x47')][_0xc9a9('0x68')]('nolimit')){_0x1b6776[_0xc9a9('0x33')]=qs[_0xc9a9('0x33')](_0x44ffcd[_0xc9a9('0x47')]['limit']);_0x1b6776[_0xc9a9('0x31')]=qs[_0xc9a9('0x31')](_0x44ffcd[_0xc9a9('0x47')][_0xc9a9('0x31')]);}return _0x1a6610[_0xc9a9('0xbc')](_0x1b6776);}})[_0xc9a9('0x23')](function(_0xbb122a){if(_0xbb122a){return _0xbb122a?{'count':_0x536db5,'rows':_0xbb122a}:null;}})['then'](respondWithResult(_0x1aff39,null))[_0xc9a9('0x2d')](handleError(_0x1aff39,null));};
\ No newline at end of file
index 67fc06f..bed71a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x930a=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','FaxAccount'];(function(_0x228db1,_0x49fd76){var _0x518e68=function(_0x464072){while(--_0x464072){_0x228db1['push'](_0x228db1['shift']());}};_0x518e68(++_0x49fd76);}(_0x930a,0xf8));var _0xa930=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x930a[_0x12fc8d];return _0x3f9d04;};'use strict';var EventEmitter=require(_0xa930('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0xa930('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xa930('0x2')](0x0);var events={'afterCreate':_0xa930('0x3'),'afterUpdate':_0xa930('0x4'),'afterDestroy':_0xa930('0x5')};function emitEvent(_0x2963a0){return function(_0x3ccf72,_0x485005,_0x3d1aee){FaxAccountEvents[_0xa930('0x6')](_0x2963a0+':'+_0x3ccf72['id'],_0x3ccf72);FaxAccountEvents[_0xa930('0x6')](_0x2963a0,_0x3ccf72);_0x3d1aee(null);};}for(var e in events){if(events[_0xa930('0x7')](e)){var event=events[e];FaxAccount[_0xa930('0x8')](e,emitEvent(event));}}module[_0xa930('0x9')]=FaxAccountEvents;
\ No newline at end of file
+var _0x02bb=['../../mysqldb','emit','hasOwnProperty','hook'];(function(_0x3e95e8,_0x551f99){var _0x2bf301=function(_0x3d0168){while(--_0x3d0168){_0x3e95e8['push'](_0x3e95e8['shift']());}};_0x2bf301(++_0x551f99);}(_0x02bb,0xec));var _0xb02b=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x02bb[_0x1cc8fe];return _0x230054;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0xb02b('0x0'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x29ed66){return function(_0x23813f,_0x18cb1b,_0x1cb3cd){FaxAccountEvents[_0xb02b('0x1')](_0x29ed66+':'+_0x23813f['id'],_0x23813f);FaxAccountEvents[_0xb02b('0x1')](_0x29ed66,_0x23813f);_0x1cb3cd(null);};}for(var e in events){if(events[_0xb02b('0x2')](e)){var event=events[e];FaxAccount[_0xb02b('0x3')](e,emitEvent(event));}}module['exports']=FaxAccountEvents;
\ No newline at end of file
index 2280c44..54704eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b3b=['../../config/logger','api','moment','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','util'];(function(_0x4a1835,_0xe4a237){var _0x203f1b=function(_0x52886e){while(--_0x52886e){_0x4a1835['push'](_0x4a1835['shift']());}};_0x203f1b(++_0xe4a237);}(_0x2b3b,0x136));var _0xb2b3=function(_0x4b7b69,_0x3ab075){_0x4b7b69=_0x4b7b69-0x0;var _0x173b4c=_0x2b3b[_0x4b7b69];return _0x173b4c;};'use strict';var _=require(_0xb2b3('0x0'));var util=require(_0xb2b3('0x1'));var logger=require(_0xb2b3('0x2'))(_0xb2b3('0x3'));var moment=require(_0xb2b3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb2b3('0x5'));var rimraf=require(_0xb2b3('0x6'));var config=require(_0xb2b3('0x7'));var attributes=require(_0xb2b3('0x8'));module[_0xb2b3('0x9')]=function(_0x4d4941,_0x269fab){return _0x4d4941[_0xb2b3('0xa')](_0xb2b3('0xb'),attributes,{'tableName':_0xb2b3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xea4c=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','FaxAccount','fax_accounts','lodash'];(function(_0x45fb40,_0x4ee5b6){var _0x10eae3=function(_0x2f60c8){while(--_0x2f60c8){_0x45fb40['push'](_0x45fb40['shift']());}};_0x10eae3(++_0x4ee5b6);}(_0xea4c,0x113));var _0xcea4=function(_0x1fdfa5,_0x4d1b12){_0x1fdfa5=_0x1fdfa5-0x0;var _0x421776=_0xea4c[_0x1fdfa5];return _0x421776;};'use strict';var _=require(_0xcea4('0x0'));var util=require(_0xcea4('0x1'));var logger=require(_0xcea4('0x2'))('api');var moment=require(_0xcea4('0x3'));var BPromise=require('bluebird');var rp=require(_0xcea4('0x4'));var fs=require('fs');var path=require(_0xcea4('0x5'));var rimraf=require(_0xcea4('0x6'));var config=require(_0xcea4('0x7'));var attributes=require(_0xcea4('0x8'));module[_0xcea4('0x9')]=function(_0x40d9fe,_0x548e95){return _0x40d9fe['define'](_0xcea4('0xa'),attributes,{'tableName':_0xcea4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f083241..a711b2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb299=['register','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxAccount,\x20%s,\x20%s','result','catch','GetFaxAccount','FaxAccount','findAll','options','attributes','include','map','model','NotifyFaxAccount','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','body','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','from','find','account','CmList','List','Contacts','Applications','get','applications','list','orderBy','priority','length','defaults','FaxInteraction','spread','autoclose','push','close','unmanaged','created','interaction','FaxMessage','create','ContactId','AttachmentId','User','name','UserId','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxAccount.socket'];(function(_0x2d2e85,_0x22faa9){var _0x3e9f5e=function(_0x101c22){while(--_0x101c22){_0x2d2e85['push'](_0x2d2e85['shift']());}};_0x3e9f5e(++_0x22faa9);}(_0xb299,0x14d));var _0x9b29=function(_0x12264f,_0x257f83){_0x12264f=_0x12264f-0x0;var _0x143915=_0xb299[_0x12264f];return _0x143915;};'use strict';var _=require(_0x9b29('0x0'));var util=require('util');var moment=require(_0x9b29('0x1'));var BPromise=require(_0x9b29('0x2'));var rs=require(_0x9b29('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9b29('0x4'));var logger=require(_0x9b29('0x5'))(_0x9b29('0x6'));var config=require(_0x9b29('0x7'));var jayson=require(_0x9b29('0x8'));var client=jayson[_0x9b29('0x9')][_0x9b29('0xa')]({'port':0x232c});config['redis']=_['defaults'](config[_0x9b29('0xb')],{'host':_0x9b29('0xc'),'port':0x18eb});var socket=require(_0x9b29('0xd'))(new Redis(config[_0x9b29('0xb')]));require(_0x9b29('0xe'))[_0x9b29('0xf')](socket);function respondWithRpcPromise(_0x5e9891,_0x54119b,_0x31fbe3){return new BPromise(function(_0x3a316c,_0x73cfef){return client['request'](_0x5e9891,_0x31fbe3)[_0x9b29('0x10')](function(_0x2015f7){logger[_0x9b29('0x11')]('FaxAccount,\x20%s,\x20%s',_0x54119b,_0x9b29('0x12'));logger[_0x9b29('0x13')](_0x9b29('0x14'),_0x54119b,_0x9b29('0x12'),JSON[_0x9b29('0x15')](_0x2015f7));if(_0x2015f7[_0x9b29('0x16')]){if(_0x2015f7[_0x9b29('0x16')][_0x9b29('0x17')]===0x1f4){logger[_0x9b29('0x16')]('FaxAccount,\x20%s,\x20%s',_0x54119b,_0x2015f7[_0x9b29('0x16')][_0x9b29('0x18')]);return _0x73cfef(_0x2015f7[_0x9b29('0x16')]['message']);}logger[_0x9b29('0x16')](_0x9b29('0x19'),_0x54119b,_0x2015f7[_0x9b29('0x16')]['message']);return _0x3a316c(_0x2015f7[_0x9b29('0x16')][_0x9b29('0x18')]);}else{logger[_0x9b29('0x11')](_0x9b29('0x19'),_0x54119b,'request\x20sent');_0x3a316c(_0x2015f7[_0x9b29('0x1a')][_0x9b29('0x18')]);}})[_0x9b29('0x1b')](function(_0x4b032b){logger[_0x9b29('0x16')](_0x9b29('0x19'),_0x54119b,_0x4b032b);_0x73cfef(_0x4b032b);});});}exports[_0x9b29('0x1c')]=function(_0x1f562f){var _0x2694e6=this;return new Promise(function(_0x153c29,_0x47fb91){return db[_0x9b29('0x1d')][_0x9b29('0x1e')]({'raw':_0x1f562f[_0x9b29('0x1f')]?_0x1f562f[_0x9b29('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x1f562f[_0x9b29('0x1f')]?_0x1f562f['options']['where']||null:null,'attributes':_0x1f562f[_0x9b29('0x1f')]?_0x1f562f['options'][_0x9b29('0x20')]||null:null,'limit':_0x1f562f[_0x9b29('0x1f')]?_0x1f562f[_0x9b29('0x1f')]['limit']||null:null,'include':_0x1f562f[_0x9b29('0x1f')]?_0x1f562f[_0x9b29('0x1f')][_0x9b29('0x21')]?_[_0x9b29('0x22')](_0x1f562f['options'][_0x9b29('0x21')],function(_0x23cdb4){return{'model':db[_0x23cdb4[_0x9b29('0x23')]],'as':_0x23cdb4['as'],'attributes':_0x23cdb4[_0x9b29('0x20')],'include':_0x23cdb4[_0x9b29('0x21')]?_['map'](_0x23cdb4[_0x9b29('0x21')],function(_0x42a932){return{'model':db[_0x42a932[_0x9b29('0x23')]],'as':_0x42a932['as'],'attributes':_0x42a932[_0x9b29('0x20')],'include':_0x42a932[_0x9b29('0x21')]?_[_0x9b29('0x22')](_0x42a932['include'],function(_0xbff4ed){return{'model':db[_0xbff4ed[_0x9b29('0x23')]],'as':_0xbff4ed['as'],'attributes':_0xbff4ed[_0x9b29('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9b29('0x10')](function(_0x6694c6){logger[_0x9b29('0x11')](_0x9b29('0x1c'),_0x1f562f);logger[_0x9b29('0x13')](_0x9b29('0x1c'),_0x1f562f,JSON[_0x9b29('0x15')](_0x6694c6));_0x153c29(_0x6694c6);})[_0x9b29('0x1b')](function(_0x235d87){logger[_0x9b29('0x16')](_0x9b29('0x1c'),_0x235d87[_0x9b29('0x18')],_0x1f562f);_0x47fb91(_0x2694e6[_0x9b29('0x16')](0x1f4,_0x235d87[_0x9b29('0x18')]));});});};exports[_0x9b29('0x24')]=function(_0x52cf13,_0x2564b2,_0x2ee507){var _0x3e7d98=this;return new Promise(function(_0x2aea7e,_0x4de713){var _0x44bc6b={'body':_0x52cf13['body'],'channel':'fax'};var _0x5d6212=[];var _0x5c93e8=[];var _0x20d6aa={};return db[_0x9b29('0x25')]['describe']()[_0x9b29('0x10')](function(_0x1c3738){if(!_0x1c3738){throw new db[(_0x9b29('0x26'))][(_0x9b29('0x27'))](_0x9b29('0x28'));}_0x5d6212=_[_0x9b29('0x29')](_[_0x9b29('0x2a')](_0x1c3738),[_0x9b29('0x2b'),'updatedAt']);_0x5c93e8=_[_0x9b29('0x29')](_[_0x9b29('0x2a')](_0x1c3738),[_0x9b29('0x2b'),_0x9b29('0x2c'),_0x9b29('0x2d'),_0x9b29('0x2e')]);if(_0x52cf13[_0x9b29('0x2f')]['id']){delete _0x52cf13[_0x9b29('0x2f')]['id'];}if(_[_0x9b29('0x30')](_0x52cf13['body']['from'])){throw new db[(_0x9b29('0x26'))][(_0x9b29('0x27'))]('from\x20is\x20mandatory');}if(_[_0x9b29('0x30')](_0x52cf13[_0x9b29('0x2f')][_0x9b29('0x2f')])||_0x52cf13[_0x9b29('0x2f')][_0x9b29('0x2f')]===''){throw new db[(_0x9b29('0x26'))][(_0x9b29('0x27'))](_0x9b29('0x31'));}if(_[_0x9b29('0x30')](_0x52cf13['body'][_0x9b29('0x32')])){throw new db[(_0x9b29('0x26'))][(_0x9b29('0x27'))](_0x9b29('0x33')+_0x5c93e8);}if(!_['includes'](_0x5c93e8,_0x52cf13['body'][_0x9b29('0x32')])){throw new db['Sequelize'][(_0x9b29('0x27'))](_0x9b29('0x34')+_0x5c93e8);}_0x20d6aa[_0x52cf13['body'][_0x9b29('0x32')]]=_0x52cf13[_0x9b29('0x2f')][_0x9b29('0x35')];})['then'](function(){return db[_0x9b29('0x1d')][_0x9b29('0x36')]({'where':{'id':_0x52cf13[_0x9b29('0x37')]['id']},'include':[{'model':db[_0x9b29('0x38')],'as':_0x9b29('0x39'),'include':[{'model':db['CmContact'],'as':_0x9b29('0x3a'),'where':_0x20d6aa,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['FaxApplication'],'as':_0x9b29('0x3b')}]});})['then'](function(_0x20b1b5){if(_0x20b1b5&&_0x20b1b5[_0x9b29('0x39')]){var _0x21efdf=_0x20b1b5[_0x9b29('0x3c')]({'plain':!![]});_0x44bc6b['account']=_0x21efdf;_0x44bc6b[_0x9b29('0x3d')]=_0x21efdf[_0x9b29('0x3b')];_0x44bc6b[_0x9b29('0x3e')]=_0x21efdf[_0x9b29('0x39')];_0x44bc6b[_0x9b29('0x3d')]=_[_0x9b29('0x3f')](_0x44bc6b[_0x9b29('0x3d')],[_0x9b29('0x40')],['asc']);if(_0x44bc6b[_0x9b29('0x37')][_0x9b29('0x3b')]){delete _0x44bc6b[_0x9b29('0x37')]['Applications'];}if(_0x44bc6b[_0x9b29('0x37')]['List']&&_0x44bc6b[_0x9b29('0x37')][_0x9b29('0x39')][_0x9b29('0x3a')][_0x9b29('0x41')]){return _0x44bc6b[_0x9b29('0x37')][_0x9b29('0x39')][_0x9b29('0x3a')][0x0];}var _0x209a66=_[_0x9b29('0x42')](_0x52cf13[_0x9b29('0x2f')],{'firstName':_0x52cf13[_0x9b29('0x2f')][_0x9b29('0x35')],'ListId':_0x21efdf[_0x9b29('0x2e')]});_0x209a66[_0x52cf13[_0x9b29('0x2f')]['mapKey']]=_0x52cf13[_0x9b29('0x2f')][_0x9b29('0x35')];return db[_0x9b29('0x25')]['create'](_0x209a66,{'fields':_0x5d6212,'raw':!![]});}})['then'](function(_0x64ae06){_0x44bc6b['contact']=_0x64ae06;if(_0x64ae06){var _0x110f40={'ContactId':_0x64ae06['id'],'FaxAccountId':_0x52cf13[_0x9b29('0x37')]['id'],'fax':_0x64ae06['fax']};return db[_0x9b29('0x43')]['find']({'where':{'ContactId':_0x64ae06['id'],'closed':![],'FaxAccountId':_0x52cf13[_0x9b29('0x37')]['id']}})[_0x9b29('0x10')](function(_0x1b7dcb){if(_0x1b7dcb){return[_0x1b7dcb,![]];}return db[_0x9b29('0x43')]['create'](_0x110f40)[_0x9b29('0x10')](function(_0x1a3511){return[_0x1a3511,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x9b29('0x44')](function(_0x49b76a,_0x2789de){var _0x1bad97=_0x49b76a[_0x9b29('0x3c')]({'plain':!![]});if(_0x2789de){if(_0x44bc6b[_0x9b29('0x37')][_0x9b29('0x45')]){_0x44bc6b['applications'][_0x9b29('0x46')]({'id':0x0,'priority':_0x44bc6b[_0x9b29('0x3d')][_0x9b29('0x41')]+0x1,'app':_0x9b29('0x47'),'appdata':_0x9b29('0x48'),'interval':'*,*,*,*'});}_0x1bad97[_0x9b29('0x49')]=!![];}else{_0x1bad97[_0x9b29('0x49')]=![];}_0x44bc6b[_0x9b29('0x4a')]=_0x1bad97;return db[_0x9b29('0x4b')][_0x9b29('0x4c')]({'body':_0x52cf13[_0x9b29('0x2f')]['body'],'FaxAccountId':_0x52cf13[_0x9b29('0x37')]['id'],'FaxInteractionId':_0x49b76a['id'],'direction':'in','ContactId':_0x49b76a[_0x9b29('0x4d')],'AttachmentId':_0x52cf13[_0x9b29('0x2f')][_0x9b29('0x4e')]});})['then'](function(_0x19ab80){_0x44bc6b[_0x9b29('0x18')]=_0x19ab80;if(_0x44bc6b[_0x9b29('0x4a')]['UserId']){return db[_0x9b29('0x4f')]['find']({'attributes':['id',_0x9b29('0x50')],'where':{'id':_0x44bc6b[_0x9b29('0x4a')][_0x9b29('0x51')]}})[_0x9b29('0x10')](function(_0x110c11){if(_0x110c11){_0x44bc6b[_0x9b29('0x3d')]['unshift']({'id':0x0,'priority':0x0,'app':_0x9b29('0x52'),'appdata':_0x110c11[_0x9b29('0x50')]+','+(_0x44bc6b['account'][_0x9b29('0x53')]||0xa),'interval':_0x9b29('0x54')});}return respondWithRpcPromise(_0x9b29('0x55'),_0x9b29('0x56'),_0x44bc6b);});}return respondWithRpcPromise('Start',_0x9b29('0x56'),_0x44bc6b);})[_0x9b29('0x10')](function(_0x2e2f93){_0x2aea7e(_0x2e2f93);})[_0x9b29('0x1b')](function(_0x4d1c69){_0x4de713(_0x3e7d98['error'](0x1f4,_0x4d1c69[_0x9b29('0x18')]));});});};
\ No newline at end of file
+var _0x9b55=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','defaults','redis','socket.io-emitter','./faxAccount.socket','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','body','fax','Sequelize','ValidationError','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','account','CmList','List','CmContact','Contacts','DESC','FaxApplication','Applications','list','applications','orderBy','priority','create','find','Contact\x20not\x20found','autoclose','push','length','close','unmanaged','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','name','unshift','agent','*,*,*,*','Start','startRouting','lodash','util','moment','bluebird'];(function(_0x109d2c,_0xc45b1d){var _0x1a3809=function(_0x4b1cee){while(--_0x4b1cee){_0x109d2c['push'](_0x109d2c['shift']());}};_0x1a3809(++_0xc45b1d);}(_0x9b55,0x158));var _0x59b5=function(_0x468f74,_0x10e053){_0x468f74=_0x468f74-0x0;var _0x49e865=_0x9b55[_0x468f74];return _0x49e865;};'use strict';var _=require(_0x59b5('0x0'));var util=require(_0x59b5('0x1'));var moment=require(_0x59b5('0x2'));var BPromise=require(_0x59b5('0x3'));var rs=require(_0x59b5('0x4'));var fs=require('fs');var Redis=require(_0x59b5('0x5'));var db=require(_0x59b5('0x6'))['db'];var utils=require(_0x59b5('0x7'));var logger=require('../../config/logger')(_0x59b5('0x8'));var config=require('../../config/environment');var jayson=require(_0x59b5('0x9'));var client=jayson['client']['http']({'port':0x232c});config['redis']=_[_0x59b5('0xa')](config[_0x59b5('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x59b5('0xc'))(new Redis(config[_0x59b5('0xb')]));require(_0x59b5('0xd'))['register'](socket);function respondWithRpcPromise(_0x49750f,_0xccaae1,_0x4d631d){return new BPromise(function(_0x3136b2,_0x3b89f4){return client[_0x59b5('0xe')](_0x49750f,_0x4d631d)[_0x59b5('0xf')](function(_0xc38ca7){logger[_0x59b5('0x10')](_0x59b5('0x11'),_0xccaae1,_0x59b5('0x12'));logger['debug'](_0x59b5('0x13'),_0xccaae1,'request\x20sent',JSON['stringify'](_0xc38ca7));if(_0xc38ca7[_0x59b5('0x14')]){if(_0xc38ca7[_0x59b5('0x14')][_0x59b5('0x15')]===0x1f4){logger[_0x59b5('0x14')](_0x59b5('0x11'),_0xccaae1,_0xc38ca7[_0x59b5('0x14')][_0x59b5('0x16')]);return _0x3b89f4(_0xc38ca7['error'][_0x59b5('0x16')]);}logger[_0x59b5('0x14')](_0x59b5('0x11'),_0xccaae1,_0xc38ca7[_0x59b5('0x14')][_0x59b5('0x16')]);return _0x3136b2(_0xc38ca7[_0x59b5('0x14')][_0x59b5('0x16')]);}else{logger[_0x59b5('0x10')](_0x59b5('0x11'),_0xccaae1,_0x59b5('0x12'));_0x3136b2(_0xc38ca7[_0x59b5('0x17')][_0x59b5('0x16')]);}})[_0x59b5('0x18')](function(_0x3c82f7){logger[_0x59b5('0x14')](_0x59b5('0x11'),_0xccaae1,_0x3c82f7);_0x3b89f4(_0x3c82f7);});});}exports[_0x59b5('0x19')]=function(_0x36a54a){var _0x2414f9=this;return new Promise(function(_0x2e2e86,_0x584a1f){return db[_0x59b5('0x1a')][_0x59b5('0x1b')]({'raw':_0x36a54a[_0x59b5('0x1c')]?_0x36a54a[_0x59b5('0x1c')][_0x59b5('0x1d')]===undefined?!![]:![]:!![],'where':_0x36a54a['options']?_0x36a54a['options'][_0x59b5('0x1e')]||null:null,'attributes':_0x36a54a[_0x59b5('0x1c')]?_0x36a54a[_0x59b5('0x1c')][_0x59b5('0x1f')]||null:null,'limit':_0x36a54a[_0x59b5('0x1c')]?_0x36a54a[_0x59b5('0x1c')][_0x59b5('0x20')]||null:null,'include':_0x36a54a[_0x59b5('0x1c')]?_0x36a54a[_0x59b5('0x1c')][_0x59b5('0x21')]?_[_0x59b5('0x22')](_0x36a54a['options']['include'],function(_0x400d06){return{'model':db[_0x400d06[_0x59b5('0x23')]],'as':_0x400d06['as'],'attributes':_0x400d06[_0x59b5('0x1f')],'include':_0x400d06[_0x59b5('0x21')]?_[_0x59b5('0x22')](_0x400d06[_0x59b5('0x21')],function(_0x4303d7){return{'model':db[_0x4303d7[_0x59b5('0x23')]],'as':_0x4303d7['as'],'attributes':_0x4303d7['attributes'],'include':_0x4303d7[_0x59b5('0x21')]?_[_0x59b5('0x22')](_0x4303d7[_0x59b5('0x21')],function(_0x1c88ef){return{'model':db[_0x1c88ef[_0x59b5('0x23')]],'as':_0x1c88ef['as'],'attributes':_0x1c88ef[_0x59b5('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x59b5('0xf')](function(_0x9e981f){logger[_0x59b5('0x10')](_0x59b5('0x19'),_0x36a54a);logger[_0x59b5('0x24')](_0x59b5('0x19'),_0x36a54a,JSON[_0x59b5('0x25')](_0x9e981f));_0x2e2e86(_0x9e981f);})['catch'](function(_0x7028c6){logger[_0x59b5('0x14')]('GetFaxAccount',_0x7028c6[_0x59b5('0x16')],_0x36a54a);_0x584a1f(_0x2414f9[_0x59b5('0x14')](0x1f4,_0x7028c6['message']));});});};exports['NotifyFaxAccount']=function(_0x529b51,_0x279eb4,_0x55ac5e){var _0x138bf4=this;return new Promise(function(_0x3dadc3,_0x166bfd){var _0x7ba7c3={'body':_0x529b51[_0x59b5('0x26')],'channel':_0x59b5('0x27')};var _0x28ed5e=[];var _0x11cb14=[];var _0x175596={};return db['CmContact']['describe']()[_0x59b5('0xf')](function(_0x4850b1){if(!_0x4850b1){throw new db[(_0x59b5('0x28'))][(_0x59b5('0x29'))]('no\x20available\x20attributes');}_0x28ed5e=_[_0x59b5('0x2a')](_[_0x59b5('0x2b')](_0x4850b1),[_0x59b5('0x2c'),'updatedAt']);_0x11cb14=_[_0x59b5('0x2a')](_[_0x59b5('0x2b')](_0x4850b1),[_0x59b5('0x2c'),_0x59b5('0x2d'),_0x59b5('0x2e'),_0x59b5('0x2f')]);if(_0x529b51[_0x59b5('0x26')]['id']){delete _0x529b51[_0x59b5('0x26')]['id'];}if(_[_0x59b5('0x30')](_0x529b51[_0x59b5('0x26')][_0x59b5('0x31')])){throw new db[(_0x59b5('0x28'))][(_0x59b5('0x29'))]('from\x20is\x20mandatory');}if(_[_0x59b5('0x30')](_0x529b51[_0x59b5('0x26')]['body'])||_0x529b51[_0x59b5('0x26')]['body']===''){throw new db[(_0x59b5('0x28'))][(_0x59b5('0x29'))](_0x59b5('0x32'));}if(_[_0x59b5('0x30')](_0x529b51['body']['mapKey'])){throw new db[(_0x59b5('0x28'))][(_0x59b5('0x29'))](_0x59b5('0x33')+_0x11cb14);}if(!_[_0x59b5('0x34')](_0x11cb14,_0x529b51['body'][_0x59b5('0x35')])){throw new db[(_0x59b5('0x28'))][(_0x59b5('0x29'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x11cb14);}_0x175596[_0x529b51[_0x59b5('0x26')]['mapKey']]=_0x529b51[_0x59b5('0x26')][_0x59b5('0x31')];})['then'](function(){return db[_0x59b5('0x1a')]['find']({'where':{'id':_0x529b51[_0x59b5('0x36')]['id']},'include':[{'model':db[_0x59b5('0x37')],'as':_0x59b5('0x38'),'include':[{'model':db[_0x59b5('0x39')],'as':_0x59b5('0x3a'),'where':_0x175596,'limit':0x1,'order':[[_0x59b5('0x2d'),_0x59b5('0x3b')]]}]},{'model':db[_0x59b5('0x3c')],'as':_0x59b5('0x3d')}]});})[_0x59b5('0xf')](function(_0x240bbb){if(_0x240bbb&&_0x240bbb[_0x59b5('0x38')]){var _0x3b7e3b=_0x240bbb['get']({'plain':!![]});_0x7ba7c3['account']=_0x3b7e3b;_0x7ba7c3['applications']=_0x3b7e3b[_0x59b5('0x3d')];_0x7ba7c3[_0x59b5('0x3e')]=_0x3b7e3b[_0x59b5('0x38')];_0x7ba7c3[_0x59b5('0x3f')]=_[_0x59b5('0x40')](_0x7ba7c3[_0x59b5('0x3f')],[_0x59b5('0x41')],['asc']);if(_0x7ba7c3[_0x59b5('0x36')][_0x59b5('0x3d')]){delete _0x7ba7c3[_0x59b5('0x36')][_0x59b5('0x3d')];}if(_0x7ba7c3[_0x59b5('0x36')][_0x59b5('0x38')]&&_0x7ba7c3[_0x59b5('0x36')][_0x59b5('0x38')][_0x59b5('0x3a')]['length']){return _0x7ba7c3[_0x59b5('0x36')][_0x59b5('0x38')][_0x59b5('0x3a')][0x0];}var _0x49bb12=_[_0x59b5('0xa')](_0x529b51[_0x59b5('0x26')],{'firstName':_0x529b51['body'][_0x59b5('0x31')],'ListId':_0x3b7e3b[_0x59b5('0x2f')]});_0x49bb12[_0x529b51[_0x59b5('0x26')][_0x59b5('0x35')]]=_0x529b51[_0x59b5('0x26')][_0x59b5('0x31')];return db[_0x59b5('0x39')][_0x59b5('0x42')](_0x49bb12,{'fields':_0x28ed5e,'raw':!![]});}})['then'](function(_0x2d6e0b){_0x7ba7c3['contact']=_0x2d6e0b;if(_0x2d6e0b){var _0x5762d9={'ContactId':_0x2d6e0b['id'],'FaxAccountId':_0x529b51[_0x59b5('0x36')]['id'],'fax':_0x2d6e0b[_0x59b5('0x27')]};return db['FaxInteraction'][_0x59b5('0x43')]({'where':{'ContactId':_0x2d6e0b['id'],'closed':![],'FaxAccountId':_0x529b51['account']['id']}})[_0x59b5('0xf')](function(_0x40f868){if(_0x40f868){return[_0x40f868,![]];}return db['FaxInteraction']['create'](_0x5762d9)[_0x59b5('0xf')](function(_0x4f66dc){return[_0x4f66dc,!![]];});});}else{throw new Error(_0x59b5('0x44'));}})['spread'](function(_0x4fd70c,_0x33ef2d){var _0x52703c=_0x4fd70c['get']({'plain':!![]});if(_0x33ef2d){if(_0x7ba7c3['account'][_0x59b5('0x45')]){_0x7ba7c3[_0x59b5('0x3f')][_0x59b5('0x46')]({'id':0x0,'priority':_0x7ba7c3[_0x59b5('0x3f')][_0x59b5('0x47')]+0x1,'app':_0x59b5('0x48'),'appdata':_0x59b5('0x49'),'interval':'*,*,*,*'});}_0x52703c[_0x59b5('0x4a')]=!![];}else{_0x52703c['created']=![];}_0x7ba7c3[_0x59b5('0x4b')]=_0x52703c;return db[_0x59b5('0x4c')][_0x59b5('0x42')]({'body':_0x529b51[_0x59b5('0x26')][_0x59b5('0x26')],'FaxAccountId':_0x529b51[_0x59b5('0x36')]['id'],'FaxInteractionId':_0x4fd70c['id'],'direction':'in','ContactId':_0x4fd70c[_0x59b5('0x4d')],'AttachmentId':_0x529b51[_0x59b5('0x26')][_0x59b5('0x4e')]});})['then'](function(_0xb8b93e){_0x7ba7c3[_0x59b5('0x16')]=_0xb8b93e;if(_0x7ba7c3['interaction'][_0x59b5('0x4f')]){return db[_0x59b5('0x50')][_0x59b5('0x43')]({'attributes':['id',_0x59b5('0x51')],'where':{'id':_0x7ba7c3[_0x59b5('0x4b')]['UserId']}})[_0x59b5('0xf')](function(_0x301af7){if(_0x301af7){_0x7ba7c3[_0x59b5('0x3f')][_0x59b5('0x52')]({'id':0x0,'priority':0x0,'app':_0x59b5('0x53'),'appdata':_0x301af7['name']+','+(_0x7ba7c3[_0x59b5('0x36')]['waitForTheAssignedAgent']||0xa),'interval':_0x59b5('0x54')});}return respondWithRpcPromise(_0x59b5('0x55'),_0x59b5('0x56'),_0x7ba7c3);});}return respondWithRpcPromise(_0x59b5('0x55'),_0x59b5('0x56'),_0x7ba7c3);})[_0x59b5('0xf')](function(_0x101c4e){_0x3dadc3(_0x101c4e);})[_0x59b5('0x18')](function(_0x3a3479){_0x166bfd(_0x138bf4[_0x59b5('0x14')](0x1f4,_0x3a3479[_0x59b5('0x16')]));});});};
\ No newline at end of file
index cbbf8dd..5ca85df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b93=['save','remove','emit','removeListener','register','length','faxAccount:','./faxAccount.events'];(function(_0x4521c2,_0x7360ee){var _0x120e1f=function(_0x3546e2){while(--_0x3546e2){_0x4521c2['push'](_0x4521c2['shift']());}};_0x120e1f(++_0x7360ee);}(_0x6b93,0xf7));var _0x36b9=function(_0x1c8418,_0x593434){_0x1c8418=_0x1c8418-0x0;var _0x301619=_0x6b93[_0x1c8418];return _0x301619;};'use strict';var FaxAccountEvents=require(_0x36b9('0x0'));var events=[_0x36b9('0x1'),_0x36b9('0x2'),'update'];function createListener(_0x1157ff,_0x5c2bee){return function(_0x4e0a99){_0x5c2bee[_0x36b9('0x3')](_0x1157ff,_0x4e0a99);};}function removeListener(_0x22db78,_0x3e9ae6){return function(){FaxAccountEvents[_0x36b9('0x4')](_0x22db78,_0x3e9ae6);};}exports[_0x36b9('0x5')]=function(_0x37f76d){for(var _0x170bd1=0x0,_0x2a654f=events[_0x36b9('0x6')];_0x170bd1<_0x2a654f;_0x170bd1++){var _0x5d78a4=events[_0x170bd1];var _0x150985=createListener(_0x36b9('0x7')+_0x5d78a4,_0x37f76d);FaxAccountEvents['on'](_0x5d78a4,_0x150985);}};
\ No newline at end of file
+var _0x7df6=['update','emit','register','length','faxAccount:','./faxAccount.events','remove'];(function(_0x1139a9,_0xde5006){var _0x6482d9=function(_0x570a84){while(--_0x570a84){_0x1139a9['push'](_0x1139a9['shift']());}};_0x6482d9(++_0xde5006);}(_0x7df6,0x17f));var _0x67df=function(_0x43dc7e,_0x49a390){_0x43dc7e=_0x43dc7e-0x0;var _0x21e12d=_0x7df6[_0x43dc7e];return _0x21e12d;};'use strict';var FaxAccountEvents=require(_0x67df('0x0'));var events=['save',_0x67df('0x1'),_0x67df('0x2')];function createListener(_0x51dd1b,_0x3a5e18){return function(_0xdbd98d){_0x3a5e18[_0x67df('0x3')](_0x51dd1b,_0xdbd98d);};}function removeListener(_0x2a2718,_0x475c6d){return function(){FaxAccountEvents['removeListener'](_0x2a2718,_0x475c6d);};}exports[_0x67df('0x4')]=function(_0x532d14){for(var _0xf5bd7c=0x0,_0xa00478=events[_0x67df('0x5')];_0xf5bd7c<_0xa00478;_0xf5bd7c++){var _0x2acfaa=events[_0xf5bd7c];var _0x978370=createListener(_0x67df('0x6')+_0x2acfaa,_0x532d14);FaxAccountEvents['on'](_0x2acfaa,_0x978370);}};
\ No newline at end of file
index 1fb6b7b..bd36bdf 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(_0x3512c3,_0x346843){var _0x3b2842=function(_0x49341b){while(--_0x49341b){_0x3512c3['push'](_0x3512c3['shift']());}};_0x3b2842(++_0x346843);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0x18fd4b,_0x475e2e){var _0xe5d6b4=function(_0x591c9b){while(--_0x591c9b){_0x18fd4b['push'](_0x18fd4b['shift']());}};_0xe5d6b4(++_0x475e2e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 5369d22..e8914ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3756=['STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x15d58c,_0x3054f3){var _0x2637fd=function(_0xb4b472){while(--_0xb4b472){_0x15d58c['push'](_0x15d58c['shift']());}};_0x2637fd(++_0x3054f3);}(_0x3756,0x112));var _0x6375=function(_0x5e3420,_0x4e3e54){_0x5e3420=_0x5e3420-0x0;var _0x30bb53=_0x3756[_0x5e3420];return _0x30bb53;};'use strict';var Sequelize=require(_0x6375('0x0'));module[_0x6375('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x6375('0x2')],'allowNull':![],'defaultValue':_0x6375('0x3')},'appdata':{'type':Sequelize[_0x6375('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x6375('0x2')],'defaultValue':_0x6375('0x5')}};
\ No newline at end of file
+var _0x546a=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x159464,_0x78b0c3){var _0x3100d5=function(_0x2f4637){while(--_0x2f4637){_0x159464['push'](_0x159464['shift']());}};_0x3100d5(++_0x78b0c3);}(_0x546a,0x1bc));var _0xa546=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x546a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa546('0x0'));module[_0xa546('0x1')]={'priority':{'type':Sequelize[_0xa546('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xa546('0x3')],'allowNull':![],'defaultValue':_0xa546('0x4')},'appdata':{'type':Sequelize[_0xa546('0x5')]()},'description':{'type':Sequelize[_0xa546('0x3')]},'interval':{'type':Sequelize[_0xa546('0x3')],'defaultValue':_0xa546('0x6')}};
\ No newline at end of file
index c8c01f3..a4c7dad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc75=['stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','FaxApplication','findAll','rows','catch','show','keys','includeAll','find','create','body','destroy','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','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/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','then','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcc75,0xfe));var _0x5cc7=function(_0x40f4b0,_0x31b96a){_0x40f4b0=_0x40f4b0-0x0;var _0x2294ba=_0xcc75[_0x40f4b0];return _0x2294ba;};'use strict';var emlformat=require(_0x5cc7('0x0'));var rimraf=require(_0x5cc7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5cc7('0x2'));var moment=require(_0x5cc7('0x3'));var BPromise=require(_0x5cc7('0x4'));var Mustache=require(_0x5cc7('0x5'));var util=require('util');var path=require(_0x5cc7('0x6'));var sox=require(_0x5cc7('0x7'));var csv=require(_0x5cc7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5cc7('0x9'));var _=require('lodash');var squel=require(_0x5cc7('0xa'));var crypto=require(_0x5cc7('0xb'));var jsforce=require(_0x5cc7('0xc'));var deskjs=require(_0x5cc7('0xd'));var toCsv=require(_0x5cc7('0x8'));var querystring=require(_0x5cc7('0xe'));var Papa=require(_0x5cc7('0xf'));var Redis=require(_0x5cc7('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5cc7('0x11'));var as=require(_0x5cc7('0x12'));var hardwareService=require(_0x5cc7('0x13'));var logger=require(_0x5cc7('0x14'))(_0x5cc7('0x15'));var utils=require(_0x5cc7('0x16'));var config=require(_0x5cc7('0x17'));var licenseUtil=require(_0x5cc7('0x18'));var db=require(_0x5cc7('0x19'))['db'];function respondWithStatusCode(_0x3bbb76,_0x55c415){_0x55c415=_0x55c415||0xcc;return function(_0x12eb05){if(_0x12eb05){return _0x3bbb76['sendStatus'](_0x55c415);}return _0x3bbb76[_0x5cc7('0x1a')](_0x55c415)[_0x5cc7('0x1b')]();};}function respondWithResult(_0x2fd1a0,_0x44bc0b){_0x44bc0b=_0x44bc0b||0xc8;return function(_0x45ecae){if(_0x45ecae){return _0x2fd1a0['status'](_0x44bc0b)['json'](_0x45ecae);}};}function respondWithFilteredResult(_0x29aa84,_0x36aa55){return function(_0x1d0268){if(_0x1d0268){var _0x1ccb2d=typeof _0x36aa55[_0x5cc7('0x1c')]===_0x5cc7('0x1d')&&typeof _0x36aa55[_0x5cc7('0x1e')]===_0x5cc7('0x1d');var _0x19b816=_0x1d0268['count'];var _0x2ea75f=_0x1ccb2d?0x0:_0x36aa55[_0x5cc7('0x1c')];var _0x398efd=_0x1ccb2d?_0x1d0268[_0x5cc7('0x1f')]:_0x36aa55['offset']+_0x36aa55[_0x5cc7('0x1e')];var _0x55758f;if(_0x398efd>=_0x19b816){_0x398efd=_0x19b816;_0x55758f=0xc8;}else{_0x55758f=0xce;}_0x29aa84[_0x5cc7('0x1a')](_0x55758f);return _0x29aa84[_0x5cc7('0x20')](_0x5cc7('0x21'),_0x2ea75f+'-'+_0x398efd+'/'+_0x19b816)[_0x5cc7('0x22')](_0x1d0268);}return null;};}function patchUpdates(_0x59b72e){return function(_0x39965c){try{jsonpatch[_0x5cc7('0x23')](_0x39965c,_0x59b72e,!![]);}catch(_0x48b622){return BPromise['reject'](_0x48b622);}return _0x39965c['save']();};}function saveUpdates(_0x3ec316,_0x5f32c6){return function(_0x20b06d){if(_0x20b06d){return _0x20b06d['update'](_0x3ec316)[_0x5cc7('0x24')](function(_0x3e9e4a){return _0x3e9e4a;});}return null;};}function removeEntity(_0x346db8,_0x10010d){return function(_0x3d0fb3){if(_0x3d0fb3){return _0x3d0fb3['destroy']()['then'](function(){_0x346db8[_0x5cc7('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d415c,_0x195e86){return function(_0x1cd0a8){if(!_0x1cd0a8){_0x3d415c['sendStatus'](0x194);}return _0x1cd0a8;};}function handleError(_0x3a89a9,_0x48b8fd){_0x48b8fd=_0x48b8fd||0x1f4;return function(_0x2ce27e){logger[_0x5cc7('0x25')](_0x2ce27e[_0x5cc7('0x26')]);if(_0x2ce27e[_0x5cc7('0x27')]){delete _0x2ce27e['name'];}_0x3a89a9['status'](_0x48b8fd)[_0x5cc7('0x28')](_0x2ce27e);};}exports[_0x5cc7('0x29')]=function(_0x3066a9,_0x16c267){var _0x5b68bd={},_0x39200f={},_0x9f3a77={'count':0x0,'rows':[]};var _0x32f86f=_[_0x5cc7('0x2a')](db['FaxApplication'][_0x5cc7('0x2b')],function(_0x5b6398){return{'name':_0x5b6398[_0x5cc7('0x2c')],'type':_0x5b6398[_0x5cc7('0x2d')][_0x5cc7('0x2e')]};});_0x39200f[_0x5cc7('0x2f')]=_[_0x5cc7('0x2a')](_0x32f86f,_0x5cc7('0x27'));_0x39200f['query']=_['keys'](_0x3066a9[_0x5cc7('0x30')]);_0x39200f[_0x5cc7('0x31')]=_['intersection'](_0x39200f[_0x5cc7('0x2f')],_0x39200f[_0x5cc7('0x30')]);_0x5b68bd[_0x5cc7('0x32')]=_[_0x5cc7('0x33')](_0x39200f[_0x5cc7('0x2f')],qs['fields'](_0x3066a9[_0x5cc7('0x30')][_0x5cc7('0x34')]));_0x5b68bd['attributes']=_0x5b68bd[_0x5cc7('0x32')][_0x5cc7('0x35')]?_0x5b68bd[_0x5cc7('0x32')]:_0x39200f[_0x5cc7('0x2f')];if(!_0x3066a9[_0x5cc7('0x30')][_0x5cc7('0x36')]('nolimit')){_0x5b68bd[_0x5cc7('0x1e')]=qs['limit'](_0x3066a9['query'][_0x5cc7('0x1e')]);_0x5b68bd[_0x5cc7('0x1c')]=qs['offset'](_0x3066a9[_0x5cc7('0x30')][_0x5cc7('0x1c')]);}_0x5b68bd[_0x5cc7('0x37')]=qs[_0x5cc7('0x38')](_0x3066a9[_0x5cc7('0x30')]['sort']);_0x5b68bd['where']=qs['filters'](_['pick'](_0x3066a9['query'],_0x39200f['filters']),_0x32f86f);if(_0x3066a9[_0x5cc7('0x30')][_0x5cc7('0x39')]){_0x5b68bd[_0x5cc7('0x3a')]=_[_0x5cc7('0x3b')](_0x5b68bd['where'],{'$or':_[_0x5cc7('0x2a')](_0x32f86f,function(_0x1d62b1){if(_0x1d62b1['type']!==_0x5cc7('0x3c')){var _0x229e14={};_0x229e14[_0x1d62b1['name']]={'$like':'%'+_0x3066a9[_0x5cc7('0x30')][_0x5cc7('0x39')]+'%'};return _0x229e14;}})});}_0x5b68bd=_[_0x5cc7('0x3b')]({},_0x5b68bd,_0x3066a9[_0x5cc7('0x3d')]);var _0x57aaf7={'where':_0x5b68bd['where']};return db['FaxApplication'][_0x5cc7('0x1f')](_0x57aaf7)[_0x5cc7('0x24')](function(_0x379b6d){_0x9f3a77[_0x5cc7('0x1f')]=_0x379b6d;if(_0x3066a9[_0x5cc7('0x30')]['includeAll']){_0x5b68bd['include']=[{'all':!![]}];}return db[_0x5cc7('0x3e')][_0x5cc7('0x3f')](_0x5b68bd);})['then'](function(_0x48bd62){_0x9f3a77[_0x5cc7('0x40')]=_0x48bd62;return _0x9f3a77;})[_0x5cc7('0x24')](respondWithFilteredResult(_0x16c267,_0x5b68bd))[_0x5cc7('0x41')](handleError(_0x16c267,null));};exports[_0x5cc7('0x42')]=function(_0x5a430c,_0x423bf4){var _0x46dc47={'raw':!![],'where':{'id':_0x5a430c['params']['id']}},_0x4f63bf={};_0x4f63bf[_0x5cc7('0x2f')]=_[_0x5cc7('0x43')](db['FaxApplication']['rawAttributes']);_0x4f63bf[_0x5cc7('0x30')]=_[_0x5cc7('0x43')](_0x5a430c[_0x5cc7('0x30')]);_0x4f63bf[_0x5cc7('0x31')]=_['intersection'](_0x4f63bf['model'],_0x4f63bf[_0x5cc7('0x30')]);_0x46dc47[_0x5cc7('0x32')]=_[_0x5cc7('0x33')](_0x4f63bf[_0x5cc7('0x2f')],qs['fields'](_0x5a430c['query'][_0x5cc7('0x34')]));_0x46dc47[_0x5cc7('0x32')]=_0x46dc47[_0x5cc7('0x32')][_0x5cc7('0x35')]?_0x46dc47[_0x5cc7('0x32')]:_0x4f63bf['model'];if(_0x5a430c[_0x5cc7('0x30')][_0x5cc7('0x44')]){_0x46dc47['include']=[{'all':!![]}];}_0x46dc47=_[_0x5cc7('0x3b')]({},_0x46dc47,_0x5a430c[_0x5cc7('0x3d')]);return db[_0x5cc7('0x3e')][_0x5cc7('0x45')](_0x46dc47)[_0x5cc7('0x24')](handleEntityNotFound(_0x423bf4,null))[_0x5cc7('0x24')](respondWithResult(_0x423bf4,null))[_0x5cc7('0x41')](handleError(_0x423bf4,null));};exports['create']=function(_0x52037a,_0x56e36e){return db['FaxApplication'][_0x5cc7('0x46')](_0x52037a[_0x5cc7('0x47')],{})[_0x5cc7('0x24')](respondWithResult(_0x56e36e,0xc9))[_0x5cc7('0x41')](handleError(_0x56e36e,null));};exports['update']=function(_0x625507,_0x2163c2){if(_0x625507[_0x5cc7('0x47')]['id']){delete _0x625507[_0x5cc7('0x47')]['id'];}return db['FaxApplication']['find']({'where':{'id':_0x625507['params']['id']}})['then'](handleEntityNotFound(_0x2163c2,null))[_0x5cc7('0x24')](saveUpdates(_0x625507['body'],null))['then'](respondWithResult(_0x2163c2,null))[_0x5cc7('0x41')](handleError(_0x2163c2,null));};exports[_0x5cc7('0x48')]=function(_0x217728,_0x44680f){return db['FaxApplication'][_0x5cc7('0x45')]({'where':{'id':_0x217728['params']['id']}})[_0x5cc7('0x24')](handleEntityNotFound(_0x44680f,null))[_0x5cc7('0x24')](removeEntity(_0x44680f,null))[_0x5cc7('0x41')](handleError(_0x44680f,null));};
\ No newline at end of file
+var _0xc1ca=['squel','crypto','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','undefined','offset','set','apply','reject','save','then','error','name','send','index','FaxApplication','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','update','body','destroy','eml-format','zip-dir','request-promise','moment','bluebird','path','ejs','fs-extra','lodash'];(function(_0x575bb9,_0x1562ef){var _0x5e086f=function(_0xec0349){while(--_0xec0349){_0x575bb9['push'](_0x575bb9['shift']());}};_0x5e086f(++_0x1562ef);}(_0xc1ca,0x8f));var _0xac1c=function(_0x3e0f57,_0x7aceb7){_0x3e0f57=_0x3e0f57-0x0;var _0xf9f971=_0xc1ca[_0x3e0f57];return _0xf9f971;};'use strict';var emlformat=require(_0xac1c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xac1c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xac1c('0x2'));var moment=require(_0xac1c('0x3'));var BPromise=require(_0xac1c('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xac1c('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xac1c('0x6'));var fs=require('fs');var fs_extra=require(_0xac1c('0x7'));var _=require(_0xac1c('0x8'));var squel=require(_0xac1c('0x9'));var crypto=require(_0xac1c('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac1c('0xb'));var querystring=require(_0xac1c('0xc'));var Papa=require(_0xac1c('0xd'));var Redis=require(_0xac1c('0xe'));var authService=require(_0xac1c('0xf'));var qs=require(_0xac1c('0x10'));var as=require(_0xac1c('0x11'));var hardwareService=require(_0xac1c('0x12'));var logger=require(_0xac1c('0x13'))(_0xac1c('0x14'));var utils=require(_0xac1c('0x15'));var config=require(_0xac1c('0x16'));var licenseUtil=require(_0xac1c('0x17'));var db=require(_0xac1c('0x18'))['db'];function respondWithStatusCode(_0x3ee5d7,_0x27649b){_0x27649b=_0x27649b||0xcc;return function(_0x2be837){if(_0x2be837){return _0x3ee5d7[_0xac1c('0x19')](_0x27649b);}return _0x3ee5d7[_0xac1c('0x1a')](_0x27649b)[_0xac1c('0x1b')]();};}function respondWithResult(_0x19bda1,_0xa22723){_0xa22723=_0xa22723||0xc8;return function(_0x4658f8){if(_0x4658f8){return _0x19bda1['status'](_0xa22723)['json'](_0x4658f8);}};}function respondWithFilteredResult(_0x535445,_0xfd4b63){return function(_0x3e9d4c){if(_0x3e9d4c){var _0x9c5b7a=typeof _0xfd4b63['offset']===_0xac1c('0x1c')&&typeof _0xfd4b63['limit']==='undefined';var _0x3389a4=_0x3e9d4c['count'];var _0x5e90bc=_0x9c5b7a?0x0:_0xfd4b63[_0xac1c('0x1d')];var _0x306717=_0x9c5b7a?_0x3e9d4c['count']:_0xfd4b63['offset']+_0xfd4b63['limit'];var _0x347817;if(_0x306717>=_0x3389a4){_0x306717=_0x3389a4;_0x347817=0xc8;}else{_0x347817=0xce;}_0x535445['status'](_0x347817);return _0x535445[_0xac1c('0x1e')]('Content-Range',_0x5e90bc+'-'+_0x306717+'/'+_0x3389a4)['json'](_0x3e9d4c);}return null;};}function patchUpdates(_0x11ae9e){return function(_0x59bcc8){try{jsonpatch[_0xac1c('0x1f')](_0x59bcc8,_0x11ae9e,!![]);}catch(_0x5ceb21){return BPromise[_0xac1c('0x20')](_0x5ceb21);}return _0x59bcc8[_0xac1c('0x21')]();};}function saveUpdates(_0x50146a,_0x17da5e){return function(_0x2bbcf5){if(_0x2bbcf5){return _0x2bbcf5['update'](_0x50146a)[_0xac1c('0x22')](function(_0x46962d){return _0x46962d;});}return null;};}function removeEntity(_0x1e729a,_0x28bab7){return function(_0x2c56f4){if(_0x2c56f4){return _0x2c56f4['destroy']()[_0xac1c('0x22')](function(){_0x1e729a[_0xac1c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51e16d,_0x1d7c58){return function(_0x4e722c){if(!_0x4e722c){_0x51e16d[_0xac1c('0x19')](0x194);}return _0x4e722c;};}function handleError(_0x164799,_0x4b1941){_0x4b1941=_0x4b1941||0x1f4;return function(_0x27271e){logger[_0xac1c('0x23')](_0x27271e['stack']);if(_0x27271e[_0xac1c('0x24')]){delete _0x27271e[_0xac1c('0x24')];}_0x164799['status'](_0x4b1941)[_0xac1c('0x25')](_0x27271e);};}exports[_0xac1c('0x26')]=function(_0x1f2e54,_0x5553e8){var _0x29a9ed={},_0x219796={},_0x43009b={'count':0x0,'rows':[]};var _0x29da15=_['map'](db[_0xac1c('0x27')]['rawAttributes'],function(_0x5f5ef8){return{'name':_0x5f5ef8[_0xac1c('0x28')],'type':_0x5f5ef8[_0xac1c('0x29')]['key']};});_0x219796[_0xac1c('0x2a')]=_['map'](_0x29da15,'name');_0x219796[_0xac1c('0x2b')]=_[_0xac1c('0x2c')](_0x1f2e54['query']);_0x219796[_0xac1c('0x2d')]=_['intersection'](_0x219796[_0xac1c('0x2a')],_0x219796['query']);_0x29a9ed[_0xac1c('0x2e')]=_[_0xac1c('0x2f')](_0x219796['model'],qs[_0xac1c('0x30')](_0x1f2e54[_0xac1c('0x2b')]['fields']));_0x29a9ed[_0xac1c('0x2e')]=_0x29a9ed[_0xac1c('0x2e')][_0xac1c('0x31')]?_0x29a9ed[_0xac1c('0x2e')]:_0x219796['model'];if(!_0x1f2e54[_0xac1c('0x2b')][_0xac1c('0x32')](_0xac1c('0x33'))){_0x29a9ed['limit']=qs[_0xac1c('0x34')](_0x1f2e54[_0xac1c('0x2b')][_0xac1c('0x34')]);_0x29a9ed[_0xac1c('0x1d')]=qs[_0xac1c('0x1d')](_0x1f2e54['query'][_0xac1c('0x1d')]);}_0x29a9ed[_0xac1c('0x35')]=qs[_0xac1c('0x36')](_0x1f2e54[_0xac1c('0x2b')]['sort']);_0x29a9ed[_0xac1c('0x37')]=qs[_0xac1c('0x2d')](_[_0xac1c('0x38')](_0x1f2e54[_0xac1c('0x2b')],_0x219796[_0xac1c('0x2d')]),_0x29da15);if(_0x1f2e54['query'][_0xac1c('0x39')]){_0x29a9ed[_0xac1c('0x37')]=_[_0xac1c('0x3a')](_0x29a9ed[_0xac1c('0x37')],{'$or':_[_0xac1c('0x3b')](_0x29da15,function(_0x41cbab){if(_0x41cbab[_0xac1c('0x29')]!==_0xac1c('0x3c')){var _0x4b5f9a={};_0x4b5f9a[_0x41cbab[_0xac1c('0x24')]]={'$like':'%'+_0x1f2e54[_0xac1c('0x2b')]['filter']+'%'};return _0x4b5f9a;}})});}_0x29a9ed=_['merge']({},_0x29a9ed,_0x1f2e54[_0xac1c('0x3d')]);var _0x1d5926={'where':_0x29a9ed[_0xac1c('0x37')]};return db[_0xac1c('0x27')][_0xac1c('0x3e')](_0x1d5926)[_0xac1c('0x22')](function(_0x42f338){_0x43009b[_0xac1c('0x3e')]=_0x42f338;if(_0x1f2e54['query'][_0xac1c('0x3f')]){_0x29a9ed[_0xac1c('0x40')]=[{'all':!![]}];}return db[_0xac1c('0x27')][_0xac1c('0x41')](_0x29a9ed);})['then'](function(_0x41e331){_0x43009b[_0xac1c('0x42')]=_0x41e331;return _0x43009b;})[_0xac1c('0x22')](respondWithFilteredResult(_0x5553e8,_0x29a9ed))[_0xac1c('0x43')](handleError(_0x5553e8,null));};exports[_0xac1c('0x44')]=function(_0xe9d3a8,_0x4da822){var _0x471e1d={'raw':!![],'where':{'id':_0xe9d3a8[_0xac1c('0x45')]['id']}},_0x244d0c={};_0x244d0c[_0xac1c('0x2a')]=_[_0xac1c('0x2c')](db[_0xac1c('0x27')][_0xac1c('0x46')]);_0x244d0c[_0xac1c('0x2b')]=_[_0xac1c('0x2c')](_0xe9d3a8[_0xac1c('0x2b')]);_0x244d0c[_0xac1c('0x2d')]=_['intersection'](_0x244d0c['model'],_0x244d0c[_0xac1c('0x2b')]);_0x471e1d[_0xac1c('0x2e')]=_[_0xac1c('0x2f')](_0x244d0c[_0xac1c('0x2a')],qs[_0xac1c('0x30')](_0xe9d3a8[_0xac1c('0x2b')][_0xac1c('0x30')]));_0x471e1d[_0xac1c('0x2e')]=_0x471e1d[_0xac1c('0x2e')][_0xac1c('0x31')]?_0x471e1d['attributes']:_0x244d0c[_0xac1c('0x2a')];if(_0xe9d3a8[_0xac1c('0x2b')][_0xac1c('0x3f')]){_0x471e1d['include']=[{'all':!![]}];}_0x471e1d=_[_0xac1c('0x3a')]({},_0x471e1d,_0xe9d3a8[_0xac1c('0x3d')]);return db[_0xac1c('0x27')][_0xac1c('0x47')](_0x471e1d)[_0xac1c('0x22')](handleEntityNotFound(_0x4da822,null))['then'](respondWithResult(_0x4da822,null))[_0xac1c('0x43')](handleError(_0x4da822,null));};exports[_0xac1c('0x48')]=function(_0x53a54a,_0x389838){return db[_0xac1c('0x27')][_0xac1c('0x48')](_0x53a54a['body'],{})[_0xac1c('0x22')](respondWithResult(_0x389838,0xc9))['catch'](handleError(_0x389838,null));};exports[_0xac1c('0x49')]=function(_0xb8ce6e,_0x53913b){if(_0xb8ce6e[_0xac1c('0x4a')]['id']){delete _0xb8ce6e[_0xac1c('0x4a')]['id'];}return db[_0xac1c('0x27')]['find']({'where':{'id':_0xb8ce6e['params']['id']}})[_0xac1c('0x22')](handleEntityNotFound(_0x53913b,null))[_0xac1c('0x22')](saveUpdates(_0xb8ce6e['body'],null))['then'](respondWithResult(_0x53913b,null))['catch'](handleError(_0x53913b,null));};exports[_0xac1c('0x4b')]=function(_0x4b68cc,_0x317a9e){return db[_0xac1c('0x27')][_0xac1c('0x47')]({'where':{'id':_0x4b68cc[_0xac1c('0x45')]['id']}})[_0xac1c('0x22')](handleEntityNotFound(_0x317a9e,null))['then'](removeEntity(_0x317a9e,null))['catch'](handleError(_0x317a9e,null));};
\ No newline at end of file
index 5cb39e4..8618a6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb67=['path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise'];(function(_0x1bdfea,_0x7c6945){var _0x2fe457=function(_0x2e801d){while(--_0x2e801d){_0x1bdfea['push'](_0x1bdfea['shift']());}};_0x2fe457(++_0x7c6945);}(_0xdb67,0x73));var _0x7db6=function(_0x63cf67,_0x1d6f39){_0x63cf67=_0x63cf67-0x0;var _0x38e135=_0xdb67[_0x63cf67];return _0x38e135;};'use strict';var _=require(_0x7db6('0x0'));var util=require(_0x7db6('0x1'));var logger=require('../../config/logger')(_0x7db6('0x2'));var moment=require('moment');var BPromise=require(_0x7db6('0x3'));var rp=require(_0x7db6('0x4'));var fs=require('fs');var path=require(_0x7db6('0x5'));var rimraf=require(_0x7db6('0x6'));var config=require(_0x7db6('0x7'));var attributes=require(_0x7db6('0x8'));module[_0x7db6('0x9')]=function(_0x13db9e,_0x128554){return _0x13db9e[_0x7db6('0xa')](_0x7db6('0xb'),attributes,{'tableName':_0x7db6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7db6('0xd'),'collate':_0x7db6('0xe')});};
\ No newline at end of file
+var _0xd2ab=['request-promise','rimraf','./faxApplication.attributes','exports','FaxApplication','lodash','../../config/logger','moment','bluebird'];(function(_0x3241e0,_0x5f3409){var _0x4361f7=function(_0x1d1d06){while(--_0x1d1d06){_0x3241e0['push'](_0x3241e0['shift']());}};_0x4361f7(++_0x5f3409);}(_0xd2ab,0x7a));var _0xbd2a=function(_0x3acb84,_0x5cead1){_0x3acb84=_0x3acb84-0x0;var _0x5d071b=_0xd2ab[_0x3acb84];return _0x5d071b;};'use strict';var _=require(_0xbd2a('0x0'));var util=require('util');var logger=require(_0xbd2a('0x1'))('api');var moment=require(_0xbd2a('0x2'));var BPromise=require(_0xbd2a('0x3'));var rp=require(_0xbd2a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbd2a('0x5'));var config=require('../../config/environment');var attributes=require(_0xbd2a('0x6'));module[_0xbd2a('0x7')]=function(_0x4df7ec,_0x45ec73){return _0x4df7ec['define'](_0xbd2a('0x8'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 70b2384..04f37cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x015d=['debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateFaxApplication','FaxApplication','update','options','where','attributes','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x261522,_0x1adc1f){var _0x98a25a=function(_0x1b0f9c){while(--_0x1b0f9c){_0x261522['push'](_0x261522['shift']());}};_0x98a25a(++_0x1adc1f);}(_0x015d,0xd2));var _0xd015=function(_0x2ac71a,_0x1d2a02){_0x2ac71a=_0x2ac71a-0x0;var _0x3ee904=_0x015d[_0x2ac71a];return _0x3ee904;};'use strict';var _=require(_0xd015('0x0'));var util=require(_0xd015('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd015('0x2'));var db=require(_0xd015('0x3'))['db'];var utils=require(_0xd015('0x4'));var logger=require(_0xd015('0x5'))(_0xd015('0x6'));var config=require(_0xd015('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd015('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bf4e5,_0x372066,_0x1b4ccf){return new BPromise(function(_0x36f494,_0x185df6){return client[_0xd015('0x9')](_0x1bf4e5,_0x1b4ccf)[_0xd015('0xa')](function(_0x5bf501){logger[_0xd015('0xb')](_0xd015('0xc'),_0x372066,_0xd015('0xd'));logger[_0xd015('0xe')](_0xd015('0xf'),_0x372066,_0xd015('0xd'),JSON[_0xd015('0x10')](_0x5bf501));if(_0x5bf501[_0xd015('0x11')]){if(_0x5bf501['error'][_0xd015('0x12')]===0x1f4){logger[_0xd015('0x11')]('FaxApplication,\x20%s,\x20%s',_0x372066,_0x5bf501[_0xd015('0x11')][_0xd015('0x13')]);return _0x185df6(_0x5bf501[_0xd015('0x11')]['message']);}logger[_0xd015('0x11')](_0xd015('0xc'),_0x372066,_0x5bf501[_0xd015('0x11')][_0xd015('0x13')]);return _0x36f494(_0x5bf501[_0xd015('0x11')][_0xd015('0x13')]);}else{logger[_0xd015('0xb')](_0xd015('0xc'),_0x372066,_0xd015('0xd'));_0x36f494(_0x5bf501[_0xd015('0x14')]['message']);}})['catch'](function(_0xdb2ce){logger['error'](_0xd015('0xc'),_0x372066,_0xdb2ce);_0x185df6(_0xdb2ce);});});}exports[_0xd015('0x15')]=function(_0x356dfe){var _0x4367e6=this;return new Promise(function(_0x1725c7,_0x2df0e1){return db[_0xd015('0x16')][_0xd015('0x17')](_0x356dfe['body'],{'raw':_0x356dfe[_0xd015('0x18')]?_0x356dfe['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x356dfe[_0xd015('0x18')]?_0x356dfe[_0xd015('0x18')][_0xd015('0x19')]||null:null,'attributes':_0x356dfe['options']?_0x356dfe['options'][_0xd015('0x1a')]||null:null,'limit':_0x356dfe[_0xd015('0x18')]?_0x356dfe[_0xd015('0x18')]['limit']||null:null})['then'](function(_0x4edd7a){logger[_0xd015('0xb')]('UpdateFaxApplication',_0x356dfe);logger[_0xd015('0xe')](_0xd015('0x15'),_0x356dfe,JSON[_0xd015('0x10')](_0x4edd7a));_0x1725c7(_0x4edd7a);})[_0xd015('0x1b')](function(_0x1f1ec6){logger['error'](_0xd015('0x15'),_0x1f1ec6[_0xd015('0x13')],_0x356dfe);_0x2df0e1(_0x4367e6[_0xd015('0x11')](0x1f4,_0x1f1ec6[_0xd015('0x13')]));});});};
\ No newline at end of file
+var _0xf41a=['client','http','request','info','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','attributes','limit','then','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x20446d,_0x196b02){var _0x3b126d=function(_0x38b2c7){while(--_0x38b2c7){_0x20446d['push'](_0x20446d['shift']());}};_0x3b126d(++_0x196b02);}(_0xf41a,0xd2));var _0xaf41=function(_0x213b74,_0x46786a){_0x213b74=_0x213b74-0x0;var _0x31a624=_0xf41a[_0x213b74];return _0x31a624;};'use strict';var _=require(_0xaf41('0x0'));var util=require(_0xaf41('0x1'));var moment=require(_0xaf41('0x2'));var BPromise=require(_0xaf41('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf41('0x4'));var db=require(_0xaf41('0x5'))['db'];var utils=require(_0xaf41('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaf41('0x7')][_0xaf41('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a9b4f,_0x3f0e14,_0x3ffdf9){return new BPromise(function(_0x3321c5,_0x19512b){return client[_0xaf41('0x9')](_0x2a9b4f,_0x3ffdf9)['then'](function(_0x33cffc){logger[_0xaf41('0xa')](_0xaf41('0xb'),_0x3f0e14,'request\x20sent');logger[_0xaf41('0xc')](_0xaf41('0xd'),_0x3f0e14,_0xaf41('0xe'),JSON[_0xaf41('0xf')](_0x33cffc));if(_0x33cffc[_0xaf41('0x10')]){if(_0x33cffc['error'][_0xaf41('0x11')]===0x1f4){logger['error'](_0xaf41('0xb'),_0x3f0e14,_0x33cffc[_0xaf41('0x10')][_0xaf41('0x12')]);return _0x19512b(_0x33cffc[_0xaf41('0x10')][_0xaf41('0x12')]);}logger[_0xaf41('0x10')](_0xaf41('0xb'),_0x3f0e14,_0x33cffc['error'][_0xaf41('0x12')]);return _0x3321c5(_0x33cffc[_0xaf41('0x10')][_0xaf41('0x12')]);}else{logger[_0xaf41('0xa')](_0xaf41('0xb'),_0x3f0e14,_0xaf41('0xe'));_0x3321c5(_0x33cffc[_0xaf41('0x13')][_0xaf41('0x12')]);}})['catch'](function(_0x50d73b){logger['error'](_0xaf41('0xb'),_0x3f0e14,_0x50d73b);_0x19512b(_0x50d73b);});});}exports[_0xaf41('0x14')]=function(_0xe4a23b){var _0x37abec=this;return new Promise(function(_0x118e39,_0x567df2){return db[_0xaf41('0x15')][_0xaf41('0x16')](_0xe4a23b[_0xaf41('0x17')],{'raw':_0xe4a23b[_0xaf41('0x18')]?_0xe4a23b['options'][_0xaf41('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe4a23b[_0xaf41('0x18')]?_0xe4a23b['options'][_0xaf41('0x1a')]||null:null,'attributes':_0xe4a23b[_0xaf41('0x18')]?_0xe4a23b[_0xaf41('0x18')][_0xaf41('0x1b')]||null:null,'limit':_0xe4a23b[_0xaf41('0x18')]?_0xe4a23b[_0xaf41('0x18')][_0xaf41('0x1c')]||null:null})[_0xaf41('0x1d')](function(_0x50e642){logger[_0xaf41('0xa')](_0xaf41('0x14'),_0xe4a23b);logger['debug'](_0xaf41('0x14'),_0xe4a23b,JSON['stringify'](_0x50e642));_0x118e39(_0x50e642);})[_0xaf41('0x1e')](function(_0x27371c){logger[_0xaf41('0x10')](_0xaf41('0x14'),_0x27371c[_0xaf41('0x12')],_0xe4a23b);_0x567df2(_0x37abec[_0xaf41('0x10')](0x1f4,_0x27371c[_0xaf41('0x12')]));});});};
\ No newline at end of file
index 8ad4cb6..a8ea866 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa571=['index','/:id','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated'];(function(_0x422525,_0x32fb15){var _0x5eeaca=function(_0x3516e3){while(--_0x3516e3){_0x422525['push'](_0x422525['shift']());}};_0x5eeaca(++_0x32fb15);}(_0xa571,0x107));var _0x1a57=function(_0x27a611,_0xe00621){_0x27a611=_0x27a611-0x0;var _0x39c5de=_0xa571[_0x27a611];return _0x39c5de;};'use strict';var multer=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var path=require(_0x1a57('0x2'));var timeout=require(_0x1a57('0x3'));var express=require('express');var router=express[_0x1a57('0x4')]();var fs_extra=require(_0x1a57('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1a57('0x6'));var controller=require('./faxApplication.controller');router[_0x1a57('0x7')]('/',auth[_0x1a57('0x8')](),controller[_0x1a57('0x9')]);router[_0x1a57('0x7')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller['show']);router[_0x1a57('0xb')]('/',auth[_0x1a57('0x8')](),controller[_0x1a57('0xc')]);router['put'](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xd')]);router[_0x1a57('0xe')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xf')]);module[_0x1a57('0x10')]=router;
\ No newline at end of file
+var _0xda2d=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./faxApplication.controller','get'];(function(_0x5257b7,_0x4f42d6){var _0x5a8139=function(_0x4adfe2){while(--_0x4adfe2){_0x5257b7['push'](_0x5257b7['shift']());}};_0x5a8139(++_0x4f42d6);}(_0xda2d,0x102));var _0xdda2=function(_0x4d3c03,_0x4ba6ec){_0x4d3c03=_0x4d3c03-0x0;var _0x5b9e22=_0xda2d[_0x4d3c03];return _0x5b9e22;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0xc')]('/',auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xf')]);router[_0xdda2('0x10')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x11')]);module[_0xdda2('0x12')]=router;
\ No newline at end of file
index 3e9509a..9aaa7b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7a1=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x52090d,_0x50b912){var _0x3233e4=function(_0x51a153){while(--_0x51a153){_0x52090d['push'](_0x52090d['shift']());}};_0x3233e4(++_0x50b912);}(_0xb7a1,0xe6));var _0x1b7a=function(_0x258d0f,_0x233084){_0x258d0f=_0x258d0f-0x0;var _0x44fc94=_0xb7a1[_0x258d0f];return _0x44fc94;};'use strict';var Sequelize=require(_0x1b7a('0x0'));module[_0x1b7a('0x1')]={'closed':{'type':Sequelize[_0x1b7a('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1b7a('0x3')]},'disposition':{'type':Sequelize[_0x1b7a('0x4')]},'secondDisposition':{'type':Sequelize[_0x1b7a('0x4')]},'thirdDisposition':{'type':Sequelize[_0x1b7a('0x4')]},'note':{'type':Sequelize[_0x1b7a('0x4')]},'read1stAt':{'type':Sequelize[_0x1b7a('0x3')]},'fax':{'type':Sequelize[_0x1b7a('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x1b7a('0x5')]('in',_0x1b7a('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1b7a('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0x12c1=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x37ee6f,_0x49d769){var _0x3db325=function(_0xda9717){while(--_0xda9717){_0x37ee6f['push'](_0x37ee6f['shift']());}};_0x3db325(++_0x49d769);}(_0x12c1,0x9c));var _0x112c=function(_0x2bf7fa,_0x178079){_0x2bf7fa=_0x2bf7fa-0x0;var _0x5ce982=_0x12c1[_0x2bf7fa];return _0x5ce982;};'use strict';var Sequelize=require(_0x112c('0x0'));module[_0x112c('0x1')]={'closed':{'type':Sequelize[_0x112c('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x112c('0x3')]},'disposition':{'type':Sequelize[_0x112c('0x4')]},'secondDisposition':{'type':Sequelize[_0x112c('0x4')]},'thirdDisposition':{'type':Sequelize[_0x112c('0x4')]},'note':{'type':Sequelize[_0x112c('0x4')]},'read1stAt':{'type':Sequelize[_0x112c('0x3')]},'fax':{'type':Sequelize[_0x112c('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x112c('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x112c('0x5')]('in','out'),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index 72c0f2a..f4766ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6ac=['map','fullname','TagIds','Tags','split','forEach','push','catch','FaxInteraction','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20>\x200','Contact','operator','$substring','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','UserId','buildExpression','keys','compact','isEmpty','i.FaxAccountId\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','isArray','tag','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','t.id\x20IN\x20?','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','sequelize','merge','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','contactName','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.fax','Contact.fax','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','toString','groupBy','rows','show','includeAll','include','options','create','body','params','destroy','describe','addMessage','FaxMessage','ids','getMessages','findOne','FaxInteractionId','filter','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','omit','spread','emit','faxInteractionTags:save','removeTags','unix','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','existsSync','createReadStream','pipe','resolve','download','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','json','limit','undefined','offset','count','set','Content-Range','apply','save','update','then','end','stack','name','Users'];(function(_0x2b71e0,_0x313267){var _0x36ca99=function(_0x3bf6ee){while(--_0x3bf6ee){_0x2b71e0['push'](_0x2b71e0['shift']());}};_0x36ca99(++_0x313267);}(_0xe6ac,0xad));var _0xce6a=function(_0x4404ff,_0x13d7a9){_0x4404ff=_0x4404ff-0x0;var _0x5e7b19=_0xe6ac[_0x4404ff];return _0x5e7b19;};'use strict';var emlformat=require(_0xce6a('0x0'));var rimraf=require(_0xce6a('0x1'));var zipdir=require(_0xce6a('0x2'));var jsonpatch=require(_0xce6a('0x3'));var rp=require(_0xce6a('0x4'));var moment=require(_0xce6a('0x5'));var BPromise=require(_0xce6a('0x6'));var Mustache=require(_0xce6a('0x7'));var util=require(_0xce6a('0x8'));var path=require(_0xce6a('0x9'));var sox=require('sox');var csv=require(_0xce6a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xce6a('0xb'));var squel=require(_0xce6a('0xc'));var crypto=require(_0xce6a('0xd'));var jsforce=require(_0xce6a('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xce6a('0xf'));var Papa=require('papaparse');var Redis=require(_0xce6a('0x10'));var authService=require(_0xce6a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xce6a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xce6a('0x13'));var config=require(_0xce6a('0x14'));var licenseUtil=require(_0xce6a('0x15'));var db=require(_0xce6a('0x16'))['db'];config[_0xce6a('0x17')]=_[_0xce6a('0x18')](config[_0xce6a('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xce6a('0x19'))(new Redis(config[_0xce6a('0x17')]));require('./faxInteraction.socket')[_0xce6a('0x1a')](socket);function respondWithStatusCode(_0x3dc1da,_0x4ff403){_0x4ff403=_0x4ff403||0xcc;return function(_0xbbf06d){if(_0xbbf06d){return _0x3dc1da[_0xce6a('0x1b')](_0x4ff403);}return _0x3dc1da['status'](_0x4ff403)['end']();};}function respondWithResult(_0x45d368,_0x450609){_0x450609=_0x450609||0xc8;return function(_0x22cf85){if(_0x22cf85){return _0x45d368[_0xce6a('0x1c')](_0x450609)[_0xce6a('0x1d')](_0x22cf85);}};}function respondWithFilteredResult(_0x46d5ee,_0x44e583){return function(_0x591f74){if(_0x591f74){var _0x166d7f=typeof _0x44e583['offset']==='undefined'&&typeof _0x44e583[_0xce6a('0x1e')]===_0xce6a('0x1f');var _0x53ee1a=_0x591f74['count'];var _0x427ed5=_0x166d7f?0x0:_0x44e583[_0xce6a('0x20')];var _0x3f9a1e=_0x166d7f?_0x591f74[_0xce6a('0x21')]:_0x44e583['offset']+_0x44e583[_0xce6a('0x1e')];var _0x39813b;if(_0x3f9a1e>=_0x53ee1a){_0x3f9a1e=_0x53ee1a;_0x39813b=0xc8;}else{_0x39813b=0xce;}_0x46d5ee[_0xce6a('0x1c')](_0x39813b);return _0x46d5ee[_0xce6a('0x22')](_0xce6a('0x23'),_0x427ed5+'-'+_0x3f9a1e+'/'+_0x53ee1a)[_0xce6a('0x1d')](_0x591f74);}return null;};}function patchUpdates(_0x238f67){return function(_0xb98252){try{jsonpatch[_0xce6a('0x24')](_0xb98252,_0x238f67,!![]);}catch(_0x34e8bb){return BPromise['reject'](_0x34e8bb);}return _0xb98252[_0xce6a('0x25')]();};}function saveUpdates(_0x23cd82,_0xcfac82){return function(_0x163e7f){if(_0x163e7f){return _0x163e7f[_0xce6a('0x26')](_0x23cd82)[_0xce6a('0x27')](function(_0x488e4f){return _0x488e4f;});}return null;};}function removeEntity(_0x38e109,_0x3cc933){return function(_0x4705fd){if(_0x4705fd){return _0x4705fd['destroy']()[_0xce6a('0x27')](function(){_0x38e109[_0xce6a('0x1c')](0xcc)[_0xce6a('0x28')]();});}};}function handleEntityNotFound(_0x50b7ae,_0x53e66a){return function(_0x4792c7){if(!_0x4792c7){_0x50b7ae[_0xce6a('0x1b')](0x194);}return _0x4792c7;};}function handleError(_0x5970b3,_0x1b7a84){_0x1b7a84=_0x1b7a84||0x1f4;return function(_0x47c4ea){logger['error'](_0x47c4ea[_0xce6a('0x29')]);if(_0x47c4ea[_0xce6a('0x2a')]){delete _0x47c4ea[_0xce6a('0x2a')];}_0x5970b3[_0xce6a('0x1c')](_0x1b7a84)['send'](_0x47c4ea);};}function getInteractionUsers(_0x1ad956,_0x50e6ef){return new BPromise(function(_0x35ff7e,_0x4d24dd){try{if(_0x50e6ef[_0x1ad956['id']]){_0x1ad956[_0xce6a('0x2b')]=_[_0xce6a('0x2c')](_0x50e6ef[_0x1ad956['id']],function(_0x2a6f57){return{'id':_0x2a6f57['id'],'fullname':_0x2a6f57[_0xce6a('0x2d')]};});}}catch(_0x3fba32){_0x4d24dd(_0x3fba32);}_0x35ff7e(_0x1ad956);});}function getInteractionTags(_0x436e83,_0x36b436){return new BPromise(function(_0x3c5f8d,_0x21c8f1){try{if(_0x436e83[_0xce6a('0x2e')]){_0x436e83[_0xce6a('0x2f')]=[];_0x436e83[_0xce6a('0x2e')][_0xce6a('0x30')](',')[_0xce6a('0x31')](function(_0x274b58){_0x436e83['Tags'][_0xce6a('0x32')](_0x36b436[_0x274b58]);});}delete _0x436e83[_0xce6a('0x2e')];}catch(_0x2bf09f){_0x21c8f1(_0x2bf09f);}_0x3c5f8d(_0x436e83);});}function updateFaxInteraction(_0x348791,_0x3c09f1,_0x577efe){return new BPromise(function(_0x5819a8,_0x42f88e){return getInteractionUsers(_0x348791,_0x577efe)[_0xce6a('0x27')](function(_0x257a30){return getInteractionTags(_0x257a30,_0x3c09f1);})[_0xce6a('0x27')](function(_0x3d9d9c){_0x5819a8(_0x3d9d9c);})[_0xce6a('0x33')](function(_0x165811){_0x42f88e(_0x165811);});});}exports['index']=function(_0x5de566,_0xca1221){var _0x2548e3={},_0x5b44cb={},_0x2c4fb5={'count':0x0,'rows':[]};var _0x4ac409=_[_0xce6a('0x2c')](db[_0xce6a('0x34')][_0xce6a('0x35')],function(_0x2a31f5){return{'name':_0x2a31f5[_0xce6a('0x36')],'type':_0x2a31f5[_0xce6a('0x37')][_0xce6a('0x38')]};});_0x5b44cb[_0xce6a('0x39')]=_['map'](_0x4ac409,_0xce6a('0x2a'));_0x5b44cb['query']=_['keys'](_0x5de566[_0xce6a('0x3a')]);_0x5b44cb[_0xce6a('0x3b')]=_['intersection'](_0x5b44cb[_0xce6a('0x39')],_0x5b44cb[_0xce6a('0x3a')]);_0x2548e3['attributes']=_[_0xce6a('0x3c')](_0x5b44cb[_0xce6a('0x39')],qs[_0xce6a('0x3d')](_0x5de566[_0xce6a('0x3a')][_0xce6a('0x3d')]));_0x2548e3[_0xce6a('0x3e')]=_0x2548e3[_0xce6a('0x3e')][_0xce6a('0x3f')]?_0x2548e3[_0xce6a('0x3e')]:_0x5b44cb[_0xce6a('0x39')];if(!_0x5de566[_0xce6a('0x3a')][_0xce6a('0x40')](_0xce6a('0x41'))){_0x2548e3[_0xce6a('0x1e')]=qs[_0xce6a('0x1e')](_0x5de566['query']['limit']);_0x2548e3[_0xce6a('0x20')]=qs['offset'](_0x5de566[_0xce6a('0x3a')][_0xce6a('0x20')]);}_0x2548e3['order']=qs['sort'](_0x5de566['query'][_0xce6a('0x42')]);_0x2548e3[_0xce6a('0x43')]=qs['filters'](_[_0xce6a('0x44')](_0x5de566[_0xce6a('0x3a')],_0x5b44cb[_0xce6a('0x3b')]),_0x4ac409);var _0x31e996=[];var _0x5e92ee=squel[_0xce6a('0x45')]()[_0xce6a('0x46')]('id')[_0xce6a('0x46')]('name')['field'](_0xce6a('0x47'))[_0xce6a('0x48')](_0xce6a('0x49'));var _0x54fa55=squel[_0xce6a('0x45')]()[_0xce6a('0x46')]('u.id')[_0xce6a('0x46')](_0xce6a('0x4a'))['field'](_0xce6a('0x4b'))[_0xce6a('0x48')](_0xce6a('0x4c'),'ui')[_0xce6a('0x4d')](_0xce6a('0x4e'),'u',_0xce6a('0x4f'));var _0x45bbd9=squel[_0xce6a('0x45')]()[_0xce6a('0x48')](_0xce6a('0x50'),'i')[_0xce6a('0x4d')](_0xce6a('0x51'),'c',_0xce6a('0x52'))[_0xce6a('0x4d')](_0xce6a('0x4e'),'o',_0xce6a('0x53'))[_0xce6a('0x4d')](_0xce6a('0x54'),'a',_0xce6a('0x55'))[_0xce6a('0x4d')](_0xce6a('0x56'),'me',_0xce6a('0x57'))[_0xce6a('0x4d')](_0xce6a('0x58'),'it',_0xce6a('0x59'))[_0xce6a('0x4d')]('tools_tags','t',_0xce6a('0x5a'));var _0x36c463=squel[_0xce6a('0x5b')]();var _0x318fd1=[];var _0x5eec13=squel[_0xce6a('0x5b')]();var _0x1ab43a;if(_0x5de566[_0xce6a('0x3a')][_0xce6a('0x5c')]){_0x1ab43a=as[_0xce6a('0x5d')](_0x5de566[_0xce6a('0x3a')][_0xce6a('0x5c')]);var _0x5757a9=_0x1ab43a[_0xce6a('0x5e')];for(var _0x1bc244=0x0;_0x1bc244<_0x1ab43a[_0xce6a('0x5f')][_0xce6a('0x3f')];_0x1bc244++){var _0x112833=_0x1ab43a[_0xce6a('0x5f')][_0x1bc244];var _0x4f5179='i';var _0x450148=_[_0xce6a('0x60')](_0x4ac409,['name',_0x112833['field']]);if(!_0x450148){switch(_0x112833[_0xce6a('0x46')]){case _0xce6a('0x61'):if(_0x112833['value']==0x1){_0x45bbd9[_0xce6a('0x62')]('`'+_0x112833[_0xce6a('0x46')]+'`\x20=\x200');}else{_0x45bbd9[_0xce6a('0x62')]('`'+_0x112833['field']+_0xce6a('0x63'));}break;case _0xce6a('0x64'):if(_0x112833[_0xce6a('0x65')]===_0xce6a('0x66')){if(_0x112833[_0xce6a('0x67')][_0xce6a('0x30')]('\x20')[_0xce6a('0x3f')]>0x1){_0x36c463[_0x5757a9]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xce6a('0x68')](_0x112833[_0xce6a('0x67')]),null);}else{var _0x1cef6c='%'+_0x112833[_0xce6a('0x67')]+'%';_0x36c463[_0x5757a9](_0xce6a('0x69'),_0x1cef6c,_0x1cef6c,_0x1cef6c);}}else{_0x450148=_[_0xce6a('0x60')](_0x4ac409,[_0xce6a('0x2a'),_0xce6a('0x6a')]);_0x112833['field']=_0xce6a('0x6a');_0x3ecdad=as['buildExpression'](_0x4f5179,_0x450148[_0xce6a('0x37')],_0x112833);_0x36c463[_0x5757a9](_0x3ecdad[_0xce6a('0x6b')],_0x3ecdad[_0xce6a('0x67')][_0xce6a('0x6c')],_0x3ecdad[_0xce6a('0x67')][_0xce6a('0x28')]);}break;case _0xce6a('0x6d'):var _0x320adc=_0x112833[_0xce6a('0x67')][_0xce6a('0x30')](',')['map'](function(_0x49e5ee){return Number(_0x49e5ee);});_0x320adc[_0xce6a('0x31')](function(_0x561fd1){_0x5eec13['or'](_0xce6a('0x6e'),'%,'+_0x561fd1+',%');});_0x318fd1=_['union'](_0x318fd1,_0x320adc);break;case _0xce6a('0x6f'):if(_0x112833[_0xce6a('0x65')]===_0xce6a('0x66')){_0x36c463[_0x5757a9]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x112833['value']+'%',null);}else{_0x450148=_[_0xce6a('0x60')](_0x4ac409,[_0xce6a('0x2a'),_0xce6a('0x70')]);_0x112833[_0xce6a('0x46')]=_0xce6a('0x70');_0x3ecdad=as[_0xce6a('0x71')](_0x4f5179,_0x450148['type'],_0x112833);_0x36c463[_0x5757a9](_0x3ecdad['text'],_0x3ecdad[_0xce6a('0x67')][_0xce6a('0x6c')],_0x3ecdad[_0xce6a('0x67')]['end']);}break;case'body':_0x3ecdad=as[_0xce6a('0x71')]('me',null,_0x112833);_0x36c463[_0x5757a9](_0x3ecdad[_0xce6a('0x6b')],_0x3ecdad[_0xce6a('0x67')][_0xce6a('0x6c')],_0x3ecdad['value']['end']);break;}}else{var _0x3ecdad=as[_0xce6a('0x71')](_0x4f5179,_0x450148[_0xce6a('0x37')],_0x112833);_0x36c463[_0x5757a9](_0x3ecdad[_0xce6a('0x6b')],_0x3ecdad[_0xce6a('0x67')][_0xce6a('0x6c')],_0x3ecdad['value'][_0xce6a('0x28')]);}}}else{var _0x93625a=_(_0x5de566[_0xce6a('0x3a')])[_0xce6a('0x72')]()[_0xce6a('0x2c')](function(_0x38b235){return _['some'](_0x4ac409,['name',_0x38b235])?_0x38b235:undefined;})[_0xce6a('0x73')]()[_0xce6a('0x67')]();if(!_[_0xce6a('0x74')](_0x93625a)){_0x93625a[_0xce6a('0x31')](function(_0x51a2c1){if(_0x51a2c1==='FaxAccountId'){_0x45bbd9['where'](_0xce6a('0x75'),[][_0xce6a('0x76')](_0x5de566['query'][_0x51a2c1]));}else if(_0x51a2c1===_0xce6a('0x77')){var _0x82466e=JSON[_0xce6a('0x78')](_0x5de566['query'][_0x51a2c1])[_0xce6a('0x79')];var _0x3a7e34=JSON[_0xce6a('0x78')](_0x5de566[_0xce6a('0x3a')][_0x51a2c1])[_0xce6a('0x7a')];_0x45bbd9[_0xce6a('0x43')](_0xce6a('0x7b'),_0x82466e,_0x3a7e34);}else{if(_0x5de566['query'][_0x51a2c1]===_0xce6a('0x7c')){_0x45bbd9[_0xce6a('0x43')]('i.'+_0x51a2c1+_0xce6a('0x7d'));}else{_0x45bbd9[_0xce6a('0x43')]('i.'+_0x51a2c1+_0xce6a('0x7e'),_0x5de566['query'][_0x51a2c1]);}}});}if(_0x5de566[_0xce6a('0x3a')][_0xce6a('0x7f')]){if(_0x5de566['query'][_0xce6a('0x7f')]==0x1){_0x45bbd9['having'](_0xce6a('0x80'));}else{_0x45bbd9[_0xce6a('0x62')](_0xce6a('0x81'));}}if(_0x5de566[_0xce6a('0x3a')]['tag']){_0x318fd1=_[_0xce6a('0x82')](_0x5de566['query']['tag'])?_0x5de566[_0xce6a('0x3a')][_0xce6a('0x83')]:new Array(_0x5de566['query'][_0xce6a('0x83')]);_0x318fd1[_0xce6a('0x31')](function(_0x1308c0){_0x5eec13['or'](_0xce6a('0x6e'),'%,'+_0x1308c0+',%');});}if(_0x5de566[_0xce6a('0x3a')]['filter']){var _0x27e8c6=_0x5de566[_0xce6a('0x3a')]['filter']['replace']('\x5c','\x5c\x5c')[_0xce6a('0x84')](/'/g,'\x27\x27');if(qs[_0xce6a('0x85')](_0x27e8c6)){_0x36c463['or'](_0xce6a('0x86'),_0x27e8c6+'%')['or'](_0xce6a('0x87'),_0x27e8c6+'%');}_0x36c463['or'](_0xce6a('0x88'),_0x27e8c6+'%');}}_0x45bbd9[_0xce6a('0x43')](_0x36c463);_0x45bbd9[_0xce6a('0x89')](_0xce6a('0x8a'));var _0x2958f7={'type':db['Sequelize'][_0xce6a('0x8b')][_0xce6a('0x8c')],'raw':!![]};var _0x524971=_0x45bbd9[_0xce6a('0x8d')]();_0x524971[_0xce6a('0x46')](_0xce6a('0x8a'));_0x524971[_0xce6a('0x46')](_0xce6a('0x8e'),_0xce6a('0x61'));if(_0x2548e3[_0xce6a('0x8f')]){_0x2548e3[_0xce6a('0x8f')][_0xce6a('0x31')](function(_0x2207c8){var _0x4bc354=_0x2207c8[0x0]==='contactName'?_0x2207c8[0x0]:'i.'+_0x2207c8[0x0];_0x45bbd9['order'](_0x4bc354,_0x2207c8[0x1]==='DESC'?![]:!![]);});}if(!_[_0xce6a('0x74')](_0x318fd1)){_0x45bbd9[_0xce6a('0x62')](_0x5eec13);_0x524971[_0xce6a('0x43')](_0xce6a('0x90'),_0x318fd1);}BPromise['resolve']()[_0xce6a('0x27')](function(){if(!_0x1ab43a){if(_0x5de566[_0xce6a('0x3a')][_0xce6a('0x91')])return;_0x524971['where'](_0xce6a('0x92'));_0x45bbd9[_0xce6a('0x43')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x5de566[_0xce6a('0x93')][_0xce6a('0x94')]!==_0xce6a('0x95'))return;return _0x5de566[_0xce6a('0x93')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0xce6a('0x27')](function(_0x443dd4){if(_[_0xce6a('0x74')](_0x443dd4)){_0x524971[_0xce6a('0x43')]('i.FaxAccountId\x20IS\x20NULL');_0x45bbd9[_0xce6a('0x43')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x524971[_0xce6a('0x43')](_0xce6a('0x75'),_['map'](_0x443dd4,'id'));_0x45bbd9[_0xce6a('0x43')](_0xce6a('0x75'),_[_0xce6a('0x2c')](_0x443dd4,'id'));}});})[_0xce6a('0x27')](function(){if(_0x5de566[_0xce6a('0x93')][_0xce6a('0x94')]===_0xce6a('0x95')&&!_0x1ab43a&&!_0x5de566[_0xce6a('0x3a')][_0xce6a('0x91')])return[];return db[_0xce6a('0x96')][_0xce6a('0x3a')](_0x524971['toString'](),_0x2958f7);})['then'](function(_0x1dc630){_0x2c4fb5['count']=_0x1dc630[_0xce6a('0x3f')];if(_0x2c4fb5[_0xce6a('0x21')]===0x0)return[];return db[_0xce6a('0x96')][_0xce6a('0x3a')](_0x5e92ee['toString'](),_0x2958f7)[_0xce6a('0x27')](function(_0x285a0c){_0x31e996=_['keyBy'](_0x285a0c,'id');_0x2958f7=_[_0xce6a('0x97')](_0x2958f7,{'model':db[_0xce6a('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5de566[_0xce6a('0x3a')][_0xce6a('0x3d')]){_0x2548e3[_0xce6a('0x3e')]['forEach'](function(_0x158e41){_0x45bbd9[_0xce6a('0x46')]('i.'+_0x158e41);});}else{_0x45bbd9[_0xce6a('0x46')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xce6a('0x61'));_0x45bbd9[_0xce6a('0x46')]('a.key',_0xce6a('0x98'));_0x45bbd9[_0xce6a('0x46')](_0xce6a('0x99'),'Account.mandatoryDisposition');_0x45bbd9['field'](_0xce6a('0x9a'),_0xce6a('0x9b'));_0x45bbd9[_0xce6a('0x46')]('i.*');_0x45bbd9['field'](_0xce6a('0x9c'),_0xce6a('0x9d'));_0x45bbd9[_0xce6a('0x46')](_0xce6a('0x9e'),'Contact.lastName');_0x45bbd9[_0xce6a('0x46')](_0xce6a('0x9f'),_0xce6a('0xa0'));_0x45bbd9[_0xce6a('0x46')](_0xce6a('0xa1'),_0xce6a('0xa2'));_0x45bbd9[_0xce6a('0x46')]('c.mobile','Contact.mobile');_0x45bbd9['field'](_0xce6a('0xa3'),_0xce6a('0xa4'));_0x45bbd9[_0xce6a('0x46')](_0xce6a('0xa5'),'Owner.fullname');_0x45bbd9[_0xce6a('0x46')]('o.internal',_0xce6a('0xa6'));_0x45bbd9[_0xce6a('0x46')](_0xce6a('0xa7'),_0xce6a('0x2e'));}if(_0x2548e3[_0xce6a('0x1e')])_0x45bbd9[_0xce6a('0x1e')](_0x2548e3[_0xce6a('0x1e')]);if(_0x2548e3[_0xce6a('0x20')])_0x45bbd9[_0xce6a('0x20')](_0x2548e3[_0xce6a('0x20')]);return db[_0xce6a('0x96')]['query'](_0x45bbd9['toString'](),_0x2958f7);})[_0xce6a('0x27')](function(_0x914b43){if(_0x914b43['length']>0x0)_0x54fa55[_0xce6a('0x43')](_0xce6a('0xa8'),_[_0xce6a('0x2c')](_0x914b43,'id'));return db[_0xce6a('0x96')][_0xce6a('0x3a')](_0x54fa55[_0xce6a('0xa9')](),_0x2958f7)[_0xce6a('0x27')](function(_0x284e8f){var _0xe5a3ff=_[_0xce6a('0xaa')](_0x284e8f,'FaxInteractionId');var _0x237025=[];_0x914b43[_0xce6a('0x31')](function(_0x19fdcc){_0x237025['push'](updateFaxInteraction(_0x19fdcc,_0x31e996,_0xe5a3ff));});return BPromise['all'](_0x237025);});});})[_0xce6a('0x27')](function(_0x45a8e6){_0x2c4fb5[_0xce6a('0xab')]=_0x45a8e6;return _0x2c4fb5;})['then'](respondWithFilteredResult(_0xca1221,_0x2548e3))['catch'](handleError(_0xca1221,null));};exports[_0xce6a('0xac')]=function(_0x19595c,_0x4a3bff){var _0x4fe3bf={'raw':![],'where':{'id':_0x19595c['params']['id']}},_0x4bd9b8={};_0x4bd9b8[_0xce6a('0x39')]=_[_0xce6a('0x72')](db[_0xce6a('0x34')][_0xce6a('0x35')]);_0x4bd9b8['query']=_['keys'](_0x19595c[_0xce6a('0x3a')]);_0x4bd9b8[_0xce6a('0x3b')]=_[_0xce6a('0x3c')](_0x4bd9b8[_0xce6a('0x39')],_0x4bd9b8[_0xce6a('0x3a')]);_0x4fe3bf[_0xce6a('0x3e')]=_[_0xce6a('0x3c')](_0x4bd9b8['model'],qs[_0xce6a('0x3d')](_0x19595c[_0xce6a('0x3a')][_0xce6a('0x3d')]));_0x4fe3bf['attributes']=_0x4fe3bf[_0xce6a('0x3e')]['length']?_0x4fe3bf['attributes']:_0x4bd9b8[_0xce6a('0x39')];if(_0x19595c[_0xce6a('0x3a')][_0xce6a('0xad')]){_0x4fe3bf[_0xce6a('0xae')]=[{'all':!![]}];}_0x4fe3bf=_[_0xce6a('0x97')]({},_0x4fe3bf,_0x19595c[_0xce6a('0xaf')]);return db[_0xce6a('0x34')]['find'](_0x4fe3bf)['then'](handleEntityNotFound(_0x4a3bff,null))[_0xce6a('0x27')](respondWithResult(_0x4a3bff,null))['catch'](handleError(_0x4a3bff,null));};exports[_0xce6a('0xb0')]=function(_0x460ce7,_0x32ce44){return db[_0xce6a('0x34')]['create'](_0x460ce7[_0xce6a('0xb1')],{})['then'](respondWithResult(_0x32ce44,0xc9))[_0xce6a('0x33')](handleError(_0x32ce44,null));};exports['update']=function(_0x51f6b5,_0x3a1caa){if(_0x51f6b5[_0xce6a('0xb1')]['id']){delete _0x51f6b5['body']['id'];}return db['FaxInteraction'][_0xce6a('0x60')]({'where':{'id':_0x51f6b5[_0xce6a('0xb2')]['id']}})[_0xce6a('0x27')](handleEntityNotFound(_0x3a1caa,null))[_0xce6a('0x27')](saveUpdates(_0x51f6b5[_0xce6a('0xb1')],null))[_0xce6a('0x27')](respondWithResult(_0x3a1caa,null))[_0xce6a('0x33')](handleError(_0x3a1caa,null));};exports[_0xce6a('0xb3')]=function(_0x227b04,_0x2bced9){return db[_0xce6a('0x34')][_0xce6a('0x60')]({'where':{'id':_0x227b04[_0xce6a('0xb2')]['id']}})[_0xce6a('0x27')](handleEntityNotFound(_0x2bced9,null))['then'](removeEntity(_0x2bced9,null))[_0xce6a('0x33')](handleError(_0x2bced9,null));};exports[_0xce6a('0xb4')]=function(_0x30cb46,_0x4dfe29){return db[_0xce6a('0x34')][_0xce6a('0xb4')]()[_0xce6a('0x27')](respondWithResult(_0x4dfe29,null))[_0xce6a('0x33')](handleError(_0x4dfe29,null));};exports[_0xce6a('0xb5')]=function(_0x50bbef,_0x4ea786,_0x4733fa){return db[_0xce6a('0xb6')]['find']({'where':{'id':_0x50bbef[_0xce6a('0xb2')]['id']}})[_0xce6a('0x27')](handleEntityNotFound(_0x4ea786,null))[_0xce6a('0x27')](function(_0x28df15){if(_0x28df15){return _0x28df15[_0xce6a('0xb5')](_0x50bbef[_0xce6a('0xb1')]['ids'],_['omit'](_0x50bbef[_0xce6a('0xb1')],[_0xce6a('0xb7'),'id'])||{});}})[_0xce6a('0x27')](respondWithResult(_0x4ea786,null))[_0xce6a('0x33')](handleError(_0x4ea786,null));};exports[_0xce6a('0xb8')]=function(_0x4684d3,_0x4d697c,_0x288521){var _0x15803f={'raw':![],'where':{}};var _0x1a6819={};var _0x472040={'count':0x0,'rows':[]};return db['FaxInteraction'][_0xce6a('0xb9')]({'where':{'id':_0x4684d3[_0xce6a('0xb2')]['id']}})[_0xce6a('0x27')](handleEntityNotFound(_0x4d697c,null))[_0xce6a('0x27')](function(_0x12f168){if(_0x12f168){_0x1a6819[_0xce6a('0x39')]=_[_0xce6a('0x72')](db[_0xce6a('0xb6')][_0xce6a('0x35')]);_0x1a6819[_0xce6a('0x3a')]=_[_0xce6a('0x72')](_0x4684d3[_0xce6a('0x3a')]);_0x1a6819[_0xce6a('0x3b')]=_[_0xce6a('0x3c')](_0x1a6819[_0xce6a('0x39')],_0x1a6819[_0xce6a('0x3a')]);_0x15803f[_0xce6a('0x3e')]=_[_0xce6a('0x3c')](_0x1a6819[_0xce6a('0x39')],qs['fields'](_0x4684d3['query'][_0xce6a('0x3d')]));_0x15803f[_0xce6a('0x3e')]=_0x15803f[_0xce6a('0x3e')][_0xce6a('0x3f')]?_0x15803f[_0xce6a('0x3e')]:_0x1a6819[_0xce6a('0x39')];if(!_0x4684d3[_0xce6a('0x3a')]['hasOwnProperty'](_0xce6a('0x41'))){_0x15803f[_0xce6a('0x1e')]=qs['limit'](_0x4684d3[_0xce6a('0x3a')][_0xce6a('0x1e')]);_0x15803f[_0xce6a('0x20')]=qs[_0xce6a('0x20')](_0x4684d3[_0xce6a('0x3a')][_0xce6a('0x20')]);}_0x15803f[_0xce6a('0x8f')]=qs[_0xce6a('0x42')](_0x4684d3[_0xce6a('0x3a')][_0xce6a('0x42')]);_0x15803f[_0xce6a('0x43')]=qs[_0xce6a('0x3b')](_[_0xce6a('0x44')](_0x4684d3[_0xce6a('0x3a')],_0x1a6819[_0xce6a('0x3b')]));_0x15803f['where'][_0xce6a('0xba')]=_0x12f168['id'];if(_0x4684d3['query']['filter']){_0x15803f['where']=_[_0xce6a('0x97')](_0x15803f[_0xce6a('0x43')],{'$or':_['map'](_0x15803f['attributes'],function(_0x3e7aee){var _0x37d7fc={};_0x37d7fc[_0x3e7aee]={'$like':'%'+_0x4684d3[_0xce6a('0x3a')][_0xce6a('0xbb')]+'%'};return _0x37d7fc;})});}if(_0x4684d3[_0xce6a('0x3a')][_0xce6a('0x79')]){var _0x16c50d=_0x4684d3[_0xce6a('0x3a')]['$gte'][_0xce6a('0x30')](',');var _0x1ac208={};_0x1ac208[_0x16c50d[0x0]]={'$gte':moment(_0x16c50d[0x1])['format'](_0xce6a('0xbc'))};_0x15803f['where']=_['merge'](_0x15803f[_0xce6a('0x43')],_0x1ac208);}_0x15803f=_[_0xce6a('0x97')]({},_0x15803f,_0x4684d3[_0xce6a('0xaf')]);return db[_0xce6a('0xb6')][_0xce6a('0x21')]({'where':_0x15803f[_0xce6a('0x43')]})[_0xce6a('0x27')](function(_0x4661e1){_0x472040[_0xce6a('0x21')]=_0x4661e1;if(_0x4684d3['query'][_0xce6a('0xad')]){_0x15803f[_0xce6a('0xae')]=[{'all':!![]}];}return db['FaxMessage'][_0xce6a('0xbd')](_0x15803f);})[_0xce6a('0x27')](function(_0x12c4dc){_0x472040['rows']=_0x12c4dc;return _0x472040;});}})[_0xce6a('0x27')](respondWithFilteredResult(_0x4d697c,_0x15803f))[_0xce6a('0x33')](handleError(_0x4d697c,null));};exports[_0xce6a('0xbe')]=function(_0xd7dca8,_0x53e24c,_0x500413){return db[_0xce6a('0x34')]['find']({'where':{'id':_0xd7dca8[_0xce6a('0xb2')]['id']}})[_0xce6a('0x27')](handleEntityNotFound(_0x53e24c,null))['then'](function(_0x1e1d39){if(_0x1e1d39){return _0x1e1d39[_0xce6a('0xbf')](_0xd7dca8[_0xce6a('0xb1')][_0xce6a('0xb7')],_[_0xce6a('0xc0')](_0xd7dca8['body'],[_0xce6a('0xb7'),'id'])||{})[_0xce6a('0xc1')](function(){return db[_0xce6a('0x6d')][_0xce6a('0xbd')]({'attributes':['id','name',_0xce6a('0x47')],'where':{'id':_0xd7dca8['body'][_0xce6a('0xb7')]}});})[_0xce6a('0x27')](function(_0x1b71f1){socket[_0xce6a('0xc2')](_0xce6a('0xc3'),{'id':Number(_0xd7dca8[_0xce6a('0xb2')]['id']),'tags':_0x1b71f1||[]});return{'id':Number(_0xd7dca8[_0xce6a('0xb2')]['id']),'tags':_0x1b71f1||[]};});}})[_0xce6a('0x27')](respondWithResult(_0x53e24c,null))['catch'](handleError(_0x53e24c,null));};exports[_0xce6a('0xc4')]=function(_0x350f07,_0x2cf687,_0x439ff3){return db['FaxInteraction']['find']({'where':{'id':_0x350f07[_0xce6a('0xb2')]['id']}})[_0xce6a('0x27')](handleEntityNotFound(_0x2cf687,null))[_0xce6a('0x27')](function(_0x5859c4){if(_0x5859c4){return _0x5859c4[_0xce6a('0xc4')](_0x350f07[_0xce6a('0x3a')][_0xce6a('0xb7')]);}})[_0xce6a('0x27')](respondWithStatusCode(_0x2cf687,null))[_0xce6a('0x33')](handleError(_0x2cf687,null));};exports['download']=function(_0x53f5d3,_0xe90131){var _0x4df1e3=moment()[_0xce6a('0xc5')]()[_0xce6a('0xa9')]();var _0x3b0ed9=path[_0xce6a('0xc6')](config[_0xce6a('0xc7')],_0xce6a('0xc8'),_0xce6a('0xc9'),_0xce6a('0xca'));var _0x102784=path[_0xce6a('0xc6')](config[_0xce6a('0xc7')],'server',_0xce6a('0xc9'),_0xce6a('0xcb'));var _0x53329c=path[_0xce6a('0xc6')](_0x3b0ed9,_0x4df1e3);var _0x1956bf=util[_0xce6a('0xcc')](_0xce6a('0xcd'),_0x53f5d3[_0xce6a('0xb2')]['id'],_0x4df1e3);var _0x55e694=path[_0xce6a('0xc6')](_0x3b0ed9,_0x1956bf);var _0x81290d=[];_0x81290d[_0xce6a('0x32')]({'model':db[_0xce6a('0xce')],'as':'Attachment','raw':!![]});var _0x453371=[{'model':db[_0xce6a('0xb6')],'as':_0xce6a('0xcf'),'attributes':['id',_0xce6a('0xb1'),_0xce6a('0x77')],'include':_0x81290d}];return db['FaxInteraction'][_0xce6a('0x60')]({'where':{'id':_0x53f5d3[_0xce6a('0xb2')]['id']},'include':_0x453371})[_0xce6a('0x27')](handleEntityNotFound(_0xe90131,null))[_0xce6a('0x27')](function(_0x435506){if(_0x435506&&_0x435506[_0xce6a('0xcf')]){var _0x3eb128=_0x435506[_0xce6a('0xd0')]({'plain':!![]});fs[_0xce6a('0xd1')](_0x53329c);for(var _0x377151=0x0;_0x377151<_0x3eb128['Messages'][_0xce6a('0x3f')];_0x377151++){var _0x320231=_0x3eb128['Messages'][_0x377151][_0xce6a('0xce')];if(_0x320231){var _0x5be33a=path[_0xce6a('0xc6')](_0x102784,_0x320231['basename']);if(fs[_0xce6a('0xd2')](_0x5be33a)){fs[_0xce6a('0xd3')](_0x5be33a)[_0xce6a('0xd4')](fs['createWriteStream'](path[_0xce6a('0xc6')](_0x53329c,_0x320231['basename'])));}}}return BPromise[_0xce6a('0xd5')]()[_0xce6a('0x27')](function(){return new BPromise(function(_0x3c50de,_0x11cfce){zipdir(_0x53329c,{'saveTo':_0x55e694},function(_0x474f5a,_0x3d3374){if(_0x474f5a)return _0x11cfce(_0x474f5a);return _0x3c50de(_0x3d3374);});})[_0xce6a('0x27')](function(){return new BPromise(function(_0x4858f7,_0x8aef52){rimraf(_0x53329c,function(_0x2375bd){if(_0x2375bd)_0x8aef52(_0x2375bd);return _0x4858f7();});});})[_0xce6a('0x27')](function(){return _0xe90131[_0xce6a('0xd6')](_0x55e694,_0x1956bf,function(_0x38384f){if(_0x38384f){console[_0xce6a('0xd7')](_0xce6a('0xd8'),_0x38384f);}else{fs['unlinkSync'](_0x55e694);}});});});}else{return _0xe90131['sendStatus'](0xc8);}})[_0xce6a('0x33')](handleError(_0xe90131,null));};
\ No newline at end of file
+var _0x21e4=['fullname','TagIds','Tags','push','catch','index','FaxInteraction','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','filters','select','field','color','from','tools_tags','u.fullname','ui.FaxInteractionId','users','fax_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','length','find','value','having','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','start','Tag','forEach','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','isNumeric','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','unreadMessages','contactName','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','count','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','FaxInteractionId','all','show','params','includeAll','include','options','create','body','destroy','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','spread','emit','faxInteractionTags:save','removeTags','unix','server','join','root','attachments','transcript-%d-%s.zip','Attachment','Messages','mkdirSync','basename','existsSync','createWriteStream','download','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','defaults','localhost','socket.io-emitter','redis','./faxInteraction.socket','register','sendStatus','json','offset','undefined','Content-Range','apply','reject','save','update','then','status','end','error','stack','name','Users','map'];(function(_0x2107a5,_0x2d34cd){var _0x402566=function(_0x16987e){while(--_0x16987e){_0x2107a5['push'](_0x2107a5['shift']());}};_0x402566(++_0x2d34cd);}(_0x21e4,0x17a));var _0x421e=function(_0x58124f,_0x4f9ddf){_0x58124f=_0x58124f-0x0;var _0x5c5f85=_0x21e4[_0x58124f];return _0x5c5f85;};'use strict';var emlformat=require(_0x421e('0x0'));var rimraf=require(_0x421e('0x1'));var zipdir=require(_0x421e('0x2'));var jsonpatch=require(_0x421e('0x3'));var rp=require('request-promise');var moment=require(_0x421e('0x4'));var BPromise=require(_0x421e('0x5'));var Mustache=require('mustache');var util=require(_0x421e('0x6'));var path=require(_0x421e('0x7'));var sox=require(_0x421e('0x8'));var csv=require(_0x421e('0x9'));var ejs=require(_0x421e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x421e('0xb'));var squel=require('squel');var crypto=require(_0x421e('0xc'));var jsforce=require(_0x421e('0xd'));var deskjs=require(_0x421e('0xe'));var toCsv=require(_0x421e('0x9'));var querystring=require(_0x421e('0xf'));var Papa=require(_0x421e('0x10'));var Redis=require('ioredis');var authService=require(_0x421e('0x11'));var qs=require(_0x421e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x421e('0x13'));var logger=require(_0x421e('0x14'))('api');var utils=require(_0x421e('0x15'));var config=require(_0x421e('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x421e('0x17')](config['redis'],{'host':_0x421e('0x18'),'port':0x18eb});var socket=require(_0x421e('0x19'))(new Redis(config[_0x421e('0x1a')]));require(_0x421e('0x1b'))[_0x421e('0x1c')](socket);function respondWithStatusCode(_0x2346c2,_0x16e14f){_0x16e14f=_0x16e14f||0xcc;return function(_0x3faff6){if(_0x3faff6){return _0x2346c2[_0x421e('0x1d')](_0x16e14f);}return _0x2346c2['status'](_0x16e14f)['end']();};}function respondWithResult(_0x55748a,_0x2881cf){_0x2881cf=_0x2881cf||0xc8;return function(_0x3bfe63){if(_0x3bfe63){return _0x55748a['status'](_0x2881cf)[_0x421e('0x1e')](_0x3bfe63);}};}function respondWithFilteredResult(_0x3d8aa0,_0xbac1bd){return function(_0x3f6e0c){if(_0x3f6e0c){var _0x1502fc=typeof _0xbac1bd[_0x421e('0x1f')]===_0x421e('0x20')&&typeof _0xbac1bd['limit']===_0x421e('0x20');var _0x475a27=_0x3f6e0c['count'];var _0x37a774=_0x1502fc?0x0:_0xbac1bd['offset'];var _0x5c3fc5=_0x1502fc?_0x3f6e0c['count']:_0xbac1bd[_0x421e('0x1f')]+_0xbac1bd['limit'];var _0x29ad77;if(_0x5c3fc5>=_0x475a27){_0x5c3fc5=_0x475a27;_0x29ad77=0xc8;}else{_0x29ad77=0xce;}_0x3d8aa0['status'](_0x29ad77);return _0x3d8aa0['set'](_0x421e('0x21'),_0x37a774+'-'+_0x5c3fc5+'/'+_0x475a27)['json'](_0x3f6e0c);}return null;};}function patchUpdates(_0x2c6812){return function(_0x35383b){try{jsonpatch[_0x421e('0x22')](_0x35383b,_0x2c6812,!![]);}catch(_0x4d0778){return BPromise[_0x421e('0x23')](_0x4d0778);}return _0x35383b[_0x421e('0x24')]();};}function saveUpdates(_0x5a47a4,_0x117e6a){return function(_0x10dfae){if(_0x10dfae){return _0x10dfae[_0x421e('0x25')](_0x5a47a4)[_0x421e('0x26')](function(_0x2478e1){return _0x2478e1;});}return null;};}function removeEntity(_0x2ecc0c,_0x5c9b5a){return function(_0x1f7fc9){if(_0x1f7fc9){return _0x1f7fc9['destroy']()[_0x421e('0x26')](function(){_0x2ecc0c[_0x421e('0x27')](0xcc)[_0x421e('0x28')]();});}};}function handleEntityNotFound(_0x3ab688,_0x5d9db3){return function(_0x8cff41){if(!_0x8cff41){_0x3ab688[_0x421e('0x1d')](0x194);}return _0x8cff41;};}function handleError(_0xc3b39,_0x3ae87b){_0x3ae87b=_0x3ae87b||0x1f4;return function(_0x2ae2cc){logger[_0x421e('0x29')](_0x2ae2cc[_0x421e('0x2a')]);if(_0x2ae2cc['name']){delete _0x2ae2cc[_0x421e('0x2b')];}_0xc3b39[_0x421e('0x27')](_0x3ae87b)['send'](_0x2ae2cc);};}function getInteractionUsers(_0x2fbac3,_0x54fab7){return new BPromise(function(_0x519fb6,_0x435b29){try{if(_0x54fab7[_0x2fbac3['id']]){_0x2fbac3[_0x421e('0x2c')]=_[_0x421e('0x2d')](_0x54fab7[_0x2fbac3['id']],function(_0x363e54){return{'id':_0x363e54['id'],'fullname':_0x363e54[_0x421e('0x2e')]};});}}catch(_0x1b2e13){_0x435b29(_0x1b2e13);}_0x519fb6(_0x2fbac3);});}function getInteractionTags(_0x2b2452,_0x5683b4){return new BPromise(function(_0x2fd27a,_0x3df61b){try{if(_0x2b2452[_0x421e('0x2f')]){_0x2b2452[_0x421e('0x30')]=[];_0x2b2452[_0x421e('0x2f')]['split'](',')['forEach'](function(_0x21ed16){_0x2b2452[_0x421e('0x30')][_0x421e('0x31')](_0x5683b4[_0x21ed16]);});}delete _0x2b2452[_0x421e('0x2f')];}catch(_0x4d7086){_0x3df61b(_0x4d7086);}_0x2fd27a(_0x2b2452);});}function updateFaxInteraction(_0x3ca88d,_0x44fbb5,_0x2b40e8){return new BPromise(function(_0x59b7d5,_0x3ebad9){return getInteractionUsers(_0x3ca88d,_0x2b40e8)[_0x421e('0x26')](function(_0x5d8d43){return getInteractionTags(_0x5d8d43,_0x44fbb5);})[_0x421e('0x26')](function(_0x45fa5b){_0x59b7d5(_0x45fa5b);})[_0x421e('0x32')](function(_0x14d99c){_0x3ebad9(_0x14d99c);});});}exports[_0x421e('0x33')]=function(_0x28d8d7,_0x2adcde){var _0x247879={},_0x3f7180={},_0x3da2e6={'count':0x0,'rows':[]};var _0x28a7c8=_[_0x421e('0x2d')](db[_0x421e('0x34')][_0x421e('0x35')],function(_0xc39b6f){return{'name':_0xc39b6f[_0x421e('0x36')],'type':_0xc39b6f[_0x421e('0x37')][_0x421e('0x38')]};});_0x3f7180[_0x421e('0x39')]=_[_0x421e('0x2d')](_0x28a7c8,_0x421e('0x2b'));_0x3f7180[_0x421e('0x3a')]=_[_0x421e('0x3b')](_0x28d8d7[_0x421e('0x3a')]);_0x3f7180['filters']=_[_0x421e('0x3c')](_0x3f7180['model'],_0x3f7180['query']);_0x247879[_0x421e('0x3d')]=_['intersection'](_0x3f7180[_0x421e('0x39')],qs[_0x421e('0x3e')](_0x28d8d7[_0x421e('0x3a')][_0x421e('0x3e')]));_0x247879['attributes']=_0x247879['attributes']['length']?_0x247879['attributes']:_0x3f7180[_0x421e('0x39')];if(!_0x28d8d7[_0x421e('0x3a')][_0x421e('0x3f')](_0x421e('0x40'))){_0x247879[_0x421e('0x41')]=qs[_0x421e('0x41')](_0x28d8d7[_0x421e('0x3a')][_0x421e('0x41')]);_0x247879['offset']=qs[_0x421e('0x1f')](_0x28d8d7[_0x421e('0x3a')]['offset']);}_0x247879[_0x421e('0x42')]=qs[_0x421e('0x43')](_0x28d8d7['query'][_0x421e('0x43')]);_0x247879['where']=qs[_0x421e('0x44')](_['pick'](_0x28d8d7[_0x421e('0x3a')],_0x3f7180['filters']),_0x28a7c8);var _0x12f45f=[];var _0x5a638b=squel[_0x421e('0x45')]()[_0x421e('0x46')]('id')['field'](_0x421e('0x2b'))[_0x421e('0x46')](_0x421e('0x47'))[_0x421e('0x48')](_0x421e('0x49'));var _0xd5e352=squel[_0x421e('0x45')]()['field']('u.id')[_0x421e('0x46')](_0x421e('0x4a'))[_0x421e('0x46')](_0x421e('0x4b'))[_0x421e('0x48')]('user_has_fax_interactions','ui')['left_join'](_0x421e('0x4c'),'u','u.id\x20=\x20ui.UserId');var _0x58e7e6=squel[_0x421e('0x45')]()[_0x421e('0x48')](_0x421e('0x4d'),'i')[_0x421e('0x4e')](_0x421e('0x4f'),'c',_0x421e('0x50'))['left_join']('users','o','o.id\x20=\x20i.UserId')[_0x421e('0x4e')](_0x421e('0x51'),'a',_0x421e('0x52'))[_0x421e('0x4e')](_0x421e('0x53'),'me',_0x421e('0x54'))['left_join'](_0x421e('0x55'),'it',_0x421e('0x56'))[_0x421e('0x4e')]('tools_tags','t',_0x421e('0x57'));var _0x22c936=squel[_0x421e('0x58')]();var _0x2b424f=[];var _0x18973a=squel['expr']();var _0x1dcac3;if(_0x28d8d7[_0x421e('0x3a')][_0x421e('0x59')]){_0x1dcac3=as['parseSearch'](_0x28d8d7[_0x421e('0x3a')][_0x421e('0x59')]);var _0x3403be=_0x1dcac3[_0x421e('0x5a')];for(var _0x5b3e1f=0x0;_0x5b3e1f<_0x1dcac3[_0x421e('0x5b')][_0x421e('0x5c')];_0x5b3e1f++){var _0x4c96b4=_0x1dcac3['conditions'][_0x5b3e1f];var _0x2b917a='i';var _0x452c22=_[_0x421e('0x5d')](_0x28a7c8,[_0x421e('0x2b'),_0x4c96b4[_0x421e('0x46')]]);if(!_0x452c22){switch(_0x4c96b4[_0x421e('0x46')]){case'unreadMessages':if(_0x4c96b4[_0x421e('0x5e')]==0x1){_0x58e7e6['having']('`'+_0x4c96b4[_0x421e('0x46')]+'`\x20=\x200');}else{_0x58e7e6[_0x421e('0x5f')]('`'+_0x4c96b4['field']+_0x421e('0x60'));}break;case _0x421e('0x61'):if(_0x4c96b4[_0x421e('0x62')]===_0x421e('0x63')){if(_0x4c96b4[_0x421e('0x5e')][_0x421e('0x64')]('\x20')['length']>0x1){_0x22c936[_0x3403be](_0x421e('0x65'),qs['getFullTextValue'](_0x4c96b4[_0x421e('0x5e')]),null);}else{var _0x73d05e='%'+_0x4c96b4['value']+'%';_0x22c936[_0x3403be]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x73d05e,_0x73d05e,_0x73d05e);}}else{_0x452c22=_[_0x421e('0x5d')](_0x28a7c8,[_0x421e('0x2b'),_0x421e('0x66')]);_0x4c96b4[_0x421e('0x46')]='ContactId';_0x56f95e=as[_0x421e('0x67')](_0x2b917a,_0x452c22[_0x421e('0x37')],_0x4c96b4);_0x22c936[_0x3403be](_0x56f95e['text'],_0x56f95e[_0x421e('0x5e')][_0x421e('0x68')],_0x56f95e[_0x421e('0x5e')]['end']);}break;case _0x421e('0x69'):var _0x56a938=_0x4c96b4['value']['split'](',')[_0x421e('0x2d')](function(_0xc924fb){return Number(_0xc924fb);});_0x56a938[_0x421e('0x6a')](function(_0x194caf){_0x18973a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x194caf+',%');});_0x2b424f=_[_0x421e('0x6b')](_0x2b424f,_0x56a938);break;case _0x421e('0x6c'):if(_0x4c96b4['operator']===_0x421e('0x63')){_0x22c936[_0x3403be](_0x421e('0x6d'),'%'+_0x4c96b4[_0x421e('0x5e')]+'%',null);}else{_0x452c22=_[_0x421e('0x5d')](_0x28a7c8,[_0x421e('0x2b'),'UserId']);_0x4c96b4[_0x421e('0x46')]='UserId';_0x56f95e=as[_0x421e('0x67')](_0x2b917a,_0x452c22[_0x421e('0x37')],_0x4c96b4);_0x22c936[_0x3403be](_0x56f95e[_0x421e('0x6e')],_0x56f95e[_0x421e('0x5e')]['start'],_0x56f95e[_0x421e('0x5e')][_0x421e('0x28')]);}break;case'body':_0x56f95e=as['buildExpression']('me',null,_0x4c96b4);_0x22c936[_0x3403be](_0x56f95e[_0x421e('0x6e')],_0x56f95e[_0x421e('0x5e')][_0x421e('0x68')],_0x56f95e['value']['end']);break;}}else{var _0x56f95e=as[_0x421e('0x67')](_0x2b917a,_0x452c22[_0x421e('0x37')],_0x4c96b4);_0x22c936[_0x3403be](_0x56f95e[_0x421e('0x6e')],_0x56f95e[_0x421e('0x5e')][_0x421e('0x68')],_0x56f95e['value']['end']);}}}else{var _0x4f8b54=_(_0x28d8d7[_0x421e('0x3a')])[_0x421e('0x3b')]()[_0x421e('0x2d')](function(_0x399e31){return _[_0x421e('0x6f')](_0x28a7c8,['name',_0x399e31])?_0x399e31:undefined;})[_0x421e('0x70')]()[_0x421e('0x5e')]();if(!_[_0x421e('0x71')](_0x4f8b54)){_0x4f8b54[_0x421e('0x6a')](function(_0x42f0ad){if(_0x42f0ad===_0x421e('0x72')){_0x58e7e6['where'](_0x421e('0x73'),[][_0x421e('0x74')](_0x28d8d7[_0x421e('0x3a')][_0x42f0ad]));}else if(_0x42f0ad===_0x421e('0x75')){var _0x19fef7=JSON['parse'](_0x28d8d7['query'][_0x42f0ad])['$gte'];var _0x29178f=JSON[_0x421e('0x76')](_0x28d8d7[_0x421e('0x3a')][_0x42f0ad])[_0x421e('0x77')];_0x58e7e6[_0x421e('0x78')](_0x421e('0x79'),_0x19fef7,_0x29178f);}else{if(_0x28d8d7[_0x421e('0x3a')][_0x42f0ad]==='null'){_0x58e7e6[_0x421e('0x78')]('i.'+_0x42f0ad+_0x421e('0x7a'));}else{_0x58e7e6[_0x421e('0x78')]('i.'+_0x42f0ad+'\x20=\x20?',_0x28d8d7[_0x421e('0x3a')][_0x42f0ad]);}}});}if(_0x28d8d7[_0x421e('0x3a')][_0x421e('0x7b')]){if(_0x28d8d7[_0x421e('0x3a')][_0x421e('0x7b')]==0x1){_0x58e7e6['having']('`unreadMessages`\x20=\x200');}else{_0x58e7e6[_0x421e('0x5f')](_0x421e('0x7c'));}}if(_0x28d8d7['query'][_0x421e('0x7d')]){_0x2b424f=_['isArray'](_0x28d8d7[_0x421e('0x3a')][_0x421e('0x7d')])?_0x28d8d7[_0x421e('0x3a')][_0x421e('0x7d')]:new Array(_0x28d8d7['query'][_0x421e('0x7d')]);_0x2b424f['forEach'](function(_0xcac46){_0x18973a['or'](_0x421e('0x7e'),'%,'+_0xcac46+',%');});}if(_0x28d8d7[_0x421e('0x3a')]['filter']){var _0x4239f0=_0x28d8d7['query'][_0x421e('0x7f')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x421e('0x80')](_0x4239f0)){_0x22c936['or']('i.id\x20LIKE\x20?',_0x4239f0+'%')['or']('i.fax\x20LIKE\x20?',_0x4239f0+'%');}_0x22c936['or'](_0x421e('0x81'),_0x4239f0+'%');}}_0x58e7e6[_0x421e('0x78')](_0x22c936);_0x58e7e6[_0x421e('0x82')](_0x421e('0x83'));var _0x1bd617={'type':db[_0x421e('0x84')][_0x421e('0x85')][_0x421e('0x86')],'raw':!![]};var _0x54fd66=_0x58e7e6[_0x421e('0x87')]();_0x54fd66[_0x421e('0x46')]('i.id');_0x54fd66[_0x421e('0x46')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x421e('0x88'));if(_0x247879[_0x421e('0x42')]){_0x247879[_0x421e('0x42')][_0x421e('0x6a')](function(_0x5986d0){var _0x3a34c1=_0x5986d0[0x0]===_0x421e('0x89')?_0x5986d0[0x0]:'i.'+_0x5986d0[0x0];_0x58e7e6[_0x421e('0x42')](_0x3a34c1,_0x5986d0[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x2b424f)){_0x58e7e6['having'](_0x18973a);_0x54fd66[_0x421e('0x78')](_0x421e('0x8a'),_0x2b424f);}BPromise[_0x421e('0x8b')]()[_0x421e('0x26')](function(){if(!_0x1dcac3){if(_0x28d8d7['query'][_0x421e('0x72')])return;_0x54fd66[_0x421e('0x78')](_0x421e('0x8c'));_0x58e7e6[_0x421e('0x78')](_0x421e('0x8c'));return;}if(_0x28d8d7[_0x421e('0x8d')][_0x421e('0x8e')]!==_0x421e('0x8f'))return;return _0x28d8d7[_0x421e('0x8d')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0x421e('0x26')](function(_0x141db4){if(_['isEmpty'](_0x141db4)){_0x54fd66[_0x421e('0x78')]('i.FaxAccountId\x20IS\x20NULL');_0x58e7e6[_0x421e('0x78')](_0x421e('0x90'));}else{_0x54fd66['where'](_0x421e('0x73'),_[_0x421e('0x2d')](_0x141db4,'id'));_0x58e7e6[_0x421e('0x78')](_0x421e('0x73'),_['map'](_0x141db4,'id'));}});})[_0x421e('0x26')](function(){if(_0x28d8d7[_0x421e('0x8d')]['role']===_0x421e('0x8f')&&!_0x1dcac3&&!_0x28d8d7[_0x421e('0x3a')]['FaxAccountId'])return[];return db[_0x421e('0x91')][_0x421e('0x3a')](_0x54fd66[_0x421e('0x92')](),_0x1bd617);})[_0x421e('0x26')](function(_0x5e3d05){_0x3da2e6[_0x421e('0x93')]=_0x5e3d05[_0x421e('0x5c')];if(_0x3da2e6[_0x421e('0x93')]===0x0)return[];return db[_0x421e('0x91')][_0x421e('0x3a')](_0x5a638b[_0x421e('0x92')](),_0x1bd617)[_0x421e('0x26')](function(_0x413c21){_0x12f45f=_[_0x421e('0x94')](_0x413c21,'id');_0x1bd617=_[_0x421e('0x95')](_0x1bd617,{'model':db[_0x421e('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x28d8d7[_0x421e('0x3a')][_0x421e('0x3e')]){_0x247879[_0x421e('0x3d')][_0x421e('0x6a')](function(_0x140a58){_0x58e7e6[_0x421e('0x46')]('i.'+_0x140a58);});}else{_0x58e7e6['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x58e7e6[_0x421e('0x46')](_0x421e('0x96'),'Account.key');_0x58e7e6[_0x421e('0x46')](_0x421e('0x97'),_0x421e('0x98'));_0x58e7e6[_0x421e('0x46')](_0x421e('0x99'),_0x421e('0x89'));_0x58e7e6[_0x421e('0x46')](_0x421e('0x9a'));_0x58e7e6[_0x421e('0x46')]('c.firstName',_0x421e('0x9b'));_0x58e7e6[_0x421e('0x46')](_0x421e('0x9c'),_0x421e('0x9d'));_0x58e7e6[_0x421e('0x46')]('c.email',_0x421e('0x9e'));_0x58e7e6[_0x421e('0x46')]('c.phone',_0x421e('0x9f'));_0x58e7e6['field'](_0x421e('0xa0'),_0x421e('0xa1'));_0x58e7e6[_0x421e('0x46')](_0x421e('0xa2'),_0x421e('0xa3'));_0x58e7e6[_0x421e('0x46')](_0x421e('0xa4'),'Owner.fullname');_0x58e7e6['field'](_0x421e('0xa5'),'Owner.internal');_0x58e7e6['field'](_0x421e('0xa6'),_0x421e('0x2f'));}if(_0x247879[_0x421e('0x41')])_0x58e7e6[_0x421e('0x41')](_0x247879[_0x421e('0x41')]);if(_0x247879[_0x421e('0x1f')])_0x58e7e6[_0x421e('0x1f')](_0x247879[_0x421e('0x1f')]);return db['sequelize'][_0x421e('0x3a')](_0x58e7e6[_0x421e('0x92')](),_0x1bd617);})[_0x421e('0x26')](function(_0x3aa311){if(_0x3aa311[_0x421e('0x5c')]>0x0)_0xd5e352[_0x421e('0x78')]('ui.FaxInteractionId\x20IN\x20?',_[_0x421e('0x2d')](_0x3aa311,'id'));return db[_0x421e('0x91')][_0x421e('0x3a')](_0xd5e352[_0x421e('0x92')](),_0x1bd617)[_0x421e('0x26')](function(_0x40d3b8){var _0x299342=_[_0x421e('0xa7')](_0x40d3b8,_0x421e('0xa8'));var _0x4d3c4c=[];_0x3aa311[_0x421e('0x6a')](function(_0x45e728){_0x4d3c4c['push'](updateFaxInteraction(_0x45e728,_0x12f45f,_0x299342));});return BPromise[_0x421e('0xa9')](_0x4d3c4c);});});})['then'](function(_0x45b89b){_0x3da2e6['rows']=_0x45b89b;return _0x3da2e6;})[_0x421e('0x26')](respondWithFilteredResult(_0x2adcde,_0x247879))['catch'](handleError(_0x2adcde,null));};exports[_0x421e('0xaa')]=function(_0x7f55da,_0x5aefc0){var _0x1abed8={'raw':![],'where':{'id':_0x7f55da[_0x421e('0xab')]['id']}},_0x3ceb68={};_0x3ceb68[_0x421e('0x39')]=_['keys'](db[_0x421e('0x34')][_0x421e('0x35')]);_0x3ceb68[_0x421e('0x3a')]=_[_0x421e('0x3b')](_0x7f55da[_0x421e('0x3a')]);_0x3ceb68['filters']=_[_0x421e('0x3c')](_0x3ceb68[_0x421e('0x39')],_0x3ceb68[_0x421e('0x3a')]);_0x1abed8[_0x421e('0x3d')]=_['intersection'](_0x3ceb68['model'],qs['fields'](_0x7f55da['query']['fields']));_0x1abed8['attributes']=_0x1abed8['attributes']['length']?_0x1abed8[_0x421e('0x3d')]:_0x3ceb68[_0x421e('0x39')];if(_0x7f55da['query'][_0x421e('0xac')]){_0x1abed8[_0x421e('0xad')]=[{'all':!![]}];}_0x1abed8=_[_0x421e('0x95')]({},_0x1abed8,_0x7f55da[_0x421e('0xae')]);return db[_0x421e('0x34')]['find'](_0x1abed8)[_0x421e('0x26')](handleEntityNotFound(_0x5aefc0,null))[_0x421e('0x26')](respondWithResult(_0x5aefc0,null))[_0x421e('0x32')](handleError(_0x5aefc0,null));};exports[_0x421e('0xaf')]=function(_0x36feb0,_0x8b8b31){return db[_0x421e('0x34')]['create'](_0x36feb0['body'],{})['then'](respondWithResult(_0x8b8b31,0xc9))[_0x421e('0x32')](handleError(_0x8b8b31,null));};exports[_0x421e('0x25')]=function(_0x299184,_0x5cda07){if(_0x299184['body']['id']){delete _0x299184[_0x421e('0xb0')]['id'];}return db[_0x421e('0x34')][_0x421e('0x5d')]({'where':{'id':_0x299184[_0x421e('0xab')]['id']}})[_0x421e('0x26')](handleEntityNotFound(_0x5cda07,null))['then'](saveUpdates(_0x299184[_0x421e('0xb0')],null))['then'](respondWithResult(_0x5cda07,null))[_0x421e('0x32')](handleError(_0x5cda07,null));};exports[_0x421e('0xb1')]=function(_0x471c4f,_0x2c4428){return db[_0x421e('0x34')][_0x421e('0x5d')]({'where':{'id':_0x471c4f[_0x421e('0xab')]['id']}})[_0x421e('0x26')](handleEntityNotFound(_0x2c4428,null))[_0x421e('0x26')](removeEntity(_0x2c4428,null))['catch'](handleError(_0x2c4428,null));};exports[_0x421e('0xb2')]=function(_0x40e740,_0x23ce81){return db['FaxInteraction'][_0x421e('0xb2')]()['then'](respondWithResult(_0x23ce81,null))[_0x421e('0x32')](handleError(_0x23ce81,null));};exports[_0x421e('0xb3')]=function(_0x35a139,_0x261f9e,_0x5e3972){return db[_0x421e('0xb4')][_0x421e('0x5d')]({'where':{'id':_0x35a139[_0x421e('0xab')]['id']}})[_0x421e('0x26')](handleEntityNotFound(_0x261f9e,null))['then'](function(_0x211113){if(_0x211113){return _0x211113[_0x421e('0xb3')](_0x35a139[_0x421e('0xb0')][_0x421e('0xb5')],_[_0x421e('0xb6')](_0x35a139['body'],[_0x421e('0xb5'),'id'])||{});}})[_0x421e('0x26')](respondWithResult(_0x261f9e,null))['catch'](handleError(_0x261f9e,null));};exports[_0x421e('0xb7')]=function(_0x10328b,_0x420c6a,_0x1b9a4a){var _0x2ed34b={'raw':![],'where':{}};var _0x529b24={};var _0x31c8b5={'count':0x0,'rows':[]};return db[_0x421e('0x34')][_0x421e('0xb8')]({'where':{'id':_0x10328b[_0x421e('0xab')]['id']}})[_0x421e('0x26')](handleEntityNotFound(_0x420c6a,null))[_0x421e('0x26')](function(_0x31b8ba){if(_0x31b8ba){_0x529b24[_0x421e('0x39')]=_['keys'](db[_0x421e('0xb4')][_0x421e('0x35')]);_0x529b24['query']=_['keys'](_0x10328b[_0x421e('0x3a')]);_0x529b24['filters']=_[_0x421e('0x3c')](_0x529b24[_0x421e('0x39')],_0x529b24[_0x421e('0x3a')]);_0x2ed34b['attributes']=_['intersection'](_0x529b24[_0x421e('0x39')],qs[_0x421e('0x3e')](_0x10328b[_0x421e('0x3a')][_0x421e('0x3e')]));_0x2ed34b[_0x421e('0x3d')]=_0x2ed34b['attributes'][_0x421e('0x5c')]?_0x2ed34b['attributes']:_0x529b24[_0x421e('0x39')];if(!_0x10328b[_0x421e('0x3a')][_0x421e('0x3f')](_0x421e('0x40'))){_0x2ed34b['limit']=qs[_0x421e('0x41')](_0x10328b[_0x421e('0x3a')][_0x421e('0x41')]);_0x2ed34b[_0x421e('0x1f')]=qs[_0x421e('0x1f')](_0x10328b[_0x421e('0x3a')][_0x421e('0x1f')]);}_0x2ed34b['order']=qs[_0x421e('0x43')](_0x10328b[_0x421e('0x3a')][_0x421e('0x43')]);_0x2ed34b[_0x421e('0x78')]=qs[_0x421e('0x44')](_[_0x421e('0xb9')](_0x10328b['query'],_0x529b24[_0x421e('0x44')]));_0x2ed34b['where'][_0x421e('0xa8')]=_0x31b8ba['id'];if(_0x10328b[_0x421e('0x3a')]['filter']){_0x2ed34b[_0x421e('0x78')]=_[_0x421e('0x95')](_0x2ed34b[_0x421e('0x78')],{'$or':_['map'](_0x2ed34b[_0x421e('0x3d')],function(_0x2cf0de){var _0x45ed09={};_0x45ed09[_0x2cf0de]={'$like':'%'+_0x10328b[_0x421e('0x3a')]['filter']+'%'};return _0x45ed09;})});}if(_0x10328b[_0x421e('0x3a')][_0x421e('0xba')]){var _0x5091ab=_0x10328b[_0x421e('0x3a')][_0x421e('0xba')][_0x421e('0x64')](',');var _0x1a551e={};_0x1a551e[_0x5091ab[0x0]]={'$gte':moment(_0x5091ab[0x1])[_0x421e('0xbb')](_0x421e('0xbc'))};_0x2ed34b[_0x421e('0x78')]=_[_0x421e('0x95')](_0x2ed34b[_0x421e('0x78')],_0x1a551e);}_0x2ed34b=_['merge']({},_0x2ed34b,_0x10328b[_0x421e('0xae')]);return db[_0x421e('0xb4')]['count']({'where':_0x2ed34b['where']})['then'](function(_0x39441c){_0x31c8b5[_0x421e('0x93')]=_0x39441c;if(_0x10328b[_0x421e('0x3a')][_0x421e('0xac')]){_0x2ed34b['include']=[{'all':!![]}];}return db['FaxMessage'][_0x421e('0xbd')](_0x2ed34b);})[_0x421e('0x26')](function(_0x2a5b35){_0x31c8b5[_0x421e('0xbe')]=_0x2a5b35;return _0x31c8b5;});}})['then'](respondWithFilteredResult(_0x420c6a,_0x2ed34b))[_0x421e('0x32')](handleError(_0x420c6a,null));};exports[_0x421e('0xbf')]=function(_0x24eed3,_0x9a36cc,_0x23b04f){return db[_0x421e('0x34')][_0x421e('0x5d')]({'where':{'id':_0x24eed3[_0x421e('0xab')]['id']}})[_0x421e('0x26')](handleEntityNotFound(_0x9a36cc,null))[_0x421e('0x26')](function(_0x576681){if(_0x576681){return _0x576681['setTags'](_0x24eed3[_0x421e('0xb0')]['ids'],_[_0x421e('0xb6')](_0x24eed3[_0x421e('0xb0')],['ids','id'])||{})[_0x421e('0xc0')](function(){return db[_0x421e('0x69')][_0x421e('0xbd')]({'attributes':['id',_0x421e('0x2b'),'color'],'where':{'id':_0x24eed3[_0x421e('0xb0')][_0x421e('0xb5')]}});})[_0x421e('0x26')](function(_0x31d550){socket[_0x421e('0xc1')](_0x421e('0xc2'),{'id':Number(_0x24eed3[_0x421e('0xab')]['id']),'tags':_0x31d550||[]});return{'id':Number(_0x24eed3[_0x421e('0xab')]['id']),'tags':_0x31d550||[]};});}})[_0x421e('0x26')](respondWithResult(_0x9a36cc,null))[_0x421e('0x32')](handleError(_0x9a36cc,null));};exports[_0x421e('0xc3')]=function(_0x368e47,_0xc48bfa,_0x2f5803){return db['FaxInteraction'][_0x421e('0x5d')]({'where':{'id':_0x368e47[_0x421e('0xab')]['id']}})[_0x421e('0x26')](handleEntityNotFound(_0xc48bfa,null))[_0x421e('0x26')](function(_0x26ae53){if(_0x26ae53){return _0x26ae53[_0x421e('0xc3')](_0x368e47[_0x421e('0x3a')][_0x421e('0xb5')]);}})[_0x421e('0x26')](respondWithStatusCode(_0xc48bfa,null))[_0x421e('0x32')](handleError(_0xc48bfa,null));};exports['download']=function(_0x1988e7,_0x7a5bf9){var _0x459639=moment()[_0x421e('0xc4')]()[_0x421e('0x92')]();var _0x448e49=path['join'](config['root'],_0x421e('0xc5'),'files','tmp');var _0xdfe9c0=path[_0x421e('0xc6')](config[_0x421e('0xc7')],'server','files',_0x421e('0xc8'));var _0xceaa35=path['join'](_0x448e49,_0x459639);var _0x4b32f3=util['format'](_0x421e('0xc9'),_0x1988e7[_0x421e('0xab')]['id'],_0x459639);var _0x2ae3a9=path['join'](_0x448e49,_0x4b32f3);var _0x407f56=[];_0x407f56[_0x421e('0x31')]({'model':db['Attachment'],'as':_0x421e('0xca'),'raw':!![]});var _0x1f2613=[{'model':db[_0x421e('0xb4')],'as':_0x421e('0xcb'),'attributes':['id','body','createdAt'],'include':_0x407f56}];return db[_0x421e('0x34')]['find']({'where':{'id':_0x1988e7[_0x421e('0xab')]['id']},'include':_0x1f2613})[_0x421e('0x26')](handleEntityNotFound(_0x7a5bf9,null))[_0x421e('0x26')](function(_0x2c9784){if(_0x2c9784&&_0x2c9784['Messages']){var _0x78a8a6=_0x2c9784['get']({'plain':!![]});fs[_0x421e('0xcc')](_0xceaa35);for(var _0x5b268d=0x0;_0x5b268d<_0x78a8a6[_0x421e('0xcb')][_0x421e('0x5c')];_0x5b268d++){var _0x5e6464=_0x78a8a6[_0x421e('0xcb')][_0x5b268d][_0x421e('0xca')];if(_0x5e6464){var _0x4c71d0=path['join'](_0xdfe9c0,_0x5e6464[_0x421e('0xcd')]);if(fs[_0x421e('0xce')](_0x4c71d0)){fs['createReadStream'](_0x4c71d0)['pipe'](fs[_0x421e('0xcf')](path[_0x421e('0xc6')](_0xceaa35,_0x5e6464[_0x421e('0xcd')])));}}}return BPromise[_0x421e('0x8b')]()[_0x421e('0x26')](function(){return new BPromise(function(_0xbac39a,_0x4adf77){zipdir(_0xceaa35,{'saveTo':_0x2ae3a9},function(_0x58ffce,_0x4725d6){if(_0x58ffce)return _0x4adf77(_0x58ffce);return _0xbac39a(_0x4725d6);});})[_0x421e('0x26')](function(){return new BPromise(function(_0x58c527,_0x13019c){rimraf(_0xceaa35,function(_0x223890){if(_0x223890)_0x13019c(_0x223890);return _0x58c527();});});})['then'](function(){return _0x7a5bf9[_0x421e('0xd0')](_0x2ae3a9,_0x4b32f3,function(_0x5339be){if(_0x5339be){console[_0x421e('0xd1')](_0x421e('0xd2'),_0x5339be);}else{fs[_0x421e('0xd3')](_0x2ae3a9);}});});});}else{return _0x7a5bf9[_0x421e('0x1d')](0xc8);}})[_0x421e('0x32')](handleError(_0x7a5bf9,null));};
\ No newline at end of file
index ad254a1..784a2b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1046=['length','emit','hasOwnProperty','hook','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','findAll'];(function(_0x4ffa00,_0x5be360){var _0x231956=function(_0xe4f07a){while(--_0xe4f07a){_0x4ffa00['push'](_0x4ffa00['shift']());}};_0x231956(++_0x5be360);}(_0x1046,0xd4));var _0x6104=function(_0x3d2b6a,_0x5061d0){_0x3d2b6a=_0x3d2b6a-0x0;var _0x17d017=_0x1046[_0x3d2b6a];return _0x17d017;};'use strict';var EventEmitter=require(_0x6104('0x0'));var FaxInteraction=require(_0x6104('0x1'))['db'][_0x6104('0x2')];var FaxMessage=require(_0x6104('0x1'))['db'][_0x6104('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x6104('0x4')](0x0);var events={'afterCreate':_0x6104('0x5'),'afterUpdate':_0x6104('0x6'),'afterDestroy':_0x6104('0x7')};function emitEvent(_0x39c78b){return function(_0x3acce9,_0xd94be9,_0x2d85eb){_0x3acce9['getUsers']({'attributes':['id'],'raw':!![]})[_0x6104('0x8')](function(_0x41e6b7){_0x3acce9[_0x6104('0x9')](_0x6104('0xa'),_0x41e6b7['map'](function(_0x4a51de){return{'id':_0x4a51de['id']};}));return FaxMessage[_0x6104('0xb')]({'where':{'FaxInteractionId':_0x3acce9['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x21a853){_0x3acce9[_0x6104('0x9')]('unreadMessages',_0x21a853[_0x6104('0xc')]);FaxInteractionEvents['emit'](_0x39c78b+':'+_0x3acce9['id'],_0x3acce9);FaxInteractionEvents[_0x6104('0xd')](_0x39c78b,_0x3acce9);_0x2d85eb(null);})['catch'](_0x2d85eb(null));};}for(var e in events){if(events[_0x6104('0xe')](e)){var event=events[e];FaxInteraction[_0x6104('0xf')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents;
\ No newline at end of file
+var _0xebd0=['setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','remove','getUsers','then','Users','map'];(function(_0x285374,_0x4b7e9d){var _0x1f4428=function(_0x2c3319){while(--_0x2c3319){_0x285374['push'](_0x285374['shift']());}};_0x1f4428(++_0x4b7e9d);}(_0xebd0,0x14b));var _0x0ebd=function(_0x342089,_0x31dc2c){_0x342089=_0x342089-0x0;var _0x260b6c=_0xebd0[_0x342089];return _0x260b6c;};'use strict';var EventEmitter=require(_0x0ebd('0x0'));var FaxInteraction=require(_0x0ebd('0x1'))['db'][_0x0ebd('0x2')];var FaxMessage=require(_0x0ebd('0x1'))['db'][_0x0ebd('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x0ebd('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0ebd('0x5'),'afterDestroy':_0x0ebd('0x6')};function emitEvent(_0x152e7f){return function(_0x4dd0e5,_0x544493,_0x26a9dc){_0x4dd0e5[_0x0ebd('0x7')]({'attributes':['id'],'raw':!![]})[_0x0ebd('0x8')](function(_0x3e946f){_0x4dd0e5['setDataValue'](_0x0ebd('0x9'),_0x3e946f[_0x0ebd('0xa')](function(_0x25fc4b){return{'id':_0x25fc4b['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x4dd0e5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0ebd('0x8')](function(_0x51c692){_0x4dd0e5[_0x0ebd('0xb')](_0x0ebd('0xc'),_0x51c692[_0x0ebd('0xd')]);FaxInteractionEvents[_0x0ebd('0xe')](_0x152e7f+':'+_0x4dd0e5['id'],_0x4dd0e5);FaxInteractionEvents[_0x0ebd('0xe')](_0x152e7f,_0x4dd0e5);_0x26a9dc(null);})[_0x0ebd('0xf')](_0x26a9dc(null));};}for(var e in events){if(events[_0x0ebd('0x10')](e)){var event=events[e];FaxInteraction[_0x0ebd('0x11')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents;
\ No newline at end of file
index cea0378..d8ffcde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x034d=['define','FaxInteraction','fax_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports'];(function(_0x38ffd6,_0x54c358){var _0x131bdb=function(_0x36aac3){while(--_0x36aac3){_0x38ffd6['push'](_0x38ffd6['shift']());}};_0x131bdb(++_0x54c358);}(_0x034d,0x193));var _0xd034=function(_0x694103,_0x4801){_0x694103=_0x694103-0x0;var _0x1866c5=_0x034d[_0x694103];return _0x1866c5;};'use strict';var _=require(_0xd034('0x0'));var util=require(_0xd034('0x1'));var logger=require('../../config/logger')(_0xd034('0x2'));var moment=require(_0xd034('0x3'));var BPromise=require(_0xd034('0x4'));var rp=require(_0xd034('0x5'));var fs=require('fs');var path=require(_0xd034('0x6'));var rimraf=require(_0xd034('0x7'));var config=require(_0xd034('0x8'));var attributes=require(_0xd034('0x9'));module[_0xd034('0xa')]=function(_0x38ea51,_0x5ce09e){return _0x38ea51[_0xd034('0xb')](_0xd034('0xc'),attributes,{'tableName':_0xd034('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5d82d9,_0x54221c,_0xee4c4e){if(_0x5d82d9[_0xd034('0xe')]('closed')){_0x5d82d9[_0xd034('0xf')]=moment()[_0xd034('0x10')](_0xd034('0x11'));}_0xee4c4e(null,_0x5d82d9);}}});};
\ No newline at end of file
+var _0x0b6c=['fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','bluebird','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction'];(function(_0x513324,_0x4c36bf){var _0x55bf55=function(_0xc7bb0a){while(--_0xc7bb0a){_0x513324['push'](_0x513324['shift']());}};_0x55bf55(++_0x4c36bf);}(_0x0b6c,0x6f));var _0xc0b6=function(_0x14cc23,_0x5856e3){_0x14cc23=_0x14cc23-0x0;var _0xdfbd6f=_0x0b6c[_0x14cc23];return _0xdfbd6f;};'use strict';var _=require('lodash');var util=require(_0xc0b6('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc0b6('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc0b6('0x2'));var rimraf=require(_0xc0b6('0x3'));var config=require(_0xc0b6('0x4'));var attributes=require(_0xc0b6('0x5'));module[_0xc0b6('0x6')]=function(_0x3c8750,_0x709711){return _0x3c8750[_0xc0b6('0x7')](_0xc0b6('0x8'),attributes,{'tableName':_0xc0b6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xe28a9b,_0x72790b,_0x5e9de1){if(_0xe28a9b[_0xc0b6('0xa')](_0xc0b6('0xb'))){_0xe28a9b[_0xc0b6('0xc')]=moment()[_0xc0b6('0xd')](_0xc0b6('0xe'));}_0x5e9de1(null,_0xe28a9b);}}});};
\ No newline at end of file
index bdfc1a6..c0caf46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1fe=['FaxInteraction','update','body','options','raw','where','limit','AddTagsToFaxInteraction','find','ids','spread','AddTags','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','register','request','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','UpdateFaxInteraction'];(function(_0x6633d6,_0x19b0e0){var _0x2dcfe8=function(_0x293a0e){while(--_0x293a0e){_0x6633d6['push'](_0x6633d6['shift']());}};_0x2dcfe8(++_0x19b0e0);}(_0xf1fe,0xf6));var _0xef1f=function(_0x8c1005,_0x1f3f16){_0x8c1005=_0x8c1005-0x0;var _0x175354=_0xf1fe[_0x8c1005];return _0x175354;};'use strict';var _=require(_0xef1f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xef1f('0x1'));var rs=require(_0xef1f('0x2'));var fs=require('fs');var Redis=require(_0xef1f('0x3'));var db=require(_0xef1f('0x4'))['db'];var utils=require(_0xef1f('0x5'));var logger=require('../../config/logger')(_0xef1f('0x6'));var config=require(_0xef1f('0x7'));var jayson=require(_0xef1f('0x8'));var client=jayson[_0xef1f('0x9')]['http']({'port':0x232a});config['redis']=_[_0xef1f('0xa')](config[_0xef1f('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xef1f('0xc'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0xef1f('0xd')](socket);function respondWithRpcPromise(_0xabb30d,_0x5ed75c,_0x50e6eb){return new BPromise(function(_0x18976f,_0x415a97){return client[_0xef1f('0xe')](_0xabb30d,_0x50e6eb)[_0xef1f('0xf')](function(_0xb528a2){logger['info'](_0xef1f('0x10'),_0x5ed75c,_0xef1f('0x11'));logger[_0xef1f('0x12')](_0xef1f('0x13'),_0x5ed75c,_0xef1f('0x11'),JSON[_0xef1f('0x14')](_0xb528a2));if(_0xb528a2[_0xef1f('0x15')]){if(_0xb528a2['error']['code']===0x1f4){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x5ed75c,_0xb528a2[_0xef1f('0x15')]['message']);return _0x415a97(_0xb528a2[_0xef1f('0x15')][_0xef1f('0x16')]);}logger[_0xef1f('0x15')](_0xef1f('0x10'),_0x5ed75c,_0xb528a2[_0xef1f('0x15')][_0xef1f('0x16')]);return _0x18976f(_0xb528a2[_0xef1f('0x15')][_0xef1f('0x16')]);}else{logger[_0xef1f('0x17')](_0xef1f('0x10'),_0x5ed75c,_0xef1f('0x11'));_0x18976f(_0xb528a2[_0xef1f('0x18')][_0xef1f('0x16')]);}})[_0xef1f('0x19')](function(_0x5d969a){logger[_0xef1f('0x15')](_0xef1f('0x10'),_0x5ed75c,_0x5d969a);_0x415a97(_0x5d969a);});});}exports[_0xef1f('0x1a')]=function(_0x34597b){var _0x2df76c=this;return new Promise(function(_0x54c2c6,_0x19f0d2){return db[_0xef1f('0x1b')][_0xef1f('0x1c')](_0x34597b[_0xef1f('0x1d')],{'raw':_0x34597b[_0xef1f('0x1e')]?_0x34597b[_0xef1f('0x1e')][_0xef1f('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34597b['options']?_0x34597b[_0xef1f('0x1e')][_0xef1f('0x20')]||null:null,'attributes':_0x34597b[_0xef1f('0x1e')]?_0x34597b[_0xef1f('0x1e')]['attributes']||null:null,'limit':_0x34597b[_0xef1f('0x1e')]?_0x34597b[_0xef1f('0x1e')][_0xef1f('0x21')]||null:null})[_0xef1f('0xf')](function(_0x562f43){logger[_0xef1f('0x17')]('UpdateFaxInteraction',_0x34597b);logger[_0xef1f('0x12')](_0xef1f('0x1a'),_0x34597b,JSON[_0xef1f('0x14')](_0x562f43));_0x54c2c6(_0x562f43);})[_0xef1f('0x19')](function(_0x5a402c){logger[_0xef1f('0x15')](_0xef1f('0x1a'),_0x5a402c[_0xef1f('0x16')],_0x34597b);_0x19f0d2(_0x2df76c[_0xef1f('0x15')](0x1f4,_0x5a402c['message']));});});};exports[_0xef1f('0x22')]=function(_0x325767){return new Promise(function(_0x431cba,_0x30034f){return db[_0xef1f('0x1b')][_0xef1f('0x23')]({'where':_0x325767['options']?_0x325767[_0xef1f('0x1e')][_0xef1f('0x20')]||null:null})[_0xef1f('0xf')](function(_0x15372b){if(_0x15372b){return _0x15372b['addTags'](_0x325767[_0xef1f('0x1d')][_0xef1f('0x24')],_['omit'](_0x325767[_0xef1f('0x1d')],[_0xef1f('0x24'),'id'])||{});}})[_0xef1f('0x25')](function(_0xc7eb64){logger['info'](_0xef1f('0x26'),_0x325767);logger['debug']('AddTags',_0x325767,JSON[_0xef1f('0x14')](_0xc7eb64));_0x431cba(_0xc7eb64);})['catch'](function(_0x2e8b9f){logger[_0xef1f('0x15')](_0xef1f('0x26'),_0x2e8b9f['message'],_0x325767);_0x30034f(_this[_0xef1f('0x15')](0x1f4,_0x2e8b9f[_0xef1f('0x16')]));});});};
\ No newline at end of file
+var _0x6fca=['UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','AddTagsToFaxInteraction','find','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x2d3a4d,_0x47561e){var _0x3a94a3=function(_0x2f48da){while(--_0x2f48da){_0x2d3a4d['push'](_0x2d3a4d['shift']());}};_0x3a94a3(++_0x47561e);}(_0x6fca,0xaf));var _0xa6fc=function(_0x48e316,_0x3550e7){_0x48e316=_0x48e316-0x0;var _0x518e94=_0x6fca[_0x48e316];return _0x518e94;};'use strict';var _=require(_0xa6fc('0x0'));var util=require(_0xa6fc('0x1'));var moment=require(_0xa6fc('0x2'));var BPromise=require(_0xa6fc('0x3'));var rs=require(_0xa6fc('0x4'));var fs=require('fs');var Redis=require(_0xa6fc('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa6fc('0x6'));var logger=require(_0xa6fc('0x7'))(_0xa6fc('0x8'));var config=require(_0xa6fc('0x9'));var jayson=require(_0xa6fc('0xa'));var client=jayson[_0xa6fc('0xb')][_0xa6fc('0xc')]({'port':0x232a});config[_0xa6fc('0xd')]=_['defaults'](config[_0xa6fc('0xd')],{'host':_0xa6fc('0xe'),'port':0x18eb});var socket=require(_0xa6fc('0xf'))(new Redis(config['redis']));require(_0xa6fc('0x10'))[_0xa6fc('0x11')](socket);function respondWithRpcPromise(_0xab9134,_0x2acd69,_0x2e1209){return new BPromise(function(_0x180bcb,_0x524cef){return client[_0xa6fc('0x12')](_0xab9134,_0x2e1209)[_0xa6fc('0x13')](function(_0x230e8a){logger[_0xa6fc('0x14')](_0xa6fc('0x15'),_0x2acd69,_0xa6fc('0x16'));logger[_0xa6fc('0x17')](_0xa6fc('0x18'),_0x2acd69,_0xa6fc('0x16'),JSON[_0xa6fc('0x19')](_0x230e8a));if(_0x230e8a['error']){if(_0x230e8a[_0xa6fc('0x1a')]['code']===0x1f4){logger[_0xa6fc('0x1a')](_0xa6fc('0x15'),_0x2acd69,_0x230e8a[_0xa6fc('0x1a')][_0xa6fc('0x1b')]);return _0x524cef(_0x230e8a[_0xa6fc('0x1a')][_0xa6fc('0x1b')]);}logger['error'](_0xa6fc('0x15'),_0x2acd69,_0x230e8a[_0xa6fc('0x1a')][_0xa6fc('0x1b')]);return _0x180bcb(_0x230e8a[_0xa6fc('0x1a')][_0xa6fc('0x1b')]);}else{logger[_0xa6fc('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x2acd69,_0xa6fc('0x16'));_0x180bcb(_0x230e8a[_0xa6fc('0x1c')][_0xa6fc('0x1b')]);}})[_0xa6fc('0x1d')](function(_0x4c179d){logger[_0xa6fc('0x1a')](_0xa6fc('0x15'),_0x2acd69,_0x4c179d);_0x524cef(_0x4c179d);});});}exports[_0xa6fc('0x1e')]=function(_0x1580ea){var _0x9a7498=this;return new Promise(function(_0xbb81c5,_0x312037){return db[_0xa6fc('0x1f')][_0xa6fc('0x20')](_0x1580ea[_0xa6fc('0x21')],{'raw':_0x1580ea['options']?_0x1580ea[_0xa6fc('0x22')][_0xa6fc('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1580ea['options']?_0x1580ea['options'][_0xa6fc('0x24')]||null:null,'attributes':_0x1580ea[_0xa6fc('0x22')]?_0x1580ea['options']['attributes']||null:null,'limit':_0x1580ea[_0xa6fc('0x22')]?_0x1580ea['options']['limit']||null:null})[_0xa6fc('0x13')](function(_0x5238b3){logger[_0xa6fc('0x14')](_0xa6fc('0x1e'),_0x1580ea);logger[_0xa6fc('0x17')](_0xa6fc('0x1e'),_0x1580ea,JSON[_0xa6fc('0x19')](_0x5238b3));_0xbb81c5(_0x5238b3);})[_0xa6fc('0x1d')](function(_0x5c25c4){logger[_0xa6fc('0x1a')](_0xa6fc('0x1e'),_0x5c25c4[_0xa6fc('0x1b')],_0x1580ea);_0x312037(_0x9a7498[_0xa6fc('0x1a')](0x1f4,_0x5c25c4[_0xa6fc('0x1b')]));});});};exports[_0xa6fc('0x25')]=function(_0x18666f){return new Promise(function(_0x3edff3,_0xe672ce){return db[_0xa6fc('0x1f')][_0xa6fc('0x26')]({'where':_0x18666f['options']?_0x18666f[_0xa6fc('0x22')]['where']||null:null})[_0xa6fc('0x13')](function(_0x57f629){if(_0x57f629){return _0x57f629['addTags'](_0x18666f[_0xa6fc('0x21')][_0xa6fc('0x27')],_['omit'](_0x18666f['body'],['ids','id'])||{});}})['spread'](function(_0x5314d5){logger[_0xa6fc('0x14')](_0xa6fc('0x28'),_0x18666f);logger[_0xa6fc('0x17')](_0xa6fc('0x28'),_0x18666f,JSON[_0xa6fc('0x19')](_0x5314d5));_0x3edff3(_0x5314d5);})[_0xa6fc('0x1d')](function(_0xbef06c){logger[_0xa6fc('0x1a')]('AddTags',_0xbef06c['message'],_0x18666f);_0xe672ce(_this['error'](0x1f4,_0xbef06c[_0xa6fc('0x1b')]));});});};
\ No newline at end of file
index 8a38635..c1c6ca7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafa9=['length','faxInteraction:','update','emit','removeListener','register'];(function(_0x1e2b9d,_0x425ca3){var _0x5ccc29=function(_0x59faea){while(--_0x59faea){_0x1e2b9d['push'](_0x1e2b9d['shift']());}};_0x5ccc29(++_0x425ca3);}(_0xafa9,0x17c));var _0x9afa=function(_0x2f50b6,_0xd09fe3){_0x2f50b6=_0x2f50b6-0x0;var _0x54b027=_0xafa9[_0x2f50b6];return _0x54b027;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=['save','remove',_0x9afa('0x0')];function createListener(_0xd75cf8,_0x3a34a4){return function(_0x533013){_0x3a34a4[_0x9afa('0x1')](_0xd75cf8,_0x533013);};}function removeListener(_0x11c1e5,_0x3bcf34){return function(){FaxInteractionEvents[_0x9afa('0x2')](_0x11c1e5,_0x3bcf34);};}exports[_0x9afa('0x3')]=function(_0x2b5a12){for(var _0x148c53=0x0,_0x4d85fc=events[_0x9afa('0x4')];_0x148c53<_0x4d85fc;_0x148c53++){var _0x300306=events[_0x148c53];var _0x261c93=createListener(_0x9afa('0x5')+_0x300306,_0x2b5a12);FaxInteractionEvents['on'](_0x300306,_0x261c93);}};
\ No newline at end of file
+var _0x08d3=['remove','update','emit','removeListener','register','length','faxInteraction:','./faxInteraction.events','save'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x08d3,0x73));var _0x308d=function(_0x481704,_0x2c8229){_0x481704=_0x481704-0x0;var _0x1e95a3=_0x08d3[_0x481704];return _0x1e95a3;};'use strict';var FaxInteractionEvents=require(_0x308d('0x0'));var events=[_0x308d('0x1'),_0x308d('0x2'),_0x308d('0x3')];function createListener(_0x577d08,_0x3393d3){return function(_0x3830de){_0x3393d3[_0x308d('0x4')](_0x577d08,_0x3830de);};}function removeListener(_0x2829e0,_0x13c725){return function(){FaxInteractionEvents[_0x308d('0x5')](_0x2829e0,_0x13c725);};}exports[_0x308d('0x6')]=function(_0x2ef36b){for(var _0x524881=0x0,_0x27d57f=events[_0x308d('0x7')];_0x524881<_0x27d57f;_0x524881++){var _0x20fac4=events[_0x524881];var _0x41c506=createListener(_0x308d('0x8')+_0x20fac4,_0x2ef36b);FaxInteractionEvents['on'](_0x20fac4,_0x41c506);}};
\ No newline at end of file
index 3ba2fa2..3f6fea4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6c5=['exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','tracked','faxinteraction:addtags','addTags','fax','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','/:id/tags','removeTags'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0xb6c5,0x1e1));var _0x5b6c=function(_0x79369d,_0xd6f3c){_0x79369d=_0x79369d-0x0;var _0x9da19f=_0xb6c5[_0x79369d];return _0x9da19f;};'use strict';var multer=require('multer');var util=require(_0x5b6c('0x0'));var path=require('path');var timeout=require(_0x5b6c('0x1'));var express=require('express');var router=express[_0x5b6c('0x2')]();var fs_extra=require(_0x5b6c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5b6c('0x4'));var config=require(_0x5b6c('0x5'));var controller=require(_0x5b6c('0x6'));router['get']('/',auth[_0x5b6c('0x7')](),controller['index']);router[_0x5b6c('0x8')](_0x5b6c('0x9'),auth[_0x5b6c('0x7')](),controller[_0x5b6c('0xa')]);router['get'](_0x5b6c('0xb'),auth[_0x5b6c('0x7')](),controller[_0x5b6c('0xc')]);router[_0x5b6c('0x8')](_0x5b6c('0xd'),auth[_0x5b6c('0x7')](),controller[_0x5b6c('0xe')]);router[_0x5b6c('0x8')](_0x5b6c('0xf'),auth['isAuthenticated'](),controller[_0x5b6c('0x10')]);router[_0x5b6c('0x11')]('/',auth[_0x5b6c('0x7')](),controller[_0x5b6c('0x12')]);router[_0x5b6c('0x11')](_0x5b6c('0xd'),auth[_0x5b6c('0x7')](),controller[_0x5b6c('0x13')]);router[_0x5b6c('0x11')]('/:id/tags',auth[_0x5b6c('0x7')](),interaction[_0x5b6c('0x14')]('fax',_0x5b6c('0x15')),controller[_0x5b6c('0x16')]);router['put']('/:id',auth[_0x5b6c('0x7')](),interaction[_0x5b6c('0x14')](_0x5b6c('0x17'),_0x5b6c('0x18')),controller[_0x5b6c('0x19')]);router[_0x5b6c('0x1a')](_0x5b6c('0xb'),auth[_0x5b6c('0x7')](),interaction[_0x5b6c('0x14')](_0x5b6c('0x17'),_0x5b6c('0x1b')),controller[_0x5b6c('0x1c')]);router[_0x5b6c('0x1a')](_0x5b6c('0x1d'),auth[_0x5b6c('0x7')](),controller[_0x5b6c('0x1e')]);module[_0x5b6c('0x1f')]=router;
\ No newline at end of file
+var _0x2d57=['../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','faxinteraction:addtags','addTags','put','fax','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x35ac83,_0x10be5c){var _0x35a6a0=function(_0x5298c0){while(--_0x5298c0){_0x35ac83['push'](_0x35ac83['shift']());}};_0x35a6a0(++_0x10be5c);}(_0x2d57,0x17a));var _0x72d5=function(_0x420b24,_0x382adc){_0x420b24=_0x420b24-0x0;var _0x4da552=_0x2d57[_0x420b24];return _0x4da552;};'use strict';var multer=require('multer');var util=require(_0x72d5('0x0'));var path=require('path');var timeout=require(_0x72d5('0x1'));var express=require(_0x72d5('0x2'));var router=express[_0x72d5('0x3')]();var fs_extra=require(_0x72d5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x72d5('0x5'));var config=require(_0x72d5('0x6'));var controller=require('./faxInteraction.controller');router[_0x72d5('0x7')]('/',auth[_0x72d5('0x8')](),controller[_0x72d5('0x9')]);router[_0x72d5('0x7')]('/describe',auth[_0x72d5('0x8')](),controller[_0x72d5('0xa')]);router['get'](_0x72d5('0xb'),auth[_0x72d5('0x8')](),controller[_0x72d5('0xc')]);router[_0x72d5('0x7')](_0x72d5('0xd'),auth[_0x72d5('0x8')](),controller['getMessages']);router['get'](_0x72d5('0xe'),auth[_0x72d5('0x8')](),controller[_0x72d5('0xf')]);router[_0x72d5('0x10')]('/',auth[_0x72d5('0x8')](),controller[_0x72d5('0x11')]);router['post']('/:id/messages',auth[_0x72d5('0x8')](),controller[_0x72d5('0x12')]);router['post'](_0x72d5('0x13'),auth['isAuthenticated'](),interaction[_0x72d5('0x14')]('fax',_0x72d5('0x15')),controller[_0x72d5('0x16')]);router[_0x72d5('0x17')](_0x72d5('0xb'),auth[_0x72d5('0x8')](),interaction[_0x72d5('0x14')](_0x72d5('0x18'),_0x72d5('0x19')),controller[_0x72d5('0x1a')]);router[_0x72d5('0x1b')](_0x72d5('0xb'),auth['isAuthenticated'](),interaction[_0x72d5('0x14')](_0x72d5('0x18'),_0x72d5('0x1c')),controller[_0x72d5('0x1d')]);router[_0x72d5('0x1b')](_0x72d5('0x13'),auth[_0x72d5('0x8')](),controller[_0x72d5('0x1e')]);module[_0x72d5('0x1f')]=router;
\ No newline at end of file
index 206eb7f..a0314c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12c9=['out','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x3fb122,_0xf2def0){var _0x1dbcbd=function(_0x2fe576){while(--_0x2fe576){_0x3fb122['push'](_0x3fb122['shift']());}};_0x1dbcbd(++_0xf2def0);}(_0x12c9,0x1c9));var _0x912c=function(_0x353e0c,_0x530a72){_0x353e0c=_0x353e0c-0x0;var _0x1ba0ed=_0x12c9[_0x353e0c];return _0x1ba0ed;};'use strict';var Sequelize=require(_0x912c('0x0'));module[_0x912c('0x1')]={'body':{'type':Sequelize[_0x912c('0x2')](_0x912c('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x912c('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x912c('0x5')),'defaultValue':_0x912c('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x912c('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x912c('0x6')]}};
\ No newline at end of file
+var _0xa8eb=['TEXT','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x5d4e83,_0x23c49e){var _0x503b36=function(_0xaabb32){while(--_0xaabb32){_0x5d4e83['push'](_0x5d4e83['shift']());}};_0x503b36(++_0x23c49e);}(_0xa8eb,0x179));var _0xba8e=function(_0x1541a3,_0xec95b6){_0x1541a3=_0x1541a3-0x0;var _0x5be16c=_0xa8eb[_0x1541a3];return _0x5be16c;};'use strict';var Sequelize=require(_0xba8e('0x0'));module['exports']={'body':{'type':Sequelize[_0xba8e('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xba8e('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xba8e('0x3')]('in',_0xba8e('0x4')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0xba8e('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0xba8e('0x5')]}};
\ No newline at end of file
index 50355c8..c5d85e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc853=['includeAll','include','findAll','rows','params','length','options','find','body','describe','fax-interactions','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteraction','read1stAt','interaction','info','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','SELECT','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','event','accept','EventManager','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','ContactId','motionChannel','rejectmessage','create','CmContact','findOne','isNil','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','AttachmentId','join','server','files','attachments','Attachment','download','basename','eml-format','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxMessage.socket','jayson/promise','client','http','request','then','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','stack','name','send','index','map','FaxMessage','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x3c2255,_0x3c8e01){var _0x19996c=function(_0x1b25a7){while(--_0x1b25a7){_0x3c2255['push'](_0x3c2255['shift']());}};_0x19996c(++_0x3c8e01);}(_0xc853,0xd1));var _0x3c85=function(_0x19024f,_0x5a4227){_0x19024f=_0x19024f-0x0;var _0x225877=_0xc853[_0x19024f];return _0x225877;};'use strict';var emlformat=require(_0x3c85('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3c85('0x1'));var rp=require(_0x3c85('0x2'));var moment=require('moment');var BPromise=require(_0x3c85('0x3'));var Mustache=require('mustache');var util=require(_0x3c85('0x4'));var path=require('path');var sox=require(_0x3c85('0x5'));var csv=require(_0x3c85('0x6'));var ejs=require(_0x3c85('0x7'));var fs=require('fs');var fs_extra=require(_0x3c85('0x8'));var _=require(_0x3c85('0x9'));var squel=require(_0x3c85('0xa'));var crypto=require(_0x3c85('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3c85('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3c85('0xd'));var Papa=require('papaparse');var Redis=require(_0x3c85('0xe'));var authService=require(_0x3c85('0xf'));var qs=require(_0x3c85('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c85('0x11'))(_0x3c85('0x12'));var utils=require(_0x3c85('0x13'));var config=require(_0x3c85('0x14'));var licenseUtil=require(_0x3c85('0x15'));var db=require(_0x3c85('0x16'))['db'];config[_0x3c85('0x17')]=_[_0x3c85('0x18')](config[_0x3c85('0x17')],{'host':_0x3c85('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3c85('0x17')]));require(_0x3c85('0x1a'))['register'](socket);var jayson=require(_0x3c85('0x1b'));var client=jayson[_0x3c85('0x1c')][_0x3c85('0x1d')]({'port':0x232c});var client9002=jayson[_0x3c85('0x1c')][_0x3c85('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x413f52,_0x2afff3,_0x45c0aa,_0x3d5434){return new BPromise(function(_0x3bd1ed,_0x312ec9){var _0xf38995=_0x3d5434||client;return _0xf38995[_0x3c85('0x1e')](_0x413f52,_0x45c0aa)[_0x3c85('0x1f')](function(_0xe3b0c){logger['info'](_0x3c85('0x20'),_0x2afff3,'request\x20sent');logger[_0x3c85('0x21')](_0x3c85('0x22'),_0x2afff3,_0x3c85('0x23'),JSON[_0x3c85('0x24')](_0xe3b0c));if(_0xe3b0c[_0x3c85('0x25')]){if(_0xe3b0c[_0x3c85('0x25')][_0x3c85('0x26')]===0x1f4){logger[_0x3c85('0x25')](_0x3c85('0x20'),_0x2afff3,_0xe3b0c[_0x3c85('0x25')][_0x3c85('0x27')]);return _0x312ec9(_0xe3b0c['error'][_0x3c85('0x27')]);}logger[_0x3c85('0x25')](_0x3c85('0x20'),_0x2afff3,_0xe3b0c[_0x3c85('0x25')]['message']);return _0x3bd1ed(_0xe3b0c[_0x3c85('0x25')][_0x3c85('0x27')]);}else{logger['info'](_0x3c85('0x20'),_0x2afff3,_0x3c85('0x23'));_0x3bd1ed(_0xe3b0c[_0x3c85('0x28')]['message']);}})[_0x3c85('0x29')](function(_0x32501d){logger[_0x3c85('0x25')](_0x3c85('0x20'),_0x2afff3,_0x32501d);_0x312ec9(_0x32501d);});});}function respondWithStatusCode(_0x34951c,_0x270d97){_0x270d97=_0x270d97||0xcc;return function(_0x3b9fb3){if(_0x3b9fb3){return _0x34951c[_0x3c85('0x2a')](_0x270d97);}return _0x34951c[_0x3c85('0x2b')](_0x270d97)[_0x3c85('0x2c')]();};}function respondWithResult(_0x25f7d5,_0xadaede){_0xadaede=_0xadaede||0xc8;return function(_0x375afa){if(_0x375afa){return _0x25f7d5[_0x3c85('0x2b')](_0xadaede)[_0x3c85('0x2d')](_0x375afa);}};}function respondWithFilteredResult(_0x4a13dd,_0x59fd7a){return function(_0x2eb7de){if(_0x2eb7de){var _0x27a26a=typeof _0x59fd7a[_0x3c85('0x2e')]===_0x3c85('0x2f')&&typeof _0x59fd7a[_0x3c85('0x30')]===_0x3c85('0x2f');var _0x384f82=_0x2eb7de[_0x3c85('0x31')];var _0x566a85=_0x27a26a?0x0:_0x59fd7a['offset'];var _0x430bb0=_0x27a26a?_0x2eb7de[_0x3c85('0x31')]:_0x59fd7a[_0x3c85('0x2e')]+_0x59fd7a[_0x3c85('0x30')];var _0x2b9442;if(_0x430bb0>=_0x384f82){_0x430bb0=_0x384f82;_0x2b9442=0xc8;}else{_0x2b9442=0xce;}_0x4a13dd[_0x3c85('0x2b')](_0x2b9442);return _0x4a13dd[_0x3c85('0x32')]('Content-Range',_0x566a85+'-'+_0x430bb0+'/'+_0x384f82)[_0x3c85('0x2d')](_0x2eb7de);}return null;};}function patchUpdates(_0x42627a){return function(_0x1f26a5){try{jsonpatch[_0x3c85('0x33')](_0x1f26a5,_0x42627a,!![]);}catch(_0x2eb30b){return BPromise[_0x3c85('0x34')](_0x2eb30b);}return _0x1f26a5[_0x3c85('0x35')]();};}function saveUpdates(_0x4cf3fd,_0x2d4683){return function(_0x5ac7f4){if(_0x5ac7f4){return _0x5ac7f4[_0x3c85('0x36')](_0x4cf3fd)[_0x3c85('0x1f')](function(_0x472953){return _0x472953;});}return null;};}function removeEntity(_0x3821da,_0x16b546){return function(_0x38fe2e){if(_0x38fe2e){return _0x38fe2e[_0x3c85('0x37')]()[_0x3c85('0x1f')](function(){_0x3821da[_0x3c85('0x2b')](0xcc)[_0x3c85('0x2c')]();});}};}function handleEntityNotFound(_0x52fb44,_0xe4a37b){return function(_0x38025f){if(!_0x38025f){_0x52fb44['sendStatus'](0x194);}return _0x38025f;};}function handleError(_0x4777ec,_0x5cc617){_0x5cc617=_0x5cc617||0x1f4;return function(_0x2700c5){logger[_0x3c85('0x25')](_0x2700c5[_0x3c85('0x38')]);if(_0x2700c5[_0x3c85('0x39')]){delete _0x2700c5['name'];}_0x4777ec[_0x3c85('0x2b')](_0x5cc617)[_0x3c85('0x3a')](_0x2700c5);};}exports[_0x3c85('0x3b')]=function(_0x30af21,_0x30c00a){var _0x4c2776={},_0x4294c4={},_0x2d3320={'count':0x0,'rows':[]};var _0x1c02a6=_[_0x3c85('0x3c')](db[_0x3c85('0x3d')][_0x3c85('0x3e')],function(_0x3a403b){return{'name':_0x3a403b['fieldName'],'type':_0x3a403b[_0x3c85('0x3f')]['key']};});_0x4294c4[_0x3c85('0x40')]=_['map'](_0x1c02a6,_0x3c85('0x39'));_0x4294c4[_0x3c85('0x41')]=_[_0x3c85('0x42')](_0x30af21[_0x3c85('0x41')]);_0x4294c4[_0x3c85('0x43')]=_['intersection'](_0x4294c4[_0x3c85('0x40')],_0x4294c4[_0x3c85('0x41')]);_0x4c2776[_0x3c85('0x44')]=_[_0x3c85('0x45')](_0x4294c4['model'],qs['fields'](_0x30af21['query'][_0x3c85('0x46')]));_0x4c2776[_0x3c85('0x44')]=_0x4c2776[_0x3c85('0x44')]['length']?_0x4c2776[_0x3c85('0x44')]:_0x4294c4['model'];if(!_0x30af21[_0x3c85('0x41')][_0x3c85('0x47')](_0x3c85('0x48'))){_0x4c2776[_0x3c85('0x30')]=qs[_0x3c85('0x30')](_0x30af21[_0x3c85('0x41')][_0x3c85('0x30')]);_0x4c2776[_0x3c85('0x2e')]=qs[_0x3c85('0x2e')](_0x30af21[_0x3c85('0x41')][_0x3c85('0x2e')]);}_0x4c2776[_0x3c85('0x49')]=qs[_0x3c85('0x4a')](_0x30af21[_0x3c85('0x41')][_0x3c85('0x4a')]);_0x4c2776[_0x3c85('0x4b')]=qs['filters'](_[_0x3c85('0x4c')](_0x30af21[_0x3c85('0x41')],_0x4294c4['filters']),_0x1c02a6);if(_0x30af21[_0x3c85('0x41')][_0x3c85('0x4d')]){_0x4c2776[_0x3c85('0x4b')]=_[_0x3c85('0x4e')](_0x4c2776[_0x3c85('0x4b')],{'$or':_[_0x3c85('0x3c')](_0x1c02a6,function(_0x4bb197){if(_0x4bb197['type']!=='VIRTUAL'){var _0x43fa9a={};_0x43fa9a[_0x4bb197[_0x3c85('0x39')]]={'$like':'%'+_0x30af21[_0x3c85('0x41')][_0x3c85('0x4d')]+'%'};return _0x43fa9a;}})});}_0x4c2776=_[_0x3c85('0x4e')]({},_0x4c2776,_0x30af21['options']);var _0x37af3b={'where':_0x4c2776[_0x3c85('0x4b')]};return db['FaxMessage'][_0x3c85('0x31')](_0x37af3b)[_0x3c85('0x1f')](function(_0x49c5ee){_0x2d3320[_0x3c85('0x31')]=_0x49c5ee;if(_0x30af21['query'][_0x3c85('0x4f')]){_0x4c2776[_0x3c85('0x50')]=[{'all':!![]}];}return db[_0x3c85('0x3d')][_0x3c85('0x51')](_0x4c2776);})[_0x3c85('0x1f')](function(_0x559a73){_0x2d3320[_0x3c85('0x52')]=_0x559a73;return _0x2d3320;})[_0x3c85('0x1f')](respondWithFilteredResult(_0x30c00a,_0x4c2776))[_0x3c85('0x29')](handleError(_0x30c00a,null));};exports['show']=function(_0x42edc9,_0x1eb2d1){var _0x26d721={'raw':!![],'where':{'id':_0x42edc9[_0x3c85('0x53')]['id']}},_0x52e564={};_0x52e564[_0x3c85('0x40')]=_[_0x3c85('0x42')](db[_0x3c85('0x3d')]['rawAttributes']);_0x52e564['query']=_[_0x3c85('0x42')](_0x42edc9['query']);_0x52e564['filters']=_[_0x3c85('0x45')](_0x52e564[_0x3c85('0x40')],_0x52e564[_0x3c85('0x41')]);_0x26d721[_0x3c85('0x44')]=_['intersection'](_0x52e564['model'],qs[_0x3c85('0x46')](_0x42edc9['query'][_0x3c85('0x46')]));_0x26d721[_0x3c85('0x44')]=_0x26d721['attributes'][_0x3c85('0x54')]?_0x26d721[_0x3c85('0x44')]:_0x52e564[_0x3c85('0x40')];if(_0x42edc9['query'][_0x3c85('0x4f')]){_0x26d721[_0x3c85('0x50')]=[{'all':!![]}];}_0x26d721=_['merge']({},_0x26d721,_0x42edc9[_0x3c85('0x55')]);return db[_0x3c85('0x3d')][_0x3c85('0x56')](_0x26d721)[_0x3c85('0x1f')](handleEntityNotFound(_0x1eb2d1,null))[_0x3c85('0x1f')](respondWithResult(_0x1eb2d1,null))[_0x3c85('0x29')](handleError(_0x1eb2d1,null));};exports['update']=function(_0x452524,_0x3a0a7e){if(_0x452524[_0x3c85('0x57')]['id']){delete _0x452524['body']['id'];}return db['FaxMessage'][_0x3c85('0x56')]({'where':{'id':_0x452524['params']['id']}})[_0x3c85('0x1f')](handleEntityNotFound(_0x3a0a7e,null))['then'](saveUpdates(_0x452524[_0x3c85('0x57')],null))['then'](respondWithResult(_0x3a0a7e,null))[_0x3c85('0x29')](handleError(_0x3a0a7e,null));};exports['destroy']=function(_0x14bd2c,_0x501fdd){return db[_0x3c85('0x3d')][_0x3c85('0x56')]({'where':{'id':_0x14bd2c['params']['id']}})[_0x3c85('0x1f')](handleEntityNotFound(_0x501fdd,null))[_0x3c85('0x1f')](removeEntity(_0x501fdd,null))[_0x3c85('0x29')](handleError(_0x501fdd,null));};exports[_0x3c85('0x58')]=function(_0x2283bb,_0x64622e){return db['FaxMessage']['describe']()[_0x3c85('0x1f')](respondWithResult(_0x64622e,null))[_0x3c85('0x29')](handleError(_0x64622e,null));};var interaction_log=require('../../config/logger')(_0x3c85('0x59'));exports['accept']=function(_0x5e4956,_0x18d41e,_0x2cfef2){var _0x4a0125={'agent':{},'channel':_0x3c85('0x5a')};if(_0x5e4956[_0x3c85('0x57')]['id']){delete _0x5e4956[_0x3c85('0x57')]['id'];}_0x5e4956[_0x3c85('0x57')][_0x3c85('0x5b')]=!![];_0x5e4956[_0x3c85('0x57')][_0x3c85('0x5c')]=moment()[_0x3c85('0x5d')](_0x3c85('0x5e'));_0x5e4956[_0x3c85('0x57')][_0x3c85('0x5f')]=_0x5e4956['body'][_0x3c85('0x5f')]||_0x5e4956[_0x3c85('0x60')]['id'];_0x4a0125['agent']['id']=_0x5e4956[_0x3c85('0x57')][_0x3c85('0x5f')];return db[_0x3c85('0x3d')][_0x3c85('0x56')]({'where':{'id':_0x5e4956[_0x3c85('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x18d41e,null))[_0x3c85('0x1f')](saveUpdates(_0x5e4956['body'],null))['then'](function(_0x2819f5){if(_0x2819f5){_0x4a0125['message']=_0x2819f5[_0x3c85('0x61')]({'plain':!![]});return db[_0x3c85('0x62')][_0x3c85('0x56')]({'where':{'id':_0x2819f5['FaxInteractionId']}});}return null;})[_0x3c85('0x1f')](handleEntityNotFound(_0x18d41e,null))['then'](function(_0x5762fa){if(_0x5762fa){return _0x5762fa['update']({'UserId':_0x5e4956[_0x3c85('0x57')][_0x3c85('0x5f')],'read1stAt':_['isNil'](_0x5762fa[_0x3c85('0x63')])?moment()[_0x3c85('0x5d')](_0x3c85('0x5e')):undefined});}return null;})[_0x3c85('0x1f')](function(_0x354719){if(_0x354719){_0x4a0125[_0x3c85('0x64')]=_0x354719['get']({'plain':!![]});interaction_log[_0x3c85('0x65')](_0x3c85('0x66'),_0x5e4956['user']['id'],_0x5e4956[_0x3c85('0x60')][_0x3c85('0x39')],_0x5e4956['user'][_0x3c85('0x67')],_0x4a0125['interaction']['id'],_0x5e4956[_0x3c85('0x57')]?JSON[_0x3c85('0x24')](_0x5e4956[_0x3c85('0x57')]):_0x3c85('0x68'));return respondWithRpcPromise(_0x3c85('0x69'),_0x3c85('0x6a'),_0x4a0125);}return null;})['then'](function(_0x1508a8){var _0x2f66d0=_0x3c85('0x6b')+_0x1508a8[_0x3c85('0x27')]['ContactId'];return db[_0x3c85('0x6c')][_0x3c85('0x41')](_0x2f66d0,{'type':db['Sequelize']['QueryTypes'][_0x3c85('0x6d')],'raw':!![]})[_0x3c85('0x1f')](function(_0x155c69){return _0x155c69;});})['then'](function(_0x56b8dc){if(_0x56b8dc){_0x4a0125['message'][_0x3c85('0x6e')]=_0x56b8dc[0x0];if(!_0x5e4956[_0x3c85('0x57')][_0x3c85('0x5f')])return;return db[_0x3c85('0x6f')][_0x3c85('0x56')]({'where':{'id':_0x5e4956[_0x3c85('0x57')][_0x3c85('0x5f')],'role':_0x3c85('0x70')},'attributes':['id',_0x3c85('0x39'),_0x3c85('0x71'),_0x3c85('0x72'),_0x3c85('0x73')],'raw':!![]});}return null;})['then'](function(_0x1d074f){if(!_0x1d074f)return null;_0x4a0125[_0x3c85('0x27')][_0x3c85('0x70')]=_0x1d074f;return _0x4a0125;})[_0x3c85('0x1f')](function(_0x360389){if(_0x360389){if(_0x5e4956[_0x3c85('0x57')][_0x3c85('0x74')]){_0x4a0125[_0x3c85('0x27')][_0x3c85('0x75')]=util['format'](_0x3c85('0x76'),_0x5e4956[_0x3c85('0x60')][_0x3c85('0x39')]);_0x4a0125[_0x3c85('0x27')][_0x3c85('0x77')]=_0x4a0125[_0x3c85('0x77')];_0x4a0125[_0x3c85('0x27')]['motionChannel']=_0x4a0125[_0x3c85('0x77')];_0x4a0125[_0x3c85('0x27')][_0x3c85('0x78')]=_0x3c85('0x79');return respondWithRpcPromise(_0x3c85('0x7a'),_0x3c85('0x7a'),{'event':'acceptmessage','message':_0x4a0125[_0x3c85('0x27')]},client9002)['then'](function(){return _0x4a0125;});}return _0x4a0125;}return null;})[_0x3c85('0x1f')](respondWithResult(_0x18d41e,null))[_0x3c85('0x29')](handleError(_0x18d41e,null));};var interaction_log=require(_0x3c85('0x11'))(_0x3c85('0x59'));exports[_0x3c85('0x34')]=function(_0x5054d5,_0x50ca19,_0x232c70){var _0x3a6f17={'agent':{},'channel':'fax'};if(_0x5054d5[_0x3c85('0x57')]['id']){delete _0x5054d5[_0x3c85('0x57')]['id'];}_0x5054d5['body'][_0x3c85('0x5f')]=_0x5054d5[_0x3c85('0x57')]['UserId']||_0x5054d5[_0x3c85('0x60')]['id'];_0x3a6f17[_0x3c85('0x70')]['id']=_0x5054d5[_0x3c85('0x57')][_0x3c85('0x5f')];return db[_0x3c85('0x3d')][_0x3c85('0x56')]({'where':{'id':_0x5054d5[_0x3c85('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x50ca19,null))[_0x3c85('0x1f')](function(_0x54e365){if(_0x54e365){_0x3a6f17[_0x3c85('0x27')]=_0x54e365['get']({'plain':!![]});return db[_0x3c85('0x62')][_0x3c85('0x56')]({'where':{'id':_0x54e365[_0x3c85('0x7b')]}});}return null;})[_0x3c85('0x1f')](handleEntityNotFound(_0x50ca19,null))['then'](function(_0x3de4a1){if(_0x3de4a1){_0x3a6f17[_0x3c85('0x64')]=_0x3de4a1['get']({'plain':!![]});interaction_log[_0x3c85('0x65')](_0x3c85('0x7c'),_0x5054d5[_0x3c85('0x60')]['id'],_0x5054d5[_0x3c85('0x60')][_0x3c85('0x39')],_0x5054d5[_0x3c85('0x60')][_0x3c85('0x67')],_0x3a6f17[_0x3c85('0x64')]['id'],_0x5054d5[_0x3c85('0x57')]?JSON[_0x3c85('0x24')](_0x5054d5[_0x3c85('0x57')]):_0x3c85('0x68'));return respondWithRpcPromise('RejectMessage',_0x3c85('0x7d'),_0x3a6f17);}return null;})['then'](function(_0x378fe0){var _0x401d17=_0x3c85('0x6b')+_0x378fe0['message'][_0x3c85('0x7e')];return db['sequelize'][_0x3c85('0x41')](_0x401d17,{'type':db['Sequelize']['QueryTypes'][_0x3c85('0x6d')],'raw':!![]})[_0x3c85('0x1f')](function(_0x18f2fb){return _0x18f2fb;});})['then'](function(_0x284b2a){if(_0x284b2a){_0x3a6f17[_0x3c85('0x27')][_0x3c85('0x6e')]=_0x284b2a[0x0];if(!_0x5054d5[_0x3c85('0x57')][_0x3c85('0x5f')])return;return db[_0x3c85('0x6f')][_0x3c85('0x56')]({'where':{'id':_0x5054d5[_0x3c85('0x57')][_0x3c85('0x5f')],'role':_0x3c85('0x70')},'attributes':['id','name',_0x3c85('0x71'),'email',_0x3c85('0x73')],'raw':!![]});}return null;})[_0x3c85('0x1f')](function(_0x546058){if(!_0x546058)return null;_0x3a6f17[_0x3c85('0x27')][_0x3c85('0x70')]=_0x546058;return _0x3a6f17;})['then'](function(_0x225fc8){if(_0x225fc8){_0x225fc8[_0x3c85('0x27')][_0x3c85('0x75')]=util[_0x3c85('0x5d')](_0x3c85('0x76'),_0x5054d5[_0x3c85('0x60')]['name']);_0x225fc8[_0x3c85('0x27')][_0x3c85('0x77')]=_0x3a6f17[_0x3c85('0x77')];_0x225fc8[_0x3c85('0x27')][_0x3c85('0x7f')]=_0x3a6f17[_0x3c85('0x77')];_0x225fc8[_0x3c85('0x27')][_0x3c85('0x78')]=_0x3c85('0x34');respondWithRpcPromise(_0x3c85('0x7a'),_0x3c85('0x7a'),{'event':_0x3c85('0x80'),'message':_0x225fc8[_0x3c85('0x27')]},client9002);return _0x3a6f17;}return null;})['then'](respondWithResult(_0x50ca19,null))[_0x3c85('0x29')](handleError(_0x50ca19,null));};exports[_0x3c85('0x81')]=function(_0x963d5e,_0x44b75b){var _0x2687fb;return db[_0x3c85('0x3d')][_0x3c85('0x81')](_0x963d5e['body'],{})[_0x3c85('0x1f')](function(_0x47b9d9){_0x2687fb=_0x47b9d9;return db[_0x3c85('0x82')][_0x3c85('0x83')]({'where':{'id':_0x2687fb[_0x3c85('0x7e')]}});})[_0x3c85('0x1f')](function(_0x24cb90){if(_[_0x3c85('0x84')](_0x24cb90)){return;}else{_0x2687fb[_0x3c85('0x5a')]=_0x24cb90[_0x3c85('0x5a')];return db['Attachment'][_0x3c85('0x83')]({'where':{'id':_0x2687fb['AttachmentId']}});}})[_0x3c85('0x1f')](function(_0x2fe8ad){return respondWithRpcPromise(_0x3c85('0x85'),'SendFax',{'FaxAccountId':_[_0x3c85('0x84')](_0x963d5e[_0x3c85('0x57')])?undefined:_0x963d5e[_0x3c85('0x57')][_0x3c85('0x86')],'path':_['isNil'](_0x2fe8ad)?undefined:util['format'](_0x3c85('0x87'),_0x2fe8ad['basename']),'fax':_[_0x3c85('0x84')](_0x2687fb[_0x3c85('0x5a')])?undefined:_0x2687fb[_0x3c85('0x5a')],'AttachmentId':_0x2687fb[_0x3c85('0x88')]},client9002);})['then'](respondWithResult(_0x44b75b,0xc9))[_0x3c85('0x29')](handleError(_0x44b75b,null));};exports['download']=function(_0x48d06b,_0x3abb0e){var _0x26ac5f=path[_0x3c85('0x89')](config['root'],_0x3c85('0x8a'),_0x3c85('0x8b'),_0x3c85('0x8c'));return db[_0x3c85('0x3d')]['find']({'where':{'id':_0x48d06b[_0x3c85('0x53')]['id']},'include':[{'model':db['Attachment'],'as':_0x3c85('0x8d')}]})[_0x3c85('0x1f')](handleEntityNotFound(_0x3abb0e,null))[_0x3c85('0x1f')](function(_0x5088f5){if(_0x5088f5){return _0x3abb0e[_0x3c85('0x8e')](path[_0x3c85('0x89')](_0x26ac5f,_0x5088f5[_0x3c85('0x8d')][_0x3c85('0x8f')]));}})[_0x3c85('0x29')](handleError(_0x3abb0e,null));};
\ No newline at end of file
+var _0x1381=['count','Content-Range','apply','save','update','destroy','stack','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','VIRTUAL','filter','includeAll','rows','params','include','options','find','body','accept','fax','readAt','format','UserId','user','agent','get','FaxInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','EventManager','acceptmessage','fax-interactions','reject','FaxInteraction','role','ContactId','motionChannel','event','rejectmessage','create','CmContact','Attachment','findOne','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','download','root','server','files','attachments','join','basename','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxMessage.socket','register','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','json','offset','undefined'];(function(_0x28edf8,_0x3ab79f){var _0xb0bbba=function(_0x52eeae){while(--_0x52eeae){_0x28edf8['push'](_0x28edf8['shift']());}};_0xb0bbba(++_0x3ab79f);}(_0x1381,0x174));var _0x1138=function(_0x36ef33,_0x4bc2c5){_0x36ef33=_0x36ef33-0x0;var _0x107115=_0x1381[_0x36ef33];return _0x107115;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1138('0x0'));var zipdir=require(_0x1138('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1138('0x2'));var moment=require(_0x1138('0x3'));var BPromise=require(_0x1138('0x4'));var Mustache=require(_0x1138('0x5'));var util=require(_0x1138('0x6'));var path=require('path');var sox=require(_0x1138('0x7'));var csv=require(_0x1138('0x8'));var ejs=require(_0x1138('0x9'));var fs=require('fs');var fs_extra=require(_0x1138('0xa'));var _=require('lodash');var squel=require(_0x1138('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1138('0xc'));var toCsv=require(_0x1138('0x8'));var querystring=require(_0x1138('0xd'));var Papa=require('papaparse');var Redis=require(_0x1138('0xe'));var authService=require(_0x1138('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x1138('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1138('0x11'))('api');var utils=require(_0x1138('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x1138('0x13'));var db=require(_0x1138('0x14'))['db'];config[_0x1138('0x15')]=_['defaults'](config[_0x1138('0x15')],{'host':_0x1138('0x16'),'port':0x18eb});var socket=require(_0x1138('0x17'))(new Redis(config[_0x1138('0x15')]));require(_0x1138('0x18'))[_0x1138('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x1138('0x1a')][_0x1138('0x1b')]({'port':0x232c});var client9002=jayson[_0x1138('0x1a')][_0x1138('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x7d5b41,_0x360735,_0x4cc97c,_0xbea5ac){return new BPromise(function(_0x39b828,_0x2a1893){var _0x2ae43e=_0xbea5ac||client;return _0x2ae43e[_0x1138('0x1c')](_0x7d5b41,_0x4cc97c)[_0x1138('0x1d')](function(_0x1e51be){logger[_0x1138('0x1e')](_0x1138('0x1f'),_0x360735,_0x1138('0x20'));logger[_0x1138('0x21')](_0x1138('0x22'),_0x360735,_0x1138('0x20'),JSON['stringify'](_0x1e51be));if(_0x1e51be[_0x1138('0x23')]){if(_0x1e51be['error'][_0x1138('0x24')]===0x1f4){logger[_0x1138('0x23')]('FaxMessage,\x20%s,\x20%s',_0x360735,_0x1e51be[_0x1138('0x23')][_0x1138('0x25')]);return _0x2a1893(_0x1e51be['error'][_0x1138('0x25')]);}logger[_0x1138('0x23')](_0x1138('0x1f'),_0x360735,_0x1e51be[_0x1138('0x23')][_0x1138('0x25')]);return _0x39b828(_0x1e51be[_0x1138('0x23')][_0x1138('0x25')]);}else{logger['info'](_0x1138('0x1f'),_0x360735,_0x1138('0x20'));_0x39b828(_0x1e51be[_0x1138('0x26')]['message']);}})[_0x1138('0x27')](function(_0x42be63){logger[_0x1138('0x23')]('FaxMessage,\x20%s,\x20%s',_0x360735,_0x42be63);_0x2a1893(_0x42be63);});});}function respondWithStatusCode(_0x599045,_0x5089ec){_0x5089ec=_0x5089ec||0xcc;return function(_0x239807){if(_0x239807){return _0x599045['sendStatus'](_0x5089ec);}return _0x599045[_0x1138('0x28')](_0x5089ec)[_0x1138('0x29')]();};}function respondWithResult(_0x1c953b,_0x3413a6){_0x3413a6=_0x3413a6||0xc8;return function(_0x46ebb2){if(_0x46ebb2){return _0x1c953b[_0x1138('0x28')](_0x3413a6)[_0x1138('0x2a')](_0x46ebb2);}};}function respondWithFilteredResult(_0xf60229,_0x48cce9){return function(_0x1acea1){if(_0x1acea1){var _0x3a8cbf=typeof _0x48cce9[_0x1138('0x2b')]===_0x1138('0x2c')&&typeof _0x48cce9['limit']===_0x1138('0x2c');var _0x4f3737=_0x1acea1['count'];var _0x3492b5=_0x3a8cbf?0x0:_0x48cce9[_0x1138('0x2b')];var _0xd07034=_0x3a8cbf?_0x1acea1[_0x1138('0x2d')]:_0x48cce9[_0x1138('0x2b')]+_0x48cce9['limit'];var _0x5b94ce;if(_0xd07034>=_0x4f3737){_0xd07034=_0x4f3737;_0x5b94ce=0xc8;}else{_0x5b94ce=0xce;}_0xf60229[_0x1138('0x28')](_0x5b94ce);return _0xf60229['set'](_0x1138('0x2e'),_0x3492b5+'-'+_0xd07034+'/'+_0x4f3737)[_0x1138('0x2a')](_0x1acea1);}return null;};}function patchUpdates(_0x5138e4){return function(_0x532c5f){try{jsonpatch[_0x1138('0x2f')](_0x532c5f,_0x5138e4,!![]);}catch(_0x39bf76){return BPromise['reject'](_0x39bf76);}return _0x532c5f[_0x1138('0x30')]();};}function saveUpdates(_0x43a943,_0x184b3f){return function(_0x3cbc3e){if(_0x3cbc3e){return _0x3cbc3e[_0x1138('0x31')](_0x43a943)['then'](function(_0x26bfd6){return _0x26bfd6;});}return null;};}function removeEntity(_0x3d6ce1,_0x26b97f){return function(_0x38745b){if(_0x38745b){return _0x38745b[_0x1138('0x32')]()[_0x1138('0x1d')](function(){_0x3d6ce1[_0x1138('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45484a,_0x2e9fec){return function(_0xab9589){if(!_0xab9589){_0x45484a['sendStatus'](0x194);}return _0xab9589;};}function handleError(_0x203af1,_0x5b748d){_0x5b748d=_0x5b748d||0x1f4;return function(_0x5abaff){logger[_0x1138('0x23')](_0x5abaff[_0x1138('0x33')]);if(_0x5abaff['name']){delete _0x5abaff['name'];}_0x203af1[_0x1138('0x28')](_0x5b748d)[_0x1138('0x34')](_0x5abaff);};}exports[_0x1138('0x35')]=function(_0x491595,_0x28c74b){var _0xbdfe86={},_0xba5cd0={},_0x10ba7d={'count':0x0,'rows':[]};var _0x5a6124=_[_0x1138('0x36')](db[_0x1138('0x37')][_0x1138('0x38')],function(_0x5820ac){return{'name':_0x5820ac[_0x1138('0x39')],'type':_0x5820ac[_0x1138('0x3a')][_0x1138('0x3b')]};});_0xba5cd0[_0x1138('0x3c')]=_[_0x1138('0x36')](_0x5a6124,_0x1138('0x3d'));_0xba5cd0[_0x1138('0x3e')]=_[_0x1138('0x3f')](_0x491595['query']);_0xba5cd0[_0x1138('0x40')]=_[_0x1138('0x41')](_0xba5cd0['model'],_0xba5cd0[_0x1138('0x3e')]);_0xbdfe86[_0x1138('0x42')]=_[_0x1138('0x41')](_0xba5cd0['model'],qs[_0x1138('0x43')](_0x491595[_0x1138('0x3e')]['fields']));_0xbdfe86[_0x1138('0x42')]=_0xbdfe86[_0x1138('0x42')][_0x1138('0x44')]?_0xbdfe86[_0x1138('0x42')]:_0xba5cd0['model'];if(!_0x491595['query'][_0x1138('0x45')](_0x1138('0x46'))){_0xbdfe86[_0x1138('0x47')]=qs['limit'](_0x491595['query'][_0x1138('0x47')]);_0xbdfe86['offset']=qs[_0x1138('0x2b')](_0x491595[_0x1138('0x3e')][_0x1138('0x2b')]);}_0xbdfe86['order']=qs[_0x1138('0x48')](_0x491595[_0x1138('0x3e')][_0x1138('0x48')]);_0xbdfe86[_0x1138('0x49')]=qs[_0x1138('0x40')](_[_0x1138('0x4a')](_0x491595[_0x1138('0x3e')],_0xba5cd0[_0x1138('0x40')]),_0x5a6124);if(_0x491595[_0x1138('0x3e')]['filter']){_0xbdfe86[_0x1138('0x49')]=_[_0x1138('0x4b')](_0xbdfe86[_0x1138('0x49')],{'$or':_['map'](_0x5a6124,function(_0x5c1e97){if(_0x5c1e97[_0x1138('0x3a')]!==_0x1138('0x4c')){var _0x3078d2={};_0x3078d2[_0x5c1e97[_0x1138('0x3d')]]={'$like':'%'+_0x491595[_0x1138('0x3e')][_0x1138('0x4d')]+'%'};return _0x3078d2;}})});}_0xbdfe86=_[_0x1138('0x4b')]({},_0xbdfe86,_0x491595['options']);var _0x41fab4={'where':_0xbdfe86['where']};return db['FaxMessage'][_0x1138('0x2d')](_0x41fab4)['then'](function(_0x182873){_0x10ba7d[_0x1138('0x2d')]=_0x182873;if(_0x491595['query'][_0x1138('0x4e')]){_0xbdfe86['include']=[{'all':!![]}];}return db[_0x1138('0x37')]['findAll'](_0xbdfe86);})[_0x1138('0x1d')](function(_0x146465){_0x10ba7d[_0x1138('0x4f')]=_0x146465;return _0x10ba7d;})[_0x1138('0x1d')](respondWithFilteredResult(_0x28c74b,_0xbdfe86))[_0x1138('0x27')](handleError(_0x28c74b,null));};exports['show']=function(_0x2ced90,_0x407869){var _0x199377={'raw':!![],'where':{'id':_0x2ced90[_0x1138('0x50')]['id']}},_0x2658fa={};_0x2658fa['model']=_[_0x1138('0x3f')](db[_0x1138('0x37')][_0x1138('0x38')]);_0x2658fa[_0x1138('0x3e')]=_[_0x1138('0x3f')](_0x2ced90[_0x1138('0x3e')]);_0x2658fa['filters']=_[_0x1138('0x41')](_0x2658fa[_0x1138('0x3c')],_0x2658fa[_0x1138('0x3e')]);_0x199377[_0x1138('0x42')]=_[_0x1138('0x41')](_0x2658fa[_0x1138('0x3c')],qs[_0x1138('0x43')](_0x2ced90['query']['fields']));_0x199377[_0x1138('0x42')]=_0x199377[_0x1138('0x42')][_0x1138('0x44')]?_0x199377[_0x1138('0x42')]:_0x2658fa[_0x1138('0x3c')];if(_0x2ced90[_0x1138('0x3e')][_0x1138('0x4e')]){_0x199377[_0x1138('0x51')]=[{'all':!![]}];}_0x199377=_[_0x1138('0x4b')]({},_0x199377,_0x2ced90[_0x1138('0x52')]);return db[_0x1138('0x37')][_0x1138('0x53')](_0x199377)[_0x1138('0x1d')](handleEntityNotFound(_0x407869,null))[_0x1138('0x1d')](respondWithResult(_0x407869,null))[_0x1138('0x27')](handleError(_0x407869,null));};exports['update']=function(_0x1ab1dc,_0x19c048){if(_0x1ab1dc[_0x1138('0x54')]['id']){delete _0x1ab1dc[_0x1138('0x54')]['id'];}return db['FaxMessage']['find']({'where':{'id':_0x1ab1dc[_0x1138('0x50')]['id']}})[_0x1138('0x1d')](handleEntityNotFound(_0x19c048,null))[_0x1138('0x1d')](saveUpdates(_0x1ab1dc[_0x1138('0x54')],null))['then'](respondWithResult(_0x19c048,null))['catch'](handleError(_0x19c048,null));};exports[_0x1138('0x32')]=function(_0x6045db,_0x3c58af){return db['FaxMessage'][_0x1138('0x53')]({'where':{'id':_0x6045db[_0x1138('0x50')]['id']}})[_0x1138('0x1d')](handleEntityNotFound(_0x3c58af,null))[_0x1138('0x1d')](removeEntity(_0x3c58af,null))[_0x1138('0x27')](handleError(_0x3c58af,null));};exports['describe']=function(_0x257b51,_0x22264c){return db[_0x1138('0x37')]['describe']()[_0x1138('0x1d')](respondWithResult(_0x22264c,null))[_0x1138('0x27')](handleError(_0x22264c,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0x1138('0x55')]=function(_0x44443b,_0x3eafcf,_0x340f7d){var _0xf88f9c={'agent':{},'channel':_0x1138('0x56')};if(_0x44443b[_0x1138('0x54')]['id']){delete _0x44443b['body']['id'];}_0x44443b[_0x1138('0x54')]['read']=!![];_0x44443b[_0x1138('0x54')][_0x1138('0x57')]=moment()[_0x1138('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x44443b[_0x1138('0x54')][_0x1138('0x59')]=_0x44443b[_0x1138('0x54')][_0x1138('0x59')]||_0x44443b[_0x1138('0x5a')]['id'];_0xf88f9c[_0x1138('0x5b')]['id']=_0x44443b[_0x1138('0x54')][_0x1138('0x59')];return db[_0x1138('0x37')][_0x1138('0x53')]({'where':{'id':_0x44443b['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3eafcf,null))[_0x1138('0x1d')](saveUpdates(_0x44443b[_0x1138('0x54')],null))[_0x1138('0x1d')](function(_0xc328c7){if(_0xc328c7){_0xf88f9c[_0x1138('0x25')]=_0xc328c7[_0x1138('0x5c')]({'plain':!![]});return db['FaxInteraction'][_0x1138('0x53')]({'where':{'id':_0xc328c7[_0x1138('0x5d')]}});}return null;})[_0x1138('0x1d')](handleEntityNotFound(_0x3eafcf,null))['then'](function(_0xf36014){if(_0xf36014){return _0xf36014[_0x1138('0x31')]({'UserId':_0x44443b[_0x1138('0x54')][_0x1138('0x59')],'read1stAt':_[_0x1138('0x5e')](_0xf36014['read1stAt'])?moment()[_0x1138('0x58')](_0x1138('0x5f')):undefined});}return null;})['then'](function(_0x1d2c4){if(_0x1d2c4){_0xf88f9c[_0x1138('0x60')]=_0x1d2c4[_0x1138('0x5c')]({'plain':!![]});interaction_log[_0x1138('0x1e')](_0x1138('0x61'),_0x44443b[_0x1138('0x5a')]['id'],_0x44443b[_0x1138('0x5a')][_0x1138('0x3d')],_0x44443b[_0x1138('0x5a')]['role'],_0xf88f9c[_0x1138('0x60')]['id'],_0x44443b['body']?JSON[_0x1138('0x62')](_0x44443b[_0x1138('0x54')]):_0x1138('0x63'));return respondWithRpcPromise(_0x1138('0x64'),_0x1138('0x65'),_0xf88f9c);}return null;})[_0x1138('0x1d')](function(_0x2095d4){var _0x18bfdf=_0x1138('0x66')+_0x2095d4[_0x1138('0x25')]['ContactId'];return db[_0x1138('0x67')]['query'](_0x18bfdf,{'type':db[_0x1138('0x68')][_0x1138('0x69')][_0x1138('0x6a')],'raw':!![]})[_0x1138('0x1d')](function(_0xc155b3){return _0xc155b3;});})['then'](function(_0x1999ee){if(_0x1999ee){_0xf88f9c[_0x1138('0x25')][_0x1138('0x6b')]=_0x1999ee[0x0];if(!_0x44443b[_0x1138('0x54')]['UserId'])return;return db[_0x1138('0x6c')][_0x1138('0x53')]({'where':{'id':_0x44443b[_0x1138('0x54')][_0x1138('0x59')],'role':'agent'},'attributes':['id',_0x1138('0x3d'),_0x1138('0x6d'),_0x1138('0x6e'),_0x1138('0x6f')],'raw':!![]});}return null;})[_0x1138('0x1d')](function(_0x5b70e9){if(!_0x5b70e9)return null;_0xf88f9c[_0x1138('0x25')][_0x1138('0x5b')]=_0x5b70e9;return _0xf88f9c;})[_0x1138('0x1d')](function(_0x51273a){if(_0x51273a){if(_0x44443b[_0x1138('0x54')]['manual']){_0xf88f9c[_0x1138('0x25')][_0x1138('0x70')]=util[_0x1138('0x58')](_0x1138('0x71'),_0x44443b[_0x1138('0x5a')]['name']);_0xf88f9c['message'][_0x1138('0x72')]=_0xf88f9c['channel'];_0xf88f9c[_0x1138('0x25')]['motionChannel']=_0xf88f9c[_0x1138('0x72')];_0xf88f9c[_0x1138('0x25')]['event']='accept';return respondWithRpcPromise('EventManager',_0x1138('0x73'),{'event':_0x1138('0x74'),'message':_0xf88f9c[_0x1138('0x25')]},client9002)[_0x1138('0x1d')](function(){return _0xf88f9c;});}return _0xf88f9c;}return null;})['then'](respondWithResult(_0x3eafcf,null))[_0x1138('0x27')](handleError(_0x3eafcf,null));};var interaction_log=require(_0x1138('0x11'))(_0x1138('0x75'));exports[_0x1138('0x76')]=function(_0x489ab6,_0x151027,_0x28aec4){var _0x55dd38={'agent':{},'channel':'fax'};if(_0x489ab6[_0x1138('0x54')]['id']){delete _0x489ab6[_0x1138('0x54')]['id'];}_0x489ab6['body'][_0x1138('0x59')]=_0x489ab6[_0x1138('0x54')][_0x1138('0x59')]||_0x489ab6['user']['id'];_0x55dd38[_0x1138('0x5b')]['id']=_0x489ab6['body'][_0x1138('0x59')];return db[_0x1138('0x37')]['find']({'where':{'id':_0x489ab6['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x151027,null))[_0x1138('0x1d')](function(_0xd5d01b){if(_0xd5d01b){_0x55dd38['message']=_0xd5d01b[_0x1138('0x5c')]({'plain':!![]});return db[_0x1138('0x77')][_0x1138('0x53')]({'where':{'id':_0xd5d01b['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x151027,null))[_0x1138('0x1d')](function(_0x454fe9){if(_0x454fe9){_0x55dd38[_0x1138('0x60')]=_0x454fe9[_0x1138('0x5c')]({'plain':!![]});interaction_log[_0x1138('0x1e')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x489ab6['user']['id'],_0x489ab6[_0x1138('0x5a')][_0x1138('0x3d')],_0x489ab6[_0x1138('0x5a')][_0x1138('0x78')],_0x55dd38['interaction']['id'],_0x489ab6[_0x1138('0x54')]?JSON['stringify'](_0x489ab6[_0x1138('0x54')]):_0x1138('0x63'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x55dd38);}return null;})[_0x1138('0x1d')](function(_0x2c6cb2){var _0x469c40=_0x1138('0x66')+_0x2c6cb2[_0x1138('0x25')][_0x1138('0x79')];return db[_0x1138('0x67')][_0x1138('0x3e')](_0x469c40,{'type':db[_0x1138('0x68')][_0x1138('0x69')]['SELECT'],'raw':!![]})[_0x1138('0x1d')](function(_0x58bdcc){return _0x58bdcc;});})[_0x1138('0x1d')](function(_0x1669e6){if(_0x1669e6){_0x55dd38[_0x1138('0x25')][_0x1138('0x6b')]=_0x1669e6[0x0];if(!_0x489ab6['body'][_0x1138('0x59')])return;return db['User'][_0x1138('0x53')]({'where':{'id':_0x489ab6[_0x1138('0x54')][_0x1138('0x59')],'role':_0x1138('0x5b')},'attributes':['id',_0x1138('0x3d'),_0x1138('0x6d'),'email',_0x1138('0x6f')],'raw':!![]});}return null;})[_0x1138('0x1d')](function(_0x134028){if(!_0x134028)return null;_0x55dd38[_0x1138('0x25')][_0x1138('0x5b')]=_0x134028;return _0x55dd38;})[_0x1138('0x1d')](function(_0x4c9160){if(_0x4c9160){_0x4c9160[_0x1138('0x25')][_0x1138('0x70')]=util[_0x1138('0x58')](_0x1138('0x71'),_0x489ab6[_0x1138('0x5a')][_0x1138('0x3d')]);_0x4c9160[_0x1138('0x25')][_0x1138('0x72')]=_0x55dd38[_0x1138('0x72')];_0x4c9160[_0x1138('0x25')][_0x1138('0x7a')]=_0x55dd38['channel'];_0x4c9160[_0x1138('0x25')][_0x1138('0x7b')]='reject';respondWithRpcPromise('EventManager','EventManager',{'event':_0x1138('0x7c'),'message':_0x4c9160[_0x1138('0x25')]},client9002);return _0x55dd38;}return null;})[_0x1138('0x1d')](respondWithResult(_0x151027,null))[_0x1138('0x27')](handleError(_0x151027,null));};exports[_0x1138('0x7d')]=function(_0x46b2a4,_0x5834d6){var _0x560179;return db[_0x1138('0x37')]['create'](_0x46b2a4['body'],{})[_0x1138('0x1d')](function(_0x3c62b2){_0x560179=_0x3c62b2;return db[_0x1138('0x7e')]['findOne']({'where':{'id':_0x560179[_0x1138('0x79')]}});})['then'](function(_0xf1a370){if(_[_0x1138('0x5e')](_0xf1a370)){return;}else{_0x560179[_0x1138('0x56')]=_0xf1a370['fax'];return db[_0x1138('0x7f')][_0x1138('0x80')]({'where':{'id':_0x560179['AttachmentId']}});}})[_0x1138('0x1d')](function(_0x3bb4a5){return respondWithRpcPromise(_0x1138('0x81'),_0x1138('0x81'),{'FaxAccountId':_[_0x1138('0x5e')](_0x46b2a4[_0x1138('0x54')])?undefined:_0x46b2a4[_0x1138('0x54')][_0x1138('0x82')],'path':_['isNil'](_0x3bb4a5)?undefined:util[_0x1138('0x58')](_0x1138('0x83'),_0x3bb4a5['basename']),'fax':_[_0x1138('0x5e')](_0x560179[_0x1138('0x56')])?undefined:_0x560179['fax'],'AttachmentId':_0x560179['AttachmentId']},client9002);})[_0x1138('0x1d')](respondWithResult(_0x5834d6,0xc9))['catch'](handleError(_0x5834d6,null));};exports[_0x1138('0x84')]=function(_0x46b45c,_0x37492a){var _0x3e7e22=path['join'](config[_0x1138('0x85')],_0x1138('0x86'),_0x1138('0x87'),_0x1138('0x88'));return db[_0x1138('0x37')][_0x1138('0x53')]({'where':{'id':_0x46b45c[_0x1138('0x50')]['id']},'include':[{'model':db[_0x1138('0x7f')],'as':'Attachment'}]})[_0x1138('0x1d')](handleEntityNotFound(_0x37492a,null))[_0x1138('0x1d')](function(_0x3d5d5c){if(_0x3d5d5c){return _0x37492a[_0x1138('0x84')](path[_0x1138('0x89')](_0x3e7e22,_0x3d5d5c['Attachment'][_0x1138('0x8a')]));}})[_0x1138('0x27')](handleError(_0x37492a,null));};
\ No newline at end of file
index a81ebc7..4c0d5dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcedf=['setMaxListeners','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','FaxMessage'];(function(_0x3fca67,_0x2e419a){var _0x521248=function(_0x4cd267){while(--_0x4cd267){_0x3fca67['push'](_0x3fca67['shift']());}};_0x521248(++_0x2e419a);}(_0xcedf,0x1b6));var _0xfced=function(_0x3900b3,_0x400f56){_0x3900b3=_0x3900b3-0x0;var _0x53d047=_0xcedf[_0x3900b3];return _0x53d047;};'use strict';var EventEmitter=require(_0xfced('0x0'));var FaxMessage=require(_0xfced('0x1'))['db'][_0xfced('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xfced('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfced('0x4'),'afterDestroy':_0xfced('0x5')};function emitEvent(_0x4c426b){return function(_0x5b16af,_0x1dad76,_0x4a86d5){FaxMessageEvents[_0xfced('0x6')](_0x4c426b+':'+_0x5b16af['id'],_0x5b16af);FaxMessageEvents['emit'](_0x4c426b,_0x5b16af);_0x4a86d5(null);};}for(var e in events){if(events[_0xfced('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0xfced('0x8')]=FaxMessageEvents;
\ No newline at end of file
+var _0xd386=['FaxMessage','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x17e0af,_0x28e8f5){var _0x4b4266=function(_0x1100e1){while(--_0x1100e1){_0x17e0af['push'](_0x17e0af['shift']());}};_0x4b4266(++_0x28e8f5);}(_0xd386,0x10c));var _0x6d38=function(_0x3ad7ad,_0x291a8d){_0x3ad7ad=_0x3ad7ad-0x0;var _0x225a60=_0xd386[_0x3ad7ad];return _0x225a60;};'use strict';var EventEmitter=require(_0x6d38('0x0'));var FaxMessage=require(_0x6d38('0x1'))['db'][_0x6d38('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6d38('0x3'),'afterUpdate':_0x6d38('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1ce7c5){return function(_0x21b7ee,_0x97f669,_0xa6b2b3){FaxMessageEvents['emit'](_0x1ce7c5+':'+_0x21b7ee['id'],_0x21b7ee);FaxMessageEvents[_0x6d38('0x5')](_0x1ce7c5,_0x21b7ee);_0xa6b2b3(null);};}for(var e in events){if(events[_0x6d38('0x6')](e)){var event=events[e];FaxMessage[_0x6d38('0x7')](e,emitEvent(event));}}module[_0x6d38('0x8')]=FaxMessageEvents;
\ No newline at end of file
index c2723a6..77fd019 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ae5=['error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch'];(function(_0x2b45b5,_0x474458){var _0x1d9c06=function(_0x9a3264){while(--_0x9a3264){_0x2b45b5['push'](_0x2b45b5['shift']());}};_0x1d9c06(++_0x474458);}(_0x2ae5,0x1a7));var _0x52ae=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x2ae5[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0x52ae('0x0'));var util=require(_0x52ae('0x1'));var logger=require(_0x52ae('0x2'))(_0x52ae('0x3'));var moment=require(_0x52ae('0x4'));var BPromise=require(_0x52ae('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x52ae('0x6'));var rimraf=require('rimraf');var config=require(_0x52ae('0x7'));var attributes=require('./faxMessage.attributes');module[_0x52ae('0x8')]=function(_0x368513,_0xf45f91){return _0x368513['define']('FaxMessage',attributes,{'tableName':_0x52ae('0x9'),'paranoid':![],'indexes':[{'name':_0x52ae('0xa'),'fields':[_0x52ae('0xb')],'type':_0x52ae('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3a0b3d,_0x4a96a8,_0x6eb63e){var _0x42c505=_0x368513[_0x52ae('0xd')];var _0x21a661=_0x3a0b3d[_0x52ae('0xe')]({'plain':!![]});if(_0x21a661[_0x52ae('0xf')][_0x52ae('0x10')]()==='in'||_0x21a661[_0x52ae('0xf')][_0x52ae('0x10')]()===_0x52ae('0x11')&&!_0x21a661[_0x52ae('0x12')]&&!_['isNil'](_0x21a661[_0x52ae('0x13')])){_0x42c505[_0x52ae('0x14')][_0x52ae('0x15')]({'where':{'id':_0x21a661[_0x52ae('0x16')]}})[_0x52ae('0x17')](function(_0x34d71c){if(_0x34d71c){_0x34d71c[_0x52ae('0x18')]({'lastMsgAt':_0x21a661[_0x52ae('0x19')],'lastMsgDirection':_0x21a661[_0x52ae('0xf')][_0x52ae('0x10')]()});}})[_0x52ae('0x1a')](function(_0x57ff1c){console[_0x52ae('0x1b')](_0x57ff1c);});}_0x6eb63e();}},'charset':_0x52ae('0x1c'),'collate':_0x52ae('0x1d')});};
\ No newline at end of file
+var _0x85d0=['../../config/environment','./faxMessage.attributes','FaxMessage','fax_messages','body','FULLTEXT','get','toLowerCase','secret','isNil','FaxInteraction','findOne','FaxInteractionId','then','createdAt','direction','catch','error','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x46a930,_0x4a77ce){var _0x8822a=function(_0x4c1c69){while(--_0x4c1c69){_0x46a930['push'](_0x46a930['shift']());}};_0x8822a(++_0x4a77ce);}(_0x85d0,0x170));var _0x085d=function(_0x40c443,_0x1c851b){_0x40c443=_0x40c443-0x0;var _0x28e0e9=_0x85d0[_0x40c443];return _0x28e0e9;};'use strict';var _=require(_0x085d('0x0'));var util=require(_0x085d('0x1'));var logger=require(_0x085d('0x2'))(_0x085d('0x3'));var moment=require(_0x085d('0x4'));var BPromise=require(_0x085d('0x5'));var rp=require(_0x085d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x085d('0x7'));var attributes=require(_0x085d('0x8'));module['exports']=function(_0x1d33da,_0x4f89ba){return _0x1d33da['define'](_0x085d('0x9'),attributes,{'tableName':_0x085d('0xa'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x085d('0xb')],'type':_0x085d('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x47575f,_0x3d7898,_0x121990){var _0x2e00bf=_0x1d33da['models'];var _0x5641d4=_0x47575f[_0x085d('0xd')]({'plain':!![]});if(_0x5641d4['direction'][_0x085d('0xe')]()==='in'||_0x5641d4['direction'][_0x085d('0xe')]()==='out'&&!_0x5641d4[_0x085d('0xf')]&&!_[_0x085d('0x10')](_0x5641d4['UserId'])){_0x2e00bf[_0x085d('0x11')][_0x085d('0x12')]({'where':{'id':_0x5641d4[_0x085d('0x13')]}})[_0x085d('0x14')](function(_0x5f2ffd){if(_0x5f2ffd){_0x5f2ffd['update']({'lastMsgAt':_0x5641d4[_0x085d('0x15')],'lastMsgDirection':_0x5641d4[_0x085d('0x16')]['toLowerCase']()});}})[_0x085d('0x17')](function(_0x83348c){console[_0x085d('0x18')](_0x83348c);});}_0x121990();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 55a4671..be05b32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00bb=['redis','defaults','localhost','socket.io-emitter','then','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','FaxMessage,\x20%s,\x20%s','CreateFaxMessage','FaxMessage','create','body','options','raw','catch','update','attributes','UpdateFaxMessage','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x5f17d0,_0x16a2cf){var _0x39c744=function(_0x58d5ae){while(--_0x58d5ae){_0x5f17d0['push'](_0x5f17d0['shift']());}};_0x39c744(++_0x16a2cf);}(_0x00bb,0x1d8));var _0xb00b=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x00bb[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xb00b('0x8')]=_[_0xb00b('0x9')](config[_0xb00b('0x8')],{'host':_0xb00b('0xa'),'port':0x18eb});var socket=require(_0xb00b('0xb'))(new Redis(config[_0xb00b('0x8')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x5154d9,_0x1e9b7b,_0x5851d4){return new BPromise(function(_0x46a25c,_0x28d3cc){return client['request'](_0x5154d9,_0x5851d4)[_0xb00b('0xc')](function(_0x5a63ed){logger['info']('FaxMessage,\x20%s,\x20%s',_0x1e9b7b,_0xb00b('0xd'));logger[_0xb00b('0xe')](_0xb00b('0xf'),_0x1e9b7b,_0xb00b('0xd'),JSON[_0xb00b('0x10')](_0x5a63ed));if(_0x5a63ed[_0xb00b('0x11')]){if(_0x5a63ed['error'][_0xb00b('0x12')]===0x1f4){logger[_0xb00b('0x11')]('FaxMessage,\x20%s,\x20%s',_0x1e9b7b,_0x5a63ed[_0xb00b('0x11')][_0xb00b('0x13')]);return _0x28d3cc(_0x5a63ed['error']['message']);}logger[_0xb00b('0x11')]('FaxMessage,\x20%s,\x20%s',_0x1e9b7b,_0x5a63ed['error'][_0xb00b('0x13')]);return _0x46a25c(_0x5a63ed[_0xb00b('0x11')][_0xb00b('0x13')]);}else{logger[_0xb00b('0x14')]('FaxMessage,\x20%s,\x20%s',_0x1e9b7b,_0xb00b('0xd'));_0x46a25c(_0x5a63ed['result'][_0xb00b('0x13')]);}})['catch'](function(_0x25d7a0){logger['error'](_0xb00b('0x15'),_0x1e9b7b,_0x25d7a0);_0x28d3cc(_0x25d7a0);});});}exports[_0xb00b('0x16')]=function(_0x53ee68){var _0x55770c=this;return new Promise(function(_0x2b0da1,_0x4a334b){return db[_0xb00b('0x17')][_0xb00b('0x18')](_0x53ee68[_0xb00b('0x19')],{'raw':_0x53ee68[_0xb00b('0x1a')]?_0x53ee68['options'][_0xb00b('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x25a973){logger[_0xb00b('0x14')]('CreateFaxMessage',_0x53ee68);logger[_0xb00b('0xe')](_0xb00b('0x16'),_0x53ee68,JSON['stringify'](_0x25a973));_0x2b0da1(_0x25a973);})[_0xb00b('0x1c')](function(_0x1f04d3){logger['error'](_0xb00b('0x16'),_0x1f04d3[_0xb00b('0x13')],_0x53ee68);_0x4a334b(_0x55770c[_0xb00b('0x11')](0x1f4,_0x1f04d3[_0xb00b('0x13')]));});});};exports['UpdateFaxMessage']=function(_0x50be6c){var _0x3785e9=this;return new Promise(function(_0x490380,_0x550587){return db['FaxMessage'][_0xb00b('0x1d')](_0x50be6c[_0xb00b('0x19')],{'raw':_0x50be6c[_0xb00b('0x1a')]?_0x50be6c[_0xb00b('0x1a')][_0xb00b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50be6c[_0xb00b('0x1a')]?_0x50be6c[_0xb00b('0x1a')]['where']||null:null,'attributes':_0x50be6c[_0xb00b('0x1a')]?_0x50be6c['options'][_0xb00b('0x1e')]||null:null,'limit':_0x50be6c[_0xb00b('0x1a')]?_0x50be6c[_0xb00b('0x1a')]['limit']||null:null})[_0xb00b('0xc')](function(_0x280ed3){logger[_0xb00b('0x14')](_0xb00b('0x1f'),_0x50be6c);logger[_0xb00b('0xe')](_0xb00b('0x1f'),_0x50be6c,JSON[_0xb00b('0x10')](_0x280ed3));_0x490380(_0x280ed3);})[_0xb00b('0x1c')](function(_0x149c1a){logger['error'](_0xb00b('0x1f'),_0x149c1a[_0xb00b('0x13')],_0x50be6c);_0x550587(_0x3785e9['error'](0x1f4,_0x149c1a[_0xb00b('0x13')]));});});};
\ No newline at end of file
+var _0x0e85=['catch','FaxMessage','create','body','options','raw','info','CreateFaxMessage','UpdateFaxMessage','update','where','attributes','limit','lodash','util','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','request','then','request\x20sent','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result'];(function(_0x519ee0,_0x7412ab){var _0x5d8910=function(_0x21305c){while(--_0x21305c){_0x519ee0['push'](_0x519ee0['shift']());}};_0x5d8910(++_0x7412ab);}(_0x0e85,0x7c));var _0x50e8=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0x0e85[_0x46d0c9];return _0x174506;};'use strict';var _=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var moment=require('moment');var BPromise=require(_0x50e8('0x2'));var rs=require(_0x50e8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x50e8('0x4'))('rpc');var config=require(_0x50e8('0x5'));var jayson=require(_0x50e8('0x6'));var client=jayson[_0x50e8('0x7')][_0x50e8('0x8')]({'port':0x232a});config['redis']=_[_0x50e8('0x9')](config[_0x50e8('0xa')],{'host':_0x50e8('0xb'),'port':0x18eb});var socket=require(_0x50e8('0xc'))(new Redis(config[_0x50e8('0xa')]));require(_0x50e8('0xd'))['register'](socket);function respondWithRpcPromise(_0x11717c,_0x228ed1,_0x19d1bc){return new BPromise(function(_0x2d4750,_0x154b9e){return client[_0x50e8('0xe')](_0x11717c,_0x19d1bc)[_0x50e8('0xf')](function(_0x3d25ea){logger['info']('FaxMessage,\x20%s,\x20%s',_0x228ed1,_0x50e8('0x10'));logger[_0x50e8('0x11')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x228ed1,'request\x20sent',JSON[_0x50e8('0x12')](_0x3d25ea));if(_0x3d25ea[_0x50e8('0x13')]){if(_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x14')]===0x1f4){logger['error'](_0x50e8('0x15'),_0x228ed1,_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x16')]);return _0x154b9e(_0x3d25ea['error']['message']);}logger[_0x50e8('0x13')](_0x50e8('0x15'),_0x228ed1,_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x16')]);return _0x2d4750(_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x16')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x228ed1,_0x50e8('0x10'));_0x2d4750(_0x3d25ea[_0x50e8('0x17')][_0x50e8('0x16')]);}})[_0x50e8('0x18')](function(_0x5dae4e){logger[_0x50e8('0x13')](_0x50e8('0x15'),_0x228ed1,_0x5dae4e);_0x154b9e(_0x5dae4e);});});}exports['CreateFaxMessage']=function(_0x415596){var _0x55997c=this;return new Promise(function(_0x4d2318,_0xe04a5c){return db[_0x50e8('0x19')][_0x50e8('0x1a')](_0x415596[_0x50e8('0x1b')],{'raw':_0x415596['options']?_0x415596[_0x50e8('0x1c')][_0x50e8('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x31d23c){logger[_0x50e8('0x1e')]('CreateFaxMessage',_0x415596);logger[_0x50e8('0x11')](_0x50e8('0x1f'),_0x415596,JSON['stringify'](_0x31d23c));_0x4d2318(_0x31d23c);})['catch'](function(_0x59582d){logger[_0x50e8('0x13')](_0x50e8('0x1f'),_0x59582d[_0x50e8('0x16')],_0x415596);_0xe04a5c(_0x55997c[_0x50e8('0x13')](0x1f4,_0x59582d[_0x50e8('0x16')]));});});};exports[_0x50e8('0x20')]=function(_0x53d848){var _0x3a6442=this;return new Promise(function(_0x396611,_0x4b3a09){return db[_0x50e8('0x19')][_0x50e8('0x21')](_0x53d848[_0x50e8('0x1b')],{'raw':_0x53d848[_0x50e8('0x1c')]?_0x53d848['options'][_0x50e8('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53d848['options']?_0x53d848[_0x50e8('0x1c')][_0x50e8('0x22')]||null:null,'attributes':_0x53d848[_0x50e8('0x1c')]?_0x53d848['options'][_0x50e8('0x23')]||null:null,'limit':_0x53d848[_0x50e8('0x1c')]?_0x53d848[_0x50e8('0x1c')][_0x50e8('0x24')]||null:null})[_0x50e8('0xf')](function(_0x18aa31){logger[_0x50e8('0x1e')]('UpdateFaxMessage',_0x53d848);logger[_0x50e8('0x11')](_0x50e8('0x20'),_0x53d848,JSON['stringify'](_0x18aa31));_0x396611(_0x18aa31);})['catch'](function(_0x329b9c){logger[_0x50e8('0x13')](_0x50e8('0x20'),_0x329b9c['message'],_0x53d848);_0x4b3a09(_0x3a6442['error'](0x1f4,_0x329b9c[_0x50e8('0x16')]));});});};
\ No newline at end of file
index e0ed13d..3a3f0a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f15=['./faxMessage.events','save','remove','update','removeListener','register','length','faxMessage:'];(function(_0x4980e2,_0x200972){var _0x2b19ce=function(_0x473b31){while(--_0x473b31){_0x4980e2['push'](_0x4980e2['shift']());}};_0x2b19ce(++_0x200972);}(_0x7f15,0xa8));var _0x57f1=function(_0x46aaf8,_0x379b43){_0x46aaf8=_0x46aaf8-0x0;var _0x1cff12=_0x7f15[_0x46aaf8];return _0x1cff12;};'use strict';var FaxMessageEvents=require(_0x57f1('0x0'));var events=[_0x57f1('0x1'),_0x57f1('0x2'),_0x57f1('0x3')];function createListener(_0x1da6c6,_0x2da985){return function(_0x3085fb){_0x2da985['emit'](_0x1da6c6,_0x3085fb);};}function removeListener(_0x182c59,_0x3286b4){return function(){FaxMessageEvents[_0x57f1('0x4')](_0x182c59,_0x3286b4);};}exports[_0x57f1('0x5')]=function(_0x59997){for(var _0x214fa6=0x0,_0x9d1c78=events[_0x57f1('0x6')];_0x214fa6<_0x9d1c78;_0x214fa6++){var _0x5de9a1=events[_0x214fa6];var _0x4ff08b=createListener(_0x57f1('0x7')+_0x5de9a1,_0x59997);FaxMessageEvents['on'](_0x5de9a1,_0x4ff08b);}};
\ No newline at end of file
+var _0x35bf=['length','faxMessage:','./faxMessage.events','save','remove','update','removeListener','register'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x35bf,0xa2));var _0xf35b=function(_0x3514e4,_0x19fe27){_0x3514e4=_0x3514e4-0x0;var _0x3b5cb6=_0x35bf[_0x3514e4];return _0x3b5cb6;};'use strict';var FaxMessageEvents=require(_0xf35b('0x0'));var events=[_0xf35b('0x1'),_0xf35b('0x2'),_0xf35b('0x3')];function createListener(_0x147b5d,_0x4e28ae){return function(_0x52e36c){_0x4e28ae['emit'](_0x147b5d,_0x52e36c);};}function removeListener(_0x4553a6,_0x4c48fd){return function(){FaxMessageEvents[_0xf35b('0x4')](_0x4553a6,_0x4c48fd);};}exports[_0xf35b('0x5')]=function(_0x3af58b){for(var _0xa1c35c=0x0,_0x2f308f=events[_0xf35b('0x6')];_0xa1c35c<_0x2f308f;_0xa1c35c++){var _0x29b48d=events[_0xa1c35c];var _0x3c5c20=createListener(_0xf35b('0x7')+_0x29b48d,_0x3af58b);FaxMessageEvents['on'](_0x29b48d,_0x3c5c20);}};
\ No newline at end of file
index e137567..ea93b0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7072=['/:id/download','download','post','tracked','fax','faxmessage:create','create','put','accept','/:id/reject','delete','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x4976ed,_0x5ff3ce){var _0x5122b4=function(_0x31184d){while(--_0x31184d){_0x4976ed['push'](_0x4976ed['shift']());}};_0x5122b4(++_0x5ff3ce);}(_0x7072,0x138));var _0x2707=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x7072[_0xfae23b];return _0x200640;};'use strict';var multer=require('multer');var util=require(_0x2707('0x0'));var path=require(_0x2707('0x1'));var timeout=require(_0x2707('0x2'));var express=require(_0x2707('0x3'));var router=express[_0x2707('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2707('0x5'));var config=require('../../config/environment');var controller=require(_0x2707('0x6'));router[_0x2707('0x7')]('/',auth[_0x2707('0x8')](),controller[_0x2707('0x9')]);router[_0x2707('0x7')](_0x2707('0xa'),auth[_0x2707('0x8')](),controller[_0x2707('0xb')]);router[_0x2707('0x7')](_0x2707('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x2707('0x7')](_0x2707('0xd'),auth[_0x2707('0x8')](),controller[_0x2707('0xe')]);router[_0x2707('0xf')]('/',auth[_0x2707('0x8')](),interaction[_0x2707('0x10')](_0x2707('0x11'),_0x2707('0x12')),controller[_0x2707('0x13')]);router[_0x2707('0x14')](_0x2707('0xc'),auth[_0x2707('0x8')](),controller['update']);router[_0x2707('0x14')]('/:id/accept',auth[_0x2707('0x8')](),controller[_0x2707('0x15')]);router[_0x2707('0x14')](_0x2707('0x16'),auth[_0x2707('0x8')](),controller['reject']);router[_0x2707('0x17')](_0x2707('0xc'),auth[_0x2707('0x8')](),controller['destroy']);module[_0x2707('0x18')]=router;
\ No newline at end of file
+var _0xaa88=['describe','get','show','download','post','fax','faxmessage:create','put','/:id','/:id/accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','index','/describe','isAuthenticated'];(function(_0x19e915,_0x3ac017){var _0x23c76c=function(_0x50ab75){while(--_0x50ab75){_0x19e915['push'](_0x19e915['shift']());}};_0x23c76c(++_0x3ac017);}(_0xaa88,0x137));var _0x8aa8=function(_0x3a0c4f,_0x5dd1a3){_0x3a0c4f=_0x3a0c4f-0x0;var _0x247049=_0xaa88[_0x3a0c4f];return _0x247049;};'use strict';var multer=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var path=require(_0x8aa8('0x2'));var timeout=require(_0x8aa8('0x3'));var express=require('express');var router=express[_0x8aa8('0x4')]();var fs_extra=require(_0x8aa8('0x5'));var auth=require(_0x8aa8('0x6'));var interaction=require(_0x8aa8('0x7'));var config=require(_0x8aa8('0x8'));var controller=require(_0x8aa8('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x8aa8('0xa')]);router['get'](_0x8aa8('0xb'),auth[_0x8aa8('0xc')](),controller[_0x8aa8('0xd')]);router[_0x8aa8('0xe')]('/:id',auth[_0x8aa8('0xc')](),controller[_0x8aa8('0xf')]);router[_0x8aa8('0xe')]('/:id/download',auth[_0x8aa8('0xc')](),controller[_0x8aa8('0x10')]);router[_0x8aa8('0x11')]('/',auth[_0x8aa8('0xc')](),interaction['tracked'](_0x8aa8('0x12'),_0x8aa8('0x13')),controller['create']);router[_0x8aa8('0x14')](_0x8aa8('0x15'),auth[_0x8aa8('0xc')](),controller['update']);router[_0x8aa8('0x14')](_0x8aa8('0x16'),auth[_0x8aa8('0xc')](),controller['accept']);router[_0x8aa8('0x14')]('/:id/reject',auth['isAuthenticated'](),controller[_0x8aa8('0x17')]);router[_0x8aa8('0x18')](_0x8aa8('0x15'),auth[_0x8aa8('0xc')](),controller[_0x8aa8('0x19')]);module[_0x8aa8('0x1a')]=router;
\ No newline at end of file
index 4dae4d8..6f8d514 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c27=['STRING','INTEGER','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x314d55,_0x6a083){var _0x745d61=function(_0x4eb48c){while(--_0x4eb48c){_0x314d55['push'](_0x314d55['shift']());}};_0x745d61(++_0x6a083);}(_0x2c27,0x9f));var _0x72c2=function(_0x53e8b0,_0x2032a4){_0x53e8b0=_0x53e8b0-0x0;var _0x11c6a6=_0x2c27[_0x53e8b0];return _0x11c6a6;};'use strict';var Sequelize=require(_0x72c2('0x0'));module[_0x72c2('0x1')]={'name':{'type':Sequelize[_0x72c2('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x72c2('0x2')]},'timeout':{'type':Sequelize[_0x72c2('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x72c2('0x4'),_0x72c2('0x5'),_0x72c2('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x72c2('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x7e0a=['ENUM','beepall','roundrobin','sequelize','STRING','name','INTEGER'];(function(_0x708c33,_0x57e9f2){var _0xe5e059=function(_0x209937){while(--_0x209937){_0x708c33['push'](_0x708c33['shift']());}};_0xe5e059(++_0x57e9f2);}(_0x7e0a,0x15a));var _0xa7e0=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x7e0a[_0x82129b];return _0x2ae5dc;};'use strict';var Sequelize=require(_0xa7e0('0x0'));module['exports']={'name':{'type':Sequelize[_0xa7e0('0x1')],'unique':_0xa7e0('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa7e0('0x1')]},'timeout':{'type':Sequelize[_0xa7e0('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa7e0('0x4')]('rrmemory',_0xa7e0('0x5'),_0xa7e0('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 55a65ef..873ba5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ef2=['send','index','map','FaxQueue','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','findOne','UserFaxQueue','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','faxPause','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','each','forEach','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','sequelize','toString','SELECT','every','TeamId','includes','all','compact','value','transaction','removeTeams','isEmpty','removeAgents','emit','userFaxQueue:remove','addAgents','userFaxQueue:save','isArray','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','update','destroy','then','get','FaxQueues','UserProfileResource','sendStatus','error','stack','name'];(function(_0x3c6835,_0x952d5c){var _0x1adeb9=function(_0xfefab3){while(--_0xfefab3){_0x3c6835['push'](_0x3c6835['shift']());}};_0x1adeb9(++_0x952d5c);}(_0x7ef2,0xe9));var _0x27ef=function(_0x5cb070,_0x22677e){_0x5cb070=_0x5cb070-0x0;var _0x383029=_0x7ef2[_0x5cb070];return _0x383029;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x27ef('0x0'));var jsonpatch=require(_0x27ef('0x1'));var rp=require(_0x27ef('0x2'));var moment=require(_0x27ef('0x3'));var BPromise=require(_0x27ef('0x4'));var Mustache=require(_0x27ef('0x5'));var util=require(_0x27ef('0x6'));var path=require(_0x27ef('0x7'));var sox=require(_0x27ef('0x8'));var csv=require(_0x27ef('0x9'));var ejs=require(_0x27ef('0xa'));var fs=require('fs');var fs_extra=require(_0x27ef('0xb'));var _=require(_0x27ef('0xc'));var squel=require(_0x27ef('0xd'));var crypto=require(_0x27ef('0xe'));var jsforce=require(_0x27ef('0xf'));var deskjs=require(_0x27ef('0x10'));var toCsv=require(_0x27ef('0x9'));var querystring=require('querystring');var Papa=require(_0x27ef('0x11'));var Redis=require(_0x27ef('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x27ef('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x27ef('0x14'))(_0x27ef('0x15'));var utils=require(_0x27ef('0x16'));var config=require(_0x27ef('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x27ef('0x18')]=_['defaults'](config[_0x27ef('0x18')],{'host':_0x27ef('0x19'),'port':0x18eb});var socket=require(_0x27ef('0x1a'))(new Redis(config[_0x27ef('0x18')]));require('./faxQueue.socket')['register'](socket);function respondWithStatusCode(_0x569a2e,_0x2aae0f){_0x2aae0f=_0x2aae0f||0xcc;return function(_0x30f834){if(_0x30f834){return _0x569a2e['sendStatus'](_0x2aae0f);}return _0x569a2e[_0x27ef('0x1b')](_0x2aae0f)[_0x27ef('0x1c')]();};}function respondWithResult(_0x3702f5,_0x14f1cc){_0x14f1cc=_0x14f1cc||0xc8;return function(_0x4a7992){if(_0x4a7992){return _0x3702f5[_0x27ef('0x1b')](_0x14f1cc)[_0x27ef('0x1d')](_0x4a7992);}};}function respondWithFilteredResult(_0xe4039b,_0x5f0f7b){return function(_0x517087){if(_0x517087){var _0x504023=typeof _0x5f0f7b[_0x27ef('0x1e')]==='undefined'&&typeof _0x5f0f7b[_0x27ef('0x1f')]===_0x27ef('0x20');var _0x4ff8bc=_0x517087['count'];var _0x5770df=_0x504023?0x0:_0x5f0f7b[_0x27ef('0x1e')];var _0x1a3e72=_0x504023?_0x517087[_0x27ef('0x21')]:_0x5f0f7b[_0x27ef('0x1e')]+_0x5f0f7b['limit'];var _0x2b928a;if(_0x1a3e72>=_0x4ff8bc){_0x1a3e72=_0x4ff8bc;_0x2b928a=0xc8;}else{_0x2b928a=0xce;}_0xe4039b[_0x27ef('0x1b')](_0x2b928a);return _0xe4039b['set'](_0x27ef('0x22'),_0x5770df+'-'+_0x1a3e72+'/'+_0x4ff8bc)[_0x27ef('0x1d')](_0x517087);}return null;};}function patchUpdates(_0x1e28b5){return function(_0x4cf8cd){try{jsonpatch['apply'](_0x4cf8cd,_0x1e28b5,!![]);}catch(_0x2d92f1){return BPromise[_0x27ef('0x23')](_0x2d92f1);}return _0x4cf8cd[_0x27ef('0x24')]();};}function saveUpdates(_0x303b43,_0x30ac73){return function(_0x5f0ce7){if(_0x5f0ce7){return _0x5f0ce7[_0x27ef('0x25')](_0x303b43)['then'](function(_0x34746c){return _0x34746c;});}return null;};}function removeEntity(_0x4b2d1e,_0x584535){return function(_0x3192c9){if(_0x3192c9){return _0x3192c9[_0x27ef('0x26')]()[_0x27ef('0x27')](function(){var _0x3a3993=_0x3192c9[_0x27ef('0x28')]({'plain':!![]});var _0x4a9897=_0x27ef('0x29');return db[_0x27ef('0x2a')][_0x27ef('0x26')]({'where':{'type':_0x4a9897,'resourceId':_0x3a3993['id']}})['then'](function(){return _0x3192c9;});})[_0x27ef('0x27')](function(){_0x4b2d1e[_0x27ef('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d8e71,_0x177347){return function(_0x1a9a28){if(!_0x1a9a28){_0x5d8e71[_0x27ef('0x2b')](0x194);}return _0x1a9a28;};}function handleError(_0x431d1a,_0x2659a9){_0x2659a9=_0x2659a9||0x1f4;return function(_0x3adbf3){logger[_0x27ef('0x2c')](_0x3adbf3[_0x27ef('0x2d')]);if(_0x3adbf3[_0x27ef('0x2e')]){delete _0x3adbf3[_0x27ef('0x2e')];}_0x431d1a[_0x27ef('0x1b')](_0x2659a9)[_0x27ef('0x2f')](_0x3adbf3);};}exports[_0x27ef('0x30')]=function(_0x4f6ce5,_0xf0778a){var _0x5c24d9={},_0x2a6213={},_0x22f250={'count':0x0,'rows':[]};var _0x2bb94e=_[_0x27ef('0x31')](db[_0x27ef('0x32')]['rawAttributes'],function(_0x235d15){return{'name':_0x235d15[_0x27ef('0x33')],'type':_0x235d15[_0x27ef('0x34')][_0x27ef('0x35')]};});_0x2a6213['model']=_[_0x27ef('0x31')](_0x2bb94e,_0x27ef('0x2e'));_0x2a6213[_0x27ef('0x36')]=_[_0x27ef('0x37')](_0x4f6ce5[_0x27ef('0x36')]);_0x2a6213['filters']=_[_0x27ef('0x38')](_0x2a6213[_0x27ef('0x39')],_0x2a6213[_0x27ef('0x36')]);_0x5c24d9[_0x27ef('0x3a')]=_[_0x27ef('0x38')](_0x2a6213['model'],qs[_0x27ef('0x3b')](_0x4f6ce5[_0x27ef('0x36')][_0x27ef('0x3b')]));_0x5c24d9['attributes']=_0x5c24d9[_0x27ef('0x3a')][_0x27ef('0x3c')]?_0x5c24d9[_0x27ef('0x3a')]:_0x2a6213[_0x27ef('0x39')];if(!_0x4f6ce5['query'][_0x27ef('0x3d')](_0x27ef('0x3e'))){_0x5c24d9[_0x27ef('0x1f')]=qs[_0x27ef('0x1f')](_0x4f6ce5[_0x27ef('0x36')]['limit']);_0x5c24d9[_0x27ef('0x1e')]=qs['offset'](_0x4f6ce5[_0x27ef('0x36')]['offset']);}_0x5c24d9[_0x27ef('0x3f')]=qs[_0x27ef('0x40')](_0x4f6ce5[_0x27ef('0x36')][_0x27ef('0x40')]);_0x5c24d9[_0x27ef('0x41')]=qs[_0x27ef('0x42')](_[_0x27ef('0x43')](_0x4f6ce5['query'],_0x2a6213['filters']),_0x2bb94e);if(_0x4f6ce5[_0x27ef('0x36')][_0x27ef('0x44')]){_0x5c24d9[_0x27ef('0x41')]=_[_0x27ef('0x45')](_0x5c24d9[_0x27ef('0x41')],{'$or':_['map'](_0x2bb94e,function(_0x5345db){if(_0x5345db[_0x27ef('0x34')]!=='VIRTUAL'){var _0x550b37={};_0x550b37[_0x5345db[_0x27ef('0x2e')]]={'$like':'%'+_0x4f6ce5[_0x27ef('0x36')]['filter']+'%'};return _0x550b37;}})});}_0x5c24d9=_[_0x27ef('0x45')]({},_0x5c24d9,_0x4f6ce5['options']);var _0x112883={'where':_0x5c24d9[_0x27ef('0x41')]};return db[_0x27ef('0x32')][_0x27ef('0x21')](_0x112883)['then'](function(_0x365d0b){_0x22f250[_0x27ef('0x21')]=_0x365d0b;if(_0x4f6ce5[_0x27ef('0x36')][_0x27ef('0x46')]){_0x5c24d9[_0x27ef('0x47')]=[{'all':!![]}];}return db['FaxQueue'][_0x27ef('0x48')](_0x5c24d9);})['then'](function(_0x3b45f9){_0x22f250[_0x27ef('0x49')]=_0x3b45f9;return _0x22f250;})['then'](respondWithFilteredResult(_0xf0778a,_0x5c24d9))[_0x27ef('0x4a')](handleError(_0xf0778a,null));};exports['show']=function(_0x320e31,_0x5f2db2){var _0x151306={'raw':!![],'where':{'id':_0x320e31[_0x27ef('0x4b')]['id']}},_0x3593d4={};_0x3593d4[_0x27ef('0x39')]=_['keys'](db[_0x27ef('0x32')][_0x27ef('0x4c')]);_0x3593d4[_0x27ef('0x36')]=_[_0x27ef('0x37')](_0x320e31[_0x27ef('0x36')]);_0x3593d4['filters']=_[_0x27ef('0x38')](_0x3593d4[_0x27ef('0x39')],_0x3593d4[_0x27ef('0x36')]);_0x151306[_0x27ef('0x3a')]=_[_0x27ef('0x38')](_0x3593d4['model'],qs[_0x27ef('0x3b')](_0x320e31[_0x27ef('0x36')][_0x27ef('0x3b')]));_0x151306[_0x27ef('0x3a')]=_0x151306[_0x27ef('0x3a')][_0x27ef('0x3c')]?_0x151306[_0x27ef('0x3a')]:_0x3593d4[_0x27ef('0x39')];if(_0x320e31[_0x27ef('0x36')][_0x27ef('0x46')]){_0x151306[_0x27ef('0x47')]=[{'all':!![]}];}_0x151306=_[_0x27ef('0x45')]({},_0x151306,_0x320e31[_0x27ef('0x4d')]);return db[_0x27ef('0x32')][_0x27ef('0x4e')](_0x151306)[_0x27ef('0x27')](handleEntityNotFound(_0x5f2db2,null))[_0x27ef('0x27')](respondWithResult(_0x5f2db2,null))[_0x27ef('0x4a')](handleError(_0x5f2db2,null));};exports[_0x27ef('0x4f')]=function(_0x528103,_0x1f1800){return db['FaxQueue'][_0x27ef('0x4f')](_0x528103[_0x27ef('0x50')],{})[_0x27ef('0x27')](function(_0x4ef289){var _0x179eb0=_0x528103[_0x27ef('0x51')][_0x27ef('0x28')]({'plain':!![]});if(!_0x179eb0)throw new Error(_0x27ef('0x52'));if(_0x179eb0[_0x27ef('0x53')]===_0x27ef('0x51')){var _0x4c122d=_0x4ef289[_0x27ef('0x28')]({'plain':!![]});var _0x16556f=_0x27ef('0x29');return db[_0x27ef('0x54')][_0x27ef('0x4e')]({'where':{'name':_0x16556f,'userProfileId':_0x179eb0[_0x27ef('0x55')]},'raw':!![]})[_0x27ef('0x27')](function(_0x4d1ec5){if(_0x4d1ec5&&_0x4d1ec5[_0x27ef('0x56')]===0x0){return db['UserProfileResource'][_0x27ef('0x4f')]({'name':_0x4c122d[_0x27ef('0x2e')],'resourceId':_0x4c122d['id'],'type':_0x4d1ec5[_0x27ef('0x2e')],'sectionId':_0x4d1ec5['id']},{})[_0x27ef('0x27')](function(){return _0x4ef289;});}else{return _0x4ef289;}})[_0x27ef('0x4a')](function(_0x1da0cd){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1da0cd);throw _0x1da0cd;});}return _0x4ef289;})['then'](respondWithResult(_0x1f1800,0xc9))['catch'](handleError(_0x1f1800,null));};exports[_0x27ef('0x25')]=function(_0xf9a205,_0x59ac2c){if(_0xf9a205[_0x27ef('0x50')]['id']){delete _0xf9a205['body']['id'];}return db[_0x27ef('0x32')][_0x27ef('0x4e')]({'where':{'id':_0xf9a205[_0x27ef('0x4b')]['id']}})[_0x27ef('0x27')](handleEntityNotFound(_0x59ac2c,null))[_0x27ef('0x27')](saveUpdates(_0xf9a205[_0x27ef('0x50')],null))[_0x27ef('0x27')](respondWithResult(_0x59ac2c,null))[_0x27ef('0x4a')](handleError(_0x59ac2c,null));};exports['destroy']=function(_0x3cc9c9,_0x574159){return db[_0x27ef('0x32')][_0x27ef('0x4e')]({'where':{'id':_0x3cc9c9[_0x27ef('0x4b')]['id']}})['then'](handleEntityNotFound(_0x574159,null))[_0x27ef('0x27')](removeEntity(_0x574159,null))[_0x27ef('0x4a')](handleError(_0x574159,null));};exports[_0x27ef('0x57')]=function(_0x2440f2,_0x3b5d2e){return db[_0x27ef('0x32')][_0x27ef('0x57')]()['then'](respondWithResult(_0x3b5d2e,null))[_0x27ef('0x4a')](handleError(_0x3b5d2e,null));};exports['getMembers']=function(_0x20b04a,_0xc82468,_0x12a740){var _0x32e25f={'raw':!![],'where':{}},_0x43fb20={},_0x177ebf;return db[_0x27ef('0x32')][_0x27ef('0x58')]({'where':{'id':_0x20b04a[_0x27ef('0x4b')]['id']}})['then'](handleEntityNotFound(_0xc82468,null))[_0x27ef('0x27')](function(_0x1e2c84){if(_0x1e2c84){_0x177ebf=_0x1e2c84[_0x27ef('0x28')]({'plain':!![]});_0x43fb20['model']=_[_0x27ef('0x37')](db[_0x27ef('0x59')]['rawAttributes']);_0x43fb20['query']=_[_0x27ef('0x37')](_0x20b04a[_0x27ef('0x36')]);_0x43fb20['filters']=_[_0x27ef('0x38')](_0x43fb20[_0x27ef('0x39')],_0x43fb20['query']);_0x32e25f[_0x27ef('0x3a')]=_[_0x27ef('0x38')](_0x43fb20[_0x27ef('0x39')],qs[_0x27ef('0x3b')](_0x20b04a[_0x27ef('0x36')][_0x27ef('0x3b')]));_0x32e25f['attributes']=_0x32e25f[_0x27ef('0x3a')][_0x27ef('0x3c')]?_0x32e25f[_0x27ef('0x3a')]:_0x43fb20[_0x27ef('0x39')];if(!_0x20b04a[_0x27ef('0x36')][_0x27ef('0x3d')](_0x27ef('0x3e'))){_0x32e25f[_0x27ef('0x1f')]=qs[_0x27ef('0x1f')](_0x20b04a[_0x27ef('0x36')][_0x27ef('0x1f')]);_0x32e25f['offset']=qs[_0x27ef('0x1e')](_0x20b04a[_0x27ef('0x36')][_0x27ef('0x1e')]);}_0x32e25f[_0x27ef('0x3f')]=qs[_0x27ef('0x40')](_0x20b04a[_0x27ef('0x36')][_0x27ef('0x40')]);_0x32e25f[_0x27ef('0x41')]=qs[_0x27ef('0x42')](_[_0x27ef('0x43')](_0x20b04a['query'],_0x43fb20[_0x27ef('0x42')]));_0x32e25f[_0x27ef('0x41')]['FaxQueueId']=_0x1e2c84['id'];if(_0x20b04a[_0x27ef('0x36')][_0x27ef('0x44')]){_0x32e25f[_0x27ef('0x41')]=_['merge'](_0x32e25f['where'],{'$or':_['map'](_0x32e25f['attributes'],function(_0x27ce4e){var _0x3eebf2={};_0x3eebf2[_0x27ce4e]={'$like':'%'+_0x20b04a[_0x27ef('0x36')][_0x27ef('0x44')]+'%'};return _0x3eebf2;})});}_0x32e25f=_[_0x27ef('0x45')]({},_0x32e25f,_0x20b04a['options']);return db[_0x27ef('0x59')][_0x27ef('0x48')](_0x32e25f);}})[_0x27ef('0x27')](function(_0x4ae705){if(_0x4ae705){return db[_0x27ef('0x5a')][_0x27ef('0x5b')]({'where':{'id':_[_0x27ef('0x31')](_0x4ae705,_0x27ef('0x5c')),'role':_0x27ef('0x5d')},'attributes':['id',_0x27ef('0x2e'),'faxPause',_0x27ef('0x5e'),_0x27ef('0x5f')]});}})[_0x27ef('0x27')](function(_0x61e964){if(_0x61e964){return{'count':_0x61e964[_0x27ef('0x21')],'rows':_[_0x27ef('0x31')](_0x61e964[_0x27ef('0x49')],function(_0x43a916){return{'membername':_0x43a916['name'],'UserId':_0x43a916['id'],'queue_name':_0x177ebf[_0x27ef('0x2e')],'FaxQueueId':_0x177ebf['id'],'interface':util[_0x27ef('0x60')](_0x27ef('0x61'),_0x27ef('0x62'),_0x43a916['name']),'penalty':0x0,'paused':_0x43a916[_0x27ef('0x63')],'createdAt':_0x43a916['createdAt'],'updatedAt':_0x43a916[_0x27ef('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x27ef('0x27')](respondWithFilteredResult(_0xc82468,_0x32e25f))[_0x27ef('0x4a')](handleError(_0xc82468,null));};exports[_0x27ef('0x64')]=function(_0x9d96ee,_0x583ef6,_0x4e45ac){var _0x47194c={};var _0x12ae65={};var _0x110391;var _0x4a4f1d;return db['FaxQueue'][_0x27ef('0x58')]({'where':{'id':_0x9d96ee[_0x27ef('0x4b')]['id']}})[_0x27ef('0x27')](handleEntityNotFound(_0x583ef6,null))[_0x27ef('0x27')](function(_0xcd45bc){if(_0xcd45bc){_0x110391=_0xcd45bc;_0x12ae65[_0x27ef('0x39')]=_[_0x27ef('0x37')](db[_0x27ef('0x65')][_0x27ef('0x4c')]);_0x12ae65[_0x27ef('0x36')]=_[_0x27ef('0x37')](_0x9d96ee['query']);_0x12ae65[_0x27ef('0x42')]=_['intersection'](_0x12ae65[_0x27ef('0x39')],_0x12ae65[_0x27ef('0x36')]);_0x47194c[_0x27ef('0x3a')]=_[_0x27ef('0x38')](_0x12ae65['model'],qs[_0x27ef('0x3b')](_0x9d96ee[_0x27ef('0x36')]['fields']));_0x47194c[_0x27ef('0x3a')]=_0x47194c[_0x27ef('0x3a')][_0x27ef('0x3c')]?_0x47194c[_0x27ef('0x3a')]:_0x12ae65[_0x27ef('0x39')];_0x47194c['order']=qs['sort'](_0x9d96ee[_0x27ef('0x36')][_0x27ef('0x40')]);_0x47194c[_0x27ef('0x41')]=qs[_0x27ef('0x42')](_[_0x27ef('0x43')](_0x9d96ee['query'],_0x12ae65['filters']));if(_0x9d96ee['query']['filter']){_0x47194c[_0x27ef('0x41')]=_['merge'](_0x47194c[_0x27ef('0x41')],{'$or':_[_0x27ef('0x31')](_0x47194c[_0x27ef('0x3a')],function(_0x4aa948){var _0x4b2e1c={};_0x4b2e1c[_0x4aa948]={'$like':'%'+_0x9d96ee['query'][_0x27ef('0x44')]+'%'};return _0x4b2e1c;})});}_0x47194c=_[_0x27ef('0x45')]({},_0x47194c,_0x9d96ee[_0x27ef('0x4d')]);return _0x110391['getTeams'](_0x47194c);}})[_0x27ef('0x27')](function(_0x242188){if(_0x242188){_0x4a4f1d=_0x242188[_0x27ef('0x3c')];if(!_0x9d96ee[_0x27ef('0x36')][_0x27ef('0x3d')](_0x27ef('0x3e'))){_0x47194c[_0x27ef('0x1f')]=qs['limit'](_0x9d96ee[_0x27ef('0x36')][_0x27ef('0x1f')]);_0x47194c[_0x27ef('0x1e')]=qs[_0x27ef('0x1e')](_0x9d96ee['query']['offset']);}return _0x110391[_0x27ef('0x64')](_0x47194c);}})[_0x27ef('0x27')](function(_0x57cf5f){if(_0x57cf5f){return _0x57cf5f?{'count':_0x4a4f1d,'rows':_0x57cf5f}:null;}})[_0x27ef('0x27')](respondWithResult(_0x583ef6,null))[_0x27ef('0x4a')](handleError(_0x583ef6,null));};exports[_0x27ef('0x66')]=function(_0xa54679,_0x1a0252,_0xb87686){var _0x408160=_0xa54679[_0x27ef('0x50')][_0x27ef('0x67')];return db[_0x27ef('0x65')][_0x27ef('0x48')]({'where':{'id':_0x408160},'attributes':['id'],'include':[{'model':db[_0x27ef('0x5a')],'as':_0x27ef('0x68'),'attributes':['id',_0x27ef('0x2e'),_0x27ef('0x69'),_0x27ef('0x6a'),_0x27ef('0x6b')],'raw':!![]}]})[_0x27ef('0x27')](function(_0x40a632){if(_0x40a632){var _0x383d6c=_[_0x27ef('0x6c')](_0x40a632,function(_0x309e4d){var _0x8599f2=_0x309e4d[_0x27ef('0x28')]({'plain':!![]});return _0x8599f2[_0x27ef('0x68')];});return db[_0x27ef('0x32')]['find']({'where':{'id':_0xa54679['params']['id']}})['then'](function(_0x3092bc){return db['sequelize']['transaction'](function(_0x2d1ef5){return _0x3092bc[_0x27ef('0x66')](_0x408160,{'transaction':_0x2d1ef5})[_0x27ef('0x27')](function(){return BPromise[_0x27ef('0x6d')](_0x383d6c,function(_0x15d24e){return db[_0x27ef('0x59')]['findOrCreate']({'where':{'UserId':_0x15d24e['id'],'FaxQueueId':_0xa54679[_0x27ef('0x4b')]['id']},'transaction':_0x2d1ef5});});})[_0x27ef('0x27')](function(){_0x383d6c[_0x27ef('0x6e')](function(_0x313eca){socket['emit']('userFaxQueue:save',{'UserId':_0x313eca['id'],'FaxQueueId':_0x3092bc['id']});});});});});}})[_0x27ef('0x27')](respondWithStatusCode(_0x1a0252,null))['catch'](handleError(_0x1a0252,null));};exports['removeTeams']=function(_0x325d7d,_0x46cb09,_0x23be8a){return db['Team'][_0x27ef('0x48')]({'where':{'id':_0x325d7d[_0x27ef('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x27ef('0x5a')],'as':_0x27ef('0x68'),'attributes':['id'],'raw':!![]}]})[_0x27ef('0x27')](handleEntityNotFound(_0x46cb09,null))[_0x27ef('0x27')](function(_0x11baa0){var _0x2731c8=_[_0x27ef('0x31')](_0x11baa0,'id');var _0x337f99=[];var _0x5b673e=[];var _0x4f3a6d=squel[_0x27ef('0x6f')]();_0x4f3a6d[_0x27ef('0x70')](_0x27ef('0x71'))[_0x27ef('0x72')](_0x27ef('0x73'),'tq')[_0x27ef('0x74')](_0x27ef('0x75'),'ut',_0x27ef('0x76'))[_0x27ef('0x41')](_0x27ef('0x77'),_0x325d7d[_0x27ef('0x4b')]['id']);for(var _0x1f72fb=0x0;_0x1f72fb<_0x11baa0[_0x27ef('0x3c')];_0x1f72fb+=0x1){let _0x484c63=_0x11baa0[_0x1f72fb];for(var _0x37c857=0x0;_0x37c857<_0x484c63[_0x27ef('0x68')][_0x27ef('0x3c')];_0x37c857+=0x1){let _0x235836=_0x484c63[_0x27ef('0x68')][_0x37c857];var _0x1cda9a=_0x4f3a6d[_0x27ef('0x78')]();_0x1cda9a[_0x27ef('0x41')]('ut.UserId\x20=\x20?',_0x235836['id']);_0x5b673e['push'](db[_0x27ef('0x79')][_0x27ef('0x36')](_0x1cda9a[_0x27ef('0x7a')](),{'type':db[_0x27ef('0x79')]['QueryTypes'][_0x27ef('0x7b')]})['then'](function(_0x3d3802){if(_0x3d3802[_0x27ef('0x3c')]===0x1){return _0x235836['id'];}else{var _0x1fbf97=_[_0x27ef('0x7c')](_[_0x27ef('0x31')](_0x3d3802,_0x27ef('0x7d')),function(_0x5e8164){return _[_0x27ef('0x7e')](_0x2731c8,_0x5e8164);});if(_0x1fbf97){return _0x235836['id'];}}}));}}return BPromise[_0x27ef('0x7f')](_0x5b673e)[_0x27ef('0x27')](function(_0x21b0d6){_0x337f99=_(_0x337f99)['union'](_0x21b0d6)[_0x27ef('0x80')]()[_0x27ef('0x81')]();return db[_0x27ef('0x32')][_0x27ef('0x4e')]({'where':{'id':_0x325d7d[_0x27ef('0x4b')]['id']}})[_0x27ef('0x27')](function(_0x9ab7a2){return db[_0x27ef('0x79')][_0x27ef('0x82')](function(_0x35799a){return _0x9ab7a2[_0x27ef('0x83')](_0x325d7d[_0x27ef('0x36')][_0x27ef('0x67')],{'transaction':_0x35799a})[_0x27ef('0x27')](function(){if(!_[_0x27ef('0x84')](_0x337f99)){return _0x9ab7a2[_0x27ef('0x85')](_0x337f99,{'transaction':_0x35799a});}})[_0x27ef('0x27')](function(){_0x337f99[_0x27ef('0x6e')](function(_0x117e7a){socket[_0x27ef('0x86')](_0x27ef('0x87'),{'UserId':_0x117e7a,'FaxQueueId':_0x9ab7a2['id']});});});});});});})[_0x27ef('0x27')](respondWithStatusCode(_0x46cb09,null))['catch'](handleError(_0x46cb09,null));};exports[_0x27ef('0x88')]=function(_0x474f90,_0x541be5,_0x490910){return db[_0x27ef('0x32')][_0x27ef('0x4e')]({'where':{'id':_0x474f90['params']['id']}})[_0x27ef('0x27')](handleEntityNotFound(_0x541be5,null))['then'](function(_0xbd9e27){if(_0xbd9e27){return _0xbd9e27[_0x27ef('0x88')](_0x474f90['body']['ids'],_['omit'](_0x474f90['body'],[_0x27ef('0x67'),'id'])||{})['spread'](function(_0x121d56){for(var _0x50cf13=0x0;_0x50cf13<_0x474f90['body'][_0x27ef('0x67')]['length'];_0x50cf13+=0x1){socket[_0x27ef('0x86')](_0x27ef('0x89'),{'UserId':Number(_0x474f90[_0x27ef('0x50')][_0x27ef('0x67')][_0x50cf13]),'FaxQueueId':Number(_0x474f90[_0x27ef('0x4b')]['id'])});}return _0x121d56;});}})['then'](respondWithResult(_0x541be5,null))['catch'](handleError(_0x541be5,null));};exports[_0x27ef('0x85')]=function(_0x1de133,_0x419c41,_0x29bdfd){return db['FaxQueue']['find']({'where':{'id':_0x1de133[_0x27ef('0x4b')]['id']}})['then'](handleEntityNotFound(_0x419c41,null))['then'](function(_0x3186d9){if(_0x3186d9){return _0x3186d9['removeAgents'](_0x1de133[_0x27ef('0x36')][_0x27ef('0x67')])['then'](function(){if(_[_0x27ef('0x8a')](_0x1de133[_0x27ef('0x36')][_0x27ef('0x67')])){for(var _0x1c6851=0x0;_0x1c6851<_0x1de133['query'][_0x27ef('0x67')][_0x27ef('0x3c')];_0x1c6851+=0x1){socket[_0x27ef('0x86')](_0x27ef('0x87'),{'UserId':Number(_0x1de133[_0x27ef('0x36')][_0x27ef('0x67')][_0x1c6851]),'FaxQueueId':Number(_0x1de133['params']['id'])});}}else{socket[_0x27ef('0x86')](_0x27ef('0x87'),{'UserId':Number(_0x1de133['query'][_0x27ef('0x67')]),'FaxQueueId':Number(_0x1de133[_0x27ef('0x4b')]['id'])});}});}})[_0x27ef('0x27')](respondWithStatusCode(_0x419c41,null))[_0x27ef('0x4a')](handleError(_0x419c41,null));};exports[_0x27ef('0x8b')]=function(_0x1de56c,_0x5bf18e,_0x3dbf2f){var _0x81f758={};var _0x515ca8={};var _0x23569d;var _0x59a433;return db[_0x27ef('0x32')][_0x27ef('0x58')]({'where':{'id':_0x1de56c[_0x27ef('0x4b')]['id']}})[_0x27ef('0x27')](handleEntityNotFound(_0x5bf18e,null))[_0x27ef('0x27')](function(_0x220fbe){if(_0x220fbe){_0x23569d=_0x220fbe;_0x515ca8['model']=_[_0x27ef('0x37')](db[_0x27ef('0x5a')][_0x27ef('0x4c')]);_0x515ca8[_0x27ef('0x36')]=_[_0x27ef('0x37')](_0x1de56c[_0x27ef('0x36')]);_0x515ca8['filters']=_[_0x27ef('0x38')](_0x515ca8[_0x27ef('0x39')],_0x515ca8['query']);_0x81f758[_0x27ef('0x3a')]=_[_0x27ef('0x38')](_0x515ca8[_0x27ef('0x39')],qs[_0x27ef('0x3b')](_0x1de56c[_0x27ef('0x36')]['fields']));_0x81f758['attributes']=_0x81f758[_0x27ef('0x3a')][_0x27ef('0x3c')]?_0x81f758[_0x27ef('0x3a')]:_0x515ca8['model'];_0x81f758[_0x27ef('0x3f')]=qs[_0x27ef('0x40')](_0x1de56c[_0x27ef('0x36')]['sort']);_0x81f758[_0x27ef('0x41')]=qs[_0x27ef('0x42')](_[_0x27ef('0x43')](_0x1de56c[_0x27ef('0x36')],_0x515ca8[_0x27ef('0x42')]));if(_0x1de56c[_0x27ef('0x36')]['filter']){_0x81f758[_0x27ef('0x41')]=_['merge'](_0x81f758[_0x27ef('0x41')],{'$or':_[_0x27ef('0x31')](_0x81f758[_0x27ef('0x3a')],function(_0x189324){var _0x2bafd2={};_0x2bafd2[_0x189324]={'$like':'%'+_0x1de56c[_0x27ef('0x36')][_0x27ef('0x44')]+'%'};return _0x2bafd2;})});}_0x81f758=_[_0x27ef('0x45')]({},_0x81f758,_0x1de56c[_0x27ef('0x4d')]);return _0x23569d[_0x27ef('0x8b')](_0x81f758);}})['then'](function(_0x5c3edb){if(_0x5c3edb){_0x59a433=_0x5c3edb[_0x27ef('0x3c')];if(!_0x1de56c[_0x27ef('0x36')][_0x27ef('0x3d')]('nolimit')){_0x81f758[_0x27ef('0x1f')]=qs[_0x27ef('0x1f')](_0x1de56c[_0x27ef('0x36')]['limit']);_0x81f758['offset']=qs[_0x27ef('0x1e')](_0x1de56c[_0x27ef('0x36')][_0x27ef('0x1e')]);}return _0x23569d[_0x27ef('0x8b')](_0x81f758);}})['then'](function(_0x1ab23f){if(_0x1ab23f){return _0x1ab23f?{'count':_0x59a433,'rows':_0x1ab23f}:null;}})[_0x27ef('0x27')](respondWithResult(_0x5bf18e,null))['catch'](handleError(_0x5bf18e,null));};
\ No newline at end of file
+var _0x6d72=['fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','socket.io-emitter','./faxQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','get','FaxQueues','error','name','send','index','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','FaxQueue','include','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','getMembers','findOne','UserFaxQueue','nolimit','User','agent','faxPause','updatedAt','createdAt','format','SIP','Team','ids','findAll','Agents','voicePause','interface','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','select','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','SELECT','every','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','userFaxQueue:remove','addAgents','spread','userFaxQueue:save','isArray','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x4403e5,_0x32ddae){var _0x512114=function(_0x1f21cb){while(--_0x1f21cb){_0x4403e5['push'](_0x4403e5['shift']());}};_0x512114(++_0x32ddae);}(_0x6d72,0x7d));var _0x26d7=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6d72[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x26d7('0x0'));var zipdir=require(_0x26d7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x26d7('0x2'));var moment=require(_0x26d7('0x3'));var BPromise=require(_0x26d7('0x4'));var Mustache=require(_0x26d7('0x5'));var util=require(_0x26d7('0x6'));var path=require(_0x26d7('0x7'));var sox=require(_0x26d7('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x26d7('0x9'));var _=require(_0x26d7('0xa'));var squel=require(_0x26d7('0xb'));var crypto=require(_0x26d7('0xc'));var jsforce=require(_0x26d7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x26d7('0xe'));var querystring=require(_0x26d7('0xf'));var Papa=require(_0x26d7('0x10'));var Redis=require('ioredis');var authService=require(_0x26d7('0x11'));var qs=require(_0x26d7('0x12'));var as=require(_0x26d7('0x13'));var hardwareService=require(_0x26d7('0x14'));var logger=require(_0x26d7('0x15'))(_0x26d7('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x26d7('0x17'))['db'];config[_0x26d7('0x18')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x26d7('0x19'))(new Redis(config[_0x26d7('0x18')]));require(_0x26d7('0x1a'))['register'](socket);function respondWithStatusCode(_0x4deb0e,_0x20fc47){_0x20fc47=_0x20fc47||0xcc;return function(_0x3cfd8b){if(_0x3cfd8b){return _0x4deb0e[_0x26d7('0x1b')](_0x20fc47);}return _0x4deb0e[_0x26d7('0x1c')](_0x20fc47)[_0x26d7('0x1d')]();};}function respondWithResult(_0x25ed79,_0x41e827){_0x41e827=_0x41e827||0xc8;return function(_0x2c1163){if(_0x2c1163){return _0x25ed79['status'](_0x41e827)[_0x26d7('0x1e')](_0x2c1163);}};}function respondWithFilteredResult(_0x3d4b42,_0x3e528a){return function(_0xcca7e7){if(_0xcca7e7){var _0x1d3ce4=typeof _0x3e528a[_0x26d7('0x1f')]===_0x26d7('0x20')&&typeof _0x3e528a[_0x26d7('0x21')]===_0x26d7('0x20');var _0x1855e4=_0xcca7e7[_0x26d7('0x22')];var _0x5c9e58=_0x1d3ce4?0x0:_0x3e528a[_0x26d7('0x1f')];var _0x5b8ee4=_0x1d3ce4?_0xcca7e7[_0x26d7('0x22')]:_0x3e528a[_0x26d7('0x1f')]+_0x3e528a['limit'];var _0x23098b;if(_0x5b8ee4>=_0x1855e4){_0x5b8ee4=_0x1855e4;_0x23098b=0xc8;}else{_0x23098b=0xce;}_0x3d4b42['status'](_0x23098b);return _0x3d4b42[_0x26d7('0x23')](_0x26d7('0x24'),_0x5c9e58+'-'+_0x5b8ee4+'/'+_0x1855e4)[_0x26d7('0x1e')](_0xcca7e7);}return null;};}function patchUpdates(_0x467685){return function(_0x566b03){try{jsonpatch[_0x26d7('0x25')](_0x566b03,_0x467685,!![]);}catch(_0x3b29fc){return BPromise[_0x26d7('0x26')](_0x3b29fc);}return _0x566b03['save']();};}function saveUpdates(_0x184279,_0x243212){return function(_0x21dfd1){if(_0x21dfd1){return _0x21dfd1[_0x26d7('0x27')](_0x184279)[_0x26d7('0x28')](function(_0x2fc51b){return _0x2fc51b;});}return null;};}function removeEntity(_0x3cb015,_0x35d39d){return function(_0xe9a009){if(_0xe9a009){return _0xe9a009['destroy']()[_0x26d7('0x28')](function(){var _0x30f17a=_0xe9a009[_0x26d7('0x29')]({'plain':!![]});var _0x102148=_0x26d7('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x102148,'resourceId':_0x30f17a['id']}})[_0x26d7('0x28')](function(){return _0xe9a009;});})[_0x26d7('0x28')](function(){_0x3cb015[_0x26d7('0x1c')](0xcc)[_0x26d7('0x1d')]();});}};}function handleEntityNotFound(_0x45f7b4,_0x369bac){return function(_0x5a9946){if(!_0x5a9946){_0x45f7b4['sendStatus'](0x194);}return _0x5a9946;};}function handleError(_0x569c23,_0x5a118e){_0x5a118e=_0x5a118e||0x1f4;return function(_0x58e6d1){logger[_0x26d7('0x2b')](_0x58e6d1['stack']);if(_0x58e6d1[_0x26d7('0x2c')]){delete _0x58e6d1[_0x26d7('0x2c')];}_0x569c23[_0x26d7('0x1c')](_0x5a118e)[_0x26d7('0x2d')](_0x58e6d1);};}exports[_0x26d7('0x2e')]=function(_0x21fde9,_0x31e554){var _0x504eff={},_0x4dc8f9={},_0x57c8a5={'count':0x0,'rows':[]};var _0x2c647f=_['map'](db['FaxQueue'][_0x26d7('0x2f')],function(_0xea8020){return{'name':_0xea8020['fieldName'],'type':_0xea8020['type'][_0x26d7('0x30')]};});_0x4dc8f9[_0x26d7('0x31')]=_['map'](_0x2c647f,'name');_0x4dc8f9[_0x26d7('0x32')]=_[_0x26d7('0x33')](_0x21fde9[_0x26d7('0x32')]);_0x4dc8f9[_0x26d7('0x34')]=_[_0x26d7('0x35')](_0x4dc8f9['model'],_0x4dc8f9[_0x26d7('0x32')]);_0x504eff[_0x26d7('0x36')]=_[_0x26d7('0x35')](_0x4dc8f9[_0x26d7('0x31')],qs[_0x26d7('0x37')](_0x21fde9[_0x26d7('0x32')]['fields']));_0x504eff['attributes']=_0x504eff[_0x26d7('0x36')][_0x26d7('0x38')]?_0x504eff[_0x26d7('0x36')]:_0x4dc8f9[_0x26d7('0x31')];if(!_0x21fde9[_0x26d7('0x32')][_0x26d7('0x39')]('nolimit')){_0x504eff[_0x26d7('0x21')]=qs[_0x26d7('0x21')](_0x21fde9[_0x26d7('0x32')][_0x26d7('0x21')]);_0x504eff[_0x26d7('0x1f')]=qs[_0x26d7('0x1f')](_0x21fde9[_0x26d7('0x32')]['offset']);}_0x504eff[_0x26d7('0x3a')]=qs[_0x26d7('0x3b')](_0x21fde9[_0x26d7('0x32')]['sort']);_0x504eff[_0x26d7('0x3c')]=qs[_0x26d7('0x34')](_[_0x26d7('0x3d')](_0x21fde9[_0x26d7('0x32')],_0x4dc8f9[_0x26d7('0x34')]),_0x2c647f);if(_0x21fde9['query'][_0x26d7('0x3e')]){_0x504eff[_0x26d7('0x3c')]=_[_0x26d7('0x3f')](_0x504eff[_0x26d7('0x3c')],{'$or':_[_0x26d7('0x40')](_0x2c647f,function(_0x18e017){if(_0x18e017[_0x26d7('0x41')]!==_0x26d7('0x42')){var _0x526ab9={};_0x526ab9[_0x18e017[_0x26d7('0x2c')]]={'$like':'%'+_0x21fde9[_0x26d7('0x32')]['filter']+'%'};return _0x526ab9;}})});}_0x504eff=_[_0x26d7('0x3f')]({},_0x504eff,_0x21fde9[_0x26d7('0x43')]);var _0x381595={'where':_0x504eff[_0x26d7('0x3c')]};return db[_0x26d7('0x44')][_0x26d7('0x22')](_0x381595)[_0x26d7('0x28')](function(_0x500ce6){_0x57c8a5[_0x26d7('0x22')]=_0x500ce6;if(_0x21fde9['query']['includeAll']){_0x504eff[_0x26d7('0x45')]=[{'all':!![]}];}return db['FaxQueue']['findAll'](_0x504eff);})[_0x26d7('0x28')](function(_0x421512){_0x57c8a5[_0x26d7('0x46')]=_0x421512;return _0x57c8a5;})[_0x26d7('0x28')](respondWithFilteredResult(_0x31e554,_0x504eff))[_0x26d7('0x47')](handleError(_0x31e554,null));};exports[_0x26d7('0x48')]=function(_0x8f22df,_0x25d569){var _0x42b351={'raw':!![],'where':{'id':_0x8f22df[_0x26d7('0x49')]['id']}},_0x36c5cc={};_0x36c5cc['model']=_[_0x26d7('0x33')](db['FaxQueue'][_0x26d7('0x2f')]);_0x36c5cc[_0x26d7('0x32')]=_[_0x26d7('0x33')](_0x8f22df[_0x26d7('0x32')]);_0x36c5cc[_0x26d7('0x34')]=_[_0x26d7('0x35')](_0x36c5cc[_0x26d7('0x31')],_0x36c5cc['query']);_0x42b351[_0x26d7('0x36')]=_[_0x26d7('0x35')](_0x36c5cc[_0x26d7('0x31')],qs[_0x26d7('0x37')](_0x8f22df[_0x26d7('0x32')][_0x26d7('0x37')]));_0x42b351[_0x26d7('0x36')]=_0x42b351['attributes'][_0x26d7('0x38')]?_0x42b351[_0x26d7('0x36')]:_0x36c5cc[_0x26d7('0x31')];if(_0x8f22df[_0x26d7('0x32')]['includeAll']){_0x42b351['include']=[{'all':!![]}];}_0x42b351=_[_0x26d7('0x3f')]({},_0x42b351,_0x8f22df['options']);return db[_0x26d7('0x44')][_0x26d7('0x4a')](_0x42b351)[_0x26d7('0x28')](handleEntityNotFound(_0x25d569,null))['then'](respondWithResult(_0x25d569,null))['catch'](handleError(_0x25d569,null));};exports[_0x26d7('0x4b')]=function(_0x59303c,_0x12fdfd){return db[_0x26d7('0x44')][_0x26d7('0x4b')](_0x59303c[_0x26d7('0x4c')],{})[_0x26d7('0x28')](function(_0x433f80){var _0x2d4646=_0x59303c['user']['get']({'plain':!![]});if(!_0x2d4646)throw new Error(_0x26d7('0x4d'));if(_0x2d4646[_0x26d7('0x4e')]===_0x26d7('0x4f')){var _0x42d43e=_0x433f80[_0x26d7('0x29')]({'plain':!![]});var _0x120316='FaxQueues';return db[_0x26d7('0x50')][_0x26d7('0x4a')]({'where':{'name':_0x120316,'userProfileId':_0x2d4646[_0x26d7('0x51')]},'raw':!![]})[_0x26d7('0x28')](function(_0x149ba8){if(_0x149ba8&&_0x149ba8[_0x26d7('0x52')]===0x0){return db[_0x26d7('0x53')][_0x26d7('0x4b')]({'name':_0x42d43e[_0x26d7('0x2c')],'resourceId':_0x42d43e['id'],'type':_0x149ba8[_0x26d7('0x2c')],'sectionId':_0x149ba8['id']},{})['then'](function(){return _0x433f80;});}else{return _0x433f80;}})[_0x26d7('0x47')](function(_0x54f33d){logger['error'](_0x26d7('0x54'),_0x54f33d);throw _0x54f33d;});}return _0x433f80;})[_0x26d7('0x28')](respondWithResult(_0x12fdfd,0xc9))[_0x26d7('0x47')](handleError(_0x12fdfd,null));};exports[_0x26d7('0x27')]=function(_0x484ae4,_0x1cbc0d){if(_0x484ae4[_0x26d7('0x4c')]['id']){delete _0x484ae4[_0x26d7('0x4c')]['id'];}return db[_0x26d7('0x44')]['find']({'where':{'id':_0x484ae4[_0x26d7('0x49')]['id']}})[_0x26d7('0x28')](handleEntityNotFound(_0x1cbc0d,null))[_0x26d7('0x28')](saveUpdates(_0x484ae4[_0x26d7('0x4c')],null))[_0x26d7('0x28')](respondWithResult(_0x1cbc0d,null))[_0x26d7('0x47')](handleError(_0x1cbc0d,null));};exports[_0x26d7('0x55')]=function(_0x1ba269,_0x2161ca){return db[_0x26d7('0x44')][_0x26d7('0x4a')]({'where':{'id':_0x1ba269[_0x26d7('0x49')]['id']}})[_0x26d7('0x28')](handleEntityNotFound(_0x2161ca,null))[_0x26d7('0x28')](removeEntity(_0x2161ca,null))['catch'](handleError(_0x2161ca,null));};exports[_0x26d7('0x56')]=function(_0x3e6753,_0x5e9900){return db['FaxQueue']['describe']()[_0x26d7('0x28')](respondWithResult(_0x5e9900,null))[_0x26d7('0x47')](handleError(_0x5e9900,null));};exports[_0x26d7('0x57')]=function(_0x503f9e,_0x4b1dba,_0x2686a5){var _0x55edb8={'raw':!![],'where':{}},_0x4fa81e={},_0x50ee4b;return db[_0x26d7('0x44')][_0x26d7('0x58')]({'where':{'id':_0x503f9e[_0x26d7('0x49')]['id']}})[_0x26d7('0x28')](handleEntityNotFound(_0x4b1dba,null))[_0x26d7('0x28')](function(_0x263fe8){if(_0x263fe8){_0x50ee4b=_0x263fe8[_0x26d7('0x29')]({'plain':!![]});_0x4fa81e['model']=_['keys'](db[_0x26d7('0x59')][_0x26d7('0x2f')]);_0x4fa81e[_0x26d7('0x32')]=_['keys'](_0x503f9e['query']);_0x4fa81e[_0x26d7('0x34')]=_[_0x26d7('0x35')](_0x4fa81e[_0x26d7('0x31')],_0x4fa81e[_0x26d7('0x32')]);_0x55edb8['attributes']=_[_0x26d7('0x35')](_0x4fa81e[_0x26d7('0x31')],qs[_0x26d7('0x37')](_0x503f9e[_0x26d7('0x32')][_0x26d7('0x37')]));_0x55edb8['attributes']=_0x55edb8[_0x26d7('0x36')]['length']?_0x55edb8['attributes']:_0x4fa81e[_0x26d7('0x31')];if(!_0x503f9e[_0x26d7('0x32')][_0x26d7('0x39')](_0x26d7('0x5a'))){_0x55edb8[_0x26d7('0x21')]=qs[_0x26d7('0x21')](_0x503f9e[_0x26d7('0x32')]['limit']);_0x55edb8[_0x26d7('0x1f')]=qs[_0x26d7('0x1f')](_0x503f9e[_0x26d7('0x32')][_0x26d7('0x1f')]);}_0x55edb8[_0x26d7('0x3a')]=qs[_0x26d7('0x3b')](_0x503f9e['query'][_0x26d7('0x3b')]);_0x55edb8[_0x26d7('0x3c')]=qs[_0x26d7('0x34')](_[_0x26d7('0x3d')](_0x503f9e['query'],_0x4fa81e[_0x26d7('0x34')]));_0x55edb8['where']['FaxQueueId']=_0x263fe8['id'];if(_0x503f9e[_0x26d7('0x32')][_0x26d7('0x3e')]){_0x55edb8[_0x26d7('0x3c')]=_[_0x26d7('0x3f')](_0x55edb8[_0x26d7('0x3c')],{'$or':_[_0x26d7('0x40')](_0x55edb8['attributes'],function(_0x3a6207){var _0x5a0548={};_0x5a0548[_0x3a6207]={'$like':'%'+_0x503f9e[_0x26d7('0x32')]['filter']+'%'};return _0x5a0548;})});}_0x55edb8=_[_0x26d7('0x3f')]({},_0x55edb8,_0x503f9e['options']);return db[_0x26d7('0x59')]['findAll'](_0x55edb8);}})[_0x26d7('0x28')](function(_0x2d0b9f){if(_0x2d0b9f){return db[_0x26d7('0x5b')]['findAndCountAll']({'where':{'id':_[_0x26d7('0x40')](_0x2d0b9f,'UserId'),'role':_0x26d7('0x5c')},'attributes':['id',_0x26d7('0x2c'),_0x26d7('0x5d'),_0x26d7('0x5e'),_0x26d7('0x5f')]});}})[_0x26d7('0x28')](function(_0x6ad851){if(_0x6ad851){return{'count':_0x6ad851[_0x26d7('0x22')],'rows':_[_0x26d7('0x40')](_0x6ad851[_0x26d7('0x46')],function(_0x50866e){return{'membername':_0x50866e[_0x26d7('0x2c')],'UserId':_0x50866e['id'],'queue_name':_0x50ee4b[_0x26d7('0x2c')],'FaxQueueId':_0x50ee4b['id'],'interface':util[_0x26d7('0x60')]('%s/%s',_0x26d7('0x61'),_0x50866e[_0x26d7('0x2c')]),'penalty':0x0,'paused':_0x50866e[_0x26d7('0x5d')],'createdAt':_0x50866e['createdAt'],'updatedAt':_0x50866e['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x26d7('0x28')](respondWithFilteredResult(_0x4b1dba,_0x55edb8))['catch'](handleError(_0x4b1dba,null));};exports['getTeams']=function(_0x461a33,_0x5efe9b,_0x5962f6){var _0x360c4b={};var _0x5bc5bc={};var _0x2903f0;var _0x5b10f1;return db['FaxQueue'][_0x26d7('0x58')]({'where':{'id':_0x461a33[_0x26d7('0x49')]['id']}})[_0x26d7('0x28')](handleEntityNotFound(_0x5efe9b,null))[_0x26d7('0x28')](function(_0x5b0c35){if(_0x5b0c35){_0x2903f0=_0x5b0c35;_0x5bc5bc[_0x26d7('0x31')]=_[_0x26d7('0x33')](db[_0x26d7('0x62')][_0x26d7('0x2f')]);_0x5bc5bc[_0x26d7('0x32')]=_[_0x26d7('0x33')](_0x461a33[_0x26d7('0x32')]);_0x5bc5bc['filters']=_[_0x26d7('0x35')](_0x5bc5bc[_0x26d7('0x31')],_0x5bc5bc[_0x26d7('0x32')]);_0x360c4b['attributes']=_[_0x26d7('0x35')](_0x5bc5bc['model'],qs[_0x26d7('0x37')](_0x461a33[_0x26d7('0x32')][_0x26d7('0x37')]));_0x360c4b[_0x26d7('0x36')]=_0x360c4b['attributes'][_0x26d7('0x38')]?_0x360c4b[_0x26d7('0x36')]:_0x5bc5bc['model'];_0x360c4b[_0x26d7('0x3a')]=qs['sort'](_0x461a33[_0x26d7('0x32')][_0x26d7('0x3b')]);_0x360c4b[_0x26d7('0x3c')]=qs[_0x26d7('0x34')](_['pick'](_0x461a33[_0x26d7('0x32')],_0x5bc5bc[_0x26d7('0x34')]));if(_0x461a33[_0x26d7('0x32')][_0x26d7('0x3e')]){_0x360c4b['where']=_[_0x26d7('0x3f')](_0x360c4b[_0x26d7('0x3c')],{'$or':_[_0x26d7('0x40')](_0x360c4b['attributes'],function(_0x183ae4){var _0xae56d5={};_0xae56d5[_0x183ae4]={'$like':'%'+_0x461a33['query'][_0x26d7('0x3e')]+'%'};return _0xae56d5;})});}_0x360c4b=_['merge']({},_0x360c4b,_0x461a33['options']);return _0x2903f0['getTeams'](_0x360c4b);}})[_0x26d7('0x28')](function(_0x4b6045){if(_0x4b6045){_0x5b10f1=_0x4b6045[_0x26d7('0x38')];if(!_0x461a33[_0x26d7('0x32')][_0x26d7('0x39')](_0x26d7('0x5a'))){_0x360c4b[_0x26d7('0x21')]=qs[_0x26d7('0x21')](_0x461a33['query']['limit']);_0x360c4b[_0x26d7('0x1f')]=qs[_0x26d7('0x1f')](_0x461a33[_0x26d7('0x32')]['offset']);}return _0x2903f0['getTeams'](_0x360c4b);}})['then'](function(_0x2dd8fa){if(_0x2dd8fa){return _0x2dd8fa?{'count':_0x5b10f1,'rows':_0x2dd8fa}:null;}})[_0x26d7('0x28')](respondWithResult(_0x5efe9b,null))[_0x26d7('0x47')](handleError(_0x5efe9b,null));};exports['addTeams']=function(_0x2a7927,_0x26e49a,_0x4f5eaa){var _0x122d75=_0x2a7927['body'][_0x26d7('0x63')];return db[_0x26d7('0x62')][_0x26d7('0x64')]({'where':{'id':_0x122d75},'attributes':['id'],'include':[{'model':db[_0x26d7('0x5b')],'as':_0x26d7('0x65'),'attributes':['id',_0x26d7('0x2c'),'online',_0x26d7('0x66'),_0x26d7('0x67')],'raw':!![]}]})[_0x26d7('0x28')](function(_0x5249d9){if(_0x5249d9){var _0x1c19bf=_['flatMap'](_0x5249d9,function(_0x3d1de3){var _0x2194fe=_0x3d1de3[_0x26d7('0x29')]({'plain':!![]});return _0x2194fe[_0x26d7('0x65')];});return db[_0x26d7('0x44')][_0x26d7('0x4a')]({'where':{'id':_0x2a7927[_0x26d7('0x49')]['id']}})[_0x26d7('0x28')](function(_0x1002ba){return db[_0x26d7('0x68')][_0x26d7('0x69')](function(_0x324ad6){return _0x1002ba[_0x26d7('0x6a')](_0x122d75,{'transaction':_0x324ad6})[_0x26d7('0x28')](function(){return BPromise[_0x26d7('0x6b')](_0x1c19bf,function(_0x440ff9){return db['UserFaxQueue'][_0x26d7('0x6c')]({'where':{'UserId':_0x440ff9['id'],'FaxQueueId':_0x2a7927[_0x26d7('0x49')]['id']},'transaction':_0x324ad6});});})[_0x26d7('0x28')](function(){_0x1c19bf[_0x26d7('0x6d')](function(_0x2ed3c4){socket[_0x26d7('0x6e')]('userFaxQueue:save',{'UserId':_0x2ed3c4['id'],'FaxQueueId':_0x1002ba['id']});});});});});}})[_0x26d7('0x28')](respondWithStatusCode(_0x26e49a,null))['catch'](handleError(_0x26e49a,null));};exports['removeTeams']=function(_0x59a6db,_0x2565b9,_0x28382a){return db[_0x26d7('0x62')]['findAll']({'where':{'id':_0x59a6db[_0x26d7('0x32')]['ids']},'attributes':['id'],'include':[{'model':db[_0x26d7('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x26d7('0x28')](handleEntityNotFound(_0x2565b9,null))[_0x26d7('0x28')](function(_0x82e3a1){var _0x5dc596=_[_0x26d7('0x40')](_0x82e3a1,'id');var _0x3d18ce=[];var _0x564a22=[];var _0x28b21d=squel[_0x26d7('0x6f')]();_0x28b21d['field'](_0x26d7('0x70'))[_0x26d7('0x71')]('team_has_fax_queues','tq')['join'](_0x26d7('0x72'),'ut',_0x26d7('0x73'))['where']('FaxQueueId\x20=\x20?',_0x59a6db[_0x26d7('0x49')]['id']);for(var _0x6bef7=0x0;_0x6bef7<_0x82e3a1['length'];_0x6bef7+=0x1){let _0x31b7d9=_0x82e3a1[_0x6bef7];for(var _0x76350d=0x0;_0x76350d<_0x31b7d9[_0x26d7('0x65')]['length'];_0x76350d+=0x1){let _0x5ae731=_0x31b7d9[_0x26d7('0x65')][_0x76350d];var _0x1ac9fd=_0x28b21d[_0x26d7('0x74')]();_0x1ac9fd[_0x26d7('0x3c')]('ut.UserId\x20=\x20?',_0x5ae731['id']);_0x564a22[_0x26d7('0x75')](db[_0x26d7('0x68')]['query'](_0x1ac9fd['toString'](),{'type':db[_0x26d7('0x68')]['QueryTypes'][_0x26d7('0x76')]})[_0x26d7('0x28')](function(_0x2bf2b3){if(_0x2bf2b3[_0x26d7('0x38')]===0x1){return _0x5ae731['id'];}else{var _0x4a0363=_[_0x26d7('0x77')](_[_0x26d7('0x40')](_0x2bf2b3,'TeamId'),function(_0x57cc1f){return _[_0x26d7('0x78')](_0x5dc596,_0x57cc1f);});if(_0x4a0363){return _0x5ae731['id'];}}}));}}return BPromise[_0x26d7('0x79')](_0x564a22)[_0x26d7('0x28')](function(_0x13005f){_0x3d18ce=_(_0x3d18ce)[_0x26d7('0x7a')](_0x13005f)[_0x26d7('0x7b')]()[_0x26d7('0x7c')]();return db['FaxQueue'][_0x26d7('0x4a')]({'where':{'id':_0x59a6db[_0x26d7('0x49')]['id']}})[_0x26d7('0x28')](function(_0x174478){return db['sequelize'][_0x26d7('0x69')](function(_0x5200b9){return _0x174478[_0x26d7('0x7d')](_0x59a6db['query'][_0x26d7('0x63')],{'transaction':_0x5200b9})['then'](function(){if(!_[_0x26d7('0x7e')](_0x3d18ce)){return _0x174478[_0x26d7('0x7f')](_0x3d18ce,{'transaction':_0x5200b9});}})[_0x26d7('0x28')](function(){_0x3d18ce[_0x26d7('0x6d')](function(_0x48d97c){socket[_0x26d7('0x6e')](_0x26d7('0x80'),{'UserId':_0x48d97c,'FaxQueueId':_0x174478['id']});});});});});});})[_0x26d7('0x28')](respondWithStatusCode(_0x2565b9,null))[_0x26d7('0x47')](handleError(_0x2565b9,null));};exports[_0x26d7('0x81')]=function(_0x1d8478,_0x568481,_0x4c60f6){return db[_0x26d7('0x44')][_0x26d7('0x4a')]({'where':{'id':_0x1d8478[_0x26d7('0x49')]['id']}})[_0x26d7('0x28')](handleEntityNotFound(_0x568481,null))[_0x26d7('0x28')](function(_0x33701a){if(_0x33701a){return _0x33701a['addAgents'](_0x1d8478[_0x26d7('0x4c')]['ids'],_['omit'](_0x1d8478[_0x26d7('0x4c')],['ids','id'])||{})[_0x26d7('0x82')](function(_0x5f31b3){for(var _0x1914ce=0x0;_0x1914ce<_0x1d8478[_0x26d7('0x4c')]['ids'][_0x26d7('0x38')];_0x1914ce+=0x1){socket[_0x26d7('0x6e')](_0x26d7('0x83'),{'UserId':Number(_0x1d8478['body'][_0x26d7('0x63')][_0x1914ce]),'FaxQueueId':Number(_0x1d8478[_0x26d7('0x49')]['id'])});}return _0x5f31b3;});}})[_0x26d7('0x28')](respondWithResult(_0x568481,null))[_0x26d7('0x47')](handleError(_0x568481,null));};exports[_0x26d7('0x7f')]=function(_0x773387,_0x41c9e7,_0x29f822){return db[_0x26d7('0x44')][_0x26d7('0x4a')]({'where':{'id':_0x773387[_0x26d7('0x49')]['id']}})['then'](handleEntityNotFound(_0x41c9e7,null))[_0x26d7('0x28')](function(_0x15f316){if(_0x15f316){return _0x15f316[_0x26d7('0x7f')](_0x773387[_0x26d7('0x32')]['ids'])[_0x26d7('0x28')](function(){if(_[_0x26d7('0x84')](_0x773387[_0x26d7('0x32')][_0x26d7('0x63')])){for(var _0x2fb3c5=0x0;_0x2fb3c5<_0x773387[_0x26d7('0x32')][_0x26d7('0x63')][_0x26d7('0x38')];_0x2fb3c5+=0x1){socket[_0x26d7('0x6e')]('userFaxQueue:remove',{'UserId':Number(_0x773387[_0x26d7('0x32')]['ids'][_0x2fb3c5]),'FaxQueueId':Number(_0x773387[_0x26d7('0x49')]['id'])});}}else{socket[_0x26d7('0x6e')](_0x26d7('0x80'),{'UserId':Number(_0x773387['query'][_0x26d7('0x63')]),'FaxQueueId':Number(_0x773387[_0x26d7('0x49')]['id'])});}});}})[_0x26d7('0x28')](respondWithStatusCode(_0x41c9e7,null))[_0x26d7('0x47')](handleError(_0x41c9e7,null));};exports[_0x26d7('0x85')]=function(_0x3e22aa,_0x522f4a,_0x1a1f03){var _0x41bd8d={};var _0x1b4c79={};var _0x4a014a;var _0xf9fd81;return db[_0x26d7('0x44')][_0x26d7('0x58')]({'where':{'id':_0x3e22aa['params']['id']}})[_0x26d7('0x28')](handleEntityNotFound(_0x522f4a,null))[_0x26d7('0x28')](function(_0x59ca5c){if(_0x59ca5c){_0x4a014a=_0x59ca5c;_0x1b4c79[_0x26d7('0x31')]=_[_0x26d7('0x33')](db['User'][_0x26d7('0x2f')]);_0x1b4c79[_0x26d7('0x32')]=_[_0x26d7('0x33')](_0x3e22aa[_0x26d7('0x32')]);_0x1b4c79[_0x26d7('0x34')]=_[_0x26d7('0x35')](_0x1b4c79[_0x26d7('0x31')],_0x1b4c79['query']);_0x41bd8d[_0x26d7('0x36')]=_[_0x26d7('0x35')](_0x1b4c79[_0x26d7('0x31')],qs[_0x26d7('0x37')](_0x3e22aa[_0x26d7('0x32')]['fields']));_0x41bd8d[_0x26d7('0x36')]=_0x41bd8d['attributes']['length']?_0x41bd8d[_0x26d7('0x36')]:_0x1b4c79['model'];_0x41bd8d[_0x26d7('0x3a')]=qs[_0x26d7('0x3b')](_0x3e22aa[_0x26d7('0x32')][_0x26d7('0x3b')]);_0x41bd8d[_0x26d7('0x3c')]=qs['filters'](_[_0x26d7('0x3d')](_0x3e22aa['query'],_0x1b4c79[_0x26d7('0x34')]));if(_0x3e22aa['query'][_0x26d7('0x3e')]){_0x41bd8d['where']=_[_0x26d7('0x3f')](_0x41bd8d['where'],{'$or':_[_0x26d7('0x40')](_0x41bd8d['attributes'],function(_0x1f2d0a){var _0x29bb7b={};_0x29bb7b[_0x1f2d0a]={'$like':'%'+_0x3e22aa[_0x26d7('0x32')][_0x26d7('0x3e')]+'%'};return _0x29bb7b;})});}_0x41bd8d=_['merge']({},_0x41bd8d,_0x3e22aa[_0x26d7('0x43')]);return _0x4a014a[_0x26d7('0x85')](_0x41bd8d);}})[_0x26d7('0x28')](function(_0x3eabb5){if(_0x3eabb5){_0xf9fd81=_0x3eabb5['length'];if(!_0x3e22aa[_0x26d7('0x32')][_0x26d7('0x39')]('nolimit')){_0x41bd8d[_0x26d7('0x21')]=qs[_0x26d7('0x21')](_0x3e22aa['query'][_0x26d7('0x21')]);_0x41bd8d[_0x26d7('0x1f')]=qs[_0x26d7('0x1f')](_0x3e22aa[_0x26d7('0x32')][_0x26d7('0x1f')]);}return _0x4a014a[_0x26d7('0x85')](_0x41bd8d);}})[_0x26d7('0x28')](function(_0x1fc790){if(_0x1fc790){return _0x1fc790?{'count':_0xf9fd81,'rows':_0x1fc790}:null;}})[_0x26d7('0x28')](respondWithResult(_0x522f4a,null))[_0x26d7('0x47')](handleError(_0x522f4a,null));};
\ No newline at end of file
index 93705c8..8f83510 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc89a=['hook','exports','../../mysqldb','update','remove','emit'];(function(_0xcaf5ea,_0x9412fc){var _0xaabcd6=function(_0x3246c4){while(--_0x3246c4){_0xcaf5ea['push'](_0xcaf5ea['shift']());}};_0xaabcd6(++_0x9412fc);}(_0xc89a,0x6e));var _0xac89=function(_0xbd4e93,_0x25b4ca){_0xbd4e93=_0xbd4e93-0x0;var _0x1da352=_0xc89a[_0xbd4e93];return _0x1da352;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0xac89('0x0'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xac89('0x1'),'afterDestroy':_0xac89('0x2')};function emitEvent(_0x4fbe99){return function(_0x4c5bbd,_0x41f42c,_0x227d16){FaxQueueEvents[_0xac89('0x3')](_0x4fbe99+':'+_0x4c5bbd['id'],_0x4c5bbd);FaxQueueEvents[_0xac89('0x3')](_0x4fbe99,_0x4c5bbd);_0x227d16(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0xac89('0x4')](e,emitEvent(event));}}module[_0xac89('0x5')]=FaxQueueEvents;
\ No newline at end of file
+var _0x37ac=['../../mysqldb','FaxQueue','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x270dba,_0x1817d2){var _0x36b83b=function(_0x15a276){while(--_0x15a276){_0x270dba['push'](_0x270dba['shift']());}};_0x36b83b(++_0x1817d2);}(_0x37ac,0x1c1));var _0xc37a=function(_0x209a22,_0x235da2){_0x209a22=_0x209a22-0x0;var _0x5c0456=_0x37ac[_0x209a22];return _0x5c0456;};'use strict';var EventEmitter=require(_0xc37a('0x0'));var FaxQueue=require(_0xc37a('0x1'))['db'][_0xc37a('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc37a('0x3'),'afterUpdate':_0xc37a('0x4'),'afterDestroy':_0xc37a('0x5')};function emitEvent(_0x50b9ed){return function(_0x245be9,_0x5e50c1,_0x22054d){FaxQueueEvents[_0xc37a('0x6')](_0x50b9ed+':'+_0x245be9['id'],_0x245be9);FaxQueueEvents['emit'](_0x50b9ed,_0x245be9);_0x22054d(null);};}for(var e in events){if(events[_0xc37a('0x7')](e)){var event=events[e];FaxQueue[_0xc37a('0x8')](e,emitEvent(event));}}module['exports']=FaxQueueEvents;
\ No newline at end of file
index c2aa9dc..31716a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66da=['fax_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxQueue.attributes','exports','FaxQueue'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x66da,0x1bd));var _0xa66d=function(_0x145b3c,_0x31ea4a){_0x145b3c=_0x145b3c-0x0;var _0x1b6e36=_0x66da[_0x145b3c];return _0x1b6e36;};'use strict';var _=require('lodash');var util=require(_0xa66d('0x0'));var logger=require(_0xa66d('0x1'))(_0xa66d('0x2'));var moment=require(_0xa66d('0x3'));var BPromise=require(_0xa66d('0x4'));var rp=require(_0xa66d('0x5'));var fs=require('fs');var path=require(_0xa66d('0x6'));var rimraf=require(_0xa66d('0x7'));var config=require('../../config/environment');var attributes=require(_0xa66d('0x8'));module[_0xa66d('0x9')]=function(_0x5bab50,_0x403e6a){return _0x5bab50['define'](_0xa66d('0xa'),attributes,{'tableName':_0xa66d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd5ea=['request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','util','api','moment'];(function(_0x316e3e,_0x4cd8da){var _0x5b7f8c=function(_0x9aae60){while(--_0x9aae60){_0x316e3e['push'](_0x316e3e['shift']());}};_0x5b7f8c(++_0x4cd8da);}(_0xd5ea,0x1dd));var _0xad5e=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xd5ea[_0x2be8c2];return _0x97f531;};'use strict';var _=require('lodash');var util=require(_0xad5e('0x0'));var logger=require('../../config/logger')(_0xad5e('0x1'));var moment=require(_0xad5e('0x2'));var BPromise=require('bluebird');var rp=require(_0xad5e('0x3'));var fs=require('fs');var path=require(_0xad5e('0x4'));var rimraf=require(_0xad5e('0x5'));var config=require(_0xad5e('0x6'));var attributes=require(_0xad5e('0x7'));module[_0xad5e('0x8')]=function(_0x7627de,_0x35d904){return _0x7627de[_0xad5e('0x9')](_0xad5e('0xa'),attributes,{'tableName':_0xad5e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 720a815..1628cb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75d5=['error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','where','attributes','include','map','model','stringify','ShowFaxQueue','find','debug','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s'];(function(_0xdf3db6,_0x2a1952){var _0x4b7a65=function(_0x2953be){while(--_0x2953be){_0xdf3db6['push'](_0xdf3db6['shift']());}};_0x4b7a65(++_0x2a1952);}(_0x75d5,0x1a9));var _0x575d=function(_0x4a5bd2,_0x5e14ee){_0x4a5bd2=_0x4a5bd2-0x0;var _0x145e70=_0x75d5[_0x4a5bd2];return _0x145e70;};'use strict';var _=require(_0x575d('0x0'));var util=require(_0x575d('0x1'));var moment=require(_0x575d('0x2'));var BPromise=require(_0x575d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x575d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x575d('0x5'))(_0x575d('0x6'));var config=require('../../config/environment');var jayson=require(_0x575d('0x7'));var client=jayson[_0x575d('0x8')][_0x575d('0x9')]({'port':0x232a});config[_0x575d('0xa')]=_[_0x575d('0xb')](config[_0x575d('0xa')],{'host':_0x575d('0xc'),'port':0x18eb});var socket=require(_0x575d('0xd'))(new Redis(config['redis']));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x28b618,_0x546235,_0x259713){return new BPromise(function(_0x2943de,_0x305c40){return client['request'](_0x28b618,_0x259713)[_0x575d('0xe')](function(_0x282b71){logger[_0x575d('0xf')](_0x575d('0x10'),_0x546235,_0x575d('0x11'));logger['debug'](_0x575d('0x12'),_0x546235,_0x575d('0x11'),JSON['stringify'](_0x282b71));if(_0x282b71[_0x575d('0x13')]){if(_0x282b71['error'][_0x575d('0x14')]===0x1f4){logger[_0x575d('0x13')](_0x575d('0x10'),_0x546235,_0x282b71[_0x575d('0x13')][_0x575d('0x15')]);return _0x305c40(_0x282b71[_0x575d('0x13')][_0x575d('0x15')]);}logger['error'](_0x575d('0x10'),_0x546235,_0x282b71[_0x575d('0x13')]['message']);return _0x2943de(_0x282b71['error'][_0x575d('0x15')]);}else{logger[_0x575d('0xf')](_0x575d('0x10'),_0x546235,_0x575d('0x11'));_0x2943de(_0x282b71[_0x575d('0x16')]['message']);}})[_0x575d('0x17')](function(_0x4dcb71){logger['error'](_0x575d('0x10'),_0x546235,_0x4dcb71);_0x305c40(_0x4dcb71);});});}exports[_0x575d('0x18')]=function(_0x241ecd){var _0x3561c1=this;return new Promise(function(_0x5de5b6,_0x45b690){return db[_0x575d('0x19')][_0x575d('0x1a')]({'raw':_0x241ecd[_0x575d('0x1b')]?_0x241ecd[_0x575d('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x241ecd[_0x575d('0x1b')]?_0x241ecd['options'][_0x575d('0x1c')]||null:null,'attributes':_0x241ecd[_0x575d('0x1b')]?_0x241ecd[_0x575d('0x1b')][_0x575d('0x1d')]||null:null,'limit':_0x241ecd[_0x575d('0x1b')]?_0x241ecd[_0x575d('0x1b')]['limit']||null:null,'include':_0x241ecd[_0x575d('0x1b')]?_0x241ecd['options'][_0x575d('0x1e')]?_[_0x575d('0x1f')](_0x241ecd[_0x575d('0x1b')][_0x575d('0x1e')],function(_0xbf0284){return{'model':db[_0xbf0284[_0x575d('0x20')]],'as':_0xbf0284['as'],'attributes':_0xbf0284[_0x575d('0x1d')],'include':_0xbf0284['include']?_[_0x575d('0x1f')](_0xbf0284['include'],function(_0x5f0fd9){return{'model':db[_0x5f0fd9[_0x575d('0x20')]],'as':_0x5f0fd9['as'],'attributes':_0x5f0fd9[_0x575d('0x1d')],'include':_0x5f0fd9['include']?_[_0x575d('0x1f')](_0x5f0fd9[_0x575d('0x1e')],function(_0x15dc2b){return{'model':db[_0x15dc2b[_0x575d('0x20')]],'as':_0x15dc2b['as'],'attributes':_0x15dc2b[_0x575d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x575d('0xe')](function(_0x1026d3){logger['info'](_0x575d('0x18'),_0x241ecd);logger['debug']('GetFaxQueue',_0x241ecd,JSON[_0x575d('0x21')](_0x1026d3));_0x5de5b6(_0x1026d3);})[_0x575d('0x17')](function(_0x38c081){logger[_0x575d('0x13')](_0x575d('0x18'),_0x38c081['message'],_0x241ecd);_0x45b690(_0x3561c1[_0x575d('0x13')](0x1f4,_0x38c081['message']));});});};exports[_0x575d('0x22')]=function(_0x330055){var _0x12334a=this;return new Promise(function(_0x4ff248,_0x549b71){return db['FaxQueue'][_0x575d('0x23')]({'raw':_0x330055[_0x575d('0x1b')]?_0x330055['options']['raw']===undefined?!![]:![]:!![],'where':_0x330055[_0x575d('0x1b')]?_0x330055['options'][_0x575d('0x1c')]||null:null,'attributes':_0x330055[_0x575d('0x1b')]?_0x330055[_0x575d('0x1b')][_0x575d('0x1d')]||null:null,'include':_0x330055['options']?_0x330055[_0x575d('0x1b')][_0x575d('0x1e')]?_[_0x575d('0x1f')](_0x330055[_0x575d('0x1b')][_0x575d('0x1e')],function(_0x12911b){return{'model':db[_0x12911b[_0x575d('0x20')]],'as':_0x12911b['as'],'attributes':_0x12911b[_0x575d('0x1d')],'include':_0x12911b[_0x575d('0x1e')]?_['map'](_0x12911b['include'],function(_0x28f908){return{'model':db[_0x28f908['model']],'as':_0x28f908['as'],'attributes':_0x28f908['attributes'],'include':_0x28f908[_0x575d('0x1e')]?_['map'](_0x28f908[_0x575d('0x1e')],function(_0x572c34){return{'model':db[_0x572c34[_0x575d('0x20')]],'as':_0x572c34['as'],'attributes':_0x572c34[_0x575d('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d209a){logger['info'](_0x575d('0x22'),_0x330055);logger[_0x575d('0x24')](_0x575d('0x22'),_0x330055,JSON[_0x575d('0x21')](_0x3d209a));_0x4ff248(_0x3d209a);})[_0x575d('0x17')](function(_0x3dd98f){logger[_0x575d('0x13')](_0x575d('0x22'),_0x3dd98f[_0x575d('0x15')],_0x330055);_0x549b71(_0x12334a[_0x575d('0x13')](0x1f4,_0x3dd98f['message']));});});};
\ No newline at end of file
+var _0x3795=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetFaxQueue','FaxQueue','raw','options','where','attributes','limit','include','map','model','debug','ShowFaxQueue','lodash','util','moment','bluebird'];(function(_0x16337a,_0x4789a1){var _0x422365=function(_0x34f039){while(--_0x34f039){_0x16337a['push'](_0x16337a['shift']());}};_0x422365(++_0x4789a1);}(_0x3795,0xe0));var _0x5379=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x3795[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x5379('0x0'));var util=require(_0x5379('0x1'));var moment=require(_0x5379('0x2'));var BPromise=require(_0x5379('0x3'));var rs=require(_0x5379('0x4'));var fs=require('fs');var Redis=require(_0x5379('0x5'));var db=require(_0x5379('0x6'))['db'];var utils=require(_0x5379('0x7'));var logger=require(_0x5379('0x8'))('rpc');var config=require(_0x5379('0x9'));var jayson=require(_0x5379('0xa'));var client=jayson[_0x5379('0xb')]['http']({'port':0x232a});config[_0x5379('0xc')]=_[_0x5379('0xd')](config[_0x5379('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5379('0xc')]));require(_0x5379('0xe'))[_0x5379('0xf')](socket);function respondWithRpcPromise(_0xa87848,_0x25eaf0,_0x2c8dee){return new BPromise(function(_0x383263,_0x148250){return client[_0x5379('0x10')](_0xa87848,_0x2c8dee)[_0x5379('0x11')](function(_0x592f76){logger[_0x5379('0x12')](_0x5379('0x13'),_0x25eaf0,_0x5379('0x14'));logger['debug']('FaxQueue,\x20%s,\x20%s,\x20%s',_0x25eaf0,_0x5379('0x14'),JSON[_0x5379('0x15')](_0x592f76));if(_0x592f76[_0x5379('0x16')]){if(_0x592f76[_0x5379('0x16')][_0x5379('0x17')]===0x1f4){logger[_0x5379('0x16')]('FaxQueue,\x20%s,\x20%s',_0x25eaf0,_0x592f76['error']['message']);return _0x148250(_0x592f76[_0x5379('0x16')][_0x5379('0x18')]);}logger[_0x5379('0x16')](_0x5379('0x13'),_0x25eaf0,_0x592f76['error'][_0x5379('0x18')]);return _0x383263(_0x592f76[_0x5379('0x16')][_0x5379('0x18')]);}else{logger[_0x5379('0x12')]('FaxQueue,\x20%s,\x20%s',_0x25eaf0,_0x5379('0x14'));_0x383263(_0x592f76['result'][_0x5379('0x18')]);}})[_0x5379('0x19')](function(_0x2aa6fb){logger[_0x5379('0x16')](_0x5379('0x13'),_0x25eaf0,_0x2aa6fb);_0x148250(_0x2aa6fb);});});}exports[_0x5379('0x1a')]=function(_0x30c0db){var _0x22363d=this;return new Promise(function(_0x186195,_0x259b59){return db[_0x5379('0x1b')]['findAll']({'raw':_0x30c0db['options']?_0x30c0db['options'][_0x5379('0x1c')]===undefined?!![]:![]:!![],'where':_0x30c0db[_0x5379('0x1d')]?_0x30c0db['options'][_0x5379('0x1e')]||null:null,'attributes':_0x30c0db['options']?_0x30c0db[_0x5379('0x1d')][_0x5379('0x1f')]||null:null,'limit':_0x30c0db[_0x5379('0x1d')]?_0x30c0db[_0x5379('0x1d')][_0x5379('0x20')]||null:null,'include':_0x30c0db[_0x5379('0x1d')]?_0x30c0db['options'][_0x5379('0x21')]?_[_0x5379('0x22')](_0x30c0db[_0x5379('0x1d')][_0x5379('0x21')],function(_0x3abb9b){return{'model':db[_0x3abb9b[_0x5379('0x23')]],'as':_0x3abb9b['as'],'attributes':_0x3abb9b[_0x5379('0x1f')],'include':_0x3abb9b[_0x5379('0x21')]?_[_0x5379('0x22')](_0x3abb9b[_0x5379('0x21')],function(_0x29d677){return{'model':db[_0x29d677['model']],'as':_0x29d677['as'],'attributes':_0x29d677['attributes'],'include':_0x29d677[_0x5379('0x21')]?_['map'](_0x29d677[_0x5379('0x21')],function(_0x440f00){return{'model':db[_0x440f00[_0x5379('0x23')]],'as':_0x440f00['as'],'attributes':_0x440f00[_0x5379('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5379('0x11')](function(_0x2d057b){logger['info'](_0x5379('0x1a'),_0x30c0db);logger['debug'](_0x5379('0x1a'),_0x30c0db,JSON[_0x5379('0x15')](_0x2d057b));_0x186195(_0x2d057b);})[_0x5379('0x19')](function(_0x14ce6a){logger['error'](_0x5379('0x1a'),_0x14ce6a[_0x5379('0x18')],_0x30c0db);_0x259b59(_0x22363d[_0x5379('0x16')](0x1f4,_0x14ce6a[_0x5379('0x18')]));});});};exports['ShowFaxQueue']=function(_0x161171){var _0x108ef2=this;return new Promise(function(_0x217e50,_0x570115){return db[_0x5379('0x1b')]['find']({'raw':_0x161171[_0x5379('0x1d')]?_0x161171[_0x5379('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x161171['options']?_0x161171['options'][_0x5379('0x1e')]||null:null,'attributes':_0x161171[_0x5379('0x1d')]?_0x161171[_0x5379('0x1d')][_0x5379('0x1f')]||null:null,'include':_0x161171[_0x5379('0x1d')]?_0x161171['options'][_0x5379('0x21')]?_['map'](_0x161171[_0x5379('0x1d')][_0x5379('0x21')],function(_0x45e1ee){return{'model':db[_0x45e1ee[_0x5379('0x23')]],'as':_0x45e1ee['as'],'attributes':_0x45e1ee[_0x5379('0x1f')],'include':_0x45e1ee[_0x5379('0x21')]?_[_0x5379('0x22')](_0x45e1ee[_0x5379('0x21')],function(_0x1dc141){return{'model':db[_0x1dc141[_0x5379('0x23')]],'as':_0x1dc141['as'],'attributes':_0x1dc141[_0x5379('0x1f')],'include':_0x1dc141['include']?_[_0x5379('0x22')](_0x1dc141['include'],function(_0x32d1df){return{'model':db[_0x32d1df['model']],'as':_0x32d1df['as'],'attributes':_0x32d1df['attributes']};}):[]};}):[]};}):[]:[]})[_0x5379('0x11')](function(_0x53ad1e){logger['info']('ShowFaxQueue',_0x161171);logger[_0x5379('0x24')](_0x5379('0x25'),_0x161171,JSON[_0x5379('0x15')](_0x53ad1e));_0x217e50(_0x53ad1e);})[_0x5379('0x19')](function(_0x2fd7a1){logger[_0x5379('0x16')](_0x5379('0x25'),_0x2fd7a1[_0x5379('0x18')],_0x161171);_0x570115(_0x108ef2[_0x5379('0x16')](0x1f4,_0x2fd7a1[_0x5379('0x18')]));});});};
\ No newline at end of file
index 61744af..a86daae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c75=['emit','removeListener','register','length','faxQueue:','./faxQueue.events','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0c75,0x185));var _0x50c7=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0c75[_0x122ef9];return _0x42fba0;};'use strict';var FaxQueueEvents=require(_0x50c7('0x0'));var events=[_0x50c7('0x1'),_0x50c7('0x2'),'update'];function createListener(_0x255f69,_0x3f81f7){return function(_0x316b7d){_0x3f81f7[_0x50c7('0x3')](_0x255f69,_0x316b7d);};}function removeListener(_0x5beff8,_0x467915){return function(){FaxQueueEvents[_0x50c7('0x4')](_0x5beff8,_0x467915);};}exports[_0x50c7('0x5')]=function(_0x429489){for(var _0x58016c=0x0,_0x3a4f88=events[_0x50c7('0x6')];_0x58016c<_0x3a4f88;_0x58016c++){var _0x58d137=events[_0x58016c];var _0x3b73c4=createListener(_0x50c7('0x7')+_0x58d137,_0x429489);FaxQueueEvents['on'](_0x58d137,_0x3b73c4);}};
\ No newline at end of file
+var _0xee81=['length','faxQueue:','./faxQueue.events','save','remove','register'];(function(_0x218947,_0x22c2a0){var _0x25c3bd=function(_0x4b6652){while(--_0x4b6652){_0x218947['push'](_0x218947['shift']());}};_0x25c3bd(++_0x22c2a0);}(_0xee81,0x15e));var _0x1ee8=function(_0x2e703d,_0x2b1fba){_0x2e703d=_0x2e703d-0x0;var _0x372a44=_0xee81[_0x2e703d];return _0x372a44;};'use strict';var FaxQueueEvents=require(_0x1ee8('0x0'));var events=[_0x1ee8('0x1'),_0x1ee8('0x2'),'update'];function createListener(_0x5d224f,_0x3b4269){return function(_0x2b7a72){_0x3b4269['emit'](_0x5d224f,_0x2b7a72);};}function removeListener(_0xd4fc66,_0x11b545){return function(){FaxQueueEvents['removeListener'](_0xd4fc66,_0x11b545);};}exports[_0x1ee8('0x3')]=function(_0xd6987){for(var _0x1f303b=0x0,_0x211c4f=events[_0x1ee8('0x4')];_0x1f303b<_0x211c4f;_0x1f303b++){var _0x984d62=events[_0x1f303b];var _0x3e095d=createListener(_0x1ee8('0x5')+_0x984d62,_0xd6987);FaxQueueEvents['on'](_0x984d62,_0x3e095d);}};
\ No newline at end of file
index 33cf25e..3b2576a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fe7=['show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeAgents','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./faxQueue.controller','get','index','/describe','describe','/:id','isAuthenticated'];(function(_0x1ce679,_0x50880e){var _0x168e70=function(_0x75fc75){while(--_0x75fc75){_0x1ce679['push'](_0x1ce679['shift']());}};_0x168e70(++_0x50880e);}(_0x9fe7,0x1df));var _0x79fe=function(_0x29a332,_0x841cd3){_0x29a332=_0x29a332-0x0;var _0xc2c815=_0x9fe7[_0x29a332];return _0xc2c815;};'use strict';var multer=require(_0x79fe('0x0'));var util=require(_0x79fe('0x1'));var path=require('path');var timeout=require(_0x79fe('0x2'));var express=require('express');var router=express[_0x79fe('0x3')]();var fs_extra=require(_0x79fe('0x4'));var auth=require(_0x79fe('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x79fe('0x6'));var controller=require(_0x79fe('0x7'));router[_0x79fe('0x8')]('/',auth['isAuthenticated'](),controller[_0x79fe('0x9')]);router[_0x79fe('0x8')](_0x79fe('0xa'),auth['isAuthenticated'](),controller[_0x79fe('0xb')]);router[_0x79fe('0x8')](_0x79fe('0xc'),auth[_0x79fe('0xd')](),controller[_0x79fe('0xe')]);router['get'](_0x79fe('0xf'),auth[_0x79fe('0xd')](),controller['getMembers']);router[_0x79fe('0x8')](_0x79fe('0x10'),auth[_0x79fe('0xd')](),controller[_0x79fe('0x11')]);router['get'](_0x79fe('0x12'),auth[_0x79fe('0xd')](),controller[_0x79fe('0x13')]);router[_0x79fe('0x14')]('/',auth[_0x79fe('0xd')](),controller[_0x79fe('0x15')]);router[_0x79fe('0x14')](_0x79fe('0x10'),auth['isAuthenticated'](),controller[_0x79fe('0x16')]);router[_0x79fe('0x14')](_0x79fe('0x12'),auth[_0x79fe('0xd')](),controller[_0x79fe('0x17')]);router[_0x79fe('0x18')]('/:id',auth[_0x79fe('0xd')](),controller[_0x79fe('0x19')]);router[_0x79fe('0x1a')](_0x79fe('0xc'),auth['isAuthenticated'](),controller[_0x79fe('0x1b')]);router[_0x79fe('0x1a')](_0x79fe('0x10'),auth[_0x79fe('0xd')](),controller['removeTeams']);router['delete'](_0x79fe('0x12'),auth[_0x79fe('0xd')](),controller[_0x79fe('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0x0295=['../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','getMembers','getTeams','getAgents','/:id/teams','addTeams','post','/:id/users','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents','multer','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x2c1dcd,_0x350452){var _0x158ce5=function(_0x5c1c57){while(--_0x5c1c57){_0x2c1dcd['push'](_0x2c1dcd['shift']());}};_0x158ce5(++_0x350452);}(_0x0295,0x1f0));var _0x5029=function(_0xfab345,_0x43fc6e){_0xfab345=_0xfab345-0x0;var _0x1a60fd=_0x0295[_0xfab345];return _0x1a60fd;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5029('0x2'));var auth=require(_0x5029('0x3'));var interaction=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var controller=require(_0x5029('0x6'));router[_0x5029('0x7')]('/',auth[_0x5029('0x8')](),controller[_0x5029('0x9')]);router[_0x5029('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x5029('0x7')]('/:id',auth[_0x5029('0x8')](),controller['show']);router[_0x5029('0x7')]('/:id/members',auth[_0x5029('0x8')](),controller[_0x5029('0xa')]);router[_0x5029('0x7')]('/:id/teams',auth[_0x5029('0x8')](),controller[_0x5029('0xb')]);router[_0x5029('0x7')]('/:id/users',auth[_0x5029('0x8')](),controller[_0x5029('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x5029('0xd'),auth[_0x5029('0x8')](),controller[_0x5029('0xe')]);router[_0x5029('0xf')](_0x5029('0x10'),auth[_0x5029('0x8')](),controller[_0x5029('0x11')]);router[_0x5029('0x12')](_0x5029('0x13'),auth[_0x5029('0x8')](),controller[_0x5029('0x14')]);router[_0x5029('0x15')](_0x5029('0x13'),auth[_0x5029('0x8')](),controller[_0x5029('0x16')]);router['delete'](_0x5029('0xd'),auth[_0x5029('0x8')](),controller[_0x5029('0x17')]);router[_0x5029('0x15')](_0x5029('0x10'),auth[_0x5029('0x8')](),controller[_0x5029('0x18')]);module['exports']=router;
\ No newline at end of file
index f2c411c..d6d7eee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ed6=['STRING','DATE','moment','exports'];(function(_0x2ba4aa,_0x3c30c0){var _0x43cd33=function(_0x3c06ae){while(--_0x3c06ae){_0x2ba4aa['push'](_0x2ba4aa['shift']());}};_0x43cd33(++_0x3c30c0);}(_0x3ed6,0x1c2));var _0x63ed=function(_0xeffb20,_0x32af68){_0xeffb20=_0xeffb20-0x0;var _0x4ec0f8=_0x3ed6[_0xeffb20];return _0x4ec0f8;};'use strict';var moment=require(_0x63ed('0x0'));var Sequelize=require('sequelize');module[_0x63ed('0x1')]={'uniqueid':{'type':Sequelize[_0x63ed('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x63ed('0x2')]},'joinAt':{'type':Sequelize[_0x63ed('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x63ed('0x3')]},'exitAt':{'type':Sequelize[_0x63ed('0x3')]},'reason':{'type':Sequelize[_0x63ed('0x2')]}};
\ No newline at end of file
+var _0xdd48=['moment','sequelize','STRING','DATE'];(function(_0x11afde,_0x5defc5){var _0x591a00=function(_0x98dbb1){while(--_0x98dbb1){_0x11afde['push'](_0x11afde['shift']());}};_0x591a00(++_0x5defc5);}(_0xdd48,0xec));var _0x8dd4=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xdd48[_0x122ef9];return _0x42fba0;};'use strict';var moment=require(_0x8dd4('0x0'));var Sequelize=require(_0x8dd4('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x8dd4('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x8dd4('0x3')]},'leaveAt':{'type':Sequelize[_0x8dd4('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x8dd4('0x3')]},'reason':{'type':Sequelize[_0x8dd4('0x2')]}};
\ No newline at end of file
index a3a6f9e..ca4237f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ccb=['lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','save','update','then','error','stack','send','FaxQueueReport','rawAttributes','type','model','name','query','filters','intersection','attributes','nolimit','order','sort','where','pick','merge','map','VIRTUAL','includeAll','findAll','rows','keys','fields','include','options','find','create','catch','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra'];(function(_0x5e9590,_0x390b30){var _0x3d0ecd=function(_0x4a1738){while(--_0x4a1738){_0x5e9590['push'](_0x5e9590['shift']());}};_0x3d0ecd(++_0x390b30);}(_0x8ccb,0x1c4));var _0xb8cc=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x8ccb[_0x45d55e];return _0x29812a;};'use strict';var emlformat=require(_0xb8cc('0x0'));var rimraf=require(_0xb8cc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb8cc('0x2'));var rp=require(_0xb8cc('0x3'));var moment=require(_0xb8cc('0x4'));var BPromise=require(_0xb8cc('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb8cc('0x6'));var sox=require(_0xb8cc('0x7'));var csv=require(_0xb8cc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb8cc('0x9'));var _=require(_0xb8cc('0xa'));var squel=require(_0xb8cc('0xb'));var crypto=require('crypto');var jsforce=require(_0xb8cc('0xc'));var deskjs=require(_0xb8cc('0xd'));var toCsv=require(_0xb8cc('0x8'));var querystring=require('querystring');var Papa=require(_0xb8cc('0xe'));var Redis=require(_0xb8cc('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb8cc('0x10'));var hardwareService=require(_0xb8cc('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xb8cc('0x12'));var config=require(_0xb8cc('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xb8cc('0x14'))['db'];function respondWithStatusCode(_0x2c1cbc,_0xfd89e0){_0xfd89e0=_0xfd89e0||0xcc;return function(_0x2875e0){if(_0x2875e0){return _0x2c1cbc[_0xb8cc('0x15')](_0xfd89e0);}return _0x2c1cbc[_0xb8cc('0x16')](_0xfd89e0)[_0xb8cc('0x17')]();};}function respondWithResult(_0x4983ae,_0x11ecf2){_0x11ecf2=_0x11ecf2||0xc8;return function(_0x5ec8a7){if(_0x5ec8a7){return _0x4983ae[_0xb8cc('0x16')](_0x11ecf2)[_0xb8cc('0x18')](_0x5ec8a7);}};}function respondWithFilteredResult(_0x183056,_0x5f3b91){return function(_0x1f8b8d){if(_0x1f8b8d){var _0x274cab=typeof _0x5f3b91[_0xb8cc('0x19')]==='undefined'&&typeof _0x5f3b91[_0xb8cc('0x1a')]==='undefined';var _0x131c44=_0x1f8b8d['count'];var _0x2ac4cc=_0x274cab?0x0:_0x5f3b91[_0xb8cc('0x19')];var _0x2b7130=_0x274cab?_0x1f8b8d[_0xb8cc('0x1b')]:_0x5f3b91[_0xb8cc('0x19')]+_0x5f3b91['limit'];var _0x1c1022;if(_0x2b7130>=_0x131c44){_0x2b7130=_0x131c44;_0x1c1022=0xc8;}else{_0x1c1022=0xce;}_0x183056[_0xb8cc('0x16')](_0x1c1022);return _0x183056[_0xb8cc('0x1c')]('Content-Range',_0x2ac4cc+'-'+_0x2b7130+'/'+_0x131c44)[_0xb8cc('0x18')](_0x1f8b8d);}return null;};}function patchUpdates(_0x1a81b4){return function(_0x4a7aac){try{jsonpatch[_0xb8cc('0x1d')](_0x4a7aac,_0x1a81b4,!![]);}catch(_0xe5ad50){return BPromise['reject'](_0xe5ad50);}return _0x4a7aac[_0xb8cc('0x1e')]();};}function saveUpdates(_0xdcb33d,_0xd1c676){return function(_0x1d372c){if(_0x1d372c){return _0x1d372c[_0xb8cc('0x1f')](_0xdcb33d)[_0xb8cc('0x20')](function(_0x1a0467){return _0x1a0467;});}return null;};}function removeEntity(_0x59608c,_0x50aa38){return function(_0x8b6b21){if(_0x8b6b21){return _0x8b6b21['destroy']()[_0xb8cc('0x20')](function(){_0x59608c['status'](0xcc)[_0xb8cc('0x17')]();});}};}function handleEntityNotFound(_0xbb1918,_0x335f32){return function(_0x77a162){if(!_0x77a162){_0xbb1918['sendStatus'](0x194);}return _0x77a162;};}function handleError(_0x2c4aa0,_0x2cc7f3){_0x2cc7f3=_0x2cc7f3||0x1f4;return function(_0x400de6){logger[_0xb8cc('0x21')](_0x400de6[_0xb8cc('0x22')]);if(_0x400de6['name']){delete _0x400de6['name'];}_0x2c4aa0[_0xb8cc('0x16')](_0x2cc7f3)[_0xb8cc('0x23')](_0x400de6);};}exports['index']=function(_0x3e4a37,_0x5cc936){var _0x23f204={},_0x2634a4={},_0x1d1514={'count':0x0,'rows':[]};var _0x118a18=_['map'](db[_0xb8cc('0x24')][_0xb8cc('0x25')],function(_0x282579){return{'name':_0x282579['fieldName'],'type':_0x282579[_0xb8cc('0x26')]['key']};});_0x2634a4[_0xb8cc('0x27')]=_['map'](_0x118a18,_0xb8cc('0x28'));_0x2634a4[_0xb8cc('0x29')]=_['keys'](_0x3e4a37[_0xb8cc('0x29')]);_0x2634a4[_0xb8cc('0x2a')]=_[_0xb8cc('0x2b')](_0x2634a4[_0xb8cc('0x27')],_0x2634a4[_0xb8cc('0x29')]);_0x23f204[_0xb8cc('0x2c')]=_[_0xb8cc('0x2b')](_0x2634a4['model'],qs['fields'](_0x3e4a37[_0xb8cc('0x29')]['fields']));_0x23f204[_0xb8cc('0x2c')]=_0x23f204['attributes']['length']?_0x23f204[_0xb8cc('0x2c')]:_0x2634a4[_0xb8cc('0x27')];if(!_0x3e4a37[_0xb8cc('0x29')]['hasOwnProperty'](_0xb8cc('0x2d'))){_0x23f204[_0xb8cc('0x1a')]=qs[_0xb8cc('0x1a')](_0x3e4a37[_0xb8cc('0x29')][_0xb8cc('0x1a')]);_0x23f204[_0xb8cc('0x19')]=qs[_0xb8cc('0x19')](_0x3e4a37[_0xb8cc('0x29')][_0xb8cc('0x19')]);}_0x23f204[_0xb8cc('0x2e')]=qs[_0xb8cc('0x2f')](_0x3e4a37[_0xb8cc('0x29')][_0xb8cc('0x2f')]);_0x23f204[_0xb8cc('0x30')]=qs[_0xb8cc('0x2a')](_[_0xb8cc('0x31')](_0x3e4a37[_0xb8cc('0x29')],_0x2634a4[_0xb8cc('0x2a')]),_0x118a18);if(_0x3e4a37['query']['filter']){_0x23f204[_0xb8cc('0x30')]=_[_0xb8cc('0x32')](_0x23f204[_0xb8cc('0x30')],{'$or':_[_0xb8cc('0x33')](_0x118a18,function(_0x25cde5){if(_0x25cde5[_0xb8cc('0x26')]!==_0xb8cc('0x34')){var _0x1564e9={};_0x1564e9[_0x25cde5[_0xb8cc('0x28')]]={'$like':'%'+_0x3e4a37['query']['filter']+'%'};return _0x1564e9;}})});}_0x23f204=_['merge']({},_0x23f204,_0x3e4a37['options']);var _0xf7a2c={'where':_0x23f204['where']};return db[_0xb8cc('0x24')]['count'](_0xf7a2c)[_0xb8cc('0x20')](function(_0x23ece3){_0x1d1514[_0xb8cc('0x1b')]=_0x23ece3;if(_0x3e4a37[_0xb8cc('0x29')][_0xb8cc('0x35')]){_0x23f204['include']=[{'all':!![]}];}return db[_0xb8cc('0x24')][_0xb8cc('0x36')](_0x23f204);})[_0xb8cc('0x20')](function(_0x4d8942){_0x1d1514[_0xb8cc('0x37')]=_0x4d8942;return _0x1d1514;})['then'](respondWithFilteredResult(_0x5cc936,_0x23f204))['catch'](handleError(_0x5cc936,null));};exports['show']=function(_0x143679,_0xd54827){var _0x3d2f26={'raw':!![],'where':{'id':_0x143679['params']['id']}},_0x3f3a96={};_0x3f3a96['model']=_[_0xb8cc('0x38')](db['FaxQueueReport']['rawAttributes']);_0x3f3a96[_0xb8cc('0x29')]=_[_0xb8cc('0x38')](_0x143679[_0xb8cc('0x29')]);_0x3f3a96[_0xb8cc('0x2a')]=_['intersection'](_0x3f3a96[_0xb8cc('0x27')],_0x3f3a96[_0xb8cc('0x29')]);_0x3d2f26['attributes']=_[_0xb8cc('0x2b')](_0x3f3a96[_0xb8cc('0x27')],qs[_0xb8cc('0x39')](_0x143679[_0xb8cc('0x29')][_0xb8cc('0x39')]));_0x3d2f26[_0xb8cc('0x2c')]=_0x3d2f26[_0xb8cc('0x2c')]['length']?_0x3d2f26[_0xb8cc('0x2c')]:_0x3f3a96[_0xb8cc('0x27')];if(_0x143679[_0xb8cc('0x29')][_0xb8cc('0x35')]){_0x3d2f26[_0xb8cc('0x3a')]=[{'all':!![]}];}_0x3d2f26=_[_0xb8cc('0x32')]({},_0x3d2f26,_0x143679[_0xb8cc('0x3b')]);return db['FaxQueueReport'][_0xb8cc('0x3c')](_0x3d2f26)['then'](handleEntityNotFound(_0xd54827,null))['then'](respondWithResult(_0xd54827,null))['catch'](handleError(_0xd54827,null));};exports[_0xb8cc('0x3d')]=function(_0x1fe418,_0x210d59){return db[_0xb8cc('0x24')]['create'](_0x1fe418['body'],{})[_0xb8cc('0x20')](respondWithResult(_0x210d59,0xc9))[_0xb8cc('0x3e')](handleError(_0x210d59,null));};exports[_0xb8cc('0x1f')]=function(_0x3e5e32,_0x3216a4){if(_0x3e5e32[_0xb8cc('0x3f')]['id']){delete _0x3e5e32[_0xb8cc('0x3f')]['id'];}return db[_0xb8cc('0x24')][_0xb8cc('0x3c')]({'where':{'id':_0x3e5e32[_0xb8cc('0x40')]['id']}})['then'](handleEntityNotFound(_0x3216a4,null))[_0xb8cc('0x20')](saveUpdates(_0x3e5e32[_0xb8cc('0x3f')],null))[_0xb8cc('0x20')](respondWithResult(_0x3216a4,null))[_0xb8cc('0x3e')](handleError(_0x3216a4,null));};exports['destroy']=function(_0x2ac1be,_0x4688b4){return db[_0xb8cc('0x24')]['find']({'where':{'id':_0x2ac1be[_0xb8cc('0x40')]['id']}})[_0xb8cc('0x20')](handleEntityNotFound(_0x4688b4,null))[_0xb8cc('0x20')](removeEntity(_0x4688b4,null))['catch'](handleError(_0x4688b4,null));};exports[_0xb8cc('0x41')]=function(_0x289f6c,_0x563e4f){return db[_0xb8cc('0x24')][_0xb8cc('0x41')]()[_0xb8cc('0x20')](respondWithResult(_0x563e4f,null))['catch'](handleError(_0x563e4f,null));};
\ No newline at end of file
+var _0x280f=['sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','FaxQueueReport','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','length','options','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x197185,_0x251145){var _0x2c8af1=function(_0x1dbcfd){while(--_0x1dbcfd){_0x197185['push'](_0x197185['shift']());}};_0x2c8af1(++_0x251145);}(_0x280f,0xe2));var _0xf280=function(_0x46efd7,_0x43f84d){_0x46efd7=_0x46efd7-0x0;var _0x5637e4=_0x280f[_0x46efd7];return _0x5637e4;};'use strict';var emlformat=require(_0xf280('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf280('0x1'));var jsonpatch=require(_0xf280('0x2'));var rp=require(_0xf280('0x3'));var moment=require(_0xf280('0x4'));var BPromise=require(_0xf280('0x5'));var Mustache=require(_0xf280('0x6'));var util=require(_0xf280('0x7'));var path=require('path');var sox=require(_0xf280('0x8'));var csv=require(_0xf280('0x9'));var ejs=require(_0xf280('0xa'));var fs=require('fs');var fs_extra=require(_0xf280('0xb'));var _=require(_0xf280('0xc'));var squel=require('squel');var crypto=require(_0xf280('0xd'));var jsforce=require(_0xf280('0xe'));var deskjs=require(_0xf280('0xf'));var toCsv=require(_0xf280('0x9'));var querystring=require(_0xf280('0x10'));var Papa=require(_0xf280('0x11'));var Redis=require('ioredis');var authService=require(_0xf280('0x12'));var qs=require(_0xf280('0x13'));var as=require(_0xf280('0x14'));var hardwareService=require(_0xf280('0x15'));var logger=require(_0xf280('0x16'))(_0xf280('0x17'));var utils=require(_0xf280('0x18'));var config=require(_0xf280('0x19'));var licenseUtil=require(_0xf280('0x1a'));var db=require(_0xf280('0x1b'))['db'];function respondWithStatusCode(_0x148d24,_0x56221f){_0x56221f=_0x56221f||0xcc;return function(_0x566eb7){if(_0x566eb7){return _0x148d24[_0xf280('0x1c')](_0x56221f);}return _0x148d24[_0xf280('0x1d')](_0x56221f)[_0xf280('0x1e')]();};}function respondWithResult(_0x1d7175,_0x3e9acc){_0x3e9acc=_0x3e9acc||0xc8;return function(_0x59fb22){if(_0x59fb22){return _0x1d7175[_0xf280('0x1d')](_0x3e9acc)[_0xf280('0x1f')](_0x59fb22);}};}function respondWithFilteredResult(_0x34cadb,_0x224162){return function(_0x1e8f4d){if(_0x1e8f4d){var _0x462177=typeof _0x224162[_0xf280('0x20')]==='undefined'&&typeof _0x224162['limit']==='undefined';var _0x30a9a6=_0x1e8f4d['count'];var _0x11c2b0=_0x462177?0x0:_0x224162['offset'];var _0x2a19e7=_0x462177?_0x1e8f4d[_0xf280('0x21')]:_0x224162['offset']+_0x224162[_0xf280('0x22')];var _0x59b8af;if(_0x2a19e7>=_0x30a9a6){_0x2a19e7=_0x30a9a6;_0x59b8af=0xc8;}else{_0x59b8af=0xce;}_0x34cadb[_0xf280('0x1d')](_0x59b8af);return _0x34cadb[_0xf280('0x23')](_0xf280('0x24'),_0x11c2b0+'-'+_0x2a19e7+'/'+_0x30a9a6)[_0xf280('0x1f')](_0x1e8f4d);}return null;};}function patchUpdates(_0x11db7d){return function(_0x3a4eff){try{jsonpatch[_0xf280('0x25')](_0x3a4eff,_0x11db7d,!![]);}catch(_0x469bdf){return BPromise[_0xf280('0x26')](_0x469bdf);}return _0x3a4eff['save']();};}function saveUpdates(_0x1ad62a,_0x5a1aa1){return function(_0xfb624e){if(_0xfb624e){return _0xfb624e[_0xf280('0x27')](_0x1ad62a)[_0xf280('0x28')](function(_0x32039f){return _0x32039f;});}return null;};}function removeEntity(_0x3de08f,_0x42020c){return function(_0x4c3618){if(_0x4c3618){return _0x4c3618[_0xf280('0x29')]()[_0xf280('0x28')](function(){_0x3de08f[_0xf280('0x1d')](0xcc)[_0xf280('0x1e')]();});}};}function handleEntityNotFound(_0x35cd2d,_0x302132){return function(_0x4509c1){if(!_0x4509c1){_0x35cd2d[_0xf280('0x1c')](0x194);}return _0x4509c1;};}function handleError(_0x485788,_0x368b24){_0x368b24=_0x368b24||0x1f4;return function(_0x1b21fb){logger[_0xf280('0x2a')](_0x1b21fb[_0xf280('0x2b')]);if(_0x1b21fb['name']){delete _0x1b21fb['name'];}_0x485788['status'](_0x368b24)['send'](_0x1b21fb);};}exports['index']=function(_0x3da40e,_0x2409f4){var _0xa1fbb7={},_0x34edaf={},_0x545ccf={'count':0x0,'rows':[]};var _0x1cdf05=_['map'](db[_0xf280('0x2c')][_0xf280('0x2d')],function(_0x534233){return{'name':_0x534233[_0xf280('0x2e')],'type':_0x534233[_0xf280('0x2f')][_0xf280('0x30')]};});_0x34edaf[_0xf280('0x31')]=_['map'](_0x1cdf05,_0xf280('0x32'));_0x34edaf[_0xf280('0x33')]=_[_0xf280('0x34')](_0x3da40e[_0xf280('0x33')]);_0x34edaf[_0xf280('0x35')]=_[_0xf280('0x36')](_0x34edaf[_0xf280('0x31')],_0x34edaf[_0xf280('0x33')]);_0xa1fbb7['attributes']=_[_0xf280('0x36')](_0x34edaf[_0xf280('0x31')],qs[_0xf280('0x37')](_0x3da40e[_0xf280('0x33')]['fields']));_0xa1fbb7['attributes']=_0xa1fbb7[_0xf280('0x38')]['length']?_0xa1fbb7[_0xf280('0x38')]:_0x34edaf[_0xf280('0x31')];if(!_0x3da40e[_0xf280('0x33')][_0xf280('0x39')](_0xf280('0x3a'))){_0xa1fbb7['limit']=qs['limit'](_0x3da40e['query'][_0xf280('0x22')]);_0xa1fbb7['offset']=qs[_0xf280('0x20')](_0x3da40e[_0xf280('0x33')]['offset']);}_0xa1fbb7[_0xf280('0x3b')]=qs[_0xf280('0x3c')](_0x3da40e[_0xf280('0x33')][_0xf280('0x3c')]);_0xa1fbb7[_0xf280('0x3d')]=qs[_0xf280('0x35')](_[_0xf280('0x3e')](_0x3da40e[_0xf280('0x33')],_0x34edaf[_0xf280('0x35')]),_0x1cdf05);if(_0x3da40e[_0xf280('0x33')]['filter']){_0xa1fbb7[_0xf280('0x3d')]=_[_0xf280('0x3f')](_0xa1fbb7[_0xf280('0x3d')],{'$or':_[_0xf280('0x40')](_0x1cdf05,function(_0x263a56){if(_0x263a56['type']!==_0xf280('0x41')){var _0x1f9365={};_0x1f9365[_0x263a56['name']]={'$like':'%'+_0x3da40e[_0xf280('0x33')][_0xf280('0x42')]+'%'};return _0x1f9365;}})});}_0xa1fbb7=_[_0xf280('0x3f')]({},_0xa1fbb7,_0x3da40e['options']);var _0x1ff055={'where':_0xa1fbb7[_0xf280('0x3d')]};return db['FaxQueueReport'][_0xf280('0x21')](_0x1ff055)[_0xf280('0x28')](function(_0x422f4c){_0x545ccf[_0xf280('0x21')]=_0x422f4c;if(_0x3da40e[_0xf280('0x33')][_0xf280('0x43')]){_0xa1fbb7[_0xf280('0x44')]=[{'all':!![]}];}return db[_0xf280('0x2c')][_0xf280('0x45')](_0xa1fbb7);})[_0xf280('0x28')](function(_0x22822e){_0x545ccf['rows']=_0x22822e;return _0x545ccf;})[_0xf280('0x28')](respondWithFilteredResult(_0x2409f4,_0xa1fbb7))[_0xf280('0x46')](handleError(_0x2409f4,null));};exports[_0xf280('0x47')]=function(_0x408be4,_0x4dcffd){var _0x2ef2c6={'raw':!![],'where':{'id':_0x408be4[_0xf280('0x48')]['id']}},_0x456ac6={};_0x456ac6[_0xf280('0x31')]=_[_0xf280('0x34')](db['FaxQueueReport'][_0xf280('0x2d')]);_0x456ac6['query']=_[_0xf280('0x34')](_0x408be4['query']);_0x456ac6[_0xf280('0x35')]=_[_0xf280('0x36')](_0x456ac6[_0xf280('0x31')],_0x456ac6['query']);_0x2ef2c6['attributes']=_[_0xf280('0x36')](_0x456ac6[_0xf280('0x31')],qs['fields'](_0x408be4[_0xf280('0x33')][_0xf280('0x37')]));_0x2ef2c6[_0xf280('0x38')]=_0x2ef2c6[_0xf280('0x38')][_0xf280('0x49')]?_0x2ef2c6['attributes']:_0x456ac6[_0xf280('0x31')];if(_0x408be4[_0xf280('0x33')][_0xf280('0x43')]){_0x2ef2c6[_0xf280('0x44')]=[{'all':!![]}];}_0x2ef2c6=_[_0xf280('0x3f')]({},_0x2ef2c6,_0x408be4[_0xf280('0x4a')]);return db[_0xf280('0x2c')]['find'](_0x2ef2c6)[_0xf280('0x28')](handleEntityNotFound(_0x4dcffd,null))[_0xf280('0x28')](respondWithResult(_0x4dcffd,null))[_0xf280('0x46')](handleError(_0x4dcffd,null));};exports[_0xf280('0x4b')]=function(_0x5648cc,_0x29c7f0){return db[_0xf280('0x2c')]['create'](_0x5648cc[_0xf280('0x4c')],{})[_0xf280('0x28')](respondWithResult(_0x29c7f0,0xc9))['catch'](handleError(_0x29c7f0,null));};exports[_0xf280('0x27')]=function(_0x4991d9,_0x5f45ca){if(_0x4991d9[_0xf280('0x4c')]['id']){delete _0x4991d9[_0xf280('0x4c')]['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0x4991d9[_0xf280('0x48')]['id']}})['then'](handleEntityNotFound(_0x5f45ca,null))[_0xf280('0x28')](saveUpdates(_0x4991d9[_0xf280('0x4c')],null))[_0xf280('0x28')](respondWithResult(_0x5f45ca,null))[_0xf280('0x46')](handleError(_0x5f45ca,null));};exports[_0xf280('0x29')]=function(_0x1c4522,_0xc3a873){return db['FaxQueueReport'][_0xf280('0x4d')]({'where':{'id':_0x1c4522[_0xf280('0x48')]['id']}})['then'](handleEntityNotFound(_0xc3a873,null))['then'](removeEntity(_0xc3a873,null))['catch'](handleError(_0xc3a873,null));};exports['describe']=function(_0x5a8325,_0x1ed725){return db[_0xf280('0x2c')]['describe']()[_0xf280('0x28')](respondWithResult(_0x1ed725,null))[_0xf280('0x46')](handleError(_0x1ed725,null));};
\ No newline at end of file
index c1918d6..cce6da2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cb9=['api','moment','bluebird','path','rimraf','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','../../config/logger'];(function(_0x3e6d5d,_0x264c7a){var _0x238923=function(_0x201b19){while(--_0x201b19){_0x3e6d5d['push'](_0x3e6d5d['shift']());}};_0x238923(++_0x264c7a);}(_0x1cb9,0x14e));var _0x91cb=function(_0x43796a,_0x11cfcc){_0x43796a=_0x43796a-0x0;var _0x494964=_0x1cb9[_0x43796a];return _0x494964;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x91cb('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x53ec=['path','../../config/environment','./faxQueueReport.attributes','define','FaxQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x224177,_0x26fc45){var _0xb6699c=function(_0x3dfd05){while(--_0x3dfd05){_0x224177['push'](_0x224177['shift']());}};_0xb6699c(++_0x26fc45);}(_0x53ec,0x192));var _0xc53e=function(_0x224f65,_0x4750bf){_0x224f65=_0x224f65-0x0;var _0x3f921c=_0x53ec[_0x224f65];return _0x3f921c;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xc53e('0xb'),'fields':[_0xc53e('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 34b2af8..e1bc428 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe248=['where','attributes','limit','then','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateFaxQueueReport','FaxQueueReport','body','options','raw','info','UpdateFaxQueueReport'];(function(_0x357a73,_0x57e4f7){var _0x491c14=function(_0x789389){while(--_0x789389){_0x357a73['push'](_0x357a73['shift']());}};_0x491c14(++_0x57e4f7);}(_0xe248,0x9a));var _0x8e24=function(_0x353a30,_0x50c68a){_0x353a30=_0x353a30-0x0;var _0x213161=_0xe248[_0x353a30];return _0x213161;};'use strict';var _=require(_0x8e24('0x0'));var util=require(_0x8e24('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8e24('0x2'));var fs=require('fs');var Redis=require(_0x8e24('0x3'));var db=require(_0x8e24('0x4'))['db'];var utils=require(_0x8e24('0x5'));var logger=require('../../config/logger')(_0x8e24('0x6'));var config=require(_0x8e24('0x7'));var jayson=require(_0x8e24('0x8'));var client=jayson[_0x8e24('0x9')][_0x8e24('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2889ac,_0x2385b6,_0x1d8942){return new BPromise(function(_0x39dfaf,_0x523412){return client['request'](_0x2889ac,_0x1d8942)['then'](function(_0x3e963d){logger['info'](_0x8e24('0xb'),_0x2385b6,_0x8e24('0xc'));logger[_0x8e24('0xd')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x2385b6,_0x8e24('0xc'),JSON[_0x8e24('0xe')](_0x3e963d));if(_0x3e963d[_0x8e24('0xf')]){if(_0x3e963d['error']['code']===0x1f4){logger[_0x8e24('0xf')](_0x8e24('0xb'),_0x2385b6,_0x3e963d[_0x8e24('0xf')][_0x8e24('0x10')]);return _0x523412(_0x3e963d[_0x8e24('0xf')][_0x8e24('0x10')]);}logger[_0x8e24('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x2385b6,_0x3e963d[_0x8e24('0xf')][_0x8e24('0x10')]);return _0x39dfaf(_0x3e963d[_0x8e24('0xf')][_0x8e24('0x10')]);}else{logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x2385b6,_0x8e24('0xc'));_0x39dfaf(_0x3e963d[_0x8e24('0x11')][_0x8e24('0x10')]);}})[_0x8e24('0x12')](function(_0x5447c5){logger[_0x8e24('0xf')](_0x8e24('0xb'),_0x2385b6,_0x5447c5);_0x523412(_0x5447c5);});});}exports[_0x8e24('0x13')]=function(_0x604150){var _0x2e1c98=this;return new Promise(function(_0x20affb,_0x166599){return db[_0x8e24('0x14')]['create'](_0x604150[_0x8e24('0x15')],{'raw':_0x604150[_0x8e24('0x16')]?_0x604150[_0x8e24('0x16')][_0x8e24('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x56f9b0){logger[_0x8e24('0x18')]('CreateFaxQueueReport',_0x604150);logger['debug'](_0x8e24('0x13'),_0x604150,JSON[_0x8e24('0xe')](_0x56f9b0));_0x20affb(_0x56f9b0);})[_0x8e24('0x12')](function(_0x56ba5a){logger[_0x8e24('0xf')](_0x8e24('0x13'),_0x56ba5a[_0x8e24('0x10')],_0x604150);_0x166599(_0x2e1c98['error'](0x1f4,_0x56ba5a[_0x8e24('0x10')]));});});};exports[_0x8e24('0x19')]=function(_0x49eb7e){var _0x1d693e=this;return new Promise(function(_0x591a7f,_0x2d303b){return db[_0x8e24('0x14')]['update'](_0x49eb7e[_0x8e24('0x15')],{'raw':_0x49eb7e['options']?_0x49eb7e['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49eb7e[_0x8e24('0x16')]?_0x49eb7e[_0x8e24('0x16')][_0x8e24('0x1a')]||null:null,'attributes':_0x49eb7e[_0x8e24('0x16')]?_0x49eb7e[_0x8e24('0x16')][_0x8e24('0x1b')]||null:null,'limit':_0x49eb7e[_0x8e24('0x16')]?_0x49eb7e[_0x8e24('0x16')][_0x8e24('0x1c')]||null:null})[_0x8e24('0x1d')](function(_0x20b74b){logger[_0x8e24('0x18')](_0x8e24('0x19'),_0x49eb7e);logger['debug']('UpdateFaxQueueReport',_0x49eb7e,JSON['stringify'](_0x20b74b));_0x591a7f(_0x20b74b);})[_0x8e24('0x12')](function(_0x2cea9c){logger[_0x8e24('0xf')](_0x8e24('0x19'),_0x2cea9c[_0x8e24('0x10')],_0x49eb7e);_0x2d303b(_0x1d693e[_0x8e24('0xf')](0x1f4,_0x2cea9c[_0x8e24('0x10')]));});});};
\ No newline at end of file
+var _0xd4fe=['create','body','raw','CreateFaxQueueReport','FaxQueueReport','update','options','limit','UpdateFaxQueueReport','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','info','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x4a5b60,_0x382a8d){var _0x55c779=function(_0x3dfb52){while(--_0x3dfb52){_0x4a5b60['push'](_0x4a5b60['shift']());}};_0x55c779(++_0x382a8d);}(_0xd4fe,0x9f));var _0xed4f=function(_0x3c4c6e,_0x473754){_0x3c4c6e=_0x3c4c6e-0x0;var _0x55ff5f=_0xd4fe[_0x3c4c6e];return _0x55ff5f;};'use strict';var _=require(_0xed4f('0x0'));var util=require(_0xed4f('0x1'));var moment=require('moment');var BPromise=require(_0xed4f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed4f('0x3'));var db=require(_0xed4f('0x4'))['db'];var utils=require(_0xed4f('0x5'));var logger=require('../../config/logger')(_0xed4f('0x6'));var config=require('../../config/environment');var jayson=require(_0xed4f('0x7'));var client=jayson['client'][_0xed4f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4b847c,_0x42ba43,_0x163f7b){return new BPromise(function(_0x821468,_0x5ef53f){return client['request'](_0x4b847c,_0x163f7b)[_0xed4f('0x9')](function(_0x3d0ac3){logger[_0xed4f('0xa')](_0xed4f('0xb'),_0x42ba43,'request\x20sent');logger[_0xed4f('0xc')](_0xed4f('0xd'),_0x42ba43,_0xed4f('0xe'),JSON[_0xed4f('0xf')](_0x3d0ac3));if(_0x3d0ac3[_0xed4f('0x10')]){if(_0x3d0ac3['error'][_0xed4f('0x11')]===0x1f4){logger['error'](_0xed4f('0xb'),_0x42ba43,_0x3d0ac3[_0xed4f('0x10')][_0xed4f('0x12')]);return _0x5ef53f(_0x3d0ac3[_0xed4f('0x10')][_0xed4f('0x12')]);}logger[_0xed4f('0x10')]('FaxQueueReport,\x20%s,\x20%s',_0x42ba43,_0x3d0ac3['error']['message']);return _0x821468(_0x3d0ac3[_0xed4f('0x10')][_0xed4f('0x12')]);}else{logger['info'](_0xed4f('0xb'),_0x42ba43,_0xed4f('0xe'));_0x821468(_0x3d0ac3[_0xed4f('0x13')][_0xed4f('0x12')]);}})[_0xed4f('0x14')](function(_0x56e18a){logger[_0xed4f('0x10')](_0xed4f('0xb'),_0x42ba43,_0x56e18a);_0x5ef53f(_0x56e18a);});});}exports['CreateFaxQueueReport']=function(_0x5067f3){var _0x5c7164=this;return new Promise(function(_0x3777ad,_0x210779){return db['FaxQueueReport'][_0xed4f('0x15')](_0x5067f3[_0xed4f('0x16')],{'raw':_0x5067f3['options']?_0x5067f3['options'][_0xed4f('0x17')]===undefined?!![]:![]:!![]})[_0xed4f('0x9')](function(_0x3677c8){logger[_0xed4f('0xa')](_0xed4f('0x18'),_0x5067f3);logger[_0xed4f('0xc')]('CreateFaxQueueReport',_0x5067f3,JSON['stringify'](_0x3677c8));_0x3777ad(_0x3677c8);})[_0xed4f('0x14')](function(_0x8a769e){logger[_0xed4f('0x10')](_0xed4f('0x18'),_0x8a769e[_0xed4f('0x12')],_0x5067f3);_0x210779(_0x5c7164['error'](0x1f4,_0x8a769e['message']));});});};exports['UpdateFaxQueueReport']=function(_0x1eef7c){var _0x34ea94=this;return new Promise(function(_0x15e1c5,_0x37ceee){return db[_0xed4f('0x19')][_0xed4f('0x1a')](_0x1eef7c[_0xed4f('0x16')],{'raw':_0x1eef7c[_0xed4f('0x1b')]?_0x1eef7c[_0xed4f('0x1b')][_0xed4f('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1eef7c[_0xed4f('0x1b')]?_0x1eef7c[_0xed4f('0x1b')]['where']||null:null,'attributes':_0x1eef7c['options']?_0x1eef7c[_0xed4f('0x1b')]['attributes']||null:null,'limit':_0x1eef7c[_0xed4f('0x1b')]?_0x1eef7c[_0xed4f('0x1b')][_0xed4f('0x1c')]||null:null})[_0xed4f('0x9')](function(_0x248d15){logger['info'](_0xed4f('0x1d'),_0x1eef7c);logger[_0xed4f('0xc')](_0xed4f('0x1d'),_0x1eef7c,JSON[_0xed4f('0xf')](_0x248d15));_0x15e1c5(_0x248d15);})['catch'](function(_0x209ee8){logger[_0xed4f('0x10')](_0xed4f('0x1d'),_0x209ee8[_0xed4f('0x12')],_0x1eef7c);_0x37ceee(_0x34ea94[_0xed4f('0x10')](0x1f4,_0x209ee8[_0xed4f('0x12')]));});});};
\ No newline at end of file
index 000479c..6c051f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1171=['create','put','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x1171,0x115));var _0x1117=function(_0x414648,_0x34a290){_0x414648=_0x414648-0x0;var _0x3fae7=_0x1171[_0x414648];return _0x3fae7;};'use strict';var multer=require(_0x1117('0x0'));var util=require(_0x1117('0x1'));var path=require(_0x1117('0x2'));var timeout=require('connect-timeout');var express=require(_0x1117('0x3'));var router=express[_0x1117('0x4')]();var fs_extra=require(_0x1117('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1117('0x6'));var config=require(_0x1117('0x7'));var controller=require(_0x1117('0x8'));router[_0x1117('0x9')]('/',auth[_0x1117('0xa')](),controller[_0x1117('0xb')]);router[_0x1117('0x9')](_0x1117('0xc'),auth[_0x1117('0xa')](),controller[_0x1117('0xd')]);router['get'](_0x1117('0xe'),auth[_0x1117('0xa')](),controller[_0x1117('0xf')]);router[_0x1117('0x10')]('/',auth[_0x1117('0xa')](),controller[_0x1117('0x11')]);router[_0x1117('0x12')]('/:id',auth[_0x1117('0xa')](),controller['update']);router[_0x1117('0x13')](_0x1117('0xe'),auth['isAuthenticated'](),controller[_0x1117('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x9278=['path','Router','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','put','update','delete','multer','util'];(function(_0x479650,_0x2bee99){var _0x26b288=function(_0x1ba49f){while(--_0x1ba49f){_0x479650['push'](_0x479650['shift']());}};_0x26b288(++_0x2bee99);}(_0x9278,0xa8));var _0x8927=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x9278[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x8927('0x0'));var util=require(_0x8927('0x1'));var path=require(_0x8927('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8927('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8927('0x4'));var config=require(_0x8927('0x5'));var controller=require(_0x8927('0x6'));router[_0x8927('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8927('0x8'),auth[_0x8927('0x9')](),controller[_0x8927('0xa')]);router[_0x8927('0x7')](_0x8927('0xb'),auth['isAuthenticated'](),controller[_0x8927('0xc')]);router[_0x8927('0xd')]('/',auth[_0x8927('0x9')](),controller['create']);router[_0x8927('0xe')](_0x8927('0xb'),auth[_0x8927('0x9')](),controller[_0x8927('0xf')]);router[_0x8927('0x10')]('/:id',auth[_0x8927('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 23238d9..ef2d993 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x4d561c,_0x5da229){var _0x2b7ed4=function(_0x579593){while(--_0x579593){_0x4d561c['push'](_0x4d561c['shift']());}};_0x2b7ed4(++_0x5da229);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x15ea09,_0x2f30ab){_0x15ea09=_0x15ea09-0x0;var _0x3e9c78=_0xcb91[_0x15ea09];return _0x3e9c78;};'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
+var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x1f93e8,_0x3866e1){var _0x151973=function(_0x3b86ff){while(--_0x3b86ff){_0x1f93e8['push'](_0x1f93e8['shift']());}};_0x151973(++_0x3866e1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x54d49e,_0x5d9911){_0x54d49e=_0x54d49e-0x0;var _0x4af0f1=_0xcb91[_0x54d49e];return _0x4af0f1;};'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 7886e10..5e48ca4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x376e=['limit','count','apply','update','then','destroy','sendStatus','stack','name','rawAttributes','map','query','keys','filters','intersection','model','attributes','fields','order','sort','where','pick','merge','VIRTUAL','filter','options','FaxTransferReport','includeAll','include','rows','params','length','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined'];(function(_0x4c356f,_0x2054c8){var _0x1c7630=function(_0x1f9773){while(--_0x1f9773){_0x4c356f['push'](_0x4c356f['shift']());}};_0x1c7630(++_0x2054c8);}(_0x376e,0x135));var _0xe376=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x376e[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0xe376('0x0'));var rimraf=require(_0xe376('0x1'));var zipdir=require(_0xe376('0x2'));var jsonpatch=require(_0xe376('0x3'));var rp=require(_0xe376('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe376('0x5'));var util=require(_0xe376('0x6'));var path=require(_0xe376('0x7'));var sox=require(_0xe376('0x8'));var csv=require(_0xe376('0x9'));var ejs=require(_0xe376('0xa'));var fs=require('fs');var fs_extra=require(_0xe376('0xb'));var _=require(_0xe376('0xc'));var squel=require(_0xe376('0xd'));var crypto=require('crypto');var jsforce=require(_0xe376('0xe'));var deskjs=require(_0xe376('0xf'));var toCsv=require(_0xe376('0x9'));var querystring=require(_0xe376('0x10'));var Papa=require(_0xe376('0x11'));var Redis=require('ioredis');var authService=require(_0xe376('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe376('0x13'));var hardwareService=require(_0xe376('0x14'));var logger=require(_0xe376('0x15'))(_0xe376('0x16'));var utils=require('../../config/utils');var config=require(_0xe376('0x17'));var licenseUtil=require(_0xe376('0x18'));var db=require(_0xe376('0x19'))['db'];function respondWithStatusCode(_0x17a66f,_0x455ae0){_0x455ae0=_0x455ae0||0xcc;return function(_0x1a39ee){if(_0x1a39ee){return _0x17a66f['sendStatus'](_0x455ae0);}return _0x17a66f['status'](_0x455ae0)[_0xe376('0x1a')]();};}function respondWithResult(_0x2bad72,_0x1c9504){_0x1c9504=_0x1c9504||0xc8;return function(_0x1018be){if(_0x1018be){return _0x2bad72[_0xe376('0x1b')](_0x1c9504)[_0xe376('0x1c')](_0x1018be);}};}function respondWithFilteredResult(_0x3f7dfe,_0x5c855c){return function(_0x6519cf){if(_0x6519cf){var _0x58ccba=typeof _0x5c855c[_0xe376('0x1d')]===_0xe376('0x1e')&&typeof _0x5c855c[_0xe376('0x1f')]===_0xe376('0x1e');var _0x31157b=_0x6519cf[_0xe376('0x20')];var _0x236036=_0x58ccba?0x0:_0x5c855c[_0xe376('0x1d')];var _0x4d328d=_0x58ccba?_0x6519cf[_0xe376('0x20')]:_0x5c855c['offset']+_0x5c855c[_0xe376('0x1f')];var _0x49d9ac;if(_0x4d328d>=_0x31157b){_0x4d328d=_0x31157b;_0x49d9ac=0xc8;}else{_0x49d9ac=0xce;}_0x3f7dfe[_0xe376('0x1b')](_0x49d9ac);return _0x3f7dfe['set']('Content-Range',_0x236036+'-'+_0x4d328d+'/'+_0x31157b)[_0xe376('0x1c')](_0x6519cf);}return null;};}function patchUpdates(_0x4aff9a){return function(_0x53f2d0){try{jsonpatch[_0xe376('0x21')](_0x53f2d0,_0x4aff9a,!![]);}catch(_0x16bcdf){return BPromise['reject'](_0x16bcdf);}return _0x53f2d0['save']();};}function saveUpdates(_0x53973d,_0x2b2fc2){return function(_0x5d7f00){if(_0x5d7f00){return _0x5d7f00[_0xe376('0x22')](_0x53973d)[_0xe376('0x23')](function(_0xc01977){return _0xc01977;});}return null;};}function removeEntity(_0x55ca3c,_0x2198f1){return function(_0x69005){if(_0x69005){return _0x69005[_0xe376('0x24')]()[_0xe376('0x23')](function(){_0x55ca3c[_0xe376('0x1b')](0xcc)[_0xe376('0x1a')]();});}};}function handleEntityNotFound(_0x528a68,_0x5bc5f7){return function(_0xeb40f9){if(!_0xeb40f9){_0x528a68[_0xe376('0x25')](0x194);}return _0xeb40f9;};}function handleError(_0xbe17a7,_0x1ab5e1){_0x1ab5e1=_0x1ab5e1||0x1f4;return function(_0xf3fab){logger['error'](_0xf3fab[_0xe376('0x26')]);if(_0xf3fab[_0xe376('0x27')]){delete _0xf3fab[_0xe376('0x27')];}_0xbe17a7[_0xe376('0x1b')](_0x1ab5e1)['send'](_0xf3fab);};}exports['index']=function(_0x417d19,_0x5b27ee){var _0x570041={},_0x47fb24={},_0x5f106a={'count':0x0,'rows':[]};var _0x4f2d1e=_['map'](db['FaxTransferReport'][_0xe376('0x28')],function(_0x1e1abb){return{'name':_0x1e1abb['fieldName'],'type':_0x1e1abb['type']['key']};});_0x47fb24['model']=_[_0xe376('0x29')](_0x4f2d1e,_0xe376('0x27'));_0x47fb24[_0xe376('0x2a')]=_[_0xe376('0x2b')](_0x417d19[_0xe376('0x2a')]);_0x47fb24[_0xe376('0x2c')]=_[_0xe376('0x2d')](_0x47fb24[_0xe376('0x2e')],_0x47fb24['query']);_0x570041[_0xe376('0x2f')]=_[_0xe376('0x2d')](_0x47fb24[_0xe376('0x2e')],qs[_0xe376('0x30')](_0x417d19['query']['fields']));_0x570041[_0xe376('0x2f')]=_0x570041[_0xe376('0x2f')]['length']?_0x570041[_0xe376('0x2f')]:_0x47fb24[_0xe376('0x2e')];if(!_0x417d19[_0xe376('0x2a')]['hasOwnProperty']('nolimit')){_0x570041[_0xe376('0x1f')]=qs['limit'](_0x417d19['query'][_0xe376('0x1f')]);_0x570041[_0xe376('0x1d')]=qs[_0xe376('0x1d')](_0x417d19[_0xe376('0x2a')][_0xe376('0x1d')]);}_0x570041[_0xe376('0x31')]=qs[_0xe376('0x32')](_0x417d19['query'][_0xe376('0x32')]);_0x570041[_0xe376('0x33')]=qs[_0xe376('0x2c')](_[_0xe376('0x34')](_0x417d19[_0xe376('0x2a')],_0x47fb24[_0xe376('0x2c')]),_0x4f2d1e);if(_0x417d19[_0xe376('0x2a')]['filter']){_0x570041[_0xe376('0x33')]=_[_0xe376('0x35')](_0x570041[_0xe376('0x33')],{'$or':_[_0xe376('0x29')](_0x4f2d1e,function(_0x5f5508){if(_0x5f5508['type']!==_0xe376('0x36')){var _0x4c06c6={};_0x4c06c6[_0x5f5508[_0xe376('0x27')]]={'$like':'%'+_0x417d19[_0xe376('0x2a')][_0xe376('0x37')]+'%'};return _0x4c06c6;}})});}_0x570041=_[_0xe376('0x35')]({},_0x570041,_0x417d19[_0xe376('0x38')]);var _0x3cf492={'where':_0x570041[_0xe376('0x33')]};return db[_0xe376('0x39')]['count'](_0x3cf492)['then'](function(_0xd6f2c0){_0x5f106a[_0xe376('0x20')]=_0xd6f2c0;if(_0x417d19[_0xe376('0x2a')][_0xe376('0x3a')]){_0x570041[_0xe376('0x3b')]=[{'all':!![]}];}return db[_0xe376('0x39')]['findAll'](_0x570041);})[_0xe376('0x23')](function(_0x47c0e6){_0x5f106a[_0xe376('0x3c')]=_0x47c0e6;return _0x5f106a;})[_0xe376('0x23')](respondWithFilteredResult(_0x5b27ee,_0x570041))['catch'](handleError(_0x5b27ee,null));};exports['show']=function(_0x11764f,_0x5af945){var _0x47bd5f={'raw':!![],'where':{'id':_0x11764f[_0xe376('0x3d')]['id']}},_0x72a0f7={};_0x72a0f7[_0xe376('0x2e')]=_[_0xe376('0x2b')](db['FaxTransferReport']['rawAttributes']);_0x72a0f7[_0xe376('0x2a')]=_[_0xe376('0x2b')](_0x11764f[_0xe376('0x2a')]);_0x72a0f7[_0xe376('0x2c')]=_[_0xe376('0x2d')](_0x72a0f7[_0xe376('0x2e')],_0x72a0f7[_0xe376('0x2a')]);_0x47bd5f[_0xe376('0x2f')]=_['intersection'](_0x72a0f7[_0xe376('0x2e')],qs['fields'](_0x11764f[_0xe376('0x2a')][_0xe376('0x30')]));_0x47bd5f['attributes']=_0x47bd5f[_0xe376('0x2f')][_0xe376('0x3e')]?_0x47bd5f[_0xe376('0x2f')]:_0x72a0f7[_0xe376('0x2e')];if(_0x11764f[_0xe376('0x2a')][_0xe376('0x3a')]){_0x47bd5f[_0xe376('0x3b')]=[{'all':!![]}];}_0x47bd5f=_[_0xe376('0x35')]({},_0x47bd5f,_0x11764f['options']);return db[_0xe376('0x39')]['find'](_0x47bd5f)[_0xe376('0x23')](handleEntityNotFound(_0x5af945,null))[_0xe376('0x23')](respondWithResult(_0x5af945,null))[_0xe376('0x3f')](handleError(_0x5af945,null));};exports[_0xe376('0x40')]=function(_0x4e89e0,_0x2255e8){return db[_0xe376('0x39')][_0xe376('0x40')](_0x4e89e0['body'],{})[_0xe376('0x23')](respondWithResult(_0x2255e8,0xc9))[_0xe376('0x3f')](handleError(_0x2255e8,null));};exports[_0xe376('0x22')]=function(_0x48248d,_0x200605){if(_0x48248d[_0xe376('0x41')]['id']){delete _0x48248d[_0xe376('0x41')]['id'];}return db[_0xe376('0x39')][_0xe376('0x42')]({'where':{'id':_0x48248d[_0xe376('0x3d')]['id']}})['then'](handleEntityNotFound(_0x200605,null))[_0xe376('0x23')](saveUpdates(_0x48248d['body'],null))[_0xe376('0x23')](respondWithResult(_0x200605,null))[_0xe376('0x3f')](handleError(_0x200605,null));};exports['destroy']=function(_0x20d6c2,_0x3a5687){return db[_0xe376('0x39')]['find']({'where':{'id':_0x20d6c2[_0xe376('0x3d')]['id']}})[_0xe376('0x23')](handleEntityNotFound(_0x3a5687,null))[_0xe376('0x23')](removeEntity(_0x3a5687,null))[_0xe376('0x3f')](handleError(_0x3a5687,null));};exports[_0xe376('0x43')]=function(_0x4af566,_0x1b3d8a){return db[_0xe376('0x39')][_0xe376('0x43')]()[_0xe376('0x23')](respondWithResult(_0x1b3d8a,null))[_0xe376('0x3f')](handleError(_0x1b3d8a,null));};
\ No newline at end of file
+var _0x68be=['type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','rawAttributes','includeAll','create','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','stack','name','send','index','FaxTransferReport','fieldName'];(function(_0x5ad07c,_0x324dcd){var _0x204bae=function(_0x1245bc){while(--_0x1245bc){_0x5ad07c['push'](_0x5ad07c['shift']());}};_0x204bae(++_0x324dcd);}(_0x68be,0x13f));var _0xe68b=function(_0x5aee17,_0x7859ca){_0x5aee17=_0x5aee17-0x0;var _0x1c4ba=_0x68be[_0x5aee17];return _0x1c4ba;};'use strict';var emlformat=require(_0xe68b('0x0'));var rimraf=require(_0xe68b('0x1'));var zipdir=require(_0xe68b('0x2'));var jsonpatch=require(_0xe68b('0x3'));var rp=require(_0xe68b('0x4'));var moment=require(_0xe68b('0x5'));var BPromise=require(_0xe68b('0x6'));var Mustache=require(_0xe68b('0x7'));var util=require(_0xe68b('0x8'));var path=require(_0xe68b('0x9'));var sox=require(_0xe68b('0xa'));var csv=require(_0xe68b('0xb'));var ejs=require(_0xe68b('0xc'));var fs=require('fs');var fs_extra=require(_0xe68b('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe68b('0xe'));var Redis=require(_0xe68b('0xf'));var authService=require(_0xe68b('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe68b('0x11'));var logger=require('../../config/logger')(_0xe68b('0x12'));var utils=require(_0xe68b('0x13'));var config=require(_0xe68b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xe68b('0x15'))['db'];function respondWithStatusCode(_0x151911,_0x24e0ce){_0x24e0ce=_0x24e0ce||0xcc;return function(_0x27e448){if(_0x27e448){return _0x151911[_0xe68b('0x16')](_0x24e0ce);}return _0x151911[_0xe68b('0x17')](_0x24e0ce)[_0xe68b('0x18')]();};}function respondWithResult(_0x276b4e,_0x1b8e44){_0x1b8e44=_0x1b8e44||0xc8;return function(_0x1d5f24){if(_0x1d5f24){return _0x276b4e['status'](_0x1b8e44)['json'](_0x1d5f24);}};}function respondWithFilteredResult(_0x2a659e,_0x1441ac){return function(_0x3c5456){if(_0x3c5456){var _0xb282fb=typeof _0x1441ac[_0xe68b('0x19')]===_0xe68b('0x1a')&&typeof _0x1441ac[_0xe68b('0x1b')]===_0xe68b('0x1a');var _0x53550e=_0x3c5456[_0xe68b('0x1c')];var _0x410771=_0xb282fb?0x0:_0x1441ac[_0xe68b('0x19')];var _0x12802d=_0xb282fb?_0x3c5456[_0xe68b('0x1c')]:_0x1441ac[_0xe68b('0x19')]+_0x1441ac[_0xe68b('0x1b')];var _0x373c41;if(_0x12802d>=_0x53550e){_0x12802d=_0x53550e;_0x373c41=0xc8;}else{_0x373c41=0xce;}_0x2a659e['status'](_0x373c41);return _0x2a659e[_0xe68b('0x1d')](_0xe68b('0x1e'),_0x410771+'-'+_0x12802d+'/'+_0x53550e)['json'](_0x3c5456);}return null;};}function patchUpdates(_0x33b84a){return function(_0x4b98e3){try{jsonpatch['apply'](_0x4b98e3,_0x33b84a,!![]);}catch(_0x35735b){return BPromise[_0xe68b('0x1f')](_0x35735b);}return _0x4b98e3[_0xe68b('0x20')]();};}function saveUpdates(_0x1c4cd9,_0x75960){return function(_0x377d90){if(_0x377d90){return _0x377d90['update'](_0x1c4cd9)[_0xe68b('0x21')](function(_0x4de201){return _0x4de201;});}return null;};}function removeEntity(_0x134e46,_0x25d6b1){return function(_0x45b1bc){if(_0x45b1bc){return _0x45b1bc[_0xe68b('0x22')]()[_0xe68b('0x21')](function(){_0x134e46[_0xe68b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf6c8ae,_0x2e564d){return function(_0x192dd6){if(!_0x192dd6){_0xf6c8ae[_0xe68b('0x16')](0x194);}return _0x192dd6;};}function handleError(_0x21d4ce,_0x4fda6a){_0x4fda6a=_0x4fda6a||0x1f4;return function(_0x2090a2){logger['error'](_0x2090a2[_0xe68b('0x23')]);if(_0x2090a2[_0xe68b('0x24')]){delete _0x2090a2[_0xe68b('0x24')];}_0x21d4ce['status'](_0x4fda6a)[_0xe68b('0x25')](_0x2090a2);};}exports[_0xe68b('0x26')]=function(_0x15f9d0,_0x1cbd22){var _0x255ca2={},_0x54f41b={},_0x12a6dd={'count':0x0,'rows':[]};var _0x4d0be5=_['map'](db[_0xe68b('0x27')]['rawAttributes'],function(_0x3e0951){return{'name':_0x3e0951[_0xe68b('0x28')],'type':_0x3e0951[_0xe68b('0x29')][_0xe68b('0x2a')]};});_0x54f41b[_0xe68b('0x2b')]=_[_0xe68b('0x2c')](_0x4d0be5,_0xe68b('0x24'));_0x54f41b[_0xe68b('0x2d')]=_[_0xe68b('0x2e')](_0x15f9d0[_0xe68b('0x2d')]);_0x54f41b[_0xe68b('0x2f')]=_[_0xe68b('0x30')](_0x54f41b[_0xe68b('0x2b')],_0x54f41b['query']);_0x255ca2[_0xe68b('0x31')]=_[_0xe68b('0x30')](_0x54f41b['model'],qs[_0xe68b('0x32')](_0x15f9d0[_0xe68b('0x2d')]['fields']));_0x255ca2[_0xe68b('0x31')]=_0x255ca2[_0xe68b('0x31')][_0xe68b('0x33')]?_0x255ca2[_0xe68b('0x31')]:_0x54f41b[_0xe68b('0x2b')];if(!_0x15f9d0[_0xe68b('0x2d')][_0xe68b('0x34')](_0xe68b('0x35'))){_0x255ca2[_0xe68b('0x1b')]=qs[_0xe68b('0x1b')](_0x15f9d0[_0xe68b('0x2d')][_0xe68b('0x1b')]);_0x255ca2[_0xe68b('0x19')]=qs[_0xe68b('0x19')](_0x15f9d0[_0xe68b('0x2d')][_0xe68b('0x19')]);}_0x255ca2['order']=qs[_0xe68b('0x36')](_0x15f9d0[_0xe68b('0x2d')][_0xe68b('0x36')]);_0x255ca2[_0xe68b('0x37')]=qs[_0xe68b('0x2f')](_['pick'](_0x15f9d0[_0xe68b('0x2d')],_0x54f41b['filters']),_0x4d0be5);if(_0x15f9d0['query'][_0xe68b('0x38')]){_0x255ca2[_0xe68b('0x37')]=_[_0xe68b('0x39')](_0x255ca2[_0xe68b('0x37')],{'$or':_[_0xe68b('0x2c')](_0x4d0be5,function(_0x38d8aa){if(_0x38d8aa[_0xe68b('0x29')]!==_0xe68b('0x3a')){var _0x150203={};_0x150203[_0x38d8aa[_0xe68b('0x24')]]={'$like':'%'+_0x15f9d0[_0xe68b('0x2d')][_0xe68b('0x38')]+'%'};return _0x150203;}})});}_0x255ca2=_['merge']({},_0x255ca2,_0x15f9d0[_0xe68b('0x3b')]);var _0x125d2b={'where':_0x255ca2[_0xe68b('0x37')]};return db[_0xe68b('0x27')][_0xe68b('0x1c')](_0x125d2b)[_0xe68b('0x21')](function(_0x354ff8){_0x12a6dd['count']=_0x354ff8;if(_0x15f9d0['query']['includeAll']){_0x255ca2[_0xe68b('0x3c')]=[{'all':!![]}];}return db[_0xe68b('0x27')][_0xe68b('0x3d')](_0x255ca2);})[_0xe68b('0x21')](function(_0x3fd3ea){_0x12a6dd['rows']=_0x3fd3ea;return _0x12a6dd;})[_0xe68b('0x21')](respondWithFilteredResult(_0x1cbd22,_0x255ca2))[_0xe68b('0x3e')](handleError(_0x1cbd22,null));};exports[_0xe68b('0x3f')]=function(_0x4d1ef4,_0x19d419){var _0x2dc734={'raw':!![],'where':{'id':_0x4d1ef4[_0xe68b('0x40')]['id']}},_0x40287a={};_0x40287a[_0xe68b('0x2b')]=_['keys'](db[_0xe68b('0x27')][_0xe68b('0x41')]);_0x40287a[_0xe68b('0x2d')]=_['keys'](_0x4d1ef4[_0xe68b('0x2d')]);_0x40287a[_0xe68b('0x2f')]=_[_0xe68b('0x30')](_0x40287a[_0xe68b('0x2b')],_0x40287a[_0xe68b('0x2d')]);_0x2dc734[_0xe68b('0x31')]=_[_0xe68b('0x30')](_0x40287a['model'],qs[_0xe68b('0x32')](_0x4d1ef4[_0xe68b('0x2d')]['fields']));_0x2dc734[_0xe68b('0x31')]=_0x2dc734[_0xe68b('0x31')][_0xe68b('0x33')]?_0x2dc734[_0xe68b('0x31')]:_0x40287a[_0xe68b('0x2b')];if(_0x4d1ef4['query'][_0xe68b('0x42')]){_0x2dc734['include']=[{'all':!![]}];}_0x2dc734=_[_0xe68b('0x39')]({},_0x2dc734,_0x4d1ef4[_0xe68b('0x3b')]);return db[_0xe68b('0x27')]['find'](_0x2dc734)[_0xe68b('0x21')](handleEntityNotFound(_0x19d419,null))['then'](respondWithResult(_0x19d419,null))[_0xe68b('0x3e')](handleError(_0x19d419,null));};exports[_0xe68b('0x43')]=function(_0xf486b9,_0x35a804){return db['FaxTransferReport']['create'](_0xf486b9[_0xe68b('0x44')],{})[_0xe68b('0x21')](respondWithResult(_0x35a804,0xc9))['catch'](handleError(_0x35a804,null));};exports[_0xe68b('0x45')]=function(_0x9dde9e,_0x1706e8){if(_0x9dde9e[_0xe68b('0x44')]['id']){delete _0x9dde9e[_0xe68b('0x44')]['id'];}return db[_0xe68b('0x27')][_0xe68b('0x46')]({'where':{'id':_0x9dde9e[_0xe68b('0x40')]['id']}})[_0xe68b('0x21')](handleEntityNotFound(_0x1706e8,null))[_0xe68b('0x21')](saveUpdates(_0x9dde9e['body'],null))[_0xe68b('0x21')](respondWithResult(_0x1706e8,null))['catch'](handleError(_0x1706e8,null));};exports['destroy']=function(_0x29a193,_0x31a458){return db[_0xe68b('0x27')][_0xe68b('0x46')]({'where':{'id':_0x29a193[_0xe68b('0x40')]['id']}})[_0xe68b('0x21')](handleEntityNotFound(_0x31a458,null))[_0xe68b('0x21')](removeEntity(_0x31a458,null))[_0xe68b('0x3e')](handleError(_0x31a458,null));};exports[_0xe68b('0x47')]=function(_0x4dc22a,_0x1e9fa1){return db[_0xe68b('0x27')][_0xe68b('0x47')]()[_0xe68b('0x21')](respondWithResult(_0x1e9fa1,null))[_0xe68b('0x3e')](handleError(_0x1e9fa1,null));};
\ No newline at end of file
index a4134bf..8053007 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x416b=['uniqueid','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer'];(function(_0x486f1d,_0x90c2b5){var _0x5a2c2d=function(_0x1a5f79){while(--_0x1a5f79){_0x486f1d['push'](_0x486f1d['shift']());}};_0x5a2c2d(++_0x90c2b5);}(_0x416b,0x1c8));var _0xb416=function(_0x146214,_0x13482f){_0x146214=_0x146214-0x0;var _0x2c2acb=_0x416b[_0x146214];return _0x2c2acb;};'use strict';var _=require(_0xb416('0x0'));var util=require(_0xb416('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb416('0x2'));var BPromise=require('bluebird');var rp=require(_0xb416('0x3'));var fs=require('fs');var path=require(_0xb416('0x4'));var rimraf=require(_0xb416('0x5'));var config=require(_0xb416('0x6'));var attributes=require(_0xb416('0x7'));module[_0xb416('0x8')]=function(_0x386517,_0x35bf96){return _0x386517[_0xb416('0x9')](_0xb416('0xa'),attributes,{'tableName':_0xb416('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb416('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x40cb=['api','moment','rimraf','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x10a984,_0x396e32){var _0x30ffcb=function(_0x4dceec){while(--_0x4dceec){_0x10a984['push'](_0x10a984['shift']());}};_0x30ffcb(++_0x396e32);}(_0x40cb,0x105));var _0xb40c=function(_0x413b19,_0x299538){_0x413b19=_0x413b19-0x0;var _0xb73bb6=_0x40cb[_0x413b19];return _0xb73bb6;};'use strict';var _=require(_0xb40c('0x0'));var util=require(_0xb40c('0x1'));var logger=require(_0xb40c('0x2'))(_0xb40c('0x3'));var moment=require(_0xb40c('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb40c('0x5'));var config=require('../../config/environment');var attributes=require(_0xb40c('0x6'));module[_0xb40c('0x7')]=function(_0xf28b4f,_0xfe8ac0){return _0xf28b4f[_0xb40c('0x8')](_0xb40c('0x9'),attributes,{'tableName':_0xb40c('0xa'),'paranoid':![],'indexes':[{'name':_0xb40c('0xb'),'fields':[_0xb40c('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index f4004a5..68bc981 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce75=['request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http'];(function(_0x46a7ef,_0x3c7736){var _0x3e192c=function(_0xb6d42b){while(--_0xb6d42b){_0x46a7ef['push'](_0x46a7ef['shift']());}};_0x3e192c(++_0x3c7736);}(_0xce75,0x126));var _0x5ce7=function(_0x1096f4,_0x280cb5){_0x1096f4=_0x1096f4-0x0;var _0x2aaf97=_0xce75[_0x1096f4];return _0x2aaf97;};'use strict';var _=require(_0x5ce7('0x0'));var util=require(_0x5ce7('0x1'));var moment=require(_0x5ce7('0x2'));var BPromise=require(_0x5ce7('0x3'));var rs=require(_0x5ce7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ce7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5ce7('0x6'))('rpc');var config=require(_0x5ce7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5ce7('0x8')][_0x5ce7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e51d7,_0x211c4d,_0x42742a){return new BPromise(function(_0xfa2a0c,_0xad88f0){return client[_0x5ce7('0xa')](_0x3e51d7,_0x42742a)['then'](function(_0x111bd6){logger[_0x5ce7('0xb')](_0x5ce7('0xc'),_0x211c4d,_0x5ce7('0xd'));logger[_0x5ce7('0xe')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x211c4d,_0x5ce7('0xd'),JSON['stringify'](_0x111bd6));if(_0x111bd6['error']){if(_0x111bd6[_0x5ce7('0xf')][_0x5ce7('0x10')]===0x1f4){logger[_0x5ce7('0xf')](_0x5ce7('0xc'),_0x211c4d,_0x111bd6[_0x5ce7('0xf')][_0x5ce7('0x11')]);return _0xad88f0(_0x111bd6[_0x5ce7('0xf')]['message']);}logger['error'](_0x5ce7('0xc'),_0x211c4d,_0x111bd6[_0x5ce7('0xf')][_0x5ce7('0x11')]);return _0xfa2a0c(_0x111bd6['error'][_0x5ce7('0x11')]);}else{logger[_0x5ce7('0xb')]('FaxTransferReport,\x20%s,\x20%s',_0x211c4d,_0x5ce7('0xd'));_0xfa2a0c(_0x111bd6[_0x5ce7('0x12')][_0x5ce7('0x11')]);}})['catch'](function(_0xeb3619){logger[_0x5ce7('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x211c4d,_0xeb3619);_0xad88f0(_0xeb3619);});});}
\ No newline at end of file
+var _0xb3d0=['rpc','../../config/environment','client','request','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb3d0,0x1af));var _0x0b3d=function(_0x4dd823,_0x336a6c){_0x4dd823=_0x4dd823-0x0;var _0x4412db=_0xb3d0[_0x4dd823];return _0x4412db;};'use strict';var _=require(_0x0b3d('0x0'));var util=require(_0x0b3d('0x1'));var moment=require('moment');var BPromise=require(_0x0b3d('0x2'));var rs=require(_0x0b3d('0x3'));var fs=require('fs');var Redis=require(_0x0b3d('0x4'));var db=require(_0x0b3d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0b3d('0x6'));var config=require(_0x0b3d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0b3d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c1307,_0x2dc456,_0x15b374){return new BPromise(function(_0x19fafa,_0x299428){return client[_0x0b3d('0x9')](_0x4c1307,_0x15b374)['then'](function(_0x51060a){logger['info'](_0x0b3d('0xa'),_0x2dc456,_0x0b3d('0xb'));logger[_0x0b3d('0xc')](_0x0b3d('0xd'),_0x2dc456,'request\x20sent',JSON[_0x0b3d('0xe')](_0x51060a));if(_0x51060a['error']){if(_0x51060a[_0x0b3d('0xf')]['code']===0x1f4){logger['error'](_0x0b3d('0xa'),_0x2dc456,_0x51060a[_0x0b3d('0xf')]['message']);return _0x299428(_0x51060a[_0x0b3d('0xf')][_0x0b3d('0x10')]);}logger[_0x0b3d('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x2dc456,_0x51060a['error']['message']);return _0x19fafa(_0x51060a[_0x0b3d('0xf')][_0x0b3d('0x10')]);}else{logger[_0x0b3d('0x11')](_0x0b3d('0xa'),_0x2dc456,_0x0b3d('0xb'));_0x19fafa(_0x51060a[_0x0b3d('0x12')][_0x0b3d('0x10')]);}})['catch'](function(_0x173f1e){logger['error'](_0x0b3d('0xa'),_0x2dc456,_0x173f1e);_0x299428(_0x173f1e);});});}
\ No newline at end of file
index b92716c..8e9ca3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32bd=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','put','update','delete'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x32bd,0x8e));var _0xd32b=function(_0x3c9c95,_0x170256){_0x3c9c95=_0x3c9c95-0x0;var _0x1e3f99=_0x32bd[_0x3c9c95];return _0x1e3f99;};'use strict';var multer=require(_0xd32b('0x0'));var util=require(_0xd32b('0x1'));var path=require(_0xd32b('0x2'));var timeout=require(_0xd32b('0x3'));var express=require('express');var router=express[_0xd32b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd32b('0x5'));var interaction=require(_0xd32b('0x6'));var config=require('../../config/environment');var controller=require(_0xd32b('0x7'));router[_0xd32b('0x8')]('/',auth['isAuthenticated'](),controller[_0xd32b('0x9')]);router[_0xd32b('0x8')](_0xd32b('0xa'),auth[_0xd32b('0xb')](),controller[_0xd32b('0xc')]);router[_0xd32b('0x8')](_0xd32b('0xd'),auth[_0xd32b('0xb')](),controller[_0xd32b('0xe')]);router['post']('/',auth[_0xd32b('0xb')](),controller['create']);router[_0xd32b('0xf')](_0xd32b('0xd'),auth['isAuthenticated'](),controller[_0xd32b('0x10')]);router[_0xd32b('0x11')](_0xd32b('0xd'),auth[_0xd32b('0xb')](),controller[_0xd32b('0x12')]);module[_0xd32b('0x13')]=router;
\ No newline at end of file
+var _0xff26=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xff26,0x19d));var _0x6ff2=function(_0x3322a0,_0xc75fc7){_0x3322a0=_0x3322a0-0x0;var _0x15be8e=_0xff26[_0x3322a0];return _0x15be8e;};'use strict';var multer=require(_0x6ff2('0x0'));var util=require(_0x6ff2('0x1'));var path=require(_0x6ff2('0x2'));var timeout=require(_0x6ff2('0x3'));var express=require(_0x6ff2('0x4'));var router=express[_0x6ff2('0x5')]();var fs_extra=require(_0x6ff2('0x6'));var auth=require(_0x6ff2('0x7'));var interaction=require(_0x6ff2('0x8'));var config=require(_0x6ff2('0x9'));var controller=require(_0x6ff2('0xa'));router[_0x6ff2('0xb')]('/',auth[_0x6ff2('0xc')](),controller[_0x6ff2('0xd')]);router[_0x6ff2('0xb')](_0x6ff2('0xe'),auth[_0x6ff2('0xc')](),controller[_0x6ff2('0xf')]);router[_0x6ff2('0xb')](_0x6ff2('0x10'),auth[_0x6ff2('0xc')](),controller[_0x6ff2('0x11')]);router[_0x6ff2('0x12')]('/',auth['isAuthenticated'](),controller[_0x6ff2('0x13')]);router[_0x6ff2('0x14')](_0x6ff2('0x10'),auth[_0x6ff2('0xc')](),controller[_0x6ff2('0x15')]);router[_0x6ff2('0x16')](_0x6ff2('0x10'),auth[_0x6ff2('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 69e9e9a..42e7c28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9e4=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0xb9e4,0x140));var _0x4b9e=function(_0x18a197,_0x471864){_0x18a197=_0x18a197-0x0;var _0x13c07f=_0xb9e4[_0x18a197];return _0x13c07f;};'use strict';var multer=require(_0x4b9e('0x0'));var util=require(_0x4b9e('0x1'));var path=require(_0x4b9e('0x2'));var timeout=require(_0x4b9e('0x3'));var express=require('express');var router=express[_0x4b9e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4b9e('0x5'));var interaction=require(_0x4b9e('0x6'));var config=require(_0x4b9e('0x7'));var controller=require('./intDeskAccount.controller');router[_0x4b9e('0x8')]('/',auth[_0x4b9e('0x9')](),controller['index']);router[_0x4b9e('0x8')](_0x4b9e('0xa'),auth[_0x4b9e('0x9')](),controller[_0x4b9e('0xb')]);router[_0x4b9e('0x8')](_0x4b9e('0xc'),auth['isAuthenticated'](),controller[_0x4b9e('0xd')]);router['get'](_0x4b9e('0xe'),auth[_0x4b9e('0x9')](),controller['getFields']);router[_0x4b9e('0xf')]('/',auth[_0x4b9e('0x9')](),controller[_0x4b9e('0x10')]);router[_0x4b9e('0xf')](_0x4b9e('0xc'),auth[_0x4b9e('0x9')](),controller[_0x4b9e('0x11')]);router['put'](_0x4b9e('0xa'),auth['isAuthenticated'](),controller[_0x4b9e('0x12')]);router[_0x4b9e('0x13')](_0x4b9e('0xa'),auth['isAuthenticated'](),controller[_0x4b9e('0x14')]);module[_0x4b9e('0x15')]=router;
\ No newline at end of file
+var _0x2a2a=['get','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','isAuthenticated','index'];(function(_0x5271e8,_0x391087){var _0x328211=function(_0x69acdb){while(--_0x69acdb){_0x5271e8['push'](_0x5271e8['shift']());}};_0x328211(++_0x391087);}(_0x2a2a,0xa3));var _0xa2a2=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0x2a2a[_0x55abd9];return _0x3e5669;};'use strict';var multer=require(_0xa2a2('0x0'));var util=require(_0xa2a2('0x1'));var path=require(_0xa2a2('0x2'));var timeout=require(_0xa2a2('0x3'));var express=require(_0xa2a2('0x4'));var router=express[_0xa2a2('0x5')]();var fs_extra=require(_0xa2a2('0x6'));var auth=require(_0xa2a2('0x7'));var interaction=require(_0xa2a2('0x8'));var config=require('../../config/environment');var controller=require(_0xa2a2('0x9'));router['get']('/',auth[_0xa2a2('0xa')](),controller[_0xa2a2('0xb')]);router[_0xa2a2('0xc')]('/:id',auth[_0xa2a2('0xa')](),controller[_0xa2a2('0xd')]);router['get'](_0xa2a2('0xe'),auth[_0xa2a2('0xa')](),controller[_0xa2a2('0xf')]);router[_0xa2a2('0xc')](_0xa2a2('0x10'),auth[_0xa2a2('0xa')](),controller[_0xa2a2('0x11')]);router[_0xa2a2('0x12')]('/',auth['isAuthenticated'](),controller[_0xa2a2('0x13')]);router[_0xa2a2('0x12')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xa2a2('0x14')]);router['put'](_0xa2a2('0x15'),auth[_0xa2a2('0xa')](),controller['update']);router[_0xa2a2('0x16')](_0xa2a2('0x15'),auth[_0xa2a2('0xa')](),controller[_0xa2a2('0x17')]);module[_0xa2a2('0x18')]=router;
\ No newline at end of file
index 0d08f89..20f3362 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7be4=['STRING','ENUM','basic','integrationTab','newTab','sequelize','exports'];(function(_0x140678,_0x22abb7){var _0x5db4d1=function(_0x77d3ed){while(--_0x77d3ed){_0x140678['push'](_0x140678['shift']());}};_0x5db4d1(++_0x22abb7);}(_0x7be4,0x7c));var _0x47be=function(_0x494990,_0x4267fd){_0x494990=_0x494990-0x0;var _0xd5649c=_0x7be4[_0x494990];return _0xd5649c;};'use strict';var Sequelize=require(_0x47be('0x0'));module[_0x47be('0x1')]={'name':{'type':Sequelize[_0x47be('0x2')]},'description':{'type':Sequelize[_0x47be('0x2')]},'username':{'type':Sequelize[_0x47be('0x2')]},'remoteUri':{'type':Sequelize[_0x47be('0x2')]},'authType':{'type':Sequelize[_0x47be('0x3')]('basic'),'defaultValue':_0x47be('0x4')},'password':{'type':Sequelize[_0x47be('0x2')]},'consumerKey':{'type':Sequelize[_0x47be('0x2')]},'consumerSecret':{'type':Sequelize[_0x47be('0x2')]},'token':{'type':Sequelize[_0x47be('0x2')]},'tokenSecret':{'type':Sequelize[_0x47be('0x2')]},'serverUrl':{'type':Sequelize[_0x47be('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x47be('0x3')](_0x47be('0x5'),_0x47be('0x6')),'defaultValue':_0x47be('0x5')}};
\ No newline at end of file
+var _0x61ad=['STRING','basic','ENUM','integrationTab','newTab','sequelize','exports'];(function(_0x455ed5,_0xab57cc){var _0x481ac4=function(_0x4e2e61){while(--_0x4e2e61){_0x455ed5['push'](_0x455ed5['shift']());}};_0x481ac4(++_0xab57cc);}(_0x61ad,0x17f));var _0xd61a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x61ad[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xd61a('0x0'));module[_0xd61a('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd61a('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xd61a('0x2')]},'authType':{'type':Sequelize['ENUM']('basic'),'defaultValue':_0xd61a('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0xd61a('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0xd61a('0x2')]},'serverUrl':{'type':Sequelize[_0xd61a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xd61a('0x4')](_0xd61a('0x5'),_0xd61a('0x6')),'defaultValue':'integrationTab'}};
\ No newline at end of file
index 20d8cd8..4cde12c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa923=['hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','keys','include','options','find','create','body','destroy','getConfigurations','findOne','pick','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','DeskConfiguration','Subjects','DeskField','getFields','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET','application/json','basic','headers','format','Basic\x20%s','%s:%s','base64','_embedded','entries','active','label','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','json','offset','undefined','limit','count','status','set','reject','save','update','then','sendStatus','error','stack','name','send','map','DeskAccount','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length'];(function(_0x59f008,_0x38de75){var _0x11d453=function(_0x33ac91){while(--_0x33ac91){_0x59f008['push'](_0x59f008['shift']());}};_0x11d453(++_0x38de75);}(_0xa923,0xb3));var _0x3a92=function(_0x957f0d,_0x527a78){_0x957f0d=_0x957f0d-0x0;var _0x38bd17=_0xa923[_0x957f0d];return _0x38bd17;};'use strict';var emlformat=require(_0x3a92('0x0'));var rimraf=require(_0x3a92('0x1'));var zipdir=require(_0x3a92('0x2'));var jsonpatch=require(_0x3a92('0x3'));var rp=require(_0x3a92('0x4'));var moment=require(_0x3a92('0x5'));var BPromise=require(_0x3a92('0x6'));var Mustache=require(_0x3a92('0x7'));var util=require('util');var path=require(_0x3a92('0x8'));var sox=require(_0x3a92('0x9'));var csv=require(_0x3a92('0xa'));var ejs=require(_0x3a92('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3a92('0xc'));var squel=require(_0x3a92('0xd'));var crypto=require(_0x3a92('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3a92('0xf'));var Papa=require(_0x3a92('0x10'));var Redis=require(_0x3a92('0x11'));var authService=require(_0x3a92('0x12'));var qs=require(_0x3a92('0x13'));var as=require(_0x3a92('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3a92('0x15'))(_0x3a92('0x16'));var utils=require(_0x3a92('0x17'));var config=require(_0x3a92('0x18'));var licenseUtil=require(_0x3a92('0x19'));var db=require(_0x3a92('0x1a'))['db'];var integrations=require(_0x3a92('0x1b'));function respondWithStatusCode(_0x51f0d4,_0x1d4935){_0x1d4935=_0x1d4935||0xcc;return function(_0x5f31c7){if(_0x5f31c7){return _0x51f0d4['sendStatus'](_0x1d4935);}return _0x51f0d4['status'](_0x1d4935)['end']();};}function respondWithResult(_0x3fb78c,_0x1891f6){_0x1891f6=_0x1891f6||0xc8;return function(_0x41cf56){if(_0x41cf56){return _0x3fb78c['status'](_0x1891f6)[_0x3a92('0x1c')](_0x41cf56);}};}function respondWithFilteredResult(_0x8c8544,_0x3e872f){return function(_0x274293){if(_0x274293){var _0x449d44=typeof _0x3e872f[_0x3a92('0x1d')]===_0x3a92('0x1e')&&typeof _0x3e872f[_0x3a92('0x1f')]===_0x3a92('0x1e');var _0x309d3e=_0x274293[_0x3a92('0x20')];var _0x30e1fa=_0x449d44?0x0:_0x3e872f['offset'];var _0xc77895=_0x449d44?_0x274293[_0x3a92('0x20')]:_0x3e872f['offset']+_0x3e872f[_0x3a92('0x1f')];var _0x3f7749;if(_0xc77895>=_0x309d3e){_0xc77895=_0x309d3e;_0x3f7749=0xc8;}else{_0x3f7749=0xce;}_0x8c8544[_0x3a92('0x21')](_0x3f7749);return _0x8c8544[_0x3a92('0x22')]('Content-Range',_0x30e1fa+'-'+_0xc77895+'/'+_0x309d3e)[_0x3a92('0x1c')](_0x274293);}return null;};}function patchUpdates(_0xd3f2d1){return function(_0x143d88){try{jsonpatch['apply'](_0x143d88,_0xd3f2d1,!![]);}catch(_0x11878b){return BPromise[_0x3a92('0x23')](_0x11878b);}return _0x143d88[_0x3a92('0x24')]();};}function saveUpdates(_0x48be79,_0x229a4d){return function(_0x21fe2b){if(_0x21fe2b){return _0x21fe2b[_0x3a92('0x25')](_0x48be79)[_0x3a92('0x26')](function(_0x48c7d9){return _0x48c7d9;});}return null;};}function removeEntity(_0x260b9d,_0x374ae5){return function(_0x23d376){if(_0x23d376){return _0x23d376['destroy']()[_0x3a92('0x26')](function(){_0x260b9d[_0x3a92('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fc332,_0x503e7b){return function(_0x6d96c8){if(!_0x6d96c8){_0x4fc332[_0x3a92('0x27')](0x194);}return _0x6d96c8;};}function handleError(_0x510e6a,_0x524902){_0x524902=_0x524902||0x1f4;return function(_0xcf91d7){logger[_0x3a92('0x28')](_0xcf91d7[_0x3a92('0x29')]);if(_0xcf91d7[_0x3a92('0x2a')]){delete _0xcf91d7['name'];}_0x510e6a[_0x3a92('0x21')](_0x524902)[_0x3a92('0x2b')](_0xcf91d7);};}exports['index']=function(_0x23b01b,_0x51a616){var _0x4b5211={},_0x13972e={},_0x3a0bff={'count':0x0,'rows':[]};var _0x561aa7=_[_0x3a92('0x2c')](db[_0x3a92('0x2d')][_0x3a92('0x2e')],function(_0xacb54d){return{'name':_0xacb54d[_0x3a92('0x2f')],'type':_0xacb54d[_0x3a92('0x30')]['key']};});_0x13972e[_0x3a92('0x31')]=_['map'](_0x561aa7,'name');_0x13972e['query']=_['keys'](_0x23b01b[_0x3a92('0x32')]);_0x13972e['filters']=_[_0x3a92('0x33')](_0x13972e['model'],_0x13972e[_0x3a92('0x32')]);_0x4b5211[_0x3a92('0x34')]=_[_0x3a92('0x33')](_0x13972e[_0x3a92('0x31')],qs['fields'](_0x23b01b[_0x3a92('0x32')][_0x3a92('0x35')]));_0x4b5211['attributes']=_0x4b5211[_0x3a92('0x34')][_0x3a92('0x36')]?_0x4b5211[_0x3a92('0x34')]:_0x13972e[_0x3a92('0x31')];if(!_0x23b01b[_0x3a92('0x32')][_0x3a92('0x37')](_0x3a92('0x38'))){_0x4b5211[_0x3a92('0x1f')]=qs[_0x3a92('0x1f')](_0x23b01b[_0x3a92('0x32')]['limit']);_0x4b5211[_0x3a92('0x1d')]=qs['offset'](_0x23b01b[_0x3a92('0x32')][_0x3a92('0x1d')]);}_0x4b5211[_0x3a92('0x39')]=qs[_0x3a92('0x3a')](_0x23b01b[_0x3a92('0x32')][_0x3a92('0x3a')]);_0x4b5211[_0x3a92('0x3b')]=qs['filters'](_['pick'](_0x23b01b[_0x3a92('0x32')],_0x13972e[_0x3a92('0x3c')]),_0x561aa7);if(_0x23b01b[_0x3a92('0x32')][_0x3a92('0x3d')]){_0x4b5211[_0x3a92('0x3b')]=_[_0x3a92('0x3e')](_0x4b5211[_0x3a92('0x3b')],{'$or':_['map'](_0x561aa7,function(_0x4572a2){if(_0x4572a2[_0x3a92('0x30')]!==_0x3a92('0x3f')){var _0x16c648={};_0x16c648[_0x4572a2[_0x3a92('0x2a')]]={'$like':'%'+_0x23b01b['query'][_0x3a92('0x3d')]+'%'};return _0x16c648;}})});}_0x4b5211=_[_0x3a92('0x3e')]({},_0x4b5211,_0x23b01b['options']);var _0x55a05c={'where':_0x4b5211['where']};return db[_0x3a92('0x2d')][_0x3a92('0x20')](_0x55a05c)[_0x3a92('0x26')](function(_0x318efa){_0x3a0bff[_0x3a92('0x20')]=_0x318efa;if(_0x23b01b[_0x3a92('0x32')][_0x3a92('0x40')]){_0x4b5211['include']=[{'all':!![]}];}return db['DeskAccount'][_0x3a92('0x41')](_0x4b5211);})['then'](function(_0x18a5c7){_0x3a0bff[_0x3a92('0x42')]=_0x18a5c7;return _0x3a0bff;})[_0x3a92('0x26')](respondWithFilteredResult(_0x51a616,_0x4b5211))[_0x3a92('0x43')](handleError(_0x51a616,null));};exports[_0x3a92('0x44')]=function(_0x45f477,_0x6c24db){var _0x2b1cf0={'raw':![],'where':{'id':_0x45f477[_0x3a92('0x45')]['id']}},_0x462cf3={};_0x462cf3[_0x3a92('0x31')]=_['keys'](db[_0x3a92('0x2d')][_0x3a92('0x2e')]);_0x462cf3[_0x3a92('0x32')]=_[_0x3a92('0x46')](_0x45f477[_0x3a92('0x32')]);_0x462cf3[_0x3a92('0x3c')]=_['intersection'](_0x462cf3[_0x3a92('0x31')],_0x462cf3['query']);_0x2b1cf0[_0x3a92('0x34')]=_[_0x3a92('0x33')](_0x462cf3[_0x3a92('0x31')],qs['fields'](_0x45f477[_0x3a92('0x32')][_0x3a92('0x35')]));_0x2b1cf0[_0x3a92('0x34')]=_0x2b1cf0['attributes'][_0x3a92('0x36')]?_0x2b1cf0[_0x3a92('0x34')]:_0x462cf3[_0x3a92('0x31')];if(_0x45f477[_0x3a92('0x32')][_0x3a92('0x40')]){_0x2b1cf0[_0x3a92('0x47')]=[{'all':!![]}];}_0x2b1cf0=_[_0x3a92('0x3e')]({},_0x2b1cf0,_0x45f477[_0x3a92('0x48')]);return db[_0x3a92('0x2d')][_0x3a92('0x49')](_0x2b1cf0)[_0x3a92('0x26')](handleEntityNotFound(_0x6c24db,null))['then'](respondWithResult(_0x6c24db,null))[_0x3a92('0x43')](handleError(_0x6c24db,null));};exports['create']=function(_0x1b438d,_0x5dabb5){return db['DeskAccount'][_0x3a92('0x4a')](_0x1b438d[_0x3a92('0x4b')],{})['then'](respondWithResult(_0x5dabb5,0xc9))[_0x3a92('0x43')](handleError(_0x5dabb5,null));};exports[_0x3a92('0x25')]=function(_0x38c4d4,_0x535c59){if(_0x38c4d4['body']['id']){delete _0x38c4d4[_0x3a92('0x4b')]['id'];}return db['DeskAccount']['find']({'where':{'id':_0x38c4d4['params']['id']}})[_0x3a92('0x26')](handleEntityNotFound(_0x535c59,null))['then'](saveUpdates(_0x38c4d4[_0x3a92('0x4b')],null))['then'](respondWithResult(_0x535c59,null))['catch'](handleError(_0x535c59,null));};exports[_0x3a92('0x4c')]=function(_0x39345d,_0x3b9e88){return db['DeskAccount'][_0x3a92('0x49')]({'where':{'id':_0x39345d[_0x3a92('0x45')]['id']}})[_0x3a92('0x26')](handleEntityNotFound(_0x3b9e88,null))[_0x3a92('0x26')](removeEntity(_0x3b9e88,null))[_0x3a92('0x43')](handleError(_0x3b9e88,null));};exports[_0x3a92('0x4d')]=function(_0x380b3c,_0x19c1cd,_0x2e762f){var _0x17ab37={};var _0x18e190={};var _0x1bc348;var _0x100c25;return db['DeskAccount'][_0x3a92('0x4e')]({'where':{'id':_0x380b3c[_0x3a92('0x45')]['id']}})['then'](handleEntityNotFound(_0x19c1cd,null))[_0x3a92('0x26')](function(_0x42ac23){if(_0x42ac23){_0x1bc348=_0x42ac23;_0x18e190['model']=_[_0x3a92('0x46')](db['DeskConfiguration'][_0x3a92('0x2e')]);_0x18e190[_0x3a92('0x32')]=_['keys'](_0x380b3c[_0x3a92('0x32')]);_0x18e190[_0x3a92('0x3c')]=_[_0x3a92('0x33')](_0x18e190[_0x3a92('0x31')],_0x18e190['query']);_0x17ab37['attributes']=_[_0x3a92('0x33')](_0x18e190['model'],qs[_0x3a92('0x35')](_0x380b3c['query'][_0x3a92('0x35')]));_0x17ab37[_0x3a92('0x34')]=_0x17ab37[_0x3a92('0x34')][_0x3a92('0x36')]?_0x17ab37['attributes']:_0x18e190[_0x3a92('0x31')];_0x17ab37['order']=qs[_0x3a92('0x3a')](_0x380b3c['query']['sort']);_0x17ab37[_0x3a92('0x3b')]=qs[_0x3a92('0x3c')](_[_0x3a92('0x4f')](_0x380b3c[_0x3a92('0x32')],_0x18e190['filters']));if(_0x380b3c['query'][_0x3a92('0x3d')]){_0x17ab37['where']=_['merge'](_0x17ab37['where'],{'$or':_[_0x3a92('0x2c')](_0x17ab37[_0x3a92('0x34')],function(_0x78c81a){var _0x15daa6={};_0x15daa6[_0x78c81a]={'$like':'%'+_0x380b3c[_0x3a92('0x32')]['filter']+'%'};return _0x15daa6;})});}_0x17ab37=_[_0x3a92('0x3e')]({},_0x17ab37,_0x380b3c['options']);return _0x1bc348[_0x3a92('0x4d')](_0x17ab37);}})['then'](function(_0x2b3db6){if(_0x2b3db6){_0x100c25=_0x2b3db6[_0x3a92('0x36')];if(!_0x380b3c[_0x3a92('0x32')][_0x3a92('0x37')](_0x3a92('0x38'))){_0x17ab37['limit']=qs[_0x3a92('0x1f')](_0x380b3c[_0x3a92('0x32')][_0x3a92('0x1f')]);_0x17ab37[_0x3a92('0x1d')]=qs[_0x3a92('0x1d')](_0x380b3c[_0x3a92('0x32')][_0x3a92('0x1d')]);}return _0x1bc348[_0x3a92('0x4d')](_0x17ab37);}})[_0x3a92('0x26')](function(_0x2d61c6){if(_0x2d61c6){return _0x2d61c6?{'count':_0x100c25,'rows':_0x2d61c6}:null;}})[_0x3a92('0x26')](respondWithResult(_0x19c1cd,null))['catch'](handleError(_0x19c1cd,null));};exports[_0x3a92('0x50')]=function(_0x29ef29,_0x343f01,_0x44ee24){if(_0x29ef29[_0x3a92('0x4b')]['id']){delete _0x29ef29[_0x3a92('0x4b')]['id'];}return db[_0x3a92('0x2d')]['findOne']({'where':{'id':_0x29ef29[_0x3a92('0x45')]['id']}})[_0x3a92('0x26')](handleEntityNotFound(_0x343f01,null))['then'](function(_0x59348f){if(_0x59348f){_0x29ef29[_0x3a92('0x4b')][_0x3a92('0x51')]=_0x59348f['id'];_0x29ef29[_0x3a92('0x4b')]['Subjects']=integrations[_0x3a92('0x52')](_0x29ef29[_0x3a92('0x4b')][_0x3a92('0x53')],_0x29ef29['body'][_0x3a92('0x30')]);_0x29ef29['body'][_0x3a92('0x54')]=integrations[_0x3a92('0x55')](_0x29ef29[_0x3a92('0x4b')][_0x3a92('0x53')],_0x29ef29[_0x3a92('0x4b')][_0x3a92('0x30')]);return db[_0x3a92('0x56')]['create'](_0x29ef29[_0x3a92('0x4b')],{'include':[{'model':db['DeskField'],'as':_0x3a92('0x57')},{'model':db[_0x3a92('0x58')],'as':'Descriptions'}]});}return null;})[_0x3a92('0x26')](respondWithResult(_0x343f01,null))[_0x3a92('0x43')](handleError(_0x343f01,null));};exports[_0x3a92('0x59')]=function(_0x23ec52,_0x19340a,_0xb0201c){var _0x353efd=[{'name':'priority','label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x548d6b='';return db[_0x3a92('0x2d')][_0x3a92('0x4e')]({'where':{'id':_0x23ec52[_0x3a92('0x45')]['id']},'attributes':['id',_0x3a92('0x5a'),_0x3a92('0x5b'),_0x3a92('0x5c'),_0x3a92('0x5d'),_0x3a92('0x5e'),_0x3a92('0x5f'),_0x3a92('0x60'),_0x3a92('0x61')]})['then'](handleEntityNotFound(_0x19340a,null))['then'](function(_0x1d01d5){if(_0x1d01d5){_0x548d6b=_0x1d01d5[_0x3a92('0x5a')];var _0x4b0e86=_0x548d6b[_0x3a92('0x62')](-0x1);if(_0x4b0e86==='/'){_0x548d6b=_0x548d6b[_0x3a92('0x63')](0x0,_0x548d6b[_0x3a92('0x64')](_0x4b0e86));}var _0x415cef={'method':_0x3a92('0x65'),'uri':util['format']('%s/custom_fields',_0x548d6b),'headers':{'Content-Type':_0x3a92('0x66'),'Accept':_0x3a92('0x66')},'json':!![]};if(_0x1d01d5[_0x3a92('0x5b')]===_0x3a92('0x67')){_0x415cef[_0x3a92('0x68')]['Authorization']=util[_0x3a92('0x69')](_0x3a92('0x6a'),new Buffer(util[_0x3a92('0x69')](_0x3a92('0x6b'),_0x1d01d5[_0x3a92('0x5c')],_0x1d01d5[_0x3a92('0x5d')]))['toString'](_0x3a92('0x6c')));}return rp(_0x415cef)[_0x3a92('0x26')](function(_0x331c77){return _0x353efd['concat'](_[_0x3a92('0x2c')](_0x331c77[_0x3a92('0x6d')][_0x3a92('0x6e')],function(_0xcda38b){return{'id':_0xcda38b['name'],'name':_0xcda38b[_0x3a92('0x2a')],'type':_0xcda38b[_0x3a92('0x30')],'active':_0xcda38b[_0x3a92('0x6f')],'label':_0xcda38b[_0x3a92('0x70')],'custom':!![]};}));});}})['then'](function(_0xf12eef){return{'count':_0xf12eef[_0x3a92('0x36')],'rows':_0xf12eef};})[_0x3a92('0x26')](respondWithResult(_0x19340a,null))[_0x3a92('0x43')](function(_0x424488){var _0x194211=_0x23ec52['query'][_0x3a92('0x71')]?0x1f4:_0x424488[_0x3a92('0x72')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x194211,JSON[_0x3a92('0x73')](_0x424488));delete _0x424488[_0x3a92('0x2a')];if(_0x194211===0x191){_0x194211=0x190;}_0x19340a[_0x3a92('0x21')](_0x194211)[_0x3a92('0x2b')](_0x23ec52[_0x3a92('0x32')][_0x3a92('0x71')]?{'message':_0x3a92('0x74'),'statusCode':_0x424488[_0x3a92('0x72')]}:_0x424488);});};
\ No newline at end of file
+var _0x3235=['channel','Descriptions','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','tokenSecret','slice','substring','format','application/json','headers','Authorization','%s:%s','toString','base64','concat','_embedded','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','sendStatus','error','stack','name','send','index','map','DeskAccount','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','rawAttributes','options','find','create','params','body','destroy','getConfigurations','DeskConfiguration','addConfiguration','findOne','Subjects','getSubjects'];(function(_0x14fad0,_0x278d75){var _0x5c665f=function(_0xe43a83){while(--_0xe43a83){_0x14fad0['push'](_0x14fad0['shift']());}};_0x5c665f(++_0x278d75);}(_0x3235,0x8b));var _0x5323=function(_0x11a6a6,_0x531bd8){_0x11a6a6=_0x11a6a6-0x0;var _0x4a08b4=_0x3235[_0x11a6a6];return _0x4a08b4;};'use strict';var emlformat=require(_0x5323('0x0'));var rimraf=require(_0x5323('0x1'));var zipdir=require(_0x5323('0x2'));var jsonpatch=require(_0x5323('0x3'));var rp=require(_0x5323('0x4'));var moment=require('moment');var BPromise=require(_0x5323('0x5'));var Mustache=require(_0x5323('0x6'));var util=require(_0x5323('0x7'));var path=require(_0x5323('0x8'));var sox=require(_0x5323('0x9'));var csv=require(_0x5323('0xa'));var ejs=require(_0x5323('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5323('0xc'));var squel=require('squel');var crypto=require(_0x5323('0xd'));var jsforce=require(_0x5323('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5323('0xa'));var querystring=require('querystring');var Papa=require(_0x5323('0xf'));var Redis=require('ioredis');var authService=require(_0x5323('0x10'));var qs=require(_0x5323('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5323('0x12'));var logger=require(_0x5323('0x13'))(_0x5323('0x14'));var utils=require(_0x5323('0x15'));var config=require(_0x5323('0x16'));var licenseUtil=require(_0x5323('0x17'));var db=require(_0x5323('0x18'))['db'];var integrations=require(_0x5323('0x19'));function respondWithStatusCode(_0x15dff2,_0x23512c){_0x23512c=_0x23512c||0xcc;return function(_0x4c030b){if(_0x4c030b){return _0x15dff2['sendStatus'](_0x23512c);}return _0x15dff2['status'](_0x23512c)[_0x5323('0x1a')]();};}function respondWithResult(_0x235e86,_0x5e6689){_0x5e6689=_0x5e6689||0xc8;return function(_0x376f46){if(_0x376f46){return _0x235e86[_0x5323('0x1b')](_0x5e6689)[_0x5323('0x1c')](_0x376f46);}};}function respondWithFilteredResult(_0x54642c,_0x462e87){return function(_0x34d7ad){if(_0x34d7ad){var _0x3985ae=typeof _0x462e87[_0x5323('0x1d')]===_0x5323('0x1e')&&typeof _0x462e87[_0x5323('0x1f')]==='undefined';var _0x57dbda=_0x34d7ad[_0x5323('0x20')];var _0x27ee65=_0x3985ae?0x0:_0x462e87[_0x5323('0x1d')];var _0x20f624=_0x3985ae?_0x34d7ad[_0x5323('0x20')]:_0x462e87[_0x5323('0x1d')]+_0x462e87[_0x5323('0x1f')];var _0x3e18e5;if(_0x20f624>=_0x57dbda){_0x20f624=_0x57dbda;_0x3e18e5=0xc8;}else{_0x3e18e5=0xce;}_0x54642c[_0x5323('0x1b')](_0x3e18e5);return _0x54642c['set'](_0x5323('0x21'),_0x27ee65+'-'+_0x20f624+'/'+_0x57dbda)['json'](_0x34d7ad);}return null;};}function patchUpdates(_0x482ea3){return function(_0x5a128b){try{jsonpatch[_0x5323('0x22')](_0x5a128b,_0x482ea3,!![]);}catch(_0x328858){return BPromise['reject'](_0x328858);}return _0x5a128b[_0x5323('0x23')]();};}function saveUpdates(_0x3ae1e4,_0x2ae8ce){return function(_0x362ca2){if(_0x362ca2){return _0x362ca2[_0x5323('0x24')](_0x3ae1e4)[_0x5323('0x25')](function(_0x1f2522){return _0x1f2522;});}return null;};}function removeEntity(_0x26be9f,_0x1e2a13){return function(_0x4d3f1e){if(_0x4d3f1e){return _0x4d3f1e['destroy']()['then'](function(){_0x26be9f[_0x5323('0x1b')](0xcc)[_0x5323('0x1a')]();});}};}function handleEntityNotFound(_0x13bc51,_0x599d6c){return function(_0x41dd56){if(!_0x41dd56){_0x13bc51[_0x5323('0x26')](0x194);}return _0x41dd56;};}function handleError(_0x28381b,_0x2384e3){_0x2384e3=_0x2384e3||0x1f4;return function(_0x366d31){logger[_0x5323('0x27')](_0x366d31[_0x5323('0x28')]);if(_0x366d31[_0x5323('0x29')]){delete _0x366d31['name'];}_0x28381b[_0x5323('0x1b')](_0x2384e3)[_0x5323('0x2a')](_0x366d31);};}exports[_0x5323('0x2b')]=function(_0x5ad729,_0x115c33){var _0x2d74c6={},_0x29fe7f={},_0x389934={'count':0x0,'rows':[]};var _0x2dc4f9=_[_0x5323('0x2c')](db[_0x5323('0x2d')]['rawAttributes'],function(_0x35235a){return{'name':_0x35235a[_0x5323('0x2e')],'type':_0x35235a['type'][_0x5323('0x2f')]};});_0x29fe7f[_0x5323('0x30')]=_[_0x5323('0x2c')](_0x2dc4f9,_0x5323('0x29'));_0x29fe7f['query']=_[_0x5323('0x31')](_0x5ad729[_0x5323('0x32')]);_0x29fe7f[_0x5323('0x33')]=_[_0x5323('0x34')](_0x29fe7f['model'],_0x29fe7f[_0x5323('0x32')]);_0x2d74c6[_0x5323('0x35')]=_[_0x5323('0x34')](_0x29fe7f[_0x5323('0x30')],qs['fields'](_0x5ad729[_0x5323('0x32')][_0x5323('0x36')]));_0x2d74c6[_0x5323('0x35')]=_0x2d74c6['attributes'][_0x5323('0x37')]?_0x2d74c6[_0x5323('0x35')]:_0x29fe7f['model'];if(!_0x5ad729[_0x5323('0x32')][_0x5323('0x38')](_0x5323('0x39'))){_0x2d74c6[_0x5323('0x1f')]=qs[_0x5323('0x1f')](_0x5ad729[_0x5323('0x32')]['limit']);_0x2d74c6[_0x5323('0x1d')]=qs[_0x5323('0x1d')](_0x5ad729['query'][_0x5323('0x1d')]);}_0x2d74c6[_0x5323('0x3a')]=qs[_0x5323('0x3b')](_0x5ad729[_0x5323('0x32')][_0x5323('0x3b')]);_0x2d74c6['where']=qs[_0x5323('0x33')](_[_0x5323('0x3c')](_0x5ad729[_0x5323('0x32')],_0x29fe7f['filters']),_0x2dc4f9);if(_0x5ad729['query']['filter']){_0x2d74c6[_0x5323('0x3d')]=_[_0x5323('0x3e')](_0x2d74c6[_0x5323('0x3d')],{'$or':_[_0x5323('0x2c')](_0x2dc4f9,function(_0x3eee6f){if(_0x3eee6f[_0x5323('0x3f')]!==_0x5323('0x40')){var _0x4c27db={};_0x4c27db[_0x3eee6f[_0x5323('0x29')]]={'$like':'%'+_0x5ad729[_0x5323('0x32')][_0x5323('0x41')]+'%'};return _0x4c27db;}})});}_0x2d74c6=_[_0x5323('0x3e')]({},_0x2d74c6,_0x5ad729['options']);var _0x4256f2={'where':_0x2d74c6[_0x5323('0x3d')]};return db[_0x5323('0x2d')]['count'](_0x4256f2)['then'](function(_0x52923b){_0x389934[_0x5323('0x20')]=_0x52923b;if(_0x5ad729[_0x5323('0x32')][_0x5323('0x42')]){_0x2d74c6[_0x5323('0x43')]=[{'all':!![]}];}return db['DeskAccount'][_0x5323('0x44')](_0x2d74c6);})[_0x5323('0x25')](function(_0xd3f701){_0x389934[_0x5323('0x45')]=_0xd3f701;return _0x389934;})[_0x5323('0x25')](respondWithFilteredResult(_0x115c33,_0x2d74c6))[_0x5323('0x46')](handleError(_0x115c33,null));};exports[_0x5323('0x47')]=function(_0x2d7831,_0x554d8d){var _0x15878d={'raw':![],'where':{'id':_0x2d7831['params']['id']}},_0x56889f={};_0x56889f[_0x5323('0x30')]=_['keys'](db[_0x5323('0x2d')][_0x5323('0x48')]);_0x56889f[_0x5323('0x32')]=_[_0x5323('0x31')](_0x2d7831[_0x5323('0x32')]);_0x56889f[_0x5323('0x33')]=_[_0x5323('0x34')](_0x56889f[_0x5323('0x30')],_0x56889f[_0x5323('0x32')]);_0x15878d['attributes']=_[_0x5323('0x34')](_0x56889f[_0x5323('0x30')],qs['fields'](_0x2d7831[_0x5323('0x32')]['fields']));_0x15878d['attributes']=_0x15878d[_0x5323('0x35')][_0x5323('0x37')]?_0x15878d[_0x5323('0x35')]:_0x56889f['model'];if(_0x2d7831[_0x5323('0x32')][_0x5323('0x42')]){_0x15878d[_0x5323('0x43')]=[{'all':!![]}];}_0x15878d=_[_0x5323('0x3e')]({},_0x15878d,_0x2d7831[_0x5323('0x49')]);return db[_0x5323('0x2d')][_0x5323('0x4a')](_0x15878d)[_0x5323('0x25')](handleEntityNotFound(_0x554d8d,null))['then'](respondWithResult(_0x554d8d,null))['catch'](handleError(_0x554d8d,null));};exports['create']=function(_0x564c67,_0xc2e966){return db[_0x5323('0x2d')][_0x5323('0x4b')](_0x564c67['body'],{})[_0x5323('0x25')](respondWithResult(_0xc2e966,0xc9))[_0x5323('0x46')](handleError(_0xc2e966,null));};exports[_0x5323('0x24')]=function(_0x8877d,_0xf56aa2){if(_0x8877d['body']['id']){delete _0x8877d['body']['id'];}return db[_0x5323('0x2d')][_0x5323('0x4a')]({'where':{'id':_0x8877d[_0x5323('0x4c')]['id']}})[_0x5323('0x25')](handleEntityNotFound(_0xf56aa2,null))[_0x5323('0x25')](saveUpdates(_0x8877d[_0x5323('0x4d')],null))[_0x5323('0x25')](respondWithResult(_0xf56aa2,null))[_0x5323('0x46')](handleError(_0xf56aa2,null));};exports[_0x5323('0x4e')]=function(_0x502eb4,_0x101cec){return db[_0x5323('0x2d')][_0x5323('0x4a')]({'where':{'id':_0x502eb4[_0x5323('0x4c')]['id']}})[_0x5323('0x25')](handleEntityNotFound(_0x101cec,null))[_0x5323('0x25')](removeEntity(_0x101cec,null))[_0x5323('0x46')](handleError(_0x101cec,null));};exports[_0x5323('0x4f')]=function(_0x30ba10,_0xa4def1,_0x2b90f7){var _0x15cd05={};var _0x48d34b={};var _0x59bc51;var _0x88d739;return db[_0x5323('0x2d')]['findOne']({'where':{'id':_0x30ba10[_0x5323('0x4c')]['id']}})['then'](handleEntityNotFound(_0xa4def1,null))[_0x5323('0x25')](function(_0xe9bb00){if(_0xe9bb00){_0x59bc51=_0xe9bb00;_0x48d34b[_0x5323('0x30')]=_[_0x5323('0x31')](db[_0x5323('0x50')][_0x5323('0x48')]);_0x48d34b[_0x5323('0x32')]=_['keys'](_0x30ba10[_0x5323('0x32')]);_0x48d34b[_0x5323('0x33')]=_[_0x5323('0x34')](_0x48d34b[_0x5323('0x30')],_0x48d34b[_0x5323('0x32')]);_0x15cd05[_0x5323('0x35')]=_[_0x5323('0x34')](_0x48d34b[_0x5323('0x30')],qs[_0x5323('0x36')](_0x30ba10[_0x5323('0x32')][_0x5323('0x36')]));_0x15cd05[_0x5323('0x35')]=_0x15cd05['attributes']['length']?_0x15cd05[_0x5323('0x35')]:_0x48d34b[_0x5323('0x30')];_0x15cd05[_0x5323('0x3a')]=qs[_0x5323('0x3b')](_0x30ba10['query'][_0x5323('0x3b')]);_0x15cd05[_0x5323('0x3d')]=qs['filters'](_[_0x5323('0x3c')](_0x30ba10['query'],_0x48d34b[_0x5323('0x33')]));if(_0x30ba10[_0x5323('0x32')][_0x5323('0x41')]){_0x15cd05['where']=_[_0x5323('0x3e')](_0x15cd05[_0x5323('0x3d')],{'$or':_[_0x5323('0x2c')](_0x15cd05[_0x5323('0x35')],function(_0x2148d2){var _0x1fbb5a={};_0x1fbb5a[_0x2148d2]={'$like':'%'+_0x30ba10[_0x5323('0x32')][_0x5323('0x41')]+'%'};return _0x1fbb5a;})});}_0x15cd05=_['merge']({},_0x15cd05,_0x30ba10[_0x5323('0x49')]);return _0x59bc51[_0x5323('0x4f')](_0x15cd05);}})['then'](function(_0xd2b1bd){if(_0xd2b1bd){_0x88d739=_0xd2b1bd[_0x5323('0x37')];if(!_0x30ba10[_0x5323('0x32')][_0x5323('0x38')](_0x5323('0x39'))){_0x15cd05[_0x5323('0x1f')]=qs[_0x5323('0x1f')](_0x30ba10['query'][_0x5323('0x1f')]);_0x15cd05['offset']=qs[_0x5323('0x1d')](_0x30ba10[_0x5323('0x32')][_0x5323('0x1d')]);}return _0x59bc51[_0x5323('0x4f')](_0x15cd05);}})['then'](function(_0x4706c2){if(_0x4706c2){return _0x4706c2?{'count':_0x88d739,'rows':_0x4706c2}:null;}})['then'](respondWithResult(_0xa4def1,null))[_0x5323('0x46')](handleError(_0xa4def1,null));};exports[_0x5323('0x51')]=function(_0x23e800,_0xfa5b58,_0x4f6830){if(_0x23e800[_0x5323('0x4d')]['id']){delete _0x23e800['body']['id'];}return db[_0x5323('0x2d')][_0x5323('0x52')]({'where':{'id':_0x23e800['params']['id']}})[_0x5323('0x25')](handleEntityNotFound(_0xfa5b58,null))['then'](function(_0x1a9e9a){if(_0x1a9e9a){_0x23e800[_0x5323('0x4d')]['AccountId']=_0x1a9e9a['id'];_0x23e800[_0x5323('0x4d')][_0x5323('0x53')]=integrations[_0x5323('0x54')](_0x23e800[_0x5323('0x4d')][_0x5323('0x55')],_0x23e800[_0x5323('0x4d')][_0x5323('0x3f')]);_0x23e800[_0x5323('0x4d')][_0x5323('0x56')]=integrations['getDescriptions'](_0x23e800[_0x5323('0x4d')][_0x5323('0x55')],_0x23e800[_0x5323('0x4d')][_0x5323('0x3f')]);return db['DeskConfiguration'][_0x5323('0x4b')](_0x23e800[_0x5323('0x4d')],{'include':[{'model':db['DeskField'],'as':_0x5323('0x53')},{'model':db['DeskField'],'as':_0x5323('0x56')}]});}return null;})['then'](respondWithResult(_0xfa5b58,null))[_0x5323('0x46')](handleError(_0xfa5b58,null));};exports[_0x5323('0x57')]=function(_0x392526,_0x5e762b,_0x26d1c2){var _0x3d69a3=[{'name':_0x5323('0x58'),'label':_0x5323('0x58'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x1106d6='';return db[_0x5323('0x2d')][_0x5323('0x52')]({'where':{'id':_0x392526[_0x5323('0x4c')]['id']},'attributes':['id',_0x5323('0x59'),_0x5323('0x5a'),_0x5323('0x5b'),_0x5323('0x5c'),_0x5323('0x5d'),_0x5323('0x5e'),'token',_0x5323('0x5f')]})['then'](handleEntityNotFound(_0x5e762b,null))['then'](function(_0x3ab4e4){if(_0x3ab4e4){_0x1106d6=_0x3ab4e4[_0x5323('0x59')];var _0x260b68=_0x1106d6[_0x5323('0x60')](-0x1);if(_0x260b68==='/'){_0x1106d6=_0x1106d6[_0x5323('0x61')](0x0,_0x1106d6['lastIndexOf'](_0x260b68));}var _0x5ca779={'method':'GET','uri':util[_0x5323('0x62')]('%s/custom_fields',_0x1106d6),'headers':{'Content-Type':'application/json','Accept':_0x5323('0x63')},'json':!![]};if(_0x3ab4e4[_0x5323('0x5a')]==='basic'){_0x5ca779[_0x5323('0x64')][_0x5323('0x65')]=util[_0x5323('0x62')]('Basic\x20%s',new Buffer(util['format'](_0x5323('0x66'),_0x3ab4e4[_0x5323('0x5b')],_0x3ab4e4['password']))[_0x5323('0x67')](_0x5323('0x68')));}return rp(_0x5ca779)['then'](function(_0x462e42){return _0x3d69a3[_0x5323('0x69')](_[_0x5323('0x2c')](_0x462e42[_0x5323('0x6a')]['entries'],function(_0x46e305){return{'id':_0x46e305[_0x5323('0x29')],'name':_0x46e305[_0x5323('0x29')],'type':_0x46e305['type'],'active':_0x46e305['active'],'label':_0x46e305[_0x5323('0x6b')],'custom':!![]};}));});}})['then'](function(_0x75ec29){return{'count':_0x75ec29[_0x5323('0x37')],'rows':_0x75ec29};})[_0x5323('0x25')](respondWithResult(_0x5e762b,null))[_0x5323('0x46')](function(_0x3c3822){var _0x4a714c=_0x392526[_0x5323('0x32')][_0x5323('0x6c')]?0x1f4:_0x3c3822[_0x5323('0x6d')]||0x1f4;logger['error'](_0x5323('0x6e'),_0x5323('0x57'),_0x4a714c,JSON[_0x5323('0x6f')](_0x3c3822));delete _0x3c3822[_0x5323('0x29')];if(_0x4a714c===0x191){_0x4a714c=0x190;}_0x5e762b[_0x5323('0x1b')](_0x4a714c)[_0x5323('0x2a')](_0x392526[_0x5323('0x32')][_0x5323('0x6c')]?{'message':'Wrong\x20credentials','statusCode':_0x3c3822[_0x5323('0x6d')]}:_0x3c3822);});};
\ No newline at end of file
index 3547c13..c36d7e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd398=['../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','define','DeskAccount','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x1971ac,_0x115521){var _0x400354=function(_0x12719a){while(--_0x12719a){_0x1971ac['push'](_0x1971ac['shift']());}};_0x400354(++_0x115521);}(_0xd398,0x1d9));var _0x8d39=function(_0x6a9297,_0x5487ad){_0x6a9297=_0x6a9297-0x0;var _0x5ee147=_0xd398[_0x6a9297];return _0x5ee147;};'use strict';var _=require('lodash');var util=require(_0x8d39('0x0'));var logger=require(_0x8d39('0x1'))(_0x8d39('0x2'));var moment=require('moment');var BPromise=require(_0x8d39('0x3'));var rp=require(_0x8d39('0x4'));var fs=require('fs');var path=require(_0x8d39('0x5'));var rimraf=require(_0x8d39('0x6'));var config=require(_0x8d39('0x7'));var attributes=require(_0x8d39('0x8'));var integrations=require(_0x8d39('0x9'));module['exports']=function(_0x1ba747,_0x552fb9){return _0x1ba747[_0x8d39('0xa')](_0x8d39('0xb'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x896f=['exports','define','DeskAccount','int_desk_accounts','util','../../config/logger','bluebird','request-promise','./intDeskAccount.attributes'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x896f,0x9d));var _0xf896=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x896f[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require('lodash');var util=require(_0xf896('0x0'));var logger=require(_0xf896('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf896('0x2'));var rp=require(_0xf896('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf896('0x4'));var integrations=require('../../components/integrations/configuration');module[_0xf896('0x5')]=function(_0x1c7cda,_0x56c3ee){return _0x1c7cda[_0xf896('0x6')](_0xf896('0x7'),attributes,{'tableName':_0xf896('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 55a1723..9e0b623 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x513a=['code','message','request\x20sent','result','catch','GetDeskAccount','DeskAccount','options','where','attributes','include','model','map','ShowDeskAccount','find','lodash','util','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','info','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x13d617,_0x34d3ce){var _0x381c74=function(_0x12b0f8){while(--_0x12b0f8){_0x13d617['push'](_0x13d617['shift']());}};_0x381c74(++_0x34d3ce);}(_0x513a,0x1cf));var _0xa513=function(_0x6d31bf,_0x30b243){_0x6d31bf=_0x6d31bf-0x0;var _0x367ef8=_0x513a[_0x6d31bf];return _0x367ef8;};'use strict';var _=require(_0xa513('0x0'));var util=require(_0xa513('0x1'));var moment=require('moment');var BPromise=require(_0xa513('0x2'));var rs=require(_0xa513('0x3'));var fs=require('fs');var Redis=require(_0xa513('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa513('0x5'));var config=require(_0xa513('0x6'));var jayson=require(_0xa513('0x7'));var client=jayson[_0xa513('0x8')][_0xa513('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x488435,_0x35bbd1,_0x290a96){return new BPromise(function(_0x3bc36f,_0x358c41){return client['request'](_0x488435,_0x290a96)[_0xa513('0xa')](function(_0xa7d948){logger[_0xa513('0xb')](_0xa513('0xc'),_0x35bbd1,'request\x20sent');logger[_0xa513('0xd')](_0xa513('0xe'),_0x35bbd1,'request\x20sent',JSON[_0xa513('0xf')](_0xa7d948));if(_0xa7d948[_0xa513('0x10')]){if(_0xa7d948[_0xa513('0x10')][_0xa513('0x11')]===0x1f4){logger[_0xa513('0x10')](_0xa513('0xc'),_0x35bbd1,_0xa7d948[_0xa513('0x10')]['message']);return _0x358c41(_0xa7d948[_0xa513('0x10')][_0xa513('0x12')]);}logger['error'](_0xa513('0xc'),_0x35bbd1,_0xa7d948['error'][_0xa513('0x12')]);return _0x3bc36f(_0xa7d948['error'][_0xa513('0x12')]);}else{logger[_0xa513('0xb')](_0xa513('0xc'),_0x35bbd1,_0xa513('0x13'));_0x3bc36f(_0xa7d948[_0xa513('0x14')][_0xa513('0x12')]);}})[_0xa513('0x15')](function(_0x2e346f){logger[_0xa513('0x10')](_0xa513('0xc'),_0x35bbd1,_0x2e346f);_0x358c41(_0x2e346f);});});}exports[_0xa513('0x16')]=function(_0xcbdc28){var _0x573c27=this;return new Promise(function(_0x33b4fa,_0x3e201d){return db[_0xa513('0x17')]['findAll']({'raw':_0xcbdc28['options']?_0xcbdc28['options']['raw']===undefined?!![]:![]:!![],'where':_0xcbdc28[_0xa513('0x18')]?_0xcbdc28['options'][_0xa513('0x19')]||null:null,'attributes':_0xcbdc28['options']?_0xcbdc28[_0xa513('0x18')][_0xa513('0x1a')]||null:null,'limit':_0xcbdc28[_0xa513('0x18')]?_0xcbdc28[_0xa513('0x18')]['limit']||null:null,'include':_0xcbdc28[_0xa513('0x18')]?_0xcbdc28['options']['include']?_['map'](_0xcbdc28[_0xa513('0x18')][_0xa513('0x1b')],function(_0x57b8e5){return{'model':db[_0x57b8e5[_0xa513('0x1c')]],'as':_0x57b8e5['as'],'attributes':_0x57b8e5['attributes'],'include':_0x57b8e5[_0xa513('0x1b')]?_[_0xa513('0x1d')](_0x57b8e5[_0xa513('0x1b')],function(_0x5092dd){return{'model':db[_0x5092dd[_0xa513('0x1c')]],'as':_0x5092dd['as'],'attributes':_0x5092dd['attributes'],'include':_0x5092dd[_0xa513('0x1b')]?_[_0xa513('0x1d')](_0x5092dd[_0xa513('0x1b')],function(_0x20d459){return{'model':db[_0x20d459[_0xa513('0x1c')]],'as':_0x20d459['as'],'attributes':_0x20d459[_0xa513('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa513('0xa')](function(_0x553d30){logger['info'](_0xa513('0x16'),_0xcbdc28);logger[_0xa513('0xd')](_0xa513('0x16'),_0xcbdc28,JSON[_0xa513('0xf')](_0x553d30));_0x33b4fa(_0x553d30);})[_0xa513('0x15')](function(_0x12313e){logger['error'](_0xa513('0x16'),_0x12313e[_0xa513('0x12')],_0xcbdc28);_0x3e201d(_0x573c27[_0xa513('0x10')](0x1f4,_0x12313e[_0xa513('0x12')]));});});};exports[_0xa513('0x1e')]=function(_0x24b9d6){var _0x30ca4b=this;return new Promise(function(_0x40ea33,_0x507193){return db['DeskAccount'][_0xa513('0x1f')]({'raw':_0x24b9d6['options']?_0x24b9d6[_0xa513('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x24b9d6[_0xa513('0x18')]?_0x24b9d6[_0xa513('0x18')][_0xa513('0x19')]||null:null,'attributes':_0x24b9d6['options']?_0x24b9d6['options']['attributes']||null:null,'include':_0x24b9d6[_0xa513('0x18')]?_0x24b9d6[_0xa513('0x18')][_0xa513('0x1b')]?_[_0xa513('0x1d')](_0x24b9d6[_0xa513('0x18')]['include'],function(_0x537cc6){return{'model':db[_0x537cc6[_0xa513('0x1c')]],'as':_0x537cc6['as'],'attributes':_0x537cc6['attributes'],'include':_0x537cc6[_0xa513('0x1b')]?_[_0xa513('0x1d')](_0x537cc6[_0xa513('0x1b')],function(_0x25eace){return{'model':db[_0x25eace[_0xa513('0x1c')]],'as':_0x25eace['as'],'attributes':_0x25eace[_0xa513('0x1a')],'include':_0x25eace[_0xa513('0x1b')]?_['map'](_0x25eace[_0xa513('0x1b')],function(_0x59dae6){return{'model':db[_0x59dae6[_0xa513('0x1c')]],'as':_0x59dae6['as'],'attributes':_0x59dae6[_0xa513('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b3ad5){logger['info'](_0xa513('0x1e'),_0x24b9d6);logger[_0xa513('0xd')](_0xa513('0x1e'),_0x24b9d6,JSON['stringify'](_0x2b3ad5));_0x40ea33(_0x2b3ad5);})[_0xa513('0x15')](function(_0x4b5897){logger[_0xa513('0x10')](_0xa513('0x1e'),_0x4b5897[_0xa513('0x12')],_0x24b9d6);_0x507193(_0x30ca4b[_0xa513('0x10')](0x1f4,_0x4b5897[_0xa513('0x12')]));});});};
\ No newline at end of file
+var _0x8d4d=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetDeskAccount','findAll','options','raw','where','attributes','limit','map','model','include','debug','stringify','DeskAccount','ShowDeskAccount','lodash','moment','bluebird'];(function(_0x138d2c,_0x2abba6){var _0xacae0d=function(_0x4fcfd2){while(--_0x4fcfd2){_0x138d2c['push'](_0x138d2c['shift']());}};_0xacae0d(++_0x2abba6);}(_0x8d4d,0xb1));var _0xd8d4=function(_0xacde2e,_0x222056){_0xacde2e=_0xacde2e-0x0;var _0x3e7d33=_0x8d4d[_0xacde2e];return _0x3e7d33;};'use strict';var _=require(_0xd8d4('0x0'));var util=require('util');var moment=require(_0xd8d4('0x1'));var BPromise=require(_0xd8d4('0x2'));var rs=require(_0xd8d4('0x3'));var fs=require('fs');var Redis=require(_0xd8d4('0x4'));var db=require(_0xd8d4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd8d4('0x6'))(_0xd8d4('0x7'));var config=require(_0xd8d4('0x8'));var jayson=require(_0xd8d4('0x9'));var client=jayson[_0xd8d4('0xa')][_0xd8d4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10e731,_0x1a262f,_0x50179f){return new BPromise(function(_0x3eb70c,_0x1153fb){return client['request'](_0x10e731,_0x50179f)[_0xd8d4('0xc')](function(_0x7caf3a){logger['info'](_0xd8d4('0xd'),_0x1a262f,_0xd8d4('0xe'));logger['debug'](_0xd8d4('0xf'),_0x1a262f,'request\x20sent',JSON['stringify'](_0x7caf3a));if(_0x7caf3a['error']){if(_0x7caf3a[_0xd8d4('0x10')][_0xd8d4('0x11')]===0x1f4){logger[_0xd8d4('0x10')](_0xd8d4('0xd'),_0x1a262f,_0x7caf3a[_0xd8d4('0x10')]['message']);return _0x1153fb(_0x7caf3a[_0xd8d4('0x10')][_0xd8d4('0x12')]);}logger[_0xd8d4('0x10')](_0xd8d4('0xd'),_0x1a262f,_0x7caf3a['error'][_0xd8d4('0x12')]);return _0x3eb70c(_0x7caf3a[_0xd8d4('0x10')][_0xd8d4('0x12')]);}else{logger[_0xd8d4('0x13')](_0xd8d4('0xd'),_0x1a262f,_0xd8d4('0xe'));_0x3eb70c(_0x7caf3a[_0xd8d4('0x14')][_0xd8d4('0x12')]);}})[_0xd8d4('0x15')](function(_0x4748c4){logger[_0xd8d4('0x10')](_0xd8d4('0xd'),_0x1a262f,_0x4748c4);_0x1153fb(_0x4748c4);});});}exports[_0xd8d4('0x16')]=function(_0x577629){var _0x83fdc2=this;return new Promise(function(_0x40b4fa,_0x1d8cb2){return db['DeskAccount'][_0xd8d4('0x17')]({'raw':_0x577629[_0xd8d4('0x18')]?_0x577629[_0xd8d4('0x18')][_0xd8d4('0x19')]===undefined?!![]:![]:!![],'where':_0x577629[_0xd8d4('0x18')]?_0x577629[_0xd8d4('0x18')][_0xd8d4('0x1a')]||null:null,'attributes':_0x577629[_0xd8d4('0x18')]?_0x577629[_0xd8d4('0x18')][_0xd8d4('0x1b')]||null:null,'limit':_0x577629['options']?_0x577629[_0xd8d4('0x18')][_0xd8d4('0x1c')]||null:null,'include':_0x577629[_0xd8d4('0x18')]?_0x577629[_0xd8d4('0x18')]['include']?_[_0xd8d4('0x1d')](_0x577629[_0xd8d4('0x18')]['include'],function(_0x374ab7){return{'model':db[_0x374ab7[_0xd8d4('0x1e')]],'as':_0x374ab7['as'],'attributes':_0x374ab7[_0xd8d4('0x1b')],'include':_0x374ab7[_0xd8d4('0x1f')]?_[_0xd8d4('0x1d')](_0x374ab7[_0xd8d4('0x1f')],function(_0x5bf18e){return{'model':db[_0x5bf18e[_0xd8d4('0x1e')]],'as':_0x5bf18e['as'],'attributes':_0x5bf18e[_0xd8d4('0x1b')],'include':_0x5bf18e['include']?_[_0xd8d4('0x1d')](_0x5bf18e['include'],function(_0x10894d){return{'model':db[_0x10894d[_0xd8d4('0x1e')]],'as':_0x10894d['as'],'attributes':_0x10894d[_0xd8d4('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd8d4('0xc')](function(_0x149659){logger[_0xd8d4('0x13')]('GetDeskAccount',_0x577629);logger[_0xd8d4('0x20')](_0xd8d4('0x16'),_0x577629,JSON[_0xd8d4('0x21')](_0x149659));_0x40b4fa(_0x149659);})[_0xd8d4('0x15')](function(_0x4292d1){logger[_0xd8d4('0x10')](_0xd8d4('0x16'),_0x4292d1[_0xd8d4('0x12')],_0x577629);_0x1d8cb2(_0x83fdc2['error'](0x1f4,_0x4292d1[_0xd8d4('0x12')]));});});};exports['ShowDeskAccount']=function(_0x476017){var _0x1221b5=this;return new Promise(function(_0x19eaca,_0x4fe18e){return db[_0xd8d4('0x22')]['find']({'raw':_0x476017[_0xd8d4('0x18')]?_0x476017[_0xd8d4('0x18')][_0xd8d4('0x19')]===undefined?!![]:![]:!![],'where':_0x476017[_0xd8d4('0x18')]?_0x476017['options'][_0xd8d4('0x1a')]||null:null,'attributes':_0x476017[_0xd8d4('0x18')]?_0x476017[_0xd8d4('0x18')][_0xd8d4('0x1b')]||null:null,'include':_0x476017['options']?_0x476017['options'][_0xd8d4('0x1f')]?_[_0xd8d4('0x1d')](_0x476017[_0xd8d4('0x18')][_0xd8d4('0x1f')],function(_0x52f4b9){return{'model':db[_0x52f4b9['model']],'as':_0x52f4b9['as'],'attributes':_0x52f4b9[_0xd8d4('0x1b')],'include':_0x52f4b9[_0xd8d4('0x1f')]?_[_0xd8d4('0x1d')](_0x52f4b9[_0xd8d4('0x1f')],function(_0x158f09){return{'model':db[_0x158f09[_0xd8d4('0x1e')]],'as':_0x158f09['as'],'attributes':_0x158f09[_0xd8d4('0x1b')],'include':_0x158f09[_0xd8d4('0x1f')]?_[_0xd8d4('0x1d')](_0x158f09[_0xd8d4('0x1f')],function(_0x460ffd){return{'model':db[_0x460ffd[_0xd8d4('0x1e')]],'as':_0x460ffd['as'],'attributes':_0x460ffd[_0xd8d4('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x218f12){logger[_0xd8d4('0x13')](_0xd8d4('0x23'),_0x476017);logger[_0xd8d4('0x20')](_0xd8d4('0x23'),_0x476017,JSON[_0xd8d4('0x21')](_0x218f12));_0x19eaca(_0x218f12);})[_0xd8d4('0x15')](function(_0x21f7c3){logger['error']('ShowDeskAccount',_0x21f7c3[_0xd8d4('0x12')],_0x476017);_0x4fe18e(_0x1221b5[_0xd8d4('0x10')](0x1f4,_0x21f7c3[_0xd8d4('0x12')]));});});};
\ No newline at end of file
index 4a58bae..6fe44db 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(_0x2e7bb3,_0x4037b1){var _0x286c7a=function(_0x138cdf){while(--_0x138cdf){_0x2e7bb3['push'](_0x2e7bb3['shift']());}};_0x286c7a(++_0x4037b1);}(_0x008c,0x188));var _0xc008=function(_0x167914,_0x87b5a){_0x167914=_0x167914-0x0;var _0x5e5d79=_0x008c[_0x167914];return _0x5e5d79;};'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 _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x33a048,_0x583b64){var _0x346085=function(_0x2054b9){while(--_0x2054b9){_0x33a048['push'](_0x33a048['shift']());}};_0x346085(++_0x583b64);}(_0xedd9,0xfc));var _0x9edd=function(_0x2ed174,_0x2a4c49){_0x2ed174=_0x2ed174-0x0;var _0x3d02cb=_0xedd9[_0x2ed174];return _0x3d02cb;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router;
\ No newline at end of file
index d716f71..1b369fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cbd=['sequelize','STRING'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x9cbd,0x1ea));var _0xd9cb=function(_0x58a5ce,_0xa05f14){_0x58a5ce=_0x58a5ce-0x0;var _0x12b5b0=_0x9cbd[_0x58a5ce];return _0x12b5b0;};'use strict';var Sequelize=require(_0xd9cb('0x0'));module['exports']={'name':{'type':Sequelize[_0xd9cb('0x1')]},'description':{'type':Sequelize[_0xd9cb('0x1')]}};
\ No newline at end of file
+var _0x1916=['exports','STRING'];(function(_0x49dfd1,_0x37f207){var _0x5bb373=function(_0x3d2afe){while(--_0x3d2afe){_0x49dfd1['push'](_0x49dfd1['shift']());}};_0x5bb373(++_0x37f207);}(_0x1916,0xda));var _0x6191=function(_0x3d826b,_0x551b00){_0x3d826b=_0x3d826b-0x0;var _0x1fca61=_0x1916[_0x3d826b];return _0x1fca61;};'use strict';var Sequelize=require('sequelize');module[_0x6191('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6191('0x1')]}};
\ No newline at end of file
index 5176f74..4fcdbe5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff69=['setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','error','stack','name','map','DeskConfiguration','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','includeAll','findAll','catch','show','options','create','body','find','params','getFields','findOne','DeskField','pick','getSubjects','getDescriptions','getTags','Tag'];(function(_0x211dca,_0x455ac7){var _0x21b582=function(_0x39dd6d){while(--_0x39dd6d){_0x211dca['push'](_0x211dca['shift']());}};_0x21b582(++_0x455ac7);}(_0xff69,0x14e));var _0x9ff6=function(_0x221272,_0x29146a){_0x221272=_0x221272-0x0;var _0xe0a9d7=_0xff69[_0x221272];return _0xe0a9d7;};'use strict';var emlformat=require(_0x9ff6('0x0'));var rimraf=require(_0x9ff6('0x1'));var zipdir=require(_0x9ff6('0x2'));var jsonpatch=require(_0x9ff6('0x3'));var rp=require(_0x9ff6('0x4'));var moment=require(_0x9ff6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9ff6('0x6'));var util=require(_0x9ff6('0x7'));var path=require('path');var sox=require(_0x9ff6('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9ff6('0x9'));var _=require(_0x9ff6('0xa'));var squel=require(_0x9ff6('0xb'));var crypto=require(_0x9ff6('0xc'));var jsforce=require(_0x9ff6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9ff6('0xe'));var querystring=require(_0x9ff6('0xf'));var Papa=require(_0x9ff6('0x10'));var Redis=require(_0x9ff6('0x11'));var authService=require(_0x9ff6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x9ff6('0x13'));var hardwareService=require(_0x9ff6('0x14'));var logger=require(_0x9ff6('0x15'))(_0x9ff6('0x16'));var utils=require(_0x9ff6('0x17'));var config=require(_0x9ff6('0x18'));var licenseUtil=require(_0x9ff6('0x19'));var db=require(_0x9ff6('0x1a'))['db'];function respondWithStatusCode(_0x247dcb,_0x4045cf){_0x4045cf=_0x4045cf||0xcc;return function(_0x3a4cc3){if(_0x3a4cc3){return _0x247dcb[_0x9ff6('0x1b')](_0x4045cf);}return _0x247dcb[_0x9ff6('0x1c')](_0x4045cf)[_0x9ff6('0x1d')]();};}function respondWithResult(_0x3c4512,_0xc55c36){_0xc55c36=_0xc55c36||0xc8;return function(_0x439826){if(_0x439826){return _0x3c4512[_0x9ff6('0x1c')](_0xc55c36)[_0x9ff6('0x1e')](_0x439826);}};}function respondWithFilteredResult(_0x45331f,_0x556de0){return function(_0x7e351a){if(_0x7e351a){var _0x2d80e1=typeof _0x556de0[_0x9ff6('0x1f')]===_0x9ff6('0x20')&&typeof _0x556de0['limit']==='undefined';var _0x1e1606=_0x7e351a[_0x9ff6('0x21')];var _0x59af57=_0x2d80e1?0x0:_0x556de0['offset'];var _0x47e74e=_0x2d80e1?_0x7e351a[_0x9ff6('0x21')]:_0x556de0[_0x9ff6('0x1f')]+_0x556de0[_0x9ff6('0x22')];var _0x2e9ecc;if(_0x47e74e>=_0x1e1606){_0x47e74e=_0x1e1606;_0x2e9ecc=0xc8;}else{_0x2e9ecc=0xce;}_0x45331f[_0x9ff6('0x1c')](_0x2e9ecc);return _0x45331f[_0x9ff6('0x23')](_0x9ff6('0x24'),_0x59af57+'-'+_0x47e74e+'/'+_0x1e1606)['json'](_0x7e351a);}return null;};}function patchUpdates(_0x4dd046){return function(_0x39ebf0){try{jsonpatch[_0x9ff6('0x25')](_0x39ebf0,_0x4dd046,!![]);}catch(_0x5ab0b0){return BPromise[_0x9ff6('0x26')](_0x5ab0b0);}return _0x39ebf0[_0x9ff6('0x27')]();};}function saveUpdates(_0xd41ca7,_0x37e67c){return function(_0xba2ad){if(_0xba2ad){return _0xba2ad['update'](_0xd41ca7)[_0x9ff6('0x28')](function(_0xff03b){return _0xff03b;});}return null;};}function removeEntity(_0xccaa0a,_0x50f14d){return function(_0x53c05c){if(_0x53c05c){return _0x53c05c['destroy']()['then'](function(){_0xccaa0a[_0x9ff6('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a4bc9,_0x5b528e){return function(_0x558323){if(!_0x558323){_0x3a4bc9[_0x9ff6('0x1b')](0x194);}return _0x558323;};}function handleError(_0x2667cb,_0x4c5bd7){_0x4c5bd7=_0x4c5bd7||0x1f4;return function(_0x4d9572){logger[_0x9ff6('0x29')](_0x4d9572[_0x9ff6('0x2a')]);if(_0x4d9572[_0x9ff6('0x2b')]){delete _0x4d9572[_0x9ff6('0x2b')];}_0x2667cb[_0x9ff6('0x1c')](_0x4c5bd7)['send'](_0x4d9572);};}exports['index']=function(_0x2a5828,_0x36c42a){var _0x2a3948={},_0x4c6c25={},_0x12d1cd={'count':0x0,'rows':[]};var _0x571d02=_[_0x9ff6('0x2c')](db[_0x9ff6('0x2d')][_0x9ff6('0x2e')],function(_0x578a6f){return{'name':_0x578a6f[_0x9ff6('0x2f')],'type':_0x578a6f[_0x9ff6('0x30')]['key']};});_0x4c6c25[_0x9ff6('0x31')]=_['map'](_0x571d02,'name');_0x4c6c25[_0x9ff6('0x32')]=_[_0x9ff6('0x33')](_0x2a5828['query']);_0x4c6c25['filters']=_[_0x9ff6('0x34')](_0x4c6c25[_0x9ff6('0x31')],_0x4c6c25[_0x9ff6('0x32')]);_0x2a3948[_0x9ff6('0x35')]=_[_0x9ff6('0x34')](_0x4c6c25[_0x9ff6('0x31')],qs['fields'](_0x2a5828[_0x9ff6('0x32')][_0x9ff6('0x36')]));_0x2a3948[_0x9ff6('0x35')]=_0x2a3948[_0x9ff6('0x35')][_0x9ff6('0x37')]?_0x2a3948['attributes']:_0x4c6c25[_0x9ff6('0x31')];if(!_0x2a5828[_0x9ff6('0x32')][_0x9ff6('0x38')](_0x9ff6('0x39'))){_0x2a3948[_0x9ff6('0x22')]=qs['limit'](_0x2a5828[_0x9ff6('0x32')][_0x9ff6('0x22')]);_0x2a3948['offset']=qs[_0x9ff6('0x1f')](_0x2a5828[_0x9ff6('0x32')][_0x9ff6('0x1f')]);}_0x2a3948[_0x9ff6('0x3a')]=qs[_0x9ff6('0x3b')](_0x2a5828['query']['sort']);_0x2a3948[_0x9ff6('0x3c')]=qs[_0x9ff6('0x3d')](_['pick'](_0x2a5828[_0x9ff6('0x32')],_0x4c6c25[_0x9ff6('0x3d')]),_0x571d02);if(_0x2a5828['query'][_0x9ff6('0x3e')]){_0x2a3948['where']=_['merge'](_0x2a3948[_0x9ff6('0x3c')],{'$or':_['map'](_0x571d02,function(_0x129a72){if(_0x129a72[_0x9ff6('0x30')]!=='VIRTUAL'){var _0x416d16={};_0x416d16[_0x129a72[_0x9ff6('0x2b')]]={'$like':'%'+_0x2a5828[_0x9ff6('0x32')][_0x9ff6('0x3e')]+'%'};return _0x416d16;}})});}_0x2a3948=_[_0x9ff6('0x3f')]({},_0x2a3948,_0x2a5828['options']);var _0x3d5930={'where':_0x2a3948['where']};return db['DeskConfiguration']['count'](_0x3d5930)['then'](function(_0x40477e){_0x12d1cd[_0x9ff6('0x21')]=_0x40477e;if(_0x2a5828[_0x9ff6('0x32')][_0x9ff6('0x40')]){_0x2a3948['include']=[{'all':!![]}];}return db[_0x9ff6('0x2d')][_0x9ff6('0x41')](_0x2a3948);})[_0x9ff6('0x28')](function(_0x23e390){_0x12d1cd['rows']=_0x23e390;return _0x12d1cd;})[_0x9ff6('0x28')](respondWithFilteredResult(_0x36c42a,_0x2a3948))[_0x9ff6('0x42')](handleError(_0x36c42a,null));};exports[_0x9ff6('0x43')]=function(_0x1bed06,_0x3bcd81){var _0x5012b4={'raw':![],'where':{'id':_0x1bed06['params']['id']}},_0x3f8c0a={};_0x3f8c0a['model']=_[_0x9ff6('0x33')](db[_0x9ff6('0x2d')][_0x9ff6('0x2e')]);_0x3f8c0a[_0x9ff6('0x32')]=_[_0x9ff6('0x33')](_0x1bed06['query']);_0x3f8c0a['filters']=_[_0x9ff6('0x34')](_0x3f8c0a['model'],_0x3f8c0a['query']);_0x5012b4[_0x9ff6('0x35')]=_[_0x9ff6('0x34')](_0x3f8c0a[_0x9ff6('0x31')],qs[_0x9ff6('0x36')](_0x1bed06['query'][_0x9ff6('0x36')]));_0x5012b4[_0x9ff6('0x35')]=_0x5012b4[_0x9ff6('0x35')]['length']?_0x5012b4['attributes']:_0x3f8c0a[_0x9ff6('0x31')];if(_0x1bed06[_0x9ff6('0x32')][_0x9ff6('0x40')]){_0x5012b4['include']=[{'all':!![]}];}_0x5012b4=_['merge']({},_0x5012b4,_0x1bed06[_0x9ff6('0x44')]);return db[_0x9ff6('0x2d')]['find'](_0x5012b4)[_0x9ff6('0x28')](handleEntityNotFound(_0x3bcd81,null))[_0x9ff6('0x28')](respondWithResult(_0x3bcd81,null))[_0x9ff6('0x42')](handleError(_0x3bcd81,null));};exports[_0x9ff6('0x45')]=function(_0x3f647e,_0x4ec4e6){return db[_0x9ff6('0x2d')]['create'](_0x3f647e['body'],{})['then'](respondWithResult(_0x4ec4e6,0xc9))[_0x9ff6('0x42')](handleError(_0x4ec4e6,null));};exports['update']=function(_0x3b44f9,_0x3c12a3){if(_0x3b44f9[_0x9ff6('0x46')]['id']){delete _0x3b44f9[_0x9ff6('0x46')]['id'];}return db[_0x9ff6('0x2d')][_0x9ff6('0x47')]({'where':{'id':_0x3b44f9[_0x9ff6('0x48')]['id']}})['then'](handleEntityNotFound(_0x3c12a3,null))[_0x9ff6('0x28')](saveUpdates(_0x3b44f9['body'],null))[_0x9ff6('0x28')](respondWithResult(_0x3c12a3,null))[_0x9ff6('0x42')](handleError(_0x3c12a3,null));};exports['destroy']=function(_0xd49fff,_0x372270){return db[_0x9ff6('0x2d')]['find']({'where':{'id':_0xd49fff[_0x9ff6('0x48')]['id']}})[_0x9ff6('0x28')](handleEntityNotFound(_0x372270,null))[_0x9ff6('0x28')](removeEntity(_0x372270,null))[_0x9ff6('0x42')](handleError(_0x372270,null));};exports[_0x9ff6('0x49')]=function(_0xb27f5,_0x389678,_0x312496){var _0x1b6f1b={};var _0x2012f1={};var _0x108b52;var _0x3215b4;return db[_0x9ff6('0x2d')][_0x9ff6('0x4a')]({'where':{'id':_0xb27f5[_0x9ff6('0x48')]['id']}})[_0x9ff6('0x28')](handleEntityNotFound(_0x389678,null))['then'](function(_0x1dfb22){if(_0x1dfb22){_0x108b52=_0x1dfb22;_0x2012f1['model']=_['keys'](db[_0x9ff6('0x4b')][_0x9ff6('0x2e')]);_0x2012f1[_0x9ff6('0x32')]=_[_0x9ff6('0x33')](_0xb27f5[_0x9ff6('0x32')]);_0x2012f1[_0x9ff6('0x3d')]=_[_0x9ff6('0x34')](_0x2012f1[_0x9ff6('0x31')],_0x2012f1[_0x9ff6('0x32')]);_0x1b6f1b['attributes']=_[_0x9ff6('0x34')](_0x2012f1[_0x9ff6('0x31')],qs[_0x9ff6('0x36')](_0xb27f5[_0x9ff6('0x32')][_0x9ff6('0x36')]));_0x1b6f1b[_0x9ff6('0x35')]=_0x1b6f1b['attributes']['length']?_0x1b6f1b[_0x9ff6('0x35')]:_0x2012f1[_0x9ff6('0x31')];_0x1b6f1b[_0x9ff6('0x3a')]=qs[_0x9ff6('0x3b')](_0xb27f5[_0x9ff6('0x32')]['sort']);_0x1b6f1b[_0x9ff6('0x3c')]=qs['filters'](_[_0x9ff6('0x4c')](_0xb27f5[_0x9ff6('0x32')],_0x2012f1[_0x9ff6('0x3d')]));if(_0xb27f5[_0x9ff6('0x32')]['filter']){_0x1b6f1b[_0x9ff6('0x3c')]=_[_0x9ff6('0x3f')](_0x1b6f1b[_0x9ff6('0x3c')],{'$or':_[_0x9ff6('0x2c')](_0x1b6f1b[_0x9ff6('0x35')],function(_0x61a2bd){var _0xc1b48d={};_0xc1b48d[_0x61a2bd]={'$like':'%'+_0xb27f5[_0x9ff6('0x32')][_0x9ff6('0x3e')]+'%'};return _0xc1b48d;})});}_0x1b6f1b=_[_0x9ff6('0x3f')]({},_0x1b6f1b,_0xb27f5[_0x9ff6('0x44')]);return _0x108b52[_0x9ff6('0x49')](_0x1b6f1b);}})['then'](function(_0x2a1270){if(_0x2a1270){_0x3215b4=_0x2a1270[_0x9ff6('0x37')];if(!_0xb27f5[_0x9ff6('0x32')][_0x9ff6('0x38')](_0x9ff6('0x39'))){_0x1b6f1b[_0x9ff6('0x22')]=qs[_0x9ff6('0x22')](_0xb27f5[_0x9ff6('0x32')][_0x9ff6('0x22')]);_0x1b6f1b[_0x9ff6('0x1f')]=qs[_0x9ff6('0x1f')](_0xb27f5[_0x9ff6('0x32')][_0x9ff6('0x1f')]);}return _0x108b52[_0x9ff6('0x49')](_0x1b6f1b);}})[_0x9ff6('0x28')](function(_0x5dc3d9){if(_0x5dc3d9){return _0x5dc3d9?{'count':_0x3215b4,'rows':_0x5dc3d9}:null;}})[_0x9ff6('0x28')](respondWithResult(_0x389678,null))['catch'](handleError(_0x389678,null));};exports['getSubjects']=function(_0xf61e7a,_0x469032,_0x4d43a5){var _0x5808ed={};var _0x598697={};var _0x40e135;var _0x196599;return db[_0x9ff6('0x2d')]['findOne']({'where':{'id':_0xf61e7a[_0x9ff6('0x48')]['id']}})['then'](handleEntityNotFound(_0x469032,null))[_0x9ff6('0x28')](function(_0xd4c690){if(_0xd4c690){_0x40e135=_0xd4c690;_0x598697['model']=_[_0x9ff6('0x33')](db[_0x9ff6('0x4b')][_0x9ff6('0x2e')]);_0x598697['query']=_[_0x9ff6('0x33')](_0xf61e7a[_0x9ff6('0x32')]);_0x598697['filters']=_['intersection'](_0x598697[_0x9ff6('0x31')],_0x598697[_0x9ff6('0x32')]);_0x5808ed['attributes']=_['intersection'](_0x598697['model'],qs[_0x9ff6('0x36')](_0xf61e7a[_0x9ff6('0x32')][_0x9ff6('0x36')]));_0x5808ed[_0x9ff6('0x35')]=_0x5808ed[_0x9ff6('0x35')][_0x9ff6('0x37')]?_0x5808ed[_0x9ff6('0x35')]:_0x598697[_0x9ff6('0x31')];_0x5808ed[_0x9ff6('0x3a')]=qs[_0x9ff6('0x3b')](_0xf61e7a[_0x9ff6('0x32')][_0x9ff6('0x3b')]);_0x5808ed['where']=qs[_0x9ff6('0x3d')](_[_0x9ff6('0x4c')](_0xf61e7a[_0x9ff6('0x32')],_0x598697[_0x9ff6('0x3d')]));if(_0xf61e7a[_0x9ff6('0x32')][_0x9ff6('0x3e')]){_0x5808ed[_0x9ff6('0x3c')]=_[_0x9ff6('0x3f')](_0x5808ed['where'],{'$or':_[_0x9ff6('0x2c')](_0x5808ed[_0x9ff6('0x35')],function(_0x258c49){var _0x3a8301={};_0x3a8301[_0x258c49]={'$like':'%'+_0xf61e7a['query'][_0x9ff6('0x3e')]+'%'};return _0x3a8301;})});}_0x5808ed=_[_0x9ff6('0x3f')]({},_0x5808ed,_0xf61e7a[_0x9ff6('0x44')]);return _0x40e135[_0x9ff6('0x4d')](_0x5808ed);}})['then'](function(_0x34652e){if(_0x34652e){_0x196599=_0x34652e[_0x9ff6('0x37')];if(!_0xf61e7a[_0x9ff6('0x32')][_0x9ff6('0x38')]('nolimit')){_0x5808ed[_0x9ff6('0x22')]=qs[_0x9ff6('0x22')](_0xf61e7a['query']['limit']);_0x5808ed[_0x9ff6('0x1f')]=qs[_0x9ff6('0x1f')](_0xf61e7a[_0x9ff6('0x32')][_0x9ff6('0x1f')]);}return _0x40e135[_0x9ff6('0x4d')](_0x5808ed);}})[_0x9ff6('0x28')](function(_0x11289e){if(_0x11289e){return _0x11289e?{'count':_0x196599,'rows':_0x11289e}:null;}})[_0x9ff6('0x28')](respondWithResult(_0x469032,null))[_0x9ff6('0x42')](handleError(_0x469032,null));};exports[_0x9ff6('0x4e')]=function(_0x26339b,_0x141755,_0x34351a){var _0xae45f7={};var _0x296348={};var _0x4cb2aa;var _0x3bf444;return db[_0x9ff6('0x2d')]['findOne']({'where':{'id':_0x26339b[_0x9ff6('0x48')]['id']}})[_0x9ff6('0x28')](handleEntityNotFound(_0x141755,null))[_0x9ff6('0x28')](function(_0x313892){if(_0x313892){_0x4cb2aa=_0x313892;_0x296348['model']=_['keys'](db[_0x9ff6('0x4b')][_0x9ff6('0x2e')]);_0x296348[_0x9ff6('0x32')]=_[_0x9ff6('0x33')](_0x26339b['query']);_0x296348[_0x9ff6('0x3d')]=_[_0x9ff6('0x34')](_0x296348[_0x9ff6('0x31')],_0x296348[_0x9ff6('0x32')]);_0xae45f7[_0x9ff6('0x35')]=_[_0x9ff6('0x34')](_0x296348['model'],qs[_0x9ff6('0x36')](_0x26339b['query'][_0x9ff6('0x36')]));_0xae45f7['attributes']=_0xae45f7['attributes'][_0x9ff6('0x37')]?_0xae45f7[_0x9ff6('0x35')]:_0x296348['model'];_0xae45f7[_0x9ff6('0x3a')]=qs[_0x9ff6('0x3b')](_0x26339b[_0x9ff6('0x32')]['sort']);_0xae45f7[_0x9ff6('0x3c')]=qs[_0x9ff6('0x3d')](_[_0x9ff6('0x4c')](_0x26339b[_0x9ff6('0x32')],_0x296348[_0x9ff6('0x3d')]));if(_0x26339b['query']['filter']){_0xae45f7[_0x9ff6('0x3c')]=_[_0x9ff6('0x3f')](_0xae45f7['where'],{'$or':_[_0x9ff6('0x2c')](_0xae45f7[_0x9ff6('0x35')],function(_0x3497e7){var _0x413d07={};_0x413d07[_0x3497e7]={'$like':'%'+_0x26339b[_0x9ff6('0x32')][_0x9ff6('0x3e')]+'%'};return _0x413d07;})});}_0xae45f7=_[_0x9ff6('0x3f')]({},_0xae45f7,_0x26339b[_0x9ff6('0x44')]);return _0x4cb2aa[_0x9ff6('0x4e')](_0xae45f7);}})[_0x9ff6('0x28')](function(_0x3a81f6){if(_0x3a81f6){_0x3bf444=_0x3a81f6[_0x9ff6('0x37')];if(!_0x26339b['query']['hasOwnProperty'](_0x9ff6('0x39'))){_0xae45f7[_0x9ff6('0x22')]=qs[_0x9ff6('0x22')](_0x26339b['query'][_0x9ff6('0x22')]);_0xae45f7[_0x9ff6('0x1f')]=qs['offset'](_0x26339b[_0x9ff6('0x32')]['offset']);}return _0x4cb2aa[_0x9ff6('0x4e')](_0xae45f7);}})[_0x9ff6('0x28')](function(_0x310dd2){if(_0x310dd2){return _0x310dd2?{'count':_0x3bf444,'rows':_0x310dd2}:null;}})[_0x9ff6('0x28')](respondWithResult(_0x141755,null))[_0x9ff6('0x42')](handleError(_0x141755,null));};exports[_0x9ff6('0x4f')]=function(_0x242189,_0x2e1242,_0x5183a3){var _0x3f2c6a={};var _0x5b88ce={};var _0x70fee5;var _0x5f2be5;return db[_0x9ff6('0x2d')]['findOne']({'where':{'id':_0x242189[_0x9ff6('0x48')]['id']}})[_0x9ff6('0x28')](handleEntityNotFound(_0x2e1242,null))[_0x9ff6('0x28')](function(_0x129b79){if(_0x129b79){_0x70fee5=_0x129b79;_0x5b88ce[_0x9ff6('0x31')]=_[_0x9ff6('0x33')](db[_0x9ff6('0x50')]['rawAttributes']);_0x5b88ce['query']=_[_0x9ff6('0x33')](_0x242189['query']);_0x5b88ce[_0x9ff6('0x3d')]=_[_0x9ff6('0x34')](_0x5b88ce[_0x9ff6('0x31')],_0x5b88ce[_0x9ff6('0x32')]);_0x3f2c6a[_0x9ff6('0x35')]=_[_0x9ff6('0x34')](_0x5b88ce['model'],qs[_0x9ff6('0x36')](_0x242189[_0x9ff6('0x32')][_0x9ff6('0x36')]));_0x3f2c6a[_0x9ff6('0x35')]=_0x3f2c6a[_0x9ff6('0x35')][_0x9ff6('0x37')]?_0x3f2c6a[_0x9ff6('0x35')]:_0x5b88ce[_0x9ff6('0x31')];_0x3f2c6a['order']=qs['sort'](_0x242189[_0x9ff6('0x32')][_0x9ff6('0x3b')]);_0x3f2c6a[_0x9ff6('0x3c')]=qs['filters'](_[_0x9ff6('0x4c')](_0x242189[_0x9ff6('0x32')],_0x5b88ce[_0x9ff6('0x3d')]));if(_0x242189[_0x9ff6('0x32')]['filter']){_0x3f2c6a[_0x9ff6('0x3c')]=_[_0x9ff6('0x3f')](_0x3f2c6a[_0x9ff6('0x3c')],{'$or':_[_0x9ff6('0x2c')](_0x3f2c6a[_0x9ff6('0x35')],function(_0xfce8d0){var _0x266a36={};_0x266a36[_0xfce8d0]={'$like':'%'+_0x242189[_0x9ff6('0x32')][_0x9ff6('0x3e')]+'%'};return _0x266a36;})});}_0x3f2c6a=_['merge']({},_0x3f2c6a,_0x242189[_0x9ff6('0x44')]);return _0x70fee5[_0x9ff6('0x4f')](_0x3f2c6a);}})[_0x9ff6('0x28')](function(_0x4c2e5){if(_0x4c2e5){_0x5f2be5=_0x4c2e5[_0x9ff6('0x37')];if(!_0x242189[_0x9ff6('0x32')][_0x9ff6('0x38')](_0x9ff6('0x39'))){_0x3f2c6a[_0x9ff6('0x22')]=qs[_0x9ff6('0x22')](_0x242189[_0x9ff6('0x32')][_0x9ff6('0x22')]);_0x3f2c6a[_0x9ff6('0x1f')]=qs[_0x9ff6('0x1f')](_0x242189[_0x9ff6('0x32')][_0x9ff6('0x1f')]);}return _0x70fee5[_0x9ff6('0x4f')](_0x3f2c6a);}})['then'](function(_0x56bdff){if(_0x56bdff){return _0x56bdff?{'count':_0x5f2be5,'rows':_0x56bdff}:null;}})['then'](respondWithResult(_0x2e1242,null))[_0x9ff6('0x42')](handleError(_0x2e1242,null));};exports[_0x9ff6('0x51')]=function(_0x38ca2d,_0x409321,_0x3a6375){if(_0x38ca2d['body']['id']){delete _0x38ca2d['body']['id'];}return db[_0x9ff6('0x2d')]['findOne']({'where':{'id':_0x38ca2d[_0x9ff6('0x48')]['id']}})[_0x9ff6('0x28')](handleEntityNotFound(_0x409321,null))['then'](function(_0x449ce2){if(_0x449ce2){return _0x449ce2[_0x9ff6('0x51')](_0x38ca2d[_0x9ff6('0x46')][_0x9ff6('0x52')]||[]);}return null;})[_0x9ff6('0x28')](respondWithResult(_0x409321,null))['catch'](handleError(_0x409321,null));};
\ No newline at end of file
+var _0x05a7=['includeAll','include','findAll','catch','show','find','create','body','params','destroy','getFields','findOne','hasOwnProperty','getSubjects','DeskField','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','set','apply','reject','save','update','then','end','sendStatus','error','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count'];(function(_0x673722,_0x275d7e){var _0x21249c=function(_0x25b4e7){while(--_0x25b4e7){_0x673722['push'](_0x673722['shift']());}};_0x21249c(++_0x275d7e);}(_0x05a7,0x1ad));var _0x705a=function(_0xbc346f,_0x3db5c0){_0xbc346f=_0xbc346f-0x0;var _0x9f9260=_0x05a7[_0xbc346f];return _0x9f9260;};'use strict';var emlformat=require(_0x705a('0x0'));var rimraf=require(_0x705a('0x1'));var zipdir=require(_0x705a('0x2'));var jsonpatch=require(_0x705a('0x3'));var rp=require(_0x705a('0x4'));var moment=require(_0x705a('0x5'));var BPromise=require(_0x705a('0x6'));var Mustache=require(_0x705a('0x7'));var util=require(_0x705a('0x8'));var path=require(_0x705a('0x9'));var sox=require(_0x705a('0xa'));var csv=require('to-csv');var ejs=require(_0x705a('0xb'));var fs=require('fs');var fs_extra=require(_0x705a('0xc'));var _=require(_0x705a('0xd'));var squel=require(_0x705a('0xe'));var crypto=require(_0x705a('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x705a('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x705a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x705a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x705a('0x13'))('api');var utils=require(_0x705a('0x14'));var config=require(_0x705a('0x15'));var licenseUtil=require(_0x705a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3bab43,_0x524a00){_0x524a00=_0x524a00||0xcc;return function(_0x1899d8){if(_0x1899d8){return _0x3bab43['sendStatus'](_0x524a00);}return _0x3bab43[_0x705a('0x17')](_0x524a00)['end']();};}function respondWithResult(_0x22f4c3,_0x361e28){_0x361e28=_0x361e28||0xc8;return function(_0x571e96){if(_0x571e96){return _0x22f4c3['status'](_0x361e28)[_0x705a('0x18')](_0x571e96);}};}function respondWithFilteredResult(_0x389138,_0x33fb06){return function(_0x425595){if(_0x425595){var _0x13d199=typeof _0x33fb06[_0x705a('0x19')]==='undefined'&&typeof _0x33fb06['limit']===_0x705a('0x1a');var _0x3f9059=_0x425595['count'];var _0x5227ed=_0x13d199?0x0:_0x33fb06[_0x705a('0x19')];var _0x4ab2fe=_0x13d199?_0x425595['count']:_0x33fb06[_0x705a('0x19')]+_0x33fb06[_0x705a('0x1b')];var _0x54ce5a;if(_0x4ab2fe>=_0x3f9059){_0x4ab2fe=_0x3f9059;_0x54ce5a=0xc8;}else{_0x54ce5a=0xce;}_0x389138[_0x705a('0x17')](_0x54ce5a);return _0x389138[_0x705a('0x1c')]('Content-Range',_0x5227ed+'-'+_0x4ab2fe+'/'+_0x3f9059)['json'](_0x425595);}return null;};}function patchUpdates(_0x16ffc5){return function(_0x591eac){try{jsonpatch[_0x705a('0x1d')](_0x591eac,_0x16ffc5,!![]);}catch(_0x524d51){return BPromise[_0x705a('0x1e')](_0x524d51);}return _0x591eac[_0x705a('0x1f')]();};}function saveUpdates(_0x4565d8,_0x11e6d4){return function(_0x1ed677){if(_0x1ed677){return _0x1ed677[_0x705a('0x20')](_0x4565d8)[_0x705a('0x21')](function(_0x5e1420){return _0x5e1420;});}return null;};}function removeEntity(_0x3b8aaf,_0x1ba1aa){return function(_0xd22ba3){if(_0xd22ba3){return _0xd22ba3['destroy']()[_0x705a('0x21')](function(){_0x3b8aaf[_0x705a('0x17')](0xcc)[_0x705a('0x22')]();});}};}function handleEntityNotFound(_0x2abd13,_0xb6e083){return function(_0x19a0e4){if(!_0x19a0e4){_0x2abd13[_0x705a('0x23')](0x194);}return _0x19a0e4;};}function handleError(_0x56582,_0x3a76fd){_0x3a76fd=_0x3a76fd||0x1f4;return function(_0x59dea0){logger[_0x705a('0x24')](_0x59dea0['stack']);if(_0x59dea0[_0x705a('0x25')]){delete _0x59dea0[_0x705a('0x25')];}_0x56582[_0x705a('0x17')](_0x3a76fd)[_0x705a('0x26')](_0x59dea0);};}exports[_0x705a('0x27')]=function(_0x39b00f,_0x33ac1c){var _0x26b791={},_0x4c8d42={},_0x463711={'count':0x0,'rows':[]};var _0x232987=_[_0x705a('0x28')](db[_0x705a('0x29')][_0x705a('0x2a')],function(_0x5e1e29){return{'name':_0x5e1e29[_0x705a('0x2b')],'type':_0x5e1e29[_0x705a('0x2c')]['key']};});_0x4c8d42['model']=_[_0x705a('0x28')](_0x232987,_0x705a('0x25'));_0x4c8d42[_0x705a('0x2d')]=_[_0x705a('0x2e')](_0x39b00f['query']);_0x4c8d42[_0x705a('0x2f')]=_[_0x705a('0x30')](_0x4c8d42[_0x705a('0x31')],_0x4c8d42[_0x705a('0x2d')]);_0x26b791[_0x705a('0x32')]=_[_0x705a('0x30')](_0x4c8d42['model'],qs[_0x705a('0x33')](_0x39b00f[_0x705a('0x2d')][_0x705a('0x33')]));_0x26b791[_0x705a('0x32')]=_0x26b791[_0x705a('0x32')][_0x705a('0x34')]?_0x26b791[_0x705a('0x32')]:_0x4c8d42['model'];if(!_0x39b00f['query']['hasOwnProperty'](_0x705a('0x35'))){_0x26b791[_0x705a('0x1b')]=qs[_0x705a('0x1b')](_0x39b00f[_0x705a('0x2d')][_0x705a('0x1b')]);_0x26b791[_0x705a('0x19')]=qs[_0x705a('0x19')](_0x39b00f[_0x705a('0x2d')][_0x705a('0x19')]);}_0x26b791[_0x705a('0x36')]=qs['sort'](_0x39b00f[_0x705a('0x2d')][_0x705a('0x37')]);_0x26b791[_0x705a('0x38')]=qs[_0x705a('0x2f')](_[_0x705a('0x39')](_0x39b00f[_0x705a('0x2d')],_0x4c8d42[_0x705a('0x2f')]),_0x232987);if(_0x39b00f[_0x705a('0x2d')][_0x705a('0x3a')]){_0x26b791[_0x705a('0x38')]=_[_0x705a('0x3b')](_0x26b791[_0x705a('0x38')],{'$or':_['map'](_0x232987,function(_0x308e2a){if(_0x308e2a[_0x705a('0x2c')]!==_0x705a('0x3c')){var _0x52fa1d={};_0x52fa1d[_0x308e2a[_0x705a('0x25')]]={'$like':'%'+_0x39b00f['query'][_0x705a('0x3a')]+'%'};return _0x52fa1d;}})});}_0x26b791=_[_0x705a('0x3b')]({},_0x26b791,_0x39b00f[_0x705a('0x3d')]);var _0x153021={'where':_0x26b791[_0x705a('0x38')]};return db[_0x705a('0x29')]['count'](_0x153021)[_0x705a('0x21')](function(_0x13323d){_0x463711[_0x705a('0x3e')]=_0x13323d;if(_0x39b00f[_0x705a('0x2d')][_0x705a('0x3f')]){_0x26b791[_0x705a('0x40')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x705a('0x41')](_0x26b791);})[_0x705a('0x21')](function(_0x1fb9ed){_0x463711['rows']=_0x1fb9ed;return _0x463711;})['then'](respondWithFilteredResult(_0x33ac1c,_0x26b791))[_0x705a('0x42')](handleError(_0x33ac1c,null));};exports[_0x705a('0x43')]=function(_0x4a9fcc,_0x198070){var _0x374e41={'raw':![],'where':{'id':_0x4a9fcc['params']['id']}},_0x1f6cd1={};_0x1f6cd1[_0x705a('0x31')]=_[_0x705a('0x2e')](db['DeskConfiguration']['rawAttributes']);_0x1f6cd1[_0x705a('0x2d')]=_[_0x705a('0x2e')](_0x4a9fcc['query']);_0x1f6cd1['filters']=_[_0x705a('0x30')](_0x1f6cd1[_0x705a('0x31')],_0x1f6cd1['query']);_0x374e41['attributes']=_[_0x705a('0x30')](_0x1f6cd1[_0x705a('0x31')],qs['fields'](_0x4a9fcc[_0x705a('0x2d')][_0x705a('0x33')]));_0x374e41[_0x705a('0x32')]=_0x374e41[_0x705a('0x32')][_0x705a('0x34')]?_0x374e41[_0x705a('0x32')]:_0x1f6cd1[_0x705a('0x31')];if(_0x4a9fcc[_0x705a('0x2d')][_0x705a('0x3f')]){_0x374e41[_0x705a('0x40')]=[{'all':!![]}];}_0x374e41=_['merge']({},_0x374e41,_0x4a9fcc[_0x705a('0x3d')]);return db[_0x705a('0x29')][_0x705a('0x44')](_0x374e41)[_0x705a('0x21')](handleEntityNotFound(_0x198070,null))[_0x705a('0x21')](respondWithResult(_0x198070,null))[_0x705a('0x42')](handleError(_0x198070,null));};exports['create']=function(_0x21166a,_0x3604f8){return db[_0x705a('0x29')][_0x705a('0x45')](_0x21166a['body'],{})[_0x705a('0x21')](respondWithResult(_0x3604f8,0xc9))[_0x705a('0x42')](handleError(_0x3604f8,null));};exports[_0x705a('0x20')]=function(_0xe0e1ca,_0x48e6c1){if(_0xe0e1ca['body']['id']){delete _0xe0e1ca[_0x705a('0x46')]['id'];}return db[_0x705a('0x29')]['find']({'where':{'id':_0xe0e1ca[_0x705a('0x47')]['id']}})[_0x705a('0x21')](handleEntityNotFound(_0x48e6c1,null))[_0x705a('0x21')](saveUpdates(_0xe0e1ca[_0x705a('0x46')],null))[_0x705a('0x21')](respondWithResult(_0x48e6c1,null))[_0x705a('0x42')](handleError(_0x48e6c1,null));};exports[_0x705a('0x48')]=function(_0x23f204,_0x2a2b30){return db[_0x705a('0x29')][_0x705a('0x44')]({'where':{'id':_0x23f204[_0x705a('0x47')]['id']}})[_0x705a('0x21')](handleEntityNotFound(_0x2a2b30,null))[_0x705a('0x21')](removeEntity(_0x2a2b30,null))['catch'](handleError(_0x2a2b30,null));};exports[_0x705a('0x49')]=function(_0x31f6e4,_0xe7b973,_0x55074d){var _0x38e712={};var _0x49e925={};var _0x3a42e0;var _0x4693ef;return db[_0x705a('0x29')][_0x705a('0x4a')]({'where':{'id':_0x31f6e4[_0x705a('0x47')]['id']}})['then'](handleEntityNotFound(_0xe7b973,null))['then'](function(_0x427aed){if(_0x427aed){_0x3a42e0=_0x427aed;_0x49e925['model']=_[_0x705a('0x2e')](db['DeskField'][_0x705a('0x2a')]);_0x49e925['query']=_[_0x705a('0x2e')](_0x31f6e4[_0x705a('0x2d')]);_0x49e925[_0x705a('0x2f')]=_['intersection'](_0x49e925[_0x705a('0x31')],_0x49e925[_0x705a('0x2d')]);_0x38e712[_0x705a('0x32')]=_['intersection'](_0x49e925[_0x705a('0x31')],qs['fields'](_0x31f6e4[_0x705a('0x2d')][_0x705a('0x33')]));_0x38e712['attributes']=_0x38e712[_0x705a('0x32')][_0x705a('0x34')]?_0x38e712[_0x705a('0x32')]:_0x49e925[_0x705a('0x31')];_0x38e712[_0x705a('0x36')]=qs[_0x705a('0x37')](_0x31f6e4[_0x705a('0x2d')][_0x705a('0x37')]);_0x38e712[_0x705a('0x38')]=qs[_0x705a('0x2f')](_[_0x705a('0x39')](_0x31f6e4['query'],_0x49e925[_0x705a('0x2f')]));if(_0x31f6e4[_0x705a('0x2d')][_0x705a('0x3a')]){_0x38e712[_0x705a('0x38')]=_[_0x705a('0x3b')](_0x38e712[_0x705a('0x38')],{'$or':_[_0x705a('0x28')](_0x38e712[_0x705a('0x32')],function(_0x180994){var _0x1ac5f0={};_0x1ac5f0[_0x180994]={'$like':'%'+_0x31f6e4[_0x705a('0x2d')][_0x705a('0x3a')]+'%'};return _0x1ac5f0;})});}_0x38e712=_[_0x705a('0x3b')]({},_0x38e712,_0x31f6e4['options']);return _0x3a42e0[_0x705a('0x49')](_0x38e712);}})[_0x705a('0x21')](function(_0x5f0b6d){if(_0x5f0b6d){_0x4693ef=_0x5f0b6d[_0x705a('0x34')];if(!_0x31f6e4[_0x705a('0x2d')][_0x705a('0x4b')](_0x705a('0x35'))){_0x38e712['limit']=qs['limit'](_0x31f6e4[_0x705a('0x2d')][_0x705a('0x1b')]);_0x38e712[_0x705a('0x19')]=qs['offset'](_0x31f6e4[_0x705a('0x2d')][_0x705a('0x19')]);}return _0x3a42e0[_0x705a('0x49')](_0x38e712);}})[_0x705a('0x21')](function(_0x40719e){if(_0x40719e){return _0x40719e?{'count':_0x4693ef,'rows':_0x40719e}:null;}})[_0x705a('0x21')](respondWithResult(_0xe7b973,null))[_0x705a('0x42')](handleError(_0xe7b973,null));};exports[_0x705a('0x4c')]=function(_0x52dd5e,_0x44bc88,_0x190969){var _0x1adfbc={};var _0x3b2851={};var _0x42481a;var _0x308c2f;return db['DeskConfiguration'][_0x705a('0x4a')]({'where':{'id':_0x52dd5e[_0x705a('0x47')]['id']}})[_0x705a('0x21')](handleEntityNotFound(_0x44bc88,null))[_0x705a('0x21')](function(_0x5b44d3){if(_0x5b44d3){_0x42481a=_0x5b44d3;_0x3b2851[_0x705a('0x31')]=_[_0x705a('0x2e')](db[_0x705a('0x4d')][_0x705a('0x2a')]);_0x3b2851['query']=_[_0x705a('0x2e')](_0x52dd5e['query']);_0x3b2851[_0x705a('0x2f')]=_[_0x705a('0x30')](_0x3b2851[_0x705a('0x31')],_0x3b2851[_0x705a('0x2d')]);_0x1adfbc[_0x705a('0x32')]=_[_0x705a('0x30')](_0x3b2851[_0x705a('0x31')],qs[_0x705a('0x33')](_0x52dd5e['query'][_0x705a('0x33')]));_0x1adfbc[_0x705a('0x32')]=_0x1adfbc[_0x705a('0x32')]['length']?_0x1adfbc[_0x705a('0x32')]:_0x3b2851[_0x705a('0x31')];_0x1adfbc[_0x705a('0x36')]=qs[_0x705a('0x37')](_0x52dd5e[_0x705a('0x2d')]['sort']);_0x1adfbc[_0x705a('0x38')]=qs[_0x705a('0x2f')](_['pick'](_0x52dd5e[_0x705a('0x2d')],_0x3b2851[_0x705a('0x2f')]));if(_0x52dd5e['query']['filter']){_0x1adfbc[_0x705a('0x38')]=_[_0x705a('0x3b')](_0x1adfbc['where'],{'$or':_['map'](_0x1adfbc[_0x705a('0x32')],function(_0x129ad2){var _0x5eda95={};_0x5eda95[_0x129ad2]={'$like':'%'+_0x52dd5e[_0x705a('0x2d')]['filter']+'%'};return _0x5eda95;})});}_0x1adfbc=_[_0x705a('0x3b')]({},_0x1adfbc,_0x52dd5e[_0x705a('0x3d')]);return _0x42481a['getSubjects'](_0x1adfbc);}})[_0x705a('0x21')](function(_0x45e0fd){if(_0x45e0fd){_0x308c2f=_0x45e0fd[_0x705a('0x34')];if(!_0x52dd5e[_0x705a('0x2d')][_0x705a('0x4b')](_0x705a('0x35'))){_0x1adfbc['limit']=qs['limit'](_0x52dd5e[_0x705a('0x2d')][_0x705a('0x1b')]);_0x1adfbc['offset']=qs[_0x705a('0x19')](_0x52dd5e[_0x705a('0x2d')][_0x705a('0x19')]);}return _0x42481a[_0x705a('0x4c')](_0x1adfbc);}})[_0x705a('0x21')](function(_0x370ce3){if(_0x370ce3){return _0x370ce3?{'count':_0x308c2f,'rows':_0x370ce3}:null;}})['then'](respondWithResult(_0x44bc88,null))[_0x705a('0x42')](handleError(_0x44bc88,null));};exports['getDescriptions']=function(_0x1ba255,_0x3abc58,_0x5155b3){var _0x3c3b6b={};var _0x21fbe6={};var _0x32f4cc;var _0x2cb33c;return db[_0x705a('0x29')][_0x705a('0x4a')]({'where':{'id':_0x1ba255[_0x705a('0x47')]['id']}})[_0x705a('0x21')](handleEntityNotFound(_0x3abc58,null))[_0x705a('0x21')](function(_0x5de30e){if(_0x5de30e){_0x32f4cc=_0x5de30e;_0x21fbe6['model']=_[_0x705a('0x2e')](db['DeskField'][_0x705a('0x2a')]);_0x21fbe6['query']=_[_0x705a('0x2e')](_0x1ba255[_0x705a('0x2d')]);_0x21fbe6['filters']=_[_0x705a('0x30')](_0x21fbe6[_0x705a('0x31')],_0x21fbe6[_0x705a('0x2d')]);_0x3c3b6b[_0x705a('0x32')]=_['intersection'](_0x21fbe6[_0x705a('0x31')],qs[_0x705a('0x33')](_0x1ba255[_0x705a('0x2d')][_0x705a('0x33')]));_0x3c3b6b['attributes']=_0x3c3b6b[_0x705a('0x32')][_0x705a('0x34')]?_0x3c3b6b[_0x705a('0x32')]:_0x21fbe6[_0x705a('0x31')];_0x3c3b6b[_0x705a('0x36')]=qs[_0x705a('0x37')](_0x1ba255[_0x705a('0x2d')][_0x705a('0x37')]);_0x3c3b6b['where']=qs[_0x705a('0x2f')](_['pick'](_0x1ba255[_0x705a('0x2d')],_0x21fbe6[_0x705a('0x2f')]));if(_0x1ba255[_0x705a('0x2d')][_0x705a('0x3a')]){_0x3c3b6b[_0x705a('0x38')]=_[_0x705a('0x3b')](_0x3c3b6b[_0x705a('0x38')],{'$or':_['map'](_0x3c3b6b['attributes'],function(_0x189586){var _0x5639a1={};_0x5639a1[_0x189586]={'$like':'%'+_0x1ba255['query']['filter']+'%'};return _0x5639a1;})});}_0x3c3b6b=_[_0x705a('0x3b')]({},_0x3c3b6b,_0x1ba255[_0x705a('0x3d')]);return _0x32f4cc[_0x705a('0x4e')](_0x3c3b6b);}})[_0x705a('0x21')](function(_0x298553){if(_0x298553){_0x2cb33c=_0x298553[_0x705a('0x34')];if(!_0x1ba255['query']['hasOwnProperty']('nolimit')){_0x3c3b6b[_0x705a('0x1b')]=qs[_0x705a('0x1b')](_0x1ba255[_0x705a('0x2d')][_0x705a('0x1b')]);_0x3c3b6b[_0x705a('0x19')]=qs[_0x705a('0x19')](_0x1ba255[_0x705a('0x2d')][_0x705a('0x19')]);}return _0x32f4cc['getDescriptions'](_0x3c3b6b);}})[_0x705a('0x21')](function(_0x20b1ec){if(_0x20b1ec){return _0x20b1ec?{'count':_0x2cb33c,'rows':_0x20b1ec}:null;}})[_0x705a('0x21')](respondWithResult(_0x3abc58,null))[_0x705a('0x42')](handleError(_0x3abc58,null));};exports[_0x705a('0x4f')]=function(_0x587d2b,_0x3b1f20,_0x2db679){var _0x427a6a={};var _0x28d495={};var _0x1a67fe;var _0x1f97a9;return db['DeskConfiguration'][_0x705a('0x4a')]({'where':{'id':_0x587d2b[_0x705a('0x47')]['id']}})[_0x705a('0x21')](handleEntityNotFound(_0x3b1f20,null))[_0x705a('0x21')](function(_0x3afd30){if(_0x3afd30){_0x1a67fe=_0x3afd30;_0x28d495[_0x705a('0x31')]=_[_0x705a('0x2e')](db[_0x705a('0x50')][_0x705a('0x2a')]);_0x28d495['query']=_[_0x705a('0x2e')](_0x587d2b[_0x705a('0x2d')]);_0x28d495[_0x705a('0x2f')]=_[_0x705a('0x30')](_0x28d495[_0x705a('0x31')],_0x28d495[_0x705a('0x2d')]);_0x427a6a[_0x705a('0x32')]=_[_0x705a('0x30')](_0x28d495[_0x705a('0x31')],qs[_0x705a('0x33')](_0x587d2b[_0x705a('0x2d')][_0x705a('0x33')]));_0x427a6a[_0x705a('0x32')]=_0x427a6a['attributes']['length']?_0x427a6a[_0x705a('0x32')]:_0x28d495[_0x705a('0x31')];_0x427a6a[_0x705a('0x36')]=qs[_0x705a('0x37')](_0x587d2b[_0x705a('0x2d')][_0x705a('0x37')]);_0x427a6a[_0x705a('0x38')]=qs[_0x705a('0x2f')](_[_0x705a('0x39')](_0x587d2b['query'],_0x28d495[_0x705a('0x2f')]));if(_0x587d2b[_0x705a('0x2d')][_0x705a('0x3a')]){_0x427a6a['where']=_['merge'](_0x427a6a[_0x705a('0x38')],{'$or':_[_0x705a('0x28')](_0x427a6a[_0x705a('0x32')],function(_0x7f1b47){var _0x473726={};_0x473726[_0x7f1b47]={'$like':'%'+_0x587d2b[_0x705a('0x2d')]['filter']+'%'};return _0x473726;})});}_0x427a6a=_[_0x705a('0x3b')]({},_0x427a6a,_0x587d2b[_0x705a('0x3d')]);return _0x1a67fe[_0x705a('0x4f')](_0x427a6a);}})[_0x705a('0x21')](function(_0x5ace3d){if(_0x5ace3d){_0x1f97a9=_0x5ace3d[_0x705a('0x34')];if(!_0x587d2b[_0x705a('0x2d')][_0x705a('0x4b')](_0x705a('0x35'))){_0x427a6a[_0x705a('0x1b')]=qs[_0x705a('0x1b')](_0x587d2b[_0x705a('0x2d')][_0x705a('0x1b')]);_0x427a6a[_0x705a('0x19')]=qs['offset'](_0x587d2b['query']['offset']);}return _0x1a67fe[_0x705a('0x4f')](_0x427a6a);}})[_0x705a('0x21')](function(_0x2c78cd){if(_0x2c78cd){return _0x2c78cd?{'count':_0x1f97a9,'rows':_0x2c78cd}:null;}})[_0x705a('0x21')](respondWithResult(_0x3b1f20,null))['catch'](handleError(_0x3b1f20,null));};exports[_0x705a('0x51')]=function(_0x77714a,_0x536c78,_0x14e3f1){if(_0x77714a[_0x705a('0x46')]['id']){delete _0x77714a[_0x705a('0x46')]['id'];}return db[_0x705a('0x29')]['findOne']({'where':{'id':_0x77714a['params']['id']}})[_0x705a('0x21')](handleEntityNotFound(_0x536c78,null))['then'](function(_0x6c1103){if(_0x6c1103){return _0x6c1103[_0x705a('0x51')](_0x77714a[_0x705a('0x46')]['ids']||[]);}return null;})[_0x705a('0x21')](respondWithResult(_0x536c78,null))[_0x705a('0x42')](handleError(_0x536c78,null));};
\ No newline at end of file
index 196615b..f390089 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf86b=['../../config/environment','./intDeskConfiguration.attributes','exports','define','int_desk_configurations','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x984ff7,_0x3b21ee){var _0x41942a=function(_0x2c95d9){while(--_0x2c95d9){_0x984ff7['push'](_0x984ff7['shift']());}};_0x41942a(++_0x3b21ee);}(_0xf86b,0xd7));var _0xbf86=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf86b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbf86('0x0'))(_0xbf86('0x1'));var moment=require(_0xbf86('0x2'));var BPromise=require(_0xbf86('0x3'));var rp=require(_0xbf86('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbf86('0x5'));var attributes=require(_0xbf86('0x6'));module[_0xbf86('0x7')]=function(_0x367620,_0x459411){return _0x367620[_0xbf86('0x8')]('DeskConfiguration',attributes,{'tableName':_0xbf86('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbe5b=['exports','define','DeskConfiguration','int_desk_configurations','lodash','util','api','rimraf','../../config/environment'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xbe5b,0x199));var _0xbbe5=function(_0x3472b5,_0x41d633){_0x3472b5=_0x3472b5-0x0;var _0x3c628a=_0xbe5b[_0x3472b5];return _0x3c628a;};'use strict';var _=require(_0xbbe5('0x0'));var util=require(_0xbbe5('0x1'));var logger=require('../../config/logger')(_0xbbe5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbbe5('0x3'));var config=require(_0xbbe5('0x4'));var attributes=require('./intDeskConfiguration.attributes');module[_0xbbe5('0x5')]=function(_0x189288,_0x476d5b){return _0x189288[_0xbbe5('0x6')](_0xbbe5('0x7'),attributes,{'tableName':_0xbbe5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 692c999..6f58bdf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1fed=['debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','request','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x546aaf,_0x1ed138){var _0x1cbf6d=function(_0x36c837){while(--_0x36c837){_0x546aaf['push'](_0x546aaf['shift']());}};_0x1cbf6d(++_0x1ed138);}(_0x1fed,0x1d3));var _0xd1fe=function(_0x3dd266,_0x4d919f){_0x3dd266=_0x3dd266-0x0;var _0x320665=_0x1fed[_0x3dd266];return _0x320665;};'use strict';var _=require(_0xd1fe('0x0'));var util=require('util');var moment=require(_0xd1fe('0x1'));var BPromise=require(_0xd1fe('0x2'));var rs=require(_0xd1fe('0x3'));var fs=require('fs');var Redis=require(_0xd1fe('0x4'));var db=require(_0xd1fe('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd1fe('0x6'));var config=require('../../config/environment');var jayson=require(_0xd1fe('0x7'));var client=jayson[_0xd1fe('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x550fe4,_0x47fb79,_0x4ab4fc){return new BPromise(function(_0x187285,_0xa14551){return client[_0xd1fe('0x9')](_0x550fe4,_0x4ab4fc)[_0xd1fe('0xa')](function(_0x39e44a){logger['info'](_0xd1fe('0xb'),_0x47fb79,_0xd1fe('0xc'));logger[_0xd1fe('0xd')](_0xd1fe('0xe'),_0x47fb79,_0xd1fe('0xc'),JSON['stringify'](_0x39e44a));if(_0x39e44a[_0xd1fe('0xf')]){if(_0x39e44a[_0xd1fe('0xf')][_0xd1fe('0x10')]===0x1f4){logger[_0xd1fe('0xf')](_0xd1fe('0xb'),_0x47fb79,_0x39e44a['error'][_0xd1fe('0x11')]);return _0xa14551(_0x39e44a[_0xd1fe('0xf')]['message']);}logger[_0xd1fe('0xf')]('DeskConfiguration,\x20%s,\x20%s',_0x47fb79,_0x39e44a[_0xd1fe('0xf')][_0xd1fe('0x11')]);return _0x187285(_0x39e44a[_0xd1fe('0xf')][_0xd1fe('0x11')]);}else{logger[_0xd1fe('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x47fb79,_0xd1fe('0xc'));_0x187285(_0x39e44a[_0xd1fe('0x13')]['message']);}})['catch'](function(_0x11bdee){logger['error'](_0xd1fe('0xb'),_0x47fb79,_0x11bdee);_0xa14551(_0x11bdee);});});}
\ No newline at end of file
+var _0x20d8=['stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x16c8fc,_0x197778){var _0x34ce69=function(_0x4df72b){while(--_0x4df72b){_0x16c8fc['push'](_0x16c8fc['shift']());}};_0x34ce69(++_0x197778);}(_0x20d8,0xee));var _0x820d=function(_0x144d5b,_0xc6249f){_0x144d5b=_0x144d5b-0x0;var _0xccdcf4=_0x20d8[_0x144d5b];return _0xccdcf4;};'use strict';var _=require(_0x820d('0x0'));var util=require(_0x820d('0x1'));var moment=require(_0x820d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x820d('0x3'));var db=require(_0x820d('0x4'))['db'];var utils=require(_0x820d('0x5'));var logger=require(_0x820d('0x6'))(_0x820d('0x7'));var config=require('../../config/environment');var jayson=require(_0x820d('0x8'));var client=jayson[_0x820d('0x9')][_0x820d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e23e3,_0x435a84,_0xa2751d){return new BPromise(function(_0x3b084c,_0x485bde){return client[_0x820d('0xb')](_0x4e23e3,_0xa2751d)['then'](function(_0x45fdd7){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x435a84,_0x820d('0xc'));logger['debug'](_0x820d('0xd'),_0x435a84,_0x820d('0xc'),JSON[_0x820d('0xe')](_0x45fdd7));if(_0x45fdd7['error']){if(_0x45fdd7[_0x820d('0xf')][_0x820d('0x10')]===0x1f4){logger['error'](_0x820d('0x11'),_0x435a84,_0x45fdd7['error'][_0x820d('0x12')]);return _0x485bde(_0x45fdd7[_0x820d('0xf')][_0x820d('0x12')]);}logger[_0x820d('0xf')](_0x820d('0x11'),_0x435a84,_0x45fdd7[_0x820d('0xf')]['message']);return _0x3b084c(_0x45fdd7['error'][_0x820d('0x12')]);}else{logger['info'](_0x820d('0x11'),_0x435a84,_0x820d('0xc'));_0x3b084c(_0x45fdd7[_0x820d('0x13')]['message']);}})[_0x820d('0x14')](function(_0x3466c1){logger[_0x820d('0xf')](_0x820d('0x11'),_0x435a84,_0x3466c1);_0x485bde(_0x3466c1);});});}
\ No newline at end of file
index 58b2da5..e3f746e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4cf=['isAuthenticated','index','get','/:id','show','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xc4cf,0xc8));var _0xfc4c=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0xc4cf[_0x411017];return _0x2adeea;};'use strict';var multer=require(_0xfc4c('0x0'));var util=require(_0xfc4c('0x1'));var path=require(_0xfc4c('0x2'));var timeout=require(_0xfc4c('0x3'));var express=require(_0xfc4c('0x4'));var router=express[_0xfc4c('0x5')]();var fs_extra=require(_0xfc4c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xfc4c('0x7'));var config=require(_0xfc4c('0x8'));var controller=require('./intDeskField.controller');router['get']('/',auth[_0xfc4c('0x9')](),controller[_0xfc4c('0xa')]);router[_0xfc4c('0xb')](_0xfc4c('0xc'),auth['isAuthenticated'](),controller[_0xfc4c('0xd')]);router[_0xfc4c('0xe')]('/',auth[_0xfc4c('0x9')](),controller[_0xfc4c('0xf')]);router[_0xfc4c('0x10')](_0xfc4c('0xc'),auth[_0xfc4c('0x9')](),controller['update']);router['delete']('/:id',auth[_0xfc4c('0x9')](),controller[_0xfc4c('0x11')]);module[_0xfc4c('0x12')]=router;
\ No newline at end of file
+var _0x25a8=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','/:id','update','delete','destroy','multer'];(function(_0x3f4bb0,_0x13821e){var _0x5b316a=function(_0x12c027){while(--_0x12c027){_0x3f4bb0['push'](_0x3f4bb0['shift']());}};_0x5b316a(++_0x13821e);}(_0x25a8,0x18b));var _0x825a=function(_0x4d2916,_0x479ece){_0x4d2916=_0x4d2916-0x0;var _0x2ee767=_0x25a8[_0x4d2916];return _0x2ee767;};'use strict';var multer=require(_0x825a('0x0'));var util=require('util');var path=require(_0x825a('0x1'));var timeout=require(_0x825a('0x2'));var express=require(_0x825a('0x3'));var router=express['Router']();var fs_extra=require(_0x825a('0x4'));var auth=require(_0x825a('0x5'));var interaction=require(_0x825a('0x6'));var config=require(_0x825a('0x7'));var controller=require('./intDeskField.controller');router[_0x825a('0x8')]('/',auth[_0x825a('0x9')](),controller[_0x825a('0xa')]);router['get']('/:id',auth[_0x825a('0x9')](),controller[_0x825a('0xb')]);router[_0x825a('0xc')]('/',auth[_0x825a('0x9')](),controller[_0x825a('0xd')]);router['put'](_0x825a('0xe'),auth[_0x825a('0x9')](),controller[_0x825a('0xf')]);router[_0x825a('0x10')](_0x825a('0xe'),auth[_0x825a('0x9')](),controller[_0x825a('0x11')]);module['exports']=router;
\ No newline at end of file
index d88f054..e3cd766 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24dc=['string','STRING','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist'];(function(_0xa990b7,_0x26c527){var _0x52c99c=function(_0xf94328){while(--_0xf94328){_0xa990b7['push'](_0xa990b7['shift']());}};_0x52c99c(++_0x26c527);}(_0x24dc,0x197));var _0xc24d=function(_0x47c9fd,_0x2b1512){_0x47c9fd=_0x47c9fd-0x0;var _0x35ca44=_0x24dc[_0x47c9fd];return _0x35ca44;};'use strict';var Sequelize=require(_0xc24d('0x0'));module[_0xc24d('0x1')]={'type':{'type':Sequelize[_0xc24d('0x2')]('string',_0xc24d('0x3'),_0xc24d('0x4'),_0xc24d('0x5'),_0xc24d('0x6')),'defaultValue':_0xc24d('0x7')},'content':{'type':Sequelize[_0xc24d('0x8')]},'key':{'type':Sequelize[_0xc24d('0x8')]},'keyType':{'type':Sequelize[_0xc24d('0x2')](_0xc24d('0x7'),_0xc24d('0x3'),_0xc24d('0x4'))},'keyContent':{'type':Sequelize[_0xc24d('0x8')]},'idField':{'type':Sequelize[_0xc24d('0x8')]},'nameField':{'type':Sequelize[_0xc24d('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x59d6=['exports','string','variable','customVariable','keyValue','picklist','STRING','sequelize'];(function(_0x13a013,_0x4c4894){var _0x103bb7=function(_0x411f48){while(--_0x411f48){_0x13a013['push'](_0x13a013['shift']());}};_0x103bb7(++_0x4c4894);}(_0x59d6,0x1ef));var _0x659d=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x59d6[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0x659d('0x0'));module[_0x659d('0x1')]={'type':{'type':Sequelize['ENUM'](_0x659d('0x2'),_0x659d('0x3'),_0x659d('0x4'),_0x659d('0x5'),_0x659d('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x659d('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x659d('0x2'),'variable',_0x659d('0x4'))},'keyContent':{'type':Sequelize[_0x659d('0x7')]},'idField':{'type':Sequelize[_0x659d('0x7')]},'nameField':{'type':Sequelize[_0x659d('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x659d('0x7')]}};
\ No newline at end of file
index 972f9eb..be36641 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf130=['name','index','DeskField','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','end','stack'];(function(_0x4627b7,_0x269344){var _0xf75718=function(_0x45c922){while(--_0x45c922){_0x4627b7['push'](_0x4627b7['shift']());}};_0xf75718(++_0x269344);}(_0xf130,0x149));var _0x0f13=function(_0x1f68dd,_0x40414e){_0x1f68dd=_0x1f68dd-0x0;var _0x5b72c9=_0xf130[_0x1f68dd];return _0x5b72c9;};'use strict';var emlformat=require(_0x0f13('0x0'));var rimraf=require(_0x0f13('0x1'));var zipdir=require(_0x0f13('0x2'));var jsonpatch=require(_0x0f13('0x3'));var rp=require(_0x0f13('0x4'));var moment=require(_0x0f13('0x5'));var BPromise=require(_0x0f13('0x6'));var Mustache=require(_0x0f13('0x7'));var util=require('util');var path=require(_0x0f13('0x8'));var sox=require(_0x0f13('0x9'));var csv=require(_0x0f13('0xa'));var ejs=require(_0x0f13('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0f13('0xc'));var squel=require(_0x0f13('0xd'));var crypto=require(_0x0f13('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0f13('0xf'));var toCsv=require(_0x0f13('0xa'));var querystring=require(_0x0f13('0x10'));var Papa=require(_0x0f13('0x11'));var Redis=require(_0x0f13('0x12'));var authService=require(_0x0f13('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0f13('0x14'));var logger=require('../../config/logger')(_0x0f13('0x15'));var utils=require(_0x0f13('0x16'));var config=require(_0x0f13('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0f13('0x18'))['db'];function respondWithStatusCode(_0x216bb7,_0x3e7de8){_0x3e7de8=_0x3e7de8||0xcc;return function(_0x2ad79e){if(_0x2ad79e){return _0x216bb7[_0x0f13('0x19')](_0x3e7de8);}return _0x216bb7[_0x0f13('0x1a')](_0x3e7de8)['end']();};}function respondWithResult(_0x273e5f,_0x404631){_0x404631=_0x404631||0xc8;return function(_0x50f626){if(_0x50f626){return _0x273e5f[_0x0f13('0x1a')](_0x404631)[_0x0f13('0x1b')](_0x50f626);}};}function respondWithFilteredResult(_0x36c09e,_0xe171cd){return function(_0x187568){if(_0x187568){var _0x308893=typeof _0xe171cd[_0x0f13('0x1c')]===_0x0f13('0x1d')&&typeof _0xe171cd['limit']===_0x0f13('0x1d');var _0x2b4f43=_0x187568['count'];var _0x467e84=_0x308893?0x0:_0xe171cd['offset'];var _0xb8cb0f=_0x308893?_0x187568[_0x0f13('0x1e')]:_0xe171cd[_0x0f13('0x1c')]+_0xe171cd[_0x0f13('0x1f')];var _0x4c544e;if(_0xb8cb0f>=_0x2b4f43){_0xb8cb0f=_0x2b4f43;_0x4c544e=0xc8;}else{_0x4c544e=0xce;}_0x36c09e['status'](_0x4c544e);return _0x36c09e[_0x0f13('0x20')](_0x0f13('0x21'),_0x467e84+'-'+_0xb8cb0f+'/'+_0x2b4f43)[_0x0f13('0x1b')](_0x187568);}return null;};}function patchUpdates(_0x1ad99a){return function(_0x446ad4){try{jsonpatch[_0x0f13('0x22')](_0x446ad4,_0x1ad99a,!![]);}catch(_0x14f657){return BPromise[_0x0f13('0x23')](_0x14f657);}return _0x446ad4[_0x0f13('0x24')]();};}function saveUpdates(_0x728b17,_0x5994d0){return function(_0x58dc78){if(_0x58dc78){return _0x58dc78[_0x0f13('0x25')](_0x728b17)[_0x0f13('0x26')](function(_0x860f0c){return _0x860f0c;});}return null;};}function removeEntity(_0x2e71b4,_0x36b170){return function(_0x393f0e){if(_0x393f0e){return _0x393f0e['destroy']()[_0x0f13('0x26')](function(){_0x2e71b4[_0x0f13('0x1a')](0xcc)[_0x0f13('0x27')]();});}};}function handleEntityNotFound(_0x68dffc,_0x5a6aba){return function(_0x1e71b3){if(!_0x1e71b3){_0x68dffc['sendStatus'](0x194);}return _0x1e71b3;};}function handleError(_0x1509d5,_0x4426fa){_0x4426fa=_0x4426fa||0x1f4;return function(_0x1f5c7e){logger['error'](_0x1f5c7e[_0x0f13('0x28')]);if(_0x1f5c7e[_0x0f13('0x29')]){delete _0x1f5c7e[_0x0f13('0x29')];}_0x1509d5[_0x0f13('0x1a')](_0x4426fa)['send'](_0x1f5c7e);};}exports[_0x0f13('0x2a')]=function(_0x57195c,_0x57b9ed){var _0x513eed={},_0x3dfe41={},_0x155a00={'count':0x0,'rows':[]};var _0x2592b0=_['map'](db[_0x0f13('0x2b')][_0x0f13('0x2c')],function(_0x51a83d){return{'name':_0x51a83d['fieldName'],'type':_0x51a83d[_0x0f13('0x2d')][_0x0f13('0x2e')]};});_0x3dfe41['model']=_['map'](_0x2592b0,_0x0f13('0x29'));_0x3dfe41[_0x0f13('0x2f')]=_[_0x0f13('0x30')](_0x57195c[_0x0f13('0x2f')]);_0x3dfe41['filters']=_[_0x0f13('0x31')](_0x3dfe41[_0x0f13('0x32')],_0x3dfe41['query']);_0x513eed[_0x0f13('0x33')]=_[_0x0f13('0x31')](_0x3dfe41[_0x0f13('0x32')],qs[_0x0f13('0x34')](_0x57195c[_0x0f13('0x2f')]['fields']));_0x513eed['attributes']=_0x513eed['attributes'][_0x0f13('0x35')]?_0x513eed['attributes']:_0x3dfe41[_0x0f13('0x32')];if(!_0x57195c[_0x0f13('0x2f')][_0x0f13('0x36')](_0x0f13('0x37'))){_0x513eed['limit']=qs[_0x0f13('0x1f')](_0x57195c[_0x0f13('0x2f')][_0x0f13('0x1f')]);_0x513eed['offset']=qs[_0x0f13('0x1c')](_0x57195c[_0x0f13('0x2f')][_0x0f13('0x1c')]);}_0x513eed[_0x0f13('0x38')]=qs[_0x0f13('0x39')](_0x57195c['query'][_0x0f13('0x39')]);_0x513eed[_0x0f13('0x3a')]=qs['filters'](_['pick'](_0x57195c[_0x0f13('0x2f')],_0x3dfe41[_0x0f13('0x3b')]),_0x2592b0);if(_0x57195c[_0x0f13('0x2f')][_0x0f13('0x3c')]){_0x513eed['where']=_[_0x0f13('0x3d')](_0x513eed['where'],{'$or':_[_0x0f13('0x3e')](_0x2592b0,function(_0x7e19bd){if(_0x7e19bd[_0x0f13('0x2d')]!==_0x0f13('0x3f')){var _0x3eb593={};_0x3eb593[_0x7e19bd[_0x0f13('0x29')]]={'$like':'%'+_0x57195c[_0x0f13('0x2f')]['filter']+'%'};return _0x3eb593;}})});}_0x513eed=_['merge']({},_0x513eed,_0x57195c[_0x0f13('0x40')]);var _0x54b225={'where':_0x513eed[_0x0f13('0x3a')]};return db['DeskField'][_0x0f13('0x1e')](_0x54b225)[_0x0f13('0x26')](function(_0x1f7b0d){_0x155a00[_0x0f13('0x1e')]=_0x1f7b0d;if(_0x57195c['query'][_0x0f13('0x41')]){_0x513eed[_0x0f13('0x42')]=[{'all':!![]}];}return db['DeskField'][_0x0f13('0x43')](_0x513eed);})[_0x0f13('0x26')](function(_0x5d41d6){_0x155a00['rows']=_0x5d41d6;return _0x155a00;})[_0x0f13('0x26')](respondWithFilteredResult(_0x57b9ed,_0x513eed))[_0x0f13('0x44')](handleError(_0x57b9ed,null));};exports[_0x0f13('0x45')]=function(_0x33edc6,_0x31b5ec){var _0x4a9ecf={'raw':!![],'where':{'id':_0x33edc6[_0x0f13('0x46')]['id']}},_0x2d33da={};_0x2d33da['model']=_[_0x0f13('0x30')](db[_0x0f13('0x2b')][_0x0f13('0x2c')]);_0x2d33da[_0x0f13('0x2f')]=_[_0x0f13('0x30')](_0x33edc6['query']);_0x2d33da[_0x0f13('0x3b')]=_[_0x0f13('0x31')](_0x2d33da[_0x0f13('0x32')],_0x2d33da[_0x0f13('0x2f')]);_0x4a9ecf[_0x0f13('0x33')]=_[_0x0f13('0x31')](_0x2d33da[_0x0f13('0x32')],qs[_0x0f13('0x34')](_0x33edc6[_0x0f13('0x2f')][_0x0f13('0x34')]));_0x4a9ecf[_0x0f13('0x33')]=_0x4a9ecf['attributes'][_0x0f13('0x35')]?_0x4a9ecf[_0x0f13('0x33')]:_0x2d33da[_0x0f13('0x32')];if(_0x33edc6[_0x0f13('0x2f')]['includeAll']){_0x4a9ecf[_0x0f13('0x42')]=[{'all':!![]}];}_0x4a9ecf=_[_0x0f13('0x3d')]({},_0x4a9ecf,_0x33edc6[_0x0f13('0x40')]);return db[_0x0f13('0x2b')]['find'](_0x4a9ecf)[_0x0f13('0x26')](handleEntityNotFound(_0x31b5ec,null))[_0x0f13('0x26')](respondWithResult(_0x31b5ec,null))[_0x0f13('0x44')](handleError(_0x31b5ec,null));};exports[_0x0f13('0x47')]=function(_0x54ac44,_0x3d2199){return db[_0x0f13('0x2b')]['create'](_0x54ac44['body'],{})[_0x0f13('0x26')](respondWithResult(_0x3d2199,0xc9))[_0x0f13('0x44')](handleError(_0x3d2199,null));};exports[_0x0f13('0x25')]=function(_0x1f896d,_0x317691){if(_0x1f896d[_0x0f13('0x48')]['id']){delete _0x1f896d[_0x0f13('0x48')]['id'];}return db['DeskField'][_0x0f13('0x49')]({'where':{'id':_0x1f896d[_0x0f13('0x46')]['id']}})[_0x0f13('0x26')](handleEntityNotFound(_0x317691,null))[_0x0f13('0x26')](saveUpdates(_0x1f896d[_0x0f13('0x48')],null))['then'](respondWithResult(_0x317691,null))[_0x0f13('0x44')](handleError(_0x317691,null));};exports['destroy']=function(_0x1b07c6,_0x13d020){return db[_0x0f13('0x2b')][_0x0f13('0x49')]({'where':{'id':_0x1b07c6[_0x0f13('0x46')]['id']}})[_0x0f13('0x26')](handleEntityNotFound(_0x13d020,null))[_0x0f13('0x26')](removeEntity(_0x13d020,null))['catch'](handleError(_0x13d020,null));};
\ No newline at end of file
+var _0x1365=['../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','apply','save','update','then','destroy','error','stack','send','index','map','DeskField','fieldName','name','query','keys','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x1365,0x1a4));var _0x5136=function(_0x220f8,_0x4e159e){_0x220f8=_0x220f8-0x0;var _0x5e678e=_0x1365[_0x220f8];return _0x5e678e;};'use strict';var emlformat=require(_0x5136('0x0'));var rimraf=require(_0x5136('0x1'));var zipdir=require(_0x5136('0x2'));var jsonpatch=require(_0x5136('0x3'));var rp=require(_0x5136('0x4'));var moment=require(_0x5136('0x5'));var BPromise=require(_0x5136('0x6'));var Mustache=require(_0x5136('0x7'));var util=require(_0x5136('0x8'));var path=require(_0x5136('0x9'));var sox=require('sox');var csv=require(_0x5136('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5136('0xb'));var squel=require('squel');var crypto=require(_0x5136('0xc'));var jsforce=require(_0x5136('0xd'));var deskjs=require(_0x5136('0xe'));var toCsv=require(_0x5136('0xa'));var querystring=require(_0x5136('0xf'));var Papa=require(_0x5136('0x10'));var Redis=require('ioredis');var authService=require(_0x5136('0x11'));var qs=require(_0x5136('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5136('0x13'));var logger=require('../../config/logger')(_0x5136('0x14'));var utils=require(_0x5136('0x15'));var config=require(_0x5136('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5136('0x17'))['db'];function respondWithStatusCode(_0x44e4b7,_0x1cdd4a){_0x1cdd4a=_0x1cdd4a||0xcc;return function(_0x25e2bb){if(_0x25e2bb){return _0x44e4b7[_0x5136('0x18')](_0x1cdd4a);}return _0x44e4b7[_0x5136('0x19')](_0x1cdd4a)[_0x5136('0x1a')]();};}function respondWithResult(_0x263978,_0x48350d){_0x48350d=_0x48350d||0xc8;return function(_0x59fe56){if(_0x59fe56){return _0x263978['status'](_0x48350d)['json'](_0x59fe56);}};}function respondWithFilteredResult(_0x462844,_0x519e66){return function(_0x49e37e){if(_0x49e37e){var _0x577772=typeof _0x519e66[_0x5136('0x1b')]===_0x5136('0x1c')&&typeof _0x519e66[_0x5136('0x1d')]===_0x5136('0x1c');var _0x1f0e19=_0x49e37e[_0x5136('0x1e')];var _0x2f509d=_0x577772?0x0:_0x519e66['offset'];var _0x18b3c7=_0x577772?_0x49e37e['count']:_0x519e66[_0x5136('0x1b')]+_0x519e66[_0x5136('0x1d')];var _0x56b054;if(_0x18b3c7>=_0x1f0e19){_0x18b3c7=_0x1f0e19;_0x56b054=0xc8;}else{_0x56b054=0xce;}_0x462844[_0x5136('0x19')](_0x56b054);return _0x462844['set']('Content-Range',_0x2f509d+'-'+_0x18b3c7+'/'+_0x1f0e19)['json'](_0x49e37e);}return null;};}function patchUpdates(_0x76a12e){return function(_0x5b701f){try{jsonpatch[_0x5136('0x1f')](_0x5b701f,_0x76a12e,!![]);}catch(_0x5cfd2e){return BPromise['reject'](_0x5cfd2e);}return _0x5b701f[_0x5136('0x20')]();};}function saveUpdates(_0x264c85,_0x4f0168){return function(_0x5af5a1){if(_0x5af5a1){return _0x5af5a1[_0x5136('0x21')](_0x264c85)[_0x5136('0x22')](function(_0x5abdd8){return _0x5abdd8;});}return null;};}function removeEntity(_0x1a3f4e,_0x30b656){return function(_0xab029c){if(_0xab029c){return _0xab029c[_0x5136('0x23')]()[_0x5136('0x22')](function(){_0x1a3f4e[_0x5136('0x19')](0xcc)[_0x5136('0x1a')]();});}};}function handleEntityNotFound(_0x5d0e9e,_0x404c94){return function(_0x57e76e){if(!_0x57e76e){_0x5d0e9e[_0x5136('0x18')](0x194);}return _0x57e76e;};}function handleError(_0x5187a0,_0x10d5bf){_0x10d5bf=_0x10d5bf||0x1f4;return function(_0x3f39e4){logger[_0x5136('0x24')](_0x3f39e4[_0x5136('0x25')]);if(_0x3f39e4['name']){delete _0x3f39e4['name'];}_0x5187a0[_0x5136('0x19')](_0x10d5bf)[_0x5136('0x26')](_0x3f39e4);};}exports[_0x5136('0x27')]=function(_0x221693,_0x15a8de){var _0x3e59ca={},_0x3a4f94={},_0x1a1ec4={'count':0x0,'rows':[]};var _0x1bc724=_[_0x5136('0x28')](db[_0x5136('0x29')]['rawAttributes'],function(_0x4e699d){return{'name':_0x4e699d[_0x5136('0x2a')],'type':_0x4e699d['type']['key']};});_0x3a4f94['model']=_[_0x5136('0x28')](_0x1bc724,_0x5136('0x2b'));_0x3a4f94[_0x5136('0x2c')]=_[_0x5136('0x2d')](_0x221693[_0x5136('0x2c')]);_0x3a4f94['filters']=_['intersection'](_0x3a4f94['model'],_0x3a4f94[_0x5136('0x2c')]);_0x3e59ca['attributes']=_['intersection'](_0x3a4f94['model'],qs[_0x5136('0x2e')](_0x221693['query']['fields']));_0x3e59ca[_0x5136('0x2f')]=_0x3e59ca[_0x5136('0x2f')][_0x5136('0x30')]?_0x3e59ca['attributes']:_0x3a4f94[_0x5136('0x31')];if(!_0x221693[_0x5136('0x2c')][_0x5136('0x32')](_0x5136('0x33'))){_0x3e59ca['limit']=qs[_0x5136('0x1d')](_0x221693[_0x5136('0x2c')][_0x5136('0x1d')]);_0x3e59ca[_0x5136('0x1b')]=qs['offset'](_0x221693[_0x5136('0x2c')][_0x5136('0x1b')]);}_0x3e59ca[_0x5136('0x34')]=qs[_0x5136('0x35')](_0x221693[_0x5136('0x2c')][_0x5136('0x35')]);_0x3e59ca[_0x5136('0x36')]=qs['filters'](_[_0x5136('0x37')](_0x221693['query'],_0x3a4f94[_0x5136('0x38')]),_0x1bc724);if(_0x221693[_0x5136('0x2c')][_0x5136('0x39')]){_0x3e59ca['where']=_[_0x5136('0x3a')](_0x3e59ca[_0x5136('0x36')],{'$or':_[_0x5136('0x28')](_0x1bc724,function(_0x49b10e){if(_0x49b10e[_0x5136('0x3b')]!==_0x5136('0x3c')){var _0x21656b={};_0x21656b[_0x49b10e[_0x5136('0x2b')]]={'$like':'%'+_0x221693[_0x5136('0x2c')][_0x5136('0x39')]+'%'};return _0x21656b;}})});}_0x3e59ca=_[_0x5136('0x3a')]({},_0x3e59ca,_0x221693[_0x5136('0x3d')]);var _0x1f1eb8={'where':_0x3e59ca[_0x5136('0x36')]};return db[_0x5136('0x29')]['count'](_0x1f1eb8)[_0x5136('0x22')](function(_0xf06fb){_0x1a1ec4['count']=_0xf06fb;if(_0x221693[_0x5136('0x2c')][_0x5136('0x3e')]){_0x3e59ca['include']=[{'all':!![]}];}return db[_0x5136('0x29')][_0x5136('0x3f')](_0x3e59ca);})[_0x5136('0x22')](function(_0x23a9fb){_0x1a1ec4[_0x5136('0x40')]=_0x23a9fb;return _0x1a1ec4;})[_0x5136('0x22')](respondWithFilteredResult(_0x15a8de,_0x3e59ca))[_0x5136('0x41')](handleError(_0x15a8de,null));};exports[_0x5136('0x42')]=function(_0x2ab73b,_0x3bcf25){var _0x2bd409={'raw':!![],'where':{'id':_0x2ab73b[_0x5136('0x43')]['id']}},_0x31359b={};_0x31359b['model']=_['keys'](db['DeskField'][_0x5136('0x44')]);_0x31359b['query']=_[_0x5136('0x2d')](_0x2ab73b['query']);_0x31359b[_0x5136('0x38')]=_['intersection'](_0x31359b[_0x5136('0x31')],_0x31359b[_0x5136('0x2c')]);_0x2bd409[_0x5136('0x2f')]=_[_0x5136('0x45')](_0x31359b[_0x5136('0x31')],qs[_0x5136('0x2e')](_0x2ab73b['query'][_0x5136('0x2e')]));_0x2bd409[_0x5136('0x2f')]=_0x2bd409[_0x5136('0x2f')]['length']?_0x2bd409[_0x5136('0x2f')]:_0x31359b[_0x5136('0x31')];if(_0x2ab73b[_0x5136('0x2c')]['includeAll']){_0x2bd409['include']=[{'all':!![]}];}_0x2bd409=_['merge']({},_0x2bd409,_0x2ab73b[_0x5136('0x3d')]);return db[_0x5136('0x29')][_0x5136('0x46')](_0x2bd409)[_0x5136('0x22')](handleEntityNotFound(_0x3bcf25,null))[_0x5136('0x22')](respondWithResult(_0x3bcf25,null))[_0x5136('0x41')](handleError(_0x3bcf25,null));};exports[_0x5136('0x47')]=function(_0x402333,_0x4e235a){return db[_0x5136('0x29')][_0x5136('0x47')](_0x402333[_0x5136('0x48')],{})['then'](respondWithResult(_0x4e235a,0xc9))['catch'](handleError(_0x4e235a,null));};exports[_0x5136('0x21')]=function(_0x3b4bc0,_0x3fd844){if(_0x3b4bc0['body']['id']){delete _0x3b4bc0[_0x5136('0x48')]['id'];}return db[_0x5136('0x29')]['find']({'where':{'id':_0x3b4bc0[_0x5136('0x43')]['id']}})[_0x5136('0x22')](handleEntityNotFound(_0x3fd844,null))[_0x5136('0x22')](saveUpdates(_0x3b4bc0['body'],null))[_0x5136('0x22')](respondWithResult(_0x3fd844,null))[_0x5136('0x41')](handleError(_0x3fd844,null));};exports[_0x5136('0x23')]=function(_0x5a5bdb,_0x141bdf){return db[_0x5136('0x29')]['find']({'where':{'id':_0x5a5bdb['params']['id']}})[_0x5136('0x22')](handleEntityNotFound(_0x141bdf,null))[_0x5136('0x22')](removeEntity(_0x141bdf,null))['catch'](handleError(_0x141bdf,null));};
\ No newline at end of file
index f763b2b..27c5ac0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffb2=['desk_unique_index','idField','lodash','api','moment','path','rimraf','../../config/environment','./intDeskField.attributes','DeskField','int_desk_fields'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xffb2,0x120));var _0x2ffb=function(_0x2eb3db,_0x4a32c0){_0x2eb3db=_0x2eb3db-0x0;var _0x358f33=_0xffb2[_0x2eb3db];return _0x358f33;};'use strict';var _=require(_0x2ffb('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2ffb('0x1'));var moment=require(_0x2ffb('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2ffb('0x3'));var rimraf=require(_0x2ffb('0x4'));var config=require(_0x2ffb('0x5'));var attributes=require(_0x2ffb('0x6'));module['exports']=function(_0x810608,_0x1037bf){return _0x810608['define'](_0x2ffb('0x7'),attributes,{'tableName':_0x2ffb('0x8'),'paranoid':![],'indexes':[{'name':_0x2ffb('0x9'),'fields':[_0x2ffb('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe5e9=['idField','FieldId','lodash','moment','request-promise','path','rimraf','./intDeskField.attributes','exports','DeskField','int_desk_fields','desk_unique_index'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe5e9,0x15e));var _0x9e5e=function(_0x5da048,_0xca5c85){_0x5da048=_0x5da048-0x0;var _0x13dfc5=_0xe5e9[_0x5da048];return _0x13dfc5;};'use strict';var _=require(_0x9e5e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x9e5e('0x1'));var BPromise=require('bluebird');var rp=require(_0x9e5e('0x2'));var fs=require('fs');var path=require(_0x9e5e('0x3'));var rimraf=require(_0x9e5e('0x4'));var config=require('../../config/environment');var attributes=require(_0x9e5e('0x5'));module[_0x9e5e('0x6')]=function(_0x108168,_0x19b325){return _0x108168['define'](_0x9e5e('0x7'),attributes,{'tableName':_0x9e5e('0x8'),'paranoid':![],'indexes':[{'name':_0x9e5e('0x9'),'fields':[_0x9e5e('0xa'),_0x9e5e('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 379882a..4709441 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2fc=['result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x5cf52f,_0x2304cc){var _0x5b4b76=function(_0x3c408b){while(--_0x3c408b){_0x5cf52f['push'](_0x5cf52f['shift']());}};_0x5b4b76(++_0x2304cc);}(_0xf2fc,0x1b6));var _0xcf2f=function(_0x2215c7,_0x32f45a){_0x2215c7=_0x2215c7-0x0;var _0x58b1e1=_0xf2fc[_0x2215c7];return _0x58b1e1;};'use strict';var _=require(_0xcf2f('0x0'));var util=require(_0xcf2f('0x1'));var moment=require(_0xcf2f('0x2'));var BPromise=require('bluebird');var rs=require(_0xcf2f('0x3'));var fs=require('fs');var Redis=require(_0xcf2f('0x4'));var db=require(_0xcf2f('0x5'))['db'];var utils=require(_0xcf2f('0x6'));var logger=require('../../config/logger')(_0xcf2f('0x7'));var config=require(_0xcf2f('0x8'));var jayson=require(_0xcf2f('0x9'));var client=jayson[_0xcf2f('0xa')][_0xcf2f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3689a0,_0x222703,_0x458465){return new BPromise(function(_0x30a0bd,_0x58a237){return client[_0xcf2f('0xc')](_0x3689a0,_0x458465)[_0xcf2f('0xd')](function(_0x5a8ce0){logger[_0xcf2f('0xe')](_0xcf2f('0xf'),_0x222703,_0xcf2f('0x10'));logger[_0xcf2f('0x11')]('DeskField,\x20%s,\x20%s,\x20%s',_0x222703,_0xcf2f('0x10'),JSON[_0xcf2f('0x12')](_0x5a8ce0));if(_0x5a8ce0[_0xcf2f('0x13')]){if(_0x5a8ce0[_0xcf2f('0x13')][_0xcf2f('0x14')]===0x1f4){logger[_0xcf2f('0x13')](_0xcf2f('0xf'),_0x222703,_0x5a8ce0['error']['message']);return _0x58a237(_0x5a8ce0['error'][_0xcf2f('0x15')]);}logger[_0xcf2f('0x13')](_0xcf2f('0xf'),_0x222703,_0x5a8ce0[_0xcf2f('0x13')][_0xcf2f('0x15')]);return _0x30a0bd(_0x5a8ce0[_0xcf2f('0x13')][_0xcf2f('0x15')]);}else{logger[_0xcf2f('0xe')](_0xcf2f('0xf'),_0x222703,'request\x20sent');_0x30a0bd(_0x5a8ce0[_0xcf2f('0x16')]['message']);}})['catch'](function(_0x45f4ea){logger[_0xcf2f('0x13')](_0xcf2f('0xf'),_0x222703,_0x45f4ea);_0x58a237(_0x45f4ea);});});}
\ No newline at end of file
+var _0xfb04=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfb04,0x6c));var _0x4fb0=function(_0x5eadd8,_0x4e58f2){_0x5eadd8=_0x5eadd8-0x0;var _0x73b164=_0xfb04[_0x5eadd8];return _0x73b164;};'use strict';var _=require('lodash');var util=require(_0x4fb0('0x0'));var moment=require(_0x4fb0('0x1'));var BPromise=require('bluebird');var rs=require(_0x4fb0('0x2'));var fs=require('fs');var Redis=require(_0x4fb0('0x3'));var db=require(_0x4fb0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4fb0('0x5'))(_0x4fb0('0x6'));var config=require(_0x4fb0('0x7'));var jayson=require(_0x4fb0('0x8'));var client=jayson['client'][_0x4fb0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x570173,_0x320ded,_0x4ca99c){return new BPromise(function(_0x1a4aba,_0x56a888){return client['request'](_0x570173,_0x4ca99c)[_0x4fb0('0xa')](function(_0x16a3bb){logger[_0x4fb0('0xb')](_0x4fb0('0xc'),_0x320ded,_0x4fb0('0xd'));logger[_0x4fb0('0xe')](_0x4fb0('0xf'),_0x320ded,_0x4fb0('0xd'),JSON[_0x4fb0('0x10')](_0x16a3bb));if(_0x16a3bb['error']){if(_0x16a3bb[_0x4fb0('0x11')][_0x4fb0('0x12')]===0x1f4){logger[_0x4fb0('0x11')](_0x4fb0('0xc'),_0x320ded,_0x16a3bb[_0x4fb0('0x11')][_0x4fb0('0x13')]);return _0x56a888(_0x16a3bb[_0x4fb0('0x11')][_0x4fb0('0x13')]);}logger[_0x4fb0('0x11')](_0x4fb0('0xc'),_0x320ded,_0x16a3bb['error'][_0x4fb0('0x13')]);return _0x1a4aba(_0x16a3bb[_0x4fb0('0x11')][_0x4fb0('0x13')]);}else{logger['info'](_0x4fb0('0xc'),_0x320ded,_0x4fb0('0xd'));_0x1a4aba(_0x16a3bb[_0x4fb0('0x14')]['message']);}})[_0x4fb0('0x15')](function(_0x107206){logger[_0x4fb0('0x11')](_0x4fb0('0xc'),_0x320ded,_0x107206);_0x56a888(_0x107206);});});}
\ No newline at end of file
index d1c4d26..70fcd49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf246=['path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','isAuthenticated','index','get','/:id','show','getConfigurations','/:id/fields','post','/:id/configurations','addConfiguration','put','update','destroy','exports','multer'];(function(_0x1c5a1,_0x30f792){var _0x11a7c3=function(_0x95da12){while(--_0x95da12){_0x1c5a1['push'](_0x1c5a1['shift']());}};_0x11a7c3(++_0x30f792);}(_0xf246,0x107));var _0x6f24=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf246[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x6f24('0x0'));var util=require('util');var path=require(_0x6f24('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6f24('0x2')]();var fs_extra=require(_0x6f24('0x3'));var auth=require(_0x6f24('0x4'));var interaction=require(_0x6f24('0x5'));var config=require(_0x6f24('0x6'));var controller=require(_0x6f24('0x7'));router['get']('/',auth[_0x6f24('0x8')](),controller[_0x6f24('0x9')]);router[_0x6f24('0xa')](_0x6f24('0xb'),auth['isAuthenticated'](),controller[_0x6f24('0xc')]);router[_0x6f24('0xa')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x6f24('0xd')]);router[_0x6f24('0xa')](_0x6f24('0xe'),auth[_0x6f24('0x8')](),controller['getFields']);router[_0x6f24('0xf')]('/',auth[_0x6f24('0x8')](),controller['create']);router[_0x6f24('0xf')](_0x6f24('0x10'),auth[_0x6f24('0x8')](),controller[_0x6f24('0x11')]);router[_0x6f24('0x12')]('/:id',auth[_0x6f24('0x8')](),controller[_0x6f24('0x13')]);router['delete'](_0x6f24('0xb'),auth[_0x6f24('0x8')](),controller[_0x6f24('0x14')]);module[_0x6f24('0x15')]=router;
\ No newline at end of file
+var _0xc82a=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','multer','util'];(function(_0x43c29d,_0x2bb419){var _0x567a24=function(_0xa26ba6){while(--_0xa26ba6){_0x43c29d['push'](_0x43c29d['shift']());}};_0x567a24(++_0x2bb419);}(_0xc82a,0xdf));var _0xac82=function(_0x41ecb2,_0x306e02){_0x41ecb2=_0x41ecb2-0x0;var _0x1137d9=_0xc82a[_0x41ecb2];return _0x1137d9;};'use strict';var multer=require(_0xac82('0x0'));var util=require(_0xac82('0x1'));var path=require(_0xac82('0x2'));var timeout=require(_0xac82('0x3'));var express=require(_0xac82('0x4'));var router=express[_0xac82('0x5')]();var fs_extra=require(_0xac82('0x6'));var auth=require(_0xac82('0x7'));var interaction=require(_0xac82('0x8'));var config=require(_0xac82('0x9'));var controller=require(_0xac82('0xa'));router[_0xac82('0xb')]('/',auth[_0xac82('0xc')](),controller[_0xac82('0xd')]);router['get'](_0xac82('0xe'),auth[_0xac82('0xc')](),controller['show']);router[_0xac82('0xb')](_0xac82('0xf'),auth[_0xac82('0xc')](),controller[_0xac82('0x10')]);router['get'](_0xac82('0x11'),auth[_0xac82('0xc')](),controller[_0xac82('0x12')]);router[_0xac82('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xac82('0x13')](_0xac82('0xf'),auth[_0xac82('0xc')](),controller[_0xac82('0x14')]);router[_0xac82('0x15')](_0xac82('0xe'),auth[_0xac82('0xc')](),controller[_0xac82('0x16')]);router[_0xac82('0x17')](_0xac82('0xe'),auth['isAuthenticated'](),controller[_0xac82('0x18')]);module['exports']=router;
\ No newline at end of file
index 8e86e09..e991841 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf90=['sequelize','exports','STRING'];(function(_0x58c20f,_0x4cdb1b){var _0x3b0318=function(_0x36fa84){while(--_0x36fa84){_0x58c20f['push'](_0x58c20f['shift']());}};_0x3b0318(++_0x4cdb1b);}(_0xaf90,0x93));var _0x0af9=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xaf90[_0x9df060];return _0x338dfe;};'use strict';var Sequelize=require(_0x0af9('0x0'));module[_0x0af9('0x1')]={'name':{'type':Sequelize[_0x0af9('0x2')]},'username':{'type':Sequelize[_0x0af9('0x2')]},'password':{'type':Sequelize[_0x0af9('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x0af9('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xfdca=['exports','STRING','sequelize'];(function(_0xccc718,_0x11c2a2){var _0x44fdb4=function(_0x16de6f){while(--_0x16de6f){_0xccc718['push'](_0xccc718['shift']());}};_0x44fdb4(++_0x11c2a2);}(_0xfdca,0x152));var _0xafdc=function(_0x4444e4,_0x381c05){_0x4444e4=_0x4444e4-0x0;var _0xf81a45=_0xfdca[_0x4444e4];return _0xf81a45;};'use strict';var Sequelize=require(_0xafdc('0x0'));module[_0xafdc('0x1')]={'name':{'type':Sequelize[_0xafdc('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xafdc('0x2')]},'remoteUri':{'type':Sequelize[_0xafdc('0x2')]},'tenantId':{'type':Sequelize[_0xafdc('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xafdc('0x2')]},'serverUrl':{'type':Sequelize[_0xafdc('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xafdc('0x2')]}};
\ No newline at end of file
index 508c900..2a29034 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb790=[')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','includes','LogicalName','forEach','@odata.type','substring','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','rimraf','moment','util','path','to-csv','ejs','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','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','update','then','error','stack','name','send','index','Dynamics365Account','rawAttributes','type','model','map','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','keys','options','catch','create','body','find','params','findOne','Dynamics365Configuration','order','AccountId','Subjects','getSubjects','channel','Descriptions','Dynamics365Field','getFields','PhoneCall','title','customerid','ownerid','caseorigincode','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','socialprofileidname','statecode','statuscode','subjectidname','transactioncurrencyidname','versionnumber','concat','username','password','clientId','slice','lastIndexOf','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','clientSecret','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','MetadataId'];(function(_0x3c1328,_0x237895){var _0x3a0544=function(_0x5bf43c){while(--_0x5bf43c){_0x3c1328['push'](_0x3c1328['shift']());}};_0x3a0544(++_0x237895);}(_0xb790,0xe5));var _0x0b79=function(_0x475bf1,_0x5235b6){_0x475bf1=_0x475bf1-0x0;var _0x4095d1=_0xb790[_0x475bf1];return _0x4095d1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0b79('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0b79('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0b79('0x2'));var path=require(_0x0b79('0x3'));var sox=require('sox');var csv=require(_0x0b79('0x4'));var ejs=require(_0x0b79('0x5'));var fs=require('fs');var fs_extra=require(_0x0b79('0x6'));var _=require(_0x0b79('0x7'));var squel=require(_0x0b79('0x8'));var crypto=require(_0x0b79('0x9'));var jsforce=require(_0x0b79('0xa'));var deskjs=require(_0x0b79('0xb'));var toCsv=require(_0x0b79('0x4'));var querystring=require(_0x0b79('0xc'));var Papa=require(_0x0b79('0xd'));var Redis=require(_0x0b79('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0b79('0xf'));var hardwareService=require(_0x0b79('0x10'));var logger=require(_0x0b79('0x11'))(_0x0b79('0x12'));var utils=require(_0x0b79('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0b79('0x14'));var db=require(_0x0b79('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x44c94c,_0x1c0a61){_0x1c0a61=_0x1c0a61||0xcc;return function(_0x439e12){if(_0x439e12){return _0x44c94c[_0x0b79('0x16')](_0x1c0a61);}return _0x44c94c['status'](_0x1c0a61)[_0x0b79('0x17')]();};}function respondWithResult(_0x4681e4,_0x162522){_0x162522=_0x162522||0xc8;return function(_0x39551a){if(_0x39551a){return _0x4681e4['status'](_0x162522)[_0x0b79('0x18')](_0x39551a);}};}function respondWithFilteredResult(_0x44f4f7,_0x5bf09b){return function(_0x1820fa){if(_0x1820fa){var _0x23d5c3=typeof _0x5bf09b[_0x0b79('0x19')]===_0x0b79('0x1a')&&typeof _0x5bf09b[_0x0b79('0x1b')]===_0x0b79('0x1a');var _0x4f4754=_0x1820fa[_0x0b79('0x1c')];var _0x55bc36=_0x23d5c3?0x0:_0x5bf09b['offset'];var _0x4e7614=_0x23d5c3?_0x1820fa[_0x0b79('0x1c')]:_0x5bf09b[_0x0b79('0x19')]+_0x5bf09b[_0x0b79('0x1b')];var _0x5579dd;if(_0x4e7614>=_0x4f4754){_0x4e7614=_0x4f4754;_0x5579dd=0xc8;}else{_0x5579dd=0xce;}_0x44f4f7[_0x0b79('0x1d')](_0x5579dd);return _0x44f4f7['set'](_0x0b79('0x1e'),_0x55bc36+'-'+_0x4e7614+'/'+_0x4f4754)[_0x0b79('0x18')](_0x1820fa);}return null;};}function patchUpdates(_0x8482ad){return function(_0x5b630c){try{jsonpatch[_0x0b79('0x1f')](_0x5b630c,_0x8482ad,!![]);}catch(_0x330027){return BPromise[_0x0b79('0x20')](_0x330027);}return _0x5b630c['save']();};}function saveUpdates(_0xa836a8,_0x58901a){return function(_0x5bd229){if(_0x5bd229){return _0x5bd229[_0x0b79('0x21')](_0xa836a8)['then'](function(_0x80fbe9){return _0x80fbe9;});}return null;};}function removeEntity(_0x235a7f,_0x3a04d3){return function(_0x136734){if(_0x136734){return _0x136734['destroy']()[_0x0b79('0x22')](function(){_0x235a7f[_0x0b79('0x1d')](0xcc)[_0x0b79('0x17')]();});}};}function handleEntityNotFound(_0x553ed1,_0x143ca2){return function(_0x316866){if(!_0x316866){_0x553ed1[_0x0b79('0x16')](0x194);}return _0x316866;};}function handleError(_0x4a2f93,_0x39b034){_0x39b034=_0x39b034||0x1f4;return function(_0x18a2ea){logger[_0x0b79('0x23')](_0x18a2ea[_0x0b79('0x24')]);if(_0x18a2ea[_0x0b79('0x25')]){delete _0x18a2ea['name'];}_0x4a2f93[_0x0b79('0x1d')](_0x39b034)[_0x0b79('0x26')](_0x18a2ea);};}exports[_0x0b79('0x27')]=function(_0x365ea4,_0x48756d){var _0x47cdf2={},_0x10f10c={},_0x5595fd={'count':0x0,'rows':[]};var _0x2f0639=_['map'](db[_0x0b79('0x28')][_0x0b79('0x29')],function(_0x19971a){return{'name':_0x19971a['fieldName'],'type':_0x19971a[_0x0b79('0x2a')]['key']};});_0x10f10c[_0x0b79('0x2b')]=_[_0x0b79('0x2c')](_0x2f0639,_0x0b79('0x25'));_0x10f10c['query']=_['keys'](_0x365ea4[_0x0b79('0x2d')]);_0x10f10c[_0x0b79('0x2e')]=_[_0x0b79('0x2f')](_0x10f10c[_0x0b79('0x2b')],_0x10f10c[_0x0b79('0x2d')]);_0x47cdf2[_0x0b79('0x30')]=_[_0x0b79('0x2f')](_0x10f10c[_0x0b79('0x2b')],qs[_0x0b79('0x31')](_0x365ea4[_0x0b79('0x2d')][_0x0b79('0x31')]));_0x47cdf2[_0x0b79('0x30')]=_0x47cdf2[_0x0b79('0x30')][_0x0b79('0x32')]?_0x47cdf2[_0x0b79('0x30')]:_0x10f10c[_0x0b79('0x2b')];if(!_0x365ea4['query']['hasOwnProperty'](_0x0b79('0x33'))){_0x47cdf2[_0x0b79('0x1b')]=qs[_0x0b79('0x1b')](_0x365ea4[_0x0b79('0x2d')][_0x0b79('0x1b')]);_0x47cdf2[_0x0b79('0x19')]=qs[_0x0b79('0x19')](_0x365ea4[_0x0b79('0x2d')][_0x0b79('0x19')]);}_0x47cdf2['order']=qs[_0x0b79('0x34')](_0x365ea4[_0x0b79('0x2d')]['sort']);_0x47cdf2[_0x0b79('0x35')]=qs[_0x0b79('0x2e')](_[_0x0b79('0x36')](_0x365ea4[_0x0b79('0x2d')],_0x10f10c[_0x0b79('0x2e')]),_0x2f0639);if(_0x365ea4[_0x0b79('0x2d')]['filter']){_0x47cdf2[_0x0b79('0x35')]=_[_0x0b79('0x37')](_0x47cdf2[_0x0b79('0x35')],{'$or':_[_0x0b79('0x2c')](_0x2f0639,function(_0x221ce3){if(_0x221ce3['type']!==_0x0b79('0x38')){var _0x5b8d0b={};_0x5b8d0b[_0x221ce3[_0x0b79('0x25')]]={'$like':'%'+_0x365ea4[_0x0b79('0x2d')][_0x0b79('0x39')]+'%'};return _0x5b8d0b;}})});}_0x47cdf2=_['merge']({},_0x47cdf2,_0x365ea4['options']);var _0x564884={'where':_0x47cdf2[_0x0b79('0x35')]};return db['Dynamics365Account'][_0x0b79('0x1c')](_0x564884)[_0x0b79('0x22')](function(_0x293a33){_0x5595fd[_0x0b79('0x1c')]=_0x293a33;if(_0x365ea4[_0x0b79('0x2d')][_0x0b79('0x3a')]){_0x47cdf2[_0x0b79('0x3b')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x0b79('0x3c')](_0x47cdf2);})[_0x0b79('0x22')](function(_0x6f2200){_0x5595fd[_0x0b79('0x3d')]=_0x6f2200;return _0x5595fd;})[_0x0b79('0x22')](respondWithFilteredResult(_0x48756d,_0x47cdf2))['catch'](handleError(_0x48756d,null));};exports[_0x0b79('0x3e')]=function(_0x2b9f9f,_0x47f9e8){var _0x1a8e38={'raw':![],'where':{'id':_0x2b9f9f['params']['id']}},_0xb74c93={};_0xb74c93['model']=_[_0x0b79('0x3f')](db[_0x0b79('0x28')][_0x0b79('0x29')]);_0xb74c93[_0x0b79('0x2d')]=_['keys'](_0x2b9f9f[_0x0b79('0x2d')]);_0xb74c93[_0x0b79('0x2e')]=_[_0x0b79('0x2f')](_0xb74c93['model'],_0xb74c93[_0x0b79('0x2d')]);_0x1a8e38[_0x0b79('0x30')]=_[_0x0b79('0x2f')](_0xb74c93[_0x0b79('0x2b')],qs[_0x0b79('0x31')](_0x2b9f9f[_0x0b79('0x2d')][_0x0b79('0x31')]));_0x1a8e38[_0x0b79('0x30')]=_0x1a8e38[_0x0b79('0x30')][_0x0b79('0x32')]?_0x1a8e38[_0x0b79('0x30')]:_0xb74c93['model'];if(_0x2b9f9f['query'][_0x0b79('0x3a')]){_0x1a8e38[_0x0b79('0x3b')]=[{'all':!![]}];}_0x1a8e38=_[_0x0b79('0x37')]({},_0x1a8e38,_0x2b9f9f[_0x0b79('0x40')]);return db[_0x0b79('0x28')]['find'](_0x1a8e38)[_0x0b79('0x22')](handleEntityNotFound(_0x47f9e8,null))['then'](respondWithResult(_0x47f9e8,null))[_0x0b79('0x41')](handleError(_0x47f9e8,null));};exports[_0x0b79('0x42')]=function(_0x358bce,_0x25f719){return db[_0x0b79('0x28')][_0x0b79('0x42')](_0x358bce[_0x0b79('0x43')],{})[_0x0b79('0x22')](respondWithResult(_0x25f719,0xc9))[_0x0b79('0x41')](handleError(_0x25f719,null));};exports[_0x0b79('0x21')]=function(_0x362aa4,_0x21dc25){if(_0x362aa4[_0x0b79('0x43')]['id']){delete _0x362aa4[_0x0b79('0x43')]['id'];}return db[_0x0b79('0x28')][_0x0b79('0x44')]({'where':{'id':_0x362aa4['params']['id']}})[_0x0b79('0x22')](handleEntityNotFound(_0x21dc25,null))['then'](saveUpdates(_0x362aa4[_0x0b79('0x43')],null))[_0x0b79('0x22')](respondWithResult(_0x21dc25,null))[_0x0b79('0x41')](handleError(_0x21dc25,null));};exports['destroy']=function(_0x4172b9,_0x1862c4){return db[_0x0b79('0x28')][_0x0b79('0x44')]({'where':{'id':_0x4172b9[_0x0b79('0x45')]['id']}})[_0x0b79('0x22')](handleEntityNotFound(_0x1862c4,null))[_0x0b79('0x22')](removeEntity(_0x1862c4,null))[_0x0b79('0x41')](handleError(_0x1862c4,null));};exports['getConfigurations']=function(_0x1a6f6a,_0x472051,_0x17d0db){var _0x278d42={};var _0x7b9f57={};var _0x46eb9e;var _0x2309be;return db[_0x0b79('0x28')][_0x0b79('0x46')]({'where':{'id':_0x1a6f6a['params']['id']}})[_0x0b79('0x22')](handleEntityNotFound(_0x472051,null))['then'](function(_0x1616fa){if(_0x1616fa){_0x46eb9e=_0x1616fa;_0x7b9f57[_0x0b79('0x2b')]=_['keys'](db[_0x0b79('0x47')][_0x0b79('0x29')]);_0x7b9f57[_0x0b79('0x2d')]=_[_0x0b79('0x3f')](_0x1a6f6a[_0x0b79('0x2d')]);_0x7b9f57[_0x0b79('0x2e')]=_['intersection'](_0x7b9f57['model'],_0x7b9f57[_0x0b79('0x2d')]);_0x278d42[_0x0b79('0x30')]=_[_0x0b79('0x2f')](_0x7b9f57[_0x0b79('0x2b')],qs[_0x0b79('0x31')](_0x1a6f6a[_0x0b79('0x2d')][_0x0b79('0x31')]));_0x278d42[_0x0b79('0x30')]=_0x278d42[_0x0b79('0x30')][_0x0b79('0x32')]?_0x278d42['attributes']:_0x7b9f57[_0x0b79('0x2b')];_0x278d42[_0x0b79('0x48')]=qs[_0x0b79('0x34')](_0x1a6f6a[_0x0b79('0x2d')]['sort']);_0x278d42[_0x0b79('0x35')]=qs[_0x0b79('0x2e')](_[_0x0b79('0x36')](_0x1a6f6a[_0x0b79('0x2d')],_0x7b9f57[_0x0b79('0x2e')]));if(_0x1a6f6a[_0x0b79('0x2d')][_0x0b79('0x39')]){_0x278d42[_0x0b79('0x35')]=_[_0x0b79('0x37')](_0x278d42[_0x0b79('0x35')],{'$or':_[_0x0b79('0x2c')](_0x278d42[_0x0b79('0x30')],function(_0x2abb67){var _0x4416af={};_0x4416af[_0x2abb67]={'$like':'%'+_0x1a6f6a[_0x0b79('0x2d')][_0x0b79('0x39')]+'%'};return _0x4416af;})});}_0x278d42=_['merge']({},_0x278d42,_0x1a6f6a['options']);return _0x46eb9e['getConfigurations'](_0x278d42);}})[_0x0b79('0x22')](function(_0xdf3b19){if(_0xdf3b19){_0x2309be=_0xdf3b19['length'];if(!_0x1a6f6a[_0x0b79('0x2d')]['hasOwnProperty']('nolimit')){_0x278d42[_0x0b79('0x1b')]=qs['limit'](_0x1a6f6a[_0x0b79('0x2d')][_0x0b79('0x1b')]);_0x278d42[_0x0b79('0x19')]=qs[_0x0b79('0x19')](_0x1a6f6a[_0x0b79('0x2d')][_0x0b79('0x19')]);}return _0x46eb9e['getConfigurations'](_0x278d42);}})['then'](function(_0x32aee1){if(_0x32aee1){return _0x32aee1?{'count':_0x2309be,'rows':_0x32aee1}:null;}})[_0x0b79('0x22')](respondWithResult(_0x472051,null))['catch'](handleError(_0x472051,null));};exports['addConfiguration']=function(_0x52acb9,_0x92fa34,_0x4922b1){if(_0x52acb9[_0x0b79('0x43')]['id']){delete _0x52acb9[_0x0b79('0x43')]['id'];}return db[_0x0b79('0x28')][_0x0b79('0x46')]({'where':{'id':_0x52acb9[_0x0b79('0x45')]['id']}})[_0x0b79('0x22')](handleEntityNotFound(_0x92fa34,null))[_0x0b79('0x22')](function(_0x8ecdc9){if(_0x8ecdc9){_0x52acb9['body'][_0x0b79('0x49')]=_0x8ecdc9['id'];_0x52acb9[_0x0b79('0x43')][_0x0b79('0x4a')]=integrations[_0x0b79('0x4b')](_0x52acb9[_0x0b79('0x43')][_0x0b79('0x4c')],_0x52acb9['body']['type']);_0x52acb9[_0x0b79('0x43')][_0x0b79('0x4d')]=integrations['getDescriptions'](_0x52acb9[_0x0b79('0x43')][_0x0b79('0x4c')],_0x52acb9[_0x0b79('0x43')][_0x0b79('0x2a')]);return db[_0x0b79('0x47')][_0x0b79('0x42')](_0x52acb9[_0x0b79('0x43')],{'include':[{'model':db[_0x0b79('0x4e')],'as':_0x0b79('0x4a')},{'model':db[_0x0b79('0x4e')],'as':'Descriptions'}]});}return null;})[_0x0b79('0x22')](respondWithResult(_0x92fa34,null))[_0x0b79('0x41')](handleError(_0x92fa34,null));};exports[_0x0b79('0x4f')]=function(_0x21ee3b,_0x30c29c,_0x4d4bb3){var _0x1e8278=_0x21ee3b[_0x0b79('0x2d')]['ticketType'];var _0x4e7c7b=_0x1e8278==='incident'?'Incident':_0x0b79('0x50');var _0x26fc79='';var _0x5c8a1d='';var _0x3c15f4='';var _0x4e5ef4='';var _0x3a69fb='';var _0x253f93='';var _0x1d3cd7='';var _0xa5920f='';var _0x2e216d=[_0x0b79('0x51'),'description',_0x0b79('0x52'),_0x0b79('0x53'),_0x0b79('0x54'),'subject',_0x0b79('0x55'),_0x0b79('0x56'),_0x0b79('0x57'),_0x0b79('0x58')];var _0x570b45=[_0x0b79('0x59'),_0x0b79('0x5a'),'actualserviceunits',_0x0b79('0x5b'),_0x0b79('0x5c'),_0x0b79('0x5d'),_0x0b79('0x5e'),_0x0b79('0x5f'),_0x0b79('0x60'),'createdbyexternalpartyyominame','createdbyname',_0x0b79('0x61'),_0x0b79('0x62'),_0x0b79('0x63'),_0x0b79('0x64'),_0x0b79('0x65'),_0x0b79('0x66'),_0x0b79('0x67'),_0x0b79('0x68'),_0x0b79('0x69'),_0x0b79('0x6a'),_0x0b79('0x6b'),_0x0b79('0x6c'),_0x0b79('0x6d'),'firstresponsebykpiidname',_0x0b79('0x6e'),'importsequencenumber','influencescore',_0x0b79('0x6f'),_0x0b79('0x70'),'masteridname',_0x0b79('0x71'),_0x0b79('0x72'),'modifiedbyname',_0x0b79('0x73'),_0x0b79('0x74'),'modifiedonbehalfbyname',_0x0b79('0x75'),_0x0b79('0x76'),_0x0b79('0x77'),_0x0b79('0x78'),'onholdtime',_0x0b79('0x79'),_0x0b79('0x7a'),_0x0b79('0x7b'),'owneridyominame',_0x0b79('0x7c'),_0x0b79('0x7d'),_0x0b79('0x7e'),_0x0b79('0x7f'),_0x0b79('0x80'),_0x0b79('0x81'),_0x0b79('0x82'),_0x0b79('0x83'),_0x0b79('0x84'),_0x0b79('0x85'),_0x0b79('0x86'),_0x0b79('0x87'),'slainvokedidname','slaname',_0x0b79('0x88'),_0x0b79('0x89'),_0x0b79('0x8a'),_0x0b79('0x8b'),'ticketnumber','timezoneruleversionnumber',_0x0b79('0x8c'),'traversedpath','utcconversiontimezonecode',_0x0b79('0x8d')];var _0x4bf810=_0x2e216d[_0x0b79('0x8e')](_0x570b45);return db[_0x0b79('0x28')][_0x0b79('0x46')]({'where':{'id':_0x21ee3b[_0x0b79('0x45')]['id']},'attributes':['id',_0x0b79('0x8f'),_0x0b79('0x90'),'remoteUri','tenantId',_0x0b79('0x91'),'clientSecret']})[_0x0b79('0x22')](handleEntityNotFound(_0x30c29c,null))[_0x0b79('0x22')](function(_0x411a9f){if(_0x411a9f){_0xa5920f=_0x411a9f['remoteUri'];var _0x2662d2=_0xa5920f[_0x0b79('0x92')](-0x1);if(_0x2662d2==='/'){_0xa5920f=_0xa5920f['substring'](0x0,_0xa5920f[_0x0b79('0x93')](_0x2662d2));}_0x1d3cd7=util['format'](_0x0b79('0x94'),_0xa5920f);var _0x46b7a7={'method':_0x0b79('0x95'),'uri':_0x0b79('0x96')+_0x411a9f[_0x0b79('0x97')]+_0x0b79('0x98'),'form':{'client_id':_0x411a9f[_0x0b79('0x91')],'resource':_0xa5920f,'username':_0x411a9f[_0x0b79('0x8f')],'password':_0x411a9f['password'],'grant_type':_0x0b79('0x90'),'client_secret':_0x411a9f[_0x0b79('0x99')]},'json':!![]};return rp(_0x46b7a7);}})[_0x0b79('0x22')](function(_0x131c38){_0x253f93=_0x131c38['access_token'];var _0x3f360e={'method':_0x0b79('0x9a'),'uri':encodeURI(_0x1d3cd7+_0x0b79('0x9b')+_0x4e7c7b+'\x27'),'headers':{'Authorization':_0x0b79('0x9c')+_0x253f93,'If-None-Match':null,'OData-Version':_0x0b79('0x9d')},'json':!![]};return rp(_0x3f360e);})[_0x0b79('0x22')](function(_0x1261a2){var _0x530def=_0x1261a2['value'][0x0];var _0x4c5956=_0x530def[_0x0b79('0x9e')];var _0x39b1a2={'method':'GET','uri':_0x1d3cd7+'EntityDefinitions('+_0x4c5956+_0x0b79('0x9f'),'headers':{'Authorization':'Bearer\x20'+_0x253f93,'If-None-Match':null,'OData-Version':_0x0b79('0x9d')},'json':!![]};return rp(_0x39b1a2);})[_0x0b79('0x22')](function(_0x59a5bc){_0x26fc79=_0x59a5bc;_0x5c8a1d=_0x26fc79[_0x0b79('0xa0')];_0x5c8a1d=_['remove'](_0x5c8a1d,function(_0x12b003){return!_0x4bf810[_0x0b79('0xa1')](_0x12b003[_0x0b79('0xa2')]);});var _0x427131=[];var _0x19da21=[];_0x5c8a1d[_0x0b79('0xa3')](function(_0x42e594){if(_0x42e594[_0x0b79('0xa4')]){var _0x21225a=_0x42e594[_0x0b79('0xa4')][_0x0b79('0xa5')](_0x42e594[_0x0b79('0xa4')]['lastIndexOf']('.')+0x1);if(_0x21225a==='PicklistAttributeMetadata'){_0x427131[_0x0b79('0xa6')](getSelectList(_0x1d3cd7,_0x1e8278,_0x19da21,_0x26fc79[_0x0b79('0x9e')],_0x42e594[_0x0b79('0x9e')],_0x253f93));}}});return Promise[_0x0b79('0xa7')](_0x427131);})['then'](function(_0x5a58eb){_0x3c15f4=_0x5a58eb[0x0];var _0x901f06=[];var _0x559f13=[];_0x5c8a1d['forEach'](function(_0x1ccf84){if(!_[_0x0b79('0xa8')](_0x1ccf84[_0x0b79('0xa4')])){var _0x502b33=_0x1ccf84['@odata.type'][_0x0b79('0xa5')](_0x1ccf84['@odata.type'][_0x0b79('0x93')]('.')+0x1);if(_0x502b33===_0x0b79('0xa9')){_0x901f06[_0x0b79('0xa6')](getBooleanList(_0x1d3cd7,_0x1e8278,_0x559f13,_0x26fc79[_0x0b79('0x9e')],_0x1ccf84[_0x0b79('0x9e')],_0x253f93));}}});return Promise['all'](_0x901f06);})[_0x0b79('0x22')](function(_0x347724){_0x4e5ef4=_0x347724[0x0];var _0x452ac=[];var _0x4bbdf9=[];_0x5c8a1d[_0x0b79('0xa3')](function(_0x129fce){if(_0x129fce[_0x0b79('0xa4')]){var _0x54a8e5=_0x129fce['@odata.type']['substring'](_0x129fce[_0x0b79('0xa4')][_0x0b79('0x93')]('.')+0x1);if(_0x54a8e5===_0x0b79('0xaa')||_0x54a8e5==='DoubleAttributeMetadata'||_0x54a8e5==='BigIntAttributeMetadata'||_0x54a8e5===_0x0b79('0xab')||_0x54a8e5==='MemoAttributeMetadata'||_0x54a8e5===_0x0b79('0xac')||_0x54a8e5===_0x0b79('0xad')||_0x54a8e5===_0x0b79('0xae')||_0x54a8e5==='StateAttributeMetadata'||_0x54a8e5===_0x0b79('0xaf')){_0x452ac['push'](getInputList(_0x1d3cd7,_0x1e8278,_0x54a8e5,_0x4bbdf9,_0x26fc79['MetadataId'],_0x129fce['MetadataId'],_0x253f93));}}});return Promise[_0x0b79('0xa7')](_0x452ac);})[_0x0b79('0x22')](function(_0x5234be){_0x3a69fb=_0x5234be[0x0];var _0x57cb37=_0x3c15f4[_0x0b79('0x8e')](_0x4e5ef4)[_0x0b79('0x8e')](_0x3a69fb);var _0x45ff53={'count':_0x57cb37['length'],'rows':_0x57cb37};return _0x45ff53;})[_0x0b79('0x22')](respondWithResult(_0x30c29c,null))['catch'](function(_0x1f56a6){var _0x131d18=_0x21ee3b[_0x0b79('0x2d')][_0x0b79('0xb0')]?0x1f4:_0x1f56a6[_0x0b79('0xb1')]||0x1f4;logger[_0x0b79('0x23')](_0x1f56a6['stack']);delete _0x1f56a6[_0x0b79('0x25')];if(_0x131d18===0x191){_0x131d18=0x190;}_0x30c29c[_0x0b79('0x1d')](_0x131d18)[_0x0b79('0x26')](_0x21ee3b[_0x0b79('0x2d')][_0x0b79('0xb0')]?{'message':_0x0b79('0xb2'),'statusCode':_0x1f56a6[_0x0b79('0xb1')]}:_0x1f56a6);});};function getSelectList(_0x49414d,_0x2f157b,_0x1bad80,_0x5ed3b3,_0x3d3b5c,_0x309ab9){var _0x4ec192={'method':_0x0b79('0x9a'),'uri':_0x49414d+_0x0b79('0xb3')+_0x5ed3b3+_0x0b79('0xb4')+_0x3d3b5c+_0x0b79('0xb5')+_0x0b79('0xb6'),'headers':{'Authorization':_0x0b79('0x9c')+_0x309ab9,'If-None-Match':null,'OData-Version':_0x0b79('0x9d')},'json':!![]};return rp(_0x4ec192)[_0x0b79('0x22')](function(_0x1b294d){var _0x1d7f69=[];var _0x181ebf=_0x1b294d['OptionSet'][_0x0b79('0xb7')];_0x181ebf[_0x0b79('0xa3')](function(_0x2a50dc){_0x1d7f69['push']({'name':_0x2a50dc[_0x0b79('0xb8')][_0x0b79('0xb9')]['Label'],'value':String(_0x2a50dc['Value'])});});var _0x38ddaa={'id':_0x2f157b+'_'+_0x1b294d[_0x0b79('0xa2')],'name':_0x1b294d[_0x0b79('0xba')]['UserLocalizedLabel'][_0x0b79('0xb8')],'custom':![],'options':_0x1d7f69};_0x1bad80[_0x0b79('0xa6')](_0x38ddaa);return _0x1bad80;});}function getBooleanList(_0x3e228c,_0x467bcf,_0x201d96,_0x19d668,_0x3b0107,_0x415f32){var _0x123c70={'method':_0x0b79('0x9a'),'uri':_0x3e228c+_0x0b79('0xb3')+_0x19d668+_0x0b79('0xb4')+_0x3b0107+_0x0b79('0xbb'),'headers':{'Authorization':_0x0b79('0x9c')+_0x415f32,'If-None-Match':null,'OData-Version':_0x0b79('0x9d')},'json':!![]};return rp(_0x123c70)['then'](function(_0xa34638){var _0x475264=[];_0x475264[_0x0b79('0xa6')]({'name':_0xa34638[_0x0b79('0xbc')][_0x0b79('0xbd')][_0x0b79('0xb8')][_0x0b79('0xb9')]['Label'],'value':_0x0b79('0xbe')},{'name':_0xa34638[_0x0b79('0xbc')][_0x0b79('0xbf')][_0x0b79('0xb8')][_0x0b79('0xb9')][_0x0b79('0xb8')],'value':_0x0b79('0xc0')});var _0x3a34c9={'id':_0x467bcf+'_'+_0xa34638[_0x0b79('0xa2')],'name':_0xa34638['DisplayName'][_0x0b79('0xb9')][_0x0b79('0xb8')],'custom':![],'options':_0x475264};_0x201d96[_0x0b79('0xa6')](_0x3a34c9);return _0x201d96;});}function getInputList(_0x2eebce,_0x449d0b,_0x523e8f,_0xa0dfef,_0x42e7e7,_0x30a3ba,_0x483e50){var _0x3b8b8d={'method':_0x0b79('0x9a'),'uri':_0x2eebce+_0x0b79('0xb3')+_0x42e7e7+_0x0b79('0xb4')+_0x30a3ba+_0x0b79('0xc1')+_0x523e8f+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x0b79('0x9c')+_0x483e50,'If-None-Match':null,'OData-Version':_0x0b79('0x9d')},'json':!![]};return rp(_0x3b8b8d)[_0x0b79('0x22')](function(_0xa4bbfa){var _0x31077c={'id':_0x449d0b+'_'+_0xa4bbfa[_0x0b79('0xa2')],'name':_0xa4bbfa[_0x0b79('0xba')][_0x0b79('0xb9')]?_0xa4bbfa['DisplayName'][_0x0b79('0xb9')]['Label']:_0xa4bbfa[_0x0b79('0xa2')],'custom':![],'options':[]};_0xa0dfef[_0x0b79('0xa6')](_0x31077c);return _0xa0dfef;});}
\ No newline at end of file
+var _0x8e63=['channel','Descriptions','getDescriptions','Dynamics365Field','Subjects','getFields','ticketType','incident','PhoneCall','title','customerid','ownerid','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','slainvokedidname','slaname','statecode','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','password','remoteUri','tenantId','clientId','clientSecret','slice','substring','lastIndexOf','format','POST','username','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','EntityDefinitions(','Attributes','remove','forEach','@odata.type','PicklistAttributeMetadata','push','MetadataId','all','BooleanAttributeMetadata','StringAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','error','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','Label','LogicalName','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','FalseOption',')/Microsoft.Dynamics.CRM.','rimraf','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','reject','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','Dynamics365Account','includeAll','rows','catch','params','length','include','find','create','body','destroy','getConfigurations','findOne','Dynamics365Configuration','nolimit','addConfiguration','getSubjects'];(function(_0x29d096,_0x4f3bf9){var _0x469bb8=function(_0x2e789a){while(--_0x2e789a){_0x29d096['push'](_0x29d096['shift']());}};_0x469bb8(++_0x4f3bf9);}(_0x8e63,0x7c));var _0x38e6=function(_0x33876e,_0x4a74d9){_0x33876e=_0x33876e-0x0;var _0x258a24=_0x8e63[_0x33876e];return _0x258a24;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x38e6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x38e6('0x1'));var moment=require(_0x38e6('0x2'));var BPromise=require(_0x38e6('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x38e6('0x4'));var sox=require(_0x38e6('0x5'));var csv=require(_0x38e6('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x38e6('0x7'));var _=require(_0x38e6('0x8'));var squel=require(_0x38e6('0x9'));var crypto=require(_0x38e6('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x38e6('0x6'));var querystring=require(_0x38e6('0xb'));var Papa=require(_0x38e6('0xc'));var Redis=require(_0x38e6('0xd'));var authService=require(_0x38e6('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x38e6('0xf'));var logger=require('../../config/logger')(_0x38e6('0x10'));var utils=require('../../config/utils');var config=require(_0x38e6('0x11'));var licenseUtil=require(_0x38e6('0x12'));var db=require(_0x38e6('0x13'))['db'];var integrations=require(_0x38e6('0x14'));function respondWithStatusCode(_0x2e2585,_0x57c207){_0x57c207=_0x57c207||0xcc;return function(_0x2b4679){if(_0x2b4679){return _0x2e2585[_0x38e6('0x15')](_0x57c207);}return _0x2e2585['status'](_0x57c207)[_0x38e6('0x16')]();};}function respondWithResult(_0xfd7f2,_0x229f18){_0x229f18=_0x229f18||0xc8;return function(_0x1370bb){if(_0x1370bb){return _0xfd7f2[_0x38e6('0x17')](_0x229f18)[_0x38e6('0x18')](_0x1370bb);}};}function respondWithFilteredResult(_0x55208f,_0x279688){return function(_0x36a263){if(_0x36a263){var _0x3299c9=typeof _0x279688[_0x38e6('0x19')]===_0x38e6('0x1a')&&typeof _0x279688['limit']===_0x38e6('0x1a');var _0x58c772=_0x36a263[_0x38e6('0x1b')];var _0x3e94f9=_0x3299c9?0x0:_0x279688[_0x38e6('0x19')];var _0x1dee00=_0x3299c9?_0x36a263['count']:_0x279688[_0x38e6('0x19')]+_0x279688['limit'];var _0x18ec00;if(_0x1dee00>=_0x58c772){_0x1dee00=_0x58c772;_0x18ec00=0xc8;}else{_0x18ec00=0xce;}_0x55208f[_0x38e6('0x17')](_0x18ec00);return _0x55208f[_0x38e6('0x1c')](_0x38e6('0x1d'),_0x3e94f9+'-'+_0x1dee00+'/'+_0x58c772)[_0x38e6('0x18')](_0x36a263);}return null;};}function patchUpdates(_0x41bb24){return function(_0x495268){try{jsonpatch['apply'](_0x495268,_0x41bb24,!![]);}catch(_0x4d6bf4){return BPromise[_0x38e6('0x1e')](_0x4d6bf4);}return _0x495268['save']();};}function saveUpdates(_0x4a82f6,_0x2d995f){return function(_0xa4a8b9){if(_0xa4a8b9){return _0xa4a8b9[_0x38e6('0x1f')](_0x4a82f6)[_0x38e6('0x20')](function(_0x5f5ab2){return _0x5f5ab2;});}return null;};}function removeEntity(_0x140fc3,_0x4530a7){return function(_0x185922){if(_0x185922){return _0x185922['destroy']()[_0x38e6('0x20')](function(){_0x140fc3[_0x38e6('0x17')](0xcc)[_0x38e6('0x16')]();});}};}function handleEntityNotFound(_0x9bc0b0,_0x106424){return function(_0xdcf7ff){if(!_0xdcf7ff){_0x9bc0b0[_0x38e6('0x15')](0x194);}return _0xdcf7ff;};}function handleError(_0x167b28,_0x4a261a){_0x4a261a=_0x4a261a||0x1f4;return function(_0x175815){logger['error'](_0x175815[_0x38e6('0x21')]);if(_0x175815[_0x38e6('0x22')]){delete _0x175815[_0x38e6('0x22')];}_0x167b28[_0x38e6('0x17')](_0x4a261a)[_0x38e6('0x23')](_0x175815);};}exports[_0x38e6('0x24')]=function(_0x1d4a1b,_0x5a4912){var _0xe93f18={},_0x1980a4={},_0x48f5a2={'count':0x0,'rows':[]};var _0x1aa78b=_[_0x38e6('0x25')](db['Dynamics365Account'][_0x38e6('0x26')],function(_0x192893){return{'name':_0x192893[_0x38e6('0x27')],'type':_0x192893[_0x38e6('0x28')][_0x38e6('0x29')]};});_0x1980a4[_0x38e6('0x2a')]=_[_0x38e6('0x25')](_0x1aa78b,'name');_0x1980a4[_0x38e6('0x2b')]=_[_0x38e6('0x2c')](_0x1d4a1b[_0x38e6('0x2b')]);_0x1980a4[_0x38e6('0x2d')]=_[_0x38e6('0x2e')](_0x1980a4[_0x38e6('0x2a')],_0x1980a4[_0x38e6('0x2b')]);_0xe93f18['attributes']=_[_0x38e6('0x2e')](_0x1980a4[_0x38e6('0x2a')],qs[_0x38e6('0x2f')](_0x1d4a1b[_0x38e6('0x2b')][_0x38e6('0x2f')]));_0xe93f18[_0x38e6('0x30')]=_0xe93f18[_0x38e6('0x30')]['length']?_0xe93f18[_0x38e6('0x30')]:_0x1980a4[_0x38e6('0x2a')];if(!_0x1d4a1b[_0x38e6('0x2b')][_0x38e6('0x31')]('nolimit')){_0xe93f18[_0x38e6('0x32')]=qs[_0x38e6('0x32')](_0x1d4a1b['query'][_0x38e6('0x32')]);_0xe93f18[_0x38e6('0x19')]=qs[_0x38e6('0x19')](_0x1d4a1b[_0x38e6('0x2b')]['offset']);}_0xe93f18[_0x38e6('0x33')]=qs[_0x38e6('0x34')](_0x1d4a1b[_0x38e6('0x2b')][_0x38e6('0x34')]);_0xe93f18['where']=qs[_0x38e6('0x2d')](_[_0x38e6('0x35')](_0x1d4a1b[_0x38e6('0x2b')],_0x1980a4[_0x38e6('0x2d')]),_0x1aa78b);if(_0x1d4a1b[_0x38e6('0x2b')][_0x38e6('0x36')]){_0xe93f18[_0x38e6('0x37')]=_['merge'](_0xe93f18[_0x38e6('0x37')],{'$or':_[_0x38e6('0x25')](_0x1aa78b,function(_0x5700a1){if(_0x5700a1['type']!==_0x38e6('0x38')){var _0x11556e={};_0x11556e[_0x5700a1[_0x38e6('0x22')]]={'$like':'%'+_0x1d4a1b[_0x38e6('0x2b')][_0x38e6('0x36')]+'%'};return _0x11556e;}})});}_0xe93f18=_[_0x38e6('0x39')]({},_0xe93f18,_0x1d4a1b[_0x38e6('0x3a')]);var _0x1878e9={'where':_0xe93f18[_0x38e6('0x37')]};return db[_0x38e6('0x3b')]['count'](_0x1878e9)[_0x38e6('0x20')](function(_0xd558ec){_0x48f5a2[_0x38e6('0x1b')]=_0xd558ec;if(_0x1d4a1b[_0x38e6('0x2b')][_0x38e6('0x3c')]){_0xe93f18['include']=[{'all':!![]}];}return db[_0x38e6('0x3b')]['findAll'](_0xe93f18);})[_0x38e6('0x20')](function(_0x2c4c63){_0x48f5a2[_0x38e6('0x3d')]=_0x2c4c63;return _0x48f5a2;})[_0x38e6('0x20')](respondWithFilteredResult(_0x5a4912,_0xe93f18))[_0x38e6('0x3e')](handleError(_0x5a4912,null));};exports['show']=function(_0x44e6af,_0x3166fb){var _0x5f4ae3={'raw':![],'where':{'id':_0x44e6af[_0x38e6('0x3f')]['id']}},_0x385045={};_0x385045[_0x38e6('0x2a')]=_['keys'](db[_0x38e6('0x3b')][_0x38e6('0x26')]);_0x385045['query']=_[_0x38e6('0x2c')](_0x44e6af[_0x38e6('0x2b')]);_0x385045[_0x38e6('0x2d')]=_[_0x38e6('0x2e')](_0x385045[_0x38e6('0x2a')],_0x385045['query']);_0x5f4ae3[_0x38e6('0x30')]=_['intersection'](_0x385045[_0x38e6('0x2a')],qs[_0x38e6('0x2f')](_0x44e6af['query'][_0x38e6('0x2f')]));_0x5f4ae3[_0x38e6('0x30')]=_0x5f4ae3['attributes'][_0x38e6('0x40')]?_0x5f4ae3[_0x38e6('0x30')]:_0x385045[_0x38e6('0x2a')];if(_0x44e6af['query'][_0x38e6('0x3c')]){_0x5f4ae3[_0x38e6('0x41')]=[{'all':!![]}];}_0x5f4ae3=_[_0x38e6('0x39')]({},_0x5f4ae3,_0x44e6af['options']);return db['Dynamics365Account'][_0x38e6('0x42')](_0x5f4ae3)[_0x38e6('0x20')](handleEntityNotFound(_0x3166fb,null))['then'](respondWithResult(_0x3166fb,null))[_0x38e6('0x3e')](handleError(_0x3166fb,null));};exports[_0x38e6('0x43')]=function(_0x2eadb4,_0x2e0644){return db[_0x38e6('0x3b')][_0x38e6('0x43')](_0x2eadb4[_0x38e6('0x44')],{})['then'](respondWithResult(_0x2e0644,0xc9))['catch'](handleError(_0x2e0644,null));};exports[_0x38e6('0x1f')]=function(_0x5d1e7b,_0xcb5099){if(_0x5d1e7b[_0x38e6('0x44')]['id']){delete _0x5d1e7b['body']['id'];}return db['Dynamics365Account'][_0x38e6('0x42')]({'where':{'id':_0x5d1e7b[_0x38e6('0x3f')]['id']}})['then'](handleEntityNotFound(_0xcb5099,null))[_0x38e6('0x20')](saveUpdates(_0x5d1e7b['body'],null))['then'](respondWithResult(_0xcb5099,null))[_0x38e6('0x3e')](handleError(_0xcb5099,null));};exports[_0x38e6('0x45')]=function(_0x385de7,_0x1b6291){return db[_0x38e6('0x3b')]['find']({'where':{'id':_0x385de7[_0x38e6('0x3f')]['id']}})[_0x38e6('0x20')](handleEntityNotFound(_0x1b6291,null))[_0x38e6('0x20')](removeEntity(_0x1b6291,null))[_0x38e6('0x3e')](handleError(_0x1b6291,null));};exports[_0x38e6('0x46')]=function(_0x361ff6,_0x138800,_0x4bd79d){var _0x55bbe4={};var _0x487485={};var _0x32e8dc;var _0x3cdcbd;return db['Dynamics365Account'][_0x38e6('0x47')]({'where':{'id':_0x361ff6[_0x38e6('0x3f')]['id']}})[_0x38e6('0x20')](handleEntityNotFound(_0x138800,null))[_0x38e6('0x20')](function(_0x38590e){if(_0x38590e){_0x32e8dc=_0x38590e;_0x487485[_0x38e6('0x2a')]=_[_0x38e6('0x2c')](db[_0x38e6('0x48')][_0x38e6('0x26')]);_0x487485[_0x38e6('0x2b')]=_['keys'](_0x361ff6[_0x38e6('0x2b')]);_0x487485[_0x38e6('0x2d')]=_[_0x38e6('0x2e')](_0x487485[_0x38e6('0x2a')],_0x487485[_0x38e6('0x2b')]);_0x55bbe4[_0x38e6('0x30')]=_[_0x38e6('0x2e')](_0x487485['model'],qs[_0x38e6('0x2f')](_0x361ff6[_0x38e6('0x2b')][_0x38e6('0x2f')]));_0x55bbe4[_0x38e6('0x30')]=_0x55bbe4['attributes']['length']?_0x55bbe4['attributes']:_0x487485['model'];_0x55bbe4[_0x38e6('0x33')]=qs[_0x38e6('0x34')](_0x361ff6[_0x38e6('0x2b')]['sort']);_0x55bbe4[_0x38e6('0x37')]=qs[_0x38e6('0x2d')](_['pick'](_0x361ff6[_0x38e6('0x2b')],_0x487485['filters']));if(_0x361ff6[_0x38e6('0x2b')][_0x38e6('0x36')]){_0x55bbe4[_0x38e6('0x37')]=_['merge'](_0x55bbe4[_0x38e6('0x37')],{'$or':_['map'](_0x55bbe4[_0x38e6('0x30')],function(_0x54a0bc){var _0x432026={};_0x432026[_0x54a0bc]={'$like':'%'+_0x361ff6[_0x38e6('0x2b')]['filter']+'%'};return _0x432026;})});}_0x55bbe4=_[_0x38e6('0x39')]({},_0x55bbe4,_0x361ff6[_0x38e6('0x3a')]);return _0x32e8dc['getConfigurations'](_0x55bbe4);}})['then'](function(_0x492f00){if(_0x492f00){_0x3cdcbd=_0x492f00[_0x38e6('0x40')];if(!_0x361ff6[_0x38e6('0x2b')][_0x38e6('0x31')](_0x38e6('0x49'))){_0x55bbe4[_0x38e6('0x32')]=qs[_0x38e6('0x32')](_0x361ff6['query'][_0x38e6('0x32')]);_0x55bbe4[_0x38e6('0x19')]=qs[_0x38e6('0x19')](_0x361ff6[_0x38e6('0x2b')]['offset']);}return _0x32e8dc[_0x38e6('0x46')](_0x55bbe4);}})[_0x38e6('0x20')](function(_0x45e5b5){if(_0x45e5b5){return _0x45e5b5?{'count':_0x3cdcbd,'rows':_0x45e5b5}:null;}})[_0x38e6('0x20')](respondWithResult(_0x138800,null))[_0x38e6('0x3e')](handleError(_0x138800,null));};exports[_0x38e6('0x4a')]=function(_0x46a495,_0x4dfae1,_0x169ba9){if(_0x46a495[_0x38e6('0x44')]['id']){delete _0x46a495['body']['id'];}return db[_0x38e6('0x3b')][_0x38e6('0x47')]({'where':{'id':_0x46a495['params']['id']}})[_0x38e6('0x20')](handleEntityNotFound(_0x4dfae1,null))['then'](function(_0x21c25b){if(_0x21c25b){_0x46a495[_0x38e6('0x44')]['AccountId']=_0x21c25b['id'];_0x46a495[_0x38e6('0x44')]['Subjects']=integrations[_0x38e6('0x4b')](_0x46a495[_0x38e6('0x44')][_0x38e6('0x4c')],_0x46a495['body']['type']);_0x46a495[_0x38e6('0x44')][_0x38e6('0x4d')]=integrations[_0x38e6('0x4e')](_0x46a495[_0x38e6('0x44')][_0x38e6('0x4c')],_0x46a495[_0x38e6('0x44')]['type']);return db['Dynamics365Configuration'][_0x38e6('0x43')](_0x46a495[_0x38e6('0x44')],{'include':[{'model':db[_0x38e6('0x4f')],'as':_0x38e6('0x50')},{'model':db[_0x38e6('0x4f')],'as':_0x38e6('0x4d')}]});}return null;})[_0x38e6('0x20')](respondWithResult(_0x4dfae1,null))[_0x38e6('0x3e')](handleError(_0x4dfae1,null));};exports[_0x38e6('0x51')]=function(_0x37d317,_0x1ef1dd,_0x45da45){var _0x5c965b=_0x37d317[_0x38e6('0x2b')][_0x38e6('0x52')];var _0x8ab723=_0x5c965b===_0x38e6('0x53')?'Incident':_0x38e6('0x54');var _0x385343='';var _0x28004d='';var _0x15ca57='';var _0x23a79e='';var _0x592512='';var _0x332315='';var _0x2fa987='';var _0x2f9906='';var _0x252426=[_0x38e6('0x55'),'description',_0x38e6('0x56'),_0x38e6('0x57'),'caseorigincode','subject',_0x38e6('0x58'),_0x38e6('0x59'),_0x38e6('0x5a'),_0x38e6('0x5b')];var _0x59c637=[_0x38e6('0x5c'),'accountidyominame',_0x38e6('0x5d'),_0x38e6('0x5e'),_0x38e6('0x5f'),_0x38e6('0x60'),_0x38e6('0x61'),'contractidname',_0x38e6('0x62'),_0x38e6('0x63'),_0x38e6('0x64'),_0x38e6('0x65'),_0x38e6('0x66'),_0x38e6('0x67'),_0x38e6('0x68'),_0x38e6('0x69'),_0x38e6('0x6a'),_0x38e6('0x6b'),_0x38e6('0x6c'),_0x38e6('0x6d'),_0x38e6('0x6e'),'entityimage_url',_0x38e6('0x6f'),_0x38e6('0x70'),_0x38e6('0x71'),'followupby',_0x38e6('0x72'),'influencescore','kbarticleidname',_0x38e6('0x73'),_0x38e6('0x74'),'modifiedbyexternalpartyname',_0x38e6('0x75'),_0x38e6('0x76'),_0x38e6('0x77'),_0x38e6('0x78'),_0x38e6('0x79'),_0x38e6('0x7a'),_0x38e6('0x7b'),_0x38e6('0x7c'),_0x38e6('0x7d'),_0x38e6('0x7e'),_0x38e6('0x7f'),_0x38e6('0x80'),'owneridtype','owneridyominame',_0x38e6('0x81'),_0x38e6('0x82'),_0x38e6('0x83'),_0x38e6('0x84'),_0x38e6('0x85'),_0x38e6('0x86'),_0x38e6('0x87'),_0x38e6('0x88'),_0x38e6('0x89'),_0x38e6('0x8a'),'responsiblecontactidyominame',_0x38e6('0x8b'),_0x38e6('0x8c'),_0x38e6('0x8d'),'socialprofileidname',_0x38e6('0x8e'),_0x38e6('0x8f'),_0x38e6('0x90'),'ticketnumber',_0x38e6('0x91'),_0x38e6('0x92'),_0x38e6('0x93'),_0x38e6('0x94'),'versionnumber'];var _0x343b85=_0x252426[_0x38e6('0x95')](_0x59c637);return db[_0x38e6('0x3b')]['findOne']({'where':{'id':_0x37d317[_0x38e6('0x3f')]['id']},'attributes':['id','username',_0x38e6('0x96'),_0x38e6('0x97'),_0x38e6('0x98'),_0x38e6('0x99'),_0x38e6('0x9a')]})[_0x38e6('0x20')](handleEntityNotFound(_0x1ef1dd,null))[_0x38e6('0x20')](function(_0x18bf4e){if(_0x18bf4e){_0x2f9906=_0x18bf4e[_0x38e6('0x97')];var _0x4c13a0=_0x2f9906[_0x38e6('0x9b')](-0x1);if(_0x4c13a0==='/'){_0x2f9906=_0x2f9906[_0x38e6('0x9c')](0x0,_0x2f9906[_0x38e6('0x9d')](_0x4c13a0));}_0x2fa987=util[_0x38e6('0x9e')]('%s/api/data/v9.0/',_0x2f9906);var _0x550751={'method':_0x38e6('0x9f'),'uri':'https://login.microsoftonline.com/'+_0x18bf4e[_0x38e6('0x98')]+'/oauth2/token','form':{'client_id':_0x18bf4e[_0x38e6('0x99')],'resource':_0x2f9906,'username':_0x18bf4e[_0x38e6('0xa0')],'password':_0x18bf4e[_0x38e6('0x96')],'grant_type':_0x38e6('0x96'),'client_secret':_0x18bf4e[_0x38e6('0x9a')]},'json':!![]};return rp(_0x550751);}})[_0x38e6('0x20')](function(_0x1436cd){_0x332315=_0x1436cd[_0x38e6('0xa1')];var _0x3f7ffe={'method':_0x38e6('0xa2'),'uri':encodeURI(_0x2fa987+_0x38e6('0xa3')+_0x8ab723+'\x27'),'headers':{'Authorization':_0x38e6('0xa4')+_0x332315,'If-None-Match':null,'OData-Version':_0x38e6('0xa5')},'json':!![]};return rp(_0x3f7ffe);})['then'](function(_0x2e1e9d){var _0x5ae4ec=_0x2e1e9d[_0x38e6('0xa6')][0x0];var _0x3a8ec3=_0x5ae4ec['MetadataId'];var _0x1579a7={'method':_0x38e6('0xa2'),'uri':_0x2fa987+_0x38e6('0xa7')+_0x3a8ec3+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x38e6('0xa4')+_0x332315,'If-None-Match':null,'OData-Version':_0x38e6('0xa5')},'json':!![]};return rp(_0x1579a7);})[_0x38e6('0x20')](function(_0x2b5174){_0x385343=_0x2b5174;_0x28004d=_0x385343[_0x38e6('0xa8')];_0x28004d=_[_0x38e6('0xa9')](_0x28004d,function(_0x5ad13a){return!_0x343b85['includes'](_0x5ad13a['LogicalName']);});var _0x40a47e=[];var _0x434b9e=[];_0x28004d[_0x38e6('0xaa')](function(_0xcccf86){if(_0xcccf86[_0x38e6('0xab')]){var _0x172110=_0xcccf86['@odata.type'][_0x38e6('0x9c')](_0xcccf86[_0x38e6('0xab')][_0x38e6('0x9d')]('.')+0x1);if(_0x172110===_0x38e6('0xac')){_0x40a47e[_0x38e6('0xad')](getSelectList(_0x2fa987,_0x5c965b,_0x434b9e,_0x385343['MetadataId'],_0xcccf86[_0x38e6('0xae')],_0x332315));}}});return Promise[_0x38e6('0xaf')](_0x40a47e);})[_0x38e6('0x20')](function(_0x2f886a){_0x15ca57=_0x2f886a[0x0];var _0x27acf0=[];var _0x4b99a2=[];_0x28004d['forEach'](function(_0xcecef1){if(!_['isNil'](_0xcecef1[_0x38e6('0xab')])){var _0x57de21=_0xcecef1['@odata.type']['substring'](_0xcecef1[_0x38e6('0xab')][_0x38e6('0x9d')]('.')+0x1);if(_0x57de21===_0x38e6('0xb0')){_0x27acf0[_0x38e6('0xad')](getBooleanList(_0x2fa987,_0x5c965b,_0x4b99a2,_0x385343[_0x38e6('0xae')],_0xcecef1[_0x38e6('0xae')],_0x332315));}}});return Promise['all'](_0x27acf0);})['then'](function(_0x17ca5f){_0x23a79e=_0x17ca5f[0x0];var _0x3f3d3b=[];var _0x39b2e0=[];_0x28004d['forEach'](function(_0x48bd58){if(_0x48bd58[_0x38e6('0xab')]){var _0x17eafd=_0x48bd58[_0x38e6('0xab')][_0x38e6('0x9c')](_0x48bd58['@odata.type'][_0x38e6('0x9d')]('.')+0x1);if(_0x17eafd===_0x38e6('0xb1')||_0x17eafd==='DoubleAttributeMetadata'||_0x17eafd==='BigIntAttributeMetadata'||_0x17eafd===_0x38e6('0xb2')||_0x17eafd===_0x38e6('0xb3')||_0x17eafd===_0x38e6('0xb4')||_0x17eafd===_0x38e6('0xb5')||_0x17eafd==='EntityNameAttributeMetadata'||_0x17eafd===_0x38e6('0xb6')||_0x17eafd===_0x38e6('0xb7')){_0x3f3d3b['push'](getInputList(_0x2fa987,_0x5c965b,_0x17eafd,_0x39b2e0,_0x385343['MetadataId'],_0x48bd58['MetadataId'],_0x332315));}}});return Promise[_0x38e6('0xaf')](_0x3f3d3b);})[_0x38e6('0x20')](function(_0x5ec226){_0x592512=_0x5ec226[0x0];var _0x548b8d=_0x15ca57[_0x38e6('0x95')](_0x23a79e)['concat'](_0x592512);var _0x5b733a={'count':_0x548b8d[_0x38e6('0x40')],'rows':_0x548b8d};return _0x5b733a;})[_0x38e6('0x20')](respondWithResult(_0x1ef1dd,null))['catch'](function(_0x23c67d){var _0x276997=_0x37d317[_0x38e6('0x2b')][_0x38e6('0xb8')]?0x1f4:_0x23c67d[_0x38e6('0xb9')]||0x1f4;logger[_0x38e6('0xba')](_0x23c67d[_0x38e6('0x21')]);delete _0x23c67d[_0x38e6('0x22')];if(_0x276997===0x191){_0x276997=0x190;}_0x1ef1dd['status'](_0x276997)['send'](_0x37d317['query'][_0x38e6('0xb8')]?{'message':_0x38e6('0xbb'),'statusCode':_0x23c67d[_0x38e6('0xb9')]}:_0x23c67d);});};function getSelectList(_0x1a1115,_0x2dc7fc,_0x5130ba,_0x1ad836,_0x58d289,_0x1dfc0a){var _0x252da1={'method':'GET','uri':_0x1a1115+'EntityDefinitions('+_0x1ad836+_0x38e6('0xbc')+_0x58d289+_0x38e6('0xbd')+_0x38e6('0xbe'),'headers':{'Authorization':_0x38e6('0xa4')+_0x1dfc0a,'If-None-Match':null,'OData-Version':_0x38e6('0xa5')},'json':!![]};return rp(_0x252da1)['then'](function(_0x1e7c07){var _0x300176=[];var _0x186975=_0x1e7c07[_0x38e6('0xbf')][_0x38e6('0xc0')];_0x186975[_0x38e6('0xaa')](function(_0x4adae5){_0x300176['push']({'name':_0x4adae5['Label'][_0x38e6('0xc1')][_0x38e6('0xc2')],'value':String(_0x4adae5['Value'])});});var _0x2ec2cb={'id':_0x2dc7fc+'_'+_0x1e7c07[_0x38e6('0xc3')],'name':_0x1e7c07[_0x38e6('0xc4')][_0x38e6('0xc1')][_0x38e6('0xc2')],'custom':![],'options':_0x300176};_0x5130ba[_0x38e6('0xad')](_0x2ec2cb);return _0x5130ba;});}function getBooleanList(_0x31d884,_0x2a47d4,_0x4e0968,_0x4d142a,_0x4a61ae,_0x247ebd){var _0x1d87ae={'method':_0x38e6('0xa2'),'uri':_0x31d884+'EntityDefinitions('+_0x4d142a+_0x38e6('0xbc')+_0x4a61ae+_0x38e6('0xc5'),'headers':{'Authorization':'Bearer\x20'+_0x247ebd,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1d87ae)['then'](function(_0x5a43d6){var _0x4c9a5e=[];_0x4c9a5e[_0x38e6('0xad')]({'name':_0x5a43d6[_0x38e6('0xbf')]['TrueOption'][_0x38e6('0xc2')][_0x38e6('0xc1')]['Label'],'value':'true'},{'name':_0x5a43d6['OptionSet'][_0x38e6('0xc6')][_0x38e6('0xc2')]['UserLocalizedLabel']['Label'],'value':'false'});var _0x26e06e={'id':_0x2a47d4+'_'+_0x5a43d6['LogicalName'],'name':_0x5a43d6[_0x38e6('0xc4')]['UserLocalizedLabel'][_0x38e6('0xc2')],'custom':![],'options':_0x4c9a5e};_0x4e0968[_0x38e6('0xad')](_0x26e06e);return _0x4e0968;});}function getInputList(_0x44490d,_0x1b489c,_0x22e340,_0x406fe0,_0x2838ff,_0x59db53,_0x161af5){var _0x3c9faa={'method':_0x38e6('0xa2'),'uri':_0x44490d+'EntityDefinitions('+_0x2838ff+')/Attributes('+_0x59db53+_0x38e6('0xc7')+_0x22e340+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x38e6('0xa4')+_0x161af5,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3c9faa)['then'](function(_0x2c637f){var _0x45eac4={'id':_0x1b489c+'_'+_0x2c637f['LogicalName'],'name':_0x2c637f[_0x38e6('0xc4')][_0x38e6('0xc1')]?_0x2c637f['DisplayName']['UserLocalizedLabel'][_0x38e6('0xc2')]:_0x2c637f[_0x38e6('0xc3')],'custom':![],'options':[]};_0x406fe0[_0x38e6('0xad')](_0x45eac4);return _0x406fe0;});}
\ No newline at end of file
index 9a1e0cf..49e5b3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x48e6c1,_0x2e0b0b){var _0x32df98=function(_0x2aa31b){while(--_0x2aa31b){_0x48e6c1['push'](_0x48e6c1['shift']());}};_0x32df98(++_0x2e0b0b);}(_0xe706,0xa3));var _0x6e70=function(_0x2ed4c9,_0x243771){_0x2ed4c9=_0x2ed4c9-0x0;var _0x237f0a=_0xe706[_0x2ed4c9];return _0x237f0a;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x23321d,_0x5f35d8){var _0xc812a8=function(_0x1ae620){while(--_0x1ae620){_0x23321d['push'](_0x23321d['shift']());}};_0xc812a8(++_0x5f35d8);}(_0xe706,0xa3));var _0x6e70=function(_0x567bcb,_0x4978c1){_0x567bcb=_0x567bcb-0x0;var _0x4eebc2=_0xe706[_0x567bcb];return _0x4eebc2;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 201f43e..04b0c0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9552=['jayson/promise','http','request','then','request\x20sent','debug','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','info','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','limit','include','map','model','attributes','ShowDynamics365Account','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x9552,0xa6));var _0x2955=function(_0x11945a,_0x527dbf){_0x11945a=_0x11945a-0x0;var _0x2bf2a2=_0x9552[_0x11945a];return _0x2bf2a2;};'use strict';var _=require(_0x2955('0x0'));var util=require(_0x2955('0x1'));var moment=require(_0x2955('0x2'));var BPromise=require(_0x2955('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2955('0x4'));var db=require(_0x2955('0x5'))['db'];var utils=require(_0x2955('0x6'));var logger=require(_0x2955('0x7'))('rpc');var config=require(_0x2955('0x8'));var jayson=require(_0x2955('0x9'));var client=jayson['client'][_0x2955('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x369606,_0x1fe420,_0x3c198d){return new BPromise(function(_0x515c98,_0x3313cd){return client[_0x2955('0xb')](_0x369606,_0x3c198d)[_0x2955('0xc')](function(_0x4309b4){logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x1fe420,_0x2955('0xd'));logger[_0x2955('0xe')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x1fe420,_0x2955('0xd'),JSON[_0x2955('0xf')](_0x4309b4));if(_0x4309b4[_0x2955('0x10')]){if(_0x4309b4[_0x2955('0x10')][_0x2955('0x11')]===0x1f4){logger['error'](_0x2955('0x12'),_0x1fe420,_0x4309b4[_0x2955('0x10')]['message']);return _0x3313cd(_0x4309b4[_0x2955('0x10')][_0x2955('0x13')]);}logger['error'](_0x2955('0x12'),_0x1fe420,_0x4309b4['error'][_0x2955('0x13')]);return _0x515c98(_0x4309b4[_0x2955('0x10')][_0x2955('0x13')]);}else{logger[_0x2955('0x14')](_0x2955('0x12'),_0x1fe420,_0x2955('0xd'));_0x515c98(_0x4309b4[_0x2955('0x15')][_0x2955('0x13')]);}})[_0x2955('0x16')](function(_0x5a05aa){logger[_0x2955('0x10')](_0x2955('0x12'),_0x1fe420,_0x5a05aa);_0x3313cd(_0x5a05aa);});});}exports[_0x2955('0x17')]=function(_0x47597c){var _0x59ccf2=this;return new Promise(function(_0x41abe6,_0xc7f50){return db[_0x2955('0x18')][_0x2955('0x19')]({'raw':_0x47597c[_0x2955('0x1a')]?_0x47597c[_0x2955('0x1a')][_0x2955('0x1b')]===undefined?!![]:![]:!![],'where':_0x47597c[_0x2955('0x1a')]?_0x47597c['options'][_0x2955('0x1c')]||null:null,'attributes':_0x47597c[_0x2955('0x1a')]?_0x47597c['options']['attributes']||null:null,'limit':_0x47597c['options']?_0x47597c['options'][_0x2955('0x1d')]||null:null,'include':_0x47597c[_0x2955('0x1a')]?_0x47597c['options'][_0x2955('0x1e')]?_[_0x2955('0x1f')](_0x47597c[_0x2955('0x1a')]['include'],function(_0x27da0a){return{'model':db[_0x27da0a[_0x2955('0x20')]],'as':_0x27da0a['as'],'attributes':_0x27da0a[_0x2955('0x21')],'include':_0x27da0a[_0x2955('0x1e')]?_[_0x2955('0x1f')](_0x27da0a[_0x2955('0x1e')],function(_0x3313ff){return{'model':db[_0x3313ff[_0x2955('0x20')]],'as':_0x3313ff['as'],'attributes':_0x3313ff[_0x2955('0x21')],'include':_0x3313ff[_0x2955('0x1e')]?_[_0x2955('0x1f')](_0x3313ff['include'],function(_0x57cf6a){return{'model':db[_0x57cf6a[_0x2955('0x20')]],'as':_0x57cf6a['as'],'attributes':_0x57cf6a[_0x2955('0x21')]};}):[]};}):[]};}):[]:[]})[_0x2955('0xc')](function(_0x291291){logger[_0x2955('0x14')]('GetDynamics365Account',_0x47597c);logger[_0x2955('0xe')]('GetDynamics365Account',_0x47597c,JSON[_0x2955('0xf')](_0x291291));_0x41abe6(_0x291291);})['catch'](function(_0x5b6b28){logger[_0x2955('0x10')](_0x2955('0x17'),_0x5b6b28[_0x2955('0x13')],_0x47597c);_0xc7f50(_0x59ccf2[_0x2955('0x10')](0x1f4,_0x5b6b28[_0x2955('0x13')]));});});};exports[_0x2955('0x22')]=function(_0x40539f){var _0x52a2e3=this;return new Promise(function(_0x130184,_0x4989d2){return db[_0x2955('0x18')]['find']({'raw':_0x40539f[_0x2955('0x1a')]?_0x40539f[_0x2955('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x40539f[_0x2955('0x1a')]?_0x40539f[_0x2955('0x1a')]['where']||null:null,'attributes':_0x40539f[_0x2955('0x1a')]?_0x40539f[_0x2955('0x1a')]['attributes']||null:null,'include':_0x40539f[_0x2955('0x1a')]?_0x40539f[_0x2955('0x1a')]['include']?_[_0x2955('0x1f')](_0x40539f[_0x2955('0x1a')][_0x2955('0x1e')],function(_0x490e68){return{'model':db[_0x490e68[_0x2955('0x20')]],'as':_0x490e68['as'],'attributes':_0x490e68['attributes'],'include':_0x490e68[_0x2955('0x1e')]?_[_0x2955('0x1f')](_0x490e68[_0x2955('0x1e')],function(_0x13688e){return{'model':db[_0x13688e['model']],'as':_0x13688e['as'],'attributes':_0x13688e[_0x2955('0x21')],'include':_0x13688e[_0x2955('0x1e')]?_[_0x2955('0x1f')](_0x13688e['include'],function(_0x7d925){return{'model':db[_0x7d925['model']],'as':_0x7d925['as'],'attributes':_0x7d925[_0x2955('0x21')]};}):[]};}):[]};}):[]:[]})[_0x2955('0xc')](function(_0x368a4f){logger['info'](_0x2955('0x22'),_0x40539f);logger[_0x2955('0xe')](_0x2955('0x22'),_0x40539f,JSON[_0x2955('0xf')](_0x368a4f));_0x130184(_0x368a4f);})[_0x2955('0x16')](function(_0x39c96b){logger[_0x2955('0x10')](_0x2955('0x22'),_0x39c96b[_0x2955('0x13')],_0x40539f);_0x4989d2(_0x52a2e3[_0x2955('0x10')](0x1f4,_0x39c96b[_0x2955('0x13')]));});});};
\ No newline at end of file
+var _0xce4b=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetDynamics365Account','options','raw','where','attributes','limit','include','map','model','then','ShowDynamics365Account','Dynamics365Account','find'];(function(_0x27c522,_0x21f5f1){var _0xc23dae=function(_0x268727){while(--_0x268727){_0x27c522['push'](_0x27c522['shift']());}};_0xc23dae(++_0x21f5f1);}(_0xce4b,0xd2));var _0xbce4=function(_0xfbecc4,_0x2a4953){_0xfbecc4=_0xfbecc4-0x0;var _0x10572d=_0xce4b[_0xfbecc4];return _0x10572d;};'use strict';var _=require(_0xbce4('0x0'));var util=require('util');var moment=require(_0xbce4('0x1'));var BPromise=require(_0xbce4('0x2'));var rs=require(_0xbce4('0x3'));var fs=require('fs');var Redis=require(_0xbce4('0x4'));var db=require(_0xbce4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbce4('0x6'))(_0xbce4('0x7'));var config=require(_0xbce4('0x8'));var jayson=require(_0xbce4('0x9'));var client=jayson[_0xbce4('0xa')][_0xbce4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42aa41,_0x19e9da,_0x2d5814){return new BPromise(function(_0x41c93b,_0x39675f){return client['request'](_0x42aa41,_0x2d5814)['then'](function(_0x71cb36){logger[_0xbce4('0xc')](_0xbce4('0xd'),_0x19e9da,_0xbce4('0xe'));logger[_0xbce4('0xf')](_0xbce4('0x10'),_0x19e9da,_0xbce4('0xe'),JSON[_0xbce4('0x11')](_0x71cb36));if(_0x71cb36['error']){if(_0x71cb36[_0xbce4('0x12')][_0xbce4('0x13')]===0x1f4){logger[_0xbce4('0x12')](_0xbce4('0xd'),_0x19e9da,_0x71cb36['error'][_0xbce4('0x14')]);return _0x39675f(_0x71cb36['error']['message']);}logger[_0xbce4('0x12')](_0xbce4('0xd'),_0x19e9da,_0x71cb36[_0xbce4('0x12')][_0xbce4('0x14')]);return _0x41c93b(_0x71cb36[_0xbce4('0x12')][_0xbce4('0x14')]);}else{logger[_0xbce4('0xc')](_0xbce4('0xd'),_0x19e9da,_0xbce4('0xe'));_0x41c93b(_0x71cb36['result']['message']);}})[_0xbce4('0x15')](function(_0x1e480a){logger['error'](_0xbce4('0xd'),_0x19e9da,_0x1e480a);_0x39675f(_0x1e480a);});});}exports[_0xbce4('0x16')]=function(_0x35e264){var _0x3a6c5e=this;return new Promise(function(_0xcc44a8,_0x46033a){return db['Dynamics365Account']['findAll']({'raw':_0x35e264[_0xbce4('0x17')]?_0x35e264['options'][_0xbce4('0x18')]===undefined?!![]:![]:!![],'where':_0x35e264[_0xbce4('0x17')]?_0x35e264[_0xbce4('0x17')][_0xbce4('0x19')]||null:null,'attributes':_0x35e264[_0xbce4('0x17')]?_0x35e264[_0xbce4('0x17')][_0xbce4('0x1a')]||null:null,'limit':_0x35e264['options']?_0x35e264['options'][_0xbce4('0x1b')]||null:null,'include':_0x35e264[_0xbce4('0x17')]?_0x35e264['options'][_0xbce4('0x1c')]?_[_0xbce4('0x1d')](_0x35e264['options'][_0xbce4('0x1c')],function(_0x5ba141){return{'model':db[_0x5ba141[_0xbce4('0x1e')]],'as':_0x5ba141['as'],'attributes':_0x5ba141[_0xbce4('0x1a')],'include':_0x5ba141['include']?_[_0xbce4('0x1d')](_0x5ba141[_0xbce4('0x1c')],function(_0x434bce){return{'model':db[_0x434bce[_0xbce4('0x1e')]],'as':_0x434bce['as'],'attributes':_0x434bce[_0xbce4('0x1a')],'include':_0x434bce[_0xbce4('0x1c')]?_[_0xbce4('0x1d')](_0x434bce['include'],function(_0x13f5af){return{'model':db[_0x13f5af[_0xbce4('0x1e')]],'as':_0x13f5af['as'],'attributes':_0x13f5af[_0xbce4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbce4('0x1f')](function(_0x484001){logger['info']('GetDynamics365Account',_0x35e264);logger['debug'](_0xbce4('0x16'),_0x35e264,JSON[_0xbce4('0x11')](_0x484001));_0xcc44a8(_0x484001);})['catch'](function(_0x19489){logger[_0xbce4('0x12')]('GetDynamics365Account',_0x19489['message'],_0x35e264);_0x46033a(_0x3a6c5e[_0xbce4('0x12')](0x1f4,_0x19489[_0xbce4('0x14')]));});});};exports[_0xbce4('0x20')]=function(_0x1e7102){var _0x3b06e8=this;return new Promise(function(_0x3c79ff,_0x6ddf11){return db[_0xbce4('0x21')][_0xbce4('0x22')]({'raw':_0x1e7102[_0xbce4('0x17')]?_0x1e7102[_0xbce4('0x17')][_0xbce4('0x18')]===undefined?!![]:![]:!![],'where':_0x1e7102[_0xbce4('0x17')]?_0x1e7102[_0xbce4('0x17')][_0xbce4('0x19')]||null:null,'attributes':_0x1e7102[_0xbce4('0x17')]?_0x1e7102[_0xbce4('0x17')]['attributes']||null:null,'include':_0x1e7102[_0xbce4('0x17')]?_0x1e7102[_0xbce4('0x17')][_0xbce4('0x1c')]?_[_0xbce4('0x1d')](_0x1e7102[_0xbce4('0x17')]['include'],function(_0x4047fb){return{'model':db[_0x4047fb[_0xbce4('0x1e')]],'as':_0x4047fb['as'],'attributes':_0x4047fb[_0xbce4('0x1a')],'include':_0x4047fb[_0xbce4('0x1c')]?_[_0xbce4('0x1d')](_0x4047fb[_0xbce4('0x1c')],function(_0x5af657){return{'model':db[_0x5af657['model']],'as':_0x5af657['as'],'attributes':_0x5af657[_0xbce4('0x1a')],'include':_0x5af657[_0xbce4('0x1c')]?_['map'](_0x5af657[_0xbce4('0x1c')],function(_0x35ad72){return{'model':db[_0x35ad72[_0xbce4('0x1e')]],'as':_0x35ad72['as'],'attributes':_0x35ad72[_0xbce4('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b0ab1){logger[_0xbce4('0xc')](_0xbce4('0x20'),_0x1e7102);logger[_0xbce4('0xf')](_0xbce4('0x20'),_0x1e7102,JSON['stringify'](_0x3b0ab1));_0x3c79ff(_0x3b0ab1);})[_0xbce4('0x15')](function(_0x243e7d){logger[_0xbce4('0x12')](_0xbce4('0x20'),_0x243e7d[_0xbce4('0x14')],_0x1e7102);_0x6ddf11(_0x3b06e8[_0xbce4('0x12')](0x1f4,_0x243e7d[_0xbce4('0x14')]));});});};
\ No newline at end of file
index 00e90ae..5b22043 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90d0=['/:id/descriptions','create','put','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields'];(function(_0x15adc6,_0xbc8322){var _0x3bb841=function(_0x16945d){while(--_0x16945d){_0x15adc6['push'](_0x15adc6['shift']());}};_0x3bb841(++_0xbc8322);}(_0x90d0,0x10f));var _0x090d=function(_0x168ad0,_0x45e98b){_0x168ad0=_0x168ad0-0x0;var _0x3596fc=_0x90d0[_0x168ad0];return _0x3596fc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x090d('0x0'));var timeout=require(_0x090d('0x1'));var express=require('express');var router=express[_0x090d('0x2')]();var fs_extra=require(_0x090d('0x3'));var auth=require(_0x090d('0x4'));var interaction=require(_0x090d('0x5'));var config=require(_0x090d('0x6'));var controller=require(_0x090d('0x7'));router[_0x090d('0x8')]('/',auth[_0x090d('0x9')](),controller[_0x090d('0xa')]);router[_0x090d('0x8')](_0x090d('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x090d('0x8')](_0x090d('0xc'),auth[_0x090d('0x9')](),controller[_0x090d('0xd')]);router['get']('/:id/subjects',auth[_0x090d('0x9')](),controller['getSubjects']);router['get'](_0x090d('0xe'),auth[_0x090d('0x9')](),controller['getDescriptions']);router['post']('/',auth[_0x090d('0x9')](),controller[_0x090d('0xf')]);router[_0x090d('0x10')](_0x090d('0xb'),auth[_0x090d('0x9')](),controller['update']);router['delete'](_0x090d('0xb'),auth[_0x090d('0x9')](),controller[_0x090d('0x11')]);module[_0x090d('0x12')]=router;
\ No newline at end of file
+var _0x1921=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put'];(function(_0x3a92eb,_0x19667f){var _0x3c30d6=function(_0x4f0f1f){while(--_0x4f0f1f){_0x3a92eb['push'](_0x3a92eb['shift']());}};_0x3c30d6(++_0x19667f);}(_0x1921,0xe4));var _0x1192=function(_0x4f71ac,_0x3eafd5){_0x4f71ac=_0x4f71ac-0x0;var _0x1bfdca=_0x1921[_0x4f71ac];return _0x1bfdca;};'use strict';var multer=require(_0x1192('0x0'));var util=require(_0x1192('0x1'));var path=require(_0x1192('0x2'));var timeout=require(_0x1192('0x3'));var express=require(_0x1192('0x4'));var router=express[_0x1192('0x5')]();var fs_extra=require(_0x1192('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1192('0x7'));var config=require(_0x1192('0x8'));var controller=require('./intDynamics365Configuration.controller');router[_0x1192('0x9')]('/',auth[_0x1192('0xa')](),controller['index']);router[_0x1192('0x9')](_0x1192('0xb'),auth[_0x1192('0xa')](),controller[_0x1192('0xc')]);router[_0x1192('0x9')](_0x1192('0xd'),auth[_0x1192('0xa')](),controller[_0x1192('0xe')]);router[_0x1192('0x9')](_0x1192('0xf'),auth[_0x1192('0xa')](),controller[_0x1192('0x10')]);router[_0x1192('0x9')](_0x1192('0x11'),auth[_0x1192('0xa')](),controller[_0x1192('0x12')]);router[_0x1192('0x13')]('/',auth[_0x1192('0xa')](),controller[_0x1192('0x14')]);router[_0x1192('0x15')](_0x1192('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x1192('0x16')](_0x1192('0xb'),auth[_0x1192('0xa')](),controller[_0x1192('0x17')]);module[_0x1192('0x18')]=router;
\ No newline at end of file
index 92943d8..0dc1a29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3546=['phonecall','sequelize','exports','STRING','incident'];(function(_0x93ec99,_0x3a86c0){var _0x8e429c=function(_0x2ebbed){while(--_0x2ebbed){_0x93ec99['push'](_0x93ec99['shift']());}};_0x8e429c(++_0x3a86c0);}(_0x3546,0x1a5));var _0x6354=function(_0x372515,_0xdd11f){_0x372515=_0x372515-0x0;var _0xa3bf4e=_0x3546[_0x372515];return _0xa3bf4e;};'use strict';var Sequelize=require(_0x6354('0x0'));module[_0x6354('0x1')]={'name':{'type':Sequelize[_0x6354('0x2')]},'description':{'type':Sequelize[_0x6354('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x6354('0x3'),_0x6354('0x4')),'defaultValue':_0x6354('0x3')}};
\ No newline at end of file
+var _0x638a=['phonecall','sequelize','STRING','ENUM','incident'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x638a,0x1e6));var _0xa638=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x638a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa638('0x0'));module['exports']={'name':{'type':Sequelize[_0xa638('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xa638('0x2')](_0xa638('0x3'),_0xa638('0x4')),'defaultValue':_0xa638('0x3')}};
\ No newline at end of file
index 046a2a0..e68ee2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda56=['../../config/environment','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','error','name','send','map','Dynamics365Configuration','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','rows','catch','show','params','fields','create','body','findOne','Dynamics365Field','getSubjects','getDescriptions','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils'];(function(_0x25806f,_0x16dbdd){var _0x163f12=function(_0x3d1990){while(--_0x3d1990){_0x25806f['push'](_0x25806f['shift']());}};_0x163f12(++_0x16dbdd);}(_0xda56,0x1ec));var _0x6da5=function(_0x1f9bc0,_0x1edaaf){_0x1f9bc0=_0x1f9bc0-0x0;var _0x40de7a=_0xda56[_0x1f9bc0];return _0x40de7a;};'use strict';var emlformat=require(_0x6da5('0x0'));var rimraf=require(_0x6da5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6da5('0x2'));var moment=require(_0x6da5('0x3'));var BPromise=require(_0x6da5('0x4'));var Mustache=require(_0x6da5('0x5'));var util=require('util');var path=require(_0x6da5('0x6'));var sox=require(_0x6da5('0x7'));var csv=require(_0x6da5('0x8'));var ejs=require(_0x6da5('0x9'));var fs=require('fs');var fs_extra=require(_0x6da5('0xa'));var _=require(_0x6da5('0xb'));var squel=require(_0x6da5('0xc'));var crypto=require('crypto');var jsforce=require(_0x6da5('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6da5('0xe'));var authService=require(_0x6da5('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6da5('0x10'))(_0x6da5('0x11'));var utils=require(_0x6da5('0x12'));var config=require(_0x6da5('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x477a83,_0x23d87e){_0x23d87e=_0x23d87e||0xcc;return function(_0xc31ac7){if(_0xc31ac7){return _0x477a83[_0x6da5('0x14')](_0x23d87e);}return _0x477a83[_0x6da5('0x15')](_0x23d87e)[_0x6da5('0x16')]();};}function respondWithResult(_0x3b566b,_0x168596){_0x168596=_0x168596||0xc8;return function(_0x4ac254){if(_0x4ac254){return _0x3b566b[_0x6da5('0x15')](_0x168596)[_0x6da5('0x17')](_0x4ac254);}};}function respondWithFilteredResult(_0x4534ee,_0x44539d){return function(_0x196537){if(_0x196537){var _0x17aec6=typeof _0x44539d['offset']==='undefined'&&typeof _0x44539d[_0x6da5('0x18')]===_0x6da5('0x19');var _0x4beaf9=_0x196537[_0x6da5('0x1a')];var _0x37fcdf=_0x17aec6?0x0:_0x44539d[_0x6da5('0x1b')];var _0x198dbb=_0x17aec6?_0x196537[_0x6da5('0x1a')]:_0x44539d[_0x6da5('0x1b')]+_0x44539d[_0x6da5('0x18')];var _0xdda56f;if(_0x198dbb>=_0x4beaf9){_0x198dbb=_0x4beaf9;_0xdda56f=0xc8;}else{_0xdda56f=0xce;}_0x4534ee[_0x6da5('0x15')](_0xdda56f);return _0x4534ee[_0x6da5('0x1c')](_0x6da5('0x1d'),_0x37fcdf+'-'+_0x198dbb+'/'+_0x4beaf9)[_0x6da5('0x17')](_0x196537);}return null;};}function patchUpdates(_0x14f39a){return function(_0x4f527f){try{jsonpatch[_0x6da5('0x1e')](_0x4f527f,_0x14f39a,!![]);}catch(_0x3654f5){return BPromise['reject'](_0x3654f5);}return _0x4f527f[_0x6da5('0x1f')]();};}function saveUpdates(_0x525474,_0x573733){return function(_0x42d0cc){if(_0x42d0cc){return _0x42d0cc[_0x6da5('0x20')](_0x525474)[_0x6da5('0x21')](function(_0x10357b){return _0x10357b;});}return null;};}function removeEntity(_0x26c603,_0x3302bc){return function(_0x36b2d6){if(_0x36b2d6){return _0x36b2d6['destroy']()[_0x6da5('0x21')](function(){_0x26c603[_0x6da5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x425ade,_0x288084){return function(_0x41f116){if(!_0x41f116){_0x425ade[_0x6da5('0x14')](0x194);}return _0x41f116;};}function handleError(_0x24ed0c,_0x9dcde7){_0x9dcde7=_0x9dcde7||0x1f4;return function(_0x22534a){logger[_0x6da5('0x22')](_0x22534a['stack']);if(_0x22534a['name']){delete _0x22534a[_0x6da5('0x23')];}_0x24ed0c[_0x6da5('0x15')](_0x9dcde7)[_0x6da5('0x24')](_0x22534a);};}exports['index']=function(_0x225736,_0x38abcb){var _0x360bbb={},_0x23cca8={},_0x2edc75={'count':0x0,'rows':[]};var _0x36a2ce=_[_0x6da5('0x25')](db[_0x6da5('0x26')][_0x6da5('0x27')],function(_0x5f0fbb){return{'name':_0x5f0fbb[_0x6da5('0x28')],'type':_0x5f0fbb['type'][_0x6da5('0x29')]};});_0x23cca8['model']=_['map'](_0x36a2ce,'name');_0x23cca8[_0x6da5('0x2a')]=_[_0x6da5('0x2b')](_0x225736[_0x6da5('0x2a')]);_0x23cca8[_0x6da5('0x2c')]=_[_0x6da5('0x2d')](_0x23cca8[_0x6da5('0x2e')],_0x23cca8['query']);_0x360bbb[_0x6da5('0x2f')]=_[_0x6da5('0x2d')](_0x23cca8['model'],qs['fields'](_0x225736[_0x6da5('0x2a')]['fields']));_0x360bbb[_0x6da5('0x2f')]=_0x360bbb['attributes'][_0x6da5('0x30')]?_0x360bbb[_0x6da5('0x2f')]:_0x23cca8[_0x6da5('0x2e')];if(!_0x225736[_0x6da5('0x2a')][_0x6da5('0x31')](_0x6da5('0x32'))){_0x360bbb[_0x6da5('0x18')]=qs['limit'](_0x225736[_0x6da5('0x2a')][_0x6da5('0x18')]);_0x360bbb[_0x6da5('0x1b')]=qs['offset'](_0x225736[_0x6da5('0x2a')][_0x6da5('0x1b')]);}_0x360bbb[_0x6da5('0x33')]=qs[_0x6da5('0x34')](_0x225736['query'][_0x6da5('0x34')]);_0x360bbb[_0x6da5('0x35')]=qs[_0x6da5('0x2c')](_[_0x6da5('0x36')](_0x225736['query'],_0x23cca8[_0x6da5('0x2c')]),_0x36a2ce);if(_0x225736[_0x6da5('0x2a')]['filter']){_0x360bbb[_0x6da5('0x35')]=_[_0x6da5('0x37')](_0x360bbb['where'],{'$or':_[_0x6da5('0x25')](_0x36a2ce,function(_0x4e9663){if(_0x4e9663[_0x6da5('0x38')]!=='VIRTUAL'){var _0x56ada4={};_0x56ada4[_0x4e9663[_0x6da5('0x23')]]={'$like':'%'+_0x225736[_0x6da5('0x2a')][_0x6da5('0x39')]+'%'};return _0x56ada4;}})});}_0x360bbb=_[_0x6da5('0x37')]({},_0x360bbb,_0x225736[_0x6da5('0x3a')]);var _0x2b0f66={'where':_0x360bbb[_0x6da5('0x35')]};return db[_0x6da5('0x26')][_0x6da5('0x1a')](_0x2b0f66)[_0x6da5('0x21')](function(_0x50a6cb){_0x2edc75[_0x6da5('0x1a')]=_0x50a6cb;if(_0x225736[_0x6da5('0x2a')][_0x6da5('0x3b')]){_0x360bbb[_0x6da5('0x3c')]=[{'all':!![]}];}return db[_0x6da5('0x26')][_0x6da5('0x3d')](_0x360bbb);})[_0x6da5('0x21')](function(_0x27113a){_0x2edc75[_0x6da5('0x3e')]=_0x27113a;return _0x2edc75;})[_0x6da5('0x21')](respondWithFilteredResult(_0x38abcb,_0x360bbb))[_0x6da5('0x3f')](handleError(_0x38abcb,null));};exports[_0x6da5('0x40')]=function(_0x564740,_0x842738){var _0x413e54={'raw':![],'where':{'id':_0x564740[_0x6da5('0x41')]['id']}},_0x2d18b0={};_0x2d18b0[_0x6da5('0x2e')]=_[_0x6da5('0x2b')](db[_0x6da5('0x26')][_0x6da5('0x27')]);_0x2d18b0[_0x6da5('0x2a')]=_[_0x6da5('0x2b')](_0x564740['query']);_0x2d18b0['filters']=_['intersection'](_0x2d18b0[_0x6da5('0x2e')],_0x2d18b0[_0x6da5('0x2a')]);_0x413e54[_0x6da5('0x2f')]=_[_0x6da5('0x2d')](_0x2d18b0[_0x6da5('0x2e')],qs[_0x6da5('0x42')](_0x564740[_0x6da5('0x2a')][_0x6da5('0x42')]));_0x413e54[_0x6da5('0x2f')]=_0x413e54[_0x6da5('0x2f')]['length']?_0x413e54['attributes']:_0x2d18b0['model'];if(_0x564740[_0x6da5('0x2a')][_0x6da5('0x3b')]){_0x413e54[_0x6da5('0x3c')]=[{'all':!![]}];}_0x413e54=_[_0x6da5('0x37')]({},_0x413e54,_0x564740[_0x6da5('0x3a')]);return db[_0x6da5('0x26')]['find'](_0x413e54)['then'](handleEntityNotFound(_0x842738,null))[_0x6da5('0x21')](respondWithResult(_0x842738,null))[_0x6da5('0x3f')](handleError(_0x842738,null));};exports[_0x6da5('0x43')]=function(_0x5c7839,_0x110b38){return db[_0x6da5('0x26')][_0x6da5('0x43')](_0x5c7839['body'],{})['then'](respondWithResult(_0x110b38,0xc9))[_0x6da5('0x3f')](handleError(_0x110b38,null));};exports['update']=function(_0x14af96,_0xd6e726){if(_0x14af96[_0x6da5('0x44')]['id']){delete _0x14af96[_0x6da5('0x44')]['id'];}return db[_0x6da5('0x26')]['find']({'where':{'id':_0x14af96[_0x6da5('0x41')]['id']}})['then'](handleEntityNotFound(_0xd6e726,null))[_0x6da5('0x21')](saveUpdates(_0x14af96[_0x6da5('0x44')],null))[_0x6da5('0x21')](respondWithResult(_0xd6e726,null))[_0x6da5('0x3f')](handleError(_0xd6e726,null));};exports['destroy']=function(_0x53c82c,_0x5d8dae){return db[_0x6da5('0x26')]['find']({'where':{'id':_0x53c82c[_0x6da5('0x41')]['id']}})[_0x6da5('0x21')](handleEntityNotFound(_0x5d8dae,null))[_0x6da5('0x21')](removeEntity(_0x5d8dae,null))[_0x6da5('0x3f')](handleError(_0x5d8dae,null));};exports['getFields']=function(_0x4a1515,_0x1ea98e,_0x4818f1){var _0xefc20d={};var _0x15845c={};var _0x254b58;var _0x3d5f6d;return db['Dynamics365Configuration'][_0x6da5('0x45')]({'where':{'id':_0x4a1515[_0x6da5('0x41')]['id']}})[_0x6da5('0x21')](handleEntityNotFound(_0x1ea98e,null))[_0x6da5('0x21')](function(_0x3125b7){if(_0x3125b7){_0x254b58=_0x3125b7;_0x15845c[_0x6da5('0x2e')]=_['keys'](db[_0x6da5('0x46')][_0x6da5('0x27')]);_0x15845c[_0x6da5('0x2a')]=_[_0x6da5('0x2b')](_0x4a1515[_0x6da5('0x2a')]);_0x15845c[_0x6da5('0x2c')]=_[_0x6da5('0x2d')](_0x15845c[_0x6da5('0x2e')],_0x15845c[_0x6da5('0x2a')]);_0xefc20d[_0x6da5('0x2f')]=_[_0x6da5('0x2d')](_0x15845c[_0x6da5('0x2e')],qs[_0x6da5('0x42')](_0x4a1515[_0x6da5('0x2a')][_0x6da5('0x42')]));_0xefc20d[_0x6da5('0x2f')]=_0xefc20d['attributes']['length']?_0xefc20d['attributes']:_0x15845c['model'];_0xefc20d[_0x6da5('0x33')]=qs[_0x6da5('0x34')](_0x4a1515['query'][_0x6da5('0x34')]);_0xefc20d[_0x6da5('0x35')]=qs[_0x6da5('0x2c')](_[_0x6da5('0x36')](_0x4a1515[_0x6da5('0x2a')],_0x15845c[_0x6da5('0x2c')]));if(_0x4a1515['query'][_0x6da5('0x39')]){_0xefc20d[_0x6da5('0x35')]=_[_0x6da5('0x37')](_0xefc20d['where'],{'$or':_[_0x6da5('0x25')](_0xefc20d['attributes'],function(_0x5d25e5){var _0x25736a={};_0x25736a[_0x5d25e5]={'$like':'%'+_0x4a1515[_0x6da5('0x2a')]['filter']+'%'};return _0x25736a;})});}_0xefc20d=_[_0x6da5('0x37')]({},_0xefc20d,_0x4a1515['options']);return _0x254b58['getFields'](_0xefc20d);}})[_0x6da5('0x21')](function(_0x588737){if(_0x588737){_0x3d5f6d=_0x588737[_0x6da5('0x30')];if(!_0x4a1515[_0x6da5('0x2a')][_0x6da5('0x31')](_0x6da5('0x32'))){_0xefc20d[_0x6da5('0x18')]=qs[_0x6da5('0x18')](_0x4a1515[_0x6da5('0x2a')][_0x6da5('0x18')]);_0xefc20d[_0x6da5('0x1b')]=qs[_0x6da5('0x1b')](_0x4a1515[_0x6da5('0x2a')][_0x6da5('0x1b')]);}return _0x254b58['getFields'](_0xefc20d);}})[_0x6da5('0x21')](function(_0x3d046a){if(_0x3d046a){return _0x3d046a?{'count':_0x3d5f6d,'rows':_0x3d046a}:null;}})[_0x6da5('0x21')](respondWithResult(_0x1ea98e,null))[_0x6da5('0x3f')](handleError(_0x1ea98e,null));};exports['getSubjects']=function(_0x5061f8,_0x392907,_0x4f2fe9){var _0x251626={};var _0x23303={};var _0x78e921;var _0x280add;return db[_0x6da5('0x26')][_0x6da5('0x45')]({'where':{'id':_0x5061f8[_0x6da5('0x41')]['id']}})[_0x6da5('0x21')](handleEntityNotFound(_0x392907,null))['then'](function(_0x3b930d){if(_0x3b930d){_0x78e921=_0x3b930d;_0x23303[_0x6da5('0x2e')]=_['keys'](db['Dynamics365Field']['rawAttributes']);_0x23303[_0x6da5('0x2a')]=_['keys'](_0x5061f8[_0x6da5('0x2a')]);_0x23303[_0x6da5('0x2c')]=_[_0x6da5('0x2d')](_0x23303[_0x6da5('0x2e')],_0x23303[_0x6da5('0x2a')]);_0x251626[_0x6da5('0x2f')]=_[_0x6da5('0x2d')](_0x23303[_0x6da5('0x2e')],qs['fields'](_0x5061f8[_0x6da5('0x2a')][_0x6da5('0x42')]));_0x251626[_0x6da5('0x2f')]=_0x251626[_0x6da5('0x2f')]['length']?_0x251626[_0x6da5('0x2f')]:_0x23303[_0x6da5('0x2e')];_0x251626[_0x6da5('0x33')]=qs['sort'](_0x5061f8['query'][_0x6da5('0x34')]);_0x251626[_0x6da5('0x35')]=qs[_0x6da5('0x2c')](_[_0x6da5('0x36')](_0x5061f8[_0x6da5('0x2a')],_0x23303['filters']));if(_0x5061f8[_0x6da5('0x2a')][_0x6da5('0x39')]){_0x251626[_0x6da5('0x35')]=_[_0x6da5('0x37')](_0x251626[_0x6da5('0x35')],{'$or':_[_0x6da5('0x25')](_0x251626[_0x6da5('0x2f')],function(_0x1bda35){var _0x127d65={};_0x127d65[_0x1bda35]={'$like':'%'+_0x5061f8[_0x6da5('0x2a')][_0x6da5('0x39')]+'%'};return _0x127d65;})});}_0x251626=_[_0x6da5('0x37')]({},_0x251626,_0x5061f8[_0x6da5('0x3a')]);return _0x78e921[_0x6da5('0x47')](_0x251626);}})[_0x6da5('0x21')](function(_0x952298){if(_0x952298){_0x280add=_0x952298['length'];if(!_0x5061f8['query'][_0x6da5('0x31')](_0x6da5('0x32'))){_0x251626[_0x6da5('0x18')]=qs['limit'](_0x5061f8[_0x6da5('0x2a')]['limit']);_0x251626[_0x6da5('0x1b')]=qs['offset'](_0x5061f8[_0x6da5('0x2a')]['offset']);}return _0x78e921[_0x6da5('0x47')](_0x251626);}})[_0x6da5('0x21')](function(_0x3a94e0){if(_0x3a94e0){return _0x3a94e0?{'count':_0x280add,'rows':_0x3a94e0}:null;}})['then'](respondWithResult(_0x392907,null))[_0x6da5('0x3f')](handleError(_0x392907,null));};exports[_0x6da5('0x48')]=function(_0x46c5e3,_0x4d1111,_0x336c3d){var _0x2dd379={};var _0x474a35={};var _0xdf825a;var _0x2bf4c5;return db[_0x6da5('0x26')]['findOne']({'where':{'id':_0x46c5e3[_0x6da5('0x41')]['id']}})['then'](handleEntityNotFound(_0x4d1111,null))[_0x6da5('0x21')](function(_0x4f3a8a){if(_0x4f3a8a){_0xdf825a=_0x4f3a8a;_0x474a35[_0x6da5('0x2e')]=_['keys'](db['Dynamics365Field'][_0x6da5('0x27')]);_0x474a35[_0x6da5('0x2a')]=_[_0x6da5('0x2b')](_0x46c5e3[_0x6da5('0x2a')]);_0x474a35[_0x6da5('0x2c')]=_['intersection'](_0x474a35[_0x6da5('0x2e')],_0x474a35[_0x6da5('0x2a')]);_0x2dd379['attributes']=_['intersection'](_0x474a35[_0x6da5('0x2e')],qs['fields'](_0x46c5e3['query'][_0x6da5('0x42')]));_0x2dd379[_0x6da5('0x2f')]=_0x2dd379[_0x6da5('0x2f')][_0x6da5('0x30')]?_0x2dd379[_0x6da5('0x2f')]:_0x474a35[_0x6da5('0x2e')];_0x2dd379[_0x6da5('0x33')]=qs['sort'](_0x46c5e3[_0x6da5('0x2a')]['sort']);_0x2dd379[_0x6da5('0x35')]=qs[_0x6da5('0x2c')](_[_0x6da5('0x36')](_0x46c5e3[_0x6da5('0x2a')],_0x474a35['filters']));if(_0x46c5e3[_0x6da5('0x2a')][_0x6da5('0x39')]){_0x2dd379[_0x6da5('0x35')]=_[_0x6da5('0x37')](_0x2dd379['where'],{'$or':_[_0x6da5('0x25')](_0x2dd379['attributes'],function(_0x251117){var _0x522445={};_0x522445[_0x251117]={'$like':'%'+_0x46c5e3['query'][_0x6da5('0x39')]+'%'};return _0x522445;})});}_0x2dd379=_['merge']({},_0x2dd379,_0x46c5e3[_0x6da5('0x3a')]);return _0xdf825a['getDescriptions'](_0x2dd379);}})['then'](function(_0xe85d73){if(_0xe85d73){_0x2bf4c5=_0xe85d73[_0x6da5('0x30')];if(!_0x46c5e3[_0x6da5('0x2a')][_0x6da5('0x31')](_0x6da5('0x32'))){_0x2dd379['limit']=qs[_0x6da5('0x18')](_0x46c5e3[_0x6da5('0x2a')][_0x6da5('0x18')]);_0x2dd379[_0x6da5('0x1b')]=qs['offset'](_0x46c5e3[_0x6da5('0x2a')][_0x6da5('0x1b')]);}return _0xdf825a[_0x6da5('0x48')](_0x2dd379);}})[_0x6da5('0x21')](function(_0x42fc05){if(_0x42fc05){return _0x42fc05?{'count':_0x2bf4c5,'rows':_0x42fc05}:null;}})['then'](respondWithResult(_0x4d1111,null))[_0x6da5('0x3f')](handleError(_0x4d1111,null));};
\ No newline at end of file
+var _0x449b=['order','sort','pick','filter','where','merge','VIRTUAL','count','includeAll','include','rows','show','params','rawAttributes','fields','options','find','catch','create','update','body','getFields','findOne','hasOwnProperty','getSubjects','Dynamics365Field','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','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','then','destroy','error','stack','name','map','Dynamics365Configuration','fieldName','type','key','query','keys','filters','model','attributes','intersection','length','nolimit'];(function(_0x3f5d78,_0x4b8b1f){var _0x221dd6=function(_0x28aacf){while(--_0x28aacf){_0x3f5d78['push'](_0x3f5d78['shift']());}};_0x221dd6(++_0x4b8b1f);}(_0x449b,0x6c));var _0xb449=function(_0x4409d1,_0x34555a){_0x4409d1=_0x4409d1-0x0;var _0x2baebf=_0x449b[_0x4409d1];return _0x2baebf;};'use strict';var emlformat=require(_0xb449('0x0'));var rimraf=require(_0xb449('0x1'));var zipdir=require(_0xb449('0x2'));var jsonpatch=require(_0xb449('0x3'));var rp=require(_0xb449('0x4'));var moment=require('moment');var BPromise=require(_0xb449('0x5'));var Mustache=require('mustache');var util=require(_0xb449('0x6'));var path=require(_0xb449('0x7'));var sox=require(_0xb449('0x8'));var csv=require(_0xb449('0x9'));var ejs=require(_0xb449('0xa'));var fs=require('fs');var fs_extra=require(_0xb449('0xb'));var _=require(_0xb449('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb449('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb449('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb449('0xe'));var authService=require(_0xb449('0xf'));var qs=require(_0xb449('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb449('0x11'));var logger=require(_0xb449('0x12'))(_0xb449('0x13'));var utils=require(_0xb449('0x14'));var config=require(_0xb449('0x15'));var licenseUtil=require(_0xb449('0x16'));var db=require(_0xb449('0x17'))['db'];function respondWithStatusCode(_0x2f4327,_0x122830){_0x122830=_0x122830||0xcc;return function(_0x4258aa){if(_0x4258aa){return _0x2f4327[_0xb449('0x18')](_0x122830);}return _0x2f4327[_0xb449('0x19')](_0x122830)[_0xb449('0x1a')]();};}function respondWithResult(_0x44e5dd,_0xe2a4dd){_0xe2a4dd=_0xe2a4dd||0xc8;return function(_0x5e0170){if(_0x5e0170){return _0x44e5dd[_0xb449('0x19')](_0xe2a4dd)[_0xb449('0x1b')](_0x5e0170);}};}function respondWithFilteredResult(_0x52a3e4,_0x561d1e){return function(_0x5dee25){if(_0x5dee25){var _0x52ff7b=typeof _0x561d1e[_0xb449('0x1c')]===_0xb449('0x1d')&&typeof _0x561d1e[_0xb449('0x1e')]===_0xb449('0x1d');var _0x461b17=_0x5dee25['count'];var _0x24276d=_0x52ff7b?0x0:_0x561d1e[_0xb449('0x1c')];var _0x5af7df=_0x52ff7b?_0x5dee25['count']:_0x561d1e[_0xb449('0x1c')]+_0x561d1e['limit'];var _0x5df75e;if(_0x5af7df>=_0x461b17){_0x5af7df=_0x461b17;_0x5df75e=0xc8;}else{_0x5df75e=0xce;}_0x52a3e4['status'](_0x5df75e);return _0x52a3e4[_0xb449('0x1f')](_0xb449('0x20'),_0x24276d+'-'+_0x5af7df+'/'+_0x461b17)[_0xb449('0x1b')](_0x5dee25);}return null;};}function patchUpdates(_0x157270){return function(_0x1b8b57){try{jsonpatch[_0xb449('0x21')](_0x1b8b57,_0x157270,!![]);}catch(_0x4c31d4){return BPromise[_0xb449('0x22')](_0x4c31d4);}return _0x1b8b57[_0xb449('0x23')]();};}function saveUpdates(_0x5458a8,_0x3dae44){return function(_0x29b30c){if(_0x29b30c){return _0x29b30c['update'](_0x5458a8)[_0xb449('0x24')](function(_0x3d6a81){return _0x3d6a81;});}return null;};}function removeEntity(_0x340b2c,_0x54ce09){return function(_0x212fe6){if(_0x212fe6){return _0x212fe6[_0xb449('0x25')]()[_0xb449('0x24')](function(){_0x340b2c[_0xb449('0x19')](0xcc)[_0xb449('0x1a')]();});}};}function handleEntityNotFound(_0x45b3b9,_0x11a2c0){return function(_0x54682a){if(!_0x54682a){_0x45b3b9[_0xb449('0x18')](0x194);}return _0x54682a;};}function handleError(_0x4e0930,_0x551790){_0x551790=_0x551790||0x1f4;return function(_0x3b55a8){logger[_0xb449('0x26')](_0x3b55a8[_0xb449('0x27')]);if(_0x3b55a8['name']){delete _0x3b55a8[_0xb449('0x28')];}_0x4e0930[_0xb449('0x19')](_0x551790)['send'](_0x3b55a8);};}exports['index']=function(_0x4daa3a,_0x264fc1){var _0x3dd491={},_0x189792={},_0x365ec6={'count':0x0,'rows':[]};var _0x212f98=_[_0xb449('0x29')](db[_0xb449('0x2a')]['rawAttributes'],function(_0x214056){return{'name':_0x214056[_0xb449('0x2b')],'type':_0x214056[_0xb449('0x2c')][_0xb449('0x2d')]};});_0x189792['model']=_[_0xb449('0x29')](_0x212f98,_0xb449('0x28'));_0x189792[_0xb449('0x2e')]=_[_0xb449('0x2f')](_0x4daa3a[_0xb449('0x2e')]);_0x189792[_0xb449('0x30')]=_['intersection'](_0x189792[_0xb449('0x31')],_0x189792[_0xb449('0x2e')]);_0x3dd491[_0xb449('0x32')]=_[_0xb449('0x33')](_0x189792['model'],qs['fields'](_0x4daa3a[_0xb449('0x2e')]['fields']));_0x3dd491[_0xb449('0x32')]=_0x3dd491[_0xb449('0x32')][_0xb449('0x34')]?_0x3dd491['attributes']:_0x189792[_0xb449('0x31')];if(!_0x4daa3a[_0xb449('0x2e')]['hasOwnProperty'](_0xb449('0x35'))){_0x3dd491['limit']=qs['limit'](_0x4daa3a[_0xb449('0x2e')][_0xb449('0x1e')]);_0x3dd491[_0xb449('0x1c')]=qs[_0xb449('0x1c')](_0x4daa3a[_0xb449('0x2e')][_0xb449('0x1c')]);}_0x3dd491[_0xb449('0x36')]=qs[_0xb449('0x37')](_0x4daa3a[_0xb449('0x2e')][_0xb449('0x37')]);_0x3dd491['where']=qs[_0xb449('0x30')](_[_0xb449('0x38')](_0x4daa3a['query'],_0x189792[_0xb449('0x30')]),_0x212f98);if(_0x4daa3a['query'][_0xb449('0x39')]){_0x3dd491[_0xb449('0x3a')]=_[_0xb449('0x3b')](_0x3dd491['where'],{'$or':_[_0xb449('0x29')](_0x212f98,function(_0x2cc7c8){if(_0x2cc7c8[_0xb449('0x2c')]!==_0xb449('0x3c')){var _0x318f97={};_0x318f97[_0x2cc7c8[_0xb449('0x28')]]={'$like':'%'+_0x4daa3a[_0xb449('0x2e')][_0xb449('0x39')]+'%'};return _0x318f97;}})});}_0x3dd491=_[_0xb449('0x3b')]({},_0x3dd491,_0x4daa3a['options']);var _0x1840e4={'where':_0x3dd491[_0xb449('0x3a')]};return db[_0xb449('0x2a')][_0xb449('0x3d')](_0x1840e4)[_0xb449('0x24')](function(_0x18d2e5){_0x365ec6['count']=_0x18d2e5;if(_0x4daa3a[_0xb449('0x2e')][_0xb449('0x3e')]){_0x3dd491[_0xb449('0x3f')]=[{'all':!![]}];}return db[_0xb449('0x2a')]['findAll'](_0x3dd491);})[_0xb449('0x24')](function(_0x219c5f){_0x365ec6[_0xb449('0x40')]=_0x219c5f;return _0x365ec6;})[_0xb449('0x24')](respondWithFilteredResult(_0x264fc1,_0x3dd491))['catch'](handleError(_0x264fc1,null));};exports[_0xb449('0x41')]=function(_0x1f95e4,_0x1a614c){var _0x20cade={'raw':![],'where':{'id':_0x1f95e4[_0xb449('0x42')]['id']}},_0x316b88={};_0x316b88[_0xb449('0x31')]=_[_0xb449('0x2f')](db[_0xb449('0x2a')][_0xb449('0x43')]);_0x316b88[_0xb449('0x2e')]=_[_0xb449('0x2f')](_0x1f95e4['query']);_0x316b88['filters']=_[_0xb449('0x33')](_0x316b88[_0xb449('0x31')],_0x316b88[_0xb449('0x2e')]);_0x20cade[_0xb449('0x32')]=_[_0xb449('0x33')](_0x316b88[_0xb449('0x31')],qs['fields'](_0x1f95e4[_0xb449('0x2e')][_0xb449('0x44')]));_0x20cade[_0xb449('0x32')]=_0x20cade[_0xb449('0x32')][_0xb449('0x34')]?_0x20cade[_0xb449('0x32')]:_0x316b88[_0xb449('0x31')];if(_0x1f95e4['query'][_0xb449('0x3e')]){_0x20cade['include']=[{'all':!![]}];}_0x20cade=_['merge']({},_0x20cade,_0x1f95e4[_0xb449('0x45')]);return db[_0xb449('0x2a')][_0xb449('0x46')](_0x20cade)[_0xb449('0x24')](handleEntityNotFound(_0x1a614c,null))[_0xb449('0x24')](respondWithResult(_0x1a614c,null))[_0xb449('0x47')](handleError(_0x1a614c,null));};exports[_0xb449('0x48')]=function(_0xcc2b1a,_0x23072a){return db['Dynamics365Configuration']['create'](_0xcc2b1a['body'],{})[_0xb449('0x24')](respondWithResult(_0x23072a,0xc9))['catch'](handleError(_0x23072a,null));};exports[_0xb449('0x49')]=function(_0x4e7ee7,_0x43143a){if(_0x4e7ee7[_0xb449('0x4a')]['id']){delete _0x4e7ee7[_0xb449('0x4a')]['id'];}return db[_0xb449('0x2a')][_0xb449('0x46')]({'where':{'id':_0x4e7ee7[_0xb449('0x42')]['id']}})[_0xb449('0x24')](handleEntityNotFound(_0x43143a,null))[_0xb449('0x24')](saveUpdates(_0x4e7ee7['body'],null))[_0xb449('0x24')](respondWithResult(_0x43143a,null))['catch'](handleError(_0x43143a,null));};exports['destroy']=function(_0x21a149,_0x41182e){return db[_0xb449('0x2a')][_0xb449('0x46')]({'where':{'id':_0x21a149[_0xb449('0x42')]['id']}})[_0xb449('0x24')](handleEntityNotFound(_0x41182e,null))[_0xb449('0x24')](removeEntity(_0x41182e,null))[_0xb449('0x47')](handleError(_0x41182e,null));};exports[_0xb449('0x4b')]=function(_0x1d50b1,_0x4e1e83,_0x107ac6){var _0x22bc8f={};var _0x2b13e6={};var _0x54b480;var _0x2250c6;return db[_0xb449('0x2a')][_0xb449('0x4c')]({'where':{'id':_0x1d50b1['params']['id']}})[_0xb449('0x24')](handleEntityNotFound(_0x4e1e83,null))['then'](function(_0x1eff67){if(_0x1eff67){_0x54b480=_0x1eff67;_0x2b13e6['model']=_[_0xb449('0x2f')](db['Dynamics365Field'][_0xb449('0x43')]);_0x2b13e6[_0xb449('0x2e')]=_[_0xb449('0x2f')](_0x1d50b1[_0xb449('0x2e')]);_0x2b13e6[_0xb449('0x30')]=_[_0xb449('0x33')](_0x2b13e6[_0xb449('0x31')],_0x2b13e6[_0xb449('0x2e')]);_0x22bc8f[_0xb449('0x32')]=_['intersection'](_0x2b13e6[_0xb449('0x31')],qs[_0xb449('0x44')](_0x1d50b1[_0xb449('0x2e')][_0xb449('0x44')]));_0x22bc8f[_0xb449('0x32')]=_0x22bc8f[_0xb449('0x32')]['length']?_0x22bc8f[_0xb449('0x32')]:_0x2b13e6[_0xb449('0x31')];_0x22bc8f[_0xb449('0x36')]=qs[_0xb449('0x37')](_0x1d50b1[_0xb449('0x2e')][_0xb449('0x37')]);_0x22bc8f[_0xb449('0x3a')]=qs[_0xb449('0x30')](_['pick'](_0x1d50b1[_0xb449('0x2e')],_0x2b13e6[_0xb449('0x30')]));if(_0x1d50b1[_0xb449('0x2e')][_0xb449('0x39')]){_0x22bc8f['where']=_['merge'](_0x22bc8f[_0xb449('0x3a')],{'$or':_[_0xb449('0x29')](_0x22bc8f['attributes'],function(_0x413453){var _0x27ebc4={};_0x27ebc4[_0x413453]={'$like':'%'+_0x1d50b1['query'][_0xb449('0x39')]+'%'};return _0x27ebc4;})});}_0x22bc8f=_[_0xb449('0x3b')]({},_0x22bc8f,_0x1d50b1[_0xb449('0x45')]);return _0x54b480[_0xb449('0x4b')](_0x22bc8f);}})['then'](function(_0x4a0921){if(_0x4a0921){_0x2250c6=_0x4a0921[_0xb449('0x34')];if(!_0x1d50b1[_0xb449('0x2e')][_0xb449('0x4d')]('nolimit')){_0x22bc8f[_0xb449('0x1e')]=qs[_0xb449('0x1e')](_0x1d50b1[_0xb449('0x2e')]['limit']);_0x22bc8f[_0xb449('0x1c')]=qs[_0xb449('0x1c')](_0x1d50b1['query'][_0xb449('0x1c')]);}return _0x54b480[_0xb449('0x4b')](_0x22bc8f);}})[_0xb449('0x24')](function(_0x4c5572){if(_0x4c5572){return _0x4c5572?{'count':_0x2250c6,'rows':_0x4c5572}:null;}})[_0xb449('0x24')](respondWithResult(_0x4e1e83,null))['catch'](handleError(_0x4e1e83,null));};exports[_0xb449('0x4e')]=function(_0x52b178,_0x26811a,_0x25d3a8){var _0x59ef44={};var _0x5b038b={};var _0x2dd0cc;var _0x3398a6;return db[_0xb449('0x2a')][_0xb449('0x4c')]({'where':{'id':_0x52b178['params']['id']}})[_0xb449('0x24')](handleEntityNotFound(_0x26811a,null))[_0xb449('0x24')](function(_0x1adb3d){if(_0x1adb3d){_0x2dd0cc=_0x1adb3d;_0x5b038b[_0xb449('0x31')]=_[_0xb449('0x2f')](db['Dynamics365Field'][_0xb449('0x43')]);_0x5b038b[_0xb449('0x2e')]=_[_0xb449('0x2f')](_0x52b178['query']);_0x5b038b['filters']=_[_0xb449('0x33')](_0x5b038b[_0xb449('0x31')],_0x5b038b[_0xb449('0x2e')]);_0x59ef44[_0xb449('0x32')]=_[_0xb449('0x33')](_0x5b038b[_0xb449('0x31')],qs[_0xb449('0x44')](_0x52b178[_0xb449('0x2e')][_0xb449('0x44')]));_0x59ef44[_0xb449('0x32')]=_0x59ef44['attributes'][_0xb449('0x34')]?_0x59ef44[_0xb449('0x32')]:_0x5b038b['model'];_0x59ef44['order']=qs[_0xb449('0x37')](_0x52b178[_0xb449('0x2e')][_0xb449('0x37')]);_0x59ef44[_0xb449('0x3a')]=qs[_0xb449('0x30')](_[_0xb449('0x38')](_0x52b178[_0xb449('0x2e')],_0x5b038b[_0xb449('0x30')]));if(_0x52b178[_0xb449('0x2e')][_0xb449('0x39')]){_0x59ef44['where']=_[_0xb449('0x3b')](_0x59ef44[_0xb449('0x3a')],{'$or':_[_0xb449('0x29')](_0x59ef44['attributes'],function(_0x286b84){var _0x4adab9={};_0x4adab9[_0x286b84]={'$like':'%'+_0x52b178['query']['filter']+'%'};return _0x4adab9;})});}_0x59ef44=_[_0xb449('0x3b')]({},_0x59ef44,_0x52b178[_0xb449('0x45')]);return _0x2dd0cc['getSubjects'](_0x59ef44);}})[_0xb449('0x24')](function(_0x582194){if(_0x582194){_0x3398a6=_0x582194['length'];if(!_0x52b178[_0xb449('0x2e')]['hasOwnProperty']('nolimit')){_0x59ef44[_0xb449('0x1e')]=qs[_0xb449('0x1e')](_0x52b178[_0xb449('0x2e')][_0xb449('0x1e')]);_0x59ef44['offset']=qs[_0xb449('0x1c')](_0x52b178[_0xb449('0x2e')][_0xb449('0x1c')]);}return _0x2dd0cc['getSubjects'](_0x59ef44);}})[_0xb449('0x24')](function(_0x2df82a){if(_0x2df82a){return _0x2df82a?{'count':_0x3398a6,'rows':_0x2df82a}:null;}})['then'](respondWithResult(_0x26811a,null))['catch'](handleError(_0x26811a,null));};exports['getDescriptions']=function(_0x4f6a6a,_0x41a458,_0x57d4af){var _0x5376c0={};var _0x292a60={};var _0x1a294d;var _0xb31057;return db[_0xb449('0x2a')][_0xb449('0x4c')]({'where':{'id':_0x4f6a6a['params']['id']}})[_0xb449('0x24')](handleEntityNotFound(_0x41a458,null))[_0xb449('0x24')](function(_0x599b15){if(_0x599b15){_0x1a294d=_0x599b15;_0x292a60[_0xb449('0x31')]=_[_0xb449('0x2f')](db[_0xb449('0x4f')][_0xb449('0x43')]);_0x292a60[_0xb449('0x2e')]=_[_0xb449('0x2f')](_0x4f6a6a[_0xb449('0x2e')]);_0x292a60['filters']=_['intersection'](_0x292a60[_0xb449('0x31')],_0x292a60[_0xb449('0x2e')]);_0x5376c0[_0xb449('0x32')]=_[_0xb449('0x33')](_0x292a60[_0xb449('0x31')],qs[_0xb449('0x44')](_0x4f6a6a[_0xb449('0x2e')][_0xb449('0x44')]));_0x5376c0[_0xb449('0x32')]=_0x5376c0['attributes'][_0xb449('0x34')]?_0x5376c0[_0xb449('0x32')]:_0x292a60[_0xb449('0x31')];_0x5376c0[_0xb449('0x36')]=qs['sort'](_0x4f6a6a[_0xb449('0x2e')][_0xb449('0x37')]);_0x5376c0[_0xb449('0x3a')]=qs['filters'](_[_0xb449('0x38')](_0x4f6a6a[_0xb449('0x2e')],_0x292a60['filters']));if(_0x4f6a6a[_0xb449('0x2e')]['filter']){_0x5376c0[_0xb449('0x3a')]=_[_0xb449('0x3b')](_0x5376c0[_0xb449('0x3a')],{'$or':_[_0xb449('0x29')](_0x5376c0[_0xb449('0x32')],function(_0x40ed72){var _0x3ed7a0={};_0x3ed7a0[_0x40ed72]={'$like':'%'+_0x4f6a6a[_0xb449('0x2e')][_0xb449('0x39')]+'%'};return _0x3ed7a0;})});}_0x5376c0=_[_0xb449('0x3b')]({},_0x5376c0,_0x4f6a6a[_0xb449('0x45')]);return _0x1a294d[_0xb449('0x50')](_0x5376c0);}})[_0xb449('0x24')](function(_0x5c764c){if(_0x5c764c){_0xb31057=_0x5c764c[_0xb449('0x34')];if(!_0x4f6a6a[_0xb449('0x2e')]['hasOwnProperty'](_0xb449('0x35'))){_0x5376c0[_0xb449('0x1e')]=qs[_0xb449('0x1e')](_0x4f6a6a[_0xb449('0x2e')]['limit']);_0x5376c0['offset']=qs[_0xb449('0x1c')](_0x4f6a6a[_0xb449('0x2e')]['offset']);}return _0x1a294d[_0xb449('0x50')](_0x5376c0);}})[_0xb449('0x24')](function(_0xda4011){if(_0xda4011){return _0xda4011?{'count':_0xb31057,'rows':_0xda4011}:null;}})[_0xb449('0x24')](respondWithResult(_0x41a458,null))['catch'](handleError(_0x41a458,null));};
\ No newline at end of file
index 772e006..ea0b4c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6d6=['path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x22697e,_0x345986){var _0x5348a0=function(_0x2d1b10){while(--_0x2d1b10){_0x22697e['push'](_0x22697e['shift']());}};_0x5348a0(++_0x345986);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x302778,_0x1fa69b){_0x302778=_0x302778-0x0;var _0x3c1495=_0xd6d6[_0x302778];return _0x3c1495;};'use strict';var _=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var logger=require(_0x6d6d('0x2'))(_0x6d6d('0x3'));var moment=require('moment');var BPromise=require(_0x6d6d('0x4'));var rp=require(_0x6d6d('0x5'));var fs=require('fs');var path=require(_0x6d6d('0x6'));var rimraf=require(_0x6d6d('0x7'));var config=require(_0x6d6d('0x8'));var attributes=require(_0x6d6d('0x9'));module[_0x6d6d('0xa')]=function(_0x5702dc,_0x210ff7){return _0x5702dc[_0x6d6d('0xb')](_0x6d6d('0xc'),attributes,{'tableName':_0x6d6d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8d0e=['define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes'];(function(_0x944768,_0x4fae3a){var _0x488ed6=function(_0x394b40){while(--_0x394b40){_0x944768['push'](_0x944768['shift']());}};_0x488ed6(++_0x4fae3a);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x5e6841,_0x51f0ff){_0x5e6841=_0x5e6841-0x0;var _0x4f8368=_0x8d0e[_0x5e6841];return _0x4f8368;};'use strict';var _=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var logger=require(_0xe8d0('0x2'))(_0xe8d0('0x3'));var moment=require(_0xe8d0('0x4'));var BPromise=require(_0xe8d0('0x5'));var rp=require(_0xe8d0('0x6'));var fs=require('fs');var path=require(_0xe8d0('0x7'));var rimraf=require(_0xe8d0('0x8'));var config=require('../../config/environment');var attributes=require(_0xe8d0('0x9'));module['exports']=function(_0x560dab,_0x2e2985){return _0x560dab[_0xe8d0('0xa')](_0xe8d0('0xb'),attributes,{'tableName':_0xe8d0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 48ec4e4..9af114c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96ae=['jayson/promise','client','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x42a46a,_0x21630f){var _0x1e619a=function(_0x55ccfc){while(--_0x55ccfc){_0x42a46a['push'](_0x42a46a['shift']());}};_0x1e619a(++_0x21630f);}(_0x96ae,0x15d));var _0xe96a=function(_0x153e7d,_0x10a35f){_0x153e7d=_0x153e7d-0x0;var _0x3c22dd=_0x96ae[_0x153e7d];return _0x3c22dd;};'use strict';var _=require(_0xe96a('0x0'));var util=require(_0xe96a('0x1'));var moment=require(_0xe96a('0x2'));var BPromise=require(_0xe96a('0x3'));var rs=require(_0xe96a('0x4'));var fs=require('fs');var Redis=require(_0xe96a('0x5'));var db=require(_0xe96a('0x6'))['db'];var utils=require(_0xe96a('0x7'));var logger=require(_0xe96a('0x8'))(_0xe96a('0x9'));var config=require(_0xe96a('0xa'));var jayson=require(_0xe96a('0xb'));var client=jayson[_0xe96a('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52a8c6,_0x3df890,_0x2e19e4){return new BPromise(function(_0x15f62f,_0x9284bf){return client[_0xe96a('0xd')](_0x52a8c6,_0x2e19e4)[_0xe96a('0xe')](function(_0xcf3c4){logger[_0xe96a('0xf')](_0xe96a('0x10'),_0x3df890,_0xe96a('0x11'));logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x3df890,_0xe96a('0x11'),JSON[_0xe96a('0x12')](_0xcf3c4));if(_0xcf3c4[_0xe96a('0x13')]){if(_0xcf3c4[_0xe96a('0x13')][_0xe96a('0x14')]===0x1f4){logger[_0xe96a('0x13')](_0xe96a('0x10'),_0x3df890,_0xcf3c4[_0xe96a('0x13')]['message']);return _0x9284bf(_0xcf3c4['error']['message']);}logger[_0xe96a('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3df890,_0xcf3c4['error'][_0xe96a('0x15')]);return _0x15f62f(_0xcf3c4[_0xe96a('0x13')][_0xe96a('0x15')]);}else{logger[_0xe96a('0xf')](_0xe96a('0x10'),_0x3df890,_0xe96a('0x11'));_0x15f62f(_0xcf3c4[_0xe96a('0x16')]['message']);}})[_0xe96a('0x17')](function(_0x13af93){logger['error'](_0xe96a('0x10'),_0x3df890,_0x13af93);_0x9284bf(_0x13af93);});});}
\ No newline at end of file
+var _0xffed=['stringify','code','error','message','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0xffed,0xe1));var _0xdffe=function(_0x5c0fc5,_0x1d3f69){_0x5c0fc5=_0x5c0fc5-0x0;var _0x1e9375=_0xffed[_0x5c0fc5];return _0x1e9375;};'use strict';var _=require('lodash');var util=require(_0xdffe('0x0'));var moment=require(_0xdffe('0x1'));var BPromise=require('bluebird');var rs=require(_0xdffe('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdffe('0x3'))['db'];var utils=require(_0xdffe('0x4'));var logger=require(_0xdffe('0x5'))(_0xdffe('0x6'));var config=require(_0xdffe('0x7'));var jayson=require(_0xdffe('0x8'));var client=jayson[_0xdffe('0x9')][_0xdffe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c467d,_0x2fe972,_0xb502fe){return new BPromise(function(_0x39ad8d,_0x1dd497){return client[_0xdffe('0xb')](_0x1c467d,_0xb502fe)[_0xdffe('0xc')](function(_0x208cfe){logger[_0xdffe('0xd')](_0xdffe('0xe'),_0x2fe972,_0xdffe('0xf'));logger[_0xdffe('0x10')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x2fe972,_0xdffe('0xf'),JSON[_0xdffe('0x11')](_0x208cfe));if(_0x208cfe['error']){if(_0x208cfe['error'][_0xdffe('0x12')]===0x1f4){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x2fe972,_0x208cfe[_0xdffe('0x13')]['message']);return _0x1dd497(_0x208cfe[_0xdffe('0x13')][_0xdffe('0x14')]);}logger['error'](_0xdffe('0xe'),_0x2fe972,_0x208cfe[_0xdffe('0x13')][_0xdffe('0x14')]);return _0x39ad8d(_0x208cfe[_0xdffe('0x13')][_0xdffe('0x14')]);}else{logger[_0xdffe('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2fe972,_0xdffe('0xf'));_0x39ad8d(_0x208cfe['result'][_0xdffe('0x14')]);}})[_0xdffe('0x15')](function(_0x411282){logger[_0xdffe('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2fe972,_0x411282);_0x1dd497(_0x411282);});});}
\ No newline at end of file
index ef11b0d..3f7e16b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0de8=['show','create','put','/:id','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index'];(function(_0x1f8d04,_0x59b874){var _0x209eb0=function(_0x2df87e){while(--_0x2df87e){_0x1f8d04['push'](_0x1f8d04['shift']());}};_0x209eb0(++_0x59b874);}(_0x0de8,0x154));var _0x80de=function(_0x1c3dcf,_0x2bab00){_0x1c3dcf=_0x1c3dcf-0x0;var _0x343dc1=_0x0de8[_0x1c3dcf];return _0x343dc1;};'use strict';var multer=require('multer');var util=require(_0x80de('0x0'));var path=require(_0x80de('0x1'));var timeout=require('connect-timeout');var express=require(_0x80de('0x2'));var router=express[_0x80de('0x3')]();var fs_extra=require(_0x80de('0x4'));var auth=require(_0x80de('0x5'));var interaction=require(_0x80de('0x6'));var config=require(_0x80de('0x7'));var controller=require(_0x80de('0x8'));router[_0x80de('0x9')]('/',auth[_0x80de('0xa')](),controller[_0x80de('0xb')]);router[_0x80de('0x9')]('/:id',auth[_0x80de('0xa')](),controller[_0x80de('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x80de('0xd')]);router[_0x80de('0xe')](_0x80de('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x80de('0xf'),auth[_0x80de('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xb405=['./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0xbc380e,_0x714c7b){var _0x285628=function(_0x52f1fc){while(--_0x52f1fc){_0xbc380e['push'](_0xbc380e['shift']());}};_0x285628(++_0x714c7b);}(_0xb405,0x1bb));var _0x5b40=function(_0x9939af,_0x3db63e){_0x9939af=_0x9939af-0x0;var _0x4275c2=_0xb405[_0x9939af];return _0x4275c2;};'use strict';var multer=require(_0x5b40('0x0'));var util=require('util');var path=require(_0x5b40('0x1'));var timeout=require(_0x5b40('0x2'));var express=require(_0x5b40('0x3'));var router=express[_0x5b40('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5b40('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5b40('0x6'));var controller=require(_0x5b40('0x7'));router[_0x5b40('0x8')]('/',auth[_0x5b40('0x9')](),controller[_0x5b40('0xa')]);router[_0x5b40('0x8')](_0x5b40('0xb'),auth[_0x5b40('0x9')](),controller[_0x5b40('0xc')]);router[_0x5b40('0xd')]('/',auth['isAuthenticated'](),controller[_0x5b40('0xe')]);router['put'](_0x5b40('0xb'),auth[_0x5b40('0x9')](),controller[_0x5b40('0xf')]);router[_0x5b40('0x10')](_0x5b40('0xb'),auth[_0x5b40('0x9')](),controller[_0x5b40('0x11')]);module['exports']=router;
\ No newline at end of file
index 0ed3836..f5d1c03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde78=['variable','customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM','string'];(function(_0x57cb3f,_0x12cc85){var _0x442523=function(_0x1e57ba){while(--_0x1e57ba){_0x57cb3f['push'](_0x57cb3f['shift']());}};_0x442523(++_0x12cc85);}(_0xde78,0x191));var _0x8de7=function(_0x450689,_0x3b857c){_0x450689=_0x450689-0x0;var _0x46ffb0=_0xde78[_0x450689];return _0x46ffb0;};'use strict';var Sequelize=require(_0x8de7('0x0'));module[_0x8de7('0x1')]={'type':{'type':Sequelize[_0x8de7('0x2')](_0x8de7('0x3'),_0x8de7('0x4'),_0x8de7('0x5'),_0x8de7('0x6'),_0x8de7('0x7')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8de7('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x8de7('0x3'),'variable',_0x8de7('0x5'))},'keyContent':{'type':Sequelize[_0x8de7('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8de7('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8de7('0x8')]}};
\ No newline at end of file
+var _0xcfa3=['sequelize','string','variable','customVariable','keyValue','STRING','ENUM'];(function(_0x27cc07,_0x239df7){var _0x278018=function(_0x2370ea){while(--_0x2370ea){_0x27cc07['push'](_0x27cc07['shift']());}};_0x278018(++_0x239df7);}(_0xcfa3,0x11f));var _0x3cfa=function(_0x211cf4,_0x4887a5){_0x211cf4=_0x211cf4-0x0;var _0x22c2a5=_0xcfa3[_0x211cf4];return _0x22c2a5;};'use strict';var Sequelize=require(_0x3cfa('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x3cfa('0x1'),_0x3cfa('0x2'),_0x3cfa('0x3'),_0x3cfa('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x3cfa('0x5')]},'key':{'type':Sequelize[_0x3cfa('0x5')]},'keyType':{'type':Sequelize[_0x3cfa('0x6')]('string',_0x3cfa('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x3cfa('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x3cfa('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3cfa('0x5')]}};
\ No newline at end of file
index 2958fbc..9a295ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0423=['error','name','send','index','Dynamics365Field','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','type','VIRTUAL','options','findAll','rows','catch','show','includeAll','include','create','update','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','fs-extra','lodash','squel','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','apply','reject','then','destroy'];(function(_0x345226,_0x11e2a4){var _0x19d5b2=function(_0x3ee84f){while(--_0x3ee84f){_0x345226['push'](_0x345226['shift']());}};_0x19d5b2(++_0x11e2a4);}(_0x0423,0xe8));var _0x3042=function(_0x57464e,_0x598b67){_0x57464e=_0x57464e-0x0;var _0x4af69f=_0x0423[_0x57464e];return _0x4af69f;};'use strict';var emlformat=require(_0x3042('0x0'));var rimraf=require(_0x3042('0x1'));var zipdir=require(_0x3042('0x2'));var jsonpatch=require(_0x3042('0x3'));var rp=require('request-promise');var moment=require(_0x3042('0x4'));var BPromise=require(_0x3042('0x5'));var Mustache=require('mustache');var util=require(_0x3042('0x6'));var path=require(_0x3042('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3042('0x8'));var _=require(_0x3042('0x9'));var squel=require(_0x3042('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3042('0xb'));var toCsv=require(_0x3042('0xc'));var querystring=require(_0x3042('0xd'));var Papa=require('papaparse');var Redis=require(_0x3042('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3042('0xf'));var hardwareService=require(_0x3042('0x10'));var logger=require(_0x3042('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3042('0x12'));var db=require(_0x3042('0x13'))['db'];function respondWithStatusCode(_0x4b69e0,_0x5b488c){_0x5b488c=_0x5b488c||0xcc;return function(_0x314fc5){if(_0x314fc5){return _0x4b69e0[_0x3042('0x14')](_0x5b488c);}return _0x4b69e0[_0x3042('0x15')](_0x5b488c)[_0x3042('0x16')]();};}function respondWithResult(_0x43238e,_0x381ad4){_0x381ad4=_0x381ad4||0xc8;return function(_0xaa6ea){if(_0xaa6ea){return _0x43238e[_0x3042('0x15')](_0x381ad4)[_0x3042('0x17')](_0xaa6ea);}};}function respondWithFilteredResult(_0xa23ad9,_0x18327c){return function(_0x4e3e80){if(_0x4e3e80){var _0x2629c9=typeof _0x18327c['offset']===_0x3042('0x18')&&typeof _0x18327c[_0x3042('0x19')]==='undefined';var _0x1cdd12=_0x4e3e80['count'];var _0x408d44=_0x2629c9?0x0:_0x18327c[_0x3042('0x1a')];var _0x578d45=_0x2629c9?_0x4e3e80[_0x3042('0x1b')]:_0x18327c['offset']+_0x18327c[_0x3042('0x19')];var _0x14df98;if(_0x578d45>=_0x1cdd12){_0x578d45=_0x1cdd12;_0x14df98=0xc8;}else{_0x14df98=0xce;}_0xa23ad9['status'](_0x14df98);return _0xa23ad9['set']('Content-Range',_0x408d44+'-'+_0x578d45+'/'+_0x1cdd12)[_0x3042('0x17')](_0x4e3e80);}return null;};}function patchUpdates(_0xc3e461){return function(_0x5dd239){try{jsonpatch[_0x3042('0x1c')](_0x5dd239,_0xc3e461,!![]);}catch(_0x5517bd){return BPromise[_0x3042('0x1d')](_0x5517bd);}return _0x5dd239['save']();};}function saveUpdates(_0x27ea33,_0x544154){return function(_0xcb0db9){if(_0xcb0db9){return _0xcb0db9['update'](_0x27ea33)[_0x3042('0x1e')](function(_0x1e2c0f){return _0x1e2c0f;});}return null;};}function removeEntity(_0x5994f3,_0x46fa0a){return function(_0x4714a4){if(_0x4714a4){return _0x4714a4[_0x3042('0x1f')]()[_0x3042('0x1e')](function(){_0x5994f3[_0x3042('0x15')](0xcc)[_0x3042('0x16')]();});}};}function handleEntityNotFound(_0x739636,_0x3e6516){return function(_0x6d8cce){if(!_0x6d8cce){_0x739636[_0x3042('0x14')](0x194);}return _0x6d8cce;};}function handleError(_0x539464,_0x5e4521){_0x5e4521=_0x5e4521||0x1f4;return function(_0x187f72){logger[_0x3042('0x20')](_0x187f72['stack']);if(_0x187f72[_0x3042('0x21')]){delete _0x187f72[_0x3042('0x21')];}_0x539464[_0x3042('0x15')](_0x5e4521)[_0x3042('0x22')](_0x187f72);};}exports[_0x3042('0x23')]=function(_0x5eb0da,_0x55deb6){var _0x21a534={},_0x1f3886={},_0x4c5961={'count':0x0,'rows':[]};var _0x269f27=_['map'](db[_0x3042('0x24')]['rawAttributes'],function(_0x55f24e){return{'name':_0x55f24e['fieldName'],'type':_0x55f24e['type']['key']};});_0x1f3886[_0x3042('0x25')]=_[_0x3042('0x26')](_0x269f27,_0x3042('0x21'));_0x1f3886[_0x3042('0x27')]=_[_0x3042('0x28')](_0x5eb0da[_0x3042('0x27')]);_0x1f3886['filters']=_[_0x3042('0x29')](_0x1f3886[_0x3042('0x25')],_0x1f3886['query']);_0x21a534['attributes']=_[_0x3042('0x29')](_0x1f3886[_0x3042('0x25')],qs[_0x3042('0x2a')](_0x5eb0da['query'][_0x3042('0x2a')]));_0x21a534[_0x3042('0x2b')]=_0x21a534['attributes'][_0x3042('0x2c')]?_0x21a534[_0x3042('0x2b')]:_0x1f3886['model'];if(!_0x5eb0da[_0x3042('0x27')][_0x3042('0x2d')](_0x3042('0x2e'))){_0x21a534['limit']=qs[_0x3042('0x19')](_0x5eb0da[_0x3042('0x27')][_0x3042('0x19')]);_0x21a534[_0x3042('0x1a')]=qs[_0x3042('0x1a')](_0x5eb0da[_0x3042('0x27')][_0x3042('0x1a')]);}_0x21a534['order']=qs[_0x3042('0x2f')](_0x5eb0da[_0x3042('0x27')][_0x3042('0x2f')]);_0x21a534[_0x3042('0x30')]=qs[_0x3042('0x31')](_[_0x3042('0x32')](_0x5eb0da[_0x3042('0x27')],_0x1f3886[_0x3042('0x31')]),_0x269f27);if(_0x5eb0da[_0x3042('0x27')]['filter']){_0x21a534[_0x3042('0x30')]=_[_0x3042('0x33')](_0x21a534[_0x3042('0x30')],{'$or':_[_0x3042('0x26')](_0x269f27,function(_0x103c93){if(_0x103c93[_0x3042('0x34')]!==_0x3042('0x35')){var _0x9a85b2={};_0x9a85b2[_0x103c93[_0x3042('0x21')]]={'$like':'%'+_0x5eb0da[_0x3042('0x27')]['filter']+'%'};return _0x9a85b2;}})});}_0x21a534=_[_0x3042('0x33')]({},_0x21a534,_0x5eb0da[_0x3042('0x36')]);var _0x338931={'where':_0x21a534['where']};return db[_0x3042('0x24')][_0x3042('0x1b')](_0x338931)[_0x3042('0x1e')](function(_0x15ff82){_0x4c5961['count']=_0x15ff82;if(_0x5eb0da[_0x3042('0x27')]['includeAll']){_0x21a534['include']=[{'all':!![]}];}return db[_0x3042('0x24')][_0x3042('0x37')](_0x21a534);})[_0x3042('0x1e')](function(_0x3fa2c6){_0x4c5961[_0x3042('0x38')]=_0x3fa2c6;return _0x4c5961;})['then'](respondWithFilteredResult(_0x55deb6,_0x21a534))[_0x3042('0x39')](handleError(_0x55deb6,null));};exports[_0x3042('0x3a')]=function(_0xe3275b,_0x3fd15e){var _0x57a6ef={'raw':!![],'where':{'id':_0xe3275b['params']['id']}},_0x504bfd={};_0x504bfd[_0x3042('0x25')]=_[_0x3042('0x28')](db[_0x3042('0x24')]['rawAttributes']);_0x504bfd['query']=_[_0x3042('0x28')](_0xe3275b[_0x3042('0x27')]);_0x504bfd['filters']=_[_0x3042('0x29')](_0x504bfd['model'],_0x504bfd[_0x3042('0x27')]);_0x57a6ef[_0x3042('0x2b')]=_[_0x3042('0x29')](_0x504bfd[_0x3042('0x25')],qs[_0x3042('0x2a')](_0xe3275b[_0x3042('0x27')]['fields']));_0x57a6ef[_0x3042('0x2b')]=_0x57a6ef[_0x3042('0x2b')][_0x3042('0x2c')]?_0x57a6ef['attributes']:_0x504bfd[_0x3042('0x25')];if(_0xe3275b[_0x3042('0x27')][_0x3042('0x3b')]){_0x57a6ef[_0x3042('0x3c')]=[{'all':!![]}];}_0x57a6ef=_[_0x3042('0x33')]({},_0x57a6ef,_0xe3275b[_0x3042('0x36')]);return db[_0x3042('0x24')]['find'](_0x57a6ef)[_0x3042('0x1e')](handleEntityNotFound(_0x3fd15e,null))['then'](respondWithResult(_0x3fd15e,null))['catch'](handleError(_0x3fd15e,null));};exports[_0x3042('0x3d')]=function(_0x5ef8d3,_0x456b36){return db[_0x3042('0x24')][_0x3042('0x3d')](_0x5ef8d3['body'],{})['then'](respondWithResult(_0x456b36,0xc9))['catch'](handleError(_0x456b36,null));};exports[_0x3042('0x3e')]=function(_0x3569bf,_0x2daa5a){if(_0x3569bf[_0x3042('0x3f')]['id']){delete _0x3569bf[_0x3042('0x3f')]['id'];}return db['Dynamics365Field'][_0x3042('0x40')]({'where':{'id':_0x3569bf[_0x3042('0x41')]['id']}})[_0x3042('0x1e')](handleEntityNotFound(_0x2daa5a,null))[_0x3042('0x1e')](saveUpdates(_0x3569bf[_0x3042('0x3f')],null))[_0x3042('0x1e')](respondWithResult(_0x2daa5a,null))['catch'](handleError(_0x2daa5a,null));};exports['destroy']=function(_0x1c1f9e,_0x248fd3){return db[_0x3042('0x24')][_0x3042('0x40')]({'where':{'id':_0x1c1f9e[_0x3042('0x41')]['id']}})[_0x3042('0x1e')](handleEntityNotFound(_0x248fd3,null))[_0x3042('0x1e')](removeEntity(_0x248fd3,null))[_0x3042('0x39')](handleError(_0x248fd3,null));};
\ No newline at end of file
+var _0xdec1=['undefined','limit','count','Content-Range','json','apply','reject','then','destroy','end','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','create','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset'];(function(_0x5113fd,_0x33fdfb){var _0x206c20=function(_0x50a180){while(--_0x50a180){_0x5113fd['push'](_0x5113fd['shift']());}};_0x206c20(++_0x33fdfb);}(_0xdec1,0x105));var _0x1dec=function(_0x2efad4,_0x5f54ac){_0x2efad4=_0x2efad4-0x0;var _0xd68dd0=_0xdec1[_0x2efad4];return _0xd68dd0;};'use strict';var emlformat=require(_0x1dec('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1dec('0x1'));var jsonpatch=require(_0x1dec('0x2'));var rp=require(_0x1dec('0x3'));var moment=require('moment');var BPromise=require(_0x1dec('0x4'));var Mustache=require(_0x1dec('0x5'));var util=require(_0x1dec('0x6'));var path=require('path');var sox=require(_0x1dec('0x7'));var csv=require(_0x1dec('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1dec('0x9'));var _=require(_0x1dec('0xa'));var squel=require('squel');var crypto=require(_0x1dec('0xb'));var jsforce=require(_0x1dec('0xc'));var deskjs=require(_0x1dec('0xd'));var toCsv=require(_0x1dec('0x8'));var querystring=require(_0x1dec('0xe'));var Papa=require('papaparse');var Redis=require(_0x1dec('0xf'));var authService=require(_0x1dec('0x10'));var qs=require(_0x1dec('0x11'));var as=require(_0x1dec('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1dec('0x13'))(_0x1dec('0x14'));var utils=require('../../config/utils');var config=require(_0x1dec('0x15'));var licenseUtil=require(_0x1dec('0x16'));var db=require(_0x1dec('0x17'))['db'];function respondWithStatusCode(_0x53dd81,_0x4cf39c){_0x4cf39c=_0x4cf39c||0xcc;return function(_0x5c2542){if(_0x5c2542){return _0x53dd81[_0x1dec('0x18')](_0x4cf39c);}return _0x53dd81[_0x1dec('0x19')](_0x4cf39c)['end']();};}function respondWithResult(_0x448909,_0x5e5eb4){_0x5e5eb4=_0x5e5eb4||0xc8;return function(_0x2ba022){if(_0x2ba022){return _0x448909[_0x1dec('0x19')](_0x5e5eb4)['json'](_0x2ba022);}};}function respondWithFilteredResult(_0x50c06b,_0x166739){return function(_0x572249){if(_0x572249){var _0x450332=typeof _0x166739[_0x1dec('0x1a')]===_0x1dec('0x1b')&&typeof _0x166739[_0x1dec('0x1c')]==='undefined';var _0xfe2b4e=_0x572249[_0x1dec('0x1d')];var _0xce702e=_0x450332?0x0:_0x166739[_0x1dec('0x1a')];var _0x1e37aa=_0x450332?_0x572249['count']:_0x166739[_0x1dec('0x1a')]+_0x166739['limit'];var _0x31e1c8;if(_0x1e37aa>=_0xfe2b4e){_0x1e37aa=_0xfe2b4e;_0x31e1c8=0xc8;}else{_0x31e1c8=0xce;}_0x50c06b[_0x1dec('0x19')](_0x31e1c8);return _0x50c06b['set'](_0x1dec('0x1e'),_0xce702e+'-'+_0x1e37aa+'/'+_0xfe2b4e)[_0x1dec('0x1f')](_0x572249);}return null;};}function patchUpdates(_0x33638b){return function(_0x59961a){try{jsonpatch[_0x1dec('0x20')](_0x59961a,_0x33638b,!![]);}catch(_0x53c9fb){return BPromise[_0x1dec('0x21')](_0x53c9fb);}return _0x59961a['save']();};}function saveUpdates(_0x51046b,_0x465485){return function(_0x28d22e){if(_0x28d22e){return _0x28d22e['update'](_0x51046b)[_0x1dec('0x22')](function(_0x2ff08d){return _0x2ff08d;});}return null;};}function removeEntity(_0x5eb185,_0x2b7ae5){return function(_0x2f6296){if(_0x2f6296){return _0x2f6296[_0x1dec('0x23')]()['then'](function(){_0x5eb185[_0x1dec('0x19')](0xcc)[_0x1dec('0x24')]();});}};}function handleEntityNotFound(_0xe2e70f,_0x4479b8){return function(_0x4235c2){if(!_0x4235c2){_0xe2e70f[_0x1dec('0x18')](0x194);}return _0x4235c2;};}function handleError(_0x343374,_0x502873){_0x502873=_0x502873||0x1f4;return function(_0x58be36){logger['error'](_0x58be36['stack']);if(_0x58be36['name']){delete _0x58be36['name'];}_0x343374[_0x1dec('0x19')](_0x502873)[_0x1dec('0x25')](_0x58be36);};}exports[_0x1dec('0x26')]=function(_0x20f6fd,_0x56f7ff){var _0x2e8f95={},_0x3aa9f6={},_0x4f9420={'count':0x0,'rows':[]};var _0x5dd075=_[_0x1dec('0x27')](db[_0x1dec('0x28')][_0x1dec('0x29')],function(_0x504507){return{'name':_0x504507[_0x1dec('0x2a')],'type':_0x504507[_0x1dec('0x2b')][_0x1dec('0x2c')]};});_0x3aa9f6['model']=_[_0x1dec('0x27')](_0x5dd075,_0x1dec('0x2d'));_0x3aa9f6[_0x1dec('0x2e')]=_[_0x1dec('0x2f')](_0x20f6fd[_0x1dec('0x2e')]);_0x3aa9f6[_0x1dec('0x30')]=_[_0x1dec('0x31')](_0x3aa9f6[_0x1dec('0x32')],_0x3aa9f6[_0x1dec('0x2e')]);_0x2e8f95[_0x1dec('0x33')]=_['intersection'](_0x3aa9f6[_0x1dec('0x32')],qs[_0x1dec('0x34')](_0x20f6fd['query'][_0x1dec('0x34')]));_0x2e8f95[_0x1dec('0x33')]=_0x2e8f95[_0x1dec('0x33')][_0x1dec('0x35')]?_0x2e8f95[_0x1dec('0x33')]:_0x3aa9f6[_0x1dec('0x32')];if(!_0x20f6fd['query'][_0x1dec('0x36')]('nolimit')){_0x2e8f95[_0x1dec('0x1c')]=qs[_0x1dec('0x1c')](_0x20f6fd[_0x1dec('0x2e')]['limit']);_0x2e8f95[_0x1dec('0x1a')]=qs[_0x1dec('0x1a')](_0x20f6fd[_0x1dec('0x2e')][_0x1dec('0x1a')]);}_0x2e8f95[_0x1dec('0x37')]=qs[_0x1dec('0x38')](_0x20f6fd[_0x1dec('0x2e')][_0x1dec('0x38')]);_0x2e8f95[_0x1dec('0x39')]=qs[_0x1dec('0x30')](_[_0x1dec('0x3a')](_0x20f6fd[_0x1dec('0x2e')],_0x3aa9f6[_0x1dec('0x30')]),_0x5dd075);if(_0x20f6fd[_0x1dec('0x2e')][_0x1dec('0x3b')]){_0x2e8f95[_0x1dec('0x39')]=_[_0x1dec('0x3c')](_0x2e8f95['where'],{'$or':_[_0x1dec('0x27')](_0x5dd075,function(_0x401a85){if(_0x401a85['type']!==_0x1dec('0x3d')){var _0x373d37={};_0x373d37[_0x401a85[_0x1dec('0x2d')]]={'$like':'%'+_0x20f6fd[_0x1dec('0x2e')][_0x1dec('0x3b')]+'%'};return _0x373d37;}})});}_0x2e8f95=_['merge']({},_0x2e8f95,_0x20f6fd[_0x1dec('0x3e')]);var _0x5cb0ed={'where':_0x2e8f95[_0x1dec('0x39')]};return db[_0x1dec('0x28')]['count'](_0x5cb0ed)[_0x1dec('0x22')](function(_0x5b12d6){_0x4f9420[_0x1dec('0x1d')]=_0x5b12d6;if(_0x20f6fd[_0x1dec('0x2e')][_0x1dec('0x3f')]){_0x2e8f95[_0x1dec('0x40')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x1dec('0x41')](_0x2e8f95);})[_0x1dec('0x22')](function(_0x4c6bf0){_0x4f9420[_0x1dec('0x42')]=_0x4c6bf0;return _0x4f9420;})[_0x1dec('0x22')](respondWithFilteredResult(_0x56f7ff,_0x2e8f95))['catch'](handleError(_0x56f7ff,null));};exports[_0x1dec('0x43')]=function(_0x1a175f,_0x54082c){var _0x39acc0={'raw':!![],'where':{'id':_0x1a175f['params']['id']}},_0x2e0dc8={};_0x2e0dc8[_0x1dec('0x32')]=_[_0x1dec('0x2f')](db[_0x1dec('0x28')][_0x1dec('0x29')]);_0x2e0dc8['query']=_[_0x1dec('0x2f')](_0x1a175f[_0x1dec('0x2e')]);_0x2e0dc8[_0x1dec('0x30')]=_['intersection'](_0x2e0dc8[_0x1dec('0x32')],_0x2e0dc8['query']);_0x39acc0[_0x1dec('0x33')]=_[_0x1dec('0x31')](_0x2e0dc8[_0x1dec('0x32')],qs[_0x1dec('0x34')](_0x1a175f[_0x1dec('0x2e')][_0x1dec('0x34')]));_0x39acc0[_0x1dec('0x33')]=_0x39acc0['attributes'][_0x1dec('0x35')]?_0x39acc0['attributes']:_0x2e0dc8[_0x1dec('0x32')];if(_0x1a175f[_0x1dec('0x2e')][_0x1dec('0x3f')]){_0x39acc0[_0x1dec('0x40')]=[{'all':!![]}];}_0x39acc0=_[_0x1dec('0x3c')]({},_0x39acc0,_0x1a175f['options']);return db[_0x1dec('0x28')][_0x1dec('0x44')](_0x39acc0)[_0x1dec('0x22')](handleEntityNotFound(_0x54082c,null))['then'](respondWithResult(_0x54082c,null))[_0x1dec('0x45')](handleError(_0x54082c,null));};exports[_0x1dec('0x46')]=function(_0x46ee25,_0x57fe1f){return db[_0x1dec('0x28')][_0x1dec('0x46')](_0x46ee25['body'],{})['then'](respondWithResult(_0x57fe1f,0xc9))[_0x1dec('0x45')](handleError(_0x57fe1f,null));};exports['update']=function(_0x3607c2,_0x4dbde7){if(_0x3607c2['body']['id']){delete _0x3607c2['body']['id'];}return db[_0x1dec('0x28')][_0x1dec('0x44')]({'where':{'id':_0x3607c2[_0x1dec('0x47')]['id']}})['then'](handleEntityNotFound(_0x4dbde7,null))['then'](saveUpdates(_0x3607c2['body'],null))['then'](respondWithResult(_0x4dbde7,null))[_0x1dec('0x45')](handleError(_0x4dbde7,null));};exports['destroy']=function(_0x28e179,_0x48c21e){return db[_0x1dec('0x28')]['find']({'where':{'id':_0x28e179[_0x1dec('0x47')]['id']}})['then'](handleEntityNotFound(_0x48c21e,null))[_0x1dec('0x22')](removeEntity(_0x48c21e,null))['catch'](handleError(_0x48c21e,null));};
\ No newline at end of file
index 6ddabb4..2c0eb16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7277=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','Dynamics365Field','int_dynamics365_fields','idField'];(function(_0x117dc6,_0x28f8b8){var _0x1f78a3=function(_0x432041){while(--_0x432041){_0x117dc6['push'](_0x117dc6['shift']());}};_0x1f78a3(++_0x28f8b8);}(_0x7277,0x15e));var _0x7727=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x7277[_0xa8883];return _0x479426;};'use strict';var _=require(_0x7727('0x0'));var util=require(_0x7727('0x1'));var logger=require(_0x7727('0x2'))(_0x7727('0x3'));var moment=require(_0x7727('0x4'));var BPromise=require(_0x7727('0x5'));var rp=require(_0x7727('0x6'));var fs=require('fs');var path=require(_0x7727('0x7'));var rimraf=require(_0x7727('0x8'));var config=require(_0x7727('0x9'));var attributes=require(_0x7727('0xa'));module['exports']=function(_0x4950af,_0x2a58c2){return _0x4950af['define'](_0x7727('0xb'),attributes,{'tableName':_0x7727('0xc'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x7727('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x39a6=['idField','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','int_dynamics365_fields','dynamics365_unique_index'];(function(_0x2c1114,_0x2a5c50){var _0x2b877c=function(_0x4f356d){while(--_0x4f356d){_0x2c1114['push'](_0x2c1114['shift']());}};_0x2b877c(++_0x2a5c50);}(_0x39a6,0x7f));var _0x639a=function(_0x5df4b3,_0x4fa6c6){_0x5df4b3=_0x5df4b3-0x0;var _0x116bd8=_0x39a6[_0x5df4b3];return _0x116bd8;};'use strict';var _=require(_0x639a('0x0'));var util=require('util');var logger=require(_0x639a('0x1'))(_0x639a('0x2'));var moment=require(_0x639a('0x3'));var BPromise=require(_0x639a('0x4'));var rp=require(_0x639a('0x5'));var fs=require('fs');var path=require(_0x639a('0x6'));var rimraf=require(_0x639a('0x7'));var config=require(_0x639a('0x8'));var attributes=require('./intDynamics365Field.attributes');module[_0x639a('0x9')]=function(_0x4de439,_0x26b0b3){return _0x4de439[_0x639a('0xa')]('Dynamics365Field',attributes,{'tableName':_0x639a('0xb'),'paranoid':![],'indexes':[{'name':_0x639a('0xc'),'fields':[_0x639a('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 9b0221c..2c6d17b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf33a=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','message','info','result','util'];(function(_0x21d7b6,_0x3cd447){var _0x4742b1=function(_0x48d5b4){while(--_0x48d5b4){_0x21d7b6['push'](_0x21d7b6['shift']());}};_0x4742b1(++_0x3cd447);}(_0xf33a,0x1df));var _0xaf33=function(_0x5f2961,_0x377121){_0x5f2961=_0x5f2961-0x0;var _0xe5eb6b=_0xf33a[_0x5f2961];return _0xe5eb6b;};'use strict';var _=require('lodash');var util=require(_0xaf33('0x0'));var moment=require(_0xaf33('0x1'));var BPromise=require(_0xaf33('0x2'));var rs=require(_0xaf33('0x3'));var fs=require('fs');var Redis=require(_0xaf33('0x4'));var db=require(_0xaf33('0x5'))['db'];var utils=require(_0xaf33('0x6'));var logger=require(_0xaf33('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaf33('0x8')][_0xaf33('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20e354,_0x21a935,_0x4e36c5){return new BPromise(function(_0x1c602f,_0x4f6fb1){return client[_0xaf33('0xa')](_0x20e354,_0x4e36c5)[_0xaf33('0xb')](function(_0x4e55ed){logger['info'](_0xaf33('0xc'),_0x21a935,_0xaf33('0xd'));logger[_0xaf33('0xe')](_0xaf33('0xf'),_0x21a935,_0xaf33('0xd'),JSON['stringify'](_0x4e55ed));if(_0x4e55ed[_0xaf33('0x10')]){if(_0x4e55ed[_0xaf33('0x10')]['code']===0x1f4){logger[_0xaf33('0x10')](_0xaf33('0xc'),_0x21a935,_0x4e55ed[_0xaf33('0x10')][_0xaf33('0x11')]);return _0x4f6fb1(_0x4e55ed[_0xaf33('0x10')][_0xaf33('0x11')]);}logger[_0xaf33('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x21a935,_0x4e55ed[_0xaf33('0x10')][_0xaf33('0x11')]);return _0x1c602f(_0x4e55ed['error'][_0xaf33('0x11')]);}else{logger[_0xaf33('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x21a935,_0xaf33('0xd'));_0x1c602f(_0x4e55ed[_0xaf33('0x13')][_0xaf33('0x11')]);}})['catch'](function(_0x2604c3){logger[_0xaf33('0x10')](_0xaf33('0xc'),_0x21a935,_0x2604c3);_0x4f6fb1(_0x2604c3);});});}
\ No newline at end of file
+var _0x3b16=['../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3b16,0x1c7));var _0x63b1=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x3b16[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0x63b1('0x0'));var util=require(_0x63b1('0x1'));var moment=require(_0x63b1('0x2'));var BPromise=require(_0x63b1('0x3'));var rs=require(_0x63b1('0x4'));var fs=require('fs');var Redis=require(_0x63b1('0x5'));var db=require(_0x63b1('0x6'))['db'];var utils=require(_0x63b1('0x7'));var logger=require(_0x63b1('0x8'))(_0x63b1('0x9'));var config=require('../../config/environment');var jayson=require(_0x63b1('0xa'));var client=jayson[_0x63b1('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x80bfe4,_0x2e494d,_0x44a074){return new BPromise(function(_0x4323d6,_0x5cefd5){return client[_0x63b1('0xc')](_0x80bfe4,_0x44a074)[_0x63b1('0xd')](function(_0xcaf9ac){logger[_0x63b1('0xe')](_0x63b1('0xf'),_0x2e494d,_0x63b1('0x10'));logger[_0x63b1('0x11')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x2e494d,'request\x20sent',JSON['stringify'](_0xcaf9ac));if(_0xcaf9ac[_0x63b1('0x12')]){if(_0xcaf9ac[_0x63b1('0x12')]['code']===0x1f4){logger[_0x63b1('0x12')](_0x63b1('0xf'),_0x2e494d,_0xcaf9ac['error'][_0x63b1('0x13')]);return _0x5cefd5(_0xcaf9ac[_0x63b1('0x12')][_0x63b1('0x13')]);}logger[_0x63b1('0x12')](_0x63b1('0xf'),_0x2e494d,_0xcaf9ac['error']['message']);return _0x4323d6(_0xcaf9ac[_0x63b1('0x12')][_0x63b1('0x13')]);}else{logger[_0x63b1('0xe')](_0x63b1('0xf'),_0x2e494d,'request\x20sent');_0x4323d6(_0xcaf9ac[_0x63b1('0x14')][_0x63b1('0x13')]);}})[_0x63b1('0x15')](function(_0x4f13d0){logger[_0x63b1('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x2e494d,_0x4f13d0);_0x5cefd5(_0x4f13d0);});});}
\ No newline at end of file
index 634fa8f..aad6ace 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb36=['getFields','post','create','addConfiguration','put','update','delete','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xfb36,0x7a));var _0x6fb3=function(_0x5c9baf,_0x547384){_0x5c9baf=_0x5c9baf-0x0;var _0x22b576=_0xfb36[_0x5c9baf];return _0x22b576;};'use strict';var multer=require(_0x6fb3('0x0'));var util=require(_0x6fb3('0x1'));var path=require('path');var timeout=require(_0x6fb3('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6fb3('0x3'));var auth=require(_0x6fb3('0x4'));var interaction=require(_0x6fb3('0x5'));var config=require(_0x6fb3('0x6'));var controller=require(_0x6fb3('0x7'));router[_0x6fb3('0x8')]('/',auth[_0x6fb3('0x9')](),controller[_0x6fb3('0xa')]);router[_0x6fb3('0x8')](_0x6fb3('0xb'),auth[_0x6fb3('0x9')](),controller[_0x6fb3('0xc')]);router['get'](_0x6fb3('0xd'),auth[_0x6fb3('0x9')](),controller[_0x6fb3('0xe')]);router['get'](_0x6fb3('0xf'),auth[_0x6fb3('0x9')](),controller[_0x6fb3('0x10')]);router[_0x6fb3('0x11')]('/',auth['isAuthenticated'](),controller[_0x6fb3('0x12')]);router['post'](_0x6fb3('0xd'),auth['isAuthenticated'](),controller[_0x6fb3('0x13')]);router[_0x6fb3('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x6fb3('0x15')]);router[_0x6fb3('0x16')](_0x6fb3('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xff35=['addConfiguration','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','isAuthenticated','get','/:id','show','/:id/configurations','getConfigurations','getFields','post','create'];(function(_0x3ba422,_0x53303c){var _0x20b5dd=function(_0x10b8a7){while(--_0x10b8a7){_0x3ba422['push'](_0x3ba422['shift']());}};_0x20b5dd(++_0x53303c);}(_0xff35,0x13a));var _0x5ff3=function(_0xf1d988,_0x341f87){_0xf1d988=_0xf1d988-0x0;var _0x264fa0=_0xff35[_0xf1d988];return _0x264fa0;};'use strict';var multer=require(_0x5ff3('0x0'));var util=require('util');var path=require(_0x5ff3('0x1'));var timeout=require(_0x5ff3('0x2'));var express=require(_0x5ff3('0x3'));var router=express[_0x5ff3('0x4')]();var fs_extra=require(_0x5ff3('0x5'));var auth=require(_0x5ff3('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intFreshdeskAccount.controller');router['get']('/',auth[_0x5ff3('0x7')](),controller['index']);router[_0x5ff3('0x8')](_0x5ff3('0x9'),auth[_0x5ff3('0x7')](),controller[_0x5ff3('0xa')]);router['get'](_0x5ff3('0xb'),auth[_0x5ff3('0x7')](),controller[_0x5ff3('0xc')]);router[_0x5ff3('0x8')]('/:id/fields',auth[_0x5ff3('0x7')](),controller[_0x5ff3('0xd')]);router[_0x5ff3('0xe')]('/',auth['isAuthenticated'](),controller[_0x5ff3('0xf')]);router[_0x5ff3('0xe')](_0x5ff3('0xb'),auth[_0x5ff3('0x7')](),controller[_0x5ff3('0x10')]);router[_0x5ff3('0x11')](_0x5ff3('0x9'),auth[_0x5ff3('0x7')](),controller[_0x5ff3('0x12')]);router[_0x5ff3('0x13')](_0x5ff3('0x9'),auth['isAuthenticated'](),controller[_0x5ff3('0x14')]);module[_0x5ff3('0x15')]=router;
\ No newline at end of file
index b7e6322..51e2862 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcbb=['exports','STRING','username','remoteUri','sequelize'];(function(_0x529739,_0x21a3dd){var _0x5b6951=function(_0x367a7a){while(--_0x367a7a){_0x529739['push'](_0x529739['shift']());}};_0x5b6951(++_0x21a3dd);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x5b95ef,_0x1cbf0b){_0x5b95ef=_0x5b95ef-0x0;var _0x36d8d4=_0xfcbb[_0x5b95ef];return _0x36d8d4;};'use strict';var Sequelize=require(_0xbfcb('0x0'));module[_0xbfcb('0x1')]={'name':{'type':Sequelize[_0xbfcb('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0xbfcb('0x3')},'apiKey':{'type':Sequelize[_0xbfcb('0x2')]},'remoteUri':{'type':Sequelize[_0xbfcb('0x2')],'unique':_0xbfcb('0x4')},'serverUrl':{'type':Sequelize[_0xbfcb('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xaebd=['remoteUri','sequelize','STRING','username'];(function(_0x18b729,_0x3f159e){var _0x596825=function(_0x1e285d){while(--_0x1e285d){_0x18b729['push'](_0x18b729['shift']());}};_0x596825(++_0x3f159e);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x5ea165,_0x236631){_0x5ea165=_0x5ea165-0x0;var _0x5868d5=_0xaebd[_0x5ea165];return _0x5868d5;};'use strict';var Sequelize=require(_0xdaeb('0x0'));module['exports']={'name':{'type':Sequelize[_0xdaeb('0x1')]},'description':{'type':Sequelize[_0xdaeb('0x1')]},'username':{'type':Sequelize[_0xdaeb('0x1')],'unique':_0xdaeb('0x2')},'apiKey':{'type':Sequelize[_0xdaeb('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xdaeb('0x3')},'serverUrl':{'type':Sequelize[_0xdaeb('0x1')],'allowNull':![]}};
\ No newline at end of file
index d7f1c68..ff0603c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f38=['pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','keys','length','include','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','Basic\x20%s','%s:X','toString','requester','subject','agent','description','priority','group','source','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','label','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','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/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x2f38,0x1a7));var _0x82f3=function(_0x391073,_0x2574ec){_0x391073=_0x391073-0x0;var _0x25ead0=_0x2f38[_0x391073];return _0x25ead0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x82f3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x82f3('0x1'));var rp=require(_0x82f3('0x2'));var moment=require(_0x82f3('0x3'));var BPromise=require(_0x82f3('0x4'));var Mustache=require(_0x82f3('0x5'));var util=require(_0x82f3('0x6'));var path=require('path');var sox=require(_0x82f3('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x82f3('0x8'));var _=require(_0x82f3('0x9'));var squel=require(_0x82f3('0xa'));var crypto=require(_0x82f3('0xb'));var jsforce=require(_0x82f3('0xc'));var deskjs=require(_0x82f3('0xd'));var toCsv=require(_0x82f3('0xe'));var querystring=require(_0x82f3('0xf'));var Papa=require(_0x82f3('0x10'));var Redis=require(_0x82f3('0x11'));var authService=require(_0x82f3('0x12'));var qs=require(_0x82f3('0x13'));var as=require(_0x82f3('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x82f3('0x15'))(_0x82f3('0x16'));var utils=require(_0x82f3('0x17'));var config=require(_0x82f3('0x18'));var licenseUtil=require(_0x82f3('0x19'));var db=require(_0x82f3('0x1a'))['db'];var integrations=require(_0x82f3('0x1b'));function respondWithStatusCode(_0x52a044,_0x561868){_0x561868=_0x561868||0xcc;return function(_0x19f218){if(_0x19f218){return _0x52a044[_0x82f3('0x1c')](_0x561868);}return _0x52a044['status'](_0x561868)[_0x82f3('0x1d')]();};}function respondWithResult(_0x2cca50,_0x3d34b2){_0x3d34b2=_0x3d34b2||0xc8;return function(_0xf7faa1){if(_0xf7faa1){return _0x2cca50[_0x82f3('0x1e')](_0x3d34b2)[_0x82f3('0x1f')](_0xf7faa1);}};}function respondWithFilteredResult(_0x4ad50f,_0x2621ae){return function(_0x2cafd6){if(_0x2cafd6){var _0x1b3b55=typeof _0x2621ae[_0x82f3('0x20')]===_0x82f3('0x21')&&typeof _0x2621ae[_0x82f3('0x22')]==='undefined';var _0x588386=_0x2cafd6[_0x82f3('0x23')];var _0x1cbb52=_0x1b3b55?0x0:_0x2621ae[_0x82f3('0x20')];var _0x404019=_0x1b3b55?_0x2cafd6[_0x82f3('0x23')]:_0x2621ae[_0x82f3('0x20')]+_0x2621ae['limit'];var _0x5e0eb7;if(_0x404019>=_0x588386){_0x404019=_0x588386;_0x5e0eb7=0xc8;}else{_0x5e0eb7=0xce;}_0x4ad50f[_0x82f3('0x1e')](_0x5e0eb7);return _0x4ad50f[_0x82f3('0x24')]('Content-Range',_0x1cbb52+'-'+_0x404019+'/'+_0x588386)['json'](_0x2cafd6);}return null;};}function patchUpdates(_0xe0c596){return function(_0xb85dff){try{jsonpatch[_0x82f3('0x25')](_0xb85dff,_0xe0c596,!![]);}catch(_0x1c7069){return BPromise[_0x82f3('0x26')](_0x1c7069);}return _0xb85dff[_0x82f3('0x27')]();};}function saveUpdates(_0x25f3b8,_0x11d076){return function(_0x507ad9){if(_0x507ad9){return _0x507ad9[_0x82f3('0x28')](_0x25f3b8)[_0x82f3('0x29')](function(_0x5ddf8c){return _0x5ddf8c;});}return null;};}function removeEntity(_0x5a5070,_0x2144a7){return function(_0x5a3982){if(_0x5a3982){return _0x5a3982[_0x82f3('0x2a')]()[_0x82f3('0x29')](function(){_0x5a5070[_0x82f3('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x402bff,_0xcd0d7){return function(_0xe66683){if(!_0xe66683){_0x402bff[_0x82f3('0x1c')](0x194);}return _0xe66683;};}function handleError(_0x3021d7,_0x48b7d3){_0x48b7d3=_0x48b7d3||0x1f4;return function(_0x405f1c){logger[_0x82f3('0x2b')](_0x405f1c[_0x82f3('0x2c')]);if(_0x405f1c['name']){delete _0x405f1c[_0x82f3('0x2d')];}_0x3021d7[_0x82f3('0x1e')](_0x48b7d3)[_0x82f3('0x2e')](_0x405f1c);};}exports[_0x82f3('0x2f')]=function(_0xf98e7f,_0x11141f){var _0x35d7c3={},_0x44f14d={},_0x1aa0e4={'count':0x0,'rows':[]};var _0x3bdc31=_[_0x82f3('0x30')](db[_0x82f3('0x31')][_0x82f3('0x32')],function(_0x1b0f43){return{'name':_0x1b0f43[_0x82f3('0x33')],'type':_0x1b0f43[_0x82f3('0x34')][_0x82f3('0x35')]};});_0x44f14d[_0x82f3('0x36')]=_[_0x82f3('0x30')](_0x3bdc31,'name');_0x44f14d[_0x82f3('0x37')]=_['keys'](_0xf98e7f[_0x82f3('0x37')]);_0x44f14d[_0x82f3('0x38')]=_[_0x82f3('0x39')](_0x44f14d[_0x82f3('0x36')],_0x44f14d[_0x82f3('0x37')]);_0x35d7c3['attributes']=_[_0x82f3('0x39')](_0x44f14d[_0x82f3('0x36')],qs[_0x82f3('0x3a')](_0xf98e7f[_0x82f3('0x37')][_0x82f3('0x3a')]));_0x35d7c3['attributes']=_0x35d7c3[_0x82f3('0x3b')]['length']?_0x35d7c3[_0x82f3('0x3b')]:_0x44f14d['model'];if(!_0xf98e7f[_0x82f3('0x37')][_0x82f3('0x3c')](_0x82f3('0x3d'))){_0x35d7c3['limit']=qs['limit'](_0xf98e7f['query'][_0x82f3('0x22')]);_0x35d7c3[_0x82f3('0x20')]=qs[_0x82f3('0x20')](_0xf98e7f[_0x82f3('0x37')][_0x82f3('0x20')]);}_0x35d7c3[_0x82f3('0x3e')]=qs[_0x82f3('0x3f')](_0xf98e7f[_0x82f3('0x37')]['sort']);_0x35d7c3[_0x82f3('0x40')]=qs[_0x82f3('0x38')](_[_0x82f3('0x41')](_0xf98e7f['query'],_0x44f14d[_0x82f3('0x38')]),_0x3bdc31);if(_0xf98e7f[_0x82f3('0x37')][_0x82f3('0x42')]){_0x35d7c3[_0x82f3('0x40')]=_['merge'](_0x35d7c3[_0x82f3('0x40')],{'$or':_[_0x82f3('0x30')](_0x3bdc31,function(_0x55a5b5){if(_0x55a5b5[_0x82f3('0x34')]!=='VIRTUAL'){var _0x1035f8={};_0x1035f8[_0x55a5b5[_0x82f3('0x2d')]]={'$like':'%'+_0xf98e7f[_0x82f3('0x37')][_0x82f3('0x42')]+'%'};return _0x1035f8;}})});}_0x35d7c3=_[_0x82f3('0x43')]({},_0x35d7c3,_0xf98e7f[_0x82f3('0x44')]);var _0x19ac5b={'where':_0x35d7c3[_0x82f3('0x40')]};return db['FreshdeskAccount'][_0x82f3('0x23')](_0x19ac5b)['then'](function(_0x4d6df5){_0x1aa0e4[_0x82f3('0x23')]=_0x4d6df5;if(_0xf98e7f[_0x82f3('0x37')][_0x82f3('0x45')]){_0x35d7c3['include']=[{'all':!![]}];}return db[_0x82f3('0x31')][_0x82f3('0x46')](_0x35d7c3);})[_0x82f3('0x29')](function(_0x114dab){_0x1aa0e4[_0x82f3('0x47')]=_0x114dab;return _0x1aa0e4;})['then'](respondWithFilteredResult(_0x11141f,_0x35d7c3))[_0x82f3('0x48')](handleError(_0x11141f,null));};exports[_0x82f3('0x49')]=function(_0x23e765,_0xbfa034){var _0x1cc602={'raw':![],'where':{'id':_0x23e765[_0x82f3('0x4a')]['id']}},_0x20f934={};_0x20f934[_0x82f3('0x36')]=_[_0x82f3('0x4b')](db['FreshdeskAccount'][_0x82f3('0x32')]);_0x20f934[_0x82f3('0x37')]=_[_0x82f3('0x4b')](_0x23e765['query']);_0x20f934[_0x82f3('0x38')]=_[_0x82f3('0x39')](_0x20f934[_0x82f3('0x36')],_0x20f934[_0x82f3('0x37')]);_0x1cc602['attributes']=_[_0x82f3('0x39')](_0x20f934[_0x82f3('0x36')],qs['fields'](_0x23e765[_0x82f3('0x37')]['fields']));_0x1cc602[_0x82f3('0x3b')]=_0x1cc602[_0x82f3('0x3b')][_0x82f3('0x4c')]?_0x1cc602[_0x82f3('0x3b')]:_0x20f934[_0x82f3('0x36')];if(_0x23e765[_0x82f3('0x37')][_0x82f3('0x45')]){_0x1cc602[_0x82f3('0x4d')]=[{'all':!![]}];}_0x1cc602=_[_0x82f3('0x43')]({},_0x1cc602,_0x23e765[_0x82f3('0x44')]);return db[_0x82f3('0x31')][_0x82f3('0x4e')](_0x1cc602)[_0x82f3('0x29')](handleEntityNotFound(_0xbfa034,null))[_0x82f3('0x29')](respondWithResult(_0xbfa034,null))[_0x82f3('0x48')](handleError(_0xbfa034,null));};exports[_0x82f3('0x4f')]=function(_0x4aabc6,_0x5cbd4a){return db['FreshdeskAccount']['create'](_0x4aabc6['body'],{})['then'](respondWithResult(_0x5cbd4a,0xc9))['catch'](handleError(_0x5cbd4a,null));};exports[_0x82f3('0x28')]=function(_0xe1634b,_0xa9a615){if(_0xe1634b['body']['id']){delete _0xe1634b[_0x82f3('0x50')]['id'];}return db[_0x82f3('0x31')][_0x82f3('0x4e')]({'where':{'id':_0xe1634b[_0x82f3('0x4a')]['id']}})[_0x82f3('0x29')](handleEntityNotFound(_0xa9a615,null))[_0x82f3('0x29')](saveUpdates(_0xe1634b['body'],null))[_0x82f3('0x29')](respondWithResult(_0xa9a615,null))[_0x82f3('0x48')](handleError(_0xa9a615,null));};exports[_0x82f3('0x2a')]=function(_0x5dccdc,_0x381630){return db[_0x82f3('0x31')][_0x82f3('0x4e')]({'where':{'id':_0x5dccdc['params']['id']}})[_0x82f3('0x29')](handleEntityNotFound(_0x381630,null))[_0x82f3('0x29')](removeEntity(_0x381630,null))[_0x82f3('0x48')](handleError(_0x381630,null));};exports[_0x82f3('0x51')]=function(_0x16b5c8,_0x52279a,_0x29b6aa){var _0x30e55d={};var _0x8f83ac={};var _0xf2231b;var _0x116356;return db[_0x82f3('0x31')][_0x82f3('0x52')]({'where':{'id':_0x16b5c8[_0x82f3('0x4a')]['id']}})[_0x82f3('0x29')](handleEntityNotFound(_0x52279a,null))['then'](function(_0x2549ad){if(_0x2549ad){_0xf2231b=_0x2549ad;_0x8f83ac[_0x82f3('0x36')]=_[_0x82f3('0x4b')](db[_0x82f3('0x53')][_0x82f3('0x32')]);_0x8f83ac['query']=_[_0x82f3('0x4b')](_0x16b5c8[_0x82f3('0x37')]);_0x8f83ac[_0x82f3('0x38')]=_['intersection'](_0x8f83ac[_0x82f3('0x36')],_0x8f83ac[_0x82f3('0x37')]);_0x30e55d[_0x82f3('0x3b')]=_['intersection'](_0x8f83ac[_0x82f3('0x36')],qs[_0x82f3('0x3a')](_0x16b5c8['query'][_0x82f3('0x3a')]));_0x30e55d[_0x82f3('0x3b')]=_0x30e55d[_0x82f3('0x3b')][_0x82f3('0x4c')]?_0x30e55d[_0x82f3('0x3b')]:_0x8f83ac['model'];_0x30e55d[_0x82f3('0x3e')]=qs[_0x82f3('0x3f')](_0x16b5c8[_0x82f3('0x37')]['sort']);_0x30e55d[_0x82f3('0x40')]=qs['filters'](_[_0x82f3('0x41')](_0x16b5c8[_0x82f3('0x37')],_0x8f83ac['filters']));if(_0x16b5c8['query'][_0x82f3('0x42')]){_0x30e55d[_0x82f3('0x40')]=_[_0x82f3('0x43')](_0x30e55d[_0x82f3('0x40')],{'$or':_[_0x82f3('0x30')](_0x30e55d[_0x82f3('0x3b')],function(_0x38f6dd){var _0x35086c={};_0x35086c[_0x38f6dd]={'$like':'%'+_0x16b5c8[_0x82f3('0x37')][_0x82f3('0x42')]+'%'};return _0x35086c;})});}_0x30e55d=_[_0x82f3('0x43')]({},_0x30e55d,_0x16b5c8['options']);return _0xf2231b[_0x82f3('0x51')](_0x30e55d);}})[_0x82f3('0x29')](function(_0x369e2c){if(_0x369e2c){_0x116356=_0x369e2c['length'];if(!_0x16b5c8['query'][_0x82f3('0x3c')](_0x82f3('0x3d'))){_0x30e55d[_0x82f3('0x22')]=qs[_0x82f3('0x22')](_0x16b5c8['query'][_0x82f3('0x22')]);_0x30e55d[_0x82f3('0x20')]=qs['offset'](_0x16b5c8[_0x82f3('0x37')]['offset']);}return _0xf2231b['getConfigurations'](_0x30e55d);}})[_0x82f3('0x29')](function(_0x285372){if(_0x285372){return _0x285372?{'count':_0x116356,'rows':_0x285372}:null;}})['then'](respondWithResult(_0x52279a,null))['catch'](handleError(_0x52279a,null));};exports['addConfiguration']=function(_0x3d6f3b,_0x6c91a4,_0xe12c00){if(_0x3d6f3b[_0x82f3('0x50')]['id']){delete _0x3d6f3b['body']['id'];}return db[_0x82f3('0x31')][_0x82f3('0x52')]({'where':{'id':_0x3d6f3b[_0x82f3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x6c91a4,null))[_0x82f3('0x29')](function(_0x364182){if(_0x364182){_0x3d6f3b[_0x82f3('0x50')][_0x82f3('0x54')]=_0x364182['id'];_0x3d6f3b[_0x82f3('0x50')][_0x82f3('0x55')]=integrations[_0x82f3('0x56')](_0x3d6f3b[_0x82f3('0x50')]['channel'],_0x3d6f3b[_0x82f3('0x50')][_0x82f3('0x34')]);_0x3d6f3b[_0x82f3('0x50')][_0x82f3('0x57')]=integrations[_0x82f3('0x58')](_0x3d6f3b[_0x82f3('0x50')][_0x82f3('0x59')],_0x3d6f3b['body'][_0x82f3('0x34')]);return db[_0x82f3('0x53')][_0x82f3('0x4f')](_0x3d6f3b['body'],{'include':[{'model':db[_0x82f3('0x5a')],'as':_0x82f3('0x55')},{'model':db[_0x82f3('0x5a')],'as':_0x82f3('0x57')}]});}return null;})[_0x82f3('0x29')](respondWithResult(_0x6c91a4,null))[_0x82f3('0x48')](handleError(_0x6c91a4,null));};exports[_0x82f3('0x5b')]=function(_0x250d31,_0x5e467d,_0x86e1c9){var _0x10f7e6='';return db[_0x82f3('0x31')]['findOne']({'where':{'id':_0x250d31[_0x82f3('0x4a')]['id']},'attributes':['id',_0x82f3('0x5c'),_0x82f3('0x5d')]})[_0x82f3('0x29')](handleEntityNotFound(_0x5e467d,null))[_0x82f3('0x29')](function(_0x41e3be){if(_0x41e3be){_0x10f7e6=_0x41e3be[_0x82f3('0x5c')];var _0x262ac9=_0x10f7e6[_0x82f3('0x5e')](-0x1);if(_0x262ac9==='/'){_0x10f7e6=_0x10f7e6[_0x82f3('0x5f')](0x0,_0x10f7e6[_0x82f3('0x60')](_0x262ac9));}return rp({'method':_0x82f3('0x61'),'uri':util[_0x82f3('0x62')](_0x82f3('0x63'),_0x10f7e6,'api/v2/ticket_fields'),'headers':{'Authorization':util['format'](_0x82f3('0x64'),new Buffer(util['format'](_0x82f3('0x65'),_0x41e3be[_0x82f3('0x5d')]))[_0x82f3('0x66')]('base64'))},'json':!![]});}})[_0x82f3('0x29')](function(_0x1910ba){if(_0x1910ba){var _0x3f0967=[_0x82f3('0x67'),_0x82f3('0x68'),_0x82f3('0x69'),_0x82f3('0x6a'),_0x82f3('0x1e'),_0x82f3('0x6b'),_0x82f3('0x6c'),_0x82f3('0x6d'),_0x82f3('0x6e'),_0x82f3('0x6c'),_0x82f3('0x6f')];_[_0x82f3('0x70')](_0x1910ba,function(_0x582e8f){return _0x3f0967[_0x82f3('0x71')](_0x582e8f[_0x82f3('0x2d')])||!_0x582e8f[_0x82f3('0x72')]&&_0x582e8f[_0x82f3('0x34')]!==_0x82f3('0x73')&&_0x582e8f[_0x82f3('0x34')]!==_0x82f3('0x74');});return{'count':_0x1910ba[_0x82f3('0x4c')],'rows':_[_0x82f3('0x30')](_0x1910ba,function(_0x16ab6c){return{'id':_0x16ab6c[_0x82f3('0x2d')],'name':_0x16ab6c[_0x82f3('0x75')],'custom':!_0x16ab6c[_0x82f3('0x72')],'options':_0x16ab6c['choices']?_[_0x82f3('0x30')](_0x16ab6c['choices'],function(_0x137cf3){return{'name':_[_0x82f3('0x76')](_0x137cf3),'value':_0x137cf3};}):[]};})};}})[_0x82f3('0x29')](respondWithResult(_0x5e467d,null))['catch'](function(_0x1573dc){var _0x85f2f4=_0x250d31['query']['test']?0x1f4:_0x1573dc[_0x82f3('0x77')]||0x1f4;logger[_0x82f3('0x2b')](_0x82f3('0x78'),'getFields',_0x85f2f4,JSON[_0x82f3('0x79')](_0x1573dc));delete _0x1573dc[_0x82f3('0x2d')];if(_0x85f2f4===0x191){_0x85f2f4=0x190;}_0x5e467d[_0x82f3('0x1e')](_0x85f2f4)[_0x82f3('0x2e')](_0x250d31[_0x82f3('0x37')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x1573dc['statusCode']}:_0x1573dc);});};
\ No newline at end of file
+var _0x66d3=['body','destroy','getConfigurations','findOne','FreshdeskConfiguration','nolimit','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','FreshdeskField','getFields','remoteUri','substring','lastIndexOf','GET','format','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','description','group','source','ticket_type','company','remove','includes','custom_text','label','default','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','json','undefined','offset','count','set','reject','save','then','end','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','hasOwnProperty','limit','order','sort','where','pick','filter','merge','FreshdeskAccount','includeAll','include','findAll','rows','catch','show','params','length','find','update'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x66d3,0x10f));var _0x366d=function(_0x4bdd09,_0x40a121){_0x4bdd09=_0x4bdd09-0x0;var _0x13666a=_0x66d3[_0x4bdd09];return _0x13666a;};'use strict';var emlformat=require(_0x366d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x366d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x366d('0x2'));var moment=require(_0x366d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x366d('0x4'));var util=require('util');var path=require(_0x366d('0x5'));var sox=require('sox');var csv=require(_0x366d('0x6'));var ejs=require(_0x366d('0x7'));var fs=require('fs');var fs_extra=require(_0x366d('0x8'));var _=require(_0x366d('0x9'));var squel=require(_0x366d('0xa'));var crypto=require(_0x366d('0xb'));var jsforce=require(_0x366d('0xc'));var deskjs=require(_0x366d('0xd'));var toCsv=require(_0x366d('0x6'));var querystring=require(_0x366d('0xe'));var Papa=require(_0x366d('0xf'));var Redis=require('ioredis');var authService=require(_0x366d('0x10'));var qs=require(_0x366d('0x11'));var as=require(_0x366d('0x12'));var hardwareService=require(_0x366d('0x13'));var logger=require(_0x366d('0x14'))(_0x366d('0x15'));var utils=require(_0x366d('0x16'));var config=require(_0x366d('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x366d('0x18'));function respondWithStatusCode(_0x797ee,_0x3dd776){_0x3dd776=_0x3dd776||0xcc;return function(_0x2eef82){if(_0x2eef82){return _0x797ee[_0x366d('0x19')](_0x3dd776);}return _0x797ee[_0x366d('0x1a')](_0x3dd776)['end']();};}function respondWithResult(_0x265292,_0x2a3fdb){_0x2a3fdb=_0x2a3fdb||0xc8;return function(_0x4e1d8e){if(_0x4e1d8e){return _0x265292[_0x366d('0x1a')](_0x2a3fdb)[_0x366d('0x1b')](_0x4e1d8e);}};}function respondWithFilteredResult(_0x54a1bb,_0x3da66f){return function(_0x309dc6){if(_0x309dc6){var _0x413008=typeof _0x3da66f['offset']===_0x366d('0x1c')&&typeof _0x3da66f['limit']===_0x366d('0x1c');var _0x6b9092=_0x309dc6['count'];var _0x401eca=_0x413008?0x0:_0x3da66f[_0x366d('0x1d')];var _0x12fecc=_0x413008?_0x309dc6[_0x366d('0x1e')]:_0x3da66f[_0x366d('0x1d')]+_0x3da66f['limit'];var _0xb8b16d;if(_0x12fecc>=_0x6b9092){_0x12fecc=_0x6b9092;_0xb8b16d=0xc8;}else{_0xb8b16d=0xce;}_0x54a1bb['status'](_0xb8b16d);return _0x54a1bb[_0x366d('0x1f')]('Content-Range',_0x401eca+'-'+_0x12fecc+'/'+_0x6b9092)['json'](_0x309dc6);}return null;};}function patchUpdates(_0x219106){return function(_0x3eb8d9){try{jsonpatch['apply'](_0x3eb8d9,_0x219106,!![]);}catch(_0x189dc0){return BPromise[_0x366d('0x20')](_0x189dc0);}return _0x3eb8d9[_0x366d('0x21')]();};}function saveUpdates(_0x58d16f,_0x3b5c89){return function(_0x3c540d){if(_0x3c540d){return _0x3c540d['update'](_0x58d16f)[_0x366d('0x22')](function(_0x47ebf4){return _0x47ebf4;});}return null;};}function removeEntity(_0x1c9ee9,_0x1326c9){return function(_0x46bf52){if(_0x46bf52){return _0x46bf52['destroy']()[_0x366d('0x22')](function(){_0x1c9ee9[_0x366d('0x1a')](0xcc)[_0x366d('0x23')]();});}};}function handleEntityNotFound(_0x5254e6,_0x53002e){return function(_0x5aec17){if(!_0x5aec17){_0x5254e6[_0x366d('0x19')](0x194);}return _0x5aec17;};}function handleError(_0x40f3df,_0x5d2b67){_0x5d2b67=_0x5d2b67||0x1f4;return function(_0x5592a1){logger[_0x366d('0x24')](_0x5592a1[_0x366d('0x25')]);if(_0x5592a1[_0x366d('0x26')]){delete _0x5592a1[_0x366d('0x26')];}_0x40f3df['status'](_0x5d2b67)[_0x366d('0x27')](_0x5592a1);};}exports['index']=function(_0x47cc0c,_0x13a6b2){var _0x594d42={},_0x535b26={},_0xa856fa={'count':0x0,'rows':[]};var _0x13aaca=_[_0x366d('0x28')](db['FreshdeskAccount'][_0x366d('0x29')],function(_0x2cb209){return{'name':_0x2cb209[_0x366d('0x2a')],'type':_0x2cb209[_0x366d('0x2b')][_0x366d('0x2c')]};});_0x535b26[_0x366d('0x2d')]=_['map'](_0x13aaca,_0x366d('0x26'));_0x535b26['query']=_[_0x366d('0x2e')](_0x47cc0c['query']);_0x535b26[_0x366d('0x2f')]=_[_0x366d('0x30')](_0x535b26[_0x366d('0x2d')],_0x535b26[_0x366d('0x31')]);_0x594d42['attributes']=_[_0x366d('0x30')](_0x535b26[_0x366d('0x2d')],qs[_0x366d('0x32')](_0x47cc0c[_0x366d('0x31')][_0x366d('0x32')]));_0x594d42[_0x366d('0x33')]=_0x594d42['attributes']['length']?_0x594d42[_0x366d('0x33')]:_0x535b26[_0x366d('0x2d')];if(!_0x47cc0c[_0x366d('0x31')][_0x366d('0x34')]('nolimit')){_0x594d42[_0x366d('0x35')]=qs[_0x366d('0x35')](_0x47cc0c[_0x366d('0x31')][_0x366d('0x35')]);_0x594d42[_0x366d('0x1d')]=qs[_0x366d('0x1d')](_0x47cc0c[_0x366d('0x31')][_0x366d('0x1d')]);}_0x594d42[_0x366d('0x36')]=qs['sort'](_0x47cc0c[_0x366d('0x31')][_0x366d('0x37')]);_0x594d42[_0x366d('0x38')]=qs['filters'](_[_0x366d('0x39')](_0x47cc0c[_0x366d('0x31')],_0x535b26[_0x366d('0x2f')]),_0x13aaca);if(_0x47cc0c[_0x366d('0x31')][_0x366d('0x3a')]){_0x594d42[_0x366d('0x38')]=_['merge'](_0x594d42[_0x366d('0x38')],{'$or':_[_0x366d('0x28')](_0x13aaca,function(_0x28dabd){if(_0x28dabd[_0x366d('0x2b')]!=='VIRTUAL'){var _0xffb576={};_0xffb576[_0x28dabd[_0x366d('0x26')]]={'$like':'%'+_0x47cc0c[_0x366d('0x31')][_0x366d('0x3a')]+'%'};return _0xffb576;}})});}_0x594d42=_[_0x366d('0x3b')]({},_0x594d42,_0x47cc0c['options']);var _0xf280fe={'where':_0x594d42[_0x366d('0x38')]};return db[_0x366d('0x3c')][_0x366d('0x1e')](_0xf280fe)[_0x366d('0x22')](function(_0x2957e2){_0xa856fa[_0x366d('0x1e')]=_0x2957e2;if(_0x47cc0c['query'][_0x366d('0x3d')]){_0x594d42[_0x366d('0x3e')]=[{'all':!![]}];}return db[_0x366d('0x3c')][_0x366d('0x3f')](_0x594d42);})[_0x366d('0x22')](function(_0x2dbcb5){_0xa856fa[_0x366d('0x40')]=_0x2dbcb5;return _0xa856fa;})[_0x366d('0x22')](respondWithFilteredResult(_0x13a6b2,_0x594d42))[_0x366d('0x41')](handleError(_0x13a6b2,null));};exports[_0x366d('0x42')]=function(_0x1b5d5c,_0x185abc){var _0x53c654={'raw':![],'where':{'id':_0x1b5d5c[_0x366d('0x43')]['id']}},_0xfe8801={};_0xfe8801['model']=_[_0x366d('0x2e')](db['FreshdeskAccount'][_0x366d('0x29')]);_0xfe8801['query']=_[_0x366d('0x2e')](_0x1b5d5c['query']);_0xfe8801[_0x366d('0x2f')]=_[_0x366d('0x30')](_0xfe8801[_0x366d('0x2d')],_0xfe8801[_0x366d('0x31')]);_0x53c654[_0x366d('0x33')]=_[_0x366d('0x30')](_0xfe8801[_0x366d('0x2d')],qs['fields'](_0x1b5d5c[_0x366d('0x31')][_0x366d('0x32')]));_0x53c654[_0x366d('0x33')]=_0x53c654[_0x366d('0x33')][_0x366d('0x44')]?_0x53c654[_0x366d('0x33')]:_0xfe8801[_0x366d('0x2d')];if(_0x1b5d5c[_0x366d('0x31')][_0x366d('0x3d')]){_0x53c654[_0x366d('0x3e')]=[{'all':!![]}];}_0x53c654=_[_0x366d('0x3b')]({},_0x53c654,_0x1b5d5c['options']);return db[_0x366d('0x3c')][_0x366d('0x45')](_0x53c654)[_0x366d('0x22')](handleEntityNotFound(_0x185abc,null))['then'](respondWithResult(_0x185abc,null))[_0x366d('0x41')](handleError(_0x185abc,null));};exports['create']=function(_0x15efc4,_0x423fb6){return db[_0x366d('0x3c')]['create'](_0x15efc4['body'],{})[_0x366d('0x22')](respondWithResult(_0x423fb6,0xc9))[_0x366d('0x41')](handleError(_0x423fb6,null));};exports[_0x366d('0x46')]=function(_0x68ba99,_0xe88468){if(_0x68ba99[_0x366d('0x47')]['id']){delete _0x68ba99[_0x366d('0x47')]['id'];}return db['FreshdeskAccount'][_0x366d('0x45')]({'where':{'id':_0x68ba99[_0x366d('0x43')]['id']}})[_0x366d('0x22')](handleEntityNotFound(_0xe88468,null))['then'](saveUpdates(_0x68ba99['body'],null))[_0x366d('0x22')](respondWithResult(_0xe88468,null))[_0x366d('0x41')](handleError(_0xe88468,null));};exports[_0x366d('0x48')]=function(_0x3948c8,_0xfffa10){return db[_0x366d('0x3c')][_0x366d('0x45')]({'where':{'id':_0x3948c8['params']['id']}})[_0x366d('0x22')](handleEntityNotFound(_0xfffa10,null))[_0x366d('0x22')](removeEntity(_0xfffa10,null))[_0x366d('0x41')](handleError(_0xfffa10,null));};exports[_0x366d('0x49')]=function(_0x1537d9,_0x9d8be,_0x7c3397){var _0x315f08={};var _0x8520af={};var _0x1359ea;var _0x39d546;return db['FreshdeskAccount'][_0x366d('0x4a')]({'where':{'id':_0x1537d9[_0x366d('0x43')]['id']}})['then'](handleEntityNotFound(_0x9d8be,null))[_0x366d('0x22')](function(_0x207afe){if(_0x207afe){_0x1359ea=_0x207afe;_0x8520af['model']=_[_0x366d('0x2e')](db[_0x366d('0x4b')]['rawAttributes']);_0x8520af[_0x366d('0x31')]=_[_0x366d('0x2e')](_0x1537d9[_0x366d('0x31')]);_0x8520af[_0x366d('0x2f')]=_['intersection'](_0x8520af[_0x366d('0x2d')],_0x8520af['query']);_0x315f08[_0x366d('0x33')]=_[_0x366d('0x30')](_0x8520af['model'],qs[_0x366d('0x32')](_0x1537d9['query'][_0x366d('0x32')]));_0x315f08[_0x366d('0x33')]=_0x315f08[_0x366d('0x33')]['length']?_0x315f08[_0x366d('0x33')]:_0x8520af[_0x366d('0x2d')];_0x315f08[_0x366d('0x36')]=qs[_0x366d('0x37')](_0x1537d9['query'][_0x366d('0x37')]);_0x315f08[_0x366d('0x38')]=qs[_0x366d('0x2f')](_[_0x366d('0x39')](_0x1537d9[_0x366d('0x31')],_0x8520af[_0x366d('0x2f')]));if(_0x1537d9[_0x366d('0x31')][_0x366d('0x3a')]){_0x315f08[_0x366d('0x38')]=_[_0x366d('0x3b')](_0x315f08['where'],{'$or':_[_0x366d('0x28')](_0x315f08[_0x366d('0x33')],function(_0x1da500){var _0x152da4={};_0x152da4[_0x1da500]={'$like':'%'+_0x1537d9[_0x366d('0x31')][_0x366d('0x3a')]+'%'};return _0x152da4;})});}_0x315f08=_[_0x366d('0x3b')]({},_0x315f08,_0x1537d9['options']);return _0x1359ea[_0x366d('0x49')](_0x315f08);}})[_0x366d('0x22')](function(_0x1da9a1){if(_0x1da9a1){_0x39d546=_0x1da9a1[_0x366d('0x44')];if(!_0x1537d9[_0x366d('0x31')][_0x366d('0x34')](_0x366d('0x4c'))){_0x315f08[_0x366d('0x35')]=qs[_0x366d('0x35')](_0x1537d9['query'][_0x366d('0x35')]);_0x315f08[_0x366d('0x1d')]=qs['offset'](_0x1537d9[_0x366d('0x31')][_0x366d('0x1d')]);}return _0x1359ea[_0x366d('0x49')](_0x315f08);}})[_0x366d('0x22')](function(_0x2ac178){if(_0x2ac178){return _0x2ac178?{'count':_0x39d546,'rows':_0x2ac178}:null;}})[_0x366d('0x22')](respondWithResult(_0x9d8be,null))[_0x366d('0x41')](handleError(_0x9d8be,null));};exports[_0x366d('0x4d')]=function(_0x25db3f,_0x299b86,_0x54430c){if(_0x25db3f[_0x366d('0x47')]['id']){delete _0x25db3f['body']['id'];}return db[_0x366d('0x3c')][_0x366d('0x4a')]({'where':{'id':_0x25db3f['params']['id']}})[_0x366d('0x22')](handleEntityNotFound(_0x299b86,null))[_0x366d('0x22')](function(_0x278ca2){if(_0x278ca2){_0x25db3f[_0x366d('0x47')]['AccountId']=_0x278ca2['id'];_0x25db3f[_0x366d('0x47')][_0x366d('0x4e')]=integrations[_0x366d('0x4f')](_0x25db3f[_0x366d('0x47')][_0x366d('0x50')],_0x25db3f['body'][_0x366d('0x2b')]);_0x25db3f[_0x366d('0x47')][_0x366d('0x51')]=integrations[_0x366d('0x52')](_0x25db3f[_0x366d('0x47')][_0x366d('0x50')],_0x25db3f[_0x366d('0x47')][_0x366d('0x2b')]);return db[_0x366d('0x4b')][_0x366d('0x53')](_0x25db3f[_0x366d('0x47')],{'include':[{'model':db['FreshdeskField'],'as':_0x366d('0x4e')},{'model':db[_0x366d('0x54')],'as':_0x366d('0x51')}]});}return null;})['then'](respondWithResult(_0x299b86,null))['catch'](handleError(_0x299b86,null));};exports[_0x366d('0x55')]=function(_0x15d796,_0x33f391,_0x241fd6){var _0x25a823='';return db[_0x366d('0x3c')][_0x366d('0x4a')]({'where':{'id':_0x15d796[_0x366d('0x43')]['id']},'attributes':['id',_0x366d('0x56'),'apiKey']})[_0x366d('0x22')](handleEntityNotFound(_0x33f391,null))[_0x366d('0x22')](function(_0x79ca8a){if(_0x79ca8a){_0x25a823=_0x79ca8a[_0x366d('0x56')];var _0x54e6d0=_0x25a823['slice'](-0x1);if(_0x54e6d0==='/'){_0x25a823=_0x25a823[_0x366d('0x57')](0x0,_0x25a823[_0x366d('0x58')](_0x54e6d0));}return rp({'method':_0x366d('0x59'),'uri':util[_0x366d('0x5a')]('%s/%s',_0x25a823,_0x366d('0x5b')),'headers':{'Authorization':util[_0x366d('0x5a')](_0x366d('0x5c'),new Buffer(util[_0x366d('0x5a')](_0x366d('0x5d'),_0x79ca8a['apiKey']))[_0x366d('0x5e')](_0x366d('0x5f')))},'json':!![]});}})[_0x366d('0x22')](function(_0x49df32){if(_0x49df32){var _0x466bfe=[_0x366d('0x60'),_0x366d('0x61'),'agent',_0x366d('0x62'),_0x366d('0x1a'),'priority',_0x366d('0x63'),_0x366d('0x64'),_0x366d('0x65'),_0x366d('0x63'),_0x366d('0x66')];_[_0x366d('0x67')](_0x49df32,function(_0x3192ba){return _0x466bfe[_0x366d('0x68')](_0x3192ba[_0x366d('0x26')])||!_0x3192ba['default']&&_0x3192ba[_0x366d('0x2b')]!==_0x366d('0x69')&&_0x3192ba[_0x366d('0x2b')]!=='custom_dropdown';});return{'count':_0x49df32[_0x366d('0x44')],'rows':_[_0x366d('0x28')](_0x49df32,function(_0x4046f3){return{'id':_0x4046f3[_0x366d('0x26')],'name':_0x4046f3[_0x366d('0x6a')],'custom':!_0x4046f3[_0x366d('0x6b')],'options':_0x4046f3[_0x366d('0x6c')]?_[_0x366d('0x28')](_0x4046f3[_0x366d('0x6c')],function(_0x1d380d){return{'name':_['capitalize'](_0x1d380d),'value':_0x1d380d};}):[]};})};}})['then'](respondWithResult(_0x33f391,null))['catch'](function(_0x1b2c75){var _0x3b01fb=_0x15d796[_0x366d('0x31')][_0x366d('0x6d')]?0x1f4:_0x1b2c75[_0x366d('0x6e')]||0x1f4;logger[_0x366d('0x24')](_0x366d('0x6f'),_0x366d('0x55'),_0x3b01fb,JSON[_0x366d('0x70')](_0x1b2c75));delete _0x1b2c75[_0x366d('0x26')];if(_0x3b01fb===0x191){_0x3b01fb=0x190;}_0x33f391[_0x366d('0x1a')](_0x3b01fb)[_0x366d('0x27')](_0x15d796[_0x366d('0x31')][_0x366d('0x6d')]?{'message':_0x366d('0x71'),'statusCode':_0x1b2c75[_0x366d('0x6e')]}:_0x1b2c75);});};
\ No newline at end of file
index 164e957..1bd8934 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf104=['./intFreshdeskAccount.attributes','define','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5e3099,_0x431ce0){var _0x32cbe1=function(_0x50077b){while(--_0x50077b){_0x5e3099['push'](_0x5e3099['shift']());}};_0x32cbe1(++_0x431ce0);}(_0xf104,0xfc));var _0x4f10=function(_0x476565,_0x22944d){_0x476565=_0x476565-0x0;var _0x4e8838=_0xf104[_0x476565];return _0x4e8838;};'use strict';var _=require('lodash');var util=require(_0x4f10('0x0'));var logger=require(_0x4f10('0x1'))(_0x4f10('0x2'));var moment=require('moment');var BPromise=require(_0x4f10('0x3'));var rp=require(_0x4f10('0x4'));var fs=require('fs');var path=require(_0x4f10('0x5'));var rimraf=require(_0x4f10('0x6'));var config=require(_0x4f10('0x7'));var attributes=require(_0x4f10('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x556788,_0x1e2e62){return _0x556788[_0x4f10('0x9')]('FreshdeskAccount',attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe733=['lodash','util','../../config/logger','api','bluebird','path','./intFreshdeskAccount.attributes','../../components/integrations/configuration','define','FreshdeskAccount'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe733,0x140));var _0x3e73=function(_0x8483ac,_0x5b9bab){_0x8483ac=_0x8483ac-0x0;var _0x4fcd66=_0xe733[_0x8483ac];return _0x4fcd66;};'use strict';var _=require(_0x3e73('0x0'));var util=require(_0x3e73('0x1'));var logger=require(_0x3e73('0x2'))(_0x3e73('0x3'));var moment=require('moment');var BPromise=require(_0x3e73('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3e73('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3e73('0x6'));var integrations=require(_0x3e73('0x7'));module['exports']=function(_0x19cef2,_0x193e64){return _0x19cef2[_0x3e73('0x8')](_0x3e73('0x9'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 687e18f..d9dad97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1eff=['FreshdeskAccount,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','limit','include','model','attributes','map','debug','ShowFreshdeskAccount','find','where','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x384231,_0x50be41){var _0x2480bf=function(_0x1c4838){while(--_0x1c4838){_0x384231['push'](_0x384231['shift']());}};_0x2480bf(++_0x50be41);}(_0x1eff,0xdc));var _0xf1ef=function(_0x1a87a9,_0x394c9f){_0x1a87a9=_0x1a87a9-0x0;var _0x481ee2=_0x1eff[_0x1a87a9];return _0x481ee2;};'use strict';var _=require(_0xf1ef('0x0'));var util=require('util');var moment=require(_0xf1ef('0x1'));var BPromise=require(_0xf1ef('0x2'));var rs=require(_0xf1ef('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf1ef('0x4'))['db'];var utils=require(_0xf1ef('0x5'));var logger=require('../../config/logger')(_0xf1ef('0x6'));var config=require(_0xf1ef('0x7'));var jayson=require(_0xf1ef('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x8b0d2f,_0x1682f1,_0x1b46bb){return new BPromise(function(_0x105d53,_0x100a1f){return client[_0xf1ef('0x9')](_0x8b0d2f,_0x1b46bb)[_0xf1ef('0xa')](function(_0x375b1c){logger['info'](_0xf1ef('0xb'),_0x1682f1,'request\x20sent');logger['debug']('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x1682f1,'request\x20sent',JSON[_0xf1ef('0xc')](_0x375b1c));if(_0x375b1c['error']){if(_0x375b1c[_0xf1ef('0xd')][_0xf1ef('0xe')]===0x1f4){logger['error'](_0xf1ef('0xb'),_0x1682f1,_0x375b1c[_0xf1ef('0xd')][_0xf1ef('0xf')]);return _0x100a1f(_0x375b1c[_0xf1ef('0xd')][_0xf1ef('0xf')]);}logger[_0xf1ef('0xd')](_0xf1ef('0xb'),_0x1682f1,_0x375b1c['error'][_0xf1ef('0xf')]);return _0x105d53(_0x375b1c[_0xf1ef('0xd')]['message']);}else{logger[_0xf1ef('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x1682f1,_0xf1ef('0x11'));_0x105d53(_0x375b1c['result'][_0xf1ef('0xf')]);}})[_0xf1ef('0x12')](function(_0xb0f621){logger[_0xf1ef('0xd')](_0xf1ef('0xb'),_0x1682f1,_0xb0f621);_0x100a1f(_0xb0f621);});});}exports[_0xf1ef('0x13')]=function(_0x2cc278){var _0x40e8fd=this;return new Promise(function(_0x39e59d,_0x44a77d){return db[_0xf1ef('0x14')][_0xf1ef('0x15')]({'raw':_0x2cc278[_0xf1ef('0x16')]?_0x2cc278[_0xf1ef('0x16')][_0xf1ef('0x17')]===undefined?!![]:![]:!![],'where':_0x2cc278[_0xf1ef('0x16')]?_0x2cc278[_0xf1ef('0x16')]['where']||null:null,'attributes':_0x2cc278[_0xf1ef('0x16')]?_0x2cc278[_0xf1ef('0x16')]['attributes']||null:null,'limit':_0x2cc278['options']?_0x2cc278[_0xf1ef('0x16')][_0xf1ef('0x18')]||null:null,'include':_0x2cc278['options']?_0x2cc278[_0xf1ef('0x16')][_0xf1ef('0x19')]?_['map'](_0x2cc278[_0xf1ef('0x16')][_0xf1ef('0x19')],function(_0x222c31){return{'model':db[_0x222c31[_0xf1ef('0x1a')]],'as':_0x222c31['as'],'attributes':_0x222c31[_0xf1ef('0x1b')],'include':_0x222c31[_0xf1ef('0x19')]?_['map'](_0x222c31[_0xf1ef('0x19')],function(_0x2dcc6b){return{'model':db[_0x2dcc6b[_0xf1ef('0x1a')]],'as':_0x2dcc6b['as'],'attributes':_0x2dcc6b[_0xf1ef('0x1b')],'include':_0x2dcc6b[_0xf1ef('0x19')]?_[_0xf1ef('0x1c')](_0x2dcc6b[_0xf1ef('0x19')],function(_0x189c81){return{'model':db[_0x189c81[_0xf1ef('0x1a')]],'as':_0x189c81['as'],'attributes':_0x189c81[_0xf1ef('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x59ad58){logger[_0xf1ef('0x10')]('GetFreshdeskAccount',_0x2cc278);logger[_0xf1ef('0x1d')]('GetFreshdeskAccount',_0x2cc278,JSON[_0xf1ef('0xc')](_0x59ad58));_0x39e59d(_0x59ad58);})[_0xf1ef('0x12')](function(_0x28fe3a){logger[_0xf1ef('0xd')](_0xf1ef('0x13'),_0x28fe3a[_0xf1ef('0xf')],_0x2cc278);_0x44a77d(_0x40e8fd[_0xf1ef('0xd')](0x1f4,_0x28fe3a[_0xf1ef('0xf')]));});});};exports[_0xf1ef('0x1e')]=function(_0x434314){var _0x20dac6=this;return new Promise(function(_0x2ff705,_0xec90c9){return db[_0xf1ef('0x14')][_0xf1ef('0x1f')]({'raw':_0x434314[_0xf1ef('0x16')]?_0x434314[_0xf1ef('0x16')][_0xf1ef('0x17')]===undefined?!![]:![]:!![],'where':_0x434314[_0xf1ef('0x16')]?_0x434314[_0xf1ef('0x16')][_0xf1ef('0x20')]||null:null,'attributes':_0x434314[_0xf1ef('0x16')]?_0x434314[_0xf1ef('0x16')]['attributes']||null:null,'include':_0x434314[_0xf1ef('0x16')]?_0x434314[_0xf1ef('0x16')][_0xf1ef('0x19')]?_[_0xf1ef('0x1c')](_0x434314['options'][_0xf1ef('0x19')],function(_0x136716){return{'model':db[_0x136716[_0xf1ef('0x1a')]],'as':_0x136716['as'],'attributes':_0x136716[_0xf1ef('0x1b')],'include':_0x136716[_0xf1ef('0x19')]?_[_0xf1ef('0x1c')](_0x136716['include'],function(_0x54416b){return{'model':db[_0x54416b[_0xf1ef('0x1a')]],'as':_0x54416b['as'],'attributes':_0x54416b[_0xf1ef('0x1b')],'include':_0x54416b[_0xf1ef('0x19')]?_['map'](_0x54416b['include'],function(_0x4c9cb2){return{'model':db[_0x4c9cb2[_0xf1ef('0x1a')]],'as':_0x4c9cb2['as'],'attributes':_0x4c9cb2[_0xf1ef('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf1ef('0xa')](function(_0x450e1f){logger['info'](_0xf1ef('0x1e'),_0x434314);logger[_0xf1ef('0x1d')](_0xf1ef('0x1e'),_0x434314,JSON[_0xf1ef('0xc')](_0x450e1f));_0x2ff705(_0x450e1f);})[_0xf1ef('0x12')](function(_0x4dd437){logger[_0xf1ef('0xd')](_0xf1ef('0x1e'),_0x4dd437[_0xf1ef('0xf')],_0x434314);_0xec90c9(_0x20dac6[_0xf1ef('0xd')](0x1f4,_0x4dd437[_0xf1ef('0xf')]));});});};
\ No newline at end of file
+var _0x96a5=['then','info','FreshdeskAccount,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','GetFreshdeskAccount','findAll','options','raw','where','attributes','limit','map','include','model','find','ShowFreshdeskAccount','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x514ca4,_0x5f3a51){var _0x2a64dc=function(_0x4f5736){while(--_0x4f5736){_0x514ca4['push'](_0x514ca4['shift']());}};_0x2a64dc(++_0x5f3a51);}(_0x96a5,0xef));var _0x596a=function(_0x4e95c1,_0x58aa3c){_0x4e95c1=_0x4e95c1-0x0;var _0xb610e8=_0x96a5[_0x4e95c1];return _0xb610e8;};'use strict';var _=require(_0x596a('0x0'));var util=require(_0x596a('0x1'));var moment=require(_0x596a('0x2'));var BPromise=require(_0x596a('0x3'));var rs=require(_0x596a('0x4'));var fs=require('fs');var Redis=require(_0x596a('0x5'));var db=require(_0x596a('0x6'))['db'];var utils=require(_0x596a('0x7'));var logger=require(_0x596a('0x8'))(_0x596a('0x9'));var config=require('../../config/environment');var jayson=require(_0x596a('0xa'));var client=jayson[_0x596a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8bae2f,_0x153389,_0x110107){return new BPromise(function(_0x4e3537,_0x5bf528){return client[_0x596a('0xc')](_0x8bae2f,_0x110107)[_0x596a('0xd')](function(_0x2401f5){logger[_0x596a('0xe')](_0x596a('0xf'),_0x153389,'request\x20sent');logger[_0x596a('0x10')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x153389,'request\x20sent',JSON['stringify'](_0x2401f5));if(_0x2401f5[_0x596a('0x11')]){if(_0x2401f5[_0x596a('0x11')][_0x596a('0x12')]===0x1f4){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x153389,_0x2401f5[_0x596a('0x11')]['message']);return _0x5bf528(_0x2401f5[_0x596a('0x11')][_0x596a('0x13')]);}logger[_0x596a('0x11')](_0x596a('0xf'),_0x153389,_0x2401f5[_0x596a('0x11')][_0x596a('0x13')]);return _0x4e3537(_0x2401f5[_0x596a('0x11')][_0x596a('0x13')]);}else{logger[_0x596a('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x153389,_0x596a('0x14'));_0x4e3537(_0x2401f5[_0x596a('0x15')]['message']);}})[_0x596a('0x16')](function(_0x3713af){logger[_0x596a('0x11')](_0x596a('0xf'),_0x153389,_0x3713af);_0x5bf528(_0x3713af);});});}exports[_0x596a('0x17')]=function(_0xc9c01c){var _0x4840da=this;return new Promise(function(_0x5e56f,_0xc4b801){return db['FreshdeskAccount'][_0x596a('0x18')]({'raw':_0xc9c01c[_0x596a('0x19')]?_0xc9c01c[_0x596a('0x19')][_0x596a('0x1a')]===undefined?!![]:![]:!![],'where':_0xc9c01c[_0x596a('0x19')]?_0xc9c01c[_0x596a('0x19')][_0x596a('0x1b')]||null:null,'attributes':_0xc9c01c[_0x596a('0x19')]?_0xc9c01c[_0x596a('0x19')][_0x596a('0x1c')]||null:null,'limit':_0xc9c01c[_0x596a('0x19')]?_0xc9c01c[_0x596a('0x19')][_0x596a('0x1d')]||null:null,'include':_0xc9c01c['options']?_0xc9c01c[_0x596a('0x19')]['include']?_[_0x596a('0x1e')](_0xc9c01c[_0x596a('0x19')][_0x596a('0x1f')],function(_0x30998f){return{'model':db[_0x30998f[_0x596a('0x20')]],'as':_0x30998f['as'],'attributes':_0x30998f['attributes'],'include':_0x30998f[_0x596a('0x1f')]?_[_0x596a('0x1e')](_0x30998f[_0x596a('0x1f')],function(_0x2c068d){return{'model':db[_0x2c068d[_0x596a('0x20')]],'as':_0x2c068d['as'],'attributes':_0x2c068d[_0x596a('0x1c')],'include':_0x2c068d[_0x596a('0x1f')]?_[_0x596a('0x1e')](_0x2c068d[_0x596a('0x1f')],function(_0x5f0d8a){return{'model':db[_0x5f0d8a[_0x596a('0x20')]],'as':_0x5f0d8a['as'],'attributes':_0x5f0d8a[_0x596a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x596a('0xd')](function(_0x3275e1){logger[_0x596a('0xe')]('GetFreshdeskAccount',_0xc9c01c);logger['debug']('GetFreshdeskAccount',_0xc9c01c,JSON['stringify'](_0x3275e1));_0x5e56f(_0x3275e1);})[_0x596a('0x16')](function(_0x5c77d6){logger[_0x596a('0x11')](_0x596a('0x17'),_0x5c77d6['message'],_0xc9c01c);_0xc4b801(_0x4840da['error'](0x1f4,_0x5c77d6[_0x596a('0x13')]));});});};exports['ShowFreshdeskAccount']=function(_0x3cfd05){var _0x610079=this;return new Promise(function(_0x35122e,_0x59ec65){return db['FreshdeskAccount'][_0x596a('0x21')]({'raw':_0x3cfd05[_0x596a('0x19')]?_0x3cfd05[_0x596a('0x19')][_0x596a('0x1a')]===undefined?!![]:![]:!![],'where':_0x3cfd05[_0x596a('0x19')]?_0x3cfd05[_0x596a('0x19')][_0x596a('0x1b')]||null:null,'attributes':_0x3cfd05[_0x596a('0x19')]?_0x3cfd05[_0x596a('0x19')][_0x596a('0x1c')]||null:null,'include':_0x3cfd05['options']?_0x3cfd05[_0x596a('0x19')]['include']?_[_0x596a('0x1e')](_0x3cfd05[_0x596a('0x19')][_0x596a('0x1f')],function(_0x50185f){return{'model':db[_0x50185f[_0x596a('0x20')]],'as':_0x50185f['as'],'attributes':_0x50185f[_0x596a('0x1c')],'include':_0x50185f[_0x596a('0x1f')]?_[_0x596a('0x1e')](_0x50185f[_0x596a('0x1f')],function(_0x531c04){return{'model':db[_0x531c04[_0x596a('0x20')]],'as':_0x531c04['as'],'attributes':_0x531c04['attributes'],'include':_0x531c04['include']?_[_0x596a('0x1e')](_0x531c04[_0x596a('0x1f')],function(_0x4dc29e){return{'model':db[_0x4dc29e[_0x596a('0x20')]],'as':_0x4dc29e['as'],'attributes':_0x4dc29e[_0x596a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x596a('0xd')](function(_0xad59a1){logger[_0x596a('0xe')](_0x596a('0x22'),_0x3cfd05);logger['debug'](_0x596a('0x22'),_0x3cfd05,JSON[_0x596a('0x23')](_0xad59a1));_0x35122e(_0xad59a1);})[_0x596a('0x16')](function(_0x297ef8){logger[_0x596a('0x11')](_0x596a('0x22'),_0x297ef8[_0x596a('0x13')],_0x3cfd05);_0x59ec65(_0x610079[_0x596a('0x11')](0x1f4,_0x297ef8[_0x596a('0x13')]));});});};
\ No newline at end of file
index 3f8607c..9e2c40b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2f9=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x593f03,_0x4af84a){var _0x178299=function(_0x284500){while(--_0x284500){_0x593f03['push'](_0x593f03['shift']());}};_0x178299(++_0x4af84a);}(_0xe2f9,0x9e));var _0x9e2f=function(_0x461642,_0x45cedc){_0x461642=_0x461642-0x0;var _0x237f26=_0xe2f9[_0x461642];return _0x237f26;};'use strict';var multer=require(_0x9e2f('0x0'));var util=require(_0x9e2f('0x1'));var path=require(_0x9e2f('0x2'));var timeout=require(_0x9e2f('0x3'));var express=require('express');var router=express[_0x9e2f('0x4')]();var fs_extra=require(_0x9e2f('0x5'));var auth=require(_0x9e2f('0x6'));var interaction=require(_0x9e2f('0x7'));var config=require(_0x9e2f('0x8'));var controller=require('./intFreshdeskConfiguration.controller');router['get']('/',auth[_0x9e2f('0x9')](),controller[_0x9e2f('0xa')]);router[_0x9e2f('0xb')](_0x9e2f('0xc'),auth[_0x9e2f('0x9')](),controller[_0x9e2f('0xd')]);router[_0x9e2f('0xb')]('/:id/fields',auth[_0x9e2f('0x9')](),controller[_0x9e2f('0xe')]);router[_0x9e2f('0xb')](_0x9e2f('0xf'),auth[_0x9e2f('0x9')](),controller[_0x9e2f('0x10')]);router[_0x9e2f('0xb')](_0x9e2f('0x11'),auth[_0x9e2f('0x9')](),controller[_0x9e2f('0x12')]);router[_0x9e2f('0xb')](_0x9e2f('0x13'),auth[_0x9e2f('0x9')](),controller[_0x9e2f('0x14')]);router[_0x9e2f('0x15')]('/',auth[_0x9e2f('0x9')](),controller['create']);router[_0x9e2f('0x15')](_0x9e2f('0x13'),auth[_0x9e2f('0x9')](),controller['setTags']);router[_0x9e2f('0x16')](_0x9e2f('0xc'),auth['isAuthenticated'](),controller[_0x9e2f('0x17')]);router[_0x9e2f('0x18')](_0x9e2f('0xc'),auth[_0x9e2f('0x9')](),controller[_0x9e2f('0x19')]);module[_0x9e2f('0x1a')]=router;
\ No newline at end of file
+var _0x83d1=['getTags','post','create','setTags','delete','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','/:id/tags'];(function(_0x5536af,_0xb75547){var _0xcfeaaa=function(_0x5391c7){while(--_0x5391c7){_0x5536af['push'](_0x5536af['shift']());}};_0xcfeaaa(++_0xb75547);}(_0x83d1,0xe2));var _0x183d=function(_0x8430f6,_0x40c010){_0x8430f6=_0x8430f6-0x0;var _0x558dbb=_0x83d1[_0x8430f6];return _0x558dbb;};'use strict';var multer=require(_0x183d('0x0'));var util=require(_0x183d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x183d('0x2'));var router=express[_0x183d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x183d('0x4'));var interaction=require(_0x183d('0x5'));var config=require(_0x183d('0x6'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x183d('0x7')]('/',auth[_0x183d('0x8')](),controller[_0x183d('0x9')]);router[_0x183d('0x7')]('/:id',auth[_0x183d('0x8')](),controller[_0x183d('0xa')]);router[_0x183d('0x7')](_0x183d('0xb'),auth[_0x183d('0x8')](),controller[_0x183d('0xc')]);router[_0x183d('0x7')](_0x183d('0xd'),auth[_0x183d('0x8')](),controller['getSubjects']);router[_0x183d('0x7')](_0x183d('0xe'),auth[_0x183d('0x8')](),controller['getDescriptions']);router[_0x183d('0x7')](_0x183d('0xf'),auth[_0x183d('0x8')](),controller[_0x183d('0x10')]);router[_0x183d('0x11')]('/',auth[_0x183d('0x8')](),controller[_0x183d('0x12')]);router[_0x183d('0x11')](_0x183d('0xf'),auth[_0x183d('0x8')](),controller[_0x183d('0x13')]);router['put']('/:id',auth[_0x183d('0x8')](),controller['update']);router[_0x183d('0x14')]('/:id',auth[_0x183d('0x8')](),controller['destroy']);module[_0x183d('0x15')]=router;
\ No newline at end of file
index b6522cb..a9998fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d6f=['STRING','sequelize','exports'];(function(_0x22d1d0,_0x3ada30){var _0xb8f7f=function(_0x4c15ee){while(--_0x4c15ee){_0x22d1d0['push'](_0x22d1d0['shift']());}};_0xb8f7f(++_0x3ada30);}(_0x3d6f,0x8e));var _0xf3d6=function(_0x4c05da,_0x414720){_0x4c05da=_0x4c05da-0x0;var _0x1614db=_0x3d6f[_0x4c05da];return _0x1614db;};'use strict';var Sequelize=require(_0xf3d6('0x0'));module[_0xf3d6('0x1')]={'name':{'type':Sequelize[_0xf3d6('0x2')]},'description':{'type':Sequelize[_0xf3d6('0x2')]}};
\ No newline at end of file
+var _0x7f1c=['STRING','sequelize'];(function(_0x18592,_0xf82d77){var _0x3f4daa=function(_0x49080a){while(--_0x49080a){_0x18592['push'](_0x18592['shift']());}};_0x3f4daa(++_0xf82d77);}(_0x7f1c,0x131));var _0xc7f1=function(_0xe06dfd,_0x553a8b){_0xe06dfd=_0xe06dfd-0x0;var _0x35a4c3=_0x7f1c[_0xe06dfd];return _0x35a4c3;};'use strict';var Sequelize=require(_0xc7f1('0x0'));module['exports']={'name':{'type':Sequelize[_0xc7f1('0x1')]},'description':{'type':Sequelize[_0xc7f1('0x1')]}};
\ No newline at end of file
index 3360c8f..29020e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dc7=['attributes','find','create','body','findOne','FreshdeskField','getFields','getSubjects','rawAttributes','nolimit','getDescriptions','Tag','getTags','setTags','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','save','update','destroy','then','stack','name','send','map','FreshdeskConfiguration','type','query','keys','filters','intersection','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params'];(function(_0x15a40f,_0x80b57f){var _0x172d2a=function(_0x1cfc72){while(--_0x1cfc72){_0x15a40f['push'](_0x15a40f['shift']());}};_0x172d2a(++_0x80b57f);}(_0x2dc7,0x14e));var _0x72dc=function(_0x2c96f6,_0x877207){_0x2c96f6=_0x2c96f6-0x0;var _0x6d4808=_0x2dc7[_0x2c96f6];return _0x6d4808;};'use strict';var emlformat=require(_0x72dc('0x0'));var rimraf=require(_0x72dc('0x1'));var zipdir=require(_0x72dc('0x2'));var jsonpatch=require(_0x72dc('0x3'));var rp=require('request-promise');var moment=require(_0x72dc('0x4'));var BPromise=require(_0x72dc('0x5'));var Mustache=require(_0x72dc('0x6'));var util=require(_0x72dc('0x7'));var path=require(_0x72dc('0x8'));var sox=require(_0x72dc('0x9'));var csv=require(_0x72dc('0xa'));var ejs=require(_0x72dc('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x72dc('0xc'));var crypto=require('crypto');var jsforce=require(_0x72dc('0xd'));var deskjs=require(_0x72dc('0xe'));var toCsv=require('to-csv');var querystring=require(_0x72dc('0xf'));var Papa=require(_0x72dc('0x10'));var Redis=require(_0x72dc('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x72dc('0x12'));var as=require(_0x72dc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x72dc('0x14'));var utils=require(_0x72dc('0x15'));var config=require(_0x72dc('0x16'));var licenseUtil=require(_0x72dc('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3760e0,_0x3998ad){_0x3998ad=_0x3998ad||0xcc;return function(_0x2cea31){if(_0x2cea31){return _0x3760e0[_0x72dc('0x18')](_0x3998ad);}return _0x3760e0[_0x72dc('0x19')](_0x3998ad)[_0x72dc('0x1a')]();};}function respondWithResult(_0x510a59,_0x5794eb){_0x5794eb=_0x5794eb||0xc8;return function(_0x40abdd){if(_0x40abdd){return _0x510a59[_0x72dc('0x19')](_0x5794eb)[_0x72dc('0x1b')](_0x40abdd);}};}function respondWithFilteredResult(_0x1d8013,_0x398452){return function(_0x123ab6){if(_0x123ab6){var _0x9f600d=typeof _0x398452[_0x72dc('0x1c')]==='undefined'&&typeof _0x398452[_0x72dc('0x1d')]==='undefined';var _0x22603d=_0x123ab6[_0x72dc('0x1e')];var _0x499379=_0x9f600d?0x0:_0x398452['offset'];var _0xdbc16d=_0x9f600d?_0x123ab6[_0x72dc('0x1e')]:_0x398452[_0x72dc('0x1c')]+_0x398452[_0x72dc('0x1d')];var _0x32c6bc;if(_0xdbc16d>=_0x22603d){_0xdbc16d=_0x22603d;_0x32c6bc=0xc8;}else{_0x32c6bc=0xce;}_0x1d8013[_0x72dc('0x19')](_0x32c6bc);return _0x1d8013[_0x72dc('0x1f')](_0x72dc('0x20'),_0x499379+'-'+_0xdbc16d+'/'+_0x22603d)[_0x72dc('0x1b')](_0x123ab6);}return null;};}function patchUpdates(_0x3131a0){return function(_0xd219d6){try{jsonpatch[_0x72dc('0x21')](_0xd219d6,_0x3131a0,!![]);}catch(_0x4e5fc3){return BPromise['reject'](_0x4e5fc3);}return _0xd219d6[_0x72dc('0x22')]();};}function saveUpdates(_0xa7c5ed,_0x2669e1){return function(_0x8610c3){if(_0x8610c3){return _0x8610c3[_0x72dc('0x23')](_0xa7c5ed)['then'](function(_0x14dea6){return _0x14dea6;});}return null;};}function removeEntity(_0x43a5a2,_0x45d7a0){return function(_0xeb4850){if(_0xeb4850){return _0xeb4850[_0x72dc('0x24')]()[_0x72dc('0x25')](function(){_0x43a5a2[_0x72dc('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3906ab,_0x2bf99f){return function(_0xe8ce56){if(!_0xe8ce56){_0x3906ab[_0x72dc('0x18')](0x194);}return _0xe8ce56;};}function handleError(_0x266f0c,_0x3dafd5){_0x3dafd5=_0x3dafd5||0x1f4;return function(_0x4bfb58){logger['error'](_0x4bfb58[_0x72dc('0x26')]);if(_0x4bfb58['name']){delete _0x4bfb58[_0x72dc('0x27')];}_0x266f0c[_0x72dc('0x19')](_0x3dafd5)[_0x72dc('0x28')](_0x4bfb58);};}exports['index']=function(_0x17692d,_0x1a7203){var _0x4fe493={},_0x31c6a4={},_0x4d3c6e={'count':0x0,'rows':[]};var _0x312486=_[_0x72dc('0x29')](db[_0x72dc('0x2a')]['rawAttributes'],function(_0x53551a){return{'name':_0x53551a['fieldName'],'type':_0x53551a[_0x72dc('0x2b')]['key']};});_0x31c6a4['model']=_['map'](_0x312486,_0x72dc('0x27'));_0x31c6a4[_0x72dc('0x2c')]=_[_0x72dc('0x2d')](_0x17692d[_0x72dc('0x2c')]);_0x31c6a4[_0x72dc('0x2e')]=_[_0x72dc('0x2f')](_0x31c6a4[_0x72dc('0x30')],_0x31c6a4[_0x72dc('0x2c')]);_0x4fe493['attributes']=_['intersection'](_0x31c6a4[_0x72dc('0x30')],qs[_0x72dc('0x31')](_0x17692d['query'][_0x72dc('0x31')]));_0x4fe493['attributes']=_0x4fe493['attributes'][_0x72dc('0x32')]?_0x4fe493['attributes']:_0x31c6a4['model'];if(!_0x17692d[_0x72dc('0x2c')][_0x72dc('0x33')]('nolimit')){_0x4fe493[_0x72dc('0x1d')]=qs[_0x72dc('0x1d')](_0x17692d[_0x72dc('0x2c')]['limit']);_0x4fe493[_0x72dc('0x1c')]=qs[_0x72dc('0x1c')](_0x17692d[_0x72dc('0x2c')][_0x72dc('0x1c')]);}_0x4fe493[_0x72dc('0x34')]=qs[_0x72dc('0x35')](_0x17692d['query']['sort']);_0x4fe493[_0x72dc('0x36')]=qs['filters'](_[_0x72dc('0x37')](_0x17692d[_0x72dc('0x2c')],_0x31c6a4['filters']),_0x312486);if(_0x17692d[_0x72dc('0x2c')][_0x72dc('0x38')]){_0x4fe493[_0x72dc('0x36')]=_[_0x72dc('0x39')](_0x4fe493[_0x72dc('0x36')],{'$or':_[_0x72dc('0x29')](_0x312486,function(_0x271ff1){if(_0x271ff1[_0x72dc('0x2b')]!==_0x72dc('0x3a')){var _0x302fee={};_0x302fee[_0x271ff1['name']]={'$like':'%'+_0x17692d['query']['filter']+'%'};return _0x302fee;}})});}_0x4fe493=_[_0x72dc('0x39')]({},_0x4fe493,_0x17692d[_0x72dc('0x3b')]);var _0xb42c4d={'where':_0x4fe493[_0x72dc('0x36')]};return db[_0x72dc('0x2a')][_0x72dc('0x1e')](_0xb42c4d)[_0x72dc('0x25')](function(_0x120029){_0x4d3c6e[_0x72dc('0x1e')]=_0x120029;if(_0x17692d[_0x72dc('0x2c')][_0x72dc('0x3c')]){_0x4fe493[_0x72dc('0x3d')]=[{'all':!![]}];}return db[_0x72dc('0x2a')][_0x72dc('0x3e')](_0x4fe493);})['then'](function(_0x3e0bc5){_0x4d3c6e['rows']=_0x3e0bc5;return _0x4d3c6e;})[_0x72dc('0x25')](respondWithFilteredResult(_0x1a7203,_0x4fe493))[_0x72dc('0x3f')](handleError(_0x1a7203,null));};exports[_0x72dc('0x40')]=function(_0x580569,_0x3b8c85){var _0x31dad4={'raw':![],'where':{'id':_0x580569[_0x72dc('0x41')]['id']}},_0x5c99cc={};_0x5c99cc[_0x72dc('0x30')]=_[_0x72dc('0x2d')](db['FreshdeskConfiguration']['rawAttributes']);_0x5c99cc[_0x72dc('0x2c')]=_[_0x72dc('0x2d')](_0x580569['query']);_0x5c99cc[_0x72dc('0x2e')]=_[_0x72dc('0x2f')](_0x5c99cc[_0x72dc('0x30')],_0x5c99cc[_0x72dc('0x2c')]);_0x31dad4['attributes']=_[_0x72dc('0x2f')](_0x5c99cc[_0x72dc('0x30')],qs['fields'](_0x580569[_0x72dc('0x2c')][_0x72dc('0x31')]));_0x31dad4[_0x72dc('0x42')]=_0x31dad4[_0x72dc('0x42')]['length']?_0x31dad4[_0x72dc('0x42')]:_0x5c99cc[_0x72dc('0x30')];if(_0x580569[_0x72dc('0x2c')][_0x72dc('0x3c')]){_0x31dad4[_0x72dc('0x3d')]=[{'all':!![]}];}_0x31dad4=_[_0x72dc('0x39')]({},_0x31dad4,_0x580569[_0x72dc('0x3b')]);return db[_0x72dc('0x2a')][_0x72dc('0x43')](_0x31dad4)[_0x72dc('0x25')](handleEntityNotFound(_0x3b8c85,null))[_0x72dc('0x25')](respondWithResult(_0x3b8c85,null))[_0x72dc('0x3f')](handleError(_0x3b8c85,null));};exports[_0x72dc('0x44')]=function(_0x245329,_0x283058){return db[_0x72dc('0x2a')][_0x72dc('0x44')](_0x245329[_0x72dc('0x45')],{})[_0x72dc('0x25')](respondWithResult(_0x283058,0xc9))['catch'](handleError(_0x283058,null));};exports[_0x72dc('0x23')]=function(_0x5d1e99,_0x7a44c3){if(_0x5d1e99[_0x72dc('0x45')]['id']){delete _0x5d1e99[_0x72dc('0x45')]['id'];}return db[_0x72dc('0x2a')]['find']({'where':{'id':_0x5d1e99[_0x72dc('0x41')]['id']}})[_0x72dc('0x25')](handleEntityNotFound(_0x7a44c3,null))[_0x72dc('0x25')](saveUpdates(_0x5d1e99[_0x72dc('0x45')],null))['then'](respondWithResult(_0x7a44c3,null))[_0x72dc('0x3f')](handleError(_0x7a44c3,null));};exports[_0x72dc('0x24')]=function(_0x1a4516,_0x1546f9){return db[_0x72dc('0x2a')][_0x72dc('0x43')]({'where':{'id':_0x1a4516['params']['id']}})['then'](handleEntityNotFound(_0x1546f9,null))[_0x72dc('0x25')](removeEntity(_0x1546f9,null))[_0x72dc('0x3f')](handleError(_0x1546f9,null));};exports['getFields']=function(_0x8b2b9f,_0xfa8686,_0x3ab508){var _0x53603c={};var _0x50a697={};var _0xfa6d40;var _0x45ba52;return db[_0x72dc('0x2a')][_0x72dc('0x46')]({'where':{'id':_0x8b2b9f['params']['id']}})['then'](handleEntityNotFound(_0xfa8686,null))[_0x72dc('0x25')](function(_0x12bd32){if(_0x12bd32){_0xfa6d40=_0x12bd32;_0x50a697[_0x72dc('0x30')]=_[_0x72dc('0x2d')](db[_0x72dc('0x47')]['rawAttributes']);_0x50a697[_0x72dc('0x2c')]=_[_0x72dc('0x2d')](_0x8b2b9f[_0x72dc('0x2c')]);_0x50a697[_0x72dc('0x2e')]=_['intersection'](_0x50a697[_0x72dc('0x30')],_0x50a697['query']);_0x53603c[_0x72dc('0x42')]=_['intersection'](_0x50a697[_0x72dc('0x30')],qs[_0x72dc('0x31')](_0x8b2b9f[_0x72dc('0x2c')][_0x72dc('0x31')]));_0x53603c[_0x72dc('0x42')]=_0x53603c[_0x72dc('0x42')][_0x72dc('0x32')]?_0x53603c[_0x72dc('0x42')]:_0x50a697[_0x72dc('0x30')];_0x53603c[_0x72dc('0x34')]=qs['sort'](_0x8b2b9f['query'][_0x72dc('0x35')]);_0x53603c['where']=qs[_0x72dc('0x2e')](_[_0x72dc('0x37')](_0x8b2b9f['query'],_0x50a697[_0x72dc('0x2e')]));if(_0x8b2b9f['query'][_0x72dc('0x38')]){_0x53603c[_0x72dc('0x36')]=_[_0x72dc('0x39')](_0x53603c[_0x72dc('0x36')],{'$or':_[_0x72dc('0x29')](_0x53603c[_0x72dc('0x42')],function(_0x4b118a){var _0x594bbc={};_0x594bbc[_0x4b118a]={'$like':'%'+_0x8b2b9f[_0x72dc('0x2c')]['filter']+'%'};return _0x594bbc;})});}_0x53603c=_[_0x72dc('0x39')]({},_0x53603c,_0x8b2b9f['options']);return _0xfa6d40[_0x72dc('0x48')](_0x53603c);}})[_0x72dc('0x25')](function(_0x40b36a){if(_0x40b36a){_0x45ba52=_0x40b36a[_0x72dc('0x32')];if(!_0x8b2b9f[_0x72dc('0x2c')][_0x72dc('0x33')]('nolimit')){_0x53603c['limit']=qs[_0x72dc('0x1d')](_0x8b2b9f[_0x72dc('0x2c')]['limit']);_0x53603c[_0x72dc('0x1c')]=qs[_0x72dc('0x1c')](_0x8b2b9f['query'][_0x72dc('0x1c')]);}return _0xfa6d40[_0x72dc('0x48')](_0x53603c);}})[_0x72dc('0x25')](function(_0x39fdd3){if(_0x39fdd3){return _0x39fdd3?{'count':_0x45ba52,'rows':_0x39fdd3}:null;}})[_0x72dc('0x25')](respondWithResult(_0xfa8686,null))['catch'](handleError(_0xfa8686,null));};exports[_0x72dc('0x49')]=function(_0x2fbfbb,_0xce2432,_0x3a8561){var _0x442c9b={};var _0xf8f316={};var _0x3d5955;var _0x2028d5;return db[_0x72dc('0x2a')][_0x72dc('0x46')]({'where':{'id':_0x2fbfbb['params']['id']}})['then'](handleEntityNotFound(_0xce2432,null))[_0x72dc('0x25')](function(_0x112081){if(_0x112081){_0x3d5955=_0x112081;_0xf8f316[_0x72dc('0x30')]=_[_0x72dc('0x2d')](db['FreshdeskField'][_0x72dc('0x4a')]);_0xf8f316[_0x72dc('0x2c')]=_[_0x72dc('0x2d')](_0x2fbfbb[_0x72dc('0x2c')]);_0xf8f316['filters']=_[_0x72dc('0x2f')](_0xf8f316['model'],_0xf8f316[_0x72dc('0x2c')]);_0x442c9b[_0x72dc('0x42')]=_[_0x72dc('0x2f')](_0xf8f316[_0x72dc('0x30')],qs[_0x72dc('0x31')](_0x2fbfbb['query'][_0x72dc('0x31')]));_0x442c9b[_0x72dc('0x42')]=_0x442c9b['attributes']['length']?_0x442c9b[_0x72dc('0x42')]:_0xf8f316[_0x72dc('0x30')];_0x442c9b[_0x72dc('0x34')]=qs['sort'](_0x2fbfbb[_0x72dc('0x2c')][_0x72dc('0x35')]);_0x442c9b[_0x72dc('0x36')]=qs[_0x72dc('0x2e')](_[_0x72dc('0x37')](_0x2fbfbb[_0x72dc('0x2c')],_0xf8f316[_0x72dc('0x2e')]));if(_0x2fbfbb[_0x72dc('0x2c')][_0x72dc('0x38')]){_0x442c9b[_0x72dc('0x36')]=_[_0x72dc('0x39')](_0x442c9b[_0x72dc('0x36')],{'$or':_[_0x72dc('0x29')](_0x442c9b[_0x72dc('0x42')],function(_0x2253e4){var _0x4a114a={};_0x4a114a[_0x2253e4]={'$like':'%'+_0x2fbfbb[_0x72dc('0x2c')][_0x72dc('0x38')]+'%'};return _0x4a114a;})});}_0x442c9b=_[_0x72dc('0x39')]({},_0x442c9b,_0x2fbfbb['options']);return _0x3d5955['getSubjects'](_0x442c9b);}})[_0x72dc('0x25')](function(_0x259f7e){if(_0x259f7e){_0x2028d5=_0x259f7e[_0x72dc('0x32')];if(!_0x2fbfbb['query'][_0x72dc('0x33')](_0x72dc('0x4b'))){_0x442c9b['limit']=qs[_0x72dc('0x1d')](_0x2fbfbb[_0x72dc('0x2c')]['limit']);_0x442c9b['offset']=qs[_0x72dc('0x1c')](_0x2fbfbb['query'][_0x72dc('0x1c')]);}return _0x3d5955['getSubjects'](_0x442c9b);}})[_0x72dc('0x25')](function(_0x2102b0){if(_0x2102b0){return _0x2102b0?{'count':_0x2028d5,'rows':_0x2102b0}:null;}})[_0x72dc('0x25')](respondWithResult(_0xce2432,null))['catch'](handleError(_0xce2432,null));};exports[_0x72dc('0x4c')]=function(_0x4ac2b7,_0x1f71a7,_0x1e0ae0){var _0x3b7d43={};var _0x46f208={};var _0x2b6a59;var _0x597bb2;return db[_0x72dc('0x2a')][_0x72dc('0x46')]({'where':{'id':_0x4ac2b7[_0x72dc('0x41')]['id']}})[_0x72dc('0x25')](handleEntityNotFound(_0x1f71a7,null))['then'](function(_0x24b602){if(_0x24b602){_0x2b6a59=_0x24b602;_0x46f208[_0x72dc('0x30')]=_[_0x72dc('0x2d')](db['FreshdeskField'][_0x72dc('0x4a')]);_0x46f208[_0x72dc('0x2c')]=_[_0x72dc('0x2d')](_0x4ac2b7[_0x72dc('0x2c')]);_0x46f208['filters']=_['intersection'](_0x46f208[_0x72dc('0x30')],_0x46f208[_0x72dc('0x2c')]);_0x3b7d43['attributes']=_[_0x72dc('0x2f')](_0x46f208['model'],qs[_0x72dc('0x31')](_0x4ac2b7[_0x72dc('0x2c')][_0x72dc('0x31')]));_0x3b7d43['attributes']=_0x3b7d43[_0x72dc('0x42')][_0x72dc('0x32')]?_0x3b7d43['attributes']:_0x46f208[_0x72dc('0x30')];_0x3b7d43['order']=qs[_0x72dc('0x35')](_0x4ac2b7[_0x72dc('0x2c')][_0x72dc('0x35')]);_0x3b7d43['where']=qs[_0x72dc('0x2e')](_['pick'](_0x4ac2b7[_0x72dc('0x2c')],_0x46f208[_0x72dc('0x2e')]));if(_0x4ac2b7[_0x72dc('0x2c')]['filter']){_0x3b7d43[_0x72dc('0x36')]=_[_0x72dc('0x39')](_0x3b7d43['where'],{'$or':_[_0x72dc('0x29')](_0x3b7d43[_0x72dc('0x42')],function(_0x1c844f){var _0x399bfd={};_0x399bfd[_0x1c844f]={'$like':'%'+_0x4ac2b7[_0x72dc('0x2c')]['filter']+'%'};return _0x399bfd;})});}_0x3b7d43=_[_0x72dc('0x39')]({},_0x3b7d43,_0x4ac2b7[_0x72dc('0x3b')]);return _0x2b6a59[_0x72dc('0x4c')](_0x3b7d43);}})[_0x72dc('0x25')](function(_0x2cd34e){if(_0x2cd34e){_0x597bb2=_0x2cd34e[_0x72dc('0x32')];if(!_0x4ac2b7[_0x72dc('0x2c')][_0x72dc('0x33')](_0x72dc('0x4b'))){_0x3b7d43[_0x72dc('0x1d')]=qs[_0x72dc('0x1d')](_0x4ac2b7['query'][_0x72dc('0x1d')]);_0x3b7d43['offset']=qs[_0x72dc('0x1c')](_0x4ac2b7[_0x72dc('0x2c')][_0x72dc('0x1c')]);}return _0x2b6a59['getDescriptions'](_0x3b7d43);}})['then'](function(_0x25460b){if(_0x25460b){return _0x25460b?{'count':_0x597bb2,'rows':_0x25460b}:null;}})[_0x72dc('0x25')](respondWithResult(_0x1f71a7,null))[_0x72dc('0x3f')](handleError(_0x1f71a7,null));};exports['getTags']=function(_0x298034,_0xe02a0d,_0x4bd256){var _0x35c364={};var _0x81b3bd={};var _0x50b495;var _0x40dd9d;return db[_0x72dc('0x2a')][_0x72dc('0x46')]({'where':{'id':_0x298034[_0x72dc('0x41')]['id']}})[_0x72dc('0x25')](handleEntityNotFound(_0xe02a0d,null))[_0x72dc('0x25')](function(_0x13c9e3){if(_0x13c9e3){_0x50b495=_0x13c9e3;_0x81b3bd[_0x72dc('0x30')]=_[_0x72dc('0x2d')](db[_0x72dc('0x4d')][_0x72dc('0x4a')]);_0x81b3bd[_0x72dc('0x2c')]=_[_0x72dc('0x2d')](_0x298034[_0x72dc('0x2c')]);_0x81b3bd[_0x72dc('0x2e')]=_[_0x72dc('0x2f')](_0x81b3bd[_0x72dc('0x30')],_0x81b3bd[_0x72dc('0x2c')]);_0x35c364[_0x72dc('0x42')]=_[_0x72dc('0x2f')](_0x81b3bd[_0x72dc('0x30')],qs[_0x72dc('0x31')](_0x298034[_0x72dc('0x2c')][_0x72dc('0x31')]));_0x35c364[_0x72dc('0x42')]=_0x35c364[_0x72dc('0x42')]['length']?_0x35c364[_0x72dc('0x42')]:_0x81b3bd['model'];_0x35c364[_0x72dc('0x34')]=qs[_0x72dc('0x35')](_0x298034[_0x72dc('0x2c')][_0x72dc('0x35')]);_0x35c364[_0x72dc('0x36')]=qs[_0x72dc('0x2e')](_[_0x72dc('0x37')](_0x298034[_0x72dc('0x2c')],_0x81b3bd[_0x72dc('0x2e')]));if(_0x298034[_0x72dc('0x2c')]['filter']){_0x35c364[_0x72dc('0x36')]=_['merge'](_0x35c364[_0x72dc('0x36')],{'$or':_['map'](_0x35c364['attributes'],function(_0x49b5f6){var _0x2f6d92={};_0x2f6d92[_0x49b5f6]={'$like':'%'+_0x298034[_0x72dc('0x2c')][_0x72dc('0x38')]+'%'};return _0x2f6d92;})});}_0x35c364=_[_0x72dc('0x39')]({},_0x35c364,_0x298034[_0x72dc('0x3b')]);return _0x50b495[_0x72dc('0x4e')](_0x35c364);}})[_0x72dc('0x25')](function(_0x280389){if(_0x280389){_0x40dd9d=_0x280389[_0x72dc('0x32')];if(!_0x298034[_0x72dc('0x2c')][_0x72dc('0x33')]('nolimit')){_0x35c364['limit']=qs[_0x72dc('0x1d')](_0x298034[_0x72dc('0x2c')][_0x72dc('0x1d')]);_0x35c364[_0x72dc('0x1c')]=qs[_0x72dc('0x1c')](_0x298034['query']['offset']);}return _0x50b495['getTags'](_0x35c364);}})[_0x72dc('0x25')](function(_0x491c47){if(_0x491c47){return _0x491c47?{'count':_0x40dd9d,'rows':_0x491c47}:null;}})[_0x72dc('0x25')](respondWithResult(_0xe02a0d,null))[_0x72dc('0x3f')](handleError(_0xe02a0d,null));};exports['setTags']=function(_0x2fd785,_0x2508de,_0x104a0){if(_0x2fd785[_0x72dc('0x45')]['id']){delete _0x2fd785[_0x72dc('0x45')]['id'];}return db[_0x72dc('0x2a')][_0x72dc('0x46')]({'where':{'id':_0x2fd785[_0x72dc('0x41')]['id']}})['then'](handleEntityNotFound(_0x2508de,null))[_0x72dc('0x25')](function(_0x3c265d){if(_0x3c265d){return _0x3c265d[_0x72dc('0x4f')](_0x2fd785[_0x72dc('0x45')]['ids']||[]);}return null;})[_0x72dc('0x25')](respondWithResult(_0x2508de,null))[_0x72dc('0x3f')](handleError(_0x2508de,null));};
\ No newline at end of file
+var _0x3c72=['attributes','fields','where','pick','filter','merge','rows','catch','show','length','options','find','create','body','params','destroy','findOne','FreshdeskField','order','sort','getFields','hasOwnProperty','nolimit','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x2c77b9,_0x45f5e3){var _0x3c2596=function(_0x4facf6){while(--_0x4facf6){_0x2c77b9['push'](_0x2c77b9['shift']());}};_0x3c2596(++_0x45f5e3);}(_0x3c72,0x6b));var _0x23c7=function(_0x2854f5,_0x59c45e){_0x2854f5=_0x2854f5-0x0;var _0x39706a=_0x3c72[_0x2854f5];return _0x39706a;};'use strict';var emlformat=require(_0x23c7('0x0'));var rimraf=require(_0x23c7('0x1'));var zipdir=require(_0x23c7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x23c7('0x3'));var moment=require(_0x23c7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x23c7('0x5'));var util=require(_0x23c7('0x6'));var path=require(_0x23c7('0x7'));var sox=require(_0x23c7('0x8'));var csv=require(_0x23c7('0x9'));var ejs=require(_0x23c7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x23c7('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x23c7('0x9'));var querystring=require('querystring');var Papa=require(_0x23c7('0xc'));var Redis=require(_0x23c7('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x23c7('0xe'));var as=require(_0x23c7('0xf'));var hardwareService=require(_0x23c7('0x10'));var logger=require(_0x23c7('0x11'))(_0x23c7('0x12'));var utils=require('../../config/utils');var config=require(_0x23c7('0x13'));var licenseUtil=require(_0x23c7('0x14'));var db=require(_0x23c7('0x15'))['db'];function respondWithStatusCode(_0x267680,_0x44c3af){_0x44c3af=_0x44c3af||0xcc;return function(_0x32ed05){if(_0x32ed05){return _0x267680[_0x23c7('0x16')](_0x44c3af);}return _0x267680['status'](_0x44c3af)['end']();};}function respondWithResult(_0xbbf0d1,_0x515947){_0x515947=_0x515947||0xc8;return function(_0x34d2c3){if(_0x34d2c3){return _0xbbf0d1[_0x23c7('0x17')](_0x515947)[_0x23c7('0x18')](_0x34d2c3);}};}function respondWithFilteredResult(_0x1c496c,_0x4ae6e9){return function(_0x375ccd){if(_0x375ccd){var _0x240ad4=typeof _0x4ae6e9[_0x23c7('0x19')]===_0x23c7('0x1a')&&typeof _0x4ae6e9[_0x23c7('0x1b')]==='undefined';var _0x957018=_0x375ccd['count'];var _0x511fc1=_0x240ad4?0x0:_0x4ae6e9[_0x23c7('0x19')];var _0x571b2c=_0x240ad4?_0x375ccd[_0x23c7('0x1c')]:_0x4ae6e9['offset']+_0x4ae6e9[_0x23c7('0x1b')];var _0xe48476;if(_0x571b2c>=_0x957018){_0x571b2c=_0x957018;_0xe48476=0xc8;}else{_0xe48476=0xce;}_0x1c496c[_0x23c7('0x17')](_0xe48476);return _0x1c496c[_0x23c7('0x1d')](_0x23c7('0x1e'),_0x511fc1+'-'+_0x571b2c+'/'+_0x957018)[_0x23c7('0x18')](_0x375ccd);}return null;};}function patchUpdates(_0x1efc16){return function(_0x20baa5){try{jsonpatch[_0x23c7('0x1f')](_0x20baa5,_0x1efc16,!![]);}catch(_0x2f9c1d){return BPromise[_0x23c7('0x20')](_0x2f9c1d);}return _0x20baa5[_0x23c7('0x21')]();};}function saveUpdates(_0x4d4b3a,_0x1cc19e){return function(_0x38f34c){if(_0x38f34c){return _0x38f34c[_0x23c7('0x22')](_0x4d4b3a)[_0x23c7('0x23')](function(_0x34a04d){return _0x34a04d;});}return null;};}function removeEntity(_0x1c2080,_0x55dd83){return function(_0x1e63a8){if(_0x1e63a8){return _0x1e63a8['destroy']()['then'](function(){_0x1c2080['status'](0xcc)[_0x23c7('0x24')]();});}};}function handleEntityNotFound(_0x10c613,_0x5c6931){return function(_0x35323f){if(!_0x35323f){_0x10c613['sendStatus'](0x194);}return _0x35323f;};}function handleError(_0x2bae0d,_0x8918ad){_0x8918ad=_0x8918ad||0x1f4;return function(_0x154085){logger['error'](_0x154085['stack']);if(_0x154085[_0x23c7('0x25')]){delete _0x154085[_0x23c7('0x25')];}_0x2bae0d['status'](_0x8918ad)[_0x23c7('0x26')](_0x154085);};}exports[_0x23c7('0x27')]=function(_0x59196f,_0x5f151d){var _0x4763db={},_0x27ad21={},_0x2f4d63={'count':0x0,'rows':[]};var _0x31f38b=_[_0x23c7('0x28')](db[_0x23c7('0x29')][_0x23c7('0x2a')],function(_0x36c519){return{'name':_0x36c519[_0x23c7('0x2b')],'type':_0x36c519[_0x23c7('0x2c')][_0x23c7('0x2d')]};});_0x27ad21[_0x23c7('0x2e')]=_['map'](_0x31f38b,_0x23c7('0x25'));_0x27ad21[_0x23c7('0x2f')]=_[_0x23c7('0x30')](_0x59196f[_0x23c7('0x2f')]);_0x27ad21[_0x23c7('0x31')]=_[_0x23c7('0x32')](_0x27ad21[_0x23c7('0x2e')],_0x27ad21['query']);_0x4763db[_0x23c7('0x33')]=_['intersection'](_0x27ad21[_0x23c7('0x2e')],qs[_0x23c7('0x34')](_0x59196f['query'][_0x23c7('0x34')]));_0x4763db['attributes']=_0x4763db['attributes']['length']?_0x4763db[_0x23c7('0x33')]:_0x27ad21[_0x23c7('0x2e')];if(!_0x59196f[_0x23c7('0x2f')]['hasOwnProperty']('nolimit')){_0x4763db[_0x23c7('0x1b')]=qs[_0x23c7('0x1b')](_0x59196f[_0x23c7('0x2f')][_0x23c7('0x1b')]);_0x4763db['offset']=qs[_0x23c7('0x19')](_0x59196f[_0x23c7('0x2f')][_0x23c7('0x19')]);}_0x4763db['order']=qs['sort'](_0x59196f[_0x23c7('0x2f')]['sort']);_0x4763db[_0x23c7('0x35')]=qs['filters'](_[_0x23c7('0x36')](_0x59196f[_0x23c7('0x2f')],_0x27ad21[_0x23c7('0x31')]),_0x31f38b);if(_0x59196f['query'][_0x23c7('0x37')]){_0x4763db[_0x23c7('0x35')]=_[_0x23c7('0x38')](_0x4763db[_0x23c7('0x35')],{'$or':_['map'](_0x31f38b,function(_0x154ffd){if(_0x154ffd[_0x23c7('0x2c')]!=='VIRTUAL'){var _0x3f87f1={};_0x3f87f1[_0x154ffd[_0x23c7('0x25')]]={'$like':'%'+_0x59196f[_0x23c7('0x2f')][_0x23c7('0x37')]+'%'};return _0x3f87f1;}})});}_0x4763db=_[_0x23c7('0x38')]({},_0x4763db,_0x59196f['options']);var _0x171824={'where':_0x4763db[_0x23c7('0x35')]};return db[_0x23c7('0x29')][_0x23c7('0x1c')](_0x171824)[_0x23c7('0x23')](function(_0x5f4ecc){_0x2f4d63['count']=_0x5f4ecc;if(_0x59196f[_0x23c7('0x2f')]['includeAll']){_0x4763db['include']=[{'all':!![]}];}return db[_0x23c7('0x29')]['findAll'](_0x4763db);})['then'](function(_0x5a7c12){_0x2f4d63[_0x23c7('0x39')]=_0x5a7c12;return _0x2f4d63;})[_0x23c7('0x23')](respondWithFilteredResult(_0x5f151d,_0x4763db))[_0x23c7('0x3a')](handleError(_0x5f151d,null));};exports[_0x23c7('0x3b')]=function(_0x46b0e8,_0x5471a4){var _0x5ef285={'raw':![],'where':{'id':_0x46b0e8['params']['id']}},_0x252142={};_0x252142[_0x23c7('0x2e')]=_[_0x23c7('0x30')](db[_0x23c7('0x29')][_0x23c7('0x2a')]);_0x252142[_0x23c7('0x2f')]=_[_0x23c7('0x30')](_0x46b0e8[_0x23c7('0x2f')]);_0x252142['filters']=_[_0x23c7('0x32')](_0x252142[_0x23c7('0x2e')],_0x252142[_0x23c7('0x2f')]);_0x5ef285['attributes']=_[_0x23c7('0x32')](_0x252142[_0x23c7('0x2e')],qs[_0x23c7('0x34')](_0x46b0e8['query'][_0x23c7('0x34')]));_0x5ef285['attributes']=_0x5ef285[_0x23c7('0x33')][_0x23c7('0x3c')]?_0x5ef285[_0x23c7('0x33')]:_0x252142[_0x23c7('0x2e')];if(_0x46b0e8[_0x23c7('0x2f')]['includeAll']){_0x5ef285['include']=[{'all':!![]}];}_0x5ef285=_[_0x23c7('0x38')]({},_0x5ef285,_0x46b0e8[_0x23c7('0x3d')]);return db['FreshdeskConfiguration'][_0x23c7('0x3e')](_0x5ef285)['then'](handleEntityNotFound(_0x5471a4,null))[_0x23c7('0x23')](respondWithResult(_0x5471a4,null))[_0x23c7('0x3a')](handleError(_0x5471a4,null));};exports[_0x23c7('0x3f')]=function(_0x2628e1,_0x59dcca){return db['FreshdeskConfiguration'][_0x23c7('0x3f')](_0x2628e1[_0x23c7('0x40')],{})[_0x23c7('0x23')](respondWithResult(_0x59dcca,0xc9))[_0x23c7('0x3a')](handleError(_0x59dcca,null));};exports[_0x23c7('0x22')]=function(_0x531643,_0x3c3795){if(_0x531643['body']['id']){delete _0x531643[_0x23c7('0x40')]['id'];}return db[_0x23c7('0x29')][_0x23c7('0x3e')]({'where':{'id':_0x531643[_0x23c7('0x41')]['id']}})[_0x23c7('0x23')](handleEntityNotFound(_0x3c3795,null))['then'](saveUpdates(_0x531643[_0x23c7('0x40')],null))[_0x23c7('0x23')](respondWithResult(_0x3c3795,null))['catch'](handleError(_0x3c3795,null));};exports[_0x23c7('0x42')]=function(_0x3fb6e6,_0x37abb6){return db['FreshdeskConfiguration']['find']({'where':{'id':_0x3fb6e6[_0x23c7('0x41')]['id']}})[_0x23c7('0x23')](handleEntityNotFound(_0x37abb6,null))['then'](removeEntity(_0x37abb6,null))[_0x23c7('0x3a')](handleError(_0x37abb6,null));};exports['getFields']=function(_0xfb5bb7,_0x1adbee,_0x2101c5){var _0x396148={};var _0x9efe4b={};var _0x3f2afa;var _0x5a5b48;return db['FreshdeskConfiguration'][_0x23c7('0x43')]({'where':{'id':_0xfb5bb7[_0x23c7('0x41')]['id']}})[_0x23c7('0x23')](handleEntityNotFound(_0x1adbee,null))[_0x23c7('0x23')](function(_0x3b65ae){if(_0x3b65ae){_0x3f2afa=_0x3b65ae;_0x9efe4b[_0x23c7('0x2e')]=_['keys'](db[_0x23c7('0x44')][_0x23c7('0x2a')]);_0x9efe4b[_0x23c7('0x2f')]=_[_0x23c7('0x30')](_0xfb5bb7[_0x23c7('0x2f')]);_0x9efe4b['filters']=_[_0x23c7('0x32')](_0x9efe4b['model'],_0x9efe4b[_0x23c7('0x2f')]);_0x396148[_0x23c7('0x33')]=_[_0x23c7('0x32')](_0x9efe4b[_0x23c7('0x2e')],qs[_0x23c7('0x34')](_0xfb5bb7[_0x23c7('0x2f')][_0x23c7('0x34')]));_0x396148['attributes']=_0x396148[_0x23c7('0x33')][_0x23c7('0x3c')]?_0x396148[_0x23c7('0x33')]:_0x9efe4b['model'];_0x396148[_0x23c7('0x45')]=qs[_0x23c7('0x46')](_0xfb5bb7[_0x23c7('0x2f')][_0x23c7('0x46')]);_0x396148[_0x23c7('0x35')]=qs['filters'](_[_0x23c7('0x36')](_0xfb5bb7[_0x23c7('0x2f')],_0x9efe4b[_0x23c7('0x31')]));if(_0xfb5bb7['query'][_0x23c7('0x37')]){_0x396148[_0x23c7('0x35')]=_['merge'](_0x396148[_0x23c7('0x35')],{'$or':_[_0x23c7('0x28')](_0x396148[_0x23c7('0x33')],function(_0x47616e){var _0x3f322d={};_0x3f322d[_0x47616e]={'$like':'%'+_0xfb5bb7[_0x23c7('0x2f')][_0x23c7('0x37')]+'%'};return _0x3f322d;})});}_0x396148=_['merge']({},_0x396148,_0xfb5bb7[_0x23c7('0x3d')]);return _0x3f2afa[_0x23c7('0x47')](_0x396148);}})[_0x23c7('0x23')](function(_0x408cc8){if(_0x408cc8){_0x5a5b48=_0x408cc8[_0x23c7('0x3c')];if(!_0xfb5bb7[_0x23c7('0x2f')][_0x23c7('0x48')](_0x23c7('0x49'))){_0x396148[_0x23c7('0x1b')]=qs[_0x23c7('0x1b')](_0xfb5bb7[_0x23c7('0x2f')][_0x23c7('0x1b')]);_0x396148[_0x23c7('0x19')]=qs[_0x23c7('0x19')](_0xfb5bb7[_0x23c7('0x2f')][_0x23c7('0x19')]);}return _0x3f2afa[_0x23c7('0x47')](_0x396148);}})[_0x23c7('0x23')](function(_0x3c0254){if(_0x3c0254){return _0x3c0254?{'count':_0x5a5b48,'rows':_0x3c0254}:null;}})[_0x23c7('0x23')](respondWithResult(_0x1adbee,null))[_0x23c7('0x3a')](handleError(_0x1adbee,null));};exports[_0x23c7('0x4a')]=function(_0x803fec,_0xd34732,_0x156943){var _0x536c93={};var _0x2b3048={};var _0x50ee29;var _0x127a92;return db[_0x23c7('0x29')][_0x23c7('0x43')]({'where':{'id':_0x803fec['params']['id']}})[_0x23c7('0x23')](handleEntityNotFound(_0xd34732,null))['then'](function(_0x2df910){if(_0x2df910){_0x50ee29=_0x2df910;_0x2b3048[_0x23c7('0x2e')]=_['keys'](db[_0x23c7('0x44')]['rawAttributes']);_0x2b3048[_0x23c7('0x2f')]=_[_0x23c7('0x30')](_0x803fec[_0x23c7('0x2f')]);_0x2b3048['filters']=_[_0x23c7('0x32')](_0x2b3048[_0x23c7('0x2e')],_0x2b3048[_0x23c7('0x2f')]);_0x536c93[_0x23c7('0x33')]=_[_0x23c7('0x32')](_0x2b3048['model'],qs[_0x23c7('0x34')](_0x803fec[_0x23c7('0x2f')][_0x23c7('0x34')]));_0x536c93[_0x23c7('0x33')]=_0x536c93[_0x23c7('0x33')]['length']?_0x536c93[_0x23c7('0x33')]:_0x2b3048['model'];_0x536c93[_0x23c7('0x45')]=qs['sort'](_0x803fec[_0x23c7('0x2f')][_0x23c7('0x46')]);_0x536c93[_0x23c7('0x35')]=qs[_0x23c7('0x31')](_['pick'](_0x803fec[_0x23c7('0x2f')],_0x2b3048[_0x23c7('0x31')]));if(_0x803fec[_0x23c7('0x2f')]['filter']){_0x536c93['where']=_[_0x23c7('0x38')](_0x536c93[_0x23c7('0x35')],{'$or':_[_0x23c7('0x28')](_0x536c93[_0x23c7('0x33')],function(_0x59ff72){var _0x2a0587={};_0x2a0587[_0x59ff72]={'$like':'%'+_0x803fec[_0x23c7('0x2f')]['filter']+'%'};return _0x2a0587;})});}_0x536c93=_[_0x23c7('0x38')]({},_0x536c93,_0x803fec[_0x23c7('0x3d')]);return _0x50ee29[_0x23c7('0x4a')](_0x536c93);}})[_0x23c7('0x23')](function(_0x249291){if(_0x249291){_0x127a92=_0x249291['length'];if(!_0x803fec[_0x23c7('0x2f')][_0x23c7('0x48')](_0x23c7('0x49'))){_0x536c93['limit']=qs[_0x23c7('0x1b')](_0x803fec[_0x23c7('0x2f')][_0x23c7('0x1b')]);_0x536c93[_0x23c7('0x19')]=qs['offset'](_0x803fec[_0x23c7('0x2f')][_0x23c7('0x19')]);}return _0x50ee29[_0x23c7('0x4a')](_0x536c93);}})[_0x23c7('0x23')](function(_0x20d943){if(_0x20d943){return _0x20d943?{'count':_0x127a92,'rows':_0x20d943}:null;}})[_0x23c7('0x23')](respondWithResult(_0xd34732,null))[_0x23c7('0x3a')](handleError(_0xd34732,null));};exports[_0x23c7('0x4b')]=function(_0x3a02cf,_0x25f6e4,_0x428005){var _0x1efad5={};var _0x38191f={};var _0x1a94fc;var _0x373328;return db['FreshdeskConfiguration'][_0x23c7('0x43')]({'where':{'id':_0x3a02cf[_0x23c7('0x41')]['id']}})[_0x23c7('0x23')](handleEntityNotFound(_0x25f6e4,null))[_0x23c7('0x23')](function(_0x525043){if(_0x525043){_0x1a94fc=_0x525043;_0x38191f['model']=_[_0x23c7('0x30')](db[_0x23c7('0x44')][_0x23c7('0x2a')]);_0x38191f[_0x23c7('0x2f')]=_[_0x23c7('0x30')](_0x3a02cf[_0x23c7('0x2f')]);_0x38191f[_0x23c7('0x31')]=_[_0x23c7('0x32')](_0x38191f[_0x23c7('0x2e')],_0x38191f[_0x23c7('0x2f')]);_0x1efad5['attributes']=_[_0x23c7('0x32')](_0x38191f['model'],qs[_0x23c7('0x34')](_0x3a02cf['query'][_0x23c7('0x34')]));_0x1efad5[_0x23c7('0x33')]=_0x1efad5[_0x23c7('0x33')]['length']?_0x1efad5[_0x23c7('0x33')]:_0x38191f[_0x23c7('0x2e')];_0x1efad5[_0x23c7('0x45')]=qs[_0x23c7('0x46')](_0x3a02cf['query'][_0x23c7('0x46')]);_0x1efad5[_0x23c7('0x35')]=qs['filters'](_[_0x23c7('0x36')](_0x3a02cf['query'],_0x38191f[_0x23c7('0x31')]));if(_0x3a02cf[_0x23c7('0x2f')][_0x23c7('0x37')]){_0x1efad5[_0x23c7('0x35')]=_[_0x23c7('0x38')](_0x1efad5[_0x23c7('0x35')],{'$or':_[_0x23c7('0x28')](_0x1efad5[_0x23c7('0x33')],function(_0x2a87a6){var _0x472601={};_0x472601[_0x2a87a6]={'$like':'%'+_0x3a02cf[_0x23c7('0x2f')][_0x23c7('0x37')]+'%'};return _0x472601;})});}_0x1efad5=_[_0x23c7('0x38')]({},_0x1efad5,_0x3a02cf[_0x23c7('0x3d')]);return _0x1a94fc[_0x23c7('0x4b')](_0x1efad5);}})[_0x23c7('0x23')](function(_0x1f471c){if(_0x1f471c){_0x373328=_0x1f471c['length'];if(!_0x3a02cf[_0x23c7('0x2f')][_0x23c7('0x48')](_0x23c7('0x49'))){_0x1efad5[_0x23c7('0x1b')]=qs[_0x23c7('0x1b')](_0x3a02cf[_0x23c7('0x2f')]['limit']);_0x1efad5[_0x23c7('0x19')]=qs[_0x23c7('0x19')](_0x3a02cf[_0x23c7('0x2f')]['offset']);}return _0x1a94fc[_0x23c7('0x4b')](_0x1efad5);}})['then'](function(_0x55ec19){if(_0x55ec19){return _0x55ec19?{'count':_0x373328,'rows':_0x55ec19}:null;}})[_0x23c7('0x23')](respondWithResult(_0x25f6e4,null))['catch'](handleError(_0x25f6e4,null));};exports[_0x23c7('0x4c')]=function(_0x1f96b,_0x41bea5,_0x14f705){var _0x3ecd53={};var _0x4fe18a={};var _0x135a31;var _0x156ac1;return db[_0x23c7('0x29')][_0x23c7('0x43')]({'where':{'id':_0x1f96b[_0x23c7('0x41')]['id']}})[_0x23c7('0x23')](handleEntityNotFound(_0x41bea5,null))[_0x23c7('0x23')](function(_0x4cffb0){if(_0x4cffb0){_0x135a31=_0x4cffb0;_0x4fe18a[_0x23c7('0x2e')]=_['keys'](db['Tag'][_0x23c7('0x2a')]);_0x4fe18a[_0x23c7('0x2f')]=_[_0x23c7('0x30')](_0x1f96b[_0x23c7('0x2f')]);_0x4fe18a[_0x23c7('0x31')]=_[_0x23c7('0x32')](_0x4fe18a['model'],_0x4fe18a['query']);_0x3ecd53['attributes']=_[_0x23c7('0x32')](_0x4fe18a[_0x23c7('0x2e')],qs[_0x23c7('0x34')](_0x1f96b[_0x23c7('0x2f')][_0x23c7('0x34')]));_0x3ecd53['attributes']=_0x3ecd53[_0x23c7('0x33')][_0x23c7('0x3c')]?_0x3ecd53['attributes']:_0x4fe18a[_0x23c7('0x2e')];_0x3ecd53[_0x23c7('0x45')]=qs[_0x23c7('0x46')](_0x1f96b['query'][_0x23c7('0x46')]);_0x3ecd53[_0x23c7('0x35')]=qs[_0x23c7('0x31')](_['pick'](_0x1f96b[_0x23c7('0x2f')],_0x4fe18a[_0x23c7('0x31')]));if(_0x1f96b[_0x23c7('0x2f')][_0x23c7('0x37')]){_0x3ecd53[_0x23c7('0x35')]=_[_0x23c7('0x38')](_0x3ecd53[_0x23c7('0x35')],{'$or':_['map'](_0x3ecd53['attributes'],function(_0x2ee8db){var _0x583b73={};_0x583b73[_0x2ee8db]={'$like':'%'+_0x1f96b[_0x23c7('0x2f')][_0x23c7('0x37')]+'%'};return _0x583b73;})});}_0x3ecd53=_[_0x23c7('0x38')]({},_0x3ecd53,_0x1f96b['options']);return _0x135a31[_0x23c7('0x4c')](_0x3ecd53);}})[_0x23c7('0x23')](function(_0x2f5ff0){if(_0x2f5ff0){_0x156ac1=_0x2f5ff0['length'];if(!_0x1f96b[_0x23c7('0x2f')][_0x23c7('0x48')](_0x23c7('0x49'))){_0x3ecd53[_0x23c7('0x1b')]=qs[_0x23c7('0x1b')](_0x1f96b[_0x23c7('0x2f')][_0x23c7('0x1b')]);_0x3ecd53[_0x23c7('0x19')]=qs[_0x23c7('0x19')](_0x1f96b[_0x23c7('0x2f')]['offset']);}return _0x135a31[_0x23c7('0x4c')](_0x3ecd53);}})[_0x23c7('0x23')](function(_0x43eed3){if(_0x43eed3){return _0x43eed3?{'count':_0x156ac1,'rows':_0x43eed3}:null;}})[_0x23c7('0x23')](respondWithResult(_0x41bea5,null))[_0x23c7('0x3a')](handleError(_0x41bea5,null));};exports[_0x23c7('0x4d')]=function(_0x37f169,_0xb4397c,_0xdd57e3){if(_0x37f169[_0x23c7('0x40')]['id']){delete _0x37f169[_0x23c7('0x40')]['id'];}return db[_0x23c7('0x29')][_0x23c7('0x43')]({'where':{'id':_0x37f169[_0x23c7('0x41')]['id']}})[_0x23c7('0x23')](handleEntityNotFound(_0xb4397c,null))[_0x23c7('0x23')](function(_0x356e36){if(_0x356e36){return _0x356e36[_0x23c7('0x4d')](_0x37f169[_0x23c7('0x40')][_0x23c7('0x4e')]||[]);}return null;})[_0x23c7('0x23')](respondWithResult(_0xb4397c,null))['catch'](handleError(_0xb4397c,null));};
\ No newline at end of file
index a8ff8e2..31bde66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa8e=['../../config/logger','bluebird','request-promise','path','../../config/environment','exports','int_freshdesk_configurations','lodash','util'];(function(_0x1713d1,_0x3eb828){var _0xe2a36f=function(_0x4b8592){while(--_0x4b8592){_0x1713d1['push'](_0x1713d1['shift']());}};_0xe2a36f(++_0x3eb828);}(_0xaa8e,0x97));var _0xeaa8=function(_0x4e3d14,_0x1cefe5){_0x4e3d14=_0x4e3d14-0x0;var _0x565920=_0xaa8e[_0x4e3d14];return _0x565920;};'use strict';var _=require(_0xeaa8('0x0'));var util=require(_0xeaa8('0x1'));var logger=require(_0xeaa8('0x2'))('api');var moment=require('moment');var BPromise=require(_0xeaa8('0x3'));var rp=require(_0xeaa8('0x4'));var fs=require('fs');var path=require(_0xeaa8('0x5'));var rimraf=require('rimraf');var config=require(_0xeaa8('0x6'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0xeaa8('0x7')]=function(_0x26c0d5,_0xa3c74d){return _0x26c0d5['define']('FreshdeskConfiguration',attributes,{'tableName':_0xeaa8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x52ea=['../../config/environment','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4dbc5b,_0xf50059){var _0x4bb4a8=function(_0x494403){while(--_0x494403){_0x4dbc5b['push'](_0x4dbc5b['shift']());}};_0x4bb4a8(++_0xf50059);}(_0x52ea,0xdf));var _0xa52e=function(_0x40b981,_0x48b308){_0x40b981=_0x40b981-0x0;var _0x58696b=_0x52ea[_0x40b981];return _0x58696b;};'use strict';var _=require(_0xa52e('0x0'));var util=require(_0xa52e('0x1'));var logger=require(_0xa52e('0x2'))(_0xa52e('0x3'));var moment=require(_0xa52e('0x4'));var BPromise=require(_0xa52e('0x5'));var rp=require(_0xa52e('0x6'));var fs=require('fs');var path=require(_0xa52e('0x7'));var rimraf=require('rimraf');var config=require(_0xa52e('0x8'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0xa52e('0x9')]=function(_0x588f4e,_0x189475){return _0x588f4e[_0xa52e('0xa')]('FreshdeskConfiguration',attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 97a0849..2020e00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e4c=['request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x7e4c,0xfc));var _0xc7e4=function(_0x126fb9,_0x122c59){_0x126fb9=_0x126fb9-0x0;var _0xc8a3b1=_0x7e4c[_0x126fb9];return _0xc8a3b1;};'use strict';var _=require(_0xc7e4('0x0'));var util=require(_0xc7e4('0x1'));var moment=require(_0xc7e4('0x2'));var BPromise=require('bluebird');var rs=require(_0xc7e4('0x3'));var fs=require('fs');var Redis=require(_0xc7e4('0x4'));var db=require(_0xc7e4('0x5'))['db'];var utils=require(_0xc7e4('0x6'));var logger=require(_0xc7e4('0x7'))(_0xc7e4('0x8'));var config=require(_0xc7e4('0x9'));var jayson=require(_0xc7e4('0xa'));var client=jayson[_0xc7e4('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ef416,_0x3a449,_0x51ac4d){return new BPromise(function(_0x824a78,_0xfe8223){return client[_0xc7e4('0xc')](_0x4ef416,_0x51ac4d)[_0xc7e4('0xd')](function(_0x14a9e1){logger[_0xc7e4('0xe')](_0xc7e4('0xf'),_0x3a449,_0xc7e4('0x10'));logger[_0xc7e4('0x11')](_0xc7e4('0x12'),_0x3a449,_0xc7e4('0x10'),JSON[_0xc7e4('0x13')](_0x14a9e1));if(_0x14a9e1['error']){if(_0x14a9e1[_0xc7e4('0x14')][_0xc7e4('0x15')]===0x1f4){logger['error'](_0xc7e4('0xf'),_0x3a449,_0x14a9e1[_0xc7e4('0x14')]['message']);return _0xfe8223(_0x14a9e1['error'][_0xc7e4('0x16')]);}logger[_0xc7e4('0x14')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3a449,_0x14a9e1['error']['message']);return _0x824a78(_0x14a9e1[_0xc7e4('0x14')][_0xc7e4('0x16')]);}else{logger[_0xc7e4('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3a449,_0xc7e4('0x10'));_0x824a78(_0x14a9e1['result'][_0xc7e4('0x16')]);}})[_0xc7e4('0x17')](function(_0x1f4625){logger[_0xc7e4('0x14')](_0xc7e4('0xf'),_0x3a449,_0x1f4625);_0xfe8223(_0x1f4625);});});}
\ No newline at end of file
+var _0x1be6=['debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x1fcaf1,_0x21c3c2){var _0x55f464=function(_0x348eb3){while(--_0x348eb3){_0x1fcaf1['push'](_0x1fcaf1['shift']());}};_0x55f464(++_0x21c3c2);}(_0x1be6,0x133));var _0x61be=function(_0x4be8d6,_0x19b6e7){_0x4be8d6=_0x4be8d6-0x0;var _0x3dd1c7=_0x1be6[_0x4be8d6];return _0x3dd1c7;};'use strict';var _=require(_0x61be('0x0'));var util=require(_0x61be('0x1'));var moment=require(_0x61be('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x61be('0x3'));var db=require(_0x61be('0x4'))['db'];var utils=require(_0x61be('0x5'));var logger=require(_0x61be('0x6'))(_0x61be('0x7'));var config=require(_0x61be('0x8'));var jayson=require(_0x61be('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1e6989,_0x56cd89,_0xa1d512){return new BPromise(function(_0x586eff,_0x392d8e){return client[_0x61be('0xa')](_0x1e6989,_0xa1d512)['then'](function(_0x36da36){logger['info'](_0x61be('0xb'),_0x56cd89,_0x61be('0xc'));logger[_0x61be('0xd')](_0x61be('0xe'),_0x56cd89,_0x61be('0xc'),JSON['stringify'](_0x36da36));if(_0x36da36[_0x61be('0xf')]){if(_0x36da36['error'][_0x61be('0x10')]===0x1f4){logger[_0x61be('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x56cd89,_0x36da36[_0x61be('0xf')]['message']);return _0x392d8e(_0x36da36[_0x61be('0xf')][_0x61be('0x11')]);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x56cd89,_0x36da36[_0x61be('0xf')][_0x61be('0x11')]);return _0x586eff(_0x36da36['error']['message']);}else{logger[_0x61be('0x12')](_0x61be('0xb'),_0x56cd89,_0x61be('0xc'));_0x586eff(_0x36da36['result'][_0x61be('0x11')]);}})[_0x61be('0x13')](function(_0x1e5905){logger[_0x61be('0xf')](_0x61be('0xb'),_0x56cd89,_0x1e5905);_0x392d8e(_0x1e5905);});});}
\ No newline at end of file
index adba0a3..4432646 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88e0=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','post','create','/:id','update','destroy','exports','multer','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x88e0,0x18d));var _0x088e=function(_0x23f125,_0x280031){_0x23f125=_0x23f125-0x0;var _0x2bb414=_0x88e0[_0x23f125];return _0x2bb414;};'use strict';var multer=require(_0x088e('0x0'));var util=require(_0x088e('0x1'));var path=require('path');var timeout=require(_0x088e('0x2'));var express=require(_0x088e('0x3'));var router=express[_0x088e('0x4')]();var fs_extra=require(_0x088e('0x5'));var auth=require(_0x088e('0x6'));var interaction=require(_0x088e('0x7'));var config=require(_0x088e('0x8'));var controller=require(_0x088e('0x9'));router[_0x088e('0xa')]('/',auth[_0x088e('0xb')](),controller[_0x088e('0xc')]);router[_0x088e('0xa')]('/:id',auth[_0x088e('0xb')](),controller['show']);router[_0x088e('0xd')]('/',auth[_0x088e('0xb')](),controller[_0x088e('0xe')]);router['put'](_0x088e('0xf'),auth['isAuthenticated'](),controller[_0x088e('0x10')]);router['delete'](_0x088e('0xf'),auth[_0x088e('0xb')](),controller[_0x088e('0x11')]);module[_0x088e('0x12')]=router;
\ No newline at end of file
+var _0xed24=['show','create','put','delete','exports','multer','util','path','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','/:id'];(function(_0x3378e9,_0x224437){var _0x2e2a08=function(_0x2065c9){while(--_0x2065c9){_0x3378e9['push'](_0x3378e9['shift']());}};_0x2e2a08(++_0x224437);}(_0xed24,0x1d6));var _0x4ed2=function(_0x2804b1,_0x30a18c){_0x2804b1=_0x2804b1-0x0;var _0x296240=_0xed24[_0x2804b1];return _0x296240;};'use strict';var multer=require(_0x4ed2('0x0'));var util=require(_0x4ed2('0x1'));var path=require(_0x4ed2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4ed2('0x3'));var interaction=require(_0x4ed2('0x4'));var config=require('../../config/environment');var controller=require(_0x4ed2('0x5'));router[_0x4ed2('0x6')]('/',auth[_0x4ed2('0x7')](),controller[_0x4ed2('0x8')]);router['get'](_0x4ed2('0x9'),auth[_0x4ed2('0x7')](),controller[_0x4ed2('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4ed2('0xb')]);router[_0x4ed2('0xc')](_0x4ed2('0x9'),auth[_0x4ed2('0x7')](),controller['update']);router[_0x4ed2('0xd')](_0x4ed2('0x9'),auth[_0x4ed2('0x7')](),controller['destroy']);module[_0x4ed2('0xe')]=router;
\ No newline at end of file
index acc8d41..25b62a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11cc=['picklist','STRING','ENUM','string','variable','customVariable'];(function(_0x680be8,_0x27ad4f){var _0x5ef590=function(_0x2c98bb){while(--_0x2c98bb){_0x680be8['push'](_0x680be8['shift']());}};_0x5ef590(++_0x27ad4f);}(_0x11cc,0x6e));var _0xc11c=function(_0x395b75,_0x5e4170){_0x395b75=_0x395b75-0x0;var _0x21f76c=_0x11cc[_0x395b75];return _0x21f76c;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xc11c('0x0')](_0xc11c('0x1'),_0xc11c('0x2'),_0xc11c('0x3'),'keyValue',_0xc11c('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xc11c('0x5')]},'key':{'type':Sequelize[_0xc11c('0x5')]},'keyType':{'type':Sequelize[_0xc11c('0x0')](_0xc11c('0x1'),_0xc11c('0x2'),_0xc11c('0x3'))},'keyContent':{'type':Sequelize[_0xc11c('0x5')]},'idField':{'type':Sequelize[_0xc11c('0x5')]},'nameField':{'type':Sequelize[_0xc11c('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xa3d0=['customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string','variable'];(function(_0x3ef4c7,_0x3c8f24){var _0x4d358f=function(_0x352fb7){while(--_0x352fb7){_0x3ef4c7['push'](_0x3ef4c7['shift']());}};_0x4d358f(++_0x3c8f24);}(_0xa3d0,0x164));var _0x0a3d=function(_0x4f24ec,_0x552826){_0x4f24ec=_0x4f24ec-0x0;var _0x11926e=_0xa3d0[_0x4f24ec];return _0x11926e;};'use strict';var Sequelize=require('sequelize');module[_0x0a3d('0x0')]={'type':{'type':Sequelize[_0x0a3d('0x1')](_0x0a3d('0x2'),_0x0a3d('0x3'),_0x0a3d('0x4'),_0x0a3d('0x5'),_0x0a3d('0x6')),'defaultValue':_0x0a3d('0x2')},'content':{'type':Sequelize[_0x0a3d('0x7')]},'key':{'type':Sequelize[_0x0a3d('0x7')]},'keyType':{'type':Sequelize[_0x0a3d('0x1')](_0x0a3d('0x2'),'variable',_0x0a3d('0x4'))},'keyContent':{'type':Sequelize[_0x0a3d('0x7')]},'idField':{'type':Sequelize[_0x0a3d('0x7')]},'nameField':{'type':Sequelize[_0x0a3d('0x7')]},'customField':{'type':Sequelize[_0x0a3d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0a3d('0x7')]}};
\ No newline at end of file
index af983ff..0d58c18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa699=['index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','FreshdeskField','includeAll','include','rows','show','params','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','then','error','stack','name','send'];(function(_0x2dc860,_0x19a1af){var _0x335f46=function(_0x582a20){while(--_0x582a20){_0x2dc860['push'](_0x2dc860['shift']());}};_0x335f46(++_0x19a1af);}(_0xa699,0x6b));var _0x9a69=function(_0x2aefb6,_0x1bd384){_0x2aefb6=_0x2aefb6-0x0;var _0x202772=_0xa699[_0x2aefb6];return _0x202772;};'use strict';var emlformat=require(_0x9a69('0x0'));var rimraf=require(_0x9a69('0x1'));var zipdir=require(_0x9a69('0x2'));var jsonpatch=require(_0x9a69('0x3'));var rp=require(_0x9a69('0x4'));var moment=require(_0x9a69('0x5'));var BPromise=require(_0x9a69('0x6'));var Mustache=require(_0x9a69('0x7'));var util=require(_0x9a69('0x8'));var path=require(_0x9a69('0x9'));var sox=require(_0x9a69('0xa'));var csv=require(_0x9a69('0xb'));var ejs=require(_0x9a69('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9a69('0xd'));var squel=require(_0x9a69('0xe'));var crypto=require(_0x9a69('0xf'));var jsforce=require(_0x9a69('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x9a69('0xb'));var querystring=require(_0x9a69('0x11'));var Papa=require(_0x9a69('0x12'));var Redis=require(_0x9a69('0x13'));var authService=require(_0x9a69('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9a69('0x15'));var logger=require('../../config/logger')(_0x9a69('0x16'));var utils=require(_0x9a69('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9a69('0x18'));var db=require(_0x9a69('0x19'))['db'];function respondWithStatusCode(_0x56e43f,_0x81dfb1){_0x81dfb1=_0x81dfb1||0xcc;return function(_0x2e613e){if(_0x2e613e){return _0x56e43f[_0x9a69('0x1a')](_0x81dfb1);}return _0x56e43f[_0x9a69('0x1b')](_0x81dfb1)[_0x9a69('0x1c')]();};}function respondWithResult(_0x70475b,_0x34b5b0){_0x34b5b0=_0x34b5b0||0xc8;return function(_0x2a5b83){if(_0x2a5b83){return _0x70475b[_0x9a69('0x1b')](_0x34b5b0)['json'](_0x2a5b83);}};}function respondWithFilteredResult(_0x2323ae,_0x17de41){return function(_0x2be3ec){if(_0x2be3ec){var _0x5e982d=typeof _0x17de41[_0x9a69('0x1d')]===_0x9a69('0x1e')&&typeof _0x17de41[_0x9a69('0x1f')]===_0x9a69('0x1e');var _0xed2c19=_0x2be3ec['count'];var _0x2e4264=_0x5e982d?0x0:_0x17de41[_0x9a69('0x1d')];var _0x186a5a=_0x5e982d?_0x2be3ec[_0x9a69('0x20')]:_0x17de41[_0x9a69('0x1d')]+_0x17de41[_0x9a69('0x1f')];var _0x2633d5;if(_0x186a5a>=_0xed2c19){_0x186a5a=_0xed2c19;_0x2633d5=0xc8;}else{_0x2633d5=0xce;}_0x2323ae[_0x9a69('0x1b')](_0x2633d5);return _0x2323ae[_0x9a69('0x21')](_0x9a69('0x22'),_0x2e4264+'-'+_0x186a5a+'/'+_0xed2c19)['json'](_0x2be3ec);}return null;};}function patchUpdates(_0x4d8db9){return function(_0x5ebb09){try{jsonpatch[_0x9a69('0x23')](_0x5ebb09,_0x4d8db9,!![]);}catch(_0x12ebe5){return BPromise['reject'](_0x12ebe5);}return _0x5ebb09[_0x9a69('0x24')]();};}function saveUpdates(_0x527ca6,_0x265291){return function(_0x4d6a93){if(_0x4d6a93){return _0x4d6a93['update'](_0x527ca6)['then'](function(_0x189989){return _0x189989;});}return null;};}function removeEntity(_0x5f4138,_0x140cbe){return function(_0x28f5f7){if(_0x28f5f7){return _0x28f5f7[_0x9a69('0x25')]()[_0x9a69('0x26')](function(){_0x5f4138['status'](0xcc)[_0x9a69('0x1c')]();});}};}function handleEntityNotFound(_0x5130b2,_0x203d32){return function(_0x4ef126){if(!_0x4ef126){_0x5130b2['sendStatus'](0x194);}return _0x4ef126;};}function handleError(_0xbcdcd9,_0xf6fea2){_0xf6fea2=_0xf6fea2||0x1f4;return function(_0x268cef){logger[_0x9a69('0x27')](_0x268cef[_0x9a69('0x28')]);if(_0x268cef[_0x9a69('0x29')]){delete _0x268cef[_0x9a69('0x29')];}_0xbcdcd9[_0x9a69('0x1b')](_0xf6fea2)[_0x9a69('0x2a')](_0x268cef);};}exports[_0x9a69('0x2b')]=function(_0x47916a,_0x1ff48e){var _0x165a87={},_0x5433b3={},_0x54e643={'count':0x0,'rows':[]};var _0x4b3539=_[_0x9a69('0x2c')](db['FreshdeskField'][_0x9a69('0x2d')],function(_0x2d15e3){return{'name':_0x2d15e3[_0x9a69('0x2e')],'type':_0x2d15e3[_0x9a69('0x2f')][_0x9a69('0x30')]};});_0x5433b3[_0x9a69('0x31')]=_[_0x9a69('0x2c')](_0x4b3539,_0x9a69('0x29'));_0x5433b3[_0x9a69('0x32')]=_[_0x9a69('0x33')](_0x47916a[_0x9a69('0x32')]);_0x5433b3[_0x9a69('0x34')]=_[_0x9a69('0x35')](_0x5433b3[_0x9a69('0x31')],_0x5433b3[_0x9a69('0x32')]);_0x165a87[_0x9a69('0x36')]=_[_0x9a69('0x35')](_0x5433b3['model'],qs['fields'](_0x47916a[_0x9a69('0x32')][_0x9a69('0x37')]));_0x165a87[_0x9a69('0x36')]=_0x165a87[_0x9a69('0x36')][_0x9a69('0x38')]?_0x165a87['attributes']:_0x5433b3['model'];if(!_0x47916a['query']['hasOwnProperty'](_0x9a69('0x39'))){_0x165a87[_0x9a69('0x1f')]=qs[_0x9a69('0x1f')](_0x47916a[_0x9a69('0x32')][_0x9a69('0x1f')]);_0x165a87[_0x9a69('0x1d')]=qs['offset'](_0x47916a['query'][_0x9a69('0x1d')]);}_0x165a87[_0x9a69('0x3a')]=qs[_0x9a69('0x3b')](_0x47916a['query'][_0x9a69('0x3b')]);_0x165a87[_0x9a69('0x3c')]=qs[_0x9a69('0x34')](_[_0x9a69('0x3d')](_0x47916a[_0x9a69('0x32')],_0x5433b3[_0x9a69('0x34')]),_0x4b3539);if(_0x47916a[_0x9a69('0x32')][_0x9a69('0x3e')]){_0x165a87[_0x9a69('0x3c')]=_[_0x9a69('0x3f')](_0x165a87[_0x9a69('0x3c')],{'$or':_['map'](_0x4b3539,function(_0x1ac0b7){if(_0x1ac0b7['type']!=='VIRTUAL'){var _0x4cc399={};_0x4cc399[_0x1ac0b7['name']]={'$like':'%'+_0x47916a[_0x9a69('0x32')][_0x9a69('0x3e')]+'%'};return _0x4cc399;}})});}_0x165a87=_['merge']({},_0x165a87,_0x47916a['options']);var _0x5a1e62={'where':_0x165a87[_0x9a69('0x3c')]};return db[_0x9a69('0x40')][_0x9a69('0x20')](_0x5a1e62)['then'](function(_0x2ff507){_0x54e643[_0x9a69('0x20')]=_0x2ff507;if(_0x47916a[_0x9a69('0x32')][_0x9a69('0x41')]){_0x165a87[_0x9a69('0x42')]=[{'all':!![]}];}return db[_0x9a69('0x40')]['findAll'](_0x165a87);})[_0x9a69('0x26')](function(_0x27d0db){_0x54e643[_0x9a69('0x43')]=_0x27d0db;return _0x54e643;})[_0x9a69('0x26')](respondWithFilteredResult(_0x1ff48e,_0x165a87))['catch'](handleError(_0x1ff48e,null));};exports[_0x9a69('0x44')]=function(_0x373939,_0x5b309a){var _0x318de1={'raw':!![],'where':{'id':_0x373939[_0x9a69('0x45')]['id']}},_0x3c78e2={};_0x3c78e2['model']=_['keys'](db['FreshdeskField'][_0x9a69('0x2d')]);_0x3c78e2[_0x9a69('0x32')]=_[_0x9a69('0x33')](_0x373939[_0x9a69('0x32')]);_0x3c78e2['filters']=_[_0x9a69('0x35')](_0x3c78e2[_0x9a69('0x31')],_0x3c78e2[_0x9a69('0x32')]);_0x318de1[_0x9a69('0x36')]=_['intersection'](_0x3c78e2[_0x9a69('0x31')],qs[_0x9a69('0x37')](_0x373939[_0x9a69('0x32')][_0x9a69('0x37')]));_0x318de1['attributes']=_0x318de1[_0x9a69('0x36')]['length']?_0x318de1[_0x9a69('0x36')]:_0x3c78e2['model'];if(_0x373939[_0x9a69('0x32')]['includeAll']){_0x318de1[_0x9a69('0x42')]=[{'all':!![]}];}_0x318de1=_['merge']({},_0x318de1,_0x373939[_0x9a69('0x46')]);return db[_0x9a69('0x40')][_0x9a69('0x47')](_0x318de1)[_0x9a69('0x26')](handleEntityNotFound(_0x5b309a,null))['then'](respondWithResult(_0x5b309a,null))[_0x9a69('0x48')](handleError(_0x5b309a,null));};exports[_0x9a69('0x49')]=function(_0x77781d,_0x2537b0){return db[_0x9a69('0x40')][_0x9a69('0x49')](_0x77781d[_0x9a69('0x4a')],{})[_0x9a69('0x26')](respondWithResult(_0x2537b0,0xc9))[_0x9a69('0x48')](handleError(_0x2537b0,null));};exports['update']=function(_0x281ef0,_0x6046a7){if(_0x281ef0[_0x9a69('0x4a')]['id']){delete _0x281ef0[_0x9a69('0x4a')]['id'];}return db[_0x9a69('0x40')][_0x9a69('0x47')]({'where':{'id':_0x281ef0[_0x9a69('0x45')]['id']}})[_0x9a69('0x26')](handleEntityNotFound(_0x6046a7,null))[_0x9a69('0x26')](saveUpdates(_0x281ef0[_0x9a69('0x4a')],null))[_0x9a69('0x26')](respondWithResult(_0x6046a7,null))[_0x9a69('0x48')](handleError(_0x6046a7,null));};exports[_0x9a69('0x25')]=function(_0x43b084,_0x18ab7a){return db['FreshdeskField'][_0x9a69('0x47')]({'where':{'id':_0x43b084[_0x9a69('0x45')]['id']}})[_0x9a69('0x26')](handleEntityNotFound(_0x18ab7a,null))[_0x9a69('0x26')](removeEntity(_0x18ab7a,null))[_0x9a69('0x48')](handleError(_0x18ab7a,null));};
\ No newline at end of file
+var _0xeb74=['crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','merge','where','VIRTUAL','filter','options','FreshdeskField','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash'];(function(_0x5c4573,_0x4f0e2a){var _0x3d1bba=function(_0xe988d1){while(--_0xe988d1){_0x5c4573['push'](_0x5c4573['shift']());}};_0x3d1bba(++_0x4f0e2a);}(_0xeb74,0xe3));var _0x4eb7=function(_0x415073,_0x25b09a){_0x415073=_0x415073-0x0;var _0x39dabf=_0xeb74[_0x415073];return _0x39dabf;};'use strict';var emlformat=require(_0x4eb7('0x0'));var rimraf=require(_0x4eb7('0x1'));var zipdir=require(_0x4eb7('0x2'));var jsonpatch=require(_0x4eb7('0x3'));var rp=require(_0x4eb7('0x4'));var moment=require(_0x4eb7('0x5'));var BPromise=require(_0x4eb7('0x6'));var Mustache=require('mustache');var util=require(_0x4eb7('0x7'));var path=require(_0x4eb7('0x8'));var sox=require(_0x4eb7('0x9'));var csv=require(_0x4eb7('0xa'));var ejs=require(_0x4eb7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4eb7('0xc'));var squel=require('squel');var crypto=require(_0x4eb7('0xd'));var jsforce=require(_0x4eb7('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4eb7('0xf'));var Papa=require(_0x4eb7('0x10'));var Redis=require('ioredis');var authService=require(_0x4eb7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4eb7('0x12'));var hardwareService=require(_0x4eb7('0x13'));var logger=require(_0x4eb7('0x14'))('api');var utils=require(_0x4eb7('0x15'));var config=require(_0x4eb7('0x16'));var licenseUtil=require(_0x4eb7('0x17'));var db=require(_0x4eb7('0x18'))['db'];function respondWithStatusCode(_0x35fa89,_0x4194e1){_0x4194e1=_0x4194e1||0xcc;return function(_0x3c9f45){if(_0x3c9f45){return _0x35fa89['sendStatus'](_0x4194e1);}return _0x35fa89['status'](_0x4194e1)['end']();};}function respondWithResult(_0x17fb81,_0x51f09d){_0x51f09d=_0x51f09d||0xc8;return function(_0x84c68b){if(_0x84c68b){return _0x17fb81[_0x4eb7('0x19')](_0x51f09d)[_0x4eb7('0x1a')](_0x84c68b);}};}function respondWithFilteredResult(_0x1c4a97,_0x5d6d5){return function(_0x21433d){if(_0x21433d){var _0x11674f=typeof _0x5d6d5[_0x4eb7('0x1b')]===_0x4eb7('0x1c')&&typeof _0x5d6d5[_0x4eb7('0x1d')]==='undefined';var _0xb86bc9=_0x21433d[_0x4eb7('0x1e')];var _0x3b6d41=_0x11674f?0x0:_0x5d6d5[_0x4eb7('0x1b')];var _0x302e16=_0x11674f?_0x21433d[_0x4eb7('0x1e')]:_0x5d6d5[_0x4eb7('0x1b')]+_0x5d6d5[_0x4eb7('0x1d')];var _0x5f4780;if(_0x302e16>=_0xb86bc9){_0x302e16=_0xb86bc9;_0x5f4780=0xc8;}else{_0x5f4780=0xce;}_0x1c4a97[_0x4eb7('0x19')](_0x5f4780);return _0x1c4a97[_0x4eb7('0x1f')](_0x4eb7('0x20'),_0x3b6d41+'-'+_0x302e16+'/'+_0xb86bc9)[_0x4eb7('0x1a')](_0x21433d);}return null;};}function patchUpdates(_0x32f0f5){return function(_0x2efd67){try{jsonpatch[_0x4eb7('0x21')](_0x2efd67,_0x32f0f5,!![]);}catch(_0x4ddbe4){return BPromise[_0x4eb7('0x22')](_0x4ddbe4);}return _0x2efd67[_0x4eb7('0x23')]();};}function saveUpdates(_0x4783b1,_0x164515){return function(_0x14a7be){if(_0x14a7be){return _0x14a7be[_0x4eb7('0x24')](_0x4783b1)[_0x4eb7('0x25')](function(_0x2df1b1){return _0x2df1b1;});}return null;};}function removeEntity(_0x1a2b8b,_0x13e871){return function(_0x4de2d9){if(_0x4de2d9){return _0x4de2d9[_0x4eb7('0x26')]()[_0x4eb7('0x25')](function(){_0x1a2b8b[_0x4eb7('0x19')](0xcc)[_0x4eb7('0x27')]();});}};}function handleEntityNotFound(_0x3e0da2,_0x25eb74){return function(_0x365060){if(!_0x365060){_0x3e0da2[_0x4eb7('0x28')](0x194);}return _0x365060;};}function handleError(_0x80b804,_0x248759){_0x248759=_0x248759||0x1f4;return function(_0xf83c11){logger[_0x4eb7('0x29')](_0xf83c11[_0x4eb7('0x2a')]);if(_0xf83c11[_0x4eb7('0x2b')]){delete _0xf83c11[_0x4eb7('0x2b')];}_0x80b804[_0x4eb7('0x19')](_0x248759)[_0x4eb7('0x2c')](_0xf83c11);};}exports[_0x4eb7('0x2d')]=function(_0x33a2c1,_0x28fda8){var _0x114c68={},_0x17030a={},_0x3ed224={'count':0x0,'rows':[]};var _0x50209d=_[_0x4eb7('0x2e')](db['FreshdeskField'][_0x4eb7('0x2f')],function(_0x13f71a){return{'name':_0x13f71a[_0x4eb7('0x30')],'type':_0x13f71a[_0x4eb7('0x31')][_0x4eb7('0x32')]};});_0x17030a[_0x4eb7('0x33')]=_[_0x4eb7('0x2e')](_0x50209d,_0x4eb7('0x2b'));_0x17030a[_0x4eb7('0x34')]=_['keys'](_0x33a2c1[_0x4eb7('0x34')]);_0x17030a['filters']=_[_0x4eb7('0x35')](_0x17030a[_0x4eb7('0x33')],_0x17030a['query']);_0x114c68['attributes']=_[_0x4eb7('0x35')](_0x17030a[_0x4eb7('0x33')],qs[_0x4eb7('0x36')](_0x33a2c1[_0x4eb7('0x34')]['fields']));_0x114c68[_0x4eb7('0x37')]=_0x114c68[_0x4eb7('0x37')][_0x4eb7('0x38')]?_0x114c68[_0x4eb7('0x37')]:_0x17030a[_0x4eb7('0x33')];if(!_0x33a2c1['query'][_0x4eb7('0x39')](_0x4eb7('0x3a'))){_0x114c68[_0x4eb7('0x1d')]=qs['limit'](_0x33a2c1[_0x4eb7('0x34')][_0x4eb7('0x1d')]);_0x114c68[_0x4eb7('0x1b')]=qs['offset'](_0x33a2c1[_0x4eb7('0x34')]['offset']);}_0x114c68[_0x4eb7('0x3b')]=qs[_0x4eb7('0x3c')](_0x33a2c1[_0x4eb7('0x34')][_0x4eb7('0x3c')]);_0x114c68['where']=qs[_0x4eb7('0x3d')](_[_0x4eb7('0x3e')](_0x33a2c1[_0x4eb7('0x34')],_0x17030a[_0x4eb7('0x3d')]),_0x50209d);if(_0x33a2c1['query']['filter']){_0x114c68['where']=_[_0x4eb7('0x3f')](_0x114c68[_0x4eb7('0x40')],{'$or':_[_0x4eb7('0x2e')](_0x50209d,function(_0x20ac7b){if(_0x20ac7b[_0x4eb7('0x31')]!==_0x4eb7('0x41')){var _0x1038c1={};_0x1038c1[_0x20ac7b[_0x4eb7('0x2b')]]={'$like':'%'+_0x33a2c1[_0x4eb7('0x34')][_0x4eb7('0x42')]+'%'};return _0x1038c1;}})});}_0x114c68=_['merge']({},_0x114c68,_0x33a2c1[_0x4eb7('0x43')]);var _0x38218f={'where':_0x114c68[_0x4eb7('0x40')]};return db[_0x4eb7('0x44')][_0x4eb7('0x1e')](_0x38218f)[_0x4eb7('0x25')](function(_0x704d4d){_0x3ed224[_0x4eb7('0x1e')]=_0x704d4d;if(_0x33a2c1[_0x4eb7('0x34')][_0x4eb7('0x45')]){_0x114c68[_0x4eb7('0x46')]=[{'all':!![]}];}return db[_0x4eb7('0x44')][_0x4eb7('0x47')](_0x114c68);})[_0x4eb7('0x25')](function(_0x38af1f){_0x3ed224[_0x4eb7('0x48')]=_0x38af1f;return _0x3ed224;})[_0x4eb7('0x25')](respondWithFilteredResult(_0x28fda8,_0x114c68))[_0x4eb7('0x49')](handleError(_0x28fda8,null));};exports[_0x4eb7('0x4a')]=function(_0x79aec5,_0x5eff9e){var _0x2fd5c2={'raw':!![],'where':{'id':_0x79aec5[_0x4eb7('0x4b')]['id']}},_0x2df542={};_0x2df542[_0x4eb7('0x33')]=_[_0x4eb7('0x4c')](db[_0x4eb7('0x44')][_0x4eb7('0x2f')]);_0x2df542[_0x4eb7('0x34')]=_[_0x4eb7('0x4c')](_0x79aec5['query']);_0x2df542[_0x4eb7('0x3d')]=_['intersection'](_0x2df542[_0x4eb7('0x33')],_0x2df542[_0x4eb7('0x34')]);_0x2fd5c2[_0x4eb7('0x37')]=_['intersection'](_0x2df542[_0x4eb7('0x33')],qs[_0x4eb7('0x36')](_0x79aec5[_0x4eb7('0x34')][_0x4eb7('0x36')]));_0x2fd5c2['attributes']=_0x2fd5c2[_0x4eb7('0x37')]['length']?_0x2fd5c2[_0x4eb7('0x37')]:_0x2df542[_0x4eb7('0x33')];if(_0x79aec5[_0x4eb7('0x34')][_0x4eb7('0x45')]){_0x2fd5c2[_0x4eb7('0x46')]=[{'all':!![]}];}_0x2fd5c2=_['merge']({},_0x2fd5c2,_0x79aec5['options']);return db[_0x4eb7('0x44')][_0x4eb7('0x4d')](_0x2fd5c2)[_0x4eb7('0x25')](handleEntityNotFound(_0x5eff9e,null))[_0x4eb7('0x25')](respondWithResult(_0x5eff9e,null))[_0x4eb7('0x49')](handleError(_0x5eff9e,null));};exports['create']=function(_0x6086,_0x104284){return db['FreshdeskField'][_0x4eb7('0x4e')](_0x6086[_0x4eb7('0x4f')],{})['then'](respondWithResult(_0x104284,0xc9))[_0x4eb7('0x49')](handleError(_0x104284,null));};exports[_0x4eb7('0x24')]=function(_0x3c8049,_0x5774d5){if(_0x3c8049[_0x4eb7('0x4f')]['id']){delete _0x3c8049['body']['id'];}return db['FreshdeskField'][_0x4eb7('0x4d')]({'where':{'id':_0x3c8049[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x5774d5,null))[_0x4eb7('0x25')](saveUpdates(_0x3c8049[_0x4eb7('0x4f')],null))[_0x4eb7('0x25')](respondWithResult(_0x5774d5,null))[_0x4eb7('0x49')](handleError(_0x5774d5,null));};exports[_0x4eb7('0x26')]=function(_0x2913c5,_0x23c0d5){return db[_0x4eb7('0x44')][_0x4eb7('0x4d')]({'where':{'id':_0x2913c5[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x23c0d5,null))[_0x4eb7('0x25')](removeEntity(_0x23c0d5,null))[_0x4eb7('0x49')](handleError(_0x23c0d5,null));};
\ No newline at end of file
index 74f2783..1e3d84d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d82=['api','request-promise','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','FreshdeskField','int_freshdesk_fields','FieldId','lodash'];(function(_0x2ac71a,_0x1d2a02){var _0x3ee904=function(_0x5c902a){while(--_0x5c902a){_0x2ac71a['push'](_0x2ac71a['shift']());}};_0x3ee904(++_0x1d2a02);}(_0x3d82,0x117));var _0x23d8=function(_0x17b6f9,_0x279598){_0x17b6f9=_0x17b6f9-0x0;var _0x1e2c1a=_0x3d82[_0x17b6f9];return _0x1e2c1a;};'use strict';var _=require(_0x23d8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x23d8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x23d8('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x23d8('0x3'));var config=require(_0x23d8('0x4'));var attributes=require(_0x23d8('0x5'));module[_0x23d8('0x6')]=function(_0x3a5203,_0x1aef23){return _0x3a5203['define'](_0x23d8('0x7'),attributes,{'tableName':_0x23d8('0x8'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':['idField',_0x23d8('0x9')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x43d3=['bluebird','request-promise','path','rimraf','./intFreshdeskField.attributes','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','util','../../config/logger','api','moment'];(function(_0x3cfe70,_0x2465d5){var _0x2f0890=function(_0x2fa927){while(--_0x2fa927){_0x3cfe70['push'](_0x3cfe70['shift']());}};_0x2f0890(++_0x2465d5);}(_0x43d3,0x182));var _0x343d=function(_0x4e8a8e,_0x40d7c3){_0x4e8a8e=_0x4e8a8e-0x0;var _0xea8fe5=_0x43d3[_0x4e8a8e];return _0xea8fe5;};'use strict';var _=require('lodash');var util=require(_0x343d('0x0'));var logger=require(_0x343d('0x1'))(_0x343d('0x2'));var moment=require(_0x343d('0x3'));var BPromise=require(_0x343d('0x4'));var rp=require(_0x343d('0x5'));var fs=require('fs');var path=require(_0x343d('0x6'));var rimraf=require(_0x343d('0x7'));var config=require('../../config/environment');var attributes=require(_0x343d('0x8'));module['exports']=function(_0x117216,_0x3aa08a){return _0x117216[_0x343d('0x9')](_0x343d('0xa'),attributes,{'tableName':_0x343d('0xb'),'paranoid':![],'indexes':[{'name':_0x343d('0xc'),'fields':[_0x343d('0xd'),_0x343d('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 4b54c31..20b9ae3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe397=['FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe397,0x172));var _0x7e39=function(_0x556c31,_0x27f18a){_0x556c31=_0x556c31-0x0;var _0x954887=_0xe397[_0x556c31];return _0x954887;};'use strict';var _=require(_0x7e39('0x0'));var util=require(_0x7e39('0x1'));var moment=require(_0x7e39('0x2'));var BPromise=require(_0x7e39('0x3'));var rs=require(_0x7e39('0x4'));var fs=require('fs');var Redis=require(_0x7e39('0x5'));var db=require(_0x7e39('0x6'))['db'];var utils=require(_0x7e39('0x7'));var logger=require('../../config/logger')(_0x7e39('0x8'));var config=require(_0x7e39('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7e39('0xa')][_0x7e39('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e6356,_0x3940c5,_0x2e58ea){return new BPromise(function(_0x12ada1,_0x18d354){return client[_0x7e39('0xc')](_0x1e6356,_0x2e58ea)['then'](function(_0x443ac7){logger[_0x7e39('0xd')](_0x7e39('0xe'),_0x3940c5,_0x7e39('0xf'));logger[_0x7e39('0x10')](_0x7e39('0x11'),_0x3940c5,_0x7e39('0xf'),JSON[_0x7e39('0x12')](_0x443ac7));if(_0x443ac7[_0x7e39('0x13')]){if(_0x443ac7[_0x7e39('0x13')][_0x7e39('0x14')]===0x1f4){logger[_0x7e39('0x13')](_0x7e39('0xe'),_0x3940c5,_0x443ac7[_0x7e39('0x13')][_0x7e39('0x15')]);return _0x18d354(_0x443ac7[_0x7e39('0x13')][_0x7e39('0x15')]);}logger[_0x7e39('0x13')](_0x7e39('0xe'),_0x3940c5,_0x443ac7[_0x7e39('0x13')][_0x7e39('0x15')]);return _0x12ada1(_0x443ac7[_0x7e39('0x13')][_0x7e39('0x15')]);}else{logger[_0x7e39('0xd')](_0x7e39('0xe'),_0x3940c5,_0x7e39('0xf'));_0x12ada1(_0x443ac7[_0x7e39('0x16')][_0x7e39('0x15')]);}})[_0x7e39('0x17')](function(_0x269868){logger[_0x7e39('0x13')](_0x7e39('0xe'),_0x3940c5,_0x269868);_0x18d354(_0x269868);});});}
\ No newline at end of file
+var _0x3d5a=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','FreshdeskField,\x20%s,\x20%s','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird'];(function(_0xcad84b,_0x3e75f3){var _0x17c611=function(_0x5773b8){while(--_0x5773b8){_0xcad84b['push'](_0xcad84b['shift']());}};_0x17c611(++_0x3e75f3);}(_0x3d5a,0x19f));var _0xa3d5=function(_0x3bf04a,_0x56ed90){_0x3bf04a=_0x3bf04a-0x0;var _0x241e4b=_0x3d5a[_0x3bf04a];return _0x241e4b;};'use strict';var _=require(_0xa3d5('0x0'));var util=require(_0xa3d5('0x1'));var moment=require('moment');var BPromise=require(_0xa3d5('0x2'));var rs=require(_0xa3d5('0x3'));var fs=require('fs');var Redis=require(_0xa3d5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa3d5('0x5'));var logger=require(_0xa3d5('0x6'))(_0xa3d5('0x7'));var config=require(_0xa3d5('0x8'));var jayson=require(_0xa3d5('0x9'));var client=jayson['client'][_0xa3d5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd80a76,_0x57e010,_0x30ebc3){return new BPromise(function(_0x1654d3,_0x475a3e){return client[_0xa3d5('0xb')](_0xd80a76,_0x30ebc3)['then'](function(_0x357a15){logger['info'](_0xa3d5('0xc'),_0x57e010,_0xa3d5('0xd'));logger['debug'](_0xa3d5('0xe'),_0x57e010,_0xa3d5('0xd'),JSON[_0xa3d5('0xf')](_0x357a15));if(_0x357a15[_0xa3d5('0x10')]){if(_0x357a15[_0xa3d5('0x10')][_0xa3d5('0x11')]===0x1f4){logger[_0xa3d5('0x10')](_0xa3d5('0xc'),_0x57e010,_0x357a15['error'][_0xa3d5('0x12')]);return _0x475a3e(_0x357a15[_0xa3d5('0x10')]['message']);}logger[_0xa3d5('0x10')](_0xa3d5('0xc'),_0x57e010,_0x357a15[_0xa3d5('0x10')][_0xa3d5('0x12')]);return _0x1654d3(_0x357a15[_0xa3d5('0x10')][_0xa3d5('0x12')]);}else{logger[_0xa3d5('0x13')](_0xa3d5('0xc'),_0x57e010,'request\x20sent');_0x1654d3(_0x357a15[_0xa3d5('0x14')][_0xa3d5('0x12')]);}})[_0xa3d5('0x15')](function(_0x1362de){logger[_0xa3d5('0x10')](_0xa3d5('0xc'),_0x57e010,_0x1362de);_0x475a3e(_0x1362de);});});}
\ No newline at end of file
index 55b0f8f..9ec9029 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd87e=['post','create','addConfiguration','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','isAuthenticated','/:id','show','get','getConfigurations','/:id/fields','getFields'];(function(_0xc0eacc,_0x1ef0ad){var _0x1742a8=function(_0x3c413d){while(--_0x3c413d){_0xc0eacc['push'](_0xc0eacc['shift']());}};_0x1742a8(++_0x1ef0ad);}(_0xd87e,0x1bf));var _0xed87=function(_0x5f150e,_0x5e3a1e){_0x5f150e=_0x5f150e-0x0;var _0x2f6957=_0xd87e[_0x5f150e];return _0x2f6957;};'use strict';var multer=require(_0xed87('0x0'));var util=require(_0xed87('0x1'));var path=require('path');var timeout=require(_0xed87('0x2'));var express=require(_0xed87('0x3'));var router=express[_0xed87('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xed87('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xed87('0x6'));var controller=require(_0xed87('0x7'));router['get']('/',auth[_0xed87('0x8')](),controller['index']);router['get'](_0xed87('0x9'),auth[_0xed87('0x8')](),controller[_0xed87('0xa')]);router[_0xed87('0xb')]('/:id/configurations',auth[_0xed87('0x8')](),controller[_0xed87('0xc')]);router[_0xed87('0xb')](_0xed87('0xd'),auth[_0xed87('0x8')](),controller[_0xed87('0xe')]);router[_0xed87('0xf')]('/',auth['isAuthenticated'](),controller[_0xed87('0x10')]);router[_0xed87('0xf')]('/:id/configurations',auth[_0xed87('0x8')](),controller[_0xed87('0x11')]);router['put']('/:id',auth[_0xed87('0x8')](),controller[_0xed87('0x12')]);router[_0xed87('0x13')](_0xed87('0x9'),auth[_0xed87('0x8')](),controller[_0xed87('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xe205=['./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id/configurations','/:id/fields','getFields','create','post','addConfiguration','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xe205,0xa7));var _0x5e20=function(_0x483c6f,_0x35aa0c){_0x483c6f=_0x483c6f-0x0;var _0x365b8c=_0xe205[_0x483c6f];return _0x365b8c;};'use strict';var multer=require(_0x5e20('0x0'));var util=require(_0x5e20('0x1'));var path=require(_0x5e20('0x2'));var timeout=require(_0x5e20('0x3'));var express=require(_0x5e20('0x4'));var router=express[_0x5e20('0x5')]();var fs_extra=require(_0x5e20('0x6'));var auth=require(_0x5e20('0x7'));var interaction=require(_0x5e20('0x8'));var config=require('../../config/environment');var controller=require(_0x5e20('0x9'));router[_0x5e20('0xa')]('/',auth[_0x5e20('0xb')](),controller[_0x5e20('0xc')]);router['get']('/:id',auth[_0x5e20('0xb')](),controller['show']);router['get'](_0x5e20('0xd'),auth[_0x5e20('0xb')](),controller['getConfigurations']);router[_0x5e20('0xa')](_0x5e20('0xe'),auth[_0x5e20('0xb')](),controller[_0x5e20('0xf')]);router['post']('/',auth[_0x5e20('0xb')](),controller[_0x5e20('0x10')]);router[_0x5e20('0x11')](_0x5e20('0xd'),auth[_0x5e20('0xb')](),controller[_0x5e20('0x12')]);router['put'](_0x5e20('0x13'),auth[_0x5e20('0xb')](),controller[_0x5e20('0x14')]);router['delete'](_0x5e20('0x13'),auth['isAuthenticated'](),controller[_0x5e20('0x15')]);module['exports']=router;
\ No newline at end of file
index 56d2958..f594ae7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd943=['exports','STRING','username','remoteUri','sequelize'];(function(_0x330e59,_0x31f733){var _0x26feeb=function(_0x350588){while(--_0x350588){_0x330e59['push'](_0x330e59['shift']());}};_0x26feeb(++_0x31f733);}(_0xd943,0x15d));var _0x3d94=function(_0x3457e8,_0x29054b){_0x3457e8=_0x3457e8-0x0;var _0x226a95=_0xd943[_0x3457e8];return _0x226a95;};'use strict';var Sequelize=require(_0x3d94('0x0'));module[_0x3d94('0x1')]={'name':{'type':Sequelize[_0x3d94('0x2')]},'description':{'type':Sequelize[_0x3d94('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x3d94('0x3')},'apiKey':{'type':Sequelize[_0x3d94('0x2')]},'remoteUri':{'type':Sequelize[_0x3d94('0x2')],'unique':_0x3d94('0x4')},'serverUrl':{'type':Sequelize[_0x3d94('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x4e2e=['username','remoteUri','exports','STRING'];(function(_0xddda8a,_0x18e398){var _0x1fcb3d=function(_0x71251){while(--_0x71251){_0xddda8a['push'](_0xddda8a['shift']());}};_0x1fcb3d(++_0x18e398);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x383ef3,_0x26b75f){_0x383ef3=_0x383ef3-0x0;var _0x2c3fdb=_0x4e2e[_0x383ef3];return _0x2c3fdb;};'use strict';var Sequelize=require('sequelize');module[_0xe4e2('0x0')]={'name':{'type':Sequelize[_0xe4e2('0x1')]},'description':{'type':Sequelize[_0xe4e2('0x1')]},'username':{'type':Sequelize[_0xe4e2('0x1')],'unique':_0xe4e2('0x2')},'apiKey':{'type':Sequelize[_0xe4e2('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xe4e2('0x3')},'serverUrl':{'type':Sequelize[_0xe4e2('0x1')],'allowNull':![]}};
\ No newline at end of file
index 58138dd..125ac4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd12a=['format','/api/selector/owners','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','error','name','send','index','FreshsalesAccount','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','includeAll','catch','show','include','options','create','body','find','getConfigurations','findOne','params','FreshsalesConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','GET'];(function(_0x3fb610,_0x228ec7){var _0x46fd28=function(_0x17ef49){while(--_0x17ef49){_0x3fb610['push'](_0x3fb610['shift']());}};_0x46fd28(++_0x228ec7);}(_0xd12a,0x6e));var _0xad12=function(_0x5956cf,_0x3f6868){_0x5956cf=_0x5956cf-0x0;var _0x1ded47=_0xd12a[_0x5956cf];return _0x1ded47;};'use strict';var emlformat=require(_0xad12('0x0'));var rimraf=require(_0xad12('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xad12('0x2'));var rp=require(_0xad12('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xad12('0x4'));var util=require(_0xad12('0x5'));var path=require(_0xad12('0x6'));var sox=require(_0xad12('0x7'));var csv=require(_0xad12('0x8'));var ejs=require(_0xad12('0x9'));var fs=require('fs');var fs_extra=require(_0xad12('0xa'));var _=require(_0xad12('0xb'));var squel=require(_0xad12('0xc'));var crypto=require(_0xad12('0xd'));var jsforce=require(_0xad12('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xad12('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xad12('0xf'));var authService=require(_0xad12('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xad12('0x11'));var hardwareService=require(_0xad12('0x12'));var logger=require(_0xad12('0x13'))(_0xad12('0x14'));var utils=require(_0xad12('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xad12('0x16'));var db=require(_0xad12('0x17'))['db'];var integrations=require(_0xad12('0x18'));function respondWithStatusCode(_0x5688ff,_0x4f2a42){_0x4f2a42=_0x4f2a42||0xcc;return function(_0x1ef8b6){if(_0x1ef8b6){return _0x5688ff[_0xad12('0x19')](_0x4f2a42);}return _0x5688ff[_0xad12('0x1a')](_0x4f2a42)[_0xad12('0x1b')]();};}function respondWithResult(_0x26f8c7,_0x35c054){_0x35c054=_0x35c054||0xc8;return function(_0x3a9432){if(_0x3a9432){return _0x26f8c7[_0xad12('0x1a')](_0x35c054)[_0xad12('0x1c')](_0x3a9432);}};}function respondWithFilteredResult(_0x3890eb,_0x11d150){return function(_0x110c0f){if(_0x110c0f){var _0x1edd64=typeof _0x11d150['offset']===_0xad12('0x1d')&&typeof _0x11d150[_0xad12('0x1e')]===_0xad12('0x1d');var _0x425231=_0x110c0f[_0xad12('0x1f')];var _0x2a05d3=_0x1edd64?0x0:_0x11d150[_0xad12('0x20')];var _0x317f40=_0x1edd64?_0x110c0f[_0xad12('0x1f')]:_0x11d150['offset']+_0x11d150[_0xad12('0x1e')];var _0x6f90fb;if(_0x317f40>=_0x425231){_0x317f40=_0x425231;_0x6f90fb=0xc8;}else{_0x6f90fb=0xce;}_0x3890eb['status'](_0x6f90fb);return _0x3890eb[_0xad12('0x21')]('Content-Range',_0x2a05d3+'-'+_0x317f40+'/'+_0x425231)['json'](_0x110c0f);}return null;};}function patchUpdates(_0x2f72f6){return function(_0x32ad90){try{jsonpatch[_0xad12('0x22')](_0x32ad90,_0x2f72f6,!![]);}catch(_0x522a47){return BPromise[_0xad12('0x23')](_0x522a47);}return _0x32ad90[_0xad12('0x24')]();};}function saveUpdates(_0x5c600c,_0x452d21){return function(_0x3b564e){if(_0x3b564e){return _0x3b564e['update'](_0x5c600c)[_0xad12('0x25')](function(_0x3669f9){return _0x3669f9;});}return null;};}function removeEntity(_0x1eb99c,_0x2b3851){return function(_0x364e9c){if(_0x364e9c){return _0x364e9c[_0xad12('0x26')]()[_0xad12('0x25')](function(){_0x1eb99c[_0xad12('0x1a')](0xcc)[_0xad12('0x1b')]();});}};}function handleEntityNotFound(_0xb57197,_0x443a7e){return function(_0x4def5d){if(!_0x4def5d){_0xb57197[_0xad12('0x19')](0x194);}return _0x4def5d;};}function handleError(_0x1bf4a9,_0xec1d74){_0xec1d74=_0xec1d74||0x1f4;return function(_0x2dd116){logger[_0xad12('0x27')](_0x2dd116['stack']);if(_0x2dd116[_0xad12('0x28')]){delete _0x2dd116['name'];}_0x1bf4a9['status'](_0xec1d74)[_0xad12('0x29')](_0x2dd116);};}exports[_0xad12('0x2a')]=function(_0x219dfd,_0x5b53a6){var _0x29c82d={},_0x686d75={},_0x10a86a={'count':0x0,'rows':[]};var _0x5a068e=_['map'](db[_0xad12('0x2b')][_0xad12('0x2c')],function(_0x4e4c1d){return{'name':_0x4e4c1d[_0xad12('0x2d')],'type':_0x4e4c1d[_0xad12('0x2e')][_0xad12('0x2f')]};});_0x686d75[_0xad12('0x30')]=_[_0xad12('0x31')](_0x5a068e,'name');_0x686d75[_0xad12('0x32')]=_[_0xad12('0x33')](_0x219dfd['query']);_0x686d75['filters']=_[_0xad12('0x34')](_0x686d75['model'],_0x686d75[_0xad12('0x32')]);_0x29c82d[_0xad12('0x35')]=_[_0xad12('0x34')](_0x686d75['model'],qs['fields'](_0x219dfd[_0xad12('0x32')][_0xad12('0x36')]));_0x29c82d[_0xad12('0x35')]=_0x29c82d[_0xad12('0x35')][_0xad12('0x37')]?_0x29c82d[_0xad12('0x35')]:_0x686d75[_0xad12('0x30')];if(!_0x219dfd[_0xad12('0x32')]['hasOwnProperty'](_0xad12('0x38'))){_0x29c82d[_0xad12('0x1e')]=qs[_0xad12('0x1e')](_0x219dfd[_0xad12('0x32')][_0xad12('0x1e')]);_0x29c82d['offset']=qs['offset'](_0x219dfd[_0xad12('0x32')]['offset']);}_0x29c82d[_0xad12('0x39')]=qs[_0xad12('0x3a')](_0x219dfd[_0xad12('0x32')][_0xad12('0x3a')]);_0x29c82d[_0xad12('0x3b')]=qs['filters'](_[_0xad12('0x3c')](_0x219dfd[_0xad12('0x32')],_0x686d75[_0xad12('0x3d')]),_0x5a068e);if(_0x219dfd[_0xad12('0x32')][_0xad12('0x3e')]){_0x29c82d[_0xad12('0x3b')]=_['merge'](_0x29c82d[_0xad12('0x3b')],{'$or':_[_0xad12('0x31')](_0x5a068e,function(_0x76cb4){if(_0x76cb4[_0xad12('0x2e')]!=='VIRTUAL'){var _0x29b95f={};_0x29b95f[_0x76cb4['name']]={'$like':'%'+_0x219dfd[_0xad12('0x32')][_0xad12('0x3e')]+'%'};return _0x29b95f;}})});}_0x29c82d=_[_0xad12('0x3f')]({},_0x29c82d,_0x219dfd['options']);var _0x21c925={'where':_0x29c82d[_0xad12('0x3b')]};return db[_0xad12('0x2b')][_0xad12('0x1f')](_0x21c925)[_0xad12('0x25')](function(_0x19c696){_0x10a86a[_0xad12('0x1f')]=_0x19c696;if(_0x219dfd[_0xad12('0x32')][_0xad12('0x40')]){_0x29c82d['include']=[{'all':!![]}];}return db[_0xad12('0x2b')]['findAll'](_0x29c82d);})[_0xad12('0x25')](function(_0x564a24){_0x10a86a['rows']=_0x564a24;return _0x10a86a;})[_0xad12('0x25')](respondWithFilteredResult(_0x5b53a6,_0x29c82d))[_0xad12('0x41')](handleError(_0x5b53a6,null));};exports[_0xad12('0x42')]=function(_0xba6585,_0x58fa2c){var _0x3e3356={'raw':![],'where':{'id':_0xba6585['params']['id']}},_0x29a7aa={};_0x29a7aa[_0xad12('0x30')]=_[_0xad12('0x33')](db[_0xad12('0x2b')][_0xad12('0x2c')]);_0x29a7aa['query']=_[_0xad12('0x33')](_0xba6585['query']);_0x29a7aa[_0xad12('0x3d')]=_[_0xad12('0x34')](_0x29a7aa[_0xad12('0x30')],_0x29a7aa[_0xad12('0x32')]);_0x3e3356['attributes']=_['intersection'](_0x29a7aa['model'],qs[_0xad12('0x36')](_0xba6585[_0xad12('0x32')][_0xad12('0x36')]));_0x3e3356[_0xad12('0x35')]=_0x3e3356[_0xad12('0x35')][_0xad12('0x37')]?_0x3e3356[_0xad12('0x35')]:_0x29a7aa[_0xad12('0x30')];if(_0xba6585[_0xad12('0x32')][_0xad12('0x40')]){_0x3e3356[_0xad12('0x43')]=[{'all':!![]}];}_0x3e3356=_['merge']({},_0x3e3356,_0xba6585[_0xad12('0x44')]);return db[_0xad12('0x2b')]['find'](_0x3e3356)[_0xad12('0x25')](handleEntityNotFound(_0x58fa2c,null))[_0xad12('0x25')](respondWithResult(_0x58fa2c,null))[_0xad12('0x41')](handleError(_0x58fa2c,null));};exports[_0xad12('0x45')]=function(_0x21c9d7,_0x1f8925){return db[_0xad12('0x2b')]['create'](_0x21c9d7[_0xad12('0x46')],{})[_0xad12('0x25')](respondWithResult(_0x1f8925,0xc9))[_0xad12('0x41')](handleError(_0x1f8925,null));};exports['update']=function(_0x2dc2fc,_0x581437){if(_0x2dc2fc[_0xad12('0x46')]['id']){delete _0x2dc2fc[_0xad12('0x46')]['id'];}return db[_0xad12('0x2b')][_0xad12('0x47')]({'where':{'id':_0x2dc2fc['params']['id']}})[_0xad12('0x25')](handleEntityNotFound(_0x581437,null))[_0xad12('0x25')](saveUpdates(_0x2dc2fc[_0xad12('0x46')],null))['then'](respondWithResult(_0x581437,null))[_0xad12('0x41')](handleError(_0x581437,null));};exports['destroy']=function(_0x3953a2,_0x59c272){return db[_0xad12('0x2b')]['find']({'where':{'id':_0x3953a2['params']['id']}})['then'](handleEntityNotFound(_0x59c272,null))[_0xad12('0x25')](removeEntity(_0x59c272,null))['catch'](handleError(_0x59c272,null));};exports[_0xad12('0x48')]=function(_0x37cc69,_0x596283,_0x88ccdd){var _0x2d2434={};var _0x284b24={};var _0x1d6295;var _0x30ea34;return db[_0xad12('0x2b')][_0xad12('0x49')]({'where':{'id':_0x37cc69[_0xad12('0x4a')]['id']}})[_0xad12('0x25')](handleEntityNotFound(_0x596283,null))['then'](function(_0x18772d){if(_0x18772d){_0x1d6295=_0x18772d;_0x284b24[_0xad12('0x30')]=_['keys'](db[_0xad12('0x4b')]['rawAttributes']);_0x284b24[_0xad12('0x32')]=_[_0xad12('0x33')](_0x37cc69[_0xad12('0x32')]);_0x284b24[_0xad12('0x3d')]=_['intersection'](_0x284b24[_0xad12('0x30')],_0x284b24[_0xad12('0x32')]);_0x2d2434[_0xad12('0x35')]=_['intersection'](_0x284b24[_0xad12('0x30')],qs[_0xad12('0x36')](_0x37cc69[_0xad12('0x32')][_0xad12('0x36')]));_0x2d2434[_0xad12('0x35')]=_0x2d2434['attributes'][_0xad12('0x37')]?_0x2d2434[_0xad12('0x35')]:_0x284b24['model'];_0x2d2434[_0xad12('0x39')]=qs[_0xad12('0x3a')](_0x37cc69[_0xad12('0x32')]['sort']);_0x2d2434[_0xad12('0x3b')]=qs[_0xad12('0x3d')](_['pick'](_0x37cc69[_0xad12('0x32')],_0x284b24[_0xad12('0x3d')]));if(_0x37cc69[_0xad12('0x32')][_0xad12('0x3e')]){_0x2d2434['where']=_['merge'](_0x2d2434['where'],{'$or':_[_0xad12('0x31')](_0x2d2434[_0xad12('0x35')],function(_0xc688ab){var _0x19aa90={};_0x19aa90[_0xc688ab]={'$like':'%'+_0x37cc69['query'][_0xad12('0x3e')]+'%'};return _0x19aa90;})});}_0x2d2434=_[_0xad12('0x3f')]({},_0x2d2434,_0x37cc69[_0xad12('0x44')]);return _0x1d6295[_0xad12('0x48')](_0x2d2434);}})['then'](function(_0x475c01){if(_0x475c01){_0x30ea34=_0x475c01[_0xad12('0x37')];if(!_0x37cc69['query'][_0xad12('0x4c')](_0xad12('0x38'))){_0x2d2434['limit']=qs['limit'](_0x37cc69[_0xad12('0x32')][_0xad12('0x1e')]);_0x2d2434[_0xad12('0x20')]=qs[_0xad12('0x20')](_0x37cc69[_0xad12('0x32')][_0xad12('0x20')]);}return _0x1d6295[_0xad12('0x48')](_0x2d2434);}})['then'](function(_0x266268){if(_0x266268){return _0x266268?{'count':_0x30ea34,'rows':_0x266268}:null;}})['then'](respondWithResult(_0x596283,null))[_0xad12('0x41')](handleError(_0x596283,null));};exports[_0xad12('0x4d')]=function(_0x4090aa,_0x4cb12d,_0x40d093){if(_0x4090aa[_0xad12('0x46')]['id']){delete _0x4090aa[_0xad12('0x46')]['id'];}return db[_0xad12('0x2b')]['findOne']({'where':{'id':_0x4090aa[_0xad12('0x4a')]['id']}})[_0xad12('0x25')](handleEntityNotFound(_0x4cb12d,null))[_0xad12('0x25')](function(_0x2abcd0){if(_0x2abcd0){_0x4090aa['body'][_0xad12('0x4e')]=_0x2abcd0['id'];_0x4090aa[_0xad12('0x46')][_0xad12('0x4f')]=integrations[_0xad12('0x50')](_0x4090aa[_0xad12('0x46')][_0xad12('0x51')],_0x4090aa[_0xad12('0x46')][_0xad12('0x2e')]);_0x4090aa[_0xad12('0x46')][_0xad12('0x52')]=integrations[_0xad12('0x53')](_0x4090aa[_0xad12('0x46')][_0xad12('0x51')],_0x4090aa[_0xad12('0x46')]['type']);return db[_0xad12('0x4b')][_0xad12('0x45')](_0x4090aa[_0xad12('0x46')],{'include':[{'model':db[_0xad12('0x54')],'as':_0xad12('0x4f')},{'model':db['FreshsalesField'],'as':_0xad12('0x52')}]});}return null;})[_0xad12('0x25')](respondWithResult(_0x4cb12d,null))[_0xad12('0x41')](handleError(_0x4cb12d,null));};exports[_0xad12('0x55')]=function(_0x148419,_0x26eed6,_0x4ee385){var _0x928d6b='';var _0xa65891='';return db[_0xad12('0x2b')][_0xad12('0x49')]({'where':{'id':_0x148419[_0xad12('0x4a')]['id']},'attributes':['id',_0xad12('0x56'),_0xad12('0x57'),_0xad12('0x58')]})[_0xad12('0x25')](handleEntityNotFound(_0x26eed6,null))[_0xad12('0x25')](function(_0x6c5dee){if(_0x6c5dee){_0xa65891=_0x6c5dee[_0xad12('0x56')];_0x928d6b=_0x6c5dee[_0xad12('0x57')];var _0x25de35=_0x6c5dee['remoteUri'][_0xad12('0x59')](-0x1);if(_0x25de35==='/'){_0x928d6b=_0x928d6b[_0xad12('0x5a')](0x0,_0x928d6b['lastIndexOf'](_0x25de35));}return rp({'method':_0xad12('0x5b'),'uri':util[_0xad12('0x5c')]('%s%s',_0x928d6b,_0xad12('0x5d')),'headers':{'Authorization':_0xad12('0x5e')+_0x6c5dee['apiKey']},'json':!![]});}})[_0xad12('0x25')](function(_0x21c77c){if(_0x21c77c){var _0x5b39c1=_0x21c77c[_0xad12('0x5f')];var _0x43c03c=![];var _0x5dd59c=null;for(_0x5dd59c=0x0;_0x5dd59c<_0x5b39c1['length'];_0x5dd59c++){if(_0x5b39c1[_0x5dd59c]['email']===_0xa65891){_0x43c03c=!![];}}if(_0x43c03c){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xad12('0x60')});}}})[_0xad12('0x25')](respondWithResult(_0x26eed6,null))[_0xad12('0x41')](function(_0x2172e0){var _0x4a1f5d=_0x148419[_0xad12('0x32')][_0xad12('0x61')]?0x1f4:_0x2172e0[_0xad12('0x62')]||0x1f4;logger[_0xad12('0x27')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x4a1f5d,JSON[_0xad12('0x63')](_0x2172e0));delete _0x2172e0[_0xad12('0x28')];if(_0x4a1f5d===0x191){_0x4a1f5d=0x190;}_0x26eed6[_0xad12('0x1a')](_0x4a1f5d)[_0xad12('0x29')](_0x148419[_0xad12('0x32')]['test']?{'message':_0xad12('0x64'),'statusCode':_0x2172e0[_0xad12('0x62')]}:_0x2172e0);});};
\ No newline at end of file
+var _0x9fe8=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','show','params','find','catch','create','body','update','destroy','getConfigurations','findOne','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesConfiguration','FreshsalesField','getFields','username','remoteUri','apiKey','slice','lastIndexOf','format','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','then','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model'];(function(_0x131de3,_0xe50190){var _0x4a189e=function(_0x56f287){while(--_0x56f287){_0x131de3['push'](_0x131de3['shift']());}};_0x4a189e(++_0xe50190);}(_0x9fe8,0xfd));var _0x89fe=function(_0x57b707,_0x1b5d3c){_0x57b707=_0x57b707-0x0;var _0x15d0d4=_0x9fe8[_0x57b707];return _0x15d0d4;};'use strict';var emlformat=require(_0x89fe('0x0'));var rimraf=require(_0x89fe('0x1'));var zipdir=require(_0x89fe('0x2'));var jsonpatch=require(_0x89fe('0x3'));var rp=require(_0x89fe('0x4'));var moment=require(_0x89fe('0x5'));var BPromise=require(_0x89fe('0x6'));var Mustache=require(_0x89fe('0x7'));var util=require(_0x89fe('0x8'));var path=require('path');var sox=require(_0x89fe('0x9'));var csv=require(_0x89fe('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x89fe('0xb'));var squel=require('squel');var crypto=require(_0x89fe('0xc'));var jsforce=require(_0x89fe('0xd'));var deskjs=require(_0x89fe('0xe'));var toCsv=require(_0x89fe('0xa'));var querystring=require('querystring');var Papa=require(_0x89fe('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x89fe('0x10'));var as=require(_0x89fe('0x11'));var hardwareService=require(_0x89fe('0x12'));var logger=require(_0x89fe('0x13'))(_0x89fe('0x14'));var utils=require(_0x89fe('0x15'));var config=require(_0x89fe('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4d1ea5,_0x2971af){_0x2971af=_0x2971af||0xcc;return function(_0x387df4){if(_0x387df4){return _0x4d1ea5[_0x89fe('0x17')](_0x2971af);}return _0x4d1ea5[_0x89fe('0x18')](_0x2971af)[_0x89fe('0x19')]();};}function respondWithResult(_0xb80e16,_0x411368){_0x411368=_0x411368||0xc8;return function(_0x3829ba){if(_0x3829ba){return _0xb80e16['status'](_0x411368)[_0x89fe('0x1a')](_0x3829ba);}};}function respondWithFilteredResult(_0x535a05,_0x577e51){return function(_0x56b4b7){if(_0x56b4b7){var _0x52d771=typeof _0x577e51['offset']==='undefined'&&typeof _0x577e51[_0x89fe('0x1b')]===_0x89fe('0x1c');var _0x5b9067=_0x56b4b7[_0x89fe('0x1d')];var _0x13a62d=_0x52d771?0x0:_0x577e51[_0x89fe('0x1e')];var _0xc00f43=_0x52d771?_0x56b4b7[_0x89fe('0x1d')]:_0x577e51[_0x89fe('0x1e')]+_0x577e51[_0x89fe('0x1b')];var _0x76da7f;if(_0xc00f43>=_0x5b9067){_0xc00f43=_0x5b9067;_0x76da7f=0xc8;}else{_0x76da7f=0xce;}_0x535a05[_0x89fe('0x18')](_0x76da7f);return _0x535a05[_0x89fe('0x1f')](_0x89fe('0x20'),_0x13a62d+'-'+_0xc00f43+'/'+_0x5b9067)[_0x89fe('0x1a')](_0x56b4b7);}return null;};}function patchUpdates(_0x2667b2){return function(_0x3b4a8e){try{jsonpatch[_0x89fe('0x21')](_0x3b4a8e,_0x2667b2,!![]);}catch(_0x21d586){return BPromise['reject'](_0x21d586);}return _0x3b4a8e[_0x89fe('0x22')]();};}function saveUpdates(_0x13a0ed,_0x3f2d3f){return function(_0x3e4aa1){if(_0x3e4aa1){return _0x3e4aa1['update'](_0x13a0ed)[_0x89fe('0x23')](function(_0x4fa184){return _0x4fa184;});}return null;};}function removeEntity(_0x36973c,_0x375c0a){return function(_0x152bf1){if(_0x152bf1){return _0x152bf1['destroy']()[_0x89fe('0x23')](function(){_0x36973c[_0x89fe('0x18')](0xcc)[_0x89fe('0x19')]();});}};}function handleEntityNotFound(_0x393de9,_0x5557a9){return function(_0x31f5af){if(!_0x31f5af){_0x393de9['sendStatus'](0x194);}return _0x31f5af;};}function handleError(_0x3a658c,_0xcfcf3c){_0xcfcf3c=_0xcfcf3c||0x1f4;return function(_0x4f2321){logger['error'](_0x4f2321[_0x89fe('0x24')]);if(_0x4f2321[_0x89fe('0x25')]){delete _0x4f2321['name'];}_0x3a658c[_0x89fe('0x18')](_0xcfcf3c)[_0x89fe('0x26')](_0x4f2321);};}exports[_0x89fe('0x27')]=function(_0x2c07c3,_0x2c9c68){var _0x3ffd80={},_0x2e278b={},_0x11466b={'count':0x0,'rows':[]};var _0x33b0a8=_[_0x89fe('0x28')](db[_0x89fe('0x29')][_0x89fe('0x2a')],function(_0x5435f8){return{'name':_0x5435f8[_0x89fe('0x2b')],'type':_0x5435f8[_0x89fe('0x2c')][_0x89fe('0x2d')]};});_0x2e278b[_0x89fe('0x2e')]=_[_0x89fe('0x28')](_0x33b0a8,_0x89fe('0x25'));_0x2e278b[_0x89fe('0x2f')]=_[_0x89fe('0x30')](_0x2c07c3['query']);_0x2e278b[_0x89fe('0x31')]=_[_0x89fe('0x32')](_0x2e278b[_0x89fe('0x2e')],_0x2e278b[_0x89fe('0x2f')]);_0x3ffd80[_0x89fe('0x33')]=_[_0x89fe('0x32')](_0x2e278b[_0x89fe('0x2e')],qs[_0x89fe('0x34')](_0x2c07c3[_0x89fe('0x2f')][_0x89fe('0x34')]));_0x3ffd80[_0x89fe('0x33')]=_0x3ffd80['attributes'][_0x89fe('0x35')]?_0x3ffd80[_0x89fe('0x33')]:_0x2e278b[_0x89fe('0x2e')];if(!_0x2c07c3[_0x89fe('0x2f')][_0x89fe('0x36')]('nolimit')){_0x3ffd80[_0x89fe('0x1b')]=qs[_0x89fe('0x1b')](_0x2c07c3[_0x89fe('0x2f')][_0x89fe('0x1b')]);_0x3ffd80[_0x89fe('0x1e')]=qs[_0x89fe('0x1e')](_0x2c07c3[_0x89fe('0x2f')][_0x89fe('0x1e')]);}_0x3ffd80['order']=qs['sort'](_0x2c07c3[_0x89fe('0x2f')][_0x89fe('0x37')]);_0x3ffd80[_0x89fe('0x38')]=qs[_0x89fe('0x31')](_[_0x89fe('0x39')](_0x2c07c3[_0x89fe('0x2f')],_0x2e278b[_0x89fe('0x31')]),_0x33b0a8);if(_0x2c07c3[_0x89fe('0x2f')][_0x89fe('0x3a')]){_0x3ffd80[_0x89fe('0x38')]=_[_0x89fe('0x3b')](_0x3ffd80[_0x89fe('0x38')],{'$or':_[_0x89fe('0x28')](_0x33b0a8,function(_0x5b2879){if(_0x5b2879['type']!==_0x89fe('0x3c')){var _0x34a96b={};_0x34a96b[_0x5b2879[_0x89fe('0x25')]]={'$like':'%'+_0x2c07c3[_0x89fe('0x2f')][_0x89fe('0x3a')]+'%'};return _0x34a96b;}})});}_0x3ffd80=_[_0x89fe('0x3b')]({},_0x3ffd80,_0x2c07c3[_0x89fe('0x3d')]);var _0x2fb5f3={'where':_0x3ffd80['where']};return db[_0x89fe('0x29')]['count'](_0x2fb5f3)['then'](function(_0x114211){_0x11466b[_0x89fe('0x1d')]=_0x114211;if(_0x2c07c3[_0x89fe('0x2f')][_0x89fe('0x3e')]){_0x3ffd80[_0x89fe('0x3f')]=[{'all':!![]}];}return db['FreshsalesAccount']['findAll'](_0x3ffd80);})[_0x89fe('0x23')](function(_0x3b41ff){_0x11466b['rows']=_0x3b41ff;return _0x11466b;})[_0x89fe('0x23')](respondWithFilteredResult(_0x2c9c68,_0x3ffd80))['catch'](handleError(_0x2c9c68,null));};exports[_0x89fe('0x40')]=function(_0x46a0c3,_0x1ad0b8){var _0x422002={'raw':![],'where':{'id':_0x46a0c3[_0x89fe('0x41')]['id']}},_0x39079d={};_0x39079d[_0x89fe('0x2e')]=_[_0x89fe('0x30')](db[_0x89fe('0x29')][_0x89fe('0x2a')]);_0x39079d[_0x89fe('0x2f')]=_[_0x89fe('0x30')](_0x46a0c3[_0x89fe('0x2f')]);_0x39079d['filters']=_['intersection'](_0x39079d[_0x89fe('0x2e')],_0x39079d[_0x89fe('0x2f')]);_0x422002['attributes']=_[_0x89fe('0x32')](_0x39079d['model'],qs[_0x89fe('0x34')](_0x46a0c3[_0x89fe('0x2f')][_0x89fe('0x34')]));_0x422002[_0x89fe('0x33')]=_0x422002[_0x89fe('0x33')][_0x89fe('0x35')]?_0x422002[_0x89fe('0x33')]:_0x39079d[_0x89fe('0x2e')];if(_0x46a0c3['query']['includeAll']){_0x422002['include']=[{'all':!![]}];}_0x422002=_[_0x89fe('0x3b')]({},_0x422002,_0x46a0c3[_0x89fe('0x3d')]);return db[_0x89fe('0x29')][_0x89fe('0x42')](_0x422002)[_0x89fe('0x23')](handleEntityNotFound(_0x1ad0b8,null))[_0x89fe('0x23')](respondWithResult(_0x1ad0b8,null))[_0x89fe('0x43')](handleError(_0x1ad0b8,null));};exports[_0x89fe('0x44')]=function(_0x544dd6,_0x1451cf){return db['FreshsalesAccount'][_0x89fe('0x44')](_0x544dd6[_0x89fe('0x45')],{})['then'](respondWithResult(_0x1451cf,0xc9))[_0x89fe('0x43')](handleError(_0x1451cf,null));};exports[_0x89fe('0x46')]=function(_0x234e85,_0x44627e){if(_0x234e85['body']['id']){delete _0x234e85[_0x89fe('0x45')]['id'];}return db[_0x89fe('0x29')][_0x89fe('0x42')]({'where':{'id':_0x234e85[_0x89fe('0x41')]['id']}})['then'](handleEntityNotFound(_0x44627e,null))[_0x89fe('0x23')](saveUpdates(_0x234e85[_0x89fe('0x45')],null))[_0x89fe('0x23')](respondWithResult(_0x44627e,null))['catch'](handleError(_0x44627e,null));};exports[_0x89fe('0x47')]=function(_0x38d6e4,_0x58267e){return db[_0x89fe('0x29')][_0x89fe('0x42')]({'where':{'id':_0x38d6e4[_0x89fe('0x41')]['id']}})[_0x89fe('0x23')](handleEntityNotFound(_0x58267e,null))[_0x89fe('0x23')](removeEntity(_0x58267e,null))[_0x89fe('0x43')](handleError(_0x58267e,null));};exports[_0x89fe('0x48')]=function(_0x416b6a,_0x57e2f3,_0xc6883e){var _0x126151={};var _0x268aed={};var _0x21edd1;var _0x1306c5;return db[_0x89fe('0x29')][_0x89fe('0x49')]({'where':{'id':_0x416b6a[_0x89fe('0x41')]['id']}})[_0x89fe('0x23')](handleEntityNotFound(_0x57e2f3,null))['then'](function(_0x5c216f){if(_0x5c216f){_0x21edd1=_0x5c216f;_0x268aed['model']=_['keys'](db['FreshsalesConfiguration'][_0x89fe('0x2a')]);_0x268aed[_0x89fe('0x2f')]=_[_0x89fe('0x30')](_0x416b6a[_0x89fe('0x2f')]);_0x268aed[_0x89fe('0x31')]=_[_0x89fe('0x32')](_0x268aed[_0x89fe('0x2e')],_0x268aed[_0x89fe('0x2f')]);_0x126151[_0x89fe('0x33')]=_[_0x89fe('0x32')](_0x268aed[_0x89fe('0x2e')],qs[_0x89fe('0x34')](_0x416b6a[_0x89fe('0x2f')][_0x89fe('0x34')]));_0x126151[_0x89fe('0x33')]=_0x126151[_0x89fe('0x33')][_0x89fe('0x35')]?_0x126151[_0x89fe('0x33')]:_0x268aed[_0x89fe('0x2e')];_0x126151['order']=qs[_0x89fe('0x37')](_0x416b6a['query'][_0x89fe('0x37')]);_0x126151[_0x89fe('0x38')]=qs['filters'](_['pick'](_0x416b6a[_0x89fe('0x2f')],_0x268aed[_0x89fe('0x31')]));if(_0x416b6a['query'][_0x89fe('0x3a')]){_0x126151[_0x89fe('0x38')]=_[_0x89fe('0x3b')](_0x126151['where'],{'$or':_[_0x89fe('0x28')](_0x126151[_0x89fe('0x33')],function(_0x5aaefc){var _0x406164={};_0x406164[_0x5aaefc]={'$like':'%'+_0x416b6a[_0x89fe('0x2f')]['filter']+'%'};return _0x406164;})});}_0x126151=_['merge']({},_0x126151,_0x416b6a[_0x89fe('0x3d')]);return _0x21edd1['getConfigurations'](_0x126151);}})['then'](function(_0x3aa88f){if(_0x3aa88f){_0x1306c5=_0x3aa88f[_0x89fe('0x35')];if(!_0x416b6a[_0x89fe('0x2f')][_0x89fe('0x36')](_0x89fe('0x4a'))){_0x126151[_0x89fe('0x1b')]=qs[_0x89fe('0x1b')](_0x416b6a[_0x89fe('0x2f')][_0x89fe('0x1b')]);_0x126151[_0x89fe('0x1e')]=qs[_0x89fe('0x1e')](_0x416b6a['query'][_0x89fe('0x1e')]);}return _0x21edd1[_0x89fe('0x48')](_0x126151);}})[_0x89fe('0x23')](function(_0x1cb416){if(_0x1cb416){return _0x1cb416?{'count':_0x1306c5,'rows':_0x1cb416}:null;}})[_0x89fe('0x23')](respondWithResult(_0x57e2f3,null))[_0x89fe('0x43')](handleError(_0x57e2f3,null));};exports[_0x89fe('0x4b')]=function(_0x4d7810,_0x128e00,_0x16bf5b){if(_0x4d7810[_0x89fe('0x45')]['id']){delete _0x4d7810['body']['id'];}return db[_0x89fe('0x29')]['findOne']({'where':{'id':_0x4d7810[_0x89fe('0x41')]['id']}})[_0x89fe('0x23')](handleEntityNotFound(_0x128e00,null))[_0x89fe('0x23')](function(_0x30b7e2){if(_0x30b7e2){_0x4d7810[_0x89fe('0x45')][_0x89fe('0x4c')]=_0x30b7e2['id'];_0x4d7810[_0x89fe('0x45')][_0x89fe('0x4d')]=integrations[_0x89fe('0x4e')](_0x4d7810[_0x89fe('0x45')][_0x89fe('0x4f')],_0x4d7810['body']['type']);_0x4d7810[_0x89fe('0x45')][_0x89fe('0x50')]=integrations[_0x89fe('0x51')](_0x4d7810['body'][_0x89fe('0x4f')],_0x4d7810[_0x89fe('0x45')][_0x89fe('0x2c')]);return db[_0x89fe('0x52')][_0x89fe('0x44')](_0x4d7810[_0x89fe('0x45')],{'include':[{'model':db[_0x89fe('0x53')],'as':_0x89fe('0x4d')},{'model':db[_0x89fe('0x53')],'as':_0x89fe('0x50')}]});}return null;})['then'](respondWithResult(_0x128e00,null))['catch'](handleError(_0x128e00,null));};exports[_0x89fe('0x54')]=function(_0x4294a5,_0x458691,_0x4ac815){var _0x58d50f='';var _0xfa6251='';return db[_0x89fe('0x29')][_0x89fe('0x49')]({'where':{'id':_0x4294a5[_0x89fe('0x41')]['id']},'attributes':['id',_0x89fe('0x55'),_0x89fe('0x56'),_0x89fe('0x57')]})[_0x89fe('0x23')](handleEntityNotFound(_0x458691,null))['then'](function(_0x3f53e3){if(_0x3f53e3){_0xfa6251=_0x3f53e3[_0x89fe('0x55')];_0x58d50f=_0x3f53e3['remoteUri'];var _0x920d49=_0x3f53e3[_0x89fe('0x56')][_0x89fe('0x58')](-0x1);if(_0x920d49==='/'){_0x58d50f=_0x58d50f['substring'](0x0,_0x58d50f[_0x89fe('0x59')](_0x920d49));}return rp({'method':'GET','uri':util[_0x89fe('0x5a')]('%s%s',_0x58d50f,_0x89fe('0x5b')),'headers':{'Authorization':_0x89fe('0x5c')+_0x3f53e3[_0x89fe('0x57')]},'json':!![]});}})[_0x89fe('0x23')](function(_0x5edc65){if(_0x5edc65){var _0x50c940=_0x5edc65[_0x89fe('0x5d')];var _0x55f87f=![];var _0x29e972=null;for(_0x29e972=0x0;_0x29e972<_0x50c940[_0x89fe('0x35')];_0x29e972++){if(_0x50c940[_0x29e972][_0x89fe('0x5e')]===_0xfa6251){_0x55f87f=!![];}}if(_0x55f87f){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x89fe('0x5f')});}}})[_0x89fe('0x23')](respondWithResult(_0x458691,null))[_0x89fe('0x43')](function(_0xa40a85){var _0x3ff105=_0x4294a5[_0x89fe('0x2f')]['test']?0x1f4:_0xa40a85[_0x89fe('0x60')]||0x1f4;logger[_0x89fe('0x61')](_0x89fe('0x62'),_0x89fe('0x54'),_0x3ff105,JSON[_0x89fe('0x63')](_0xa40a85));delete _0xa40a85['name'];if(_0x3ff105===0x191){_0x3ff105=0x190;}_0x458691['status'](_0x3ff105)[_0x89fe('0x26')](_0x4294a5[_0x89fe('0x2f')]['test']?{'message':'Wrong\x20credentials','statusCode':_0xa40a85[_0x89fe('0x60')]}:_0xa40a85);});};
\ No newline at end of file
index 0199aaf..2ca31ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6050=['moment','bluebird','path','rimraf','../../config/environment','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0x43b595,_0x15b51a){var _0x1338a5=function(_0x5c0782){while(--_0x5c0782){_0x43b595['push'](_0x43b595['shift']());}};_0x1338a5(++_0x15b51a);}(_0x6050,0x196));var _0x0605=function(_0x3004ba,_0x34ea1a){_0x3004ba=_0x3004ba-0x0;var _0x25e804=_0x6050[_0x3004ba];return _0x25e804;};'use strict';var _=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var logger=require(_0x0605('0x2'))(_0x0605('0x3'));var moment=require(_0x0605('0x4'));var BPromise=require(_0x0605('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0605('0x6'));var rimraf=require(_0x0605('0x7'));var config=require(_0x0605('0x8'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0xd78d96,_0x578623){return _0xd78d96['define']('FreshsalesAccount',attributes,{'tableName':_0x0605('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4975=['path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount','int_freshsales_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1bcd6f,_0xa89d8){var _0x349319=function(_0x20a636){while(--_0x20a636){_0x1bcd6f['push'](_0x1bcd6f['shift']());}};_0x349319(++_0xa89d8);}(_0x4975,0x86));var _0x5497=function(_0x6c051,_0x4a3ea7){_0x6c051=_0x6c051-0x0;var _0x3b5e5f=_0x4975[_0x6c051];return _0x3b5e5f;};'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'));var integrations=require(_0x5497('0xa'));module['exports']=function(_0x37e48d,_0x4f563d){return _0x37e48d[_0x5497('0xb')](_0x5497('0xc'),attributes,{'tableName':_0x5497('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d93e24d..a3e7216 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3da=['then','GetFreshsalesAccount','catch','ShowFreshsalesAccount','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','FreshsalesAccount','findAll','options','raw','attributes','limit','include','map','model'];(function(_0x4f36d9,_0x35e95d){var _0x17bb63=function(_0x282912){while(--_0x282912){_0x4f36d9['push'](_0x4f36d9['shift']());}};_0x17bb63(++_0x35e95d);}(_0xe3da,0x1cd));var _0xae3d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe3da[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var moment=require(_0xae3d('0x2'));var BPromise=require(_0xae3d('0x3'));var rs=require(_0xae3d('0x4'));var fs=require('fs');var Redis=require(_0xae3d('0x5'));var db=require(_0xae3d('0x6'))['db'];var utils=require(_0xae3d('0x7'));var logger=require(_0xae3d('0x8'))(_0xae3d('0x9'));var config=require(_0xae3d('0xa'));var jayson=require(_0xae3d('0xb'));var client=jayson[_0xae3d('0xc')][_0xae3d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x476579,_0x33c089,_0x583b98){return new BPromise(function(_0x2a5c45,_0x3d6650){return client['request'](_0x476579,_0x583b98)['then'](function(_0x459592){logger[_0xae3d('0xe')](_0xae3d('0xf'),_0x33c089,_0xae3d('0x10'));logger[_0xae3d('0x11')](_0xae3d('0x12'),_0x33c089,'request\x20sent',JSON[_0xae3d('0x13')](_0x459592));if(_0x459592['error']){if(_0x459592[_0xae3d('0x14')][_0xae3d('0x15')]===0x1f4){logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0x459592['error'][_0xae3d('0x16')]);return _0x3d6650(_0x459592[_0xae3d('0x14')][_0xae3d('0x16')]);}logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0x459592[_0xae3d('0x14')][_0xae3d('0x16')]);return _0x2a5c45(_0x459592['error'][_0xae3d('0x16')]);}else{logger[_0xae3d('0xe')](_0xae3d('0xf'),_0x33c089,_0xae3d('0x10'));_0x2a5c45(_0x459592[_0xae3d('0x17')][_0xae3d('0x16')]);}})['catch'](function(_0xe925fd){logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0xe925fd);_0x3d6650(_0xe925fd);});});}exports['GetFreshsalesAccount']=function(_0x3f8cf9){var _0x4cbe4e=this;return new Promise(function(_0x558e42,_0x4d931d){return db[_0xae3d('0x18')][_0xae3d('0x19')]({'raw':_0x3f8cf9[_0xae3d('0x1a')]?_0x3f8cf9[_0xae3d('0x1a')][_0xae3d('0x1b')]===undefined?!![]:![]:!![],'where':_0x3f8cf9['options']?_0x3f8cf9[_0xae3d('0x1a')]['where']||null:null,'attributes':_0x3f8cf9[_0xae3d('0x1a')]?_0x3f8cf9[_0xae3d('0x1a')][_0xae3d('0x1c')]||null:null,'limit':_0x3f8cf9[_0xae3d('0x1a')]?_0x3f8cf9[_0xae3d('0x1a')][_0xae3d('0x1d')]||null:null,'include':_0x3f8cf9[_0xae3d('0x1a')]?_0x3f8cf9[_0xae3d('0x1a')][_0xae3d('0x1e')]?_[_0xae3d('0x1f')](_0x3f8cf9[_0xae3d('0x1a')][_0xae3d('0x1e')],function(_0x37f5ff){return{'model':db[_0x37f5ff[_0xae3d('0x20')]],'as':_0x37f5ff['as'],'attributes':_0x37f5ff[_0xae3d('0x1c')],'include':_0x37f5ff[_0xae3d('0x1e')]?_[_0xae3d('0x1f')](_0x37f5ff[_0xae3d('0x1e')],function(_0x2131e9){return{'model':db[_0x2131e9[_0xae3d('0x20')]],'as':_0x2131e9['as'],'attributes':_0x2131e9['attributes'],'include':_0x2131e9[_0xae3d('0x1e')]?_[_0xae3d('0x1f')](_0x2131e9[_0xae3d('0x1e')],function(_0x52df0f){return{'model':db[_0x52df0f[_0xae3d('0x20')]],'as':_0x52df0f['as'],'attributes':_0x52df0f[_0xae3d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xae3d('0x21')](function(_0x54c1e1){logger['info'](_0xae3d('0x22'),_0x3f8cf9);logger[_0xae3d('0x11')](_0xae3d('0x22'),_0x3f8cf9,JSON[_0xae3d('0x13')](_0x54c1e1));_0x558e42(_0x54c1e1);})[_0xae3d('0x23')](function(_0x561371){logger[_0xae3d('0x14')](_0xae3d('0x22'),_0x561371['message'],_0x3f8cf9);_0x4d931d(_0x4cbe4e[_0xae3d('0x14')](0x1f4,_0x561371[_0xae3d('0x16')]));});});};exports[_0xae3d('0x24')]=function(_0x46f484){var _0x432c04=this;return new Promise(function(_0x6ef13c,_0x5356d4){return db['FreshsalesAccount']['find']({'raw':_0x46f484[_0xae3d('0x1a')]?_0x46f484[_0xae3d('0x1a')][_0xae3d('0x1b')]===undefined?!![]:![]:!![],'where':_0x46f484[_0xae3d('0x1a')]?_0x46f484['options'][_0xae3d('0x25')]||null:null,'attributes':_0x46f484[_0xae3d('0x1a')]?_0x46f484[_0xae3d('0x1a')][_0xae3d('0x1c')]||null:null,'include':_0x46f484[_0xae3d('0x1a')]?_0x46f484[_0xae3d('0x1a')][_0xae3d('0x1e')]?_['map'](_0x46f484[_0xae3d('0x1a')]['include'],function(_0x55aae4){return{'model':db[_0x55aae4[_0xae3d('0x20')]],'as':_0x55aae4['as'],'attributes':_0x55aae4['attributes'],'include':_0x55aae4[_0xae3d('0x1e')]?_['map'](_0x55aae4['include'],function(_0x1a28b5){return{'model':db[_0x1a28b5[_0xae3d('0x20')]],'as':_0x1a28b5['as'],'attributes':_0x1a28b5[_0xae3d('0x1c')],'include':_0x1a28b5['include']?_[_0xae3d('0x1f')](_0x1a28b5['include'],function(_0xce647f){return{'model':db[_0xce647f[_0xae3d('0x20')]],'as':_0xce647f['as'],'attributes':_0xce647f[_0xae3d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xae3d('0x21')](function(_0x18c469){logger[_0xae3d('0xe')](_0xae3d('0x24'),_0x46f484);logger[_0xae3d('0x11')](_0xae3d('0x24'),_0x46f484,JSON[_0xae3d('0x13')](_0x18c469));_0x6ef13c(_0x18c469);})[_0xae3d('0x23')](function(_0x5543ee){logger['error'](_0xae3d('0x24'),_0x5543ee['message'],_0x46f484);_0x5356d4(_0x432c04[_0xae3d('0x14')](0x1f4,_0x5543ee[_0xae3d('0x16')]));});});};
\ No newline at end of file
+var _0xafc4=['raw','where','attributes','limit','include','model','map','ShowFreshsalesAccount','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','GetFreshsalesAccount','FreshsalesAccount','options'];(function(_0x3e7b86,_0x3a4c16){var _0x56ef5d=function(_0x29c0f0){while(--_0x29c0f0){_0x3e7b86['push'](_0x3e7b86['shift']());}};_0x56ef5d(++_0x3a4c16);}(_0xafc4,0x69));var _0x4afc=function(_0x5d76cc,_0x195736){_0x5d76cc=_0x5d76cc-0x0;var _0x4acce4=_0xafc4[_0x5d76cc];return _0x4acce4;};'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')]('FreshsalesAccount,\x20%s,\x20%s',_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x5e1e29(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}else{logger['info']('FreshsalesAccount,\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);});});}exports[_0x4afc('0x14')]=function(_0x22f809){var _0x3ad418=this;return new Promise(function(_0x16365f,_0x135349){return db[_0x4afc('0x15')]['findAll']({'raw':_0x22f809[_0x4afc('0x16')]?_0x22f809[_0x4afc('0x16')][_0x4afc('0x17')]===undefined?!![]:![]:!![],'where':_0x22f809[_0x4afc('0x16')]?_0x22f809['options'][_0x4afc('0x18')]||null:null,'attributes':_0x22f809[_0x4afc('0x16')]?_0x22f809[_0x4afc('0x16')][_0x4afc('0x19')]||null:null,'limit':_0x22f809[_0x4afc('0x16')]?_0x22f809[_0x4afc('0x16')][_0x4afc('0x1a')]||null:null,'include':_0x22f809['options']?_0x22f809[_0x4afc('0x16')][_0x4afc('0x1b')]?_['map'](_0x22f809[_0x4afc('0x16')]['include'],function(_0x1aa676){return{'model':db[_0x1aa676[_0x4afc('0x1c')]],'as':_0x1aa676['as'],'attributes':_0x1aa676[_0x4afc('0x19')],'include':_0x1aa676[_0x4afc('0x1b')]?_[_0x4afc('0x1d')](_0x1aa676[_0x4afc('0x1b')],function(_0x40a0db){return{'model':db[_0x40a0db[_0x4afc('0x1c')]],'as':_0x40a0db['as'],'attributes':_0x40a0db[_0x4afc('0x19')],'include':_0x40a0db[_0x4afc('0x1b')]?_[_0x4afc('0x1d')](_0x40a0db[_0x4afc('0x1b')],function(_0x35f5b3){return{'model':db[_0x35f5b3['model']],'as':_0x35f5b3['as'],'attributes':_0x35f5b3[_0x4afc('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4afc('0xa')](function(_0x2d6112){logger['info']('GetFreshsalesAccount',_0x22f809);logger['debug'](_0x4afc('0x14'),_0x22f809,JSON[_0x4afc('0xe')](_0x2d6112));_0x16365f(_0x2d6112);})['catch'](function(_0xd26d2f){logger[_0x4afc('0xf')]('GetFreshsalesAccount',_0xd26d2f['message'],_0x22f809);_0x135349(_0x3ad418['error'](0x1f4,_0xd26d2f[_0x4afc('0x11')]));});});};exports[_0x4afc('0x1e')]=function(_0x17a43d){var _0x46357b=this;return new Promise(function(_0xc1d91,_0x28cd3e){return db['FreshsalesAccount'][_0x4afc('0x1f')]({'raw':_0x17a43d[_0x4afc('0x16')]?_0x17a43d[_0x4afc('0x16')][_0x4afc('0x17')]===undefined?!![]:![]:!![],'where':_0x17a43d[_0x4afc('0x16')]?_0x17a43d[_0x4afc('0x16')][_0x4afc('0x18')]||null:null,'attributes':_0x17a43d[_0x4afc('0x16')]?_0x17a43d['options'][_0x4afc('0x19')]||null:null,'include':_0x17a43d['options']?_0x17a43d['options'][_0x4afc('0x1b')]?_[_0x4afc('0x1d')](_0x17a43d[_0x4afc('0x16')][_0x4afc('0x1b')],function(_0x3ec6fa){return{'model':db[_0x3ec6fa[_0x4afc('0x1c')]],'as':_0x3ec6fa['as'],'attributes':_0x3ec6fa['attributes'],'include':_0x3ec6fa[_0x4afc('0x1b')]?_[_0x4afc('0x1d')](_0x3ec6fa[_0x4afc('0x1b')],function(_0x127ac8){return{'model':db[_0x127ac8[_0x4afc('0x1c')]],'as':_0x127ac8['as'],'attributes':_0x127ac8[_0x4afc('0x19')],'include':_0x127ac8['include']?_[_0x4afc('0x1d')](_0x127ac8[_0x4afc('0x1b')],function(_0x91565d){return{'model':db[_0x91565d[_0x4afc('0x1c')]],'as':_0x91565d['as'],'attributes':_0x91565d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x43c341){logger[_0x4afc('0xb')](_0x4afc('0x1e'),_0x17a43d);logger['debug']('ShowFreshsalesAccount',_0x17a43d,JSON[_0x4afc('0xe')](_0x43c341));_0xc1d91(_0x43c341);})['catch'](function(_0x5947bb){logger[_0x4afc('0xf')](_0x4afc('0x1e'),_0x5947bb[_0x4afc('0x11')],_0x17a43d);_0x28cd3e(_0x46357b[_0x4afc('0xf')](0x1f4,_0x5947bb[_0x4afc('0x11')]));});});};
\ No newline at end of file
index f7dda0a..19d5920 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf7e=['/:id','show','/:id/descriptions','/:id/fields','getFields','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcf7e,0x1d9));var _0xecf7=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xcf7e[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require(_0xecf7('0x0'));var util=require(_0xecf7('0x1'));var path=require(_0xecf7('0x2'));var timeout=require(_0xecf7('0x3'));var express=require(_0xecf7('0x4'));var router=express['Router']();var fs_extra=require(_0xecf7('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xecf7('0x6'));var controller=require(_0xecf7('0x7'));router[_0xecf7('0x8')]('/',auth[_0xecf7('0x9')](),controller[_0xecf7('0xa')]);router[_0xecf7('0x8')](_0xecf7('0xb'),auth[_0xecf7('0x9')](),controller[_0xecf7('0xc')]);router['get']('/:id/subjects',auth[_0xecf7('0x9')](),controller['getSubjects']);router[_0xecf7('0x8')](_0xecf7('0xd'),auth[_0xecf7('0x9')](),controller['getDescriptions']);router[_0xecf7('0x8')](_0xecf7('0xe'),auth[_0xecf7('0x9')](),controller[_0xecf7('0xf')]);router[_0xecf7('0x10')]('/',auth[_0xecf7('0x9')](),controller[_0xecf7('0x11')]);router[_0xecf7('0x12')]('/:id',auth[_0xecf7('0x9')](),controller[_0xecf7('0x13')]);router[_0xecf7('0x14')](_0xecf7('0xb'),auth[_0xecf7('0x9')](),controller[_0xecf7('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x9d87=['../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x9d87,0x10d));var _0x79d8=function(_0xe24c6e,_0x3f1672){_0xe24c6e=_0xe24c6e-0x0;var _0xf764fe=_0x9d87[_0xe24c6e];return _0xf764fe;};'use strict';var multer=require(_0x79d8('0x0'));var util=require('util');var path=require(_0x79d8('0x1'));var timeout=require(_0x79d8('0x2'));var express=require(_0x79d8('0x3'));var router=express[_0x79d8('0x4')]();var fs_extra=require(_0x79d8('0x5'));var auth=require(_0x79d8('0x6'));var interaction=require(_0x79d8('0x7'));var config=require(_0x79d8('0x8'));var controller=require(_0x79d8('0x9'));router[_0x79d8('0xa')]('/',auth[_0x79d8('0xb')](),controller['index']);router['get'](_0x79d8('0xc'),auth[_0x79d8('0xb')](),controller[_0x79d8('0xd')]);router[_0x79d8('0xa')](_0x79d8('0xe'),auth[_0x79d8('0xb')](),controller[_0x79d8('0xf')]);router[_0x79d8('0xa')](_0x79d8('0x10'),auth[_0x79d8('0xb')](),controller[_0x79d8('0x11')]);router[_0x79d8('0xa')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x79d8('0x12')]('/',auth[_0x79d8('0xb')](),controller[_0x79d8('0x13')]);router['put']('/:id',auth[_0x79d8('0xb')](),controller['update']);router[_0x79d8('0x14')](_0x79d8('0xc'),auth[_0x79d8('0xb')](),controller[_0x79d8('0x15')]);module[_0x79d8('0x16')]=router;
\ No newline at end of file
index 4cd4265..eb9684e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09a0=['sequelize','exports','STRING'];(function(_0x338bb6,_0x5504a6){var _0x2fb7a7=function(_0x693e01){while(--_0x693e01){_0x338bb6['push'](_0x338bb6['shift']());}};_0x2fb7a7(++_0x5504a6);}(_0x09a0,0x114));var _0x009a=function(_0xe9c061,_0x38ee98){_0xe9c061=_0xe9c061-0x0;var _0x289f96=_0x09a0[_0xe9c061];return _0x289f96;};'use strict';var Sequelize=require(_0x009a('0x0'));module[_0x009a('0x1')]={'name':{'type':Sequelize[_0x009a('0x2')]},'description':{'type':Sequelize[_0x009a('0x2')]}};
\ No newline at end of file
+var _0xcf86=['STRING','sequelize','exports'];(function(_0x1dd2cc,_0x36ddfe){var _0x305d8e=function(_0x27df09){while(--_0x27df09){_0x1dd2cc['push'](_0x1dd2cc['shift']());}};_0x305d8e(++_0x36ddfe);}(_0xcf86,0x139));var _0x6cf8=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0xcf86[_0xe66cf2];return _0x2d84e7;};'use strict';var Sequelize=require(_0x6cf8('0x0'));module[_0x6cf8('0x1')]={'name':{'type':Sequelize[_0x6cf8('0x2')]},'description':{'type':Sequelize[_0x6cf8('0x2')]}};
\ No newline at end of file
index 505438e..02f540b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0257=['query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','rawAttributes','create','body','params','destroy','find','getSubjects','findOne','order','FreshsalesField','getDescriptions','getFields','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','error','stack','name','send','index','map','FreshsalesConfiguration','fieldName','type','key','keys'];(function(_0x449e3e,_0x3e113e){var _0x6cc58a=function(_0x4d8c4d){while(--_0x4d8c4d){_0x449e3e['push'](_0x449e3e['shift']());}};_0x6cc58a(++_0x3e113e);}(_0x0257,0x159));var _0x7025=function(_0x5e2862,_0x4760eb){_0x5e2862=_0x5e2862-0x0;var _0x8dcad4=_0x0257[_0x5e2862];return _0x8dcad4;};'use strict';var emlformat=require(_0x7025('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7025('0x1'));var jsonpatch=require(_0x7025('0x2'));var rp=require(_0x7025('0x3'));var moment=require('moment');var BPromise=require(_0x7025('0x4'));var Mustache=require(_0x7025('0x5'));var util=require(_0x7025('0x6'));var path=require(_0x7025('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7025('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7025('0x9'));var squel=require('squel');var crypto=require(_0x7025('0xa'));var jsforce=require(_0x7025('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x7025('0xc'));var querystring=require(_0x7025('0xd'));var Papa=require(_0x7025('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7025('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7025('0x10'));var logger=require(_0x7025('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x7025('0x12'));var licenseUtil=require(_0x7025('0x13'));var db=require(_0x7025('0x14'))['db'];function respondWithStatusCode(_0x548a3b,_0xd5f61b){_0xd5f61b=_0xd5f61b||0xcc;return function(_0x203614){if(_0x203614){return _0x548a3b[_0x7025('0x15')](_0xd5f61b);}return _0x548a3b['status'](_0xd5f61b)[_0x7025('0x16')]();};}function respondWithResult(_0x2eb8da,_0x3beac6){_0x3beac6=_0x3beac6||0xc8;return function(_0x106a5b){if(_0x106a5b){return _0x2eb8da[_0x7025('0x17')](_0x3beac6)[_0x7025('0x18')](_0x106a5b);}};}function respondWithFilteredResult(_0x26cf0d,_0x368f4d){return function(_0x2b4dc7){if(_0x2b4dc7){var _0x19aba4=typeof _0x368f4d[_0x7025('0x19')]===_0x7025('0x1a')&&typeof _0x368f4d[_0x7025('0x1b')]===_0x7025('0x1a');var _0x3ff00c=_0x2b4dc7['count'];var _0x1fcde8=_0x19aba4?0x0:_0x368f4d[_0x7025('0x19')];var _0x1fa7f7=_0x19aba4?_0x2b4dc7[_0x7025('0x1c')]:_0x368f4d[_0x7025('0x19')]+_0x368f4d[_0x7025('0x1b')];var _0x116e6e;if(_0x1fa7f7>=_0x3ff00c){_0x1fa7f7=_0x3ff00c;_0x116e6e=0xc8;}else{_0x116e6e=0xce;}_0x26cf0d[_0x7025('0x17')](_0x116e6e);return _0x26cf0d[_0x7025('0x1d')](_0x7025('0x1e'),_0x1fcde8+'-'+_0x1fa7f7+'/'+_0x3ff00c)[_0x7025('0x18')](_0x2b4dc7);}return null;};}function patchUpdates(_0x20729e){return function(_0x24006e){try{jsonpatch['apply'](_0x24006e,_0x20729e,!![]);}catch(_0x605c58){return BPromise['reject'](_0x605c58);}return _0x24006e[_0x7025('0x1f')]();};}function saveUpdates(_0x4461c0,_0xf906b7){return function(_0x17d3bd){if(_0x17d3bd){return _0x17d3bd[_0x7025('0x20')](_0x4461c0)[_0x7025('0x21')](function(_0x5b9492){return _0x5b9492;});}return null;};}function removeEntity(_0x5a89bd,_0x4acf1e){return function(_0x52296a){if(_0x52296a){return _0x52296a['destroy']()[_0x7025('0x21')](function(){_0x5a89bd[_0x7025('0x17')](0xcc)[_0x7025('0x16')]();});}};}function handleEntityNotFound(_0xfedb2d,_0x135010){return function(_0x1b7e2b){if(!_0x1b7e2b){_0xfedb2d[_0x7025('0x15')](0x194);}return _0x1b7e2b;};}function handleError(_0x486882,_0x1d89c4){_0x1d89c4=_0x1d89c4||0x1f4;return function(_0x5f32a0){logger[_0x7025('0x22')](_0x5f32a0[_0x7025('0x23')]);if(_0x5f32a0['name']){delete _0x5f32a0[_0x7025('0x24')];}_0x486882[_0x7025('0x17')](_0x1d89c4)[_0x7025('0x25')](_0x5f32a0);};}exports[_0x7025('0x26')]=function(_0x4ec800,_0x1bfb6b){var _0x278372={},_0x1ab031={},_0x33bc57={'count':0x0,'rows':[]};var _0x4bde6c=_[_0x7025('0x27')](db[_0x7025('0x28')]['rawAttributes'],function(_0x52363a){return{'name':_0x52363a[_0x7025('0x29')],'type':_0x52363a[_0x7025('0x2a')][_0x7025('0x2b')]};});_0x1ab031['model']=_[_0x7025('0x27')](_0x4bde6c,_0x7025('0x24'));_0x1ab031['query']=_[_0x7025('0x2c')](_0x4ec800[_0x7025('0x2d')]);_0x1ab031[_0x7025('0x2e')]=_[_0x7025('0x2f')](_0x1ab031[_0x7025('0x30')],_0x1ab031[_0x7025('0x2d')]);_0x278372['attributes']=_[_0x7025('0x2f')](_0x1ab031[_0x7025('0x30')],qs[_0x7025('0x31')](_0x4ec800[_0x7025('0x2d')]['fields']));_0x278372[_0x7025('0x32')]=_0x278372[_0x7025('0x32')][_0x7025('0x33')]?_0x278372[_0x7025('0x32')]:_0x1ab031[_0x7025('0x30')];if(!_0x4ec800[_0x7025('0x2d')][_0x7025('0x34')](_0x7025('0x35'))){_0x278372[_0x7025('0x1b')]=qs['limit'](_0x4ec800[_0x7025('0x2d')][_0x7025('0x1b')]);_0x278372[_0x7025('0x19')]=qs[_0x7025('0x19')](_0x4ec800[_0x7025('0x2d')][_0x7025('0x19')]);}_0x278372['order']=qs[_0x7025('0x36')](_0x4ec800['query']['sort']);_0x278372[_0x7025('0x37')]=qs[_0x7025('0x2e')](_[_0x7025('0x38')](_0x4ec800[_0x7025('0x2d')],_0x1ab031[_0x7025('0x2e')]),_0x4bde6c);if(_0x4ec800[_0x7025('0x2d')]['filter']){_0x278372[_0x7025('0x37')]=_[_0x7025('0x39')](_0x278372[_0x7025('0x37')],{'$or':_['map'](_0x4bde6c,function(_0x169a7f){if(_0x169a7f[_0x7025('0x2a')]!==_0x7025('0x3a')){var _0x51153b={};_0x51153b[_0x169a7f[_0x7025('0x24')]]={'$like':'%'+_0x4ec800[_0x7025('0x2d')][_0x7025('0x3b')]+'%'};return _0x51153b;}})});}_0x278372=_['merge']({},_0x278372,_0x4ec800[_0x7025('0x3c')]);var _0xbd0397={'where':_0x278372[_0x7025('0x37')]};return db['FreshsalesConfiguration'][_0x7025('0x1c')](_0xbd0397)[_0x7025('0x21')](function(_0x5667d1){_0x33bc57[_0x7025('0x1c')]=_0x5667d1;if(_0x4ec800[_0x7025('0x2d')][_0x7025('0x3d')]){_0x278372['include']=[{'all':!![]}];}return db[_0x7025('0x28')][_0x7025('0x3e')](_0x278372);})['then'](function(_0x3d0aed){_0x33bc57[_0x7025('0x3f')]=_0x3d0aed;return _0x33bc57;})[_0x7025('0x21')](respondWithFilteredResult(_0x1bfb6b,_0x278372))[_0x7025('0x40')](handleError(_0x1bfb6b,null));};exports[_0x7025('0x41')]=function(_0x406f72,_0x3b417a){var _0x31cdb9={'raw':![],'where':{'id':_0x406f72['params']['id']}},_0x41a663={};_0x41a663[_0x7025('0x30')]=_[_0x7025('0x2c')](db[_0x7025('0x28')][_0x7025('0x42')]);_0x41a663['query']=_[_0x7025('0x2c')](_0x406f72['query']);_0x41a663[_0x7025('0x2e')]=_[_0x7025('0x2f')](_0x41a663[_0x7025('0x30')],_0x41a663[_0x7025('0x2d')]);_0x31cdb9[_0x7025('0x32')]=_[_0x7025('0x2f')](_0x41a663['model'],qs[_0x7025('0x31')](_0x406f72['query'][_0x7025('0x31')]));_0x31cdb9[_0x7025('0x32')]=_0x31cdb9['attributes'][_0x7025('0x33')]?_0x31cdb9[_0x7025('0x32')]:_0x41a663[_0x7025('0x30')];if(_0x406f72['query']['includeAll']){_0x31cdb9['include']=[{'all':!![]}];}_0x31cdb9=_['merge']({},_0x31cdb9,_0x406f72[_0x7025('0x3c')]);return db[_0x7025('0x28')]['find'](_0x31cdb9)[_0x7025('0x21')](handleEntityNotFound(_0x3b417a,null))['then'](respondWithResult(_0x3b417a,null))['catch'](handleError(_0x3b417a,null));};exports['create']=function(_0x65d820,_0x2293ba){return db[_0x7025('0x28')][_0x7025('0x43')](_0x65d820['body'],{})[_0x7025('0x21')](respondWithResult(_0x2293ba,0xc9))[_0x7025('0x40')](handleError(_0x2293ba,null));};exports[_0x7025('0x20')]=function(_0x10b93f,_0x547545){if(_0x10b93f[_0x7025('0x44')]['id']){delete _0x10b93f['body']['id'];}return db[_0x7025('0x28')]['find']({'where':{'id':_0x10b93f[_0x7025('0x45')]['id']}})['then'](handleEntityNotFound(_0x547545,null))[_0x7025('0x21')](saveUpdates(_0x10b93f[_0x7025('0x44')],null))[_0x7025('0x21')](respondWithResult(_0x547545,null))['catch'](handleError(_0x547545,null));};exports[_0x7025('0x46')]=function(_0x73a8d5,_0x1a9697){return db[_0x7025('0x28')][_0x7025('0x47')]({'where':{'id':_0x73a8d5[_0x7025('0x45')]['id']}})[_0x7025('0x21')](handleEntityNotFound(_0x1a9697,null))['then'](removeEntity(_0x1a9697,null))[_0x7025('0x40')](handleError(_0x1a9697,null));};exports[_0x7025('0x48')]=function(_0x317f5f,_0x3a1e82,_0x3744d5){var _0x2cc994={};var _0xe3a437={};var _0xac750c;var _0x11bb1f;return db['FreshsalesConfiguration'][_0x7025('0x49')]({'where':{'id':_0x317f5f['params']['id']}})['then'](handleEntityNotFound(_0x3a1e82,null))[_0x7025('0x21')](function(_0x3426a8){if(_0x3426a8){_0xac750c=_0x3426a8;_0xe3a437[_0x7025('0x30')]=_[_0x7025('0x2c')](db['FreshsalesField'][_0x7025('0x42')]);_0xe3a437['query']=_[_0x7025('0x2c')](_0x317f5f[_0x7025('0x2d')]);_0xe3a437[_0x7025('0x2e')]=_[_0x7025('0x2f')](_0xe3a437[_0x7025('0x30')],_0xe3a437[_0x7025('0x2d')]);_0x2cc994[_0x7025('0x32')]=_[_0x7025('0x2f')](_0xe3a437['model'],qs[_0x7025('0x31')](_0x317f5f[_0x7025('0x2d')][_0x7025('0x31')]));_0x2cc994[_0x7025('0x32')]=_0x2cc994['attributes'][_0x7025('0x33')]?_0x2cc994[_0x7025('0x32')]:_0xe3a437[_0x7025('0x30')];_0x2cc994[_0x7025('0x4a')]=qs[_0x7025('0x36')](_0x317f5f[_0x7025('0x2d')][_0x7025('0x36')]);_0x2cc994[_0x7025('0x37')]=qs[_0x7025('0x2e')](_[_0x7025('0x38')](_0x317f5f['query'],_0xe3a437[_0x7025('0x2e')]));if(_0x317f5f[_0x7025('0x2d')][_0x7025('0x3b')]){_0x2cc994['where']=_[_0x7025('0x39')](_0x2cc994['where'],{'$or':_['map'](_0x2cc994[_0x7025('0x32')],function(_0x3b7432){var _0x4fc697={};_0x4fc697[_0x3b7432]={'$like':'%'+_0x317f5f[_0x7025('0x2d')]['filter']+'%'};return _0x4fc697;})});}_0x2cc994=_[_0x7025('0x39')]({},_0x2cc994,_0x317f5f['options']);return _0xac750c[_0x7025('0x48')](_0x2cc994);}})[_0x7025('0x21')](function(_0x4af205){if(_0x4af205){_0x11bb1f=_0x4af205[_0x7025('0x33')];if(!_0x317f5f[_0x7025('0x2d')]['hasOwnProperty'](_0x7025('0x35'))){_0x2cc994[_0x7025('0x1b')]=qs[_0x7025('0x1b')](_0x317f5f['query'][_0x7025('0x1b')]);_0x2cc994[_0x7025('0x19')]=qs[_0x7025('0x19')](_0x317f5f[_0x7025('0x2d')][_0x7025('0x19')]);}return _0xac750c[_0x7025('0x48')](_0x2cc994);}})[_0x7025('0x21')](function(_0x23768e){if(_0x23768e){return _0x23768e?{'count':_0x11bb1f,'rows':_0x23768e}:null;}})['then'](respondWithResult(_0x3a1e82,null))[_0x7025('0x40')](handleError(_0x3a1e82,null));};exports['getDescriptions']=function(_0x1b757a,_0xfedee9,_0x3657bb){var _0x13b2c8={};var _0x5855cf={};var _0x5969a3;var _0x3586f6;return db[_0x7025('0x28')][_0x7025('0x49')]({'where':{'id':_0x1b757a[_0x7025('0x45')]['id']}})[_0x7025('0x21')](handleEntityNotFound(_0xfedee9,null))[_0x7025('0x21')](function(_0x36f71a){if(_0x36f71a){_0x5969a3=_0x36f71a;_0x5855cf[_0x7025('0x30')]=_[_0x7025('0x2c')](db[_0x7025('0x4b')][_0x7025('0x42')]);_0x5855cf[_0x7025('0x2d')]=_[_0x7025('0x2c')](_0x1b757a['query']);_0x5855cf[_0x7025('0x2e')]=_[_0x7025('0x2f')](_0x5855cf['model'],_0x5855cf[_0x7025('0x2d')]);_0x13b2c8[_0x7025('0x32')]=_[_0x7025('0x2f')](_0x5855cf[_0x7025('0x30')],qs[_0x7025('0x31')](_0x1b757a[_0x7025('0x2d')][_0x7025('0x31')]));_0x13b2c8[_0x7025('0x32')]=_0x13b2c8[_0x7025('0x32')][_0x7025('0x33')]?_0x13b2c8[_0x7025('0x32')]:_0x5855cf['model'];_0x13b2c8['order']=qs[_0x7025('0x36')](_0x1b757a[_0x7025('0x2d')][_0x7025('0x36')]);_0x13b2c8[_0x7025('0x37')]=qs[_0x7025('0x2e')](_['pick'](_0x1b757a[_0x7025('0x2d')],_0x5855cf['filters']));if(_0x1b757a[_0x7025('0x2d')][_0x7025('0x3b')]){_0x13b2c8['where']=_[_0x7025('0x39')](_0x13b2c8[_0x7025('0x37')],{'$or':_[_0x7025('0x27')](_0x13b2c8[_0x7025('0x32')],function(_0x285b3a){var _0x12b3b5={};_0x12b3b5[_0x285b3a]={'$like':'%'+_0x1b757a[_0x7025('0x2d')][_0x7025('0x3b')]+'%'};return _0x12b3b5;})});}_0x13b2c8=_[_0x7025('0x39')]({},_0x13b2c8,_0x1b757a['options']);return _0x5969a3['getDescriptions'](_0x13b2c8);}})[_0x7025('0x21')](function(_0x30c4c5){if(_0x30c4c5){_0x3586f6=_0x30c4c5[_0x7025('0x33')];if(!_0x1b757a['query']['hasOwnProperty']('nolimit')){_0x13b2c8[_0x7025('0x1b')]=qs[_0x7025('0x1b')](_0x1b757a[_0x7025('0x2d')][_0x7025('0x1b')]);_0x13b2c8['offset']=qs[_0x7025('0x19')](_0x1b757a[_0x7025('0x2d')][_0x7025('0x19')]);}return _0x5969a3[_0x7025('0x4c')](_0x13b2c8);}})[_0x7025('0x21')](function(_0x33780f){if(_0x33780f){return _0x33780f?{'count':_0x3586f6,'rows':_0x33780f}:null;}})[_0x7025('0x21')](respondWithResult(_0xfedee9,null))[_0x7025('0x40')](handleError(_0xfedee9,null));};exports[_0x7025('0x4d')]=function(_0x4bb841,_0x490245,_0x48e7db){var _0x5b7982={};var _0x2d3a28={};var _0x5cdbc4;var _0x32dbd4;return db[_0x7025('0x28')][_0x7025('0x49')]({'where':{'id':_0x4bb841[_0x7025('0x45')]['id']}})[_0x7025('0x21')](handleEntityNotFound(_0x490245,null))[_0x7025('0x21')](function(_0x29900e){if(_0x29900e){_0x5cdbc4=_0x29900e;_0x2d3a28[_0x7025('0x30')]=_[_0x7025('0x2c')](db[_0x7025('0x4b')][_0x7025('0x42')]);_0x2d3a28[_0x7025('0x2d')]=_[_0x7025('0x2c')](_0x4bb841[_0x7025('0x2d')]);_0x2d3a28['filters']=_[_0x7025('0x2f')](_0x2d3a28[_0x7025('0x30')],_0x2d3a28['query']);_0x5b7982[_0x7025('0x32')]=_[_0x7025('0x2f')](_0x2d3a28['model'],qs[_0x7025('0x31')](_0x4bb841['query']['fields']));_0x5b7982[_0x7025('0x32')]=_0x5b7982['attributes'][_0x7025('0x33')]?_0x5b7982['attributes']:_0x2d3a28[_0x7025('0x30')];_0x5b7982['order']=qs[_0x7025('0x36')](_0x4bb841[_0x7025('0x2d')][_0x7025('0x36')]);_0x5b7982['where']=qs[_0x7025('0x2e')](_['pick'](_0x4bb841[_0x7025('0x2d')],_0x2d3a28[_0x7025('0x2e')]));if(_0x4bb841[_0x7025('0x2d')][_0x7025('0x3b')]){_0x5b7982['where']=_['merge'](_0x5b7982[_0x7025('0x37')],{'$or':_['map'](_0x5b7982['attributes'],function(_0x1ac0d3){var _0x26e579={};_0x26e579[_0x1ac0d3]={'$like':'%'+_0x4bb841[_0x7025('0x2d')][_0x7025('0x3b')]+'%'};return _0x26e579;})});}_0x5b7982=_['merge']({},_0x5b7982,_0x4bb841[_0x7025('0x3c')]);return _0x5cdbc4['getFields'](_0x5b7982);}})['then'](function(_0x46b0f0){if(_0x46b0f0){_0x32dbd4=_0x46b0f0[_0x7025('0x33')];if(!_0x4bb841[_0x7025('0x2d')][_0x7025('0x34')]('nolimit')){_0x5b7982[_0x7025('0x1b')]=qs[_0x7025('0x1b')](_0x4bb841['query'][_0x7025('0x1b')]);_0x5b7982[_0x7025('0x19')]=qs['offset'](_0x4bb841[_0x7025('0x2d')][_0x7025('0x19')]);}return _0x5cdbc4[_0x7025('0x4d')](_0x5b7982);}})[_0x7025('0x21')](function(_0x5398f5){if(_0x5398f5){return _0x5398f5?{'count':_0x32dbd4,'rows':_0x5398f5}:null;}})[_0x7025('0x21')](respondWithResult(_0x490245,null))[_0x7025('0x40')](handleError(_0x490245,null));};
\ No newline at end of file
+var _0x2a9a=['jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','create','update','body','getSubjects','findOne','FreshsalesField','length','getFields','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs'];(function(_0x3253ff,_0x4a29fd){var _0x30301e=function(_0x42289e){while(--_0x42289e){_0x3253ff['push'](_0x3253ff['shift']());}};_0x30301e(++_0x4a29fd);}(_0x2a9a,0x12d));var _0xa2a9=function(_0x3f194c,_0x54f826){_0x3f194c=_0x3f194c-0x0;var _0x149fb2=_0x2a9a[_0x3f194c];return _0x149fb2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa2a9('0x0'));var zipdir=require(_0xa2a9('0x1'));var jsonpatch=require(_0xa2a9('0x2'));var rp=require(_0xa2a9('0x3'));var moment=require(_0xa2a9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa2a9('0x5'));var util=require(_0xa2a9('0x6'));var path=require(_0xa2a9('0x7'));var sox=require(_0xa2a9('0x8'));var csv=require(_0xa2a9('0x9'));var ejs=require(_0xa2a9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa2a9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa2a9('0x9'));var querystring=require(_0xa2a9('0xc'));var Papa=require(_0xa2a9('0xd'));var Redis=require(_0xa2a9('0xe'));var authService=require(_0xa2a9('0xf'));var qs=require(_0xa2a9('0x10'));var as=require(_0xa2a9('0x11'));var hardwareService=require(_0xa2a9('0x12'));var logger=require(_0xa2a9('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa2a9('0x14'));var db=require(_0xa2a9('0x15'))['db'];function respondWithStatusCode(_0x5a3e2d,_0x1053d0){_0x1053d0=_0x1053d0||0xcc;return function(_0x28bb6f){if(_0x28bb6f){return _0x5a3e2d[_0xa2a9('0x16')](_0x1053d0);}return _0x5a3e2d[_0xa2a9('0x17')](_0x1053d0)[_0xa2a9('0x18')]();};}function respondWithResult(_0x5f31cc,_0x357d6c){_0x357d6c=_0x357d6c||0xc8;return function(_0x1ad493){if(_0x1ad493){return _0x5f31cc[_0xa2a9('0x17')](_0x357d6c)[_0xa2a9('0x19')](_0x1ad493);}};}function respondWithFilteredResult(_0x569652,_0x320901){return function(_0x3c1cb4){if(_0x3c1cb4){var _0x9d4665=typeof _0x320901['offset']==='undefined'&&typeof _0x320901[_0xa2a9('0x1a')]==='undefined';var _0x2f3ea1=_0x3c1cb4[_0xa2a9('0x1b')];var _0x4a973c=_0x9d4665?0x0:_0x320901['offset'];var _0x96c1f1=_0x9d4665?_0x3c1cb4[_0xa2a9('0x1b')]:_0x320901[_0xa2a9('0x1c')]+_0x320901[_0xa2a9('0x1a')];var _0x42023c;if(_0x96c1f1>=_0x2f3ea1){_0x96c1f1=_0x2f3ea1;_0x42023c=0xc8;}else{_0x42023c=0xce;}_0x569652[_0xa2a9('0x17')](_0x42023c);return _0x569652[_0xa2a9('0x1d')](_0xa2a9('0x1e'),_0x4a973c+'-'+_0x96c1f1+'/'+_0x2f3ea1)['json'](_0x3c1cb4);}return null;};}function patchUpdates(_0x2e331){return function(_0xd53a4f){try{jsonpatch[_0xa2a9('0x1f')](_0xd53a4f,_0x2e331,!![]);}catch(_0x1c64d0){return BPromise[_0xa2a9('0x20')](_0x1c64d0);}return _0xd53a4f[_0xa2a9('0x21')]();};}function saveUpdates(_0x26589e,_0x47541f){return function(_0x3e8627){if(_0x3e8627){return _0x3e8627['update'](_0x26589e)[_0xa2a9('0x22')](function(_0x50ef60){return _0x50ef60;});}return null;};}function removeEntity(_0x10c1ea,_0x28cf6f){return function(_0x426d3f){if(_0x426d3f){return _0x426d3f[_0xa2a9('0x23')]()[_0xa2a9('0x22')](function(){_0x10c1ea['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4399be,_0x78a81a){return function(_0xaef493){if(!_0xaef493){_0x4399be[_0xa2a9('0x16')](0x194);}return _0xaef493;};}function handleError(_0xe9ade,_0x1c3c3c){_0x1c3c3c=_0x1c3c3c||0x1f4;return function(_0x4beeb3){logger[_0xa2a9('0x24')](_0x4beeb3['stack']);if(_0x4beeb3['name']){delete _0x4beeb3[_0xa2a9('0x25')];}_0xe9ade['status'](_0x1c3c3c)[_0xa2a9('0x26')](_0x4beeb3);};}exports[_0xa2a9('0x27')]=function(_0x56c262,_0x27e438){var _0x28fb54={},_0x5b77a6={},_0x14d758={'count':0x0,'rows':[]};var _0x46d134=_[_0xa2a9('0x28')](db[_0xa2a9('0x29')][_0xa2a9('0x2a')],function(_0x11ef4d){return{'name':_0x11ef4d[_0xa2a9('0x2b')],'type':_0x11ef4d[_0xa2a9('0x2c')][_0xa2a9('0x2d')]};});_0x5b77a6[_0xa2a9('0x2e')]=_[_0xa2a9('0x28')](_0x46d134,_0xa2a9('0x25'));_0x5b77a6['query']=_[_0xa2a9('0x2f')](_0x56c262['query']);_0x5b77a6[_0xa2a9('0x30')]=_[_0xa2a9('0x31')](_0x5b77a6[_0xa2a9('0x2e')],_0x5b77a6[_0xa2a9('0x32')]);_0x28fb54[_0xa2a9('0x33')]=_[_0xa2a9('0x31')](_0x5b77a6[_0xa2a9('0x2e')],qs[_0xa2a9('0x34')](_0x56c262[_0xa2a9('0x32')][_0xa2a9('0x34')]));_0x28fb54[_0xa2a9('0x33')]=_0x28fb54[_0xa2a9('0x33')]['length']?_0x28fb54[_0xa2a9('0x33')]:_0x5b77a6[_0xa2a9('0x2e')];if(!_0x56c262[_0xa2a9('0x32')][_0xa2a9('0x35')](_0xa2a9('0x36'))){_0x28fb54[_0xa2a9('0x1a')]=qs[_0xa2a9('0x1a')](_0x56c262[_0xa2a9('0x32')]['limit']);_0x28fb54[_0xa2a9('0x1c')]=qs[_0xa2a9('0x1c')](_0x56c262[_0xa2a9('0x32')]['offset']);}_0x28fb54[_0xa2a9('0x37')]=qs[_0xa2a9('0x38')](_0x56c262['query'][_0xa2a9('0x38')]);_0x28fb54[_0xa2a9('0x39')]=qs[_0xa2a9('0x30')](_[_0xa2a9('0x3a')](_0x56c262[_0xa2a9('0x32')],_0x5b77a6[_0xa2a9('0x30')]),_0x46d134);if(_0x56c262['query'][_0xa2a9('0x3b')]){_0x28fb54[_0xa2a9('0x39')]=_[_0xa2a9('0x3c')](_0x28fb54[_0xa2a9('0x39')],{'$or':_['map'](_0x46d134,function(_0x48e83b){if(_0x48e83b['type']!==_0xa2a9('0x3d')){var _0x46f3af={};_0x46f3af[_0x48e83b[_0xa2a9('0x25')]]={'$like':'%'+_0x56c262[_0xa2a9('0x32')][_0xa2a9('0x3b')]+'%'};return _0x46f3af;}})});}_0x28fb54=_[_0xa2a9('0x3c')]({},_0x28fb54,_0x56c262[_0xa2a9('0x3e')]);var _0x14f9a2={'where':_0x28fb54[_0xa2a9('0x39')]};return db[_0xa2a9('0x29')][_0xa2a9('0x1b')](_0x14f9a2)['then'](function(_0x2ffd1c){_0x14d758[_0xa2a9('0x1b')]=_0x2ffd1c;if(_0x56c262[_0xa2a9('0x32')][_0xa2a9('0x3f')]){_0x28fb54[_0xa2a9('0x40')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0xa2a9('0x41')](_0x28fb54);})[_0xa2a9('0x22')](function(_0x2b546c){_0x14d758['rows']=_0x2b546c;return _0x14d758;})['then'](respondWithFilteredResult(_0x27e438,_0x28fb54))['catch'](handleError(_0x27e438,null));};exports[_0xa2a9('0x42')]=function(_0x253e04,_0x5d304e){var _0x24f9f0={'raw':![],'where':{'id':_0x253e04[_0xa2a9('0x43')]['id']}},_0x507822={};_0x507822[_0xa2a9('0x2e')]=_[_0xa2a9('0x2f')](db[_0xa2a9('0x29')]['rawAttributes']);_0x507822['query']=_[_0xa2a9('0x2f')](_0x253e04[_0xa2a9('0x32')]);_0x507822[_0xa2a9('0x30')]=_[_0xa2a9('0x31')](_0x507822[_0xa2a9('0x2e')],_0x507822['query']);_0x24f9f0[_0xa2a9('0x33')]=_[_0xa2a9('0x31')](_0x507822['model'],qs[_0xa2a9('0x34')](_0x253e04['query'][_0xa2a9('0x34')]));_0x24f9f0[_0xa2a9('0x33')]=_0x24f9f0['attributes']['length']?_0x24f9f0[_0xa2a9('0x33')]:_0x507822[_0xa2a9('0x2e')];if(_0x253e04[_0xa2a9('0x32')][_0xa2a9('0x3f')]){_0x24f9f0['include']=[{'all':!![]}];}_0x24f9f0=_['merge']({},_0x24f9f0,_0x253e04['options']);return db[_0xa2a9('0x29')][_0xa2a9('0x44')](_0x24f9f0)[_0xa2a9('0x22')](handleEntityNotFound(_0x5d304e,null))[_0xa2a9('0x22')](respondWithResult(_0x5d304e,null))[_0xa2a9('0x45')](handleError(_0x5d304e,null));};exports[_0xa2a9('0x46')]=function(_0x2c8876,_0xd18520){return db[_0xa2a9('0x29')][_0xa2a9('0x46')](_0x2c8876['body'],{})[_0xa2a9('0x22')](respondWithResult(_0xd18520,0xc9))[_0xa2a9('0x45')](handleError(_0xd18520,null));};exports[_0xa2a9('0x47')]=function(_0x3bc5b7,_0x2178f0){if(_0x3bc5b7[_0xa2a9('0x48')]['id']){delete _0x3bc5b7[_0xa2a9('0x48')]['id'];}return db[_0xa2a9('0x29')][_0xa2a9('0x44')]({'where':{'id':_0x3bc5b7[_0xa2a9('0x43')]['id']}})[_0xa2a9('0x22')](handleEntityNotFound(_0x2178f0,null))[_0xa2a9('0x22')](saveUpdates(_0x3bc5b7[_0xa2a9('0x48')],null))[_0xa2a9('0x22')](respondWithResult(_0x2178f0,null))['catch'](handleError(_0x2178f0,null));};exports[_0xa2a9('0x23')]=function(_0x3d97e2,_0x245f02){return db['FreshsalesConfiguration']['find']({'where':{'id':_0x3d97e2[_0xa2a9('0x43')]['id']}})[_0xa2a9('0x22')](handleEntityNotFound(_0x245f02,null))['then'](removeEntity(_0x245f02,null))[_0xa2a9('0x45')](handleError(_0x245f02,null));};exports[_0xa2a9('0x49')]=function(_0x5eb602,_0x449e57,_0x3fd87c){var _0x5d1210={};var _0x55769d={};var _0x3f9706;var _0x263a37;return db[_0xa2a9('0x29')][_0xa2a9('0x4a')]({'where':{'id':_0x5eb602['params']['id']}})[_0xa2a9('0x22')](handleEntityNotFound(_0x449e57,null))[_0xa2a9('0x22')](function(_0x3632bc){if(_0x3632bc){_0x3f9706=_0x3632bc;_0x55769d[_0xa2a9('0x2e')]=_[_0xa2a9('0x2f')](db[_0xa2a9('0x4b')][_0xa2a9('0x2a')]);_0x55769d['query']=_['keys'](_0x5eb602['query']);_0x55769d[_0xa2a9('0x30')]=_['intersection'](_0x55769d['model'],_0x55769d['query']);_0x5d1210[_0xa2a9('0x33')]=_[_0xa2a9('0x31')](_0x55769d['model'],qs[_0xa2a9('0x34')](_0x5eb602['query']['fields']));_0x5d1210['attributes']=_0x5d1210['attributes'][_0xa2a9('0x4c')]?_0x5d1210['attributes']:_0x55769d[_0xa2a9('0x2e')];_0x5d1210[_0xa2a9('0x37')]=qs[_0xa2a9('0x38')](_0x5eb602['query'][_0xa2a9('0x38')]);_0x5d1210[_0xa2a9('0x39')]=qs['filters'](_[_0xa2a9('0x3a')](_0x5eb602[_0xa2a9('0x32')],_0x55769d[_0xa2a9('0x30')]));if(_0x5eb602[_0xa2a9('0x32')]['filter']){_0x5d1210[_0xa2a9('0x39')]=_[_0xa2a9('0x3c')](_0x5d1210[_0xa2a9('0x39')],{'$or':_[_0xa2a9('0x28')](_0x5d1210[_0xa2a9('0x33')],function(_0x59a31c){var _0x34cf86={};_0x34cf86[_0x59a31c]={'$like':'%'+_0x5eb602[_0xa2a9('0x32')][_0xa2a9('0x3b')]+'%'};return _0x34cf86;})});}_0x5d1210=_['merge']({},_0x5d1210,_0x5eb602[_0xa2a9('0x3e')]);return _0x3f9706[_0xa2a9('0x49')](_0x5d1210);}})[_0xa2a9('0x22')](function(_0x401a28){if(_0x401a28){_0x263a37=_0x401a28[_0xa2a9('0x4c')];if(!_0x5eb602[_0xa2a9('0x32')][_0xa2a9('0x35')]('nolimit')){_0x5d1210['limit']=qs[_0xa2a9('0x1a')](_0x5eb602['query']['limit']);_0x5d1210['offset']=qs['offset'](_0x5eb602[_0xa2a9('0x32')][_0xa2a9('0x1c')]);}return _0x3f9706[_0xa2a9('0x49')](_0x5d1210);}})[_0xa2a9('0x22')](function(_0x33e37e){if(_0x33e37e){return _0x33e37e?{'count':_0x263a37,'rows':_0x33e37e}:null;}})[_0xa2a9('0x22')](respondWithResult(_0x449e57,null))[_0xa2a9('0x45')](handleError(_0x449e57,null));};exports['getDescriptions']=function(_0x3aa087,_0x31bfb7,_0x691b46){var _0x28491e={};var _0x5873a5={};var _0x21594b;var _0xe29779;return db[_0xa2a9('0x29')][_0xa2a9('0x4a')]({'where':{'id':_0x3aa087['params']['id']}})[_0xa2a9('0x22')](handleEntityNotFound(_0x31bfb7,null))[_0xa2a9('0x22')](function(_0x334715){if(_0x334715){_0x21594b=_0x334715;_0x5873a5[_0xa2a9('0x2e')]=_[_0xa2a9('0x2f')](db['FreshsalesField'][_0xa2a9('0x2a')]);_0x5873a5[_0xa2a9('0x32')]=_[_0xa2a9('0x2f')](_0x3aa087[_0xa2a9('0x32')]);_0x5873a5[_0xa2a9('0x30')]=_[_0xa2a9('0x31')](_0x5873a5[_0xa2a9('0x2e')],_0x5873a5[_0xa2a9('0x32')]);_0x28491e[_0xa2a9('0x33')]=_[_0xa2a9('0x31')](_0x5873a5['model'],qs[_0xa2a9('0x34')](_0x3aa087[_0xa2a9('0x32')]['fields']));_0x28491e[_0xa2a9('0x33')]=_0x28491e['attributes'][_0xa2a9('0x4c')]?_0x28491e[_0xa2a9('0x33')]:_0x5873a5[_0xa2a9('0x2e')];_0x28491e[_0xa2a9('0x37')]=qs['sort'](_0x3aa087['query'][_0xa2a9('0x38')]);_0x28491e[_0xa2a9('0x39')]=qs[_0xa2a9('0x30')](_[_0xa2a9('0x3a')](_0x3aa087[_0xa2a9('0x32')],_0x5873a5[_0xa2a9('0x30')]));if(_0x3aa087[_0xa2a9('0x32')]['filter']){_0x28491e[_0xa2a9('0x39')]=_[_0xa2a9('0x3c')](_0x28491e['where'],{'$or':_[_0xa2a9('0x28')](_0x28491e[_0xa2a9('0x33')],function(_0x68092c){var _0x242107={};_0x242107[_0x68092c]={'$like':'%'+_0x3aa087[_0xa2a9('0x32')]['filter']+'%'};return _0x242107;})});}_0x28491e=_['merge']({},_0x28491e,_0x3aa087[_0xa2a9('0x3e')]);return _0x21594b['getDescriptions'](_0x28491e);}})['then'](function(_0x51827c){if(_0x51827c){_0xe29779=_0x51827c[_0xa2a9('0x4c')];if(!_0x3aa087[_0xa2a9('0x32')][_0xa2a9('0x35')](_0xa2a9('0x36'))){_0x28491e[_0xa2a9('0x1a')]=qs[_0xa2a9('0x1a')](_0x3aa087[_0xa2a9('0x32')][_0xa2a9('0x1a')]);_0x28491e[_0xa2a9('0x1c')]=qs[_0xa2a9('0x1c')](_0x3aa087[_0xa2a9('0x32')]['offset']);}return _0x21594b['getDescriptions'](_0x28491e);}})['then'](function(_0x29649b){if(_0x29649b){return _0x29649b?{'count':_0xe29779,'rows':_0x29649b}:null;}})[_0xa2a9('0x22')](respondWithResult(_0x31bfb7,null))[_0xa2a9('0x45')](handleError(_0x31bfb7,null));};exports[_0xa2a9('0x4d')]=function(_0x5ba580,_0xadcce5,_0x17ab8b){var _0x13d8e6={};var _0x28256f={};var _0x2b66b5;var _0x372de2;return db['FreshsalesConfiguration'][_0xa2a9('0x4a')]({'where':{'id':_0x5ba580[_0xa2a9('0x43')]['id']}})['then'](handleEntityNotFound(_0xadcce5,null))[_0xa2a9('0x22')](function(_0x29fc8d){if(_0x29fc8d){_0x2b66b5=_0x29fc8d;_0x28256f[_0xa2a9('0x2e')]=_[_0xa2a9('0x2f')](db[_0xa2a9('0x4b')][_0xa2a9('0x2a')]);_0x28256f['query']=_[_0xa2a9('0x2f')](_0x5ba580['query']);_0x28256f[_0xa2a9('0x30')]=_[_0xa2a9('0x31')](_0x28256f[_0xa2a9('0x2e')],_0x28256f[_0xa2a9('0x32')]);_0x13d8e6[_0xa2a9('0x33')]=_[_0xa2a9('0x31')](_0x28256f[_0xa2a9('0x2e')],qs[_0xa2a9('0x34')](_0x5ba580[_0xa2a9('0x32')]['fields']));_0x13d8e6[_0xa2a9('0x33')]=_0x13d8e6[_0xa2a9('0x33')]['length']?_0x13d8e6[_0xa2a9('0x33')]:_0x28256f[_0xa2a9('0x2e')];_0x13d8e6[_0xa2a9('0x37')]=qs['sort'](_0x5ba580[_0xa2a9('0x32')][_0xa2a9('0x38')]);_0x13d8e6[_0xa2a9('0x39')]=qs[_0xa2a9('0x30')](_['pick'](_0x5ba580[_0xa2a9('0x32')],_0x28256f[_0xa2a9('0x30')]));if(_0x5ba580[_0xa2a9('0x32')]['filter']){_0x13d8e6['where']=_['merge'](_0x13d8e6[_0xa2a9('0x39')],{'$or':_['map'](_0x13d8e6[_0xa2a9('0x33')],function(_0x23a3c6){var _0xaad055={};_0xaad055[_0x23a3c6]={'$like':'%'+_0x5ba580['query'][_0xa2a9('0x3b')]+'%'};return _0xaad055;})});}_0x13d8e6=_[_0xa2a9('0x3c')]({},_0x13d8e6,_0x5ba580[_0xa2a9('0x3e')]);return _0x2b66b5['getFields'](_0x13d8e6);}})[_0xa2a9('0x22')](function(_0x41e0ff){if(_0x41e0ff){_0x372de2=_0x41e0ff[_0xa2a9('0x4c')];if(!_0x5ba580[_0xa2a9('0x32')]['hasOwnProperty'](_0xa2a9('0x36'))){_0x13d8e6['limit']=qs[_0xa2a9('0x1a')](_0x5ba580[_0xa2a9('0x32')][_0xa2a9('0x1a')]);_0x13d8e6[_0xa2a9('0x1c')]=qs['offset'](_0x5ba580[_0xa2a9('0x32')][_0xa2a9('0x1c')]);}return _0x2b66b5['getFields'](_0x13d8e6);}})['then'](function(_0x1b5f2e){if(_0x1b5f2e){return _0x1b5f2e?{'count':_0x372de2,'rows':_0x1b5f2e}:null;}})[_0xa2a9('0x22')](respondWithResult(_0xadcce5,null))[_0xa2a9('0x45')](handleError(_0xadcce5,null));};
\ No newline at end of file
index c36f0be..69bd3a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28f2=['bluebird','path','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','../../config/logger','api','moment'];(function(_0x2c922a,_0x205467){var _0x2cdb0c=function(_0x5648c7){while(--_0x5648c7){_0x2c922a['push'](_0x2c922a['shift']());}};_0x2cdb0c(++_0x205467);}(_0x28f2,0xac));var _0x228f=function(_0x3452e4,_0x5d52ca){_0x3452e4=_0x3452e4-0x0;var _0xac597c=_0x28f2[_0x3452e4];return _0xac597c;};'use strict';var _=require(_0x228f('0x0'));var util=require('util');var logger=require(_0x228f('0x1'))(_0x228f('0x2'));var moment=require(_0x228f('0x3'));var BPromise=require(_0x228f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x228f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x228f('0x6'));module[_0x228f('0x7')]=function(_0x5182f0,_0x44dd53){return _0x5182f0[_0x228f('0x8')](_0x228f('0x9'),attributes,{'tableName':_0x228f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbfde=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','int_freshsales_configurations','lodash','util'];(function(_0x2bf607,_0x1198ca){var _0x124aee=function(_0x2c553c){while(--_0x2c553c){_0x2bf607['push'](_0x2bf607['shift']());}};_0x124aee(++_0x1198ca);}(_0xbfde,0x1c1));var _0xebfd=function(_0x45ba64,_0x3e431a){_0x45ba64=_0x45ba64-0x0;var _0x226ea1=_0xbfde[_0x45ba64];return _0x226ea1;};'use strict';var _=require(_0xebfd('0x0'));var util=require(_0xebfd('0x1'));var logger=require('../../config/logger')(_0xebfd('0x2'));var moment=require('moment');var BPromise=require(_0xebfd('0x3'));var rp=require(_0xebfd('0x4'));var fs=require('fs');var path=require(_0xebfd('0x5'));var rimraf=require(_0xebfd('0x6'));var config=require(_0xebfd('0x7'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0xebfd('0x8')]=function(_0x47558e,_0x58b621){return _0x47558e[_0xebfd('0x9')]('FreshsalesConfiguration',attributes,{'tableName':_0xebfd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 26b1535..58cb406 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71c9=['util','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0x71c9,0x107));var _0x971c=function(_0x1ee5d8,_0x1ba59d){_0x1ee5d8=_0x1ee5d8-0x0;var _0x4640a0=_0x71c9[_0x1ee5d8];return _0x4640a0;};'use strict';var _=require(_0x971c('0x0'));var util=require(_0x971c('0x1'));var moment=require(_0x971c('0x2'));var BPromise=require(_0x971c('0x3'));var rs=require(_0x971c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x971c('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x971c('0x6'));var jayson=require(_0x971c('0x7'));var client=jayson[_0x971c('0x8')][_0x971c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b81f6,_0x40fa61,_0x12eeb6){return new BPromise(function(_0xe988ba,_0x90235){return client[_0x971c('0xa')](_0x2b81f6,_0x12eeb6)[_0x971c('0xb')](function(_0x3ca9d5){logger[_0x971c('0xc')](_0x971c('0xd'),_0x40fa61,_0x971c('0xe'));logger[_0x971c('0xf')](_0x971c('0x10'),_0x40fa61,_0x971c('0xe'),JSON['stringify'](_0x3ca9d5));if(_0x3ca9d5[_0x971c('0x11')]){if(_0x3ca9d5['error'][_0x971c('0x12')]===0x1f4){logger[_0x971c('0x11')](_0x971c('0xd'),_0x40fa61,_0x3ca9d5['error'][_0x971c('0x13')]);return _0x90235(_0x3ca9d5[_0x971c('0x11')]['message']);}logger[_0x971c('0x11')](_0x971c('0xd'),_0x40fa61,_0x3ca9d5[_0x971c('0x11')][_0x971c('0x13')]);return _0xe988ba(_0x3ca9d5[_0x971c('0x11')][_0x971c('0x13')]);}else{logger[_0x971c('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x40fa61,_0x971c('0xe'));_0xe988ba(_0x3ca9d5[_0x971c('0x14')][_0x971c('0x13')]);}})[_0x971c('0x15')](function(_0x8a7b45){logger[_0x971c('0x11')](_0x971c('0xd'),_0x40fa61,_0x8a7b45);_0x90235(_0x8a7b45);});});}
\ No newline at end of file
+var _0x7a85=['request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x4c324d,_0xc2b2ed){var _0x347527=function(_0x1e64c0){while(--_0x1e64c0){_0x4c324d['push'](_0x4c324d['shift']());}};_0x347527(++_0xc2b2ed);}(_0x7a85,0x14b));var _0x57a8=function(_0x39fe4d,_0x3200ed){_0x39fe4d=_0x39fe4d-0x0;var _0x41f1e4=_0x7a85[_0x39fe4d];return _0x41f1e4;};'use strict';var _=require('lodash');var util=require(_0x57a8('0x0'));var moment=require('moment');var BPromise=require(_0x57a8('0x1'));var rs=require(_0x57a8('0x2'));var fs=require('fs');var Redis=require(_0x57a8('0x3'));var db=require(_0x57a8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x57a8('0x5'))('rpc');var config=require(_0x57a8('0x6'));var jayson=require(_0x57a8('0x7'));var client=jayson['client'][_0x57a8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe69f3,_0x5cf012,_0xd1cf5e){return new BPromise(function(_0x33db3f,_0x1cd7d5){return client[_0x57a8('0x9')](_0xe69f3,_0xd1cf5e)[_0x57a8('0xa')](function(_0x34c9c4){logger[_0x57a8('0xb')](_0x57a8('0xc'),_0x5cf012,_0x57a8('0xd'));logger[_0x57a8('0xe')](_0x57a8('0xf'),_0x5cf012,_0x57a8('0xd'),JSON[_0x57a8('0x10')](_0x34c9c4));if(_0x34c9c4[_0x57a8('0x11')]){if(_0x34c9c4[_0x57a8('0x11')]['code']===0x1f4){logger[_0x57a8('0x11')](_0x57a8('0xc'),_0x5cf012,_0x34c9c4[_0x57a8('0x11')][_0x57a8('0x12')]);return _0x1cd7d5(_0x34c9c4['error'][_0x57a8('0x12')]);}logger[_0x57a8('0x11')](_0x57a8('0xc'),_0x5cf012,_0x34c9c4[_0x57a8('0x11')]['message']);return _0x33db3f(_0x34c9c4[_0x57a8('0x11')][_0x57a8('0x12')]);}else{logger[_0x57a8('0xb')](_0x57a8('0xc'),_0x5cf012,'request\x20sent');_0x33db3f(_0x34c9c4['result'][_0x57a8('0x12')]);}})[_0x57a8('0x13')](function(_0x10b786){logger[_0x57a8('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5cf012,_0x10b786);_0x1cd7d5(_0x10b786);});});}
\ No newline at end of file
index f8ef844..c804e6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda65=['Router','fs-extra','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','exports','multer','util','path','express'];(function(_0x43e04b,_0x169a65){var _0x10aae0=function(_0x2ed67b){while(--_0x2ed67b){_0x43e04b['push'](_0x43e04b['shift']());}};_0x10aae0(++_0x169a65);}(_0xda65,0x1d0));var _0x5da6=function(_0x5a9bc8,_0x5bfe84){_0x5a9bc8=_0x5a9bc8-0x0;var _0x2f6e2b=_0xda65[_0x5a9bc8];return _0x2f6e2b;};'use strict';var multer=require(_0x5da6('0x0'));var util=require(_0x5da6('0x1'));var path=require(_0x5da6('0x2'));var timeout=require('connect-timeout');var express=require(_0x5da6('0x3'));var router=express[_0x5da6('0x4')]();var fs_extra=require(_0x5da6('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5da6('0x6'));var controller=require(_0x5da6('0x7'));router[_0x5da6('0x8')]('/',auth[_0x5da6('0x9')](),controller[_0x5da6('0xa')]);router['get'](_0x5da6('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x5da6('0xc')]('/',auth['isAuthenticated'](),controller[_0x5da6('0xd')]);router[_0x5da6('0xe')](_0x5da6('0xb'),auth[_0x5da6('0x9')](),controller[_0x5da6('0xf')]);router[_0x5da6('0x10')](_0x5da6('0xb'),auth[_0x5da6('0x9')](),controller['destroy']);module[_0x5da6('0x11')]=router;
\ No newline at end of file
+var _0xfa2b=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','multer'];(function(_0x1ce56a,_0x5e353b){var _0x15c77f=function(_0x1bc2cd){while(--_0x1bc2cd){_0x1ce56a['push'](_0x1ce56a['shift']());}};_0x15c77f(++_0x5e353b);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0x5328ad,_0x209af9){_0x5328ad=_0x5328ad-0x0;var _0x52bf47=_0xfa2b[_0x5328ad];return _0x52bf47;};'use strict';var multer=require(_0xbfa2('0x0'));var util=require(_0xbfa2('0x1'));var path=require(_0xbfa2('0x2'));var timeout=require(_0xbfa2('0x3'));var express=require(_0xbfa2('0x4'));var router=express[_0xbfa2('0x5')]();var fs_extra=require(_0xbfa2('0x6'));var auth=require(_0xbfa2('0x7'));var interaction=require(_0xbfa2('0x8'));var config=require(_0xbfa2('0x9'));var controller=require(_0xbfa2('0xa'));router[_0xbfa2('0xb')]('/',auth[_0xbfa2('0xc')](),controller[_0xbfa2('0xd')]);router[_0xbfa2('0xb')](_0xbfa2('0xe'),auth['isAuthenticated'](),controller[_0xbfa2('0xf')]);router['post']('/',auth[_0xbfa2('0xc')](),controller[_0xbfa2('0x10')]);router[_0xbfa2('0x11')](_0xbfa2('0xe'),auth[_0xbfa2('0xc')](),controller[_0xbfa2('0x12')]);router[_0xbfa2('0x13')](_0xbfa2('0xe'),auth[_0xbfa2('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 3939da5..16388c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f36=['string','variable','customVariable','keyValue','STRING','BOOLEAN','exports','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4f36,0x14e));var _0x64f3=function(_0x10d618,_0x1f1c82){_0x10d618=_0x10d618-0x0;var _0x57d044=_0x4f36[_0x10d618];return _0x57d044;};'use strict';var Sequelize=require('sequelize');module[_0x64f3('0x0')]={'type':{'type':Sequelize[_0x64f3('0x1')](_0x64f3('0x2'),_0x64f3('0x3'),_0x64f3('0x4'),_0x64f3('0x5'),'picklist'),'defaultValue':_0x64f3('0x2')},'content':{'type':Sequelize[_0x64f3('0x6')]},'key':{'type':Sequelize[_0x64f3('0x6')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0x64f3('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x64f3('0x6')]},'nameField':{'type':Sequelize[_0x64f3('0x6')]},'customField':{'type':Sequelize[_0x64f3('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x64f3('0x6')]}};
\ No newline at end of file
+var _0xb7b6=['string','STRING','BOOLEAN','sequelize','ENUM','variable'];(function(_0x47c9e7,_0x44e5e8){var _0x485836=function(_0x4b1360){while(--_0x4b1360){_0x47c9e7['push'](_0x47c9e7['shift']());}};_0x485836(++_0x44e5e8);}(_0xb7b6,0xed));var _0x6b7b=function(_0x125d47,_0xb75069){_0x125d47=_0x125d47-0x0;var _0x159c9c=_0xb7b6[_0x125d47];return _0x159c9c;};'use strict';var Sequelize=require(_0x6b7b('0x0'));module['exports']={'type':{'type':Sequelize[_0x6b7b('0x1')]('string',_0x6b7b('0x2'),'customVariable','keyValue','picklist'),'defaultValue':_0x6b7b('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6b7b('0x4')]},'keyType':{'type':Sequelize[_0x6b7b('0x1')](_0x6b7b('0x3'),_0x6b7b('0x2'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x6b7b('0x4')]},'customField':{'type':Sequelize[_0x6b7b('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6b7b('0x4')]}};
\ No newline at end of file
index e85e99b..51c3e0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfbeb=['../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','FreshsalesField','rawAttributes','type','model','query','keys','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','update','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xfbeb,0x80));var _0xbfbe=function(_0x5d0207,_0x4000c4){_0x5d0207=_0x5d0207-0x0;var _0xf3e249=_0xfbeb[_0x5d0207];return _0xf3e249;};'use strict';var emlformat=require(_0xbfbe('0x0'));var rimraf=require(_0xbfbe('0x1'));var zipdir=require(_0xbfbe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbfbe('0x3'));var BPromise=require(_0xbfbe('0x4'));var Mustache=require(_0xbfbe('0x5'));var util=require(_0xbfbe('0x6'));var path=require(_0xbfbe('0x7'));var sox=require(_0xbfbe('0x8'));var csv=require(_0xbfbe('0x9'));var ejs=require(_0xbfbe('0xa'));var fs=require('fs');var fs_extra=require(_0xbfbe('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xbfbe('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbfbe('0xd'));var toCsv=require(_0xbfbe('0x9'));var querystring=require(_0xbfbe('0xe'));var Papa=require(_0xbfbe('0xf'));var Redis=require(_0xbfbe('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbfbe('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbfbe('0x12'));var logger=require(_0xbfbe('0x13'))(_0xbfbe('0x14'));var utils=require(_0xbfbe('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbfbe('0x16'))['db'];function respondWithStatusCode(_0x519aaf,_0xb53fd4){_0xb53fd4=_0xb53fd4||0xcc;return function(_0x3a3f10){if(_0x3a3f10){return _0x519aaf[_0xbfbe('0x17')](_0xb53fd4);}return _0x519aaf[_0xbfbe('0x18')](_0xb53fd4)[_0xbfbe('0x19')]();};}function respondWithResult(_0x1527ae,_0x526a56){_0x526a56=_0x526a56||0xc8;return function(_0x38e727){if(_0x38e727){return _0x1527ae['status'](_0x526a56)[_0xbfbe('0x1a')](_0x38e727);}};}function respondWithFilteredResult(_0x55c87f,_0x370519){return function(_0x2fae93){if(_0x2fae93){var _0x4385b9=typeof _0x370519[_0xbfbe('0x1b')]===_0xbfbe('0x1c')&&typeof _0x370519['limit']===_0xbfbe('0x1c');var _0x328ab5=_0x2fae93[_0xbfbe('0x1d')];var _0x34fd6f=_0x4385b9?0x0:_0x370519[_0xbfbe('0x1b')];var _0x236ebf=_0x4385b9?_0x2fae93['count']:_0x370519['offset']+_0x370519[_0xbfbe('0x1e')];var _0x179d9b;if(_0x236ebf>=_0x328ab5){_0x236ebf=_0x328ab5;_0x179d9b=0xc8;}else{_0x179d9b=0xce;}_0x55c87f[_0xbfbe('0x18')](_0x179d9b);return _0x55c87f[_0xbfbe('0x1f')](_0xbfbe('0x20'),_0x34fd6f+'-'+_0x236ebf+'/'+_0x328ab5)[_0xbfbe('0x1a')](_0x2fae93);}return null;};}function patchUpdates(_0x3ccbde){return function(_0x94969c){try{jsonpatch[_0xbfbe('0x21')](_0x94969c,_0x3ccbde,!![]);}catch(_0x223e89){return BPromise[_0xbfbe('0x22')](_0x223e89);}return _0x94969c[_0xbfbe('0x23')]();};}function saveUpdates(_0xccdfd6,_0xc3449a){return function(_0x214bae){if(_0x214bae){return _0x214bae['update'](_0xccdfd6)[_0xbfbe('0x24')](function(_0x3ec132){return _0x3ec132;});}return null;};}function removeEntity(_0x4c0e48,_0x46b54a){return function(_0x2ee4e1){if(_0x2ee4e1){return _0x2ee4e1[_0xbfbe('0x25')]()[_0xbfbe('0x24')](function(){_0x4c0e48[_0xbfbe('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f7466,_0x58f5e4){return function(_0xeb99bb){if(!_0xeb99bb){_0x3f7466['sendStatus'](0x194);}return _0xeb99bb;};}function handleError(_0x3fcf4a,_0x1e2326){_0x1e2326=_0x1e2326||0x1f4;return function(_0x1606ba){logger[_0xbfbe('0x26')](_0x1606ba[_0xbfbe('0x27')]);if(_0x1606ba[_0xbfbe('0x28')]){delete _0x1606ba[_0xbfbe('0x28')];}_0x3fcf4a[_0xbfbe('0x18')](_0x1e2326)[_0xbfbe('0x29')](_0x1606ba);};}exports['index']=function(_0x1758bb,_0x6335a6){var _0x1a4b59={},_0x178727={},_0x39ee6a={'count':0x0,'rows':[]};var _0x25b4fc=_[_0xbfbe('0x2a')](db[_0xbfbe('0x2b')][_0xbfbe('0x2c')],function(_0x435299){return{'name':_0x435299['fieldName'],'type':_0x435299[_0xbfbe('0x2d')]['key']};});_0x178727[_0xbfbe('0x2e')]=_['map'](_0x25b4fc,_0xbfbe('0x28'));_0x178727[_0xbfbe('0x2f')]=_[_0xbfbe('0x30')](_0x1758bb['query']);_0x178727['filters']=_[_0xbfbe('0x31')](_0x178727['model'],_0x178727[_0xbfbe('0x2f')]);_0x1a4b59['attributes']=_[_0xbfbe('0x31')](_0x178727[_0xbfbe('0x2e')],qs['fields'](_0x1758bb[_0xbfbe('0x2f')][_0xbfbe('0x32')]));_0x1a4b59['attributes']=_0x1a4b59['attributes'][_0xbfbe('0x33')]?_0x1a4b59[_0xbfbe('0x34')]:_0x178727[_0xbfbe('0x2e')];if(!_0x1758bb[_0xbfbe('0x2f')][_0xbfbe('0x35')](_0xbfbe('0x36'))){_0x1a4b59[_0xbfbe('0x1e')]=qs['limit'](_0x1758bb['query'][_0xbfbe('0x1e')]);_0x1a4b59[_0xbfbe('0x1b')]=qs[_0xbfbe('0x1b')](_0x1758bb['query']['offset']);}_0x1a4b59[_0xbfbe('0x37')]=qs[_0xbfbe('0x38')](_0x1758bb[_0xbfbe('0x2f')]['sort']);_0x1a4b59[_0xbfbe('0x39')]=qs[_0xbfbe('0x3a')](_[_0xbfbe('0x3b')](_0x1758bb[_0xbfbe('0x2f')],_0x178727['filters']),_0x25b4fc);if(_0x1758bb['query'][_0xbfbe('0x3c')]){_0x1a4b59[_0xbfbe('0x39')]=_[_0xbfbe('0x3d')](_0x1a4b59[_0xbfbe('0x39')],{'$or':_['map'](_0x25b4fc,function(_0x258f6a){if(_0x258f6a['type']!==_0xbfbe('0x3e')){var _0x18f9ff={};_0x18f9ff[_0x258f6a['name']]={'$like':'%'+_0x1758bb['query'][_0xbfbe('0x3c')]+'%'};return _0x18f9ff;}})});}_0x1a4b59=_['merge']({},_0x1a4b59,_0x1758bb[_0xbfbe('0x3f')]);var _0x33a8a6={'where':_0x1a4b59['where']};return db[_0xbfbe('0x2b')]['count'](_0x33a8a6)[_0xbfbe('0x24')](function(_0x4ed2c3){_0x39ee6a[_0xbfbe('0x1d')]=_0x4ed2c3;if(_0x1758bb['query'][_0xbfbe('0x40')]){_0x1a4b59[_0xbfbe('0x41')]=[{'all':!![]}];}return db[_0xbfbe('0x2b')][_0xbfbe('0x42')](_0x1a4b59);})['then'](function(_0x36e03e){_0x39ee6a[_0xbfbe('0x43')]=_0x36e03e;return _0x39ee6a;})['then'](respondWithFilteredResult(_0x6335a6,_0x1a4b59))[_0xbfbe('0x44')](handleError(_0x6335a6,null));};exports[_0xbfbe('0x45')]=function(_0x41c5da,_0x5890d5){var _0x5190de={'raw':!![],'where':{'id':_0x41c5da[_0xbfbe('0x46')]['id']}},_0x2edeb8={};_0x2edeb8['model']=_['keys'](db['FreshsalesField'][_0xbfbe('0x2c')]);_0x2edeb8[_0xbfbe('0x2f')]=_[_0xbfbe('0x30')](_0x41c5da[_0xbfbe('0x2f')]);_0x2edeb8['filters']=_[_0xbfbe('0x31')](_0x2edeb8['model'],_0x2edeb8[_0xbfbe('0x2f')]);_0x5190de['attributes']=_[_0xbfbe('0x31')](_0x2edeb8[_0xbfbe('0x2e')],qs[_0xbfbe('0x32')](_0x41c5da['query'][_0xbfbe('0x32')]));_0x5190de[_0xbfbe('0x34')]=_0x5190de[_0xbfbe('0x34')][_0xbfbe('0x33')]?_0x5190de['attributes']:_0x2edeb8['model'];if(_0x41c5da['query'][_0xbfbe('0x40')]){_0x5190de[_0xbfbe('0x41')]=[{'all':!![]}];}_0x5190de=_[_0xbfbe('0x3d')]({},_0x5190de,_0x41c5da[_0xbfbe('0x3f')]);return db[_0xbfbe('0x2b')][_0xbfbe('0x47')](_0x5190de)[_0xbfbe('0x24')](handleEntityNotFound(_0x5890d5,null))[_0xbfbe('0x24')](respondWithResult(_0x5890d5,null))['catch'](handleError(_0x5890d5,null));};exports[_0xbfbe('0x48')]=function(_0x57eb4c,_0x16097f){return db[_0xbfbe('0x2b')][_0xbfbe('0x48')](_0x57eb4c['body'],{})['then'](respondWithResult(_0x16097f,0xc9))[_0xbfbe('0x44')](handleError(_0x16097f,null));};exports[_0xbfbe('0x49')]=function(_0x14b820,_0x1cbdfc){if(_0x14b820[_0xbfbe('0x4a')]['id']){delete _0x14b820[_0xbfbe('0x4a')]['id'];}return db['FreshsalesField'][_0xbfbe('0x47')]({'where':{'id':_0x14b820[_0xbfbe('0x46')]['id']}})['then'](handleEntityNotFound(_0x1cbdfc,null))[_0xbfbe('0x24')](saveUpdates(_0x14b820[_0xbfbe('0x4a')],null))[_0xbfbe('0x24')](respondWithResult(_0x1cbdfc,null))[_0xbfbe('0x44')](handleError(_0x1cbdfc,null));};exports[_0xbfbe('0x25')]=function(_0x5bb946,_0xd869cd){return db[_0xbfbe('0x2b')][_0xbfbe('0x47')]({'where':{'id':_0x5bb946[_0xbfbe('0x46')]['id']}})[_0xbfbe('0x24')](handleEntityNotFound(_0xd869cd,null))[_0xbfbe('0x24')](removeEntity(_0xd869cd,null))[_0xbfbe('0x44')](handleError(_0xd869cd,null));};
\ No newline at end of file
+var _0xd096=['path','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','sendStatus','error','name','send','index','map','FreshsalesField','rawAttributes','query','keys','filters','model','attributes','intersection','fields','length','order','sort','where','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','merge','create','body','find','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util'];(function(_0x42f061,_0x5724d0){var _0x2a58cd=function(_0x70848a){while(--_0x70848a){_0x42f061['push'](_0x42f061['shift']());}};_0x2a58cd(++_0x5724d0);}(_0xd096,0x19d));var _0x6d09=function(_0x3fc7a4,_0x12efc6){_0x3fc7a4=_0x3fc7a4-0x0;var _0x2bc8b8=_0xd096[_0x3fc7a4];return _0x2bc8b8;};'use strict';var emlformat=require(_0x6d09('0x0'));var rimraf=require(_0x6d09('0x1'));var zipdir=require(_0x6d09('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6d09('0x3'));var moment=require('moment');var BPromise=require(_0x6d09('0x4'));var Mustache=require(_0x6d09('0x5'));var util=require(_0x6d09('0x6'));var path=require(_0x6d09('0x7'));var sox=require(_0x6d09('0x8'));var csv=require(_0x6d09('0x9'));var ejs=require(_0x6d09('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6d09('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6d09('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6d09('0x9'));var querystring=require(_0x6d09('0xd'));var Papa=require(_0x6d09('0xe'));var Redis=require('ioredis');var authService=require(_0x6d09('0xf'));var qs=require(_0x6d09('0x10'));var as=require(_0x6d09('0x11'));var hardwareService=require(_0x6d09('0x12'));var logger=require(_0x6d09('0x13'))(_0x6d09('0x14'));var utils=require(_0x6d09('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6d09('0x16'));var db=require(_0x6d09('0x17'))['db'];function respondWithStatusCode(_0x5d5fba,_0x3f12d6){_0x3f12d6=_0x3f12d6||0xcc;return function(_0x2abada){if(_0x2abada){return _0x5d5fba['sendStatus'](_0x3f12d6);}return _0x5d5fba['status'](_0x3f12d6)[_0x6d09('0x18')]();};}function respondWithResult(_0x3cbb57,_0x5ee1ee){_0x5ee1ee=_0x5ee1ee||0xc8;return function(_0xea5b9e){if(_0xea5b9e){return _0x3cbb57[_0x6d09('0x19')](_0x5ee1ee)[_0x6d09('0x1a')](_0xea5b9e);}};}function respondWithFilteredResult(_0x25fff6,_0x428939){return function(_0xeaac06){if(_0xeaac06){var _0x311870=typeof _0x428939[_0x6d09('0x1b')]===_0x6d09('0x1c')&&typeof _0x428939[_0x6d09('0x1d')]===_0x6d09('0x1c');var _0x1defe1=_0xeaac06[_0x6d09('0x1e')];var _0x3d5ce7=_0x311870?0x0:_0x428939[_0x6d09('0x1b')];var _0x43c63a=_0x311870?_0xeaac06[_0x6d09('0x1e')]:_0x428939[_0x6d09('0x1b')]+_0x428939[_0x6d09('0x1d')];var _0x52666f;if(_0x43c63a>=_0x1defe1){_0x43c63a=_0x1defe1;_0x52666f=0xc8;}else{_0x52666f=0xce;}_0x25fff6[_0x6d09('0x19')](_0x52666f);return _0x25fff6[_0x6d09('0x1f')](_0x6d09('0x20'),_0x3d5ce7+'-'+_0x43c63a+'/'+_0x1defe1)['json'](_0xeaac06);}return null;};}function patchUpdates(_0x537f10){return function(_0x2e3acd){try{jsonpatch['apply'](_0x2e3acd,_0x537f10,!![]);}catch(_0x5c2567){return BPromise['reject'](_0x5c2567);}return _0x2e3acd[_0x6d09('0x21')]();};}function saveUpdates(_0xa8caa8,_0x31f3b1){return function(_0x532479){if(_0x532479){return _0x532479[_0x6d09('0x22')](_0xa8caa8)['then'](function(_0x3496f4){return _0x3496f4;});}return null;};}function removeEntity(_0x48ea41,_0x3bcbdd){return function(_0x3c729a){if(_0x3c729a){return _0x3c729a[_0x6d09('0x23')]()[_0x6d09('0x24')](function(){_0x48ea41[_0x6d09('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x482e42,_0x51f72c){return function(_0x588afc){if(!_0x588afc){_0x482e42[_0x6d09('0x25')](0x194);}return _0x588afc;};}function handleError(_0x18c318,_0x36c062){_0x36c062=_0x36c062||0x1f4;return function(_0x182800){logger[_0x6d09('0x26')](_0x182800['stack']);if(_0x182800[_0x6d09('0x27')]){delete _0x182800[_0x6d09('0x27')];}_0x18c318[_0x6d09('0x19')](_0x36c062)[_0x6d09('0x28')](_0x182800);};}exports[_0x6d09('0x29')]=function(_0x511594,_0x542178){var _0x2f25fc={},_0x2f3369={},_0x5d29a8={'count':0x0,'rows':[]};var _0x34447c=_[_0x6d09('0x2a')](db[_0x6d09('0x2b')][_0x6d09('0x2c')],function(_0x481f69){return{'name':_0x481f69['fieldName'],'type':_0x481f69['type']['key']};});_0x2f3369['model']=_[_0x6d09('0x2a')](_0x34447c,_0x6d09('0x27'));_0x2f3369[_0x6d09('0x2d')]=_[_0x6d09('0x2e')](_0x511594[_0x6d09('0x2d')]);_0x2f3369[_0x6d09('0x2f')]=_['intersection'](_0x2f3369[_0x6d09('0x30')],_0x2f3369[_0x6d09('0x2d')]);_0x2f25fc[_0x6d09('0x31')]=_[_0x6d09('0x32')](_0x2f3369[_0x6d09('0x30')],qs[_0x6d09('0x33')](_0x511594[_0x6d09('0x2d')][_0x6d09('0x33')]));_0x2f25fc[_0x6d09('0x31')]=_0x2f25fc[_0x6d09('0x31')][_0x6d09('0x34')]?_0x2f25fc['attributes']:_0x2f3369['model'];if(!_0x511594['query']['hasOwnProperty']('nolimit')){_0x2f25fc[_0x6d09('0x1d')]=qs[_0x6d09('0x1d')](_0x511594[_0x6d09('0x2d')][_0x6d09('0x1d')]);_0x2f25fc['offset']=qs[_0x6d09('0x1b')](_0x511594[_0x6d09('0x2d')][_0x6d09('0x1b')]);}_0x2f25fc[_0x6d09('0x35')]=qs[_0x6d09('0x36')](_0x511594[_0x6d09('0x2d')][_0x6d09('0x36')]);_0x2f25fc[_0x6d09('0x37')]=qs[_0x6d09('0x2f')](_['pick'](_0x511594[_0x6d09('0x2d')],_0x2f3369['filters']),_0x34447c);if(_0x511594['query']['filter']){_0x2f25fc[_0x6d09('0x37')]=_['merge'](_0x2f25fc[_0x6d09('0x37')],{'$or':_[_0x6d09('0x2a')](_0x34447c,function(_0x46158a){if(_0x46158a[_0x6d09('0x38')]!==_0x6d09('0x39')){var _0x3ea246={};_0x3ea246[_0x46158a['name']]={'$like':'%'+_0x511594[_0x6d09('0x2d')][_0x6d09('0x3a')]+'%'};return _0x3ea246;}})});}_0x2f25fc=_['merge']({},_0x2f25fc,_0x511594[_0x6d09('0x3b')]);var _0x29e991={'where':_0x2f25fc[_0x6d09('0x37')]};return db[_0x6d09('0x2b')][_0x6d09('0x1e')](_0x29e991)[_0x6d09('0x24')](function(_0x4b549e){_0x5d29a8['count']=_0x4b549e;if(_0x511594['query'][_0x6d09('0x3c')]){_0x2f25fc[_0x6d09('0x3d')]=[{'all':!![]}];}return db[_0x6d09('0x2b')]['findAll'](_0x2f25fc);})[_0x6d09('0x24')](function(_0x198696){_0x5d29a8[_0x6d09('0x3e')]=_0x198696;return _0x5d29a8;})[_0x6d09('0x24')](respondWithFilteredResult(_0x542178,_0x2f25fc))[_0x6d09('0x3f')](handleError(_0x542178,null));};exports[_0x6d09('0x40')]=function(_0x9255e6,_0x446257){var _0x206207={'raw':!![],'where':{'id':_0x9255e6[_0x6d09('0x41')]['id']}},_0x30b7a1={};_0x30b7a1[_0x6d09('0x30')]=_['keys'](db[_0x6d09('0x2b')]['rawAttributes']);_0x30b7a1[_0x6d09('0x2d')]=_['keys'](_0x9255e6['query']);_0x30b7a1['filters']=_['intersection'](_0x30b7a1['model'],_0x30b7a1[_0x6d09('0x2d')]);_0x206207[_0x6d09('0x31')]=_[_0x6d09('0x32')](_0x30b7a1[_0x6d09('0x30')],qs[_0x6d09('0x33')](_0x9255e6['query'][_0x6d09('0x33')]));_0x206207[_0x6d09('0x31')]=_0x206207[_0x6d09('0x31')][_0x6d09('0x34')]?_0x206207[_0x6d09('0x31')]:_0x30b7a1[_0x6d09('0x30')];if(_0x9255e6[_0x6d09('0x2d')][_0x6d09('0x3c')]){_0x206207[_0x6d09('0x3d')]=[{'all':!![]}];}_0x206207=_[_0x6d09('0x42')]({},_0x206207,_0x9255e6[_0x6d09('0x3b')]);return db[_0x6d09('0x2b')]['find'](_0x206207)[_0x6d09('0x24')](handleEntityNotFound(_0x446257,null))['then'](respondWithResult(_0x446257,null))[_0x6d09('0x3f')](handleError(_0x446257,null));};exports[_0x6d09('0x43')]=function(_0x4b66e1,_0x94960){return db[_0x6d09('0x2b')][_0x6d09('0x43')](_0x4b66e1[_0x6d09('0x44')],{})['then'](respondWithResult(_0x94960,0xc9))[_0x6d09('0x3f')](handleError(_0x94960,null));};exports[_0x6d09('0x22')]=function(_0x1076d5,_0x92338){if(_0x1076d5[_0x6d09('0x44')]['id']){delete _0x1076d5['body']['id'];}return db['FreshsalesField'][_0x6d09('0x45')]({'where':{'id':_0x1076d5[_0x6d09('0x41')]['id']}})['then'](handleEntityNotFound(_0x92338,null))[_0x6d09('0x24')](saveUpdates(_0x1076d5[_0x6d09('0x44')],null))[_0x6d09('0x24')](respondWithResult(_0x92338,null))[_0x6d09('0x3f')](handleError(_0x92338,null));};exports['destroy']=function(_0x3bd8c4,_0x1b38ea){return db[_0x6d09('0x2b')][_0x6d09('0x45')]({'where':{'id':_0x3bd8c4[_0x6d09('0x41')]['id']}})['then'](handleEntityNotFound(_0x1b38ea,null))[_0x6d09('0x24')](removeEntity(_0x1b38ea,null))[_0x6d09('0x3f')](handleError(_0x1b38ea,null));};
\ No newline at end of file
index 9ad5890..fea10c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd23d=['define','FreshsalesField','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./intFreshsalesField.attributes','exports'];(function(_0x4bafe6,_0x3cc7f1){var _0x35f3c3=function(_0x56e36e){while(--_0x56e36e){_0x4bafe6['push'](_0x4bafe6['shift']());}};_0x35f3c3(++_0x3cc7f1);}(_0xd23d,0xa0));var _0xdd23=function(_0x33c9f8,_0x5aedbb){_0x33c9f8=_0x33c9f8-0x0;var _0x2d7004=_0xd23d[_0x33c9f8];return _0x2d7004;};'use strict';var _=require(_0xdd23('0x0'));var util=require(_0xdd23('0x1'));var logger=require(_0xdd23('0x2'))(_0xdd23('0x3'));var moment=require(_0xdd23('0x4'));var BPromise=require(_0xdd23('0x5'));var rp=require(_0xdd23('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdd23('0x7'));module[_0xdd23('0x8')]=function(_0x7232e8,_0xa5bdac){return _0x7232e8[_0xdd23('0x9')](_0xdd23('0xa'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xdd23('0xb'),_0xdd23('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xaaee=['FieldId','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./intFreshsalesField.attributes','exports','define','FreshsalesField','freshsales_unique_index','idField'];(function(_0x18bf22,_0x3517ce){var _0x13c5dc=function(_0x45c65a){while(--_0x45c65a){_0x18bf22['push'](_0x18bf22['shift']());}};_0x13c5dc(++_0x3517ce);}(_0xaaee,0xa9));var _0xeaae=function(_0xa527d2,_0x23c3d4){_0xa527d2=_0xa527d2-0x0;var _0x3eaa20=_0xaaee[_0xa527d2];return _0x3eaa20;};'use strict';var _=require(_0xeaae('0x0'));var util=require('util');var logger=require(_0xeaae('0x1'))(_0xeaae('0x2'));var moment=require('moment');var BPromise=require(_0xeaae('0x3'));var rp=require(_0xeaae('0x4'));var fs=require('fs');var path=require(_0xeaae('0x5'));var rimraf=require(_0xeaae('0x6'));var config=require('../../config/environment');var attributes=require(_0xeaae('0x7'));module[_0xeaae('0x8')]=function(_0x213422,_0x45c104){return _0x213422[_0xeaae('0x9')](_0xeaae('0xa'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0xeaae('0xb'),'fields':[_0xeaae('0xc'),_0xeaae('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 235d1da..bfee728 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4819=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','FreshsalesField,\x20%s,\x20%s','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util','moment'];(function(_0x3f0406,_0x3d338d){var _0x667f30=function(_0x5e5a7a){while(--_0x5e5a7a){_0x3f0406['push'](_0x3f0406['shift']());}};_0x667f30(++_0x3d338d);}(_0x4819,0xcd));var _0x9481=function(_0x4409e7,_0x307f17){_0x4409e7=_0x4409e7-0x0;var _0x24c751=_0x4819[_0x4409e7];return _0x24c751;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var moment=require(_0x9481('0x1'));var BPromise=require(_0x9481('0x2'));var rs=require(_0x9481('0x3'));var fs=require('fs');var Redis=require(_0x9481('0x4'));var db=require(_0x9481('0x5'))['db'];var utils=require(_0x9481('0x6'));var logger=require(_0x9481('0x7'))(_0x9481('0x8'));var config=require(_0x9481('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9481('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54cc78,_0x14e05a,_0x6c6a08){return new BPromise(function(_0x27c033,_0x3278ff){return client[_0x9481('0xb')](_0x54cc78,_0x6c6a08)['then'](function(_0x1818cf){logger['info'](_0x9481('0xc'),_0x14e05a,'request\x20sent');logger[_0x9481('0xd')](_0x9481('0xe'),_0x14e05a,_0x9481('0xf'),JSON[_0x9481('0x10')](_0x1818cf));if(_0x1818cf[_0x9481('0x11')]){if(_0x1818cf[_0x9481('0x11')][_0x9481('0x12')]===0x1f4){logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x1818cf['error']['message']);return _0x3278ff(_0x1818cf[_0x9481('0x11')][_0x9481('0x13')]);}logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x1818cf[_0x9481('0x11')][_0x9481('0x13')]);return _0x27c033(_0x1818cf[_0x9481('0x11')]['message']);}else{logger[_0x9481('0x14')](_0x9481('0xc'),_0x14e05a,'request\x20sent');_0x27c033(_0x1818cf[_0x9481('0x15')]['message']);}})[_0x9481('0x16')](function(_0x7a2ac8){logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x7a2ac8);_0x3278ff(_0x7a2ac8);});});}
\ No newline at end of file
+var _0x01d9=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x2dbaa6,_0x28e5c0){var _0x3128fb=function(_0x23507a){while(--_0x23507a){_0x2dbaa6['push'](_0x2dbaa6['shift']());}};_0x3128fb(++_0x28e5c0);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var moment=require(_0x901d('0x2'));var BPromise=require(_0x901d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x901d('0x4'));var db=require(_0x901d('0x5'))['db'];var utils=require(_0x901d('0x6'));var logger=require(_0x901d('0x7'))(_0x901d('0x8'));var config=require(_0x901d('0x9'));var jayson=require(_0x901d('0xa'));var client=jayson['client'][_0x901d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6c9ac8,_0x21e1d7,_0x12c39f){return new BPromise(function(_0x313f85,_0x39fc94){return client[_0x901d('0xc')](_0x6c9ac8,_0x12c39f)[_0x901d('0xd')](function(_0x15076e){logger[_0x901d('0xe')](_0x901d('0xf'),_0x21e1d7,_0x901d('0x10'));logger[_0x901d('0x11')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x21e1d7,_0x901d('0x10'),JSON['stringify'](_0x15076e));if(_0x15076e[_0x901d('0x12')]){if(_0x15076e[_0x901d('0x12')][_0x901d('0x13')]===0x1f4){logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x15076e['error'][_0x901d('0x14')]);return _0x39fc94(_0x15076e[_0x901d('0x12')][_0x901d('0x14')]);}logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x15076e[_0x901d('0x12')]['message']);return _0x313f85(_0x15076e[_0x901d('0x12')][_0x901d('0x14')]);}else{logger[_0x901d('0xe')](_0x901d('0xf'),_0x21e1d7,_0x901d('0x10'));_0x313f85(_0x15076e[_0x901d('0x15')][_0x901d('0x14')]);}})[_0x901d('0x16')](function(_0x3368fc){logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x3368fc);_0x39fc94(_0x3368fc);});});}
\ No newline at end of file
index 517b160..5070d01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x22b513,_0xe1c1c5){var _0x7fd76c=function(_0x23a216){while(--_0x23a216){_0x22b513['push'](_0x22b513['shift']());}};_0x7fd76c(++_0xe1c1c5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router;
\ No newline at end of file
+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(_0x2bf9f8,_0x419118){var _0x58c859=function(_0x4ba048){while(--_0x4ba048){_0x2bf9f8['push'](_0x2bf9f8['shift']());}};_0x58c859(++_0x419118);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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 a2c62b1..9a09e1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1f1=['exports','STRING','username','ENUM','integrationTab','newTab','sequelize'];(function(_0x13e300,_0x1bcb41){var _0x5a3eea=function(_0x2dfd2a){while(--_0x2dfd2a){_0x13e300['push'](_0x13e300['shift']());}};_0x5a3eea(++_0x1bcb41);}(_0xd1f1,0xbc));var _0x1d1f=function(_0x213721,_0xc41653){_0x213721=_0x213721-0x0;var _0x6435ee=_0xd1f1[_0x213721];return _0x6435ee;};'use strict';var Sequelize=require(_0x1d1f('0x0'));module[_0x1d1f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1d1f('0x2')]},'username':{'type':Sequelize[_0x1d1f('0x2')],'unique':_0x1d1f('0x3')},'remoteUri':{'type':Sequelize[_0x1d1f('0x2')]},'password':{'type':Sequelize[_0x1d1f('0x2')]},'clientId':{'type':Sequelize[_0x1d1f('0x2')]},'clientSecret':{'type':Sequelize[_0x1d1f('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x1d1f('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x1d1f('0x4')](_0x1d1f('0x5'),_0x1d1f('0x6')),'defaultValue':_0x1d1f('0x5')}};
\ No newline at end of file
+var _0xe635=['STRING','username','ENUM','integrationTab','newTab','sequelize','exports'];(function(_0x3f4aee,_0x3114c5){var _0x327bc8=function(_0x49702e){while(--_0x49702e){_0x3f4aee['push'](_0x3f4aee['shift']());}};_0x327bc8(++_0x3114c5);}(_0xe635,0x1be));var _0x5e63=function(_0x360681,_0xd973a2){_0x360681=_0x360681-0x0;var _0x2abca7=_0xe635[_0x360681];return _0x2abca7;};'use strict';var Sequelize=require(_0x5e63('0x0'));module[_0x5e63('0x1')]={'name':{'type':Sequelize[_0x5e63('0x2')]},'description':{'type':Sequelize[_0x5e63('0x2')]},'username':{'type':Sequelize[_0x5e63('0x2')],'unique':_0x5e63('0x3')},'remoteUri':{'type':Sequelize[_0x5e63('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x5e63('0x2')]},'securityToken':{'type':Sequelize[_0x5e63('0x2')]},'serverUrl':{'type':Sequelize[_0x5e63('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x5e63('0x4')](_0x5e63('0x5'),_0x5e63('0x6')),'defaultValue':_0x5e63('0x5')}};
\ No newline at end of file
index 39273ac..1c57068 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb007=['filters','attributes','length','hasOwnProperty','order','sort','filter','where','merge','options','SalesforceAccount','findAll','rows','catch','show','rawAttributes','intersection','fields','include','find','create','body','params','getConfigurations','SalesforceConfiguration','pick','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','slice','substring','lastIndexOf','Connection','login','concat','securityToken','isNil','ticketType','describe','OwnerId','IsRecurrence','Subject','picklist','boolean','email','textarea','phone','includes','label','picklistValues','value','True','true','false','test','statusCode','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','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','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys'];(function(_0x27e029,_0x17e305){var _0x29bf95=function(_0x4755a4){while(--_0x4755a4){_0x27e029['push'](_0x27e029['shift']());}};_0x29bf95(++_0x17e305);}(_0xb007,0x1bb));var _0x7b00=function(_0x5a5a52,_0xd7100b){_0x5a5a52=_0x5a5a52-0x0;var _0xf0b991=_0xb007[_0x5a5a52];return _0xf0b991;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b00('0x0'));var zipdir=require(_0x7b00('0x1'));var jsonpatch=require(_0x7b00('0x2'));var rp=require('request-promise');var moment=require(_0x7b00('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7b00('0x4'));var util=require(_0x7b00('0x5'));var path=require(_0x7b00('0x6'));var sox=require('sox');var csv=require(_0x7b00('0x7'));var ejs=require(_0x7b00('0x8'));var fs=require('fs');var fs_extra=require(_0x7b00('0x9'));var _=require(_0x7b00('0xa'));var squel=require(_0x7b00('0xb'));var crypto=require('crypto');var jsforce=require(_0x7b00('0xc'));var deskjs=require(_0x7b00('0xd'));var toCsv=require(_0x7b00('0x7'));var querystring=require(_0x7b00('0xe'));var Papa=require(_0x7b00('0xf'));var Redis=require(_0x7b00('0x10'));var authService=require(_0x7b00('0x11'));var qs=require(_0x7b00('0x12'));var as=require(_0x7b00('0x13'));var hardwareService=require(_0x7b00('0x14'));var logger=require('../../config/logger')(_0x7b00('0x15'));var utils=require(_0x7b00('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7b00('0x17'));var db=require(_0x7b00('0x18'))['db'];var integrations=require(_0x7b00('0x19'));function respondWithStatusCode(_0x389ef2,_0xae82e9){_0xae82e9=_0xae82e9||0xcc;return function(_0xf41a5e){if(_0xf41a5e){return _0x389ef2[_0x7b00('0x1a')](_0xae82e9);}return _0x389ef2[_0x7b00('0x1b')](_0xae82e9)[_0x7b00('0x1c')]();};}function respondWithResult(_0x1908d8,_0x202737){_0x202737=_0x202737||0xc8;return function(_0x35de96){if(_0x35de96){return _0x1908d8[_0x7b00('0x1b')](_0x202737)[_0x7b00('0x1d')](_0x35de96);}};}function respondWithFilteredResult(_0x1af45a,_0x31e190){return function(_0x3cab07){if(_0x3cab07){var _0x4e3689=typeof _0x31e190[_0x7b00('0x1e')]==='undefined'&&typeof _0x31e190[_0x7b00('0x1f')]===_0x7b00('0x20');var _0x4b1a83=_0x3cab07[_0x7b00('0x21')];var _0x3ee76c=_0x4e3689?0x0:_0x31e190[_0x7b00('0x1e')];var _0x49b505=_0x4e3689?_0x3cab07[_0x7b00('0x21')]:_0x31e190[_0x7b00('0x1e')]+_0x31e190['limit'];var _0x7375ee;if(_0x49b505>=_0x4b1a83){_0x49b505=_0x4b1a83;_0x7375ee=0xc8;}else{_0x7375ee=0xce;}_0x1af45a[_0x7b00('0x1b')](_0x7375ee);return _0x1af45a['set'](_0x7b00('0x22'),_0x3ee76c+'-'+_0x49b505+'/'+_0x4b1a83)[_0x7b00('0x1d')](_0x3cab07);}return null;};}function patchUpdates(_0x21f778){return function(_0x246cc3){try{jsonpatch[_0x7b00('0x23')](_0x246cc3,_0x21f778,!![]);}catch(_0xfc6cbd){return BPromise[_0x7b00('0x24')](_0xfc6cbd);}return _0x246cc3[_0x7b00('0x25')]();};}function saveUpdates(_0x4959ce,_0x13ff32){return function(_0x376c4d){if(_0x376c4d){return _0x376c4d[_0x7b00('0x26')](_0x4959ce)[_0x7b00('0x27')](function(_0x2d423e){return _0x2d423e;});}return null;};}function removeEntity(_0x234860,_0x4a2f85){return function(_0x36cbdb){if(_0x36cbdb){return _0x36cbdb[_0x7b00('0x28')]()[_0x7b00('0x27')](function(){_0x234860[_0x7b00('0x1b')](0xcc)[_0x7b00('0x1c')]();});}};}function handleEntityNotFound(_0x23de2b,_0x5a5161){return function(_0x129128){if(!_0x129128){_0x23de2b[_0x7b00('0x1a')](0x194);}return _0x129128;};}function handleError(_0x4bb079,_0x48c03a){_0x48c03a=_0x48c03a||0x1f4;return function(_0x5c2579){logger[_0x7b00('0x29')](_0x5c2579[_0x7b00('0x2a')]);if(_0x5c2579[_0x7b00('0x2b')]){delete _0x5c2579['name'];}_0x4bb079['status'](_0x48c03a)[_0x7b00('0x2c')](_0x5c2579);};}exports[_0x7b00('0x2d')]=function(_0x5dacff,_0x21f45b){var _0x3af700={},_0x184d35={},_0x4234d2={'count':0x0,'rows':[]};var _0x4c11ab=_[_0x7b00('0x2e')](db['SalesforceAccount']['rawAttributes'],function(_0x3d954d){return{'name':_0x3d954d[_0x7b00('0x2f')],'type':_0x3d954d[_0x7b00('0x30')][_0x7b00('0x31')]};});_0x184d35[_0x7b00('0x32')]=_[_0x7b00('0x2e')](_0x4c11ab,_0x7b00('0x2b'));_0x184d35[_0x7b00('0x33')]=_[_0x7b00('0x34')](_0x5dacff['query']);_0x184d35[_0x7b00('0x35')]=_['intersection'](_0x184d35[_0x7b00('0x32')],_0x184d35['query']);_0x3af700[_0x7b00('0x36')]=_['intersection'](_0x184d35['model'],qs['fields'](_0x5dacff[_0x7b00('0x33')]['fields']));_0x3af700[_0x7b00('0x36')]=_0x3af700[_0x7b00('0x36')][_0x7b00('0x37')]?_0x3af700[_0x7b00('0x36')]:_0x184d35['model'];if(!_0x5dacff[_0x7b00('0x33')][_0x7b00('0x38')]('nolimit')){_0x3af700[_0x7b00('0x1f')]=qs[_0x7b00('0x1f')](_0x5dacff[_0x7b00('0x33')][_0x7b00('0x1f')]);_0x3af700['offset']=qs['offset'](_0x5dacff[_0x7b00('0x33')][_0x7b00('0x1e')]);}_0x3af700[_0x7b00('0x39')]=qs[_0x7b00('0x3a')](_0x5dacff['query'][_0x7b00('0x3a')]);_0x3af700['where']=qs[_0x7b00('0x35')](_['pick'](_0x5dacff[_0x7b00('0x33')],_0x184d35['filters']),_0x4c11ab);if(_0x5dacff['query'][_0x7b00('0x3b')]){_0x3af700[_0x7b00('0x3c')]=_[_0x7b00('0x3d')](_0x3af700[_0x7b00('0x3c')],{'$or':_[_0x7b00('0x2e')](_0x4c11ab,function(_0x5abf43){if(_0x5abf43[_0x7b00('0x30')]!=='VIRTUAL'){var _0x4d3f67={};_0x4d3f67[_0x5abf43[_0x7b00('0x2b')]]={'$like':'%'+_0x5dacff['query'][_0x7b00('0x3b')]+'%'};return _0x4d3f67;}})});}_0x3af700=_['merge']({},_0x3af700,_0x5dacff[_0x7b00('0x3e')]);var _0x3d9ec8={'where':_0x3af700[_0x7b00('0x3c')]};return db[_0x7b00('0x3f')][_0x7b00('0x21')](_0x3d9ec8)['then'](function(_0x187857){_0x4234d2[_0x7b00('0x21')]=_0x187857;if(_0x5dacff['query']['includeAll']){_0x3af700['include']=[{'all':!![]}];}return db['SalesforceAccount'][_0x7b00('0x40')](_0x3af700);})['then'](function(_0x27aec8){_0x4234d2[_0x7b00('0x41')]=_0x27aec8;return _0x4234d2;})[_0x7b00('0x27')](respondWithFilteredResult(_0x21f45b,_0x3af700))[_0x7b00('0x42')](handleError(_0x21f45b,null));};exports[_0x7b00('0x43')]=function(_0x2a9bf5,_0x849b4f){var _0x3626a8={'raw':![],'where':{'id':_0x2a9bf5['params']['id']}},_0x2b9fdc={};_0x2b9fdc[_0x7b00('0x32')]=_['keys'](db['SalesforceAccount'][_0x7b00('0x44')]);_0x2b9fdc[_0x7b00('0x33')]=_[_0x7b00('0x34')](_0x2a9bf5[_0x7b00('0x33')]);_0x2b9fdc[_0x7b00('0x35')]=_['intersection'](_0x2b9fdc['model'],_0x2b9fdc[_0x7b00('0x33')]);_0x3626a8['attributes']=_[_0x7b00('0x45')](_0x2b9fdc[_0x7b00('0x32')],qs[_0x7b00('0x46')](_0x2a9bf5[_0x7b00('0x33')][_0x7b00('0x46')]));_0x3626a8[_0x7b00('0x36')]=_0x3626a8[_0x7b00('0x36')][_0x7b00('0x37')]?_0x3626a8['attributes']:_0x2b9fdc[_0x7b00('0x32')];if(_0x2a9bf5[_0x7b00('0x33')]['includeAll']){_0x3626a8[_0x7b00('0x47')]=[{'all':!![]}];}_0x3626a8=_[_0x7b00('0x3d')]({},_0x3626a8,_0x2a9bf5[_0x7b00('0x3e')]);return db[_0x7b00('0x3f')][_0x7b00('0x48')](_0x3626a8)[_0x7b00('0x27')](handleEntityNotFound(_0x849b4f,null))[_0x7b00('0x27')](respondWithResult(_0x849b4f,null))[_0x7b00('0x42')](handleError(_0x849b4f,null));};exports[_0x7b00('0x49')]=function(_0x11b181,_0x3c41d8){return db[_0x7b00('0x3f')][_0x7b00('0x49')](_0x11b181[_0x7b00('0x4a')],{})[_0x7b00('0x27')](respondWithResult(_0x3c41d8,0xc9))[_0x7b00('0x42')](handleError(_0x3c41d8,null));};exports[_0x7b00('0x26')]=function(_0x329c34,_0x49a3c3){if(_0x329c34[_0x7b00('0x4a')]['id']){delete _0x329c34['body']['id'];}return db[_0x7b00('0x3f')][_0x7b00('0x48')]({'where':{'id':_0x329c34[_0x7b00('0x4b')]['id']}})['then'](handleEntityNotFound(_0x49a3c3,null))[_0x7b00('0x27')](saveUpdates(_0x329c34[_0x7b00('0x4a')],null))[_0x7b00('0x27')](respondWithResult(_0x49a3c3,null))[_0x7b00('0x42')](handleError(_0x49a3c3,null));};exports[_0x7b00('0x28')]=function(_0x494adf,_0x42fea7){return db[_0x7b00('0x3f')][_0x7b00('0x48')]({'where':{'id':_0x494adf[_0x7b00('0x4b')]['id']}})['then'](handleEntityNotFound(_0x42fea7,null))[_0x7b00('0x27')](removeEntity(_0x42fea7,null))[_0x7b00('0x42')](handleError(_0x42fea7,null));};exports[_0x7b00('0x4c')]=function(_0x588ca5,_0x10eefe,_0x5bff54){var _0x5b5adf={};var _0x2cdbd2={};var _0x5281c2;var _0x16a5ca;return db['SalesforceAccount']['findOne']({'where':{'id':_0x588ca5['params']['id']}})[_0x7b00('0x27')](handleEntityNotFound(_0x10eefe,null))['then'](function(_0x1ded0f){if(_0x1ded0f){_0x5281c2=_0x1ded0f;_0x2cdbd2['model']=_[_0x7b00('0x34')](db[_0x7b00('0x4d')]['rawAttributes']);_0x2cdbd2[_0x7b00('0x33')]=_[_0x7b00('0x34')](_0x588ca5[_0x7b00('0x33')]);_0x2cdbd2['filters']=_[_0x7b00('0x45')](_0x2cdbd2[_0x7b00('0x32')],_0x2cdbd2[_0x7b00('0x33')]);_0x5b5adf[_0x7b00('0x36')]=_[_0x7b00('0x45')](_0x2cdbd2[_0x7b00('0x32')],qs[_0x7b00('0x46')](_0x588ca5[_0x7b00('0x33')]['fields']));_0x5b5adf['attributes']=_0x5b5adf[_0x7b00('0x36')][_0x7b00('0x37')]?_0x5b5adf['attributes']:_0x2cdbd2['model'];_0x5b5adf[_0x7b00('0x39')]=qs[_0x7b00('0x3a')](_0x588ca5[_0x7b00('0x33')][_0x7b00('0x3a')]);_0x5b5adf[_0x7b00('0x3c')]=qs[_0x7b00('0x35')](_[_0x7b00('0x4e')](_0x588ca5[_0x7b00('0x33')],_0x2cdbd2[_0x7b00('0x35')]));if(_0x588ca5[_0x7b00('0x33')][_0x7b00('0x3b')]){_0x5b5adf[_0x7b00('0x3c')]=_['merge'](_0x5b5adf['where'],{'$or':_[_0x7b00('0x2e')](_0x5b5adf[_0x7b00('0x36')],function(_0x3d9c92){var _0x27c89e={};_0x27c89e[_0x3d9c92]={'$like':'%'+_0x588ca5['query'][_0x7b00('0x3b')]+'%'};return _0x27c89e;})});}_0x5b5adf=_[_0x7b00('0x3d')]({},_0x5b5adf,_0x588ca5[_0x7b00('0x3e')]);return _0x5281c2[_0x7b00('0x4c')](_0x5b5adf);}})[_0x7b00('0x27')](function(_0x203d18){if(_0x203d18){_0x16a5ca=_0x203d18[_0x7b00('0x37')];if(!_0x588ca5['query'][_0x7b00('0x38')](_0x7b00('0x4f'))){_0x5b5adf[_0x7b00('0x1f')]=qs[_0x7b00('0x1f')](_0x588ca5[_0x7b00('0x33')]['limit']);_0x5b5adf[_0x7b00('0x1e')]=qs[_0x7b00('0x1e')](_0x588ca5[_0x7b00('0x33')][_0x7b00('0x1e')]);}return _0x5281c2['getConfigurations'](_0x5b5adf);}})[_0x7b00('0x27')](function(_0x1bc7dd){if(_0x1bc7dd){return _0x1bc7dd?{'count':_0x16a5ca,'rows':_0x1bc7dd}:null;}})['then'](respondWithResult(_0x10eefe,null))['catch'](handleError(_0x10eefe,null));};exports[_0x7b00('0x50')]=function(_0xdb63a9,_0x1f9a05,_0x33665a){if(_0xdb63a9[_0x7b00('0x4a')]['id']){delete _0xdb63a9[_0x7b00('0x4a')]['id'];}return db[_0x7b00('0x3f')]['findOne']({'where':{'id':_0xdb63a9['params']['id']}})[_0x7b00('0x27')](handleEntityNotFound(_0x1f9a05,null))[_0x7b00('0x27')](function(_0x4cb0e3){if(_0x4cb0e3){_0xdb63a9['body'][_0x7b00('0x51')]=_0x4cb0e3['id'];_0xdb63a9[_0x7b00('0x4a')][_0x7b00('0x52')]=integrations[_0x7b00('0x53')](_0xdb63a9[_0x7b00('0x4a')][_0x7b00('0x54')],_0xdb63a9[_0x7b00('0x4a')][_0x7b00('0x30')]);_0xdb63a9[_0x7b00('0x4a')][_0x7b00('0x55')]=integrations[_0x7b00('0x56')](_0xdb63a9[_0x7b00('0x4a')]['channel'],_0xdb63a9[_0x7b00('0x4a')]['type']);return db[_0x7b00('0x4d')]['create'](_0xdb63a9[_0x7b00('0x4a')],{'include':[{'model':db[_0x7b00('0x57')],'as':_0x7b00('0x52')},{'model':db[_0x7b00('0x57')],'as':'Descriptions'}]});}return null;})[_0x7b00('0x27')](respondWithResult(_0x1f9a05,null))[_0x7b00('0x42')](handleError(_0x1f9a05,null));};exports[_0x7b00('0x58')]=function(_0x23bf87,_0x4e663b,_0x10e6f0){var _0x70ef93;var _0x566c8a='';var _0x49edfc=_0x7b00('0x59');return db[_0x7b00('0x3f')]['findOne']({'where':{'id':_0x23bf87[_0x7b00('0x4b')]['id']},'attributes':['id',_0x7b00('0x5a'),_0x7b00('0x5b'),_0x7b00('0x5c'),_0x7b00('0x5d'),_0x7b00('0x5e'),'securityToken']})[_0x7b00('0x27')](handleEntityNotFound(_0x4e663b,null))[_0x7b00('0x27')](function(_0x598f3b){if(_0x598f3b){_0x566c8a=_0x598f3b[_0x7b00('0x5a')];var _0x114ad8=_0x566c8a[_0x7b00('0x5f')](-0x1);if(_0x114ad8==='/'){_0x566c8a=_0x566c8a[_0x7b00('0x60')](0x0,_0x566c8a[_0x7b00('0x61')](_0x114ad8));}_0x70ef93=new jsforce[(_0x7b00('0x62'))]({'oauth2':{'loginUrl':_0x566c8a,'clientId':_0x598f3b[_0x7b00('0x5b')],'clientSecret':_0x598f3b['clientSecret']}});return _0x70ef93[_0x7b00('0x63')](_0x598f3b[_0x7b00('0x5d')],_0x598f3b[_0x7b00('0x5e')][_0x7b00('0x64')](_0x598f3b[_0x7b00('0x65')]));}})[_0x7b00('0x27')](function(_0x19c67f){if(_0x19c67f){if(!_[_0x7b00('0x66')](_0x23bf87[_0x7b00('0x33')][_0x7b00('0x67')])){_0x49edfc=_0x23bf87[_0x7b00('0x33')][_0x7b00('0x67')];}return _0x70ef93['sobject'](_0x49edfc)[_0x7b00('0x68')]();}})[_0x7b00('0x27')](function(_0x2ae9c2){var _0x218520=[_0x7b00('0x69'),'ActivityDate','IsReminderSet',_0x7b00('0x6a'),_0x7b00('0x6b'),'Description'];var _0x28e0e7=['string','int',_0x7b00('0x6c'),_0x7b00('0x6d'),_0x7b00('0x6e'),_0x7b00('0x6f'),_0x7b00('0x70')];if(_0x2ae9c2){_['remove'](_0x2ae9c2[_0x7b00('0x46')],function(_0x44c9ee){return _0x218520[_0x7b00('0x71')](_0x44c9ee[_0x7b00('0x2b')])||!_0x28e0e7[_0x7b00('0x71')](_0x44c9ee[_0x7b00('0x30')]);});return{'count':_0x2ae9c2[_0x7b00('0x46')][_0x7b00('0x37')],'rows':_[_0x7b00('0x2e')](_0x2ae9c2[_0x7b00('0x46')],function(_0x5050b9){return{'id':_0x5050b9['name'],'name':_0x5050b9[_0x7b00('0x72')],'custom':_0x5050b9['custom'],'options':_0x5050b9[_0x7b00('0x73')][_0x7b00('0x37')]>0x0?_[_0x7b00('0x2e')](_0x5050b9[_0x7b00('0x73')],function(_0x3d8b94){return{'name':_0x3d8b94[_0x7b00('0x72')],'value':_0x3d8b94[_0x7b00('0x74')]};}):_0x5050b9['type']==_0x7b00('0x6d')?[{'name':_0x7b00('0x75'),'value':_0x7b00('0x76')},{'name':'False','value':_0x7b00('0x77')}]:[]};})};}})[_0x7b00('0x27')](respondWithResult(_0x4e663b,null))[_0x7b00('0x42')](function(_0x2a61f9){var _0x4d077b=_0x23bf87['query'][_0x7b00('0x78')]?0x1f4:_0x2a61f9[_0x7b00('0x79')]||0x1f4;logger[_0x7b00('0x29')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x4d077b,JSON[_0x7b00('0x7a')](_0x2a61f9));delete _0x2a61f9[_0x7b00('0x2b')];if(_0x4d077b===0x191){_0x4d077b=0x190;}_0x4e663b['status'](_0x4d077b)['send'](_0x23bf87['query'][_0x7b00('0x78')]?{'message':_0x7b00('0x7b'),'statusCode':_0x2a61f9['statusCode']}:_0x2a61f9);});};
\ No newline at end of file
+var _0xe341=['order','getConfigurations','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','SalesforceField','getFields','remoteUri','clientId','clientSecret','username','substring','login','password','concat','securityToken','isNil','ticketType','sobject','describe','ActivityDate','IsRecurrence','Subject','string','int','picklist','email','textarea','phone','remove','includes','label','custom','picklistValues','map','value','boolean','True','true','False','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','status','error','stack','name','send','SalesforceAccount','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','rows','catch','params','rawAttributes','include','find','create','body','destroy','findOne','SalesforceConfiguration'];(function(_0x325501,_0x5242f6){var _0x2c1626=function(_0x4270b2){while(--_0x4270b2){_0x325501['push'](_0x325501['shift']());}};_0x2c1626(++_0x5242f6);}(_0xe341,0x18c));var _0x1e34=function(_0x192a5a,_0x1a4bfc){_0x192a5a=_0x192a5a-0x0;var _0x16d5b1=_0xe341[_0x192a5a];return _0x16d5b1;};'use strict';var emlformat=require(_0x1e34('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1e34('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1e34('0x2'));var moment=require(_0x1e34('0x3'));var BPromise=require(_0x1e34('0x4'));var Mustache=require(_0x1e34('0x5'));var util=require('util');var path=require(_0x1e34('0x6'));var sox=require('sox');var csv=require(_0x1e34('0x7'));var ejs=require(_0x1e34('0x8'));var fs=require('fs');var fs_extra=require(_0x1e34('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1e34('0xa'));var jsforce=require(_0x1e34('0xb'));var deskjs=require(_0x1e34('0xc'));var toCsv=require(_0x1e34('0x7'));var querystring=require('querystring');var Papa=require(_0x1e34('0xd'));var Redis=require('ioredis');var authService=require(_0x1e34('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x1e34('0xf'));var hardwareService=require(_0x1e34('0x10'));var logger=require(_0x1e34('0x11'))(_0x1e34('0x12'));var utils=require(_0x1e34('0x13'));var config=require(_0x1e34('0x14'));var licenseUtil=require(_0x1e34('0x15'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x478e01,_0x5316b8){_0x5316b8=_0x5316b8||0xcc;return function(_0x4908a8){if(_0x4908a8){return _0x478e01[_0x1e34('0x16')](_0x5316b8);}return _0x478e01['status'](_0x5316b8)[_0x1e34('0x17')]();};}function respondWithResult(_0x2e31ed,_0x962785){_0x962785=_0x962785||0xc8;return function(_0xe11e3){if(_0xe11e3){return _0x2e31ed['status'](_0x962785)[_0x1e34('0x18')](_0xe11e3);}};}function respondWithFilteredResult(_0x247402,_0x44b694){return function(_0x1e7373){if(_0x1e7373){var _0x190896=typeof _0x44b694[_0x1e34('0x19')]==='undefined'&&typeof _0x44b694['limit']===_0x1e34('0x1a');var _0x283e38=_0x1e7373[_0x1e34('0x1b')];var _0x4b8e74=_0x190896?0x0:_0x44b694['offset'];var _0x1cef5d=_0x190896?_0x1e7373[_0x1e34('0x1b')]:_0x44b694[_0x1e34('0x19')]+_0x44b694[_0x1e34('0x1c')];var _0x12b15b;if(_0x1cef5d>=_0x283e38){_0x1cef5d=_0x283e38;_0x12b15b=0xc8;}else{_0x12b15b=0xce;}_0x247402['status'](_0x12b15b);return _0x247402[_0x1e34('0x1d')](_0x1e34('0x1e'),_0x4b8e74+'-'+_0x1cef5d+'/'+_0x283e38)[_0x1e34('0x18')](_0x1e7373);}return null;};}function patchUpdates(_0x12aab0){return function(_0x52cb38){try{jsonpatch[_0x1e34('0x1f')](_0x52cb38,_0x12aab0,!![]);}catch(_0x30c0be){return BPromise['reject'](_0x30c0be);}return _0x52cb38[_0x1e34('0x20')]();};}function saveUpdates(_0x1c2b83,_0x37f0c8){return function(_0x2d13a4){if(_0x2d13a4){return _0x2d13a4[_0x1e34('0x21')](_0x1c2b83)[_0x1e34('0x22')](function(_0x2a4601){return _0x2a4601;});}return null;};}function removeEntity(_0x17062a,_0x1763f4){return function(_0x41846e){if(_0x41846e){return _0x41846e['destroy']()[_0x1e34('0x22')](function(){_0x17062a[_0x1e34('0x23')](0xcc)[_0x1e34('0x17')]();});}};}function handleEntityNotFound(_0x204e58,_0x1aab86){return function(_0x352d17){if(!_0x352d17){_0x204e58[_0x1e34('0x16')](0x194);}return _0x352d17;};}function handleError(_0x502f6c,_0x12abff){_0x12abff=_0x12abff||0x1f4;return function(_0x3bcc8b){logger[_0x1e34('0x24')](_0x3bcc8b[_0x1e34('0x25')]);if(_0x3bcc8b[_0x1e34('0x26')]){delete _0x3bcc8b[_0x1e34('0x26')];}_0x502f6c['status'](_0x12abff)[_0x1e34('0x27')](_0x3bcc8b);};}exports['index']=function(_0x3c3c17,_0x1dedcc){var _0xc4bd60={},_0x1bb972={},_0x941c6c={'count':0x0,'rows':[]};var _0x5ae9a3=_['map'](db[_0x1e34('0x28')]['rawAttributes'],function(_0x2224e5){return{'name':_0x2224e5[_0x1e34('0x29')],'type':_0x2224e5[_0x1e34('0x2a')][_0x1e34('0x2b')]};});_0x1bb972[_0x1e34('0x2c')]=_['map'](_0x5ae9a3,_0x1e34('0x26'));_0x1bb972[_0x1e34('0x2d')]=_[_0x1e34('0x2e')](_0x3c3c17[_0x1e34('0x2d')]);_0x1bb972[_0x1e34('0x2f')]=_['intersection'](_0x1bb972['model'],_0x1bb972[_0x1e34('0x2d')]);_0xc4bd60['attributes']=_[_0x1e34('0x30')](_0x1bb972[_0x1e34('0x2c')],qs[_0x1e34('0x31')](_0x3c3c17[_0x1e34('0x2d')][_0x1e34('0x31')]));_0xc4bd60['attributes']=_0xc4bd60[_0x1e34('0x32')][_0x1e34('0x33')]?_0xc4bd60['attributes']:_0x1bb972[_0x1e34('0x2c')];if(!_0x3c3c17[_0x1e34('0x2d')][_0x1e34('0x34')](_0x1e34('0x35'))){_0xc4bd60['limit']=qs[_0x1e34('0x1c')](_0x3c3c17[_0x1e34('0x2d')]['limit']);_0xc4bd60[_0x1e34('0x19')]=qs['offset'](_0x3c3c17[_0x1e34('0x2d')][_0x1e34('0x19')]);}_0xc4bd60['order']=qs[_0x1e34('0x36')](_0x3c3c17[_0x1e34('0x2d')][_0x1e34('0x36')]);_0xc4bd60['where']=qs[_0x1e34('0x2f')](_[_0x1e34('0x37')](_0x3c3c17[_0x1e34('0x2d')],_0x1bb972['filters']),_0x5ae9a3);if(_0x3c3c17[_0x1e34('0x2d')][_0x1e34('0x38')]){_0xc4bd60[_0x1e34('0x39')]=_['merge'](_0xc4bd60['where'],{'$or':_['map'](_0x5ae9a3,function(_0x4ccead){if(_0x4ccead[_0x1e34('0x2a')]!==_0x1e34('0x3a')){var _0x45b2d1={};_0x45b2d1[_0x4ccead[_0x1e34('0x26')]]={'$like':'%'+_0x3c3c17[_0x1e34('0x2d')][_0x1e34('0x38')]+'%'};return _0x45b2d1;}})});}_0xc4bd60=_[_0x1e34('0x3b')]({},_0xc4bd60,_0x3c3c17[_0x1e34('0x3c')]);var _0x51d0cb={'where':_0xc4bd60[_0x1e34('0x39')]};return db[_0x1e34('0x28')][_0x1e34('0x1b')](_0x51d0cb)[_0x1e34('0x22')](function(_0x16b953){_0x941c6c[_0x1e34('0x1b')]=_0x16b953;if(_0x3c3c17[_0x1e34('0x2d')]['includeAll']){_0xc4bd60['include']=[{'all':!![]}];}return db[_0x1e34('0x28')]['findAll'](_0xc4bd60);})[_0x1e34('0x22')](function(_0x58c270){_0x941c6c[_0x1e34('0x3d')]=_0x58c270;return _0x941c6c;})[_0x1e34('0x22')](respondWithFilteredResult(_0x1dedcc,_0xc4bd60))[_0x1e34('0x3e')](handleError(_0x1dedcc,null));};exports['show']=function(_0x535f5f,_0x4bbe27){var _0x4f758f={'raw':![],'where':{'id':_0x535f5f[_0x1e34('0x3f')]['id']}},_0x585c8e={};_0x585c8e[_0x1e34('0x2c')]=_[_0x1e34('0x2e')](db['SalesforceAccount'][_0x1e34('0x40')]);_0x585c8e['query']=_['keys'](_0x535f5f[_0x1e34('0x2d')]);_0x585c8e[_0x1e34('0x2f')]=_[_0x1e34('0x30')](_0x585c8e[_0x1e34('0x2c')],_0x585c8e[_0x1e34('0x2d')]);_0x4f758f[_0x1e34('0x32')]=_['intersection'](_0x585c8e[_0x1e34('0x2c')],qs['fields'](_0x535f5f[_0x1e34('0x2d')]['fields']));_0x4f758f[_0x1e34('0x32')]=_0x4f758f[_0x1e34('0x32')][_0x1e34('0x33')]?_0x4f758f[_0x1e34('0x32')]:_0x585c8e['model'];if(_0x535f5f[_0x1e34('0x2d')]['includeAll']){_0x4f758f[_0x1e34('0x41')]=[{'all':!![]}];}_0x4f758f=_[_0x1e34('0x3b')]({},_0x4f758f,_0x535f5f['options']);return db['SalesforceAccount'][_0x1e34('0x42')](_0x4f758f)[_0x1e34('0x22')](handleEntityNotFound(_0x4bbe27,null))['then'](respondWithResult(_0x4bbe27,null))[_0x1e34('0x3e')](handleError(_0x4bbe27,null));};exports['create']=function(_0x4bae55,_0x1d241c){return db['SalesforceAccount'][_0x1e34('0x43')](_0x4bae55['body'],{})[_0x1e34('0x22')](respondWithResult(_0x1d241c,0xc9))['catch'](handleError(_0x1d241c,null));};exports[_0x1e34('0x21')]=function(_0x360d43,_0x1ce4c4){if(_0x360d43['body']['id']){delete _0x360d43[_0x1e34('0x44')]['id'];}return db[_0x1e34('0x28')]['find']({'where':{'id':_0x360d43[_0x1e34('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1ce4c4,null))[_0x1e34('0x22')](saveUpdates(_0x360d43['body'],null))['then'](respondWithResult(_0x1ce4c4,null))[_0x1e34('0x3e')](handleError(_0x1ce4c4,null));};exports[_0x1e34('0x45')]=function(_0x5cb858,_0x41272a){return db['SalesforceAccount'][_0x1e34('0x42')]({'where':{'id':_0x5cb858['params']['id']}})[_0x1e34('0x22')](handleEntityNotFound(_0x41272a,null))[_0x1e34('0x22')](removeEntity(_0x41272a,null))[_0x1e34('0x3e')](handleError(_0x41272a,null));};exports['getConfigurations']=function(_0x21e8a2,_0x98dcb3,_0x392633){var _0xe06a47={};var _0x517aba={};var _0x29ae09;var _0x51a3bb;return db[_0x1e34('0x28')][_0x1e34('0x46')]({'where':{'id':_0x21e8a2[_0x1e34('0x3f')]['id']}})[_0x1e34('0x22')](handleEntityNotFound(_0x98dcb3,null))[_0x1e34('0x22')](function(_0x2445a8){if(_0x2445a8){_0x29ae09=_0x2445a8;_0x517aba['model']=_[_0x1e34('0x2e')](db[_0x1e34('0x47')][_0x1e34('0x40')]);_0x517aba['query']=_['keys'](_0x21e8a2[_0x1e34('0x2d')]);_0x517aba[_0x1e34('0x2f')]=_['intersection'](_0x517aba['model'],_0x517aba[_0x1e34('0x2d')]);_0xe06a47[_0x1e34('0x32')]=_[_0x1e34('0x30')](_0x517aba[_0x1e34('0x2c')],qs[_0x1e34('0x31')](_0x21e8a2[_0x1e34('0x2d')][_0x1e34('0x31')]));_0xe06a47['attributes']=_0xe06a47[_0x1e34('0x32')]['length']?_0xe06a47['attributes']:_0x517aba['model'];_0xe06a47[_0x1e34('0x48')]=qs[_0x1e34('0x36')](_0x21e8a2['query'][_0x1e34('0x36')]);_0xe06a47['where']=qs[_0x1e34('0x2f')](_['pick'](_0x21e8a2[_0x1e34('0x2d')],_0x517aba[_0x1e34('0x2f')]));if(_0x21e8a2[_0x1e34('0x2d')][_0x1e34('0x38')]){_0xe06a47['where']=_[_0x1e34('0x3b')](_0xe06a47[_0x1e34('0x39')],{'$or':_['map'](_0xe06a47['attributes'],function(_0x2adbe6){var _0x1efc4d={};_0x1efc4d[_0x2adbe6]={'$like':'%'+_0x21e8a2[_0x1e34('0x2d')][_0x1e34('0x38')]+'%'};return _0x1efc4d;})});}_0xe06a47=_[_0x1e34('0x3b')]({},_0xe06a47,_0x21e8a2[_0x1e34('0x3c')]);return _0x29ae09['getConfigurations'](_0xe06a47);}})[_0x1e34('0x22')](function(_0x31ff4e){if(_0x31ff4e){_0x51a3bb=_0x31ff4e[_0x1e34('0x33')];if(!_0x21e8a2[_0x1e34('0x2d')][_0x1e34('0x34')](_0x1e34('0x35'))){_0xe06a47['limit']=qs[_0x1e34('0x1c')](_0x21e8a2[_0x1e34('0x2d')][_0x1e34('0x1c')]);_0xe06a47[_0x1e34('0x19')]=qs[_0x1e34('0x19')](_0x21e8a2['query'][_0x1e34('0x19')]);}return _0x29ae09[_0x1e34('0x49')](_0xe06a47);}})[_0x1e34('0x22')](function(_0x20e898){if(_0x20e898){return _0x20e898?{'count':_0x51a3bb,'rows':_0x20e898}:null;}})['then'](respondWithResult(_0x98dcb3,null))[_0x1e34('0x3e')](handleError(_0x98dcb3,null));};exports['addConfiguration']=function(_0x591011,_0x2ace13,_0x3fa65c){if(_0x591011[_0x1e34('0x44')]['id']){delete _0x591011[_0x1e34('0x44')]['id'];}return db[_0x1e34('0x28')][_0x1e34('0x46')]({'where':{'id':_0x591011['params']['id']}})[_0x1e34('0x22')](handleEntityNotFound(_0x2ace13,null))[_0x1e34('0x22')](function(_0x590659){if(_0x590659){_0x591011['body'][_0x1e34('0x4a')]=_0x590659['id'];_0x591011['body'][_0x1e34('0x4b')]=integrations[_0x1e34('0x4c')](_0x591011[_0x1e34('0x44')]['channel'],_0x591011['body']['type']);_0x591011[_0x1e34('0x44')][_0x1e34('0x4d')]=integrations[_0x1e34('0x4e')](_0x591011[_0x1e34('0x44')]['channel'],_0x591011[_0x1e34('0x44')][_0x1e34('0x2a')]);return db['SalesforceConfiguration'][_0x1e34('0x43')](_0x591011['body'],{'include':[{'model':db[_0x1e34('0x4f')],'as':'Subjects'},{'model':db[_0x1e34('0x4f')],'as':_0x1e34('0x4d')}]});}return null;})[_0x1e34('0x22')](respondWithResult(_0x2ace13,null))[_0x1e34('0x3e')](handleError(_0x2ace13,null));};exports[_0x1e34('0x50')]=function(_0x1fb226,_0x520eeb,_0x2db8a7){var _0x23b104;var _0x26bf65='';var _0x5d1ecf='Task';return db[_0x1e34('0x28')]['findOne']({'where':{'id':_0x1fb226[_0x1e34('0x3f')]['id']},'attributes':['id',_0x1e34('0x51'),_0x1e34('0x52'),_0x1e34('0x53'),_0x1e34('0x54'),'password','securityToken']})['then'](handleEntityNotFound(_0x520eeb,null))['then'](function(_0x3725fe){if(_0x3725fe){_0x26bf65=_0x3725fe['remoteUri'];var _0x3857ef=_0x26bf65['slice'](-0x1);if(_0x3857ef==='/'){_0x26bf65=_0x26bf65[_0x1e34('0x55')](0x0,_0x26bf65['lastIndexOf'](_0x3857ef));}_0x23b104=new jsforce['Connection']({'oauth2':{'loginUrl':_0x26bf65,'clientId':_0x3725fe[_0x1e34('0x52')],'clientSecret':_0x3725fe[_0x1e34('0x53')]}});return _0x23b104[_0x1e34('0x56')](_0x3725fe[_0x1e34('0x54')],_0x3725fe[_0x1e34('0x57')][_0x1e34('0x58')](_0x3725fe[_0x1e34('0x59')]));}})[_0x1e34('0x22')](function(_0x189c04){if(_0x189c04){if(!_[_0x1e34('0x5a')](_0x1fb226[_0x1e34('0x2d')][_0x1e34('0x5b')])){_0x5d1ecf=_0x1fb226['query'][_0x1e34('0x5b')];}return _0x23b104[_0x1e34('0x5c')](_0x5d1ecf)[_0x1e34('0x5d')]();}})[_0x1e34('0x22')](function(_0x2ba70a){var _0x406737=['OwnerId',_0x1e34('0x5e'),'IsReminderSet',_0x1e34('0x5f'),_0x1e34('0x60'),'Description'];var _0x42a849=[_0x1e34('0x61'),_0x1e34('0x62'),_0x1e34('0x63'),'boolean',_0x1e34('0x64'),_0x1e34('0x65'),_0x1e34('0x66')];if(_0x2ba70a){_[_0x1e34('0x67')](_0x2ba70a[_0x1e34('0x31')],function(_0x5ae2bf){return _0x406737[_0x1e34('0x68')](_0x5ae2bf['name'])||!_0x42a849['includes'](_0x5ae2bf[_0x1e34('0x2a')]);});return{'count':_0x2ba70a[_0x1e34('0x31')][_0x1e34('0x33')],'rows':_['map'](_0x2ba70a[_0x1e34('0x31')],function(_0x4699b7){return{'id':_0x4699b7['name'],'name':_0x4699b7[_0x1e34('0x69')],'custom':_0x4699b7[_0x1e34('0x6a')],'options':_0x4699b7[_0x1e34('0x6b')][_0x1e34('0x33')]>0x0?_[_0x1e34('0x6c')](_0x4699b7[_0x1e34('0x6b')],function(_0x3a1b4d){return{'name':_0x3a1b4d[_0x1e34('0x69')],'value':_0x3a1b4d[_0x1e34('0x6d')]};}):_0x4699b7[_0x1e34('0x2a')]==_0x1e34('0x6e')?[{'name':_0x1e34('0x6f'),'value':_0x1e34('0x70')},{'name':_0x1e34('0x71'),'value':'false'}]:[]};})};}})[_0x1e34('0x22')](respondWithResult(_0x520eeb,null))[_0x1e34('0x3e')](function(_0x3bd261){var _0x341a6b=_0x1fb226[_0x1e34('0x2d')][_0x1e34('0x72')]?0x1f4:_0x3bd261['statusCode']||0x1f4;logger[_0x1e34('0x24')](_0x1e34('0x73'),_0x1e34('0x50'),_0x341a6b,JSON['stringify'](_0x3bd261));delete _0x3bd261[_0x1e34('0x26')];if(_0x341a6b===0x191){_0x341a6b=0x190;}_0x520eeb[_0x1e34('0x23')](_0x341a6b)['send'](_0x1fb226[_0x1e34('0x2d')][_0x1e34('0x72')]?{'message':_0x1e34('0x74'),'statusCode':_0x3bd261['statusCode']}:_0x3bd261);});};
\ No newline at end of file
index 18ec690..586f747 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x930e=['./intSalesforceAccount.attributes','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x223033,_0x51b86b){var _0x116577=function(_0x57bd62){while(--_0x57bd62){_0x223033['push'](_0x223033['shift']());}};_0x116577(++_0x51b86b);}(_0x930e,0x185));var _0xe930=function(_0x56d81f,_0x519a2e){_0x56d81f=_0x56d81f-0x0;var _0xf8a9dc=_0x930e[_0x56d81f];return _0xf8a9dc;};'use strict';var _=require(_0xe930('0x0'));var util=require('util');var logger=require(_0xe930('0x1'))('api');var moment=require(_0xe930('0x2'));var BPromise=require(_0xe930('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe930('0x4'));var rimraf=require(_0xe930('0x5'));var config=require(_0xe930('0x6'));var attributes=require(_0xe930('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xe930('0x8')]=function(_0xd4d873,_0x416c63){return _0xd4d873[_0xe930('0x9')](_0xe930('0xa'),attributes,{'tableName':_0xe930('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5620=['define','SalesforceAccount','lodash','../../config/logger','api','path','../../config/environment','../../components/integrations/configuration','exports'];(function(_0x6bf9f6,_0x33fcc0){var _0x5bc37e=function(_0x5910fd){while(--_0x5910fd){_0x6bf9f6['push'](_0x6bf9f6['shift']());}};_0x5bc37e(++_0x33fcc0);}(_0x5620,0xbf));var _0x0562=function(_0x533381,_0x8a69fa){_0x533381=_0x533381-0x0;var _0x2877ed=_0x5620[_0x533381];return _0x2877ed;};'use strict';var _=require(_0x0562('0x0'));var util=require('util');var logger=require(_0x0562('0x1'))(_0x0562('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0562('0x3'));var rimraf=require('rimraf');var config=require(_0x0562('0x4'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x0562('0x5'));module[_0x0562('0x6')]=function(_0x4155b9,_0x24b8d1){return _0x4155b9[_0x0562('0x7')](_0x0562('0x8'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 905c876..4f66d74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x001e=['http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','map','include','model','attributes','catch','ShowSalesforceAccount','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x627656,_0x222672){var _0x385571=function(_0xc95ee6){while(--_0xc95ee6){_0x627656['push'](_0x627656['shift']());}};_0x385571(++_0x222672);}(_0x001e,0x1b1));var _0xe001=function(_0x1ce65b,_0x1a8a61){_0x1ce65b=_0x1ce65b-0x0;var _0x49554d=_0x001e[_0x1ce65b];return _0x49554d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe001('0x0'));var BPromise=require(_0xe001('0x1'));var rs=require(_0xe001('0x2'));var fs=require('fs');var Redis=require(_0xe001('0x3'));var db=require(_0xe001('0x4'))['db'];var utils=require(_0xe001('0x5'));var logger=require(_0xe001('0x6'))(_0xe001('0x7'));var config=require(_0xe001('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe001('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e672a,_0x512a3c,_0x16692d){return new BPromise(function(_0x1f26b0,_0xb9546a){return client[_0xe001('0xa')](_0x4e672a,_0x16692d)[_0xe001('0xb')](function(_0x3f4ccf){logger[_0xe001('0xc')](_0xe001('0xd'),_0x512a3c,_0xe001('0xe'));logger[_0xe001('0xf')](_0xe001('0x10'),_0x512a3c,_0xe001('0xe'),JSON[_0xe001('0x11')](_0x3f4ccf));if(_0x3f4ccf['error']){if(_0x3f4ccf[_0xe001('0x12')][_0xe001('0x13')]===0x1f4){logger[_0xe001('0x12')](_0xe001('0xd'),_0x512a3c,_0x3f4ccf['error'][_0xe001('0x14')]);return _0xb9546a(_0x3f4ccf[_0xe001('0x12')]['message']);}logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x512a3c,_0x3f4ccf[_0xe001('0x12')][_0xe001('0x14')]);return _0x1f26b0(_0x3f4ccf[_0xe001('0x12')][_0xe001('0x14')]);}else{logger[_0xe001('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x512a3c,'request\x20sent');_0x1f26b0(_0x3f4ccf['result'][_0xe001('0x14')]);}})['catch'](function(_0x70f26c){logger[_0xe001('0x12')](_0xe001('0xd'),_0x512a3c,_0x70f26c);_0xb9546a(_0x70f26c);});});}exports[_0xe001('0x15')]=function(_0x272517){var _0x2c40d2=this;return new Promise(function(_0x33fac4,_0x19ea36){return db[_0xe001('0x16')][_0xe001('0x17')]({'raw':_0x272517[_0xe001('0x18')]?_0x272517[_0xe001('0x18')][_0xe001('0x19')]===undefined?!![]:![]:!![],'where':_0x272517[_0xe001('0x18')]?_0x272517[_0xe001('0x18')][_0xe001('0x1a')]||null:null,'attributes':_0x272517[_0xe001('0x18')]?_0x272517[_0xe001('0x18')]['attributes']||null:null,'limit':_0x272517[_0xe001('0x18')]?_0x272517[_0xe001('0x18')]['limit']||null:null,'include':_0x272517[_0xe001('0x18')]?_0x272517[_0xe001('0x18')]['include']?_[_0xe001('0x1b')](_0x272517[_0xe001('0x18')][_0xe001('0x1c')],function(_0xf2a0bf){return{'model':db[_0xf2a0bf[_0xe001('0x1d')]],'as':_0xf2a0bf['as'],'attributes':_0xf2a0bf[_0xe001('0x1e')],'include':_0xf2a0bf[_0xe001('0x1c')]?_['map'](_0xf2a0bf[_0xe001('0x1c')],function(_0x1971e){return{'model':db[_0x1971e[_0xe001('0x1d')]],'as':_0x1971e['as'],'attributes':_0x1971e[_0xe001('0x1e')],'include':_0x1971e[_0xe001('0x1c')]?_['map'](_0x1971e[_0xe001('0x1c')],function(_0xdb516){return{'model':db[_0xdb516[_0xe001('0x1d')]],'as':_0xdb516['as'],'attributes':_0xdb516[_0xe001('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x40c85d){logger[_0xe001('0xc')](_0xe001('0x15'),_0x272517);logger[_0xe001('0xf')](_0xe001('0x15'),_0x272517,JSON[_0xe001('0x11')](_0x40c85d));_0x33fac4(_0x40c85d);})[_0xe001('0x1f')](function(_0x238b36){logger[_0xe001('0x12')](_0xe001('0x15'),_0x238b36['message'],_0x272517);_0x19ea36(_0x2c40d2[_0xe001('0x12')](0x1f4,_0x238b36[_0xe001('0x14')]));});});};exports[_0xe001('0x20')]=function(_0x1e84d5){var _0xaa33bc=this;return new Promise(function(_0x5c714e,_0x513caf){return db[_0xe001('0x16')][_0xe001('0x21')]({'raw':_0x1e84d5[_0xe001('0x18')]?_0x1e84d5[_0xe001('0x18')][_0xe001('0x19')]===undefined?!![]:![]:!![],'where':_0x1e84d5[_0xe001('0x18')]?_0x1e84d5[_0xe001('0x18')][_0xe001('0x1a')]||null:null,'attributes':_0x1e84d5[_0xe001('0x18')]?_0x1e84d5[_0xe001('0x18')][_0xe001('0x1e')]||null:null,'include':_0x1e84d5[_0xe001('0x18')]?_0x1e84d5['options']['include']?_[_0xe001('0x1b')](_0x1e84d5[_0xe001('0x18')][_0xe001('0x1c')],function(_0x2fdadc){return{'model':db[_0x2fdadc['model']],'as':_0x2fdadc['as'],'attributes':_0x2fdadc[_0xe001('0x1e')],'include':_0x2fdadc[_0xe001('0x1c')]?_[_0xe001('0x1b')](_0x2fdadc[_0xe001('0x1c')],function(_0x296367){return{'model':db[_0x296367[_0xe001('0x1d')]],'as':_0x296367['as'],'attributes':_0x296367['attributes'],'include':_0x296367[_0xe001('0x1c')]?_[_0xe001('0x1b')](_0x296367['include'],function(_0x4187da){return{'model':db[_0x4187da[_0xe001('0x1d')]],'as':_0x4187da['as'],'attributes':_0x4187da['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b7400){logger['info']('ShowSalesforceAccount',_0x1e84d5);logger['debug'](_0xe001('0x20'),_0x1e84d5,JSON[_0xe001('0x11')](_0x1b7400));_0x5c714e(_0x1b7400);})[_0xe001('0x1f')](function(_0x57356d){logger[_0xe001('0x12')](_0xe001('0x20'),_0x57356d['message'],_0x1e84d5);_0x513caf(_0xaa33bc[_0xe001('0x12')](0x1f4,_0x57356d[_0xe001('0x14')]));});});};
\ No newline at end of file
+var _0x4890=['findAll','options','where','attributes','limit','map','include','model','GetSalesforceAccount','stringify','ShowSalesforceAccount','find','raw','lodash','util','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','http','then','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','SalesforceAccount,\x20%s,\x20%s','message','info','result','catch','SalesforceAccount'];(function(_0x2c7b28,_0x146b28){var _0x888d18=function(_0x4e9843){while(--_0x4e9843){_0x2c7b28['push'](_0x2c7b28['shift']());}};_0x888d18(++_0x146b28);}(_0x4890,0x157));var _0x0489=function(_0x3e25c1,_0x1d15f9){_0x3e25c1=_0x3e25c1-0x0;var _0x52e7f2=_0x4890[_0x3e25c1];return _0x52e7f2;};'use strict';var _=require(_0x0489('0x0'));var util=require(_0x0489('0x1'));var moment=require('moment');var BPromise=require(_0x0489('0x2'));var rs=require(_0x0489('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0489('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0489('0x5'));var config=require(_0x0489('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0489('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5ad03d,_0x4f0d92,_0x5d0e19){return new BPromise(function(_0x38148d,_0x18926d){return client['request'](_0x5ad03d,_0x5d0e19)[_0x0489('0x8')](function(_0x391f8a){logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x4f0d92,_0x0489('0x9'));logger[_0x0489('0xa')](_0x0489('0xb'),_0x4f0d92,_0x0489('0x9'),JSON['stringify'](_0x391f8a));if(_0x391f8a[_0x0489('0xc')]){if(_0x391f8a[_0x0489('0xc')][_0x0489('0xd')]===0x1f4){logger['error'](_0x0489('0xe'),_0x4f0d92,_0x391f8a['error'][_0x0489('0xf')]);return _0x18926d(_0x391f8a[_0x0489('0xc')][_0x0489('0xf')]);}logger[_0x0489('0xc')](_0x0489('0xe'),_0x4f0d92,_0x391f8a[_0x0489('0xc')][_0x0489('0xf')]);return _0x38148d(_0x391f8a[_0x0489('0xc')]['message']);}else{logger[_0x0489('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x4f0d92,'request\x20sent');_0x38148d(_0x391f8a[_0x0489('0x11')][_0x0489('0xf')]);}})[_0x0489('0x12')](function(_0x463d22){logger[_0x0489('0xc')](_0x0489('0xe'),_0x4f0d92,_0x463d22);_0x18926d(_0x463d22);});});}exports['GetSalesforceAccount']=function(_0x406ba5){var _0x36ec98=this;return new Promise(function(_0xd1db1,_0x2ce9bc){return db[_0x0489('0x13')][_0x0489('0x14')]({'raw':_0x406ba5[_0x0489('0x15')]?_0x406ba5[_0x0489('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x406ba5['options']?_0x406ba5[_0x0489('0x15')][_0x0489('0x16')]||null:null,'attributes':_0x406ba5[_0x0489('0x15')]?_0x406ba5['options'][_0x0489('0x17')]||null:null,'limit':_0x406ba5[_0x0489('0x15')]?_0x406ba5[_0x0489('0x15')][_0x0489('0x18')]||null:null,'include':_0x406ba5['options']?_0x406ba5[_0x0489('0x15')]['include']?_[_0x0489('0x19')](_0x406ba5[_0x0489('0x15')][_0x0489('0x1a')],function(_0x1ba0ff){return{'model':db[_0x1ba0ff[_0x0489('0x1b')]],'as':_0x1ba0ff['as'],'attributes':_0x1ba0ff[_0x0489('0x17')],'include':_0x1ba0ff[_0x0489('0x1a')]?_[_0x0489('0x19')](_0x1ba0ff[_0x0489('0x1a')],function(_0x24b956){return{'model':db[_0x24b956['model']],'as':_0x24b956['as'],'attributes':_0x24b956[_0x0489('0x17')],'include':_0x24b956[_0x0489('0x1a')]?_[_0x0489('0x19')](_0x24b956[_0x0489('0x1a')],function(_0x29f8bb){return{'model':db[_0x29f8bb[_0x0489('0x1b')]],'as':_0x29f8bb['as'],'attributes':_0x29f8bb['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x66ad20){logger[_0x0489('0x10')](_0x0489('0x1c'),_0x406ba5);logger[_0x0489('0xa')]('GetSalesforceAccount',_0x406ba5,JSON[_0x0489('0x1d')](_0x66ad20));_0xd1db1(_0x66ad20);})[_0x0489('0x12')](function(_0x5a7f99){logger['error'](_0x0489('0x1c'),_0x5a7f99['message'],_0x406ba5);_0x2ce9bc(_0x36ec98[_0x0489('0xc')](0x1f4,_0x5a7f99[_0x0489('0xf')]));});});};exports[_0x0489('0x1e')]=function(_0x3df6bd){var _0x1669ae=this;return new Promise(function(_0x5ddc11,_0x35abbc){return db['SalesforceAccount'][_0x0489('0x1f')]({'raw':_0x3df6bd[_0x0489('0x15')]?_0x3df6bd[_0x0489('0x15')][_0x0489('0x20')]===undefined?!![]:![]:!![],'where':_0x3df6bd[_0x0489('0x15')]?_0x3df6bd[_0x0489('0x15')][_0x0489('0x16')]||null:null,'attributes':_0x3df6bd[_0x0489('0x15')]?_0x3df6bd['options']['attributes']||null:null,'include':_0x3df6bd[_0x0489('0x15')]?_0x3df6bd[_0x0489('0x15')][_0x0489('0x1a')]?_[_0x0489('0x19')](_0x3df6bd[_0x0489('0x15')]['include'],function(_0x44ada5){return{'model':db[_0x44ada5[_0x0489('0x1b')]],'as':_0x44ada5['as'],'attributes':_0x44ada5[_0x0489('0x17')],'include':_0x44ada5['include']?_[_0x0489('0x19')](_0x44ada5[_0x0489('0x1a')],function(_0x2f73a4){return{'model':db[_0x2f73a4['model']],'as':_0x2f73a4['as'],'attributes':_0x2f73a4[_0x0489('0x17')],'include':_0x2f73a4['include']?_['map'](_0x2f73a4[_0x0489('0x1a')],function(_0x471a38){return{'model':db[_0x471a38[_0x0489('0x1b')]],'as':_0x471a38['as'],'attributes':_0x471a38['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xc0f1fe){logger[_0x0489('0x10')](_0x0489('0x1e'),_0x3df6bd);logger['debug'](_0x0489('0x1e'),_0x3df6bd,JSON[_0x0489('0x1d')](_0xc0f1fe));_0x5ddc11(_0xc0f1fe);})[_0x0489('0x12')](function(_0x546897){logger['error'](_0x0489('0x1e'),_0x546897[_0x0489('0xf')],_0x3df6bd);_0x35abbc(_0x1669ae[_0x0489('0xc')](0x1f4,_0x546897['message']));});});};
\ No newline at end of file
index c6eb3f5..299cc42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2032=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','exports','util','path','connect-timeout'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2032,0xd9));var _0x2203=function(_0x3cd7c6,_0x5d985e){_0x3cd7c6=_0x3cd7c6-0x0;var _0x3b501a=_0x2032[_0x3cd7c6];return _0x3b501a;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['get'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router['get'](_0x2203('0x10'),auth['isAuthenticated'](),controller[_0x2203('0x11')]);router['post']('/',auth[_0x2203('0x9')](),controller[_0x2203('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x2203('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x2203('0x13')]=router;
\ No newline at end of file
+var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xdb28,0x106));var _0x8db2=function(_0xce6daf,_0x443cb1){_0xce6daf=_0xce6daf-0x0;var _0x40e38b=_0xdb28[_0xce6daf];return _0x40e38b;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router;
\ No newline at end of file
index 63ca2b5..b9f3c88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d30=['nothing','sequelize','exports','STRING','Task','Case','ENUM','contact','lead','account','contact_lead'];(function(_0x554975,_0x4ddc6c){var _0x70a8e9=function(_0x37f5e6){while(--_0x37f5e6){_0x554975['push'](_0x554975['shift']());}};_0x70a8e9(++_0x4ddc6c);}(_0x4d30,0x1da));var _0x04d3=function(_0x3bd474,_0x4caaad){_0x3bd474=_0x3bd474-0x0;var _0x4bfaf3=_0x4d30[_0x3bd474];return _0x4bfaf3;};'use strict';var Sequelize=require(_0x04d3('0x0'));module[_0x04d3('0x1')]={'name':{'type':Sequelize[_0x04d3('0x2')]},'description':{'type':Sequelize[_0x04d3('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x04d3('0x3'),_0x04d3('0x4')),'defaultValue':_0x04d3('0x3')},'moduleSearch':{'type':Sequelize[_0x04d3('0x5')]('contact_lead',_0x04d3('0x6'),_0x04d3('0x7'),'account_contact_lead',_0x04d3('0x8')),'defaultValue':_0x04d3('0x9')},'moduleCreate':{'type':Sequelize[_0x04d3('0x5')](_0x04d3('0xa'),_0x04d3('0x6'),_0x04d3('0x7'),_0x04d3('0x8')),'defaultValue':_0x04d3('0x7')},'leadId':{'type':Sequelize[_0x04d3('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x04d3('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x04d3('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x04d3('0x2')]}};
\ No newline at end of file
+var _0x4d4b=['contact','lead','account_contact_lead','account','nothing','STRING','ENUM','Task','Case','contact_lead'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x4d4b,0xf5));var _0xb4d4=function(_0x57d22c,_0x317c8c){_0x57d22c=_0x57d22c-0x0;var _0x44a9b2=_0x4d4b[_0x57d22c];return _0x44a9b2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb4d4('0x0')]},'description':{'type':Sequelize[_0xb4d4('0x0')]},'ticketType':{'type':Sequelize[_0xb4d4('0x1')](_0xb4d4('0x2'),_0xb4d4('0x3')),'defaultValue':_0xb4d4('0x2')},'moduleSearch':{'type':Sequelize[_0xb4d4('0x1')](_0xb4d4('0x4'),_0xb4d4('0x5'),_0xb4d4('0x6'),_0xb4d4('0x7'),_0xb4d4('0x8')),'defaultValue':_0xb4d4('0x4')},'moduleCreate':{'type':Sequelize[_0xb4d4('0x1')](_0xb4d4('0x9'),_0xb4d4('0x5'),'lead',_0xb4d4('0x8')),'defaultValue':_0xb4d4('0x6')},'leadId':{'type':Sequelize[_0xb4d4('0x0')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0xb4d4('0x0')]}};
\ No newline at end of file
index 27c4296..d676dac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61c8=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','options','include','findAll','catch','show','params','includeAll','find','create','body','findOne','SalesforceField','getFields','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','count','status','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','SalesforceConfiguration','rawAttributes'];(function(_0x1d5ba8,_0x412a52){var _0x1022a2=function(_0x187f11){while(--_0x187f11){_0x1d5ba8['push'](_0x1d5ba8['shift']());}};_0x1022a2(++_0x412a52);}(_0x61c8,0x199));var _0x861c=function(_0x22491d,_0x3bad40){_0x22491d=_0x22491d-0x0;var _0x431173=_0x61c8[_0x22491d];return _0x431173;};'use strict';var emlformat=require(_0x861c('0x0'));var rimraf=require(_0x861c('0x1'));var zipdir=require(_0x861c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x861c('0x3'));var BPromise=require(_0x861c('0x4'));var Mustache=require(_0x861c('0x5'));var util=require(_0x861c('0x6'));var path=require(_0x861c('0x7'));var sox=require('sox');var csv=require(_0x861c('0x8'));var ejs=require(_0x861c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x861c('0xa'));var squel=require(_0x861c('0xb'));var crypto=require('crypto');var jsforce=require(_0x861c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x861c('0x8'));var querystring=require(_0x861c('0xd'));var Papa=require('papaparse');var Redis=require(_0x861c('0xe'));var authService=require(_0x861c('0xf'));var qs=require(_0x861c('0x10'));var as=require(_0x861c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x861c('0x12'));var licenseUtil=require(_0x861c('0x13'));var db=require(_0x861c('0x14'))['db'];function respondWithStatusCode(_0x2a7e22,_0x24b456){_0x24b456=_0x24b456||0xcc;return function(_0x59dbb6){if(_0x59dbb6){return _0x2a7e22['sendStatus'](_0x24b456);}return _0x2a7e22['status'](_0x24b456)[_0x861c('0x15')]();};}function respondWithResult(_0x3c2667,_0x142e5d){_0x142e5d=_0x142e5d||0xc8;return function(_0x6ccf72){if(_0x6ccf72){return _0x3c2667['status'](_0x142e5d)[_0x861c('0x16')](_0x6ccf72);}};}function respondWithFilteredResult(_0x216afc,_0x523a82){return function(_0x56a693){if(_0x56a693){var _0x2787ac=typeof _0x523a82[_0x861c('0x17')]===_0x861c('0x18')&&typeof _0x523a82['limit']==='undefined';var _0x590ee9=_0x56a693[_0x861c('0x19')];var _0x19c6d2=_0x2787ac?0x0:_0x523a82[_0x861c('0x17')];var _0x1cd16f=_0x2787ac?_0x56a693['count']:_0x523a82[_0x861c('0x17')]+_0x523a82['limit'];var _0x2d88a6;if(_0x1cd16f>=_0x590ee9){_0x1cd16f=_0x590ee9;_0x2d88a6=0xc8;}else{_0x2d88a6=0xce;}_0x216afc[_0x861c('0x1a')](_0x2d88a6);return _0x216afc[_0x861c('0x1b')](_0x861c('0x1c'),_0x19c6d2+'-'+_0x1cd16f+'/'+_0x590ee9)[_0x861c('0x16')](_0x56a693);}return null;};}function patchUpdates(_0x2b5500){return function(_0x105056){try{jsonpatch[_0x861c('0x1d')](_0x105056,_0x2b5500,!![]);}catch(_0x2acf77){return BPromise[_0x861c('0x1e')](_0x2acf77);}return _0x105056['save']();};}function saveUpdates(_0x486a0a,_0x4efe98){return function(_0x155d2b){if(_0x155d2b){return _0x155d2b[_0x861c('0x1f')](_0x486a0a)[_0x861c('0x20')](function(_0x503792){return _0x503792;});}return null;};}function removeEntity(_0x3636ed,_0x2cd4d0){return function(_0xd83bda){if(_0xd83bda){return _0xd83bda[_0x861c('0x21')]()[_0x861c('0x20')](function(){_0x3636ed['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e3a00,_0x429695){return function(_0x37f210){if(!_0x37f210){_0x3e3a00['sendStatus'](0x194);}return _0x37f210;};}function handleError(_0x2ae363,_0x21b778){_0x21b778=_0x21b778||0x1f4;return function(_0x383736){logger[_0x861c('0x22')](_0x383736[_0x861c('0x23')]);if(_0x383736[_0x861c('0x24')]){delete _0x383736[_0x861c('0x24')];}_0x2ae363['status'](_0x21b778)['send'](_0x383736);};}exports[_0x861c('0x25')]=function(_0x4a5a58,_0x5314b9){var _0x2ad63f={},_0x4c9e3d={},_0x3e90f0={'count':0x0,'rows':[]};var _0x3b3f69=_[_0x861c('0x26')](db[_0x861c('0x27')][_0x861c('0x28')],function(_0x4aa965){return{'name':_0x4aa965['fieldName'],'type':_0x4aa965[_0x861c('0x29')][_0x861c('0x2a')]};});_0x4c9e3d[_0x861c('0x2b')]=_[_0x861c('0x26')](_0x3b3f69,_0x861c('0x24'));_0x4c9e3d[_0x861c('0x2c')]=_[_0x861c('0x2d')](_0x4a5a58[_0x861c('0x2c')]);_0x4c9e3d[_0x861c('0x2e')]=_[_0x861c('0x2f')](_0x4c9e3d[_0x861c('0x2b')],_0x4c9e3d[_0x861c('0x2c')]);_0x2ad63f[_0x861c('0x30')]=_[_0x861c('0x2f')](_0x4c9e3d[_0x861c('0x2b')],qs['fields'](_0x4a5a58[_0x861c('0x2c')][_0x861c('0x31')]));_0x2ad63f[_0x861c('0x30')]=_0x2ad63f[_0x861c('0x30')][_0x861c('0x32')]?_0x2ad63f[_0x861c('0x30')]:_0x4c9e3d[_0x861c('0x2b')];if(!_0x4a5a58[_0x861c('0x2c')][_0x861c('0x33')]('nolimit')){_0x2ad63f[_0x861c('0x34')]=qs[_0x861c('0x34')](_0x4a5a58[_0x861c('0x2c')]['limit']);_0x2ad63f['offset']=qs[_0x861c('0x17')](_0x4a5a58[_0x861c('0x2c')][_0x861c('0x17')]);}_0x2ad63f[_0x861c('0x35')]=qs[_0x861c('0x36')](_0x4a5a58[_0x861c('0x2c')][_0x861c('0x36')]);_0x2ad63f[_0x861c('0x37')]=qs[_0x861c('0x2e')](_[_0x861c('0x38')](_0x4a5a58[_0x861c('0x2c')],_0x4c9e3d[_0x861c('0x2e')]),_0x3b3f69);if(_0x4a5a58[_0x861c('0x2c')][_0x861c('0x39')]){_0x2ad63f[_0x861c('0x37')]=_[_0x861c('0x3a')](_0x2ad63f[_0x861c('0x37')],{'$or':_['map'](_0x3b3f69,function(_0x3d74ea){if(_0x3d74ea[_0x861c('0x29')]!=='VIRTUAL'){var _0x41ea26={};_0x41ea26[_0x3d74ea[_0x861c('0x24')]]={'$like':'%'+_0x4a5a58[_0x861c('0x2c')][_0x861c('0x39')]+'%'};return _0x41ea26;}})});}_0x2ad63f=_['merge']({},_0x2ad63f,_0x4a5a58[_0x861c('0x3b')]);var _0x423492={'where':_0x2ad63f['where']};return db[_0x861c('0x27')][_0x861c('0x19')](_0x423492)[_0x861c('0x20')](function(_0x2c1eb2){_0x3e90f0[_0x861c('0x19')]=_0x2c1eb2;if(_0x4a5a58[_0x861c('0x2c')]['includeAll']){_0x2ad63f[_0x861c('0x3c')]=[{'all':!![]}];}return db[_0x861c('0x27')][_0x861c('0x3d')](_0x2ad63f);})[_0x861c('0x20')](function(_0x2fe83d){_0x3e90f0['rows']=_0x2fe83d;return _0x3e90f0;})['then'](respondWithFilteredResult(_0x5314b9,_0x2ad63f))[_0x861c('0x3e')](handleError(_0x5314b9,null));};exports[_0x861c('0x3f')]=function(_0xdcacaa,_0x337167){var _0x2a1384={'raw':![],'where':{'id':_0xdcacaa[_0x861c('0x40')]['id']}},_0x467eb5={};_0x467eb5[_0x861c('0x2b')]=_[_0x861c('0x2d')](db[_0x861c('0x27')]['rawAttributes']);_0x467eb5[_0x861c('0x2c')]=_[_0x861c('0x2d')](_0xdcacaa[_0x861c('0x2c')]);_0x467eb5['filters']=_[_0x861c('0x2f')](_0x467eb5[_0x861c('0x2b')],_0x467eb5[_0x861c('0x2c')]);_0x2a1384['attributes']=_[_0x861c('0x2f')](_0x467eb5[_0x861c('0x2b')],qs['fields'](_0xdcacaa[_0x861c('0x2c')][_0x861c('0x31')]));_0x2a1384[_0x861c('0x30')]=_0x2a1384[_0x861c('0x30')][_0x861c('0x32')]?_0x2a1384[_0x861c('0x30')]:_0x467eb5[_0x861c('0x2b')];if(_0xdcacaa[_0x861c('0x2c')][_0x861c('0x41')]){_0x2a1384['include']=[{'all':!![]}];}_0x2a1384=_['merge']({},_0x2a1384,_0xdcacaa[_0x861c('0x3b')]);return db['SalesforceConfiguration'][_0x861c('0x42')](_0x2a1384)[_0x861c('0x20')](handleEntityNotFound(_0x337167,null))['then'](respondWithResult(_0x337167,null))[_0x861c('0x3e')](handleError(_0x337167,null));};exports[_0x861c('0x43')]=function(_0xbc9c89,_0x269230){return db[_0x861c('0x27')][_0x861c('0x43')](_0xbc9c89[_0x861c('0x44')],{})['then'](respondWithResult(_0x269230,0xc9))[_0x861c('0x3e')](handleError(_0x269230,null));};exports[_0x861c('0x1f')]=function(_0x194a36,_0x3e43e5){if(_0x194a36[_0x861c('0x44')]['id']){delete _0x194a36['body']['id'];}return db[_0x861c('0x27')]['find']({'where':{'id':_0x194a36[_0x861c('0x40')]['id']}})[_0x861c('0x20')](handleEntityNotFound(_0x3e43e5,null))['then'](saveUpdates(_0x194a36[_0x861c('0x44')],null))['then'](respondWithResult(_0x3e43e5,null))[_0x861c('0x3e')](handleError(_0x3e43e5,null));};exports[_0x861c('0x21')]=function(_0x185cb1,_0x4b7d6e){return db[_0x861c('0x27')][_0x861c('0x42')]({'where':{'id':_0x185cb1[_0x861c('0x40')]['id']}})[_0x861c('0x20')](handleEntityNotFound(_0x4b7d6e,null))[_0x861c('0x20')](removeEntity(_0x4b7d6e,null))['catch'](handleError(_0x4b7d6e,null));};exports['getFields']=function(_0x287eef,_0xd5f67c,_0x397675){var _0x1d2f0b={};var _0x2b0c3d={};var _0x40e13e;var _0x573ba3;return db[_0x861c('0x27')][_0x861c('0x45')]({'where':{'id':_0x287eef[_0x861c('0x40')]['id']}})[_0x861c('0x20')](handleEntityNotFound(_0xd5f67c,null))[_0x861c('0x20')](function(_0x192165){if(_0x192165){_0x40e13e=_0x192165;_0x2b0c3d[_0x861c('0x2b')]=_[_0x861c('0x2d')](db[_0x861c('0x46')][_0x861c('0x28')]);_0x2b0c3d[_0x861c('0x2c')]=_[_0x861c('0x2d')](_0x287eef['query']);_0x2b0c3d[_0x861c('0x2e')]=_['intersection'](_0x2b0c3d[_0x861c('0x2b')],_0x2b0c3d[_0x861c('0x2c')]);_0x1d2f0b[_0x861c('0x30')]=_[_0x861c('0x2f')](_0x2b0c3d[_0x861c('0x2b')],qs[_0x861c('0x31')](_0x287eef[_0x861c('0x2c')]['fields']));_0x1d2f0b[_0x861c('0x30')]=_0x1d2f0b[_0x861c('0x30')][_0x861c('0x32')]?_0x1d2f0b[_0x861c('0x30')]:_0x2b0c3d['model'];_0x1d2f0b[_0x861c('0x35')]=qs['sort'](_0x287eef[_0x861c('0x2c')][_0x861c('0x36')]);_0x1d2f0b[_0x861c('0x37')]=qs[_0x861c('0x2e')](_[_0x861c('0x38')](_0x287eef[_0x861c('0x2c')],_0x2b0c3d[_0x861c('0x2e')]));if(_0x287eef['query'][_0x861c('0x39')]){_0x1d2f0b[_0x861c('0x37')]=_[_0x861c('0x3a')](_0x1d2f0b[_0x861c('0x37')],{'$or':_[_0x861c('0x26')](_0x1d2f0b[_0x861c('0x30')],function(_0xb505d5){var _0x785543={};_0x785543[_0xb505d5]={'$like':'%'+_0x287eef[_0x861c('0x2c')][_0x861c('0x39')]+'%'};return _0x785543;})});}_0x1d2f0b=_[_0x861c('0x3a')]({},_0x1d2f0b,_0x287eef[_0x861c('0x3b')]);return _0x40e13e[_0x861c('0x47')](_0x1d2f0b);}})[_0x861c('0x20')](function(_0x3158b4){if(_0x3158b4){_0x573ba3=_0x3158b4[_0x861c('0x32')];if(!_0x287eef[_0x861c('0x2c')][_0x861c('0x33')](_0x861c('0x48'))){_0x1d2f0b[_0x861c('0x34')]=qs[_0x861c('0x34')](_0x287eef[_0x861c('0x2c')][_0x861c('0x34')]);_0x1d2f0b[_0x861c('0x17')]=qs[_0x861c('0x17')](_0x287eef[_0x861c('0x2c')][_0x861c('0x17')]);}return _0x40e13e['getFields'](_0x1d2f0b);}})[_0x861c('0x20')](function(_0x344aac){if(_0x344aac){return _0x344aac?{'count':_0x573ba3,'rows':_0x344aac}:null;}})['then'](respondWithResult(_0xd5f67c,null))[_0x861c('0x3e')](handleError(_0xd5f67c,null));};exports[_0x861c('0x49')]=function(_0xc9665e,_0x2c25d2,_0x5d921d){var _0x17a336={};var _0x2f5ee5={};var _0x32cd63;var _0x4e6f63;return db[_0x861c('0x27')][_0x861c('0x45')]({'where':{'id':_0xc9665e[_0x861c('0x40')]['id']}})[_0x861c('0x20')](handleEntityNotFound(_0x2c25d2,null))[_0x861c('0x20')](function(_0x19d780){if(_0x19d780){_0x32cd63=_0x19d780;_0x2f5ee5['model']=_['keys'](db[_0x861c('0x46')][_0x861c('0x28')]);_0x2f5ee5[_0x861c('0x2c')]=_[_0x861c('0x2d')](_0xc9665e[_0x861c('0x2c')]);_0x2f5ee5[_0x861c('0x2e')]=_[_0x861c('0x2f')](_0x2f5ee5[_0x861c('0x2b')],_0x2f5ee5[_0x861c('0x2c')]);_0x17a336[_0x861c('0x30')]=_['intersection'](_0x2f5ee5[_0x861c('0x2b')],qs[_0x861c('0x31')](_0xc9665e[_0x861c('0x2c')][_0x861c('0x31')]));_0x17a336[_0x861c('0x30')]=_0x17a336[_0x861c('0x30')][_0x861c('0x32')]?_0x17a336[_0x861c('0x30')]:_0x2f5ee5[_0x861c('0x2b')];_0x17a336[_0x861c('0x35')]=qs[_0x861c('0x36')](_0xc9665e[_0x861c('0x2c')]['sort']);_0x17a336[_0x861c('0x37')]=qs['filters'](_[_0x861c('0x38')](_0xc9665e['query'],_0x2f5ee5[_0x861c('0x2e')]));if(_0xc9665e[_0x861c('0x2c')][_0x861c('0x39')]){_0x17a336[_0x861c('0x37')]=_['merge'](_0x17a336[_0x861c('0x37')],{'$or':_['map'](_0x17a336[_0x861c('0x30')],function(_0x17d1d4){var _0x1279e9={};_0x1279e9[_0x17d1d4]={'$like':'%'+_0xc9665e[_0x861c('0x2c')]['filter']+'%'};return _0x1279e9;})});}_0x17a336=_[_0x861c('0x3a')]({},_0x17a336,_0xc9665e[_0x861c('0x3b')]);return _0x32cd63[_0x861c('0x49')](_0x17a336);}})[_0x861c('0x20')](function(_0x4b6e09){if(_0x4b6e09){_0x4e6f63=_0x4b6e09['length'];if(!_0xc9665e[_0x861c('0x2c')][_0x861c('0x33')]('nolimit')){_0x17a336[_0x861c('0x34')]=qs[_0x861c('0x34')](_0xc9665e['query'][_0x861c('0x34')]);_0x17a336['offset']=qs['offset'](_0xc9665e['query'][_0x861c('0x17')]);}return _0x32cd63[_0x861c('0x49')](_0x17a336);}})[_0x861c('0x20')](function(_0x38f088){if(_0x38f088){return _0x38f088?{'count':_0x4e6f63,'rows':_0x38f088}:null;}})[_0x861c('0x20')](respondWithResult(_0x2c25d2,null))[_0x861c('0x3e')](handleError(_0x2c25d2,null));};exports['getDescriptions']=function(_0x1615ce,_0x3d1e23,_0x8f288e){var _0x28509c={};var _0x2bcc37={};var _0x43c90a;var _0x43156b;return db[_0x861c('0x27')][_0x861c('0x45')]({'where':{'id':_0x1615ce[_0x861c('0x40')]['id']}})[_0x861c('0x20')](handleEntityNotFound(_0x3d1e23,null))[_0x861c('0x20')](function(_0x2b0048){if(_0x2b0048){_0x43c90a=_0x2b0048;_0x2bcc37['model']=_[_0x861c('0x2d')](db[_0x861c('0x46')][_0x861c('0x28')]);_0x2bcc37[_0x861c('0x2c')]=_[_0x861c('0x2d')](_0x1615ce[_0x861c('0x2c')]);_0x2bcc37['filters']=_[_0x861c('0x2f')](_0x2bcc37[_0x861c('0x2b')],_0x2bcc37[_0x861c('0x2c')]);_0x28509c['attributes']=_[_0x861c('0x2f')](_0x2bcc37[_0x861c('0x2b')],qs['fields'](_0x1615ce['query'][_0x861c('0x31')]));_0x28509c[_0x861c('0x30')]=_0x28509c[_0x861c('0x30')][_0x861c('0x32')]?_0x28509c['attributes']:_0x2bcc37[_0x861c('0x2b')];_0x28509c[_0x861c('0x35')]=qs[_0x861c('0x36')](_0x1615ce[_0x861c('0x2c')][_0x861c('0x36')]);_0x28509c['where']=qs[_0x861c('0x2e')](_[_0x861c('0x38')](_0x1615ce[_0x861c('0x2c')],_0x2bcc37[_0x861c('0x2e')]));if(_0x1615ce[_0x861c('0x2c')][_0x861c('0x39')]){_0x28509c['where']=_['merge'](_0x28509c[_0x861c('0x37')],{'$or':_[_0x861c('0x26')](_0x28509c[_0x861c('0x30')],function(_0x2470b3){var _0x399699={};_0x399699[_0x2470b3]={'$like':'%'+_0x1615ce['query'][_0x861c('0x39')]+'%'};return _0x399699;})});}_0x28509c=_[_0x861c('0x3a')]({},_0x28509c,_0x1615ce[_0x861c('0x3b')]);return _0x43c90a[_0x861c('0x4a')](_0x28509c);}})[_0x861c('0x20')](function(_0x1dacb4){if(_0x1dacb4){_0x43156b=_0x1dacb4[_0x861c('0x32')];if(!_0x1615ce[_0x861c('0x2c')][_0x861c('0x33')](_0x861c('0x48'))){_0x28509c[_0x861c('0x34')]=qs[_0x861c('0x34')](_0x1615ce[_0x861c('0x2c')][_0x861c('0x34')]);_0x28509c[_0x861c('0x17')]=qs['offset'](_0x1615ce['query']['offset']);}return _0x43c90a[_0x861c('0x4a')](_0x28509c);}})[_0x861c('0x20')](function(_0x147c54){if(_0x147c54){return _0x147c54?{'count':_0x43156b,'rows':_0x147c54}:null;}})[_0x861c('0x20')](respondWithResult(_0x3d1e23,null))['catch'](handleError(_0x3d1e23,null));};
\ No newline at end of file
+var _0x8b1f=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','SalesforceConfiguration','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','catch','create','body','SalesforceField','getFields','getSubjects','findOne','pick','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring'];(function(_0x12b4ff,_0x3749f2){var _0x3dde2b=function(_0x3f94c9){while(--_0x3f94c9){_0x12b4ff['push'](_0x12b4ff['shift']());}};_0x3dde2b(++_0x3749f2);}(_0x8b1f,0xda));var _0xf8b1=function(_0xc5da18,_0x3354e1){_0xc5da18=_0xc5da18-0x0;var _0xf6646f=_0x8b1f[_0xc5da18];return _0xf6646f;};'use strict';var emlformat=require(_0xf8b1('0x0'));var rimraf=require(_0xf8b1('0x1'));var zipdir=require(_0xf8b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf8b1('0x3'));var moment=require(_0xf8b1('0x4'));var BPromise=require(_0xf8b1('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xf8b1('0x6'));var csv=require(_0xf8b1('0x7'));var ejs=require(_0xf8b1('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf8b1('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf8b1('0xa'));var deskjs=require(_0xf8b1('0xb'));var toCsv=require(_0xf8b1('0x7'));var querystring=require(_0xf8b1('0xc'));var Papa=require(_0xf8b1('0xd'));var Redis=require(_0xf8b1('0xe'));var authService=require(_0xf8b1('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf8b1('0x10'));var hardwareService=require(_0xf8b1('0x11'));var logger=require(_0xf8b1('0x12'))('api');var utils=require(_0xf8b1('0x13'));var config=require(_0xf8b1('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf8b1('0x15'))['db'];function respondWithStatusCode(_0x174482,_0x1f7f25){_0x1f7f25=_0x1f7f25||0xcc;return function(_0x520cdf){if(_0x520cdf){return _0x174482['sendStatus'](_0x1f7f25);}return _0x174482[_0xf8b1('0x16')](_0x1f7f25)['end']();};}function respondWithResult(_0x1e09b1,_0x24021d){_0x24021d=_0x24021d||0xc8;return function(_0x2f8ed6){if(_0x2f8ed6){return _0x1e09b1[_0xf8b1('0x16')](_0x24021d)[_0xf8b1('0x17')](_0x2f8ed6);}};}function respondWithFilteredResult(_0x382d51,_0x45f747){return function(_0x4221b1){if(_0x4221b1){var _0x251ec4=typeof _0x45f747['offset']===_0xf8b1('0x18')&&typeof _0x45f747[_0xf8b1('0x19')]===_0xf8b1('0x18');var _0x55827c=_0x4221b1[_0xf8b1('0x1a')];var _0x156d13=_0x251ec4?0x0:_0x45f747[_0xf8b1('0x1b')];var _0x55c57f=_0x251ec4?_0x4221b1['count']:_0x45f747[_0xf8b1('0x1b')]+_0x45f747[_0xf8b1('0x19')];var _0x31a8e7;if(_0x55c57f>=_0x55827c){_0x55c57f=_0x55827c;_0x31a8e7=0xc8;}else{_0x31a8e7=0xce;}_0x382d51[_0xf8b1('0x16')](_0x31a8e7);return _0x382d51[_0xf8b1('0x1c')](_0xf8b1('0x1d'),_0x156d13+'-'+_0x55c57f+'/'+_0x55827c)[_0xf8b1('0x17')](_0x4221b1);}return null;};}function patchUpdates(_0x1f4728){return function(_0x217f23){try{jsonpatch[_0xf8b1('0x1e')](_0x217f23,_0x1f4728,!![]);}catch(_0x4617e9){return BPromise[_0xf8b1('0x1f')](_0x4617e9);}return _0x217f23[_0xf8b1('0x20')]();};}function saveUpdates(_0x2b61f1,_0xe6ee23){return function(_0x516da8){if(_0x516da8){return _0x516da8[_0xf8b1('0x21')](_0x2b61f1)[_0xf8b1('0x22')](function(_0x37f973){return _0x37f973;});}return null;};}function removeEntity(_0xf9dea4,_0x4859bb){return function(_0x3733ae){if(_0x3733ae){return _0x3733ae[_0xf8b1('0x23')]()[_0xf8b1('0x22')](function(){_0xf9dea4[_0xf8b1('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b8fed,_0x4cce19){return function(_0x33dd50){if(!_0x33dd50){_0x2b8fed[_0xf8b1('0x24')](0x194);}return _0x33dd50;};}function handleError(_0x220213,_0x3067b7){_0x3067b7=_0x3067b7||0x1f4;return function(_0x22fd1e){logger['error'](_0x22fd1e[_0xf8b1('0x25')]);if(_0x22fd1e[_0xf8b1('0x26')]){delete _0x22fd1e['name'];}_0x220213['status'](_0x3067b7)[_0xf8b1('0x27')](_0x22fd1e);};}exports['index']=function(_0x147d21,_0x4a9c53){var _0x37e81a={},_0x21e304={},_0xb10199={'count':0x0,'rows':[]};var _0x545ac3=_[_0xf8b1('0x28')](db[_0xf8b1('0x29')]['rawAttributes'],function(_0x35d31a){return{'name':_0x35d31a[_0xf8b1('0x2a')],'type':_0x35d31a['type'][_0xf8b1('0x2b')]};});_0x21e304[_0xf8b1('0x2c')]=_[_0xf8b1('0x28')](_0x545ac3,_0xf8b1('0x26'));_0x21e304[_0xf8b1('0x2d')]=_['keys'](_0x147d21[_0xf8b1('0x2d')]);_0x21e304[_0xf8b1('0x2e')]=_['intersection'](_0x21e304[_0xf8b1('0x2c')],_0x21e304[_0xf8b1('0x2d')]);_0x37e81a['attributes']=_[_0xf8b1('0x2f')](_0x21e304[_0xf8b1('0x2c')],qs['fields'](_0x147d21[_0xf8b1('0x2d')][_0xf8b1('0x30')]));_0x37e81a[_0xf8b1('0x31')]=_0x37e81a['attributes'][_0xf8b1('0x32')]?_0x37e81a[_0xf8b1('0x31')]:_0x21e304[_0xf8b1('0x2c')];if(!_0x147d21['query'][_0xf8b1('0x33')](_0xf8b1('0x34'))){_0x37e81a[_0xf8b1('0x19')]=qs[_0xf8b1('0x19')](_0x147d21[_0xf8b1('0x2d')]['limit']);_0x37e81a['offset']=qs[_0xf8b1('0x1b')](_0x147d21[_0xf8b1('0x2d')]['offset']);}_0x37e81a[_0xf8b1('0x35')]=qs[_0xf8b1('0x36')](_0x147d21[_0xf8b1('0x2d')][_0xf8b1('0x36')]);_0x37e81a[_0xf8b1('0x37')]=qs[_0xf8b1('0x2e')](_['pick'](_0x147d21[_0xf8b1('0x2d')],_0x21e304[_0xf8b1('0x2e')]),_0x545ac3);if(_0x147d21[_0xf8b1('0x2d')][_0xf8b1('0x38')]){_0x37e81a[_0xf8b1('0x37')]=_['merge'](_0x37e81a[_0xf8b1('0x37')],{'$or':_[_0xf8b1('0x28')](_0x545ac3,function(_0x46eead){if(_0x46eead['type']!=='VIRTUAL'){var _0x4aa9f1={};_0x4aa9f1[_0x46eead[_0xf8b1('0x26')]]={'$like':'%'+_0x147d21[_0xf8b1('0x2d')][_0xf8b1('0x38')]+'%'};return _0x4aa9f1;}})});}_0x37e81a=_[_0xf8b1('0x39')]({},_0x37e81a,_0x147d21[_0xf8b1('0x3a')]);var _0x3f569c={'where':_0x37e81a[_0xf8b1('0x37')]};return db[_0xf8b1('0x29')][_0xf8b1('0x1a')](_0x3f569c)[_0xf8b1('0x22')](function(_0x53229b){_0xb10199['count']=_0x53229b;if(_0x147d21['query'][_0xf8b1('0x3b')]){_0x37e81a[_0xf8b1('0x3c')]=[{'all':!![]}];}return db[_0xf8b1('0x29')][_0xf8b1('0x3d')](_0x37e81a);})[_0xf8b1('0x22')](function(_0x4c5301){_0xb10199[_0xf8b1('0x3e')]=_0x4c5301;return _0xb10199;})[_0xf8b1('0x22')](respondWithFilteredResult(_0x4a9c53,_0x37e81a))['catch'](handleError(_0x4a9c53,null));};exports[_0xf8b1('0x3f')]=function(_0x18c70e,_0x453b79){var _0x28fdf2={'raw':![],'where':{'id':_0x18c70e[_0xf8b1('0x40')]['id']}},_0x3c83e2={};_0x3c83e2[_0xf8b1('0x2c')]=_[_0xf8b1('0x41')](db[_0xf8b1('0x29')][_0xf8b1('0x42')]);_0x3c83e2['query']=_['keys'](_0x18c70e[_0xf8b1('0x2d')]);_0x3c83e2[_0xf8b1('0x2e')]=_[_0xf8b1('0x2f')](_0x3c83e2[_0xf8b1('0x2c')],_0x3c83e2[_0xf8b1('0x2d')]);_0x28fdf2[_0xf8b1('0x31')]=_[_0xf8b1('0x2f')](_0x3c83e2[_0xf8b1('0x2c')],qs['fields'](_0x18c70e['query'][_0xf8b1('0x30')]));_0x28fdf2[_0xf8b1('0x31')]=_0x28fdf2[_0xf8b1('0x31')]['length']?_0x28fdf2[_0xf8b1('0x31')]:_0x3c83e2[_0xf8b1('0x2c')];if(_0x18c70e[_0xf8b1('0x2d')][_0xf8b1('0x3b')]){_0x28fdf2['include']=[{'all':!![]}];}_0x28fdf2=_['merge']({},_0x28fdf2,_0x18c70e[_0xf8b1('0x3a')]);return db['SalesforceConfiguration'][_0xf8b1('0x43')](_0x28fdf2)[_0xf8b1('0x22')](handleEntityNotFound(_0x453b79,null))['then'](respondWithResult(_0x453b79,null))[_0xf8b1('0x44')](handleError(_0x453b79,null));};exports[_0xf8b1('0x45')]=function(_0x46db4b,_0x4c1555){return db[_0xf8b1('0x29')][_0xf8b1('0x45')](_0x46db4b[_0xf8b1('0x46')],{})['then'](respondWithResult(_0x4c1555,0xc9))[_0xf8b1('0x44')](handleError(_0x4c1555,null));};exports[_0xf8b1('0x21')]=function(_0x2df99f,_0x25504e){if(_0x2df99f[_0xf8b1('0x46')]['id']){delete _0x2df99f[_0xf8b1('0x46')]['id'];}return db['SalesforceConfiguration'][_0xf8b1('0x43')]({'where':{'id':_0x2df99f[_0xf8b1('0x40')]['id']}})['then'](handleEntityNotFound(_0x25504e,null))['then'](saveUpdates(_0x2df99f[_0xf8b1('0x46')],null))[_0xf8b1('0x22')](respondWithResult(_0x25504e,null))[_0xf8b1('0x44')](handleError(_0x25504e,null));};exports[_0xf8b1('0x23')]=function(_0x15d0be,_0xb02131){return db[_0xf8b1('0x29')][_0xf8b1('0x43')]({'where':{'id':_0x15d0be['params']['id']}})[_0xf8b1('0x22')](handleEntityNotFound(_0xb02131,null))[_0xf8b1('0x22')](removeEntity(_0xb02131,null))[_0xf8b1('0x44')](handleError(_0xb02131,null));};exports['getFields']=function(_0x154b53,_0x3c8b58,_0x45a350){var _0x27b144={};var _0x15082a={};var _0x562b02;var _0x358021;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x154b53[_0xf8b1('0x40')]['id']}})[_0xf8b1('0x22')](handleEntityNotFound(_0x3c8b58,null))[_0xf8b1('0x22')](function(_0x592310){if(_0x592310){_0x562b02=_0x592310;_0x15082a['model']=_['keys'](db[_0xf8b1('0x47')][_0xf8b1('0x42')]);_0x15082a[_0xf8b1('0x2d')]=_[_0xf8b1('0x41')](_0x154b53[_0xf8b1('0x2d')]);_0x15082a['filters']=_['intersection'](_0x15082a['model'],_0x15082a[_0xf8b1('0x2d')]);_0x27b144['attributes']=_[_0xf8b1('0x2f')](_0x15082a[_0xf8b1('0x2c')],qs[_0xf8b1('0x30')](_0x154b53[_0xf8b1('0x2d')][_0xf8b1('0x30')]));_0x27b144['attributes']=_0x27b144[_0xf8b1('0x31')][_0xf8b1('0x32')]?_0x27b144[_0xf8b1('0x31')]:_0x15082a['model'];_0x27b144[_0xf8b1('0x35')]=qs[_0xf8b1('0x36')](_0x154b53[_0xf8b1('0x2d')]['sort']);_0x27b144[_0xf8b1('0x37')]=qs[_0xf8b1('0x2e')](_['pick'](_0x154b53['query'],_0x15082a[_0xf8b1('0x2e')]));if(_0x154b53[_0xf8b1('0x2d')][_0xf8b1('0x38')]){_0x27b144[_0xf8b1('0x37')]=_['merge'](_0x27b144[_0xf8b1('0x37')],{'$or':_['map'](_0x27b144['attributes'],function(_0x2536e7){var _0x325b01={};_0x325b01[_0x2536e7]={'$like':'%'+_0x154b53[_0xf8b1('0x2d')][_0xf8b1('0x38')]+'%'};return _0x325b01;})});}_0x27b144=_[_0xf8b1('0x39')]({},_0x27b144,_0x154b53[_0xf8b1('0x3a')]);return _0x562b02['getFields'](_0x27b144);}})[_0xf8b1('0x22')](function(_0xc703e4){if(_0xc703e4){_0x358021=_0xc703e4[_0xf8b1('0x32')];if(!_0x154b53[_0xf8b1('0x2d')][_0xf8b1('0x33')](_0xf8b1('0x34'))){_0x27b144[_0xf8b1('0x19')]=qs[_0xf8b1('0x19')](_0x154b53['query'][_0xf8b1('0x19')]);_0x27b144['offset']=qs[_0xf8b1('0x1b')](_0x154b53['query']['offset']);}return _0x562b02[_0xf8b1('0x48')](_0x27b144);}})['then'](function(_0x20aefd){if(_0x20aefd){return _0x20aefd?{'count':_0x358021,'rows':_0x20aefd}:null;}})[_0xf8b1('0x22')](respondWithResult(_0x3c8b58,null))[_0xf8b1('0x44')](handleError(_0x3c8b58,null));};exports[_0xf8b1('0x49')]=function(_0x395f97,_0x336b6b,_0x572e3d){var _0x3b30c8={};var _0x3c1356={};var _0x5757d7;var _0x45539e;return db['SalesforceConfiguration'][_0xf8b1('0x4a')]({'where':{'id':_0x395f97[_0xf8b1('0x40')]['id']}})[_0xf8b1('0x22')](handleEntityNotFound(_0x336b6b,null))[_0xf8b1('0x22')](function(_0x1bebea){if(_0x1bebea){_0x5757d7=_0x1bebea;_0x3c1356['model']=_[_0xf8b1('0x41')](db[_0xf8b1('0x47')][_0xf8b1('0x42')]);_0x3c1356['query']=_[_0xf8b1('0x41')](_0x395f97[_0xf8b1('0x2d')]);_0x3c1356[_0xf8b1('0x2e')]=_[_0xf8b1('0x2f')](_0x3c1356[_0xf8b1('0x2c')],_0x3c1356['query']);_0x3b30c8[_0xf8b1('0x31')]=_[_0xf8b1('0x2f')](_0x3c1356['model'],qs[_0xf8b1('0x30')](_0x395f97[_0xf8b1('0x2d')][_0xf8b1('0x30')]));_0x3b30c8['attributes']=_0x3b30c8[_0xf8b1('0x31')][_0xf8b1('0x32')]?_0x3b30c8[_0xf8b1('0x31')]:_0x3c1356['model'];_0x3b30c8[_0xf8b1('0x35')]=qs[_0xf8b1('0x36')](_0x395f97[_0xf8b1('0x2d')][_0xf8b1('0x36')]);_0x3b30c8['where']=qs[_0xf8b1('0x2e')](_[_0xf8b1('0x4b')](_0x395f97[_0xf8b1('0x2d')],_0x3c1356[_0xf8b1('0x2e')]));if(_0x395f97[_0xf8b1('0x2d')]['filter']){_0x3b30c8[_0xf8b1('0x37')]=_['merge'](_0x3b30c8[_0xf8b1('0x37')],{'$or':_[_0xf8b1('0x28')](_0x3b30c8[_0xf8b1('0x31')],function(_0x23d137){var _0x396191={};_0x396191[_0x23d137]={'$like':'%'+_0x395f97[_0xf8b1('0x2d')][_0xf8b1('0x38')]+'%'};return _0x396191;})});}_0x3b30c8=_['merge']({},_0x3b30c8,_0x395f97['options']);return _0x5757d7[_0xf8b1('0x49')](_0x3b30c8);}})[_0xf8b1('0x22')](function(_0x22469f){if(_0x22469f){_0x45539e=_0x22469f['length'];if(!_0x395f97[_0xf8b1('0x2d')][_0xf8b1('0x33')](_0xf8b1('0x34'))){_0x3b30c8[_0xf8b1('0x19')]=qs['limit'](_0x395f97['query'][_0xf8b1('0x19')]);_0x3b30c8[_0xf8b1('0x1b')]=qs[_0xf8b1('0x1b')](_0x395f97[_0xf8b1('0x2d')][_0xf8b1('0x1b')]);}return _0x5757d7[_0xf8b1('0x49')](_0x3b30c8);}})[_0xf8b1('0x22')](function(_0x3a9b46){if(_0x3a9b46){return _0x3a9b46?{'count':_0x45539e,'rows':_0x3a9b46}:null;}})['then'](respondWithResult(_0x336b6b,null))['catch'](handleError(_0x336b6b,null));};exports[_0xf8b1('0x4c')]=function(_0x53c7f5,_0x42d598,_0x43d16f){var _0x2b8b15={};var _0x13307b={};var _0x144a8d;var _0x208c6e;return db[_0xf8b1('0x29')][_0xf8b1('0x4a')]({'where':{'id':_0x53c7f5[_0xf8b1('0x40')]['id']}})[_0xf8b1('0x22')](handleEntityNotFound(_0x42d598,null))[_0xf8b1('0x22')](function(_0x1da8be){if(_0x1da8be){_0x144a8d=_0x1da8be;_0x13307b['model']=_[_0xf8b1('0x41')](db['SalesforceField'][_0xf8b1('0x42')]);_0x13307b[_0xf8b1('0x2d')]=_[_0xf8b1('0x41')](_0x53c7f5[_0xf8b1('0x2d')]);_0x13307b[_0xf8b1('0x2e')]=_[_0xf8b1('0x2f')](_0x13307b['model'],_0x13307b['query']);_0x2b8b15['attributes']=_[_0xf8b1('0x2f')](_0x13307b[_0xf8b1('0x2c')],qs['fields'](_0x53c7f5[_0xf8b1('0x2d')][_0xf8b1('0x30')]));_0x2b8b15[_0xf8b1('0x31')]=_0x2b8b15[_0xf8b1('0x31')]['length']?_0x2b8b15[_0xf8b1('0x31')]:_0x13307b[_0xf8b1('0x2c')];_0x2b8b15[_0xf8b1('0x35')]=qs[_0xf8b1('0x36')](_0x53c7f5['query'][_0xf8b1('0x36')]);_0x2b8b15[_0xf8b1('0x37')]=qs[_0xf8b1('0x2e')](_[_0xf8b1('0x4b')](_0x53c7f5['query'],_0x13307b['filters']));if(_0x53c7f5['query']['filter']){_0x2b8b15[_0xf8b1('0x37')]=_[_0xf8b1('0x39')](_0x2b8b15[_0xf8b1('0x37')],{'$or':_[_0xf8b1('0x28')](_0x2b8b15[_0xf8b1('0x31')],function(_0x3444dc){var _0x2e4855={};_0x2e4855[_0x3444dc]={'$like':'%'+_0x53c7f5[_0xf8b1('0x2d')][_0xf8b1('0x38')]+'%'};return _0x2e4855;})});}_0x2b8b15=_[_0xf8b1('0x39')]({},_0x2b8b15,_0x53c7f5[_0xf8b1('0x3a')]);return _0x144a8d['getDescriptions'](_0x2b8b15);}})[_0xf8b1('0x22')](function(_0x55c92a){if(_0x55c92a){_0x208c6e=_0x55c92a[_0xf8b1('0x32')];if(!_0x53c7f5[_0xf8b1('0x2d')][_0xf8b1('0x33')]('nolimit')){_0x2b8b15[_0xf8b1('0x19')]=qs[_0xf8b1('0x19')](_0x53c7f5[_0xf8b1('0x2d')][_0xf8b1('0x19')]);_0x2b8b15[_0xf8b1('0x1b')]=qs[_0xf8b1('0x1b')](_0x53c7f5['query'][_0xf8b1('0x1b')]);}return _0x144a8d['getDescriptions'](_0x2b8b15);}})['then'](function(_0x313ac7){if(_0x313ac7){return _0x313ac7?{'count':_0x208c6e,'rows':_0x313ac7}:null;}})[_0xf8b1('0x22')](respondWithResult(_0x42d598,null))[_0xf8b1('0x44')](handleError(_0x42d598,null));};
\ No newline at end of file
index 5ca0f97..13e7f73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1232=['rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x19116e,_0x5c9212){var _0x40ee7d=function(_0x41c788){while(--_0x41c788){_0x19116e['push'](_0x19116e['shift']());}};_0x40ee7d(++_0x5c9212);}(_0x1232,0x85));var _0x2123=function(_0x2dba56,_0x35ba5e){_0x2dba56=_0x2dba56-0x0;var _0x44f478=_0x1232[_0x2dba56];return _0x44f478;};'use strict';var _=require(_0x2123('0x0'));var util=require(_0x2123('0x1'));var logger=require(_0x2123('0x2'))(_0x2123('0x3'));var moment=require(_0x2123('0x4'));var BPromise=require(_0x2123('0x5'));var rp=require(_0x2123('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2123('0x7'));var config=require(_0x2123('0x8'));var attributes=require(_0x2123('0x9'));module[_0x2123('0xa')]=function(_0xa43a30,_0x437d41){return _0xa43a30[_0x2123('0xb')](_0x2123('0xc'),attributes,{'tableName':_0x2123('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3648=['./intSalesforceConfiguration.attributes','exports','define','int_salesforce_configurations','lodash','../../config/logger','api','moment','request-promise','../../config/environment'];(function(_0x1f7e4a,_0x54ef35){var _0x4532a2=function(_0x4e948b){while(--_0x4e948b){_0x1f7e4a['push'](_0x1f7e4a['shift']());}};_0x4532a2(++_0x54ef35);}(_0x3648,0x1ee));var _0x8364=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3648[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8364('0x0'));var util=require('util');var logger=require(_0x8364('0x1'))(_0x8364('0x2'));var moment=require(_0x8364('0x3'));var BPromise=require('bluebird');var rp=require(_0x8364('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8364('0x5'));var attributes=require(_0x8364('0x6'));module[_0x8364('0x7')]=function(_0x42985d,_0xda8c18){return _0x42985d[_0x8364('0x8')]('SalesforceConfiguration',attributes,{'tableName':_0x8364('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b00458f..ef9195b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4ea=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1974a1,_0x347db8){var _0x415789=function(_0x325524){while(--_0x325524){_0x1974a1['push'](_0x1974a1['shift']());}};_0x415789(++_0x347db8);}(_0xb4ea,0x1cc));var _0xab4e=function(_0x485c25,_0x4a4d8a){_0x485c25=_0x485c25-0x0;var _0x35e0dc=_0xb4ea[_0x485c25];return _0x35e0dc;};'use strict';var _=require(_0xab4e('0x0'));var util=require(_0xab4e('0x1'));var moment=require(_0xab4e('0x2'));var BPromise=require(_0xab4e('0x3'));var rs=require(_0xab4e('0x4'));var fs=require('fs');var Redis=require(_0xab4e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xab4e('0x6'));var logger=require(_0xab4e('0x7'))(_0xab4e('0x8'));var config=require(_0xab4e('0x9'));var jayson=require(_0xab4e('0xa'));var client=jayson[_0xab4e('0xb')][_0xab4e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x58e9cb,_0x3ce381,_0x44ed34){return new BPromise(function(_0x24e8c9,_0x2b3896){return client[_0xab4e('0xd')](_0x58e9cb,_0x44ed34)['then'](function(_0xb9861d){logger[_0xab4e('0xe')](_0xab4e('0xf'),_0x3ce381,_0xab4e('0x10'));logger['debug'](_0xab4e('0x11'),_0x3ce381,_0xab4e('0x10'),JSON[_0xab4e('0x12')](_0xb9861d));if(_0xb9861d[_0xab4e('0x13')]){if(_0xb9861d[_0xab4e('0x13')][_0xab4e('0x14')]===0x1f4){logger[_0xab4e('0x13')](_0xab4e('0xf'),_0x3ce381,_0xb9861d[_0xab4e('0x13')][_0xab4e('0x15')]);return _0x2b3896(_0xb9861d[_0xab4e('0x13')][_0xab4e('0x15')]);}logger[_0xab4e('0x13')](_0xab4e('0xf'),_0x3ce381,_0xb9861d[_0xab4e('0x13')][_0xab4e('0x15')]);return _0x24e8c9(_0xb9861d[_0xab4e('0x13')][_0xab4e('0x15')]);}else{logger[_0xab4e('0xe')](_0xab4e('0xf'),_0x3ce381,'request\x20sent');_0x24e8c9(_0xb9861d[_0xab4e('0x16')][_0xab4e('0x15')]);}})[_0xab4e('0x17')](function(_0x3ee88b){logger[_0xab4e('0x13')](_0xab4e('0xf'),_0x3ce381,_0x3ee88b);_0x2b3896(_0x3ee88b);});});}
\ No newline at end of file
+var _0x8c5d=['client','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x4231c6,_0x59d4f4){var _0x2e86a2=function(_0x22ab8e){while(--_0x22ab8e){_0x4231c6['push'](_0x4231c6['shift']());}};_0x2e86a2(++_0x59d4f4);}(_0x8c5d,0x16b));var _0xd8c5=function(_0xdb2eb5,_0x248d67){_0xdb2eb5=_0xdb2eb5-0x0;var _0x5e0830=_0x8c5d[_0xdb2eb5];return _0x5e0830;};'use strict';var _=require(_0xd8c5('0x0'));var util=require(_0xd8c5('0x1'));var moment=require(_0xd8c5('0x2'));var BPromise=require(_0xd8c5('0x3'));var rs=require(_0xd8c5('0x4'));var fs=require('fs');var Redis=require(_0xd8c5('0x5'));var db=require(_0xd8c5('0x6'))['db'];var utils=require(_0xd8c5('0x7'));var logger=require(_0xd8c5('0x8'))(_0xd8c5('0x9'));var config=require('../../config/environment');var jayson=require(_0xd8c5('0xa'));var client=jayson[_0xd8c5('0xb')][_0xd8c5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x172687,_0x534941,_0x238705){return new BPromise(function(_0x5e4a5e,_0x43a131){return client[_0xd8c5('0xd')](_0x172687,_0x238705)[_0xd8c5('0xe')](function(_0x3bee2f){logger['info'](_0xd8c5('0xf'),_0x534941,_0xd8c5('0x10'));logger['debug'](_0xd8c5('0x11'),_0x534941,'request\x20sent',JSON[_0xd8c5('0x12')](_0x3bee2f));if(_0x3bee2f['error']){if(_0x3bee2f[_0xd8c5('0x13')]['code']===0x1f4){logger[_0xd8c5('0x13')](_0xd8c5('0xf'),_0x534941,_0x3bee2f[_0xd8c5('0x13')][_0xd8c5('0x14')]);return _0x43a131(_0x3bee2f[_0xd8c5('0x13')]['message']);}logger['error'](_0xd8c5('0xf'),_0x534941,_0x3bee2f[_0xd8c5('0x13')][_0xd8c5('0x14')]);return _0x5e4a5e(_0x3bee2f[_0xd8c5('0x13')][_0xd8c5('0x14')]);}else{logger['info'](_0xd8c5('0xf'),_0x534941,_0xd8c5('0x10'));_0x5e4a5e(_0x3bee2f['result'][_0xd8c5('0x14')]);}})[_0xd8c5('0x15')](function(_0x2b989b){logger[_0xd8c5('0x13')](_0xd8c5('0xf'),_0x534941,_0x2b989b);_0x43a131(_0x2b989b);});});}
\ No newline at end of file
index c047a64..a9647bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00f9=['util','path','Router','../../components/auth/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','create','destroy','exports'];(function(_0x2c78a7,_0x467a15){var _0x11cf04=function(_0x215358){while(--_0x215358){_0x2c78a7['push'](_0x2c78a7['shift']());}};_0x11cf04(++_0x467a15);}(_0x00f9,0xf0));var _0x900f=function(_0x3ba422,_0x53303c){_0x3ba422=_0x3ba422-0x0;var _0x20b5dd=_0x00f9[_0x3ba422];return _0x20b5dd;};'use strict';var multer=require('multer');var util=require(_0x900f('0x0'));var path=require(_0x900f('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x900f('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x900f('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x900f('0x4'));var controller=require(_0x900f('0x5'));router[_0x900f('0x6')]('/',auth[_0x900f('0x7')](),controller[_0x900f('0x8')]);router['get'](_0x900f('0x9'),auth['isAuthenticated'](),controller[_0x900f('0xa')]);router[_0x900f('0xb')]('/',auth['isAuthenticated'](),controller[_0x900f('0xc')]);router['put']('/:id',auth[_0x900f('0x7')](),controller['update']);router['delete'](_0x900f('0x9'),auth['isAuthenticated'](),controller[_0x900f('0xd')]);module[_0x900f('0xe')]=router;
\ No newline at end of file
+var _0x5898=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','isAuthenticated','get','/:id','show','create','put','update'];(function(_0x1361d2,_0x337bfd){var _0x51f900=function(_0x56611a){while(--_0x56611a){_0x1361d2['push'](_0x1361d2['shift']());}};_0x51f900(++_0x337bfd);}(_0x5898,0x157));var _0x8589=function(_0x17c283,_0x587fcc){_0x17c283=_0x17c283-0x0;var _0x4e0800=_0x5898[_0x17c283];return _0x4e0800;};'use strict';var multer=require(_0x8589('0x0'));var util=require(_0x8589('0x1'));var path=require(_0x8589('0x2'));var timeout=require(_0x8589('0x3'));var express=require(_0x8589('0x4'));var router=express[_0x8589('0x5')]();var fs_extra=require(_0x8589('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8589('0x7'));var config=require(_0x8589('0x8'));var controller=require(_0x8589('0x9'));router['get']('/',auth[_0x8589('0xa')](),controller['index']);router[_0x8589('0xb')](_0x8589('0xc'),auth['isAuthenticated'](),controller[_0x8589('0xd')]);router['post']('/',auth[_0x8589('0xa')](),controller[_0x8589('0xe')]);router[_0x8589('0xf')](_0x8589('0xc'),auth['isAuthenticated'](),controller[_0x8589('0x10')]);router[_0x8589('0x11')](_0x8589('0xc'),auth['isAuthenticated'](),controller[_0x8589('0x12')]);module[_0x8589('0x13')]=router;
\ No newline at end of file
index 3a1cf57..b4005d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6b4=['ENUM','string','variable','customVariable','picklist','STRING','sequelize','exports'];(function(_0xa735c4,_0x3d5f93){var _0x534982=function(_0x57dd9f){while(--_0x57dd9f){_0xa735c4['push'](_0xa735c4['shift']());}};_0x534982(++_0x3d5f93);}(_0xd6b4,0x9e));var _0x4d6b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xd6b4[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x4d6b('0x0'));module[_0x4d6b('0x1')]={'type':{'type':Sequelize[_0x4d6b('0x2')](_0x4d6b('0x3'),_0x4d6b('0x4'),_0x4d6b('0x5'),'keyValue',_0x4d6b('0x6')),'defaultValue':_0x4d6b('0x3')},'content':{'type':Sequelize[_0x4d6b('0x7')]},'key':{'type':Sequelize[_0x4d6b('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x4d6b('0x3'),_0x4d6b('0x4'),_0x4d6b('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4d6b('0x7')]},'variableName':{'type':Sequelize[_0x4d6b('0x7')]}};
\ No newline at end of file
+var _0x3c6d=['keyValue','picklist','STRING','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x3005d5,_0xf588c7){var _0x547c7e=function(_0x4514dc){while(--_0x4514dc){_0x3005d5['push'](_0x3005d5['shift']());}};_0x547c7e(++_0xf588c7);}(_0x3c6d,0x1aa));var _0xd3c6=function(_0x51631a,_0x1ffe1c){_0x51631a=_0x51631a-0x0;var _0x4812d0=_0x3c6d[_0x51631a];return _0x4812d0;};'use strict';var Sequelize=require(_0xd3c6('0x0'));module[_0xd3c6('0x1')]={'type':{'type':Sequelize[_0xd3c6('0x2')](_0xd3c6('0x3'),_0xd3c6('0x4'),_0xd3c6('0x5'),_0xd3c6('0x6'),_0xd3c6('0x7')),'defaultValue':_0xd3c6('0x3')},'content':{'type':Sequelize[_0xd3c6('0x8')]},'key':{'type':Sequelize[_0xd3c6('0x8')]},'keyType':{'type':Sequelize['ENUM']('string',_0xd3c6('0x4'),_0xd3c6('0x5'))},'keyContent':{'type':Sequelize[_0xd3c6('0x8')]},'idField':{'type':Sequelize[_0xd3c6('0x8')]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 07d40aa..ab6a8af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ba1=['../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','send','index','SalesforceField','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x5ac1e5,_0x4b5012){var _0x1bccc6=function(_0x102562){while(--_0x102562){_0x5ac1e5['push'](_0x5ac1e5['shift']());}};_0x1bccc6(++_0x4b5012);}(_0x8ba1,0x119));var _0x18ba=function(_0xdca38e,_0x30cd5f){_0xdca38e=_0xdca38e-0x0;var _0x45eb3d=_0x8ba1[_0xdca38e];return _0x45eb3d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x18ba('0x0'));var jsonpatch=require(_0x18ba('0x1'));var rp=require(_0x18ba('0x2'));var moment=require(_0x18ba('0x3'));var BPromise=require(_0x18ba('0x4'));var Mustache=require('mustache');var util=require(_0x18ba('0x5'));var path=require(_0x18ba('0x6'));var sox=require(_0x18ba('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x18ba('0x8'));var _=require(_0x18ba('0x9'));var squel=require(_0x18ba('0xa'));var crypto=require('crypto');var jsforce=require(_0x18ba('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x18ba('0xc'));var querystring=require(_0x18ba('0xd'));var Papa=require(_0x18ba('0xe'));var Redis=require(_0x18ba('0xf'));var authService=require(_0x18ba('0x10'));var qs=require(_0x18ba('0x11'));var as=require(_0x18ba('0x12'));var hardwareService=require(_0x18ba('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x18ba('0x14'));var config=require(_0x18ba('0x15'));var licenseUtil=require(_0x18ba('0x16'));var db=require(_0x18ba('0x17'))['db'];function respondWithStatusCode(_0x5bd288,_0x443718){_0x443718=_0x443718||0xcc;return function(_0x45da64){if(_0x45da64){return _0x5bd288['sendStatus'](_0x443718);}return _0x5bd288[_0x18ba('0x18')](_0x443718)['end']();};}function respondWithResult(_0xb710bd,_0x4f8df5){_0x4f8df5=_0x4f8df5||0xc8;return function(_0x5881c2){if(_0x5881c2){return _0xb710bd[_0x18ba('0x18')](_0x4f8df5)[_0x18ba('0x19')](_0x5881c2);}};}function respondWithFilteredResult(_0x51076f,_0x277097){return function(_0x1566c0){if(_0x1566c0){var _0x2ada0b=typeof _0x277097[_0x18ba('0x1a')]===_0x18ba('0x1b')&&typeof _0x277097[_0x18ba('0x1c')]==='undefined';var _0x4553af=_0x1566c0['count'];var _0x2181a5=_0x2ada0b?0x0:_0x277097[_0x18ba('0x1a')];var _0x3cc163=_0x2ada0b?_0x1566c0[_0x18ba('0x1d')]:_0x277097[_0x18ba('0x1a')]+_0x277097[_0x18ba('0x1c')];var _0x57ee29;if(_0x3cc163>=_0x4553af){_0x3cc163=_0x4553af;_0x57ee29=0xc8;}else{_0x57ee29=0xce;}_0x51076f[_0x18ba('0x18')](_0x57ee29);return _0x51076f['set'](_0x18ba('0x1e'),_0x2181a5+'-'+_0x3cc163+'/'+_0x4553af)['json'](_0x1566c0);}return null;};}function patchUpdates(_0x153435){return function(_0x2fe94d){try{jsonpatch[_0x18ba('0x1f')](_0x2fe94d,_0x153435,!![]);}catch(_0x5dbece){return BPromise[_0x18ba('0x20')](_0x5dbece);}return _0x2fe94d[_0x18ba('0x21')]();};}function saveUpdates(_0x1177fe,_0x31796e){return function(_0x194716){if(_0x194716){return _0x194716['update'](_0x1177fe)[_0x18ba('0x22')](function(_0x256713){return _0x256713;});}return null;};}function removeEntity(_0x412e76,_0x4246ea){return function(_0x77dbc1){if(_0x77dbc1){return _0x77dbc1[_0x18ba('0x23')]()[_0x18ba('0x22')](function(){_0x412e76[_0x18ba('0x18')](0xcc)[_0x18ba('0x24')]();});}};}function handleEntityNotFound(_0x123e18,_0x862046){return function(_0x3e4bef){if(!_0x3e4bef){_0x123e18[_0x18ba('0x25')](0x194);}return _0x3e4bef;};}function handleError(_0x2c60e0,_0x19599f){_0x19599f=_0x19599f||0x1f4;return function(_0x17f988){logger[_0x18ba('0x26')](_0x17f988[_0x18ba('0x27')]);if(_0x17f988[_0x18ba('0x28')]){delete _0x17f988['name'];}_0x2c60e0[_0x18ba('0x18')](_0x19599f)[_0x18ba('0x29')](_0x17f988);};}exports[_0x18ba('0x2a')]=function(_0x425a6b,_0x1d0ffb){var _0x457693={},_0x141728={},_0x322647={'count':0x0,'rows':[]};var _0x58052d=_['map'](db[_0x18ba('0x2b')]['rawAttributes'],function(_0x10eb3c){return{'name':_0x10eb3c[_0x18ba('0x2c')],'type':_0x10eb3c[_0x18ba('0x2d')][_0x18ba('0x2e')]};});_0x141728[_0x18ba('0x2f')]=_[_0x18ba('0x30')](_0x58052d,'name');_0x141728['query']=_[_0x18ba('0x31')](_0x425a6b[_0x18ba('0x32')]);_0x141728[_0x18ba('0x33')]=_[_0x18ba('0x34')](_0x141728[_0x18ba('0x2f')],_0x141728['query']);_0x457693[_0x18ba('0x35')]=_[_0x18ba('0x34')](_0x141728['model'],qs[_0x18ba('0x36')](_0x425a6b[_0x18ba('0x32')][_0x18ba('0x36')]));_0x457693[_0x18ba('0x35')]=_0x457693[_0x18ba('0x35')][_0x18ba('0x37')]?_0x457693['attributes']:_0x141728[_0x18ba('0x2f')];if(!_0x425a6b[_0x18ba('0x32')][_0x18ba('0x38')](_0x18ba('0x39'))){_0x457693['limit']=qs['limit'](_0x425a6b[_0x18ba('0x32')][_0x18ba('0x1c')]);_0x457693['offset']=qs[_0x18ba('0x1a')](_0x425a6b['query'][_0x18ba('0x1a')]);}_0x457693[_0x18ba('0x3a')]=qs[_0x18ba('0x3b')](_0x425a6b['query'][_0x18ba('0x3b')]);_0x457693[_0x18ba('0x3c')]=qs[_0x18ba('0x33')](_[_0x18ba('0x3d')](_0x425a6b[_0x18ba('0x32')],_0x141728[_0x18ba('0x33')]),_0x58052d);if(_0x425a6b[_0x18ba('0x32')][_0x18ba('0x3e')]){_0x457693[_0x18ba('0x3c')]=_[_0x18ba('0x3f')](_0x457693[_0x18ba('0x3c')],{'$or':_[_0x18ba('0x30')](_0x58052d,function(_0x4b14d7){if(_0x4b14d7['type']!==_0x18ba('0x40')){var _0x1a93bc={};_0x1a93bc[_0x4b14d7[_0x18ba('0x28')]]={'$like':'%'+_0x425a6b[_0x18ba('0x32')][_0x18ba('0x3e')]+'%'};return _0x1a93bc;}})});}_0x457693=_[_0x18ba('0x3f')]({},_0x457693,_0x425a6b[_0x18ba('0x41')]);var _0x1df212={'where':_0x457693['where']};return db[_0x18ba('0x2b')][_0x18ba('0x1d')](_0x1df212)['then'](function(_0x263575){_0x322647[_0x18ba('0x1d')]=_0x263575;if(_0x425a6b['query'][_0x18ba('0x42')]){_0x457693['include']=[{'all':!![]}];}return db[_0x18ba('0x2b')][_0x18ba('0x43')](_0x457693);})[_0x18ba('0x22')](function(_0x77f74f){_0x322647[_0x18ba('0x44')]=_0x77f74f;return _0x322647;})[_0x18ba('0x22')](respondWithFilteredResult(_0x1d0ffb,_0x457693))[_0x18ba('0x45')](handleError(_0x1d0ffb,null));};exports[_0x18ba('0x46')]=function(_0x392cb2,_0x7765b6){var _0x10673e={'raw':!![],'where':{'id':_0x392cb2[_0x18ba('0x47')]['id']}},_0x1c09b4={};_0x1c09b4['model']=_[_0x18ba('0x31')](db['SalesforceField'][_0x18ba('0x48')]);_0x1c09b4[_0x18ba('0x32')]=_[_0x18ba('0x31')](_0x392cb2[_0x18ba('0x32')]);_0x1c09b4[_0x18ba('0x33')]=_[_0x18ba('0x34')](_0x1c09b4['model'],_0x1c09b4['query']);_0x10673e[_0x18ba('0x35')]=_[_0x18ba('0x34')](_0x1c09b4[_0x18ba('0x2f')],qs[_0x18ba('0x36')](_0x392cb2[_0x18ba('0x32')][_0x18ba('0x36')]));_0x10673e[_0x18ba('0x35')]=_0x10673e[_0x18ba('0x35')][_0x18ba('0x37')]?_0x10673e['attributes']:_0x1c09b4['model'];if(_0x392cb2[_0x18ba('0x32')][_0x18ba('0x42')]){_0x10673e[_0x18ba('0x49')]=[{'all':!![]}];}_0x10673e=_[_0x18ba('0x3f')]({},_0x10673e,_0x392cb2[_0x18ba('0x41')]);return db[_0x18ba('0x2b')]['find'](_0x10673e)[_0x18ba('0x22')](handleEntityNotFound(_0x7765b6,null))[_0x18ba('0x22')](respondWithResult(_0x7765b6,null))['catch'](handleError(_0x7765b6,null));};exports[_0x18ba('0x4a')]=function(_0x2ae15e,_0x3674b1){return db['SalesforceField'][_0x18ba('0x4a')](_0x2ae15e[_0x18ba('0x4b')],{})['then'](respondWithResult(_0x3674b1,0xc9))[_0x18ba('0x45')](handleError(_0x3674b1,null));};exports['update']=function(_0x2c25c5,_0x11b3d7){if(_0x2c25c5[_0x18ba('0x4b')]['id']){delete _0x2c25c5['body']['id'];}return db['SalesforceField']['find']({'where':{'id':_0x2c25c5[_0x18ba('0x47')]['id']}})['then'](handleEntityNotFound(_0x11b3d7,null))[_0x18ba('0x22')](saveUpdates(_0x2c25c5[_0x18ba('0x4b')],null))[_0x18ba('0x22')](respondWithResult(_0x11b3d7,null))[_0x18ba('0x45')](handleError(_0x11b3d7,null));};exports['destroy']=function(_0x2ab54a,_0x514925){return db[_0x18ba('0x2b')]['find']({'where':{'id':_0x2ab54a[_0x18ba('0x47')]['id']}})[_0x18ba('0x22')](handleEntityNotFound(_0x514925,null))[_0x18ba('0x22')](removeEntity(_0x514925,null))[_0x18ba('0x45')](handleError(_0x514925,null));};
\ No newline at end of file
+var _0x0501=['fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','json','save','update','then','error','stack','name','index','map','SalesforceField','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','findAll','rows','catch','show','params','includeAll','include','options','find','create','body','destroy','eml-format','rimraf','zip-dir'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x0501,0x1a7));var _0x1050=function(_0x2a94cf,_0x2b970d){_0x2a94cf=_0x2a94cf-0x0;var _0x22147f=_0x0501[_0x2a94cf];return _0x22147f;};'use strict';var emlformat=require(_0x1050('0x0'));var rimraf=require(_0x1050('0x1'));var zipdir=require(_0x1050('0x2'));var jsonpatch=require(_0x1050('0x3'));var rp=require(_0x1050('0x4'));var moment=require(_0x1050('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1050('0x6'));var util=require(_0x1050('0x7'));var path=require('path');var sox=require(_0x1050('0x8'));var csv=require(_0x1050('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1050('0xa'));var _=require(_0x1050('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1050('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1050('0xd'));var Papa=require('papaparse');var Redis=require(_0x1050('0xe'));var authService=require(_0x1050('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x1050('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1050('0x11'))('api');var utils=require(_0x1050('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x1050('0x13'));var db=require(_0x1050('0x14'))['db'];function respondWithStatusCode(_0x1ee20e,_0x4b9f78){_0x4b9f78=_0x4b9f78||0xcc;return function(_0x2e6fb9){if(_0x2e6fb9){return _0x1ee20e[_0x1050('0x15')](_0x4b9f78);}return _0x1ee20e[_0x1050('0x16')](_0x4b9f78)[_0x1050('0x17')]();};}function respondWithResult(_0x1d9244,_0x279996){_0x279996=_0x279996||0xc8;return function(_0x72ab9a){if(_0x72ab9a){return _0x1d9244[_0x1050('0x16')](_0x279996)['json'](_0x72ab9a);}};}function respondWithFilteredResult(_0x12e9d1,_0x130147){return function(_0x319d04){if(_0x319d04){var _0x3a24f8=typeof _0x130147['offset']==='undefined'&&typeof _0x130147['limit']===_0x1050('0x18');var _0x3b41c2=_0x319d04[_0x1050('0x19')];var _0x388742=_0x3a24f8?0x0:_0x130147['offset'];var _0x4df422=_0x3a24f8?_0x319d04[_0x1050('0x19')]:_0x130147[_0x1050('0x1a')]+_0x130147[_0x1050('0x1b')];var _0x20a4b1;if(_0x4df422>=_0x3b41c2){_0x4df422=_0x3b41c2;_0x20a4b1=0xc8;}else{_0x20a4b1=0xce;}_0x12e9d1[_0x1050('0x16')](_0x20a4b1);return _0x12e9d1[_0x1050('0x1c')]('Content-Range',_0x388742+'-'+_0x4df422+'/'+_0x3b41c2)[_0x1050('0x1d')](_0x319d04);}return null;};}function patchUpdates(_0x4a5c55){return function(_0x2df613){try{jsonpatch['apply'](_0x2df613,_0x4a5c55,!![]);}catch(_0x3a9bd8){return BPromise['reject'](_0x3a9bd8);}return _0x2df613[_0x1050('0x1e')]();};}function saveUpdates(_0x5f458e,_0x5d53f9){return function(_0x1818b5){if(_0x1818b5){return _0x1818b5[_0x1050('0x1f')](_0x5f458e)[_0x1050('0x20')](function(_0x4a1b0c){return _0x4a1b0c;});}return null;};}function removeEntity(_0x22dbc5,_0x2d333c){return function(_0x2154f5){if(_0x2154f5){return _0x2154f5['destroy']()[_0x1050('0x20')](function(){_0x22dbc5[_0x1050('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41a066,_0x42c140){return function(_0x2a8b91){if(!_0x2a8b91){_0x41a066['sendStatus'](0x194);}return _0x2a8b91;};}function handleError(_0x4956f1,_0x5cf2c3){_0x5cf2c3=_0x5cf2c3||0x1f4;return function(_0x24e9be){logger[_0x1050('0x21')](_0x24e9be[_0x1050('0x22')]);if(_0x24e9be[_0x1050('0x23')]){delete _0x24e9be[_0x1050('0x23')];}_0x4956f1[_0x1050('0x16')](_0x5cf2c3)['send'](_0x24e9be);};}exports[_0x1050('0x24')]=function(_0x353238,_0x23538a){var _0x348625={},_0x2b7c94={},_0x42b6c0={'count':0x0,'rows':[]};var _0x25edf2=_[_0x1050('0x25')](db[_0x1050('0x26')][_0x1050('0x27')],function(_0xa853d2){return{'name':_0xa853d2[_0x1050('0x28')],'type':_0xa853d2['type'][_0x1050('0x29')]};});_0x2b7c94[_0x1050('0x2a')]=_[_0x1050('0x25')](_0x25edf2,_0x1050('0x23'));_0x2b7c94[_0x1050('0x2b')]=_[_0x1050('0x2c')](_0x353238[_0x1050('0x2b')]);_0x2b7c94['filters']=_[_0x1050('0x2d')](_0x2b7c94[_0x1050('0x2a')],_0x2b7c94['query']);_0x348625[_0x1050('0x2e')]=_[_0x1050('0x2d')](_0x2b7c94[_0x1050('0x2a')],qs[_0x1050('0x2f')](_0x353238[_0x1050('0x2b')][_0x1050('0x2f')]));_0x348625[_0x1050('0x2e')]=_0x348625['attributes'][_0x1050('0x30')]?_0x348625['attributes']:_0x2b7c94[_0x1050('0x2a')];if(!_0x353238[_0x1050('0x2b')][_0x1050('0x31')](_0x1050('0x32'))){_0x348625[_0x1050('0x1b')]=qs[_0x1050('0x1b')](_0x353238[_0x1050('0x2b')][_0x1050('0x1b')]);_0x348625[_0x1050('0x1a')]=qs[_0x1050('0x1a')](_0x353238[_0x1050('0x2b')][_0x1050('0x1a')]);}_0x348625[_0x1050('0x33')]=qs[_0x1050('0x34')](_0x353238['query'][_0x1050('0x34')]);_0x348625[_0x1050('0x35')]=qs[_0x1050('0x36')](_[_0x1050('0x37')](_0x353238[_0x1050('0x2b')],_0x2b7c94[_0x1050('0x36')]),_0x25edf2);if(_0x353238[_0x1050('0x2b')][_0x1050('0x38')]){_0x348625[_0x1050('0x35')]=_[_0x1050('0x39')](_0x348625['where'],{'$or':_[_0x1050('0x25')](_0x25edf2,function(_0x4ce3fa){if(_0x4ce3fa['type']!==_0x1050('0x3a')){var _0x5056df={};_0x5056df[_0x4ce3fa['name']]={'$like':'%'+_0x353238[_0x1050('0x2b')][_0x1050('0x38')]+'%'};return _0x5056df;}})});}_0x348625=_[_0x1050('0x39')]({},_0x348625,_0x353238['options']);var _0x5eb6ad={'where':_0x348625[_0x1050('0x35')]};return db[_0x1050('0x26')][_0x1050('0x19')](_0x5eb6ad)[_0x1050('0x20')](function(_0x106586){_0x42b6c0[_0x1050('0x19')]=_0x106586;if(_0x353238[_0x1050('0x2b')]['includeAll']){_0x348625['include']=[{'all':!![]}];}return db[_0x1050('0x26')][_0x1050('0x3b')](_0x348625);})[_0x1050('0x20')](function(_0x575da4){_0x42b6c0[_0x1050('0x3c')]=_0x575da4;return _0x42b6c0;})[_0x1050('0x20')](respondWithFilteredResult(_0x23538a,_0x348625))[_0x1050('0x3d')](handleError(_0x23538a,null));};exports[_0x1050('0x3e')]=function(_0x530d58,_0x24ec99){var _0x423fc5={'raw':!![],'where':{'id':_0x530d58[_0x1050('0x3f')]['id']}},_0x1b8517={};_0x1b8517['model']=_[_0x1050('0x2c')](db[_0x1050('0x26')]['rawAttributes']);_0x1b8517['query']=_[_0x1050('0x2c')](_0x530d58[_0x1050('0x2b')]);_0x1b8517[_0x1050('0x36')]=_[_0x1050('0x2d')](_0x1b8517[_0x1050('0x2a')],_0x1b8517[_0x1050('0x2b')]);_0x423fc5['attributes']=_['intersection'](_0x1b8517[_0x1050('0x2a')],qs[_0x1050('0x2f')](_0x530d58[_0x1050('0x2b')]['fields']));_0x423fc5['attributes']=_0x423fc5[_0x1050('0x2e')][_0x1050('0x30')]?_0x423fc5[_0x1050('0x2e')]:_0x1b8517[_0x1050('0x2a')];if(_0x530d58[_0x1050('0x2b')][_0x1050('0x40')]){_0x423fc5[_0x1050('0x41')]=[{'all':!![]}];}_0x423fc5=_[_0x1050('0x39')]({},_0x423fc5,_0x530d58[_0x1050('0x42')]);return db[_0x1050('0x26')][_0x1050('0x43')](_0x423fc5)[_0x1050('0x20')](handleEntityNotFound(_0x24ec99,null))[_0x1050('0x20')](respondWithResult(_0x24ec99,null))['catch'](handleError(_0x24ec99,null));};exports['create']=function(_0x1ca57a,_0xf7dc0e){return db[_0x1050('0x26')][_0x1050('0x44')](_0x1ca57a['body'],{})[_0x1050('0x20')](respondWithResult(_0xf7dc0e,0xc9))[_0x1050('0x3d')](handleError(_0xf7dc0e,null));};exports[_0x1050('0x1f')]=function(_0x369193,_0x18e40e){if(_0x369193[_0x1050('0x45')]['id']){delete _0x369193[_0x1050('0x45')]['id'];}return db[_0x1050('0x26')][_0x1050('0x43')]({'where':{'id':_0x369193['params']['id']}})['then'](handleEntityNotFound(_0x18e40e,null))[_0x1050('0x20')](saveUpdates(_0x369193['body'],null))[_0x1050('0x20')](respondWithResult(_0x18e40e,null))[_0x1050('0x3d')](handleError(_0x18e40e,null));};exports[_0x1050('0x46')]=function(_0x52f6fe,_0x257181){return db[_0x1050('0x26')]['find']({'where':{'id':_0x52f6fe[_0x1050('0x3f')]['id']}})['then'](handleEntityNotFound(_0x257181,null))[_0x1050('0x20')](removeEntity(_0x257181,null))[_0x1050('0x3d')](handleError(_0x257181,null));};
\ No newline at end of file
index e6ca090..10cb709 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x950e=['salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','SalesforceField','int_salesforce_fields'];(function(_0x17a9dd,_0x578863){var _0x10d833=function(_0x8bcb36){while(--_0x8bcb36){_0x17a9dd['push'](_0x17a9dd['shift']());}};_0x10d833(++_0x578863);}(_0x950e,0xf1));var _0xe950=function(_0x31d866,_0x1e1e3b){_0x31d866=_0x31d866-0x0;var _0x399948=_0x950e[_0x31d866];return _0x399948;};'use strict';var _=require(_0xe950('0x0'));var util=require(_0xe950('0x1'));var logger=require(_0xe950('0x2'))(_0xe950('0x3'));var moment=require(_0xe950('0x4'));var BPromise=require(_0xe950('0x5'));var rp=require(_0xe950('0x6'));var fs=require('fs');var path=require(_0xe950('0x7'));var rimraf=require(_0xe950('0x8'));var config=require(_0xe950('0x9'));var attributes=require(_0xe950('0xa'));module[_0xe950('0xb')]=function(_0x57fe83,_0x5ee161){return _0x57fe83['define'](_0xe950('0xc'),attributes,{'tableName':_0xe950('0xd'),'paranoid':![],'indexes':[{'name':_0xe950('0xe'),'fields':[_0xe950('0xf'),_0xe950('0x10')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x183c=['exports','define','SalesforceField','salesforce_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSalesforceField.attributes'];(function(_0x2c1e7a,_0x155f86){var _0xcacb4f=function(_0x2b2eb3){while(--_0x2b2eb3){_0x2c1e7a['push'](_0x2c1e7a['shift']());}};_0xcacb4f(++_0x155f86);}(_0x183c,0x14f));var _0xc183=function(_0x5bb21c,_0x10705b){_0x5bb21c=_0x5bb21c-0x0;var _0x5d2fbc=_0x183c[_0x5bb21c];return _0x5d2fbc;};'use strict';var _=require(_0xc183('0x0'));var util=require(_0xc183('0x1'));var logger=require(_0xc183('0x2'))(_0xc183('0x3'));var moment=require(_0xc183('0x4'));var BPromise=require(_0xc183('0x5'));var rp=require(_0xc183('0x6'));var fs=require('fs');var path=require(_0xc183('0x7'));var rimraf=require(_0xc183('0x8'));var config=require('../../config/environment');var attributes=require(_0xc183('0x9'));module[_0xc183('0xa')]=function(_0x1fdc78,_0x36c372){return _0x1fdc78[_0xc183('0xb')](_0xc183('0xc'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0xc183('0xd'),'fields':['idField',_0xc183('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index bacd98a..558c085 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f62=['SalesforceField,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent'];(function(_0x7abd7,_0x1ca3f9){var _0x3a2577=function(_0x18456d){while(--_0x18456d){_0x7abd7['push'](_0x7abd7['shift']());}};_0x3a2577(++_0x1ca3f9);}(_0x9f62,0x68));var _0x29f6=function(_0x518e84,_0x4c3e3a){_0x518e84=_0x518e84-0x0;var _0x5ec2d6=_0x9f62[_0x518e84];return _0x5ec2d6;};'use strict';var _=require(_0x29f6('0x0'));var util=require(_0x29f6('0x1'));var moment=require(_0x29f6('0x2'));var BPromise=require(_0x29f6('0x3'));var rs=require(_0x29f6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x29f6('0x5'));var logger=require(_0x29f6('0x6'))(_0x29f6('0x7'));var config=require(_0x29f6('0x8'));var jayson=require(_0x29f6('0x9'));var client=jayson[_0x29f6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa5cf36,_0x55a306,_0x3f44ee){return new BPromise(function(_0x4db0bc,_0x2d7658){return client[_0x29f6('0xb')](_0xa5cf36,_0x3f44ee)[_0x29f6('0xc')](function(_0x1025eb){logger[_0x29f6('0xd')](_0x29f6('0xe'),_0x55a306,_0x29f6('0xf'));logger['debug'](_0x29f6('0x10'),_0x55a306,_0x29f6('0xf'),JSON['stringify'](_0x1025eb));if(_0x1025eb[_0x29f6('0x11')]){if(_0x1025eb[_0x29f6('0x11')]['code']===0x1f4){logger[_0x29f6('0x11')]('SalesforceField,\x20%s,\x20%s',_0x55a306,_0x1025eb[_0x29f6('0x11')][_0x29f6('0x12')]);return _0x2d7658(_0x1025eb[_0x29f6('0x11')][_0x29f6('0x12')]);}logger[_0x29f6('0x11')]('SalesforceField,\x20%s,\x20%s',_0x55a306,_0x1025eb[_0x29f6('0x11')][_0x29f6('0x12')]);return _0x4db0bc(_0x1025eb[_0x29f6('0x11')][_0x29f6('0x12')]);}else{logger[_0x29f6('0xd')](_0x29f6('0xe'),_0x55a306,'request\x20sent');_0x4db0bc(_0x1025eb['result'][_0x29f6('0x12')]);}})[_0x29f6('0x13')](function(_0x5c35a7){logger[_0x29f6('0x11')](_0x29f6('0xe'),_0x55a306,_0x5c35a7);_0x2d7658(_0x5c35a7);});});}
\ No newline at end of file
+var _0x5caa=['jayson/promise','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x268916,_0x1c27e1){var _0x38f8a4=function(_0x5e9ea6){while(--_0x5e9ea6){_0x268916['push'](_0x268916['shift']());}};_0x38f8a4(++_0x1c27e1);}(_0x5caa,0x10c));var _0xa5ca=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x5caa[_0x8c43de];return _0xa6591b;};'use strict';var _=require('lodash');var util=require(_0xa5ca('0x0'));var moment=require(_0xa5ca('0x1'));var BPromise=require(_0xa5ca('0x2'));var rs=require(_0xa5ca('0x3'));var fs=require('fs');var Redis=require(_0xa5ca('0x4'));var db=require(_0xa5ca('0x5'))['db'];var utils=require(_0xa5ca('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa5ca('0x7'));var jayson=require(_0xa5ca('0x8'));var client=jayson[_0xa5ca('0x9')][_0xa5ca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x272c64,_0x48cfb8,_0x2a3967){return new BPromise(function(_0x33b4b0,_0x54522f){return client[_0xa5ca('0xb')](_0x272c64,_0x2a3967)[_0xa5ca('0xc')](function(_0x45759f){logger[_0xa5ca('0xd')](_0xa5ca('0xe'),_0x48cfb8,_0xa5ca('0xf'));logger[_0xa5ca('0x10')](_0xa5ca('0x11'),_0x48cfb8,_0xa5ca('0xf'),JSON[_0xa5ca('0x12')](_0x45759f));if(_0x45759f[_0xa5ca('0x13')]){if(_0x45759f['error'][_0xa5ca('0x14')]===0x1f4){logger['error'](_0xa5ca('0xe'),_0x48cfb8,_0x45759f[_0xa5ca('0x13')][_0xa5ca('0x15')]);return _0x54522f(_0x45759f[_0xa5ca('0x13')][_0xa5ca('0x15')]);}logger[_0xa5ca('0x13')]('SalesforceField,\x20%s,\x20%s',_0x48cfb8,_0x45759f[_0xa5ca('0x13')]['message']);return _0x33b4b0(_0x45759f[_0xa5ca('0x13')][_0xa5ca('0x15')]);}else{logger[_0xa5ca('0xd')](_0xa5ca('0xe'),_0x48cfb8,_0xa5ca('0xf'));_0x33b4b0(_0x45759f[_0xa5ca('0x16')][_0xa5ca('0x15')]);}})['catch'](function(_0x3029f5){logger['error'](_0xa5ca('0xe'),_0x48cfb8,_0x3029f5);_0x54522f(_0x3029f5);});});}
\ No newline at end of file
index b75c776..b113121 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2504=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','index','isAuthenticated','show','/:id/configurations','getFields','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x574233,_0x5ca3ff){var _0x5595ab=function(_0x196e2b){while(--_0x196e2b){_0x574233['push'](_0x574233['shift']());}};_0x5595ab(++_0x5ca3ff);}(_0x2504,0xee));var _0x4250=function(_0x2d0f26,_0x209a8c){_0x2d0f26=_0x2d0f26-0x0;var _0x35dfd5=_0x2504[_0x2d0f26];return _0x35dfd5;};'use strict';var multer=require(_0x4250('0x0'));var util=require(_0x4250('0x1'));var path=require(_0x4250('0x2'));var timeout=require(_0x4250('0x3'));var express=require(_0x4250('0x4'));var router=express[_0x4250('0x5')]();var fs_extra=require(_0x4250('0x6'));var auth=require(_0x4250('0x7'));var interaction=require(_0x4250('0x8'));var config=require(_0x4250('0x9'));var controller=require(_0x4250('0xa'));router[_0x4250('0xb')]('/',auth['isAuthenticated'](),controller[_0x4250('0xc')]);router['get']('/:id',auth[_0x4250('0xd')](),controller[_0x4250('0xe')]);router[_0x4250('0xb')](_0x4250('0xf'),auth[_0x4250('0xd')](),controller['getConfigurations']);router[_0x4250('0xb')]('/:id/fields',auth[_0x4250('0xd')](),controller[_0x4250('0x10')]);router['post']('/',auth[_0x4250('0xd')](),controller['create']);router['post'](_0x4250('0xf'),auth[_0x4250('0xd')](),controller[_0x4250('0x11')]);router[_0x4250('0x12')](_0x4250('0x13'),auth['isAuthenticated'](),controller[_0x4250('0x14')]);router[_0x4250('0x15')](_0x4250('0x13'),auth[_0x4250('0xd')](),controller[_0x4250('0x16')]);module[_0x4250('0x17')]=router;
\ No newline at end of file
+var _0xd588=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','/:id','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x27e49a,_0x32735d){var _0x1cd4e5=function(_0x411255){while(--_0x411255){_0x27e49a['push'](_0x27e49a['shift']());}};_0x1cd4e5(++_0x32735d);}(_0xd588,0x195));var _0x8d58=function(_0x238e4e,_0x2755f4){_0x238e4e=_0x238e4e-0x0;var _0x58962f=_0xd588[_0x238e4e];return _0x58962f;};'use strict';var multer=require(_0x8d58('0x0'));var util=require('util');var path=require(_0x8d58('0x1'));var timeout=require(_0x8d58('0x2'));var express=require(_0x8d58('0x3'));var router=express[_0x8d58('0x4')]();var fs_extra=require(_0x8d58('0x5'));var auth=require(_0x8d58('0x6'));var interaction=require(_0x8d58('0x7'));var config=require(_0x8d58('0x8'));var controller=require(_0x8d58('0x9'));router[_0x8d58('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8d58('0xb'),auth[_0x8d58('0xc')](),controller[_0x8d58('0xd')]);router[_0x8d58('0xa')]('/:id/configurations',auth[_0x8d58('0xc')](),controller[_0x8d58('0xe')]);router[_0x8d58('0xa')](_0x8d58('0xf'),auth['isAuthenticated'](),controller[_0x8d58('0x10')]);router[_0x8d58('0x11')]('/',auth[_0x8d58('0xc')](),controller[_0x8d58('0x12')]);router[_0x8d58('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x8d58('0x13')]);router[_0x8d58('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x8d58('0x15')]);router[_0x8d58('0x16')](_0x8d58('0xb'),auth[_0x8d58('0xc')](),controller[_0x8d58('0x17')]);module[_0x8d58('0x18')]=router;
\ No newline at end of file
index a48d9e2..dd28c44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b42=['username','exports','STRING'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x1b42,0x13f));var _0x21b4=function(_0x465a8a,_0x3617ac){_0x465a8a=_0x465a8a-0x0;var _0x143d84=_0x1b42[_0x465a8a];return _0x143d84;};'use strict';var Sequelize=require('sequelize');module[_0x21b4('0x0')]={'name':{'type':Sequelize[_0x21b4('0x1')]},'description':{'type':Sequelize[_0x21b4('0x1')]},'username':{'type':Sequelize[_0x21b4('0x1')],'unique':_0x21b4('0x2')},'password':{'type':Sequelize[_0x21b4('0x1')]},'email':{'type':Sequelize[_0x21b4('0x1')]},'remoteUri':{'type':Sequelize[_0x21b4('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x21b4('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x8722=['sequelize','exports','STRING','username'];(function(_0x349c2b,_0x3c316f){var _0xb77279=function(_0x57c342){while(--_0x57c342){_0x349c2b['push'](_0x349c2b['shift']());}};_0xb77279(++_0x3c316f);}(_0x8722,0xc4));var _0x2872=function(_0x55fc56,_0xbe231f){_0x55fc56=_0x55fc56-0x0;var _0x2d5c9d=_0x8722[_0x55fc56];return _0x2d5c9d;};'use strict';var Sequelize=require(_0x2872('0x0'));module[_0x2872('0x1')]={'name':{'type':Sequelize[_0x2872('0x2')]},'description':{'type':Sequelize[_0x2872('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x2872('0x3')},'password':{'type':Sequelize[_0x2872('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2872('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x2872('0x2')],'allowNull':![]}};
\ No newline at end of file
index 79ff433..8b212d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8bea=['inactive','value','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','params','find','create','body','ServicenowConfiguration','getConfigurations','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','opened_at','group_list','work_end','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','parent_incident','sys_id','reopened_by','incident_state','urgency','problem_id','company','reassignment_count','activity_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','email','remoteUri','serverUrl','slice','lastIndexOf','format','%s/api/now/table/','GET','result','log','incident\x20table\x20objects','includes','forEach','internalType','label','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','push','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','true','false','sys_choice?sysparm_query=name=incident^element='];(function(_0x5d2f3c,_0x27d2db){var _0x21f77a=function(_0x5e3eae){while(--_0x5e3eae){_0x5d2f3c['push'](_0x5d2f3c['shift']());}};_0x21f77a(++_0x27d2db);}(_0x8bea,0xc1));var _0xa8be=function(_0x473ac3,_0xf8066a){_0x473ac3=_0x473ac3-0x0;var _0x563cfd=_0x8bea[_0x473ac3];return _0x563cfd;};'use strict';var emlformat=require(_0xa8be('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa8be('0x1'));var jsonpatch=require(_0xa8be('0x2'));var rp=require('request-promise');var moment=require(_0xa8be('0x3'));var BPromise=require(_0xa8be('0x4'));var Mustache=require(_0xa8be('0x5'));var util=require(_0xa8be('0x6'));var path=require(_0xa8be('0x7'));var sox=require(_0xa8be('0x8'));var csv=require(_0xa8be('0x9'));var ejs=require(_0xa8be('0xa'));var fs=require('fs');var fs_extra=require(_0xa8be('0xb'));var _=require(_0xa8be('0xc'));var squel=require(_0xa8be('0xd'));var crypto=require(_0xa8be('0xe'));var jsforce=require(_0xa8be('0xf'));var deskjs=require(_0xa8be('0x10'));var toCsv=require(_0xa8be('0x9'));var querystring=require(_0xa8be('0x11'));var Papa=require(_0xa8be('0x12'));var Redis=require(_0xa8be('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xa8be('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa8be('0x15'))('api');var utils=require(_0xa8be('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xa8be('0x17'));function respondWithStatusCode(_0x19bc0f,_0x4adf5c){_0x4adf5c=_0x4adf5c||0xcc;return function(_0x44167d){if(_0x44167d){return _0x19bc0f[_0xa8be('0x18')](_0x4adf5c);}return _0x19bc0f['status'](_0x4adf5c)['end']();};}function respondWithResult(_0x5885f2,_0x11a122){_0x11a122=_0x11a122||0xc8;return function(_0x4615d1){if(_0x4615d1){return _0x5885f2[_0xa8be('0x19')](_0x11a122)[_0xa8be('0x1a')](_0x4615d1);}};}function respondWithFilteredResult(_0x29e2bc,_0x187bb1){return function(_0x2351cb){if(_0x2351cb){var _0x2942fd=typeof _0x187bb1[_0xa8be('0x1b')]===_0xa8be('0x1c')&&typeof _0x187bb1[_0xa8be('0x1d')]==='undefined';var _0x2e6164=_0x2351cb['count'];var _0x495460=_0x2942fd?0x0:_0x187bb1[_0xa8be('0x1b')];var _0x69e0f=_0x2942fd?_0x2351cb[_0xa8be('0x1e')]:_0x187bb1[_0xa8be('0x1b')]+_0x187bb1[_0xa8be('0x1d')];var _0x195fad;if(_0x69e0f>=_0x2e6164){_0x69e0f=_0x2e6164;_0x195fad=0xc8;}else{_0x195fad=0xce;}_0x29e2bc[_0xa8be('0x19')](_0x195fad);return _0x29e2bc[_0xa8be('0x1f')](_0xa8be('0x20'),_0x495460+'-'+_0x69e0f+'/'+_0x2e6164)[_0xa8be('0x1a')](_0x2351cb);}return null;};}function patchUpdates(_0x40d1ac){return function(_0x580bfd){try{jsonpatch[_0xa8be('0x21')](_0x580bfd,_0x40d1ac,!![]);}catch(_0x305437){return BPromise[_0xa8be('0x22')](_0x305437);}return _0x580bfd[_0xa8be('0x23')]();};}function saveUpdates(_0x1cb876,_0x5dc77a){return function(_0x315c4b){if(_0x315c4b){return _0x315c4b[_0xa8be('0x24')](_0x1cb876)[_0xa8be('0x25')](function(_0x219ce8){return _0x219ce8;});}return null;};}function removeEntity(_0x3f1302,_0x4b60ec){return function(_0x5865f5){if(_0x5865f5){return _0x5865f5[_0xa8be('0x26')]()[_0xa8be('0x25')](function(){_0x3f1302['status'](0xcc)[_0xa8be('0x27')]();});}};}function handleEntityNotFound(_0x3a67ce,_0xd09b78){return function(_0x1273e3){if(!_0x1273e3){_0x3a67ce[_0xa8be('0x18')](0x194);}return _0x1273e3;};}function handleError(_0x411a28,_0x1f09cc){_0x1f09cc=_0x1f09cc||0x1f4;return function(_0x3b406b){logger[_0xa8be('0x28')](_0x3b406b[_0xa8be('0x29')]);if(_0x3b406b[_0xa8be('0x2a')]){delete _0x3b406b['name'];}_0x411a28[_0xa8be('0x19')](_0x1f09cc)[_0xa8be('0x2b')](_0x3b406b);};}exports[_0xa8be('0x2c')]=function(_0x5abdc9,_0x4b461f){var _0x462971={},_0x3b607e={},_0x43ff41={'count':0x0,'rows':[]};var _0x2b3e2c=_[_0xa8be('0x2d')](db[_0xa8be('0x2e')][_0xa8be('0x2f')],function(_0x110f16){return{'name':_0x110f16[_0xa8be('0x30')],'type':_0x110f16[_0xa8be('0x31')][_0xa8be('0x32')]};});_0x3b607e[_0xa8be('0x33')]=_[_0xa8be('0x2d')](_0x2b3e2c,'name');_0x3b607e[_0xa8be('0x34')]=_[_0xa8be('0x35')](_0x5abdc9[_0xa8be('0x34')]);_0x3b607e[_0xa8be('0x36')]=_['intersection'](_0x3b607e['model'],_0x3b607e[_0xa8be('0x34')]);_0x462971[_0xa8be('0x37')]=_[_0xa8be('0x38')](_0x3b607e[_0xa8be('0x33')],qs[_0xa8be('0x39')](_0x5abdc9[_0xa8be('0x34')][_0xa8be('0x39')]));_0x462971['attributes']=_0x462971[_0xa8be('0x37')][_0xa8be('0x3a')]?_0x462971['attributes']:_0x3b607e[_0xa8be('0x33')];if(!_0x5abdc9[_0xa8be('0x34')][_0xa8be('0x3b')]('nolimit')){_0x462971[_0xa8be('0x1d')]=qs[_0xa8be('0x1d')](_0x5abdc9[_0xa8be('0x34')][_0xa8be('0x1d')]);_0x462971[_0xa8be('0x1b')]=qs['offset'](_0x5abdc9[_0xa8be('0x34')][_0xa8be('0x1b')]);}_0x462971[_0xa8be('0x3c')]=qs[_0xa8be('0x3d')](_0x5abdc9['query'][_0xa8be('0x3d')]);_0x462971[_0xa8be('0x3e')]=qs[_0xa8be('0x36')](_[_0xa8be('0x3f')](_0x5abdc9[_0xa8be('0x34')],_0x3b607e[_0xa8be('0x36')]),_0x2b3e2c);if(_0x5abdc9['query'][_0xa8be('0x40')]){_0x462971[_0xa8be('0x3e')]=_['merge'](_0x462971[_0xa8be('0x3e')],{'$or':_[_0xa8be('0x2d')](_0x2b3e2c,function(_0x17838){if(_0x17838['type']!==_0xa8be('0x41')){var _0x4fdb8b={};_0x4fdb8b[_0x17838[_0xa8be('0x2a')]]={'$like':'%'+_0x5abdc9[_0xa8be('0x34')]['filter']+'%'};return _0x4fdb8b;}})});}_0x462971=_[_0xa8be('0x42')]({},_0x462971,_0x5abdc9[_0xa8be('0x43')]);var _0x2af2d2={'where':_0x462971[_0xa8be('0x3e')]};return db['ServicenowAccount'][_0xa8be('0x1e')](_0x2af2d2)[_0xa8be('0x25')](function(_0x59389f){_0x43ff41[_0xa8be('0x1e')]=_0x59389f;if(_0x5abdc9['query'][_0xa8be('0x44')]){_0x462971[_0xa8be('0x45')]=[{'all':!![]}];}return db[_0xa8be('0x2e')]['findAll'](_0x462971);})['then'](function(_0x417a7e){_0x43ff41[_0xa8be('0x46')]=_0x417a7e;return _0x43ff41;})[_0xa8be('0x25')](respondWithFilteredResult(_0x4b461f,_0x462971))[_0xa8be('0x47')](handleError(_0x4b461f,null));};exports['show']=function(_0x423e12,_0x1dff47){var _0x87cedd={'raw':![],'where':{'id':_0x423e12[_0xa8be('0x48')]['id']}},_0x3ebea2={};_0x3ebea2[_0xa8be('0x33')]=_[_0xa8be('0x35')](db['ServicenowAccount'][_0xa8be('0x2f')]);_0x3ebea2[_0xa8be('0x34')]=_[_0xa8be('0x35')](_0x423e12[_0xa8be('0x34')]);_0x3ebea2[_0xa8be('0x36')]=_[_0xa8be('0x38')](_0x3ebea2[_0xa8be('0x33')],_0x3ebea2[_0xa8be('0x34')]);_0x87cedd[_0xa8be('0x37')]=_[_0xa8be('0x38')](_0x3ebea2[_0xa8be('0x33')],qs['fields'](_0x423e12[_0xa8be('0x34')][_0xa8be('0x39')]));_0x87cedd['attributes']=_0x87cedd[_0xa8be('0x37')]['length']?_0x87cedd[_0xa8be('0x37')]:_0x3ebea2[_0xa8be('0x33')];if(_0x423e12[_0xa8be('0x34')][_0xa8be('0x44')]){_0x87cedd[_0xa8be('0x45')]=[{'all':!![]}];}_0x87cedd=_[_0xa8be('0x42')]({},_0x87cedd,_0x423e12['options']);return db['ServicenowAccount'][_0xa8be('0x49')](_0x87cedd)['then'](handleEntityNotFound(_0x1dff47,null))[_0xa8be('0x25')](respondWithResult(_0x1dff47,null))[_0xa8be('0x47')](handleError(_0x1dff47,null));};exports['create']=function(_0x5061b2,_0x26c073){return db[_0xa8be('0x2e')][_0xa8be('0x4a')](_0x5061b2['body'],{})[_0xa8be('0x25')](respondWithResult(_0x26c073,0xc9))['catch'](handleError(_0x26c073,null));};exports['update']=function(_0x3cf8e5,_0x2beae6){if(_0x3cf8e5[_0xa8be('0x4b')]['id']){delete _0x3cf8e5[_0xa8be('0x4b')]['id'];}return db[_0xa8be('0x2e')][_0xa8be('0x49')]({'where':{'id':_0x3cf8e5['params']['id']}})[_0xa8be('0x25')](handleEntityNotFound(_0x2beae6,null))['then'](saveUpdates(_0x3cf8e5[_0xa8be('0x4b')],null))['then'](respondWithResult(_0x2beae6,null))[_0xa8be('0x47')](handleError(_0x2beae6,null));};exports[_0xa8be('0x26')]=function(_0x3b78d0,_0x53841f){return db[_0xa8be('0x2e')][_0xa8be('0x49')]({'where':{'id':_0x3b78d0[_0xa8be('0x48')]['id']}})[_0xa8be('0x25')](handleEntityNotFound(_0x53841f,null))[_0xa8be('0x25')](removeEntity(_0x53841f,null))[_0xa8be('0x47')](handleError(_0x53841f,null));};exports['getConfigurations']=function(_0x5caee5,_0x2cfc79,_0x5a249b){var _0x5a9757={};var _0x2054eb={};var _0x246434;var _0x24aa97;return db[_0xa8be('0x2e')]['findOne']({'where':{'id':_0x5caee5[_0xa8be('0x48')]['id']}})[_0xa8be('0x25')](handleEntityNotFound(_0x2cfc79,null))[_0xa8be('0x25')](function(_0xccf577){if(_0xccf577){_0x246434=_0xccf577;_0x2054eb[_0xa8be('0x33')]=_[_0xa8be('0x35')](db[_0xa8be('0x4c')][_0xa8be('0x2f')]);_0x2054eb['query']=_[_0xa8be('0x35')](_0x5caee5['query']);_0x2054eb[_0xa8be('0x36')]=_[_0xa8be('0x38')](_0x2054eb[_0xa8be('0x33')],_0x2054eb['query']);_0x5a9757[_0xa8be('0x37')]=_[_0xa8be('0x38')](_0x2054eb[_0xa8be('0x33')],qs[_0xa8be('0x39')](_0x5caee5[_0xa8be('0x34')][_0xa8be('0x39')]));_0x5a9757[_0xa8be('0x37')]=_0x5a9757[_0xa8be('0x37')]['length']?_0x5a9757['attributes']:_0x2054eb[_0xa8be('0x33')];_0x5a9757[_0xa8be('0x3c')]=qs[_0xa8be('0x3d')](_0x5caee5[_0xa8be('0x34')][_0xa8be('0x3d')]);_0x5a9757[_0xa8be('0x3e')]=qs[_0xa8be('0x36')](_[_0xa8be('0x3f')](_0x5caee5['query'],_0x2054eb['filters']));if(_0x5caee5[_0xa8be('0x34')][_0xa8be('0x40')]){_0x5a9757[_0xa8be('0x3e')]=_[_0xa8be('0x42')](_0x5a9757[_0xa8be('0x3e')],{'$or':_[_0xa8be('0x2d')](_0x5a9757[_0xa8be('0x37')],function(_0x21dd08){var _0xa8f6f1={};_0xa8f6f1[_0x21dd08]={'$like':'%'+_0x5caee5[_0xa8be('0x34')][_0xa8be('0x40')]+'%'};return _0xa8f6f1;})});}_0x5a9757=_[_0xa8be('0x42')]({},_0x5a9757,_0x5caee5[_0xa8be('0x43')]);return _0x246434[_0xa8be('0x4d')](_0x5a9757);}})[_0xa8be('0x25')](function(_0x4be63e){if(_0x4be63e){_0x24aa97=_0x4be63e['length'];if(!_0x5caee5['query'][_0xa8be('0x3b')](_0xa8be('0x4e'))){_0x5a9757[_0xa8be('0x1d')]=qs[_0xa8be('0x1d')](_0x5caee5[_0xa8be('0x34')]['limit']);_0x5a9757[_0xa8be('0x1b')]=qs[_0xa8be('0x1b')](_0x5caee5[_0xa8be('0x34')][_0xa8be('0x1b')]);}return _0x246434[_0xa8be('0x4d')](_0x5a9757);}})[_0xa8be('0x25')](function(_0x554013){if(_0x554013){return _0x554013?{'count':_0x24aa97,'rows':_0x554013}:null;}})['then'](respondWithResult(_0x2cfc79,null))[_0xa8be('0x47')](handleError(_0x2cfc79,null));};exports[_0xa8be('0x4f')]=function(_0x3db698,_0xf7f533,_0x263f61){if(_0x3db698[_0xa8be('0x4b')]['id']){delete _0x3db698[_0xa8be('0x4b')]['id'];}return db[_0xa8be('0x2e')][_0xa8be('0x50')]({'where':{'id':_0x3db698[_0xa8be('0x48')]['id']}})[_0xa8be('0x25')](handleEntityNotFound(_0xf7f533,null))[_0xa8be('0x25')](function(_0x2e2b8a){if(_0x2e2b8a){_0x3db698[_0xa8be('0x4b')][_0xa8be('0x51')]=_0x2e2b8a['id'];_0x3db698['body'][_0xa8be('0x52')]=integrations[_0xa8be('0x53')](_0x3db698['body'][_0xa8be('0x54')],_0x3db698[_0xa8be('0x4b')][_0xa8be('0x31')]);_0x3db698['body'][_0xa8be('0x55')]=integrations[_0xa8be('0x56')](_0x3db698['body']['channel'],_0x3db698[_0xa8be('0x4b')][_0xa8be('0x31')]);return db[_0xa8be('0x4c')]['create'](_0x3db698[_0xa8be('0x4b')],{'include':[{'model':db['ServicenowField'],'as':'Subjects'},{'model':db['ServicenowField'],'as':_0xa8be('0x55')}]});}return null;})[_0xa8be('0x25')](respondWithResult(_0xf7f533,null))['catch'](handleError(_0xf7f533,null));};exports[_0xa8be('0x57')]=function(_0x509ab6,_0x3337e7,_0x1102c3){var _0x20f01a=[_0xa8be('0x58'),_0xa8be('0x59'),_0xa8be('0x5a'),_0xa8be('0x5b'),_0xa8be('0x5c'),_0xa8be('0x5d'),'incident_state',_0xa8be('0x5e'),_0xa8be('0x5f')];var _0x2bb54e=[_0xa8be('0x60'),_0xa8be('0x58'),_0xa8be('0x61'),_0xa8be('0x62'),_0xa8be('0x63'),_0xa8be('0x64'),_0xa8be('0x65'),_0xa8be('0x59'),_0xa8be('0x66'),_0xa8be('0x67'),'resolved_by',_0xa8be('0x68'),_0xa8be('0x69'),_0xa8be('0x6a'),_0xa8be('0x6b'),_0xa8be('0x6c'),_0xa8be('0x6d'),_0xa8be('0x6e'),_0xa8be('0x5a'),_0xa8be('0x3c'),'calendar_stc','closed_at',_0xa8be('0x6f'),_0xa8be('0x70'),_0xa8be('0x71'),_0xa8be('0x72'),_0xa8be('0x73'),_0xa8be('0x74'),_0xa8be('0x75'),_0xa8be('0x76'),_0xa8be('0x77'),_0xa8be('0x78'),'expected_start',_0xa8be('0x79'),'business_duration',_0xa8be('0x7a'),_0xa8be('0x7b'),'reopened_time',_0xa8be('0x7c'),_0xa8be('0x7d'),_0xa8be('0x7e'),'subcategory',_0xa8be('0x7f'),_0xa8be('0x80'),_0xa8be('0x5c'),_0xa8be('0x81'),_0xa8be('0x82'),_0xa8be('0x83'),_0xa8be('0x84'),_0xa8be('0x85'),_0xa8be('0x86'),_0xa8be('0x87'),_0xa8be('0x88'),_0xa8be('0x5d'),_0xa8be('0x89'),_0xa8be('0x8a'),_0xa8be('0x8b'),'follow_up',_0xa8be('0x8c'),_0xa8be('0x8d'),'contact_type',_0xa8be('0x8e'),_0xa8be('0x8f'),_0xa8be('0x90'),_0xa8be('0x91'),_0xa8be('0x92'),_0xa8be('0x93'),_0xa8be('0x94'),'assigned_to','severity','comments','sla_due',_0xa8be('0x95'),_0xa8be('0x96'),_0xa8be('0x97'),_0xa8be('0x98'),_0xa8be('0x99'),_0xa8be('0x9a'),_0xa8be('0x9b'),_0xa8be('0x9c'),_0xa8be('0x9d'),_0xa8be('0x9e'),'category'];var _0xdda2c='';var _0x106080='';var _0x90d4e3=[];var _0x21c60e='';var _0x3e78b5='';var _0x4add54=[];var _0x223a93='';var _0x26177d='';var _0x7e8ff5={};var _0x1371b8='';return db[_0xa8be('0x2e')][_0xa8be('0x50')]({'where':{'id':_0x509ab6[_0xa8be('0x48')]['id']},'attributes':['id',_0xa8be('0x9f'),_0xa8be('0xa0'),_0xa8be('0xa1'),_0xa8be('0xa2'),_0xa8be('0xa3')]})['then'](handleEntityNotFound(_0x3337e7,null))['then'](function(_0xab502d){if(_0xab502d){_0x1371b8=_0xab502d[_0xa8be('0xa2')];var _0x4ea35a=_0x1371b8[_0xa8be('0xa4')](-0x1);if(_0x4ea35a==='/'){_0x1371b8=_0x1371b8['substring'](0x0,_0x1371b8[_0xa8be('0xa5')](_0x4ea35a));}_0x26177d=util[_0xa8be('0xa6')]('%s/api/now/doc/table/schema/',_0x1371b8);_0x223a93=util[_0xa8be('0xa6')](_0xa8be('0xa7'),_0x1371b8);_0x7e8ff5={'user':_0xab502d['username'],'pass':_0xab502d[_0xa8be('0xa0')]};var _0x3ca0c2={'method':_0xa8be('0xa8'),'uri':_0x26177d+'incident?sysparm_display_value=all','auth':_0x7e8ff5,'json':!![]};return rp(_0x3ca0c2);}})[_0xa8be('0x25')](function(_0x3604d8){if(_0x3604d8[_0xa8be('0xa9')][_0xa8be('0x3a')]>0x0){_0xdda2c=_0x3604d8[_0xa8be('0xa9')];}console[_0xa8be('0xaa')](_0xa8be('0xab'),_0xdda2c);_0x4add54=[];_0x106080=Object['assign']([],_0xdda2c);_['remove'](_0x106080,function(_0x19c250){return!_0x20f01a[_0xa8be('0xac')](_0x19c250[_0xa8be('0x2a')]);});_0x106080[_0xa8be('0xad')](function(_0x110562){var _0x483a6c=createFieldObject(_0x223a93,_0x7e8ff5,_0x110562[_0xa8be('0xae')],_0x110562[_0xa8be('0x2a')],_0x110562[_0xa8be('0xaf')],![]);_0x4add54['push'](_0x483a6c);});return Promise[_0xa8be('0xb0')](_0x4add54);})['then'](function(_0x119453){_0x90d4e3=_0x119453;_0x21c60e=Object['assign']([],_0xdda2c);console['log'](_0xa8be('0xb1'),_0xdda2c);_['remove'](_0x21c60e,function(_0x57600c){return _0x2bb54e[_0xa8be('0xac')](_0x57600c[_0xa8be('0x2a')]);});console[_0xa8be('0xaa')](_0xa8be('0xb2'),_0x21c60e);_0x4add54=[];_0x21c60e[_0xa8be('0xad')](function(_0x5f17c6){var _0x178e0=createFieldObject(_0x223a93,_0x7e8ff5,_0x5f17c6[_0xa8be('0xae')],_0x5f17c6[_0xa8be('0x2a')],_0x5f17c6['label'],!![]);_0x4add54[_0xa8be('0xb3')](_0x178e0);});return Promise[_0xa8be('0xb0')](_0x4add54);})[_0xa8be('0x25')](function(_0x1fa9b2){_0x3e78b5=_0x1fa9b2;var _0x314beb=_0x90d4e3[_0xa8be('0xb4')](_0x3e78b5);return{'count':_0x314beb['length'],'rows':_0x314beb};})[_0xa8be('0x25')](respondWithResult(_0x3337e7,null))[_0xa8be('0x47')](function(_0x4c40c9){console['log'](_0xa8be('0xb5')+_0x4c40c9);var _0x12a0ba=_0x509ab6[_0xa8be('0x34')][_0xa8be('0xb6')]?0x1f4:_0x4c40c9[_0xa8be('0xb7')]||0x1f4;logger[_0xa8be('0x28')](_0x4c40c9[_0xa8be('0x29')]);delete _0x4c40c9['name'];if(_0x12a0ba===0x191){_0x12a0ba=0x190;}_0x3337e7['status'](_0x12a0ba)[_0xa8be('0x2b')](_0x509ab6[_0xa8be('0x34')]['test']?{'message':_0xa8be('0xb8'),'statusCode':_0x4c40c9['statusCode']}:_0x4c40c9);});};function createFieldObject(_0x30ad28,_0x4c0ec8,_0x428f12,_0x28292b,_0x5048bb,_0x529984){return new Promise(function(_0x417f38,_0x7fc350){var _0x2badb1={'id':_0x28292b,'name':_0x5048bb,'custom':_0x529984};if(_0x428f12===_0xa8be('0xb9')){_0x2badb1[_0xa8be('0x43')]=[{'name':'True','value':_0xa8be('0xba')},{'name':'False','value':_0xa8be('0xbb')}];_0x417f38(_0x2badb1);}else{var _0x52c301={'method':_0xa8be('0xa8'),'uri':_0x30ad28+_0xa8be('0xbc')+_0x28292b,'auth':_0x4c0ec8,'json':!![]};return rp(_0x52c301)[_0xa8be('0x25')](function(_0x144b30){var _0x411eff=[];if(_0x144b30[_0xa8be('0xa9')][_0xa8be('0x3a')]>0x0){_0x144b30['result'][_0xa8be('0xad')](function(_0x1ea095){if(_0x1ea095[_0xa8be('0xbd')]===_0xa8be('0xbb')){var _0x1cd2ec={'name':_0x1ea095[_0xa8be('0xaf')],'value':_0x1ea095[_0xa8be('0xbe')]};_0x411eff['push'](_0x1cd2ec);}});}_0x2badb1[_0xa8be('0x43')]=_0x411eff;if(_0x2badb1[_0xa8be('0x43')][_0xa8be('0x3a')]>0x0){_0x417f38(_0x2badb1);}else{if(_0x529984==![]){_0x417f38();}else{_0x417f38(_0x2badb1);}}});}});}
\ No newline at end of file
+var _0xfe1c=['findAll','catch','params','rawAttributes','create','body','find','getConfigurations','ServicenowConfiguration','addConfiguration','findOne','Subjects','Descriptions','channel','ServicenowField','getFields','knowledge','subcategory','notify','incident_state','severity','category','made_sla','upon_reject','hold_reason','approval_history','resolved_by','opened_by','user_input','sys_created_on','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','active','work_notes_list','business_service','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','caller_id','approval_set','work_notes','short_description','close_code','delivery_task','work_start','assignment_group','business_stc','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','contact_type','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','remoteUri','serverUrl','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','remove','forEach','internalType','label','push','all','log','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','True','False','sys_choice?sysparm_query=name=incident^element=','inactive','false','value','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','ServicenowAccount','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include'];(function(_0x45765b,_0x55564f){var _0x32305a=function(_0x154002){while(--_0x154002){_0x45765b['push'](_0x45765b['shift']());}};_0x32305a(++_0x55564f);}(_0xfe1c,0x11a));var _0xcfe1=function(_0x5043ed,_0x2b8a50){_0x5043ed=_0x5043ed-0x0;var _0x5becf0=_0xfe1c[_0x5043ed];return _0x5becf0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcfe1('0x0'));var jsonpatch=require(_0xcfe1('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcfe1('0x2'));var Mustache=require(_0xcfe1('0x3'));var util=require(_0xcfe1('0x4'));var path=require(_0xcfe1('0x5'));var sox=require(_0xcfe1('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcfe1('0x7'));var _=require('lodash');var squel=require(_0xcfe1('0x8'));var crypto=require(_0xcfe1('0x9'));var jsforce=require(_0xcfe1('0xa'));var deskjs=require(_0xcfe1('0xb'));var toCsv=require(_0xcfe1('0xc'));var querystring=require(_0xcfe1('0xd'));var Papa=require(_0xcfe1('0xe'));var Redis=require(_0xcfe1('0xf'));var authService=require(_0xcfe1('0x10'));var qs=require(_0xcfe1('0x11'));var as=require(_0xcfe1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xcfe1('0x13'));var config=require(_0xcfe1('0x14'));var licenseUtil=require(_0xcfe1('0x15'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4301d2,_0x1cdf51){_0x1cdf51=_0x1cdf51||0xcc;return function(_0xeefc78){if(_0xeefc78){return _0x4301d2['sendStatus'](_0x1cdf51);}return _0x4301d2[_0xcfe1('0x16')](_0x1cdf51)['end']();};}function respondWithResult(_0x1e7f90,_0x35e31c){_0x35e31c=_0x35e31c||0xc8;return function(_0x34915e){if(_0x34915e){return _0x1e7f90[_0xcfe1('0x16')](_0x35e31c)[_0xcfe1('0x17')](_0x34915e);}};}function respondWithFilteredResult(_0x24cad2,_0xf8c47e){return function(_0x41fb9e){if(_0x41fb9e){var _0x21a75e=typeof _0xf8c47e[_0xcfe1('0x18')]===_0xcfe1('0x19')&&typeof _0xf8c47e['limit']==='undefined';var _0x218093=_0x41fb9e[_0xcfe1('0x1a')];var _0xdd07fd=_0x21a75e?0x0:_0xf8c47e[_0xcfe1('0x18')];var _0x5f51a3=_0x21a75e?_0x41fb9e['count']:_0xf8c47e['offset']+_0xf8c47e[_0xcfe1('0x1b')];var _0x4ac288;if(_0x5f51a3>=_0x218093){_0x5f51a3=_0x218093;_0x4ac288=0xc8;}else{_0x4ac288=0xce;}_0x24cad2['status'](_0x4ac288);return _0x24cad2['set'](_0xcfe1('0x1c'),_0xdd07fd+'-'+_0x5f51a3+'/'+_0x218093)['json'](_0x41fb9e);}return null;};}function patchUpdates(_0x1b36a8){return function(_0x3ac854){try{jsonpatch[_0xcfe1('0x1d')](_0x3ac854,_0x1b36a8,!![]);}catch(_0x3373f6){return BPromise[_0xcfe1('0x1e')](_0x3373f6);}return _0x3ac854[_0xcfe1('0x1f')]();};}function saveUpdates(_0x3057a6,_0x5a0cf2){return function(_0x5a01eb){if(_0x5a01eb){return _0x5a01eb[_0xcfe1('0x20')](_0x3057a6)[_0xcfe1('0x21')](function(_0x18e977){return _0x18e977;});}return null;};}function removeEntity(_0x3663f7,_0x58ff5b){return function(_0x56c2bc){if(_0x56c2bc){return _0x56c2bc[_0xcfe1('0x22')]()[_0xcfe1('0x21')](function(){_0x3663f7[_0xcfe1('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe64f80,_0x15119d){return function(_0x248501){if(!_0x248501){_0xe64f80[_0xcfe1('0x23')](0x194);}return _0x248501;};}function handleError(_0x477890,_0x30f691){_0x30f691=_0x30f691||0x1f4;return function(_0x51ef7f){logger[_0xcfe1('0x24')](_0x51ef7f[_0xcfe1('0x25')]);if(_0x51ef7f['name']){delete _0x51ef7f[_0xcfe1('0x26')];}_0x477890[_0xcfe1('0x16')](_0x30f691)[_0xcfe1('0x27')](_0x51ef7f);};}exports['index']=function(_0x2b28d7,_0x389526){var _0x4b6d25={},_0x1bd2af={},_0x247f33={'count':0x0,'rows':[]};var _0x555ebb=_[_0xcfe1('0x28')](db[_0xcfe1('0x29')]['rawAttributes'],function(_0x6b001e){return{'name':_0x6b001e['fieldName'],'type':_0x6b001e['type'][_0xcfe1('0x2a')]};});_0x1bd2af[_0xcfe1('0x2b')]=_[_0xcfe1('0x28')](_0x555ebb,_0xcfe1('0x26'));_0x1bd2af[_0xcfe1('0x2c')]=_[_0xcfe1('0x2d')](_0x2b28d7[_0xcfe1('0x2c')]);_0x1bd2af[_0xcfe1('0x2e')]=_[_0xcfe1('0x2f')](_0x1bd2af[_0xcfe1('0x2b')],_0x1bd2af[_0xcfe1('0x2c')]);_0x4b6d25['attributes']=_['intersection'](_0x1bd2af[_0xcfe1('0x2b')],qs[_0xcfe1('0x30')](_0x2b28d7[_0xcfe1('0x2c')][_0xcfe1('0x30')]));_0x4b6d25[_0xcfe1('0x31')]=_0x4b6d25[_0xcfe1('0x31')][_0xcfe1('0x32')]?_0x4b6d25[_0xcfe1('0x31')]:_0x1bd2af['model'];if(!_0x2b28d7[_0xcfe1('0x2c')][_0xcfe1('0x33')]('nolimit')){_0x4b6d25[_0xcfe1('0x1b')]=qs[_0xcfe1('0x1b')](_0x2b28d7[_0xcfe1('0x2c')][_0xcfe1('0x1b')]);_0x4b6d25[_0xcfe1('0x18')]=qs[_0xcfe1('0x18')](_0x2b28d7[_0xcfe1('0x2c')][_0xcfe1('0x18')]);}_0x4b6d25['order']=qs[_0xcfe1('0x34')](_0x2b28d7[_0xcfe1('0x2c')][_0xcfe1('0x34')]);_0x4b6d25[_0xcfe1('0x35')]=qs[_0xcfe1('0x2e')](_[_0xcfe1('0x36')](_0x2b28d7[_0xcfe1('0x2c')],_0x1bd2af['filters']),_0x555ebb);if(_0x2b28d7[_0xcfe1('0x2c')][_0xcfe1('0x37')]){_0x4b6d25['where']=_['merge'](_0x4b6d25[_0xcfe1('0x35')],{'$or':_['map'](_0x555ebb,function(_0x480628){if(_0x480628[_0xcfe1('0x38')]!==_0xcfe1('0x39')){var _0x342771={};_0x342771[_0x480628[_0xcfe1('0x26')]]={'$like':'%'+_0x2b28d7[_0xcfe1('0x2c')]['filter']+'%'};return _0x342771;}})});}_0x4b6d25=_[_0xcfe1('0x3a')]({},_0x4b6d25,_0x2b28d7[_0xcfe1('0x3b')]);var _0x3ff352={'where':_0x4b6d25[_0xcfe1('0x35')]};return db[_0xcfe1('0x29')][_0xcfe1('0x1a')](_0x3ff352)[_0xcfe1('0x21')](function(_0x469c60){_0x247f33[_0xcfe1('0x1a')]=_0x469c60;if(_0x2b28d7[_0xcfe1('0x2c')][_0xcfe1('0x3c')]){_0x4b6d25[_0xcfe1('0x3d')]=[{'all':!![]}];}return db[_0xcfe1('0x29')][_0xcfe1('0x3e')](_0x4b6d25);})[_0xcfe1('0x21')](function(_0x1aaee0){_0x247f33['rows']=_0x1aaee0;return _0x247f33;})['then'](respondWithFilteredResult(_0x389526,_0x4b6d25))[_0xcfe1('0x3f')](handleError(_0x389526,null));};exports['show']=function(_0x3392b3,_0x8d6e81){var _0x3dab60={'raw':![],'where':{'id':_0x3392b3[_0xcfe1('0x40')]['id']}},_0x2a7bbc={};_0x2a7bbc[_0xcfe1('0x2b')]=_['keys'](db['ServicenowAccount'][_0xcfe1('0x41')]);_0x2a7bbc[_0xcfe1('0x2c')]=_['keys'](_0x3392b3[_0xcfe1('0x2c')]);_0x2a7bbc['filters']=_[_0xcfe1('0x2f')](_0x2a7bbc[_0xcfe1('0x2b')],_0x2a7bbc[_0xcfe1('0x2c')]);_0x3dab60[_0xcfe1('0x31')]=_[_0xcfe1('0x2f')](_0x2a7bbc[_0xcfe1('0x2b')],qs[_0xcfe1('0x30')](_0x3392b3[_0xcfe1('0x2c')][_0xcfe1('0x30')]));_0x3dab60[_0xcfe1('0x31')]=_0x3dab60['attributes'][_0xcfe1('0x32')]?_0x3dab60['attributes']:_0x2a7bbc['model'];if(_0x3392b3[_0xcfe1('0x2c')][_0xcfe1('0x3c')]){_0x3dab60['include']=[{'all':!![]}];}_0x3dab60=_['merge']({},_0x3dab60,_0x3392b3[_0xcfe1('0x3b')]);return db['ServicenowAccount']['find'](_0x3dab60)['then'](handleEntityNotFound(_0x8d6e81,null))[_0xcfe1('0x21')](respondWithResult(_0x8d6e81,null))['catch'](handleError(_0x8d6e81,null));};exports[_0xcfe1('0x42')]=function(_0x560f1e,_0x1d8a3c){return db[_0xcfe1('0x29')][_0xcfe1('0x42')](_0x560f1e[_0xcfe1('0x43')],{})[_0xcfe1('0x21')](respondWithResult(_0x1d8a3c,0xc9))['catch'](handleError(_0x1d8a3c,null));};exports[_0xcfe1('0x20')]=function(_0x8f86f4,_0x1ccd3f){if(_0x8f86f4[_0xcfe1('0x43')]['id']){delete _0x8f86f4['body']['id'];}return db[_0xcfe1('0x29')][_0xcfe1('0x44')]({'where':{'id':_0x8f86f4[_0xcfe1('0x40')]['id']}})[_0xcfe1('0x21')](handleEntityNotFound(_0x1ccd3f,null))[_0xcfe1('0x21')](saveUpdates(_0x8f86f4['body'],null))['then'](respondWithResult(_0x1ccd3f,null))[_0xcfe1('0x3f')](handleError(_0x1ccd3f,null));};exports[_0xcfe1('0x22')]=function(_0x295fc2,_0x174cab){return db[_0xcfe1('0x29')][_0xcfe1('0x44')]({'where':{'id':_0x295fc2[_0xcfe1('0x40')]['id']}})[_0xcfe1('0x21')](handleEntityNotFound(_0x174cab,null))[_0xcfe1('0x21')](removeEntity(_0x174cab,null))[_0xcfe1('0x3f')](handleError(_0x174cab,null));};exports[_0xcfe1('0x45')]=function(_0x2f6f93,_0x593f9a,_0x154dff){var _0xf836f1={};var _0x43ab60={};var _0x171cf1;var _0x461e19;return db[_0xcfe1('0x29')]['findOne']({'where':{'id':_0x2f6f93[_0xcfe1('0x40')]['id']}})[_0xcfe1('0x21')](handleEntityNotFound(_0x593f9a,null))[_0xcfe1('0x21')](function(_0x5788e1){if(_0x5788e1){_0x171cf1=_0x5788e1;_0x43ab60[_0xcfe1('0x2b')]=_['keys'](db[_0xcfe1('0x46')][_0xcfe1('0x41')]);_0x43ab60[_0xcfe1('0x2c')]=_[_0xcfe1('0x2d')](_0x2f6f93['query']);_0x43ab60[_0xcfe1('0x2e')]=_[_0xcfe1('0x2f')](_0x43ab60['model'],_0x43ab60[_0xcfe1('0x2c')]);_0xf836f1[_0xcfe1('0x31')]=_['intersection'](_0x43ab60['model'],qs['fields'](_0x2f6f93[_0xcfe1('0x2c')][_0xcfe1('0x30')]));_0xf836f1[_0xcfe1('0x31')]=_0xf836f1['attributes']['length']?_0xf836f1[_0xcfe1('0x31')]:_0x43ab60[_0xcfe1('0x2b')];_0xf836f1['order']=qs[_0xcfe1('0x34')](_0x2f6f93['query'][_0xcfe1('0x34')]);_0xf836f1[_0xcfe1('0x35')]=qs['filters'](_[_0xcfe1('0x36')](_0x2f6f93['query'],_0x43ab60[_0xcfe1('0x2e')]));if(_0x2f6f93[_0xcfe1('0x2c')][_0xcfe1('0x37')]){_0xf836f1['where']=_['merge'](_0xf836f1['where'],{'$or':_[_0xcfe1('0x28')](_0xf836f1['attributes'],function(_0x3a0ffb){var _0x2709a0={};_0x2709a0[_0x3a0ffb]={'$like':'%'+_0x2f6f93[_0xcfe1('0x2c')][_0xcfe1('0x37')]+'%'};return _0x2709a0;})});}_0xf836f1=_['merge']({},_0xf836f1,_0x2f6f93[_0xcfe1('0x3b')]);return _0x171cf1['getConfigurations'](_0xf836f1);}})['then'](function(_0x5a262d){if(_0x5a262d){_0x461e19=_0x5a262d[_0xcfe1('0x32')];if(!_0x2f6f93[_0xcfe1('0x2c')][_0xcfe1('0x33')]('nolimit')){_0xf836f1['limit']=qs['limit'](_0x2f6f93['query'][_0xcfe1('0x1b')]);_0xf836f1[_0xcfe1('0x18')]=qs['offset'](_0x2f6f93[_0xcfe1('0x2c')]['offset']);}return _0x171cf1[_0xcfe1('0x45')](_0xf836f1);}})['then'](function(_0x1b7624){if(_0x1b7624){return _0x1b7624?{'count':_0x461e19,'rows':_0x1b7624}:null;}})['then'](respondWithResult(_0x593f9a,null))[_0xcfe1('0x3f')](handleError(_0x593f9a,null));};exports[_0xcfe1('0x47')]=function(_0x1efbb5,_0x1841bc,_0x42e3b6){if(_0x1efbb5[_0xcfe1('0x43')]['id']){delete _0x1efbb5[_0xcfe1('0x43')]['id'];}return db[_0xcfe1('0x29')][_0xcfe1('0x48')]({'where':{'id':_0x1efbb5['params']['id']}})['then'](handleEntityNotFound(_0x1841bc,null))[_0xcfe1('0x21')](function(_0x356e36){if(_0x356e36){_0x1efbb5[_0xcfe1('0x43')]['AccountId']=_0x356e36['id'];_0x1efbb5[_0xcfe1('0x43')][_0xcfe1('0x49')]=integrations['getSubjects'](_0x1efbb5[_0xcfe1('0x43')]['channel'],_0x1efbb5[_0xcfe1('0x43')][_0xcfe1('0x38')]);_0x1efbb5[_0xcfe1('0x43')][_0xcfe1('0x4a')]=integrations['getDescriptions'](_0x1efbb5[_0xcfe1('0x43')][_0xcfe1('0x4b')],_0x1efbb5[_0xcfe1('0x43')][_0xcfe1('0x38')]);return db[_0xcfe1('0x46')]['create'](_0x1efbb5[_0xcfe1('0x43')],{'include':[{'model':db[_0xcfe1('0x4c')],'as':_0xcfe1('0x49')},{'model':db[_0xcfe1('0x4c')],'as':_0xcfe1('0x4a')}]});}return null;})[_0xcfe1('0x21')](respondWithResult(_0x1841bc,null))['catch'](handleError(_0x1841bc,null));};exports[_0xcfe1('0x4d')]=function(_0x3f4cd5,_0x185e77,_0x112829){var _0x5227b7=['made_sla','hold_reason',_0xcfe1('0x4e'),_0xcfe1('0x4f'),'close_code',_0xcfe1('0x50'),_0xcfe1('0x51'),_0xcfe1('0x52'),_0xcfe1('0x53')];var _0xa26293=['parent',_0xcfe1('0x54'),'caused_by','watch_list',_0xcfe1('0x55'),'sys_updated_on','child_incidents',_0xcfe1('0x56'),_0xcfe1('0x57'),'number',_0xcfe1('0x58'),'sys_updated_by',_0xcfe1('0x59'),_0xcfe1('0x5a'),_0xcfe1('0x5b'),'sys_domain',_0xcfe1('0x5c'),_0xcfe1('0x5d'),_0xcfe1('0x4e'),'order',_0xcfe1('0x5e'),_0xcfe1('0x5f'),_0xcfe1('0x60'),_0xcfe1('0x61'),'impact',_0xcfe1('0x62'),_0xcfe1('0x63'),_0xcfe1('0x64'),'priority','sys_domain_path','rfc','time_worked',_0xcfe1('0x65'),_0xcfe1('0x66'),_0xcfe1('0x67'),_0xcfe1('0x68'),_0xcfe1('0x69'),_0xcfe1('0x6a'),'resolved_at',_0xcfe1('0x6b'),_0xcfe1('0x6c'),_0xcfe1('0x4f'),_0xcfe1('0x6d'),_0xcfe1('0x6e'),_0xcfe1('0x6f'),'correlation_display',_0xcfe1('0x70'),_0xcfe1('0x71'),_0xcfe1('0x72'),_0xcfe1('0x73'),'additional_assignee_list',_0xcfe1('0x74'),_0xcfe1('0x75'),'notify',_0xcfe1('0x76'),_0xcfe1('0x77'),_0xcfe1('0x78'),_0xcfe1('0x79'),_0xcfe1('0x7a'),'sys_id',_0xcfe1('0x7b'),'reopened_by',_0xcfe1('0x51'),_0xcfe1('0x7c'),_0xcfe1('0x7d'),_0xcfe1('0x7e'),_0xcfe1('0x7f'),_0xcfe1('0x80'),_0xcfe1('0x81'),_0xcfe1('0x52'),_0xcfe1('0x82'),_0xcfe1('0x83'),_0xcfe1('0x84'),'comments_and_work_notes',_0xcfe1('0x85'),_0xcfe1('0x86'),_0xcfe1('0x87'),_0xcfe1('0x88'),_0xcfe1('0x89'),_0xcfe1('0x8a'),_0xcfe1('0x8b'),_0xcfe1('0x8c'),_0xcfe1('0x53')];var _0x3f7330='';var _0x56c7ef='';var _0x27f80b=[];var _0x577b5d='';var _0x2c3d92='';var _0xe01561=[];var _0x25ab7c='';var _0x2b5eed='';var _0x41a503={};var _0x1658f4='';return db[_0xcfe1('0x29')][_0xcfe1('0x48')]({'where':{'id':_0x3f4cd5[_0xcfe1('0x40')]['id']},'attributes':['id','username','password','email',_0xcfe1('0x8d'),_0xcfe1('0x8e')]})['then'](handleEntityNotFound(_0x185e77,null))[_0xcfe1('0x21')](function(_0x4b2427){if(_0x4b2427){_0x1658f4=_0x4b2427[_0xcfe1('0x8d')];var _0x36e0b0=_0x1658f4['slice'](-0x1);if(_0x36e0b0==='/'){_0x1658f4=_0x1658f4[_0xcfe1('0x8f')](0x0,_0x1658f4[_0xcfe1('0x90')](_0x36e0b0));}_0x2b5eed=util[_0xcfe1('0x91')](_0xcfe1('0x92'),_0x1658f4);_0x25ab7c=util['format'](_0xcfe1('0x93'),_0x1658f4);_0x41a503={'user':_0x4b2427['username'],'pass':_0x4b2427['password']};var _0x3549db={'method':_0xcfe1('0x94'),'uri':_0x2b5eed+_0xcfe1('0x95'),'auth':_0x41a503,'json':!![]};return rp(_0x3549db);}})['then'](function(_0x1f1c27){if(_0x1f1c27[_0xcfe1('0x96')][_0xcfe1('0x32')]>0x0){_0x3f7330=_0x1f1c27[_0xcfe1('0x96')];}console['log'](_0xcfe1('0x97'),_0x3f7330);_0xe01561=[];_0x56c7ef=Object[_0xcfe1('0x98')]([],_0x3f7330);_[_0xcfe1('0x99')](_0x56c7ef,function(_0x497fd7){return!_0x5227b7['includes'](_0x497fd7[_0xcfe1('0x26')]);});_0x56c7ef[_0xcfe1('0x9a')](function(_0x17d786){var _0x6821e4=createFieldObject(_0x25ab7c,_0x41a503,_0x17d786[_0xcfe1('0x9b')],_0x17d786[_0xcfe1('0x26')],_0x17d786[_0xcfe1('0x9c')],![]);_0xe01561[_0xcfe1('0x9d')](_0x6821e4);});return Promise[_0xcfe1('0x9e')](_0xe01561);})[_0xcfe1('0x21')](function(_0x445bdf){_0x27f80b=_0x445bdf;_0x577b5d=Object[_0xcfe1('0x98')]([],_0x3f7330);console[_0xcfe1('0x9f')](_0xcfe1('0xa0'),_0x3f7330);_['remove'](_0x577b5d,function(_0x38ba33){return _0xa26293[_0xcfe1('0xa1')](_0x38ba33['name']);});console[_0xcfe1('0x9f')](_0xcfe1('0xa2'),_0x577b5d);_0xe01561=[];_0x577b5d[_0xcfe1('0x9a')](function(_0x4431ee){var _0x53cfd9=createFieldObject(_0x25ab7c,_0x41a503,_0x4431ee[_0xcfe1('0x9b')],_0x4431ee[_0xcfe1('0x26')],_0x4431ee[_0xcfe1('0x9c')],!![]);_0xe01561[_0xcfe1('0x9d')](_0x53cfd9);});return Promise[_0xcfe1('0x9e')](_0xe01561);})[_0xcfe1('0x21')](function(_0x29c997){_0x2c3d92=_0x29c997;var _0x3bc7f5=_0x27f80b[_0xcfe1('0xa3')](_0x2c3d92);return{'count':_0x3bc7f5[_0xcfe1('0x32')],'rows':_0x3bc7f5};})[_0xcfe1('0x21')](respondWithResult(_0x185e77,null))[_0xcfe1('0x3f')](function(_0x28c7a6){console[_0xcfe1('0x9f')](_0xcfe1('0xa4')+_0x28c7a6);var _0x3731ca=_0x3f4cd5[_0xcfe1('0x2c')]['test']?0x1f4:_0x28c7a6['statusCode']||0x1f4;logger[_0xcfe1('0x24')](_0x28c7a6[_0xcfe1('0x25')]);delete _0x28c7a6[_0xcfe1('0x26')];if(_0x3731ca===0x191){_0x3731ca=0x190;}_0x185e77[_0xcfe1('0x16')](_0x3731ca)[_0xcfe1('0x27')](_0x3f4cd5['query'][_0xcfe1('0xa5')]?{'message':'Wrong\x20credentials','statusCode':_0x28c7a6['statusCode']}:_0x28c7a6);});};function createFieldObject(_0x98f029,_0xe44ee5,_0x20261a,_0x112e1b,_0x7a0097,_0x1e61b9){return new Promise(function(_0x142763,_0x4b913c){var _0x404990={'id':_0x112e1b,'name':_0x7a0097,'custom':_0x1e61b9};if(_0x20261a==='boolean'){_0x404990['options']=[{'name':_0xcfe1('0xa6'),'value':'true'},{'name':_0xcfe1('0xa7'),'value':'false'}];_0x142763(_0x404990);}else{var _0x7ab921={'method':_0xcfe1('0x94'),'uri':_0x98f029+_0xcfe1('0xa8')+_0x112e1b,'auth':_0xe44ee5,'json':!![]};return rp(_0x7ab921)[_0xcfe1('0x21')](function(_0x5c492b){var _0x3ec758=[];if(_0x5c492b[_0xcfe1('0x96')]['length']>0x0){_0x5c492b[_0xcfe1('0x96')]['forEach'](function(_0x24b13c){if(_0x24b13c[_0xcfe1('0xa9')]===_0xcfe1('0xaa')){var _0x513773={'name':_0x24b13c[_0xcfe1('0x9c')],'value':_0x24b13c[_0xcfe1('0xab')]};_0x3ec758['push'](_0x513773);}});}_0x404990['options']=_0x3ec758;if(_0x404990['options'][_0xcfe1('0x32')]>0x0){_0x142763(_0x404990);}else{if(_0x1e61b9==![]){_0x142763();}else{_0x142763(_0x404990);}}});}});}
\ No newline at end of file
index b531c2d..1224706 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1c6=['rimraf','../../components/integrations/configuration','define','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x512001,_0x5b1940){var _0x3ffddf=function(_0x221200){while(--_0x221200){_0x512001['push'](_0x512001['shift']());}};_0x3ffddf(++_0x5b1940);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x2ba8e7,_0x5dd591){_0x2ba8e7=_0x2ba8e7-0x0;var _0x427856=_0xc1c6[_0x2ba8e7];return _0x427856;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var logger=require(_0x6c1c('0x2'))('api');var moment=require(_0x6c1c('0x3'));var BPromise=require('bluebird');var rp=require(_0x6c1c('0x4'));var fs=require('fs');var path=require(_0x6c1c('0x5'));var rimraf=require(_0x6c1c('0x6'));var config=require('../../config/environment');var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0x6c1c('0x7'));module['exports']=function(_0x50c1bb,_0x582bec){return _0x50c1bb[_0x6c1c('0x8')](_0x6c1c('0x9'),attributes,{'tableName':_0x6c1c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb138=['int_servicenow_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','exports','define','ServicenowAccount'];(function(_0x1b9339,_0x10ec96){var _0x1354e4=function(_0x593b36){while(--_0x593b36){_0x1b9339['push'](_0x1b9339['shift']());}};_0x1354e4(++_0x10ec96);}(_0xb138,0x1dd));var _0x8b13=function(_0x4a705a,_0x13c990){_0x4a705a=_0x4a705a-0x0;var _0x37e5bd=_0xb138[_0x4a705a];return _0x37e5bd;};'use strict';var _=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var logger=require(_0x8b13('0x2'))(_0x8b13('0x3'));var moment=require(_0x8b13('0x4'));var BPromise=require(_0x8b13('0x5'));var rp=require(_0x8b13('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var attributes=require(_0x8b13('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x8b13('0xa')]=function(_0x13f7bd,_0x5d51b1){return _0x13f7bd[_0x8b13('0xb')](_0x8b13('0xc'),attributes,{'tableName':_0x8b13('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cc9648a..2045048 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x895d=['ServicenowAccount','findAll','options','where','limit','map','include','attributes','model','catch','ShowServicenowAccount','find','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','debug','request\x20sent','error','ServicenowAccount,\x20%s,\x20%s','message','result','GetServicenowAccount'];(function(_0x58765f,_0x10e464){var _0x834973=function(_0xb7eb02){while(--_0xb7eb02){_0x58765f['push'](_0x58765f['shift']());}};_0x834973(++_0x10e464);}(_0x895d,0xd9));var _0xd895=function(_0x434161,_0x48bf7d){_0x434161=_0x434161-0x0;var _0x51f6fc=_0x895d[_0x434161];return _0x51f6fc;};'use strict';var _=require(_0xd895('0x0'));var util=require(_0xd895('0x1'));var moment=require(_0xd895('0x2'));var BPromise=require(_0xd895('0x3'));var rs=require(_0xd895('0x4'));var fs=require('fs');var Redis=require(_0xd895('0x5'));var db=require(_0xd895('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd895('0x7'))('rpc');var config=require(_0xd895('0x8'));var jayson=require(_0xd895('0x9'));var client=jayson[_0xd895('0xa')][_0xd895('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b7c5a,_0x178fed,_0x4ae4c6){return new BPromise(function(_0x2e78e2,_0x1bba65){return client['request'](_0x5b7c5a,_0x4ae4c6)[_0xd895('0xc')](function(_0x2f8a2a){logger[_0xd895('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x178fed,'request\x20sent');logger[_0xd895('0xe')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x178fed,_0xd895('0xf'),JSON['stringify'](_0x2f8a2a));if(_0x2f8a2a[_0xd895('0x10')]){if(_0x2f8a2a['error']['code']===0x1f4){logger[_0xd895('0x10')](_0xd895('0x11'),_0x178fed,_0x2f8a2a[_0xd895('0x10')][_0xd895('0x12')]);return _0x1bba65(_0x2f8a2a[_0xd895('0x10')][_0xd895('0x12')]);}logger['error'](_0xd895('0x11'),_0x178fed,_0x2f8a2a[_0xd895('0x10')][_0xd895('0x12')]);return _0x2e78e2(_0x2f8a2a[_0xd895('0x10')]['message']);}else{logger[_0xd895('0xd')](_0xd895('0x11'),_0x178fed,'request\x20sent');_0x2e78e2(_0x2f8a2a[_0xd895('0x13')][_0xd895('0x12')]);}})['catch'](function(_0xf68cfd){logger[_0xd895('0x10')](_0xd895('0x11'),_0x178fed,_0xf68cfd);_0x1bba65(_0xf68cfd);});});}exports[_0xd895('0x14')]=function(_0x486e0d){var _0x5478c2=this;return new Promise(function(_0x4a3378,_0x5a99b9){return db[_0xd895('0x15')][_0xd895('0x16')]({'raw':_0x486e0d[_0xd895('0x17')]?_0x486e0d[_0xd895('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x486e0d[_0xd895('0x17')]?_0x486e0d[_0xd895('0x17')][_0xd895('0x18')]||null:null,'attributes':_0x486e0d[_0xd895('0x17')]?_0x486e0d[_0xd895('0x17')]['attributes']||null:null,'limit':_0x486e0d['options']?_0x486e0d[_0xd895('0x17')][_0xd895('0x19')]||null:null,'include':_0x486e0d[_0xd895('0x17')]?_0x486e0d[_0xd895('0x17')]['include']?_[_0xd895('0x1a')](_0x486e0d[_0xd895('0x17')][_0xd895('0x1b')],function(_0x32a618){return{'model':db[_0x32a618['model']],'as':_0x32a618['as'],'attributes':_0x32a618[_0xd895('0x1c')],'include':_0x32a618['include']?_['map'](_0x32a618[_0xd895('0x1b')],function(_0x557317){return{'model':db[_0x557317[_0xd895('0x1d')]],'as':_0x557317['as'],'attributes':_0x557317[_0xd895('0x1c')],'include':_0x557317[_0xd895('0x1b')]?_[_0xd895('0x1a')](_0x557317['include'],function(_0x4e8d27){return{'model':db[_0x4e8d27[_0xd895('0x1d')]],'as':_0x4e8d27['as'],'attributes':_0x4e8d27['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3da657){logger[_0xd895('0xd')]('GetServicenowAccount',_0x486e0d);logger[_0xd895('0xe')](_0xd895('0x14'),_0x486e0d,JSON['stringify'](_0x3da657));_0x4a3378(_0x3da657);})[_0xd895('0x1e')](function(_0x11c8c3){logger[_0xd895('0x10')](_0xd895('0x14'),_0x11c8c3['message'],_0x486e0d);_0x5a99b9(_0x5478c2[_0xd895('0x10')](0x1f4,_0x11c8c3['message']));});});};exports[_0xd895('0x1f')]=function(_0x1850e3){var _0x2ed3cb=this;return new Promise(function(_0x4b1d6b,_0x19dffa){return db[_0xd895('0x15')][_0xd895('0x20')]({'raw':_0x1850e3[_0xd895('0x17')]?_0x1850e3[_0xd895('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1850e3['options']?_0x1850e3['options']['where']||null:null,'attributes':_0x1850e3[_0xd895('0x17')]?_0x1850e3[_0xd895('0x17')]['attributes']||null:null,'include':_0x1850e3[_0xd895('0x17')]?_0x1850e3[_0xd895('0x17')][_0xd895('0x1b')]?_['map'](_0x1850e3[_0xd895('0x17')][_0xd895('0x1b')],function(_0x445c99){return{'model':db[_0x445c99[_0xd895('0x1d')]],'as':_0x445c99['as'],'attributes':_0x445c99[_0xd895('0x1c')],'include':_0x445c99[_0xd895('0x1b')]?_[_0xd895('0x1a')](_0x445c99['include'],function(_0x506131){return{'model':db[_0x506131[_0xd895('0x1d')]],'as':_0x506131['as'],'attributes':_0x506131[_0xd895('0x1c')],'include':_0x506131[_0xd895('0x1b')]?_[_0xd895('0x1a')](_0x506131[_0xd895('0x1b')],function(_0x5e4360){return{'model':db[_0x5e4360[_0xd895('0x1d')]],'as':_0x5e4360['as'],'attributes':_0x5e4360['attributes']};}):[]};}):[]};}):[]:[]})[_0xd895('0xc')](function(_0x3c1e8d){logger[_0xd895('0xd')]('ShowServicenowAccount',_0x1850e3);logger[_0xd895('0xe')](_0xd895('0x1f'),_0x1850e3,JSON[_0xd895('0x21')](_0x3c1e8d));_0x4b1d6b(_0x3c1e8d);})[_0xd895('0x1e')](function(_0x281eb5){logger[_0xd895('0x10')]('ShowServicenowAccount',_0x281eb5[_0xd895('0x12')],_0x1850e3);_0x19dffa(_0x2ed3cb['error'](0x1f4,_0x281eb5['message']));});});};
\ No newline at end of file
+var _0x2329=['attributes','limit','include','model','map','catch','find','raw','ShowServicenowAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetServicenowAccount','ServicenowAccount','findAll','options','where'];(function(_0x5476fc,_0x34a4b2){var _0x2a4764=function(_0x48e41f){while(--_0x48e41f){_0x5476fc['push'](_0x5476fc['shift']());}};_0x2a4764(++_0x34a4b2);}(_0x2329,0xa5));var _0x9232=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2329[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x9232('0x0'));var moment=require(_0x9232('0x1'));var BPromise=require(_0x9232('0x2'));var rs=require(_0x9232('0x3'));var fs=require('fs');var Redis=require(_0x9232('0x4'));var db=require(_0x9232('0x5'))['db'];var utils=require(_0x9232('0x6'));var logger=require(_0x9232('0x7'))(_0x9232('0x8'));var config=require(_0x9232('0x9'));var jayson=require(_0x9232('0xa'));var client=jayson[_0x9232('0xb')][_0x9232('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xb47272,_0x2c9641,_0x238c5){return new BPromise(function(_0x5247fa,_0x421685){return client[_0x9232('0xd')](_0xb47272,_0x238c5)[_0x9232('0xe')](function(_0x2ed211){logger[_0x9232('0xf')](_0x9232('0x10'),_0x2c9641,_0x9232('0x11'));logger[_0x9232('0x12')](_0x9232('0x13'),_0x2c9641,'request\x20sent',JSON[_0x9232('0x14')](_0x2ed211));if(_0x2ed211['error']){if(_0x2ed211['error'][_0x9232('0x15')]===0x1f4){logger[_0x9232('0x16')](_0x9232('0x10'),_0x2c9641,_0x2ed211[_0x9232('0x16')][_0x9232('0x17')]);return _0x421685(_0x2ed211[_0x9232('0x16')]['message']);}logger[_0x9232('0x16')]('ServicenowAccount,\x20%s,\x20%s',_0x2c9641,_0x2ed211[_0x9232('0x16')][_0x9232('0x17')]);return _0x5247fa(_0x2ed211[_0x9232('0x16')][_0x9232('0x17')]);}else{logger[_0x9232('0xf')](_0x9232('0x10'),_0x2c9641,_0x9232('0x11'));_0x5247fa(_0x2ed211[_0x9232('0x18')][_0x9232('0x17')]);}})['catch'](function(_0x6f5e25){logger[_0x9232('0x16')]('ServicenowAccount,\x20%s,\x20%s',_0x2c9641,_0x6f5e25);_0x421685(_0x6f5e25);});});}exports[_0x9232('0x19')]=function(_0x5a7223){var _0xa9a812=this;return new Promise(function(_0x2cc154,_0x48c98e){return db[_0x9232('0x1a')][_0x9232('0x1b')]({'raw':_0x5a7223[_0x9232('0x1c')]?_0x5a7223[_0x9232('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5a7223[_0x9232('0x1c')]?_0x5a7223[_0x9232('0x1c')][_0x9232('0x1d')]||null:null,'attributes':_0x5a7223[_0x9232('0x1c')]?_0x5a7223[_0x9232('0x1c')][_0x9232('0x1e')]||null:null,'limit':_0x5a7223['options']?_0x5a7223['options'][_0x9232('0x1f')]||null:null,'include':_0x5a7223[_0x9232('0x1c')]?_0x5a7223[_0x9232('0x1c')][_0x9232('0x20')]?_['map'](_0x5a7223[_0x9232('0x1c')][_0x9232('0x20')],function(_0xddef8d){return{'model':db[_0xddef8d[_0x9232('0x21')]],'as':_0xddef8d['as'],'attributes':_0xddef8d[_0x9232('0x1e')],'include':_0xddef8d[_0x9232('0x20')]?_[_0x9232('0x22')](_0xddef8d[_0x9232('0x20')],function(_0x29b434){return{'model':db[_0x29b434[_0x9232('0x21')]],'as':_0x29b434['as'],'attributes':_0x29b434[_0x9232('0x1e')],'include':_0x29b434[_0x9232('0x20')]?_['map'](_0x29b434[_0x9232('0x20')],function(_0x2207a9){return{'model':db[_0x2207a9[_0x9232('0x21')]],'as':_0x2207a9['as'],'attributes':_0x2207a9['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x496644){logger[_0x9232('0xf')]('GetServicenowAccount',_0x5a7223);logger[_0x9232('0x12')]('GetServicenowAccount',_0x5a7223,JSON[_0x9232('0x14')](_0x496644));_0x2cc154(_0x496644);})[_0x9232('0x23')](function(_0x4a9dea){logger['error'](_0x9232('0x19'),_0x4a9dea[_0x9232('0x17')],_0x5a7223);_0x48c98e(_0xa9a812[_0x9232('0x16')](0x1f4,_0x4a9dea[_0x9232('0x17')]));});});};exports['ShowServicenowAccount']=function(_0x49c539){var _0xc76c9a=this;return new Promise(function(_0x3ebf06,_0x69911f){return db['ServicenowAccount'][_0x9232('0x24')]({'raw':_0x49c539[_0x9232('0x1c')]?_0x49c539[_0x9232('0x1c')][_0x9232('0x25')]===undefined?!![]:![]:!![],'where':_0x49c539[_0x9232('0x1c')]?_0x49c539['options'][_0x9232('0x1d')]||null:null,'attributes':_0x49c539[_0x9232('0x1c')]?_0x49c539[_0x9232('0x1c')][_0x9232('0x1e')]||null:null,'include':_0x49c539['options']?_0x49c539[_0x9232('0x1c')][_0x9232('0x20')]?_[_0x9232('0x22')](_0x49c539['options']['include'],function(_0x7c69d6){return{'model':db[_0x7c69d6['model']],'as':_0x7c69d6['as'],'attributes':_0x7c69d6[_0x9232('0x1e')],'include':_0x7c69d6['include']?_[_0x9232('0x22')](_0x7c69d6['include'],function(_0x5019eb){return{'model':db[_0x5019eb['model']],'as':_0x5019eb['as'],'attributes':_0x5019eb[_0x9232('0x1e')],'include':_0x5019eb['include']?_['map'](_0x5019eb[_0x9232('0x20')],function(_0x453ea3){return{'model':db[_0x453ea3['model']],'as':_0x453ea3['as'],'attributes':_0x453ea3[_0x9232('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9232('0xe')](function(_0x10dc76){logger[_0x9232('0xf')](_0x9232('0x26'),_0x49c539);logger[_0x9232('0x12')](_0x9232('0x26'),_0x49c539,JSON['stringify'](_0x10dc76));_0x3ebf06(_0x10dc76);})[_0x9232('0x23')](function(_0x5698ce){logger[_0x9232('0x16')](_0x9232('0x26'),_0x5698ce[_0x9232('0x17')],_0x49c539);_0x69911f(_0xc76c9a['error'](0x1f4,_0x5698ce[_0x9232('0x17')]));});});};
\ No newline at end of file
index 08fc11d..d8d0f28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8754=['/:id/descriptions','getDescriptions','put','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8754,0x195));var _0x4875=function(_0x400fbb,_0x1a6b82){_0x400fbb=_0x400fbb-0x0;var _0x44fb45=_0x8754[_0x400fbb];return _0x44fb45;};'use strict';var multer=require(_0x4875('0x0'));var util=require('util');var path=require(_0x4875('0x1'));var timeout=require('connect-timeout');var express=require(_0x4875('0x2'));var router=express[_0x4875('0x3')]();var fs_extra=require(_0x4875('0x4'));var auth=require(_0x4875('0x5'));var interaction=require(_0x4875('0x6'));var config=require(_0x4875('0x7'));var controller=require(_0x4875('0x8'));router[_0x4875('0x9')]('/',auth[_0x4875('0xa')](),controller[_0x4875('0xb')]);router[_0x4875('0x9')](_0x4875('0xc'),auth['isAuthenticated'](),controller[_0x4875('0xd')]);router[_0x4875('0x9')](_0x4875('0xe'),auth[_0x4875('0xa')](),controller['getFields']);router['get']('/:id/subjects',auth[_0x4875('0xa')](),controller['getSubjects']);router[_0x4875('0x9')](_0x4875('0xf'),auth[_0x4875('0xa')](),controller[_0x4875('0x10')]);router['post']('/',auth[_0x4875('0xa')](),controller['create']);router[_0x4875('0x11')](_0x4875('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x4875('0x12')](_0x4875('0xc'),auth[_0x4875('0xa')](),controller[_0x4875('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x7054=['put','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','/:id/descriptions','create'];(function(_0x21003d,_0x15858f){var _0x1cd2e6=function(_0x20cbeb){while(--_0x20cbeb){_0x21003d['push'](_0x21003d['shift']());}};_0x1cd2e6(++_0x15858f);}(_0x7054,0x89));var _0x4705=function(_0x57746e,_0x45093f){_0x57746e=_0x57746e-0x0;var _0x5caeaa=_0x7054[_0x57746e];return _0x5caeaa;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x4705('0x0'));var express=require(_0x4705('0x1'));var router=express[_0x4705('0x2')]();var fs_extra=require(_0x4705('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4705('0x4'));var config=require('../../config/environment');var controller=require(_0x4705('0x5'));router[_0x4705('0x6')]('/',auth[_0x4705('0x7')](),controller[_0x4705('0x8')]);router[_0x4705('0x6')](_0x4705('0x9'),auth[_0x4705('0x7')](),controller['show']);router['get'](_0x4705('0xa'),auth[_0x4705('0x7')](),controller[_0x4705('0xb')]);router[_0x4705('0x6')](_0x4705('0xc'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x4705('0x6')](_0x4705('0xd'),auth[_0x4705('0x7')](),controller['getDescriptions']);router['post']('/',auth[_0x4705('0x7')](),controller[_0x4705('0xe')]);router[_0x4705('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x4705('0x10')](_0x4705('0x9'),auth['isAuthenticated'](),controller[_0x4705('0x11')]);module[_0x4705('0x12')]=router;
\ No newline at end of file
index 6bf67db..1f92cf5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3d3=['sequelize','STRING'];(function(_0x5ecff9,_0x473070){var _0x5e1415=function(_0x3c34a1){while(--_0x3c34a1){_0x5ecff9['push'](_0x5ecff9['shift']());}};_0x5e1415(++_0x473070);}(_0xa3d3,0xdc));var _0x3a3d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa3d3[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x3a3d('0x0'));module['exports']={'name':{'type':Sequelize[_0x3a3d('0x1')]},'description':{'type':Sequelize[_0x3a3d('0x1')]}};
\ No newline at end of file
+var _0x20ff=['sequelize','exports','STRING'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x20ff,0x96));var _0xf20f=function(_0x478830,_0x266465){_0x478830=_0x478830-0x0;var _0x1f2420=_0x20ff[_0x478830];return _0x1f2420;};'use strict';var Sequelize=require(_0xf20f('0x0'));module[_0xf20f('0x1')]={'name':{'type':Sequelize[_0xf20f('0x2')]},'description':{'type':Sequelize[_0xf20f('0x2')]}};
\ No newline at end of file
index d1eb233..c9c32cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa05e=['body','find','getFields','findOne','ServicenowField','order','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','create'];(function(_0x4f1fc6,_0x3ff605){var _0x54f24a=function(_0x6030e1){while(--_0x6030e1){_0x4f1fc6['push'](_0x4f1fc6['shift']());}};_0x54f24a(++_0x3ff605);}(_0xa05e,0x1ad));var _0xea05=function(_0x9d567,_0x2494bd){_0x9d567=_0x9d567-0x0;var _0x4d68c6=_0xa05e[_0x9d567];return _0x4d68c6;};'use strict';var emlformat=require(_0xea05('0x0'));var rimraf=require(_0xea05('0x1'));var zipdir=require(_0xea05('0x2'));var jsonpatch=require(_0xea05('0x3'));var rp=require(_0xea05('0x4'));var moment=require(_0xea05('0x5'));var BPromise=require(_0xea05('0x6'));var Mustache=require(_0xea05('0x7'));var util=require(_0xea05('0x8'));var path=require(_0xea05('0x9'));var sox=require(_0xea05('0xa'));var csv=require(_0xea05('0xb'));var ejs=require(_0xea05('0xc'));var fs=require('fs');var fs_extra=require(_0xea05('0xd'));var _=require(_0xea05('0xe'));var squel=require('squel');var crypto=require(_0xea05('0xf'));var jsforce=require(_0xea05('0x10'));var deskjs=require(_0xea05('0x11'));var toCsv=require(_0xea05('0xb'));var querystring=require('querystring');var Papa=require(_0xea05('0x12'));var Redis=require('ioredis');var authService=require(_0xea05('0x13'));var qs=require(_0xea05('0x14'));var as=require(_0xea05('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xea05('0x16'))(_0xea05('0x17'));var utils=require(_0xea05('0x18'));var config=require(_0xea05('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xea05('0x1a'))['db'];function respondWithStatusCode(_0x1ac528,_0x3b5df3){_0x3b5df3=_0x3b5df3||0xcc;return function(_0x21eaf6){if(_0x21eaf6){return _0x1ac528[_0xea05('0x1b')](_0x3b5df3);}return _0x1ac528[_0xea05('0x1c')](_0x3b5df3)[_0xea05('0x1d')]();};}function respondWithResult(_0x10de35,_0x2a53ff){_0x2a53ff=_0x2a53ff||0xc8;return function(_0x51c634){if(_0x51c634){return _0x10de35['status'](_0x2a53ff)[_0xea05('0x1e')](_0x51c634);}};}function respondWithFilteredResult(_0x584e0c,_0x591e99){return function(_0x221a70){if(_0x221a70){var _0x3743a4=typeof _0x591e99[_0xea05('0x1f')]===_0xea05('0x20')&&typeof _0x591e99[_0xea05('0x21')]===_0xea05('0x20');var _0x548b3b=_0x221a70['count'];var _0x4b3496=_0x3743a4?0x0:_0x591e99[_0xea05('0x1f')];var _0x53e55a=_0x3743a4?_0x221a70[_0xea05('0x22')]:_0x591e99[_0xea05('0x1f')]+_0x591e99[_0xea05('0x21')];var _0x2cfa69;if(_0x53e55a>=_0x548b3b){_0x53e55a=_0x548b3b;_0x2cfa69=0xc8;}else{_0x2cfa69=0xce;}_0x584e0c[_0xea05('0x1c')](_0x2cfa69);return _0x584e0c[_0xea05('0x23')](_0xea05('0x24'),_0x4b3496+'-'+_0x53e55a+'/'+_0x548b3b)['json'](_0x221a70);}return null;};}function patchUpdates(_0x39977b){return function(_0x2e56b4){try{jsonpatch[_0xea05('0x25')](_0x2e56b4,_0x39977b,!![]);}catch(_0x38927d){return BPromise[_0xea05('0x26')](_0x38927d);}return _0x2e56b4[_0xea05('0x27')]();};}function saveUpdates(_0x5488b7,_0x5313fa){return function(_0x582f55){if(_0x582f55){return _0x582f55[_0xea05('0x28')](_0x5488b7)[_0xea05('0x29')](function(_0x3644ad){return _0x3644ad;});}return null;};}function removeEntity(_0x48ce66,_0x274605){return function(_0x56c4f1){if(_0x56c4f1){return _0x56c4f1[_0xea05('0x2a')]()['then'](function(){_0x48ce66['status'](0xcc)[_0xea05('0x1d')]();});}};}function handleEntityNotFound(_0x32b205,_0x149748){return function(_0x8c2ac4){if(!_0x8c2ac4){_0x32b205[_0xea05('0x1b')](0x194);}return _0x8c2ac4;};}function handleError(_0x38ef82,_0x53e209){_0x53e209=_0x53e209||0x1f4;return function(_0x57bed6){logger['error'](_0x57bed6['stack']);if(_0x57bed6[_0xea05('0x2b')]){delete _0x57bed6[_0xea05('0x2b')];}_0x38ef82['status'](_0x53e209)[_0xea05('0x2c')](_0x57bed6);};}exports[_0xea05('0x2d')]=function(_0x4045d6,_0x19f42e){var _0xfa9b84={},_0x22817f={},_0x333540={'count':0x0,'rows':[]};var _0x351460=_['map'](db[_0xea05('0x2e')][_0xea05('0x2f')],function(_0x2a7516){return{'name':_0x2a7516[_0xea05('0x30')],'type':_0x2a7516[_0xea05('0x31')][_0xea05('0x32')]};});_0x22817f[_0xea05('0x33')]=_[_0xea05('0x34')](_0x351460,_0xea05('0x2b'));_0x22817f['query']=_[_0xea05('0x35')](_0x4045d6[_0xea05('0x36')]);_0x22817f[_0xea05('0x37')]=_['intersection'](_0x22817f[_0xea05('0x33')],_0x22817f[_0xea05('0x36')]);_0xfa9b84[_0xea05('0x38')]=_[_0xea05('0x39')](_0x22817f[_0xea05('0x33')],qs[_0xea05('0x3a')](_0x4045d6[_0xea05('0x36')][_0xea05('0x3a')]));_0xfa9b84[_0xea05('0x38')]=_0xfa9b84[_0xea05('0x38')][_0xea05('0x3b')]?_0xfa9b84[_0xea05('0x38')]:_0x22817f['model'];if(!_0x4045d6[_0xea05('0x36')]['hasOwnProperty'](_0xea05('0x3c'))){_0xfa9b84[_0xea05('0x21')]=qs[_0xea05('0x21')](_0x4045d6[_0xea05('0x36')]['limit']);_0xfa9b84[_0xea05('0x1f')]=qs['offset'](_0x4045d6[_0xea05('0x36')]['offset']);}_0xfa9b84['order']=qs[_0xea05('0x3d')](_0x4045d6['query']['sort']);_0xfa9b84[_0xea05('0x3e')]=qs[_0xea05('0x37')](_[_0xea05('0x3f')](_0x4045d6[_0xea05('0x36')],_0x22817f[_0xea05('0x37')]),_0x351460);if(_0x4045d6['query'][_0xea05('0x40')]){_0xfa9b84['where']=_[_0xea05('0x41')](_0xfa9b84[_0xea05('0x3e')],{'$or':_[_0xea05('0x34')](_0x351460,function(_0x157cfa){if(_0x157cfa[_0xea05('0x31')]!==_0xea05('0x42')){var _0x49e9c0={};_0x49e9c0[_0x157cfa['name']]={'$like':'%'+_0x4045d6[_0xea05('0x36')][_0xea05('0x40')]+'%'};return _0x49e9c0;}})});}_0xfa9b84=_[_0xea05('0x41')]({},_0xfa9b84,_0x4045d6[_0xea05('0x43')]);var _0xcd2ae5={'where':_0xfa9b84[_0xea05('0x3e')]};return db[_0xea05('0x2e')][_0xea05('0x22')](_0xcd2ae5)[_0xea05('0x29')](function(_0x1f8026){_0x333540[_0xea05('0x22')]=_0x1f8026;if(_0x4045d6[_0xea05('0x36')]['includeAll']){_0xfa9b84[_0xea05('0x44')]=[{'all':!![]}];}return db[_0xea05('0x2e')][_0xea05('0x45')](_0xfa9b84);})[_0xea05('0x29')](function(_0x2a28fa){_0x333540[_0xea05('0x46')]=_0x2a28fa;return _0x333540;})[_0xea05('0x29')](respondWithFilteredResult(_0x19f42e,_0xfa9b84))[_0xea05('0x47')](handleError(_0x19f42e,null));};exports[_0xea05('0x48')]=function(_0x2f5e14,_0x3ffa45){var _0x444bc0={'raw':![],'where':{'id':_0x2f5e14[_0xea05('0x49')]['id']}},_0x38c61a={};_0x38c61a[_0xea05('0x33')]=_[_0xea05('0x35')](db[_0xea05('0x2e')][_0xea05('0x2f')]);_0x38c61a[_0xea05('0x36')]=_[_0xea05('0x35')](_0x2f5e14[_0xea05('0x36')]);_0x38c61a['filters']=_[_0xea05('0x39')](_0x38c61a[_0xea05('0x33')],_0x38c61a[_0xea05('0x36')]);_0x444bc0[_0xea05('0x38')]=_[_0xea05('0x39')](_0x38c61a[_0xea05('0x33')],qs[_0xea05('0x3a')](_0x2f5e14[_0xea05('0x36')]['fields']));_0x444bc0[_0xea05('0x38')]=_0x444bc0['attributes']['length']?_0x444bc0[_0xea05('0x38')]:_0x38c61a[_0xea05('0x33')];if(_0x2f5e14[_0xea05('0x36')]['includeAll']){_0x444bc0[_0xea05('0x44')]=[{'all':!![]}];}_0x444bc0=_['merge']({},_0x444bc0,_0x2f5e14['options']);return db[_0xea05('0x2e')]['find'](_0x444bc0)['then'](handleEntityNotFound(_0x3ffa45,null))['then'](respondWithResult(_0x3ffa45,null))[_0xea05('0x47')](handleError(_0x3ffa45,null));};exports[_0xea05('0x4a')]=function(_0x325558,_0x3c5c5e){return db[_0xea05('0x2e')]['create'](_0x325558[_0xea05('0x4b')],{})[_0xea05('0x29')](respondWithResult(_0x3c5c5e,0xc9))['catch'](handleError(_0x3c5c5e,null));};exports[_0xea05('0x28')]=function(_0x4801f1,_0x28c5a8){if(_0x4801f1['body']['id']){delete _0x4801f1['body']['id'];}return db[_0xea05('0x2e')][_0xea05('0x4c')]({'where':{'id':_0x4801f1[_0xea05('0x49')]['id']}})[_0xea05('0x29')](handleEntityNotFound(_0x28c5a8,null))['then'](saveUpdates(_0x4801f1[_0xea05('0x4b')],null))[_0xea05('0x29')](respondWithResult(_0x28c5a8,null))[_0xea05('0x47')](handleError(_0x28c5a8,null));};exports[_0xea05('0x2a')]=function(_0x1ba41f,_0x30dfdb){return db['ServicenowConfiguration']['find']({'where':{'id':_0x1ba41f[_0xea05('0x49')]['id']}})['then'](handleEntityNotFound(_0x30dfdb,null))[_0xea05('0x29')](removeEntity(_0x30dfdb,null))['catch'](handleError(_0x30dfdb,null));};exports[_0xea05('0x4d')]=function(_0x3f6d23,_0x34b7b7,_0x5b783c){var _0x3edd07={};var _0x2c9ece={};var _0x2f3ffe;var _0x5856ef;return db['ServicenowConfiguration'][_0xea05('0x4e')]({'where':{'id':_0x3f6d23[_0xea05('0x49')]['id']}})[_0xea05('0x29')](handleEntityNotFound(_0x34b7b7,null))['then'](function(_0x113abf){if(_0x113abf){_0x2f3ffe=_0x113abf;_0x2c9ece[_0xea05('0x33')]=_['keys'](db[_0xea05('0x4f')]['rawAttributes']);_0x2c9ece['query']=_['keys'](_0x3f6d23[_0xea05('0x36')]);_0x2c9ece[_0xea05('0x37')]=_[_0xea05('0x39')](_0x2c9ece[_0xea05('0x33')],_0x2c9ece[_0xea05('0x36')]);_0x3edd07[_0xea05('0x38')]=_[_0xea05('0x39')](_0x2c9ece['model'],qs[_0xea05('0x3a')](_0x3f6d23[_0xea05('0x36')][_0xea05('0x3a')]));_0x3edd07[_0xea05('0x38')]=_0x3edd07[_0xea05('0x38')][_0xea05('0x3b')]?_0x3edd07['attributes']:_0x2c9ece[_0xea05('0x33')];_0x3edd07[_0xea05('0x50')]=qs['sort'](_0x3f6d23[_0xea05('0x36')][_0xea05('0x3d')]);_0x3edd07[_0xea05('0x3e')]=qs[_0xea05('0x37')](_[_0xea05('0x3f')](_0x3f6d23['query'],_0x2c9ece['filters']));if(_0x3f6d23[_0xea05('0x36')]['filter']){_0x3edd07[_0xea05('0x3e')]=_[_0xea05('0x41')](_0x3edd07['where'],{'$or':_[_0xea05('0x34')](_0x3edd07[_0xea05('0x38')],function(_0x51547d){var _0x200d83={};_0x200d83[_0x51547d]={'$like':'%'+_0x3f6d23[_0xea05('0x36')][_0xea05('0x40')]+'%'};return _0x200d83;})});}_0x3edd07=_['merge']({},_0x3edd07,_0x3f6d23[_0xea05('0x43')]);return _0x2f3ffe[_0xea05('0x4d')](_0x3edd07);}})['then'](function(_0x1250a0){if(_0x1250a0){_0x5856ef=_0x1250a0[_0xea05('0x3b')];if(!_0x3f6d23[_0xea05('0x36')][_0xea05('0x51')](_0xea05('0x3c'))){_0x3edd07[_0xea05('0x21')]=qs[_0xea05('0x21')](_0x3f6d23[_0xea05('0x36')][_0xea05('0x21')]);_0x3edd07[_0xea05('0x1f')]=qs[_0xea05('0x1f')](_0x3f6d23[_0xea05('0x36')]['offset']);}return _0x2f3ffe['getFields'](_0x3edd07);}})[_0xea05('0x29')](function(_0x41fdca){if(_0x41fdca){return _0x41fdca?{'count':_0x5856ef,'rows':_0x41fdca}:null;}})['then'](respondWithResult(_0x34b7b7,null))[_0xea05('0x47')](handleError(_0x34b7b7,null));};exports[_0xea05('0x52')]=function(_0x2158e9,_0x3da7ee,_0x48deb5){var _0x2b1bc2={};var _0x549cae={};var _0x289ac7;var _0x5d3e27;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x2158e9[_0xea05('0x49')]['id']}})[_0xea05('0x29')](handleEntityNotFound(_0x3da7ee,null))[_0xea05('0x29')](function(_0x485328){if(_0x485328){_0x289ac7=_0x485328;_0x549cae[_0xea05('0x33')]=_[_0xea05('0x35')](db[_0xea05('0x4f')][_0xea05('0x2f')]);_0x549cae[_0xea05('0x36')]=_[_0xea05('0x35')](_0x2158e9[_0xea05('0x36')]);_0x549cae['filters']=_[_0xea05('0x39')](_0x549cae[_0xea05('0x33')],_0x549cae[_0xea05('0x36')]);_0x2b1bc2['attributes']=_[_0xea05('0x39')](_0x549cae['model'],qs[_0xea05('0x3a')](_0x2158e9[_0xea05('0x36')]['fields']));_0x2b1bc2[_0xea05('0x38')]=_0x2b1bc2['attributes'][_0xea05('0x3b')]?_0x2b1bc2[_0xea05('0x38')]:_0x549cae['model'];_0x2b1bc2[_0xea05('0x50')]=qs[_0xea05('0x3d')](_0x2158e9[_0xea05('0x36')]['sort']);_0x2b1bc2[_0xea05('0x3e')]=qs[_0xea05('0x37')](_[_0xea05('0x3f')](_0x2158e9['query'],_0x549cae[_0xea05('0x37')]));if(_0x2158e9[_0xea05('0x36')][_0xea05('0x40')]){_0x2b1bc2[_0xea05('0x3e')]=_['merge'](_0x2b1bc2[_0xea05('0x3e')],{'$or':_['map'](_0x2b1bc2[_0xea05('0x38')],function(_0x2af9a6){var _0xddb686={};_0xddb686[_0x2af9a6]={'$like':'%'+_0x2158e9[_0xea05('0x36')][_0xea05('0x40')]+'%'};return _0xddb686;})});}_0x2b1bc2=_[_0xea05('0x41')]({},_0x2b1bc2,_0x2158e9[_0xea05('0x43')]);return _0x289ac7['getSubjects'](_0x2b1bc2);}})[_0xea05('0x29')](function(_0x1ca142){if(_0x1ca142){_0x5d3e27=_0x1ca142[_0xea05('0x3b')];if(!_0x2158e9[_0xea05('0x36')][_0xea05('0x51')](_0xea05('0x3c'))){_0x2b1bc2[_0xea05('0x21')]=qs[_0xea05('0x21')](_0x2158e9[_0xea05('0x36')]['limit']);_0x2b1bc2[_0xea05('0x1f')]=qs[_0xea05('0x1f')](_0x2158e9['query']['offset']);}return _0x289ac7[_0xea05('0x52')](_0x2b1bc2);}})['then'](function(_0x412ea1){if(_0x412ea1){return _0x412ea1?{'count':_0x5d3e27,'rows':_0x412ea1}:null;}})[_0xea05('0x29')](respondWithResult(_0x3da7ee,null))[_0xea05('0x47')](handleError(_0x3da7ee,null));};exports[_0xea05('0x53')]=function(_0x27017b,_0x53595d,_0x544f74){var _0x22f2f7={};var _0x505a2b={};var _0x5ecf41;var _0x3f2018;return db[_0xea05('0x2e')][_0xea05('0x4e')]({'where':{'id':_0x27017b[_0xea05('0x49')]['id']}})[_0xea05('0x29')](handleEntityNotFound(_0x53595d,null))[_0xea05('0x29')](function(_0x2237fc){if(_0x2237fc){_0x5ecf41=_0x2237fc;_0x505a2b['model']=_[_0xea05('0x35')](db[_0xea05('0x4f')][_0xea05('0x2f')]);_0x505a2b[_0xea05('0x36')]=_[_0xea05('0x35')](_0x27017b[_0xea05('0x36')]);_0x505a2b[_0xea05('0x37')]=_[_0xea05('0x39')](_0x505a2b[_0xea05('0x33')],_0x505a2b[_0xea05('0x36')]);_0x22f2f7[_0xea05('0x38')]=_[_0xea05('0x39')](_0x505a2b['model'],qs[_0xea05('0x3a')](_0x27017b['query'][_0xea05('0x3a')]));_0x22f2f7[_0xea05('0x38')]=_0x22f2f7['attributes'][_0xea05('0x3b')]?_0x22f2f7[_0xea05('0x38')]:_0x505a2b[_0xea05('0x33')];_0x22f2f7[_0xea05('0x50')]=qs[_0xea05('0x3d')](_0x27017b[_0xea05('0x36')]['sort']);_0x22f2f7[_0xea05('0x3e')]=qs[_0xea05('0x37')](_['pick'](_0x27017b[_0xea05('0x36')],_0x505a2b['filters']));if(_0x27017b['query'][_0xea05('0x40')]){_0x22f2f7['where']=_[_0xea05('0x41')](_0x22f2f7[_0xea05('0x3e')],{'$or':_['map'](_0x22f2f7[_0xea05('0x38')],function(_0x57f81e){var _0x2a7a23={};_0x2a7a23[_0x57f81e]={'$like':'%'+_0x27017b[_0xea05('0x36')][_0xea05('0x40')]+'%'};return _0x2a7a23;})});}_0x22f2f7=_[_0xea05('0x41')]({},_0x22f2f7,_0x27017b['options']);return _0x5ecf41[_0xea05('0x53')](_0x22f2f7);}})['then'](function(_0x4e4d99){if(_0x4e4d99){_0x3f2018=_0x4e4d99['length'];if(!_0x27017b['query'][_0xea05('0x51')](_0xea05('0x3c'))){_0x22f2f7[_0xea05('0x21')]=qs[_0xea05('0x21')](_0x27017b[_0xea05('0x36')][_0xea05('0x21')]);_0x22f2f7[_0xea05('0x1f')]=qs[_0xea05('0x1f')](_0x27017b[_0xea05('0x36')][_0xea05('0x1f')]);}return _0x5ecf41[_0xea05('0x53')](_0x22f2f7);}})['then'](function(_0x518100){if(_0x518100){return _0x518100?{'count':_0x3f2018,'rows':_0x518100}:null;}})[_0xea05('0x29')](respondWithResult(_0x53595d,null))[_0xea05('0x47')](handleError(_0x53595d,null));};
\ No newline at end of file
+var _0x5fe1=['getFields','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','count','offset','limit','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','key','query','filters','intersection','attributes','model','fields','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','keys','length','create','body','find','params','findOne','ServicenowField','order'];(function(_0x54b83b,_0x50919b){var _0x4e4405=function(_0x2f420f){while(--_0x2f420f){_0x54b83b['push'](_0x54b83b['shift']());}};_0x4e4405(++_0x50919b);}(_0x5fe1,0x158));var _0x15fe=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x5fe1[_0x2f3848];return _0x102668;};'use strict';var emlformat=require(_0x15fe('0x0'));var rimraf=require(_0x15fe('0x1'));var zipdir=require(_0x15fe('0x2'));var jsonpatch=require(_0x15fe('0x3'));var rp=require(_0x15fe('0x4'));var moment=require(_0x15fe('0x5'));var BPromise=require(_0x15fe('0x6'));var Mustache=require(_0x15fe('0x7'));var util=require(_0x15fe('0x8'));var path=require(_0x15fe('0x9'));var sox=require(_0x15fe('0xa'));var csv=require(_0x15fe('0xb'));var ejs=require(_0x15fe('0xc'));var fs=require('fs');var fs_extra=require(_0x15fe('0xd'));var _=require(_0x15fe('0xe'));var squel=require(_0x15fe('0xf'));var crypto=require(_0x15fe('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x15fe('0x11'));var toCsv=require(_0x15fe('0xb'));var querystring=require('querystring');var Papa=require(_0x15fe('0x12'));var Redis=require(_0x15fe('0x13'));var authService=require(_0x15fe('0x14'));var qs=require(_0x15fe('0x15'));var as=require(_0x15fe('0x16'));var hardwareService=require(_0x15fe('0x17'));var logger=require('../../config/logger')(_0x15fe('0x18'));var utils=require(_0x15fe('0x19'));var config=require(_0x15fe('0x1a'));var licenseUtil=require(_0x15fe('0x1b'));var db=require(_0x15fe('0x1c'))['db'];function respondWithStatusCode(_0x4ae913,_0x1e2c47){_0x1e2c47=_0x1e2c47||0xcc;return function(_0x1ca9e7){if(_0x1ca9e7){return _0x4ae913['sendStatus'](_0x1e2c47);}return _0x4ae913['status'](_0x1e2c47)[_0x15fe('0x1d')]();};}function respondWithResult(_0xde1384,_0x3ab967){_0x3ab967=_0x3ab967||0xc8;return function(_0x41407c){if(_0x41407c){return _0xde1384[_0x15fe('0x1e')](_0x3ab967)[_0x15fe('0x1f')](_0x41407c);}};}function respondWithFilteredResult(_0xc7167c,_0x526e8d){return function(_0x4d9484){if(_0x4d9484){var _0x4cc20f=typeof _0x526e8d['offset']===_0x15fe('0x20')&&typeof _0x526e8d['limit']===_0x15fe('0x20');var _0x75c568=_0x4d9484[_0x15fe('0x21')];var _0x20d2fb=_0x4cc20f?0x0:_0x526e8d[_0x15fe('0x22')];var _0x5b4604=_0x4cc20f?_0x4d9484[_0x15fe('0x21')]:_0x526e8d[_0x15fe('0x22')]+_0x526e8d[_0x15fe('0x23')];var _0x4ce058;if(_0x5b4604>=_0x75c568){_0x5b4604=_0x75c568;_0x4ce058=0xc8;}else{_0x4ce058=0xce;}_0xc7167c[_0x15fe('0x1e')](_0x4ce058);return _0xc7167c[_0x15fe('0x24')](_0x15fe('0x25'),_0x20d2fb+'-'+_0x5b4604+'/'+_0x75c568)[_0x15fe('0x1f')](_0x4d9484);}return null;};}function patchUpdates(_0x607ef6){return function(_0x2f6e0e){try{jsonpatch['apply'](_0x2f6e0e,_0x607ef6,!![]);}catch(_0x322dfe){return BPromise['reject'](_0x322dfe);}return _0x2f6e0e[_0x15fe('0x26')]();};}function saveUpdates(_0x25b3f5,_0x16323d){return function(_0x1251a1){if(_0x1251a1){return _0x1251a1[_0x15fe('0x27')](_0x25b3f5)[_0x15fe('0x28')](function(_0x1cf537){return _0x1cf537;});}return null;};}function removeEntity(_0x288e80,_0x310f58){return function(_0x267eeb){if(_0x267eeb){return _0x267eeb[_0x15fe('0x29')]()[_0x15fe('0x28')](function(){_0x288e80['status'](0xcc)[_0x15fe('0x1d')]();});}};}function handleEntityNotFound(_0x51f0ba,_0x32b976){return function(_0x1351fb){if(!_0x1351fb){_0x51f0ba['sendStatus'](0x194);}return _0x1351fb;};}function handleError(_0x40f349,_0x2b3085){_0x2b3085=_0x2b3085||0x1f4;return function(_0x375bc8){logger[_0x15fe('0x2a')](_0x375bc8[_0x15fe('0x2b')]);if(_0x375bc8[_0x15fe('0x2c')]){delete _0x375bc8['name'];}_0x40f349[_0x15fe('0x1e')](_0x2b3085)[_0x15fe('0x2d')](_0x375bc8);};}exports[_0x15fe('0x2e')]=function(_0x1ff82d,_0x1ee875){var _0x339e0b={},_0x3d1023={},_0x1253a9={'count':0x0,'rows':[]};var _0x1a0647=_[_0x15fe('0x2f')](db[_0x15fe('0x30')][_0x15fe('0x31')],function(_0x3ea53d){return{'name':_0x3ea53d[_0x15fe('0x32')],'type':_0x3ea53d['type'][_0x15fe('0x33')]};});_0x3d1023['model']=_['map'](_0x1a0647,'name');_0x3d1023[_0x15fe('0x34')]=_['keys'](_0x1ff82d[_0x15fe('0x34')]);_0x3d1023[_0x15fe('0x35')]=_[_0x15fe('0x36')](_0x3d1023['model'],_0x3d1023['query']);_0x339e0b[_0x15fe('0x37')]=_['intersection'](_0x3d1023[_0x15fe('0x38')],qs[_0x15fe('0x39')](_0x1ff82d['query'][_0x15fe('0x39')]));_0x339e0b[_0x15fe('0x37')]=_0x339e0b['attributes']['length']?_0x339e0b['attributes']:_0x3d1023[_0x15fe('0x38')];if(!_0x1ff82d[_0x15fe('0x34')]['hasOwnProperty'](_0x15fe('0x3a'))){_0x339e0b[_0x15fe('0x23')]=qs[_0x15fe('0x23')](_0x1ff82d[_0x15fe('0x34')]['limit']);_0x339e0b['offset']=qs[_0x15fe('0x22')](_0x1ff82d[_0x15fe('0x34')][_0x15fe('0x22')]);}_0x339e0b['order']=qs[_0x15fe('0x3b')](_0x1ff82d[_0x15fe('0x34')][_0x15fe('0x3b')]);_0x339e0b[_0x15fe('0x3c')]=qs['filters'](_[_0x15fe('0x3d')](_0x1ff82d[_0x15fe('0x34')],_0x3d1023['filters']),_0x1a0647);if(_0x1ff82d[_0x15fe('0x34')]['filter']){_0x339e0b['where']=_[_0x15fe('0x3e')](_0x339e0b[_0x15fe('0x3c')],{'$or':_['map'](_0x1a0647,function(_0x26511c){if(_0x26511c[_0x15fe('0x3f')]!==_0x15fe('0x40')){var _0x160288={};_0x160288[_0x26511c['name']]={'$like':'%'+_0x1ff82d[_0x15fe('0x34')][_0x15fe('0x41')]+'%'};return _0x160288;}})});}_0x339e0b=_[_0x15fe('0x3e')]({},_0x339e0b,_0x1ff82d[_0x15fe('0x42')]);var _0xe9321c={'where':_0x339e0b[_0x15fe('0x3c')]};return db['ServicenowConfiguration']['count'](_0xe9321c)[_0x15fe('0x28')](function(_0x12248d){_0x1253a9['count']=_0x12248d;if(_0x1ff82d[_0x15fe('0x34')][_0x15fe('0x43')]){_0x339e0b[_0x15fe('0x44')]=[{'all':!![]}];}return db[_0x15fe('0x30')][_0x15fe('0x45')](_0x339e0b);})['then'](function(_0x3ab7ff){_0x1253a9['rows']=_0x3ab7ff;return _0x1253a9;})[_0x15fe('0x28')](respondWithFilteredResult(_0x1ee875,_0x339e0b))[_0x15fe('0x46')](handleError(_0x1ee875,null));};exports[_0x15fe('0x47')]=function(_0x2b7270,_0x50beb7){var _0x49c1f2={'raw':![],'where':{'id':_0x2b7270['params']['id']}},_0x189936={};_0x189936['model']=_[_0x15fe('0x48')](db[_0x15fe('0x30')][_0x15fe('0x31')]);_0x189936[_0x15fe('0x34')]=_['keys'](_0x2b7270[_0x15fe('0x34')]);_0x189936[_0x15fe('0x35')]=_[_0x15fe('0x36')](_0x189936['model'],_0x189936['query']);_0x49c1f2[_0x15fe('0x37')]=_[_0x15fe('0x36')](_0x189936[_0x15fe('0x38')],qs[_0x15fe('0x39')](_0x2b7270[_0x15fe('0x34')]['fields']));_0x49c1f2[_0x15fe('0x37')]=_0x49c1f2['attributes'][_0x15fe('0x49')]?_0x49c1f2[_0x15fe('0x37')]:_0x189936[_0x15fe('0x38')];if(_0x2b7270[_0x15fe('0x34')]['includeAll']){_0x49c1f2['include']=[{'all':!![]}];}_0x49c1f2=_[_0x15fe('0x3e')]({},_0x49c1f2,_0x2b7270[_0x15fe('0x42')]);return db[_0x15fe('0x30')]['find'](_0x49c1f2)[_0x15fe('0x28')](handleEntityNotFound(_0x50beb7,null))[_0x15fe('0x28')](respondWithResult(_0x50beb7,null))[_0x15fe('0x46')](handleError(_0x50beb7,null));};exports[_0x15fe('0x4a')]=function(_0x31a7c2,_0x533c1f){return db['ServicenowConfiguration']['create'](_0x31a7c2[_0x15fe('0x4b')],{})['then'](respondWithResult(_0x533c1f,0xc9))[_0x15fe('0x46')](handleError(_0x533c1f,null));};exports[_0x15fe('0x27')]=function(_0x3cf00c,_0x35714d){if(_0x3cf00c[_0x15fe('0x4b')]['id']){delete _0x3cf00c[_0x15fe('0x4b')]['id'];}return db['ServicenowConfiguration'][_0x15fe('0x4c')]({'where':{'id':_0x3cf00c['params']['id']}})['then'](handleEntityNotFound(_0x35714d,null))[_0x15fe('0x28')](saveUpdates(_0x3cf00c[_0x15fe('0x4b')],null))[_0x15fe('0x28')](respondWithResult(_0x35714d,null))['catch'](handleError(_0x35714d,null));};exports[_0x15fe('0x29')]=function(_0x64df1b,_0x513d5b){return db['ServicenowConfiguration']['find']({'where':{'id':_0x64df1b[_0x15fe('0x4d')]['id']}})[_0x15fe('0x28')](handleEntityNotFound(_0x513d5b,null))[_0x15fe('0x28')](removeEntity(_0x513d5b,null))[_0x15fe('0x46')](handleError(_0x513d5b,null));};exports['getFields']=function(_0x5d5772,_0xb289d8,_0x44a162){var _0x51f5a8={};var _0x1524f7={};var _0x134966;var _0x4304ed;return db[_0x15fe('0x30')][_0x15fe('0x4e')]({'where':{'id':_0x5d5772['params']['id']}})[_0x15fe('0x28')](handleEntityNotFound(_0xb289d8,null))[_0x15fe('0x28')](function(_0x343dd6){if(_0x343dd6){_0x134966=_0x343dd6;_0x1524f7[_0x15fe('0x38')]=_[_0x15fe('0x48')](db[_0x15fe('0x4f')][_0x15fe('0x31')]);_0x1524f7[_0x15fe('0x34')]=_[_0x15fe('0x48')](_0x5d5772[_0x15fe('0x34')]);_0x1524f7[_0x15fe('0x35')]=_[_0x15fe('0x36')](_0x1524f7['model'],_0x1524f7[_0x15fe('0x34')]);_0x51f5a8[_0x15fe('0x37')]=_['intersection'](_0x1524f7[_0x15fe('0x38')],qs[_0x15fe('0x39')](_0x5d5772[_0x15fe('0x34')][_0x15fe('0x39')]));_0x51f5a8[_0x15fe('0x37')]=_0x51f5a8[_0x15fe('0x37')][_0x15fe('0x49')]?_0x51f5a8[_0x15fe('0x37')]:_0x1524f7[_0x15fe('0x38')];_0x51f5a8[_0x15fe('0x50')]=qs[_0x15fe('0x3b')](_0x5d5772[_0x15fe('0x34')][_0x15fe('0x3b')]);_0x51f5a8[_0x15fe('0x3c')]=qs['filters'](_[_0x15fe('0x3d')](_0x5d5772[_0x15fe('0x34')],_0x1524f7[_0x15fe('0x35')]));if(_0x5d5772['query'][_0x15fe('0x41')]){_0x51f5a8[_0x15fe('0x3c')]=_['merge'](_0x51f5a8['where'],{'$or':_[_0x15fe('0x2f')](_0x51f5a8[_0x15fe('0x37')],function(_0x5c8e33){var _0x7776f7={};_0x7776f7[_0x5c8e33]={'$like':'%'+_0x5d5772[_0x15fe('0x34')][_0x15fe('0x41')]+'%'};return _0x7776f7;})});}_0x51f5a8=_[_0x15fe('0x3e')]({},_0x51f5a8,_0x5d5772[_0x15fe('0x42')]);return _0x134966[_0x15fe('0x51')](_0x51f5a8);}})[_0x15fe('0x28')](function(_0x88d057){if(_0x88d057){_0x4304ed=_0x88d057[_0x15fe('0x49')];if(!_0x5d5772['query'][_0x15fe('0x52')](_0x15fe('0x3a'))){_0x51f5a8[_0x15fe('0x23')]=qs[_0x15fe('0x23')](_0x5d5772[_0x15fe('0x34')][_0x15fe('0x23')]);_0x51f5a8[_0x15fe('0x22')]=qs[_0x15fe('0x22')](_0x5d5772[_0x15fe('0x34')][_0x15fe('0x22')]);}return _0x134966[_0x15fe('0x51')](_0x51f5a8);}})[_0x15fe('0x28')](function(_0xbf5219){if(_0xbf5219){return _0xbf5219?{'count':_0x4304ed,'rows':_0xbf5219}:null;}})['then'](respondWithResult(_0xb289d8,null))[_0x15fe('0x46')](handleError(_0xb289d8,null));};exports[_0x15fe('0x53')]=function(_0x444f94,_0x2c720b,_0xbb6419){var _0xf0234e={};var _0x2d08fc={};var _0x10e0bc;var _0x2e3635;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x444f94['params']['id']}})['then'](handleEntityNotFound(_0x2c720b,null))[_0x15fe('0x28')](function(_0x10c745){if(_0x10c745){_0x10e0bc=_0x10c745;_0x2d08fc[_0x15fe('0x38')]=_[_0x15fe('0x48')](db[_0x15fe('0x4f')][_0x15fe('0x31')]);_0x2d08fc[_0x15fe('0x34')]=_[_0x15fe('0x48')](_0x444f94[_0x15fe('0x34')]);_0x2d08fc[_0x15fe('0x35')]=_[_0x15fe('0x36')](_0x2d08fc[_0x15fe('0x38')],_0x2d08fc['query']);_0xf0234e['attributes']=_[_0x15fe('0x36')](_0x2d08fc[_0x15fe('0x38')],qs['fields'](_0x444f94['query'][_0x15fe('0x39')]));_0xf0234e[_0x15fe('0x37')]=_0xf0234e[_0x15fe('0x37')][_0x15fe('0x49')]?_0xf0234e['attributes']:_0x2d08fc[_0x15fe('0x38')];_0xf0234e['order']=qs[_0x15fe('0x3b')](_0x444f94[_0x15fe('0x34')][_0x15fe('0x3b')]);_0xf0234e['where']=qs['filters'](_[_0x15fe('0x3d')](_0x444f94[_0x15fe('0x34')],_0x2d08fc[_0x15fe('0x35')]));if(_0x444f94[_0x15fe('0x34')][_0x15fe('0x41')]){_0xf0234e['where']=_[_0x15fe('0x3e')](_0xf0234e[_0x15fe('0x3c')],{'$or':_[_0x15fe('0x2f')](_0xf0234e[_0x15fe('0x37')],function(_0x8ffa6d){var _0x16b8d3={};_0x16b8d3[_0x8ffa6d]={'$like':'%'+_0x444f94[_0x15fe('0x34')]['filter']+'%'};return _0x16b8d3;})});}_0xf0234e=_['merge']({},_0xf0234e,_0x444f94['options']);return _0x10e0bc[_0x15fe('0x53')](_0xf0234e);}})[_0x15fe('0x28')](function(_0x1da32e){if(_0x1da32e){_0x2e3635=_0x1da32e['length'];if(!_0x444f94[_0x15fe('0x34')][_0x15fe('0x52')](_0x15fe('0x3a'))){_0xf0234e[_0x15fe('0x23')]=qs[_0x15fe('0x23')](_0x444f94[_0x15fe('0x34')][_0x15fe('0x23')]);_0xf0234e[_0x15fe('0x22')]=qs[_0x15fe('0x22')](_0x444f94[_0x15fe('0x34')][_0x15fe('0x22')]);}return _0x10e0bc['getSubjects'](_0xf0234e);}})[_0x15fe('0x28')](function(_0x549142){if(_0x549142){return _0x549142?{'count':_0x2e3635,'rows':_0x549142}:null;}})[_0x15fe('0x28')](respondWithResult(_0x2c720b,null))[_0x15fe('0x46')](handleError(_0x2c720b,null));};exports[_0x15fe('0x54')]=function(_0x5ac309,_0x5083de,_0x30d46a){var _0x5d57ef={};var _0x35de8a={};var _0x56e2b2;var _0x2fa804;return db[_0x15fe('0x30')]['findOne']({'where':{'id':_0x5ac309[_0x15fe('0x4d')]['id']}})[_0x15fe('0x28')](handleEntityNotFound(_0x5083de,null))[_0x15fe('0x28')](function(_0x33b2e9){if(_0x33b2e9){_0x56e2b2=_0x33b2e9;_0x35de8a[_0x15fe('0x38')]=_[_0x15fe('0x48')](db[_0x15fe('0x4f')][_0x15fe('0x31')]);_0x35de8a[_0x15fe('0x34')]=_[_0x15fe('0x48')](_0x5ac309[_0x15fe('0x34')]);_0x35de8a[_0x15fe('0x35')]=_['intersection'](_0x35de8a[_0x15fe('0x38')],_0x35de8a[_0x15fe('0x34')]);_0x5d57ef[_0x15fe('0x37')]=_['intersection'](_0x35de8a[_0x15fe('0x38')],qs[_0x15fe('0x39')](_0x5ac309[_0x15fe('0x34')][_0x15fe('0x39')]));_0x5d57ef[_0x15fe('0x37')]=_0x5d57ef[_0x15fe('0x37')][_0x15fe('0x49')]?_0x5d57ef[_0x15fe('0x37')]:_0x35de8a['model'];_0x5d57ef[_0x15fe('0x50')]=qs[_0x15fe('0x3b')](_0x5ac309[_0x15fe('0x34')][_0x15fe('0x3b')]);_0x5d57ef['where']=qs[_0x15fe('0x35')](_[_0x15fe('0x3d')](_0x5ac309[_0x15fe('0x34')],_0x35de8a[_0x15fe('0x35')]));if(_0x5ac309[_0x15fe('0x34')][_0x15fe('0x41')]){_0x5d57ef[_0x15fe('0x3c')]=_[_0x15fe('0x3e')](_0x5d57ef[_0x15fe('0x3c')],{'$or':_[_0x15fe('0x2f')](_0x5d57ef[_0x15fe('0x37')],function(_0x57192f){var _0x3ad430={};_0x3ad430[_0x57192f]={'$like':'%'+_0x5ac309['query'][_0x15fe('0x41')]+'%'};return _0x3ad430;})});}_0x5d57ef=_[_0x15fe('0x3e')]({},_0x5d57ef,_0x5ac309[_0x15fe('0x42')]);return _0x56e2b2[_0x15fe('0x54')](_0x5d57ef);}})[_0x15fe('0x28')](function(_0x3c60f2){if(_0x3c60f2){_0x2fa804=_0x3c60f2[_0x15fe('0x49')];if(!_0x5ac309['query']['hasOwnProperty'](_0x15fe('0x3a'))){_0x5d57ef[_0x15fe('0x23')]=qs[_0x15fe('0x23')](_0x5ac309['query'][_0x15fe('0x23')]);_0x5d57ef['offset']=qs[_0x15fe('0x22')](_0x5ac309['query'][_0x15fe('0x22')]);}return _0x56e2b2[_0x15fe('0x54')](_0x5d57ef);}})['then'](function(_0x3fe6d2){if(_0x3fe6d2){return _0x3fe6d2?{'count':_0x2fa804,'rows':_0x3fe6d2}:null;}})[_0x15fe('0x28')](respondWithResult(_0x5083de,null))['catch'](handleError(_0x5083de,null));};
\ No newline at end of file
index 05e7a5e..3ac94ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09df=['../../config/environment','./intServicenowConfiguration.attributes','define','int_servicenow_configurations','lodash','util','api','request-promise'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x09df,0x164));var _0xf09d=function(_0x4f5108,_0x46a54b){_0x4f5108=_0x4f5108-0x0;var _0x2d56ca=_0x09df[_0x4f5108];return _0x2d56ca;};'use strict';var _=require(_0xf09d('0x0'));var util=require(_0xf09d('0x1'));var logger=require('../../config/logger')(_0xf09d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf09d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf09d('0x4'));var attributes=require(_0xf09d('0x5'));module['exports']=function(_0x4db4e7,_0x4b452b){return _0x4db4e7[_0xf09d('0x6')]('ServicenowConfiguration',attributes,{'tableName':_0xf09d('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x457b=['api','moment','bluebird','request-promise','path','../../config/environment','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration','int_servicenow_configurations','lodash','util'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x457b,0xca));var _0xb457=function(_0x42cb74,_0xd030f0){_0x42cb74=_0x42cb74-0x0;var _0x264737=_0x457b[_0x42cb74];return _0x264737;};'use strict';var _=require(_0xb457('0x0'));var util=require(_0xb457('0x1'));var logger=require('../../config/logger')(_0xb457('0x2'));var moment=require(_0xb457('0x3'));var BPromise=require(_0xb457('0x4'));var rp=require(_0xb457('0x5'));var fs=require('fs');var path=require(_0xb457('0x6'));var rimraf=require('rimraf');var config=require(_0xb457('0x7'));var attributes=require(_0xb457('0x8'));module[_0xb457('0x9')]=function(_0x3823c7,_0x3cefc3){return _0x3823c7['define'](_0xb457('0xa'),attributes,{'tableName':_0xb457('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 25c2e36..5f8bc9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f61=['util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x55320c,_0x130a6f){var _0x3e2c1c=function(_0x1db21b){while(--_0x1db21b){_0x55320c['push'](_0x55320c['shift']());}};_0x3e2c1c(++_0x130a6f);}(_0x4f61,0x149));var _0x14f6=function(_0x3ce3fe,_0x16a3ce){_0x3ce3fe=_0x3ce3fe-0x0;var _0x575fa6=_0x4f61[_0x3ce3fe];return _0x575fa6;};'use strict';var _=require(_0x14f6('0x0'));var util=require(_0x14f6('0x1'));var moment=require(_0x14f6('0x2'));var BPromise=require('bluebird');var rs=require(_0x14f6('0x3'));var fs=require('fs');var Redis=require(_0x14f6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x14f6('0x5'));var logger=require(_0x14f6('0x6'))(_0x14f6('0x7'));var config=require(_0x14f6('0x8'));var jayson=require(_0x14f6('0x9'));var client=jayson[_0x14f6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41fd96,_0x14123a,_0x2fcb1e){return new BPromise(function(_0xa85b5b,_0x23af1f){return client['request'](_0x41fd96,_0x2fcb1e)[_0x14f6('0xb')](function(_0x1b7c50){logger[_0x14f6('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0x14123a,_0x14f6('0xd'));logger[_0x14f6('0xe')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x14123a,_0x14f6('0xd'),JSON[_0x14f6('0xf')](_0x1b7c50));if(_0x1b7c50[_0x14f6('0x10')]){if(_0x1b7c50[_0x14f6('0x10')][_0x14f6('0x11')]===0x1f4){logger['error'](_0x14f6('0x12'),_0x14123a,_0x1b7c50[_0x14f6('0x10')][_0x14f6('0x13')]);return _0x23af1f(_0x1b7c50[_0x14f6('0x10')][_0x14f6('0x13')]);}logger[_0x14f6('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x14123a,_0x1b7c50[_0x14f6('0x10')][_0x14f6('0x13')]);return _0xa85b5b(_0x1b7c50['error'][_0x14f6('0x13')]);}else{logger[_0x14f6('0xc')](_0x14f6('0x12'),_0x14123a,_0x14f6('0xd'));_0xa85b5b(_0x1b7c50[_0x14f6('0x14')][_0x14f6('0x13')]);}})[_0x14f6('0x15')](function(_0x18cced){logger[_0x14f6('0x10')](_0x14f6('0x12'),_0x14123a,_0x18cced);_0x23af1f(_0x18cced);});});}
\ No newline at end of file
+var _0x90ef=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','result'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0x90ef,0x171));var _0xf90e=function(_0x1b3e32,_0x49ad74){_0x1b3e32=_0x1b3e32-0x0;var _0x4796e3=_0x90ef[_0x1b3e32];return _0x4796e3;};'use strict';var _=require(_0xf90e('0x0'));var util=require(_0xf90e('0x1'));var moment=require(_0xf90e('0x2'));var BPromise=require(_0xf90e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf90e('0x4'));var db=require(_0xf90e('0x5'))['db'];var utils=require(_0xf90e('0x6'));var logger=require('../../config/logger')(_0xf90e('0x7'));var config=require(_0xf90e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf90e('0x9')][_0xf90e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x385436,_0x5a86ce,_0x3ddfee){return new BPromise(function(_0x4fce40,_0x327de0){return client[_0xf90e('0xb')](_0x385436,_0x3ddfee)[_0xf90e('0xc')](function(_0x4ea9a0){logger[_0xf90e('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5a86ce,_0xf90e('0xe'));logger['debug'](_0xf90e('0xf'),_0x5a86ce,_0xf90e('0xe'),JSON[_0xf90e('0x10')](_0x4ea9a0));if(_0x4ea9a0[_0xf90e('0x11')]){if(_0x4ea9a0['error'][_0xf90e('0x12')]===0x1f4){logger[_0xf90e('0x11')](_0xf90e('0x13'),_0x5a86ce,_0x4ea9a0[_0xf90e('0x11')][_0xf90e('0x14')]);return _0x327de0(_0x4ea9a0['error'][_0xf90e('0x14')]);}logger[_0xf90e('0x11')](_0xf90e('0x13'),_0x5a86ce,_0x4ea9a0[_0xf90e('0x11')][_0xf90e('0x14')]);return _0x4fce40(_0x4ea9a0['error'][_0xf90e('0x14')]);}else{logger[_0xf90e('0xd')](_0xf90e('0x13'),_0x5a86ce,'request\x20sent');_0x4fce40(_0x4ea9a0[_0xf90e('0x15')][_0xf90e('0x14')]);}})[_0xf90e('0x16')](function(_0x1a5506){logger[_0xf90e('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5a86ce,_0x1a5506);_0x327de0(_0x1a5506);});});}
\ No newline at end of file
index 18ec5bf..7c583c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2635=['path','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put','destroy','exports','multer'];(function(_0x5c705f,_0xae3dfd){var _0x31d0ce=function(_0x4b58b2){while(--_0x4b58b2){_0x5c705f['push'](_0x5c705f['shift']());}};_0x31d0ce(++_0xae3dfd);}(_0x2635,0x175));var _0x5263=function(_0x4ff8e6,_0xfa7e41){_0x4ff8e6=_0x4ff8e6-0x0;var _0x33de7c=_0x2635[_0x4ff8e6];return _0x33de7c;};'use strict';var multer=require(_0x5263('0x0'));var util=require('util');var path=require(_0x5263('0x1'));var timeout=require('connect-timeout');var express=require(_0x5263('0x2'));var router=express[_0x5263('0x3')]();var fs_extra=require(_0x5263('0x4'));var auth=require(_0x5263('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5263('0x6'));var controller=require('./intServicenowField.controller');router['get']('/',auth[_0x5263('0x7')](),controller[_0x5263('0x8')]);router[_0x5263('0x9')](_0x5263('0xa'),auth[_0x5263('0x7')](),controller[_0x5263('0xb')]);router[_0x5263('0xc')]('/',auth[_0x5263('0x7')](),controller[_0x5263('0xd')]);router[_0x5263('0xe')](_0x5263('0xa'),auth[_0x5263('0x7')](),controller['update']);router['delete'](_0x5263('0xa'),auth[_0x5263('0x7')](),controller[_0x5263('0xf')]);module[_0x5263('0x10')]=router;
\ No newline at end of file
+var _0xf44e=['delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x31def2,_0x314684){var _0x2be1d3=function(_0x3fbadf){while(--_0x3fbadf){_0x31def2['push'](_0x31def2['shift']());}};_0x2be1d3(++_0x314684);}(_0xf44e,0x16b));var _0xef44=function(_0x2c1dfd,_0x263dc3){_0x2c1dfd=_0x2c1dfd-0x0;var _0x27b362=_0xf44e[_0x2c1dfd];return _0x27b362;};'use strict';var multer=require(_0xef44('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xef44('0x1'));var express=require(_0xef44('0x2'));var router=express[_0xef44('0x3')]();var fs_extra=require(_0xef44('0x4'));var auth=require(_0xef44('0x5'));var interaction=require(_0xef44('0x6'));var config=require('../../config/environment');var controller=require(_0xef44('0x7'));router[_0xef44('0x8')]('/',auth[_0xef44('0x9')](),controller[_0xef44('0xa')]);router['get'](_0xef44('0xb'),auth[_0xef44('0x9')](),controller[_0xef44('0xc')]);router[_0xef44('0xd')]('/',auth[_0xef44('0x9')](),controller[_0xef44('0xe')]);router[_0xef44('0xf')](_0xef44('0xb'),auth[_0xef44('0x9')](),controller[_0xef44('0x10')]);router[_0xef44('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xef44('0x12')]);module[_0xef44('0x13')]=router;
\ No newline at end of file
index 20763cf..25ea56c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8305=['string','customVariable','keyValue','STRING','ENUM','variable','BOOLEAN','sequelize','exports'];(function(_0x5861c6,_0xb11481){var _0x1cc9df=function(_0x1008e1){while(--_0x1008e1){_0x5861c6['push'](_0x5861c6['shift']());}};_0x1cc9df(++_0xb11481);}(_0x8305,0xd6));var _0x5830=function(_0x56a13d,_0x283398){_0x56a13d=_0x56a13d-0x0;var _0x5ada39=_0x8305[_0x56a13d];return _0x5ada39;};'use strict';var Sequelize=require(_0x5830('0x0'));module[_0x5830('0x1')]={'type':{'type':Sequelize['ENUM'](_0x5830('0x2'),'variable',_0x5830('0x3'),_0x5830('0x4'),'picklist'),'defaultValue':_0x5830('0x2')},'content':{'type':Sequelize[_0x5830('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x5830('0x6')](_0x5830('0x2'),_0x5830('0x7'),_0x5830('0x3'))},'keyContent':{'type':Sequelize[_0x5830('0x5')]},'idField':{'type':Sequelize[_0x5830('0x5')]},'nameField':{'type':Sequelize[_0x5830('0x5')]},'customField':{'type':Sequelize[_0x5830('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x3972=['ENUM','customVariable','keyValue','picklist','string','STRING','variable','BOOLEAN','sequelize'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x3972,0xce));var _0x2397=function(_0xc472da,_0xac0d82){_0xc472da=_0xc472da-0x0;var _0x1e6558=_0x3972[_0xc472da];return _0x1e6558;};'use strict';var Sequelize=require(_0x2397('0x0'));module['exports']={'type':{'type':Sequelize[_0x2397('0x1')]('string','variable',_0x2397('0x2'),_0x2397('0x3'),_0x2397('0x4')),'defaultValue':_0x2397('0x5')},'content':{'type':Sequelize[_0x2397('0x6')]},'key':{'type':Sequelize[_0x2397('0x6')]},'keyType':{'type':Sequelize[_0x2397('0x1')](_0x2397('0x5'),_0x2397('0x7'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2397('0x6')]},'nameField':{'type':Sequelize[_0x2397('0x6')]},'customField':{'type':Sequelize[_0x2397('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2397('0x6')]}};
\ No newline at end of file
index b6c260d..2dd0578 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d8f=['json','offset','undefined','limit','count','set','apply','reject','then','destroy','error','name','send','map','ServicenowField','fieldName','type','key','query','intersection','model','attributes','fields','hasOwnProperty','sort','pick','filters','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','keys','rawAttributes','find','create','body','update','params','eml-format','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x6d8f,0x175));var _0xf6d8=function(_0x33c147,_0xd24400){_0x33c147=_0x33c147-0x0;var _0x216d7d=_0x6d8f[_0x33c147];return _0x216d7d;};'use strict';var emlformat=require(_0xf6d8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf6d8('0x1'));var rp=require(_0xf6d8('0x2'));var moment=require(_0xf6d8('0x3'));var BPromise=require(_0xf6d8('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf6d8('0x5'));var sox=require(_0xf6d8('0x6'));var csv=require(_0xf6d8('0x7'));var ejs=require(_0xf6d8('0x8'));var fs=require('fs');var fs_extra=require(_0xf6d8('0x9'));var _=require(_0xf6d8('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf6d8('0x7'));var querystring=require(_0xf6d8('0xb'));var Papa=require(_0xf6d8('0xc'));var Redis=require(_0xf6d8('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf6d8('0xe'));var hardwareService=require(_0xf6d8('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0xf6d8('0x10'));var config=require(_0xf6d8('0x11'));var licenseUtil=require(_0xf6d8('0x12'));var db=require(_0xf6d8('0x13'))['db'];function respondWithStatusCode(_0x34f377,_0x4b93ae){_0x4b93ae=_0x4b93ae||0xcc;return function(_0x39e739){if(_0x39e739){return _0x34f377[_0xf6d8('0x14')](_0x4b93ae);}return _0x34f377[_0xf6d8('0x15')](_0x4b93ae)[_0xf6d8('0x16')]();};}function respondWithResult(_0x4971e3,_0x48c087){_0x48c087=_0x48c087||0xc8;return function(_0x4b207b){if(_0x4b207b){return _0x4971e3[_0xf6d8('0x15')](_0x48c087)[_0xf6d8('0x17')](_0x4b207b);}};}function respondWithFilteredResult(_0x3dc204,_0x5a1814){return function(_0x15f81e){if(_0x15f81e){var _0x54147c=typeof _0x5a1814[_0xf6d8('0x18')]===_0xf6d8('0x19')&&typeof _0x5a1814[_0xf6d8('0x1a')]===_0xf6d8('0x19');var _0x3b592e=_0x15f81e[_0xf6d8('0x1b')];var _0x7cb8c=_0x54147c?0x0:_0x5a1814[_0xf6d8('0x18')];var _0x27fc91=_0x54147c?_0x15f81e['count']:_0x5a1814[_0xf6d8('0x18')]+_0x5a1814['limit'];var _0xdda570;if(_0x27fc91>=_0x3b592e){_0x27fc91=_0x3b592e;_0xdda570=0xc8;}else{_0xdda570=0xce;}_0x3dc204['status'](_0xdda570);return _0x3dc204[_0xf6d8('0x1c')]('Content-Range',_0x7cb8c+'-'+_0x27fc91+'/'+_0x3b592e)[_0xf6d8('0x17')](_0x15f81e);}return null;};}function patchUpdates(_0x53c9c6){return function(_0x3094d3){try{jsonpatch[_0xf6d8('0x1d')](_0x3094d3,_0x53c9c6,!![]);}catch(_0x3e66e4){return BPromise[_0xf6d8('0x1e')](_0x3e66e4);}return _0x3094d3['save']();};}function saveUpdates(_0x32c224,_0x1f32ed){return function(_0x3573b1){if(_0x3573b1){return _0x3573b1['update'](_0x32c224)[_0xf6d8('0x1f')](function(_0x2a7d58){return _0x2a7d58;});}return null;};}function removeEntity(_0x852561,_0x21d79a){return function(_0x441d0b){if(_0x441d0b){return _0x441d0b[_0xf6d8('0x20')]()[_0xf6d8('0x1f')](function(){_0x852561[_0xf6d8('0x15')](0xcc)[_0xf6d8('0x16')]();});}};}function handleEntityNotFound(_0x346a90,_0x13e875){return function(_0x2f231f){if(!_0x2f231f){_0x346a90['sendStatus'](0x194);}return _0x2f231f;};}function handleError(_0x2f346f,_0x5a921c){_0x5a921c=_0x5a921c||0x1f4;return function(_0x4933fc){logger[_0xf6d8('0x21')](_0x4933fc['stack']);if(_0x4933fc[_0xf6d8('0x22')]){delete _0x4933fc[_0xf6d8('0x22')];}_0x2f346f[_0xf6d8('0x15')](_0x5a921c)[_0xf6d8('0x23')](_0x4933fc);};}exports['index']=function(_0x4dc7f7,_0x41187b){var _0x5e1186={},_0xada864={},_0x48c8c4={'count':0x0,'rows':[]};var _0x59ad95=_[_0xf6d8('0x24')](db[_0xf6d8('0x25')]['rawAttributes'],function(_0x3a7219){return{'name':_0x3a7219[_0xf6d8('0x26')],'type':_0x3a7219[_0xf6d8('0x27')][_0xf6d8('0x28')]};});_0xada864['model']=_[_0xf6d8('0x24')](_0x59ad95,_0xf6d8('0x22'));_0xada864[_0xf6d8('0x29')]=_['keys'](_0x4dc7f7[_0xf6d8('0x29')]);_0xada864['filters']=_[_0xf6d8('0x2a')](_0xada864[_0xf6d8('0x2b')],_0xada864[_0xf6d8('0x29')]);_0x5e1186[_0xf6d8('0x2c')]=_[_0xf6d8('0x2a')](_0xada864[_0xf6d8('0x2b')],qs[_0xf6d8('0x2d')](_0x4dc7f7[_0xf6d8('0x29')][_0xf6d8('0x2d')]));_0x5e1186[_0xf6d8('0x2c')]=_0x5e1186[_0xf6d8('0x2c')]['length']?_0x5e1186[_0xf6d8('0x2c')]:_0xada864[_0xf6d8('0x2b')];if(!_0x4dc7f7['query'][_0xf6d8('0x2e')]('nolimit')){_0x5e1186[_0xf6d8('0x1a')]=qs[_0xf6d8('0x1a')](_0x4dc7f7[_0xf6d8('0x29')][_0xf6d8('0x1a')]);_0x5e1186[_0xf6d8('0x18')]=qs['offset'](_0x4dc7f7['query']['offset']);}_0x5e1186['order']=qs[_0xf6d8('0x2f')](_0x4dc7f7[_0xf6d8('0x29')][_0xf6d8('0x2f')]);_0x5e1186['where']=qs['filters'](_[_0xf6d8('0x30')](_0x4dc7f7[_0xf6d8('0x29')],_0xada864[_0xf6d8('0x31')]),_0x59ad95);if(_0x4dc7f7[_0xf6d8('0x29')]['filter']){_0x5e1186[_0xf6d8('0x32')]=_[_0xf6d8('0x33')](_0x5e1186[_0xf6d8('0x32')],{'$or':_[_0xf6d8('0x24')](_0x59ad95,function(_0x62509c){if(_0x62509c[_0xf6d8('0x27')]!==_0xf6d8('0x34')){var _0x577c6e={};_0x577c6e[_0x62509c[_0xf6d8('0x22')]]={'$like':'%'+_0x4dc7f7['query']['filter']+'%'};return _0x577c6e;}})});}_0x5e1186=_[_0xf6d8('0x33')]({},_0x5e1186,_0x4dc7f7[_0xf6d8('0x35')]);var _0x27380b={'where':_0x5e1186[_0xf6d8('0x32')]};return db[_0xf6d8('0x25')][_0xf6d8('0x1b')](_0x27380b)[_0xf6d8('0x1f')](function(_0x5c0284){_0x48c8c4[_0xf6d8('0x1b')]=_0x5c0284;if(_0x4dc7f7[_0xf6d8('0x29')][_0xf6d8('0x36')]){_0x5e1186[_0xf6d8('0x37')]=[{'all':!![]}];}return db[_0xf6d8('0x25')]['findAll'](_0x5e1186);})['then'](function(_0x2e982f){_0x48c8c4[_0xf6d8('0x38')]=_0x2e982f;return _0x48c8c4;})[_0xf6d8('0x1f')](respondWithFilteredResult(_0x41187b,_0x5e1186))[_0xf6d8('0x39')](handleError(_0x41187b,null));};exports[_0xf6d8('0x3a')]=function(_0x8b414,_0x2db6b8){var _0x56509a={'raw':!![],'where':{'id':_0x8b414['params']['id']}},_0x37e8f9={};_0x37e8f9['model']=_[_0xf6d8('0x3b')](db[_0xf6d8('0x25')][_0xf6d8('0x3c')]);_0x37e8f9[_0xf6d8('0x29')]=_[_0xf6d8('0x3b')](_0x8b414[_0xf6d8('0x29')]);_0x37e8f9[_0xf6d8('0x31')]=_[_0xf6d8('0x2a')](_0x37e8f9['model'],_0x37e8f9[_0xf6d8('0x29')]);_0x56509a[_0xf6d8('0x2c')]=_[_0xf6d8('0x2a')](_0x37e8f9[_0xf6d8('0x2b')],qs[_0xf6d8('0x2d')](_0x8b414[_0xf6d8('0x29')][_0xf6d8('0x2d')]));_0x56509a['attributes']=_0x56509a['attributes']['length']?_0x56509a['attributes']:_0x37e8f9[_0xf6d8('0x2b')];if(_0x8b414['query'][_0xf6d8('0x36')]){_0x56509a[_0xf6d8('0x37')]=[{'all':!![]}];}_0x56509a=_[_0xf6d8('0x33')]({},_0x56509a,_0x8b414[_0xf6d8('0x35')]);return db[_0xf6d8('0x25')][_0xf6d8('0x3d')](_0x56509a)['then'](handleEntityNotFound(_0x2db6b8,null))[_0xf6d8('0x1f')](respondWithResult(_0x2db6b8,null))[_0xf6d8('0x39')](handleError(_0x2db6b8,null));};exports[_0xf6d8('0x3e')]=function(_0x169c1c,_0x3c96d7){return db['ServicenowField']['create'](_0x169c1c[_0xf6d8('0x3f')],{})[_0xf6d8('0x1f')](respondWithResult(_0x3c96d7,0xc9))['catch'](handleError(_0x3c96d7,null));};exports[_0xf6d8('0x40')]=function(_0x44edba,_0x3b640b){if(_0x44edba['body']['id']){delete _0x44edba['body']['id'];}return db['ServicenowField'][_0xf6d8('0x3d')]({'where':{'id':_0x44edba[_0xf6d8('0x41')]['id']}})[_0xf6d8('0x1f')](handleEntityNotFound(_0x3b640b,null))['then'](saveUpdates(_0x44edba[_0xf6d8('0x3f')],null))[_0xf6d8('0x1f')](respondWithResult(_0x3b640b,null))['catch'](handleError(_0x3b640b,null));};exports[_0xf6d8('0x20')]=function(_0x34494a,_0x4a7690){return db[_0xf6d8('0x25')][_0xf6d8('0x3d')]({'where':{'id':_0x34494a['params']['id']}})[_0xf6d8('0x1f')](handleEntityNotFound(_0x4a7690,null))[_0xf6d8('0x1f')](removeEntity(_0x4a7690,null))[_0xf6d8('0x39')](handleError(_0x4a7690,null));};
\ No newline at end of file
+var _0x1b85=['to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','count','limit','Content-Range','apply','reject','then','destroy','end','error','name','index','map','ServicenowField','rawAttributes','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','find','create','body','catch','update','params','eml-format','rimraf','zip-dir','bluebird','path','sox'];(function(_0x3099d1,_0x3dd47b){var _0x19fec0=function(_0x28a1e8){while(--_0x28a1e8){_0x3099d1['push'](_0x3099d1['shift']());}};_0x19fec0(++_0x3dd47b);}(_0x1b85,0x10e));var _0x51b8=function(_0x48df04,_0x1522b1){_0x48df04=_0x48df04-0x0;var _0x4de5fa=_0x1b85[_0x48df04];return _0x4de5fa;};'use strict';var emlformat=require(_0x51b8('0x0'));var rimraf=require(_0x51b8('0x1'));var zipdir=require(_0x51b8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x51b8('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x51b8('0x4'));var sox=require(_0x51b8('0x5'));var csv=require(_0x51b8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x51b8('0x7'));var _=require(_0x51b8('0x8'));var squel=require(_0x51b8('0x9'));var crypto=require(_0x51b8('0xa'));var jsforce=require(_0x51b8('0xb'));var deskjs=require(_0x51b8('0xc'));var toCsv=require(_0x51b8('0x6'));var querystring=require('querystring');var Papa=require(_0x51b8('0xd'));var Redis=require(_0x51b8('0xe'));var authService=require(_0x51b8('0xf'));var qs=require(_0x51b8('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x51b8('0x11'))(_0x51b8('0x12'));var utils=require(_0x51b8('0x13'));var config=require(_0x51b8('0x14'));var licenseUtil=require(_0x51b8('0x15'));var db=require(_0x51b8('0x16'))['db'];function respondWithStatusCode(_0x8b7928,_0x2d117b){_0x2d117b=_0x2d117b||0xcc;return function(_0x40af79){if(_0x40af79){return _0x8b7928['sendStatus'](_0x2d117b);}return _0x8b7928['status'](_0x2d117b)['end']();};}function respondWithResult(_0x9677a4,_0x5e7a5e){_0x5e7a5e=_0x5e7a5e||0xc8;return function(_0x176518){if(_0x176518){return _0x9677a4[_0x51b8('0x17')](_0x5e7a5e)[_0x51b8('0x18')](_0x176518);}};}function respondWithFilteredResult(_0x1cd2ed,_0x2d46f0){return function(_0x52829b){if(_0x52829b){var _0x553a35=typeof _0x2d46f0[_0x51b8('0x19')]==='undefined'&&typeof _0x2d46f0['limit']==='undefined';var _0x4b5baa=_0x52829b[_0x51b8('0x1a')];var _0x5628fe=_0x553a35?0x0:_0x2d46f0[_0x51b8('0x19')];var _0x119874=_0x553a35?_0x52829b[_0x51b8('0x1a')]:_0x2d46f0[_0x51b8('0x19')]+_0x2d46f0[_0x51b8('0x1b')];var _0x39a08a;if(_0x119874>=_0x4b5baa){_0x119874=_0x4b5baa;_0x39a08a=0xc8;}else{_0x39a08a=0xce;}_0x1cd2ed['status'](_0x39a08a);return _0x1cd2ed['set'](_0x51b8('0x1c'),_0x5628fe+'-'+_0x119874+'/'+_0x4b5baa)[_0x51b8('0x18')](_0x52829b);}return null;};}function patchUpdates(_0x696ab5){return function(_0x40becc){try{jsonpatch[_0x51b8('0x1d')](_0x40becc,_0x696ab5,!![]);}catch(_0x56b2bb){return BPromise[_0x51b8('0x1e')](_0x56b2bb);}return _0x40becc['save']();};}function saveUpdates(_0x2a5cdc,_0x21476d){return function(_0x8df4b8){if(_0x8df4b8){return _0x8df4b8['update'](_0x2a5cdc)[_0x51b8('0x1f')](function(_0x20eba2){return _0x20eba2;});}return null;};}function removeEntity(_0x431a36,_0xd56aeb){return function(_0x34387d){if(_0x34387d){return _0x34387d[_0x51b8('0x20')]()[_0x51b8('0x1f')](function(){_0x431a36[_0x51b8('0x17')](0xcc)[_0x51b8('0x21')]();});}};}function handleEntityNotFound(_0x234f9a,_0x547e4f){return function(_0x394fb9){if(!_0x394fb9){_0x234f9a['sendStatus'](0x194);}return _0x394fb9;};}function handleError(_0x3527b2,_0x44bedf){_0x44bedf=_0x44bedf||0x1f4;return function(_0x18c3b7){logger[_0x51b8('0x22')](_0x18c3b7['stack']);if(_0x18c3b7[_0x51b8('0x23')]){delete _0x18c3b7[_0x51b8('0x23')];}_0x3527b2[_0x51b8('0x17')](_0x44bedf)['send'](_0x18c3b7);};}exports[_0x51b8('0x24')]=function(_0x4b9699,_0xbbc4f6){var _0x4273b4={},_0x382323={},_0x2dd4ff={'count':0x0,'rows':[]};var _0x7db813=_[_0x51b8('0x25')](db[_0x51b8('0x26')][_0x51b8('0x27')],function(_0x6121f6){return{'name':_0x6121f6['fieldName'],'type':_0x6121f6[_0x51b8('0x28')][_0x51b8('0x29')]};});_0x382323['model']=_[_0x51b8('0x25')](_0x7db813,'name');_0x382323['query']=_[_0x51b8('0x2a')](_0x4b9699[_0x51b8('0x2b')]);_0x382323[_0x51b8('0x2c')]=_[_0x51b8('0x2d')](_0x382323[_0x51b8('0x2e')],_0x382323[_0x51b8('0x2b')]);_0x4273b4['attributes']=_[_0x51b8('0x2d')](_0x382323[_0x51b8('0x2e')],qs[_0x51b8('0x2f')](_0x4b9699[_0x51b8('0x2b')][_0x51b8('0x2f')]));_0x4273b4[_0x51b8('0x30')]=_0x4273b4[_0x51b8('0x30')][_0x51b8('0x31')]?_0x4273b4[_0x51b8('0x30')]:_0x382323[_0x51b8('0x2e')];if(!_0x4b9699[_0x51b8('0x2b')][_0x51b8('0x32')](_0x51b8('0x33'))){_0x4273b4['limit']=qs[_0x51b8('0x1b')](_0x4b9699['query']['limit']);_0x4273b4[_0x51b8('0x19')]=qs[_0x51b8('0x19')](_0x4b9699[_0x51b8('0x2b')][_0x51b8('0x19')]);}_0x4273b4[_0x51b8('0x34')]=qs[_0x51b8('0x35')](_0x4b9699[_0x51b8('0x2b')][_0x51b8('0x35')]);_0x4273b4[_0x51b8('0x36')]=qs[_0x51b8('0x2c')](_['pick'](_0x4b9699[_0x51b8('0x2b')],_0x382323['filters']),_0x7db813);if(_0x4b9699['query']['filter']){_0x4273b4['where']=_[_0x51b8('0x37')](_0x4273b4[_0x51b8('0x36')],{'$or':_[_0x51b8('0x25')](_0x7db813,function(_0x4b3fed){if(_0x4b3fed[_0x51b8('0x28')]!==_0x51b8('0x38')){var _0x5a3acf={};_0x5a3acf[_0x4b3fed[_0x51b8('0x23')]]={'$like':'%'+_0x4b9699[_0x51b8('0x2b')][_0x51b8('0x39')]+'%'};return _0x5a3acf;}})});}_0x4273b4=_[_0x51b8('0x37')]({},_0x4273b4,_0x4b9699[_0x51b8('0x3a')]);var _0x56ea39={'where':_0x4273b4[_0x51b8('0x36')]};return db['ServicenowField'][_0x51b8('0x1a')](_0x56ea39)[_0x51b8('0x1f')](function(_0x379dab){_0x2dd4ff['count']=_0x379dab;if(_0x4b9699[_0x51b8('0x2b')][_0x51b8('0x3b')]){_0x4273b4[_0x51b8('0x3c')]=[{'all':!![]}];}return db['ServicenowField'][_0x51b8('0x3d')](_0x4273b4);})[_0x51b8('0x1f')](function(_0x1ba3f2){_0x2dd4ff['rows']=_0x1ba3f2;return _0x2dd4ff;})[_0x51b8('0x1f')](respondWithFilteredResult(_0xbbc4f6,_0x4273b4))['catch'](handleError(_0xbbc4f6,null));};exports[_0x51b8('0x3e')]=function(_0x35744a,_0x3168cd){var _0x56b5dc={'raw':!![],'where':{'id':_0x35744a['params']['id']}},_0x295454={};_0x295454[_0x51b8('0x2e')]=_[_0x51b8('0x2a')](db[_0x51b8('0x26')]['rawAttributes']);_0x295454['query']=_[_0x51b8('0x2a')](_0x35744a[_0x51b8('0x2b')]);_0x295454[_0x51b8('0x2c')]=_[_0x51b8('0x2d')](_0x295454[_0x51b8('0x2e')],_0x295454['query']);_0x56b5dc[_0x51b8('0x30')]=_[_0x51b8('0x2d')](_0x295454[_0x51b8('0x2e')],qs[_0x51b8('0x2f')](_0x35744a[_0x51b8('0x2b')][_0x51b8('0x2f')]));_0x56b5dc['attributes']=_0x56b5dc[_0x51b8('0x30')][_0x51b8('0x31')]?_0x56b5dc['attributes']:_0x295454['model'];if(_0x35744a[_0x51b8('0x2b')][_0x51b8('0x3b')]){_0x56b5dc[_0x51b8('0x3c')]=[{'all':!![]}];}_0x56b5dc=_[_0x51b8('0x37')]({},_0x56b5dc,_0x35744a[_0x51b8('0x3a')]);return db[_0x51b8('0x26')][_0x51b8('0x3f')](_0x56b5dc)[_0x51b8('0x1f')](handleEntityNotFound(_0x3168cd,null))[_0x51b8('0x1f')](respondWithResult(_0x3168cd,null))['catch'](handleError(_0x3168cd,null));};exports['create']=function(_0x354372,_0x4e1de3){return db[_0x51b8('0x26')][_0x51b8('0x40')](_0x354372[_0x51b8('0x41')],{})[_0x51b8('0x1f')](respondWithResult(_0x4e1de3,0xc9))[_0x51b8('0x42')](handleError(_0x4e1de3,null));};exports[_0x51b8('0x43')]=function(_0x15201c,_0x29be49){if(_0x15201c[_0x51b8('0x41')]['id']){delete _0x15201c[_0x51b8('0x41')]['id'];}return db[_0x51b8('0x26')][_0x51b8('0x3f')]({'where':{'id':_0x15201c[_0x51b8('0x44')]['id']}})[_0x51b8('0x1f')](handleEntityNotFound(_0x29be49,null))['then'](saveUpdates(_0x15201c[_0x51b8('0x41')],null))[_0x51b8('0x1f')](respondWithResult(_0x29be49,null))[_0x51b8('0x42')](handleError(_0x29be49,null));};exports[_0x51b8('0x20')]=function(_0x582735,_0x210a11){return db[_0x51b8('0x26')]['find']({'where':{'id':_0x582735[_0x51b8('0x44')]['id']}})[_0x51b8('0x1f')](handleEntityNotFound(_0x210a11,null))['then'](removeEntity(_0x210a11,null))[_0x51b8('0x42')](handleError(_0x210a11,null));};
\ No newline at end of file
index eb94242..ce842ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d6a=['FieldId','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','ServicenowField','int_servicenow_fields','idField'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x7d6a,0x1a1));var _0xa7d6=function(_0x39b7db,_0xbe4c47){_0x39b7db=_0x39b7db-0x0;var _0x2432ac=_0x7d6a[_0x39b7db];return _0x2432ac;};'use strict';var _=require(_0xa7d6('0x0'));var util=require(_0xa7d6('0x1'));var logger=require('../../config/logger')(_0xa7d6('0x2'));var moment=require(_0xa7d6('0x3'));var BPromise=require(_0xa7d6('0x4'));var rp=require(_0xa7d6('0x5'));var fs=require('fs');var path=require(_0xa7d6('0x6'));var rimraf=require(_0xa7d6('0x7'));var config=require(_0xa7d6('0x8'));var attributes=require('./intServicenowField.attributes');module['exports']=function(_0x32d87c,_0xf44687){return _0x32d87c['define'](_0xa7d6('0x9'),attributes,{'tableName':_0xa7d6('0xa'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xa7d6('0xb'),_0xa7d6('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc892=['FieldId','lodash','../../config/logger','api','moment','bluebird','./intServicenowField.attributes','ServicenowField','servicenow_unique_index'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc892,0xd0));var _0x2c89=function(_0x4ec352,_0x1300ba){_0x4ec352=_0x4ec352-0x0;var _0x1a7f42=_0xc892[_0x4ec352];return _0x1a7f42;};'use strict';var _=require(_0x2c89('0x0'));var util=require('util');var logger=require(_0x2c89('0x1'))(_0x2c89('0x2'));var moment=require(_0x2c89('0x3'));var BPromise=require(_0x2c89('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2c89('0x5'));module['exports']=function(_0xbee858,_0x11977d){return _0xbee858['define'](_0x2c89('0x6'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x2c89('0x7'),'fields':['idField',_0x2c89('0x8')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 05879f7..0a5fb58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x18bbe6,_0x4bac8e){var _0x116eb7=function(_0x6729b0){while(--_0x6729b0){_0x18bbe6['push'](_0x18bbe6['shift']());}};_0x116eb7(++_0x4bac8e);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4deaa4,_0x17621f){_0x4deaa4=_0x4deaa4-0x0;var _0x45d54c=_0xb43b[_0x4deaa4];return _0x45d54c;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});}
\ No newline at end of file
+var _0xf4eb=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3feccc,_0x5534c7){var _0x2c13b5=function(_0x59a2cd){while(--_0x59a2cd){_0x3feccc['push'](_0x3feccc['shift']());}};_0x2c13b5(++_0x5534c7);}(_0xf4eb,0xec));var _0xbf4e=function(_0x3968a1,_0x51e12a){_0x3968a1=_0x3968a1-0x0;var _0x513aad=_0xf4eb[_0x3968a1];return _0x513aad;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('ServicenowField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});}
\ No newline at end of file
index 41a9a12..7e55fff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1080a2,_0x510e98){var _0x406abe=function(_0x3b770c){while(--_0x3b770c){_0x1080a2['push'](_0x1080a2['shift']());}};_0x406abe(++_0x510e98);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x27874c,_0x193d59){var _0x3af0b8=function(_0x32bfc2){while(--_0x32bfc2){_0x27874c['push'](_0x27874c['shift']());}};_0x3af0b8(++_0x193d59);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
index 50e3926..0a1be10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0xa56d66,_0x2db568){var _0x5c1953=function(_0x4e1aa8){while(--_0x4e1aa8){_0xa56d66['push'](_0xa56d66['shift']());}};_0x5c1953(++_0x2db568);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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(_0xa0e18f,_0x37889e){var _0x331b49=function(_0x41e501){while(--_0x41e501){_0xa0e18f['push'](_0xa0e18f['shift']());}};_0x331b49(++_0x37889e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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 1023911..ab3afc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f1e=['nolimit','sort','pick','filters','filter','where','VIRTUAL','options','SugarcrmAccount','includeAll','rows','params','include','merge','catch','create','body','find','findOne','SugarcrmConfiguration','length','getConfigurations','addConfiguration','AccountId','Subjects','channel','Descriptions','SugarcrmField','getFields','assigned_user_id','date_start','duration_hours','parent_id','parent_type','parent_name','direction','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','username','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','module_fields','label','endsWith','values','value','test','statusCode','send','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','intersection','attributes','fields','query','hasOwnProperty'];(function(_0xdb200d,_0x4cd806){var _0x36a104=function(_0x57be33){while(--_0x57be33){_0xdb200d['push'](_0xdb200d['shift']());}};_0x36a104(++_0x4cd806);}(_0x0f1e,0x1a7));var _0xe0f1=function(_0x508a19,_0xba5af1){_0x508a19=_0x508a19-0x0;var _0x2b2393=_0x0f1e[_0x508a19];return _0x2b2393;};'use strict';var emlformat=require(_0xe0f1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0f1('0x1'));var jsonpatch=require(_0xe0f1('0x2'));var rp=require(_0xe0f1('0x3'));var moment=require(_0xe0f1('0x4'));var BPromise=require(_0xe0f1('0x5'));var Mustache=require('mustache');var util=require(_0xe0f1('0x6'));var path=require('path');var sox=require(_0xe0f1('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe0f1('0x8'));var _=require(_0xe0f1('0x9'));var squel=require(_0xe0f1('0xa'));var crypto=require(_0xe0f1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe0f1('0xc'));var toCsv=require(_0xe0f1('0xd'));var querystring=require(_0xe0f1('0xe'));var Papa=require('papaparse');var Redis=require(_0xe0f1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe0f1('0x10'));var as=require(_0xe0f1('0x11'));var hardwareService=require(_0xe0f1('0x12'));var logger=require(_0xe0f1('0x13'))(_0xe0f1('0x14'));var utils=require(_0xe0f1('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe0f1('0x16'));var db=require(_0xe0f1('0x17'))['db'];var integrations=require(_0xe0f1('0x18'));function respondWithStatusCode(_0x2b0c28,_0x124473){_0x124473=_0x124473||0xcc;return function(_0x36c888){if(_0x36c888){return _0x2b0c28[_0xe0f1('0x19')](_0x124473);}return _0x2b0c28[_0xe0f1('0x1a')](_0x124473)[_0xe0f1('0x1b')]();};}function respondWithResult(_0x487923,_0x1ba556){_0x1ba556=_0x1ba556||0xc8;return function(_0x2207af){if(_0x2207af){return _0x487923['status'](_0x1ba556)[_0xe0f1('0x1c')](_0x2207af);}};}function respondWithFilteredResult(_0x27cdbe,_0x1c6bc9){return function(_0xf8618d){if(_0xf8618d){var _0x31fe6c=typeof _0x1c6bc9[_0xe0f1('0x1d')]===_0xe0f1('0x1e')&&typeof _0x1c6bc9[_0xe0f1('0x1f')]===_0xe0f1('0x1e');var _0x2dd285=_0xf8618d[_0xe0f1('0x20')];var _0x3a516c=_0x31fe6c?0x0:_0x1c6bc9[_0xe0f1('0x1d')];var _0x495680=_0x31fe6c?_0xf8618d[_0xe0f1('0x20')]:_0x1c6bc9[_0xe0f1('0x1d')]+_0x1c6bc9[_0xe0f1('0x1f')];var _0xb86750;if(_0x495680>=_0x2dd285){_0x495680=_0x2dd285;_0xb86750=0xc8;}else{_0xb86750=0xce;}_0x27cdbe[_0xe0f1('0x1a')](_0xb86750);return _0x27cdbe[_0xe0f1('0x21')](_0xe0f1('0x22'),_0x3a516c+'-'+_0x495680+'/'+_0x2dd285)[_0xe0f1('0x1c')](_0xf8618d);}return null;};}function patchUpdates(_0x48afa0){return function(_0x63fdfc){try{jsonpatch[_0xe0f1('0x23')](_0x63fdfc,_0x48afa0,!![]);}catch(_0x11e65f){return BPromise[_0xe0f1('0x24')](_0x11e65f);}return _0x63fdfc[_0xe0f1('0x25')]();};}function saveUpdates(_0x22353d,_0xf3cf5a){return function(_0x5cabaa){if(_0x5cabaa){return _0x5cabaa[_0xe0f1('0x26')](_0x22353d)['then'](function(_0x31b3a7){return _0x31b3a7;});}return null;};}function removeEntity(_0x186b6d,_0x26e01d){return function(_0x4e9eaa){if(_0x4e9eaa){return _0x4e9eaa[_0xe0f1('0x27')]()[_0xe0f1('0x28')](function(){_0x186b6d['status'](0xcc)[_0xe0f1('0x1b')]();});}};}function handleEntityNotFound(_0x5d8281,_0x4c1b77){return function(_0x11f7a0){if(!_0x11f7a0){_0x5d8281['sendStatus'](0x194);}return _0x11f7a0;};}function handleError(_0x3f5cca,_0x4040cb){_0x4040cb=_0x4040cb||0x1f4;return function(_0x12df6){logger[_0xe0f1('0x29')](_0x12df6[_0xe0f1('0x2a')]);if(_0x12df6[_0xe0f1('0x2b')]){delete _0x12df6[_0xe0f1('0x2b')];}_0x3f5cca[_0xe0f1('0x1a')](_0x4040cb)['send'](_0x12df6);};}exports[_0xe0f1('0x2c')]=function(_0x42e098,_0x379ec1){var _0x594f6a={},_0x2ac7e0={},_0x5c7865={'count':0x0,'rows':[]};var _0x5b4076=_[_0xe0f1('0x2d')](db['SugarcrmAccount'][_0xe0f1('0x2e')],function(_0x5b6b2e){return{'name':_0x5b6b2e[_0xe0f1('0x2f')],'type':_0x5b6b2e[_0xe0f1('0x30')][_0xe0f1('0x31')]};});_0x2ac7e0[_0xe0f1('0x32')]=_[_0xe0f1('0x2d')](_0x5b4076,_0xe0f1('0x2b'));_0x2ac7e0['query']=_[_0xe0f1('0x33')](_0x42e098['query']);_0x2ac7e0['filters']=_[_0xe0f1('0x34')](_0x2ac7e0[_0xe0f1('0x32')],_0x2ac7e0['query']);_0x594f6a[_0xe0f1('0x35')]=_[_0xe0f1('0x34')](_0x2ac7e0[_0xe0f1('0x32')],qs[_0xe0f1('0x36')](_0x42e098['query'][_0xe0f1('0x36')]));_0x594f6a[_0xe0f1('0x35')]=_0x594f6a[_0xe0f1('0x35')]['length']?_0x594f6a[_0xe0f1('0x35')]:_0x2ac7e0['model'];if(!_0x42e098[_0xe0f1('0x37')][_0xe0f1('0x38')](_0xe0f1('0x39'))){_0x594f6a[_0xe0f1('0x1f')]=qs[_0xe0f1('0x1f')](_0x42e098[_0xe0f1('0x37')][_0xe0f1('0x1f')]);_0x594f6a[_0xe0f1('0x1d')]=qs[_0xe0f1('0x1d')](_0x42e098[_0xe0f1('0x37')][_0xe0f1('0x1d')]);}_0x594f6a['order']=qs[_0xe0f1('0x3a')](_0x42e098[_0xe0f1('0x37')][_0xe0f1('0x3a')]);_0x594f6a['where']=qs['filters'](_[_0xe0f1('0x3b')](_0x42e098['query'],_0x2ac7e0[_0xe0f1('0x3c')]),_0x5b4076);if(_0x42e098[_0xe0f1('0x37')][_0xe0f1('0x3d')]){_0x594f6a[_0xe0f1('0x3e')]=_['merge'](_0x594f6a[_0xe0f1('0x3e')],{'$or':_['map'](_0x5b4076,function(_0x953282){if(_0x953282[_0xe0f1('0x30')]!==_0xe0f1('0x3f')){var _0x45eac7={};_0x45eac7[_0x953282[_0xe0f1('0x2b')]]={'$like':'%'+_0x42e098[_0xe0f1('0x37')][_0xe0f1('0x3d')]+'%'};return _0x45eac7;}})});}_0x594f6a=_['merge']({},_0x594f6a,_0x42e098[_0xe0f1('0x40')]);var _0x4aac47={'where':_0x594f6a[_0xe0f1('0x3e')]};return db[_0xe0f1('0x41')]['count'](_0x4aac47)['then'](function(_0xd0b5d6){_0x5c7865[_0xe0f1('0x20')]=_0xd0b5d6;if(_0x42e098[_0xe0f1('0x37')][_0xe0f1('0x42')]){_0x594f6a['include']=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x594f6a);})[_0xe0f1('0x28')](function(_0x59f50b){_0x5c7865[_0xe0f1('0x43')]=_0x59f50b;return _0x5c7865;})[_0xe0f1('0x28')](respondWithFilteredResult(_0x379ec1,_0x594f6a))['catch'](handleError(_0x379ec1,null));};exports['show']=function(_0x2d7999,_0x2b1d4e){var _0x449d90={'raw':![],'where':{'id':_0x2d7999[_0xe0f1('0x44')]['id']}},_0x2d7e10={};_0x2d7e10[_0xe0f1('0x32')]=_[_0xe0f1('0x33')](db[_0xe0f1('0x41')][_0xe0f1('0x2e')]);_0x2d7e10['query']=_['keys'](_0x2d7999['query']);_0x2d7e10['filters']=_[_0xe0f1('0x34')](_0x2d7e10['model'],_0x2d7e10[_0xe0f1('0x37')]);_0x449d90[_0xe0f1('0x35')]=_[_0xe0f1('0x34')](_0x2d7e10[_0xe0f1('0x32')],qs['fields'](_0x2d7999[_0xe0f1('0x37')][_0xe0f1('0x36')]));_0x449d90[_0xe0f1('0x35')]=_0x449d90['attributes']['length']?_0x449d90['attributes']:_0x2d7e10[_0xe0f1('0x32')];if(_0x2d7999[_0xe0f1('0x37')][_0xe0f1('0x42')]){_0x449d90[_0xe0f1('0x45')]=[{'all':!![]}];}_0x449d90=_[_0xe0f1('0x46')]({},_0x449d90,_0x2d7999[_0xe0f1('0x40')]);return db['SugarcrmAccount']['find'](_0x449d90)[_0xe0f1('0x28')](handleEntityNotFound(_0x2b1d4e,null))['then'](respondWithResult(_0x2b1d4e,null))[_0xe0f1('0x47')](handleError(_0x2b1d4e,null));};exports[_0xe0f1('0x48')]=function(_0x1400c8,_0x26be8b){return db['SugarcrmAccount'][_0xe0f1('0x48')](_0x1400c8[_0xe0f1('0x49')],{})['then'](respondWithResult(_0x26be8b,0xc9))[_0xe0f1('0x47')](handleError(_0x26be8b,null));};exports[_0xe0f1('0x26')]=function(_0x1a2d7d,_0x35b28d){if(_0x1a2d7d['body']['id']){delete _0x1a2d7d[_0xe0f1('0x49')]['id'];}return db[_0xe0f1('0x41')]['find']({'where':{'id':_0x1a2d7d[_0xe0f1('0x44')]['id']}})[_0xe0f1('0x28')](handleEntityNotFound(_0x35b28d,null))[_0xe0f1('0x28')](saveUpdates(_0x1a2d7d['body'],null))[_0xe0f1('0x28')](respondWithResult(_0x35b28d,null))[_0xe0f1('0x47')](handleError(_0x35b28d,null));};exports['destroy']=function(_0x2d543a,_0x1bd98d){return db[_0xe0f1('0x41')][_0xe0f1('0x4a')]({'where':{'id':_0x2d543a[_0xe0f1('0x44')]['id']}})[_0xe0f1('0x28')](handleEntityNotFound(_0x1bd98d,null))[_0xe0f1('0x28')](removeEntity(_0x1bd98d,null))[_0xe0f1('0x47')](handleError(_0x1bd98d,null));};exports['getConfigurations']=function(_0x1cf417,_0x5b6a8a,_0x871751){var _0x456c10={};var _0x4ba46e={};var _0xe52bd0;var _0x4f85be;return db[_0xe0f1('0x41')][_0xe0f1('0x4b')]({'where':{'id':_0x1cf417[_0xe0f1('0x44')]['id']}})['then'](handleEntityNotFound(_0x5b6a8a,null))[_0xe0f1('0x28')](function(_0x1c2513){if(_0x1c2513){_0xe52bd0=_0x1c2513;_0x4ba46e[_0xe0f1('0x32')]=_[_0xe0f1('0x33')](db[_0xe0f1('0x4c')][_0xe0f1('0x2e')]);_0x4ba46e['query']=_[_0xe0f1('0x33')](_0x1cf417[_0xe0f1('0x37')]);_0x4ba46e[_0xe0f1('0x3c')]=_['intersection'](_0x4ba46e[_0xe0f1('0x32')],_0x4ba46e[_0xe0f1('0x37')]);_0x456c10[_0xe0f1('0x35')]=_['intersection'](_0x4ba46e[_0xe0f1('0x32')],qs['fields'](_0x1cf417[_0xe0f1('0x37')][_0xe0f1('0x36')]));_0x456c10[_0xe0f1('0x35')]=_0x456c10[_0xe0f1('0x35')][_0xe0f1('0x4d')]?_0x456c10['attributes']:_0x4ba46e[_0xe0f1('0x32')];_0x456c10['order']=qs[_0xe0f1('0x3a')](_0x1cf417['query'][_0xe0f1('0x3a')]);_0x456c10[_0xe0f1('0x3e')]=qs[_0xe0f1('0x3c')](_[_0xe0f1('0x3b')](_0x1cf417[_0xe0f1('0x37')],_0x4ba46e[_0xe0f1('0x3c')]));if(_0x1cf417[_0xe0f1('0x37')]['filter']){_0x456c10[_0xe0f1('0x3e')]=_[_0xe0f1('0x46')](_0x456c10['where'],{'$or':_[_0xe0f1('0x2d')](_0x456c10[_0xe0f1('0x35')],function(_0x430ebb){var _0xb86993={};_0xb86993[_0x430ebb]={'$like':'%'+_0x1cf417[_0xe0f1('0x37')][_0xe0f1('0x3d')]+'%'};return _0xb86993;})});}_0x456c10=_[_0xe0f1('0x46')]({},_0x456c10,_0x1cf417[_0xe0f1('0x40')]);return _0xe52bd0[_0xe0f1('0x4e')](_0x456c10);}})['then'](function(_0x3352b2){if(_0x3352b2){_0x4f85be=_0x3352b2[_0xe0f1('0x4d')];if(!_0x1cf417[_0xe0f1('0x37')][_0xe0f1('0x38')]('nolimit')){_0x456c10[_0xe0f1('0x1f')]=qs[_0xe0f1('0x1f')](_0x1cf417[_0xe0f1('0x37')][_0xe0f1('0x1f')]);_0x456c10['offset']=qs['offset'](_0x1cf417[_0xe0f1('0x37')][_0xe0f1('0x1d')]);}return _0xe52bd0['getConfigurations'](_0x456c10);}})['then'](function(_0x215b27){if(_0x215b27){return _0x215b27?{'count':_0x4f85be,'rows':_0x215b27}:null;}})[_0xe0f1('0x28')](respondWithResult(_0x5b6a8a,null))['catch'](handleError(_0x5b6a8a,null));};exports[_0xe0f1('0x4f')]=function(_0xb0c2ff,_0x59d990,_0x1c440a){if(_0xb0c2ff[_0xe0f1('0x49')]['id']){delete _0xb0c2ff['body']['id'];}return db[_0xe0f1('0x41')][_0xe0f1('0x4b')]({'where':{'id':_0xb0c2ff[_0xe0f1('0x44')]['id']}})['then'](handleEntityNotFound(_0x59d990,null))[_0xe0f1('0x28')](function(_0x32758d){if(_0x32758d){_0xb0c2ff[_0xe0f1('0x49')][_0xe0f1('0x50')]=_0x32758d['id'];_0xb0c2ff[_0xe0f1('0x49')][_0xe0f1('0x51')]=integrations['getSubjects'](_0xb0c2ff[_0xe0f1('0x49')][_0xe0f1('0x52')],_0xb0c2ff[_0xe0f1('0x49')][_0xe0f1('0x30')]);_0xb0c2ff[_0xe0f1('0x49')][_0xe0f1('0x53')]=integrations['getDescriptions'](_0xb0c2ff[_0xe0f1('0x49')]['channel'],_0xb0c2ff[_0xe0f1('0x49')][_0xe0f1('0x30')]);return db[_0xe0f1('0x4c')][_0xe0f1('0x48')](_0xb0c2ff['body'],{'include':[{'model':db[_0xe0f1('0x54')],'as':'Subjects'},{'model':db['SugarcrmField'],'as':_0xe0f1('0x53')}]});}return null;})[_0xe0f1('0x28')](respondWithResult(_0x59d990,null))[_0xe0f1('0x47')](handleError(_0x59d990,null));};exports[_0xe0f1('0x55')]=function(_0x53b378,_0x23cc01,_0x457135){var _0xa5312f='';var _0x35ce22=['id',_0xe0f1('0x2b'),_0xe0f1('0x56'),'created_by','description',_0xe0f1('0x57'),_0xe0f1('0x58'),'duration_minutes',_0xe0f1('0x59'),_0xe0f1('0x5a'),_0xe0f1('0x5b'),_0xe0f1('0x5c')];return db[_0xe0f1('0x41')]['findOne']({'where':{'id':_0x53b378['params']['id']},'attributes':['id','username',_0xe0f1('0x5d'),_0xe0f1('0x5e')]})[_0xe0f1('0x28')](handleEntityNotFound(_0x23cc01,null))['then'](function(_0x29557b){if(_0x29557b){_0xa5312f=_0x29557b[_0xe0f1('0x5e')];var _0x3d2465=_0xa5312f[_0xe0f1('0x5f')](-0x1);if(_0x3d2465==='/'){_0xa5312f=_0xa5312f[_0xe0f1('0x60')](0x0,_0xa5312f[_0xe0f1('0x61')](_0x3d2465));}return rp({'method':_0xe0f1('0x62'),'uri':util[_0xe0f1('0x63')](_0xe0f1('0x64'),_0xa5312f,_0xe0f1('0x65')),'json':!![],'form':{'method':_0xe0f1('0x66'),'input_type':_0xe0f1('0x67'),'response_type':_0xe0f1('0x67'),'rest_data':JSON[_0xe0f1('0x68')]({'user_auth':{'user_name':_0x29557b[_0xe0f1('0x69')],'password':_0x29557b[_0xe0f1('0x5d')],'encryption':_0xe0f1('0x6a')},'application':_0xe0f1('0x6b')})}});}})[_0xe0f1('0x28')](function(_0x9344d9){if(_0x9344d9&&_0x9344d9[_0xe0f1('0x2b')]!==_0xe0f1('0x6c')&&_0x9344d9['name']!==_0xe0f1('0x6d')){return rp({'method':_0xe0f1('0x62'),'uri':util[_0xe0f1('0x63')](_0xe0f1('0x64'),_0xa5312f,_0xe0f1('0x65')),'json':!![],'form':{'method':_0xe0f1('0x6e'),'input_type':_0xe0f1('0x67'),'response_type':_0xe0f1('0x67'),'rest_data':JSON[_0xe0f1('0x68')]({'session':_0x9344d9['id'],'module_name':'Calls'})}})[_0xe0f1('0x28')](function(_0x50bc7e){if(_0x50bc7e){var _0x4b2b7a=_['values'](_0x50bc7e[_0xe0f1('0x6f')]);_['remove'](_0x4b2b7a,function(_0x35943f){return _0x35ce22['includes'](_0x35943f[_0xe0f1('0x2b')]);});return{'count':_0x4b2b7a['length'],'rows':_[_0xe0f1('0x2d')](_0x4b2b7a,function(_0x24db46){return{'id':_0x24db46[_0xe0f1('0x2b')],'name':_0x24db46[_0xe0f1('0x70')],'custom':_[_0xe0f1('0x71')](_0x24db46[_0xe0f1('0x2b')],'_c')?!![]:![],'options':_0x24db46[_0xe0f1('0x40')]?_[_0xe0f1('0x2d')](_[_0xe0f1('0x72')](_0x24db46[_0xe0f1('0x40')]),function(_0x4cf9d0){return{'name':_0x4cf9d0[_0xe0f1('0x73')],'value':_0x4cf9d0[_0xe0f1('0x2b')]};}):[]};})};}})[_0xe0f1('0x28')](respondWithResult(_0x23cc01,null))[_0xe0f1('0x47')](function(_0x1d9191){var _0x13596f=_0x53b378['query'][_0xe0f1('0x74')]?0x1f4:_0x1d9191[_0xe0f1('0x75')]||0x1f4;logger[_0xe0f1('0x29')]('getFields,\x20%s,\x20%s,\x20%s',_0xe0f1('0x55'),_0x13596f,JSON[_0xe0f1('0x68')](_0x1d9191));delete _0x1d9191[_0xe0f1('0x2b')];if(_0x13596f===0x191){_0x13596f=0x190;}_0x23cc01[_0xe0f1('0x1a')](_0x13596f)[_0xe0f1('0x76')](_0x53b378[_0xe0f1('0x37')][_0xe0f1('0x74')]?{'message':_0xe0f1('0x77'),'statusCode':_0x1d9191[_0xe0f1('0x75')]}:_0x1d9191);});}else{var _0x355e6b=0x1f4;_0x23cc01[_0xe0f1('0x1a')](_0x355e6b)['send']({'message':_0xe0f1('0x77'),'statusCode':0x190});}});};
\ No newline at end of file
+var _0xd192=['date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','username','password','remoteUri','substring','format','%s%s','/service/v4_1/rest.php','JSON','Invalid\x20Login','Password\x20Expired','get_module_fields','stringify','Calls','module_fields','remove','label','values','value','statusCode','send','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','then','destroy','error','stack','name','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','where','filter','VIRTUAL','merge','options','include','findAll','catch','show','params','keys','find','create','body','getConfigurations','sort','pick','nolimit','addConfiguration','findOne','getSubjects','channel','Descriptions','getDescriptions','SugarcrmConfiguration','SugarcrmField','getFields','description'];(function(_0x36a51b,_0x5c5362){var _0x528ba3=function(_0x38868d){while(--_0x38868d){_0x36a51b['push'](_0x36a51b['shift']());}};_0x528ba3(++_0x5c5362);}(_0xd192,0x8d));var _0x2d19=function(_0x105e5f,_0xaa5f92){_0x105e5f=_0x105e5f-0x0;var _0x5b60c2=_0xd192[_0x105e5f];return _0x5b60c2;};'use strict';var emlformat=require(_0x2d19('0x0'));var rimraf=require(_0x2d19('0x1'));var zipdir=require(_0x2d19('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2d19('0x3'));var BPromise=require(_0x2d19('0x4'));var Mustache=require('mustache');var util=require(_0x2d19('0x5'));var path=require(_0x2d19('0x6'));var sox=require(_0x2d19('0x7'));var csv=require(_0x2d19('0x8'));var ejs=require(_0x2d19('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2d19('0xa'));var squel=require(_0x2d19('0xb'));var crypto=require(_0x2d19('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2d19('0xd'));var toCsv=require(_0x2d19('0x8'));var querystring=require(_0x2d19('0xe'));var Papa=require(_0x2d19('0xf'));var Redis=require(_0x2d19('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2d19('0x11'));var as=require(_0x2d19('0x12'));var hardwareService=require(_0x2d19('0x13'));var logger=require(_0x2d19('0x14'))(_0x2d19('0x15'));var utils=require(_0x2d19('0x16'));var config=require(_0x2d19('0x17'));var licenseUtil=require(_0x2d19('0x18'));var db=require(_0x2d19('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xcb742,_0x46a1d3){_0x46a1d3=_0x46a1d3||0xcc;return function(_0x23196b){if(_0x23196b){return _0xcb742[_0x2d19('0x1a')](_0x46a1d3);}return _0xcb742['status'](_0x46a1d3)[_0x2d19('0x1b')]();};}function respondWithResult(_0x29f78f,_0x2a8053){_0x2a8053=_0x2a8053||0xc8;return function(_0x50dd05){if(_0x50dd05){return _0x29f78f[_0x2d19('0x1c')](_0x2a8053)['json'](_0x50dd05);}};}function respondWithFilteredResult(_0x36d8bf,_0x4d6a4f){return function(_0x25ab60){if(_0x25ab60){var _0xae40c0=typeof _0x4d6a4f[_0x2d19('0x1d')]===_0x2d19('0x1e')&&typeof _0x4d6a4f[_0x2d19('0x1f')]===_0x2d19('0x1e');var _0x32aac8=_0x25ab60[_0x2d19('0x20')];var _0x1b2865=_0xae40c0?0x0:_0x4d6a4f['offset'];var _0x4f9186=_0xae40c0?_0x25ab60[_0x2d19('0x20')]:_0x4d6a4f[_0x2d19('0x1d')]+_0x4d6a4f['limit'];var _0x3a9a95;if(_0x4f9186>=_0x32aac8){_0x4f9186=_0x32aac8;_0x3a9a95=0xc8;}else{_0x3a9a95=0xce;}_0x36d8bf[_0x2d19('0x1c')](_0x3a9a95);return _0x36d8bf['set'](_0x2d19('0x21'),_0x1b2865+'-'+_0x4f9186+'/'+_0x32aac8)[_0x2d19('0x22')](_0x25ab60);}return null;};}function patchUpdates(_0x3e5f6e){return function(_0x1cd264){try{jsonpatch[_0x2d19('0x23')](_0x1cd264,_0x3e5f6e,!![]);}catch(_0x1e1154){return BPromise[_0x2d19('0x24')](_0x1e1154);}return _0x1cd264['save']();};}function saveUpdates(_0x26c2ee,_0x38885b){return function(_0x324957){if(_0x324957){return _0x324957['update'](_0x26c2ee)[_0x2d19('0x25')](function(_0x4756d8){return _0x4756d8;});}return null;};}function removeEntity(_0x2e9e08,_0x344f31){return function(_0x1a0c79){if(_0x1a0c79){return _0x1a0c79[_0x2d19('0x26')]()[_0x2d19('0x25')](function(){_0x2e9e08[_0x2d19('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a9551,_0x2d1c00){return function(_0x369e0c){if(!_0x369e0c){_0x2a9551[_0x2d19('0x1a')](0x194);}return _0x369e0c;};}function handleError(_0x2ae3ca,_0x59de91){_0x59de91=_0x59de91||0x1f4;return function(_0x4e090e){logger[_0x2d19('0x27')](_0x4e090e[_0x2d19('0x28')]);if(_0x4e090e[_0x2d19('0x29')]){delete _0x4e090e[_0x2d19('0x29')];}_0x2ae3ca[_0x2d19('0x1c')](_0x59de91)['send'](_0x4e090e);};}exports['index']=function(_0x3b8467,_0xfcafec){var _0x3cd93c={},_0x576559={},_0x46a919={'count':0x0,'rows':[]};var _0x189f38=_[_0x2d19('0x2a')](db[_0x2d19('0x2b')][_0x2d19('0x2c')],function(_0x556fa3){return{'name':_0x556fa3[_0x2d19('0x2d')],'type':_0x556fa3[_0x2d19('0x2e')][_0x2d19('0x2f')]};});_0x576559[_0x2d19('0x30')]=_['map'](_0x189f38,_0x2d19('0x29'));_0x576559['query']=_['keys'](_0x3b8467[_0x2d19('0x31')]);_0x576559[_0x2d19('0x32')]=_['intersection'](_0x576559['model'],_0x576559[_0x2d19('0x31')]);_0x3cd93c[_0x2d19('0x33')]=_[_0x2d19('0x34')](_0x576559[_0x2d19('0x30')],qs[_0x2d19('0x35')](_0x3b8467[_0x2d19('0x31')][_0x2d19('0x35')]));_0x3cd93c[_0x2d19('0x33')]=_0x3cd93c[_0x2d19('0x33')][_0x2d19('0x36')]?_0x3cd93c[_0x2d19('0x33')]:_0x576559[_0x2d19('0x30')];if(!_0x3b8467[_0x2d19('0x31')][_0x2d19('0x37')]('nolimit')){_0x3cd93c[_0x2d19('0x1f')]=qs['limit'](_0x3b8467[_0x2d19('0x31')][_0x2d19('0x1f')]);_0x3cd93c[_0x2d19('0x1d')]=qs[_0x2d19('0x1d')](_0x3b8467['query'][_0x2d19('0x1d')]);}_0x3cd93c[_0x2d19('0x38')]=qs['sort'](_0x3b8467[_0x2d19('0x31')]['sort']);_0x3cd93c[_0x2d19('0x39')]=qs[_0x2d19('0x32')](_['pick'](_0x3b8467[_0x2d19('0x31')],_0x576559[_0x2d19('0x32')]),_0x189f38);if(_0x3b8467[_0x2d19('0x31')][_0x2d19('0x3a')]){_0x3cd93c[_0x2d19('0x39')]=_['merge'](_0x3cd93c[_0x2d19('0x39')],{'$or':_[_0x2d19('0x2a')](_0x189f38,function(_0x5d7f58){if(_0x5d7f58[_0x2d19('0x2e')]!==_0x2d19('0x3b')){var _0x271aeb={};_0x271aeb[_0x5d7f58[_0x2d19('0x29')]]={'$like':'%'+_0x3b8467[_0x2d19('0x31')]['filter']+'%'};return _0x271aeb;}})});}_0x3cd93c=_[_0x2d19('0x3c')]({},_0x3cd93c,_0x3b8467[_0x2d19('0x3d')]);var _0x5759e5={'where':_0x3cd93c[_0x2d19('0x39')]};return db[_0x2d19('0x2b')][_0x2d19('0x20')](_0x5759e5)[_0x2d19('0x25')](function(_0x5cf113){_0x46a919['count']=_0x5cf113;if(_0x3b8467[_0x2d19('0x31')]['includeAll']){_0x3cd93c[_0x2d19('0x3e')]=[{'all':!![]}];}return db[_0x2d19('0x2b')][_0x2d19('0x3f')](_0x3cd93c);})[_0x2d19('0x25')](function(_0x5012e0){_0x46a919['rows']=_0x5012e0;return _0x46a919;})[_0x2d19('0x25')](respondWithFilteredResult(_0xfcafec,_0x3cd93c))[_0x2d19('0x40')](handleError(_0xfcafec,null));};exports[_0x2d19('0x41')]=function(_0x47770b,_0x3e060e){var _0x35c9e8={'raw':![],'where':{'id':_0x47770b[_0x2d19('0x42')]['id']}},_0x100dfd={};_0x100dfd[_0x2d19('0x30')]=_[_0x2d19('0x43')](db[_0x2d19('0x2b')][_0x2d19('0x2c')]);_0x100dfd['query']=_['keys'](_0x47770b[_0x2d19('0x31')]);_0x100dfd['filters']=_[_0x2d19('0x34')](_0x100dfd[_0x2d19('0x30')],_0x100dfd[_0x2d19('0x31')]);_0x35c9e8['attributes']=_[_0x2d19('0x34')](_0x100dfd['model'],qs[_0x2d19('0x35')](_0x47770b[_0x2d19('0x31')][_0x2d19('0x35')]));_0x35c9e8[_0x2d19('0x33')]=_0x35c9e8[_0x2d19('0x33')][_0x2d19('0x36')]?_0x35c9e8[_0x2d19('0x33')]:_0x100dfd[_0x2d19('0x30')];if(_0x47770b['query']['includeAll']){_0x35c9e8[_0x2d19('0x3e')]=[{'all':!![]}];}_0x35c9e8=_[_0x2d19('0x3c')]({},_0x35c9e8,_0x47770b[_0x2d19('0x3d')]);return db[_0x2d19('0x2b')][_0x2d19('0x44')](_0x35c9e8)['then'](handleEntityNotFound(_0x3e060e,null))[_0x2d19('0x25')](respondWithResult(_0x3e060e,null))[_0x2d19('0x40')](handleError(_0x3e060e,null));};exports[_0x2d19('0x45')]=function(_0xade053,_0x373269){return db['SugarcrmAccount']['create'](_0xade053[_0x2d19('0x46')],{})[_0x2d19('0x25')](respondWithResult(_0x373269,0xc9))[_0x2d19('0x40')](handleError(_0x373269,null));};exports['update']=function(_0x5bc8f9,_0x439cf9){if(_0x5bc8f9[_0x2d19('0x46')]['id']){delete _0x5bc8f9[_0x2d19('0x46')]['id'];}return db[_0x2d19('0x2b')][_0x2d19('0x44')]({'where':{'id':_0x5bc8f9[_0x2d19('0x42')]['id']}})['then'](handleEntityNotFound(_0x439cf9,null))[_0x2d19('0x25')](saveUpdates(_0x5bc8f9[_0x2d19('0x46')],null))[_0x2d19('0x25')](respondWithResult(_0x439cf9,null))['catch'](handleError(_0x439cf9,null));};exports[_0x2d19('0x26')]=function(_0x22fa63,_0x457b3a){return db[_0x2d19('0x2b')][_0x2d19('0x44')]({'where':{'id':_0x22fa63[_0x2d19('0x42')]['id']}})[_0x2d19('0x25')](handleEntityNotFound(_0x457b3a,null))[_0x2d19('0x25')](removeEntity(_0x457b3a,null))[_0x2d19('0x40')](handleError(_0x457b3a,null));};exports[_0x2d19('0x47')]=function(_0x3f3d66,_0xedf666,_0x371207){var _0xd4cc92={};var _0x4cd38d={};var _0x40e7b5;var _0xbea0b8;return db[_0x2d19('0x2b')]['findOne']({'where':{'id':_0x3f3d66[_0x2d19('0x42')]['id']}})[_0x2d19('0x25')](handleEntityNotFound(_0xedf666,null))['then'](function(_0x39578a){if(_0x39578a){_0x40e7b5=_0x39578a;_0x4cd38d[_0x2d19('0x30')]=_[_0x2d19('0x43')](db['SugarcrmConfiguration'][_0x2d19('0x2c')]);_0x4cd38d[_0x2d19('0x31')]=_[_0x2d19('0x43')](_0x3f3d66['query']);_0x4cd38d[_0x2d19('0x32')]=_[_0x2d19('0x34')](_0x4cd38d[_0x2d19('0x30')],_0x4cd38d[_0x2d19('0x31')]);_0xd4cc92['attributes']=_[_0x2d19('0x34')](_0x4cd38d[_0x2d19('0x30')],qs[_0x2d19('0x35')](_0x3f3d66['query']['fields']));_0xd4cc92[_0x2d19('0x33')]=_0xd4cc92[_0x2d19('0x33')][_0x2d19('0x36')]?_0xd4cc92['attributes']:_0x4cd38d[_0x2d19('0x30')];_0xd4cc92[_0x2d19('0x38')]=qs[_0x2d19('0x48')](_0x3f3d66['query'][_0x2d19('0x48')]);_0xd4cc92[_0x2d19('0x39')]=qs[_0x2d19('0x32')](_[_0x2d19('0x49')](_0x3f3d66[_0x2d19('0x31')],_0x4cd38d[_0x2d19('0x32')]));if(_0x3f3d66[_0x2d19('0x31')][_0x2d19('0x3a')]){_0xd4cc92[_0x2d19('0x39')]=_[_0x2d19('0x3c')](_0xd4cc92['where'],{'$or':_[_0x2d19('0x2a')](_0xd4cc92['attributes'],function(_0xdf6f3d){var _0x3384f1={};_0x3384f1[_0xdf6f3d]={'$like':'%'+_0x3f3d66[_0x2d19('0x31')][_0x2d19('0x3a')]+'%'};return _0x3384f1;})});}_0xd4cc92=_[_0x2d19('0x3c')]({},_0xd4cc92,_0x3f3d66['options']);return _0x40e7b5[_0x2d19('0x47')](_0xd4cc92);}})[_0x2d19('0x25')](function(_0x5b32fe){if(_0x5b32fe){_0xbea0b8=_0x5b32fe[_0x2d19('0x36')];if(!_0x3f3d66[_0x2d19('0x31')][_0x2d19('0x37')](_0x2d19('0x4a'))){_0xd4cc92[_0x2d19('0x1f')]=qs[_0x2d19('0x1f')](_0x3f3d66['query']['limit']);_0xd4cc92[_0x2d19('0x1d')]=qs[_0x2d19('0x1d')](_0x3f3d66[_0x2d19('0x31')][_0x2d19('0x1d')]);}return _0x40e7b5[_0x2d19('0x47')](_0xd4cc92);}})['then'](function(_0x4b49ae){if(_0x4b49ae){return _0x4b49ae?{'count':_0xbea0b8,'rows':_0x4b49ae}:null;}})[_0x2d19('0x25')](respondWithResult(_0xedf666,null))[_0x2d19('0x40')](handleError(_0xedf666,null));};exports[_0x2d19('0x4b')]=function(_0xbb056,_0x11fef8,_0x67cf3e){if(_0xbb056[_0x2d19('0x46')]['id']){delete _0xbb056['body']['id'];}return db['SugarcrmAccount'][_0x2d19('0x4c')]({'where':{'id':_0xbb056[_0x2d19('0x42')]['id']}})[_0x2d19('0x25')](handleEntityNotFound(_0x11fef8,null))[_0x2d19('0x25')](function(_0x303d4e){if(_0x303d4e){_0xbb056[_0x2d19('0x46')]['AccountId']=_0x303d4e['id'];_0xbb056[_0x2d19('0x46')]['Subjects']=integrations[_0x2d19('0x4d')](_0xbb056['body'][_0x2d19('0x4e')],_0xbb056[_0x2d19('0x46')][_0x2d19('0x2e')]);_0xbb056[_0x2d19('0x46')][_0x2d19('0x4f')]=integrations[_0x2d19('0x50')](_0xbb056[_0x2d19('0x46')][_0x2d19('0x4e')],_0xbb056[_0x2d19('0x46')][_0x2d19('0x2e')]);return db[_0x2d19('0x51')][_0x2d19('0x45')](_0xbb056[_0x2d19('0x46')],{'include':[{'model':db[_0x2d19('0x52')],'as':'Subjects'},{'model':db[_0x2d19('0x52')],'as':'Descriptions'}]});}return null;})[_0x2d19('0x25')](respondWithResult(_0x11fef8,null))['catch'](handleError(_0x11fef8,null));};exports[_0x2d19('0x53')]=function(_0x10becd,_0x4d17af,_0x119567){var _0x45ba43='';var _0x535925=['id','name','assigned_user_id','created_by',_0x2d19('0x54'),_0x2d19('0x55'),_0x2d19('0x56'),_0x2d19('0x57'),_0x2d19('0x58'),_0x2d19('0x59'),_0x2d19('0x5a'),'direction'];return db[_0x2d19('0x2b')][_0x2d19('0x4c')]({'where':{'id':_0x10becd[_0x2d19('0x42')]['id']},'attributes':['id',_0x2d19('0x5b'),_0x2d19('0x5c'),'remoteUri']})['then'](handleEntityNotFound(_0x4d17af,null))['then'](function(_0x5b3a29){if(_0x5b3a29){_0x45ba43=_0x5b3a29[_0x2d19('0x5d')];var _0x3eff63=_0x45ba43['slice'](-0x1);if(_0x3eff63==='/'){_0x45ba43=_0x45ba43[_0x2d19('0x5e')](0x0,_0x45ba43['lastIndexOf'](_0x3eff63));}return rp({'method':'POST','uri':util[_0x2d19('0x5f')](_0x2d19('0x60'),_0x45ba43,_0x2d19('0x61')),'json':!![],'form':{'method':'login','input_type':_0x2d19('0x62'),'response_type':_0x2d19('0x62'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x5b3a29[_0x2d19('0x5b')],'password':_0x5b3a29['password'],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20Integration'})}});}})['then'](function(_0x6f0e11){if(_0x6f0e11&&_0x6f0e11[_0x2d19('0x29')]!==_0x2d19('0x63')&&_0x6f0e11['name']!==_0x2d19('0x64')){return rp({'method':'POST','uri':util[_0x2d19('0x5f')](_0x2d19('0x60'),_0x45ba43,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x2d19('0x65'),'input_type':_0x2d19('0x62'),'response_type':_0x2d19('0x62'),'rest_data':JSON[_0x2d19('0x66')]({'session':_0x6f0e11['id'],'module_name':_0x2d19('0x67')})}})[_0x2d19('0x25')](function(_0x327364){if(_0x327364){var _0x3df06c=_['values'](_0x327364[_0x2d19('0x68')]);_[_0x2d19('0x69')](_0x3df06c,function(_0x569212){return _0x535925['includes'](_0x569212['name']);});return{'count':_0x3df06c[_0x2d19('0x36')],'rows':_[_0x2d19('0x2a')](_0x3df06c,function(_0x46d35a){return{'id':_0x46d35a[_0x2d19('0x29')],'name':_0x46d35a[_0x2d19('0x6a')],'custom':_['endsWith'](_0x46d35a[_0x2d19('0x29')],'_c')?!![]:![],'options':_0x46d35a[_0x2d19('0x3d')]?_[_0x2d19('0x2a')](_[_0x2d19('0x6b')](_0x46d35a['options']),function(_0x2260cf){return{'name':_0x2260cf[_0x2d19('0x6c')],'value':_0x2260cf[_0x2d19('0x29')]};}):[]};})};}})[_0x2d19('0x25')](respondWithResult(_0x4d17af,null))[_0x2d19('0x40')](function(_0x15789d){var _0x41827a=_0x10becd['query']['test']?0x1f4:_0x15789d[_0x2d19('0x6d')]||0x1f4;logger[_0x2d19('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0x2d19('0x53'),_0x41827a,JSON[_0x2d19('0x66')](_0x15789d));delete _0x15789d[_0x2d19('0x29')];if(_0x41827a===0x191){_0x41827a=0x190;}_0x4d17af[_0x2d19('0x1c')](_0x41827a)[_0x2d19('0x6e')](_0x10becd['query'][_0x2d19('0x6f')]?{'message':_0x2d19('0x70'),'statusCode':_0x15789d[_0x2d19('0x6d')]}:_0x15789d);});}else{var _0x1dbd90=0x1f4;_0x4d17af['status'](_0x1dbd90)[_0x2d19('0x6e')]({'message':_0x2d19('0x70'),'statusCode':0x190});}});};
\ No newline at end of file
index 94df2e0..81a46b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95a6=['request-promise','path','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','api','moment','bluebird'];(function(_0x499c61,_0x3a0666){var _0x2eaaae=function(_0x314857){while(--_0x314857){_0x499c61['push'](_0x499c61['shift']());}};_0x2eaaae(++_0x3a0666);}(_0x95a6,0xe5));var _0x695a=function(_0x307d4c,_0x25fbcb){_0x307d4c=_0x307d4c-0x0;var _0x3d872f=_0x95a6[_0x307d4c];return _0x3d872f;};'use strict';var _=require(_0x695a('0x0'));var util=require(_0x695a('0x1'));var logger=require('../../config/logger')(_0x695a('0x2'));var moment=require(_0x695a('0x3'));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'));var integrations=require(_0x695a('0x8'));module[_0x695a('0x9')]=function(_0xe45b1d,_0x4160bc){return _0xe45b1d[_0x695a('0xa')](_0x695a('0xb'),attributes,{'tableName':_0x695a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe426=['bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','int_sugarcrm_accounts','lodash','../../config/logger','api','moment'];(function(_0x3dc534,_0xfd7d8a){var _0x1fde67=function(_0x1fe78b){while(--_0x1fe78b){_0x3dc534['push'](_0x3dc534['shift']());}};_0x1fde67(++_0xfd7d8a);}(_0xe426,0xf8));var _0x6e42=function(_0x2b79a8,_0xade1e4){_0x2b79a8=_0x2b79a8-0x0;var _0x1ad925=_0xe426[_0x2b79a8];return _0x1ad925;};'use strict';var _=require(_0x6e42('0x0'));var util=require('util');var logger=require(_0x6e42('0x1'))(_0x6e42('0x2'));var moment=require(_0x6e42('0x3'));var BPromise=require(_0x6e42('0x4'));var rp=require(_0x6e42('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6e42('0x6'));var config=require(_0x6e42('0x7'));var attributes=require(_0x6e42('0x8'));var integrations=require(_0x6e42('0x9'));module['exports']=function(_0x7807d8,_0xfaf712){return _0x7807d8[_0x6e42('0xa')]('SugarcrmAccount',attributes,{'tableName':_0x6e42('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index df30e6a..79fd8ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0039=['raw','where','attributes','limit','map','model','include','debug','ShowSugarcrmAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','request','then','info','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SugarcrmAccount,\x20%s,\x20%s','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options'];(function(_0x3a23f1,_0x401962){var _0x484219=function(_0x2d862b){while(--_0x2d862b){_0x3a23f1['push'](_0x3a23f1['shift']());}};_0x484219(++_0x401962);}(_0x0039,0x15d));var _0x9003=function(_0x6e1a41,_0x18b6d3){_0x6e1a41=_0x6e1a41-0x0;var _0x2114f9=_0x0039[_0x6e1a41];return _0x2114f9;};'use strict';var _=require(_0x9003('0x0'));var util=require(_0x9003('0x1'));var moment=require(_0x9003('0x2'));var BPromise=require(_0x9003('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9003('0x4'));var db=require(_0x9003('0x5'))['db'];var utils=require(_0x9003('0x6'));var logger=require('../../config/logger')(_0x9003('0x7'));var config=require(_0x9003('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x47600a,_0x2dc0d6,_0x36d178){return new BPromise(function(_0x41245a,_0x1f6245){return client[_0x9003('0x9')](_0x47600a,_0x36d178)[_0x9003('0xa')](function(_0x5aae03){logger[_0x9003('0xb')]('SugarcrmAccount,\x20%s,\x20%s',_0x2dc0d6,_0x9003('0xc'));logger['debug'](_0x9003('0xd'),_0x2dc0d6,_0x9003('0xc'),JSON[_0x9003('0xe')](_0x5aae03));if(_0x5aae03[_0x9003('0xf')]){if(_0x5aae03[_0x9003('0xf')][_0x9003('0x10')]===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x2dc0d6,_0x5aae03['error'][_0x9003('0x11')]);return _0x1f6245(_0x5aae03[_0x9003('0xf')]['message']);}logger['error'](_0x9003('0x12'),_0x2dc0d6,_0x5aae03[_0x9003('0xf')]['message']);return _0x41245a(_0x5aae03['error'][_0x9003('0x11')]);}else{logger[_0x9003('0xb')](_0x9003('0x12'),_0x2dc0d6,_0x9003('0xc'));_0x41245a(_0x5aae03[_0x9003('0x13')][_0x9003('0x11')]);}})[_0x9003('0x14')](function(_0x566325){logger[_0x9003('0xf')](_0x9003('0x12'),_0x2dc0d6,_0x566325);_0x1f6245(_0x566325);});});}exports[_0x9003('0x15')]=function(_0x938139){var _0x5399b0=this;return new Promise(function(_0x2ebe1c,_0x2fac88){return db[_0x9003('0x16')][_0x9003('0x17')]({'raw':_0x938139['options']?_0x938139[_0x9003('0x18')][_0x9003('0x19')]===undefined?!![]:![]:!![],'where':_0x938139['options']?_0x938139[_0x9003('0x18')][_0x9003('0x1a')]||null:null,'attributes':_0x938139['options']?_0x938139[_0x9003('0x18')][_0x9003('0x1b')]||null:null,'limit':_0x938139[_0x9003('0x18')]?_0x938139[_0x9003('0x18')][_0x9003('0x1c')]||null:null,'include':_0x938139[_0x9003('0x18')]?_0x938139[_0x9003('0x18')]['include']?_[_0x9003('0x1d')](_0x938139['options']['include'],function(_0x434cd7){return{'model':db[_0x434cd7[_0x9003('0x1e')]],'as':_0x434cd7['as'],'attributes':_0x434cd7[_0x9003('0x1b')],'include':_0x434cd7[_0x9003('0x1f')]?_[_0x9003('0x1d')](_0x434cd7[_0x9003('0x1f')],function(_0x40aa81){return{'model':db[_0x40aa81[_0x9003('0x1e')]],'as':_0x40aa81['as'],'attributes':_0x40aa81[_0x9003('0x1b')],'include':_0x40aa81[_0x9003('0x1f')]?_[_0x9003('0x1d')](_0x40aa81['include'],function(_0x3da81c){return{'model':db[_0x3da81c[_0x9003('0x1e')]],'as':_0x3da81c['as'],'attributes':_0x3da81c[_0x9003('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9003('0xa')](function(_0x385c03){logger[_0x9003('0xb')](_0x9003('0x15'),_0x938139);logger[_0x9003('0x20')](_0x9003('0x15'),_0x938139,JSON[_0x9003('0xe')](_0x385c03));_0x2ebe1c(_0x385c03);})['catch'](function(_0x2ab72e){logger[_0x9003('0xf')](_0x9003('0x15'),_0x2ab72e[_0x9003('0x11')],_0x938139);_0x2fac88(_0x5399b0[_0x9003('0xf')](0x1f4,_0x2ab72e[_0x9003('0x11')]));});});};exports[_0x9003('0x21')]=function(_0x3ecd89){var _0x4ffe5c=this;return new Promise(function(_0x5489ce,_0x59e3b8){return db['SugarcrmAccount']['find']({'raw':_0x3ecd89[_0x9003('0x18')]?_0x3ecd89['options'][_0x9003('0x19')]===undefined?!![]:![]:!![],'where':_0x3ecd89[_0x9003('0x18')]?_0x3ecd89[_0x9003('0x18')][_0x9003('0x1a')]||null:null,'attributes':_0x3ecd89[_0x9003('0x18')]?_0x3ecd89['options'][_0x9003('0x1b')]||null:null,'include':_0x3ecd89[_0x9003('0x18')]?_0x3ecd89['options']['include']?_[_0x9003('0x1d')](_0x3ecd89[_0x9003('0x18')][_0x9003('0x1f')],function(_0x1e07aa){return{'model':db[_0x1e07aa[_0x9003('0x1e')]],'as':_0x1e07aa['as'],'attributes':_0x1e07aa[_0x9003('0x1b')],'include':_0x1e07aa[_0x9003('0x1f')]?_[_0x9003('0x1d')](_0x1e07aa[_0x9003('0x1f')],function(_0x40c585){return{'model':db[_0x40c585['model']],'as':_0x40c585['as'],'attributes':_0x40c585[_0x9003('0x1b')],'include':_0x40c585[_0x9003('0x1f')]?_['map'](_0x40c585[_0x9003('0x1f')],function(_0x3a19ff){return{'model':db[_0x3a19ff[_0x9003('0x1e')]],'as':_0x3a19ff['as'],'attributes':_0x3a19ff[_0x9003('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b69da){logger['info'](_0x9003('0x21'),_0x3ecd89);logger[_0x9003('0x20')](_0x9003('0x21'),_0x3ecd89,JSON[_0x9003('0xe')](_0x4b69da));_0x5489ce(_0x4b69da);})['catch'](function(_0x4e3c4f){logger[_0x9003('0xf')](_0x9003('0x21'),_0x4e3c4f[_0x9003('0x11')],_0x3ecd89);_0x59e3b8(_0x4ffe5c[_0x9003('0xf')](0x1f4,_0x4e3c4f[_0x9003('0x11')]));});});};
\ No newline at end of file
+var _0xa2cd=['catch','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetSugarcrmAccount','ShowSugarcrmAccount','find','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x1e1fd5,_0x1173d8){var _0x397946=function(_0x5c2e42){while(--_0x5c2e42){_0x1e1fd5['push'](_0x1e1fd5['shift']());}};_0x397946(++_0x1173d8);}(_0xa2cd,0x96));var _0xda2c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa2cd[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xda2c('0x0'));var moment=require(_0xda2c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda2c('0x2'));var db=require(_0xda2c('0x3'))['db'];var utils=require(_0xda2c('0x4'));var logger=require(_0xda2c('0x5'))('rpc');var config=require(_0xda2c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xda2c('0x7')][_0xda2c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x36c7d0,_0x2df207,_0x423004){return new BPromise(function(_0x431662,_0x193228){return client[_0xda2c('0x9')](_0x36c7d0,_0x423004)[_0xda2c('0xa')](function(_0x4c44e5){logger['info'](_0xda2c('0xb'),_0x2df207,_0xda2c('0xc'));logger[_0xda2c('0xd')](_0xda2c('0xe'),_0x2df207,_0xda2c('0xc'),JSON[_0xda2c('0xf')](_0x4c44e5));if(_0x4c44e5['error']){if(_0x4c44e5[_0xda2c('0x10')][_0xda2c('0x11')]===0x1f4){logger[_0xda2c('0x10')](_0xda2c('0xb'),_0x2df207,_0x4c44e5[_0xda2c('0x10')]['message']);return _0x193228(_0x4c44e5['error'][_0xda2c('0x12')]);}logger[_0xda2c('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x2df207,_0x4c44e5[_0xda2c('0x10')]['message']);return _0x431662(_0x4c44e5[_0xda2c('0x10')][_0xda2c('0x12')]);}else{logger[_0xda2c('0x13')](_0xda2c('0xb'),_0x2df207,'request\x20sent');_0x431662(_0x4c44e5['result']['message']);}})[_0xda2c('0x14')](function(_0x206c42){logger[_0xda2c('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x2df207,_0x206c42);_0x193228(_0x206c42);});});}exports['GetSugarcrmAccount']=function(_0xde3565){var _0x4fa27b=this;return new Promise(function(_0x533a62,_0x162063){return db[_0xda2c('0x15')][_0xda2c('0x16')]({'raw':_0xde3565[_0xda2c('0x17')]?_0xde3565['options'][_0xda2c('0x18')]===undefined?!![]:![]:!![],'where':_0xde3565[_0xda2c('0x17')]?_0xde3565[_0xda2c('0x17')][_0xda2c('0x19')]||null:null,'attributes':_0xde3565['options']?_0xde3565['options'][_0xda2c('0x1a')]||null:null,'limit':_0xde3565[_0xda2c('0x17')]?_0xde3565[_0xda2c('0x17')][_0xda2c('0x1b')]||null:null,'include':_0xde3565[_0xda2c('0x17')]?_0xde3565[_0xda2c('0x17')][_0xda2c('0x1c')]?_[_0xda2c('0x1d')](_0xde3565[_0xda2c('0x17')][_0xda2c('0x1c')],function(_0xb06ab4){return{'model':db[_0xb06ab4[_0xda2c('0x1e')]],'as':_0xb06ab4['as'],'attributes':_0xb06ab4[_0xda2c('0x1a')],'include':_0xb06ab4['include']?_[_0xda2c('0x1d')](_0xb06ab4[_0xda2c('0x1c')],function(_0x368c57){return{'model':db[_0x368c57[_0xda2c('0x1e')]],'as':_0x368c57['as'],'attributes':_0x368c57['attributes'],'include':_0x368c57[_0xda2c('0x1c')]?_['map'](_0x368c57[_0xda2c('0x1c')],function(_0x3c47b9){return{'model':db[_0x3c47b9[_0xda2c('0x1e')]],'as':_0x3c47b9['as'],'attributes':_0x3c47b9[_0xda2c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xda2c('0xa')](function(_0x29168c){logger['info'](_0xda2c('0x1f'),_0xde3565);logger[_0xda2c('0xd')](_0xda2c('0x1f'),_0xde3565,JSON['stringify'](_0x29168c));_0x533a62(_0x29168c);})['catch'](function(_0x897fd5){logger[_0xda2c('0x10')](_0xda2c('0x1f'),_0x897fd5[_0xda2c('0x12')],_0xde3565);_0x162063(_0x4fa27b[_0xda2c('0x10')](0x1f4,_0x897fd5[_0xda2c('0x12')]));});});};exports[_0xda2c('0x20')]=function(_0x389b43){var _0x38ff1f=this;return new Promise(function(_0x264c71,_0x408595){return db[_0xda2c('0x15')][_0xda2c('0x21')]({'raw':_0x389b43[_0xda2c('0x17')]?_0x389b43[_0xda2c('0x17')][_0xda2c('0x18')]===undefined?!![]:![]:!![],'where':_0x389b43[_0xda2c('0x17')]?_0x389b43['options'][_0xda2c('0x19')]||null:null,'attributes':_0x389b43[_0xda2c('0x17')]?_0x389b43[_0xda2c('0x17')]['attributes']||null:null,'include':_0x389b43[_0xda2c('0x17')]?_0x389b43['options'][_0xda2c('0x1c')]?_['map'](_0x389b43[_0xda2c('0x17')]['include'],function(_0x5508ad){return{'model':db[_0x5508ad[_0xda2c('0x1e')]],'as':_0x5508ad['as'],'attributes':_0x5508ad[_0xda2c('0x1a')],'include':_0x5508ad[_0xda2c('0x1c')]?_[_0xda2c('0x1d')](_0x5508ad['include'],function(_0x1efe0d){return{'model':db[_0x1efe0d[_0xda2c('0x1e')]],'as':_0x1efe0d['as'],'attributes':_0x1efe0d['attributes'],'include':_0x1efe0d[_0xda2c('0x1c')]?_[_0xda2c('0x1d')](_0x1efe0d['include'],function(_0x371b3b){return{'model':db[_0x371b3b[_0xda2c('0x1e')]],'as':_0x371b3b['as'],'attributes':_0x371b3b[_0xda2c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xda2c('0xa')](function(_0x1a3ab0){logger[_0xda2c('0x13')]('ShowSugarcrmAccount',_0x389b43);logger[_0xda2c('0xd')](_0xda2c('0x20'),_0x389b43,JSON['stringify'](_0x1a3ab0));_0x264c71(_0x1a3ab0);})[_0xda2c('0x14')](function(_0x2f886e){logger['error'](_0xda2c('0x20'),_0x2f886e[_0xda2c('0x12')],_0x389b43);_0x408595(_0x38ff1f['error'](0x1f4,_0x2f886e[_0xda2c('0x12')]));});});};
\ No newline at end of file
index f32f07d..7fb5de6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f4e=['create','update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/descriptions'];(function(_0x15b962,_0x4bd809){var _0xe4676b=function(_0x3b7e44){while(--_0x3b7e44){_0x15b962['push'](_0x15b962['shift']());}};_0xe4676b(++_0x4bd809);}(_0x0f4e,0x194));var _0xe0f4=function(_0x19d24c,_0x62bc50){_0x19d24c=_0x19d24c-0x0;var _0x2fae8d=_0x0f4e[_0x19d24c];return _0x2fae8d;};'use strict';var multer=require('multer');var util=require(_0xe0f4('0x0'));var path=require('path');var timeout=require(_0xe0f4('0x1'));var express=require(_0xe0f4('0x2'));var router=express[_0xe0f4('0x3')]();var fs_extra=require(_0xe0f4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe0f4('0x5'));var config=require(_0xe0f4('0x6'));var controller=require(_0xe0f4('0x7'));router[_0xe0f4('0x8')]('/',auth['isAuthenticated'](),controller[_0xe0f4('0x9')]);router['get'](_0xe0f4('0xa'),auth[_0xe0f4('0xb')](),controller[_0xe0f4('0xc')]);router[_0xe0f4('0x8')](_0xe0f4('0xd'),auth[_0xe0f4('0xb')](),controller[_0xe0f4('0xe')]);router[_0xe0f4('0x8')]('/:id/subjects',auth[_0xe0f4('0xb')](),controller['getSubjects']);router['get'](_0xe0f4('0xf'),auth[_0xe0f4('0xb')](),controller['getDescriptions']);router['post']('/',auth[_0xe0f4('0xb')](),controller[_0xe0f4('0x10')]);router['put'](_0xe0f4('0xa'),auth[_0xe0f4('0xb')](),controller[_0xe0f4('0x11')]);router['delete'](_0xe0f4('0xa'),auth['isAuthenticated'](),controller[_0xe0f4('0x12')]);module[_0xe0f4('0x13')]=router;
\ No newline at end of file
+var _0xbc95=['./intSugarcrmConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','post','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x1e0d9a,_0x214450){var _0x36cbe0=function(_0x4003b4){while(--_0x4003b4){_0x1e0d9a['push'](_0x1e0d9a['shift']());}};_0x36cbe0(++_0x214450);}(_0xbc95,0x77));var _0x5bc9=function(_0x5a5cfb,_0x37ed01){_0x5a5cfb=_0x5a5cfb-0x0;var _0x334936=_0xbc95[_0x5a5cfb];return _0x334936;};'use strict';var multer=require('multer');var util=require(_0x5bc9('0x0'));var path=require(_0x5bc9('0x1'));var timeout=require(_0x5bc9('0x2'));var express=require(_0x5bc9('0x3'));var router=express['Router']();var fs_extra=require(_0x5bc9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5bc9('0x5'));var config=require(_0x5bc9('0x6'));var controller=require(_0x5bc9('0x7'));router[_0x5bc9('0x8')]('/',auth[_0x5bc9('0x9')](),controller['index']);router['get'](_0x5bc9('0xa'),auth['isAuthenticated'](),controller[_0x5bc9('0xb')]);router[_0x5bc9('0x8')](_0x5bc9('0xc'),auth[_0x5bc9('0x9')](),controller['getFields']);router['get'](_0x5bc9('0xd'),auth[_0x5bc9('0x9')](),controller[_0x5bc9('0xe')]);router['get']('/:id/descriptions',auth[_0x5bc9('0x9')](),controller[_0x5bc9('0xf')]);router[_0x5bc9('0x10')]('/',auth[_0x5bc9('0x9')](),controller['create']);router['put']('/:id',auth[_0x5bc9('0x9')](),controller[_0x5bc9('0x11')]);router[_0x5bc9('0x12')](_0x5bc9('0xa'),auth[_0x5bc9('0x9')](),controller[_0x5bc9('0x13')]);module[_0x5bc9('0x14')]=router;
\ No newline at end of file
index b994f1c..aa02cb7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8951=['sequelize'];(function(_0x59d938,_0x39d421){var _0x46aa4c=function(_0x377a04){while(--_0x377a04){_0x59d938['push'](_0x59d938['shift']());}};_0x46aa4c(++_0x39d421);}(_0x8951,0xb3));var _0x1895=function(_0x1dd4d2,_0x369502){_0x1dd4d2=_0x1dd4d2-0x0;var _0x43b1b1=_0x8951[_0x1dd4d2];return _0x43b1b1;};'use strict';var Sequelize=require(_0x1895('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x7383=['sequelize','STRING'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x7383,0x104));var _0x3738=function(_0x2ed416,_0x484a43){_0x2ed416=_0x2ed416-0x0;var _0xd3778a=_0x7383[_0x2ed416];return _0xd3778a;};'use strict';var Sequelize=require(_0x3738('0x0'));module['exports']={'name':{'type':Sequelize[_0x3738('0x1')]},'description':{'type':Sequelize[_0x3738('0x1')]}};
\ No newline at end of file
index 3cf83c1..af33ee9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb554=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','fields','create','body','find','catch','getFields','findOne','SugarcrmField','length','getSubjects','getDescriptions','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','then','destroy','error','name','index','map','SugarcrmConfiguration','rawAttributes','type','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','limit'];(function(_0x472524,_0x5b149c){var _0x362ff6=function(_0xf61431){while(--_0xf61431){_0x472524['push'](_0x472524['shift']());}};_0x362ff6(++_0x5b149c);}(_0xb554,0x14c));var _0x4b55=function(_0x4c47f4,_0x1d3141){_0x4c47f4=_0x4c47f4-0x0;var _0x9b41e6=_0xb554[_0x4c47f4];return _0x9b41e6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4b55('0x0'));var zipdir=require(_0x4b55('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4b55('0x2'));var moment=require(_0x4b55('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4b55('0x4'));var path=require(_0x4b55('0x5'));var sox=require('sox');var csv=require(_0x4b55('0x6'));var ejs=require(_0x4b55('0x7'));var fs=require('fs');var fs_extra=require(_0x4b55('0x8'));var _=require(_0x4b55('0x9'));var squel=require(_0x4b55('0xa'));var crypto=require(_0x4b55('0xb'));var jsforce=require(_0x4b55('0xc'));var deskjs=require(_0x4b55('0xd'));var toCsv=require(_0x4b55('0x6'));var querystring=require(_0x4b55('0xe'));var Papa=require(_0x4b55('0xf'));var Redis=require(_0x4b55('0x10'));var authService=require(_0x4b55('0x11'));var qs=require(_0x4b55('0x12'));var as=require(_0x4b55('0x13'));var hardwareService=require(_0x4b55('0x14'));var logger=require(_0x4b55('0x15'))(_0x4b55('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4b55('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37b690,_0x2ee079){_0x2ee079=_0x2ee079||0xcc;return function(_0xcd91a8){if(_0xcd91a8){return _0x37b690[_0x4b55('0x18')](_0x2ee079);}return _0x37b690[_0x4b55('0x19')](_0x2ee079)[_0x4b55('0x1a')]();};}function respondWithResult(_0x4dbdf5,_0x8b787){_0x8b787=_0x8b787||0xc8;return function(_0x51cc7f){if(_0x51cc7f){return _0x4dbdf5['status'](_0x8b787)[_0x4b55('0x1b')](_0x51cc7f);}};}function respondWithFilteredResult(_0x3fe142,_0x4ccafb){return function(_0x2a1a09){if(_0x2a1a09){var _0x2ee040=typeof _0x4ccafb['offset']===_0x4b55('0x1c')&&typeof _0x4ccafb['limit']==='undefined';var _0x58e788=_0x2a1a09[_0x4b55('0x1d')];var _0x2eb910=_0x2ee040?0x0:_0x4ccafb[_0x4b55('0x1e')];var _0x30eb9d=_0x2ee040?_0x2a1a09[_0x4b55('0x1d')]:_0x4ccafb['offset']+_0x4ccafb['limit'];var _0x37df40;if(_0x30eb9d>=_0x58e788){_0x30eb9d=_0x58e788;_0x37df40=0xc8;}else{_0x37df40=0xce;}_0x3fe142[_0x4b55('0x19')](_0x37df40);return _0x3fe142[_0x4b55('0x1f')](_0x4b55('0x20'),_0x2eb910+'-'+_0x30eb9d+'/'+_0x58e788)[_0x4b55('0x1b')](_0x2a1a09);}return null;};}function patchUpdates(_0x4bca6d){return function(_0x4b448a){try{jsonpatch[_0x4b55('0x21')](_0x4b448a,_0x4bca6d,!![]);}catch(_0x1a7919){return BPromise[_0x4b55('0x22')](_0x1a7919);}return _0x4b448a['save']();};}function saveUpdates(_0x29bec4,_0x54b4e9){return function(_0x14d59e){if(_0x14d59e){return _0x14d59e['update'](_0x29bec4)[_0x4b55('0x23')](function(_0x1d7368){return _0x1d7368;});}return null;};}function removeEntity(_0xa2186,_0x527045){return function(_0x45e1cd){if(_0x45e1cd){return _0x45e1cd[_0x4b55('0x24')]()[_0x4b55('0x23')](function(){_0xa2186['status'](0xcc)[_0x4b55('0x1a')]();});}};}function handleEntityNotFound(_0x241d4a,_0x43b4fb){return function(_0x411ffc){if(!_0x411ffc){_0x241d4a[_0x4b55('0x18')](0x194);}return _0x411ffc;};}function handleError(_0xf93bec,_0x3adf20){_0x3adf20=_0x3adf20||0x1f4;return function(_0x5251d0){logger[_0x4b55('0x25')](_0x5251d0['stack']);if(_0x5251d0[_0x4b55('0x26')]){delete _0x5251d0[_0x4b55('0x26')];}_0xf93bec[_0x4b55('0x19')](_0x3adf20)['send'](_0x5251d0);};}exports[_0x4b55('0x27')]=function(_0x2153a8,_0x1148c2){var _0x23a882={},_0x1c2997={},_0x4cfb4f={'count':0x0,'rows':[]};var _0x640326=_[_0x4b55('0x28')](db[_0x4b55('0x29')][_0x4b55('0x2a')],function(_0xc97c00){return{'name':_0xc97c00['fieldName'],'type':_0xc97c00[_0x4b55('0x2b')]['key']};});_0x1c2997[_0x4b55('0x2c')]=_[_0x4b55('0x28')](_0x640326,_0x4b55('0x26'));_0x1c2997['query']=_[_0x4b55('0x2d')](_0x2153a8[_0x4b55('0x2e')]);_0x1c2997[_0x4b55('0x2f')]=_[_0x4b55('0x30')](_0x1c2997['model'],_0x1c2997[_0x4b55('0x2e')]);_0x23a882[_0x4b55('0x31')]=_[_0x4b55('0x30')](_0x1c2997[_0x4b55('0x2c')],qs['fields'](_0x2153a8[_0x4b55('0x2e')]['fields']));_0x23a882[_0x4b55('0x31')]=_0x23a882['attributes']['length']?_0x23a882[_0x4b55('0x31')]:_0x1c2997[_0x4b55('0x2c')];if(!_0x2153a8[_0x4b55('0x2e')][_0x4b55('0x32')](_0x4b55('0x33'))){_0x23a882[_0x4b55('0x34')]=qs[_0x4b55('0x34')](_0x2153a8[_0x4b55('0x2e')]['limit']);_0x23a882[_0x4b55('0x1e')]=qs['offset'](_0x2153a8[_0x4b55('0x2e')][_0x4b55('0x1e')]);}_0x23a882[_0x4b55('0x35')]=qs[_0x4b55('0x36')](_0x2153a8['query'][_0x4b55('0x36')]);_0x23a882[_0x4b55('0x37')]=qs[_0x4b55('0x2f')](_[_0x4b55('0x38')](_0x2153a8['query'],_0x1c2997[_0x4b55('0x2f')]),_0x640326);if(_0x2153a8[_0x4b55('0x2e')][_0x4b55('0x39')]){_0x23a882[_0x4b55('0x37')]=_[_0x4b55('0x3a')](_0x23a882[_0x4b55('0x37')],{'$or':_[_0x4b55('0x28')](_0x640326,function(_0x3e59e1){if(_0x3e59e1['type']!==_0x4b55('0x3b')){var _0x5a6283={};_0x5a6283[_0x3e59e1[_0x4b55('0x26')]]={'$like':'%'+_0x2153a8[_0x4b55('0x2e')]['filter']+'%'};return _0x5a6283;}})});}_0x23a882=_[_0x4b55('0x3a')]({},_0x23a882,_0x2153a8[_0x4b55('0x3c')]);var _0x4cf4be={'where':_0x23a882['where']};return db[_0x4b55('0x29')][_0x4b55('0x1d')](_0x4cf4be)[_0x4b55('0x23')](function(_0xe9373f){_0x4cfb4f[_0x4b55('0x1d')]=_0xe9373f;if(_0x2153a8['query'][_0x4b55('0x3d')]){_0x23a882[_0x4b55('0x3e')]=[{'all':!![]}];}return db[_0x4b55('0x29')]['findAll'](_0x23a882);})['then'](function(_0x12417f){_0x4cfb4f[_0x4b55('0x3f')]=_0x12417f;return _0x4cfb4f;})[_0x4b55('0x23')](respondWithFilteredResult(_0x1148c2,_0x23a882))['catch'](handleError(_0x1148c2,null));};exports[_0x4b55('0x40')]=function(_0x5cc48e,_0x3b3e87){var _0x18e43b={'raw':![],'where':{'id':_0x5cc48e[_0x4b55('0x41')]['id']}},_0x456bcd={};_0x456bcd[_0x4b55('0x2c')]=_[_0x4b55('0x2d')](db[_0x4b55('0x29')][_0x4b55('0x2a')]);_0x456bcd[_0x4b55('0x2e')]=_[_0x4b55('0x2d')](_0x5cc48e[_0x4b55('0x2e')]);_0x456bcd[_0x4b55('0x2f')]=_[_0x4b55('0x30')](_0x456bcd[_0x4b55('0x2c')],_0x456bcd['query']);_0x18e43b['attributes']=_[_0x4b55('0x30')](_0x456bcd[_0x4b55('0x2c')],qs[_0x4b55('0x42')](_0x5cc48e[_0x4b55('0x2e')][_0x4b55('0x42')]));_0x18e43b['attributes']=_0x18e43b[_0x4b55('0x31')]['length']?_0x18e43b['attributes']:_0x456bcd[_0x4b55('0x2c')];if(_0x5cc48e['query'][_0x4b55('0x3d')]){_0x18e43b['include']=[{'all':!![]}];}_0x18e43b=_[_0x4b55('0x3a')]({},_0x18e43b,_0x5cc48e[_0x4b55('0x3c')]);return db[_0x4b55('0x29')]['find'](_0x18e43b)[_0x4b55('0x23')](handleEntityNotFound(_0x3b3e87,null))[_0x4b55('0x23')](respondWithResult(_0x3b3e87,null))['catch'](handleError(_0x3b3e87,null));};exports[_0x4b55('0x43')]=function(_0x4b7bcb,_0x29a7a7){return db['SugarcrmConfiguration']['create'](_0x4b7bcb['body'],{})[_0x4b55('0x23')](respondWithResult(_0x29a7a7,0xc9))['catch'](handleError(_0x29a7a7,null));};exports['update']=function(_0x5f38e1,_0xe46d38){if(_0x5f38e1[_0x4b55('0x44')]['id']){delete _0x5f38e1[_0x4b55('0x44')]['id'];}return db['SugarcrmConfiguration'][_0x4b55('0x45')]({'where':{'id':_0x5f38e1[_0x4b55('0x41')]['id']}})[_0x4b55('0x23')](handleEntityNotFound(_0xe46d38,null))['then'](saveUpdates(_0x5f38e1[_0x4b55('0x44')],null))[_0x4b55('0x23')](respondWithResult(_0xe46d38,null))[_0x4b55('0x46')](handleError(_0xe46d38,null));};exports[_0x4b55('0x24')]=function(_0x207a1b,_0x127eed){return db[_0x4b55('0x29')][_0x4b55('0x45')]({'where':{'id':_0x207a1b[_0x4b55('0x41')]['id']}})['then'](handleEntityNotFound(_0x127eed,null))[_0x4b55('0x23')](removeEntity(_0x127eed,null))[_0x4b55('0x46')](handleError(_0x127eed,null));};exports[_0x4b55('0x47')]=function(_0x2a0808,_0x3e1c5d,_0xacbd55){var _0x2bdaa2={};var _0x2c0ed8={};var _0x258c2d;var _0xca1ea0;return db['SugarcrmConfiguration'][_0x4b55('0x48')]({'where':{'id':_0x2a0808[_0x4b55('0x41')]['id']}})['then'](handleEntityNotFound(_0x3e1c5d,null))[_0x4b55('0x23')](function(_0x230907){if(_0x230907){_0x258c2d=_0x230907;_0x2c0ed8[_0x4b55('0x2c')]=_[_0x4b55('0x2d')](db[_0x4b55('0x49')][_0x4b55('0x2a')]);_0x2c0ed8[_0x4b55('0x2e')]=_[_0x4b55('0x2d')](_0x2a0808['query']);_0x2c0ed8['filters']=_[_0x4b55('0x30')](_0x2c0ed8[_0x4b55('0x2c')],_0x2c0ed8[_0x4b55('0x2e')]);_0x2bdaa2['attributes']=_['intersection'](_0x2c0ed8[_0x4b55('0x2c')],qs[_0x4b55('0x42')](_0x2a0808[_0x4b55('0x2e')]['fields']));_0x2bdaa2[_0x4b55('0x31')]=_0x2bdaa2[_0x4b55('0x31')]['length']?_0x2bdaa2[_0x4b55('0x31')]:_0x2c0ed8['model'];_0x2bdaa2[_0x4b55('0x35')]=qs['sort'](_0x2a0808[_0x4b55('0x2e')]['sort']);_0x2bdaa2[_0x4b55('0x37')]=qs[_0x4b55('0x2f')](_[_0x4b55('0x38')](_0x2a0808[_0x4b55('0x2e')],_0x2c0ed8['filters']));if(_0x2a0808['query'][_0x4b55('0x39')]){_0x2bdaa2[_0x4b55('0x37')]=_[_0x4b55('0x3a')](_0x2bdaa2['where'],{'$or':_['map'](_0x2bdaa2['attributes'],function(_0x24d15b){var _0x2a5f71={};_0x2a5f71[_0x24d15b]={'$like':'%'+_0x2a0808[_0x4b55('0x2e')][_0x4b55('0x39')]+'%'};return _0x2a5f71;})});}_0x2bdaa2=_[_0x4b55('0x3a')]({},_0x2bdaa2,_0x2a0808[_0x4b55('0x3c')]);return _0x258c2d[_0x4b55('0x47')](_0x2bdaa2);}})[_0x4b55('0x23')](function(_0x50ce3e){if(_0x50ce3e){_0xca1ea0=_0x50ce3e['length'];if(!_0x2a0808[_0x4b55('0x2e')]['hasOwnProperty']('nolimit')){_0x2bdaa2[_0x4b55('0x34')]=qs[_0x4b55('0x34')](_0x2a0808['query'][_0x4b55('0x34')]);_0x2bdaa2[_0x4b55('0x1e')]=qs[_0x4b55('0x1e')](_0x2a0808[_0x4b55('0x2e')][_0x4b55('0x1e')]);}return _0x258c2d[_0x4b55('0x47')](_0x2bdaa2);}})['then'](function(_0x25a611){if(_0x25a611){return _0x25a611?{'count':_0xca1ea0,'rows':_0x25a611}:null;}})[_0x4b55('0x23')](respondWithResult(_0x3e1c5d,null))[_0x4b55('0x46')](handleError(_0x3e1c5d,null));};exports['getSubjects']=function(_0x32211e,_0xd3025d,_0x560c7a){var _0x4cd693={};var _0x57e67a={};var _0x25ea53;var _0x10a6d9;return db[_0x4b55('0x29')]['findOne']({'where':{'id':_0x32211e[_0x4b55('0x41')]['id']}})[_0x4b55('0x23')](handleEntityNotFound(_0xd3025d,null))[_0x4b55('0x23')](function(_0x96b7f7){if(_0x96b7f7){_0x25ea53=_0x96b7f7;_0x57e67a[_0x4b55('0x2c')]=_[_0x4b55('0x2d')](db[_0x4b55('0x49')][_0x4b55('0x2a')]);_0x57e67a[_0x4b55('0x2e')]=_[_0x4b55('0x2d')](_0x32211e['query']);_0x57e67a['filters']=_[_0x4b55('0x30')](_0x57e67a['model'],_0x57e67a[_0x4b55('0x2e')]);_0x4cd693[_0x4b55('0x31')]=_['intersection'](_0x57e67a[_0x4b55('0x2c')],qs['fields'](_0x32211e['query'][_0x4b55('0x42')]));_0x4cd693[_0x4b55('0x31')]=_0x4cd693[_0x4b55('0x31')][_0x4b55('0x4a')]?_0x4cd693[_0x4b55('0x31')]:_0x57e67a['model'];_0x4cd693['order']=qs['sort'](_0x32211e[_0x4b55('0x2e')][_0x4b55('0x36')]);_0x4cd693[_0x4b55('0x37')]=qs[_0x4b55('0x2f')](_[_0x4b55('0x38')](_0x32211e['query'],_0x57e67a[_0x4b55('0x2f')]));if(_0x32211e[_0x4b55('0x2e')][_0x4b55('0x39')]){_0x4cd693[_0x4b55('0x37')]=_[_0x4b55('0x3a')](_0x4cd693[_0x4b55('0x37')],{'$or':_['map'](_0x4cd693[_0x4b55('0x31')],function(_0x5d68c8){var _0x313f80={};_0x313f80[_0x5d68c8]={'$like':'%'+_0x32211e[_0x4b55('0x2e')]['filter']+'%'};return _0x313f80;})});}_0x4cd693=_[_0x4b55('0x3a')]({},_0x4cd693,_0x32211e[_0x4b55('0x3c')]);return _0x25ea53[_0x4b55('0x4b')](_0x4cd693);}})[_0x4b55('0x23')](function(_0x501c85){if(_0x501c85){_0x10a6d9=_0x501c85['length'];if(!_0x32211e[_0x4b55('0x2e')][_0x4b55('0x32')]('nolimit')){_0x4cd693[_0x4b55('0x34')]=qs['limit'](_0x32211e[_0x4b55('0x2e')]['limit']);_0x4cd693[_0x4b55('0x1e')]=qs[_0x4b55('0x1e')](_0x32211e[_0x4b55('0x2e')][_0x4b55('0x1e')]);}return _0x25ea53[_0x4b55('0x4b')](_0x4cd693);}})[_0x4b55('0x23')](function(_0x185510){if(_0x185510){return _0x185510?{'count':_0x10a6d9,'rows':_0x185510}:null;}})[_0x4b55('0x23')](respondWithResult(_0xd3025d,null))['catch'](handleError(_0xd3025d,null));};exports[_0x4b55('0x4c')]=function(_0x3678fe,_0x54ee1c,_0x304069){var _0x152be4={};var _0x27bc63={};var _0x1c8f37;var _0x4740ac;return db['SugarcrmConfiguration'][_0x4b55('0x48')]({'where':{'id':_0x3678fe[_0x4b55('0x41')]['id']}})[_0x4b55('0x23')](handleEntityNotFound(_0x54ee1c,null))[_0x4b55('0x23')](function(_0x30f137){if(_0x30f137){_0x1c8f37=_0x30f137;_0x27bc63[_0x4b55('0x2c')]=_[_0x4b55('0x2d')](db[_0x4b55('0x49')][_0x4b55('0x2a')]);_0x27bc63[_0x4b55('0x2e')]=_['keys'](_0x3678fe[_0x4b55('0x2e')]);_0x27bc63[_0x4b55('0x2f')]=_[_0x4b55('0x30')](_0x27bc63[_0x4b55('0x2c')],_0x27bc63[_0x4b55('0x2e')]);_0x152be4[_0x4b55('0x31')]=_[_0x4b55('0x30')](_0x27bc63[_0x4b55('0x2c')],qs[_0x4b55('0x42')](_0x3678fe[_0x4b55('0x2e')]['fields']));_0x152be4['attributes']=_0x152be4['attributes'][_0x4b55('0x4a')]?_0x152be4[_0x4b55('0x31')]:_0x27bc63[_0x4b55('0x2c')];_0x152be4[_0x4b55('0x35')]=qs[_0x4b55('0x36')](_0x3678fe['query'][_0x4b55('0x36')]);_0x152be4[_0x4b55('0x37')]=qs[_0x4b55('0x2f')](_[_0x4b55('0x38')](_0x3678fe[_0x4b55('0x2e')],_0x27bc63[_0x4b55('0x2f')]));if(_0x3678fe[_0x4b55('0x2e')][_0x4b55('0x39')]){_0x152be4['where']=_[_0x4b55('0x3a')](_0x152be4[_0x4b55('0x37')],{'$or':_[_0x4b55('0x28')](_0x152be4[_0x4b55('0x31')],function(_0xe1b131){var _0x43733d={};_0x43733d[_0xe1b131]={'$like':'%'+_0x3678fe[_0x4b55('0x2e')]['filter']+'%'};return _0x43733d;})});}_0x152be4=_['merge']({},_0x152be4,_0x3678fe[_0x4b55('0x3c')]);return _0x1c8f37[_0x4b55('0x4c')](_0x152be4);}})[_0x4b55('0x23')](function(_0x27e067){if(_0x27e067){_0x4740ac=_0x27e067[_0x4b55('0x4a')];if(!_0x3678fe['query'][_0x4b55('0x32')](_0x4b55('0x33'))){_0x152be4[_0x4b55('0x34')]=qs['limit'](_0x3678fe[_0x4b55('0x2e')][_0x4b55('0x34')]);_0x152be4['offset']=qs[_0x4b55('0x1e')](_0x3678fe['query'][_0x4b55('0x1e')]);}return _0x1c8f37['getDescriptions'](_0x152be4);}})[_0x4b55('0x23')](function(_0x371cc9){if(_0x371cc9){return _0x371cc9?{'count':_0x4740ac,'rows':_0x371cc9}:null;}})['then'](respondWithResult(_0x54ee1c,null))['catch'](handleError(_0x54ee1c,null));};
\ No newline at end of file
+var _0xf6ab=['fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','SugarcrmConfiguration','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','findOne','SugarcrmField','pick','getFields','getSubjects','getDescriptions','rimraf','request-promise','moment','mustache','util','path','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','rawAttributes'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0xf6ab,0x109));var _0xbf6a=function(_0x5d2f25,_0x2f58f3){_0x5d2f25=_0x5d2f25-0x0;var _0x5e793d=_0xf6ab[_0x5d2f25];return _0x5e793d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbf6a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbf6a('0x1'));var moment=require(_0xbf6a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xbf6a('0x3'));var util=require(_0xbf6a('0x4'));var path=require(_0xbf6a('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbf6a('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbf6a('0x7'));var crypto=require(_0xbf6a('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xbf6a('0x9'));var toCsv=require(_0xbf6a('0xa'));var querystring=require(_0xbf6a('0xb'));var Papa=require(_0xbf6a('0xc'));var Redis=require('ioredis');var authService=require(_0xbf6a('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbf6a('0xe'));var utils=require(_0xbf6a('0xf'));var config=require(_0xbf6a('0x10'));var licenseUtil=require(_0xbf6a('0x11'));var db=require(_0xbf6a('0x12'))['db'];function respondWithStatusCode(_0x3b2b0c,_0xa24a69){_0xa24a69=_0xa24a69||0xcc;return function(_0xec450a){if(_0xec450a){return _0x3b2b0c[_0xbf6a('0x13')](_0xa24a69);}return _0x3b2b0c[_0xbf6a('0x14')](_0xa24a69)[_0xbf6a('0x15')]();};}function respondWithResult(_0x5b044b,_0x2da5f6){_0x2da5f6=_0x2da5f6||0xc8;return function(_0x29e49a){if(_0x29e49a){return _0x5b044b['status'](_0x2da5f6)[_0xbf6a('0x16')](_0x29e49a);}};}function respondWithFilteredResult(_0x1cf5ff,_0x1f64ae){return function(_0x52156e){if(_0x52156e){var _0x58a380=typeof _0x1f64ae['offset']===_0xbf6a('0x17')&&typeof _0x1f64ae[_0xbf6a('0x18')]===_0xbf6a('0x17');var _0x415b84=_0x52156e[_0xbf6a('0x19')];var _0x48a7d1=_0x58a380?0x0:_0x1f64ae[_0xbf6a('0x1a')];var _0x23aecc=_0x58a380?_0x52156e[_0xbf6a('0x19')]:_0x1f64ae[_0xbf6a('0x1a')]+_0x1f64ae['limit'];var _0x4e3652;if(_0x23aecc>=_0x415b84){_0x23aecc=_0x415b84;_0x4e3652=0xc8;}else{_0x4e3652=0xce;}_0x1cf5ff[_0xbf6a('0x14')](_0x4e3652);return _0x1cf5ff[_0xbf6a('0x1b')](_0xbf6a('0x1c'),_0x48a7d1+'-'+_0x23aecc+'/'+_0x415b84)[_0xbf6a('0x16')](_0x52156e);}return null;};}function patchUpdates(_0x1cba08){return function(_0x504a79){try{jsonpatch[_0xbf6a('0x1d')](_0x504a79,_0x1cba08,!![]);}catch(_0x2aabc6){return BPromise[_0xbf6a('0x1e')](_0x2aabc6);}return _0x504a79[_0xbf6a('0x1f')]();};}function saveUpdates(_0x52417c,_0x141ec5){return function(_0x5efed5){if(_0x5efed5){return _0x5efed5['update'](_0x52417c)[_0xbf6a('0x20')](function(_0x353a3d){return _0x353a3d;});}return null;};}function removeEntity(_0x31dab1,_0x2eb5e6){return function(_0x4c06f3){if(_0x4c06f3){return _0x4c06f3[_0xbf6a('0x21')]()[_0xbf6a('0x20')](function(){_0x31dab1[_0xbf6a('0x14')](0xcc)[_0xbf6a('0x15')]();});}};}function handleEntityNotFound(_0x3d081e,_0x30b0e1){return function(_0x2b4d1c){if(!_0x2b4d1c){_0x3d081e[_0xbf6a('0x13')](0x194);}return _0x2b4d1c;};}function handleError(_0x4ab689,_0x442e01){_0x442e01=_0x442e01||0x1f4;return function(_0x46d9f0){logger[_0xbf6a('0x22')](_0x46d9f0[_0xbf6a('0x23')]);if(_0x46d9f0[_0xbf6a('0x24')]){delete _0x46d9f0[_0xbf6a('0x24')];}_0x4ab689[_0xbf6a('0x14')](_0x442e01)['send'](_0x46d9f0);};}exports[_0xbf6a('0x25')]=function(_0x3d9b67,_0xfeb944){var _0x396882={},_0x417758={},_0x1d11b9={'count':0x0,'rows':[]};var _0x53e061=_['map'](db['SugarcrmConfiguration'][_0xbf6a('0x26')],function(_0x2d2089){return{'name':_0x2d2089[_0xbf6a('0x27')],'type':_0x2d2089[_0xbf6a('0x28')]['key']};});_0x417758[_0xbf6a('0x29')]=_['map'](_0x53e061,'name');_0x417758[_0xbf6a('0x2a')]=_[_0xbf6a('0x2b')](_0x3d9b67[_0xbf6a('0x2a')]);_0x417758[_0xbf6a('0x2c')]=_[_0xbf6a('0x2d')](_0x417758[_0xbf6a('0x29')],_0x417758[_0xbf6a('0x2a')]);_0x396882['attributes']=_[_0xbf6a('0x2d')](_0x417758[_0xbf6a('0x29')],qs[_0xbf6a('0x2e')](_0x3d9b67[_0xbf6a('0x2a')][_0xbf6a('0x2e')]));_0x396882['attributes']=_0x396882[_0xbf6a('0x2f')][_0xbf6a('0x30')]?_0x396882[_0xbf6a('0x2f')]:_0x417758[_0xbf6a('0x29')];if(!_0x3d9b67[_0xbf6a('0x2a')][_0xbf6a('0x31')](_0xbf6a('0x32'))){_0x396882['limit']=qs[_0xbf6a('0x18')](_0x3d9b67[_0xbf6a('0x2a')][_0xbf6a('0x18')]);_0x396882[_0xbf6a('0x1a')]=qs[_0xbf6a('0x1a')](_0x3d9b67[_0xbf6a('0x2a')][_0xbf6a('0x1a')]);}_0x396882[_0xbf6a('0x33')]=qs[_0xbf6a('0x34')](_0x3d9b67[_0xbf6a('0x2a')]['sort']);_0x396882[_0xbf6a('0x35')]=qs['filters'](_['pick'](_0x3d9b67[_0xbf6a('0x2a')],_0x417758[_0xbf6a('0x2c')]),_0x53e061);if(_0x3d9b67[_0xbf6a('0x2a')][_0xbf6a('0x36')]){_0x396882[_0xbf6a('0x35')]=_[_0xbf6a('0x37')](_0x396882[_0xbf6a('0x35')],{'$or':_[_0xbf6a('0x38')](_0x53e061,function(_0x5e7b56){if(_0x5e7b56[_0xbf6a('0x28')]!==_0xbf6a('0x39')){var _0x5f04b4={};_0x5f04b4[_0x5e7b56[_0xbf6a('0x24')]]={'$like':'%'+_0x3d9b67['query'][_0xbf6a('0x36')]+'%'};return _0x5f04b4;}})});}_0x396882=_['merge']({},_0x396882,_0x3d9b67['options']);var _0x32cfb6={'where':_0x396882[_0xbf6a('0x35')]};return db[_0xbf6a('0x3a')]['count'](_0x32cfb6)['then'](function(_0x4c9036){_0x1d11b9['count']=_0x4c9036;if(_0x3d9b67[_0xbf6a('0x2a')][_0xbf6a('0x3b')]){_0x396882[_0xbf6a('0x3c')]=[{'all':!![]}];}return db[_0xbf6a('0x3a')][_0xbf6a('0x3d')](_0x396882);})[_0xbf6a('0x20')](function(_0x3b8084){_0x1d11b9[_0xbf6a('0x3e')]=_0x3b8084;return _0x1d11b9;})[_0xbf6a('0x20')](respondWithFilteredResult(_0xfeb944,_0x396882))[_0xbf6a('0x3f')](handleError(_0xfeb944,null));};exports[_0xbf6a('0x40')]=function(_0x2a6194,_0x3f4b01){var _0x47317e={'raw':![],'where':{'id':_0x2a6194[_0xbf6a('0x41')]['id']}},_0xcf08a3={};_0xcf08a3[_0xbf6a('0x29')]=_['keys'](db[_0xbf6a('0x3a')][_0xbf6a('0x26')]);_0xcf08a3[_0xbf6a('0x2a')]=_[_0xbf6a('0x2b')](_0x2a6194[_0xbf6a('0x2a')]);_0xcf08a3[_0xbf6a('0x2c')]=_[_0xbf6a('0x2d')](_0xcf08a3[_0xbf6a('0x29')],_0xcf08a3[_0xbf6a('0x2a')]);_0x47317e[_0xbf6a('0x2f')]=_[_0xbf6a('0x2d')](_0xcf08a3[_0xbf6a('0x29')],qs[_0xbf6a('0x2e')](_0x2a6194['query'][_0xbf6a('0x2e')]));_0x47317e['attributes']=_0x47317e[_0xbf6a('0x2f')][_0xbf6a('0x30')]?_0x47317e[_0xbf6a('0x2f')]:_0xcf08a3['model'];if(_0x2a6194[_0xbf6a('0x2a')][_0xbf6a('0x3b')]){_0x47317e[_0xbf6a('0x3c')]=[{'all':!![]}];}_0x47317e=_['merge']({},_0x47317e,_0x2a6194[_0xbf6a('0x42')]);return db['SugarcrmConfiguration'][_0xbf6a('0x43')](_0x47317e)[_0xbf6a('0x20')](handleEntityNotFound(_0x3f4b01,null))['then'](respondWithResult(_0x3f4b01,null))[_0xbf6a('0x3f')](handleError(_0x3f4b01,null));};exports[_0xbf6a('0x44')]=function(_0x436618,_0x23e125){return db[_0xbf6a('0x3a')][_0xbf6a('0x44')](_0x436618['body'],{})[_0xbf6a('0x20')](respondWithResult(_0x23e125,0xc9))[_0xbf6a('0x3f')](handleError(_0x23e125,null));};exports['update']=function(_0x27a2df,_0x1648df){if(_0x27a2df[_0xbf6a('0x45')]['id']){delete _0x27a2df[_0xbf6a('0x45')]['id'];}return db['SugarcrmConfiguration'][_0xbf6a('0x43')]({'where':{'id':_0x27a2df[_0xbf6a('0x41')]['id']}})[_0xbf6a('0x20')](handleEntityNotFound(_0x1648df,null))[_0xbf6a('0x20')](saveUpdates(_0x27a2df[_0xbf6a('0x45')],null))[_0xbf6a('0x20')](respondWithResult(_0x1648df,null))['catch'](handleError(_0x1648df,null));};exports['destroy']=function(_0x1e2fdc,_0x192c50){return db[_0xbf6a('0x3a')]['find']({'where':{'id':_0x1e2fdc['params']['id']}})[_0xbf6a('0x20')](handleEntityNotFound(_0x192c50,null))['then'](removeEntity(_0x192c50,null))[_0xbf6a('0x3f')](handleError(_0x192c50,null));};exports['getFields']=function(_0x3a027e,_0x2e28dd,_0x5b78d6){var _0xac7a9c={};var _0x529342={};var _0xbbec86;var _0x44eb50;return db[_0xbf6a('0x3a')][_0xbf6a('0x46')]({'where':{'id':_0x3a027e[_0xbf6a('0x41')]['id']}})[_0xbf6a('0x20')](handleEntityNotFound(_0x2e28dd,null))[_0xbf6a('0x20')](function(_0x187d8e){if(_0x187d8e){_0xbbec86=_0x187d8e;_0x529342['model']=_[_0xbf6a('0x2b')](db[_0xbf6a('0x47')][_0xbf6a('0x26')]);_0x529342['query']=_['keys'](_0x3a027e['query']);_0x529342[_0xbf6a('0x2c')]=_['intersection'](_0x529342[_0xbf6a('0x29')],_0x529342[_0xbf6a('0x2a')]);_0xac7a9c[_0xbf6a('0x2f')]=_[_0xbf6a('0x2d')](_0x529342[_0xbf6a('0x29')],qs['fields'](_0x3a027e[_0xbf6a('0x2a')]['fields']));_0xac7a9c['attributes']=_0xac7a9c[_0xbf6a('0x2f')][_0xbf6a('0x30')]?_0xac7a9c[_0xbf6a('0x2f')]:_0x529342[_0xbf6a('0x29')];_0xac7a9c['order']=qs[_0xbf6a('0x34')](_0x3a027e[_0xbf6a('0x2a')][_0xbf6a('0x34')]);_0xac7a9c[_0xbf6a('0x35')]=qs[_0xbf6a('0x2c')](_[_0xbf6a('0x48')](_0x3a027e[_0xbf6a('0x2a')],_0x529342['filters']));if(_0x3a027e[_0xbf6a('0x2a')][_0xbf6a('0x36')]){_0xac7a9c[_0xbf6a('0x35')]=_[_0xbf6a('0x37')](_0xac7a9c[_0xbf6a('0x35')],{'$or':_[_0xbf6a('0x38')](_0xac7a9c[_0xbf6a('0x2f')],function(_0x4864e3){var _0x346534={};_0x346534[_0x4864e3]={'$like':'%'+_0x3a027e[_0xbf6a('0x2a')][_0xbf6a('0x36')]+'%'};return _0x346534;})});}_0xac7a9c=_[_0xbf6a('0x37')]({},_0xac7a9c,_0x3a027e['options']);return _0xbbec86['getFields'](_0xac7a9c);}})[_0xbf6a('0x20')](function(_0x2f656d){if(_0x2f656d){_0x44eb50=_0x2f656d[_0xbf6a('0x30')];if(!_0x3a027e[_0xbf6a('0x2a')]['hasOwnProperty']('nolimit')){_0xac7a9c[_0xbf6a('0x18')]=qs[_0xbf6a('0x18')](_0x3a027e['query']['limit']);_0xac7a9c[_0xbf6a('0x1a')]=qs[_0xbf6a('0x1a')](_0x3a027e[_0xbf6a('0x2a')]['offset']);}return _0xbbec86[_0xbf6a('0x49')](_0xac7a9c);}})[_0xbf6a('0x20')](function(_0x1ad70f){if(_0x1ad70f){return _0x1ad70f?{'count':_0x44eb50,'rows':_0x1ad70f}:null;}})[_0xbf6a('0x20')](respondWithResult(_0x2e28dd,null))[_0xbf6a('0x3f')](handleError(_0x2e28dd,null));};exports['getSubjects']=function(_0x5081bb,_0x1fee27,_0x5344da){var _0x32fa4a={};var _0x104c6f={};var _0x2728e3;var _0x50302e;return db[_0xbf6a('0x3a')][_0xbf6a('0x46')]({'where':{'id':_0x5081bb[_0xbf6a('0x41')]['id']}})[_0xbf6a('0x20')](handleEntityNotFound(_0x1fee27,null))[_0xbf6a('0x20')](function(_0x4ddf78){if(_0x4ddf78){_0x2728e3=_0x4ddf78;_0x104c6f[_0xbf6a('0x29')]=_[_0xbf6a('0x2b')](db[_0xbf6a('0x47')][_0xbf6a('0x26')]);_0x104c6f[_0xbf6a('0x2a')]=_['keys'](_0x5081bb[_0xbf6a('0x2a')]);_0x104c6f[_0xbf6a('0x2c')]=_[_0xbf6a('0x2d')](_0x104c6f[_0xbf6a('0x29')],_0x104c6f[_0xbf6a('0x2a')]);_0x32fa4a[_0xbf6a('0x2f')]=_[_0xbf6a('0x2d')](_0x104c6f['model'],qs['fields'](_0x5081bb[_0xbf6a('0x2a')][_0xbf6a('0x2e')]));_0x32fa4a[_0xbf6a('0x2f')]=_0x32fa4a['attributes'][_0xbf6a('0x30')]?_0x32fa4a[_0xbf6a('0x2f')]:_0x104c6f[_0xbf6a('0x29')];_0x32fa4a['order']=qs[_0xbf6a('0x34')](_0x5081bb[_0xbf6a('0x2a')][_0xbf6a('0x34')]);_0x32fa4a[_0xbf6a('0x35')]=qs['filters'](_['pick'](_0x5081bb[_0xbf6a('0x2a')],_0x104c6f['filters']));if(_0x5081bb[_0xbf6a('0x2a')][_0xbf6a('0x36')]){_0x32fa4a['where']=_['merge'](_0x32fa4a[_0xbf6a('0x35')],{'$or':_['map'](_0x32fa4a[_0xbf6a('0x2f')],function(_0x58249f){var _0x92c8bb={};_0x92c8bb[_0x58249f]={'$like':'%'+_0x5081bb[_0xbf6a('0x2a')]['filter']+'%'};return _0x92c8bb;})});}_0x32fa4a=_[_0xbf6a('0x37')]({},_0x32fa4a,_0x5081bb[_0xbf6a('0x42')]);return _0x2728e3['getSubjects'](_0x32fa4a);}})[_0xbf6a('0x20')](function(_0x3a0ba1){if(_0x3a0ba1){_0x50302e=_0x3a0ba1['length'];if(!_0x5081bb[_0xbf6a('0x2a')]['hasOwnProperty'](_0xbf6a('0x32'))){_0x32fa4a[_0xbf6a('0x18')]=qs[_0xbf6a('0x18')](_0x5081bb[_0xbf6a('0x2a')][_0xbf6a('0x18')]);_0x32fa4a[_0xbf6a('0x1a')]=qs[_0xbf6a('0x1a')](_0x5081bb[_0xbf6a('0x2a')]['offset']);}return _0x2728e3[_0xbf6a('0x4a')](_0x32fa4a);}})[_0xbf6a('0x20')](function(_0x2377cd){if(_0x2377cd){return _0x2377cd?{'count':_0x50302e,'rows':_0x2377cd}:null;}})[_0xbf6a('0x20')](respondWithResult(_0x1fee27,null))['catch'](handleError(_0x1fee27,null));};exports[_0xbf6a('0x4b')]=function(_0x4ad253,_0xa66295,_0x2d68b6){var _0x2b282b={};var _0x1bd658={};var _0x269cdb;var _0x572fc8;return db[_0xbf6a('0x3a')][_0xbf6a('0x46')]({'where':{'id':_0x4ad253[_0xbf6a('0x41')]['id']}})[_0xbf6a('0x20')](handleEntityNotFound(_0xa66295,null))[_0xbf6a('0x20')](function(_0x305bee){if(_0x305bee){_0x269cdb=_0x305bee;_0x1bd658['model']=_[_0xbf6a('0x2b')](db[_0xbf6a('0x47')][_0xbf6a('0x26')]);_0x1bd658[_0xbf6a('0x2a')]=_[_0xbf6a('0x2b')](_0x4ad253[_0xbf6a('0x2a')]);_0x1bd658[_0xbf6a('0x2c')]=_[_0xbf6a('0x2d')](_0x1bd658[_0xbf6a('0x29')],_0x1bd658[_0xbf6a('0x2a')]);_0x2b282b[_0xbf6a('0x2f')]=_[_0xbf6a('0x2d')](_0x1bd658[_0xbf6a('0x29')],qs[_0xbf6a('0x2e')](_0x4ad253[_0xbf6a('0x2a')]['fields']));_0x2b282b[_0xbf6a('0x2f')]=_0x2b282b['attributes']['length']?_0x2b282b[_0xbf6a('0x2f')]:_0x1bd658[_0xbf6a('0x29')];_0x2b282b[_0xbf6a('0x33')]=qs['sort'](_0x4ad253[_0xbf6a('0x2a')]['sort']);_0x2b282b[_0xbf6a('0x35')]=qs[_0xbf6a('0x2c')](_[_0xbf6a('0x48')](_0x4ad253[_0xbf6a('0x2a')],_0x1bd658[_0xbf6a('0x2c')]));if(_0x4ad253[_0xbf6a('0x2a')][_0xbf6a('0x36')]){_0x2b282b['where']=_[_0xbf6a('0x37')](_0x2b282b[_0xbf6a('0x35')],{'$or':_[_0xbf6a('0x38')](_0x2b282b['attributes'],function(_0x373989){var _0x27b6f2={};_0x27b6f2[_0x373989]={'$like':'%'+_0x4ad253[_0xbf6a('0x2a')]['filter']+'%'};return _0x27b6f2;})});}_0x2b282b=_[_0xbf6a('0x37')]({},_0x2b282b,_0x4ad253[_0xbf6a('0x42')]);return _0x269cdb[_0xbf6a('0x4b')](_0x2b282b);}})[_0xbf6a('0x20')](function(_0x2a854a){if(_0x2a854a){_0x572fc8=_0x2a854a[_0xbf6a('0x30')];if(!_0x4ad253[_0xbf6a('0x2a')][_0xbf6a('0x31')]('nolimit')){_0x2b282b[_0xbf6a('0x18')]=qs[_0xbf6a('0x18')](_0x4ad253['query'][_0xbf6a('0x18')]);_0x2b282b[_0xbf6a('0x1a')]=qs[_0xbf6a('0x1a')](_0x4ad253['query'][_0xbf6a('0x1a')]);}return _0x269cdb[_0xbf6a('0x4b')](_0x2b282b);}})[_0xbf6a('0x20')](function(_0x157252){if(_0x157252){return _0x157252?{'count':_0x572fc8,'rows':_0x157252}:null;}})[_0xbf6a('0x20')](respondWithResult(_0xa66295,null))[_0xbf6a('0x3f')](handleError(_0xa66295,null));};
\ No newline at end of file
index c03e768..b52d5bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa17c=['path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','define','int_sugarcrm_configurations','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xa17c,0x1da));var _0xca17=function(_0x7c4840,_0x43dc5c){_0x7c4840=_0x7c4840-0x0;var _0x1a19a5=_0xa17c[_0x7c4840];return _0x1a19a5;};'use strict';var _=require(_0xca17('0x0'));var util=require(_0xca17('0x1'));var logger=require(_0xca17('0x2'))(_0xca17('0x3'));var moment=require('moment');var BPromise=require(_0xca17('0x4'));var rp=require(_0xca17('0x5'));var fs=require('fs');var path=require(_0xca17('0x6'));var rimraf=require(_0xca17('0x7'));var config=require(_0xca17('0x8'));var attributes=require(_0xca17('0x9'));module['exports']=function(_0x5fd126,_0x2051f1){return _0x5fd126[_0xca17('0xa')]('SugarcrmConfiguration',attributes,{'tableName':_0xca17('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x739b=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','int_sugarcrm_configurations'];(function(_0x32ee51,_0x26d577){var _0x57d860=function(_0x55b534){while(--_0x55b534){_0x32ee51['push'](_0x32ee51['shift']());}};_0x57d860(++_0x26d577);}(_0x739b,0x1b0));var _0xb739=function(_0x36d768,_0x4075c4){_0x36d768=_0x36d768-0x0;var _0x4d4d90=_0x739b[_0x36d768];return _0x4d4d90;};'use strict';var _=require(_0xb739('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb739('0x1'));var moment=require(_0xb739('0x2'));var BPromise=require(_0xb739('0x3'));var rp=require(_0xb739('0x4'));var fs=require('fs');var path=require(_0xb739('0x5'));var rimraf=require(_0xb739('0x6'));var config=require(_0xb739('0x7'));var attributes=require(_0xb739('0x8'));module['exports']=function(_0x15dfa5,_0xc6b362){return _0x15dfa5[_0xb739('0x9')](_0xb739('0xa'),attributes,{'tableName':_0xb739('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 75cdb3d..cf82f43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e01=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x1943d9,_0x245bb8){var _0x4b4f3f=function(_0x3bba90){while(--_0x3bba90){_0x1943d9['push'](_0x1943d9['shift']());}};_0x4b4f3f(++_0x245bb8);}(_0x5e01,0xe9));var _0x15e0=function(_0x2338fa,_0x80579a){_0x2338fa=_0x2338fa-0x0;var _0x42df9b=_0x5e01[_0x2338fa];return _0x42df9b;};'use strict';var _=require(_0x15e0('0x0'));var util=require(_0x15e0('0x1'));var moment=require(_0x15e0('0x2'));var BPromise=require(_0x15e0('0x3'));var rs=require(_0x15e0('0x4'));var fs=require('fs');var Redis=require(_0x15e0('0x5'));var db=require(_0x15e0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x15e0('0x7'))('rpc');var config=require(_0x15e0('0x8'));var jayson=require(_0x15e0('0x9'));var client=jayson[_0x15e0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x174a43,_0x11b46c,_0x3a1821){return new BPromise(function(_0x1c2cd4,_0x171caa){return client[_0x15e0('0xb')](_0x174a43,_0x3a1821)[_0x15e0('0xc')](function(_0xf39ef4){logger[_0x15e0('0xd')](_0x15e0('0xe'),_0x11b46c,_0x15e0('0xf'));logger[_0x15e0('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x11b46c,_0x15e0('0xf'),JSON[_0x15e0('0x11')](_0xf39ef4));if(_0xf39ef4['error']){if(_0xf39ef4[_0x15e0('0x12')]['code']===0x1f4){logger[_0x15e0('0x12')](_0x15e0('0xe'),_0x11b46c,_0xf39ef4['error'][_0x15e0('0x13')]);return _0x171caa(_0xf39ef4[_0x15e0('0x12')]['message']);}logger['error'](_0x15e0('0xe'),_0x11b46c,_0xf39ef4[_0x15e0('0x12')]['message']);return _0x1c2cd4(_0xf39ef4[_0x15e0('0x12')][_0x15e0('0x13')]);}else{logger[_0x15e0('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x11b46c,_0x15e0('0xf'));_0x1c2cd4(_0xf39ef4['result']['message']);}})[_0x15e0('0x14')](function(_0x5dede5){logger[_0x15e0('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x11b46c,_0x5dede5);_0x171caa(_0x5dede5);});});}
\ No newline at end of file
+var _0xf31d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment'];(function(_0x568964,_0x38917d){var _0x4715b7=function(_0x1287a0){while(--_0x1287a0){_0x568964['push'](_0x568964['shift']());}};_0x4715b7(++_0x38917d);}(_0xf31d,0x111));var _0xdf31=function(_0x148c09,_0x4fd39f){_0x148c09=_0x148c09-0x0;var _0x18e613=_0xf31d[_0x148c09];return _0x18e613;};'use strict';var _=require(_0xdf31('0x0'));var util=require('util');var moment=require(_0xdf31('0x1'));var BPromise=require(_0xdf31('0x2'));var rs=require(_0xdf31('0x3'));var fs=require('fs');var Redis=require(_0xdf31('0x4'));var db=require(_0xdf31('0x5'))['db'];var utils=require(_0xdf31('0x6'));var logger=require(_0xdf31('0x7'))(_0xdf31('0x8'));var config=require('../../config/environment');var jayson=require(_0xdf31('0x9'));var client=jayson[_0xdf31('0xa')][_0xdf31('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x114913,_0xdbf73,_0x2dc77f){return new BPromise(function(_0x4669ce,_0x17d3b4){return client[_0xdf31('0xc')](_0x114913,_0x2dc77f)[_0xdf31('0xd')](function(_0x4541a3){logger[_0xdf31('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xdbf73,'request\x20sent');logger[_0xdf31('0xf')](_0xdf31('0x10'),_0xdbf73,_0xdf31('0x11'),JSON[_0xdf31('0x12')](_0x4541a3));if(_0x4541a3[_0xdf31('0x13')]){if(_0x4541a3['error'][_0xdf31('0x14')]===0x1f4){logger['error'](_0xdf31('0x15'),_0xdbf73,_0x4541a3[_0xdf31('0x13')][_0xdf31('0x16')]);return _0x17d3b4(_0x4541a3[_0xdf31('0x13')]['message']);}logger[_0xdf31('0x13')](_0xdf31('0x15'),_0xdbf73,_0x4541a3[_0xdf31('0x13')]['message']);return _0x4669ce(_0x4541a3[_0xdf31('0x13')][_0xdf31('0x16')]);}else{logger[_0xdf31('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xdbf73,_0xdf31('0x11'));_0x4669ce(_0x4541a3[_0xdf31('0x17')][_0xdf31('0x16')]);}})[_0xdf31('0x18')](function(_0x464d47){logger[_0xdf31('0x13')](_0xdf31('0x15'),_0xdbf73,_0x464d47);_0x17d3b4(_0x464d47);});});}
\ No newline at end of file
index dc25e69..b7796f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x102e=['fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get','index','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','express','Router'];(function(_0x598770,_0x3e6195){var _0x571b76=function(_0x8cef66){while(--_0x8cef66){_0x598770['push'](_0x598770['shift']());}};_0x571b76(++_0x3e6195);}(_0x102e,0x9f));var _0xe102=function(_0x1e80f7,_0x51070a){_0x1e80f7=_0x1e80f7-0x0;var _0x361cb6=_0x102e[_0x1e80f7];return _0x361cb6;};'use strict';var multer=require(_0xe102('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe102('0x1'));var router=express[_0xe102('0x2')]();var fs_extra=require(_0xe102('0x3'));var auth=require(_0xe102('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe102('0x5'));var controller=require(_0xe102('0x6'));router[_0xe102('0x7')]('/',auth['isAuthenticated'](),controller[_0xe102('0x8')]);router[_0xe102('0x7')](_0xe102('0x9'),auth[_0xe102('0xa')](),controller[_0xe102('0xb')]);router[_0xe102('0xc')]('/',auth['isAuthenticated'](),controller[_0xe102('0xd')]);router[_0xe102('0xe')](_0xe102('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xe102('0xf')](_0xe102('0x9'),auth[_0xe102('0xa')](),controller[_0xe102('0x10')]);module[_0xe102('0x11')]=router;
\ No newline at end of file
+var _0xe6dc=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','show','create','put','/:id','update','delete'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xe6dc,0x91));var _0xce6d=function(_0x36b6d5,_0x5837f2){_0x36b6d5=_0x36b6d5-0x0;var _0x2f493e=_0xe6dc[_0x36b6d5];return _0x2f493e;};'use strict';var multer=require(_0xce6d('0x0'));var util=require(_0xce6d('0x1'));var path=require('path');var timeout=require(_0xce6d('0x2'));var express=require(_0xce6d('0x3'));var router=express[_0xce6d('0x4')]();var fs_extra=require(_0xce6d('0x5'));var auth=require(_0xce6d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xce6d('0x7'));var controller=require(_0xce6d('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xce6d('0x9')]('/:id',auth[_0xce6d('0xa')](),controller[_0xce6d('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xce6d('0xc')]);router[_0xce6d('0xd')](_0xce6d('0xe'),auth[_0xce6d('0xa')](),controller[_0xce6d('0xf')]);router[_0xce6d('0x10')]('/:id',auth[_0xce6d('0xa')](),controller['destroy']);module[_0xce6d('0x11')]=router;
\ No newline at end of file
index b1b5e3c..78bc522 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa716=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x204b90,_0x35b72a){var _0x5c2e67=function(_0x14a78e){while(--_0x14a78e){_0x204b90['push'](_0x204b90['shift']());}};_0x5c2e67(++_0x35b72a);}(_0xa716,0x76));var _0x6a71=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xa716[_0x199572];return _0x13cfa3;};'use strict';var Sequelize=require(_0x6a71('0x0'));module[_0x6a71('0x1')]={'type':{'type':Sequelize[_0x6a71('0x2')](_0x6a71('0x3'),_0x6a71('0x4'),_0x6a71('0x5'),_0x6a71('0x6'),_0x6a71('0x7')),'defaultValue':_0x6a71('0x3')},'content':{'type':Sequelize[_0x6a71('0x8')]},'key':{'type':Sequelize[_0x6a71('0x8')]},'keyType':{'type':Sequelize[_0x6a71('0x2')](_0x6a71('0x3'),_0x6a71('0x4'),_0x6a71('0x5'))},'keyContent':{'type':Sequelize[_0x6a71('0x8')]},'idField':{'type':Sequelize[_0x6a71('0x8')]},'nameField':{'type':Sequelize[_0x6a71('0x8')]},'customField':{'type':Sequelize[_0x6a71('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x929e=['string','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','variable','keyValue','picklist'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x929e,0x18a));var _0xe929=function(_0x55a1f8,_0x4a8bf6){_0x55a1f8=_0x55a1f8-0x0;var _0x9a92e9=_0x929e[_0x55a1f8];return _0x9a92e9;};'use strict';var Sequelize=require(_0xe929('0x0'));module[_0xe929('0x1')]={'type':{'type':Sequelize[_0xe929('0x2')]('string',_0xe929('0x3'),'customVariable',_0xe929('0x4'),_0xe929('0x5')),'defaultValue':_0xe929('0x6')},'content':{'type':Sequelize[_0xe929('0x7')]},'key':{'type':Sequelize[_0xe929('0x7')]},'keyType':{'type':Sequelize[_0xe929('0x2')]('string','variable',_0xe929('0x8'))},'keyContent':{'type':Sequelize[_0xe929('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xe929('0x7')]},'customField':{'type':Sequelize[_0xe929('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe929('0x7')]}};
\ No newline at end of file
index 117b534..5214738 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6414=['bluebird','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','SugarcrmField','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x4c7241,_0x1a26fe){var _0xf6002f=function(_0x1e30d1){while(--_0x1e30d1){_0x4c7241['push'](_0x4c7241['shift']());}};_0xf6002f(++_0x1a26fe);}(_0x6414,0xcd));var _0x4641=function(_0x3b1763,_0x3f22d7){_0x3b1763=_0x3b1763-0x0;var _0xa96936=_0x6414[_0x3b1763];return _0xa96936;};'use strict';var emlformat=require(_0x4641('0x0'));var rimraf=require(_0x4641('0x1'));var zipdir=require(_0x4641('0x2'));var jsonpatch=require(_0x4641('0x3'));var rp=require('request-promise');var moment=require(_0x4641('0x4'));var BPromise=require(_0x4641('0x5'));var Mustache=require('mustache');var util=require(_0x4641('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x4641('0x7'));var ejs=require(_0x4641('0x8'));var fs=require('fs');var fs_extra=require(_0x4641('0x9'));var _=require('lodash');var squel=require(_0x4641('0xa'));var crypto=require(_0x4641('0xb'));var jsforce=require(_0x4641('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4641('0x7'));var querystring=require(_0x4641('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4641('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x4641('0xf'));var hardwareService=require(_0x4641('0x10'));var logger=require(_0x4641('0x11'))(_0x4641('0x12'));var utils=require(_0x4641('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4641('0x14'))['db'];function respondWithStatusCode(_0x5f7ba0,_0x25d08c){_0x25d08c=_0x25d08c||0xcc;return function(_0x2ea614){if(_0x2ea614){return _0x5f7ba0[_0x4641('0x15')](_0x25d08c);}return _0x5f7ba0[_0x4641('0x16')](_0x25d08c)[_0x4641('0x17')]();};}function respondWithResult(_0x4427bb,_0x4a90e2){_0x4a90e2=_0x4a90e2||0xc8;return function(_0x188b15){if(_0x188b15){return _0x4427bb[_0x4641('0x16')](_0x4a90e2)['json'](_0x188b15);}};}function respondWithFilteredResult(_0x517d77,_0x11760b){return function(_0x8b3018){if(_0x8b3018){var _0x490608=typeof _0x11760b[_0x4641('0x18')]===_0x4641('0x19')&&typeof _0x11760b['limit']==='undefined';var _0xb8d0fe=_0x8b3018[_0x4641('0x1a')];var _0x5af3be=_0x490608?0x0:_0x11760b[_0x4641('0x18')];var _0x21be76=_0x490608?_0x8b3018[_0x4641('0x1a')]:_0x11760b[_0x4641('0x18')]+_0x11760b[_0x4641('0x1b')];var _0x45bcd3;if(_0x21be76>=_0xb8d0fe){_0x21be76=_0xb8d0fe;_0x45bcd3=0xc8;}else{_0x45bcd3=0xce;}_0x517d77['status'](_0x45bcd3);return _0x517d77[_0x4641('0x1c')](_0x4641('0x1d'),_0x5af3be+'-'+_0x21be76+'/'+_0xb8d0fe)['json'](_0x8b3018);}return null;};}function patchUpdates(_0x4ee3e6){return function(_0x4ce8cb){try{jsonpatch[_0x4641('0x1e')](_0x4ce8cb,_0x4ee3e6,!![]);}catch(_0x30a0df){return BPromise['reject'](_0x30a0df);}return _0x4ce8cb[_0x4641('0x1f')]();};}function saveUpdates(_0x257ac9,_0x50e801){return function(_0x2aed7c){if(_0x2aed7c){return _0x2aed7c[_0x4641('0x20')](_0x257ac9)[_0x4641('0x21')](function(_0x8a1e){return _0x8a1e;});}return null;};}function removeEntity(_0x1622f1,_0x55af3f){return function(_0x48699e){if(_0x48699e){return _0x48699e[_0x4641('0x22')]()['then'](function(){_0x1622f1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x24dc31,_0x4ecff3){return function(_0x55db85){if(!_0x55db85){_0x24dc31[_0x4641('0x15')](0x194);}return _0x55db85;};}function handleError(_0x453fee,_0x21266d){_0x21266d=_0x21266d||0x1f4;return function(_0x2d951d){logger[_0x4641('0x23')](_0x2d951d[_0x4641('0x24')]);if(_0x2d951d[_0x4641('0x25')]){delete _0x2d951d['name'];}_0x453fee[_0x4641('0x16')](_0x21266d)[_0x4641('0x26')](_0x2d951d);};}exports[_0x4641('0x27')]=function(_0x19b8fd,_0x4006e8){var _0x42e662={},_0x6101db={},_0x5989ad={'count':0x0,'rows':[]};var _0x2dc4dd=_[_0x4641('0x28')](db[_0x4641('0x29')]['rawAttributes'],function(_0x3b7ded){return{'name':_0x3b7ded['fieldName'],'type':_0x3b7ded[_0x4641('0x2a')]['key']};});_0x6101db[_0x4641('0x2b')]=_[_0x4641('0x28')](_0x2dc4dd,_0x4641('0x25'));_0x6101db[_0x4641('0x2c')]=_[_0x4641('0x2d')](_0x19b8fd[_0x4641('0x2c')]);_0x6101db[_0x4641('0x2e')]=_['intersection'](_0x6101db[_0x4641('0x2b')],_0x6101db[_0x4641('0x2c')]);_0x42e662[_0x4641('0x2f')]=_[_0x4641('0x30')](_0x6101db[_0x4641('0x2b')],qs[_0x4641('0x31')](_0x19b8fd[_0x4641('0x2c')][_0x4641('0x31')]));_0x42e662[_0x4641('0x2f')]=_0x42e662['attributes'][_0x4641('0x32')]?_0x42e662[_0x4641('0x2f')]:_0x6101db['model'];if(!_0x19b8fd[_0x4641('0x2c')][_0x4641('0x33')](_0x4641('0x34'))){_0x42e662[_0x4641('0x1b')]=qs[_0x4641('0x1b')](_0x19b8fd[_0x4641('0x2c')][_0x4641('0x1b')]);_0x42e662[_0x4641('0x18')]=qs[_0x4641('0x18')](_0x19b8fd[_0x4641('0x2c')][_0x4641('0x18')]);}_0x42e662[_0x4641('0x35')]=qs['sort'](_0x19b8fd[_0x4641('0x2c')][_0x4641('0x36')]);_0x42e662[_0x4641('0x37')]=qs[_0x4641('0x2e')](_[_0x4641('0x38')](_0x19b8fd[_0x4641('0x2c')],_0x6101db['filters']),_0x2dc4dd);if(_0x19b8fd[_0x4641('0x2c')][_0x4641('0x39')]){_0x42e662['where']=_[_0x4641('0x3a')](_0x42e662[_0x4641('0x37')],{'$or':_[_0x4641('0x28')](_0x2dc4dd,function(_0x620532){if(_0x620532[_0x4641('0x2a')]!==_0x4641('0x3b')){var _0x4d97a8={};_0x4d97a8[_0x620532[_0x4641('0x25')]]={'$like':'%'+_0x19b8fd['query'][_0x4641('0x39')]+'%'};return _0x4d97a8;}})});}_0x42e662=_[_0x4641('0x3a')]({},_0x42e662,_0x19b8fd['options']);var _0x5c8e1d={'where':_0x42e662[_0x4641('0x37')]};return db[_0x4641('0x29')][_0x4641('0x1a')](_0x5c8e1d)[_0x4641('0x21')](function(_0xfa59df){_0x5989ad[_0x4641('0x1a')]=_0xfa59df;if(_0x19b8fd[_0x4641('0x2c')][_0x4641('0x3c')]){_0x42e662[_0x4641('0x3d')]=[{'all':!![]}];}return db[_0x4641('0x29')]['findAll'](_0x42e662);})[_0x4641('0x21')](function(_0x5e90be){_0x5989ad[_0x4641('0x3e')]=_0x5e90be;return _0x5989ad;})[_0x4641('0x21')](respondWithFilteredResult(_0x4006e8,_0x42e662))[_0x4641('0x3f')](handleError(_0x4006e8,null));};exports[_0x4641('0x40')]=function(_0x179af0,_0xc2cbbe){var _0x237836={'raw':!![],'where':{'id':_0x179af0[_0x4641('0x41')]['id']}},_0x5b199f={};_0x5b199f[_0x4641('0x2b')]=_[_0x4641('0x2d')](db[_0x4641('0x29')][_0x4641('0x42')]);_0x5b199f['query']=_[_0x4641('0x2d')](_0x179af0[_0x4641('0x2c')]);_0x5b199f['filters']=_[_0x4641('0x30')](_0x5b199f[_0x4641('0x2b')],_0x5b199f[_0x4641('0x2c')]);_0x237836['attributes']=_[_0x4641('0x30')](_0x5b199f['model'],qs[_0x4641('0x31')](_0x179af0['query'][_0x4641('0x31')]));_0x237836['attributes']=_0x237836[_0x4641('0x2f')]['length']?_0x237836[_0x4641('0x2f')]:_0x5b199f[_0x4641('0x2b')];if(_0x179af0[_0x4641('0x2c')]['includeAll']){_0x237836[_0x4641('0x3d')]=[{'all':!![]}];}_0x237836=_['merge']({},_0x237836,_0x179af0['options']);return db[_0x4641('0x29')][_0x4641('0x43')](_0x237836)['then'](handleEntityNotFound(_0xc2cbbe,null))['then'](respondWithResult(_0xc2cbbe,null))['catch'](handleError(_0xc2cbbe,null));};exports[_0x4641('0x44')]=function(_0x3aa0ff,_0x352f8c){return db[_0x4641('0x29')]['create'](_0x3aa0ff['body'],{})[_0x4641('0x21')](respondWithResult(_0x352f8c,0xc9))['catch'](handleError(_0x352f8c,null));};exports[_0x4641('0x20')]=function(_0x2d8c69,_0x1a9203){if(_0x2d8c69[_0x4641('0x45')]['id']){delete _0x2d8c69[_0x4641('0x45')]['id'];}return db[_0x4641('0x29')][_0x4641('0x43')]({'where':{'id':_0x2d8c69[_0x4641('0x41')]['id']}})[_0x4641('0x21')](handleEntityNotFound(_0x1a9203,null))[_0x4641('0x21')](saveUpdates(_0x2d8c69[_0x4641('0x45')],null))[_0x4641('0x21')](respondWithResult(_0x1a9203,null))[_0x4641('0x3f')](handleError(_0x1a9203,null));};exports['destroy']=function(_0x494d30,_0x4ed9f2){return db[_0x4641('0x29')][_0x4641('0x43')]({'where':{'id':_0x494d30[_0x4641('0x41')]['id']}})[_0x4641('0x21')](handleEntityNotFound(_0x4ed9f2,null))[_0x4641('0x21')](removeEntity(_0x4ed9f2,null))['catch'](handleError(_0x4ed9f2,null));};
\ No newline at end of file
+var _0xa7ee=['merge','VIRTUAL','options','then','findAll','show','params','intersection','includeAll','include','find','catch','create','body','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','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','send','index','map','SugarcrmField','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where'];(function(_0x318e31,_0x1a8c88){var _0x512793=function(_0x33cbf0){while(--_0x33cbf0){_0x318e31['push'](_0x318e31['shift']());}};_0x512793(++_0x1a8c88);}(_0xa7ee,0x1ee));var _0xea7e=function(_0x3ca7a9,_0x4fc0c7){_0x3ca7a9=_0x3ca7a9-0x0;var _0x399428=_0xa7ee[_0x3ca7a9];return _0x399428;};'use strict';var emlformat=require(_0xea7e('0x0'));var rimraf=require(_0xea7e('0x1'));var zipdir=require(_0xea7e('0x2'));var jsonpatch=require(_0xea7e('0x3'));var rp=require(_0xea7e('0x4'));var moment=require(_0xea7e('0x5'));var BPromise=require(_0xea7e('0x6'));var Mustache=require(_0xea7e('0x7'));var util=require(_0xea7e('0x8'));var path=require('path');var sox=require(_0xea7e('0x9'));var csv=require(_0xea7e('0xa'));var ejs=require(_0xea7e('0xb'));var fs=require('fs');var fs_extra=require(_0xea7e('0xc'));var _=require(_0xea7e('0xd'));var squel=require('squel');var crypto=require(_0xea7e('0xe'));var jsforce=require(_0xea7e('0xf'));var deskjs=require(_0xea7e('0x10'));var toCsv=require(_0xea7e('0xa'));var querystring=require(_0xea7e('0x11'));var Papa=require(_0xea7e('0x12'));var Redis=require(_0xea7e('0x13'));var authService=require(_0xea7e('0x14'));var qs=require(_0xea7e('0x15'));var as=require(_0xea7e('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xea7e('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xea7e('0x18'));var licenseUtil=require(_0xea7e('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58942a,_0x404b84){_0x404b84=_0x404b84||0xcc;return function(_0x2e0827){if(_0x2e0827){return _0x58942a[_0xea7e('0x1a')](_0x404b84);}return _0x58942a[_0xea7e('0x1b')](_0x404b84)['end']();};}function respondWithResult(_0x243383,_0x10fa87){_0x10fa87=_0x10fa87||0xc8;return function(_0x45b3b9){if(_0x45b3b9){return _0x243383['status'](_0x10fa87)[_0xea7e('0x1c')](_0x45b3b9);}};}function respondWithFilteredResult(_0xd27e80,_0x55047e){return function(_0x4f2675){if(_0x4f2675){var _0x38e088=typeof _0x55047e[_0xea7e('0x1d')]===_0xea7e('0x1e')&&typeof _0x55047e[_0xea7e('0x1f')]==='undefined';var _0x20c137=_0x4f2675[_0xea7e('0x20')];var _0x1c4597=_0x38e088?0x0:_0x55047e['offset'];var _0x52c987=_0x38e088?_0x4f2675[_0xea7e('0x20')]:_0x55047e['offset']+_0x55047e[_0xea7e('0x1f')];var _0x13b02c;if(_0x52c987>=_0x20c137){_0x52c987=_0x20c137;_0x13b02c=0xc8;}else{_0x13b02c=0xce;}_0xd27e80['status'](_0x13b02c);return _0xd27e80[_0xea7e('0x21')](_0xea7e('0x22'),_0x1c4597+'-'+_0x52c987+'/'+_0x20c137)['json'](_0x4f2675);}return null;};}function patchUpdates(_0x3a7d8d){return function(_0x58be42){try{jsonpatch[_0xea7e('0x23')](_0x58be42,_0x3a7d8d,!![]);}catch(_0x5b7ae8){return BPromise[_0xea7e('0x24')](_0x5b7ae8);}return _0x58be42[_0xea7e('0x25')]();};}function saveUpdates(_0x180e73,_0x262fb2){return function(_0x338cf7){if(_0x338cf7){return _0x338cf7[_0xea7e('0x26')](_0x180e73)['then'](function(_0x3d7ec8){return _0x3d7ec8;});}return null;};}function removeEntity(_0x75a582,_0x3ba979){return function(_0x16f599){if(_0x16f599){return _0x16f599[_0xea7e('0x27')]()['then'](function(){_0x75a582[_0xea7e('0x1b')](0xcc)[_0xea7e('0x28')]();});}};}function handleEntityNotFound(_0x33841d,_0x341c0e){return function(_0x52f5e5){if(!_0x52f5e5){_0x33841d['sendStatus'](0x194);}return _0x52f5e5;};}function handleError(_0x52e8fa,_0x1e148a){_0x1e148a=_0x1e148a||0x1f4;return function(_0x40e9ce){logger[_0xea7e('0x29')](_0x40e9ce[_0xea7e('0x2a')]);if(_0x40e9ce['name']){delete _0x40e9ce[_0xea7e('0x2b')];}_0x52e8fa['status'](_0x1e148a)[_0xea7e('0x2c')](_0x40e9ce);};}exports[_0xea7e('0x2d')]=function(_0x498020,_0x705366){var _0x97dce5={},_0x4de38b={},_0x34a6b9={'count':0x0,'rows':[]};var _0x2baace=_[_0xea7e('0x2e')](db[_0xea7e('0x2f')][_0xea7e('0x30')],function(_0x381f9f){return{'name':_0x381f9f[_0xea7e('0x31')],'type':_0x381f9f[_0xea7e('0x32')][_0xea7e('0x33')]};});_0x4de38b['model']=_[_0xea7e('0x2e')](_0x2baace,_0xea7e('0x2b'));_0x4de38b[_0xea7e('0x34')]=_[_0xea7e('0x35')](_0x498020[_0xea7e('0x34')]);_0x4de38b[_0xea7e('0x36')]=_['intersection'](_0x4de38b[_0xea7e('0x37')],_0x4de38b[_0xea7e('0x34')]);_0x97dce5[_0xea7e('0x38')]=_['intersection'](_0x4de38b[_0xea7e('0x37')],qs[_0xea7e('0x39')](_0x498020[_0xea7e('0x34')][_0xea7e('0x39')]));_0x97dce5['attributes']=_0x97dce5['attributes'][_0xea7e('0x3a')]?_0x97dce5['attributes']:_0x4de38b[_0xea7e('0x37')];if(!_0x498020[_0xea7e('0x34')][_0xea7e('0x3b')](_0xea7e('0x3c'))){_0x97dce5[_0xea7e('0x1f')]=qs['limit'](_0x498020[_0xea7e('0x34')][_0xea7e('0x1f')]);_0x97dce5['offset']=qs['offset'](_0x498020['query']['offset']);}_0x97dce5[_0xea7e('0x3d')]=qs[_0xea7e('0x3e')](_0x498020['query']['sort']);_0x97dce5['where']=qs[_0xea7e('0x36')](_[_0xea7e('0x3f')](_0x498020['query'],_0x4de38b[_0xea7e('0x36')]),_0x2baace);if(_0x498020[_0xea7e('0x34')][_0xea7e('0x40')]){_0x97dce5[_0xea7e('0x41')]=_[_0xea7e('0x42')](_0x97dce5[_0xea7e('0x41')],{'$or':_[_0xea7e('0x2e')](_0x2baace,function(_0x54f5ef){if(_0x54f5ef[_0xea7e('0x32')]!==_0xea7e('0x43')){var _0x2c2bea={};_0x2c2bea[_0x54f5ef[_0xea7e('0x2b')]]={'$like':'%'+_0x498020[_0xea7e('0x34')][_0xea7e('0x40')]+'%'};return _0x2c2bea;}})});}_0x97dce5=_['merge']({},_0x97dce5,_0x498020[_0xea7e('0x44')]);var _0x8bd231={'where':_0x97dce5[_0xea7e('0x41')]};return db['SugarcrmField'][_0xea7e('0x20')](_0x8bd231)[_0xea7e('0x45')](function(_0x1329a9){_0x34a6b9[_0xea7e('0x20')]=_0x1329a9;if(_0x498020['query']['includeAll']){_0x97dce5['include']=[{'all':!![]}];}return db[_0xea7e('0x2f')][_0xea7e('0x46')](_0x97dce5);})[_0xea7e('0x45')](function(_0x4b7771){_0x34a6b9['rows']=_0x4b7771;return _0x34a6b9;})[_0xea7e('0x45')](respondWithFilteredResult(_0x705366,_0x97dce5))['catch'](handleError(_0x705366,null));};exports[_0xea7e('0x47')]=function(_0xe45537,_0x54d516){var _0xe9b341={'raw':!![],'where':{'id':_0xe45537[_0xea7e('0x48')]['id']}},_0x2cfd04={};_0x2cfd04[_0xea7e('0x37')]=_[_0xea7e('0x35')](db['SugarcrmField'][_0xea7e('0x30')]);_0x2cfd04[_0xea7e('0x34')]=_['keys'](_0xe45537[_0xea7e('0x34')]);_0x2cfd04[_0xea7e('0x36')]=_[_0xea7e('0x49')](_0x2cfd04[_0xea7e('0x37')],_0x2cfd04[_0xea7e('0x34')]);_0xe9b341[_0xea7e('0x38')]=_[_0xea7e('0x49')](_0x2cfd04[_0xea7e('0x37')],qs[_0xea7e('0x39')](_0xe45537['query']['fields']));_0xe9b341[_0xea7e('0x38')]=_0xe9b341['attributes'][_0xea7e('0x3a')]?_0xe9b341[_0xea7e('0x38')]:_0x2cfd04[_0xea7e('0x37')];if(_0xe45537[_0xea7e('0x34')][_0xea7e('0x4a')]){_0xe9b341[_0xea7e('0x4b')]=[{'all':!![]}];}_0xe9b341=_[_0xea7e('0x42')]({},_0xe9b341,_0xe45537[_0xea7e('0x44')]);return db[_0xea7e('0x2f')][_0xea7e('0x4c')](_0xe9b341)[_0xea7e('0x45')](handleEntityNotFound(_0x54d516,null))[_0xea7e('0x45')](respondWithResult(_0x54d516,null))[_0xea7e('0x4d')](handleError(_0x54d516,null));};exports[_0xea7e('0x4e')]=function(_0x1ca920,_0x847c52){return db[_0xea7e('0x2f')][_0xea7e('0x4e')](_0x1ca920['body'],{})[_0xea7e('0x45')](respondWithResult(_0x847c52,0xc9))[_0xea7e('0x4d')](handleError(_0x847c52,null));};exports['update']=function(_0x5f2138,_0x313c41){if(_0x5f2138[_0xea7e('0x4f')]['id']){delete _0x5f2138[_0xea7e('0x4f')]['id'];}return db['SugarcrmField'][_0xea7e('0x4c')]({'where':{'id':_0x5f2138[_0xea7e('0x48')]['id']}})['then'](handleEntityNotFound(_0x313c41,null))[_0xea7e('0x45')](saveUpdates(_0x5f2138['body'],null))[_0xea7e('0x45')](respondWithResult(_0x313c41,null))['catch'](handleError(_0x313c41,null));};exports[_0xea7e('0x27')]=function(_0x2abdf9,_0x5a7171){return db[_0xea7e('0x2f')]['find']({'where':{'id':_0x2abdf9['params']['id']}})[_0xea7e('0x45')](handleEntityNotFound(_0x5a7171,null))[_0xea7e('0x45')](removeEntity(_0x5a7171,null))[_0xea7e('0x4d')](handleError(_0x5a7171,null));};
\ No newline at end of file
index 0efba96..3aa3d5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1eaf=['idField','FieldId','lodash','util','moment','bluebird','request-promise','path','rimraf','./intSugarcrmField.attributes','define','int_sugarcrm_fields','sugarcrm_unique_index'];(function(_0x3a3e4f,_0x5b0b27){var _0x5841a6=function(_0x36da29){while(--_0x36da29){_0x3a3e4f['push'](_0x3a3e4f['shift']());}};_0x5841a6(++_0x5b0b27);}(_0x1eaf,0x1af));var _0xf1ea=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x1eaf[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xf1ea('0x0'));var util=require(_0xf1ea('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf1ea('0x2'));var BPromise=require(_0xf1ea('0x3'));var rp=require(_0xf1ea('0x4'));var fs=require('fs');var path=require(_0xf1ea('0x5'));var rimraf=require(_0xf1ea('0x6'));var config=require('../../config/environment');var attributes=require(_0xf1ea('0x7'));module['exports']=function(_0x45979e,_0x356fa4){return _0x45979e[_0xf1ea('0x8')]('SugarcrmField',attributes,{'tableName':_0xf1ea('0x9'),'paranoid':![],'indexes':[{'name':_0xf1ea('0xa'),'fields':[_0xf1ea('0xb'),_0xf1ea('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8831=['request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','../../config/logger','api','moment'];(function(_0x5e0b68,_0x5a4bbf){var _0x190b88=function(_0x4f216c){while(--_0x4f216c){_0x5e0b68['push'](_0x5e0b68['shift']());}};_0x190b88(++_0x5a4bbf);}(_0x8831,0x155));var _0x1883=function(_0xd58fc1,_0x1d931c){_0xd58fc1=_0xd58fc1-0x0;var _0xc71c40=_0x8831[_0xd58fc1];return _0xc71c40;};'use strict';var _=require(_0x1883('0x0'));var util=require('util');var logger=require(_0x1883('0x1'))(_0x1883('0x2'));var moment=require(_0x1883('0x3'));var BPromise=require('bluebird');var rp=require(_0x1883('0x4'));var fs=require('fs');var path=require(_0x1883('0x5'));var rimraf=require(_0x1883('0x6'));var config=require(_0x1883('0x7'));var attributes=require(_0x1883('0x8'));module[_0x1883('0x9')]=function(_0x590909,_0x4b611a){return _0x590909[_0x1883('0xa')]('SugarcrmField',attributes,{'tableName':_0x1883('0xb'),'paranoid':![],'indexes':[{'name':_0x1883('0xc'),'fields':[_0x1883('0xd'),_0x1883('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index c5ad0bc..313718c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc05c=['rpc','../../config/environment','jayson/promise','client','http','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x5b733d,_0x272606){var _0x2b7995=function(_0x1e5bf8){while(--_0x1e5bf8){_0x5b733d['push'](_0x5b733d['shift']());}};_0x2b7995(++_0x272606);}(_0xc05c,0x143));var _0xcc05=function(_0xc0dc5,_0x4739b7){_0xc0dc5=_0xc0dc5-0x0;var _0x3a6255=_0xc05c[_0xc0dc5];return _0x3a6255;};'use strict';var _=require(_0xcc05('0x0'));var util=require('util');var moment=require(_0xcc05('0x1'));var BPromise=require(_0xcc05('0x2'));var rs=require(_0xcc05('0x3'));var fs=require('fs');var Redis=require(_0xcc05('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcc05('0x5'));var logger=require(_0xcc05('0x6'))(_0xcc05('0x7'));var config=require(_0xcc05('0x8'));var jayson=require(_0xcc05('0x9'));var client=jayson[_0xcc05('0xa')][_0xcc05('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1655e3,_0x313a43,_0x5a6ccc){return new BPromise(function(_0x2cee00,_0x309b06){return client['request'](_0x1655e3,_0x5a6ccc)[_0xcc05('0xc')](function(_0x4f0e09){logger['info'](_0xcc05('0xd'),_0x313a43,_0xcc05('0xe'));logger['debug'](_0xcc05('0xf'),_0x313a43,_0xcc05('0xe'),JSON[_0xcc05('0x10')](_0x4f0e09));if(_0x4f0e09[_0xcc05('0x11')]){if(_0x4f0e09[_0xcc05('0x11')][_0xcc05('0x12')]===0x1f4){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x313a43,_0x4f0e09[_0xcc05('0x11')]['message']);return _0x309b06(_0x4f0e09[_0xcc05('0x11')][_0xcc05('0x13')]);}logger[_0xcc05('0x11')](_0xcc05('0xd'),_0x313a43,_0x4f0e09[_0xcc05('0x11')][_0xcc05('0x13')]);return _0x2cee00(_0x4f0e09[_0xcc05('0x11')][_0xcc05('0x13')]);}else{logger[_0xcc05('0x14')](_0xcc05('0xd'),_0x313a43,'request\x20sent');_0x2cee00(_0x4f0e09[_0xcc05('0x15')][_0xcc05('0x13')]);}})['catch'](function(_0x3e51dc){logger[_0xcc05('0x11')](_0xcc05('0xd'),_0x313a43,_0x3e51dc);_0x309b06(_0x3e51dc);});});}
\ No newline at end of file
+var _0x74c6=['SugarcrmField,\x20%s,\x20%s','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','error','code','message'];(function(_0x57c0b9,_0x58e04a){var _0xe65535=function(_0x130a6b){while(--_0x130a6b){_0x57c0b9['push'](_0x57c0b9['shift']());}};_0xe65535(++_0x58e04a);}(_0x74c6,0x16a));var _0x674c=function(_0x72d336,_0x238cab){_0x72d336=_0x72d336-0x0;var _0x36b2a0=_0x74c6[_0x72d336];return _0x36b2a0;};'use strict';var _=require(_0x674c('0x0'));var util=require(_0x674c('0x1'));var moment=require(_0x674c('0x2'));var BPromise=require('bluebird');var rs=require(_0x674c('0x3'));var fs=require('fs');var Redis=require(_0x674c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x674c('0x5'));var logger=require(_0x674c('0x6'))(_0x674c('0x7'));var config=require(_0x674c('0x8'));var jayson=require(_0x674c('0x9'));var client=jayson['client'][_0x674c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5309e9,_0x30eae1,_0x3cba54){return new BPromise(function(_0x4d5964,_0x526381){return client[_0x674c('0xb')](_0x5309e9,_0x3cba54)[_0x674c('0xc')](function(_0x3a5e1c){logger[_0x674c('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x30eae1,_0x674c('0xe'));logger['debug']('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x30eae1,'request\x20sent',JSON['stringify'](_0x3a5e1c));if(_0x3a5e1c[_0x674c('0xf')]){if(_0x3a5e1c[_0x674c('0xf')][_0x674c('0x10')]===0x1f4){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x30eae1,_0x3a5e1c[_0x674c('0xf')][_0x674c('0x11')]);return _0x526381(_0x3a5e1c[_0x674c('0xf')][_0x674c('0x11')]);}logger[_0x674c('0xf')](_0x674c('0x12'),_0x30eae1,_0x3a5e1c[_0x674c('0xf')][_0x674c('0x11')]);return _0x4d5964(_0x3a5e1c[_0x674c('0xf')][_0x674c('0x11')]);}else{logger[_0x674c('0xd')](_0x674c('0x12'),_0x30eae1,_0x674c('0xe'));_0x4d5964(_0x3a5e1c['result'][_0x674c('0x11')]);}})[_0x674c('0x13')](function(_0x2f1a25){logger[_0x674c('0xf')](_0x674c('0x12'),_0x30eae1,_0x2f1a25);_0x526381(_0x2f1a25);});});}
\ No newline at end of file
index 0f174f4..bb636e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x534d=['/:id','show','getConfigurations','/:id/fields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x534d,0x79));var _0xd534=function(_0x103b67,_0x800ef7){_0x103b67=_0x103b67-0x0;var _0x11650f=_0x534d[_0x103b67];return _0x11650f;};'use strict';var multer=require(_0xd534('0x0'));var util=require(_0xd534('0x1'));var path=require(_0xd534('0x2'));var timeout=require(_0xd534('0x3'));var express=require(_0xd534('0x4'));var router=express[_0xd534('0x5')]();var fs_extra=require(_0xd534('0x6'));var auth=require(_0xd534('0x7'));var interaction=require(_0xd534('0x8'));var config=require(_0xd534('0x9'));var controller=require(_0xd534('0xa'));router[_0xd534('0xb')]('/',auth[_0xd534('0xc')](),controller[_0xd534('0xd')]);router[_0xd534('0xb')](_0xd534('0xe'),auth[_0xd534('0xc')](),controller[_0xd534('0xf')]);router[_0xd534('0xb')]('/:id/configurations',auth[_0xd534('0xc')](),controller[_0xd534('0x10')]);router[_0xd534('0xb')](_0xd534('0x11'),auth[_0xd534('0xc')](),controller['getFields']);router[_0xd534('0x12')]('/',auth[_0xd534('0xc')](),controller[_0xd534('0x13')]);router[_0xd534('0x12')](_0xd534('0x14'),auth[_0xd534('0xc')](),controller[_0xd534('0x15')]);router[_0xd534('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xd534('0x17')]);router[_0xd534('0x18')](_0xd534('0xe'),auth[_0xd534('0xc')](),controller[_0xd534('0x19')]);module[_0xd534('0x1a')]=router;
\ No newline at end of file
+var _0x7531=['../../config/environment','./intVtigerAccount.controller','isAuthenticated','index','get','/:id','show','getConfigurations','/:id/fields','getFields','create','post','/:id/configurations','addConfiguration','put','update','exports','multer','util','path','fs-extra','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7531,0x69));var _0x1753=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x7531[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x1753('0x0'));var util=require(_0x1753('0x1'));var path=require(_0x1753('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x1753('0x3'));var auth=require(_0x1753('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1753('0x5'));var controller=require(_0x1753('0x6'));router['get']('/',auth[_0x1753('0x7')](),controller[_0x1753('0x8')]);router[_0x1753('0x9')](_0x1753('0xa'),auth[_0x1753('0x7')](),controller[_0x1753('0xb')]);router[_0x1753('0x9')]('/:id/configurations',auth[_0x1753('0x7')](),controller[_0x1753('0xc')]);router[_0x1753('0x9')](_0x1753('0xd'),auth[_0x1753('0x7')](),controller[_0x1753('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1753('0xf')]);router[_0x1753('0x10')](_0x1753('0x11'),auth[_0x1753('0x7')](),controller[_0x1753('0x12')]);router[_0x1753('0x13')](_0x1753('0xa'),auth[_0x1753('0x7')](),controller[_0x1753('0x14')]);router['delete'](_0x1753('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x1753('0x15')]=router;
\ No newline at end of file
index 6d8eeff..106a895 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61b6=['exports','STRING'];(function(_0x2300f2,_0x315c5f){var _0x6bd508=function(_0x2fa0f6){while(--_0x2fa0f6){_0x2300f2['push'](_0x2300f2['shift']());}};_0x6bd508(++_0x315c5f);}(_0x61b6,0x106));var _0x661b=function(_0x595c09,_0x5c53fe){_0x595c09=_0x595c09-0x0;var _0xaac9e=_0x61b6[_0x595c09];return _0xaac9e;};'use strict';var Sequelize=require('sequelize');module[_0x661b('0x0')]={'name':{'type':Sequelize[_0x661b('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x661b('0x1')]},'username':{'type':Sequelize[_0x661b('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x661b('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0x83aa=['exports','STRING','HelpDesk','sequelize'];(function(_0xbd0c3d,_0x1f4957){var _0x53e1ff=function(_0x5aa9ff){while(--_0x5aa9ff){_0xbd0c3d['push'](_0xbd0c3d['shift']());}};_0x53e1ff(++_0x1f4957);}(_0x83aa,0x8f));var _0xa83a=function(_0x27ea81,_0x12a73f){_0x27ea81=_0x27ea81-0x0;var _0x57ccc0=_0x83aa[_0x27ea81];return _0x57ccc0;};'use strict';var Sequelize=require(_0xa83a('0x0'));module[_0xa83a('0x1')]={'name':{'type':Sequelize[_0xa83a('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0xa83a('0x2')],'allowNull':![],'defaultValue':_0xa83a('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0xa83a('0x2')],'allowNull':![]}};
\ No newline at end of file
index a6173c9..5fd7e28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc2e=['login','result','token','success','describe','sessionName','reference','remove','includes','false','label','startsWith','cf_','picklist','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../components/integrations/configuration','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','sendStatus','error','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','keys','find','create','catch','update','body','params','destroy','getConfigurations','findOne','VtigerConfiguration','nolimit','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','VtigerField','md5','getFields','moduleName','remoteUri','username','accessKey','slice','substring','format','%s/webservice.php','GET','getchallenge','POST'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdc2e,0x89));var _0xedc2=function(_0x120b23,_0xb9810f){_0x120b23=_0x120b23-0x0;var _0x2958eb=_0xdc2e[_0x120b23];return _0x2958eb;};'use strict';var emlformat=require(_0xedc2('0x0'));var rimraf=require(_0xedc2('0x1'));var zipdir=require(_0xedc2('0x2'));var jsonpatch=require(_0xedc2('0x3'));var rp=require(_0xedc2('0x4'));var moment=require(_0xedc2('0x5'));var BPromise=require(_0xedc2('0x6'));var Mustache=require(_0xedc2('0x7'));var util=require('util');var path=require(_0xedc2('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xedc2('0x9'));var fs=require('fs');var fs_extra=require(_0xedc2('0xa'));var _=require(_0xedc2('0xb'));var squel=require(_0xedc2('0xc'));var crypto=require('crypto');var jsforce=require(_0xedc2('0xd'));var deskjs=require(_0xedc2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xedc2('0xf'));var Papa=require(_0xedc2('0x10'));var Redis=require(_0xedc2('0x11'));var authService=require(_0xedc2('0x12'));var qs=require(_0xedc2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xedc2('0x14'));var logger=require(_0xedc2('0x15'))('api');var utils=require(_0xedc2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xedc2('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xedc2('0x18'));function respondWithStatusCode(_0x2a0cf2,_0x233f68){_0x233f68=_0x233f68||0xcc;return function(_0x1b1b39){if(_0x1b1b39){return _0x2a0cf2['sendStatus'](_0x233f68);}return _0x2a0cf2['status'](_0x233f68)['end']();};}function respondWithResult(_0x7dbdfa,_0x1aef68){_0x1aef68=_0x1aef68||0xc8;return function(_0x4c5004){if(_0x4c5004){return _0x7dbdfa[_0xedc2('0x19')](_0x1aef68)['json'](_0x4c5004);}};}function respondWithFilteredResult(_0x1e8522,_0x42f72c){return function(_0xf8c2d4){if(_0xf8c2d4){var _0x588e47=typeof _0x42f72c[_0xedc2('0x1a')]===_0xedc2('0x1b')&&typeof _0x42f72c[_0xedc2('0x1c')]==='undefined';var _0x454906=_0xf8c2d4[_0xedc2('0x1d')];var _0x948d88=_0x588e47?0x0:_0x42f72c[_0xedc2('0x1a')];var _0x295fb6=_0x588e47?_0xf8c2d4[_0xedc2('0x1d')]:_0x42f72c[_0xedc2('0x1a')]+_0x42f72c[_0xedc2('0x1c')];var _0x522349;if(_0x295fb6>=_0x454906){_0x295fb6=_0x454906;_0x522349=0xc8;}else{_0x522349=0xce;}_0x1e8522[_0xedc2('0x19')](_0x522349);return _0x1e8522[_0xedc2('0x1e')](_0xedc2('0x1f'),_0x948d88+'-'+_0x295fb6+'/'+_0x454906)['json'](_0xf8c2d4);}return null;};}function patchUpdates(_0x4592f3){return function(_0x4a3dbe){try{jsonpatch[_0xedc2('0x20')](_0x4a3dbe,_0x4592f3,!![]);}catch(_0x3a1c97){return BPromise[_0xedc2('0x21')](_0x3a1c97);}return _0x4a3dbe[_0xedc2('0x22')]();};}function saveUpdates(_0x418902,_0x10c364){return function(_0x2ec0d0){if(_0x2ec0d0){return _0x2ec0d0['update'](_0x418902)[_0xedc2('0x23')](function(_0x2605f7){return _0x2605f7;});}return null;};}function removeEntity(_0x1070b2,_0x437873){return function(_0x5956d2){if(_0x5956d2){return _0x5956d2['destroy']()['then'](function(){_0x1070b2[_0xedc2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c3531,_0xfb5462){return function(_0xfef468){if(!_0xfef468){_0x2c3531[_0xedc2('0x24')](0x194);}return _0xfef468;};}function handleError(_0x342a1f,_0x26a365){_0x26a365=_0x26a365||0x1f4;return function(_0x32c261){logger[_0xedc2('0x25')](_0x32c261['stack']);if(_0x32c261[_0xedc2('0x26')]){delete _0x32c261['name'];}_0x342a1f[_0xedc2('0x19')](_0x26a365)[_0xedc2('0x27')](_0x32c261);};}exports[_0xedc2('0x28')]=function(_0x368ba0,_0x70add5){var _0x3e073c={},_0x586514={},_0x8cb1b4={'count':0x0,'rows':[]};var _0x32d3ce=_[_0xedc2('0x29')](db[_0xedc2('0x2a')][_0xedc2('0x2b')],function(_0x156919){return{'name':_0x156919[_0xedc2('0x2c')],'type':_0x156919[_0xedc2('0x2d')][_0xedc2('0x2e')]};});_0x586514[_0xedc2('0x2f')]=_[_0xedc2('0x29')](_0x32d3ce,_0xedc2('0x26'));_0x586514[_0xedc2('0x30')]=_['keys'](_0x368ba0['query']);_0x586514['filters']=_['intersection'](_0x586514[_0xedc2('0x2f')],_0x586514[_0xedc2('0x30')]);_0x3e073c[_0xedc2('0x31')]=_[_0xedc2('0x32')](_0x586514[_0xedc2('0x2f')],qs[_0xedc2('0x33')](_0x368ba0[_0xedc2('0x30')]['fields']));_0x3e073c['attributes']=_0x3e073c['attributes'][_0xedc2('0x34')]?_0x3e073c[_0xedc2('0x31')]:_0x586514['model'];if(!_0x368ba0[_0xedc2('0x30')][_0xedc2('0x35')]('nolimit')){_0x3e073c[_0xedc2('0x1c')]=qs['limit'](_0x368ba0[_0xedc2('0x30')][_0xedc2('0x1c')]);_0x3e073c[_0xedc2('0x1a')]=qs[_0xedc2('0x1a')](_0x368ba0[_0xedc2('0x30')]['offset']);}_0x3e073c[_0xedc2('0x36')]=qs[_0xedc2('0x37')](_0x368ba0[_0xedc2('0x30')][_0xedc2('0x37')]);_0x3e073c[_0xedc2('0x38')]=qs[_0xedc2('0x39')](_[_0xedc2('0x3a')](_0x368ba0[_0xedc2('0x30')],_0x586514[_0xedc2('0x39')]),_0x32d3ce);if(_0x368ba0[_0xedc2('0x30')][_0xedc2('0x3b')]){_0x3e073c[_0xedc2('0x38')]=_['merge'](_0x3e073c[_0xedc2('0x38')],{'$or':_[_0xedc2('0x29')](_0x32d3ce,function(_0x35c25e){if(_0x35c25e[_0xedc2('0x2d')]!=='VIRTUAL'){var _0x2a5d15={};_0x2a5d15[_0x35c25e[_0xedc2('0x26')]]={'$like':'%'+_0x368ba0[_0xedc2('0x30')][_0xedc2('0x3b')]+'%'};return _0x2a5d15;}})});}_0x3e073c=_[_0xedc2('0x3c')]({},_0x3e073c,_0x368ba0[_0xedc2('0x3d')]);var _0x2f8f8d={'where':_0x3e073c['where']};return db['VtigerAccount'][_0xedc2('0x1d')](_0x2f8f8d)[_0xedc2('0x23')](function(_0x3239b6){_0x8cb1b4[_0xedc2('0x1d')]=_0x3239b6;if(_0x368ba0['query'][_0xedc2('0x3e')]){_0x3e073c[_0xedc2('0x3f')]=[{'all':!![]}];}return db[_0xedc2('0x2a')][_0xedc2('0x40')](_0x3e073c);})['then'](function(_0x342b49){_0x8cb1b4[_0xedc2('0x41')]=_0x342b49;return _0x8cb1b4;})['then'](respondWithFilteredResult(_0x70add5,_0x3e073c))['catch'](handleError(_0x70add5,null));};exports['show']=function(_0x10ed67,_0x93900d){var _0x5e23cd={'raw':![],'where':{'id':_0x10ed67['params']['id']}},_0x323b28={};_0x323b28['model']=_[_0xedc2('0x42')](db[_0xedc2('0x2a')][_0xedc2('0x2b')]);_0x323b28[_0xedc2('0x30')]=_[_0xedc2('0x42')](_0x10ed67[_0xedc2('0x30')]);_0x323b28[_0xedc2('0x39')]=_[_0xedc2('0x32')](_0x323b28[_0xedc2('0x2f')],_0x323b28['query']);_0x5e23cd[_0xedc2('0x31')]=_[_0xedc2('0x32')](_0x323b28[_0xedc2('0x2f')],qs[_0xedc2('0x33')](_0x10ed67['query'][_0xedc2('0x33')]));_0x5e23cd[_0xedc2('0x31')]=_0x5e23cd[_0xedc2('0x31')]['length']?_0x5e23cd[_0xedc2('0x31')]:_0x323b28[_0xedc2('0x2f')];if(_0x10ed67[_0xedc2('0x30')][_0xedc2('0x3e')]){_0x5e23cd[_0xedc2('0x3f')]=[{'all':!![]}];}_0x5e23cd=_[_0xedc2('0x3c')]({},_0x5e23cd,_0x10ed67[_0xedc2('0x3d')]);return db[_0xedc2('0x2a')][_0xedc2('0x43')](_0x5e23cd)['then'](handleEntityNotFound(_0x93900d,null))['then'](respondWithResult(_0x93900d,null))['catch'](handleError(_0x93900d,null));};exports['create']=function(_0x4002a7,_0x49c18f){return db[_0xedc2('0x2a')][_0xedc2('0x44')](_0x4002a7['body'],{})[_0xedc2('0x23')](respondWithResult(_0x49c18f,0xc9))[_0xedc2('0x45')](handleError(_0x49c18f,null));};exports[_0xedc2('0x46')]=function(_0x39ac0c,_0x2244dc){if(_0x39ac0c[_0xedc2('0x47')]['id']){delete _0x39ac0c['body']['id'];}return db[_0xedc2('0x2a')]['find']({'where':{'id':_0x39ac0c[_0xedc2('0x48')]['id']}})[_0xedc2('0x23')](handleEntityNotFound(_0x2244dc,null))[_0xedc2('0x23')](saveUpdates(_0x39ac0c[_0xedc2('0x47')],null))['then'](respondWithResult(_0x2244dc,null))['catch'](handleError(_0x2244dc,null));};exports[_0xedc2('0x49')]=function(_0x5e5f31,_0x2abb9c){return db[_0xedc2('0x2a')][_0xedc2('0x43')]({'where':{'id':_0x5e5f31[_0xedc2('0x48')]['id']}})['then'](handleEntityNotFound(_0x2abb9c,null))[_0xedc2('0x23')](removeEntity(_0x2abb9c,null))['catch'](handleError(_0x2abb9c,null));};exports[_0xedc2('0x4a')]=function(_0x4149a6,_0x1b4a32,_0x1bf26c){var _0x8a2cc0={};var _0x2c0852={};var _0x3427c6;var _0x1116d9;return db[_0xedc2('0x2a')][_0xedc2('0x4b')]({'where':{'id':_0x4149a6[_0xedc2('0x48')]['id']}})[_0xedc2('0x23')](handleEntityNotFound(_0x1b4a32,null))[_0xedc2('0x23')](function(_0xf0dc64){if(_0xf0dc64){_0x3427c6=_0xf0dc64;_0x2c0852[_0xedc2('0x2f')]=_[_0xedc2('0x42')](db[_0xedc2('0x4c')]['rawAttributes']);_0x2c0852[_0xedc2('0x30')]=_[_0xedc2('0x42')](_0x4149a6[_0xedc2('0x30')]);_0x2c0852[_0xedc2('0x39')]=_['intersection'](_0x2c0852[_0xedc2('0x2f')],_0x2c0852[_0xedc2('0x30')]);_0x8a2cc0[_0xedc2('0x31')]=_[_0xedc2('0x32')](_0x2c0852[_0xedc2('0x2f')],qs[_0xedc2('0x33')](_0x4149a6[_0xedc2('0x30')]['fields']));_0x8a2cc0[_0xedc2('0x31')]=_0x8a2cc0[_0xedc2('0x31')]['length']?_0x8a2cc0[_0xedc2('0x31')]:_0x2c0852[_0xedc2('0x2f')];_0x8a2cc0[_0xedc2('0x36')]=qs[_0xedc2('0x37')](_0x4149a6[_0xedc2('0x30')][_0xedc2('0x37')]);_0x8a2cc0[_0xedc2('0x38')]=qs['filters'](_[_0xedc2('0x3a')](_0x4149a6[_0xedc2('0x30')],_0x2c0852[_0xedc2('0x39')]));if(_0x4149a6[_0xedc2('0x30')][_0xedc2('0x3b')]){_0x8a2cc0[_0xedc2('0x38')]=_[_0xedc2('0x3c')](_0x8a2cc0[_0xedc2('0x38')],{'$or':_[_0xedc2('0x29')](_0x8a2cc0['attributes'],function(_0x2ec907){var _0x1dc9b4={};_0x1dc9b4[_0x2ec907]={'$like':'%'+_0x4149a6[_0xedc2('0x30')]['filter']+'%'};return _0x1dc9b4;})});}_0x8a2cc0=_[_0xedc2('0x3c')]({},_0x8a2cc0,_0x4149a6[_0xedc2('0x3d')]);return _0x3427c6['getConfigurations'](_0x8a2cc0);}})[_0xedc2('0x23')](function(_0x36611b){if(_0x36611b){_0x1116d9=_0x36611b[_0xedc2('0x34')];if(!_0x4149a6[_0xedc2('0x30')][_0xedc2('0x35')](_0xedc2('0x4d'))){_0x8a2cc0[_0xedc2('0x1c')]=qs[_0xedc2('0x1c')](_0x4149a6[_0xedc2('0x30')]['limit']);_0x8a2cc0['offset']=qs[_0xedc2('0x1a')](_0x4149a6[_0xedc2('0x30')][_0xedc2('0x1a')]);}return _0x3427c6[_0xedc2('0x4a')](_0x8a2cc0);}})[_0xedc2('0x23')](function(_0x3c111e){if(_0x3c111e){return _0x3c111e?{'count':_0x1116d9,'rows':_0x3c111e}:null;}})[_0xedc2('0x23')](respondWithResult(_0x1b4a32,null))['catch'](handleError(_0x1b4a32,null));};exports[_0xedc2('0x4e')]=function(_0x696fd8,_0x889ac4,_0x4165a8){if(_0x696fd8['body']['id']){delete _0x696fd8[_0xedc2('0x47')]['id'];}return db['VtigerAccount'][_0xedc2('0x4b')]({'where':{'id':_0x696fd8[_0xedc2('0x48')]['id']}})[_0xedc2('0x23')](handleEntityNotFound(_0x889ac4,null))[_0xedc2('0x23')](function(_0x6c8996){if(_0x6c8996){_0x696fd8[_0xedc2('0x47')][_0xedc2('0x4f')]=_0x6c8996['id'];_0x696fd8[_0xedc2('0x47')][_0xedc2('0x50')]=integrations[_0xedc2('0x51')](_0x696fd8[_0xedc2('0x47')]['channel'],_0x696fd8[_0xedc2('0x47')][_0xedc2('0x2d')]);_0x696fd8[_0xedc2('0x47')][_0xedc2('0x52')]=integrations[_0xedc2('0x53')](_0x696fd8['body'][_0xedc2('0x54')],_0x696fd8[_0xedc2('0x47')][_0xedc2('0x2d')]);return db['VtigerConfiguration'][_0xedc2('0x44')](_0x696fd8['body'],{'include':[{'model':db[_0xedc2('0x55')],'as':_0xedc2('0x50')},{'model':db[_0xedc2('0x55')],'as':'Descriptions'}]});}return null;})[_0xedc2('0x23')](respondWithResult(_0x889ac4,null))['catch'](handleError(_0x889ac4,null));};var md5=require(_0xedc2('0x56'));exports[_0xedc2('0x57')]=function(_0x37dddf,_0x5a87e7,_0x543446){var _0x41030b=null;var _0x199672=null;var _0x5d0da4=null;var _0x3f604b=null;var _0xe56c71='';return db[_0xedc2('0x2a')][_0xedc2('0x4b')]({'where':{'id':_0x37dddf[_0xedc2('0x48')]['id']},'attributes':['id',_0xedc2('0x26'),'username','description',_0xedc2('0x58'),_0xedc2('0x59'),'serverUrl','accessKey']})['then'](handleEntityNotFound(_0x5a87e7,null))[_0xedc2('0x23')](function(_0x1fe068){if(_0x1fe068){_0x41030b=_0x1fe068[_0xedc2('0x5a')];_0x199672=_0x1fe068[_0xedc2('0x5b')];_0x5d0da4=_0x1fe068[_0xedc2('0x58')];_0xe56c71=_0x1fe068[_0xedc2('0x59')];var _0x1faf3f=_0xe56c71[_0xedc2('0x5c')](-0x1);if(_0x1faf3f==='/'){_0xe56c71=_0xe56c71[_0xedc2('0x5d')](0x0,_0xe56c71['lastIndexOf'](_0x1faf3f));}_0x3f604b=util[_0xedc2('0x5e')](_0xedc2('0x5f'),_0xe56c71);var _0x4ae0ba={'method':_0xedc2('0x60'),'uri':_0x3f604b,'qs':{'operation':_0xedc2('0x61'),'username':_0x1fe068[_0xedc2('0x5a')]},'json':!![]};return rp(_0x4ae0ba);}})[_0xedc2('0x23')](function(_0x1e0fcc){if(_0x1e0fcc['success']){var _0x3f7a2b={'method':_0xedc2('0x62'),'uri':_0x3f604b,'form':{'operation':_0xedc2('0x63'),'username':_0x41030b,'accessKey':md5(_0x1e0fcc[_0xedc2('0x64')][_0xedc2('0x65')]+_0x199672)},'json':!![]};return rp(_0x3f7a2b);}})['then'](function(_0x1b734a){if(_0x1b734a[_0xedc2('0x66')]){var _0x2a37dd={'method':_0xedc2('0x60'),'uri':_0x3f604b,'qs':{'operation':_0xedc2('0x67'),'username':_0x41030b,'sessionName':_0x1b734a[_0xedc2('0x64')][_0xedc2('0x68')],'elementType':_0x5d0da4},'json':!![]};return rp(_0x2a37dd);}})[_0xedc2('0x23')](function(_0x35520b){if(_0x35520b[_0xedc2('0x66')]){var _0x46d0e1=['autogenerated',_0xedc2('0x69'),'owner'];_[_0xedc2('0x6a')](_0x35520b[_0xedc2('0x64')][_0xedc2('0x33')],function(_0x5d70ef){return _0x46d0e1[_0xedc2('0x6b')](_0x5d70ef[_0xedc2('0x2d')][_0xedc2('0x26')]);});_[_0xedc2('0x6a')](_0x35520b['result']['fields'],function(_0x114758){return _0x114758['editable']===_0xedc2('0x6c');});return{'count':_0x35520b[_0xedc2('0x64')]['fields']['length'],'rows':_[_0xedc2('0x29')](_0x35520b[_0xedc2('0x64')][_0xedc2('0x33')],function(_0x1d3969){return{'id':_0x1d3969[_0xedc2('0x26')],'name':_0x1d3969[_0xedc2('0x6d')],'custom':_[_0xedc2('0x6e')](_0x1d3969[_0xedc2('0x26')],_0xedc2('0x6f'))?!![]:![],'options':_0x1d3969[_0xedc2('0x2d')][_0xedc2('0x26')]===_0xedc2('0x70')&&_0x1d3969['type']['picklistValues'][_0xedc2('0x34')]>0x0?_[_0xedc2('0x29')](_0x1d3969[_0xedc2('0x2d')]['picklistValues'],function(_0x43ba0d){return{'name':_0x43ba0d[_0xedc2('0x6d')],'value':_0x43ba0d['value']};}):[]};})};}})['then'](respondWithResult(_0x5a87e7,null))[_0xedc2('0x45')](function(_0x42accd){console['log'](_0xedc2('0x71')+_0x42accd);var _0x75bbbb=_0x37dddf['query']['test']?0x1f4:_0x42accd[_0xedc2('0x72')]||0x1f4;logger[_0xedc2('0x25')](_0xedc2('0x73'),_0xedc2('0x57'),_0x75bbbb,JSON[_0xedc2('0x74')](_0x42accd));delete _0x42accd[_0xedc2('0x26')];if(_0x75bbbb===0x191){_0x75bbbb=0x190;}_0x5a87e7[_0xedc2('0x19')](_0x75bbbb)[_0xedc2('0x27')](_0x37dddf[_0xedc2('0x30')][_0xedc2('0x75')]?{'message':'Wrong\x20credentials','statusCode':_0x42accd[_0xedc2('0x72')]}:_0x42accd);});};
\ No newline at end of file
+var _0xc06e=['attributes','fields','length','hasOwnProperty','nolimit','where','merge','VIRTUAL','filter','options','include','findAll','show','keys','includeAll','find','catch','create','body','params','findOne','VtigerConfiguration','order','sort','pick','getConfigurations','Subjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','moduleName','remoteUri','accessKey','substring','format','GET','success','POST','login','result','describe','remove','includes','editable','label','startsWith','cf_','picklist','picklistValues','vTiger\x20error:\x20','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','sendStatus','error','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','model','query','filters','intersection'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc06e,0x1e6));var _0xec06=function(_0x512c83,_0x42a67a){_0x512c83=_0x512c83-0x0;var _0x1f7f25=_0xc06e[_0x512c83];return _0x1f7f25;};'use strict';var emlformat=require(_0xec06('0x0'));var rimraf=require(_0xec06('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xec06('0x2'));var rp=require(_0xec06('0x3'));var moment=require('moment');var BPromise=require(_0xec06('0x4'));var Mustache=require('mustache');var util=require(_0xec06('0x5'));var path=require('path');var sox=require(_0xec06('0x6'));var csv=require(_0xec06('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xec06('0x8'));var squel=require(_0xec06('0x9'));var crypto=require(_0xec06('0xa'));var jsforce=require(_0xec06('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xec06('0xc'));var Redis=require(_0xec06('0xd'));var authService=require(_0xec06('0xe'));var qs=require(_0xec06('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xec06('0x10'));var logger=require(_0xec06('0x11'))('api');var utils=require(_0xec06('0x12'));var config=require(_0xec06('0x13'));var licenseUtil=require(_0xec06('0x14'));var db=require('../../mysqldb')['db'];var integrations=require(_0xec06('0x15'));function respondWithStatusCode(_0x1541ed,_0x52f383){_0x52f383=_0x52f383||0xcc;return function(_0x488bc9){if(_0x488bc9){return _0x1541ed['sendStatus'](_0x52f383);}return _0x1541ed[_0xec06('0x16')](_0x52f383)[_0xec06('0x17')]();};}function respondWithResult(_0x4fd410,_0x5103a1){_0x5103a1=_0x5103a1||0xc8;return function(_0x1d7489){if(_0x1d7489){return _0x4fd410[_0xec06('0x16')](_0x5103a1)[_0xec06('0x18')](_0x1d7489);}};}function respondWithFilteredResult(_0x34b274,_0x5e3e31){return function(_0x533b63){if(_0x533b63){var _0x35fd9f=typeof _0x5e3e31[_0xec06('0x19')]==='undefined'&&typeof _0x5e3e31[_0xec06('0x1a')]===_0xec06('0x1b');var _0x42d353=_0x533b63[_0xec06('0x1c')];var _0x5a75f3=_0x35fd9f?0x0:_0x5e3e31[_0xec06('0x19')];var _0x440dd9=_0x35fd9f?_0x533b63[_0xec06('0x1c')]:_0x5e3e31[_0xec06('0x19')]+_0x5e3e31[_0xec06('0x1a')];var _0x5c8898;if(_0x440dd9>=_0x42d353){_0x440dd9=_0x42d353;_0x5c8898=0xc8;}else{_0x5c8898=0xce;}_0x34b274[_0xec06('0x16')](_0x5c8898);return _0x34b274['set'](_0xec06('0x1d'),_0x5a75f3+'-'+_0x440dd9+'/'+_0x42d353)['json'](_0x533b63);}return null;};}function patchUpdates(_0x1caa3f){return function(_0x255ff){try{jsonpatch[_0xec06('0x1e')](_0x255ff,_0x1caa3f,!![]);}catch(_0x444586){return BPromise[_0xec06('0x1f')](_0x444586);}return _0x255ff['save']();};}function saveUpdates(_0x1e134f,_0xcbdf00){return function(_0x4acb22){if(_0x4acb22){return _0x4acb22[_0xec06('0x20')](_0x1e134f)[_0xec06('0x21')](function(_0x3098a5){return _0x3098a5;});}return null;};}function removeEntity(_0x2500eb,_0x589d60){return function(_0x5b3e97){if(_0x5b3e97){return _0x5b3e97[_0xec06('0x22')]()[_0xec06('0x21')](function(){_0x2500eb[_0xec06('0x16')](0xcc)[_0xec06('0x17')]();});}};}function handleEntityNotFound(_0x1ca5a7,_0x41210a){return function(_0x13ae1a){if(!_0x13ae1a){_0x1ca5a7[_0xec06('0x23')](0x194);}return _0x13ae1a;};}function handleError(_0x30529d,_0xd9daa5){_0xd9daa5=_0xd9daa5||0x1f4;return function(_0x4ef5d7){logger[_0xec06('0x24')](_0x4ef5d7['stack']);if(_0x4ef5d7['name']){delete _0x4ef5d7[_0xec06('0x25')];}_0x30529d[_0xec06('0x16')](_0xd9daa5)[_0xec06('0x26')](_0x4ef5d7);};}exports[_0xec06('0x27')]=function(_0x4d9381,_0x360cdc){var _0x593cab={},_0x2da2ce={},_0x4b5d39={'count':0x0,'rows':[]};var _0x26e633=_[_0xec06('0x28')](db[_0xec06('0x29')][_0xec06('0x2a')],function(_0x295a3c){return{'name':_0x295a3c[_0xec06('0x2b')],'type':_0x295a3c[_0xec06('0x2c')]['key']};});_0x2da2ce[_0xec06('0x2d')]=_[_0xec06('0x28')](_0x26e633,'name');_0x2da2ce[_0xec06('0x2e')]=_['keys'](_0x4d9381[_0xec06('0x2e')]);_0x2da2ce[_0xec06('0x2f')]=_[_0xec06('0x30')](_0x2da2ce['model'],_0x2da2ce['query']);_0x593cab[_0xec06('0x31')]=_[_0xec06('0x30')](_0x2da2ce['model'],qs[_0xec06('0x32')](_0x4d9381[_0xec06('0x2e')][_0xec06('0x32')]));_0x593cab[_0xec06('0x31')]=_0x593cab['attributes'][_0xec06('0x33')]?_0x593cab['attributes']:_0x2da2ce[_0xec06('0x2d')];if(!_0x4d9381[_0xec06('0x2e')][_0xec06('0x34')](_0xec06('0x35'))){_0x593cab[_0xec06('0x1a')]=qs[_0xec06('0x1a')](_0x4d9381[_0xec06('0x2e')][_0xec06('0x1a')]);_0x593cab['offset']=qs[_0xec06('0x19')](_0x4d9381[_0xec06('0x2e')][_0xec06('0x19')]);}_0x593cab['order']=qs['sort'](_0x4d9381[_0xec06('0x2e')]['sort']);_0x593cab[_0xec06('0x36')]=qs[_0xec06('0x2f')](_['pick'](_0x4d9381[_0xec06('0x2e')],_0x2da2ce[_0xec06('0x2f')]),_0x26e633);if(_0x4d9381[_0xec06('0x2e')]['filter']){_0x593cab[_0xec06('0x36')]=_[_0xec06('0x37')](_0x593cab[_0xec06('0x36')],{'$or':_[_0xec06('0x28')](_0x26e633,function(_0x5cb295){if(_0x5cb295[_0xec06('0x2c')]!==_0xec06('0x38')){var _0x50f74f={};_0x50f74f[_0x5cb295[_0xec06('0x25')]]={'$like':'%'+_0x4d9381[_0xec06('0x2e')][_0xec06('0x39')]+'%'};return _0x50f74f;}})});}_0x593cab=_['merge']({},_0x593cab,_0x4d9381[_0xec06('0x3a')]);var _0x4aa141={'where':_0x593cab[_0xec06('0x36')]};return db['VtigerAccount'][_0xec06('0x1c')](_0x4aa141)['then'](function(_0x77094d){_0x4b5d39[_0xec06('0x1c')]=_0x77094d;if(_0x4d9381[_0xec06('0x2e')]['includeAll']){_0x593cab[_0xec06('0x3b')]=[{'all':!![]}];}return db[_0xec06('0x29')][_0xec06('0x3c')](_0x593cab);})[_0xec06('0x21')](function(_0xa09010){_0x4b5d39['rows']=_0xa09010;return _0x4b5d39;})['then'](respondWithFilteredResult(_0x360cdc,_0x593cab))['catch'](handleError(_0x360cdc,null));};exports[_0xec06('0x3d')]=function(_0x127b91,_0xf0e13f){var _0x4c4eb2={'raw':![],'where':{'id':_0x127b91['params']['id']}},_0x1abcff={};_0x1abcff['model']=_[_0xec06('0x3e')](db[_0xec06('0x29')][_0xec06('0x2a')]);_0x1abcff[_0xec06('0x2e')]=_['keys'](_0x127b91[_0xec06('0x2e')]);_0x1abcff['filters']=_[_0xec06('0x30')](_0x1abcff[_0xec06('0x2d')],_0x1abcff[_0xec06('0x2e')]);_0x4c4eb2[_0xec06('0x31')]=_[_0xec06('0x30')](_0x1abcff[_0xec06('0x2d')],qs[_0xec06('0x32')](_0x127b91[_0xec06('0x2e')][_0xec06('0x32')]));_0x4c4eb2[_0xec06('0x31')]=_0x4c4eb2[_0xec06('0x31')]['length']?_0x4c4eb2['attributes']:_0x1abcff[_0xec06('0x2d')];if(_0x127b91[_0xec06('0x2e')][_0xec06('0x3f')]){_0x4c4eb2[_0xec06('0x3b')]=[{'all':!![]}];}_0x4c4eb2=_[_0xec06('0x37')]({},_0x4c4eb2,_0x127b91[_0xec06('0x3a')]);return db[_0xec06('0x29')][_0xec06('0x40')](_0x4c4eb2)[_0xec06('0x21')](handleEntityNotFound(_0xf0e13f,null))[_0xec06('0x21')](respondWithResult(_0xf0e13f,null))[_0xec06('0x41')](handleError(_0xf0e13f,null));};exports[_0xec06('0x42')]=function(_0x5cfc72,_0x16992f){return db['VtigerAccount']['create'](_0x5cfc72['body'],{})[_0xec06('0x21')](respondWithResult(_0x16992f,0xc9))[_0xec06('0x41')](handleError(_0x16992f,null));};exports[_0xec06('0x20')]=function(_0x3dbd5f,_0x10d344){if(_0x3dbd5f[_0xec06('0x43')]['id']){delete _0x3dbd5f['body']['id'];}return db['VtigerAccount']['find']({'where':{'id':_0x3dbd5f[_0xec06('0x44')]['id']}})[_0xec06('0x21')](handleEntityNotFound(_0x10d344,null))['then'](saveUpdates(_0x3dbd5f[_0xec06('0x43')],null))[_0xec06('0x21')](respondWithResult(_0x10d344,null))[_0xec06('0x41')](handleError(_0x10d344,null));};exports[_0xec06('0x22')]=function(_0x437336,_0x353b28){return db[_0xec06('0x29')][_0xec06('0x40')]({'where':{'id':_0x437336[_0xec06('0x44')]['id']}})[_0xec06('0x21')](handleEntityNotFound(_0x353b28,null))[_0xec06('0x21')](removeEntity(_0x353b28,null))[_0xec06('0x41')](handleError(_0x353b28,null));};exports['getConfigurations']=function(_0x28ecae,_0x403a61,_0x4823dc){var _0x703588={};var _0x4ccd5f={};var _0x4ffc9b;var _0x39de9b;return db[_0xec06('0x29')][_0xec06('0x45')]({'where':{'id':_0x28ecae[_0xec06('0x44')]['id']}})['then'](handleEntityNotFound(_0x403a61,null))[_0xec06('0x21')](function(_0x1f7338){if(_0x1f7338){_0x4ffc9b=_0x1f7338;_0x4ccd5f[_0xec06('0x2d')]=_[_0xec06('0x3e')](db[_0xec06('0x46')][_0xec06('0x2a')]);_0x4ccd5f[_0xec06('0x2e')]=_['keys'](_0x28ecae[_0xec06('0x2e')]);_0x4ccd5f[_0xec06('0x2f')]=_[_0xec06('0x30')](_0x4ccd5f[_0xec06('0x2d')],_0x4ccd5f[_0xec06('0x2e')]);_0x703588[_0xec06('0x31')]=_['intersection'](_0x4ccd5f['model'],qs[_0xec06('0x32')](_0x28ecae[_0xec06('0x2e')][_0xec06('0x32')]));_0x703588[_0xec06('0x31')]=_0x703588['attributes'][_0xec06('0x33')]?_0x703588[_0xec06('0x31')]:_0x4ccd5f['model'];_0x703588[_0xec06('0x47')]=qs[_0xec06('0x48')](_0x28ecae[_0xec06('0x2e')][_0xec06('0x48')]);_0x703588['where']=qs[_0xec06('0x2f')](_[_0xec06('0x49')](_0x28ecae[_0xec06('0x2e')],_0x4ccd5f['filters']));if(_0x28ecae['query'][_0xec06('0x39')]){_0x703588[_0xec06('0x36')]=_[_0xec06('0x37')](_0x703588['where'],{'$or':_['map'](_0x703588[_0xec06('0x31')],function(_0x3c305d){var _0x35fbaf={};_0x35fbaf[_0x3c305d]={'$like':'%'+_0x28ecae[_0xec06('0x2e')][_0xec06('0x39')]+'%'};return _0x35fbaf;})});}_0x703588=_[_0xec06('0x37')]({},_0x703588,_0x28ecae[_0xec06('0x3a')]);return _0x4ffc9b['getConfigurations'](_0x703588);}})[_0xec06('0x21')](function(_0x4f69c4){if(_0x4f69c4){_0x39de9b=_0x4f69c4['length'];if(!_0x28ecae[_0xec06('0x2e')]['hasOwnProperty'](_0xec06('0x35'))){_0x703588[_0xec06('0x1a')]=qs[_0xec06('0x1a')](_0x28ecae[_0xec06('0x2e')][_0xec06('0x1a')]);_0x703588[_0xec06('0x19')]=qs['offset'](_0x28ecae[_0xec06('0x2e')][_0xec06('0x19')]);}return _0x4ffc9b[_0xec06('0x4a')](_0x703588);}})[_0xec06('0x21')](function(_0x3b1bcb){if(_0x3b1bcb){return _0x3b1bcb?{'count':_0x39de9b,'rows':_0x3b1bcb}:null;}})['then'](respondWithResult(_0x403a61,null))[_0xec06('0x41')](handleError(_0x403a61,null));};exports['addConfiguration']=function(_0x26d4f1,_0x5eca6e,_0x13f543){if(_0x26d4f1['body']['id']){delete _0x26d4f1[_0xec06('0x43')]['id'];}return db[_0xec06('0x29')]['findOne']({'where':{'id':_0x26d4f1[_0xec06('0x44')]['id']}})['then'](handleEntityNotFound(_0x5eca6e,null))['then'](function(_0x23f79c){if(_0x23f79c){_0x26d4f1['body']['AccountId']=_0x23f79c['id'];_0x26d4f1[_0xec06('0x43')][_0xec06('0x4b')]=integrations['getSubjects'](_0x26d4f1[_0xec06('0x43')][_0xec06('0x4c')],_0x26d4f1[_0xec06('0x43')][_0xec06('0x2c')]);_0x26d4f1[_0xec06('0x43')][_0xec06('0x4d')]=integrations[_0xec06('0x4e')](_0x26d4f1[_0xec06('0x43')][_0xec06('0x4c')],_0x26d4f1[_0xec06('0x43')][_0xec06('0x2c')]);return db[_0xec06('0x46')][_0xec06('0x42')](_0x26d4f1[_0xec06('0x43')],{'include':[{'model':db[_0xec06('0x4f')],'as':_0xec06('0x4b')},{'model':db[_0xec06('0x4f')],'as':_0xec06('0x4d')}]});}return null;})[_0xec06('0x21')](respondWithResult(_0x5eca6e,null))['catch'](handleError(_0x5eca6e,null));};var md5=require(_0xec06('0x50'));exports[_0xec06('0x51')]=function(_0x43d518,_0x3ff4a1,_0x497717){var _0x48a91a=null;var _0x2d83aa=null;var _0x4b905e=null;var _0x49ff9b=null;var _0x5ee701='';return db[_0xec06('0x29')][_0xec06('0x45')]({'where':{'id':_0x43d518[_0xec06('0x44')]['id']},'attributes':['id',_0xec06('0x25'),_0xec06('0x52'),'description',_0xec06('0x53'),_0xec06('0x54'),'serverUrl','accessKey']})[_0xec06('0x21')](handleEntityNotFound(_0x3ff4a1,null))[_0xec06('0x21')](function(_0x498fb6){if(_0x498fb6){_0x48a91a=_0x498fb6[_0xec06('0x52')];_0x2d83aa=_0x498fb6[_0xec06('0x55')];_0x4b905e=_0x498fb6['moduleName'];_0x5ee701=_0x498fb6[_0xec06('0x54')];var _0xe9b4cf=_0x5ee701['slice'](-0x1);if(_0xe9b4cf==='/'){_0x5ee701=_0x5ee701[_0xec06('0x56')](0x0,_0x5ee701['lastIndexOf'](_0xe9b4cf));}_0x49ff9b=util[_0xec06('0x57')]('%s/webservice.php',_0x5ee701);var _0x58ae96={'method':_0xec06('0x58'),'uri':_0x49ff9b,'qs':{'operation':'getchallenge','username':_0x498fb6[_0xec06('0x52')]},'json':!![]};return rp(_0x58ae96);}})['then'](function(_0x3fcb13){if(_0x3fcb13[_0xec06('0x59')]){var _0x16c3ec={'method':_0xec06('0x5a'),'uri':_0x49ff9b,'form':{'operation':_0xec06('0x5b'),'username':_0x48a91a,'accessKey':md5(_0x3fcb13[_0xec06('0x5c')]['token']+_0x2d83aa)},'json':!![]};return rp(_0x16c3ec);}})[_0xec06('0x21')](function(_0x8e6ecc){if(_0x8e6ecc['success']){var _0x56e504={'method':_0xec06('0x58'),'uri':_0x49ff9b,'qs':{'operation':_0xec06('0x5d'),'username':_0x48a91a,'sessionName':_0x8e6ecc[_0xec06('0x5c')]['sessionName'],'elementType':_0x4b905e},'json':!![]};return rp(_0x56e504);}})['then'](function(_0x1c5a01){if(_0x1c5a01[_0xec06('0x59')]){var _0x48efb8=['autogenerated','reference','owner'];_[_0xec06('0x5e')](_0x1c5a01[_0xec06('0x5c')][_0xec06('0x32')],function(_0x44f168){return _0x48efb8[_0xec06('0x5f')](_0x44f168['type'][_0xec06('0x25')]);});_[_0xec06('0x5e')](_0x1c5a01[_0xec06('0x5c')][_0xec06('0x32')],function(_0x4b62f3){return _0x4b62f3[_0xec06('0x60')]==='false';});return{'count':_0x1c5a01[_0xec06('0x5c')][_0xec06('0x32')]['length'],'rows':_[_0xec06('0x28')](_0x1c5a01[_0xec06('0x5c')][_0xec06('0x32')],function(_0x593644){return{'id':_0x593644[_0xec06('0x25')],'name':_0x593644[_0xec06('0x61')],'custom':_[_0xec06('0x62')](_0x593644[_0xec06('0x25')],_0xec06('0x63'))?!![]:![],'options':_0x593644[_0xec06('0x2c')]['name']===_0xec06('0x64')&&_0x593644[_0xec06('0x2c')][_0xec06('0x65')][_0xec06('0x33')]>0x0?_[_0xec06('0x28')](_0x593644['type'][_0xec06('0x65')],function(_0x56ccd6){return{'name':_0x56ccd6['label'],'value':_0x56ccd6['value']};}):[]};})};}})[_0xec06('0x21')](respondWithResult(_0x3ff4a1,null))[_0xec06('0x41')](function(_0x1bb626){console['log'](_0xec06('0x66')+_0x1bb626);var _0x5dffb3=_0x43d518['query'][_0xec06('0x67')]?0x1f4:_0x1bb626[_0xec06('0x68')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x5dffb3,JSON[_0xec06('0x69')](_0x1bb626));delete _0x1bb626[_0xec06('0x25')];if(_0x5dffb3===0x191){_0x5dffb3=0x190;}_0x3ff4a1[_0xec06('0x16')](_0x5dffb3)[_0xec06('0x26')](_0x43d518[_0xec06('0x2e')][_0xec06('0x67')]?{'message':_0xec06('0x6a'),'statusCode':_0x1bb626[_0xec06('0x68')]}:_0x1bb626);});};
\ No newline at end of file
index 5901ca2..56539da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6497=['rimraf','./intVtigerAccount.attributes','exports','define','VtigerAccount','int_vtiger_accounts','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0xd39959,_0x302d09){var _0x1ff69c=function(_0x17c97f){while(--_0x17c97f){_0xd39959['push'](_0xd39959['shift']());}};_0x1ff69c(++_0x302d09);}(_0x6497,0x102));var _0x7649=function(_0x4da356,_0x5235e1){_0x4da356=_0x4da356-0x0;var _0x321b07=_0x6497[_0x4da356];return _0x321b07;};'use strict';var _=require('lodash');var util=require(_0x7649('0x0'));var logger=require(_0x7649('0x1'))('api');var moment=require(_0x7649('0x2'));var BPromise=require(_0x7649('0x3'));var rp=require(_0x7649('0x4'));var fs=require('fs');var path=require(_0x7649('0x5'));var rimraf=require(_0x7649('0x6'));var config=require('../../config/environment');var attributes=require(_0x7649('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x7649('0x8')]=function(_0x445844,_0x5db78d){return _0x445844[_0x7649('0x9')](_0x7649('0xa'),attributes,{'tableName':_0x7649('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb8eb=['path','rimraf','../../config/environment','./intVtigerAccount.attributes','exports','VtigerAccount','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5b09dd,_0x57f9bd){var _0x4df232=function(_0x5219af){while(--_0x5219af){_0x5b09dd['push'](_0x5b09dd['shift']());}};_0x4df232(++_0x57f9bd);}(_0xb8eb,0x96));var _0xbb8e=function(_0x223537,_0x126eab){_0x223537=_0x223537-0x0;var _0x531d63=_0xb8eb[_0x223537];return _0x531d63;};'use strict';var _=require(_0xbb8e('0x0'));var util=require('util');var logger=require(_0xbb8e('0x1'))(_0xbb8e('0x2'));var moment=require(_0xbb8e('0x3'));var BPromise=require(_0xbb8e('0x4'));var rp=require(_0xbb8e('0x5'));var fs=require('fs');var path=require(_0xbb8e('0x6'));var rimraf=require(_0xbb8e('0x7'));var config=require(_0xbb8e('0x8'));var attributes=require(_0xbb8e('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xbb8e('0xa')]=function(_0x905e58,_0x105fe7){return _0x905e58['define'](_0xbb8e('0xb'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d135ff8..74a3699 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0565=['request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','code','message','error','GetVtigerAccount','options','raw','where','attributes','limit','map','model','include','debug','catch','ShowVtigerAccount','VtigerAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s'];(function(_0x41bf83,_0x25e2c6){var _0x309384=function(_0x4646eb){while(--_0x4646eb){_0x41bf83['push'](_0x41bf83['shift']());}};_0x309384(++_0x25e2c6);}(_0x0565,0xf2));var _0x5056=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0x0565[_0x9dfc10];return _0x4f938a;};'use strict';var _=require(_0x5056('0x0'));var util=require(_0x5056('0x1'));var moment=require(_0x5056('0x2'));var BPromise=require(_0x5056('0x3'));var rs=require(_0x5056('0x4'));var fs=require('fs');var Redis=require(_0x5056('0x5'));var db=require(_0x5056('0x6'))['db'];var utils=require(_0x5056('0x7'));var logger=require(_0x5056('0x8'))(_0x5056('0x9'));var config=require('../../config/environment');var jayson=require(_0x5056('0xa'));var client=jayson[_0x5056('0xb')][_0x5056('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22afb7,_0x4b8280,_0x52b01f){return new BPromise(function(_0x38f74,_0x223c92){return client[_0x5056('0xd')](_0x22afb7,_0x52b01f)[_0x5056('0xe')](function(_0x2144a9){logger[_0x5056('0xf')](_0x5056('0x10'),_0x4b8280,_0x5056('0x11'));logger['debug'](_0x5056('0x12'),_0x4b8280,_0x5056('0x11'),JSON[_0x5056('0x13')](_0x2144a9));if(_0x2144a9['error']){if(_0x2144a9['error'][_0x5056('0x14')]===0x1f4){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x4b8280,_0x2144a9['error'][_0x5056('0x15')]);return _0x223c92(_0x2144a9['error'][_0x5056('0x15')]);}logger[_0x5056('0x16')](_0x5056('0x10'),_0x4b8280,_0x2144a9['error'][_0x5056('0x15')]);return _0x38f74(_0x2144a9[_0x5056('0x16')][_0x5056('0x15')]);}else{logger[_0x5056('0xf')](_0x5056('0x10'),_0x4b8280,_0x5056('0x11'));_0x38f74(_0x2144a9['result'][_0x5056('0x15')]);}})['catch'](function(_0x43db77){logger[_0x5056('0x16')](_0x5056('0x10'),_0x4b8280,_0x43db77);_0x223c92(_0x43db77);});});}exports[_0x5056('0x17')]=function(_0x4056ce){var _0x51b21e=this;return new Promise(function(_0x9ea88,_0x56537e){return db['VtigerAccount']['findAll']({'raw':_0x4056ce[_0x5056('0x18')]?_0x4056ce[_0x5056('0x18')][_0x5056('0x19')]===undefined?!![]:![]:!![],'where':_0x4056ce[_0x5056('0x18')]?_0x4056ce[_0x5056('0x18')][_0x5056('0x1a')]||null:null,'attributes':_0x4056ce[_0x5056('0x18')]?_0x4056ce['options'][_0x5056('0x1b')]||null:null,'limit':_0x4056ce[_0x5056('0x18')]?_0x4056ce['options'][_0x5056('0x1c')]||null:null,'include':_0x4056ce[_0x5056('0x18')]?_0x4056ce[_0x5056('0x18')]['include']?_[_0x5056('0x1d')](_0x4056ce[_0x5056('0x18')]['include'],function(_0x4a64be){return{'model':db[_0x4a64be[_0x5056('0x1e')]],'as':_0x4a64be['as'],'attributes':_0x4a64be[_0x5056('0x1b')],'include':_0x4a64be[_0x5056('0x1f')]?_[_0x5056('0x1d')](_0x4a64be['include'],function(_0x267048){return{'model':db[_0x267048[_0x5056('0x1e')]],'as':_0x267048['as'],'attributes':_0x267048['attributes'],'include':_0x267048[_0x5056('0x1f')]?_['map'](_0x267048[_0x5056('0x1f')],function(_0x39d539){return{'model':db[_0x39d539[_0x5056('0x1e')]],'as':_0x39d539['as'],'attributes':_0x39d539[_0x5056('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5056('0xe')](function(_0x50f2a8){logger[_0x5056('0xf')](_0x5056('0x17'),_0x4056ce);logger[_0x5056('0x20')](_0x5056('0x17'),_0x4056ce,JSON['stringify'](_0x50f2a8));_0x9ea88(_0x50f2a8);})[_0x5056('0x21')](function(_0x5b0270){logger[_0x5056('0x16')]('GetVtigerAccount',_0x5b0270['message'],_0x4056ce);_0x56537e(_0x51b21e['error'](0x1f4,_0x5b0270[_0x5056('0x15')]));});});};exports[_0x5056('0x22')]=function(_0x482939){var _0x27f4be=this;return new Promise(function(_0x2c5728,_0x9e2986){return db[_0x5056('0x23')][_0x5056('0x24')]({'raw':_0x482939[_0x5056('0x18')]?_0x482939[_0x5056('0x18')][_0x5056('0x19')]===undefined?!![]:![]:!![],'where':_0x482939[_0x5056('0x18')]?_0x482939[_0x5056('0x18')][_0x5056('0x1a')]||null:null,'attributes':_0x482939['options']?_0x482939['options'][_0x5056('0x1b')]||null:null,'include':_0x482939[_0x5056('0x18')]?_0x482939['options'][_0x5056('0x1f')]?_[_0x5056('0x1d')](_0x482939['options'][_0x5056('0x1f')],function(_0x378b33){return{'model':db[_0x378b33[_0x5056('0x1e')]],'as':_0x378b33['as'],'attributes':_0x378b33[_0x5056('0x1b')],'include':_0x378b33[_0x5056('0x1f')]?_[_0x5056('0x1d')](_0x378b33[_0x5056('0x1f')],function(_0x2f1d27){return{'model':db[_0x2f1d27[_0x5056('0x1e')]],'as':_0x2f1d27['as'],'attributes':_0x2f1d27[_0x5056('0x1b')],'include':_0x2f1d27[_0x5056('0x1f')]?_[_0x5056('0x1d')](_0x2f1d27[_0x5056('0x1f')],function(_0x3d7d78){return{'model':db[_0x3d7d78[_0x5056('0x1e')]],'as':_0x3d7d78['as'],'attributes':_0x3d7d78['attributes']};}):[]};}):[]};}):[]:[]})[_0x5056('0xe')](function(_0x483d1e){logger[_0x5056('0xf')](_0x5056('0x22'),_0x482939);logger[_0x5056('0x20')](_0x5056('0x22'),_0x482939,JSON['stringify'](_0x483d1e));_0x2c5728(_0x483d1e);})[_0x5056('0x21')](function(_0x32fecc){logger['error'](_0x5056('0x22'),_0x32fecc['message'],_0x482939);_0x9e2986(_0x27f4be[_0x5056('0x16')](0x1f4,_0x32fecc[_0x5056('0x15')]));});});};
\ No newline at end of file
+var _0xeffd=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','catch','VtigerAccount','findAll','options','raw','where','limit','include','map','model','attributes','GetVtigerAccount','find','ShowVtigerAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xeffd,0x6b));var _0xdeff=function(_0x426426,_0x3619c5){_0x426426=_0x426426-0x0;var _0x1a7a9a=_0xeffd[_0x426426];return _0x1a7a9a;};'use strict';var _=require(_0xdeff('0x0'));var util=require('util');var moment=require(_0xdeff('0x1'));var BPromise=require(_0xdeff('0x2'));var rs=require(_0xdeff('0x3'));var fs=require('fs');var Redis=require(_0xdeff('0x4'));var db=require(_0xdeff('0x5'))['db'];var utils=require(_0xdeff('0x6'));var logger=require(_0xdeff('0x7'))(_0xdeff('0x8'));var config=require(_0xdeff('0x9'));var jayson=require(_0xdeff('0xa'));var client=jayson[_0xdeff('0xb')][_0xdeff('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x281ad7,_0x256323,_0x39878e){return new BPromise(function(_0x12e953,_0x24897a){return client['request'](_0x281ad7,_0x39878e)[_0xdeff('0xd')](function(_0x45a8a6){logger[_0xdeff('0xe')]('VtigerAccount,\x20%s,\x20%s',_0x256323,_0xdeff('0xf'));logger[_0xdeff('0x10')](_0xdeff('0x11'),_0x256323,_0xdeff('0xf'),JSON[_0xdeff('0x12')](_0x45a8a6));if(_0x45a8a6[_0xdeff('0x13')]){if(_0x45a8a6[_0xdeff('0x13')][_0xdeff('0x14')]===0x1f4){logger['error'](_0xdeff('0x15'),_0x256323,_0x45a8a6[_0xdeff('0x13')]['message']);return _0x24897a(_0x45a8a6[_0xdeff('0x13')]['message']);}logger['error'](_0xdeff('0x15'),_0x256323,_0x45a8a6[_0xdeff('0x13')][_0xdeff('0x16')]);return _0x12e953(_0x45a8a6[_0xdeff('0x13')]['message']);}else{logger[_0xdeff('0xe')](_0xdeff('0x15'),_0x256323,_0xdeff('0xf'));_0x12e953(_0x45a8a6[_0xdeff('0x17')][_0xdeff('0x16')]);}})[_0xdeff('0x18')](function(_0x577244){logger['error'](_0xdeff('0x15'),_0x256323,_0x577244);_0x24897a(_0x577244);});});}exports['GetVtigerAccount']=function(_0x5c9837){var _0x35635f=this;return new Promise(function(_0x369e13,_0x4b14b6){return db[_0xdeff('0x19')][_0xdeff('0x1a')]({'raw':_0x5c9837[_0xdeff('0x1b')]?_0x5c9837[_0xdeff('0x1b')][_0xdeff('0x1c')]===undefined?!![]:![]:!![],'where':_0x5c9837[_0xdeff('0x1b')]?_0x5c9837[_0xdeff('0x1b')][_0xdeff('0x1d')]||null:null,'attributes':_0x5c9837['options']?_0x5c9837['options']['attributes']||null:null,'limit':_0x5c9837[_0xdeff('0x1b')]?_0x5c9837['options'][_0xdeff('0x1e')]||null:null,'include':_0x5c9837[_0xdeff('0x1b')]?_0x5c9837['options'][_0xdeff('0x1f')]?_[_0xdeff('0x20')](_0x5c9837['options']['include'],function(_0x3b2554){return{'model':db[_0x3b2554[_0xdeff('0x21')]],'as':_0x3b2554['as'],'attributes':_0x3b2554[_0xdeff('0x22')],'include':_0x3b2554[_0xdeff('0x1f')]?_[_0xdeff('0x20')](_0x3b2554['include'],function(_0xb08f19){return{'model':db[_0xb08f19[_0xdeff('0x21')]],'as':_0xb08f19['as'],'attributes':_0xb08f19[_0xdeff('0x22')],'include':_0xb08f19[_0xdeff('0x1f')]?_[_0xdeff('0x20')](_0xb08f19[_0xdeff('0x1f')],function(_0x3d0111){return{'model':db[_0x3d0111['model']],'as':_0x3d0111['as'],'attributes':_0x3d0111[_0xdeff('0x22')]};}):[]};}):[]};}):[]:[]})[_0xdeff('0xd')](function(_0x53b168){logger['info'](_0xdeff('0x23'),_0x5c9837);logger[_0xdeff('0x10')](_0xdeff('0x23'),_0x5c9837,JSON[_0xdeff('0x12')](_0x53b168));_0x369e13(_0x53b168);})[_0xdeff('0x18')](function(_0xf9b278){logger[_0xdeff('0x13')]('GetVtigerAccount',_0xf9b278[_0xdeff('0x16')],_0x5c9837);_0x4b14b6(_0x35635f[_0xdeff('0x13')](0x1f4,_0xf9b278[_0xdeff('0x16')]));});});};exports['ShowVtigerAccount']=function(_0x59f7a0){var _0x346743=this;return new Promise(function(_0x505e3f,_0x69842a){return db[_0xdeff('0x19')][_0xdeff('0x24')]({'raw':_0x59f7a0['options']?_0x59f7a0[_0xdeff('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x59f7a0['options']?_0x59f7a0[_0xdeff('0x1b')][_0xdeff('0x1d')]||null:null,'attributes':_0x59f7a0[_0xdeff('0x1b')]?_0x59f7a0[_0xdeff('0x1b')]['attributes']||null:null,'include':_0x59f7a0[_0xdeff('0x1b')]?_0x59f7a0[_0xdeff('0x1b')][_0xdeff('0x1f')]?_[_0xdeff('0x20')](_0x59f7a0[_0xdeff('0x1b')][_0xdeff('0x1f')],function(_0x321ef0){return{'model':db[_0x321ef0['model']],'as':_0x321ef0['as'],'attributes':_0x321ef0[_0xdeff('0x22')],'include':_0x321ef0['include']?_[_0xdeff('0x20')](_0x321ef0[_0xdeff('0x1f')],function(_0x2e1736){return{'model':db[_0x2e1736[_0xdeff('0x21')]],'as':_0x2e1736['as'],'attributes':_0x2e1736[_0xdeff('0x22')],'include':_0x2e1736[_0xdeff('0x1f')]?_['map'](_0x2e1736[_0xdeff('0x1f')],function(_0x3bf462){return{'model':db[_0x3bf462['model']],'as':_0x3bf462['as'],'attributes':_0x3bf462[_0xdeff('0x22')]};}):[]};}):[]};}):[]:[]})[_0xdeff('0xd')](function(_0x1c6d4c){logger[_0xdeff('0xe')](_0xdeff('0x25'),_0x59f7a0);logger[_0xdeff('0x10')](_0xdeff('0x25'),_0x59f7a0,JSON[_0xdeff('0x12')](_0x1c6d4c));_0x505e3f(_0x1c6d4c);})['catch'](function(_0x118752){logger['error'](_0xdeff('0x25'),_0x118752[_0xdeff('0x16')],_0x59f7a0);_0x69842a(_0x346743[_0xdeff('0x13')](0x1f4,_0x118752['message']));});});};
\ No newline at end of file
index 5e7502e..424a84e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa506=['Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x4a750d,_0xe0f09b){var _0x5e0e3c=function(_0x5f103b){while(--_0x5f103b){_0x4a750d['push'](_0x4a750d['shift']());}};_0x5e0e3c(++_0xe0f09b);}(_0xa506,0x18c));var _0x6a50=function(_0x2ee6db,_0x15b3cd){_0x2ee6db=_0x2ee6db-0x0;var _0x439d79=_0xa506[_0x2ee6db];return _0x439d79;};'use strict';var multer=require(_0x6a50('0x0'));var util=require(_0x6a50('0x1'));var path=require('path');var timeout=require(_0x6a50('0x2'));var express=require(_0x6a50('0x3'));var router=express[_0x6a50('0x4')]();var fs_extra=require(_0x6a50('0x5'));var auth=require(_0x6a50('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6a50('0x7'));var controller=require(_0x6a50('0x8'));router[_0x6a50('0x9')]('/',auth[_0x6a50('0xa')](),controller[_0x6a50('0xb')]);router['get'](_0x6a50('0xc'),auth['isAuthenticated'](),controller[_0x6a50('0xd')]);router['get'](_0x6a50('0xe'),auth[_0x6a50('0xa')](),controller[_0x6a50('0xf')]);router[_0x6a50('0x9')](_0x6a50('0x10'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x6a50('0x9')](_0x6a50('0x11'),auth[_0x6a50('0xa')](),controller[_0x6a50('0x12')]);router[_0x6a50('0x13')]('/',auth[_0x6a50('0xa')](),controller['create']);router[_0x6a50('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x6a50('0x15')]);router[_0x6a50('0x16')]('/:id',auth[_0x6a50('0xa')](),controller[_0x6a50('0x17')]);module[_0x6a50('0x18')]=router;
\ No newline at end of file
+var _0xd842=['../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','index','/:id','show','isAuthenticated','/:id/subjects','getSubjects','/:id/descriptions','put','update','delete','util','Router','fs-extra'];(function(_0x1ded25,_0x26be3d){var _0x8ec99f=function(_0x3017ac){while(--_0x3017ac){_0x1ded25['push'](_0x1ded25['shift']());}};_0x8ec99f(++_0x26be3d);}(_0xd842,0x140));var _0x2d84=function(_0x47b6db,_0x3ad28b){_0x47b6db=_0x47b6db-0x0;var _0x7d5e23=_0xd842[_0x47b6db];return _0x7d5e23;};'use strict';var multer=require('multer');var util=require(_0x2d84('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2d84('0x1')]();var fs_extra=require(_0x2d84('0x2'));var auth=require(_0x2d84('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2d84('0x4'));var controller=require(_0x2d84('0x5'));router[_0x2d84('0x6')]('/',auth['isAuthenticated'](),controller[_0x2d84('0x7')]);router[_0x2d84('0x6')](_0x2d84('0x8'),auth['isAuthenticated'](),controller[_0x2d84('0x9')]);router[_0x2d84('0x6')]('/:id/fields',auth[_0x2d84('0xa')](),controller['getFields']);router[_0x2d84('0x6')](_0x2d84('0xb'),auth['isAuthenticated'](),controller[_0x2d84('0xc')]);router[_0x2d84('0x6')](_0x2d84('0xd'),auth[_0x2d84('0xa')](),controller['getDescriptions']);router['post']('/',auth[_0x2d84('0xa')](),controller['create']);router[_0x2d84('0xe')](_0x2d84('0x8'),auth[_0x2d84('0xa')](),controller[_0x2d84('0xf')]);router[_0x2d84('0x10')](_0x2d84('0x8'),auth[_0x2d84('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 225445b..3bb59f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb453=['exports','STRING','sequelize'];(function(_0x6c0123,_0x4c8d3b){var _0x5a87d2=function(_0x1ff614){while(--_0x1ff614){_0x6c0123['push'](_0x6c0123['shift']());}};_0x5a87d2(++_0x4c8d3b);}(_0xb453,0x11f));var _0x3b45=function(_0x51557d,_0x4c1361){_0x51557d=_0x51557d-0x0;var _0x2a31eb=_0xb453[_0x51557d];return _0x2a31eb;};'use strict';var Sequelize=require(_0x3b45('0x0'));module[_0x3b45('0x1')]={'name':{'type':Sequelize[_0x3b45('0x2')]},'description':{'type':Sequelize[_0x3b45('0x2')]}};
\ No newline at end of file
+var _0x5f22=['STRING','sequelize','exports'];(function(_0x17b67f,_0x5afa55){var _0x79be8c=function(_0x509f1b){while(--_0x509f1b){_0x17b67f['push'](_0x17b67f['shift']());}};_0x79be8c(++_0x5afa55);}(_0x5f22,0x1b1));var _0x25f2=function(_0x4226d6,_0x3864ca){_0x4226d6=_0x4226d6-0x0;var _0x19655b=_0x5f22[_0x4226d6];return _0x19655b;};'use strict';var Sequelize=require(_0x25f2('0x0'));module[_0x25f2('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x25f2('0x2')]}};
\ No newline at end of file
index 8d8f6eb..e01c237 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4200=['model','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','merge','VIRTUAL','filter','includeAll','rows','catch','show','include','options','find','create','body','params','getFields','sort','getSubjects','findOne','getDescriptions','VtigerField','rimraf','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','key','query','keys','intersection'];(function(_0x80d733,_0x266211){var _0x435868=function(_0x2ae0f0){while(--_0x2ae0f0){_0x80d733['push'](_0x80d733['shift']());}};_0x435868(++_0x266211);}(_0x4200,0x199));var _0x0420=function(_0x9052f6,_0x35f7aa){_0x9052f6=_0x9052f6-0x0;var _0x2aacc6=_0x4200[_0x9052f6];return _0x2aacc6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0420('0x0'));var zipdir=require(_0x0420('0x1'));var jsonpatch=require(_0x0420('0x2'));var rp=require(_0x0420('0x3'));var moment=require(_0x0420('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x0420('0x5'));var csv=require(_0x0420('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0420('0x7'));var _=require(_0x0420('0x8'));var squel=require(_0x0420('0x9'));var crypto=require(_0x0420('0xa'));var jsforce=require(_0x0420('0xb'));var deskjs=require(_0x0420('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0420('0xd'));var Papa=require(_0x0420('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0420('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0420('0x10'));var logger=require(_0x0420('0x11'))('api');var utils=require(_0x0420('0x12'));var config=require(_0x0420('0x13'));var licenseUtil=require(_0x0420('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4832c1,_0x53b7bc){_0x53b7bc=_0x53b7bc||0xcc;return function(_0x3182e1){if(_0x3182e1){return _0x4832c1[_0x0420('0x15')](_0x53b7bc);}return _0x4832c1[_0x0420('0x16')](_0x53b7bc)[_0x0420('0x17')]();};}function respondWithResult(_0x1c176,_0x4a5470){_0x4a5470=_0x4a5470||0xc8;return function(_0x2744ca){if(_0x2744ca){return _0x1c176[_0x0420('0x16')](_0x4a5470)['json'](_0x2744ca);}};}function respondWithFilteredResult(_0x612f11,_0x35f13d){return function(_0x2cabea){if(_0x2cabea){var _0x557699=typeof _0x35f13d[_0x0420('0x18')]==='undefined'&&typeof _0x35f13d[_0x0420('0x19')]==='undefined';var _0x220cc5=_0x2cabea[_0x0420('0x1a')];var _0x553e4c=_0x557699?0x0:_0x35f13d[_0x0420('0x18')];var _0x3a775a=_0x557699?_0x2cabea['count']:_0x35f13d['offset']+_0x35f13d['limit'];var _0x1a8e51;if(_0x3a775a>=_0x220cc5){_0x3a775a=_0x220cc5;_0x1a8e51=0xc8;}else{_0x1a8e51=0xce;}_0x612f11['status'](_0x1a8e51);return _0x612f11[_0x0420('0x1b')](_0x0420('0x1c'),_0x553e4c+'-'+_0x3a775a+'/'+_0x220cc5)['json'](_0x2cabea);}return null;};}function patchUpdates(_0x4d7fb9){return function(_0x5c3d53){try{jsonpatch[_0x0420('0x1d')](_0x5c3d53,_0x4d7fb9,!![]);}catch(_0x5b3cb3){return BPromise[_0x0420('0x1e')](_0x5b3cb3);}return _0x5c3d53[_0x0420('0x1f')]();};}function saveUpdates(_0x37bcc3,_0x2e24de){return function(_0x4b4727){if(_0x4b4727){return _0x4b4727[_0x0420('0x20')](_0x37bcc3)[_0x0420('0x21')](function(_0x5204df){return _0x5204df;});}return null;};}function removeEntity(_0x478770,_0x5b0d29){return function(_0x101d68){if(_0x101d68){return _0x101d68[_0x0420('0x22')]()[_0x0420('0x21')](function(){_0x478770['status'](0xcc)[_0x0420('0x17')]();});}};}function handleEntityNotFound(_0x35f2d9,_0x1ab0fe){return function(_0x9ef985){if(!_0x9ef985){_0x35f2d9['sendStatus'](0x194);}return _0x9ef985;};}function handleError(_0xceb878,_0xc7da1f){_0xc7da1f=_0xc7da1f||0x1f4;return function(_0x128496){logger[_0x0420('0x23')](_0x128496['stack']);if(_0x128496['name']){delete _0x128496[_0x0420('0x24')];}_0xceb878[_0x0420('0x16')](_0xc7da1f)[_0x0420('0x25')](_0x128496);};}exports[_0x0420('0x26')]=function(_0x52ee9e,_0x5bf2a6){var _0x188101={},_0xc1e28a={},_0x517909={'count':0x0,'rows':[]};var _0x360f7e=_[_0x0420('0x27')](db[_0x0420('0x28')][_0x0420('0x29')],function(_0x34ab12){return{'name':_0x34ab12[_0x0420('0x2a')],'type':_0x34ab12['type'][_0x0420('0x2b')]};});_0xc1e28a['model']=_[_0x0420('0x27')](_0x360f7e,'name');_0xc1e28a[_0x0420('0x2c')]=_[_0x0420('0x2d')](_0x52ee9e[_0x0420('0x2c')]);_0xc1e28a['filters']=_[_0x0420('0x2e')](_0xc1e28a[_0x0420('0x2f')],_0xc1e28a[_0x0420('0x2c')]);_0x188101[_0x0420('0x30')]=_[_0x0420('0x2e')](_0xc1e28a['model'],qs[_0x0420('0x31')](_0x52ee9e[_0x0420('0x2c')][_0x0420('0x31')]));_0x188101['attributes']=_0x188101['attributes'][_0x0420('0x32')]?_0x188101[_0x0420('0x30')]:_0xc1e28a[_0x0420('0x2f')];if(!_0x52ee9e[_0x0420('0x2c')][_0x0420('0x33')](_0x0420('0x34'))){_0x188101[_0x0420('0x19')]=qs[_0x0420('0x19')](_0x52ee9e['query'][_0x0420('0x19')]);_0x188101['offset']=qs[_0x0420('0x18')](_0x52ee9e[_0x0420('0x2c')][_0x0420('0x18')]);}_0x188101[_0x0420('0x35')]=qs['sort'](_0x52ee9e[_0x0420('0x2c')]['sort']);_0x188101[_0x0420('0x36')]=qs[_0x0420('0x37')](_[_0x0420('0x38')](_0x52ee9e[_0x0420('0x2c')],_0xc1e28a[_0x0420('0x37')]),_0x360f7e);if(_0x52ee9e[_0x0420('0x2c')]['filter']){_0x188101[_0x0420('0x36')]=_[_0x0420('0x39')](_0x188101[_0x0420('0x36')],{'$or':_[_0x0420('0x27')](_0x360f7e,function(_0x387de3){if(_0x387de3['type']!==_0x0420('0x3a')){var _0x268baa={};_0x268baa[_0x387de3[_0x0420('0x24')]]={'$like':'%'+_0x52ee9e[_0x0420('0x2c')][_0x0420('0x3b')]+'%'};return _0x268baa;}})});}_0x188101=_[_0x0420('0x39')]({},_0x188101,_0x52ee9e['options']);var _0x3cdac7={'where':_0x188101['where']};return db[_0x0420('0x28')]['count'](_0x3cdac7)[_0x0420('0x21')](function(_0x134c56){_0x517909[_0x0420('0x1a')]=_0x134c56;if(_0x52ee9e['query'][_0x0420('0x3c')]){_0x188101['include']=[{'all':!![]}];}return db[_0x0420('0x28')]['findAll'](_0x188101);})[_0x0420('0x21')](function(_0x140d25){_0x517909[_0x0420('0x3d')]=_0x140d25;return _0x517909;})['then'](respondWithFilteredResult(_0x5bf2a6,_0x188101))[_0x0420('0x3e')](handleError(_0x5bf2a6,null));};exports[_0x0420('0x3f')]=function(_0x3087b0,_0x2cc8e4){var _0xd2f007={'raw':![],'where':{'id':_0x3087b0['params']['id']}},_0x48b631={};_0x48b631['model']=_[_0x0420('0x2d')](db['VtigerConfiguration'][_0x0420('0x29')]);_0x48b631[_0x0420('0x2c')]=_[_0x0420('0x2d')](_0x3087b0[_0x0420('0x2c')]);_0x48b631['filters']=_['intersection'](_0x48b631[_0x0420('0x2f')],_0x48b631['query']);_0xd2f007['attributes']=_[_0x0420('0x2e')](_0x48b631[_0x0420('0x2f')],qs[_0x0420('0x31')](_0x3087b0[_0x0420('0x2c')]['fields']));_0xd2f007[_0x0420('0x30')]=_0xd2f007['attributes'][_0x0420('0x32')]?_0xd2f007['attributes']:_0x48b631[_0x0420('0x2f')];if(_0x3087b0[_0x0420('0x2c')]['includeAll']){_0xd2f007[_0x0420('0x40')]=[{'all':!![]}];}_0xd2f007=_[_0x0420('0x39')]({},_0xd2f007,_0x3087b0[_0x0420('0x41')]);return db[_0x0420('0x28')][_0x0420('0x42')](_0xd2f007)[_0x0420('0x21')](handleEntityNotFound(_0x2cc8e4,null))[_0x0420('0x21')](respondWithResult(_0x2cc8e4,null))[_0x0420('0x3e')](handleError(_0x2cc8e4,null));};exports[_0x0420('0x43')]=function(_0x24017b,_0x3ce55b){return db[_0x0420('0x28')]['create'](_0x24017b[_0x0420('0x44')],{})[_0x0420('0x21')](respondWithResult(_0x3ce55b,0xc9))[_0x0420('0x3e')](handleError(_0x3ce55b,null));};exports[_0x0420('0x20')]=function(_0x53aa20,_0x188078){if(_0x53aa20[_0x0420('0x44')]['id']){delete _0x53aa20[_0x0420('0x44')]['id'];}return db[_0x0420('0x28')][_0x0420('0x42')]({'where':{'id':_0x53aa20[_0x0420('0x45')]['id']}})[_0x0420('0x21')](handleEntityNotFound(_0x188078,null))[_0x0420('0x21')](saveUpdates(_0x53aa20[_0x0420('0x44')],null))[_0x0420('0x21')](respondWithResult(_0x188078,null))[_0x0420('0x3e')](handleError(_0x188078,null));};exports[_0x0420('0x22')]=function(_0x9c2a3e,_0x35ece0){return db[_0x0420('0x28')][_0x0420('0x42')]({'where':{'id':_0x9c2a3e['params']['id']}})[_0x0420('0x21')](handleEntityNotFound(_0x35ece0,null))[_0x0420('0x21')](removeEntity(_0x35ece0,null))[_0x0420('0x3e')](handleError(_0x35ece0,null));};exports[_0x0420('0x46')]=function(_0x1a5496,_0x486cee,_0x3850bb){var _0x4b0362={};var _0xb13a91={};var _0x3d6063;var _0x530df0;return db[_0x0420('0x28')]['findOne']({'where':{'id':_0x1a5496[_0x0420('0x45')]['id']}})[_0x0420('0x21')](handleEntityNotFound(_0x486cee,null))['then'](function(_0x383fa3){if(_0x383fa3){_0x3d6063=_0x383fa3;_0xb13a91[_0x0420('0x2f')]=_[_0x0420('0x2d')](db['VtigerField']['rawAttributes']);_0xb13a91[_0x0420('0x2c')]=_['keys'](_0x1a5496[_0x0420('0x2c')]);_0xb13a91['filters']=_[_0x0420('0x2e')](_0xb13a91[_0x0420('0x2f')],_0xb13a91[_0x0420('0x2c')]);_0x4b0362['attributes']=_[_0x0420('0x2e')](_0xb13a91[_0x0420('0x2f')],qs[_0x0420('0x31')](_0x1a5496[_0x0420('0x2c')][_0x0420('0x31')]));_0x4b0362[_0x0420('0x30')]=_0x4b0362[_0x0420('0x30')][_0x0420('0x32')]?_0x4b0362[_0x0420('0x30')]:_0xb13a91[_0x0420('0x2f')];_0x4b0362[_0x0420('0x35')]=qs['sort'](_0x1a5496[_0x0420('0x2c')][_0x0420('0x47')]);_0x4b0362[_0x0420('0x36')]=qs[_0x0420('0x37')](_['pick'](_0x1a5496[_0x0420('0x2c')],_0xb13a91[_0x0420('0x37')]));if(_0x1a5496['query'][_0x0420('0x3b')]){_0x4b0362[_0x0420('0x36')]=_[_0x0420('0x39')](_0x4b0362[_0x0420('0x36')],{'$or':_[_0x0420('0x27')](_0x4b0362[_0x0420('0x30')],function(_0x3c4986){var _0x2f2b1e={};_0x2f2b1e[_0x3c4986]={'$like':'%'+_0x1a5496[_0x0420('0x2c')][_0x0420('0x3b')]+'%'};return _0x2f2b1e;})});}_0x4b0362=_[_0x0420('0x39')]({},_0x4b0362,_0x1a5496[_0x0420('0x41')]);return _0x3d6063[_0x0420('0x46')](_0x4b0362);}})['then'](function(_0x1c9628){if(_0x1c9628){_0x530df0=_0x1c9628[_0x0420('0x32')];if(!_0x1a5496[_0x0420('0x2c')]['hasOwnProperty'](_0x0420('0x34'))){_0x4b0362[_0x0420('0x19')]=qs[_0x0420('0x19')](_0x1a5496[_0x0420('0x2c')]['limit']);_0x4b0362[_0x0420('0x18')]=qs[_0x0420('0x18')](_0x1a5496[_0x0420('0x2c')][_0x0420('0x18')]);}return _0x3d6063[_0x0420('0x46')](_0x4b0362);}})['then'](function(_0x50ddca){if(_0x50ddca){return _0x50ddca?{'count':_0x530df0,'rows':_0x50ddca}:null;}})[_0x0420('0x21')](respondWithResult(_0x486cee,null))[_0x0420('0x3e')](handleError(_0x486cee,null));};exports[_0x0420('0x48')]=function(_0x342da2,_0x1a9645,_0x113ff9){var _0x23b6e6={};var _0x5af850={};var _0x102fc4;var _0x21f939;return db['VtigerConfiguration'][_0x0420('0x49')]({'where':{'id':_0x342da2[_0x0420('0x45')]['id']}})[_0x0420('0x21')](handleEntityNotFound(_0x1a9645,null))[_0x0420('0x21')](function(_0x2dde91){if(_0x2dde91){_0x102fc4=_0x2dde91;_0x5af850['model']=_[_0x0420('0x2d')](db['VtigerField'][_0x0420('0x29')]);_0x5af850[_0x0420('0x2c')]=_[_0x0420('0x2d')](_0x342da2[_0x0420('0x2c')]);_0x5af850[_0x0420('0x37')]=_[_0x0420('0x2e')](_0x5af850[_0x0420('0x2f')],_0x5af850[_0x0420('0x2c')]);_0x23b6e6[_0x0420('0x30')]=_[_0x0420('0x2e')](_0x5af850[_0x0420('0x2f')],qs[_0x0420('0x31')](_0x342da2[_0x0420('0x2c')]['fields']));_0x23b6e6[_0x0420('0x30')]=_0x23b6e6[_0x0420('0x30')][_0x0420('0x32')]?_0x23b6e6[_0x0420('0x30')]:_0x5af850['model'];_0x23b6e6['order']=qs[_0x0420('0x47')](_0x342da2[_0x0420('0x2c')][_0x0420('0x47')]);_0x23b6e6[_0x0420('0x36')]=qs[_0x0420('0x37')](_['pick'](_0x342da2[_0x0420('0x2c')],_0x5af850['filters']));if(_0x342da2[_0x0420('0x2c')]['filter']){_0x23b6e6[_0x0420('0x36')]=_['merge'](_0x23b6e6[_0x0420('0x36')],{'$or':_['map'](_0x23b6e6['attributes'],function(_0x61782a){var _0x349ce1={};_0x349ce1[_0x61782a]={'$like':'%'+_0x342da2[_0x0420('0x2c')][_0x0420('0x3b')]+'%'};return _0x349ce1;})});}_0x23b6e6=_[_0x0420('0x39')]({},_0x23b6e6,_0x342da2['options']);return _0x102fc4['getSubjects'](_0x23b6e6);}})['then'](function(_0x2c53d7){if(_0x2c53d7){_0x21f939=_0x2c53d7['length'];if(!_0x342da2[_0x0420('0x2c')][_0x0420('0x33')](_0x0420('0x34'))){_0x23b6e6[_0x0420('0x19')]=qs[_0x0420('0x19')](_0x342da2[_0x0420('0x2c')][_0x0420('0x19')]);_0x23b6e6[_0x0420('0x18')]=qs[_0x0420('0x18')](_0x342da2[_0x0420('0x2c')][_0x0420('0x18')]);}return _0x102fc4[_0x0420('0x48')](_0x23b6e6);}})['then'](function(_0xa6c9ec){if(_0xa6c9ec){return _0xa6c9ec?{'count':_0x21f939,'rows':_0xa6c9ec}:null;}})[_0x0420('0x21')](respondWithResult(_0x1a9645,null))[_0x0420('0x3e')](handleError(_0x1a9645,null));};exports[_0x0420('0x4a')]=function(_0x5c16d7,_0x7956bd,_0x14a985){var _0x2f01f8={};var _0x36ea3a={};var _0x1f0ead;var _0x4293c6;return db[_0x0420('0x28')][_0x0420('0x49')]({'where':{'id':_0x5c16d7[_0x0420('0x45')]['id']}})[_0x0420('0x21')](handleEntityNotFound(_0x7956bd,null))[_0x0420('0x21')](function(_0x26558d){if(_0x26558d){_0x1f0ead=_0x26558d;_0x36ea3a[_0x0420('0x2f')]=_[_0x0420('0x2d')](db[_0x0420('0x4b')]['rawAttributes']);_0x36ea3a['query']=_[_0x0420('0x2d')](_0x5c16d7[_0x0420('0x2c')]);_0x36ea3a['filters']=_['intersection'](_0x36ea3a[_0x0420('0x2f')],_0x36ea3a[_0x0420('0x2c')]);_0x2f01f8[_0x0420('0x30')]=_[_0x0420('0x2e')](_0x36ea3a[_0x0420('0x2f')],qs[_0x0420('0x31')](_0x5c16d7[_0x0420('0x2c')][_0x0420('0x31')]));_0x2f01f8[_0x0420('0x30')]=_0x2f01f8['attributes'][_0x0420('0x32')]?_0x2f01f8[_0x0420('0x30')]:_0x36ea3a[_0x0420('0x2f')];_0x2f01f8[_0x0420('0x35')]=qs['sort'](_0x5c16d7[_0x0420('0x2c')][_0x0420('0x47')]);_0x2f01f8[_0x0420('0x36')]=qs[_0x0420('0x37')](_[_0x0420('0x38')](_0x5c16d7[_0x0420('0x2c')],_0x36ea3a[_0x0420('0x37')]));if(_0x5c16d7[_0x0420('0x2c')]['filter']){_0x2f01f8[_0x0420('0x36')]=_[_0x0420('0x39')](_0x2f01f8[_0x0420('0x36')],{'$or':_[_0x0420('0x27')](_0x2f01f8[_0x0420('0x30')],function(_0x1babc2){var _0x1cf953={};_0x1cf953[_0x1babc2]={'$like':'%'+_0x5c16d7[_0x0420('0x2c')]['filter']+'%'};return _0x1cf953;})});}_0x2f01f8=_['merge']({},_0x2f01f8,_0x5c16d7[_0x0420('0x41')]);return _0x1f0ead[_0x0420('0x4a')](_0x2f01f8);}})[_0x0420('0x21')](function(_0x3454c8){if(_0x3454c8){_0x4293c6=_0x3454c8[_0x0420('0x32')];if(!_0x5c16d7['query'][_0x0420('0x33')]('nolimit')){_0x2f01f8[_0x0420('0x19')]=qs[_0x0420('0x19')](_0x5c16d7['query'][_0x0420('0x19')]);_0x2f01f8['offset']=qs[_0x0420('0x18')](_0x5c16d7['query'][_0x0420('0x18')]);}return _0x1f0ead['getDescriptions'](_0x2f01f8);}})[_0x0420('0x21')](function(_0xf67ae8){if(_0xf67ae8){return _0xf67ae8?{'count':_0x4293c6,'rows':_0xf67ae8}:null;}})[_0x0420('0x21')](respondWithResult(_0x7956bd,null))[_0x0420('0x3e')](handleError(_0x7956bd,null));};
\ No newline at end of file
+var _0xdb81=['moment','bluebird','util','path','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','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','keys','length','find','create','body','params','getFields','VtigerField','order','findOne','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise'];(function(_0x4ea955,_0x1eda76){var _0x558561=function(_0x5b20f4){while(--_0x5b20f4){_0x4ea955['push'](_0x4ea955['shift']());}};_0x558561(++_0x1eda76);}(_0xdb81,0x191));var _0x1db8=function(_0xc93daa,_0x55ef84){_0xc93daa=_0xc93daa-0x0;var _0x2afc45=_0xdb81[_0xc93daa];return _0x2afc45;};'use strict';var emlformat=require(_0x1db8('0x0'));var rimraf=require(_0x1db8('0x1'));var zipdir=require(_0x1db8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1db8('0x3'));var moment=require(_0x1db8('0x4'));var BPromise=require(_0x1db8('0x5'));var Mustache=require('mustache');var util=require(_0x1db8('0x6'));var path=require(_0x1db8('0x7'));var sox=require('sox');var csv=require(_0x1db8('0x8'));var ejs=require(_0x1db8('0x9'));var fs=require('fs');var fs_extra=require(_0x1db8('0xa'));var _=require(_0x1db8('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1db8('0xc'));var deskjs=require(_0x1db8('0xd'));var toCsv=require(_0x1db8('0x8'));var querystring=require(_0x1db8('0xe'));var Papa=require(_0x1db8('0xf'));var Redis=require('ioredis');var authService=require(_0x1db8('0x10'));var qs=require(_0x1db8('0x11'));var as=require(_0x1db8('0x12'));var hardwareService=require(_0x1db8('0x13'));var logger=require(_0x1db8('0x14'))(_0x1db8('0x15'));var utils=require(_0x1db8('0x16'));var config=require(_0x1db8('0x17'));var licenseUtil=require(_0x1db8('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24ea0f,_0x4a3a64){_0x4a3a64=_0x4a3a64||0xcc;return function(_0x337c20){if(_0x337c20){return _0x24ea0f[_0x1db8('0x19')](_0x4a3a64);}return _0x24ea0f[_0x1db8('0x1a')](_0x4a3a64)[_0x1db8('0x1b')]();};}function respondWithResult(_0x304da6,_0x422149){_0x422149=_0x422149||0xc8;return function(_0x53db4c){if(_0x53db4c){return _0x304da6[_0x1db8('0x1a')](_0x422149)[_0x1db8('0x1c')](_0x53db4c);}};}function respondWithFilteredResult(_0x4380cb,_0x5c7acb){return function(_0x3c3686){if(_0x3c3686){var _0x1f4207=typeof _0x5c7acb[_0x1db8('0x1d')]===_0x1db8('0x1e')&&typeof _0x5c7acb[_0x1db8('0x1f')]===_0x1db8('0x1e');var _0x57cc68=_0x3c3686[_0x1db8('0x20')];var _0x1bd862=_0x1f4207?0x0:_0x5c7acb['offset'];var _0x5f5a1d=_0x1f4207?_0x3c3686[_0x1db8('0x20')]:_0x5c7acb['offset']+_0x5c7acb[_0x1db8('0x1f')];var _0x1b5556;if(_0x5f5a1d>=_0x57cc68){_0x5f5a1d=_0x57cc68;_0x1b5556=0xc8;}else{_0x1b5556=0xce;}_0x4380cb[_0x1db8('0x1a')](_0x1b5556);return _0x4380cb['set'](_0x1db8('0x21'),_0x1bd862+'-'+_0x5f5a1d+'/'+_0x57cc68)['json'](_0x3c3686);}return null;};}function patchUpdates(_0x5d8bc7){return function(_0x3702ec){try{jsonpatch['apply'](_0x3702ec,_0x5d8bc7,!![]);}catch(_0x2f5033){return BPromise[_0x1db8('0x22')](_0x2f5033);}return _0x3702ec[_0x1db8('0x23')]();};}function saveUpdates(_0x298511,_0x964e5d){return function(_0x18ebb7){if(_0x18ebb7){return _0x18ebb7[_0x1db8('0x24')](_0x298511)[_0x1db8('0x25')](function(_0x55d947){return _0x55d947;});}return null;};}function removeEntity(_0xe4f4c4,_0x2e38){return function(_0x2829a7){if(_0x2829a7){return _0x2829a7[_0x1db8('0x26')]()['then'](function(){_0xe4f4c4[_0x1db8('0x1a')](0xcc)[_0x1db8('0x1b')]();});}};}function handleEntityNotFound(_0x4d0791,_0x49ec0e){return function(_0x33211e){if(!_0x33211e){_0x4d0791[_0x1db8('0x19')](0x194);}return _0x33211e;};}function handleError(_0x17100a,_0x2f3677){_0x2f3677=_0x2f3677||0x1f4;return function(_0xe246e2){logger['error'](_0xe246e2[_0x1db8('0x27')]);if(_0xe246e2[_0x1db8('0x28')]){delete _0xe246e2['name'];}_0x17100a[_0x1db8('0x1a')](_0x2f3677)[_0x1db8('0x29')](_0xe246e2);};}exports[_0x1db8('0x2a')]=function(_0x14cb4e,_0x53095e){var _0x7eb185={},_0x483ede={},_0x3d4ff7={'count':0x0,'rows':[]};var _0x47b94e=_[_0x1db8('0x2b')](db[_0x1db8('0x2c')][_0x1db8('0x2d')],function(_0x358ab){return{'name':_0x358ab[_0x1db8('0x2e')],'type':_0x358ab[_0x1db8('0x2f')][_0x1db8('0x30')]};});_0x483ede['model']=_['map'](_0x47b94e,'name');_0x483ede['query']=_['keys'](_0x14cb4e[_0x1db8('0x31')]);_0x483ede[_0x1db8('0x32')]=_[_0x1db8('0x33')](_0x483ede['model'],_0x483ede[_0x1db8('0x31')]);_0x7eb185[_0x1db8('0x34')]=_[_0x1db8('0x33')](_0x483ede[_0x1db8('0x35')],qs[_0x1db8('0x36')](_0x14cb4e[_0x1db8('0x31')][_0x1db8('0x36')]));_0x7eb185['attributes']=_0x7eb185[_0x1db8('0x34')]['length']?_0x7eb185[_0x1db8('0x34')]:_0x483ede[_0x1db8('0x35')];if(!_0x14cb4e['query'][_0x1db8('0x37')]('nolimit')){_0x7eb185[_0x1db8('0x1f')]=qs[_0x1db8('0x1f')](_0x14cb4e[_0x1db8('0x31')][_0x1db8('0x1f')]);_0x7eb185[_0x1db8('0x1d')]=qs[_0x1db8('0x1d')](_0x14cb4e[_0x1db8('0x31')][_0x1db8('0x1d')]);}_0x7eb185['order']=qs[_0x1db8('0x38')](_0x14cb4e[_0x1db8('0x31')][_0x1db8('0x38')]);_0x7eb185[_0x1db8('0x39')]=qs[_0x1db8('0x32')](_[_0x1db8('0x3a')](_0x14cb4e[_0x1db8('0x31')],_0x483ede[_0x1db8('0x32')]),_0x47b94e);if(_0x14cb4e[_0x1db8('0x31')]['filter']){_0x7eb185[_0x1db8('0x39')]=_[_0x1db8('0x3b')](_0x7eb185['where'],{'$or':_[_0x1db8('0x2b')](_0x47b94e,function(_0x55ca88){if(_0x55ca88[_0x1db8('0x2f')]!==_0x1db8('0x3c')){var _0x2327ff={};_0x2327ff[_0x55ca88['name']]={'$like':'%'+_0x14cb4e[_0x1db8('0x31')][_0x1db8('0x3d')]+'%'};return _0x2327ff;}})});}_0x7eb185=_[_0x1db8('0x3b')]({},_0x7eb185,_0x14cb4e[_0x1db8('0x3e')]);var _0x3a4afb={'where':_0x7eb185[_0x1db8('0x39')]};return db[_0x1db8('0x2c')]['count'](_0x3a4afb)[_0x1db8('0x25')](function(_0x476bb0){_0x3d4ff7['count']=_0x476bb0;if(_0x14cb4e[_0x1db8('0x31')][_0x1db8('0x3f')]){_0x7eb185[_0x1db8('0x40')]=[{'all':!![]}];}return db[_0x1db8('0x2c')][_0x1db8('0x41')](_0x7eb185);})['then'](function(_0x219fe9){_0x3d4ff7[_0x1db8('0x42')]=_0x219fe9;return _0x3d4ff7;})[_0x1db8('0x25')](respondWithFilteredResult(_0x53095e,_0x7eb185))[_0x1db8('0x43')](handleError(_0x53095e,null));};exports[_0x1db8('0x44')]=function(_0x15e942,_0x57d488){var _0x3ad5dc={'raw':![],'where':{'id':_0x15e942['params']['id']}},_0xeb4fe8={};_0xeb4fe8['model']=_[_0x1db8('0x45')](db[_0x1db8('0x2c')][_0x1db8('0x2d')]);_0xeb4fe8[_0x1db8('0x31')]=_['keys'](_0x15e942[_0x1db8('0x31')]);_0xeb4fe8[_0x1db8('0x32')]=_['intersection'](_0xeb4fe8[_0x1db8('0x35')],_0xeb4fe8[_0x1db8('0x31')]);_0x3ad5dc[_0x1db8('0x34')]=_['intersection'](_0xeb4fe8[_0x1db8('0x35')],qs['fields'](_0x15e942[_0x1db8('0x31')]['fields']));_0x3ad5dc[_0x1db8('0x34')]=_0x3ad5dc[_0x1db8('0x34')][_0x1db8('0x46')]?_0x3ad5dc[_0x1db8('0x34')]:_0xeb4fe8['model'];if(_0x15e942[_0x1db8('0x31')][_0x1db8('0x3f')]){_0x3ad5dc['include']=[{'all':!![]}];}_0x3ad5dc=_[_0x1db8('0x3b')]({},_0x3ad5dc,_0x15e942[_0x1db8('0x3e')]);return db[_0x1db8('0x2c')][_0x1db8('0x47')](_0x3ad5dc)[_0x1db8('0x25')](handleEntityNotFound(_0x57d488,null))['then'](respondWithResult(_0x57d488,null))['catch'](handleError(_0x57d488,null));};exports['create']=function(_0x388f8a,_0xa847ca){return db[_0x1db8('0x2c')][_0x1db8('0x48')](_0x388f8a['body'],{})[_0x1db8('0x25')](respondWithResult(_0xa847ca,0xc9))[_0x1db8('0x43')](handleError(_0xa847ca,null));};exports[_0x1db8('0x24')]=function(_0x5051ec,_0x5a32cb){if(_0x5051ec[_0x1db8('0x49')]['id']){delete _0x5051ec[_0x1db8('0x49')]['id'];}return db[_0x1db8('0x2c')][_0x1db8('0x47')]({'where':{'id':_0x5051ec[_0x1db8('0x4a')]['id']}})[_0x1db8('0x25')](handleEntityNotFound(_0x5a32cb,null))[_0x1db8('0x25')](saveUpdates(_0x5051ec[_0x1db8('0x49')],null))[_0x1db8('0x25')](respondWithResult(_0x5a32cb,null))[_0x1db8('0x43')](handleError(_0x5a32cb,null));};exports['destroy']=function(_0x30d4c3,_0x36c9e2){return db[_0x1db8('0x2c')][_0x1db8('0x47')]({'where':{'id':_0x30d4c3['params']['id']}})[_0x1db8('0x25')](handleEntityNotFound(_0x36c9e2,null))[_0x1db8('0x25')](removeEntity(_0x36c9e2,null))[_0x1db8('0x43')](handleError(_0x36c9e2,null));};exports[_0x1db8('0x4b')]=function(_0x1fa205,_0x853599,_0x122771){var _0x4bcd91={};var _0x1e7ff5={};var _0x1935d3;var _0x412d0e;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x1fa205[_0x1db8('0x4a')]['id']}})[_0x1db8('0x25')](handleEntityNotFound(_0x853599,null))[_0x1db8('0x25')](function(_0x5f35d3){if(_0x5f35d3){_0x1935d3=_0x5f35d3;_0x1e7ff5['model']=_[_0x1db8('0x45')](db[_0x1db8('0x4c')][_0x1db8('0x2d')]);_0x1e7ff5['query']=_[_0x1db8('0x45')](_0x1fa205[_0x1db8('0x31')]);_0x1e7ff5[_0x1db8('0x32')]=_[_0x1db8('0x33')](_0x1e7ff5['model'],_0x1e7ff5[_0x1db8('0x31')]);_0x4bcd91[_0x1db8('0x34')]=_[_0x1db8('0x33')](_0x1e7ff5[_0x1db8('0x35')],qs['fields'](_0x1fa205[_0x1db8('0x31')][_0x1db8('0x36')]));_0x4bcd91[_0x1db8('0x34')]=_0x4bcd91['attributes'][_0x1db8('0x46')]?_0x4bcd91[_0x1db8('0x34')]:_0x1e7ff5['model'];_0x4bcd91[_0x1db8('0x4d')]=qs[_0x1db8('0x38')](_0x1fa205[_0x1db8('0x31')][_0x1db8('0x38')]);_0x4bcd91[_0x1db8('0x39')]=qs[_0x1db8('0x32')](_[_0x1db8('0x3a')](_0x1fa205[_0x1db8('0x31')],_0x1e7ff5[_0x1db8('0x32')]));if(_0x1fa205['query'][_0x1db8('0x3d')]){_0x4bcd91['where']=_[_0x1db8('0x3b')](_0x4bcd91[_0x1db8('0x39')],{'$or':_[_0x1db8('0x2b')](_0x4bcd91[_0x1db8('0x34')],function(_0x2ff3b9){var _0x4ac7fc={};_0x4ac7fc[_0x2ff3b9]={'$like':'%'+_0x1fa205[_0x1db8('0x31')]['filter']+'%'};return _0x4ac7fc;})});}_0x4bcd91=_[_0x1db8('0x3b')]({},_0x4bcd91,_0x1fa205[_0x1db8('0x3e')]);return _0x1935d3[_0x1db8('0x4b')](_0x4bcd91);}})[_0x1db8('0x25')](function(_0x595ee8){if(_0x595ee8){_0x412d0e=_0x595ee8['length'];if(!_0x1fa205[_0x1db8('0x31')][_0x1db8('0x37')]('nolimit')){_0x4bcd91[_0x1db8('0x1f')]=qs[_0x1db8('0x1f')](_0x1fa205[_0x1db8('0x31')]['limit']);_0x4bcd91['offset']=qs['offset'](_0x1fa205[_0x1db8('0x31')][_0x1db8('0x1d')]);}return _0x1935d3[_0x1db8('0x4b')](_0x4bcd91);}})[_0x1db8('0x25')](function(_0xd97e67){if(_0xd97e67){return _0xd97e67?{'count':_0x412d0e,'rows':_0xd97e67}:null;}})[_0x1db8('0x25')](respondWithResult(_0x853599,null))[_0x1db8('0x43')](handleError(_0x853599,null));};exports['getSubjects']=function(_0x424446,_0x4aad62,_0x1e5de4){var _0x3b3b99={};var _0x41d288={};var _0xb97b0;var _0x273284;return db['VtigerConfiguration'][_0x1db8('0x4e')]({'where':{'id':_0x424446[_0x1db8('0x4a')]['id']}})[_0x1db8('0x25')](handleEntityNotFound(_0x4aad62,null))[_0x1db8('0x25')](function(_0x2a251b){if(_0x2a251b){_0xb97b0=_0x2a251b;_0x41d288[_0x1db8('0x35')]=_[_0x1db8('0x45')](db[_0x1db8('0x4c')][_0x1db8('0x2d')]);_0x41d288['query']=_[_0x1db8('0x45')](_0x424446[_0x1db8('0x31')]);_0x41d288['filters']=_['intersection'](_0x41d288['model'],_0x41d288['query']);_0x3b3b99[_0x1db8('0x34')]=_[_0x1db8('0x33')](_0x41d288[_0x1db8('0x35')],qs['fields'](_0x424446[_0x1db8('0x31')][_0x1db8('0x36')]));_0x3b3b99[_0x1db8('0x34')]=_0x3b3b99[_0x1db8('0x34')]['length']?_0x3b3b99[_0x1db8('0x34')]:_0x41d288[_0x1db8('0x35')];_0x3b3b99[_0x1db8('0x4d')]=qs[_0x1db8('0x38')](_0x424446[_0x1db8('0x31')][_0x1db8('0x38')]);_0x3b3b99[_0x1db8('0x39')]=qs[_0x1db8('0x32')](_[_0x1db8('0x3a')](_0x424446['query'],_0x41d288[_0x1db8('0x32')]));if(_0x424446[_0x1db8('0x31')][_0x1db8('0x3d')]){_0x3b3b99[_0x1db8('0x39')]=_[_0x1db8('0x3b')](_0x3b3b99[_0x1db8('0x39')],{'$or':_['map'](_0x3b3b99[_0x1db8('0x34')],function(_0x5ea483){var _0x1cf7a1={};_0x1cf7a1[_0x5ea483]={'$like':'%'+_0x424446[_0x1db8('0x31')]['filter']+'%'};return _0x1cf7a1;})});}_0x3b3b99=_['merge']({},_0x3b3b99,_0x424446[_0x1db8('0x3e')]);return _0xb97b0['getSubjects'](_0x3b3b99);}})[_0x1db8('0x25')](function(_0x9acc4){if(_0x9acc4){_0x273284=_0x9acc4[_0x1db8('0x46')];if(!_0x424446['query'][_0x1db8('0x37')]('nolimit')){_0x3b3b99['limit']=qs[_0x1db8('0x1f')](_0x424446[_0x1db8('0x31')]['limit']);_0x3b3b99['offset']=qs[_0x1db8('0x1d')](_0x424446['query']['offset']);}return _0xb97b0[_0x1db8('0x4f')](_0x3b3b99);}})[_0x1db8('0x25')](function(_0x303324){if(_0x303324){return _0x303324?{'count':_0x273284,'rows':_0x303324}:null;}})[_0x1db8('0x25')](respondWithResult(_0x4aad62,null))[_0x1db8('0x43')](handleError(_0x4aad62,null));};exports[_0x1db8('0x50')]=function(_0x4d38e4,_0x27fd70,_0x2b144e){var _0x4e507a={};var _0x469d9a={};var _0xb7b61e;var _0x191277;return db[_0x1db8('0x2c')][_0x1db8('0x4e')]({'where':{'id':_0x4d38e4[_0x1db8('0x4a')]['id']}})[_0x1db8('0x25')](handleEntityNotFound(_0x27fd70,null))[_0x1db8('0x25')](function(_0x2a4587){if(_0x2a4587){_0xb7b61e=_0x2a4587;_0x469d9a[_0x1db8('0x35')]=_[_0x1db8('0x45')](db[_0x1db8('0x4c')]['rawAttributes']);_0x469d9a[_0x1db8('0x31')]=_['keys'](_0x4d38e4['query']);_0x469d9a[_0x1db8('0x32')]=_[_0x1db8('0x33')](_0x469d9a['model'],_0x469d9a[_0x1db8('0x31')]);_0x4e507a[_0x1db8('0x34')]=_[_0x1db8('0x33')](_0x469d9a[_0x1db8('0x35')],qs[_0x1db8('0x36')](_0x4d38e4[_0x1db8('0x31')][_0x1db8('0x36')]));_0x4e507a['attributes']=_0x4e507a[_0x1db8('0x34')][_0x1db8('0x46')]?_0x4e507a[_0x1db8('0x34')]:_0x469d9a[_0x1db8('0x35')];_0x4e507a[_0x1db8('0x4d')]=qs[_0x1db8('0x38')](_0x4d38e4[_0x1db8('0x31')][_0x1db8('0x38')]);_0x4e507a[_0x1db8('0x39')]=qs['filters'](_[_0x1db8('0x3a')](_0x4d38e4[_0x1db8('0x31')],_0x469d9a[_0x1db8('0x32')]));if(_0x4d38e4[_0x1db8('0x31')][_0x1db8('0x3d')]){_0x4e507a['where']=_[_0x1db8('0x3b')](_0x4e507a['where'],{'$or':_[_0x1db8('0x2b')](_0x4e507a[_0x1db8('0x34')],function(_0xfaf94e){var _0x29eb30={};_0x29eb30[_0xfaf94e]={'$like':'%'+_0x4d38e4[_0x1db8('0x31')][_0x1db8('0x3d')]+'%'};return _0x29eb30;})});}_0x4e507a=_['merge']({},_0x4e507a,_0x4d38e4['options']);return _0xb7b61e['getDescriptions'](_0x4e507a);}})[_0x1db8('0x25')](function(_0x4f47a0){if(_0x4f47a0){_0x191277=_0x4f47a0[_0x1db8('0x46')];if(!_0x4d38e4['query']['hasOwnProperty']('nolimit')){_0x4e507a[_0x1db8('0x1f')]=qs['limit'](_0x4d38e4[_0x1db8('0x31')][_0x1db8('0x1f')]);_0x4e507a['offset']=qs[_0x1db8('0x1d')](_0x4d38e4['query']['offset']);}return _0xb7b61e[_0x1db8('0x50')](_0x4e507a);}})[_0x1db8('0x25')](function(_0x348abf){if(_0x348abf){return _0x348abf?{'count':_0x191277,'rows':_0x348abf}:null;}})[_0x1db8('0x25')](respondWithResult(_0x27fd70,null))['catch'](handleError(_0x27fd70,null));};
\ No newline at end of file
index 0968c14..74cbb33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b37=['int_vtiger_configurations','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes'];(function(_0x46a671,_0x758e9a){var _0x526d75=function(_0xde3640){while(--_0xde3640){_0x46a671['push'](_0x46a671['shift']());}};_0x526d75(++_0x758e9a);}(_0x8b37,0xf1));var _0x78b3=function(_0x6f2671,_0x4f16ad){_0x6f2671=_0x6f2671-0x0;var _0x873b3c=_0x8b37[_0x6f2671];return _0x873b3c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x78b3('0x0'))(_0x78b3('0x1'));var moment=require(_0x78b3('0x2'));var BPromise=require(_0x78b3('0x3'));var rp=require(_0x78b3('0x4'));var fs=require('fs');var path=require(_0x78b3('0x5'));var rimraf=require(_0x78b3('0x6'));var config=require(_0x78b3('0x7'));var attributes=require(_0x78b3('0x8'));module['exports']=function(_0x46c24f,_0x319771){return _0x46c24f['define']('VtigerConfiguration',attributes,{'tableName':_0x78b3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x53cd=['exports','define','VtigerConfiguration','int_vtiger_configurations','../../config/logger','request-promise','rimraf','./intVtigerConfiguration.attributes'];(function(_0xcb4cdc,_0x42032f){var _0x21ca5b=function(_0x179c8c){while(--_0x179c8c){_0xcb4cdc['push'](_0xcb4cdc['shift']());}};_0x21ca5b(++_0x42032f);}(_0x53cd,0x15c));var _0xd53c=function(_0x3874ef,_0x373424){_0x3874ef=_0x3874ef-0x0;var _0x185561=_0x53cd[_0x3874ef];return _0x185561;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd53c('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd53c('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd53c('0x2'));var config=require('../../config/environment');var attributes=require(_0xd53c('0x3'));module[_0xd53c('0x4')]=function(_0x551a66,_0x574296){return _0x551a66[_0xd53c('0x5')](_0xd53c('0x6'),attributes,{'tableName':_0xd53c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e4e1062..65a74ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb0a=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3d18c9,_0x3c4754){var _0x434b12=function(_0x20275e){while(--_0x20275e){_0x3d18c9['push'](_0x3d18c9['shift']());}};_0x434b12(++_0x3c4754);}(_0xeb0a,0x70));var _0xaeb0=function(_0x456b57,_0x58691a){_0x456b57=_0x456b57-0x0;var _0x18f49f=_0xeb0a[_0x456b57];return _0x18f49f;};'use strict';var _=require(_0xaeb0('0x0'));var util=require(_0xaeb0('0x1'));var moment=require(_0xaeb0('0x2'));var BPromise=require(_0xaeb0('0x3'));var rs=require(_0xaeb0('0x4'));var fs=require('fs');var Redis=require(_0xaeb0('0x5'));var db=require(_0xaeb0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xaeb0('0x7'))(_0xaeb0('0x8'));var config=require(_0xaeb0('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x26304c,_0x2b58ab,_0x3734d0){return new BPromise(function(_0x166ecb,_0x35bc65){return client[_0xaeb0('0xa')](_0x26304c,_0x3734d0)[_0xaeb0('0xb')](function(_0x73728e){logger[_0xaeb0('0xc')](_0xaeb0('0xd'),_0x2b58ab,_0xaeb0('0xe'));logger[_0xaeb0('0xf')](_0xaeb0('0x10'),_0x2b58ab,_0xaeb0('0xe'),JSON[_0xaeb0('0x11')](_0x73728e));if(_0x73728e[_0xaeb0('0x12')]){if(_0x73728e['error'][_0xaeb0('0x13')]===0x1f4){logger[_0xaeb0('0x12')](_0xaeb0('0xd'),_0x2b58ab,_0x73728e[_0xaeb0('0x12')]['message']);return _0x35bc65(_0x73728e[_0xaeb0('0x12')][_0xaeb0('0x14')]);}logger[_0xaeb0('0x12')]('VtigerConfiguration,\x20%s,\x20%s',_0x2b58ab,_0x73728e['error'][_0xaeb0('0x14')]);return _0x166ecb(_0x73728e[_0xaeb0('0x12')][_0xaeb0('0x14')]);}else{logger['info'](_0xaeb0('0xd'),_0x2b58ab,'request\x20sent');_0x166ecb(_0x73728e[_0xaeb0('0x15')][_0xaeb0('0x14')]);}})['catch'](function(_0x3e249b){logger[_0xaeb0('0x12')](_0xaeb0('0xd'),_0x2b58ab,_0x3e249b);_0x35bc65(_0x3e249b);});});}
\ No newline at end of file
+var _0x40fe=['error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x40fe,0x175));var _0xe40f=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x40fe[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xe40f('0x0'));var util=require(_0xe40f('0x1'));var moment=require(_0xe40f('0x2'));var BPromise=require(_0xe40f('0x3'));var rs=require(_0xe40f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe40f('0x5'))['db'];var utils=require(_0xe40f('0x6'));var logger=require('../../config/logger')(_0xe40f('0x7'));var config=require(_0xe40f('0x8'));var jayson=require(_0xe40f('0x9'));var client=jayson[_0xe40f('0xa')][_0xe40f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1db810,_0x115266,_0x5beac2){return new BPromise(function(_0x1b4f1e,_0x3a5e58){return client[_0xe40f('0xc')](_0x1db810,_0x5beac2)[_0xe40f('0xd')](function(_0x3b9dfd){logger['info'](_0xe40f('0xe'),_0x115266,_0xe40f('0xf'));logger['debug'](_0xe40f('0x10'),_0x115266,_0xe40f('0xf'),JSON[_0xe40f('0x11')](_0x3b9dfd));if(_0x3b9dfd['error']){if(_0x3b9dfd[_0xe40f('0x12')][_0xe40f('0x13')]===0x1f4){logger[_0xe40f('0x12')](_0xe40f('0xe'),_0x115266,_0x3b9dfd[_0xe40f('0x12')]['message']);return _0x3a5e58(_0x3b9dfd['error']['message']);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x115266,_0x3b9dfd[_0xe40f('0x12')][_0xe40f('0x14')]);return _0x1b4f1e(_0x3b9dfd[_0xe40f('0x12')][_0xe40f('0x14')]);}else{logger[_0xe40f('0x15')](_0xe40f('0xe'),_0x115266,_0xe40f('0xf'));_0x1b4f1e(_0x3b9dfd['result'][_0xe40f('0x14')]);}})[_0xe40f('0x16')](function(_0x4c89e5){logger['error'](_0xe40f('0xe'),_0x115266,_0x4c89e5);_0x3a5e58(_0x4c89e5);});});}
\ No newline at end of file
index 5830eb6..e8965e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8904=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','show','delete','destroy','exports','connect-timeout','express','Router','fs-extra'];(function(_0x5089ea,_0x3d8378){var _0xabe953=function(_0x18e67e){while(--_0x18e67e){_0x5089ea['push'](_0x5089ea['shift']());}};_0xabe953(++_0x3d8378);}(_0x8904,0xdd));var _0x4890=function(_0x2cadaa,_0x140520){_0x2cadaa=_0x2cadaa-0x0;var _0x56e0a9=_0x8904[_0x2cadaa];return _0x56e0a9;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x4890('0x0'));var express=require(_0x4890('0x1'));var router=express[_0x4890('0x2')]();var fs_extra=require(_0x4890('0x3'));var auth=require(_0x4890('0x4'));var interaction=require(_0x4890('0x5'));var config=require(_0x4890('0x6'));var controller=require(_0x4890('0x7'));router[_0x4890('0x8')]('/',auth[_0x4890('0x9')](),controller[_0x4890('0xa')]);router[_0x4890('0x8')]('/:id',auth[_0x4890('0x9')](),controller[_0x4890('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x4890('0x9')](),controller['update']);router[_0x4890('0xc')]('/:id',auth[_0x4890('0x9')](),controller[_0x4890('0xd')]);module[_0x4890('0xe')]=router;
\ No newline at end of file
+var _0x8fa6=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','destroy','exports','multer','util'];(function(_0x554d5a,_0x7e474f){var _0x1f219f=function(_0x562921){while(--_0x562921){_0x554d5a['push'](_0x554d5a['shift']());}};_0x1f219f(++_0x7e474f);}(_0x8fa6,0x19c));var _0x68fa=function(_0x219e19,_0x972a89){_0x219e19=_0x219e19-0x0;var _0x8fafa=_0x8fa6[_0x219e19];return _0x8fafa;};'use strict';var multer=require(_0x68fa('0x0'));var util=require(_0x68fa('0x1'));var path=require(_0x68fa('0x2'));var timeout=require(_0x68fa('0x3'));var express=require(_0x68fa('0x4'));var router=express[_0x68fa('0x5')]();var fs_extra=require(_0x68fa('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x68fa('0x7'));var config=require(_0x68fa('0x8'));var controller=require('./intVtigerField.controller');router[_0x68fa('0x9')]('/',auth[_0x68fa('0xa')](),controller[_0x68fa('0xb')]);router[_0x68fa('0x9')](_0x68fa('0xc'),auth[_0x68fa('0xa')](),controller[_0x68fa('0xd')]);router[_0x68fa('0xe')]('/',auth[_0x68fa('0xa')](),controller[_0x68fa('0xf')]);router['put']('/:id',auth[_0x68fa('0xa')](),controller['update']);router['delete']('/:id',auth[_0x68fa('0xa')](),controller[_0x68fa('0x10')]);module[_0x68fa('0x11')]=router;
\ No newline at end of file
index beebdc1..5407c0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1418=['STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist'];(function(_0x114e5a,_0x6ec839){var _0x2f7243=function(_0xdd330b){while(--_0xdd330b){_0x114e5a['push'](_0x114e5a['shift']());}};_0x2f7243(++_0x6ec839);}(_0x1418,0x18e));var _0x8141=function(_0x4886e8,_0x1208da){_0x4886e8=_0x4886e8-0x0;var _0x536219=_0x1418[_0x4886e8];return _0x536219;};'use strict';var Sequelize=require(_0x8141('0x0'));module[_0x8141('0x1')]={'type':{'type':Sequelize[_0x8141('0x2')]('string',_0x8141('0x3'),_0x8141('0x4'),_0x8141('0x5'),_0x8141('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8141('0x7')]},'key':{'type':Sequelize[_0x8141('0x7')]},'keyType':{'type':Sequelize[_0x8141('0x2')]('string','variable',_0x8141('0x4'))},'keyContent':{'type':Sequelize[_0x8141('0x7')]},'idField':{'type':Sequelize[_0x8141('0x7')]},'nameField':{'type':Sequelize[_0x8141('0x7')]},'customField':{'type':Sequelize[_0x8141('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x6b5c=['exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x6b5c,0xce));var _0xc6b5=function(_0x309d93,_0x157662){_0x309d93=_0x309d93-0x0;var _0x2dd61d=_0x6b5c[_0x309d93];return _0x2dd61d;};'use strict';var Sequelize=require(_0xc6b5('0x0'));module[_0xc6b5('0x1')]={'type':{'type':Sequelize[_0xc6b5('0x2')](_0xc6b5('0x3'),_0xc6b5('0x4'),_0xc6b5('0x5'),_0xc6b5('0x6'),'picklist'),'defaultValue':_0xc6b5('0x3')},'content':{'type':Sequelize[_0xc6b5('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xc6b5('0x2')](_0xc6b5('0x3'),_0xc6b5('0x4'),_0xc6b5('0x5'))},'keyContent':{'type':Sequelize[_0xc6b5('0x7')]},'idField':{'type':Sequelize[_0xc6b5('0x7')]},'nameField':{'type':Sequelize[_0xc6b5('0x7')]},'customField':{'type':Sequelize[_0xc6b5('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 654dc48..ca2e63e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ee2=['keys','query','filters','attributes','intersection','fields','length','nolimit','sort','pick','filter','merge','VIRTUAL','where','includeAll','show','options','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','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','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','stack','name','send','map','VtigerField','rawAttributes','fieldName','type','key','model'];(function(_0x3fdcf6,_0x2fc65c){var _0x6348fd=function(_0x107b40){while(--_0x107b40){_0x3fdcf6['push'](_0x3fdcf6['shift']());}};_0x6348fd(++_0x2fc65c);}(_0x4ee2,0x1e4));var _0x24ee=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4ee2[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0x24ee('0x0'));var rimraf=require(_0x24ee('0x1'));var zipdir=require(_0x24ee('0x2'));var jsonpatch=require(_0x24ee('0x3'));var rp=require(_0x24ee('0x4'));var moment=require(_0x24ee('0x5'));var BPromise=require(_0x24ee('0x6'));var Mustache=require(_0x24ee('0x7'));var util=require(_0x24ee('0x8'));var path=require(_0x24ee('0x9'));var sox=require(_0x24ee('0xa'));var csv=require(_0x24ee('0xb'));var ejs=require(_0x24ee('0xc'));var fs=require('fs');var fs_extra=require(_0x24ee('0xd'));var _=require(_0x24ee('0xe'));var squel=require(_0x24ee('0xf'));var crypto=require(_0x24ee('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x24ee('0x11'));var toCsv=require('to-csv');var querystring=require(_0x24ee('0x12'));var Papa=require(_0x24ee('0x13'));var Redis=require(_0x24ee('0x14'));var authService=require(_0x24ee('0x15'));var qs=require(_0x24ee('0x16'));var as=require(_0x24ee('0x17'));var hardwareService=require(_0x24ee('0x18'));var logger=require(_0x24ee('0x19'))(_0x24ee('0x1a'));var utils=require(_0x24ee('0x1b'));var config=require(_0x24ee('0x1c'));var licenseUtil=require('../../config/license/util');var db=require(_0x24ee('0x1d'))['db'];function respondWithStatusCode(_0x7834bd,_0x37ffe0){_0x37ffe0=_0x37ffe0||0xcc;return function(_0x3b577d){if(_0x3b577d){return _0x7834bd[_0x24ee('0x1e')](_0x37ffe0);}return _0x7834bd[_0x24ee('0x1f')](_0x37ffe0)[_0x24ee('0x20')]();};}function respondWithResult(_0x31c204,_0x46e301){_0x46e301=_0x46e301||0xc8;return function(_0x144753){if(_0x144753){return _0x31c204['status'](_0x46e301)['json'](_0x144753);}};}function respondWithFilteredResult(_0x4e7792,_0x2461ab){return function(_0x118ce8){if(_0x118ce8){var _0x2b811e=typeof _0x2461ab[_0x24ee('0x21')]==='undefined'&&typeof _0x2461ab[_0x24ee('0x22')]===_0x24ee('0x23');var _0x226f1a=_0x118ce8[_0x24ee('0x24')];var _0x499c3e=_0x2b811e?0x0:_0x2461ab[_0x24ee('0x21')];var _0x23c7d9=_0x2b811e?_0x118ce8[_0x24ee('0x24')]:_0x2461ab[_0x24ee('0x21')]+_0x2461ab[_0x24ee('0x22')];var _0x156fc0;if(_0x23c7d9>=_0x226f1a){_0x23c7d9=_0x226f1a;_0x156fc0=0xc8;}else{_0x156fc0=0xce;}_0x4e7792[_0x24ee('0x1f')](_0x156fc0);return _0x4e7792[_0x24ee('0x25')](_0x24ee('0x26'),_0x499c3e+'-'+_0x23c7d9+'/'+_0x226f1a)[_0x24ee('0x27')](_0x118ce8);}return null;};}function patchUpdates(_0x2dfb40){return function(_0x1a2c0c){try{jsonpatch['apply'](_0x1a2c0c,_0x2dfb40,!![]);}catch(_0x1eb3c4){return BPromise[_0x24ee('0x28')](_0x1eb3c4);}return _0x1a2c0c[_0x24ee('0x29')]();};}function saveUpdates(_0xa811d2,_0xccd92a){return function(_0x360604){if(_0x360604){return _0x360604[_0x24ee('0x2a')](_0xa811d2)[_0x24ee('0x2b')](function(_0x2758c6){return _0x2758c6;});}return null;};}function removeEntity(_0x575c81,_0x3f8a4b){return function(_0x257a61){if(_0x257a61){return _0x257a61[_0x24ee('0x2c')]()[_0x24ee('0x2b')](function(){_0x575c81[_0x24ee('0x1f')](0xcc)[_0x24ee('0x20')]();});}};}function handleEntityNotFound(_0x5bf822,_0x2cfb7e){return function(_0xf15d52){if(!_0xf15d52){_0x5bf822['sendStatus'](0x194);}return _0xf15d52;};}function handleError(_0x5923c9,_0x14e6b8){_0x14e6b8=_0x14e6b8||0x1f4;return function(_0x279bdf){logger['error'](_0x279bdf[_0x24ee('0x2d')]);if(_0x279bdf[_0x24ee('0x2e')]){delete _0x279bdf[_0x24ee('0x2e')];}_0x5923c9[_0x24ee('0x1f')](_0x14e6b8)[_0x24ee('0x2f')](_0x279bdf);};}exports['index']=function(_0x32e44e,_0x4f9b00){var _0x216c9c={},_0x8f9d30={},_0x5e4f07={'count':0x0,'rows':[]};var _0xdfd584=_[_0x24ee('0x30')](db[_0x24ee('0x31')][_0x24ee('0x32')],function(_0x5516f4){return{'name':_0x5516f4[_0x24ee('0x33')],'type':_0x5516f4[_0x24ee('0x34')][_0x24ee('0x35')]};});_0x8f9d30[_0x24ee('0x36')]=_[_0x24ee('0x30')](_0xdfd584,_0x24ee('0x2e'));_0x8f9d30['query']=_[_0x24ee('0x37')](_0x32e44e[_0x24ee('0x38')]);_0x8f9d30[_0x24ee('0x39')]=_['intersection'](_0x8f9d30[_0x24ee('0x36')],_0x8f9d30[_0x24ee('0x38')]);_0x216c9c[_0x24ee('0x3a')]=_[_0x24ee('0x3b')](_0x8f9d30[_0x24ee('0x36')],qs['fields'](_0x32e44e[_0x24ee('0x38')][_0x24ee('0x3c')]));_0x216c9c['attributes']=_0x216c9c[_0x24ee('0x3a')][_0x24ee('0x3d')]?_0x216c9c[_0x24ee('0x3a')]:_0x8f9d30[_0x24ee('0x36')];if(!_0x32e44e['query']['hasOwnProperty'](_0x24ee('0x3e'))){_0x216c9c['limit']=qs[_0x24ee('0x22')](_0x32e44e['query'][_0x24ee('0x22')]);_0x216c9c[_0x24ee('0x21')]=qs[_0x24ee('0x21')](_0x32e44e['query'][_0x24ee('0x21')]);}_0x216c9c['order']=qs[_0x24ee('0x3f')](_0x32e44e[_0x24ee('0x38')]['sort']);_0x216c9c['where']=qs[_0x24ee('0x39')](_[_0x24ee('0x40')](_0x32e44e[_0x24ee('0x38')],_0x8f9d30[_0x24ee('0x39')]),_0xdfd584);if(_0x32e44e[_0x24ee('0x38')][_0x24ee('0x41')]){_0x216c9c['where']=_[_0x24ee('0x42')](_0x216c9c['where'],{'$or':_['map'](_0xdfd584,function(_0x3edb9d){if(_0x3edb9d[_0x24ee('0x34')]!==_0x24ee('0x43')){var _0x126293={};_0x126293[_0x3edb9d[_0x24ee('0x2e')]]={'$like':'%'+_0x32e44e[_0x24ee('0x38')][_0x24ee('0x41')]+'%'};return _0x126293;}})});}_0x216c9c=_['merge']({},_0x216c9c,_0x32e44e['options']);var _0x4ee70c={'where':_0x216c9c[_0x24ee('0x44')]};return db['VtigerField'][_0x24ee('0x24')](_0x4ee70c)[_0x24ee('0x2b')](function(_0x59313e){_0x5e4f07[_0x24ee('0x24')]=_0x59313e;if(_0x32e44e[_0x24ee('0x38')][_0x24ee('0x45')]){_0x216c9c['include']=[{'all':!![]}];}return db[_0x24ee('0x31')]['findAll'](_0x216c9c);})['then'](function(_0x3d4058){_0x5e4f07['rows']=_0x3d4058;return _0x5e4f07;})[_0x24ee('0x2b')](respondWithFilteredResult(_0x4f9b00,_0x216c9c))['catch'](handleError(_0x4f9b00,null));};exports[_0x24ee('0x46')]=function(_0x100ded,_0x39e5c4){var _0x4f57f9={'raw':!![],'where':{'id':_0x100ded['params']['id']}},_0x4c89dd={};_0x4c89dd[_0x24ee('0x36')]=_[_0x24ee('0x37')](db['VtigerField'][_0x24ee('0x32')]);_0x4c89dd[_0x24ee('0x38')]=_[_0x24ee('0x37')](_0x100ded[_0x24ee('0x38')]);_0x4c89dd[_0x24ee('0x39')]=_[_0x24ee('0x3b')](_0x4c89dd[_0x24ee('0x36')],_0x4c89dd['query']);_0x4f57f9['attributes']=_[_0x24ee('0x3b')](_0x4c89dd[_0x24ee('0x36')],qs[_0x24ee('0x3c')](_0x100ded[_0x24ee('0x38')][_0x24ee('0x3c')]));_0x4f57f9['attributes']=_0x4f57f9[_0x24ee('0x3a')]['length']?_0x4f57f9[_0x24ee('0x3a')]:_0x4c89dd[_0x24ee('0x36')];if(_0x100ded[_0x24ee('0x38')]['includeAll']){_0x4f57f9['include']=[{'all':!![]}];}_0x4f57f9=_[_0x24ee('0x42')]({},_0x4f57f9,_0x100ded[_0x24ee('0x47')]);return db[_0x24ee('0x31')][_0x24ee('0x48')](_0x4f57f9)[_0x24ee('0x2b')](handleEntityNotFound(_0x39e5c4,null))['then'](respondWithResult(_0x39e5c4,null))[_0x24ee('0x49')](handleError(_0x39e5c4,null));};exports[_0x24ee('0x4a')]=function(_0x51a243,_0x41ced8){return db['VtigerField'][_0x24ee('0x4a')](_0x51a243[_0x24ee('0x4b')],{})[_0x24ee('0x2b')](respondWithResult(_0x41ced8,0xc9))[_0x24ee('0x49')](handleError(_0x41ced8,null));};exports[_0x24ee('0x2a')]=function(_0x29bf64,_0x348de6){if(_0x29bf64['body']['id']){delete _0x29bf64[_0x24ee('0x4b')]['id'];}return db[_0x24ee('0x31')]['find']({'where':{'id':_0x29bf64[_0x24ee('0x4c')]['id']}})['then'](handleEntityNotFound(_0x348de6,null))[_0x24ee('0x2b')](saveUpdates(_0x29bf64[_0x24ee('0x4b')],null))['then'](respondWithResult(_0x348de6,null))[_0x24ee('0x49')](handleError(_0x348de6,null));};exports['destroy']=function(_0x4e950d,_0x56cc9b){return db['VtigerField'][_0x24ee('0x48')]({'where':{'id':_0x4e950d['params']['id']}})[_0x24ee('0x2b')](handleEntityNotFound(_0x56cc9b,null))[_0x24ee('0x2b')](removeEntity(_0x56cc9b,null))[_0x24ee('0x49')](handleError(_0x56cc9b,null));};
\ No newline at end of file
+var _0x910b=['params','include','find','create','body','destroy','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','index','map','VtigerField','rawAttributes','key','name','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','catch'];(function(_0x528bb5,_0x119c5b){var _0x58e8ca=function(_0x5a8077){while(--_0x5a8077){_0x528bb5['push'](_0x528bb5['shift']());}};_0x58e8ca(++_0x119c5b);}(_0x910b,0x98));var _0xb910=function(_0x347d46,_0x54b037){_0x347d46=_0x347d46-0x0;var _0x17b251=_0x910b[_0x347d46];return _0x17b251;};'use strict';var emlformat=require(_0xb910('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb910('0x1'));var rp=require(_0xb910('0x2'));var moment=require(_0xb910('0x3'));var BPromise=require(_0xb910('0x4'));var Mustache=require(_0xb910('0x5'));var util=require(_0xb910('0x6'));var path=require(_0xb910('0x7'));var sox=require(_0xb910('0x8'));var csv=require(_0xb910('0x9'));var ejs=require(_0xb910('0xa'));var fs=require('fs');var fs_extra=require(_0xb910('0xb'));var _=require(_0xb910('0xc'));var squel=require('squel');var crypto=require(_0xb910('0xd'));var jsforce=require(_0xb910('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb910('0x9'));var querystring=require(_0xb910('0xf'));var Papa=require(_0xb910('0x10'));var Redis=require(_0xb910('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb910('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb910('0x13'))(_0xb910('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb910('0x15'));var db=require(_0xb910('0x16'))['db'];function respondWithStatusCode(_0x1143f4,_0x3a99c2){_0x3a99c2=_0x3a99c2||0xcc;return function(_0x286cf6){if(_0x286cf6){return _0x1143f4[_0xb910('0x17')](_0x3a99c2);}return _0x1143f4[_0xb910('0x18')](_0x3a99c2)[_0xb910('0x19')]();};}function respondWithResult(_0x1177ac,_0x336f9c){_0x336f9c=_0x336f9c||0xc8;return function(_0x5de3f8){if(_0x5de3f8){return _0x1177ac['status'](_0x336f9c)[_0xb910('0x1a')](_0x5de3f8);}};}function respondWithFilteredResult(_0x3a66da,_0x2b1993){return function(_0x49dcbc){if(_0x49dcbc){var _0x269c7b=typeof _0x2b1993['offset']==='undefined'&&typeof _0x2b1993[_0xb910('0x1b')]===_0xb910('0x1c');var _0x23636f=_0x49dcbc[_0xb910('0x1d')];var _0x4ca9ae=_0x269c7b?0x0:_0x2b1993['offset'];var _0xaa4a8c=_0x269c7b?_0x49dcbc['count']:_0x2b1993[_0xb910('0x1e')]+_0x2b1993['limit'];var _0x5b66be;if(_0xaa4a8c>=_0x23636f){_0xaa4a8c=_0x23636f;_0x5b66be=0xc8;}else{_0x5b66be=0xce;}_0x3a66da['status'](_0x5b66be);return _0x3a66da[_0xb910('0x1f')](_0xb910('0x20'),_0x4ca9ae+'-'+_0xaa4a8c+'/'+_0x23636f)['json'](_0x49dcbc);}return null;};}function patchUpdates(_0x581491){return function(_0xaf6e5c){try{jsonpatch[_0xb910('0x21')](_0xaf6e5c,_0x581491,!![]);}catch(_0x45383e){return BPromise[_0xb910('0x22')](_0x45383e);}return _0xaf6e5c[_0xb910('0x23')]();};}function saveUpdates(_0x2a4530,_0x3149fa){return function(_0x1f30df){if(_0x1f30df){return _0x1f30df[_0xb910('0x24')](_0x2a4530)[_0xb910('0x25')](function(_0x57314c){return _0x57314c;});}return null;};}function removeEntity(_0x55c9bb,_0x33d265){return function(_0x1c0fac){if(_0x1c0fac){return _0x1c0fac['destroy']()['then'](function(){_0x55c9bb['status'](0xcc)[_0xb910('0x19')]();});}};}function handleEntityNotFound(_0x9726f3,_0xd2721b){return function(_0x54bfcf){if(!_0x54bfcf){_0x9726f3['sendStatus'](0x194);}return _0x54bfcf;};}function handleError(_0x2c22ad,_0x50fd30){_0x50fd30=_0x50fd30||0x1f4;return function(_0x2be392){logger[_0xb910('0x26')](_0x2be392[_0xb910('0x27')]);if(_0x2be392['name']){delete _0x2be392['name'];}_0x2c22ad[_0xb910('0x18')](_0x50fd30)['send'](_0x2be392);};}exports[_0xb910('0x28')]=function(_0x3e3446,_0x3d502c){var _0x3462a2={},_0x12160f={},_0x18badd={'count':0x0,'rows':[]};var _0x1a8503=_[_0xb910('0x29')](db[_0xb910('0x2a')][_0xb910('0x2b')],function(_0x45251b){return{'name':_0x45251b['fieldName'],'type':_0x45251b['type'][_0xb910('0x2c')]};});_0x12160f['model']=_[_0xb910('0x29')](_0x1a8503,_0xb910('0x2d'));_0x12160f[_0xb910('0x2e')]=_[_0xb910('0x2f')](_0x3e3446['query']);_0x12160f['filters']=_[_0xb910('0x30')](_0x12160f[_0xb910('0x31')],_0x12160f[_0xb910('0x2e')]);_0x3462a2[_0xb910('0x32')]=_[_0xb910('0x30')](_0x12160f['model'],qs[_0xb910('0x33')](_0x3e3446[_0xb910('0x2e')]['fields']));_0x3462a2[_0xb910('0x32')]=_0x3462a2[_0xb910('0x32')][_0xb910('0x34')]?_0x3462a2[_0xb910('0x32')]:_0x12160f[_0xb910('0x31')];if(!_0x3e3446['query'][_0xb910('0x35')](_0xb910('0x36'))){_0x3462a2[_0xb910('0x1b')]=qs[_0xb910('0x1b')](_0x3e3446[_0xb910('0x2e')][_0xb910('0x1b')]);_0x3462a2['offset']=qs[_0xb910('0x1e')](_0x3e3446['query'][_0xb910('0x1e')]);}_0x3462a2['order']=qs[_0xb910('0x37')](_0x3e3446[_0xb910('0x2e')][_0xb910('0x37')]);_0x3462a2[_0xb910('0x38')]=qs[_0xb910('0x39')](_[_0xb910('0x3a')](_0x3e3446[_0xb910('0x2e')],_0x12160f[_0xb910('0x39')]),_0x1a8503);if(_0x3e3446[_0xb910('0x2e')][_0xb910('0x3b')]){_0x3462a2[_0xb910('0x38')]=_[_0xb910('0x3c')](_0x3462a2[_0xb910('0x38')],{'$or':_['map'](_0x1a8503,function(_0x39fe2b){if(_0x39fe2b[_0xb910('0x3d')]!==_0xb910('0x3e')){var _0x5c40cb={};_0x5c40cb[_0x39fe2b[_0xb910('0x2d')]]={'$like':'%'+_0x3e3446[_0xb910('0x2e')]['filter']+'%'};return _0x5c40cb;}})});}_0x3462a2=_[_0xb910('0x3c')]({},_0x3462a2,_0x3e3446[_0xb910('0x3f')]);var _0x4d7b25={'where':_0x3462a2[_0xb910('0x38')]};return db[_0xb910('0x2a')][_0xb910('0x1d')](_0x4d7b25)[_0xb910('0x25')](function(_0x4d2d84){_0x18badd[_0xb910('0x1d')]=_0x4d2d84;if(_0x3e3446[_0xb910('0x2e')][_0xb910('0x40')]){_0x3462a2['include']=[{'all':!![]}];}return db[_0xb910('0x2a')]['findAll'](_0x3462a2);})[_0xb910('0x25')](function(_0x48e3e5){_0x18badd[_0xb910('0x41')]=_0x48e3e5;return _0x18badd;})[_0xb910('0x25')](respondWithFilteredResult(_0x3d502c,_0x3462a2))[_0xb910('0x42')](handleError(_0x3d502c,null));};exports['show']=function(_0x5d1884,_0x217f34){var _0x41da37={'raw':!![],'where':{'id':_0x5d1884[_0xb910('0x43')]['id']}},_0x4f1c72={};_0x4f1c72[_0xb910('0x31')]=_[_0xb910('0x2f')](db[_0xb910('0x2a')][_0xb910('0x2b')]);_0x4f1c72[_0xb910('0x2e')]=_[_0xb910('0x2f')](_0x5d1884[_0xb910('0x2e')]);_0x4f1c72['filters']=_[_0xb910('0x30')](_0x4f1c72[_0xb910('0x31')],_0x4f1c72[_0xb910('0x2e')]);_0x41da37[_0xb910('0x32')]=_[_0xb910('0x30')](_0x4f1c72[_0xb910('0x31')],qs[_0xb910('0x33')](_0x5d1884['query'][_0xb910('0x33')]));_0x41da37[_0xb910('0x32')]=_0x41da37[_0xb910('0x32')][_0xb910('0x34')]?_0x41da37['attributes']:_0x4f1c72[_0xb910('0x31')];if(_0x5d1884[_0xb910('0x2e')][_0xb910('0x40')]){_0x41da37[_0xb910('0x44')]=[{'all':!![]}];}_0x41da37=_[_0xb910('0x3c')]({},_0x41da37,_0x5d1884[_0xb910('0x3f')]);return db['VtigerField'][_0xb910('0x45')](_0x41da37)[_0xb910('0x25')](handleEntityNotFound(_0x217f34,null))[_0xb910('0x25')](respondWithResult(_0x217f34,null))['catch'](handleError(_0x217f34,null));};exports[_0xb910('0x46')]=function(_0x410887,_0x10358c){return db[_0xb910('0x2a')][_0xb910('0x46')](_0x410887[_0xb910('0x47')],{})[_0xb910('0x25')](respondWithResult(_0x10358c,0xc9))[_0xb910('0x42')](handleError(_0x10358c,null));};exports['update']=function(_0x8cc3b7,_0x1e5d8c){if(_0x8cc3b7[_0xb910('0x47')]['id']){delete _0x8cc3b7['body']['id'];}return db[_0xb910('0x2a')][_0xb910('0x45')]({'where':{'id':_0x8cc3b7[_0xb910('0x43')]['id']}})[_0xb910('0x25')](handleEntityNotFound(_0x1e5d8c,null))[_0xb910('0x25')](saveUpdates(_0x8cc3b7[_0xb910('0x47')],null))[_0xb910('0x25')](respondWithResult(_0x1e5d8c,null))[_0xb910('0x42')](handleError(_0x1e5d8c,null));};exports[_0xb910('0x48')]=function(_0x1f0456,_0x5618c8){return db[_0xb910('0x2a')][_0xb910('0x45')]({'where':{'id':_0x1f0456[_0xb910('0x43')]['id']}})[_0xb910('0x25')](handleEntityNotFound(_0x5618c8,null))[_0xb910('0x25')](removeEntity(_0x5618c8,null))['catch'](handleError(_0x5618c8,null));};
\ No newline at end of file
index b7667d8..2a99d44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf692=['request-promise','path','../../config/environment','./intVtigerField.attributes','exports','int_vtiger_fields','vtiger_unique_index','idField','FieldId','../../config/logger','api','moment','bluebird'];(function(_0x22e58f,_0x306c63){var _0x1c3325=function(_0x27dcc1){while(--_0x27dcc1){_0x22e58f['push'](_0x22e58f['shift']());}};_0x1c3325(++_0x306c63);}(_0xf692,0x7e));var _0x2f69=function(_0x11c8b5,_0x1d08a6){_0x11c8b5=_0x11c8b5-0x0;var _0x33c453=_0xf692[_0x11c8b5];return _0x33c453;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2f69('0x0'))(_0x2f69('0x1'));var moment=require(_0x2f69('0x2'));var BPromise=require(_0x2f69('0x3'));var rp=require(_0x2f69('0x4'));var fs=require('fs');var path=require(_0x2f69('0x5'));var rimraf=require('rimraf');var config=require(_0x2f69('0x6'));var attributes=require(_0x2f69('0x7'));module[_0x2f69('0x8')]=function(_0x4a7384,_0x32cd6f){return _0x4a7384['define']('VtigerField',attributes,{'tableName':_0x2f69('0x9'),'paranoid':![],'indexes':[{'name':_0x2f69('0xa'),'fields':[_0x2f69('0xb'),_0x2f69('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4260=['VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define'];(function(_0x50bbc7,_0xa9db18){var _0x39d039=function(_0x4b5937){while(--_0x4b5937){_0x50bbc7['push'](_0x50bbc7['shift']());}};_0x39d039(++_0xa9db18);}(_0x4260,0x17f));var _0x0426=function(_0x14f80d,_0x3a99aa){_0x14f80d=_0x14f80d-0x0;var _0x4a25ea=_0x4260[_0x14f80d];return _0x4a25ea;};'use strict';var _=require(_0x0426('0x0'));var util=require(_0x0426('0x1'));var logger=require(_0x0426('0x2'))(_0x0426('0x3'));var moment=require(_0x0426('0x4'));var BPromise=require(_0x0426('0x5'));var rp=require(_0x0426('0x6'));var fs=require('fs');var path=require(_0x0426('0x7'));var rimraf=require(_0x0426('0x8'));var config=require(_0x0426('0x9'));var attributes=require(_0x0426('0xa'));module[_0x0426('0xb')]=function(_0x237556,_0x4bd7bd){return _0x237556[_0x0426('0xc')](_0x0426('0xd'),attributes,{'tableName':_0x0426('0xe'),'paranoid':![],'indexes':[{'name':_0x0426('0xf'),'fields':[_0x0426('0x10'),_0x0426('0x11')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 0a6446f..a0f77f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68c8=['VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','VtigerField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x587bbb,_0x42462e){var _0x31b085=function(_0x119406){while(--_0x119406){_0x587bbb['push'](_0x587bbb['shift']());}};_0x31b085(++_0x42462e);}(_0x68c8,0x16f));var _0x868c=function(_0xcc7d70,_0x47606e){_0xcc7d70=_0xcc7d70-0x0;var _0x292342=_0x68c8[_0xcc7d70];return _0x292342;};'use strict';var _=require(_0x868c('0x0'));var util=require(_0x868c('0x1'));var moment=require(_0x868c('0x2'));var BPromise=require(_0x868c('0x3'));var rs=require(_0x868c('0x4'));var fs=require('fs');var Redis=require(_0x868c('0x5'));var db=require(_0x868c('0x6'))['db'];var utils=require(_0x868c('0x7'));var logger=require(_0x868c('0x8'))(_0x868c('0x9'));var config=require('../../config/environment');var jayson=require(_0x868c('0xa'));var client=jayson['client'][_0x868c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4005d3,_0x1899f6,_0x53f4fe){return new BPromise(function(_0x275f61,_0x3ef654){return client[_0x868c('0xc')](_0x4005d3,_0x53f4fe)[_0x868c('0xd')](function(_0x3b4a88){logger['info'](_0x868c('0xe'),_0x1899f6,_0x868c('0xf'));logger[_0x868c('0x10')](_0x868c('0x11'),_0x1899f6,'request\x20sent',JSON[_0x868c('0x12')](_0x3b4a88));if(_0x3b4a88['error']){if(_0x3b4a88['error']['code']===0x1f4){logger[_0x868c('0x13')](_0x868c('0xe'),_0x1899f6,_0x3b4a88[_0x868c('0x13')]['message']);return _0x3ef654(_0x3b4a88[_0x868c('0x13')][_0x868c('0x14')]);}logger[_0x868c('0x13')]('VtigerField,\x20%s,\x20%s',_0x1899f6,_0x3b4a88[_0x868c('0x13')][_0x868c('0x14')]);return _0x275f61(_0x3b4a88['error'][_0x868c('0x14')]);}else{logger[_0x868c('0x15')](_0x868c('0xe'),_0x1899f6,_0x868c('0xf'));_0x275f61(_0x3b4a88[_0x868c('0x16')][_0x868c('0x14')]);}})[_0x868c('0x17')](function(_0x50f172){logger[_0x868c('0x13')](_0x868c('0xe'),_0x1899f6,_0x50f172);_0x3ef654(_0x50f172);});});}
\ No newline at end of file
+var _0x883f=['message','info','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','http','then','VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x386078,_0x3aa89e){var _0x4a7083=function(_0x1005bc){while(--_0x1005bc){_0x386078['push'](_0x386078['shift']());}};_0x4a7083(++_0x3aa89e);}(_0x883f,0x147));var _0xf883=function(_0xbfa006,_0x1118d1){_0xbfa006=_0xbfa006-0x0;var _0x396001=_0x883f[_0xbfa006];return _0x396001;};'use strict';var _=require('lodash');var util=require(_0xf883('0x0'));var moment=require('moment');var BPromise=require(_0xf883('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf883('0x2'));var db=require(_0xf883('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf883('0x4'))(_0xf883('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf883('0x6')][_0xf883('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x43ccb6,_0x450be5,_0x319773){return new BPromise(function(_0x1e0fcc,_0x25a548){return client['request'](_0x43ccb6,_0x319773)[_0xf883('0x8')](function(_0x12f04b){logger['info'](_0xf883('0x9'),_0x450be5,_0xf883('0xa'));logger['debug'](_0xf883('0xb'),_0x450be5,_0xf883('0xa'),JSON[_0xf883('0xc')](_0x12f04b));if(_0x12f04b[_0xf883('0xd')]){if(_0x12f04b['error'][_0xf883('0xe')]===0x1f4){logger[_0xf883('0xd')](_0xf883('0x9'),_0x450be5,_0x12f04b['error'][_0xf883('0xf')]);return _0x25a548(_0x12f04b['error'][_0xf883('0xf')]);}logger[_0xf883('0xd')](_0xf883('0x9'),_0x450be5,_0x12f04b[_0xf883('0xd')][_0xf883('0xf')]);return _0x1e0fcc(_0x12f04b[_0xf883('0xd')][_0xf883('0xf')]);}else{logger[_0xf883('0x10')]('VtigerField,\x20%s,\x20%s',_0x450be5,_0xf883('0xa'));_0x1e0fcc(_0x12f04b[_0xf883('0x11')][_0xf883('0xf')]);}})[_0xf883('0x12')](function(_0x36ddb0){logger[_0xf883('0xd')](_0xf883('0x9'),_0x450be5,_0x36ddb0);_0x25a548(_0x36ddb0);});});}
\ No newline at end of file
index bbfa679..0802b26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfab1=['show','get','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xfab1,0xe5));var _0x1fab=function(_0xad9b66,_0x4a6b2c){_0xad9b66=_0xad9b66-0x0;var _0x3e4c3f=_0xfab1[_0xad9b66];return _0x3e4c3f;};'use strict';var multer=require(_0x1fab('0x0'));var util=require(_0x1fab('0x1'));var path=require(_0x1fab('0x2'));var timeout=require(_0x1fab('0x3'));var express=require(_0x1fab('0x4'));var router=express[_0x1fab('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1fab('0x6'));var interaction=require(_0x1fab('0x7'));var config=require(_0x1fab('0x8'));var controller=require('./intZendeskAccount.controller');router['get']('/',auth[_0x1fab('0x9')](),controller[_0x1fab('0xa')]);router['get']('/:id',auth[_0x1fab('0x9')](),controller[_0x1fab('0xb')]);router[_0x1fab('0xc')](_0x1fab('0xd'),auth[_0x1fab('0x9')](),controller['getConfigurations']);router['get'](_0x1fab('0xe'),auth['isAuthenticated'](),controller[_0x1fab('0xf')]);router[_0x1fab('0x10')]('/',auth[_0x1fab('0x9')](),controller[_0x1fab('0x11')]);router[_0x1fab('0x10')](_0x1fab('0xd'),auth[_0x1fab('0x9')](),controller[_0x1fab('0x12')]);router[_0x1fab('0x13')](_0x1fab('0x14'),auth[_0x1fab('0x9')](),controller[_0x1fab('0x15')]);router['delete'](_0x1fab('0x14'),auth[_0x1fab('0x9')](),controller[_0x1fab('0x16')]);module[_0x1fab('0x17')]=router;
\ No newline at end of file
+var _0xbe7b=['Router','../../components/auth/service','./intZendeskAccount.controller','index','get','/:id','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','delete','destroy','exports','multer','util','path'];(function(_0x23b6ab,_0x541da0){var _0x458ab5=function(_0x4cb6a6){while(--_0x4cb6a6){_0x23b6ab['push'](_0x23b6ab['shift']());}};_0x458ab5(++_0x541da0);}(_0xbe7b,0x66));var _0xbbe7=function(_0x576e2b,_0x328953){_0x576e2b=_0x576e2b-0x0;var _0x46461a=_0xbe7b[_0x576e2b];return _0x46461a;};'use strict';var multer=require(_0xbbe7('0x0'));var util=require(_0xbbe7('0x1'));var path=require(_0xbbe7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbbe7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbbe7('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbbe7('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xbbe7('0x6')]);router[_0xbbe7('0x7')](_0xbbe7('0x8'),auth[_0xbbe7('0x9')](),controller['show']);router['get']('/:id/configurations',auth[_0xbbe7('0x9')](),controller[_0xbbe7('0xa')]);router['get'](_0xbbe7('0xb'),auth[_0xbbe7('0x9')](),controller[_0xbbe7('0xc')]);router[_0xbbe7('0xd')]('/',auth[_0xbbe7('0x9')](),controller[_0xbbe7('0xe')]);router[_0xbbe7('0xd')](_0xbbe7('0xf'),auth[_0xbbe7('0x9')](),controller[_0xbbe7('0x10')]);router[_0xbbe7('0x11')](_0xbbe7('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xbbe7('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xbbe7('0x13')]);module[_0xbbe7('0x14')]=router;
\ No newline at end of file
index 83b3793..9530c0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68b3=['token','ENUM','integrationTab','newTab','sequelize','exports','STRING','remoteUri','password'];(function(_0x2e6cf5,_0x495b7d){var _0x356021=function(_0x5f7bae){while(--_0x5f7bae){_0x2e6cf5['push'](_0x2e6cf5['shift']());}};_0x356021(++_0x495b7d);}(_0x68b3,0x1d8));var _0x368b=function(_0x159d86,_0xdae0c7){_0x159d86=_0x159d86-0x0;var _0x38cb1d=_0x68b3[_0x159d86];return _0x38cb1d;};'use strict';var Sequelize=require(_0x368b('0x0'));module[_0x368b('0x1')]={'name':{'type':Sequelize[_0x368b('0x2')]},'description':{'type':Sequelize[_0x368b('0x2')]},'username':{'type':Sequelize[_0x368b('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x368b('0x2')]},'token':{'type':Sequelize[_0x368b('0x2')]},'remoteUri':{'type':Sequelize[_0x368b('0x2')],'unique':_0x368b('0x3')},'authType':{'type':Sequelize['ENUM'](_0x368b('0x4'),_0x368b('0x5')),'defaultValue':_0x368b('0x4')},'serverUrl':{'type':Sequelize[_0x368b('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x368b('0x6')](_0x368b('0x7'),_0x368b('0x8')),'defaultValue':_0x368b('0x7')}};
\ No newline at end of file
+var _0xfb11=['remoteUri','ENUM','token','password','integrationTab','newTab','sequelize','STRING','username'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xfb11[_0x1b349a];return _0x5d1f7c;};'use strict';var Sequelize=require(_0x1fb1('0x0'));module['exports']={'name':{'type':Sequelize[_0x1fb1('0x1')]},'description':{'type':Sequelize[_0x1fb1('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x1fb1('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x1fb1('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x1fb1('0x3')},'authType':{'type':Sequelize[_0x1fb1('0x4')]('password',_0x1fb1('0x5')),'defaultValue':_0x1fb1('0x6')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x1fb1('0x4')](_0x1fb1('0x7'),_0x1fb1('0x8')),'defaultValue':_0x1fb1('0x7')}};
\ No newline at end of file
index 4802151..c19bafb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeffd=['querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','end','json','offset','undefined','count','limit','status','set','Content-Range','save','update','destroy','then','sendStatus','error','stack','send','index','map','ZendeskAccount','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','create','body','find','findOne','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','ZendeskConfiguration','ZendeskField','Descriptions','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','%s/%s','ticket_fields','headers','format','Basic\x20%s','%s:%s','username','toString','%s/token:%s','base64','Sequelize','Unknown\x20authentication\x20type','subject','group','assignee','remove','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','name','Wrong\x20credentials','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'];(function(_0x2378ad,_0x38b7fc){var _0xd43e31=function(_0x309780){while(--_0x309780){_0x2378ad['push'](_0x2378ad['shift']());}};_0xd43e31(++_0x38b7fc);}(_0xeffd,0x6b));var _0xdeff=function(_0x34bb12,_0x40ee99){_0x34bb12=_0x34bb12-0x0;var _0x26e6e7=_0xeffd[_0x34bb12];return _0x26e6e7;};'use strict';var emlformat=require(_0xdeff('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdeff('0x1'));var jsonpatch=require(_0xdeff('0x2'));var rp=require(_0xdeff('0x3'));var moment=require(_0xdeff('0x4'));var BPromise=require(_0xdeff('0x5'));var Mustache=require(_0xdeff('0x6'));var util=require(_0xdeff('0x7'));var path=require(_0xdeff('0x8'));var sox=require(_0xdeff('0x9'));var csv=require(_0xdeff('0xa'));var ejs=require(_0xdeff('0xb'));var fs=require('fs');var fs_extra=require(_0xdeff('0xc'));var _=require(_0xdeff('0xd'));var squel=require(_0xdeff('0xe'));var crypto=require(_0xdeff('0xf'));var jsforce=require(_0xdeff('0x10'));var deskjs=require(_0xdeff('0x11'));var toCsv=require('to-csv');var querystring=require(_0xdeff('0x12'));var Papa=require(_0xdeff('0x13'));var Redis=require(_0xdeff('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xdeff('0x15'));var as=require(_0xdeff('0x16'));var hardwareService=require(_0xdeff('0x17'));var logger=require(_0xdeff('0x18'))(_0xdeff('0x19'));var utils=require(_0xdeff('0x1a'));var config=require(_0xdeff('0x1b'));var licenseUtil=require(_0xdeff('0x1c'));var db=require('../../mysqldb')['db'];var integrations=require(_0xdeff('0x1d'));function respondWithStatusCode(_0x116bf9,_0x4952f2){_0x4952f2=_0x4952f2||0xcc;return function(_0x2e614c){if(_0x2e614c){return _0x116bf9['sendStatus'](_0x4952f2);}return _0x116bf9['status'](_0x4952f2)[_0xdeff('0x1e')]();};}function respondWithResult(_0x47410f,_0x1585e8){_0x1585e8=_0x1585e8||0xc8;return function(_0xb4bc82){if(_0xb4bc82){return _0x47410f['status'](_0x1585e8)[_0xdeff('0x1f')](_0xb4bc82);}};}function respondWithFilteredResult(_0x314ded,_0xea6c4){return function(_0x391633){if(_0x391633){var _0x3dbba1=typeof _0xea6c4[_0xdeff('0x20')]==='undefined'&&typeof _0xea6c4['limit']===_0xdeff('0x21');var _0x4cf724=_0x391633['count'];var _0x35635f=_0x3dbba1?0x0:_0xea6c4[_0xdeff('0x20')];var _0x4b14b6=_0x3dbba1?_0x391633[_0xdeff('0x22')]:_0xea6c4[_0xdeff('0x20')]+_0xea6c4[_0xdeff('0x23')];var _0x3a677a;if(_0x4b14b6>=_0x4cf724){_0x4b14b6=_0x4cf724;_0x3a677a=0xc8;}else{_0x3a677a=0xce;}_0x314ded[_0xdeff('0x24')](_0x3a677a);return _0x314ded[_0xdeff('0x25')](_0xdeff('0x26'),_0x35635f+'-'+_0x4b14b6+'/'+_0x4cf724)[_0xdeff('0x1f')](_0x391633);}return null;};}function patchUpdates(_0x488faa){return function(_0x5591fa){try{jsonpatch['apply'](_0x5591fa,_0x488faa,!![]);}catch(_0x2f3fd6){return BPromise['reject'](_0x2f3fd6);}return _0x5591fa[_0xdeff('0x27')]();};}function saveUpdates(_0x91c0b4,_0x543653){return function(_0x18338c){if(_0x18338c){return _0x18338c[_0xdeff('0x28')](_0x91c0b4)['then'](function(_0x5dbe96){return _0x5dbe96;});}return null;};}function removeEntity(_0x3b2554,_0x15c425){return function(_0x253eed){if(_0x253eed){return _0x253eed[_0xdeff('0x29')]()[_0xdeff('0x2a')](function(){_0x3b2554['status'](0xcc)[_0xdeff('0x1e')]();});}};}function handleEntityNotFound(_0x412db3,_0x3741fb){return function(_0x393659){if(!_0x393659){_0x412db3[_0xdeff('0x2b')](0x194);}return _0x393659;};}function handleError(_0x35823c,_0x3d0111){_0x3d0111=_0x3d0111||0x1f4;return function(_0x52ea5d){logger[_0xdeff('0x2c')](_0x52ea5d[_0xdeff('0x2d')]);if(_0x52ea5d['name']){delete _0x52ea5d['name'];}_0x35823c[_0xdeff('0x24')](_0x3d0111)[_0xdeff('0x2e')](_0x52ea5d);};}exports[_0xdeff('0x2f')]=function(_0xcb819c,_0x533069){var _0xf9b278={},_0xbc75ee={},_0x4e0ff2={'count':0x0,'rows':[]};var _0x331ddc=_[_0xdeff('0x30')](db[_0xdeff('0x31')]['rawAttributes'],function(_0x59f7a0){return{'name':_0x59f7a0[_0xdeff('0x32')],'type':_0x59f7a0['type'][_0xdeff('0x33')]};});_0xbc75ee[_0xdeff('0x34')]=_[_0xdeff('0x30')](_0x331ddc,'name');_0xbc75ee[_0xdeff('0x35')]=_['keys'](_0xcb819c['query']);_0xbc75ee[_0xdeff('0x36')]=_[_0xdeff('0x37')](_0xbc75ee[_0xdeff('0x34')],_0xbc75ee[_0xdeff('0x35')]);_0xf9b278['attributes']=_[_0xdeff('0x37')](_0xbc75ee[_0xdeff('0x34')],qs[_0xdeff('0x38')](_0xcb819c[_0xdeff('0x35')][_0xdeff('0x38')]));_0xf9b278[_0xdeff('0x39')]=_0xf9b278[_0xdeff('0x39')]['length']?_0xf9b278[_0xdeff('0x39')]:_0xbc75ee['model'];if(!_0xcb819c[_0xdeff('0x35')][_0xdeff('0x3a')](_0xdeff('0x3b'))){_0xf9b278[_0xdeff('0x23')]=qs[_0xdeff('0x23')](_0xcb819c[_0xdeff('0x35')]['limit']);_0xf9b278[_0xdeff('0x20')]=qs[_0xdeff('0x20')](_0xcb819c['query'][_0xdeff('0x20')]);}_0xf9b278[_0xdeff('0x3c')]=qs[_0xdeff('0x3d')](_0xcb819c[_0xdeff('0x35')][_0xdeff('0x3d')]);_0xf9b278[_0xdeff('0x3e')]=qs[_0xdeff('0x36')](_[_0xdeff('0x3f')](_0xcb819c['query'],_0xbc75ee[_0xdeff('0x36')]),_0x331ddc);if(_0xcb819c['query'][_0xdeff('0x40')]){_0xf9b278[_0xdeff('0x3e')]=_[_0xdeff('0x41')](_0xf9b278['where'],{'$or':_[_0xdeff('0x30')](_0x331ddc,function(_0x280a86){if(_0x280a86[_0xdeff('0x42')]!==_0xdeff('0x43')){var _0x226028={};_0x226028[_0x280a86['name']]={'$like':'%'+_0xcb819c[_0xdeff('0x35')]['filter']+'%'};return _0x226028;}})});}_0xf9b278=_[_0xdeff('0x41')]({},_0xf9b278,_0xcb819c[_0xdeff('0x44')]);var _0x518280={'where':_0xf9b278[_0xdeff('0x3e')]};return db[_0xdeff('0x31')][_0xdeff('0x22')](_0x518280)[_0xdeff('0x2a')](function(_0x3e2be3){_0x4e0ff2['count']=_0x3e2be3;if(_0xcb819c[_0xdeff('0x35')][_0xdeff('0x45')]){_0xf9b278[_0xdeff('0x46')]=[{'all':!![]}];}return db[_0xdeff('0x31')][_0xdeff('0x47')](_0xf9b278);})['then'](function(_0x5f1110){_0x4e0ff2[_0xdeff('0x48')]=_0x5f1110;return _0x4e0ff2;})[_0xdeff('0x2a')](respondWithFilteredResult(_0x533069,_0xf9b278))[_0xdeff('0x49')](handleError(_0x533069,null));};exports[_0xdeff('0x4a')]=function(_0x3c4fd2,_0x289f70){var _0x2cd68a={'raw':![],'where':{'id':_0x3c4fd2[_0xdeff('0x4b')]['id']}},_0x4f02f5={};_0x4f02f5[_0xdeff('0x34')]=_[_0xdeff('0x4c')](db['ZendeskAccount'][_0xdeff('0x4d')]);_0x4f02f5[_0xdeff('0x35')]=_[_0xdeff('0x4c')](_0x3c4fd2[_0xdeff('0x35')]);_0x4f02f5['filters']=_[_0xdeff('0x37')](_0x4f02f5[_0xdeff('0x34')],_0x4f02f5[_0xdeff('0x35')]);_0x2cd68a[_0xdeff('0x39')]=_[_0xdeff('0x37')](_0x4f02f5[_0xdeff('0x34')],qs[_0xdeff('0x38')](_0x3c4fd2[_0xdeff('0x35')]['fields']));_0x2cd68a[_0xdeff('0x39')]=_0x2cd68a[_0xdeff('0x39')][_0xdeff('0x4e')]?_0x2cd68a[_0xdeff('0x39')]:_0x4f02f5[_0xdeff('0x34')];if(_0x3c4fd2['query'][_0xdeff('0x45')]){_0x2cd68a[_0xdeff('0x46')]=[{'all':!![]}];}_0x2cd68a=_[_0xdeff('0x41')]({},_0x2cd68a,_0x3c4fd2[_0xdeff('0x44')]);return db[_0xdeff('0x31')]['find'](_0x2cd68a)[_0xdeff('0x2a')](handleEntityNotFound(_0x289f70,null))['then'](respondWithResult(_0x289f70,null))[_0xdeff('0x49')](handleError(_0x289f70,null));};exports[_0xdeff('0x4f')]=function(_0x1bf17c,_0x46c428){return db[_0xdeff('0x31')][_0xdeff('0x4f')](_0x1bf17c['body'],{})['then'](respondWithResult(_0x46c428,0xc9))[_0xdeff('0x49')](handleError(_0x46c428,null));};exports[_0xdeff('0x28')]=function(_0x3dc206,_0x49de92){if(_0x3dc206['body']['id']){delete _0x3dc206[_0xdeff('0x50')]['id'];}return db[_0xdeff('0x31')]['find']({'where':{'id':_0x3dc206[_0xdeff('0x4b')]['id']}})[_0xdeff('0x2a')](handleEntityNotFound(_0x49de92,null))[_0xdeff('0x2a')](saveUpdates(_0x3dc206['body'],null))[_0xdeff('0x2a')](respondWithResult(_0x49de92,null))[_0xdeff('0x49')](handleError(_0x49de92,null));};exports[_0xdeff('0x29')]=function(_0x59ae32,_0xce8379){return db[_0xdeff('0x31')][_0xdeff('0x51')]({'where':{'id':_0x59ae32[_0xdeff('0x4b')]['id']}})[_0xdeff('0x2a')](handleEntityNotFound(_0xce8379,null))[_0xdeff('0x2a')](removeEntity(_0xce8379,null))[_0xdeff('0x49')](handleError(_0xce8379,null));};exports['getConfigurations']=function(_0x4517d1,_0x1b90a9,_0x5e0c60){var _0xe5a773={};var _0x1b676b={};var _0x2967b4;var _0x33482b;return db[_0xdeff('0x31')][_0xdeff('0x52')]({'where':{'id':_0x4517d1[_0xdeff('0x4b')]['id']}})[_0xdeff('0x2a')](handleEntityNotFound(_0x1b90a9,null))['then'](function(_0x1b7eb3){if(_0x1b7eb3){_0x2967b4=_0x1b7eb3;_0x1b676b[_0xdeff('0x34')]=_[_0xdeff('0x4c')](db['ZendeskConfiguration']['rawAttributes']);_0x1b676b[_0xdeff('0x35')]=_[_0xdeff('0x4c')](_0x4517d1[_0xdeff('0x35')]);_0x1b676b[_0xdeff('0x36')]=_[_0xdeff('0x37')](_0x1b676b[_0xdeff('0x34')],_0x1b676b['query']);_0xe5a773['attributes']=_[_0xdeff('0x37')](_0x1b676b[_0xdeff('0x34')],qs['fields'](_0x4517d1['query'][_0xdeff('0x38')]));_0xe5a773[_0xdeff('0x39')]=_0xe5a773['attributes'][_0xdeff('0x4e')]?_0xe5a773[_0xdeff('0x39')]:_0x1b676b['model'];_0xe5a773[_0xdeff('0x3c')]=qs[_0xdeff('0x3d')](_0x4517d1['query'][_0xdeff('0x3d')]);_0xe5a773[_0xdeff('0x3e')]=qs['filters'](_[_0xdeff('0x3f')](_0x4517d1[_0xdeff('0x35')],_0x1b676b[_0xdeff('0x36')]));if(_0x4517d1['query']['filter']){_0xe5a773[_0xdeff('0x3e')]=_['merge'](_0xe5a773[_0xdeff('0x3e')],{'$or':_[_0xdeff('0x30')](_0xe5a773[_0xdeff('0x39')],function(_0x34d033){var _0x300955={};_0x300955[_0x34d033]={'$like':'%'+_0x4517d1['query']['filter']+'%'};return _0x300955;})});}_0xe5a773=_[_0xdeff('0x41')]({},_0xe5a773,_0x4517d1[_0xdeff('0x44')]);return _0x2967b4[_0xdeff('0x53')](_0xe5a773);}})[_0xdeff('0x2a')](function(_0x106976){if(_0x106976){_0x33482b=_0x106976[_0xdeff('0x4e')];if(!_0x4517d1['query'][_0xdeff('0x3a')]('nolimit')){_0xe5a773[_0xdeff('0x23')]=qs[_0xdeff('0x23')](_0x4517d1[_0xdeff('0x35')][_0xdeff('0x23')]);_0xe5a773[_0xdeff('0x20')]=qs[_0xdeff('0x20')](_0x4517d1[_0xdeff('0x35')][_0xdeff('0x20')]);}return _0x2967b4[_0xdeff('0x53')](_0xe5a773);}})['then'](function(_0x43f74){if(_0x43f74){return _0x43f74?{'count':_0x33482b,'rows':_0x43f74}:null;}})['then'](respondWithResult(_0x1b90a9,null))[_0xdeff('0x49')](handleError(_0x1b90a9,null));};exports[_0xdeff('0x54')]=function(_0x5a51d4,_0x286e4d,_0x492372){if(_0x5a51d4[_0xdeff('0x50')]['id']){delete _0x5a51d4['body']['id'];}return db['ZendeskAccount'][_0xdeff('0x52')]({'where':{'id':_0x5a51d4[_0xdeff('0x4b')]['id']}})['then'](handleEntityNotFound(_0x286e4d,null))[_0xdeff('0x2a')](function(_0x196e90){if(_0x196e90){_0x5a51d4[_0xdeff('0x50')][_0xdeff('0x55')]=_0x196e90['id'];_0x5a51d4[_0xdeff('0x50')][_0xdeff('0x56')]=integrations[_0xdeff('0x57')](_0x5a51d4[_0xdeff('0x50')][_0xdeff('0x58')],_0x5a51d4['body'][_0xdeff('0x42')]);_0x5a51d4[_0xdeff('0x50')]['Descriptions']=integrations['getDescriptions'](_0x5a51d4[_0xdeff('0x50')][_0xdeff('0x58')],_0x5a51d4['body'][_0xdeff('0x42')]);return db[_0xdeff('0x59')][_0xdeff('0x4f')](_0x5a51d4[_0xdeff('0x50')],{'include':[{'model':db[_0xdeff('0x5a')],'as':_0xdeff('0x56')},{'model':db[_0xdeff('0x5a')],'as':_0xdeff('0x5b')}]});}return null;})[_0xdeff('0x2a')](respondWithResult(_0x286e4d,null))[_0xdeff('0x49')](handleError(_0x286e4d,null));};exports['getFields']=function(_0x221af0,_0x169145,_0x190191){var _0x44bad3='';return db[_0xdeff('0x31')]['findOne']({'where':{'id':_0x221af0['params']['id']},'attributes':['id','username',_0xdeff('0x5c'),_0xdeff('0x5d'),_0xdeff('0x5e'),_0xdeff('0x5f')]})['then'](handleEntityNotFound(_0x169145,null))['then'](function(_0x19de80){if(_0x19de80){_0x44bad3=_0x19de80[_0xdeff('0x5f')];var _0x46e1d5=_0x44bad3[_0xdeff('0x60')](-0x1);if(_0x46e1d5==='/'){_0x44bad3=_0x44bad3[_0xdeff('0x61')](0x0,_0x44bad3[_0xdeff('0x62')](_0x46e1d5));}var _0x1eb1a3={'method':_0xdeff('0x63'),'uri':util['format'](_0xdeff('0x64'),_0x44bad3,_0xdeff('0x65')),'json':!![]};switch(_0x19de80[_0xdeff('0x5e')]){case _0xdeff('0x5c'):_0x1eb1a3[_0xdeff('0x66')]={'Authorization':util[_0xdeff('0x67')](_0xdeff('0x68'),new Buffer(util[_0xdeff('0x67')](_0xdeff('0x69'),_0x19de80[_0xdeff('0x6a')],_0x19de80[_0xdeff('0x5c')]))[_0xdeff('0x6b')]('base64'))};break;case _0xdeff('0x5d'):_0x1eb1a3[_0xdeff('0x66')]={'Authorization':util[_0xdeff('0x67')]('Basic\x20%s',new Buffer(util[_0xdeff('0x67')](_0xdeff('0x6c'),_0x19de80[_0xdeff('0x6a')],_0x19de80[_0xdeff('0x5d')]))['toString'](_0xdeff('0x6d')))};break;default:throw new db[(_0xdeff('0x6e'))]['ValidationError'](_0xdeff('0x6f'));}return rp(_0x1eb1a3);}})[_0xdeff('0x2a')](function(_0x1430e8){if(_0x1430e8){var _0x1cc1d3=[_0xdeff('0x70'),'description',_0xdeff('0x71'),_0xdeff('0x72')];_[_0xdeff('0x73')](_0x1430e8[_0xdeff('0x65')],function(_0xe85561){return _0x1cc1d3['includes'](_0xe85561[_0xdeff('0x42')]);});return{'count':_0x1430e8[_0xdeff('0x65')]['length'],'rows':_[_0xdeff('0x30')](_0x1430e8[_0xdeff('0x65')],function(_0x1fe603){return{'id':_0x1fe603['id'],'name':_0x1fe603['position']>0x7?_0x1fe603[_0xdeff('0x74')]:_0x1fe603[_0xdeff('0x42')],'custom':_0x1fe603['position']>0x7?!![]:![],'options':_0x1fe603[_0xdeff('0x75')]?_0x1fe603[_0xdeff('0x75')]:_0x1fe603[_0xdeff('0x76')]?_0x1fe603[_0xdeff('0x76')]:[]};})};}})['then'](respondWithResult(_0x169145,null))[_0xdeff('0x49')](function(_0x3b8f20){var _0x14a77f=_0x221af0[_0xdeff('0x35')][_0xdeff('0x77')]?0x1f4:_0x3b8f20[_0xdeff('0x78')]||0x1f4;logger[_0xdeff('0x2c')](_0xdeff('0x79'),_0xdeff('0x7a'),_0x14a77f,JSON['stringify'](_0x3b8f20));delete _0x3b8f20[_0xdeff('0x7b')];if(_0x14a77f===0x191){_0x14a77f=0x190;}_0x169145['status'](_0x14a77f)[_0xdeff('0x2e')](_0x221af0['query']['test']?{'message':_0xdeff('0x7c'),'statusCode':_0x3b8f20[_0xdeff('0x78')]}:_0x3b8f20);});};
\ No newline at end of file
+var _0xc788=['query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','password','token','remoteUri','slice','substring','lastIndexOf','GET','format','authType','headers','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','ticket_fields','includes','title','position','system_field_options','custom_field_options','error','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','ZendeskAccount','rawAttributes','fieldName','type','model','keys'];(function(_0x1adb8e,_0x26c003){var _0x20efb4=function(_0x457f55){while(--_0x457f55){_0x1adb8e['push'](_0x1adb8e['shift']());}};_0x20efb4(++_0x26c003);}(_0xc788,0xc4));var _0x8c78=function(_0x566c5a,_0x42e09c){_0x566c5a=_0x566c5a-0x0;var _0x3c4abe=_0xc788[_0x566c5a];return _0x3c4abe;};'use strict';var emlformat=require(_0x8c78('0x0'));var rimraf=require(_0x8c78('0x1'));var zipdir=require(_0x8c78('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8c78('0x3'));var BPromise=require(_0x8c78('0x4'));var Mustache=require(_0x8c78('0x5'));var util=require(_0x8c78('0x6'));var path=require(_0x8c78('0x7'));var sox=require('sox');var csv=require(_0x8c78('0x8'));var ejs=require(_0x8c78('0x9'));var fs=require('fs');var fs_extra=require(_0x8c78('0xa'));var _=require(_0x8c78('0xb'));var squel=require(_0x8c78('0xc'));var crypto=require('crypto');var jsforce=require(_0x8c78('0xd'));var deskjs=require(_0x8c78('0xe'));var toCsv=require(_0x8c78('0x8'));var querystring=require(_0x8c78('0xf'));var Papa=require(_0x8c78('0x10'));var Redis=require(_0x8c78('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8c78('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c78('0x13'));var logger=require(_0x8c78('0x14'))('api');var utils=require(_0x8c78('0x15'));var config=require(_0x8c78('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8c78('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x56a802,_0x349dfa){_0x349dfa=_0x349dfa||0xcc;return function(_0x1b1d0e){if(_0x1b1d0e){return _0x56a802[_0x8c78('0x18')](_0x349dfa);}return _0x56a802[_0x8c78('0x19')](_0x349dfa)[_0x8c78('0x1a')]();};}function respondWithResult(_0x3d1306,_0xe5f8ae){_0xe5f8ae=_0xe5f8ae||0xc8;return function(_0x930233){if(_0x930233){return _0x3d1306[_0x8c78('0x19')](_0xe5f8ae)[_0x8c78('0x1b')](_0x930233);}};}function respondWithFilteredResult(_0x4ff4b0,_0x1fa78e){return function(_0x293cfe){if(_0x293cfe){var _0x57ad11=typeof _0x1fa78e[_0x8c78('0x1c')]===_0x8c78('0x1d')&&typeof _0x1fa78e[_0x8c78('0x1e')]===_0x8c78('0x1d');var _0x2a982c=_0x293cfe[_0x8c78('0x1f')];var _0x54eafa=_0x57ad11?0x0:_0x1fa78e['offset'];var _0x339d04=_0x57ad11?_0x293cfe['count']:_0x1fa78e['offset']+_0x1fa78e[_0x8c78('0x1e')];var _0x56c191;if(_0x339d04>=_0x2a982c){_0x339d04=_0x2a982c;_0x56c191=0xc8;}else{_0x56c191=0xce;}_0x4ff4b0[_0x8c78('0x19')](_0x56c191);return _0x4ff4b0[_0x8c78('0x20')]('Content-Range',_0x54eafa+'-'+_0x339d04+'/'+_0x2a982c)[_0x8c78('0x1b')](_0x293cfe);}return null;};}function patchUpdates(_0x5b111b){return function(_0x2dba52){try{jsonpatch[_0x8c78('0x21')](_0x2dba52,_0x5b111b,!![]);}catch(_0x5a254d){return BPromise[_0x8c78('0x22')](_0x5a254d);}return _0x2dba52[_0x8c78('0x23')]();};}function saveUpdates(_0x499603,_0x2bc595){return function(_0x28ed3a){if(_0x28ed3a){return _0x28ed3a[_0x8c78('0x24')](_0x499603)[_0x8c78('0x25')](function(_0x215940){return _0x215940;});}return null;};}function removeEntity(_0x20f483,_0xbfdf6f){return function(_0x1958f1){if(_0x1958f1){return _0x1958f1[_0x8c78('0x26')]()['then'](function(){_0x20f483[_0x8c78('0x19')](0xcc)[_0x8c78('0x1a')]();});}};}function handleEntityNotFound(_0x1d1cef,_0x49cccb){return function(_0x331bfe){if(!_0x331bfe){_0x1d1cef['sendStatus'](0x194);}return _0x331bfe;};}function handleError(_0xe85d05,_0x24f9a7){_0x24f9a7=_0x24f9a7||0x1f4;return function(_0x8d9ff9){logger['error'](_0x8d9ff9[_0x8c78('0x27')]);if(_0x8d9ff9[_0x8c78('0x28')]){delete _0x8d9ff9['name'];}_0xe85d05[_0x8c78('0x19')](_0x24f9a7)[_0x8c78('0x29')](_0x8d9ff9);};}exports[_0x8c78('0x2a')]=function(_0x36e8e5,_0x253776){var _0x2ab5cc={},_0x5ba7d4={},_0x1c3039={'count':0x0,'rows':[]};var _0x51add6=_[_0x8c78('0x2b')](db[_0x8c78('0x2c')][_0x8c78('0x2d')],function(_0x4e764f){return{'name':_0x4e764f[_0x8c78('0x2e')],'type':_0x4e764f[_0x8c78('0x2f')]['key']};});_0x5ba7d4[_0x8c78('0x30')]=_[_0x8c78('0x2b')](_0x51add6,_0x8c78('0x28'));_0x5ba7d4['query']=_[_0x8c78('0x31')](_0x36e8e5[_0x8c78('0x32')]);_0x5ba7d4[_0x8c78('0x33')]=_['intersection'](_0x5ba7d4[_0x8c78('0x30')],_0x5ba7d4[_0x8c78('0x32')]);_0x2ab5cc['attributes']=_[_0x8c78('0x34')](_0x5ba7d4[_0x8c78('0x30')],qs[_0x8c78('0x35')](_0x36e8e5[_0x8c78('0x32')][_0x8c78('0x35')]));_0x2ab5cc[_0x8c78('0x36')]=_0x2ab5cc[_0x8c78('0x36')][_0x8c78('0x37')]?_0x2ab5cc[_0x8c78('0x36')]:_0x5ba7d4[_0x8c78('0x30')];if(!_0x36e8e5['query'][_0x8c78('0x38')](_0x8c78('0x39'))){_0x2ab5cc[_0x8c78('0x1e')]=qs[_0x8c78('0x1e')](_0x36e8e5[_0x8c78('0x32')]['limit']);_0x2ab5cc[_0x8c78('0x1c')]=qs[_0x8c78('0x1c')](_0x36e8e5[_0x8c78('0x32')]['offset']);}_0x2ab5cc[_0x8c78('0x3a')]=qs[_0x8c78('0x3b')](_0x36e8e5['query'][_0x8c78('0x3b')]);_0x2ab5cc['where']=qs[_0x8c78('0x33')](_[_0x8c78('0x3c')](_0x36e8e5[_0x8c78('0x32')],_0x5ba7d4[_0x8c78('0x33')]),_0x51add6);if(_0x36e8e5['query'][_0x8c78('0x3d')]){_0x2ab5cc['where']=_[_0x8c78('0x3e')](_0x2ab5cc[_0x8c78('0x3f')],{'$or':_[_0x8c78('0x2b')](_0x51add6,function(_0x5ae2aa){if(_0x5ae2aa['type']!==_0x8c78('0x40')){var _0x25d143={};_0x25d143[_0x5ae2aa[_0x8c78('0x28')]]={'$like':'%'+_0x36e8e5[_0x8c78('0x32')][_0x8c78('0x3d')]+'%'};return _0x25d143;}})});}_0x2ab5cc=_[_0x8c78('0x3e')]({},_0x2ab5cc,_0x36e8e5[_0x8c78('0x41')]);var _0x314679={'where':_0x2ab5cc[_0x8c78('0x3f')]};return db[_0x8c78('0x2c')][_0x8c78('0x1f')](_0x314679)[_0x8c78('0x25')](function(_0x234d0e){_0x1c3039['count']=_0x234d0e;if(_0x36e8e5[_0x8c78('0x32')][_0x8c78('0x42')]){_0x2ab5cc['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0x8c78('0x43')](_0x2ab5cc);})[_0x8c78('0x25')](function(_0x5c9af3){_0x1c3039[_0x8c78('0x44')]=_0x5c9af3;return _0x1c3039;})[_0x8c78('0x25')](respondWithFilteredResult(_0x253776,_0x2ab5cc))['catch'](handleError(_0x253776,null));};exports[_0x8c78('0x45')]=function(_0x27603f,_0x57e2c7){var _0x10d521={'raw':![],'where':{'id':_0x27603f[_0x8c78('0x46')]['id']}},_0x24a8ea={};_0x24a8ea[_0x8c78('0x30')]=_[_0x8c78('0x31')](db['ZendeskAccount']['rawAttributes']);_0x24a8ea[_0x8c78('0x32')]=_[_0x8c78('0x31')](_0x27603f[_0x8c78('0x32')]);_0x24a8ea[_0x8c78('0x33')]=_[_0x8c78('0x34')](_0x24a8ea[_0x8c78('0x30')],_0x24a8ea[_0x8c78('0x32')]);_0x10d521[_0x8c78('0x36')]=_[_0x8c78('0x34')](_0x24a8ea[_0x8c78('0x30')],qs[_0x8c78('0x35')](_0x27603f['query'][_0x8c78('0x35')]));_0x10d521[_0x8c78('0x36')]=_0x10d521[_0x8c78('0x36')][_0x8c78('0x37')]?_0x10d521[_0x8c78('0x36')]:_0x24a8ea['model'];if(_0x27603f[_0x8c78('0x32')][_0x8c78('0x42')]){_0x10d521[_0x8c78('0x47')]=[{'all':!![]}];}_0x10d521=_[_0x8c78('0x3e')]({},_0x10d521,_0x27603f[_0x8c78('0x41')]);return db['ZendeskAccount'][_0x8c78('0x48')](_0x10d521)['then'](handleEntityNotFound(_0x57e2c7,null))['then'](respondWithResult(_0x57e2c7,null))[_0x8c78('0x49')](handleError(_0x57e2c7,null));};exports[_0x8c78('0x4a')]=function(_0x61e20,_0x5a5f3b){return db[_0x8c78('0x2c')][_0x8c78('0x4a')](_0x61e20[_0x8c78('0x4b')],{})[_0x8c78('0x25')](respondWithResult(_0x5a5f3b,0xc9))[_0x8c78('0x49')](handleError(_0x5a5f3b,null));};exports[_0x8c78('0x24')]=function(_0x26103c,_0x1f5cdb){if(_0x26103c[_0x8c78('0x4b')]['id']){delete _0x26103c['body']['id'];}return db[_0x8c78('0x2c')][_0x8c78('0x48')]({'where':{'id':_0x26103c[_0x8c78('0x46')]['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0x1f5cdb,null))['then'](saveUpdates(_0x26103c[_0x8c78('0x4b')],null))[_0x8c78('0x25')](respondWithResult(_0x1f5cdb,null))[_0x8c78('0x49')](handleError(_0x1f5cdb,null));};exports[_0x8c78('0x26')]=function(_0x53e75c,_0x336b95){return db[_0x8c78('0x2c')][_0x8c78('0x48')]({'where':{'id':_0x53e75c['params']['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0x336b95,null))['then'](removeEntity(_0x336b95,null))[_0x8c78('0x49')](handleError(_0x336b95,null));};exports[_0x8c78('0x4c')]=function(_0x402faa,_0xa87aba,_0x349b87){var _0x462b89={};var _0xf68e0={};var _0x38fec1;var _0x19d807;return db[_0x8c78('0x2c')][_0x8c78('0x4d')]({'where':{'id':_0x402faa[_0x8c78('0x46')]['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0xa87aba,null))[_0x8c78('0x25')](function(_0x54b40d){if(_0x54b40d){_0x38fec1=_0x54b40d;_0xf68e0[_0x8c78('0x30')]=_[_0x8c78('0x31')](db[_0x8c78('0x4e')][_0x8c78('0x2d')]);_0xf68e0['query']=_[_0x8c78('0x31')](_0x402faa[_0x8c78('0x32')]);_0xf68e0[_0x8c78('0x33')]=_[_0x8c78('0x34')](_0xf68e0[_0x8c78('0x30')],_0xf68e0[_0x8c78('0x32')]);_0x462b89['attributes']=_[_0x8c78('0x34')](_0xf68e0[_0x8c78('0x30')],qs['fields'](_0x402faa[_0x8c78('0x32')]['fields']));_0x462b89[_0x8c78('0x36')]=_0x462b89[_0x8c78('0x36')][_0x8c78('0x37')]?_0x462b89[_0x8c78('0x36')]:_0xf68e0[_0x8c78('0x30')];_0x462b89[_0x8c78('0x3a')]=qs[_0x8c78('0x3b')](_0x402faa['query'][_0x8c78('0x3b')]);_0x462b89[_0x8c78('0x3f')]=qs['filters'](_[_0x8c78('0x3c')](_0x402faa[_0x8c78('0x32')],_0xf68e0['filters']));if(_0x402faa[_0x8c78('0x32')][_0x8c78('0x3d')]){_0x462b89[_0x8c78('0x3f')]=_[_0x8c78('0x3e')](_0x462b89[_0x8c78('0x3f')],{'$or':_[_0x8c78('0x2b')](_0x462b89[_0x8c78('0x36')],function(_0x445630){var _0x20a0d9={};_0x20a0d9[_0x445630]={'$like':'%'+_0x402faa[_0x8c78('0x32')][_0x8c78('0x3d')]+'%'};return _0x20a0d9;})});}_0x462b89=_[_0x8c78('0x3e')]({},_0x462b89,_0x402faa[_0x8c78('0x41')]);return _0x38fec1[_0x8c78('0x4c')](_0x462b89);}})['then'](function(_0x3897ea){if(_0x3897ea){_0x19d807=_0x3897ea['length'];if(!_0x402faa[_0x8c78('0x32')]['hasOwnProperty']('nolimit')){_0x462b89['limit']=qs[_0x8c78('0x1e')](_0x402faa['query']['limit']);_0x462b89['offset']=qs[_0x8c78('0x1c')](_0x402faa[_0x8c78('0x32')][_0x8c78('0x1c')]);}return _0x38fec1[_0x8c78('0x4c')](_0x462b89);}})['then'](function(_0x333272){if(_0x333272){return _0x333272?{'count':_0x19d807,'rows':_0x333272}:null;}})[_0x8c78('0x25')](respondWithResult(_0xa87aba,null))[_0x8c78('0x49')](handleError(_0xa87aba,null));};exports[_0x8c78('0x4f')]=function(_0x334d0a,_0x3c3332,_0x3990c2){if(_0x334d0a[_0x8c78('0x4b')]['id']){delete _0x334d0a[_0x8c78('0x4b')]['id'];}return db[_0x8c78('0x2c')][_0x8c78('0x4d')]({'where':{'id':_0x334d0a[_0x8c78('0x46')]['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0x3c3332,null))[_0x8c78('0x25')](function(_0x4bdb7e){if(_0x4bdb7e){_0x334d0a[_0x8c78('0x4b')]['AccountId']=_0x4bdb7e['id'];_0x334d0a[_0x8c78('0x4b')][_0x8c78('0x50')]=integrations[_0x8c78('0x51')](_0x334d0a['body'][_0x8c78('0x52')],_0x334d0a[_0x8c78('0x4b')][_0x8c78('0x2f')]);_0x334d0a['body'][_0x8c78('0x53')]=integrations[_0x8c78('0x54')](_0x334d0a['body'][_0x8c78('0x52')],_0x334d0a[_0x8c78('0x4b')][_0x8c78('0x2f')]);return db['ZendeskConfiguration'][_0x8c78('0x4a')](_0x334d0a[_0x8c78('0x4b')],{'include':[{'model':db[_0x8c78('0x55')],'as':_0x8c78('0x50')},{'model':db[_0x8c78('0x55')],'as':_0x8c78('0x53')}]});}return null;})[_0x8c78('0x25')](respondWithResult(_0x3c3332,null))[_0x8c78('0x49')](handleError(_0x3c3332,null));};exports[_0x8c78('0x56')]=function(_0x5646ff,_0x1f2b8f,_0x21b400){var _0x3c6886='';return db[_0x8c78('0x2c')][_0x8c78('0x4d')]({'where':{'id':_0x5646ff[_0x8c78('0x46')]['id']},'attributes':['id',_0x8c78('0x57'),_0x8c78('0x58'),_0x8c78('0x59'),'authType',_0x8c78('0x5a')]})[_0x8c78('0x25')](handleEntityNotFound(_0x1f2b8f,null))['then'](function(_0x5e6a23){if(_0x5e6a23){_0x3c6886=_0x5e6a23[_0x8c78('0x5a')];var _0x4dbb47=_0x3c6886[_0x8c78('0x5b')](-0x1);if(_0x4dbb47==='/'){_0x3c6886=_0x3c6886[_0x8c78('0x5c')](0x0,_0x3c6886[_0x8c78('0x5d')](_0x4dbb47));}var _0x476835={'method':_0x8c78('0x5e'),'uri':util[_0x8c78('0x5f')]('%s/%s',_0x3c6886,'ticket_fields'),'json':!![]};switch(_0x5e6a23[_0x8c78('0x60')]){case _0x8c78('0x58'):_0x476835[_0x8c78('0x61')]={'Authorization':util[_0x8c78('0x5f')](_0x8c78('0x62'),new Buffer(util['format'](_0x8c78('0x63'),_0x5e6a23[_0x8c78('0x57')],_0x5e6a23[_0x8c78('0x58')]))[_0x8c78('0x64')](_0x8c78('0x65')))};break;case _0x8c78('0x59'):_0x476835['headers']={'Authorization':util[_0x8c78('0x5f')](_0x8c78('0x62'),new Buffer(util['format'](_0x8c78('0x66'),_0x5e6a23[_0x8c78('0x57')],_0x5e6a23[_0x8c78('0x59')]))[_0x8c78('0x64')](_0x8c78('0x65')))};break;default:throw new db[(_0x8c78('0x67'))][(_0x8c78('0x68'))](_0x8c78('0x69'));}return rp(_0x476835);}})[_0x8c78('0x25')](function(_0x402cff){if(_0x402cff){var _0x280a8b=[_0x8c78('0x6a'),_0x8c78('0x6b'),_0x8c78('0x6c'),_0x8c78('0x6d')];_[_0x8c78('0x6e')](_0x402cff[_0x8c78('0x6f')],function(_0x4c6cc5){return _0x280a8b[_0x8c78('0x70')](_0x4c6cc5['type']);});return{'count':_0x402cff['ticket_fields'][_0x8c78('0x37')],'rows':_[_0x8c78('0x2b')](_0x402cff[_0x8c78('0x6f')],function(_0x3b3c51){return{'id':_0x3b3c51['id'],'name':_0x3b3c51['position']>0x7?_0x3b3c51[_0x8c78('0x71')]:_0x3b3c51[_0x8c78('0x2f')],'custom':_0x3b3c51[_0x8c78('0x72')]>0x7?!![]:![],'options':_0x3b3c51['system_field_options']?_0x3b3c51[_0x8c78('0x73')]:_0x3b3c51[_0x8c78('0x74')]?_0x3b3c51[_0x8c78('0x74')]:[]};})};}})[_0x8c78('0x25')](respondWithResult(_0x1f2b8f,null))['catch'](function(_0xfff9a5){var _0x837c68=_0x5646ff['query']['test']?0x1f4:_0xfff9a5['statusCode']||0x1f4;logger[_0x8c78('0x75')](_0x8c78('0x76'),_0x8c78('0x56'),_0x837c68,JSON[_0x8c78('0x77')](_0xfff9a5));delete _0xfff9a5['name'];if(_0x837c68===0x191){_0x837c68=0x190;}_0x1f2b8f[_0x8c78('0x19')](_0x837c68)['send'](_0x5646ff[_0x8c78('0x32')][_0x8c78('0x78')]?{'message':_0x8c78('0x79'),'statusCode':_0xfff9a5[_0x8c78('0x7a')]}:_0xfff9a5);});};
\ No newline at end of file
index d7a6e28..1c4ccde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb68=['moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','int_zendesk_accounts','lodash','../../config/logger','api'];(function(_0x3b4f45,_0x1661db){var _0xb725ae=function(_0x277895){while(--_0x277895){_0x3b4f45['push'](_0x3b4f45['shift']());}};_0xb725ae(++_0x1661db);}(_0xfb68,0xc0));var _0x8fb6=function(_0x48e2e1,_0xb5ed3f){_0x48e2e1=_0x48e2e1-0x0;var _0x5c19eb=_0xfb68[_0x48e2e1];return _0x5c19eb;};'use strict';var _=require(_0x8fb6('0x0'));var util=require('util');var logger=require(_0x8fb6('0x1'))(_0x8fb6('0x2'));var moment=require(_0x8fb6('0x3'));var BPromise=require(_0x8fb6('0x4'));var rp=require(_0x8fb6('0x5'));var fs=require('fs');var path=require(_0x8fb6('0x6'));var rimraf=require(_0x8fb6('0x7'));var config=require(_0x8fb6('0x8'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x8fb6('0x9'));module[_0x8fb6('0xa')]=function(_0x2a1971,_0x477143){return _0x2a1971[_0x8fb6('0xb')]('ZendeskAccount',attributes,{'tableName':_0x8fb6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7fe7=['int_zendesk_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x2dd6a3,_0x331095){var _0x4eff75=function(_0xc0d1cb){while(--_0xc0d1cb){_0x2dd6a3['push'](_0x2dd6a3['shift']());}};_0x4eff75(++_0x331095);}(_0x7fe7,0xe1));var _0x77fe=function(_0x287aba,_0x2b05a3){_0x287aba=_0x287aba-0x0;var _0x25d2ea=_0x7fe7[_0x287aba];return _0x25d2ea;};'use strict';var _=require(_0x77fe('0x0'));var util=require(_0x77fe('0x1'));var logger=require(_0x77fe('0x2'))(_0x77fe('0x3'));var moment=require('moment');var BPromise=require(_0x77fe('0x4'));var rp=require(_0x77fe('0x5'));var fs=require('fs');var path=require(_0x77fe('0x6'));var rimraf=require(_0x77fe('0x7'));var config=require(_0x77fe('0x8'));var attributes=require(_0x77fe('0x9'));var integrations=require(_0x77fe('0xa'));module[_0x77fe('0xb')]=function(_0x2306ef,_0x4725c8){return _0x2306ef[_0x77fe('0xc')]('ZendeskAccount',attributes,{'tableName':_0x77fe('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 75f3ef8..88a711c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed48=['result','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetZendeskAccount','ShowZendeskAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x22b8a3,_0x2a79a7){var _0x199a0c=function(_0x544c66){while(--_0x544c66){_0x22b8a3['push'](_0x22b8a3['shift']());}};_0x199a0c(++_0x2a79a7);}(_0xed48,0x176));var _0x8ed4=function(_0x3f9ac2,_0x1b670b){_0x3f9ac2=_0x3f9ac2-0x0;var _0xe6a436=_0xed48[_0x3f9ac2];return _0xe6a436;};'use strict';var _=require(_0x8ed4('0x0'));var util=require(_0x8ed4('0x1'));var moment=require('moment');var BPromise=require(_0x8ed4('0x2'));var rs=require(_0x8ed4('0x3'));var fs=require('fs');var Redis=require(_0x8ed4('0x4'));var db=require(_0x8ed4('0x5'))['db'];var utils=require(_0x8ed4('0x6'));var logger=require('../../config/logger')(_0x8ed4('0x7'));var config=require(_0x8ed4('0x8'));var jayson=require(_0x8ed4('0x9'));var client=jayson[_0x8ed4('0xa')][_0x8ed4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x196d77,_0x1c7326,_0x3eebe9){return new BPromise(function(_0x51d223,_0x46cebb){return client[_0x8ed4('0xc')](_0x196d77,_0x3eebe9)[_0x8ed4('0xd')](function(_0x398983){logger['info'](_0x8ed4('0xe'),_0x1c7326,_0x8ed4('0xf'));logger[_0x8ed4('0x10')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x1c7326,_0x8ed4('0xf'),JSON[_0x8ed4('0x11')](_0x398983));if(_0x398983[_0x8ed4('0x12')]){if(_0x398983['error'][_0x8ed4('0x13')]===0x1f4){logger[_0x8ed4('0x12')](_0x8ed4('0xe'),_0x1c7326,_0x398983[_0x8ed4('0x12')]['message']);return _0x46cebb(_0x398983[_0x8ed4('0x12')][_0x8ed4('0x14')]);}logger[_0x8ed4('0x12')](_0x8ed4('0xe'),_0x1c7326,_0x398983[_0x8ed4('0x12')]['message']);return _0x51d223(_0x398983['error']['message']);}else{logger[_0x8ed4('0x15')](_0x8ed4('0xe'),_0x1c7326,_0x8ed4('0xf'));_0x51d223(_0x398983[_0x8ed4('0x16')][_0x8ed4('0x14')]);}})[_0x8ed4('0x17')](function(_0x5f45ca){logger[_0x8ed4('0x12')](_0x8ed4('0xe'),_0x1c7326,_0x5f45ca);_0x46cebb(_0x5f45ca);});});}exports['GetZendeskAccount']=function(_0x28f775){var _0x38cce4=this;return new Promise(function(_0x7a606d,_0x7644d2){return db['ZendeskAccount'][_0x8ed4('0x18')]({'raw':_0x28f775[_0x8ed4('0x19')]?_0x28f775[_0x8ed4('0x19')][_0x8ed4('0x1a')]===undefined?!![]:![]:!![],'where':_0x28f775[_0x8ed4('0x19')]?_0x28f775[_0x8ed4('0x19')][_0x8ed4('0x1b')]||null:null,'attributes':_0x28f775[_0x8ed4('0x19')]?_0x28f775['options'][_0x8ed4('0x1c')]||null:null,'limit':_0x28f775[_0x8ed4('0x19')]?_0x28f775[_0x8ed4('0x19')][_0x8ed4('0x1d')]||null:null,'include':_0x28f775[_0x8ed4('0x19')]?_0x28f775[_0x8ed4('0x19')][_0x8ed4('0x1e')]?_[_0x8ed4('0x1f')](_0x28f775[_0x8ed4('0x19')][_0x8ed4('0x1e')],function(_0x19b966){return{'model':db[_0x19b966[_0x8ed4('0x20')]],'as':_0x19b966['as'],'attributes':_0x19b966['attributes'],'include':_0x19b966['include']?_['map'](_0x19b966[_0x8ed4('0x1e')],function(_0x404167){return{'model':db[_0x404167[_0x8ed4('0x20')]],'as':_0x404167['as'],'attributes':_0x404167[_0x8ed4('0x1c')],'include':_0x404167[_0x8ed4('0x1e')]?_[_0x8ed4('0x1f')](_0x404167[_0x8ed4('0x1e')],function(_0x5a1f70){return{'model':db[_0x5a1f70['model']],'as':_0x5a1f70['as'],'attributes':_0x5a1f70['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x46acaf){logger[_0x8ed4('0x15')](_0x8ed4('0x21'),_0x28f775);logger[_0x8ed4('0x10')](_0x8ed4('0x21'),_0x28f775,JSON[_0x8ed4('0x11')](_0x46acaf));_0x7a606d(_0x46acaf);})[_0x8ed4('0x17')](function(_0x29b578){logger[_0x8ed4('0x12')](_0x8ed4('0x21'),_0x29b578[_0x8ed4('0x14')],_0x28f775);_0x7644d2(_0x38cce4[_0x8ed4('0x12')](0x1f4,_0x29b578['message']));});});};exports[_0x8ed4('0x22')]=function(_0x10785a){var _0x31507f=this;return new Promise(function(_0x4cbad3,_0xf41044){return db['ZendeskAccount'][_0x8ed4('0x23')]({'raw':_0x10785a[_0x8ed4('0x19')]?_0x10785a[_0x8ed4('0x19')][_0x8ed4('0x1a')]===undefined?!![]:![]:!![],'where':_0x10785a['options']?_0x10785a[_0x8ed4('0x19')][_0x8ed4('0x1b')]||null:null,'attributes':_0x10785a[_0x8ed4('0x19')]?_0x10785a['options'][_0x8ed4('0x1c')]||null:null,'include':_0x10785a[_0x8ed4('0x19')]?_0x10785a['options'][_0x8ed4('0x1e')]?_[_0x8ed4('0x1f')](_0x10785a[_0x8ed4('0x19')]['include'],function(_0x367e85){return{'model':db[_0x367e85[_0x8ed4('0x20')]],'as':_0x367e85['as'],'attributes':_0x367e85[_0x8ed4('0x1c')],'include':_0x367e85[_0x8ed4('0x1e')]?_[_0x8ed4('0x1f')](_0x367e85[_0x8ed4('0x1e')],function(_0x85a246){return{'model':db[_0x85a246[_0x8ed4('0x20')]],'as':_0x85a246['as'],'attributes':_0x85a246[_0x8ed4('0x1c')],'include':_0x85a246[_0x8ed4('0x1e')]?_[_0x8ed4('0x1f')](_0x85a246['include'],function(_0x56cd6c){return{'model':db[_0x56cd6c[_0x8ed4('0x20')]],'as':_0x56cd6c['as'],'attributes':_0x56cd6c[_0x8ed4('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x255898){logger['info'](_0x8ed4('0x22'),_0x10785a);logger[_0x8ed4('0x10')]('ShowZendeskAccount',_0x10785a,JSON[_0x8ed4('0x11')](_0x255898));_0x4cbad3(_0x255898);})[_0x8ed4('0x17')](function(_0x3572e8){logger['error'](_0x8ed4('0x22'),_0x3572e8[_0x8ed4('0x14')],_0x10785a);_0xf41044(_0x31507f[_0x8ed4('0x12')](0x1f4,_0x3572e8[_0x8ed4('0x14')]));});});};
\ No newline at end of file
+var _0x046b=['error','message','catch','GetZendeskAccount','ZendeskAccount','options','where','attributes','include','map','model','find','ShowZendeskAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x046b,0x1ba));var _0xb046=function(_0x547302,_0x2fccee){_0x547302=_0x547302-0x0;var _0x3a24f0=_0x046b[_0x547302];return _0x3a24f0;};'use strict';var _=require(_0xb046('0x0'));var util=require(_0xb046('0x1'));var moment=require(_0xb046('0x2'));var BPromise=require(_0xb046('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb046('0x4'));var db=require(_0xb046('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb046('0x6'))(_0xb046('0x7'));var config=require(_0xb046('0x8'));var jayson=require(_0xb046('0x9'));var client=jayson[_0xb046('0xa')][_0xb046('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x475e10,_0x24e1d7,_0x2a3c2e){return new BPromise(function(_0x231f85,_0x32aa04){return client[_0xb046('0xc')](_0x475e10,_0x2a3c2e)[_0xb046('0xd')](function(_0x53c263){logger[_0xb046('0xe')](_0xb046('0xf'),_0x24e1d7,_0xb046('0x10'));logger[_0xb046('0x11')](_0xb046('0x12'),_0x24e1d7,'request\x20sent',JSON[_0xb046('0x13')](_0x53c263));if(_0x53c263[_0xb046('0x14')]){if(_0x53c263['error']['code']===0x1f4){logger[_0xb046('0x14')](_0xb046('0xf'),_0x24e1d7,_0x53c263[_0xb046('0x14')][_0xb046('0x15')]);return _0x32aa04(_0x53c263[_0xb046('0x14')][_0xb046('0x15')]);}logger[_0xb046('0x14')](_0xb046('0xf'),_0x24e1d7,_0x53c263[_0xb046('0x14')][_0xb046('0x15')]);return _0x231f85(_0x53c263['error'][_0xb046('0x15')]);}else{logger[_0xb046('0xe')]('ZendeskAccount,\x20%s,\x20%s',_0x24e1d7,_0xb046('0x10'));_0x231f85(_0x53c263['result'][_0xb046('0x15')]);}})[_0xb046('0x16')](function(_0x3199b8){logger[_0xb046('0x14')](_0xb046('0xf'),_0x24e1d7,_0x3199b8);_0x32aa04(_0x3199b8);});});}exports[_0xb046('0x17')]=function(_0x52241f){var _0x47d1ad=this;return new Promise(function(_0x17bbb0,_0x4431bd){return db[_0xb046('0x18')]['findAll']({'raw':_0x52241f['options']?_0x52241f[_0xb046('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x52241f[_0xb046('0x19')]?_0x52241f['options'][_0xb046('0x1a')]||null:null,'attributes':_0x52241f[_0xb046('0x19')]?_0x52241f[_0xb046('0x19')][_0xb046('0x1b')]||null:null,'limit':_0x52241f['options']?_0x52241f['options']['limit']||null:null,'include':_0x52241f[_0xb046('0x19')]?_0x52241f[_0xb046('0x19')][_0xb046('0x1c')]?_[_0xb046('0x1d')](_0x52241f[_0xb046('0x19')][_0xb046('0x1c')],function(_0x51c65d){return{'model':db[_0x51c65d[_0xb046('0x1e')]],'as':_0x51c65d['as'],'attributes':_0x51c65d['attributes'],'include':_0x51c65d['include']?_[_0xb046('0x1d')](_0x51c65d[_0xb046('0x1c')],function(_0x1c3638){return{'model':db[_0x1c3638[_0xb046('0x1e')]],'as':_0x1c3638['as'],'attributes':_0x1c3638[_0xb046('0x1b')],'include':_0x1c3638[_0xb046('0x1c')]?_[_0xb046('0x1d')](_0x1c3638[_0xb046('0x1c')],function(_0x5ac704){return{'model':db[_0x5ac704['model']],'as':_0x5ac704['as'],'attributes':_0x5ac704[_0xb046('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ff57c){logger[_0xb046('0xe')](_0xb046('0x17'),_0x52241f);logger[_0xb046('0x11')](_0xb046('0x17'),_0x52241f,JSON[_0xb046('0x13')](_0x2ff57c));_0x17bbb0(_0x2ff57c);})[_0xb046('0x16')](function(_0x333dbe){logger[_0xb046('0x14')](_0xb046('0x17'),_0x333dbe[_0xb046('0x15')],_0x52241f);_0x4431bd(_0x47d1ad[_0xb046('0x14')](0x1f4,_0x333dbe[_0xb046('0x15')]));});});};exports['ShowZendeskAccount']=function(_0x28b3fb){var _0x5398f9=this;return new Promise(function(_0x9fd5f8,_0x57124d){return db[_0xb046('0x18')][_0xb046('0x1f')]({'raw':_0x28b3fb[_0xb046('0x19')]?_0x28b3fb['options']['raw']===undefined?!![]:![]:!![],'where':_0x28b3fb[_0xb046('0x19')]?_0x28b3fb[_0xb046('0x19')][_0xb046('0x1a')]||null:null,'attributes':_0x28b3fb[_0xb046('0x19')]?_0x28b3fb['options'][_0xb046('0x1b')]||null:null,'include':_0x28b3fb[_0xb046('0x19')]?_0x28b3fb[_0xb046('0x19')]['include']?_[_0xb046('0x1d')](_0x28b3fb[_0xb046('0x19')][_0xb046('0x1c')],function(_0x293b56){return{'model':db[_0x293b56[_0xb046('0x1e')]],'as':_0x293b56['as'],'attributes':_0x293b56[_0xb046('0x1b')],'include':_0x293b56['include']?_['map'](_0x293b56[_0xb046('0x1c')],function(_0x285092){return{'model':db[_0x285092[_0xb046('0x1e')]],'as':_0x285092['as'],'attributes':_0x285092[_0xb046('0x1b')],'include':_0x285092[_0xb046('0x1c')]?_['map'](_0x285092[_0xb046('0x1c')],function(_0x5b0278){return{'model':db[_0x5b0278[_0xb046('0x1e')]],'as':_0x5b0278['as'],'attributes':_0x5b0278[_0xb046('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb046('0xd')](function(_0x271c14){logger[_0xb046('0xe')](_0xb046('0x20'),_0x28b3fb);logger[_0xb046('0x11')](_0xb046('0x20'),_0x28b3fb,JSON['stringify'](_0x271c14));_0x9fd5f8(_0x271c14);})[_0xb046('0x16')](function(_0x10ddfa){logger[_0xb046('0x14')]('ShowZendeskAccount',_0x10ddfa['message'],_0x28b3fb);_0x57124d(_0x5398f9['error'](0x1f4,_0x10ddfa['message']));});});};
\ No newline at end of file
index 6e684c7..78e1061 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['delete','destroy','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','index','get','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','put','update'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xb7e7,0x121));var _0x7b7e=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0xb7e7[_0x424a9a];return _0xa7831c;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x8')](_0x7b7e('0xb'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0x8')](_0x7b7e('0xe'),auth['isAuthenticated'](),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x8')](_0x7b7e('0x10'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x11')]);router[_0x7b7e('0x8')](_0x7b7e('0x12'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x13')]);router['post']('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x14')]);router['post'](_0x7b7e('0x12'),auth['isAuthenticated'](),controller['setTags']);router[_0x7b7e('0x15')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x16')]);router[_0x7b7e('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x7b7e('0x18')]);module[_0x7b7e('0x19')]=router;
\ No newline at end of file
+var _0x0713=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','post','setTags','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x1bbc08,_0x444008){var _0x5d825b=function(_0x522920){while(--_0x522920){_0x1bbc08['push'](_0x1bbc08['shift']());}};_0x5d825b(++_0x444008);}(_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'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['getFields']);router[_0x3071('0x8')](_0x3071('0xe'),auth[_0x3071('0x9')](),controller[_0x3071('0xf')]);router[_0x3071('0x8')]('/:id/descriptions',auth[_0x3071('0x9')](),controller[_0x3071('0x10')]);router[_0x3071('0x8')](_0x3071('0x11'),auth[_0x3071('0x9')](),controller['getTags']);router['post']('/',auth[_0x3071('0x9')](),controller['create']);router[_0x3071('0x12')](_0x3071('0x11'),auth['isAuthenticated'](),controller[_0x3071('0x13')]);router['put'](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0x14')]);router[_0x3071('0x15')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0x16')]);module[_0x3071('0x17')]=router;
\ No newline at end of file
index 9590a27..5ab3716 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cc5=['STRING'];(function(_0xa4928c,_0x16b89c){var _0x27cc29=function(_0x14b819){while(--_0x14b819){_0xa4928c['push'](_0xa4928c['shift']());}};_0x27cc29(++_0x16b89c);}(_0x2cc5,0x182));var _0x52cc=function(_0x3b3fe4,_0x2ecb64){_0x3b3fe4=_0x3b3fe4-0x0;var _0x1158de=_0x2cc5[_0x3b3fe4];return _0x1158de;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x52cc('0x0')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x18e1=['sequelize'];(function(_0xc5b34f,_0x2e4810){var _0x2eeb54=function(_0x4d45f3){while(--_0x4d45f3){_0xc5b34f['push'](_0xc5b34f['shift']());}};_0x2eeb54(++_0x2e4810);}(_0x18e1,0x6b));var _0x118e=function(_0x12a884,_0x3803c5){_0x12a884=_0x12a884-0x0;var _0x2d604e=_0x18e1[_0x12a884];return _0x2d604e;};'use strict';var Sequelize=require(_0x118e('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 7bbbb81..9c70a8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94c1=['Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','keys','find','create','body','params','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','count','set'];(function(_0x1a47a8,_0x399f70){var _0x50fe0c=function(_0x378cb9){while(--_0x378cb9){_0x1a47a8['push'](_0x1a47a8['shift']());}};_0x50fe0c(++_0x399f70);}(_0x94c1,0x8d));var _0x194c=function(_0x4d0af5,_0x55dc07){_0x4d0af5=_0x4d0af5-0x0;var _0x5d0b82=_0x94c1[_0x4d0af5];return _0x5d0b82;};'use strict';var emlformat=require(_0x194c('0x0'));var rimraf=require(_0x194c('0x1'));var zipdir=require(_0x194c('0x2'));var jsonpatch=require(_0x194c('0x3'));var rp=require(_0x194c('0x4'));var moment=require(_0x194c('0x5'));var BPromise=require(_0x194c('0x6'));var Mustache=require(_0x194c('0x7'));var util=require(_0x194c('0x8'));var path=require('path');var sox=require(_0x194c('0x9'));var csv=require(_0x194c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x194c('0xb'));var _=require(_0x194c('0xc'));var squel=require(_0x194c('0xd'));var crypto=require('crypto');var jsforce=require(_0x194c('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x194c('0xf'));var Papa=require(_0x194c('0x10'));var Redis=require(_0x194c('0x11'));var authService=require(_0x194c('0x12'));var qs=require(_0x194c('0x13'));var as=require(_0x194c('0x14'));var hardwareService=require(_0x194c('0x15'));var logger=require('../../config/logger')(_0x194c('0x16'));var utils=require(_0x194c('0x17'));var config=require(_0x194c('0x18'));var licenseUtil=require(_0x194c('0x19'));var db=require(_0x194c('0x1a'))['db'];function respondWithStatusCode(_0x42fc3f,_0x117d32){_0x117d32=_0x117d32||0xcc;return function(_0x2ed6ac){if(_0x2ed6ac){return _0x42fc3f['sendStatus'](_0x117d32);}return _0x42fc3f[_0x194c('0x1b')](_0x117d32)[_0x194c('0x1c')]();};}function respondWithResult(_0xcbff5a,_0x57cb53){_0x57cb53=_0x57cb53||0xc8;return function(_0x18a07e){if(_0x18a07e){return _0xcbff5a[_0x194c('0x1b')](_0x57cb53)[_0x194c('0x1d')](_0x18a07e);}};}function respondWithFilteredResult(_0x164c2f,_0x11fd34){return function(_0x4c55c7){if(_0x4c55c7){var _0x86fbfc=typeof _0x11fd34['offset']==='undefined'&&typeof _0x11fd34[_0x194c('0x1e')]==='undefined';var _0x278fae=_0x4c55c7['count'];var _0x343b9e=_0x86fbfc?0x0:_0x11fd34['offset'];var _0x2ff535=_0x86fbfc?_0x4c55c7[_0x194c('0x1f')]:_0x11fd34['offset']+_0x11fd34[_0x194c('0x1e')];var _0x15c31a;if(_0x2ff535>=_0x278fae){_0x2ff535=_0x278fae;_0x15c31a=0xc8;}else{_0x15c31a=0xce;}_0x164c2f[_0x194c('0x1b')](_0x15c31a);return _0x164c2f[_0x194c('0x20')](_0x194c('0x21'),_0x343b9e+'-'+_0x2ff535+'/'+_0x278fae)[_0x194c('0x1d')](_0x4c55c7);}return null;};}function patchUpdates(_0x31bf80){return function(_0x342094){try{jsonpatch[_0x194c('0x22')](_0x342094,_0x31bf80,!![]);}catch(_0x1df771){return BPromise[_0x194c('0x23')](_0x1df771);}return _0x342094[_0x194c('0x24')]();};}function saveUpdates(_0x53a8c8,_0x3a2a30){return function(_0x379ffc){if(_0x379ffc){return _0x379ffc[_0x194c('0x25')](_0x53a8c8)[_0x194c('0x26')](function(_0x2adec8){return _0x2adec8;});}return null;};}function removeEntity(_0x590deb,_0x549f89){return function(_0x480eec){if(_0x480eec){return _0x480eec[_0x194c('0x27')]()[_0x194c('0x26')](function(){_0x590deb[_0x194c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4308fb,_0x37a899){return function(_0x32fca3){if(!_0x32fca3){_0x4308fb[_0x194c('0x28')](0x194);}return _0x32fca3;};}function handleError(_0x1593f9,_0x358830){_0x358830=_0x358830||0x1f4;return function(_0x328567){logger[_0x194c('0x29')](_0x328567[_0x194c('0x2a')]);if(_0x328567[_0x194c('0x2b')]){delete _0x328567[_0x194c('0x2b')];}_0x1593f9[_0x194c('0x1b')](_0x358830)[_0x194c('0x2c')](_0x328567);};}exports[_0x194c('0x2d')]=function(_0x3ef61c,_0x218563){var _0x7c770={},_0x7da156={},_0x3a1a5d={'count':0x0,'rows':[]};var _0x30f465=_[_0x194c('0x2e')](db[_0x194c('0x2f')][_0x194c('0x30')],function(_0x1d17cc){return{'name':_0x1d17cc['fieldName'],'type':_0x1d17cc[_0x194c('0x31')][_0x194c('0x32')]};});_0x7da156[_0x194c('0x33')]=_[_0x194c('0x2e')](_0x30f465,_0x194c('0x2b'));_0x7da156['query']=_['keys'](_0x3ef61c[_0x194c('0x34')]);_0x7da156[_0x194c('0x35')]=_[_0x194c('0x36')](_0x7da156[_0x194c('0x33')],_0x7da156['query']);_0x7c770[_0x194c('0x37')]=_[_0x194c('0x36')](_0x7da156[_0x194c('0x33')],qs[_0x194c('0x38')](_0x3ef61c['query'][_0x194c('0x38')]));_0x7c770[_0x194c('0x37')]=_0x7c770[_0x194c('0x37')][_0x194c('0x39')]?_0x7c770[_0x194c('0x37')]:_0x7da156[_0x194c('0x33')];if(!_0x3ef61c['query'][_0x194c('0x3a')](_0x194c('0x3b'))){_0x7c770[_0x194c('0x1e')]=qs['limit'](_0x3ef61c[_0x194c('0x34')][_0x194c('0x1e')]);_0x7c770[_0x194c('0x3c')]=qs[_0x194c('0x3c')](_0x3ef61c['query'][_0x194c('0x3c')]);}_0x7c770[_0x194c('0x3d')]=qs[_0x194c('0x3e')](_0x3ef61c[_0x194c('0x34')][_0x194c('0x3e')]);_0x7c770[_0x194c('0x3f')]=qs['filters'](_[_0x194c('0x40')](_0x3ef61c[_0x194c('0x34')],_0x7da156['filters']),_0x30f465);if(_0x3ef61c[_0x194c('0x34')][_0x194c('0x41')]){_0x7c770[_0x194c('0x3f')]=_[_0x194c('0x42')](_0x7c770[_0x194c('0x3f')],{'$or':_[_0x194c('0x2e')](_0x30f465,function(_0x390050){if(_0x390050[_0x194c('0x31')]!==_0x194c('0x43')){var _0x27c6a5={};_0x27c6a5[_0x390050[_0x194c('0x2b')]]={'$like':'%'+_0x3ef61c[_0x194c('0x34')][_0x194c('0x41')]+'%'};return _0x27c6a5;}})});}_0x7c770=_['merge']({},_0x7c770,_0x3ef61c[_0x194c('0x44')]);var _0x2dc62f={'where':_0x7c770[_0x194c('0x3f')]};return db[_0x194c('0x2f')][_0x194c('0x1f')](_0x2dc62f)[_0x194c('0x26')](function(_0x5c32f0){_0x3a1a5d[_0x194c('0x1f')]=_0x5c32f0;if(_0x3ef61c[_0x194c('0x34')][_0x194c('0x45')]){_0x7c770[_0x194c('0x46')]=[{'all':!![]}];}return db[_0x194c('0x2f')]['findAll'](_0x7c770);})[_0x194c('0x26')](function(_0x2e8947){_0x3a1a5d['rows']=_0x2e8947;return _0x3a1a5d;})[_0x194c('0x26')](respondWithFilteredResult(_0x218563,_0x7c770))[_0x194c('0x47')](handleError(_0x218563,null));};exports[_0x194c('0x48')]=function(_0x510360,_0x3b7229){var _0x3abc48={'raw':![],'where':{'id':_0x510360['params']['id']}},_0x729c23={};_0x729c23[_0x194c('0x33')]=_['keys'](db[_0x194c('0x2f')][_0x194c('0x30')]);_0x729c23[_0x194c('0x34')]=_[_0x194c('0x49')](_0x510360[_0x194c('0x34')]);_0x729c23[_0x194c('0x35')]=_[_0x194c('0x36')](_0x729c23[_0x194c('0x33')],_0x729c23[_0x194c('0x34')]);_0x3abc48['attributes']=_[_0x194c('0x36')](_0x729c23['model'],qs[_0x194c('0x38')](_0x510360['query'][_0x194c('0x38')]));_0x3abc48[_0x194c('0x37')]=_0x3abc48['attributes']['length']?_0x3abc48[_0x194c('0x37')]:_0x729c23[_0x194c('0x33')];if(_0x510360[_0x194c('0x34')]['includeAll']){_0x3abc48[_0x194c('0x46')]=[{'all':!![]}];}_0x3abc48=_[_0x194c('0x42')]({},_0x3abc48,_0x510360[_0x194c('0x44')]);return db[_0x194c('0x2f')][_0x194c('0x4a')](_0x3abc48)[_0x194c('0x26')](handleEntityNotFound(_0x3b7229,null))[_0x194c('0x26')](respondWithResult(_0x3b7229,null))[_0x194c('0x47')](handleError(_0x3b7229,null));};exports[_0x194c('0x4b')]=function(_0x301fc2,_0x444da0){return db['ZendeskConfiguration']['create'](_0x301fc2['body'],{})[_0x194c('0x26')](respondWithResult(_0x444da0,0xc9))[_0x194c('0x47')](handleError(_0x444da0,null));};exports[_0x194c('0x25')]=function(_0x67ed71,_0x4674fa){if(_0x67ed71['body']['id']){delete _0x67ed71[_0x194c('0x4c')]['id'];}return db[_0x194c('0x2f')]['find']({'where':{'id':_0x67ed71[_0x194c('0x4d')]['id']}})[_0x194c('0x26')](handleEntityNotFound(_0x4674fa,null))[_0x194c('0x26')](saveUpdates(_0x67ed71[_0x194c('0x4c')],null))['then'](respondWithResult(_0x4674fa,null))['catch'](handleError(_0x4674fa,null));};exports[_0x194c('0x27')]=function(_0x2157d2,_0x4eeb6e){return db[_0x194c('0x2f')][_0x194c('0x4a')]({'where':{'id':_0x2157d2[_0x194c('0x4d')]['id']}})[_0x194c('0x26')](handleEntityNotFound(_0x4eeb6e,null))['then'](removeEntity(_0x4eeb6e,null))['catch'](handleError(_0x4eeb6e,null));};exports[_0x194c('0x4e')]=function(_0xadc571,_0x18d95f,_0x5ccc8f){var _0x269c61={};var _0x2830d3={};var _0x49e45e;var _0x179898;return db['ZendeskConfiguration'][_0x194c('0x4f')]({'where':{'id':_0xadc571['params']['id']}})[_0x194c('0x26')](handleEntityNotFound(_0x18d95f,null))[_0x194c('0x26')](function(_0x120ac5){if(_0x120ac5){_0x49e45e=_0x120ac5;_0x2830d3[_0x194c('0x33')]=_[_0x194c('0x49')](db[_0x194c('0x50')][_0x194c('0x30')]);_0x2830d3[_0x194c('0x34')]=_[_0x194c('0x49')](_0xadc571['query']);_0x2830d3['filters']=_[_0x194c('0x36')](_0x2830d3['model'],_0x2830d3[_0x194c('0x34')]);_0x269c61[_0x194c('0x37')]=_[_0x194c('0x36')](_0x2830d3['model'],qs['fields'](_0xadc571[_0x194c('0x34')]['fields']));_0x269c61[_0x194c('0x37')]=_0x269c61[_0x194c('0x37')][_0x194c('0x39')]?_0x269c61['attributes']:_0x2830d3[_0x194c('0x33')];_0x269c61[_0x194c('0x3d')]=qs[_0x194c('0x3e')](_0xadc571[_0x194c('0x34')]['sort']);_0x269c61[_0x194c('0x3f')]=qs[_0x194c('0x35')](_['pick'](_0xadc571[_0x194c('0x34')],_0x2830d3[_0x194c('0x35')]));if(_0xadc571['query']['filter']){_0x269c61[_0x194c('0x3f')]=_[_0x194c('0x42')](_0x269c61['where'],{'$or':_[_0x194c('0x2e')](_0x269c61[_0x194c('0x37')],function(_0x37bf67){var _0x2883fd={};_0x2883fd[_0x37bf67]={'$like':'%'+_0xadc571[_0x194c('0x34')][_0x194c('0x41')]+'%'};return _0x2883fd;})});}_0x269c61=_[_0x194c('0x42')]({},_0x269c61,_0xadc571[_0x194c('0x44')]);return _0x49e45e['getFields'](_0x269c61);}})['then'](function(_0x1f5a5b){if(_0x1f5a5b){_0x179898=_0x1f5a5b['length'];if(!_0xadc571['query'][_0x194c('0x3a')](_0x194c('0x3b'))){_0x269c61[_0x194c('0x1e')]=qs[_0x194c('0x1e')](_0xadc571[_0x194c('0x34')][_0x194c('0x1e')]);_0x269c61[_0x194c('0x3c')]=qs[_0x194c('0x3c')](_0xadc571[_0x194c('0x34')]['offset']);}return _0x49e45e['getFields'](_0x269c61);}})[_0x194c('0x26')](function(_0x57fa4b){if(_0x57fa4b){return _0x57fa4b?{'count':_0x179898,'rows':_0x57fa4b}:null;}})[_0x194c('0x26')](respondWithResult(_0x18d95f,null))['catch'](handleError(_0x18d95f,null));};exports[_0x194c('0x51')]=function(_0x16e6e0,_0x2186ab,_0x23e617){var _0x5c3663={};var _0x48d62b={};var _0x4ad142;var _0x7a48c4;return db['ZendeskConfiguration'][_0x194c('0x4f')]({'where':{'id':_0x16e6e0['params']['id']}})[_0x194c('0x26')](handleEntityNotFound(_0x2186ab,null))[_0x194c('0x26')](function(_0x11eeb3){if(_0x11eeb3){_0x4ad142=_0x11eeb3;_0x48d62b[_0x194c('0x33')]=_[_0x194c('0x49')](db['ZendeskField'][_0x194c('0x30')]);_0x48d62b[_0x194c('0x34')]=_[_0x194c('0x49')](_0x16e6e0['query']);_0x48d62b[_0x194c('0x35')]=_[_0x194c('0x36')](_0x48d62b[_0x194c('0x33')],_0x48d62b[_0x194c('0x34')]);_0x5c3663[_0x194c('0x37')]=_[_0x194c('0x36')](_0x48d62b[_0x194c('0x33')],qs[_0x194c('0x38')](_0x16e6e0[_0x194c('0x34')][_0x194c('0x38')]));_0x5c3663[_0x194c('0x37')]=_0x5c3663[_0x194c('0x37')][_0x194c('0x39')]?_0x5c3663[_0x194c('0x37')]:_0x48d62b['model'];_0x5c3663['order']=qs['sort'](_0x16e6e0[_0x194c('0x34')][_0x194c('0x3e')]);_0x5c3663[_0x194c('0x3f')]=qs[_0x194c('0x35')](_['pick'](_0x16e6e0[_0x194c('0x34')],_0x48d62b['filters']));if(_0x16e6e0[_0x194c('0x34')][_0x194c('0x41')]){_0x5c3663[_0x194c('0x3f')]=_['merge'](_0x5c3663['where'],{'$or':_[_0x194c('0x2e')](_0x5c3663['attributes'],function(_0x21142e){var _0x3488d7={};_0x3488d7[_0x21142e]={'$like':'%'+_0x16e6e0[_0x194c('0x34')][_0x194c('0x41')]+'%'};return _0x3488d7;})});}_0x5c3663=_[_0x194c('0x42')]({},_0x5c3663,_0x16e6e0[_0x194c('0x44')]);return _0x4ad142['getSubjects'](_0x5c3663);}})['then'](function(_0x568bc1){if(_0x568bc1){_0x7a48c4=_0x568bc1[_0x194c('0x39')];if(!_0x16e6e0['query'][_0x194c('0x3a')](_0x194c('0x3b'))){_0x5c3663[_0x194c('0x1e')]=qs['limit'](_0x16e6e0[_0x194c('0x34')]['limit']);_0x5c3663[_0x194c('0x3c')]=qs['offset'](_0x16e6e0[_0x194c('0x34')][_0x194c('0x3c')]);}return _0x4ad142[_0x194c('0x51')](_0x5c3663);}})[_0x194c('0x26')](function(_0xcea924){if(_0xcea924){return _0xcea924?{'count':_0x7a48c4,'rows':_0xcea924}:null;}})['then'](respondWithResult(_0x2186ab,null))[_0x194c('0x47')](handleError(_0x2186ab,null));};exports[_0x194c('0x52')]=function(_0x4850c2,_0x778b0f,_0x3647ea){var _0x337327={};var _0x4cde1e={};var _0x10f477;var _0x2db5d3;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x4850c2['params']['id']}})[_0x194c('0x26')](handleEntityNotFound(_0x778b0f,null))[_0x194c('0x26')](function(_0x257f4e){if(_0x257f4e){_0x10f477=_0x257f4e;_0x4cde1e['model']=_['keys'](db[_0x194c('0x50')][_0x194c('0x30')]);_0x4cde1e[_0x194c('0x34')]=_[_0x194c('0x49')](_0x4850c2[_0x194c('0x34')]);_0x4cde1e[_0x194c('0x35')]=_[_0x194c('0x36')](_0x4cde1e[_0x194c('0x33')],_0x4cde1e[_0x194c('0x34')]);_0x337327[_0x194c('0x37')]=_['intersection'](_0x4cde1e['model'],qs[_0x194c('0x38')](_0x4850c2[_0x194c('0x34')]['fields']));_0x337327[_0x194c('0x37')]=_0x337327[_0x194c('0x37')][_0x194c('0x39')]?_0x337327['attributes']:_0x4cde1e[_0x194c('0x33')];_0x337327[_0x194c('0x3d')]=qs[_0x194c('0x3e')](_0x4850c2[_0x194c('0x34')][_0x194c('0x3e')]);_0x337327[_0x194c('0x3f')]=qs[_0x194c('0x35')](_[_0x194c('0x40')](_0x4850c2[_0x194c('0x34')],_0x4cde1e[_0x194c('0x35')]));if(_0x4850c2['query']['filter']){_0x337327[_0x194c('0x3f')]=_[_0x194c('0x42')](_0x337327[_0x194c('0x3f')],{'$or':_[_0x194c('0x2e')](_0x337327[_0x194c('0x37')],function(_0x42024e){var _0x570cc8={};_0x570cc8[_0x42024e]={'$like':'%'+_0x4850c2[_0x194c('0x34')][_0x194c('0x41')]+'%'};return _0x570cc8;})});}_0x337327=_[_0x194c('0x42')]({},_0x337327,_0x4850c2[_0x194c('0x44')]);return _0x10f477[_0x194c('0x52')](_0x337327);}})[_0x194c('0x26')](function(_0x5207a2){if(_0x5207a2){_0x2db5d3=_0x5207a2[_0x194c('0x39')];if(!_0x4850c2['query'][_0x194c('0x3a')](_0x194c('0x3b'))){_0x337327[_0x194c('0x1e')]=qs[_0x194c('0x1e')](_0x4850c2[_0x194c('0x34')][_0x194c('0x1e')]);_0x337327[_0x194c('0x3c')]=qs[_0x194c('0x3c')](_0x4850c2[_0x194c('0x34')]['offset']);}return _0x10f477[_0x194c('0x52')](_0x337327);}})['then'](function(_0x5aa534){if(_0x5aa534){return _0x5aa534?{'count':_0x2db5d3,'rows':_0x5aa534}:null;}})[_0x194c('0x26')](respondWithResult(_0x778b0f,null))[_0x194c('0x47')](handleError(_0x778b0f,null));};exports[_0x194c('0x53')]=function(_0xd67071,_0x4e0d8b,_0x19bfbd){var _0x18f8d0={};var _0x2ce3bc={};var _0x294701;var _0x505ad2;return db[_0x194c('0x2f')][_0x194c('0x4f')]({'where':{'id':_0xd67071[_0x194c('0x4d')]['id']}})[_0x194c('0x26')](handleEntityNotFound(_0x4e0d8b,null))[_0x194c('0x26')](function(_0x38163f){if(_0x38163f){_0x294701=_0x38163f;_0x2ce3bc[_0x194c('0x33')]=_['keys'](db[_0x194c('0x54')][_0x194c('0x30')]);_0x2ce3bc[_0x194c('0x34')]=_[_0x194c('0x49')](_0xd67071[_0x194c('0x34')]);_0x2ce3bc[_0x194c('0x35')]=_[_0x194c('0x36')](_0x2ce3bc['model'],_0x2ce3bc[_0x194c('0x34')]);_0x18f8d0['attributes']=_[_0x194c('0x36')](_0x2ce3bc[_0x194c('0x33')],qs[_0x194c('0x38')](_0xd67071['query'][_0x194c('0x38')]));_0x18f8d0[_0x194c('0x37')]=_0x18f8d0['attributes'][_0x194c('0x39')]?_0x18f8d0[_0x194c('0x37')]:_0x2ce3bc['model'];_0x18f8d0['order']=qs[_0x194c('0x3e')](_0xd67071['query'][_0x194c('0x3e')]);_0x18f8d0[_0x194c('0x3f')]=qs[_0x194c('0x35')](_[_0x194c('0x40')](_0xd67071[_0x194c('0x34')],_0x2ce3bc[_0x194c('0x35')]));if(_0xd67071[_0x194c('0x34')]['filter']){_0x18f8d0['where']=_[_0x194c('0x42')](_0x18f8d0[_0x194c('0x3f')],{'$or':_[_0x194c('0x2e')](_0x18f8d0['attributes'],function(_0x4a4c6e){var _0x16a228={};_0x16a228[_0x4a4c6e]={'$like':'%'+_0xd67071[_0x194c('0x34')]['filter']+'%'};return _0x16a228;})});}_0x18f8d0=_[_0x194c('0x42')]({},_0x18f8d0,_0xd67071[_0x194c('0x44')]);return _0x294701[_0x194c('0x53')](_0x18f8d0);}})[_0x194c('0x26')](function(_0x48761c){if(_0x48761c){_0x505ad2=_0x48761c['length'];if(!_0xd67071[_0x194c('0x34')][_0x194c('0x3a')](_0x194c('0x3b'))){_0x18f8d0['limit']=qs[_0x194c('0x1e')](_0xd67071[_0x194c('0x34')][_0x194c('0x1e')]);_0x18f8d0[_0x194c('0x3c')]=qs[_0x194c('0x3c')](_0xd67071[_0x194c('0x34')]['offset']);}return _0x294701[_0x194c('0x53')](_0x18f8d0);}})[_0x194c('0x26')](function(_0x2c0c2b){if(_0x2c0c2b){return _0x2c0c2b?{'count':_0x505ad2,'rows':_0x2c0c2b}:null;}})['then'](respondWithResult(_0x4e0d8b,null))[_0x194c('0x47')](handleError(_0x4e0d8b,null));};exports[_0x194c('0x55')]=function(_0x19a68e,_0x2fbaa8,_0x1cd419){if(_0x19a68e[_0x194c('0x4c')]['id']){delete _0x19a68e['body']['id'];}return db[_0x194c('0x2f')]['findOne']({'where':{'id':_0x19a68e[_0x194c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2fbaa8,null))[_0x194c('0x26')](function(_0x45b9ea){if(_0x45b9ea){return _0x45b9ea[_0x194c('0x55')](_0x19a68e[_0x194c('0x4c')][_0x194c('0x56')]||[]);}return null;})['then'](respondWithResult(_0x2fbaa8,null))['catch'](handleError(_0x2fbaa8,null));};
\ No newline at end of file
+var _0x72b4=['fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','include','rows','catch','show','keys','rawAttributes','find','create','body','params','getFields','findOne','merge','getSubjects','ZendeskField','getDescriptions','Tag','getTags','setTags','ids','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','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','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','index','map','ZendeskConfiguration'];(function(_0x307b78,_0x4ce9d0){var _0x4fd7ca=function(_0x4405ab){while(--_0x4405ab){_0x307b78['push'](_0x307b78['shift']());}};_0x4fd7ca(++_0x4ce9d0);}(_0x72b4,0x173));var _0x472b=function(_0x27a9cc,_0x1b1b55){_0x27a9cc=_0x27a9cc-0x0;var _0x412f06=_0x72b4[_0x27a9cc];return _0x412f06;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x472b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x472b('0x1'));var rp=require(_0x472b('0x2'));var moment=require(_0x472b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x472b('0x4'));var util=require('util');var path=require(_0x472b('0x5'));var sox=require(_0x472b('0x6'));var csv=require(_0x472b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x472b('0x8'));var _=require('lodash');var squel=require(_0x472b('0x9'));var crypto=require('crypto');var jsforce=require(_0x472b('0xa'));var deskjs=require(_0x472b('0xb'));var toCsv=require(_0x472b('0x7'));var querystring=require(_0x472b('0xc'));var Papa=require(_0x472b('0xd'));var Redis=require(_0x472b('0xe'));var authService=require(_0x472b('0xf'));var qs=require(_0x472b('0x10'));var as=require(_0x472b('0x11'));var hardwareService=require(_0x472b('0x12'));var logger=require(_0x472b('0x13'))(_0x472b('0x14'));var utils=require(_0x472b('0x15'));var config=require(_0x472b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x472b('0x17'))['db'];function respondWithStatusCode(_0x81ee33,_0x29ef6b){_0x29ef6b=_0x29ef6b||0xcc;return function(_0x191e20){if(_0x191e20){return _0x81ee33[_0x472b('0x18')](_0x29ef6b);}return _0x81ee33[_0x472b('0x19')](_0x29ef6b)['end']();};}function respondWithResult(_0x3fe7f7,_0x3cd72a){_0x3cd72a=_0x3cd72a||0xc8;return function(_0x3015f2){if(_0x3015f2){return _0x3fe7f7['status'](_0x3cd72a)[_0x472b('0x1a')](_0x3015f2);}};}function respondWithFilteredResult(_0x32fab4,_0x39f279){return function(_0x21efd5){if(_0x21efd5){var _0x3f804b=typeof _0x39f279[_0x472b('0x1b')]===_0x472b('0x1c')&&typeof _0x39f279[_0x472b('0x1d')]===_0x472b('0x1c');var _0x3d3d87=_0x21efd5[_0x472b('0x1e')];var _0x535cdf=_0x3f804b?0x0:_0x39f279['offset'];var _0x12617b=_0x3f804b?_0x21efd5[_0x472b('0x1e')]:_0x39f279['offset']+_0x39f279['limit'];var _0x34963b;if(_0x12617b>=_0x3d3d87){_0x12617b=_0x3d3d87;_0x34963b=0xc8;}else{_0x34963b=0xce;}_0x32fab4['status'](_0x34963b);return _0x32fab4['set'](_0x472b('0x1f'),_0x535cdf+'-'+_0x12617b+'/'+_0x3d3d87)[_0x472b('0x1a')](_0x21efd5);}return null;};}function patchUpdates(_0x4acdae){return function(_0xffec9d){try{jsonpatch[_0x472b('0x20')](_0xffec9d,_0x4acdae,!![]);}catch(_0x4ea7f8){return BPromise[_0x472b('0x21')](_0x4ea7f8);}return _0xffec9d['save']();};}function saveUpdates(_0x548d76,_0x267158){return function(_0x4e8d70){if(_0x4e8d70){return _0x4e8d70[_0x472b('0x22')](_0x548d76)[_0x472b('0x23')](function(_0x3e929d){return _0x3e929d;});}return null;};}function removeEntity(_0x34d32b,_0x5c1c31){return function(_0xcd2c7c){if(_0xcd2c7c){return _0xcd2c7c[_0x472b('0x24')]()[_0x472b('0x23')](function(){_0x34d32b[_0x472b('0x19')](0xcc)[_0x472b('0x25')]();});}};}function handleEntityNotFound(_0x17f179,_0x22e871){return function(_0x26997e){if(!_0x26997e){_0x17f179[_0x472b('0x18')](0x194);}return _0x26997e;};}function handleError(_0x3b12e9,_0x29d29a){_0x29d29a=_0x29d29a||0x1f4;return function(_0xc216d1){logger['error'](_0xc216d1[_0x472b('0x26')]);if(_0xc216d1[_0x472b('0x27')]){delete _0xc216d1['name'];}_0x3b12e9[_0x472b('0x19')](_0x29d29a)[_0x472b('0x28')](_0xc216d1);};}exports[_0x472b('0x29')]=function(_0x12d0cb,_0x5cfcfd){var _0x4b7604={},_0x373ab1={},_0x24d1dd={'count':0x0,'rows':[]};var _0x155996=_[_0x472b('0x2a')](db[_0x472b('0x2b')]['rawAttributes'],function(_0x2bd8a8){return{'name':_0x2bd8a8[_0x472b('0x2c')],'type':_0x2bd8a8['type'][_0x472b('0x2d')]};});_0x373ab1[_0x472b('0x2e')]=_[_0x472b('0x2a')](_0x155996,_0x472b('0x27'));_0x373ab1[_0x472b('0x2f')]=_['keys'](_0x12d0cb[_0x472b('0x2f')]);_0x373ab1[_0x472b('0x30')]=_[_0x472b('0x31')](_0x373ab1['model'],_0x373ab1[_0x472b('0x2f')]);_0x4b7604[_0x472b('0x32')]=_['intersection'](_0x373ab1['model'],qs[_0x472b('0x33')](_0x12d0cb[_0x472b('0x2f')][_0x472b('0x33')]));_0x4b7604[_0x472b('0x32')]=_0x4b7604['attributes'][_0x472b('0x34')]?_0x4b7604[_0x472b('0x32')]:_0x373ab1[_0x472b('0x2e')];if(!_0x12d0cb['query'][_0x472b('0x35')](_0x472b('0x36'))){_0x4b7604[_0x472b('0x1d')]=qs['limit'](_0x12d0cb[_0x472b('0x2f')][_0x472b('0x1d')]);_0x4b7604['offset']=qs[_0x472b('0x1b')](_0x12d0cb[_0x472b('0x2f')][_0x472b('0x1b')]);}_0x4b7604[_0x472b('0x37')]=qs[_0x472b('0x38')](_0x12d0cb[_0x472b('0x2f')]['sort']);_0x4b7604[_0x472b('0x39')]=qs['filters'](_[_0x472b('0x3a')](_0x12d0cb['query'],_0x373ab1[_0x472b('0x30')]),_0x155996);if(_0x12d0cb['query'][_0x472b('0x3b')]){_0x4b7604[_0x472b('0x39')]=_['merge'](_0x4b7604[_0x472b('0x39')],{'$or':_[_0x472b('0x2a')](_0x155996,function(_0x142ddd){if(_0x142ddd[_0x472b('0x3c')]!==_0x472b('0x3d')){var _0x5de85e={};_0x5de85e[_0x142ddd['name']]={'$like':'%'+_0x12d0cb[_0x472b('0x2f')][_0x472b('0x3b')]+'%'};return _0x5de85e;}})});}_0x4b7604=_['merge']({},_0x4b7604,_0x12d0cb[_0x472b('0x3e')]);var _0x312634={'where':_0x4b7604[_0x472b('0x39')]};return db[_0x472b('0x2b')][_0x472b('0x1e')](_0x312634)['then'](function(_0x3f0755){_0x24d1dd[_0x472b('0x1e')]=_0x3f0755;if(_0x12d0cb[_0x472b('0x2f')]['includeAll']){_0x4b7604[_0x472b('0x3f')]=[{'all':!![]}];}return db[_0x472b('0x2b')]['findAll'](_0x4b7604);})[_0x472b('0x23')](function(_0x37eadf){_0x24d1dd[_0x472b('0x40')]=_0x37eadf;return _0x24d1dd;})['then'](respondWithFilteredResult(_0x5cfcfd,_0x4b7604))[_0x472b('0x41')](handleError(_0x5cfcfd,null));};exports[_0x472b('0x42')]=function(_0x1097e4,_0x4c1a8f){var _0x230d3b={'raw':![],'where':{'id':_0x1097e4['params']['id']}},_0x35593e={};_0x35593e[_0x472b('0x2e')]=_[_0x472b('0x43')](db[_0x472b('0x2b')][_0x472b('0x44')]);_0x35593e[_0x472b('0x2f')]=_[_0x472b('0x43')](_0x1097e4['query']);_0x35593e['filters']=_['intersection'](_0x35593e[_0x472b('0x2e')],_0x35593e[_0x472b('0x2f')]);_0x230d3b[_0x472b('0x32')]=_[_0x472b('0x31')](_0x35593e[_0x472b('0x2e')],qs[_0x472b('0x33')](_0x1097e4[_0x472b('0x2f')]['fields']));_0x230d3b['attributes']=_0x230d3b[_0x472b('0x32')]['length']?_0x230d3b['attributes']:_0x35593e[_0x472b('0x2e')];if(_0x1097e4['query']['includeAll']){_0x230d3b[_0x472b('0x3f')]=[{'all':!![]}];}_0x230d3b=_['merge']({},_0x230d3b,_0x1097e4['options']);return db[_0x472b('0x2b')][_0x472b('0x45')](_0x230d3b)[_0x472b('0x23')](handleEntityNotFound(_0x4c1a8f,null))[_0x472b('0x23')](respondWithResult(_0x4c1a8f,null))['catch'](handleError(_0x4c1a8f,null));};exports[_0x472b('0x46')]=function(_0x23aac4,_0x326959){return db[_0x472b('0x2b')][_0x472b('0x46')](_0x23aac4[_0x472b('0x47')],{})['then'](respondWithResult(_0x326959,0xc9))[_0x472b('0x41')](handleError(_0x326959,null));};exports['update']=function(_0x3e9fd8,_0x5affc8){if(_0x3e9fd8[_0x472b('0x47')]['id']){delete _0x3e9fd8[_0x472b('0x47')]['id'];}return db[_0x472b('0x2b')][_0x472b('0x45')]({'where':{'id':_0x3e9fd8[_0x472b('0x48')]['id']}})['then'](handleEntityNotFound(_0x5affc8,null))['then'](saveUpdates(_0x3e9fd8[_0x472b('0x47')],null))[_0x472b('0x23')](respondWithResult(_0x5affc8,null))['catch'](handleError(_0x5affc8,null));};exports[_0x472b('0x24')]=function(_0x585d23,_0xa684d3){return db[_0x472b('0x2b')][_0x472b('0x45')]({'where':{'id':_0x585d23[_0x472b('0x48')]['id']}})[_0x472b('0x23')](handleEntityNotFound(_0xa684d3,null))['then'](removeEntity(_0xa684d3,null))[_0x472b('0x41')](handleError(_0xa684d3,null));};exports[_0x472b('0x49')]=function(_0x4a4aca,_0x2826a4,_0x3fdf56){var _0x30504a={};var _0x16fd63={};var _0x8e47e;var _0x562722;return db['ZendeskConfiguration'][_0x472b('0x4a')]({'where':{'id':_0x4a4aca[_0x472b('0x48')]['id']}})[_0x472b('0x23')](handleEntityNotFound(_0x2826a4,null))[_0x472b('0x23')](function(_0x1a083e){if(_0x1a083e){_0x8e47e=_0x1a083e;_0x16fd63['model']=_[_0x472b('0x43')](db['ZendeskField'][_0x472b('0x44')]);_0x16fd63['query']=_[_0x472b('0x43')](_0x4a4aca[_0x472b('0x2f')]);_0x16fd63[_0x472b('0x30')]=_['intersection'](_0x16fd63[_0x472b('0x2e')],_0x16fd63[_0x472b('0x2f')]);_0x30504a[_0x472b('0x32')]=_['intersection'](_0x16fd63[_0x472b('0x2e')],qs[_0x472b('0x33')](_0x4a4aca['query']['fields']));_0x30504a[_0x472b('0x32')]=_0x30504a[_0x472b('0x32')][_0x472b('0x34')]?_0x30504a[_0x472b('0x32')]:_0x16fd63['model'];_0x30504a[_0x472b('0x37')]=qs[_0x472b('0x38')](_0x4a4aca['query'][_0x472b('0x38')]);_0x30504a[_0x472b('0x39')]=qs[_0x472b('0x30')](_[_0x472b('0x3a')](_0x4a4aca[_0x472b('0x2f')],_0x16fd63[_0x472b('0x30')]));if(_0x4a4aca[_0x472b('0x2f')][_0x472b('0x3b')]){_0x30504a[_0x472b('0x39')]=_[_0x472b('0x4b')](_0x30504a[_0x472b('0x39')],{'$or':_[_0x472b('0x2a')](_0x30504a[_0x472b('0x32')],function(_0x5ade02){var _0x29f59e={};_0x29f59e[_0x5ade02]={'$like':'%'+_0x4a4aca['query'][_0x472b('0x3b')]+'%'};return _0x29f59e;})});}_0x30504a=_[_0x472b('0x4b')]({},_0x30504a,_0x4a4aca[_0x472b('0x3e')]);return _0x8e47e[_0x472b('0x49')](_0x30504a);}})[_0x472b('0x23')](function(_0x5dd06a){if(_0x5dd06a){_0x562722=_0x5dd06a[_0x472b('0x34')];if(!_0x4a4aca[_0x472b('0x2f')][_0x472b('0x35')](_0x472b('0x36'))){_0x30504a[_0x472b('0x1d')]=qs[_0x472b('0x1d')](_0x4a4aca[_0x472b('0x2f')][_0x472b('0x1d')]);_0x30504a[_0x472b('0x1b')]=qs[_0x472b('0x1b')](_0x4a4aca[_0x472b('0x2f')]['offset']);}return _0x8e47e[_0x472b('0x49')](_0x30504a);}})['then'](function(_0x8d7dae){if(_0x8d7dae){return _0x8d7dae?{'count':_0x562722,'rows':_0x8d7dae}:null;}})[_0x472b('0x23')](respondWithResult(_0x2826a4,null))[_0x472b('0x41')](handleError(_0x2826a4,null));};exports[_0x472b('0x4c')]=function(_0x5e0eb6,_0x320f08,_0x2fc5de){var _0x33ea80={};var _0x5b59d0={};var _0xcf60a4;var _0x1aefee;return db[_0x472b('0x2b')][_0x472b('0x4a')]({'where':{'id':_0x5e0eb6[_0x472b('0x48')]['id']}})[_0x472b('0x23')](handleEntityNotFound(_0x320f08,null))[_0x472b('0x23')](function(_0x173c50){if(_0x173c50){_0xcf60a4=_0x173c50;_0x5b59d0[_0x472b('0x2e')]=_[_0x472b('0x43')](db[_0x472b('0x4d')][_0x472b('0x44')]);_0x5b59d0[_0x472b('0x2f')]=_[_0x472b('0x43')](_0x5e0eb6[_0x472b('0x2f')]);_0x5b59d0['filters']=_[_0x472b('0x31')](_0x5b59d0[_0x472b('0x2e')],_0x5b59d0[_0x472b('0x2f')]);_0x33ea80[_0x472b('0x32')]=_[_0x472b('0x31')](_0x5b59d0[_0x472b('0x2e')],qs[_0x472b('0x33')](_0x5e0eb6[_0x472b('0x2f')][_0x472b('0x33')]));_0x33ea80[_0x472b('0x32')]=_0x33ea80[_0x472b('0x32')][_0x472b('0x34')]?_0x33ea80['attributes']:_0x5b59d0[_0x472b('0x2e')];_0x33ea80[_0x472b('0x37')]=qs[_0x472b('0x38')](_0x5e0eb6[_0x472b('0x2f')][_0x472b('0x38')]);_0x33ea80[_0x472b('0x39')]=qs[_0x472b('0x30')](_[_0x472b('0x3a')](_0x5e0eb6['query'],_0x5b59d0[_0x472b('0x30')]));if(_0x5e0eb6[_0x472b('0x2f')][_0x472b('0x3b')]){_0x33ea80[_0x472b('0x39')]=_[_0x472b('0x4b')](_0x33ea80[_0x472b('0x39')],{'$or':_[_0x472b('0x2a')](_0x33ea80[_0x472b('0x32')],function(_0x2440f2){var _0x2b2a65={};_0x2b2a65[_0x2440f2]={'$like':'%'+_0x5e0eb6[_0x472b('0x2f')][_0x472b('0x3b')]+'%'};return _0x2b2a65;})});}_0x33ea80=_[_0x472b('0x4b')]({},_0x33ea80,_0x5e0eb6[_0x472b('0x3e')]);return _0xcf60a4[_0x472b('0x4c')](_0x33ea80);}})[_0x472b('0x23')](function(_0x3a20b4){if(_0x3a20b4){_0x1aefee=_0x3a20b4[_0x472b('0x34')];if(!_0x5e0eb6[_0x472b('0x2f')][_0x472b('0x35')]('nolimit')){_0x33ea80['limit']=qs[_0x472b('0x1d')](_0x5e0eb6[_0x472b('0x2f')]['limit']);_0x33ea80[_0x472b('0x1b')]=qs[_0x472b('0x1b')](_0x5e0eb6[_0x472b('0x2f')][_0x472b('0x1b')]);}return _0xcf60a4[_0x472b('0x4c')](_0x33ea80);}})[_0x472b('0x23')](function(_0x4b924b){if(_0x4b924b){return _0x4b924b?{'count':_0x1aefee,'rows':_0x4b924b}:null;}})[_0x472b('0x23')](respondWithResult(_0x320f08,null))['catch'](handleError(_0x320f08,null));};exports[_0x472b('0x4e')]=function(_0x52209e,_0x23dff2,_0x5cd83f){var _0x425783={};var _0x4dfd5b={};var _0x35e7a8;var _0x1578c5;return db[_0x472b('0x2b')][_0x472b('0x4a')]({'where':{'id':_0x52209e['params']['id']}})[_0x472b('0x23')](handleEntityNotFound(_0x23dff2,null))[_0x472b('0x23')](function(_0x19878d){if(_0x19878d){_0x35e7a8=_0x19878d;_0x4dfd5b['model']=_[_0x472b('0x43')](db[_0x472b('0x4d')]['rawAttributes']);_0x4dfd5b[_0x472b('0x2f')]=_[_0x472b('0x43')](_0x52209e[_0x472b('0x2f')]);_0x4dfd5b[_0x472b('0x30')]=_[_0x472b('0x31')](_0x4dfd5b[_0x472b('0x2e')],_0x4dfd5b['query']);_0x425783[_0x472b('0x32')]=_[_0x472b('0x31')](_0x4dfd5b[_0x472b('0x2e')],qs[_0x472b('0x33')](_0x52209e[_0x472b('0x2f')][_0x472b('0x33')]));_0x425783['attributes']=_0x425783[_0x472b('0x32')][_0x472b('0x34')]?_0x425783[_0x472b('0x32')]:_0x4dfd5b[_0x472b('0x2e')];_0x425783[_0x472b('0x37')]=qs[_0x472b('0x38')](_0x52209e[_0x472b('0x2f')][_0x472b('0x38')]);_0x425783['where']=qs[_0x472b('0x30')](_[_0x472b('0x3a')](_0x52209e[_0x472b('0x2f')],_0x4dfd5b[_0x472b('0x30')]));if(_0x52209e[_0x472b('0x2f')][_0x472b('0x3b')]){_0x425783[_0x472b('0x39')]=_['merge'](_0x425783[_0x472b('0x39')],{'$or':_[_0x472b('0x2a')](_0x425783['attributes'],function(_0x339d72){var _0x3a865c={};_0x3a865c[_0x339d72]={'$like':'%'+_0x52209e[_0x472b('0x2f')][_0x472b('0x3b')]+'%'};return _0x3a865c;})});}_0x425783=_['merge']({},_0x425783,_0x52209e['options']);return _0x35e7a8[_0x472b('0x4e')](_0x425783);}})['then'](function(_0x50d4e1){if(_0x50d4e1){_0x1578c5=_0x50d4e1['length'];if(!_0x52209e[_0x472b('0x2f')][_0x472b('0x35')]('nolimit')){_0x425783[_0x472b('0x1d')]=qs[_0x472b('0x1d')](_0x52209e['query'][_0x472b('0x1d')]);_0x425783['offset']=qs[_0x472b('0x1b')](_0x52209e[_0x472b('0x2f')]['offset']);}return _0x35e7a8[_0x472b('0x4e')](_0x425783);}})[_0x472b('0x23')](function(_0x446ef9){if(_0x446ef9){return _0x446ef9?{'count':_0x1578c5,'rows':_0x446ef9}:null;}})[_0x472b('0x23')](respondWithResult(_0x23dff2,null))['catch'](handleError(_0x23dff2,null));};exports['getTags']=function(_0x27a2fb,_0x46bfa4,_0x478722){var _0x43bf79={};var _0x323e06={};var _0x1d670a;var _0xfd085;return db[_0x472b('0x2b')][_0x472b('0x4a')]({'where':{'id':_0x27a2fb[_0x472b('0x48')]['id']}})[_0x472b('0x23')](handleEntityNotFound(_0x46bfa4,null))[_0x472b('0x23')](function(_0x1c694a){if(_0x1c694a){_0x1d670a=_0x1c694a;_0x323e06[_0x472b('0x2e')]=_['keys'](db[_0x472b('0x4f')][_0x472b('0x44')]);_0x323e06[_0x472b('0x2f')]=_[_0x472b('0x43')](_0x27a2fb[_0x472b('0x2f')]);_0x323e06[_0x472b('0x30')]=_[_0x472b('0x31')](_0x323e06['model'],_0x323e06[_0x472b('0x2f')]);_0x43bf79[_0x472b('0x32')]=_['intersection'](_0x323e06[_0x472b('0x2e')],qs[_0x472b('0x33')](_0x27a2fb[_0x472b('0x2f')][_0x472b('0x33')]));_0x43bf79[_0x472b('0x32')]=_0x43bf79[_0x472b('0x32')][_0x472b('0x34')]?_0x43bf79[_0x472b('0x32')]:_0x323e06['model'];_0x43bf79[_0x472b('0x37')]=qs['sort'](_0x27a2fb[_0x472b('0x2f')][_0x472b('0x38')]);_0x43bf79[_0x472b('0x39')]=qs[_0x472b('0x30')](_[_0x472b('0x3a')](_0x27a2fb[_0x472b('0x2f')],_0x323e06[_0x472b('0x30')]));if(_0x27a2fb[_0x472b('0x2f')][_0x472b('0x3b')]){_0x43bf79[_0x472b('0x39')]=_['merge'](_0x43bf79[_0x472b('0x39')],{'$or':_[_0x472b('0x2a')](_0x43bf79[_0x472b('0x32')],function(_0x1a1f04){var _0x1c2779={};_0x1c2779[_0x1a1f04]={'$like':'%'+_0x27a2fb[_0x472b('0x2f')][_0x472b('0x3b')]+'%'};return _0x1c2779;})});}_0x43bf79=_[_0x472b('0x4b')]({},_0x43bf79,_0x27a2fb[_0x472b('0x3e')]);return _0x1d670a[_0x472b('0x50')](_0x43bf79);}})[_0x472b('0x23')](function(_0x472adc){if(_0x472adc){_0xfd085=_0x472adc[_0x472b('0x34')];if(!_0x27a2fb[_0x472b('0x2f')]['hasOwnProperty'](_0x472b('0x36'))){_0x43bf79[_0x472b('0x1d')]=qs[_0x472b('0x1d')](_0x27a2fb['query']['limit']);_0x43bf79[_0x472b('0x1b')]=qs[_0x472b('0x1b')](_0x27a2fb[_0x472b('0x2f')][_0x472b('0x1b')]);}return _0x1d670a['getTags'](_0x43bf79);}})[_0x472b('0x23')](function(_0x26c858){if(_0x26c858){return _0x26c858?{'count':_0xfd085,'rows':_0x26c858}:null;}})[_0x472b('0x23')](respondWithResult(_0x46bfa4,null))[_0x472b('0x41')](handleError(_0x46bfa4,null));};exports[_0x472b('0x51')]=function(_0x126e85,_0x4f1057,_0x55e431){if(_0x126e85[_0x472b('0x47')]['id']){delete _0x126e85[_0x472b('0x47')]['id'];}return db[_0x472b('0x2b')][_0x472b('0x4a')]({'where':{'id':_0x126e85[_0x472b('0x48')]['id']}})[_0x472b('0x23')](handleEntityNotFound(_0x4f1057,null))[_0x472b('0x23')](function(_0x4efb92){if(_0x4efb92){return _0x4efb92[_0x472b('0x51')](_0x126e85[_0x472b('0x47')][_0x472b('0x52')]||[]);}return null;})[_0x472b('0x23')](respondWithResult(_0x4f1057,null))['catch'](handleError(_0x4f1057,null));};
\ No newline at end of file
index 9dba9ba..ac3e81f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a95=['bluebird','request-promise','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','lodash','util','../../config/logger','api','moment'];(function(_0x259e09,_0x43dc8e){var _0x221f0f=function(_0xc75af){while(--_0xc75af){_0x259e09['push'](_0x259e09['shift']());}};_0x221f0f(++_0x43dc8e);}(_0x6a95,0x1db));var _0x56a9=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x6a95[_0x40bffc];return _0x3007e9;};'use strict';var _=require(_0x56a9('0x0'));var util=require(_0x56a9('0x1'));var logger=require(_0x56a9('0x2'))(_0x56a9('0x3'));var moment=require(_0x56a9('0x4'));var BPromise=require(_0x56a9('0x5'));var rp=require(_0x56a9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x56a9('0x7'));var attributes=require(_0x56a9('0x8'));module[_0x56a9('0x9')]=function(_0x2eb132,_0x3c15b6){return _0x2eb132[_0x56a9('0xa')](_0x56a9('0xb'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x351d=['../../config/environment','exports','ZendeskConfiguration','int_zendesk_configurations','lodash','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x25cf2e,_0x46ab77){var _0x349fe4=function(_0x159134){while(--_0x159134){_0x25cf2e['push'](_0x25cf2e['shift']());}};_0x349fe4(++_0x46ab77);}(_0x351d,0x90));var _0xd351=function(_0x188fab,_0x3736df){_0x188fab=_0x188fab-0x0;var _0x52ae60=_0x351d[_0x188fab];return _0x52ae60;};'use strict';var _=require(_0xd351('0x0'));var util=require('util');var logger=require(_0xd351('0x1'))(_0xd351('0x2'));var moment=require(_0xd351('0x3'));var BPromise=require('bluebird');var rp=require(_0xd351('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd351('0x5'));var config=require(_0xd351('0x6'));var attributes=require('./intZendeskConfiguration.attributes');module[_0xd351('0x7')]=function(_0x45e9e5,_0x88bd2b){return _0x45e9e5['define'](_0xd351('0x8'),attributes,{'tableName':_0xd351('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 195387d..924bf47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x960f=['code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x58ced6,_0x329875){var _0x1b613a=function(_0x4d6f67){while(--_0x4d6f67){_0x58ced6['push'](_0x58ced6['shift']());}};_0x1b613a(++_0x329875);}(_0x960f,0x64));var _0xf960=function(_0x388b47,_0x5cdac5){_0x388b47=_0x388b47-0x0;var _0x4859df=_0x960f[_0x388b47];return _0x4859df;};'use strict';var _=require(_0xf960('0x0'));var util=require(_0xf960('0x1'));var moment=require(_0xf960('0x2'));var BPromise=require(_0xf960('0x3'));var rs=require(_0xf960('0x4'));var fs=require('fs');var Redis=require(_0xf960('0x5'));var db=require(_0xf960('0x6'))['db'];var utils=require(_0xf960('0x7'));var logger=require(_0xf960('0x8'))(_0xf960('0x9'));var config=require(_0xf960('0xa'));var jayson=require(_0xf960('0xb'));var client=jayson[_0xf960('0xc')][_0xf960('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5df453,_0x5040ff,_0x21fdc8){return new BPromise(function(_0x1b62b9,_0x91b887){return client[_0xf960('0xe')](_0x5df453,_0x21fdc8)[_0xf960('0xf')](function(_0x9babf2){logger['info'](_0xf960('0x10'),_0x5040ff,_0xf960('0x11'));logger[_0xf960('0x12')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5040ff,'request\x20sent',JSON['stringify'](_0x9babf2));if(_0x9babf2[_0xf960('0x13')]){if(_0x9babf2[_0xf960('0x13')][_0xf960('0x14')]===0x1f4){logger[_0xf960('0x13')](_0xf960('0x10'),_0x5040ff,_0x9babf2['error'][_0xf960('0x15')]);return _0x91b887(_0x9babf2[_0xf960('0x13')][_0xf960('0x15')]);}logger[_0xf960('0x13')](_0xf960('0x10'),_0x5040ff,_0x9babf2[_0xf960('0x13')][_0xf960('0x15')]);return _0x1b62b9(_0x9babf2['error'][_0xf960('0x15')]);}else{logger[_0xf960('0x16')](_0xf960('0x10'),_0x5040ff,'request\x20sent');_0x1b62b9(_0x9babf2[_0xf960('0x17')][_0xf960('0x15')]);}})['catch'](function(_0x113b35){logger[_0xf960('0x13')](_0xf960('0x10'),_0x5040ff,_0x113b35);_0x91b887(_0x113b35);});});}
\ No newline at end of file
+var _0x641e=['ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xaf0e1e,_0x35d918){var _0xd25ff4=function(_0x250b24){while(--_0x250b24){_0xaf0e1e['push'](_0xaf0e1e['shift']());}};_0xd25ff4(++_0x35d918);}(_0x641e,0x97));var _0xe641=function(_0x317257,_0x1677dc){_0x317257=_0x317257-0x0;var _0x1f235d=_0x641e[_0x317257];return _0x1f235d;};'use strict';var _=require(_0xe641('0x0'));var util=require('util');var moment=require(_0xe641('0x1'));var BPromise=require(_0xe641('0x2'));var rs=require(_0xe641('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe641('0x4'));var logger=require(_0xe641('0x5'))(_0xe641('0x6'));var config=require(_0xe641('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe641('0x8')][_0xe641('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x368d14,_0x403877,_0x586dee){return new BPromise(function(_0x40491b,_0x3d57c3){return client['request'](_0x368d14,_0x586dee)[_0xe641('0xa')](function(_0x56aa6d){logger[_0xe641('0xb')]('ZendeskConfiguration,\x20%s,\x20%s',_0x403877,_0xe641('0xc'));logger[_0xe641('0xd')](_0xe641('0xe'),_0x403877,_0xe641('0xc'),JSON[_0xe641('0xf')](_0x56aa6d));if(_0x56aa6d['error']){if(_0x56aa6d[_0xe641('0x10')]['code']===0x1f4){logger[_0xe641('0x10')](_0xe641('0x11'),_0x403877,_0x56aa6d[_0xe641('0x10')][_0xe641('0x12')]);return _0x3d57c3(_0x56aa6d['error']['message']);}logger['error'](_0xe641('0x11'),_0x403877,_0x56aa6d[_0xe641('0x10')][_0xe641('0x12')]);return _0x40491b(_0x56aa6d[_0xe641('0x10')]['message']);}else{logger[_0xe641('0xb')](_0xe641('0x11'),_0x403877,'request\x20sent');_0x40491b(_0x56aa6d[_0xe641('0x13')][_0xe641('0x12')]);}})[_0xe641('0x14')](function(_0x121116){logger['error'](_0xe641('0x11'),_0x403877,_0x121116);_0x3d57c3(_0x121116);});});}
\ No newline at end of file
index 2ddafa0..5af596e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fbb=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','multer'];(function(_0x2cad67,_0x30a165){var _0x557943=function(_0x1f677b){while(--_0x1f677b){_0x2cad67['push'](_0x2cad67['shift']());}};_0x557943(++_0x30a165);}(_0x0fbb,0x125));var _0xb0fb=function(_0x474391,_0x40de11){_0x474391=_0x474391-0x0;var _0x3e292f=_0x0fbb[_0x474391];return _0x3e292f;};'use strict';var multer=require(_0xb0fb('0x0'));var util=require(_0xb0fb('0x1'));var path=require(_0xb0fb('0x2'));var timeout=require(_0xb0fb('0x3'));var express=require(_0xb0fb('0x4'));var router=express[_0xb0fb('0x5')]();var fs_extra=require(_0xb0fb('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xb0fb('0x7'));var config=require(_0xb0fb('0x8'));var controller=require(_0xb0fb('0x9'));router[_0xb0fb('0xa')]('/',auth['isAuthenticated'](),controller[_0xb0fb('0xb')]);router[_0xb0fb('0xa')](_0xb0fb('0xc'),auth[_0xb0fb('0xd')](),controller[_0xb0fb('0xe')]);router[_0xb0fb('0xf')]('/',auth['isAuthenticated'](),controller[_0xb0fb('0x10')]);router[_0xb0fb('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xb0fb('0x12')]);router[_0xb0fb('0x13')](_0xb0fb('0xc'),auth[_0xb0fb('0xd')](),controller[_0xb0fb('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x1e3d=['destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete'];(function(_0x1e60fa,_0x611d6d){var _0x59a8ee=function(_0xdc465a){while(--_0xdc465a){_0x1e60fa['push'](_0x1e60fa['shift']());}};_0x59a8ee(++_0x611d6d);}(_0x1e3d,0x11e));var _0xd1e3=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x1e3d[_0x2261ce];return _0x524640;};'use strict';var multer=require('multer');var util=require(_0xd1e3('0x0'));var path=require(_0xd1e3('0x1'));var timeout=require(_0xd1e3('0x2'));var express=require(_0xd1e3('0x3'));var router=express[_0xd1e3('0x4')]();var fs_extra=require(_0xd1e3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd1e3('0x6'));var config=require(_0xd1e3('0x7'));var controller=require(_0xd1e3('0x8'));router[_0xd1e3('0x9')]('/',auth[_0xd1e3('0xa')](),controller[_0xd1e3('0xb')]);router[_0xd1e3('0x9')](_0xd1e3('0xc'),auth[_0xd1e3('0xa')](),controller[_0xd1e3('0xd')]);router[_0xd1e3('0xe')]('/',auth['isAuthenticated'](),controller[_0xd1e3('0xf')]);router['put'](_0xd1e3('0xc'),auth[_0xd1e3('0xa')](),controller[_0xd1e3('0x10')]);router[_0xd1e3('0x11')]('/:id',auth[_0xd1e3('0xa')](),controller[_0xd1e3('0x12')]);module['exports']=router;
\ No newline at end of file
index 080dbb8..abbfdfc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ecf=['variable','BOOLEAN','ENUM','string','keyValue','picklist','STRING'];(function(_0x29a2f0,_0x58b1e1){var _0x6a49d1=function(_0x3dead9){while(--_0x3dead9){_0x29a2f0['push'](_0x29a2f0['shift']());}};_0x6a49d1(++_0x58b1e1);}(_0x5ecf,0x136));var _0xf5ec=function(_0x4e94ad,_0x127aba){_0x4e94ad=_0x4e94ad-0x0;var _0x2be377=_0x5ecf[_0x4e94ad];return _0x2be377;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xf5ec('0x0')](_0xf5ec('0x1'),'variable','customVariable',_0xf5ec('0x2'),_0xf5ec('0x3')),'defaultValue':'string'},'content':{'type':Sequelize[_0xf5ec('0x4')]},'key':{'type':Sequelize[_0xf5ec('0x4')]},'keyType':{'type':Sequelize[_0xf5ec('0x0')](_0xf5ec('0x1'),_0xf5ec('0x5'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf5ec('0x4')]},'nameField':{'type':Sequelize[_0xf5ec('0x4')]},'customField':{'type':Sequelize[_0xf5ec('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf5ec('0x4')]}};
\ No newline at end of file
+var _0xafcd=['customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize','exports','string','variable'];(function(_0x3e1b77,_0x4c2c98){var _0x434515=function(_0x37816d){while(--_0x37816d){_0x3e1b77['push'](_0x3e1b77['shift']());}};_0x434515(++_0x4c2c98);}(_0xafcd,0x150));var _0xdafc=function(_0x1992cd,_0x57d364){_0x1992cd=_0x1992cd-0x0;var _0x33c636=_0xafcd[_0x1992cd];return _0x33c636;};'use strict';var Sequelize=require(_0xdafc('0x0'));module[_0xdafc('0x1')]={'type':{'type':Sequelize['ENUM'](_0xdafc('0x2'),_0xdafc('0x3'),_0xdafc('0x4'),_0xdafc('0x5'),_0xdafc('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xdafc('0x7')]},'key':{'type':Sequelize[_0xdafc('0x7')]},'keyType':{'type':Sequelize[_0xdafc('0x8')](_0xdafc('0x2'),'variable',_0xdafc('0x4'))},'keyContent':{'type':Sequelize[_0xdafc('0x7')]},'idField':{'type':Sequelize[_0xdafc('0x7')]},'nameField':{'type':Sequelize[_0xdafc('0x7')]},'customField':{'type':Sequelize[_0xdafc('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index adf2c42..88b7623 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b73=['include','options','find','catch','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','error','stack','name','map','ZendeskField','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','findAll','rows','show','params','includeAll'];(function(_0x52b789,_0x2f27d2){var _0x1ce5a8=function(_0x50f4fe){while(--_0x50f4fe){_0x52b789['push'](_0x52b789['shift']());}};_0x1ce5a8(++_0x2f27d2);}(_0x1b73,0x1d5));var _0x31b7=function(_0x3c5611,_0x3900d0){_0x3c5611=_0x3c5611-0x0;var _0x43286e=_0x1b73[_0x3c5611];return _0x43286e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x31b7('0x0'));var zipdir=require(_0x31b7('0x1'));var jsonpatch=require(_0x31b7('0x2'));var rp=require(_0x31b7('0x3'));var moment=require('moment');var BPromise=require(_0x31b7('0x4'));var Mustache=require('mustache');var util=require(_0x31b7('0x5'));var path=require(_0x31b7('0x6'));var sox=require('sox');var csv=require(_0x31b7('0x7'));var ejs=require(_0x31b7('0x8'));var fs=require('fs');var fs_extra=require(_0x31b7('0x9'));var _=require('lodash');var squel=require(_0x31b7('0xa'));var crypto=require(_0x31b7('0xb'));var jsforce=require(_0x31b7('0xc'));var deskjs=require(_0x31b7('0xd'));var toCsv=require(_0x31b7('0x7'));var querystring=require(_0x31b7('0xe'));var Papa=require(_0x31b7('0xf'));var Redis=require('ioredis');var authService=require(_0x31b7('0x10'));var qs=require(_0x31b7('0x11'));var as=require(_0x31b7('0x12'));var hardwareService=require(_0x31b7('0x13'));var logger=require(_0x31b7('0x14'))(_0x31b7('0x15'));var utils=require(_0x31b7('0x16'));var config=require(_0x31b7('0x17'));var licenseUtil=require(_0x31b7('0x18'));var db=require(_0x31b7('0x19'))['db'];function respondWithStatusCode(_0x492612,_0x32afeb){_0x32afeb=_0x32afeb||0xcc;return function(_0x55e1bb){if(_0x55e1bb){return _0x492612[_0x31b7('0x1a')](_0x32afeb);}return _0x492612[_0x31b7('0x1b')](_0x32afeb)[_0x31b7('0x1c')]();};}function respondWithResult(_0x1969d2,_0x7988e2){_0x7988e2=_0x7988e2||0xc8;return function(_0x34e917){if(_0x34e917){return _0x1969d2[_0x31b7('0x1b')](_0x7988e2)['json'](_0x34e917);}};}function respondWithFilteredResult(_0x1e93fb,_0x491c98){return function(_0x210f18){if(_0x210f18){var _0xf213c9=typeof _0x491c98['offset']===_0x31b7('0x1d')&&typeof _0x491c98[_0x31b7('0x1e')]===_0x31b7('0x1d');var _0x39eee9=_0x210f18[_0x31b7('0x1f')];var _0x5f3245=_0xf213c9?0x0:_0x491c98[_0x31b7('0x20')];var _0x437eba=_0xf213c9?_0x210f18[_0x31b7('0x1f')]:_0x491c98[_0x31b7('0x20')]+_0x491c98[_0x31b7('0x1e')];var _0x4b8ab1;if(_0x437eba>=_0x39eee9){_0x437eba=_0x39eee9;_0x4b8ab1=0xc8;}else{_0x4b8ab1=0xce;}_0x1e93fb[_0x31b7('0x1b')](_0x4b8ab1);return _0x1e93fb[_0x31b7('0x21')](_0x31b7('0x22'),_0x5f3245+'-'+_0x437eba+'/'+_0x39eee9)[_0x31b7('0x23')](_0x210f18);}return null;};}function patchUpdates(_0x5b56bc){return function(_0x892fe4){try{jsonpatch[_0x31b7('0x24')](_0x892fe4,_0x5b56bc,!![]);}catch(_0x424318){return BPromise[_0x31b7('0x25')](_0x424318);}return _0x892fe4['save']();};}function saveUpdates(_0x33dd04,_0x20cb03){return function(_0x250574){if(_0x250574){return _0x250574[_0x31b7('0x26')](_0x33dd04)[_0x31b7('0x27')](function(_0x2d24bf){return _0x2d24bf;});}return null;};}function removeEntity(_0x36492c,_0x20e5b0){return function(_0x3b0eff){if(_0x3b0eff){return _0x3b0eff['destroy']()[_0x31b7('0x27')](function(){_0x36492c[_0x31b7('0x1b')](0xcc)[_0x31b7('0x1c')]();});}};}function handleEntityNotFound(_0x2c993b,_0x4e5673){return function(_0xb8a998){if(!_0xb8a998){_0x2c993b['sendStatus'](0x194);}return _0xb8a998;};}function handleError(_0x3dd60d,_0x2da751){_0x2da751=_0x2da751||0x1f4;return function(_0x14b63f){logger[_0x31b7('0x28')](_0x14b63f[_0x31b7('0x29')]);if(_0x14b63f[_0x31b7('0x2a')]){delete _0x14b63f[_0x31b7('0x2a')];}_0x3dd60d[_0x31b7('0x1b')](_0x2da751)['send'](_0x14b63f);};}exports['index']=function(_0x503549,_0x46508a){var _0x39521d={},_0x2a7c54={},_0x4f5e1d={'count':0x0,'rows':[]};var _0x169238=_[_0x31b7('0x2b')](db[_0x31b7('0x2c')][_0x31b7('0x2d')],function(_0x58a87e){return{'name':_0x58a87e[_0x31b7('0x2e')],'type':_0x58a87e[_0x31b7('0x2f')]['key']};});_0x2a7c54['model']=_[_0x31b7('0x2b')](_0x169238,_0x31b7('0x2a'));_0x2a7c54[_0x31b7('0x30')]=_[_0x31b7('0x31')](_0x503549['query']);_0x2a7c54['filters']=_[_0x31b7('0x32')](_0x2a7c54[_0x31b7('0x33')],_0x2a7c54[_0x31b7('0x30')]);_0x39521d[_0x31b7('0x34')]=_[_0x31b7('0x32')](_0x2a7c54['model'],qs['fields'](_0x503549[_0x31b7('0x30')][_0x31b7('0x35')]));_0x39521d['attributes']=_0x39521d[_0x31b7('0x34')][_0x31b7('0x36')]?_0x39521d['attributes']:_0x2a7c54[_0x31b7('0x33')];if(!_0x503549[_0x31b7('0x30')][_0x31b7('0x37')](_0x31b7('0x38'))){_0x39521d[_0x31b7('0x1e')]=qs[_0x31b7('0x1e')](_0x503549[_0x31b7('0x30')][_0x31b7('0x1e')]);_0x39521d[_0x31b7('0x20')]=qs[_0x31b7('0x20')](_0x503549[_0x31b7('0x30')][_0x31b7('0x20')]);}_0x39521d[_0x31b7('0x39')]=qs['sort'](_0x503549['query'][_0x31b7('0x3a')]);_0x39521d[_0x31b7('0x3b')]=qs[_0x31b7('0x3c')](_[_0x31b7('0x3d')](_0x503549[_0x31b7('0x30')],_0x2a7c54[_0x31b7('0x3c')]),_0x169238);if(_0x503549[_0x31b7('0x30')][_0x31b7('0x3e')]){_0x39521d[_0x31b7('0x3b')]=_[_0x31b7('0x3f')](_0x39521d['where'],{'$or':_[_0x31b7('0x2b')](_0x169238,function(_0xfd4863){if(_0xfd4863[_0x31b7('0x2f')]!==_0x31b7('0x40')){var _0x5c9cec={};_0x5c9cec[_0xfd4863[_0x31b7('0x2a')]]={'$like':'%'+_0x503549[_0x31b7('0x30')]['filter']+'%'};return _0x5c9cec;}})});}_0x39521d=_[_0x31b7('0x3f')]({},_0x39521d,_0x503549['options']);var _0x587506={'where':_0x39521d[_0x31b7('0x3b')]};return db[_0x31b7('0x2c')][_0x31b7('0x1f')](_0x587506)[_0x31b7('0x27')](function(_0x3d0413){_0x4f5e1d['count']=_0x3d0413;if(_0x503549[_0x31b7('0x30')]['includeAll']){_0x39521d['include']=[{'all':!![]}];}return db['ZendeskField'][_0x31b7('0x41')](_0x39521d);})[_0x31b7('0x27')](function(_0x1527b3){_0x4f5e1d[_0x31b7('0x42')]=_0x1527b3;return _0x4f5e1d;})[_0x31b7('0x27')](respondWithFilteredResult(_0x46508a,_0x39521d))['catch'](handleError(_0x46508a,null));};exports[_0x31b7('0x43')]=function(_0x5d1f25,_0xef2b18){var _0x3caab0={'raw':!![],'where':{'id':_0x5d1f25[_0x31b7('0x44')]['id']}},_0x41c92e={};_0x41c92e['model']=_[_0x31b7('0x31')](db[_0x31b7('0x2c')][_0x31b7('0x2d')]);_0x41c92e['query']=_[_0x31b7('0x31')](_0x5d1f25['query']);_0x41c92e[_0x31b7('0x3c')]=_[_0x31b7('0x32')](_0x41c92e['model'],_0x41c92e[_0x31b7('0x30')]);_0x3caab0[_0x31b7('0x34')]=_[_0x31b7('0x32')](_0x41c92e[_0x31b7('0x33')],qs['fields'](_0x5d1f25[_0x31b7('0x30')]['fields']));_0x3caab0['attributes']=_0x3caab0[_0x31b7('0x34')][_0x31b7('0x36')]?_0x3caab0[_0x31b7('0x34')]:_0x41c92e[_0x31b7('0x33')];if(_0x5d1f25['query'][_0x31b7('0x45')]){_0x3caab0[_0x31b7('0x46')]=[{'all':!![]}];}_0x3caab0=_['merge']({},_0x3caab0,_0x5d1f25[_0x31b7('0x47')]);return db[_0x31b7('0x2c')][_0x31b7('0x48')](_0x3caab0)['then'](handleEntityNotFound(_0xef2b18,null))[_0x31b7('0x27')](respondWithResult(_0xef2b18,null))[_0x31b7('0x49')](handleError(_0xef2b18,null));};exports[_0x31b7('0x4a')]=function(_0x164115,_0x345059){return db[_0x31b7('0x2c')][_0x31b7('0x4a')](_0x164115[_0x31b7('0x4b')],{})['then'](respondWithResult(_0x345059,0xc9))[_0x31b7('0x49')](handleError(_0x345059,null));};exports['update']=function(_0x5a72ee,_0x22cc77){if(_0x5a72ee[_0x31b7('0x4b')]['id']){delete _0x5a72ee[_0x31b7('0x4b')]['id'];}return db[_0x31b7('0x2c')]['find']({'where':{'id':_0x5a72ee[_0x31b7('0x44')]['id']}})[_0x31b7('0x27')](handleEntityNotFound(_0x22cc77,null))[_0x31b7('0x27')](saveUpdates(_0x5a72ee['body'],null))[_0x31b7('0x27')](respondWithResult(_0x22cc77,null))[_0x31b7('0x49')](handleError(_0x22cc77,null));};exports[_0x31b7('0x4c')]=function(_0x3b5868,_0x2bf59c){return db[_0x31b7('0x2c')][_0x31b7('0x48')]({'where':{'id':_0x3b5868[_0x31b7('0x44')]['id']}})['then'](handleEntityNotFound(_0x2bf59c,null))['then'](removeEntity(_0x2bf59c,null))[_0x31b7('0x49')](handleError(_0x2bf59c,null));};
\ No newline at end of file
+var _0x0373=['show','keys','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0x0373,0x1c2));var _0x3037=function(_0x4f027d,_0x3f9587){_0x4f027d=_0x4f027d-0x0;var _0xc46890=_0x0373[_0x4f027d];return _0xc46890;};'use strict';var emlformat=require(_0x3037('0x0'));var rimraf=require(_0x3037('0x1'));var zipdir=require(_0x3037('0x2'));var jsonpatch=require(_0x3037('0x3'));var rp=require(_0x3037('0x4'));var moment=require(_0x3037('0x5'));var BPromise=require(_0x3037('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3037('0x7'));var sox=require(_0x3037('0x8'));var csv=require(_0x3037('0x9'));var ejs=require(_0x3037('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3037('0xb'));var squel=require(_0x3037('0xc'));var crypto=require(_0x3037('0xd'));var jsforce=require(_0x3037('0xe'));var deskjs=require(_0x3037('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3037('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3037('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3037('0x12'));var logger=require(_0x3037('0x13'))(_0x3037('0x14'));var utils=require(_0x3037('0x15'));var config=require(_0x3037('0x16'));var licenseUtil=require(_0x3037('0x17'));var db=require(_0x3037('0x18'))['db'];function respondWithStatusCode(_0x2e16fd,_0x224113){_0x224113=_0x224113||0xcc;return function(_0x252d6f){if(_0x252d6f){return _0x2e16fd[_0x3037('0x19')](_0x224113);}return _0x2e16fd[_0x3037('0x1a')](_0x224113)[_0x3037('0x1b')]();};}function respondWithResult(_0x50d807,_0x1159f9){_0x1159f9=_0x1159f9||0xc8;return function(_0x3d5ee0){if(_0x3d5ee0){return _0x50d807['status'](_0x1159f9)[_0x3037('0x1c')](_0x3d5ee0);}};}function respondWithFilteredResult(_0x490804,_0x151da7){return function(_0xd4528){if(_0xd4528){var _0x16355e=typeof _0x151da7[_0x3037('0x1d')]===_0x3037('0x1e')&&typeof _0x151da7[_0x3037('0x1f')]===_0x3037('0x1e');var _0x509cb9=_0xd4528[_0x3037('0x20')];var _0x3054ba=_0x16355e?0x0:_0x151da7[_0x3037('0x1d')];var _0x19dba4=_0x16355e?_0xd4528[_0x3037('0x20')]:_0x151da7[_0x3037('0x1d')]+_0x151da7[_0x3037('0x1f')];var _0x568ef4;if(_0x19dba4>=_0x509cb9){_0x19dba4=_0x509cb9;_0x568ef4=0xc8;}else{_0x568ef4=0xce;}_0x490804['status'](_0x568ef4);return _0x490804[_0x3037('0x21')](_0x3037('0x22'),_0x3054ba+'-'+_0x19dba4+'/'+_0x509cb9)[_0x3037('0x1c')](_0xd4528);}return null;};}function patchUpdates(_0xe6e72){return function(_0x183f50){try{jsonpatch[_0x3037('0x23')](_0x183f50,_0xe6e72,!![]);}catch(_0x4ed4a3){return BPromise['reject'](_0x4ed4a3);}return _0x183f50[_0x3037('0x24')]();};}function saveUpdates(_0xfe3ac7,_0x37ca38){return function(_0x3d6157){if(_0x3d6157){return _0x3d6157[_0x3037('0x25')](_0xfe3ac7)[_0x3037('0x26')](function(_0x1c6065){return _0x1c6065;});}return null;};}function removeEntity(_0x61be38,_0x35012d){return function(_0xd8250e){if(_0xd8250e){return _0xd8250e['destroy']()[_0x3037('0x26')](function(){_0x61be38[_0x3037('0x1a')](0xcc)[_0x3037('0x1b')]();});}};}function handleEntityNotFound(_0x1aa014,_0x17928b){return function(_0x2f2bfb){if(!_0x2f2bfb){_0x1aa014[_0x3037('0x19')](0x194);}return _0x2f2bfb;};}function handleError(_0x5b7d09,_0x11fcb8){_0x11fcb8=_0x11fcb8||0x1f4;return function(_0x24b8d3){logger['error'](_0x24b8d3[_0x3037('0x27')]);if(_0x24b8d3[_0x3037('0x28')]){delete _0x24b8d3[_0x3037('0x28')];}_0x5b7d09[_0x3037('0x1a')](_0x11fcb8)[_0x3037('0x29')](_0x24b8d3);};}exports[_0x3037('0x2a')]=function(_0x36faaa,_0x2a875d){var _0x2a2ba5={},_0x39ea1e={},_0x4c5c91={'count':0x0,'rows':[]};var _0x1790ad=_[_0x3037('0x2b')](db[_0x3037('0x2c')][_0x3037('0x2d')],function(_0x22f27c){return{'name':_0x22f27c[_0x3037('0x2e')],'type':_0x22f27c[_0x3037('0x2f')][_0x3037('0x30')]};});_0x39ea1e[_0x3037('0x31')]=_[_0x3037('0x2b')](_0x1790ad,_0x3037('0x28'));_0x39ea1e[_0x3037('0x32')]=_['keys'](_0x36faaa[_0x3037('0x32')]);_0x39ea1e[_0x3037('0x33')]=_[_0x3037('0x34')](_0x39ea1e[_0x3037('0x31')],_0x39ea1e['query']);_0x2a2ba5[_0x3037('0x35')]=_['intersection'](_0x39ea1e['model'],qs['fields'](_0x36faaa[_0x3037('0x32')][_0x3037('0x36')]));_0x2a2ba5['attributes']=_0x2a2ba5[_0x3037('0x35')][_0x3037('0x37')]?_0x2a2ba5['attributes']:_0x39ea1e[_0x3037('0x31')];if(!_0x36faaa[_0x3037('0x32')]['hasOwnProperty'](_0x3037('0x38'))){_0x2a2ba5[_0x3037('0x1f')]=qs[_0x3037('0x1f')](_0x36faaa[_0x3037('0x32')][_0x3037('0x1f')]);_0x2a2ba5[_0x3037('0x1d')]=qs[_0x3037('0x1d')](_0x36faaa[_0x3037('0x32')][_0x3037('0x1d')]);}_0x2a2ba5[_0x3037('0x39')]=qs['sort'](_0x36faaa[_0x3037('0x32')][_0x3037('0x3a')]);_0x2a2ba5[_0x3037('0x3b')]=qs[_0x3037('0x33')](_[_0x3037('0x3c')](_0x36faaa[_0x3037('0x32')],_0x39ea1e[_0x3037('0x33')]),_0x1790ad);if(_0x36faaa[_0x3037('0x32')][_0x3037('0x3d')]){_0x2a2ba5['where']=_[_0x3037('0x3e')](_0x2a2ba5[_0x3037('0x3b')],{'$or':_[_0x3037('0x2b')](_0x1790ad,function(_0x4db52c){if(_0x4db52c[_0x3037('0x2f')]!==_0x3037('0x3f')){var _0xea8178={};_0xea8178[_0x4db52c[_0x3037('0x28')]]={'$like':'%'+_0x36faaa['query']['filter']+'%'};return _0xea8178;}})});}_0x2a2ba5=_['merge']({},_0x2a2ba5,_0x36faaa['options']);var _0xa1e67a={'where':_0x2a2ba5[_0x3037('0x3b')]};return db['ZendeskField'][_0x3037('0x20')](_0xa1e67a)[_0x3037('0x26')](function(_0x333fc8){_0x4c5c91[_0x3037('0x20')]=_0x333fc8;if(_0x36faaa[_0x3037('0x32')][_0x3037('0x40')]){_0x2a2ba5[_0x3037('0x41')]=[{'all':!![]}];}return db[_0x3037('0x2c')][_0x3037('0x42')](_0x2a2ba5);})[_0x3037('0x26')](function(_0xcd65ff){_0x4c5c91['rows']=_0xcd65ff;return _0x4c5c91;})['then'](respondWithFilteredResult(_0x2a875d,_0x2a2ba5))[_0x3037('0x43')](handleError(_0x2a875d,null));};exports[_0x3037('0x44')]=function(_0x1ebf6e,_0x49541d){var _0xf98859={'raw':!![],'where':{'id':_0x1ebf6e['params']['id']}},_0x1b6447={};_0x1b6447['model']=_[_0x3037('0x45')](db[_0x3037('0x2c')][_0x3037('0x2d')]);_0x1b6447[_0x3037('0x32')]=_[_0x3037('0x45')](_0x1ebf6e[_0x3037('0x32')]);_0x1b6447[_0x3037('0x33')]=_[_0x3037('0x34')](_0x1b6447[_0x3037('0x31')],_0x1b6447['query']);_0xf98859[_0x3037('0x35')]=_[_0x3037('0x34')](_0x1b6447[_0x3037('0x31')],qs[_0x3037('0x36')](_0x1ebf6e[_0x3037('0x32')][_0x3037('0x36')]));_0xf98859[_0x3037('0x35')]=_0xf98859[_0x3037('0x35')][_0x3037('0x37')]?_0xf98859['attributes']:_0x1b6447['model'];if(_0x1ebf6e[_0x3037('0x32')][_0x3037('0x40')]){_0xf98859['include']=[{'all':!![]}];}_0xf98859=_['merge']({},_0xf98859,_0x1ebf6e['options']);return db[_0x3037('0x2c')][_0x3037('0x46')](_0xf98859)[_0x3037('0x26')](handleEntityNotFound(_0x49541d,null))['then'](respondWithResult(_0x49541d,null))['catch'](handleError(_0x49541d,null));};exports[_0x3037('0x47')]=function(_0x296abe,_0x3c9319){return db[_0x3037('0x2c')][_0x3037('0x47')](_0x296abe[_0x3037('0x48')],{})[_0x3037('0x26')](respondWithResult(_0x3c9319,0xc9))[_0x3037('0x43')](handleError(_0x3c9319,null));};exports[_0x3037('0x25')]=function(_0x10bd4d,_0x3dbc47){if(_0x10bd4d['body']['id']){delete _0x10bd4d[_0x3037('0x48')]['id'];}return db[_0x3037('0x2c')][_0x3037('0x46')]({'where':{'id':_0x10bd4d[_0x3037('0x49')]['id']}})[_0x3037('0x26')](handleEntityNotFound(_0x3dbc47,null))['then'](saveUpdates(_0x10bd4d[_0x3037('0x48')],null))[_0x3037('0x26')](respondWithResult(_0x3dbc47,null))['catch'](handleError(_0x3dbc47,null));};exports['destroy']=function(_0x5b8340,_0x28e026){return db[_0x3037('0x2c')][_0x3037('0x46')]({'where':{'id':_0x5b8340[_0x3037('0x49')]['id']}})['then'](handleEntityNotFound(_0x28e026,null))[_0x3037('0x26')](removeEntity(_0x28e026,null))[_0x3037('0x43')](handleError(_0x28e026,null));};
\ No newline at end of file
index 2822d86..4d46b99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01cb=['define','ZendeskField','zendesk_unique_index','idField','FieldId','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intZendeskField.attributes','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x01cb,0x67));var _0xb01c=function(_0x4c3ffe,_0x457374){_0x4c3ffe=_0x4c3ffe-0x0;var _0x28d3eb=_0x01cb[_0x4c3ffe];return _0x28d3eb;};'use strict';var _=require('lodash');var util=require(_0xb01c('0x0'));var logger=require(_0xb01c('0x1'))(_0xb01c('0x2'));var moment=require('moment');var BPromise=require(_0xb01c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb01c('0x4'));var rimraf=require(_0xb01c('0x5'));var config=require(_0xb01c('0x6'));var attributes=require(_0xb01c('0x7'));module[_0xb01c('0x8')]=function(_0x319e96,_0x1da2aa){return _0x319e96[_0xb01c('0x9')](_0xb01c('0xa'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0xb01c('0xb'),'fields':[_0xb01c('0xc'),_0xb01c('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8e65=['./intZendeskField.attributes','exports','define','int_zendesk_fields','zendesk_unique_index','idField','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3c8cfe,_0x4bae35){var _0x4690fc=function(_0x4f441e){while(--_0x4f441e){_0x3c8cfe['push'](_0x3c8cfe['shift']());}};_0x4690fc(++_0x4bae35);}(_0x8e65,0x1c8));var _0x58e6=function(_0x4fad1,_0x3aebb4){_0x4fad1=_0x4fad1-0x0;var _0x24f9e1=_0x8e65[_0x4fad1];return _0x24f9e1;};'use strict';var _=require(_0x58e6('0x0'));var util=require('util');var logger=require(_0x58e6('0x1'))(_0x58e6('0x2'));var moment=require(_0x58e6('0x3'));var BPromise=require(_0x58e6('0x4'));var rp=require(_0x58e6('0x5'));var fs=require('fs');var path=require(_0x58e6('0x6'));var rimraf=require(_0x58e6('0x7'));var config=require(_0x58e6('0x8'));var attributes=require(_0x58e6('0x9'));module[_0x58e6('0xa')]=function(_0x54c17b,_0x298f8b){return _0x54c17b[_0x58e6('0xb')]('ZendeskField',attributes,{'tableName':_0x58e6('0xc'),'paranoid':![],'indexes':[{'name':_0x58e6('0xd'),'fields':[_0x58e6('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index e72d931..3384d2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97b7=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x97b7,0x1ce));var _0x797b=function(_0x3d7559,_0x2bef9f){_0x3d7559=_0x3d7559-0x0;var _0x577b3d=_0x97b7[_0x3d7559];return _0x577b3d;};'use strict';var _=require(_0x797b('0x0'));var util=require('util');var moment=require(_0x797b('0x1'));var BPromise=require(_0x797b('0x2'));var rs=require(_0x797b('0x3'));var fs=require('fs');var Redis=require(_0x797b('0x4'));var db=require(_0x797b('0x5'))['db'];var utils=require(_0x797b('0x6'));var logger=require('../../config/logger')(_0x797b('0x7'));var config=require(_0x797b('0x8'));var jayson=require(_0x797b('0x9'));var client=jayson[_0x797b('0xa')][_0x797b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x506658,_0x2a07c0,_0x4755f1){return new BPromise(function(_0x237eb3,_0x3bfcdc){return client[_0x797b('0xc')](_0x506658,_0x4755f1)['then'](function(_0x5b6368){logger[_0x797b('0xd')](_0x797b('0xe'),_0x2a07c0,_0x797b('0xf'));logger[_0x797b('0x10')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x2a07c0,'request\x20sent',JSON[_0x797b('0x11')](_0x5b6368));if(_0x5b6368['error']){if(_0x5b6368[_0x797b('0x12')][_0x797b('0x13')]===0x1f4){logger[_0x797b('0x12')](_0x797b('0xe'),_0x2a07c0,_0x5b6368['error'][_0x797b('0x14')]);return _0x3bfcdc(_0x5b6368[_0x797b('0x12')][_0x797b('0x14')]);}logger[_0x797b('0x12')]('ZendeskField,\x20%s,\x20%s',_0x2a07c0,_0x5b6368[_0x797b('0x12')][_0x797b('0x14')]);return _0x237eb3(_0x5b6368['error'][_0x797b('0x14')]);}else{logger['info'](_0x797b('0xe'),_0x2a07c0,_0x797b('0xf'));_0x237eb3(_0x5b6368[_0x797b('0x15')][_0x797b('0x14')]);}})[_0x797b('0x16')](function(_0x21c324){logger[_0x797b('0x12')](_0x797b('0xe'),_0x2a07c0,_0x21c324);_0x3bfcdc(_0x21c324);});});}
\ No newline at end of file
+var _0xf53e=['code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x386525,_0xefae6){var _0x14d015=function(_0x4a45c1){while(--_0x4a45c1){_0x386525['push'](_0x386525['shift']());}};_0x14d015(++_0xefae6);}(_0xf53e,0x94));var _0xef53=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf53e[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xef53('0x0'));var util=require(_0xef53('0x1'));var moment=require(_0xef53('0x2'));var BPromise=require(_0xef53('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xef53('0x4'));var db=require(_0xef53('0x5'))['db'];var utils=require(_0xef53('0x6'));var logger=require(_0xef53('0x7'))(_0xef53('0x8'));var config=require(_0xef53('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xef53('0xa')][_0xef53('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29f274,_0x162c21,_0x9fdf38){return new BPromise(function(_0x7f18bb,_0x30dbcb){return client[_0xef53('0xc')](_0x29f274,_0x9fdf38)[_0xef53('0xd')](function(_0x1ac1a5){logger[_0xef53('0xe')](_0xef53('0xf'),_0x162c21,'request\x20sent');logger[_0xef53('0x10')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x162c21,_0xef53('0x11'),JSON[_0xef53('0x12')](_0x1ac1a5));if(_0x1ac1a5[_0xef53('0x13')]){if(_0x1ac1a5[_0xef53('0x13')][_0xef53('0x14')]===0x1f4){logger['error']('ZendeskField,\x20%s,\x20%s',_0x162c21,_0x1ac1a5[_0xef53('0x13')][_0xef53('0x15')]);return _0x30dbcb(_0x1ac1a5[_0xef53('0x13')]['message']);}logger[_0xef53('0x13')](_0xef53('0xf'),_0x162c21,_0x1ac1a5[_0xef53('0x13')][_0xef53('0x15')]);return _0x7f18bb(_0x1ac1a5['error'][_0xef53('0x15')]);}else{logger[_0xef53('0xe')](_0xef53('0xf'),_0x162c21,'request\x20sent');_0x7f18bb(_0x1ac1a5[_0xef53('0x16')][_0xef53('0x15')]);}})[_0xef53('0x17')](function(_0x418274){logger[_0xef53('0x13')]('ZendeskField,\x20%s,\x20%s',_0x162c21,_0x418274);_0x30dbcb(_0x418274);});});}
\ No newline at end of file
index 6b24c4a..22a7c45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba62=['/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','/:id','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x3ac7e6,_0x392fe5){var _0x592a9b=function(_0x515656){while(--_0x515656){_0x3ac7e6['push'](_0x3ac7e6['shift']());}};_0x592a9b(++_0x392fe5);}(_0xba62,0xb3));var _0x2ba6=function(_0x21ccfc,_0x48834e){_0x21ccfc=_0x21ccfc-0x0;var _0x279454=_0xba62[_0x21ccfc];return _0x279454;};'use strict';var multer=require('multer');var util=require(_0x2ba6('0x0'));var path=require(_0x2ba6('0x1'));var timeout=require(_0x2ba6('0x2'));var express=require('express');var router=express[_0x2ba6('0x3')]();var fs_extra=require(_0x2ba6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2ba6('0x5'));var config=require(_0x2ba6('0x6'));var controller=require('./intZohoAccount.controller');router[_0x2ba6('0x7')]('/',auth[_0x2ba6('0x8')](),controller[_0x2ba6('0x9')]);router[_0x2ba6('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x2ba6('0x7')](_0x2ba6('0xa'),auth[_0x2ba6('0x8')](),controller[_0x2ba6('0xb')]);router['get'](_0x2ba6('0xc'),auth[_0x2ba6('0x8')](),controller[_0x2ba6('0xd')]);router[_0x2ba6('0xe')]('/',auth[_0x2ba6('0x8')](),controller[_0x2ba6('0xf')]);router[_0x2ba6('0xe')]('/:id/configurations',auth[_0x2ba6('0x8')](),controller[_0x2ba6('0x10')]);router['put'](_0x2ba6('0x11'),auth[_0x2ba6('0x8')](),controller['update']);router[_0x2ba6('0x12')](_0x2ba6('0x11'),auth[_0x2ba6('0x8')](),controller[_0x2ba6('0x13')]);module[_0x2ba6('0x14')]=router;
\ No newline at end of file
+var _0x16a9=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete'];(function(_0x5d0de8,_0x22f569){var _0x3afe4a=function(_0x24bdde){while(--_0x24bdde){_0x5d0de8['push'](_0x5d0de8['shift']());}};_0x3afe4a(++_0x22f569);}(_0x16a9,0x7a));var _0x916a=function(_0x433e30,_0x1adab3){_0x433e30=_0x433e30-0x0;var _0x523194=_0x16a9[_0x433e30];return _0x523194;};'use strict';var multer=require(_0x916a('0x0'));var util=require(_0x916a('0x1'));var path=require('path');var timeout=require(_0x916a('0x2'));var express=require(_0x916a('0x3'));var router=express[_0x916a('0x4')]();var fs_extra=require(_0x916a('0x5'));var auth=require(_0x916a('0x6'));var interaction=require(_0x916a('0x7'));var config=require('../../config/environment');var controller=require('./intZohoAccount.controller');router[_0x916a('0x8')]('/',auth['isAuthenticated'](),controller[_0x916a('0x9')]);router[_0x916a('0x8')](_0x916a('0xa'),auth['isAuthenticated'](),controller[_0x916a('0xb')]);router[_0x916a('0x8')](_0x916a('0xc'),auth[_0x916a('0xd')](),controller[_0x916a('0xe')]);router[_0x916a('0x8')](_0x916a('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0x916a('0x10')]('/',auth['isAuthenticated'](),controller[_0x916a('0x11')]);router['post'](_0x916a('0xc'),auth[_0x916a('0xd')](),controller[_0x916a('0x12')]);router[_0x916a('0x13')](_0x916a('0xa'),auth[_0x916a('0xd')](),controller[_0x916a('0x14')]);router[_0x916a('0x15')]('/:id',auth[_0x916a('0xd')](),controller[_0x916a('0x16')]);module[_0x916a('0x17')]=router;
\ No newline at end of file
index 5355e44..9b0c634 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41bb=['exports','STRING','sequelize'];(function(_0x5af97c,_0x24a49f){var _0x3472ae=function(_0x54cdc3){while(--_0x54cdc3){_0x5af97c['push'](_0x5af97c['shift']());}};_0x3472ae(++_0x24a49f);}(_0x41bb,0xc5));var _0xb41b=function(_0x2e323f,_0x4d5934){_0x2e323f=_0x2e323f-0x0;var _0x3052da=_0x41bb[_0x2e323f];return _0x3052da;};'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 _0x5c12=['exports','STRING'];(function(_0x33a13f,_0x2ffcab){var _0x1ccb8d=function(_0x3e9fca){while(--_0x3e9fca){_0x33a13f['push'](_0x33a13f['shift']());}};_0x1ccb8d(++_0x2ffcab);}(_0x5c12,0x188));var _0x25c1=function(_0x2d9e27,_0x5965b2){_0x2d9e27=_0x2d9e27-0x0;var _0xd35381=_0x5c12[_0x2d9e27];return _0xd35381;};'use strict';var Sequelize=require('sequelize');module[_0x25c1('0x0')]={'name':{'type':Sequelize[_0x25c1('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x25c1('0x1')]},'zone':{'type':Sequelize[_0x25c1('0x1')]},'clientId':{'type':Sequelize[_0x25c1('0x1')]},'clientSecret':{'type':Sequelize[_0x25c1('0x1')]},'serverUrl':{'type':Sequelize[_0x25c1('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0x25c1('0x1')]},'refreshToken':{'type':Sequelize[_0x25c1('0x1')]}};
\ No newline at end of file
index 580b2c1..469d2dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x720d=['hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','catch','params','ZohoAccount','length','include','create','body','update','find','getConfigurations','findOne','pick','AccountId','Subjects','getSubjects','channel','getDescriptions','ZohoConfiguration','ZohoField','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','zone','serverUrl','code','slice','substring','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','message','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','includes','system_mandatory','display_label','custom_field','data_type','pick_list_values','stringify','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x720d,0xb7));var _0xd720=function(_0x78ea1a,_0x2275eb){_0x78ea1a=_0x78ea1a-0x0;var _0x53d92e=_0x720d[_0x78ea1a];return _0x53d92e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd720('0x0'));var zipdir=require(_0xd720('0x1'));var jsonpatch=require(_0xd720('0x2'));var rp=require(_0xd720('0x3'));var moment=require(_0xd720('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd720('0x5'));var util=require(_0xd720('0x6'));var path=require(_0xd720('0x7'));var sox=require('sox');var csv=require(_0xd720('0x8'));var ejs=require(_0xd720('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd720('0xa'));var squel=require('squel');var crypto=require(_0xd720('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd720('0xc'));var toCsv=require(_0xd720('0x8'));var querystring=require('querystring');var Papa=require(_0xd720('0xd'));var Redis=require('ioredis');var authService=require(_0xd720('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xd720('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd720('0x10'))('api');var utils=require(_0xd720('0x11'));var config=require(_0xd720('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xd720('0x13'));function respondWithStatusCode(_0x6001ce,_0xef731f){_0xef731f=_0xef731f||0xcc;return function(_0x187a82){if(_0x187a82){return _0x6001ce[_0xd720('0x14')](_0xef731f);}return _0x6001ce[_0xd720('0x15')](_0xef731f)[_0xd720('0x16')]();};}function respondWithResult(_0x365ac5,_0x560ed7){_0x560ed7=_0x560ed7||0xc8;return function(_0x164ecc){if(_0x164ecc){return _0x365ac5[_0xd720('0x15')](_0x560ed7)['json'](_0x164ecc);}};}function respondWithFilteredResult(_0x4a1551,_0x3fccee){return function(_0x3c5dca){if(_0x3c5dca){var _0x317947=typeof _0x3fccee[_0xd720('0x17')]===_0xd720('0x18')&&typeof _0x3fccee[_0xd720('0x19')]===_0xd720('0x18');var _0x2ca01d=_0x3c5dca[_0xd720('0x1a')];var _0xdd4b57=_0x317947?0x0:_0x3fccee[_0xd720('0x17')];var _0x41b4b2=_0x317947?_0x3c5dca[_0xd720('0x1a')]:_0x3fccee['offset']+_0x3fccee[_0xd720('0x19')];var _0x4ec711;if(_0x41b4b2>=_0x2ca01d){_0x41b4b2=_0x2ca01d;_0x4ec711=0xc8;}else{_0x4ec711=0xce;}_0x4a1551[_0xd720('0x15')](_0x4ec711);return _0x4a1551[_0xd720('0x1b')](_0xd720('0x1c'),_0xdd4b57+'-'+_0x41b4b2+'/'+_0x2ca01d)[_0xd720('0x1d')](_0x3c5dca);}return null;};}function patchUpdates(_0x2751b0){return function(_0x2999f7){try{jsonpatch['apply'](_0x2999f7,_0x2751b0,!![]);}catch(_0x11ae53){return BPromise[_0xd720('0x1e')](_0x11ae53);}return _0x2999f7[_0xd720('0x1f')]();};}function saveUpdates(_0x4777c1,_0x302e25){return function(_0x12db1f){if(_0x12db1f){return _0x12db1f['update'](_0x4777c1)['then'](function(_0x4cb08b){return _0x4cb08b;});}return null;};}function removeEntity(_0xc5f264,_0x3e9151){return function(_0x8b3f00){if(_0x8b3f00){return _0x8b3f00[_0xd720('0x20')]()[_0xd720('0x21')](function(){_0xc5f264[_0xd720('0x15')](0xcc)[_0xd720('0x16')]();});}};}function handleEntityNotFound(_0x43a56c,_0xe64601){return function(_0x498665){if(!_0x498665){_0x43a56c[_0xd720('0x14')](0x194);}return _0x498665;};}function handleError(_0x22a909,_0x396749){_0x396749=_0x396749||0x1f4;return function(_0x2a6067){logger[_0xd720('0x22')](_0x2a6067[_0xd720('0x23')]);if(_0x2a6067[_0xd720('0x24')]){delete _0x2a6067[_0xd720('0x24')];}_0x22a909[_0xd720('0x15')](_0x396749)[_0xd720('0x25')](_0x2a6067);};}exports[_0xd720('0x26')]=function(_0x434641,_0xb5029c){var _0x3c382b={},_0x21d255={},_0x655a3e={'count':0x0,'rows':[]};var _0x3101bd=_[_0xd720('0x27')](db['ZohoAccount'][_0xd720('0x28')],function(_0x428ed2){return{'name':_0x428ed2[_0xd720('0x29')],'type':_0x428ed2[_0xd720('0x2a')][_0xd720('0x2b')]};});_0x21d255['model']=_[_0xd720('0x27')](_0x3101bd,_0xd720('0x24'));_0x21d255[_0xd720('0x2c')]=_[_0xd720('0x2d')](_0x434641[_0xd720('0x2c')]);_0x21d255[_0xd720('0x2e')]=_['intersection'](_0x21d255[_0xd720('0x2f')],_0x21d255[_0xd720('0x2c')]);_0x3c382b[_0xd720('0x30')]=_[_0xd720('0x31')](_0x21d255[_0xd720('0x2f')],qs[_0xd720('0x32')](_0x434641[_0xd720('0x2c')]['fields']));_0x3c382b[_0xd720('0x30')]=_0x3c382b['attributes']['length']?_0x3c382b[_0xd720('0x30')]:_0x21d255[_0xd720('0x2f')];if(!_0x434641[_0xd720('0x2c')][_0xd720('0x33')](_0xd720('0x34'))){_0x3c382b[_0xd720('0x19')]=qs[_0xd720('0x19')](_0x434641[_0xd720('0x2c')][_0xd720('0x19')]);_0x3c382b[_0xd720('0x17')]=qs[_0xd720('0x17')](_0x434641[_0xd720('0x2c')][_0xd720('0x17')]);}_0x3c382b[_0xd720('0x35')]=qs[_0xd720('0x36')](_0x434641[_0xd720('0x2c')][_0xd720('0x36')]);_0x3c382b['where']=qs[_0xd720('0x2e')](_['pick'](_0x434641['query'],_0x21d255['filters']),_0x3101bd);if(_0x434641['query']['filter']){_0x3c382b['where']=_['merge'](_0x3c382b[_0xd720('0x37')],{'$or':_[_0xd720('0x27')](_0x3101bd,function(_0x4c53c6){if(_0x4c53c6['type']!=='VIRTUAL'){var _0x56f9ba={};_0x56f9ba[_0x4c53c6['name']]={'$like':'%'+_0x434641[_0xd720('0x2c')][_0xd720('0x38')]+'%'};return _0x56f9ba;}})});}_0x3c382b=_[_0xd720('0x39')]({},_0x3c382b,_0x434641[_0xd720('0x3a')]);var _0x463681={'where':_0x3c382b['where']};return db['ZohoAccount'][_0xd720('0x1a')](_0x463681)[_0xd720('0x21')](function(_0x4567c4){_0x655a3e[_0xd720('0x1a')]=_0x4567c4;if(_0x434641[_0xd720('0x2c')][_0xd720('0x3b')]){_0x3c382b['include']=[{'all':!![]}];}return db['ZohoAccount'][_0xd720('0x3c')](_0x3c382b);})[_0xd720('0x21')](function(_0x41d6ff){_0x655a3e['rows']=_0x41d6ff;return _0x655a3e;})['then'](respondWithFilteredResult(_0xb5029c,_0x3c382b))[_0xd720('0x3d')](handleError(_0xb5029c,null));};exports['show']=function(_0x553872,_0x4cbf0b){var _0x1e053f={'raw':![],'where':{'id':_0x553872[_0xd720('0x3e')]['id']}},_0x344fe4={};_0x344fe4[_0xd720('0x2f')]=_['keys'](db[_0xd720('0x3f')][_0xd720('0x28')]);_0x344fe4[_0xd720('0x2c')]=_[_0xd720('0x2d')](_0x553872['query']);_0x344fe4[_0xd720('0x2e')]=_[_0xd720('0x31')](_0x344fe4[_0xd720('0x2f')],_0x344fe4[_0xd720('0x2c')]);_0x1e053f[_0xd720('0x30')]=_[_0xd720('0x31')](_0x344fe4[_0xd720('0x2f')],qs['fields'](_0x553872[_0xd720('0x2c')]['fields']));_0x1e053f[_0xd720('0x30')]=_0x1e053f[_0xd720('0x30')][_0xd720('0x40')]?_0x1e053f[_0xd720('0x30')]:_0x344fe4[_0xd720('0x2f')];if(_0x553872[_0xd720('0x2c')]['includeAll']){_0x1e053f[_0xd720('0x41')]=[{'all':!![]}];}_0x1e053f=_['merge']({},_0x1e053f,_0x553872[_0xd720('0x3a')]);return db['ZohoAccount']['find'](_0x1e053f)[_0xd720('0x21')](handleEntityNotFound(_0x4cbf0b,null))['then'](respondWithResult(_0x4cbf0b,null))['catch'](handleError(_0x4cbf0b,null));};exports[_0xd720('0x42')]=function(_0x5a0e76,_0x132b53){return db[_0xd720('0x3f')][_0xd720('0x42')](_0x5a0e76[_0xd720('0x43')],{})[_0xd720('0x21')](respondWithResult(_0x132b53,0xc9))['catch'](handleError(_0x132b53,null));};exports[_0xd720('0x44')]=function(_0x5ab0f4,_0x1bf18a){if(_0x5ab0f4[_0xd720('0x43')]['id']){delete _0x5ab0f4[_0xd720('0x43')]['id'];}return db[_0xd720('0x3f')]['find']({'where':{'id':_0x5ab0f4[_0xd720('0x3e')]['id']}})[_0xd720('0x21')](handleEntityNotFound(_0x1bf18a,null))[_0xd720('0x21')](saveUpdates(_0x5ab0f4[_0xd720('0x43')],null))[_0xd720('0x21')](respondWithResult(_0x1bf18a,null))[_0xd720('0x3d')](handleError(_0x1bf18a,null));};exports[_0xd720('0x20')]=function(_0x4180aa,_0x4dab9e){return db[_0xd720('0x3f')][_0xd720('0x45')]({'where':{'id':_0x4180aa[_0xd720('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4dab9e,null))[_0xd720('0x21')](removeEntity(_0x4dab9e,null))['catch'](handleError(_0x4dab9e,null));};exports[_0xd720('0x46')]=function(_0x518f8f,_0x7fd1aa,_0x4a0961){var _0x300dc2={};var _0x1340f3={};var _0x432a9d;var _0x211aad;return db[_0xd720('0x3f')][_0xd720('0x47')]({'where':{'id':_0x518f8f['params']['id']}})[_0xd720('0x21')](handleEntityNotFound(_0x7fd1aa,null))[_0xd720('0x21')](function(_0x5098d9){if(_0x5098d9){_0x432a9d=_0x5098d9;_0x1340f3['model']=_[_0xd720('0x2d')](db['ZohoConfiguration'][_0xd720('0x28')]);_0x1340f3['query']=_[_0xd720('0x2d')](_0x518f8f[_0xd720('0x2c')]);_0x1340f3[_0xd720('0x2e')]=_[_0xd720('0x31')](_0x1340f3[_0xd720('0x2f')],_0x1340f3['query']);_0x300dc2[_0xd720('0x30')]=_[_0xd720('0x31')](_0x1340f3[_0xd720('0x2f')],qs[_0xd720('0x32')](_0x518f8f[_0xd720('0x2c')]['fields']));_0x300dc2[_0xd720('0x30')]=_0x300dc2[_0xd720('0x30')][_0xd720('0x40')]?_0x300dc2['attributes']:_0x1340f3[_0xd720('0x2f')];_0x300dc2[_0xd720('0x35')]=qs[_0xd720('0x36')](_0x518f8f[_0xd720('0x2c')][_0xd720('0x36')]);_0x300dc2[_0xd720('0x37')]=qs[_0xd720('0x2e')](_[_0xd720('0x48')](_0x518f8f[_0xd720('0x2c')],_0x1340f3[_0xd720('0x2e')]));if(_0x518f8f[_0xd720('0x2c')][_0xd720('0x38')]){_0x300dc2[_0xd720('0x37')]=_[_0xd720('0x39')](_0x300dc2[_0xd720('0x37')],{'$or':_[_0xd720('0x27')](_0x300dc2[_0xd720('0x30')],function(_0x309026){var _0x5c9ee2={};_0x5c9ee2[_0x309026]={'$like':'%'+_0x518f8f['query'][_0xd720('0x38')]+'%'};return _0x5c9ee2;})});}_0x300dc2=_['merge']({},_0x300dc2,_0x518f8f['options']);return _0x432a9d[_0xd720('0x46')](_0x300dc2);}})[_0xd720('0x21')](function(_0x5872af){if(_0x5872af){_0x211aad=_0x5872af[_0xd720('0x40')];if(!_0x518f8f[_0xd720('0x2c')][_0xd720('0x33')]('nolimit')){_0x300dc2[_0xd720('0x19')]=qs[_0xd720('0x19')](_0x518f8f[_0xd720('0x2c')]['limit']);_0x300dc2[_0xd720('0x17')]=qs[_0xd720('0x17')](_0x518f8f[_0xd720('0x2c')][_0xd720('0x17')]);}return _0x432a9d['getConfigurations'](_0x300dc2);}})[_0xd720('0x21')](function(_0x3e5cf9){if(_0x3e5cf9){return _0x3e5cf9?{'count':_0x211aad,'rows':_0x3e5cf9}:null;}})[_0xd720('0x21')](respondWithResult(_0x7fd1aa,null))['catch'](handleError(_0x7fd1aa,null));};exports['addConfiguration']=function(_0x486c41,_0x5927e3,_0xa9261){if(_0x486c41[_0xd720('0x43')]['id']){delete _0x486c41[_0xd720('0x43')]['id'];}return db[_0xd720('0x3f')][_0xd720('0x47')]({'where':{'id':_0x486c41['params']['id']}})[_0xd720('0x21')](handleEntityNotFound(_0x5927e3,null))[_0xd720('0x21')](function(_0x40480b){if(_0x40480b){_0x486c41['body'][_0xd720('0x49')]=_0x40480b['id'];_0x486c41[_0xd720('0x43')][_0xd720('0x4a')]=integrations[_0xd720('0x4b')](_0x486c41['body'][_0xd720('0x4c')],_0x486c41[_0xd720('0x43')][_0xd720('0x2a')]);_0x486c41[_0xd720('0x43')]['Descriptions']=integrations[_0xd720('0x4d')](_0x486c41[_0xd720('0x43')]['channel'],_0x486c41[_0xd720('0x43')][_0xd720('0x2a')]);return db[_0xd720('0x4e')]['create'](_0x486c41[_0xd720('0x43')],{'include':[{'model':db[_0xd720('0x4f')],'as':_0xd720('0x4a')},{'model':db[_0xd720('0x4f')],'as':'Descriptions'}]});}return null;})[_0xd720('0x21')](respondWithResult(_0x5927e3,null))[_0xd720('0x3d')](handleError(_0x5927e3,null));};function getAccessToken(_0xcc2a5c){return new Promise(function(_0x131b03,_0xf31448){var _0x422f01;switch(_0xcc2a5c['zone']){case'US':_0x422f01='https://accounts.zoho.com';break;case'AU':_0x422f01=_0xd720('0x50');break;case'EU':_0x422f01='https://accounts.zoho.eu';break;case'IN':_0x422f01=_0xd720('0x51');break;case'CN':_0x422f01=_0xd720('0x52');break;default:_0x422f01=_0xd720('0x53');break;}var _0x6fdd9d={'method':_0xd720('0x54'),'uri':_0x422f01+_0xd720('0x55'),'qs':{'refresh_token':_0xcc2a5c['refreshToken'],'client_id':_0xcc2a5c[_0xd720('0x56')],'client_secret':_0xcc2a5c[_0xd720('0x57')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x6fdd9d)['then'](function(_0x12fe2a){if(_0x12fe2a[_0xd720('0x58')]){_0x131b03(_0x12fe2a[_0xd720('0x58')]);}else{_0xf31448(_0xd720('0x59'));}})[_0xd720('0x3d')](function(_0x3904a7){_0xf31448(_0x3904a7);});});}exports[_0xd720('0x5a')]=function(_0x5007db,_0x4c2c9a,_0xeafec4){var _0x52b3a9,_0x490769,_0x14a6e3,_0x3c90ca,_0x20df61;return db[_0xd720('0x3f')]['findOne']({'where':{'id':_0x5007db[_0xd720('0x3e')]['id']},'attributes':['id','host',_0xd720('0x5b'),_0xd720('0x56'),_0xd720('0x57'),_0xd720('0x5c'),_0xd720('0x5d'),'refreshToken']})[_0xd720('0x21')](handleEntityNotFound(_0x4c2c9a,null))['then'](function(_0x3b5ed9){_0x20df61=_0x3b5ed9;_0x52b3a9=_0x20df61['host'];_0x490769=_0x52b3a9==='zoho.eu'?'eu':'com';_0x14a6e3=_0x20df61[_0xd720('0x5c')];var _0x12a16b=_0x14a6e3[_0xd720('0x5e')](-0x1);if(_0x12a16b==='/'||_0x12a16b==='\x5c'||_0x12a16b===':'){_0x14a6e3=_0x14a6e3[_0xd720('0x5f')](0x0,_0x14a6e3['lastIndexOf'](_0x12a16b));}if(!_0x20df61['refreshToken']){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x20df61);})['then'](function(_0x132c5d){if(_0x132c5d){return rp({'method':_0xd720('0x60'),'uri':util[_0xd720('0x61')](_0xd720('0x62'),_0x490769),'qs':{'module':'Calls'},'headers':{'Authorization':_0xd720('0x63')+_0x132c5d},'json':!![]});}})['then'](function(_0xc69f1e){if(_0xc69f1e){if(_0xc69f1e['response']&&_0xc69f1e[_0xd720('0x64')]['error']){throw new Error(_0xc69f1e[_0xd720('0x64')]['error'][_0xd720('0x65')]);}var _0x2ebc77=[];var _0x59e976=[];var _0xea70ca=['Owner',_0xd720('0x66'),_0xd720('0x67'),_0xd720('0x68'),_0xd720('0x69'),_0xd720('0x6a'),_0xd720('0x6b'),_0xd720('0x6c')];_0x59e976=_['remove'](_0xc69f1e[_0xd720('0x32')],function(_0x358ab3){return _0xea70ca[_0xd720('0x6d')](_0x358ab3['api_name']);});for(var _0x45c16e=0x0;_0x45c16e<_0x59e976[_0xd720('0x40')];_0x45c16e++){if(_0x59e976[_0x45c16e][_0xd720('0x6e')]===![]){_0x2ebc77['push']({'id':_0x59e976[_0x45c16e]['id'],'name':_0x59e976[_0x45c16e][_0xd720('0x6f')],'custom':_0x59e976[_0x45c16e][_0xd720('0x70')],'options':_0x59e976[_0x45c16e][_0xd720('0x71')]==='picklist'&&_0x59e976[_0x45c16e][_0xd720('0x72')][_0xd720('0x40')]>-0x1?_['map'](_0x59e976[_0x45c16e][_0xd720('0x72')],function(_0x249ec0){return{'name':_0x249ec0,'value':_0x249ec0};}):[]});}}return{'count':_0x2ebc77[_0xd720('0x40')],'rows':_0x2ebc77};}else{return{'count':0x0,'rows':[]};}})[_0xd720('0x21')](respondWithResult(_0x4c2c9a,null))['catch'](function(_0x46e9cc){var _0x6ca3a1=_0x5007db[_0xd720('0x2c')]['test']?0x1f4:_0x46e9cc['statusCode']||0x1f4;logger[_0xd720('0x22')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x6ca3a1,JSON[_0xd720('0x73')](_0x46e9cc));delete _0x46e9cc[_0xd720('0x24')];if(_0x6ca3a1===0x191){_0x6ca3a1=0x190;}_0x4c2c9a[_0xd720('0x15')](_0x6ca3a1)[_0xd720('0x25')](_0x5007db[_0xd720('0x2c')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x46e9cc[_0xd720('0x74')]}:_0x46e9cc);});};
\ No newline at end of file
+var _0x3116=['params','getConfigurations','findOne','ZohoConfiguration','sort','filter','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','ZohoField','Subjects','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','access_token','getFields','host','clientSecret','serverUrl','code','zoho.eu','com','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Zoho-oauthtoken\x20','response','error','message','Owner','Description','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','api_name','system_mandatory','display_label','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','name','index','map','ZohoAccount','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','pick','merge','where','type','VIRTUAL','options','includeAll','include','findAll','catch','find','create','body'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3116,0x1c5));var _0x6311=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x3116[_0x3e112d];return _0x531c31;};'use strict';var emlformat=require(_0x6311('0x0'));var rimraf=require(_0x6311('0x1'));var zipdir=require(_0x6311('0x2'));var jsonpatch=require(_0x6311('0x3'));var rp=require(_0x6311('0x4'));var moment=require(_0x6311('0x5'));var BPromise=require(_0x6311('0x6'));var Mustache=require('mustache');var util=require(_0x6311('0x7'));var path=require(_0x6311('0x8'));var sox=require('sox');var csv=require(_0x6311('0x9'));var ejs=require(_0x6311('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6311('0xb'));var squel=require(_0x6311('0xc'));var crypto=require(_0x6311('0xd'));var jsforce=require(_0x6311('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6311('0x9'));var querystring=require(_0x6311('0xf'));var Papa=require(_0x6311('0x10'));var Redis=require(_0x6311('0x11'));var authService=require(_0x6311('0x12'));var qs=require(_0x6311('0x13'));var as=require(_0x6311('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6311('0x15'));var utils=require(_0x6311('0x16'));var config=require(_0x6311('0x17'));var licenseUtil=require(_0x6311('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x6311('0x19'));function respondWithStatusCode(_0x3779ce,_0x2dbdce){_0x2dbdce=_0x2dbdce||0xcc;return function(_0x5155d3){if(_0x5155d3){return _0x3779ce[_0x6311('0x1a')](_0x2dbdce);}return _0x3779ce[_0x6311('0x1b')](_0x2dbdce)['end']();};}function respondWithResult(_0x4eb23f,_0x156492){_0x156492=_0x156492||0xc8;return function(_0x3b61bc){if(_0x3b61bc){return _0x4eb23f['status'](_0x156492)['json'](_0x3b61bc);}};}function respondWithFilteredResult(_0x5b22dc,_0x4f3494){return function(_0x712101){if(_0x712101){var _0xdb47b7=typeof _0x4f3494[_0x6311('0x1c')]==='undefined'&&typeof _0x4f3494[_0x6311('0x1d')]===_0x6311('0x1e');var _0x3dd39d=_0x712101[_0x6311('0x1f')];var _0x589489=_0xdb47b7?0x0:_0x4f3494[_0x6311('0x1c')];var _0x5d483f=_0xdb47b7?_0x712101[_0x6311('0x1f')]:_0x4f3494['offset']+_0x4f3494['limit'];var _0x226233;if(_0x5d483f>=_0x3dd39d){_0x5d483f=_0x3dd39d;_0x226233=0xc8;}else{_0x226233=0xce;}_0x5b22dc[_0x6311('0x1b')](_0x226233);return _0x5b22dc[_0x6311('0x20')](_0x6311('0x21'),_0x589489+'-'+_0x5d483f+'/'+_0x3dd39d)['json'](_0x712101);}return null;};}function patchUpdates(_0x26f110){return function(_0x3a80a9){try{jsonpatch[_0x6311('0x22')](_0x3a80a9,_0x26f110,!![]);}catch(_0x495111){return BPromise[_0x6311('0x23')](_0x495111);}return _0x3a80a9[_0x6311('0x24')]();};}function saveUpdates(_0x5b1f0d,_0x551f70){return function(_0x3e6e53){if(_0x3e6e53){return _0x3e6e53[_0x6311('0x25')](_0x5b1f0d)[_0x6311('0x26')](function(_0x4bc06d){return _0x4bc06d;});}return null;};}function removeEntity(_0x30e254,_0x5047a7){return function(_0x44ed4b){if(_0x44ed4b){return _0x44ed4b[_0x6311('0x27')]()[_0x6311('0x26')](function(){_0x30e254[_0x6311('0x1b')](0xcc)[_0x6311('0x28')]();});}};}function handleEntityNotFound(_0x83c01b,_0x17c414){return function(_0x2b9bfa){if(!_0x2b9bfa){_0x83c01b['sendStatus'](0x194);}return _0x2b9bfa;};}function handleError(_0x513d36,_0x4c7142){_0x4c7142=_0x4c7142||0x1f4;return function(_0xb8ea54){logger['error'](_0xb8ea54['stack']);if(_0xb8ea54[_0x6311('0x29')]){delete _0xb8ea54[_0x6311('0x29')];}_0x513d36[_0x6311('0x1b')](_0x4c7142)['send'](_0xb8ea54);};}exports[_0x6311('0x2a')]=function(_0x5565ac,_0x6e0dca){var _0x21fdcc={},_0x51fd59={},_0x2155c0={'count':0x0,'rows':[]};var _0x2d1848=_[_0x6311('0x2b')](db[_0x6311('0x2c')][_0x6311('0x2d')],function(_0x36c69e){return{'name':_0x36c69e[_0x6311('0x2e')],'type':_0x36c69e['type'][_0x6311('0x2f')]};});_0x51fd59['model']=_[_0x6311('0x2b')](_0x2d1848,_0x6311('0x29'));_0x51fd59['query']=_[_0x6311('0x30')](_0x5565ac[_0x6311('0x31')]);_0x51fd59[_0x6311('0x32')]=_[_0x6311('0x33')](_0x51fd59[_0x6311('0x34')],_0x51fd59['query']);_0x21fdcc[_0x6311('0x35')]=_[_0x6311('0x33')](_0x51fd59[_0x6311('0x34')],qs[_0x6311('0x36')](_0x5565ac['query'][_0x6311('0x36')]));_0x21fdcc[_0x6311('0x35')]=_0x21fdcc[_0x6311('0x35')][_0x6311('0x37')]?_0x21fdcc[_0x6311('0x35')]:_0x51fd59[_0x6311('0x34')];if(!_0x5565ac[_0x6311('0x31')]['hasOwnProperty'](_0x6311('0x38'))){_0x21fdcc['limit']=qs[_0x6311('0x1d')](_0x5565ac[_0x6311('0x31')][_0x6311('0x1d')]);_0x21fdcc[_0x6311('0x1c')]=qs[_0x6311('0x1c')](_0x5565ac[_0x6311('0x31')][_0x6311('0x1c')]);}_0x21fdcc[_0x6311('0x39')]=qs['sort'](_0x5565ac[_0x6311('0x31')]['sort']);_0x21fdcc['where']=qs[_0x6311('0x32')](_[_0x6311('0x3a')](_0x5565ac[_0x6311('0x31')],_0x51fd59['filters']),_0x2d1848);if(_0x5565ac[_0x6311('0x31')]['filter']){_0x21fdcc['where']=_[_0x6311('0x3b')](_0x21fdcc[_0x6311('0x3c')],{'$or':_[_0x6311('0x2b')](_0x2d1848,function(_0x10d8f7){if(_0x10d8f7[_0x6311('0x3d')]!==_0x6311('0x3e')){var _0x218901={};_0x218901[_0x10d8f7['name']]={'$like':'%'+_0x5565ac['query']['filter']+'%'};return _0x218901;}})});}_0x21fdcc=_[_0x6311('0x3b')]({},_0x21fdcc,_0x5565ac[_0x6311('0x3f')]);var _0x1c8053={'where':_0x21fdcc['where']};return db[_0x6311('0x2c')]['count'](_0x1c8053)['then'](function(_0x56cdb0){_0x2155c0[_0x6311('0x1f')]=_0x56cdb0;if(_0x5565ac['query'][_0x6311('0x40')]){_0x21fdcc[_0x6311('0x41')]=[{'all':!![]}];}return db[_0x6311('0x2c')][_0x6311('0x42')](_0x21fdcc);})[_0x6311('0x26')](function(_0x2eaed6){_0x2155c0['rows']=_0x2eaed6;return _0x2155c0;})[_0x6311('0x26')](respondWithFilteredResult(_0x6e0dca,_0x21fdcc))[_0x6311('0x43')](handleError(_0x6e0dca,null));};exports['show']=function(_0x486cc0,_0x107383){var _0x356988={'raw':![],'where':{'id':_0x486cc0['params']['id']}},_0x48ae6d={};_0x48ae6d[_0x6311('0x34')]=_[_0x6311('0x30')](db[_0x6311('0x2c')]['rawAttributes']);_0x48ae6d[_0x6311('0x31')]=_[_0x6311('0x30')](_0x486cc0[_0x6311('0x31')]);_0x48ae6d['filters']=_[_0x6311('0x33')](_0x48ae6d['model'],_0x48ae6d[_0x6311('0x31')]);_0x356988[_0x6311('0x35')]=_['intersection'](_0x48ae6d['model'],qs['fields'](_0x486cc0[_0x6311('0x31')][_0x6311('0x36')]));_0x356988[_0x6311('0x35')]=_0x356988[_0x6311('0x35')][_0x6311('0x37')]?_0x356988[_0x6311('0x35')]:_0x48ae6d[_0x6311('0x34')];if(_0x486cc0[_0x6311('0x31')][_0x6311('0x40')]){_0x356988[_0x6311('0x41')]=[{'all':!![]}];}_0x356988=_[_0x6311('0x3b')]({},_0x356988,_0x486cc0[_0x6311('0x3f')]);return db[_0x6311('0x2c')][_0x6311('0x44')](_0x356988)[_0x6311('0x26')](handleEntityNotFound(_0x107383,null))[_0x6311('0x26')](respondWithResult(_0x107383,null))[_0x6311('0x43')](handleError(_0x107383,null));};exports['create']=function(_0x57e8b4,_0x5988b1){return db[_0x6311('0x2c')][_0x6311('0x45')](_0x57e8b4[_0x6311('0x46')],{})[_0x6311('0x26')](respondWithResult(_0x5988b1,0xc9))[_0x6311('0x43')](handleError(_0x5988b1,null));};exports[_0x6311('0x25')]=function(_0x19a09c,_0x2d4062){if(_0x19a09c[_0x6311('0x46')]['id']){delete _0x19a09c[_0x6311('0x46')]['id'];}return db['ZohoAccount'][_0x6311('0x44')]({'where':{'id':_0x19a09c[_0x6311('0x47')]['id']}})[_0x6311('0x26')](handleEntityNotFound(_0x2d4062,null))['then'](saveUpdates(_0x19a09c['body'],null))[_0x6311('0x26')](respondWithResult(_0x2d4062,null))[_0x6311('0x43')](handleError(_0x2d4062,null));};exports[_0x6311('0x27')]=function(_0x560263,_0x16eeab){return db[_0x6311('0x2c')][_0x6311('0x44')]({'where':{'id':_0x560263[_0x6311('0x47')]['id']}})[_0x6311('0x26')](handleEntityNotFound(_0x16eeab,null))[_0x6311('0x26')](removeEntity(_0x16eeab,null))['catch'](handleError(_0x16eeab,null));};exports[_0x6311('0x48')]=function(_0xb19b11,_0x55cda3,_0xda8457){var _0x18806c={};var _0x4dae77={};var _0x1e4357;var _0x31bfdb;return db[_0x6311('0x2c')][_0x6311('0x49')]({'where':{'id':_0xb19b11[_0x6311('0x47')]['id']}})[_0x6311('0x26')](handleEntityNotFound(_0x55cda3,null))[_0x6311('0x26')](function(_0x3c12b7){if(_0x3c12b7){_0x1e4357=_0x3c12b7;_0x4dae77['model']=_['keys'](db[_0x6311('0x4a')][_0x6311('0x2d')]);_0x4dae77[_0x6311('0x31')]=_[_0x6311('0x30')](_0xb19b11[_0x6311('0x31')]);_0x4dae77[_0x6311('0x32')]=_[_0x6311('0x33')](_0x4dae77['model'],_0x4dae77[_0x6311('0x31')]);_0x18806c[_0x6311('0x35')]=_['intersection'](_0x4dae77['model'],qs[_0x6311('0x36')](_0xb19b11['query'][_0x6311('0x36')]));_0x18806c[_0x6311('0x35')]=_0x18806c['attributes'][_0x6311('0x37')]?_0x18806c['attributes']:_0x4dae77['model'];_0x18806c['order']=qs[_0x6311('0x4b')](_0xb19b11[_0x6311('0x31')][_0x6311('0x4b')]);_0x18806c[_0x6311('0x3c')]=qs[_0x6311('0x32')](_['pick'](_0xb19b11[_0x6311('0x31')],_0x4dae77['filters']));if(_0xb19b11[_0x6311('0x31')][_0x6311('0x4c')]){_0x18806c[_0x6311('0x3c')]=_[_0x6311('0x3b')](_0x18806c[_0x6311('0x3c')],{'$or':_['map'](_0x18806c['attributes'],function(_0x5b443c){var _0x5e8ad5={};_0x5e8ad5[_0x5b443c]={'$like':'%'+_0xb19b11[_0x6311('0x31')][_0x6311('0x4c')]+'%'};return _0x5e8ad5;})});}_0x18806c=_[_0x6311('0x3b')]({},_0x18806c,_0xb19b11[_0x6311('0x3f')]);return _0x1e4357[_0x6311('0x48')](_0x18806c);}})[_0x6311('0x26')](function(_0x2a53a9){if(_0x2a53a9){_0x31bfdb=_0x2a53a9[_0x6311('0x37')];if(!_0xb19b11[_0x6311('0x31')][_0x6311('0x4d')](_0x6311('0x38'))){_0x18806c[_0x6311('0x1d')]=qs[_0x6311('0x1d')](_0xb19b11[_0x6311('0x31')][_0x6311('0x1d')]);_0x18806c['offset']=qs[_0x6311('0x1c')](_0xb19b11[_0x6311('0x31')][_0x6311('0x1c')]);}return _0x1e4357[_0x6311('0x48')](_0x18806c);}})[_0x6311('0x26')](function(_0x17cd51){if(_0x17cd51){return _0x17cd51?{'count':_0x31bfdb,'rows':_0x17cd51}:null;}})['then'](respondWithResult(_0x55cda3,null))['catch'](handleError(_0x55cda3,null));};exports[_0x6311('0x4e')]=function(_0x502ad7,_0x57e55b,_0xad5669){if(_0x502ad7[_0x6311('0x46')]['id']){delete _0x502ad7['body']['id'];}return db[_0x6311('0x2c')]['findOne']({'where':{'id':_0x502ad7[_0x6311('0x47')]['id']}})[_0x6311('0x26')](handleEntityNotFound(_0x57e55b,null))[_0x6311('0x26')](function(_0x45b0c1){if(_0x45b0c1){_0x502ad7[_0x6311('0x46')][_0x6311('0x4f')]=_0x45b0c1['id'];_0x502ad7['body']['Subjects']=integrations[_0x6311('0x50')](_0x502ad7[_0x6311('0x46')][_0x6311('0x51')],_0x502ad7[_0x6311('0x46')][_0x6311('0x3d')]);_0x502ad7[_0x6311('0x46')][_0x6311('0x52')]=integrations[_0x6311('0x53')](_0x502ad7[_0x6311('0x46')][_0x6311('0x51')],_0x502ad7['body'][_0x6311('0x3d')]);return db['ZohoConfiguration']['create'](_0x502ad7[_0x6311('0x46')],{'include':[{'model':db[_0x6311('0x54')],'as':_0x6311('0x55')},{'model':db[_0x6311('0x54')],'as':_0x6311('0x52')}]});}return null;})[_0x6311('0x26')](respondWithResult(_0x57e55b,null))['catch'](handleError(_0x57e55b,null));};function getAccessToken(_0x4bb8c4){return new Promise(function(_0x4b81ab,_0xc2c414){var _0x4d6331;switch(_0x4bb8c4[_0x6311('0x56')]){case'US':_0x4d6331=_0x6311('0x57');break;case'AU':_0x4d6331=_0x6311('0x58');break;case'EU':_0x4d6331=_0x6311('0x59');break;case'IN':_0x4d6331='https://accounts.zoho.in';break;case'CN':_0x4d6331='https://accounts.zoho.com.cn';break;default:_0x4d6331=_0x6311('0x59');break;}var _0x18f974={'method':_0x6311('0x5a'),'uri':_0x4d6331+_0x6311('0x5b'),'qs':{'refresh_token':_0x4bb8c4[_0x6311('0x5c')],'client_id':_0x4bb8c4[_0x6311('0x5d')],'client_secret':_0x4bb8c4['clientSecret'],'grant_type':_0x6311('0x5e')},'json':!![]};return rp(_0x18f974)[_0x6311('0x26')](function(_0x7d9316){if(_0x7d9316[_0x6311('0x5f')]){_0x4b81ab(_0x7d9316[_0x6311('0x5f')]);}else{_0xc2c414('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x6311('0x43')](function(_0x436368){_0xc2c414(_0x436368);});});}exports[_0x6311('0x60')]=function(_0x233312,_0x4f1e79,_0x5016ac){var _0x4fda41,_0x3feb9c,_0x4f8a91,_0x24e0a,_0x23ddb4;return db[_0x6311('0x2c')][_0x6311('0x49')]({'where':{'id':_0x233312[_0x6311('0x47')]['id']},'attributes':['id',_0x6311('0x61'),_0x6311('0x56'),'clientId',_0x6311('0x62'),_0x6311('0x63'),_0x6311('0x64'),_0x6311('0x5c')]})[_0x6311('0x26')](handleEntityNotFound(_0x4f1e79,null))[_0x6311('0x26')](function(_0xd5f993){_0x23ddb4=_0xd5f993;_0x4fda41=_0x23ddb4[_0x6311('0x61')];_0x3feb9c=_0x4fda41===_0x6311('0x65')?'eu':_0x6311('0x66');_0x4f8a91=_0x23ddb4['serverUrl'];var _0x2f0038=_0x4f8a91[_0x6311('0x67')](-0x1);if(_0x2f0038==='/'||_0x2f0038==='\x5c'||_0x2f0038===':'){_0x4f8a91=_0x4f8a91['substring'](0x0,_0x4f8a91[_0x6311('0x68')](_0x2f0038));}if(!_0x23ddb4['refreshToken']){throw new Error(_0x6311('0x69'));}return getAccessToken(_0x23ddb4);})['then'](function(_0x1a849a){if(_0x1a849a){return rp({'method':_0x6311('0x6a'),'uri':util[_0x6311('0x6b')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x3feb9c),'qs':{'module':'Calls'},'headers':{'Authorization':_0x6311('0x6c')+_0x1a849a},'json':!![]});}})[_0x6311('0x26')](function(_0x17a239){if(_0x17a239){if(_0x17a239['response']&&_0x17a239[_0x6311('0x6d')][_0x6311('0x6e')]){throw new Error(_0x17a239[_0x6311('0x6d')][_0x6311('0x6e')][_0x6311('0x6f')]);}var _0x5c1e80=[];var _0x1f7b49=[];var _0x6ffe98=[_0x6311('0x70'),'Subject',_0x6311('0x71'),'WhoId',_0x6311('0x72'),_0x6311('0x73'),_0x6311('0x74'),_0x6311('0x75')];_0x1f7b49=_[_0x6311('0x76')](_0x17a239[_0x6311('0x36')],function(_0x28d48d){return _0x6ffe98['includes'](_0x28d48d[_0x6311('0x77')]);});for(var _0x4d7f5d=0x0;_0x4d7f5d<_0x1f7b49[_0x6311('0x37')];_0x4d7f5d++){if(_0x1f7b49[_0x4d7f5d][_0x6311('0x78')]===![]){_0x5c1e80['push']({'id':_0x1f7b49[_0x4d7f5d]['id'],'name':_0x1f7b49[_0x4d7f5d][_0x6311('0x79')],'custom':_0x1f7b49[_0x4d7f5d]['custom_field'],'options':_0x1f7b49[_0x4d7f5d][_0x6311('0x7a')]===_0x6311('0x7b')&&_0x1f7b49[_0x4d7f5d][_0x6311('0x7c')]['length']>-0x1?_['map'](_0x1f7b49[_0x4d7f5d][_0x6311('0x7c')],function(_0x98cd6f){return{'name':_0x98cd6f,'value':_0x98cd6f};}):[]});}}return{'count':_0x5c1e80[_0x6311('0x37')],'rows':_0x5c1e80};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x4f1e79,null))['catch'](function(_0x5b91be){var _0x215bdd=_0x233312[_0x6311('0x31')][_0x6311('0x7d')]?0x1f4:_0x5b91be[_0x6311('0x7e')]||0x1f4;logger[_0x6311('0x6e')](_0x6311('0x7f'),_0x6311('0x60'),_0x215bdd,JSON[_0x6311('0x80')](_0x5b91be));delete _0x5b91be[_0x6311('0x29')];if(_0x215bdd===0x191){_0x215bdd=0x190;}_0x4f1e79[_0x6311('0x1b')](_0x215bdd)[_0x6311('0x81')](_0x233312[_0x6311('0x31')][_0x6311('0x7d')]?{'message':_0x6311('0x82'),'statusCode':_0x5b91be[_0x6311('0x7e')]}:_0x5b91be);});};
\ No newline at end of file
index 6898177..94eb6c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb8a=['name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','host','substring','lastIndexOf','parse','refresh_token','lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','code','slice','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','authorization_code','application/x-www-form-urlencoded','then','refreshToken','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d'];(function(_0x263ac8,_0xf75a48){var _0x37196f=function(_0x3f9652){while(--_0x3f9652){_0x263ac8['push'](_0x263ac8['shift']());}};_0x37196f(++_0xf75a48);}(_0xeb8a,0x18d));var _0xaeb8=function(_0x31a004,_0x52a3c4){_0x31a004=_0x31a004-0x0;var _0x5bc6bc=_0xeb8a[_0x31a004];return _0x5bc6bc;};'use strict';var _=require(_0xaeb8('0x0'));var util=require('util');var logger=require(_0xaeb8('0x1'))(_0xaeb8('0x2'));var moment=require(_0xaeb8('0x3'));var BPromise=require('bluebird');var rp=require(_0xaeb8('0x4'));var fs=require('fs');var path=require(_0xaeb8('0x5'));var rimraf=require('rimraf');var config=require(_0xaeb8('0x6'));var attributes=require(_0xaeb8('0x7'));var integrations=require(_0xaeb8('0x8'));module[_0xaeb8('0x9')]=function(_0x511b44,_0x241d8b){return _0x511b44[_0xaeb8('0xa')](_0xaeb8('0xb'),attributes,{'tableName':_0xaeb8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4252f3,_0x5c4308,_0x45cbd6){if(_0x4252f3[_0xaeb8('0xd')](_0xaeb8('0xe'))||_0x4252f3[_0xaeb8('0xd')](_0xaeb8('0xf'))||_0x4252f3['changed'](_0xaeb8('0x10'))||_0x4252f3[_0xaeb8('0xd')](_0xaeb8('0x11'))||_0x4252f3[_0xaeb8('0xd')](_0xaeb8('0x12'))||_0x4252f3[_0xaeb8('0xd')]('host')){var _0x5c7ef7,_0x4bec6b;_0x5c7ef7=_0x4252f3[_0xaeb8('0xf')];var _0x54458e=_0x5c7ef7[_0xaeb8('0x13')](-0x1);if(_0x54458e==='/'||_0x54458e==='\x5c'||_0x54458e===':'){_0x5c7ef7=_0x5c7ef7['substring'](0x0,_0x5c7ef7['lastIndexOf'](_0x54458e));}switch(_0x4252f3[_0xaeb8('0xe')]){case'US':_0x4bec6b=_0xaeb8('0x14');break;case'AU':_0x4bec6b=_0xaeb8('0x15');break;case'IN':_0x4bec6b=_0xaeb8('0x16');break;case'CN':_0x4bec6b=_0xaeb8('0x17');break;default:_0x4bec6b=_0xaeb8('0x18');break;}var _0x7362cd={'method':_0xaeb8('0x19'),'uri':_0x4bec6b+_0xaeb8('0x1a'),'form':{'grant_type':_0xaeb8('0x1b'),'client_id':_0x4252f3['clientId'],'client_secret':_0x4252f3[_0xaeb8('0x11')],'redirect_uri':_0x4252f3['serverUrl'],'code':_0x4252f3['code']},'headers':{'Content-Type':_0xaeb8('0x1c')}};return rp(_0x7362cd)[_0xaeb8('0x1d')](function(_0x25bf35){var _0xf309f6=JSON['parse'](_0x25bf35);if(_0xf309f6['refresh_token']){_0x4252f3[_0xaeb8('0x1e')]=_0xf309f6['refresh_token'];logger['info'](util[_0xaeb8('0x1f')](_0xaeb8('0x20'),_0x4252f3[_0xaeb8('0x21')],_0x4252f3['id']));}else{logger[_0xaeb8('0x22')](util[_0xaeb8('0x1f')](_0xaeb8('0x23'),_0x4252f3[_0xaeb8('0x21')],_0x4252f3['id']),util[_0xaeb8('0x24')](_0xf309f6,{'showHidden':![],'depth':null}));}return _0x45cbd6(null,_0x5c4308);})[_0xaeb8('0x25')](function(_0xb6d17){logger[_0xaeb8('0x22')](util[_0xaeb8('0x1f')](_0xaeb8('0x23'),_0x4252f3[_0xaeb8('0x21')],_0x4252f3['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x45cbd6(_0xb6d17);});}else{return _0x45cbd6(null,_0x5c4308);}},'beforeUpdate':function(_0x1aa9c8,_0x5a2273,_0x56cffa){if(_0x1aa9c8[_0xaeb8('0xd')](_0xaeb8('0xe'))||_0x1aa9c8[_0xaeb8('0xd')](_0xaeb8('0xf'))||_0x1aa9c8[_0xaeb8('0xd')](_0xaeb8('0x10'))||_0x1aa9c8[_0xaeb8('0xd')](_0xaeb8('0x11'))||_0x1aa9c8[_0xaeb8('0xd')](_0xaeb8('0x12'))||_0x1aa9c8[_0xaeb8('0xd')](_0xaeb8('0x26'))){var _0x4146df,_0x1fddad;_0x4146df=_0x1aa9c8[_0xaeb8('0xf')];var _0x61e13a=_0x4146df[_0xaeb8('0x13')](-0x1);if(_0x61e13a==='/'||_0x61e13a==='\x5c'||_0x61e13a===':'){_0x4146df=_0x4146df[_0xaeb8('0x27')](0x0,_0x4146df[_0xaeb8('0x28')](_0x61e13a));}switch(_0x1aa9c8[_0xaeb8('0xe')]){case'US':_0x1fddad=_0xaeb8('0x14');break;case'AU':_0x1fddad='https://accounts.zoho.com.au';break;case'IN':_0x1fddad='https://accounts.zoho.in';break;case'CN':_0x1fddad='https://accounts.zoho.com.cn';break;default:_0x1fddad='https://accounts.zoho.eu';break;}var _0x4b2555={'method':'POST','uri':_0x1fddad+_0xaeb8('0x1a'),'form':{'grant_type':'authorization_code','client_id':_0x1aa9c8[_0xaeb8('0x10')],'client_secret':_0x1aa9c8[_0xaeb8('0x11')],'redirect_uri':_0x1aa9c8[_0xaeb8('0xf')],'code':_0x1aa9c8['code']},'headers':{'Content-Type':_0xaeb8('0x1c')}};return rp(_0x4b2555)[_0xaeb8('0x1d')](function(_0x37b430){var _0x1b40ab=JSON[_0xaeb8('0x29')](_0x37b430);if(_0x1b40ab['refresh_token']){_0x1aa9c8['refreshToken']=_0x1b40ab[_0xaeb8('0x2a')];logger['info'](util[_0xaeb8('0x1f')](_0xaeb8('0x20'),_0x1aa9c8[_0xaeb8('0x21')],_0x1aa9c8['id']));}else{logger[_0xaeb8('0x22')](util['format'](_0xaeb8('0x23'),_0x1aa9c8[_0xaeb8('0x21')],_0x1aa9c8['id']),util[_0xaeb8('0x24')](_0x1b40ab,{'showHidden':![],'depth':null}));}return _0x56cffa(null,_0x5a2273);})[_0xaeb8('0x25')](function(_0x522ba4){logger[_0xaeb8('0x22')](util[_0xaeb8('0x1f')](_0xaeb8('0x23'),_0x1aa9c8[_0xaeb8('0x21')],_0x1aa9c8['id']),util[_0xaeb8('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x56cffa(_0x522ba4);});}else{return _0x56cffa(null,_0x5a2273);}}}});};
\ No newline at end of file
+var _0x0b5a=['lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','zone','changed','serverUrl','clientId','code','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','authorization_code','clientSecret','then','parse','refresh_token','refreshToken','info','format','name','inspect','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','host','slice','https://accounts.zoho.com','https://accounts.zoho.com.cn','/oauth/v2/token','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','catch'];(function(_0x4e76b0,_0x3168de){var _0x5d5358=function(_0x57db2a){while(--_0x57db2a){_0x4e76b0['push'](_0x4e76b0['shift']());}};_0x5d5358(++_0x3168de);}(_0x0b5a,0x158));var _0xa0b5=function(_0x530385,_0xcbc622){_0x530385=_0x530385-0x0;var _0x425e01=_0x0b5a[_0x530385];return _0x425e01;};'use strict';var _=require(_0xa0b5('0x0'));var util=require(_0xa0b5('0x1'));var logger=require(_0xa0b5('0x2'))(_0xa0b5('0x3'));var moment=require(_0xa0b5('0x4'));var BPromise=require('bluebird');var rp=require(_0xa0b5('0x5'));var fs=require('fs');var path=require(_0xa0b5('0x6'));var rimraf=require('rimraf');var config=require(_0xa0b5('0x7'));var attributes=require(_0xa0b5('0x8'));var integrations=require(_0xa0b5('0x9'));module[_0xa0b5('0xa')]=function(_0x4b7505,_0x27e6cb){return _0x4b7505[_0xa0b5('0xb')](_0xa0b5('0xc'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x354ab4,_0x47e23d,_0x596124){if(_0x354ab4['changed'](_0xa0b5('0xd'))||_0x354ab4[_0xa0b5('0xe')](_0xa0b5('0xf'))||_0x354ab4[_0xa0b5('0xe')](_0xa0b5('0x10'))||_0x354ab4['changed']('clientSecret')||_0x354ab4[_0xa0b5('0xe')](_0xa0b5('0x11'))||_0x354ab4[_0xa0b5('0xe')]('host')){var _0x18db88,_0x276fea;_0x18db88=_0x354ab4[_0xa0b5('0xf')];var _0x552b5f=_0x18db88['slice'](-0x1);if(_0x552b5f==='/'||_0x552b5f==='\x5c'||_0x552b5f===':'){_0x18db88=_0x18db88[_0xa0b5('0x12')](0x0,_0x18db88[_0xa0b5('0x13')](_0x552b5f));}switch(_0x354ab4[_0xa0b5('0xd')]){case'US':_0x276fea='https://accounts.zoho.com';break;case'AU':_0x276fea=_0xa0b5('0x14');break;case'IN':_0x276fea=_0xa0b5('0x15');break;case'CN':_0x276fea='https://accounts.zoho.com.cn';break;default:_0x276fea=_0xa0b5('0x16');break;}var _0x1dc75e={'method':_0xa0b5('0x17'),'uri':_0x276fea+'/oauth/v2/token','form':{'grant_type':_0xa0b5('0x18'),'client_id':_0x354ab4['clientId'],'client_secret':_0x354ab4[_0xa0b5('0x19')],'redirect_uri':_0x354ab4[_0xa0b5('0xf')],'code':_0x354ab4[_0xa0b5('0x11')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x1dc75e)[_0xa0b5('0x1a')](function(_0x3d2b33){var _0x116392=JSON[_0xa0b5('0x1b')](_0x3d2b33);if(_0x116392[_0xa0b5('0x1c')]){_0x354ab4[_0xa0b5('0x1d')]=_0x116392[_0xa0b5('0x1c')];logger[_0xa0b5('0x1e')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x354ab4['name'],_0x354ab4['id']));}else{logger['error'](util[_0xa0b5('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x354ab4[_0xa0b5('0x20')],_0x354ab4['id']),util[_0xa0b5('0x21')](_0x116392,{'showHidden':![],'depth':null}));}return _0x596124(null,_0x47e23d);})['catch'](function(_0x18056e){logger[_0xa0b5('0x22')](util['format'](_0xa0b5('0x23'),_0x354ab4[_0xa0b5('0x20')],_0x354ab4['id']),util[_0xa0b5('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x596124(_0x18056e);});}else{return _0x596124(null,_0x47e23d);}},'beforeUpdate':function(_0x390d24,_0x14718b,_0x30ccb0){if(_0x390d24[_0xa0b5('0xe')]('zone')||_0x390d24['changed'](_0xa0b5('0xf'))||_0x390d24['changed']('clientId')||_0x390d24[_0xa0b5('0xe')](_0xa0b5('0x19'))||_0x390d24[_0xa0b5('0xe')](_0xa0b5('0x11'))||_0x390d24[_0xa0b5('0xe')](_0xa0b5('0x24'))){var _0x25c65f,_0x3ed5be;_0x25c65f=_0x390d24[_0xa0b5('0xf')];var _0x388c09=_0x25c65f[_0xa0b5('0x25')](-0x1);if(_0x388c09==='/'||_0x388c09==='\x5c'||_0x388c09===':'){_0x25c65f=_0x25c65f[_0xa0b5('0x12')](0x0,_0x25c65f[_0xa0b5('0x13')](_0x388c09));}switch(_0x390d24[_0xa0b5('0xd')]){case'US':_0x3ed5be=_0xa0b5('0x26');break;case'AU':_0x3ed5be=_0xa0b5('0x14');break;case'IN':_0x3ed5be=_0xa0b5('0x15');break;case'CN':_0x3ed5be=_0xa0b5('0x27');break;default:_0x3ed5be=_0xa0b5('0x16');break;}var _0x36d519={'method':'POST','uri':_0x3ed5be+_0xa0b5('0x28'),'form':{'grant_type':'authorization_code','client_id':_0x390d24[_0xa0b5('0x10')],'client_secret':_0x390d24[_0xa0b5('0x19')],'redirect_uri':_0x390d24[_0xa0b5('0xf')],'code':_0x390d24[_0xa0b5('0x11')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x36d519)['then'](function(_0x6bd9b8){var _0x297a2e=JSON[_0xa0b5('0x1b')](_0x6bd9b8);if(_0x297a2e['refresh_token']){_0x390d24[_0xa0b5('0x1d')]=_0x297a2e[_0xa0b5('0x1c')];logger['info'](util['format'](_0xa0b5('0x29'),_0x390d24[_0xa0b5('0x20')],_0x390d24['id']));}else{logger['error'](util[_0xa0b5('0x1f')](_0xa0b5('0x23'),_0x390d24[_0xa0b5('0x20')],_0x390d24['id']),util[_0xa0b5('0x21')](_0x297a2e,{'showHidden':![],'depth':null}));}return _0x30ccb0(null,_0x14718b);})[_0xa0b5('0x2a')](function(_0x160494){logger[_0xa0b5('0x22')](util['format'](_0xa0b5('0x23'),_0x390d24['name'],_0x390d24['id']),util[_0xa0b5('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x30ccb0(_0x160494);});}else{return _0x30ccb0(null,_0x14718b);}}}});};
\ No newline at end of file
index f37b55c..f4fac62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61f1=['findAll','options','raw','where','attributes','include','model','map','stringify','ShowZohoAccount','util','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetZohoAccount','ZohoAccount'];(function(_0x4ddfe1,_0x35939d){var _0x4aaf51=function(_0x1e99a0){while(--_0x1e99a0){_0x4ddfe1['push'](_0x4ddfe1['shift']());}};_0x4aaf51(++_0x35939d);}(_0x61f1,0x18a));var _0x161f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x61f1[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x161f('0x0'));var moment=require('moment');var BPromise=require(_0x161f('0x1'));var rs=require(_0x161f('0x2'));var fs=require('fs');var Redis=require(_0x161f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x161f('0x4'))(_0x161f('0x5'));var config=require('../../config/environment');var jayson=require(_0x161f('0x6'));var client=jayson[_0x161f('0x7')][_0x161f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xf8174c,_0xd1ad5d,_0x4ff5e1){return new BPromise(function(_0x910af4,_0x31f44e){return client[_0x161f('0x9')](_0xf8174c,_0x4ff5e1)[_0x161f('0xa')](function(_0x24bc8a){logger[_0x161f('0xb')](_0x161f('0xc'),_0xd1ad5d,_0x161f('0xd'));logger[_0x161f('0xe')](_0x161f('0xf'),_0xd1ad5d,_0x161f('0xd'),JSON['stringify'](_0x24bc8a));if(_0x24bc8a[_0x161f('0x10')]){if(_0x24bc8a[_0x161f('0x10')][_0x161f('0x11')]===0x1f4){logger[_0x161f('0x10')](_0x161f('0xc'),_0xd1ad5d,_0x24bc8a['error'][_0x161f('0x12')]);return _0x31f44e(_0x24bc8a[_0x161f('0x10')][_0x161f('0x12')]);}logger[_0x161f('0x10')]('ZohoAccount,\x20%s,\x20%s',_0xd1ad5d,_0x24bc8a[_0x161f('0x10')][_0x161f('0x12')]);return _0x910af4(_0x24bc8a[_0x161f('0x10')][_0x161f('0x12')]);}else{logger[_0x161f('0xb')](_0x161f('0xc'),_0xd1ad5d,'request\x20sent');_0x910af4(_0x24bc8a['result'][_0x161f('0x12')]);}})[_0x161f('0x13')](function(_0x189a95){logger['error'](_0x161f('0xc'),_0xd1ad5d,_0x189a95);_0x31f44e(_0x189a95);});});}exports[_0x161f('0x14')]=function(_0x2cf920){var _0x561a13=this;return new Promise(function(_0x420818,_0x5943e7){return db[_0x161f('0x15')][_0x161f('0x16')]({'raw':_0x2cf920[_0x161f('0x17')]?_0x2cf920[_0x161f('0x17')][_0x161f('0x18')]===undefined?!![]:![]:!![],'where':_0x2cf920[_0x161f('0x17')]?_0x2cf920[_0x161f('0x17')][_0x161f('0x19')]||null:null,'attributes':_0x2cf920[_0x161f('0x17')]?_0x2cf920[_0x161f('0x17')][_0x161f('0x1a')]||null:null,'limit':_0x2cf920[_0x161f('0x17')]?_0x2cf920[_0x161f('0x17')]['limit']||null:null,'include':_0x2cf920[_0x161f('0x17')]?_0x2cf920[_0x161f('0x17')][_0x161f('0x1b')]?_['map'](_0x2cf920['options'][_0x161f('0x1b')],function(_0xaf2a44){return{'model':db[_0xaf2a44[_0x161f('0x1c')]],'as':_0xaf2a44['as'],'attributes':_0xaf2a44[_0x161f('0x1a')],'include':_0xaf2a44[_0x161f('0x1b')]?_['map'](_0xaf2a44[_0x161f('0x1b')],function(_0x2b501f){return{'model':db[_0x2b501f[_0x161f('0x1c')]],'as':_0x2b501f['as'],'attributes':_0x2b501f['attributes'],'include':_0x2b501f[_0x161f('0x1b')]?_[_0x161f('0x1d')](_0x2b501f[_0x161f('0x1b')],function(_0x413c75){return{'model':db[_0x413c75[_0x161f('0x1c')]],'as':_0x413c75['as'],'attributes':_0x413c75[_0x161f('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x168b66){logger[_0x161f('0xb')](_0x161f('0x14'),_0x2cf920);logger[_0x161f('0xe')](_0x161f('0x14'),_0x2cf920,JSON[_0x161f('0x1e')](_0x168b66));_0x420818(_0x168b66);})['catch'](function(_0x18e910){logger[_0x161f('0x10')](_0x161f('0x14'),_0x18e910['message'],_0x2cf920);_0x5943e7(_0x561a13[_0x161f('0x10')](0x1f4,_0x18e910[_0x161f('0x12')]));});});};exports[_0x161f('0x1f')]=function(_0x389c45){var _0x27ebc7=this;return new Promise(function(_0x2f570e,_0x2bd3b0){return db[_0x161f('0x15')]['find']({'raw':_0x389c45['options']?_0x389c45[_0x161f('0x17')][_0x161f('0x18')]===undefined?!![]:![]:!![],'where':_0x389c45[_0x161f('0x17')]?_0x389c45['options']['where']||null:null,'attributes':_0x389c45['options']?_0x389c45[_0x161f('0x17')][_0x161f('0x1a')]||null:null,'include':_0x389c45['options']?_0x389c45[_0x161f('0x17')][_0x161f('0x1b')]?_[_0x161f('0x1d')](_0x389c45[_0x161f('0x17')]['include'],function(_0x3ea752){return{'model':db[_0x3ea752['model']],'as':_0x3ea752['as'],'attributes':_0x3ea752[_0x161f('0x1a')],'include':_0x3ea752[_0x161f('0x1b')]?_[_0x161f('0x1d')](_0x3ea752[_0x161f('0x1b')],function(_0x34a923){return{'model':db[_0x34a923[_0x161f('0x1c')]],'as':_0x34a923['as'],'attributes':_0x34a923[_0x161f('0x1a')],'include':_0x34a923[_0x161f('0x1b')]?_[_0x161f('0x1d')](_0x34a923[_0x161f('0x1b')],function(_0x4b90cb){return{'model':db[_0x4b90cb[_0x161f('0x1c')]],'as':_0x4b90cb['as'],'attributes':_0x4b90cb['attributes']};}):[]};}):[]};}):[]:[]})[_0x161f('0xa')](function(_0x2387da){logger['info'](_0x161f('0x1f'),_0x389c45);logger[_0x161f('0xe')](_0x161f('0x1f'),_0x389c45,JSON[_0x161f('0x1e')](_0x2387da));_0x2f570e(_0x2387da);})['catch'](function(_0xc63286){logger[_0x161f('0x10')]('ShowZohoAccount',_0xc63286['message'],_0x389c45);_0x2bd3b0(_0x27ebc7['error'](0x1f4,_0xc63286[_0x161f('0x12')]));});});};
\ No newline at end of file
+var _0x2250=['code','message','catch','GetZohoAccount','findAll','options','where','attributes','limit','include','model','map','ShowZohoAccount','find','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x2250,0x178));var _0x0225=function(_0x1eec3a,_0x168828){_0x1eec3a=_0x1eec3a-0x0;var _0x133cf7=_0x2250[_0x1eec3a];return _0x133cf7;};'use strict';var _=require(_0x0225('0x0'));var util=require(_0x0225('0x1'));var moment=require(_0x0225('0x2'));var BPromise=require(_0x0225('0x3'));var rs=require(_0x0225('0x4'));var fs=require('fs');var Redis=require(_0x0225('0x5'));var db=require(_0x0225('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0225('0x7'))(_0x0225('0x8'));var config=require(_0x0225('0x9'));var jayson=require(_0x0225('0xa'));var client=jayson[_0x0225('0xb')][_0x0225('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1a9fd5,_0x229c55,_0x4b8eda){return new BPromise(function(_0x331807,_0x5b87cc){return client['request'](_0x1a9fd5,_0x4b8eda)[_0x0225('0xd')](function(_0x1991b5){logger[_0x0225('0xe')](_0x0225('0xf'),_0x229c55,_0x0225('0x10'));logger['debug'](_0x0225('0x11'),_0x229c55,_0x0225('0x10'),JSON[_0x0225('0x12')](_0x1991b5));if(_0x1991b5[_0x0225('0x13')]){if(_0x1991b5['error'][_0x0225('0x14')]===0x1f4){logger['error'](_0x0225('0xf'),_0x229c55,_0x1991b5[_0x0225('0x13')]['message']);return _0x5b87cc(_0x1991b5[_0x0225('0x13')][_0x0225('0x15')]);}logger[_0x0225('0x13')](_0x0225('0xf'),_0x229c55,_0x1991b5[_0x0225('0x13')][_0x0225('0x15')]);return _0x331807(_0x1991b5[_0x0225('0x13')][_0x0225('0x15')]);}else{logger[_0x0225('0xe')](_0x0225('0xf'),_0x229c55,_0x0225('0x10'));_0x331807(_0x1991b5['result'][_0x0225('0x15')]);}})[_0x0225('0x16')](function(_0x59e455){logger[_0x0225('0x13')]('ZohoAccount,\x20%s,\x20%s',_0x229c55,_0x59e455);_0x5b87cc(_0x59e455);});});}exports[_0x0225('0x17')]=function(_0x424b5b){var _0x27ab34=this;return new Promise(function(_0x38534d,_0x1318bc){return db['ZohoAccount'][_0x0225('0x18')]({'raw':_0x424b5b['options']?_0x424b5b['options']['raw']===undefined?!![]:![]:!![],'where':_0x424b5b[_0x0225('0x19')]?_0x424b5b[_0x0225('0x19')][_0x0225('0x1a')]||null:null,'attributes':_0x424b5b[_0x0225('0x19')]?_0x424b5b[_0x0225('0x19')][_0x0225('0x1b')]||null:null,'limit':_0x424b5b[_0x0225('0x19')]?_0x424b5b['options'][_0x0225('0x1c')]||null:null,'include':_0x424b5b[_0x0225('0x19')]?_0x424b5b[_0x0225('0x19')]['include']?_['map'](_0x424b5b[_0x0225('0x19')]['include'],function(_0x58efd3){return{'model':db[_0x58efd3['model']],'as':_0x58efd3['as'],'attributes':_0x58efd3['attributes'],'include':_0x58efd3[_0x0225('0x1d')]?_['map'](_0x58efd3[_0x0225('0x1d')],function(_0xcb5384){return{'model':db[_0xcb5384[_0x0225('0x1e')]],'as':_0xcb5384['as'],'attributes':_0xcb5384[_0x0225('0x1b')],'include':_0xcb5384[_0x0225('0x1d')]?_[_0x0225('0x1f')](_0xcb5384[_0x0225('0x1d')],function(_0x5579ad){return{'model':db[_0x5579ad[_0x0225('0x1e')]],'as':_0x5579ad['as'],'attributes':_0x5579ad[_0x0225('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0225('0xd')](function(_0x32d45d){logger['info']('GetZohoAccount',_0x424b5b);logger['debug'](_0x0225('0x17'),_0x424b5b,JSON['stringify'](_0x32d45d));_0x38534d(_0x32d45d);})['catch'](function(_0x3d205c){logger['error'](_0x0225('0x17'),_0x3d205c['message'],_0x424b5b);_0x1318bc(_0x27ab34[_0x0225('0x13')](0x1f4,_0x3d205c['message']));});});};exports[_0x0225('0x20')]=function(_0x45ae3){var _0x3b793a=this;return new Promise(function(_0x391aed,_0x1353ff){return db['ZohoAccount'][_0x0225('0x21')]({'raw':_0x45ae3[_0x0225('0x19')]?_0x45ae3[_0x0225('0x19')][_0x0225('0x22')]===undefined?!![]:![]:!![],'where':_0x45ae3['options']?_0x45ae3[_0x0225('0x19')][_0x0225('0x1a')]||null:null,'attributes':_0x45ae3['options']?_0x45ae3[_0x0225('0x19')][_0x0225('0x1b')]||null:null,'include':_0x45ae3[_0x0225('0x19')]?_0x45ae3[_0x0225('0x19')][_0x0225('0x1d')]?_[_0x0225('0x1f')](_0x45ae3['options'][_0x0225('0x1d')],function(_0x59749a){return{'model':db[_0x59749a['model']],'as':_0x59749a['as'],'attributes':_0x59749a[_0x0225('0x1b')],'include':_0x59749a['include']?_['map'](_0x59749a[_0x0225('0x1d')],function(_0x52969c){return{'model':db[_0x52969c[_0x0225('0x1e')]],'as':_0x52969c['as'],'attributes':_0x52969c['attributes'],'include':_0x52969c[_0x0225('0x1d')]?_[_0x0225('0x1f')](_0x52969c[_0x0225('0x1d')],function(_0x59e00e){return{'model':db[_0x59e00e[_0x0225('0x1e')]],'as':_0x59e00e['as'],'attributes':_0x59e00e[_0x0225('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0225('0xd')](function(_0x18cd91){logger[_0x0225('0xe')](_0x0225('0x20'),_0x45ae3);logger[_0x0225('0x23')](_0x0225('0x20'),_0x45ae3,JSON['stringify'](_0x18cd91));_0x391aed(_0x18cd91);})['catch'](function(_0xc267cc){logger[_0x0225('0x13')](_0x0225('0x20'),_0xc267cc[_0x0225('0x15')],_0x45ae3);_0x1353ff(_0x3b793a[_0x0225('0x13')](0x1f4,_0xc267cc[_0x0225('0x15')]));});});};
\ No newline at end of file
index 6bbe38b..161ec8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe875=['show','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated'];(function(_0x6d8818,_0x5ccad0){var _0x545a0b=function(_0x35403d){while(--_0x35403d){_0x6d8818['push'](_0x6d8818['shift']());}};_0x545a0b(++_0x5ccad0);}(_0xe875,0xcc));var _0x5e87=function(_0x358eea,_0x2d7a1f){_0x358eea=_0x358eea-0x0;var _0x5332a5=_0xe875[_0x358eea];return _0x5332a5;};'use strict';var multer=require(_0x5e87('0x0'));var util=require('util');var path=require(_0x5e87('0x1'));var timeout=require(_0x5e87('0x2'));var express=require(_0x5e87('0x3'));var router=express[_0x5e87('0x4')]();var fs_extra=require(_0x5e87('0x5'));var auth=require(_0x5e87('0x6'));var interaction=require(_0x5e87('0x7'));var config=require(_0x5e87('0x8'));var controller=require(_0x5e87('0x9'));router[_0x5e87('0xa')]('/',auth[_0x5e87('0xb')](),controller['index']);router[_0x5e87('0xa')]('/:id',auth[_0x5e87('0xb')](),controller[_0x5e87('0xc')]);router[_0x5e87('0xa')]('/:id/fields',auth[_0x5e87('0xb')](),controller[_0x5e87('0xd')]);router[_0x5e87('0xa')](_0x5e87('0xe'),auth[_0x5e87('0xb')](),controller[_0x5e87('0xf')]);router['get'](_0x5e87('0x10'),auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth[_0x5e87('0xb')](),controller[_0x5e87('0x11')]);router[_0x5e87('0x12')](_0x5e87('0x13'),auth[_0x5e87('0xb')](),controller[_0x5e87('0x14')]);router[_0x5e87('0x15')](_0x5e87('0x13'),auth[_0x5e87('0xb')](),controller[_0x5e87('0x16')]);module[_0x5e87('0x17')]=router;
\ No newline at end of file
+var _0xfb3d=['express','Router','../../components/interaction/service','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','getSubjects','/:id/descriptions','getDescriptions','update','exports','connect-timeout'];(function(_0x4c56ff,_0xdc2249){var _0xa5d48d=function(_0x2e457e){while(--_0x2e457e){_0x4c56ff['push'](_0x4c56ff['shift']());}};_0xa5d48d(++_0xdc2249);}(_0xfb3d,0x10f));var _0xdfb3=function(_0x2a1e85,_0x5829f1){_0x2a1e85=_0x2a1e85-0x0;var _0x218ae9=_0xfb3d[_0x2a1e85];return _0x218ae9;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xdfb3('0x0'));var express=require(_0xdfb3('0x1'));var router=express[_0xdfb3('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdfb3('0x3'));var config=require('../../config/environment');var controller=require(_0xdfb3('0x4'));router[_0xdfb3('0x5')]('/',auth[_0xdfb3('0x6')](),controller[_0xdfb3('0x7')]);router[_0xdfb3('0x5')](_0xdfb3('0x8'),auth[_0xdfb3('0x6')](),controller[_0xdfb3('0x9')]);router[_0xdfb3('0x5')]('/:id/fields',auth['isAuthenticated'](),controller[_0xdfb3('0xa')]);router[_0xdfb3('0x5')]('/:id/subjects',auth[_0xdfb3('0x6')](),controller[_0xdfb3('0xb')]);router[_0xdfb3('0x5')](_0xdfb3('0xc'),auth[_0xdfb3('0x6')](),controller[_0xdfb3('0xd')]);router['post']('/',auth[_0xdfb3('0x6')](),controller['create']);router['put'](_0xdfb3('0x8'),auth[_0xdfb3('0x6')](),controller[_0xdfb3('0xe')]);router['delete'](_0xdfb3('0x8'),auth[_0xdfb3('0x6')](),controller['destroy']);module[_0xdfb3('0xf')]=router;
\ No newline at end of file
index 201a0f3..13f8304 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x619f=['contact','sequelize','exports','STRING','lead','nothing','ENUM'];(function(_0x2c18a8,_0x24eaa5){var _0x1e009a=function(_0x5dea3a){while(--_0x5dea3a){_0x2c18a8['push'](_0x2c18a8['shift']());}};_0x1e009a(++_0x24eaa5);}(_0x619f,0x14a));var _0xf619=function(_0x25d81b,_0x2e9ff5){_0x25d81b=_0x25d81b-0x0;var _0x1b1fdb=_0x619f[_0x25d81b];return _0x1b1fdb;};'use strict';var Sequelize=require(_0xf619('0x0'));module[_0xf619('0x1')]={'name':{'type':Sequelize[_0xf619('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0xf619('0x3'),'contact',_0xf619('0x4')),'defaultValue':_0xf619('0x3')},'moduleSearch':{'type':Sequelize[_0xf619('0x5')]('contact_lead',_0xf619('0x6'),_0xf619('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x0869=['exports','STRING','ENUM','contact','nothing','lead','contact_lead','sequelize'];(function(_0x1bef2a,_0x5becb3){var _0x10f24b=function(_0x1b9b83){while(--_0x1b9b83){_0x1bef2a['push'](_0x1bef2a['shift']());}};_0x10f24b(++_0x5becb3);}(_0x0869,0xaf));var _0x9086=function(_0x3902ad,_0x3c27dd){_0x3902ad=_0x3902ad-0x0;var _0x364fea=_0x0869[_0x3902ad];return _0x364fea;};'use strict';var Sequelize=require(_0x9086('0x0'));module[_0x9086('0x1')]={'name':{'type':Sequelize[_0x9086('0x2')]},'moduleCreate':{'type':Sequelize[_0x9086('0x3')]('lead',_0x9086('0x4'),_0x9086('0x5')),'defaultValue':_0x9086('0x6')},'moduleSearch':{'type':Sequelize[_0x9086('0x3')](_0x9086('0x7'),_0x9086('0x4'),'lead'),'defaultValue':_0x9086('0x7')},'description':{'type':Sequelize[_0x9086('0x2')]}};
\ No newline at end of file
index 19d8019..eab7205 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2973=['catch','show','params','keys','create','body','find','ZohoField','order','getFields','nolimit','getSubjects','getDescriptions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','index','map','rawAttributes','type','model','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','ZohoConfiguration','findAll','rows'];(function(_0x3bc72b,_0x34bc37){var _0x519a42=function(_0x244dd2){while(--_0x244dd2){_0x3bc72b['push'](_0x3bc72b['shift']());}};_0x519a42(++_0x34bc37);}(_0x2973,0xb6));var _0x3297=function(_0x11c0cb,_0x4476aa){_0x11c0cb=_0x11c0cb-0x0;var _0x3dbf20=_0x2973[_0x11c0cb];return _0x3dbf20;};'use strict';var emlformat=require(_0x3297('0x0'));var rimraf=require(_0x3297('0x1'));var zipdir=require(_0x3297('0x2'));var jsonpatch=require(_0x3297('0x3'));var rp=require(_0x3297('0x4'));var moment=require(_0x3297('0x5'));var BPromise=require(_0x3297('0x6'));var Mustache=require(_0x3297('0x7'));var util=require(_0x3297('0x8'));var path=require('path');var sox=require(_0x3297('0x9'));var csv=require(_0x3297('0xa'));var ejs=require(_0x3297('0xb'));var fs=require('fs');var fs_extra=require(_0x3297('0xc'));var _=require(_0x3297('0xd'));var squel=require('squel');var crypto=require(_0x3297('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3297('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3297('0x10'));var Papa=require(_0x3297('0x11'));var Redis=require(_0x3297('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3297('0x13'));var as=require(_0x3297('0x14'));var hardwareService=require(_0x3297('0x15'));var logger=require(_0x3297('0x16'))(_0x3297('0x17'));var utils=require(_0x3297('0x18'));var config=require(_0x3297('0x19'));var licenseUtil=require(_0x3297('0x1a'));var db=require(_0x3297('0x1b'))['db'];function respondWithStatusCode(_0x2fda51,_0x32de89){_0x32de89=_0x32de89||0xcc;return function(_0x3cfdb9){if(_0x3cfdb9){return _0x2fda51[_0x3297('0x1c')](_0x32de89);}return _0x2fda51[_0x3297('0x1d')](_0x32de89)[_0x3297('0x1e')]();};}function respondWithResult(_0xe8877,_0x4c3bd4){_0x4c3bd4=_0x4c3bd4||0xc8;return function(_0x228b5b){if(_0x228b5b){return _0xe8877[_0x3297('0x1d')](_0x4c3bd4)[_0x3297('0x1f')](_0x228b5b);}};}function respondWithFilteredResult(_0x125d05,_0x187f6f){return function(_0x337815){if(_0x337815){var _0x399bec=typeof _0x187f6f[_0x3297('0x20')]===_0x3297('0x21')&&typeof _0x187f6f[_0x3297('0x22')]==='undefined';var _0x2d26a4=_0x337815[_0x3297('0x23')];var _0x263b4b=_0x399bec?0x0:_0x187f6f[_0x3297('0x20')];var _0x50ac34=_0x399bec?_0x337815[_0x3297('0x23')]:_0x187f6f[_0x3297('0x20')]+_0x187f6f[_0x3297('0x22')];var _0x2c148b;if(_0x50ac34>=_0x2d26a4){_0x50ac34=_0x2d26a4;_0x2c148b=0xc8;}else{_0x2c148b=0xce;}_0x125d05[_0x3297('0x1d')](_0x2c148b);return _0x125d05['set'](_0x3297('0x24'),_0x263b4b+'-'+_0x50ac34+'/'+_0x2d26a4)[_0x3297('0x1f')](_0x337815);}return null;};}function patchUpdates(_0x23603a){return function(_0x35357f){try{jsonpatch[_0x3297('0x25')](_0x35357f,_0x23603a,!![]);}catch(_0x5bdb11){return BPromise[_0x3297('0x26')](_0x5bdb11);}return _0x35357f[_0x3297('0x27')]();};}function saveUpdates(_0x4b13d8,_0x14d23f){return function(_0x93e80b){if(_0x93e80b){return _0x93e80b[_0x3297('0x28')](_0x4b13d8)[_0x3297('0x29')](function(_0x938efd){return _0x938efd;});}return null;};}function removeEntity(_0x185d4d,_0x365890){return function(_0x3d727b){if(_0x3d727b){return _0x3d727b[_0x3297('0x2a')]()[_0x3297('0x29')](function(){_0x185d4d[_0x3297('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ee6ec,_0x3bd754){return function(_0x1d24a8){if(!_0x1d24a8){_0x2ee6ec[_0x3297('0x1c')](0x194);}return _0x1d24a8;};}function handleError(_0x5e7f58,_0x5910d8){_0x5910d8=_0x5910d8||0x1f4;return function(_0x3a02a2){logger[_0x3297('0x2b')](_0x3a02a2[_0x3297('0x2c')]);if(_0x3a02a2['name']){delete _0x3a02a2['name'];}_0x5e7f58[_0x3297('0x1d')](_0x5910d8)['send'](_0x3a02a2);};}exports[_0x3297('0x2d')]=function(_0x18fe1a,_0x547a7d){var _0x1bd69d={},_0x4d6b07={},_0x39e167={'count':0x0,'rows':[]};var _0x21f79c=_[_0x3297('0x2e')](db['ZohoConfiguration'][_0x3297('0x2f')],function(_0x5fcaae){return{'name':_0x5fcaae['fieldName'],'type':_0x5fcaae[_0x3297('0x30')]['key']};});_0x4d6b07[_0x3297('0x31')]=_[_0x3297('0x2e')](_0x21f79c,_0x3297('0x32'));_0x4d6b07['query']=_['keys'](_0x18fe1a[_0x3297('0x33')]);_0x4d6b07[_0x3297('0x34')]=_[_0x3297('0x35')](_0x4d6b07['model'],_0x4d6b07[_0x3297('0x33')]);_0x1bd69d['attributes']=_[_0x3297('0x35')](_0x4d6b07[_0x3297('0x31')],qs[_0x3297('0x36')](_0x18fe1a[_0x3297('0x33')][_0x3297('0x36')]));_0x1bd69d['attributes']=_0x1bd69d[_0x3297('0x37')][_0x3297('0x38')]?_0x1bd69d['attributes']:_0x4d6b07[_0x3297('0x31')];if(!_0x18fe1a[_0x3297('0x33')][_0x3297('0x39')]('nolimit')){_0x1bd69d['limit']=qs[_0x3297('0x22')](_0x18fe1a[_0x3297('0x33')][_0x3297('0x22')]);_0x1bd69d[_0x3297('0x20')]=qs[_0x3297('0x20')](_0x18fe1a[_0x3297('0x33')][_0x3297('0x20')]);}_0x1bd69d['order']=qs[_0x3297('0x3a')](_0x18fe1a[_0x3297('0x33')][_0x3297('0x3a')]);_0x1bd69d['where']=qs[_0x3297('0x34')](_[_0x3297('0x3b')](_0x18fe1a[_0x3297('0x33')],_0x4d6b07[_0x3297('0x34')]),_0x21f79c);if(_0x18fe1a[_0x3297('0x33')]['filter']){_0x1bd69d[_0x3297('0x3c')]=_[_0x3297('0x3d')](_0x1bd69d['where'],{'$or':_[_0x3297('0x2e')](_0x21f79c,function(_0x3d6cdc){if(_0x3d6cdc[_0x3297('0x30')]!==_0x3297('0x3e')){var _0x474b8f={};_0x474b8f[_0x3d6cdc[_0x3297('0x32')]]={'$like':'%'+_0x18fe1a[_0x3297('0x33')][_0x3297('0x3f')]+'%'};return _0x474b8f;}})});}_0x1bd69d=_[_0x3297('0x3d')]({},_0x1bd69d,_0x18fe1a[_0x3297('0x40')]);var _0x773459={'where':_0x1bd69d[_0x3297('0x3c')]};return db['ZohoConfiguration'][_0x3297('0x23')](_0x773459)['then'](function(_0x330524){_0x39e167[_0x3297('0x23')]=_0x330524;if(_0x18fe1a[_0x3297('0x33')][_0x3297('0x41')]){_0x1bd69d[_0x3297('0x42')]=[{'all':!![]}];}return db[_0x3297('0x43')][_0x3297('0x44')](_0x1bd69d);})['then'](function(_0x4e0644){_0x39e167[_0x3297('0x45')]=_0x4e0644;return _0x39e167;})[_0x3297('0x29')](respondWithFilteredResult(_0x547a7d,_0x1bd69d))[_0x3297('0x46')](handleError(_0x547a7d,null));};exports[_0x3297('0x47')]=function(_0xba8c02,_0x5b648e){var _0x4d75ce={'raw':![],'where':{'id':_0xba8c02[_0x3297('0x48')]['id']}},_0x5ca846={};_0x5ca846['model']=_[_0x3297('0x49')](db['ZohoConfiguration'][_0x3297('0x2f')]);_0x5ca846[_0x3297('0x33')]=_[_0x3297('0x49')](_0xba8c02[_0x3297('0x33')]);_0x5ca846[_0x3297('0x34')]=_[_0x3297('0x35')](_0x5ca846[_0x3297('0x31')],_0x5ca846[_0x3297('0x33')]);_0x4d75ce[_0x3297('0x37')]=_[_0x3297('0x35')](_0x5ca846[_0x3297('0x31')],qs[_0x3297('0x36')](_0xba8c02[_0x3297('0x33')][_0x3297('0x36')]));_0x4d75ce[_0x3297('0x37')]=_0x4d75ce[_0x3297('0x37')][_0x3297('0x38')]?_0x4d75ce['attributes']:_0x5ca846['model'];if(_0xba8c02[_0x3297('0x33')][_0x3297('0x41')]){_0x4d75ce[_0x3297('0x42')]=[{'all':!![]}];}_0x4d75ce=_['merge']({},_0x4d75ce,_0xba8c02[_0x3297('0x40')]);return db[_0x3297('0x43')]['find'](_0x4d75ce)['then'](handleEntityNotFound(_0x5b648e,null))[_0x3297('0x29')](respondWithResult(_0x5b648e,null))[_0x3297('0x46')](handleError(_0x5b648e,null));};exports[_0x3297('0x4a')]=function(_0x409e85,_0x24dc6b){return db['ZohoConfiguration']['create'](_0x409e85[_0x3297('0x4b')],{})[_0x3297('0x29')](respondWithResult(_0x24dc6b,0xc9))[_0x3297('0x46')](handleError(_0x24dc6b,null));};exports[_0x3297('0x28')]=function(_0x1df3b8,_0x22cda5){if(_0x1df3b8[_0x3297('0x4b')]['id']){delete _0x1df3b8[_0x3297('0x4b')]['id'];}return db[_0x3297('0x43')][_0x3297('0x4c')]({'where':{'id':_0x1df3b8[_0x3297('0x48')]['id']}})[_0x3297('0x29')](handleEntityNotFound(_0x22cda5,null))[_0x3297('0x29')](saveUpdates(_0x1df3b8[_0x3297('0x4b')],null))['then'](respondWithResult(_0x22cda5,null))['catch'](handleError(_0x22cda5,null));};exports[_0x3297('0x2a')]=function(_0x52580b,_0x24570f){return db[_0x3297('0x43')][_0x3297('0x4c')]({'where':{'id':_0x52580b['params']['id']}})[_0x3297('0x29')](handleEntityNotFound(_0x24570f,null))['then'](removeEntity(_0x24570f,null))[_0x3297('0x46')](handleError(_0x24570f,null));};exports['getFields']=function(_0x51b471,_0x15fbd7,_0x84f34){var _0x1bea0f={};var _0x831f2a={};var _0x58b5bc;var _0x3d5a86;return db[_0x3297('0x43')]['findOne']({'where':{'id':_0x51b471['params']['id']}})[_0x3297('0x29')](handleEntityNotFound(_0x15fbd7,null))['then'](function(_0x50a327){if(_0x50a327){_0x58b5bc=_0x50a327;_0x831f2a[_0x3297('0x31')]=_['keys'](db[_0x3297('0x4d')][_0x3297('0x2f')]);_0x831f2a['query']=_[_0x3297('0x49')](_0x51b471[_0x3297('0x33')]);_0x831f2a[_0x3297('0x34')]=_[_0x3297('0x35')](_0x831f2a['model'],_0x831f2a[_0x3297('0x33')]);_0x1bea0f['attributes']=_[_0x3297('0x35')](_0x831f2a[_0x3297('0x31')],qs[_0x3297('0x36')](_0x51b471[_0x3297('0x33')][_0x3297('0x36')]));_0x1bea0f[_0x3297('0x37')]=_0x1bea0f[_0x3297('0x37')][_0x3297('0x38')]?_0x1bea0f[_0x3297('0x37')]:_0x831f2a[_0x3297('0x31')];_0x1bea0f[_0x3297('0x4e')]=qs[_0x3297('0x3a')](_0x51b471[_0x3297('0x33')][_0x3297('0x3a')]);_0x1bea0f[_0x3297('0x3c')]=qs['filters'](_[_0x3297('0x3b')](_0x51b471[_0x3297('0x33')],_0x831f2a[_0x3297('0x34')]));if(_0x51b471[_0x3297('0x33')][_0x3297('0x3f')]){_0x1bea0f[_0x3297('0x3c')]=_['merge'](_0x1bea0f[_0x3297('0x3c')],{'$or':_[_0x3297('0x2e')](_0x1bea0f['attributes'],function(_0x226c0e){var _0x3bdce9={};_0x3bdce9[_0x226c0e]={'$like':'%'+_0x51b471[_0x3297('0x33')]['filter']+'%'};return _0x3bdce9;})});}_0x1bea0f=_[_0x3297('0x3d')]({},_0x1bea0f,_0x51b471['options']);return _0x58b5bc[_0x3297('0x4f')](_0x1bea0f);}})['then'](function(_0xcc8bc){if(_0xcc8bc){_0x3d5a86=_0xcc8bc[_0x3297('0x38')];if(!_0x51b471[_0x3297('0x33')][_0x3297('0x39')](_0x3297('0x50'))){_0x1bea0f[_0x3297('0x22')]=qs[_0x3297('0x22')](_0x51b471[_0x3297('0x33')]['limit']);_0x1bea0f[_0x3297('0x20')]=qs[_0x3297('0x20')](_0x51b471[_0x3297('0x33')]['offset']);}return _0x58b5bc['getFields'](_0x1bea0f);}})[_0x3297('0x29')](function(_0x567810){if(_0x567810){return _0x567810?{'count':_0x3d5a86,'rows':_0x567810}:null;}})[_0x3297('0x29')](respondWithResult(_0x15fbd7,null))[_0x3297('0x46')](handleError(_0x15fbd7,null));};exports[_0x3297('0x51')]=function(_0x2f1d97,_0x1703ab,_0x23cac4){var _0x27a485={};var _0x1bf9c2={};var _0x32fd14;var _0x2a132b;return db[_0x3297('0x43')]['findOne']({'where':{'id':_0x2f1d97[_0x3297('0x48')]['id']}})[_0x3297('0x29')](handleEntityNotFound(_0x1703ab,null))[_0x3297('0x29')](function(_0x3ed1f6){if(_0x3ed1f6){_0x32fd14=_0x3ed1f6;_0x1bf9c2['model']=_[_0x3297('0x49')](db['ZohoField'][_0x3297('0x2f')]);_0x1bf9c2['query']=_[_0x3297('0x49')](_0x2f1d97['query']);_0x1bf9c2[_0x3297('0x34')]=_[_0x3297('0x35')](_0x1bf9c2['model'],_0x1bf9c2[_0x3297('0x33')]);_0x27a485[_0x3297('0x37')]=_[_0x3297('0x35')](_0x1bf9c2[_0x3297('0x31')],qs[_0x3297('0x36')](_0x2f1d97[_0x3297('0x33')][_0x3297('0x36')]));_0x27a485[_0x3297('0x37')]=_0x27a485[_0x3297('0x37')][_0x3297('0x38')]?_0x27a485[_0x3297('0x37')]:_0x1bf9c2[_0x3297('0x31')];_0x27a485[_0x3297('0x4e')]=qs[_0x3297('0x3a')](_0x2f1d97[_0x3297('0x33')][_0x3297('0x3a')]);_0x27a485[_0x3297('0x3c')]=qs[_0x3297('0x34')](_[_0x3297('0x3b')](_0x2f1d97[_0x3297('0x33')],_0x1bf9c2['filters']));if(_0x2f1d97['query'][_0x3297('0x3f')]){_0x27a485[_0x3297('0x3c')]=_['merge'](_0x27a485[_0x3297('0x3c')],{'$or':_[_0x3297('0x2e')](_0x27a485[_0x3297('0x37')],function(_0x622856){var _0x2b00e0={};_0x2b00e0[_0x622856]={'$like':'%'+_0x2f1d97['query'][_0x3297('0x3f')]+'%'};return _0x2b00e0;})});}_0x27a485=_['merge']({},_0x27a485,_0x2f1d97[_0x3297('0x40')]);return _0x32fd14[_0x3297('0x51')](_0x27a485);}})[_0x3297('0x29')](function(_0x3bba23){if(_0x3bba23){_0x2a132b=_0x3bba23[_0x3297('0x38')];if(!_0x2f1d97[_0x3297('0x33')][_0x3297('0x39')](_0x3297('0x50'))){_0x27a485[_0x3297('0x22')]=qs['limit'](_0x2f1d97[_0x3297('0x33')]['limit']);_0x27a485['offset']=qs[_0x3297('0x20')](_0x2f1d97[_0x3297('0x33')]['offset']);}return _0x32fd14[_0x3297('0x51')](_0x27a485);}})[_0x3297('0x29')](function(_0x592dae){if(_0x592dae){return _0x592dae?{'count':_0x2a132b,'rows':_0x592dae}:null;}})['then'](respondWithResult(_0x1703ab,null))[_0x3297('0x46')](handleError(_0x1703ab,null));};exports[_0x3297('0x52')]=function(_0x5ccd83,_0xb4c8ec,_0x104eea){var _0x380386={};var _0x4be106={};var _0x4de3fe;var _0x3d14a0;return db['ZohoConfiguration'][_0x3297('0x53')]({'where':{'id':_0x5ccd83[_0x3297('0x48')]['id']}})[_0x3297('0x29')](handleEntityNotFound(_0xb4c8ec,null))[_0x3297('0x29')](function(_0x55e7dd){if(_0x55e7dd){_0x4de3fe=_0x55e7dd;_0x4be106[_0x3297('0x31')]=_[_0x3297('0x49')](db['ZohoField'][_0x3297('0x2f')]);_0x4be106[_0x3297('0x33')]=_[_0x3297('0x49')](_0x5ccd83['query']);_0x4be106[_0x3297('0x34')]=_[_0x3297('0x35')](_0x4be106[_0x3297('0x31')],_0x4be106[_0x3297('0x33')]);_0x380386['attributes']=_[_0x3297('0x35')](_0x4be106[_0x3297('0x31')],qs[_0x3297('0x36')](_0x5ccd83[_0x3297('0x33')]['fields']));_0x380386[_0x3297('0x37')]=_0x380386['attributes'][_0x3297('0x38')]?_0x380386[_0x3297('0x37')]:_0x4be106[_0x3297('0x31')];_0x380386[_0x3297('0x4e')]=qs[_0x3297('0x3a')](_0x5ccd83['query'][_0x3297('0x3a')]);_0x380386[_0x3297('0x3c')]=qs['filters'](_[_0x3297('0x3b')](_0x5ccd83[_0x3297('0x33')],_0x4be106[_0x3297('0x34')]));if(_0x5ccd83[_0x3297('0x33')][_0x3297('0x3f')]){_0x380386[_0x3297('0x3c')]=_[_0x3297('0x3d')](_0x380386['where'],{'$or':_['map'](_0x380386['attributes'],function(_0x9672ec){var _0x2465e5={};_0x2465e5[_0x9672ec]={'$like':'%'+_0x5ccd83['query'][_0x3297('0x3f')]+'%'};return _0x2465e5;})});}_0x380386=_['merge']({},_0x380386,_0x5ccd83[_0x3297('0x40')]);return _0x4de3fe[_0x3297('0x52')](_0x380386);}})[_0x3297('0x29')](function(_0x3c8a06){if(_0x3c8a06){_0x3d14a0=_0x3c8a06[_0x3297('0x38')];if(!_0x5ccd83['query']['hasOwnProperty'](_0x3297('0x50'))){_0x380386[_0x3297('0x22')]=qs[_0x3297('0x22')](_0x5ccd83[_0x3297('0x33')][_0x3297('0x22')]);_0x380386['offset']=qs['offset'](_0x5ccd83[_0x3297('0x33')][_0x3297('0x20')]);}return _0x4de3fe[_0x3297('0x52')](_0x380386);}})['then'](function(_0x43ada3){if(_0x43ada3){return _0x43ada3?{'count':_0x3d14a0,'rows':_0x43ada3}:null;}})['then'](respondWithResult(_0xb4c8ec,null))['catch'](handleError(_0xb4c8ec,null));};
\ No newline at end of file
+var _0x3d4f=['order','getSubjects','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','getFields','findOne','ZohoField'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3d4f,0x198));var _0xf3d4=function(_0x571a17,_0x63fb3d){_0x571a17=_0x571a17-0x0;var _0x3ef337=_0x3d4f[_0x571a17];return _0x3ef337;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf3d4('0x0'));var jsonpatch=require(_0xf3d4('0x1'));var rp=require(_0xf3d4('0x2'));var moment=require(_0xf3d4('0x3'));var BPromise=require(_0xf3d4('0x4'));var Mustache=require(_0xf3d4('0x5'));var util=require(_0xf3d4('0x6'));var path=require('path');var sox=require(_0xf3d4('0x7'));var csv=require(_0xf3d4('0x8'));var ejs=require(_0xf3d4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf3d4('0xa'));var crypto=require(_0xf3d4('0xb'));var jsforce=require(_0xf3d4('0xc'));var deskjs=require(_0xf3d4('0xd'));var toCsv=require(_0xf3d4('0x8'));var querystring=require(_0xf3d4('0xe'));var Papa=require(_0xf3d4('0xf'));var Redis=require(_0xf3d4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf3d4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf3d4('0x12'))(_0xf3d4('0x13'));var utils=require(_0xf3d4('0x14'));var config=require(_0xf3d4('0x15'));var licenseUtil=require(_0xf3d4('0x16'));var db=require(_0xf3d4('0x17'))['db'];function respondWithStatusCode(_0x56818f,_0x2c3982){_0x2c3982=_0x2c3982||0xcc;return function(_0x34a15b){if(_0x34a15b){return _0x56818f[_0xf3d4('0x18')](_0x2c3982);}return _0x56818f[_0xf3d4('0x19')](_0x2c3982)[_0xf3d4('0x1a')]();};}function respondWithResult(_0x4ebbd8,_0x22c133){_0x22c133=_0x22c133||0xc8;return function(_0x4f81fb){if(_0x4f81fb){return _0x4ebbd8[_0xf3d4('0x19')](_0x22c133)[_0xf3d4('0x1b')](_0x4f81fb);}};}function respondWithFilteredResult(_0x5dec55,_0x1d7184){return function(_0x389ac0){if(_0x389ac0){var _0x235113=typeof _0x1d7184[_0xf3d4('0x1c')]===_0xf3d4('0x1d')&&typeof _0x1d7184[_0xf3d4('0x1e')]===_0xf3d4('0x1d');var _0x690857=_0x389ac0['count'];var _0x315ba3=_0x235113?0x0:_0x1d7184[_0xf3d4('0x1c')];var _0x554d05=_0x235113?_0x389ac0[_0xf3d4('0x1f')]:_0x1d7184[_0xf3d4('0x1c')]+_0x1d7184['limit'];var _0x29223e;if(_0x554d05>=_0x690857){_0x554d05=_0x690857;_0x29223e=0xc8;}else{_0x29223e=0xce;}_0x5dec55[_0xf3d4('0x19')](_0x29223e);return _0x5dec55[_0xf3d4('0x20')](_0xf3d4('0x21'),_0x315ba3+'-'+_0x554d05+'/'+_0x690857)[_0xf3d4('0x1b')](_0x389ac0);}return null;};}function patchUpdates(_0x462ad7){return function(_0x59ae52){try{jsonpatch['apply'](_0x59ae52,_0x462ad7,!![]);}catch(_0x4d04e3){return BPromise[_0xf3d4('0x22')](_0x4d04e3);}return _0x59ae52[_0xf3d4('0x23')]();};}function saveUpdates(_0x20de85,_0x467d9b){return function(_0x525940){if(_0x525940){return _0x525940[_0xf3d4('0x24')](_0x20de85)['then'](function(_0x104bca){return _0x104bca;});}return null;};}function removeEntity(_0x4e17fc,_0xc3f7bc){return function(_0xf84b6){if(_0xf84b6){return _0xf84b6[_0xf3d4('0x25')]()[_0xf3d4('0x26')](function(){_0x4e17fc[_0xf3d4('0x19')](0xcc)[_0xf3d4('0x1a')]();});}};}function handleEntityNotFound(_0x2f0a0c,_0x2574d9){return function(_0x3f984f){if(!_0x3f984f){_0x2f0a0c[_0xf3d4('0x18')](0x194);}return _0x3f984f;};}function handleError(_0x587f3b,_0x415c8d){_0x415c8d=_0x415c8d||0x1f4;return function(_0x861e1c){logger['error'](_0x861e1c['stack']);if(_0x861e1c[_0xf3d4('0x27')]){delete _0x861e1c['name'];}_0x587f3b['status'](_0x415c8d)[_0xf3d4('0x28')](_0x861e1c);};}exports[_0xf3d4('0x29')]=function(_0x1e703d,_0x196221){var _0x5c19a6={},_0x4010cc={},_0x3a3cd1={'count':0x0,'rows':[]};var _0x39fc39=_[_0xf3d4('0x2a')](db[_0xf3d4('0x2b')][_0xf3d4('0x2c')],function(_0x31c1d3){return{'name':_0x31c1d3[_0xf3d4('0x2d')],'type':_0x31c1d3[_0xf3d4('0x2e')][_0xf3d4('0x2f')]};});_0x4010cc[_0xf3d4('0x30')]=_[_0xf3d4('0x2a')](_0x39fc39,'name');_0x4010cc[_0xf3d4('0x31')]=_[_0xf3d4('0x32')](_0x1e703d[_0xf3d4('0x31')]);_0x4010cc['filters']=_[_0xf3d4('0x33')](_0x4010cc[_0xf3d4('0x30')],_0x4010cc[_0xf3d4('0x31')]);_0x5c19a6[_0xf3d4('0x34')]=_['intersection'](_0x4010cc['model'],qs[_0xf3d4('0x35')](_0x1e703d[_0xf3d4('0x31')][_0xf3d4('0x35')]));_0x5c19a6[_0xf3d4('0x34')]=_0x5c19a6[_0xf3d4('0x34')][_0xf3d4('0x36')]?_0x5c19a6[_0xf3d4('0x34')]:_0x4010cc['model'];if(!_0x1e703d[_0xf3d4('0x31')][_0xf3d4('0x37')](_0xf3d4('0x38'))){_0x5c19a6[_0xf3d4('0x1e')]=qs[_0xf3d4('0x1e')](_0x1e703d[_0xf3d4('0x31')]['limit']);_0x5c19a6[_0xf3d4('0x1c')]=qs[_0xf3d4('0x1c')](_0x1e703d[_0xf3d4('0x31')][_0xf3d4('0x1c')]);}_0x5c19a6['order']=qs[_0xf3d4('0x39')](_0x1e703d[_0xf3d4('0x31')][_0xf3d4('0x39')]);_0x5c19a6[_0xf3d4('0x3a')]=qs['filters'](_[_0xf3d4('0x3b')](_0x1e703d[_0xf3d4('0x31')],_0x4010cc[_0xf3d4('0x3c')]),_0x39fc39);if(_0x1e703d[_0xf3d4('0x31')][_0xf3d4('0x3d')]){_0x5c19a6[_0xf3d4('0x3a')]=_[_0xf3d4('0x3e')](_0x5c19a6['where'],{'$or':_[_0xf3d4('0x2a')](_0x39fc39,function(_0x273ea0){if(_0x273ea0[_0xf3d4('0x2e')]!==_0xf3d4('0x3f')){var _0x2ef032={};_0x2ef032[_0x273ea0[_0xf3d4('0x27')]]={'$like':'%'+_0x1e703d[_0xf3d4('0x31')][_0xf3d4('0x3d')]+'%'};return _0x2ef032;}})});}_0x5c19a6=_[_0xf3d4('0x3e')]({},_0x5c19a6,_0x1e703d[_0xf3d4('0x40')]);var _0x1cdeef={'where':_0x5c19a6[_0xf3d4('0x3a')]};return db[_0xf3d4('0x2b')]['count'](_0x1cdeef)[_0xf3d4('0x26')](function(_0x4e6a12){_0x3a3cd1[_0xf3d4('0x1f')]=_0x4e6a12;if(_0x1e703d['query'][_0xf3d4('0x41')]){_0x5c19a6[_0xf3d4('0x42')]=[{'all':!![]}];}return db[_0xf3d4('0x2b')][_0xf3d4('0x43')](_0x5c19a6);})[_0xf3d4('0x26')](function(_0x2861db){_0x3a3cd1[_0xf3d4('0x44')]=_0x2861db;return _0x3a3cd1;})[_0xf3d4('0x26')](respondWithFilteredResult(_0x196221,_0x5c19a6))[_0xf3d4('0x45')](handleError(_0x196221,null));};exports[_0xf3d4('0x46')]=function(_0x32627b,_0x17d1b8){var _0x5f2f28={'raw':![],'where':{'id':_0x32627b['params']['id']}},_0x3608ab={};_0x3608ab[_0xf3d4('0x30')]=_['keys'](db[_0xf3d4('0x2b')][_0xf3d4('0x2c')]);_0x3608ab[_0xf3d4('0x31')]=_[_0xf3d4('0x32')](_0x32627b[_0xf3d4('0x31')]);_0x3608ab[_0xf3d4('0x3c')]=_[_0xf3d4('0x33')](_0x3608ab['model'],_0x3608ab[_0xf3d4('0x31')]);_0x5f2f28['attributes']=_[_0xf3d4('0x33')](_0x3608ab[_0xf3d4('0x30')],qs[_0xf3d4('0x35')](_0x32627b[_0xf3d4('0x31')][_0xf3d4('0x35')]));_0x5f2f28[_0xf3d4('0x34')]=_0x5f2f28[_0xf3d4('0x34')][_0xf3d4('0x36')]?_0x5f2f28['attributes']:_0x3608ab[_0xf3d4('0x30')];if(_0x32627b[_0xf3d4('0x31')][_0xf3d4('0x41')]){_0x5f2f28[_0xf3d4('0x42')]=[{'all':!![]}];}_0x5f2f28=_[_0xf3d4('0x3e')]({},_0x5f2f28,_0x32627b[_0xf3d4('0x40')]);return db['ZohoConfiguration'][_0xf3d4('0x47')](_0x5f2f28)[_0xf3d4('0x26')](handleEntityNotFound(_0x17d1b8,null))[_0xf3d4('0x26')](respondWithResult(_0x17d1b8,null))[_0xf3d4('0x45')](handleError(_0x17d1b8,null));};exports['create']=function(_0x330dc4,_0x238b54){return db[_0xf3d4('0x2b')][_0xf3d4('0x48')](_0x330dc4['body'],{})[_0xf3d4('0x26')](respondWithResult(_0x238b54,0xc9))[_0xf3d4('0x45')](handleError(_0x238b54,null));};exports[_0xf3d4('0x24')]=function(_0x555a6b,_0x21ef5d){if(_0x555a6b[_0xf3d4('0x49')]['id']){delete _0x555a6b[_0xf3d4('0x49')]['id'];}return db[_0xf3d4('0x2b')]['find']({'where':{'id':_0x555a6b[_0xf3d4('0x4a')]['id']}})[_0xf3d4('0x26')](handleEntityNotFound(_0x21ef5d,null))[_0xf3d4('0x26')](saveUpdates(_0x555a6b[_0xf3d4('0x49')],null))[_0xf3d4('0x26')](respondWithResult(_0x21ef5d,null))[_0xf3d4('0x45')](handleError(_0x21ef5d,null));};exports[_0xf3d4('0x25')]=function(_0x2d3a3d,_0x3bb5df){return db[_0xf3d4('0x2b')][_0xf3d4('0x47')]({'where':{'id':_0x2d3a3d['params']['id']}})['then'](handleEntityNotFound(_0x3bb5df,null))[_0xf3d4('0x26')](removeEntity(_0x3bb5df,null))['catch'](handleError(_0x3bb5df,null));};exports[_0xf3d4('0x4b')]=function(_0x10bc95,_0x235324,_0x3ebd10){var _0x580727={};var _0x55c4d3={};var _0x1e49ff;var _0x5546dc;return db['ZohoConfiguration'][_0xf3d4('0x4c')]({'where':{'id':_0x10bc95[_0xf3d4('0x4a')]['id']}})['then'](handleEntityNotFound(_0x235324,null))['then'](function(_0x52933f){if(_0x52933f){_0x1e49ff=_0x52933f;_0x55c4d3[_0xf3d4('0x30')]=_['keys'](db[_0xf3d4('0x4d')][_0xf3d4('0x2c')]);_0x55c4d3[_0xf3d4('0x31')]=_[_0xf3d4('0x32')](_0x10bc95[_0xf3d4('0x31')]);_0x55c4d3[_0xf3d4('0x3c')]=_[_0xf3d4('0x33')](_0x55c4d3[_0xf3d4('0x30')],_0x55c4d3[_0xf3d4('0x31')]);_0x580727['attributes']=_[_0xf3d4('0x33')](_0x55c4d3[_0xf3d4('0x30')],qs[_0xf3d4('0x35')](_0x10bc95[_0xf3d4('0x31')][_0xf3d4('0x35')]));_0x580727[_0xf3d4('0x34')]=_0x580727[_0xf3d4('0x34')][_0xf3d4('0x36')]?_0x580727[_0xf3d4('0x34')]:_0x55c4d3['model'];_0x580727['order']=qs[_0xf3d4('0x39')](_0x10bc95[_0xf3d4('0x31')][_0xf3d4('0x39')]);_0x580727[_0xf3d4('0x3a')]=qs[_0xf3d4('0x3c')](_[_0xf3d4('0x3b')](_0x10bc95[_0xf3d4('0x31')],_0x55c4d3[_0xf3d4('0x3c')]));if(_0x10bc95['query'][_0xf3d4('0x3d')]){_0x580727['where']=_[_0xf3d4('0x3e')](_0x580727[_0xf3d4('0x3a')],{'$or':_[_0xf3d4('0x2a')](_0x580727[_0xf3d4('0x34')],function(_0x64561c){var _0x5ccb35={};_0x5ccb35[_0x64561c]={'$like':'%'+_0x10bc95[_0xf3d4('0x31')][_0xf3d4('0x3d')]+'%'};return _0x5ccb35;})});}_0x580727=_[_0xf3d4('0x3e')]({},_0x580727,_0x10bc95[_0xf3d4('0x40')]);return _0x1e49ff['getFields'](_0x580727);}})[_0xf3d4('0x26')](function(_0x2c479b){if(_0x2c479b){_0x5546dc=_0x2c479b['length'];if(!_0x10bc95[_0xf3d4('0x31')][_0xf3d4('0x37')](_0xf3d4('0x38'))){_0x580727[_0xf3d4('0x1e')]=qs[_0xf3d4('0x1e')](_0x10bc95['query'][_0xf3d4('0x1e')]);_0x580727[_0xf3d4('0x1c')]=qs[_0xf3d4('0x1c')](_0x10bc95[_0xf3d4('0x31')][_0xf3d4('0x1c')]);}return _0x1e49ff[_0xf3d4('0x4b')](_0x580727);}})[_0xf3d4('0x26')](function(_0x55a2d9){if(_0x55a2d9){return _0x55a2d9?{'count':_0x5546dc,'rows':_0x55a2d9}:null;}})['then'](respondWithResult(_0x235324,null))[_0xf3d4('0x45')](handleError(_0x235324,null));};exports['getSubjects']=function(_0x5e8d32,_0x4e707e,_0x2c8f20){var _0x13b856={};var _0x470eef={};var _0x55cbd7;var _0x4f0cb1;return db['ZohoConfiguration'][_0xf3d4('0x4c')]({'where':{'id':_0x5e8d32[_0xf3d4('0x4a')]['id']}})[_0xf3d4('0x26')](handleEntityNotFound(_0x4e707e,null))[_0xf3d4('0x26')](function(_0x48dbef){if(_0x48dbef){_0x55cbd7=_0x48dbef;_0x470eef[_0xf3d4('0x30')]=_[_0xf3d4('0x32')](db[_0xf3d4('0x4d')][_0xf3d4('0x2c')]);_0x470eef[_0xf3d4('0x31')]=_['keys'](_0x5e8d32[_0xf3d4('0x31')]);_0x470eef['filters']=_['intersection'](_0x470eef[_0xf3d4('0x30')],_0x470eef[_0xf3d4('0x31')]);_0x13b856[_0xf3d4('0x34')]=_[_0xf3d4('0x33')](_0x470eef['model'],qs[_0xf3d4('0x35')](_0x5e8d32['query'][_0xf3d4('0x35')]));_0x13b856[_0xf3d4('0x34')]=_0x13b856['attributes']['length']?_0x13b856[_0xf3d4('0x34')]:_0x470eef['model'];_0x13b856[_0xf3d4('0x4e')]=qs['sort'](_0x5e8d32[_0xf3d4('0x31')][_0xf3d4('0x39')]);_0x13b856[_0xf3d4('0x3a')]=qs['filters'](_[_0xf3d4('0x3b')](_0x5e8d32[_0xf3d4('0x31')],_0x470eef[_0xf3d4('0x3c')]));if(_0x5e8d32['query'][_0xf3d4('0x3d')]){_0x13b856['where']=_[_0xf3d4('0x3e')](_0x13b856[_0xf3d4('0x3a')],{'$or':_['map'](_0x13b856['attributes'],function(_0x1534ee){var _0x23eaeb={};_0x23eaeb[_0x1534ee]={'$like':'%'+_0x5e8d32[_0xf3d4('0x31')][_0xf3d4('0x3d')]+'%'};return _0x23eaeb;})});}_0x13b856=_[_0xf3d4('0x3e')]({},_0x13b856,_0x5e8d32[_0xf3d4('0x40')]);return _0x55cbd7[_0xf3d4('0x4f')](_0x13b856);}})['then'](function(_0x2ae03b){if(_0x2ae03b){_0x4f0cb1=_0x2ae03b[_0xf3d4('0x36')];if(!_0x5e8d32[_0xf3d4('0x31')][_0xf3d4('0x37')](_0xf3d4('0x38'))){_0x13b856[_0xf3d4('0x1e')]=qs[_0xf3d4('0x1e')](_0x5e8d32[_0xf3d4('0x31')]['limit']);_0x13b856[_0xf3d4('0x1c')]=qs[_0xf3d4('0x1c')](_0x5e8d32[_0xf3d4('0x31')]['offset']);}return _0x55cbd7[_0xf3d4('0x4f')](_0x13b856);}})[_0xf3d4('0x26')](function(_0x16dd5a){if(_0x16dd5a){return _0x16dd5a?{'count':_0x4f0cb1,'rows':_0x16dd5a}:null;}})[_0xf3d4('0x26')](respondWithResult(_0x4e707e,null))[_0xf3d4('0x45')](handleError(_0x4e707e,null));};exports[_0xf3d4('0x50')]=function(_0x1e3490,_0x4c4158,_0x44bb8c){var _0x502fcc={};var _0x59bc2a={};var _0x48071f;var _0x5ba182;return db[_0xf3d4('0x2b')]['findOne']({'where':{'id':_0x1e3490[_0xf3d4('0x4a')]['id']}})[_0xf3d4('0x26')](handleEntityNotFound(_0x4c4158,null))[_0xf3d4('0x26')](function(_0x385c93){if(_0x385c93){_0x48071f=_0x385c93;_0x59bc2a['model']=_[_0xf3d4('0x32')](db[_0xf3d4('0x4d')][_0xf3d4('0x2c')]);_0x59bc2a[_0xf3d4('0x31')]=_[_0xf3d4('0x32')](_0x1e3490[_0xf3d4('0x31')]);_0x59bc2a[_0xf3d4('0x3c')]=_[_0xf3d4('0x33')](_0x59bc2a[_0xf3d4('0x30')],_0x59bc2a[_0xf3d4('0x31')]);_0x502fcc[_0xf3d4('0x34')]=_['intersection'](_0x59bc2a[_0xf3d4('0x30')],qs[_0xf3d4('0x35')](_0x1e3490[_0xf3d4('0x31')][_0xf3d4('0x35')]));_0x502fcc[_0xf3d4('0x34')]=_0x502fcc[_0xf3d4('0x34')][_0xf3d4('0x36')]?_0x502fcc['attributes']:_0x59bc2a[_0xf3d4('0x30')];_0x502fcc[_0xf3d4('0x4e')]=qs['sort'](_0x1e3490[_0xf3d4('0x31')][_0xf3d4('0x39')]);_0x502fcc[_0xf3d4('0x3a')]=qs['filters'](_[_0xf3d4('0x3b')](_0x1e3490[_0xf3d4('0x31')],_0x59bc2a[_0xf3d4('0x3c')]));if(_0x1e3490['query']['filter']){_0x502fcc[_0xf3d4('0x3a')]=_[_0xf3d4('0x3e')](_0x502fcc[_0xf3d4('0x3a')],{'$or':_[_0xf3d4('0x2a')](_0x502fcc[_0xf3d4('0x34')],function(_0x511a56){var _0x33127e={};_0x33127e[_0x511a56]={'$like':'%'+_0x1e3490['query'][_0xf3d4('0x3d')]+'%'};return _0x33127e;})});}_0x502fcc=_[_0xf3d4('0x3e')]({},_0x502fcc,_0x1e3490[_0xf3d4('0x40')]);return _0x48071f['getDescriptions'](_0x502fcc);}})['then'](function(_0x581382){if(_0x581382){_0x5ba182=_0x581382['length'];if(!_0x1e3490[_0xf3d4('0x31')][_0xf3d4('0x37')](_0xf3d4('0x38'))){_0x502fcc[_0xf3d4('0x1e')]=qs[_0xf3d4('0x1e')](_0x1e3490[_0xf3d4('0x31')][_0xf3d4('0x1e')]);_0x502fcc[_0xf3d4('0x1c')]=qs['offset'](_0x1e3490['query'][_0xf3d4('0x1c')]);}return _0x48071f['getDescriptions'](_0x502fcc);}})[_0xf3d4('0x26')](function(_0x5a7a90){if(_0x5a7a90){return _0x5a7a90?{'count':_0x5ba182,'rows':_0x5a7a90}:null;}})[_0xf3d4('0x26')](respondWithResult(_0x4c4158,null))['catch'](handleError(_0x4c4158,null));};
\ No newline at end of file
index c0df220..fe554bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa30c=['rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x217010,_0x57aeff){var _0x2d99b8=function(_0x1cddf7){while(--_0x1cddf7){_0x217010['push'](_0x217010['shift']());}};_0x2d99b8(++_0x57aeff);}(_0xa30c,0x69));var _0xca30=function(_0x198d9,_0x48217c){_0x198d9=_0x198d9-0x0;var _0x51e065=_0xa30c[_0x198d9];return _0x51e065;};'use strict';var _=require(_0xca30('0x0'));var util=require(_0xca30('0x1'));var logger=require(_0xca30('0x2'))(_0xca30('0x3'));var moment=require('moment');var BPromise=require(_0xca30('0x4'));var rp=require(_0xca30('0x5'));var fs=require('fs');var path=require(_0xca30('0x6'));var rimraf=require(_0xca30('0x7'));var config=require(_0xca30('0x8'));var attributes=require(_0xca30('0x9'));module[_0xca30('0xa')]=function(_0x42e0a8,_0x16fe9a){return _0x42e0a8[_0xca30('0xb')](_0xca30('0xc'),attributes,{'tableName':_0xca30('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x711e=['rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x118d57,_0x5dd82a){var _0x22c697=function(_0x2f1173){while(--_0x2f1173){_0x118d57['push'](_0x118d57['shift']());}};_0x22c697(++_0x5dd82a);}(_0x711e,0xcb));var _0xe711=function(_0x3cc075,_0x2ffbc5){_0x3cc075=_0x3cc075-0x0;var _0x54a72d=_0x711e[_0x3cc075];return _0x54a72d;};'use strict';var _=require(_0xe711('0x0'));var util=require(_0xe711('0x1'));var logger=require(_0xe711('0x2'))(_0xe711('0x3'));var moment=require(_0xe711('0x4'));var BPromise=require('bluebird');var rp=require(_0xe711('0x5'));var fs=require('fs');var path=require(_0xe711('0x6'));var rimraf=require(_0xe711('0x7'));var config=require(_0xe711('0x8'));var attributes=require(_0xe711('0x9'));module[_0xe711('0xa')]=function(_0x14908e,_0x4fbe20){return _0x14908e[_0xe711('0xb')](_0xe711('0xc'),attributes,{'tableName':_0xe711('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f8470a4..e57a15d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc217=['ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x348c13,_0x492072){var _0x3528f7=function(_0x570007){while(--_0x570007){_0x348c13['push'](_0x348c13['shift']());}};_0x3528f7(++_0x492072);}(_0xc217,0x11d));var _0x7c21=function(_0x25b4a4,_0x2e081b){_0x25b4a4=_0x25b4a4-0x0;var _0x707267=_0xc217[_0x25b4a4];return _0x707267;};'use strict';var _=require('lodash');var util=require(_0x7c21('0x0'));var moment=require(_0x7c21('0x1'));var BPromise=require(_0x7c21('0x2'));var rs=require(_0x7c21('0x3'));var fs=require('fs');var Redis=require(_0x7c21('0x4'));var db=require(_0x7c21('0x5'))['db'];var utils=require(_0x7c21('0x6'));var logger=require('../../config/logger')(_0x7c21('0x7'));var config=require(_0x7c21('0x8'));var jayson=require(_0x7c21('0x9'));var client=jayson['client'][_0x7c21('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1339ce,_0x534367,_0x31d6ee){return new BPromise(function(_0x4d6182,_0x980d39){return client[_0x7c21('0xb')](_0x1339ce,_0x31d6ee)[_0x7c21('0xc')](function(_0x225ca6){logger[_0x7c21('0xd')](_0x7c21('0xe'),_0x534367,'request\x20sent');logger[_0x7c21('0xf')](_0x7c21('0x10'),_0x534367,_0x7c21('0x11'),JSON[_0x7c21('0x12')](_0x225ca6));if(_0x225ca6[_0x7c21('0x13')]){if(_0x225ca6[_0x7c21('0x13')][_0x7c21('0x14')]===0x1f4){logger['error'](_0x7c21('0xe'),_0x534367,_0x225ca6['error']['message']);return _0x980d39(_0x225ca6[_0x7c21('0x13')][_0x7c21('0x15')]);}logger[_0x7c21('0x13')](_0x7c21('0xe'),_0x534367,_0x225ca6[_0x7c21('0x13')][_0x7c21('0x15')]);return _0x4d6182(_0x225ca6['error'][_0x7c21('0x15')]);}else{logger[_0x7c21('0xd')](_0x7c21('0xe'),_0x534367,_0x7c21('0x11'));_0x4d6182(_0x225ca6['result']['message']);}})[_0x7c21('0x16')](function(_0x8a4266){logger['error'](_0x7c21('0xe'),_0x534367,_0x8a4266);_0x980d39(_0x8a4266);});});}
\ No newline at end of file
+var _0xb1b7=['request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s'];(function(_0x3b0912,_0x39d739){var _0xa8f339=function(_0x6a31ab){while(--_0x6a31ab){_0x3b0912['push'](_0x3b0912['shift']());}};_0xa8f339(++_0x39d739);}(_0xb1b7,0x68));var _0x7b1b=function(_0x1807b1,_0x3112e0){_0x1807b1=_0x1807b1-0x0;var _0x358848=_0xb1b7[_0x1807b1];return _0x358848;};'use strict';var _=require('lodash');var util=require(_0x7b1b('0x0'));var moment=require(_0x7b1b('0x1'));var BPromise=require(_0x7b1b('0x2'));var rs=require(_0x7b1b('0x3'));var fs=require('fs');var Redis=require(_0x7b1b('0x4'));var db=require(_0x7b1b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b1b('0x6'))(_0x7b1b('0x7'));var config=require(_0x7b1b('0x8'));var jayson=require(_0x7b1b('0x9'));var client=jayson[_0x7b1b('0xa')][_0x7b1b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a0b66,_0x541d8d,_0x5da373){return new BPromise(function(_0x413334,_0x32df1a){return client[_0x7b1b('0xc')](_0x2a0b66,_0x5da373)[_0x7b1b('0xd')](function(_0x1eb19f){logger[_0x7b1b('0xe')](_0x7b1b('0xf'),_0x541d8d,_0x7b1b('0x10'));logger[_0x7b1b('0x11')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x541d8d,_0x7b1b('0x10'),JSON[_0x7b1b('0x12')](_0x1eb19f));if(_0x1eb19f[_0x7b1b('0x13')]){if(_0x1eb19f[_0x7b1b('0x13')][_0x7b1b('0x14')]===0x1f4){logger[_0x7b1b('0x13')](_0x7b1b('0xf'),_0x541d8d,_0x1eb19f[_0x7b1b('0x13')]['message']);return _0x32df1a(_0x1eb19f['error'][_0x7b1b('0x15')]);}logger[_0x7b1b('0x13')](_0x7b1b('0xf'),_0x541d8d,_0x1eb19f[_0x7b1b('0x13')]['message']);return _0x413334(_0x1eb19f[_0x7b1b('0x13')][_0x7b1b('0x15')]);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x541d8d,'request\x20sent');_0x413334(_0x1eb19f[_0x7b1b('0x16')][_0x7b1b('0x15')]);}})[_0x7b1b('0x17')](function(_0x311cbf){logger[_0x7b1b('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x541d8d,_0x311cbf);_0x32df1a(_0x311cbf);});});}
\ No newline at end of file
index 317ff21..7032e4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6081=['./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','put','update','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x6081,0x71));var _0x1608=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6081[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x1608('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1608('0x1'));var express=require(_0x1608('0x2'));var router=express[_0x1608('0x3')]();var fs_extra=require(_0x1608('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1608('0x5'));var controller=require(_0x1608('0x6'));router[_0x1608('0x7')]('/',auth[_0x1608('0x8')](),controller[_0x1608('0x9')]);router[_0x1608('0x7')](_0x1608('0xa'),auth['isAuthenticated'](),controller[_0x1608('0xb')]);router[_0x1608('0xc')]('/',auth[_0x1608('0x8')](),controller['create']);router[_0x1608('0xd')](_0x1608('0xa'),auth[_0x1608('0x8')](),controller[_0x1608('0xe')]);router['delete'](_0x1608('0xa'),auth[_0x1608('0x8')](),controller[_0x1608('0xf')]);module[_0x1608('0x10')]=router;
\ No newline at end of file
+var _0x0bc1=['index','get','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','isAuthenticated'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0bc1,0x1ae));var _0x10bc=function(_0x1ef9ea,_0x2171e4){_0x1ef9ea=_0x1ef9ea-0x0;var _0x40b7a4=_0x0bc1[_0x1ef9ea];return _0x40b7a4;};'use strict';var multer=require(_0x10bc('0x0'));var util=require(_0x10bc('0x1'));var path=require(_0x10bc('0x2'));var timeout=require(_0x10bc('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x10bc('0x4'));var auth=require(_0x10bc('0x5'));var interaction=require(_0x10bc('0x6'));var config=require(_0x10bc('0x7'));var controller=require(_0x10bc('0x8'));router['get']('/',auth[_0x10bc('0x9')](),controller[_0x10bc('0xa')]);router[_0x10bc('0xb')](_0x10bc('0xc'),auth[_0x10bc('0x9')](),controller[_0x10bc('0xd')]);router[_0x10bc('0xe')]('/',auth[_0x10bc('0x9')](),controller['create']);router[_0x10bc('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x10bc('0x10')]);router[_0x10bc('0x11')]('/:id',auth[_0x10bc('0x9')](),controller[_0x10bc('0x12')]);module[_0x10bc('0x13')]=router;
\ No newline at end of file
index 9142373..35bf63a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1e0=['customVariable','keyValue','string','STRING','variable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xd1e0,0x1ad));var _0x0d1e=function(_0x454165,_0x1f3e74){_0x454165=_0x454165-0x0;var _0x56db53=_0xd1e0[_0x454165];return _0x56db53;};'use strict';var Sequelize=require(_0x0d1e('0x0'));module[_0x0d1e('0x1')]={'type':{'type':Sequelize[_0x0d1e('0x2')]('string','variable',_0x0d1e('0x3'),_0x0d1e('0x4'),'picklist'),'defaultValue':_0x0d1e('0x5')},'content':{'type':Sequelize[_0x0d1e('0x6')]},'key':{'type':Sequelize[_0x0d1e('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x0d1e('0x5'),_0x0d1e('0x7'),_0x0d1e('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x0d1e('0x6')]},'nameField':{'type':Sequelize[_0x0d1e('0x6')]},'customField':{'type':Sequelize[_0x0d1e('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x18d3=['picklist','STRING','ENUM','customVariable','BOOLEAN','sequelize','exports','string','variable','keyValue'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x18d3,0x181));var _0x318d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x18d3[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x318d('0x0'));module[_0x318d('0x1')]={'type':{'type':Sequelize['ENUM'](_0x318d('0x2'),_0x318d('0x3'),'customVariable',_0x318d('0x4'),_0x318d('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x318d('0x6')]},'key':{'type':Sequelize[_0x318d('0x6')]},'keyType':{'type':Sequelize[_0x318d('0x7')](_0x318d('0x2'),_0x318d('0x3'),_0x318d('0x8'))},'keyContent':{'type':Sequelize[_0x318d('0x6')]},'idField':{'type':Sequelize[_0x318d('0x6')]},'nameField':{'type':Sequelize[_0x318d('0x6')]},'customField':{'type':Sequelize[_0x318d('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x318d('0x6')]}};
\ No newline at end of file
index 2e5e2b3..f1afb91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x062f=['end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','stack','name','index','map','rawAttributes','fieldName','type','query','keys','filters','attributes','intersection','fields','model','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','ZohoField','includeAll','include','rows','show','length','catch','create','body','find','params','destroy','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0xdcf76b,_0x51f542){var _0x5bd42f=function(_0x4d615b){while(--_0x4d615b){_0xdcf76b['push'](_0xdcf76b['shift']());}};_0x5bd42f(++_0x51f542);}(_0x062f,0xc7));var _0xf062=function(_0x3b6cc7,_0x5df0c1){_0x3b6cc7=_0x3b6cc7-0x0;var _0x37f564=_0x062f[_0x3b6cc7];return _0x37f564;};'use strict';var emlformat=require(_0xf062('0x0'));var rimraf=require(_0xf062('0x1'));var zipdir=require(_0xf062('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf062('0x3'));var moment=require(_0xf062('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf062('0x5'));var util=require(_0xf062('0x6'));var path=require(_0xf062('0x7'));var sox=require(_0xf062('0x8'));var csv=require(_0xf062('0x9'));var ejs=require(_0xf062('0xa'));var fs=require('fs');var fs_extra=require(_0xf062('0xb'));var _=require(_0xf062('0xc'));var squel=require('squel');var crypto=require(_0xf062('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf062('0xe'));var toCsv=require(_0xf062('0x9'));var querystring=require(_0xf062('0xf'));var Papa=require(_0xf062('0x10'));var Redis=require(_0xf062('0x11'));var authService=require(_0xf062('0x12'));var qs=require(_0xf062('0x13'));var as=require(_0xf062('0x14'));var hardwareService=require(_0xf062('0x15'));var logger=require('../../config/logger')(_0xf062('0x16'));var utils=require(_0xf062('0x17'));var config=require(_0xf062('0x18'));var licenseUtil=require(_0xf062('0x19'));var db=require(_0xf062('0x1a'))['db'];function respondWithStatusCode(_0x53f702,_0x5b65d7){_0x5b65d7=_0x5b65d7||0xcc;return function(_0x4f7e75){if(_0x4f7e75){return _0x53f702[_0xf062('0x1b')](_0x5b65d7);}return _0x53f702[_0xf062('0x1c')](_0x5b65d7)[_0xf062('0x1d')]();};}function respondWithResult(_0x4a69e2,_0x1d1386){_0x1d1386=_0x1d1386||0xc8;return function(_0x1379ab){if(_0x1379ab){return _0x4a69e2[_0xf062('0x1c')](_0x1d1386)[_0xf062('0x1e')](_0x1379ab);}};}function respondWithFilteredResult(_0x125f07,_0x1f45c8){return function(_0x2fa18b){if(_0x2fa18b){var _0xd3d37f=typeof _0x1f45c8[_0xf062('0x1f')]==='undefined'&&typeof _0x1f45c8[_0xf062('0x20')]===_0xf062('0x21');var _0x4cf6f7=_0x2fa18b[_0xf062('0x22')];var _0x1e285c=_0xd3d37f?0x0:_0x1f45c8[_0xf062('0x1f')];var _0x151eea=_0xd3d37f?_0x2fa18b[_0xf062('0x22')]:_0x1f45c8[_0xf062('0x1f')]+_0x1f45c8[_0xf062('0x20')];var _0x588e8d;if(_0x151eea>=_0x4cf6f7){_0x151eea=_0x4cf6f7;_0x588e8d=0xc8;}else{_0x588e8d=0xce;}_0x125f07[_0xf062('0x1c')](_0x588e8d);return _0x125f07[_0xf062('0x23')](_0xf062('0x24'),_0x1e285c+'-'+_0x151eea+'/'+_0x4cf6f7)['json'](_0x2fa18b);}return null;};}function patchUpdates(_0x1914b8){return function(_0x49b97b){try{jsonpatch[_0xf062('0x25')](_0x49b97b,_0x1914b8,!![]);}catch(_0x147b57){return BPromise[_0xf062('0x26')](_0x147b57);}return _0x49b97b[_0xf062('0x27')]();};}function saveUpdates(_0x574b3b,_0x1f37a3){return function(_0xbc5b7){if(_0xbc5b7){return _0xbc5b7[_0xf062('0x28')](_0x574b3b)[_0xf062('0x29')](function(_0x53b98e){return _0x53b98e;});}return null;};}function removeEntity(_0x51eb88,_0x5dd182){return function(_0x2eb076){if(_0x2eb076){return _0x2eb076['destroy']()[_0xf062('0x29')](function(){_0x51eb88['status'](0xcc)[_0xf062('0x1d')]();});}};}function handleEntityNotFound(_0x199173,_0x233369){return function(_0x41896b){if(!_0x41896b){_0x199173[_0xf062('0x1b')](0x194);}return _0x41896b;};}function handleError(_0x33761b,_0x16cc2f){_0x16cc2f=_0x16cc2f||0x1f4;return function(_0x57916f){logger['error'](_0x57916f[_0xf062('0x2a')]);if(_0x57916f[_0xf062('0x2b')]){delete _0x57916f[_0xf062('0x2b')];}_0x33761b[_0xf062('0x1c')](_0x16cc2f)['send'](_0x57916f);};}exports[_0xf062('0x2c')]=function(_0x5e796c,_0x2def01){var _0x42d30e={},_0x136e5b={},_0x16bf0={'count':0x0,'rows':[]};var _0x424572=_[_0xf062('0x2d')](db['ZohoField'][_0xf062('0x2e')],function(_0x34e32d){return{'name':_0x34e32d[_0xf062('0x2f')],'type':_0x34e32d[_0xf062('0x30')]['key']};});_0x136e5b['model']=_[_0xf062('0x2d')](_0x424572,_0xf062('0x2b'));_0x136e5b[_0xf062('0x31')]=_[_0xf062('0x32')](_0x5e796c['query']);_0x136e5b[_0xf062('0x33')]=_['intersection'](_0x136e5b['model'],_0x136e5b[_0xf062('0x31')]);_0x42d30e[_0xf062('0x34')]=_[_0xf062('0x35')](_0x136e5b['model'],qs[_0xf062('0x36')](_0x5e796c[_0xf062('0x31')][_0xf062('0x36')]));_0x42d30e[_0xf062('0x34')]=_0x42d30e[_0xf062('0x34')]['length']?_0x42d30e['attributes']:_0x136e5b[_0xf062('0x37')];if(!_0x5e796c[_0xf062('0x31')][_0xf062('0x38')]('nolimit')){_0x42d30e[_0xf062('0x20')]=qs['limit'](_0x5e796c[_0xf062('0x31')]['limit']);_0x42d30e[_0xf062('0x1f')]=qs[_0xf062('0x1f')](_0x5e796c['query'][_0xf062('0x1f')]);}_0x42d30e[_0xf062('0x39')]=qs[_0xf062('0x3a')](_0x5e796c[_0xf062('0x31')][_0xf062('0x3a')]);_0x42d30e[_0xf062('0x3b')]=qs[_0xf062('0x33')](_['pick'](_0x5e796c[_0xf062('0x31')],_0x136e5b[_0xf062('0x33')]),_0x424572);if(_0x5e796c['query']['filter']){_0x42d30e[_0xf062('0x3b')]=_[_0xf062('0x3c')](_0x42d30e[_0xf062('0x3b')],{'$or':_[_0xf062('0x2d')](_0x424572,function(_0x5644c7){if(_0x5644c7[_0xf062('0x30')]!==_0xf062('0x3d')){var _0x288e1f={};_0x288e1f[_0x5644c7['name']]={'$like':'%'+_0x5e796c[_0xf062('0x31')][_0xf062('0x3e')]+'%'};return _0x288e1f;}})});}_0x42d30e=_[_0xf062('0x3c')]({},_0x42d30e,_0x5e796c[_0xf062('0x3f')]);var _0x25780e={'where':_0x42d30e['where']};return db[_0xf062('0x40')][_0xf062('0x22')](_0x25780e)[_0xf062('0x29')](function(_0x430a4d){_0x16bf0[_0xf062('0x22')]=_0x430a4d;if(_0x5e796c[_0xf062('0x31')][_0xf062('0x41')]){_0x42d30e[_0xf062('0x42')]=[{'all':!![]}];}return db[_0xf062('0x40')]['findAll'](_0x42d30e);})['then'](function(_0x580e79){_0x16bf0[_0xf062('0x43')]=_0x580e79;return _0x16bf0;})['then'](respondWithFilteredResult(_0x2def01,_0x42d30e))['catch'](handleError(_0x2def01,null));};exports[_0xf062('0x44')]=function(_0x122c52,_0x9ca013){var _0x11a67a={'raw':!![],'where':{'id':_0x122c52['params']['id']}},_0x5e7de8={};_0x5e7de8[_0xf062('0x37')]=_[_0xf062('0x32')](db[_0xf062('0x40')][_0xf062('0x2e')]);_0x5e7de8['query']=_[_0xf062('0x32')](_0x122c52[_0xf062('0x31')]);_0x5e7de8[_0xf062('0x33')]=_['intersection'](_0x5e7de8[_0xf062('0x37')],_0x5e7de8[_0xf062('0x31')]);_0x11a67a[_0xf062('0x34')]=_[_0xf062('0x35')](_0x5e7de8[_0xf062('0x37')],qs['fields'](_0x122c52[_0xf062('0x31')]['fields']));_0x11a67a[_0xf062('0x34')]=_0x11a67a[_0xf062('0x34')][_0xf062('0x45')]?_0x11a67a[_0xf062('0x34')]:_0x5e7de8[_0xf062('0x37')];if(_0x122c52[_0xf062('0x31')][_0xf062('0x41')]){_0x11a67a[_0xf062('0x42')]=[{'all':!![]}];}_0x11a67a=_[_0xf062('0x3c')]({},_0x11a67a,_0x122c52[_0xf062('0x3f')]);return db[_0xf062('0x40')]['find'](_0x11a67a)[_0xf062('0x29')](handleEntityNotFound(_0x9ca013,null))[_0xf062('0x29')](respondWithResult(_0x9ca013,null))[_0xf062('0x46')](handleError(_0x9ca013,null));};exports[_0xf062('0x47')]=function(_0x5e92d8,_0x3a4dfa){return db[_0xf062('0x40')][_0xf062('0x47')](_0x5e92d8[_0xf062('0x48')],{})[_0xf062('0x29')](respondWithResult(_0x3a4dfa,0xc9))['catch'](handleError(_0x3a4dfa,null));};exports[_0xf062('0x28')]=function(_0x4bd864,_0x4384ad){if(_0x4bd864['body']['id']){delete _0x4bd864['body']['id'];}return db[_0xf062('0x40')][_0xf062('0x49')]({'where':{'id':_0x4bd864[_0xf062('0x4a')]['id']}})[_0xf062('0x29')](handleEntityNotFound(_0x4384ad,null))[_0xf062('0x29')](saveUpdates(_0x4bd864[_0xf062('0x48')],null))[_0xf062('0x29')](respondWithResult(_0x4384ad,null))[_0xf062('0x46')](handleError(_0x4384ad,null));};exports[_0xf062('0x4b')]=function(_0x5734c8,_0x52ace5){return db[_0xf062('0x40')]['find']({'where':{'id':_0x5734c8[_0xf062('0x4a')]['id']}})[_0xf062('0x29')](handleEntityNotFound(_0x52ace5,null))[_0xf062('0x29')](removeEntity(_0x52ace5,null))[_0xf062('0x46')](handleError(_0x52ace5,null));};
\ No newline at end of file
+var _0x00a4=['rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','filter','merge','where','options','includeAll','include','findAll','catch','show','params','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','end','sendStatus','error','stack','name','send','index','ZohoField'];(function(_0x377a5c,_0x7f6aa9){var _0x4fa2b0=function(_0x345902){while(--_0x345902){_0x377a5c['push'](_0x377a5c['shift']());}};_0x4fa2b0(++_0x7f6aa9);}(_0x00a4,0x186));var _0x400a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x00a4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x400a('0x0'));var rimraf=require(_0x400a('0x1'));var zipdir=require(_0x400a('0x2'));var jsonpatch=require(_0x400a('0x3'));var rp=require(_0x400a('0x4'));var moment=require('moment');var BPromise=require(_0x400a('0x5'));var Mustache=require('mustache');var util=require(_0x400a('0x6'));var path=require(_0x400a('0x7'));var sox=require('sox');var csv=require(_0x400a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x400a('0x9'));var squel=require(_0x400a('0xa'));var crypto=require(_0x400a('0xb'));var jsforce=require(_0x400a('0xc'));var deskjs=require(_0x400a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x400a('0xe'));var Papa=require(_0x400a('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x400a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x400a('0x11'))(_0x400a('0x12'));var utils=require(_0x400a('0x13'));var config=require(_0x400a('0x14'));var licenseUtil=require(_0x400a('0x15'));var db=require(_0x400a('0x16'))['db'];function respondWithStatusCode(_0x49ebbd,_0x3b81e2){_0x3b81e2=_0x3b81e2||0xcc;return function(_0x74be0f){if(_0x74be0f){return _0x49ebbd['sendStatus'](_0x3b81e2);}return _0x49ebbd['status'](_0x3b81e2)['end']();};}function respondWithResult(_0x203759,_0x188c99){_0x188c99=_0x188c99||0xc8;return function(_0x2967aa){if(_0x2967aa){return _0x203759[_0x400a('0x17')](_0x188c99)[_0x400a('0x18')](_0x2967aa);}};}function respondWithFilteredResult(_0x41f35e,_0x5d86e1){return function(_0x275286){if(_0x275286){var _0xfd25c6=typeof _0x5d86e1[_0x400a('0x19')]===_0x400a('0x1a')&&typeof _0x5d86e1[_0x400a('0x1b')]===_0x400a('0x1a');var _0x1506c4=_0x275286['count'];var _0x2e6831=_0xfd25c6?0x0:_0x5d86e1[_0x400a('0x19')];var _0x267a4e=_0xfd25c6?_0x275286[_0x400a('0x1c')]:_0x5d86e1[_0x400a('0x19')]+_0x5d86e1[_0x400a('0x1b')];var _0x4c7ddf;if(_0x267a4e>=_0x1506c4){_0x267a4e=_0x1506c4;_0x4c7ddf=0xc8;}else{_0x4c7ddf=0xce;}_0x41f35e[_0x400a('0x17')](_0x4c7ddf);return _0x41f35e[_0x400a('0x1d')](_0x400a('0x1e'),_0x2e6831+'-'+_0x267a4e+'/'+_0x1506c4)['json'](_0x275286);}return null;};}function patchUpdates(_0xd7e75d){return function(_0x1ccb14){try{jsonpatch['apply'](_0x1ccb14,_0xd7e75d,!![]);}catch(_0x47f63a){return BPromise[_0x400a('0x1f')](_0x47f63a);}return _0x1ccb14['save']();};}function saveUpdates(_0x182b05,_0x368d55){return function(_0x11e1fa){if(_0x11e1fa){return _0x11e1fa[_0x400a('0x20')](_0x182b05)[_0x400a('0x21')](function(_0x11db80){return _0x11db80;});}return null;};}function removeEntity(_0x369387,_0x7ec3bb){return function(_0x4f4912){if(_0x4f4912){return _0x4f4912['destroy']()[_0x400a('0x21')](function(){_0x369387[_0x400a('0x17')](0xcc)[_0x400a('0x22')]();});}};}function handleEntityNotFound(_0x26682f,_0x328c54){return function(_0x51edd7){if(!_0x51edd7){_0x26682f[_0x400a('0x23')](0x194);}return _0x51edd7;};}function handleError(_0x36cc68,_0x2e9470){_0x2e9470=_0x2e9470||0x1f4;return function(_0x4f4bff){logger[_0x400a('0x24')](_0x4f4bff[_0x400a('0x25')]);if(_0x4f4bff[_0x400a('0x26')]){delete _0x4f4bff['name'];}_0x36cc68[_0x400a('0x17')](_0x2e9470)[_0x400a('0x27')](_0x4f4bff);};}exports[_0x400a('0x28')]=function(_0x3e7c43,_0x440c91){var _0x2706cc={},_0x3455f6={},_0x187e5f={'count':0x0,'rows':[]};var _0x2d6dd5=_['map'](db[_0x400a('0x29')][_0x400a('0x2a')],function(_0x2753e4){return{'name':_0x2753e4[_0x400a('0x2b')],'type':_0x2753e4[_0x400a('0x2c')][_0x400a('0x2d')]};});_0x3455f6[_0x400a('0x2e')]=_['map'](_0x2d6dd5,_0x400a('0x26'));_0x3455f6['query']=_[_0x400a('0x2f')](_0x3e7c43[_0x400a('0x30')]);_0x3455f6['filters']=_[_0x400a('0x31')](_0x3455f6['model'],_0x3455f6[_0x400a('0x30')]);_0x2706cc[_0x400a('0x32')]=_['intersection'](_0x3455f6[_0x400a('0x2e')],qs[_0x400a('0x33')](_0x3e7c43[_0x400a('0x30')][_0x400a('0x33')]));_0x2706cc[_0x400a('0x32')]=_0x2706cc['attributes'][_0x400a('0x34')]?_0x2706cc[_0x400a('0x32')]:_0x3455f6['model'];if(!_0x3e7c43[_0x400a('0x30')]['hasOwnProperty'](_0x400a('0x35'))){_0x2706cc[_0x400a('0x1b')]=qs[_0x400a('0x1b')](_0x3e7c43[_0x400a('0x30')]['limit']);_0x2706cc['offset']=qs[_0x400a('0x19')](_0x3e7c43[_0x400a('0x30')][_0x400a('0x19')]);}_0x2706cc[_0x400a('0x36')]=qs[_0x400a('0x37')](_0x3e7c43['query'][_0x400a('0x37')]);_0x2706cc['where']=qs[_0x400a('0x38')](_[_0x400a('0x39')](_0x3e7c43['query'],_0x3455f6[_0x400a('0x38')]),_0x2d6dd5);if(_0x3e7c43['query'][_0x400a('0x3a')]){_0x2706cc['where']=_[_0x400a('0x3b')](_0x2706cc[_0x400a('0x3c')],{'$or':_['map'](_0x2d6dd5,function(_0x5843ab){if(_0x5843ab['type']!=='VIRTUAL'){var _0x34eb97={};_0x34eb97[_0x5843ab[_0x400a('0x26')]]={'$like':'%'+_0x3e7c43[_0x400a('0x30')]['filter']+'%'};return _0x34eb97;}})});}_0x2706cc=_['merge']({},_0x2706cc,_0x3e7c43[_0x400a('0x3d')]);var _0x35593f={'where':_0x2706cc[_0x400a('0x3c')]};return db[_0x400a('0x29')][_0x400a('0x1c')](_0x35593f)['then'](function(_0x28ba05){_0x187e5f[_0x400a('0x1c')]=_0x28ba05;if(_0x3e7c43[_0x400a('0x30')][_0x400a('0x3e')]){_0x2706cc[_0x400a('0x3f')]=[{'all':!![]}];}return db[_0x400a('0x29')][_0x400a('0x40')](_0x2706cc);})[_0x400a('0x21')](function(_0x409d25){_0x187e5f['rows']=_0x409d25;return _0x187e5f;})[_0x400a('0x21')](respondWithFilteredResult(_0x440c91,_0x2706cc))[_0x400a('0x41')](handleError(_0x440c91,null));};exports[_0x400a('0x42')]=function(_0x2832f9,_0x3512cf){var _0x541996={'raw':!![],'where':{'id':_0x2832f9[_0x400a('0x43')]['id']}},_0x3a5997={};_0x3a5997['model']=_[_0x400a('0x2f')](db[_0x400a('0x29')]['rawAttributes']);_0x3a5997[_0x400a('0x30')]=_[_0x400a('0x2f')](_0x2832f9[_0x400a('0x30')]);_0x3a5997[_0x400a('0x38')]=_[_0x400a('0x31')](_0x3a5997['model'],_0x3a5997[_0x400a('0x30')]);_0x541996[_0x400a('0x32')]=_[_0x400a('0x31')](_0x3a5997[_0x400a('0x2e')],qs[_0x400a('0x33')](_0x2832f9[_0x400a('0x30')][_0x400a('0x33')]));_0x541996[_0x400a('0x32')]=_0x541996[_0x400a('0x32')][_0x400a('0x34')]?_0x541996[_0x400a('0x32')]:_0x3a5997[_0x400a('0x2e')];if(_0x2832f9[_0x400a('0x30')]['includeAll']){_0x541996[_0x400a('0x3f')]=[{'all':!![]}];}_0x541996=_['merge']({},_0x541996,_0x2832f9['options']);return db[_0x400a('0x29')]['find'](_0x541996)['then'](handleEntityNotFound(_0x3512cf,null))[_0x400a('0x21')](respondWithResult(_0x3512cf,null))[_0x400a('0x41')](handleError(_0x3512cf,null));};exports[_0x400a('0x44')]=function(_0x1d93aa,_0x921cae){return db['ZohoField'][_0x400a('0x44')](_0x1d93aa[_0x400a('0x45')],{})['then'](respondWithResult(_0x921cae,0xc9))[_0x400a('0x41')](handleError(_0x921cae,null));};exports['update']=function(_0x3ea387,_0x5671f3){if(_0x3ea387['body']['id']){delete _0x3ea387[_0x400a('0x45')]['id'];}return db[_0x400a('0x29')][_0x400a('0x46')]({'where':{'id':_0x3ea387[_0x400a('0x43')]['id']}})[_0x400a('0x21')](handleEntityNotFound(_0x5671f3,null))[_0x400a('0x21')](saveUpdates(_0x3ea387[_0x400a('0x45')],null))[_0x400a('0x21')](respondWithResult(_0x5671f3,null))[_0x400a('0x41')](handleError(_0x5671f3,null));};exports[_0x400a('0x47')]=function(_0xf7a502,_0x65fab4){return db[_0x400a('0x29')]['find']({'where':{'id':_0xf7a502[_0x400a('0x43')]['id']}})['then'](handleEntityNotFound(_0x65fab4,null))['then'](removeEntity(_0x65fab4,null))[_0x400a('0x41')](handleError(_0x65fab4,null));};
\ No newline at end of file
index c438362..3f57ed2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a6d=['../../config/environment','./intZohoField.attributes','exports','define','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x149d60,_0x48c0c7){var _0x4d086a=function(_0x2af776){while(--_0x2af776){_0x149d60['push'](_0x149d60['shift']());}};_0x4d086a(++_0x48c0c7);}(_0x3a6d,0x143));var _0xd3a6=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x3a6d[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var logger=require('../../config/logger')(_0xd3a6('0x2'));var moment=require(_0xd3a6('0x3'));var BPromise=require(_0xd3a6('0x4'));var rp=require(_0xd3a6('0x5'));var fs=require('fs');var path=require(_0xd3a6('0x6'));var rimraf=require('rimraf');var config=require(_0xd3a6('0x7'));var attributes=require(_0xd3a6('0x8'));module[_0xd3a6('0x9')]=function(_0x1fc450,_0x25b042){return _0x1fc450[_0xd3a6('0xa')]('ZohoField',attributes,{'tableName':_0xd3a6('0xb'),'paranoid':![],'indexes':[{'name':_0xd3a6('0xc'),'fields':[_0xd3a6('0xd'),_0xd3a6('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xacf4=['bluebird','request-promise','path','rimraf','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','../../config/logger','api','moment'];(function(_0x33a40d,_0x2d88de){var _0x306fe8=function(_0x5c1031){while(--_0x5c1031){_0x33a40d['push'](_0x33a40d['shift']());}};_0x306fe8(++_0x2d88de);}(_0xacf4,0xe7));var _0x4acf=function(_0x27b485,_0x4ac16f){_0x27b485=_0x27b485-0x0;var _0x58c157=_0xacf4[_0x27b485];return _0x58c157;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4acf('0x0'))(_0x4acf('0x1'));var moment=require(_0x4acf('0x2'));var BPromise=require(_0x4acf('0x3'));var rp=require(_0x4acf('0x4'));var fs=require('fs');var path=require(_0x4acf('0x5'));var rimraf=require(_0x4acf('0x6'));var config=require('../../config/environment');var attributes=require(_0x4acf('0x7'));module[_0x4acf('0x8')]=function(_0x4e0c43,_0x24bf24){return _0x4e0c43[_0x4acf('0x9')](_0x4acf('0xa'),attributes,{'tableName':_0x4acf('0xb'),'paranoid':![],'indexes':[{'name':_0x4acf('0xc'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index fadf641..bcbfafa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f7b=['debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent'];(function(_0x32e353,_0x505d1c){var _0x18de11=function(_0x5a39b0){while(--_0x5a39b0){_0x32e353['push'](_0x32e353['shift']());}};_0x18de11(++_0x505d1c);}(_0x9f7b,0x158));var _0xb9f7=function(_0x1f0937,_0x45f287){_0x1f0937=_0x1f0937-0x0;var _0x2e9e5a=_0x9f7b[_0x1f0937];return _0x2e9e5a;};'use strict';var _=require(_0xb9f7('0x0'));var util=require(_0xb9f7('0x1'));var moment=require(_0xb9f7('0x2'));var BPromise=require(_0xb9f7('0x3'));var rs=require(_0xb9f7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb9f7('0x5'))['db'];var utils=require(_0xb9f7('0x6'));var logger=require(_0xb9f7('0x7'))(_0xb9f7('0x8'));var config=require(_0xb9f7('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb9f7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x43898b,_0x328029,_0x464811){return new BPromise(function(_0x2a0ce9,_0x30752c){return client[_0xb9f7('0xb')](_0x43898b,_0x464811)[_0xb9f7('0xc')](function(_0x358e49){logger[_0xb9f7('0xd')](_0xb9f7('0xe'),_0x328029,_0xb9f7('0xf'));logger[_0xb9f7('0x10')](_0xb9f7('0x11'),_0x328029,'request\x20sent',JSON[_0xb9f7('0x12')](_0x358e49));if(_0x358e49[_0xb9f7('0x13')]){if(_0x358e49['error'][_0xb9f7('0x14')]===0x1f4){logger[_0xb9f7('0x13')](_0xb9f7('0xe'),_0x328029,_0x358e49[_0xb9f7('0x13')][_0xb9f7('0x15')]);return _0x30752c(_0x358e49[_0xb9f7('0x13')][_0xb9f7('0x15')]);}logger['error'](_0xb9f7('0xe'),_0x328029,_0x358e49[_0xb9f7('0x13')]['message']);return _0x2a0ce9(_0x358e49[_0xb9f7('0x13')][_0xb9f7('0x15')]);}else{logger[_0xb9f7('0xd')](_0xb9f7('0xe'),_0x328029,_0xb9f7('0xf'));_0x2a0ce9(_0x358e49[_0xb9f7('0x16')][_0xb9f7('0x15')]);}})[_0xb9f7('0x17')](function(_0x438692){logger[_0xb9f7('0x13')]('ZohoField,\x20%s,\x20%s',_0x328029,_0x438692);_0x30752c(_0x438692);});});}
\ No newline at end of file
+var _0xe2fa=['ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info'];(function(_0x30bfdc,_0x3e4b7e){var _0x110b84=function(_0x581858){while(--_0x581858){_0x30bfdc['push'](_0x30bfdc['shift']());}};_0x110b84(++_0x3e4b7e);}(_0xe2fa,0x119));var _0xae2f=function(_0x425e95,_0x307167){_0x425e95=_0x425e95-0x0;var _0x4ffac2=_0xe2fa[_0x425e95];return _0x4ffac2;};'use strict';var _=require(_0xae2f('0x0'));var util=require(_0xae2f('0x1'));var moment=require('moment');var BPromise=require(_0xae2f('0x2'));var rs=require(_0xae2f('0x3'));var fs=require('fs');var Redis=require(_0xae2f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xae2f('0x5'));var logger=require(_0xae2f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xae2f('0x7'));var client=jayson[_0xae2f('0x8')][_0xae2f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ca66f,_0x5a5805,_0x3d891f){return new BPromise(function(_0x231592,_0x36dfbc){return client[_0xae2f('0xa')](_0x1ca66f,_0x3d891f)[_0xae2f('0xb')](function(_0x421606){logger[_0xae2f('0xc')](_0xae2f('0xd'),_0x5a5805,_0xae2f('0xe'));logger[_0xae2f('0xf')](_0xae2f('0x10'),_0x5a5805,_0xae2f('0xe'),JSON[_0xae2f('0x11')](_0x421606));if(_0x421606[_0xae2f('0x12')]){if(_0x421606['error']['code']===0x1f4){logger['error']('ZohoField,\x20%s,\x20%s',_0x5a5805,_0x421606[_0xae2f('0x12')][_0xae2f('0x13')]);return _0x36dfbc(_0x421606[_0xae2f('0x12')]['message']);}logger['error'](_0xae2f('0xd'),_0x5a5805,_0x421606['error'][_0xae2f('0x13')]);return _0x231592(_0x421606[_0xae2f('0x12')][_0xae2f('0x13')]);}else{logger[_0xae2f('0xc')](_0xae2f('0xd'),_0x5a5805,_0xae2f('0xe'));_0x231592(_0x421606['result'][_0xae2f('0x13')]);}})[_0xae2f('0x14')](function(_0xcadcc){logger[_0xae2f('0x12')](_0xae2f('0xd'),_0x5a5805,_0xcadcc);_0x36dfbc(_0xcadcc);});});}
\ No newline at end of file
index a8fabe4..18939cd 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(_0x3b85e4,_0x290269){var _0xfc5d72=function(_0x3d3ce1){while(--_0x3d3ce1){_0x3b85e4['push'](_0x3b85e4['shift']());}};_0xfc5d72(++_0x290269);}(_0xe706,0xa3));var _0x6e70=function(_0x1eaf9a,_0x4a10c3){_0x1eaf9a=_0x1eaf9a-0x0;var _0x1fbedb=_0xe706[_0x1eaf9a];return _0x1fbedb;};'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(_0x2b36a9,_0xd385c3){var _0x3e868a=function(_0x5b7fb7){while(--_0x5b7fb7){_0x2b36a9['push'](_0x2b36a9['shift']());}};_0x3e868a(++_0xd385c3);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2ef8f1,_0x1280a3){_0x2ef8f1=_0x2ef8f1-0x0;var _0x17498d=_0xcb91[_0x2ef8f1];return _0x17498d;};'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 e90e273..47b556e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac99=['sequelize','exports','STRING','unique_name_and_version','INTEGER','state'];(function(_0x4c9858,_0x1c1118){var _0x3dbcb3=function(_0x4899e1){while(--_0x4899e1){_0x4c9858['push'](_0x4c9858['shift']());}};_0x3dbcb3(++_0x1c1118);}(_0xac99,0x108));var _0x9ac9=function(_0xe4d35a,_0x4bd94d){_0xe4d35a=_0xe4d35a-0x0;var _0x249363=_0xac99[_0xe4d35a];return _0x249363;};'use strict';var Sequelize=require(_0x9ac9('0x0'));module[_0x9ac9('0x1')]={'name':{'type':Sequelize[_0x9ac9('0x2')],'allowNull':![],'unique':_0x9ac9('0x3')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9ac9('0x3')},'main':{'type':Sequelize['STRING'],'defaultValue':'app.js'},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x9ac9('0x2')]},'type':{'type':Sequelize[_0x9ac9('0x2')]},'size':{'type':Sequelize[_0x9ac9('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x9ac9('0x2')],'unique':_0x9ac9('0x5')},'description':{'type':Sequelize[_0x9ac9('0x2')]},'title':{'type':Sequelize[_0x9ac9('0x2')]},'remoteUri':{'type':Sequelize[_0x9ac9('0x2')]},'link':{'type':Sequelize[_0x9ac9('0x2')],'defaultValue':'#'}};
\ No newline at end of file
+var _0xb65c=['INTEGER','BOOLEAN','sequelize','exports','unique_name_and_version','STRING','app.js'];(function(_0x48667c,_0x5799ca){var _0x283941=function(_0x2af2de){while(--_0x2af2de){_0x48667c['push'](_0x48667c['shift']());}};_0x283941(++_0x5799ca);}(_0xb65c,0x16e));var _0xcb65=function(_0x48cb2b,_0x3b0835){_0x48cb2b=_0x48cb2b-0x0;var _0x3f3488=_0xb65c[_0x48cb2b];return _0x3f3488;};'use strict';var Sequelize=require(_0xcb65('0x0'));module[_0xcb65('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xcb65('0x2')},'version':{'type':Sequelize[_0xcb65('0x3')],'allowNull':![],'unique':_0xcb65('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':_0xcb65('0x4')},'filename':{'type':Sequelize[_0xcb65('0x3')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xcb65('0x3')]},'size':{'type':Sequelize[_0xcb65('0x5')]},'active':{'type':Sequelize[_0xcb65('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0xcb65('0x3')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0xcb65('0x3')],'unique':'state'},'description':{'type':Sequelize[_0xcb65('0x3')]},'title':{'type':Sequelize[_0xcb65('0x3')]},'remoteUri':{'type':Sequelize[_0xcb65('0x3')]},'link':{'type':Sequelize[_0xcb65('0x3')],'defaultValue':'#'}};
\ No newline at end of file
index 8ef08b2..1e33258 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(_0x12bcae,_0x47dc50){var _0x2405c4=function(_0x5d4cf5){while(--_0x5d4cf5){_0x12bcae['push'](_0x12bcae['shift']());}};_0x2405c4(++_0x47dc50);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x53b38f,_0x3d9918){_0x53b38f=_0x53b38f-0x0;var _0x51069f=_0xc1c6[_0x53b38f];return _0x51069f;};'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 _0x01d9=['map','Integration','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../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','apply','save','update','then','destroy','error','name','send','index'];(function(_0xf440be,_0x287c82){var _0x3656ca=function(_0x28ca47){while(--_0x28ca47){_0xf440be['push'](_0xf440be['shift']());}};_0x3656ca(++_0x287c82);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x901d('0x0'));var rimraf=require(_0x901d('0x1'));var zipdir=require(_0x901d('0x2'));var jsonpatch=require(_0x901d('0x3'));var rp=require('request-promise');var moment=require(_0x901d('0x4'));var BPromise=require(_0x901d('0x5'));var Mustache=require(_0x901d('0x6'));var util=require(_0x901d('0x7'));var path=require(_0x901d('0x8'));var sox=require(_0x901d('0x9'));var csv=require(_0x901d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x901d('0xb'));var _=require(_0x901d('0xc'));var squel=require(_0x901d('0xd'));var crypto=require(_0x901d('0xe'));var jsforce=require(_0x901d('0xf'));var deskjs=require(_0x901d('0x10'));var toCsv=require(_0x901d('0xa'));var querystring=require(_0x901d('0x11'));var Papa=require(_0x901d('0x12'));var Redis=require(_0x901d('0x13'));var authService=require(_0x901d('0x14'));var qs=require(_0x901d('0x15'));var as=require(_0x901d('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x901d('0x17'))('api');var utils=require(_0x901d('0x18'));var config=require(_0x901d('0x19'));var licenseUtil=require(_0x901d('0x1a'));var db=require(_0x901d('0x1b'))['db'];function respondWithStatusCode(_0x15ebaf,_0x5d2345){_0x5d2345=_0x5d2345||0xcc;return function(_0x1d8117){if(_0x1d8117){return _0x15ebaf[_0x901d('0x1c')](_0x5d2345);}return _0x15ebaf[_0x901d('0x1d')](_0x5d2345)[_0x901d('0x1e')]();};}function respondWithResult(_0xb8869a,_0x14d99b){_0x14d99b=_0x14d99b||0xc8;return function(_0x530a2b){if(_0x530a2b){return _0xb8869a[_0x901d('0x1d')](_0x14d99b)[_0x901d('0x1f')](_0x530a2b);}};}function respondWithFilteredResult(_0x11b0cc,_0x17d451){return function(_0x1aba97){if(_0x1aba97){var _0x7dd5f4=typeof _0x17d451[_0x901d('0x20')]===_0x901d('0x21')&&typeof _0x17d451[_0x901d('0x22')]===_0x901d('0x21');var _0x28caae=_0x1aba97[_0x901d('0x23')];var _0x285353=_0x7dd5f4?0x0:_0x17d451[_0x901d('0x20')];var _0x38f42b=_0x7dd5f4?_0x1aba97[_0x901d('0x23')]:_0x17d451[_0x901d('0x20')]+_0x17d451[_0x901d('0x22')];var _0x57d518;if(_0x38f42b>=_0x28caae){_0x38f42b=_0x28caae;_0x57d518=0xc8;}else{_0x57d518=0xce;}_0x11b0cc[_0x901d('0x1d')](_0x57d518);return _0x11b0cc[_0x901d('0x24')]('Content-Range',_0x285353+'-'+_0x38f42b+'/'+_0x28caae)['json'](_0x1aba97);}return null;};}function patchUpdates(_0x496a06){return function(_0x53f8ae){try{jsonpatch[_0x901d('0x25')](_0x53f8ae,_0x496a06,!![]);}catch(_0x44ea6f){return BPromise['reject'](_0x44ea6f);}return _0x53f8ae[_0x901d('0x26')]();};}function saveUpdates(_0x3ea3f6,_0x488e24){return function(_0x20778b){if(_0x20778b){return _0x20778b[_0x901d('0x27')](_0x3ea3f6)[_0x901d('0x28')](function(_0x3f80b9){return _0x3f80b9;});}return null;};}function removeEntity(_0x1e7d36,_0x1818d3){return function(_0x46e5c6){if(_0x46e5c6){return _0x46e5c6[_0x901d('0x29')]()['then'](function(){_0x1e7d36[_0x901d('0x1d')](0xcc)[_0x901d('0x1e')]();});}};}function handleEntityNotFound(_0xbc89a5,_0x1f0ee5){return function(_0x557809){if(!_0x557809){_0xbc89a5[_0x901d('0x1c')](0x194);}return _0x557809;};}function handleError(_0x23fd43,_0x27f4ca){_0x27f4ca=_0x27f4ca||0x1f4;return function(_0x3cbe43){logger[_0x901d('0x2a')](_0x3cbe43['stack']);if(_0x3cbe43[_0x901d('0x2b')]){delete _0x3cbe43[_0x901d('0x2b')];}_0x23fd43[_0x901d('0x1d')](_0x27f4ca)[_0x901d('0x2c')](_0x3cbe43);};}exports[_0x901d('0x2d')]=function(_0x3de9b9,_0x48e86e){var _0xae6dfe={},_0x533038={},_0x128830={'count':0x0,'rows':[]};var _0x389fd9=_[_0x901d('0x2e')](db[_0x901d('0x2f')][_0x901d('0x30')],function(_0x20df02){return{'name':_0x20df02[_0x901d('0x31')],'type':_0x20df02[_0x901d('0x32')][_0x901d('0x33')]};});_0x533038[_0x901d('0x34')]=_[_0x901d('0x2e')](_0x389fd9,_0x901d('0x2b'));_0x533038[_0x901d('0x35')]=_[_0x901d('0x36')](_0x3de9b9[_0x901d('0x35')]);_0x533038['filters']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],_0x533038[_0x901d('0x35')]);_0xae6dfe['attributes']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],qs[_0x901d('0x38')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x38')]));_0xae6dfe[_0x901d('0x39')]=_0xae6dfe[_0x901d('0x39')][_0x901d('0x3a')]?_0xae6dfe[_0x901d('0x39')]:_0x533038[_0x901d('0x34')];if(!_0x3de9b9['query']['hasOwnProperty'](_0x901d('0x3b'))){_0xae6dfe['limit']=qs[_0x901d('0x22')](_0x3de9b9[_0x901d('0x35')]['limit']);_0xae6dfe[_0x901d('0x20')]=qs[_0x901d('0x20')](_0x3de9b9[_0x901d('0x35')]['offset']);}_0xae6dfe[_0x901d('0x3c')]=qs[_0x901d('0x3d')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x3d')]);_0xae6dfe[_0x901d('0x3e')]=qs[_0x901d('0x3f')](_[_0x901d('0x40')](_0x3de9b9[_0x901d('0x35')],_0x533038[_0x901d('0x3f')]),_0x389fd9);if(_0x3de9b9[_0x901d('0x35')][_0x901d('0x41')]){_0xae6dfe[_0x901d('0x3e')]=_[_0x901d('0x42')](_0xae6dfe[_0x901d('0x3e')],{'$or':_[_0x901d('0x2e')](_0x389fd9,function(_0x1644d8){if(_0x1644d8['type']!==_0x901d('0x43')){var _0x423cab={};_0x423cab[_0x1644d8['name']]={'$like':'%'+_0x3de9b9['query'][_0x901d('0x41')]+'%'};return _0x423cab;}})});}_0xae6dfe=_['merge']({},_0xae6dfe,_0x3de9b9[_0x901d('0x44')]);var _0x3d0556={'where':_0xae6dfe[_0x901d('0x3e')]};return db[_0x901d('0x2f')][_0x901d('0x23')](_0x3d0556)[_0x901d('0x28')](function(_0x5df4cb){_0x128830['count']=_0x5df4cb;if(_0x3de9b9['query']['includeAll']){_0xae6dfe[_0x901d('0x45')]=[{'all':!![]}];}return db[_0x901d('0x2f')]['findAll'](_0xae6dfe);})[_0x901d('0x28')](function(_0x22fc44){_0x128830['rows']=_0x22fc44;return _0x128830;})[_0x901d('0x28')](respondWithFilteredResult(_0x48e86e,_0xae6dfe))[_0x901d('0x46')](handleError(_0x48e86e,null));};exports[_0x901d('0x47')]=function(_0x2c1895,_0x53663d){var _0x5aeb41={'raw':![],'where':{'id':_0x2c1895[_0x901d('0x48')]['id']}},_0xa9c008={};_0xa9c008[_0x901d('0x34')]=_[_0x901d('0x36')](db[_0x901d('0x2f')][_0x901d('0x30')]);_0xa9c008[_0x901d('0x35')]=_[_0x901d('0x36')](_0x2c1895[_0x901d('0x35')]);_0xa9c008[_0x901d('0x3f')]=_[_0x901d('0x37')](_0xa9c008['model'],_0xa9c008[_0x901d('0x35')]);_0x5aeb41['attributes']=_[_0x901d('0x37')](_0xa9c008['model'],qs[_0x901d('0x38')](_0x2c1895['query'][_0x901d('0x38')]));_0x5aeb41[_0x901d('0x39')]=_0x5aeb41[_0x901d('0x39')][_0x901d('0x3a')]?_0x5aeb41[_0x901d('0x39')]:_0xa9c008[_0x901d('0x34')];if(_0x2c1895[_0x901d('0x35')][_0x901d('0x49')]){_0x5aeb41[_0x901d('0x45')]=[{'all':!![]}];}_0x5aeb41=_[_0x901d('0x42')]({},_0x5aeb41,_0x2c1895[_0x901d('0x44')]);return db['Integration'][_0x901d('0x4a')](_0x5aeb41)[_0x901d('0x28')](handleEntityNotFound(_0x53663d,null))[_0x901d('0x28')](respondWithResult(_0x53663d,null))[_0x901d('0x46')](handleError(_0x53663d,null));};exports[_0x901d('0x4b')]=function(_0x24b6fa,_0x27459b){return db[_0x901d('0x2f')][_0x901d('0x4b')](_0x24b6fa[_0x901d('0x4c')],{})[_0x901d('0x28')](respondWithResult(_0x27459b,0xc9))[_0x901d('0x46')](handleError(_0x27459b,null));};exports[_0x901d('0x27')]=function(_0x23f2a9,_0x4888e8){if(_0x23f2a9['body']['id']){delete _0x23f2a9[_0x901d('0x4c')]['id'];}return db[_0x901d('0x2f')][_0x901d('0x4a')]({'where':{'id':_0x23f2a9[_0x901d('0x48')]['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x4888e8,null))['then'](saveUpdates(_0x23f2a9['body'],null))[_0x901d('0x28')](respondWithResult(_0x4888e8,null))[_0x901d('0x46')](handleError(_0x4888e8,null));};exports['destroy']=function(_0x23673d,_0x165207){return db['Integration'][_0x901d('0x4a')]({'where':{'id':_0x23673d['params']['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x165207,null))[_0x901d('0x28')](removeEntity(_0x165207,null))[_0x901d('0x46')](handleError(_0x165207,null));};
\ No newline at end of file
index 1ed700c..0d9abab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc33f=['./integration.attributes','exports','define','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x1e921e,_0x4ae8dc){var _0x526f3c=function(_0x1ca975){while(--_0x1ca975){_0x1e921e['push'](_0x1e921e['shift']());}};_0x526f3c(++_0x4ae8dc);}(_0xc33f,0x11a));var _0xfc33=function(_0x154d1e,_0x1f705a){_0x154d1e=_0x154d1e-0x0;var _0x17568e=_0xc33f[_0x154d1e];return _0x17568e;};'use strict';var _=require(_0xfc33('0x0'));var util=require(_0xfc33('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xfc33('0x2'));var rp=require(_0xfc33('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfc33('0x4'));var config=require(_0xfc33('0x5'));var attributes=require(_0xfc33('0x6'));module[_0xfc33('0x7')]=function(_0x119152,_0x1e286e){return _0x119152[_0xfc33('0x8')]('Integration',attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xef2a=['../../config/environment','exports','define','Integration','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x568ad9,_0x1fae9e){var _0x5e694c=function(_0x4ce2b9){while(--_0x4ce2b9){_0x568ad9['push'](_0x568ad9['shift']());}};_0x5e694c(++_0x1fae9e);}(_0xef2a,0x88));var _0xaef2=function(_0x434b0a,_0x2fddef){_0x434b0a=_0x434b0a-0x0;var _0x10ba54=_0xef2a[_0x434b0a];return _0x10ba54;};'use strict';var _=require(_0xaef2('0x0'));var util=require(_0xaef2('0x1'));var logger=require(_0xaef2('0x2'))(_0xaef2('0x3'));var moment=require('moment');var BPromise=require(_0xaef2('0x4'));var rp=require(_0xaef2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaef2('0x6'));var config=require(_0xaef2('0x7'));var attributes=require('./integration.attributes');module[_0xaef2('0x8')]=function(_0x394bf4,_0x1cb5ef){return _0x394bf4[_0xaef2('0x9')](_0xaef2('0xa'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 16757f1..755b2b9 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','Integration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x169125,_0x1d493d){var _0x16b8ae=function(_0x2a5457){while(--_0x2a5457){_0x169125['push'](_0x169125['shift']());}};_0x16b8ae(++_0x1d493d);}(_0xdb28,0x106));var _0x8db2=function(_0x2571e3,_0x358e7d){_0x2571e3=_0x2571e3-0x0;var _0x2e5043=_0xdb28[_0x2571e3];return _0x2e5043;};'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')]('Integration,\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 _0x0295=['client','http','then','info','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','Integration,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2ca7ca,_0x559929){var _0x17af13=function(_0x48942e){while(--_0x48942e){_0x2ca7ca['push'](_0x2ca7ca['shift']());}};_0x17af13(++_0x559929);}(_0x0295,0x1f0));var _0x5029=function(_0x26bcec,_0xe13f50){_0x26bcec=_0x26bcec-0x0;var _0x1049dc=_0x0295[_0x26bcec];return _0x1049dc;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5029('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5029('0x2'))['db'];var utils=require(_0x5029('0x3'));var logger=require(_0x5029('0x4'))(_0x5029('0x5'));var config=require(_0x5029('0x6'));var jayson=require(_0x5029('0x7'));var client=jayson[_0x5029('0x8')][_0x5029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3cd,_0x502a62,_0x54978f){return new BPromise(function(_0x4ee867,_0xf4459b){return client['request'](_0x5b3cd,_0x54978f)[_0x5029('0xa')](function(_0x5bccfc){logger[_0x5029('0xb')]('Integration,\x20%s,\x20%s',_0x502a62,_0x5029('0xc'));logger[_0x5029('0xd')](_0x5029('0xe'),_0x502a62,'request\x20sent',JSON[_0x5029('0xf')](_0x5bccfc));if(_0x5bccfc[_0x5029('0x10')]){if(_0x5bccfc[_0x5029('0x10')]['code']===0x1f4){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc['error']['message']);return _0xf4459b(_0x5bccfc['error']['message']);}logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);return _0x4ee867(_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);}else{logger[_0x5029('0xb')](_0x5029('0x11'),_0x502a62,_0x5029('0xc'));_0x4ee867(_0x5bccfc[_0x5029('0x13')][_0x5029('0x12')]);}})[_0x5029('0x14')](function(_0x3786b5){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x3786b5);_0xf4459b(_0x3786b5);});});}
\ No newline at end of file
index 14b0c2a..2230a5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a85=['../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service'];(function(_0x58e92d,_0x1181bd){var _0x45d179=function(_0xf162a4){while(--_0xf162a4){_0x58e92d['push'](_0x58e92d['shift']());}};_0x45d179(++_0x1181bd);}(_0x1a85,0x178));var _0x51a8=function(_0x4689d0,_0x5a28c5){_0x4689d0=_0x4689d0-0x0;var _0xb61270=_0x1a85[_0x4689d0];return _0xb61270;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x51a8('0x0'));var timeout=require(_0x51a8('0x1'));var express=require(_0x51a8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x51a8('0x3'));var interaction=require(_0x51a8('0x4'));var config=require(_0x51a8('0x5'));var controller=require('./integrationReport.controller');router[_0x51a8('0x6')]('/',auth['isAuthenticated'](),controller[_0x51a8('0x7')]);router['get'](_0x51a8('0x8'),auth[_0x51a8('0x9')](),controller['describe']);router[_0x51a8('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x51a8('0xa')]);router[_0x51a8('0xb')]('/',auth[_0x51a8('0x9')](),controller[_0x51a8('0xc')]);router[_0x51a8('0xd')](_0x51a8('0xe'),auth[_0x51a8('0x9')](),controller[_0x51a8('0xf')]);router[_0x51a8('0x10')](_0x51a8('0xe'),auth[_0x51a8('0x9')](),controller[_0x51a8('0x11')]);module[_0x51a8('0x12')]=router;
\ No newline at end of file
+var _0x4137=['show','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','/:id'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x4137,0xf8));var _0x7413=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x4137[_0x46e363];return _0x3fb059;};'use strict';var multer=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var path=require(_0x7413('0x2'));var timeout=require(_0x7413('0x3'));var express=require(_0x7413('0x4'));var router=express[_0x7413('0x5')]();var fs_extra=require(_0x7413('0x6'));var auth=require(_0x7413('0x7'));var interaction=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var controller=require(_0x7413('0xa'));router[_0x7413('0xb')]('/',auth['isAuthenticated'](),controller[_0x7413('0xc')]);router[_0x7413('0xb')](_0x7413('0xd'),auth[_0x7413('0xe')](),controller['describe']);router[_0x7413('0xb')](_0x7413('0xf'),auth['isAuthenticated'](),controller[_0x7413('0x10')]);router[_0x7413('0x11')]('/',auth['isAuthenticated'](),controller[_0x7413('0x12')]);router[_0x7413('0x13')](_0x7413('0xf'),auth[_0x7413('0xe')](),controller[_0x7413('0x14')]);router['delete'](_0x7413('0xf'),auth[_0x7413('0xe')](),controller['destroy']);module[_0x7413('0x15')]=router;
\ No newline at end of file
index 967f58d..24f89db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc575=['FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED'];(function(_0x2e8b3f,_0x3eaa5a){var _0x251aab=function(_0x47c84b){while(--_0x47c84b){_0x2e8b3f['push'](_0x2e8b3f['shift']());}};_0x251aab(++_0x3eaa5a);}(_0xc575,0x9d));var _0x5c57=function(_0x240860,_0x20c04d){_0x240860=_0x240860-0x0;var _0x40e288=_0xc575[_0x240860];return _0x40e288;};'use strict';var Sequelize=require(_0x5c57('0x0'));module[_0x5c57('0x1')]={'integration':{'type':Sequelize[_0x5c57('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x5c57('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x5c57('0x3')]},'contacts':{'type':Sequelize[_0x5c57('0x2')]},'uniqueid':{'type':Sequelize[_0x5c57('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x5c57('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x5c57('0x2')]},'membername':{'type':Sequelize[_0x5c57('0x2')]},'agentcalledAt':{'type':Sequelize[_0x5c57('0x4')]},'agentconnectAt':{'type':Sequelize[_0x5c57('0x4')]},'holdtime':{'type':Sequelize[_0x5c57('0x3')]},'agentcomplete':{'type':Sequelize[_0x5c57('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x5c57('0x4')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x5c57('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x5c57('0x3')]},'reason':{'type':Sequelize[_0x5c57('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x5c57('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x5c57('0x4')]},'agentdump':{'type':Sequelize[_0x5c57('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x5c57('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x5c57('0x3')]},'channelstatedesc':{'type':Sequelize[_0x5c57('0x2')]},'connectedlinenum':{'type':Sequelize[_0x5c57('0x2')]},'connectedlinename':{'type':Sequelize[_0x5c57('0x2')]},'language':{'type':Sequelize[_0x5c57('0x2')]},'accountcode':{'type':Sequelize[_0x5c57('0x2')]},'context':{'type':Sequelize[_0x5c57('0x2')]},'exten':{'type':Sequelize[_0x5c57('0x2')]},'priority':{'type':Sequelize[_0x5c57('0x2')]},'destchannel':{'type':Sequelize[_0x5c57('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x5c57('0x2')]},'destcalleridnum':{'type':Sequelize[_0x5c57('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x5c57('0x2')]},'destaccountcode':{'type':Sequelize[_0x5c57('0x2')]},'destcontext':{'type':Sequelize[_0x5c57('0x2')]},'destexten':{'type':Sequelize[_0x5c57('0x2')]},'destpriority':{'type':Sequelize[_0x5c57('0x2')]},'destuniqueid':{'type':Sequelize[_0x5c57('0x2')]},'messageId':{'type':Sequelize[_0x5c57('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x5c57('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x5c57('0x2')]},'cc':{'type':Sequelize[_0x5c57('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x5c57('0x6')]},'text':{'type':Sequelize[_0x5c57('0x6')]},'status':{'type':Sequelize[_0x5c57('0x7')](_0x5c57('0x8'),_0x5c57('0x9'),_0x5c57('0xa'),_0x5c57('0xb'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x5c57('0x2')]},'appdata':{'type':Sequelize[_0x5c57('0x2')]},'projectId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xf43c=['RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT','SENDING'];(function(_0x3dc190,_0xa6c975){var _0x5bde76=function(_0xad954e){while(--_0xad954e){_0x3dc190['push'](_0x3dc190['shift']());}};_0x5bde76(++_0xa6c975);}(_0xf43c,0x7b));var _0xcf43=function(_0x3a40df,_0x1d262d){_0x3a40df=_0x3a40df-0x0;var _0x105865=_0xf43c[_0x3a40df];return _0x105865;};'use strict';var Sequelize=require(_0xcf43('0x0'));module[_0xcf43('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0xcf43('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xcf43('0x3')]},'contacts':{'type':Sequelize[_0xcf43('0x2')]},'uniqueid':{'type':Sequelize[_0xcf43('0x2')]},'calleridnum':{'type':Sequelize[_0xcf43('0x2')]},'calleridname':{'type':Sequelize[_0xcf43('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xcf43('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xcf43('0x4')]},'agentconnectAt':{'type':Sequelize[_0xcf43('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xcf43('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xcf43('0x4')]},'talktime':{'type':Sequelize[_0xcf43('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xcf43('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0xcf43('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xcf43('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xcf43('0x4')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xcf43('0x2')]},'channelstate':{'type':Sequelize[_0xcf43('0x3')]},'channelstatedesc':{'type':Sequelize[_0xcf43('0x2')]},'connectedlinenum':{'type':Sequelize[_0xcf43('0x2')]},'connectedlinename':{'type':Sequelize[_0xcf43('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xcf43('0x2')]},'context':{'type':Sequelize[_0xcf43('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xcf43('0x2')]},'destchannelstate':{'type':Sequelize[_0xcf43('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xcf43('0x2')]},'destcalleridnum':{'type':Sequelize[_0xcf43('0x2')]},'destcalleridname':{'type':Sequelize[_0xcf43('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xcf43('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xcf43('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xcf43('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xcf43('0x2')]},'destuniqueid':{'type':Sequelize[_0xcf43('0x2')]},'messageId':{'type':Sequelize[_0xcf43('0x2')]},'inReplyTo':{'type':Sequelize[_0xcf43('0x2')]},'subject':{'type':Sequelize[_0xcf43('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xcf43('0x2')]},'cc':{'type':Sequelize[_0xcf43('0x2')]},'attachment':{'type':Sequelize[_0xcf43('0x6')]},'html':{'type':Sequelize[_0xcf43('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize['ENUM'](_0xcf43('0x7'),_0xcf43('0x8'),_0xcf43('0x9'),_0xcf43('0xa'))},'url':{'type':Sequelize[_0xcf43('0x2')]},'app':{'type':Sequelize[_0xcf43('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index ebe5e3c..1004d3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86c6=['includeAll','include','findAll','show','params','keys','rawAttributes','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','index','IntegrationReport','fieldName','type','key','map','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x86c6,0xf9));var _0x686c=function(_0x55e1a3,_0x1a203d){_0x55e1a3=_0x55e1a3-0x0;var _0x397fc7=_0x86c6[_0x55e1a3];return _0x397fc7;};'use strict';var emlformat=require(_0x686c('0x0'));var rimraf=require(_0x686c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x686c('0x2'));var rp=require(_0x686c('0x3'));var moment=require(_0x686c('0x4'));var BPromise=require(_0x686c('0x5'));var Mustache=require('mustache');var util=require(_0x686c('0x6'));var path=require(_0x686c('0x7'));var sox=require(_0x686c('0x8'));var csv=require('to-csv');var ejs=require(_0x686c('0x9'));var fs=require('fs');var fs_extra=require(_0x686c('0xa'));var _=require(_0x686c('0xb'));var squel=require(_0x686c('0xc'));var crypto=require(_0x686c('0xd'));var jsforce=require(_0x686c('0xe'));var deskjs=require(_0x686c('0xf'));var toCsv=require(_0x686c('0x10'));var querystring=require(_0x686c('0x11'));var Papa=require(_0x686c('0x12'));var Redis=require(_0x686c('0x13'));var authService=require(_0x686c('0x14'));var qs=require(_0x686c('0x15'));var as=require(_0x686c('0x16'));var hardwareService=require(_0x686c('0x17'));var logger=require(_0x686c('0x18'))(_0x686c('0x19'));var utils=require(_0x686c('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x143b41,_0x4e9a79){_0x4e9a79=_0x4e9a79||0xcc;return function(_0x3ab0b4){if(_0x3ab0b4){return _0x143b41[_0x686c('0x1b')](_0x4e9a79);}return _0x143b41[_0x686c('0x1c')](_0x4e9a79)['end']();};}function respondWithResult(_0x292529,_0x4a3604){_0x4a3604=_0x4a3604||0xc8;return function(_0x4b3807){if(_0x4b3807){return _0x292529[_0x686c('0x1c')](_0x4a3604)['json'](_0x4b3807);}};}function respondWithFilteredResult(_0x5f11c5,_0x52dab0){return function(_0x19fb05){if(_0x19fb05){var _0x4b58f4=typeof _0x52dab0[_0x686c('0x1d')]==='undefined'&&typeof _0x52dab0[_0x686c('0x1e')]===_0x686c('0x1f');var _0x34f73c=_0x19fb05[_0x686c('0x20')];var _0x1227ad=_0x4b58f4?0x0:_0x52dab0[_0x686c('0x1d')];var _0x542298=_0x4b58f4?_0x19fb05[_0x686c('0x20')]:_0x52dab0[_0x686c('0x1d')]+_0x52dab0['limit'];var _0x57c302;if(_0x542298>=_0x34f73c){_0x542298=_0x34f73c;_0x57c302=0xc8;}else{_0x57c302=0xce;}_0x5f11c5['status'](_0x57c302);return _0x5f11c5[_0x686c('0x21')](_0x686c('0x22'),_0x1227ad+'-'+_0x542298+'/'+_0x34f73c)[_0x686c('0x23')](_0x19fb05);}return null;};}function patchUpdates(_0x279977){return function(_0x3597d8){try{jsonpatch[_0x686c('0x24')](_0x3597d8,_0x279977,!![]);}catch(_0x2953a6){return BPromise[_0x686c('0x25')](_0x2953a6);}return _0x3597d8[_0x686c('0x26')]();};}function saveUpdates(_0xb8592f,_0x4e0240){return function(_0x225a02){if(_0x225a02){return _0x225a02[_0x686c('0x27')](_0xb8592f)[_0x686c('0x28')](function(_0x465fb4){return _0x465fb4;});}return null;};}function removeEntity(_0xeb7b7f,_0x2ce628){return function(_0x270304){if(_0x270304){return _0x270304[_0x686c('0x29')]()[_0x686c('0x28')](function(){_0xeb7b7f[_0x686c('0x1c')](0xcc)[_0x686c('0x2a')]();});}};}function handleEntityNotFound(_0x710a18,_0x51742c){return function(_0x30c1d9){if(!_0x30c1d9){_0x710a18[_0x686c('0x1b')](0x194);}return _0x30c1d9;};}function handleError(_0x24e900,_0x6220e4){_0x6220e4=_0x6220e4||0x1f4;return function(_0x4afe2b){logger[_0x686c('0x2b')](_0x4afe2b[_0x686c('0x2c')]);if(_0x4afe2b[_0x686c('0x2d')]){delete _0x4afe2b[_0x686c('0x2d')];}_0x24e900[_0x686c('0x1c')](_0x6220e4)['send'](_0x4afe2b);};}exports[_0x686c('0x2e')]=function(_0x74cc3f,_0x1b2f7f){var _0x5c1440={},_0x3801e3={},_0x2ac74d={'count':0x0,'rows':[]};var _0x381078=_['map'](db[_0x686c('0x2f')]['rawAttributes'],function(_0x40defb){return{'name':_0x40defb[_0x686c('0x30')],'type':_0x40defb[_0x686c('0x31')][_0x686c('0x32')]};});_0x3801e3['model']=_[_0x686c('0x33')](_0x381078,'name');_0x3801e3[_0x686c('0x34')]=_['keys'](_0x74cc3f[_0x686c('0x34')]);_0x3801e3['filters']=_[_0x686c('0x35')](_0x3801e3[_0x686c('0x36')],_0x3801e3[_0x686c('0x34')]);_0x5c1440[_0x686c('0x37')]=_[_0x686c('0x35')](_0x3801e3[_0x686c('0x36')],qs['fields'](_0x74cc3f[_0x686c('0x34')][_0x686c('0x38')]));_0x5c1440[_0x686c('0x37')]=_0x5c1440[_0x686c('0x37')][_0x686c('0x39')]?_0x5c1440[_0x686c('0x37')]:_0x3801e3[_0x686c('0x36')];if(!_0x74cc3f['query'][_0x686c('0x3a')](_0x686c('0x3b'))){_0x5c1440['limit']=qs[_0x686c('0x1e')](_0x74cc3f[_0x686c('0x34')]['limit']);_0x5c1440[_0x686c('0x1d')]=qs[_0x686c('0x1d')](_0x74cc3f['query'][_0x686c('0x1d')]);}_0x5c1440['order']=qs[_0x686c('0x3c')](_0x74cc3f[_0x686c('0x34')]['sort']);_0x5c1440[_0x686c('0x3d')]=qs[_0x686c('0x3e')](_[_0x686c('0x3f')](_0x74cc3f[_0x686c('0x34')],_0x3801e3['filters']),_0x381078);if(_0x74cc3f[_0x686c('0x34')][_0x686c('0x40')]){_0x5c1440['where']=_[_0x686c('0x41')](_0x5c1440[_0x686c('0x3d')],{'$or':_[_0x686c('0x33')](_0x381078,function(_0x4d2ee8){if(_0x4d2ee8[_0x686c('0x31')]!=='VIRTUAL'){var _0x308030={};_0x308030[_0x4d2ee8[_0x686c('0x2d')]]={'$like':'%'+_0x74cc3f[_0x686c('0x34')][_0x686c('0x40')]+'%'};return _0x308030;}})});}_0x5c1440=_[_0x686c('0x41')]({},_0x5c1440,_0x74cc3f[_0x686c('0x42')]);var _0x1d3ea4={'where':_0x5c1440[_0x686c('0x3d')]};return db['IntegrationReport'][_0x686c('0x20')](_0x1d3ea4)[_0x686c('0x28')](function(_0x35388b){_0x2ac74d[_0x686c('0x20')]=_0x35388b;if(_0x74cc3f[_0x686c('0x34')][_0x686c('0x43')]){_0x5c1440[_0x686c('0x44')]=[{'all':!![]}];}return db['IntegrationReport'][_0x686c('0x45')](_0x5c1440);})[_0x686c('0x28')](function(_0x3772ac){_0x2ac74d['rows']=_0x3772ac;return _0x2ac74d;})[_0x686c('0x28')](respondWithFilteredResult(_0x1b2f7f,_0x5c1440))['catch'](handleError(_0x1b2f7f,null));};exports[_0x686c('0x46')]=function(_0x36a481,_0x511cb0){var _0x236b62={'raw':![],'where':{'id':_0x36a481[_0x686c('0x47')]['id']}},_0x3b3427={};_0x3b3427[_0x686c('0x36')]=_[_0x686c('0x48')](db['IntegrationReport'][_0x686c('0x49')]);_0x3b3427['query']=_[_0x686c('0x48')](_0x36a481[_0x686c('0x34')]);_0x3b3427[_0x686c('0x3e')]=_[_0x686c('0x35')](_0x3b3427[_0x686c('0x36')],_0x3b3427['query']);_0x236b62[_0x686c('0x37')]=_['intersection'](_0x3b3427['model'],qs['fields'](_0x36a481[_0x686c('0x34')][_0x686c('0x38')]));_0x236b62[_0x686c('0x37')]=_0x236b62['attributes'][_0x686c('0x39')]?_0x236b62[_0x686c('0x37')]:_0x3b3427[_0x686c('0x36')];if(_0x36a481['query']['includeAll']){_0x236b62[_0x686c('0x44')]=[{'all':!![]}];}_0x236b62=_[_0x686c('0x41')]({},_0x236b62,_0x36a481[_0x686c('0x42')]);return db[_0x686c('0x2f')][_0x686c('0x4a')](_0x236b62)[_0x686c('0x28')](handleEntityNotFound(_0x511cb0,null))['then'](respondWithResult(_0x511cb0,null))[_0x686c('0x4b')](handleError(_0x511cb0,null));};exports[_0x686c('0x4c')]=function(_0x427abe,_0x1fa1c9){return db['IntegrationReport'][_0x686c('0x4c')](_0x427abe[_0x686c('0x4d')],{})[_0x686c('0x28')](respondWithResult(_0x1fa1c9,0xc9))[_0x686c('0x4b')](handleError(_0x1fa1c9,null));};exports[_0x686c('0x27')]=function(_0xee6d52,_0x4879df){if(_0xee6d52[_0x686c('0x4d')]['id']){delete _0xee6d52['body']['id'];}return db[_0x686c('0x2f')][_0x686c('0x4a')]({'where':{'id':_0xee6d52[_0x686c('0x47')]['id']}})['then'](handleEntityNotFound(_0x4879df,null))[_0x686c('0x28')](saveUpdates(_0xee6d52[_0x686c('0x4d')],null))[_0x686c('0x28')](respondWithResult(_0x4879df,null))[_0x686c('0x4b')](handleError(_0x4879df,null));};exports[_0x686c('0x29')]=function(_0x3d6548,_0x2fca03){return db[_0x686c('0x2f')]['find']({'where':{'id':_0x3d6548[_0x686c('0x47')]['id']}})[_0x686c('0x28')](handleEntityNotFound(_0x2fca03,null))['then'](removeEntity(_0x2fca03,null))['catch'](handleError(_0x2fca03,null));};exports[_0x686c('0x4e')]=function(_0x2b6fa6,_0x45b450){return db[_0x686c('0x2f')][_0x686c('0x4e')]()[_0x686c('0x28')](respondWithResult(_0x45b450,null))[_0x686c('0x4b')](handleError(_0x45b450,null));};
\ No newline at end of file
+var _0xf387=['query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','error','name','send','index','IntegrationReport','rawAttributes','fieldName','type','key','model','map','keys'];(function(_0x36e68e,_0x1cc8f6){var _0x1be971=function(_0x1f0707){while(--_0x1f0707){_0x36e68e['push'](_0x36e68e['shift']());}};_0x1be971(++_0x1cc8f6);}(_0xf387,0x65));var _0x7f38=function(_0x52b9a2,_0x4e8ea1){_0x52b9a2=_0x52b9a2-0x0;var _0xdce3cf=_0xf387[_0x52b9a2];return _0xdce3cf;};'use strict';var emlformat=require(_0x7f38('0x0'));var rimraf=require(_0x7f38('0x1'));var zipdir=require(_0x7f38('0x2'));var jsonpatch=require(_0x7f38('0x3'));var rp=require(_0x7f38('0x4'));var moment=require(_0x7f38('0x5'));var BPromise=require(_0x7f38('0x6'));var Mustache=require(_0x7f38('0x7'));var util=require('util');var path=require(_0x7f38('0x8'));var sox=require(_0x7f38('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7f38('0xa'));var _=require(_0x7f38('0xb'));var squel=require(_0x7f38('0xc'));var crypto=require(_0x7f38('0xd'));var jsforce=require(_0x7f38('0xe'));var deskjs=require(_0x7f38('0xf'));var toCsv=require(_0x7f38('0x10'));var querystring=require(_0x7f38('0x11'));var Papa=require(_0x7f38('0x12'));var Redis=require(_0x7f38('0x13'));var authService=require(_0x7f38('0x14'));var qs=require(_0x7f38('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7f38('0x16'));var logger=require('../../config/logger')(_0x7f38('0x17'));var utils=require('../../config/utils');var config=require(_0x7f38('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f38('0x19'))['db'];function respondWithStatusCode(_0x369cd3,_0x91b2b4){_0x91b2b4=_0x91b2b4||0xcc;return function(_0x41bfa8){if(_0x41bfa8){return _0x369cd3[_0x7f38('0x1a')](_0x91b2b4);}return _0x369cd3[_0x7f38('0x1b')](_0x91b2b4)[_0x7f38('0x1c')]();};}function respondWithResult(_0x5f4779,_0x1f4d79){_0x1f4d79=_0x1f4d79||0xc8;return function(_0x1d3cd9){if(_0x1d3cd9){return _0x5f4779[_0x7f38('0x1b')](_0x1f4d79)[_0x7f38('0x1d')](_0x1d3cd9);}};}function respondWithFilteredResult(_0x362981,_0x314045){return function(_0x501a82){if(_0x501a82){var _0x208f2d=typeof _0x314045[_0x7f38('0x1e')]===_0x7f38('0x1f')&&typeof _0x314045[_0x7f38('0x20')]==='undefined';var _0x1e4607=_0x501a82[_0x7f38('0x21')];var _0x27c65c=_0x208f2d?0x0:_0x314045[_0x7f38('0x1e')];var _0x205e9d=_0x208f2d?_0x501a82['count']:_0x314045['offset']+_0x314045['limit'];var _0x1e517e;if(_0x205e9d>=_0x1e4607){_0x205e9d=_0x1e4607;_0x1e517e=0xc8;}else{_0x1e517e=0xce;}_0x362981['status'](_0x1e517e);return _0x362981[_0x7f38('0x22')]('Content-Range',_0x27c65c+'-'+_0x205e9d+'/'+_0x1e4607)[_0x7f38('0x1d')](_0x501a82);}return null;};}function patchUpdates(_0x286ed4){return function(_0x53fc3e){try{jsonpatch[_0x7f38('0x23')](_0x53fc3e,_0x286ed4,!![]);}catch(_0x19cfcd){return BPromise[_0x7f38('0x24')](_0x19cfcd);}return _0x53fc3e[_0x7f38('0x25')]();};}function saveUpdates(_0x36784e,_0x181185){return function(_0x3b020c){if(_0x3b020c){return _0x3b020c[_0x7f38('0x26')](_0x36784e)['then'](function(_0x3b57cd){return _0x3b57cd;});}return null;};}function removeEntity(_0x5c383d,_0x903994){return function(_0xe26629){if(_0xe26629){return _0xe26629[_0x7f38('0x27')]()[_0x7f38('0x28')](function(){_0x5c383d[_0x7f38('0x1b')](0xcc)[_0x7f38('0x1c')]();});}};}function handleEntityNotFound(_0x210468,_0x41df61){return function(_0x200dcf){if(!_0x200dcf){_0x210468['sendStatus'](0x194);}return _0x200dcf;};}function handleError(_0x47f10e,_0xd73b60){_0xd73b60=_0xd73b60||0x1f4;return function(_0x2e383b){logger[_0x7f38('0x29')](_0x2e383b['stack']);if(_0x2e383b[_0x7f38('0x2a')]){delete _0x2e383b[_0x7f38('0x2a')];}_0x47f10e[_0x7f38('0x1b')](_0xd73b60)[_0x7f38('0x2b')](_0x2e383b);};}exports[_0x7f38('0x2c')]=function(_0x566750,_0x295863){var _0x5730f9={},_0x17514b={},_0x2f8eae={'count':0x0,'rows':[]};var _0x4342c2=_['map'](db[_0x7f38('0x2d')][_0x7f38('0x2e')],function(_0x3f123a){return{'name':_0x3f123a[_0x7f38('0x2f')],'type':_0x3f123a[_0x7f38('0x30')][_0x7f38('0x31')]};});_0x17514b[_0x7f38('0x32')]=_[_0x7f38('0x33')](_0x4342c2,'name');_0x17514b['query']=_[_0x7f38('0x34')](_0x566750[_0x7f38('0x35')]);_0x17514b['filters']=_[_0x7f38('0x36')](_0x17514b[_0x7f38('0x32')],_0x17514b[_0x7f38('0x35')]);_0x5730f9[_0x7f38('0x37')]=_['intersection'](_0x17514b[_0x7f38('0x32')],qs[_0x7f38('0x38')](_0x566750['query'][_0x7f38('0x38')]));_0x5730f9[_0x7f38('0x37')]=_0x5730f9['attributes'][_0x7f38('0x39')]?_0x5730f9['attributes']:_0x17514b[_0x7f38('0x32')];if(!_0x566750['query'][_0x7f38('0x3a')](_0x7f38('0x3b'))){_0x5730f9[_0x7f38('0x20')]=qs[_0x7f38('0x20')](_0x566750[_0x7f38('0x35')][_0x7f38('0x20')]);_0x5730f9[_0x7f38('0x1e')]=qs[_0x7f38('0x1e')](_0x566750[_0x7f38('0x35')][_0x7f38('0x1e')]);}_0x5730f9['order']=qs[_0x7f38('0x3c')](_0x566750[_0x7f38('0x35')]['sort']);_0x5730f9[_0x7f38('0x3d')]=qs[_0x7f38('0x3e')](_[_0x7f38('0x3f')](_0x566750[_0x7f38('0x35')],_0x17514b['filters']),_0x4342c2);if(_0x566750[_0x7f38('0x35')][_0x7f38('0x40')]){_0x5730f9[_0x7f38('0x3d')]=_[_0x7f38('0x41')](_0x5730f9['where'],{'$or':_[_0x7f38('0x33')](_0x4342c2,function(_0x49ef51){if(_0x49ef51[_0x7f38('0x30')]!==_0x7f38('0x42')){var _0x1db20c={};_0x1db20c[_0x49ef51[_0x7f38('0x2a')]]={'$like':'%'+_0x566750[_0x7f38('0x35')][_0x7f38('0x40')]+'%'};return _0x1db20c;}})});}_0x5730f9=_[_0x7f38('0x41')]({},_0x5730f9,_0x566750[_0x7f38('0x43')]);var _0x44b3bf={'where':_0x5730f9[_0x7f38('0x3d')]};return db[_0x7f38('0x2d')][_0x7f38('0x21')](_0x44b3bf)[_0x7f38('0x28')](function(_0x2cbfc6){_0x2f8eae[_0x7f38('0x21')]=_0x2cbfc6;if(_0x566750[_0x7f38('0x35')][_0x7f38('0x44')]){_0x5730f9[_0x7f38('0x45')]=[{'all':!![]}];}return db[_0x7f38('0x2d')]['findAll'](_0x5730f9);})[_0x7f38('0x28')](function(_0x4173fb){_0x2f8eae[_0x7f38('0x46')]=_0x4173fb;return _0x2f8eae;})[_0x7f38('0x28')](respondWithFilteredResult(_0x295863,_0x5730f9))[_0x7f38('0x47')](handleError(_0x295863,null));};exports[_0x7f38('0x48')]=function(_0x2cf65c,_0x554202){var _0x4041dd={'raw':![],'where':{'id':_0x2cf65c[_0x7f38('0x49')]['id']}},_0x37da5b={};_0x37da5b['model']=_['keys'](db[_0x7f38('0x2d')]['rawAttributes']);_0x37da5b[_0x7f38('0x35')]=_['keys'](_0x2cf65c[_0x7f38('0x35')]);_0x37da5b['filters']=_[_0x7f38('0x36')](_0x37da5b[_0x7f38('0x32')],_0x37da5b[_0x7f38('0x35')]);_0x4041dd[_0x7f38('0x37')]=_[_0x7f38('0x36')](_0x37da5b[_0x7f38('0x32')],qs[_0x7f38('0x38')](_0x2cf65c[_0x7f38('0x35')]['fields']));_0x4041dd[_0x7f38('0x37')]=_0x4041dd[_0x7f38('0x37')]['length']?_0x4041dd[_0x7f38('0x37')]:_0x37da5b['model'];if(_0x2cf65c[_0x7f38('0x35')][_0x7f38('0x44')]){_0x4041dd[_0x7f38('0x45')]=[{'all':!![]}];}_0x4041dd=_[_0x7f38('0x41')]({},_0x4041dd,_0x2cf65c['options']);return db['IntegrationReport'][_0x7f38('0x4a')](_0x4041dd)['then'](handleEntityNotFound(_0x554202,null))[_0x7f38('0x28')](respondWithResult(_0x554202,null))[_0x7f38('0x47')](handleError(_0x554202,null));};exports['create']=function(_0xdb5cf8,_0x32e76e){return db[_0x7f38('0x2d')]['create'](_0xdb5cf8['body'],{})[_0x7f38('0x28')](respondWithResult(_0x32e76e,0xc9))[_0x7f38('0x47')](handleError(_0x32e76e,null));};exports['update']=function(_0x3bb06f,_0x2bcbd7){if(_0x3bb06f[_0x7f38('0x4b')]['id']){delete _0x3bb06f['body']['id'];}return db['IntegrationReport'][_0x7f38('0x4a')]({'where':{'id':_0x3bb06f[_0x7f38('0x49')]['id']}})['then'](handleEntityNotFound(_0x2bcbd7,null))[_0x7f38('0x28')](saveUpdates(_0x3bb06f[_0x7f38('0x4b')],null))['then'](respondWithResult(_0x2bcbd7,null))['catch'](handleError(_0x2bcbd7,null));};exports[_0x7f38('0x27')]=function(_0x377f4,_0x520621){return db['IntegrationReport'][_0x7f38('0x4a')]({'where':{'id':_0x377f4['params']['id']}})[_0x7f38('0x28')](handleEntityNotFound(_0x520621,null))[_0x7f38('0x28')](removeEntity(_0x520621,null))[_0x7f38('0x47')](handleError(_0x520621,null));};exports[_0x7f38('0x4c')]=function(_0x788bd,_0x2420c0){return db['IntegrationReport'][_0x7f38('0x4c')]()[_0x7f38('0x28')](respondWithResult(_0x2420c0,null))[_0x7f38('0x47')](handleError(_0x2420c0,null));};
\ No newline at end of file
index 1639ec4..a58998c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad87=['IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xad87,0x1af));var _0x7ad8=function(_0x1e2321,_0x3ae1c5){_0x1e2321=_0x1e2321-0x0;var _0x1d346d=_0xad87[_0x1e2321];return _0x1d346d;};'use strict';var _=require(_0x7ad8('0x0'));var util=require(_0x7ad8('0x1'));var logger=require(_0x7ad8('0x2'))(_0x7ad8('0x3'));var moment=require(_0x7ad8('0x4'));var BPromise=require(_0x7ad8('0x5'));var rp=require(_0x7ad8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7ad8('0x7'));var config=require(_0x7ad8('0x8'));var attributes=require('./integrationReport.attributes');module[_0x7ad8('0x9')]=function(_0x3d87b,_0x2f4c2a){return _0x3d87b[_0x7ad8('0xa')](_0x7ad8('0xb'),attributes,{'tableName':_0x7ad8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf0f1=['report_integration','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport'];(function(_0x386dad,_0x50f891){var _0x1f9d54=function(_0x1ab4b6){while(--_0x1ab4b6){_0x386dad['push'](_0x386dad['shift']());}};_0x1f9d54(++_0x50f891);}(_0xf0f1,0x12c));var _0x1f0f=function(_0x281e5e,_0xf320e2){_0x281e5e=_0x281e5e-0x0;var _0x5a22d2=_0xf0f1[_0x281e5e];return _0x5a22d2;};'use strict';var _=require(_0x1f0f('0x0'));var util=require(_0x1f0f('0x1'));var logger=require(_0x1f0f('0x2'))(_0x1f0f('0x3'));var moment=require(_0x1f0f('0x4'));var BPromise=require('bluebird');var rp=require(_0x1f0f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1f0f('0x6'));var config=require(_0x1f0f('0x7'));var attributes=require(_0x1f0f('0x8'));module[_0x1f0f('0x9')]=function(_0x70969a,_0x4a232f){return _0x70969a[_0x1f0f('0xa')](_0x1f0f('0xb'),attributes,{'tableName':_0x1f0f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3512143..d3d79b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2675=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','randomstring','ioredis'];(function(_0x1248eb,_0x465f4b){var _0x37b15b=function(_0x213937){while(--_0x213937){_0x1248eb['push'](_0x1248eb['shift']());}};_0x37b15b(++_0x465f4b);}(_0x2675,0x75));var _0x5267=function(_0x16dc2a,_0x109ce4){_0x16dc2a=_0x16dc2a-0x0;var _0x5ab8e6=_0x2675[_0x16dc2a];return _0x5ab8e6;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5267('0x1'));var fs=require('fs');var Redis=require(_0x5267('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5267('0x3'));var logger=require(_0x5267('0x4'))('rpc');var config=require(_0x5267('0x5'));var jayson=require(_0x5267('0x6'));var client=jayson[_0x5267('0x7')][_0x5267('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20f065,_0xc56cd5,_0x527c16){return new BPromise(function(_0x9e0a27,_0x46bfdf){return client['request'](_0x20f065,_0x527c16)[_0x5267('0x9')](function(_0x5d6645){logger[_0x5267('0xa')](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));logger['debug'](_0x5267('0xd'),_0xc56cd5,'request\x20sent',JSON[_0x5267('0xe')](_0x5d6645));if(_0x5d6645['error']){if(_0x5d6645[_0x5267('0xf')][_0x5267('0x10')]===0x1f4){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x46bfdf(_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);}logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x9e0a27(_0x5d6645[_0x5267('0xf')]['message']);}else{logger['info'](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));_0x9e0a27(_0x5d6645[_0x5267('0x12')][_0x5267('0x11')]);}})[_0x5267('0x13')](function(_0x27e5c6){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x27e5c6);_0x46bfdf(_0x27e5c6);});});}
\ No newline at end of file
+var _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x53ec,0x192));var _0xc53e=function(_0x40348a,_0x5c0bb3){_0x40348a=_0x40348a-0x0;var _0x290d46=_0x53ec[_0x40348a];return _0x290d46;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});}
\ No newline at end of file
index 9d3e56f..9e8c0aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd916=['create','post','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./interval.controller','get','index','/:id','isAuthenticated','show','/:id/sub_intervals'];(function(_0x4b0621,_0x1144a1){var _0x560690=function(_0x41dca3){while(--_0x41dca3){_0x4b0621['push'](_0x4b0621['shift']());}};_0x560690(++_0x1144a1);}(_0xd916,0x18a));var _0x6d91=function(_0x603c53,_0xf08acd){_0x603c53=_0x603c53-0x0;var _0x23734a=_0xd916[_0x603c53];return _0x23734a;};'use strict';var multer=require(_0x6d91('0x0'));var util=require(_0x6d91('0x1'));var path=require(_0x6d91('0x2'));var timeout=require(_0x6d91('0x3'));var express=require(_0x6d91('0x4'));var router=express['Router']();var fs_extra=require(_0x6d91('0x5'));var auth=require(_0x6d91('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6d91('0x7'));router[_0x6d91('0x8')]('/',auth['isAuthenticated'](),controller[_0x6d91('0x9')]);router[_0x6d91('0x8')](_0x6d91('0xa'),auth[_0x6d91('0xb')](),controller[_0x6d91('0xc')]);router[_0x6d91('0x8')](_0x6d91('0xd'),auth['isAuthenticated'](),controller['getIntervals']);router['post']('/',auth['isAuthenticated'](),controller[_0x6d91('0xe')]);router[_0x6d91('0xf')](_0x6d91('0xd'),auth[_0x6d91('0xb')](),controller[_0x6d91('0x10')]);router['post'](_0x6d91('0x11'),auth[_0x6d91('0xb')](),controller[_0x6d91('0x12')]);router[_0x6d91('0x13')](_0x6d91('0xa'),auth[_0x6d91('0xb')](),controller[_0x6d91('0x14')]);router[_0x6d91('0x15')](_0x6d91('0xa'),auth[_0x6d91('0xb')](),controller[_0x6d91('0x16')]);module[_0x6d91('0x17')]=router;
\ No newline at end of file
+var _0xfdcd=['../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','post','create','addInterval','addIntervals','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xfdcd,0xe9));var _0xdfdc=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xfdcd[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0xdfdc('0x0'));var path=require(_0xdfdc('0x1'));var timeout=require(_0xdfdc('0x2'));var express=require('express');var router=express[_0xdfdc('0x3')]();var fs_extra=require(_0xdfdc('0x4'));var auth=require(_0xdfdc('0x5'));var interaction=require(_0xdfdc('0x6'));var config=require(_0xdfdc('0x7'));var controller=require(_0xdfdc('0x8'));router[_0xdfdc('0x9')]('/',auth[_0xdfdc('0xa')](),controller[_0xdfdc('0xb')]);router[_0xdfdc('0x9')](_0xdfdc('0xc'),auth[_0xdfdc('0xa')](),controller[_0xdfdc('0xd')]);router['get'](_0xdfdc('0xe'),auth[_0xdfdc('0xa')](),controller['getIntervals']);router[_0xdfdc('0xf')]('/',auth[_0xdfdc('0xa')](),controller[_0xdfdc('0x10')]);router[_0xdfdc('0xf')](_0xdfdc('0xe'),auth['isAuthenticated'](),controller[_0xdfdc('0x11')]);router['post']('/:id/sub_intervals/create_many',auth[_0xdfdc('0xa')](),controller[_0xdfdc('0x12')]);router[_0xdfdc('0x13')](_0xdfdc('0xc'),auth[_0xdfdc('0xa')](),controller[_0xdfdc('0x14')]);router[_0xdfdc('0x15')]('/:id',auth[_0xdfdc('0xa')](),controller[_0xdfdc('0x16')]);module[_0xdfdc('0x17')]=router;
\ No newline at end of file
index 9b4e741..98b9084 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc436=['STRING','sequelize','exports'];(function(_0x256422,_0x367394){var _0x55dddc=function(_0x1594bc){while(--_0x1594bc){_0x256422['push'](_0x256422['shift']());}};_0x55dddc(++_0x367394);}(_0xc436,0x97));var _0x6c43=function(_0x9e5cfb,_0x5e1a0f){_0x9e5cfb=_0x9e5cfb-0x0;var _0x5a3140=_0xc436[_0x9e5cfb];return _0x5a3140;};'use strict';var Sequelize=require(_0x6c43('0x0'));module[_0x6c43('0x1')]={'name':{'type':Sequelize[_0x6c43('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
+var _0xcccb=['exports','STRING'];(function(_0x1e9afa,_0x5ab465){var _0x1a5eff=function(_0x4fc4ef){while(--_0x4fc4ef){_0x1e9afa['push'](_0x1e9afa['shift']());}};_0x1a5eff(++_0x5ab465);}(_0xcccb,0x1e2));var _0xbccc=function(_0x1cc67b,_0x5e8a7c){_0x1cc67b=_0x1cc67b-0x0;var _0x529cd9=_0xcccb[_0x1cc67b];return _0x529cd9;};'use strict';var Sequelize=require('sequelize');module[_0xbccc('0x0')]={'name':{'type':Sequelize[_0xbccc('0x1')]},'description':{'type':Sequelize[_0xbccc('0x1')]},'interval':{'type':Sequelize[_0xbccc('0x1')],'allowNull':!![]}};
\ No newline at end of file
index 36653d5..0e47f6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe96c=['Intervals','UserProfileSection','find','userProfileId','params','addInterval','getIntervals','findOne','keys','hasOwnProperty','nolimit','addIntervals','sequelize','IntervalId','bulkCreate','findAll','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','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/extensions/rewrite','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','send','index','map','Interval','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x242a4f,_0x369c57){var _0x122117=function(_0x55a797){while(--_0x55a797){_0x242a4f['push'](_0x242a4f['shift']());}};_0x122117(++_0x369c57);}(_0xe96c,0x1e6));var _0xce96=function(_0xd75219,_0x430bc1){_0xd75219=_0xd75219-0x0;var _0x38cc9f=_0xe96c[_0xd75219];return _0x38cc9f;};'use strict';var emlformat=require(_0xce96('0x0'));var rimraf=require(_0xce96('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xce96('0x2'));var rp=require(_0xce96('0x3'));var moment=require(_0xce96('0x4'));var BPromise=require(_0xce96('0x5'));var Mustache=require(_0xce96('0x6'));var util=require('util');var path=require(_0xce96('0x7'));var sox=require(_0xce96('0x8'));var csv=require(_0xce96('0x9'));var ejs=require(_0xce96('0xa'));var fs=require('fs');var fs_extra=require(_0xce96('0xb'));var _=require(_0xce96('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xce96('0xd'));var toCsv=require(_0xce96('0x9'));var querystring=require(_0xce96('0xe'));var Papa=require(_0xce96('0xf'));var Redis=require(_0xce96('0x10'));var authService=require(_0xce96('0x11'));var qs=require(_0xce96('0x12'));var as=require(_0xce96('0x13'));var hardwareService=require(_0xce96('0x14'));var logger=require(_0xce96('0x15'))(_0xce96('0x16'));var utils=require(_0xce96('0x17'));var config=require(_0xce96('0x18'));var licenseUtil=require(_0xce96('0x19'));var db=require(_0xce96('0x1a'))['db'];var extensions=require(_0xce96('0x1b'));function respondWithStatusCode(_0x39d3c2,_0x49dfba){_0x49dfba=_0x49dfba||0xcc;return function(_0x54c90b){if(_0x54c90b){return _0x39d3c2[_0xce96('0x1c')](_0x49dfba);}return _0x39d3c2[_0xce96('0x1d')](_0x49dfba)['end']();};}function respondWithResult(_0x3132ed,_0x3f8335){_0x3f8335=_0x3f8335||0xc8;return function(_0x583b43){if(_0x583b43){return _0x3132ed['status'](_0x3f8335)['json'](_0x583b43);}};}function respondWithFilteredResult(_0x21c518,_0x1d2467){return function(_0x3214a8){if(_0x3214a8){var _0x2a4ae6=typeof _0x1d2467[_0xce96('0x1e')]===_0xce96('0x1f')&&typeof _0x1d2467[_0xce96('0x20')]===_0xce96('0x1f');var _0x5a7a05=_0x3214a8[_0xce96('0x21')];var _0x49c2f9=_0x2a4ae6?0x0:_0x1d2467[_0xce96('0x1e')];var _0x592834=_0x2a4ae6?_0x3214a8['count']:_0x1d2467['offset']+_0x1d2467[_0xce96('0x20')];var _0x210d27;if(_0x592834>=_0x5a7a05){_0x592834=_0x5a7a05;_0x210d27=0xc8;}else{_0x210d27=0xce;}_0x21c518[_0xce96('0x1d')](_0x210d27);return _0x21c518[_0xce96('0x22')](_0xce96('0x23'),_0x49c2f9+'-'+_0x592834+'/'+_0x5a7a05)[_0xce96('0x24')](_0x3214a8);}return null;};}function patchUpdates(_0x771bdc){return function(_0x5bcc3b){try{jsonpatch[_0xce96('0x25')](_0x5bcc3b,_0x771bdc,!![]);}catch(_0x49c39c){return BPromise[_0xce96('0x26')](_0x49c39c);}return _0x5bcc3b[_0xce96('0x27')]();};}function saveUpdates(_0x28d86f,_0x1c6a00){return function(_0x29408f){if(_0x29408f){return _0x29408f[_0xce96('0x28')](_0x28d86f)[_0xce96('0x29')](function(_0x3efc56){return _0x3efc56;});}return null;};}function removeEntity(_0x2d6804,_0x2d72d9){return function(_0x4856b3){if(_0x4856b3){return _0x4856b3[_0xce96('0x2a')]()[_0xce96('0x29')](function(){var _0x3ecedd=_0x4856b3[_0xce96('0x2b')]({'plain':!![]});var _0x4ec479='Intervals';return db[_0xce96('0x2c')][_0xce96('0x2a')]({'where':{'type':_0x4ec479,'resourceId':_0x3ecedd['id']}})[_0xce96('0x29')](function(){return _0x4856b3;});})[_0xce96('0x29')](function(){_0x2d6804[_0xce96('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fb93f,_0x2c8f8d){return function(_0x5bed6e){if(!_0x5bed6e){_0x3fb93f['sendStatus'](0x194);}return _0x5bed6e;};}function handleError(_0x10e0f1,_0x5121eb){_0x5121eb=_0x5121eb||0x1f4;return function(_0x524c6f){logger['error'](_0x524c6f[_0xce96('0x2d')]);if(_0x524c6f[_0xce96('0x2e')]){delete _0x524c6f[_0xce96('0x2e')];}_0x10e0f1[_0xce96('0x1d')](_0x5121eb)[_0xce96('0x2f')](_0x524c6f);};}exports[_0xce96('0x30')]=function(_0x19cfa6,_0x271901){var _0x26695a={},_0x13d251={},_0x5acc5d={'count':0x0,'rows':[]};var _0x1dee96=_[_0xce96('0x31')](db[_0xce96('0x32')][_0xce96('0x33')],function(_0x2639c6){return{'name':_0x2639c6[_0xce96('0x34')],'type':_0x2639c6[_0xce96('0x35')]['key']};});_0x13d251[_0xce96('0x36')]=_[_0xce96('0x31')](_0x1dee96,_0xce96('0x2e'));_0x13d251[_0xce96('0x37')]=_['keys'](_0x19cfa6[_0xce96('0x37')]);_0x13d251['filters']=_[_0xce96('0x38')](_0x13d251[_0xce96('0x36')],_0x13d251[_0xce96('0x37')]);_0x26695a[_0xce96('0x39')]=_[_0xce96('0x38')](_0x13d251[_0xce96('0x36')],qs[_0xce96('0x3a')](_0x19cfa6[_0xce96('0x37')][_0xce96('0x3a')]));_0x26695a[_0xce96('0x39')]=_0x26695a['attributes'][_0xce96('0x3b')]?_0x26695a[_0xce96('0x39')]:_0x13d251['model'];if(!_0x19cfa6[_0xce96('0x37')]['hasOwnProperty']('nolimit')){_0x26695a[_0xce96('0x20')]=qs[_0xce96('0x20')](_0x19cfa6[_0xce96('0x37')][_0xce96('0x20')]);_0x26695a[_0xce96('0x1e')]=qs[_0xce96('0x1e')](_0x19cfa6[_0xce96('0x37')]['offset']);}_0x26695a[_0xce96('0x3c')]=qs[_0xce96('0x3d')](_0x19cfa6['query'][_0xce96('0x3d')]);_0x26695a[_0xce96('0x3e')]=qs['filters'](_['pick'](_0x19cfa6['query'],_0x13d251[_0xce96('0x3f')]),_0x1dee96);if(_0x19cfa6[_0xce96('0x37')][_0xce96('0x40')]){_0x26695a['where']=_[_0xce96('0x41')](_0x26695a[_0xce96('0x3e')],{'$or':_[_0xce96('0x31')](_0x1dee96,function(_0x1ad1f8){if(_0x1ad1f8[_0xce96('0x35')]!==_0xce96('0x42')){var _0x25c879={};_0x25c879[_0x1ad1f8[_0xce96('0x2e')]]={'$like':'%'+_0x19cfa6['query']['filter']+'%'};return _0x25c879;}})});}_0x26695a=_[_0xce96('0x41')]({},_0x26695a,_0x19cfa6[_0xce96('0x43')]);var _0x49235d={'where':_0x26695a[_0xce96('0x3e')]};return db[_0xce96('0x32')]['count'](_0x49235d)['then'](function(_0x3e32fe){_0x5acc5d[_0xce96('0x21')]=_0x3e32fe;if(_0x19cfa6[_0xce96('0x37')][_0xce96('0x44')]){_0x26695a['include']=[{'all':!![]}];}return db[_0xce96('0x32')]['findAll'](_0x26695a);})[_0xce96('0x29')](function(_0x4dfce1){_0x5acc5d[_0xce96('0x45')]=_0x4dfce1;return _0x5acc5d;})[_0xce96('0x29')](respondWithFilteredResult(_0x271901,_0x26695a))[_0xce96('0x46')](handleError(_0x271901,null));};exports[_0xce96('0x47')]=function(_0x1c75a0,_0x482b78){var _0x2abb80={'raw':!![],'where':{'id':_0x1c75a0['params']['id']}},_0x512b8c={};_0x512b8c['model']=_['keys'](db['Interval']['rawAttributes']);_0x512b8c[_0xce96('0x37')]=_['keys'](_0x1c75a0[_0xce96('0x37')]);_0x512b8c[_0xce96('0x3f')]=_[_0xce96('0x38')](_0x512b8c[_0xce96('0x36')],_0x512b8c['query']);_0x2abb80['attributes']=_[_0xce96('0x38')](_0x512b8c[_0xce96('0x36')],qs['fields'](_0x1c75a0[_0xce96('0x37')][_0xce96('0x3a')]));_0x2abb80[_0xce96('0x39')]=_0x2abb80[_0xce96('0x39')][_0xce96('0x3b')]?_0x2abb80[_0xce96('0x39')]:_0x512b8c[_0xce96('0x36')];if(_0x1c75a0['query'][_0xce96('0x44')]){_0x2abb80[_0xce96('0x48')]=[{'all':!![]}];}_0x2abb80=_[_0xce96('0x41')]({},_0x2abb80,_0x1c75a0[_0xce96('0x43')]);return db[_0xce96('0x32')]['find'](_0x2abb80)[_0xce96('0x29')](handleEntityNotFound(_0x482b78,null))[_0xce96('0x29')](respondWithResult(_0x482b78,null))[_0xce96('0x46')](handleError(_0x482b78,null));};exports[_0xce96('0x49')]=function(_0x3a9aa4,_0x241f8b){return db[_0xce96('0x32')][_0xce96('0x49')](_0x3a9aa4[_0xce96('0x4a')],{})[_0xce96('0x29')](function(_0xc6d178){var _0x5e7f1a=_0x3a9aa4[_0xce96('0x4b')][_0xce96('0x2b')]({'plain':!![]});if(!_0x5e7f1a)throw new Error(_0xce96('0x4c'));if(_0x5e7f1a[_0xce96('0x4d')]===_0xce96('0x4b')){var _0x2c7758=_0xc6d178[_0xce96('0x2b')]({'plain':!![]});var _0x5407ee=_0xce96('0x4e');return db[_0xce96('0x4f')][_0xce96('0x50')]({'where':{'name':_0x5407ee,'userProfileId':_0x5e7f1a[_0xce96('0x51')]},'raw':!![]})[_0xce96('0x29')](function(_0x234041){if(_0x234041&&_0x234041['autoAssociation']===0x0){return db[_0xce96('0x2c')][_0xce96('0x49')]({'name':_0x2c7758[_0xce96('0x2e')],'resourceId':_0x2c7758['id'],'type':_0x234041['name'],'sectionId':_0x234041['id']},{})[_0xce96('0x29')](function(){return _0xc6d178;});}else{return _0xc6d178;}})[_0xce96('0x46')](function(_0x55433f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x55433f);throw _0x55433f;});}return _0xc6d178;})[_0xce96('0x29')](respondWithResult(_0x241f8b,0xc9))[_0xce96('0x46')](handleError(_0x241f8b,null));};exports['update']=function(_0x5bd6f2,_0xdf29c6){if(_0x5bd6f2[_0xce96('0x4a')]['id']){delete _0x5bd6f2[_0xce96('0x4a')]['id'];}return db['Interval'][_0xce96('0x50')]({'where':{'id':_0x5bd6f2[_0xce96('0x52')]['id']}})[_0xce96('0x29')](handleEntityNotFound(_0xdf29c6,null))['then'](saveUpdates(_0x5bd6f2[_0xce96('0x4a')],null))[_0xce96('0x29')](respondWithResult(_0xdf29c6,null))[_0xce96('0x46')](handleError(_0xdf29c6,null));};exports[_0xce96('0x2a')]=function(_0x3ff6c4,_0x17ca9c){return db[_0xce96('0x32')][_0xce96('0x50')]({'where':{'id':_0x3ff6c4[_0xce96('0x52')]['id']}})['then'](handleEntityNotFound(_0x17ca9c,null))[_0xce96('0x29')](removeEntity(_0x17ca9c,null))[_0xce96('0x46')](handleError(_0x17ca9c,null));};exports[_0xce96('0x53')]=function(_0x57265a,_0x103a85,_0x326177){if(_0x57265a[_0xce96('0x4a')]['id']){delete _0x57265a[_0xce96('0x4a')]['id'];}return db[_0xce96('0x32')][_0xce96('0x50')]({'where':{'id':_0x57265a[_0xce96('0x52')]['id']}})[_0xce96('0x29')](handleEntityNotFound(_0x103a85,null))['then'](function(_0x43a8c3){if(_0x43a8c3){_0x57265a[_0xce96('0x4a')]['IntervalId']=_0x43a8c3['id'];return db[_0xce96('0x32')][_0xce96('0x49')](_0x57265a[_0xce96('0x4a')]);}})[_0xce96('0x29')](respondWithResult(_0x103a85,null))[_0xce96('0x46')](handleError(_0x103a85,null));};exports[_0xce96('0x54')]=function(_0x50b7a9,_0x2bccb2,_0x5b3288){var _0x95b819={};var _0x435382={};var _0x3678b3;var _0x41ae46;return db[_0xce96('0x32')][_0xce96('0x55')]({'where':{'id':_0x50b7a9['params']['id']}})[_0xce96('0x29')](handleEntityNotFound(_0x2bccb2,null))[_0xce96('0x29')](function(_0x6a2b47){if(_0x6a2b47){_0x3678b3=_0x6a2b47;_0x435382[_0xce96('0x36')]=_[_0xce96('0x56')](db[_0xce96('0x32')]['rawAttributes']);_0x435382[_0xce96('0x37')]=_[_0xce96('0x56')](_0x50b7a9['query']);_0x435382[_0xce96('0x3f')]=_[_0xce96('0x38')](_0x435382[_0xce96('0x36')],_0x435382['query']);_0x95b819[_0xce96('0x39')]=_[_0xce96('0x38')](_0x435382['model'],qs[_0xce96('0x3a')](_0x50b7a9[_0xce96('0x37')][_0xce96('0x3a')]));_0x95b819[_0xce96('0x39')]=_0x95b819[_0xce96('0x39')][_0xce96('0x3b')]?_0x95b819[_0xce96('0x39')]:_0x435382['model'];_0x95b819[_0xce96('0x3c')]=qs['sort'](_0x50b7a9[_0xce96('0x37')]['sort']);_0x95b819[_0xce96('0x3e')]=qs[_0xce96('0x3f')](_['pick'](_0x50b7a9[_0xce96('0x37')],_0x435382[_0xce96('0x3f')]));if(_0x50b7a9['query'][_0xce96('0x40')]){_0x95b819[_0xce96('0x3e')]=_['merge'](_0x95b819[_0xce96('0x3e')],{'$or':_[_0xce96('0x31')](_0x95b819[_0xce96('0x39')],function(_0x9117e2){var _0x40382={};_0x40382[_0x9117e2]={'$like':'%'+_0x50b7a9[_0xce96('0x37')][_0xce96('0x40')]+'%'};return _0x40382;})});}_0x95b819=_['merge']({},_0x95b819,_0x50b7a9[_0xce96('0x43')]);return _0x3678b3[_0xce96('0x54')](_0x95b819);}})['then'](function(_0x176397){if(_0x176397){_0x41ae46=_0x176397[_0xce96('0x3b')];if(!_0x50b7a9[_0xce96('0x37')][_0xce96('0x57')](_0xce96('0x58'))){_0x95b819[_0xce96('0x20')]=qs[_0xce96('0x20')](_0x50b7a9[_0xce96('0x37')][_0xce96('0x20')]);_0x95b819[_0xce96('0x1e')]=qs['offset'](_0x50b7a9[_0xce96('0x37')][_0xce96('0x1e')]);}return _0x3678b3[_0xce96('0x54')](_0x95b819);}})[_0xce96('0x29')](function(_0x6d4232){if(_0x6d4232){return _0x6d4232?{'count':_0x41ae46,'rows':_0x6d4232}:null;}})[_0xce96('0x29')](respondWithResult(_0x2bccb2,null))[_0xce96('0x46')](handleError(_0x2bccb2,null));};exports[_0xce96('0x59')]=function(_0x43705e,_0x1842a7,_0x24ff59){return db['Interval'][_0xce96('0x55')]({'where':{'id':_0x43705e[_0xce96('0x52')]['id']}})[_0xce96('0x29')](handleEntityNotFound(_0x1842a7,null))[_0xce96('0x29')](function(_0x2d472d){if(_0x2d472d){return db[_0xce96('0x5a')]['transaction'](function(_0x3f39a7){return db[_0xce96('0x32')][_0xce96('0x2a')]({'where':{'IntervalId':_0x43705e['params']['id']},'transaction':_0x3f39a7})[_0xce96('0x29')](function(_0x193288){var _0x53ee3c=_[_0xce96('0x31')](_0x43705e['body'],function(_0x5e937d){delete _0x5e937d['id'];_0x5e937d[_0xce96('0x5b')]=_0x43705e[_0xce96('0x52')]['id'];return _0x5e937d;});return db[_0xce96('0x32')][_0xce96('0x5c')](_0x53ee3c,{'transaction':_0x3f39a7});});})[_0xce96('0x29')](function(){return db['Interval'][_0xce96('0x5d')]({'where':{'IntervalId':_0x43705e[_0xce96('0x52')]['id']}});});}})[_0xce96('0x29')](respondWithResult(_0x1842a7,null))[_0xce96('0x46')](handleError(_0x1842a7,null));};
\ No newline at end of file
+var _0xa87d=['where','pick','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addInterval','IntervalId','getIntervals','findOne','order','filter','addIntervals','transaction','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/extensions/rewrite','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','get','Intervals','UserProfileResource','end','error','name','send','index','map','Interval','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort'];(function(_0x22a2c7,_0x1cae88){var _0x4abf52=function(_0x3faf3a){while(--_0x3faf3a){_0x22a2c7['push'](_0x22a2c7['shift']());}};_0x4abf52(++_0x1cae88);}(_0xa87d,0xc5));var _0xda87=function(_0x3cf780,_0x4412f9){_0x3cf780=_0x3cf780-0x0;var _0x181a05=_0xa87d[_0x3cf780];return _0x181a05;};'use strict';var emlformat=require(_0xda87('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xda87('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xda87('0x2'));var moment=require(_0xda87('0x3'));var BPromise=require(_0xda87('0x4'));var Mustache=require(_0xda87('0x5'));var util=require(_0xda87('0x6'));var path=require('path');var sox=require(_0xda87('0x7'));var csv=require(_0xda87('0x8'));var ejs=require(_0xda87('0x9'));var fs=require('fs');var fs_extra=require(_0xda87('0xa'));var _=require('lodash');var squel=require(_0xda87('0xb'));var crypto=require(_0xda87('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xda87('0x8'));var querystring=require(_0xda87('0xd'));var Papa=require(_0xda87('0xe'));var Redis=require('ioredis');var authService=require(_0xda87('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xda87('0x10'));var logger=require(_0xda87('0x11'))('api');var utils=require(_0xda87('0x12'));var config=require(_0xda87('0x13'));var licenseUtil=require(_0xda87('0x14'));var db=require('../../mysqldb')['db'];var extensions=require(_0xda87('0x15'));function respondWithStatusCode(_0xabb0ef,_0x43b1c3){_0x43b1c3=_0x43b1c3||0xcc;return function(_0x52028d){if(_0x52028d){return _0xabb0ef[_0xda87('0x16')](_0x43b1c3);}return _0xabb0ef[_0xda87('0x17')](_0x43b1c3)['end']();};}function respondWithResult(_0x2a7763,_0x53a552){_0x53a552=_0x53a552||0xc8;return function(_0x300b9f){if(_0x300b9f){return _0x2a7763['status'](_0x53a552)['json'](_0x300b9f);}};}function respondWithFilteredResult(_0x11c472,_0x1229b3){return function(_0x12296e){if(_0x12296e){var _0x51a526=typeof _0x1229b3[_0xda87('0x18')]===_0xda87('0x19')&&typeof _0x1229b3[_0xda87('0x1a')]===_0xda87('0x19');var _0x17bd35=_0x12296e['count'];var _0x9ea7c=_0x51a526?0x0:_0x1229b3['offset'];var _0x16d53c=_0x51a526?_0x12296e[_0xda87('0x1b')]:_0x1229b3[_0xda87('0x18')]+_0x1229b3['limit'];var _0x55fed3;if(_0x16d53c>=_0x17bd35){_0x16d53c=_0x17bd35;_0x55fed3=0xc8;}else{_0x55fed3=0xce;}_0x11c472[_0xda87('0x17')](_0x55fed3);return _0x11c472[_0xda87('0x1c')](_0xda87('0x1d'),_0x9ea7c+'-'+_0x16d53c+'/'+_0x17bd35)['json'](_0x12296e);}return null;};}function patchUpdates(_0x4c3306){return function(_0x3ef0a6){try{jsonpatch[_0xda87('0x1e')](_0x3ef0a6,_0x4c3306,!![]);}catch(_0x4cd0d6){return BPromise[_0xda87('0x1f')](_0x4cd0d6);}return _0x3ef0a6['save']();};}function saveUpdates(_0x3cfcf1,_0x30e0bd){return function(_0x3ea400){if(_0x3ea400){return _0x3ea400['update'](_0x3cfcf1)[_0xda87('0x20')](function(_0x29fcd6){return _0x29fcd6;});}return null;};}function removeEntity(_0x254298,_0x321cbd){return function(_0x2d2078){if(_0x2d2078){return _0x2d2078[_0xda87('0x21')]()[_0xda87('0x20')](function(){var _0x158463=_0x2d2078[_0xda87('0x22')]({'plain':!![]});var _0x442d3f=_0xda87('0x23');return db[_0xda87('0x24')][_0xda87('0x21')]({'where':{'type':_0x442d3f,'resourceId':_0x158463['id']}})[_0xda87('0x20')](function(){return _0x2d2078;});})[_0xda87('0x20')](function(){_0x254298[_0xda87('0x17')](0xcc)[_0xda87('0x25')]();});}};}function handleEntityNotFound(_0x21504f,_0x201fb1){return function(_0x35da91){if(!_0x35da91){_0x21504f['sendStatus'](0x194);}return _0x35da91;};}function handleError(_0x4217d6,_0x4c0d86){_0x4c0d86=_0x4c0d86||0x1f4;return function(_0x43f434){logger[_0xda87('0x26')](_0x43f434['stack']);if(_0x43f434['name']){delete _0x43f434[_0xda87('0x27')];}_0x4217d6[_0xda87('0x17')](_0x4c0d86)[_0xda87('0x28')](_0x43f434);};}exports[_0xda87('0x29')]=function(_0x182fc2,_0x43eb48){var _0x4e10ab={},_0xfeb3aa={},_0x4784c1={'count':0x0,'rows':[]};var _0x3c45d4=_[_0xda87('0x2a')](db[_0xda87('0x2b')][_0xda87('0x2c')],function(_0x3a1a21){return{'name':_0x3a1a21[_0xda87('0x2d')],'type':_0x3a1a21[_0xda87('0x2e')][_0xda87('0x2f')]};});_0xfeb3aa[_0xda87('0x30')]=_[_0xda87('0x2a')](_0x3c45d4,_0xda87('0x27'));_0xfeb3aa[_0xda87('0x31')]=_[_0xda87('0x32')](_0x182fc2[_0xda87('0x31')]);_0xfeb3aa[_0xda87('0x33')]=_['intersection'](_0xfeb3aa[_0xda87('0x30')],_0xfeb3aa[_0xda87('0x31')]);_0x4e10ab['attributes']=_[_0xda87('0x34')](_0xfeb3aa[_0xda87('0x30')],qs[_0xda87('0x35')](_0x182fc2['query'][_0xda87('0x35')]));_0x4e10ab[_0xda87('0x36')]=_0x4e10ab[_0xda87('0x36')][_0xda87('0x37')]?_0x4e10ab[_0xda87('0x36')]:_0xfeb3aa['model'];if(!_0x182fc2[_0xda87('0x31')][_0xda87('0x38')]('nolimit')){_0x4e10ab['limit']=qs[_0xda87('0x1a')](_0x182fc2[_0xda87('0x31')]['limit']);_0x4e10ab[_0xda87('0x18')]=qs['offset'](_0x182fc2[_0xda87('0x31')][_0xda87('0x18')]);}_0x4e10ab['order']=qs['sort'](_0x182fc2[_0xda87('0x31')][_0xda87('0x39')]);_0x4e10ab[_0xda87('0x3a')]=qs[_0xda87('0x33')](_[_0xda87('0x3b')](_0x182fc2[_0xda87('0x31')],_0xfeb3aa['filters']),_0x3c45d4);if(_0x182fc2['query']['filter']){_0x4e10ab[_0xda87('0x3a')]=_[_0xda87('0x3c')](_0x4e10ab['where'],{'$or':_[_0xda87('0x2a')](_0x3c45d4,function(_0x1f7158){if(_0x1f7158[_0xda87('0x2e')]!==_0xda87('0x3d')){var _0x5debd8={};_0x5debd8[_0x1f7158[_0xda87('0x27')]]={'$like':'%'+_0x182fc2[_0xda87('0x31')]['filter']+'%'};return _0x5debd8;}})});}_0x4e10ab=_[_0xda87('0x3c')]({},_0x4e10ab,_0x182fc2[_0xda87('0x3e')]);var _0x3e57a={'where':_0x4e10ab[_0xda87('0x3a')]};return db['Interval'][_0xda87('0x1b')](_0x3e57a)[_0xda87('0x20')](function(_0x4b7a0d){_0x4784c1[_0xda87('0x1b')]=_0x4b7a0d;if(_0x182fc2['query'][_0xda87('0x3f')]){_0x4e10ab[_0xda87('0x40')]=[{'all':!![]}];}return db[_0xda87('0x2b')][_0xda87('0x41')](_0x4e10ab);})[_0xda87('0x20')](function(_0x1572cc){_0x4784c1['rows']=_0x1572cc;return _0x4784c1;})['then'](respondWithFilteredResult(_0x43eb48,_0x4e10ab))[_0xda87('0x42')](handleError(_0x43eb48,null));};exports[_0xda87('0x43')]=function(_0x18b52b,_0x12cb74){var _0x1498d2={'raw':!![],'where':{'id':_0x18b52b[_0xda87('0x44')]['id']}},_0x38159c={};_0x38159c[_0xda87('0x30')]=_['keys'](db['Interval'][_0xda87('0x2c')]);_0x38159c['query']=_[_0xda87('0x32')](_0x18b52b[_0xda87('0x31')]);_0x38159c[_0xda87('0x33')]=_[_0xda87('0x34')](_0x38159c[_0xda87('0x30')],_0x38159c[_0xda87('0x31')]);_0x1498d2['attributes']=_[_0xda87('0x34')](_0x38159c['model'],qs[_0xda87('0x35')](_0x18b52b[_0xda87('0x31')][_0xda87('0x35')]));_0x1498d2[_0xda87('0x36')]=_0x1498d2['attributes'][_0xda87('0x37')]?_0x1498d2['attributes']:_0x38159c[_0xda87('0x30')];if(_0x18b52b['query'][_0xda87('0x3f')]){_0x1498d2[_0xda87('0x40')]=[{'all':!![]}];}_0x1498d2=_['merge']({},_0x1498d2,_0x18b52b[_0xda87('0x3e')]);return db[_0xda87('0x2b')]['find'](_0x1498d2)[_0xda87('0x20')](handleEntityNotFound(_0x12cb74,null))[_0xda87('0x20')](respondWithResult(_0x12cb74,null))['catch'](handleError(_0x12cb74,null));};exports[_0xda87('0x45')]=function(_0x17f33f,_0x1b53fa){return db[_0xda87('0x2b')][_0xda87('0x45')](_0x17f33f['body'],{})[_0xda87('0x20')](function(_0x530e28){var _0xd50931=_0x17f33f['user'][_0xda87('0x22')]({'plain':!![]});if(!_0xd50931)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd50931['role']==='user'){var _0x5318de=_0x530e28['get']({'plain':!![]});var _0x296754=_0xda87('0x23');return db[_0xda87('0x46')][_0xda87('0x47')]({'where':{'name':_0x296754,'userProfileId':_0xd50931[_0xda87('0x48')]},'raw':!![]})[_0xda87('0x20')](function(_0x2efc70){if(_0x2efc70&&_0x2efc70[_0xda87('0x49')]===0x0){return db[_0xda87('0x24')][_0xda87('0x45')]({'name':_0x5318de[_0xda87('0x27')],'resourceId':_0x5318de['id'],'type':_0x2efc70['name'],'sectionId':_0x2efc70['id']},{})[_0xda87('0x20')](function(){return _0x530e28;});}else{return _0x530e28;}})[_0xda87('0x42')](function(_0x43256f){logger['error'](_0xda87('0x4a'),_0x43256f);throw _0x43256f;});}return _0x530e28;})['then'](respondWithResult(_0x1b53fa,0xc9))[_0xda87('0x42')](handleError(_0x1b53fa,null));};exports[_0xda87('0x4b')]=function(_0xc3cdce,_0x2a4559){if(_0xc3cdce[_0xda87('0x4c')]['id']){delete _0xc3cdce[_0xda87('0x4c')]['id'];}return db[_0xda87('0x2b')]['find']({'where':{'id':_0xc3cdce['params']['id']}})[_0xda87('0x20')](handleEntityNotFound(_0x2a4559,null))[_0xda87('0x20')](saveUpdates(_0xc3cdce['body'],null))[_0xda87('0x20')](respondWithResult(_0x2a4559,null))[_0xda87('0x42')](handleError(_0x2a4559,null));};exports['destroy']=function(_0x2c77d3,_0x5a11e5){return db[_0xda87('0x2b')][_0xda87('0x47')]({'where':{'id':_0x2c77d3[_0xda87('0x44')]['id']}})['then'](handleEntityNotFound(_0x5a11e5,null))['then'](removeEntity(_0x5a11e5,null))[_0xda87('0x42')](handleError(_0x5a11e5,null));};exports[_0xda87('0x4d')]=function(_0xd3f485,_0x74c188,_0x3b7953){if(_0xd3f485['body']['id']){delete _0xd3f485['body']['id'];}return db[_0xda87('0x2b')][_0xda87('0x47')]({'where':{'id':_0xd3f485[_0xda87('0x44')]['id']}})[_0xda87('0x20')](handleEntityNotFound(_0x74c188,null))[_0xda87('0x20')](function(_0x376c09){if(_0x376c09){_0xd3f485['body'][_0xda87('0x4e')]=_0x376c09['id'];return db[_0xda87('0x2b')]['create'](_0xd3f485[_0xda87('0x4c')]);}})['then'](respondWithResult(_0x74c188,null))[_0xda87('0x42')](handleError(_0x74c188,null));};exports[_0xda87('0x4f')]=function(_0x17b0a1,_0x507617,_0x49d951){var _0x956401={};var _0x174e93={};var _0x7a3ffc;var _0xfbc90b;return db[_0xda87('0x2b')][_0xda87('0x50')]({'where':{'id':_0x17b0a1[_0xda87('0x44')]['id']}})[_0xda87('0x20')](handleEntityNotFound(_0x507617,null))['then'](function(_0x328fea){if(_0x328fea){_0x7a3ffc=_0x328fea;_0x174e93['model']=_[_0xda87('0x32')](db[_0xda87('0x2b')][_0xda87('0x2c')]);_0x174e93[_0xda87('0x31')]=_['keys'](_0x17b0a1['query']);_0x174e93['filters']=_[_0xda87('0x34')](_0x174e93[_0xda87('0x30')],_0x174e93[_0xda87('0x31')]);_0x956401[_0xda87('0x36')]=_[_0xda87('0x34')](_0x174e93[_0xda87('0x30')],qs['fields'](_0x17b0a1[_0xda87('0x31')][_0xda87('0x35')]));_0x956401['attributes']=_0x956401[_0xda87('0x36')][_0xda87('0x37')]?_0x956401[_0xda87('0x36')]:_0x174e93['model'];_0x956401[_0xda87('0x51')]=qs[_0xda87('0x39')](_0x17b0a1[_0xda87('0x31')][_0xda87('0x39')]);_0x956401['where']=qs[_0xda87('0x33')](_[_0xda87('0x3b')](_0x17b0a1[_0xda87('0x31')],_0x174e93[_0xda87('0x33')]));if(_0x17b0a1['query']['filter']){_0x956401[_0xda87('0x3a')]=_[_0xda87('0x3c')](_0x956401['where'],{'$or':_['map'](_0x956401[_0xda87('0x36')],function(_0x1c9c17){var _0x38943b={};_0x38943b[_0x1c9c17]={'$like':'%'+_0x17b0a1[_0xda87('0x31')][_0xda87('0x52')]+'%'};return _0x38943b;})});}_0x956401=_['merge']({},_0x956401,_0x17b0a1[_0xda87('0x3e')]);return _0x7a3ffc[_0xda87('0x4f')](_0x956401);}})[_0xda87('0x20')](function(_0x17ac90){if(_0x17ac90){_0xfbc90b=_0x17ac90['length'];if(!_0x17b0a1[_0xda87('0x31')]['hasOwnProperty']('nolimit')){_0x956401['limit']=qs[_0xda87('0x1a')](_0x17b0a1[_0xda87('0x31')][_0xda87('0x1a')]);_0x956401[_0xda87('0x18')]=qs[_0xda87('0x18')](_0x17b0a1['query'][_0xda87('0x18')]);}return _0x7a3ffc['getIntervals'](_0x956401);}})[_0xda87('0x20')](function(_0x4de528){if(_0x4de528){return _0x4de528?{'count':_0xfbc90b,'rows':_0x4de528}:null;}})[_0xda87('0x20')](respondWithResult(_0x507617,null))[_0xda87('0x42')](handleError(_0x507617,null));};exports[_0xda87('0x53')]=function(_0x2458a3,_0x45e077,_0x24ec5a){return db['Interval']['findOne']({'where':{'id':_0x2458a3[_0xda87('0x44')]['id']}})['then'](handleEntityNotFound(_0x45e077,null))[_0xda87('0x20')](function(_0x2c348e){if(_0x2c348e){return db['sequelize'][_0xda87('0x54')](function(_0x29a32c){return db[_0xda87('0x2b')][_0xda87('0x21')]({'where':{'IntervalId':_0x2458a3['params']['id']},'transaction':_0x29a32c})[_0xda87('0x20')](function(_0x2c228e){var _0x3f6dad=_[_0xda87('0x2a')](_0x2458a3[_0xda87('0x4c')],function(_0x127e2f){delete _0x127e2f['id'];_0x127e2f[_0xda87('0x4e')]=_0x2458a3[_0xda87('0x44')]['id'];return _0x127e2f;});return db['Interval']['bulkCreate'](_0x3f6dad,{'transaction':_0x29a32c});});})[_0xda87('0x20')](function(){return db[_0xda87('0x2b')]['findAll']({'where':{'IntervalId':_0x2458a3['params']['id']}});});}})[_0xda87('0x20')](respondWithResult(_0x45e077,null))['catch'](handleError(_0x45e077,null));};
\ No newline at end of file
index 8d03ecd..1ad88b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1dcc=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite'];(function(_0x48bba8,_0x1ba99f){var _0x191ebc=function(_0x115226){while(--_0x115226){_0x48bba8['push'](_0x48bba8['shift']());}};_0x191ebc(++_0x1ba99f);}(_0x1dcc,0x8c));var _0xc1dc=function(_0x5bdb21,_0x5069db){_0x5bdb21=_0x5bdb21-0x0;var _0x59222d=_0x1dcc[_0x5bdb21];return _0x59222d;};'use strict';var _=require(_0xc1dc('0x0'));var util=require(_0xc1dc('0x1'));var logger=require(_0xc1dc('0x2'))('api');var moment=require(_0xc1dc('0x3'));var BPromise=require(_0xc1dc('0x4'));var rp=require(_0xc1dc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc1dc('0x6'));var config=require('../../config/environment');var attributes=require(_0xc1dc('0x7'));var extensions=require(_0xc1dc('0x8'));module[_0xc1dc('0x9')]=function(_0x155803,_0x552593){return _0x155803[_0xc1dc('0xa')](_0xc1dc('0xb'),attributes,{'tableName':_0xc1dc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x56679b,_0x1731e8){extensions[_0xc1dc('0xd')](_0x155803,_0x56679b);},'afterBulkCreate':function(_0x296abc,_0x5208aa,_0x40fc24){_0x40fc24();extensions['rewrite'](_0x155803,_0x296abc[0x0]);},'afterUpdate':function(_0x566693,_0xffa5f8){extensions[_0xc1dc('0xd')](_0x155803,_0x566693);},'afterDestroy':function(_0x775fea,_0x1c577e){extensions[_0xc1dc('0xd')](_0x155803,_0x775fea);}}});};
\ No newline at end of file
+var _0x81db=['exports','tools_intervals','rewrite','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','../../components/extensions/rewrite'];(function(_0x46784e,_0x2adf21){var _0x2776da=function(_0x47aa77){while(--_0x47aa77){_0x46784e['push'](_0x46784e['shift']());}};_0x2776da(++_0x2adf21);}(_0x81db,0x9f));var _0xb81d=function(_0x135d50,_0x49fdf6){_0x135d50=_0x135d50-0x0;var _0x29836c=_0x81db[_0x135d50];return _0x29836c;};'use strict';var _=require(_0xb81d('0x0'));var util=require('util');var logger=require(_0xb81d('0x1'))(_0xb81d('0x2'));var moment=require('moment');var BPromise=require(_0xb81d('0x3'));var rp=require(_0xb81d('0x4'));var fs=require('fs');var path=require(_0xb81d('0x5'));var rimraf=require(_0xb81d('0x6'));var config=require(_0xb81d('0x7'));var attributes=require('./interval.attributes');var extensions=require(_0xb81d('0x8'));module[_0xb81d('0x9')]=function(_0x436784,_0x51cae3){return _0x436784['define']('Interval',attributes,{'tableName':_0xb81d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5674e9,_0x2830fe){extensions[_0xb81d('0xb')](_0x436784,_0x5674e9);},'afterBulkCreate':function(_0x3c5be4,_0x38f097,_0x13d5f9){_0x13d5f9();extensions[_0xb81d('0xb')](_0x436784,_0x3c5be4[0x0]);},'afterUpdate':function(_0x3a6b2e,_0x5df31f){extensions[_0xb81d('0xb')](_0x436784,_0x3a6b2e);},'afterDestroy':function(_0x4ad22e,_0x4327b2){extensions[_0xb81d('0xb')](_0x436784,_0x4ad22e);}}});};
\ No newline at end of file
index df35a42..236352c 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(_0x4854d6,_0x2f1264){var _0x3885c0=function(_0x4d564d){while(--_0x4d564d){_0x4854d6['push'](_0x4854d6['shift']());}};_0x3885c0(++_0x2f1264);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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(_0x28014d,_0x383e2f){var _0x2572cc=function(_0x17aabd){while(--_0x17aabd){_0x28014d['push'](_0x28014d['shift']());}};_0x2572cc(++_0x383e2f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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 b3ce4c3..52656d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4880fd,_0x2cc70d){_0x4880fd=_0x4880fd-0x0;var _0x4a4b50=_0x0b0e[_0x4880fd];return _0x4a4b50;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('0x5')]=router;
\ No newline at end of file
+var _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x2ffee8,_0x308957){var _0x26f0c8=function(_0x3c5ef2){while(--_0x3c5ef2){_0x2ffee8['push'](_0x2ffee8['shift']());}};_0x26f0c8(++_0x308957);}(_0x2032,0xd9));var _0x2203=function(_0x12accf,_0x357361){_0x12accf=_0x12accf-0x0;var _0x1f99bc=_0x2032[_0x12accf];return _0x1f99bc;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router;
\ No newline at end of file
index ebde0dc..374b99e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2d8=['write','openIssue','send','body','connection','remoteAddress','socket','bluebird','https','../../config/logger','3eAmWpBVP0','key','MOTGUI','summary','Report','description','stringify','Bug','fields','customfield_11500','email','oldToken','newToken','customfield_11503','name','reason','track.xcallymotion.com','/rest/api/2/issue','toString','base64','request','setEncoding','utf8','data','end','statusCode','json','error','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xc2d8,0xd4));var _0x8c2d=function(_0x1b1dbd,_0x2fe3e2){_0x1b1dbd=_0x1b1dbd-0x0;var _0x3a3fcd=_0xc2d8[_0x1b1dbd];return _0x3a3fcd;};'use strict';var BPromise=require(_0x8c2d('0x0'));var https=require(_0x8c2d('0x1'));var logger=require(_0x8c2d('0x2'))('api');var USERNAME='support';var PASSWORD=_0x8c2d('0x3');function openIssue(_0x4fcda9,_0x2206b5){var _0x8a0dff={'fields':{'project':{'key':_0x4fcda9[_0x8c2d('0x4')]||_0x8c2d('0x5')},'summary':(_0x4fcda9[_0x8c2d('0x6')]||_0x8c2d('0x7'))+'\x20from\x20'+_0x4fcda9['ip'],'description':_0x4fcda9[_0x8c2d('0x8')]||JSON[_0x8c2d('0x9')](_0x4fcda9),'issuetype':{'name':_0x4fcda9['issuetype']||_0x8c2d('0xa')}}};_0x8a0dff[_0x8c2d('0xb')][_0x8c2d('0xc')]=_0x4fcda9[_0x8c2d('0xd')];_0x8a0dff[_0x8c2d('0xb')]['customfield_11501']=_0x4fcda9[_0x8c2d('0xe')];_0x8a0dff[_0x8c2d('0xb')]['customfield_11502']=_0x4fcda9[_0x8c2d('0xf')];_0x8a0dff[_0x8c2d('0xb')][_0x8c2d('0x10')]=_0x4fcda9[_0x8c2d('0x11')];_0x8a0dff[_0x8c2d('0xb')]['customfield_11504']=_0x4fcda9[_0x8c2d('0x12')];_0x8a0dff[_0x8c2d('0xb')]['customfield_10102']=_0x4fcda9['ip'];var _0x573f52={'host':_0x8c2d('0x13'),'port':0x1bb,'path':_0x8c2d('0x14'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x8c2d('0x15')](_0x8c2d('0x16'))}};var _0x3b496e=JSON['stringify'](_0x8a0dff);var _0xed67fc=https[_0x8c2d('0x17')](_0x573f52,function(_0x8b4825){_0x8b4825[_0x8c2d('0x18')](_0x8c2d('0x19'));var _0x388b12='';_0x8b4825['on'](_0x8c2d('0x1a'),function(_0x1efb8a){_0x388b12+=_0x1efb8a;});_0x8b4825['on'](_0x8c2d('0x1b'),function(){if(_0x2206b5){return _0x2206b5['status'](_0x8b4825[_0x8c2d('0x1c')])[_0x8c2d('0x1d')](JSON['parse'](_0x388b12));}});});_0xed67fc['on'](_0x8c2d('0x1e'),function(_0x3de061){if(_0x2206b5){return _0x2206b5[_0x8c2d('0x1f')](0x1f4)[_0x8c2d('0x1d')]({'errors':[{'message':_0x8c2d('0x20'),'type':_0x8c2d('0x21')}]});}});_0xed67fc[_0x8c2d('0x22')](_0x3b496e);_0xed67fc[_0x8c2d('0x1b')]();}exports[_0x8c2d('0x23')]=openIssue;exports[_0x8c2d('0x24')]=function(_0x24991e,_0x3582c5){_0x24991e[_0x8c2d('0x25')]['ip']=_0x24991e['headers']['x-forwarded-for']||_0x24991e[_0x8c2d('0x26')][_0x8c2d('0x27')]||_0x24991e[_0x8c2d('0x28')][_0x8c2d('0x27')]||_0x24991e['connection']['socket']['remoteAddress'];return openIssue(_0x24991e[_0x8c2d('0x25')],_0x3582c5);};
\ No newline at end of file
+var _0xdd7b=['setEncoding','data','end','status','statusCode','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','https','../../config/logger','support','3eAmWpBVP0','key','summary','\x20from\x20','description','stringify','issuetype','fields','email','customfield_11501','oldToken','customfield_11503','name','customfield_11504','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','base64'];(function(_0x1fb80d,_0x4591b0){var _0x1e9d52=function(_0x238215){while(--_0x238215){_0x1fb80d['push'](_0x1fb80d['shift']());}};_0x1e9d52(++_0x4591b0);}(_0xdd7b,0x130));var _0xbdd7=function(_0x25a661,_0x28b612){_0x25a661=_0x25a661-0x0;var _0x16a63c=_0xdd7b[_0x25a661];return _0x16a63c;};'use strict';var BPromise=require('bluebird');var https=require(_0xbdd7('0x0'));var logger=require(_0xbdd7('0x1'))('api');var USERNAME=_0xbdd7('0x2');var PASSWORD=_0xbdd7('0x3');function openIssue(_0xe0b306,_0x1e4e60){var _0x4e113a={'fields':{'project':{'key':_0xe0b306[_0xbdd7('0x4')]||'MOTGUI'},'summary':(_0xe0b306[_0xbdd7('0x5')]||'Report')+_0xbdd7('0x6')+_0xe0b306['ip'],'description':_0xe0b306[_0xbdd7('0x7')]||JSON[_0xbdd7('0x8')](_0xe0b306),'issuetype':{'name':_0xe0b306[_0xbdd7('0x9')]||'Bug'}}};_0x4e113a[_0xbdd7('0xa')]['customfield_11500']=_0xe0b306[_0xbdd7('0xb')];_0x4e113a[_0xbdd7('0xa')][_0xbdd7('0xc')]=_0xe0b306[_0xbdd7('0xd')];_0x4e113a['fields']['customfield_11502']=_0xe0b306['newToken'];_0x4e113a[_0xbdd7('0xa')][_0xbdd7('0xe')]=_0xe0b306[_0xbdd7('0xf')];_0x4e113a[_0xbdd7('0xa')][_0xbdd7('0x10')]=_0xe0b306['reason'];_0x4e113a[_0xbdd7('0xa')][_0xbdd7('0x11')]=_0xe0b306['ip'];var _0x3c574d={'host':_0xbdd7('0x12'),'port':0x1bb,'path':_0xbdd7('0x13'),'method':_0xbdd7('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0xbdd7('0x15'),'Authorization':_0xbdd7('0x16')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0xbdd7('0x17'))}};var _0x18bb1c=JSON[_0xbdd7('0x8')](_0x4e113a);var _0x203c53=https['request'](_0x3c574d,function(_0x22b21b){_0x22b21b[_0xbdd7('0x18')]('utf8');var _0x4708a7='';_0x22b21b['on'](_0xbdd7('0x19'),function(_0x47f781){_0x4708a7+=_0x47f781;});_0x22b21b['on'](_0xbdd7('0x1a'),function(){if(_0x1e4e60){return _0x1e4e60[_0xbdd7('0x1b')](_0x22b21b[_0xbdd7('0x1c')])[_0xbdd7('0x1d')](JSON['parse'](_0x4708a7));}});});_0x203c53['on']('error',function(_0x24ce0a){if(_0x1e4e60){return _0x1e4e60[_0xbdd7('0x1b')](0x1f4)[_0xbdd7('0x1d')]({'errors':[{'message':_0xbdd7('0x1e'),'type':_0xbdd7('0x1f')}]});}});_0x203c53[_0xbdd7('0x20')](_0x18bb1c);_0x203c53['end']();}exports[_0xbdd7('0x21')]=openIssue;exports[_0xbdd7('0x22')]=function(_0x2c28f1,_0x1cb5ac){_0x2c28f1[_0xbdd7('0x23')]['ip']=_0x2c28f1[_0xbdd7('0x24')][_0xbdd7('0x25')]||_0x2c28f1[_0xbdd7('0x26')][_0xbdd7('0x27')]||_0x2c28f1[_0xbdd7('0x28')][_0xbdd7('0x27')]||_0x2c28f1[_0xbdd7('0x26')]['socket']['remoteAddress'];return openIssue(_0x2c28f1[_0xbdd7('0x23')],_0x1cb5ac);};
\ No newline at end of file
index c13736b..f0d867e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91a7=['Router','../../components/auth/service','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout'];(function(_0x5ecc63,_0x110d0d){var _0x56e65f=function(_0x138202){while(--_0x138202){_0x5ecc63['push'](_0x5ecc63['shift']());}};_0x56e65f(++_0x110d0d);}(_0x91a7,0xe7));var _0x791a=function(_0x35b19d,_0x585ab5){_0x35b19d=_0x35b19d-0x0;var _0x571f72=_0x91a7[_0x35b19d];return _0x571f72;};'use strict';var multer=require('multer');var util=require(_0x791a('0x0'));var path=require(_0x791a('0x1'));var timeout=require(_0x791a('0x2'));var express=require('express');var router=express[_0x791a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x791a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x791a('0x5'));router[_0x791a('0x6')]('/',auth['isAuthenticated'](),controller[_0x791a('0x7')]);router['get'](_0x791a('0x8'),auth[_0x791a('0x9')](),controller['describe']);router[_0x791a('0x6')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0xb')]);router[_0x791a('0xc')]('/',auth['isAuthenticated'](),controller[_0x791a('0xd')]);router[_0x791a('0xe')]('/:id',auth[_0x791a('0x9')](),controller[_0x791a('0xf')]);router[_0x791a('0x10')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x55e0=['./jscriptyAnswerReport.controller','get','isAuthenticated','describe','/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1f60a3,_0x32f1f8){var _0x5bb3c9=function(_0x2cdbb0){while(--_0x2cdbb0){_0x1f60a3['push'](_0x1f60a3['shift']());}};_0x5bb3c9(++_0x32f1f8);}(_0x55e0,0xdc));var _0x055e=function(_0x437746,_0x3ecf1f){_0x437746=_0x437746-0x0;var _0x5b0ffc=_0x55e0[_0x437746];return _0x5b0ffc;};'use strict';var multer=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var path=require(_0x055e('0x2'));var timeout=require(_0x055e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x055e('0x4'));var auth=require(_0x055e('0x5'));var interaction=require(_0x055e('0x6'));var config=require(_0x055e('0x7'));var controller=require(_0x055e('0x8'));router[_0x055e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x055e('0x9')]('/describe',auth[_0x055e('0xa')](),controller[_0x055e('0xb')]);router[_0x055e('0x9')](_0x055e('0xc'),auth[_0x055e('0xa')](),controller['show']);router[_0x055e('0xd')]('/',auth[_0x055e('0xa')](),controller[_0x055e('0xe')]);router[_0x055e('0xf')](_0x055e('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x055e('0x10')]('/:id',auth[_0x055e('0xa')](),controller[_0x055e('0x11')]);module[_0x055e('0x12')]=router;
\ No newline at end of file
index fe5876f..b11ea4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x7a54,0x106));var _0x47a5=function(_0xf832b2,_0x2d53ce){_0xf832b2=_0xf832b2-0x0;var _0x23f114=_0x7a54[_0xf832b2];return _0x23f114;};'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(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x7a54,0x106));var _0x47a5=function(_0x2eeb82,_0x5a28d6){_0x2eeb82=_0x2eeb82-0x0;var _0x309246=_0x7a54[_0x2eeb82];return _0x309246;};'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 ce4643a..b2e6c97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbeea=['stack','name','index','map','JscriptyAnswerReport','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filters','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','length','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','apply','save','update','destroy','then','sendStatus'];(function(_0x23071e,_0x4df73d){var _0x397837=function(_0x3a1e44){while(--_0x3a1e44){_0x23071e['push'](_0x23071e['shift']());}};_0x397837(++_0x4df73d);}(_0xbeea,0xb1));var _0xabee=function(_0x3374db,_0x3b178c){_0x3374db=_0x3374db-0x0;var _0x4d8156=_0xbeea[_0x3374db];return _0x4d8156;};'use strict';var emlformat=require(_0xabee('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xabee('0x1'));var jsonpatch=require(_0xabee('0x2'));var rp=require(_0xabee('0x3'));var moment=require('moment');var BPromise=require(_0xabee('0x4'));var Mustache=require('mustache');var util=require(_0xabee('0x5'));var path=require(_0xabee('0x6'));var sox=require(_0xabee('0x7'));var csv=require(_0xabee('0x8'));var ejs=require(_0xabee('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xabee('0xa'));var crypto=require(_0xabee('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xabee('0xc'));var toCsv=require('to-csv');var querystring=require(_0xabee('0xd'));var Papa=require(_0xabee('0xe'));var Redis=require(_0xabee('0xf'));var authService=require(_0xabee('0x10'));var qs=require(_0xabee('0x11'));var as=require(_0xabee('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xabee('0x13'))(_0xabee('0x14'));var utils=require(_0xabee('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xabee('0x16'));var db=require(_0xabee('0x17'))['db'];function respondWithStatusCode(_0x16d6a5,_0x49fb73){_0x49fb73=_0x49fb73||0xcc;return function(_0x5915a1){if(_0x5915a1){return _0x16d6a5['sendStatus'](_0x49fb73);}return _0x16d6a5['status'](_0x49fb73)['end']();};}function respondWithResult(_0x113c5c,_0x370a4e){_0x370a4e=_0x370a4e||0xc8;return function(_0x38ba29){if(_0x38ba29){return _0x113c5c[_0xabee('0x18')](_0x370a4e)[_0xabee('0x19')](_0x38ba29);}};}function respondWithFilteredResult(_0x5e94ff,_0x177670){return function(_0x2d85a4){if(_0x2d85a4){var _0x2f1107=typeof _0x177670[_0xabee('0x1a')]===_0xabee('0x1b')&&typeof _0x177670[_0xabee('0x1c')]===_0xabee('0x1b');var _0x5a9562=_0x2d85a4[_0xabee('0x1d')];var _0x112bb9=_0x2f1107?0x0:_0x177670[_0xabee('0x1a')];var _0x471b24=_0x2f1107?_0x2d85a4[_0xabee('0x1d')]:_0x177670[_0xabee('0x1a')]+_0x177670['limit'];var _0x47fa3f;if(_0x471b24>=_0x5a9562){_0x471b24=_0x5a9562;_0x47fa3f=0xc8;}else{_0x47fa3f=0xce;}_0x5e94ff[_0xabee('0x18')](_0x47fa3f);return _0x5e94ff['set']('Content-Range',_0x112bb9+'-'+_0x471b24+'/'+_0x5a9562)[_0xabee('0x19')](_0x2d85a4);}return null;};}function patchUpdates(_0x443301){return function(_0x3dd1ff){try{jsonpatch[_0xabee('0x1e')](_0x3dd1ff,_0x443301,!![]);}catch(_0x2b66f5){return BPromise['reject'](_0x2b66f5);}return _0x3dd1ff[_0xabee('0x1f')]();};}function saveUpdates(_0x54014d,_0x4f5501){return function(_0x4926d7){if(_0x4926d7){return _0x4926d7[_0xabee('0x20')](_0x54014d)['then'](function(_0x870569){return _0x870569;});}return null;};}function removeEntity(_0x2834e3,_0x520bc){return function(_0x15a36c){if(_0x15a36c){return _0x15a36c[_0xabee('0x21')]()[_0xabee('0x22')](function(){_0x2834e3[_0xabee('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdbbf57,_0xfc419d){return function(_0x42277e){if(!_0x42277e){_0xdbbf57[_0xabee('0x23')](0x194);}return _0x42277e;};}function handleError(_0x4ae65e,_0x2aa470){_0x2aa470=_0x2aa470||0x1f4;return function(_0x123d58){logger['error'](_0x123d58[_0xabee('0x24')]);if(_0x123d58[_0xabee('0x25')]){delete _0x123d58[_0xabee('0x25')];}_0x4ae65e[_0xabee('0x18')](_0x2aa470)['send'](_0x123d58);};}exports[_0xabee('0x26')]=function(_0x2b7464,_0x1b5aee){var _0x37e780={},_0x1c4f51={},_0x116e41={'count':0x0,'rows':[]};var _0x3df00d=_[_0xabee('0x27')](db[_0xabee('0x28')]['rawAttributes'],function(_0x2a2441){return{'name':_0x2a2441['fieldName'],'type':_0x2a2441[_0xabee('0x29')][_0xabee('0x2a')]};});_0x1c4f51[_0xabee('0x2b')]=_[_0xabee('0x27')](_0x3df00d,'name');_0x1c4f51[_0xabee('0x2c')]=_['keys'](_0x2b7464[_0xabee('0x2c')]);_0x1c4f51['filters']=_[_0xabee('0x2d')](_0x1c4f51['model'],_0x1c4f51['query']);_0x37e780[_0xabee('0x2e')]=_[_0xabee('0x2d')](_0x1c4f51[_0xabee('0x2b')],qs[_0xabee('0x2f')](_0x2b7464[_0xabee('0x2c')][_0xabee('0x2f')]));_0x37e780[_0xabee('0x2e')]=_0x37e780[_0xabee('0x2e')]['length']?_0x37e780[_0xabee('0x2e')]:_0x1c4f51[_0xabee('0x2b')];if(!_0x2b7464[_0xabee('0x2c')][_0xabee('0x30')](_0xabee('0x31'))){_0x37e780[_0xabee('0x1c')]=qs[_0xabee('0x1c')](_0x2b7464[_0xabee('0x2c')][_0xabee('0x1c')]);_0x37e780[_0xabee('0x1a')]=qs[_0xabee('0x1a')](_0x2b7464[_0xabee('0x2c')][_0xabee('0x1a')]);}_0x37e780[_0xabee('0x32')]=qs[_0xabee('0x33')](_0x2b7464[_0xabee('0x2c')][_0xabee('0x33')]);_0x37e780['where']=qs['filters'](_[_0xabee('0x34')](_0x2b7464[_0xabee('0x2c')],_0x1c4f51[_0xabee('0x35')]),_0x3df00d);if(_0x2b7464[_0xabee('0x2c')]['filter']){_0x37e780[_0xabee('0x36')]=_[_0xabee('0x37')](_0x37e780[_0xabee('0x36')],{'$or':_['map'](_0x3df00d,function(_0x1a48d5){if(_0x1a48d5['type']!==_0xabee('0x38')){var _0x879d31={};_0x879d31[_0x1a48d5[_0xabee('0x25')]]={'$like':'%'+_0x2b7464[_0xabee('0x2c')]['filter']+'%'};return _0x879d31;}})});}_0x37e780=_['merge']({},_0x37e780,_0x2b7464[_0xabee('0x39')]);var _0xb76b1d={'where':_0x37e780[_0xabee('0x36')]};return db[_0xabee('0x28')][_0xabee('0x1d')](_0xb76b1d)['then'](function(_0x229b00){_0x116e41[_0xabee('0x1d')]=_0x229b00;if(_0x2b7464['query'][_0xabee('0x3a')]){_0x37e780[_0xabee('0x3b')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xabee('0x3c')](_0x37e780);})[_0xabee('0x22')](function(_0x3f05ee){_0x116e41[_0xabee('0x3d')]=_0x3f05ee;return _0x116e41;})[_0xabee('0x22')](respondWithFilteredResult(_0x1b5aee,_0x37e780))[_0xabee('0x3e')](handleError(_0x1b5aee,null));};exports[_0xabee('0x3f')]=function(_0x4ee7e6,_0x36fc07){var _0x22fc91={'raw':!![],'where':{'id':_0x4ee7e6['params']['id']}},_0x206350={};_0x206350[_0xabee('0x2b')]=_[_0xabee('0x40')](db['JscriptyAnswerReport'][_0xabee('0x41')]);_0x206350[_0xabee('0x2c')]=_['keys'](_0x4ee7e6[_0xabee('0x2c')]);_0x206350[_0xabee('0x35')]=_[_0xabee('0x2d')](_0x206350[_0xabee('0x2b')],_0x206350[_0xabee('0x2c')]);_0x22fc91[_0xabee('0x2e')]=_[_0xabee('0x2d')](_0x206350['model'],qs[_0xabee('0x2f')](_0x4ee7e6[_0xabee('0x2c')][_0xabee('0x2f')]));_0x22fc91['attributes']=_0x22fc91[_0xabee('0x2e')][_0xabee('0x42')]?_0x22fc91['attributes']:_0x206350['model'];if(_0x4ee7e6['query'][_0xabee('0x3a')]){_0x22fc91[_0xabee('0x3b')]=[{'all':!![]}];}_0x22fc91=_['merge']({},_0x22fc91,_0x4ee7e6['options']);return db[_0xabee('0x28')][_0xabee('0x43')](_0x22fc91)[_0xabee('0x22')](handleEntityNotFound(_0x36fc07,null))[_0xabee('0x22')](respondWithResult(_0x36fc07,null))[_0xabee('0x3e')](handleError(_0x36fc07,null));};exports[_0xabee('0x44')]=function(_0x430b08,_0x307d34){return db[_0xabee('0x28')][_0xabee('0x44')](_0x430b08[_0xabee('0x45')],{})[_0xabee('0x22')](respondWithResult(_0x307d34,0xc9))[_0xabee('0x3e')](handleError(_0x307d34,null));};exports[_0xabee('0x20')]=function(_0x3e277d,_0x252f60){if(_0x3e277d[_0xabee('0x45')]['id']){delete _0x3e277d[_0xabee('0x45')]['id'];}return db['JscriptyAnswerReport'][_0xabee('0x43')]({'where':{'id':_0x3e277d[_0xabee('0x46')]['id']}})['then'](handleEntityNotFound(_0x252f60,null))['then'](saveUpdates(_0x3e277d[_0xabee('0x45')],null))[_0xabee('0x22')](respondWithResult(_0x252f60,null))[_0xabee('0x3e')](handleError(_0x252f60,null));};exports[_0xabee('0x21')]=function(_0xe2433f,_0x3d819a){return db[_0xabee('0x28')]['find']({'where':{'id':_0xe2433f[_0xabee('0x46')]['id']}})['then'](handleEntityNotFound(_0x3d819a,null))[_0xabee('0x22')](removeEntity(_0x3d819a,null))[_0xabee('0x3e')](handleError(_0x3d819a,null));};exports['describe']=function(_0x3ebd50,_0x3aaf14){return db[_0xabee('0x28')]['describe']()[_0xabee('0x22')](respondWithResult(_0x3aaf14,null))['catch'](handleError(_0x3aaf14,null));};
\ No newline at end of file
+var _0x3ca4=['describe','eml-format','rimraf','zip-dir','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/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','then','destroy','error','send','index','map','fieldName','type','key','model','name','keys','filters','intersection','query','attributes','fields','hasOwnProperty','sort','where','filter','merge','VIRTUAL','JscriptyAnswerReport','includeAll','include','findAll','catch','show','params','rawAttributes','length','options','find','create','update','body'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x3ca4,0x17d));var _0x43ca=function(_0x38d4a2,_0x24cdc1){_0x38d4a2=_0x38d4a2-0x0;var _0x51d655=_0x3ca4[_0x38d4a2];return _0x51d655;};'use strict';var emlformat=require(_0x43ca('0x0'));var rimraf=require(_0x43ca('0x1'));var zipdir=require(_0x43ca('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x43ca('0x3'));var BPromise=require(_0x43ca('0x4'));var Mustache=require(_0x43ca('0x5'));var util=require(_0x43ca('0x6'));var path=require(_0x43ca('0x7'));var sox=require(_0x43ca('0x8'));var csv=require(_0x43ca('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x43ca('0xa'));var _=require(_0x43ca('0xb'));var squel=require(_0x43ca('0xc'));var crypto=require(_0x43ca('0xd'));var jsforce=require(_0x43ca('0xe'));var deskjs=require(_0x43ca('0xf'));var toCsv=require(_0x43ca('0x9'));var querystring=require(_0x43ca('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x43ca('0x11'));var qs=require(_0x43ca('0x12'));var as=require(_0x43ca('0x13'));var hardwareService=require(_0x43ca('0x14'));var logger=require('../../config/logger')(_0x43ca('0x15'));var utils=require(_0x43ca('0x16'));var config=require(_0x43ca('0x17'));var licenseUtil=require(_0x43ca('0x18'));var db=require(_0x43ca('0x19'))['db'];function respondWithStatusCode(_0x246ead,_0x30184f){_0x30184f=_0x30184f||0xcc;return function(_0x2ede07){if(_0x2ede07){return _0x246ead[_0x43ca('0x1a')](_0x30184f);}return _0x246ead['status'](_0x30184f)[_0x43ca('0x1b')]();};}function respondWithResult(_0x13cf26,_0x4b710d){_0x4b710d=_0x4b710d||0xc8;return function(_0x309176){if(_0x309176){return _0x13cf26['status'](_0x4b710d)[_0x43ca('0x1c')](_0x309176);}};}function respondWithFilteredResult(_0x567579,_0xdccc62){return function(_0x1a8bf6){if(_0x1a8bf6){var _0x51a517=typeof _0xdccc62[_0x43ca('0x1d')]===_0x43ca('0x1e')&&typeof _0xdccc62[_0x43ca('0x1f')]==='undefined';var _0x4fb5e4=_0x1a8bf6['count'];var _0x5e50c9=_0x51a517?0x0:_0xdccc62[_0x43ca('0x1d')];var _0x268817=_0x51a517?_0x1a8bf6[_0x43ca('0x20')]:_0xdccc62['offset']+_0xdccc62[_0x43ca('0x1f')];var _0x806f68;if(_0x268817>=_0x4fb5e4){_0x268817=_0x4fb5e4;_0x806f68=0xc8;}else{_0x806f68=0xce;}_0x567579[_0x43ca('0x21')](_0x806f68);return _0x567579['set'](_0x43ca('0x22'),_0x5e50c9+'-'+_0x268817+'/'+_0x4fb5e4)['json'](_0x1a8bf6);}return null;};}function patchUpdates(_0x106d07){return function(_0x9bc5dc){try{jsonpatch[_0x43ca('0x23')](_0x9bc5dc,_0x106d07,!![]);}catch(_0x5ae497){return BPromise[_0x43ca('0x24')](_0x5ae497);}return _0x9bc5dc[_0x43ca('0x25')]();};}function saveUpdates(_0x2af64f,_0x2ad8fa){return function(_0x35d34c){if(_0x35d34c){return _0x35d34c['update'](_0x2af64f)[_0x43ca('0x26')](function(_0x34767e){return _0x34767e;});}return null;};}function removeEntity(_0x557b96,_0x379902){return function(_0x22d6ac){if(_0x22d6ac){return _0x22d6ac[_0x43ca('0x27')]()[_0x43ca('0x26')](function(){_0x557b96[_0x43ca('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2da1ec,_0xc07cde){return function(_0x29f2ee){if(!_0x29f2ee){_0x2da1ec[_0x43ca('0x1a')](0x194);}return _0x29f2ee;};}function handleError(_0x14287e,_0x1de54b){_0x1de54b=_0x1de54b||0x1f4;return function(_0x3b2078){logger[_0x43ca('0x28')](_0x3b2078['stack']);if(_0x3b2078['name']){delete _0x3b2078['name'];}_0x14287e[_0x43ca('0x21')](_0x1de54b)[_0x43ca('0x29')](_0x3b2078);};}exports[_0x43ca('0x2a')]=function(_0x9d09b9,_0x34dc4f){var _0x36884b={},_0xffad2d={},_0x3f0b2b={'count':0x0,'rows':[]};var _0x5f37ff=_[_0x43ca('0x2b')](db['JscriptyAnswerReport']['rawAttributes'],function(_0x12b2a2){return{'name':_0x12b2a2[_0x43ca('0x2c')],'type':_0x12b2a2[_0x43ca('0x2d')][_0x43ca('0x2e')]};});_0xffad2d[_0x43ca('0x2f')]=_['map'](_0x5f37ff,_0x43ca('0x30'));_0xffad2d['query']=_[_0x43ca('0x31')](_0x9d09b9['query']);_0xffad2d[_0x43ca('0x32')]=_[_0x43ca('0x33')](_0xffad2d['model'],_0xffad2d[_0x43ca('0x34')]);_0x36884b[_0x43ca('0x35')]=_[_0x43ca('0x33')](_0xffad2d[_0x43ca('0x2f')],qs[_0x43ca('0x36')](_0x9d09b9[_0x43ca('0x34')][_0x43ca('0x36')]));_0x36884b['attributes']=_0x36884b[_0x43ca('0x35')]['length']?_0x36884b[_0x43ca('0x35')]:_0xffad2d[_0x43ca('0x2f')];if(!_0x9d09b9['query'][_0x43ca('0x37')]('nolimit')){_0x36884b['limit']=qs[_0x43ca('0x1f')](_0x9d09b9[_0x43ca('0x34')][_0x43ca('0x1f')]);_0x36884b[_0x43ca('0x1d')]=qs[_0x43ca('0x1d')](_0x9d09b9[_0x43ca('0x34')][_0x43ca('0x1d')]);}_0x36884b['order']=qs[_0x43ca('0x38')](_0x9d09b9[_0x43ca('0x34')]['sort']);_0x36884b[_0x43ca('0x39')]=qs[_0x43ca('0x32')](_['pick'](_0x9d09b9[_0x43ca('0x34')],_0xffad2d['filters']),_0x5f37ff);if(_0x9d09b9['query'][_0x43ca('0x3a')]){_0x36884b[_0x43ca('0x39')]=_[_0x43ca('0x3b')](_0x36884b[_0x43ca('0x39')],{'$or':_[_0x43ca('0x2b')](_0x5f37ff,function(_0x2205c4){if(_0x2205c4[_0x43ca('0x2d')]!==_0x43ca('0x3c')){var _0x35e316={};_0x35e316[_0x2205c4[_0x43ca('0x30')]]={'$like':'%'+_0x9d09b9[_0x43ca('0x34')][_0x43ca('0x3a')]+'%'};return _0x35e316;}})});}_0x36884b=_['merge']({},_0x36884b,_0x9d09b9['options']);var _0xb36699={'where':_0x36884b[_0x43ca('0x39')]};return db[_0x43ca('0x3d')]['count'](_0xb36699)[_0x43ca('0x26')](function(_0x57a2d4){_0x3f0b2b[_0x43ca('0x20')]=_0x57a2d4;if(_0x9d09b9['query'][_0x43ca('0x3e')]){_0x36884b[_0x43ca('0x3f')]=[{'all':!![]}];}return db[_0x43ca('0x3d')][_0x43ca('0x40')](_0x36884b);})[_0x43ca('0x26')](function(_0xc48edb){_0x3f0b2b['rows']=_0xc48edb;return _0x3f0b2b;})['then'](respondWithFilteredResult(_0x34dc4f,_0x36884b))[_0x43ca('0x41')](handleError(_0x34dc4f,null));};exports[_0x43ca('0x42')]=function(_0x1a3d8d,_0x331505){var _0x4343c0={'raw':!![],'where':{'id':_0x1a3d8d[_0x43ca('0x43')]['id']}},_0x35cb5e={};_0x35cb5e[_0x43ca('0x2f')]=_[_0x43ca('0x31')](db[_0x43ca('0x3d')][_0x43ca('0x44')]);_0x35cb5e[_0x43ca('0x34')]=_[_0x43ca('0x31')](_0x1a3d8d[_0x43ca('0x34')]);_0x35cb5e[_0x43ca('0x32')]=_[_0x43ca('0x33')](_0x35cb5e[_0x43ca('0x2f')],_0x35cb5e[_0x43ca('0x34')]);_0x4343c0[_0x43ca('0x35')]=_[_0x43ca('0x33')](_0x35cb5e[_0x43ca('0x2f')],qs['fields'](_0x1a3d8d[_0x43ca('0x34')][_0x43ca('0x36')]));_0x4343c0[_0x43ca('0x35')]=_0x4343c0['attributes'][_0x43ca('0x45')]?_0x4343c0[_0x43ca('0x35')]:_0x35cb5e[_0x43ca('0x2f')];if(_0x1a3d8d[_0x43ca('0x34')][_0x43ca('0x3e')]){_0x4343c0[_0x43ca('0x3f')]=[{'all':!![]}];}_0x4343c0=_[_0x43ca('0x3b')]({},_0x4343c0,_0x1a3d8d[_0x43ca('0x46')]);return db[_0x43ca('0x3d')][_0x43ca('0x47')](_0x4343c0)[_0x43ca('0x26')](handleEntityNotFound(_0x331505,null))['then'](respondWithResult(_0x331505,null))[_0x43ca('0x41')](handleError(_0x331505,null));};exports[_0x43ca('0x48')]=function(_0x31bbaf,_0x4b4c54){return db['JscriptyAnswerReport'][_0x43ca('0x48')](_0x31bbaf['body'],{})[_0x43ca('0x26')](respondWithResult(_0x4b4c54,0xc9))['catch'](handleError(_0x4b4c54,null));};exports[_0x43ca('0x49')]=function(_0x25e0fd,_0x45cafd){if(_0x25e0fd['body']['id']){delete _0x25e0fd[_0x43ca('0x4a')]['id'];}return db[_0x43ca('0x3d')]['find']({'where':{'id':_0x25e0fd[_0x43ca('0x43')]['id']}})['then'](handleEntityNotFound(_0x45cafd,null))['then'](saveUpdates(_0x25e0fd[_0x43ca('0x4a')],null))[_0x43ca('0x26')](respondWithResult(_0x45cafd,null))[_0x43ca('0x41')](handleError(_0x45cafd,null));};exports[_0x43ca('0x27')]=function(_0x10c183,_0x435daa){return db['JscriptyAnswerReport']['find']({'where':{'id':_0x10c183[_0x43ca('0x43')]['id']}})[_0x43ca('0x26')](handleEntityNotFound(_0x435daa,null))['then'](removeEntity(_0x435daa,null))['catch'](handleError(_0x435daa,null));};exports[_0x43ca('0x4b')]=function(_0x55107c,_0x218604){return db[_0x43ca('0x3d')][_0x43ca('0x4b')]()['then'](respondWithResult(_0x218604,null))[_0x43ca('0x41')](handleError(_0x218604,null));};
\ No newline at end of file
index 6dcb9a4..2ccbbcd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed2d=['rimraf','../../config/environment','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2b3cad,_0x573629){var _0x2175c4=function(_0x2f5a4f){while(--_0x2f5a4f){_0x2b3cad['push'](_0x2b3cad['shift']());}};_0x2175c4(++_0x573629);}(_0xed2d,0x116));var _0xded2=function(_0x3b7b42,_0x31badd){_0x3b7b42=_0x3b7b42-0x0;var _0x1ebaad=_0xed2d[_0x3b7b42];return _0x1ebaad;};'use strict';var _=require(_0xded2('0x0'));var util=require(_0xded2('0x1'));var logger=require(_0xded2('0x2'))(_0xded2('0x3'));var moment=require(_0xded2('0x4'));var BPromise=require(_0xded2('0x5'));var rp=require(_0xded2('0x6'));var fs=require('fs');var path=require(_0xded2('0x7'));var rimraf=require(_0xded2('0x8'));var config=require(_0xded2('0x9'));var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x1e6a19,_0x188d59){return _0x1e6a19[_0xded2('0xa')](_0xded2('0xb'),attributes,{'tableName':_0xded2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x771a=['path','./jscriptyAnswerReport.attributes','define','report_jscripty_answers','util','../../config/logger','api','bluebird'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x771a,0x18c));var _0xa771=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x771a[_0x2064e5];return _0x21a233;};'use strict';var _=require('lodash');var util=require(_0xa771('0x0'));var logger=require(_0xa771('0x1'))(_0xa771('0x2'));var moment=require('moment');var BPromise=require(_0xa771('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa771('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa771('0x5'));module['exports']=function(_0x567534,_0x572106){return _0x567534[_0xa771('0x6')]('JscriptyAnswerReport',attributes,{'tableName':_0xa771('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9623893..0fcf51a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e44=['code','message','info','result','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x2b683f,_0x32bf74){var _0x39866d=function(_0x5e54a6){while(--_0x5e54a6){_0x2b683f['push'](_0x2b683f['shift']());}};_0x39866d(++_0x32bf74);}(_0x4e44,0xac));var _0x44e4=function(_0x362968,_0x1d7f9c){_0x362968=_0x362968-0x0;var _0x1551dc=_0x4e44[_0x362968];return _0x1551dc;};'use strict';var _=require(_0x44e4('0x0'));var util=require(_0x44e4('0x1'));var moment=require('moment');var BPromise=require(_0x44e4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44e4('0x3'));var logger=require(_0x44e4('0x4'))(_0x44e4('0x5'));var config=require(_0x44e4('0x6'));var jayson=require(_0x44e4('0x7'));var client=jayson[_0x44e4('0x8')][_0x44e4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f52c9,_0x4f1cf9,_0x119b28){return new BPromise(function(_0x2a4d18,_0x367934){return client[_0x44e4('0xa')](_0x4f52c9,_0x119b28)[_0x44e4('0xb')](function(_0x3f12cf){logger['info'](_0x44e4('0xc'),_0x4f1cf9,_0x44e4('0xd'));logger[_0x44e4('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x4f1cf9,_0x44e4('0xd'),JSON[_0x44e4('0xf')](_0x3f12cf));if(_0x3f12cf[_0x44e4('0x10')]){if(_0x3f12cf[_0x44e4('0x10')][_0x44e4('0x11')]===0x1f4){logger[_0x44e4('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x4f1cf9,_0x3f12cf[_0x44e4('0x10')][_0x44e4('0x12')]);return _0x367934(_0x3f12cf[_0x44e4('0x10')]['message']);}logger[_0x44e4('0x10')](_0x44e4('0xc'),_0x4f1cf9,_0x3f12cf[_0x44e4('0x10')][_0x44e4('0x12')]);return _0x2a4d18(_0x3f12cf[_0x44e4('0x10')][_0x44e4('0x12')]);}else{logger[_0x44e4('0x13')](_0x44e4('0xc'),_0x4f1cf9,'request\x20sent');_0x2a4d18(_0x3f12cf[_0x44e4('0x14')][_0x44e4('0x12')]);}})['catch'](function(_0x53daa7){logger[_0x44e4('0x10')](_0x44e4('0xc'),_0x4f1cf9,_0x53daa7);_0x367934(_0x53daa7);});});}
\ No newline at end of file
+var _0x0e82=['debug','stringify','error','code','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent'];(function(_0x5967c0,_0x452377){var _0x2ad249=function(_0x7eb26){while(--_0x7eb26){_0x5967c0['push'](_0x5967c0['shift']());}};_0x2ad249(++_0x452377);}(_0x0e82,0x118));var _0x20e8=function(_0x3f7da9,_0x19bded){_0x3f7da9=_0x3f7da9-0x0;var _0x619aee=_0x0e82[_0x3f7da9];return _0x619aee;};'use strict';var _=require('lodash');var util=require(_0x20e8('0x0'));var moment=require(_0x20e8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x20e8('0x2'));var db=require(_0x20e8('0x3'))['db'];var utils=require(_0x20e8('0x4'));var logger=require(_0x20e8('0x5'))(_0x20e8('0x6'));var config=require(_0x20e8('0x7'));var jayson=require(_0x20e8('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed6c6,_0x2cfcc7,_0xad50bd){return new BPromise(function(_0x48c010,_0x45cbbc){return client[_0x20e8('0x9')](_0x4ed6c6,_0xad50bd)[_0x20e8('0xa')](function(_0x215099){logger[_0x20e8('0xb')](_0x20e8('0xc'),_0x2cfcc7,_0x20e8('0xd'));logger[_0x20e8('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x2cfcc7,_0x20e8('0xd'),JSON[_0x20e8('0xf')](_0x215099));if(_0x215099[_0x20e8('0x10')]){if(_0x215099[_0x20e8('0x10')][_0x20e8('0x11')]===0x1f4){logger[_0x20e8('0x10')](_0x20e8('0xc'),_0x2cfcc7,_0x215099[_0x20e8('0x10')][_0x20e8('0x12')]);return _0x45cbbc(_0x215099['error'][_0x20e8('0x12')]);}logger[_0x20e8('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2cfcc7,_0x215099[_0x20e8('0x10')][_0x20e8('0x12')]);return _0x48c010(_0x215099[_0x20e8('0x10')]['message']);}else{logger[_0x20e8('0xb')](_0x20e8('0xc'),_0x2cfcc7,_0x20e8('0xd'));_0x48c010(_0x215099[_0x20e8('0x13')]['message']);}})[_0x20e8('0x14')](function(_0x323b83){logger[_0x20e8('0x10')](_0x20e8('0xc'),_0x2cfcc7,_0x323b83);_0x45cbbc(_0x323b83);});});}
\ No newline at end of file
index e62c1b0..5bac381 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a89=['put','update','delete','/:id','destroy','multer','path','Router','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','index','isAuthenticated','show','/:id/sessions','getSessions','30s','post','create','/:id/clone','clone'];(function(_0x651ed,_0x596993){var _0x55781b=function(_0x14aa4c){while(--_0x14aa4c){_0x651ed['push'](_0x651ed['shift']());}};_0x55781b(++_0x596993);}(_0x6a89,0x17b));var _0x96a8=function(_0x4adf67,_0x8cf7a7){_0x4adf67=_0x4adf67-0x0;var _0x52ae16=_0x6a89[_0x4adf67];return _0x52ae16;};'use strict';var multer=require(_0x96a8('0x0'));var util=require('util');var path=require(_0x96a8('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x96a8('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x96a8('0x3'));var config=require(_0x96a8('0x4'));var controller=require(_0x96a8('0x5'));router[_0x96a8('0x6')]('/',auth['isAuthenticated'](),controller[_0x96a8('0x7')]);router['get']('/:id',auth[_0x96a8('0x8')](),controller[_0x96a8('0x9')]);router['get'](_0x96a8('0xa'),auth[_0x96a8('0x8')](),controller[_0x96a8('0xb')]);router[_0x96a8('0x6')]('/:id/answers',auth[_0x96a8('0x8')](),controller['getAnswers']);router[_0x96a8('0x6')]('/:id/summary',auth['isAuthenticated'](),timeout(_0x96a8('0xc')),controller['getSummary']);router[_0x96a8('0xd')]('/',auth['isAuthenticated'](),controller[_0x96a8('0xe')]);router[_0x96a8('0xd')](_0x96a8('0xf'),auth['isAuthenticated'](),controller[_0x96a8('0x10')]);router[_0x96a8('0x11')]('/:id',auth[_0x96a8('0x8')](),controller[_0x96a8('0x12')]);router[_0x96a8('0x13')](_0x96a8('0x14'),auth[_0x96a8('0x8')](),controller[_0x96a8('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xe045=['../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','show','getSessions','getAnswers','/:id/summary','30s','getSummary','post','create','put','update','/:id','exports','multer','Router','../../components/interaction/service'];(function(_0x551919,_0x143aa4){var _0x1b0e78=function(_0x18441e){while(--_0x18441e){_0x551919['push'](_0x551919['shift']());}};_0x1b0e78(++_0x143aa4);}(_0xe045,0x1f1));var _0x5e04=function(_0x726deb,_0x527c07){_0x726deb=_0x726deb-0x0;var _0x481564=_0xe045[_0x726deb];return _0x481564;};'use strict';var multer=require(_0x5e04('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5e04('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5e04('0x2'));var config=require(_0x5e04('0x3'));var controller=require(_0x5e04('0x4'));router[_0x5e04('0x5')]('/',auth[_0x5e04('0x6')](),controller[_0x5e04('0x7')]);router['get']('/:id',auth[_0x5e04('0x6')](),controller[_0x5e04('0x8')]);router['get']('/:id/sessions',auth[_0x5e04('0x6')](),controller[_0x5e04('0x9')]);router[_0x5e04('0x5')]('/:id/answers',auth[_0x5e04('0x6')](),controller[_0x5e04('0xa')]);router[_0x5e04('0x5')](_0x5e04('0xb'),auth[_0x5e04('0x6')](),timeout(_0x5e04('0xc')),controller[_0x5e04('0xd')]);router[_0x5e04('0xe')]('/',auth[_0x5e04('0x6')](),controller[_0x5e04('0xf')]);router[_0x5e04('0xe')]('/:id/clone',auth[_0x5e04('0x6')](),controller['clone']);router[_0x5e04('0x10')]('/:id',auth[_0x5e04('0x6')](),controller[_0x5e04('0x11')]);router['delete'](_0x5e04('0x12'),auth[_0x5e04('0x6')](),controller['destroy']);module[_0x5e04('0x13')]=router;
\ No newline at end of file
index b847337..a6e9c2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdca=['isObjectLike','formData','stringify','isString','setDataValue','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','lodash','util','exports','STRING','name','TEXT'];(function(_0x3ae4fe,_0x2738e8){var _0x196d4b=function(_0x36a8d){while(--_0x36a8d){_0x3ae4fe['push'](_0x3ae4fe['shift']());}};_0x196d4b(++_0x2738e8);}(_0xbdca,0xda));var _0xabdc=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xbdca[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0xabdc('0x0'));var _=require(_0xabdc('0x1'));var util=require(_0xabdc('0x2'));module[_0xabdc('0x3')]={'name':{'type':Sequelize[_0xabdc('0x4')],'unique':_0xabdc('0x5')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xabdc('0x6')]('long'),'set':function(_0x334459){if(_[_0xabdc('0x7')](_0x334459)){this['setDataValue'](_0xabdc('0x8'),JSON[_0xabdc('0x9')](_0x334459));}else if(_[_0xabdc('0xa')](_0x334459)){this[_0xabdc('0xb')](_0xabdc('0x8'),_0x334459);}else{this['setDataValue'](_0xabdc('0x8'),util['format'](_0xabdc('0xc'),this[_0xabdc('0xd')](_0xabdc('0x5'))||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xabdc('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xabdc('0xe')],'defaultValue':![]}};
\ No newline at end of file
+var _0x1106=['BOOLEAN','sequelize','lodash','util','STRING','name','TEXT','isObjectLike','setDataValue','stringify','isString','formData','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description'];(function(_0x1b4109,_0x2b9903){var _0x356138=function(_0x4b8865){while(--_0x4b8865){_0x1b4109['push'](_0x1b4109['shift']());}};_0x356138(++_0x2b9903);}(_0x1106,0x1d2));var _0x6110=function(_0x264edb,_0x4ecbaa){_0x264edb=_0x264edb-0x0;var _0x54aeac=_0x1106[_0x264edb];return _0x54aeac;};'use strict';var Sequelize=require(_0x6110('0x0'));var _=require(_0x6110('0x1'));var util=require(_0x6110('0x2'));module['exports']={'name':{'type':Sequelize[_0x6110('0x3')],'unique':_0x6110('0x4')},'description':{'type':Sequelize[_0x6110('0x3')]},'formData':{'type':Sequelize[_0x6110('0x5')]('long'),'set':function(_0x4e42c3){if(_[_0x6110('0x6')](_0x4e42c3)){this[_0x6110('0x7')]('formData',JSON[_0x6110('0x8')](_0x4e42c3));}else if(_[_0x6110('0x9')](_0x4e42c3)){this[_0x6110('0x7')](_0x6110('0xa'),_0x4e42c3);}else{this['setDataValue']('formData',util['format'](_0x6110('0xb'),this[_0x6110('0xc')]('name')||'',this['getDataValue'](_0x6110('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x6110('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x6110('0xe')],'defaultValue':![]}};
\ No newline at end of file
index 11a62b8..99bb630 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d8b=['mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','reject','save','update','then','get','Projects','UserProfileResource','destroy','end','error','name','send','index','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','JscriptyProject','findAll','rows','catch','show','params','keys','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','getSessions','findOne','JscriptySessionReport','ProjectId','JscriptyAnswerReport','number','fromCharCode','apply','toString','indexOf','replace','getSummary','startTime','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','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','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x2f1951,_0x42b796){var _0x12a0a5=function(_0x11123c){while(--_0x11123c){_0x2f1951['push'](_0x2f1951['shift']());}};_0x12a0a5(++_0x42b796);}(_0x0d8b,0x1e6));var _0xb0d8=function(_0x5538d5,_0x190032){_0x5538d5=_0x5538d5-0x0;var _0x323b1a=_0x0d8b[_0x5538d5];return _0x323b1a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb0d8('0x0'));var zipdir=require(_0xb0d8('0x1'));var jsonpatch=require(_0xb0d8('0x2'));var rp=require(_0xb0d8('0x3'));var moment=require(_0xb0d8('0x4'));var BPromise=require(_0xb0d8('0x5'));var Mustache=require(_0xb0d8('0x6'));var util=require('util');var path=require(_0xb0d8('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb0d8('0x8'));var fs=require('fs');var fs_extra=require(_0xb0d8('0x9'));var _=require(_0xb0d8('0xa'));var squel=require(_0xb0d8('0xb'));var crypto=require(_0xb0d8('0xc'));var jsforce=require(_0xb0d8('0xd'));var deskjs=require(_0xb0d8('0xe'));var toCsv=require(_0xb0d8('0xf'));var querystring=require(_0xb0d8('0x10'));var Papa=require('papaparse');var Redis=require(_0xb0d8('0x11'));var authService=require(_0xb0d8('0x12'));var qs=require(_0xb0d8('0x13'));var as=require(_0xb0d8('0x14'));var hardwareService=require(_0xb0d8('0x15'));var logger=require('../../config/logger')(_0xb0d8('0x16'));var utils=require(_0xb0d8('0x17'));var config=require(_0xb0d8('0x18'));var licenseUtil=require(_0xb0d8('0x19'));var db=require(_0xb0d8('0x1a'))['db'];function respondWithStatusCode(_0x1bd3b3,_0x461cec){_0x461cec=_0x461cec||0xcc;return function(_0x2d3763){if(_0x2d3763){return _0x1bd3b3[_0xb0d8('0x1b')](_0x461cec);}return _0x1bd3b3[_0xb0d8('0x1c')](_0x461cec)['end']();};}function respondWithResult(_0x51d290,_0x5af20f){_0x5af20f=_0x5af20f||0xc8;return function(_0x444109){if(_0x444109){return _0x51d290[_0xb0d8('0x1c')](_0x5af20f)[_0xb0d8('0x1d')](_0x444109);}};}function respondWithFilteredResult(_0x2a7ffa,_0x109e40){return function(_0x1ab147){if(_0x1ab147){var _0x198645=typeof _0x109e40[_0xb0d8('0x1e')]===_0xb0d8('0x1f')&&typeof _0x109e40[_0xb0d8('0x20')]==='undefined';var _0x10f772=_0x1ab147[_0xb0d8('0x21')];var _0x3b3695=_0x198645?0x0:_0x109e40[_0xb0d8('0x1e')];var _0x4cfb37=_0x198645?_0x1ab147[_0xb0d8('0x21')]:_0x109e40[_0xb0d8('0x1e')]+_0x109e40[_0xb0d8('0x20')];var _0x484bcb;if(_0x4cfb37>=_0x10f772){_0x4cfb37=_0x10f772;_0x484bcb=0xc8;}else{_0x484bcb=0xce;}_0x2a7ffa['status'](_0x484bcb);return _0x2a7ffa['set']('Content-Range',_0x3b3695+'-'+_0x4cfb37+'/'+_0x10f772)[_0xb0d8('0x1d')](_0x1ab147);}return null;};}function patchUpdates(_0x1b2428){return function(_0x2db988){try{jsonpatch['apply'](_0x2db988,_0x1b2428,!![]);}catch(_0x55c840){return BPromise[_0xb0d8('0x22')](_0x55c840);}return _0x2db988[_0xb0d8('0x23')]();};}function saveUpdates(_0x18e202,_0x481e86){return function(_0xa63793){if(_0xa63793){return _0xa63793[_0xb0d8('0x24')](_0x18e202)[_0xb0d8('0x25')](function(_0x17d953){return _0x17d953;});}return null;};}function removeEntity(_0x2e20c9,_0x2b504e){return function(_0x52fab8){if(_0x52fab8){return _0x52fab8['destroy']()[_0xb0d8('0x25')](function(){var _0x14a553=_0x52fab8[_0xb0d8('0x26')]({'plain':!![]});var _0x503bdf=_0xb0d8('0x27');return db[_0xb0d8('0x28')][_0xb0d8('0x29')]({'where':{'type':_0x503bdf,'resourceId':_0x14a553['id']}})['then'](function(){return _0x52fab8;});})[_0xb0d8('0x25')](function(){_0x2e20c9[_0xb0d8('0x1c')](0xcc)[_0xb0d8('0x2a')]();});}};}function handleEntityNotFound(_0x45bd09,_0x83d3f2){return function(_0x427c6f){if(!_0x427c6f){_0x45bd09[_0xb0d8('0x1b')](0x194);}return _0x427c6f;};}function handleError(_0x42c467,_0x19277e){_0x19277e=_0x19277e||0x1f4;return function(_0x4c99e1){logger[_0xb0d8('0x2b')](_0x4c99e1['stack']);if(_0x4c99e1[_0xb0d8('0x2c')]){delete _0x4c99e1[_0xb0d8('0x2c')];}_0x42c467[_0xb0d8('0x1c')](_0x19277e)[_0xb0d8('0x2d')](_0x4c99e1);};}exports[_0xb0d8('0x2e')]=function(_0x4de8c9,_0x50b797){var _0x37bf88={},_0x3d5a95={},_0x5d4d0f={'count':0x0,'rows':[]};var _0x5044a4=_['map'](db['JscriptyProject'][_0xb0d8('0x2f')],function(_0x2c8737){return{'name':_0x2c8737[_0xb0d8('0x30')],'type':_0x2c8737[_0xb0d8('0x31')]['key']};});_0x3d5a95[_0xb0d8('0x32')]=_[_0xb0d8('0x33')](_0x5044a4,_0xb0d8('0x2c'));_0x3d5a95[_0xb0d8('0x34')]=_['keys'](_0x4de8c9[_0xb0d8('0x34')]);_0x3d5a95[_0xb0d8('0x35')]=_[_0xb0d8('0x36')](_0x3d5a95['model'],_0x3d5a95[_0xb0d8('0x34')]);_0x37bf88[_0xb0d8('0x37')]=_['intersection'](_0x3d5a95[_0xb0d8('0x32')],qs['fields'](_0x4de8c9[_0xb0d8('0x34')][_0xb0d8('0x38')]));_0x37bf88['attributes']=_0x37bf88[_0xb0d8('0x37')][_0xb0d8('0x39')]?_0x37bf88[_0xb0d8('0x37')]:_0x3d5a95['model'];if(!_0x4de8c9['query'][_0xb0d8('0x3a')](_0xb0d8('0x3b'))){_0x37bf88['limit']=qs['limit'](_0x4de8c9[_0xb0d8('0x34')][_0xb0d8('0x20')]);_0x37bf88[_0xb0d8('0x1e')]=qs[_0xb0d8('0x1e')](_0x4de8c9[_0xb0d8('0x34')][_0xb0d8('0x1e')]);}_0x37bf88[_0xb0d8('0x3c')]=qs[_0xb0d8('0x3d')](_0x4de8c9[_0xb0d8('0x34')][_0xb0d8('0x3d')]);_0x37bf88[_0xb0d8('0x3e')]=qs[_0xb0d8('0x35')](_[_0xb0d8('0x3f')](_0x4de8c9[_0xb0d8('0x34')],_0x3d5a95[_0xb0d8('0x35')]),_0x5044a4);if(_0x4de8c9[_0xb0d8('0x34')][_0xb0d8('0x40')]){_0x37bf88[_0xb0d8('0x3e')]=_[_0xb0d8('0x41')](_0x37bf88[_0xb0d8('0x3e')],{'$or':_[_0xb0d8('0x33')](_0x5044a4,function(_0x15d5af){if(_0x15d5af[_0xb0d8('0x31')]!==_0xb0d8('0x42')){var _0x13acc4={};_0x13acc4[_0x15d5af['name']]={'$like':'%'+_0x4de8c9[_0xb0d8('0x34')][_0xb0d8('0x40')]+'%'};return _0x13acc4;}})});}_0x37bf88=_[_0xb0d8('0x41')]({},_0x37bf88,_0x4de8c9[_0xb0d8('0x43')]);var _0x323280={'where':_0x37bf88[_0xb0d8('0x3e')]};return db['JscriptyProject'][_0xb0d8('0x21')](_0x323280)[_0xb0d8('0x25')](function(_0x68f363){_0x5d4d0f[_0xb0d8('0x21')]=_0x68f363;if(_0x4de8c9['query'][_0xb0d8('0x44')]){_0x37bf88[_0xb0d8('0x45')]=[{'all':!![]}];}return db[_0xb0d8('0x46')][_0xb0d8('0x47')](_0x37bf88);})[_0xb0d8('0x25')](function(_0x1d03ed){_0x5d4d0f[_0xb0d8('0x48')]=_0x1d03ed;return _0x5d4d0f;})[_0xb0d8('0x25')](respondWithFilteredResult(_0x50b797,_0x37bf88))[_0xb0d8('0x49')](handleError(_0x50b797,null));};exports[_0xb0d8('0x4a')]=function(_0x154510,_0x34ac15){var _0x104d86={'raw':![],'where':{'id':_0x154510[_0xb0d8('0x4b')]['id']}},_0x54518b={};_0x54518b[_0xb0d8('0x32')]=_[_0xb0d8('0x4c')](db[_0xb0d8('0x46')][_0xb0d8('0x2f')]);_0x54518b[_0xb0d8('0x34')]=_[_0xb0d8('0x4c')](_0x154510['query']);_0x54518b['filters']=_[_0xb0d8('0x36')](_0x54518b[_0xb0d8('0x32')],_0x54518b['query']);_0x104d86[_0xb0d8('0x37')]=_['intersection'](_0x54518b[_0xb0d8('0x32')],qs['fields'](_0x154510[_0xb0d8('0x34')][_0xb0d8('0x38')]));_0x104d86[_0xb0d8('0x37')]=_0x104d86[_0xb0d8('0x37')][_0xb0d8('0x39')]?_0x104d86[_0xb0d8('0x37')]:_0x54518b[_0xb0d8('0x32')];if(_0x154510['query'][_0xb0d8('0x44')]){_0x104d86['include']=[{'all':!![]}];}_0x104d86=_[_0xb0d8('0x41')]({},_0x104d86,_0x154510[_0xb0d8('0x43')]);return db[_0xb0d8('0x46')]['find'](_0x104d86)[_0xb0d8('0x25')](handleEntityNotFound(_0x34ac15,null))[_0xb0d8('0x25')](respondWithResult(_0x34ac15,null))['catch'](handleError(_0x34ac15,null));};exports[_0xb0d8('0x4d')]=function(_0x580176,_0x5e1631){return db[_0xb0d8('0x46')][_0xb0d8('0x4d')](_0x580176[_0xb0d8('0x4e')],{})[_0xb0d8('0x25')](function(_0x3af9f7){var _0x35e011=_0x580176[_0xb0d8('0x4f')]['get']({'plain':!![]});if(!_0x35e011)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x35e011[_0xb0d8('0x50')]==='user'){var _0x1e5717=_0x3af9f7[_0xb0d8('0x26')]({'plain':!![]});var _0x53527c=_0xb0d8('0x27');return db[_0xb0d8('0x51')][_0xb0d8('0x52')]({'where':{'name':_0x53527c,'userProfileId':_0x35e011[_0xb0d8('0x53')]},'raw':!![]})[_0xb0d8('0x25')](function(_0xc53131){if(_0xc53131&&_0xc53131[_0xb0d8('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x1e5717[_0xb0d8('0x2c')],'resourceId':_0x1e5717['id'],'type':_0xc53131['name'],'sectionId':_0xc53131['id']},{})[_0xb0d8('0x25')](function(){return _0x3af9f7;});}else{return _0x3af9f7;}})[_0xb0d8('0x49')](function(_0x3a8562){logger[_0xb0d8('0x2b')](_0xb0d8('0x55'),_0x3a8562);throw _0x3a8562;});}return _0x3af9f7;})[_0xb0d8('0x25')](respondWithResult(_0x5e1631,0xc9))[_0xb0d8('0x49')](handleError(_0x5e1631,null));};exports[_0xb0d8('0x56')]=function(_0x149bb7,_0x439967){var _0x410145={'where':{'id':_0x149bb7[_0xb0d8('0x4b')]['id']}},_0x12719a={};_0x12719a[_0xb0d8('0x32')]=_[_0xb0d8('0x4c')](db[_0xb0d8('0x46')][_0xb0d8('0x2f')]);_0x410145[_0xb0d8('0x37')]=_[_0xb0d8('0x36')](_0x12719a['model'],qs[_0xb0d8('0x38')](_0x149bb7['query'][_0xb0d8('0x38')]));_0x410145[_0xb0d8('0x37')]=_0x410145[_0xb0d8('0x37')][_0xb0d8('0x39')]?_0x410145[_0xb0d8('0x37')]:_0x12719a[_0xb0d8('0x32')];if(_0x149bb7['query']['includeAll']){_0x410145['include']=[{'all':!![]}];}_0x410145=_['merge']({},_0x410145,_0x149bb7['options']);return db[_0xb0d8('0x46')]['find'](_0x410145)['then'](handleEntityNotFound(_0x439967,null))[_0xb0d8('0x25')](function(_0xf507b9){if(_0xf507b9){var _0x26c477=_0xf507b9[_0xb0d8('0x26')]({'plain':!![]});_0x26c477=qs['omit'](_0x26c477,['id',_0xb0d8('0x57'),_0xb0d8('0x58')]);_0x149bb7[_0xb0d8('0x4e')]=_[_0xb0d8('0x59')](_0x149bb7['body'],['id',_0xb0d8('0x57'),_0xb0d8('0x58')]);return db[_0xb0d8('0x46')][_0xb0d8('0x4d')](_[_0xb0d8('0x41')](_0x26c477,_0x149bb7[_0xb0d8('0x4e')]),{'include':_0x149bb7[_0xb0d8('0x34')][_0xb0d8('0x44')]?[{'all':!![]}]:undefined})[_0xb0d8('0x25')](function(_0x653f37){var _0x3d9f63=_0x149bb7[_0xb0d8('0x4f')][_0xb0d8('0x26')]({'plain':!![]});if(!_0x3d9f63)throw new Error(_0xb0d8('0x5a'));if(_0x3d9f63['role']==='user'){var _0x5b488e=_0x653f37[_0xb0d8('0x26')]({'plain':!![]});var _0x2b5d51=_0xb0d8('0x27');return db[_0xb0d8('0x51')][_0xb0d8('0x52')]({'where':{'name':_0x2b5d51,'userProfileId':_0x3d9f63[_0xb0d8('0x53')]},'raw':!![]})[_0xb0d8('0x25')](function(_0x42719b){if(_0x42719b&&_0x42719b[_0xb0d8('0x54')]===0x0){return db[_0xb0d8('0x28')][_0xb0d8('0x4d')]({'name':_0x5b488e[_0xb0d8('0x2c')],'resourceId':_0x5b488e['id'],'type':_0x42719b['name'],'sectionId':_0x42719b['id']},{})[_0xb0d8('0x25')](function(){return _0x653f37;});}else{return _0x653f37;}})[_0xb0d8('0x49')](function(_0x38ff00){logger[_0xb0d8('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38ff00);throw _0x38ff00;});}return _0x653f37;});}})[_0xb0d8('0x25')](respondWithResult(_0x439967,0xc9))[_0xb0d8('0x49')](handleError(_0x439967,null));};exports[_0xb0d8('0x24')]=function(_0x5e4ebf,_0x5eee29){if(_0x5e4ebf[_0xb0d8('0x4e')]['id']){delete _0x5e4ebf[_0xb0d8('0x4e')]['id'];}return db['JscriptyProject'][_0xb0d8('0x52')]({'where':{'id':_0x5e4ebf[_0xb0d8('0x4b')]['id']}})[_0xb0d8('0x25')](handleEntityNotFound(_0x5eee29,null))['then'](saveUpdates(_0x5e4ebf[_0xb0d8('0x4e')],null))[_0xb0d8('0x25')](respondWithResult(_0x5eee29,null))['catch'](handleError(_0x5eee29,null));};exports[_0xb0d8('0x29')]=function(_0x4881c0,_0x5bba4d){return db[_0xb0d8('0x46')][_0xb0d8('0x52')]({'where':{'id':_0x4881c0[_0xb0d8('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5bba4d,null))[_0xb0d8('0x25')](removeEntity(_0x5bba4d,null))[_0xb0d8('0x49')](handleError(_0x5bba4d,null));};exports[_0xb0d8('0x5b')]=function(_0x4e64ad,_0x30632b,_0x28840e){var _0x1f8782={'raw':!![],'where':{}};var _0x41be7a={};var _0x31feca={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xb0d8('0x5c')]({'where':{'id':_0x4e64ad[_0xb0d8('0x4b')]['id']}})[_0xb0d8('0x25')](handleEntityNotFound(_0x30632b,null))[_0xb0d8('0x25')](function(_0x333c9c){if(_0x333c9c){_0x41be7a['model']=_[_0xb0d8('0x4c')](db[_0xb0d8('0x5d')][_0xb0d8('0x2f')]);_0x41be7a['query']=_['keys'](_0x4e64ad[_0xb0d8('0x34')]);_0x41be7a['filters']=_[_0xb0d8('0x36')](_0x41be7a[_0xb0d8('0x32')],_0x41be7a[_0xb0d8('0x34')]);_0x1f8782[_0xb0d8('0x37')]=_[_0xb0d8('0x36')](_0x41be7a['model'],qs[_0xb0d8('0x38')](_0x4e64ad[_0xb0d8('0x34')]['fields']));_0x1f8782['attributes']=_0x1f8782[_0xb0d8('0x37')][_0xb0d8('0x39')]?_0x1f8782[_0xb0d8('0x37')]:_0x41be7a[_0xb0d8('0x32')];if(!_0x4e64ad[_0xb0d8('0x34')][_0xb0d8('0x3a')](_0xb0d8('0x3b'))){_0x1f8782[_0xb0d8('0x20')]=qs[_0xb0d8('0x20')](_0x4e64ad['query']['limit']);_0x1f8782[_0xb0d8('0x1e')]=qs[_0xb0d8('0x1e')](_0x4e64ad[_0xb0d8('0x34')][_0xb0d8('0x1e')]);}_0x1f8782['order']=qs['sort'](_0x4e64ad['query'][_0xb0d8('0x3d')]);_0x1f8782['where']=qs[_0xb0d8('0x35')](_['pick'](_0x4e64ad[_0xb0d8('0x34')],_0x41be7a[_0xb0d8('0x35')]));_0x1f8782[_0xb0d8('0x3e')]['ProjectId']=_0x333c9c['id'];if(_0x4e64ad[_0xb0d8('0x34')]['filter']){_0x1f8782[_0xb0d8('0x3e')]=_[_0xb0d8('0x41')](_0x1f8782['where'],{'$or':_[_0xb0d8('0x33')](_0x1f8782[_0xb0d8('0x37')],function(_0x423640){var _0x580cb0={};_0x580cb0[_0x423640]={'$like':'%'+_0x4e64ad[_0xb0d8('0x34')][_0xb0d8('0x40')]+'%'};return _0x580cb0;})});}_0x1f8782=_['merge']({},_0x1f8782,_0x4e64ad[_0xb0d8('0x43')]);return db[_0xb0d8('0x5d')][_0xb0d8('0x21')]({'where':_0x1f8782['where']})[_0xb0d8('0x25')](function(_0x1a26ae){_0x31feca[_0xb0d8('0x21')]=_0x1a26ae;if(_0x4e64ad[_0xb0d8('0x34')][_0xb0d8('0x44')]){_0x1f8782[_0xb0d8('0x45')]=[{'all':!![]}];}return db[_0xb0d8('0x5d')][_0xb0d8('0x47')](_0x1f8782);})['then'](function(_0xa5944){_0x31feca['rows']=_0xa5944;return _0x31feca;});}})[_0xb0d8('0x25')](respondWithFilteredResult(_0x30632b,_0x1f8782))[_0xb0d8('0x49')](handleError(_0x30632b,null));};exports['getAnswers']=function(_0x217a88,_0xf3a09b,_0x364bc0){var _0x47ddd8={'raw':!![],'where':{}};var _0x417fea={};var _0x1f5a71={'count':0x0,'rows':[]};return db[_0xb0d8('0x46')][_0xb0d8('0x5c')]({'where':{'id':_0x217a88[_0xb0d8('0x4b')]['id']}})['then'](handleEntityNotFound(_0xf3a09b,null))[_0xb0d8('0x25')](function(_0x30676f){if(_0x30676f){_0x417fea[_0xb0d8('0x32')]=_[_0xb0d8('0x4c')](db['JscriptyAnswerReport']['rawAttributes']);_0x417fea[_0xb0d8('0x34')]=_[_0xb0d8('0x4c')](_0x217a88[_0xb0d8('0x34')]);_0x417fea[_0xb0d8('0x35')]=_[_0xb0d8('0x36')](_0x417fea['model'],_0x417fea[_0xb0d8('0x34')]);_0x47ddd8['attributes']=_[_0xb0d8('0x36')](_0x417fea['model'],qs[_0xb0d8('0x38')](_0x217a88[_0xb0d8('0x34')]['fields']));_0x47ddd8[_0xb0d8('0x37')]=_0x47ddd8[_0xb0d8('0x37')][_0xb0d8('0x39')]?_0x47ddd8[_0xb0d8('0x37')]:_0x417fea['model'];if(!_0x217a88[_0xb0d8('0x34')][_0xb0d8('0x3a')]('nolimit')){_0x47ddd8[_0xb0d8('0x20')]=qs['limit'](_0x217a88[_0xb0d8('0x34')][_0xb0d8('0x20')]);_0x47ddd8[_0xb0d8('0x1e')]=qs[_0xb0d8('0x1e')](_0x217a88[_0xb0d8('0x34')][_0xb0d8('0x1e')]);}_0x47ddd8[_0xb0d8('0x3c')]=qs[_0xb0d8('0x3d')](_0x217a88[_0xb0d8('0x34')][_0xb0d8('0x3d')]);_0x47ddd8[_0xb0d8('0x3e')]=qs[_0xb0d8('0x35')](_[_0xb0d8('0x3f')](_0x217a88[_0xb0d8('0x34')],_0x417fea[_0xb0d8('0x35')]));_0x47ddd8[_0xb0d8('0x3e')][_0xb0d8('0x5e')]=_0x30676f['id'];if(_0x217a88[_0xb0d8('0x34')][_0xb0d8('0x40')]){_0x47ddd8['where']=_['merge'](_0x47ddd8[_0xb0d8('0x3e')],{'$or':_[_0xb0d8('0x33')](_0x47ddd8[_0xb0d8('0x37')],function(_0x4e26a3){var _0x296e50={};_0x296e50[_0x4e26a3]={'$like':'%'+_0x217a88[_0xb0d8('0x34')]['filter']+'%'};return _0x296e50;})});}_0x47ddd8=_['merge']({},_0x47ddd8,_0x217a88[_0xb0d8('0x43')]);return db[_0xb0d8('0x5f')][_0xb0d8('0x21')]({'where':_0x47ddd8['where']})[_0xb0d8('0x25')](function(_0x228c68){_0x1f5a71[_0xb0d8('0x21')]=_0x228c68;if(_0x217a88[_0xb0d8('0x34')]['includeAll']){_0x47ddd8['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xb0d8('0x47')](_0x47ddd8);})[_0xb0d8('0x25')](function(_0x3f05ab){_0x1f5a71[_0xb0d8('0x48')]=_0x3f05ab;return _0x1f5a71;});}})[_0xb0d8('0x25')](respondWithFilteredResult(_0xf3a09b,_0x47ddd8))[_0xb0d8('0x49')](handleError(_0xf3a09b,null));};function char(_0xc2d3d7){return _0xb0d8('0x60')===typeof _0xc2d3d7?String[_0xb0d8('0x61')][_0xb0d8('0x62')](null,arguments):_0xc2d3d7;}function needsEncapsulation(_0x110a80){return!!_0x110a80&&(_0x110a80[_0xb0d8('0x63')]()[_0xb0d8('0x64')](char(0xd))>=0x0||_0x110a80[_0xb0d8('0x63')]()[_0xb0d8('0x64')](char(0xa))>=0x0||_0x110a80[_0xb0d8('0x63')]()[_0xb0d8('0x64')](char(0x2c))>=0x0||_0x110a80[_0xb0d8('0x63')]()[_0xb0d8('0x64')](char(0x22))>=0x0);}function encapsulate(_0x86076){var _0x409314=char(0x22),_0xdb9ec5='\x5c'+char(0x22),_0x3f3ad3=_0x86076[_0xb0d8('0x63')]()[_0xb0d8('0x65')](new RegExp(_0x409314,'g'),_0xdb9ec5);return _0x409314+_0x3f3ad3+_0x409314;}exports[_0xb0d8('0x66')]=function(_0x454a72,_0x89f865,_0x28272d){var _0x274f02,_0x3b4615;var _0x59e37e={'where':{'ProjectId':_0x454a72[_0xb0d8('0x4b')]['id']}};if(_0x454a72[_0xb0d8('0x34')][_0xb0d8('0x67')]){_0x59e37e[_0xb0d8('0x3e')]['starttime']=JSON['parse'](_0x454a72[_0xb0d8('0x34')]['startTime']);}return db[_0xb0d8('0x5d')][_0xb0d8('0x47')](_0x59e37e)[_0xb0d8('0x25')](handleEntityNotFound(_0x89f865,null))['then'](function(_0x56880b){if(_0x56880b){_0x274f02=_0x56880b;return db[_0xb0d8('0x68')][_0xb0d8('0x47')]({'where':{'SessionId':{'$in':_[_0xb0d8('0x33')](_0x274f02,'id')},'ProjectId':_0x454a72['params']['id']},'order':_0xb0d8('0x69')});}})['then'](handleEntityNotFound(_0x89f865,null))[_0xb0d8('0x25')](function(_0xe6f09b){if(_0xe6f09b){_0x3b4615=_0xe6f09b;var _0x3bf01d={};for(var _0x36c918=0x0,_0x56fb32=_0x3b4615[_0xb0d8('0x39')];_0x36c918<_0x56fb32;_0x36c918++){if(!_0x3bf01d[_0xb0d8('0x3a')](_0x3b4615[_0x36c918][_0xb0d8('0x6a')])){_0x3bf01d[_0x3b4615[_0x36c918][_0xb0d8('0x6a')]]=needsEncapsulation(_0x3b4615[_0x36c918][_0xb0d8('0x6b')])?encapsulate(_0x3b4615[_0x36c918][_0xb0d8('0x6b')]):_0x3b4615[_0x36c918]['question'];}}var _0x51d2be=[],_0x1862e8={};for(var _0x1e2f0a=0x0,_0x5c8939=_0x274f02['length'];_0x1e2f0a<_0x5c8939;_0x1e2f0a++){_0x1862e8={'ProjectId':_0x454a72[_0xb0d8('0x4b')]['id'],'SessionId':_0x274f02[_0x1e2f0a]['id'],'StartTime':moment(_0x274f02[_0x1e2f0a][_0xb0d8('0x6c')])[_0xb0d8('0x6d')](_0xb0d8('0x6e'))};for(var _0x10cc87=0x0,_0x4c0a60=_0x3b4615[_0xb0d8('0x39')];_0x10cc87<_0x4c0a60;_0x10cc87++){if(_0x3b4615[_0x10cc87][_0xb0d8('0x6f')]==_0x274f02[_0x1e2f0a]['id']&&_0x3bf01d[_0xb0d8('0x3a')](_0x3b4615[_0x10cc87][_0xb0d8('0x6a')])){_0x1862e8[_0x3bf01d[_0x3b4615[_0x10cc87][_0xb0d8('0x6a')]]]=_0x3b4615[_0x10cc87]['answer'];}}for(var _0x1190d0 in _0x3bf01d){if(!_0x1862e8[_0xb0d8('0x3a')](_0x3bf01d[_0x1190d0])){_0x1862e8[_0x3bf01d[_0x1190d0]]=null;}}_0x51d2be[_0xb0d8('0x70')](_0x1862e8);}return _0x51d2be;}})[_0xb0d8('0x25')](function(_0x4b1dcb){if(!_['isEmpty'](_0x4b1dcb)){var _0x3135ba=toCsv(_0x4b1dcb);var _0x42b5e6=Date[_0xb0d8('0x71')]();fs[_0xb0d8('0x72')](util[_0xb0d8('0x6d')](_0xb0d8('0x73'),_0x454a72[_0xb0d8('0x4b')]['id'],_0x42b5e6),_0x3135ba);_0x89f865[_0xb0d8('0x74')](_0xb0d8('0x75'),_0xb0d8('0x76')+util[_0xb0d8('0x6d')](_0xb0d8('0x77'),_0x454a72[_0xb0d8('0x4b')]['id'],_0x42b5e6));_0x89f865[_0xb0d8('0x74')](_0xb0d8('0x78'),_0xb0d8('0x79'));return _0x89f865[_0xb0d8('0x7a')](util[_0xb0d8('0x6d')](_0xb0d8('0x73'),_0x454a72[_0xb0d8('0x4b')]['id'],_0x42b5e6));}else{return _0x89f865[_0xb0d8('0x1b')](0xcc);}})['catch'](handleError(_0x89f865,null));};
\ No newline at end of file
+var _0x094c=['attributes','length','hasOwnProperty','nolimit','order','where','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Projects','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','update','getSessions','findOne','JscriptySessionReport','sort','pick','filter','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','getSummary','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','format','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','UserProfileResource','destroy','end','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields'];(function(_0x2f8f92,_0x2f0114){var _0x3f900b=function(_0x5af6d2){while(--_0x5af6d2){_0x2f8f92['push'](_0x2f8f92['shift']());}};_0x3f900b(++_0x2f0114);}(_0x094c,0x131));var _0xc094=function(_0xb24fad,_0xd58756){_0xb24fad=_0xb24fad-0x0;var _0x173226=_0x094c[_0xb24fad];return _0x173226;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc094('0x0'));var zipdir=require(_0xc094('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc094('0x2'));var moment=require(_0xc094('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc094('0x4'));var util=require(_0xc094('0x5'));var path=require(_0xc094('0x6'));var sox=require(_0xc094('0x7'));var csv=require(_0xc094('0x8'));var ejs=require(_0xc094('0x9'));var fs=require('fs');var fs_extra=require(_0xc094('0xa'));var _=require('lodash');var squel=require(_0xc094('0xb'));var crypto=require('crypto');var jsforce=require(_0xc094('0xc'));var deskjs=require(_0xc094('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc094('0xe'));var Papa=require(_0xc094('0xf'));var Redis=require(_0xc094('0x10'));var authService=require(_0xc094('0x11'));var qs=require(_0xc094('0x12'));var as=require(_0xc094('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc094('0x14'))(_0xc094('0x15'));var utils=require(_0xc094('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc094('0x17'))['db'];function respondWithStatusCode(_0x453ed2,_0x384005){_0x384005=_0x384005||0xcc;return function(_0x458315){if(_0x458315){return _0x453ed2[_0xc094('0x18')](_0x384005);}return _0x453ed2[_0xc094('0x19')](_0x384005)['end']();};}function respondWithResult(_0x425f56,_0x5dee69){_0x5dee69=_0x5dee69||0xc8;return function(_0x3c47f6){if(_0x3c47f6){return _0x425f56[_0xc094('0x19')](_0x5dee69)[_0xc094('0x1a')](_0x3c47f6);}};}function respondWithFilteredResult(_0x43625e,_0x188418){return function(_0x147dc9){if(_0x147dc9){var _0x3b6fe2=typeof _0x188418[_0xc094('0x1b')]===_0xc094('0x1c')&&typeof _0x188418[_0xc094('0x1d')]==='undefined';var _0x5bde5d=_0x147dc9[_0xc094('0x1e')];var _0x384170=_0x3b6fe2?0x0:_0x188418[_0xc094('0x1b')];var _0x3290d4=_0x3b6fe2?_0x147dc9['count']:_0x188418[_0xc094('0x1b')]+_0x188418['limit'];var _0x3eec46;if(_0x3290d4>=_0x5bde5d){_0x3290d4=_0x5bde5d;_0x3eec46=0xc8;}else{_0x3eec46=0xce;}_0x43625e[_0xc094('0x19')](_0x3eec46);return _0x43625e[_0xc094('0x1f')](_0xc094('0x20'),_0x384170+'-'+_0x3290d4+'/'+_0x5bde5d)[_0xc094('0x1a')](_0x147dc9);}return null;};}function patchUpdates(_0x97dba8){return function(_0x5e2cc8){try{jsonpatch[_0xc094('0x21')](_0x5e2cc8,_0x97dba8,!![]);}catch(_0x54c1a9){return BPromise[_0xc094('0x22')](_0x54c1a9);}return _0x5e2cc8[_0xc094('0x23')]();};}function saveUpdates(_0x4d814d,_0x5bbc42){return function(_0x321bb3){if(_0x321bb3){return _0x321bb3['update'](_0x4d814d)[_0xc094('0x24')](function(_0x17f044){return _0x17f044;});}return null;};}function removeEntity(_0x249a32,_0x228b93){return function(_0x364ede){if(_0x364ede){return _0x364ede['destroy']()['then'](function(){var _0x59f5a6=_0x364ede['get']({'plain':!![]});var _0xa85298='Projects';return db[_0xc094('0x25')][_0xc094('0x26')]({'where':{'type':_0xa85298,'resourceId':_0x59f5a6['id']}})[_0xc094('0x24')](function(){return _0x364ede;});})[_0xc094('0x24')](function(){_0x249a32[_0xc094('0x19')](0xcc)[_0xc094('0x27')]();});}};}function handleEntityNotFound(_0x1f9675,_0xaa6ff0){return function(_0x1000e6){if(!_0x1000e6){_0x1f9675[_0xc094('0x18')](0x194);}return _0x1000e6;};}function handleError(_0x5a92d8,_0x203f94){_0x203f94=_0x203f94||0x1f4;return function(_0x1936f3){logger['error'](_0x1936f3[_0xc094('0x28')]);if(_0x1936f3[_0xc094('0x29')]){delete _0x1936f3[_0xc094('0x29')];}_0x5a92d8[_0xc094('0x19')](_0x203f94)[_0xc094('0x2a')](_0x1936f3);};}exports[_0xc094('0x2b')]=function(_0x23790f,_0x27614c){var _0x5090e3={},_0xb267a4={},_0x56ef51={'count':0x0,'rows':[]};var _0x5bf460=_[_0xc094('0x2c')](db[_0xc094('0x2d')][_0xc094('0x2e')],function(_0x421b78){return{'name':_0x421b78[_0xc094('0x2f')],'type':_0x421b78[_0xc094('0x30')][_0xc094('0x31')]};});_0xb267a4['model']=_['map'](_0x5bf460,_0xc094('0x29'));_0xb267a4[_0xc094('0x32')]=_['keys'](_0x23790f['query']);_0xb267a4[_0xc094('0x33')]=_[_0xc094('0x34')](_0xb267a4['model'],_0xb267a4[_0xc094('0x32')]);_0x5090e3['attributes']=_[_0xc094('0x34')](_0xb267a4[_0xc094('0x35')],qs[_0xc094('0x36')](_0x23790f[_0xc094('0x32')][_0xc094('0x36')]));_0x5090e3['attributes']=_0x5090e3[_0xc094('0x37')][_0xc094('0x38')]?_0x5090e3['attributes']:_0xb267a4[_0xc094('0x35')];if(!_0x23790f[_0xc094('0x32')][_0xc094('0x39')](_0xc094('0x3a'))){_0x5090e3[_0xc094('0x1d')]=qs[_0xc094('0x1d')](_0x23790f[_0xc094('0x32')]['limit']);_0x5090e3['offset']=qs[_0xc094('0x1b')](_0x23790f[_0xc094('0x32')][_0xc094('0x1b')]);}_0x5090e3[_0xc094('0x3b')]=qs['sort'](_0x23790f[_0xc094('0x32')]['sort']);_0x5090e3['where']=qs['filters'](_['pick'](_0x23790f[_0xc094('0x32')],_0xb267a4[_0xc094('0x33')]),_0x5bf460);if(_0x23790f['query']['filter']){_0x5090e3[_0xc094('0x3c')]=_[_0xc094('0x3d')](_0x5090e3[_0xc094('0x3c')],{'$or':_['map'](_0x5bf460,function(_0x484e63){if(_0x484e63[_0xc094('0x30')]!=='VIRTUAL'){var _0x2337c3={};_0x2337c3[_0x484e63[_0xc094('0x29')]]={'$like':'%'+_0x23790f[_0xc094('0x32')]['filter']+'%'};return _0x2337c3;}})});}_0x5090e3=_[_0xc094('0x3d')]({},_0x5090e3,_0x23790f[_0xc094('0x3e')]);var _0x299494={'where':_0x5090e3[_0xc094('0x3c')]};return db['JscriptyProject'][_0xc094('0x1e')](_0x299494)[_0xc094('0x24')](function(_0x109a09){_0x56ef51[_0xc094('0x1e')]=_0x109a09;if(_0x23790f[_0xc094('0x32')][_0xc094('0x3f')]){_0x5090e3[_0xc094('0x40')]=[{'all':!![]}];}return db['JscriptyProject'][_0xc094('0x41')](_0x5090e3);})['then'](function(_0x5082df){_0x56ef51[_0xc094('0x42')]=_0x5082df;return _0x56ef51;})['then'](respondWithFilteredResult(_0x27614c,_0x5090e3))[_0xc094('0x43')](handleError(_0x27614c,null));};exports[_0xc094('0x44')]=function(_0x43600e,_0x1c97e6){var _0x388e76={'raw':![],'where':{'id':_0x43600e['params']['id']}},_0x1bf5f1={};_0x1bf5f1[_0xc094('0x35')]=_[_0xc094('0x45')](db['JscriptyProject'][_0xc094('0x2e')]);_0x1bf5f1['query']=_['keys'](_0x43600e[_0xc094('0x32')]);_0x1bf5f1[_0xc094('0x33')]=_[_0xc094('0x34')](_0x1bf5f1[_0xc094('0x35')],_0x1bf5f1['query']);_0x388e76[_0xc094('0x37')]=_[_0xc094('0x34')](_0x1bf5f1[_0xc094('0x35')],qs[_0xc094('0x36')](_0x43600e['query'][_0xc094('0x36')]));_0x388e76[_0xc094('0x37')]=_0x388e76[_0xc094('0x37')][_0xc094('0x38')]?_0x388e76[_0xc094('0x37')]:_0x1bf5f1[_0xc094('0x35')];if(_0x43600e['query']['includeAll']){_0x388e76[_0xc094('0x40')]=[{'all':!![]}];}_0x388e76=_['merge']({},_0x388e76,_0x43600e[_0xc094('0x3e')]);return db['JscriptyProject'][_0xc094('0x46')](_0x388e76)['then'](handleEntityNotFound(_0x1c97e6,null))[_0xc094('0x24')](respondWithResult(_0x1c97e6,null))['catch'](handleError(_0x1c97e6,null));};exports[_0xc094('0x47')]=function(_0x56dc51,_0x46aa3b){return db[_0xc094('0x2d')][_0xc094('0x47')](_0x56dc51[_0xc094('0x48')],{})['then'](function(_0x43cab6){var _0x5f1f2a=_0x56dc51[_0xc094('0x49')][_0xc094('0x4a')]({'plain':!![]});if(!_0x5f1f2a)throw new Error(_0xc094('0x4b'));if(_0x5f1f2a[_0xc094('0x4c')]===_0xc094('0x49')){var _0xb7ba29=_0x43cab6[_0xc094('0x4a')]({'plain':!![]});var _0xac85c5=_0xc094('0x4d');return db[_0xc094('0x4e')]['find']({'where':{'name':_0xac85c5,'userProfileId':_0x5f1f2a[_0xc094('0x4f')]},'raw':!![]})['then'](function(_0x2ba0a9){if(_0x2ba0a9&&_0x2ba0a9[_0xc094('0x50')]===0x0){return db[_0xc094('0x25')]['create']({'name':_0xb7ba29[_0xc094('0x29')],'resourceId':_0xb7ba29['id'],'type':_0x2ba0a9[_0xc094('0x29')],'sectionId':_0x2ba0a9['id']},{})[_0xc094('0x24')](function(){return _0x43cab6;});}else{return _0x43cab6;}})[_0xc094('0x43')](function(_0x5b38ef){logger[_0xc094('0x51')](_0xc094('0x52'),_0x5b38ef);throw _0x5b38ef;});}return _0x43cab6;})['then'](respondWithResult(_0x46aa3b,0xc9))[_0xc094('0x43')](handleError(_0x46aa3b,null));};exports[_0xc094('0x53')]=function(_0x5ac606,_0x1a2db9){var _0x54fc6b={'where':{'id':_0x5ac606[_0xc094('0x54')]['id']}},_0x5e7a51={};_0x5e7a51[_0xc094('0x35')]=_[_0xc094('0x45')](db['JscriptyProject'][_0xc094('0x2e')]);_0x54fc6b[_0xc094('0x37')]=_[_0xc094('0x34')](_0x5e7a51[_0xc094('0x35')],qs[_0xc094('0x36')](_0x5ac606[_0xc094('0x32')][_0xc094('0x36')]));_0x54fc6b[_0xc094('0x37')]=_0x54fc6b[_0xc094('0x37')][_0xc094('0x38')]?_0x54fc6b['attributes']:_0x5e7a51[_0xc094('0x35')];if(_0x5ac606[_0xc094('0x32')][_0xc094('0x3f')]){_0x54fc6b['include']=[{'all':!![]}];}_0x54fc6b=_[_0xc094('0x3d')]({},_0x54fc6b,_0x5ac606[_0xc094('0x3e')]);return db['JscriptyProject'][_0xc094('0x46')](_0x54fc6b)[_0xc094('0x24')](handleEntityNotFound(_0x1a2db9,null))[_0xc094('0x24')](function(_0x5f2bba){if(_0x5f2bba){var _0x1a0b90=_0x5f2bba['get']({'plain':!![]});_0x1a0b90=qs[_0xc094('0x55')](_0x1a0b90,['id',_0xc094('0x56'),_0xc094('0x57')]);_0x5ac606[_0xc094('0x48')]=_[_0xc094('0x55')](_0x5ac606[_0xc094('0x48')],['id',_0xc094('0x56'),_0xc094('0x57')]);return db[_0xc094('0x2d')][_0xc094('0x47')](_[_0xc094('0x3d')](_0x1a0b90,_0x5ac606[_0xc094('0x48')]),{'include':_0x5ac606['query'][_0xc094('0x3f')]?[{'all':!![]}]:undefined})[_0xc094('0x24')](function(_0xc9d8){var _0x465b28=_0x5ac606[_0xc094('0x49')][_0xc094('0x4a')]({'plain':!![]});if(!_0x465b28)throw new Error(_0xc094('0x4b'));if(_0x465b28[_0xc094('0x4c')]===_0xc094('0x49')){var _0x419006=_0xc9d8[_0xc094('0x4a')]({'plain':!![]});var _0x22d1f3=_0xc094('0x4d');return db[_0xc094('0x4e')][_0xc094('0x46')]({'where':{'name':_0x22d1f3,'userProfileId':_0x465b28[_0xc094('0x4f')]},'raw':!![]})[_0xc094('0x24')](function(_0x401f4b){if(_0x401f4b&&_0x401f4b[_0xc094('0x50')]===0x0){return db[_0xc094('0x25')][_0xc094('0x47')]({'name':_0x419006[_0xc094('0x29')],'resourceId':_0x419006['id'],'type':_0x401f4b[_0xc094('0x29')],'sectionId':_0x401f4b['id']},{})[_0xc094('0x24')](function(){return _0xc9d8;});}else{return _0xc9d8;}})['catch'](function(_0x11c69d){logger[_0xc094('0x51')](_0xc094('0x52'),_0x11c69d);throw _0x11c69d;});}return _0xc9d8;});}})[_0xc094('0x24')](respondWithResult(_0x1a2db9,0xc9))[_0xc094('0x43')](handleError(_0x1a2db9,null));};exports[_0xc094('0x58')]=function(_0x2aae68,_0xbc704c){if(_0x2aae68[_0xc094('0x48')]['id']){delete _0x2aae68['body']['id'];}return db[_0xc094('0x2d')][_0xc094('0x46')]({'where':{'id':_0x2aae68[_0xc094('0x54')]['id']}})[_0xc094('0x24')](handleEntityNotFound(_0xbc704c,null))[_0xc094('0x24')](saveUpdates(_0x2aae68[_0xc094('0x48')],null))['then'](respondWithResult(_0xbc704c,null))[_0xc094('0x43')](handleError(_0xbc704c,null));};exports['destroy']=function(_0x3fbd46,_0x6df9b3){return db[_0xc094('0x2d')][_0xc094('0x46')]({'where':{'id':_0x3fbd46[_0xc094('0x54')]['id']}})['then'](handleEntityNotFound(_0x6df9b3,null))[_0xc094('0x24')](removeEntity(_0x6df9b3,null))[_0xc094('0x43')](handleError(_0x6df9b3,null));};exports[_0xc094('0x59')]=function(_0x2168ab,_0x443857,_0x42f14e){var _0x3b81d2={'raw':!![],'where':{}};var _0x5b56dd={};var _0x519713={'count':0x0,'rows':[]};return db[_0xc094('0x2d')][_0xc094('0x5a')]({'where':{'id':_0x2168ab['params']['id']}})['then'](handleEntityNotFound(_0x443857,null))[_0xc094('0x24')](function(_0x1575d0){if(_0x1575d0){_0x5b56dd[_0xc094('0x35')]=_['keys'](db[_0xc094('0x5b')][_0xc094('0x2e')]);_0x5b56dd[_0xc094('0x32')]=_[_0xc094('0x45')](_0x2168ab['query']);_0x5b56dd['filters']=_[_0xc094('0x34')](_0x5b56dd['model'],_0x5b56dd[_0xc094('0x32')]);_0x3b81d2['attributes']=_[_0xc094('0x34')](_0x5b56dd['model'],qs[_0xc094('0x36')](_0x2168ab[_0xc094('0x32')][_0xc094('0x36')]));_0x3b81d2[_0xc094('0x37')]=_0x3b81d2[_0xc094('0x37')][_0xc094('0x38')]?_0x3b81d2['attributes']:_0x5b56dd[_0xc094('0x35')];if(!_0x2168ab[_0xc094('0x32')][_0xc094('0x39')]('nolimit')){_0x3b81d2[_0xc094('0x1d')]=qs[_0xc094('0x1d')](_0x2168ab['query'][_0xc094('0x1d')]);_0x3b81d2[_0xc094('0x1b')]=qs[_0xc094('0x1b')](_0x2168ab['query']['offset']);}_0x3b81d2['order']=qs[_0xc094('0x5c')](_0x2168ab['query'][_0xc094('0x5c')]);_0x3b81d2['where']=qs['filters'](_[_0xc094('0x5d')](_0x2168ab[_0xc094('0x32')],_0x5b56dd[_0xc094('0x33')]));_0x3b81d2['where']['ProjectId']=_0x1575d0['id'];if(_0x2168ab[_0xc094('0x32')][_0xc094('0x5e')]){_0x3b81d2[_0xc094('0x3c')]=_['merge'](_0x3b81d2[_0xc094('0x3c')],{'$or':_['map'](_0x3b81d2[_0xc094('0x37')],function(_0x5abe4a){var _0x20f456={};_0x20f456[_0x5abe4a]={'$like':'%'+_0x2168ab[_0xc094('0x32')][_0xc094('0x5e')]+'%'};return _0x20f456;})});}_0x3b81d2=_[_0xc094('0x3d')]({},_0x3b81d2,_0x2168ab['options']);return db[_0xc094('0x5b')][_0xc094('0x1e')]({'where':_0x3b81d2['where']})[_0xc094('0x24')](function(_0x53b4c0){_0x519713['count']=_0x53b4c0;if(_0x2168ab[_0xc094('0x32')][_0xc094('0x3f')]){_0x3b81d2[_0xc094('0x40')]=[{'all':!![]}];}return db[_0xc094('0x5b')]['findAll'](_0x3b81d2);})['then'](function(_0x6db787){_0x519713['rows']=_0x6db787;return _0x519713;});}})['then'](respondWithFilteredResult(_0x443857,_0x3b81d2))[_0xc094('0x43')](handleError(_0x443857,null));};exports[_0xc094('0x5f')]=function(_0x20d0a6,_0x93ed7e,_0x19a5a0){var _0xd61d85={'raw':!![],'where':{}};var _0x272d5f={};var _0x2905cf={'count':0x0,'rows':[]};return db[_0xc094('0x2d')][_0xc094('0x5a')]({'where':{'id':_0x20d0a6[_0xc094('0x54')]['id']}})['then'](handleEntityNotFound(_0x93ed7e,null))[_0xc094('0x24')](function(_0x11db0f){if(_0x11db0f){_0x272d5f[_0xc094('0x35')]=_[_0xc094('0x45')](db[_0xc094('0x60')]['rawAttributes']);_0x272d5f['query']=_['keys'](_0x20d0a6[_0xc094('0x32')]);_0x272d5f[_0xc094('0x33')]=_[_0xc094('0x34')](_0x272d5f[_0xc094('0x35')],_0x272d5f[_0xc094('0x32')]);_0xd61d85[_0xc094('0x37')]=_['intersection'](_0x272d5f[_0xc094('0x35')],qs[_0xc094('0x36')](_0x20d0a6[_0xc094('0x32')][_0xc094('0x36')]));_0xd61d85[_0xc094('0x37')]=_0xd61d85[_0xc094('0x37')][_0xc094('0x38')]?_0xd61d85[_0xc094('0x37')]:_0x272d5f['model'];if(!_0x20d0a6[_0xc094('0x32')][_0xc094('0x39')]('nolimit')){_0xd61d85[_0xc094('0x1d')]=qs[_0xc094('0x1d')](_0x20d0a6[_0xc094('0x32')][_0xc094('0x1d')]);_0xd61d85[_0xc094('0x1b')]=qs[_0xc094('0x1b')](_0x20d0a6['query'][_0xc094('0x1b')]);}_0xd61d85[_0xc094('0x3b')]=qs[_0xc094('0x5c')](_0x20d0a6[_0xc094('0x32')][_0xc094('0x5c')]);_0xd61d85[_0xc094('0x3c')]=qs['filters'](_[_0xc094('0x5d')](_0x20d0a6['query'],_0x272d5f[_0xc094('0x33')]));_0xd61d85[_0xc094('0x3c')]['ProjectId']=_0x11db0f['id'];if(_0x20d0a6['query']['filter']){_0xd61d85[_0xc094('0x3c')]=_['merge'](_0xd61d85[_0xc094('0x3c')],{'$or':_['map'](_0xd61d85[_0xc094('0x37')],function(_0x19a16a){var _0x53e9b5={};_0x53e9b5[_0x19a16a]={'$like':'%'+_0x20d0a6[_0xc094('0x32')][_0xc094('0x5e')]+'%'};return _0x53e9b5;})});}_0xd61d85=_[_0xc094('0x3d')]({},_0xd61d85,_0x20d0a6['options']);return db[_0xc094('0x60')][_0xc094('0x1e')]({'where':_0xd61d85[_0xc094('0x3c')]})[_0xc094('0x24')](function(_0x550f2e){_0x2905cf[_0xc094('0x1e')]=_0x550f2e;if(_0x20d0a6['query'][_0xc094('0x3f')]){_0xd61d85[_0xc094('0x40')]=[{'all':!![]}];}return db[_0xc094('0x60')]['findAll'](_0xd61d85);})['then'](function(_0x1b5c26){_0x2905cf[_0xc094('0x42')]=_0x1b5c26;return _0x2905cf;});}})[_0xc094('0x24')](respondWithFilteredResult(_0x93ed7e,_0xd61d85))['catch'](handleError(_0x93ed7e,null));};function char(_0x56626c){return _0xc094('0x61')===typeof _0x56626c?String[_0xc094('0x62')][_0xc094('0x21')](null,arguments):_0x56626c;}function needsEncapsulation(_0x2fd2a9){return!!_0x2fd2a9&&(_0x2fd2a9[_0xc094('0x63')]()[_0xc094('0x64')](char(0xd))>=0x0||_0x2fd2a9[_0xc094('0x63')]()[_0xc094('0x64')](char(0xa))>=0x0||_0x2fd2a9[_0xc094('0x63')]()[_0xc094('0x64')](char(0x2c))>=0x0||_0x2fd2a9[_0xc094('0x63')]()[_0xc094('0x64')](char(0x22))>=0x0);}function encapsulate(_0xffec0a){var _0x105e4d=char(0x22),_0x2aa2f1='\x5c'+char(0x22),_0x4d8b71=_0xffec0a[_0xc094('0x63')]()['replace'](new RegExp(_0x105e4d,'g'),_0x2aa2f1);return _0x105e4d+_0x4d8b71+_0x105e4d;}exports[_0xc094('0x65')]=function(_0x45b875,_0x1b9316,_0x955189){var _0x1366cf,_0x23f273;var _0x565ba7={'where':{'ProjectId':_0x45b875[_0xc094('0x54')]['id']}};if(_0x45b875[_0xc094('0x32')]['startTime']){_0x565ba7['where'][_0xc094('0x66')]=JSON[_0xc094('0x67')](_0x45b875['query']['startTime']);}return db[_0xc094('0x5b')][_0xc094('0x41')](_0x565ba7)[_0xc094('0x24')](handleEntityNotFound(_0x1b9316,null))[_0xc094('0x24')](function(_0x5a27e1){if(_0x5a27e1){_0x1366cf=_0x5a27e1;return db[_0xc094('0x68')]['findAll']({'where':{'SessionId':{'$in':_[_0xc094('0x2c')](_0x1366cf,'id')},'ProjectId':_0x45b875[_0xc094('0x54')]['id']},'order':_0xc094('0x69')});}})['then'](handleEntityNotFound(_0x1b9316,null))['then'](function(_0x387cb0){if(_0x387cb0){_0x23f273=_0x387cb0;var _0x53109f={};for(var _0x245e38=0x0,_0x5624f3=_0x23f273[_0xc094('0x38')];_0x245e38<_0x5624f3;_0x245e38++){if(!_0x53109f[_0xc094('0x39')](_0x23f273[_0x245e38][_0xc094('0x6a')])){_0x53109f[_0x23f273[_0x245e38][_0xc094('0x6a')]]=needsEncapsulation(_0x23f273[_0x245e38][_0xc094('0x6b')])?encapsulate(_0x23f273[_0x245e38][_0xc094('0x6b')]):_0x23f273[_0x245e38][_0xc094('0x6b')];}}var _0x32bc4b=[],_0x51eda7={};for(var _0x26885b=0x0,_0x350538=_0x1366cf[_0xc094('0x38')];_0x26885b<_0x350538;_0x26885b++){_0x51eda7={'ProjectId':_0x45b875[_0xc094('0x54')]['id'],'SessionId':_0x1366cf[_0x26885b]['id'],'StartTime':moment(_0x1366cf[_0x26885b][_0xc094('0x66')])['format'](_0xc094('0x6c'))};for(var _0x34ca8a=0x0,_0x27492b=_0x23f273[_0xc094('0x38')];_0x34ca8a<_0x27492b;_0x34ca8a++){if(_0x23f273[_0x34ca8a][_0xc094('0x6d')]==_0x1366cf[_0x26885b]['id']&&_0x53109f[_0xc094('0x39')](_0x23f273[_0x34ca8a][_0xc094('0x6a')])){_0x51eda7[_0x53109f[_0x23f273[_0x34ca8a][_0xc094('0x6a')]]]=_0x23f273[_0x34ca8a][_0xc094('0x6e')];}}for(var _0xf24a1e in _0x53109f){if(!_0x51eda7[_0xc094('0x39')](_0x53109f[_0xf24a1e])){_0x51eda7[_0x53109f[_0xf24a1e]]=null;}}_0x32bc4b['push'](_0x51eda7);}return _0x32bc4b;}})[_0xc094('0x24')](function(_0x321652){if(!_[_0xc094('0x6f')](_0x321652)){var _0x14b39b=toCsv(_0x321652);var _0x24f12d=Date[_0xc094('0x70')]();fs['writeFileSync'](util['format'](_0xc094('0x71'),_0x45b875[_0xc094('0x54')]['id'],_0x24f12d),_0x14b39b);_0x1b9316[_0xc094('0x72')](_0xc094('0x73'),'attachment;\x20filename='+util[_0xc094('0x74')](_0xc094('0x75'),_0x45b875[_0xc094('0x54')]['id'],_0x24f12d));_0x1b9316[_0xc094('0x72')](_0xc094('0x76'),'text/csv');return _0x1b9316[_0xc094('0x77')](util[_0xc094('0x74')](_0xc094('0x71'),_0x45b875[_0xc094('0x54')]['id'],_0x24f12d));}else{return _0x1b9316[_0xc094('0x18')](0xcc);}})[_0xc094('0x43')](handleError(_0x1b9316,null));};
\ No newline at end of file
index b7d774d..371877e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcca7=['request-promise','rimraf','../../config/environment','./jscriptyProject.attributes','exports','jscripty_projects','lodash','util','../../config/logger','api'];(function(_0x4a05e7,_0x22f0df){var _0x126423=function(_0x58f08c){while(--_0x58f08c){_0x4a05e7['push'](_0x4a05e7['shift']());}};_0x126423(++_0x22f0df);}(_0xcca7,0x1aa));var _0x7cca=function(_0x1f7420,_0x46922d){_0x1f7420=_0x1f7420-0x0;var _0x5574ac=_0xcca7[_0x1f7420];return _0x5574ac;};'use strict';var _=require(_0x7cca('0x0'));var util=require(_0x7cca('0x1'));var logger=require(_0x7cca('0x2'))(_0x7cca('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7cca('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7cca('0x5'));var config=require(_0x7cca('0x6'));var attributes=require(_0x7cca('0x7'));module[_0x7cca('0x8')]=function(_0x1c6c95,_0xe70805){return _0x1c6c95['define']('JscriptyProject',attributes,{'tableName':_0x7cca('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb717=['exports','define','JscriptyProject','jscripty_projects','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyProject.attributes'];(function(_0x23207b,_0x4d57bd){var _0x337090=function(_0x76cdaf){while(--_0x76cdaf){_0x23207b['push'](_0x23207b['shift']());}};_0x337090(++_0x4d57bd);}(_0xb717,0x1b4));var _0x7b71=function(_0x4813df,_0x16059d){_0x4813df=_0x4813df-0x0;var _0x1f0f2c=_0xb717[_0x4813df];return _0x1f0f2c;};'use strict';var _=require(_0x7b71('0x0'));var util=require('util');var logger=require(_0x7b71('0x1'))('api');var moment=require(_0x7b71('0x2'));var BPromise=require(_0x7b71('0x3'));var rp=require(_0x7b71('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b71('0x5'));var config=require(_0x7b71('0x6'));var attributes=require(_0x7b71('0x7'));module[_0x7b71('0x8')]=function(_0x3d3643,_0x593c15){return _0x3d3643[_0x7b71('0x9')](_0x7b71('0xa'),attributes,{'tableName':_0x7b71('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 68199f1..a515fc7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac4a=['JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xac4a,0x13f));var _0xaac4=function(_0x1075dc,_0x22dfae){_0x1075dc=_0x1075dc-0x0;var _0x3409e9=_0xac4a[_0x1075dc];return _0x3409e9;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});}
\ No newline at end of file
+var _0xda3f=['rpc','jayson/promise','client','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x52e363,_0x48062a){var _0x3fc2b5=function(_0x1b0cf9){while(--_0x1b0cf9){_0x52e363['push'](_0x52e363['shift']());}};_0x3fc2b5(++_0x48062a);}(_0xda3f,0xec));var _0xfda3=function(_0x14b9d3,_0x5d4c4b){_0x14b9d3=_0x14b9d3-0x0;var _0x638f30=_0xda3f[_0x14b9d3];return _0x638f30;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});}
\ No newline at end of file
index 3d1ee41..d908b32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeaa8=['create','put','/:id','update','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','show','post'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xeaa8,0x16b));var _0x8eaa=function(_0x5ae58c,_0x29a28c){_0x5ae58c=_0x5ae58c-0x0;var _0x4bc987=_0xeaa8[_0x5ae58c];return _0x4bc987;};'use strict';var multer=require('multer');var util=require(_0x8eaa('0x0'));var path=require(_0x8eaa('0x1'));var timeout=require(_0x8eaa('0x2'));var express=require('express');var router=express[_0x8eaa('0x3')]();var fs_extra=require(_0x8eaa('0x4'));var auth=require(_0x8eaa('0x5'));var interaction=require(_0x8eaa('0x6'));var config=require(_0x8eaa('0x7'));var controller=require(_0x8eaa('0x8'));router[_0x8eaa('0x9')]('/',auth[_0x8eaa('0xa')](),controller[_0x8eaa('0xb')]);router['get'](_0x8eaa('0xc'),auth[_0x8eaa('0xa')](),controller['describe']);router[_0x8eaa('0x9')]('/:id',auth[_0x8eaa('0xa')](),controller[_0x8eaa('0xd')]);router[_0x8eaa('0xe')]('/',auth[_0x8eaa('0xa')](),controller[_0x8eaa('0xf')]);router[_0x8eaa('0x10')](_0x8eaa('0x11'),auth[_0x8eaa('0xa')](),controller[_0x8eaa('0x12')]);router['delete'](_0x8eaa('0x11'),auth[_0x8eaa('0xa')](),controller[_0x8eaa('0x13')]);module[_0x8eaa('0x14')]=router;
\ No newline at end of file
+var _0xc7a7=['put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','isAuthenticated','index','get','/:id','show','create'];(function(_0x404cde,_0x27b51c){var _0x139882=function(_0x1f31d1){while(--_0x1f31d1){_0x404cde['push'](_0x404cde['shift']());}};_0x139882(++_0x27b51c);}(_0xc7a7,0x16c));var _0x7c7a=function(_0x27eed5,_0x45c856){_0x27eed5=_0x27eed5-0x0;var _0x42397c=_0xc7a7[_0x27eed5];return _0x42397c;};'use strict';var multer=require(_0x7c7a('0x0'));var util=require(_0x7c7a('0x1'));var path=require(_0x7c7a('0x2'));var timeout=require(_0x7c7a('0x3'));var express=require(_0x7c7a('0x4'));var router=express[_0x7c7a('0x5')]();var fs_extra=require(_0x7c7a('0x6'));var auth=require(_0x7c7a('0x7'));var interaction=require(_0x7c7a('0x8'));var config=require('../../config/environment');var controller=require(_0x7c7a('0x9'));router['get']('/',auth[_0x7c7a('0xa')](),controller[_0x7c7a('0xb')]);router[_0x7c7a('0xc')]('/describe',auth[_0x7c7a('0xa')](),controller['describe']);router[_0x7c7a('0xc')](_0x7c7a('0xd'),auth['isAuthenticated'](),controller[_0x7c7a('0xe')]);router['post']('/',auth[_0x7c7a('0xa')](),controller[_0x7c7a('0xf')]);router[_0x7c7a('0x10')](_0x7c7a('0xd'),auth[_0x7c7a('0xa')](),controller['update']);router[_0x7c7a('0x11')]('/:id',auth[_0x7c7a('0xa')](),controller[_0x7c7a('0x12')]);module[_0x7c7a('0x13')]=router;
\ No newline at end of file
index 2d3e51a..2561242 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x7a54,0x106));var _0x47a5=function(_0x26065f,_0x503b08){_0x26065f=_0x26065f-0x0;var _0x23f851=_0x7a54[_0x26065f];return _0x23f851;};'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(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x7a54,0x106));var _0x47a5=function(_0x1f7b8a,_0x446305){_0x1f7b8a=_0x1f7b8a-0x0;var _0x4ba7a2=_0x7a54[_0x1f7b8a];return _0x4ba7a2;};'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 4da5233..4106262 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77ac=['offset','Content-Range','apply','reject','save','destroy','then','end','error','name','index','map','JscriptyQuestionReport','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','params','fields','include','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','limit','undefined','count'];(function(_0x4735c8,_0x299642){var _0x5c0a52=function(_0x1cfed9){while(--_0x1cfed9){_0x4735c8['push'](_0x4735c8['shift']());}};_0x5c0a52(++_0x299642);}(_0x77ac,0x1a3));var _0xc77a=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x77ac[_0xd1d19a];return _0x52a79d;};'use strict';var emlformat=require(_0xc77a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc77a('0x1'));var jsonpatch=require(_0xc77a('0x2'));var rp=require(_0xc77a('0x3'));var moment=require(_0xc77a('0x4'));var BPromise=require(_0xc77a('0x5'));var Mustache=require(_0xc77a('0x6'));var util=require(_0xc77a('0x7'));var path=require(_0xc77a('0x8'));var sox=require(_0xc77a('0x9'));var csv=require(_0xc77a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc77a('0xb'));var _=require(_0xc77a('0xc'));var squel=require(_0xc77a('0xd'));var crypto=require(_0xc77a('0xe'));var jsforce=require(_0xc77a('0xf'));var deskjs=require(_0xc77a('0x10'));var toCsv=require(_0xc77a('0xa'));var querystring=require('querystring');var Papa=require(_0xc77a('0x11'));var Redis=require(_0xc77a('0x12'));var authService=require(_0xc77a('0x13'));var qs=require(_0xc77a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc77a('0x15'));var logger=require(_0xc77a('0x16'))('api');var utils=require(_0xc77a('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc77a('0x18'))['db'];function respondWithStatusCode(_0xff736b,_0x5a9362){_0x5a9362=_0x5a9362||0xcc;return function(_0x3f35b7){if(_0x3f35b7){return _0xff736b[_0xc77a('0x19')](_0x5a9362);}return _0xff736b['status'](_0x5a9362)['end']();};}function respondWithResult(_0x130586,_0x54a9b0){_0x54a9b0=_0x54a9b0||0xc8;return function(_0x39cc55){if(_0x39cc55){return _0x130586[_0xc77a('0x1a')](_0x54a9b0)[_0xc77a('0x1b')](_0x39cc55);}};}function respondWithFilteredResult(_0x43a7ea,_0x5a6124){return function(_0x51133e){if(_0x51133e){var _0x160a35=typeof _0x5a6124['offset']==='undefined'&&typeof _0x5a6124[_0xc77a('0x1c')]===_0xc77a('0x1d');var _0x35a4d2=_0x51133e[_0xc77a('0x1e')];var _0x1243dc=_0x160a35?0x0:_0x5a6124[_0xc77a('0x1f')];var _0x4122bf=_0x160a35?_0x51133e[_0xc77a('0x1e')]:_0x5a6124[_0xc77a('0x1f')]+_0x5a6124[_0xc77a('0x1c')];var _0x418569;if(_0x4122bf>=_0x35a4d2){_0x4122bf=_0x35a4d2;_0x418569=0xc8;}else{_0x418569=0xce;}_0x43a7ea[_0xc77a('0x1a')](_0x418569);return _0x43a7ea['set'](_0xc77a('0x20'),_0x1243dc+'-'+_0x4122bf+'/'+_0x35a4d2)[_0xc77a('0x1b')](_0x51133e);}return null;};}function patchUpdates(_0xb1cc56){return function(_0x2bf6ba){try{jsonpatch[_0xc77a('0x21')](_0x2bf6ba,_0xb1cc56,!![]);}catch(_0x49c3b5){return BPromise[_0xc77a('0x22')](_0x49c3b5);}return _0x2bf6ba[_0xc77a('0x23')]();};}function saveUpdates(_0x4292b8,_0x46a962){return function(_0x54f5c0){if(_0x54f5c0){return _0x54f5c0['update'](_0x4292b8)['then'](function(_0x1353bc){return _0x1353bc;});}return null;};}function removeEntity(_0x1b04c6,_0x221eb9){return function(_0x45baae){if(_0x45baae){return _0x45baae[_0xc77a('0x24')]()[_0xc77a('0x25')](function(){_0x1b04c6[_0xc77a('0x1a')](0xcc)[_0xc77a('0x26')]();});}};}function handleEntityNotFound(_0x2dd453,_0x43c9f5){return function(_0x132a6f){if(!_0x132a6f){_0x2dd453[_0xc77a('0x19')](0x194);}return _0x132a6f;};}function handleError(_0x26d418,_0x268745){_0x268745=_0x268745||0x1f4;return function(_0x44f22a){logger[_0xc77a('0x27')](_0x44f22a['stack']);if(_0x44f22a[_0xc77a('0x28')]){delete _0x44f22a[_0xc77a('0x28')];}_0x26d418[_0xc77a('0x1a')](_0x268745)['send'](_0x44f22a);};}exports[_0xc77a('0x29')]=function(_0x4422ab,_0x164942){var _0x2b2543={},_0x57d31d={},_0x10cb2a={'count':0x0,'rows':[]};var _0x25e5b2=_[_0xc77a('0x2a')](db[_0xc77a('0x2b')]['rawAttributes'],function(_0x4a0d6a){return{'name':_0x4a0d6a[_0xc77a('0x2c')],'type':_0x4a0d6a[_0xc77a('0x2d')][_0xc77a('0x2e')]};});_0x57d31d[_0xc77a('0x2f')]=_[_0xc77a('0x2a')](_0x25e5b2,'name');_0x57d31d['query']=_[_0xc77a('0x30')](_0x4422ab[_0xc77a('0x31')]);_0x57d31d[_0xc77a('0x32')]=_[_0xc77a('0x33')](_0x57d31d[_0xc77a('0x2f')],_0x57d31d['query']);_0x2b2543['attributes']=_[_0xc77a('0x33')](_0x57d31d[_0xc77a('0x2f')],qs['fields'](_0x4422ab[_0xc77a('0x31')]['fields']));_0x2b2543[_0xc77a('0x34')]=_0x2b2543[_0xc77a('0x34')][_0xc77a('0x35')]?_0x2b2543[_0xc77a('0x34')]:_0x57d31d['model'];if(!_0x4422ab['query'][_0xc77a('0x36')]('nolimit')){_0x2b2543[_0xc77a('0x1c')]=qs['limit'](_0x4422ab[_0xc77a('0x31')][_0xc77a('0x1c')]);_0x2b2543[_0xc77a('0x1f')]=qs[_0xc77a('0x1f')](_0x4422ab[_0xc77a('0x31')][_0xc77a('0x1f')]);}_0x2b2543[_0xc77a('0x37')]=qs[_0xc77a('0x38')](_0x4422ab[_0xc77a('0x31')][_0xc77a('0x38')]);_0x2b2543[_0xc77a('0x39')]=qs[_0xc77a('0x32')](_[_0xc77a('0x3a')](_0x4422ab[_0xc77a('0x31')],_0x57d31d[_0xc77a('0x32')]),_0x25e5b2);if(_0x4422ab[_0xc77a('0x31')]['filter']){_0x2b2543[_0xc77a('0x39')]=_[_0xc77a('0x3b')](_0x2b2543[_0xc77a('0x39')],{'$or':_['map'](_0x25e5b2,function(_0xaea4c4){if(_0xaea4c4[_0xc77a('0x2d')]!==_0xc77a('0x3c')){var _0x3c221d={};_0x3c221d[_0xaea4c4[_0xc77a('0x28')]]={'$like':'%'+_0x4422ab['query'][_0xc77a('0x3d')]+'%'};return _0x3c221d;}})});}_0x2b2543=_[_0xc77a('0x3b')]({},_0x2b2543,_0x4422ab[_0xc77a('0x3e')]);var _0x3b5db2={'where':_0x2b2543[_0xc77a('0x39')]};return db[_0xc77a('0x2b')][_0xc77a('0x1e')](_0x3b5db2)['then'](function(_0x39fa52){_0x10cb2a[_0xc77a('0x1e')]=_0x39fa52;if(_0x4422ab[_0xc77a('0x31')][_0xc77a('0x3f')]){_0x2b2543['include']=[{'all':!![]}];}return db[_0xc77a('0x2b')][_0xc77a('0x40')](_0x2b2543);})[_0xc77a('0x25')](function(_0x28bd0c){_0x10cb2a[_0xc77a('0x41')]=_0x28bd0c;return _0x10cb2a;})[_0xc77a('0x25')](respondWithFilteredResult(_0x164942,_0x2b2543))[_0xc77a('0x42')](handleError(_0x164942,null));};exports['show']=function(_0x66115,_0x68cc60){var _0x328933={'raw':!![],'where':{'id':_0x66115[_0xc77a('0x43')]['id']}},_0xb1f89c={};_0xb1f89c[_0xc77a('0x2f')]=_[_0xc77a('0x30')](db[_0xc77a('0x2b')]['rawAttributes']);_0xb1f89c[_0xc77a('0x31')]=_['keys'](_0x66115['query']);_0xb1f89c[_0xc77a('0x32')]=_['intersection'](_0xb1f89c[_0xc77a('0x2f')],_0xb1f89c[_0xc77a('0x31')]);_0x328933[_0xc77a('0x34')]=_[_0xc77a('0x33')](_0xb1f89c[_0xc77a('0x2f')],qs['fields'](_0x66115[_0xc77a('0x31')][_0xc77a('0x44')]));_0x328933[_0xc77a('0x34')]=_0x328933['attributes'][_0xc77a('0x35')]?_0x328933[_0xc77a('0x34')]:_0xb1f89c[_0xc77a('0x2f')];if(_0x66115['query']['includeAll']){_0x328933[_0xc77a('0x45')]=[{'all':!![]}];}_0x328933=_[_0xc77a('0x3b')]({},_0x328933,_0x66115[_0xc77a('0x3e')]);return db[_0xc77a('0x2b')][_0xc77a('0x46')](_0x328933)['then'](handleEntityNotFound(_0x68cc60,null))[_0xc77a('0x25')](respondWithResult(_0x68cc60,null))[_0xc77a('0x42')](handleError(_0x68cc60,null));};exports[_0xc77a('0x47')]=function(_0x3dfc92,_0xe190da){return db[_0xc77a('0x2b')][_0xc77a('0x47')](_0x3dfc92[_0xc77a('0x48')],{})['then'](respondWithResult(_0xe190da,0xc9))[_0xc77a('0x42')](handleError(_0xe190da,null));};exports[_0xc77a('0x49')]=function(_0x2de406,_0x38994e){if(_0x2de406[_0xc77a('0x48')]['id']){delete _0x2de406[_0xc77a('0x48')]['id'];}return db[_0xc77a('0x2b')][_0xc77a('0x46')]({'where':{'id':_0x2de406[_0xc77a('0x43')]['id']}})[_0xc77a('0x25')](handleEntityNotFound(_0x38994e,null))[_0xc77a('0x25')](saveUpdates(_0x2de406[_0xc77a('0x48')],null))[_0xc77a('0x25')](respondWithResult(_0x38994e,null))['catch'](handleError(_0x38994e,null));};exports['destroy']=function(_0x3126f7,_0x1ca974){return db[_0xc77a('0x2b')][_0xc77a('0x46')]({'where':{'id':_0x3126f7['params']['id']}})[_0xc77a('0x25')](handleEntityNotFound(_0x1ca974,null))[_0xc77a('0x25')](removeEntity(_0x1ca974,null))[_0xc77a('0x42')](handleError(_0x1ca974,null));};exports['describe']=function(_0x206dd8,_0x1fe2ca){return db['JscriptyQuestionReport'][_0xc77a('0x4a')]()[_0xc77a('0x25')](respondWithResult(_0x1fe2ca,null))[_0xc77a('0x42')](handleError(_0x1fe2ca,null));};
\ No newline at end of file
+var _0x58b2=['count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','nolimit','limit','filter','where','VIRTUAL','options','JscriptyQuestionReport','includeAll','include','findAll','rows','show','params','merge','find','catch','create','body','describe','eml-format','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined'];(function(_0x217b17,_0x35fc8d){var _0x150d1b=function(_0x34296c){while(--_0x34296c){_0x217b17['push'](_0x217b17['shift']());}};_0x150d1b(++_0x35fc8d);}(_0x58b2,0xfb));var _0x258b=function(_0x4913a8,_0x5a8cbd){_0x4913a8=_0x4913a8-0x0;var _0x50a4de=_0x58b2[_0x4913a8];return _0x50a4de;};'use strict';var emlformat=require(_0x258b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x258b('0x1'));var moment=require(_0x258b('0x2'));var BPromise=require(_0x258b('0x3'));var Mustache=require(_0x258b('0x4'));var util=require(_0x258b('0x5'));var path=require('path');var sox=require(_0x258b('0x6'));var csv=require(_0x258b('0x7'));var ejs=require(_0x258b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x258b('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x258b('0xa'));var Papa=require('papaparse');var Redis=require(_0x258b('0xb'));var authService=require(_0x258b('0xc'));var qs=require(_0x258b('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x258b('0xe'));var logger=require(_0x258b('0xf'))(_0x258b('0x10'));var utils=require(_0x258b('0x11'));var config=require(_0x258b('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x258b('0x13'))['db'];function respondWithStatusCode(_0x501eb9,_0x31da1f){_0x31da1f=_0x31da1f||0xcc;return function(_0x3b5f5f){if(_0x3b5f5f){return _0x501eb9[_0x258b('0x14')](_0x31da1f);}return _0x501eb9['status'](_0x31da1f)['end']();};}function respondWithResult(_0x5378bd,_0x2c0fe7){_0x2c0fe7=_0x2c0fe7||0xc8;return function(_0x1318ff){if(_0x1318ff){return _0x5378bd[_0x258b('0x15')](_0x2c0fe7)[_0x258b('0x16')](_0x1318ff);}};}function respondWithFilteredResult(_0x29f490,_0xd3cd85){return function(_0x1a4dbc){if(_0x1a4dbc){var _0x23057a=typeof _0xd3cd85[_0x258b('0x17')]===_0x258b('0x18')&&typeof _0xd3cd85['limit']==='undefined';var _0x5b2ab7=_0x1a4dbc[_0x258b('0x19')];var _0xea8a8a=_0x23057a?0x0:_0xd3cd85[_0x258b('0x17')];var _0x340703=_0x23057a?_0x1a4dbc[_0x258b('0x19')]:_0xd3cd85[_0x258b('0x17')]+_0xd3cd85['limit'];var _0x366457;if(_0x340703>=_0x5b2ab7){_0x340703=_0x5b2ab7;_0x366457=0xc8;}else{_0x366457=0xce;}_0x29f490['status'](_0x366457);return _0x29f490[_0x258b('0x1a')](_0x258b('0x1b'),_0xea8a8a+'-'+_0x340703+'/'+_0x5b2ab7)['json'](_0x1a4dbc);}return null;};}function patchUpdates(_0x3c516d){return function(_0xee2aa){try{jsonpatch[_0x258b('0x1c')](_0xee2aa,_0x3c516d,!![]);}catch(_0x45392d){return BPromise['reject'](_0x45392d);}return _0xee2aa[_0x258b('0x1d')]();};}function saveUpdates(_0x1b8a2e,_0x630977){return function(_0x407c2f){if(_0x407c2f){return _0x407c2f[_0x258b('0x1e')](_0x1b8a2e)[_0x258b('0x1f')](function(_0x36706d){return _0x36706d;});}return null;};}function removeEntity(_0xce162d,_0x545d29){return function(_0x5949bd){if(_0x5949bd){return _0x5949bd[_0x258b('0x20')]()['then'](function(){_0xce162d['status'](0xcc)[_0x258b('0x21')]();});}};}function handleEntityNotFound(_0x3f95e9,_0x16bad0){return function(_0x6ee75d){if(!_0x6ee75d){_0x3f95e9[_0x258b('0x14')](0x194);}return _0x6ee75d;};}function handleError(_0x32c6d4,_0x43ccb5){_0x43ccb5=_0x43ccb5||0x1f4;return function(_0x6be3ea){logger[_0x258b('0x22')](_0x6be3ea[_0x258b('0x23')]);if(_0x6be3ea[_0x258b('0x24')]){delete _0x6be3ea[_0x258b('0x24')];}_0x32c6d4[_0x258b('0x15')](_0x43ccb5)['send'](_0x6be3ea);};}exports[_0x258b('0x25')]=function(_0x33102a,_0xf2da29){var _0x588e0d={},_0x44d677={},_0x1b64fd={'count':0x0,'rows':[]};var _0x28e1dd=_[_0x258b('0x26')](db['JscriptyQuestionReport'][_0x258b('0x27')],function(_0x4d0e5f){return{'name':_0x4d0e5f[_0x258b('0x28')],'type':_0x4d0e5f[_0x258b('0x29')]['key']};});_0x44d677['model']=_[_0x258b('0x26')](_0x28e1dd,_0x258b('0x24'));_0x44d677[_0x258b('0x2a')]=_[_0x258b('0x2b')](_0x33102a['query']);_0x44d677[_0x258b('0x2c')]=_[_0x258b('0x2d')](_0x44d677[_0x258b('0x2e')],_0x44d677[_0x258b('0x2a')]);_0x588e0d['attributes']=_[_0x258b('0x2d')](_0x44d677[_0x258b('0x2e')],qs[_0x258b('0x2f')](_0x33102a[_0x258b('0x2a')][_0x258b('0x2f')]));_0x588e0d[_0x258b('0x30')]=_0x588e0d[_0x258b('0x30')][_0x258b('0x31')]?_0x588e0d[_0x258b('0x30')]:_0x44d677[_0x258b('0x2e')];if(!_0x33102a[_0x258b('0x2a')]['hasOwnProperty'](_0x258b('0x32'))){_0x588e0d[_0x258b('0x33')]=qs['limit'](_0x33102a['query']['limit']);_0x588e0d['offset']=qs['offset'](_0x33102a[_0x258b('0x2a')][_0x258b('0x17')]);}_0x588e0d['order']=qs['sort'](_0x33102a['query']['sort']);_0x588e0d['where']=qs['filters'](_['pick'](_0x33102a[_0x258b('0x2a')],_0x44d677['filters']),_0x28e1dd);if(_0x33102a[_0x258b('0x2a')][_0x258b('0x34')]){_0x588e0d[_0x258b('0x35')]=_['merge'](_0x588e0d['where'],{'$or':_['map'](_0x28e1dd,function(_0x581a4f){if(_0x581a4f[_0x258b('0x29')]!==_0x258b('0x36')){var _0x544483={};_0x544483[_0x581a4f[_0x258b('0x24')]]={'$like':'%'+_0x33102a[_0x258b('0x2a')][_0x258b('0x34')]+'%'};return _0x544483;}})});}_0x588e0d=_['merge']({},_0x588e0d,_0x33102a[_0x258b('0x37')]);var _0x440e68={'where':_0x588e0d[_0x258b('0x35')]};return db[_0x258b('0x38')]['count'](_0x440e68)[_0x258b('0x1f')](function(_0x2ec108){_0x1b64fd[_0x258b('0x19')]=_0x2ec108;if(_0x33102a[_0x258b('0x2a')][_0x258b('0x39')]){_0x588e0d[_0x258b('0x3a')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x258b('0x3b')](_0x588e0d);})['then'](function(_0x161872){_0x1b64fd[_0x258b('0x3c')]=_0x161872;return _0x1b64fd;})['then'](respondWithFilteredResult(_0xf2da29,_0x588e0d))['catch'](handleError(_0xf2da29,null));};exports[_0x258b('0x3d')]=function(_0x5e8da3,_0x1be079){var _0xcdc5d2={'raw':!![],'where':{'id':_0x5e8da3[_0x258b('0x3e')]['id']}},_0x37c4a5={};_0x37c4a5['model']=_['keys'](db['JscriptyQuestionReport'][_0x258b('0x27')]);_0x37c4a5[_0x258b('0x2a')]=_[_0x258b('0x2b')](_0x5e8da3[_0x258b('0x2a')]);_0x37c4a5[_0x258b('0x2c')]=_[_0x258b('0x2d')](_0x37c4a5[_0x258b('0x2e')],_0x37c4a5[_0x258b('0x2a')]);_0xcdc5d2[_0x258b('0x30')]=_[_0x258b('0x2d')](_0x37c4a5[_0x258b('0x2e')],qs[_0x258b('0x2f')](_0x5e8da3['query'][_0x258b('0x2f')]));_0xcdc5d2[_0x258b('0x30')]=_0xcdc5d2[_0x258b('0x30')][_0x258b('0x31')]?_0xcdc5d2[_0x258b('0x30')]:_0x37c4a5['model'];if(_0x5e8da3['query'][_0x258b('0x39')]){_0xcdc5d2[_0x258b('0x3a')]=[{'all':!![]}];}_0xcdc5d2=_[_0x258b('0x3f')]({},_0xcdc5d2,_0x5e8da3['options']);return db[_0x258b('0x38')][_0x258b('0x40')](_0xcdc5d2)['then'](handleEntityNotFound(_0x1be079,null))['then'](respondWithResult(_0x1be079,null))[_0x258b('0x41')](handleError(_0x1be079,null));};exports[_0x258b('0x42')]=function(_0x2e68af,_0x563684){return db[_0x258b('0x38')][_0x258b('0x42')](_0x2e68af[_0x258b('0x43')],{})[_0x258b('0x1f')](respondWithResult(_0x563684,0xc9))[_0x258b('0x41')](handleError(_0x563684,null));};exports[_0x258b('0x1e')]=function(_0x1ad876,_0x1dbe34){if(_0x1ad876[_0x258b('0x43')]['id']){delete _0x1ad876['body']['id'];}return db[_0x258b('0x38')][_0x258b('0x40')]({'where':{'id':_0x1ad876[_0x258b('0x3e')]['id']}})[_0x258b('0x1f')](handleEntityNotFound(_0x1dbe34,null))['then'](saveUpdates(_0x1ad876[_0x258b('0x43')],null))[_0x258b('0x1f')](respondWithResult(_0x1dbe34,null))[_0x258b('0x41')](handleError(_0x1dbe34,null));};exports['destroy']=function(_0x15eb2d,_0x2f3fe4){return db[_0x258b('0x38')][_0x258b('0x40')]({'where':{'id':_0x15eb2d[_0x258b('0x3e')]['id']}})[_0x258b('0x1f')](handleEntityNotFound(_0x2f3fe4,null))[_0x258b('0x1f')](removeEntity(_0x2f3fe4,null))[_0x258b('0x41')](handleError(_0x2f3fe4,null));};exports['describe']=function(_0x3fdc22,_0x65c63c){return db['JscriptyQuestionReport'][_0x258b('0x44')]()[_0x258b('0x1f')](respondWithResult(_0x65c63c,null))['catch'](handleError(_0x65c63c,null));};
\ No newline at end of file
index b91c294..f43893f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb6b=['request-promise','path','../../config/environment','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','api','bluebird'];(function(_0x499b56,_0x175726){var _0x4fa77f=function(_0x46ac23){while(--_0x46ac23){_0x499b56['push'](_0x499b56['shift']());}};_0x4fa77f(++_0x175726);}(_0xdb6b,0x10f));var _0xbdb6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdb6b[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xbdb6('0x0'));var util=require(_0xbdb6('0x1'));var logger=require('../../config/logger')(_0xbdb6('0x2'));var moment=require('moment');var BPromise=require(_0xbdb6('0x3'));var rp=require(_0xbdb6('0x4'));var fs=require('fs');var path=require(_0xbdb6('0x5'));var rimraf=require('rimraf');var config=require(_0xbdb6('0x6'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0xbdb6('0x7')]=function(_0x3946cd,_0x592af8){return _0x3946cd[_0xbdb6('0x8')](_0xbdb6('0x9'),attributes,{'tableName':_0xbdb6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb8dc=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./jscriptyQuestionReport.attributes','define','JscriptyQuestionReport','util'];(function(_0x48b4a1,_0x3c2bf4){var _0x2df379=function(_0x5962c1){while(--_0x5962c1){_0x48b4a1['push'](_0x48b4a1['shift']());}};_0x2df379(++_0x3c2bf4);}(_0xb8dc,0xba));var _0xcb8d=function(_0x2194b5,_0x5cabd2){_0x2194b5=_0x2194b5-0x0;var _0x46a794=_0xb8dc[_0x2194b5];return _0x46a794;};'use strict';var _=require('lodash');var util=require(_0xcb8d('0x0'));var logger=require(_0xcb8d('0x1'))(_0xcb8d('0x2'));var moment=require(_0xcb8d('0x3'));var BPromise=require(_0xcb8d('0x4'));var rp=require(_0xcb8d('0x5'));var fs=require('fs');var path=require(_0xcb8d('0x6'));var rimraf=require(_0xcb8d('0x7'));var config=require('../../config/environment');var attributes=require(_0xcb8d('0x8'));module['exports']=function(_0x52601d,_0x54f3a){return _0x52601d[_0xcb8d('0x9')](_0xcb8d('0xa'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4cc3699..cbf0588 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7929=['request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s'];(function(_0x1a8f86,_0x5ed9c4){var _0x20d876=function(_0x596e1b){while(--_0x596e1b){_0x1a8f86['push'](_0x1a8f86['shift']());}};_0x20d876(++_0x5ed9c4);}(_0x7929,0xe4));var _0x9792=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x7929[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x9792('0x0'));var util=require(_0x9792('0x1'));var moment=require('moment');var BPromise=require(_0x9792('0x2'));var rs=require(_0x9792('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9792('0x4'));var config=require(_0x9792('0x5'));var jayson=require(_0x9792('0x6'));var client=jayson['client'][_0x9792('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x21a0ab,_0x46fddf,_0x5e9649){return new BPromise(function(_0x1df1fa,_0x275833){return client[_0x9792('0x8')](_0x21a0ab,_0x5e9649)[_0x9792('0x9')](function(_0x34025f){logger[_0x9792('0xa')](_0x9792('0xb'),_0x46fddf,_0x9792('0xc'));logger['debug'](_0x9792('0xd'),_0x46fddf,_0x9792('0xc'),JSON[_0x9792('0xe')](_0x34025f));if(_0x34025f['error']){if(_0x34025f[_0x9792('0xf')][_0x9792('0x10')]===0x1f4){logger[_0x9792('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x46fddf,_0x34025f['error'][_0x9792('0x11')]);return _0x275833(_0x34025f[_0x9792('0xf')][_0x9792('0x11')]);}logger[_0x9792('0xf')](_0x9792('0xb'),_0x46fddf,_0x34025f['error'][_0x9792('0x11')]);return _0x1df1fa(_0x34025f[_0x9792('0xf')][_0x9792('0x11')]);}else{logger['info'](_0x9792('0xb'),_0x46fddf,_0x9792('0xc'));_0x1df1fa(_0x34025f[_0x9792('0x12')][_0x9792('0x11')]);}})[_0x9792('0x13')](function(_0x5d785a){logger[_0x9792('0xf')](_0x9792('0xb'),_0x46fddf,_0x5d785a);_0x275833(_0x5d785a);});});}
\ No newline at end of file
+var _0x8026=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring'];(function(_0x5ad0c0,_0x444dfe){var _0x21bfb0=function(_0x1ccbea){while(--_0x1ccbea){_0x5ad0c0['push'](_0x5ad0c0['shift']());}};_0x21bfb0(++_0x444dfe);}(_0x8026,0x1d7));var _0x6802=function(_0x4e68aa,_0x77632d){_0x4e68aa=_0x4e68aa-0x0;var _0xfe0a56=_0x8026[_0x4e68aa];return _0xfe0a56;};'use strict';var _=require('lodash');var util=require(_0x6802('0x0'));var moment=require(_0x6802('0x1'));var BPromise=require(_0x6802('0x2'));var rs=require(_0x6802('0x3'));var fs=require('fs');var Redis=require(_0x6802('0x4'));var db=require(_0x6802('0x5'))['db'];var utils=require(_0x6802('0x6'));var logger=require(_0x6802('0x7'))(_0x6802('0x8'));var config=require(_0x6802('0x9'));var jayson=require(_0x6802('0xa'));var client=jayson[_0x6802('0xb')][_0x6802('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x574598,_0x1c1456,_0x52150e){return new BPromise(function(_0xa92a2c,_0x4d87e7){return client[_0x6802('0xd')](_0x574598,_0x52150e)[_0x6802('0xe')](function(_0x5ae3a9){logger[_0x6802('0xf')](_0x6802('0x10'),_0x1c1456,_0x6802('0x11'));logger[_0x6802('0x12')](_0x6802('0x13'),_0x1c1456,'request\x20sent',JSON[_0x6802('0x14')](_0x5ae3a9));if(_0x5ae3a9[_0x6802('0x15')]){if(_0x5ae3a9[_0x6802('0x15')][_0x6802('0x16')]===0x1f4){logger[_0x6802('0x15')](_0x6802('0x10'),_0x1c1456,_0x5ae3a9[_0x6802('0x15')][_0x6802('0x17')]);return _0x4d87e7(_0x5ae3a9[_0x6802('0x15')][_0x6802('0x17')]);}logger[_0x6802('0x15')](_0x6802('0x10'),_0x1c1456,_0x5ae3a9[_0x6802('0x15')]['message']);return _0xa92a2c(_0x5ae3a9[_0x6802('0x15')]['message']);}else{logger[_0x6802('0xf')](_0x6802('0x10'),_0x1c1456,_0x6802('0x11'));_0xa92a2c(_0x5ae3a9['result']['message']);}})[_0x6802('0x18')](function(_0x4e9d9e){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x1c1456,_0x4e9d9e);_0x4d87e7(_0x4e9d9e);});});}
\ No newline at end of file
index f9cbeb1..03c9fef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc461=['update','delete','destroy','multer','path','connect-timeout','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/questions','create'];(function(_0x56d16b,_0x21a53c){var _0x28ff30=function(_0x3aeadb){while(--_0x3aeadb){_0x56d16b['push'](_0x56d16b['shift']());}};_0x28ff30(++_0x21a53c);}(_0xc461,0xd3));var _0x1c46=function(_0x21e679,_0x53b326){_0x21e679=_0x21e679-0x0;var _0x2e1f70=_0xc461[_0x21e679];return _0x2e1f70;};'use strict';var multer=require(_0x1c46('0x0'));var util=require('util');var path=require(_0x1c46('0x1'));var timeout=require(_0x1c46('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1c46('0x3'));router[_0x1c46('0x4')]('/',auth[_0x1c46('0x5')](),controller[_0x1c46('0x6')]);router[_0x1c46('0x4')](_0x1c46('0x7'),auth[_0x1c46('0x5')](),controller[_0x1c46('0x8')]);router['get'](_0x1c46('0x9'),auth[_0x1c46('0x5')](),controller[_0x1c46('0xa')]);router[_0x1c46('0x4')](_0x1c46('0xb'),auth[_0x1c46('0x5')](),controller['getQuestions']);router['post']('/',auth[_0x1c46('0x5')](),controller[_0x1c46('0xc')]);router['put'](_0x1c46('0x9'),auth[_0x1c46('0x5')](),controller[_0x1c46('0xd')]);router[_0x1c46('0xe')](_0x1c46('0x9'),auth[_0x1c46('0x5')](),controller[_0x1c46('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x2ba0=['post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x10adb7,_0x534196){var _0x48ce7d=function(_0x147e80){while(--_0x147e80){_0x10adb7['push'](_0x10adb7['shift']());}};_0x48ce7d(++_0x534196);}(_0x2ba0,0x67));var _0x02ba=function(_0x4240be,_0x2846f4){_0x4240be=_0x4240be-0x0;var _0x400bd7=_0x2ba0[_0x4240be];return _0x400bd7;};'use strict';var multer=require(_0x02ba('0x0'));var util=require(_0x02ba('0x1'));var path=require(_0x02ba('0x2'));var timeout=require(_0x02ba('0x3'));var express=require(_0x02ba('0x4'));var router=express[_0x02ba('0x5')]();var fs_extra=require(_0x02ba('0x6'));var auth=require(_0x02ba('0x7'));var interaction=require(_0x02ba('0x8'));var config=require(_0x02ba('0x9'));var controller=require(_0x02ba('0xa'));router[_0x02ba('0xb')]('/',auth[_0x02ba('0xc')](),controller[_0x02ba('0xd')]);router[_0x02ba('0xb')](_0x02ba('0xe'),auth['isAuthenticated'](),controller[_0x02ba('0xf')]);router[_0x02ba('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x02ba('0x10')]);router[_0x02ba('0xb')]('/:id/questions',auth[_0x02ba('0xc')](),controller['getQuestions']);router[_0x02ba('0x11')]('/',auth['isAuthenticated'](),controller[_0x02ba('0x12')]);router[_0x02ba('0x13')](_0x02ba('0x14'),auth[_0x02ba('0xc')](),controller[_0x02ba('0x15')]);router['delete'](_0x02ba('0x14'),auth[_0x02ba('0xc')](),controller[_0x02ba('0x16')]);module[_0x02ba('0x17')]=router;
\ No newline at end of file
index fa27fe5..a4ffc14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7dbe=['starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','BOOLEAN','moment','exports','setDataValue'];(function(_0x4f229e,_0x1b1e6c){var _0x407c5e=function(_0x1f094f){while(--_0x1f094f){_0x4f229e['push'](_0x4f229e['shift']());}};_0x407c5e(++_0x1b1e6c);}(_0x7dbe,0x183));var _0xe7db=function(_0x190e91,_0x44c97a){_0x190e91=_0x190e91-0x0;var _0x1f0fdd=_0x7dbe[_0x190e91];return _0x1f0fdd;};'use strict';var moment=require(_0xe7db('0x0'));var Sequelize=require('sequelize');module[_0xe7db('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x58de97){this[_0xe7db('0x2')](_0xe7db('0x3'),_0x58de97);this['setDataValue'](_0xe7db('0x4'),moment()[_0xe7db('0x5')](_0xe7db('0x6')));}},'endtime':{'type':Sequelize[_0xe7db('0x7')]},'membername':{'type':Sequelize[_0xe7db('0x8')]},'projectname':{'type':Sequelize[_0xe7db('0x8')]},'queue':{'type':Sequelize[_0xe7db('0x8')]},'uniqueid':{'type':Sequelize[_0xe7db('0x8')]},'calleridname':{'type':Sequelize[_0xe7db('0x8')]},'calleridnum':{'type':Sequelize[_0xe7db('0x8')]},'completed':{'type':Sequelize[_0xe7db('0x9')],'defaultValue':![]}};
\ No newline at end of file
+var _0xa2c6=['STRING','BOOLEAN','moment','exports','DATE','setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa2c6,0x1bb));var _0x6a2c=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0xa2c6[_0x1573ea];return _0x51c0e2;};'use strict';var moment=require(_0x6a2c('0x0'));var Sequelize=require('sequelize');module[_0x6a2c('0x1')]={'starttime':{'type':Sequelize[_0x6a2c('0x2')],'set':function(_0x30dca6){this['setDataValue']('starttime',_0x30dca6);this[_0x6a2c('0x3')](_0x6a2c('0x4'),moment()[_0x6a2c('0x5')](_0x6a2c('0x6')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x6a2c('0x7')]},'uniqueid':{'type':Sequelize[_0x6a2c('0x7')]},'calleridname':{'type':Sequelize[_0x6a2c('0x7')]},'calleridnum':{'type':Sequelize[_0x6a2c('0x7')]},'completed':{'type':Sequelize[_0x6a2c('0x8')],'defaultValue':![]}};
\ No newline at end of file
index d416080..8eeaa8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48da=['moment','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filters','filter','merge','VIRTUAL','options','JscriptySessionReport','includeAll','findAll','rows','catch','show','params','keys','include','create','body','find','describe','getQuestions','findOne','nolimit','order','SessionId','JscriptyQuestionReport','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x2d0818,_0x16d1a9){var _0x466400=function(_0x3955d1){while(--_0x3955d1){_0x2d0818['push'](_0x2d0818['shift']());}};_0x466400(++_0x16d1a9);}(_0x48da,0x13c));var _0xa48d=function(_0x566a0f,_0x728aab){_0x566a0f=_0x566a0f-0x0;var _0x382bb5=_0x48da[_0x566a0f];return _0x382bb5;};'use strict';var emlformat=require(_0xa48d('0x0'));var rimraf=require(_0xa48d('0x1'));var zipdir=require(_0xa48d('0x2'));var jsonpatch=require(_0xa48d('0x3'));var rp=require('request-promise');var moment=require(_0xa48d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa48d('0x5'));var util=require(_0xa48d('0x6'));var path=require(_0xa48d('0x7'));var sox=require('sox');var csv=require(_0xa48d('0x8'));var ejs=require(_0xa48d('0x9'));var fs=require('fs');var fs_extra=require(_0xa48d('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa48d('0xb'));var jsforce=require(_0xa48d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa48d('0x8'));var querystring=require(_0xa48d('0xd'));var Papa=require(_0xa48d('0xe'));var Redis=require(_0xa48d('0xf'));var authService=require(_0xa48d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa48d('0x11'));var hardwareService=require(_0xa48d('0x12'));var logger=require(_0xa48d('0x13'))(_0xa48d('0x14'));var utils=require(_0xa48d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa48d('0x16'));var db=require(_0xa48d('0x17'))['db'];function respondWithStatusCode(_0x31ebc9,_0x41ebae){_0x41ebae=_0x41ebae||0xcc;return function(_0x4fb588){if(_0x4fb588){return _0x31ebc9[_0xa48d('0x18')](_0x41ebae);}return _0x31ebc9[_0xa48d('0x19')](_0x41ebae)[_0xa48d('0x1a')]();};}function respondWithResult(_0x23a5f0,_0x721c82){_0x721c82=_0x721c82||0xc8;return function(_0x1b7b75){if(_0x1b7b75){return _0x23a5f0[_0xa48d('0x19')](_0x721c82)[_0xa48d('0x1b')](_0x1b7b75);}};}function respondWithFilteredResult(_0x430db7,_0x427ee9){return function(_0x4efeb8){if(_0x4efeb8){var _0x4b1088=typeof _0x427ee9[_0xa48d('0x1c')]===_0xa48d('0x1d')&&typeof _0x427ee9[_0xa48d('0x1e')]==='undefined';var _0x137e7a=_0x4efeb8[_0xa48d('0x1f')];var _0x32548b=_0x4b1088?0x0:_0x427ee9['offset'];var _0x5d0ce7=_0x4b1088?_0x4efeb8[_0xa48d('0x1f')]:_0x427ee9[_0xa48d('0x1c')]+_0x427ee9[_0xa48d('0x1e')];var _0x21d980;if(_0x5d0ce7>=_0x137e7a){_0x5d0ce7=_0x137e7a;_0x21d980=0xc8;}else{_0x21d980=0xce;}_0x430db7['status'](_0x21d980);return _0x430db7['set'](_0xa48d('0x20'),_0x32548b+'-'+_0x5d0ce7+'/'+_0x137e7a)['json'](_0x4efeb8);}return null;};}function patchUpdates(_0x229eab){return function(_0x5515fb){try{jsonpatch[_0xa48d('0x21')](_0x5515fb,_0x229eab,!![]);}catch(_0x184a43){return BPromise[_0xa48d('0x22')](_0x184a43);}return _0x5515fb[_0xa48d('0x23')]();};}function saveUpdates(_0x58a537,_0x547089){return function(_0x36901b){if(_0x36901b){return _0x36901b[_0xa48d('0x24')](_0x58a537)[_0xa48d('0x25')](function(_0x3c0dba){return _0x3c0dba;});}return null;};}function removeEntity(_0x8b2017,_0x1e4a49){return function(_0x4ac801){if(_0x4ac801){return _0x4ac801[_0xa48d('0x26')]()['then'](function(){_0x8b2017[_0xa48d('0x19')](0xcc)[_0xa48d('0x1a')]();});}};}function handleEntityNotFound(_0x4c3d1b,_0x10914a){return function(_0x576023){if(!_0x576023){_0x4c3d1b[_0xa48d('0x18')](0x194);}return _0x576023;};}function handleError(_0x24e52e,_0x57d242){_0x57d242=_0x57d242||0x1f4;return function(_0x542ffb){logger[_0xa48d('0x27')](_0x542ffb['stack']);if(_0x542ffb[_0xa48d('0x28')]){delete _0x542ffb[_0xa48d('0x28')];}_0x24e52e[_0xa48d('0x19')](_0x57d242)['send'](_0x542ffb);};}exports['index']=function(_0x4c2b99,_0x16333a){var _0xfd3758={},_0x5815da={},_0x24592f={'count':0x0,'rows':[]};var _0x5bbaa7=_[_0xa48d('0x29')](db['JscriptySessionReport'][_0xa48d('0x2a')],function(_0x1ce6e5){return{'name':_0x1ce6e5[_0xa48d('0x2b')],'type':_0x1ce6e5[_0xa48d('0x2c')][_0xa48d('0x2d')]};});_0x5815da[_0xa48d('0x2e')]=_[_0xa48d('0x29')](_0x5bbaa7,_0xa48d('0x28'));_0x5815da[_0xa48d('0x2f')]=_['keys'](_0x4c2b99[_0xa48d('0x2f')]);_0x5815da['filters']=_[_0xa48d('0x30')](_0x5815da['model'],_0x5815da[_0xa48d('0x2f')]);_0xfd3758[_0xa48d('0x31')]=_[_0xa48d('0x30')](_0x5815da['model'],qs['fields'](_0x4c2b99[_0xa48d('0x2f')][_0xa48d('0x32')]));_0xfd3758[_0xa48d('0x31')]=_0xfd3758[_0xa48d('0x31')][_0xa48d('0x33')]?_0xfd3758[_0xa48d('0x31')]:_0x5815da['model'];if(!_0x4c2b99[_0xa48d('0x2f')][_0xa48d('0x34')]('nolimit')){_0xfd3758[_0xa48d('0x1e')]=qs['limit'](_0x4c2b99[_0xa48d('0x2f')][_0xa48d('0x1e')]);_0xfd3758['offset']=qs['offset'](_0x4c2b99[_0xa48d('0x2f')][_0xa48d('0x1c')]);}_0xfd3758['order']=qs[_0xa48d('0x35')](_0x4c2b99[_0xa48d('0x2f')][_0xa48d('0x35')]);_0xfd3758[_0xa48d('0x36')]=qs['filters'](_[_0xa48d('0x37')](_0x4c2b99[_0xa48d('0x2f')],_0x5815da[_0xa48d('0x38')]),_0x5bbaa7);if(_0x4c2b99[_0xa48d('0x2f')][_0xa48d('0x39')]){_0xfd3758['where']=_[_0xa48d('0x3a')](_0xfd3758[_0xa48d('0x36')],{'$or':_[_0xa48d('0x29')](_0x5bbaa7,function(_0x12e64a){if(_0x12e64a[_0xa48d('0x2c')]!==_0xa48d('0x3b')){var _0xe6ac8={};_0xe6ac8[_0x12e64a[_0xa48d('0x28')]]={'$like':'%'+_0x4c2b99[_0xa48d('0x2f')][_0xa48d('0x39')]+'%'};return _0xe6ac8;}})});}_0xfd3758=_['merge']({},_0xfd3758,_0x4c2b99[_0xa48d('0x3c')]);var _0x55b3e2={'where':_0xfd3758[_0xa48d('0x36')]};return db[_0xa48d('0x3d')][_0xa48d('0x1f')](_0x55b3e2)[_0xa48d('0x25')](function(_0x321716){_0x24592f[_0xa48d('0x1f')]=_0x321716;if(_0x4c2b99[_0xa48d('0x2f')][_0xa48d('0x3e')]){_0xfd3758['include']=[{'all':!![]}];}return db[_0xa48d('0x3d')][_0xa48d('0x3f')](_0xfd3758);})[_0xa48d('0x25')](function(_0x49d2ec){_0x24592f[_0xa48d('0x40')]=_0x49d2ec;return _0x24592f;})[_0xa48d('0x25')](respondWithFilteredResult(_0x16333a,_0xfd3758))[_0xa48d('0x41')](handleError(_0x16333a,null));};exports[_0xa48d('0x42')]=function(_0xe9f0ba,_0x209f9e){var _0x76481d={'raw':!![],'where':{'id':_0xe9f0ba[_0xa48d('0x43')]['id']}},_0x6083fe={};_0x6083fe[_0xa48d('0x2e')]=_['keys'](db['JscriptySessionReport'][_0xa48d('0x2a')]);_0x6083fe[_0xa48d('0x2f')]=_[_0xa48d('0x44')](_0xe9f0ba['query']);_0x6083fe[_0xa48d('0x38')]=_[_0xa48d('0x30')](_0x6083fe['model'],_0x6083fe[_0xa48d('0x2f')]);_0x76481d[_0xa48d('0x31')]=_['intersection'](_0x6083fe[_0xa48d('0x2e')],qs[_0xa48d('0x32')](_0xe9f0ba['query']['fields']));_0x76481d[_0xa48d('0x31')]=_0x76481d[_0xa48d('0x31')]['length']?_0x76481d['attributes']:_0x6083fe[_0xa48d('0x2e')];if(_0xe9f0ba[_0xa48d('0x2f')][_0xa48d('0x3e')]){_0x76481d[_0xa48d('0x45')]=[{'all':!![]}];}_0x76481d=_['merge']({},_0x76481d,_0xe9f0ba[_0xa48d('0x3c')]);return db['JscriptySessionReport']['find'](_0x76481d)[_0xa48d('0x25')](handleEntityNotFound(_0x209f9e,null))[_0xa48d('0x25')](respondWithResult(_0x209f9e,null))[_0xa48d('0x41')](handleError(_0x209f9e,null));};exports[_0xa48d('0x46')]=function(_0x56ac39,_0x586f1e){return db[_0xa48d('0x3d')]['create'](_0x56ac39[_0xa48d('0x47')],{})[_0xa48d('0x25')](respondWithResult(_0x586f1e,0xc9))['catch'](handleError(_0x586f1e,null));};exports[_0xa48d('0x24')]=function(_0x223765,_0x3c5934){if(_0x223765['body']['id']){delete _0x223765[_0xa48d('0x47')]['id'];}return db['JscriptySessionReport'][_0xa48d('0x48')]({'where':{'id':_0x223765['params']['id']}})[_0xa48d('0x25')](handleEntityNotFound(_0x3c5934,null))[_0xa48d('0x25')](saveUpdates(_0x223765['body'],null))[_0xa48d('0x25')](respondWithResult(_0x3c5934,null))['catch'](handleError(_0x3c5934,null));};exports['destroy']=function(_0x1f0b73,_0x16d094){return db['JscriptySessionReport']['find']({'where':{'id':_0x1f0b73['params']['id']}})[_0xa48d('0x25')](handleEntityNotFound(_0x16d094,null))[_0xa48d('0x25')](removeEntity(_0x16d094,null))[_0xa48d('0x41')](handleError(_0x16d094,null));};exports[_0xa48d('0x49')]=function(_0x9fd1ed,_0x2d6d81){return db[_0xa48d('0x3d')]['describe']()[_0xa48d('0x25')](respondWithResult(_0x2d6d81,null))[_0xa48d('0x41')](handleError(_0x2d6d81,null));};exports[_0xa48d('0x4a')]=function(_0x47a772,_0x22daaa,_0x4a8242){var _0x5e41d6={'raw':!![],'where':{}};var _0x16e310={};var _0x180ad6={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0xa48d('0x4b')]({'where':{'id':_0x47a772['params']['id']}})[_0xa48d('0x25')](handleEntityNotFound(_0x22daaa,null))[_0xa48d('0x25')](function(_0x1e6d63){if(_0x1e6d63){_0x16e310[_0xa48d('0x2e')]=_[_0xa48d('0x44')](db['JscriptyQuestionReport'][_0xa48d('0x2a')]);_0x16e310[_0xa48d('0x2f')]=_[_0xa48d('0x44')](_0x47a772[_0xa48d('0x2f')]);_0x16e310[_0xa48d('0x38')]=_[_0xa48d('0x30')](_0x16e310[_0xa48d('0x2e')],_0x16e310[_0xa48d('0x2f')]);_0x5e41d6['attributes']=_[_0xa48d('0x30')](_0x16e310[_0xa48d('0x2e')],qs[_0xa48d('0x32')](_0x47a772[_0xa48d('0x2f')][_0xa48d('0x32')]));_0x5e41d6['attributes']=_0x5e41d6['attributes'][_0xa48d('0x33')]?_0x5e41d6['attributes']:_0x16e310[_0xa48d('0x2e')];if(!_0x47a772['query'][_0xa48d('0x34')](_0xa48d('0x4c'))){_0x5e41d6[_0xa48d('0x1e')]=qs['limit'](_0x47a772['query']['limit']);_0x5e41d6[_0xa48d('0x1c')]=qs['offset'](_0x47a772['query']['offset']);}_0x5e41d6[_0xa48d('0x4d')]=qs[_0xa48d('0x35')](_0x47a772[_0xa48d('0x2f')][_0xa48d('0x35')]);_0x5e41d6['where']=qs[_0xa48d('0x38')](_[_0xa48d('0x37')](_0x47a772[_0xa48d('0x2f')],_0x16e310[_0xa48d('0x38')]));_0x5e41d6[_0xa48d('0x36')][_0xa48d('0x4e')]=_0x1e6d63['id'];if(_0x47a772[_0xa48d('0x2f')][_0xa48d('0x39')]){_0x5e41d6[_0xa48d('0x36')]=_[_0xa48d('0x3a')](_0x5e41d6[_0xa48d('0x36')],{'$or':_['map'](_0x5e41d6[_0xa48d('0x31')],function(_0x9f7e66){var _0x3bd1c3={};_0x3bd1c3[_0x9f7e66]={'$like':'%'+_0x47a772['query'][_0xa48d('0x39')]+'%'};return _0x3bd1c3;})});}_0x5e41d6=_[_0xa48d('0x3a')]({},_0x5e41d6,_0x47a772[_0xa48d('0x3c')]);return db[_0xa48d('0x4f')][_0xa48d('0x1f')]({'where':_0x5e41d6[_0xa48d('0x36')]})['then'](function(_0x2c2a02){_0x180ad6[_0xa48d('0x1f')]=_0x2c2a02;if(_0x47a772[_0xa48d('0x2f')][_0xa48d('0x3e')]){_0x5e41d6[_0xa48d('0x45')]=[{'all':!![]}];}return db[_0xa48d('0x4f')]['findAll'](_0x5e41d6);})['then'](function(_0x3df79f){_0x180ad6[_0xa48d('0x40')]=_0x3df79f;return _0x180ad6;});}})[_0xa48d('0x25')](respondWithFilteredResult(_0x22daaa,_0x5e41d6))[_0xa48d('0x41')](handleError(_0x22daaa,null));};
\ No newline at end of file
+var _0x659d=['merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','describe','findOne','nolimit','order','SessionId','JscriptyQuestionReport','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','end','sendStatus','error','name','index','map','JscriptySessionReport','rawAttributes','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','pick','filter','where'];(function(_0xd7d73c,_0x2f5719){var _0x81ed61=function(_0x2c0a76){while(--_0x2c0a76){_0xd7d73c['push'](_0xd7d73c['shift']());}};_0x81ed61(++_0x2f5719);}(_0x659d,0x64));var _0xd659=function(_0x41ee16,_0xfa94c3){_0x41ee16=_0x41ee16-0x0;var _0x1f60de=_0x659d[_0x41ee16];return _0x1f60de;};'use strict';var emlformat=require(_0xd659('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd659('0x1'));var jsonpatch=require(_0xd659('0x2'));var rp=require(_0xd659('0x3'));var moment=require(_0xd659('0x4'));var BPromise=require(_0xd659('0x5'));var Mustache=require('mustache');var util=require(_0xd659('0x6'));var path=require(_0xd659('0x7'));var sox=require(_0xd659('0x8'));var csv=require('to-csv');var ejs=require(_0xd659('0x9'));var fs=require('fs');var fs_extra=require(_0xd659('0xa'));var _=require(_0xd659('0xb'));var squel=require(_0xd659('0xc'));var crypto=require(_0xd659('0xd'));var jsforce=require(_0xd659('0xe'));var deskjs=require(_0xd659('0xf'));var toCsv=require(_0xd659('0x10'));var querystring=require(_0xd659('0x11'));var Papa=require(_0xd659('0x12'));var Redis=require('ioredis');var authService=require(_0xd659('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xd659('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd659('0x15'))(_0xd659('0x16'));var utils=require('../../config/utils');var config=require(_0xd659('0x17'));var licenseUtil=require(_0xd659('0x18'));var db=require(_0xd659('0x19'))['db'];function respondWithStatusCode(_0x39660b,_0x1d7fc3){_0x1d7fc3=_0x1d7fc3||0xcc;return function(_0xda1eae){if(_0xda1eae){return _0x39660b['sendStatus'](_0x1d7fc3);}return _0x39660b[_0xd659('0x1a')](_0x1d7fc3)['end']();};}function respondWithResult(_0x700bfd,_0x1437e4){_0x1437e4=_0x1437e4||0xc8;return function(_0x34fe75){if(_0x34fe75){return _0x700bfd['status'](_0x1437e4)[_0xd659('0x1b')](_0x34fe75);}};}function respondWithFilteredResult(_0x30af48,_0x339f16){return function(_0x188a21){if(_0x188a21){var _0x296b4d=typeof _0x339f16['offset']==='undefined'&&typeof _0x339f16[_0xd659('0x1c')]===_0xd659('0x1d');var _0x48c48b=_0x188a21[_0xd659('0x1e')];var _0x17eabc=_0x296b4d?0x0:_0x339f16[_0xd659('0x1f')];var _0x31688a=_0x296b4d?_0x188a21[_0xd659('0x1e')]:_0x339f16[_0xd659('0x1f')]+_0x339f16[_0xd659('0x1c')];var _0x932cc8;if(_0x31688a>=_0x48c48b){_0x31688a=_0x48c48b;_0x932cc8=0xc8;}else{_0x932cc8=0xce;}_0x30af48['status'](_0x932cc8);return _0x30af48[_0xd659('0x20')]('Content-Range',_0x17eabc+'-'+_0x31688a+'/'+_0x48c48b)['json'](_0x188a21);}return null;};}function patchUpdates(_0x55b5eb){return function(_0x469d0e){try{jsonpatch[_0xd659('0x21')](_0x469d0e,_0x55b5eb,!![]);}catch(_0x1edf23){return BPromise[_0xd659('0x22')](_0x1edf23);}return _0x469d0e[_0xd659('0x23')]();};}function saveUpdates(_0x5c23d6,_0x58f12b){return function(_0xad0c55){if(_0xad0c55){return _0xad0c55[_0xd659('0x24')](_0x5c23d6)[_0xd659('0x25')](function(_0x4f2faf){return _0x4f2faf;});}return null;};}function removeEntity(_0x2c20bf,_0x1df00a){return function(_0x14741e){if(_0x14741e){return _0x14741e[_0xd659('0x26')]()['then'](function(){_0x2c20bf['status'](0xcc)[_0xd659('0x27')]();});}};}function handleEntityNotFound(_0x584f75,_0x5eca81){return function(_0x2073bd){if(!_0x2073bd){_0x584f75[_0xd659('0x28')](0x194);}return _0x2073bd;};}function handleError(_0x5cb9c0,_0x3c699e){_0x3c699e=_0x3c699e||0x1f4;return function(_0x983e2c){logger[_0xd659('0x29')](_0x983e2c['stack']);if(_0x983e2c[_0xd659('0x2a')]){delete _0x983e2c['name'];}_0x5cb9c0[_0xd659('0x1a')](_0x3c699e)['send'](_0x983e2c);};}exports[_0xd659('0x2b')]=function(_0x50e325,_0x4f9fcf){var _0x32223e={},_0x398a5e={},_0x7a8064={'count':0x0,'rows':[]};var _0x2d75ef=_[_0xd659('0x2c')](db[_0xd659('0x2d')][_0xd659('0x2e')],function(_0x3b61b9){return{'name':_0x3b61b9['fieldName'],'type':_0x3b61b9['type'][_0xd659('0x2f')]};});_0x398a5e['model']=_[_0xd659('0x2c')](_0x2d75ef,'name');_0x398a5e[_0xd659('0x30')]=_['keys'](_0x50e325[_0xd659('0x30')]);_0x398a5e[_0xd659('0x31')]=_[_0xd659('0x32')](_0x398a5e[_0xd659('0x33')],_0x398a5e[_0xd659('0x30')]);_0x32223e[_0xd659('0x34')]=_['intersection'](_0x398a5e[_0xd659('0x33')],qs[_0xd659('0x35')](_0x50e325['query'][_0xd659('0x35')]));_0x32223e['attributes']=_0x32223e[_0xd659('0x34')][_0xd659('0x36')]?_0x32223e[_0xd659('0x34')]:_0x398a5e[_0xd659('0x33')];if(!_0x50e325[_0xd659('0x30')][_0xd659('0x37')]('nolimit')){_0x32223e[_0xd659('0x1c')]=qs[_0xd659('0x1c')](_0x50e325[_0xd659('0x30')][_0xd659('0x1c')]);_0x32223e[_0xd659('0x1f')]=qs[_0xd659('0x1f')](_0x50e325[_0xd659('0x30')][_0xd659('0x1f')]);}_0x32223e['order']=qs['sort'](_0x50e325[_0xd659('0x30')][_0xd659('0x38')]);_0x32223e['where']=qs[_0xd659('0x31')](_[_0xd659('0x39')](_0x50e325[_0xd659('0x30')],_0x398a5e[_0xd659('0x31')]),_0x2d75ef);if(_0x50e325[_0xd659('0x30')][_0xd659('0x3a')]){_0x32223e[_0xd659('0x3b')]=_[_0xd659('0x3c')](_0x32223e[_0xd659('0x3b')],{'$or':_['map'](_0x2d75ef,function(_0x1d9180){if(_0x1d9180[_0xd659('0x3d')]!==_0xd659('0x3e')){var _0x326e02={};_0x326e02[_0x1d9180[_0xd659('0x2a')]]={'$like':'%'+_0x50e325[_0xd659('0x30')][_0xd659('0x3a')]+'%'};return _0x326e02;}})});}_0x32223e=_[_0xd659('0x3c')]({},_0x32223e,_0x50e325[_0xd659('0x3f')]);var _0x4f4488={'where':_0x32223e[_0xd659('0x3b')]};return db['JscriptySessionReport'][_0xd659('0x1e')](_0x4f4488)[_0xd659('0x25')](function(_0x89691c){_0x7a8064['count']=_0x89691c;if(_0x50e325['query'][_0xd659('0x40')]){_0x32223e[_0xd659('0x41')]=[{'all':!![]}];}return db[_0xd659('0x2d')]['findAll'](_0x32223e);})[_0xd659('0x25')](function(_0x14b514){_0x7a8064[_0xd659('0x42')]=_0x14b514;return _0x7a8064;})[_0xd659('0x25')](respondWithFilteredResult(_0x4f9fcf,_0x32223e))[_0xd659('0x43')](handleError(_0x4f9fcf,null));};exports[_0xd659('0x44')]=function(_0x23d895,_0x474476){var _0x5cb2a5={'raw':!![],'where':{'id':_0x23d895[_0xd659('0x45')]['id']}},_0x52d949={};_0x52d949[_0xd659('0x33')]=_[_0xd659('0x46')](db[_0xd659('0x2d')][_0xd659('0x2e')]);_0x52d949[_0xd659('0x30')]=_[_0xd659('0x46')](_0x23d895[_0xd659('0x30')]);_0x52d949['filters']=_[_0xd659('0x32')](_0x52d949['model'],_0x52d949[_0xd659('0x30')]);_0x5cb2a5[_0xd659('0x34')]=_['intersection'](_0x52d949[_0xd659('0x33')],qs[_0xd659('0x35')](_0x23d895[_0xd659('0x30')][_0xd659('0x35')]));_0x5cb2a5['attributes']=_0x5cb2a5[_0xd659('0x34')][_0xd659('0x36')]?_0x5cb2a5[_0xd659('0x34')]:_0x52d949[_0xd659('0x33')];if(_0x23d895[_0xd659('0x30')][_0xd659('0x40')]){_0x5cb2a5[_0xd659('0x41')]=[{'all':!![]}];}_0x5cb2a5=_['merge']({},_0x5cb2a5,_0x23d895[_0xd659('0x3f')]);return db[_0xd659('0x2d')][_0xd659('0x47')](_0x5cb2a5)['then'](handleEntityNotFound(_0x474476,null))[_0xd659('0x25')](respondWithResult(_0x474476,null))[_0xd659('0x43')](handleError(_0x474476,null));};exports[_0xd659('0x48')]=function(_0x15618b,_0x5881f8){return db[_0xd659('0x2d')][_0xd659('0x48')](_0x15618b[_0xd659('0x49')],{})[_0xd659('0x25')](respondWithResult(_0x5881f8,0xc9))[_0xd659('0x43')](handleError(_0x5881f8,null));};exports[_0xd659('0x24')]=function(_0x5fe69b,_0x776c7f){if(_0x5fe69b[_0xd659('0x49')]['id']){delete _0x5fe69b[_0xd659('0x49')]['id'];}return db[_0xd659('0x2d')][_0xd659('0x47')]({'where':{'id':_0x5fe69b['params']['id']}})[_0xd659('0x25')](handleEntityNotFound(_0x776c7f,null))['then'](saveUpdates(_0x5fe69b[_0xd659('0x49')],null))['then'](respondWithResult(_0x776c7f,null))[_0xd659('0x43')](handleError(_0x776c7f,null));};exports[_0xd659('0x26')]=function(_0x5ce8fb,_0x1046ec){return db[_0xd659('0x2d')][_0xd659('0x47')]({'where':{'id':_0x5ce8fb[_0xd659('0x45')]['id']}})[_0xd659('0x25')](handleEntityNotFound(_0x1046ec,null))['then'](removeEntity(_0x1046ec,null))[_0xd659('0x43')](handleError(_0x1046ec,null));};exports[_0xd659('0x4a')]=function(_0x5c922e,_0x6f6e6f){return db[_0xd659('0x2d')][_0xd659('0x4a')]()[_0xd659('0x25')](respondWithResult(_0x6f6e6f,null))[_0xd659('0x43')](handleError(_0x6f6e6f,null));};exports['getQuestions']=function(_0x12ff74,_0x36c488,_0x455b26){var _0x3ebcd0={'raw':!![],'where':{}};var _0x2281ce={};var _0x12ca6c={'count':0x0,'rows':[]};return db[_0xd659('0x2d')][_0xd659('0x4b')]({'where':{'id':_0x12ff74[_0xd659('0x45')]['id']}})['then'](handleEntityNotFound(_0x36c488,null))[_0xd659('0x25')](function(_0x201e7d){if(_0x201e7d){_0x2281ce[_0xd659('0x33')]=_[_0xd659('0x46')](db['JscriptyQuestionReport'][_0xd659('0x2e')]);_0x2281ce[_0xd659('0x30')]=_[_0xd659('0x46')](_0x12ff74['query']);_0x2281ce[_0xd659('0x31')]=_[_0xd659('0x32')](_0x2281ce['model'],_0x2281ce[_0xd659('0x30')]);_0x3ebcd0[_0xd659('0x34')]=_[_0xd659('0x32')](_0x2281ce[_0xd659('0x33')],qs[_0xd659('0x35')](_0x12ff74[_0xd659('0x30')][_0xd659('0x35')]));_0x3ebcd0[_0xd659('0x34')]=_0x3ebcd0['attributes']['length']?_0x3ebcd0[_0xd659('0x34')]:_0x2281ce[_0xd659('0x33')];if(!_0x12ff74[_0xd659('0x30')][_0xd659('0x37')](_0xd659('0x4c'))){_0x3ebcd0[_0xd659('0x1c')]=qs['limit'](_0x12ff74[_0xd659('0x30')][_0xd659('0x1c')]);_0x3ebcd0[_0xd659('0x1f')]=qs[_0xd659('0x1f')](_0x12ff74[_0xd659('0x30')]['offset']);}_0x3ebcd0[_0xd659('0x4d')]=qs[_0xd659('0x38')](_0x12ff74[_0xd659('0x30')]['sort']);_0x3ebcd0[_0xd659('0x3b')]=qs[_0xd659('0x31')](_[_0xd659('0x39')](_0x12ff74[_0xd659('0x30')],_0x2281ce[_0xd659('0x31')]));_0x3ebcd0[_0xd659('0x3b')][_0xd659('0x4e')]=_0x201e7d['id'];if(_0x12ff74['query'][_0xd659('0x3a')]){_0x3ebcd0[_0xd659('0x3b')]=_[_0xd659('0x3c')](_0x3ebcd0[_0xd659('0x3b')],{'$or':_[_0xd659('0x2c')](_0x3ebcd0[_0xd659('0x34')],function(_0x32e5e4){var _0x598f13={};_0x598f13[_0x32e5e4]={'$like':'%'+_0x12ff74['query'][_0xd659('0x3a')]+'%'};return _0x598f13;})});}_0x3ebcd0=_[_0xd659('0x3c')]({},_0x3ebcd0,_0x12ff74[_0xd659('0x3f')]);return db['JscriptyQuestionReport']['count']({'where':_0x3ebcd0['where']})[_0xd659('0x25')](function(_0x135129){_0x12ca6c[_0xd659('0x1e')]=_0x135129;if(_0x12ff74[_0xd659('0x30')][_0xd659('0x40')]){_0x3ebcd0[_0xd659('0x41')]=[{'all':!![]}];}return db[_0xd659('0x4f')]['findAll'](_0x3ebcd0);})[_0xd659('0x25')](function(_0x24912e){_0x12ca6c[_0xd659('0x42')]=_0x24912e;return _0x12ca6c;});}})['then'](respondWithFilteredResult(_0x36c488,_0x3ebcd0))[_0xd659('0x43')](handleError(_0x36c488,null));};
\ No newline at end of file
index 77e8c32..f47dafc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x038b=['report_jscripty_sessions','util','../../config/logger','api','bluebird','path','rimraf','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0x5a948b,_0x59a3e5){var _0x49561f=function(_0x5b3d21){while(--_0x5b3d21){_0x5a948b['push'](_0x5a948b['shift']());}};_0x49561f(++_0x59a3e5);}(_0x038b,0x114));var _0xb038=function(_0xc66bb4,_0x1a4c72){_0xc66bb4=_0xc66bb4-0x0;var _0x3165fb=_0x038b[_0xc66bb4];return _0x3165fb;};'use strict';var _=require('lodash');var util=require(_0xb038('0x0'));var logger=require(_0xb038('0x1'))(_0xb038('0x2'));var moment=require('moment');var BPromise=require(_0xb038('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb038('0x4'));var rimraf=require(_0xb038('0x5'));var config=require('../../config/environment');var attributes=require(_0xb038('0x6'));module[_0xb038('0x7')]=function(_0x4fe092,_0x54e1e7){return _0x4fe092[_0xb038('0x8')](_0xb038('0x9'),attributes,{'tableName':_0xb038('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2d72=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','JscriptySessionReport','report_jscripty_sessions'];(function(_0x21c9e7,_0x1ca4d1){var _0x3fd3ff=function(_0xc5e171){while(--_0xc5e171){_0x21c9e7['push'](_0x21c9e7['shift']());}};_0x3fd3ff(++_0x1ca4d1);}(_0x2d72,0xa8));var _0x22d7=function(_0x459585,_0x35c5bc){_0x459585=_0x459585-0x0;var _0x50835b=_0x2d72[_0x459585];return _0x50835b;};'use strict';var _=require(_0x22d7('0x0'));var util=require(_0x22d7('0x1'));var logger=require(_0x22d7('0x2'))(_0x22d7('0x3'));var moment=require(_0x22d7('0x4'));var BPromise=require(_0x22d7('0x5'));var rp=require(_0x22d7('0x6'));var fs=require('fs');var path=require(_0x22d7('0x7'));var rimraf=require(_0x22d7('0x8'));var config=require(_0x22d7('0x9'));var attributes=require(_0x22d7('0xa'));module[_0x22d7('0xb')]=function(_0x208b5b,_0x100426){return _0x208b5b['define'](_0x22d7('0xc'),attributes,{'tableName':_0x22d7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 93e34f5..d1d55ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3da=['stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s'];(function(_0x333e36,_0x3766b7){var _0x3a6847=function(_0x374481){while(--_0x374481){_0x333e36['push'](_0x333e36['shift']());}};_0x3a6847(++_0x3766b7);}(_0xe3da,0x1cd));var _0xae3d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe3da[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var moment=require(_0xae3d('0x2'));var BPromise=require(_0xae3d('0x3'));var rs=require(_0xae3d('0x4'));var fs=require('fs');var Redis=require(_0xae3d('0x5'));var db=require(_0xae3d('0x6'))['db'];var utils=require(_0xae3d('0x7'));var logger=require(_0xae3d('0x8'))(_0xae3d('0x9'));var config=require(_0xae3d('0xa'));var jayson=require(_0xae3d('0xb'));var client=jayson[_0xae3d('0xc')][_0xae3d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x476579,_0x33c089,_0x583b98){return new BPromise(function(_0x2a5c45,_0x3d6650){return client['request'](_0x476579,_0x583b98)['then'](function(_0x459592){logger[_0xae3d('0xe')](_0xae3d('0xf'),_0x33c089,_0xae3d('0x10'));logger[_0xae3d('0x11')](_0xae3d('0x12'),_0x33c089,'request\x20sent',JSON[_0xae3d('0x13')](_0x459592));if(_0x459592['error']){if(_0x459592[_0xae3d('0x14')][_0xae3d('0x15')]===0x1f4){logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0x459592['error'][_0xae3d('0x16')]);return _0x3d6650(_0x459592[_0xae3d('0x14')][_0xae3d('0x16')]);}logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0x459592[_0xae3d('0x14')][_0xae3d('0x16')]);return _0x2a5c45(_0x459592['error'][_0xae3d('0x16')]);}else{logger[_0xae3d('0xe')](_0xae3d('0xf'),_0x33c089,_0xae3d('0x10'));_0x2a5c45(_0x459592[_0xae3d('0x17')][_0xae3d('0x16')]);}})['catch'](function(_0xe925fd){logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0xe925fd);_0x3d6650(_0xe925fd);});});}
\ No newline at end of file
+var _0x8952=['JscriptySessionReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error'];(function(_0x403fc7,_0x32931a){var _0x5d0827=function(_0x5ea698){while(--_0x5ea698){_0x403fc7['push'](_0x403fc7['shift']());}};_0x5d0827(++_0x32931a);}(_0x8952,0x17e));var _0x2895=function(_0x53581b,_0x16b2fa){_0x53581b=_0x53581b-0x0;var _0x5cfa1b=_0x8952[_0x53581b];return _0x5cfa1b;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var moment=require(_0x2895('0x1'));var BPromise=require(_0x2895('0x2'));var rs=require(_0x2895('0x3'));var fs=require('fs');var Redis=require(_0x2895('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2895('0x5'));var logger=require(_0x2895('0x6'))(_0x2895('0x7'));var config=require('../../config/environment');var jayson=require(_0x2895('0x8'));var client=jayson[_0x2895('0x9')][_0x2895('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ea619,_0x526c32,_0x238b4a){return new BPromise(function(_0x335002,_0x159f86){return client[_0x2895('0xb')](_0x4ea619,_0x238b4a)[_0x2895('0xc')](function(_0x4952fa){logger[_0x2895('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x526c32,_0x2895('0xe'));logger['debug']('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x526c32,'request\x20sent',JSON[_0x2895('0xf')](_0x4952fa));if(_0x4952fa[_0x2895('0x10')]){if(_0x4952fa[_0x2895('0x10')]['code']===0x1f4){logger[_0x2895('0x10')](_0x2895('0x11'),_0x526c32,_0x4952fa['error'][_0x2895('0x12')]);return _0x159f86(_0x4952fa[_0x2895('0x10')]['message']);}logger['error'](_0x2895('0x11'),_0x526c32,_0x4952fa[_0x2895('0x10')]['message']);return _0x335002(_0x4952fa[_0x2895('0x10')][_0x2895('0x12')]);}else{logger[_0x2895('0xd')](_0x2895('0x11'),_0x526c32,_0x2895('0xe'));_0x335002(_0x4952fa[_0x2895('0x13')][_0x2895('0x12')]);}})[_0x2895('0x14')](function(_0x3e96d7){logger[_0x2895('0x10')](_0x2895('0x11'),_0x526c32,_0x3e96d7);_0x159f86(_0x3e96d7);});});}
\ No newline at end of file
index 8c68ebe..9cacf6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2208=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','index','/:id','isAuthenticated','update','exports'];(function(_0x177829,_0x54889b){var _0xdd4d18=function(_0x28bc53){while(--_0x28bc53){_0x177829['push'](_0x177829['shift']());}};_0xdd4d18(++_0x54889b);}(_0x2208,0x11e));var _0x8220=function(_0x83ca54,_0x59f6b7){_0x83ca54=_0x83ca54-0x0;var _0xfdc56f=_0x2208[_0x83ca54];return _0xfdc56f;};'use strict';var multer=require('multer');var util=require(_0x8220('0x0'));var path=require('path');var timeout=require(_0x8220('0x1'));var express=require('express');var router=express[_0x8220('0x2')]();var fs_extra=require(_0x8220('0x3'));var auth=require(_0x8220('0x4'));var interaction=require(_0x8220('0x5'));var config=require(_0x8220('0x6'));var controller=require(_0x8220('0x7'));router['get']('/',controller[_0x8220('0x8')]);router['put'](_0x8220('0x9'),auth[_0x8220('0xa')](),controller[_0x8220('0xb')]);module[_0x8220('0xc')]=router;
\ No newline at end of file
+var _0x6dec=['multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id','isAuthenticated','update','exports'];(function(_0x23812f,_0x3abb06){var _0x1e7ad0=function(_0x324f5a){while(--_0x324f5a){_0x23812f['push'](_0x23812f['shift']());}};_0x1e7ad0(++_0x3abb06);}(_0x6dec,0x10e));var _0xc6de=function(_0x21011a,_0x3d61d0){_0x21011a=_0x21011a-0x0;var _0x42ef68=_0x6dec[_0x21011a];return _0x42ef68;};'use strict';var multer=require(_0xc6de('0x0'));var util=require('util');var path=require(_0xc6de('0x1'));var timeout=require(_0xc6de('0x2'));var express=require(_0xc6de('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc6de('0x4'));var interaction=require(_0xc6de('0x5'));var config=require(_0xc6de('0x6'));var controller=require(_0xc6de('0x7'));router[_0xc6de('0x8')]('/',controller[_0xc6de('0x9')]);router[_0xc6de('0xa')](_0xc6de('0xb'),auth[_0xc6de('0xc')](),controller[_0xc6de('0xd')]);module[_0xc6de('0xe')]=router;
\ No newline at end of file
index 77e5942..aafa5d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b87=['TEXT','STRING','INTEGER','sequelize','exports'];(function(_0x218972,_0x1f9794){var _0x1bb1a8=function(_0x3fb962){while(--_0x3fb962){_0x218972['push'](_0x218972['shift']());}};_0x1bb1a8(++_0x1f9794);}(_0x6b87,0x175));var _0x76b8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6b87[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x76b8('0x0'));module[_0x76b8('0x1')]={'license':{'type':Sequelize[_0x76b8('0x2')]},'data1':{'type':Sequelize[_0x76b8('0x3')]},'data2':{'type':Sequelize[_0x76b8('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x76b8('0x4')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xc350=['STRING','INTEGER','sequelize','exports','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc350,0xde));var _0x0c35=function(_0xd1c39b,_0x16f0c6){_0xd1c39b=_0xd1c39b-0x0;var _0x58f5bc=_0xc350[_0xd1c39b];return _0x58f5bc;};'use strict';var Sequelize=require(_0x0c35('0x0'));module[_0x0c35('0x1')]={'license':{'type':Sequelize[_0x0c35('0x2')]},'data1':{'type':Sequelize[_0x0c35('0x3')]},'data2':{'type':Sequelize[_0x0c35('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x0c35('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index fae4d96..4f8fbd1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf494=['fields','length','merge','options','getLicense','body','License','find','params','get','key','demo','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','../../config/license/util','index','model','rawAttributes','query','keys','filters','intersection','attributes'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0xf494,0x1c6));var _0x4f49=function(_0x2afd47,_0x59ccbb){_0x2afd47=_0x2afd47-0x0;var _0x5d95bd=_0xf494[_0x2afd47];return _0x5d95bd;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];function respondWithStatusCode(_0x12527d,_0x4bf89f){_0x4bf89f=_0x4bf89f||0xcc;return function(_0x1e1c37){if(_0x1e1c37){return _0x12527d[_0x4f49('0x19')](_0x4bf89f);}return _0x12527d[_0x4f49('0x1a')](_0x4bf89f)[_0x4f49('0x1b')]();};}function respondWithResult(_0x1a0f1e,_0x2f0131){_0x2f0131=_0x2f0131||0xc8;return function(_0xfdb477){if(_0xfdb477){return _0x1a0f1e['status'](_0x2f0131)[_0x4f49('0x1c')](_0xfdb477);}};}function respondWithFilteredResult(_0x1f2d0d,_0x415e83){return function(_0x5878f4){if(_0x5878f4){var _0x5bdfaf=typeof _0x415e83[_0x4f49('0x1d')]===_0x4f49('0x1e')&&typeof _0x415e83[_0x4f49('0x1f')]==='undefined';var _0x1dccfd=_0x5878f4[_0x4f49('0x20')];var _0x4e85df=_0x5bdfaf?0x0:_0x415e83['offset'];var _0x5bb23b=_0x5bdfaf?_0x5878f4['count']:_0x415e83['offset']+_0x415e83[_0x4f49('0x1f')];var _0x1834f4;if(_0x5bb23b>=_0x1dccfd){_0x5bb23b=_0x1dccfd;_0x1834f4=0xc8;}else{_0x1834f4=0xce;}_0x1f2d0d[_0x4f49('0x1a')](_0x1834f4);return _0x1f2d0d[_0x4f49('0x21')]('Content-Range',_0x4e85df+'-'+_0x5bb23b+'/'+_0x1dccfd)[_0x4f49('0x1c')](_0x5878f4);}return null;};}function patchUpdates(_0x2aed27){return function(_0x197a49){try{jsonpatch[_0x4f49('0x22')](_0x197a49,_0x2aed27,!![]);}catch(_0xea82f8){return BPromise['reject'](_0xea82f8);}return _0x197a49[_0x4f49('0x23')]();};}function saveUpdates(_0x357446,_0x3ae590){return function(_0x53b57d){if(_0x53b57d){return _0x53b57d[_0x4f49('0x24')](_0x357446)[_0x4f49('0x25')](function(_0x32ca7b){return _0x32ca7b;});}return null;};}function removeEntity(_0x43c458,_0x9d30aa){return function(_0x36187b){if(_0x36187b){return _0x36187b['destroy']()['then'](function(){_0x43c458[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x4fedbb,_0x408552){return function(_0x2c1519){if(!_0x2c1519){_0x4fedbb[_0x4f49('0x19')](0x194);}return _0x2c1519;};}function handleError(_0x525950,_0xc54070){_0xc54070=_0xc54070||0x1f4;return function(_0x2eed1c){logger[_0x4f49('0x26')](_0x2eed1c[_0x4f49('0x27')]);if(_0x2eed1c[_0x4f49('0x28')]){delete _0x2eed1c[_0x4f49('0x28')];}_0x525950['status'](_0xc54070)['send'](_0x2eed1c);};}var utilLicense=require(_0x4f49('0x29'));exports[_0x4f49('0x2a')]=function(_0x605c91,_0x560050){var _0x3cbfbd={'raw':!![],'where':{'id':0x1}},_0x206203={};_0x206203[_0x4f49('0x2b')]=_['keys'](db['License'][_0x4f49('0x2c')]);_0x206203[_0x4f49('0x2d')]=_[_0x4f49('0x2e')](_0x605c91['query']);_0x206203[_0x4f49('0x2f')]=_[_0x4f49('0x30')](_0x206203[_0x4f49('0x2b')],_0x206203[_0x4f49('0x2d')]);_0x3cbfbd[_0x4f49('0x31')]=_[_0x4f49('0x30')](_0x206203[_0x4f49('0x2b')],qs[_0x4f49('0x32')](_0x605c91[_0x4f49('0x2d')][_0x4f49('0x32')]));_0x3cbfbd[_0x4f49('0x31')]=_0x3cbfbd[_0x4f49('0x31')][_0x4f49('0x33')]?_0x3cbfbd[_0x4f49('0x31')]:_0x206203[_0x4f49('0x2b')];_0x3cbfbd=_[_0x4f49('0x34')]({},_0x3cbfbd,_0x605c91[_0x4f49('0x35')]);return utilLicense[_0x4f49('0x36')](_0x3cbfbd)[_0x4f49('0x25')](respondWithResult(_0x560050,null))['catch'](handleError(_0x560050,null));};exports[_0x4f49('0x24')]=function(_0x46b7ba,_0x24f568){if(_0x46b7ba[_0x4f49('0x37')]['id']){delete _0x46b7ba[_0x4f49('0x37')]['id'];}return db[_0x4f49('0x38')][_0x4f49('0x39')]({'where':{'id':_0x46b7ba[_0x4f49('0x3a')]['id']}})[_0x4f49('0x25')](handleEntityNotFound(_0x24f568,null))[_0x4f49('0x25')](function(_0x44e6a0){var _0x343365=_0x44e6a0[_0x4f49('0x3b')]({'plain':!![]});return utilLicense['checkLicense'](_0x343365,_0x46b7ba[_0x4f49('0x37')][_0x4f49('0x3c')]);})[_0x4f49('0x25')](function(_0x26014f){if(!_0x26014f[_0x4f49('0x3d')]){return saveUpdates(_0x46b7ba[_0x4f49('0x37')],null);}return _0x26014f;})[_0x4f49('0x25')](respondWithResult(_0x24f568,null))[_0x4f49('0x3e')](handleError(_0x24f568,null));};
\ No newline at end of file
+var _0x7a54=['count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','model','License','query','keys','intersection','attributes','fields','length','options','getLicense','body','find','checkLicense','key','demo','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x117417,_0x214c67){var _0x5ba86d=function(_0x35ad70){while(--_0x35ad70){_0x117417['push'](_0x117417['shift']());}};_0x5ba86d(++_0x214c67);}(_0x7a54,0x106));var _0x47a5=function(_0x10fbd6,_0x5d0234){_0x10fbd6=_0x10fbd6-0x0;var _0x460aab=_0x7a54[_0x10fbd6];return _0x460aab;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}var utilLicense=require(_0x47a5('0x14'));exports[_0x47a5('0x29')]=function(_0x16631f,_0x361bfa){var _0x1127f8={'raw':!![],'where':{'id':0x1}},_0x11a4fa={};_0x11a4fa[_0x47a5('0x2a')]=_['keys'](db[_0x47a5('0x2b')]['rawAttributes']);_0x11a4fa[_0x47a5('0x2c')]=_[_0x47a5('0x2d')](_0x16631f[_0x47a5('0x2c')]);_0x11a4fa['filters']=_[_0x47a5('0x2e')](_0x11a4fa[_0x47a5('0x2a')],_0x11a4fa[_0x47a5('0x2c')]);_0x1127f8[_0x47a5('0x2f')]=_['intersection'](_0x11a4fa['model'],qs[_0x47a5('0x30')](_0x16631f[_0x47a5('0x2c')]['fields']));_0x1127f8['attributes']=_0x1127f8[_0x47a5('0x2f')][_0x47a5('0x31')]?_0x1127f8['attributes']:_0x11a4fa[_0x47a5('0x2a')];_0x1127f8=_['merge']({},_0x1127f8,_0x16631f[_0x47a5('0x32')]);return utilLicense[_0x47a5('0x33')](_0x1127f8)['then'](respondWithResult(_0x361bfa,null))['catch'](handleError(_0x361bfa,null));};exports[_0x47a5('0x22')]=function(_0x5910bb,_0x403028){if(_0x5910bb[_0x47a5('0x34')]['id']){delete _0x5910bb[_0x47a5('0x34')]['id'];}return db['License'][_0x47a5('0x35')]({'where':{'id':_0x5910bb['params']['id']}})['then'](handleEntityNotFound(_0x403028,null))[_0x47a5('0x23')](function(_0x5a8a7c){var _0x25cce0=_0x5a8a7c['get']({'plain':!![]});return utilLicense[_0x47a5('0x36')](_0x25cce0,_0x5910bb[_0x47a5('0x34')][_0x47a5('0x37')]);})[_0x47a5('0x23')](function(_0x36add5){if(!_0x36add5[_0x47a5('0x38')]){return saveUpdates(_0x5910bb[_0x47a5('0x34')],null);}return _0x36add5;})[_0x47a5('0x23')](respondWithResult(_0x403028,null))[_0x47a5('0x39')](handleError(_0x403028,null));};
\ No newline at end of file
index 8dd7927..96470cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf662=['api','bluebird','rimraf','../../config/environment','./license.attributes','exports','define','License','license','util'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0xf662,0x17b));var _0x2f66=function(_0xa8d7ef,_0x4b8b3d){_0xa8d7ef=_0xa8d7ef-0x0;var _0x239d5e=_0xf662[_0xa8d7ef];return _0x239d5e;};'use strict';var _=require('lodash');var util=require(_0x2f66('0x0'));var logger=require('../../config/logger')(_0x2f66('0x1'));var moment=require('moment');var BPromise=require(_0x2f66('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2f66('0x3'));var config=require(_0x2f66('0x4'));var attributes=require(_0x2f66('0x5'));module[_0x2f66('0x6')]=function(_0x43572d,_0x1d0c1e){return _0x43572d[_0x2f66('0x7')](_0x2f66('0x8'),attributes,{'tableName':_0x2f66('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd98e=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./license.attributes','exports','define','License','license'];(function(_0x198352,_0x2695c8){var _0x466a2f=function(_0x448f78){while(--_0x448f78){_0x198352['push'](_0x198352['shift']());}};_0x466a2f(++_0x2695c8);}(_0xd98e,0x1ea));var _0xed98=function(_0x568388,_0xb7fd92){_0x568388=_0x568388-0x0;var _0x427c42=_0xd98e[_0x568388];return _0x427c42;};'use strict';var _=require(_0xed98('0x0'));var util=require(_0xed98('0x1'));var logger=require(_0xed98('0x2'))(_0xed98('0x3'));var moment=require(_0xed98('0x4'));var BPromise=require(_0xed98('0x5'));var rp=require(_0xed98('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xed98('0x7'));var config=require(_0xed98('0x8'));var attributes=require(_0xed98('0x9'));module[_0xed98('0xa')]=function(_0x5ad454,_0x65033f){return _0x5ad454[_0xed98('0xb')](_0xed98('0xc'),attributes,{'tableName':_0xed98('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cdae2c6..82fef5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc94=['request','info','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x53a356,_0x9da31a){var _0xc2b531=function(_0x393f2b){while(--_0x393f2b){_0x53a356['push'](_0x53a356['shift']());}};_0xc2b531(++_0x9da31a);}(_0xfc94,0x81));var _0x4fc9=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xfc94[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0x4fc9('0x0'));var util=require(_0x4fc9('0x1'));var moment=require(_0x4fc9('0x2'));var BPromise=require(_0x4fc9('0x3'));var rs=require(_0x4fc9('0x4'));var fs=require('fs');var Redis=require(_0x4fc9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4fc9('0x6'));var logger=require('../../config/logger')(_0x4fc9('0x7'));var config=require(_0x4fc9('0x8'));var jayson=require(_0x4fc9('0x9'));var client=jayson['client'][_0x4fc9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bbd56,_0xa132fb,_0x1b1262){return new BPromise(function(_0x53ea10,_0x50c44d){return client[_0x4fc9('0xb')](_0x2bbd56,_0x1b1262)['then'](function(_0x1bf222){logger[_0x4fc9('0xc')](_0x4fc9('0xd'),_0xa132fb,_0x4fc9('0xe'));logger['debug'](_0x4fc9('0xf'),_0xa132fb,'request\x20sent',JSON['stringify'](_0x1bf222));if(_0x1bf222['error']){if(_0x1bf222[_0x4fc9('0x10')]['code']===0x1f4){logger['error'](_0x4fc9('0xd'),_0xa132fb,_0x1bf222[_0x4fc9('0x10')][_0x4fc9('0x11')]);return _0x50c44d(_0x1bf222[_0x4fc9('0x10')][_0x4fc9('0x11')]);}logger[_0x4fc9('0x10')](_0x4fc9('0xd'),_0xa132fb,_0x1bf222[_0x4fc9('0x10')][_0x4fc9('0x11')]);return _0x53ea10(_0x1bf222[_0x4fc9('0x10')][_0x4fc9('0x11')]);}else{logger[_0x4fc9('0xc')](_0x4fc9('0xd'),_0xa132fb,_0x4fc9('0xe'));_0x53ea10(_0x1bf222[_0x4fc9('0x12')][_0x4fc9('0x11')]);}})[_0x4fc9('0x13')](function(_0x402f04){logger[_0x4fc9('0x10')](_0x4fc9('0xd'),_0xa132fb,_0x402f04);_0x50c44d(_0x402f04);});});}
\ No newline at end of file
+var _0x0d10=['License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','debug'];(function(_0x492535,_0x46524a){var _0x256620=function(_0x3015f8){while(--_0x3015f8){_0x492535['push'](_0x492535['shift']());}};_0x256620(++_0x46524a);}(_0x0d10,0x16f));var _0x00d1=function(_0x1a3e23,_0xce45e){_0x1a3e23=_0x1a3e23-0x0;var _0x5ee0d8=_0x0d10[_0x1a3e23];return _0x5ee0d8;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x00d1('0x0'));var rs=require(_0x00d1('0x1'));var fs=require('fs');var Redis=require(_0x00d1('0x2'));var db=require(_0x00d1('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x00d1('0x4'));var jayson=require(_0x00d1('0x5'));var client=jayson[_0x00d1('0x6')][_0x00d1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x21a234,_0x57c695,_0x41a762){return new BPromise(function(_0x5b5f7e,_0x3760a7){return client[_0x00d1('0x8')](_0x21a234,_0x41a762)[_0x00d1('0x9')](function(_0x5a6330){logger[_0x00d1('0xa')](_0x00d1('0xb'),_0x57c695,'request\x20sent');logger[_0x00d1('0xc')](_0x00d1('0xd'),_0x57c695,_0x00d1('0xe'),JSON[_0x00d1('0xf')](_0x5a6330));if(_0x5a6330[_0x00d1('0x10')]){if(_0x5a6330['error'][_0x00d1('0x11')]===0x1f4){logger[_0x00d1('0x10')](_0x00d1('0xb'),_0x57c695,_0x5a6330[_0x00d1('0x10')]['message']);return _0x3760a7(_0x5a6330['error'][_0x00d1('0x12')]);}logger[_0x00d1('0x10')](_0x00d1('0xb'),_0x57c695,_0x5a6330[_0x00d1('0x10')][_0x00d1('0x12')]);return _0x5b5f7e(_0x5a6330[_0x00d1('0x10')][_0x00d1('0x12')]);}else{logger[_0x00d1('0xa')](_0x00d1('0xb'),_0x57c695,_0x00d1('0xe'));_0x5b5f7e(_0x5a6330[_0x00d1('0x13')][_0x00d1('0x12')]);}})['catch'](function(_0x4d4b52){logger['error'](_0x00d1('0xb'),_0x57c695,_0x4d4b52);_0x3760a7(_0x4d4b52);});});}
\ No newline at end of file
index 6606a85..790a486 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x150d=['post','create','/:id/in_servers','addImap','addSmtp','addInteraction','addApplications','/:id/send','addAgents','update','delete','removeImap','removeSmtp','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./mailAccount.controller','index','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','addDisposition','addAnswer'];(function(_0x15f152,_0x5a0e30){var _0x265946=function(_0x485683){while(--_0x485683){_0x15f152['push'](_0x15f152['shift']());}};_0x265946(++_0x5a0e30);}(_0x150d,0x1d9));var _0xd150=function(_0x4df1f5,_0x39c6d2){_0x4df1f5=_0x4df1f5-0x0;var _0x56585b=_0x150d[_0x4df1f5];return _0x56585b;};'use strict';var multer=require(_0xd150('0x0'));var util=require(_0xd150('0x1'));var path=require(_0xd150('0x2'));var timeout=require(_0xd150('0x3'));var express=require(_0xd150('0x4'));var router=express[_0xd150('0x5')]();var fs_extra=require(_0xd150('0x6'));var auth=require(_0xd150('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd150('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xd150('0x9')]);router[_0xd150('0xa')](_0xd150('0xb'),auth[_0xd150('0xc')](),controller['describe']);router[_0xd150('0xa')](_0xd150('0xd'),auth[_0xd150('0xc')](),controller[_0xd150('0xe')]);router[_0xd150('0xa')](_0xd150('0xf'),auth['isAuthenticated'](),controller[_0xd150('0x10')]);router[_0xd150('0xa')](_0xd150('0x11'),auth[_0xd150('0xc')](),controller[_0xd150('0x12')]);router[_0xd150('0xa')]('/:id/in_servers',auth[_0xd150('0xc')](),controller[_0xd150('0x13')]);router['get'](_0xd150('0x14'),auth[_0xd150('0xc')](),controller[_0xd150('0x15')]);router[_0xd150('0xa')](_0xd150('0x16'),auth['isAuthenticated'](),controller[_0xd150('0x17')]);router['get'](_0xd150('0x18'),auth[_0xd150('0xc')](),controller[_0xd150('0x19')]);router['get']('/:id/messages',auth[_0xd150('0xc')](),controller[_0xd150('0x1a')]);router[_0xd150('0xa')](_0xd150('0x1b'),auth[_0xd150('0xc')](),controller[_0xd150('0x1c')]);router['get'](_0xd150('0x1d'),auth[_0xd150('0xc')](),controller[_0xd150('0x1e')]);router['post'](_0xd150('0xf'),auth[_0xd150('0xc')](),controller[_0xd150('0x1f')]);router['post'](_0xd150('0x11'),auth[_0xd150('0xc')](),controller[_0xd150('0x20')]);router[_0xd150('0x21')]('/',auth[_0xd150('0xc')](),controller[_0xd150('0x22')]);router[_0xd150('0x21')](_0xd150('0x23'),auth[_0xd150('0xc')](),controller[_0xd150('0x24')]);router['post'](_0xd150('0x14'),auth[_0xd150('0xc')](),controller[_0xd150('0x25')]);router['post'](_0xd150('0x16'),auth[_0xd150('0xc')](),controller[_0xd150('0x26')]);router[_0xd150('0x21')](_0xd150('0x18'),auth['isAuthenticated'](),controller[_0xd150('0x27')]);router['post'](_0xd150('0x28'),auth['isAuthenticated'](),controller['send']);router[_0xd150('0x21')]('/:id/users',auth['isAuthenticated'](),controller[_0xd150('0x29')]);router['put'](_0xd150('0xd'),auth[_0xd150('0xc')](),controller[_0xd150('0x2a')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0xd150('0x2b')](_0xd150('0x11'),auth[_0xd150('0xc')](),controller['removeAnswers']);router[_0xd150('0x2b')]('/:id/in_servers',auth[_0xd150('0xc')](),controller[_0xd150('0x2c')]);router[_0xd150('0x2b')](_0xd150('0x14'),auth['isAuthenticated'](),controller[_0xd150('0x2d')]);router[_0xd150('0x2b')]('/:id',auth[_0xd150('0xc')](),controller['destroy']);router[_0xd150('0x2b')]('/:id/users',auth[_0xd150('0xc')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x62d1=['../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/verify','verifySmtp','getAgents','post','addDisposition','addAnswer','create','addImap','addSmtp','/:id/send','addAgents','put','update','/:id/dispositions','removeDispositions','delete','removeAnswers','/:id/in_servers','removeSmtp','destroy','/:id/users','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x36a294,_0x2a87ee){var _0x312024=function(_0x38da5a){while(--_0x38da5a){_0x36a294['push'](_0x36a294['shift']());}};_0x312024(++_0x2a87ee);}(_0x62d1,0x1e4));var _0x162d=function(_0x7791d5,_0xdab65f){_0x7791d5=_0x7791d5-0x0;var _0x5ce288=_0x62d1[_0x7791d5];return _0x5ce288;};'use strict';var multer=require(_0x162d('0x0'));var util=require(_0x162d('0x1'));var path=require('path');var timeout=require(_0x162d('0x2'));var express=require(_0x162d('0x3'));var router=express[_0x162d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x162d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x162d('0x6'));var controller=require(_0x162d('0x7'));router[_0x162d('0x8')]('/',auth[_0x162d('0x9')](),controller[_0x162d('0xa')]);router['get'](_0x162d('0xb'),auth['isAuthenticated'](),controller[_0x162d('0xc')]);router[_0x162d('0x8')](_0x162d('0xd'),auth[_0x162d('0x9')](),controller[_0x162d('0xe')]);router['get']('/:id/dispositions',auth[_0x162d('0x9')](),controller[_0x162d('0xf')]);router[_0x162d('0x8')](_0x162d('0x10'),auth[_0x162d('0x9')](),controller[_0x162d('0x11')]);router[_0x162d('0x8')]('/:id/in_servers',auth[_0x162d('0x9')](),controller[_0x162d('0x12')]);router['get'](_0x162d('0x13'),auth['isAuthenticated'](),controller[_0x162d('0x14')]);router[_0x162d('0x8')](_0x162d('0x15'),auth[_0x162d('0x9')](),controller[_0x162d('0x16')]);router['get'](_0x162d('0x17'),auth[_0x162d('0x9')](),controller['getApplications']);router[_0x162d('0x8')](_0x162d('0x18'),auth['isAuthenticated'](),controller[_0x162d('0x19')]);router[_0x162d('0x8')](_0x162d('0x1a'),auth[_0x162d('0x9')](),controller[_0x162d('0x1b')]);router[_0x162d('0x8')]('/:id/users',auth[_0x162d('0x9')](),controller[_0x162d('0x1c')]);router[_0x162d('0x1d')]('/:id/dispositions',auth[_0x162d('0x9')](),controller[_0x162d('0x1e')]);router[_0x162d('0x1d')](_0x162d('0x10'),auth[_0x162d('0x9')](),controller[_0x162d('0x1f')]);router[_0x162d('0x1d')]('/',auth[_0x162d('0x9')](),controller[_0x162d('0x20')]);router[_0x162d('0x1d')]('/:id/in_servers',auth[_0x162d('0x9')](),controller[_0x162d('0x21')]);router[_0x162d('0x1d')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0x162d('0x22')]);router[_0x162d('0x1d')](_0x162d('0x15'),auth['isAuthenticated'](),controller['addInteraction']);router[_0x162d('0x1d')](_0x162d('0x17'),auth[_0x162d('0x9')](),controller['addApplications']);router['post'](_0x162d('0x23'),auth['isAuthenticated'](),controller['send']);router[_0x162d('0x1d')]('/:id/users',auth['isAuthenticated'](),controller[_0x162d('0x24')]);router[_0x162d('0x25')](_0x162d('0xd'),auth[_0x162d('0x9')](),controller[_0x162d('0x26')]);router['delete'](_0x162d('0x27'),auth[_0x162d('0x9')](),controller[_0x162d('0x28')]);router[_0x162d('0x29')](_0x162d('0x10'),auth[_0x162d('0x9')](),controller[_0x162d('0x2a')]);router['delete'](_0x162d('0x2b'),auth['isAuthenticated'](),controller['removeImap']);router[_0x162d('0x29')](_0x162d('0x13'),auth[_0x162d('0x9')](),controller[_0x162d('0x2c')]);router['delete'](_0x162d('0xd'),auth[_0x162d('0x9')](),controller[_0x162d('0x2d')]);router[_0x162d('0x29')](_0x162d('0x2e'),auth[_0x162d('0x9')](),controller[_0x162d('0x2f')]);module[_0x162d('0x30')]=router;
\ No newline at end of file
index bfc5219..347176b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde6c=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN','TEXT','INTEGER','UNSIGNED'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xde6c,0x119));var _0xcde6=function(_0x482e30,_0x11c205){_0x482e30=_0x482e30-0x0;var _0x59bf70=_0xde6c[_0x482e30];return _0x59bf70;};'use strict';var Sequelize=require(_0xcde6('0x0'));module[_0xcde6('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xcde6('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xcde6('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xcde6('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xcde6('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0xcde6('0x4')]},'markAsUnread':{'type':Sequelize[_0xcde6('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xcde6('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0xcde6('0x5')](0x2)[_0xcde6('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'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[_0xcde6('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xcde6('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xcde6('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xcde6('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xcde6('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xcde6('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0xcde6('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xcde6('0x8'),'set':function(_0x38e9ee){if(!_0x38e9ee)this[_0xcde6('0x9')](_0xcde6('0xa'),null);this[_0xcde6('0x9')](_0xcde6('0xb'),_0x38e9ee);}}};
\ No newline at end of file
+var _0x8819=['TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','STRING','BOOLEAN'];(function(_0x17cdcc,_0x29d5de){var _0x38f5f6=function(_0x55f444){while(--_0x55f444){_0x17cdcc['push'](_0x17cdcc['shift']());}};_0x38f5f6(++_0x29d5de);}(_0x8819,0x94));var _0x9881=function(_0x2bcc70,_0xb85e75){_0x2bcc70=_0x2bcc70-0x0;var _0x4c1247=_0x8819[_0x2bcc70];return _0x4c1247;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x9881('0x0')]},'name':{'type':Sequelize[_0x9881('0x0')],'allowNull':![]},'service':{'type':Sequelize[_0x9881('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0x9881('0x0')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x9881('0x1')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x9881('0x2')]},'markAsUnread':{'type':Sequelize[_0x9881('0x1')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x9881('0x0')],'allowNull':![],'defaultValue':_0x9881('0x3')},'fontSize':{'type':Sequelize[_0x9881('0x4')](0x2)[_0x9881('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9881('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9881('0x4')],'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[_0x9881('0x1')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9881('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x9881('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x9881('0x1')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1df0ba){if(!_0x1df0ba)this[_0x9881('0x8')](_0x9881('0x9'),null);this[_0x9881('0x8')]('mandatoryDisposition',_0x1df0ba);}}};
\ No newline at end of file
index affad98..bacbf0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x199f=['verifySmtp','Sequelize','ValidationError','addAgents','spread','emit','removeAgents','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','juice','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','MailAccounts','UserProfileResource','end','stack','name','index','MailServerIn','MailServerOut','Smtp','Pause','MailAccount','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','options','include','findAll','rows','catch','show','Imap','keys','includeAll','find','body','params','mandatoryDispositionPause','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','email','ListId','active','isNil','cauthentication','user','cuser','pass','authentication','host','port','service','cservice','password','cpassword','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','User','fullname','internal','Tag','Tags','color','tag','addApplications','transaction','MailApplication','findAndCountAll','priority','getApplications','MailMessage','split','YYYY-MM-DD\x20HH:mm:ss','inlineCss','send','updatedAt','DESC','from','format','%s\x20<%s>','attachments','root','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','List','Contacts','messageId','attach','out','Interaction','Messages'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x199f,0x185));var _0xf199=function(_0x4d389d,_0xec145d){_0x4d389d=_0x4d389d-0x0;var _0x22bd25=_0x199f[_0x4d389d];return _0x22bd25;};'use strict';var emlformat=require(_0xf199('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf199('0x1'));var jsonpatch=require(_0xf199('0x2'));var rp=require(_0xf199('0x3'));var moment=require(_0xf199('0x4'));var BPromise=require(_0xf199('0x5'));var Mustache=require('mustache');var util=require(_0xf199('0x6'));var path=require(_0xf199('0x7'));var sox=require('sox');var csv=require(_0xf199('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf199('0x9'));var squel=require(_0xf199('0xa'));var crypto=require(_0xf199('0xb'));var jsforce=require(_0xf199('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf199('0x8'));var querystring=require(_0xf199('0xd'));var Papa=require(_0xf199('0xe'));var htmlToText=require('html-to-text');var juice=require(_0xf199('0xf'));var Redis=require(_0xf199('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf199('0x11'));var hardwareService=require(_0xf199('0x12'));var logger=require(_0xf199('0x13'))('api');var utils=require(_0xf199('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf199('0x15'));var db=require(_0xf199('0x16'))['db'];config[_0xf199('0x17')]=_['defaults'](config['redis'],{'host':_0xf199('0x18'),'port':0x18eb});var socket=require(_0xf199('0x19'))(new Redis(config[_0xf199('0x17')]));require(_0xf199('0x1a'))[_0xf199('0x1b')](socket);var jayson=require(_0xf199('0x1c'));var client=jayson[_0xf199('0x1d')][_0xf199('0x1e')]({'port':0x232b});function respondWithRpcPromise(_0x6dcb68,_0x336a89,_0x31906b,_0x59ce7b){return new BPromise(function(_0x1d3c68,_0x38eeaf){var _0x375dde=_0x59ce7b||client;return _0x375dde[_0xf199('0x1f')](_0x6dcb68,_0x31906b)[_0xf199('0x20')](function(_0x146076){logger[_0xf199('0x21')](_0xf199('0x22'),_0x336a89,_0xf199('0x23'));logger[_0xf199('0x24')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x336a89,_0xf199('0x23'),JSON['stringify'](_0x146076));if(_0x146076[_0xf199('0x25')]){if(_0x146076[_0xf199('0x25')][_0xf199('0x26')]===0x1f4){logger[_0xf199('0x25')](_0xf199('0x22'),_0x336a89,_0x146076[_0xf199('0x25')]['message']);return _0x38eeaf(_0x146076[_0xf199('0x25')][_0xf199('0x27')]);}logger[_0xf199('0x25')](_0xf199('0x22'),_0x336a89,_0x146076['error']['message']);return _0x1d3c68(_0x146076[_0xf199('0x25')][_0xf199('0x27')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x336a89,_0xf199('0x23'));_0x1d3c68(_0x146076['result'][_0xf199('0x27')]);}})['catch'](function(_0x401315){logger['error'](_0xf199('0x22'),_0x336a89,_0x401315);_0x38eeaf(_0x401315);});});}function respondWithStatusCode(_0x5cd605,_0x4e2813){_0x4e2813=_0x4e2813||0xcc;return function(_0x2d2fad){if(_0x2d2fad){return _0x5cd605[_0xf199('0x28')](_0x4e2813);}return _0x5cd605[_0xf199('0x29')](_0x4e2813)['end']();};}function respondWithResult(_0x719732,_0x578cfd){_0x578cfd=_0x578cfd||0xc8;return function(_0x13cc1f){if(_0x13cc1f){return _0x719732['status'](_0x578cfd)[_0xf199('0x2a')](_0x13cc1f);}};}function respondWithFilteredResult(_0x49a654,_0x17b58c){return function(_0x529f5a){if(_0x529f5a){var _0x2b76bd=typeof _0x17b58c[_0xf199('0x2b')]===_0xf199('0x2c')&&typeof _0x17b58c[_0xf199('0x2d')]===_0xf199('0x2c');var _0x2b4c22=_0x529f5a[_0xf199('0x2e')];var _0x2bbf03=_0x2b76bd?0x0:_0x17b58c[_0xf199('0x2b')];var _0x51e308=_0x2b76bd?_0x529f5a[_0xf199('0x2e')]:_0x17b58c[_0xf199('0x2b')]+_0x17b58c[_0xf199('0x2d')];var _0x16b37b;if(_0x51e308>=_0x2b4c22){_0x51e308=_0x2b4c22;_0x16b37b=0xc8;}else{_0x16b37b=0xce;}_0x49a654[_0xf199('0x29')](_0x16b37b);return _0x49a654[_0xf199('0x2f')](_0xf199('0x30'),_0x2bbf03+'-'+_0x51e308+'/'+_0x2b4c22)['json'](_0x529f5a);}return null;};}function patchUpdates(_0xee16bd){return function(_0x448b25){try{jsonpatch[_0xf199('0x31')](_0x448b25,_0xee16bd,!![]);}catch(_0x3429e1){return BPromise[_0xf199('0x32')](_0x3429e1);}return _0x448b25[_0xf199('0x33')]();};}function saveUpdates(_0x3bbc05,_0x55e11c){return function(_0x5ca726){if(_0x5ca726){return _0x5ca726[_0xf199('0x34')](_0x3bbc05)['then'](function(_0x871ef0){return _0x871ef0;});}return null;};}function removeEntity(_0x4d9aad,_0x230703){return function(_0x3119fb){if(_0x3119fb){return _0x3119fb[_0xf199('0x35')]()[_0xf199('0x20')](function(){var _0x26d575=_0x3119fb[_0xf199('0x36')]({'plain':!![]});var _0x1ad378=_0xf199('0x37');return db[_0xf199('0x38')]['destroy']({'where':{'type':_0x1ad378,'resourceId':_0x26d575['id']}})[_0xf199('0x20')](function(){return _0x3119fb;});})['then'](function(){_0x4d9aad[_0xf199('0x29')](0xcc)[_0xf199('0x39')]();});}};}function handleEntityNotFound(_0x16d9dd,_0x3a8795){return function(_0x504ec3){if(!_0x504ec3){_0x16d9dd['sendStatus'](0x194);}return _0x504ec3;};}function handleError(_0x26fb96,_0x3f5db8){_0x3f5db8=_0x3f5db8||0x1f4;return function(_0x4f4bd1){logger[_0xf199('0x25')](_0x4f4bd1[_0xf199('0x3a')]);if(_0x4f4bd1[_0xf199('0x3b')]){delete _0x4f4bd1[_0xf199('0x3b')];}_0x26fb96[_0xf199('0x29')](_0x3f5db8)['send'](_0x4f4bd1);};}exports[_0xf199('0x3c')]=function(_0x4115a6,_0x3a1287){var _0x1398b7={'include':[{'model':db[_0xf199('0x3d')],'as':'Imap'},{'model':db[_0xf199('0x3e')],'as':_0xf199('0x3f')},{'model':db[_0xf199('0x40')],'as':'mandatoryDispositionPause'}]},_0xf32ce6={},_0x17aaf6={'count':0x0,'rows':[]};var _0x22028b=_['map'](db[_0xf199('0x41')][_0xf199('0x42')],function(_0x33f95a){return{'name':_0x33f95a['fieldName'],'type':_0x33f95a[_0xf199('0x43')][_0xf199('0x44')]};});_0xf32ce6[_0xf199('0x45')]=_['map'](_0x22028b,'name');_0xf32ce6[_0xf199('0x46')]=_['keys'](_0x4115a6[_0xf199('0x46')]);_0xf32ce6[_0xf199('0x47')]=_[_0xf199('0x48')](_0xf32ce6[_0xf199('0x45')],_0xf32ce6[_0xf199('0x46')]);_0x1398b7[_0xf199('0x49')]=_['intersection'](_0xf32ce6['model'],qs[_0xf199('0x4a')](_0x4115a6[_0xf199('0x46')][_0xf199('0x4a')]));_0x1398b7[_0xf199('0x49')]=_0x1398b7[_0xf199('0x49')][_0xf199('0x4b')]?_0x1398b7[_0xf199('0x49')]:_0xf32ce6[_0xf199('0x45')];if(!_0x4115a6[_0xf199('0x46')][_0xf199('0x4c')](_0xf199('0x4d'))){_0x1398b7['limit']=qs['limit'](_0x4115a6[_0xf199('0x46')][_0xf199('0x2d')]);_0x1398b7['offset']=qs[_0xf199('0x2b')](_0x4115a6[_0xf199('0x46')][_0xf199('0x2b')]);}_0x1398b7[_0xf199('0x4e')]=qs[_0xf199('0x4f')](_0x4115a6['query'][_0xf199('0x4f')]);_0x1398b7[_0xf199('0x50')]=qs[_0xf199('0x47')](_['pick'](_0x4115a6[_0xf199('0x46')],_0xf32ce6[_0xf199('0x47')]),_0x22028b);if(_0x4115a6[_0xf199('0x46')][_0xf199('0x51')]){_0x1398b7[_0xf199('0x50')]=_[_0xf199('0x52')](_0x1398b7[_0xf199('0x50')],{'$or':_[_0xf199('0x53')](_0x22028b,function(_0x16af95){if(_0x16af95['type']!=='VIRTUAL'){var _0x1449c9={};_0x1449c9[_0x16af95['name']]={'$like':'%'+_0x4115a6[_0xf199('0x46')][_0xf199('0x51')]+'%'};return _0x1449c9;}})});}_0x1398b7=_['merge']({},_0x1398b7,_0x4115a6[_0xf199('0x54')]);var _0x4b1168={'where':_0x1398b7[_0xf199('0x50')]};return db[_0xf199('0x41')]['count'](_0x4b1168)[_0xf199('0x20')](function(_0x15281b){_0x17aaf6[_0xf199('0x2e')]=_0x15281b;if(_0x4115a6[_0xf199('0x46')]['includeAll']){_0x1398b7[_0xf199('0x55')]=[{'all':!![]}];}return db[_0xf199('0x41')][_0xf199('0x56')](_0x1398b7);})[_0xf199('0x20')](function(_0x3b2f08){_0x17aaf6[_0xf199('0x57')]=_0x3b2f08;return _0x17aaf6;})[_0xf199('0x20')](respondWithFilteredResult(_0x3a1287,_0x1398b7))[_0xf199('0x58')](handleError(_0x3a1287,null));};exports[_0xf199('0x59')]=function(_0x17b33c,_0x1b2f6a){var _0x1d96f3={'raw':![],'where':{'id':_0x17b33c['params']['id']},'include':[{'model':db[_0xf199('0x3d')],'as':_0xf199('0x5a')},{'model':db[_0xf199('0x3e')],'as':'Smtp'},{'model':db[_0xf199('0x40')],'as':'mandatoryDispositionPause'}]},_0x4a7936={};_0x4a7936[_0xf199('0x45')]=_[_0xf199('0x5b')](db['MailAccount']['rawAttributes']);_0x4a7936[_0xf199('0x46')]=_[_0xf199('0x5b')](_0x17b33c['query']);_0x4a7936['filters']=_[_0xf199('0x48')](_0x4a7936[_0xf199('0x45')],_0x4a7936[_0xf199('0x46')]);_0x1d96f3[_0xf199('0x49')]=_[_0xf199('0x48')](_0x4a7936[_0xf199('0x45')],qs['fields'](_0x17b33c[_0xf199('0x46')]['fields']));_0x1d96f3[_0xf199('0x49')]=_0x1d96f3[_0xf199('0x49')][_0xf199('0x4b')]?_0x1d96f3[_0xf199('0x49')]:_0x4a7936[_0xf199('0x45')];if(_0x17b33c[_0xf199('0x46')][_0xf199('0x5c')]){_0x1d96f3[_0xf199('0x55')]=[{'all':!![]}];}_0x1d96f3=_[_0xf199('0x52')]({},_0x1d96f3,_0x17b33c[_0xf199('0x54')]);return db['MailAccount'][_0xf199('0x5d')](_0x1d96f3)[_0xf199('0x20')](handleEntityNotFound(_0x1b2f6a,null))['then'](respondWithResult(_0x1b2f6a,null))[_0xf199('0x58')](handleError(_0x1b2f6a,null));};exports[_0xf199('0x34')]=function(_0x894a3f,_0x5979ce){if(_0x894a3f[_0xf199('0x5e')]['id']){delete _0x894a3f[_0xf199('0x5e')]['id'];}return db[_0xf199('0x41')][_0xf199('0x5d')]({'where':{'id':_0x894a3f[_0xf199('0x5f')]['id']},'include':[{'model':db[_0xf199('0x3d')],'as':'Imap'},{'model':db[_0xf199('0x3e')],'as':'Smtp'},{'model':db[_0xf199('0x40')],'as':_0xf199('0x60')}]})[_0xf199('0x20')](handleEntityNotFound(_0x5979ce,null))[_0xf199('0x20')](saveUpdates(_0x894a3f[_0xf199('0x5e')],null))[_0xf199('0x20')](function(_0x40d6ba){if(_0x40d6ba&&_0x894a3f[_0xf199('0x5e')][_0xf199('0x5a')]){return db[_0xf199('0x3d')][_0xf199('0x34')](_0x894a3f[_0xf199('0x5e')][_0xf199('0x5a')],{'where':{'MailAccountId':_0x40d6ba['id']}})[_0xf199('0x20')](function(){return _0x40d6ba;});}return _0x40d6ba;})[_0xf199('0x20')](function(_0x53044f){if(_0x53044f&&_0x894a3f[_0xf199('0x5e')][_0xf199('0x3f')]){return db[_0xf199('0x3e')][_0xf199('0x34')](_0x894a3f[_0xf199('0x5e')][_0xf199('0x3f')],{'where':{'MailAccountId':_0x53044f['id']}})['then'](function(){return _0x53044f;});}return _0x53044f;})['then'](respondWithResult(_0x5979ce,null))[_0xf199('0x58')](handleError(_0x5979ce,null));};exports[_0xf199('0x61')]=function(_0x376029,_0x74ff99){return db[_0xf199('0x41')][_0xf199('0x61')]()['then'](respondWithResult(_0x74ff99,null))[_0xf199('0x58')](handleError(_0x74ff99,null));};exports[_0xf199('0x62')]=function(_0x3d9b20,_0x588572,_0x4ed96a){if(_0x3d9b20['body']['id']){delete _0x3d9b20[_0xf199('0x5e')]['id'];}return db['MailAccount'][_0xf199('0x5d')]({'where':{'id':_0x3d9b20[_0xf199('0x5f')]['id']}})[_0xf199('0x20')](handleEntityNotFound(_0x588572,null))[_0xf199('0x20')](function(_0x252ff6){if(_0x252ff6){_0x3d9b20[_0xf199('0x5e')][_0xf199('0x63')]=_0x252ff6['id'];return db[_0xf199('0x64')][_0xf199('0x65')](_0x3d9b20[_0xf199('0x5e')]);}})[_0xf199('0x20')](respondWithResult(_0x588572,null))[_0xf199('0x58')](handleError(_0x588572,null));};exports[_0xf199('0x66')]=function(_0x19c0bf,_0x4700a0,_0x466627){var _0x77fa51={'raw':![],'where':{}};var _0x20bf93={};var _0x4c3ce4={'count':0x0,'rows':[]};return db[_0xf199('0x41')][_0xf199('0x67')]({'where':{'id':_0x19c0bf[_0xf199('0x5f')]['id']}})[_0xf199('0x20')](handleEntityNotFound(_0x4700a0,null))['then'](function(_0x1d1565){if(_0x1d1565){_0x20bf93[_0xf199('0x45')]=_['keys'](db['Disposition']['rawAttributes']);_0x20bf93[_0xf199('0x46')]=_[_0xf199('0x5b')](_0x19c0bf[_0xf199('0x46')]);_0x20bf93[_0xf199('0x47')]=_['intersection'](_0x20bf93[_0xf199('0x45')],_0x20bf93[_0xf199('0x46')]);_0x77fa51[_0xf199('0x49')]=_[_0xf199('0x48')](_0x20bf93[_0xf199('0x45')],qs['fields'](_0x19c0bf[_0xf199('0x46')][_0xf199('0x4a')]));_0x77fa51[_0xf199('0x49')]=_0x77fa51['attributes'][_0xf199('0x4b')]?_0x77fa51[_0xf199('0x49')]:_0x20bf93[_0xf199('0x45')];if(!_0x19c0bf['query'][_0xf199('0x4c')]('nolimit')){_0x77fa51[_0xf199('0x2d')]=qs[_0xf199('0x2d')](_0x19c0bf['query'][_0xf199('0x2d')]);_0x77fa51[_0xf199('0x2b')]=qs[_0xf199('0x2b')](_0x19c0bf['query'][_0xf199('0x2b')]);}_0x77fa51['order']=qs[_0xf199('0x4f')](_0x19c0bf[_0xf199('0x46')][_0xf199('0x4f')]);_0x77fa51[_0xf199('0x50')]=qs['filters'](_[_0xf199('0x68')](_0x19c0bf['query'],_0x20bf93[_0xf199('0x47')]));_0x77fa51[_0xf199('0x50')]['MailAccountId']=_0x1d1565['id'];if(_0x19c0bf['query'][_0xf199('0x51')]){_0x77fa51['where']=_[_0xf199('0x52')](_0x77fa51[_0xf199('0x50')],{'$or':_[_0xf199('0x53')](_0x77fa51[_0xf199('0x49')],function(_0x35acfa){var _0x4e5f7c={};_0x4e5f7c[_0x35acfa]={'$like':'%'+_0x19c0bf[_0xf199('0x46')][_0xf199('0x51')]+'%'};return _0x4e5f7c;})});}_0x77fa51=_['merge']({},_0x77fa51,_0x19c0bf[_0xf199('0x54')]);return db[_0xf199('0x64')][_0xf199('0x2e')]({'where':_0x77fa51[_0xf199('0x50')]})[_0xf199('0x20')](function(_0xb25da2){_0x4c3ce4[_0xf199('0x2e')]=_0xb25da2;if(_0x19c0bf[_0xf199('0x46')]['includeAll']){_0x77fa51[_0xf199('0x55')]=[{'all':!![]}];}return db['Disposition'][_0xf199('0x56')](_0x77fa51);})[_0xf199('0x20')](function(_0x21f6bb){_0x4c3ce4[_0xf199('0x57')]=_0x21f6bb;return _0x4c3ce4;});}})[_0xf199('0x20')](respondWithFilteredResult(_0x4700a0,_0x77fa51))[_0xf199('0x58')](handleError(_0x4700a0,null));};exports[_0xf199('0x69')]=function(_0x1b0357,_0x567520,_0x3dc5d4){return db['MailAccount'][_0xf199('0x5d')]({'where':{'id':_0x1b0357['params']['id']}})[_0xf199('0x20')](handleEntityNotFound(_0x567520,null))['then'](function(_0x17a20d){if(_0x17a20d){return _0x17a20d['removeDispositions'](_0x1b0357['query'][_0xf199('0x6a')]);}})['then'](respondWithStatusCode(_0x567520,null))['catch'](handleError(_0x567520,null));};exports[_0xf199('0x6b')]=function(_0x360e0b,_0xcba034,_0x476c93){if(_0x360e0b[_0xf199('0x5e')]['id']){delete _0x360e0b[_0xf199('0x5e')]['id'];}return db[_0xf199('0x41')][_0xf199('0x5d')]({'where':{'id':_0x360e0b[_0xf199('0x5f')]['id']}})[_0xf199('0x20')](handleEntityNotFound(_0xcba034,null))[_0xf199('0x20')](function(_0xd3e4c1){if(_0xd3e4c1){_0x360e0b[_0xf199('0x5e')][_0xf199('0x63')]=_0xd3e4c1['id'];return db[_0xf199('0x6c')]['create'](_0x360e0b[_0xf199('0x5e')]);}})['then'](respondWithResult(_0xcba034,null))[_0xf199('0x58')](handleError(_0xcba034,null));};exports[_0xf199('0x6d')]=function(_0x49ba40,_0x3b5386,_0x3f76de){var _0x35e068={'raw':![],'where':{}};var _0x22be60={};var _0x6677e4={'count':0x0,'rows':[]};return db[_0xf199('0x41')]['findOne']({'where':{'id':_0x49ba40[_0xf199('0x5f')]['id']}})[_0xf199('0x20')](handleEntityNotFound(_0x3b5386,null))[_0xf199('0x20')](function(_0x2d917f){if(_0x2d917f){_0x22be60[_0xf199('0x45')]=_[_0xf199('0x5b')](db['CannedAnswer']['rawAttributes']);_0x22be60['query']=_['keys'](_0x49ba40[_0xf199('0x46')]);_0x22be60[_0xf199('0x47')]=_[_0xf199('0x48')](_0x22be60['model'],_0x22be60['query']);_0x35e068['attributes']=_[_0xf199('0x48')](_0x22be60['model'],qs[_0xf199('0x4a')](_0x49ba40['query'][_0xf199('0x4a')]));_0x35e068[_0xf199('0x49')]=_0x35e068[_0xf199('0x49')][_0xf199('0x4b')]?_0x35e068[_0xf199('0x49')]:_0x22be60[_0xf199('0x45')];if(!_0x49ba40[_0xf199('0x46')][_0xf199('0x4c')](_0xf199('0x4d'))){_0x35e068[_0xf199('0x2d')]=qs[_0xf199('0x2d')](_0x49ba40[_0xf199('0x46')][_0xf199('0x2d')]);_0x35e068['offset']=qs[_0xf199('0x2b')](_0x49ba40[_0xf199('0x46')][_0xf199('0x2b')]);}_0x35e068['order']=qs[_0xf199('0x4f')](_0x49ba40[_0xf199('0x46')][_0xf199('0x4f')]);_0x35e068['where']=qs[_0xf199('0x47')](_[_0xf199('0x68')](_0x49ba40[_0xf199('0x46')],_0x22be60[_0xf199('0x47')]));_0x35e068['where'][_0xf199('0x63')]=_0x2d917f['id'];if(_0x49ba40['query'][_0xf199('0x51')]){_0x35e068[_0xf199('0x50')]=_[_0xf199('0x52')](_0x35e068[_0xf199('0x50')],{'$or':_[_0xf199('0x53')](_0x35e068[_0xf199('0x49')],function(_0x2a3c23){var _0x41459b={};_0x41459b[_0x2a3c23]={'$like':'%'+_0x49ba40[_0xf199('0x46')][_0xf199('0x51')]+'%'};return _0x41459b;})});}_0x35e068=_['merge']({},_0x35e068,_0x49ba40['options']);return db[_0xf199('0x6c')][_0xf199('0x2e')]({'where':_0x35e068[_0xf199('0x50')]})[_0xf199('0x20')](function(_0x1f726d){_0x6677e4[_0xf199('0x2e')]=_0x1f726d;if(_0x49ba40[_0xf199('0x46')][_0xf199('0x5c')]){_0x35e068[_0xf199('0x55')]=[{'all':!![]}];}return db[_0xf199('0x6c')]['findAll'](_0x35e068);})[_0xf199('0x20')](function(_0x51936e){_0x6677e4['rows']=_0x51936e;return _0x6677e4;});}})[_0xf199('0x20')](respondWithFilteredResult(_0x3b5386,_0x35e068))[_0xf199('0x58')](handleError(_0x3b5386,null));};exports[_0xf199('0x6e')]=function(_0x2558f0,_0x230f38,_0x4c47c8){return db[_0xf199('0x41')][_0xf199('0x5d')]({'where':{'id':_0x2558f0[_0xf199('0x5f')]['id']}})['then'](handleEntityNotFound(_0x230f38,null))[_0xf199('0x20')](function(_0x4c974e){if(_0x4c974e){return _0x4c974e['removeAnswers'](_0x2558f0['query'][_0xf199('0x6a')]);}})[_0xf199('0x20')](respondWithStatusCode(_0x230f38,null))['catch'](handleError(_0x230f38,null));};exports[_0xf199('0x65')]=function(_0x8f93ac,_0x17ce0f){var _0x47207e={'name':_0x8f93ac['body'][_0xf199('0x3b')],'key':_0x8f93ac[_0xf199('0x5e')]['key'],'email':_0x8f93ac['body'][_0xf199('0x6f')],'ListId':_0x8f93ac[_0xf199('0x5e')][_0xf199('0x70')],'active':!_['isNil'](_0x8f93ac[_0xf199('0x5e')]['active'])?_0x8f93ac['body'][_0xf199('0x71')]:!![],'description':_0x8f93ac[_0xf199('0x5e')]['description']||null,'Imap':{},'Smtp':{}};if(_[_0xf199('0x72')](_0x8f93ac[_0xf199('0x5e')]['cservice'])){if(_0x8f93ac['body'][_0xf199('0x73')]){_0x47207e[_0xf199('0x5a')][_0xf199('0x74')]=_0x47207e['Smtp'][_0xf199('0x74')]=_0x8f93ac['body'][_0xf199('0x75')];_0x47207e[_0xf199('0x5a')]['password']=_0x47207e[_0xf199('0x3f')][_0xf199('0x76')]=_0x8f93ac[_0xf199('0x5e')]['cpassword'];}else{_0x47207e[_0xf199('0x5a')]['authentication']=_0x47207e[_0xf199('0x3f')][_0xf199('0x77')]=![];}_0x47207e[_0xf199('0x5a')][_0xf199('0x78')]=_0x8f93ac['body']['Imap'][_0xf199('0x78')];_0x47207e['Imap'][_0xf199('0x79')]=_0x8f93ac[_0xf199('0x5e')][_0xf199('0x5a')][_0xf199('0x79')];_0x47207e[_0xf199('0x3f')][_0xf199('0x78')]=_0x8f93ac[_0xf199('0x5e')][_0xf199('0x3f')]['host'];_0x47207e[_0xf199('0x3f')][_0xf199('0x79')]=_0x8f93ac[_0xf199('0x5e')][_0xf199('0x3f')][_0xf199('0x79')];}else{_0x47207e[_0xf199('0x5a')][_0xf199('0x7a')]=_0x47207e[_0xf199('0x3f')]['service']=_0x8f93ac[_0xf199('0x5e')][_0xf199('0x7b')];_0x47207e['Imap'][_0xf199('0x74')]=_0x47207e[_0xf199('0x3f')]['user']=_0x8f93ac[_0xf199('0x5e')][_0xf199('0x75')];_0x47207e[_0xf199('0x5a')][_0xf199('0x7c')]=_0x47207e[_0xf199('0x3f')][_0xf199('0x76')]=_0x8f93ac[_0xf199('0x5e')][_0xf199('0x7d')];}return db[_0xf199('0x41')][_0xf199('0x65')](_0x47207e,{'include':[{'model':db[_0xf199('0x3e')],'as':'Smtp'},{'model':db['MailServerIn'],'as':_0xf199('0x5a')}]})['then'](function(_0x854aa9){var _0x4a5e51=_0x8f93ac['user'][_0xf199('0x36')]({'plain':!![]});if(!_0x4a5e51)throw new Error(_0xf199('0x7e'));if(_0x4a5e51[_0xf199('0x7f')]===_0xf199('0x74')){var _0x3c6559=_0x854aa9[_0xf199('0x36')]({'plain':!![]});return db['UserProfileSection'][_0xf199('0x5d')]({'where':{'name':_0xf199('0x37'),'userProfileId':_0x4a5e51['userProfileId']},'raw':!![]})[_0xf199('0x20')](function(_0x4e929f){if(_0x4e929f&&_0x4e929f[_0xf199('0x80')]===0x0){return db['UserProfileResource'][_0xf199('0x65')]({'name':_0x3c6559[_0xf199('0x3b')],'resourceId':_0x3c6559['id'],'type':_0x4e929f['name'],'sectionId':_0x4e929f['id']},{})[_0xf199('0x20')](function(){return _0x854aa9;});}else{return _0x854aa9;}})[_0xf199('0x58')](function(_0x2fcf2d){logger[_0xf199('0x25')](_0xf199('0x81'),_0x2fcf2d);throw _0x2fcf2d;});}return _0x854aa9;})[_0xf199('0x20')](respondWithResult(_0x17ce0f,0xc9))[_0xf199('0x58')](handleError(_0x17ce0f,null));};exports[_0xf199('0x82')]=function(_0x439854,_0x3acda8,_0x42c3f2){return db[_0xf199('0x41')][_0xf199('0x67')]({'where':{'id':_0x439854['params']['id']}})[_0xf199('0x20')](handleEntityNotFound(_0x3acda8,null))[_0xf199('0x20')](function(_0x5c26b1){if(_0x5c26b1){return _0x5c26b1[_0xf199('0x82')]();}return null;})[_0xf199('0x20')](respondWithResult(_0x3acda8,null))[_0xf199('0x58')](handleError(_0x3acda8,null));};exports['addImap']=function(_0x4a79ff,_0x548e45,_0x270798){if(_0x4a79ff[_0xf199('0x5e')]['id']){delete _0x4a79ff[_0xf199('0x5e')]['id'];}return db[_0xf199('0x41')][_0xf199('0x5d')]({'where':{'id':_0x4a79ff[_0xf199('0x5f')]['id']}})['then'](handleEntityNotFound(_0x548e45,null))['then'](function(_0x2c081f){if(_0x2c081f){_0x4a79ff[_0xf199('0x5e')][_0xf199('0x63')]=_0x2c081f['id'];return db[_0xf199('0x3d')]['create'](_0x4a79ff['body']);}})[_0xf199('0x20')](respondWithResult(_0x548e45,null))['catch'](handleError(_0x548e45,null));};exports[_0xf199('0x83')]=function(_0x3c4427,_0x32d045,_0x759982){return db[_0xf199('0x41')][_0xf199('0x67')]({'where':{'id':_0x3c4427[_0xf199('0x5f')]['id']}})[_0xf199('0x20')](handleEntityNotFound(_0x32d045,null))[_0xf199('0x20')](function(_0x5ee990){if(_0x5ee990){return _0x5ee990[_0xf199('0x84')](null);}return null;})['then'](respondWithStatusCode(_0x32d045,null))[_0xf199('0x58')](handleError(_0x32d045,null));};exports[_0xf199('0x85')]=function(_0x3c1d27,_0x366cf0,_0x315830){return db[_0xf199('0x41')][_0xf199('0x67')]({'where':{'id':_0x3c1d27[_0xf199('0x5f')]['id']}})[_0xf199('0x20')](handleEntityNotFound(_0x366cf0,null))['then'](function(_0xff3f90){if(_0xff3f90){return _0xff3f90[_0xf199('0x85')]();}return null;})[_0xf199('0x20')](respondWithResult(_0x366cf0,null))[_0xf199('0x58')](handleError(_0x366cf0,null));};exports[_0xf199('0x86')]=function(_0x4a821a,_0x436761,_0x3e9743){if(_0x4a821a['body']['id']){delete _0x4a821a[_0xf199('0x5e')]['id'];}return db['MailAccount'][_0xf199('0x5d')]({'where':{'id':_0x4a821a['params']['id']}})['then'](handleEntityNotFound(_0x436761,null))[_0xf199('0x20')](function(_0x5097b5){if(_0x5097b5){_0x4a821a[_0xf199('0x5e')][_0xf199('0x63')]=_0x5097b5['id'];return db[_0xf199('0x3e')][_0xf199('0x65')](_0x4a821a[_0xf199('0x5e')]);}})['then'](respondWithResult(_0x436761,null))[_0xf199('0x58')](handleError(_0x436761,null));};exports[_0xf199('0x87')]=function(_0x592411,_0x315264,_0x33be4a){return db[_0xf199('0x41')]['findOne']({'where':{'id':_0x592411['params']['id']}})[_0xf199('0x20')](handleEntityNotFound(_0x315264,null))[_0xf199('0x20')](function(_0x40e7b6){if(_0x40e7b6){return _0x40e7b6[_0xf199('0x88')](null);}return null;})[_0xf199('0x20')](respondWithStatusCode(_0x315264,null))[_0xf199('0x58')](handleError(_0x315264,null));};exports[_0xf199('0x89')]=function(_0x35c329,_0xfc791e,_0x2e50e8){return db[_0xf199('0x8a')][_0xf199('0x5d')]({'where':{'id':_0x35c329[_0xf199('0x5f')]['id']}})[_0xf199('0x20')](handleEntityNotFound(_0xfc791e,null))['then'](function(_0x52003d){if(_0x52003d){return _0x52003d[_0xf199('0x89')](_0x35c329[_0xf199('0x5e')]['ids'],_[_0xf199('0x8b')](_0x35c329[_0xf199('0x5e')],['ids','id'])||{});}})[_0xf199('0x20')](respondWithResult(_0xfc791e,null))[_0xf199('0x58')](handleError(_0xfc791e,null));};exports[_0xf199('0x8c')]=function(_0x39f88a,_0x6699ce,_0x177e97){var _0x728f33={'raw':![],'where':{}};var _0x34d49c={};var _0x105858={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x39f88a['params']['id']}})['then'](handleEntityNotFound(_0x6699ce,null))[_0xf199('0x20')](function(_0x57a1b6){if(_0x57a1b6){_0x34d49c[_0xf199('0x45')]=_[_0xf199('0x5b')](db['MailInteraction'][_0xf199('0x42')]);_0x34d49c[_0xf199('0x46')]=_[_0xf199('0x5b')](_0x39f88a[_0xf199('0x46')]);_0x34d49c[_0xf199('0x47')]=_[_0xf199('0x48')](_0x34d49c[_0xf199('0x45')],_0x34d49c[_0xf199('0x46')]);_0x728f33[_0xf199('0x49')]=_[_0xf199('0x48')](_0x34d49c[_0xf199('0x45')],qs[_0xf199('0x4a')](_0x39f88a[_0xf199('0x46')][_0xf199('0x4a')]));_0x728f33[_0xf199('0x49')]=_0x728f33[_0xf199('0x49')][_0xf199('0x4b')]?_0x728f33['attributes']:_0x34d49c[_0xf199('0x45')];if(!_0x39f88a['query'][_0xf199('0x4c')]('nolimit')){_0x728f33[_0xf199('0x2d')]=qs[_0xf199('0x2d')](_0x39f88a[_0xf199('0x46')][_0xf199('0x2d')]);_0x728f33[_0xf199('0x2b')]=qs[_0xf199('0x2b')](_0x39f88a[_0xf199('0x46')][_0xf199('0x2b')]);}_0x728f33[_0xf199('0x4e')]=qs[_0xf199('0x4f')](_0x39f88a['query'][_0xf199('0x4f')]);_0x728f33[_0xf199('0x50')]=qs[_0xf199('0x47')](_[_0xf199('0x68')](_0x39f88a[_0xf199('0x46')],_0x34d49c[_0xf199('0x47')]));_0x728f33['where']['MailAccountId']=_0x57a1b6['id'];if(_0x39f88a[_0xf199('0x46')][_0xf199('0x51')]){_0x728f33['where']=_['merge'](_0x728f33[_0xf199('0x50')],{'$or':_['map'](_0x728f33[_0xf199('0x49')],function(_0x525ff5){var _0x28a224={};_0x28a224[_0x525ff5]={'$like':'%'+_0x39f88a[_0xf199('0x46')][_0xf199('0x51')]+'%'};return _0x28a224;})});}_0x728f33=_[_0xf199('0x52')]({},_0x728f33,_0x39f88a['options']);return db[_0xf199('0x8a')][_0xf199('0x2e')]({'where':_0x728f33[_0xf199('0x50')]})[_0xf199('0x20')](function(_0x3b5d16){_0x105858[_0xf199('0x2e')]=_0x3b5d16;if(_0x39f88a[_0xf199('0x46')][_0xf199('0x5c')]){_0x728f33['include']=[{'model':db[_0xf199('0x8d')],'as':'Contact','required':![]},{'model':db[_0xf199('0x8e')],'as':'Owner','attributes':['name',_0xf199('0x8f'),_0xf199('0x90')],'required':![]},{'model':db[_0xf199('0x91')],'as':_0xf199('0x92'),'attributes':['id','name',_0xf199('0x93')],'where':_0x39f88a[_0xf199('0x46')][_0xf199('0x94')]?{'id':_0x39f88a[_0xf199('0x46')]['tag']}:undefined,'required':_0x39f88a[_0xf199('0x46')]['tag']?!![]:![]}];}return db[_0xf199('0x8a')]['findAll'](_0x728f33);})[_0xf199('0x20')](function(_0x6a0d7b){_0x105858[_0xf199('0x57')]=_0x6a0d7b;return _0x105858;});}})[_0xf199('0x20')](respondWithFilteredResult(_0x6699ce,_0x728f33))['catch'](handleError(_0x6699ce,null));};exports[_0xf199('0x95')]=function(_0x512dcf,_0x17f1c7,_0x515484){return db[_0xf199('0x41')][_0xf199('0x67')]({'where':{'id':_0x512dcf['params']['id']}})[_0xf199('0x20')](handleEntityNotFound(_0x17f1c7,null))[_0xf199('0x20')](function(_0x411af8){if(_0x411af8){return db['sequelize'][_0xf199('0x96')](function(_0x4e095a){return db['MailApplication']['destroy']({'where':{'MailAccountId':_0x512dcf[_0xf199('0x5f')]['id']},'transaction':_0x4e095a})[_0xf199('0x20')](function(_0xb316ef){var _0x5e0c51=_[_0xf199('0x53')](_0x512dcf[_0xf199('0x5e')],function(_0x594f40){_0x594f40[_0xf199('0x63')]=_0x512dcf['params']['id'];return _0x594f40;});return db[_0xf199('0x97')]['bulkCreate'](_0x5e0c51,{'transaction':_0x4e095a});});})[_0xf199('0x20')](function(){return db[_0xf199('0x97')][_0xf199('0x98')]({'where':{'MailAccountId':_0x512dcf[_0xf199('0x5f')]['id']},'order':_0xf199('0x99')});});}})[_0xf199('0x20')](respondWithResult(_0x17f1c7,null))[_0xf199('0x58')](handleError(_0x17f1c7,null));};exports[_0xf199('0x9a')]=function(_0x596d42,_0x38253b,_0x2ed7aa){var _0x33269b={};var _0x5b494a={};var _0x432821;var _0x1470e6;return db['MailAccount'][_0xf199('0x67')]({'where':{'id':_0x596d42[_0xf199('0x5f')]['id']}})[_0xf199('0x20')](handleEntityNotFound(_0x38253b,null))[_0xf199('0x20')](function(_0x42611b){if(_0x42611b){_0x432821=_0x42611b;_0x5b494a[_0xf199('0x45')]=_[_0xf199('0x5b')](db['MailApplication'][_0xf199('0x42')]);_0x5b494a[_0xf199('0x46')]=_[_0xf199('0x5b')](_0x596d42['query']);_0x5b494a[_0xf199('0x47')]=_['intersection'](_0x5b494a[_0xf199('0x45')],_0x5b494a[_0xf199('0x46')]);_0x33269b[_0xf199('0x49')]=_[_0xf199('0x48')](_0x5b494a['model'],qs['fields'](_0x596d42[_0xf199('0x46')]['fields']));_0x33269b['attributes']=_0x33269b[_0xf199('0x49')][_0xf199('0x4b')]?_0x33269b[_0xf199('0x49')]:_0x5b494a[_0xf199('0x45')];_0x33269b['order']=qs[_0xf199('0x4f')](_0x596d42[_0xf199('0x46')][_0xf199('0x4f')]);_0x33269b[_0xf199('0x50')]=qs[_0xf199('0x47')](_[_0xf199('0x68')](_0x596d42[_0xf199('0x46')],_0x5b494a[_0xf199('0x47')]));if(_0x596d42[_0xf199('0x46')][_0xf199('0x51')]){_0x33269b[_0xf199('0x50')]=_['merge'](_0x33269b[_0xf199('0x50')],{'$or':_[_0xf199('0x53')](_0x33269b[_0xf199('0x49')],function(_0x4a1147){var _0x4d29ec={};_0x4d29ec[_0x4a1147]={'$like':'%'+_0x596d42['query'][_0xf199('0x51')]+'%'};return _0x4d29ec;})});}_0x33269b=_[_0xf199('0x52')]({},_0x33269b,_0x596d42[_0xf199('0x54')]);return _0x432821[_0xf199('0x9a')](_0x33269b);}})[_0xf199('0x20')](function(_0x387be1){if(_0x387be1){_0x1470e6=_0x387be1['length'];if(!_0x596d42[_0xf199('0x46')][_0xf199('0x4c')]('nolimit')){_0x33269b[_0xf199('0x2d')]=qs[_0xf199('0x2d')](_0x596d42[_0xf199('0x46')]['limit']);_0x33269b[_0xf199('0x2b')]=qs[_0xf199('0x2b')](_0x596d42[_0xf199('0x46')][_0xf199('0x2b')]);}return _0x432821[_0xf199('0x9a')](_0x33269b);}})[_0xf199('0x20')](function(_0x569b95){if(_0x569b95){return _0x569b95?{'count':_0x1470e6,'rows':_0x569b95}:null;}})[_0xf199('0x20')](respondWithResult(_0x38253b,null))['catch'](handleError(_0x38253b,null));};exports['getMessages']=function(_0x635e07,_0x5109b0,_0x435bd7){var _0xd0f8c8={'raw':!![],'where':{}};var _0x16d5f3={};var _0x178fd2={'count':0x0,'rows':[]};return db[_0xf199('0x41')]['findOne']({'where':{'id':_0x635e07[_0xf199('0x5f')]['id']}})[_0xf199('0x20')](handleEntityNotFound(_0x5109b0,null))[_0xf199('0x20')](function(_0xf4a12b){if(_0xf4a12b){_0x16d5f3['model']=_[_0xf199('0x5b')](db[_0xf199('0x9b')][_0xf199('0x42')]);_0x16d5f3[_0xf199('0x46')]=_[_0xf199('0x5b')](_0x635e07['query']);_0x16d5f3[_0xf199('0x47')]=_[_0xf199('0x48')](_0x16d5f3[_0xf199('0x45')],_0x16d5f3[_0xf199('0x46')]);_0xd0f8c8['attributes']=_[_0xf199('0x48')](_0x16d5f3['model'],qs[_0xf199('0x4a')](_0x635e07[_0xf199('0x46')][_0xf199('0x4a')]));_0xd0f8c8[_0xf199('0x49')]=_0xd0f8c8[_0xf199('0x49')][_0xf199('0x4b')]?_0xd0f8c8['attributes']:_0x16d5f3['model'];if(!_0x635e07[_0xf199('0x46')][_0xf199('0x4c')](_0xf199('0x4d'))){_0xd0f8c8[_0xf199('0x2d')]=qs[_0xf199('0x2d')](_0x635e07[_0xf199('0x46')]['limit']);_0xd0f8c8[_0xf199('0x2b')]=qs[_0xf199('0x2b')](_0x635e07[_0xf199('0x46')][_0xf199('0x2b')]);}_0xd0f8c8[_0xf199('0x4e')]=qs['sort'](_0x635e07[_0xf199('0x46')][_0xf199('0x4f')]);_0xd0f8c8[_0xf199('0x50')]=qs[_0xf199('0x47')](_['pick'](_0x635e07[_0xf199('0x46')],_0x16d5f3[_0xf199('0x47')]));_0xd0f8c8['where'][_0xf199('0x63')]=_0xf4a12b['id'];if(_0x635e07[_0xf199('0x46')][_0xf199('0x51')]){_0xd0f8c8['where']=_[_0xf199('0x52')](_0xd0f8c8[_0xf199('0x50')],{'$or':_['map'](_0xd0f8c8[_0xf199('0x49')],function(_0x233560){var _0x49ac30={};_0x49ac30[_0x233560]={'$like':'%'+_0x635e07[_0xf199('0x46')]['filter']+'%'};return _0x49ac30;})});}if(_0x635e07['query']['$gte']){var _0x443295=_0x635e07[_0xf199('0x46')]['$gte'][_0xf199('0x9c')](',');var _0x166906={};_0x166906[_0x443295[0x0]]={'$gte':moment(_0x443295[0x1])['format'](_0xf199('0x9d'))};_0xd0f8c8[_0xf199('0x50')]=_['merge'](_0xd0f8c8['where'],_0x166906);}_0xd0f8c8=_['merge']({},_0xd0f8c8,_0x635e07[_0xf199('0x54')]);return db[_0xf199('0x9b')][_0xf199('0x2e')]({'where':_0xd0f8c8[_0xf199('0x50')]})[_0xf199('0x20')](function(_0x5e5f2a){_0x178fd2[_0xf199('0x2e')]=_0x5e5f2a;if(_0x635e07[_0xf199('0x46')][_0xf199('0x5c')]){_0xd0f8c8[_0xf199('0x55')]=[{'all':!![]}];}return db['MailMessage'][_0xf199('0x56')](_0xd0f8c8);})['then'](function(_0x499325){if(_0x635e07[_0xf199('0x46')][_0xf199('0x9e')]==='true'){for(var _0xb55994=0x0;_0xb55994<_0x499325[_0xf199('0x4b')];_0xb55994++){_0x499325[_0xb55994][_0xf199('0x5e')]=juice(_0x499325[_0xb55994][_0xf199('0x5e')]);}}_0x178fd2[_0xf199('0x57')]=_0x499325;return _0x178fd2;});}})[_0xf199('0x20')](respondWithFilteredResult(_0x5109b0,_0xd0f8c8))['catch'](handleError(_0x5109b0,null));};exports[_0xf199('0x9f')]=function(_0x3f3a5e,_0x5c7940,_0x2d6917){var _0x4cf939,_0x3b1c28={},_0x4623b1;if(_0x3f3a5e[_0xf199('0x5e')]['to']){_0x4623b1=_0x3f3a5e[_0xf199('0x5e')]['to'][_0xf199('0x9c')](',')[0x0];}return db['MailAccount'][_0xf199('0x5d')]({'where':{'id':_0x3f3a5e[_0xf199('0x5f')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xf199('0x8d')],'as':'Contacts','where':{'email':_0x4623b1},'limit':0x1,'order':[[_0xf199('0xa0'),_0xf199('0xa1')]]}]},{'model':db[_0xf199('0x3e')],'as':_0xf199('0x3f'),'raw':!![]}]})[_0xf199('0x20')](handleEntityNotFound(_0x5c7940,null))[_0xf199('0x20')](function(_0x27a35c){if(_0x27a35c){_0x4cf939=_0x27a35c;if(_0x27a35c[_0xf199('0x3f')]){if(_[_0xf199('0x72')](_0x3f3a5e[_0xf199('0x5e')][_0xf199('0xa2')])){_0x3f3a5e[_0xf199('0x5e')][_0xf199('0xa2')]=util[_0xf199('0xa3')](_0xf199('0xa4'),_0x27a35c['name'],_0x27a35c[_0xf199('0x6f')]||_0x27a35c[_0xf199('0x3f')][_0xf199('0x74')]);}if(_0x3f3a5e[_0xf199('0x5e')][_0xf199('0xa5')]&&_0x3f3a5e[_0xf199('0x5e')][_0xf199('0xa5')]['length']){for(var _0x1a80c2=0x0;_0x1a80c2<_0x3f3a5e[_0xf199('0x5e')]['attachments'][_0xf199('0x4b')];_0x1a80c2+=0x1){_0x3f3a5e[_0xf199('0x5e')][_0xf199('0xa5')][_0x1a80c2]={'filename':_0x3f3a5e[_0xf199('0x5e')][_0xf199('0xa5')][_0x1a80c2][_0xf199('0x3b')],'path':path['join'](config[_0xf199('0xa6')],_0xf199('0xa7'),_0x3f3a5e[_0xf199('0x5e')][_0xf199('0xa5')][_0x1a80c2][_0xf199('0xa8')])};}}var _0x3b1379={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x27a35c[_0xf199('0x3f')][_0xf199('0x7a')])){if(_0x27a35c[_0xf199('0x3f')][_0xf199('0x77')]){_0x3b1379[_0xf199('0xa9')]={'user':_0x27a35c['Smtp'][_0xf199('0x74')],'pass':_0x27a35c[_0xf199('0x3f')][_0xf199('0x76')]};}_0x3b1379[_0xf199('0x78')]=_0x27a35c[_0xf199('0x3f')]['host'];_0x3b1379[_0xf199('0x79')]=_0x27a35c['Smtp'][_0xf199('0x79')];_0x3b1379[_0xf199('0xaa')]=_0x27a35c[_0xf199('0x3f')]['secure'];}else{_0x3b1379[_0xf199('0x7a')]=_0x27a35c[_0xf199('0x3f')][_0xf199('0x7a')];_0x3b1379[_0xf199('0xa9')]={'user':_0x27a35c[_0xf199('0x3f')][_0xf199('0x74')],'pass':_0x27a35c[_0xf199('0x3f')]['pass']};}return respondWithRpcPromise(_0xf199('0xab'),_0xf199('0xac'),{'account':_0x3b1379,'message':_0x3f3a5e[_0xf199('0x5e')]});}else{throw new Error(_0xf199('0xad'));}}})[_0xf199('0x20')](function(_0x7bcee3){if(_0x7bcee3){_0x3b1c28=_0x7bcee3;if(_0x4cf939[_0xf199('0xae')]){if(_0x4cf939['List'][_0xf199('0xaf')][_0xf199('0x4b')]){return _0x4cf939[_0xf199('0xae')][_0xf199('0xaf')][0x0];}else{return db['CmContact'][_0xf199('0x65')](_['defaults'](_0x3f3a5e[_0xf199('0x5e')],{'firstName':_0x3f3a5e[_0xf199('0x5e')]['to'],'email':_0x3f3a5e['body']['to'],'phone':_0x3f3a5e[_0xf199('0x5e')]['to'],'ListId':_0x4cf939[_0xf199('0x70')]}));}}else{throw new Error(_0xf199('0xad'));}}})['then'](function(_0x4c48c2){if(_0x4c48c2){var _0x45dbba={'UserId':_0x3f3a5e[_0xf199('0x74')]['id'],'ContactId':_0x4c48c2['id'],'MailAccountId':_0x4cf939['id'],'inReplyTo':_0x3b1c28[_0xf199('0xb0')],'to':_0x3f3a5e['body'][_0xf199('0xa2')],'cc':_0x3f3a5e['body']['cc'],'subject':_0x3f3a5e[_0xf199('0x5e')]['subject'],'attach':_0x3f3a5e[_0xf199('0x5e')][_0xf199('0xb1')],'firstMsgDirection':_0xf199('0xb2'),'lastMsgAt':moment()[_0xf199('0xa3')](_0xf199('0x9d')),'lastMsgDirection':_0xf199('0xb2'),'Messages':[_[_0xf199('0x52')](_0x3f3a5e['body'],{'messageId':_0x3b1c28[_0xf199('0xb0')],'sentAt':moment()[_0xf199('0xa3')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x4cf939['id'],'UserId':_0x3f3a5e[_0xf199('0x74')]['id'],'ContactId':_0x4c48c2['id']})]};if(_0x3f3a5e[_0xf199('0x5e')][_0xf199('0xb3')]){_0x45dbba=_['merge'](_0x45dbba,_0x3f3a5e[_0xf199('0x5e')][_0xf199('0xb3')]);}return db[_0xf199('0x8a')][_0xf199('0x65')](_0x45dbba,{'include':[{'model':db[_0xf199('0x9b')],'as':_0xf199('0xb4')}]});}})[_0xf199('0x20')](respondWithResult(_0x5c7940,null))[_0xf199('0x58')](handleError(_0x5c7940,null));};exports[_0xf199('0xb5')]=function(_0x1fbd9e,_0x23a31f,_0x1731df){return db[_0xf199('0x41')][_0xf199('0x5d')]({'where':{'id':_0x1fbd9e[_0xf199('0x5f')]['id']},'include':[{'model':db[_0xf199('0x3e')],'as':_0xf199('0x3f'),'raw':!![]}]})['then'](handleEntityNotFound(_0x23a31f,null))[_0xf199('0x20')](function(_0x3cadcc){if(_0x3cadcc&&_0x3cadcc[_0xf199('0x3f')]){var _0xe42016={'id':_0x3cadcc['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3cadcc[_0xf199('0x3f')][_0xf199('0x7a')]){_0xe42016[_0xf199('0x7a')]=_0x3cadcc[_0xf199('0x3f')][_0xf199('0x7a')];}else{_0xe42016[_0xf199('0x78')]=_0x3cadcc[_0xf199('0x3f')][_0xf199('0x78')];_0xe42016['port']=_0x3cadcc['Smtp'][_0xf199('0x79')];_0xe42016[_0xf199('0xaa')]=_0x3cadcc[_0xf199('0x3f')]['secure'];}if(_0x3cadcc[_0xf199('0x3f')][_0xf199('0x77')]){_0xe42016[_0xf199('0xa9')]={'user':_0x3cadcc[_0xf199('0x3f')][_0xf199('0x74')],'pass':_0x3cadcc[_0xf199('0x3f')]['pass']};}return respondWithRpcPromise('VerifySmtp',_0xf199('0xb5'),{'account':_0xe42016});}})[_0xf199('0x20')](respondWithResult(_0x23a31f,null))[_0xf199('0x58')](handleError(_0x23a31f,null));};exports[_0xf199('0x35')]=function(_0xcfb8a0,_0x10c569){return db['MailAccount'][_0xf199('0x5d')]({'where':{'id':_0xcfb8a0['params']['id']}})[_0xf199('0x20')](handleEntityNotFound(_0x10c569,null))['then'](function(_0xd07017){if(_0xd07017&&_0xd07017['service']){throw new db[(_0xf199('0xb6'))][(_0xf199('0xb7'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0xd07017;})[_0xf199('0x20')](removeEntity(_0x10c569,null))[_0xf199('0x58')](handleError(_0x10c569,null));};exports[_0xf199('0xb8')]=function(_0xa4ae4c,_0x5a951c,_0x25cc44){return db['MailAccount'][_0xf199('0x5d')]({'where':{'id':_0xa4ae4c[_0xf199('0x5f')]['id']}})[_0xf199('0x20')](handleEntityNotFound(_0x5a951c,null))[_0xf199('0x20')](function(_0x20c35a){if(_0x20c35a){return _0x20c35a[_0xf199('0xb8')](_0xa4ae4c[_0xf199('0x5e')][_0xf199('0x6a')],_[_0xf199('0x8b')](_0xa4ae4c['body'],[_0xf199('0x6a'),'id'])||{})[_0xf199('0xb9')](function(_0x38a4cd){for(var _0x406f24=0x0;_0x406f24<_0xa4ae4c['body'][_0xf199('0x6a')][_0xf199('0x4b')];_0x406f24+=0x1){socket[_0xf199('0xba')]('userMailAccount:save',{'UserId':Number(_0xa4ae4c[_0xf199('0x5e')][_0xf199('0x6a')][_0x406f24]),'MailAccountId':Number(_0xa4ae4c[_0xf199('0x5f')]['id'])});}return _0x38a4cd;});}})['then'](respondWithResult(_0x5a951c,null))[_0xf199('0x58')](handleError(_0x5a951c,null));};exports['removeAgents']=function(_0x2c025a,_0x29d5f9,_0x47b66f){return db[_0xf199('0x41')]['find']({'where':{'id':_0x2c025a[_0xf199('0x5f')]['id']}})['then'](handleEntityNotFound(_0x29d5f9,null))[_0xf199('0x20')](function(_0x1432a1){if(_0x1432a1){return _0x1432a1[_0xf199('0xbb')](_0x2c025a[_0xf199('0x46')][_0xf199('0x6a')])[_0xf199('0x20')](function(){if(_[_0xf199('0xbc')](_0x2c025a[_0xf199('0x46')][_0xf199('0x6a')])){for(var _0x56d38c=0x0;_0x56d38c<_0x2c025a['query'][_0xf199('0x6a')][_0xf199('0x4b')];_0x56d38c+=0x1){socket[_0xf199('0xba')]('userMailAccount:remove',{'UserId':Number(_0x2c025a[_0xf199('0x46')][_0xf199('0x6a')][_0x56d38c]),'MailAccountId':Number(_0x2c025a[_0xf199('0x5f')]['id'])});}}else{socket['emit']('userMailAccount:remove',{'UserId':Number(_0x2c025a[_0xf199('0x46')]['ids']),'MailAccountId':Number(_0x2c025a[_0xf199('0x5f')]['id'])});}});}})['then'](respondWithStatusCode(_0x29d5f9,null))[_0xf199('0x58')](handleError(_0x29d5f9,null));};exports[_0xf199('0xbd')]=function(_0x56d57c,_0x36179f,_0x4a3943){var _0x5c7b08={};var _0x1245d1={};var _0x1c5ec7;var _0x56c822;return db[_0xf199('0x41')][_0xf199('0x67')]({'where':{'id':_0x56d57c[_0xf199('0x5f')]['id']}})['then'](handleEntityNotFound(_0x36179f,null))[_0xf199('0x20')](function(_0x44ad83){if(_0x44ad83){_0x1c5ec7=_0x44ad83;_0x1245d1[_0xf199('0x45')]=_[_0xf199('0x5b')](db[_0xf199('0x8e')][_0xf199('0x42')]);_0x1245d1[_0xf199('0x46')]=_[_0xf199('0x5b')](_0x56d57c[_0xf199('0x46')]);_0x1245d1[_0xf199('0x47')]=_[_0xf199('0x48')](_0x1245d1['model'],_0x1245d1[_0xf199('0x46')]);_0x5c7b08[_0xf199('0x49')]=_[_0xf199('0x48')](_0x1245d1['model'],qs[_0xf199('0x4a')](_0x56d57c[_0xf199('0x46')]['fields']));_0x5c7b08[_0xf199('0x49')]=_0x5c7b08[_0xf199('0x49')][_0xf199('0x4b')]?_0x5c7b08[_0xf199('0x49')]:_0x1245d1[_0xf199('0x45')];_0x5c7b08['order']=qs[_0xf199('0x4f')](_0x56d57c[_0xf199('0x46')][_0xf199('0x4f')]);_0x5c7b08['where']=qs[_0xf199('0x47')](_[_0xf199('0x68')](_0x56d57c['query'],_0x1245d1[_0xf199('0x47')]));if(_0x56d57c['query']['filter']){_0x5c7b08['where']=_['merge'](_0x5c7b08['where'],{'$or':_[_0xf199('0x53')](_0x5c7b08[_0xf199('0x49')],function(_0x5f5c9c){var _0x1949fe={};_0x1949fe[_0x5f5c9c]={'$like':'%'+_0x56d57c['query'][_0xf199('0x51')]+'%'};return _0x1949fe;})});}_0x5c7b08=_['merge']({},_0x5c7b08,_0x56d57c['options']);return _0x1c5ec7[_0xf199('0xbd')](_0x5c7b08);}})['then'](function(_0x2fdf76){if(_0x2fdf76){_0x56c822=_0x2fdf76[_0xf199('0x4b')];if(!_0x56d57c[_0xf199('0x46')][_0xf199('0x4c')](_0xf199('0x4d'))){_0x5c7b08[_0xf199('0x2d')]=qs[_0xf199('0x2d')](_0x56d57c[_0xf199('0x46')][_0xf199('0x2d')]);_0x5c7b08[_0xf199('0x2b')]=qs[_0xf199('0x2b')](_0x56d57c[_0xf199('0x46')][_0xf199('0x2b')]);}return _0x1c5ec7[_0xf199('0xbd')](_0x5c7b08);}})[_0xf199('0x20')](function(_0x3bd9e3){if(_0x3bd9e3){return _0x3bd9e3?{'count':_0x56c822,'rows':_0x3bd9e3}:null;}})[_0xf199('0x20')](respondWithResult(_0x36179f,null))['catch'](handleError(_0x36179f,null));};
\ No newline at end of file
+var _0xdbe3=['filter','merge','includeAll','show','params','Pause','keys','options','find','body','describe','addDisposition','MailAccountId','Disposition','create','length','hasOwnProperty','nolimit','order','include','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','findAll','removeAnswers','ListId','active','cservice','user','cuser','password','pass','cpassword','authentication','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','pick','CmContact','Contact','User','fullname','internal','Tag','Tags','tag','addApplications','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','MailMessage','$gte','split','format','inlineCss','CmList','updatedAt','DESC','isNil','from','%s\x20<%s>','email','attachments','join','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','List','messageId','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','verifySmtp','Sequelize','ValidationError','addAgents','omit','spread','removeAgents','isArray','emit','userMailAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','html-to-text','juice','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','end','status','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','MailAccounts','UserProfileResource','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','sort','where'];(function(_0x4cb219,_0x1a4765){var _0x5cf899=function(_0x127a17){while(--_0x127a17){_0x4cb219['push'](_0x4cb219['shift']());}};_0x5cf899(++_0x1a4765);}(_0xdbe3,0x135));var _0x3dbe=function(_0x1b70b7,_0x3c3737){_0x1b70b7=_0x1b70b7-0x0;var _0x5348ff=_0xdbe3[_0x1b70b7];return _0x5348ff;};'use strict';var emlformat=require(_0x3dbe('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3dbe('0x1'));var jsonpatch=require(_0x3dbe('0x2'));var rp=require(_0x3dbe('0x3'));var moment=require(_0x3dbe('0x4'));var BPromise=require(_0x3dbe('0x5'));var Mustache=require(_0x3dbe('0x6'));var util=require('util');var path=require(_0x3dbe('0x7'));var sox=require(_0x3dbe('0x8'));var csv=require(_0x3dbe('0x9'));var ejs=require(_0x3dbe('0xa'));var fs=require('fs');var fs_extra=require(_0x3dbe('0xb'));var _=require(_0x3dbe('0xc'));var squel=require(_0x3dbe('0xd'));var crypto=require('crypto');var jsforce=require(_0x3dbe('0xe'));var deskjs=require(_0x3dbe('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3dbe('0x10'));var Papa=require(_0x3dbe('0x11'));var htmlToText=require(_0x3dbe('0x12'));var juice=require(_0x3dbe('0x13'));var Redis=require(_0x3dbe('0x14'));var authService=require(_0x3dbe('0x15'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3dbe('0x16'));var logger=require('../../config/logger')(_0x3dbe('0x17'));var utils=require(_0x3dbe('0x18'));var config=require(_0x3dbe('0x19'));var licenseUtil=require(_0x3dbe('0x1a'));var db=require(_0x3dbe('0x1b'))['db'];config[_0x3dbe('0x1c')]=_[_0x3dbe('0x1d')](config[_0x3dbe('0x1c')],{'host':_0x3dbe('0x1e'),'port':0x18eb});var socket=require(_0x3dbe('0x1f'))(new Redis(config['redis']));require('./mailAccount.socket')[_0x3dbe('0x20')](socket);var jayson=require(_0x3dbe('0x21'));var client=jayson['client']['http']({'port':0x232b});function respondWithRpcPromise(_0x40c7c9,_0x38a5fa,_0x311940,_0x155305){return new BPromise(function(_0x3a615a,_0x4c318e){var _0x2803de=_0x155305||client;return _0x2803de[_0x3dbe('0x22')](_0x40c7c9,_0x311940)[_0x3dbe('0x23')](function(_0x556869){logger[_0x3dbe('0x24')](_0x3dbe('0x25'),_0x38a5fa,_0x3dbe('0x26'));logger['debug'](_0x3dbe('0x27'),_0x38a5fa,_0x3dbe('0x26'),JSON['stringify'](_0x556869));if(_0x556869[_0x3dbe('0x28')]){if(_0x556869[_0x3dbe('0x28')][_0x3dbe('0x29')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x38a5fa,_0x556869[_0x3dbe('0x28')]['message']);return _0x4c318e(_0x556869[_0x3dbe('0x28')][_0x3dbe('0x2a')]);}logger[_0x3dbe('0x28')](_0x3dbe('0x25'),_0x38a5fa,_0x556869[_0x3dbe('0x28')][_0x3dbe('0x2a')]);return _0x3a615a(_0x556869[_0x3dbe('0x28')][_0x3dbe('0x2a')]);}else{logger[_0x3dbe('0x24')](_0x3dbe('0x25'),_0x38a5fa,_0x3dbe('0x26'));_0x3a615a(_0x556869[_0x3dbe('0x2b')]['message']);}})[_0x3dbe('0x2c')](function(_0x3cf0b0){logger[_0x3dbe('0x28')](_0x3dbe('0x25'),_0x38a5fa,_0x3cf0b0);_0x4c318e(_0x3cf0b0);});});}function respondWithStatusCode(_0x4417d7,_0x59451b){_0x59451b=_0x59451b||0xcc;return function(_0x227de8){if(_0x227de8){return _0x4417d7[_0x3dbe('0x2d')](_0x59451b);}return _0x4417d7['status'](_0x59451b)[_0x3dbe('0x2e')]();};}function respondWithResult(_0x580cdf,_0x29d062){_0x29d062=_0x29d062||0xc8;return function(_0x8dfdb6){if(_0x8dfdb6){return _0x580cdf[_0x3dbe('0x2f')](_0x29d062)[_0x3dbe('0x30')](_0x8dfdb6);}};}function respondWithFilteredResult(_0x46b908,_0x4c56f4){return function(_0xdc71e5){if(_0xdc71e5){var _0x20ec62=typeof _0x4c56f4[_0x3dbe('0x31')]==='undefined'&&typeof _0x4c56f4[_0x3dbe('0x32')]==='undefined';var _0x3ac866=_0xdc71e5[_0x3dbe('0x33')];var _0x416de6=_0x20ec62?0x0:_0x4c56f4[_0x3dbe('0x31')];var _0x452065=_0x20ec62?_0xdc71e5[_0x3dbe('0x33')]:_0x4c56f4[_0x3dbe('0x31')]+_0x4c56f4[_0x3dbe('0x32')];var _0x1343ab;if(_0x452065>=_0x3ac866){_0x452065=_0x3ac866;_0x1343ab=0xc8;}else{_0x1343ab=0xce;}_0x46b908[_0x3dbe('0x2f')](_0x1343ab);return _0x46b908[_0x3dbe('0x34')](_0x3dbe('0x35'),_0x416de6+'-'+_0x452065+'/'+_0x3ac866)[_0x3dbe('0x30')](_0xdc71e5);}return null;};}function patchUpdates(_0x2876d1){return function(_0xdffea7){try{jsonpatch['apply'](_0xdffea7,_0x2876d1,!![]);}catch(_0x52b840){return BPromise[_0x3dbe('0x36')](_0x52b840);}return _0xdffea7[_0x3dbe('0x37')]();};}function saveUpdates(_0x3e36c3,_0x45e272){return function(_0x49a1df){if(_0x49a1df){return _0x49a1df[_0x3dbe('0x38')](_0x3e36c3)[_0x3dbe('0x23')](function(_0xf29cc9){return _0xf29cc9;});}return null;};}function removeEntity(_0x37859e,_0x357ac8){return function(_0x149c9f){if(_0x149c9f){return _0x149c9f[_0x3dbe('0x39')]()[_0x3dbe('0x23')](function(){var _0x2f88c9=_0x149c9f['get']({'plain':!![]});var _0x50df69=_0x3dbe('0x3a');return db[_0x3dbe('0x3b')]['destroy']({'where':{'type':_0x50df69,'resourceId':_0x2f88c9['id']}})[_0x3dbe('0x23')](function(){return _0x149c9f;});})[_0x3dbe('0x23')](function(){_0x37859e[_0x3dbe('0x2f')](0xcc)[_0x3dbe('0x2e')]();});}};}function handleEntityNotFound(_0x37690f,_0x17ced6){return function(_0x1a6cca){if(!_0x1a6cca){_0x37690f[_0x3dbe('0x2d')](0x194);}return _0x1a6cca;};}function handleError(_0x5c160d,_0x38b47b){_0x38b47b=_0x38b47b||0x1f4;return function(_0x6967c6){logger['error'](_0x6967c6[_0x3dbe('0x3c')]);if(_0x6967c6[_0x3dbe('0x3d')]){delete _0x6967c6[_0x3dbe('0x3d')];}_0x5c160d['status'](_0x38b47b)[_0x3dbe('0x3e')](_0x6967c6);};}exports[_0x3dbe('0x3f')]=function(_0x4c9703,_0xb8925d){var _0x19dfa4={'include':[{'model':db[_0x3dbe('0x40')],'as':_0x3dbe('0x41')},{'model':db[_0x3dbe('0x42')],'as':_0x3dbe('0x43')},{'model':db['Pause'],'as':_0x3dbe('0x44')}]},_0x5581da={},_0x57aebf={'count':0x0,'rows':[]};var _0x4d00ad=_[_0x3dbe('0x45')](db[_0x3dbe('0x46')][_0x3dbe('0x47')],function(_0x9411a7){return{'name':_0x9411a7[_0x3dbe('0x48')],'type':_0x9411a7[_0x3dbe('0x49')][_0x3dbe('0x4a')]};});_0x5581da[_0x3dbe('0x4b')]=_[_0x3dbe('0x45')](_0x4d00ad,_0x3dbe('0x3d'));_0x5581da[_0x3dbe('0x4c')]=_['keys'](_0x4c9703[_0x3dbe('0x4c')]);_0x5581da[_0x3dbe('0x4d')]=_[_0x3dbe('0x4e')](_0x5581da[_0x3dbe('0x4b')],_0x5581da[_0x3dbe('0x4c')]);_0x19dfa4['attributes']=_[_0x3dbe('0x4e')](_0x5581da[_0x3dbe('0x4b')],qs['fields'](_0x4c9703[_0x3dbe('0x4c')][_0x3dbe('0x4f')]));_0x19dfa4[_0x3dbe('0x50')]=_0x19dfa4[_0x3dbe('0x50')]['length']?_0x19dfa4[_0x3dbe('0x50')]:_0x5581da[_0x3dbe('0x4b')];if(!_0x4c9703[_0x3dbe('0x4c')]['hasOwnProperty']('nolimit')){_0x19dfa4[_0x3dbe('0x32')]=qs['limit'](_0x4c9703['query'][_0x3dbe('0x32')]);_0x19dfa4['offset']=qs[_0x3dbe('0x31')](_0x4c9703[_0x3dbe('0x4c')][_0x3dbe('0x31')]);}_0x19dfa4['order']=qs[_0x3dbe('0x51')](_0x4c9703[_0x3dbe('0x4c')][_0x3dbe('0x51')]);_0x19dfa4[_0x3dbe('0x52')]=qs['filters'](_['pick'](_0x4c9703['query'],_0x5581da[_0x3dbe('0x4d')]),_0x4d00ad);if(_0x4c9703[_0x3dbe('0x4c')][_0x3dbe('0x53')]){_0x19dfa4[_0x3dbe('0x52')]=_[_0x3dbe('0x54')](_0x19dfa4[_0x3dbe('0x52')],{'$or':_['map'](_0x4d00ad,function(_0x4632ef){if(_0x4632ef['type']!=='VIRTUAL'){var _0x5272d1={};_0x5272d1[_0x4632ef[_0x3dbe('0x3d')]]={'$like':'%'+_0x4c9703[_0x3dbe('0x4c')]['filter']+'%'};return _0x5272d1;}})});}_0x19dfa4=_[_0x3dbe('0x54')]({},_0x19dfa4,_0x4c9703['options']);var _0xe9b683={'where':_0x19dfa4[_0x3dbe('0x52')]};return db[_0x3dbe('0x46')]['count'](_0xe9b683)[_0x3dbe('0x23')](function(_0x4e42dd){_0x57aebf[_0x3dbe('0x33')]=_0x4e42dd;if(_0x4c9703[_0x3dbe('0x4c')][_0x3dbe('0x55')]){_0x19dfa4['include']=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x19dfa4);})['then'](function(_0x4fbe5b){_0x57aebf['rows']=_0x4fbe5b;return _0x57aebf;})['then'](respondWithFilteredResult(_0xb8925d,_0x19dfa4))[_0x3dbe('0x2c')](handleError(_0xb8925d,null));};exports[_0x3dbe('0x56')]=function(_0x4e9a29,_0x1c798d){var _0x9b301b={'raw':![],'where':{'id':_0x4e9a29[_0x3dbe('0x57')]['id']},'include':[{'model':db[_0x3dbe('0x40')],'as':_0x3dbe('0x41')},{'model':db[_0x3dbe('0x42')],'as':'Smtp'},{'model':db[_0x3dbe('0x58')],'as':_0x3dbe('0x44')}]},_0x734899={};_0x734899['model']=_[_0x3dbe('0x59')](db['MailAccount'][_0x3dbe('0x47')]);_0x734899['query']=_['keys'](_0x4e9a29['query']);_0x734899[_0x3dbe('0x4d')]=_[_0x3dbe('0x4e')](_0x734899[_0x3dbe('0x4b')],_0x734899[_0x3dbe('0x4c')]);_0x9b301b['attributes']=_[_0x3dbe('0x4e')](_0x734899[_0x3dbe('0x4b')],qs[_0x3dbe('0x4f')](_0x4e9a29[_0x3dbe('0x4c')][_0x3dbe('0x4f')]));_0x9b301b[_0x3dbe('0x50')]=_0x9b301b[_0x3dbe('0x50')]['length']?_0x9b301b[_0x3dbe('0x50')]:_0x734899[_0x3dbe('0x4b')];if(_0x4e9a29[_0x3dbe('0x4c')][_0x3dbe('0x55')]){_0x9b301b['include']=[{'all':!![]}];}_0x9b301b=_[_0x3dbe('0x54')]({},_0x9b301b,_0x4e9a29[_0x3dbe('0x5a')]);return db[_0x3dbe('0x46')][_0x3dbe('0x5b')](_0x9b301b)[_0x3dbe('0x23')](handleEntityNotFound(_0x1c798d,null))[_0x3dbe('0x23')](respondWithResult(_0x1c798d,null))[_0x3dbe('0x2c')](handleError(_0x1c798d,null));};exports['update']=function(_0x55f122,_0x356a71){if(_0x55f122[_0x3dbe('0x5c')]['id']){delete _0x55f122[_0x3dbe('0x5c')]['id'];}return db[_0x3dbe('0x46')]['find']({'where':{'id':_0x55f122['params']['id']},'include':[{'model':db[_0x3dbe('0x40')],'as':_0x3dbe('0x41')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x3dbe('0x58')],'as':_0x3dbe('0x44')}]})[_0x3dbe('0x23')](handleEntityNotFound(_0x356a71,null))[_0x3dbe('0x23')](saveUpdates(_0x55f122[_0x3dbe('0x5c')],null))['then'](function(_0x8fe50c){if(_0x8fe50c&&_0x55f122[_0x3dbe('0x5c')][_0x3dbe('0x41')]){return db[_0x3dbe('0x40')]['update'](_0x55f122[_0x3dbe('0x5c')][_0x3dbe('0x41')],{'where':{'MailAccountId':_0x8fe50c['id']}})[_0x3dbe('0x23')](function(){return _0x8fe50c;});}return _0x8fe50c;})[_0x3dbe('0x23')](function(_0x52f7fd){if(_0x52f7fd&&_0x55f122[_0x3dbe('0x5c')][_0x3dbe('0x43')]){return db[_0x3dbe('0x42')]['update'](_0x55f122[_0x3dbe('0x5c')][_0x3dbe('0x43')],{'where':{'MailAccountId':_0x52f7fd['id']}})[_0x3dbe('0x23')](function(){return _0x52f7fd;});}return _0x52f7fd;})['then'](respondWithResult(_0x356a71,null))[_0x3dbe('0x2c')](handleError(_0x356a71,null));};exports[_0x3dbe('0x5d')]=function(_0x3d1ab1,_0x30300a){return db[_0x3dbe('0x46')]['describe']()['then'](respondWithResult(_0x30300a,null))['catch'](handleError(_0x30300a,null));};exports[_0x3dbe('0x5e')]=function(_0x4875c0,_0x3dcbf1,_0x142d14){if(_0x4875c0[_0x3dbe('0x5c')]['id']){delete _0x4875c0[_0x3dbe('0x5c')]['id'];}return db[_0x3dbe('0x46')]['find']({'where':{'id':_0x4875c0[_0x3dbe('0x57')]['id']}})[_0x3dbe('0x23')](handleEntityNotFound(_0x3dcbf1,null))[_0x3dbe('0x23')](function(_0x2b50a0){if(_0x2b50a0){_0x4875c0[_0x3dbe('0x5c')][_0x3dbe('0x5f')]=_0x2b50a0['id'];return db[_0x3dbe('0x60')][_0x3dbe('0x61')](_0x4875c0['body']);}})[_0x3dbe('0x23')](respondWithResult(_0x3dcbf1,null))[_0x3dbe('0x2c')](handleError(_0x3dcbf1,null));};exports['getDispositions']=function(_0x40cce9,_0xb5f1b2,_0x5c7b39){var _0x399798={'raw':![],'where':{}};var _0x4624fa={};var _0xfd490d={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x40cce9[_0x3dbe('0x57')]['id']}})[_0x3dbe('0x23')](handleEntityNotFound(_0xb5f1b2,null))[_0x3dbe('0x23')](function(_0x3b0558){if(_0x3b0558){_0x4624fa[_0x3dbe('0x4b')]=_[_0x3dbe('0x59')](db[_0x3dbe('0x60')][_0x3dbe('0x47')]);_0x4624fa[_0x3dbe('0x4c')]=_[_0x3dbe('0x59')](_0x40cce9[_0x3dbe('0x4c')]);_0x4624fa[_0x3dbe('0x4d')]=_[_0x3dbe('0x4e')](_0x4624fa[_0x3dbe('0x4b')],_0x4624fa[_0x3dbe('0x4c')]);_0x399798[_0x3dbe('0x50')]=_[_0x3dbe('0x4e')](_0x4624fa[_0x3dbe('0x4b')],qs['fields'](_0x40cce9[_0x3dbe('0x4c')]['fields']));_0x399798[_0x3dbe('0x50')]=_0x399798[_0x3dbe('0x50')][_0x3dbe('0x62')]?_0x399798[_0x3dbe('0x50')]:_0x4624fa[_0x3dbe('0x4b')];if(!_0x40cce9[_0x3dbe('0x4c')][_0x3dbe('0x63')](_0x3dbe('0x64'))){_0x399798[_0x3dbe('0x32')]=qs[_0x3dbe('0x32')](_0x40cce9['query']['limit']);_0x399798[_0x3dbe('0x31')]=qs[_0x3dbe('0x31')](_0x40cce9[_0x3dbe('0x4c')][_0x3dbe('0x31')]);}_0x399798[_0x3dbe('0x65')]=qs['sort'](_0x40cce9[_0x3dbe('0x4c')][_0x3dbe('0x51')]);_0x399798[_0x3dbe('0x52')]=qs[_0x3dbe('0x4d')](_['pick'](_0x40cce9[_0x3dbe('0x4c')],_0x4624fa[_0x3dbe('0x4d')]));_0x399798['where'][_0x3dbe('0x5f')]=_0x3b0558['id'];if(_0x40cce9['query'][_0x3dbe('0x53')]){_0x399798['where']=_[_0x3dbe('0x54')](_0x399798['where'],{'$or':_[_0x3dbe('0x45')](_0x399798['attributes'],function(_0x55eccc){var _0xfb5cfa={};_0xfb5cfa[_0x55eccc]={'$like':'%'+_0x40cce9[_0x3dbe('0x4c')]['filter']+'%'};return _0xfb5cfa;})});}_0x399798=_[_0x3dbe('0x54')]({},_0x399798,_0x40cce9[_0x3dbe('0x5a')]);return db[_0x3dbe('0x60')][_0x3dbe('0x33')]({'where':_0x399798[_0x3dbe('0x52')]})['then'](function(_0x25034c){_0xfd490d[_0x3dbe('0x33')]=_0x25034c;if(_0x40cce9['query'][_0x3dbe('0x55')]){_0x399798[_0x3dbe('0x66')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x399798);})[_0x3dbe('0x23')](function(_0x4e74d8){_0xfd490d[_0x3dbe('0x67')]=_0x4e74d8;return _0xfd490d;});}})['then'](respondWithFilteredResult(_0xb5f1b2,_0x399798))[_0x3dbe('0x2c')](handleError(_0xb5f1b2,null));};exports[_0x3dbe('0x68')]=function(_0x1b0bd2,_0xb974b9,_0x1730fc){return db['MailAccount'][_0x3dbe('0x5b')]({'where':{'id':_0x1b0bd2[_0x3dbe('0x57')]['id']}})[_0x3dbe('0x23')](handleEntityNotFound(_0xb974b9,null))[_0x3dbe('0x23')](function(_0x1567e9){if(_0x1567e9){return _0x1567e9[_0x3dbe('0x68')](_0x1b0bd2[_0x3dbe('0x4c')][_0x3dbe('0x69')]);}})[_0x3dbe('0x23')](respondWithStatusCode(_0xb974b9,null))[_0x3dbe('0x2c')](handleError(_0xb974b9,null));};exports[_0x3dbe('0x6a')]=function(_0x1df1ac,_0x18c8cc,_0x8d5ae2){if(_0x1df1ac['body']['id']){delete _0x1df1ac[_0x3dbe('0x5c')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x1df1ac[_0x3dbe('0x57')]['id']}})[_0x3dbe('0x23')](handleEntityNotFound(_0x18c8cc,null))[_0x3dbe('0x23')](function(_0x1afd27){if(_0x1afd27){_0x1df1ac[_0x3dbe('0x5c')][_0x3dbe('0x5f')]=_0x1afd27['id'];return db[_0x3dbe('0x6b')][_0x3dbe('0x61')](_0x1df1ac[_0x3dbe('0x5c')]);}})[_0x3dbe('0x23')](respondWithResult(_0x18c8cc,null))[_0x3dbe('0x2c')](handleError(_0x18c8cc,null));};exports[_0x3dbe('0x6c')]=function(_0x239e14,_0x2fbbeb,_0x11c2fc){var _0x223500={'raw':![],'where':{}};var _0x30447b={};var _0x6e1c81={'count':0x0,'rows':[]};return db[_0x3dbe('0x46')][_0x3dbe('0x6d')]({'where':{'id':_0x239e14[_0x3dbe('0x57')]['id']}})['then'](handleEntityNotFound(_0x2fbbeb,null))[_0x3dbe('0x23')](function(_0x109a90){if(_0x109a90){_0x30447b[_0x3dbe('0x4b')]=_[_0x3dbe('0x59')](db['CannedAnswer']['rawAttributes']);_0x30447b[_0x3dbe('0x4c')]=_[_0x3dbe('0x59')](_0x239e14[_0x3dbe('0x4c')]);_0x30447b['filters']=_[_0x3dbe('0x4e')](_0x30447b[_0x3dbe('0x4b')],_0x30447b[_0x3dbe('0x4c')]);_0x223500[_0x3dbe('0x50')]=_[_0x3dbe('0x4e')](_0x30447b[_0x3dbe('0x4b')],qs[_0x3dbe('0x4f')](_0x239e14[_0x3dbe('0x4c')][_0x3dbe('0x4f')]));_0x223500[_0x3dbe('0x50')]=_0x223500[_0x3dbe('0x50')][_0x3dbe('0x62')]?_0x223500['attributes']:_0x30447b[_0x3dbe('0x4b')];if(!_0x239e14[_0x3dbe('0x4c')][_0x3dbe('0x63')]('nolimit')){_0x223500[_0x3dbe('0x32')]=qs['limit'](_0x239e14['query'][_0x3dbe('0x32')]);_0x223500[_0x3dbe('0x31')]=qs['offset'](_0x239e14['query'][_0x3dbe('0x31')]);}_0x223500[_0x3dbe('0x65')]=qs[_0x3dbe('0x51')](_0x239e14[_0x3dbe('0x4c')][_0x3dbe('0x51')]);_0x223500[_0x3dbe('0x52')]=qs['filters'](_['pick'](_0x239e14[_0x3dbe('0x4c')],_0x30447b[_0x3dbe('0x4d')]));_0x223500[_0x3dbe('0x52')][_0x3dbe('0x5f')]=_0x109a90['id'];if(_0x239e14[_0x3dbe('0x4c')][_0x3dbe('0x53')]){_0x223500[_0x3dbe('0x52')]=_[_0x3dbe('0x54')](_0x223500[_0x3dbe('0x52')],{'$or':_[_0x3dbe('0x45')](_0x223500[_0x3dbe('0x50')],function(_0x19afb9){var _0x626cc7={};_0x626cc7[_0x19afb9]={'$like':'%'+_0x239e14[_0x3dbe('0x4c')][_0x3dbe('0x53')]+'%'};return _0x626cc7;})});}_0x223500=_[_0x3dbe('0x54')]({},_0x223500,_0x239e14[_0x3dbe('0x5a')]);return db['CannedAnswer']['count']({'where':_0x223500[_0x3dbe('0x52')]})[_0x3dbe('0x23')](function(_0x366732){_0x6e1c81[_0x3dbe('0x33')]=_0x366732;if(_0x239e14[_0x3dbe('0x4c')]['includeAll']){_0x223500['include']=[{'all':!![]}];}return db[_0x3dbe('0x6b')][_0x3dbe('0x6e')](_0x223500);})[_0x3dbe('0x23')](function(_0x518d14){_0x6e1c81[_0x3dbe('0x67')]=_0x518d14;return _0x6e1c81;});}})[_0x3dbe('0x23')](respondWithFilteredResult(_0x2fbbeb,_0x223500))[_0x3dbe('0x2c')](handleError(_0x2fbbeb,null));};exports[_0x3dbe('0x6f')]=function(_0x397d88,_0x3abe17,_0x11b1c2){return db[_0x3dbe('0x46')][_0x3dbe('0x5b')]({'where':{'id':_0x397d88['params']['id']}})[_0x3dbe('0x23')](handleEntityNotFound(_0x3abe17,null))[_0x3dbe('0x23')](function(_0x88cec5){if(_0x88cec5){return _0x88cec5['removeAnswers'](_0x397d88[_0x3dbe('0x4c')][_0x3dbe('0x69')]);}})['then'](respondWithStatusCode(_0x3abe17,null))[_0x3dbe('0x2c')](handleError(_0x3abe17,null));};exports[_0x3dbe('0x61')]=function(_0x1b229d,_0x47c7f5){var _0x4f2237={'name':_0x1b229d[_0x3dbe('0x5c')][_0x3dbe('0x3d')],'key':_0x1b229d[_0x3dbe('0x5c')]['key'],'email':_0x1b229d[_0x3dbe('0x5c')]['email'],'ListId':_0x1b229d[_0x3dbe('0x5c')][_0x3dbe('0x70')],'active':!_['isNil'](_0x1b229d[_0x3dbe('0x5c')][_0x3dbe('0x71')])?_0x1b229d['body'][_0x3dbe('0x71')]:!![],'description':_0x1b229d[_0x3dbe('0x5c')]['description']||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x1b229d[_0x3dbe('0x5c')][_0x3dbe('0x72')])){if(_0x1b229d['body']['cauthentication']){_0x4f2237['Imap'][_0x3dbe('0x73')]=_0x4f2237[_0x3dbe('0x43')]['user']=_0x1b229d[_0x3dbe('0x5c')][_0x3dbe('0x74')];_0x4f2237[_0x3dbe('0x41')][_0x3dbe('0x75')]=_0x4f2237['Smtp'][_0x3dbe('0x76')]=_0x1b229d[_0x3dbe('0x5c')][_0x3dbe('0x77')];}else{_0x4f2237['Imap'][_0x3dbe('0x78')]=_0x4f2237['Smtp'][_0x3dbe('0x78')]=![];}_0x4f2237[_0x3dbe('0x41')][_0x3dbe('0x79')]=_0x1b229d[_0x3dbe('0x5c')][_0x3dbe('0x41')][_0x3dbe('0x79')];_0x4f2237[_0x3dbe('0x41')][_0x3dbe('0x7a')]=_0x1b229d['body'][_0x3dbe('0x41')][_0x3dbe('0x7a')];_0x4f2237['Smtp'][_0x3dbe('0x79')]=_0x1b229d[_0x3dbe('0x5c')][_0x3dbe('0x43')][_0x3dbe('0x79')];_0x4f2237[_0x3dbe('0x43')][_0x3dbe('0x7a')]=_0x1b229d['body'][_0x3dbe('0x43')][_0x3dbe('0x7a')];}else{_0x4f2237[_0x3dbe('0x41')][_0x3dbe('0x7b')]=_0x4f2237['Smtp'][_0x3dbe('0x7b')]=_0x1b229d[_0x3dbe('0x5c')]['cservice'];_0x4f2237['Imap'][_0x3dbe('0x73')]=_0x4f2237['Smtp'][_0x3dbe('0x73')]=_0x1b229d['body'][_0x3dbe('0x74')];_0x4f2237[_0x3dbe('0x41')][_0x3dbe('0x75')]=_0x4f2237[_0x3dbe('0x43')][_0x3dbe('0x76')]=_0x1b229d[_0x3dbe('0x5c')][_0x3dbe('0x77')];}return db[_0x3dbe('0x46')]['create'](_0x4f2237,{'include':[{'model':db[_0x3dbe('0x42')],'as':_0x3dbe('0x43')},{'model':db[_0x3dbe('0x40')],'as':_0x3dbe('0x41')}]})[_0x3dbe('0x23')](function(_0x237949){var _0x25c4f7=_0x1b229d[_0x3dbe('0x73')]['get']({'plain':!![]});if(!_0x25c4f7)throw new Error(_0x3dbe('0x7c'));if(_0x25c4f7[_0x3dbe('0x7d')]===_0x3dbe('0x73')){var _0xe431a2=_0x237949[_0x3dbe('0x7e')]({'plain':!![]});return db[_0x3dbe('0x7f')][_0x3dbe('0x5b')]({'where':{'name':_0x3dbe('0x3a'),'userProfileId':_0x25c4f7[_0x3dbe('0x80')]},'raw':!![]})[_0x3dbe('0x23')](function(_0x3eb8bb){if(_0x3eb8bb&&_0x3eb8bb[_0x3dbe('0x81')]===0x0){return db[_0x3dbe('0x3b')][_0x3dbe('0x61')]({'name':_0xe431a2['name'],'resourceId':_0xe431a2['id'],'type':_0x3eb8bb[_0x3dbe('0x3d')],'sectionId':_0x3eb8bb['id']},{})[_0x3dbe('0x23')](function(){return _0x237949;});}else{return _0x237949;}})[_0x3dbe('0x2c')](function(_0x4f5f79){logger[_0x3dbe('0x28')](_0x3dbe('0x82'),_0x4f5f79);throw _0x4f5f79;});}return _0x237949;})[_0x3dbe('0x23')](respondWithResult(_0x47c7f5,0xc9))[_0x3dbe('0x2c')](handleError(_0x47c7f5,null));};exports[_0x3dbe('0x83')]=function(_0x105262,_0xc786d6,_0x3bd46f){return db['MailAccount']['findOne']({'where':{'id':_0x105262[_0x3dbe('0x57')]['id']}})[_0x3dbe('0x23')](handleEntityNotFound(_0xc786d6,null))[_0x3dbe('0x23')](function(_0x3b52bb){if(_0x3b52bb){return _0x3b52bb[_0x3dbe('0x83')]();}return null;})[_0x3dbe('0x23')](respondWithResult(_0xc786d6,null))['catch'](handleError(_0xc786d6,null));};exports[_0x3dbe('0x84')]=function(_0x596e0a,_0x293c98,_0x3cf0ff){if(_0x596e0a['body']['id']){delete _0x596e0a[_0x3dbe('0x5c')]['id'];}return db[_0x3dbe('0x46')][_0x3dbe('0x5b')]({'where':{'id':_0x596e0a[_0x3dbe('0x57')]['id']}})[_0x3dbe('0x23')](handleEntityNotFound(_0x293c98,null))[_0x3dbe('0x23')](function(_0x1021a4){if(_0x1021a4){_0x596e0a[_0x3dbe('0x5c')][_0x3dbe('0x5f')]=_0x1021a4['id'];return db[_0x3dbe('0x40')][_0x3dbe('0x61')](_0x596e0a['body']);}})[_0x3dbe('0x23')](respondWithResult(_0x293c98,null))[_0x3dbe('0x2c')](handleError(_0x293c98,null));};exports[_0x3dbe('0x85')]=function(_0x300752,_0xd475e9,_0x10eaa6){return db[_0x3dbe('0x46')][_0x3dbe('0x6d')]({'where':{'id':_0x300752[_0x3dbe('0x57')]['id']}})[_0x3dbe('0x23')](handleEntityNotFound(_0xd475e9,null))[_0x3dbe('0x23')](function(_0xdedb08){if(_0xdedb08){return _0xdedb08[_0x3dbe('0x86')](null);}return null;})[_0x3dbe('0x23')](respondWithStatusCode(_0xd475e9,null))['catch'](handleError(_0xd475e9,null));};exports[_0x3dbe('0x87')]=function(_0xc6cbb9,_0x5bde0c,_0x10d7fb){return db[_0x3dbe('0x46')][_0x3dbe('0x6d')]({'where':{'id':_0xc6cbb9[_0x3dbe('0x57')]['id']}})[_0x3dbe('0x23')](handleEntityNotFound(_0x5bde0c,null))[_0x3dbe('0x23')](function(_0x561316){if(_0x561316){return _0x561316[_0x3dbe('0x87')]();}return null;})['then'](respondWithResult(_0x5bde0c,null))[_0x3dbe('0x2c')](handleError(_0x5bde0c,null));};exports[_0x3dbe('0x88')]=function(_0x2a3b24,_0x497ecd,_0x44a05f){if(_0x2a3b24[_0x3dbe('0x5c')]['id']){delete _0x2a3b24[_0x3dbe('0x5c')]['id'];}return db[_0x3dbe('0x46')]['find']({'where':{'id':_0x2a3b24['params']['id']}})[_0x3dbe('0x23')](handleEntityNotFound(_0x497ecd,null))['then'](function(_0x2b3d6b){if(_0x2b3d6b){_0x2a3b24['body'][_0x3dbe('0x5f')]=_0x2b3d6b['id'];return db[_0x3dbe('0x42')][_0x3dbe('0x61')](_0x2a3b24['body']);}})[_0x3dbe('0x23')](respondWithResult(_0x497ecd,null))['catch'](handleError(_0x497ecd,null));};exports[_0x3dbe('0x89')]=function(_0x4edb8a,_0x1ea187,_0x5af1db){return db[_0x3dbe('0x46')][_0x3dbe('0x6d')]({'where':{'id':_0x4edb8a[_0x3dbe('0x57')]['id']}})[_0x3dbe('0x23')](handleEntityNotFound(_0x1ea187,null))[_0x3dbe('0x23')](function(_0x3e9922){if(_0x3e9922){return _0x3e9922[_0x3dbe('0x8a')](null);}return null;})[_0x3dbe('0x23')](respondWithStatusCode(_0x1ea187,null))[_0x3dbe('0x2c')](handleError(_0x1ea187,null));};exports[_0x3dbe('0x8b')]=function(_0xde1018,_0x149651,_0x1bcb47){return db[_0x3dbe('0x8c')][_0x3dbe('0x5b')]({'where':{'id':_0xde1018[_0x3dbe('0x57')]['id']}})['then'](handleEntityNotFound(_0x149651,null))[_0x3dbe('0x23')](function(_0x263114){if(_0x263114){return _0x263114['addInteraction'](_0xde1018[_0x3dbe('0x5c')]['ids'],_['omit'](_0xde1018[_0x3dbe('0x5c')],[_0x3dbe('0x69'),'id'])||{});}})['then'](respondWithResult(_0x149651,null))[_0x3dbe('0x2c')](handleError(_0x149651,null));};exports[_0x3dbe('0x8d')]=function(_0xe2b6e5,_0x53c4da,_0x593803){var _0x461409={'raw':![],'where':{}};var _0x4d2ae4={};var _0x5ca8c5={'count':0x0,'rows':[]};return db['MailAccount'][_0x3dbe('0x6d')]({'where':{'id':_0xe2b6e5[_0x3dbe('0x57')]['id']}})[_0x3dbe('0x23')](handleEntityNotFound(_0x53c4da,null))[_0x3dbe('0x23')](function(_0x5f2e05){if(_0x5f2e05){_0x4d2ae4[_0x3dbe('0x4b')]=_[_0x3dbe('0x59')](db[_0x3dbe('0x8c')][_0x3dbe('0x47')]);_0x4d2ae4[_0x3dbe('0x4c')]=_['keys'](_0xe2b6e5['query']);_0x4d2ae4[_0x3dbe('0x4d')]=_[_0x3dbe('0x4e')](_0x4d2ae4['model'],_0x4d2ae4['query']);_0x461409[_0x3dbe('0x50')]=_[_0x3dbe('0x4e')](_0x4d2ae4[_0x3dbe('0x4b')],qs[_0x3dbe('0x4f')](_0xe2b6e5[_0x3dbe('0x4c')][_0x3dbe('0x4f')]));_0x461409[_0x3dbe('0x50')]=_0x461409[_0x3dbe('0x50')]['length']?_0x461409[_0x3dbe('0x50')]:_0x4d2ae4[_0x3dbe('0x4b')];if(!_0xe2b6e5[_0x3dbe('0x4c')][_0x3dbe('0x63')](_0x3dbe('0x64'))){_0x461409[_0x3dbe('0x32')]=qs[_0x3dbe('0x32')](_0xe2b6e5[_0x3dbe('0x4c')][_0x3dbe('0x32')]);_0x461409[_0x3dbe('0x31')]=qs[_0x3dbe('0x31')](_0xe2b6e5[_0x3dbe('0x4c')]['offset']);}_0x461409['order']=qs[_0x3dbe('0x51')](_0xe2b6e5[_0x3dbe('0x4c')][_0x3dbe('0x51')]);_0x461409[_0x3dbe('0x52')]=qs[_0x3dbe('0x4d')](_[_0x3dbe('0x8e')](_0xe2b6e5[_0x3dbe('0x4c')],_0x4d2ae4[_0x3dbe('0x4d')]));_0x461409[_0x3dbe('0x52')][_0x3dbe('0x5f')]=_0x5f2e05['id'];if(_0xe2b6e5[_0x3dbe('0x4c')][_0x3dbe('0x53')]){_0x461409[_0x3dbe('0x52')]=_['merge'](_0x461409[_0x3dbe('0x52')],{'$or':_[_0x3dbe('0x45')](_0x461409['attributes'],function(_0x2a5bd8){var _0x45cf22={};_0x45cf22[_0x2a5bd8]={'$like':'%'+_0xe2b6e5[_0x3dbe('0x4c')][_0x3dbe('0x53')]+'%'};return _0x45cf22;})});}_0x461409=_['merge']({},_0x461409,_0xe2b6e5[_0x3dbe('0x5a')]);return db[_0x3dbe('0x8c')][_0x3dbe('0x33')]({'where':_0x461409[_0x3dbe('0x52')]})[_0x3dbe('0x23')](function(_0x254cda){_0x5ca8c5['count']=_0x254cda;if(_0xe2b6e5['query']['includeAll']){_0x461409[_0x3dbe('0x66')]=[{'model':db[_0x3dbe('0x8f')],'as':_0x3dbe('0x90'),'required':![]},{'model':db[_0x3dbe('0x91')],'as':'Owner','attributes':[_0x3dbe('0x3d'),_0x3dbe('0x92'),_0x3dbe('0x93')],'required':![]},{'model':db[_0x3dbe('0x94')],'as':_0x3dbe('0x95'),'attributes':['id',_0x3dbe('0x3d'),'color'],'where':_0xe2b6e5[_0x3dbe('0x4c')][_0x3dbe('0x96')]?{'id':_0xe2b6e5['query'][_0x3dbe('0x96')]}:undefined,'required':_0xe2b6e5[_0x3dbe('0x4c')][_0x3dbe('0x96')]?!![]:![]}];}return db['MailInteraction'][_0x3dbe('0x6e')](_0x461409);})['then'](function(_0x359828){_0x5ca8c5['rows']=_0x359828;return _0x5ca8c5;});}})[_0x3dbe('0x23')](respondWithFilteredResult(_0x53c4da,_0x461409))['catch'](handleError(_0x53c4da,null));};exports[_0x3dbe('0x97')]=function(_0x2eca25,_0x3f45fc,_0x5b9332){return db[_0x3dbe('0x46')][_0x3dbe('0x6d')]({'where':{'id':_0x2eca25[_0x3dbe('0x57')]['id']}})[_0x3dbe('0x23')](handleEntityNotFound(_0x3f45fc,null))['then'](function(_0xf0c41d){if(_0xf0c41d){return db['sequelize'][_0x3dbe('0x98')](function(_0x319b6b){return db[_0x3dbe('0x99')][_0x3dbe('0x39')]({'where':{'MailAccountId':_0x2eca25['params']['id']},'transaction':_0x319b6b})[_0x3dbe('0x23')](function(_0x5352b9){var _0x2b697e=_[_0x3dbe('0x45')](_0x2eca25['body'],function(_0x1eca6e){_0x1eca6e['MailAccountId']=_0x2eca25[_0x3dbe('0x57')]['id'];return _0x1eca6e;});return db['MailApplication'][_0x3dbe('0x9a')](_0x2b697e,{'transaction':_0x319b6b});});})[_0x3dbe('0x23')](function(){return db[_0x3dbe('0x99')][_0x3dbe('0x9b')]({'where':{'MailAccountId':_0x2eca25[_0x3dbe('0x57')]['id']},'order':_0x3dbe('0x9c')});});}})[_0x3dbe('0x23')](respondWithResult(_0x3f45fc,null))[_0x3dbe('0x2c')](handleError(_0x3f45fc,null));};exports[_0x3dbe('0x9d')]=function(_0x15b615,_0x37c54a,_0x2079e4){var _0x503e53={};var _0x9f43a1={};var _0x345bc6;var _0x16037d;return db[_0x3dbe('0x46')]['findOne']({'where':{'id':_0x15b615[_0x3dbe('0x57')]['id']}})['then'](handleEntityNotFound(_0x37c54a,null))[_0x3dbe('0x23')](function(_0x48b84b){if(_0x48b84b){_0x345bc6=_0x48b84b;_0x9f43a1[_0x3dbe('0x4b')]=_[_0x3dbe('0x59')](db[_0x3dbe('0x99')][_0x3dbe('0x47')]);_0x9f43a1[_0x3dbe('0x4c')]=_['keys'](_0x15b615[_0x3dbe('0x4c')]);_0x9f43a1[_0x3dbe('0x4d')]=_[_0x3dbe('0x4e')](_0x9f43a1[_0x3dbe('0x4b')],_0x9f43a1[_0x3dbe('0x4c')]);_0x503e53[_0x3dbe('0x50')]=_['intersection'](_0x9f43a1[_0x3dbe('0x4b')],qs[_0x3dbe('0x4f')](_0x15b615[_0x3dbe('0x4c')][_0x3dbe('0x4f')]));_0x503e53[_0x3dbe('0x50')]=_0x503e53[_0x3dbe('0x50')]['length']?_0x503e53[_0x3dbe('0x50')]:_0x9f43a1['model'];_0x503e53[_0x3dbe('0x65')]=qs[_0x3dbe('0x51')](_0x15b615[_0x3dbe('0x4c')][_0x3dbe('0x51')]);_0x503e53[_0x3dbe('0x52')]=qs[_0x3dbe('0x4d')](_['pick'](_0x15b615[_0x3dbe('0x4c')],_0x9f43a1[_0x3dbe('0x4d')]));if(_0x15b615[_0x3dbe('0x4c')][_0x3dbe('0x53')]){_0x503e53[_0x3dbe('0x52')]=_[_0x3dbe('0x54')](_0x503e53['where'],{'$or':_[_0x3dbe('0x45')](_0x503e53[_0x3dbe('0x50')],function(_0x5aafcf){var _0x3ab902={};_0x3ab902[_0x5aafcf]={'$like':'%'+_0x15b615[_0x3dbe('0x4c')][_0x3dbe('0x53')]+'%'};return _0x3ab902;})});}_0x503e53=_['merge']({},_0x503e53,_0x15b615[_0x3dbe('0x5a')]);return _0x345bc6[_0x3dbe('0x9d')](_0x503e53);}})[_0x3dbe('0x23')](function(_0x3e945c){if(_0x3e945c){_0x16037d=_0x3e945c[_0x3dbe('0x62')];if(!_0x15b615[_0x3dbe('0x4c')][_0x3dbe('0x63')](_0x3dbe('0x64'))){_0x503e53[_0x3dbe('0x32')]=qs['limit'](_0x15b615[_0x3dbe('0x4c')][_0x3dbe('0x32')]);_0x503e53[_0x3dbe('0x31')]=qs[_0x3dbe('0x31')](_0x15b615[_0x3dbe('0x4c')][_0x3dbe('0x31')]);}return _0x345bc6[_0x3dbe('0x9d')](_0x503e53);}})[_0x3dbe('0x23')](function(_0x772491){if(_0x772491){return _0x772491?{'count':_0x16037d,'rows':_0x772491}:null;}})[_0x3dbe('0x23')](respondWithResult(_0x37c54a,null))['catch'](handleError(_0x37c54a,null));};exports['getMessages']=function(_0x16f747,_0x2e7409,_0x5c6b1a){var _0x1f24f0={'raw':!![],'where':{}};var _0x1bbe1c={};var _0xd883b3={'count':0x0,'rows':[]};return db[_0x3dbe('0x46')][_0x3dbe('0x6d')]({'where':{'id':_0x16f747[_0x3dbe('0x57')]['id']}})['then'](handleEntityNotFound(_0x2e7409,null))[_0x3dbe('0x23')](function(_0x195a72){if(_0x195a72){_0x1bbe1c[_0x3dbe('0x4b')]=_[_0x3dbe('0x59')](db[_0x3dbe('0x9e')][_0x3dbe('0x47')]);_0x1bbe1c[_0x3dbe('0x4c')]=_[_0x3dbe('0x59')](_0x16f747[_0x3dbe('0x4c')]);_0x1bbe1c[_0x3dbe('0x4d')]=_[_0x3dbe('0x4e')](_0x1bbe1c['model'],_0x1bbe1c[_0x3dbe('0x4c')]);_0x1f24f0['attributes']=_[_0x3dbe('0x4e')](_0x1bbe1c[_0x3dbe('0x4b')],qs[_0x3dbe('0x4f')](_0x16f747[_0x3dbe('0x4c')][_0x3dbe('0x4f')]));_0x1f24f0[_0x3dbe('0x50')]=_0x1f24f0[_0x3dbe('0x50')][_0x3dbe('0x62')]?_0x1f24f0[_0x3dbe('0x50')]:_0x1bbe1c[_0x3dbe('0x4b')];if(!_0x16f747['query']['hasOwnProperty'](_0x3dbe('0x64'))){_0x1f24f0[_0x3dbe('0x32')]=qs[_0x3dbe('0x32')](_0x16f747[_0x3dbe('0x4c')][_0x3dbe('0x32')]);_0x1f24f0['offset']=qs[_0x3dbe('0x31')](_0x16f747[_0x3dbe('0x4c')][_0x3dbe('0x31')]);}_0x1f24f0[_0x3dbe('0x65')]=qs[_0x3dbe('0x51')](_0x16f747['query']['sort']);_0x1f24f0[_0x3dbe('0x52')]=qs[_0x3dbe('0x4d')](_[_0x3dbe('0x8e')](_0x16f747[_0x3dbe('0x4c')],_0x1bbe1c[_0x3dbe('0x4d')]));_0x1f24f0[_0x3dbe('0x52')]['MailAccountId']=_0x195a72['id'];if(_0x16f747[_0x3dbe('0x4c')]['filter']){_0x1f24f0[_0x3dbe('0x52')]=_['merge'](_0x1f24f0[_0x3dbe('0x52')],{'$or':_[_0x3dbe('0x45')](_0x1f24f0['attributes'],function(_0x2666dc){var _0x1b35ab={};_0x1b35ab[_0x2666dc]={'$like':'%'+_0x16f747[_0x3dbe('0x4c')]['filter']+'%'};return _0x1b35ab;})});}if(_0x16f747[_0x3dbe('0x4c')][_0x3dbe('0x9f')]){var _0x28572a=_0x16f747[_0x3dbe('0x4c')][_0x3dbe('0x9f')][_0x3dbe('0xa0')](',');var _0x158bb6={};_0x158bb6[_0x28572a[0x0]]={'$gte':moment(_0x28572a[0x1])[_0x3dbe('0xa1')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1f24f0[_0x3dbe('0x52')]=_['merge'](_0x1f24f0[_0x3dbe('0x52')],_0x158bb6);}_0x1f24f0=_[_0x3dbe('0x54')]({},_0x1f24f0,_0x16f747[_0x3dbe('0x5a')]);return db[_0x3dbe('0x9e')]['count']({'where':_0x1f24f0[_0x3dbe('0x52')]})[_0x3dbe('0x23')](function(_0x494853){_0xd883b3[_0x3dbe('0x33')]=_0x494853;if(_0x16f747[_0x3dbe('0x4c')][_0x3dbe('0x55')]){_0x1f24f0[_0x3dbe('0x66')]=[{'all':!![]}];}return db['MailMessage'][_0x3dbe('0x6e')](_0x1f24f0);})[_0x3dbe('0x23')](function(_0x568ad4){if(_0x16f747[_0x3dbe('0x4c')][_0x3dbe('0xa2')]==='true'){for(var _0xae8217=0x0;_0xae8217<_0x568ad4[_0x3dbe('0x62')];_0xae8217++){_0x568ad4[_0xae8217][_0x3dbe('0x5c')]=juice(_0x568ad4[_0xae8217][_0x3dbe('0x5c')]);}}_0xd883b3[_0x3dbe('0x67')]=_0x568ad4;return _0xd883b3;});}})[_0x3dbe('0x23')](respondWithFilteredResult(_0x2e7409,_0x1f24f0))[_0x3dbe('0x2c')](handleError(_0x2e7409,null));};exports[_0x3dbe('0x3e')]=function(_0xb5f535,_0x11ebdf,_0x4eef16){var _0x2c56f4,_0x4db27f={},_0x50b362;if(_0xb5f535[_0x3dbe('0x5c')]['to']){_0x50b362=_0xb5f535['body']['to']['split'](',')[0x0];}return db[_0x3dbe('0x46')][_0x3dbe('0x5b')]({'where':{'id':_0xb5f535['params']['id']},'include':[{'model':db[_0x3dbe('0xa3')],'as':'List','include':[{'model':db[_0x3dbe('0x8f')],'as':'Contacts','where':{'email':_0x50b362},'limit':0x1,'order':[[_0x3dbe('0xa4'),_0x3dbe('0xa5')]]}]},{'model':db[_0x3dbe('0x42')],'as':'Smtp','raw':!![]}]})['then'](handleEntityNotFound(_0x11ebdf,null))['then'](function(_0xb3d4af){if(_0xb3d4af){_0x2c56f4=_0xb3d4af;if(_0xb3d4af[_0x3dbe('0x43')]){if(_[_0x3dbe('0xa6')](_0xb5f535[_0x3dbe('0x5c')][_0x3dbe('0xa7')])){_0xb5f535[_0x3dbe('0x5c')][_0x3dbe('0xa7')]=util[_0x3dbe('0xa1')](_0x3dbe('0xa8'),_0xb3d4af[_0x3dbe('0x3d')],_0xb3d4af[_0x3dbe('0xa9')]||_0xb3d4af[_0x3dbe('0x43')][_0x3dbe('0x73')]);}if(_0xb5f535[_0x3dbe('0x5c')][_0x3dbe('0xaa')]&&_0xb5f535[_0x3dbe('0x5c')]['attachments'][_0x3dbe('0x62')]){for(var _0x266906=0x0;_0x266906<_0xb5f535['body'][_0x3dbe('0xaa')][_0x3dbe('0x62')];_0x266906+=0x1){_0xb5f535[_0x3dbe('0x5c')][_0x3dbe('0xaa')][_0x266906]={'filename':_0xb5f535[_0x3dbe('0x5c')][_0x3dbe('0xaa')][_0x266906][_0x3dbe('0x3d')],'path':path[_0x3dbe('0xab')](config['root'],_0x3dbe('0xac'),_0xb5f535[_0x3dbe('0x5c')][_0x3dbe('0xaa')][_0x266906][_0x3dbe('0xad')])};}}var _0x5b8f38={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0xb3d4af[_0x3dbe('0x43')][_0x3dbe('0x7b')])){if(_0xb3d4af['Smtp'][_0x3dbe('0x78')]){_0x5b8f38[_0x3dbe('0xae')]={'user':_0xb3d4af[_0x3dbe('0x43')]['user'],'pass':_0xb3d4af[_0x3dbe('0x43')]['pass']};}_0x5b8f38[_0x3dbe('0x79')]=_0xb3d4af[_0x3dbe('0x43')][_0x3dbe('0x79')];_0x5b8f38[_0x3dbe('0x7a')]=_0xb3d4af[_0x3dbe('0x43')]['port'];_0x5b8f38[_0x3dbe('0xaf')]=_0xb3d4af[_0x3dbe('0x43')][_0x3dbe('0xaf')];}else{_0x5b8f38['service']=_0xb3d4af['Smtp'][_0x3dbe('0x7b')];_0x5b8f38[_0x3dbe('0xae')]={'user':_0xb3d4af[_0x3dbe('0x43')]['user'],'pass':_0xb3d4af[_0x3dbe('0x43')][_0x3dbe('0x76')]};}return respondWithRpcPromise(_0x3dbe('0xb0'),_0x3dbe('0xb1'),{'account':_0x5b8f38,'message':_0xb5f535['body']});}else{throw new Error(_0x3dbe('0xb2'));}}})['then'](function(_0x32f3c0){if(_0x32f3c0){_0x4db27f=_0x32f3c0;if(_0x2c56f4[_0x3dbe('0xb3')]){if(_0x2c56f4[_0x3dbe('0xb3')]['Contacts'][_0x3dbe('0x62')]){return _0x2c56f4[_0x3dbe('0xb3')]['Contacts'][0x0];}else{return db['CmContact']['create'](_[_0x3dbe('0x1d')](_0xb5f535[_0x3dbe('0x5c')],{'firstName':_0xb5f535['body']['to'],'email':_0xb5f535[_0x3dbe('0x5c')]['to'],'phone':_0xb5f535['body']['to'],'ListId':_0x2c56f4[_0x3dbe('0x70')]}));}}else{throw new Error(_0x3dbe('0xb2'));}}})[_0x3dbe('0x23')](function(_0xfd790e){if(_0xfd790e){var _0x30dede={'UserId':_0xb5f535[_0x3dbe('0x73')]['id'],'ContactId':_0xfd790e['id'],'MailAccountId':_0x2c56f4['id'],'inReplyTo':_0x4db27f[_0x3dbe('0xb4')],'to':_0xb5f535['body']['from'],'cc':_0xb5f535[_0x3dbe('0x5c')]['cc'],'subject':_0xb5f535[_0x3dbe('0x5c')]['subject'],'attach':_0xb5f535[_0x3dbe('0x5c')][_0x3dbe('0xb5')],'firstMsgDirection':_0x3dbe('0xb6'),'lastMsgAt':moment()['format'](_0x3dbe('0xb7')),'lastMsgDirection':_0x3dbe('0xb6'),'Messages':[_[_0x3dbe('0x54')](_0xb5f535[_0x3dbe('0x5c')],{'messageId':_0x4db27f[_0x3dbe('0xb4')],'sentAt':moment()[_0x3dbe('0xa1')](_0x3dbe('0xb7')),'read':!![],'MailAccountId':_0x2c56f4['id'],'UserId':_0xb5f535[_0x3dbe('0x73')]['id'],'ContactId':_0xfd790e['id']})]};if(_0xb5f535[_0x3dbe('0x5c')][_0x3dbe('0xb8')]){_0x30dede=_[_0x3dbe('0x54')](_0x30dede,_0xb5f535[_0x3dbe('0x5c')][_0x3dbe('0xb8')]);}return db['MailInteraction'][_0x3dbe('0x61')](_0x30dede,{'include':[{'model':db['MailMessage'],'as':'Messages'}]});}})[_0x3dbe('0x23')](respondWithResult(_0x11ebdf,null))[_0x3dbe('0x2c')](handleError(_0x11ebdf,null));};exports[_0x3dbe('0xb9')]=function(_0x51542e,_0x54eaed,_0x12d2f1){return db[_0x3dbe('0x46')][_0x3dbe('0x5b')]({'where':{'id':_0x51542e[_0x3dbe('0x57')]['id']},'include':[{'model':db[_0x3dbe('0x42')],'as':'Smtp','raw':!![]}]})[_0x3dbe('0x23')](handleEntityNotFound(_0x54eaed,null))[_0x3dbe('0x23')](function(_0x133aad){if(_0x133aad&&_0x133aad[_0x3dbe('0x43')]){var _0x4d06e6={'id':_0x133aad['id'],'tls':{'rejectUnauthorized':![]}};if(_0x133aad[_0x3dbe('0x43')][_0x3dbe('0x7b')]){_0x4d06e6[_0x3dbe('0x7b')]=_0x133aad[_0x3dbe('0x43')][_0x3dbe('0x7b')];}else{_0x4d06e6[_0x3dbe('0x79')]=_0x133aad[_0x3dbe('0x43')][_0x3dbe('0x79')];_0x4d06e6[_0x3dbe('0x7a')]=_0x133aad['Smtp'][_0x3dbe('0x7a')];_0x4d06e6[_0x3dbe('0xaf')]=_0x133aad[_0x3dbe('0x43')][_0x3dbe('0xaf')];}if(_0x133aad[_0x3dbe('0x43')][_0x3dbe('0x78')]){_0x4d06e6[_0x3dbe('0xae')]={'user':_0x133aad[_0x3dbe('0x43')][_0x3dbe('0x73')],'pass':_0x133aad['Smtp'][_0x3dbe('0x76')]};}return respondWithRpcPromise('VerifySmtp',_0x3dbe('0xb9'),{'account':_0x4d06e6});}})['then'](respondWithResult(_0x54eaed,null))[_0x3dbe('0x2c')](handleError(_0x54eaed,null));};exports[_0x3dbe('0x39')]=function(_0x2dcf0e,_0x56f3ab){return db[_0x3dbe('0x46')][_0x3dbe('0x5b')]({'where':{'id':_0x2dcf0e['params']['id']}})[_0x3dbe('0x23')](handleEntityNotFound(_0x56f3ab,null))[_0x3dbe('0x23')](function(_0x34fb2a){if(_0x34fb2a&&_0x34fb2a[_0x3dbe('0x7b')]){throw new db[(_0x3dbe('0xba'))][(_0x3dbe('0xbb'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x34fb2a;})[_0x3dbe('0x23')](removeEntity(_0x56f3ab,null))[_0x3dbe('0x2c')](handleError(_0x56f3ab,null));};exports[_0x3dbe('0xbc')]=function(_0x4661b3,_0x31b4e4,_0x549a74){return db[_0x3dbe('0x46')]['find']({'where':{'id':_0x4661b3[_0x3dbe('0x57')]['id']}})[_0x3dbe('0x23')](handleEntityNotFound(_0x31b4e4,null))[_0x3dbe('0x23')](function(_0x83d747){if(_0x83d747){return _0x83d747[_0x3dbe('0xbc')](_0x4661b3[_0x3dbe('0x5c')]['ids'],_[_0x3dbe('0xbd')](_0x4661b3[_0x3dbe('0x5c')],[_0x3dbe('0x69'),'id'])||{})[_0x3dbe('0xbe')](function(_0x2a9246){for(var _0x9b76aa=0x0;_0x9b76aa<_0x4661b3[_0x3dbe('0x5c')]['ids']['length'];_0x9b76aa+=0x1){socket['emit']('userMailAccount:save',{'UserId':Number(_0x4661b3[_0x3dbe('0x5c')][_0x3dbe('0x69')][_0x9b76aa]),'MailAccountId':Number(_0x4661b3[_0x3dbe('0x57')]['id'])});}return _0x2a9246;});}})['then'](respondWithResult(_0x31b4e4,null))[_0x3dbe('0x2c')](handleError(_0x31b4e4,null));};exports[_0x3dbe('0xbf')]=function(_0x42afc1,_0x58704e,_0x22899b){return db[_0x3dbe('0x46')][_0x3dbe('0x5b')]({'where':{'id':_0x42afc1['params']['id']}})['then'](handleEntityNotFound(_0x58704e,null))[_0x3dbe('0x23')](function(_0x388867){if(_0x388867){return _0x388867['removeAgents'](_0x42afc1[_0x3dbe('0x4c')]['ids'])[_0x3dbe('0x23')](function(){if(_[_0x3dbe('0xc0')](_0x42afc1[_0x3dbe('0x4c')]['ids'])){for(var _0x3e5433=0x0;_0x3e5433<_0x42afc1[_0x3dbe('0x4c')][_0x3dbe('0x69')][_0x3dbe('0x62')];_0x3e5433+=0x1){socket[_0x3dbe('0xc1')](_0x3dbe('0xc2'),{'UserId':Number(_0x42afc1[_0x3dbe('0x4c')][_0x3dbe('0x69')][_0x3e5433]),'MailAccountId':Number(_0x42afc1['params']['id'])});}}else{socket[_0x3dbe('0xc1')](_0x3dbe('0xc2'),{'UserId':Number(_0x42afc1[_0x3dbe('0x4c')]['ids']),'MailAccountId':Number(_0x42afc1['params']['id'])});}});}})[_0x3dbe('0x23')](respondWithStatusCode(_0x58704e,null))['catch'](handleError(_0x58704e,null));};exports[_0x3dbe('0xc3')]=function(_0x3b7e5c,_0x1edf0d,_0x2e975b){var _0x116fc2={};var _0x305b7c={};var _0x284361;var _0x4f4203;return db['MailAccount'][_0x3dbe('0x6d')]({'where':{'id':_0x3b7e5c[_0x3dbe('0x57')]['id']}})['then'](handleEntityNotFound(_0x1edf0d,null))[_0x3dbe('0x23')](function(_0x47d633){if(_0x47d633){_0x284361=_0x47d633;_0x305b7c['model']=_[_0x3dbe('0x59')](db[_0x3dbe('0x91')][_0x3dbe('0x47')]);_0x305b7c[_0x3dbe('0x4c')]=_['keys'](_0x3b7e5c['query']);_0x305b7c[_0x3dbe('0x4d')]=_[_0x3dbe('0x4e')](_0x305b7c[_0x3dbe('0x4b')],_0x305b7c[_0x3dbe('0x4c')]);_0x116fc2[_0x3dbe('0x50')]=_[_0x3dbe('0x4e')](_0x305b7c[_0x3dbe('0x4b')],qs[_0x3dbe('0x4f')](_0x3b7e5c[_0x3dbe('0x4c')][_0x3dbe('0x4f')]));_0x116fc2[_0x3dbe('0x50')]=_0x116fc2[_0x3dbe('0x50')][_0x3dbe('0x62')]?_0x116fc2[_0x3dbe('0x50')]:_0x305b7c[_0x3dbe('0x4b')];_0x116fc2['order']=qs[_0x3dbe('0x51')](_0x3b7e5c[_0x3dbe('0x4c')][_0x3dbe('0x51')]);_0x116fc2[_0x3dbe('0x52')]=qs['filters'](_['pick'](_0x3b7e5c[_0x3dbe('0x4c')],_0x305b7c[_0x3dbe('0x4d')]));if(_0x3b7e5c[_0x3dbe('0x4c')][_0x3dbe('0x53')]){_0x116fc2['where']=_[_0x3dbe('0x54')](_0x116fc2[_0x3dbe('0x52')],{'$or':_[_0x3dbe('0x45')](_0x116fc2[_0x3dbe('0x50')],function(_0x15fd3d){var _0x268e77={};_0x268e77[_0x15fd3d]={'$like':'%'+_0x3b7e5c[_0x3dbe('0x4c')]['filter']+'%'};return _0x268e77;})});}_0x116fc2=_['merge']({},_0x116fc2,_0x3b7e5c[_0x3dbe('0x5a')]);return _0x284361[_0x3dbe('0xc3')](_0x116fc2);}})[_0x3dbe('0x23')](function(_0x3f3bfe){if(_0x3f3bfe){_0x4f4203=_0x3f3bfe['length'];if(!_0x3b7e5c[_0x3dbe('0x4c')]['hasOwnProperty'](_0x3dbe('0x64'))){_0x116fc2['limit']=qs['limit'](_0x3b7e5c[_0x3dbe('0x4c')]['limit']);_0x116fc2[_0x3dbe('0x31')]=qs[_0x3dbe('0x31')](_0x3b7e5c['query'][_0x3dbe('0x31')]);}return _0x284361[_0x3dbe('0xc3')](_0x116fc2);}})[_0x3dbe('0x23')](function(_0x21524b){if(_0x21524b){return _0x21524b?{'count':_0x4f4203,'rows':_0x21524b}:null;}})['then'](respondWithResult(_0x1edf0d,null))[_0x3dbe('0x2c')](handleError(_0x1edf0d,null));};
\ No newline at end of file
index cca01e3..cc14e69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8506=['update','emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners'];(function(_0x1a4eb4,_0x56849d){var _0x29b00f=function(_0x171fe9){while(--_0x171fe9){_0x1a4eb4['push'](_0x1a4eb4['shift']());}};_0x29b00f(++_0x56849d);}(_0x8506,0xe8));var _0x6850=function(_0x1a6379,_0x1b415d){_0x1a6379=_0x1a6379-0x0;var _0x1d0132=_0x8506[_0x1a6379];return _0x1d0132;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x6850('0x0'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x6850('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6850('0x2'),'afterDestroy':'remove'};function emitEvent(_0x2e0f9d){return function(_0x204a8a,_0x321eff,_0x5e9ff2){MailAccountEvents[_0x6850('0x3')](_0x2e0f9d+':'+_0x204a8a['id'],_0x204a8a);MailAccountEvents[_0x6850('0x3')](_0x2e0f9d,_0x204a8a);_0x5e9ff2(null);};}for(var e in events){if(events[_0x6850('0x4')](e)){var event=events[e];MailAccount[_0x6850('0x5')](e,emitEvent(event));}}module['exports']=MailAccountEvents;
\ No newline at end of file
+var _0xdd68=['setMaxListeners','save','update','emit','hasOwnProperty','exports','events','MailAccount'];(function(_0x207f10,_0x1a9ff8){var _0x49f99a=function(_0x45515e){while(--_0x45515e){_0x207f10['push'](_0x207f10['shift']());}};_0x49f99a(++_0x1a9ff8);}(_0xdd68,0x196));var _0x8dd6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xdd68[_0x13d07a];return _0x5ee0ee;};'use strict';var EventEmitter=require(_0x8dd6('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x8dd6('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x8dd6('0x2')](0x0);var events={'afterCreate':_0x8dd6('0x3'),'afterUpdate':_0x8dd6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x37b71c){return function(_0x469e0c,_0x5c7c72,_0x310895){MailAccountEvents[_0x8dd6('0x5')](_0x37b71c+':'+_0x469e0c['id'],_0x469e0c);MailAccountEvents['emit'](_0x37b71c,_0x469e0c);_0x310895(null);};}for(var e in events){if(events[_0x8dd6('0x6')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x8dd6('0x7')]=MailAccountEvents;
\ No newline at end of file
index 5d08abf..9036e38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf67c=['moment','bluebird','path','rimraf','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','lodash','util','api'];(function(_0x374ab5,_0x4d7bcb){var _0x88912e=function(_0x364807){while(--_0x364807){_0x374ab5['push'](_0x374ab5['shift']());}};_0x88912e(++_0x4d7bcb);}(_0xf67c,0x135));var _0xcf67=function(_0x492686,_0x4ac9e8){_0x492686=_0x492686-0x0;var _0x246b7b=_0xf67c[_0x492686];return _0x246b7b;};'use strict';var _=require(_0xcf67('0x0'));var util=require(_0xcf67('0x1'));var logger=require('../../config/logger')(_0xcf67('0x2'));var moment=require(_0xcf67('0x3'));var BPromise=require(_0xcf67('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcf67('0x5'));var rimraf=require(_0xcf67('0x6'));var config=require(_0xcf67('0x7'));var attributes=require(_0xcf67('0x8'));module[_0xcf67('0x9')]=function(_0x1de815,_0xfd8d11){return _0x1de815[_0xcf67('0xa')](_0xcf67('0xb'),attributes,{'tableName':_0xcf67('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7764=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','define','mail_accounts'];(function(_0x57a725,_0x82c598){var _0x842833=function(_0x52235f){while(--_0x52235f){_0x57a725['push'](_0x57a725['shift']());}};_0x842833(++_0x82c598);}(_0x7764,0x113));var _0x4776=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x7764[_0x40bffc];return _0x3007e9;};'use strict';var _=require(_0x4776('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4776('0x1'));var moment=require(_0x4776('0x2'));var BPromise=require(_0x4776('0x3'));var rp=require(_0x4776('0x4'));var fs=require('fs');var path=require(_0x4776('0x5'));var rimraf=require(_0x4776('0x6'));var config=require(_0x4776('0x7'));var attributes=require(_0x4776('0x8'));module['exports']=function(_0x522945,_0x16c4dc){return _0x522945[_0x4776('0x9')]('MailAccount',attributes,{'tableName':_0x4776('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7a056a3..c44b245 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd97d=['CmContact','Contacts','updatedAt','MailApplication','MailServerOut','Smtp','get','Applications','list','applications','orderBy','priority','autoclose','push','length','close','ListId','List\x20not\x20found','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','inReplyTo','create','update','interaction','created','attachments','originTo','bcc','ChatWebsiteId','Attachment','Attachments','UserId','User','unshift','agent','name','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','defaults','localhost','socket.io-emitter','./mailAccount.socket','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetMailAccount','findAll','options','raw','attributes','limit','map','include','model','ShowMailAccount','MailAccount','find','where','NotifyMailAccount','mail','difference','keys','rawAttributes','body','from','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List'];(function(_0x1b9ac6,_0x5c7912){var _0x13517a=function(_0x5664ab){while(--_0x5664ab){_0x1b9ac6['push'](_0x1b9ac6['shift']());}};_0x13517a(++_0x5c7912);}(_0xd97d,0x15a));var _0xdd97=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xd97d[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0xdd97('0x0'));var util=require('util');var moment=require(_0xdd97('0x1'));var BPromise=require(_0xdd97('0x2'));var rs=require(_0xdd97('0x3'));var fs=require('fs');var Redis=require(_0xdd97('0x4'));var db=require(_0xdd97('0x5'))['db'];var utils=require(_0xdd97('0x6'));var logger=require(_0xdd97('0x7'))('rpc');var config=require(_0xdd97('0x8'));var jayson=require(_0xdd97('0x9'));var client=jayson['client']['http']({'port':0x232c});config['redis']=_[_0xdd97('0xa')](config['redis'],{'host':_0xdd97('0xb'),'port':0x18eb});var socket=require(_0xdd97('0xc'))(new Redis(config['redis']));require(_0xdd97('0xd'))['register'](socket);function respondWithRpcPromise(_0x4d1922,_0x34d2b5,_0x242642){return new BPromise(function(_0x44aef1,_0x8f08dd){return client['request'](_0x4d1922,_0x242642)[_0xdd97('0xe')](function(_0x363ec2){logger[_0xdd97('0xf')](_0xdd97('0x10'),_0x34d2b5,'request\x20sent');logger[_0xdd97('0x11')](_0xdd97('0x12'),_0x34d2b5,'request\x20sent',JSON[_0xdd97('0x13')](_0x363ec2));if(_0x363ec2[_0xdd97('0x14')]){if(_0x363ec2['error'][_0xdd97('0x15')]===0x1f4){logger[_0xdd97('0x14')]('MailAccount,\x20%s,\x20%s',_0x34d2b5,_0x363ec2[_0xdd97('0x14')][_0xdd97('0x16')]);return _0x8f08dd(_0x363ec2['error']['message']);}logger[_0xdd97('0x14')]('MailAccount,\x20%s,\x20%s',_0x34d2b5,_0x363ec2[_0xdd97('0x14')]['message']);return _0x44aef1(_0x363ec2[_0xdd97('0x14')]['message']);}else{logger['info'](_0xdd97('0x10'),_0x34d2b5,_0xdd97('0x17'));_0x44aef1(_0x363ec2[_0xdd97('0x18')][_0xdd97('0x16')]);}})[_0xdd97('0x19')](function(_0x1ade87){logger[_0xdd97('0x14')]('MailAccount,\x20%s,\x20%s',_0x34d2b5,_0x1ade87);_0x8f08dd(_0x1ade87);});});}exports[_0xdd97('0x1a')]=function(_0x8ca394){var _0x5bb496=this;return new Promise(function(_0x43c048,_0x5c2340){return db['MailAccount'][_0xdd97('0x1b')]({'raw':_0x8ca394[_0xdd97('0x1c')]?_0x8ca394[_0xdd97('0x1c')][_0xdd97('0x1d')]===undefined?!![]:![]:!![],'where':_0x8ca394['options']?_0x8ca394[_0xdd97('0x1c')]['where']||null:null,'attributes':_0x8ca394[_0xdd97('0x1c')]?_0x8ca394[_0xdd97('0x1c')][_0xdd97('0x1e')]||null:null,'limit':_0x8ca394[_0xdd97('0x1c')]?_0x8ca394[_0xdd97('0x1c')][_0xdd97('0x1f')]||null:null,'include':_0x8ca394[_0xdd97('0x1c')]?_0x8ca394[_0xdd97('0x1c')]['include']?_[_0xdd97('0x20')](_0x8ca394['options'][_0xdd97('0x21')],function(_0x5ae2ca){return{'model':db[_0x5ae2ca[_0xdd97('0x22')]],'as':_0x5ae2ca['as'],'attributes':_0x5ae2ca[_0xdd97('0x1e')],'include':_0x5ae2ca[_0xdd97('0x21')]?_[_0xdd97('0x20')](_0x5ae2ca[_0xdd97('0x21')],function(_0x564eea){return{'model':db[_0x564eea['model']],'as':_0x564eea['as'],'attributes':_0x564eea['attributes'],'include':_0x564eea['include']?_[_0xdd97('0x20')](_0x564eea[_0xdd97('0x21')],function(_0xabb41a){return{'model':db[_0xabb41a[_0xdd97('0x22')]],'as':_0xabb41a['as'],'attributes':_0xabb41a[_0xdd97('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47c028){logger['info'](_0xdd97('0x1a'),_0x8ca394);logger[_0xdd97('0x11')](_0xdd97('0x1a'),_0x8ca394,JSON[_0xdd97('0x13')](_0x47c028));_0x43c048(_0x47c028);})[_0xdd97('0x19')](function(_0x1a0653){logger[_0xdd97('0x14')]('GetMailAccount',_0x1a0653['message'],_0x8ca394);_0x5c2340(_0x5bb496[_0xdd97('0x14')](0x1f4,_0x1a0653['message']));});});};exports[_0xdd97('0x23')]=function(_0x11f6ca){var _0x462bf3=this;return new Promise(function(_0x3ed807,_0x311b46){return db[_0xdd97('0x24')][_0xdd97('0x25')]({'raw':_0x11f6ca['options']?_0x11f6ca[_0xdd97('0x1c')][_0xdd97('0x1d')]===undefined?!![]:![]:!![],'where':_0x11f6ca['options']?_0x11f6ca[_0xdd97('0x1c')][_0xdd97('0x26')]||null:null,'attributes':_0x11f6ca[_0xdd97('0x1c')]?_0x11f6ca[_0xdd97('0x1c')]['attributes']||null:null,'include':_0x11f6ca['options']?_0x11f6ca['options'][_0xdd97('0x21')]?_[_0xdd97('0x20')](_0x11f6ca[_0xdd97('0x1c')][_0xdd97('0x21')],function(_0x5b08ea){return{'model':db[_0x5b08ea[_0xdd97('0x22')]],'as':_0x5b08ea['as'],'attributes':_0x5b08ea[_0xdd97('0x1e')],'include':_0x5b08ea[_0xdd97('0x21')]?_[_0xdd97('0x20')](_0x5b08ea['include'],function(_0x1bb375){return{'model':db[_0x1bb375[_0xdd97('0x22')]],'as':_0x1bb375['as'],'attributes':_0x1bb375[_0xdd97('0x1e')],'include':_0x1bb375[_0xdd97('0x21')]?_[_0xdd97('0x20')](_0x1bb375[_0xdd97('0x21')],function(_0x43b2ff){return{'model':db[_0x43b2ff[_0xdd97('0x22')]],'as':_0x43b2ff['as'],'attributes':_0x43b2ff[_0xdd97('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa4879b){logger[_0xdd97('0xf')]('ShowMailAccount',_0x11f6ca);logger[_0xdd97('0x11')](_0xdd97('0x23'),_0x11f6ca,JSON[_0xdd97('0x13')](_0xa4879b));_0x3ed807(_0xa4879b);})[_0xdd97('0x19')](function(_0x1a1c2d){logger['error'](_0xdd97('0x23'),_0x1a1c2d['message'],_0x11f6ca);_0x311b46(_0x462bf3[_0xdd97('0x14')](0x1f4,_0x1a1c2d[_0xdd97('0x16')]));});});};exports[_0xdd97('0x27')]=function(_0x5f08f8){var _0x56d99f=this;return new Promise(function(_0x1a1e50,_0x2a2161){var _0x4bcf4f={'body':_0x5f08f8['body'],'channel':_0xdd97('0x28')};var _0x46d241=_[_0xdd97('0x29')](_[_0xdd97('0x2a')](db['CmContact'][_0xdd97('0x2b')]),['createdAt','updatedAt','CompanyId','ListId']);var _0x4dcc59=![];if(_0x5f08f8['body']['id']){delete _0x5f08f8['body']['id'];}if(_['isNil'](_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x2d')])){return _0x2a2161(_0x56d99f['error'](0x1f4,_0xdd97('0x2e')));}if(_[_0xdd97('0x2f')](_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x2c')])||_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x2c')]===''){return _0x2a2161(_0x56d99f[_0xdd97('0x14')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xdd97('0x2f')](_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x30')])){return _0x2a2161(_0x56d99f[_0xdd97('0x14')](0x1f4,_0xdd97('0x31')+_0x46d241));}if(!_['includes'](_0x46d241,_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x30')])){return _0x2a2161(_0x56d99f[_0xdd97('0x14')](0x1f4,_0xdd97('0x32')+_0x46d241));}var _0x573600={};_0x573600[_0x5f08f8['body'][_0xdd97('0x30')]]=_0x5f08f8['body']['from'];return db['MailAccount'][_0xdd97('0x25')]({'where':{'id':_0x5f08f8[_0xdd97('0x33')]['id']},'include':[{'model':db[_0xdd97('0x34')],'as':_0xdd97('0x35'),'include':[{'model':db[_0xdd97('0x36')],'as':_0xdd97('0x37'),'where':_0x573600,'limit':0x1,'order':[[_0xdd97('0x38'),'DESC']]}]},{'model':db[_0xdd97('0x39')],'as':'Applications'},{'model':db[_0xdd97('0x3a')],'as':_0xdd97('0x3b')}]})[_0xdd97('0xe')](function(_0x45ba42){if(_0x45ba42&&_0x45ba42['List']){var _0xbbf8d2=_0x45ba42[_0xdd97('0x3c')]({'plain':!![]});_0x4bcf4f[_0xdd97('0x33')]=_['omit'](_0xbbf8d2,[_0xdd97('0x3d'),_0xdd97('0x35')]);_0x4bcf4f['applications']=_0xbbf8d2['Applications'];_0x4bcf4f[_0xdd97('0x3e')]=_0xbbf8d2[_0xdd97('0x35')];_0x4bcf4f[_0xdd97('0x3f')]=_[_0xdd97('0x40')](_0x4bcf4f[_0xdd97('0x3f')],[_0xdd97('0x41')],['asc']);if(_0x4bcf4f[_0xdd97('0x33')]&&_0x4bcf4f[_0xdd97('0x33')][_0xdd97('0x42')]){_0x4bcf4f['applications'][_0xdd97('0x43')]({'id':0x0,'priority':_0x4bcf4f[_0xdd97('0x3f')][_0xdd97('0x44')]+0x1,'app':_0xdd97('0x45'),'appdata':_0xdd97('0x42'),'interval':'*,*,*,*'});}if(_0x4bcf4f[_0xdd97('0x33')][_0xdd97('0x3d')]){delete _0x4bcf4f[_0xdd97('0x33')][_0xdd97('0x3d')];}if(_0x4bcf4f[_0xdd97('0x33')]['List']){delete _0x4bcf4f['account'][_0xdd97('0x35')];}if(_0xbbf8d2[_0xdd97('0x35')][_0xdd97('0x37')][_0xdd97('0x44')]){return _0xbbf8d2[_0xdd97('0x35')]['Contacts'][0x0];}var _0xd7476a=_[_0xdd97('0xa')](_0x5f08f8[_0xdd97('0x2c')],{'firstName':_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x2d')],'ListId':_0xbbf8d2[_0xdd97('0x46')]});_0xd7476a[_0x5f08f8[_0xdd97('0x2c')]['mapKey']]=_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x2d')];return db['CmContact']['create'](_0xd7476a);}else{throw new Error(_0xdd97('0x47'));}})[_0xdd97('0xe')](function(_0x2f6ab2){_0x4bcf4f['contact']=_0x2f6ab2;if(_0x2f6ab2){if(!_0x5f08f8['body'][_0xdd97('0x16')]['messageId']){_0x5f08f8['body'][_0xdd97('0x16')][_0xdd97('0x48')]=rs[_0xdd97('0x49')]()+'\x20'+_0x5f08f8[_0xdd97('0x2c')]['message'][_0xdd97('0x2d')];}var _0x57f8ee={'ContactId':_0x2f6ab2['id'],'MailAccountId':_0x5f08f8[_0xdd97('0x33')]['id'],'inReplyTo':_0x5f08f8[_0xdd97('0x2c')]['message'][_0xdd97('0x48')],'to':_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x16')][_0xdd97('0x2d')],'cc':_0x5f08f8[_0xdd97('0x2c')]['message']['cc'],'subject':_0x5f08f8['body'][_0xdd97('0x16')][_0xdd97('0x4a')],'attach':_0x5f08f8[_0xdd97('0x2c')]['message'][_0xdd97('0x4b')],'lastMsgAt':moment()[_0xdd97('0x4c')](_0xdd97('0x4d')),'lastMsgDirection':'in'};return db[_0xdd97('0x4e')]['find']({'where':{'closed':![],'MailAccountId':_0x5f08f8[_0xdd97('0x33')]['id']},'include':[{'model':db[_0xdd97('0x4f')],'as':'Messages','attributes':[_0xdd97('0x48')],'where':{'messageId':_0x5f08f8['body'][_0xdd97('0x16')][_0xdd97('0x50')]}}]})['then'](function(_0x4f0eec){if(_0x4f0eec){return[_0x4f0eec,![]];}return db['MailInteraction'][_0xdd97('0x51')](_0x57f8ee)[_0xdd97('0xe')](function(_0x21959b){return[_0x21959b,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0xf5dfc5,_0x3ae2f4){if(_0xf5dfc5){_0x4dcc59=_0x3ae2f4;if(!_0x3ae2f4){return _0xf5dfc5[_0xdd97('0x52')]({'inReplyTo':_0x5f08f8['body'][_0xdd97('0x16')][_0xdd97('0x48')],'to':_0x5f08f8['body'][_0xdd97('0x16')][_0xdd97('0x2d')],'cc':_0x5f08f8['body'][_0xdd97('0x16')]['cc'],'subject':_0x5f08f8['body'][_0xdd97('0x16')][_0xdd97('0x4a')],'attach':_0xf5dfc5[_0xdd97('0x4b')]?_0xf5dfc5['attach']:_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x16')][_0xdd97('0x4b')],'substatus':null,'substatusAt':moment()[_0xdd97('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0xf5dfc5;}}})[_0xdd97('0xe')](function(_0x186f57){_0x4bcf4f['interaction']=_0x186f57['get']({'plain':!![]});_0x4bcf4f[_0xdd97('0x53')][_0xdd97('0x54')]=_0x4dcc59;return db['MailMessage']['create']({'body':_0x5f08f8[_0xdd97('0x2c')]['body'],'MailAccountId':_0x5f08f8[_0xdd97('0x33')]['id'],'MailInteractionId':_0x186f57['id'],'direction':'in','ContactId':_0x4bcf4f['contact']['id'],'messageId':_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x16')][_0xdd97('0x48')],'from':_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x16')][_0xdd97('0x2d')],'to':_0x5f08f8['body']['message']['to'],'cc':_0x5f08f8['body'][_0xdd97('0x16')]['cc'],'subject':_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x16')][_0xdd97('0x4a')],'attach':_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x16')][_0xdd97('0x4b')],'Attachments':_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x16')][_0xdd97('0x55')],'originTo':_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x16')][_0xdd97('0x56')],'originCc':_0x5f08f8['body'][_0xdd97('0x16')]['originCc'],'bcc':_0x5f08f8[_0xdd97('0x2c')]['message'][_0xdd97('0x57')],'ChatWebsiteId':_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x16')][_0xdd97('0x58')]||null,'originChannel':_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x16')]['originChannel']||'Email','ChatOfflineMessageId':_0x5f08f8['body']['message']['ChatOfflineMessageId']||null},{'include':[{'model':db[_0xdd97('0x59')],'as':_0xdd97('0x5a')}]});})[_0xdd97('0xe')](function(_0x5ea145){_0x4bcf4f['message']=_0x5ea145;if(_0x4bcf4f['interaction'][_0xdd97('0x5b')]){return db[_0xdd97('0x5c')][_0xdd97('0x25')]({'attributes':['id','name'],'where':{'id':_0x4bcf4f[_0xdd97('0x53')]['UserId']}})[_0xdd97('0xe')](function(_0x1bf8a8){if(_0x1bf8a8){_0x4bcf4f[_0xdd97('0x3f')][_0xdd97('0x5d')]({'id':0x0,'priority':0x0,'app':_0xdd97('0x5e'),'appdata':_0x1bf8a8[_0xdd97('0x5f')]+','+(_0x4bcf4f[_0xdd97('0x33')][_0xdd97('0x60')]||0xa),'interval':_0xdd97('0x61')});}return respondWithRpcPromise(_0xdd97('0x62'),_0xdd97('0x63'),_0x4bcf4f);});}return respondWithRpcPromise(_0xdd97('0x62'),_0xdd97('0x63'),_0x4bcf4f);})['then'](function(_0x135f27){_0x1a1e50(_0x135f27);})[_0xdd97('0x19')](function(_0x4bebbb){_0x2a2161(_0x56d99f[_0xdd97('0x14')](0x1f4,_0x4bebbb[_0xdd97('0x16')]));});});};
\ No newline at end of file
+var _0x8bf4=['rpc','../../config/environment','client','redis','defaults','socket.io-emitter','register','request','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','model','map','then','ShowMailAccount','find','NotifyMailAccount','mail','difference','keys','CmContact','rawAttributes','updatedAt','CompanyId','ListId','body','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','Contacts','DESC','MailApplication','MailServerOut','List','omit','Applications','applications','orderBy','priority','asc','autoclose','push','length','*,*,*,*','List\x20not\x20found','contact','messageId','generate','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','create','Contact\x20not\x20found','spread','update','format','get','interaction','created','subject','bcc','Email','ChatOfflineMessageId','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0x3fc9f2,_0x563559){var _0x3b7a42=function(_0x445999){while(--_0x445999){_0x3fc9f2['push'](_0x3fc9f2['shift']());}};_0x3b7a42(++_0x563559);}(_0x8bf4,0x134));var _0x48bf=function(_0x498334,_0x27b6fe){_0x498334=_0x498334-0x0;var _0x13bb70=_0x8bf4[_0x498334];return _0x13bb70;};'use strict';var _=require(_0x48bf('0x0'));var util=require(_0x48bf('0x1'));var moment=require(_0x48bf('0x2'));var BPromise=require(_0x48bf('0x3'));var rs=require(_0x48bf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x48bf('0x5'));var logger=require(_0x48bf('0x6'))(_0x48bf('0x7'));var config=require(_0x48bf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x48bf('0x9')]['http']({'port':0x232c});config[_0x48bf('0xa')]=_[_0x48bf('0xb')](config[_0x48bf('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x48bf('0xc'))(new Redis(config['redis']));require('./mailAccount.socket')[_0x48bf('0xd')](socket);function respondWithRpcPromise(_0x8f9feb,_0x486fcf,_0x3c9431){return new BPromise(function(_0x32c0a3,_0x4ed369){return client[_0x48bf('0xe')](_0x8f9feb,_0x3c9431)['then'](function(_0x451243){logger['info'](_0x48bf('0xf'),_0x486fcf,'request\x20sent');logger[_0x48bf('0x10')](_0x48bf('0x11'),_0x486fcf,_0x48bf('0x12'),JSON[_0x48bf('0x13')](_0x451243));if(_0x451243[_0x48bf('0x14')]){if(_0x451243[_0x48bf('0x14')][_0x48bf('0x15')]===0x1f4){logger['error'](_0x48bf('0xf'),_0x486fcf,_0x451243['error'][_0x48bf('0x16')]);return _0x4ed369(_0x451243[_0x48bf('0x14')][_0x48bf('0x16')]);}logger['error'](_0x48bf('0xf'),_0x486fcf,_0x451243['error']['message']);return _0x32c0a3(_0x451243[_0x48bf('0x14')]['message']);}else{logger[_0x48bf('0x17')](_0x48bf('0xf'),_0x486fcf,_0x48bf('0x12'));_0x32c0a3(_0x451243[_0x48bf('0x18')]['message']);}})[_0x48bf('0x19')](function(_0x3f0e2b){logger[_0x48bf('0x14')](_0x48bf('0xf'),_0x486fcf,_0x3f0e2b);_0x4ed369(_0x3f0e2b);});});}exports[_0x48bf('0x1a')]=function(_0x211d3a){var _0x1b094e=this;return new Promise(function(_0x3efe11,_0xa4c699){return db[_0x48bf('0x1b')][_0x48bf('0x1c')]({'raw':_0x211d3a[_0x48bf('0x1d')]?_0x211d3a['options'][_0x48bf('0x1e')]===undefined?!![]:![]:!![],'where':_0x211d3a['options']?_0x211d3a['options'][_0x48bf('0x1f')]||null:null,'attributes':_0x211d3a[_0x48bf('0x1d')]?_0x211d3a[_0x48bf('0x1d')][_0x48bf('0x20')]||null:null,'limit':_0x211d3a[_0x48bf('0x1d')]?_0x211d3a[_0x48bf('0x1d')][_0x48bf('0x21')]||null:null,'include':_0x211d3a['options']?_0x211d3a[_0x48bf('0x1d')][_0x48bf('0x22')]?_['map'](_0x211d3a['options']['include'],function(_0x3a0f02){return{'model':db[_0x3a0f02[_0x48bf('0x23')]],'as':_0x3a0f02['as'],'attributes':_0x3a0f02[_0x48bf('0x20')],'include':_0x3a0f02[_0x48bf('0x22')]?_[_0x48bf('0x24')](_0x3a0f02['include'],function(_0x5be420){return{'model':db[_0x5be420['model']],'as':_0x5be420['as'],'attributes':_0x5be420[_0x48bf('0x20')],'include':_0x5be420[_0x48bf('0x22')]?_[_0x48bf('0x24')](_0x5be420[_0x48bf('0x22')],function(_0xa5cee3){return{'model':db[_0xa5cee3['model']],'as':_0xa5cee3['as'],'attributes':_0xa5cee3[_0x48bf('0x20')]};}):[]};}):[]};}):[]:[]})[_0x48bf('0x25')](function(_0x1565b5){logger[_0x48bf('0x17')](_0x48bf('0x1a'),_0x211d3a);logger[_0x48bf('0x10')](_0x48bf('0x1a'),_0x211d3a,JSON['stringify'](_0x1565b5));_0x3efe11(_0x1565b5);})[_0x48bf('0x19')](function(_0x19b3e4){logger[_0x48bf('0x14')]('GetMailAccount',_0x19b3e4[_0x48bf('0x16')],_0x211d3a);_0xa4c699(_0x1b094e[_0x48bf('0x14')](0x1f4,_0x19b3e4[_0x48bf('0x16')]));});});};exports[_0x48bf('0x26')]=function(_0x2f4c24){var _0x2c29f6=this;return new Promise(function(_0x3c5a9c,_0x2a741d){return db[_0x48bf('0x1b')][_0x48bf('0x27')]({'raw':_0x2f4c24[_0x48bf('0x1d')]?_0x2f4c24[_0x48bf('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x2f4c24[_0x48bf('0x1d')]?_0x2f4c24[_0x48bf('0x1d')]['where']||null:null,'attributes':_0x2f4c24[_0x48bf('0x1d')]?_0x2f4c24[_0x48bf('0x1d')][_0x48bf('0x20')]||null:null,'include':_0x2f4c24[_0x48bf('0x1d')]?_0x2f4c24['options']['include']?_['map'](_0x2f4c24['options'][_0x48bf('0x22')],function(_0xa7ef7a){return{'model':db[_0xa7ef7a[_0x48bf('0x23')]],'as':_0xa7ef7a['as'],'attributes':_0xa7ef7a[_0x48bf('0x20')],'include':_0xa7ef7a[_0x48bf('0x22')]?_[_0x48bf('0x24')](_0xa7ef7a[_0x48bf('0x22')],function(_0x5074a3){return{'model':db[_0x5074a3['model']],'as':_0x5074a3['as'],'attributes':_0x5074a3[_0x48bf('0x20')],'include':_0x5074a3[_0x48bf('0x22')]?_[_0x48bf('0x24')](_0x5074a3['include'],function(_0x3e9851){return{'model':db[_0x3e9851['model']],'as':_0x3e9851['as'],'attributes':_0x3e9851[_0x48bf('0x20')]};}):[]};}):[]};}):[]:[]})[_0x48bf('0x25')](function(_0x368897){logger[_0x48bf('0x17')](_0x48bf('0x26'),_0x2f4c24);logger[_0x48bf('0x10')]('ShowMailAccount',_0x2f4c24,JSON[_0x48bf('0x13')](_0x368897));_0x3c5a9c(_0x368897);})[_0x48bf('0x19')](function(_0x513f63){logger[_0x48bf('0x14')](_0x48bf('0x26'),_0x513f63[_0x48bf('0x16')],_0x2f4c24);_0x2a741d(_0x2c29f6[_0x48bf('0x14')](0x1f4,_0x513f63[_0x48bf('0x16')]));});});};exports[_0x48bf('0x28')]=function(_0x5aba9d){var _0x3ba08a=this;return new Promise(function(_0x16241a,_0x279e61){var _0x44ea5b={'body':_0x5aba9d['body'],'channel':_0x48bf('0x29')};var _0x6fbd58=_[_0x48bf('0x2a')](_[_0x48bf('0x2b')](db[_0x48bf('0x2c')][_0x48bf('0x2d')]),['createdAt',_0x48bf('0x2e'),_0x48bf('0x2f'),_0x48bf('0x30')]);var _0x4233e3=![];if(_0x5aba9d[_0x48bf('0x31')]['id']){delete _0x5aba9d[_0x48bf('0x31')]['id'];}if(_[_0x48bf('0x32')](_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x33')])){return _0x279e61(_0x3ba08a[_0x48bf('0x14')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x48bf('0x32')](_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x31')])||_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x31')]===''){return _0x279e61(_0x3ba08a[_0x48bf('0x14')](0x1f4,_0x48bf('0x34')));}if(_[_0x48bf('0x32')](_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x35')])){return _0x279e61(_0x3ba08a[_0x48bf('0x14')](0x1f4,_0x48bf('0x36')+_0x6fbd58));}if(!_[_0x48bf('0x37')](_0x6fbd58,_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x35')])){return _0x279e61(_0x3ba08a[_0x48bf('0x14')](0x1f4,_0x48bf('0x38')+_0x6fbd58));}var _0x1f99c0={};_0x1f99c0[_0x5aba9d[_0x48bf('0x31')]['mapKey']]=_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x33')];return db['MailAccount'][_0x48bf('0x27')]({'where':{'id':_0x5aba9d[_0x48bf('0x39')]['id']},'include':[{'model':db[_0x48bf('0x3a')],'as':'List','include':[{'model':db[_0x48bf('0x2c')],'as':_0x48bf('0x3b'),'where':_0x1f99c0,'limit':0x1,'order':[[_0x48bf('0x2e'),_0x48bf('0x3c')]]}]},{'model':db[_0x48bf('0x3d')],'as':'Applications'},{'model':db[_0x48bf('0x3e')],'as':'Smtp'}]})[_0x48bf('0x25')](function(_0x4eccc6){if(_0x4eccc6&&_0x4eccc6[_0x48bf('0x3f')]){var _0x5ad965=_0x4eccc6['get']({'plain':!![]});_0x44ea5b['account']=_[_0x48bf('0x40')](_0x5ad965,[_0x48bf('0x41'),_0x48bf('0x3f')]);_0x44ea5b[_0x48bf('0x42')]=_0x5ad965[_0x48bf('0x41')];_0x44ea5b['list']=_0x5ad965[_0x48bf('0x3f')];_0x44ea5b['applications']=_[_0x48bf('0x43')](_0x44ea5b['applications'],[_0x48bf('0x44')],[_0x48bf('0x45')]);if(_0x44ea5b['account']&&_0x44ea5b['account'][_0x48bf('0x46')]){_0x44ea5b[_0x48bf('0x42')][_0x48bf('0x47')]({'id':0x0,'priority':_0x44ea5b[_0x48bf('0x42')][_0x48bf('0x48')]+0x1,'app':'close','appdata':_0x48bf('0x46'),'interval':_0x48bf('0x49')});}if(_0x44ea5b[_0x48bf('0x39')][_0x48bf('0x41')]){delete _0x44ea5b[_0x48bf('0x39')]['Applications'];}if(_0x44ea5b['account']['List']){delete _0x44ea5b[_0x48bf('0x39')][_0x48bf('0x3f')];}if(_0x5ad965['List'][_0x48bf('0x3b')][_0x48bf('0x48')]){return _0x5ad965[_0x48bf('0x3f')][_0x48bf('0x3b')][0x0];}var _0xb98cbf=_[_0x48bf('0xb')](_0x5aba9d[_0x48bf('0x31')],{'firstName':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x33')],'ListId':_0x5ad965['ListId']});_0xb98cbf[_0x5aba9d['body'][_0x48bf('0x35')]]=_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x33')];return db[_0x48bf('0x2c')]['create'](_0xb98cbf);}else{throw new Error(_0x48bf('0x4a'));}})[_0x48bf('0x25')](function(_0x5b8758){_0x44ea5b[_0x48bf('0x4b')]=_0x5b8758;if(_0x5b8758){if(!_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')][_0x48bf('0x4c')]){_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')][_0x48bf('0x4c')]=rs[_0x48bf('0x4d')]()+'\x20'+_0x5aba9d['body'][_0x48bf('0x16')][_0x48bf('0x33')];}var _0x234bed={'ContactId':_0x5b8758['id'],'MailAccountId':_0x5aba9d[_0x48bf('0x39')]['id'],'inReplyTo':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')]['messageId'],'to':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')][_0x48bf('0x33')],'cc':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')]['cc'],'subject':_0x5aba9d[_0x48bf('0x31')]['message']['subject'],'attach':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')][_0x48bf('0x4e')],'lastMsgAt':moment()['format'](_0x48bf('0x4f')),'lastMsgDirection':'in'};return db[_0x48bf('0x50')][_0x48bf('0x27')]({'where':{'closed':![],'MailAccountId':_0x5aba9d[_0x48bf('0x39')]['id']},'include':[{'model':db[_0x48bf('0x51')],'as':_0x48bf('0x52'),'attributes':[_0x48bf('0x4c')],'where':{'messageId':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')][_0x48bf('0x53')]}}]})['then'](function(_0x3a2a20){if(_0x3a2a20){return[_0x3a2a20,![]];}return db[_0x48bf('0x50')][_0x48bf('0x54')](_0x234bed)['then'](function(_0x41520e){return[_0x41520e,!![]];});});}else{throw new Error(_0x48bf('0x55'));}})[_0x48bf('0x56')](function(_0x1bdcf0,_0x33b67b){if(_0x1bdcf0){_0x4233e3=_0x33b67b;if(!_0x33b67b){return _0x1bdcf0[_0x48bf('0x57')]({'inReplyTo':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')][_0x48bf('0x4c')],'to':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')]['from'],'cc':_0x5aba9d[_0x48bf('0x31')]['message']['cc'],'subject':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')]['subject'],'attach':_0x1bdcf0[_0x48bf('0x4e')]?_0x1bdcf0[_0x48bf('0x4e')]:_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')][_0x48bf('0x4e')],'substatus':null,'substatusAt':moment()['format'](_0x48bf('0x4f')),'lastMsgAt':moment()[_0x48bf('0x58')](_0x48bf('0x4f')),'lastMsgDirection':'in'});}else{return _0x1bdcf0;}}})[_0x48bf('0x25')](function(_0x23546d){_0x44ea5b['interaction']=_0x23546d[_0x48bf('0x59')]({'plain':!![]});_0x44ea5b[_0x48bf('0x5a')][_0x48bf('0x5b')]=_0x4233e3;return db[_0x48bf('0x51')][_0x48bf('0x54')]({'body':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x31')],'MailAccountId':_0x5aba9d[_0x48bf('0x39')]['id'],'MailInteractionId':_0x23546d['id'],'direction':'in','ContactId':_0x44ea5b['contact']['id'],'messageId':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')]['messageId'],'from':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')][_0x48bf('0x33')],'to':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')]['to'],'cc':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')]['cc'],'subject':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')][_0x48bf('0x5c')],'attach':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')][_0x48bf('0x4e')],'Attachments':_0x5aba9d[_0x48bf('0x31')]['message']['attachments'],'originTo':_0x5aba9d['body'][_0x48bf('0x16')]['originTo'],'originCc':_0x5aba9d['body'][_0x48bf('0x16')]['originCc'],'bcc':_0x5aba9d['body'][_0x48bf('0x16')][_0x48bf('0x5d')],'ChatWebsiteId':_0x5aba9d['body'][_0x48bf('0x16')]['ChatWebsiteId']||null,'originChannel':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')]['originChannel']||_0x48bf('0x5e'),'ChatOfflineMessageId':_0x5aba9d[_0x48bf('0x31')]['message'][_0x48bf('0x5f')]||null},{'include':[{'model':db['Attachment'],'as':_0x48bf('0x60')}]});})[_0x48bf('0x25')](function(_0x3c48b6){_0x44ea5b[_0x48bf('0x16')]=_0x3c48b6;if(_0x44ea5b[_0x48bf('0x5a')][_0x48bf('0x61')]){return db[_0x48bf('0x62')]['find']({'attributes':['id',_0x48bf('0x63')],'where':{'id':_0x44ea5b['interaction']['UserId']}})['then'](function(_0x4ed88f){if(_0x4ed88f){_0x44ea5b[_0x48bf('0x42')][_0x48bf('0x64')]({'id':0x0,'priority':0x0,'app':_0x48bf('0x65'),'appdata':_0x4ed88f[_0x48bf('0x63')]+','+(_0x44ea5b['account'][_0x48bf('0x66')]||0xa),'interval':_0x48bf('0x49')});}return respondWithRpcPromise(_0x48bf('0x67'),_0x48bf('0x68'),_0x44ea5b);});}return respondWithRpcPromise(_0x48bf('0x67'),_0x48bf('0x68'),_0x44ea5b);})[_0x48bf('0x25')](function(_0x27c1e0){_0x16241a(_0x27c1e0);})[_0x48bf('0x19')](function(_0x127354){_0x279e61(_0x3ba08a['error'](0x1f4,_0x127354['message']));});});};
\ No newline at end of file
index e528ab0..124c571 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54e1=['save','remove','emit','removeListener','register','length','mailAccount:','./mailAccount.events'];(function(_0x224ee1,_0x3361bc){var _0xa84cef=function(_0x35b854){while(--_0x35b854){_0x224ee1['push'](_0x224ee1['shift']());}};_0xa84cef(++_0x3361bc);}(_0x54e1,0x147));var _0x154e=function(_0x498bd1,_0x4c6432){_0x498bd1=_0x498bd1-0x0;var _0xb3a5ce=_0x54e1[_0x498bd1];return _0xb3a5ce;};'use strict';var MailAccountEvents=require(_0x154e('0x0'));var events=[_0x154e('0x1'),_0x154e('0x2'),'update'];function createListener(_0x1e7a9b,_0x2be9eb){return function(_0x5b1b4d){_0x2be9eb[_0x154e('0x3')](_0x1e7a9b,_0x5b1b4d);};}function removeListener(_0x2de1b1,_0x487cca){return function(){MailAccountEvents[_0x154e('0x4')](_0x2de1b1,_0x487cca);};}exports[_0x154e('0x5')]=function(_0x183fde){for(var _0xcef47b=0x0,_0x1b77be=events[_0x154e('0x6')];_0xcef47b<_0x1b77be;_0xcef47b++){var _0x3dd4a3=events[_0xcef47b];var _0x1bb413=createListener(_0x154e('0x7')+_0x3dd4a3,_0x183fde);MailAccountEvents['on'](_0x3dd4a3,_0x1bb413);}};
\ No newline at end of file
+var _0x3958=['length','mailAccount:','./mailAccount.events','save','emit','removeListener'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x3958,0xe0));var _0x8395=function(_0xf0cc23,_0x136903){_0xf0cc23=_0xf0cc23-0x0;var _0xdc8dd9=_0x3958[_0xf0cc23];return _0xdc8dd9;};'use strict';var MailAccountEvents=require(_0x8395('0x0'));var events=[_0x8395('0x1'),'remove','update'];function createListener(_0x3de2a4,_0x2ed2cc){return function(_0x456f16){_0x2ed2cc[_0x8395('0x2')](_0x3de2a4,_0x456f16);};}function removeListener(_0x31b2c9,_0x45d894){return function(){MailAccountEvents[_0x8395('0x3')](_0x31b2c9,_0x45d894);};}exports['register']=function(_0x348cc4){for(var _0x1df63d=0x0,_0x1619bb=events[_0x8395('0x4')];_0x1df63d<_0x1619bb;_0x1df63d++){var _0x427b93=events[_0x1df63d];var _0x13b051=createListener(_0x8395('0x5')+_0x427b93,_0x348cc4);MailAccountEvents['on'](_0x427b93,_0x13b051);}};
\ No newline at end of file
index 4aef332..e413151 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8db=['../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','show','put','isAuthenticated','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x14275a,_0x428065){var _0x2df137=function(_0x2c975e){while(--_0x2c975e){_0x14275a['push'](_0x14275a['shift']());}};_0x2df137(++_0x428065);}(_0xd8db,0x116));var _0xbd8d=function(_0xca5fbd,_0x479c8e){_0xca5fbd=_0xca5fbd-0x0;var _0x5ee881=_0xd8db[_0xca5fbd];return _0x5ee881;};'use strict';var multer=require(_0xbd8d('0x0'));var util=require(_0xbd8d('0x1'));var path=require('path');var timeout=require(_0xbd8d('0x2'));var express=require(_0xbd8d('0x3'));var router=express[_0xbd8d('0x4')]();var fs_extra=require(_0xbd8d('0x5'));var auth=require(_0xbd8d('0x6'));var interaction=require(_0xbd8d('0x7'));var config=require(_0xbd8d('0x8'));var controller=require(_0xbd8d('0x9'));router[_0xbd8d('0xa')](_0xbd8d('0xb'),auth['isAuthenticated'](),controller[_0xbd8d('0xc')]);router[_0xbd8d('0xd')]('/:id',auth[_0xbd8d('0xe')](),controller[_0xbd8d('0xf')]);router[_0xbd8d('0x10')](_0xbd8d('0xb'),auth['isAuthenticated'](),controller[_0xbd8d('0x11')]);module[_0xbd8d('0x12')]=router;
\ No newline at end of file
+var _0x0528=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','show','put','update','delete','isAuthenticated','exports'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x0528,0x99));var _0x8052=function(_0x465e84,_0x2ad6f8){_0x465e84=_0x465e84-0x0;var _0x29c6df=_0x0528[_0x465e84];return _0x29c6df;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8052('0x0'));var timeout=require(_0x8052('0x1'));var express=require(_0x8052('0x2'));var router=express[_0x8052('0x3')]();var fs_extra=require(_0x8052('0x4'));var auth=require(_0x8052('0x5'));var interaction=require(_0x8052('0x6'));var config=require(_0x8052('0x7'));var controller=require(_0x8052('0x8'));router[_0x8052('0x9')](_0x8052('0xa'),auth['isAuthenticated'](),controller[_0x8052('0xb')]);router[_0x8052('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x8052('0xd')]);router[_0x8052('0xe')](_0x8052('0xa'),auth[_0x8052('0xf')](),controller['destroy']);module[_0x8052('0x10')]=router;
\ No newline at end of file
index 6e78b64..fe673b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaeb=['TEXT','sequelize','STRING','noop'];(function(_0x4b809b,_0x5de1c6){var _0x338f37=function(_0x189771){while(--_0x189771){_0x4b809b['push'](_0x4b809b['shift']());}};_0x338f37(++_0x5de1c6);}(_0xbaeb,0x1e9));var _0xbbae=function(_0x143934,_0x611d46){_0x143934=_0x143934-0x0;var _0x891032=_0xbaeb[_0x143934];return _0x891032;};'use strict';var Sequelize=require(_0xbbae('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xbbae('0x1')],'allowNull':![],'defaultValue':_0xbbae('0x2')},'appdata':{'type':Sequelize[_0xbbae('0x3')]()},'description':{'type':Sequelize[_0xbbae('0x1')]},'interval':{'type':Sequelize[_0xbbae('0x1')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x61a1=['exports','INTEGER','STRING','TEXT','*,*,*,*'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x61a1,0x1ae));var _0x161a=function(_0x4f2c3a,_0x6bde90){_0x4f2c3a=_0x4f2c3a-0x0;var _0x17d91c=_0x61a1[_0x4f2c3a];return _0x17d91c;};'use strict';var Sequelize=require('sequelize');module[_0x161a('0x0')]={'priority':{'type':Sequelize[_0x161a('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x161a('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x161a('0x3')]()},'description':{'type':Sequelize[_0x161a('0x2')]},'interval':{'type':Sequelize[_0x161a('0x2')],'defaultValue':_0x161a('0x4')}};
\ No newline at end of file
index e8fb363..4f3e76c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bde=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','error','name','send','show','model','keys','MailApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','params','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x470212,_0x1387de){var _0x5083cb=function(_0x3bec27){while(--_0x3bec27){_0x470212['push'](_0x470212['shift']());}};_0x5083cb(++_0x1387de);}(_0x9bde,0xe1));var _0xe9bd=function(_0x557531,_0x2bc75c){_0x557531=_0x557531-0x0;var _0x480dcd=_0x9bde[_0x557531];return _0x480dcd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9bd('0x1'));var rp=require('request-promise');var moment=require(_0xe9bd('0x2'));var BPromise=require(_0xe9bd('0x3'));var Mustache=require(_0xe9bd('0x4'));var util=require(_0xe9bd('0x5'));var path=require(_0xe9bd('0x6'));var sox=require(_0xe9bd('0x7'));var csv=require(_0xe9bd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9bd('0x9'));var _=require(_0xe9bd('0xa'));var squel=require(_0xe9bd('0xb'));var crypto=require(_0xe9bd('0xc'));var jsforce=require(_0xe9bd('0xd'));var deskjs=require(_0xe9bd('0xe'));var toCsv=require(_0xe9bd('0x8'));var querystring=require(_0xe9bd('0xf'));var Papa=require(_0xe9bd('0x10'));var Redis=require(_0xe9bd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe9bd('0x12'));var hardwareService=require(_0xe9bd('0x13'));var logger=require(_0xe9bd('0x14'))('api');var utils=require(_0xe9bd('0x15'));var config=require(_0xe9bd('0x16'));var licenseUtil=require(_0xe9bd('0x17'));var db=require(_0xe9bd('0x18'))['db'];function respondWithStatusCode(_0x5e022a,_0x2c1d98){_0x2c1d98=_0x2c1d98||0xcc;return function(_0x4ac319){if(_0x4ac319){return _0x5e022a[_0xe9bd('0x19')](_0x2c1d98);}return _0x5e022a[_0xe9bd('0x1a')](_0x2c1d98)[_0xe9bd('0x1b')]();};}function respondWithResult(_0x51109f,_0x47ba5e){_0x47ba5e=_0x47ba5e||0xc8;return function(_0x46a95e){if(_0x46a95e){return _0x51109f[_0xe9bd('0x1a')](_0x47ba5e)[_0xe9bd('0x1c')](_0x46a95e);}};}function respondWithFilteredResult(_0x46a59b,_0x3360bd){return function(_0x389e7b){if(_0x389e7b){var _0x45a9f2=typeof _0x3360bd['offset']===_0xe9bd('0x1d')&&typeof _0x3360bd[_0xe9bd('0x1e')]===_0xe9bd('0x1d');var _0x494b27=_0x389e7b[_0xe9bd('0x1f')];var _0x3bae08=_0x45a9f2?0x0:_0x3360bd[_0xe9bd('0x20')];var _0x330733=_0x45a9f2?_0x389e7b['count']:_0x3360bd[_0xe9bd('0x20')]+_0x3360bd['limit'];var _0xc6b661;if(_0x330733>=_0x494b27){_0x330733=_0x494b27;_0xc6b661=0xc8;}else{_0xc6b661=0xce;}_0x46a59b['status'](_0xc6b661);return _0x46a59b[_0xe9bd('0x21')](_0xe9bd('0x22'),_0x3bae08+'-'+_0x330733+'/'+_0x494b27)[_0xe9bd('0x1c')](_0x389e7b);}return null;};}function patchUpdates(_0x3dda13){return function(_0x1acb82){try{jsonpatch[_0xe9bd('0x23')](_0x1acb82,_0x3dda13,!![]);}catch(_0x6593ce){return BPromise['reject'](_0x6593ce);}return _0x1acb82[_0xe9bd('0x24')]();};}function saveUpdates(_0x28cd17,_0x4ecaf5){return function(_0x37aec1){if(_0x37aec1){return _0x37aec1['update'](_0x28cd17)[_0xe9bd('0x25')](function(_0x1b9cc9){return _0x1b9cc9;});}return null;};}function removeEntity(_0x36f8c0,_0xf02209){return function(_0x5bc4bf){if(_0x5bc4bf){return _0x5bc4bf[_0xe9bd('0x26')]()[_0xe9bd('0x25')](function(){_0x36f8c0[_0xe9bd('0x1a')](0xcc)[_0xe9bd('0x1b')]();});}};}function handleEntityNotFound(_0x2641be,_0xb52d45){return function(_0x399f3c){if(!_0x399f3c){_0x2641be[_0xe9bd('0x19')](0x194);}return _0x399f3c;};}function handleError(_0x1ae889,_0x5987af){_0x5987af=_0x5987af||0x1f4;return function(_0x3c211a){logger[_0xe9bd('0x27')](_0x3c211a['stack']);if(_0x3c211a[_0xe9bd('0x28')]){delete _0x3c211a[_0xe9bd('0x28')];}_0x1ae889[_0xe9bd('0x1a')](_0x5987af)[_0xe9bd('0x29')](_0x3c211a);};}exports[_0xe9bd('0x2a')]=function(_0x183601,_0x519f48){var _0x5b7f1d={'raw':!![],'where':{'id':_0x183601['params']['id']}},_0x1de54c={};_0x1de54c[_0xe9bd('0x2b')]=_[_0xe9bd('0x2c')](db[_0xe9bd('0x2d')][_0xe9bd('0x2e')]);_0x1de54c[_0xe9bd('0x2f')]=_['keys'](_0x183601['query']);_0x1de54c[_0xe9bd('0x30')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],_0x1de54c[_0xe9bd('0x2f')]);_0x5b7f1d[_0xe9bd('0x32')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],qs[_0xe9bd('0x33')](_0x183601[_0xe9bd('0x2f')]['fields']));_0x5b7f1d[_0xe9bd('0x32')]=_0x5b7f1d[_0xe9bd('0x32')][_0xe9bd('0x34')]?_0x5b7f1d['attributes']:_0x1de54c['model'];if(_0x183601[_0xe9bd('0x2f')][_0xe9bd('0x35')]){_0x5b7f1d[_0xe9bd('0x36')]=[{'all':!![]}];}_0x5b7f1d=_[_0xe9bd('0x37')]({},_0x5b7f1d,_0x183601[_0xe9bd('0x38')]);return db[_0xe9bd('0x2d')][_0xe9bd('0x39')](_0x5b7f1d)[_0xe9bd('0x25')](handleEntityNotFound(_0x519f48,null))[_0xe9bd('0x25')](respondWithResult(_0x519f48,null))[_0xe9bd('0x3a')](handleError(_0x519f48,null));};exports[_0xe9bd('0x3b')]=function(_0x549dd1,_0x2ad46e){if(_0x549dd1[_0xe9bd('0x3c')]['id']){delete _0x549dd1[_0xe9bd('0x3c')]['id'];}return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x549dd1[_0xe9bd('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2ad46e,null))[_0xe9bd('0x25')](saveUpdates(_0x549dd1[_0xe9bd('0x3c')],null))['then'](respondWithResult(_0x2ad46e,null))[_0xe9bd('0x3a')](handleError(_0x2ad46e,null));};exports[_0xe9bd('0x26')]=function(_0x4c7d47,_0x4b1da0){return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x4c7d47['params']['id']}})[_0xe9bd('0x25')](handleEntityNotFound(_0x4b1da0,null))[_0xe9bd('0x25')](removeEntity(_0x4b1da0,null))[_0xe9bd('0x3a')](handleError(_0x4b1da0,null));};
\ No newline at end of file
+var _0xedd9=['query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','destroy','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','show','params','keys','MailApplication','rawAttributes'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0xedd9,0xfc));var _0x9edd=function(_0x4975b0,_0x513519){_0x4975b0=_0x4975b0-0x0;var _0x3a8f7d=_0xedd9[_0x4975b0];return _0x3a8f7d;};'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={'raw':!![],'where':{'id':_0x52746a[_0x9edd('0x27')]['id']}},_0x2ae8dd={};_0x2ae8dd['model']=_[_0x9edd('0x28')](db[_0x9edd('0x29')][_0x9edd('0x2a')]);_0x2ae8dd[_0x9edd('0x2b')]=_[_0x9edd('0x28')](_0x52746a[_0x9edd('0x2b')]);_0x2ae8dd[_0x9edd('0x2c')]=_[_0x9edd('0x2d')](_0x2ae8dd[_0x9edd('0x2e')],_0x2ae8dd[_0x9edd('0x2b')]);_0x28cfae[_0x9edd('0x2f')]=_[_0x9edd('0x2d')](_0x2ae8dd[_0x9edd('0x2e')],qs[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2b')]['fields']));_0x28cfae[_0x9edd('0x2f')]=_0x28cfae[_0x9edd('0x2f')][_0x9edd('0x31')]?_0x28cfae['attributes']:_0x2ae8dd[_0x9edd('0x2e')];if(_0x52746a[_0x9edd('0x2b')][_0x9edd('0x32')]){_0x28cfae[_0x9edd('0x33')]=[{'all':!![]}];}_0x28cfae=_[_0x9edd('0x34')]({},_0x28cfae,_0x52746a[_0x9edd('0x35')]);return db[_0x9edd('0x29')][_0x9edd('0x36')](_0x28cfae)[_0x9edd('0x21')](handleEntityNotFound(_0x238b22,null))[_0x9edd('0x21')](respondWithResult(_0x238b22,null))[_0x9edd('0x37')](handleError(_0x238b22,null));};exports[_0x9edd('0x38')]=function(_0x27eb7e,_0x14f780){if(_0x27eb7e['body']['id']){delete _0x27eb7e[_0x9edd('0x39')]['id'];}return db['MailApplication'][_0x9edd('0x36')]({'where':{'id':_0x27eb7e[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x14f780,null))[_0x9edd('0x21')](saveUpdates(_0x27eb7e[_0x9edd('0x39')],null))['then'](respondWithResult(_0x14f780,null))[_0x9edd('0x37')](handleError(_0x14f780,null));};exports[_0x9edd('0x3a')]=function(_0x2b3469,_0x38e9be){return db[_0x9edd('0x29')][_0x9edd('0x36')]({'where':{'id':_0x2b3469[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x38e9be,null))[_0x9edd('0x21')](removeEntity(_0x38e9be,null))[_0x9edd('0x37')](handleError(_0x38e9be,null));};
\ No newline at end of file
index 2e28220..39b914c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeed8=['bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x1fb014,_0x14614e){var _0x5c0ac2=function(_0x45a63d){while(--_0x45a63d){_0x1fb014['push'](_0x1fb014['shift']());}};_0x5c0ac2(++_0x14614e);}(_0xeed8,0x1ce));var _0x8eed=function(_0x10f0a5,_0x42ecec){_0x10f0a5=_0x10f0a5-0x0;var _0x1849cb=_0xeed8[_0x10f0a5];return _0x1849cb;};'use strict';var _=require(_0x8eed('0x0'));var util=require(_0x8eed('0x1'));var logger=require('../../config/logger')(_0x8eed('0x2'));var moment=require('moment');var BPromise=require(_0x8eed('0x3'));var rp=require(_0x8eed('0x4'));var fs=require('fs');var path=require(_0x8eed('0x5'));var rimraf=require(_0x8eed('0x6'));var config=require(_0x8eed('0x7'));var attributes=require(_0x8eed('0x8'));module[_0x8eed('0x9')]=function(_0x53a3a3,_0x2bb404){return _0x53a3a3[_0x8eed('0xa')](_0x8eed('0xb'),attributes,{'tableName':_0x8eed('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8eed('0xd'),'collate':_0x8eed('0xe')});};
\ No newline at end of file
+var _0xec41=['rimraf','./mailApplication.attributes','exports','define','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0xec41,0x89));var _0x1ec4=function(_0x95d36,_0x339cbd){_0x95d36=_0x95d36-0x0;var _0x324f84=_0xec41[_0x95d36];return _0x324f84;};'use strict';var _=require(_0x1ec4('0x0'));var util=require('util');var logger=require(_0x1ec4('0x1'))(_0x1ec4('0x2'));var moment=require(_0x1ec4('0x3'));var BPromise=require(_0x1ec4('0x4'));var rp=require(_0x1ec4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1ec4('0x6'));var config=require('../../config/environment');var attributes=require(_0x1ec4('0x7'));module[_0x1ec4('0x8')]=function(_0xe18a46,_0x5af427){return _0xe18a46[_0x1ec4('0x9')]('MailApplication',attributes,{'tableName':_0x1ec4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1ec4('0xb'),'collate':_0x1ec4('0xc')});};
\ No newline at end of file
index 5909f64..6f03cca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x975f=['where','attributes','debug','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','UpdateMailApplication','MailApplication','update','body','options','raw'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x975f,0x10c));var _0xf975=function(_0x3acee8,_0x5f3924){_0x3acee8=_0x3acee8-0x0;var _0x5046cc=_0x975f[_0x3acee8];return _0x5046cc;};'use strict';var _=require('lodash');var util=require(_0xf975('0x0'));var moment=require(_0xf975('0x1'));var BPromise=require(_0xf975('0x2'));var rs=require(_0xf975('0x3'));var fs=require('fs');var Redis=require(_0xf975('0x4'));var db=require(_0xf975('0x5'))['db'];var utils=require(_0xf975('0x6'));var logger=require(_0xf975('0x7'))(_0xf975('0x8'));var config=require(_0xf975('0x9'));var jayson=require(_0xf975('0xa'));var client=jayson[_0xf975('0xb')][_0xf975('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4c08a1,_0x2a41e5,_0x37bc87){return new BPromise(function(_0xc2bd83,_0xcd1ea2){return client[_0xf975('0xd')](_0x4c08a1,_0x37bc87)[_0xf975('0xe')](function(_0x388b42){logger[_0xf975('0xf')](_0xf975('0x10'),_0x2a41e5,_0xf975('0x11'));logger['debug']('MailApplication,\x20%s,\x20%s,\x20%s',_0x2a41e5,'request\x20sent',JSON['stringify'](_0x388b42));if(_0x388b42[_0xf975('0x12')]){if(_0x388b42[_0xf975('0x12')][_0xf975('0x13')]===0x1f4){logger[_0xf975('0x12')]('MailApplication,\x20%s,\x20%s',_0x2a41e5,_0x388b42['error']['message']);return _0xcd1ea2(_0x388b42[_0xf975('0x12')]['message']);}logger[_0xf975('0x12')]('MailApplication,\x20%s,\x20%s',_0x2a41e5,_0x388b42[_0xf975('0x12')][_0xf975('0x14')]);return _0xc2bd83(_0x388b42[_0xf975('0x12')]['message']);}else{logger[_0xf975('0xf')](_0xf975('0x10'),_0x2a41e5,_0xf975('0x11'));_0xc2bd83(_0x388b42[_0xf975('0x15')][_0xf975('0x14')]);}})[_0xf975('0x16')](function(_0x26a9a6){logger[_0xf975('0x12')]('MailApplication,\x20%s,\x20%s',_0x2a41e5,_0x26a9a6);_0xcd1ea2(_0x26a9a6);});});}exports[_0xf975('0x17')]=function(_0x10952e){var _0x50c695=this;return new Promise(function(_0x5af1ce,_0xde36e8){return db[_0xf975('0x18')][_0xf975('0x19')](_0x10952e[_0xf975('0x1a')],{'raw':_0x10952e[_0xf975('0x1b')]?_0x10952e[_0xf975('0x1b')][_0xf975('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10952e[_0xf975('0x1b')]?_0x10952e[_0xf975('0x1b')][_0xf975('0x1d')]||null:null,'attributes':_0x10952e['options']?_0x10952e[_0xf975('0x1b')][_0xf975('0x1e')]||null:null,'limit':_0x10952e['options']?_0x10952e[_0xf975('0x1b')]['limit']||null:null})[_0xf975('0xe')](function(_0x41b7eb){logger[_0xf975('0xf')](_0xf975('0x17'),_0x10952e);logger[_0xf975('0x1f')](_0xf975('0x17'),_0x10952e,JSON[_0xf975('0x20')](_0x41b7eb));_0x5af1ce(_0x41b7eb);})[_0xf975('0x16')](function(_0x4f9c4c){logger[_0xf975('0x12')](_0xf975('0x17'),_0x4f9c4c['message'],_0x10952e);_0xde36e8(_0x50c695['error'](0x1f4,_0x4f9c4c[_0xf975('0x14')]));});});};
\ No newline at end of file
+var _0xdabc=['request\x20sent','debug','error','MailApplication,\x20%s,\x20%s','message','result','catch','UpdateMailApplication','update','options','raw','where','attributes','limit','stringify','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xdabc,0x16b));var _0xcdab=function(_0x164eb1,_0x198a7d){_0x164eb1=_0x164eb1-0x0;var _0x73311=_0xdabc[_0x164eb1];return _0x73311;};'use strict';var _=require('lodash');var util=require(_0xcdab('0x0'));var moment=require(_0xcdab('0x1'));var BPromise=require(_0xcdab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcdab('0x3'));var db=require(_0xcdab('0x4'))['db'];var utils=require(_0xcdab('0x5'));var logger=require(_0xcdab('0x6'))(_0xcdab('0x7'));var config=require(_0xcdab('0x8'));var jayson=require(_0xcdab('0x9'));var client=jayson[_0xcdab('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xceb00e,_0x3d2c44,_0x980fac){return new BPromise(function(_0x513c14,_0x1932b4){return client[_0xcdab('0xb')](_0xceb00e,_0x980fac)[_0xcdab('0xc')](function(_0x518b92){logger[_0xcdab('0xd')]('MailApplication,\x20%s,\x20%s',_0x3d2c44,_0xcdab('0xe'));logger[_0xcdab('0xf')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x3d2c44,_0xcdab('0xe'),JSON['stringify'](_0x518b92));if(_0x518b92['error']){if(_0x518b92['error']['code']===0x1f4){logger[_0xcdab('0x10')](_0xcdab('0x11'),_0x3d2c44,_0x518b92[_0xcdab('0x10')][_0xcdab('0x12')]);return _0x1932b4(_0x518b92[_0xcdab('0x10')]['message']);}logger['error'](_0xcdab('0x11'),_0x3d2c44,_0x518b92[_0xcdab('0x10')]['message']);return _0x513c14(_0x518b92['error']['message']);}else{logger[_0xcdab('0xd')](_0xcdab('0x11'),_0x3d2c44,_0xcdab('0xe'));_0x513c14(_0x518b92[_0xcdab('0x13')][_0xcdab('0x12')]);}})[_0xcdab('0x14')](function(_0x47ed01){logger['error'](_0xcdab('0x11'),_0x3d2c44,_0x47ed01);_0x1932b4(_0x47ed01);});});}exports[_0xcdab('0x15')]=function(_0x5e21e6){var _0xef41c6=this;return new Promise(function(_0xd529a,_0x57ad6e){return db['MailApplication'][_0xcdab('0x16')](_0x5e21e6['body'],{'raw':_0x5e21e6['options']?_0x5e21e6[_0xcdab('0x17')][_0xcdab('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e21e6[_0xcdab('0x17')]?_0x5e21e6[_0xcdab('0x17')][_0xcdab('0x19')]||null:null,'attributes':_0x5e21e6['options']?_0x5e21e6[_0xcdab('0x17')][_0xcdab('0x1a')]||null:null,'limit':_0x5e21e6[_0xcdab('0x17')]?_0x5e21e6[_0xcdab('0x17')][_0xcdab('0x1b')]||null:null})['then'](function(_0x393255){logger[_0xcdab('0xd')](_0xcdab('0x15'),_0x5e21e6);logger[_0xcdab('0xf')](_0xcdab('0x15'),_0x5e21e6,JSON[_0xcdab('0x1c')](_0x393255));_0xd529a(_0x393255);})[_0xcdab('0x14')](function(_0x11127b){logger[_0xcdab('0x10')](_0xcdab('0x15'),_0x11127b['message'],_0x5e21e6);_0x57ad6e(_0xef41c6[_0xcdab('0x10')](0x1f4,_0x11127b['message']));});});};
\ No newline at end of file
index db4408f..082c41c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e3=['index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','addTags','put','mail','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','express','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated'];(function(_0x1a3adb,_0x4c3a94){var _0x53aead=function(_0x961dea){while(--_0x961dea){_0x1a3adb['push'](_0x1a3adb['shift']());}};_0x53aead(++_0x4c3a94);}(_0xb7e3,0x1bb));var _0x3b7e=function(_0x5ce8b9,_0x5cded8){_0x5ce8b9=_0x5ce8b9-0x0;var _0xe34be0=_0xb7e3[_0x5ce8b9];return _0xe34be0;};'use strict';var express=require(_0x3b7e('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x3b7e('0x1'));var controller=require(_0x3b7e('0x2'));router[_0x3b7e('0x3')]('/',auth[_0x3b7e('0x4')](),controller[_0x3b7e('0x5')]);router['get'](_0x3b7e('0x6'),auth[_0x3b7e('0x4')](),controller[_0x3b7e('0x7')]);router['get'](_0x3b7e('0x8'),auth[_0x3b7e('0x4')](),controller[_0x3b7e('0x9')]);router['get'](_0x3b7e('0xa'),auth[_0x3b7e('0x4')](),controller[_0x3b7e('0xb')]);router['get'](_0x3b7e('0xc'),auth['isAuthenticated'](),controller[_0x3b7e('0xd')]);router[_0x3b7e('0xe')]('/',auth[_0x3b7e('0x4')](),controller[_0x3b7e('0xf')]);router[_0x3b7e('0xe')](_0x3b7e('0xa'),auth[_0x3b7e('0x4')](),controller[_0x3b7e('0x10')]);router[_0x3b7e('0xe')](_0x3b7e('0x11'),auth[_0x3b7e('0x4')](),interaction[_0x3b7e('0x12')]('mail','mailinteraction:addtags'),controller[_0x3b7e('0x13')]);router[_0x3b7e('0x14')]('/:id',auth[_0x3b7e('0x4')](),interaction['tracked'](_0x3b7e('0x15'),_0x3b7e('0x16')),controller[_0x3b7e('0x17')]);router[_0x3b7e('0x18')](_0x3b7e('0x8'),auth[_0x3b7e('0x4')](),interaction[_0x3b7e('0x12')](_0x3b7e('0x15'),_0x3b7e('0x19')),controller[_0x3b7e('0x1a')]);router[_0x3b7e('0x18')](_0x3b7e('0x11'),auth[_0x3b7e('0x4')](),controller[_0x3b7e('0x1b')]);module['exports']=router;
\ No newline at end of file
+var _0x4225=['../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','getMessages','/:id/download','download','create','post','/:id/messages','/:id/tags','mail','mailinteraction:addtags','addTags','put','update','delete','tracked','mailinteraction:destroy','destroy','removeTags','express','Router','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4225,0xd5));var _0x5422=function(_0x56a595,_0x586c93){_0x56a595=_0x56a595-0x0;var _0x4a8c03=_0x4225[_0x56a595];return _0x4a8c03;};'use strict';var express=require(_0x5422('0x0'));var router=express[_0x5422('0x1')]();var auth=require(_0x5422('0x2'));var interaction=require(_0x5422('0x3'));var controller=require('./mailInteraction.controller');router[_0x5422('0x4')]('/',auth[_0x5422('0x5')](),controller[_0x5422('0x6')]);router['get'](_0x5422('0x7'),auth['isAuthenticated'](),controller[_0x5422('0x8')]);router['get'](_0x5422('0x9'),auth[_0x5422('0x5')](),controller['show']);router[_0x5422('0x4')]('/:id/messages',auth[_0x5422('0x5')](),controller[_0x5422('0xa')]);router[_0x5422('0x4')](_0x5422('0xb'),auth[_0x5422('0x5')](),controller[_0x5422('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5422('0xd')]);router[_0x5422('0xe')](_0x5422('0xf'),auth['isAuthenticated'](),controller['addMessage']);router[_0x5422('0xe')](_0x5422('0x10'),auth[_0x5422('0x5')](),interaction['tracked'](_0x5422('0x11'),_0x5422('0x12')),controller[_0x5422('0x13')]);router[_0x5422('0x14')](_0x5422('0x9'),auth[_0x5422('0x5')](),interaction['tracked'](_0x5422('0x11'),'mailinteraction:update'),controller[_0x5422('0x15')]);router[_0x5422('0x16')](_0x5422('0x9'),auth[_0x5422('0x5')](),interaction[_0x5422('0x17')]('mail',_0x5422('0x18')),controller[_0x5422('0x19')]);router[_0x5422('0x16')](_0x5422('0x10'),auth['isAuthenticated'](),controller[_0x5422('0x1a')]);module['exports']=router;
\ No newline at end of file
index 869a089..85e3aec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e8d=['BOOLEAN','DATE','STRING','TEXT','long','ENUM','out','sequelize','iconv','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x8e8d,0x13d));var _0xd8e8=function(_0x3a549f,_0x38fbe0){_0x3a549f=_0x3a549f-0x0;var _0x434ee6=_0x8e8d[_0x3a549f];return _0x434ee6;};'use strict';var Sequelize=require(_0xd8e8('0x0'));var iconv=require(_0xd8e8('0x1'));module[_0xd8e8('0x2')]={'closed':{'type':Sequelize[_0xd8e8('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd8e8('0x4')]},'disposition':{'type':Sequelize[_0xd8e8('0x5')]},'secondDisposition':{'type':Sequelize[_0xd8e8('0x5')]},'thirdDisposition':{'type':Sequelize[_0xd8e8('0x5')]},'note':{'type':Sequelize[_0xd8e8('0x5')]},'inReplyTo':{'type':Sequelize[_0xd8e8('0x5')](0x1fe)},'to':{'type':Sequelize[_0xd8e8('0x5')]},'cc':{'type':Sequelize[_0xd8e8('0x6')](_0xd8e8('0x7'))},'subject':{'type':Sequelize[_0xd8e8('0x6')]()},'attach':{'type':Sequelize[_0xd8e8('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0xd8e8('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0xd8e8('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xd8e8('0x8')]('in',_0xd8e8('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xd8e8('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xd8e8('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x3d82=['BOOLEAN','STRING','TEXT','long','DATE','out','ENUM','sequelize'];(function(_0x20e7e3,_0x1529be){var _0x14b9de=function(_0xa82925){while(--_0xa82925){_0x20e7e3['push'](_0x20e7e3['shift']());}};_0x14b9de(++_0x1529be);}(_0x3d82,0x117));var _0x23d8=function(_0x1944e1,_0x29875e){_0x1944e1=_0x1944e1-0x0;var _0x486d30=_0x3d82[_0x1944e1];return _0x486d30;};'use strict';var Sequelize=require(_0x23d8('0x0'));var iconv=require('iconv');module['exports']={'closed':{'type':Sequelize[_0x23d8('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x23d8('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x23d8('0x2')]},'inReplyTo':{'type':Sequelize[_0x23d8('0x2')](0x1fe)},'to':{'type':Sequelize[_0x23d8('0x2')]},'cc':{'type':Sequelize[_0x23d8('0x3')](_0x23d8('0x4'))},'subject':{'type':Sequelize[_0x23d8('0x3')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x23d8('0x5')]},'substatus':{'type':Sequelize[_0x23d8('0x2')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x23d8('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x23d8('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x23d8('0x7')]('in',_0x23d8('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x23d8('0x1')],'defaultValue':![]}};
\ No newline at end of file
index 6e18e39..2f421cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42db=['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?','User','UserId','start','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20>\x200','tag','isArray','filter','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.MailAccountId\x20IS\x20NULL','sequelize','toString','count','merge','Account.key','a.mandatoryDisposition','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.UserId','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','all','rows','show','filters','options','create','body','params','destroy','describe','addMessage','ids','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','findAll','true','addTags','setTags','omit','spread','emit','mailInteractionTags:save','removeTags','download','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','Attachments','Messages','bcc','subject','mkdirSync','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','rimraf','zip-dir','moment','util','path','squel','juice','ioredis','../../components/parsers/advancedSearch','api','../../config/environment','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','Content-Range','update','then','name','send','map','fullname','TagIds','Tags','split','forEach','push','MailMessage','findOne','out','plainBody','-id','lastMsgText','trimStart','catch','index','MailInteraction','rawAttributes','fieldName','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','field','color','from','select','u.id','u.fullname','ui.MailInteractionId','left_join','users','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','it.MailInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','length'];(function(_0x401e64,_0x5bf90a){var _0x31a5f7=function(_0x546026){while(--_0x546026){_0x401e64['push'](_0x401e64['shift']());}};_0x31a5f7(++_0x5bf90a);}(_0x42db,0x88));var _0xb42d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x42db[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb42d('0x0'));var zipdir=require(_0xb42d('0x1'));var moment=require(_0xb42d('0x2'));var BPromise=require('bluebird');var util=require(_0xb42d('0x3'));var path=require(_0xb42d('0x4'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb42d('0x5'));var juice=require(_0xb42d('0x6'));var Redis=require(_0xb42d('0x7'));var qs=require('../../components/parsers/qs');var as=require(_0xb42d('0x8'));var logger=require('../../config/logger')(_0xb42d('0x9'));var config=require(_0xb42d('0xa'));var db=require('../../mysqldb')['db'];var htmlEntities=require('html-entities');config['redis']=_[_0xb42d('0xb')](config['redis'],{'host':_0xb42d('0xc'),'port':0x18eb});var socket=require(_0xb42d('0xd'))(new Redis(config['redis']));require(_0xb42d('0xe'))[_0xb42d('0xf')](socket);function respondWithStatusCode(_0x4008e9,_0x5f4fa3){_0x5f4fa3=_0x5f4fa3||0xcc;return function(_0x508625){if(_0x508625){return _0x4008e9[_0xb42d('0x10')](_0x5f4fa3);}return _0x4008e9[_0xb42d('0x11')](_0x5f4fa3)[_0xb42d('0x12')]();};}function respondWithResult(_0xb50d7,_0x338310){_0x338310=_0x338310||0xc8;return function(_0x224815){if(_0x224815){return _0xb50d7[_0xb42d('0x11')](_0x338310)[_0xb42d('0x13')](_0x224815);}};}function respondWithFilteredResult(_0x4cf9fe,_0x422349){return function(_0x18eb56){if(_0x18eb56){var _0x3de172=typeof _0x422349[_0xb42d('0x14')]==='undefined'&&typeof _0x422349['limit']===_0xb42d('0x15');var _0x173222=_0x18eb56['count'];var _0x70439e=_0x3de172?0x0:_0x422349[_0xb42d('0x14')];var _0x46ab5d=_0x3de172?_0x18eb56['count']:_0x422349['offset']+_0x422349[_0xb42d('0x16')];var _0x4252bd;if(_0x46ab5d>=_0x173222){_0x46ab5d=_0x173222;_0x4252bd=0xc8;}else{_0x4252bd=0xce;}_0x4cf9fe[_0xb42d('0x11')](_0x4252bd);return _0x4cf9fe['set'](_0xb42d('0x17'),_0x70439e+'-'+_0x46ab5d+'/'+_0x173222)[_0xb42d('0x13')](_0x18eb56);}return null;};}function saveUpdates(_0x536730){return function(_0x20f210){if(_0x20f210){return _0x20f210[_0xb42d('0x18')](_0x536730)[_0xb42d('0x19')](function(_0x4d437b){return _0x4d437b;});}return null;};}function removeEntity(_0x4cc21b){return function(_0x51e25b){if(_0x51e25b){return _0x51e25b['destroy']()['then'](function(){_0x4cc21b[_0xb42d('0x11')](0xcc)[_0xb42d('0x12')]();});}};}function handleEntityNotFound(_0x4806e3){return function(_0x136d64){if(!_0x136d64){_0x4806e3[_0xb42d('0x10')](0x194);}return _0x136d64;};}function handleError(_0x5620c9,_0x2fde60){_0x2fde60=_0x2fde60||0x1f4;return function(_0x266880){logger['error'](_0x266880['stack']);if(_0x266880['name']){delete _0x266880[_0xb42d('0x1a')];}_0x5620c9[_0xb42d('0x11')](_0x2fde60)[_0xb42d('0x1b')](_0x266880);};}function getInteractionUsers(_0x3460ce,_0x45ab91){return new BPromise(function(_0x11185d,_0x23d38e){try{if(_0x45ab91[_0x3460ce['id']]){_0x3460ce['Users']=_[_0xb42d('0x1c')](_0x45ab91[_0x3460ce['id']],function(_0x36c17c){return{'id':_0x36c17c['id'],'fullname':_0x36c17c[_0xb42d('0x1d')]};});}}catch(_0x1e7254){_0x23d38e(_0x1e7254);}_0x11185d(_0x3460ce);});}function getInteractionTags(_0x13d458,_0x443b63){return new BPromise(function(_0x5b88af,_0x3803a8){try{if(_0x13d458[_0xb42d('0x1e')]){_0x13d458[_0xb42d('0x1f')]=[];_0x13d458[_0xb42d('0x1e')][_0xb42d('0x20')](',')[_0xb42d('0x21')](function(_0x267380){_0x13d458['Tags'][_0xb42d('0x22')](_0x443b63[_0x267380]);});}delete _0x13d458[_0xb42d('0x1e')];}catch(_0x5a332c){_0x3803a8(_0x5a332c);}_0x5b88af(_0x13d458);});}function getLastMessageText(_0x6eee98){return new BPromise(function(_0x378b68,_0x25f0aa){return db[_0xb42d('0x23')][_0xb42d('0x24')]({'where':{'$and':[{'MailInteractionId':_0x6eee98['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xb42d('0x25')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xb42d('0x26')],'order':_0xb42d('0x27'),'raw':!![]})[_0xb42d('0x19')](function(_0x274c1f){if(_0x274c1f&&_0x274c1f[_0xb42d('0x26')]){_0x6eee98[_0xb42d('0x28')]=_[_0xb42d('0x29')](_0x274c1f[_0xb42d('0x26')]);}_0x378b68(_0x6eee98);})[_0xb42d('0x2a')](function(_0x5fc085){_0x25f0aa(_0x5fc085);});});}function updateMailInteraction(_0x182b75,_0x34df4,_0x559029,_0x272ce8){return new BPromise(function(_0x2e52a3,_0x3e62eb){return getInteractionUsers(_0x182b75,_0x559029)[_0xb42d('0x19')](function(_0x37b04d){return getInteractionTags(_0x37b04d,_0x34df4);})['then'](function(_0x3ccf53){if(_0x272ce8){_0x2e52a3(getLastMessageText(_0x3ccf53));}else{_0x2e52a3(_0x3ccf53);}})[_0xb42d('0x2a')](function(_0x530597){_0x3e62eb(_0x530597);});});}exports[_0xb42d('0x2b')]=function(_0x3d1cc6,_0x2b9962){var _0x3d280e={},_0xd23970={},_0x457741={'count':0x0,'rows':[]};var _0x435676=_['map'](db[_0xb42d('0x2c')][_0xb42d('0x2d')],function(_0x40a503){return{'name':_0x40a503[_0xb42d('0x2e')],'type':_0x40a503['type']['key']};});_0xd23970[_0xb42d('0x2f')]=_[_0xb42d('0x1c')](_0x435676,'name');_0xd23970[_0xb42d('0x30')]=_[_0xb42d('0x31')](_0x3d1cc6[_0xb42d('0x30')]);_0xd23970['filters']=_['intersection'](_0xd23970[_0xb42d('0x2f')],_0xd23970[_0xb42d('0x30')]);_0x3d280e[_0xb42d('0x32')]=_[_0xb42d('0x33')](_0xd23970['model'],qs['fields'](_0x3d1cc6['query'][_0xb42d('0x34')]));_0x3d280e['attributes']=_0x3d280e[_0xb42d('0x32')]['length']?_0x3d280e['attributes']:_0xd23970['model'];if(!_0x3d1cc6[_0xb42d('0x30')][_0xb42d('0x35')](_0xb42d('0x36'))){_0x3d280e[_0xb42d('0x16')]=qs[_0xb42d('0x16')](_0x3d1cc6[_0xb42d('0x30')]['limit']);_0x3d280e[_0xb42d('0x14')]=qs[_0xb42d('0x14')](_0x3d1cc6[_0xb42d('0x30')][_0xb42d('0x14')]);}_0x3d280e['order']=qs[_0xb42d('0x37')](_0x3d1cc6[_0xb42d('0x30')]['sort']);_0x3d280e[_0xb42d('0x38')]=qs['filters'](_[_0xb42d('0x39')](_0x3d1cc6[_0xb42d('0x30')],_0xd23970['filters']),_0x435676);var _0x1bbbd3=[];var _0x3fa743=squel['select']()['field']('id')['field'](_0xb42d('0x1a'))[_0xb42d('0x3a')](_0xb42d('0x3b'))[_0xb42d('0x3c')]('tools_tags');var _0x1e1b65=squel[_0xb42d('0x3d')]()[_0xb42d('0x3a')](_0xb42d('0x3e'))['field'](_0xb42d('0x3f'))[_0xb42d('0x3a')](_0xb42d('0x40'))[_0xb42d('0x3c')]('user_has_mail_interactions','ui')[_0xb42d('0x41')](_0xb42d('0x42'),'u',_0xb42d('0x43'));var _0x78811f=squel[_0xb42d('0x3d')]()[_0xb42d('0x3c')]('mail_interactions','i')[_0xb42d('0x41')]('cm_contacts','c',_0xb42d('0x44'))['left_join'](_0xb42d('0x42'),'o',_0xb42d('0x45'))[_0xb42d('0x41')](_0xb42d('0x46'),'a',_0xb42d('0x47'))[_0xb42d('0x41')](_0xb42d('0x48'),'me','me.MailInteractionId\x20=\x20i.id')['left_join']('mail_interaction_has_tags','it',_0xb42d('0x49'))[_0xb42d('0x41')](_0xb42d('0x4a'),'t',_0xb42d('0x4b'));var _0x19d9d1=squel[_0xb42d('0x4c')]();var _0x3d526a=[];var _0x116b86=squel['expr']();var _0x3f2694;if(_0x3d1cc6['query']['search']){_0x3f2694=as[_0xb42d('0x4d')](_0x3d1cc6[_0xb42d('0x30')][_0xb42d('0x4e')]);var _0x1a64e6=_0x3f2694['sqlOperator'];for(var _0x5f3440=0x0;_0x5f3440<_0x3f2694[_0xb42d('0x4f')]['length'];_0x5f3440++){var _0x3da68a=_0x3f2694[_0xb42d('0x4f')][_0x5f3440];var _0x329ccf='i';var _0x22dea1=_[_0xb42d('0x50')](_0x435676,[_0xb42d('0x1a'),_0x3da68a[_0xb42d('0x3a')]]);if(!_0x22dea1){switch(_0x3da68a['field']){case _0xb42d('0x51'):if(_0x3da68a[_0xb42d('0x52')]==0x1){_0x78811f[_0xb42d('0x53')]('`'+_0x3da68a[_0xb42d('0x3a')]+_0xb42d('0x54'));}else{_0x78811f['having']('`'+_0x3da68a[_0xb42d('0x3a')]+_0xb42d('0x55'));}break;case _0xb42d('0x56'):if(_0x3da68a[_0xb42d('0x57')]===_0xb42d('0x58')){if(_0x3da68a[_0xb42d('0x52')][_0xb42d('0x20')]('\x20')[_0xb42d('0x59')]>0x1){_0x19d9d1[_0x1a64e6](_0xb42d('0x5a'),qs[_0xb42d('0x5b')](_0x3da68a['value']),null);}else{var _0xeb6be='%'+_0x3da68a[_0xb42d('0x52')]+'%';_0x19d9d1[_0x1a64e6](_0xb42d('0x5c'),_0xeb6be,_0xeb6be,_0xeb6be);}}else{_0x22dea1=_['find'](_0x435676,[_0xb42d('0x1a'),_0xb42d('0x5d')]);_0x3da68a['field']=_0xb42d('0x5d');_0x54d39b=as[_0xb42d('0x5e')](_0x329ccf,_0x22dea1[_0xb42d('0x5f')],_0x3da68a);_0x19d9d1[_0x1a64e6](_0x54d39b[_0xb42d('0x60')],_0x54d39b[_0xb42d('0x52')]['start'],_0x54d39b[_0xb42d('0x52')][_0xb42d('0x12')]);}break;case _0xb42d('0x61'):var _0x3b3846=_0x3da68a[_0xb42d('0x52')][_0xb42d('0x20')](',')[_0xb42d('0x1c')](function(_0x4f70e4){return Number(_0x4f70e4);});_0x3b3846['forEach'](function(_0x22d9b6){_0x116b86['or'](_0xb42d('0x62'),'%,'+_0x22d9b6+',%');});_0x3d526a=_['union'](_0x3d526a,_0x3b3846);break;case _0xb42d('0x63'):if(_0x3da68a[_0xb42d('0x57')]===_0xb42d('0x58')){_0x19d9d1[_0x1a64e6]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x3da68a[_0xb42d('0x52')]+'%',null);}else{_0x22dea1=_[_0xb42d('0x50')](_0x435676,['name',_0xb42d('0x64')]);_0x3da68a['field']='UserId';_0x54d39b=as[_0xb42d('0x5e')](_0x329ccf,_0x22dea1[_0xb42d('0x5f')],_0x3da68a);_0x19d9d1[_0x1a64e6](_0x54d39b[_0xb42d('0x60')],_0x54d39b[_0xb42d('0x52')][_0xb42d('0x65')],_0x54d39b[_0xb42d('0x52')]['end']);}break;case _0xb42d('0x26'):_0x54d39b=as[_0xb42d('0x5e')]('me',null,_0x3da68a);_0x19d9d1[_0x1a64e6](_0x54d39b['text'],_0x54d39b[_0xb42d('0x52')]['start'],_0x54d39b[_0xb42d('0x52')][_0xb42d('0x12')]);break;}}else{var _0x54d39b=as[_0xb42d('0x5e')](_0x329ccf,_0x22dea1['type'],_0x3da68a);_0x19d9d1[_0x1a64e6](_0x54d39b[_0xb42d('0x60')],_0x54d39b[_0xb42d('0x52')][_0xb42d('0x65')],_0x54d39b[_0xb42d('0x52')][_0xb42d('0x12')]);}}}else{var _0x14a400=_(_0x3d1cc6['query'])[_0xb42d('0x31')]()[_0xb42d('0x1c')](function(_0x45a622){return _[_0xb42d('0x66')](_0x435676,[_0xb42d('0x1a'),_0x45a622])?_0x45a622:undefined;})[_0xb42d('0x67')]()['value']();if(!_[_0xb42d('0x68')](_0x14a400)){_0x14a400[_0xb42d('0x21')](function(_0x3d11da){if(_0x3d11da===_0xb42d('0x69')){_0x78811f[_0xb42d('0x38')](_0xb42d('0x6a'),[][_0xb42d('0x6b')](_0x3d1cc6[_0xb42d('0x30')][_0x3d11da]));}else if(_0x3d11da===_0xb42d('0x6c')){var _0x5e5f02=JSON[_0xb42d('0x6d')](_0x3d1cc6['query'][_0x3d11da])[_0xb42d('0x6e')];var _0x2bfb8a=JSON[_0xb42d('0x6d')](_0x3d1cc6[_0xb42d('0x30')][_0x3d11da])[_0xb42d('0x6f')];_0x78811f['where'](_0xb42d('0x70'),_0x5e5f02,_0x2bfb8a);}else{if(_0x3d1cc6[_0xb42d('0x30')][_0x3d11da]===_0xb42d('0x71')){_0x78811f['where']('i.'+_0x3d11da+_0xb42d('0x72'));}else{_0x78811f[_0xb42d('0x38')]('i.'+_0x3d11da+_0xb42d('0x73'),_0x3d1cc6[_0xb42d('0x30')][_0x3d11da]);}}});}if(_0x3d1cc6[_0xb42d('0x30')]['read']){if(_0x3d1cc6['query']['read']==0x1){_0x78811f[_0xb42d('0x53')]('`unreadMessages`\x20=\x200');}else{_0x78811f['having'](_0xb42d('0x74'));}}if(_0x3d1cc6[_0xb42d('0x30')][_0xb42d('0x75')]){_0x3d526a=_[_0xb42d('0x76')](_0x3d1cc6[_0xb42d('0x30')][_0xb42d('0x75')])?_0x3d1cc6[_0xb42d('0x30')][_0xb42d('0x75')]:new Array(_0x3d1cc6[_0xb42d('0x30')][_0xb42d('0x75')]);_0x3d526a[_0xb42d('0x21')](function(_0x29426a){_0x116b86['or'](_0xb42d('0x62'),'%,'+_0x29426a+',%');});}if(_0x3d1cc6['query'][_0xb42d('0x77')]){var _0x1c0fb9=_0x3d1cc6['query']['filter']['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x1c0fb9)){_0x19d9d1['or'](_0xb42d('0x78'),_0x1c0fb9+'%');}else if(qs[_0xb42d('0x79')](_0x1c0fb9)){_0x19d9d1['or'](_0xb42d('0x7a'),_0x1c0fb9+'%');}else{_0x19d9d1['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xb42d('0x5b')](_0x1c0fb9))['or'](_0xb42d('0x7b'),qs[_0xb42d('0x5b')](_0x1c0fb9));}}}_0x78811f[_0xb42d('0x38')](_0x19d9d1);_0x78811f['group'](_0xb42d('0x7c'));var _0x593884={'type':db[_0xb42d('0x7d')][_0xb42d('0x7e')][_0xb42d('0x7f')],'raw':!![]};var _0x3996b0=_0x78811f['clone']();_0x3996b0['field'](_0xb42d('0x7c'));_0x3996b0[_0xb42d('0x3a')](_0xb42d('0x80'),'unreadMessages');if(_0x3d280e[_0xb42d('0x81')]){_0x3d280e['order'][_0xb42d('0x21')](function(_0x2ae92d){var _0x45936a=_0x2ae92d[0x0]===_0xb42d('0x82')?_0x2ae92d[0x0]:'i.'+_0x2ae92d[0x0];_0x78811f[_0xb42d('0x81')](_0x45936a,_0x2ae92d[0x1]===_0xb42d('0x83')?![]:!![]);});}if(!_[_0xb42d('0x68')](_0x3d526a)){_0x78811f[_0xb42d('0x53')](_0x116b86);_0x3996b0[_0xb42d('0x38')](_0xb42d('0x84'),_0x3d526a);}BPromise[_0xb42d('0x85')]()[_0xb42d('0x19')](function(){if(!_0x3f2694){if(_0x3d1cc6[_0xb42d('0x30')][_0xb42d('0x69')])return;_0x3996b0[_0xb42d('0x38')](_0xb42d('0x86'));_0x78811f[_0xb42d('0x38')](_0xb42d('0x86'));return;}if(_0x3d1cc6[_0xb42d('0x87')][_0xb42d('0x88')]!==_0xb42d('0x89'))return;return _0x3d1cc6[_0xb42d('0x87')]['getMailAccounts']({'attributes':['id'],'raw':!![]})[_0xb42d('0x19')](function(_0x21248f){if(_[_0xb42d('0x68')](_0x21248f)){_0x3996b0[_0xb42d('0x38')](_0xb42d('0x8a'));_0x78811f[_0xb42d('0x38')](_0xb42d('0x8a'));}else{_0x3996b0[_0xb42d('0x38')](_0xb42d('0x6a'),_[_0xb42d('0x1c')](_0x21248f,'id'));_0x78811f[_0xb42d('0x38')]('i.MailAccountId\x20IN\x20?',_['map'](_0x21248f,'id'));}});})['then'](function(){if(_0x3d1cc6[_0xb42d('0x87')][_0xb42d('0x88')]==='agent'&&!_0x3f2694&&!_0x3d1cc6[_0xb42d('0x30')][_0xb42d('0x69')])return[];return db[_0xb42d('0x8b')]['query'](_0x3996b0[_0xb42d('0x8c')](),_0x593884);})['then'](function(_0x2b64c7){_0x457741[_0xb42d('0x8d')]=_0x2b64c7[_0xb42d('0x59')];if(_0x457741[_0xb42d('0x8d')]===0x0)return[];return db[_0xb42d('0x8b')][_0xb42d('0x30')](_0x3fa743[_0xb42d('0x8c')](),_0x593884)[_0xb42d('0x19')](function(_0x290b6a){_0x1bbbd3=_['keyBy'](_0x290b6a,'id');_0x593884=_[_0xb42d('0x8e')](_0x593884,{'model':db[_0xb42d('0x2c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3d1cc6[_0xb42d('0x30')]['fields']){_0x3d280e[_0xb42d('0x32')]['forEach'](function(_0x120aea){_0x78811f[_0xb42d('0x3a')]('i.'+_0x120aea);});}else{_0x78811f[_0xb42d('0x3a')](_0xb42d('0x80'),'unreadMessages');_0x78811f[_0xb42d('0x3a')]('a.key',_0xb42d('0x8f'));_0x78811f[_0xb42d('0x3a')](_0xb42d('0x90'),'Account.mandatoryDisposition');_0x78811f[_0xb42d('0x3a')]('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');_0x78811f['field']('i.id');_0x78811f[_0xb42d('0x3a')]('i.createdAt');_0x78811f[_0xb42d('0x3a')](_0xb42d('0x91'));_0x78811f[_0xb42d('0x3a')](_0xb42d('0x92'));_0x78811f['field'](_0xb42d('0x93'));_0x78811f[_0xb42d('0x3a')](_0xb42d('0x94'));_0x78811f[_0xb42d('0x3a')](_0xb42d('0x95'));_0x78811f[_0xb42d('0x3a')](_0xb42d('0x96'));_0x78811f['field'](_0xb42d('0x97'));_0x78811f[_0xb42d('0x3a')]('i.disposition');_0x78811f[_0xb42d('0x3a')](_0xb42d('0x98'));_0x78811f[_0xb42d('0x3a')](_0xb42d('0x99'));_0x78811f[_0xb42d('0x3a')](_0xb42d('0x9a'));_0x78811f[_0xb42d('0x3a')](_0xb42d('0x9b'));_0x78811f[_0xb42d('0x3a')](_0xb42d('0x9c'));_0x78811f[_0xb42d('0x3a')]('i.MailAccountId');_0x78811f[_0xb42d('0x3a')](_0xb42d('0x9d'));_0x78811f[_0xb42d('0x3a')](_0xb42d('0x9e'),_0xb42d('0x9f'));_0x78811f[_0xb42d('0x3a')]('c.lastName',_0xb42d('0xa0'));_0x78811f[_0xb42d('0x3a')](_0xb42d('0xa1'),_0xb42d('0xa2'));_0x78811f['field'](_0xb42d('0xa3'),_0xb42d('0xa4'));_0x78811f[_0xb42d('0x3a')](_0xb42d('0xa5'),_0xb42d('0xa6'));_0x78811f[_0xb42d('0x3a')](_0xb42d('0xa7'),_0xb42d('0xa8'));_0x78811f[_0xb42d('0x3a')](_0xb42d('0xa9'),_0xb42d('0xaa'));_0x78811f[_0xb42d('0x3a')]('o.internal',_0xb42d('0xab'));_0x78811f['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0xb42d('0x1e'));}if(_0x3d280e[_0xb42d('0x16')])_0x78811f[_0xb42d('0x16')](_0x3d280e[_0xb42d('0x16')]);if(_0x3d280e[_0xb42d('0x14')])_0x78811f[_0xb42d('0x14')](_0x3d280e[_0xb42d('0x14')]);return db[_0xb42d('0x8b')][_0xb42d('0x30')](_0x78811f[_0xb42d('0x8c')](),_0x593884);})['then'](function(_0x363279){if(_0x363279['length']>0x0)_0x1e1b65[_0xb42d('0x38')](_0xb42d('0xac'),_[_0xb42d('0x1c')](_0x363279,'id'));return db[_0xb42d('0x8b')][_0xb42d('0x30')](_0x1e1b65[_0xb42d('0x8c')](),_0x593884)[_0xb42d('0x19')](function(_0x322cd5){var _0x113798=_[_0xb42d('0xad')](_0x322cd5,_0xb42d('0xae'));var _0x49aac7=[];return db[_0xb42d('0xaf')][_0xb42d('0x24')]({'attributes':[_0xb42d('0xb0')],'raw':!![]})[_0xb42d('0x19')](function(_0x1ed2ef){var _0x5dfdba=_0x1ed2ef['enableEmailPreview'];_0x363279[_0xb42d('0x21')](function(_0x2ff488){_0x49aac7[_0xb42d('0x22')](updateMailInteraction(_0x2ff488,_0x1bbbd3,_0x113798,_0x5dfdba));});return BPromise[_0xb42d('0xb1')](_0x49aac7);});});});})[_0xb42d('0x19')](function(_0x3c0b06){_0x457741[_0xb42d('0xb2')]=_0x3c0b06;return _0x457741;})['then'](respondWithFilteredResult(_0x2b9962,_0x3d280e))[_0xb42d('0x2a')](handleError(_0x2b9962,null));};exports[_0xb42d('0xb3')]=function(_0x3c1c52,_0x4e6ba1){var _0xce5c82={'raw':![],'where':{'id':_0x3c1c52['params']['id']}},_0x3dc75c={};_0x3dc75c[_0xb42d('0x2f')]=_['keys'](db[_0xb42d('0x2c')]['rawAttributes']);_0x3dc75c[_0xb42d('0x30')]=_[_0xb42d('0x31')](_0x3c1c52[_0xb42d('0x30')]);_0x3dc75c[_0xb42d('0xb4')]=_[_0xb42d('0x33')](_0x3dc75c[_0xb42d('0x2f')],_0x3dc75c[_0xb42d('0x30')]);_0xce5c82['attributes']=_[_0xb42d('0x33')](_0x3dc75c[_0xb42d('0x2f')],qs['fields'](_0x3c1c52[_0xb42d('0x30')][_0xb42d('0x34')]));_0xce5c82[_0xb42d('0x32')]=_0xce5c82['attributes'][_0xb42d('0x59')]?_0xce5c82[_0xb42d('0x32')]:_0x3dc75c[_0xb42d('0x2f')];if(_0x3c1c52[_0xb42d('0x30')]['includeAll']){_0xce5c82['include']=[{'all':!![]}];}_0xce5c82=_['merge']({},_0xce5c82,_0x3c1c52[_0xb42d('0xb5')]);return db['MailInteraction'][_0xb42d('0x50')](_0xce5c82)[_0xb42d('0x19')](handleEntityNotFound(_0x4e6ba1,null))[_0xb42d('0x19')](respondWithResult(_0x4e6ba1,null))[_0xb42d('0x2a')](handleError(_0x4e6ba1,null));};exports[_0xb42d('0xb6')]=function(_0x5e1f76,_0x222900){return db[_0xb42d('0x2c')][_0xb42d('0xb6')](_0x5e1f76['body'],{})[_0xb42d('0x19')](respondWithResult(_0x222900,0xc9))[_0xb42d('0x2a')](handleError(_0x222900,null));};exports['update']=function(_0x3a2d32,_0x512d9f){if(_0x3a2d32[_0xb42d('0xb7')]['id']){delete _0x3a2d32[_0xb42d('0xb7')]['id'];}return db[_0xb42d('0x2c')][_0xb42d('0x50')]({'where':{'id':_0x3a2d32[_0xb42d('0xb8')]['id']}})[_0xb42d('0x19')](handleEntityNotFound(_0x512d9f,null))[_0xb42d('0x19')](saveUpdates(_0x3a2d32[_0xb42d('0xb7')],null))['then'](respondWithResult(_0x512d9f,null))[_0xb42d('0x2a')](handleError(_0x512d9f,null));};exports[_0xb42d('0xb9')]=function(_0x1493fe,_0x24b2c7){return db[_0xb42d('0x2c')][_0xb42d('0x50')]({'where':{'id':_0x1493fe[_0xb42d('0xb8')]['id']}})[_0xb42d('0x19')](handleEntityNotFound(_0x24b2c7,null))[_0xb42d('0x19')](removeEntity(_0x24b2c7,null))['catch'](handleError(_0x24b2c7,null));};exports[_0xb42d('0xba')]=function(_0x4d29d7,_0x224b39){return db[_0xb42d('0x2c')][_0xb42d('0xba')]()[_0xb42d('0x19')](respondWithResult(_0x224b39,null))[_0xb42d('0x2a')](handleError(_0x224b39,null));};exports[_0xb42d('0xbb')]=function(_0x3a2fae,_0x2daefb){return db['MailMessage'][_0xb42d('0x50')]({'where':{'id':_0x3a2fae['params']['id']}})[_0xb42d('0x19')](handleEntityNotFound(_0x2daefb,null))[_0xb42d('0x19')](function(_0x128687){if(_0x128687){return _0x128687[_0xb42d('0xbb')](_0x3a2fae[_0xb42d('0xb7')][_0xb42d('0xbc')],_['omit'](_0x3a2fae[_0xb42d('0xb7')],[_0xb42d('0xbc'),'id'])||{});}})['then'](respondWithResult(_0x2daefb,null))['catch'](handleError(_0x2daefb,null));};exports['getMessages']=function(_0x1c8a04,_0x45fa49){var _0x16cb1c={'raw':![],'where':{}};var _0x15d0d7={};var _0x8a0c27={'count':0x0,'rows':[]};return db[_0xb42d('0x2c')]['findOne']({'where':{'id':_0x1c8a04[_0xb42d('0xb8')]['id']}})['then'](handleEntityNotFound(_0x45fa49,null))[_0xb42d('0x19')](function(_0xc3a62){if(_0xc3a62){_0x15d0d7[_0xb42d('0x2f')]=_['keys'](db[_0xb42d('0x23')][_0xb42d('0x2d')]);_0x15d0d7['query']=_[_0xb42d('0x31')](_0x1c8a04[_0xb42d('0x30')]);_0x15d0d7[_0xb42d('0xb4')]=_[_0xb42d('0x33')](_0x15d0d7[_0xb42d('0x2f')],_0x15d0d7[_0xb42d('0x30')]);_0x16cb1c[_0xb42d('0x32')]=_[_0xb42d('0x33')](_0x15d0d7[_0xb42d('0x2f')],qs['fields'](_0x1c8a04[_0xb42d('0x30')][_0xb42d('0x34')]));_0x16cb1c[_0xb42d('0x32')]=_0x16cb1c[_0xb42d('0x32')][_0xb42d('0x59')]?_0x16cb1c[_0xb42d('0x32')]:_0x15d0d7[_0xb42d('0x2f')];if(!_0x1c8a04[_0xb42d('0x30')]['hasOwnProperty']('nolimit')){_0x16cb1c[_0xb42d('0x16')]=qs[_0xb42d('0x16')](_0x1c8a04[_0xb42d('0x30')]['limit']);_0x16cb1c[_0xb42d('0x14')]=qs[_0xb42d('0x14')](_0x1c8a04[_0xb42d('0x30')]['offset']);}_0x16cb1c[_0xb42d('0x81')]=qs[_0xb42d('0x37')](_0x1c8a04[_0xb42d('0x30')][_0xb42d('0x37')]);_0x16cb1c['where']=qs[_0xb42d('0xb4')](_[_0xb42d('0x39')](_0x1c8a04[_0xb42d('0x30')],_0x15d0d7[_0xb42d('0xb4')]));_0x16cb1c[_0xb42d('0x38')]['MailInteractionId']=_0xc3a62['id'];if(_0x1c8a04['query'][_0xb42d('0x77')]){_0x16cb1c[_0xb42d('0x38')]=_['merge'](_0x16cb1c[_0xb42d('0x38')],{'$or':_[_0xb42d('0x1c')](_0x16cb1c['attributes'],function(_0x21fb3f){var _0x23fc0b={};_0x23fc0b[_0x21fb3f]={'$like':'%'+_0x1c8a04[_0xb42d('0x30')]['filter']+'%'};return _0x23fc0b;})});}if(_0x1c8a04[_0xb42d('0x30')][_0xb42d('0x6e')]){var _0x11318c=_0x1c8a04[_0xb42d('0x30')][_0xb42d('0x6e')][_0xb42d('0x20')](',');var _0x5a7e47={};_0x5a7e47[_0x11318c[0x0]]={'$gte':moment(_0x11318c[0x1])[_0xb42d('0xbd')](_0xb42d('0xbe'))};_0x16cb1c[_0xb42d('0x38')]=_[_0xb42d('0x8e')](_0x16cb1c[_0xb42d('0x38')],_0x5a7e47);}_0x16cb1c=_['merge']({},_0x16cb1c,_0x1c8a04[_0xb42d('0xb5')]);return db['MailMessage']['count']({'where':_0x16cb1c['where']})[_0xb42d('0x19')](function(_0x1f9104){_0x8a0c27[_0xb42d('0x8d')]=_0x1f9104;if(_0x1c8a04[_0xb42d('0x30')][_0xb42d('0xbf')]){_0x16cb1c[_0xb42d('0xc0')]=[{'all':!![]}];}return db[_0xb42d('0x23')][_0xb42d('0xc1')](_0x16cb1c);})[_0xb42d('0x19')](function(_0x854519){if(_0x1c8a04[_0xb42d('0x30')]['inlineCss']===_0xb42d('0xc2')){for(var _0x292a29=0x0;_0x292a29<_0x854519[_0xb42d('0x59')];_0x292a29++){_0x854519[_0x292a29][_0xb42d('0xb7')]=juice(_0x854519[_0x292a29]['body']);}}_0x8a0c27['rows']=_0x854519;return _0x8a0c27;});}})['then'](respondWithFilteredResult(_0x45fa49,_0x16cb1c))[_0xb42d('0x2a')](handleError(_0x45fa49,null));};exports[_0xb42d('0xc3')]=function(_0x363049,_0x4cce3d){return db[_0xb42d('0x2c')][_0xb42d('0x50')]({'where':{'id':_0x363049['params']['id']}})[_0xb42d('0x19')](handleEntityNotFound(_0x4cce3d,null))[_0xb42d('0x19')](function(_0x680b73){if(_0x680b73){return _0x680b73[_0xb42d('0xc4')](_0x363049[_0xb42d('0xb7')]['ids'],_[_0xb42d('0xc5')](_0x363049[_0xb42d('0xb7')],[_0xb42d('0xbc'),'id'])||{})[_0xb42d('0xc6')](function(){return db[_0xb42d('0x61')]['findAll']({'attributes':['id',_0xb42d('0x1a'),_0xb42d('0x3b')],'where':{'id':_0x363049[_0xb42d('0xb7')][_0xb42d('0xbc')]}});})['then'](function(_0x109966){socket[_0xb42d('0xc7')](_0xb42d('0xc8'),{'id':Number(_0x363049[_0xb42d('0xb8')]['id']),'tags':_0x109966||[]});return{'id':Number(_0x363049['params']['id']),'tags':_0x109966||[]};});}})[_0xb42d('0x19')](respondWithResult(_0x4cce3d,null))[_0xb42d('0x2a')](handleError(_0x4cce3d,null));};exports[_0xb42d('0xc9')]=function(_0x3690bf,_0x23c24d){return db[_0xb42d('0x2c')][_0xb42d('0x50')]({'where':{'id':_0x3690bf['params']['id']}})[_0xb42d('0x19')](handleEntityNotFound(_0x23c24d,null))[_0xb42d('0x19')](function(_0x213a15){if(_0x213a15){return _0x213a15[_0xb42d('0xc9')](_0x3690bf[_0xb42d('0x30')][_0xb42d('0xbc')]);}})[_0xb42d('0x19')](respondWithStatusCode(_0x23c24d,null))[_0xb42d('0x2a')](handleError(_0x23c24d,null));};exports[_0xb42d('0xca')]=function(_0x5c08b6,_0x402239){var _0x41ecec=moment()['unix']()[_0xb42d('0x8c')]();var _0xc9df2c=path[_0xb42d('0xcb')](config['root'],_0xb42d('0xcc'),_0xb42d('0xcd'),_0xb42d('0xce'));var _0x754434=path[_0xb42d('0xcb')](config[_0xb42d('0xcf')],'server','files',_0xb42d('0xd0'));var _0x3c54b9=path[_0xb42d('0xcb')](_0xc9df2c,_0x41ecec);var _0x1af614=util['format'](_0xb42d('0xd1'),_0x5c08b6[_0xb42d('0xb8')]['id'],_0x41ecec);var _0x32a172=path['join'](_0xc9df2c,_0x1af614);var _0x597fd1=[];if(_0x5c08b6['query']['attachments']){_0x597fd1[_0xb42d('0x22')]({'model':db['Attachment'],'as':_0xb42d('0xd2'),'raw':!![]});}var _0x159589=[{'model':db[_0xb42d('0x23')],'as':_0xb42d('0xd3'),'attributes':['id',_0xb42d('0xb7'),_0xb42d('0x3c'),'to','cc',_0xb42d('0xd4'),_0xb42d('0xd5'),'createdAt'],'where':{'secret':![]},'order':qs[_0xb42d('0x37')]('id'),'include':_0x597fd1}];return db['MailInteraction'][_0xb42d('0x50')]({'where':{'id':_0x5c08b6['params']['id']},'include':_0x159589})[_0xb42d('0x19')](handleEntityNotFound(_0x402239,null))['then'](function(_0x229615){if(_0x229615&&_0x229615[_0xb42d('0xd3')]){var _0x462fa8=_0x229615['get']({'plain':!![]});fs[_0xb42d('0xd6')](_0x3c54b9);return BPromise['each'](_0x462fa8[_0xb42d('0xd3')],function(_0x8b326,_0xefd46f){var _0x2f4935={'from':_0x8b326['from'],'to':_0x8b326['to'],'subject':_0x8b326[_0xb42d('0xd5')],'html':htmlEntities[_0xb42d('0xd7')](_0x8b326['body']),'headers':{'Date':moment(_0x8b326[_0xb42d('0x6c')])['format'](_0xb42d('0xd8'))},'attachments':[]};if(_0x8b326['cc']){_0x2f4935[_0xb42d('0xd9')]['Cc']=_0x8b326['cc'];}if(_0x8b326['bcc']){_0x2f4935['headers'][_0xb42d('0xda')]=_0x8b326[_0xb42d('0xd4')];}return new BPromise(function(_0x398942,_0x18e6e0){if(_0x8b326[_0xb42d('0xd2')]){for(var _0x55a0e1=0x0;_0x55a0e1<_0x8b326[_0xb42d('0xd2')][_0xb42d('0x59')];_0x55a0e1++){var _0x552783=_0x8b326[_0xb42d('0xd2')][_0x55a0e1];var _0x240587=path[_0xb42d('0xcb')](_0x754434,_0x552783[_0xb42d('0xdb')]);if(fs[_0xb42d('0xdc')](_0x240587)){_0x2f4935[_0xb42d('0xd0')]['push']({'name':_0x552783['name'],'contentType':_0x552783[_0xb42d('0x5f')],'data':fs[_0xb42d('0xdd')](_0x240587)});}}}emlformat[_0xb42d('0xde')](_0x2f4935,function(_0x17f27a,_0x12c8c9){if(_0x17f27a)return _0x18e6e0(_0x17f27a);fs[_0xb42d('0xdf')](path['join'](_0x3c54b9,util['format'](_0xb42d('0xe0'),_0xefd46f)),_0x12c8c9);return _0x398942(_0x12c8c9);});});})[_0xb42d('0x19')](function(){return new BPromise(function(_0x2e5b48,_0x3a75d2){zipdir(_0x3c54b9,{'saveTo':_0x32a172},function(_0xb491e9,_0x41f895){if(_0xb491e9)return _0x3a75d2(_0xb491e9);return _0x2e5b48(_0x41f895);});})[_0xb42d('0x19')](function(){return new BPromise(function(_0x124ee2,_0x2741e4){rimraf(_0x3c54b9,function(_0x3a0118){if(_0x3a0118)_0x2741e4(_0x3a0118);return _0x124ee2();});});})[_0xb42d('0x19')](function(){return _0x402239[_0xb42d('0xca')](_0x32a172,_0x1af614,function(_0x18d3c8){if(!_0x18d3c8)fs[_0xb42d('0xe1')](_0x32a172);});});});}else{return _0x402239[_0xb42d('0x10')](0xc8);}})[_0xb42d('0x2a')](handleError(_0x402239,null));};
\ No newline at end of file
+var _0x1038=['localhost','./mailInteraction.socket','register','status','json','offset','undefined','limit','update','then','stack','name','send','map','fullname','TagIds','Tags','split','push','MailMessage','findOne','out','plainBody','lastMsgText','trimStart','catch','MailInteraction','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','u.id','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','tools_tags','expr','search','sqlOperator','conditions','find','value','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','start','end','compact','isEmpty','MailAccountId','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','QueryTypes','i.id','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','i.MailAccountId\x20IN\x20?','toString','count','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','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','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','all','rows','show','rawAttributes','include','merge','options','create','body','destroy','params','describe','addMessage','ids','getMessages','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','spread','emit','removeTags','download','unix','server','files','tmp','root','attachments','join','transcript-%d-%s.zip','Attachment','Attachments','Messages','from','bcc','createdAt','get','mkdirSync','each','decode','format','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','build','message%d.eml','unlinkSync','sendStatus','eml-format','zip-dir','moment','util','path','squel','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../mysqldb','html-entities','redis'];(function(_0xe7dc47,_0x26d832){var _0x20a92c=function(_0x3c3252){while(--_0x3c3252){_0xe7dc47['push'](_0xe7dc47['shift']());}};_0x20a92c(++_0x26d832);}(_0x1038,0x1b9));var _0x8103=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x1038[_0x49d41c];return _0xb64c5f;};'use strict';var emlformat=require(_0x8103('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8103('0x1'));var moment=require(_0x8103('0x2'));var BPromise=require('bluebird');var util=require(_0x8103('0x3'));var path=require(_0x8103('0x4'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8103('0x5'));var juice=require(_0x8103('0x6'));var Redis=require(_0x8103('0x7'));var qs=require(_0x8103('0x8'));var as=require(_0x8103('0x9'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0x8103('0xa'))['db'];var htmlEntities=require(_0x8103('0xb'));config[_0x8103('0xc')]=_['defaults'](config['redis'],{'host':_0x8103('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8103('0xc')]));require(_0x8103('0xe'))[_0x8103('0xf')](socket);function respondWithStatusCode(_0x4ba17d,_0x343281){_0x343281=_0x343281||0xcc;return function(_0x1c4f89){if(_0x1c4f89){return _0x4ba17d['sendStatus'](_0x343281);}return _0x4ba17d[_0x8103('0x10')](_0x343281)['end']();};}function respondWithResult(_0x4c5232,_0x442c45){_0x442c45=_0x442c45||0xc8;return function(_0x16da80){if(_0x16da80){return _0x4c5232[_0x8103('0x10')](_0x442c45)[_0x8103('0x11')](_0x16da80);}};}function respondWithFilteredResult(_0x553bb8,_0x330fb1){return function(_0x14d2b9){if(_0x14d2b9){var _0x4edb52=typeof _0x330fb1[_0x8103('0x12')]===_0x8103('0x13')&&typeof _0x330fb1[_0x8103('0x14')]===_0x8103('0x13');var _0x3a3098=_0x14d2b9['count'];var _0x41c8bd=_0x4edb52?0x0:_0x330fb1[_0x8103('0x12')];var _0x4e0fbf=_0x4edb52?_0x14d2b9['count']:_0x330fb1[_0x8103('0x12')]+_0x330fb1[_0x8103('0x14')];var _0x57d696;if(_0x4e0fbf>=_0x3a3098){_0x4e0fbf=_0x3a3098;_0x57d696=0xc8;}else{_0x57d696=0xce;}_0x553bb8[_0x8103('0x10')](_0x57d696);return _0x553bb8['set']('Content-Range',_0x41c8bd+'-'+_0x4e0fbf+'/'+_0x3a3098)[_0x8103('0x11')](_0x14d2b9);}return null;};}function saveUpdates(_0x38845b){return function(_0x44d1a6){if(_0x44d1a6){return _0x44d1a6[_0x8103('0x15')](_0x38845b)[_0x8103('0x16')](function(_0x1f3710){return _0x1f3710;});}return null;};}function removeEntity(_0x3598c5){return function(_0x3b6e4f){if(_0x3b6e4f){return _0x3b6e4f['destroy']()[_0x8103('0x16')](function(){_0x3598c5[_0x8103('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b1cf3){return function(_0x4e12fb){if(!_0x4e12fb){_0x3b1cf3['sendStatus'](0x194);}return _0x4e12fb;};}function handleError(_0x4fe530,_0x87496){_0x87496=_0x87496||0x1f4;return function(_0x5f094){logger['error'](_0x5f094[_0x8103('0x17')]);if(_0x5f094[_0x8103('0x18')]){delete _0x5f094[_0x8103('0x18')];}_0x4fe530[_0x8103('0x10')](_0x87496)[_0x8103('0x19')](_0x5f094);};}function getInteractionUsers(_0x5f56e3,_0x47e056){return new BPromise(function(_0x4e595b,_0x5a07d4){try{if(_0x47e056[_0x5f56e3['id']]){_0x5f56e3['Users']=_[_0x8103('0x1a')](_0x47e056[_0x5f56e3['id']],function(_0x26b935){return{'id':_0x26b935['id'],'fullname':_0x26b935[_0x8103('0x1b')]};});}}catch(_0x18a2c7){_0x5a07d4(_0x18a2c7);}_0x4e595b(_0x5f56e3);});}function getInteractionTags(_0x6f6aed,_0x5d11ef){return new BPromise(function(_0x56474a,_0x4e5eb2){try{if(_0x6f6aed[_0x8103('0x1c')]){_0x6f6aed[_0x8103('0x1d')]=[];_0x6f6aed[_0x8103('0x1c')][_0x8103('0x1e')](',')['forEach'](function(_0x471db6){_0x6f6aed[_0x8103('0x1d')][_0x8103('0x1f')](_0x5d11ef[_0x471db6]);});}delete _0x6f6aed[_0x8103('0x1c')];}catch(_0x205d53){_0x4e5eb2(_0x205d53);}_0x56474a(_0x6f6aed);});}function getLastMessageText(_0x2629bd){return new BPromise(function(_0x59f13d,_0x2ac918){return db[_0x8103('0x20')][_0x8103('0x21')]({'where':{'$and':[{'MailInteractionId':_0x2629bd['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x8103('0x22')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x8103('0x23')],'order':'-id','raw':!![]})[_0x8103('0x16')](function(_0x3f8236){if(_0x3f8236&&_0x3f8236[_0x8103('0x23')]){_0x2629bd[_0x8103('0x24')]=_[_0x8103('0x25')](_0x3f8236['plainBody']);}_0x59f13d(_0x2629bd);})[_0x8103('0x26')](function(_0x2ca2f5){_0x2ac918(_0x2ca2f5);});});}function updateMailInteraction(_0x5bafd7,_0x37b598,_0xe03e49,_0x1d8e47){return new BPromise(function(_0x5572ac,_0x24edff){return getInteractionUsers(_0x5bafd7,_0xe03e49)['then'](function(_0x378b48){return getInteractionTags(_0x378b48,_0x37b598);})['then'](function(_0x5b556d){if(_0x1d8e47){_0x5572ac(getLastMessageText(_0x5b556d));}else{_0x5572ac(_0x5b556d);}})[_0x8103('0x26')](function(_0x429fc9){_0x24edff(_0x429fc9);});});}exports['index']=function(_0x2e1318,_0x285ecd){var _0x48064a={},_0x5479ae={},_0x329c6f={'count':0x0,'rows':[]};var _0x4c573f=_[_0x8103('0x1a')](db[_0x8103('0x27')]['rawAttributes'],function(_0x3b7fd2){return{'name':_0x3b7fd2[_0x8103('0x28')],'type':_0x3b7fd2['type'][_0x8103('0x29')]};});_0x5479ae['model']=_[_0x8103('0x1a')](_0x4c573f,_0x8103('0x18'));_0x5479ae[_0x8103('0x2a')]=_[_0x8103('0x2b')](_0x2e1318[_0x8103('0x2a')]);_0x5479ae[_0x8103('0x2c')]=_[_0x8103('0x2d')](_0x5479ae['model'],_0x5479ae[_0x8103('0x2a')]);_0x48064a['attributes']=_[_0x8103('0x2d')](_0x5479ae[_0x8103('0x2e')],qs['fields'](_0x2e1318[_0x8103('0x2a')][_0x8103('0x2f')]));_0x48064a[_0x8103('0x30')]=_0x48064a['attributes'][_0x8103('0x31')]?_0x48064a[_0x8103('0x30')]:_0x5479ae[_0x8103('0x2e')];if(!_0x2e1318[_0x8103('0x2a')][_0x8103('0x32')](_0x8103('0x33'))){_0x48064a[_0x8103('0x14')]=qs[_0x8103('0x14')](_0x2e1318['query']['limit']);_0x48064a['offset']=qs[_0x8103('0x12')](_0x2e1318[_0x8103('0x2a')][_0x8103('0x12')]);}_0x48064a[_0x8103('0x34')]=qs['sort'](_0x2e1318[_0x8103('0x2a')][_0x8103('0x35')]);_0x48064a[_0x8103('0x36')]=qs['filters'](_[_0x8103('0x37')](_0x2e1318['query'],_0x5479ae[_0x8103('0x2c')]),_0x4c573f);var _0x1b3552=[];var _0x5462cd=squel[_0x8103('0x38')]()[_0x8103('0x39')]('id')['field'](_0x8103('0x18'))[_0x8103('0x39')](_0x8103('0x3a'))['from']('tools_tags');var _0x3c2989=squel['select']()['field'](_0x8103('0x3b'))[_0x8103('0x39')]('u.fullname')[_0x8103('0x39')]('ui.MailInteractionId')['from'](_0x8103('0x3c'),'ui')[_0x8103('0x3d')](_0x8103('0x3e'),'u',_0x8103('0x3f'));var _0x488f8c=squel['select']()['from'](_0x8103('0x40'),'i')[_0x8103('0x3d')](_0x8103('0x41'),'c',_0x8103('0x42'))[_0x8103('0x3d')](_0x8103('0x3e'),'o','o.id\x20=\x20i.UserId')[_0x8103('0x3d')](_0x8103('0x43'),'a',_0x8103('0x44'))[_0x8103('0x3d')](_0x8103('0x45'),'me',_0x8103('0x46'))[_0x8103('0x3d')]('mail_interaction_has_tags','it',_0x8103('0x47'))['left_join'](_0x8103('0x48'),'t','t.id\x20=\x20it.TagId');var _0x52e0f5=squel[_0x8103('0x49')]();var _0x480e8a=[];var _0x3cb205=squel[_0x8103('0x49')]();var _0x1564a2;if(_0x2e1318['query'][_0x8103('0x4a')]){_0x1564a2=as['parseSearch'](_0x2e1318['query'][_0x8103('0x4a')]);var _0x2be967=_0x1564a2[_0x8103('0x4b')];for(var _0x379989=0x0;_0x379989<_0x1564a2[_0x8103('0x4c')]['length'];_0x379989++){var _0x39b08a=_0x1564a2['conditions'][_0x379989];var _0x293e16='i';var _0x19d942=_[_0x8103('0x4d')](_0x4c573f,['name',_0x39b08a[_0x8103('0x39')]]);if(!_0x19d942){switch(_0x39b08a[_0x8103('0x39')]){case'unreadMessages':if(_0x39b08a[_0x8103('0x4e')]==0x1){_0x488f8c['having']('`'+_0x39b08a[_0x8103('0x39')]+_0x8103('0x4f'));}else{_0x488f8c['having']('`'+_0x39b08a[_0x8103('0x39')]+_0x8103('0x50'));}break;case _0x8103('0x51'):if(_0x39b08a[_0x8103('0x52')]===_0x8103('0x53')){if(_0x39b08a['value'][_0x8103('0x1e')]('\x20')[_0x8103('0x31')]>0x1){_0x52e0f5[_0x2be967](_0x8103('0x54'),qs[_0x8103('0x55')](_0x39b08a[_0x8103('0x4e')]),null);}else{var _0x5bb020='%'+_0x39b08a[_0x8103('0x4e')]+'%';_0x52e0f5[_0x2be967](_0x8103('0x56'),_0x5bb020,_0x5bb020,_0x5bb020);}}else{_0x19d942=_['find'](_0x4c573f,[_0x8103('0x18'),'ContactId']);_0x39b08a[_0x8103('0x39')]=_0x8103('0x57');_0x3adf6c=as['buildExpression'](_0x293e16,_0x19d942[_0x8103('0x58')],_0x39b08a);_0x52e0f5[_0x2be967](_0x3adf6c[_0x8103('0x59')],_0x3adf6c[_0x8103('0x4e')]['start'],_0x3adf6c[_0x8103('0x4e')]['end']);}break;case _0x8103('0x5a'):var _0x21edc0=_0x39b08a[_0x8103('0x4e')][_0x8103('0x1e')](',')[_0x8103('0x1a')](function(_0x353d19){return Number(_0x353d19);});_0x21edc0[_0x8103('0x5b')](function(_0x56fc1b){_0x3cb205['or'](_0x8103('0x5c'),'%,'+_0x56fc1b+',%');});_0x480e8a=_[_0x8103('0x5d')](_0x480e8a,_0x21edc0);break;case _0x8103('0x5e'):if(_0x39b08a[_0x8103('0x52')]===_0x8103('0x53')){_0x52e0f5[_0x2be967](_0x8103('0x5f'),'%'+_0x39b08a[_0x8103('0x4e')]+'%',null);}else{_0x19d942=_['find'](_0x4c573f,[_0x8103('0x18'),'UserId']);_0x39b08a[_0x8103('0x39')]=_0x8103('0x60');_0x3adf6c=as[_0x8103('0x61')](_0x293e16,_0x19d942['type'],_0x39b08a);_0x52e0f5[_0x2be967](_0x3adf6c[_0x8103('0x59')],_0x3adf6c[_0x8103('0x4e')][_0x8103('0x62')],_0x3adf6c[_0x8103('0x4e')][_0x8103('0x63')]);}break;case _0x8103('0x23'):_0x3adf6c=as['buildExpression']('me',null,_0x39b08a);_0x52e0f5[_0x2be967](_0x3adf6c[_0x8103('0x59')],_0x3adf6c['value'][_0x8103('0x62')],_0x3adf6c[_0x8103('0x4e')][_0x8103('0x63')]);break;}}else{var _0x3adf6c=as[_0x8103('0x61')](_0x293e16,_0x19d942[_0x8103('0x58')],_0x39b08a);_0x52e0f5[_0x2be967](_0x3adf6c['text'],_0x3adf6c[_0x8103('0x4e')]['start'],_0x3adf6c[_0x8103('0x4e')][_0x8103('0x63')]);}}}else{var _0x2cb03b=_(_0x2e1318['query'])[_0x8103('0x2b')]()[_0x8103('0x1a')](function(_0x4aab1e){return _['some'](_0x4c573f,[_0x8103('0x18'),_0x4aab1e])?_0x4aab1e:undefined;})[_0x8103('0x64')]()[_0x8103('0x4e')]();if(!_[_0x8103('0x65')](_0x2cb03b)){_0x2cb03b[_0x8103('0x5b')](function(_0x38d33b){if(_0x38d33b===_0x8103('0x66')){_0x488f8c[_0x8103('0x36')]('i.MailAccountId\x20IN\x20?',[][_0x8103('0x67')](_0x2e1318[_0x8103('0x2a')][_0x38d33b]));}else if(_0x38d33b==='createdAt'){var _0x40f1f3=JSON[_0x8103('0x68')](_0x2e1318[_0x8103('0x2a')][_0x38d33b])[_0x8103('0x69')];var _0x20ee66=JSON[_0x8103('0x68')](_0x2e1318[_0x8103('0x2a')][_0x38d33b])[_0x8103('0x6a')];_0x488f8c['where'](_0x8103('0x6b'),_0x40f1f3,_0x20ee66);}else{if(_0x2e1318['query'][_0x38d33b]==='null'){_0x488f8c[_0x8103('0x36')]('i.'+_0x38d33b+_0x8103('0x6c'));}else{_0x488f8c[_0x8103('0x36')]('i.'+_0x38d33b+'\x20=\x20?',_0x2e1318[_0x8103('0x2a')][_0x38d33b]);}}});}if(_0x2e1318[_0x8103('0x2a')][_0x8103('0x6d')]){if(_0x2e1318[_0x8103('0x2a')]['read']==0x1){_0x488f8c[_0x8103('0x6e')](_0x8103('0x6f'));}else{_0x488f8c[_0x8103('0x6e')](_0x8103('0x70'));}}if(_0x2e1318[_0x8103('0x2a')][_0x8103('0x71')]){_0x480e8a=_[_0x8103('0x72')](_0x2e1318[_0x8103('0x2a')][_0x8103('0x71')])?_0x2e1318[_0x8103('0x2a')][_0x8103('0x71')]:new Array(_0x2e1318['query'][_0x8103('0x71')]);_0x480e8a[_0x8103('0x5b')](function(_0x2bf7a0){_0x3cb205['or'](_0x8103('0x5c'),'%,'+_0x2bf7a0+',%');});}if(_0x2e1318['query']['filter']){var _0x43d2e9=_0x2e1318[_0x8103('0x2a')][_0x8103('0x73')][_0x8103('0x74')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x8103('0x75')](_0x43d2e9)){_0x52e0f5['or']('i.id\x20LIKE\x20?',_0x43d2e9+'%');}else if(qs[_0x8103('0x76')](_0x43d2e9)){_0x52e0f5['or'](_0x8103('0x77'),_0x43d2e9+'%');}else{_0x52e0f5['or'](_0x8103('0x78'),qs[_0x8103('0x55')](_0x43d2e9))['or'](_0x8103('0x79'),qs[_0x8103('0x55')](_0x43d2e9));}}}_0x488f8c[_0x8103('0x36')](_0x52e0f5);_0x488f8c[_0x8103('0x7a')]('i.id');var _0x2f5e6f={'type':db[_0x8103('0x7b')][_0x8103('0x7c')]['SELECT'],'raw':!![]};var _0x72827a=_0x488f8c['clone']();_0x72827a[_0x8103('0x39')](_0x8103('0x7d'));_0x72827a[_0x8103('0x39')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x8103('0x7e'));if(_0x48064a[_0x8103('0x34')]){_0x48064a['order'][_0x8103('0x5b')](function(_0x2a90a7){var _0x551180=_0x2a90a7[0x0]===_0x8103('0x7f')?_0x2a90a7[0x0]:'i.'+_0x2a90a7[0x0];_0x488f8c[_0x8103('0x34')](_0x551180,_0x2a90a7[0x1]===_0x8103('0x80')?![]:!![]);});}if(!_[_0x8103('0x65')](_0x480e8a)){_0x488f8c['having'](_0x3cb205);_0x72827a[_0x8103('0x36')](_0x8103('0x81'),_0x480e8a);}BPromise[_0x8103('0x82')]()[_0x8103('0x16')](function(){if(!_0x1564a2){if(_0x2e1318['query'][_0x8103('0x66')])return;_0x72827a[_0x8103('0x36')](_0x8103('0x83'));_0x488f8c[_0x8103('0x36')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x2e1318[_0x8103('0x84')]['role']!==_0x8103('0x85'))return;return _0x2e1318[_0x8103('0x84')][_0x8103('0x86')]({'attributes':['id'],'raw':!![]})[_0x8103('0x16')](function(_0x5d1bf0){if(_[_0x8103('0x65')](_0x5d1bf0)){_0x72827a[_0x8103('0x36')](_0x8103('0x87'));_0x488f8c[_0x8103('0x36')](_0x8103('0x87'));}else{_0x72827a['where'](_0x8103('0x88'),_[_0x8103('0x1a')](_0x5d1bf0,'id'));_0x488f8c[_0x8103('0x36')]('i.MailAccountId\x20IN\x20?',_[_0x8103('0x1a')](_0x5d1bf0,'id'));}});})[_0x8103('0x16')](function(){if(_0x2e1318['user']['role']===_0x8103('0x85')&&!_0x1564a2&&!_0x2e1318[_0x8103('0x2a')][_0x8103('0x66')])return[];return db['sequelize'][_0x8103('0x2a')](_0x72827a[_0x8103('0x89')](),_0x2f5e6f);})[_0x8103('0x16')](function(_0x454227){_0x329c6f[_0x8103('0x8a')]=_0x454227[_0x8103('0x31')];if(_0x329c6f[_0x8103('0x8a')]===0x0)return[];return db['sequelize']['query'](_0x5462cd['toString'](),_0x2f5e6f)[_0x8103('0x16')](function(_0x576c5a){_0x1b3552=_[_0x8103('0x8b')](_0x576c5a,'id');_0x2f5e6f=_['merge'](_0x2f5e6f,{'model':db[_0x8103('0x27')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2e1318[_0x8103('0x2a')][_0x8103('0x2f')]){_0x48064a[_0x8103('0x30')][_0x8103('0x5b')](function(_0x244a54){_0x488f8c[_0x8103('0x39')]('i.'+_0x244a54);});}else{_0x488f8c[_0x8103('0x39')](_0x8103('0x8c'),_0x8103('0x7e'));_0x488f8c[_0x8103('0x39')](_0x8103('0x8d'),_0x8103('0x8e'));_0x488f8c['field']('a.mandatoryDisposition',_0x8103('0x8f'));_0x488f8c['field'](_0x8103('0x90'),_0x8103('0x7f'));_0x488f8c['field']('i.id');_0x488f8c[_0x8103('0x39')](_0x8103('0x91'));_0x488f8c['field'](_0x8103('0x92'));_0x488f8c[_0x8103('0x39')](_0x8103('0x93'));_0x488f8c['field'](_0x8103('0x94'));_0x488f8c[_0x8103('0x39')](_0x8103('0x95'));_0x488f8c[_0x8103('0x39')](_0x8103('0x96'));_0x488f8c['field'](_0x8103('0x97'));_0x488f8c[_0x8103('0x39')]('i.subject');_0x488f8c['field']('i.disposition');_0x488f8c['field'](_0x8103('0x98'));_0x488f8c[_0x8103('0x39')](_0x8103('0x99'));_0x488f8c[_0x8103('0x39')](_0x8103('0x9a'));_0x488f8c[_0x8103('0x39')](_0x8103('0x9b'));_0x488f8c[_0x8103('0x39')](_0x8103('0x9c'));_0x488f8c[_0x8103('0x39')](_0x8103('0x9d'));_0x488f8c[_0x8103('0x39')](_0x8103('0x9e'));_0x488f8c[_0x8103('0x39')](_0x8103('0x9f'),_0x8103('0xa0'));_0x488f8c[_0x8103('0x39')](_0x8103('0xa1'),_0x8103('0xa2'));_0x488f8c[_0x8103('0x39')]('c.email',_0x8103('0xa3'));_0x488f8c[_0x8103('0x39')]('c.phone',_0x8103('0xa4'));_0x488f8c[_0x8103('0x39')]('c.mobile',_0x8103('0xa5'));_0x488f8c[_0x8103('0x39')](_0x8103('0xa6'),_0x8103('0xa7'));_0x488f8c[_0x8103('0x39')]('o.fullname','Owner.fullname');_0x488f8c[_0x8103('0x39')](_0x8103('0xa8'),_0x8103('0xa9'));_0x488f8c['field'](_0x8103('0xaa'),_0x8103('0x1c'));}if(_0x48064a[_0x8103('0x14')])_0x488f8c['limit'](_0x48064a[_0x8103('0x14')]);if(_0x48064a[_0x8103('0x12')])_0x488f8c[_0x8103('0x12')](_0x48064a[_0x8103('0x12')]);return db[_0x8103('0xab')]['query'](_0x488f8c[_0x8103('0x89')](),_0x2f5e6f);})[_0x8103('0x16')](function(_0x4deda0){if(_0x4deda0[_0x8103('0x31')]>0x0)_0x3c2989[_0x8103('0x36')](_0x8103('0xac'),_[_0x8103('0x1a')](_0x4deda0,'id'));return db[_0x8103('0xab')][_0x8103('0x2a')](_0x3c2989[_0x8103('0x89')](),_0x2f5e6f)[_0x8103('0x16')](function(_0x4b72f9){var _0x3f10de=_[_0x8103('0xad')](_0x4b72f9,_0x8103('0xae'));var _0x1478dc=[];return db[_0x8103('0xaf')][_0x8103('0x21')]({'attributes':[_0x8103('0xb0')],'raw':!![]})[_0x8103('0x16')](function(_0x4175b3){var _0x221b2a=_0x4175b3[_0x8103('0xb0')];_0x4deda0[_0x8103('0x5b')](function(_0x26afee){_0x1478dc[_0x8103('0x1f')](updateMailInteraction(_0x26afee,_0x1b3552,_0x3f10de,_0x221b2a));});return BPromise[_0x8103('0xb1')](_0x1478dc);});});});})[_0x8103('0x16')](function(_0xf59cd7){_0x329c6f[_0x8103('0xb2')]=_0xf59cd7;return _0x329c6f;})[_0x8103('0x16')](respondWithFilteredResult(_0x285ecd,_0x48064a))[_0x8103('0x26')](handleError(_0x285ecd,null));};exports[_0x8103('0xb3')]=function(_0x47b623,_0x2f024a){var _0x2143ff={'raw':![],'where':{'id':_0x47b623['params']['id']}},_0x5e5960={};_0x5e5960[_0x8103('0x2e')]=_[_0x8103('0x2b')](db['MailInteraction'][_0x8103('0xb4')]);_0x5e5960['query']=_[_0x8103('0x2b')](_0x47b623[_0x8103('0x2a')]);_0x5e5960[_0x8103('0x2c')]=_[_0x8103('0x2d')](_0x5e5960[_0x8103('0x2e')],_0x5e5960[_0x8103('0x2a')]);_0x2143ff[_0x8103('0x30')]=_[_0x8103('0x2d')](_0x5e5960[_0x8103('0x2e')],qs[_0x8103('0x2f')](_0x47b623[_0x8103('0x2a')][_0x8103('0x2f')]));_0x2143ff[_0x8103('0x30')]=_0x2143ff[_0x8103('0x30')][_0x8103('0x31')]?_0x2143ff['attributes']:_0x5e5960[_0x8103('0x2e')];if(_0x47b623[_0x8103('0x2a')]['includeAll']){_0x2143ff[_0x8103('0xb5')]=[{'all':!![]}];}_0x2143ff=_[_0x8103('0xb6')]({},_0x2143ff,_0x47b623[_0x8103('0xb7')]);return db[_0x8103('0x27')][_0x8103('0x4d')](_0x2143ff)['then'](handleEntityNotFound(_0x2f024a,null))[_0x8103('0x16')](respondWithResult(_0x2f024a,null))[_0x8103('0x26')](handleError(_0x2f024a,null));};exports['create']=function(_0x448575,_0x42f6ee){return db[_0x8103('0x27')][_0x8103('0xb8')](_0x448575[_0x8103('0xb9')],{})['then'](respondWithResult(_0x42f6ee,0xc9))[_0x8103('0x26')](handleError(_0x42f6ee,null));};exports['update']=function(_0x51a750,_0x57f9a7){if(_0x51a750[_0x8103('0xb9')]['id']){delete _0x51a750[_0x8103('0xb9')]['id'];}return db[_0x8103('0x27')][_0x8103('0x4d')]({'where':{'id':_0x51a750['params']['id']}})[_0x8103('0x16')](handleEntityNotFound(_0x57f9a7,null))['then'](saveUpdates(_0x51a750[_0x8103('0xb9')],null))['then'](respondWithResult(_0x57f9a7,null))[_0x8103('0x26')](handleError(_0x57f9a7,null));};exports[_0x8103('0xba')]=function(_0x528001,_0x501b32){return db[_0x8103('0x27')][_0x8103('0x4d')]({'where':{'id':_0x528001[_0x8103('0xbb')]['id']}})[_0x8103('0x16')](handleEntityNotFound(_0x501b32,null))['then'](removeEntity(_0x501b32,null))['catch'](handleError(_0x501b32,null));};exports[_0x8103('0xbc')]=function(_0x3131ef,_0x39ef14){return db['MailInteraction'][_0x8103('0xbc')]()[_0x8103('0x16')](respondWithResult(_0x39ef14,null))[_0x8103('0x26')](handleError(_0x39ef14,null));};exports[_0x8103('0xbd')]=function(_0x244d46,_0x34d74d){return db[_0x8103('0x20')][_0x8103('0x4d')]({'where':{'id':_0x244d46[_0x8103('0xbb')]['id']}})[_0x8103('0x16')](handleEntityNotFound(_0x34d74d,null))[_0x8103('0x16')](function(_0x1d7317){if(_0x1d7317){return _0x1d7317[_0x8103('0xbd')](_0x244d46[_0x8103('0xb9')]['ids'],_['omit'](_0x244d46['body'],[_0x8103('0xbe'),'id'])||{});}})[_0x8103('0x16')](respondWithResult(_0x34d74d,null))[_0x8103('0x26')](handleError(_0x34d74d,null));};exports[_0x8103('0xbf')]=function(_0xd25df2,_0x57034e){var _0x98d4d8={'raw':![],'where':{}};var _0x265ec4={};var _0x3083a7={'count':0x0,'rows':[]};return db[_0x8103('0x27')][_0x8103('0x21')]({'where':{'id':_0xd25df2[_0x8103('0xbb')]['id']}})[_0x8103('0x16')](handleEntityNotFound(_0x57034e,null))[_0x8103('0x16')](function(_0x1f138a){if(_0x1f138a){_0x265ec4[_0x8103('0x2e')]=_[_0x8103('0x2b')](db[_0x8103('0x20')][_0x8103('0xb4')]);_0x265ec4[_0x8103('0x2a')]=_[_0x8103('0x2b')](_0xd25df2[_0x8103('0x2a')]);_0x265ec4['filters']=_[_0x8103('0x2d')](_0x265ec4[_0x8103('0x2e')],_0x265ec4[_0x8103('0x2a')]);_0x98d4d8[_0x8103('0x30')]=_[_0x8103('0x2d')](_0x265ec4[_0x8103('0x2e')],qs[_0x8103('0x2f')](_0xd25df2[_0x8103('0x2a')][_0x8103('0x2f')]));_0x98d4d8[_0x8103('0x30')]=_0x98d4d8[_0x8103('0x30')][_0x8103('0x31')]?_0x98d4d8[_0x8103('0x30')]:_0x265ec4[_0x8103('0x2e')];if(!_0xd25df2['query'][_0x8103('0x32')]('nolimit')){_0x98d4d8[_0x8103('0x14')]=qs[_0x8103('0x14')](_0xd25df2[_0x8103('0x2a')]['limit']);_0x98d4d8[_0x8103('0x12')]=qs[_0x8103('0x12')](_0xd25df2[_0x8103('0x2a')][_0x8103('0x12')]);}_0x98d4d8['order']=qs[_0x8103('0x35')](_0xd25df2['query']['sort']);_0x98d4d8['where']=qs[_0x8103('0x2c')](_['pick'](_0xd25df2[_0x8103('0x2a')],_0x265ec4[_0x8103('0x2c')]));_0x98d4d8[_0x8103('0x36')][_0x8103('0xae')]=_0x1f138a['id'];if(_0xd25df2[_0x8103('0x2a')]['filter']){_0x98d4d8[_0x8103('0x36')]=_[_0x8103('0xb6')](_0x98d4d8[_0x8103('0x36')],{'$or':_[_0x8103('0x1a')](_0x98d4d8[_0x8103('0x30')],function(_0x18ae55){var _0x3ff2fb={};_0x3ff2fb[_0x18ae55]={'$like':'%'+_0xd25df2[_0x8103('0x2a')][_0x8103('0x73')]+'%'};return _0x3ff2fb;})});}if(_0xd25df2[_0x8103('0x2a')][_0x8103('0x69')]){var _0x59e247=_0xd25df2[_0x8103('0x2a')][_0x8103('0x69')][_0x8103('0x1e')](',');var _0x5f28ee={};_0x5f28ee[_0x59e247[0x0]]={'$gte':moment(_0x59e247[0x1])['format'](_0x8103('0xc0'))};_0x98d4d8[_0x8103('0x36')]=_[_0x8103('0xb6')](_0x98d4d8[_0x8103('0x36')],_0x5f28ee);}_0x98d4d8=_[_0x8103('0xb6')]({},_0x98d4d8,_0xd25df2[_0x8103('0xb7')]);return db[_0x8103('0x20')][_0x8103('0x8a')]({'where':_0x98d4d8['where']})[_0x8103('0x16')](function(_0x2bc691){_0x3083a7[_0x8103('0x8a')]=_0x2bc691;if(_0xd25df2[_0x8103('0x2a')][_0x8103('0xc1')]){_0x98d4d8[_0x8103('0xb5')]=[{'all':!![]}];}return db[_0x8103('0x20')][_0x8103('0xc2')](_0x98d4d8);})[_0x8103('0x16')](function(_0x44b782){if(_0xd25df2[_0x8103('0x2a')]['inlineCss']==='true'){for(var _0x5f3a3f=0x0;_0x5f3a3f<_0x44b782[_0x8103('0x31')];_0x5f3a3f++){_0x44b782[_0x5f3a3f][_0x8103('0xb9')]=juice(_0x44b782[_0x5f3a3f]['body']);}}_0x3083a7[_0x8103('0xb2')]=_0x44b782;return _0x3083a7;});}})['then'](respondWithFilteredResult(_0x57034e,_0x98d4d8))['catch'](handleError(_0x57034e,null));};exports[_0x8103('0xc3')]=function(_0x4fc651,_0x3b5304){return db[_0x8103('0x27')][_0x8103('0x4d')]({'where':{'id':_0x4fc651['params']['id']}})[_0x8103('0x16')](handleEntityNotFound(_0x3b5304,null))['then'](function(_0x20b6b5){if(_0x20b6b5){return _0x20b6b5['setTags'](_0x4fc651['body'][_0x8103('0xbe')],_['omit'](_0x4fc651[_0x8103('0xb9')],[_0x8103('0xbe'),'id'])||{})[_0x8103('0xc4')](function(){return db['Tag'][_0x8103('0xc2')]({'attributes':['id',_0x8103('0x18'),_0x8103('0x3a')],'where':{'id':_0x4fc651[_0x8103('0xb9')][_0x8103('0xbe')]}});})[_0x8103('0x16')](function(_0x319b1a){socket[_0x8103('0xc5')]('mailInteractionTags:save',{'id':Number(_0x4fc651[_0x8103('0xbb')]['id']),'tags':_0x319b1a||[]});return{'id':Number(_0x4fc651[_0x8103('0xbb')]['id']),'tags':_0x319b1a||[]};});}})[_0x8103('0x16')](respondWithResult(_0x3b5304,null))[_0x8103('0x26')](handleError(_0x3b5304,null));};exports[_0x8103('0xc6')]=function(_0x263d38,_0xed8d33){return db[_0x8103('0x27')][_0x8103('0x4d')]({'where':{'id':_0x263d38[_0x8103('0xbb')]['id']}})[_0x8103('0x16')](handleEntityNotFound(_0xed8d33,null))[_0x8103('0x16')](function(_0x163536){if(_0x163536){return _0x163536['removeTags'](_0x263d38[_0x8103('0x2a')][_0x8103('0xbe')]);}})['then'](respondWithStatusCode(_0xed8d33,null))['catch'](handleError(_0xed8d33,null));};exports[_0x8103('0xc7')]=function(_0xeb9b0f,_0x54df46){var _0x5cd2b3=moment()[_0x8103('0xc8')]()[_0x8103('0x89')]();var _0x6d5950=path['join'](config['root'],_0x8103('0xc9'),_0x8103('0xca'),_0x8103('0xcb'));var _0x26933f=path['join'](config[_0x8103('0xcc')],_0x8103('0xc9'),'files',_0x8103('0xcd'));var _0xf6a9bf=path[_0x8103('0xce')](_0x6d5950,_0x5cd2b3);var _0x5d8799=util['format'](_0x8103('0xcf'),_0xeb9b0f[_0x8103('0xbb')]['id'],_0x5cd2b3);var _0x48c5df=path[_0x8103('0xce')](_0x6d5950,_0x5d8799);var _0x30d06b=[];if(_0xeb9b0f[_0x8103('0x2a')][_0x8103('0xcd')]){_0x30d06b[_0x8103('0x1f')]({'model':db[_0x8103('0xd0')],'as':_0x8103('0xd1'),'raw':!![]});}var _0x4b43ea=[{'model':db[_0x8103('0x20')],'as':_0x8103('0xd2'),'attributes':['id',_0x8103('0xb9'),_0x8103('0xd3'),'to','cc',_0x8103('0xd4'),'subject',_0x8103('0xd5')],'where':{'secret':![]},'order':qs[_0x8103('0x35')]('id'),'include':_0x30d06b}];return db['MailInteraction'][_0x8103('0x4d')]({'where':{'id':_0xeb9b0f[_0x8103('0xbb')]['id']},'include':_0x4b43ea})['then'](handleEntityNotFound(_0x54df46,null))[_0x8103('0x16')](function(_0x11a036){if(_0x11a036&&_0x11a036['Messages']){var _0x19222a=_0x11a036[_0x8103('0xd6')]({'plain':!![]});fs[_0x8103('0xd7')](_0xf6a9bf);return BPromise[_0x8103('0xd8')](_0x19222a[_0x8103('0xd2')],function(_0xfd76e8,_0x532043){var _0x4f7307={'from':_0xfd76e8[_0x8103('0xd3')],'to':_0xfd76e8['to'],'subject':_0xfd76e8['subject'],'html':htmlEntities[_0x8103('0xd9')](_0xfd76e8['body']),'headers':{'Date':moment(_0xfd76e8['createdAt'])[_0x8103('0xda')](_0x8103('0xdb'))},'attachments':[]};if(_0xfd76e8['cc']){_0x4f7307[_0x8103('0xdc')]['Cc']=_0xfd76e8['cc'];}if(_0xfd76e8[_0x8103('0xd4')]){_0x4f7307[_0x8103('0xdc')][_0x8103('0xdd')]=_0xfd76e8['bcc'];}return new BPromise(function(_0x47915c,_0x48c5a5){if(_0xfd76e8[_0x8103('0xd1')]){for(var _0x3cbcdf=0x0;_0x3cbcdf<_0xfd76e8[_0x8103('0xd1')][_0x8103('0x31')];_0x3cbcdf++){var _0x3236d9=_0xfd76e8[_0x8103('0xd1')][_0x3cbcdf];var _0x3ea09d=path[_0x8103('0xce')](_0x26933f,_0x3236d9['basename']);if(fs[_0x8103('0xde')](_0x3ea09d)){_0x4f7307[_0x8103('0xcd')][_0x8103('0x1f')]({'name':_0x3236d9[_0x8103('0x18')],'contentType':_0x3236d9[_0x8103('0x58')],'data':fs['readFileSync'](_0x3ea09d)});}}}emlformat[_0x8103('0xdf')](_0x4f7307,function(_0x5f56d3,_0x3836b7){if(_0x5f56d3)return _0x48c5a5(_0x5f56d3);fs['writeFileSync'](path['join'](_0xf6a9bf,util['format'](_0x8103('0xe0'),_0x532043)),_0x3836b7);return _0x47915c(_0x3836b7);});});})[_0x8103('0x16')](function(){return new BPromise(function(_0x4c5e17,_0x12d09d){zipdir(_0xf6a9bf,{'saveTo':_0x48c5df},function(_0x1302f0,_0x5b78ee){if(_0x1302f0)return _0x12d09d(_0x1302f0);return _0x4c5e17(_0x5b78ee);});})[_0x8103('0x16')](function(){return new BPromise(function(_0x31735a,_0x4328ca){rimraf(_0xf6a9bf,function(_0x5976bb){if(_0x5976bb)_0x4328ca(_0x5976bb);return _0x31735a();});});})[_0x8103('0x16')](function(){return _0x54df46['download'](_0x48c5df,_0x5d8799,function(_0xa00b3b){if(!_0xa00b3b)fs[_0x8103('0xe1')](_0x48c5df);});});});}else{return _0x54df46[_0x8103('0xe2')](0xc8);}})[_0x8103('0x26')](handleError(_0x54df46,null));};
\ No newline at end of file
index 62a4577..c4a1303 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22b3=['MailMessage','setMaxListeners','save','remove','then','Users','findAll','setDataValue','unreadMessages','emit','catch','hook','exports','events','../../mysqldb','MailInteraction'];(function(_0x44aa85,_0x49d95e){var _0x9447e1=function(_0x7e0959){while(--_0x7e0959){_0x44aa85['push'](_0x44aa85['shift']());}};_0x9447e1(++_0x49d95e);}(_0x22b3,0x1cd));var _0x322b=function(_0x2c69c2,_0x1c0226){_0x2c69c2=_0x2c69c2-0x0;var _0x189018=_0x22b3[_0x2c69c2];return _0x189018;};'use strict';var EventEmitter=require(_0x322b('0x0'));var MailInteraction=require(_0x322b('0x1'))['db'][_0x322b('0x2')];var MailMessage=require(_0x322b('0x1'))['db'][_0x322b('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x322b('0x4')](0x0);var events={'afterCreate':_0x322b('0x5'),'afterUpdate':'update','afterDestroy':_0x322b('0x6')};function emitEvent(_0x56d261){return function(_0x324eb9,_0xe00e0f,_0x375132){_0x324eb9['getUsers']({'attributes':['id'],'raw':!![]})[_0x322b('0x7')](function(_0xa6cabf){_0x324eb9['setDataValue'](_0x322b('0x8'),_0xa6cabf['map'](function(_0x5b6088){return{'id':_0x5b6088['id']};}));return MailMessage[_0x322b('0x9')]({'where':{'MailInteractionId':_0x324eb9['id'],'direction':'in','read':![]},'raw':!![]});})[_0x322b('0x7')](function(_0x8a08a0){_0x324eb9[_0x322b('0xa')](_0x322b('0xb'),_0x8a08a0['length']);MailInteractionEvents[_0x322b('0xc')](_0x56d261+':'+_0x324eb9['id'],_0x324eb9);MailInteractionEvents[_0x322b('0xc')](_0x56d261,_0x324eb9);_0x375132(null);})[_0x322b('0xd')](_0x375132(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x322b('0xe')](e,emitEvent(event));}}module[_0x322b('0xf')]=MailInteractionEvents;
\ No newline at end of file
+var _0xb085=['catch','hook','events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb085,0x9b));var _0x5b08=function(_0x3dd6b1,_0x93c89){_0x3dd6b1=_0x3dd6b1-0x0;var _0x34b485=_0xb085[_0x3dd6b1];return _0x34b485;};'use strict';var EventEmitter=require(_0x5b08('0x0'));var MailInteraction=require(_0x5b08('0x1'))['db']['MailInteraction'];var MailMessage=require(_0x5b08('0x1'))['db'][_0x5b08('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x5b08('0x3')](0x0);var events={'afterCreate':_0x5b08('0x4'),'afterUpdate':_0x5b08('0x5'),'afterDestroy':_0x5b08('0x6')};function emitEvent(_0x1b3990){return function(_0x33b71d,_0xc17894,_0x4ebf0e){_0x33b71d[_0x5b08('0x7')]({'attributes':['id'],'raw':!![]})[_0x5b08('0x8')](function(_0x2e98b3){_0x33b71d[_0x5b08('0x9')](_0x5b08('0xa'),_0x2e98b3[_0x5b08('0xb')](function(_0x935aee){return{'id':_0x935aee['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x33b71d['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x32a7f0){_0x33b71d[_0x5b08('0x9')](_0x5b08('0xc'),_0x32a7f0[_0x5b08('0xd')]);MailInteractionEvents[_0x5b08('0xe')](_0x1b3990+':'+_0x33b71d['id'],_0x33b71d);MailInteractionEvents[_0x5b08('0xe')](_0x1b3990,_0x33b71d);_0x4ebf0e(null);})[_0x5b08('0xf')](_0x4ebf0e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x5b08('0x10')](e,emitEvent(event));}}module['exports']=MailInteractionEvents;
\ No newline at end of file
index 9115066..190370d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1de9=['closedAt','changed','closed','models','MailMessage','update','then','catch','utf8mb4','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','MailInteraction','mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1de9,0x1d4));var _0x91de=function(_0xaba8c1,_0x3c6ad7){_0xaba8c1=_0xaba8c1-0x0;var _0x3cbe20=_0x1de9[_0xaba8c1];return _0x3cbe20;};'use strict';var _=require(_0x91de('0x0'));var util=require('util');var logger=require(_0x91de('0x1'))(_0x91de('0x2'));var moment=require(_0x91de('0x3'));var BPromise=require(_0x91de('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91de('0x5'));var rimraf=require(_0x91de('0x6'));var config=require(_0x91de('0x7'));var attributes=require(_0x91de('0x8'));module[_0x91de('0x9')]=function(_0x4a9be4,_0x538a27){return _0x4a9be4['define'](_0x91de('0xa'),attributes,{'tableName':_0x91de('0xb'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x91de('0xc'),'to'],'type':_0x91de('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x8eac8b,_0x462952,_0x2b49fe){if(_0x8eac8b[_0x91de('0xe')]){_0x8eac8b[_0x91de('0xf')]=moment()[_0x91de('0x10')](_0x91de('0x11'));}if(_0x8eac8b['closed']){_0x8eac8b[_0x91de('0x12')]=moment()[_0x91de('0x10')](_0x91de('0x11'));}_0x2b49fe(null,_0x462952);},'beforeUpdate':function(_0x14c493,_0x364243,_0x540dcf){if(_0x14c493[_0x91de('0x13')](_0x91de('0xe'))){_0x14c493[_0x91de('0xf')]=_0x14c493[_0x91de('0xe')]?moment()[_0x91de('0x10')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x14c493['changed'](_0x91de('0x14'))){_0x14c493[_0x91de('0x12')]=moment()[_0x91de('0x10')](_0x91de('0x11'));_0x14c493[_0x91de('0xe')]=null;_0x14c493[_0x91de('0xf')]=null;}_0x540dcf(null,_0x14c493);},'afterUpdate':function(_0x3b1275,_0x14775d,_0x2d314f){var _0x591f93=_0x4a9be4[_0x91de('0x15')];var _0x43c044=_0x3b1275['get']({'plain':!![]});if(_0x43c044[_0x91de('0x14')]){return _0x591f93[_0x91de('0x16')][_0x91de('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x43c044['id']}})[_0x91de('0x18')](function(){_0x2d314f();})[_0x91de('0x19')](function(_0x51147d){_0x2d314f(_0x51147d);});}else{_0x2d314f();}}},'charset':_0x91de('0x1a'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x4261=['subject','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','format','models','get','MailMessage','update','then','catch','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','mail_interactions','fti_mail_interactions'];(function(_0x5ab633,_0x27e5a5){var _0x429b88=function(_0x4d8144){while(--_0x4d8144){_0x5ab633['push'](_0x5ab633['shift']());}};_0x429b88(++_0x27e5a5);}(_0x4261,0x16d));var _0x1426=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x4261[_0x28947d];return _0x12d2ee;};'use strict';var _=require('lodash');var util=require(_0x1426('0x0'));var logger=require(_0x1426('0x1'))(_0x1426('0x2'));var moment=require(_0x1426('0x3'));var BPromise=require(_0x1426('0x4'));var rp=require(_0x1426('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1426('0x6'));var config=require(_0x1426('0x7'));var attributes=require('./mailInteraction.attributes');module['exports']=function(_0x1b4cdc,_0x5701d8){return _0x1b4cdc['define']('MailInteraction',attributes,{'tableName':_0x1426('0x8'),'paranoid':![],'indexes':[{'name':_0x1426('0x9'),'fields':[_0x1426('0xa'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3a63fd,_0x265de9,_0x1d28de){if(_0x3a63fd[_0x1426('0xb')]){_0x3a63fd[_0x1426('0xc')]=moment()['format'](_0x1426('0xd'));}if(_0x3a63fd[_0x1426('0xe')]){_0x3a63fd[_0x1426('0xf')]=moment()['format'](_0x1426('0xd'));}_0x1d28de(null,_0x265de9);},'beforeUpdate':function(_0x50afaa,_0x1475b4,_0x6b6e27){if(_0x50afaa[_0x1426('0x10')](_0x1426('0xb'))){_0x50afaa[_0x1426('0xc')]=_0x50afaa['substatus']?moment()[_0x1426('0x11')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x50afaa[_0x1426('0x10')]('closed')){_0x50afaa[_0x1426('0xf')]=moment()[_0x1426('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x50afaa['substatus']=null;_0x50afaa[_0x1426('0xc')]=null;}_0x6b6e27(null,_0x50afaa);},'afterUpdate':function(_0x230946,_0x15502a,_0xbb33c4){var _0x3c2a66=_0x1b4cdc[_0x1426('0x12')];var _0x3644ff=_0x230946[_0x1426('0x13')]({'plain':!![]});if(_0x3644ff[_0x1426('0xe')]){return _0x3c2a66[_0x1426('0x14')][_0x1426('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x3644ff['id']}})[_0x1426('0x16')](function(){_0xbb33c4();})[_0x1426('0x17')](function(_0x273a03){_0xbb33c4(_0x273a03);});}else{_0xbb33c4();}}},'charset':'utf8mb4','collate':_0x1426('0x18')});};
\ No newline at end of file
index 679893b..424c861 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd38e=['update','options','raw','attributes','limit','find','addTags','body','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','debug','stringify','error','message','MailInteraction,\x20%s,\x20%s','request\x20sent','result','catch','UpdateMailInteraction','MailInteraction'];(function(_0x6c1e7e,_0x2fa894){var _0xb3ca54=function(_0x57735c){while(--_0x57735c){_0x6c1e7e['push'](_0x6c1e7e['shift']());}};_0xb3ca54(++_0x2fa894);}(_0xd38e,0x17d));var _0xed38=function(_0x35418c,_0x3c284e){_0x35418c=_0x35418c-0x0;var _0x2fcf61=_0xd38e[_0x35418c];return _0x2fcf61;};'use strict';var _=require(_0xed38('0x0'));var util=require('util');var moment=require(_0xed38('0x1'));var BPromise=require(_0xed38('0x2'));var rs=require(_0xed38('0x3'));var fs=require('fs');var Redis=require(_0xed38('0x4'));var db=require(_0xed38('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xed38('0x6'))(_0xed38('0x7'));var config=require(_0xed38('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xed38('0x9')][_0xed38('0xa')]({'port':0x232a});config[_0xed38('0xb')]=_['defaults'](config[_0xed38('0xb')],{'host':_0xed38('0xc'),'port':0x18eb});var socket=require(_0xed38('0xd'))(new Redis(config['redis']));require(_0xed38('0xe'))[_0xed38('0xf')](socket);function respondWithRpcPromise(_0x4773e0,_0x39edca,_0x5f2844){return new BPromise(function(_0x31661c,_0xaafa55){return client[_0xed38('0x10')](_0x4773e0,_0x5f2844)[_0xed38('0x11')](function(_0x1a7d01){logger[_0xed38('0x12')]('MailInteraction,\x20%s,\x20%s',_0x39edca,'request\x20sent');logger[_0xed38('0x13')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x39edca,'request\x20sent',JSON[_0xed38('0x14')](_0x1a7d01));if(_0x1a7d01[_0xed38('0x15')]){if(_0x1a7d01[_0xed38('0x15')]['code']===0x1f4){logger['error']('MailInteraction,\x20%s,\x20%s',_0x39edca,_0x1a7d01['error']['message']);return _0xaafa55(_0x1a7d01[_0xed38('0x15')][_0xed38('0x16')]);}logger[_0xed38('0x15')](_0xed38('0x17'),_0x39edca,_0x1a7d01[_0xed38('0x15')][_0xed38('0x16')]);return _0x31661c(_0x1a7d01['error'][_0xed38('0x16')]);}else{logger['info'](_0xed38('0x17'),_0x39edca,_0xed38('0x18'));_0x31661c(_0x1a7d01[_0xed38('0x19')][_0xed38('0x16')]);}})[_0xed38('0x1a')](function(_0x57b7c9){logger[_0xed38('0x15')](_0xed38('0x17'),_0x39edca,_0x57b7c9);_0xaafa55(_0x57b7c9);});});}exports[_0xed38('0x1b')]=function(_0x13b0ab){var _0x3d6e67=this;return new Promise(function(_0x252224,_0x278bc3){return db[_0xed38('0x1c')][_0xed38('0x1d')](_0x13b0ab['body'],{'raw':_0x13b0ab[_0xed38('0x1e')]?_0x13b0ab[_0xed38('0x1e')][_0xed38('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13b0ab[_0xed38('0x1e')]?_0x13b0ab[_0xed38('0x1e')]['where']||null:null,'attributes':_0x13b0ab[_0xed38('0x1e')]?_0x13b0ab['options'][_0xed38('0x20')]||null:null,'limit':_0x13b0ab['options']?_0x13b0ab['options'][_0xed38('0x21')]||null:null})[_0xed38('0x11')](function(_0x20a274){logger[_0xed38('0x12')]('UpdateMailInteraction',_0x13b0ab);logger[_0xed38('0x13')](_0xed38('0x1b'),_0x13b0ab,JSON[_0xed38('0x14')](_0x20a274));_0x252224(_0x20a274);})[_0xed38('0x1a')](function(_0x5c05fa){logger['error']('UpdateMailInteraction',_0x5c05fa[_0xed38('0x16')],_0x13b0ab);_0x278bc3(_0x3d6e67[_0xed38('0x15')](0x1f4,_0x5c05fa[_0xed38('0x16')]));});});};exports['AddTagsToMailInteraction']=function(_0x426601){return new Promise(function(_0x3e874e,_0x3b141c){return db[_0xed38('0x1c')][_0xed38('0x22')]({'where':_0x426601[_0xed38('0x1e')]?_0x426601[_0xed38('0x1e')]['where']||null:null})[_0xed38('0x11')](function(_0x5c5094){if(_0x5c5094){return _0x5c5094[_0xed38('0x23')](_0x426601[_0xed38('0x24')][_0xed38('0x25')],_[_0xed38('0x26')](_0x426601[_0xed38('0x24')],[_0xed38('0x25'),'id'])||{});}})[_0xed38('0x27')](function(_0xa00407){logger[_0xed38('0x12')](_0xed38('0x28'),_0x426601);logger[_0xed38('0x13')](_0xed38('0x28'),_0x426601,JSON['stringify'](_0xa00407));_0x3e874e(_0xa00407);})['catch'](function(_0x36fd74){logger[_0xed38('0x15')](_0xed38('0x28'),_0x36fd74[_0xed38('0x16')],_0x426601);_0x3b141c(_this[_0xed38('0x15')](0x1f4,_0x36fd74[_0xed38('0x16')]));});});};
\ No newline at end of file
+var _0x51a8=['where','attributes','limit','UpdateMailInteraction','stringify','AddTagsToMailInteraction','find','addTags','omit','ids','spread','AddTags','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','./mailInteraction.socket','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','MailInteraction','update','body','options'];(function(_0x28ab95,_0x5e5670){var _0x369b86=function(_0x2e76a4){while(--_0x2e76a4){_0x28ab95['push'](_0x28ab95['shift']());}};_0x369b86(++_0x5e5670);}(_0x51a8,0x186));var _0x851a=function(_0x26eb2a,_0x5293d9){_0x26eb2a=_0x26eb2a-0x0;var _0x14eed3=_0x51a8[_0x26eb2a];return _0x14eed3;};'use strict';var _=require(_0x851a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x851a('0x1'));var rs=require(_0x851a('0x2'));var fs=require('fs');var Redis=require(_0x851a('0x3'));var db=require(_0x851a('0x4'))['db'];var utils=require(_0x851a('0x5'));var logger=require(_0x851a('0x6'))(_0x851a('0x7'));var config=require(_0x851a('0x8'));var jayson=require(_0x851a('0x9'));var client=jayson[_0x851a('0xa')]['http']({'port':0x232a});config['redis']=_[_0x851a('0xb')](config[_0x851a('0xc')],{'host':_0x851a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x851a('0xc')]));require(_0x851a('0xe'))['register'](socket);function respondWithRpcPromise(_0x5e7938,_0x91ebb9,_0x428dc1){return new BPromise(function(_0xe2f757,_0x96cc23){return client[_0x851a('0xf')](_0x5e7938,_0x428dc1)[_0x851a('0x10')](function(_0x2b809c){logger[_0x851a('0x11')](_0x851a('0x12'),_0x91ebb9,_0x851a('0x13'));logger[_0x851a('0x14')](_0x851a('0x15'),_0x91ebb9,'request\x20sent',JSON['stringify'](_0x2b809c));if(_0x2b809c[_0x851a('0x16')]){if(_0x2b809c['error'][_0x851a('0x17')]===0x1f4){logger[_0x851a('0x16')]('MailInteraction,\x20%s,\x20%s',_0x91ebb9,_0x2b809c['error'][_0x851a('0x18')]);return _0x96cc23(_0x2b809c[_0x851a('0x16')]['message']);}logger[_0x851a('0x16')](_0x851a('0x12'),_0x91ebb9,_0x2b809c['error'][_0x851a('0x18')]);return _0xe2f757(_0x2b809c[_0x851a('0x16')][_0x851a('0x18')]);}else{logger[_0x851a('0x11')]('MailInteraction,\x20%s,\x20%s',_0x91ebb9,_0x851a('0x13'));_0xe2f757(_0x2b809c['result']['message']);}})[_0x851a('0x19')](function(_0xd53e6f){logger[_0x851a('0x16')](_0x851a('0x12'),_0x91ebb9,_0xd53e6f);_0x96cc23(_0xd53e6f);});});}exports['UpdateMailInteraction']=function(_0x2069f6){var _0x749cd0=this;return new Promise(function(_0x2d8e98,_0x459534){return db[_0x851a('0x1a')][_0x851a('0x1b')](_0x2069f6[_0x851a('0x1c')],{'raw':_0x2069f6[_0x851a('0x1d')]?_0x2069f6[_0x851a('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2069f6['options']?_0x2069f6[_0x851a('0x1d')][_0x851a('0x1e')]||null:null,'attributes':_0x2069f6['options']?_0x2069f6[_0x851a('0x1d')][_0x851a('0x1f')]||null:null,'limit':_0x2069f6['options']?_0x2069f6[_0x851a('0x1d')][_0x851a('0x20')]||null:null})[_0x851a('0x10')](function(_0x30a5b2){logger[_0x851a('0x11')](_0x851a('0x21'),_0x2069f6);logger['debug']('UpdateMailInteraction',_0x2069f6,JSON[_0x851a('0x22')](_0x30a5b2));_0x2d8e98(_0x30a5b2);})['catch'](function(_0x6b80ec){logger[_0x851a('0x16')]('UpdateMailInteraction',_0x6b80ec['message'],_0x2069f6);_0x459534(_0x749cd0[_0x851a('0x16')](0x1f4,_0x6b80ec[_0x851a('0x18')]));});});};exports[_0x851a('0x23')]=function(_0x5dd3b4){return new Promise(function(_0x4e337d,_0x630bdc){return db[_0x851a('0x1a')][_0x851a('0x24')]({'where':_0x5dd3b4[_0x851a('0x1d')]?_0x5dd3b4[_0x851a('0x1d')][_0x851a('0x1e')]||null:null})[_0x851a('0x10')](function(_0x46b992){if(_0x46b992){return _0x46b992[_0x851a('0x25')](_0x5dd3b4['body']['ids'],_[_0x851a('0x26')](_0x5dd3b4[_0x851a('0x1c')],[_0x851a('0x27'),'id'])||{});}})[_0x851a('0x28')](function(_0x11658b){logger[_0x851a('0x11')](_0x851a('0x29'),_0x5dd3b4);logger[_0x851a('0x14')](_0x851a('0x29'),_0x5dd3b4,JSON[_0x851a('0x22')](_0x11658b));_0x4e337d(_0x11658b);})[_0x851a('0x19')](function(_0xe9cfaf){logger[_0x851a('0x16')](_0x851a('0x29'),_0xe9cfaf[_0x851a('0x18')],_0x5dd3b4);_0x630bdc(_this[_0x851a('0x16')](0x1f4,_0xe9cfaf[_0x851a('0x18')]));});});};
\ No newline at end of file
index 1291021..fd5d186 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38a3=['./mailInteraction.events','save','remove','update','removeListener','register','length','mailInteraction:'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x38a3,0x1b0));var _0x338a=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x38a3[_0xfae23b];return _0x200640;};'use strict';var MailInteractionEvents=require(_0x338a('0x0'));var events=[_0x338a('0x1'),_0x338a('0x2'),_0x338a('0x3')];function createListener(_0x59c06e,_0x5484aa){return function(_0x24caff){_0x5484aa['emit'](_0x59c06e,_0x24caff);};}function removeListener(_0x12d480,_0x5c1d91){return function(){MailInteractionEvents[_0x338a('0x4')](_0x12d480,_0x5c1d91);};}exports[_0x338a('0x5')]=function(_0x499533){for(var _0x412489=0x0,_0x23e2e6=events[_0x338a('0x6')];_0x412489<_0x23e2e6;_0x412489++){var _0x1b0a99=events[_0x412489];var _0x25ce8b=createListener(_0x338a('0x7')+_0x1b0a99,_0x499533);MailInteractionEvents['on'](_0x1b0a99,_0x25ce8b);}};
\ No newline at end of file
+var _0xe06f=['./mailInteraction.events','save','remove','update','emit','removeListener','length','mailInteraction:'];(function(_0xaaeda8,_0x1bc84c){var _0x4b2fe2=function(_0x58ea1f){while(--_0x58ea1f){_0xaaeda8['push'](_0xaaeda8['shift']());}};_0x4b2fe2(++_0x1bc84c);}(_0xe06f,0xa8));var _0xfe06=function(_0x48c140,_0x17d968){_0x48c140=_0x48c140-0x0;var _0x530f1b=_0xe06f[_0x48c140];return _0x530f1b;};'use strict';var MailInteractionEvents=require(_0xfe06('0x0'));var events=[_0xfe06('0x1'),_0xfe06('0x2'),_0xfe06('0x3')];function createListener(_0xddac21,_0x358b85){return function(_0x4be8fa){_0x358b85[_0xfe06('0x4')](_0xddac21,_0x4be8fa);};}function removeListener(_0x4ca037,_0x1eb312){return function(){MailInteractionEvents[_0xfe06('0x5')](_0x4ca037,_0x1eb312);};}exports['register']=function(_0x3a4163){for(var _0xf4e32d=0x0,_0x20a5db=events[_0xfe06('0x6')];_0xf4e32d<_0x20a5db;_0xf4e32d++){var _0x3edbda=events[_0xf4e32d];var _0x1c86a0=createListener(_0xfe06('0x7')+_0x3edbda,_0x3a4163);MailInteractionEvents['on'](_0x3edbda,_0x1c86a0);}};
\ No newline at end of file
index 0a9b33b..ba99a3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe852=['tracked','mail','mailmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/download','download'];(function(_0x4bc478,_0x417178){var _0x44ac19=function(_0xf35604){while(--_0xf35604){_0x4bc478['push'](_0x4bc478['shift']());}};_0x44ac19(++_0x417178);}(_0xe852,0x7f));var _0x2e85=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0xe852[_0x1d9aa0];return _0x226868;};'use strict';var multer=require(_0x2e85('0x0'));var util=require(_0x2e85('0x1'));var path=require(_0x2e85('0x2'));var timeout=require('connect-timeout');var express=require(_0x2e85('0x3'));var router=express[_0x2e85('0x4')]();var fs_extra=require(_0x2e85('0x5'));var auth=require(_0x2e85('0x6'));var interaction=require(_0x2e85('0x7'));var config=require(_0x2e85('0x8'));var controller=require(_0x2e85('0x9'));router[_0x2e85('0xa')]('/',auth[_0x2e85('0xb')](),controller[_0x2e85('0xc')]);router['get'](_0x2e85('0xd'),auth[_0x2e85('0xb')](),controller['describe']);router[_0x2e85('0xa')](_0x2e85('0xe'),auth[_0x2e85('0xb')](),controller[_0x2e85('0xf')]);router[_0x2e85('0xa')](_0x2e85('0x10'),auth[_0x2e85('0xb')](),controller[_0x2e85('0x11')]);router['post']('/',auth[_0x2e85('0xb')](),interaction[_0x2e85('0x12')](_0x2e85('0x13'),_0x2e85('0x14')),controller['create']);router[_0x2e85('0x15')](_0x2e85('0xe'),auth[_0x2e85('0xb')](),controller[_0x2e85('0x16')]);router[_0x2e85('0x15')](_0x2e85('0x17'),auth[_0x2e85('0xb')](),controller[_0x2e85('0x18')]);router[_0x2e85('0x15')](_0x2e85('0x19'),auth[_0x2e85('0xb')](),controller[_0x2e85('0x1a')]);router['delete'](_0x2e85('0xe'),auth[_0x2e85('0xb')](),controller[_0x2e85('0x1b')]);module[_0x2e85('0x1c')]=router;
\ No newline at end of file
+var _0xec56=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','tracked','mail','create','put','update','/:id/accept','reject','delete','exports','multer','connect-timeout','express'];(function(_0x36d6af,_0x5b3cea){var _0x457c40=function(_0xa1bb63){while(--_0xa1bb63){_0x36d6af['push'](_0x36d6af['shift']());}};_0x457c40(++_0x5b3cea);}(_0xec56,0x1bd));var _0x6ec5=function(_0x2613f0,_0xcbb41c){_0x2613f0=_0x2613f0-0x0;var _0x47acc3=_0xec56[_0x2613f0];return _0x47acc3;};'use strict';var multer=require(_0x6ec5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ec5('0x1'));var express=require(_0x6ec5('0x2'));var router=express[_0x6ec5('0x3')]();var fs_extra=require(_0x6ec5('0x4'));var auth=require(_0x6ec5('0x5'));var interaction=require(_0x6ec5('0x6'));var config=require(_0x6ec5('0x7'));var controller=require(_0x6ec5('0x8'));router[_0x6ec5('0x9')]('/',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xb')]);router[_0x6ec5('0x9')](_0x6ec5('0xc'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xd')]);router[_0x6ec5('0x9')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xf')]);router['get'](_0x6ec5('0x10'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x11')]);router[_0x6ec5('0x12')]('/',auth[_0x6ec5('0xa')](),interaction[_0x6ec5('0x13')](_0x6ec5('0x14'),'mailmessage:create'),controller[_0x6ec5('0x15')]);router[_0x6ec5('0x16')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x17')]);router[_0x6ec5('0x16')](_0x6ec5('0x18'),auth[_0x6ec5('0xa')](),controller['accept']);router[_0x6ec5('0x16')]('/:id/reject',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x19')]);router[_0x6ec5('0x1a')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller['destroy']);module[_0x6ec5('0x1b')]=router;
\ No newline at end of file
index 89a9566..aba95be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2171=['Chat','sequelize','lodash','exports','long','ENUM','out','TEXT','DATE','Email'];(function(_0xd2d450,_0x4f1aef){var _0x378757=function(_0x1e451d){while(--_0x1e451d){_0xd2d450['push'](_0xd2d450['shift']());}};_0x378757(++_0x4f1aef);}(_0x2171,0x1b9));var _0x1217=function(_0xf879bb,_0x5aaebf){_0xf879bb=_0xf879bb-0x0;var _0x277abc=_0x2171[_0xf879bb];return _0x277abc;};'use strict';var Sequelize=require(_0x1217('0x0'));var _=require(_0x1217('0x1'));module[_0x1217('0x2')]={'body':{'type':Sequelize['TEXT'](_0x1217('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium')},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x1217('0x4')]('in',_0x1217('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x1217('0x6')]('long')},'cc':{'type':Sequelize['TEXT'](_0x1217('0x3'))},'bcc':{'type':Sequelize['TEXT'](_0x1217('0x3'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x1217('0x7')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x1217('0x7')]},'originTo':{'type':Sequelize[_0x1217('0x6')](_0x1217('0x3'))},'originCc':{'type':Sequelize[_0x1217('0x6')](_0x1217('0x3'))},'originChannel':{'type':Sequelize[_0x1217('0x4')](_0x1217('0x8'),_0x1217('0x9')),'defaultValue':_0x1217('0x8'),'allowNull':![]}};
\ No newline at end of file
+var _0x9390=['out','STRING','long','DATE','BOOLEAN','Email','Chat','sequelize','exports','TEXT','medium','ENUM'];(function(_0x560ef3,_0x2f393f){var _0x333787=function(_0x55a4ae){while(--_0x55a4ae){_0x560ef3['push'](_0x560ef3['shift']());}};_0x333787(++_0x2f393f);}(_0x9390,0xc7));var _0x0939=function(_0x321d5d,_0x52fc02){_0x321d5d=_0x321d5d-0x0;var _0x17d764=_0x9390[_0x321d5d];return _0x17d764;};'use strict';var Sequelize=require(_0x0939('0x0'));var _=require('lodash');module[_0x0939('0x1')]={'body':{'type':Sequelize[_0x0939('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x0939('0x3'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x0939('0x4')]('in',_0x0939('0x5')),'defaultValue':_0x0939('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x0939('0x6')]},'to':{'type':Sequelize[_0x0939('0x2')](_0x0939('0x7'))},'cc':{'type':Sequelize[_0x0939('0x2')](_0x0939('0x7'))},'bcc':{'type':Sequelize[_0x0939('0x2')](_0x0939('0x7'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x0939('0x8')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x0939('0x9')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x0939('0x8')]},'originTo':{'type':Sequelize['TEXT'](_0x0939('0x7'))},'originCc':{'type':Sequelize[_0x0939('0x2')]('long')},'originChannel':{'type':Sequelize[_0x0939('0x4')](_0x0939('0xa'),_0x0939('0xb')),'defaultValue':_0x0939('0xa'),'allowNull':![]}};
\ No newline at end of file
index 3724959..72d47c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb1c5=['Attachments','basename','push','readFileSync','build','eml-format','moment','bluebird','util','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','redis','defaults','localhost','html-entities','./mailMessage.socket','jayson/promise','client','http','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','name','send','index','MailMessage','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','options','includeAll','include','rows','params','find','body','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','auth','user','pass','attachments','join','root','server/files/attachments','List\x20not\x20found','SendMail','YYYY-MM-DD\x20HH:mm:ss','accept','read','readAt','format','UserId','agent','get','MailInteractionId','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','ContactId','sequelize','QueryTypes','contact','email','interface','SIP/%s','channel','event','fromString','EventManager','acceptmessage','mail','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','SELECT','fullname','internal','motionChannel','reject','rejectmessage','download','unix','toString','server','files','tmp','from','bcc','subject','createdAt','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','Bcc'];(function(_0x3aa2ea,_0xed17f1){var _0x197755=function(_0x39e0b5){while(--_0x39e0b5){_0x3aa2ea['push'](_0x3aa2ea['shift']());}};_0x197755(++_0xed17f1);}(_0xb1c5,0xa6));var _0x5b1c=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xb1c5[_0x25e7cb];return _0x375d92;};'use strict';var emlformat=require(_0x5b1c('0x0'));var moment=require(_0x5b1c('0x1'));var BPromise=require(_0x5b1c('0x2'));var util=require(_0x5b1c('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x5b1c('0x4'));var Redis=require(_0x5b1c('0x5'));var htmlToText=require(_0x5b1c('0x6'));var qs=require(_0x5b1c('0x7'));var logger=require(_0x5b1c('0x8'))(_0x5b1c('0x9'));var interaction_log=require(_0x5b1c('0x8'))(_0x5b1c('0xa'));var config=require(_0x5b1c('0xb'));var db=require('../../mysqldb')['db'];config[_0x5b1c('0xc')]=_[_0x5b1c('0xd')](config[_0x5b1c('0xc')],{'host':_0x5b1c('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5b1c('0xc')]));var htmlEntities=require(_0x5b1c('0xf'));require(_0x5b1c('0x10'))['register'](socket);var jayson=require(_0x5b1c('0x11'));var client=jayson[_0x5b1c('0x12')][_0x5b1c('0x13')]({'port':0x232c});var client9003=jayson['client']['http']({'port':0x232b});var client9002=jayson[_0x5b1c('0x12')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4394cf,_0x2ba4c2,_0x360f69,_0x80f479){return new BPromise(function(_0x3c310e,_0x40d998){var _0x18a079=_0x80f479||client;return _0x18a079[_0x5b1c('0x14')](_0x4394cf,_0x360f69)['then'](function(_0x322543){logger[_0x5b1c('0x15')](_0x5b1c('0x16'),_0x2ba4c2,_0x5b1c('0x17'));logger[_0x5b1c('0x18')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x2ba4c2,_0x5b1c('0x17'),JSON[_0x5b1c('0x19')](_0x322543));if(_0x322543[_0x5b1c('0x1a')]){if(_0x322543[_0x5b1c('0x1a')][_0x5b1c('0x1b')]===0x1f4){logger[_0x5b1c('0x1a')](_0x5b1c('0x16'),_0x2ba4c2,_0x322543[_0x5b1c('0x1a')][_0x5b1c('0x1c')]);return _0x40d998(_0x322543[_0x5b1c('0x1a')][_0x5b1c('0x1c')]);}logger[_0x5b1c('0x1a')](_0x5b1c('0x16'),_0x2ba4c2,_0x322543['error'][_0x5b1c('0x1c')]);return _0x3c310e(_0x322543['error'][_0x5b1c('0x1c')]);}else{logger['info'](_0x5b1c('0x16'),_0x2ba4c2,_0x5b1c('0x17'));_0x3c310e(_0x322543[_0x5b1c('0x1d')][_0x5b1c('0x1c')]);}})[_0x5b1c('0x1e')](function(_0x5b5fc9){logger[_0x5b1c('0x1a')]('MailMessage,\x20%s,\x20%s',_0x2ba4c2,_0x5b5fc9);_0x40d998(_0x5b5fc9);});});}function respondWithResult(_0x4a4559,_0x267ed6){_0x267ed6=_0x267ed6||0xc8;return function(_0x14d855){if(_0x14d855){return _0x4a4559[_0x5b1c('0x1f')](_0x267ed6)[_0x5b1c('0x20')](_0x14d855);}};}function respondWithFilteredResult(_0x50e8b6,_0x5e7191){return function(_0x57f06c){if(_0x57f06c){var _0x3ad860=typeof _0x5e7191[_0x5b1c('0x21')]===_0x5b1c('0x22')&&typeof _0x5e7191[_0x5b1c('0x23')]==='undefined';var _0x5d2b9c=_0x57f06c['count'];var _0x2c525d=_0x3ad860?0x0:_0x5e7191[_0x5b1c('0x21')];var _0x1750ec=_0x3ad860?_0x57f06c[_0x5b1c('0x24')]:_0x5e7191[_0x5b1c('0x21')]+_0x5e7191[_0x5b1c('0x23')];var _0x4128f0;if(_0x1750ec>=_0x5d2b9c){_0x1750ec=_0x5d2b9c;_0x4128f0=0xc8;}else{_0x4128f0=0xce;}_0x50e8b6[_0x5b1c('0x1f')](_0x4128f0);return _0x50e8b6[_0x5b1c('0x25')](_0x5b1c('0x26'),_0x2c525d+'-'+_0x1750ec+'/'+_0x5d2b9c)[_0x5b1c('0x20')](_0x57f06c);}return null;};}function saveUpdates(_0x15104f){return function(_0xcd0e21){if(_0xcd0e21){return _0xcd0e21[_0x5b1c('0x27')](_0x15104f)[_0x5b1c('0x28')](function(_0x3a080a){return _0x3a080a;});}return null;};}function removeEntity(_0x39b839){return function(_0x524ab1){if(_0x524ab1){return _0x524ab1[_0x5b1c('0x29')]()[_0x5b1c('0x28')](function(){_0x39b839[_0x5b1c('0x1f')](0xcc)[_0x5b1c('0x2a')]();});}};}function handleEntityNotFound(_0x20576f){return function(_0x1d3f84){if(!_0x1d3f84){_0x20576f['sendStatus'](0x194);}return _0x1d3f84;};}function handleError(_0x5a134b,_0x5d6966){_0x5d6966=_0x5d6966||0x1f4;return function(_0x23eda2){logger[_0x5b1c('0x1a')](_0x23eda2['stack']);if(_0x23eda2[_0x5b1c('0x2b')]){delete _0x23eda2[_0x5b1c('0x2b')];}_0x5a134b[_0x5b1c('0x1f')](_0x5d6966)[_0x5b1c('0x2c')](_0x23eda2);};}exports[_0x5b1c('0x2d')]=function(_0x348191,_0x3cf8a3){var _0x5937a8={},_0x5a92c0={},_0xac627={'count':0x0,'rows':[]};var _0x50c0ff=_['map'](db[_0x5b1c('0x2e')][_0x5b1c('0x2f')],function(_0x40c83d){return{'name':_0x40c83d['fieldName'],'type':_0x40c83d['type'][_0x5b1c('0x30')]};});_0x5a92c0[_0x5b1c('0x31')]=_['map'](_0x50c0ff,_0x5b1c('0x2b'));_0x5a92c0[_0x5b1c('0x32')]=_[_0x5b1c('0x33')](_0x348191[_0x5b1c('0x32')]);_0x5a92c0[_0x5b1c('0x34')]=_[_0x5b1c('0x35')](_0x5a92c0[_0x5b1c('0x31')],_0x5a92c0[_0x5b1c('0x32')]);_0x5937a8['attributes']=_[_0x5b1c('0x35')](_0x5a92c0[_0x5b1c('0x31')],qs[_0x5b1c('0x36')](_0x348191['query']['fields']));_0x5937a8[_0x5b1c('0x37')]=_0x5937a8[_0x5b1c('0x37')][_0x5b1c('0x38')]?_0x5937a8[_0x5b1c('0x37')]:_0x5a92c0['model'];if(!_0x348191[_0x5b1c('0x32')][_0x5b1c('0x39')](_0x5b1c('0x3a'))){_0x5937a8[_0x5b1c('0x23')]=qs['limit'](_0x348191[_0x5b1c('0x32')][_0x5b1c('0x23')]);_0x5937a8[_0x5b1c('0x21')]=qs['offset'](_0x348191[_0x5b1c('0x32')][_0x5b1c('0x21')]);}_0x5937a8[_0x5b1c('0x3b')]=qs['sort'](_0x348191[_0x5b1c('0x32')][_0x5b1c('0x3c')]);_0x5937a8[_0x5b1c('0x3d')]=qs['filters'](_[_0x5b1c('0x3e')](_0x348191['query'],_0x5a92c0[_0x5b1c('0x34')]),_0x50c0ff);if(_0x348191['query'][_0x5b1c('0x3f')]){_0x5937a8['where']=_[_0x5b1c('0x40')](_0x5937a8[_0x5b1c('0x3d')],{'$or':_[_0x5b1c('0x41')](_0x50c0ff,function(_0x31c929){if(_0x31c929[_0x5b1c('0x42')]!=='VIRTUAL'){var _0x563b68={};_0x563b68[_0x31c929[_0x5b1c('0x2b')]]={'$like':'%'+_0x348191[_0x5b1c('0x32')][_0x5b1c('0x3f')]+'%'};return _0x563b68;}})});}_0x5937a8=_[_0x5b1c('0x40')]({},_0x5937a8,_0x348191[_0x5b1c('0x43')]);var _0x2c8858={'where':_0x5937a8['where']};return db[_0x5b1c('0x2e')]['count'](_0x2c8858)['then'](function(_0xb65fb){_0xac627[_0x5b1c('0x24')]=_0xb65fb;if(_0x348191[_0x5b1c('0x32')][_0x5b1c('0x44')]){_0x5937a8[_0x5b1c('0x45')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x5937a8);})[_0x5b1c('0x28')](function(_0x2fdd02){_0xac627[_0x5b1c('0x46')]=_0x2fdd02;return _0xac627;})[_0x5b1c('0x28')](respondWithFilteredResult(_0x3cf8a3,_0x5937a8))[_0x5b1c('0x1e')](handleError(_0x3cf8a3,null));};exports['show']=function(_0x51089e,_0x360d05){var _0x688edd={'raw':!![],'where':{'id':_0x51089e[_0x5b1c('0x47')]['id']}},_0x334815={};_0x334815[_0x5b1c('0x31')]=_[_0x5b1c('0x33')](db[_0x5b1c('0x2e')][_0x5b1c('0x2f')]);_0x334815['query']=_[_0x5b1c('0x33')](_0x51089e[_0x5b1c('0x32')]);_0x334815[_0x5b1c('0x34')]=_[_0x5b1c('0x35')](_0x334815[_0x5b1c('0x31')],_0x334815[_0x5b1c('0x32')]);_0x688edd['attributes']=_[_0x5b1c('0x35')](_0x334815['model'],qs[_0x5b1c('0x36')](_0x51089e[_0x5b1c('0x32')]['fields']));_0x688edd[_0x5b1c('0x37')]=_0x688edd['attributes'][_0x5b1c('0x38')]?_0x688edd[_0x5b1c('0x37')]:_0x334815['model'];if(_0x51089e[_0x5b1c('0x32')][_0x5b1c('0x44')]){_0x688edd[_0x5b1c('0x45')]=[{'all':!![]}];}_0x688edd=_[_0x5b1c('0x40')]({},_0x688edd,_0x51089e[_0x5b1c('0x43')]);return db[_0x5b1c('0x2e')][_0x5b1c('0x48')](_0x688edd)[_0x5b1c('0x28')](handleEntityNotFound(_0x360d05,null))[_0x5b1c('0x28')](respondWithResult(_0x360d05,null))['catch'](handleError(_0x360d05,null));};exports['update']=function(_0x24e825,_0x574ebb){if(_0x24e825[_0x5b1c('0x49')]['id']){delete _0x24e825[_0x5b1c('0x49')]['id'];}return db['MailMessage'][_0x5b1c('0x48')]({'where':{'id':_0x24e825[_0x5b1c('0x47')]['id']}})[_0x5b1c('0x28')](handleEntityNotFound(_0x574ebb,null))['then'](saveUpdates(_0x24e825['body'],null))[_0x5b1c('0x28')](respondWithResult(_0x574ebb,null))[_0x5b1c('0x1e')](handleError(_0x574ebb,null));};exports[_0x5b1c('0x29')]=function(_0x35529b,_0x4d54bb){return db[_0x5b1c('0x2e')]['find']({'where':{'id':_0x35529b['params']['id']}})[_0x5b1c('0x28')](handleEntityNotFound(_0x4d54bb,null))[_0x5b1c('0x28')](removeEntity(_0x4d54bb,null))[_0x5b1c('0x1e')](handleError(_0x4d54bb,null));};exports[_0x5b1c('0x4a')]=function(_0x1c8809,_0x1154de){return db['MailMessage'][_0x5b1c('0x4a')]()[_0x5b1c('0x28')](respondWithResult(_0x1154de,null))[_0x5b1c('0x1e')](handleError(_0x1154de,null));};exports[_0x5b1c('0x4b')]=function(_0x39b97d,_0x3252c1){return db[_0x5b1c('0x2e')]['create'](_0x39b97d[_0x5b1c('0x49')])[_0x5b1c('0x28')](function(_0x4fa868){if(_0x4fa868){if(_0x4fa868[_0x5b1c('0x4c')]===_0x5b1c('0x4d')&&!_0x4fa868[_0x5b1c('0x4e')]){var _0x539579,_0x2afaff,_0x252bf1;if(_0x39b97d[_0x5b1c('0x49')]['to']){_0x2afaff=_0x39b97d[_0x5b1c('0x49')]['to'][_0x5b1c('0x4f')](',')[0x0];}return db[_0x5b1c('0x50')][_0x5b1c('0x51')]({'where':{'id':_0x4fa868[_0x5b1c('0x52')]},'include':[{'model':db['CmList'],'as':_0x5b1c('0x53'),'include':[{'model':db[_0x5b1c('0x54')],'as':_0x5b1c('0x55'),'where':{'email':_0x2afaff},'limit':0x1,'order':[[_0x5b1c('0x56'),_0x5b1c('0x57')]]}]},{'model':db[_0x5b1c('0x58')],'as':_0x5b1c('0x59'),'raw':!![]}]})['then'](function(_0x122583){_0x539579=_0x122583;if(_0x539579&&_0x539579[_0x5b1c('0x59')]){var _0x569162={'tls':{'rejectUnauthorized':![]}};if(_[_0x5b1c('0x5a')](_0x539579[_0x5b1c('0x59')][_0x5b1c('0x5b')])){_0x569162[_0x5b1c('0x5c')]=_0x539579['Smtp']['host'];_0x569162[_0x5b1c('0x5d')]=_0x539579[_0x5b1c('0x59')][_0x5b1c('0x5d')];_0x569162[_0x5b1c('0x5e')]=_0x539579[_0x5b1c('0x59')][_0x5b1c('0x5e')];if(_0x539579[_0x5b1c('0x59')]['authentication']){_0x569162[_0x5b1c('0x5f')]={'user':_0x539579[_0x5b1c('0x59')][_0x5b1c('0x60')],'pass':_0x539579[_0x5b1c('0x59')][_0x5b1c('0x61')]};}}else{_0x569162['service']=_0x539579[_0x5b1c('0x59')][_0x5b1c('0x5b')];_0x569162[_0x5b1c('0x5f')]={'user':_0x539579['Smtp'][_0x5b1c('0x60')],'pass':_0x539579[_0x5b1c('0x59')]['pass']};_0x569162[_0x5b1c('0x5e')]=_0x539579['Smtp'][_0x5b1c('0x5e')];}if(_0x39b97d[_0x5b1c('0x49')][_0x5b1c('0x62')]&&_0x39b97d[_0x5b1c('0x49')][_0x5b1c('0x62')][_0x5b1c('0x38')]){for(var _0xaaefda=0x0;_0xaaefda<_0x39b97d[_0x5b1c('0x49')]['attachments']['length'];_0xaaefda+=0x1){_0x39b97d['body'][_0x5b1c('0x62')][_0xaaefda]={'filename':_0x39b97d[_0x5b1c('0x49')][_0x5b1c('0x62')][_0xaaefda][_0x5b1c('0x2b')],'path':path[_0x5b1c('0x63')](config[_0x5b1c('0x64')],_0x5b1c('0x65'),_0x39b97d[_0x5b1c('0x49')][_0x5b1c('0x62')][_0xaaefda]['basename'])};}}_0x252bf1={'account':_0x569162,'message':_0x39b97d['body']};return;}})[_0x5b1c('0x28')](function(){if(_0x539579[_0x5b1c('0x53')]){if(_0x539579['List'][_0x5b1c('0x55')][_0x5b1c('0x38')]){return _0x539579['List'][_0x5b1c('0x55')][0x0];}else{return db['CmContact']['create'](_[_0x5b1c('0xd')](_0x39b97d[_0x5b1c('0x49')],{'firstName':_0x39b97d[_0x5b1c('0x49')]['to'],'email':_0x39b97d['body']['to'],'phone':_0x39b97d['body']['to'],'ListId':_0x539579['ListId']}));}}else{throw new Error(_0x5b1c('0x66'));}})[_0x5b1c('0x28')](function(){if(_0x252bf1){return respondWithRpcPromise(_0x5b1c('0x67'),'sendMail',_0x252bf1,client9003)[_0x5b1c('0x28')](function(_0x4435fe){return _0x4fa868['update']({'read':!![],'messageId':_0x4435fe['messageId'],'sentAt':moment()['format'](_0x5b1c('0x68'))});})['catch'](function(_0xf67389){logger['error']('%s',JSON[_0x5b1c('0x19')](_0xf67389));return _0x4fa868;});}return _0x4fa868;});}return _0x4fa868;}})[_0x5b1c('0x28')](respondWithResult(_0x3252c1,0xc9))[_0x5b1c('0x1e')](handleError(_0x3252c1,null));};exports[_0x5b1c('0x69')]=function(_0x566f2b,_0x207754){var _0x15679d={'agent':{},'channel':'mail'};if(_0x566f2b[_0x5b1c('0x49')]['id']){delete _0x566f2b[_0x5b1c('0x49')]['id'];}_0x566f2b[_0x5b1c('0x49')][_0x5b1c('0x6a')]=!![];_0x566f2b['body'][_0x5b1c('0x6b')]=moment()[_0x5b1c('0x6c')](_0x5b1c('0x68'));_0x566f2b['body'][_0x5b1c('0x6d')]=_0x566f2b[_0x5b1c('0x49')][_0x5b1c('0x6d')]||_0x566f2b['user']['id'];_0x15679d[_0x5b1c('0x6e')]['id']=_0x566f2b['body'][_0x5b1c('0x6d')];return db[_0x5b1c('0x2e')][_0x5b1c('0x48')]({'where':{'id':_0x566f2b[_0x5b1c('0x47')]['id'],'UserId':null}})[_0x5b1c('0x28')](handleEntityNotFound(_0x207754,null))[_0x5b1c('0x28')](saveUpdates(_0x566f2b[_0x5b1c('0x49')],null))[_0x5b1c('0x28')](function(_0x5d3ef9){if(_0x5d3ef9){_0x15679d['message']=_0x5d3ef9[_0x5b1c('0x6f')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x5d3ef9[_0x5b1c('0x70')]}});}return null;})['then'](handleEntityNotFound(_0x207754,null))[_0x5b1c('0x28')](function(_0x270f04){if(_0x270f04){return _0x270f04[_0x5b1c('0x27')]({'UserId':_0x566f2b['body'][_0x5b1c('0x6d')],'read1stAt':_['isNil'](_0x270f04[_0x5b1c('0x71')])?moment()['format'](_0x5b1c('0x68')):undefined});}return null;})[_0x5b1c('0x28')](function(_0x2cbc8f){if(_0x2cbc8f){_0x15679d['interaction']=_0x2cbc8f['get']({'plain':!![]});interaction_log[_0x5b1c('0x15')](_0x5b1c('0x72'),_0x566f2b['user']['id'],_0x566f2b[_0x5b1c('0x60')][_0x5b1c('0x2b')],_0x566f2b[_0x5b1c('0x60')][_0x5b1c('0x73')],_0x15679d[_0x5b1c('0x74')]['id'],_0x566f2b[_0x5b1c('0x49')]?JSON['stringify'](_0x566f2b['body']):_0x5b1c('0x75'));return respondWithRpcPromise(_0x5b1c('0x76'),_0x5b1c('0x77'),_0x15679d);}return null;})[_0x5b1c('0x28')](function(_0x3ccc9d){var _0x430463='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3ccc9d['message'][_0x5b1c('0x78')];return db[_0x5b1c('0x79')][_0x5b1c('0x32')](_0x430463,{'type':db['Sequelize'][_0x5b1c('0x7a')]['SELECT'],'raw':!![]})[_0x5b1c('0x28')](function(_0x22d686){return _0x22d686;});})[_0x5b1c('0x28')](function(_0x591b4a){if(_0x591b4a){_0x15679d[_0x5b1c('0x1c')][_0x5b1c('0x7b')]=_0x591b4a[0x0];if(!_0x566f2b[_0x5b1c('0x49')][_0x5b1c('0x6d')])return;return db['User'][_0x5b1c('0x48')]({'where':{'id':_0x566f2b['body']['UserId'],'role':_0x5b1c('0x6e')},'attributes':['id',_0x5b1c('0x2b'),'fullname',_0x5b1c('0x7c'),'internal'],'raw':!![]});}return null;})[_0x5b1c('0x28')](function(_0xef270c){if(!_0xef270c)return null;_0x15679d[_0x5b1c('0x1c')][_0x5b1c('0x6e')]=_0xef270c;return _0x15679d;})[_0x5b1c('0x28')](function(_0x36b238){if(_0x36b238){if(_0x566f2b['body']['manual']){_0x15679d['message'][_0x5b1c('0x7d')]=util[_0x5b1c('0x6c')](_0x5b1c('0x7e'),_0x566f2b['user'][_0x5b1c('0x2b')]);_0x15679d[_0x5b1c('0x1c')]['channel']=_0x15679d[_0x5b1c('0x7f')];_0x15679d[_0x5b1c('0x1c')]['motionChannel']=_0x15679d[_0x5b1c('0x7f')];_0x15679d[_0x5b1c('0x1c')][_0x5b1c('0x80')]=_0x5b1c('0x69');_0x15679d['message'][_0x5b1c('0x49')]=htmlToText[_0x5b1c('0x81')](_0x15679d['message']['body']);return respondWithRpcPromise(_0x5b1c('0x82'),_0x5b1c('0x82'),{'event':_0x5b1c('0x83'),'message':_0x15679d[_0x5b1c('0x1c')]},client9002)[_0x5b1c('0x28')](function(){return _0x15679d;});}return _0x15679d;}return null;})[_0x5b1c('0x28')](respondWithResult(_0x207754,null))[_0x5b1c('0x1e')](handleError(_0x207754,null));};exports['reject']=function(_0x3131af,_0x24ae78){var _0x504214={'agent':{},'channel':_0x5b1c('0x84')};if(_0x3131af[_0x5b1c('0x49')]['id']){delete _0x3131af[_0x5b1c('0x49')]['id'];}_0x3131af[_0x5b1c('0x49')][_0x5b1c('0x6d')]=_0x3131af[_0x5b1c('0x49')][_0x5b1c('0x6d')]||_0x3131af['user']['id'];_0x504214[_0x5b1c('0x6e')]['id']=_0x3131af[_0x5b1c('0x49')][_0x5b1c('0x6d')];return db['MailMessage'][_0x5b1c('0x48')]({'where':{'id':_0x3131af['params']['id'],'UserId':null}})[_0x5b1c('0x28')](handleEntityNotFound(_0x24ae78,null))['then'](function(_0x5ee332){if(_0x5ee332){_0x504214['message']=_0x5ee332[_0x5b1c('0x6f')]({'plain':!![]});return db[_0x5b1c('0x85')]['find']({'where':{'id':_0x5ee332[_0x5b1c('0x70')]}});}return null;})['then'](handleEntityNotFound(_0x24ae78,null))[_0x5b1c('0x28')](function(_0x735546){if(_0x735546){_0x504214[_0x5b1c('0x74')]=_0x735546[_0x5b1c('0x6f')]({'plain':!![]});interaction_log['info'](_0x5b1c('0x86'),_0x3131af[_0x5b1c('0x60')]['id'],_0x3131af['user'][_0x5b1c('0x2b')],_0x3131af[_0x5b1c('0x60')][_0x5b1c('0x73')],_0x504214['interaction']['id'],_0x3131af[_0x5b1c('0x49')]?JSON['stringify'](_0x3131af[_0x5b1c('0x49')]):_0x5b1c('0x75'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x504214);}return null;})[_0x5b1c('0x28')](function(_0x1abd32){var _0x44d3a8=_0x5b1c('0x87')+_0x1abd32[_0x5b1c('0x1c')]['ContactId'];return db[_0x5b1c('0x79')][_0x5b1c('0x32')](_0x44d3a8,{'type':db[_0x5b1c('0x88')][_0x5b1c('0x7a')][_0x5b1c('0x89')],'raw':!![]})[_0x5b1c('0x28')](function(_0x50dfeb){return _0x50dfeb;});})['then'](function(_0x4287ba){if(_0x4287ba){_0x504214['message'][_0x5b1c('0x7b')]=_0x4287ba[0x0];if(!_0x3131af['body'][_0x5b1c('0x6d')])return;return db['User'][_0x5b1c('0x48')]({'where':{'id':_0x3131af[_0x5b1c('0x49')]['UserId'],'role':_0x5b1c('0x6e')},'attributes':['id',_0x5b1c('0x2b'),_0x5b1c('0x8a'),'email',_0x5b1c('0x8b')],'raw':!![]});}return null;})[_0x5b1c('0x28')](function(_0x3fc443){if(!_0x3fc443)return null;_0x504214['message'][_0x5b1c('0x6e')]=_0x3fc443;return _0x504214;})['then'](function(_0x386a43){if(_0x386a43){_0x386a43[_0x5b1c('0x1c')]['interface']=util['format'](_0x5b1c('0x7e'),_0x3131af[_0x5b1c('0x60')][_0x5b1c('0x2b')]);_0x386a43[_0x5b1c('0x1c')][_0x5b1c('0x7f')]=_0x504214[_0x5b1c('0x7f')];_0x386a43[_0x5b1c('0x1c')][_0x5b1c('0x8c')]=_0x504214[_0x5b1c('0x7f')];_0x386a43['message'][_0x5b1c('0x80')]=_0x5b1c('0x8d');_0x386a43[_0x5b1c('0x1c')]['body']=htmlToText[_0x5b1c('0x81')](_0x504214[_0x5b1c('0x1c')][_0x5b1c('0x49')]);respondWithRpcPromise(_0x5b1c('0x82'),_0x5b1c('0x82'),{'event':_0x5b1c('0x8e'),'message':_0x386a43['message']},client9002);return _0x504214;}return null;})[_0x5b1c('0x28')](respondWithResult(_0x24ae78,null))['catch'](handleError(_0x24ae78,null));};exports[_0x5b1c('0x8f')]=function(_0x230480,_0x17362b){var _0x4f267a=moment()[_0x5b1c('0x90')]()[_0x5b1c('0x91')]();var _0x5cf33b=path[_0x5b1c('0x63')](config[_0x5b1c('0x64')],_0x5b1c('0x92'),_0x5b1c('0x93'),_0x5b1c('0x94'));var _0x24acc3=path[_0x5b1c('0x63')](config[_0x5b1c('0x64')],_0x5b1c('0x92'),_0x5b1c('0x93'),_0x5b1c('0x62'));var _0x25acf9=util[_0x5b1c('0x6c')]('message-%s.eml',_0x4f267a);return db[_0x5b1c('0x2e')][_0x5b1c('0x48')]({'where':{'id':_0x230480[_0x5b1c('0x47')]['id']},'attributes':['id','body',_0x5b1c('0x95'),'to','cc',_0x5b1c('0x96'),_0x5b1c('0x97'),_0x5b1c('0x98')],'include':_0x230480[_0x5b1c('0x32')][_0x5b1c('0x62')]?[{'model':db['Attachment'],'as':'Attachments'}]:undefined})[_0x5b1c('0x28')](handleEntityNotFound(_0x17362b,null))[_0x5b1c('0x28')](function(_0x412030){if(_0x412030){var _0x34ec54=_0x412030;var _0x4687cb={'from':_0x34ec54[_0x5b1c('0x95')],'to':_0x34ec54['to'],'subject':_0x34ec54[_0x5b1c('0x97')],'html':htmlEntities[_0x5b1c('0x99')](_0x34ec54[_0x5b1c('0x49')]),'headers':{'Date':moment(_0x34ec54['createdAt'])['format'](_0x5b1c('0x9a'))},'attachments':[]};if(_0x412030['cc']){_0x4687cb['headers']['Cc']=_0x412030['cc'];}if(_0x412030[_0x5b1c('0x96')]){_0x4687cb['headers'][_0x5b1c('0x9b')]=_0x412030[_0x5b1c('0x96')];}return new BPromise(function(_0x2d05c6,_0xacf407){if(_0x412030[_0x5b1c('0x9c')]){for(var _0x97e27d=0x0;_0x97e27d<_0x412030[_0x5b1c('0x9c')][_0x5b1c('0x38')];_0x97e27d++){var _0x27fcbd=_0x412030[_0x5b1c('0x9c')][_0x97e27d];var _0x565fab=path[_0x5b1c('0x63')](_0x24acc3,_0x27fcbd[_0x5b1c('0x9d')]);if(fs['existsSync'](_0x565fab)){_0x4687cb[_0x5b1c('0x62')][_0x5b1c('0x9e')]({'name':_0x27fcbd[_0x5b1c('0x2b')],'contentType':_0x27fcbd[_0x5b1c('0x42')],'data':fs[_0x5b1c('0x9f')](_0x565fab)});}}}emlformat[_0x5b1c('0xa0')](_0x4687cb,function(_0x33ccaf,_0xfd14f5){if(_0x33ccaf)return _0xacf407(_0x33ccaf);fs['writeFileSync'](path[_0x5b1c('0x63')](_0x5cf33b,_0x25acf9),_0xfd14f5);return _0x2d05c6(_0xfd14f5);});});}})[_0x5b1c('0x28')](function(_0x7e7ad3){if(_0x7e7ad3){return _0x17362b['download'](path[_0x5b1c('0x63')](_0x5cf33b,_0x25acf9),_0x25acf9,function(_0x27b0e0){if(!_0x27b0e0)fs['unlinkSync'](path[_0x5b1c('0x63')](_0x5cf33b,_0x25acf9));});}})[_0x5b1c('0x1e')](handleError(_0x17362b,null));};
\ No newline at end of file
+var _0x60f7=['fromString','rejectmessage','unix','toString','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','push','readFileSync','build','download','unlinkSync','eml-format','moment','bluebird','path','lodash','ioredis','html-to-text','api','../../config/logger','mail-interactions','../../mysqldb','defaults','socket.io-emitter','redis','html-entities','./mailMessage.socket','jayson/promise','http','client','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','json','offset','limit','count','set','Content-Range','update','destroy','status','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','MailMessage','includeAll','include','findAll','rows','show','params','find','body','catch','describe','create','secret','split','findOne','MailAccountId','CmList','CmContact','Contacts','DESC','MailServerOut','Smtp','isNil','service','host','port','authentication','user','pass','auth','secure','attachments','join','root','server/files/attachments','basename','List','List\x20not\x20found','SendMail','sendMail','messageId','format','stringify','accept','read','UserId','agent','get','MailInteraction','MailInteractionId','YYYY-MM-DD\x20HH:mm:ss','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','contact','User','fullname','internal','manual','interface','SIP/%s','motionChannel','channel','EventManager','acceptmessage','reject','mail','interaction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','ContactId','sequelize','SELECT','email'];(function(_0x4200c1,_0x3a50a6){var _0x2e44d5=function(_0x21b837){while(--_0x21b837){_0x4200c1['push'](_0x4200c1['shift']());}};_0x2e44d5(++_0x3a50a6);}(_0x60f7,0xbb));var _0x760f=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x60f7[_0x126558];return _0x1f6d14;};'use strict';var emlformat=require(_0x760f('0x0'));var moment=require(_0x760f('0x1'));var BPromise=require(_0x760f('0x2'));var util=require('util');var path=require(_0x760f('0x3'));var fs=require('fs');var _=require(_0x760f('0x4'));var Redis=require(_0x760f('0x5'));var htmlToText=require(_0x760f('0x6'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x760f('0x7'));var interaction_log=require(_0x760f('0x8'))(_0x760f('0x9'));var config=require('../../config/environment');var db=require(_0x760f('0xa'))['db'];config['redis']=_[_0x760f('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x760f('0xc'))(new Redis(config[_0x760f('0xd')]));var htmlEntities=require(_0x760f('0xe'));require(_0x760f('0xf'))['register'](socket);var jayson=require(_0x760f('0x10'));var client=jayson['client'][_0x760f('0x11')]({'port':0x232c});var client9003=jayson[_0x760f('0x12')][_0x760f('0x11')]({'port':0x232b});var client9002=jayson[_0x760f('0x12')][_0x760f('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x55c9d0,_0xb7c0b8,_0x32a8fa,_0x155aef){return new BPromise(function(_0x2a0bd5,_0x486eb1){var _0x48e8c2=_0x155aef||client;return _0x48e8c2['request'](_0x55c9d0,_0x32a8fa)[_0x760f('0x13')](function(_0x508319){logger['info'](_0x760f('0x14'),_0xb7c0b8,_0x760f('0x15'));logger[_0x760f('0x16')]('MailMessage,\x20%s,\x20%s,\x20%s',_0xb7c0b8,_0x760f('0x15'),JSON['stringify'](_0x508319));if(_0x508319[_0x760f('0x17')]){if(_0x508319['error'][_0x760f('0x18')]===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0xb7c0b8,_0x508319['error'][_0x760f('0x19')]);return _0x486eb1(_0x508319[_0x760f('0x17')][_0x760f('0x19')]);}logger[_0x760f('0x17')](_0x760f('0x14'),_0xb7c0b8,_0x508319[_0x760f('0x17')]['message']);return _0x2a0bd5(_0x508319[_0x760f('0x17')][_0x760f('0x19')]);}else{logger[_0x760f('0x1a')](_0x760f('0x14'),_0xb7c0b8,_0x760f('0x15'));_0x2a0bd5(_0x508319[_0x760f('0x1b')][_0x760f('0x19')]);}})['catch'](function(_0x2eee8b){logger[_0x760f('0x17')]('MailMessage,\x20%s,\x20%s',_0xb7c0b8,_0x2eee8b);_0x486eb1(_0x2eee8b);});});}function respondWithResult(_0x3c4ded,_0x2c3162){_0x2c3162=_0x2c3162||0xc8;return function(_0x445780){if(_0x445780){return _0x3c4ded['status'](_0x2c3162)[_0x760f('0x1c')](_0x445780);}};}function respondWithFilteredResult(_0x1a3f03,_0x331424){return function(_0x58283f){if(_0x58283f){var _0x4ed95b=typeof _0x331424[_0x760f('0x1d')]==='undefined'&&typeof _0x331424[_0x760f('0x1e')]==='undefined';var _0x26723e=_0x58283f[_0x760f('0x1f')];var _0x277a3b=_0x4ed95b?0x0:_0x331424['offset'];var _0xd70361=_0x4ed95b?_0x58283f['count']:_0x331424[_0x760f('0x1d')]+_0x331424['limit'];var _0x595473;if(_0xd70361>=_0x26723e){_0xd70361=_0x26723e;_0x595473=0xc8;}else{_0x595473=0xce;}_0x1a3f03['status'](_0x595473);return _0x1a3f03[_0x760f('0x20')](_0x760f('0x21'),_0x277a3b+'-'+_0xd70361+'/'+_0x26723e)[_0x760f('0x1c')](_0x58283f);}return null;};}function saveUpdates(_0x31af70){return function(_0x5c182e){if(_0x5c182e){return _0x5c182e[_0x760f('0x22')](_0x31af70)[_0x760f('0x13')](function(_0x1aa03a){return _0x1aa03a;});}return null;};}function removeEntity(_0x2f2b1c){return function(_0x121779){if(_0x121779){return _0x121779[_0x760f('0x23')]()[_0x760f('0x13')](function(){_0x2f2b1c[_0x760f('0x24')](0xcc)[_0x760f('0x25')]();});}};}function handleEntityNotFound(_0x257155){return function(_0x4e3136){if(!_0x4e3136){_0x257155[_0x760f('0x26')](0x194);}return _0x4e3136;};}function handleError(_0x2e0e4d,_0x54774c){_0x54774c=_0x54774c||0x1f4;return function(_0x5adf30){logger['error'](_0x5adf30[_0x760f('0x27')]);if(_0x5adf30[_0x760f('0x28')]){delete _0x5adf30[_0x760f('0x28')];}_0x2e0e4d[_0x760f('0x24')](_0x54774c)[_0x760f('0x29')](_0x5adf30);};}exports[_0x760f('0x2a')]=function(_0x5576d7,_0x330b39){var _0x7f2dcb={},_0x4ca4ac={},_0x417c43={'count':0x0,'rows':[]};var _0x352ef9=_[_0x760f('0x2b')](db['MailMessage'][_0x760f('0x2c')],function(_0x1f1a31){return{'name':_0x1f1a31[_0x760f('0x2d')],'type':_0x1f1a31[_0x760f('0x2e')][_0x760f('0x2f')]};});_0x4ca4ac[_0x760f('0x30')]=_[_0x760f('0x2b')](_0x352ef9,_0x760f('0x28'));_0x4ca4ac[_0x760f('0x31')]=_[_0x760f('0x32')](_0x5576d7['query']);_0x4ca4ac[_0x760f('0x33')]=_['intersection'](_0x4ca4ac[_0x760f('0x30')],_0x4ca4ac[_0x760f('0x31')]);_0x7f2dcb[_0x760f('0x34')]=_[_0x760f('0x35')](_0x4ca4ac['model'],qs['fields'](_0x5576d7[_0x760f('0x31')][_0x760f('0x36')]));_0x7f2dcb['attributes']=_0x7f2dcb['attributes'][_0x760f('0x37')]?_0x7f2dcb['attributes']:_0x4ca4ac[_0x760f('0x30')];if(!_0x5576d7['query'][_0x760f('0x38')](_0x760f('0x39'))){_0x7f2dcb['limit']=qs['limit'](_0x5576d7['query'][_0x760f('0x1e')]);_0x7f2dcb[_0x760f('0x1d')]=qs[_0x760f('0x1d')](_0x5576d7['query'][_0x760f('0x1d')]);}_0x7f2dcb['order']=qs[_0x760f('0x3a')](_0x5576d7['query'][_0x760f('0x3a')]);_0x7f2dcb[_0x760f('0x3b')]=qs[_0x760f('0x33')](_[_0x760f('0x3c')](_0x5576d7[_0x760f('0x31')],_0x4ca4ac['filters']),_0x352ef9);if(_0x5576d7[_0x760f('0x31')][_0x760f('0x3d')]){_0x7f2dcb['where']=_[_0x760f('0x3e')](_0x7f2dcb[_0x760f('0x3b')],{'$or':_[_0x760f('0x2b')](_0x352ef9,function(_0x362b22){if(_0x362b22[_0x760f('0x2e')]!==_0x760f('0x3f')){var _0x1b32d6={};_0x1b32d6[_0x362b22[_0x760f('0x28')]]={'$like':'%'+_0x5576d7[_0x760f('0x31')][_0x760f('0x3d')]+'%'};return _0x1b32d6;}})});}_0x7f2dcb=_[_0x760f('0x3e')]({},_0x7f2dcb,_0x5576d7[_0x760f('0x40')]);var _0x2ee8d5={'where':_0x7f2dcb[_0x760f('0x3b')]};return db[_0x760f('0x41')][_0x760f('0x1f')](_0x2ee8d5)['then'](function(_0x333269){_0x417c43[_0x760f('0x1f')]=_0x333269;if(_0x5576d7[_0x760f('0x31')][_0x760f('0x42')]){_0x7f2dcb[_0x760f('0x43')]=[{'all':!![]}];}return db[_0x760f('0x41')][_0x760f('0x44')](_0x7f2dcb);})[_0x760f('0x13')](function(_0x26b4a4){_0x417c43[_0x760f('0x45')]=_0x26b4a4;return _0x417c43;})[_0x760f('0x13')](respondWithFilteredResult(_0x330b39,_0x7f2dcb))['catch'](handleError(_0x330b39,null));};exports[_0x760f('0x46')]=function(_0x2a0c80,_0x237603){var _0x4d5c44={'raw':!![],'where':{'id':_0x2a0c80[_0x760f('0x47')]['id']}},_0x155c07={};_0x155c07[_0x760f('0x30')]=_[_0x760f('0x32')](db['MailMessage'][_0x760f('0x2c')]);_0x155c07[_0x760f('0x31')]=_[_0x760f('0x32')](_0x2a0c80[_0x760f('0x31')]);_0x155c07[_0x760f('0x33')]=_[_0x760f('0x35')](_0x155c07[_0x760f('0x30')],_0x155c07[_0x760f('0x31')]);_0x4d5c44['attributes']=_[_0x760f('0x35')](_0x155c07[_0x760f('0x30')],qs[_0x760f('0x36')](_0x2a0c80[_0x760f('0x31')][_0x760f('0x36')]));_0x4d5c44['attributes']=_0x4d5c44[_0x760f('0x34')][_0x760f('0x37')]?_0x4d5c44[_0x760f('0x34')]:_0x155c07['model'];if(_0x2a0c80[_0x760f('0x31')]['includeAll']){_0x4d5c44[_0x760f('0x43')]=[{'all':!![]}];}_0x4d5c44=_[_0x760f('0x3e')]({},_0x4d5c44,_0x2a0c80[_0x760f('0x40')]);return db[_0x760f('0x41')][_0x760f('0x48')](_0x4d5c44)[_0x760f('0x13')](handleEntityNotFound(_0x237603,null))[_0x760f('0x13')](respondWithResult(_0x237603,null))['catch'](handleError(_0x237603,null));};exports['update']=function(_0x2e092e,_0x32a3e9){if(_0x2e092e[_0x760f('0x49')]['id']){delete _0x2e092e['body']['id'];}return db['MailMessage'][_0x760f('0x48')]({'where':{'id':_0x2e092e[_0x760f('0x47')]['id']}})[_0x760f('0x13')](handleEntityNotFound(_0x32a3e9,null))[_0x760f('0x13')](saveUpdates(_0x2e092e[_0x760f('0x49')],null))[_0x760f('0x13')](respondWithResult(_0x32a3e9,null))[_0x760f('0x4a')](handleError(_0x32a3e9,null));};exports['destroy']=function(_0x3a2540,_0x46269e){return db[_0x760f('0x41')]['find']({'where':{'id':_0x3a2540[_0x760f('0x47')]['id']}})[_0x760f('0x13')](handleEntityNotFound(_0x46269e,null))[_0x760f('0x13')](removeEntity(_0x46269e,null))['catch'](handleError(_0x46269e,null));};exports[_0x760f('0x4b')]=function(_0x187809,_0x3fe52a){return db[_0x760f('0x41')][_0x760f('0x4b')]()[_0x760f('0x13')](respondWithResult(_0x3fe52a,null))['catch'](handleError(_0x3fe52a,null));};exports[_0x760f('0x4c')]=function(_0x541929,_0x482e0c){return db['MailMessage'][_0x760f('0x4c')](_0x541929[_0x760f('0x49')])[_0x760f('0x13')](function(_0x3a9f24){if(_0x3a9f24){if(_0x3a9f24['direction']==='out'&&!_0x3a9f24[_0x760f('0x4d')]){var _0x3d0936,_0x446d88,_0x568c66;if(_0x541929[_0x760f('0x49')]['to']){_0x446d88=_0x541929['body']['to'][_0x760f('0x4e')](',')[0x0];}return db['MailAccount'][_0x760f('0x4f')]({'where':{'id':_0x3a9f24[_0x760f('0x50')]},'include':[{'model':db[_0x760f('0x51')],'as':'List','include':[{'model':db[_0x760f('0x52')],'as':_0x760f('0x53'),'where':{'email':_0x446d88},'limit':0x1,'order':[['updatedAt',_0x760f('0x54')]]}]},{'model':db[_0x760f('0x55')],'as':_0x760f('0x56'),'raw':!![]}]})[_0x760f('0x13')](function(_0x509397){_0x3d0936=_0x509397;if(_0x3d0936&&_0x3d0936['Smtp']){var _0x3a4d51={'tls':{'rejectUnauthorized':![]}};if(_[_0x760f('0x57')](_0x3d0936[_0x760f('0x56')][_0x760f('0x58')])){_0x3a4d51[_0x760f('0x59')]=_0x3d0936['Smtp'][_0x760f('0x59')];_0x3a4d51[_0x760f('0x5a')]=_0x3d0936[_0x760f('0x56')][_0x760f('0x5a')];_0x3a4d51['secure']=_0x3d0936[_0x760f('0x56')]['secure'];if(_0x3d0936[_0x760f('0x56')][_0x760f('0x5b')]){_0x3a4d51['auth']={'user':_0x3d0936[_0x760f('0x56')][_0x760f('0x5c')],'pass':_0x3d0936['Smtp'][_0x760f('0x5d')]};}}else{_0x3a4d51[_0x760f('0x58')]=_0x3d0936[_0x760f('0x56')][_0x760f('0x58')];_0x3a4d51[_0x760f('0x5e')]={'user':_0x3d0936[_0x760f('0x56')][_0x760f('0x5c')],'pass':_0x3d0936['Smtp'][_0x760f('0x5d')]};_0x3a4d51[_0x760f('0x5f')]=_0x3d0936[_0x760f('0x56')][_0x760f('0x5f')];}if(_0x541929[_0x760f('0x49')][_0x760f('0x60')]&&_0x541929['body'][_0x760f('0x60')]['length']){for(var _0x32088e=0x0;_0x32088e<_0x541929[_0x760f('0x49')][_0x760f('0x60')][_0x760f('0x37')];_0x32088e+=0x1){_0x541929[_0x760f('0x49')]['attachments'][_0x32088e]={'filename':_0x541929[_0x760f('0x49')]['attachments'][_0x32088e][_0x760f('0x28')],'path':path[_0x760f('0x61')](config[_0x760f('0x62')],_0x760f('0x63'),_0x541929['body'][_0x760f('0x60')][_0x32088e][_0x760f('0x64')])};}}_0x568c66={'account':_0x3a4d51,'message':_0x541929[_0x760f('0x49')]};return;}})[_0x760f('0x13')](function(){if(_0x3d0936[_0x760f('0x65')]){if(_0x3d0936[_0x760f('0x65')][_0x760f('0x53')]['length']){return _0x3d0936[_0x760f('0x65')]['Contacts'][0x0];}else{return db[_0x760f('0x52')]['create'](_['defaults'](_0x541929[_0x760f('0x49')],{'firstName':_0x541929[_0x760f('0x49')]['to'],'email':_0x541929['body']['to'],'phone':_0x541929['body']['to'],'ListId':_0x3d0936['ListId']}));}}else{throw new Error(_0x760f('0x66'));}})[_0x760f('0x13')](function(){if(_0x568c66){return respondWithRpcPromise(_0x760f('0x67'),_0x760f('0x68'),_0x568c66,client9003)[_0x760f('0x13')](function(_0x543710){return _0x3a9f24[_0x760f('0x22')]({'read':!![],'messageId':_0x543710[_0x760f('0x69')],'sentAt':moment()[_0x760f('0x6a')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x760f('0x4a')](function(_0x42ad1b){logger['error']('%s',JSON[_0x760f('0x6b')](_0x42ad1b));return _0x3a9f24;});}return _0x3a9f24;});}return _0x3a9f24;}})['then'](respondWithResult(_0x482e0c,0xc9))[_0x760f('0x4a')](handleError(_0x482e0c,null));};exports[_0x760f('0x6c')]=function(_0x5e6181,_0x1c4c91){var _0xf3ec99={'agent':{},'channel':'mail'};if(_0x5e6181[_0x760f('0x49')]['id']){delete _0x5e6181[_0x760f('0x49')]['id'];}_0x5e6181[_0x760f('0x49')][_0x760f('0x6d')]=!![];_0x5e6181[_0x760f('0x49')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5e6181[_0x760f('0x49')][_0x760f('0x6e')]=_0x5e6181[_0x760f('0x49')][_0x760f('0x6e')]||_0x5e6181['user']['id'];_0xf3ec99[_0x760f('0x6f')]['id']=_0x5e6181[_0x760f('0x49')][_0x760f('0x6e')];return db[_0x760f('0x41')][_0x760f('0x48')]({'where':{'id':_0x5e6181[_0x760f('0x47')]['id'],'UserId':null}})[_0x760f('0x13')](handleEntityNotFound(_0x1c4c91,null))['then'](saveUpdates(_0x5e6181[_0x760f('0x49')],null))[_0x760f('0x13')](function(_0x59c274){if(_0x59c274){_0xf3ec99[_0x760f('0x19')]=_0x59c274[_0x760f('0x70')]({'plain':!![]});return db[_0x760f('0x71')][_0x760f('0x48')]({'where':{'id':_0x59c274[_0x760f('0x72')]}});}return null;})[_0x760f('0x13')](handleEntityNotFound(_0x1c4c91,null))[_0x760f('0x13')](function(_0x4354de){if(_0x4354de){return _0x4354de[_0x760f('0x22')]({'UserId':_0x5e6181['body'][_0x760f('0x6e')],'read1stAt':_[_0x760f('0x57')](_0x4354de['read1stAt'])?moment()[_0x760f('0x6a')](_0x760f('0x73')):undefined});}return null;})[_0x760f('0x13')](function(_0x5f4c7f){if(_0x5f4c7f){_0xf3ec99['interaction']=_0x5f4c7f['get']({'plain':!![]});interaction_log[_0x760f('0x1a')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5e6181[_0x760f('0x5c')]['id'],_0x5e6181[_0x760f('0x5c')][_0x760f('0x28')],_0x5e6181[_0x760f('0x5c')]['role'],_0xf3ec99['interaction']['id'],_0x5e6181[_0x760f('0x49')]?JSON[_0x760f('0x6b')](_0x5e6181[_0x760f('0x49')]):_0x760f('0x74'));return respondWithRpcPromise(_0x760f('0x75'),_0x760f('0x76'),_0xf3ec99);}return null;})['then'](function(_0x6419dc){var _0x43bcce=_0x760f('0x77')+_0x6419dc[_0x760f('0x19')]['ContactId'];return db['sequelize'][_0x760f('0x31')](_0x43bcce,{'type':db[_0x760f('0x78')][_0x760f('0x79')]['SELECT'],'raw':!![]})[_0x760f('0x13')](function(_0x15126d){return _0x15126d;});})[_0x760f('0x13')](function(_0x55b77e){if(_0x55b77e){_0xf3ec99[_0x760f('0x19')][_0x760f('0x7a')]=_0x55b77e[0x0];if(!_0x5e6181[_0x760f('0x49')]['UserId'])return;return db[_0x760f('0x7b')][_0x760f('0x48')]({'where':{'id':_0x5e6181[_0x760f('0x49')][_0x760f('0x6e')],'role':_0x760f('0x6f')},'attributes':['id','name',_0x760f('0x7c'),'email',_0x760f('0x7d')],'raw':!![]});}return null;})[_0x760f('0x13')](function(_0x56673f){if(!_0x56673f)return null;_0xf3ec99[_0x760f('0x19')][_0x760f('0x6f')]=_0x56673f;return _0xf3ec99;})['then'](function(_0x18ebc9){if(_0x18ebc9){if(_0x5e6181['body'][_0x760f('0x7e')]){_0xf3ec99[_0x760f('0x19')][_0x760f('0x7f')]=util['format'](_0x760f('0x80'),_0x5e6181[_0x760f('0x5c')][_0x760f('0x28')]);_0xf3ec99[_0x760f('0x19')]['channel']=_0xf3ec99['channel'];_0xf3ec99[_0x760f('0x19')][_0x760f('0x81')]=_0xf3ec99[_0x760f('0x82')];_0xf3ec99['message']['event']=_0x760f('0x6c');_0xf3ec99[_0x760f('0x19')][_0x760f('0x49')]=htmlToText['fromString'](_0xf3ec99['message'][_0x760f('0x49')]);return respondWithRpcPromise(_0x760f('0x83'),_0x760f('0x83'),{'event':_0x760f('0x84'),'message':_0xf3ec99['message']},client9002)[_0x760f('0x13')](function(){return _0xf3ec99;});}return _0xf3ec99;}return null;})[_0x760f('0x13')](respondWithResult(_0x1c4c91,null))[_0x760f('0x4a')](handleError(_0x1c4c91,null));};exports[_0x760f('0x85')]=function(_0x21ee6e,_0x2cbf9b){var _0x4ff2d8={'agent':{},'channel':_0x760f('0x86')};if(_0x21ee6e[_0x760f('0x49')]['id']){delete _0x21ee6e[_0x760f('0x49')]['id'];}_0x21ee6e['body'][_0x760f('0x6e')]=_0x21ee6e['body'][_0x760f('0x6e')]||_0x21ee6e[_0x760f('0x5c')]['id'];_0x4ff2d8[_0x760f('0x6f')]['id']=_0x21ee6e['body']['UserId'];return db[_0x760f('0x41')]['find']({'where':{'id':_0x21ee6e[_0x760f('0x47')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2cbf9b,null))[_0x760f('0x13')](function(_0x21fbe7){if(_0x21fbe7){_0x4ff2d8[_0x760f('0x19')]=_0x21fbe7['get']({'plain':!![]});return db['MailInteraction'][_0x760f('0x48')]({'where':{'id':_0x21fbe7[_0x760f('0x72')]}});}return null;})[_0x760f('0x13')](handleEntityNotFound(_0x2cbf9b,null))[_0x760f('0x13')](function(_0x559b67){if(_0x559b67){_0x4ff2d8[_0x760f('0x87')]=_0x559b67[_0x760f('0x70')]({'plain':!![]});interaction_log['info'](_0x760f('0x88'),_0x21ee6e[_0x760f('0x5c')]['id'],_0x21ee6e[_0x760f('0x5c')][_0x760f('0x28')],_0x21ee6e[_0x760f('0x5c')][_0x760f('0x89')],_0x4ff2d8['interaction']['id'],_0x21ee6e['body']?JSON[_0x760f('0x6b')](_0x21ee6e[_0x760f('0x49')]):'null');return respondWithRpcPromise('RejectMessage',_0x760f('0x8a'),_0x4ff2d8);}return null;})[_0x760f('0x13')](function(_0x16f17f){var _0x171e48='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x16f17f[_0x760f('0x19')][_0x760f('0x8b')];return db[_0x760f('0x8c')][_0x760f('0x31')](_0x171e48,{'type':db[_0x760f('0x78')]['QueryTypes'][_0x760f('0x8d')],'raw':!![]})[_0x760f('0x13')](function(_0x46aeb6){return _0x46aeb6;});})[_0x760f('0x13')](function(_0x26f5f6){if(_0x26f5f6){_0x4ff2d8['message'][_0x760f('0x7a')]=_0x26f5f6[0x0];if(!_0x21ee6e[_0x760f('0x49')]['UserId'])return;return db[_0x760f('0x7b')]['find']({'where':{'id':_0x21ee6e[_0x760f('0x49')]['UserId'],'role':'agent'},'attributes':['id',_0x760f('0x28'),'fullname',_0x760f('0x8e'),_0x760f('0x7d')],'raw':!![]});}return null;})['then'](function(_0x137dbe){if(!_0x137dbe)return null;_0x4ff2d8[_0x760f('0x19')][_0x760f('0x6f')]=_0x137dbe;return _0x4ff2d8;})[_0x760f('0x13')](function(_0x2c696a){if(_0x2c696a){_0x2c696a[_0x760f('0x19')]['interface']=util[_0x760f('0x6a')](_0x760f('0x80'),_0x21ee6e['user'][_0x760f('0x28')]);_0x2c696a[_0x760f('0x19')][_0x760f('0x82')]=_0x4ff2d8[_0x760f('0x82')];_0x2c696a[_0x760f('0x19')][_0x760f('0x81')]=_0x4ff2d8[_0x760f('0x82')];_0x2c696a[_0x760f('0x19')]['event']=_0x760f('0x85');_0x2c696a['message'][_0x760f('0x49')]=htmlToText[_0x760f('0x8f')](_0x4ff2d8[_0x760f('0x19')][_0x760f('0x49')]);respondWithRpcPromise('EventManager','EventManager',{'event':_0x760f('0x90'),'message':_0x2c696a['message']},client9002);return _0x4ff2d8;}return null;})[_0x760f('0x13')](respondWithResult(_0x2cbf9b,null))[_0x760f('0x4a')](handleError(_0x2cbf9b,null));};exports['download']=function(_0x254587,_0x160e9b){var _0x4bfc62=moment()[_0x760f('0x91')]()[_0x760f('0x92')]();var _0x5e5720=path['join'](config[_0x760f('0x62')],_0x760f('0x93'),_0x760f('0x94'),_0x760f('0x95'));var _0x18fd74=path['join'](config[_0x760f('0x62')],_0x760f('0x93'),'files',_0x760f('0x60'));var _0x451577=util['format'](_0x760f('0x96'),_0x4bfc62);return db[_0x760f('0x41')][_0x760f('0x48')]({'where':{'id':_0x254587['params']['id']},'attributes':['id',_0x760f('0x49'),_0x760f('0x97'),'to','cc',_0x760f('0x98'),_0x760f('0x99'),_0x760f('0x9a')],'include':_0x254587[_0x760f('0x31')][_0x760f('0x60')]?[{'model':db[_0x760f('0x9b')],'as':_0x760f('0x9c')}]:undefined})[_0x760f('0x13')](handleEntityNotFound(_0x160e9b,null))['then'](function(_0x271082){if(_0x271082){var _0x3824d9=_0x271082;var _0x3e4c47={'from':_0x3824d9[_0x760f('0x97')],'to':_0x3824d9['to'],'subject':_0x3824d9[_0x760f('0x99')],'html':htmlEntities[_0x760f('0x9d')](_0x3824d9[_0x760f('0x49')]),'headers':{'Date':moment(_0x3824d9[_0x760f('0x9a')])['format'](_0x760f('0x9e'))},'attachments':[]};if(_0x271082['cc']){_0x3e4c47[_0x760f('0x9f')]['Cc']=_0x271082['cc'];}if(_0x271082[_0x760f('0x98')]){_0x3e4c47[_0x760f('0x9f')]['Bcc']=_0x271082[_0x760f('0x98')];}return new BPromise(function(_0xad8960,_0x3d81fa){if(_0x271082[_0x760f('0x9c')]){for(var _0x22843d=0x0;_0x22843d<_0x271082[_0x760f('0x9c')][_0x760f('0x37')];_0x22843d++){var _0x1f1ec6=_0x271082[_0x760f('0x9c')][_0x22843d];var _0x1c2dc8=path[_0x760f('0x61')](_0x18fd74,_0x1f1ec6[_0x760f('0x64')]);if(fs['existsSync'](_0x1c2dc8)){_0x3e4c47[_0x760f('0x60')][_0x760f('0xa0')]({'name':_0x1f1ec6[_0x760f('0x28')],'contentType':_0x1f1ec6[_0x760f('0x2e')],'data':fs[_0x760f('0xa1')](_0x1c2dc8)});}}}emlformat[_0x760f('0xa2')](_0x3e4c47,function(_0x8464a1,_0x5cd180){if(_0x8464a1)return _0x3d81fa(_0x8464a1);fs['writeFileSync'](path[_0x760f('0x61')](_0x5e5720,_0x451577),_0x5cd180);return _0xad8960(_0x5cd180);});});}})[_0x760f('0x13')](function(_0x4f16df){if(_0x4f16df){return _0x160e9b[_0x760f('0xa3')](path[_0x760f('0x61')](_0x5e5720,_0x451577),_0x451577,function(_0x57a4d3){if(!_0x57a4d3)fs[_0x760f('0xa4')](path['join'](_0x5e5720,_0x451577));});}})['catch'](handleError(_0x160e9b,null));};
\ No newline at end of file
index dbe666c..455dd66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa11b=['hasOwnProperty','hook','exports','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','emit'];(function(_0x4cc03b,_0x299f1c){var _0xf0358c=function(_0x3d0da8){while(--_0x3d0da8){_0x4cc03b['push'](_0x4cc03b['shift']());}};_0xf0358c(++_0x299f1c);}(_0xa11b,0x1bb));var _0xba11=function(_0x2e3756,_0x32670f){_0x2e3756=_0x2e3756-0x0;var _0x442861=_0xa11b[_0x2e3756];return _0x442861;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xba11('0x0'))['db'][_0xba11('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xba11('0x2')](0x0);var events={'afterCreate':_0xba11('0x3'),'afterUpdate':_0xba11('0x4'),'afterDestroy':_0xba11('0x5')};function emitEvent(_0x4d254e){return function(_0x3dc2fa,_0x1dd19d,_0x1bc8df){MailMessageEvents[_0xba11('0x6')](_0x4d254e+':'+_0x3dc2fa['id'],_0x3dc2fa);MailMessageEvents['emit'](_0x4d254e,_0x3dc2fa);_0x1bc8df(null);};}for(var e in events){if(events[_0xba11('0x7')](e)){var event=events[e];MailMessage[_0xba11('0x8')](e,emitEvent(event));}}module[_0xba11('0x9')]=MailMessageEvents;
\ No newline at end of file
+var _0x0498=['events','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x3471da,_0x3666ef){var _0x36a452=function(_0x2de7e7){while(--_0x2de7e7){_0x3471da['push'](_0x3471da['shift']());}};_0x36a452(++_0x3666ef);}(_0x0498,0x88));var _0x8049=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x0498[_0x3e5086];return _0xfeb102;};'use strict';var EventEmitter=require(_0x8049('0x0'));var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x8049('0x1')](0x0);var events={'afterCreate':_0x8049('0x2'),'afterUpdate':_0x8049('0x3'),'afterDestroy':_0x8049('0x4')};function emitEvent(_0x49583a){return function(_0x371216,_0x1b820d,_0x337587){MailMessageEvents[_0x8049('0x5')](_0x49583a+':'+_0x371216['id'],_0x371216);MailMessageEvents[_0x8049('0x5')](_0x49583a,_0x371216);_0x337587(null);};}for(var e in events){if(events[_0x8049('0x6')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x8049('0x7')]=MailMessageEvents;
\ No newline at end of file
index e05c580..46f44a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b98=['UserId','MailInteraction','findOne','then','createdAt','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','models','direction','toLowerCase','out','secret'];(function(_0x820e1b,_0x2119c1){var _0x3f75f8=function(_0x555ec0){while(--_0x555ec0){_0x820e1b['push'](_0x820e1b['shift']());}};_0x3f75f8(++_0x2119c1);}(_0x1b98,0x16e));var _0x81b9=function(_0x2e9d3c,_0x34c14f){_0x2e9d3c=_0x2e9d3c-0x0;var _0x20ebc1=_0x1b98[_0x2e9d3c];return _0x20ebc1;};'use strict';var _=require('lodash');var util=require(_0x81b9('0x0'));var logger=require(_0x81b9('0x1'))(_0x81b9('0x2'));var moment=require(_0x81b9('0x3'));var BPromise=require(_0x81b9('0x4'));var rp=require(_0x81b9('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x81b9('0x6'));var rimraf=require('rimraf');var config=require(_0x81b9('0x7'));var attributes=require(_0x81b9('0x8'));module[_0x81b9('0x9')]=function(_0x314ee7,_0x6b8224){return _0x314ee7[_0x81b9('0xa')](_0x81b9('0xb'),attributes,{'tableName':_0x81b9('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x81b9('0xd')]},{'name':_0x81b9('0xe'),'fields':[_0x81b9('0xf'),_0x81b9('0x10')],'type':_0x81b9('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5f5d40,_0x4c737e,_0x47be58){if(_0x5f5d40[_0x81b9('0x12')]){_0x5f5d40['plainBody']=htmlToText['fromString'](_0x5f5d40[_0x81b9('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x47be58(null,_0x4c737e);},'afterCreate':function(_0xd56044,_0x3b16f6,_0x4626ba){var _0x5a8755=_0x314ee7[_0x81b9('0x13')];var _0x26f122=_0xd56044['get']({'plain':!![]});if(_0x26f122[_0x81b9('0x14')]['toLowerCase']()==='in'||_0x26f122['direction'][_0x81b9('0x15')]()===_0x81b9('0x16')&&!_0x26f122[_0x81b9('0x17')]&&!_['isNil'](_0x26f122[_0x81b9('0x18')])){_0x5a8755[_0x81b9('0x19')][_0x81b9('0x1a')]({'where':{'id':_0x26f122['MailInteractionId']}})[_0x81b9('0x1b')](function(_0x185703){if(_0x185703){_0x185703['update']({'lastMsgAt':_0x26f122[_0x81b9('0x1c')],'lastMsgDirection':_0x26f122[_0x81b9('0x14')][_0x81b9('0x15')]()});}})['catch'](function(_0x257fc7){console['error'](_0x257fc7);});}_0x4626ba();}},'charset':_0x81b9('0x1d'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x4b51=['exports','define','MailMessage','mail_messages','messageId','plainBody','subject','FULLTEXT','fromString','models','get','toLowerCase','direction','secret','isNil','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','lodash','../../config/logger','api','moment','request-promise','html-to-text','path','../../config/environment','./mailMessage.attributes'];(function(_0x4a2f68,_0x2a864d){var _0x55f946=function(_0x50b711){while(--_0x50b711){_0x4a2f68['push'](_0x4a2f68['shift']());}};_0x55f946(++_0x2a864d);}(_0x4b51,0x1e7));var _0x14b5=function(_0x44d9ab,_0x76bc69){_0x44d9ab=_0x44d9ab-0x0;var _0x31485e=_0x4b51[_0x44d9ab];return _0x31485e;};'use strict';var _=require(_0x14b5('0x0'));var util=require('util');var logger=require(_0x14b5('0x1'))(_0x14b5('0x2'));var moment=require(_0x14b5('0x3'));var BPromise=require('bluebird');var rp=require(_0x14b5('0x4'));var htmlToText=require(_0x14b5('0x5'));var fs=require('fs');var path=require(_0x14b5('0x6'));var rimraf=require('rimraf');var config=require(_0x14b5('0x7'));var attributes=require(_0x14b5('0x8'));module[_0x14b5('0x9')]=function(_0x32fe85,_0x1e4604){return _0x32fe85[_0x14b5('0xa')](_0x14b5('0xb'),attributes,{'tableName':_0x14b5('0xc'),'paranoid':![],'indexes':[{'name':_0x14b5('0xd'),'fields':[_0x14b5('0xd')]},{'name':'fti_mail_messages','fields':[_0x14b5('0xe'),_0x14b5('0xf')],'type':_0x14b5('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x36e917,_0x23c37d,_0x5171a7){if(_0x36e917['body']){_0x36e917[_0x14b5('0xe')]=htmlToText[_0x14b5('0x11')](_0x36e917['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5171a7(null,_0x23c37d);},'afterCreate':function(_0x2ca51f,_0x30a761,_0x3212e4){var _0x1c5b68=_0x32fe85[_0x14b5('0x12')];var _0x589fa4=_0x2ca51f[_0x14b5('0x13')]({'plain':!![]});if(_0x589fa4['direction'][_0x14b5('0x14')]()==='in'||_0x589fa4[_0x14b5('0x15')][_0x14b5('0x14')]()==='out'&&!_0x589fa4[_0x14b5('0x16')]&&!_[_0x14b5('0x17')](_0x589fa4['UserId'])){_0x1c5b68[_0x14b5('0x18')][_0x14b5('0x19')]({'where':{'id':_0x589fa4[_0x14b5('0x1a')]}})[_0x14b5('0x1b')](function(_0x3a42e4){if(_0x3a42e4){_0x3a42e4[_0x14b5('0x1c')]({'lastMsgAt':_0x589fa4[_0x14b5('0x1d')],'lastMsgDirection':_0x589fa4[_0x14b5('0x15')][_0x14b5('0x14')]()});}})[_0x14b5('0x1e')](function(_0x46cd26){console['error'](_0x46cd26);});}_0x3212e4();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 4792372..07c49f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0598=['CreateMailMessage','lodash','util','bluebird','../../mysqldb','../../config/utils','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','then','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailMessage,\x20%s,\x20%s','message','info','result','catch','MailMessage','create','body','raw'];(function(_0x25ccbe,_0xc935c0){var _0x289529=function(_0x478776){while(--_0x478776){_0x25ccbe['push'](_0x25ccbe['shift']());}};_0x289529(++_0xc935c0);}(_0x0598,0x92));var _0x8059=function(_0x54b0a5,_0x14387f){_0x54b0a5=_0x54b0a5-0x0;var _0x3a9b71=_0x0598[_0x54b0a5];return _0x3a9b71;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var moment=require('moment');var BPromise=require(_0x8059('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8059('0x3'))['db'];var utils=require(_0x8059('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8059('0x5'));var client=jayson[_0x8059('0x6')]['http']({'port':0x232a});config['redis']=_[_0x8059('0x7')](config[_0x8059('0x8')],{'host':_0x8059('0x9'),'port':0x18eb});var socket=require(_0x8059('0xa'))(new Redis(config['redis']));require('./mailMessage.socket')[_0x8059('0xb')](socket);function respondWithRpcPromise(_0x1bf5fd,_0x336f85,_0x5097d6){return new BPromise(function(_0x283b63,_0x52a60d){return client['request'](_0x1bf5fd,_0x5097d6)[_0x8059('0xc')](function(_0x4109a9){logger['info']('MailMessage,\x20%s,\x20%s',_0x336f85,'request\x20sent');logger[_0x8059('0xd')](_0x8059('0xe'),_0x336f85,_0x8059('0xf'),JSON[_0x8059('0x10')](_0x4109a9));if(_0x4109a9[_0x8059('0x11')]){if(_0x4109a9['error'][_0x8059('0x12')]===0x1f4){logger['error'](_0x8059('0x13'),_0x336f85,_0x4109a9['error'][_0x8059('0x14')]);return _0x52a60d(_0x4109a9[_0x8059('0x11')][_0x8059('0x14')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x336f85,_0x4109a9['error'][_0x8059('0x14')]);return _0x283b63(_0x4109a9[_0x8059('0x11')][_0x8059('0x14')]);}else{logger[_0x8059('0x15')](_0x8059('0x13'),_0x336f85,'request\x20sent');_0x283b63(_0x4109a9[_0x8059('0x16')][_0x8059('0x14')]);}})[_0x8059('0x17')](function(_0x1c4566){logger['error'](_0x8059('0x13'),_0x336f85,_0x1c4566);_0x52a60d(_0x1c4566);});});}exports['CreateMailMessage']=function(_0x113f42){var _0x493825=this;return new Promise(function(_0x1857c1,_0x56d794){return db[_0x8059('0x18')][_0x8059('0x19')](_0x113f42[_0x8059('0x1a')],{'raw':_0x113f42['options']?_0x113f42['options'][_0x8059('0x1b')]===undefined?!![]:![]:!![]})[_0x8059('0xc')](function(_0x32aeda){logger[_0x8059('0x15')]('CreateMailMessage',_0x113f42);logger[_0x8059('0xd')](_0x8059('0x1c'),_0x113f42,JSON[_0x8059('0x10')](_0x32aeda));_0x1857c1(_0x32aeda);})['catch'](function(_0xe9a72d){logger[_0x8059('0x11')](_0x8059('0x1c'),_0xe9a72d[_0x8059('0x14')],_0x113f42);_0x56d794(_0x493825['error'](0x1f4,_0xe9a72d[_0x8059('0x14')]));});});};
\ No newline at end of file
+var _0x7708=['info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateMailMessage','MailMessage','create','options','raw','catch','lodash','util','bluebird','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x7708,0x188));var _0x8770=function(_0x1ee9a1,_0x5f1434){_0x1ee9a1=_0x1ee9a1-0x0;var _0x21270f=_0x7708[_0x1ee9a1];return _0x21270f;};'use strict';var _=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var moment=require('moment');var BPromise=require(_0x8770('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(_0x8770('0x3'))(_0x8770('0x4'));var config=require('../../config/environment');var jayson=require(_0x8770('0x5'));var client=jayson['client'][_0x8770('0x6')]({'port':0x232a});config[_0x8770('0x7')]=_[_0x8770('0x8')](config[_0x8770('0x7')],{'host':_0x8770('0x9'),'port':0x18eb});var socket=require(_0x8770('0xa'))(new Redis(config[_0x8770('0x7')]));require('./mailMessage.socket')[_0x8770('0xb')](socket);function respondWithRpcPromise(_0x2ca830,_0x3f357a,_0x4e4551){return new BPromise(function(_0x390af0,_0x10e4a3){return client[_0x8770('0xc')](_0x2ca830,_0x4e4551)[_0x8770('0xd')](function(_0x4a0ca1){logger[_0x8770('0xe')](_0x8770('0xf'),_0x3f357a,_0x8770('0x10'));logger['debug'](_0x8770('0x11'),_0x3f357a,_0x8770('0x10'),JSON[_0x8770('0x12')](_0x4a0ca1));if(_0x4a0ca1[_0x8770('0x13')]){if(_0x4a0ca1[_0x8770('0x13')][_0x8770('0x14')]===0x1f4){logger[_0x8770('0x13')](_0x8770('0xf'),_0x3f357a,_0x4a0ca1['error'][_0x8770('0x15')]);return _0x10e4a3(_0x4a0ca1[_0x8770('0x13')]['message']);}logger[_0x8770('0x13')]('MailMessage,\x20%s,\x20%s',_0x3f357a,_0x4a0ca1[_0x8770('0x13')]['message']);return _0x390af0(_0x4a0ca1['error']['message']);}else{logger[_0x8770('0xe')](_0x8770('0xf'),_0x3f357a,_0x8770('0x10'));_0x390af0(_0x4a0ca1[_0x8770('0x16')]['message']);}})['catch'](function(_0x349bd4){logger[_0x8770('0x13')](_0x8770('0xf'),_0x3f357a,_0x349bd4);_0x10e4a3(_0x349bd4);});});}exports[_0x8770('0x17')]=function(_0x4d2c7e){var _0x4e1fa6=this;return new Promise(function(_0x3e1fe7,_0x1234dd){return db[_0x8770('0x18')][_0x8770('0x19')](_0x4d2c7e['body'],{'raw':_0x4d2c7e['options']?_0x4d2c7e[_0x8770('0x1a')][_0x8770('0x1b')]===undefined?!![]:![]:!![]})[_0x8770('0xd')](function(_0x2918a7){logger[_0x8770('0xe')](_0x8770('0x17'),_0x4d2c7e);logger['debug'](_0x8770('0x17'),_0x4d2c7e,JSON[_0x8770('0x12')](_0x2918a7));_0x3e1fe7(_0x2918a7);})[_0x8770('0x1c')](function(_0x2515c5){logger['error'](_0x8770('0x17'),_0x2515c5['message'],_0x4d2c7e);_0x1234dd(_0x4e1fa6[_0x8770('0x13')](0x1f4,_0x2515c5[_0x8770('0x15')]));});});};
\ No newline at end of file
index 487ff1a..42a564c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x136c=['emit','removeListener','register','length','./mailMessage.events','save','update'];(function(_0x291aaf,_0x4c6d8d){var _0x5571e6=function(_0x1b4fec){while(--_0x1b4fec){_0x291aaf['push'](_0x291aaf['shift']());}};_0x5571e6(++_0x4c6d8d);}(_0x136c,0x1d2));var _0xc136=function(_0x1648a6,_0x38e0f3){_0x1648a6=_0x1648a6-0x0;var _0x161a07=_0x136c[_0x1648a6];return _0x161a07;};'use strict';var MailMessageEvents=require(_0xc136('0x0'));var events=[_0xc136('0x1'),'remove',_0xc136('0x2')];function createListener(_0x3b4cbd,_0x34c789){return function(_0x15181c){_0x34c789[_0xc136('0x3')](_0x3b4cbd,_0x15181c);};}function removeListener(_0x9e2e9d,_0x19565a){return function(){MailMessageEvents[_0xc136('0x4')](_0x9e2e9d,_0x19565a);};}exports[_0xc136('0x5')]=function(_0x586570){for(var _0x1ac41b=0x0,_0x594112=events[_0xc136('0x6')];_0x1ac41b<_0x594112;_0x1ac41b++){var _0x3993f2=events[_0x1ac41b];var _0x1804c1=createListener('mailMessage:'+_0x3993f2,_0x586570);MailMessageEvents['on'](_0x3993f2,_0x1804c1);}};
\ No newline at end of file
+var _0x1d60=['length','mailMessage:','update','emit','removeListener'];(function(_0x51b1e4,_0x164131){var _0x587d06=function(_0x20f408){while(--_0x20f408){_0x51b1e4['push'](_0x51b1e4['shift']());}};_0x587d06(++_0x164131);}(_0x1d60,0xe8));var _0x01d6=function(_0x59fe15,_0x426a79){_0x59fe15=_0x59fe15-0x0;var _0x2c6d9c=_0x1d60[_0x59fe15];return _0x2c6d9c;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=['save','remove',_0x01d6('0x0')];function createListener(_0x3de8c7,_0xa743fa){return function(_0x16f460){_0xa743fa[_0x01d6('0x1')](_0x3de8c7,_0x16f460);};}function removeListener(_0x36a016,_0x486b9b){return function(){MailMessageEvents[_0x01d6('0x2')](_0x36a016,_0x486b9b);};}exports['register']=function(_0x1cee6b){for(var _0xd09b99=0x0,_0x4e0aca=events[_0x01d6('0x3')];_0xd09b99<_0x4e0aca;_0xd09b99++){var _0x19809c=events[_0xd09b99];var _0x1de5bb=createListener(_0x01d6('0x4')+_0x19809c,_0x1cee6b);MailMessageEvents['on'](_0x19809c,_0x1de5bb);}};
\ No newline at end of file
index 3558403..082b8c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e3a=['post','addTeams','/:id/users','put','/:id','update','destroy','removeTeams','delete','removeAgents','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','getMembers','/:id/teams','getTeams','getAgents'];(function(_0x2b30fb,_0x33508d){var _0x3826e4=function(_0x34468f){while(--_0x34468f){_0x2b30fb['push'](_0x2b30fb['shift']());}};_0x3826e4(++_0x33508d);}(_0x0e3a,0x107));var _0xa0e3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0e3a[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xa0e3('0x0'));var util=require(_0xa0e3('0x1'));var path=require('path');var timeout=require(_0xa0e3('0x2'));var express=require('express');var router=express[_0xa0e3('0x3')]();var fs_extra=require(_0xa0e3('0x4'));var auth=require(_0xa0e3('0x5'));var interaction=require(_0xa0e3('0x6'));var config=require(_0xa0e3('0x7'));var controller=require('./mailQueue.controller');router[_0xa0e3('0x8')]('/',auth[_0xa0e3('0x9')](),controller[_0xa0e3('0xa')]);router[_0xa0e3('0x8')](_0xa0e3('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xa0e3('0x8')]('/:id',auth[_0xa0e3('0x9')](),controller[_0xa0e3('0xc')]);router[_0xa0e3('0x8')]('/:id/members',auth[_0xa0e3('0x9')](),controller[_0xa0e3('0xd')]);router['get'](_0xa0e3('0xe'),auth[_0xa0e3('0x9')](),controller[_0xa0e3('0xf')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0xa0e3('0x10')]);router['post']('/',auth[_0xa0e3('0x9')](),controller['create']);router[_0xa0e3('0x11')]('/:id/teams',auth[_0xa0e3('0x9')](),controller[_0xa0e3('0x12')]);router[_0xa0e3('0x11')](_0xa0e3('0x13'),auth[_0xa0e3('0x9')](),controller['addAgents']);router[_0xa0e3('0x14')](_0xa0e3('0x15'),auth['isAuthenticated'](),controller[_0xa0e3('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa0e3('0x17')]);router['delete'](_0xa0e3('0xe'),auth[_0xa0e3('0x9')](),controller[_0xa0e3('0x18')]);router[_0xa0e3('0x19')]('/:id/users',auth['isAuthenticated'](),controller[_0xa0e3('0x1a')]);module[_0xa0e3('0x1b')]=router;
\ No newline at end of file
+var _0x670a=['/:id/users','getAgents','post','create','addTeams','put','update','destroy','removeTeams','delete','removeAgents','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','get','index','/describe','describe','/:id','isAuthenticated','getMembers','/:id/teams','getTeams'];(function(_0x45defb,_0x5ca043){var _0x463ec0=function(_0x43b660){while(--_0x43b660){_0x45defb['push'](_0x45defb['shift']());}};_0x463ec0(++_0x5ca043);}(_0x670a,0x1df));var _0xa670=function(_0x247244,_0x3642e4){_0x247244=_0x247244-0x0;var _0x821314=_0x670a[_0x247244];return _0x821314;};'use strict';var multer=require(_0xa670('0x0'));var util=require(_0xa670('0x1'));var path=require(_0xa670('0x2'));var timeout=require(_0xa670('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa670('0x4'));var auth=require(_0xa670('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailQueue.controller');router[_0xa670('0x6')]('/',auth['isAuthenticated'](),controller[_0xa670('0x7')]);router['get'](_0xa670('0x8'),auth['isAuthenticated'](),controller[_0xa670('0x9')]);router[_0xa670('0x6')](_0xa670('0xa'),auth[_0xa670('0xb')](),controller['show']);router[_0xa670('0x6')]('/:id/members',auth['isAuthenticated'](),controller[_0xa670('0xc')]);router[_0xa670('0x6')](_0xa670('0xd'),auth[_0xa670('0xb')](),controller[_0xa670('0xe')]);router[_0xa670('0x6')](_0xa670('0xf'),auth[_0xa670('0xb')](),controller[_0xa670('0x10')]);router[_0xa670('0x11')]('/',auth['isAuthenticated'](),controller[_0xa670('0x12')]);router[_0xa670('0x11')](_0xa670('0xd'),auth[_0xa670('0xb')](),controller[_0xa670('0x13')]);router[_0xa670('0x11')](_0xa670('0xf'),auth[_0xa670('0xb')](),controller['addAgents']);router[_0xa670('0x14')](_0xa670('0xa'),auth['isAuthenticated'](),controller[_0xa670('0x15')]);router['delete'](_0xa670('0xa'),auth['isAuthenticated'](),controller[_0xa670('0x16')]);router['delete']('/:id/teams',auth[_0xa670('0xb')](),controller[_0xa670('0x17')]);router[_0xa670('0x18')](_0xa670('0xf'),auth[_0xa670('0xb')](),controller[_0xa670('0x19')]);module['exports']=router;
\ No newline at end of file
index 5ca868e..017b760 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed81=['ENUM','beepall','sequelize','STRING','name','INTEGER'];(function(_0x2480e0,_0x291db4){var _0x397756=function(_0x199868){while(--_0x199868){_0x2480e0['push'](_0x2480e0['shift']());}};_0x397756(++_0x291db4);}(_0xed81,0x194));var _0x1ed8=function(_0x1de10d,_0xd2d326){_0x1de10d=_0x1de10d-0x0;var _0x58c616=_0xed81[_0x1de10d];return _0x58c616;};'use strict';var Sequelize=require(_0x1ed8('0x0'));module['exports']={'name':{'type':Sequelize[_0x1ed8('0x1')],'unique':_0x1ed8('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1ed8('0x1')]},'timeout':{'type':Sequelize[_0x1ed8('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1ed8('0x4')]('rrmemory',_0x1ed8('0x5'),'roundrobin')}};
\ No newline at end of file
+var _0x72b0=['INTEGER','ENUM','rrmemory','roundrobin','exports','STRING','name'];(function(_0x40aac5,_0x5d8733){var _0x343d40=function(_0x51bdbc){while(--_0x51bdbc){_0x40aac5['push'](_0x40aac5['shift']());}};_0x343d40(++_0x5d8733);}(_0x72b0,0x146));var _0x072b=function(_0x25cbf7,_0x5d7203){_0x25cbf7=_0x25cbf7-0x0;var _0x186792=_0x72b0[_0x25cbf7];return _0x186792;};'use strict';var Sequelize=require('sequelize');module[_0x072b('0x0')]={'name':{'type':Sequelize[_0x072b('0x1')],'unique':_0x072b('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x072b('0x1')]},'timeout':{'type':Sequelize[_0x072b('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x072b('0x4')](_0x072b('0x5'),'beepall',_0x072b('0x6'))}};
\ No newline at end of file
index b272540..57d773b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb05d=['params','rawAttributes','include','create','body','get','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','nolimit','pick','MailQueueId','UserMailQueue','User','findAndCountAll','UserId','agent','createdAt','format','%s/%s','SIP','updatedAt','getTeams','findOne','Team','addTeams','ids','online','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','userMailQueue:save','removeTeams','select','field','from','team_has_mail_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','every','TeamId','includes','union','value','isEmpty','removeAgents','forEach','userMailQueue:remove','omit','spread','emit','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','MailQueues','UserProfileResource','error','stack','name','index','MailQueue','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show'];(function(_0x1dc591,_0x22643a){var _0x2d107b=function(_0x2acfbf){while(--_0x2acfbf){_0x1dc591['push'](_0x1dc591['shift']());}};_0x2d107b(++_0x22643a);}(_0xb05d,0x1d9));var _0xdb05=function(_0x22b39b,_0x2b7d63){_0x22b39b=_0x22b39b-0x0;var _0x280e1d=_0xb05d[_0x22b39b];return _0x280e1d;};'use strict';var emlformat=require(_0xdb05('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdb05('0x1'));var jsonpatch=require(_0xdb05('0x2'));var rp=require('request-promise');var moment=require(_0xdb05('0x3'));var BPromise=require(_0xdb05('0x4'));var Mustache=require(_0xdb05('0x5'));var util=require(_0xdb05('0x6'));var path=require(_0xdb05('0x7'));var sox=require(_0xdb05('0x8'));var csv=require(_0xdb05('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdb05('0xa'));var squel=require('squel');var crypto=require(_0xdb05('0xb'));var jsforce=require(_0xdb05('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xdb05('0x9'));var querystring=require(_0xdb05('0xd'));var Papa=require('papaparse');var Redis=require(_0xdb05('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xdb05('0xf'));var as=require(_0xdb05('0x10'));var hardwareService=require(_0xdb05('0x11'));var logger=require(_0xdb05('0x12'))(_0xdb05('0x13'));var utils=require(_0xdb05('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdb05('0x15'))['db'];config['redis']=_['defaults'](config[_0xdb05('0x16')],{'host':_0xdb05('0x17'),'port':0x18eb});var socket=require(_0xdb05('0x18'))(new Redis(config[_0xdb05('0x16')]));require(_0xdb05('0x19'))['register'](socket);function respondWithStatusCode(_0x13f732,_0x17fa58){_0x17fa58=_0x17fa58||0xcc;return function(_0x27dd6e){if(_0x27dd6e){return _0x13f732[_0xdb05('0x1a')](_0x17fa58);}return _0x13f732[_0xdb05('0x1b')](_0x17fa58)[_0xdb05('0x1c')]();};}function respondWithResult(_0x341739,_0x53234b){_0x53234b=_0x53234b||0xc8;return function(_0x42b2cd){if(_0x42b2cd){return _0x341739['status'](_0x53234b)[_0xdb05('0x1d')](_0x42b2cd);}};}function respondWithFilteredResult(_0x5c1d22,_0x34399f){return function(_0x870eec){if(_0x870eec){var _0x805a5c=typeof _0x34399f[_0xdb05('0x1e')]===_0xdb05('0x1f')&&typeof _0x34399f[_0xdb05('0x20')]===_0xdb05('0x1f');var _0x1e64a1=_0x870eec[_0xdb05('0x21')];var _0x4a4e52=_0x805a5c?0x0:_0x34399f[_0xdb05('0x1e')];var _0x4189f9=_0x805a5c?_0x870eec[_0xdb05('0x21')]:_0x34399f[_0xdb05('0x1e')]+_0x34399f[_0xdb05('0x20')];var _0x211248;if(_0x4189f9>=_0x1e64a1){_0x4189f9=_0x1e64a1;_0x211248=0xc8;}else{_0x211248=0xce;}_0x5c1d22[_0xdb05('0x1b')](_0x211248);return _0x5c1d22[_0xdb05('0x22')](_0xdb05('0x23'),_0x4a4e52+'-'+_0x4189f9+'/'+_0x1e64a1)[_0xdb05('0x1d')](_0x870eec);}return null;};}function patchUpdates(_0x9dea2c){return function(_0x52e6ef){try{jsonpatch[_0xdb05('0x24')](_0x52e6ef,_0x9dea2c,!![]);}catch(_0x5f4b0c){return BPromise['reject'](_0x5f4b0c);}return _0x52e6ef[_0xdb05('0x25')]();};}function saveUpdates(_0x53786d,_0x1664c6){return function(_0x12b7f3){if(_0x12b7f3){return _0x12b7f3[_0xdb05('0x26')](_0x53786d)[_0xdb05('0x27')](function(_0x35c67e){return _0x35c67e;});}return null;};}function removeEntity(_0x385ac2,_0x4fe53a){return function(_0x5a1a73){if(_0x5a1a73){return _0x5a1a73[_0xdb05('0x28')]()[_0xdb05('0x27')](function(){var _0x37d1f7=_0x5a1a73['get']({'plain':!![]});var _0x5a4936=_0xdb05('0x29');return db[_0xdb05('0x2a')]['destroy']({'where':{'type':_0x5a4936,'resourceId':_0x37d1f7['id']}})[_0xdb05('0x27')](function(){return _0x5a1a73;});})[_0xdb05('0x27')](function(){_0x385ac2[_0xdb05('0x1b')](0xcc)[_0xdb05('0x1c')]();});}};}function handleEntityNotFound(_0x22666e,_0x1454f9){return function(_0x31755d){if(!_0x31755d){_0x22666e[_0xdb05('0x1a')](0x194);}return _0x31755d;};}function handleError(_0x256005,_0x31bd49){_0x31bd49=_0x31bd49||0x1f4;return function(_0x2fa3c5){logger[_0xdb05('0x2b')](_0x2fa3c5[_0xdb05('0x2c')]);if(_0x2fa3c5[_0xdb05('0x2d')]){delete _0x2fa3c5[_0xdb05('0x2d')];}_0x256005[_0xdb05('0x1b')](_0x31bd49)['send'](_0x2fa3c5);};}exports[_0xdb05('0x2e')]=function(_0x2c9398,_0x5f234){var _0xe32c67={},_0x5e0311={},_0x5d8c67={'count':0x0,'rows':[]};var _0x428908=_['map'](db[_0xdb05('0x2f')]['rawAttributes'],function(_0x387b23){return{'name':_0x387b23['fieldName'],'type':_0x387b23['type']['key']};});_0x5e0311['model']=_[_0xdb05('0x30')](_0x428908,_0xdb05('0x2d'));_0x5e0311[_0xdb05('0x31')]=_[_0xdb05('0x32')](_0x2c9398['query']);_0x5e0311[_0xdb05('0x33')]=_['intersection'](_0x5e0311[_0xdb05('0x34')],_0x5e0311[_0xdb05('0x31')]);_0xe32c67[_0xdb05('0x35')]=_[_0xdb05('0x36')](_0x5e0311[_0xdb05('0x34')],qs[_0xdb05('0x37')](_0x2c9398[_0xdb05('0x31')]['fields']));_0xe32c67['attributes']=_0xe32c67[_0xdb05('0x35')][_0xdb05('0x38')]?_0xe32c67[_0xdb05('0x35')]:_0x5e0311[_0xdb05('0x34')];if(!_0x2c9398[_0xdb05('0x31')][_0xdb05('0x39')]('nolimit')){_0xe32c67[_0xdb05('0x20')]=qs[_0xdb05('0x20')](_0x2c9398[_0xdb05('0x31')]['limit']);_0xe32c67[_0xdb05('0x1e')]=qs[_0xdb05('0x1e')](_0x2c9398['query'][_0xdb05('0x1e')]);}_0xe32c67[_0xdb05('0x3a')]=qs[_0xdb05('0x3b')](_0x2c9398[_0xdb05('0x31')]['sort']);_0xe32c67[_0xdb05('0x3c')]=qs[_0xdb05('0x33')](_['pick'](_0x2c9398['query'],_0x5e0311[_0xdb05('0x33')]),_0x428908);if(_0x2c9398['query'][_0xdb05('0x3d')]){_0xe32c67[_0xdb05('0x3c')]=_[_0xdb05('0x3e')](_0xe32c67[_0xdb05('0x3c')],{'$or':_[_0xdb05('0x30')](_0x428908,function(_0x137ac2){if(_0x137ac2[_0xdb05('0x3f')]!==_0xdb05('0x40')){var _0x4011c3={};_0x4011c3[_0x137ac2['name']]={'$like':'%'+_0x2c9398[_0xdb05('0x31')][_0xdb05('0x3d')]+'%'};return _0x4011c3;}})});}_0xe32c67=_[_0xdb05('0x3e')]({},_0xe32c67,_0x2c9398[_0xdb05('0x41')]);var _0x21b52d={'where':_0xe32c67[_0xdb05('0x3c')]};return db[_0xdb05('0x2f')]['count'](_0x21b52d)[_0xdb05('0x27')](function(_0x4082bd){_0x5d8c67[_0xdb05('0x21')]=_0x4082bd;if(_0x2c9398[_0xdb05('0x31')][_0xdb05('0x42')]){_0xe32c67['include']=[{'all':!![]}];}return db['MailQueue'][_0xdb05('0x43')](_0xe32c67);})[_0xdb05('0x27')](function(_0x48a7d8){_0x5d8c67[_0xdb05('0x44')]=_0x48a7d8;return _0x5d8c67;})[_0xdb05('0x27')](respondWithFilteredResult(_0x5f234,_0xe32c67))[_0xdb05('0x45')](handleError(_0x5f234,null));};exports[_0xdb05('0x46')]=function(_0x551b20,_0x8d421f){var _0x522b4f={'raw':!![],'where':{'id':_0x551b20[_0xdb05('0x47')]['id']}},_0x7c970e={};_0x7c970e['model']=_['keys'](db[_0xdb05('0x2f')][_0xdb05('0x48')]);_0x7c970e[_0xdb05('0x31')]=_[_0xdb05('0x32')](_0x551b20[_0xdb05('0x31')]);_0x7c970e['filters']=_[_0xdb05('0x36')](_0x7c970e['model'],_0x7c970e[_0xdb05('0x31')]);_0x522b4f[_0xdb05('0x35')]=_[_0xdb05('0x36')](_0x7c970e['model'],qs['fields'](_0x551b20[_0xdb05('0x31')][_0xdb05('0x37')]));_0x522b4f['attributes']=_0x522b4f[_0xdb05('0x35')][_0xdb05('0x38')]?_0x522b4f[_0xdb05('0x35')]:_0x7c970e[_0xdb05('0x34')];if(_0x551b20[_0xdb05('0x31')][_0xdb05('0x42')]){_0x522b4f[_0xdb05('0x49')]=[{'all':!![]}];}_0x522b4f=_[_0xdb05('0x3e')]({},_0x522b4f,_0x551b20['options']);return db['MailQueue']['find'](_0x522b4f)[_0xdb05('0x27')](handleEntityNotFound(_0x8d421f,null))[_0xdb05('0x27')](respondWithResult(_0x8d421f,null))[_0xdb05('0x45')](handleError(_0x8d421f,null));};exports[_0xdb05('0x4a')]=function(_0x1b878f,_0x333d1f){return db[_0xdb05('0x2f')][_0xdb05('0x4a')](_0x1b878f[_0xdb05('0x4b')],{})[_0xdb05('0x27')](function(_0x370f8f){var _0x17f21=_0x1b878f['user'][_0xdb05('0x4c')]({'plain':!![]});if(!_0x17f21)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x17f21[_0xdb05('0x4d')]==='user'){var _0x43b671=_0x370f8f[_0xdb05('0x4c')]({'plain':!![]});var _0x41630d=_0xdb05('0x29');return db[_0xdb05('0x4e')][_0xdb05('0x4f')]({'where':{'name':_0x41630d,'userProfileId':_0x17f21[_0xdb05('0x50')]},'raw':!![]})[_0xdb05('0x27')](function(_0x385554){if(_0x385554&&_0x385554[_0xdb05('0x51')]===0x0){return db['UserProfileResource'][_0xdb05('0x4a')]({'name':_0x43b671['name'],'resourceId':_0x43b671['id'],'type':_0x385554[_0xdb05('0x2d')],'sectionId':_0x385554['id']},{})[_0xdb05('0x27')](function(){return _0x370f8f;});}else{return _0x370f8f;}})['catch'](function(_0x371620){logger[_0xdb05('0x2b')](_0xdb05('0x52'),_0x371620);throw _0x371620;});}return _0x370f8f;})[_0xdb05('0x27')](respondWithResult(_0x333d1f,0xc9))[_0xdb05('0x45')](handleError(_0x333d1f,null));};exports[_0xdb05('0x26')]=function(_0x163d62,_0x384bc8){if(_0x163d62[_0xdb05('0x4b')]['id']){delete _0x163d62[_0xdb05('0x4b')]['id'];}return db['MailQueue'][_0xdb05('0x4f')]({'where':{'id':_0x163d62[_0xdb05('0x47')]['id']}})[_0xdb05('0x27')](handleEntityNotFound(_0x384bc8,null))['then'](saveUpdates(_0x163d62[_0xdb05('0x4b')],null))[_0xdb05('0x27')](respondWithResult(_0x384bc8,null))[_0xdb05('0x45')](handleError(_0x384bc8,null));};exports[_0xdb05('0x28')]=function(_0x5457aa,_0x35fef8){return db[_0xdb05('0x2f')][_0xdb05('0x4f')]({'where':{'id':_0x5457aa[_0xdb05('0x47')]['id']}})['then'](handleEntityNotFound(_0x35fef8,null))['then'](removeEntity(_0x35fef8,null))[_0xdb05('0x45')](handleError(_0x35fef8,null));};exports[_0xdb05('0x53')]=function(_0x4cb84d,_0x228149){return db[_0xdb05('0x2f')][_0xdb05('0x53')]()[_0xdb05('0x27')](respondWithResult(_0x228149,null))[_0xdb05('0x45')](handleError(_0x228149,null));};exports[_0xdb05('0x54')]=function(_0x4fac2b,_0x44f0a1,_0x5726e0){var _0x447218={'raw':!![],'where':{}},_0x5c0b06={},_0x3179b4;return db[_0xdb05('0x2f')]['findOne']({'where':{'id':_0x4fac2b[_0xdb05('0x47')]['id']}})[_0xdb05('0x27')](handleEntityNotFound(_0x44f0a1,null))['then'](function(_0x4b1ea0){if(_0x4b1ea0){_0x3179b4=_0x4b1ea0[_0xdb05('0x4c')]({'plain':!![]});_0x5c0b06[_0xdb05('0x34')]=_[_0xdb05('0x32')](db['UserMailQueue'][_0xdb05('0x48')]);_0x5c0b06[_0xdb05('0x31')]=_['keys'](_0x4fac2b[_0xdb05('0x31')]);_0x5c0b06['filters']=_[_0xdb05('0x36')](_0x5c0b06[_0xdb05('0x34')],_0x5c0b06['query']);_0x447218[_0xdb05('0x35')]=_[_0xdb05('0x36')](_0x5c0b06[_0xdb05('0x34')],qs['fields'](_0x4fac2b['query']['fields']));_0x447218[_0xdb05('0x35')]=_0x447218['attributes']['length']?_0x447218[_0xdb05('0x35')]:_0x5c0b06['model'];if(!_0x4fac2b['query']['hasOwnProperty'](_0xdb05('0x55'))){_0x447218[_0xdb05('0x20')]=qs[_0xdb05('0x20')](_0x4fac2b['query'][_0xdb05('0x20')]);_0x447218['offset']=qs[_0xdb05('0x1e')](_0x4fac2b[_0xdb05('0x31')][_0xdb05('0x1e')]);}_0x447218['order']=qs[_0xdb05('0x3b')](_0x4fac2b[_0xdb05('0x31')][_0xdb05('0x3b')]);_0x447218[_0xdb05('0x3c')]=qs[_0xdb05('0x33')](_[_0xdb05('0x56')](_0x4fac2b[_0xdb05('0x31')],_0x5c0b06[_0xdb05('0x33')]));_0x447218['where'][_0xdb05('0x57')]=_0x4b1ea0['id'];if(_0x4fac2b[_0xdb05('0x31')][_0xdb05('0x3d')]){_0x447218[_0xdb05('0x3c')]=_[_0xdb05('0x3e')](_0x447218['where'],{'$or':_[_0xdb05('0x30')](_0x447218['attributes'],function(_0x5f1ca1){var _0x1f6e55={};_0x1f6e55[_0x5f1ca1]={'$like':'%'+_0x4fac2b['query'][_0xdb05('0x3d')]+'%'};return _0x1f6e55;})});}_0x447218=_[_0xdb05('0x3e')]({},_0x447218,_0x4fac2b['options']);return db[_0xdb05('0x58')][_0xdb05('0x43')](_0x447218);}})[_0xdb05('0x27')](function(_0x26083c){if(_0x26083c){return db[_0xdb05('0x59')][_0xdb05('0x5a')]({'where':{'id':_['map'](_0x26083c,_0xdb05('0x5b')),'role':_0xdb05('0x5c')},'attributes':['id',_0xdb05('0x2d'),'mailPause','updatedAt',_0xdb05('0x5d')]});}})[_0xdb05('0x27')](function(_0x34593e){if(_0x34593e){return{'count':_0x34593e['count'],'rows':_[_0xdb05('0x30')](_0x34593e['rows'],function(_0x2079c8){return{'membername':_0x2079c8['name'],'UserId':_0x2079c8['id'],'queue_name':_0x3179b4[_0xdb05('0x2d')],'MailQueueId':_0x3179b4['id'],'interface':util[_0xdb05('0x5e')](_0xdb05('0x5f'),_0xdb05('0x60'),_0x2079c8[_0xdb05('0x2d')]),'penalty':0x0,'paused':_0x2079c8['mailPause'],'createdAt':_0x2079c8[_0xdb05('0x5d')],'updatedAt':_0x2079c8[_0xdb05('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xdb05('0x27')](respondWithFilteredResult(_0x44f0a1,_0x447218))[_0xdb05('0x45')](handleError(_0x44f0a1,null));};exports[_0xdb05('0x62')]=function(_0x5a56cc,_0x2609b6,_0x50bece){var _0x4f04ef={};var _0x5ec74a={};var _0x33a616;var _0x5a553d;return db[_0xdb05('0x2f')][_0xdb05('0x63')]({'where':{'id':_0x5a56cc[_0xdb05('0x47')]['id']}})[_0xdb05('0x27')](handleEntityNotFound(_0x2609b6,null))['then'](function(_0x942173){if(_0x942173){_0x33a616=_0x942173;_0x5ec74a[_0xdb05('0x34')]=_[_0xdb05('0x32')](db[_0xdb05('0x64')][_0xdb05('0x48')]);_0x5ec74a[_0xdb05('0x31')]=_[_0xdb05('0x32')](_0x5a56cc[_0xdb05('0x31')]);_0x5ec74a['filters']=_[_0xdb05('0x36')](_0x5ec74a['model'],_0x5ec74a[_0xdb05('0x31')]);_0x4f04ef['attributes']=_[_0xdb05('0x36')](_0x5ec74a[_0xdb05('0x34')],qs['fields'](_0x5a56cc[_0xdb05('0x31')]['fields']));_0x4f04ef[_0xdb05('0x35')]=_0x4f04ef[_0xdb05('0x35')][_0xdb05('0x38')]?_0x4f04ef['attributes']:_0x5ec74a['model'];_0x4f04ef['order']=qs[_0xdb05('0x3b')](_0x5a56cc[_0xdb05('0x31')]['sort']);_0x4f04ef[_0xdb05('0x3c')]=qs[_0xdb05('0x33')](_[_0xdb05('0x56')](_0x5a56cc[_0xdb05('0x31')],_0x5ec74a[_0xdb05('0x33')]));if(_0x5a56cc['query'][_0xdb05('0x3d')]){_0x4f04ef[_0xdb05('0x3c')]=_['merge'](_0x4f04ef[_0xdb05('0x3c')],{'$or':_[_0xdb05('0x30')](_0x4f04ef[_0xdb05('0x35')],function(_0x3342ce){var _0x1669c6={};_0x1669c6[_0x3342ce]={'$like':'%'+_0x5a56cc[_0xdb05('0x31')][_0xdb05('0x3d')]+'%'};return _0x1669c6;})});}_0x4f04ef=_[_0xdb05('0x3e')]({},_0x4f04ef,_0x5a56cc[_0xdb05('0x41')]);return _0x33a616[_0xdb05('0x62')](_0x4f04ef);}})['then'](function(_0x524fdf){if(_0x524fdf){_0x5a553d=_0x524fdf[_0xdb05('0x38')];if(!_0x5a56cc[_0xdb05('0x31')][_0xdb05('0x39')](_0xdb05('0x55'))){_0x4f04ef['limit']=qs[_0xdb05('0x20')](_0x5a56cc[_0xdb05('0x31')][_0xdb05('0x20')]);_0x4f04ef[_0xdb05('0x1e')]=qs[_0xdb05('0x1e')](_0x5a56cc[_0xdb05('0x31')][_0xdb05('0x1e')]);}return _0x33a616[_0xdb05('0x62')](_0x4f04ef);}})[_0xdb05('0x27')](function(_0x1f98bb){if(_0x1f98bb){return _0x1f98bb?{'count':_0x5a553d,'rows':_0x1f98bb}:null;}})[_0xdb05('0x27')](respondWithResult(_0x2609b6,null))['catch'](handleError(_0x2609b6,null));};exports[_0xdb05('0x65')]=function(_0x44cc02,_0x378227,_0x259f9c){var _0x5ca47d=_0x44cc02['body'][_0xdb05('0x66')];return db[_0xdb05('0x64')]['findAll']({'where':{'id':_0x5ca47d},'attributes':['id'],'include':[{'model':db[_0xdb05('0x59')],'as':'Agents','attributes':['id','name',_0xdb05('0x67'),'voicePause',_0xdb05('0x68')],'raw':!![]}]})[_0xdb05('0x27')](function(_0x380c47){if(_0x380c47){var _0x29ba38=_[_0xdb05('0x69')](_0x380c47,function(_0x472e60){var _0x2697e3=_0x472e60[_0xdb05('0x4c')]({'plain':!![]});return _0x2697e3[_0xdb05('0x6a')];});return db[_0xdb05('0x2f')][_0xdb05('0x4f')]({'where':{'id':_0x44cc02['params']['id']}})[_0xdb05('0x27')](function(_0x1d9694){return db[_0xdb05('0x6b')][_0xdb05('0x6c')](function(_0x53be8a){return _0x1d9694['addTeams'](_0x5ca47d,{'transaction':_0x53be8a})['then'](function(){return BPromise[_0xdb05('0x6d')](_0x29ba38,function(_0x1218e8){return db[_0xdb05('0x58')][_0xdb05('0x6e')]({'where':{'UserId':_0x1218e8['id'],'MailQueueId':_0x44cc02[_0xdb05('0x47')]['id']},'transaction':_0x53be8a});});})[_0xdb05('0x27')](function(){_0x29ba38['forEach'](function(_0x12eb7e){socket['emit'](_0xdb05('0x6f'),{'UserId':_0x12eb7e['id'],'MailQueueId':_0x1d9694['id']});});});});});}})[_0xdb05('0x27')](respondWithStatusCode(_0x378227,null))[_0xdb05('0x45')](handleError(_0x378227,null));};exports[_0xdb05('0x70')]=function(_0x2e0cad,_0x5e62fe,_0x1d642d){return db['Team'][_0xdb05('0x43')]({'where':{'id':_0x2e0cad['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xdb05('0x6a'),'attributes':['id'],'raw':!![]}]})[_0xdb05('0x27')](handleEntityNotFound(_0x5e62fe,null))[_0xdb05('0x27')](function(_0x2b4c99){var _0x399233=_[_0xdb05('0x30')](_0x2b4c99,'id');var _0x5bf9b0=[];var _0x8da08f=[];var _0x479096=squel[_0xdb05('0x71')]();_0x479096[_0xdb05('0x72')]('tq.TeamId')[_0xdb05('0x73')](_0xdb05('0x74'),'tq')[_0xdb05('0x75')](_0xdb05('0x76'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xdb05('0x3c')]('MailQueueId\x20=\x20?',_0x2e0cad[_0xdb05('0x47')]['id']);for(var _0x1bd1fe=0x0;_0x1bd1fe<_0x2b4c99['length'];_0x1bd1fe+=0x1){let _0x58d534=_0x2b4c99[_0x1bd1fe];for(var _0xe5078d=0x0;_0xe5078d<_0x58d534[_0xdb05('0x6a')][_0xdb05('0x38')];_0xe5078d+=0x1){let _0x297291=_0x58d534['Agents'][_0xe5078d];var _0x4fd566=_0x479096[_0xdb05('0x77')]();_0x4fd566[_0xdb05('0x3c')](_0xdb05('0x78'),_0x297291['id']);_0x8da08f[_0xdb05('0x79')](db['sequelize'][_0xdb05('0x31')](_0x4fd566[_0xdb05('0x7a')](),{'type':db[_0xdb05('0x6b')]['QueryTypes']['SELECT']})[_0xdb05('0x27')](function(_0x4f9ce1){if(_0x4f9ce1[_0xdb05('0x38')]===0x1){return _0x297291['id'];}else{var _0x2e3a11=_[_0xdb05('0x7b')](_['map'](_0x4f9ce1,_0xdb05('0x7c')),function(_0x54ce4e){return _[_0xdb05('0x7d')](_0x399233,_0x54ce4e);});if(_0x2e3a11){return _0x297291['id'];}}}));}}return BPromise['all'](_0x8da08f)[_0xdb05('0x27')](function(_0x5f3e32){_0x5bf9b0=_(_0x5bf9b0)[_0xdb05('0x7e')](_0x5f3e32)['compact']()[_0xdb05('0x7f')]();return db[_0xdb05('0x2f')][_0xdb05('0x4f')]({'where':{'id':_0x2e0cad[_0xdb05('0x47')]['id']}})['then'](function(_0x4bcf5e){return db[_0xdb05('0x6b')][_0xdb05('0x6c')](function(_0x5826de){return _0x4bcf5e[_0xdb05('0x70')](_0x2e0cad[_0xdb05('0x31')][_0xdb05('0x66')],{'transaction':_0x5826de})[_0xdb05('0x27')](function(){if(!_[_0xdb05('0x80')](_0x5bf9b0)){return _0x4bcf5e[_0xdb05('0x81')](_0x5bf9b0,{'transaction':_0x5826de});}})[_0xdb05('0x27')](function(){_0x5bf9b0[_0xdb05('0x82')](function(_0x521a3a){socket['emit'](_0xdb05('0x83'),{'UserId':_0x521a3a,'MailQueueId':_0x4bcf5e['id']});});});});});});})[_0xdb05('0x27')](respondWithStatusCode(_0x5e62fe,null))[_0xdb05('0x45')](handleError(_0x5e62fe,null));};exports['addAgents']=function(_0x7608e0,_0x5657b1,_0x45f25d){return db['MailQueue']['find']({'where':{'id':_0x7608e0[_0xdb05('0x47')]['id']}})['then'](handleEntityNotFound(_0x5657b1,null))[_0xdb05('0x27')](function(_0x57d140){if(_0x57d140){return _0x57d140['addAgents'](_0x7608e0[_0xdb05('0x4b')][_0xdb05('0x66')],_[_0xdb05('0x84')](_0x7608e0[_0xdb05('0x4b')],['ids','id'])||{})[_0xdb05('0x85')](function(_0xcd1e41){for(var _0x14112a=0x0;_0x14112a<_0x7608e0['body']['ids'][_0xdb05('0x38')];_0x14112a+=0x1){socket[_0xdb05('0x86')](_0xdb05('0x6f'),{'UserId':Number(_0x7608e0[_0xdb05('0x4b')][_0xdb05('0x66')][_0x14112a]),'MailQueueId':Number(_0x7608e0['params']['id'])});}return _0xcd1e41;});}})[_0xdb05('0x27')](respondWithResult(_0x5657b1,null))['catch'](handleError(_0x5657b1,null));};exports['removeAgents']=function(_0x3e9426,_0x296017,_0x36c75f){return db[_0xdb05('0x2f')][_0xdb05('0x4f')]({'where':{'id':_0x3e9426[_0xdb05('0x47')]['id']}})[_0xdb05('0x27')](handleEntityNotFound(_0x296017,null))['then'](function(_0x20b996){if(_0x20b996){return _0x20b996[_0xdb05('0x81')](_0x3e9426[_0xdb05('0x31')][_0xdb05('0x66')])[_0xdb05('0x27')](function(){if(_['isArray'](_0x3e9426['query'][_0xdb05('0x66')])){for(var _0x491a25=0x0;_0x491a25<_0x3e9426[_0xdb05('0x31')][_0xdb05('0x66')][_0xdb05('0x38')];_0x491a25+=0x1){socket[_0xdb05('0x86')](_0xdb05('0x83'),{'UserId':Number(_0x3e9426[_0xdb05('0x31')][_0xdb05('0x66')][_0x491a25]),'MailQueueId':Number(_0x3e9426[_0xdb05('0x47')]['id'])});}}else{socket[_0xdb05('0x86')](_0xdb05('0x83'),{'UserId':Number(_0x3e9426['query']['ids']),'MailQueueId':Number(_0x3e9426[_0xdb05('0x47')]['id'])});}});}})[_0xdb05('0x27')](respondWithStatusCode(_0x296017,null))[_0xdb05('0x45')](handleError(_0x296017,null));};exports[_0xdb05('0x87')]=function(_0x771a5f,_0x39c156,_0x593a00){var _0x8e4c29={};var _0x59e75e={};var _0x50596f;var _0x27ff8f;return db['MailQueue'][_0xdb05('0x63')]({'where':{'id':_0x771a5f['params']['id']}})[_0xdb05('0x27')](handleEntityNotFound(_0x39c156,null))[_0xdb05('0x27')](function(_0x54af3b){if(_0x54af3b){_0x50596f=_0x54af3b;_0x59e75e[_0xdb05('0x34')]=_['keys'](db['User'][_0xdb05('0x48')]);_0x59e75e['query']=_[_0xdb05('0x32')](_0x771a5f[_0xdb05('0x31')]);_0x59e75e[_0xdb05('0x33')]=_[_0xdb05('0x36')](_0x59e75e[_0xdb05('0x34')],_0x59e75e[_0xdb05('0x31')]);_0x8e4c29[_0xdb05('0x35')]=_[_0xdb05('0x36')](_0x59e75e[_0xdb05('0x34')],qs[_0xdb05('0x37')](_0x771a5f[_0xdb05('0x31')][_0xdb05('0x37')]));_0x8e4c29[_0xdb05('0x35')]=_0x8e4c29[_0xdb05('0x35')]['length']?_0x8e4c29[_0xdb05('0x35')]:_0x59e75e[_0xdb05('0x34')];_0x8e4c29[_0xdb05('0x3a')]=qs[_0xdb05('0x3b')](_0x771a5f[_0xdb05('0x31')]['sort']);_0x8e4c29[_0xdb05('0x3c')]=qs['filters'](_[_0xdb05('0x56')](_0x771a5f['query'],_0x59e75e['filters']));if(_0x771a5f[_0xdb05('0x31')][_0xdb05('0x3d')]){_0x8e4c29['where']=_['merge'](_0x8e4c29['where'],{'$or':_[_0xdb05('0x30')](_0x8e4c29[_0xdb05('0x35')],function(_0x2ea56f){var _0x196e2c={};_0x196e2c[_0x2ea56f]={'$like':'%'+_0x771a5f['query']['filter']+'%'};return _0x196e2c;})});}_0x8e4c29=_[_0xdb05('0x3e')]({},_0x8e4c29,_0x771a5f[_0xdb05('0x41')]);return _0x50596f[_0xdb05('0x87')](_0x8e4c29);}})[_0xdb05('0x27')](function(_0x1b88fd){if(_0x1b88fd){_0x27ff8f=_0x1b88fd[_0xdb05('0x38')];if(!_0x771a5f[_0xdb05('0x31')]['hasOwnProperty'](_0xdb05('0x55'))){_0x8e4c29['limit']=qs[_0xdb05('0x20')](_0x771a5f[_0xdb05('0x31')][_0xdb05('0x20')]);_0x8e4c29['offset']=qs[_0xdb05('0x1e')](_0x771a5f[_0xdb05('0x31')][_0xdb05('0x1e')]);}return _0x50596f[_0xdb05('0x87')](_0x8e4c29);}})[_0xdb05('0x27')](function(_0x446873){if(_0x446873){return _0x446873?{'count':_0x27ff8f,'rows':_0x446873}:null;}})['then'](respondWithResult(_0x39c156,null))[_0xdb05('0x45')](handleError(_0x39c156,null));};
\ No newline at end of file
+var _0x88f5=['../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','json','offset','limit','count','Content-Range','reject','save','update','then','destroy','get','MailQueues','UserProfileResource','end','error','stack','index','map','MailQueue','rawAttributes','fieldName','key','model','name','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','describe','findOne','MailQueueId','UserMailQueue','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','ids','Agents','online','voicePause','interface','flatMap','transaction','addTeams','forEach','emit','userMailQueue:save','select','field','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','removeTeams','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x3bdc36,_0x34eca0){var _0x3b5a5c=function(_0x1a0096){while(--_0x1a0096){_0x3bdc36['push'](_0x3bdc36['shift']());}};_0x3b5a5c(++_0x34eca0);}(_0x88f5,0x79));var _0x588f=function(_0x304cb4,_0x1631c7){_0x304cb4=_0x304cb4-0x0;var _0x84d773=_0x88f5[_0x304cb4];return _0x84d773;};'use strict';var emlformat=require(_0x588f('0x0'));var rimraf=require(_0x588f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x588f('0x2'));var moment=require(_0x588f('0x3'));var BPromise=require(_0x588f('0x4'));var Mustache=require(_0x588f('0x5'));var util=require('util');var path=require(_0x588f('0x6'));var sox=require(_0x588f('0x7'));var csv=require(_0x588f('0x8'));var ejs=require(_0x588f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x588f('0xa'));var squel=require(_0x588f('0xb'));var crypto=require(_0x588f('0xc'));var jsforce=require(_0x588f('0xd'));var deskjs=require(_0x588f('0xe'));var toCsv=require(_0x588f('0x8'));var querystring=require('querystring');var Papa=require(_0x588f('0xf'));var Redis=require(_0x588f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x588f('0x11'));var hardwareService=require(_0x588f('0x12'));var logger=require(_0x588f('0x13'))('api');var utils=require(_0x588f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x588f('0x15'));var db=require(_0x588f('0x16'))['db'];config[_0x588f('0x17')]=_[_0x588f('0x18')](config[_0x588f('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x588f('0x19'))(new Redis(config[_0x588f('0x17')]));require('./mailQueue.socket')[_0x588f('0x1a')](socket);function respondWithStatusCode(_0x1db459,_0x332bf7){_0x332bf7=_0x332bf7||0xcc;return function(_0x4a8a85){if(_0x4a8a85){return _0x1db459[_0x588f('0x1b')](_0x332bf7);}return _0x1db459[_0x588f('0x1c')](_0x332bf7)['end']();};}function respondWithResult(_0x25331b,_0x2b49a0){_0x2b49a0=_0x2b49a0||0xc8;return function(_0x3829d7){if(_0x3829d7){return _0x25331b[_0x588f('0x1c')](_0x2b49a0)[_0x588f('0x1d')](_0x3829d7);}};}function respondWithFilteredResult(_0x4a97ce,_0x33e2ee){return function(_0x1a1fac){if(_0x1a1fac){var _0x3aa544=typeof _0x33e2ee[_0x588f('0x1e')]==='undefined'&&typeof _0x33e2ee[_0x588f('0x1f')]==='undefined';var _0x213112=_0x1a1fac[_0x588f('0x20')];var _0x4ceaa7=_0x3aa544?0x0:_0x33e2ee['offset'];var _0x9ff7a2=_0x3aa544?_0x1a1fac[_0x588f('0x20')]:_0x33e2ee[_0x588f('0x1e')]+_0x33e2ee[_0x588f('0x1f')];var _0x404e8c;if(_0x9ff7a2>=_0x213112){_0x9ff7a2=_0x213112;_0x404e8c=0xc8;}else{_0x404e8c=0xce;}_0x4a97ce[_0x588f('0x1c')](_0x404e8c);return _0x4a97ce['set'](_0x588f('0x21'),_0x4ceaa7+'-'+_0x9ff7a2+'/'+_0x213112)[_0x588f('0x1d')](_0x1a1fac);}return null;};}function patchUpdates(_0x503ce3){return function(_0x38d659){try{jsonpatch['apply'](_0x38d659,_0x503ce3,!![]);}catch(_0x212a0e){return BPromise[_0x588f('0x22')](_0x212a0e);}return _0x38d659[_0x588f('0x23')]();};}function saveUpdates(_0xe96914,_0x534aa8){return function(_0x153213){if(_0x153213){return _0x153213[_0x588f('0x24')](_0xe96914)[_0x588f('0x25')](function(_0xcbdb5d){return _0xcbdb5d;});}return null;};}function removeEntity(_0x57eb13,_0x5304e5){return function(_0x69c849){if(_0x69c849){return _0x69c849[_0x588f('0x26')]()[_0x588f('0x25')](function(){var _0x516027=_0x69c849[_0x588f('0x27')]({'plain':!![]});var _0x5595be=_0x588f('0x28');return db[_0x588f('0x29')][_0x588f('0x26')]({'where':{'type':_0x5595be,'resourceId':_0x516027['id']}})['then'](function(){return _0x69c849;});})[_0x588f('0x25')](function(){_0x57eb13[_0x588f('0x1c')](0xcc)[_0x588f('0x2a')]();});}};}function handleEntityNotFound(_0x19b14e,_0x104a2b){return function(_0x24dc25){if(!_0x24dc25){_0x19b14e[_0x588f('0x1b')](0x194);}return _0x24dc25;};}function handleError(_0x442692,_0x1a6d18){_0x1a6d18=_0x1a6d18||0x1f4;return function(_0x4d7d62){logger[_0x588f('0x2b')](_0x4d7d62[_0x588f('0x2c')]);if(_0x4d7d62['name']){delete _0x4d7d62['name'];}_0x442692[_0x588f('0x1c')](_0x1a6d18)['send'](_0x4d7d62);};}exports[_0x588f('0x2d')]=function(_0x3d9fb0,_0xaa8252){var _0x29ed94={},_0x2ac854={},_0x1bbe14={'count':0x0,'rows':[]};var _0xc2f8f4=_[_0x588f('0x2e')](db[_0x588f('0x2f')][_0x588f('0x30')],function(_0xe3fd01){return{'name':_0xe3fd01[_0x588f('0x31')],'type':_0xe3fd01['type'][_0x588f('0x32')]};});_0x2ac854[_0x588f('0x33')]=_[_0x588f('0x2e')](_0xc2f8f4,_0x588f('0x34'));_0x2ac854[_0x588f('0x35')]=_[_0x588f('0x36')](_0x3d9fb0[_0x588f('0x35')]);_0x2ac854['filters']=_[_0x588f('0x37')](_0x2ac854[_0x588f('0x33')],_0x2ac854[_0x588f('0x35')]);_0x29ed94['attributes']=_[_0x588f('0x37')](_0x2ac854[_0x588f('0x33')],qs['fields'](_0x3d9fb0['query'][_0x588f('0x38')]));_0x29ed94[_0x588f('0x39')]=_0x29ed94[_0x588f('0x39')][_0x588f('0x3a')]?_0x29ed94['attributes']:_0x2ac854[_0x588f('0x33')];if(!_0x3d9fb0[_0x588f('0x35')][_0x588f('0x3b')](_0x588f('0x3c'))){_0x29ed94[_0x588f('0x1f')]=qs[_0x588f('0x1f')](_0x3d9fb0[_0x588f('0x35')]['limit']);_0x29ed94[_0x588f('0x1e')]=qs[_0x588f('0x1e')](_0x3d9fb0['query'][_0x588f('0x1e')]);}_0x29ed94[_0x588f('0x3d')]=qs['sort'](_0x3d9fb0[_0x588f('0x35')][_0x588f('0x3e')]);_0x29ed94['where']=qs['filters'](_[_0x588f('0x3f')](_0x3d9fb0[_0x588f('0x35')],_0x2ac854[_0x588f('0x40')]),_0xc2f8f4);if(_0x3d9fb0[_0x588f('0x35')][_0x588f('0x41')]){_0x29ed94[_0x588f('0x42')]=_[_0x588f('0x43')](_0x29ed94[_0x588f('0x42')],{'$or':_['map'](_0xc2f8f4,function(_0x2eb548){if(_0x2eb548[_0x588f('0x44')]!==_0x588f('0x45')){var _0x962e99={};_0x962e99[_0x2eb548[_0x588f('0x34')]]={'$like':'%'+_0x3d9fb0[_0x588f('0x35')][_0x588f('0x41')]+'%'};return _0x962e99;}})});}_0x29ed94=_[_0x588f('0x43')]({},_0x29ed94,_0x3d9fb0[_0x588f('0x46')]);var _0x127d72={'where':_0x29ed94[_0x588f('0x42')]};return db[_0x588f('0x2f')][_0x588f('0x20')](_0x127d72)[_0x588f('0x25')](function(_0x28df51){_0x1bbe14[_0x588f('0x20')]=_0x28df51;if(_0x3d9fb0[_0x588f('0x35')][_0x588f('0x47')]){_0x29ed94[_0x588f('0x48')]=[{'all':!![]}];}return db[_0x588f('0x2f')][_0x588f('0x49')](_0x29ed94);})[_0x588f('0x25')](function(_0x1bdaac){_0x1bbe14['rows']=_0x1bdaac;return _0x1bbe14;})[_0x588f('0x25')](respondWithFilteredResult(_0xaa8252,_0x29ed94))[_0x588f('0x4a')](handleError(_0xaa8252,null));};exports[_0x588f('0x4b')]=function(_0x293333,_0x220a8b){var _0x175d41={'raw':!![],'where':{'id':_0x293333[_0x588f('0x4c')]['id']}},_0x21b001={};_0x21b001[_0x588f('0x33')]=_[_0x588f('0x36')](db[_0x588f('0x2f')][_0x588f('0x30')]);_0x21b001[_0x588f('0x35')]=_[_0x588f('0x36')](_0x293333[_0x588f('0x35')]);_0x21b001[_0x588f('0x40')]=_[_0x588f('0x37')](_0x21b001[_0x588f('0x33')],_0x21b001['query']);_0x175d41[_0x588f('0x39')]=_[_0x588f('0x37')](_0x21b001[_0x588f('0x33')],qs['fields'](_0x293333[_0x588f('0x35')][_0x588f('0x38')]));_0x175d41[_0x588f('0x39')]=_0x175d41['attributes']['length']?_0x175d41[_0x588f('0x39')]:_0x21b001[_0x588f('0x33')];if(_0x293333[_0x588f('0x35')]['includeAll']){_0x175d41[_0x588f('0x48')]=[{'all':!![]}];}_0x175d41=_['merge']({},_0x175d41,_0x293333[_0x588f('0x46')]);return db[_0x588f('0x2f')]['find'](_0x175d41)[_0x588f('0x25')](handleEntityNotFound(_0x220a8b,null))[_0x588f('0x25')](respondWithResult(_0x220a8b,null))[_0x588f('0x4a')](handleError(_0x220a8b,null));};exports[_0x588f('0x4d')]=function(_0x23178e,_0x5c8fb0){return db[_0x588f('0x2f')]['create'](_0x23178e[_0x588f('0x4e')],{})[_0x588f('0x25')](function(_0x24c018){var _0x4ca36a=_0x23178e['user'][_0x588f('0x27')]({'plain':!![]});if(!_0x4ca36a)throw new Error(_0x588f('0x4f'));if(_0x4ca36a[_0x588f('0x50')]===_0x588f('0x51')){var _0x214380=_0x24c018[_0x588f('0x27')]({'plain':!![]});var _0x25b6c2='MailQueues';return db[_0x588f('0x52')][_0x588f('0x53')]({'where':{'name':_0x25b6c2,'userProfileId':_0x4ca36a['userProfileId']},'raw':!![]})['then'](function(_0x196f75){if(_0x196f75&&_0x196f75[_0x588f('0x54')]===0x0){return db[_0x588f('0x29')][_0x588f('0x4d')]({'name':_0x214380[_0x588f('0x34')],'resourceId':_0x214380['id'],'type':_0x196f75[_0x588f('0x34')],'sectionId':_0x196f75['id']},{})['then'](function(){return _0x24c018;});}else{return _0x24c018;}})[_0x588f('0x4a')](function(_0x2005d9){logger[_0x588f('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2005d9);throw _0x2005d9;});}return _0x24c018;})[_0x588f('0x25')](respondWithResult(_0x5c8fb0,0xc9))['catch'](handleError(_0x5c8fb0,null));};exports[_0x588f('0x24')]=function(_0x4eb373,_0x327bd9){if(_0x4eb373['body']['id']){delete _0x4eb373[_0x588f('0x4e')]['id'];}return db['MailQueue'][_0x588f('0x53')]({'where':{'id':_0x4eb373[_0x588f('0x4c')]['id']}})[_0x588f('0x25')](handleEntityNotFound(_0x327bd9,null))[_0x588f('0x25')](saveUpdates(_0x4eb373[_0x588f('0x4e')],null))['then'](respondWithResult(_0x327bd9,null))[_0x588f('0x4a')](handleError(_0x327bd9,null));};exports[_0x588f('0x26')]=function(_0x4172b8,_0x5c56d9){return db[_0x588f('0x2f')][_0x588f('0x53')]({'where':{'id':_0x4172b8[_0x588f('0x4c')]['id']}})[_0x588f('0x25')](handleEntityNotFound(_0x5c56d9,null))['then'](removeEntity(_0x5c56d9,null))[_0x588f('0x4a')](handleError(_0x5c56d9,null));};exports[_0x588f('0x55')]=function(_0x3db1bb,_0x673ce8){return db[_0x588f('0x2f')][_0x588f('0x55')]()[_0x588f('0x25')](respondWithResult(_0x673ce8,null))[_0x588f('0x4a')](handleError(_0x673ce8,null));};exports['getMembers']=function(_0x3c1040,_0x5056b2,_0x4b1ccc){var _0xbbe7cf={'raw':!![],'where':{}},_0x265b21={},_0x4fdc8a;return db['MailQueue'][_0x588f('0x56')]({'where':{'id':_0x3c1040['params']['id']}})['then'](handleEntityNotFound(_0x5056b2,null))[_0x588f('0x25')](function(_0x12fade){if(_0x12fade){_0x4fdc8a=_0x12fade[_0x588f('0x27')]({'plain':!![]});_0x265b21[_0x588f('0x33')]=_[_0x588f('0x36')](db['UserMailQueue'][_0x588f('0x30')]);_0x265b21[_0x588f('0x35')]=_[_0x588f('0x36')](_0x3c1040[_0x588f('0x35')]);_0x265b21['filters']=_[_0x588f('0x37')](_0x265b21['model'],_0x265b21[_0x588f('0x35')]);_0xbbe7cf['attributes']=_['intersection'](_0x265b21[_0x588f('0x33')],qs[_0x588f('0x38')](_0x3c1040[_0x588f('0x35')][_0x588f('0x38')]));_0xbbe7cf['attributes']=_0xbbe7cf[_0x588f('0x39')]['length']?_0xbbe7cf[_0x588f('0x39')]:_0x265b21[_0x588f('0x33')];if(!_0x3c1040['query'][_0x588f('0x3b')](_0x588f('0x3c'))){_0xbbe7cf[_0x588f('0x1f')]=qs['limit'](_0x3c1040[_0x588f('0x35')][_0x588f('0x1f')]);_0xbbe7cf[_0x588f('0x1e')]=qs[_0x588f('0x1e')](_0x3c1040[_0x588f('0x35')][_0x588f('0x1e')]);}_0xbbe7cf[_0x588f('0x3d')]=qs[_0x588f('0x3e')](_0x3c1040[_0x588f('0x35')][_0x588f('0x3e')]);_0xbbe7cf[_0x588f('0x42')]=qs['filters'](_[_0x588f('0x3f')](_0x3c1040[_0x588f('0x35')],_0x265b21[_0x588f('0x40')]));_0xbbe7cf[_0x588f('0x42')][_0x588f('0x57')]=_0x12fade['id'];if(_0x3c1040[_0x588f('0x35')][_0x588f('0x41')]){_0xbbe7cf[_0x588f('0x42')]=_['merge'](_0xbbe7cf[_0x588f('0x42')],{'$or':_[_0x588f('0x2e')](_0xbbe7cf[_0x588f('0x39')],function(_0xafda80){var _0x4e60b6={};_0x4e60b6[_0xafda80]={'$like':'%'+_0x3c1040['query'][_0x588f('0x41')]+'%'};return _0x4e60b6;})});}_0xbbe7cf=_[_0x588f('0x43')]({},_0xbbe7cf,_0x3c1040['options']);return db[_0x588f('0x58')][_0x588f('0x49')](_0xbbe7cf);}})[_0x588f('0x25')](function(_0x497084){if(_0x497084){return db[_0x588f('0x59')][_0x588f('0x5a')]({'where':{'id':_[_0x588f('0x2e')](_0x497084,_0x588f('0x5b')),'role':_0x588f('0x5c')},'attributes':['id','name',_0x588f('0x5d'),_0x588f('0x5e'),_0x588f('0x5f')]});}})[_0x588f('0x25')](function(_0xa16e0c){if(_0xa16e0c){return{'count':_0xa16e0c['count'],'rows':_[_0x588f('0x2e')](_0xa16e0c[_0x588f('0x60')],function(_0x177900){return{'membername':_0x177900['name'],'UserId':_0x177900['id'],'queue_name':_0x4fdc8a[_0x588f('0x34')],'MailQueueId':_0x4fdc8a['id'],'interface':util[_0x588f('0x61')](_0x588f('0x62'),_0x588f('0x63'),_0x177900[_0x588f('0x34')]),'penalty':0x0,'paused':_0x177900[_0x588f('0x5d')],'createdAt':_0x177900[_0x588f('0x5f')],'updatedAt':_0x177900['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x588f('0x25')](respondWithFilteredResult(_0x5056b2,_0xbbe7cf))['catch'](handleError(_0x5056b2,null));};exports[_0x588f('0x64')]=function(_0x4a864c,_0x256eba,_0x476dd1){var _0x3f65a6={};var _0xef9ee0={};var _0x367b19;var _0x1559cc;return db['MailQueue']['findOne']({'where':{'id':_0x4a864c[_0x588f('0x4c')]['id']}})[_0x588f('0x25')](handleEntityNotFound(_0x256eba,null))[_0x588f('0x25')](function(_0x2ba8db){if(_0x2ba8db){_0x367b19=_0x2ba8db;_0xef9ee0[_0x588f('0x33')]=_[_0x588f('0x36')](db[_0x588f('0x65')][_0x588f('0x30')]);_0xef9ee0['query']=_[_0x588f('0x36')](_0x4a864c[_0x588f('0x35')]);_0xef9ee0[_0x588f('0x40')]=_[_0x588f('0x37')](_0xef9ee0[_0x588f('0x33')],_0xef9ee0[_0x588f('0x35')]);_0x3f65a6[_0x588f('0x39')]=_[_0x588f('0x37')](_0xef9ee0[_0x588f('0x33')],qs['fields'](_0x4a864c[_0x588f('0x35')][_0x588f('0x38')]));_0x3f65a6[_0x588f('0x39')]=_0x3f65a6[_0x588f('0x39')][_0x588f('0x3a')]?_0x3f65a6['attributes']:_0xef9ee0[_0x588f('0x33')];_0x3f65a6['order']=qs[_0x588f('0x3e')](_0x4a864c[_0x588f('0x35')]['sort']);_0x3f65a6[_0x588f('0x42')]=qs[_0x588f('0x40')](_['pick'](_0x4a864c[_0x588f('0x35')],_0xef9ee0['filters']));if(_0x4a864c[_0x588f('0x35')][_0x588f('0x41')]){_0x3f65a6['where']=_['merge'](_0x3f65a6[_0x588f('0x42')],{'$or':_[_0x588f('0x2e')](_0x3f65a6[_0x588f('0x39')],function(_0x500d96){var _0x156c25={};_0x156c25[_0x500d96]={'$like':'%'+_0x4a864c[_0x588f('0x35')][_0x588f('0x41')]+'%'};return _0x156c25;})});}_0x3f65a6=_['merge']({},_0x3f65a6,_0x4a864c[_0x588f('0x46')]);return _0x367b19['getTeams'](_0x3f65a6);}})[_0x588f('0x25')](function(_0x3e86f6){if(_0x3e86f6){_0x1559cc=_0x3e86f6[_0x588f('0x3a')];if(!_0x4a864c[_0x588f('0x35')][_0x588f('0x3b')](_0x588f('0x3c'))){_0x3f65a6[_0x588f('0x1f')]=qs[_0x588f('0x1f')](_0x4a864c[_0x588f('0x35')][_0x588f('0x1f')]);_0x3f65a6[_0x588f('0x1e')]=qs[_0x588f('0x1e')](_0x4a864c[_0x588f('0x35')][_0x588f('0x1e')]);}return _0x367b19[_0x588f('0x64')](_0x3f65a6);}})['then'](function(_0x2b0a75){if(_0x2b0a75){return _0x2b0a75?{'count':_0x1559cc,'rows':_0x2b0a75}:null;}})[_0x588f('0x25')](respondWithResult(_0x256eba,null))[_0x588f('0x4a')](handleError(_0x256eba,null));};exports['addTeams']=function(_0x5b2daf,_0x334d9a,_0x581593){var _0x4adc64=_0x5b2daf['body'][_0x588f('0x66')];return db['Team'][_0x588f('0x49')]({'where':{'id':_0x4adc64},'attributes':['id'],'include':[{'model':db[_0x588f('0x59')],'as':_0x588f('0x67'),'attributes':['id',_0x588f('0x34'),_0x588f('0x68'),_0x588f('0x69'),_0x588f('0x6a')],'raw':!![]}]})[_0x588f('0x25')](function(_0x1d1723){if(_0x1d1723){var _0x10c206=_[_0x588f('0x6b')](_0x1d1723,function(_0x3d55b1){var _0x158c63=_0x3d55b1[_0x588f('0x27')]({'plain':!![]});return _0x158c63['Agents'];});return db['MailQueue'][_0x588f('0x53')]({'where':{'id':_0x5b2daf[_0x588f('0x4c')]['id']}})[_0x588f('0x25')](function(_0x44ca8b){return db['sequelize'][_0x588f('0x6c')](function(_0x17f4d6){return _0x44ca8b[_0x588f('0x6d')](_0x4adc64,{'transaction':_0x17f4d6})['then'](function(){return BPromise['each'](_0x10c206,function(_0x1feb26){return db[_0x588f('0x58')]['findOrCreate']({'where':{'UserId':_0x1feb26['id'],'MailQueueId':_0x5b2daf[_0x588f('0x4c')]['id']},'transaction':_0x17f4d6});});})['then'](function(){_0x10c206[_0x588f('0x6e')](function(_0x14b927){socket[_0x588f('0x6f')](_0x588f('0x70'),{'UserId':_0x14b927['id'],'MailQueueId':_0x44ca8b['id']});});});});});}})[_0x588f('0x25')](respondWithStatusCode(_0x334d9a,null))[_0x588f('0x4a')](handleError(_0x334d9a,null));};exports['removeTeams']=function(_0x2eb938,_0x4ef4ef,_0x34c89b){return db[_0x588f('0x65')]['findAll']({'where':{'id':_0x2eb938[_0x588f('0x35')][_0x588f('0x66')]},'attributes':['id'],'include':[{'model':db[_0x588f('0x59')],'as':_0x588f('0x67'),'attributes':['id'],'raw':!![]}]})[_0x588f('0x25')](handleEntityNotFound(_0x4ef4ef,null))['then'](function(_0x6407e3){var _0x27b89e=_[_0x588f('0x2e')](_0x6407e3,'id');var _0x2f04ca=[];var _0x4f8559=[];var _0x25823c=squel[_0x588f('0x71')]();_0x25823c[_0x588f('0x72')]('tq.TeamId')[_0x588f('0x73')](_0x588f('0x74'),'tq')[_0x588f('0x75')](_0x588f('0x76'),'ut',_0x588f('0x77'))['where']('MailQueueId\x20=\x20?',_0x2eb938['params']['id']);for(var _0x28e4b4=0x0;_0x28e4b4<_0x6407e3[_0x588f('0x3a')];_0x28e4b4+=0x1){let _0x3ad4e9=_0x6407e3[_0x28e4b4];for(var _0x3c86c0=0x0;_0x3c86c0<_0x3ad4e9[_0x588f('0x67')][_0x588f('0x3a')];_0x3c86c0+=0x1){let _0x4c4a01=_0x3ad4e9['Agents'][_0x3c86c0];var _0x238740=_0x25823c[_0x588f('0x78')]();_0x238740['where'](_0x588f('0x79'),_0x4c4a01['id']);_0x4f8559[_0x588f('0x7a')](db['sequelize'][_0x588f('0x35')](_0x238740[_0x588f('0x7b')](),{'type':db[_0x588f('0x7c')][_0x588f('0x7d')][_0x588f('0x7e')]})[_0x588f('0x25')](function(_0x507cfb){if(_0x507cfb[_0x588f('0x3a')]===0x1){return _0x4c4a01['id'];}else{var _0xb5ffdb=_[_0x588f('0x7f')](_[_0x588f('0x2e')](_0x507cfb,_0x588f('0x80')),function(_0x164c59){return _[_0x588f('0x81')](_0x27b89e,_0x164c59);});if(_0xb5ffdb){return _0x4c4a01['id'];}}}));}}return BPromise['all'](_0x4f8559)[_0x588f('0x25')](function(_0xe1f431){_0x2f04ca=_(_0x2f04ca)[_0x588f('0x82')](_0xe1f431)[_0x588f('0x83')]()[_0x588f('0x84')]();return db[_0x588f('0x2f')]['find']({'where':{'id':_0x2eb938[_0x588f('0x4c')]['id']}})[_0x588f('0x25')](function(_0x366fb2){return db[_0x588f('0x7c')][_0x588f('0x6c')](function(_0x381920){return _0x366fb2[_0x588f('0x85')](_0x2eb938[_0x588f('0x35')][_0x588f('0x66')],{'transaction':_0x381920})[_0x588f('0x25')](function(){if(!_[_0x588f('0x86')](_0x2f04ca)){return _0x366fb2[_0x588f('0x87')](_0x2f04ca,{'transaction':_0x381920});}})['then'](function(){_0x2f04ca[_0x588f('0x6e')](function(_0x4fa751){socket[_0x588f('0x6f')](_0x588f('0x88'),{'UserId':_0x4fa751,'MailQueueId':_0x366fb2['id']});});});});});});})[_0x588f('0x25')](respondWithStatusCode(_0x4ef4ef,null))[_0x588f('0x4a')](handleError(_0x4ef4ef,null));};exports[_0x588f('0x89')]=function(_0x455d47,_0x395265,_0x54006d){return db[_0x588f('0x2f')][_0x588f('0x53')]({'where':{'id':_0x455d47[_0x588f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x395265,null))[_0x588f('0x25')](function(_0x233797){if(_0x233797){return _0x233797[_0x588f('0x89')](_0x455d47[_0x588f('0x4e')][_0x588f('0x66')],_[_0x588f('0x8a')](_0x455d47['body'],['ids','id'])||{})[_0x588f('0x8b')](function(_0x324d84){for(var _0x10d627=0x0;_0x10d627<_0x455d47['body'][_0x588f('0x66')][_0x588f('0x3a')];_0x10d627+=0x1){socket[_0x588f('0x6f')](_0x588f('0x70'),{'UserId':Number(_0x455d47[_0x588f('0x4e')]['ids'][_0x10d627]),'MailQueueId':Number(_0x455d47['params']['id'])});}return _0x324d84;});}})[_0x588f('0x25')](respondWithResult(_0x395265,null))[_0x588f('0x4a')](handleError(_0x395265,null));};exports[_0x588f('0x87')]=function(_0x2385a8,_0x59e203,_0x26b34b){return db[_0x588f('0x2f')][_0x588f('0x53')]({'where':{'id':_0x2385a8['params']['id']}})[_0x588f('0x25')](handleEntityNotFound(_0x59e203,null))[_0x588f('0x25')](function(_0x5e2178){if(_0x5e2178){return _0x5e2178['removeAgents'](_0x2385a8[_0x588f('0x35')][_0x588f('0x66')])[_0x588f('0x25')](function(){if(_[_0x588f('0x8c')](_0x2385a8['query'][_0x588f('0x66')])){for(var _0x10eb9d=0x0;_0x10eb9d<_0x2385a8[_0x588f('0x35')][_0x588f('0x66')][_0x588f('0x3a')];_0x10eb9d+=0x1){socket[_0x588f('0x6f')](_0x588f('0x88'),{'UserId':Number(_0x2385a8[_0x588f('0x35')][_0x588f('0x66')][_0x10eb9d]),'MailQueueId':Number(_0x2385a8[_0x588f('0x4c')]['id'])});}}else{socket[_0x588f('0x6f')](_0x588f('0x88'),{'UserId':Number(_0x2385a8['query'][_0x588f('0x66')]),'MailQueueId':Number(_0x2385a8[_0x588f('0x4c')]['id'])});}});}})[_0x588f('0x25')](respondWithStatusCode(_0x59e203,null))[_0x588f('0x4a')](handleError(_0x59e203,null));};exports[_0x588f('0x8d')]=function(_0x537eb6,_0x3ff933,_0x30fa90){var _0x383d1f={};var _0x5e1f2c={};var _0x1e05ba;var _0x56e545;return db[_0x588f('0x2f')][_0x588f('0x56')]({'where':{'id':_0x537eb6[_0x588f('0x4c')]['id']}})[_0x588f('0x25')](handleEntityNotFound(_0x3ff933,null))[_0x588f('0x25')](function(_0x3d5503){if(_0x3d5503){_0x1e05ba=_0x3d5503;_0x5e1f2c[_0x588f('0x33')]=_['keys'](db[_0x588f('0x59')][_0x588f('0x30')]);_0x5e1f2c[_0x588f('0x35')]=_[_0x588f('0x36')](_0x537eb6[_0x588f('0x35')]);_0x5e1f2c['filters']=_[_0x588f('0x37')](_0x5e1f2c[_0x588f('0x33')],_0x5e1f2c[_0x588f('0x35')]);_0x383d1f['attributes']=_[_0x588f('0x37')](_0x5e1f2c[_0x588f('0x33')],qs[_0x588f('0x38')](_0x537eb6['query'][_0x588f('0x38')]));_0x383d1f[_0x588f('0x39')]=_0x383d1f[_0x588f('0x39')][_0x588f('0x3a')]?_0x383d1f[_0x588f('0x39')]:_0x5e1f2c[_0x588f('0x33')];_0x383d1f[_0x588f('0x3d')]=qs['sort'](_0x537eb6[_0x588f('0x35')][_0x588f('0x3e')]);_0x383d1f[_0x588f('0x42')]=qs[_0x588f('0x40')](_[_0x588f('0x3f')](_0x537eb6['query'],_0x5e1f2c['filters']));if(_0x537eb6[_0x588f('0x35')][_0x588f('0x41')]){_0x383d1f['where']=_['merge'](_0x383d1f[_0x588f('0x42')],{'$or':_[_0x588f('0x2e')](_0x383d1f[_0x588f('0x39')],function(_0x199a4c){var _0x44e96b={};_0x44e96b[_0x199a4c]={'$like':'%'+_0x537eb6['query'][_0x588f('0x41')]+'%'};return _0x44e96b;})});}_0x383d1f=_[_0x588f('0x43')]({},_0x383d1f,_0x537eb6['options']);return _0x1e05ba[_0x588f('0x8d')](_0x383d1f);}})[_0x588f('0x25')](function(_0x36cae9){if(_0x36cae9){_0x56e545=_0x36cae9[_0x588f('0x3a')];if(!_0x537eb6[_0x588f('0x35')]['hasOwnProperty'](_0x588f('0x3c'))){_0x383d1f[_0x588f('0x1f')]=qs[_0x588f('0x1f')](_0x537eb6[_0x588f('0x35')][_0x588f('0x1f')]);_0x383d1f[_0x588f('0x1e')]=qs[_0x588f('0x1e')](_0x537eb6['query']['offset']);}return _0x1e05ba[_0x588f('0x8d')](_0x383d1f);}})['then'](function(_0x2c21bb){if(_0x2c21bb){return _0x2c21bb?{'count':_0x56e545,'rows':_0x2c21bb}:null;}})[_0x588f('0x25')](respondWithResult(_0x3ff933,null))[_0x588f('0x4a')](handleError(_0x3ff933,null));};
\ No newline at end of file
index 5ae9a5e..3ae49a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b42=['exports','events','../../mysqldb','MailQueue','setMaxListeners','remove','emit','hook'];(function(_0x149337,_0x27a7b3){var _0x52b3f6=function(_0x48102f){while(--_0x48102f){_0x149337['push'](_0x149337['shift']());}};_0x52b3f6(++_0x27a7b3);}(_0x2b42,0x101));var _0x22b4=function(_0x1ec65c,_0x354923){_0x1ec65c=_0x1ec65c-0x0;var _0x5249c2=_0x2b42[_0x1ec65c];return _0x5249c2;};'use strict';var EventEmitter=require(_0x22b4('0x0'));var MailQueue=require(_0x22b4('0x1'))['db'][_0x22b4('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x22b4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x22b4('0x4')};function emitEvent(_0x4deb81){return function(_0x1268fc,_0x591563,_0x547657){MailQueueEvents['emit'](_0x4deb81+':'+_0x1268fc['id'],_0x1268fc);MailQueueEvents[_0x22b4('0x5')](_0x4deb81,_0x1268fc);_0x547657(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x22b4('0x6')](e,emitEvent(event));}}module[_0x22b4('0x7')]=MailQueueEvents;
\ No newline at end of file
+var _0xdf36=['remove','emit','hook','exports','../../mysqldb','MailQueue','setMaxListeners'];(function(_0x5c9b55,_0x5befc4){var _0x113969=function(_0x5a404d){while(--_0x5a404d){_0x5c9b55['push'](_0x5c9b55['shift']());}};_0x113969(++_0x5befc4);}(_0xdf36,0x193));var _0x6df3=function(_0x422eef,_0x367e57){_0x422eef=_0x422eef-0x0;var _0x1f8282=_0xdf36[_0x422eef];return _0x1f8282;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x6df3('0x0'))['db'][_0x6df3('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x6df3('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6df3('0x3')};function emitEvent(_0x3374fb){return function(_0x540d69,_0x22c4dc,_0x532c9f){MailQueueEvents[_0x6df3('0x4')](_0x3374fb+':'+_0x540d69['id'],_0x540d69);MailQueueEvents['emit'](_0x3374fb,_0x540d69);_0x532c9f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x6df3('0x5')](e,emitEvent(event));}}module[_0x6df3('0x6')]=MailQueueEvents;
\ No newline at end of file
index ec71b34..7733fdc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x65b1=['../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x1620d2,_0x798f79){var _0xb63a8d=function(_0x414068){while(--_0x414068){_0x1620d2['push'](_0x1620d2['shift']());}};_0xb63a8d(++_0x798f79);}(_0x65b1,0x1e7));var _0x165b=function(_0x14cddd,_0xd110fd){_0x14cddd=_0x14cddd-0x0;var _0x5e0bf8=_0x65b1[_0x14cddd];return _0x5e0bf8;};'use strict';var _=require(_0x165b('0x0'));var util=require(_0x165b('0x1'));var logger=require(_0x165b('0x2'))(_0x165b('0x3'));var moment=require(_0x165b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x165b('0x5'));var rimraf=require(_0x165b('0x6'));var config=require(_0x165b('0x7'));var attributes=require(_0x165b('0x8'));module[_0x165b('0x9')]=function(_0x97ca70,_0xbbf379){return _0x97ca70[_0x165b('0xa')](_0x165b('0xb'),attributes,{'tableName':_0x165b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xab72=['rimraf','../../config/environment','./mailQueue.attributes','exports','define','lodash','util','moment','bluebird','request-promise','path'];(function(_0x2902cc,_0x4d1d00){var _0x5f418f=function(_0x5e3846){while(--_0x5e3846){_0x2902cc['push'](_0x2902cc['shift']());}};_0x5f418f(++_0x4d1d00);}(_0xab72,0xaa));var _0x2ab7=function(_0x4c2379,_0x278271){_0x4c2379=_0x4c2379-0x0;var _0x543fd5=_0xab72[_0x4c2379];return _0x543fd5;};'use strict';var _=require(_0x2ab7('0x0'));var util=require(_0x2ab7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2ab7('0x2'));var BPromise=require(_0x2ab7('0x3'));var rp=require(_0x2ab7('0x4'));var fs=require('fs');var path=require(_0x2ab7('0x5'));var rimraf=require(_0x2ab7('0x6'));var config=require(_0x2ab7('0x7'));var attributes=require(_0x2ab7('0x8'));module[_0x2ab7('0x9')]=function(_0x5e454b,_0x48e1c3){return _0x5e454b[_0x2ab7('0xa')]('MailQueue',attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c0cb133..f5dae5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1f5=['ioredis','../../mysqldb','../../config/utils','rpc','http','redis','defaults','localhost','socket.io-emitter','register','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','options','raw','where','attributes','limit','include','model','map','ShowMailQueue','find','lodash','moment','bluebird'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xd1f5,0x1de));var _0x5d1f=function(_0x1a6152,_0x55b74b){_0x1a6152=_0x1a6152-0x0;var _0x10ecc6=_0xd1f5[_0x1a6152];return _0x10ecc6;};'use strict';var _=require(_0x5d1f('0x0'));var util=require('util');var moment=require(_0x5d1f('0x1'));var BPromise=require(_0x5d1f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d1f('0x3'));var db=require(_0x5d1f('0x4'))['db'];var utils=require(_0x5d1f('0x5'));var logger=require('../../config/logger')(_0x5d1f('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x5d1f('0x7')]({'port':0x232a});config[_0x5d1f('0x8')]=_[_0x5d1f('0x9')](config[_0x5d1f('0x8')],{'host':_0x5d1f('0xa'),'port':0x18eb});var socket=require(_0x5d1f('0xb'))(new Redis(config[_0x5d1f('0x8')]));require('./mailQueue.socket')[_0x5d1f('0xc')](socket);function respondWithRpcPromise(_0x153ac4,_0x2f7114,_0x512d32){return new BPromise(function(_0x15a5bc,_0xe240d5){return client['request'](_0x153ac4,_0x512d32)[_0x5d1f('0xd')](function(_0x471003){logger[_0x5d1f('0xe')](_0x5d1f('0xf'),_0x2f7114,_0x5d1f('0x10'));logger[_0x5d1f('0x11')](_0x5d1f('0x12'),_0x2f7114,'request\x20sent',JSON[_0x5d1f('0x13')](_0x471003));if(_0x471003[_0x5d1f('0x14')]){if(_0x471003[_0x5d1f('0x14')][_0x5d1f('0x15')]===0x1f4){logger['error'](_0x5d1f('0xf'),_0x2f7114,_0x471003[_0x5d1f('0x14')][_0x5d1f('0x16')]);return _0xe240d5(_0x471003['error'][_0x5d1f('0x16')]);}logger[_0x5d1f('0x14')](_0x5d1f('0xf'),_0x2f7114,_0x471003['error'][_0x5d1f('0x16')]);return _0x15a5bc(_0x471003[_0x5d1f('0x14')][_0x5d1f('0x16')]);}else{logger['info'](_0x5d1f('0xf'),_0x2f7114,'request\x20sent');_0x15a5bc(_0x471003[_0x5d1f('0x17')]['message']);}})[_0x5d1f('0x18')](function(_0xd97672){logger['error']('MailQueue,\x20%s,\x20%s',_0x2f7114,_0xd97672);_0xe240d5(_0xd97672);});});}exports[_0x5d1f('0x19')]=function(_0x4515d5){var _0x194df1=this;return new Promise(function(_0x28f373,_0x2b8a57){return db[_0x5d1f('0x1a')]['findAll']({'raw':_0x4515d5[_0x5d1f('0x1b')]?_0x4515d5['options'][_0x5d1f('0x1c')]===undefined?!![]:![]:!![],'where':_0x4515d5[_0x5d1f('0x1b')]?_0x4515d5[_0x5d1f('0x1b')][_0x5d1f('0x1d')]||null:null,'attributes':_0x4515d5[_0x5d1f('0x1b')]?_0x4515d5[_0x5d1f('0x1b')][_0x5d1f('0x1e')]||null:null,'limit':_0x4515d5[_0x5d1f('0x1b')]?_0x4515d5[_0x5d1f('0x1b')][_0x5d1f('0x1f')]||null:null,'include':_0x4515d5['options']?_0x4515d5[_0x5d1f('0x1b')][_0x5d1f('0x20')]?_['map'](_0x4515d5[_0x5d1f('0x1b')][_0x5d1f('0x20')],function(_0x5286e7){return{'model':db[_0x5286e7[_0x5d1f('0x21')]],'as':_0x5286e7['as'],'attributes':_0x5286e7['attributes'],'include':_0x5286e7[_0x5d1f('0x20')]?_[_0x5d1f('0x22')](_0x5286e7['include'],function(_0x449f6d){return{'model':db[_0x449f6d[_0x5d1f('0x21')]],'as':_0x449f6d['as'],'attributes':_0x449f6d[_0x5d1f('0x1e')],'include':_0x449f6d[_0x5d1f('0x20')]?_['map'](_0x449f6d[_0x5d1f('0x20')],function(_0x143a70){return{'model':db[_0x143a70[_0x5d1f('0x21')]],'as':_0x143a70['as'],'attributes':_0x143a70['attributes']};}):[]};}):[]};}):[]:[]})[_0x5d1f('0xd')](function(_0x17b8e0){logger[_0x5d1f('0xe')](_0x5d1f('0x19'),_0x4515d5);logger['debug'](_0x5d1f('0x19'),_0x4515d5,JSON['stringify'](_0x17b8e0));_0x28f373(_0x17b8e0);})[_0x5d1f('0x18')](function(_0x489ec4){logger[_0x5d1f('0x14')](_0x5d1f('0x19'),_0x489ec4[_0x5d1f('0x16')],_0x4515d5);_0x2b8a57(_0x194df1[_0x5d1f('0x14')](0x1f4,_0x489ec4[_0x5d1f('0x16')]));});});};exports[_0x5d1f('0x23')]=function(_0x1062d3){var _0x2deb35=this;return new Promise(function(_0x1c5bd6,_0x4169ce){return db[_0x5d1f('0x1a')][_0x5d1f('0x24')]({'raw':_0x1062d3[_0x5d1f('0x1b')]?_0x1062d3['options'][_0x5d1f('0x1c')]===undefined?!![]:![]:!![],'where':_0x1062d3[_0x5d1f('0x1b')]?_0x1062d3[_0x5d1f('0x1b')][_0x5d1f('0x1d')]||null:null,'attributes':_0x1062d3[_0x5d1f('0x1b')]?_0x1062d3[_0x5d1f('0x1b')][_0x5d1f('0x1e')]||null:null,'include':_0x1062d3[_0x5d1f('0x1b')]?_0x1062d3['options'][_0x5d1f('0x20')]?_[_0x5d1f('0x22')](_0x1062d3[_0x5d1f('0x1b')][_0x5d1f('0x20')],function(_0x47aeea){return{'model':db[_0x47aeea[_0x5d1f('0x21')]],'as':_0x47aeea['as'],'attributes':_0x47aeea[_0x5d1f('0x1e')],'include':_0x47aeea[_0x5d1f('0x20')]?_[_0x5d1f('0x22')](_0x47aeea['include'],function(_0x3ea0b1){return{'model':db[_0x3ea0b1[_0x5d1f('0x21')]],'as':_0x3ea0b1['as'],'attributes':_0x3ea0b1[_0x5d1f('0x1e')],'include':_0x3ea0b1[_0x5d1f('0x20')]?_[_0x5d1f('0x22')](_0x3ea0b1['include'],function(_0x4c1a06){return{'model':db[_0x4c1a06[_0x5d1f('0x21')]],'as':_0x4c1a06['as'],'attributes':_0x4c1a06[_0x5d1f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5d1f('0xd')](function(_0x3e6b27){logger[_0x5d1f('0xe')]('ShowMailQueue',_0x1062d3);logger[_0x5d1f('0x11')](_0x5d1f('0x23'),_0x1062d3,JSON['stringify'](_0x3e6b27));_0x1c5bd6(_0x3e6b27);})['catch'](function(_0x17d4b8){logger[_0x5d1f('0x14')](_0x5d1f('0x23'),_0x17d4b8['message'],_0x1062d3);_0x4169ce(_0x2deb35['error'](0x1f4,_0x17d4b8[_0x5d1f('0x16')]));});});};
\ No newline at end of file
+var _0x33a4=['redis','./mailQueue.socket','request','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetMailQueue','MailQueue','options','raw','where','limit','include','map','attributes','then','ShowMailQueue','find','model','util','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter'];(function(_0x14363e,_0x4f0e0d){var _0x17c56d=function(_0x1c7bac){while(--_0x1c7bac){_0x14363e['push'](_0x14363e['shift']());}};_0x17c56d(++_0x4f0e0d);}(_0x33a4,0x88));var _0x433a=function(_0x40ffac,_0x1fa7df){_0x40ffac=_0x40ffac-0x0;var _0x2892f9=_0x33a4[_0x40ffac];return _0x2892f9;};'use strict';var _=require('lodash');var util=require(_0x433a('0x0'));var moment=require('moment');var BPromise=require(_0x433a('0x1'));var rs=require(_0x433a('0x2'));var fs=require('fs');var Redis=require(_0x433a('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x433a('0x4'));var config=require(_0x433a('0x5'));var jayson=require(_0x433a('0x6'));var client=jayson[_0x433a('0x7')][_0x433a('0x8')]({'port':0x232a});config['redis']=_[_0x433a('0x9')](config['redis'],{'host':_0x433a('0xa'),'port':0x18eb});var socket=require(_0x433a('0xb'))(new Redis(config[_0x433a('0xc')]));require(_0x433a('0xd'))['register'](socket);function respondWithRpcPromise(_0x4ac437,_0x3e52a0,_0x12db5c){return new BPromise(function(_0x19a533,_0x3f4eee){return client[_0x433a('0xe')](_0x4ac437,_0x12db5c)['then'](function(_0x495d26){logger[_0x433a('0xf')](_0x433a('0x10'),_0x3e52a0,_0x433a('0x11'));logger[_0x433a('0x12')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x3e52a0,_0x433a('0x11'),JSON[_0x433a('0x13')](_0x495d26));if(_0x495d26['error']){if(_0x495d26[_0x433a('0x14')]['code']===0x1f4){logger[_0x433a('0x14')](_0x433a('0x10'),_0x3e52a0,_0x495d26[_0x433a('0x14')]['message']);return _0x3f4eee(_0x495d26['error'][_0x433a('0x15')]);}logger[_0x433a('0x14')](_0x433a('0x10'),_0x3e52a0,_0x495d26[_0x433a('0x14')][_0x433a('0x15')]);return _0x19a533(_0x495d26['error']['message']);}else{logger[_0x433a('0xf')](_0x433a('0x10'),_0x3e52a0,_0x433a('0x11'));_0x19a533(_0x495d26[_0x433a('0x16')][_0x433a('0x15')]);}})[_0x433a('0x17')](function(_0x35fa83){logger[_0x433a('0x14')](_0x433a('0x10'),_0x3e52a0,_0x35fa83);_0x3f4eee(_0x35fa83);});});}exports[_0x433a('0x18')]=function(_0x36db9f){var _0x5a37ad=this;return new Promise(function(_0xfc331a,_0x566ae7){return db[_0x433a('0x19')]['findAll']({'raw':_0x36db9f[_0x433a('0x1a')]?_0x36db9f[_0x433a('0x1a')][_0x433a('0x1b')]===undefined?!![]:![]:!![],'where':_0x36db9f[_0x433a('0x1a')]?_0x36db9f[_0x433a('0x1a')][_0x433a('0x1c')]||null:null,'attributes':_0x36db9f[_0x433a('0x1a')]?_0x36db9f['options']['attributes']||null:null,'limit':_0x36db9f[_0x433a('0x1a')]?_0x36db9f['options'][_0x433a('0x1d')]||null:null,'include':_0x36db9f['options']?_0x36db9f[_0x433a('0x1a')][_0x433a('0x1e')]?_[_0x433a('0x1f')](_0x36db9f[_0x433a('0x1a')][_0x433a('0x1e')],function(_0xaea8aa){return{'model':db[_0xaea8aa['model']],'as':_0xaea8aa['as'],'attributes':_0xaea8aa[_0x433a('0x20')],'include':_0xaea8aa[_0x433a('0x1e')]?_['map'](_0xaea8aa[_0x433a('0x1e')],function(_0x571461){return{'model':db[_0x571461['model']],'as':_0x571461['as'],'attributes':_0x571461['attributes'],'include':_0x571461[_0x433a('0x1e')]?_['map'](_0x571461[_0x433a('0x1e')],function(_0x499e8c){return{'model':db[_0x499e8c['model']],'as':_0x499e8c['as'],'attributes':_0x499e8c[_0x433a('0x20')]};}):[]};}):[]};}):[]:[]})[_0x433a('0x21')](function(_0x147bb9){logger['info'](_0x433a('0x18'),_0x36db9f);logger[_0x433a('0x12')](_0x433a('0x18'),_0x36db9f,JSON['stringify'](_0x147bb9));_0xfc331a(_0x147bb9);})['catch'](function(_0x713b41){logger[_0x433a('0x14')](_0x433a('0x18'),_0x713b41[_0x433a('0x15')],_0x36db9f);_0x566ae7(_0x5a37ad[_0x433a('0x14')](0x1f4,_0x713b41[_0x433a('0x15')]));});});};exports[_0x433a('0x22')]=function(_0x3b6a19){var _0x5246a6=this;return new Promise(function(_0x3c84cb,_0x2459d7){return db[_0x433a('0x19')][_0x433a('0x23')]({'raw':_0x3b6a19[_0x433a('0x1a')]?_0x3b6a19[_0x433a('0x1a')][_0x433a('0x1b')]===undefined?!![]:![]:!![],'where':_0x3b6a19[_0x433a('0x1a')]?_0x3b6a19[_0x433a('0x1a')][_0x433a('0x1c')]||null:null,'attributes':_0x3b6a19[_0x433a('0x1a')]?_0x3b6a19['options'][_0x433a('0x20')]||null:null,'include':_0x3b6a19[_0x433a('0x1a')]?_0x3b6a19[_0x433a('0x1a')][_0x433a('0x1e')]?_[_0x433a('0x1f')](_0x3b6a19[_0x433a('0x1a')][_0x433a('0x1e')],function(_0x367875){return{'model':db[_0x367875[_0x433a('0x24')]],'as':_0x367875['as'],'attributes':_0x367875[_0x433a('0x20')],'include':_0x367875[_0x433a('0x1e')]?_['map'](_0x367875[_0x433a('0x1e')],function(_0x266a9c){return{'model':db[_0x266a9c['model']],'as':_0x266a9c['as'],'attributes':_0x266a9c['attributes'],'include':_0x266a9c[_0x433a('0x1e')]?_['map'](_0x266a9c[_0x433a('0x1e')],function(_0x20fc31){return{'model':db[_0x20fc31[_0x433a('0x24')]],'as':_0x20fc31['as'],'attributes':_0x20fc31['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x28a10c){logger[_0x433a('0xf')](_0x433a('0x22'),_0x3b6a19);logger[_0x433a('0x12')](_0x433a('0x22'),_0x3b6a19,JSON[_0x433a('0x13')](_0x28a10c));_0x3c84cb(_0x28a10c);})['catch'](function(_0x4e1cac){logger[_0x433a('0x14')](_0x433a('0x22'),_0x4e1cac['message'],_0x3b6a19);_0x2459d7(_0x5246a6[_0x433a('0x14')](0x1f4,_0x4e1cac[_0x433a('0x15')]));});});};
\ No newline at end of file
index a6cec9a..3eaf13f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b63=['emit','removeListener','mailQueue:','./mailQueue.events','save'];(function(_0x457e9f,_0x4fbeee){var _0x5e72e6=function(_0xe7e24b){while(--_0xe7e24b){_0x457e9f['push'](_0x457e9f['shift']());}};_0x5e72e6(++_0x4fbeee);}(_0x2b63,0x1d4));var _0x32b6=function(_0x172da4,_0x3780c0){_0x172da4=_0x172da4-0x0;var _0x5c64df=_0x2b63[_0x172da4];return _0x5c64df;};'use strict';var MailQueueEvents=require(_0x32b6('0x0'));var events=[_0x32b6('0x1'),'remove','update'];function createListener(_0x570232,_0x2aa67e){return function(_0x4f27e8){_0x2aa67e[_0x32b6('0x2')](_0x570232,_0x4f27e8);};}function removeListener(_0x3860d9,_0x599fb8){return function(){MailQueueEvents[_0x32b6('0x3')](_0x3860d9,_0x599fb8);};}exports['register']=function(_0x155610){for(var _0x163005=0x0,_0x1ad155=events['length'];_0x163005<_0x1ad155;_0x163005++){var _0x344f64=events[_0x163005];var _0x5667c9=createListener(_0x32b6('0x4')+_0x344f64,_0x155610);MailQueueEvents['on'](_0x344f64,_0x5667c9);}};
\ No newline at end of file
+var _0x2c05=['removeListener','register','length','./mailQueue.events','save','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2c05,0xff));var _0x52c0=function(_0x10b418,_0x25b1f2){_0x10b418=_0x10b418-0x0;var _0xd0377f=_0x2c05[_0x10b418];return _0xd0377f;};'use strict';var MailQueueEvents=require(_0x52c0('0x0'));var events=[_0x52c0('0x1'),'remove',_0x52c0('0x2')];function createListener(_0x55a963,_0x5f5cd3){return function(_0x2bc05d){_0x5f5cd3[_0x52c0('0x3')](_0x55a963,_0x2bc05d);};}function removeListener(_0xb41a99,_0x432f70){return function(){MailQueueEvents[_0x52c0('0x4')](_0xb41a99,_0x432f70);};}exports[_0x52c0('0x5')]=function(_0x642719){for(var _0x526ffb=0x0,_0x548f79=events[_0x52c0('0x6')];_0x526ffb<_0x548f79;_0x526ffb++){var _0x332cb4=events[_0x526ffb];var _0x206f02=createListener('mailQueue:'+_0x332cb4,_0x642719);MailQueueEvents['on'](_0x332cb4,_0x206f02);}};
\ No newline at end of file
index e917cc5..1f429a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd158=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','isAuthenticated','index','/describe','get','/:id','show','create','put','update','delete','exports'];(function(_0x136c89,_0xe605ff){var _0x33ea8b=function(_0x2b75f5){while(--_0x2b75f5){_0x136c89['push'](_0x136c89['shift']());}};_0x33ea8b(++_0xe605ff);}(_0xd158,0xbd));var _0x8d15=function(_0x41d5ee,_0x2a7dfe){_0x41d5ee=_0x41d5ee-0x0;var _0x41fbb5=_0xd158[_0x41d5ee];return _0x41fbb5;};'use strict';var multer=require(_0x8d15('0x0'));var util=require(_0x8d15('0x1'));var path=require(_0x8d15('0x2'));var timeout=require(_0x8d15('0x3'));var express=require(_0x8d15('0x4'));var router=express['Router']();var fs_extra=require(_0x8d15('0x5'));var auth=require(_0x8d15('0x6'));var interaction=require(_0x8d15('0x7'));var config=require(_0x8d15('0x8'));var controller=require(_0x8d15('0x9'));router['get']('/',auth[_0x8d15('0xa')](),controller[_0x8d15('0xb')]);router['get'](_0x8d15('0xc'),auth[_0x8d15('0xa')](),controller['describe']);router[_0x8d15('0xd')](_0x8d15('0xe'),auth[_0x8d15('0xa')](),controller[_0x8d15('0xf')]);router['post']('/',auth[_0x8d15('0xa')](),controller[_0x8d15('0x10')]);router[_0x8d15('0x11')]('/:id',auth[_0x8d15('0xa')](),controller[_0x8d15('0x12')]);router[_0x8d15('0x13')](_0x8d15('0xe'),auth[_0x8d15('0xa')](),controller['destroy']);module[_0x8d15('0x14')]=router;
\ No newline at end of file
+var _0x5bef=['/describe','describe','/:id','post','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x151334,_0x1e11ac){var _0x3d03da=function(_0x2099cf){while(--_0x2099cf){_0x151334['push'](_0x151334['shift']());}};_0x3d03da(++_0x1e11ac);}(_0x5bef,0x7f));var _0xf5be=function(_0x3c7741,_0xe8c99d){_0x3c7741=_0x3c7741-0x0;var _0x2d9679=_0x5bef[_0x3c7741];return _0x2d9679;};'use strict';var multer=require(_0xf5be('0x0'));var util=require(_0xf5be('0x1'));var path=require(_0xf5be('0x2'));var timeout=require(_0xf5be('0x3'));var express=require(_0xf5be('0x4'));var router=express[_0xf5be('0x5')]();var fs_extra=require(_0xf5be('0x6'));var auth=require(_0xf5be('0x7'));var interaction=require(_0xf5be('0x8'));var config=require(_0xf5be('0x9'));var controller=require('./mailQueueReport.controller');router[_0xf5be('0xa')]('/',auth[_0xf5be('0xb')](),controller[_0xf5be('0xc')]);router[_0xf5be('0xa')](_0xf5be('0xd'),auth[_0xf5be('0xb')](),controller[_0xf5be('0xe')]);router['get'](_0xf5be('0xf'),auth[_0xf5be('0xb')](),controller['show']);router[_0xf5be('0x10')]('/',auth[_0xf5be('0xb')](),controller['create']);router[_0xf5be('0x11')](_0xf5be('0xf'),auth[_0xf5be('0xb')](),controller['update']);router[_0xf5be('0x12')](_0xf5be('0xf'),auth[_0xf5be('0xb')](),controller['destroy']);module[_0xf5be('0x13')]=router;
\ No newline at end of file
index 565d570..f0f8831 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe51b=['STRING','DATE','moment','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe51b,0x92));var _0xbe51=function(_0x4d2cba,_0x92444a){_0x4d2cba=_0x4d2cba-0x0;var _0x4e954a=_0xe51b[_0x4d2cba];return _0x4e954a;};'use strict';var moment=require(_0xbe51('0x0'));var Sequelize=require(_0xbe51('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbe51('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xbe51('0x2')]},'joinAt':{'type':Sequelize[_0xbe51('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xbe51('0x3')]},'exitAt':{'type':Sequelize[_0xbe51('0x3')]},'reason':{'type':Sequelize[_0xbe51('0x2')]}};
\ No newline at end of file
+var _0x100a=['moment','sequelize','exports','STRING','DATE'];(function(_0x220719,_0x1cabf9){var _0x28b05e=function(_0x21d4d2){while(--_0x21d4d2){_0x220719['push'](_0x220719['shift']());}};_0x28b05e(++_0x1cabf9);}(_0x100a,0x87));var _0xa100=function(_0x23f948,_0x197541){_0x23f948=_0x23f948-0x0;var _0x4b2c20=_0x100a[_0x23f948];return _0x4b2c20;};'use strict';var moment=require(_0xa100('0x0'));var Sequelize=require(_0xa100('0x1'));module[_0xa100('0x2')]={'uniqueid':{'type':Sequelize[_0xa100('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xa100('0x3')]},'joinAt':{'type':Sequelize[_0xa100('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xa100('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 262458a..39eb4b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d04=['Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','MailQueueReport','rows','catch','show','params','rawAttributes','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset'];(function(_0x1b633a,_0x56b65b){var _0x5e2d0c=function(_0x4f3a75){while(--_0x4f3a75){_0x1b633a['push'](_0x1b633a['shift']());}};_0x5e2d0c(++_0x56b65b);}(_0x3d04,0xbe));var _0x43d0=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x3d04[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x43d0('0x0'));var rimraf=require(_0x43d0('0x1'));var zipdir=require(_0x43d0('0x2'));var jsonpatch=require(_0x43d0('0x3'));var rp=require(_0x43d0('0x4'));var moment=require(_0x43d0('0x5'));var BPromise=require(_0x43d0('0x6'));var Mustache=require(_0x43d0('0x7'));var util=require('util');var path=require(_0x43d0('0x8'));var sox=require(_0x43d0('0x9'));var csv=require(_0x43d0('0xa'));var ejs=require(_0x43d0('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x43d0('0xc'));var deskjs=require(_0x43d0('0xd'));var toCsv=require(_0x43d0('0xa'));var querystring=require(_0x43d0('0xe'));var Papa=require(_0x43d0('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43d0('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x43d0('0x11'))(_0x43d0('0x12'));var utils=require(_0x43d0('0x13'));var config=require(_0x43d0('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x43d0('0x15'))['db'];function respondWithStatusCode(_0x23daaa,_0x546b23){_0x546b23=_0x546b23||0xcc;return function(_0x29773b){if(_0x29773b){return _0x23daaa[_0x43d0('0x16')](_0x546b23);}return _0x23daaa[_0x43d0('0x17')](_0x546b23)['end']();};}function respondWithResult(_0xd262a8,_0x2454fa){_0x2454fa=_0x2454fa||0xc8;return function(_0x436130){if(_0x436130){return _0xd262a8['status'](_0x2454fa)[_0x43d0('0x18')](_0x436130);}};}function respondWithFilteredResult(_0x357f87,_0x44e6ec){return function(_0x1218b5){if(_0x1218b5){var _0x91b4a1=typeof _0x44e6ec['offset']==='undefined'&&typeof _0x44e6ec[_0x43d0('0x19')]===_0x43d0('0x1a');var _0x35decf=_0x1218b5['count'];var _0x2c641e=_0x91b4a1?0x0:_0x44e6ec['offset'];var _0x2c9d06=_0x91b4a1?_0x1218b5[_0x43d0('0x1b')]:_0x44e6ec[_0x43d0('0x1c')]+_0x44e6ec['limit'];var _0x3d7dcc;if(_0x2c9d06>=_0x35decf){_0x2c9d06=_0x35decf;_0x3d7dcc=0xc8;}else{_0x3d7dcc=0xce;}_0x357f87[_0x43d0('0x17')](_0x3d7dcc);return _0x357f87['set'](_0x43d0('0x1d'),_0x2c641e+'-'+_0x2c9d06+'/'+_0x35decf)[_0x43d0('0x18')](_0x1218b5);}return null;};}function patchUpdates(_0x348429){return function(_0x248622){try{jsonpatch[_0x43d0('0x1e')](_0x248622,_0x348429,!![]);}catch(_0x28381b){return BPromise[_0x43d0('0x1f')](_0x28381b);}return _0x248622[_0x43d0('0x20')]();};}function saveUpdates(_0x30febc,_0xc8a644){return function(_0xec5f07){if(_0xec5f07){return _0xec5f07[_0x43d0('0x21')](_0x30febc)[_0x43d0('0x22')](function(_0xbc72e6){return _0xbc72e6;});}return null;};}function removeEntity(_0x2efd77,_0x48aa18){return function(_0x2c7b24){if(_0x2c7b24){return _0x2c7b24[_0x43d0('0x23')]()['then'](function(){_0x2efd77[_0x43d0('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29c111,_0x44497b){return function(_0x5dd310){if(!_0x5dd310){_0x29c111[_0x43d0('0x16')](0x194);}return _0x5dd310;};}function handleError(_0x238c64,_0x5ac4c0){_0x5ac4c0=_0x5ac4c0||0x1f4;return function(_0x12df30){logger[_0x43d0('0x24')](_0x12df30[_0x43d0('0x25')]);if(_0x12df30['name']){delete _0x12df30[_0x43d0('0x26')];}_0x238c64[_0x43d0('0x17')](_0x5ac4c0)[_0x43d0('0x27')](_0x12df30);};}exports[_0x43d0('0x28')]=function(_0x37d78f,_0x440ecb){var _0x31a057={},_0x4a3cd4={},_0x2b0784={'count':0x0,'rows':[]};var _0x2f5bc5=_[_0x43d0('0x29')](db['MailQueueReport']['rawAttributes'],function(_0x52c37b){return{'name':_0x52c37b[_0x43d0('0x2a')],'type':_0x52c37b[_0x43d0('0x2b')][_0x43d0('0x2c')]};});_0x4a3cd4[_0x43d0('0x2d')]=_[_0x43d0('0x29')](_0x2f5bc5,_0x43d0('0x26'));_0x4a3cd4['query']=_[_0x43d0('0x2e')](_0x37d78f[_0x43d0('0x2f')]);_0x4a3cd4[_0x43d0('0x30')]=_[_0x43d0('0x31')](_0x4a3cd4[_0x43d0('0x2d')],_0x4a3cd4[_0x43d0('0x2f')]);_0x31a057[_0x43d0('0x32')]=_[_0x43d0('0x31')](_0x4a3cd4[_0x43d0('0x2d')],qs[_0x43d0('0x33')](_0x37d78f[_0x43d0('0x2f')]['fields']));_0x31a057[_0x43d0('0x32')]=_0x31a057[_0x43d0('0x32')][_0x43d0('0x34')]?_0x31a057[_0x43d0('0x32')]:_0x4a3cd4['model'];if(!_0x37d78f[_0x43d0('0x2f')]['hasOwnProperty'](_0x43d0('0x35'))){_0x31a057[_0x43d0('0x19')]=qs['limit'](_0x37d78f[_0x43d0('0x2f')][_0x43d0('0x19')]);_0x31a057[_0x43d0('0x1c')]=qs[_0x43d0('0x1c')](_0x37d78f[_0x43d0('0x2f')][_0x43d0('0x1c')]);}_0x31a057[_0x43d0('0x36')]=qs[_0x43d0('0x37')](_0x37d78f[_0x43d0('0x2f')][_0x43d0('0x37')]);_0x31a057[_0x43d0('0x38')]=qs['filters'](_[_0x43d0('0x39')](_0x37d78f[_0x43d0('0x2f')],_0x4a3cd4[_0x43d0('0x30')]),_0x2f5bc5);if(_0x37d78f[_0x43d0('0x2f')][_0x43d0('0x3a')]){_0x31a057[_0x43d0('0x38')]=_[_0x43d0('0x3b')](_0x31a057[_0x43d0('0x38')],{'$or':_[_0x43d0('0x29')](_0x2f5bc5,function(_0x43bcc5){if(_0x43bcc5[_0x43d0('0x2b')]!==_0x43d0('0x3c')){var _0x19843c={};_0x19843c[_0x43bcc5[_0x43d0('0x26')]]={'$like':'%'+_0x37d78f['query'][_0x43d0('0x3a')]+'%'};return _0x19843c;}})});}_0x31a057=_[_0x43d0('0x3b')]({},_0x31a057,_0x37d78f[_0x43d0('0x3d')]);var _0xc3f9c7={'where':_0x31a057[_0x43d0('0x38')]};return db[_0x43d0('0x3e')][_0x43d0('0x1b')](_0xc3f9c7)[_0x43d0('0x22')](function(_0x4ae965){_0x2b0784['count']=_0x4ae965;if(_0x37d78f[_0x43d0('0x2f')]['includeAll']){_0x31a057['include']=[{'all':!![]}];}return db[_0x43d0('0x3e')]['findAll'](_0x31a057);})[_0x43d0('0x22')](function(_0x5027d0){_0x2b0784[_0x43d0('0x3f')]=_0x5027d0;return _0x2b0784;})['then'](respondWithFilteredResult(_0x440ecb,_0x31a057))[_0x43d0('0x40')](handleError(_0x440ecb,null));};exports[_0x43d0('0x41')]=function(_0x468b32,_0x4e817e){var _0x3eb2e9={'raw':!![],'where':{'id':_0x468b32[_0x43d0('0x42')]['id']}},_0x520406={};_0x520406['model']=_['keys'](db[_0x43d0('0x3e')][_0x43d0('0x43')]);_0x520406['query']=_[_0x43d0('0x2e')](_0x468b32[_0x43d0('0x2f')]);_0x520406[_0x43d0('0x30')]=_[_0x43d0('0x31')](_0x520406[_0x43d0('0x2d')],_0x520406['query']);_0x3eb2e9[_0x43d0('0x32')]=_[_0x43d0('0x31')](_0x520406[_0x43d0('0x2d')],qs[_0x43d0('0x33')](_0x468b32['query'][_0x43d0('0x33')]));_0x3eb2e9[_0x43d0('0x32')]=_0x3eb2e9[_0x43d0('0x32')][_0x43d0('0x34')]?_0x3eb2e9[_0x43d0('0x32')]:_0x520406['model'];if(_0x468b32[_0x43d0('0x2f')][_0x43d0('0x44')]){_0x3eb2e9['include']=[{'all':!![]}];}_0x3eb2e9=_[_0x43d0('0x3b')]({},_0x3eb2e9,_0x468b32[_0x43d0('0x3d')]);return db[_0x43d0('0x3e')]['find'](_0x3eb2e9)[_0x43d0('0x22')](handleEntityNotFound(_0x4e817e,null))['then'](respondWithResult(_0x4e817e,null))[_0x43d0('0x40')](handleError(_0x4e817e,null));};exports['create']=function(_0x1f55e9,_0x269d99){return db[_0x43d0('0x3e')][_0x43d0('0x45')](_0x1f55e9[_0x43d0('0x46')],{})['then'](respondWithResult(_0x269d99,0xc9))[_0x43d0('0x40')](handleError(_0x269d99,null));};exports['update']=function(_0x5a6364,_0x3e7392){if(_0x5a6364[_0x43d0('0x46')]['id']){delete _0x5a6364[_0x43d0('0x46')]['id'];}return db[_0x43d0('0x3e')][_0x43d0('0x47')]({'where':{'id':_0x5a6364[_0x43d0('0x42')]['id']}})[_0x43d0('0x22')](handleEntityNotFound(_0x3e7392,null))[_0x43d0('0x22')](saveUpdates(_0x5a6364[_0x43d0('0x46')],null))[_0x43d0('0x22')](respondWithResult(_0x3e7392,null))[_0x43d0('0x40')](handleError(_0x3e7392,null));};exports['destroy']=function(_0x338203,_0xd78af1){return db[_0x43d0('0x3e')]['find']({'where':{'id':_0x338203[_0x43d0('0x42')]['id']}})['then'](handleEntityNotFound(_0xd78af1,null))['then'](removeEntity(_0xd78af1,null))[_0x43d0('0x40')](handleError(_0xd78af1,null));};exports[_0x43d0('0x48')]=function(_0x234571,_0x127815){return db[_0x43d0('0x3e')]['describe']()['then'](respondWithResult(_0x127815,null))[_0x43d0('0x40')](handleError(_0x127815,null));};
\ No newline at end of file
+var _0xacf4=['findAll','rows','catch','show','params','intersection','length','includeAll','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','MailQueueReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','hasOwnProperty','sort','where','pick','filter','type','VIRTUAL','merge','options','include'];(function(_0x3d13bb,_0x262a54){var _0x4b5a1b=function(_0x53417e){while(--_0x53417e){_0x3d13bb['push'](_0x3d13bb['shift']());}};_0x4b5a1b(++_0x262a54);}(_0xacf4,0xe7));var _0x4acf=function(_0x28c6d2,_0xb0d949){_0x28c6d2=_0x28c6d2-0x0;var _0x4cd798=_0xacf4[_0x28c6d2];return _0x4cd798;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4acf('0x0'));var jsonpatch=require(_0x4acf('0x1'));var rp=require(_0x4acf('0x2'));var moment=require(_0x4acf('0x3'));var BPromise=require(_0x4acf('0x4'));var Mustache=require(_0x4acf('0x5'));var util=require(_0x4acf('0x6'));var path=require('path');var sox=require(_0x4acf('0x7'));var csv=require(_0x4acf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4acf('0x9'));var _=require(_0x4acf('0xa'));var squel=require(_0x4acf('0xb'));var crypto=require(_0x4acf('0xc'));var jsforce=require(_0x4acf('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4acf('0xe'));var Papa=require('papaparse');var Redis=require(_0x4acf('0xf'));var authService=require(_0x4acf('0x10'));var qs=require(_0x4acf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4acf('0x12'));var logger=require(_0x4acf('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x4acf('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1783d2,_0x979f49){_0x979f49=_0x979f49||0xcc;return function(_0x3734e1){if(_0x3734e1){return _0x1783d2[_0x4acf('0x15')](_0x979f49);}return _0x1783d2[_0x4acf('0x16')](_0x979f49)[_0x4acf('0x17')]();};}function respondWithResult(_0x7ab3ea,_0x15386a){_0x15386a=_0x15386a||0xc8;return function(_0x2025ca){if(_0x2025ca){return _0x7ab3ea[_0x4acf('0x16')](_0x15386a)[_0x4acf('0x18')](_0x2025ca);}};}function respondWithFilteredResult(_0x5f0260,_0x1b584a){return function(_0x57d8e0){if(_0x57d8e0){var _0x34cec1=typeof _0x1b584a[_0x4acf('0x19')]===_0x4acf('0x1a')&&typeof _0x1b584a['limit']==='undefined';var _0x13d10e=_0x57d8e0[_0x4acf('0x1b')];var _0x240c00=_0x34cec1?0x0:_0x1b584a['offset'];var _0x2a678b=_0x34cec1?_0x57d8e0[_0x4acf('0x1b')]:_0x1b584a[_0x4acf('0x19')]+_0x1b584a[_0x4acf('0x1c')];var _0x2f0cec;if(_0x2a678b>=_0x13d10e){_0x2a678b=_0x13d10e;_0x2f0cec=0xc8;}else{_0x2f0cec=0xce;}_0x5f0260[_0x4acf('0x16')](_0x2f0cec);return _0x5f0260[_0x4acf('0x1d')](_0x4acf('0x1e'),_0x240c00+'-'+_0x2a678b+'/'+_0x13d10e)[_0x4acf('0x18')](_0x57d8e0);}return null;};}function patchUpdates(_0x2feb89){return function(_0x1a3118){try{jsonpatch['apply'](_0x1a3118,_0x2feb89,!![]);}catch(_0x28d698){return BPromise[_0x4acf('0x1f')](_0x28d698);}return _0x1a3118['save']();};}function saveUpdates(_0x41e5d2,_0x17775f){return function(_0x569d9e){if(_0x569d9e){return _0x569d9e[_0x4acf('0x20')](_0x41e5d2)[_0x4acf('0x21')](function(_0x433b7a){return _0x433b7a;});}return null;};}function removeEntity(_0x454555,_0x53885f){return function(_0x1a2286){if(_0x1a2286){return _0x1a2286[_0x4acf('0x22')]()['then'](function(){_0x454555[_0x4acf('0x16')](0xcc)[_0x4acf('0x17')]();});}};}function handleEntityNotFound(_0x52a84a,_0x126522){return function(_0x7ebb){if(!_0x7ebb){_0x52a84a[_0x4acf('0x15')](0x194);}return _0x7ebb;};}function handleError(_0x16458f,_0x571a30){_0x571a30=_0x571a30||0x1f4;return function(_0x50236d){logger[_0x4acf('0x23')](_0x50236d[_0x4acf('0x24')]);if(_0x50236d[_0x4acf('0x25')]){delete _0x50236d[_0x4acf('0x25')];}_0x16458f[_0x4acf('0x16')](_0x571a30)[_0x4acf('0x26')](_0x50236d);};}exports[_0x4acf('0x27')]=function(_0x7a1e79,_0x382c41){var _0x2a3830={},_0x57989e={},_0x3521c2={'count':0x0,'rows':[]};var _0x3f5614=_[_0x4acf('0x28')](db[_0x4acf('0x29')][_0x4acf('0x2a')],function(_0x28570f){return{'name':_0x28570f[_0x4acf('0x2b')],'type':_0x28570f['type'][_0x4acf('0x2c')]};});_0x57989e[_0x4acf('0x2d')]=_[_0x4acf('0x28')](_0x3f5614,'name');_0x57989e[_0x4acf('0x2e')]=_[_0x4acf('0x2f')](_0x7a1e79[_0x4acf('0x2e')]);_0x57989e[_0x4acf('0x30')]=_['intersection'](_0x57989e[_0x4acf('0x2d')],_0x57989e[_0x4acf('0x2e')]);_0x2a3830[_0x4acf('0x31')]=_['intersection'](_0x57989e[_0x4acf('0x2d')],qs[_0x4acf('0x32')](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x32')]));_0x2a3830[_0x4acf('0x31')]=_0x2a3830[_0x4acf('0x31')]['length']?_0x2a3830[_0x4acf('0x31')]:_0x57989e[_0x4acf('0x2d')];if(!_0x7a1e79['query'][_0x4acf('0x33')]('nolimit')){_0x2a3830['limit']=qs['limit'](_0x7a1e79['query']['limit']);_0x2a3830['offset']=qs['offset'](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x19')]);}_0x2a3830['order']=qs[_0x4acf('0x34')](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x34')]);_0x2a3830[_0x4acf('0x35')]=qs[_0x4acf('0x30')](_[_0x4acf('0x36')](_0x7a1e79[_0x4acf('0x2e')],_0x57989e[_0x4acf('0x30')]),_0x3f5614);if(_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x37')]){_0x2a3830['where']=_['merge'](_0x2a3830[_0x4acf('0x35')],{'$or':_[_0x4acf('0x28')](_0x3f5614,function(_0x4859b6){if(_0x4859b6[_0x4acf('0x38')]!==_0x4acf('0x39')){var _0x43a2ea={};_0x43a2ea[_0x4859b6[_0x4acf('0x25')]]={'$like':'%'+_0x7a1e79['query']['filter']+'%'};return _0x43a2ea;}})});}_0x2a3830=_[_0x4acf('0x3a')]({},_0x2a3830,_0x7a1e79[_0x4acf('0x3b')]);var _0x3d5529={'where':_0x2a3830[_0x4acf('0x35')]};return db['MailQueueReport'][_0x4acf('0x1b')](_0x3d5529)[_0x4acf('0x21')](function(_0x4e9370){_0x3521c2['count']=_0x4e9370;if(_0x7a1e79['query']['includeAll']){_0x2a3830[_0x4acf('0x3c')]=[{'all':!![]}];}return db[_0x4acf('0x29')][_0x4acf('0x3d')](_0x2a3830);})['then'](function(_0x1015e3){_0x3521c2[_0x4acf('0x3e')]=_0x1015e3;return _0x3521c2;})[_0x4acf('0x21')](respondWithFilteredResult(_0x382c41,_0x2a3830))[_0x4acf('0x3f')](handleError(_0x382c41,null));};exports[_0x4acf('0x40')]=function(_0xea75e4,_0x7cf2a){var _0x17d5e9={'raw':!![],'where':{'id':_0xea75e4[_0x4acf('0x41')]['id']}},_0x461547={};_0x461547[_0x4acf('0x2d')]=_['keys'](db[_0x4acf('0x29')][_0x4acf('0x2a')]);_0x461547[_0x4acf('0x2e')]=_[_0x4acf('0x2f')](_0xea75e4[_0x4acf('0x2e')]);_0x461547['filters']=_['intersection'](_0x461547[_0x4acf('0x2d')],_0x461547[_0x4acf('0x2e')]);_0x17d5e9[_0x4acf('0x31')]=_[_0x4acf('0x42')](_0x461547[_0x4acf('0x2d')],qs[_0x4acf('0x32')](_0xea75e4['query'][_0x4acf('0x32')]));_0x17d5e9['attributes']=_0x17d5e9[_0x4acf('0x31')][_0x4acf('0x43')]?_0x17d5e9['attributes']:_0x461547['model'];if(_0xea75e4[_0x4acf('0x2e')][_0x4acf('0x44')]){_0x17d5e9[_0x4acf('0x3c')]=[{'all':!![]}];}_0x17d5e9=_[_0x4acf('0x3a')]({},_0x17d5e9,_0xea75e4['options']);return db[_0x4acf('0x29')][_0x4acf('0x45')](_0x17d5e9)[_0x4acf('0x21')](handleEntityNotFound(_0x7cf2a,null))[_0x4acf('0x21')](respondWithResult(_0x7cf2a,null))[_0x4acf('0x3f')](handleError(_0x7cf2a,null));};exports[_0x4acf('0x46')]=function(_0x1bd7d0,_0x2d946c){return db['MailQueueReport']['create'](_0x1bd7d0[_0x4acf('0x47')],{})[_0x4acf('0x21')](respondWithResult(_0x2d946c,0xc9))[_0x4acf('0x3f')](handleError(_0x2d946c,null));};exports[_0x4acf('0x20')]=function(_0x287406,_0x859247){if(_0x287406[_0x4acf('0x47')]['id']){delete _0x287406[_0x4acf('0x47')]['id'];}return db[_0x4acf('0x29')][_0x4acf('0x45')]({'where':{'id':_0x287406[_0x4acf('0x41')]['id']}})[_0x4acf('0x21')](handleEntityNotFound(_0x859247,null))['then'](saveUpdates(_0x287406[_0x4acf('0x47')],null))[_0x4acf('0x21')](respondWithResult(_0x859247,null))[_0x4acf('0x3f')](handleError(_0x859247,null));};exports[_0x4acf('0x22')]=function(_0x392dac,_0x3cf54a){return db[_0x4acf('0x29')][_0x4acf('0x45')]({'where':{'id':_0x392dac[_0x4acf('0x41')]['id']}})[_0x4acf('0x21')](handleEntityNotFound(_0x3cf54a,null))[_0x4acf('0x21')](removeEntity(_0x3cf54a,null))[_0x4acf('0x3f')](handleError(_0x3cf54a,null));};exports[_0x4acf('0x48')]=function(_0x2b62bc,_0x113425){return db[_0x4acf('0x29')]['describe']()[_0x4acf('0x21')](respondWithResult(_0x113425,null))[_0x4acf('0x3f')](handleError(_0x113425,null));};
\ No newline at end of file
index b2fae88..94b4697 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc87b=['define','report_mail_queue','uniqueid','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports'];(function(_0x294a84,_0x24aec2){var _0x16ee8e=function(_0x2c7ab9){while(--_0x2c7ab9){_0x294a84['push'](_0x294a84['shift']());}};_0x16ee8e(++_0x24aec2);}(_0xc87b,0x1a3));var _0xbc87=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xc87b[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0xbc87('0x0'));var util=require(_0xbc87('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbc87('0x2'));var BPromise=require(_0xbc87('0x3'));var rp=require(_0xbc87('0x4'));var fs=require('fs');var path=require(_0xbc87('0x5'));var rimraf=require(_0xbc87('0x6'));var config=require(_0xbc87('0x7'));var attributes=require(_0xbc87('0x8'));module[_0xbc87('0x9')]=function(_0x183471,_0x4e2c23){return _0x183471[_0xbc87('0xa')]('MailQueueReport',attributes,{'tableName':_0xbc87('0xb'),'paranoid':![],'indexes':[{'name':_0xbc87('0xc'),'fields':[_0xbc87('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x38d2=['path','./mailQueueReport.attributes','exports','define','MailQueueReport','uniqueid','util','api','moment','bluebird','request-promise'];(function(_0x18894b,_0xb20093){var _0x4b3230=function(_0x434091){while(--_0x434091){_0x18894b['push'](_0x18894b['shift']());}};_0x4b3230(++_0xb20093);}(_0x38d2,0xed));var _0x238d=function(_0x1db84b,_0xe0d0){_0x1db84b=_0x1db84b-0x0;var _0x5392d1=_0x38d2[_0x1db84b];return _0x5392d1;};'use strict';var _=require('lodash');var util=require(_0x238d('0x0'));var logger=require('../../config/logger')(_0x238d('0x1'));var moment=require(_0x238d('0x2'));var BPromise=require(_0x238d('0x3'));var rp=require(_0x238d('0x4'));var fs=require('fs');var path=require(_0x238d('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x238d('0x6'));module[_0x238d('0x7')]=function(_0x217454,_0x21ee3e){return _0x217454[_0x238d('0x8')](_0x238d('0x9'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x238d('0xa'),'fields':[_0x238d('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 985f7e7..99cd7ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2e83b8,_0x49eef9){var _0x4acbdd=function(_0x426787){while(--_0x426787){_0x2e83b8['push'](_0x2e83b8['shift']());}};_0x4acbdd(++_0x49eef9);}(_0x326f,0xd1));var _0xf326=function(_0x38b37d,_0x2bb2ab){_0x38b37d=_0x38b37d-0x0;var _0x19b0cb=_0x326f[_0x38b37d];return _0x19b0cb;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['create'](_0x453100['body'],{'raw':_0x453100['options']?_0x453100[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4cabce){logger[_0xf326('0xb')]('CreateMailQueueReport',_0x453100);logger['debug'](_0xf326('0x14'),_0x453100,JSON[_0xf326('0x18')](_0x4cabce));_0x31ffb9(_0x4cabce);})['catch'](function(_0x5aa184){logger[_0xf326('0xf')](_0xf326('0x14'),_0x5aa184['message'],_0x453100);_0xcef2b5(_0x18bee3[_0xf326('0xf')](0x1f4,_0x5aa184[_0xf326('0x11')]));});});};exports[_0xf326('0x19')]=function(_0x295752){var _0x17c157=this;return new Promise(function(_0x2049ec,_0x5ce532){return db['MailQueueReport']['update'](_0x295752[_0xf326('0x1a')],{'raw':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')]['where']||null:null,'attributes':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x1b')]||null:null,'limit':_0x295752['options']?_0x295752[_0xf326('0x16')]['limit']||null:null})['then'](function(_0x6a8e89){logger[_0xf326('0xb')](_0xf326('0x19'),_0x295752);logger['debug'](_0xf326('0x19'),_0x295752,JSON[_0xf326('0x18')](_0x6a8e89));_0x2049ec(_0x6a8e89);})['catch'](function(_0x225776){logger[_0xf326('0xf')](_0xf326('0x19'),_0x225776[_0xf326('0x11')],_0x295752);_0x5ce532(_0x17c157[_0xf326('0xf')](0x1f4,_0x225776[_0xf326('0x11')]));});});};
\ No newline at end of file
+var _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2408a7,_0x11086c){var _0x4f30e6=function(_0xd116b1){while(--_0xd116b1){_0x2408a7['push'](_0x2408a7['shift']());}};_0x4f30e6(++_0x11086c);}(_0x326f,0xd1));var _0xf326=function(_0x5e08f6,_0x57e62b){_0x5e08f6=_0x5e08f6-0x0;var _0x28c00b=_0x326f[_0x5e08f6];return _0x28c00b;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['create'](_0x453100['body'],{'raw':_0x453100['options']?_0x453100[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4cabce){logger[_0xf326('0xb')]('CreateMailQueueReport',_0x453100);logger['debug'](_0xf326('0x14'),_0x453100,JSON[_0xf326('0x18')](_0x4cabce));_0x31ffb9(_0x4cabce);})['catch'](function(_0x5aa184){logger[_0xf326('0xf')](_0xf326('0x14'),_0x5aa184['message'],_0x453100);_0xcef2b5(_0x18bee3[_0xf326('0xf')](0x1f4,_0x5aa184[_0xf326('0x11')]));});});};exports[_0xf326('0x19')]=function(_0x295752){var _0x17c157=this;return new Promise(function(_0x2049ec,_0x5ce532){return db['MailQueueReport']['update'](_0x295752[_0xf326('0x1a')],{'raw':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')]['where']||null:null,'attributes':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x1b')]||null:null,'limit':_0x295752['options']?_0x295752[_0xf326('0x16')]['limit']||null:null})['then'](function(_0x6a8e89){logger[_0xf326('0xb')](_0xf326('0x19'),_0x295752);logger['debug'](_0xf326('0x19'),_0x295752,JSON[_0xf326('0x18')](_0x6a8e89));_0x2049ec(_0x6a8e89);})['catch'](function(_0x225776){logger[_0xf326('0xf')](_0xf326('0x19'),_0x225776[_0xf326('0x11')],_0x295752);_0x5ce532(_0x17c157[_0xf326('0xf')](0x1f4,_0x225776[_0xf326('0x11')]));});});};
\ No newline at end of file
index f7f6f75..67d5f4b 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(_0x2ba054,_0x4cfa79){var _0x5d2153=function(_0xd698b4){while(--_0xd698b4){_0x2ba054['push'](_0x2ba054['shift']());}};_0x5d2153(++_0x4cfa79);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x354e60,_0x50aad4){var _0x1cc4be=function(_0x2cbc60){while(--_0x2cbc60){_0x354e60['push'](_0x354e60['shift']());}};_0x1cc4be(++_0x50aad4);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x304b67,_0x31cb39){_0x304b67=_0x304b67-0x0;var _0x493afb=_0xcb91[_0x304b67];return _0x493afb;};'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 92fc82a..ea2add1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9be=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x247aab,_0x6d308){var _0x198cd0=function(_0x2bf3a4){while(--_0x2bf3a4){_0x247aab['push'](_0x247aab['shift']());}};_0x198cd0(++_0x6d308);}(_0xb9be,0xc5));var _0xeb9b=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xb9be[_0x5f1391];return _0x50ebe3;};'use strict';var Sequelize=require(_0xeb9b('0x0'));module[_0xeb9b('0x1')]={'description':{'type':Sequelize[_0xeb9b('0x2')]},'host':{'type':Sequelize[_0xeb9b('0x2')]},'authentication':{'type':Sequelize[_0xeb9b('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xeb9b('0x2')]},'password':{'type':Sequelize[_0xeb9b('0x2')]},'port':{'type':Sequelize[_0xeb9b('0x4')]},'tls':{'type':Sequelize[_0xeb9b('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0xeb9b('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xeb9b('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xeb9b('0x2')]}};
\ No newline at end of file
+var _0x04b8=['exports','STRING','BOOLEAN','INTEGER','INBOX'];(function(_0x38aee2,_0x7d94f4){var _0x4c0922=function(_0x479037){while(--_0x479037){_0x38aee2['push'](_0x38aee2['shift']());}};_0x4c0922(++_0x7d94f4);}(_0x04b8,0x159));var _0x804b=function(_0x16a1f6,_0x427d94){_0x16a1f6=_0x16a1f6-0x0;var _0x48eaf0=_0x04b8[_0x16a1f6];return _0x48eaf0;};'use strict';var Sequelize=require('sequelize');module[_0x804b('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x804b('0x1')]},'authentication':{'type':Sequelize[_0x804b('0x2')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x804b('0x1')]},'port':{'type':Sequelize[_0x804b('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x804b('0x1')],'defaultValue':_0x804b('0x4')},'connTimeout':{'type':Sequelize[_0x804b('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x804b('0x1')]}};
\ No newline at end of file
index 7406e66..d87146c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0f1=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailServerIn.attributes','exports','define','mail_servers_in'];(function(_0xeb43fe,_0x1a7d0b){var _0x255db1=function(_0x2f0ddb){while(--_0x2f0ddb){_0xeb43fe['push'](_0xeb43fe['shift']());}};_0x255db1(++_0x1a7d0b);}(_0xc0f1,0x9c));var _0x1c0f=function(_0x46ee3c,_0x1c08f0){_0x46ee3c=_0x46ee3c-0x0;var _0x530a97=_0xc0f1[_0x46ee3c];return _0x530a97;};'use strict';var _=require(_0x1c0f('0x0'));var util=require('util');var logger=require(_0x1c0f('0x1'))(_0x1c0f('0x2'));var moment=require(_0x1c0f('0x3'));var BPromise=require(_0x1c0f('0x4'));var rp=require(_0x1c0f('0x5'));var fs=require('fs');var path=require(_0x1c0f('0x6'));var rimraf=require(_0x1c0f('0x7'));var config=require('../../config/environment');var attributes=require(_0x1c0f('0x8'));module[_0x1c0f('0x9')]=function(_0x4a7621,_0x585c6f){return _0x4a7621[_0x1c0f('0xa')]('MailServerIn',attributes,{'tableName':_0x1c0f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfb0b=['../../config/environment','./mailServerIn.attributes','MailServerIn','mail_servers_in','lodash','bluebird','request-promise'];(function(_0x102ab4,_0xad970f){var _0x3280e4=function(_0x537e73){while(--_0x537e73){_0x102ab4['push'](_0x102ab4['shift']());}};_0x3280e4(++_0xad970f);}(_0xfb0b,0x90));var _0xbfb0=function(_0x561fa4,_0x22f756){_0x561fa4=_0x561fa4-0x0;var _0x440ab9=_0xfb0b[_0x561fa4];return _0x440ab9;};'use strict';var _=require(_0xbfb0('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xbfb0('0x1'));var rp=require(_0xbfb0('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbfb0('0x3'));var attributes=require(_0xbfb0('0x4'));module['exports']=function(_0x1c8b74,_0x1ddb4){return _0x1c8b74['define'](_0xbfb0('0x5'),attributes,{'tableName':_0xbfb0('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dd73b02..8cd40a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa38=['request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailServerIn,\x20%s,\x20%s','result','catch','GetMailServerIn','findAll','options','raw','limit','include','model','map','attributes','debug','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfa38,0x97));var _0x8fa3=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xfa38[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x8fa3('0x0'));var util=require(_0x8fa3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8fa3('0x2'));var fs=require('fs');var Redis=require(_0x8fa3('0x3'));var db=require(_0x8fa3('0x4'))['db'];var utils=require(_0x8fa3('0x5'));var logger=require('../../config/logger')(_0x8fa3('0x6'));var config=require(_0x8fa3('0x7'));var jayson=require(_0x8fa3('0x8'));var client=jayson[_0x8fa3('0x9')][_0x8fa3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x355cb3,_0x29f09c,_0x49308e){return new BPromise(function(_0x16766a,_0x28e31a){return client[_0x8fa3('0xb')](_0x355cb3,_0x49308e)[_0x8fa3('0xc')](function(_0xab324b){logger[_0x8fa3('0xd')]('MailServerIn,\x20%s,\x20%s',_0x29f09c,_0x8fa3('0xe'));logger['debug'](_0x8fa3('0xf'),_0x29f09c,'request\x20sent',JSON[_0x8fa3('0x10')](_0xab324b));if(_0xab324b[_0x8fa3('0x11')]){if(_0xab324b['error'][_0x8fa3('0x12')]===0x1f4){logger['error']('MailServerIn,\x20%s,\x20%s',_0x29f09c,_0xab324b[_0x8fa3('0x11')][_0x8fa3('0x13')]);return _0x28e31a(_0xab324b[_0x8fa3('0x11')][_0x8fa3('0x13')]);}logger[_0x8fa3('0x11')]('MailServerIn,\x20%s,\x20%s',_0x29f09c,_0xab324b['error'][_0x8fa3('0x13')]);return _0x16766a(_0xab324b[_0x8fa3('0x11')][_0x8fa3('0x13')]);}else{logger[_0x8fa3('0xd')](_0x8fa3('0x14'),_0x29f09c,_0x8fa3('0xe'));_0x16766a(_0xab324b[_0x8fa3('0x15')][_0x8fa3('0x13')]);}})[_0x8fa3('0x16')](function(_0x57fa5f){logger[_0x8fa3('0x11')](_0x8fa3('0x14'),_0x29f09c,_0x57fa5f);_0x28e31a(_0x57fa5f);});});}exports[_0x8fa3('0x17')]=function(_0x7027e4){var _0x406eee=this;return new Promise(function(_0x1051ea,_0x51da07){return db['MailServerIn'][_0x8fa3('0x18')]({'raw':_0x7027e4[_0x8fa3('0x19')]?_0x7027e4[_0x8fa3('0x19')][_0x8fa3('0x1a')]===undefined?!![]:![]:!![],'where':_0x7027e4[_0x8fa3('0x19')]?_0x7027e4[_0x8fa3('0x19')]['where']||null:null,'attributes':_0x7027e4['options']?_0x7027e4['options']['attributes']||null:null,'limit':_0x7027e4['options']?_0x7027e4[_0x8fa3('0x19')][_0x8fa3('0x1b')]||null:null,'include':_0x7027e4[_0x8fa3('0x19')]?_0x7027e4[_0x8fa3('0x19')][_0x8fa3('0x1c')]?_['map'](_0x7027e4[_0x8fa3('0x19')]['include'],function(_0x5adb7a){return{'model':db[_0x5adb7a[_0x8fa3('0x1d')]],'as':_0x5adb7a['as'],'attributes':_0x5adb7a['attributes'],'include':_0x5adb7a[_0x8fa3('0x1c')]?_[_0x8fa3('0x1e')](_0x5adb7a[_0x8fa3('0x1c')],function(_0xa652ab){return{'model':db[_0xa652ab[_0x8fa3('0x1d')]],'as':_0xa652ab['as'],'attributes':_0xa652ab[_0x8fa3('0x1f')],'include':_0xa652ab['include']?_['map'](_0xa652ab['include'],function(_0x2a3f20){return{'model':db[_0x2a3f20['model']],'as':_0x2a3f20['as'],'attributes':_0x2a3f20['attributes']};}):[]};}):[]};}):[]:[]})[_0x8fa3('0xc')](function(_0x1902ba){logger[_0x8fa3('0xd')](_0x8fa3('0x17'),_0x7027e4);logger[_0x8fa3('0x20')](_0x8fa3('0x17'),_0x7027e4,JSON[_0x8fa3('0x10')](_0x1902ba));_0x1051ea(_0x1902ba);})['catch'](function(_0x12a2d0){logger[_0x8fa3('0x11')](_0x8fa3('0x17'),_0x12a2d0[_0x8fa3('0x13')],_0x7027e4);_0x51da07(_0x406eee[_0x8fa3('0x11')](0x1f4,_0x12a2d0['message']));});});};
\ No newline at end of file
+var _0xbee3=['model','attributes','stringify','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetMailServerIn','MailServerIn','findAll','options','raw','limit','include','map'];(function(_0x9d1d83,_0x2e9492){var _0x1e7e45=function(_0x1d81bf){while(--_0x1d81bf){_0x9d1d83['push'](_0x9d1d83['shift']());}};_0x1e7e45(++_0x2e9492);}(_0xbee3,0xd5));var _0x3bee=function(_0x5b7a5b,_0x2b31eb){_0x5b7a5b=_0x5b7a5b-0x0;var _0x2e1f28=_0xbee3[_0x5b7a5b];return _0x2e1f28;};'use strict';var _=require('lodash');var util=require(_0x3bee('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3bee('0x1'));var fs=require('fs');var Redis=require(_0x3bee('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3bee('0x3'));var logger=require(_0x3bee('0x4'))(_0x3bee('0x5'));var config=require('../../config/environment');var jayson=require(_0x3bee('0x6'));var client=jayson[_0x3bee('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fdeec,_0x28d912,_0x1b510d){return new BPromise(function(_0x339223,_0xbdd5d5){return client[_0x3bee('0x8')](_0x2fdeec,_0x1b510d)[_0x3bee('0x9')](function(_0x518e2d){logger[_0x3bee('0xa')](_0x3bee('0xb'),_0x28d912,_0x3bee('0xc'));logger[_0x3bee('0xd')](_0x3bee('0xe'),_0x28d912,_0x3bee('0xc'),JSON['stringify'](_0x518e2d));if(_0x518e2d[_0x3bee('0xf')]){if(_0x518e2d['error'][_0x3bee('0x10')]===0x1f4){logger[_0x3bee('0xf')](_0x3bee('0xb'),_0x28d912,_0x518e2d[_0x3bee('0xf')][_0x3bee('0x11')]);return _0xbdd5d5(_0x518e2d[_0x3bee('0xf')][_0x3bee('0x11')]);}logger['error'](_0x3bee('0xb'),_0x28d912,_0x518e2d[_0x3bee('0xf')][_0x3bee('0x11')]);return _0x339223(_0x518e2d[_0x3bee('0xf')][_0x3bee('0x11')]);}else{logger['info']('MailServerIn,\x20%s,\x20%s',_0x28d912,_0x3bee('0xc'));_0x339223(_0x518e2d['result'][_0x3bee('0x11')]);}})[_0x3bee('0x12')](function(_0x57d42c){logger['error'](_0x3bee('0xb'),_0x28d912,_0x57d42c);_0xbdd5d5(_0x57d42c);});});}exports[_0x3bee('0x13')]=function(_0xfdba3b){var _0x631ff8=this;return new Promise(function(_0x49095a,_0x30a1de){return db[_0x3bee('0x14')][_0x3bee('0x15')]({'raw':_0xfdba3b[_0x3bee('0x16')]?_0xfdba3b[_0x3bee('0x16')][_0x3bee('0x17')]===undefined?!![]:![]:!![],'where':_0xfdba3b[_0x3bee('0x16')]?_0xfdba3b['options']['where']||null:null,'attributes':_0xfdba3b[_0x3bee('0x16')]?_0xfdba3b[_0x3bee('0x16')]['attributes']||null:null,'limit':_0xfdba3b[_0x3bee('0x16')]?_0xfdba3b[_0x3bee('0x16')][_0x3bee('0x18')]||null:null,'include':_0xfdba3b[_0x3bee('0x16')]?_0xfdba3b[_0x3bee('0x16')][_0x3bee('0x19')]?_[_0x3bee('0x1a')](_0xfdba3b['options'][_0x3bee('0x19')],function(_0x1ed0c1){return{'model':db[_0x1ed0c1[_0x3bee('0x1b')]],'as':_0x1ed0c1['as'],'attributes':_0x1ed0c1[_0x3bee('0x1c')],'include':_0x1ed0c1['include']?_[_0x3bee('0x1a')](_0x1ed0c1[_0x3bee('0x19')],function(_0x1e0111){return{'model':db[_0x1e0111['model']],'as':_0x1e0111['as'],'attributes':_0x1e0111['attributes'],'include':_0x1e0111[_0x3bee('0x19')]?_[_0x3bee('0x1a')](_0x1e0111['include'],function(_0x2c0e50){return{'model':db[_0x2c0e50[_0x3bee('0x1b')]],'as':_0x2c0e50['as'],'attributes':_0x2c0e50[_0x3bee('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1984c4){logger[_0x3bee('0xa')](_0x3bee('0x13'),_0xfdba3b);logger['debug'](_0x3bee('0x13'),_0xfdba3b,JSON[_0x3bee('0x1d')](_0x1984c4));_0x49095a(_0x1984c4);})[_0x3bee('0x12')](function(_0x496abd){logger[_0x3bee('0xf')](_0x3bee('0x13'),_0x496abd[_0x3bee('0x11')],_0xfdba3b);_0x30a1de(_0x631ff8[_0x3bee('0xf')](0x1f4,_0x496abd[_0x3bee('0x11')]));});});};
\ No newline at end of file
index 3db394f..1314c67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x7a54,0x106));var _0x47a5=function(_0x286153,_0x1ebcab){_0x286153=_0x286153-0x0;var _0x49494e=_0x7a54[_0x286153];return _0x49494e;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router;
\ No newline at end of file
+var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x7a54,0x106));var _0x47a5=function(_0x47d925,_0x50885e){_0x47d925=_0x47d925-0x0;var _0x32494b=_0x7a54[_0x47d925];return _0x32494b;};'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 d4fbce9..3a6cfc6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9341=['sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x3d1b15,_0x34943b){var _0x702086=function(_0x492375){while(--_0x492375){_0x3d1b15['push'](_0x3d1b15['shift']());}};_0x702086(++_0x34943b);}(_0x9341,0xc8));var _0x1934=function(_0x55d27a,_0x2ef299){_0x55d27a=_0x55d27a-0x0;var _0x58963e=_0x9341[_0x55d27a];return _0x58963e;};'use strict';var Sequelize=require(_0x1934('0x0'));module[_0x1934('0x1')]={'description':{'type':Sequelize[_0x1934('0x2')]},'host':{'type':Sequelize[_0x1934('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x1934('0x2')]},'port':{'type':Sequelize[_0x1934('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x1934('0x2')]},'authentication':{'type':Sequelize[_0x1934('0x4')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x8b54=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x511e08,_0x26ba8c){var _0x7a652e=function(_0x42d218){while(--_0x42d218){_0x511e08['push'](_0x511e08['shift']());}};_0x7a652e(++_0x26ba8c);}(_0x8b54,0x160));var _0x48b5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8b54[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x48b5('0x0'));module[_0x48b5('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x48b5('0x2')]},'port':{'type':Sequelize[_0x48b5('0x3')]},'secure':{'type':Sequelize[_0x48b5('0x4')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x48b5('0x4')],'defaultValue':!![]}};
\ No newline at end of file
index ec90b9f..e1f4cd5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d54=['find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','end','error','stack','name','index','MailServerOut','rawAttributes','fieldName','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','keys','includeAll','options'];(function(_0x2eaa6b,_0x5f3658){var _0x4770c9=function(_0x1a22a2){while(--_0x1a22a2){_0x2eaa6b['push'](_0x2eaa6b['shift']());}};_0x4770c9(++_0x5f3658);}(_0x2d54,0xdc));var _0x42d5=function(_0x4e752e,_0x479543){_0x4e752e=_0x4e752e-0x0;var _0x2392b0=_0x2d54[_0x4e752e];return _0x2392b0;};'use strict';var emlformat=require(_0x42d5('0x0'));var rimraf=require(_0x42d5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x42d5('0x2'));var rp=require(_0x42d5('0x3'));var moment=require(_0x42d5('0x4'));var BPromise=require(_0x42d5('0x5'));var Mustache=require('mustache');var util=require(_0x42d5('0x6'));var path=require('path');var sox=require(_0x42d5('0x7'));var csv=require(_0x42d5('0x8'));var ejs=require(_0x42d5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x42d5('0xa'));var squel=require(_0x42d5('0xb'));var crypto=require(_0x42d5('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x42d5('0x8'));var querystring=require(_0x42d5('0xd'));var Papa=require('papaparse');var Redis=require(_0x42d5('0xe'));var authService=require(_0x42d5('0xf'));var qs=require(_0x42d5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x42d5('0x11'));var logger=require(_0x42d5('0x12'))('api');var utils=require(_0x42d5('0x13'));var config=require(_0x42d5('0x14'));var licenseUtil=require(_0x42d5('0x15'));var db=require(_0x42d5('0x16'))['db'];function respondWithStatusCode(_0x190cf1,_0x41cc6e){_0x41cc6e=_0x41cc6e||0xcc;return function(_0x1764ca){if(_0x1764ca){return _0x190cf1['sendStatus'](_0x41cc6e);}return _0x190cf1[_0x42d5('0x17')](_0x41cc6e)['end']();};}function respondWithResult(_0x17b7de,_0x420e3a){_0x420e3a=_0x420e3a||0xc8;return function(_0x10dfd3){if(_0x10dfd3){return _0x17b7de[_0x42d5('0x17')](_0x420e3a)[_0x42d5('0x18')](_0x10dfd3);}};}function respondWithFilteredResult(_0x5ef7da,_0x3d20a5){return function(_0x2763f0){if(_0x2763f0){var _0x1d380a=typeof _0x3d20a5[_0x42d5('0x19')]===_0x42d5('0x1a')&&typeof _0x3d20a5[_0x42d5('0x1b')]===_0x42d5('0x1a');var _0x172232=_0x2763f0[_0x42d5('0x1c')];var _0x8cbe9c=_0x1d380a?0x0:_0x3d20a5['offset'];var _0x113136=_0x1d380a?_0x2763f0[_0x42d5('0x1c')]:_0x3d20a5[_0x42d5('0x19')]+_0x3d20a5[_0x42d5('0x1b')];var _0x52d60f;if(_0x113136>=_0x172232){_0x113136=_0x172232;_0x52d60f=0xc8;}else{_0x52d60f=0xce;}_0x5ef7da[_0x42d5('0x17')](_0x52d60f);return _0x5ef7da[_0x42d5('0x1d')](_0x42d5('0x1e'),_0x8cbe9c+'-'+_0x113136+'/'+_0x172232)[_0x42d5('0x18')](_0x2763f0);}return null;};}function patchUpdates(_0x5c35e3){return function(_0x25c802){try{jsonpatch[_0x42d5('0x1f')](_0x25c802,_0x5c35e3,!![]);}catch(_0x3e2e47){return BPromise['reject'](_0x3e2e47);}return _0x25c802[_0x42d5('0x20')]();};}function saveUpdates(_0x31cc7b,_0x2f6387){return function(_0x17ae3d){if(_0x17ae3d){return _0x17ae3d[_0x42d5('0x21')](_0x31cc7b)['then'](function(_0x5209f7){return _0x5209f7;});}return null;};}function removeEntity(_0xdc4a24,_0x41c02c){return function(_0x40b1c0){if(_0x40b1c0){return _0x40b1c0[_0x42d5('0x22')]()[_0x42d5('0x23')](function(){_0xdc4a24[_0x42d5('0x17')](0xcc)[_0x42d5('0x24')]();});}};}function handleEntityNotFound(_0x43717a,_0x37d7ff){return function(_0x50b53f){if(!_0x50b53f){_0x43717a['sendStatus'](0x194);}return _0x50b53f;};}function handleError(_0x100f84,_0x41b3b3){_0x41b3b3=_0x41b3b3||0x1f4;return function(_0x6a5025){logger[_0x42d5('0x25')](_0x6a5025[_0x42d5('0x26')]);if(_0x6a5025[_0x42d5('0x27')]){delete _0x6a5025[_0x42d5('0x27')];}_0x100f84[_0x42d5('0x17')](_0x41b3b3)['send'](_0x6a5025);};}exports[_0x42d5('0x28')]=function(_0x4d45d4,_0x533a61){var _0x16db02={},_0xc564eb={},_0x54ff3f={'count':0x0,'rows':[]};var _0x10f6ba=_['map'](db[_0x42d5('0x29')][_0x42d5('0x2a')],function(_0x5ea847){return{'name':_0x5ea847[_0x42d5('0x2b')],'type':_0x5ea847['type']['key']};});_0xc564eb[_0x42d5('0x2c')]=_[_0x42d5('0x2d')](_0x10f6ba,_0x42d5('0x27'));_0xc564eb[_0x42d5('0x2e')]=_['keys'](_0x4d45d4[_0x42d5('0x2e')]);_0xc564eb[_0x42d5('0x2f')]=_['intersection'](_0xc564eb['model'],_0xc564eb['query']);_0x16db02[_0x42d5('0x30')]=_[_0x42d5('0x31')](_0xc564eb['model'],qs[_0x42d5('0x32')](_0x4d45d4['query'][_0x42d5('0x32')]));_0x16db02[_0x42d5('0x30')]=_0x16db02[_0x42d5('0x30')][_0x42d5('0x33')]?_0x16db02[_0x42d5('0x30')]:_0xc564eb[_0x42d5('0x2c')];if(!_0x4d45d4[_0x42d5('0x2e')][_0x42d5('0x34')]('nolimit')){_0x16db02['limit']=qs[_0x42d5('0x1b')](_0x4d45d4[_0x42d5('0x2e')]['limit']);_0x16db02[_0x42d5('0x19')]=qs[_0x42d5('0x19')](_0x4d45d4['query'][_0x42d5('0x19')]);}_0x16db02[_0x42d5('0x35')]=qs[_0x42d5('0x36')](_0x4d45d4[_0x42d5('0x2e')][_0x42d5('0x36')]);_0x16db02[_0x42d5('0x37')]=qs['filters'](_[_0x42d5('0x38')](_0x4d45d4[_0x42d5('0x2e')],_0xc564eb[_0x42d5('0x2f')]),_0x10f6ba);if(_0x4d45d4[_0x42d5('0x2e')][_0x42d5('0x39')]){_0x16db02[_0x42d5('0x37')]=_[_0x42d5('0x3a')](_0x16db02['where'],{'$or':_[_0x42d5('0x2d')](_0x10f6ba,function(_0x509074){if(_0x509074['type']!==_0x42d5('0x3b')){var _0x20ddbb={};_0x20ddbb[_0x509074[_0x42d5('0x27')]]={'$like':'%'+_0x4d45d4[_0x42d5('0x2e')][_0x42d5('0x39')]+'%'};return _0x20ddbb;}})});}_0x16db02=_[_0x42d5('0x3a')]({},_0x16db02,_0x4d45d4['options']);var _0x298d4a={'where':_0x16db02[_0x42d5('0x37')]};return db[_0x42d5('0x29')]['count'](_0x298d4a)[_0x42d5('0x23')](function(_0x5d3530){_0x54ff3f[_0x42d5('0x1c')]=_0x5d3530;if(_0x4d45d4['query']['includeAll']){_0x16db02[_0x42d5('0x3c')]=[{'all':!![]}];}return db[_0x42d5('0x29')][_0x42d5('0x3d')](_0x16db02);})[_0x42d5('0x23')](function(_0x48380f){_0x54ff3f[_0x42d5('0x3e')]=_0x48380f;return _0x54ff3f;})['then'](respondWithFilteredResult(_0x533a61,_0x16db02))[_0x42d5('0x3f')](handleError(_0x533a61,null));};exports[_0x42d5('0x40')]=function(_0x3fc517,_0x887baf){var _0x4f8d3a={'raw':!![],'where':{'id':_0x3fc517['params']['id']}},_0x8875d6={};_0x8875d6['model']=_[_0x42d5('0x41')](db[_0x42d5('0x29')][_0x42d5('0x2a')]);_0x8875d6[_0x42d5('0x2e')]=_[_0x42d5('0x41')](_0x3fc517[_0x42d5('0x2e')]);_0x8875d6[_0x42d5('0x2f')]=_[_0x42d5('0x31')](_0x8875d6['model'],_0x8875d6[_0x42d5('0x2e')]);_0x4f8d3a['attributes']=_['intersection'](_0x8875d6[_0x42d5('0x2c')],qs[_0x42d5('0x32')](_0x3fc517[_0x42d5('0x2e')][_0x42d5('0x32')]));_0x4f8d3a[_0x42d5('0x30')]=_0x4f8d3a[_0x42d5('0x30')][_0x42d5('0x33')]?_0x4f8d3a[_0x42d5('0x30')]:_0x8875d6[_0x42d5('0x2c')];if(_0x3fc517['query'][_0x42d5('0x42')]){_0x4f8d3a[_0x42d5('0x3c')]=[{'all':!![]}];}_0x4f8d3a=_[_0x42d5('0x3a')]({},_0x4f8d3a,_0x3fc517[_0x42d5('0x43')]);return db[_0x42d5('0x29')][_0x42d5('0x44')](_0x4f8d3a)[_0x42d5('0x23')](handleEntityNotFound(_0x887baf,null))[_0x42d5('0x23')](respondWithResult(_0x887baf,null))['catch'](handleError(_0x887baf,null));};exports[_0x42d5('0x45')]=function(_0x39611e,_0x57a8b4){return db['MailServerOut'][_0x42d5('0x45')](_0x39611e[_0x42d5('0x46')],{})[_0x42d5('0x23')](respondWithResult(_0x57a8b4,0xc9))[_0x42d5('0x3f')](handleError(_0x57a8b4,null));};exports['update']=function(_0xf863d2,_0x2b3910){if(_0xf863d2[_0x42d5('0x46')]['id']){delete _0xf863d2[_0x42d5('0x46')]['id'];}return db[_0x42d5('0x29')][_0x42d5('0x44')]({'where':{'id':_0xf863d2[_0x42d5('0x47')]['id']}})['then'](handleEntityNotFound(_0x2b3910,null))['then'](saveUpdates(_0xf863d2[_0x42d5('0x46')],null))[_0x42d5('0x23')](respondWithResult(_0x2b3910,null))[_0x42d5('0x3f')](handleError(_0x2b3910,null));};exports['destroy']=function(_0x34c240,_0x1db3a9){return db[_0x42d5('0x29')][_0x42d5('0x44')]({'where':{'id':_0x34c240[_0x42d5('0x47')]['id']}})[_0x42d5('0x23')](handleEntityNotFound(_0x1db3a9,null))[_0x42d5('0x23')](removeEntity(_0x1db3a9,null))[_0x42d5('0x3f')](handleError(_0x1db3a9,null));};
\ No newline at end of file
+var _0xce6f=['desk.js','to-csv','querystring','ioredis','../../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','apply','reject','update','then','error','stack','name','send','index','MailServerOut','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','options','includeAll','findAll','rows','catch','show','params','length','merge','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xce6f,0x166));var _0xfce6=function(_0x41b4c0,_0x56c918){_0x41b4c0=_0x41b4c0-0x0;var _0xe364b1=_0xce6f[_0x41b4c0];return _0xe364b1;};'use strict';var emlformat=require(_0xfce6('0x0'));var rimraf=require(_0xfce6('0x1'));var zipdir=require(_0xfce6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfce6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfce6('0x4'));var path=require('path');var sox=require(_0xfce6('0x5'));var csv=require('to-csv');var ejs=require(_0xfce6('0x6'));var fs=require('fs');var fs_extra=require(_0xfce6('0x7'));var _=require(_0xfce6('0x8'));var squel=require(_0xfce6('0x9'));var crypto=require(_0xfce6('0xa'));var jsforce=require(_0xfce6('0xb'));var deskjs=require(_0xfce6('0xc'));var toCsv=require(_0xfce6('0xd'));var querystring=require(_0xfce6('0xe'));var Papa=require('papaparse');var Redis=require(_0xfce6('0xf'));var authService=require(_0xfce6('0x10'));var qs=require(_0xfce6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfce6('0x12'));var logger=require(_0xfce6('0x13'))('api');var utils=require(_0xfce6('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xfce6('0x15'));var db=require(_0xfce6('0x16'))['db'];function respondWithStatusCode(_0x4a40c8,_0x4ecf55){_0x4ecf55=_0x4ecf55||0xcc;return function(_0x41adac){if(_0x41adac){return _0x4a40c8[_0xfce6('0x17')](_0x4ecf55);}return _0x4a40c8[_0xfce6('0x18')](_0x4ecf55)[_0xfce6('0x19')]();};}function respondWithResult(_0x4f0d78,_0x318c1b){_0x318c1b=_0x318c1b||0xc8;return function(_0x39b3a5){if(_0x39b3a5){return _0x4f0d78[_0xfce6('0x18')](_0x318c1b)[_0xfce6('0x1a')](_0x39b3a5);}};}function respondWithFilteredResult(_0x39ade6,_0x49e2eb){return function(_0x45f8c3){if(_0x45f8c3){var _0x985a9c=typeof _0x49e2eb[_0xfce6('0x1b')]===_0xfce6('0x1c')&&typeof _0x49e2eb[_0xfce6('0x1d')]===_0xfce6('0x1c');var _0x10044a=_0x45f8c3[_0xfce6('0x1e')];var _0x23b9ce=_0x985a9c?0x0:_0x49e2eb[_0xfce6('0x1b')];var _0x218b72=_0x985a9c?_0x45f8c3[_0xfce6('0x1e')]:_0x49e2eb[_0xfce6('0x1b')]+_0x49e2eb[_0xfce6('0x1d')];var _0x34e0df;if(_0x218b72>=_0x10044a){_0x218b72=_0x10044a;_0x34e0df=0xc8;}else{_0x34e0df=0xce;}_0x39ade6[_0xfce6('0x18')](_0x34e0df);return _0x39ade6[_0xfce6('0x1f')](_0xfce6('0x20'),_0x23b9ce+'-'+_0x218b72+'/'+_0x10044a)[_0xfce6('0x1a')](_0x45f8c3);}return null;};}function patchUpdates(_0x19ea8f){return function(_0x12fafc){try{jsonpatch[_0xfce6('0x21')](_0x12fafc,_0x19ea8f,!![]);}catch(_0x1fe8fa){return BPromise[_0xfce6('0x22')](_0x1fe8fa);}return _0x12fafc['save']();};}function saveUpdates(_0x36521a,_0xa0ed82){return function(_0x3e72fd){if(_0x3e72fd){return _0x3e72fd[_0xfce6('0x23')](_0x36521a)[_0xfce6('0x24')](function(_0x5e6d9b){return _0x5e6d9b;});}return null;};}function removeEntity(_0x1c0c35,_0x56f06b){return function(_0x2a8016){if(_0x2a8016){return _0x2a8016['destroy']()[_0xfce6('0x24')](function(){_0x1c0c35[_0xfce6('0x18')](0xcc)[_0xfce6('0x19')]();});}};}function handleEntityNotFound(_0x27bdd7,_0x30448a){return function(_0x310bf1){if(!_0x310bf1){_0x27bdd7[_0xfce6('0x17')](0x194);}return _0x310bf1;};}function handleError(_0xfbaef1,_0x5f145f){_0x5f145f=_0x5f145f||0x1f4;return function(_0x430feb){logger[_0xfce6('0x25')](_0x430feb[_0xfce6('0x26')]);if(_0x430feb[_0xfce6('0x27')]){delete _0x430feb['name'];}_0xfbaef1['status'](_0x5f145f)[_0xfce6('0x28')](_0x430feb);};}exports[_0xfce6('0x29')]=function(_0x2cc0c6,_0xb19325){var _0x44153c={},_0x363ebf={},_0x38ab4d={'count':0x0,'rows':[]};var _0x324634=_['map'](db[_0xfce6('0x2a')][_0xfce6('0x2b')],function(_0x302d07){return{'name':_0x302d07['fieldName'],'type':_0x302d07[_0xfce6('0x2c')][_0xfce6('0x2d')]};});_0x363ebf[_0xfce6('0x2e')]=_[_0xfce6('0x2f')](_0x324634,_0xfce6('0x27'));_0x363ebf[_0xfce6('0x30')]=_[_0xfce6('0x31')](_0x2cc0c6[_0xfce6('0x30')]);_0x363ebf[_0xfce6('0x32')]=_[_0xfce6('0x33')](_0x363ebf[_0xfce6('0x2e')],_0x363ebf[_0xfce6('0x30')]);_0x44153c[_0xfce6('0x34')]=_[_0xfce6('0x33')](_0x363ebf[_0xfce6('0x2e')],qs[_0xfce6('0x35')](_0x2cc0c6[_0xfce6('0x30')][_0xfce6('0x35')]));_0x44153c['attributes']=_0x44153c[_0xfce6('0x34')]['length']?_0x44153c[_0xfce6('0x34')]:_0x363ebf[_0xfce6('0x2e')];if(!_0x2cc0c6[_0xfce6('0x30')][_0xfce6('0x36')](_0xfce6('0x37'))){_0x44153c[_0xfce6('0x1d')]=qs[_0xfce6('0x1d')](_0x2cc0c6[_0xfce6('0x30')][_0xfce6('0x1d')]);_0x44153c[_0xfce6('0x1b')]=qs['offset'](_0x2cc0c6[_0xfce6('0x30')]['offset']);}_0x44153c[_0xfce6('0x38')]=qs[_0xfce6('0x39')](_0x2cc0c6[_0xfce6('0x30')][_0xfce6('0x39')]);_0x44153c['where']=qs[_0xfce6('0x32')](_[_0xfce6('0x3a')](_0x2cc0c6[_0xfce6('0x30')],_0x363ebf[_0xfce6('0x32')]),_0x324634);if(_0x2cc0c6['query'][_0xfce6('0x3b')]){_0x44153c[_0xfce6('0x3c')]=_['merge'](_0x44153c[_0xfce6('0x3c')],{'$or':_[_0xfce6('0x2f')](_0x324634,function(_0x39fce2){if(_0x39fce2[_0xfce6('0x2c')]!=='VIRTUAL'){var _0x539343={};_0x539343[_0x39fce2[_0xfce6('0x27')]]={'$like':'%'+_0x2cc0c6[_0xfce6('0x30')][_0xfce6('0x3b')]+'%'};return _0x539343;}})});}_0x44153c=_['merge']({},_0x44153c,_0x2cc0c6[_0xfce6('0x3d')]);var _0x3f147a={'where':_0x44153c['where']};return db[_0xfce6('0x2a')][_0xfce6('0x1e')](_0x3f147a)[_0xfce6('0x24')](function(_0x4533b1){_0x38ab4d['count']=_0x4533b1;if(_0x2cc0c6[_0xfce6('0x30')][_0xfce6('0x3e')]){_0x44153c['include']=[{'all':!![]}];}return db[_0xfce6('0x2a')][_0xfce6('0x3f')](_0x44153c);})[_0xfce6('0x24')](function(_0x2b626d){_0x38ab4d[_0xfce6('0x40')]=_0x2b626d;return _0x38ab4d;})[_0xfce6('0x24')](respondWithFilteredResult(_0xb19325,_0x44153c))[_0xfce6('0x41')](handleError(_0xb19325,null));};exports[_0xfce6('0x42')]=function(_0x2bb53e,_0x2def3d){var _0x308789={'raw':!![],'where':{'id':_0x2bb53e[_0xfce6('0x43')]['id']}},_0x4d2ae4={};_0x4d2ae4[_0xfce6('0x2e')]=_[_0xfce6('0x31')](db[_0xfce6('0x2a')]['rawAttributes']);_0x4d2ae4[_0xfce6('0x30')]=_[_0xfce6('0x31')](_0x2bb53e[_0xfce6('0x30')]);_0x4d2ae4[_0xfce6('0x32')]=_[_0xfce6('0x33')](_0x4d2ae4[_0xfce6('0x2e')],_0x4d2ae4[_0xfce6('0x30')]);_0x308789[_0xfce6('0x34')]=_[_0xfce6('0x33')](_0x4d2ae4['model'],qs[_0xfce6('0x35')](_0x2bb53e[_0xfce6('0x30')]['fields']));_0x308789[_0xfce6('0x34')]=_0x308789[_0xfce6('0x34')][_0xfce6('0x44')]?_0x308789[_0xfce6('0x34')]:_0x4d2ae4[_0xfce6('0x2e')];if(_0x2bb53e['query'][_0xfce6('0x3e')]){_0x308789['include']=[{'all':!![]}];}_0x308789=_[_0xfce6('0x45')]({},_0x308789,_0x2bb53e[_0xfce6('0x3d')]);return db[_0xfce6('0x2a')][_0xfce6('0x46')](_0x308789)[_0xfce6('0x24')](handleEntityNotFound(_0x2def3d,null))['then'](respondWithResult(_0x2def3d,null))[_0xfce6('0x41')](handleError(_0x2def3d,null));};exports[_0xfce6('0x47')]=function(_0x269320,_0x117490){return db[_0xfce6('0x2a')]['create'](_0x269320['body'],{})['then'](respondWithResult(_0x117490,0xc9))[_0xfce6('0x41')](handleError(_0x117490,null));};exports['update']=function(_0x5c62ab,_0x32134d){if(_0x5c62ab[_0xfce6('0x48')]['id']){delete _0x5c62ab[_0xfce6('0x48')]['id'];}return db['MailServerOut'][_0xfce6('0x46')]({'where':{'id':_0x5c62ab['params']['id']}})[_0xfce6('0x24')](handleEntityNotFound(_0x32134d,null))[_0xfce6('0x24')](saveUpdates(_0x5c62ab[_0xfce6('0x48')],null))['then'](respondWithResult(_0x32134d,null))[_0xfce6('0x41')](handleError(_0x32134d,null));};exports[_0xfce6('0x49')]=function(_0x35143f,_0x476516){return db['MailServerOut'][_0xfce6('0x46')]({'where':{'id':_0x35143f['params']['id']}})['then'](handleEntityNotFound(_0x476516,null))[_0xfce6('0x24')](removeEntity(_0x476516,null))[_0xfce6('0x41')](handleError(_0x476516,null));};
\ No newline at end of file
index 40c73d8..bf9e326 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2829=['path','rimraf','../../config/environment','exports','define','MailServerOut','util','../../config/logger','api','bluebird','request-promise'];(function(_0x260fcf,_0x4e8797){var _0x36d3f3=function(_0xe4c422){while(--_0xe4c422){_0x260fcf['push'](_0x260fcf['shift']());}};_0x36d3f3(++_0x4e8797);}(_0x2829,0x12f));var _0x9282=function(_0x40748f,_0x5eb440){_0x40748f=_0x40748f-0x0;var _0x3e26a2=_0x2829[_0x40748f];return _0x3e26a2;};'use strict';var _=require('lodash');var util=require(_0x9282('0x0'));var logger=require(_0x9282('0x1'))(_0x9282('0x2'));var moment=require('moment');var BPromise=require(_0x9282('0x3'));var rp=require(_0x9282('0x4'));var fs=require('fs');var path=require(_0x9282('0x5'));var rimraf=require(_0x9282('0x6'));var config=require(_0x9282('0x7'));var attributes=require('./mailServerOut.attributes');module[_0x9282('0x8')]=function(_0x5b74b6,_0x5990bd){return _0x5b74b6[_0x9282('0x9')](_0x9282('0xa'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3fd5=['../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','lodash','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x2560f8,_0x57607e){var _0x20dbd0=function(_0x975590){while(--_0x975590){_0x2560f8['push'](_0x2560f8['shift']());}};_0x20dbd0(++_0x57607e);}(_0x3fd5,0x19c));var _0x53fd=function(_0x22d6c8,_0x48e940){_0x22d6c8=_0x22d6c8-0x0;var _0x33953f=_0x3fd5[_0x22d6c8];return _0x33953f;};'use strict';var _=require(_0x53fd('0x0'));var util=require('util');var logger=require(_0x53fd('0x1'))('api');var moment=require('moment');var BPromise=require(_0x53fd('0x2'));var rp=require(_0x53fd('0x3'));var fs=require('fs');var path=require(_0x53fd('0x4'));var rimraf=require(_0x53fd('0x5'));var config=require(_0x53fd('0x6'));var attributes=require(_0x53fd('0x7'));module[_0x53fd('0x8')]=function(_0x5625ee,_0x4e8ca4){return _0x5625ee[_0x53fd('0x9')](_0x53fd('0xa'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 577133c..071781f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7a54,0x106));var _0x47a5=function(_0x1bde0a,_0x141cba){_0x1bde0a=_0x1bde0a-0x0;var _0x48a569=_0x7a54[_0x1bde0a];return _0x48a569;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _0x7a54=['info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x266c20,_0x1bebbb){_0x266c20=_0x266c20-0x0;var _0x509adc=_0x7a54[_0x266c20];return _0x509adc;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
index b074720..cd0cfc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ee2=['../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','describe','/:id','put','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5d6e35,_0x4d1ac0){var _0x5d7ada=function(_0x2f7dd3){while(--_0x2f7dd3){_0x5d6e35['push'](_0x5d6e35['shift']());}};_0x5d7ada(++_0x4d1ac0);}(_0x8ee2,0xac));var _0x28ee=function(_0x24502c,_0x491def){_0x24502c=_0x24502c-0x0;var _0x219d69=_0x8ee2[_0x24502c];return _0x219d69;};'use strict';var multer=require('multer');var util=require(_0x28ee('0x0'));var path=require(_0x28ee('0x1'));var timeout=require(_0x28ee('0x2'));var express=require(_0x28ee('0x3'));var router=express[_0x28ee('0x4')]();var fs_extra=require(_0x28ee('0x5'));var auth=require(_0x28ee('0x6'));var interaction=require(_0x28ee('0x7'));var config=require(_0x28ee('0x8'));var controller=require(_0x28ee('0x9'));router[_0x28ee('0xa')]('/',auth[_0x28ee('0xb')](),controller[_0x28ee('0xc')]);router['get']('/describe',auth[_0x28ee('0xb')](),controller[_0x28ee('0xd')]);router[_0x28ee('0xa')](_0x28ee('0xe'),auth[_0x28ee('0xb')](),controller['show']);router['post']('/',auth[_0x28ee('0xb')](),controller['create']);router[_0x28ee('0xf')](_0x28ee('0xe'),auth[_0x28ee('0xb')](),controller['update']);router[_0x28ee('0x10')](_0x28ee('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x28ee('0x11')]=router;
\ No newline at end of file
+var _0xdbcd=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','describe','/:id','show','create','put','update','delete'];(function(_0x49009e,_0x28c8a6){var _0x4fa03a=function(_0x381760){while(--_0x381760){_0x49009e['push'](_0x49009e['shift']());}};_0x4fa03a(++_0x28c8a6);}(_0xdbcd,0x178));var _0xddbc=function(_0x2a8042,_0x19e485){_0x2a8042=_0x2a8042-0x0;var _0x41a9d1=_0xdbcd[_0x2a8042];return _0x41a9d1;};'use strict';var multer=require(_0xddbc('0x0'));var util=require(_0xddbc('0x1'));var path=require(_0xddbc('0x2'));var timeout=require(_0xddbc('0x3'));var express=require(_0xddbc('0x4'));var router=express[_0xddbc('0x5')]();var fs_extra=require(_0xddbc('0x6'));var auth=require(_0xddbc('0x7'));var interaction=require(_0xddbc('0x8'));var config=require(_0xddbc('0x9'));var controller=require(_0xddbc('0xa'));router[_0xddbc('0xb')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0xddbc('0xc')](),controller[_0xddbc('0xd')]);router[_0xddbc('0xb')](_0xddbc('0xe'),auth[_0xddbc('0xc')](),controller[_0xddbc('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xddbc('0x10')]);router[_0xddbc('0x11')](_0xddbc('0xe'),auth[_0xddbc('0xc')](),controller[_0xddbc('0x12')]);router[_0xddbc('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xddbc('0x14')]);module[_0xddbc('0x15')]=router;
\ No newline at end of file
index d3a18ef..9c48521 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81c6=['exports'];(function(_0xbec8e6,_0x2841b5){var _0x4aa6f2=function(_0x583a0a){while(--_0x583a0a){_0xbec8e6['push'](_0xbec8e6['shift']());}};_0x4aa6f2(++_0x2841b5);}(_0x81c6,0x1d5));var _0x681c=function(_0x388c1c,_0x45ac57){_0x388c1c=_0x388c1c-0x0;var _0x2dada8=_0x81c6[_0x388c1c];return _0x2dada8;};'use strict';var Sequelize=require('sequelize');module[_0x681c('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xbeea=['sequelize','STRING','name'];(function(_0x36ea27,_0x27d9da){var _0x40e23c=function(_0x3170e7){while(--_0x3170e7){_0x36ea27['push'](_0x36ea27['shift']());}};_0x40e23c(++_0x27d9da);}(_0xbeea,0xb1));var _0xabee=function(_0x595cfc,_0x22ea3b){_0x595cfc=_0x595cfc-0x0;var _0x1213fd=_0xbeea[_0x595cfc];return _0x1213fd;};'use strict';var Sequelize=require(_0xabee('0x0'));module['exports']={'name':{'type':Sequelize[_0xabee('0x1')],'unique':_0xabee('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xabee('0x1')]}};
\ No newline at end of file
index 8ac0602..1fe78a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa75d=['create','body','describe','eml-format','rimraf','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','set','Content-Range','apply','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','merge','where','VIRTUAL','MailSubstatus','includeAll','include','findAll','rows','catch','show','params','model','keys','options','find'];(function(_0x35d8af,_0x14fd75){var _0x1d08b0=function(_0x36b437){while(--_0x36b437){_0x35d8af['push'](_0x35d8af['shift']());}};_0x1d08b0(++_0x14fd75);}(_0xa75d,0xea));var _0xda75=function(_0x1a60bb,_0x28aa67){_0x1a60bb=_0x1a60bb-0x0;var _0x41c815=_0xa75d[_0x1a60bb];return _0x41c815;};'use strict';var emlformat=require(_0xda75('0x0'));var rimraf=require(_0xda75('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xda75('0x2'));var Mustache=require('mustache');var util=require(_0xda75('0x3'));var path=require(_0xda75('0x4'));var sox=require(_0xda75('0x5'));var csv=require(_0xda75('0x6'));var ejs=require(_0xda75('0x7'));var fs=require('fs');var fs_extra=require(_0xda75('0x8'));var _=require(_0xda75('0x9'));var squel=require('squel');var crypto=require(_0xda75('0xa'));var jsforce=require(_0xda75('0xb'));var deskjs=require(_0xda75('0xc'));var toCsv=require('to-csv');var querystring=require(_0xda75('0xd'));var Papa=require(_0xda75('0xe'));var Redis=require(_0xda75('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xda75('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xda75('0x11'));var logger=require(_0xda75('0x12'))(_0xda75('0x13'));var utils=require('../../config/utils');var config=require(_0xda75('0x14'));var licenseUtil=require(_0xda75('0x15'));var db=require(_0xda75('0x16'))['db'];function respondWithStatusCode(_0x1eda9b,_0x2e95fe){_0x2e95fe=_0x2e95fe||0xcc;return function(_0x464623){if(_0x464623){return _0x1eda9b['sendStatus'](_0x2e95fe);}return _0x1eda9b[_0xda75('0x17')](_0x2e95fe)[_0xda75('0x18')]();};}function respondWithResult(_0x454ff4,_0x55ff98){_0x55ff98=_0x55ff98||0xc8;return function(_0x3ef809){if(_0x3ef809){return _0x454ff4['status'](_0x55ff98)[_0xda75('0x19')](_0x3ef809);}};}function respondWithFilteredResult(_0x34f0b4,_0xf37fa6){return function(_0x5ec5ee){if(_0x5ec5ee){var _0x3db21d=typeof _0xf37fa6['offset']==='undefined'&&typeof _0xf37fa6[_0xda75('0x1a')]===_0xda75('0x1b');var _0x3fe3eb=_0x5ec5ee[_0xda75('0x1c')];var _0x1a44c9=_0x3db21d?0x0:_0xf37fa6['offset'];var _0x4b64cb=_0x3db21d?_0x5ec5ee[_0xda75('0x1c')]:_0xf37fa6['offset']+_0xf37fa6[_0xda75('0x1a')];var _0x54a82b;if(_0x4b64cb>=_0x3fe3eb){_0x4b64cb=_0x3fe3eb;_0x54a82b=0xc8;}else{_0x54a82b=0xce;}_0x34f0b4[_0xda75('0x17')](_0x54a82b);return _0x34f0b4[_0xda75('0x1d')](_0xda75('0x1e'),_0x1a44c9+'-'+_0x4b64cb+'/'+_0x3fe3eb)[_0xda75('0x19')](_0x5ec5ee);}return null;};}function patchUpdates(_0x526ace){return function(_0x305935){try{jsonpatch[_0xda75('0x1f')](_0x305935,_0x526ace,!![]);}catch(_0x70e22c){return BPromise['reject'](_0x70e22c);}return _0x305935['save']();};}function saveUpdates(_0x13a867,_0x4b5874){return function(_0x282757){if(_0x282757){return _0x282757[_0xda75('0x20')](_0x13a867)[_0xda75('0x21')](function(_0x151f83){return _0x151f83;});}return null;};}function removeEntity(_0x578a81,_0x67ec2b){return function(_0x4a0286){if(_0x4a0286){return _0x4a0286[_0xda75('0x22')]()[_0xda75('0x21')](function(){_0x578a81['status'](0xcc)[_0xda75('0x18')]();});}};}function handleEntityNotFound(_0x31cded,_0x4d7371){return function(_0x241288){if(!_0x241288){_0x31cded[_0xda75('0x23')](0x194);}return _0x241288;};}function handleError(_0x13ab28,_0x401444){_0x401444=_0x401444||0x1f4;return function(_0x1e3003){logger[_0xda75('0x24')](_0x1e3003[_0xda75('0x25')]);if(_0x1e3003[_0xda75('0x26')]){delete _0x1e3003[_0xda75('0x26')];}_0x13ab28[_0xda75('0x17')](_0x401444)[_0xda75('0x27')](_0x1e3003);};}exports[_0xda75('0x28')]=function(_0x449037,_0x539a7b){var _0x406749={},_0x404cae={},_0x4b112c={'count':0x0,'rows':[]};var _0x1e61c8=_[_0xda75('0x29')](db['MailSubstatus'][_0xda75('0x2a')],function(_0x4b84ac){return{'name':_0x4b84ac[_0xda75('0x2b')],'type':_0x4b84ac[_0xda75('0x2c')][_0xda75('0x2d')]};});_0x404cae['model']=_[_0xda75('0x29')](_0x1e61c8,_0xda75('0x26'));_0x404cae[_0xda75('0x2e')]=_['keys'](_0x449037[_0xda75('0x2e')]);_0x404cae[_0xda75('0x2f')]=_[_0xda75('0x30')](_0x404cae['model'],_0x404cae[_0xda75('0x2e')]);_0x406749[_0xda75('0x31')]=_[_0xda75('0x30')](_0x404cae['model'],qs['fields'](_0x449037[_0xda75('0x2e')][_0xda75('0x32')]));_0x406749['attributes']=_0x406749['attributes'][_0xda75('0x33')]?_0x406749[_0xda75('0x31')]:_0x404cae['model'];if(!_0x449037[_0xda75('0x2e')][_0xda75('0x34')](_0xda75('0x35'))){_0x406749[_0xda75('0x1a')]=qs['limit'](_0x449037[_0xda75('0x2e')][_0xda75('0x1a')]);_0x406749[_0xda75('0x36')]=qs['offset'](_0x449037[_0xda75('0x2e')][_0xda75('0x36')]);}_0x406749[_0xda75('0x37')]=qs[_0xda75('0x38')](_0x449037['query'][_0xda75('0x38')]);_0x406749['where']=qs[_0xda75('0x2f')](_[_0xda75('0x39')](_0x449037[_0xda75('0x2e')],_0x404cae[_0xda75('0x2f')]),_0x1e61c8);if(_0x449037[_0xda75('0x2e')][_0xda75('0x3a')]){_0x406749['where']=_[_0xda75('0x3b')](_0x406749[_0xda75('0x3c')],{'$or':_['map'](_0x1e61c8,function(_0x589f04){if(_0x589f04[_0xda75('0x2c')]!==_0xda75('0x3d')){var _0xb0a483={};_0xb0a483[_0x589f04[_0xda75('0x26')]]={'$like':'%'+_0x449037['query'][_0xda75('0x3a')]+'%'};return _0xb0a483;}})});}_0x406749=_['merge']({},_0x406749,_0x449037['options']);var _0x230f88={'where':_0x406749[_0xda75('0x3c')]};return db[_0xda75('0x3e')]['count'](_0x230f88)[_0xda75('0x21')](function(_0x5e6d1a){_0x4b112c[_0xda75('0x1c')]=_0x5e6d1a;if(_0x449037['query'][_0xda75('0x3f')]){_0x406749[_0xda75('0x40')]=[{'all':!![]}];}return db['MailSubstatus'][_0xda75('0x41')](_0x406749);})[_0xda75('0x21')](function(_0x4c90ce){_0x4b112c[_0xda75('0x42')]=_0x4c90ce;return _0x4b112c;})[_0xda75('0x21')](respondWithFilteredResult(_0x539a7b,_0x406749))[_0xda75('0x43')](handleError(_0x539a7b,null));};exports[_0xda75('0x44')]=function(_0x4cf836,_0x52f3c6){var _0x4dcc3b={'raw':!![],'where':{'id':_0x4cf836[_0xda75('0x45')]['id']}},_0x592199={};_0x592199[_0xda75('0x46')]=_[_0xda75('0x47')](db[_0xda75('0x3e')]['rawAttributes']);_0x592199['query']=_[_0xda75('0x47')](_0x4cf836['query']);_0x592199['filters']=_[_0xda75('0x30')](_0x592199['model'],_0x592199['query']);_0x4dcc3b[_0xda75('0x31')]=_[_0xda75('0x30')](_0x592199[_0xda75('0x46')],qs['fields'](_0x4cf836['query'][_0xda75('0x32')]));_0x4dcc3b[_0xda75('0x31')]=_0x4dcc3b['attributes'][_0xda75('0x33')]?_0x4dcc3b[_0xda75('0x31')]:_0x592199[_0xda75('0x46')];if(_0x4cf836[_0xda75('0x2e')][_0xda75('0x3f')]){_0x4dcc3b[_0xda75('0x40')]=[{'all':!![]}];}_0x4dcc3b=_['merge']({},_0x4dcc3b,_0x4cf836[_0xda75('0x48')]);return db[_0xda75('0x3e')][_0xda75('0x49')](_0x4dcc3b)[_0xda75('0x21')](handleEntityNotFound(_0x52f3c6,null))[_0xda75('0x21')](respondWithResult(_0x52f3c6,null))[_0xda75('0x43')](handleError(_0x52f3c6,null));};exports[_0xda75('0x4a')]=function(_0x56f46a,_0x3071c1){return db[_0xda75('0x3e')][_0xda75('0x4a')](_0x56f46a[_0xda75('0x4b')],{})[_0xda75('0x21')](respondWithResult(_0x3071c1,0xc9))[_0xda75('0x43')](handleError(_0x3071c1,null));};exports['update']=function(_0x2097c4,_0x44d0d6){if(_0x2097c4['body']['id']){delete _0x2097c4[_0xda75('0x4b')]['id'];}return db[_0xda75('0x3e')][_0xda75('0x49')]({'where':{'id':_0x2097c4['params']['id']}})[_0xda75('0x21')](handleEntityNotFound(_0x44d0d6,null))[_0xda75('0x21')](saveUpdates(_0x2097c4['body'],null))[_0xda75('0x21')](respondWithResult(_0x44d0d6,null))[_0xda75('0x43')](handleError(_0x44d0d6,null));};exports['destroy']=function(_0x35543d,_0x5eaafe){return db['MailSubstatus'][_0xda75('0x49')]({'where':{'id':_0x35543d['params']['id']}})['then'](handleEntityNotFound(_0x5eaafe,null))[_0xda75('0x21')](removeEntity(_0x5eaafe,null))[_0xda75('0x43')](handleError(_0x5eaafe,null));};exports['describe']=function(_0x2f1d35,_0x22121c){return db[_0xda75('0x3e')][_0xda75('0x4c')]()[_0xda75('0x21')](respondWithResult(_0x22121c,null))[_0xda75('0x43')](handleError(_0x22121c,null));};
\ No newline at end of file
+var _0x118d=['status','end','json','offset','undefined','limit','count','apply','update','then','destroy','error','stack','name','send','index','map','MailSubstatus','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','catch','params','create','body','find','describe','eml-format','fast-json-patch','moment','bluebird','mustache','path','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus'];(function(_0x597997,_0x34a84e){var _0x3274da=function(_0xd83f59){while(--_0xd83f59){_0x597997['push'](_0x597997['shift']());}};_0x3274da(++_0x34a84e);}(_0x118d,0xb6));var _0xd118=function(_0x1e07d6,_0x1b3000){_0x1e07d6=_0x1e07d6-0x0;var _0x91f1f3=_0x118d[_0x1e07d6];return _0x91f1f3;};'use strict';var emlformat=require(_0xd118('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd118('0x1'));var rp=require('request-promise');var moment=require(_0xd118('0x2'));var BPromise=require(_0xd118('0x3'));var Mustache=require(_0xd118('0x4'));var util=require('util');var path=require(_0xd118('0x5'));var sox=require('sox');var csv=require(_0xd118('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd118('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd118('0x8'));var jsforce=require(_0xd118('0x9'));var deskjs=require(_0xd118('0xa'));var toCsv=require('to-csv');var querystring=require(_0xd118('0xb'));var Papa=require(_0xd118('0xc'));var Redis=require(_0xd118('0xd'));var authService=require(_0xd118('0xe'));var qs=require(_0xd118('0xf'));var as=require(_0xd118('0x10'));var hardwareService=require(_0xd118('0x11'));var logger=require(_0xd118('0x12'))(_0xd118('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd118('0x14'))['db'];function respondWithStatusCode(_0x439f00,_0x2e5b36){_0x2e5b36=_0x2e5b36||0xcc;return function(_0x1445dc){if(_0x1445dc){return _0x439f00[_0xd118('0x15')](_0x2e5b36);}return _0x439f00[_0xd118('0x16')](_0x2e5b36)[_0xd118('0x17')]();};}function respondWithResult(_0x59e9f4,_0x9da504){_0x9da504=_0x9da504||0xc8;return function(_0x591833){if(_0x591833){return _0x59e9f4[_0xd118('0x16')](_0x9da504)[_0xd118('0x18')](_0x591833);}};}function respondWithFilteredResult(_0x489b7f,_0xd9eca0){return function(_0x4f30cf){if(_0x4f30cf){var _0xc8f493=typeof _0xd9eca0[_0xd118('0x19')]===_0xd118('0x1a')&&typeof _0xd9eca0[_0xd118('0x1b')]===_0xd118('0x1a');var _0x487bc1=_0x4f30cf[_0xd118('0x1c')];var _0x5c4aae=_0xc8f493?0x0:_0xd9eca0[_0xd118('0x19')];var _0xc004f6=_0xc8f493?_0x4f30cf[_0xd118('0x1c')]:_0xd9eca0[_0xd118('0x19')]+_0xd9eca0[_0xd118('0x1b')];var _0x46bc8d;if(_0xc004f6>=_0x487bc1){_0xc004f6=_0x487bc1;_0x46bc8d=0xc8;}else{_0x46bc8d=0xce;}_0x489b7f[_0xd118('0x16')](_0x46bc8d);return _0x489b7f['set']('Content-Range',_0x5c4aae+'-'+_0xc004f6+'/'+_0x487bc1)[_0xd118('0x18')](_0x4f30cf);}return null;};}function patchUpdates(_0x49f122){return function(_0x3bdd51){try{jsonpatch[_0xd118('0x1d')](_0x3bdd51,_0x49f122,!![]);}catch(_0x4839fa){return BPromise['reject'](_0x4839fa);}return _0x3bdd51['save']();};}function saveUpdates(_0x3a3681,_0x3093b0){return function(_0x369992){if(_0x369992){return _0x369992[_0xd118('0x1e')](_0x3a3681)[_0xd118('0x1f')](function(_0x339469){return _0x339469;});}return null;};}function removeEntity(_0x73744f,_0x372eb9){return function(_0xe5af06){if(_0xe5af06){return _0xe5af06[_0xd118('0x20')]()[_0xd118('0x1f')](function(){_0x73744f[_0xd118('0x16')](0xcc)[_0xd118('0x17')]();});}};}function handleEntityNotFound(_0x3ab0f2,_0x464ff6){return function(_0x4a6d28){if(!_0x4a6d28){_0x3ab0f2['sendStatus'](0x194);}return _0x4a6d28;};}function handleError(_0x426514,_0x4bb18c){_0x4bb18c=_0x4bb18c||0x1f4;return function(_0x293892){logger[_0xd118('0x21')](_0x293892[_0xd118('0x22')]);if(_0x293892['name']){delete _0x293892[_0xd118('0x23')];}_0x426514[_0xd118('0x16')](_0x4bb18c)[_0xd118('0x24')](_0x293892);};}exports[_0xd118('0x25')]=function(_0x4f5703,_0x107db5){var _0x29daa5={},_0x360af5={},_0x55d79d={'count':0x0,'rows':[]};var _0x227986=_[_0xd118('0x26')](db[_0xd118('0x27')][_0xd118('0x28')],function(_0xf2e06b){return{'name':_0xf2e06b['fieldName'],'type':_0xf2e06b['type'][_0xd118('0x29')]};});_0x360af5['model']=_[_0xd118('0x26')](_0x227986,_0xd118('0x23'));_0x360af5[_0xd118('0x2a')]=_[_0xd118('0x2b')](_0x4f5703[_0xd118('0x2a')]);_0x360af5[_0xd118('0x2c')]=_[_0xd118('0x2d')](_0x360af5[_0xd118('0x2e')],_0x360af5['query']);_0x29daa5[_0xd118('0x2f')]=_[_0xd118('0x2d')](_0x360af5['model'],qs[_0xd118('0x30')](_0x4f5703['query'][_0xd118('0x30')]));_0x29daa5['attributes']=_0x29daa5[_0xd118('0x2f')][_0xd118('0x31')]?_0x29daa5['attributes']:_0x360af5[_0xd118('0x2e')];if(!_0x4f5703['query'][_0xd118('0x32')]('nolimit')){_0x29daa5[_0xd118('0x1b')]=qs[_0xd118('0x1b')](_0x4f5703[_0xd118('0x2a')][_0xd118('0x1b')]);_0x29daa5[_0xd118('0x19')]=qs[_0xd118('0x19')](_0x4f5703[_0xd118('0x2a')][_0xd118('0x19')]);}_0x29daa5[_0xd118('0x33')]=qs['sort'](_0x4f5703[_0xd118('0x2a')][_0xd118('0x34')]);_0x29daa5[_0xd118('0x35')]=qs['filters'](_[_0xd118('0x36')](_0x4f5703['query'],_0x360af5['filters']),_0x227986);if(_0x4f5703['query'][_0xd118('0x37')]){_0x29daa5[_0xd118('0x35')]=_[_0xd118('0x38')](_0x29daa5[_0xd118('0x35')],{'$or':_[_0xd118('0x26')](_0x227986,function(_0x3ee96e){if(_0x3ee96e[_0xd118('0x39')]!=='VIRTUAL'){var _0x15145b={};_0x15145b[_0x3ee96e[_0xd118('0x23')]]={'$like':'%'+_0x4f5703['query'][_0xd118('0x37')]+'%'};return _0x15145b;}})});}_0x29daa5=_['merge']({},_0x29daa5,_0x4f5703[_0xd118('0x3a')]);var _0x586bf6={'where':_0x29daa5[_0xd118('0x35')]};return db[_0xd118('0x27')][_0xd118('0x1c')](_0x586bf6)['then'](function(_0x315a7c){_0x55d79d[_0xd118('0x1c')]=_0x315a7c;if(_0x4f5703[_0xd118('0x2a')][_0xd118('0x3b')]){_0x29daa5[_0xd118('0x3c')]=[{'all':!![]}];}return db['MailSubstatus'][_0xd118('0x3d')](_0x29daa5);})[_0xd118('0x1f')](function(_0x3f9ff4){_0x55d79d['rows']=_0x3f9ff4;return _0x55d79d;})[_0xd118('0x1f')](respondWithFilteredResult(_0x107db5,_0x29daa5))[_0xd118('0x3e')](handleError(_0x107db5,null));};exports['show']=function(_0x12c79a,_0x439863){var _0x1d7ae3={'raw':!![],'where':{'id':_0x12c79a[_0xd118('0x3f')]['id']}},_0xaab31b={};_0xaab31b['model']=_[_0xd118('0x2b')](db[_0xd118('0x27')][_0xd118('0x28')]);_0xaab31b['query']=_[_0xd118('0x2b')](_0x12c79a[_0xd118('0x2a')]);_0xaab31b[_0xd118('0x2c')]=_['intersection'](_0xaab31b[_0xd118('0x2e')],_0xaab31b['query']);_0x1d7ae3[_0xd118('0x2f')]=_[_0xd118('0x2d')](_0xaab31b[_0xd118('0x2e')],qs[_0xd118('0x30')](_0x12c79a['query']['fields']));_0x1d7ae3[_0xd118('0x2f')]=_0x1d7ae3[_0xd118('0x2f')]['length']?_0x1d7ae3[_0xd118('0x2f')]:_0xaab31b[_0xd118('0x2e')];if(_0x12c79a[_0xd118('0x2a')][_0xd118('0x3b')]){_0x1d7ae3[_0xd118('0x3c')]=[{'all':!![]}];}_0x1d7ae3=_['merge']({},_0x1d7ae3,_0x12c79a[_0xd118('0x3a')]);return db['MailSubstatus']['find'](_0x1d7ae3)[_0xd118('0x1f')](handleEntityNotFound(_0x439863,null))[_0xd118('0x1f')](respondWithResult(_0x439863,null))[_0xd118('0x3e')](handleError(_0x439863,null));};exports['create']=function(_0x1bc182,_0x509207){return db[_0xd118('0x27')][_0xd118('0x40')](_0x1bc182['body'],{})['then'](respondWithResult(_0x509207,0xc9))[_0xd118('0x3e')](handleError(_0x509207,null));};exports[_0xd118('0x1e')]=function(_0x2e668f,_0x2228ab){if(_0x2e668f['body']['id']){delete _0x2e668f['body']['id'];}return db[_0xd118('0x27')]['find']({'where':{'id':_0x2e668f['params']['id']}})['then'](handleEntityNotFound(_0x2228ab,null))[_0xd118('0x1f')](saveUpdates(_0x2e668f[_0xd118('0x41')],null))['then'](respondWithResult(_0x2228ab,null))['catch'](handleError(_0x2228ab,null));};exports[_0xd118('0x20')]=function(_0x52a024,_0x1cd3c7){return db[_0xd118('0x27')][_0xd118('0x42')]({'where':{'id':_0x52a024[_0xd118('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1cd3c7,null))[_0xd118('0x1f')](removeEntity(_0x1cd3c7,null))[_0xd118('0x3e')](handleError(_0x1cd3c7,null));};exports[_0xd118('0x43')]=function(_0x35efeb,_0xc770e){return db[_0xd118('0x27')][_0xd118('0x43')]()['then'](respondWithResult(_0xc770e,null))[_0xd118('0x3e')](handleError(_0xc770e,null));};
\ No newline at end of file
index bd5663a..4fe3423 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd892=['api','bluebird','request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes','exports','define','MailSubstatus','mail_substatuses','lodash','util','../../config/logger'];(function(_0xc40850,_0x5de9ce){var _0x3b415c=function(_0x2ad960){while(--_0x2ad960){_0xc40850['push'](_0xc40850['shift']());}};_0x3b415c(++_0x5de9ce);}(_0xd892,0x13f));var _0x2d89=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xd892[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x2d89('0x0'));var util=require(_0x2d89('0x1'));var logger=require(_0x2d89('0x2'))(_0x2d89('0x3'));var moment=require('moment');var BPromise=require(_0x2d89('0x4'));var rp=require(_0x2d89('0x5'));var fs=require('fs');var path=require(_0x2d89('0x6'));var rimraf=require(_0x2d89('0x7'));var config=require(_0x2d89('0x8'));var attributes=require(_0x2d89('0x9'));module[_0x2d89('0xa')]=function(_0x5a7b62,_0x3b0327){return _0x5a7b62[_0x2d89('0xb')](_0x2d89('0xc'),attributes,{'tableName':_0x2d89('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5f08=['bluebird','request-promise','path','rimraf','define','mail_substatuses','util','api','moment'];(function(_0x2d34ca,_0x468d6d){var _0x33711d=function(_0x5ee7e3){while(--_0x5ee7e3){_0x2d34ca['push'](_0x2d34ca['shift']());}};_0x33711d(++_0x468d6d);}(_0x5f08,0x138));var _0x85f0=function(_0x18ea38,_0x5b07e5){_0x18ea38=_0x18ea38-0x0;var _0x38060e=_0x5f08[_0x18ea38];return _0x38060e;};'use strict';var _=require('lodash');var util=require(_0x85f0('0x0'));var logger=require('../../config/logger')(_0x85f0('0x1'));var moment=require(_0x85f0('0x2'));var BPromise=require(_0x85f0('0x3'));var rp=require(_0x85f0('0x4'));var fs=require('fs');var path=require(_0x85f0('0x5'));var rimraf=require(_0x85f0('0x6'));var config=require('../../config/environment');var attributes=require('./mailSubstatus.attributes');module['exports']=function(_0x52e118,_0x594624){return _0x52e118[_0x85f0('0x7')]('MailSubstatus',attributes,{'tableName':_0x85f0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b4b8570..858492d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37b6=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x592df4,_0x4e719b){var _0x3b4fe4=function(_0x5ebf53){while(--_0x5ebf53){_0x592df4['push'](_0x592df4['shift']());}};_0x3b4fe4(++_0x4e719b);}(_0x37b6,0x119));var _0x637b=function(_0x4b6944,_0xeb95e3){_0x4b6944=_0x4b6944-0x0;var _0x1bf147=_0x37b6[_0x4b6944];return _0x1bf147;};'use strict';var _=require(_0x637b('0x0'));var util=require(_0x637b('0x1'));var moment=require(_0x637b('0x2'));var BPromise=require(_0x637b('0x3'));var rs=require(_0x637b('0x4'));var fs=require('fs');var Redis=require(_0x637b('0x5'));var db=require(_0x637b('0x6'))['db'];var utils=require(_0x637b('0x7'));var logger=require(_0x637b('0x8'))(_0x637b('0x9'));var config=require('../../config/environment');var jayson=require(_0x637b('0xa'));var client=jayson[_0x637b('0xb')][_0x637b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5583f9,_0x34afa4,_0x152940){return new BPromise(function(_0x320814,_0x214e2c){return client[_0x637b('0xd')](_0x5583f9,_0x152940)['then'](function(_0x30da91){logger[_0x637b('0xe')](_0x637b('0xf'),_0x34afa4,'request\x20sent');logger[_0x637b('0x10')](_0x637b('0x11'),_0x34afa4,_0x637b('0x12'),JSON[_0x637b('0x13')](_0x30da91));if(_0x30da91[_0x637b('0x14')]){if(_0x30da91[_0x637b('0x14')][_0x637b('0x15')]===0x1f4){logger[_0x637b('0x14')](_0x637b('0xf'),_0x34afa4,_0x30da91['error'][_0x637b('0x16')]);return _0x214e2c(_0x30da91['error'][_0x637b('0x16')]);}logger['error'](_0x637b('0xf'),_0x34afa4,_0x30da91[_0x637b('0x14')][_0x637b('0x16')]);return _0x320814(_0x30da91[_0x637b('0x14')][_0x637b('0x16')]);}else{logger[_0x637b('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x34afa4,_0x637b('0x12'));_0x320814(_0x30da91[_0x637b('0x17')][_0x637b('0x16')]);}})[_0x637b('0x18')](function(_0x74ee9c){logger[_0x637b('0x14')](_0x637b('0xf'),_0x34afa4,_0x74ee9c);_0x214e2c(_0x74ee9c);});});}
\ No newline at end of file
+var _0x3fea=['request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','then','info','MailSubstatus,\x20%s,\x20%s'];(function(_0x22a4b8,_0x248b69){var _0x31b39c=function(_0x1375e8){while(--_0x1375e8){_0x22a4b8['push'](_0x22a4b8['shift']());}};_0x31b39c(++_0x248b69);}(_0x3fea,0x1bc));var _0xa3fe=function(_0x1c4a24,_0x2632e4){_0x1c4a24=_0x1c4a24-0x0;var _0x1ad99e=_0x3fea[_0x1c4a24];return _0x1ad99e;};'use strict';var _=require(_0xa3fe('0x0'));var util=require(_0xa3fe('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa3fe('0x2'));var fs=require('fs');var Redis=require(_0xa3fe('0x3'));var db=require(_0xa3fe('0x4'))['db'];var utils=require(_0xa3fe('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xa3fe('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa3fe('0x7')][_0xa3fe('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2971ba,_0x224ae8,_0x16ea77){return new BPromise(function(_0x22a5a3,_0x3a9f7c){return client['request'](_0x2971ba,_0x16ea77)[_0xa3fe('0x9')](function(_0x293d3c){logger[_0xa3fe('0xa')](_0xa3fe('0xb'),_0x224ae8,_0xa3fe('0xc'));logger['debug'](_0xa3fe('0xd'),_0x224ae8,_0xa3fe('0xc'),JSON['stringify'](_0x293d3c));if(_0x293d3c[_0xa3fe('0xe')]){if(_0x293d3c[_0xa3fe('0xe')][_0xa3fe('0xf')]===0x1f4){logger['error'](_0xa3fe('0xb'),_0x224ae8,_0x293d3c['error'][_0xa3fe('0x10')]);return _0x3a9f7c(_0x293d3c['error'][_0xa3fe('0x10')]);}logger['error'](_0xa3fe('0xb'),_0x224ae8,_0x293d3c[_0xa3fe('0xe')][_0xa3fe('0x10')]);return _0x22a5a3(_0x293d3c['error'][_0xa3fe('0x10')]);}else{logger[_0xa3fe('0xa')]('MailSubstatus,\x20%s,\x20%s',_0x224ae8,_0xa3fe('0xc'));_0x22a5a3(_0x293d3c[_0xa3fe('0x11')]['message']);}})[_0xa3fe('0x12')](function(_0x20aaf7){logger[_0xa3fe('0xe')](_0xa3fe('0xb'),_0x224ae8,_0x20aaf7);_0x3a9f7c(_0x20aaf7);});});}
\ No newline at end of file
index 0c29db9..86a2e6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf5e3=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','get','/describe','post','create','put','/:id','delete','destroy','exports','multer','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf5e3,0x1e0));var _0x3f5e=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xf5e3[_0x5608a3];return _0x1ed50a;};'use strict';var multer=require(_0x3f5e('0x0'));var util=require(_0x3f5e('0x1'));var path=require(_0x3f5e('0x2'));var timeout=require(_0x3f5e('0x3'));var express=require(_0x3f5e('0x4'));var router=express[_0x3f5e('0x5')]();var fs_extra=require(_0x3f5e('0x6'));var auth=require(_0x3f5e('0x7'));var interaction=require(_0x3f5e('0x8'));var config=require(_0x3f5e('0x9'));var controller=require(_0x3f5e('0xa'));router['get']('/',auth[_0x3f5e('0xb')](),controller['index']);router[_0x3f5e('0xc')](_0x3f5e('0xd'),auth[_0x3f5e('0xb')](),controller['describe']);router['get']('/:id',auth[_0x3f5e('0xb')](),controller['show']);router[_0x3f5e('0xe')]('/',auth[_0x3f5e('0xb')](),controller[_0x3f5e('0xf')]);router[_0x3f5e('0x10')](_0x3f5e('0x11'),auth[_0x3f5e('0xb')](),controller['update']);router[_0x3f5e('0x12')](_0x3f5e('0x11'),auth[_0x3f5e('0xb')](),controller[_0x3f5e('0x13')]);module[_0x3f5e('0x14')]=router;
\ No newline at end of file
+var _0x2c53=['index','/describe','isAuthenticated','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get'];(function(_0x7d3837,_0x54b098){var _0x240ff3=function(_0x252406){while(--_0x252406){_0x7d3837['push'](_0x7d3837['shift']());}};_0x240ff3(++_0x54b098);}(_0x2c53,0x166));var _0x32c5=function(_0x4695ba,_0x5a7f2a){_0x4695ba=_0x4695ba-0x0;var _0x524b7d=_0x2c53[_0x4695ba];return _0x524b7d;};'use strict';var multer=require(_0x32c5('0x0'));var util=require(_0x32c5('0x1'));var path=require(_0x32c5('0x2'));var timeout=require(_0x32c5('0x3'));var express=require(_0x32c5('0x4'));var router=express[_0x32c5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32c5('0x6'));var interaction=require(_0x32c5('0x7'));var config=require('../../config/environment');var controller=require(_0x32c5('0x8'));router[_0x32c5('0x9')]('/',auth['isAuthenticated'](),controller[_0x32c5('0xa')]);router['get'](_0x32c5('0xb'),auth[_0x32c5('0xc')](),controller[_0x32c5('0xd')]);router['get']('/:id',auth[_0x32c5('0xc')](),controller[_0x32c5('0xe')]);router[_0x32c5('0xf')]('/',auth['isAuthenticated'](),controller[_0x32c5('0x10')]);router[_0x32c5('0x11')](_0x32c5('0x12'),auth['isAuthenticated'](),controller[_0x32c5('0x13')]);router[_0x32c5('0x14')](_0x32c5('0x12'),auth['isAuthenticated'](),controller[_0x32c5('0x15')]);module[_0x32c5('0x16')]=router;
\ No newline at end of file
index fe48314..84563ac 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(_0x4a1430,_0x503a3c){var _0x48317c=function(_0x291bab){while(--_0x291bab){_0x4a1430['push'](_0x4a1430['shift']());}};_0x48317c(++_0x503a3c);}(_0x00bb,0x1d8));var _0xb00b=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x00bb[_0x411add];return _0x238242;};'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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x572e92,_0x5b8c78){var _0x50bf10=function(_0x4001d3){while(--_0x4001d3){_0x572e92['push'](_0x572e92['shift']());}};_0x50bf10(++_0x5b8c78);}(_0x008c,0x188));var _0xc008=function(_0x42f2a7,_0x5917c6){_0x42f2a7=_0x42f2a7-0x0;var _0x999180=_0x008c[_0x42f2a7];return _0x999180;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}};
\ No newline at end of file
index 129be65..484a979 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x569d=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','name','index','map','MailTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','eml-format','rimraf','moment','bluebird','mustache','util','path','to-csv','ejs','squel','jsforce','desk.js','querystring'];(function(_0x4fb570,_0xbb8ef8){var _0x44a1a7=function(_0x386b93){while(--_0x386b93){_0x4fb570['push'](_0x4fb570['shift']());}};_0x44a1a7(++_0xbb8ef8);}(_0x569d,0x1eb));var _0xd569=function(_0x182094,_0x269200){_0x182094=_0x182094-0x0;var _0x2e74ff=_0x569d[_0x182094];return _0x2e74ff;};'use strict';var emlformat=require(_0xd569('0x0'));var rimraf=require(_0xd569('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd569('0x2'));var BPromise=require(_0xd569('0x3'));var Mustache=require(_0xd569('0x4'));var util=require(_0xd569('0x5'));var path=require(_0xd569('0x6'));var sox=require('sox');var csv=require(_0xd569('0x7'));var ejs=require(_0xd569('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd569('0x9'));var crypto=require('crypto');var jsforce=require(_0xd569('0xa'));var deskjs=require(_0xd569('0xb'));var toCsv=require('to-csv');var querystring=require(_0xd569('0xc'));var Papa=require(_0xd569('0xd'));var Redis=require(_0xd569('0xe'));var authService=require(_0xd569('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd569('0x10'));var hardwareService=require(_0xd569('0x11'));var logger=require(_0xd569('0x12'))(_0xd569('0x13'));var utils=require(_0xd569('0x14'));var config=require(_0xd569('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd569('0x16'))['db'];function respondWithStatusCode(_0x26d707,_0x223a72){_0x223a72=_0x223a72||0xcc;return function(_0x1a5e9a){if(_0x1a5e9a){return _0x26d707[_0xd569('0x17')](_0x223a72);}return _0x26d707[_0xd569('0x18')](_0x223a72)['end']();};}function respondWithResult(_0x27ac39,_0x1a3a9c){_0x1a3a9c=_0x1a3a9c||0xc8;return function(_0x16034d){if(_0x16034d){return _0x27ac39['status'](_0x1a3a9c)[_0xd569('0x19')](_0x16034d);}};}function respondWithFilteredResult(_0x492e56,_0x282ac7){return function(_0x5dfce2){if(_0x5dfce2){var _0x2be6f3=typeof _0x282ac7[_0xd569('0x1a')]===_0xd569('0x1b')&&typeof _0x282ac7[_0xd569('0x1c')]==='undefined';var _0xaacad=_0x5dfce2[_0xd569('0x1d')];var _0x338c47=_0x2be6f3?0x0:_0x282ac7[_0xd569('0x1a')];var _0x1e5f8c=_0x2be6f3?_0x5dfce2[_0xd569('0x1d')]:_0x282ac7[_0xd569('0x1a')]+_0x282ac7[_0xd569('0x1c')];var _0x5a379e;if(_0x1e5f8c>=_0xaacad){_0x1e5f8c=_0xaacad;_0x5a379e=0xc8;}else{_0x5a379e=0xce;}_0x492e56['status'](_0x5a379e);return _0x492e56[_0xd569('0x1e')](_0xd569('0x1f'),_0x338c47+'-'+_0x1e5f8c+'/'+_0xaacad)['json'](_0x5dfce2);}return null;};}function patchUpdates(_0x587983){return function(_0x561f9c){try{jsonpatch[_0xd569('0x20')](_0x561f9c,_0x587983,!![]);}catch(_0x1704d3){return BPromise[_0xd569('0x21')](_0x1704d3);}return _0x561f9c[_0xd569('0x22')]();};}function saveUpdates(_0x2ed673,_0x6b6b94){return function(_0x3fae39){if(_0x3fae39){return _0x3fae39[_0xd569('0x23')](_0x2ed673)['then'](function(_0x5a4451){return _0x5a4451;});}return null;};}function removeEntity(_0x40fb61,_0x5a49e0){return function(_0x3d5fd6){if(_0x3d5fd6){return _0x3d5fd6[_0xd569('0x24')]()[_0xd569('0x25')](function(){_0x40fb61[_0xd569('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11f9ac,_0x420390){return function(_0x12e5e1){if(!_0x12e5e1){_0x11f9ac[_0xd569('0x17')](0x194);}return _0x12e5e1;};}function handleError(_0x31ea53,_0x1c213f){_0x1c213f=_0x1c213f||0x1f4;return function(_0x35bb48){logger['error'](_0x35bb48['stack']);if(_0x35bb48[_0xd569('0x26')]){delete _0x35bb48['name'];}_0x31ea53[_0xd569('0x18')](_0x1c213f)['send'](_0x35bb48);};}exports[_0xd569('0x27')]=function(_0x49759f,_0x5b5a70){var _0x108879={},_0x49a0c7={},_0x49a6a5={'count':0x0,'rows':[]};var _0x557ea8=_[_0xd569('0x28')](db[_0xd569('0x29')][_0xd569('0x2a')],function(_0x21a8f2){return{'name':_0x21a8f2['fieldName'],'type':_0x21a8f2[_0xd569('0x2b')][_0xd569('0x2c')]};});_0x49a0c7[_0xd569('0x2d')]=_[_0xd569('0x28')](_0x557ea8,_0xd569('0x26'));_0x49a0c7[_0xd569('0x2e')]=_[_0xd569('0x2f')](_0x49759f['query']);_0x49a0c7[_0xd569('0x30')]=_[_0xd569('0x31')](_0x49a0c7[_0xd569('0x2d')],_0x49a0c7[_0xd569('0x2e')]);_0x108879[_0xd569('0x32')]=_[_0xd569('0x31')](_0x49a0c7[_0xd569('0x2d')],qs['fields'](_0x49759f[_0xd569('0x2e')][_0xd569('0x33')]));_0x108879['attributes']=_0x108879[_0xd569('0x32')][_0xd569('0x34')]?_0x108879['attributes']:_0x49a0c7[_0xd569('0x2d')];if(!_0x49759f[_0xd569('0x2e')]['hasOwnProperty'](_0xd569('0x35'))){_0x108879[_0xd569('0x1c')]=qs['limit'](_0x49759f[_0xd569('0x2e')][_0xd569('0x1c')]);_0x108879[_0xd569('0x1a')]=qs[_0xd569('0x1a')](_0x49759f['query'][_0xd569('0x1a')]);}_0x108879[_0xd569('0x36')]=qs[_0xd569('0x37')](_0x49759f[_0xd569('0x2e')][_0xd569('0x37')]);_0x108879['where']=qs[_0xd569('0x30')](_[_0xd569('0x38')](_0x49759f[_0xd569('0x2e')],_0x49a0c7[_0xd569('0x30')]),_0x557ea8);if(_0x49759f[_0xd569('0x2e')][_0xd569('0x39')]){_0x108879['where']=_[_0xd569('0x3a')](_0x108879[_0xd569('0x3b')],{'$or':_[_0xd569('0x28')](_0x557ea8,function(_0x11bb4a){if(_0x11bb4a[_0xd569('0x2b')]!==_0xd569('0x3c')){var _0x26df41={};_0x26df41[_0x11bb4a[_0xd569('0x26')]]={'$like':'%'+_0x49759f[_0xd569('0x2e')][_0xd569('0x39')]+'%'};return _0x26df41;}})});}_0x108879=_['merge']({},_0x108879,_0x49759f[_0xd569('0x3d')]);var _0x156839={'where':_0x108879[_0xd569('0x3b')]};return db[_0xd569('0x29')][_0xd569('0x1d')](_0x156839)[_0xd569('0x25')](function(_0x53d8de){_0x49a6a5[_0xd569('0x1d')]=_0x53d8de;if(_0x49759f[_0xd569('0x2e')][_0xd569('0x3e')]){_0x108879[_0xd569('0x3f')]=[{'all':!![]}];}return db[_0xd569('0x29')][_0xd569('0x40')](_0x108879);})['then'](function(_0x257f69){_0x49a6a5['rows']=_0x257f69;return _0x49a6a5;})[_0xd569('0x25')](respondWithFilteredResult(_0x5b5a70,_0x108879))[_0xd569('0x41')](handleError(_0x5b5a70,null));};exports[_0xd569('0x42')]=function(_0x244087,_0x4bfdc7){var _0x3139d9={'raw':!![],'where':{'id':_0x244087[_0xd569('0x43')]['id']}},_0x3664bf={};_0x3664bf[_0xd569('0x2d')]=_['keys'](db[_0xd569('0x29')]['rawAttributes']);_0x3664bf[_0xd569('0x2e')]=_['keys'](_0x244087[_0xd569('0x2e')]);_0x3664bf[_0xd569('0x30')]=_['intersection'](_0x3664bf[_0xd569('0x2d')],_0x3664bf[_0xd569('0x2e')]);_0x3139d9[_0xd569('0x32')]=_[_0xd569('0x31')](_0x3664bf[_0xd569('0x2d')],qs[_0xd569('0x33')](_0x244087[_0xd569('0x2e')][_0xd569('0x33')]));_0x3139d9[_0xd569('0x32')]=_0x3139d9[_0xd569('0x32')]['length']?_0x3139d9[_0xd569('0x32')]:_0x3664bf[_0xd569('0x2d')];if(_0x244087['query'][_0xd569('0x3e')]){_0x3139d9[_0xd569('0x3f')]=[{'all':!![]}];}_0x3139d9=_['merge']({},_0x3139d9,_0x244087['options']);return db[_0xd569('0x29')][_0xd569('0x44')](_0x3139d9)['then'](handleEntityNotFound(_0x4bfdc7,null))[_0xd569('0x25')](respondWithResult(_0x4bfdc7,null))[_0xd569('0x41')](handleError(_0x4bfdc7,null));};exports['create']=function(_0x3dc731,_0x376e73){return db[_0xd569('0x29')][_0xd569('0x45')](_0x3dc731[_0xd569('0x46')],{})[_0xd569('0x25')](respondWithResult(_0x376e73,0xc9))[_0xd569('0x41')](handleError(_0x376e73,null));};exports[_0xd569('0x23')]=function(_0x111c20,_0x5776c3){if(_0x111c20[_0xd569('0x46')]['id']){delete _0x111c20[_0xd569('0x46')]['id'];}return db[_0xd569('0x29')][_0xd569('0x44')]({'where':{'id':_0x111c20[_0xd569('0x43')]['id']}})['then'](handleEntityNotFound(_0x5776c3,null))[_0xd569('0x25')](saveUpdates(_0x111c20[_0xd569('0x46')],null))['then'](respondWithResult(_0x5776c3,null))[_0xd569('0x41')](handleError(_0x5776c3,null));};exports['destroy']=function(_0x26d498,_0x2b065d){return db['MailTransferReport'][_0xd569('0x44')]({'where':{'id':_0x26d498[_0xd569('0x43')]['id']}})[_0xd569('0x25')](handleEntityNotFound(_0x2b065d,null))[_0xd569('0x25')](removeEntity(_0x2b065d,null))[_0xd569('0x41')](handleError(_0x2b065d,null));};exports[_0xd569('0x47')]=function(_0x4f11a5,_0xfa0584){return db[_0xd569('0x29')][_0xd569('0x47')]()[_0xd569('0x25')](respondWithResult(_0xfa0584,null))[_0xd569('0x41')](handleError(_0xfa0584,null));};
\ No newline at end of file
+var _0xfd32=['where','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','describe','rimraf','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x3b72b3,_0x339310){var _0x540a70=function(_0x4f5868){while(--_0x4f5868){_0x3b72b3['push'](_0x3b72b3['shift']());}};_0x540a70(++_0x339310);}(_0xfd32,0xf1));var _0x2fd3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd32[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2fd3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2fd3('0x1'));var rp=require(_0x2fd3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2fd3('0x3'));var util=require(_0x2fd3('0x4'));var path=require('path');var sox=require(_0x2fd3('0x5'));var csv=require(_0x2fd3('0x6'));var ejs=require(_0x2fd3('0x7'));var fs=require('fs');var fs_extra=require(_0x2fd3('0x8'));var _=require(_0x2fd3('0x9'));var squel=require(_0x2fd3('0xa'));var crypto=require(_0x2fd3('0xb'));var jsforce=require(_0x2fd3('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2fd3('0x6'));var querystring=require(_0x2fd3('0xd'));var Papa=require(_0x2fd3('0xe'));var Redis=require(_0x2fd3('0xf'));var authService=require(_0x2fd3('0x10'));var qs=require(_0x2fd3('0x11'));var as=require(_0x2fd3('0x12'));var hardwareService=require(_0x2fd3('0x13'));var logger=require('../../config/logger')(_0x2fd3('0x14'));var utils=require('../../config/utils');var config=require(_0x2fd3('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x198a41,_0x7f743){_0x7f743=_0x7f743||0xcc;return function(_0x48ba81){if(_0x48ba81){return _0x198a41[_0x2fd3('0x16')](_0x7f743);}return _0x198a41['status'](_0x7f743)[_0x2fd3('0x17')]();};}function respondWithResult(_0x26e675,_0x2b564e){_0x2b564e=_0x2b564e||0xc8;return function(_0x2e30ec){if(_0x2e30ec){return _0x26e675[_0x2fd3('0x18')](_0x2b564e)[_0x2fd3('0x19')](_0x2e30ec);}};}function respondWithFilteredResult(_0x21efbf,_0x1df803){return function(_0xa8e68b){if(_0xa8e68b){var _0x5e6abe=typeof _0x1df803[_0x2fd3('0x1a')]===_0x2fd3('0x1b')&&typeof _0x1df803[_0x2fd3('0x1c')]===_0x2fd3('0x1b');var _0x554302=_0xa8e68b[_0x2fd3('0x1d')];var _0x22374f=_0x5e6abe?0x0:_0x1df803[_0x2fd3('0x1a')];var _0xd0eb8a=_0x5e6abe?_0xa8e68b[_0x2fd3('0x1d')]:_0x1df803['offset']+_0x1df803[_0x2fd3('0x1c')];var _0x421262;if(_0xd0eb8a>=_0x554302){_0xd0eb8a=_0x554302;_0x421262=0xc8;}else{_0x421262=0xce;}_0x21efbf[_0x2fd3('0x18')](_0x421262);return _0x21efbf[_0x2fd3('0x1e')](_0x2fd3('0x1f'),_0x22374f+'-'+_0xd0eb8a+'/'+_0x554302)[_0x2fd3('0x19')](_0xa8e68b);}return null;};}function patchUpdates(_0x4ac07a){return function(_0x478b12){try{jsonpatch['apply'](_0x478b12,_0x4ac07a,!![]);}catch(_0x5e9fa5){return BPromise[_0x2fd3('0x20')](_0x5e9fa5);}return _0x478b12[_0x2fd3('0x21')]();};}function saveUpdates(_0x11eb9f,_0x276568){return function(_0x44e1b1){if(_0x44e1b1){return _0x44e1b1[_0x2fd3('0x22')](_0x11eb9f)[_0x2fd3('0x23')](function(_0x5289b8){return _0x5289b8;});}return null;};}function removeEntity(_0x56520d,_0x21f23f){return function(_0x2ae238){if(_0x2ae238){return _0x2ae238[_0x2fd3('0x24')]()[_0x2fd3('0x23')](function(){_0x56520d['status'](0xcc)[_0x2fd3('0x17')]();});}};}function handleEntityNotFound(_0x53a728,_0x4d251e){return function(_0x5d5253){if(!_0x5d5253){_0x53a728[_0x2fd3('0x16')](0x194);}return _0x5d5253;};}function handleError(_0x43c90f,_0xecc435){_0xecc435=_0xecc435||0x1f4;return function(_0x2082d8){logger[_0x2fd3('0x25')](_0x2082d8['stack']);if(_0x2082d8['name']){delete _0x2082d8[_0x2fd3('0x26')];}_0x43c90f[_0x2fd3('0x18')](_0xecc435)[_0x2fd3('0x27')](_0x2082d8);};}exports[_0x2fd3('0x28')]=function(_0x28a8fe,_0x3b0a81){var _0x4bbd63={},_0x9928b6={},_0x299c80={'count':0x0,'rows':[]};var _0x3176e2=_[_0x2fd3('0x29')](db[_0x2fd3('0x2a')][_0x2fd3('0x2b')],function(_0x32b112){return{'name':_0x32b112[_0x2fd3('0x2c')],'type':_0x32b112[_0x2fd3('0x2d')][_0x2fd3('0x2e')]};});_0x9928b6[_0x2fd3('0x2f')]=_[_0x2fd3('0x29')](_0x3176e2,_0x2fd3('0x26'));_0x9928b6[_0x2fd3('0x30')]=_[_0x2fd3('0x31')](_0x28a8fe[_0x2fd3('0x30')]);_0x9928b6[_0x2fd3('0x32')]=_[_0x2fd3('0x33')](_0x9928b6['model'],_0x9928b6[_0x2fd3('0x30')]);_0x4bbd63['attributes']=_[_0x2fd3('0x33')](_0x9928b6['model'],qs['fields'](_0x28a8fe[_0x2fd3('0x30')][_0x2fd3('0x34')]));_0x4bbd63[_0x2fd3('0x35')]=_0x4bbd63['attributes'][_0x2fd3('0x36')]?_0x4bbd63['attributes']:_0x9928b6['model'];if(!_0x28a8fe[_0x2fd3('0x30')][_0x2fd3('0x37')](_0x2fd3('0x38'))){_0x4bbd63[_0x2fd3('0x1c')]=qs['limit'](_0x28a8fe[_0x2fd3('0x30')][_0x2fd3('0x1c')]);_0x4bbd63[_0x2fd3('0x1a')]=qs[_0x2fd3('0x1a')](_0x28a8fe[_0x2fd3('0x30')][_0x2fd3('0x1a')]);}_0x4bbd63[_0x2fd3('0x39')]=qs[_0x2fd3('0x3a')](_0x28a8fe[_0x2fd3('0x30')][_0x2fd3('0x3a')]);_0x4bbd63[_0x2fd3('0x3b')]=qs[_0x2fd3('0x32')](_['pick'](_0x28a8fe['query'],_0x9928b6[_0x2fd3('0x32')]),_0x3176e2);if(_0x28a8fe[_0x2fd3('0x30')][_0x2fd3('0x3c')]){_0x4bbd63[_0x2fd3('0x3b')]=_['merge'](_0x4bbd63[_0x2fd3('0x3b')],{'$or':_[_0x2fd3('0x29')](_0x3176e2,function(_0x67c79d){if(_0x67c79d['type']!==_0x2fd3('0x3d')){var _0x5ac511={};_0x5ac511[_0x67c79d['name']]={'$like':'%'+_0x28a8fe[_0x2fd3('0x30')][_0x2fd3('0x3c')]+'%'};return _0x5ac511;}})});}_0x4bbd63=_['merge']({},_0x4bbd63,_0x28a8fe[_0x2fd3('0x3e')]);var _0x5e1f30={'where':_0x4bbd63['where']};return db[_0x2fd3('0x2a')][_0x2fd3('0x1d')](_0x5e1f30)[_0x2fd3('0x23')](function(_0x38e545){_0x299c80[_0x2fd3('0x1d')]=_0x38e545;if(_0x28a8fe[_0x2fd3('0x30')][_0x2fd3('0x3f')]){_0x4bbd63[_0x2fd3('0x40')]=[{'all':!![]}];}return db[_0x2fd3('0x2a')][_0x2fd3('0x41')](_0x4bbd63);})[_0x2fd3('0x23')](function(_0x329d81){_0x299c80[_0x2fd3('0x42')]=_0x329d81;return _0x299c80;})[_0x2fd3('0x23')](respondWithFilteredResult(_0x3b0a81,_0x4bbd63))[_0x2fd3('0x43')](handleError(_0x3b0a81,null));};exports[_0x2fd3('0x44')]=function(_0x56fc69,_0x456e45){var _0xb7c72d={'raw':!![],'where':{'id':_0x56fc69[_0x2fd3('0x45')]['id']}},_0x322e37={};_0x322e37[_0x2fd3('0x2f')]=_[_0x2fd3('0x31')](db[_0x2fd3('0x2a')]['rawAttributes']);_0x322e37['query']=_[_0x2fd3('0x31')](_0x56fc69[_0x2fd3('0x30')]);_0x322e37[_0x2fd3('0x32')]=_['intersection'](_0x322e37[_0x2fd3('0x2f')],_0x322e37[_0x2fd3('0x30')]);_0xb7c72d[_0x2fd3('0x35')]=_['intersection'](_0x322e37[_0x2fd3('0x2f')],qs[_0x2fd3('0x34')](_0x56fc69[_0x2fd3('0x30')][_0x2fd3('0x34')]));_0xb7c72d[_0x2fd3('0x35')]=_0xb7c72d[_0x2fd3('0x35')][_0x2fd3('0x36')]?_0xb7c72d[_0x2fd3('0x35')]:_0x322e37[_0x2fd3('0x2f')];if(_0x56fc69[_0x2fd3('0x30')][_0x2fd3('0x3f')]){_0xb7c72d['include']=[{'all':!![]}];}_0xb7c72d=_[_0x2fd3('0x46')]({},_0xb7c72d,_0x56fc69[_0x2fd3('0x3e')]);return db[_0x2fd3('0x2a')][_0x2fd3('0x47')](_0xb7c72d)[_0x2fd3('0x23')](handleEntityNotFound(_0x456e45,null))[_0x2fd3('0x23')](respondWithResult(_0x456e45,null))['catch'](handleError(_0x456e45,null));};exports[_0x2fd3('0x48')]=function(_0x21ca66,_0x336873){return db[_0x2fd3('0x2a')]['create'](_0x21ca66[_0x2fd3('0x49')],{})[_0x2fd3('0x23')](respondWithResult(_0x336873,0xc9))[_0x2fd3('0x43')](handleError(_0x336873,null));};exports['update']=function(_0x52b937,_0x32d481){if(_0x52b937[_0x2fd3('0x49')]['id']){delete _0x52b937[_0x2fd3('0x49')]['id'];}return db[_0x2fd3('0x2a')][_0x2fd3('0x47')]({'where':{'id':_0x52b937['params']['id']}})[_0x2fd3('0x23')](handleEntityNotFound(_0x32d481,null))[_0x2fd3('0x23')](saveUpdates(_0x52b937[_0x2fd3('0x49')],null))['then'](respondWithResult(_0x32d481,null))[_0x2fd3('0x43')](handleError(_0x32d481,null));};exports[_0x2fd3('0x24')]=function(_0x4b512e,_0x2a60c3){return db['MailTransferReport'][_0x2fd3('0x47')]({'where':{'id':_0x4b512e[_0x2fd3('0x45')]['id']}})[_0x2fd3('0x23')](handleEntityNotFound(_0x2a60c3,null))[_0x2fd3('0x23')](removeEntity(_0x2a60c3,null))[_0x2fd3('0x43')](handleError(_0x2a60c3,null));};exports[_0x2fd3('0x4a')]=function(_0x5fc3ac,_0x2d8173){return db[_0x2fd3('0x2a')][_0x2fd3('0x4a')]()['then'](respondWithResult(_0x2d8173,null))[_0x2fd3('0x43')](handleError(_0x2d8173,null));};
\ No newline at end of file
index 2ede282..8b89234 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x142c=['./mailTransferReport.attributes','define','MailTransferReport','report_mail_transfer','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x284a61,_0x231686){var _0x220e3c=function(_0x104496){while(--_0x104496){_0x284a61['push'](_0x284a61['shift']());}};_0x220e3c(++_0x231686);}(_0x142c,0x86));var _0xc142=function(_0x4742d0,_0x3667bd){_0x4742d0=_0x4742d0-0x0;var _0x43bc00=_0x142c[_0x4742d0];return _0x43bc00;};'use strict';var _=require(_0xc142('0x0'));var util=require('util');var logger=require(_0xc142('0x1'))(_0xc142('0x2'));var moment=require(_0xc142('0x3'));var BPromise=require('bluebird');var rp=require(_0xc142('0x4'));var fs=require('fs');var path=require(_0xc142('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc142('0x6'));module['exports']=function(_0x4033e9,_0x53b32f){return _0x4033e9[_0xc142('0x7')](_0xc142('0x8'),attributes,{'tableName':_0xc142('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbe22=['rimraf','../../config/environment','./mailTransferReport.attributes','exports','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','moment','bluebird','request-promise','path'];(function(_0x224233,_0x4bcfdc){var _0x50c518=function(_0xfe6f8b){while(--_0xfe6f8b){_0x224233['push'](_0x224233['shift']());}};_0x50c518(++_0x4bcfdc);}(_0xbe22,0x1c1));var _0x2be2=function(_0x223a07,_0x58fd2b){_0x223a07=_0x223a07-0x0;var _0x2bcdbb=_0xbe22[_0x223a07];return _0x2bcdbb;};'use strict';var _=require(_0x2be2('0x0'));var util=require(_0x2be2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2be2('0x2'));var BPromise=require(_0x2be2('0x3'));var rp=require(_0x2be2('0x4'));var fs=require('fs');var path=require(_0x2be2('0x5'));var rimraf=require(_0x2be2('0x6'));var config=require(_0x2be2('0x7'));var attributes=require(_0x2be2('0x8'));module[_0x2be2('0x9')]=function(_0x1b3bde,_0x3a4d77){return _0x1b3bde['define'](_0x2be2('0xa'),attributes,{'tableName':_0x2be2('0xb'),'paranoid':![],'indexes':[{'name':_0x2be2('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index acaaf98..4c99f42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x486dbe,_0x261b87){var _0x2b384b=function(_0x2e2c13){while(--_0x2e2c13){_0x486dbe['push'](_0x486dbe['shift']());}};_0x2b384b(++_0x261b87);}(_0x0713,0x9d));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x3071('0x0'));var moment=require(_0x3071('0x1'));var BPromise=require('bluebird');var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3071('0x3'));var logger=require(_0x3071('0x4'))(_0x3071('0x5'));var config=require(_0x3071('0x6'));var jayson=require(_0x3071('0x7'));var client=jayson[_0x3071('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2120b3,_0x2d7142,_0x2a9940){return new BPromise(function(_0x17bd7c,_0x4a1bfb){return client[_0x3071('0x9')](_0x2120b3,_0x2a9940)[_0x3071('0xa')](function(_0x15d878){logger[_0x3071('0xb')](_0x3071('0xc'),_0x2d7142,_0x3071('0xd'));logger[_0x3071('0xe')](_0x3071('0xf'),_0x2d7142,_0x3071('0xd'),JSON[_0x3071('0x10')](_0x15d878));if(_0x15d878[_0x3071('0x11')]){if(_0x15d878[_0x3071('0x11')][_0x3071('0x12')]===0x1f4){logger[_0x3071('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x2d7142,_0x15d878[_0x3071('0x11')][_0x3071('0x13')]);return _0x4a1bfb(_0x15d878[_0x3071('0x11')]['message']);}logger[_0x3071('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x2d7142,_0x15d878['error']['message']);return _0x17bd7c(_0x15d878[_0x3071('0x11')][_0x3071('0x13')]);}else{logger['info'](_0x3071('0xc'),_0x2d7142,'request\x20sent');_0x17bd7c(_0x15d878[_0x3071('0x14')][_0x3071('0x13')]);}})['catch'](function(_0x5c79e6){logger[_0x3071('0x11')](_0x3071('0xc'),_0x2d7142,_0x5c79e6);_0x4a1bfb(_0x5c79e6);});});}
\ No newline at end of file
+var _0x97db=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','then','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','ioredis'];(function(_0x99bff7,_0x33f3e6){var _0x53cc2f=function(_0x2f9c4d){while(--_0x2f9c4d){_0x99bff7['push'](_0x99bff7['shift']());}};_0x53cc2f(++_0x33f3e6);}(_0x97db,0x1b4));var _0xb97d=function(_0x4514a7,_0x5a4c15){_0x4514a7=_0x4514a7-0x0;var _0x4129cd=_0x97db[_0x4514a7];return _0x4129cd;};'use strict';var _=require(_0xb97d('0x0'));var util=require(_0xb97d('0x1'));var moment=require(_0xb97d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb97d('0x3'));var db=require(_0xb97d('0x4'))['db'];var utils=require(_0xb97d('0x5'));var logger=require(_0xb97d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb97d('0x7'));var client=jayson[_0xb97d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x533149,_0x2ff80e,_0x57cbd4){return new BPromise(function(_0x20f1e1,_0x2e1230){return client['request'](_0x533149,_0x57cbd4)[_0xb97d('0x9')](function(_0xe9acff){logger[_0xb97d('0xa')](_0xb97d('0xb'),_0x2ff80e,'request\x20sent');logger[_0xb97d('0xc')](_0xb97d('0xd'),_0x2ff80e,_0xb97d('0xe'),JSON[_0xb97d('0xf')](_0xe9acff));if(_0xe9acff[_0xb97d('0x10')]){if(_0xe9acff[_0xb97d('0x10')][_0xb97d('0x11')]===0x1f4){logger[_0xb97d('0x10')](_0xb97d('0xb'),_0x2ff80e,_0xe9acff[_0xb97d('0x10')][_0xb97d('0x12')]);return _0x2e1230(_0xe9acff[_0xb97d('0x10')][_0xb97d('0x12')]);}logger[_0xb97d('0x10')](_0xb97d('0xb'),_0x2ff80e,_0xe9acff[_0xb97d('0x10')][_0xb97d('0x12')]);return _0x20f1e1(_0xe9acff[_0xb97d('0x10')]['message']);}else{logger[_0xb97d('0xa')](_0xb97d('0xb'),_0x2ff80e,_0xb97d('0xe'));_0x20f1e1(_0xe9acff[_0xb97d('0x13')][_0xb97d('0x12')]);}})['catch'](function(_0x416d6a){logger[_0xb97d('0x10')](_0xb97d('0xb'),_0x2ff80e,_0x416d6a);_0x2e1230(_0x416d6a);});});}
\ No newline at end of file
index 56ac57d..cbfeef4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe96e=['../../config/environment','./memberReport.controller','get','isAuthenticated','index','describe','/:id','post','create','update','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5897fd,_0x4cb296){var _0x16bd0d=function(_0x15e2da){while(--_0x15e2da){_0x5897fd['push'](_0x5897fd['shift']());}};_0x16bd0d(++_0x4cb296);}(_0xe96e,0x181));var _0xee96=function(_0x57bbb6,_0xf8575d){_0x57bbb6=_0x57bbb6-0x0;var _0x167c4f=_0xe96e[_0x57bbb6];return _0x167c4f;};'use strict';var multer=require(_0xee96('0x0'));var util=require(_0xee96('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xee96('0x2')]();var fs_extra=require(_0xee96('0x3'));var auth=require(_0xee96('0x4'));var interaction=require(_0xee96('0x5'));var config=require(_0xee96('0x6'));var controller=require(_0xee96('0x7'));router[_0xee96('0x8')]('/',auth[_0xee96('0x9')](),controller[_0xee96('0xa')]);router[_0xee96('0x8')]('/describe',auth[_0xee96('0x9')](),controller[_0xee96('0xb')]);router[_0xee96('0x8')](_0xee96('0xc'),auth[_0xee96('0x9')](),controller['show']);router[_0xee96('0xd')]('/',auth[_0xee96('0x9')](),controller[_0xee96('0xe')]);router['put'](_0xee96('0xc'),auth[_0xee96('0x9')](),controller[_0xee96('0xf')]);router['delete'](_0xee96('0xc'),auth[_0xee96('0x9')](),controller[_0xee96('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x657b=['/describe','describe','/:id','show','create','put','delete','destroy','exports','path','Router','fs-extra','../../components/interaction/service','./memberReport.controller','get','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x657b,0xa2));var _0xb657=function(_0x18f4d6,_0x4d973f){_0x18f4d6=_0x18f4d6-0x0;var _0x5c5de1=_0x657b[_0x18f4d6];return _0x5c5de1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb657('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb657('0x1')]();var fs_extra=require(_0xb657('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xb657('0x3'));var config=require('../../config/environment');var controller=require(_0xb657('0x4'));router[_0xb657('0x5')]('/',auth[_0xb657('0x6')](),controller[_0xb657('0x7')]);router[_0xb657('0x5')](_0xb657('0x8'),auth[_0xb657('0x6')](),controller[_0xb657('0x9')]);router[_0xb657('0x5')](_0xb657('0xa'),auth[_0xb657('0x6')](),controller[_0xb657('0xb')]);router['post']('/',auth[_0xb657('0x6')](),controller[_0xb657('0xc')]);router[_0xb657('0xd')](_0xb657('0xa'),auth[_0xb657('0x6')](),controller['update']);router[_0xb657('0xe')](_0xb657('0xa'),auth[_0xb657('0x6')](),controller[_0xb657('0xf')]);module[_0xb657('0x10')]=router;
\ No newline at end of file
index 4ad6b5a..c52214f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0eec=['diff','seconds','exitAt','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x0eec,0xac));var _0xc0ee=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0eec[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xc0ee('0x0'));var moment=require('moment');module['exports']={'channel':{'type':Sequelize[_0xc0ee('0x1')]},'membername':{'type':Sequelize[_0xc0ee('0x1')]},'interface':{'type':Sequelize[_0xc0ee('0x1')]},'type':{'type':Sequelize[_0xc0ee('0x1')],'defaultValue':_0xc0ee('0x2'),'comment':_0xc0ee('0x3')},'duration':{'type':Sequelize[_0xc0ee('0x4')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xc0ee('0x5')],'set':function(_0x4db3d6){var _0x218797=moment(_0x4db3d6);var _0x39022a=moment(this[_0xc0ee('0x6')](_0xc0ee('0x7')));var _0x38b387=_0x218797[_0xc0ee('0x8')](_0x39022a,_0xc0ee('0x9'));this['setDataValue'](_0xc0ee('0xa'),_0x4db3d6);this[_0xc0ee('0xb')](_0xc0ee('0xc'),_0x38b387||null);}},'data1':{'type':Sequelize[_0xc0ee('0x1')],'comment':_0xc0ee('0xd')},'data2':{'type':Sequelize[_0xc0ee('0x1')],'comment':_0xc0ee('0xe')},'data3':{'type':Sequelize['STRING'],'comment':_0xc0ee('0xf')},'data4':{'type':Sequelize[_0xc0ee('0x1')],'comment':_0xc0ee('0x10')},'data5':{'type':Sequelize[_0xc0ee('0x1')],'comment':_0xc0ee('0x11')},'role':{'type':Sequelize[_0xc0ee('0x1')]},'internal':{'type':Sequelize[_0xc0ee('0x4')]},'uniqueid':{'type':Sequelize[_0xc0ee('0x1')]}};
\ No newline at end of file
+var _0xe130=['talk:[queue]','sequelize','moment','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','diff','seconds','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xe130,0x127));var _0x0e13=function(_0x4aa9f9,_0x25516c){_0x4aa9f9=_0x4aa9f9-0x0;var _0x22048b=_0xe130[_0x4aa9f9];return _0x22048b;};'use strict';var Sequelize=require(_0x0e13('0x0'));var moment=require(_0x0e13('0x1'));module['exports']={'channel':{'type':Sequelize[_0x0e13('0x2')]},'membername':{'type':Sequelize[_0x0e13('0x2')]},'interface':{'type':Sequelize[_0x0e13('0x2')]},'type':{'type':Sequelize[_0x0e13('0x2')],'defaultValue':_0x0e13('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x0e13('0x4')]},'enterAt':{'type':Sequelize[_0x0e13('0x5')]},'exitAt':{'type':Sequelize[_0x0e13('0x5')],'set':function(_0xcd92e){var _0x50a80e=moment(_0xcd92e);var _0x1774a5=moment(this['getDataValue']('enterAt'));var _0x5aaa22=_0x50a80e[_0x0e13('0x6')](_0x1774a5,_0x0e13('0x7'));this['setDataValue']('exitAt',_0xcd92e);this[_0x0e13('0x8')](_0x0e13('0x9'),_0x5aaa22||null);}},'data1':{'type':Sequelize[_0x0e13('0x2')],'comment':_0x0e13('0xa')},'data2':{'type':Sequelize['STRING'],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x0e13('0x2')],'comment':_0x0e13('0xb')},'data4':{'type':Sequelize[_0x0e13('0x2')],'comment':_0x0e13('0xc')},'data5':{'type':Sequelize['STRING'],'comment':_0x0e13('0xd')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x0e13('0x4')]},'uniqueid':{'type':Sequelize[_0x0e13('0x2')]}};
\ No newline at end of file
index a43f760..c1636a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xedd9,0xfc));var _0x9edd=function(_0xb36bbe,_0x132332){_0xb36bbe=_0xb36bbe-0x0;var _0x40d32b=_0xedd9[_0xb36bbe];return _0x40d32b;};'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
+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(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xedd9,0xfc));var _0x9edd=function(_0xc73f74,_0x41c03a){_0xc73f74=_0xc73f74-0x0;var _0x560e01=_0xedd9[_0xc73f74];return _0x560e01;};'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 5a8d7d9..56a8e5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e4e=['moment','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername','interface','lodash','util','../../config/logger','api'];(function(_0x547add,_0x387042){var _0x2ed1f3=function(_0x3bbb4d){while(--_0x3bbb4d){_0x547add['push'](_0x547add['shift']());}};_0x2ed1f3(++_0x387042);}(_0x1e4e,0x18c));var _0xe1e4=function(_0x2b4e47,_0x35fab7){_0x2b4e47=_0x2b4e47-0x0;var _0xa7e29a=_0x1e4e[_0x2b4e47];return _0xa7e29a;};'use strict';var _=require(_0xe1e4('0x0'));var util=require(_0xe1e4('0x1'));var logger=require(_0xe1e4('0x2'))(_0xe1e4('0x3'));var moment=require(_0xe1e4('0x4'));var BPromise=require('bluebird');var rp=require(_0xe1e4('0x5'));var fs=require('fs');var path=require(_0xe1e4('0x6'));var rimraf=require(_0xe1e4('0x7'));var config=require(_0xe1e4('0x8'));var attributes=require(_0xe1e4('0x9'));module[_0xe1e4('0xa')]=function(_0x3c444d,_0x22e3a8){return _0x3c444d[_0xe1e4('0xb')](_0xe1e4('0xc'),attributes,{'tableName':_0xe1e4('0xd'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0xe1e4('0xe'),_0xe1e4('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x070f=['request-promise','rimraf','../../config/environment','./memberReport.attributes','MemberReport','report_member','membername_interface','membername','interface','lodash','api','moment','bluebird'];(function(_0x49d0fd,_0x371f7b){var _0x20a93f=function(_0x319802){while(--_0x319802){_0x49d0fd['push'](_0x49d0fd['shift']());}};_0x20a93f(++_0x371f7b);}(_0x070f,0xf3));var _0xf070=function(_0x4a31f6,_0x4738b9){_0x4a31f6=_0x4a31f6-0x0;var _0x8919f=_0x070f[_0x4a31f6];return _0x8919f;};'use strict';var _=require(_0xf070('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf070('0x1'));var moment=require(_0xf070('0x2'));var BPromise=require(_0xf070('0x3'));var rp=require(_0xf070('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf070('0x5'));var config=require(_0xf070('0x6'));var attributes=require(_0xf070('0x7'));module['exports']=function(_0x370f5,_0x421ca4){return _0x370f5['define'](_0xf070('0x8'),attributes,{'tableName':_0xf070('0x9'),'paranoid':![],'indexes':[{'name':_0xf070('0xa'),'fields':[_0xf070('0xb'),_0xf070('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index c45aeb5..0fbba90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5031=['options','attributes','limit','include','map','model','CreateMemberReport','raw','update','body','where','UpdateMemberReport','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMemberReport','MemberReport','findAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5031,0x144));var _0x1503=function(_0x323190,_0x27cb59){_0x323190=_0x323190-0x0;var _0x357ad0=_0x5031[_0x323190];return _0x357ad0;};'use strict';var _=require(_0x1503('0x0'));var util=require(_0x1503('0x1'));var moment=require(_0x1503('0x2'));var BPromise=require(_0x1503('0x3'));var rs=require(_0x1503('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1503('0x5'));var logger=require(_0x1503('0x6'))(_0x1503('0x7'));var config=require(_0x1503('0x8'));var jayson=require(_0x1503('0x9'));var client=jayson[_0x1503('0xa')][_0x1503('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x114bec,_0x2db96e,_0x4c93e7){return new BPromise(function(_0x2007d0,_0x2dddb6){return client['request'](_0x114bec,_0x4c93e7)[_0x1503('0xc')](function(_0x466900){logger[_0x1503('0xd')](_0x1503('0xe'),_0x2db96e,_0x1503('0xf'));logger[_0x1503('0x10')](_0x1503('0x11'),_0x2db96e,_0x1503('0xf'),JSON[_0x1503('0x12')](_0x466900));if(_0x466900[_0x1503('0x13')]){if(_0x466900['error'][_0x1503('0x14')]===0x1f4){logger[_0x1503('0x13')](_0x1503('0xe'),_0x2db96e,_0x466900[_0x1503('0x13')][_0x1503('0x15')]);return _0x2dddb6(_0x466900['error'][_0x1503('0x15')]);}logger[_0x1503('0x13')](_0x1503('0xe'),_0x2db96e,_0x466900[_0x1503('0x13')][_0x1503('0x15')]);return _0x2007d0(_0x466900[_0x1503('0x13')][_0x1503('0x15')]);}else{logger[_0x1503('0xd')](_0x1503('0xe'),_0x2db96e,_0x1503('0xf'));_0x2007d0(_0x466900[_0x1503('0x16')][_0x1503('0x15')]);}})[_0x1503('0x17')](function(_0x33dae9){logger[_0x1503('0x13')](_0x1503('0xe'),_0x2db96e,_0x33dae9);_0x2dddb6(_0x33dae9);});});}exports[_0x1503('0x18')]=function(_0x3dc3c5){var _0x401b1b=this;return new Promise(function(_0x4c7390,_0x3f8c15){return db[_0x1503('0x19')][_0x1503('0x1a')]({'raw':_0x3dc3c5[_0x1503('0x1b')]?_0x3dc3c5[_0x1503('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3dc3c5['options']?_0x3dc3c5['options']['where']||null:null,'attributes':_0x3dc3c5[_0x1503('0x1b')]?_0x3dc3c5[_0x1503('0x1b')][_0x1503('0x1c')]||null:null,'limit':_0x3dc3c5[_0x1503('0x1b')]?_0x3dc3c5['options'][_0x1503('0x1d')]||null:null,'include':_0x3dc3c5[_0x1503('0x1b')]?_0x3dc3c5[_0x1503('0x1b')][_0x1503('0x1e')]?_[_0x1503('0x1f')](_0x3dc3c5[_0x1503('0x1b')][_0x1503('0x1e')],function(_0xde9620){return{'model':db[_0xde9620[_0x1503('0x20')]],'as':_0xde9620['as'],'attributes':_0xde9620['attributes'],'include':_0xde9620[_0x1503('0x1e')]?_['map'](_0xde9620[_0x1503('0x1e')],function(_0x2e8ee1){return{'model':db[_0x2e8ee1[_0x1503('0x20')]],'as':_0x2e8ee1['as'],'attributes':_0x2e8ee1[_0x1503('0x1c')],'include':_0x2e8ee1['include']?_[_0x1503('0x1f')](_0x2e8ee1[_0x1503('0x1e')],function(_0x1116b0){return{'model':db[_0x1116b0[_0x1503('0x20')]],'as':_0x1116b0['as'],'attributes':_0x1116b0[_0x1503('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1503('0xc')](function(_0x4cab3a){logger[_0x1503('0xd')](_0x1503('0x18'),_0x3dc3c5);logger[_0x1503('0x10')](_0x1503('0x18'),_0x3dc3c5,JSON[_0x1503('0x12')](_0x4cab3a));_0x4c7390(_0x4cab3a);})[_0x1503('0x17')](function(_0x3e7b2b){logger[_0x1503('0x13')](_0x1503('0x18'),_0x3e7b2b[_0x1503('0x15')],_0x3dc3c5);_0x3f8c15(_0x401b1b['error'](0x1f4,_0x3e7b2b[_0x1503('0x15')]));});});};exports[_0x1503('0x21')]=function(_0x131c4f){var _0x53acd7=this;return new Promise(function(_0x58b2fc,_0x52ecd2){return db[_0x1503('0x19')]['create'](_0x131c4f['body'],{'raw':_0x131c4f[_0x1503('0x1b')]?_0x131c4f[_0x1503('0x1b')][_0x1503('0x22')]===undefined?!![]:![]:!![]})[_0x1503('0xc')](function(_0x5d170e){logger[_0x1503('0xd')]('CreateMemberReport',_0x131c4f);logger[_0x1503('0x10')](_0x1503('0x21'),_0x131c4f,JSON[_0x1503('0x12')](_0x5d170e));_0x58b2fc(_0x5d170e);})[_0x1503('0x17')](function(_0x4d87a7){logger[_0x1503('0x13')](_0x1503('0x21'),_0x4d87a7['message'],_0x131c4f);_0x52ecd2(_0x53acd7[_0x1503('0x13')](0x1f4,_0x4d87a7[_0x1503('0x15')]));});});};exports['UpdateMemberReport']=function(_0x201b5b){var _0x2d9beb=this;return new Promise(function(_0x2989b3,_0x204ec4){return db['MemberReport'][_0x1503('0x23')](_0x201b5b[_0x1503('0x24')],{'raw':_0x201b5b[_0x1503('0x1b')]?_0x201b5b[_0x1503('0x1b')][_0x1503('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x201b5b['options']?_0x201b5b[_0x1503('0x1b')][_0x1503('0x25')]||null:null,'attributes':_0x201b5b['options']?_0x201b5b[_0x1503('0x1b')][_0x1503('0x1c')]||null:null,'limit':_0x201b5b[_0x1503('0x1b')]?_0x201b5b[_0x1503('0x1b')]['limit']||null:null})['then'](function(_0x1e4fc6){logger[_0x1503('0xd')](_0x1503('0x26'),_0x201b5b);logger[_0x1503('0x10')](_0x1503('0x26'),_0x201b5b,JSON[_0x1503('0x12')](_0x1e4fc6));_0x2989b3(_0x1e4fc6);})[_0x1503('0x17')](function(_0xbf77a5){logger[_0x1503('0x13')](_0x1503('0x26'),_0xbf77a5[_0x1503('0x15')],_0x201b5b);_0x204ec4(_0x2d9beb[_0x1503('0x13')](0x1f4,_0xbf77a5[_0x1503('0x15')]));});});};
\ No newline at end of file
+var _0x11e5=['request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','message','result','findAll','options','raw','where','attributes','limit','include','map','model','GetMemberReport','stringify','catch','CreateMemberReport','MemberReport','create','body','update','UpdateMemberReport','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','http'];(function(_0x1207d1,_0xfb8333){var _0x5b2e10=function(_0x4ebb85){while(--_0x4ebb85){_0x1207d1['push'](_0x1207d1['shift']());}};_0x5b2e10(++_0xfb8333);}(_0x11e5,0x8b));var _0x511e=function(_0x2c5df9,_0x2811cb){_0x2c5df9=_0x2c5df9-0x0;var _0x39d1d0=_0x11e5[_0x2c5df9];return _0x39d1d0;};'use strict';var _=require(_0x511e('0x0'));var util=require('util');var moment=require(_0x511e('0x1'));var BPromise=require(_0x511e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x511e('0x3'));var db=require(_0x511e('0x4'))['db'];var utils=require(_0x511e('0x5'));var logger=require('../../config/logger')(_0x511e('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x511e('0x7')][_0x511e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x466dec,_0x57cac3,_0x47cf56){return new BPromise(function(_0x3ebc4b,_0xf0ba86){return client[_0x511e('0x9')](_0x466dec,_0x47cf56)[_0x511e('0xa')](function(_0x4449c4){logger[_0x511e('0xb')](_0x511e('0xc'),_0x57cac3,_0x511e('0xd'));logger[_0x511e('0xe')](_0x511e('0xf'),_0x57cac3,_0x511e('0xd'),JSON['stringify'](_0x4449c4));if(_0x4449c4[_0x511e('0x10')]){if(_0x4449c4['error']['code']===0x1f4){logger[_0x511e('0x10')](_0x511e('0xc'),_0x57cac3,_0x4449c4[_0x511e('0x10')][_0x511e('0x11')]);return _0xf0ba86(_0x4449c4[_0x511e('0x10')][_0x511e('0x11')]);}logger['error'](_0x511e('0xc'),_0x57cac3,_0x4449c4[_0x511e('0x10')]['message']);return _0x3ebc4b(_0x4449c4[_0x511e('0x10')][_0x511e('0x11')]);}else{logger['info'](_0x511e('0xc'),_0x57cac3,_0x511e('0xd'));_0x3ebc4b(_0x4449c4[_0x511e('0x12')][_0x511e('0x11')]);}})['catch'](function(_0x3e0415){logger[_0x511e('0x10')](_0x511e('0xc'),_0x57cac3,_0x3e0415);_0xf0ba86(_0x3e0415);});});}exports['GetMemberReport']=function(_0x26af67){var _0x5bd814=this;return new Promise(function(_0x34e6cd,_0x492c9f){return db['MemberReport'][_0x511e('0x13')]({'raw':_0x26af67['options']?_0x26af67[_0x511e('0x14')][_0x511e('0x15')]===undefined?!![]:![]:!![],'where':_0x26af67[_0x511e('0x14')]?_0x26af67[_0x511e('0x14')][_0x511e('0x16')]||null:null,'attributes':_0x26af67[_0x511e('0x14')]?_0x26af67[_0x511e('0x14')][_0x511e('0x17')]||null:null,'limit':_0x26af67['options']?_0x26af67[_0x511e('0x14')][_0x511e('0x18')]||null:null,'include':_0x26af67[_0x511e('0x14')]?_0x26af67[_0x511e('0x14')][_0x511e('0x19')]?_[_0x511e('0x1a')](_0x26af67[_0x511e('0x14')][_0x511e('0x19')],function(_0x211b90){return{'model':db[_0x211b90[_0x511e('0x1b')]],'as':_0x211b90['as'],'attributes':_0x211b90['attributes'],'include':_0x211b90['include']?_[_0x511e('0x1a')](_0x211b90['include'],function(_0x1ff5c4){return{'model':db[_0x1ff5c4['model']],'as':_0x1ff5c4['as'],'attributes':_0x1ff5c4[_0x511e('0x17')],'include':_0x1ff5c4[_0x511e('0x19')]?_[_0x511e('0x1a')](_0x1ff5c4[_0x511e('0x19')],function(_0x1bb7f9){return{'model':db[_0x1bb7f9[_0x511e('0x1b')]],'as':_0x1bb7f9['as'],'attributes':_0x1bb7f9[_0x511e('0x17')]};}):[]};}):[]};}):[]:[]})[_0x511e('0xa')](function(_0x309695){logger[_0x511e('0xb')]('GetMemberReport',_0x26af67);logger[_0x511e('0xe')](_0x511e('0x1c'),_0x26af67,JSON[_0x511e('0x1d')](_0x309695));_0x34e6cd(_0x309695);})[_0x511e('0x1e')](function(_0x369be6){logger['error'](_0x511e('0x1c'),_0x369be6['message'],_0x26af67);_0x492c9f(_0x5bd814['error'](0x1f4,_0x369be6[_0x511e('0x11')]));});});};exports[_0x511e('0x1f')]=function(_0xa3b110){var _0x2fb396=this;return new Promise(function(_0x432b5d,_0x4812d9){return db[_0x511e('0x20')][_0x511e('0x21')](_0xa3b110[_0x511e('0x22')],{'raw':_0xa3b110[_0x511e('0x14')]?_0xa3b110[_0x511e('0x14')]['raw']===undefined?!![]:![]:!![]})[_0x511e('0xa')](function(_0x32a749){logger[_0x511e('0xb')](_0x511e('0x1f'),_0xa3b110);logger[_0x511e('0xe')](_0x511e('0x1f'),_0xa3b110,JSON[_0x511e('0x1d')](_0x32a749));_0x432b5d(_0x32a749);})[_0x511e('0x1e')](function(_0x5a881a){logger[_0x511e('0x10')](_0x511e('0x1f'),_0x5a881a[_0x511e('0x11')],_0xa3b110);_0x4812d9(_0x2fb396[_0x511e('0x10')](0x1f4,_0x5a881a['message']));});});};exports['UpdateMemberReport']=function(_0x3f6dfc){var _0x57026d=this;return new Promise(function(_0x529d08,_0x256fd3){return db[_0x511e('0x20')][_0x511e('0x23')](_0x3f6dfc[_0x511e('0x22')],{'raw':_0x3f6dfc[_0x511e('0x14')]?_0x3f6dfc['options'][_0x511e('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f6dfc[_0x511e('0x14')]?_0x3f6dfc[_0x511e('0x14')]['where']||null:null,'attributes':_0x3f6dfc[_0x511e('0x14')]?_0x3f6dfc[_0x511e('0x14')][_0x511e('0x17')]||null:null,'limit':_0x3f6dfc['options']?_0x3f6dfc[_0x511e('0x14')][_0x511e('0x18')]||null:null})['then'](function(_0x357a66){logger[_0x511e('0xb')](_0x511e('0x24'),_0x3f6dfc);logger[_0x511e('0xe')](_0x511e('0x24'),_0x3f6dfc,JSON[_0x511e('0x1d')](_0x357a66));_0x529d08(_0x357a66);})[_0x511e('0x1e')](function(_0x8cc26e){logger[_0x511e('0x10')](_0x511e('0x24'),_0x8cc26e[_0x511e('0x11')],_0x3f6dfc);_0x256fd3(_0x57026d['error'](0x1f4,_0x8cc26e[_0x511e('0x11')]));});});};
\ No newline at end of file
index 21fd154..4dfe814 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82e3=['../../components/interaction/service','./migration.controller','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x5984d5,_0x32f65f){var _0x45e517=function(_0x403c3d){while(--_0x403c3d){_0x5984d5['push'](_0x5984d5['shift']());}};_0x45e517(++_0x32f65f);}(_0x82e3,0x1aa));var _0x382e=function(_0x5d05fc,_0x2dc690){_0x5d05fc=_0x5d05fc-0x0;var _0x363c83=_0x82e3[_0x5d05fc];return _0x363c83;};'use strict';var multer=require(_0x382e('0x0'));var util=require(_0x382e('0x1'));var path=require('path');var timeout=require(_0x382e('0x2'));var express=require(_0x382e('0x3'));var router=express[_0x382e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x382e('0x5'));var interaction=require(_0x382e('0x6'));var config=require('../../config/environment');var controller=require(_0x382e('0x7'));router['get']('/',controller['index']);module[_0x382e('0x8')]=router;
\ No newline at end of file
+var _0xbf3e=['../../config/environment','./migration.controller','get','exports','util','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x20ed21,_0x3c4796){var _0x1a5f0e=function(_0x2e1647){while(--_0x2e1647){_0x20ed21['push'](_0x20ed21['shift']());}};_0x1a5f0e(++_0x3c4796);}(_0xbf3e,0xee));var _0xebf3=function(_0x558aa4,_0x27684d){_0x558aa4=_0x558aa4-0x0;var _0x59c117=_0xbf3e[_0x558aa4];return _0x59c117;};'use strict';var multer=require('multer');var util=require(_0xebf3('0x0'));var path=require('path');var timeout=require(_0xebf3('0x1'));var express=require(_0xebf3('0x2'));var router=express[_0xebf3('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xebf3('0x4'));var config=require(_0xebf3('0x5'));var controller=require(_0xebf3('0x6'));router[_0xebf3('0x7')]('/',controller['index']);module[_0xebf3('0x8')]=router;
\ No newline at end of file
index ef86509..d028e40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2c=['exports','STRING','version','sequelize'];(function(_0x91e035,_0xc4e4bc){var _0x1b763a=function(_0x5a4394){while(--_0x5a4394){_0x91e035['push'](_0x91e035['shift']());}};_0x1b763a(++_0xc4e4bc);}(_0x5f2c,0x6f));var _0xc5f2=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x5f2c[_0x3ab9ee];return _0x82ee88;};'use strict';var Sequelize=require(_0xc5f2('0x0'));module[_0xc5f2('0x1')]={'version':{'type':Sequelize[_0xc5f2('0x2')],'unique':_0xc5f2('0x3')}};
\ No newline at end of file
+var _0xb1a8=['version','sequelize','STRING'];(function(_0x252c3b,_0x7ae0e3){var _0x1e52e6=function(_0x4abb92){while(--_0x4abb92){_0x252c3b['push'](_0x252c3b['shift']());}};_0x1e52e6(++_0x7ae0e3);}(_0xb1a8,0x1a2));var _0x8b1a=function(_0x3ee617,_0x3f16a9){_0x3ee617=_0x3ee617-0x0;var _0x3a4098=_0xb1a8[_0x3ee617];return _0x3a4098;};'use strict';var Sequelize=require(_0x8b1a('0x0'));module['exports']={'version':{'type':Sequelize[_0x8b1a('0x1')],'unique':_0x8b1a('0x2')}};
\ No newline at end of file
index ad45a29..be582ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b1c=['rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','offset','limit','reject','save','update','then','destroy','sendStatus','error','name','index','map','Migration'];(function(_0x1fbd48,_0x45bb24){var _0x26695a=function(_0x1e9f19){while(--_0x1e9f19){_0x1fbd48['push'](_0x1fbd48['shift']());}};_0x26695a(++_0x45bb24);}(_0x0b1c,0xe0));var _0xc0b1=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0x0b1c[_0xf71120];return _0xbe2fd3;};'use strict';var emlformat=require(_0xc0b1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc0b1('0x1'));var jsonpatch=require(_0xc0b1('0x2'));var rp=require(_0xc0b1('0x3'));var moment=require(_0xc0b1('0x4'));var BPromise=require(_0xc0b1('0x5'));var Mustache=require(_0xc0b1('0x6'));var util=require(_0xc0b1('0x7'));var path=require(_0xc0b1('0x8'));var sox=require(_0xc0b1('0x9'));var csv=require(_0xc0b1('0xa'));var ejs=require(_0xc0b1('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc0b1('0xc'));var squel=require(_0xc0b1('0xd'));var crypto=require(_0xc0b1('0xe'));var jsforce=require(_0xc0b1('0xf'));var deskjs=require(_0xc0b1('0x10'));var toCsv=require('to-csv');var querystring=require(_0xc0b1('0x11'));var Papa=require('papaparse');var Redis=require(_0xc0b1('0x12'));var authService=require(_0xc0b1('0x13'));var qs=require(_0xc0b1('0x14'));var as=require(_0xc0b1('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc0b1('0x16'))(_0xc0b1('0x17'));var utils=require(_0xc0b1('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc0b1('0x19'));var db=require(_0xc0b1('0x1a'))['db'];function respondWithStatusCode(_0x3d83bc,_0x22e891){_0x22e891=_0x22e891||0xcc;return function(_0x3b9296){if(_0x3b9296){return _0x3d83bc['sendStatus'](_0x22e891);}return _0x3d83bc[_0xc0b1('0x1b')](_0x22e891)[_0xc0b1('0x1c')]();};}function respondWithResult(_0x40fcbc,_0x25869a){_0x25869a=_0x25869a||0xc8;return function(_0xf3730){if(_0xf3730){return _0x40fcbc[_0xc0b1('0x1b')](_0x25869a)[_0xc0b1('0x1d')](_0xf3730);}};}function respondWithFilteredResult(_0x534efb,_0x18c709){return function(_0x21c124){if(_0x21c124){var _0x5e8477=typeof _0x18c709['offset']==='undefined'&&typeof _0x18c709['limit']===_0xc0b1('0x1e');var _0x30e662=_0x21c124['count'];var _0x46f78f=_0x5e8477?0x0:_0x18c709[_0xc0b1('0x1f')];var _0x2e1d7e=_0x5e8477?_0x21c124['count']:_0x18c709[_0xc0b1('0x1f')]+_0x18c709[_0xc0b1('0x20')];var _0x3283bb;if(_0x2e1d7e>=_0x30e662){_0x2e1d7e=_0x30e662;_0x3283bb=0xc8;}else{_0x3283bb=0xce;}_0x534efb['status'](_0x3283bb);return _0x534efb['set']('Content-Range',_0x46f78f+'-'+_0x2e1d7e+'/'+_0x30e662)[_0xc0b1('0x1d')](_0x21c124);}return null;};}function patchUpdates(_0x162046){return function(_0x41e88f){try{jsonpatch['apply'](_0x41e88f,_0x162046,!![]);}catch(_0x350c3d){return BPromise[_0xc0b1('0x21')](_0x350c3d);}return _0x41e88f[_0xc0b1('0x22')]();};}function saveUpdates(_0x532f96,_0x1479d7){return function(_0x39d1d8){if(_0x39d1d8){return _0x39d1d8[_0xc0b1('0x23')](_0x532f96)[_0xc0b1('0x24')](function(_0x220bd2){return _0x220bd2;});}return null;};}function removeEntity(_0x52936e,_0x484592){return function(_0x305e36){if(_0x305e36){return _0x305e36[_0xc0b1('0x25')]()[_0xc0b1('0x24')](function(){_0x52936e['status'](0xcc)[_0xc0b1('0x1c')]();});}};}function handleEntityNotFound(_0x30b8a4,_0x50f81c){return function(_0x2420b3){if(!_0x2420b3){_0x30b8a4[_0xc0b1('0x26')](0x194);}return _0x2420b3;};}function handleError(_0x1b2da6,_0x5829d9){_0x5829d9=_0x5829d9||0x1f4;return function(_0x1786bc){logger[_0xc0b1('0x27')](_0x1786bc['stack']);if(_0x1786bc[_0xc0b1('0x28')]){delete _0x1786bc['name'];}_0x1b2da6[_0xc0b1('0x1b')](_0x5829d9)['send'](_0x1786bc);};}exports[_0xc0b1('0x29')]=function(_0x39198d,_0x47feaf){var _0x44c815={},_0x27a8c7={},_0x2f03d1={'count':0x0,'rows':[]};var _0x3b0ced=_[_0xc0b1('0x2a')](db[_0xc0b1('0x2b')][_0xc0b1('0x2c')],function(_0x3f1ca1){return{'name':_0x3f1ca1['fieldName'],'type':_0x3f1ca1[_0xc0b1('0x2d')][_0xc0b1('0x2e')]};});_0x27a8c7['model']=_[_0xc0b1('0x2a')](_0x3b0ced,_0xc0b1('0x28'));_0x27a8c7[_0xc0b1('0x2f')]=_[_0xc0b1('0x30')](_0x39198d[_0xc0b1('0x2f')]);_0x27a8c7[_0xc0b1('0x31')]=_[_0xc0b1('0x32')](_0x27a8c7[_0xc0b1('0x33')],_0x27a8c7[_0xc0b1('0x2f')]);_0x44c815[_0xc0b1('0x34')]=_['intersection'](_0x27a8c7['model'],qs[_0xc0b1('0x35')](_0x39198d[_0xc0b1('0x2f')][_0xc0b1('0x35')]));_0x44c815[_0xc0b1('0x34')]=_0x44c815['attributes'][_0xc0b1('0x36')]?_0x44c815[_0xc0b1('0x34')]:_0x27a8c7[_0xc0b1('0x33')];if(!_0x39198d[_0xc0b1('0x2f')][_0xc0b1('0x37')]('nolimit')){_0x44c815[_0xc0b1('0x20')]=qs[_0xc0b1('0x20')](_0x39198d[_0xc0b1('0x2f')][_0xc0b1('0x20')]);_0x44c815['offset']=qs[_0xc0b1('0x1f')](_0x39198d[_0xc0b1('0x2f')][_0xc0b1('0x1f')]);}_0x44c815[_0xc0b1('0x38')]=qs['sort'](_0x39198d['query'][_0xc0b1('0x39')]);_0x44c815[_0xc0b1('0x3a')]=qs[_0xc0b1('0x31')](_[_0xc0b1('0x3b')](_0x39198d[_0xc0b1('0x2f')],_0x27a8c7[_0xc0b1('0x31')]),_0x3b0ced);if(_0x39198d[_0xc0b1('0x2f')][_0xc0b1('0x3c')]){_0x44c815[_0xc0b1('0x3a')]=_[_0xc0b1('0x3d')](_0x44c815[_0xc0b1('0x3a')],{'$or':_['map'](_0x3b0ced,function(_0x3d4396){if(_0x3d4396[_0xc0b1('0x2d')]!==_0xc0b1('0x3e')){var _0x1684a1={};_0x1684a1[_0x3d4396['name']]={'$like':'%'+_0x39198d[_0xc0b1('0x2f')][_0xc0b1('0x3c')]+'%'};return _0x1684a1;}})});}_0x44c815=_['merge']({},_0x44c815,_0x39198d['options']);var _0x146ac7={'where':_0x44c815['where']};return db[_0xc0b1('0x2b')]['count'](_0x146ac7)[_0xc0b1('0x24')](function(_0x560f86){_0x2f03d1['count']=_0x560f86;if(_0x39198d[_0xc0b1('0x2f')][_0xc0b1('0x3f')]){_0x44c815['include']=[{'all':!![]}];}return db[_0xc0b1('0x2b')][_0xc0b1('0x40')](_0x44c815);})[_0xc0b1('0x24')](function(_0x288030){_0x2f03d1[_0xc0b1('0x41')]=_0x288030;return _0x2f03d1;})[_0xc0b1('0x24')](respondWithFilteredResult(_0x47feaf,_0x44c815))[_0xc0b1('0x42')](handleError(_0x47feaf,null));};
\ No newline at end of file
+var _0xa5b9=['sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Migration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x25678f,_0x5958d5){var _0x1961b5=function(_0x3d0258){while(--_0x3d0258){_0x25678f['push'](_0x25678f['shift']());}};_0x1961b5(++_0x5958d5);}(_0xa5b9,0x1d3));var _0x9a5b=function(_0x9dd51c,_0x3f13c6){_0x9dd51c=_0x9dd51c-0x0;var _0x14f0ff=_0xa5b9[_0x9dd51c];return _0x14f0ff;};'use strict';var emlformat=require(_0x9a5b('0x0'));var rimraf=require(_0x9a5b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9a5b('0x2'));var rp=require('request-promise');var moment=require(_0x9a5b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9a5b('0x4'));var util=require(_0x9a5b('0x5'));var path=require(_0x9a5b('0x6'));var sox=require(_0x9a5b('0x7'));var csv=require(_0x9a5b('0x8'));var ejs=require(_0x9a5b('0x9'));var fs=require('fs');var fs_extra=require(_0x9a5b('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9a5b('0xb'));var jsforce=require(_0x9a5b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9a5b('0x8'));var querystring=require('querystring');var Papa=require(_0x9a5b('0xd'));var Redis=require(_0x9a5b('0xe'));var authService=require(_0x9a5b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x9a5b('0x10'));var hardwareService=require(_0x9a5b('0x11'));var logger=require(_0x9a5b('0x12'))(_0x9a5b('0x13'));var utils=require('../../config/utils');var config=require(_0x9a5b('0x14'));var licenseUtil=require(_0x9a5b('0x15'));var db=require(_0x9a5b('0x16'))['db'];function respondWithStatusCode(_0x355f9e,_0x4655d4){_0x4655d4=_0x4655d4||0xcc;return function(_0x49d0f3){if(_0x49d0f3){return _0x355f9e[_0x9a5b('0x17')](_0x4655d4);}return _0x355f9e[_0x9a5b('0x18')](_0x4655d4)[_0x9a5b('0x19')]();};}function respondWithResult(_0x520404,_0x5cdd47){_0x5cdd47=_0x5cdd47||0xc8;return function(_0x5e666c){if(_0x5e666c){return _0x520404['status'](_0x5cdd47)[_0x9a5b('0x1a')](_0x5e666c);}};}function respondWithFilteredResult(_0x24f6c8,_0x34231b){return function(_0x4882a1){if(_0x4882a1){var _0x2c0970=typeof _0x34231b[_0x9a5b('0x1b')]==='undefined'&&typeof _0x34231b[_0x9a5b('0x1c')]===_0x9a5b('0x1d');var _0x3c18b6=_0x4882a1[_0x9a5b('0x1e')];var _0x342568=_0x2c0970?0x0:_0x34231b[_0x9a5b('0x1b')];var _0xdd487c=_0x2c0970?_0x4882a1['count']:_0x34231b['offset']+_0x34231b[_0x9a5b('0x1c')];var _0x10abdc;if(_0xdd487c>=_0x3c18b6){_0xdd487c=_0x3c18b6;_0x10abdc=0xc8;}else{_0x10abdc=0xce;}_0x24f6c8[_0x9a5b('0x18')](_0x10abdc);return _0x24f6c8['set'](_0x9a5b('0x1f'),_0x342568+'-'+_0xdd487c+'/'+_0x3c18b6)[_0x9a5b('0x1a')](_0x4882a1);}return null;};}function patchUpdates(_0x550418){return function(_0x190586){try{jsonpatch[_0x9a5b('0x20')](_0x190586,_0x550418,!![]);}catch(_0x172dbd){return BPromise[_0x9a5b('0x21')](_0x172dbd);}return _0x190586[_0x9a5b('0x22')]();};}function saveUpdates(_0x3f26f8,_0x42a550){return function(_0x4c3afd){if(_0x4c3afd){return _0x4c3afd[_0x9a5b('0x23')](_0x3f26f8)[_0x9a5b('0x24')](function(_0xdbe5a9){return _0xdbe5a9;});}return null;};}function removeEntity(_0x356e44,_0x4ab82a){return function(_0x16de56){if(_0x16de56){return _0x16de56[_0x9a5b('0x25')]()[_0x9a5b('0x24')](function(){_0x356e44[_0x9a5b('0x18')](0xcc)[_0x9a5b('0x19')]();});}};}function handleEntityNotFound(_0x39663e,_0x1f0a0a){return function(_0x51b7c4){if(!_0x51b7c4){_0x39663e[_0x9a5b('0x17')](0x194);}return _0x51b7c4;};}function handleError(_0x10580,_0x132604){_0x132604=_0x132604||0x1f4;return function(_0x1f87ab){logger[_0x9a5b('0x26')](_0x1f87ab[_0x9a5b('0x27')]);if(_0x1f87ab[_0x9a5b('0x28')]){delete _0x1f87ab[_0x9a5b('0x28')];}_0x10580['status'](_0x132604)[_0x9a5b('0x29')](_0x1f87ab);};}exports[_0x9a5b('0x2a')]=function(_0x3794fa,_0xde07b3){var _0x463be1={},_0x283a13={},_0x3be9c6={'count':0x0,'rows':[]};var _0x5bff5f=_[_0x9a5b('0x2b')](db[_0x9a5b('0x2c')][_0x9a5b('0x2d')],function(_0x1adae1){return{'name':_0x1adae1[_0x9a5b('0x2e')],'type':_0x1adae1[_0x9a5b('0x2f')][_0x9a5b('0x30')]};});_0x283a13['model']=_[_0x9a5b('0x2b')](_0x5bff5f,_0x9a5b('0x28'));_0x283a13[_0x9a5b('0x31')]=_[_0x9a5b('0x32')](_0x3794fa[_0x9a5b('0x31')]);_0x283a13[_0x9a5b('0x33')]=_[_0x9a5b('0x34')](_0x283a13[_0x9a5b('0x35')],_0x283a13['query']);_0x463be1[_0x9a5b('0x36')]=_[_0x9a5b('0x34')](_0x283a13[_0x9a5b('0x35')],qs[_0x9a5b('0x37')](_0x3794fa[_0x9a5b('0x31')][_0x9a5b('0x37')]));_0x463be1[_0x9a5b('0x36')]=_0x463be1[_0x9a5b('0x36')][_0x9a5b('0x38')]?_0x463be1[_0x9a5b('0x36')]:_0x283a13[_0x9a5b('0x35')];if(!_0x3794fa['query'][_0x9a5b('0x39')](_0x9a5b('0x3a'))){_0x463be1[_0x9a5b('0x1c')]=qs[_0x9a5b('0x1c')](_0x3794fa['query'][_0x9a5b('0x1c')]);_0x463be1[_0x9a5b('0x1b')]=qs[_0x9a5b('0x1b')](_0x3794fa[_0x9a5b('0x31')][_0x9a5b('0x1b')]);}_0x463be1[_0x9a5b('0x3b')]=qs[_0x9a5b('0x3c')](_0x3794fa['query'][_0x9a5b('0x3c')]);_0x463be1[_0x9a5b('0x3d')]=qs[_0x9a5b('0x33')](_['pick'](_0x3794fa['query'],_0x283a13['filters']),_0x5bff5f);if(_0x3794fa[_0x9a5b('0x31')][_0x9a5b('0x3e')]){_0x463be1[_0x9a5b('0x3d')]=_[_0x9a5b('0x3f')](_0x463be1['where'],{'$or':_[_0x9a5b('0x2b')](_0x5bff5f,function(_0x500a4f){if(_0x500a4f[_0x9a5b('0x2f')]!=='VIRTUAL'){var _0x1de106={};_0x1de106[_0x500a4f['name']]={'$like':'%'+_0x3794fa[_0x9a5b('0x31')][_0x9a5b('0x3e')]+'%'};return _0x1de106;}})});}_0x463be1=_[_0x9a5b('0x3f')]({},_0x463be1,_0x3794fa[_0x9a5b('0x40')]);var _0x4e7906={'where':_0x463be1[_0x9a5b('0x3d')]};return db[_0x9a5b('0x2c')]['count'](_0x4e7906)[_0x9a5b('0x24')](function(_0x4c3f15){_0x3be9c6['count']=_0x4c3f15;if(_0x3794fa['query'][_0x9a5b('0x41')]){_0x463be1[_0x9a5b('0x42')]=[{'all':!![]}];}return db[_0x9a5b('0x2c')][_0x9a5b('0x43')](_0x463be1);})[_0x9a5b('0x24')](function(_0x710167){_0x3be9c6[_0x9a5b('0x44')]=_0x710167;return _0x3be9c6;})[_0x9a5b('0x24')](respondWithFilteredResult(_0xde07b3,_0x463be1))[_0x9a5b('0x45')](handleError(_0xde07b3,null));};
\ No newline at end of file
index 45ae516..b0dfdaf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd82a=['../../config/logger','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations','lodash','util'];(function(_0x43b058,_0xcab0cc){var _0x45a9e0=function(_0x533692){while(--_0x533692){_0x43b058['push'](_0x43b058['shift']());}};_0x45a9e0(++_0xcab0cc);}(_0xd82a,0x76));var _0xad82=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xd82a[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0xad82('0x0'));var util=require(_0xad82('0x1'));var logger=require(_0xad82('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xad82('0x3'));var fs=require('fs');var path=require(_0xad82('0x4'));var rimraf=require(_0xad82('0x5'));var config=require(_0xad82('0x6'));var attributes=require(_0xad82('0x7'));module[_0xad82('0x8')]=function(_0x5d5558,_0xede954){return _0x5d5558[_0xad82('0x9')](_0xad82('0xa'),attributes,{'tableName':_0xad82('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa8f9=['rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations','util','../../config/logger','bluebird','request-promise','path'];(function(_0x144ba9,_0x1f1d84){var _0x186e01=function(_0x748c0f){while(--_0x748c0f){_0x144ba9['push'](_0x144ba9['shift']());}};_0x186e01(++_0x1f1d84);}(_0xa8f9,0x17b));var _0x9a8f=function(_0x1be8c5,_0x4cf1cf){_0x1be8c5=_0x1be8c5-0x0;var _0x4e4de2=_0xa8f9[_0x1be8c5];return _0x4e4de2;};'use strict';var _=require('lodash');var util=require(_0x9a8f('0x0'));var logger=require(_0x9a8f('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9a8f('0x2'));var rp=require(_0x9a8f('0x3'));var fs=require('fs');var path=require(_0x9a8f('0x4'));var rimraf=require(_0x9a8f('0x5'));var config=require(_0x9a8f('0x6'));var attributes=require(_0x9a8f('0x7'));module[_0x9a8f('0x8')]=function(_0x2a16ca,_0xb056cb){return _0x2a16ca[_0x9a8f('0x9')](_0x9a8f('0xa'),attributes,{'tableName':_0x9a8f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 021ddc5..51c8833 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54f3=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http','then','info','Migration,\x20%s,\x20%s','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','util'];(function(_0x570fa1,_0x56bc22){var _0x28e39d=function(_0x2670c0){while(--_0x2670c0){_0x570fa1['push'](_0x570fa1['shift']());}};_0x28e39d(++_0x56bc22);}(_0x54f3,0x120));var _0x354f=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x54f3[_0x46e363];return _0x3fb059;};'use strict';var _=require('lodash');var util=require(_0x354f('0x0'));var moment=require(_0x354f('0x1'));var BPromise=require(_0x354f('0x2'));var rs=require(_0x354f('0x3'));var fs=require('fs');var Redis=require(_0x354f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x354f('0x5'))(_0x354f('0x6'));var config=require(_0x354f('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x354f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51cd16,_0x1da503,_0x4311ad){return new BPromise(function(_0x2f111a,_0x173e1d){return client['request'](_0x51cd16,_0x4311ad)[_0x354f('0x9')](function(_0x5d1e5d){logger[_0x354f('0xa')](_0x354f('0xb'),_0x1da503,'request\x20sent');logger['debug'](_0x354f('0xc'),_0x1da503,_0x354f('0xd'),JSON['stringify'](_0x5d1e5d));if(_0x5d1e5d[_0x354f('0xe')]){if(_0x5d1e5d[_0x354f('0xe')]['code']===0x1f4){logger[_0x354f('0xe')](_0x354f('0xb'),_0x1da503,_0x5d1e5d[_0x354f('0xe')][_0x354f('0xf')]);return _0x173e1d(_0x5d1e5d[_0x354f('0xe')][_0x354f('0xf')]);}logger[_0x354f('0xe')]('Migration,\x20%s,\x20%s',_0x1da503,_0x5d1e5d[_0x354f('0xe')][_0x354f('0xf')]);return _0x2f111a(_0x5d1e5d[_0x354f('0xe')]['message']);}else{logger[_0x354f('0xa')](_0x354f('0xb'),_0x1da503,_0x354f('0xd'));_0x2f111a(_0x5d1e5d['result']['message']);}})[_0x354f('0x10')](function(_0x1d7627){logger[_0x354f('0xe')](_0x354f('0xb'),_0x1da503,_0x1d7627);_0x173e1d(_0x1d7627);});});}
\ No newline at end of file
+var _0xc7ea=['result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0xc7ea,0x171));var _0xac7e=function(_0x47559f,_0x374a08){_0x47559f=_0x47559f-0x0;var _0xe1196e=_0xc7ea[_0x47559f];return _0xe1196e;};'use strict';var _=require(_0xac7e('0x0'));var util=require(_0xac7e('0x1'));var moment=require('moment');var BPromise=require(_0xac7e('0x2'));var rs=require(_0xac7e('0x3'));var fs=require('fs');var Redis=require(_0xac7e('0x4'));var db=require(_0xac7e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xac7e('0x6'))(_0xac7e('0x7'));var config=require(_0xac7e('0x8'));var jayson=require(_0xac7e('0x9'));var client=jayson[_0xac7e('0xa')][_0xac7e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x447bfe,_0x1aca29,_0x1612f3){return new BPromise(function(_0x1cb874,_0x4d83fb){return client[_0xac7e('0xc')](_0x447bfe,_0x1612f3)[_0xac7e('0xd')](function(_0x2efbf4){logger[_0xac7e('0xe')](_0xac7e('0xf'),_0x1aca29,_0xac7e('0x10'));logger[_0xac7e('0x11')](_0xac7e('0x12'),_0x1aca29,_0xac7e('0x10'),JSON[_0xac7e('0x13')](_0x2efbf4));if(_0x2efbf4[_0xac7e('0x14')]){if(_0x2efbf4[_0xac7e('0x14')]['code']===0x1f4){logger[_0xac7e('0x14')](_0xac7e('0xf'),_0x1aca29,_0x2efbf4['error'][_0xac7e('0x15')]);return _0x4d83fb(_0x2efbf4[_0xac7e('0x14')][_0xac7e('0x15')]);}logger[_0xac7e('0x14')](_0xac7e('0xf'),_0x1aca29,_0x2efbf4['error'][_0xac7e('0x15')]);return _0x1cb874(_0x2efbf4[_0xac7e('0x14')][_0xac7e('0x15')]);}else{logger[_0xac7e('0xe')](_0xac7e('0xf'),_0x1aca29,_0xac7e('0x10'));_0x1cb874(_0x2efbf4[_0xac7e('0x16')][_0xac7e('0x15')]);}})['catch'](function(_0x3f4869){logger[_0xac7e('0x14')](_0xac7e('0xf'),_0x1aca29,_0x3f4869);_0x4d83fb(_0x3f4869);});});}
\ No newline at end of file
index d5773d7..587f561 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c24=['../../components/auth/service','../../components/interaction/service','./network.controller','get','index','/:id','isAuthenticated','show','post','update','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x58e989,_0x2b6e4a){var _0x2bf9bd=function(_0x583536){while(--_0x583536){_0x58e989['push'](_0x58e989['shift']());}};_0x2bf9bd(++_0x2b6e4a);}(_0x2c24,0x1e6));var _0x42c2=function(_0x2d197b,_0x358ea1){_0x2d197b=_0x2d197b-0x0;var _0x24232d=_0x2c24[_0x2d197b];return _0x24232d;};'use strict';var multer=require(_0x42c2('0x0'));var util=require(_0x42c2('0x1'));var path=require(_0x42c2('0x2'));var timeout=require(_0x42c2('0x3'));var express=require(_0x42c2('0x4'));var router=express[_0x42c2('0x5')]();var fs_extra=require(_0x42c2('0x6'));var auth=require(_0x42c2('0x7'));var interaction=require(_0x42c2('0x8'));var config=require('../../config/environment');var controller=require(_0x42c2('0x9'));router[_0x42c2('0xa')]('/',auth['isAuthenticated'](),controller[_0x42c2('0xb')]);router[_0x42c2('0xa')](_0x42c2('0xc'),auth[_0x42c2('0xd')](),controller[_0x42c2('0xe')]);router[_0x42c2('0xf')]('/',auth[_0x42c2('0xd')](),controller['create']);router['put'](_0x42c2('0xc'),auth[_0x42c2('0xd')](),controller[_0x42c2('0x10')]);router['delete'](_0x42c2('0xc'),auth[_0x42c2('0xd')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xad5f=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xad5f,0x1a8));var _0xfad5=function(_0x2e5a8c,_0x35f4bf){_0x2e5a8c=_0x2e5a8c-0x0;var _0x5816ec=_0xad5f[_0x2e5a8c];return _0x5816ec;};'use strict';var multer=require(_0xfad5('0x0'));var util=require(_0xfad5('0x1'));var path=require(_0xfad5('0x2'));var timeout=require(_0xfad5('0x3'));var express=require(_0xfad5('0x4'));var router=express[_0xfad5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xfad5('0x6'));var interaction=require(_0xfad5('0x7'));var config=require(_0xfad5('0x8'));var controller=require(_0xfad5('0x9'));router[_0xfad5('0xa')]('/',auth[_0xfad5('0xb')](),controller[_0xfad5('0xc')]);router['get'](_0xfad5('0xd'),auth[_0xfad5('0xb')](),controller[_0xfad5('0xe')]);router[_0xfad5('0xf')]('/',auth['isAuthenticated'](),controller[_0xfad5('0x10')]);router[_0xfad5('0x11')](_0xfad5('0xd'),auth[_0xfad5('0xb')](),controller[_0xfad5('0x12')]);router[_0xfad5('0x13')](_0xfad5('0xd'),auth['isAuthenticated'](),controller[_0xfad5('0x14')]);module[_0xfad5('0x15')]=router;
\ No newline at end of file
index 27250fe..2f49b01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde19=['localnet','externip','stun','turn','STRING','sequelize','ENUM'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xde19,0x75));var _0x9de1=function(_0x3c40f4,_0x500b8a){_0x3c40f4=_0x3c40f4-0x0;var _0x1209d=_0xde19[_0x3c40f4];return _0x1209d;};'use strict';var Sequelize=require(_0x9de1('0x0'));module['exports']={'type':{'type':Sequelize[_0x9de1('0x1')](_0x9de1('0x2'),_0x9de1('0x3'),_0x9de1('0x4'),_0x9de1('0x5'))},'value':{'type':Sequelize[_0x9de1('0x6')]},'username':{'type':Sequelize[_0x9de1('0x6')]},'password':{'type':Sequelize[_0x9de1('0x6')]}};
\ No newline at end of file
+var _0xf6f2=['ENUM','externip','stun','turn','STRING','sequelize','exports'];(function(_0x3541e4,_0x4dcf9a){var _0x3ca5d9=function(_0x3eaac2){while(--_0x3eaac2){_0x3541e4['push'](_0x3541e4['shift']());}};_0x3ca5d9(++_0x4dcf9a);}(_0xf6f2,0x171));var _0x2f6f=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xf6f2[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x2f6f('0x0'));module[_0x2f6f('0x1')]={'type':{'type':Sequelize[_0x2f6f('0x2')]('localnet',_0x2f6f('0x3'),_0x2f6f('0x4'),_0x2f6f('0x5'))},'value':{'type':Sequelize[_0x2f6f('0x6')]},'username':{'type':Sequelize[_0x2f6f('0x6')]},'password':{'type':Sequelize[_0x2f6f('0x6')]}};
\ No newline at end of file
index 7c898c2..038d886 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f2f=['lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','info','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','Network,\x20%s,\x20%s','message','result','catch','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','sendStatus','stack','name','send','map','Network','rawAttributes','fieldName','type','key','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','transaction','body','toUpperCase','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','Reload','create','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','readFileSync','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','sequelize','STUN','TURN','destroy','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra'];(function(_0x432ef8,_0x467038){var _0x9bf102=function(_0x198b88){while(--_0x198b88){_0x432ef8['push'](_0x432ef8['shift']());}};_0x9bf102(++_0x467038);}(_0x8f2f,0x1b6));var _0xf8f2=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x8f2f[_0x5608a3];return _0x1ed50a;};'use strict';var emlformat=require(_0xf8f2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf8f2('0x1'));var rp=require(_0xf8f2('0x2'));var moment=require(_0xf8f2('0x3'));var BPromise=require(_0xf8f2('0x4'));var Mustache=require(_0xf8f2('0x5'));var util=require('util');var path=require(_0xf8f2('0x6'));var sox=require('sox');var csv=require(_0xf8f2('0x7'));var ejs=require(_0xf8f2('0x8'));var fs=require('fs');var fs_extra=require(_0xf8f2('0x9'));var _=require(_0xf8f2('0xa'));var squel=require('squel');var crypto=require(_0xf8f2('0xb'));var jsforce=require(_0xf8f2('0xc'));var deskjs=require(_0xf8f2('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf8f2('0xe'));var Papa=require(_0xf8f2('0xf'));var Redis=require(_0xf8f2('0x10'));var authService=require(_0xf8f2('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf8f2('0x12'));var logger=require(_0xf8f2('0x13'))(_0xf8f2('0x14'));var utils=require(_0xf8f2('0x15'));var config=require(_0xf8f2('0x16'));var licenseUtil=require(_0xf8f2('0x17'));var db=require(_0xf8f2('0x18'))['db'];var jayson=require(_0xf8f2('0x19'));var client=jayson[_0xf8f2('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b97be,_0x3ed894,_0x427d9e,_0x1f5fe1){return new BPromise(function(_0x4c4455,_0x473dc9){var _0x1303f6=_0x1f5fe1||client;return _0x1303f6[_0xf8f2('0x1b')](_0x3b97be,_0x427d9e)[_0xf8f2('0x1c')](function(_0x335cb4){logger[_0xf8f2('0x1d')]('Network,\x20%s,\x20%s',_0x3ed894,_0xf8f2('0x1e'));logger[_0xf8f2('0x1f')](_0xf8f2('0x20'),_0x3ed894,_0xf8f2('0x1e'),JSON[_0xf8f2('0x21')](_0x335cb4));if(_0x335cb4[_0xf8f2('0x22')]){if(_0x335cb4[_0xf8f2('0x22')][_0xf8f2('0x23')]===0x1f4){logger[_0xf8f2('0x22')](_0xf8f2('0x24'),_0x3ed894,_0x335cb4[_0xf8f2('0x22')][_0xf8f2('0x25')]);return _0x473dc9(_0x335cb4[_0xf8f2('0x22')][_0xf8f2('0x25')]);}logger[_0xf8f2('0x22')]('Network,\x20%s,\x20%s',_0x3ed894,_0x335cb4[_0xf8f2('0x22')]['message']);return _0x4c4455(_0x335cb4[_0xf8f2('0x22')][_0xf8f2('0x25')]);}else{logger[_0xf8f2('0x1d')](_0xf8f2('0x24'),_0x3ed894,_0xf8f2('0x1e'));_0x4c4455(_0x335cb4[_0xf8f2('0x26')]['message']);}})[_0xf8f2('0x27')](function(_0x5ebadc){logger[_0xf8f2('0x22')](_0xf8f2('0x24'),_0x3ed894,_0x5ebadc);_0x473dc9(_0x5ebadc);});});}function respondWithStatusCode(_0x4d6c48,_0xda70ae){_0xda70ae=_0xda70ae||0xcc;return function(_0x43d3f4){if(_0x43d3f4){return _0x4d6c48['sendStatus'](_0xda70ae);}return _0x4d6c48[_0xf8f2('0x28')](_0xda70ae)[_0xf8f2('0x29')]();};}function respondWithResult(_0xf135d,_0x47816d){_0x47816d=_0x47816d||0xc8;return function(_0x1f16b5){if(_0x1f16b5){return _0xf135d[_0xf8f2('0x28')](_0x47816d)['json'](_0x1f16b5);}};}function respondWithFilteredResult(_0x102f4f,_0x1f370a){return function(_0xea99ae){if(_0xea99ae){var _0x329d28=typeof _0x1f370a[_0xf8f2('0x2a')]===_0xf8f2('0x2b')&&typeof _0x1f370a['limit']===_0xf8f2('0x2b');var _0xfaccc4=_0xea99ae[_0xf8f2('0x2c')];var _0x435392=_0x329d28?0x0:_0x1f370a['offset'];var _0x4f124e=_0x329d28?_0xea99ae[_0xf8f2('0x2c')]:_0x1f370a[_0xf8f2('0x2a')]+_0x1f370a[_0xf8f2('0x2d')];var _0x3b5c72;if(_0x4f124e>=_0xfaccc4){_0x4f124e=_0xfaccc4;_0x3b5c72=0xc8;}else{_0x3b5c72=0xce;}_0x102f4f[_0xf8f2('0x28')](_0x3b5c72);return _0x102f4f[_0xf8f2('0x2e')](_0xf8f2('0x2f'),_0x435392+'-'+_0x4f124e+'/'+_0xfaccc4)[_0xf8f2('0x30')](_0xea99ae);}return null;};}function patchUpdates(_0x5b8193){return function(_0x1ec3db){try{jsonpatch[_0xf8f2('0x31')](_0x1ec3db,_0x5b8193,!![]);}catch(_0x3e128e){return BPromise[_0xf8f2('0x32')](_0x3e128e);}return _0x1ec3db[_0xf8f2('0x33')]();};}function saveUpdates(_0xb54663,_0x1cf1ac){return function(_0x4c3674){if(_0x4c3674){return _0x4c3674[_0xf8f2('0x34')](_0xb54663)[_0xf8f2('0x1c')](function(_0x212fe0){return _0x212fe0;});}return null;};}function removeEntity(_0x3dfe9c,_0x2eaf61){return function(_0x27bc53){if(_0x27bc53){return _0x27bc53['destroy']()[_0xf8f2('0x1c')](function(){_0x3dfe9c[_0xf8f2('0x28')](0xcc)[_0xf8f2('0x29')]();});}};}function handleEntityNotFound(_0x4d9508,_0x3c5e5){return function(_0x24698d){if(!_0x24698d){_0x4d9508[_0xf8f2('0x35')](0x194);}return _0x24698d;};}function handleError(_0x485f34,_0x56d0a3){_0x56d0a3=_0x56d0a3||0x1f4;return function(_0xf7ca6b){logger[_0xf8f2('0x22')](_0xf7ca6b[_0xf8f2('0x36')]);if(_0xf7ca6b[_0xf8f2('0x37')]){delete _0xf7ca6b[_0xf8f2('0x37')];}_0x485f34[_0xf8f2('0x28')](_0x56d0a3)[_0xf8f2('0x38')](_0xf7ca6b);};}exports['index']=function(_0x3a0c54,_0x2bb185){var _0xc3f34e={},_0x2873d0={},_0xbe44fa={'count':0x0,'rows':[]};var _0x635ecc=_[_0xf8f2('0x39')](db[_0xf8f2('0x3a')][_0xf8f2('0x3b')],function(_0xc50645){return{'name':_0xc50645[_0xf8f2('0x3c')],'type':_0xc50645[_0xf8f2('0x3d')][_0xf8f2('0x3e')]};});_0x2873d0['model']=_[_0xf8f2('0x39')](_0x635ecc,_0xf8f2('0x37'));_0x2873d0['query']=_[_0xf8f2('0x3f')](_0x3a0c54[_0xf8f2('0x40')]);_0x2873d0['filters']=_[_0xf8f2('0x41')](_0x2873d0[_0xf8f2('0x42')],_0x2873d0['query']);_0xc3f34e['attributes']=_[_0xf8f2('0x41')](_0x2873d0[_0xf8f2('0x42')],qs[_0xf8f2('0x43')](_0x3a0c54[_0xf8f2('0x40')][_0xf8f2('0x43')]));_0xc3f34e['attributes']=_0xc3f34e[_0xf8f2('0x44')][_0xf8f2('0x45')]?_0xc3f34e[_0xf8f2('0x44')]:_0x2873d0[_0xf8f2('0x42')];if(!_0x3a0c54[_0xf8f2('0x40')][_0xf8f2('0x46')](_0xf8f2('0x47'))){_0xc3f34e[_0xf8f2('0x2d')]=qs[_0xf8f2('0x2d')](_0x3a0c54[_0xf8f2('0x40')][_0xf8f2('0x2d')]);_0xc3f34e[_0xf8f2('0x2a')]=qs['offset'](_0x3a0c54[_0xf8f2('0x40')][_0xf8f2('0x2a')]);}_0xc3f34e[_0xf8f2('0x48')]=qs[_0xf8f2('0x49')](_0x3a0c54[_0xf8f2('0x40')][_0xf8f2('0x49')]);_0xc3f34e['where']=qs[_0xf8f2('0x4a')](_[_0xf8f2('0x4b')](_0x3a0c54[_0xf8f2('0x40')],_0x2873d0['filters']),_0x635ecc);if(_0x3a0c54['query'][_0xf8f2('0x4c')]){_0xc3f34e[_0xf8f2('0x4d')]=_[_0xf8f2('0x4e')](_0xc3f34e['where'],{'$or':_[_0xf8f2('0x39')](_0x635ecc,function(_0x272c89){if(_0x272c89[_0xf8f2('0x3d')]!==_0xf8f2('0x4f')){var _0x4942ab={};_0x4942ab[_0x272c89[_0xf8f2('0x37')]]={'$like':'%'+_0x3a0c54[_0xf8f2('0x40')][_0xf8f2('0x4c')]+'%'};return _0x4942ab;}})});}_0xc3f34e=_[_0xf8f2('0x4e')]({},_0xc3f34e,_0x3a0c54[_0xf8f2('0x50')]);var _0x186a75={'where':_0xc3f34e['where']};return db[_0xf8f2('0x3a')][_0xf8f2('0x2c')](_0x186a75)['then'](function(_0x1fcfa2){_0xbe44fa[_0xf8f2('0x2c')]=_0x1fcfa2;if(_0x3a0c54[_0xf8f2('0x40')][_0xf8f2('0x51')]){_0xc3f34e['include']=[{'all':!![]}];}return db[_0xf8f2('0x3a')][_0xf8f2('0x52')](_0xc3f34e);})[_0xf8f2('0x1c')](function(_0x5e4b9e){_0xbe44fa[_0xf8f2('0x53')]=_0x5e4b9e;return _0xbe44fa;})['then'](respondWithFilteredResult(_0x2bb185,_0xc3f34e))[_0xf8f2('0x27')](handleError(_0x2bb185,null));};exports[_0xf8f2('0x54')]=function(_0x5873e7,_0x57a234){var _0x1baa95={'raw':!![],'where':{'id':_0x5873e7[_0xf8f2('0x55')]['id']}},_0x16c12b={};_0x16c12b['model']=_[_0xf8f2('0x3f')](db['Network'][_0xf8f2('0x3b')]);_0x16c12b[_0xf8f2('0x40')]=_['keys'](_0x5873e7[_0xf8f2('0x40')]);_0x16c12b[_0xf8f2('0x4a')]=_['intersection'](_0x16c12b[_0xf8f2('0x42')],_0x16c12b[_0xf8f2('0x40')]);_0x1baa95[_0xf8f2('0x44')]=_['intersection'](_0x16c12b[_0xf8f2('0x42')],qs[_0xf8f2('0x43')](_0x5873e7[_0xf8f2('0x40')]['fields']));_0x1baa95[_0xf8f2('0x44')]=_0x1baa95[_0xf8f2('0x44')]['length']?_0x1baa95[_0xf8f2('0x44')]:_0x16c12b[_0xf8f2('0x42')];if(_0x5873e7['query']['includeAll']){_0x1baa95[_0xf8f2('0x56')]=[{'all':!![]}];}_0x1baa95=_[_0xf8f2('0x4e')]({},_0x1baa95,_0x5873e7[_0xf8f2('0x50')]);return db['Network'][_0xf8f2('0x57')](_0x1baa95)[_0xf8f2('0x1c')](handleEntityNotFound(_0x57a234,null))[_0xf8f2('0x1c')](respondWithResult(_0x57a234,null))[_0xf8f2('0x27')](handleError(_0x57a234,null));};exports['create']=function(_0x12acdb,_0x25359c,_0x4d47a8){var _0x1b8180;return db['sequelize'][_0xf8f2('0x58')](function(_0x5dc1f2){return db[_0xf8f2('0x3a')]['create'](_0x12acdb['body'],{'raw':!![]})[_0xf8f2('0x1c')](function(_0x587009){_0x1b8180=_0x587009;return db[_0xf8f2('0x3a')][_0xf8f2('0x52')]({'where':{'type':_0x12acdb[_0xf8f2('0x59')][_0xf8f2('0x3d')]},'raw':!![]});})[_0xf8f2('0x1c')](function(_0x12a6af){if(_0x1b8180['type'][_0xf8f2('0x5a')]()=='STUN'){var _0x1489e8=fs['readFileSync'](path[_0xf8f2('0x5b')](config[_0xf8f2('0x5c')],_0xf8f2('0x5d')),_0xf8f2('0x5e'));var _0x3fcd5d=ejs[_0xf8f2('0x5f')](_0x1489e8,{'networks':_0x12a6af||[]});fs[_0xf8f2('0x60')]('/etc/asterisk/stun_xcally.conf',_0x3fcd5d);return respondWithRpcPromise(_0xf8f2('0x61'),_0xf8f2('0x62'),{'module':'res_stun_monitor.so'});}else if(_0x1b8180['type'][_0xf8f2('0x5a')]()=='TURN'){var _0x59f3fd=fs['readFileSync'](path[_0xf8f2('0x5b')](config['root'],_0xf8f2('0x63')),'utf8');var _0x24e1d8=ejs[_0xf8f2('0x5f')](_0x59f3fd,{'networks':_0x12a6af||[]});fs[_0xf8f2('0x60')](_0xf8f2('0x64'),_0x24e1d8);return respondWithRpcPromise('Reload',_0xf8f2('0x62'),{'module':_0xf8f2('0x65')});}else{var _0x539ad9=fs[_0xf8f2('0x66')](path['join'](config[_0xf8f2('0x5c')],_0xf8f2('0x67')),'utf8');var _0x38c6f7=ejs['render'](_0x539ad9,{'networks':_0x12a6af||[]});fs[_0xf8f2('0x60')](util[_0xf8f2('0x68')](_0xf8f2('0x69'),_0x12acdb[_0xf8f2('0x59')]['type'][_0xf8f2('0x6a')]()),_0x38c6f7);return respondWithRpcPromise(_0xf8f2('0x61'),_0xf8f2('0x62'),{'module':_0xf8f2('0x6b')});}return null;})[_0xf8f2('0x1c')](function(){return _0x1b8180;});})[_0xf8f2('0x1c')](respondWithResult(_0x25359c,0xc9))['catch'](handleError(_0x25359c,null));};exports[_0xf8f2('0x34')]=function(_0x1f2f9c,_0x2eb601,_0x332b16){var _0x1bad99;return db[_0xf8f2('0x6c')][_0xf8f2('0x58')](function(_0x1b8e29){return db['Network'][_0xf8f2('0x57')]({'where':{'id':_0x1f2f9c[_0xf8f2('0x55')]['id']}})[_0xf8f2('0x1c')](handleEntityNotFound(_0x2eb601,null))['then'](saveUpdates(_0x1f2f9c[_0xf8f2('0x59')],null))[_0xf8f2('0x1c')](function(_0x4c4923){if(_0x4c4923){_0x1bad99=_0x4c4923;return db['Network'][_0xf8f2('0x52')]({'where':{'type':_0x1bad99[_0xf8f2('0x3d')]},'raw':!![]});}return null;})[_0xf8f2('0x1c')](function(_0x2b7a35){if(_0x1bad99[_0xf8f2('0x3d')]['toUpperCase']()==_0xf8f2('0x6d')){var _0x10a8d8=fs[_0xf8f2('0x66')](path[_0xf8f2('0x5b')](config[_0xf8f2('0x5c')],_0xf8f2('0x5d')),_0xf8f2('0x5e'));var _0x1fc0a7=ejs[_0xf8f2('0x5f')](_0x10a8d8,{'networks':_0x2b7a35||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x1fc0a7);return respondWithRpcPromise(_0xf8f2('0x61'),_0xf8f2('0x34'),{'module':_0xf8f2('0x65')});}else if(_0x1bad99['type'][_0xf8f2('0x5a')]()==_0xf8f2('0x6e')){var _0x5456b2=fs[_0xf8f2('0x66')](path[_0xf8f2('0x5b')](config[_0xf8f2('0x5c')],_0xf8f2('0x63')),_0xf8f2('0x5e'));var _0x33e626=ejs[_0xf8f2('0x5f')](_0x5456b2,{'networks':_0x2b7a35||[]});fs[_0xf8f2('0x60')](_0xf8f2('0x64'),_0x33e626);return respondWithRpcPromise(_0xf8f2('0x61'),_0xf8f2('0x34'),{'module':_0xf8f2('0x65')});}else{var _0x3668b0=fs[_0xf8f2('0x66')](path['join'](config['root'],'server/files/templates/network.ejs'),_0xf8f2('0x5e'));var _0xa88bcd=ejs['render'](_0x3668b0,{'networks':_0x2b7a35||[]});fs[_0xf8f2('0x60')](util[_0xf8f2('0x68')](_0xf8f2('0x69'),_0x1f2f9c['body'][_0xf8f2('0x3d')][_0xf8f2('0x6a')]()),_0xa88bcd);return respondWithRpcPromise('Reload',_0xf8f2('0x34'),{'module':'chan_sip.so'});}return null;})['then'](function(_0xc8759e){if(_0xc8759e){return _0x1bad99;}return null;});})['then'](respondWithResult(_0x2eb601,null))['catch'](handleError(_0x2eb601,null));};exports[_0xf8f2('0x6f')]=function(_0x2ed125,_0x54c5ea,_0x45a580){var _0x1040c9;return db['Network'][_0xf8f2('0x57')]({'where':{'id':_0x2ed125['params']['id']}})['then'](function(_0x564c99){_0x1040c9=_0x564c99;return _0x564c99;})[_0xf8f2('0x1c')](handleEntityNotFound(_0x54c5ea,null))[_0xf8f2('0x1c')](removeEntity(_0x54c5ea,null))[_0xf8f2('0x1c')](function(){if(_0x1040c9){return db['Network'][_0xf8f2('0x52')]({'where':{'type':_0x1040c9['type']},'raw':!![]});}})[_0xf8f2('0x1c')](function(_0xc4050a){if(_0x1040c9['type']['toUpperCase']()==_0xf8f2('0x6d')){var _0x42154b=fs[_0xf8f2('0x66')](path[_0xf8f2('0x5b')](config[_0xf8f2('0x5c')],_0xf8f2('0x5d')),'utf8');var _0x16fd44=ejs[_0xf8f2('0x5f')](_0x42154b,{'networks':_0xc4050a||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x16fd44);return respondWithRpcPromise(_0xf8f2('0x61'),'destroy',{'module':'res_stun_monitor.so'});}else if(_0x1040c9[_0xf8f2('0x3d')]['toUpperCase']()=='TURN'){var _0x3de953=fs[_0xf8f2('0x66')](path['join'](config[_0xf8f2('0x5c')],'server/files/templates/turn_multiple.ejs'),_0xf8f2('0x5e'));var _0x4451f1=ejs[_0xf8f2('0x5f')](_0x3de953,{'networks':_0xc4050a||[]});fs[_0xf8f2('0x60')]('/etc/asterisk/turn_xcally.conf',_0x4451f1);return respondWithRpcPromise('Reload',_0xf8f2('0x6f'),{'module':'res_stun_monitor.so'});}else{var _0x1694e0=fs['readFileSync'](path[_0xf8f2('0x5b')](config[_0xf8f2('0x5c')],_0xf8f2('0x67')),_0xf8f2('0x5e'));var _0xba1264=ejs['render'](_0x1694e0,{'networks':_0xc4050a||[]});fs[_0xf8f2('0x60')](util[_0xf8f2('0x68')]('/etc/asterisk/sip_xcally_%s.conf',_0x2ed125[_0xf8f2('0x59')]['type'][_0xf8f2('0x6a')]()),_0xba1264);return respondWithRpcPromise(_0xf8f2('0x61'),'destroy',{'module':'chan_sip.so'});}return null;})[_0xf8f2('0x27')](handleError(_0x54c5ea,null));};
\ No newline at end of file
+var _0x4502=['filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','options','includeAll','include','Network','findAll','rows','show','params','find','create','sequelize','body','toUpperCase','STUN','readFileSync','server/files/templates/stun_multiple.ejs','utf8','render','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','join','root','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','TURN','eml-format','zip-dir','moment','mustache','util','path','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','name','send','rawAttributes','type','key','model','map','query','keys'];(function(_0x9d2e,_0x18ba09){var _0x53e359=function(_0x5d1a5f){while(--_0x5d1a5f){_0x9d2e['push'](_0x9d2e['shift']());}};_0x53e359(++_0x18ba09);}(_0x4502,0x157));var _0x2450=function(_0x40b2c5,_0x2ed3da){_0x40b2c5=_0x40b2c5-0x0;var _0x2d9d66=_0x4502[_0x40b2c5];return _0x2d9d66;};'use strict';var emlformat=require(_0x2450('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2450('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2450('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2450('0x3'));var util=require(_0x2450('0x4'));var path=require(_0x2450('0x5'));var sox=require(_0x2450('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2450('0x7'));var squel=require(_0x2450('0x8'));var crypto=require('crypto');var jsforce=require(_0x2450('0x9'));var deskjs=require(_0x2450('0xa'));var toCsv=require(_0x2450('0xb'));var querystring=require(_0x2450('0xc'));var Papa=require(_0x2450('0xd'));var Redis=require(_0x2450('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x2450('0xf'));var as=require(_0x2450('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2450('0x11'));var utils=require(_0x2450('0x12'));var config=require(_0x2450('0x13'));var licenseUtil=require(_0x2450('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0x2450('0x15'));var client=jayson[_0x2450('0x16')][_0x2450('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x149762,_0x2aa48d,_0x2e80f3,_0x3b6568){return new BPromise(function(_0x110db4,_0x3c27e2){var _0x1956e5=_0x3b6568||client;return _0x1956e5[_0x2450('0x18')](_0x149762,_0x2e80f3)[_0x2450('0x19')](function(_0x5e8937){logger[_0x2450('0x1a')](_0x2450('0x1b'),_0x2aa48d,_0x2450('0x1c'));logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0x2aa48d,_0x2450('0x1c'),JSON[_0x2450('0x1d')](_0x5e8937));if(_0x5e8937['error']){if(_0x5e8937[_0x2450('0x1e')]['code']===0x1f4){logger[_0x2450('0x1e')](_0x2450('0x1b'),_0x2aa48d,_0x5e8937['error'][_0x2450('0x1f')]);return _0x3c27e2(_0x5e8937[_0x2450('0x1e')]['message']);}logger[_0x2450('0x1e')](_0x2450('0x1b'),_0x2aa48d,_0x5e8937[_0x2450('0x1e')][_0x2450('0x1f')]);return _0x110db4(_0x5e8937['error']['message']);}else{logger['info'](_0x2450('0x1b'),_0x2aa48d,'request\x20sent');_0x110db4(_0x5e8937[_0x2450('0x20')]['message']);}})[_0x2450('0x21')](function(_0x82835f){logger[_0x2450('0x1e')](_0x2450('0x1b'),_0x2aa48d,_0x82835f);_0x3c27e2(_0x82835f);});});}function respondWithStatusCode(_0x378b2b,_0x1564e8){_0x1564e8=_0x1564e8||0xcc;return function(_0x357bd0){if(_0x357bd0){return _0x378b2b['sendStatus'](_0x1564e8);}return _0x378b2b['status'](_0x1564e8)[_0x2450('0x22')]();};}function respondWithResult(_0x51e01a,_0x319e42){_0x319e42=_0x319e42||0xc8;return function(_0x3be156){if(_0x3be156){return _0x51e01a[_0x2450('0x23')](_0x319e42)[_0x2450('0x24')](_0x3be156);}};}function respondWithFilteredResult(_0xb96a9a,_0x225250){return function(_0x126855){if(_0x126855){var _0x2180ff=typeof _0x225250[_0x2450('0x25')]===_0x2450('0x26')&&typeof _0x225250[_0x2450('0x27')]===_0x2450('0x26');var _0x164fb2=_0x126855[_0x2450('0x28')];var _0x4f0997=_0x2180ff?0x0:_0x225250[_0x2450('0x25')];var _0x2225ac=_0x2180ff?_0x126855[_0x2450('0x28')]:_0x225250['offset']+_0x225250[_0x2450('0x27')];var _0x3b3793;if(_0x2225ac>=_0x164fb2){_0x2225ac=_0x164fb2;_0x3b3793=0xc8;}else{_0x3b3793=0xce;}_0xb96a9a[_0x2450('0x23')](_0x3b3793);return _0xb96a9a[_0x2450('0x29')](_0x2450('0x2a'),_0x4f0997+'-'+_0x2225ac+'/'+_0x164fb2)[_0x2450('0x24')](_0x126855);}return null;};}function patchUpdates(_0x1a740f){return function(_0x237ca2){try{jsonpatch[_0x2450('0x2b')](_0x237ca2,_0x1a740f,!![]);}catch(_0x3c9ea9){return BPromise[_0x2450('0x2c')](_0x3c9ea9);}return _0x237ca2[_0x2450('0x2d')]();};}function saveUpdates(_0x409aed,_0x43c34b){return function(_0x4196a0){if(_0x4196a0){return _0x4196a0[_0x2450('0x2e')](_0x409aed)[_0x2450('0x19')](function(_0x409e30){return _0x409e30;});}return null;};}function removeEntity(_0x45c5cd,_0x6ade59){return function(_0x2f9e9a){if(_0x2f9e9a){return _0x2f9e9a[_0x2450('0x2f')]()[_0x2450('0x19')](function(){_0x45c5cd[_0x2450('0x23')](0xcc)[_0x2450('0x22')]();});}};}function handleEntityNotFound(_0x129dfc,_0x3d75ce){return function(_0x3c071f){if(!_0x3c071f){_0x129dfc['sendStatus'](0x194);}return _0x3c071f;};}function handleError(_0x3ca808,_0x350233){_0x350233=_0x350233||0x1f4;return function(_0x3f07cb){logger[_0x2450('0x1e')](_0x3f07cb['stack']);if(_0x3f07cb['name']){delete _0x3f07cb[_0x2450('0x30')];}_0x3ca808[_0x2450('0x23')](_0x350233)[_0x2450('0x31')](_0x3f07cb);};}exports['index']=function(_0x3f9fee,_0x349679){var _0x56b11b={},_0x2ea48d={},_0x38e7f7={'count':0x0,'rows':[]};var _0x73ca5a=_['map'](db['Network'][_0x2450('0x32')],function(_0x1b421a){return{'name':_0x1b421a['fieldName'],'type':_0x1b421a[_0x2450('0x33')][_0x2450('0x34')]};});_0x2ea48d[_0x2450('0x35')]=_[_0x2450('0x36')](_0x73ca5a,_0x2450('0x30'));_0x2ea48d[_0x2450('0x37')]=_[_0x2450('0x38')](_0x3f9fee[_0x2450('0x37')]);_0x2ea48d[_0x2450('0x39')]=_[_0x2450('0x3a')](_0x2ea48d['model'],_0x2ea48d[_0x2450('0x37')]);_0x56b11b[_0x2450('0x3b')]=_[_0x2450('0x3a')](_0x2ea48d[_0x2450('0x35')],qs[_0x2450('0x3c')](_0x3f9fee[_0x2450('0x37')][_0x2450('0x3c')]));_0x56b11b[_0x2450('0x3b')]=_0x56b11b['attributes'][_0x2450('0x3d')]?_0x56b11b['attributes']:_0x2ea48d[_0x2450('0x35')];if(!_0x3f9fee['query']['hasOwnProperty']('nolimit')){_0x56b11b[_0x2450('0x27')]=qs[_0x2450('0x27')](_0x3f9fee[_0x2450('0x37')][_0x2450('0x27')]);_0x56b11b[_0x2450('0x25')]=qs[_0x2450('0x25')](_0x3f9fee[_0x2450('0x37')]['offset']);}_0x56b11b[_0x2450('0x3e')]=qs[_0x2450('0x3f')](_0x3f9fee[_0x2450('0x37')][_0x2450('0x3f')]);_0x56b11b[_0x2450('0x40')]=qs[_0x2450('0x39')](_[_0x2450('0x41')](_0x3f9fee['query'],_0x2ea48d[_0x2450('0x39')]),_0x73ca5a);if(_0x3f9fee[_0x2450('0x37')][_0x2450('0x42')]){_0x56b11b[_0x2450('0x40')]=_[_0x2450('0x43')](_0x56b11b[_0x2450('0x40')],{'$or':_[_0x2450('0x36')](_0x73ca5a,function(_0x2e5a16){if(_0x2e5a16[_0x2450('0x33')]!=='VIRTUAL'){var _0x3e981b={};_0x3e981b[_0x2e5a16[_0x2450('0x30')]]={'$like':'%'+_0x3f9fee[_0x2450('0x37')][_0x2450('0x42')]+'%'};return _0x3e981b;}})});}_0x56b11b=_[_0x2450('0x43')]({},_0x56b11b,_0x3f9fee[_0x2450('0x44')]);var _0x40f5c7={'where':_0x56b11b[_0x2450('0x40')]};return db['Network']['count'](_0x40f5c7)[_0x2450('0x19')](function(_0x3bf9c4){_0x38e7f7[_0x2450('0x28')]=_0x3bf9c4;if(_0x3f9fee['query'][_0x2450('0x45')]){_0x56b11b[_0x2450('0x46')]=[{'all':!![]}];}return db[_0x2450('0x47')][_0x2450('0x48')](_0x56b11b);})['then'](function(_0x212b79){_0x38e7f7[_0x2450('0x49')]=_0x212b79;return _0x38e7f7;})['then'](respondWithFilteredResult(_0x349679,_0x56b11b))[_0x2450('0x21')](handleError(_0x349679,null));};exports[_0x2450('0x4a')]=function(_0x1fa995,_0x142ce7){var _0x42082a={'raw':!![],'where':{'id':_0x1fa995[_0x2450('0x4b')]['id']}},_0x551980={};_0x551980[_0x2450('0x35')]=_[_0x2450('0x38')](db[_0x2450('0x47')]['rawAttributes']);_0x551980[_0x2450('0x37')]=_['keys'](_0x1fa995[_0x2450('0x37')]);_0x551980[_0x2450('0x39')]=_[_0x2450('0x3a')](_0x551980[_0x2450('0x35')],_0x551980[_0x2450('0x37')]);_0x42082a[_0x2450('0x3b')]=_['intersection'](_0x551980['model'],qs['fields'](_0x1fa995['query'][_0x2450('0x3c')]));_0x42082a[_0x2450('0x3b')]=_0x42082a[_0x2450('0x3b')][_0x2450('0x3d')]?_0x42082a[_0x2450('0x3b')]:_0x551980[_0x2450('0x35')];if(_0x1fa995[_0x2450('0x37')][_0x2450('0x45')]){_0x42082a[_0x2450('0x46')]=[{'all':!![]}];}_0x42082a=_[_0x2450('0x43')]({},_0x42082a,_0x1fa995[_0x2450('0x44')]);return db[_0x2450('0x47')][_0x2450('0x4c')](_0x42082a)[_0x2450('0x19')](handleEntityNotFound(_0x142ce7,null))[_0x2450('0x19')](respondWithResult(_0x142ce7,null))[_0x2450('0x21')](handleError(_0x142ce7,null));};exports[_0x2450('0x4d')]=function(_0x4bffc5,_0xca30ac,_0x487882){var _0x3cdfde;return db[_0x2450('0x4e')]['transaction'](function(_0x530f26){return db['Network'][_0x2450('0x4d')](_0x4bffc5[_0x2450('0x4f')],{'raw':!![]})[_0x2450('0x19')](function(_0x253001){_0x3cdfde=_0x253001;return db['Network'][_0x2450('0x48')]({'where':{'type':_0x4bffc5['body'][_0x2450('0x33')]},'raw':!![]});})[_0x2450('0x19')](function(_0xd05a59){if(_0x3cdfde[_0x2450('0x33')][_0x2450('0x50')]()==_0x2450('0x51')){var _0x2537ed=fs[_0x2450('0x52')](path['join'](config['root'],_0x2450('0x53')),_0x2450('0x54'));var _0x21a6f5=ejs[_0x2450('0x55')](_0x2537ed,{'networks':_0xd05a59||[]});fs['writeFileSync'](_0x2450('0x56'),_0x21a6f5);return respondWithRpcPromise(_0x2450('0x57'),'create',{'module':_0x2450('0x58')});}else if(_0x3cdfde['type'][_0x2450('0x50')]()=='TURN'){var _0x3a2e16=fs[_0x2450('0x52')](path[_0x2450('0x59')](config[_0x2450('0x5a')],_0x2450('0x5b')),'utf8');var _0x322979=ejs[_0x2450('0x55')](_0x3a2e16,{'networks':_0xd05a59||[]});fs['writeFileSync'](_0x2450('0x5c'),_0x322979);return respondWithRpcPromise(_0x2450('0x57'),_0x2450('0x4d'),{'module':_0x2450('0x58')});}else{var _0xbfa3b5=fs[_0x2450('0x52')](path[_0x2450('0x59')](config[_0x2450('0x5a')],_0x2450('0x5d')),_0x2450('0x54'));var _0x4873fe=ejs[_0x2450('0x55')](_0xbfa3b5,{'networks':_0xd05a59||[]});fs[_0x2450('0x5e')](util[_0x2450('0x5f')](_0x2450('0x60'),_0x4bffc5[_0x2450('0x4f')]['type'][_0x2450('0x61')]()),_0x4873fe);return respondWithRpcPromise(_0x2450('0x57'),_0x2450('0x4d'),{'module':_0x2450('0x62')});}return null;})[_0x2450('0x19')](function(){return _0x3cdfde;});})[_0x2450('0x19')](respondWithResult(_0xca30ac,0xc9))[_0x2450('0x21')](handleError(_0xca30ac,null));};exports[_0x2450('0x2e')]=function(_0x188034,_0x35f705,_0x426ba5){var _0x434c44;return db[_0x2450('0x4e')]['transaction'](function(_0x2e6d52){return db[_0x2450('0x47')]['find']({'where':{'id':_0x188034[_0x2450('0x4b')]['id']}})[_0x2450('0x19')](handleEntityNotFound(_0x35f705,null))[_0x2450('0x19')](saveUpdates(_0x188034[_0x2450('0x4f')],null))[_0x2450('0x19')](function(_0x2b7841){if(_0x2b7841){_0x434c44=_0x2b7841;return db[_0x2450('0x47')][_0x2450('0x48')]({'where':{'type':_0x434c44[_0x2450('0x33')]},'raw':!![]});}return null;})[_0x2450('0x19')](function(_0x19a1c6){if(_0x434c44[_0x2450('0x33')]['toUpperCase']()==_0x2450('0x51')){var _0x194cae=fs[_0x2450('0x52')](path[_0x2450('0x59')](config[_0x2450('0x5a')],_0x2450('0x53')),_0x2450('0x54'));var _0x5c0790=ejs[_0x2450('0x55')](_0x194cae,{'networks':_0x19a1c6||[]});fs[_0x2450('0x5e')](_0x2450('0x56'),_0x5c0790);return respondWithRpcPromise(_0x2450('0x57'),_0x2450('0x2e'),{'module':_0x2450('0x58')});}else if(_0x434c44[_0x2450('0x33')][_0x2450('0x50')]()==_0x2450('0x63')){var _0x5bdd35=fs[_0x2450('0x52')](path[_0x2450('0x59')](config[_0x2450('0x5a')],'server/files/templates/turn_multiple.ejs'),_0x2450('0x54'));var _0x1c4a5c=ejs[_0x2450('0x55')](_0x5bdd35,{'networks':_0x19a1c6||[]});fs[_0x2450('0x5e')](_0x2450('0x5c'),_0x1c4a5c);return respondWithRpcPromise(_0x2450('0x57'),_0x2450('0x2e'),{'module':_0x2450('0x58')});}else{var _0x53d25f=fs['readFileSync'](path['join'](config[_0x2450('0x5a')],'server/files/templates/network.ejs'),_0x2450('0x54'));var _0x1b62ec=ejs[_0x2450('0x55')](_0x53d25f,{'networks':_0x19a1c6||[]});fs[_0x2450('0x5e')](util[_0x2450('0x5f')](_0x2450('0x60'),_0x188034[_0x2450('0x4f')][_0x2450('0x33')]['toLowerCase']()),_0x1b62ec);return respondWithRpcPromise('Reload',_0x2450('0x2e'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x9109eb){if(_0x9109eb){return _0x434c44;}return null;});})[_0x2450('0x19')](respondWithResult(_0x35f705,null))[_0x2450('0x21')](handleError(_0x35f705,null));};exports['destroy']=function(_0x53b61e,_0x52457f,_0xd9f508){var _0x1b23af;return db[_0x2450('0x47')][_0x2450('0x4c')]({'where':{'id':_0x53b61e['params']['id']}})['then'](function(_0x198a65){_0x1b23af=_0x198a65;return _0x198a65;})[_0x2450('0x19')](handleEntityNotFound(_0x52457f,null))[_0x2450('0x19')](removeEntity(_0x52457f,null))[_0x2450('0x19')](function(){if(_0x1b23af){return db[_0x2450('0x47')][_0x2450('0x48')]({'where':{'type':_0x1b23af[_0x2450('0x33')]},'raw':!![]});}})[_0x2450('0x19')](function(_0xc0cba5){if(_0x1b23af[_0x2450('0x33')]['toUpperCase']()==_0x2450('0x51')){var _0x56934f=fs[_0x2450('0x52')](path[_0x2450('0x59')](config['root'],_0x2450('0x53')),_0x2450('0x54'));var _0x2e8abd=ejs[_0x2450('0x55')](_0x56934f,{'networks':_0xc0cba5||[]});fs['writeFileSync'](_0x2450('0x56'),_0x2e8abd);return respondWithRpcPromise('Reload',_0x2450('0x2f'),{'module':'res_stun_monitor.so'});}else if(_0x1b23af[_0x2450('0x33')][_0x2450('0x50')]()=='TURN'){var _0xd9ae97=fs[_0x2450('0x52')](path[_0x2450('0x59')](config['root'],_0x2450('0x5b')),_0x2450('0x54'));var _0x49449c=ejs[_0x2450('0x55')](_0xd9ae97,{'networks':_0xc0cba5||[]});fs['writeFileSync'](_0x2450('0x5c'),_0x49449c);return respondWithRpcPromise(_0x2450('0x57'),_0x2450('0x2f'),{'module':_0x2450('0x58')});}else{var _0x24a43d=fs[_0x2450('0x52')](path['join'](config['root'],_0x2450('0x5d')),_0x2450('0x54'));var _0x4e48bd=ejs[_0x2450('0x55')](_0x24a43d,{'networks':_0xc0cba5||[]});fs[_0x2450('0x5e')](util['format'](_0x2450('0x60'),_0x53b61e['body'][_0x2450('0x33')][_0x2450('0x61')]()),_0x4e48bd);return respondWithRpcPromise(_0x2450('0x57'),_0x2450('0x2f'),{'module':_0x2450('0x62')});}return null;})[_0x2450('0x21')](handleError(_0x52457f,null));};
\ No newline at end of file
index 0601e0d..eee5800 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f0d=['./network.attributes','define','Network','network','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x28b793,_0xee212c){_0x28b793=_0x28b793-0x0;var _0x41fb9e=_0x6f0d[_0x28b793];return _0x41fb9e;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var logger=require(_0xd6f0('0x1'))(_0xd6f0('0x2'));var moment=require(_0xd6f0('0x3'));var BPromise=require('bluebird');var rp=require(_0xd6f0('0x4'));var fs=require('fs');var path=require(_0xd6f0('0x5'));var rimraf=require(_0xd6f0('0x6'));var config=require(_0xd6f0('0x7'));var attributes=require(_0xd6f0('0x8'));module['exports']=function(_0x2d2ce6,_0x4a8b0c){return _0x2d2ce6[_0xd6f0('0x9')](_0xd6f0('0xa'),attributes,{'tableName':_0xd6f0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd757=['./network.attributes','exports','define','Network','network','lodash','util','../../config/logger','api','request-promise','path','../../config/environment'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xd757,0x1e5));var _0x7d75=function(_0x2a3273,_0x1a59fa){_0x2a3273=_0x2a3273-0x0;var _0x29ff9e=_0xd757[_0x2a3273];return _0x29ff9e;};'use strict';var _=require(_0x7d75('0x0'));var util=require(_0x7d75('0x1'));var logger=require(_0x7d75('0x2'))(_0x7d75('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7d75('0x4'));var fs=require('fs');var path=require(_0x7d75('0x5'));var rimraf=require('rimraf');var config=require(_0x7d75('0x6'));var attributes=require(_0x7d75('0x7'));module[_0x7d75('0x8')]=function(_0x52bb43,_0x5d6128){return _0x52bb43[_0x7d75('0x9')](_0x7d75('0xa'),attributes,{'tableName':_0x7d75('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 87ecab9..0126fc7 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(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0xa6c3c,_0x410e4f){_0xa6c3c=_0xa6c3c-0x0;var _0x34c41b=_0x7a54[_0xa6c3c];return _0x34c41b;};'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(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x256c20,_0x38aaaa){_0x256c20=_0x256c20-0x0;var _0x198eca=_0x7a54[_0x256c20];return _0x198eca;};'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 c245660..d003be2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72f3=['isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getInteractions','/:id/users','getAgents','post','create','addDisposition','notify','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','util','path','connect-timeout','express','Router','../../config/environment','./openchannelAccount.controller','get','index','/describe'];(function(_0x16f53c,_0x3dfdb1){var _0x2ef7cd=function(_0x508433){while(--_0x508433){_0x16f53c['push'](_0x16f53c['shift']());}};_0x2ef7cd(++_0x3dfdb1);}(_0x72f3,0x1c4));var _0x372f=function(_0x3a259d,_0x313102){_0x3a259d=_0x3a259d-0x0;var _0x2e03e6=_0x72f3[_0x3a259d];return _0x2e03e6;};'use strict';var multer=require('multer');var util=require(_0x372f('0x0'));var path=require(_0x372f('0x1'));var timeout=require(_0x372f('0x2'));var express=require(_0x372f('0x3'));var router=express[_0x372f('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x372f('0x5'));var controller=require(_0x372f('0x6'));router[_0x372f('0x7')]('/',auth['isAuthenticated'](),controller[_0x372f('0x8')]);router[_0x372f('0x7')](_0x372f('0x9'),auth[_0x372f('0xa')](),controller[_0x372f('0xb')]);router[_0x372f('0x7')](_0x372f('0xc'),auth[_0x372f('0xa')](),controller[_0x372f('0xd')]);router[_0x372f('0x7')](_0x372f('0xe'),auth[_0x372f('0xa')](),controller[_0x372f('0xf')]);router[_0x372f('0x7')](_0x372f('0x10'),auth['isAuthenticated'](),controller[_0x372f('0x11')]);router[_0x372f('0x7')](_0x372f('0x12'),auth[_0x372f('0xa')](),controller['getApplications']);router[_0x372f('0x7')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x372f('0x13')]);router[_0x372f('0x7')](_0x372f('0x14'),auth[_0x372f('0xa')](),controller[_0x372f('0x15')]);router[_0x372f('0x16')]('/',auth[_0x372f('0xa')](),controller[_0x372f('0x17')]);router[_0x372f('0x16')](_0x372f('0xe'),auth[_0x372f('0xa')](),controller[_0x372f('0x18')]);router[_0x372f('0x16')](_0x372f('0x10'),auth[_0x372f('0xa')](),controller['addAnswer']);router[_0x372f('0x16')]('/:id/notify',controller[_0x372f('0x19')]);router[_0x372f('0x16')](_0x372f('0x12'),auth[_0x372f('0xa')](),controller['addApplications']);router[_0x372f('0x16')]('/:id/users',auth[_0x372f('0xa')](),controller[_0x372f('0x1a')]);router[_0x372f('0x16')]('/:id/send',auth['isAuthenticated'](),controller['send']);router[_0x372f('0x1b')](_0x372f('0xc'),auth[_0x372f('0xa')](),controller[_0x372f('0x1c')]);router[_0x372f('0x1d')](_0x372f('0xc'),auth[_0x372f('0xa')](),controller[_0x372f('0x1e')]);router[_0x372f('0x1d')](_0x372f('0xe'),auth[_0x372f('0xa')](),controller[_0x372f('0x1f')]);router[_0x372f('0x1d')]('/:id/canned_answers',auth[_0x372f('0xa')](),controller[_0x372f('0x20')]);router[_0x372f('0x1d')](_0x372f('0x14'),auth[_0x372f('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x9fce=['getDispositions','getAnswers','/:id/applications','getApplications','getInteractions','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','addAgents','put','update','delete','removeDispositions','multer','util','path','connect-timeout','../../config/environment','./openchannelAccount.controller','isAuthenticated','index','get','describe','/:id','show','/:id/dispositions'];(function(_0x5b077b,_0x50b707){var _0x16faf7=function(_0x41ba83){while(--_0x41ba83){_0x5b077b['push'](_0x5b077b['shift']());}};_0x16faf7(++_0x50b707);}(_0x9fce,0x13d));var _0xe9fc=function(_0x1d426f,_0x37e919){_0x1d426f=_0x1d426f-0x0;var _0x17f71a=_0x9fce[_0x1d426f];return _0x17f71a;};'use strict';var multer=require(_0xe9fc('0x0'));var util=require(_0xe9fc('0x1'));var path=require(_0xe9fc('0x2'));var timeout=require(_0xe9fc('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe9fc('0x4'));var controller=require(_0xe9fc('0x5'));router['get']('/',auth[_0xe9fc('0x6')](),controller[_0xe9fc('0x7')]);router[_0xe9fc('0x8')]('/describe',auth[_0xe9fc('0x6')](),controller[_0xe9fc('0x9')]);router[_0xe9fc('0x8')](_0xe9fc('0xa'),auth['isAuthenticated'](),controller[_0xe9fc('0xb')]);router[_0xe9fc('0x8')](_0xe9fc('0xc'),auth['isAuthenticated'](),controller[_0xe9fc('0xd')]);router[_0xe9fc('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xe9fc('0xe')]);router[_0xe9fc('0x8')](_0xe9fc('0xf'),auth['isAuthenticated'](),controller[_0xe9fc('0x10')]);router[_0xe9fc('0x8')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xe9fc('0x11')]);router[_0xe9fc('0x8')]('/:id/users',auth[_0xe9fc('0x6')](),controller[_0xe9fc('0x12')]);router[_0xe9fc('0x13')]('/',auth[_0xe9fc('0x6')](),controller['create']);router[_0xe9fc('0x13')](_0xe9fc('0xc'),auth[_0xe9fc('0x6')](),controller[_0xe9fc('0x14')]);router['post'](_0xe9fc('0x15'),auth['isAuthenticated'](),controller[_0xe9fc('0x16')]);router[_0xe9fc('0x13')](_0xe9fc('0x17'),controller[_0xe9fc('0x18')]);router[_0xe9fc('0x13')](_0xe9fc('0xf'),auth[_0xe9fc('0x6')](),controller['addApplications']);router[_0xe9fc('0x13')]('/:id/users',auth[_0xe9fc('0x6')](),controller[_0xe9fc('0x19')]);router[_0xe9fc('0x13')]('/:id/send',auth[_0xe9fc('0x6')](),controller['send']);router[_0xe9fc('0x1a')](_0xe9fc('0xa'),auth[_0xe9fc('0x6')](),controller[_0xe9fc('0x1b')]);router[_0xe9fc('0x1c')](_0xe9fc('0xa'),auth[_0xe9fc('0x6')](),controller['destroy']);router[_0xe9fc('0x1c')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xe9fc('0x1d')]);router[_0xe9fc('0x1c')](_0xe9fc('0x15'),auth[_0xe9fc('0x6')](),controller['removeAnswers']);router[_0xe9fc('0x1c')]('/:id/users',auth[_0xe9fc('0x6')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index 4a95e86..7ccd401 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x398d=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x43cf19,_0x56ebde){var _0x560994=function(_0x4bfde7){while(--_0x4bfde7){_0x43cf19['push'](_0x43cf19['shift']());}};_0x560994(++_0x56ebde);}(_0x398d,0x1c9));var _0xd398=function(_0x1e3ee0,_0xb8ee13){_0x1e3ee0=_0x1e3ee0-0x0;var _0x3a171f=_0x398d[_0x1e3ee0];return _0x3a171f;};'use strict';var Sequelize=require(_0xd398('0x0'));var rs=require('randomstring');module[_0xd398('0x1')]={'name':{'type':Sequelize[_0xd398('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xd398('0x2')]},'token':{'type':Sequelize[_0xd398('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0xd398('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xd398('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xd398('0x3');}},'notificationSound':{'type':Sequelize[_0xd398('0x4')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd398('0x4')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd398('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xd398('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd398('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd398('0x4')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd398('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xd398('0x6')},'mandatoryDisposition':{'type':Sequelize[_0xd398('0x4')],'defaultValue':![],'comment':_0xd398('0x7'),'set':function(_0x57a62b){if(!_0x57a62b)this[_0xd398('0x8')](_0xd398('0x9'),null);this[_0xd398('0x8')](_0xd398('0xa'),_0x57a62b);}}};
\ No newline at end of file
+var _0x6cbc=['INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','STRING','name','generate','BOOLEAN'];(function(_0xd57e93,_0x2a2d36){var _0x5a9b37=function(_0x3f441c){while(--_0x3f441c){_0xd57e93['push'](_0xd57e93['shift']());}};_0x5a9b37(++_0x2a2d36);}(_0x6cbc,0x130));var _0xc6cb=function(_0x5d6105,_0x1f5ca9){_0x5d6105=_0x5d6105-0x0;var _0x15f36e=_0x6cbc[_0x5d6105];return _0x15f36e;};'use strict';var Sequelize=require(_0xc6cb('0x0'));var rs=require(_0xc6cb('0x1'));module['exports']={'name':{'type':Sequelize[_0xc6cb('0x2')],'unique':_0xc6cb('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xc6cb('0x2')],'defaultValue':function(){return rs[_0xc6cb('0x4')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xc6cb('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc6cb('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc6cb('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0xc6cb('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc6cb('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc6cb('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc6cb('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xc6cb('0x5')],'defaultValue':![],'comment':_0xc6cb('0x7'),'set':function(_0x256d98){if(!_0x256d98)this[_0xc6cb('0x8')](_0xc6cb('0x9'),null);this['setDataValue']('mandatoryDisposition',_0x256d98);}}};
\ No newline at end of file
index a83a578..8fe8aa5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ad0=['VIRTUAL','includeAll','include','findAll','rows','show','params','length','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','OpenchannelAccounts','find','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','nolimit','order','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','notify','openchannel','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','isNil','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','OpenchannelApplication','Applications','applications','list','orderBy','priority','asc','account','contact','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','rawAttributes','Contact','Owner','internal','Tags','tag','addAgents','omit','spread','emit','removeAgents','userOpenchannelAccount:remove','getAgents','send','DESC','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./openchannelAccount.socket','register','jayson/promise','client','http','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','save','update','destroy','get','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','OpenchannelAccount','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge'];(function(_0x551229,_0x5c98c5){var _0x41a38c=function(_0xa593e4){while(--_0xa593e4){_0x551229['push'](_0x551229['shift']());}};_0x41a38c(++_0x5c98c5);}(_0x4ad0,0x6b));var _0x04ad=function(_0x238524,_0x3d48ff){_0x238524=_0x238524-0x0;var _0x359655=_0x4ad0[_0x238524];return _0x359655;};'use strict';var emlformat=require(_0x04ad('0x0'));var rimraf=require(_0x04ad('0x1'));var zipdir=require(_0x04ad('0x2'));var jsonpatch=require(_0x04ad('0x3'));var rp=require(_0x04ad('0x4'));var moment=require(_0x04ad('0x5'));var BPromise=require(_0x04ad('0x6'));var Mustache=require(_0x04ad('0x7'));var util=require(_0x04ad('0x8'));var path=require(_0x04ad('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x04ad('0xa'));var _=require(_0x04ad('0xb'));var squel=require(_0x04ad('0xc'));var crypto=require(_0x04ad('0xd'));var jsforce=require(_0x04ad('0xe'));var deskjs=require(_0x04ad('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x04ad('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x04ad('0x11'));var as=require(_0x04ad('0x12'));var hardwareService=require(_0x04ad('0x13'));var logger=require('../../config/logger')(_0x04ad('0x14'));var utils=require('../../config/utils');var config=require(_0x04ad('0x15'));var licenseUtil=require(_0x04ad('0x16'));var db=require(_0x04ad('0x17'))['db'];config[_0x04ad('0x18')]=_[_0x04ad('0x19')](config[_0x04ad('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x04ad('0x18')]));require(_0x04ad('0x1a'))[_0x04ad('0x1b')](socket);var jayson=require(_0x04ad('0x1c'));var client=jayson[_0x04ad('0x1d')][_0x04ad('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x04ad('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x285dba,_0x2d415c,_0x1595b6,_0x20952e){return new BPromise(function(_0x2f4639,_0x2e247a){var _0x32177d=_0x20952e||client;return _0x32177d['request'](_0x285dba,_0x1595b6)[_0x04ad('0x1f')](function(_0x55a3f2){logger['info'](_0x04ad('0x20'),_0x2d415c,_0x04ad('0x21'));logger[_0x04ad('0x22')](_0x04ad('0x23'),_0x2d415c,_0x04ad('0x21'),JSON[_0x04ad('0x24')](_0x55a3f2));if(_0x55a3f2[_0x04ad('0x25')]){if(_0x55a3f2[_0x04ad('0x25')][_0x04ad('0x26')]===0x1f4){logger[_0x04ad('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x2d415c,_0x55a3f2[_0x04ad('0x25')]['message']);return _0x2e247a(_0x55a3f2[_0x04ad('0x25')]['message']);}logger['error'](_0x04ad('0x20'),_0x2d415c,_0x55a3f2[_0x04ad('0x25')]['message']);return _0x2f4639(_0x55a3f2[_0x04ad('0x25')][_0x04ad('0x27')]);}else{logger[_0x04ad('0x28')](_0x04ad('0x20'),_0x2d415c,'request\x20sent');_0x2f4639(_0x55a3f2[_0x04ad('0x29')][_0x04ad('0x27')]);}})[_0x04ad('0x2a')](function(_0x26ac62){logger[_0x04ad('0x25')](_0x04ad('0x20'),_0x2d415c,_0x26ac62);_0x2e247a(_0x26ac62);});});}function respondWithStatusCode(_0x10127a,_0x4e541e){_0x4e541e=_0x4e541e||0xcc;return function(_0x1e3158){if(_0x1e3158){return _0x10127a[_0x04ad('0x2b')](_0x4e541e);}return _0x10127a[_0x04ad('0x2c')](_0x4e541e)[_0x04ad('0x2d')]();};}function respondWithResult(_0x29cd59,_0x12c0ba){_0x12c0ba=_0x12c0ba||0xc8;return function(_0x57bf73){if(_0x57bf73){return _0x29cd59[_0x04ad('0x2c')](_0x12c0ba)['json'](_0x57bf73);}};}function respondWithFilteredResult(_0x16bcc7,_0x5567fc){return function(_0x3a3d3e){if(_0x3a3d3e){var _0x5ac89a=typeof _0x5567fc[_0x04ad('0x2e')]===_0x04ad('0x2f')&&typeof _0x5567fc['limit']===_0x04ad('0x2f');var _0x5b6c08=_0x3a3d3e['count'];var _0x581667=_0x5ac89a?0x0:_0x5567fc[_0x04ad('0x2e')];var _0x23c188=_0x5ac89a?_0x3a3d3e[_0x04ad('0x30')]:_0x5567fc['offset']+_0x5567fc[_0x04ad('0x31')];var _0x211880;if(_0x23c188>=_0x5b6c08){_0x23c188=_0x5b6c08;_0x211880=0xc8;}else{_0x211880=0xce;}_0x16bcc7['status'](_0x211880);return _0x16bcc7['set'](_0x04ad('0x32'),_0x581667+'-'+_0x23c188+'/'+_0x5b6c08)[_0x04ad('0x33')](_0x3a3d3e);}return null;};}function patchUpdates(_0x55ab69){return function(_0x3add1f){try{jsonpatch[_0x04ad('0x34')](_0x3add1f,_0x55ab69,!![]);}catch(_0x57b05b){return BPromise['reject'](_0x57b05b);}return _0x3add1f[_0x04ad('0x35')]();};}function saveUpdates(_0x39b1a2,_0x247e96){return function(_0x2b6a3c){if(_0x2b6a3c){return _0x2b6a3c[_0x04ad('0x36')](_0x39b1a2)[_0x04ad('0x1f')](function(_0x36dc3b){return _0x36dc3b;});}return null;};}function removeEntity(_0x473225,_0x332a7b){return function(_0x1076c5){if(_0x1076c5){return _0x1076c5[_0x04ad('0x37')]()[_0x04ad('0x1f')](function(){var _0x1a71ee=_0x1076c5[_0x04ad('0x38')]({'plain':!![]});var _0x4ca247='OpenchannelAccounts';return db[_0x04ad('0x39')][_0x04ad('0x37')]({'where':{'type':_0x4ca247,'resourceId':_0x1a71ee['id']}})[_0x04ad('0x1f')](function(){return _0x1076c5;});})[_0x04ad('0x1f')](function(){_0x473225[_0x04ad('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe7d1cf,_0x27a44e){return function(_0x3df0e7){if(!_0x3df0e7){_0xe7d1cf[_0x04ad('0x2b')](0x194);}return _0x3df0e7;};}function handleError(_0x283883,_0x29ae6d){_0x29ae6d=_0x29ae6d||0x1f4;return function(_0x150bd1){logger[_0x04ad('0x25')](_0x150bd1[_0x04ad('0x3a')]);if(_0x150bd1[_0x04ad('0x3b')]){delete _0x150bd1['name'];}_0x283883[_0x04ad('0x2c')](_0x29ae6d)['send'](_0x150bd1);};}exports[_0x04ad('0x3c')]=function(_0x4b07c5,_0x54ffcc){var _0x5e563c={'include':[{'model':db[_0x04ad('0x3d')],'as':_0x04ad('0x3e')}]},_0x54bfb3={},_0x5bfd01={'count':0x0,'rows':[]};var _0x269447=_['map'](db[_0x04ad('0x3f')]['rawAttributes'],function(_0x2ea3b6){return{'name':_0x2ea3b6[_0x04ad('0x40')],'type':_0x2ea3b6['type'][_0x04ad('0x41')]};});_0x54bfb3[_0x04ad('0x42')]=_[_0x04ad('0x43')](_0x269447,_0x04ad('0x3b'));_0x54bfb3[_0x04ad('0x44')]=_[_0x04ad('0x45')](_0x4b07c5[_0x04ad('0x44')]);_0x54bfb3[_0x04ad('0x46')]=_[_0x04ad('0x47')](_0x54bfb3[_0x04ad('0x42')],_0x54bfb3[_0x04ad('0x44')]);_0x5e563c[_0x04ad('0x48')]=_[_0x04ad('0x47')](_0x54bfb3[_0x04ad('0x42')],qs[_0x04ad('0x49')](_0x4b07c5[_0x04ad('0x44')][_0x04ad('0x49')]));_0x5e563c['attributes']=_0x5e563c[_0x04ad('0x48')]['length']?_0x5e563c['attributes']:_0x54bfb3[_0x04ad('0x42')];if(!_0x4b07c5['query'][_0x04ad('0x4a')]('nolimit')){_0x5e563c[_0x04ad('0x31')]=qs['limit'](_0x4b07c5[_0x04ad('0x44')][_0x04ad('0x31')]);_0x5e563c[_0x04ad('0x2e')]=qs[_0x04ad('0x2e')](_0x4b07c5['query'][_0x04ad('0x2e')]);}_0x5e563c['order']=qs[_0x04ad('0x4b')](_0x4b07c5['query'][_0x04ad('0x4b')]);_0x5e563c[_0x04ad('0x4c')]=qs[_0x04ad('0x46')](_[_0x04ad('0x4d')](_0x4b07c5[_0x04ad('0x44')],_0x54bfb3[_0x04ad('0x46')]),_0x269447);if(_0x4b07c5[_0x04ad('0x44')][_0x04ad('0x4e')]){_0x5e563c[_0x04ad('0x4c')]=_[_0x04ad('0x4f')](_0x5e563c[_0x04ad('0x4c')],{'$or':_[_0x04ad('0x43')](_0x269447,function(_0xe2b6aa){if(_0xe2b6aa['type']!==_0x04ad('0x50')){var _0x25a270={};_0x25a270[_0xe2b6aa[_0x04ad('0x3b')]]={'$like':'%'+_0x4b07c5['query'][_0x04ad('0x4e')]+'%'};return _0x25a270;}})});}_0x5e563c=_[_0x04ad('0x4f')]({},_0x5e563c,_0x4b07c5['options']);var _0x358e28={'where':_0x5e563c['where']};return db[_0x04ad('0x3f')][_0x04ad('0x30')](_0x358e28)[_0x04ad('0x1f')](function(_0x4ba66b){_0x5bfd01['count']=_0x4ba66b;if(_0x4b07c5[_0x04ad('0x44')][_0x04ad('0x51')]){_0x5e563c[_0x04ad('0x52')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x04ad('0x53')](_0x5e563c);})[_0x04ad('0x1f')](function(_0x362b64){_0x5bfd01[_0x04ad('0x54')]=_0x362b64;return _0x5bfd01;})[_0x04ad('0x1f')](respondWithFilteredResult(_0x54ffcc,_0x5e563c))[_0x04ad('0x2a')](handleError(_0x54ffcc,null));};exports[_0x04ad('0x55')]=function(_0x1d5385,_0x22ab12){var _0x5f11cd={'raw':![],'where':{'id':_0x1d5385[_0x04ad('0x56')]['id']},'include':[{'model':db[_0x04ad('0x3d')],'as':_0x04ad('0x3e')}]},_0x2ba7a2={};_0x2ba7a2[_0x04ad('0x42')]=_[_0x04ad('0x45')](db[_0x04ad('0x3f')]['rawAttributes']);_0x2ba7a2['query']=_[_0x04ad('0x45')](_0x1d5385[_0x04ad('0x44')]);_0x2ba7a2['filters']=_[_0x04ad('0x47')](_0x2ba7a2['model'],_0x2ba7a2[_0x04ad('0x44')]);_0x5f11cd['attributes']=_[_0x04ad('0x47')](_0x2ba7a2[_0x04ad('0x42')],qs[_0x04ad('0x49')](_0x1d5385[_0x04ad('0x44')]['fields']));_0x5f11cd[_0x04ad('0x48')]=_0x5f11cd['attributes'][_0x04ad('0x57')]?_0x5f11cd['attributes']:_0x2ba7a2[_0x04ad('0x42')];if(_0x1d5385[_0x04ad('0x44')]['includeAll']){_0x5f11cd[_0x04ad('0x52')]=[{'all':!![]}];}_0x5f11cd=_[_0x04ad('0x4f')]({},_0x5f11cd,_0x1d5385[_0x04ad('0x58')]);return db[_0x04ad('0x3f')]['find'](_0x5f11cd)[_0x04ad('0x1f')](handleEntityNotFound(_0x22ab12,null))['then'](respondWithResult(_0x22ab12,null))[_0x04ad('0x2a')](handleError(_0x22ab12,null));};exports[_0x04ad('0x59')]=function(_0x499229,_0x251978){return db['OpenchannelAccount'][_0x04ad('0x59')](_0x499229[_0x04ad('0x5a')],{})[_0x04ad('0x1f')](function(_0x502c0f){var _0x5c6889=_0x499229['user']['get']({'plain':!![]});if(!_0x5c6889)throw new Error(_0x04ad('0x5b'));if(_0x5c6889['role']===_0x04ad('0x5c')){var _0x19caa6=_0x502c0f[_0x04ad('0x38')]({'plain':!![]});var _0x78fcaf=_0x04ad('0x5d');return db['UserProfileSection']['find']({'where':{'name':_0x78fcaf,'userProfileId':_0x5c6889['userProfileId']},'raw':!![]})[_0x04ad('0x1f')](function(_0x341a2){if(_0x341a2&&_0x341a2['autoAssociation']===0x0){return db[_0x04ad('0x39')][_0x04ad('0x59')]({'name':_0x19caa6[_0x04ad('0x3b')],'resourceId':_0x19caa6['id'],'type':_0x341a2[_0x04ad('0x3b')],'sectionId':_0x341a2['id']},{})[_0x04ad('0x1f')](function(){return _0x502c0f;});}else{return _0x502c0f;}})[_0x04ad('0x2a')](function(_0x4515e2){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4515e2);throw _0x4515e2;});}return _0x502c0f;})['then'](respondWithResult(_0x251978,0xc9))[_0x04ad('0x2a')](handleError(_0x251978,null));};exports[_0x04ad('0x36')]=function(_0x1b2638,_0x5cef4a){if(_0x1b2638[_0x04ad('0x5a')]['id']){delete _0x1b2638[_0x04ad('0x5a')]['id'];}return db[_0x04ad('0x3f')][_0x04ad('0x5e')]({'where':{'id':_0x1b2638[_0x04ad('0x56')]['id']},'include':[{'model':db[_0x04ad('0x3d')],'as':_0x04ad('0x3e')}]})[_0x04ad('0x1f')](handleEntityNotFound(_0x5cef4a,null))[_0x04ad('0x1f')](saveUpdates(_0x1b2638[_0x04ad('0x5a')],null))[_0x04ad('0x1f')](respondWithResult(_0x5cef4a,null))[_0x04ad('0x2a')](handleError(_0x5cef4a,null));};exports[_0x04ad('0x37')]=function(_0x4e50a8,_0x4d4b47){return db['OpenchannelAccount']['find']({'where':{'id':_0x4e50a8[_0x04ad('0x56')]['id']}})[_0x04ad('0x1f')](handleEntityNotFound(_0x4d4b47,null))[_0x04ad('0x1f')](removeEntity(_0x4d4b47,null))[_0x04ad('0x2a')](handleError(_0x4d4b47,null));};exports[_0x04ad('0x5f')]=function(_0x417fb5,_0x420b35){return db['OpenchannelAccount']['describe']()[_0x04ad('0x1f')](respondWithResult(_0x420b35,null))[_0x04ad('0x2a')](handleError(_0x420b35,null));};exports[_0x04ad('0x60')]=function(_0x36c084,_0x35fd7f,_0x3197d8){if(_0x36c084[_0x04ad('0x5a')]['id']){delete _0x36c084[_0x04ad('0x5a')]['id'];}return db['OpenchannelAccount'][_0x04ad('0x5e')]({'where':{'id':_0x36c084[_0x04ad('0x56')]['id']}})[_0x04ad('0x1f')](handleEntityNotFound(_0x35fd7f,null))[_0x04ad('0x1f')](function(_0xd4c9d3){if(_0xd4c9d3){_0x36c084[_0x04ad('0x5a')][_0x04ad('0x61')]=_0xd4c9d3['id'];return db[_0x04ad('0x62')][_0x04ad('0x59')](_0x36c084[_0x04ad('0x5a')]);}})['then'](respondWithResult(_0x35fd7f,null))[_0x04ad('0x2a')](handleError(_0x35fd7f,null));};exports[_0x04ad('0x63')]=function(_0x564fd5,_0x118c4d,_0x4ec013){var _0x9f1c83={'raw':![],'where':{}};var _0x59ab93={};var _0x4f3cc3={'count':0x0,'rows':[]};return db[_0x04ad('0x3f')][_0x04ad('0x64')]({'where':{'id':_0x564fd5[_0x04ad('0x56')]['id']}})['then'](handleEntityNotFound(_0x118c4d,null))['then'](function(_0xd81526){if(_0xd81526){_0x59ab93['model']=_[_0x04ad('0x45')](db[_0x04ad('0x62')]['rawAttributes']);_0x59ab93['query']=_[_0x04ad('0x45')](_0x564fd5[_0x04ad('0x44')]);_0x59ab93[_0x04ad('0x46')]=_[_0x04ad('0x47')](_0x59ab93[_0x04ad('0x42')],_0x59ab93[_0x04ad('0x44')]);_0x9f1c83[_0x04ad('0x48')]=_[_0x04ad('0x47')](_0x59ab93[_0x04ad('0x42')],qs[_0x04ad('0x49')](_0x564fd5[_0x04ad('0x44')][_0x04ad('0x49')]));_0x9f1c83[_0x04ad('0x48')]=_0x9f1c83['attributes']['length']?_0x9f1c83[_0x04ad('0x48')]:_0x59ab93[_0x04ad('0x42')];if(!_0x564fd5[_0x04ad('0x44')]['hasOwnProperty'](_0x04ad('0x65'))){_0x9f1c83[_0x04ad('0x31')]=qs[_0x04ad('0x31')](_0x564fd5['query'][_0x04ad('0x31')]);_0x9f1c83['offset']=qs[_0x04ad('0x2e')](_0x564fd5['query'][_0x04ad('0x2e')]);}_0x9f1c83[_0x04ad('0x66')]=qs[_0x04ad('0x4b')](_0x564fd5[_0x04ad('0x44')]['sort']);_0x9f1c83[_0x04ad('0x4c')]=qs[_0x04ad('0x46')](_[_0x04ad('0x4d')](_0x564fd5[_0x04ad('0x44')],_0x59ab93['filters']));_0x9f1c83[_0x04ad('0x4c')]['OpenchannelAccountId']=_0xd81526['id'];if(_0x564fd5[_0x04ad('0x44')][_0x04ad('0x4e')]){_0x9f1c83[_0x04ad('0x4c')]=_[_0x04ad('0x4f')](_0x9f1c83[_0x04ad('0x4c')],{'$or':_[_0x04ad('0x43')](_0x9f1c83[_0x04ad('0x48')],function(_0x179bd6){var _0x8bf79b={};_0x8bf79b[_0x179bd6]={'$like':'%'+_0x564fd5['query'][_0x04ad('0x4e')]+'%'};return _0x8bf79b;})});}_0x9f1c83=_[_0x04ad('0x4f')]({},_0x9f1c83,_0x564fd5[_0x04ad('0x58')]);return db[_0x04ad('0x62')][_0x04ad('0x30')]({'where':_0x9f1c83[_0x04ad('0x4c')]})['then'](function(_0x2ddef9){_0x4f3cc3[_0x04ad('0x30')]=_0x2ddef9;if(_0x564fd5['query'][_0x04ad('0x51')]){_0x9f1c83['include']=[{'all':!![]}];}return db['Disposition'][_0x04ad('0x53')](_0x9f1c83);})[_0x04ad('0x1f')](function(_0x4fa101){_0x4f3cc3[_0x04ad('0x54')]=_0x4fa101;return _0x4f3cc3;});}})[_0x04ad('0x1f')](respondWithFilteredResult(_0x118c4d,_0x9f1c83))[_0x04ad('0x2a')](handleError(_0x118c4d,null));};exports['removeDispositions']=function(_0x3335b8,_0x38cdb2,_0x14777c){return db['OpenchannelAccount'][_0x04ad('0x5e')]({'where':{'id':_0x3335b8[_0x04ad('0x56')]['id']}})['then'](handleEntityNotFound(_0x38cdb2,null))['then'](function(_0x422dde){if(_0x422dde){return _0x422dde[_0x04ad('0x67')](_0x3335b8[_0x04ad('0x44')]['ids']);}})[_0x04ad('0x1f')](respondWithStatusCode(_0x38cdb2,null))['catch'](handleError(_0x38cdb2,null));};exports[_0x04ad('0x68')]=function(_0x2fab13,_0x2cd2a4,_0xfb8c20){if(_0x2fab13['body']['id']){delete _0x2fab13[_0x04ad('0x5a')]['id'];}return db[_0x04ad('0x3f')][_0x04ad('0x5e')]({'where':{'id':_0x2fab13['params']['id']}})[_0x04ad('0x1f')](handleEntityNotFound(_0x2cd2a4,null))['then'](function(_0x3ed4d5){if(_0x3ed4d5){_0x2fab13[_0x04ad('0x5a')][_0x04ad('0x61')]=_0x3ed4d5['id'];return db[_0x04ad('0x69')][_0x04ad('0x59')](_0x2fab13[_0x04ad('0x5a')]);}})[_0x04ad('0x1f')](respondWithResult(_0x2cd2a4,null))[_0x04ad('0x2a')](handleError(_0x2cd2a4,null));};exports[_0x04ad('0x6a')]=function(_0x5b1af4,_0x14ce94,_0x6a8c9d){var _0x1ef243={'raw':![],'where':{}};var _0x56f1e2={};var _0x195865={'count':0x0,'rows':[]};return db[_0x04ad('0x3f')][_0x04ad('0x64')]({'where':{'id':_0x5b1af4[_0x04ad('0x56')]['id']}})[_0x04ad('0x1f')](handleEntityNotFound(_0x14ce94,null))['then'](function(_0x32654f){if(_0x32654f){_0x56f1e2[_0x04ad('0x42')]=_[_0x04ad('0x45')](db[_0x04ad('0x69')]['rawAttributes']);_0x56f1e2[_0x04ad('0x44')]=_['keys'](_0x5b1af4[_0x04ad('0x44')]);_0x56f1e2['filters']=_['intersection'](_0x56f1e2[_0x04ad('0x42')],_0x56f1e2['query']);_0x1ef243[_0x04ad('0x48')]=_[_0x04ad('0x47')](_0x56f1e2['model'],qs[_0x04ad('0x49')](_0x5b1af4['query']['fields']));_0x1ef243['attributes']=_0x1ef243[_0x04ad('0x48')][_0x04ad('0x57')]?_0x1ef243[_0x04ad('0x48')]:_0x56f1e2['model'];if(!_0x5b1af4['query'][_0x04ad('0x4a')](_0x04ad('0x65'))){_0x1ef243[_0x04ad('0x31')]=qs[_0x04ad('0x31')](_0x5b1af4[_0x04ad('0x44')][_0x04ad('0x31')]);_0x1ef243[_0x04ad('0x2e')]=qs[_0x04ad('0x2e')](_0x5b1af4[_0x04ad('0x44')][_0x04ad('0x2e')]);}_0x1ef243['order']=qs[_0x04ad('0x4b')](_0x5b1af4['query'][_0x04ad('0x4b')]);_0x1ef243[_0x04ad('0x4c')]=qs[_0x04ad('0x46')](_[_0x04ad('0x4d')](_0x5b1af4[_0x04ad('0x44')],_0x56f1e2[_0x04ad('0x46')]));_0x1ef243[_0x04ad('0x4c')]['OpenchannelAccountId']=_0x32654f['id'];if(_0x5b1af4[_0x04ad('0x44')][_0x04ad('0x4e')]){_0x1ef243['where']=_[_0x04ad('0x4f')](_0x1ef243[_0x04ad('0x4c')],{'$or':_['map'](_0x1ef243[_0x04ad('0x48')],function(_0x1e6287){var _0x260d14={};_0x260d14[_0x1e6287]={'$like':'%'+_0x5b1af4[_0x04ad('0x44')][_0x04ad('0x4e')]+'%'};return _0x260d14;})});}_0x1ef243=_[_0x04ad('0x4f')]({},_0x1ef243,_0x5b1af4[_0x04ad('0x58')]);return db[_0x04ad('0x69')]['count']({'where':_0x1ef243[_0x04ad('0x4c')]})['then'](function(_0x406a09){_0x195865['count']=_0x406a09;if(_0x5b1af4[_0x04ad('0x44')][_0x04ad('0x51')]){_0x1ef243[_0x04ad('0x52')]=[{'all':!![]}];}return db[_0x04ad('0x69')]['findAll'](_0x1ef243);})['then'](function(_0x162e33){_0x195865[_0x04ad('0x54')]=_0x162e33;return _0x195865;});}})[_0x04ad('0x1f')](respondWithFilteredResult(_0x14ce94,_0x1ef243))['catch'](handleError(_0x14ce94,null));};exports[_0x04ad('0x6b')]=function(_0x24f5d0,_0x558f4f,_0x47ecbb){return db[_0x04ad('0x3f')][_0x04ad('0x5e')]({'where':{'id':_0x24f5d0[_0x04ad('0x56')]['id']}})[_0x04ad('0x1f')](handleEntityNotFound(_0x558f4f,null))[_0x04ad('0x1f')](function(_0x2c2fd2){if(_0x2c2fd2){return _0x2c2fd2[_0x04ad('0x6b')](_0x24f5d0['query'][_0x04ad('0x6c')]);}})[_0x04ad('0x1f')](respondWithStatusCode(_0x558f4f,null))[_0x04ad('0x2a')](handleError(_0x558f4f,null));};exports[_0x04ad('0x6d')]=function(_0x7317e7,_0x10e251,_0x182cbf){var _0x2e8584={'body':_0x7317e7[_0x04ad('0x5a')],'channel':_0x04ad('0x6e')};var _0x471c7b=[];var _0x34dc84=[];var _0x4f032f={};var _0x53730d=![];return db['CmContact'][_0x04ad('0x5f')]()[_0x04ad('0x1f')](function(_0x313a5e){if(!_0x313a5e){throw new db['Sequelize'][(_0x04ad('0x6f'))](_0x04ad('0x70'));}_0x471c7b=_['difference'](_[_0x04ad('0x45')](_0x313a5e),[_0x04ad('0x71'),_0x04ad('0x72')]);_0x34dc84=_[_0x04ad('0x73')](_[_0x04ad('0x45')](_0x313a5e),['createdAt','updatedAt',_0x04ad('0x74'),_0x04ad('0x75')]);if(_0x7317e7[_0x04ad('0x5a')]['id']){delete _0x7317e7[_0x04ad('0x5a')]['id'];}if(_[_0x04ad('0x76')](_0x7317e7[_0x04ad('0x5a')][_0x04ad('0x77')])){throw new db[(_0x04ad('0x78'))][(_0x04ad('0x6f'))](_0x04ad('0x79'));}if(_[_0x04ad('0x76')](_0x7317e7[_0x04ad('0x5a')][_0x04ad('0x5a')])||_0x7317e7['body'][_0x04ad('0x5a')]===''){throw new db[(_0x04ad('0x78'))][(_0x04ad('0x6f'))](_0x04ad('0x7a'));}if(_[_0x04ad('0x76')](_0x7317e7['body'][_0x04ad('0x7b')])){throw new db[(_0x04ad('0x78'))]['ValidationError'](_0x04ad('0x7c')+_0x34dc84);}if(!_['includes'](_0x34dc84,_0x7317e7[_0x04ad('0x5a')][_0x04ad('0x7b')])){throw new db[(_0x04ad('0x78'))][(_0x04ad('0x6f'))](_0x04ad('0x7d')+_0x34dc84);}_0x4f032f[_0x7317e7[_0x04ad('0x5a')][_0x04ad('0x7b')]]=_0x7317e7[_0x04ad('0x5a')][_0x04ad('0x77')];})[_0x04ad('0x1f')](function(){return db[_0x04ad('0x3f')]['find']({'where':{'id':_0x7317e7[_0x04ad('0x56')]['id']},'include':[{'model':db[_0x04ad('0x7e')],'as':_0x04ad('0x7f'),'include':[{'model':db[_0x04ad('0x80')],'as':_0x04ad('0x81'),'where':_0x4f032f,'limit':0x1,'order':[[_0x04ad('0x72'),'DESC']]}]},{'model':db[_0x04ad('0x82')],'as':_0x04ad('0x83')}]});})[_0x04ad('0x1f')](handleEntityNotFound(_0x10e251,null))[_0x04ad('0x1f')](function(_0x4efcb0){if(_0x4efcb0&&_0x4efcb0['List']){_0x2e8584['account']=_0x4efcb0;_0x2e8584[_0x04ad('0x84')]=_0x4efcb0['Applications'];_0x2e8584[_0x04ad('0x85')]=_0x4efcb0[_0x04ad('0x7f')];_0x2e8584[_0x04ad('0x84')]=_[_0x04ad('0x86')](_0x2e8584['applications'],[_0x04ad('0x87')],[_0x04ad('0x88')]);if(_0x2e8584[_0x04ad('0x89')]['Applications']){delete _0x2e8584[_0x04ad('0x89')][_0x04ad('0x83')];}if(_0x2e8584['account'][_0x04ad('0x7f')]&&_0x2e8584[_0x04ad('0x89')]['List'][_0x04ad('0x81')][_0x04ad('0x57')]){return _0x2e8584[_0x04ad('0x89')][_0x04ad('0x7f')][_0x04ad('0x81')][0x0];}var _0x1feaa4=_[_0x04ad('0x19')](_0x7317e7[_0x04ad('0x5a')],{'firstName':_0x7317e7[_0x04ad('0x5a')][_0x04ad('0x77')],'ListId':_0x4efcb0[_0x04ad('0x75')]});_0x1feaa4[_0x7317e7['body'][_0x04ad('0x7b')]]=_0x7317e7[_0x04ad('0x5a')][_0x04ad('0x77')];return db['CmContact'][_0x04ad('0x59')](_0x1feaa4,{'fields':_0x471c7b,'raw':!![]});}})[_0x04ad('0x1f')](handleEntityNotFound(_0x10e251,null))[_0x04ad('0x1f')](function(_0x585e92){_0x2e8584[_0x04ad('0x8a')]=_0x585e92;if(_0x585e92){var _0x1b2b36={'ContactId':_0x585e92['id'],'OpenchannelAccountId':_0x7317e7['params']['id'],'from':(_0x585e92[_0x04ad('0x8b')]||'')+'\x20'+(_0x585e92[_0x04ad('0x8c')]||'')};var _0xf52956={'OpenchannelAccountId':_0x7317e7[_0x04ad('0x56')]['id'],'closed':![]};if(_0x7317e7[_0x04ad('0x5a')]['threadId']){_0xf52956['threadId']=_0x7317e7['body'][_0x04ad('0x8d')];return db['OpenchannelInteraction'][_0x04ad('0x5e')]({'where':_0xf52956})[_0x04ad('0x1f')](function(_0x258e5b){if(_0x258e5b){return[_0x258e5b,![]];}_0x1b2b36[_0x04ad('0x8d')]=_0x7317e7['body']['threadId'];_0x1b2b36[_0x04ad('0x8e')]=_0x7317e7['body']['externalUrl'];return db[_0x04ad('0x8f')][_0x04ad('0x59')](_0x1b2b36)[_0x04ad('0x1f')](function(_0x36b93f){return[_0x36b93f,!![]];});});}else{_0xf52956[_0x04ad('0x8d')]=null;}_0xf52956['ContactId']=_0x585e92['id'];return db[_0x04ad('0x8f')][_0x04ad('0x5e')]({'where':_0xf52956})[_0x04ad('0x1f')](function(_0xdd0318){if(_0xdd0318){return[_0xdd0318,![]];}return db[_0x04ad('0x8f')][_0x04ad('0x59')](_0x1b2b36)[_0x04ad('0x1f')](function(_0x549610){return[_0x549610,!![]];});});}})['spread'](function(_0x5bb709,_0x4ffc27){if(_0x5bb709){_0x53730d=_0x4ffc27;if(!_0x4ffc27){var _0x2fb5ba={'from':(_0x2e8584['contact']['firstName']||'')+'\x20'+(_0x2e8584[_0x04ad('0x8a')][_0x04ad('0x8c')]||'')};if(_0x7317e7[_0x04ad('0x5a')]['threadId']&&_0x7317e7[_0x04ad('0x5a')]['messageId']&&_0x7317e7['body'][_0x04ad('0x8d')]!=_0x7317e7['body'][_0x04ad('0x90')]){_0x2fb5ba[_0x04ad('0x8d')]=_0x7317e7[_0x04ad('0x5a')][_0x04ad('0x90')];}return _0x5bb709[_0x04ad('0x36')](_0x2fb5ba);}else{return _0x5bb709;}}})[_0x04ad('0x1f')](function(_0x7d5d40){_0x2e8584[_0x04ad('0x91')]=_0x7d5d40[_0x04ad('0x38')]({'plain':!![]});_0x2e8584[_0x04ad('0x91')][_0x04ad('0x92')]=_0x53730d;if(_0x2e8584['interaction'][_0x04ad('0x92')]){if(_0x2e8584[_0x04ad('0x89')][_0x04ad('0x93')]){_0x2e8584[_0x04ad('0x84')][_0x04ad('0x94')]({'id':0x0,'priority':_0x2e8584['applications'][_0x04ad('0x57')]+0x1,'app':_0x04ad('0x95'),'appdata':_0x04ad('0x96'),'interval':_0x04ad('0x97')});}}return db[_0x04ad('0x98')][_0x04ad('0x59')]({'body':_0x7317e7[_0x04ad('0x5a')][_0x04ad('0x5a')],'OpenchannelAccountId':_0x7317e7[_0x04ad('0x56')]['id'],'OpenchannelInteractionId':_0x7d5d40['id'],'direction':'in','ContactId':_0x2e8584[_0x04ad('0x8a')]['id'],'AttachmentId':_0x7317e7[_0x04ad('0x5a')][_0x04ad('0x99')]});})['then'](function(_0x1fd4ff){_0x2e8584[_0x04ad('0x27')]=_0x1fd4ff;if(_0x2e8584[_0x04ad('0x91')]['UserId']){return db[_0x04ad('0x9a')][_0x04ad('0x5e')]({'attributes':['id',_0x04ad('0x3b')],'where':{'id':_0x2e8584[_0x04ad('0x91')][_0x04ad('0x9b')]}})['then'](function(_0x1aa1c6){if(_0x1aa1c6){_0x2e8584[_0x04ad('0x84')][_0x04ad('0x9c')]({'id':0x0,'priority':0x0,'app':_0x04ad('0x9d'),'appdata':_0x1aa1c6['name']+','+(_0x2e8584[_0x04ad('0x89')][_0x04ad('0x9e')]||0xa),'interval':_0x04ad('0x97')});_0x2e8584[_0x04ad('0x9f')]=![];}return respondWithRpcPromise(_0x04ad('0xa0'),_0x04ad('0xa1'),_0x2e8584);});}return respondWithRpcPromise(_0x04ad('0xa0'),'startRouting',_0x2e8584);})[_0x04ad('0x1f')](function(_0x1d24aa){respondWithRpcPromise(_0x04ad('0xa2'),_0x04ad('0xa2'),{'event':'notify','message':_0x1d24aa},client9002);return _0x1d24aa;})[_0x04ad('0x1f')](respondWithResult(_0x10e251,null))[_0x04ad('0x2a')](handleError(_0x10e251,null));};exports[_0x04ad('0xa3')]=function(_0x5cd8ea,_0x52a7f4,_0x4191d7){return db['OpenchannelAccount'][_0x04ad('0x64')]({'where':{'id':_0x5cd8ea[_0x04ad('0x56')]['id']}})['then'](handleEntityNotFound(_0x52a7f4,null))[_0x04ad('0x1f')](function(_0x41b234){if(_0x41b234){return db[_0x04ad('0xa4')][_0x04ad('0xa5')](function(_0x7e5142){return db[_0x04ad('0x82')][_0x04ad('0x37')]({'where':{'OpenchannelAccountId':_0x5cd8ea['params']['id']},'transaction':_0x7e5142})['then'](function(_0x99b72){var _0x35bd13=_['map'](_0x5cd8ea[_0x04ad('0x5a')],function(_0x10cbb7){_0x10cbb7['OpenchannelAccountId']=_0x5cd8ea['params']['id'];return _0x10cbb7;});return db[_0x04ad('0x82')][_0x04ad('0xa6')](_0x35bd13,{'transaction':_0x7e5142});});})[_0x04ad('0x1f')](function(){return db[_0x04ad('0x82')][_0x04ad('0xa7')]({'where':{'OpenchannelAccountId':_0x5cd8ea[_0x04ad('0x56')]['id']},'order':_0x04ad('0x87')});});}})[_0x04ad('0x1f')](respondWithResult(_0x52a7f4,null))[_0x04ad('0x2a')](handleError(_0x52a7f4,null));};exports['getApplications']=function(_0x41ae40,_0x3d4a14,_0x1d21f9){var _0x4f915f={};var _0x132e19={};var _0x40b484;var _0x3358c6;return db[_0x04ad('0x3f')]['findOne']({'where':{'id':_0x41ae40[_0x04ad('0x56')]['id']}})[_0x04ad('0x1f')](handleEntityNotFound(_0x3d4a14,null))[_0x04ad('0x1f')](function(_0x321c32){if(_0x321c32){_0x40b484=_0x321c32;_0x132e19[_0x04ad('0x42')]=_[_0x04ad('0x45')](db[_0x04ad('0x82')]['rawAttributes']);_0x132e19[_0x04ad('0x44')]=_[_0x04ad('0x45')](_0x41ae40['query']);_0x132e19['filters']=_[_0x04ad('0x47')](_0x132e19[_0x04ad('0x42')],_0x132e19['query']);_0x4f915f['attributes']=_[_0x04ad('0x47')](_0x132e19[_0x04ad('0x42')],qs['fields'](_0x41ae40[_0x04ad('0x44')]['fields']));_0x4f915f['attributes']=_0x4f915f['attributes'][_0x04ad('0x57')]?_0x4f915f[_0x04ad('0x48')]:_0x132e19[_0x04ad('0x42')];_0x4f915f[_0x04ad('0x66')]=qs[_0x04ad('0x4b')](_0x41ae40[_0x04ad('0x44')][_0x04ad('0x4b')]);_0x4f915f[_0x04ad('0x4c')]=qs[_0x04ad('0x46')](_[_0x04ad('0x4d')](_0x41ae40[_0x04ad('0x44')],_0x132e19['filters']));if(_0x41ae40['query'][_0x04ad('0x4e')]){_0x4f915f[_0x04ad('0x4c')]=_[_0x04ad('0x4f')](_0x4f915f['where'],{'$or':_[_0x04ad('0x43')](_0x4f915f[_0x04ad('0x48')],function(_0x254067){var _0x16558e={};_0x16558e[_0x254067]={'$like':'%'+_0x41ae40[_0x04ad('0x44')][_0x04ad('0x4e')]+'%'};return _0x16558e;})});}_0x4f915f=_[_0x04ad('0x4f')]({},_0x4f915f,_0x41ae40[_0x04ad('0x58')]);return _0x40b484[_0x04ad('0xa8')](_0x4f915f);}})[_0x04ad('0x1f')](function(_0x30d067){if(_0x30d067){_0x3358c6=_0x30d067[_0x04ad('0x57')];if(!_0x41ae40[_0x04ad('0x44')]['hasOwnProperty']('nolimit')){_0x4f915f[_0x04ad('0x31')]=qs[_0x04ad('0x31')](_0x41ae40[_0x04ad('0x44')][_0x04ad('0x31')]);_0x4f915f[_0x04ad('0x2e')]=qs[_0x04ad('0x2e')](_0x41ae40[_0x04ad('0x44')][_0x04ad('0x2e')]);}return _0x40b484[_0x04ad('0xa8')](_0x4f915f);}})['then'](function(_0x291c48){if(_0x291c48){return _0x291c48?{'count':_0x3358c6,'rows':_0x291c48}:null;}})[_0x04ad('0x1f')](respondWithResult(_0x3d4a14,null))[_0x04ad('0x2a')](handleError(_0x3d4a14,null));};exports['getInteractions']=function(_0x3154be,_0x3e1d5a,_0x2df462){var _0x12d89e={'raw':![],'where':{}};var _0x30c28c={};var _0x56d825={'count':0x0,'rows':[]};return db[_0x04ad('0x3f')][_0x04ad('0x64')]({'where':{'id':_0x3154be[_0x04ad('0x56')]['id']}})[_0x04ad('0x1f')](handleEntityNotFound(_0x3e1d5a,null))[_0x04ad('0x1f')](function(_0x3b0e61){if(_0x3b0e61){_0x30c28c[_0x04ad('0x42')]=_[_0x04ad('0x45')](db[_0x04ad('0x8f')][_0x04ad('0xa9')]);_0x30c28c[_0x04ad('0x44')]=_[_0x04ad('0x45')](_0x3154be[_0x04ad('0x44')]);_0x30c28c['filters']=_[_0x04ad('0x47')](_0x30c28c[_0x04ad('0x42')],_0x30c28c[_0x04ad('0x44')]);_0x12d89e['attributes']=_[_0x04ad('0x47')](_0x30c28c[_0x04ad('0x42')],qs['fields'](_0x3154be['query'][_0x04ad('0x49')]));_0x12d89e[_0x04ad('0x48')]=_0x12d89e[_0x04ad('0x48')]['length']?_0x12d89e['attributes']:_0x30c28c[_0x04ad('0x42')];if(!_0x3154be['query']['hasOwnProperty'](_0x04ad('0x65'))){_0x12d89e[_0x04ad('0x31')]=qs[_0x04ad('0x31')](_0x3154be[_0x04ad('0x44')][_0x04ad('0x31')]);_0x12d89e[_0x04ad('0x2e')]=qs[_0x04ad('0x2e')](_0x3154be['query'][_0x04ad('0x2e')]);}_0x12d89e[_0x04ad('0x66')]=qs[_0x04ad('0x4b')](_0x3154be['query']['sort']);_0x12d89e[_0x04ad('0x4c')]=qs['filters'](_[_0x04ad('0x4d')](_0x3154be['query'],_0x30c28c[_0x04ad('0x46')]));_0x12d89e['where'][_0x04ad('0x61')]=_0x3b0e61['id'];if(_0x3154be[_0x04ad('0x44')][_0x04ad('0x4e')]){_0x12d89e[_0x04ad('0x4c')]=_[_0x04ad('0x4f')](_0x12d89e[_0x04ad('0x4c')],{'$or':_[_0x04ad('0x43')](_0x12d89e[_0x04ad('0x48')],function(_0x3e0248){var _0x56bd63={};_0x56bd63[_0x3e0248]={'$like':'%'+_0x3154be[_0x04ad('0x44')][_0x04ad('0x4e')]+'%'};return _0x56bd63;})});}_0x12d89e=_[_0x04ad('0x4f')]({},_0x12d89e,_0x3154be[_0x04ad('0x58')]);return db[_0x04ad('0x8f')]['count']({'where':_0x12d89e[_0x04ad('0x4c')]})[_0x04ad('0x1f')](function(_0x4d9436){_0x56d825['count']=_0x4d9436;if(_0x3154be['query'][_0x04ad('0x51')]){_0x12d89e[_0x04ad('0x52')]=[{'model':db[_0x04ad('0x80')],'as':_0x04ad('0xaa'),'required':![]},{'model':db['User'],'as':_0x04ad('0xab'),'attributes':['name','fullname',_0x04ad('0xac')],'required':![]},{'model':db['Tag'],'as':_0x04ad('0xad'),'attributes':['id',_0x04ad('0x3b'),'color'],'where':_0x3154be[_0x04ad('0x44')][_0x04ad('0xae')]?{'id':_0x3154be['query'][_0x04ad('0xae')]}:undefined,'required':_0x3154be[_0x04ad('0x44')][_0x04ad('0xae')]?!![]:![]}];}return db[_0x04ad('0x8f')][_0x04ad('0x53')](_0x12d89e);})[_0x04ad('0x1f')](function(_0x2a35a4){_0x56d825['rows']=_0x2a35a4;return _0x56d825;});}})[_0x04ad('0x1f')](respondWithFilteredResult(_0x3e1d5a,_0x12d89e))[_0x04ad('0x2a')](handleError(_0x3e1d5a,null));};exports[_0x04ad('0xaf')]=function(_0x1b2aef,_0xa0ec83,_0x2dde43){return db[_0x04ad('0x3f')][_0x04ad('0x5e')]({'where':{'id':_0x1b2aef['params']['id']}})['then'](handleEntityNotFound(_0xa0ec83,null))[_0x04ad('0x1f')](function(_0x444fdc){if(_0x444fdc){return _0x444fdc['addAgents'](_0x1b2aef[_0x04ad('0x5a')][_0x04ad('0x6c')],_[_0x04ad('0xb0')](_0x1b2aef[_0x04ad('0x5a')],['ids','id'])||{})[_0x04ad('0xb1')](function(_0x5e0d6f){for(var _0x31f676=0x0;_0x31f676<_0x1b2aef['body'][_0x04ad('0x6c')][_0x04ad('0x57')];_0x31f676+=0x1){socket[_0x04ad('0xb2')]('userOpenchannelAccount:save',{'UserId':Number(_0x1b2aef[_0x04ad('0x5a')][_0x04ad('0x6c')][_0x31f676]),'OpenchannelAccountId':Number(_0x1b2aef['params']['id'])});}return _0x5e0d6f;});}})['then'](respondWithResult(_0xa0ec83,null))[_0x04ad('0x2a')](handleError(_0xa0ec83,null));};exports[_0x04ad('0xb3')]=function(_0x2fa267,_0x4f69b7,_0x1eef05){return db[_0x04ad('0x3f')][_0x04ad('0x5e')]({'where':{'id':_0x2fa267[_0x04ad('0x56')]['id']}})['then'](handleEntityNotFound(_0x4f69b7,null))[_0x04ad('0x1f')](function(_0x324d87){if(_0x324d87){return _0x324d87['removeAgents'](_0x2fa267['query']['ids'])[_0x04ad('0x1f')](function(){if(_['isArray'](_0x2fa267[_0x04ad('0x44')][_0x04ad('0x6c')])){for(var _0x48cd5e=0x0;_0x48cd5e<_0x2fa267[_0x04ad('0x44')]['ids']['length'];_0x48cd5e+=0x1){socket['emit'](_0x04ad('0xb4'),{'UserId':Number(_0x2fa267[_0x04ad('0x44')][_0x04ad('0x6c')][_0x48cd5e]),'OpenchannelAccountId':Number(_0x2fa267[_0x04ad('0x56')]['id'])});}}else{socket[_0x04ad('0xb2')](_0x04ad('0xb4'),{'UserId':Number(_0x2fa267[_0x04ad('0x44')][_0x04ad('0x6c')]),'OpenchannelAccountId':Number(_0x2fa267['params']['id'])});}});}})[_0x04ad('0x1f')](respondWithStatusCode(_0x4f69b7,null))[_0x04ad('0x2a')](handleError(_0x4f69b7,null));};exports[_0x04ad('0xb5')]=function(_0x3cd341,_0x51edf1,_0x22f24a){var _0x18a411={};var _0x2d7be5={};var _0x283e2c;var _0x32e53c;return db[_0x04ad('0x3f')]['findOne']({'where':{'id':_0x3cd341[_0x04ad('0x56')]['id']}})[_0x04ad('0x1f')](handleEntityNotFound(_0x51edf1,null))[_0x04ad('0x1f')](function(_0x3bdb92){if(_0x3bdb92){_0x283e2c=_0x3bdb92;_0x2d7be5[_0x04ad('0x42')]=_['keys'](db[_0x04ad('0x9a')][_0x04ad('0xa9')]);_0x2d7be5[_0x04ad('0x44')]=_[_0x04ad('0x45')](_0x3cd341[_0x04ad('0x44')]);_0x2d7be5[_0x04ad('0x46')]=_[_0x04ad('0x47')](_0x2d7be5[_0x04ad('0x42')],_0x2d7be5[_0x04ad('0x44')]);_0x18a411[_0x04ad('0x48')]=_['intersection'](_0x2d7be5[_0x04ad('0x42')],qs[_0x04ad('0x49')](_0x3cd341[_0x04ad('0x44')][_0x04ad('0x49')]));_0x18a411[_0x04ad('0x48')]=_0x18a411[_0x04ad('0x48')][_0x04ad('0x57')]?_0x18a411[_0x04ad('0x48')]:_0x2d7be5[_0x04ad('0x42')];_0x18a411[_0x04ad('0x66')]=qs[_0x04ad('0x4b')](_0x3cd341[_0x04ad('0x44')][_0x04ad('0x4b')]);_0x18a411[_0x04ad('0x4c')]=qs[_0x04ad('0x46')](_[_0x04ad('0x4d')](_0x3cd341[_0x04ad('0x44')],_0x2d7be5[_0x04ad('0x46')]));if(_0x3cd341[_0x04ad('0x44')]['filter']){_0x18a411[_0x04ad('0x4c')]=_[_0x04ad('0x4f')](_0x18a411[_0x04ad('0x4c')],{'$or':_[_0x04ad('0x43')](_0x18a411[_0x04ad('0x48')],function(_0x1a804f){var _0x56ad92={};_0x56ad92[_0x1a804f]={'$like':'%'+_0x3cd341['query'][_0x04ad('0x4e')]+'%'};return _0x56ad92;})});}_0x18a411=_[_0x04ad('0x4f')]({},_0x18a411,_0x3cd341[_0x04ad('0x58')]);return _0x283e2c[_0x04ad('0xb5')](_0x18a411);}})[_0x04ad('0x1f')](function(_0x3c0b3b){if(_0x3c0b3b){_0x32e53c=_0x3c0b3b[_0x04ad('0x57')];if(!_0x3cd341[_0x04ad('0x44')][_0x04ad('0x4a')](_0x04ad('0x65'))){_0x18a411[_0x04ad('0x31')]=qs['limit'](_0x3cd341[_0x04ad('0x44')][_0x04ad('0x31')]);_0x18a411['offset']=qs['offset'](_0x3cd341[_0x04ad('0x44')][_0x04ad('0x2e')]);}return _0x283e2c[_0x04ad('0xb5')](_0x18a411);}})[_0x04ad('0x1f')](function(_0x5baebb){if(_0x5baebb){return _0x5baebb?{'count':_0x32e53c,'rows':_0x5baebb}:null;}})[_0x04ad('0x1f')](respondWithResult(_0x51edf1,null))['catch'](handleError(_0x51edf1,null));};exports[_0x04ad('0xb6')]=function(_0x1ec568,_0x191093,_0x538a83){var _0x50dfcb,_0x479c79,_0xce3c64;if(_[_0x04ad('0x76')](_0x1ec568['body']['body'])||_0x1ec568[_0x04ad('0x5a')][_0x04ad('0x5a')]===''){throw new db[(_0x04ad('0x78'))][(_0x04ad('0x6f'))](_0x04ad('0x7a'));}if(_[_0x04ad('0x76')](_0x1ec568[_0x04ad('0x5a')]['to'])){}_0x50dfcb=_0x1ec568[_0x04ad('0x5a')]['to'];return db['OpenchannelAccount'][_0x04ad('0x64')]({'where':{'id':_0x1ec568[_0x04ad('0x56')]['id']}})[_0x04ad('0x1f')](handleEntityNotFound(_0x191093,null))['then'](function(_0x235419){if(_0x235419){return db['OpenchannelAccount'][_0x04ad('0x5e')]({'where':{'id':_0x235419['id']},'include':[{'model':db[_0x04ad('0x7e')],'as':'List','include':[{'model':db[_0x04ad('0x80')],'as':'Contacts','where':{[_0x235419[_0x04ad('0x7b')]]:_0x50dfcb},'limit':0x1,'order':[[_0x04ad('0x72'),_0x04ad('0xb7')]]}]}]})['then'](handleEntityNotFound(_0x191093,null))[_0x04ad('0x1f')](function(_0xa03c4b){if(_0xa03c4b&&_0xa03c4b['List']){_0x479c79=_0xa03c4b[_0x04ad('0x38')]({'plain':!![]});if(_0x479c79['List']&&_0x479c79['List'][_0x04ad('0x81')][_0x04ad('0x57')]){return _0x479c79[_0x04ad('0x7f')][_0x04ad('0x81')][0x0];}return db[_0x04ad('0x80')][_0x04ad('0x59')](_['defaults'](_0x1ec568[_0x04ad('0x5a')],{'firstName':_0x50dfcb,[_0xa03c4b[_0x04ad('0x7b')]]:_0x50dfcb,'phone':_0x50dfcb,'ListId':_0x479c79[_0x04ad('0x75')]}));}})['then'](handleEntityNotFound(_0x191093,null))[_0x04ad('0x1f')](function(_0x21656d){if(_0x21656d){_0xce3c64=_0x21656d;return db[_0x04ad('0x8f')]['find']({'where':{'ContactId':_0xce3c64['id'],'closed':![],'OpenchannelAccountId':_0x479c79['id']}})[_0x04ad('0x1f')](function(_0x3550a6){if(_0x3550a6){return[_0x3550a6,![]];}return db['OpenchannelInteraction'][_0x04ad('0x59')]({'UserId':_0x1ec568[_0x04ad('0x5c')]['id'],'ContactId':_0xce3c64['id'],'OpenchannelAccountId':_0x479c79['id'],'lastMsgDirection':_0x04ad('0xb8'),'Messages':[_['merge'](_0x1ec568['body'],{'read':![],'body':_0x1ec568[_0x04ad('0x5a')][_0x04ad('0x5a')],'OpenchannelAccountId':_0x479c79['id'],'UserId':_0x1ec568[_0x04ad('0x5c')]['id'],'ContactId':_0xce3c64['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x04ad('0xb9')}]})[_0x04ad('0x1f')](function(_0x4871a3){return[_0x4871a3,!![]];});});}})[_0x04ad('0xb1')](function(_0x268f41,_0x475b78){if(_0x475b78){return _0x268f41;}return db[_0x04ad('0x98')][_0x04ad('0x59')](_[_0x04ad('0x4f')](_0x1ec568[_0x04ad('0x5a')],{'read':![],'body':_0x1ec568[_0x04ad('0x5a')][_0x04ad('0x5a')],'OpenchannelAccountId':_0x479c79['id'],'OpenchannelInteractionId':_0x268f41['id'],'UserId':_0x1ec568[_0x04ad('0x5c')]['id'],'ContactId':_0xce3c64['id']}))['then'](function(_0x49667f){_0x268f41['dataValues'][_0x04ad('0xb9')]=[];_0x268f41[_0x04ad('0xba')][_0x04ad('0xb9')]['push'](_0x49667f[_0x04ad('0xba')]);return _0x268f41;});});}})[_0x04ad('0x1f')](respondWithResult(_0x191093,null))[_0x04ad('0x2a')](handleError(_0x191093,null));};
\ No newline at end of file
+var _0x9af3=['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/license/util','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','get','OpenchannelAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','fieldName','key','map','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','OpenchannelAccount','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addDisposition','OpenchannelAccountId','Disposition','findOne','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','openchannel','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','orderBy','priority','asc','contact','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','agent','Start','startRouting','EventManager','addApplications','transaction','bulkCreate','getApplications','getInteractions','User','Owner','fullname','Tag','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','CmList','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel'];(function(_0x1c4a3f,_0x2ab7e7){var _0x25a810=function(_0x2b79a4){while(--_0x2b79a4){_0x1c4a3f['push'](_0x1c4a3f['shift']());}};_0x25a810(++_0x2ab7e7);}(_0x9af3,0x173));var _0x39af=function(_0x5d6a3c,_0x3b83d0){_0x5d6a3c=_0x5d6a3c-0x0;var _0x39aae4=_0x9af3[_0x5d6a3c];return _0x39aae4;};'use strict';var emlformat=require(_0x39af('0x0'));var rimraf=require(_0x39af('0x1'));var zipdir=require(_0x39af('0x2'));var jsonpatch=require(_0x39af('0x3'));var rp=require(_0x39af('0x4'));var moment=require(_0x39af('0x5'));var BPromise=require(_0x39af('0x6'));var Mustache=require(_0x39af('0x7'));var util=require(_0x39af('0x8'));var path=require('path');var sox=require(_0x39af('0x9'));var csv=require('to-csv');var ejs=require(_0x39af('0xa'));var fs=require('fs');var fs_extra=require(_0x39af('0xb'));var _=require('lodash');var squel=require(_0x39af('0xc'));var crypto=require(_0x39af('0xd'));var jsforce=require(_0x39af('0xe'));var deskjs=require(_0x39af('0xf'));var toCsv=require(_0x39af('0x10'));var querystring=require(_0x39af('0x11'));var Papa=require(_0x39af('0x12'));var Redis=require(_0x39af('0x13'));var authService=require(_0x39af('0x14'));var qs=require(_0x39af('0x15'));var as=require(_0x39af('0x16'));var hardwareService=require(_0x39af('0x17'));var logger=require(_0x39af('0x18'))(_0x39af('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x39af('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x39af('0x1b')](config[_0x39af('0x1c')],{'host':_0x39af('0x1d'),'port':0x18eb});var socket=require(_0x39af('0x1e'))(new Redis(config[_0x39af('0x1c')]));require(_0x39af('0x1f'))[_0x39af('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0x39af('0x21')][_0x39af('0x22')]({'port':0x232c});var client9002=jayson[_0x39af('0x21')][_0x39af('0x22')]({'port':0x232a});function respondWithRpcPromise(_0xa251c9,_0x178bbe,_0x4e5661,_0x37e2a1){return new BPromise(function(_0x4609cc,_0x453a67){var _0x573001=_0x37e2a1||client;return _0x573001[_0x39af('0x23')](_0xa251c9,_0x4e5661)[_0x39af('0x24')](function(_0x2998d3){logger[_0x39af('0x25')](_0x39af('0x26'),_0x178bbe,'request\x20sent');logger['debug'](_0x39af('0x27'),_0x178bbe,_0x39af('0x28'),JSON[_0x39af('0x29')](_0x2998d3));if(_0x2998d3[_0x39af('0x2a')]){if(_0x2998d3[_0x39af('0x2a')][_0x39af('0x2b')]===0x1f4){logger[_0x39af('0x2a')](_0x39af('0x26'),_0x178bbe,_0x2998d3[_0x39af('0x2a')]['message']);return _0x453a67(_0x2998d3[_0x39af('0x2a')][_0x39af('0x2c')]);}logger[_0x39af('0x2a')](_0x39af('0x26'),_0x178bbe,_0x2998d3[_0x39af('0x2a')][_0x39af('0x2c')]);return _0x4609cc(_0x2998d3[_0x39af('0x2a')][_0x39af('0x2c')]);}else{logger[_0x39af('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x178bbe,_0x39af('0x28'));_0x4609cc(_0x2998d3[_0x39af('0x2d')][_0x39af('0x2c')]);}})[_0x39af('0x2e')](function(_0x3a5208){logger[_0x39af('0x2a')]('OpenchannelAccount,\x20%s,\x20%s',_0x178bbe,_0x3a5208);_0x453a67(_0x3a5208);});});}function respondWithStatusCode(_0x23b1b3,_0x28fb47){_0x28fb47=_0x28fb47||0xcc;return function(_0xf6617b){if(_0xf6617b){return _0x23b1b3[_0x39af('0x2f')](_0x28fb47);}return _0x23b1b3['status'](_0x28fb47)[_0x39af('0x30')]();};}function respondWithResult(_0xd2170c,_0x136c0b){_0x136c0b=_0x136c0b||0xc8;return function(_0x1dd6b4){if(_0x1dd6b4){return _0xd2170c['status'](_0x136c0b)[_0x39af('0x31')](_0x1dd6b4);}};}function respondWithFilteredResult(_0x5d74f2,_0x4e6dba){return function(_0x327f3b){if(_0x327f3b){var _0x3c3fe2=typeof _0x4e6dba[_0x39af('0x32')]===_0x39af('0x33')&&typeof _0x4e6dba[_0x39af('0x34')]==='undefined';var _0x540bfe=_0x327f3b[_0x39af('0x35')];var _0x410ce1=_0x3c3fe2?0x0:_0x4e6dba[_0x39af('0x32')];var _0x5d47fe=_0x3c3fe2?_0x327f3b[_0x39af('0x35')]:_0x4e6dba[_0x39af('0x32')]+_0x4e6dba['limit'];var _0x1a624d;if(_0x5d47fe>=_0x540bfe){_0x5d47fe=_0x540bfe;_0x1a624d=0xc8;}else{_0x1a624d=0xce;}_0x5d74f2[_0x39af('0x36')](_0x1a624d);return _0x5d74f2[_0x39af('0x37')](_0x39af('0x38'),_0x410ce1+'-'+_0x5d47fe+'/'+_0x540bfe)[_0x39af('0x31')](_0x327f3b);}return null;};}function patchUpdates(_0x248667){return function(_0x1aeb43){try{jsonpatch[_0x39af('0x39')](_0x1aeb43,_0x248667,!![]);}catch(_0x6835d6){return BPromise[_0x39af('0x3a')](_0x6835d6);}return _0x1aeb43[_0x39af('0x3b')]();};}function saveUpdates(_0x3d14c2,_0x558952){return function(_0x5bdd9a){if(_0x5bdd9a){return _0x5bdd9a['update'](_0x3d14c2)['then'](function(_0xca48da){return _0xca48da;});}return null;};}function removeEntity(_0x5ac3bc,_0xed7d15){return function(_0x5c7d01){if(_0x5c7d01){return _0x5c7d01['destroy']()['then'](function(){var _0x38c93a=_0x5c7d01[_0x39af('0x3c')]({'plain':!![]});var _0x246b81=_0x39af('0x3d');return db[_0x39af('0x3e')]['destroy']({'where':{'type':_0x246b81,'resourceId':_0x38c93a['id']}})['then'](function(){return _0x5c7d01;});})['then'](function(){_0x5ac3bc[_0x39af('0x36')](0xcc)[_0x39af('0x30')]();});}};}function handleEntityNotFound(_0x3247ff,_0x1d0392){return function(_0x1a3137){if(!_0x1a3137){_0x3247ff[_0x39af('0x2f')](0x194);}return _0x1a3137;};}function handleError(_0x348d41,_0x17e777){_0x17e777=_0x17e777||0x1f4;return function(_0x2eef08){logger[_0x39af('0x2a')](_0x2eef08[_0x39af('0x3f')]);if(_0x2eef08[_0x39af('0x40')]){delete _0x2eef08['name'];}_0x348d41[_0x39af('0x36')](_0x17e777)[_0x39af('0x41')](_0x2eef08);};}exports[_0x39af('0x42')]=function(_0x1995e1,_0x3194e5){var _0x42a8dc={'include':[{'model':db[_0x39af('0x43')],'as':_0x39af('0x44')}]},_0x4d5d96={},_0x2c6396={'count':0x0,'rows':[]};var _0x15afa5=_['map'](db['OpenchannelAccount']['rawAttributes'],function(_0x468280){return{'name':_0x468280[_0x39af('0x45')],'type':_0x468280['type'][_0x39af('0x46')]};});_0x4d5d96['model']=_[_0x39af('0x47')](_0x15afa5,_0x39af('0x40'));_0x4d5d96[_0x39af('0x48')]=_['keys'](_0x1995e1['query']);_0x4d5d96[_0x39af('0x49')]=_['intersection'](_0x4d5d96[_0x39af('0x4a')],_0x4d5d96['query']);_0x42a8dc[_0x39af('0x4b')]=_[_0x39af('0x4c')](_0x4d5d96[_0x39af('0x4a')],qs[_0x39af('0x4d')](_0x1995e1[_0x39af('0x48')][_0x39af('0x4d')]));_0x42a8dc['attributes']=_0x42a8dc[_0x39af('0x4b')][_0x39af('0x4e')]?_0x42a8dc[_0x39af('0x4b')]:_0x4d5d96[_0x39af('0x4a')];if(!_0x1995e1[_0x39af('0x48')][_0x39af('0x4f')](_0x39af('0x50'))){_0x42a8dc[_0x39af('0x34')]=qs[_0x39af('0x34')](_0x1995e1[_0x39af('0x48')][_0x39af('0x34')]);_0x42a8dc[_0x39af('0x32')]=qs[_0x39af('0x32')](_0x1995e1['query'][_0x39af('0x32')]);}_0x42a8dc[_0x39af('0x51')]=qs[_0x39af('0x52')](_0x1995e1[_0x39af('0x48')][_0x39af('0x52')]);_0x42a8dc[_0x39af('0x53')]=qs[_0x39af('0x49')](_[_0x39af('0x54')](_0x1995e1[_0x39af('0x48')],_0x4d5d96['filters']),_0x15afa5);if(_0x1995e1[_0x39af('0x48')][_0x39af('0x55')]){_0x42a8dc[_0x39af('0x53')]=_[_0x39af('0x56')](_0x42a8dc[_0x39af('0x53')],{'$or':_[_0x39af('0x47')](_0x15afa5,function(_0x4f4336){if(_0x4f4336[_0x39af('0x57')]!==_0x39af('0x58')){var _0x5f2c48={};_0x5f2c48[_0x4f4336['name']]={'$like':'%'+_0x1995e1[_0x39af('0x48')][_0x39af('0x55')]+'%'};return _0x5f2c48;}})});}_0x42a8dc=_['merge']({},_0x42a8dc,_0x1995e1[_0x39af('0x59')]);var _0x282e7e={'where':_0x42a8dc[_0x39af('0x53')]};return db[_0x39af('0x5a')][_0x39af('0x35')](_0x282e7e)[_0x39af('0x24')](function(_0x2c628c){_0x2c6396[_0x39af('0x35')]=_0x2c628c;if(_0x1995e1[_0x39af('0x48')][_0x39af('0x5b')]){_0x42a8dc[_0x39af('0x5c')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x39af('0x5d')](_0x42a8dc);})[_0x39af('0x24')](function(_0x37a0ff){_0x2c6396[_0x39af('0x5e')]=_0x37a0ff;return _0x2c6396;})['then'](respondWithFilteredResult(_0x3194e5,_0x42a8dc))['catch'](handleError(_0x3194e5,null));};exports[_0x39af('0x5f')]=function(_0x328bf5,_0x231197){var _0x41be28={'raw':![],'where':{'id':_0x328bf5[_0x39af('0x60')]['id']},'include':[{'model':db['Pause'],'as':_0x39af('0x44')}]},_0x328c40={};_0x328c40['model']=_[_0x39af('0x61')](db[_0x39af('0x5a')][_0x39af('0x62')]);_0x328c40[_0x39af('0x48')]=_['keys'](_0x328bf5[_0x39af('0x48')]);_0x328c40['filters']=_[_0x39af('0x4c')](_0x328c40[_0x39af('0x4a')],_0x328c40[_0x39af('0x48')]);_0x41be28[_0x39af('0x4b')]=_[_0x39af('0x4c')](_0x328c40[_0x39af('0x4a')],qs[_0x39af('0x4d')](_0x328bf5['query'][_0x39af('0x4d')]));_0x41be28['attributes']=_0x41be28[_0x39af('0x4b')]['length']?_0x41be28['attributes']:_0x328c40[_0x39af('0x4a')];if(_0x328bf5['query'][_0x39af('0x5b')]){_0x41be28[_0x39af('0x5c')]=[{'all':!![]}];}_0x41be28=_[_0x39af('0x56')]({},_0x41be28,_0x328bf5[_0x39af('0x59')]);return db[_0x39af('0x5a')][_0x39af('0x63')](_0x41be28)['then'](handleEntityNotFound(_0x231197,null))[_0x39af('0x24')](respondWithResult(_0x231197,null))[_0x39af('0x2e')](handleError(_0x231197,null));};exports['create']=function(_0x32f675,_0xcdc58){return db[_0x39af('0x5a')][_0x39af('0x64')](_0x32f675[_0x39af('0x65')],{})[_0x39af('0x24')](function(_0x455107){var _0x315b5d=_0x32f675[_0x39af('0x66')]['get']({'plain':!![]});if(!_0x315b5d)throw new Error(_0x39af('0x67'));if(_0x315b5d[_0x39af('0x68')]===_0x39af('0x66')){var _0x5e06cf=_0x455107['get']({'plain':!![]});var _0x1f5f59=_0x39af('0x3d');return db[_0x39af('0x69')][_0x39af('0x63')]({'where':{'name':_0x1f5f59,'userProfileId':_0x315b5d[_0x39af('0x6a')]},'raw':!![]})[_0x39af('0x24')](function(_0x13becf){if(_0x13becf&&_0x13becf['autoAssociation']===0x0){return db[_0x39af('0x3e')][_0x39af('0x64')]({'name':_0x5e06cf[_0x39af('0x40')],'resourceId':_0x5e06cf['id'],'type':_0x13becf[_0x39af('0x40')],'sectionId':_0x13becf['id']},{})[_0x39af('0x24')](function(){return _0x455107;});}else{return _0x455107;}})[_0x39af('0x2e')](function(_0x3c9e9d){logger[_0x39af('0x2a')](_0x39af('0x6b'),_0x3c9e9d);throw _0x3c9e9d;});}return _0x455107;})['then'](respondWithResult(_0xcdc58,0xc9))[_0x39af('0x2e')](handleError(_0xcdc58,null));};exports['update']=function(_0x217c26,_0x270972){if(_0x217c26[_0x39af('0x65')]['id']){delete _0x217c26[_0x39af('0x65')]['id'];}return db[_0x39af('0x5a')][_0x39af('0x63')]({'where':{'id':_0x217c26['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x39af('0x24')](handleEntityNotFound(_0x270972,null))['then'](saveUpdates(_0x217c26['body'],null))[_0x39af('0x24')](respondWithResult(_0x270972,null))[_0x39af('0x2e')](handleError(_0x270972,null));};exports[_0x39af('0x6c')]=function(_0x4b9ff1,_0xbd953e){return db['OpenchannelAccount']['find']({'where':{'id':_0x4b9ff1['params']['id']}})[_0x39af('0x24')](handleEntityNotFound(_0xbd953e,null))[_0x39af('0x24')](removeEntity(_0xbd953e,null))[_0x39af('0x2e')](handleError(_0xbd953e,null));};exports[_0x39af('0x6d')]=function(_0x5694ee,_0x112ae6){return db[_0x39af('0x5a')][_0x39af('0x6d')]()['then'](respondWithResult(_0x112ae6,null))[_0x39af('0x2e')](handleError(_0x112ae6,null));};exports[_0x39af('0x6e')]=function(_0xf75020,_0x5f4453,_0xb697f0){if(_0xf75020[_0x39af('0x65')]['id']){delete _0xf75020[_0x39af('0x65')]['id'];}return db[_0x39af('0x5a')][_0x39af('0x63')]({'where':{'id':_0xf75020['params']['id']}})[_0x39af('0x24')](handleEntityNotFound(_0x5f4453,null))[_0x39af('0x24')](function(_0x110cc4){if(_0x110cc4){_0xf75020['body'][_0x39af('0x6f')]=_0x110cc4['id'];return db[_0x39af('0x70')][_0x39af('0x64')](_0xf75020[_0x39af('0x65')]);}})[_0x39af('0x24')](respondWithResult(_0x5f4453,null))['catch'](handleError(_0x5f4453,null));};exports['getDispositions']=function(_0x257dfb,_0x68ff24,_0x3b7960){var _0x45c4a0={'raw':![],'where':{}};var _0x5c0adc={};var _0x2d424={'count':0x0,'rows':[]};return db[_0x39af('0x5a')][_0x39af('0x71')]({'where':{'id':_0x257dfb['params']['id']}})['then'](handleEntityNotFound(_0x68ff24,null))[_0x39af('0x24')](function(_0x5e9093){if(_0x5e9093){_0x5c0adc[_0x39af('0x4a')]=_['keys'](db['Disposition'][_0x39af('0x62')]);_0x5c0adc[_0x39af('0x48')]=_['keys'](_0x257dfb[_0x39af('0x48')]);_0x5c0adc['filters']=_[_0x39af('0x4c')](_0x5c0adc[_0x39af('0x4a')],_0x5c0adc[_0x39af('0x48')]);_0x45c4a0[_0x39af('0x4b')]=_['intersection'](_0x5c0adc['model'],qs['fields'](_0x257dfb[_0x39af('0x48')][_0x39af('0x4d')]));_0x45c4a0[_0x39af('0x4b')]=_0x45c4a0[_0x39af('0x4b')]['length']?_0x45c4a0['attributes']:_0x5c0adc[_0x39af('0x4a')];if(!_0x257dfb[_0x39af('0x48')][_0x39af('0x4f')](_0x39af('0x50'))){_0x45c4a0['limit']=qs[_0x39af('0x34')](_0x257dfb[_0x39af('0x48')][_0x39af('0x34')]);_0x45c4a0[_0x39af('0x32')]=qs['offset'](_0x257dfb[_0x39af('0x48')][_0x39af('0x32')]);}_0x45c4a0[_0x39af('0x51')]=qs[_0x39af('0x52')](_0x257dfb['query']['sort']);_0x45c4a0[_0x39af('0x53')]=qs[_0x39af('0x49')](_['pick'](_0x257dfb[_0x39af('0x48')],_0x5c0adc[_0x39af('0x49')]));_0x45c4a0[_0x39af('0x53')][_0x39af('0x6f')]=_0x5e9093['id'];if(_0x257dfb[_0x39af('0x48')][_0x39af('0x55')]){_0x45c4a0[_0x39af('0x53')]=_[_0x39af('0x56')](_0x45c4a0[_0x39af('0x53')],{'$or':_['map'](_0x45c4a0[_0x39af('0x4b')],function(_0x2b43ec){var _0x19d729={};_0x19d729[_0x2b43ec]={'$like':'%'+_0x257dfb['query'][_0x39af('0x55')]+'%'};return _0x19d729;})});}_0x45c4a0=_[_0x39af('0x56')]({},_0x45c4a0,_0x257dfb[_0x39af('0x59')]);return db[_0x39af('0x70')]['count']({'where':_0x45c4a0['where']})[_0x39af('0x24')](function(_0x2fb8e5){_0x2d424[_0x39af('0x35')]=_0x2fb8e5;if(_0x257dfb[_0x39af('0x48')][_0x39af('0x5b')]){_0x45c4a0[_0x39af('0x5c')]=[{'all':!![]}];}return db[_0x39af('0x70')][_0x39af('0x5d')](_0x45c4a0);})['then'](function(_0x50c7f1){_0x2d424[_0x39af('0x5e')]=_0x50c7f1;return _0x2d424;});}})['then'](respondWithFilteredResult(_0x68ff24,_0x45c4a0))[_0x39af('0x2e')](handleError(_0x68ff24,null));};exports[_0x39af('0x72')]=function(_0x2c5c19,_0x18ce00,_0x3a4751){return db[_0x39af('0x5a')][_0x39af('0x63')]({'where':{'id':_0x2c5c19['params']['id']}})['then'](handleEntityNotFound(_0x18ce00,null))['then'](function(_0x8ca773){if(_0x8ca773){return _0x8ca773[_0x39af('0x72')](_0x2c5c19[_0x39af('0x48')][_0x39af('0x73')]);}})['then'](respondWithStatusCode(_0x18ce00,null))[_0x39af('0x2e')](handleError(_0x18ce00,null));};exports[_0x39af('0x74')]=function(_0xeda21e,_0x9a726b,_0x207e37){if(_0xeda21e[_0x39af('0x65')]['id']){delete _0xeda21e['body']['id'];}return db[_0x39af('0x5a')]['find']({'where':{'id':_0xeda21e[_0x39af('0x60')]['id']}})['then'](handleEntityNotFound(_0x9a726b,null))[_0x39af('0x24')](function(_0x1e4d67){if(_0x1e4d67){_0xeda21e[_0x39af('0x65')][_0x39af('0x6f')]=_0x1e4d67['id'];return db['CannedAnswer'][_0x39af('0x64')](_0xeda21e['body']);}})[_0x39af('0x24')](respondWithResult(_0x9a726b,null))[_0x39af('0x2e')](handleError(_0x9a726b,null));};exports[_0x39af('0x75')]=function(_0x1dc382,_0x1639f4,_0x1c3849){var _0x5a92b8={'raw':![],'where':{}};var _0xc5f00={};var _0x3f4071={'count':0x0,'rows':[]};return db[_0x39af('0x5a')][_0x39af('0x71')]({'where':{'id':_0x1dc382[_0x39af('0x60')]['id']}})[_0x39af('0x24')](handleEntityNotFound(_0x1639f4,null))[_0x39af('0x24')](function(_0x37f594){if(_0x37f594){_0xc5f00[_0x39af('0x4a')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0xc5f00[_0x39af('0x48')]=_[_0x39af('0x61')](_0x1dc382[_0x39af('0x48')]);_0xc5f00['filters']=_[_0x39af('0x4c')](_0xc5f00['model'],_0xc5f00[_0x39af('0x48')]);_0x5a92b8['attributes']=_[_0x39af('0x4c')](_0xc5f00[_0x39af('0x4a')],qs['fields'](_0x1dc382[_0x39af('0x48')][_0x39af('0x4d')]));_0x5a92b8['attributes']=_0x5a92b8[_0x39af('0x4b')]['length']?_0x5a92b8[_0x39af('0x4b')]:_0xc5f00[_0x39af('0x4a')];if(!_0x1dc382[_0x39af('0x48')][_0x39af('0x4f')](_0x39af('0x50'))){_0x5a92b8[_0x39af('0x34')]=qs[_0x39af('0x34')](_0x1dc382[_0x39af('0x48')][_0x39af('0x34')]);_0x5a92b8[_0x39af('0x32')]=qs[_0x39af('0x32')](_0x1dc382['query'][_0x39af('0x32')]);}_0x5a92b8[_0x39af('0x51')]=qs[_0x39af('0x52')](_0x1dc382['query'][_0x39af('0x52')]);_0x5a92b8[_0x39af('0x53')]=qs[_0x39af('0x49')](_[_0x39af('0x54')](_0x1dc382[_0x39af('0x48')],_0xc5f00[_0x39af('0x49')]));_0x5a92b8[_0x39af('0x53')][_0x39af('0x6f')]=_0x37f594['id'];if(_0x1dc382[_0x39af('0x48')][_0x39af('0x55')]){_0x5a92b8[_0x39af('0x53')]=_['merge'](_0x5a92b8[_0x39af('0x53')],{'$or':_[_0x39af('0x47')](_0x5a92b8[_0x39af('0x4b')],function(_0x243e51){var _0x5e2e03={};_0x5e2e03[_0x243e51]={'$like':'%'+_0x1dc382['query'][_0x39af('0x55')]+'%'};return _0x5e2e03;})});}_0x5a92b8=_[_0x39af('0x56')]({},_0x5a92b8,_0x1dc382[_0x39af('0x59')]);return db[_0x39af('0x76')][_0x39af('0x35')]({'where':_0x5a92b8['where']})[_0x39af('0x24')](function(_0x4115fc){_0x3f4071['count']=_0x4115fc;if(_0x1dc382[_0x39af('0x48')][_0x39af('0x5b')]){_0x5a92b8[_0x39af('0x5c')]=[{'all':!![]}];}return db[_0x39af('0x76')][_0x39af('0x5d')](_0x5a92b8);})['then'](function(_0x2f4f5c){_0x3f4071[_0x39af('0x5e')]=_0x2f4f5c;return _0x3f4071;});}})['then'](respondWithFilteredResult(_0x1639f4,_0x5a92b8))[_0x39af('0x2e')](handleError(_0x1639f4,null));};exports[_0x39af('0x77')]=function(_0x3b9200,_0x105a03,_0x19545e){return db[_0x39af('0x5a')][_0x39af('0x63')]({'where':{'id':_0x3b9200[_0x39af('0x60')]['id']}})[_0x39af('0x24')](handleEntityNotFound(_0x105a03,null))['then'](function(_0x181762){if(_0x181762){return _0x181762[_0x39af('0x77')](_0x3b9200[_0x39af('0x48')][_0x39af('0x73')]);}})[_0x39af('0x24')](respondWithStatusCode(_0x105a03,null))[_0x39af('0x2e')](handleError(_0x105a03,null));};exports[_0x39af('0x78')]=function(_0x289336,_0x1bf188,_0x26ecff){var _0x53e3c8={'body':_0x289336['body'],'channel':_0x39af('0x79')};var _0x23ebd8=[];var _0xb2ada0=[];var _0x481d98={};var _0x2e64e4=![];return db[_0x39af('0x7a')]['describe']()['then'](function(_0x2aa20b){if(!_0x2aa20b){throw new db[(_0x39af('0x7b'))]['ValidationError'](_0x39af('0x7c'));}_0x23ebd8=_[_0x39af('0x7d')](_[_0x39af('0x61')](_0x2aa20b),[_0x39af('0x7e'),_0x39af('0x7f')]);_0xb2ada0=_[_0x39af('0x7d')](_[_0x39af('0x61')](_0x2aa20b),[_0x39af('0x7e'),_0x39af('0x7f'),_0x39af('0x80'),_0x39af('0x81')]);if(_0x289336['body']['id']){delete _0x289336[_0x39af('0x65')]['id'];}if(_[_0x39af('0x82')](_0x289336['body']['from'])){throw new db['Sequelize']['ValidationError'](_0x39af('0x83'));}if(_[_0x39af('0x82')](_0x289336[_0x39af('0x65')][_0x39af('0x65')])||_0x289336[_0x39af('0x65')][_0x39af('0x65')]===''){throw new db[(_0x39af('0x7b'))][(_0x39af('0x84'))](_0x39af('0x85'));}if(_[_0x39af('0x82')](_0x289336[_0x39af('0x65')][_0x39af('0x86')])){throw new db[(_0x39af('0x7b'))][(_0x39af('0x84'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xb2ada0);}if(!_[_0x39af('0x87')](_0xb2ada0,_0x289336[_0x39af('0x65')]['mapKey'])){throw new db[(_0x39af('0x7b'))][(_0x39af('0x84'))](_0x39af('0x88')+_0xb2ada0);}_0x481d98[_0x289336['body'][_0x39af('0x86')]]=_0x289336[_0x39af('0x65')][_0x39af('0x89')];})[_0x39af('0x24')](function(){return db['OpenchannelAccount'][_0x39af('0x63')]({'where':{'id':_0x289336[_0x39af('0x60')]['id']},'include':[{'model':db['CmList'],'as':_0x39af('0x8a'),'include':[{'model':db[_0x39af('0x7a')],'as':_0x39af('0x8b'),'where':_0x481d98,'limit':0x1,'order':[[_0x39af('0x7f'),_0x39af('0x8c')]]}]},{'model':db[_0x39af('0x8d')],'as':_0x39af('0x8e')}]});})[_0x39af('0x24')](handleEntityNotFound(_0x1bf188,null))[_0x39af('0x24')](function(_0xc7d4cf){if(_0xc7d4cf&&_0xc7d4cf[_0x39af('0x8a')]){_0x53e3c8[_0x39af('0x8f')]=_0xc7d4cf;_0x53e3c8[_0x39af('0x90')]=_0xc7d4cf[_0x39af('0x8e')];_0x53e3c8['list']=_0xc7d4cf[_0x39af('0x8a')];_0x53e3c8['applications']=_[_0x39af('0x91')](_0x53e3c8[_0x39af('0x90')],[_0x39af('0x92')],[_0x39af('0x93')]);if(_0x53e3c8['account'][_0x39af('0x8e')]){delete _0x53e3c8[_0x39af('0x8f')][_0x39af('0x8e')];}if(_0x53e3c8['account'][_0x39af('0x8a')]&&_0x53e3c8[_0x39af('0x8f')][_0x39af('0x8a')][_0x39af('0x8b')][_0x39af('0x4e')]){return _0x53e3c8['account'][_0x39af('0x8a')][_0x39af('0x8b')][0x0];}var _0xe2249b=_[_0x39af('0x1b')](_0x289336[_0x39af('0x65')],{'firstName':_0x289336[_0x39af('0x65')][_0x39af('0x89')],'ListId':_0xc7d4cf['ListId']});_0xe2249b[_0x289336[_0x39af('0x65')][_0x39af('0x86')]]=_0x289336[_0x39af('0x65')][_0x39af('0x89')];return db[_0x39af('0x7a')][_0x39af('0x64')](_0xe2249b,{'fields':_0x23ebd8,'raw':!![]});}})['then'](handleEntityNotFound(_0x1bf188,null))['then'](function(_0x51b6e7){_0x53e3c8[_0x39af('0x94')]=_0x51b6e7;if(_0x51b6e7){var _0x5c061a={'ContactId':_0x51b6e7['id'],'OpenchannelAccountId':_0x289336[_0x39af('0x60')]['id'],'from':(_0x51b6e7['firstName']||'')+'\x20'+(_0x51b6e7[_0x39af('0x95')]||'')};var _0x2665c7={'OpenchannelAccountId':_0x289336[_0x39af('0x60')]['id'],'closed':![]};if(_0x289336['body'][_0x39af('0x96')]){_0x2665c7[_0x39af('0x96')]=_0x289336[_0x39af('0x65')][_0x39af('0x96')];return db[_0x39af('0x97')][_0x39af('0x63')]({'where':_0x2665c7})['then'](function(_0x592a31){if(_0x592a31){return[_0x592a31,![]];}_0x5c061a[_0x39af('0x96')]=_0x289336[_0x39af('0x65')][_0x39af('0x96')];_0x5c061a[_0x39af('0x98')]=_0x289336['body'][_0x39af('0x98')];return db[_0x39af('0x97')]['create'](_0x5c061a)[_0x39af('0x24')](function(_0xa74de6){return[_0xa74de6,!![]];});});}else{_0x2665c7[_0x39af('0x96')]=null;}_0x2665c7[_0x39af('0x99')]=_0x51b6e7['id'];return db[_0x39af('0x97')][_0x39af('0x63')]({'where':_0x2665c7})[_0x39af('0x24')](function(_0x41f199){if(_0x41f199){return[_0x41f199,![]];}return db[_0x39af('0x97')][_0x39af('0x64')](_0x5c061a)[_0x39af('0x24')](function(_0x272663){return[_0x272663,!![]];});});}})[_0x39af('0x9a')](function(_0x999d8e,_0x1f2044){if(_0x999d8e){_0x2e64e4=_0x1f2044;if(!_0x1f2044){var _0x57ca23={'from':(_0x53e3c8[_0x39af('0x94')]['firstName']||'')+'\x20'+(_0x53e3c8[_0x39af('0x94')][_0x39af('0x95')]||'')};if(_0x289336['body']['threadId']&&_0x289336[_0x39af('0x65')]['messageId']&&_0x289336[_0x39af('0x65')][_0x39af('0x96')]!=_0x289336[_0x39af('0x65')][_0x39af('0x9b')]){_0x57ca23[_0x39af('0x96')]=_0x289336[_0x39af('0x65')]['messageId'];}return _0x999d8e['update'](_0x57ca23);}else{return _0x999d8e;}}})['then'](function(_0x543151){_0x53e3c8['interaction']=_0x543151[_0x39af('0x3c')]({'plain':!![]});_0x53e3c8[_0x39af('0x9c')][_0x39af('0x9d')]=_0x2e64e4;if(_0x53e3c8[_0x39af('0x9c')]['created']){if(_0x53e3c8[_0x39af('0x8f')][_0x39af('0x9e')]){_0x53e3c8[_0x39af('0x90')]['push']({'id':0x0,'priority':_0x53e3c8[_0x39af('0x90')][_0x39af('0x4e')]+0x1,'app':_0x39af('0x9f'),'appdata':_0x39af('0xa0'),'interval':_0x39af('0xa1')});}}return db[_0x39af('0xa2')][_0x39af('0x64')]({'body':_0x289336[_0x39af('0x65')][_0x39af('0x65')],'OpenchannelAccountId':_0x289336['params']['id'],'OpenchannelInteractionId':_0x543151['id'],'direction':'in','ContactId':_0x53e3c8['contact']['id'],'AttachmentId':_0x289336[_0x39af('0x65')][_0x39af('0xa3')]});})[_0x39af('0x24')](function(_0x9a71b0){_0x53e3c8[_0x39af('0x2c')]=_0x9a71b0;if(_0x53e3c8[_0x39af('0x9c')]['UserId']){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x53e3c8['interaction'][_0x39af('0xa4')]}})['then'](function(_0x1de46e){if(_0x1de46e){_0x53e3c8[_0x39af('0x90')][_0x39af('0xa5')]({'id':0x0,'priority':0x0,'app':_0x39af('0xa6'),'appdata':_0x1de46e[_0x39af('0x40')]+','+(_0x53e3c8[_0x39af('0x8f')]['waitForTheAssignedAgent']||0xa),'interval':_0x39af('0xa1')});_0x53e3c8['forcedOwnership']=![];}return respondWithRpcPromise(_0x39af('0xa7'),'startRouting',_0x53e3c8);});}return respondWithRpcPromise(_0x39af('0xa7'),_0x39af('0xa8'),_0x53e3c8);})[_0x39af('0x24')](function(_0x5967a3){respondWithRpcPromise(_0x39af('0xa9'),_0x39af('0xa9'),{'event':_0x39af('0x78'),'message':_0x5967a3},client9002);return _0x5967a3;})[_0x39af('0x24')](respondWithResult(_0x1bf188,null))[_0x39af('0x2e')](handleError(_0x1bf188,null));};exports[_0x39af('0xaa')]=function(_0x2f9949,_0x58c8dc,_0x1fd3e0){return db[_0x39af('0x5a')]['findOne']({'where':{'id':_0x2f9949['params']['id']}})['then'](handleEntityNotFound(_0x58c8dc,null))[_0x39af('0x24')](function(_0x42b97f){if(_0x42b97f){return db['sequelize'][_0x39af('0xab')](function(_0x4afe5b){return db[_0x39af('0x8d')]['destroy']({'where':{'OpenchannelAccountId':_0x2f9949[_0x39af('0x60')]['id']},'transaction':_0x4afe5b})['then'](function(_0xf3b839){var _0x5838d3=_['map'](_0x2f9949[_0x39af('0x65')],function(_0x2aa614){_0x2aa614[_0x39af('0x6f')]=_0x2f9949[_0x39af('0x60')]['id'];return _0x2aa614;});return db[_0x39af('0x8d')][_0x39af('0xac')](_0x5838d3,{'transaction':_0x4afe5b});});})[_0x39af('0x24')](function(){return db[_0x39af('0x8d')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x2f9949[_0x39af('0x60')]['id']},'order':_0x39af('0x92')});});}})[_0x39af('0x24')](respondWithResult(_0x58c8dc,null))[_0x39af('0x2e')](handleError(_0x58c8dc,null));};exports[_0x39af('0xad')]=function(_0x406505,_0x5bdc23,_0x1f2065){var _0x54c3eb={};var _0x2fb8f1={};var _0x368233;var _0x3dd163;return db[_0x39af('0x5a')][_0x39af('0x71')]({'where':{'id':_0x406505[_0x39af('0x60')]['id']}})[_0x39af('0x24')](handleEntityNotFound(_0x5bdc23,null))['then'](function(_0x502b50){if(_0x502b50){_0x368233=_0x502b50;_0x2fb8f1[_0x39af('0x4a')]=_['keys'](db[_0x39af('0x8d')][_0x39af('0x62')]);_0x2fb8f1[_0x39af('0x48')]=_[_0x39af('0x61')](_0x406505[_0x39af('0x48')]);_0x2fb8f1[_0x39af('0x49')]=_['intersection'](_0x2fb8f1['model'],_0x2fb8f1[_0x39af('0x48')]);_0x54c3eb['attributes']=_[_0x39af('0x4c')](_0x2fb8f1['model'],qs[_0x39af('0x4d')](_0x406505['query']['fields']));_0x54c3eb[_0x39af('0x4b')]=_0x54c3eb[_0x39af('0x4b')]['length']?_0x54c3eb[_0x39af('0x4b')]:_0x2fb8f1['model'];_0x54c3eb[_0x39af('0x51')]=qs[_0x39af('0x52')](_0x406505[_0x39af('0x48')]['sort']);_0x54c3eb['where']=qs[_0x39af('0x49')](_[_0x39af('0x54')](_0x406505[_0x39af('0x48')],_0x2fb8f1[_0x39af('0x49')]));if(_0x406505['query'][_0x39af('0x55')]){_0x54c3eb[_0x39af('0x53')]=_['merge'](_0x54c3eb[_0x39af('0x53')],{'$or':_['map'](_0x54c3eb[_0x39af('0x4b')],function(_0x1e8623){var _0x1956c6={};_0x1956c6[_0x1e8623]={'$like':'%'+_0x406505[_0x39af('0x48')]['filter']+'%'};return _0x1956c6;})});}_0x54c3eb=_[_0x39af('0x56')]({},_0x54c3eb,_0x406505[_0x39af('0x59')]);return _0x368233[_0x39af('0xad')](_0x54c3eb);}})['then'](function(_0x52ee49){if(_0x52ee49){_0x3dd163=_0x52ee49[_0x39af('0x4e')];if(!_0x406505['query'][_0x39af('0x4f')](_0x39af('0x50'))){_0x54c3eb[_0x39af('0x34')]=qs[_0x39af('0x34')](_0x406505[_0x39af('0x48')][_0x39af('0x34')]);_0x54c3eb['offset']=qs['offset'](_0x406505[_0x39af('0x48')][_0x39af('0x32')]);}return _0x368233[_0x39af('0xad')](_0x54c3eb);}})[_0x39af('0x24')](function(_0x219db6){if(_0x219db6){return _0x219db6?{'count':_0x3dd163,'rows':_0x219db6}:null;}})[_0x39af('0x24')](respondWithResult(_0x5bdc23,null))[_0x39af('0x2e')](handleError(_0x5bdc23,null));};exports[_0x39af('0xae')]=function(_0x4ab1ee,_0x437aa7,_0x443f0b){var _0x1fa4f6={'raw':![],'where':{}};var _0x1119c8={};var _0xb18f68={'count':0x0,'rows':[]};return db[_0x39af('0x5a')]['findOne']({'where':{'id':_0x4ab1ee[_0x39af('0x60')]['id']}})[_0x39af('0x24')](handleEntityNotFound(_0x437aa7,null))[_0x39af('0x24')](function(_0x23895e){if(_0x23895e){_0x1119c8[_0x39af('0x4a')]=_[_0x39af('0x61')](db[_0x39af('0x97')][_0x39af('0x62')]);_0x1119c8['query']=_['keys'](_0x4ab1ee[_0x39af('0x48')]);_0x1119c8['filters']=_[_0x39af('0x4c')](_0x1119c8['model'],_0x1119c8[_0x39af('0x48')]);_0x1fa4f6['attributes']=_['intersection'](_0x1119c8[_0x39af('0x4a')],qs['fields'](_0x4ab1ee[_0x39af('0x48')]['fields']));_0x1fa4f6[_0x39af('0x4b')]=_0x1fa4f6[_0x39af('0x4b')][_0x39af('0x4e')]?_0x1fa4f6[_0x39af('0x4b')]:_0x1119c8[_0x39af('0x4a')];if(!_0x4ab1ee[_0x39af('0x48')][_0x39af('0x4f')]('nolimit')){_0x1fa4f6['limit']=qs[_0x39af('0x34')](_0x4ab1ee['query'][_0x39af('0x34')]);_0x1fa4f6[_0x39af('0x32')]=qs[_0x39af('0x32')](_0x4ab1ee[_0x39af('0x48')]['offset']);}_0x1fa4f6[_0x39af('0x51')]=qs[_0x39af('0x52')](_0x4ab1ee['query'][_0x39af('0x52')]);_0x1fa4f6[_0x39af('0x53')]=qs[_0x39af('0x49')](_[_0x39af('0x54')](_0x4ab1ee[_0x39af('0x48')],_0x1119c8[_0x39af('0x49')]));_0x1fa4f6[_0x39af('0x53')][_0x39af('0x6f')]=_0x23895e['id'];if(_0x4ab1ee[_0x39af('0x48')][_0x39af('0x55')]){_0x1fa4f6['where']=_['merge'](_0x1fa4f6[_0x39af('0x53')],{'$or':_[_0x39af('0x47')](_0x1fa4f6['attributes'],function(_0x1ec3a8){var _0x5c24ac={};_0x5c24ac[_0x1ec3a8]={'$like':'%'+_0x4ab1ee['query'][_0x39af('0x55')]+'%'};return _0x5c24ac;})});}_0x1fa4f6=_[_0x39af('0x56')]({},_0x1fa4f6,_0x4ab1ee[_0x39af('0x59')]);return db[_0x39af('0x97')][_0x39af('0x35')]({'where':_0x1fa4f6[_0x39af('0x53')]})['then'](function(_0x21fa05){_0xb18f68[_0x39af('0x35')]=_0x21fa05;if(_0x4ab1ee[_0x39af('0x48')][_0x39af('0x5b')]){_0x1fa4f6[_0x39af('0x5c')]=[{'model':db[_0x39af('0x7a')],'as':'Contact','required':![]},{'model':db[_0x39af('0xaf')],'as':_0x39af('0xb0'),'attributes':[_0x39af('0x40'),_0x39af('0xb1'),'internal'],'required':![]},{'model':db[_0x39af('0xb2')],'as':'Tags','attributes':['id',_0x39af('0x40'),_0x39af('0xb3')],'where':_0x4ab1ee[_0x39af('0x48')][_0x39af('0xb4')]?{'id':_0x4ab1ee[_0x39af('0x48')]['tag']}:undefined,'required':_0x4ab1ee['query'][_0x39af('0xb4')]?!![]:![]}];}return db[_0x39af('0x97')][_0x39af('0x5d')](_0x1fa4f6);})['then'](function(_0x3975b4){_0xb18f68[_0x39af('0x5e')]=_0x3975b4;return _0xb18f68;});}})[_0x39af('0x24')](respondWithFilteredResult(_0x437aa7,_0x1fa4f6))[_0x39af('0x2e')](handleError(_0x437aa7,null));};exports[_0x39af('0xb5')]=function(_0x14224e,_0x29d66d,_0x5f2a0c){return db[_0x39af('0x5a')][_0x39af('0x63')]({'where':{'id':_0x14224e['params']['id']}})['then'](handleEntityNotFound(_0x29d66d,null))[_0x39af('0x24')](function(_0x356ed9){if(_0x356ed9){return _0x356ed9[_0x39af('0xb5')](_0x14224e[_0x39af('0x65')][_0x39af('0x73')],_[_0x39af('0xb6')](_0x14224e[_0x39af('0x65')],[_0x39af('0x73'),'id'])||{})[_0x39af('0x9a')](function(_0x38c6a9){for(var _0x4157e7=0x0;_0x4157e7<_0x14224e[_0x39af('0x65')]['ids'][_0x39af('0x4e')];_0x4157e7+=0x1){socket[_0x39af('0xb7')](_0x39af('0xb8'),{'UserId':Number(_0x14224e['body'][_0x39af('0x73')][_0x4157e7]),'OpenchannelAccountId':Number(_0x14224e[_0x39af('0x60')]['id'])});}return _0x38c6a9;});}})[_0x39af('0x24')](respondWithResult(_0x29d66d,null))['catch'](handleError(_0x29d66d,null));};exports['removeAgents']=function(_0x5ec79c,_0x37f733,_0x380f5a){return db[_0x39af('0x5a')][_0x39af('0x63')]({'where':{'id':_0x5ec79c[_0x39af('0x60')]['id']}})[_0x39af('0x24')](handleEntityNotFound(_0x37f733,null))[_0x39af('0x24')](function(_0x425b17){if(_0x425b17){return _0x425b17[_0x39af('0xb9')](_0x5ec79c[_0x39af('0x48')][_0x39af('0x73')])['then'](function(){if(_['isArray'](_0x5ec79c[_0x39af('0x48')][_0x39af('0x73')])){for(var _0xaba046=0x0;_0xaba046<_0x5ec79c[_0x39af('0x48')][_0x39af('0x73')][_0x39af('0x4e')];_0xaba046+=0x1){socket[_0x39af('0xb7')](_0x39af('0xba'),{'UserId':Number(_0x5ec79c[_0x39af('0x48')][_0x39af('0x73')][_0xaba046]),'OpenchannelAccountId':Number(_0x5ec79c[_0x39af('0x60')]['id'])});}}else{socket[_0x39af('0xb7')](_0x39af('0xba'),{'UserId':Number(_0x5ec79c['query'][_0x39af('0x73')]),'OpenchannelAccountId':Number(_0x5ec79c['params']['id'])});}});}})[_0x39af('0x24')](respondWithStatusCode(_0x37f733,null))[_0x39af('0x2e')](handleError(_0x37f733,null));};exports[_0x39af('0xbb')]=function(_0x5d8293,_0x5dd2e2,_0x255f13){var _0x4db7ce={};var _0x392628={};var _0x9b6618;var _0x18e250;return db[_0x39af('0x5a')][_0x39af('0x71')]({'where':{'id':_0x5d8293[_0x39af('0x60')]['id']}})[_0x39af('0x24')](handleEntityNotFound(_0x5dd2e2,null))[_0x39af('0x24')](function(_0x489e8d){if(_0x489e8d){_0x9b6618=_0x489e8d;_0x392628[_0x39af('0x4a')]=_[_0x39af('0x61')](db[_0x39af('0xaf')][_0x39af('0x62')]);_0x392628[_0x39af('0x48')]=_[_0x39af('0x61')](_0x5d8293[_0x39af('0x48')]);_0x392628['filters']=_['intersection'](_0x392628['model'],_0x392628[_0x39af('0x48')]);_0x4db7ce['attributes']=_[_0x39af('0x4c')](_0x392628[_0x39af('0x4a')],qs[_0x39af('0x4d')](_0x5d8293['query']['fields']));_0x4db7ce['attributes']=_0x4db7ce[_0x39af('0x4b')]['length']?_0x4db7ce[_0x39af('0x4b')]:_0x392628[_0x39af('0x4a')];_0x4db7ce['order']=qs['sort'](_0x5d8293[_0x39af('0x48')][_0x39af('0x52')]);_0x4db7ce[_0x39af('0x53')]=qs[_0x39af('0x49')](_[_0x39af('0x54')](_0x5d8293[_0x39af('0x48')],_0x392628[_0x39af('0x49')]));if(_0x5d8293[_0x39af('0x48')][_0x39af('0x55')]){_0x4db7ce[_0x39af('0x53')]=_['merge'](_0x4db7ce['where'],{'$or':_[_0x39af('0x47')](_0x4db7ce[_0x39af('0x4b')],function(_0x11c585){var _0x6b9cb9={};_0x6b9cb9[_0x11c585]={'$like':'%'+_0x5d8293['query'][_0x39af('0x55')]+'%'};return _0x6b9cb9;})});}_0x4db7ce=_['merge']({},_0x4db7ce,_0x5d8293['options']);return _0x9b6618['getAgents'](_0x4db7ce);}})[_0x39af('0x24')](function(_0x7c8195){if(_0x7c8195){_0x18e250=_0x7c8195[_0x39af('0x4e')];if(!_0x5d8293[_0x39af('0x48')][_0x39af('0x4f')]('nolimit')){_0x4db7ce['limit']=qs[_0x39af('0x34')](_0x5d8293[_0x39af('0x48')][_0x39af('0x34')]);_0x4db7ce[_0x39af('0x32')]=qs[_0x39af('0x32')](_0x5d8293['query'][_0x39af('0x32')]);}return _0x9b6618['getAgents'](_0x4db7ce);}})['then'](function(_0x280f4f){if(_0x280f4f){return _0x280f4f?{'count':_0x18e250,'rows':_0x280f4f}:null;}})[_0x39af('0x24')](respondWithResult(_0x5dd2e2,null))['catch'](handleError(_0x5dd2e2,null));};exports[_0x39af('0x41')]=function(_0x30c005,_0x40aaba,_0x308751){var _0x1f06fc,_0x3ec35f,_0x2f45d3;if(_[_0x39af('0x82')](_0x30c005[_0x39af('0x65')][_0x39af('0x65')])||_0x30c005['body']['body']===''){throw new db[(_0x39af('0x7b'))]['ValidationError'](_0x39af('0x85'));}if(_[_0x39af('0x82')](_0x30c005[_0x39af('0x65')]['to'])){}_0x1f06fc=_0x30c005['body']['to'];return db['OpenchannelAccount']['findOne']({'where':{'id':_0x30c005[_0x39af('0x60')]['id']}})['then'](handleEntityNotFound(_0x40aaba,null))[_0x39af('0x24')](function(_0x166f92){if(_0x166f92){return db[_0x39af('0x5a')][_0x39af('0x63')]({'where':{'id':_0x166f92['id']},'include':[{'model':db[_0x39af('0xbc')],'as':_0x39af('0x8a'),'include':[{'model':db['CmContact'],'as':_0x39af('0x8b'),'where':{[_0x166f92[_0x39af('0x86')]]:_0x1f06fc},'limit':0x1,'order':[[_0x39af('0x7f'),'DESC']]}]}]})[_0x39af('0x24')](handleEntityNotFound(_0x40aaba,null))[_0x39af('0x24')](function(_0x4b4992){if(_0x4b4992&&_0x4b4992[_0x39af('0x8a')]){_0x3ec35f=_0x4b4992[_0x39af('0x3c')]({'plain':!![]});if(_0x3ec35f['List']&&_0x3ec35f['List'][_0x39af('0x8b')]['length']){return _0x3ec35f[_0x39af('0x8a')][_0x39af('0x8b')][0x0];}return db[_0x39af('0x7a')][_0x39af('0x64')](_[_0x39af('0x1b')](_0x30c005['body'],{'firstName':_0x1f06fc,[_0x4b4992[_0x39af('0x86')]]:_0x1f06fc,'phone':_0x1f06fc,'ListId':_0x3ec35f['ListId']}));}})[_0x39af('0x24')](handleEntityNotFound(_0x40aaba,null))[_0x39af('0x24')](function(_0x4bc14e){if(_0x4bc14e){_0x2f45d3=_0x4bc14e;return db['OpenchannelInteraction'][_0x39af('0x63')]({'where':{'ContactId':_0x2f45d3['id'],'closed':![],'OpenchannelAccountId':_0x3ec35f['id']}})['then'](function(_0x10c1e8){if(_0x10c1e8){return[_0x10c1e8,![]];}return db[_0x39af('0x97')][_0x39af('0x64')]({'UserId':_0x30c005[_0x39af('0x66')]['id'],'ContactId':_0x2f45d3['id'],'OpenchannelAccountId':_0x3ec35f['id'],'lastMsgDirection':_0x39af('0xbd'),'Messages':[_[_0x39af('0x56')](_0x30c005['body'],{'read':![],'body':_0x30c005[_0x39af('0x65')][_0x39af('0x65')],'OpenchannelAccountId':_0x3ec35f['id'],'UserId':_0x30c005[_0x39af('0x66')]['id'],'ContactId':_0x2f45d3['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x39af('0xbe')}]})[_0x39af('0x24')](function(_0x29876b){return[_0x29876b,!![]];});});}})[_0x39af('0x9a')](function(_0x302518,_0x46b4d3){if(_0x46b4d3){return _0x302518;}return db[_0x39af('0xa2')]['create'](_[_0x39af('0x56')](_0x30c005[_0x39af('0x65')],{'read':![],'body':_0x30c005['body']['body'],'OpenchannelAccountId':_0x3ec35f['id'],'OpenchannelInteractionId':_0x302518['id'],'UserId':_0x30c005[_0x39af('0x66')]['id'],'ContactId':_0x2f45d3['id']}))['then'](function(_0x12778b){_0x302518[_0x39af('0xbf')][_0x39af('0xbe')]=[];_0x302518[_0x39af('0xbf')]['Messages']['push'](_0x12778b[_0x39af('0xbf')]);return _0x302518;});});}})[_0x39af('0x24')](respondWithResult(_0x40aaba,null))[_0x39af('0x2e')](handleError(_0x40aaba,null));};
\ No newline at end of file
index 6e9da1a..707fb8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb58b=['exports','../../mysqldb','OpenchannelAccount','setMaxListeners','update','remove','emit','hook'];(function(_0x2c8d7e,_0x1bf766){var _0x2da1c1=function(_0x325785){while(--_0x325785){_0x2c8d7e['push'](_0x2c8d7e['shift']());}};_0x2da1c1(++_0x1bf766);}(_0xb58b,0x1f1));var _0xbb58=function(_0x5b2cf3,_0x4b81f8){_0x5b2cf3=_0x5b2cf3-0x0;var _0x80311=_0xb58b[_0x5b2cf3];return _0x80311;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0xbb58('0x0'))['db'][_0xbb58('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xbb58('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbb58('0x3'),'afterDestroy':_0xbb58('0x4')};function emitEvent(_0x5c9ec5){return function(_0x226363,_0x546510,_0x2edb10){OpenchannelAccountEvents[_0xbb58('0x5')](_0x5c9ec5+':'+_0x226363['id'],_0x226363);OpenchannelAccountEvents[_0xbb58('0x5')](_0x5c9ec5,_0x226363);_0x2edb10(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xbb58('0x6')](e,emitEvent(event));}}module[_0xbb58('0x7')]=OpenchannelAccountEvents;
\ No newline at end of file
+var _0x9354=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelAccount','save'];(function(_0x397421,_0x5160b2){var _0x422b12=function(_0x53dd59){while(--_0x53dd59){_0x397421['push'](_0x397421['shift']());}};_0x422b12(++_0x5160b2);}(_0x9354,0x96));var _0x4935=function(_0x214a25,_0x15071d){_0x214a25=_0x214a25-0x0;var _0x405988=_0x9354[_0x214a25];return _0x405988;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0x4935('0x0'))['db'][_0x4935('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4935('0x2'),'afterUpdate':_0x4935('0x3'),'afterDestroy':_0x4935('0x4')};function emitEvent(_0x280bbc){return function(_0x5327fc,_0x46c7f9,_0x2d509b){OpenchannelAccountEvents[_0x4935('0x5')](_0x280bbc+':'+_0x5327fc['id'],_0x5327fc);OpenchannelAccountEvents[_0x4935('0x5')](_0x280bbc,_0x5327fc);_0x2d509b(null);};}for(var e in events){if(events[_0x4935('0x6')](e)){var event=events[e];OpenchannelAccount[_0x4935('0x7')](e,emitEvent(event));}}module[_0x4935('0x8')]=OpenchannelAccountEvents;
\ No newline at end of file
index 92be30b..68d9540 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(_0x468bec,_0x3caa0c){var _0x451d80=function(_0x366753){while(--_0x366753){_0x468bec['push'](_0x468bec['shift']());}};_0x451d80(++_0x3caa0c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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(_0x537bb4,_0x268b77){var _0x346ba3=function(_0x3606ef){while(--_0x3606ef){_0x537bb4['push'](_0x537bb4['shift']());}};_0x346ba3(++_0x268b77);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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 897c8f6..d2ce1f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0abf=['bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment'];(function(_0x137da3,_0xa6277a){var _0x1ac46c=function(_0x49e68b){while(--_0x49e68b){_0x137da3['push'](_0x137da3['shift']());}};_0x1ac46c(++_0xa6277a);}(_0x0abf,0xe8));var _0xf0ab=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0abf[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xf0ab('0x0'));var util=require('util');var moment=require(_0xf0ab('0x1'));var BPromise=require(_0xf0ab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf0ab('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf0ab('0x4'))(_0xf0ab('0x5'));var config=require(_0xf0ab('0x6'));var jayson=require(_0xf0ab('0x7'));var client=jayson[_0xf0ab('0x8')][_0xf0ab('0x9')]({'port':0x232a});config[_0xf0ab('0xa')]=_['defaults'](config[_0xf0ab('0xa')],{'host':_0xf0ab('0xb'),'port':0x18eb});var socket=require(_0xf0ab('0xc'))(new Redis(config[_0xf0ab('0xa')]));require('./openchannelAccount.socket')[_0xf0ab('0xd')](socket);function respondWithRpcPromise(_0x4688d8,_0x1e7887,_0x4ab8e7){return new BPromise(function(_0x5d25a0,_0x30042c){return client['request'](_0x4688d8,_0x4ab8e7)[_0xf0ab('0xe')](function(_0x10a5a2){logger[_0xf0ab('0xf')](_0xf0ab('0x10'),_0x1e7887,_0xf0ab('0x11'));logger[_0xf0ab('0x12')](_0xf0ab('0x13'),_0x1e7887,'request\x20sent',JSON[_0xf0ab('0x14')](_0x10a5a2));if(_0x10a5a2[_0xf0ab('0x15')]){if(_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x16')]===0x1f4){logger[_0xf0ab('0x15')](_0xf0ab('0x10'),_0x1e7887,_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x17')]);return _0x30042c(_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x17')]);}logger[_0xf0ab('0x15')](_0xf0ab('0x10'),_0x1e7887,_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x17')]);return _0x5d25a0(_0x10a5a2[_0xf0ab('0x15')]['message']);}else{logger[_0xf0ab('0xf')](_0xf0ab('0x10'),_0x1e7887,_0xf0ab('0x11'));_0x5d25a0(_0x10a5a2[_0xf0ab('0x18')][_0xf0ab('0x17')]);}})[_0xf0ab('0x19')](function(_0x3a0edf){logger[_0xf0ab('0x15')](_0xf0ab('0x10'),_0x1e7887,_0x3a0edf);_0x30042c(_0x3a0edf);});});}
\ No newline at end of file
+var _0x4024=['randomstring','../../mysqldb','../../config/logger','rpc','client','http','redis','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util','bluebird'];(function(_0x5a7f13,_0xf0f011){var _0x2a3c35=function(_0x1640df){while(--_0x1640df){_0x5a7f13['push'](_0x5a7f13['shift']());}};_0x2a3c35(++_0xf0f011);}(_0x4024,0x89));var _0x4402=function(_0x34ece7,_0x197dce){_0x34ece7=_0x34ece7-0x0;var _0x2bb837=_0x4024[_0x34ece7];return _0x2bb837;};'use strict';var _=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var moment=require('moment');var BPromise=require(_0x4402('0x2'));var rs=require(_0x4402('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4402('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4402('0x5'))(_0x4402('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4402('0x7')][_0x4402('0x8')]({'port':0x232a});config[_0x4402('0x9')]=_['defaults'](config[_0x4402('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4402('0x9')]));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x30fd34,_0x4f56aa,_0x1a4a47){return new BPromise(function(_0x4e1a7e,_0x34b4a6){return client['request'](_0x30fd34,_0x1a4a47)[_0x4402('0xa')](function(_0x251286){logger['info'](_0x4402('0xb'),_0x4f56aa,_0x4402('0xc'));logger[_0x4402('0xd')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x4f56aa,_0x4402('0xc'),JSON[_0x4402('0xe')](_0x251286));if(_0x251286[_0x4402('0xf')]){if(_0x251286[_0x4402('0xf')][_0x4402('0x10')]===0x1f4){logger[_0x4402('0xf')](_0x4402('0xb'),_0x4f56aa,_0x251286[_0x4402('0xf')][_0x4402('0x11')]);return _0x34b4a6(_0x251286[_0x4402('0xf')][_0x4402('0x11')]);}logger[_0x4402('0xf')](_0x4402('0xb'),_0x4f56aa,_0x251286[_0x4402('0xf')][_0x4402('0x11')]);return _0x4e1a7e(_0x251286[_0x4402('0xf')][_0x4402('0x11')]);}else{logger[_0x4402('0x12')](_0x4402('0xb'),_0x4f56aa,_0x4402('0xc'));_0x4e1a7e(_0x251286['result']['message']);}})[_0x4402('0x13')](function(_0x2a7afc){logger['error'](_0x4402('0xb'),_0x4f56aa,_0x2a7afc);_0x34b4a6(_0x2a7afc);});});}
\ No newline at end of file
index ee08fde..459b865 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdb7=['openchannelAccount:','./openchannelAccount.events','save','remove','update','emit','removeListener'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x26224c,_0x1a354c){_0x26224c=_0x26224c-0x0;var _0x4c2bc5=_0xbdb7[_0x26224c];return _0x4c2bc5;};'use strict';var OpenchannelAccountEvents=require(_0x7bdb('0x0'));var events=[_0x7bdb('0x1'),_0x7bdb('0x2'),_0x7bdb('0x3')];function createListener(_0x23c326,_0x433850){return function(_0x4496ac){_0x433850[_0x7bdb('0x4')](_0x23c326,_0x4496ac);};}function removeListener(_0x46c068,_0x47aec5){return function(){OpenchannelAccountEvents[_0x7bdb('0x5')](_0x46c068,_0x47aec5);};}exports['register']=function(_0x4b5fff){for(var _0xffdc86=0x0,_0x1e23a3=events['length'];_0xffdc86<_0x1e23a3;_0xffdc86++){var _0x513cba=events[_0xffdc86];var _0x468041=createListener(_0x7bdb('0x6')+_0x513cba,_0x4b5fff);OpenchannelAccountEvents['on'](_0x513cba,_0x468041);}};
\ No newline at end of file
+var _0xb04a=['save','remove','update','emit','removeListener','register','openchannelAccount:','./openchannelAccount.events'];(function(_0x254abd,_0x1ab7f0){var _0x31bf1b=function(_0x447fd8){while(--_0x447fd8){_0x254abd['push'](_0x254abd['shift']());}};_0x31bf1b(++_0x1ab7f0);}(_0xb04a,0xcf));var _0xab04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb04a[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelAccountEvents=require(_0xab04('0x0'));var events=[_0xab04('0x1'),_0xab04('0x2'),_0xab04('0x3')];function createListener(_0x565575,_0x28963e){return function(_0x4657c4){_0x28963e[_0xab04('0x4')](_0x565575,_0x4657c4);};}function removeListener(_0x4b8c0f,_0x2b5b06){return function(){OpenchannelAccountEvents[_0xab04('0x5')](_0x4b8c0f,_0x2b5b06);};}exports[_0xab04('0x6')]=function(_0x488ced){for(var _0x3b68e3=0x0,_0x46d9b2=events['length'];_0x3b68e3<_0x46d9b2;_0x3b68e3++){var _0x53a969=events[_0x3b68e3];var _0x4d47f5=createListener(_0xab04('0x7')+_0x53a969,_0x488ced);OpenchannelAccountEvents['on'](_0x53a969,_0x4d47f5);}};
\ No newline at end of file
index b787372..23bd174 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a4c=['isAuthenticated','update','delete','exports','util','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','/:id','post','create'];(function(_0x3d2e1b,_0x6649aa){var _0x3b85c2=function(_0x3ea5d6){while(--_0x3ea5d6){_0x3d2e1b['push'](_0x3d2e1b['shift']());}};_0x3b85c2(++_0x6649aa);}(_0x8a4c,0x74));var _0xc8a4=function(_0x3e7804,_0x121853){_0x3e7804=_0x3e7804-0x0;var _0x56efda=_0x8a4c[_0x3e7804];return _0x56efda;};'use strict';var multer=require('multer');var util=require(_0xc8a4('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xc8a4('0x1'));var auth=require(_0xc8a4('0x2'));var interaction=require(_0xc8a4('0x3'));var config=require(_0xc8a4('0x4'));var controller=require(_0xc8a4('0x5'));router[_0xc8a4('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xc8a4('0x7'),auth['isAuthenticated'](),controller['show']);router[_0xc8a4('0x8')]('/',auth['isAuthenticated'](),controller[_0xc8a4('0x9')]);router['put'](_0xc8a4('0x7'),auth[_0xc8a4('0xa')](),controller[_0xc8a4('0xb')]);router[_0xc8a4('0xc')](_0xc8a4('0x7'),auth[_0xc8a4('0xa')](),controller['destroy']);module[_0xc8a4('0xd')]=router;
\ No newline at end of file
+var _0xc7e1=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','create','put','exports','multer','util','path','connect-timeout','express'];(function(_0x54f7e2,_0x3b2a85){var _0xee8fd5=function(_0x468b0c){while(--_0x468b0c){_0x54f7e2['push'](_0x54f7e2['shift']());}};_0xee8fd5(++_0x3b2a85);}(_0xc7e1,0xdf));var _0x1c7e=function(_0x5272e6,_0xd01eb4){_0x5272e6=_0x5272e6-0x0;var _0x494f97=_0xc7e1[_0x5272e6];return _0x494f97;};'use strict';var multer=require(_0x1c7e('0x0'));var util=require(_0x1c7e('0x1'));var path=require(_0x1c7e('0x2'));var timeout=require(_0x1c7e('0x3'));var express=require(_0x1c7e('0x4'));var router=express[_0x1c7e('0x5')]();var fs_extra=require(_0x1c7e('0x6'));var auth=require(_0x1c7e('0x7'));var interaction=require(_0x1c7e('0x8'));var config=require(_0x1c7e('0x9'));var controller=require(_0x1c7e('0xa'));router[_0x1c7e('0xb')]('/',auth[_0x1c7e('0xc')](),controller[_0x1c7e('0xd')]);router[_0x1c7e('0xb')](_0x1c7e('0xe'),auth[_0x1c7e('0xc')](),controller[_0x1c7e('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1c7e('0x10')]);router[_0x1c7e('0x11')](_0x1c7e('0xe'),auth[_0x1c7e('0xc')](),controller['update']);router['delete'](_0x1c7e('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x1c7e('0x12')]=router;
\ No newline at end of file
index ebccf55..805ab2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43e1=['noop','sequelize','exports','STRING'];(function(_0x515d98,_0x118123){var _0x538457=function(_0x454b5d){while(--_0x454b5d){_0x515d98['push'](_0x515d98['shift']());}};_0x538457(++_0x118123);}(_0x43e1,0x79));var _0x143e=function(_0x46a38b,_0x16ffb5){_0x46a38b=_0x46a38b-0x0;var _0x346e75=_0x43e1[_0x46a38b];return _0x346e75;};'use strict';var Sequelize=require(_0x143e('0x0'));module[_0x143e('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x143e('0x2')],'allowNull':![],'defaultValue':_0x143e('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x143e('0x2')]},'interval':{'type':Sequelize[_0x143e('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x1a1b=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0xe8f3bc,_0x12985f){var _0x4d1fe2=function(_0xd4eb9a){while(--_0xd4eb9a){_0xe8f3bc['push'](_0xe8f3bc['shift']());}};_0x4d1fe2(++_0x12985f);}(_0x1a1b,0x1d7));var _0xb1a1=function(_0x395db3,_0x5df510){_0x395db3=_0x395db3-0x0;var _0x2dfe66=_0x1a1b[_0x395db3];return _0x2dfe66;};'use strict';var Sequelize=require(_0xb1a1('0x0'));module[_0xb1a1('0x1')]={'priority':{'type':Sequelize[_0xb1a1('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb1a1('0x3')],'allowNull':![],'defaultValue':_0xb1a1('0x4')},'appdata':{'type':Sequelize[_0xb1a1('0x5')]()},'description':{'type':Sequelize[_0xb1a1('0x3')]},'interval':{'type':Sequelize[_0xb1a1('0x3')],'defaultValue':_0xb1a1('0x6')}};
\ No newline at end of file
index c8bab57..fad26c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf27a=['limit','set','save','then','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','OpenchannelApplication','include','findAll','catch','show','params','includeAll','find','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count'];(function(_0x3d8d62,_0x491f39){var _0x5caceb=function(_0xf886f1){while(--_0xf886f1){_0x3d8d62['push'](_0x3d8d62['shift']());}};_0x5caceb(++_0x491f39);}(_0xf27a,0xc3));var _0xaf27=function(_0x250f61,_0x31698a){_0x250f61=_0x250f61-0x0;var _0x4ab6ea=_0xf27a[_0x250f61];return _0x4ab6ea;};'use strict';var emlformat=require(_0xaf27('0x0'));var rimraf=require(_0xaf27('0x1'));var zipdir=require(_0xaf27('0x2'));var jsonpatch=require(_0xaf27('0x3'));var rp=require(_0xaf27('0x4'));var moment=require(_0xaf27('0x5'));var BPromise=require(_0xaf27('0x6'));var Mustache=require('mustache');var util=require(_0xaf27('0x7'));var path=require(_0xaf27('0x8'));var sox=require('sox');var csv=require(_0xaf27('0x9'));var ejs=require(_0xaf27('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaf27('0xb'));var squel=require(_0xaf27('0xc'));var crypto=require(_0xaf27('0xd'));var jsforce=require(_0xaf27('0xe'));var deskjs=require(_0xaf27('0xf'));var toCsv=require('to-csv');var querystring=require(_0xaf27('0x10'));var Papa=require(_0xaf27('0x11'));var Redis=require(_0xaf27('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaf27('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaf27('0x14'))(_0xaf27('0x15'));var utils=require(_0xaf27('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xaf27('0x17'));var db=require(_0xaf27('0x18'))['db'];function respondWithStatusCode(_0x2285e8,_0xc80438){_0xc80438=_0xc80438||0xcc;return function(_0x15a4cf){if(_0x15a4cf){return _0x2285e8['sendStatus'](_0xc80438);}return _0x2285e8[_0xaf27('0x19')](_0xc80438)['end']();};}function respondWithResult(_0x44f634,_0x591a03){_0x591a03=_0x591a03||0xc8;return function(_0x1bcd88){if(_0x1bcd88){return _0x44f634[_0xaf27('0x19')](_0x591a03)[_0xaf27('0x1a')](_0x1bcd88);}};}function respondWithFilteredResult(_0x410169,_0x39e567){return function(_0x57a8df){if(_0x57a8df){var _0x2f3b04=typeof _0x39e567[_0xaf27('0x1b')]===_0xaf27('0x1c')&&typeof _0x39e567['limit']===_0xaf27('0x1c');var _0x14fee8=_0x57a8df[_0xaf27('0x1d')];var _0x476ac0=_0x2f3b04?0x0:_0x39e567[_0xaf27('0x1b')];var _0x31628d=_0x2f3b04?_0x57a8df[_0xaf27('0x1d')]:_0x39e567['offset']+_0x39e567[_0xaf27('0x1e')];var _0x585f87;if(_0x31628d>=_0x14fee8){_0x31628d=_0x14fee8;_0x585f87=0xc8;}else{_0x585f87=0xce;}_0x410169['status'](_0x585f87);return _0x410169[_0xaf27('0x1f')]('Content-Range',_0x476ac0+'-'+_0x31628d+'/'+_0x14fee8)[_0xaf27('0x1a')](_0x57a8df);}return null;};}function patchUpdates(_0x1def05){return function(_0x5e08f3){try{jsonpatch['apply'](_0x5e08f3,_0x1def05,!![]);}catch(_0x1407ce){return BPromise['reject'](_0x1407ce);}return _0x5e08f3[_0xaf27('0x20')]();};}function saveUpdates(_0xef4e73,_0x216f84){return function(_0x2cacad){if(_0x2cacad){return _0x2cacad['update'](_0xef4e73)[_0xaf27('0x21')](function(_0x23d233){return _0x23d233;});}return null;};}function removeEntity(_0x113b2c,_0x30345b){return function(_0x465f6e){if(_0x465f6e){return _0x465f6e[_0xaf27('0x22')]()[_0xaf27('0x21')](function(){_0x113b2c['status'](0xcc)[_0xaf27('0x23')]();});}};}function handleEntityNotFound(_0x1f637d,_0x4b3697){return function(_0x341fbc){if(!_0x341fbc){_0x1f637d[_0xaf27('0x24')](0x194);}return _0x341fbc;};}function handleError(_0x221a15,_0x1be9de){_0x1be9de=_0x1be9de||0x1f4;return function(_0x67b877){logger['error'](_0x67b877[_0xaf27('0x25')]);if(_0x67b877['name']){delete _0x67b877[_0xaf27('0x26')];}_0x221a15[_0xaf27('0x19')](_0x1be9de)[_0xaf27('0x27')](_0x67b877);};}exports[_0xaf27('0x28')]=function(_0x4d804d,_0x3c8efc){var _0x1cc39e={},_0x58ae63={},_0x21a18e={'count':0x0,'rows':[]};var _0x51b12c=_[_0xaf27('0x29')](db['OpenchannelApplication'][_0xaf27('0x2a')],function(_0x511a2e){return{'name':_0x511a2e[_0xaf27('0x2b')],'type':_0x511a2e['type'][_0xaf27('0x2c')]};});_0x58ae63[_0xaf27('0x2d')]=_[_0xaf27('0x29')](_0x51b12c,_0xaf27('0x26'));_0x58ae63[_0xaf27('0x2e')]=_[_0xaf27('0x2f')](_0x4d804d[_0xaf27('0x2e')]);_0x58ae63[_0xaf27('0x30')]=_['intersection'](_0x58ae63[_0xaf27('0x2d')],_0x58ae63['query']);_0x1cc39e[_0xaf27('0x31')]=_[_0xaf27('0x32')](_0x58ae63['model'],qs[_0xaf27('0x33')](_0x4d804d[_0xaf27('0x2e')]['fields']));_0x1cc39e['attributes']=_0x1cc39e[_0xaf27('0x31')][_0xaf27('0x34')]?_0x1cc39e[_0xaf27('0x31')]:_0x58ae63[_0xaf27('0x2d')];if(!_0x4d804d[_0xaf27('0x2e')][_0xaf27('0x35')](_0xaf27('0x36'))){_0x1cc39e['limit']=qs['limit'](_0x4d804d[_0xaf27('0x2e')][_0xaf27('0x1e')]);_0x1cc39e['offset']=qs[_0xaf27('0x1b')](_0x4d804d[_0xaf27('0x2e')]['offset']);}_0x1cc39e[_0xaf27('0x37')]=qs[_0xaf27('0x38')](_0x4d804d[_0xaf27('0x2e')][_0xaf27('0x38')]);_0x1cc39e[_0xaf27('0x39')]=qs[_0xaf27('0x30')](_[_0xaf27('0x3a')](_0x4d804d['query'],_0x58ae63[_0xaf27('0x30')]),_0x51b12c);if(_0x4d804d[_0xaf27('0x2e')][_0xaf27('0x3b')]){_0x1cc39e[_0xaf27('0x39')]=_[_0xaf27('0x3c')](_0x1cc39e[_0xaf27('0x39')],{'$or':_[_0xaf27('0x29')](_0x51b12c,function(_0x157b77){if(_0x157b77[_0xaf27('0x3d')]!==_0xaf27('0x3e')){var _0x55cbcd={};_0x55cbcd[_0x157b77[_0xaf27('0x26')]]={'$like':'%'+_0x4d804d['query'][_0xaf27('0x3b')]+'%'};return _0x55cbcd;}})});}_0x1cc39e=_[_0xaf27('0x3c')]({},_0x1cc39e,_0x4d804d[_0xaf27('0x3f')]);var _0x7813e7={'where':_0x1cc39e[_0xaf27('0x39')]};return db[_0xaf27('0x40')][_0xaf27('0x1d')](_0x7813e7)['then'](function(_0xed49e4){_0x21a18e[_0xaf27('0x1d')]=_0xed49e4;if(_0x4d804d['query']['includeAll']){_0x1cc39e[_0xaf27('0x41')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0xaf27('0x42')](_0x1cc39e);})[_0xaf27('0x21')](function(_0xfa5fee){_0x21a18e['rows']=_0xfa5fee;return _0x21a18e;})[_0xaf27('0x21')](respondWithFilteredResult(_0x3c8efc,_0x1cc39e))[_0xaf27('0x43')](handleError(_0x3c8efc,null));};exports[_0xaf27('0x44')]=function(_0x42dd47,_0x28c494){var _0x14e457={'raw':!![],'where':{'id':_0x42dd47[_0xaf27('0x45')]['id']}},_0x4a5f25={};_0x4a5f25[_0xaf27('0x2d')]=_[_0xaf27('0x2f')](db[_0xaf27('0x40')][_0xaf27('0x2a')]);_0x4a5f25[_0xaf27('0x2e')]=_['keys'](_0x42dd47[_0xaf27('0x2e')]);_0x4a5f25[_0xaf27('0x30')]=_[_0xaf27('0x32')](_0x4a5f25[_0xaf27('0x2d')],_0x4a5f25[_0xaf27('0x2e')]);_0x14e457[_0xaf27('0x31')]=_['intersection'](_0x4a5f25['model'],qs[_0xaf27('0x33')](_0x42dd47[_0xaf27('0x2e')][_0xaf27('0x33')]));_0x14e457[_0xaf27('0x31')]=_0x14e457['attributes'][_0xaf27('0x34')]?_0x14e457[_0xaf27('0x31')]:_0x4a5f25[_0xaf27('0x2d')];if(_0x42dd47['query'][_0xaf27('0x46')]){_0x14e457[_0xaf27('0x41')]=[{'all':!![]}];}_0x14e457=_[_0xaf27('0x3c')]({},_0x14e457,_0x42dd47['options']);return db[_0xaf27('0x40')][_0xaf27('0x47')](_0x14e457)[_0xaf27('0x21')](handleEntityNotFound(_0x28c494,null))[_0xaf27('0x21')](respondWithResult(_0x28c494,null))[_0xaf27('0x43')](handleError(_0x28c494,null));};exports[_0xaf27('0x48')]=function(_0x6e5961,_0x5882b2){return db[_0xaf27('0x40')][_0xaf27('0x48')](_0x6e5961['body'],{})['then'](respondWithResult(_0x5882b2,0xc9))['catch'](handleError(_0x5882b2,null));};exports[_0xaf27('0x49')]=function(_0x462d9d,_0x5346eb){if(_0x462d9d['body']['id']){delete _0x462d9d[_0xaf27('0x4a')]['id'];}return db[_0xaf27('0x40')][_0xaf27('0x47')]({'where':{'id':_0x462d9d[_0xaf27('0x45')]['id']}})['then'](handleEntityNotFound(_0x5346eb,null))['then'](saveUpdates(_0x462d9d['body'],null))[_0xaf27('0x21')](respondWithResult(_0x5346eb,null))['catch'](handleError(_0x5346eb,null));};exports[_0xaf27('0x22')]=function(_0x27360b,_0x292637){return db['OpenchannelApplication']['find']({'where':{'id':_0x27360b[_0xaf27('0x45')]['id']}})[_0xaf27('0x21')](handleEntityNotFound(_0x292637,null))[_0xaf27('0x21')](removeEntity(_0x292637,null))[_0xaf27('0x43')](handleError(_0x292637,null));};
\ No newline at end of file
+var _0x51b6=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query'];(function(_0x2010d4,_0x1d582a){var _0x5e2ff7=function(_0xb5bc06){while(--_0xb5bc06){_0x2010d4['push'](_0x2010d4['shift']());}};_0x5e2ff7(++_0x1d582a);}(_0x51b6,0x158));var _0x651b=function(_0x495732,_0x541539){_0x495732=_0x495732-0x0;var _0x42f3e5=_0x51b6[_0x495732];return _0x42f3e5;};'use strict';var emlformat=require(_0x651b('0x0'));var rimraf=require(_0x651b('0x1'));var zipdir=require(_0x651b('0x2'));var jsonpatch=require(_0x651b('0x3'));var rp=require(_0x651b('0x4'));var moment=require(_0x651b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x651b('0x6'));var util=require(_0x651b('0x7'));var path=require('path');var sox=require(_0x651b('0x8'));var csv=require(_0x651b('0x9'));var ejs=require(_0x651b('0xa'));var fs=require('fs');var fs_extra=require(_0x651b('0xb'));var _=require(_0x651b('0xc'));var squel=require(_0x651b('0xd'));var crypto=require(_0x651b('0xe'));var jsforce=require(_0x651b('0xf'));var deskjs=require(_0x651b('0x10'));var toCsv=require(_0x651b('0x9'));var querystring=require(_0x651b('0x11'));var Papa=require(_0x651b('0x12'));var Redis=require(_0x651b('0x13'));var authService=require(_0x651b('0x14'));var qs=require(_0x651b('0x15'));var as=require(_0x651b('0x16'));var hardwareService=require(_0x651b('0x17'));var logger=require(_0x651b('0x18'))(_0x651b('0x19'));var utils=require(_0x651b('0x1a'));var config=require(_0x651b('0x1b'));var licenseUtil=require(_0x651b('0x1c'));var db=require(_0x651b('0x1d'))['db'];function respondWithStatusCode(_0x13a374,_0x225767){_0x225767=_0x225767||0xcc;return function(_0x410df8){if(_0x410df8){return _0x13a374[_0x651b('0x1e')](_0x225767);}return _0x13a374[_0x651b('0x1f')](_0x225767)[_0x651b('0x20')]();};}function respondWithResult(_0x218fb4,_0x1d85f2){_0x1d85f2=_0x1d85f2||0xc8;return function(_0x19e594){if(_0x19e594){return _0x218fb4[_0x651b('0x1f')](_0x1d85f2)[_0x651b('0x21')](_0x19e594);}};}function respondWithFilteredResult(_0x1ab7e2,_0x33effe){return function(_0x1ec1fa){if(_0x1ec1fa){var _0x2ac535=typeof _0x33effe[_0x651b('0x22')]===_0x651b('0x23')&&typeof _0x33effe[_0x651b('0x24')]===_0x651b('0x23');var _0x18e1c6=_0x1ec1fa[_0x651b('0x25')];var _0x2eed0f=_0x2ac535?0x0:_0x33effe['offset'];var _0x194923=_0x2ac535?_0x1ec1fa['count']:_0x33effe[_0x651b('0x22')]+_0x33effe[_0x651b('0x24')];var _0x3de019;if(_0x194923>=_0x18e1c6){_0x194923=_0x18e1c6;_0x3de019=0xc8;}else{_0x3de019=0xce;}_0x1ab7e2[_0x651b('0x1f')](_0x3de019);return _0x1ab7e2[_0x651b('0x26')](_0x651b('0x27'),_0x2eed0f+'-'+_0x194923+'/'+_0x18e1c6)[_0x651b('0x21')](_0x1ec1fa);}return null;};}function patchUpdates(_0x3602b0){return function(_0x1732b1){try{jsonpatch[_0x651b('0x28')](_0x1732b1,_0x3602b0,!![]);}catch(_0x5894ad){return BPromise[_0x651b('0x29')](_0x5894ad);}return _0x1732b1[_0x651b('0x2a')]();};}function saveUpdates(_0x455080,_0x3996c9){return function(_0x18e8df){if(_0x18e8df){return _0x18e8df['update'](_0x455080)[_0x651b('0x2b')](function(_0x58ca37){return _0x58ca37;});}return null;};}function removeEntity(_0x5ecc94,_0x329d71){return function(_0x2cdc6c){if(_0x2cdc6c){return _0x2cdc6c[_0x651b('0x2c')]()[_0x651b('0x2b')](function(){_0x5ecc94['status'](0xcc)[_0x651b('0x20')]();});}};}function handleEntityNotFound(_0xcb418e,_0x18d065){return function(_0x133be2){if(!_0x133be2){_0xcb418e['sendStatus'](0x194);}return _0x133be2;};}function handleError(_0x29acab,_0x53c130){_0x53c130=_0x53c130||0x1f4;return function(_0x16282c){logger[_0x651b('0x2d')](_0x16282c['stack']);if(_0x16282c[_0x651b('0x2e')]){delete _0x16282c[_0x651b('0x2e')];}_0x29acab[_0x651b('0x1f')](_0x53c130)[_0x651b('0x2f')](_0x16282c);};}exports[_0x651b('0x30')]=function(_0x25e732,_0x26ef50){var _0x509ff5={},_0x244a60={},_0x118bc1={'count':0x0,'rows':[]};var _0xa8cd29=_['map'](db[_0x651b('0x31')][_0x651b('0x32')],function(_0x144f34){return{'name':_0x144f34[_0x651b('0x33')],'type':_0x144f34[_0x651b('0x34')][_0x651b('0x35')]};});_0x244a60[_0x651b('0x36')]=_['map'](_0xa8cd29,_0x651b('0x2e'));_0x244a60[_0x651b('0x37')]=_[_0x651b('0x38')](_0x25e732[_0x651b('0x37')]);_0x244a60[_0x651b('0x39')]=_[_0x651b('0x3a')](_0x244a60[_0x651b('0x36')],_0x244a60[_0x651b('0x37')]);_0x509ff5[_0x651b('0x3b')]=_[_0x651b('0x3a')](_0x244a60[_0x651b('0x36')],qs[_0x651b('0x3c')](_0x25e732[_0x651b('0x37')][_0x651b('0x3c')]));_0x509ff5[_0x651b('0x3b')]=_0x509ff5['attributes'][_0x651b('0x3d')]?_0x509ff5[_0x651b('0x3b')]:_0x244a60[_0x651b('0x36')];if(!_0x25e732[_0x651b('0x37')][_0x651b('0x3e')](_0x651b('0x3f'))){_0x509ff5[_0x651b('0x24')]=qs[_0x651b('0x24')](_0x25e732['query']['limit']);_0x509ff5[_0x651b('0x22')]=qs['offset'](_0x25e732[_0x651b('0x37')][_0x651b('0x22')]);}_0x509ff5['order']=qs[_0x651b('0x40')](_0x25e732[_0x651b('0x37')][_0x651b('0x40')]);_0x509ff5[_0x651b('0x41')]=qs[_0x651b('0x39')](_[_0x651b('0x42')](_0x25e732[_0x651b('0x37')],_0x244a60[_0x651b('0x39')]),_0xa8cd29);if(_0x25e732[_0x651b('0x37')][_0x651b('0x43')]){_0x509ff5[_0x651b('0x41')]=_[_0x651b('0x44')](_0x509ff5[_0x651b('0x41')],{'$or':_[_0x651b('0x45')](_0xa8cd29,function(_0x461742){if(_0x461742[_0x651b('0x34')]!==_0x651b('0x46')){var _0x44c55b={};_0x44c55b[_0x461742[_0x651b('0x2e')]]={'$like':'%'+_0x25e732[_0x651b('0x37')][_0x651b('0x43')]+'%'};return _0x44c55b;}})});}_0x509ff5=_[_0x651b('0x44')]({},_0x509ff5,_0x25e732[_0x651b('0x47')]);var _0x42c9e3={'where':_0x509ff5[_0x651b('0x41')]};return db[_0x651b('0x31')][_0x651b('0x25')](_0x42c9e3)[_0x651b('0x2b')](function(_0x319e59){_0x118bc1[_0x651b('0x25')]=_0x319e59;if(_0x25e732[_0x651b('0x37')][_0x651b('0x48')]){_0x509ff5[_0x651b('0x49')]=[{'all':!![]}];}return db[_0x651b('0x31')][_0x651b('0x4a')](_0x509ff5);})[_0x651b('0x2b')](function(_0x2c6ff7){_0x118bc1[_0x651b('0x4b')]=_0x2c6ff7;return _0x118bc1;})[_0x651b('0x2b')](respondWithFilteredResult(_0x26ef50,_0x509ff5))[_0x651b('0x4c')](handleError(_0x26ef50,null));};exports['show']=function(_0x1f6f6d,_0x2343d9){var _0x5db8a5={'raw':!![],'where':{'id':_0x1f6f6d['params']['id']}},_0x507596={};_0x507596[_0x651b('0x36')]=_['keys'](db[_0x651b('0x31')]['rawAttributes']);_0x507596[_0x651b('0x37')]=_[_0x651b('0x38')](_0x1f6f6d[_0x651b('0x37')]);_0x507596['filters']=_[_0x651b('0x3a')](_0x507596[_0x651b('0x36')],_0x507596[_0x651b('0x37')]);_0x5db8a5[_0x651b('0x3b')]=_[_0x651b('0x3a')](_0x507596[_0x651b('0x36')],qs[_0x651b('0x3c')](_0x1f6f6d[_0x651b('0x37')][_0x651b('0x3c')]));_0x5db8a5['attributes']=_0x5db8a5[_0x651b('0x3b')][_0x651b('0x3d')]?_0x5db8a5['attributes']:_0x507596[_0x651b('0x36')];if(_0x1f6f6d[_0x651b('0x37')][_0x651b('0x48')]){_0x5db8a5[_0x651b('0x49')]=[{'all':!![]}];}_0x5db8a5=_['merge']({},_0x5db8a5,_0x1f6f6d['options']);return db[_0x651b('0x31')]['find'](_0x5db8a5)[_0x651b('0x2b')](handleEntityNotFound(_0x2343d9,null))[_0x651b('0x2b')](respondWithResult(_0x2343d9,null))[_0x651b('0x4c')](handleError(_0x2343d9,null));};exports['create']=function(_0x39a009,_0x45adcf){return db[_0x651b('0x31')]['create'](_0x39a009[_0x651b('0x4d')],{})[_0x651b('0x2b')](respondWithResult(_0x45adcf,0xc9))[_0x651b('0x4c')](handleError(_0x45adcf,null));};exports['update']=function(_0x3a62bb,_0x1a2918){if(_0x3a62bb[_0x651b('0x4d')]['id']){delete _0x3a62bb[_0x651b('0x4d')]['id'];}return db[_0x651b('0x31')][_0x651b('0x4e')]({'where':{'id':_0x3a62bb[_0x651b('0x4f')]['id']}})[_0x651b('0x2b')](handleEntityNotFound(_0x1a2918,null))['then'](saveUpdates(_0x3a62bb['body'],null))[_0x651b('0x2b')](respondWithResult(_0x1a2918,null))[_0x651b('0x4c')](handleError(_0x1a2918,null));};exports[_0x651b('0x2c')]=function(_0x4b443b,_0x563c38){return db['OpenchannelApplication'][_0x651b('0x4e')]({'where':{'id':_0x4b443b[_0x651b('0x4f')]['id']}})[_0x651b('0x2b')](handleEntityNotFound(_0x563c38,null))[_0x651b('0x2b')](removeEntity(_0x563c38,null))[_0x651b('0x4c')](handleError(_0x563c38,null));};
\ No newline at end of file
index 11b2838..c0bba80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2b3=['define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','path','rimraf','exports'];(function(_0xb66df,_0x4fb5ce){var _0x42a702=function(_0x252d1d){while(--_0x252d1d){_0xb66df['push'](_0xb66df['shift']());}};_0x42a702(++_0x4fb5ce);}(_0xe2b3,0x198));var _0x3e2b=function(_0x72222d,_0x270476){_0x72222d=_0x72222d-0x0;var _0x36a7f8=_0xe2b3[_0x72222d];return _0x36a7f8;};'use strict';var _=require('lodash');var util=require(_0x3e2b('0x0'));var logger=require(_0x3e2b('0x1'))(_0x3e2b('0x2'));var moment=require('moment');var BPromise=require(_0x3e2b('0x3'));var rp=require(_0x3e2b('0x4'));var fs=require('fs');var path=require(_0x3e2b('0x5'));var rimraf=require(_0x3e2b('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelApplication.attributes');module[_0x3e2b('0x7')]=function(_0x497978,_0x28a8ea){return _0x497978[_0x3e2b('0x8')](_0x3e2b('0x9'),attributes,{'tableName':_0x3e2b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3e2b('0xb'),'collate':_0x3e2b('0xc')});};
\ No newline at end of file
+var _0x6017=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x6017,0xb4));var _0x7601=function(_0x4348b1,_0x42b176){_0x4348b1=_0x4348b1-0x0;var _0x211b9c=_0x6017[_0x4348b1];return _0x211b9c;};'use strict';var _=require(_0x7601('0x0'));var util=require(_0x7601('0x1'));var logger=require(_0x7601('0x2'))(_0x7601('0x3'));var moment=require(_0x7601('0x4'));var BPromise=require(_0x7601('0x5'));var rp=require(_0x7601('0x6'));var fs=require('fs');var path=require(_0x7601('0x7'));var rimraf=require(_0x7601('0x8'));var config=require(_0x7601('0x9'));var attributes=require('./openchannelApplication.attributes');module[_0x7601('0xa')]=function(_0x33b5cb,_0x5cfda7){return _0x33b5cb['define'](_0x7601('0xb'),attributes,{'tableName':_0x7601('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7601('0xd'),'collate':_0x7601('0xe')});};
\ No newline at end of file
index 326d2b3..f8ed4cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a9a=['OpenchannelApplication,\x20%s,\x20%s','result','catch','UpdateOpenchannelApplication','update','body','options','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','info','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x49eb3f,_0x125b9c){var _0x206ece=function(_0x53572f){while(--_0x53572f){_0x49eb3f['push'](_0x49eb3f['shift']());}};_0x206ece(++_0x125b9c);}(_0x3a9a,0x122));var _0xa3a9=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0x3a9a[_0x9fd887];return _0x1a54ab;};'use strict';var _=require(_0xa3a9('0x0'));var util=require(_0xa3a9('0x1'));var moment=require(_0xa3a9('0x2'));var BPromise=require(_0xa3a9('0x3'));var rs=require(_0xa3a9('0x4'));var fs=require('fs');var Redis=require(_0xa3a9('0x5'));var db=require(_0xa3a9('0x6'))['db'];var utils=require(_0xa3a9('0x7'));var logger=require(_0xa3a9('0x8'))(_0xa3a9('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa3a9('0xa')][_0xa3a9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f3b90,_0x378b7c,_0x4c8eed){return new BPromise(function(_0x5cbb3d,_0x178bee){return client['request'](_0x1f3b90,_0x4c8eed)['then'](function(_0x596e50){logger[_0xa3a9('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x378b7c,_0xa3a9('0xd'));logger[_0xa3a9('0xe')](_0xa3a9('0xf'),_0x378b7c,_0xa3a9('0xd'),JSON[_0xa3a9('0x10')](_0x596e50));if(_0x596e50[_0xa3a9('0x11')]){if(_0x596e50[_0xa3a9('0x11')][_0xa3a9('0x12')]===0x1f4){logger[_0xa3a9('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x378b7c,_0x596e50[_0xa3a9('0x11')][_0xa3a9('0x13')]);return _0x178bee(_0x596e50[_0xa3a9('0x11')][_0xa3a9('0x13')]);}logger[_0xa3a9('0x11')](_0xa3a9('0x14'),_0x378b7c,_0x596e50[_0xa3a9('0x11')][_0xa3a9('0x13')]);return _0x5cbb3d(_0x596e50[_0xa3a9('0x11')]['message']);}else{logger[_0xa3a9('0xc')](_0xa3a9('0x14'),_0x378b7c,_0xa3a9('0xd'));_0x5cbb3d(_0x596e50[_0xa3a9('0x15')][_0xa3a9('0x13')]);}})[_0xa3a9('0x16')](function(_0x1ae6e0){logger['error'](_0xa3a9('0x14'),_0x378b7c,_0x1ae6e0);_0x178bee(_0x1ae6e0);});});}exports[_0xa3a9('0x17')]=function(_0x5cd616){var _0x46dd04=this;return new Promise(function(_0x19b05e,_0x3afa08){return db['OpenchannelApplication'][_0xa3a9('0x18')](_0x5cd616[_0xa3a9('0x19')],{'raw':_0x5cd616[_0xa3a9('0x1a')]?_0x5cd616[_0xa3a9('0x1a')][_0xa3a9('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5cd616['options']?_0x5cd616[_0xa3a9('0x1a')][_0xa3a9('0x1c')]||null:null,'attributes':_0x5cd616['options']?_0x5cd616['options'][_0xa3a9('0x1d')]||null:null,'limit':_0x5cd616[_0xa3a9('0x1a')]?_0x5cd616[_0xa3a9('0x1a')][_0xa3a9('0x1e')]||null:null})['then'](function(_0x2458a8){logger[_0xa3a9('0xc')](_0xa3a9('0x17'),_0x5cd616);logger[_0xa3a9('0xe')](_0xa3a9('0x17'),_0x5cd616,JSON[_0xa3a9('0x10')](_0x2458a8));_0x19b05e(_0x2458a8);})[_0xa3a9('0x16')](function(_0x380ab4){logger['error']('UpdateOpenchannelApplication',_0x380ab4[_0xa3a9('0x13')],_0x5cd616);_0x3afa08(_0x46dd04['error'](0x1f4,_0x380ab4[_0xa3a9('0x13')]));});});};
\ No newline at end of file
+var _0x5446=['OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UpdateOpenchannelApplication','update','options','raw','where','attributes','limit','info','debug','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x216a80,_0x3d2904){var _0x48dbb0=function(_0x43ae90){while(--_0x43ae90){_0x216a80['push'](_0x216a80['shift']());}};_0x48dbb0(++_0x3d2904);}(_0x5446,0x114));var _0x6544=function(_0x58c978,_0x1455b2){_0x58c978=_0x58c978-0x0;var _0x4ca7fe=_0x5446[_0x58c978];return _0x4ca7fe;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6544('0x0'));var BPromise=require(_0x6544('0x1'));var rs=require(_0x6544('0x2'));var fs=require('fs');var Redis=require(_0x6544('0x3'));var db=require(_0x6544('0x4'))['db'];var utils=require(_0x6544('0x5'));var logger=require(_0x6544('0x6'))(_0x6544('0x7'));var config=require('../../config/environment');var jayson=require(_0x6544('0x8'));var client=jayson['client'][_0x6544('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x7a3360,_0x344e3a,_0x523426){return new BPromise(function(_0x13c691,_0x217456){return client[_0x6544('0xa')](_0x7a3360,_0x523426)[_0x6544('0xb')](function(_0x3dc07d){logger['info'](_0x6544('0xc'),_0x344e3a,_0x6544('0xd'));logger['debug'](_0x6544('0xe'),_0x344e3a,_0x6544('0xd'),JSON[_0x6544('0xf')](_0x3dc07d));if(_0x3dc07d[_0x6544('0x10')]){if(_0x3dc07d[_0x6544('0x10')]['code']===0x1f4){logger[_0x6544('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x344e3a,_0x3dc07d[_0x6544('0x10')][_0x6544('0x11')]);return _0x217456(_0x3dc07d[_0x6544('0x10')]['message']);}logger[_0x6544('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x344e3a,_0x3dc07d[_0x6544('0x10')][_0x6544('0x11')]);return _0x13c691(_0x3dc07d[_0x6544('0x10')][_0x6544('0x11')]);}else{logger['info'](_0x6544('0xc'),_0x344e3a,'request\x20sent');_0x13c691(_0x3dc07d[_0x6544('0x12')][_0x6544('0x11')]);}})['catch'](function(_0x1592ca){logger[_0x6544('0x10')](_0x6544('0xc'),_0x344e3a,_0x1592ca);_0x217456(_0x1592ca);});});}exports[_0x6544('0x13')]=function(_0x4ff6e7){var _0x269b07=this;return new Promise(function(_0x30151a,_0x9b582){return db['OpenchannelApplication'][_0x6544('0x14')](_0x4ff6e7['body'],{'raw':_0x4ff6e7[_0x6544('0x15')]?_0x4ff6e7[_0x6544('0x15')][_0x6544('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ff6e7[_0x6544('0x15')]?_0x4ff6e7[_0x6544('0x15')][_0x6544('0x17')]||null:null,'attributes':_0x4ff6e7[_0x6544('0x15')]?_0x4ff6e7[_0x6544('0x15')][_0x6544('0x18')]||null:null,'limit':_0x4ff6e7[_0x6544('0x15')]?_0x4ff6e7[_0x6544('0x15')][_0x6544('0x19')]||null:null})[_0x6544('0xb')](function(_0x1a56ac){logger[_0x6544('0x1a')](_0x6544('0x13'),_0x4ff6e7);logger[_0x6544('0x1b')](_0x6544('0x13'),_0x4ff6e7,JSON['stringify'](_0x1a56ac));_0x30151a(_0x1a56ac);})[_0x6544('0x1c')](function(_0x330224){logger[_0x6544('0x10')](_0x6544('0x13'),_0x330224[_0x6544('0x11')],_0x4ff6e7);_0x9b582(_0x269b07[_0x6544('0x10')](0x1f4,_0x330224[_0x6544('0x11')]));});});};
\ No newline at end of file
index 92646e2..cc0338d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a4e=['destroy','removeTags','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','index','get','/describe','isAuthenticated','/:id','download','post','/:id/messages','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','openchannelinteraction:update','delete','openchannelinteraction:destroy'];(function(_0x3b0209,_0x29d212){var _0x581f6e=function(_0x231f33){while(--_0x231f33){_0x3b0209['push'](_0x3b0209['shift']());}};_0x581f6e(++_0x29d212);}(_0x5a4e,0xc7));var _0xe5a4=function(_0x4ba3c4,_0x24842d){_0x4ba3c4=_0x4ba3c4-0x0;var _0x2b6605=_0x5a4e[_0x4ba3c4];return _0x2b6605;};'use strict';var multer=require(_0xe5a4('0x0'));var util=require(_0xe5a4('0x1'));var path=require(_0xe5a4('0x2'));var timeout=require(_0xe5a4('0x3'));var express=require('express');var router=express[_0xe5a4('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe5a4('0x5'));var config=require(_0xe5a4('0x6'));var controller=require(_0xe5a4('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xe5a4('0x8')]);router[_0xe5a4('0x9')](_0xe5a4('0xa'),auth[_0xe5a4('0xb')](),controller['describe']);router[_0xe5a4('0x9')](_0xe5a4('0xc'),auth[_0xe5a4('0xb')](),controller['show']);router[_0xe5a4('0x9')]('/:id/messages',auth[_0xe5a4('0xb')](),controller['getMessages']);router[_0xe5a4('0x9')]('/:id/download',auth[_0xe5a4('0xb')](),controller[_0xe5a4('0xd')]);router[_0xe5a4('0xe')]('/',auth[_0xe5a4('0xb')](),controller['create']);router[_0xe5a4('0xe')](_0xe5a4('0xf'),auth['isAuthenticated'](),controller[_0xe5a4('0x10')]);router['post'](_0xe5a4('0x11'),auth[_0xe5a4('0xb')](),interaction[_0xe5a4('0x12')](_0xe5a4('0x13'),_0xe5a4('0x14')),controller[_0xe5a4('0x15')]);router['put'](_0xe5a4('0xc'),auth['isAuthenticated'](),interaction[_0xe5a4('0x12')](_0xe5a4('0x13'),_0xe5a4('0x16')),controller['update']);router[_0xe5a4('0x17')](_0xe5a4('0xc'),auth['isAuthenticated'](),interaction['tracked']('openchannel',_0xe5a4('0x18')),controller[_0xe5a4('0x19')]);router[_0xe5a4('0x17')](_0xe5a4('0x11'),auth['isAuthenticated'](),controller[_0xe5a4('0x1a')]);module[_0xe5a4('0x1b')]=router;
\ No newline at end of file
+var _0xd4ea=['getMessages','/:id/download','post','create','addMessage','openchannelinteraction:addtags','put','/:id','openchannelinteraction:update','update','tracked','openchannel','openchannelinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','index','get','/describe','describe','show'];(function(_0x59f0ff,_0x2b9d67){var _0x28e782=function(_0x437e09){while(--_0x437e09){_0x59f0ff['push'](_0x59f0ff['shift']());}};_0x28e782(++_0x2b9d67);}(_0xd4ea,0xd1));var _0xad4e=function(_0xfe3d70,_0x7ed740){_0xfe3d70=_0xfe3d70-0x0;var _0x2a30ac=_0xd4ea[_0xfe3d70];return _0x2a30ac;};'use strict';var multer=require(_0xad4e('0x0'));var util=require(_0xad4e('0x1'));var path=require(_0xad4e('0x2'));var timeout=require(_0xad4e('0x3'));var express=require(_0xad4e('0x4'));var router=express['Router']();var fs_extra=require(_0xad4e('0x5'));var auth=require(_0xad4e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xad4e('0x7'));var controller=require(_0xad4e('0x8'));router['get']('/',auth[_0xad4e('0x9')](),controller[_0xad4e('0xa')]);router[_0xad4e('0xb')](_0xad4e('0xc'),auth['isAuthenticated'](),controller[_0xad4e('0xd')]);router[_0xad4e('0xb')]('/:id',auth[_0xad4e('0x9')](),controller[_0xad4e('0xe')]);router[_0xad4e('0xb')]('/:id/messages',auth[_0xad4e('0x9')](),controller[_0xad4e('0xf')]);router[_0xad4e('0xb')](_0xad4e('0x10'),auth[_0xad4e('0x9')](),controller['download']);router[_0xad4e('0x11')]('/',auth[_0xad4e('0x9')](),controller[_0xad4e('0x12')]);router['post']('/:id/messages',auth['isAuthenticated'](),controller[_0xad4e('0x13')]);router[_0xad4e('0x11')]('/:id/tags',auth[_0xad4e('0x9')](),interaction['tracked']('openchannel',_0xad4e('0x14')),controller['addTags']);router[_0xad4e('0x15')](_0xad4e('0x16'),auth['isAuthenticated'](),interaction['tracked']('openchannel',_0xad4e('0x17')),controller[_0xad4e('0x18')]);router['delete'](_0xad4e('0x16'),auth['isAuthenticated'](),interaction[_0xad4e('0x19')](_0xad4e('0x1a'),_0xad4e('0x1b')),controller[_0xad4e('0x1c')]);router['delete'](_0xad4e('0x1d'),auth[_0xad4e('0x9')](),controller[_0xad4e('0x1e')]);module[_0xad4e('0x1f')]=router;
\ No newline at end of file
index 0f1b398..55e1570 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0b4=['out','BOOLEAN','sequelize','DATE','STRING','ENUM'];(function(_0x484e74,_0x4e62bd){var _0x2874fa=function(_0x6c79dd){while(--_0x6c79dd){_0x484e74['push'](_0x484e74['shift']());}};_0x2874fa(++_0x4e62bd);}(_0xb0b4,0xb6));var _0x4b0b=function(_0x5aad6b,_0x2cd875){_0x5aad6b=_0x5aad6b-0x0;var _0x11654b=_0xb0b4[_0x5aad6b];return _0x11654b;};'use strict';var Sequelize=require(_0x4b0b('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4b0b('0x1')]},'disposition':{'type':Sequelize[_0x4b0b('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x4b0b('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x4b0b('0x1')]},'threadId':{'type':Sequelize[_0x4b0b('0x2')]},'externalUrl':{'type':Sequelize[_0x4b0b('0x2')]},'lastMsgAt':{'type':Sequelize[_0x4b0b('0x1')]},'lastMsgDirection':{'type':Sequelize[_0x4b0b('0x3')]('in',_0x4b0b('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x4b0b('0x2')]},'autoreplyExecuted':{'type':Sequelize[_0x4b0b('0x5')],'defaultValue':![]}};
\ No newline at end of file
+var _0xc3d6=['DATE','STRING','out','sequelize','exports','BOOLEAN'];(function(_0x5a2291,_0x3ddda7){var _0x10e3f5=function(_0xc510cc){while(--_0xc510cc){_0x5a2291['push'](_0x5a2291['shift']());}};_0x10e3f5(++_0x3ddda7);}(_0xc3d6,0x153));var _0x6c3d=function(_0x20a41b,_0x1dc833){_0x20a41b=_0x20a41b-0x0;var _0x388a1b=_0xc3d6[_0x20a41b];return _0x388a1b;};'use strict';var Sequelize=require(_0x6c3d('0x0'));module[_0x6c3d('0x1')]={'closed':{'type':Sequelize[_0x6c3d('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6c3d('0x3')]},'disposition':{'type':Sequelize[_0x6c3d('0x4')]},'secondDisposition':{'type':Sequelize[_0x6c3d('0x4')]},'thirdDisposition':{'type':Sequelize[_0x6c3d('0x4')]},'note':{'type':Sequelize[_0x6c3d('0x4')]},'read1stAt':{'type':Sequelize[_0x6c3d('0x3')]},'threadId':{'type':Sequelize[_0x6c3d('0x4')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x6c3d('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x6c3d('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0x6c3d('0x2')],'defaultValue':![]}};
\ No newline at end of file
index 5590d49..ae24b5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4574=['fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','select','field','name','from','tools_tags','u.id','u.fullname','user_has_openchannel_interactions','users','openchannel_interactions','left_join','cm_contacts','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','expr','search','parseSearch','sqlOperator','length','conditions','unreadMessages','having','`\x20=\x200','`\x20>\x200','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','Tag','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','text','start','body','some','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','contactName','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','c.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','rows','show','params','includeAll','include','options','create','describe','addMessage','ids','getMessages','findOne','OpenchannelMessage','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','color','emit','download','unix','root','server','files','tmp','join','attachments','Contact','firstName','Attachment','Messages','OpenchannelAccount','Account','fullname','get','Openchannel','Owner','N.A.','closed','closedAt','threadId','existsSync','createReadStream','pipe','createWriteStream','basename','direction','out','System','lastName','secret','renderFile','views','downloadInteraction.ejs','.pdf','unlinkSync','eml-format','rimraf','request-promise','moment','bluebird','util','sox','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','error','stack','TagIds','forEach','push','catch','index','map','OpenchannelInteraction','rawAttributes'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x4574,0x199));var _0x4457=function(_0x45581a,_0x2225db){_0x45581a=_0x45581a-0x0;var _0x11c122=_0x4574[_0x45581a];return _0x11c122;};'use strict';var emlformat=require(_0x4457('0x0'));var rimraf=require(_0x4457('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4457('0x2'));var moment=require(_0x4457('0x3'));var BPromise=require(_0x4457('0x4'));var Mustache=require('mustache');var util=require(_0x4457('0x5'));var path=require('path');var sox=require(_0x4457('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4457('0x7'));var _=require(_0x4457('0x8'));var squel=require('squel');var crypto=require(_0x4457('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x4457('0xa'));var toCsv=require('to-csv');var querystring=require(_0x4457('0xb'));var Papa=require(_0x4457('0xc'));var Redis=require(_0x4457('0xd'));var authService=require(_0x4457('0xe'));var qs=require(_0x4457('0xf'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4457('0x10'));var utils=require(_0x4457('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x4457('0x12')]=_[_0x4457('0x13')](config[_0x4457('0x12')],{'host':'localhost','port':0x18eb});var socket=require(_0x4457('0x14'))(new Redis(config[_0x4457('0x12')]));require(_0x4457('0x15'))[_0x4457('0x16')](socket);function respondWithStatusCode(_0x9975a7,_0x286b7e){_0x286b7e=_0x286b7e||0xcc;return function(_0x4d5d0f){if(_0x4d5d0f){return _0x9975a7[_0x4457('0x17')](_0x286b7e);}return _0x9975a7[_0x4457('0x18')](_0x286b7e)[_0x4457('0x19')]();};}function respondWithResult(_0x5467b0,_0x2f1b45){_0x2f1b45=_0x2f1b45||0xc8;return function(_0x4e5887){if(_0x4e5887){return _0x5467b0[_0x4457('0x18')](_0x2f1b45)[_0x4457('0x1a')](_0x4e5887);}};}function respondWithFilteredResult(_0x24c358,_0x11ac57){return function(_0x2f78aa){if(_0x2f78aa){var _0x5eaf38=typeof _0x11ac57['offset']===_0x4457('0x1b')&&typeof _0x11ac57[_0x4457('0x1c')]===_0x4457('0x1b');var _0x1cacac=_0x2f78aa[_0x4457('0x1d')];var _0x12589b=_0x5eaf38?0x0:_0x11ac57[_0x4457('0x1e')];var _0x4ec580=_0x5eaf38?_0x2f78aa[_0x4457('0x1d')]:_0x11ac57[_0x4457('0x1e')]+_0x11ac57['limit'];var _0x72e831;if(_0x4ec580>=_0x1cacac){_0x4ec580=_0x1cacac;_0x72e831=0xc8;}else{_0x72e831=0xce;}_0x24c358[_0x4457('0x18')](_0x72e831);return _0x24c358[_0x4457('0x1f')](_0x4457('0x20'),_0x12589b+'-'+_0x4ec580+'/'+_0x1cacac)['json'](_0x2f78aa);}return null;};}function patchUpdates(_0x5088af){return function(_0x372dd8){try{jsonpatch['apply'](_0x372dd8,_0x5088af,!![]);}catch(_0xc18135){return BPromise['reject'](_0xc18135);}return _0x372dd8[_0x4457('0x21')]();};}function saveUpdates(_0x59bded,_0x58c9a3){return function(_0x55b0c3){if(_0x55b0c3){return _0x55b0c3[_0x4457('0x22')](_0x59bded)[_0x4457('0x23')](function(_0x25d184){return _0x25d184;});}return null;};}function removeEntity(_0x3bff5f,_0x21963e){return function(_0xa61cfb){if(_0xa61cfb){return _0xa61cfb[_0x4457('0x24')]()[_0x4457('0x23')](function(){_0x3bff5f[_0x4457('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f252e,_0x5b4f8c){return function(_0x31a0bd){if(!_0x31a0bd){_0x5f252e[_0x4457('0x17')](0x194);}return _0x31a0bd;};}function handleError(_0x346d6a,_0x144c25){_0x144c25=_0x144c25||0x1f4;return function(_0x249e97){logger[_0x4457('0x25')](_0x249e97[_0x4457('0x26')]);if(_0x249e97['name']){delete _0x249e97['name'];}_0x346d6a['status'](_0x144c25)['send'](_0x249e97);};}function getInteractionUsers(_0xfe5c68,_0x495c5a){return new BPromise(function(_0x5e27e8,_0xc0735c){try{if(_0x495c5a[_0xfe5c68['id']]){_0xfe5c68['Users']=_['map'](_0x495c5a[_0xfe5c68['id']],function(_0xa7ec2d){return{'id':_0xa7ec2d['id'],'fullname':_0xa7ec2d['fullname']};});}}catch(_0x1861b5){_0xc0735c(_0x1861b5);}_0x5e27e8(_0xfe5c68);});}function getInteractionTags(_0x54225b,_0x5d46f5){return new BPromise(function(_0x452df4,_0x24eb69){try{if(_0x54225b[_0x4457('0x27')]){_0x54225b['Tags']=[];_0x54225b[_0x4457('0x27')]['split'](',')[_0x4457('0x28')](function(_0x4d4a9e){_0x54225b['Tags'][_0x4457('0x29')](_0x5d46f5[_0x4d4a9e]);});}delete _0x54225b['TagIds'];}catch(_0x26c37e){_0x24eb69(_0x26c37e);}_0x452df4(_0x54225b);});}function updateOpenchannelInteraction(_0x5e8c27,_0x40dadf,_0x26d1b9){return new BPromise(function(_0x597b6c,_0x434106){return getInteractionUsers(_0x5e8c27,_0x26d1b9)['then'](function(_0x48436a){return getInteractionTags(_0x48436a,_0x40dadf);})[_0x4457('0x23')](function(_0x52ad3e){_0x597b6c(_0x52ad3e);})[_0x4457('0x2a')](function(_0x458d50){_0x434106(_0x458d50);});});}exports[_0x4457('0x2b')]=function(_0x4e136f,_0x41c699){var _0x20e0e8={},_0x4a2606={},_0x29787b={'count':0x0,'rows':[]};var _0x34914b=_[_0x4457('0x2c')](db[_0x4457('0x2d')][_0x4457('0x2e')],function(_0x4b7d63){return{'name':_0x4b7d63[_0x4457('0x2f')],'type':_0x4b7d63[_0x4457('0x30')][_0x4457('0x31')]};});_0x4a2606[_0x4457('0x32')]=_[_0x4457('0x2c')](_0x34914b,'name');_0x4a2606[_0x4457('0x33')]=_[_0x4457('0x34')](_0x4e136f[_0x4457('0x33')]);_0x4a2606[_0x4457('0x35')]=_[_0x4457('0x36')](_0x4a2606[_0x4457('0x32')],_0x4a2606[_0x4457('0x33')]);_0x20e0e8[_0x4457('0x37')]=_[_0x4457('0x36')](_0x4a2606[_0x4457('0x32')],qs[_0x4457('0x38')](_0x4e136f[_0x4457('0x33')]['fields']));_0x20e0e8['attributes']=_0x20e0e8[_0x4457('0x37')]['length']?_0x20e0e8[_0x4457('0x37')]:_0x4a2606[_0x4457('0x32')];if(!_0x4e136f[_0x4457('0x33')]['hasOwnProperty'](_0x4457('0x39'))){_0x20e0e8['limit']=qs[_0x4457('0x1c')](_0x4e136f['query']['limit']);_0x20e0e8[_0x4457('0x1e')]=qs['offset'](_0x4e136f[_0x4457('0x33')][_0x4457('0x1e')]);}_0x20e0e8[_0x4457('0x3a')]=qs[_0x4457('0x3b')](_0x4e136f[_0x4457('0x33')]['sort']);_0x20e0e8[_0x4457('0x3c')]=qs[_0x4457('0x35')](_[_0x4457('0x3d')](_0x4e136f[_0x4457('0x33')],_0x4a2606[_0x4457('0x35')]),_0x34914b);var _0x53567a=[];var _0x44abf5=squel[_0x4457('0x3e')]()[_0x4457('0x3f')]('id')[_0x4457('0x3f')](_0x4457('0x40'))[_0x4457('0x3f')]('color')[_0x4457('0x41')](_0x4457('0x42'));var _0x447631=squel[_0x4457('0x3e')]()[_0x4457('0x3f')](_0x4457('0x43'))[_0x4457('0x3f')](_0x4457('0x44'))[_0x4457('0x3f')]('ui.OpenchannelInteractionId')['from'](_0x4457('0x45'),'ui')['left_join'](_0x4457('0x46'),'u','u.id\x20=\x20ui.UserId');var _0x5162ee=squel[_0x4457('0x3e')]()[_0x4457('0x41')](_0x4457('0x47'),'i')[_0x4457('0x48')](_0x4457('0x49'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0x4457('0x4a'))['left_join'](_0x4457('0x4b'),'a',_0x4457('0x4c'))[_0x4457('0x48')](_0x4457('0x4d'),'me',_0x4457('0x4e'))[_0x4457('0x48')](_0x4457('0x4f'),'it',_0x4457('0x50'))[_0x4457('0x48')](_0x4457('0x42'),'t',_0x4457('0x51'));var _0x279314=squel[_0x4457('0x52')]();var _0x5e710e=[];var _0x184f30=squel[_0x4457('0x52')]();var _0x3c0b16;if(_0x4e136f[_0x4457('0x33')][_0x4457('0x53')]){_0x3c0b16=as[_0x4457('0x54')](_0x4e136f['query'][_0x4457('0x53')]);var _0x2c025a=_0x3c0b16[_0x4457('0x55')];for(var _0xdcdfb8=0x0;_0xdcdfb8<_0x3c0b16['conditions'][_0x4457('0x56')];_0xdcdfb8++){var _0x92387a=_0x3c0b16[_0x4457('0x57')][_0xdcdfb8];var _0x54d872='i';var _0x47abc0=_['find'](_0x34914b,[_0x4457('0x40'),_0x92387a[_0x4457('0x3f')]]);if(!_0x47abc0){switch(_0x92387a[_0x4457('0x3f')]){case _0x4457('0x58'):if(_0x92387a['value']==0x1){_0x5162ee[_0x4457('0x59')]('`'+_0x92387a[_0x4457('0x3f')]+_0x4457('0x5a'));}else{_0x5162ee[_0x4457('0x59')]('`'+_0x92387a[_0x4457('0x3f')]+_0x4457('0x5b'));}break;case'Contact':if(_0x92387a['operator']===_0x4457('0x5c')){if(_0x92387a[_0x4457('0x5d')]['split']('\x20')[_0x4457('0x56')]>0x1){_0x279314[_0x2c025a](_0x4457('0x5e'),qs['getFullTextValue'](_0x92387a[_0x4457('0x5d')]),null);}else{var _0x5dc7bd='%'+_0x92387a[_0x4457('0x5d')]+'%';_0x279314[_0x2c025a](_0x4457('0x5f'),_0x5dc7bd,_0x5dc7bd,_0x5dc7bd);}}else{_0x47abc0=_[_0x4457('0x60')](_0x34914b,['name','ContactId']);_0x92387a['field']=_0x4457('0x61');_0xf08032=as['buildExpression'](_0x54d872,_0x47abc0[_0x4457('0x30')],_0x92387a);_0x279314[_0x2c025a](_0xf08032['text'],_0xf08032[_0x4457('0x5d')]['start'],_0xf08032[_0x4457('0x5d')][_0x4457('0x19')]);}break;case _0x4457('0x62'):var _0x2cc5b4=_0x92387a[_0x4457('0x5d')][_0x4457('0x63')](',')[_0x4457('0x2c')](function(_0x1b42f7){return Number(_0x1b42f7);});_0x2cc5b4['forEach'](function(_0x3eaa53){_0x184f30['or'](_0x4457('0x64'),'%,'+_0x3eaa53+',%');});_0x5e710e=_['union'](_0x5e710e,_0x2cc5b4);break;case _0x4457('0x65'):if(_0x92387a[_0x4457('0x66')]===_0x4457('0x5c')){_0x279314[_0x2c025a](_0x4457('0x67'),'%'+_0x92387a[_0x4457('0x5d')]+'%',null);}else{_0x47abc0=_[_0x4457('0x60')](_0x34914b,['name','UserId']);_0x92387a[_0x4457('0x3f')]=_0x4457('0x68');_0xf08032=as[_0x4457('0x69')](_0x54d872,_0x47abc0['type'],_0x92387a);_0x279314[_0x2c025a](_0xf08032[_0x4457('0x6a')],_0xf08032['value'][_0x4457('0x6b')],_0xf08032[_0x4457('0x5d')][_0x4457('0x19')]);}break;case _0x4457('0x6c'):_0xf08032=as[_0x4457('0x69')]('me',null,_0x92387a);_0x279314[_0x2c025a](_0xf08032[_0x4457('0x6a')],_0xf08032[_0x4457('0x5d')]['start'],_0xf08032[_0x4457('0x5d')][_0x4457('0x19')]);break;}}else{var _0xf08032=as[_0x4457('0x69')](_0x54d872,_0x47abc0[_0x4457('0x30')],_0x92387a);_0x279314[_0x2c025a](_0xf08032[_0x4457('0x6a')],_0xf08032[_0x4457('0x5d')]['start'],_0xf08032[_0x4457('0x5d')]['end']);}}}else{var _0x36d83b=_(_0x4e136f[_0x4457('0x33')])[_0x4457('0x34')]()['map'](function(_0x4e6b80){return _[_0x4457('0x6d')](_0x34914b,[_0x4457('0x40'),_0x4e6b80])?_0x4e6b80:undefined;})[_0x4457('0x6e')]()[_0x4457('0x5d')]();if(!_[_0x4457('0x6f')](_0x36d83b)){_0x36d83b[_0x4457('0x28')](function(_0xd33656){if(_0xd33656===_0x4457('0x70')){_0x5162ee['where'](_0x4457('0x71'),[][_0x4457('0x72')](_0x4e136f[_0x4457('0x33')][_0xd33656]));}else if(_0xd33656===_0x4457('0x73')){var _0x9599d0=JSON[_0x4457('0x74')](_0x4e136f['query'][_0xd33656])[_0x4457('0x75')];var _0x3ef215=JSON['parse'](_0x4e136f[_0x4457('0x33')][_0xd33656])[_0x4457('0x76')];_0x5162ee[_0x4457('0x3c')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x9599d0,_0x3ef215);}else{if(_0x4e136f[_0x4457('0x33')][_0xd33656]===_0x4457('0x77')){_0x5162ee['where']('i.'+_0xd33656+_0x4457('0x78'));}else{_0x5162ee[_0x4457('0x3c')]('i.'+_0xd33656+'\x20=\x20?',_0x4e136f['query'][_0xd33656]);}}});}if(_0x4e136f[_0x4457('0x33')]['read']){if(_0x4e136f[_0x4457('0x33')][_0x4457('0x79')]==0x1){_0x5162ee[_0x4457('0x59')](_0x4457('0x7a'));}else{_0x5162ee['having'](_0x4457('0x7b'));}}if(_0x4e136f[_0x4457('0x33')][_0x4457('0x7c')]){_0x5e710e=_[_0x4457('0x7d')](_0x4e136f['query'][_0x4457('0x7c')])?_0x4e136f[_0x4457('0x33')][_0x4457('0x7c')]:new Array(_0x4e136f[_0x4457('0x33')][_0x4457('0x7c')]);_0x5e710e[_0x4457('0x28')](function(_0x1de277){_0x184f30['or'](_0x4457('0x64'),'%,'+_0x1de277+',%');});}if(_0x4e136f['query'][_0x4457('0x7e')]){var _0x16d855=_0x4e136f['query']['filter']['replace']('\x5c','\x5c\x5c')[_0x4457('0x7f')](/'/g,'\x27\x27');if(qs[_0x4457('0x80')](_0x16d855)){_0x279314['or']('i.id\x20LIKE\x20?',_0x16d855+'%');}else{_0x279314['or'](_0x4457('0x81'),qs[_0x4457('0x82')](_0x16d855))['or'](_0x4457('0x83'),_0x16d855+'%')['or'](_0x4457('0x84'),_0x16d855+'%');}}}_0x5162ee[_0x4457('0x3c')](_0x279314);_0x5162ee[_0x4457('0x85')](_0x4457('0x86'));var _0x532a4b={'type':db[_0x4457('0x87')][_0x4457('0x88')]['SELECT'],'raw':!![]};var _0x8de31=_0x5162ee[_0x4457('0x89')]();_0x8de31[_0x4457('0x3f')]('i.id');_0x8de31[_0x4457('0x3f')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x20e0e8[_0x4457('0x3a')]){_0x20e0e8[_0x4457('0x3a')][_0x4457('0x28')](function(_0x3e07b7){var _0x50873f=_0x3e07b7[0x0]===_0x4457('0x8a')?_0x3e07b7[0x0]:'i.'+_0x3e07b7[0x0];_0x5162ee['order'](_0x50873f,_0x3e07b7[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x5e710e)){_0x5162ee[_0x4457('0x59')](_0x184f30);_0x8de31['where']('t.id\x20IN\x20?',_0x5e710e);}BPromise[_0x4457('0x8b')]()['then'](function(){if(!_0x3c0b16){if(_0x4e136f['query']['OpenchannelAccountId'])return;_0x8de31[_0x4457('0x3c')](_0x4457('0x8c'));_0x5162ee[_0x4457('0x3c')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x4e136f[_0x4457('0x8d')][_0x4457('0x8e')]!==_0x4457('0x8f'))return;return _0x4e136f['user'][_0x4457('0x90')]({'attributes':['id'],'raw':!![]})['then'](function(_0x33d5dc){if(_['isEmpty'](_0x33d5dc)){_0x8de31[_0x4457('0x3c')](_0x4457('0x91'));_0x5162ee[_0x4457('0x3c')](_0x4457('0x91'));}else{_0x8de31[_0x4457('0x3c')](_0x4457('0x71'),_[_0x4457('0x2c')](_0x33d5dc,'id'));_0x5162ee[_0x4457('0x3c')](_0x4457('0x71'),_['map'](_0x33d5dc,'id'));}});})[_0x4457('0x23')](function(){if(_0x4e136f['user'][_0x4457('0x8e')]===_0x4457('0x8f')&&!_0x3c0b16&&!_0x4e136f[_0x4457('0x33')][_0x4457('0x70')])return[];return db[_0x4457('0x92')][_0x4457('0x33')](_0x8de31[_0x4457('0x93')](),_0x532a4b);})[_0x4457('0x23')](function(_0x81dd70){_0x29787b['count']=_0x81dd70[_0x4457('0x56')];if(_0x29787b[_0x4457('0x1d')]===0x0)return[];return db[_0x4457('0x92')][_0x4457('0x33')](_0x44abf5[_0x4457('0x93')](),_0x532a4b)['then'](function(_0x4dd803){_0x53567a=_[_0x4457('0x94')](_0x4dd803,'id');_0x532a4b=_[_0x4457('0x95')](_0x532a4b,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4e136f[_0x4457('0x33')][_0x4457('0x38')]){_0x20e0e8[_0x4457('0x37')][_0x4457('0x28')](function(_0x822892){_0x5162ee[_0x4457('0x3f')]('i.'+_0x822892);});}else{_0x5162ee['field'](_0x4457('0x96'),_0x4457('0x58'));_0x5162ee['field'](_0x4457('0x97'),'Account.key');_0x5162ee['field'](_0x4457('0x98'),'Account.mandatoryDisposition');_0x5162ee[_0x4457('0x3f')](_0x4457('0x99'),_0x4457('0x8a'));_0x5162ee['field'](_0x4457('0x9a'));_0x5162ee[_0x4457('0x3f')](_0x4457('0x9b'),'Contact.firstName');_0x5162ee[_0x4457('0x3f')](_0x4457('0x9c'),_0x4457('0x9d'));_0x5162ee[_0x4457('0x3f')](_0x4457('0x9e'),'Contact.email');_0x5162ee['field'](_0x4457('0x9f'),'Contact.phone');_0x5162ee[_0x4457('0x3f')](_0x4457('0xa0'),'Contact.mobile');_0x5162ee[_0x4457('0x3f')](_0x4457('0xa1'),_0x4457('0xa2'));_0x5162ee[_0x4457('0x3f')](_0x4457('0xa3'),_0x4457('0xa4'));_0x5162ee['field'](_0x4457('0xa5'),_0x4457('0xa6'));_0x5162ee[_0x4457('0x3f')](_0x4457('0xa7'),_0x4457('0x27'));}if(_0x20e0e8[_0x4457('0x1c')])_0x5162ee['limit'](_0x20e0e8[_0x4457('0x1c')]);if(_0x20e0e8['offset'])_0x5162ee[_0x4457('0x1e')](_0x20e0e8[_0x4457('0x1e')]);return db[_0x4457('0x92')][_0x4457('0x33')](_0x5162ee[_0x4457('0x93')](),_0x532a4b);})[_0x4457('0x23')](function(_0x50bd56){if(_0x50bd56[_0x4457('0x56')]>0x0)_0x447631['where'](_0x4457('0xa8'),_['map'](_0x50bd56,'id'));return db[_0x4457('0x92')][_0x4457('0x33')](_0x447631[_0x4457('0x93')](),_0x532a4b)[_0x4457('0x23')](function(_0x6aeba8){var _0x42d700=_[_0x4457('0xa9')](_0x6aeba8,_0x4457('0xaa'));var _0x3fc837=[];_0x50bd56[_0x4457('0x28')](function(_0x2ad0ed){_0x3fc837['push'](updateOpenchannelInteraction(_0x2ad0ed,_0x53567a,_0x42d700));});return BPromise['all'](_0x3fc837);});});})['then'](function(_0x45d1db){_0x29787b[_0x4457('0xab')]=_0x45d1db;return _0x29787b;})[_0x4457('0x23')](respondWithFilteredResult(_0x41c699,_0x20e0e8))['catch'](handleError(_0x41c699,null));};exports[_0x4457('0xac')]=function(_0x436b8e,_0x4fad9a){var _0x499ece={};if(_0x436b8e[_0x4457('0x33')][_0x4457('0x30')]&&_0x436b8e[_0x4457('0x33')][_0x4457('0x30')]===_0x4457('0x41')){_0x499ece[_0x4457('0x41')]=_0x436b8e[_0x4457('0xad')]['id'];}else{_0x499ece['id']=_0x436b8e['params']['id'];}var _0xcac3ac={'raw':![],'where':_0x499ece},_0x39226a={};_0x39226a[_0x4457('0x32')]=_['keys'](db['OpenchannelInteraction']['rawAttributes']);_0x39226a[_0x4457('0x33')]=_[_0x4457('0x34')](_0x436b8e[_0x4457('0x33')]);_0x39226a[_0x4457('0x35')]=_[_0x4457('0x36')](_0x39226a[_0x4457('0x32')],_0x39226a[_0x4457('0x33')]);_0xcac3ac['attributes']=_[_0x4457('0x36')](_0x39226a['model'],qs[_0x4457('0x38')](_0x436b8e['query'][_0x4457('0x38')]));_0xcac3ac['attributes']=_0xcac3ac[_0x4457('0x37')][_0x4457('0x56')]?_0xcac3ac['attributes']:_0x39226a[_0x4457('0x32')];if(_0x436b8e[_0x4457('0x33')][_0x4457('0xae')]){_0xcac3ac[_0x4457('0xaf')]=[{'all':!![]}];}_0xcac3ac=_[_0x4457('0x95')]({},_0xcac3ac,_0x436b8e[_0x4457('0xb0')]);return db[_0x4457('0x2d')][_0x4457('0x60')](_0xcac3ac)[_0x4457('0x23')](handleEntityNotFound(_0x4fad9a,null))[_0x4457('0x23')](respondWithResult(_0x4fad9a,null))[_0x4457('0x2a')](handleError(_0x4fad9a,null));};exports[_0x4457('0xb1')]=function(_0x57be93,_0x2f514e){return db[_0x4457('0x2d')][_0x4457('0xb1')](_0x57be93[_0x4457('0x6c')],{})['then'](respondWithResult(_0x2f514e,0xc9))[_0x4457('0x2a')](handleError(_0x2f514e,null));};exports[_0x4457('0x22')]=function(_0x2747ad,_0x4213f9){if(_0x2747ad[_0x4457('0x6c')]['id']){delete _0x2747ad['body']['id'];}return db[_0x4457('0x2d')][_0x4457('0x60')]({'where':{'id':_0x2747ad[_0x4457('0xad')]['id']}})[_0x4457('0x23')](handleEntityNotFound(_0x4213f9,null))[_0x4457('0x23')](saveUpdates(_0x2747ad['body'],null))[_0x4457('0x23')](respondWithResult(_0x4213f9,null))[_0x4457('0x2a')](handleError(_0x4213f9,null));};exports[_0x4457('0x24')]=function(_0x430224,_0x1bcf9c){return db['OpenchannelInteraction'][_0x4457('0x60')]({'where':{'id':_0x430224[_0x4457('0xad')]['id']}})['then'](handleEntityNotFound(_0x1bcf9c,null))[_0x4457('0x23')](removeEntity(_0x1bcf9c,null))[_0x4457('0x2a')](handleError(_0x1bcf9c,null));};exports[_0x4457('0xb2')]=function(_0x226a35,_0x4f5819){return db['OpenchannelInteraction']['describe']()[_0x4457('0x23')](respondWithResult(_0x4f5819,null))[_0x4457('0x2a')](handleError(_0x4f5819,null));};exports[_0x4457('0xb3')]=function(_0x5e8427,_0x204c61,_0x47b876){return db['OpenchannelMessage'][_0x4457('0x60')]({'where':{'id':_0x5e8427[_0x4457('0xad')]['id']}})[_0x4457('0x23')](handleEntityNotFound(_0x204c61,null))[_0x4457('0x23')](function(_0x3a9b6f){if(_0x3a9b6f){return _0x3a9b6f[_0x4457('0xb3')](_0x5e8427[_0x4457('0x6c')]['ids'],_['omit'](_0x5e8427[_0x4457('0x6c')],[_0x4457('0xb4'),'id'])||{});}})['then'](respondWithResult(_0x204c61,null))[_0x4457('0x2a')](handleError(_0x204c61,null));};exports[_0x4457('0xb5')]=function(_0x1a2343,_0x2e7544,_0x169d82){var _0x44463e={'raw':![],'where':{}};var _0x41e7ad={};var _0x54b368={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x4457('0xb6')]({'where':{'id':_0x1a2343[_0x4457('0xad')]['id']}})[_0x4457('0x23')](handleEntityNotFound(_0x2e7544,null))[_0x4457('0x23')](function(_0x53b15c){if(_0x53b15c){_0x41e7ad['model']=_[_0x4457('0x34')](db[_0x4457('0xb7')][_0x4457('0x2e')]);_0x41e7ad[_0x4457('0x33')]=_['keys'](_0x1a2343[_0x4457('0x33')]);_0x41e7ad[_0x4457('0x35')]=_[_0x4457('0x36')](_0x41e7ad['model'],_0x41e7ad[_0x4457('0x33')]);_0x44463e[_0x4457('0x37')]=_[_0x4457('0x36')](_0x41e7ad[_0x4457('0x32')],qs[_0x4457('0x38')](_0x1a2343[_0x4457('0x33')][_0x4457('0x38')]));_0x44463e['attributes']=_0x44463e[_0x4457('0x37')][_0x4457('0x56')]?_0x44463e[_0x4457('0x37')]:_0x41e7ad[_0x4457('0x32')];if(!_0x1a2343[_0x4457('0x33')]['hasOwnProperty'](_0x4457('0x39'))){_0x44463e[_0x4457('0x1c')]=qs[_0x4457('0x1c')](_0x1a2343[_0x4457('0x33')][_0x4457('0x1c')]);_0x44463e['offset']=qs[_0x4457('0x1e')](_0x1a2343['query'][_0x4457('0x1e')]);}_0x44463e[_0x4457('0x3a')]=qs[_0x4457('0x3b')](_0x1a2343['query'][_0x4457('0x3b')]);_0x44463e[_0x4457('0x3c')]=qs[_0x4457('0x35')](_[_0x4457('0x3d')](_0x1a2343['query'],_0x41e7ad['filters']));_0x44463e[_0x4457('0x3c')][_0x4457('0xaa')]=_0x53b15c['id'];if(_0x1a2343[_0x4457('0x33')][_0x4457('0x7e')]){_0x44463e[_0x4457('0x3c')]=_[_0x4457('0x95')](_0x44463e['where'],{'$or':_[_0x4457('0x2c')](_0x44463e[_0x4457('0x37')],function(_0x3ef4a1){var _0x1fc17c={};_0x1fc17c[_0x3ef4a1]={'$like':'%'+_0x1a2343[_0x4457('0x33')][_0x4457('0x7e')]+'%'};return _0x1fc17c;})});}if(_0x1a2343[_0x4457('0x33')][_0x4457('0x75')]){var _0x47d583=_0x1a2343[_0x4457('0x33')][_0x4457('0x75')][_0x4457('0x63')](',');var _0x203028={};_0x203028[_0x47d583[0x0]]={'$gte':moment(_0x47d583[0x1])[_0x4457('0xb8')](_0x4457('0xb9'))};_0x44463e['where']=_[_0x4457('0x95')](_0x44463e['where'],_0x203028);}_0x44463e=_[_0x4457('0x95')]({},_0x44463e,_0x1a2343[_0x4457('0xb0')]);return db[_0x4457('0xb7')][_0x4457('0x1d')]({'where':_0x44463e[_0x4457('0x3c')]})[_0x4457('0x23')](function(_0x42d861){_0x54b368[_0x4457('0x1d')]=_0x42d861;if(_0x1a2343[_0x4457('0x33')][_0x4457('0xae')]){_0x44463e['include']=[{'all':!![]}];}return db[_0x4457('0xb7')][_0x4457('0xba')](_0x44463e);})['then'](function(_0x584a86){_0x54b368['rows']=_0x584a86;return _0x54b368;});}})[_0x4457('0x23')](respondWithFilteredResult(_0x2e7544,_0x44463e))[_0x4457('0x2a')](handleError(_0x2e7544,null));};exports[_0x4457('0xbb')]=function(_0x321689,_0x58284d,_0x3655cd){return db['OpenchannelInteraction'][_0x4457('0x60')]({'where':{'id':_0x321689['params']['id']}})[_0x4457('0x23')](handleEntityNotFound(_0x58284d,null))[_0x4457('0x23')](function(_0x4aaeff){if(_0x4aaeff){return _0x4aaeff['setTags'](_0x321689[_0x4457('0x6c')][_0x4457('0xb4')],_['omit'](_0x321689[_0x4457('0x6c')],[_0x4457('0xb4'),'id'])||{})[_0x4457('0xbc')](function(){return db[_0x4457('0x62')][_0x4457('0xba')]({'attributes':['id',_0x4457('0x40'),_0x4457('0xbd')],'where':{'id':_0x321689['body'][_0x4457('0xb4')]}});})[_0x4457('0x23')](function(_0x6587d1){socket[_0x4457('0xbe')]('openchannelInteractionTags:save',{'id':Number(_0x321689[_0x4457('0xad')]['id']),'tags':_0x6587d1||[]});return{'id':Number(_0x321689[_0x4457('0xad')]['id']),'tags':_0x6587d1||[]};});}})[_0x4457('0x23')](respondWithResult(_0x58284d,null))[_0x4457('0x2a')](handleError(_0x58284d,null));};exports['removeTags']=function(_0x4e7e77,_0x4d0d84,_0x1a1dd5){return db[_0x4457('0x2d')][_0x4457('0x60')]({'where':{'id':_0x4e7e77[_0x4457('0xad')]['id']}})[_0x4457('0x23')](handleEntityNotFound(_0x4d0d84,null))[_0x4457('0x23')](function(_0x195723){if(_0x195723){return _0x195723['removeTags'](_0x4e7e77[_0x4457('0x33')][_0x4457('0xb4')]);}})[_0x4457('0x23')](respondWithStatusCode(_0x4d0d84,null))[_0x4457('0x2a')](handleError(_0x4d0d84,null));};exports[_0x4457('0xbf')]=function(_0x3b850d,_0x51378d){var _0x4464d3=moment()[_0x4457('0xc0')]()[_0x4457('0x93')]();var _0x16d301=path['join'](config[_0x4457('0xc1')],_0x4457('0xc2'),_0x4457('0xc3'),_0x4457('0xc4'));var _0x3a5c50=path[_0x4457('0xc5')](config[_0x4457('0xc1')],'server',_0x4457('0xc3'),_0x4457('0xc6'));var _0xfbaa02=path[_0x4457('0xc5')](_0x16d301,_0x4464d3);var _0x1f7dc2=util['format']('transcript-%d-%s.zip',_0x3b850d[_0x4457('0xad')]['id'],_0x4464d3);var _0x4c2619=path[_0x4457('0xc5')](_0x16d301,_0x1f7dc2);var _0x42a6c1=[];_0x42a6c1[_0x4457('0x29')]({'model':db[_0x4457('0x65')],'as':_0x4457('0x65'),'attributes':['id','fullname'],'raw':!![]});_0x42a6c1[_0x4457('0x29')]({'model':db['CmContact'],'as':_0x4457('0xc7'),'attributes':['id',_0x4457('0xc8'),'lastName'],'raw':!![]});if(_0x3b850d['query'][_0x4457('0xc6')]){_0x42a6c1['push']({'model':db[_0x4457('0xc9')],'as':_0x4457('0xc9'),'raw':!![]});}var _0x421130=[{'model':db[_0x4457('0xb7')],'as':_0x4457('0xca'),'attributes':['id',_0x4457('0x6c'),_0x4457('0x73'),'direction','secret',_0x4457('0x79')],'include':_0x42a6c1}];_0x421130['push']({'model':db[_0x4457('0xcb')],'as':_0x4457('0xcc'),'attributes':['id',_0x4457('0x40')]});_0x421130['push']({'model':db[_0x4457('0x65')],'as':'Owner','attributes':['id',_0x4457('0xcd')]});return db[_0x4457('0x2d')][_0x4457('0x60')]({'where':{'id':_0x3b850d[_0x4457('0xad')]['id']},'include':_0x421130})[_0x4457('0x23')](handleEntityNotFound(_0x51378d,null))[_0x4457('0x23')](function(_0xb18365){if(_0xb18365){var _0x3e9a13=_0xb18365[_0x4457('0xce')]({'plain':!![]});fs['mkdirSync'](_0xfbaa02);var _0x40b2b9={'channel':_0x4457('0xcf'),'account':_0x3e9a13[_0x4457('0xcc')][_0x4457('0x40')],'agent':_0x3e9a13[_0x4457('0xd0')]?_0x3e9a13[_0x4457('0xd0')][_0x4457('0xcd')]:_0x4457('0xd1'),'createdAt':moment(_0x3e9a13['createdAt'])['format'](_0x4457('0xb9'))[_0x4457('0x93')](),'closedAt':_0x3e9a13[_0x4457('0xd2')]?moment(_0x3e9a13[_0x4457('0xd3')])[_0x4457('0xb8')](_0x4457('0xb9'))[_0x4457('0x93')]():'','disposition':_0x3e9a13['disposition'],'visibility':_0x3e9a13[_0x4457('0xd4')]?'Public':'Private','messages':_(_0x3e9a13['Messages'])[_0x4457('0x7e')]({'secret':![]})[_0x4457('0x2c')](function(_0x447023){if(_0x447023[_0x4457('0xc9')]){var _0x1d9c29=path[_0x4457('0xc5')](_0x3a5c50,_0x447023['Attachment']['basename']);if(fs[_0x4457('0xd5')](_0x1d9c29)){fs[_0x4457('0xd6')](_0x1d9c29)[_0x4457('0xd7')](fs[_0x4457('0xd8')](path[_0x4457('0xc5')](_0xfbaa02,_0x447023['Attachment'][_0x4457('0xd9')])));}}return{'date':moment(_0x447023['createdAt'])['format'](_0x4457('0xb9'))[_0x4457('0x93')](),'sender':_0x447023[_0x4457('0xda')]===_0x4457('0xdb')?_0x447023[_0x4457('0x65')]?_0x447023[_0x4457('0x65')][_0x4457('0xcd')]:_0x4457('0xdc'):_0x447023[_0x4457('0xc7')]['firstName']+(_0x447023[_0x4457('0xc7')][_0x4457('0xdd')]?'\x20'+_0x447023[_0x4457('0xc7')][_0x4457('0xdd')]:''),'body':_0x447023[_0x4457('0xc9')]?_0x447023['Attachment'][_0x4457('0xd9')]:_0x447023[_0x4457('0x6c')],'direction':_0x447023['direction']===_0x4457('0xdb')?'A':'C','secret':_0x447023[_0x4457('0xde')],'read':_0x447023[_0x4457('0x79')],'attachment':_0x447023[_0x4457('0xc9')]};})[_0x4457('0x5d')]()};return ejs[_0x4457('0xdf')](path[_0x4457('0xc5')](config['root'],'server',_0x4457('0xe0'),_0x4457('0xe1')),{'interaction':_0x40b2b9})['then'](function(_0x382914){var _0x1e4c66=path[_0x4457('0xc5')](_0xfbaa02,'transcript-'+_0x3e9a13['id']+'-'+_0x4464d3+_0x4457('0xe2'));var _0x4dbc99={'path':_0x1e4c66,'channel':_0x4457('0xcf'),'interactionId':_0x3e9a13['id']};return pdf['createPdfFromHTML'](_0x382914,_0x4dbc99);})['then'](function(){return new BPromise(function(_0x46a9be,_0xe13d0b){zipdir(_0xfbaa02,{'saveTo':_0x4c2619},function(_0x54b8d9,_0x551131){if(_0x54b8d9)return _0xe13d0b(_0x54b8d9);return _0x46a9be(_0x551131);});})['then'](function(){return new BPromise(function(_0x114fcf,_0x334d6c){rimraf(_0xfbaa02,function(_0xa691ad){if(_0xa691ad)_0x334d6c(_0xa691ad);return _0x114fcf();});});})[_0x4457('0x23')](function(){return _0x51378d['download'](_0x4c2619,_0x1f7dc2,function(_0x52c285){if(_0x52c285){console['log']('err',_0x52c285);}else{fs[_0x4457('0xe3')](_0x4c2619);}});});});}else{return _0x51378d[_0x4457('0x17')](0xc8);}})[_0x4457('0x2a')](handleError(_0x51378d,null));};
\ No newline at end of file
+var _0x76c4=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','send','Users','map','fullname','Tags','TagIds','split','forEach','push','catch','index','OpenchannelInteraction','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','nolimit','limit','sort','where','select','field','name','color','tools_tags','u.id','ui.OpenchannelInteractionId','from','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','t.id\x20=\x20it.TagId','search','parseSearch','sqlOperator','conditions','length','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?','ContactId','buildExpression','type','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','parse','$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?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','contactName','DESC','isEmpty','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','groupBy','OpenchannelInteractionId','all','rows','show','params','includeAll','include','options','create','body','describe','OpenchannelMessage','addMessage','ids','omit','getMessages','findOne','hasOwnProperty','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','spread','Tag','openchannelInteractionTags:save','removeTags','unix','join','root','server','files','attachments','CmContact','firstName','Attachment','Messages','createdAt','direction','OpenchannelAccount','Account','get','mkdirSync','Owner','N.A.','closed','disposition','Public','Private','pipe','createWriteStream','basename','lastName','secret','transcript-','.pdf','Openchannel','download','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce'];(function(_0xb9254,_0x3266b9){var _0x14d065=function(_0xcbe995){while(--_0xcbe995){_0xb9254['push'](_0xb9254['shift']());}};_0x14d065(++_0x3266b9);}(_0x76c4,0xe6));var _0x476c=function(_0x4400ef,_0x5bf113){_0x4400ef=_0x4400ef-0x0;var _0x14bd3f=_0x76c4[_0x4400ef];return _0x14bd3f;};'use strict';var emlformat=require(_0x476c('0x0'));var rimraf=require(_0x476c('0x1'));var zipdir=require(_0x476c('0x2'));var jsonpatch=require(_0x476c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x476c('0x4'));var Mustache=require(_0x476c('0x5'));var util=require(_0x476c('0x6'));var path=require(_0x476c('0x7'));var sox=require(_0x476c('0x8'));var csv=require(_0x476c('0x9'));var ejs=require(_0x476c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x476c('0xb'));var squel=require('squel');var crypto=require(_0x476c('0xc'));var jsforce=require(_0x476c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x476c('0x9'));var querystring=require(_0x476c('0xe'));var Papa=require(_0x476c('0xf'));var Redis=require(_0x476c('0x10'));var authService=require(_0x476c('0x11'));var qs=require(_0x476c('0x12'));var as=require(_0x476c('0x13'));var pdf=require(_0x476c('0x14'));var hardwareService=require(_0x476c('0x15'));var logger=require(_0x476c('0x16'))(_0x476c('0x17'));var utils=require(_0x476c('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x476c('0x19'));var db=require(_0x476c('0x1a'))['db'];config[_0x476c('0x1b')]=_[_0x476c('0x1c')](config[_0x476c('0x1b')],{'host':_0x476c('0x1d'),'port':0x18eb});var socket=require(_0x476c('0x1e'))(new Redis(config[_0x476c('0x1b')]));require(_0x476c('0x1f'))[_0x476c('0x20')](socket);function respondWithStatusCode(_0x163d84,_0x1c279f){_0x1c279f=_0x1c279f||0xcc;return function(_0x256e1c){if(_0x256e1c){return _0x163d84[_0x476c('0x21')](_0x1c279f);}return _0x163d84[_0x476c('0x22')](_0x1c279f)['end']();};}function respondWithResult(_0x423882,_0x3aba48){_0x3aba48=_0x3aba48||0xc8;return function(_0x79d894){if(_0x79d894){return _0x423882[_0x476c('0x22')](_0x3aba48)[_0x476c('0x23')](_0x79d894);}};}function respondWithFilteredResult(_0x64ed16,_0x5d7113){return function(_0x3b485d){if(_0x3b485d){var _0x736d9d=typeof _0x5d7113[_0x476c('0x24')]==='undefined'&&typeof _0x5d7113['limit']===_0x476c('0x25');var _0x2d7d5e=_0x3b485d[_0x476c('0x26')];var _0x5b3c91=_0x736d9d?0x0:_0x5d7113[_0x476c('0x24')];var _0x20419a=_0x736d9d?_0x3b485d[_0x476c('0x26')]:_0x5d7113['offset']+_0x5d7113['limit'];var _0x35d5f8;if(_0x20419a>=_0x2d7d5e){_0x20419a=_0x2d7d5e;_0x35d5f8=0xc8;}else{_0x35d5f8=0xce;}_0x64ed16[_0x476c('0x22')](_0x35d5f8);return _0x64ed16['set'](_0x476c('0x27'),_0x5b3c91+'-'+_0x20419a+'/'+_0x2d7d5e)[_0x476c('0x23')](_0x3b485d);}return null;};}function patchUpdates(_0x26ebc6){return function(_0x173a95){try{jsonpatch[_0x476c('0x28')](_0x173a95,_0x26ebc6,!![]);}catch(_0x4d1f56){return BPromise[_0x476c('0x29')](_0x4d1f56);}return _0x173a95[_0x476c('0x2a')]();};}function saveUpdates(_0x584596,_0x31ea22){return function(_0x16b984){if(_0x16b984){return _0x16b984[_0x476c('0x2b')](_0x584596)[_0x476c('0x2c')](function(_0x451529){return _0x451529;});}return null;};}function removeEntity(_0x4c3341,_0x49db6d){return function(_0x506f6c){if(_0x506f6c){return _0x506f6c[_0x476c('0x2d')]()[_0x476c('0x2c')](function(){_0x4c3341[_0x476c('0x22')](0xcc)[_0x476c('0x2e')]();});}};}function handleEntityNotFound(_0x5ad654,_0x3bcd36){return function(_0x201d21){if(!_0x201d21){_0x5ad654[_0x476c('0x21')](0x194);}return _0x201d21;};}function handleError(_0x59793a,_0x5e8d44){_0x5e8d44=_0x5e8d44||0x1f4;return function(_0x17b55a){logger[_0x476c('0x2f')](_0x17b55a[_0x476c('0x30')]);if(_0x17b55a['name']){delete _0x17b55a['name'];}_0x59793a[_0x476c('0x22')](_0x5e8d44)[_0x476c('0x31')](_0x17b55a);};}function getInteractionUsers(_0x188ada,_0x403e15){return new BPromise(function(_0x3540ee,_0x5d37f9){try{if(_0x403e15[_0x188ada['id']]){_0x188ada[_0x476c('0x32')]=_[_0x476c('0x33')](_0x403e15[_0x188ada['id']],function(_0x4e466f){return{'id':_0x4e466f['id'],'fullname':_0x4e466f[_0x476c('0x34')]};});}}catch(_0x36fec4){_0x5d37f9(_0x36fec4);}_0x3540ee(_0x188ada);});}function getInteractionTags(_0x3f30c6,_0x50891f){return new BPromise(function(_0x4acb27,_0x1d8c3e){try{if(_0x3f30c6['TagIds']){_0x3f30c6[_0x476c('0x35')]=[];_0x3f30c6[_0x476c('0x36')][_0x476c('0x37')](',')[_0x476c('0x38')](function(_0x3bbe61){_0x3f30c6[_0x476c('0x35')][_0x476c('0x39')](_0x50891f[_0x3bbe61]);});}delete _0x3f30c6[_0x476c('0x36')];}catch(_0xca9eec){_0x1d8c3e(_0xca9eec);}_0x4acb27(_0x3f30c6);});}function updateOpenchannelInteraction(_0x5852f4,_0x12bbfe,_0x29c942){return new BPromise(function(_0x12cf7d,_0x4ffba3){return getInteractionUsers(_0x5852f4,_0x29c942)[_0x476c('0x2c')](function(_0x5f1c22){return getInteractionTags(_0x5f1c22,_0x12bbfe);})['then'](function(_0x5e4f0e){_0x12cf7d(_0x5e4f0e);})[_0x476c('0x3a')](function(_0x2f404c){_0x4ffba3(_0x2f404c);});});}exports[_0x476c('0x3b')]=function(_0x2fa8bc,_0x367d03){var _0x498219={},_0x416edf={},_0x3cdaf4={'count':0x0,'rows':[]};var _0x150550=_[_0x476c('0x33')](db[_0x476c('0x3c')][_0x476c('0x3d')],function(_0x5d8c42){return{'name':_0x5d8c42[_0x476c('0x3e')],'type':_0x5d8c42['type'][_0x476c('0x3f')]};});_0x416edf['model']=_['map'](_0x150550,'name');_0x416edf[_0x476c('0x40')]=_[_0x476c('0x41')](_0x2fa8bc['query']);_0x416edf[_0x476c('0x42')]=_[_0x476c('0x43')](_0x416edf[_0x476c('0x44')],_0x416edf[_0x476c('0x40')]);_0x498219[_0x476c('0x45')]=_[_0x476c('0x43')](_0x416edf[_0x476c('0x44')],qs[_0x476c('0x46')](_0x2fa8bc[_0x476c('0x40')][_0x476c('0x46')]));_0x498219[_0x476c('0x45')]=_0x498219[_0x476c('0x45')]['length']?_0x498219[_0x476c('0x45')]:_0x416edf[_0x476c('0x44')];if(!_0x2fa8bc['query']['hasOwnProperty'](_0x476c('0x47'))){_0x498219[_0x476c('0x48')]=qs['limit'](_0x2fa8bc['query'][_0x476c('0x48')]);_0x498219['offset']=qs[_0x476c('0x24')](_0x2fa8bc['query']['offset']);}_0x498219['order']=qs['sort'](_0x2fa8bc['query'][_0x476c('0x49')]);_0x498219[_0x476c('0x4a')]=qs['filters'](_['pick'](_0x2fa8bc['query'],_0x416edf[_0x476c('0x42')]),_0x150550);var _0x43c70a=[];var _0x56ec92=squel[_0x476c('0x4b')]()['field']('id')[_0x476c('0x4c')](_0x476c('0x4d'))['field'](_0x476c('0x4e'))['from'](_0x476c('0x4f'));var _0x260012=squel['select']()[_0x476c('0x4c')](_0x476c('0x50'))['field']('u.fullname')[_0x476c('0x4c')](_0x476c('0x51'))[_0x476c('0x52')](_0x476c('0x53'),'ui')[_0x476c('0x54')](_0x476c('0x55'),'u',_0x476c('0x56'));var _0x468ee2=squel[_0x476c('0x4b')]()[_0x476c('0x52')](_0x476c('0x57'),'i')[_0x476c('0x54')](_0x476c('0x58'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x476c('0x54')](_0x476c('0x55'),'o',_0x476c('0x59'))[_0x476c('0x54')](_0x476c('0x5a'),'a',_0x476c('0x5b'))[_0x476c('0x54')](_0x476c('0x5c'),'me',_0x476c('0x5d'))[_0x476c('0x54')](_0x476c('0x5e'),'it','it.OpenchannelInteractionId\x20=\x20i.id')['left_join']('tools_tags','t',_0x476c('0x5f'));var _0x25dfdc=squel['expr']();var _0x197a2e=[];var _0x20c67d=squel['expr']();var _0x284377;if(_0x2fa8bc['query'][_0x476c('0x60')]){_0x284377=as[_0x476c('0x61')](_0x2fa8bc[_0x476c('0x40')][_0x476c('0x60')]);var _0x1be882=_0x284377[_0x476c('0x62')];for(var _0xe3cfa1=0x0;_0xe3cfa1<_0x284377[_0x476c('0x63')][_0x476c('0x64')];_0xe3cfa1++){var _0x1291ce=_0x284377[_0x476c('0x63')][_0xe3cfa1];var _0x2a8bb1='i';var _0x25688a=_[_0x476c('0x65')](_0x150550,['name',_0x1291ce[_0x476c('0x4c')]]);if(!_0x25688a){switch(_0x1291ce[_0x476c('0x4c')]){case'unreadMessages':if(_0x1291ce[_0x476c('0x66')]==0x1){_0x468ee2[_0x476c('0x67')]('`'+_0x1291ce[_0x476c('0x4c')]+_0x476c('0x68'));}else{_0x468ee2[_0x476c('0x67')]('`'+_0x1291ce[_0x476c('0x4c')]+'`\x20>\x200');}break;case _0x476c('0x69'):if(_0x1291ce[_0x476c('0x6a')]===_0x476c('0x6b')){if(_0x1291ce[_0x476c('0x66')]['split']('\x20')[_0x476c('0x64')]>0x1){_0x25dfdc[_0x1be882](_0x476c('0x6c'),qs[_0x476c('0x6d')](_0x1291ce[_0x476c('0x66')]),null);}else{var _0x2fd754='%'+_0x1291ce[_0x476c('0x66')]+'%';_0x25dfdc[_0x1be882](_0x476c('0x6e'),_0x2fd754,_0x2fd754,_0x2fd754);}}else{_0x25688a=_[_0x476c('0x65')](_0x150550,[_0x476c('0x4d'),_0x476c('0x6f')]);_0x1291ce['field']=_0x476c('0x6f');_0xa314a9=as[_0x476c('0x70')](_0x2a8bb1,_0x25688a[_0x476c('0x71')],_0x1291ce);_0x25dfdc[_0x1be882](_0xa314a9[_0x476c('0x72')],_0xa314a9[_0x476c('0x66')][_0x476c('0x73')],_0xa314a9[_0x476c('0x66')][_0x476c('0x2e')]);}break;case'Tag':var _0x5bd528=_0x1291ce['value']['split'](',')[_0x476c('0x33')](function(_0x4dca53){return Number(_0x4dca53);});_0x5bd528['forEach'](function(_0xf2e714){_0x20c67d['or'](_0x476c('0x74'),'%,'+_0xf2e714+',%');});_0x197a2e=_[_0x476c('0x75')](_0x197a2e,_0x5bd528);break;case _0x476c('0x76'):if(_0x1291ce['operator']===_0x476c('0x6b')){_0x25dfdc[_0x1be882](_0x476c('0x77'),'%'+_0x1291ce[_0x476c('0x66')]+'%',null);}else{_0x25688a=_[_0x476c('0x65')](_0x150550,[_0x476c('0x4d'),_0x476c('0x78')]);_0x1291ce['field']=_0x476c('0x78');_0xa314a9=as[_0x476c('0x70')](_0x2a8bb1,_0x25688a[_0x476c('0x71')],_0x1291ce);_0x25dfdc[_0x1be882](_0xa314a9[_0x476c('0x72')],_0xa314a9[_0x476c('0x66')][_0x476c('0x73')],_0xa314a9[_0x476c('0x66')][_0x476c('0x2e')]);}break;case'body':_0xa314a9=as[_0x476c('0x70')]('me',null,_0x1291ce);_0x25dfdc[_0x1be882](_0xa314a9['text'],_0xa314a9[_0x476c('0x66')][_0x476c('0x73')],_0xa314a9[_0x476c('0x66')]['end']);break;}}else{var _0xa314a9=as[_0x476c('0x70')](_0x2a8bb1,_0x25688a[_0x476c('0x71')],_0x1291ce);_0x25dfdc[_0x1be882](_0xa314a9[_0x476c('0x72')],_0xa314a9[_0x476c('0x66')][_0x476c('0x73')],_0xa314a9[_0x476c('0x66')][_0x476c('0x2e')]);}}}else{var _0x5efae8=_(_0x2fa8bc['query'])[_0x476c('0x41')]()['map'](function(_0x10de76){return _[_0x476c('0x79')](_0x150550,['name',_0x10de76])?_0x10de76:undefined;})[_0x476c('0x7a')]()['value']();if(!_['isEmpty'](_0x5efae8)){_0x5efae8[_0x476c('0x38')](function(_0x124579){if(_0x124579===_0x476c('0x7b')){_0x468ee2[_0x476c('0x4a')](_0x476c('0x7c'),[][_0x476c('0x7d')](_0x2fa8bc[_0x476c('0x40')][_0x124579]));}else if(_0x124579==='createdAt'){var _0x2fcf22=JSON['parse'](_0x2fa8bc[_0x476c('0x40')][_0x124579])['$gte'];var _0xd81c8=JSON[_0x476c('0x7e')](_0x2fa8bc[_0x476c('0x40')][_0x124579])[_0x476c('0x7f')];_0x468ee2[_0x476c('0x4a')](_0x476c('0x80'),_0x2fcf22,_0xd81c8);}else{if(_0x2fa8bc[_0x476c('0x40')][_0x124579]===_0x476c('0x81')){_0x468ee2[_0x476c('0x4a')]('i.'+_0x124579+_0x476c('0x82'));}else{_0x468ee2[_0x476c('0x4a')]('i.'+_0x124579+_0x476c('0x83'),_0x2fa8bc[_0x476c('0x40')][_0x124579]);}}});}if(_0x2fa8bc['query'][_0x476c('0x84')]){if(_0x2fa8bc[_0x476c('0x40')][_0x476c('0x84')]==0x1){_0x468ee2[_0x476c('0x67')](_0x476c('0x85'));}else{_0x468ee2[_0x476c('0x67')](_0x476c('0x86'));}}if(_0x2fa8bc[_0x476c('0x40')][_0x476c('0x87')]){_0x197a2e=_['isArray'](_0x2fa8bc['query'][_0x476c('0x87')])?_0x2fa8bc['query'][_0x476c('0x87')]:new Array(_0x2fa8bc['query'][_0x476c('0x87')]);_0x197a2e[_0x476c('0x38')](function(_0x4167f7){_0x20c67d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4167f7+',%');});}if(_0x2fa8bc['query'][_0x476c('0x88')]){var _0x4aa00a=_0x2fa8bc[_0x476c('0x40')]['filter'][_0x476c('0x89')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x476c('0x8a')](_0x4aa00a)){_0x25dfdc['or'](_0x476c('0x8b'),_0x4aa00a+'%');}else{_0x25dfdc['or'](_0x476c('0x8c'),qs[_0x476c('0x6d')](_0x4aa00a))['or'](_0x476c('0x8d'),_0x4aa00a+'%')['or'](_0x476c('0x8e'),_0x4aa00a+'%');}}}_0x468ee2['where'](_0x25dfdc);_0x468ee2['group'](_0x476c('0x8f'));var _0x4b2b6b={'type':db[_0x476c('0x90')]['QueryTypes'][_0x476c('0x91')],'raw':!![]};var _0x36e3d2=_0x468ee2[_0x476c('0x92')]();_0x36e3d2[_0x476c('0x4c')](_0x476c('0x8f'));_0x36e3d2[_0x476c('0x4c')](_0x476c('0x93'),_0x476c('0x94'));if(_0x498219[_0x476c('0x95')]){_0x498219[_0x476c('0x95')][_0x476c('0x38')](function(_0x419e98){var _0x531a4d=_0x419e98[0x0]===_0x476c('0x96')?_0x419e98[0x0]:'i.'+_0x419e98[0x0];_0x468ee2[_0x476c('0x95')](_0x531a4d,_0x419e98[0x1]===_0x476c('0x97')?![]:!![]);});}if(!_[_0x476c('0x98')](_0x197a2e)){_0x468ee2['having'](_0x20c67d);_0x36e3d2[_0x476c('0x4a')]('t.id\x20IN\x20?',_0x197a2e);}BPromise[_0x476c('0x99')]()[_0x476c('0x2c')](function(){if(!_0x284377){if(_0x2fa8bc[_0x476c('0x40')][_0x476c('0x7b')])return;_0x36e3d2[_0x476c('0x4a')](_0x476c('0x9a'));_0x468ee2[_0x476c('0x4a')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x2fa8bc[_0x476c('0x9b')][_0x476c('0x9c')]!==_0x476c('0x9d'))return;return _0x2fa8bc[_0x476c('0x9b')][_0x476c('0x9e')]({'attributes':['id'],'raw':!![]})[_0x476c('0x2c')](function(_0x127b0f){if(_[_0x476c('0x98')](_0x127b0f)){_0x36e3d2[_0x476c('0x4a')](_0x476c('0x9f'));_0x468ee2['where']('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x36e3d2[_0x476c('0x4a')]('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0x127b0f,'id'));_0x468ee2['where'](_0x476c('0x7c'),_[_0x476c('0x33')](_0x127b0f,'id'));}});})[_0x476c('0x2c')](function(){if(_0x2fa8bc['user'][_0x476c('0x9c')]===_0x476c('0x9d')&&!_0x284377&&!_0x2fa8bc[_0x476c('0x40')]['OpenchannelAccountId'])return[];return db[_0x476c('0xa0')][_0x476c('0x40')](_0x36e3d2[_0x476c('0xa1')](),_0x4b2b6b);})['then'](function(_0x40d7ec){_0x3cdaf4[_0x476c('0x26')]=_0x40d7ec[_0x476c('0x64')];if(_0x3cdaf4['count']===0x0)return[];return db[_0x476c('0xa0')][_0x476c('0x40')](_0x56ec92[_0x476c('0xa1')](),_0x4b2b6b)[_0x476c('0x2c')](function(_0x348b8b){_0x43c70a=_['keyBy'](_0x348b8b,'id');_0x4b2b6b=_[_0x476c('0xa2')](_0x4b2b6b,{'model':db[_0x476c('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2fa8bc[_0x476c('0x40')]['fields']){_0x498219[_0x476c('0x45')]['forEach'](function(_0xf96794){_0x468ee2['field']('i.'+_0xf96794);});}else{_0x468ee2[_0x476c('0x4c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x476c('0x94'));_0x468ee2[_0x476c('0x4c')](_0x476c('0xa3'),'Account.key');_0x468ee2[_0x476c('0x4c')](_0x476c('0xa4'),_0x476c('0xa5'));_0x468ee2[_0x476c('0x4c')](_0x476c('0xa6'),_0x476c('0x96'));_0x468ee2[_0x476c('0x4c')](_0x476c('0xa7'));_0x468ee2['field'](_0x476c('0xa8'),_0x476c('0xa9'));_0x468ee2['field'](_0x476c('0xaa'),_0x476c('0xab'));_0x468ee2[_0x476c('0x4c')](_0x476c('0xac'),_0x476c('0xad'));_0x468ee2[_0x476c('0x4c')](_0x476c('0xae'),_0x476c('0xaf'));_0x468ee2[_0x476c('0x4c')](_0x476c('0xb0'),'Contact.mobile');_0x468ee2['field'](_0x476c('0xb1'),_0x476c('0xb2'));_0x468ee2['field'](_0x476c('0xb3'),_0x476c('0xb4'));_0x468ee2[_0x476c('0x4c')]('o.internal',_0x476c('0xb5'));_0x468ee2[_0x476c('0x4c')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x476c('0x36'));}if(_0x498219[_0x476c('0x48')])_0x468ee2[_0x476c('0x48')](_0x498219[_0x476c('0x48')]);if(_0x498219[_0x476c('0x24')])_0x468ee2[_0x476c('0x24')](_0x498219[_0x476c('0x24')]);return db[_0x476c('0xa0')][_0x476c('0x40')](_0x468ee2[_0x476c('0xa1')](),_0x4b2b6b);})[_0x476c('0x2c')](function(_0x29f339){if(_0x29f339[_0x476c('0x64')]>0x0)_0x260012[_0x476c('0x4a')]('ui.OpenchannelInteractionId\x20IN\x20?',_[_0x476c('0x33')](_0x29f339,'id'));return db[_0x476c('0xa0')]['query'](_0x260012[_0x476c('0xa1')](),_0x4b2b6b)[_0x476c('0x2c')](function(_0x28a2ba){var _0x4fbcce=_[_0x476c('0xb6')](_0x28a2ba,_0x476c('0xb7'));var _0x284140=[];_0x29f339[_0x476c('0x38')](function(_0x4c9b5c){_0x284140['push'](updateOpenchannelInteraction(_0x4c9b5c,_0x43c70a,_0x4fbcce));});return BPromise[_0x476c('0xb8')](_0x284140);});});})[_0x476c('0x2c')](function(_0x34fd63){_0x3cdaf4[_0x476c('0xb9')]=_0x34fd63;return _0x3cdaf4;})['then'](respondWithFilteredResult(_0x367d03,_0x498219))['catch'](handleError(_0x367d03,null));};exports[_0x476c('0xba')]=function(_0x3a72a3,_0x42fd96){var _0x589fcd={};if(_0x3a72a3['query']['type']&&_0x3a72a3['query'][_0x476c('0x71')]===_0x476c('0x52')){_0x589fcd[_0x476c('0x52')]=_0x3a72a3[_0x476c('0xbb')]['id'];}else{_0x589fcd['id']=_0x3a72a3['params']['id'];}var _0x1c366d={'raw':![],'where':_0x589fcd},_0x40603c={};_0x40603c[_0x476c('0x44')]=_['keys'](db[_0x476c('0x3c')]['rawAttributes']);_0x40603c['query']=_[_0x476c('0x41')](_0x3a72a3[_0x476c('0x40')]);_0x40603c['filters']=_['intersection'](_0x40603c[_0x476c('0x44')],_0x40603c[_0x476c('0x40')]);_0x1c366d[_0x476c('0x45')]=_[_0x476c('0x43')](_0x40603c[_0x476c('0x44')],qs['fields'](_0x3a72a3[_0x476c('0x40')][_0x476c('0x46')]));_0x1c366d[_0x476c('0x45')]=_0x1c366d[_0x476c('0x45')][_0x476c('0x64')]?_0x1c366d['attributes']:_0x40603c[_0x476c('0x44')];if(_0x3a72a3['query'][_0x476c('0xbc')]){_0x1c366d[_0x476c('0xbd')]=[{'all':!![]}];}_0x1c366d=_[_0x476c('0xa2')]({},_0x1c366d,_0x3a72a3[_0x476c('0xbe')]);return db[_0x476c('0x3c')][_0x476c('0x65')](_0x1c366d)[_0x476c('0x2c')](handleEntityNotFound(_0x42fd96,null))[_0x476c('0x2c')](respondWithResult(_0x42fd96,null))[_0x476c('0x3a')](handleError(_0x42fd96,null));};exports[_0x476c('0xbf')]=function(_0x15ffe8,_0x3db564){return db[_0x476c('0x3c')][_0x476c('0xbf')](_0x15ffe8['body'],{})[_0x476c('0x2c')](respondWithResult(_0x3db564,0xc9))[_0x476c('0x3a')](handleError(_0x3db564,null));};exports[_0x476c('0x2b')]=function(_0x26c90b,_0xff167f){if(_0x26c90b[_0x476c('0xc0')]['id']){delete _0x26c90b[_0x476c('0xc0')]['id'];}return db[_0x476c('0x3c')][_0x476c('0x65')]({'where':{'id':_0x26c90b[_0x476c('0xbb')]['id']}})[_0x476c('0x2c')](handleEntityNotFound(_0xff167f,null))[_0x476c('0x2c')](saveUpdates(_0x26c90b['body'],null))[_0x476c('0x2c')](respondWithResult(_0xff167f,null))[_0x476c('0x3a')](handleError(_0xff167f,null));};exports[_0x476c('0x2d')]=function(_0x43ef4d,_0x464888){return db[_0x476c('0x3c')][_0x476c('0x65')]({'where':{'id':_0x43ef4d[_0x476c('0xbb')]['id']}})[_0x476c('0x2c')](handleEntityNotFound(_0x464888,null))[_0x476c('0x2c')](removeEntity(_0x464888,null))[_0x476c('0x3a')](handleError(_0x464888,null));};exports[_0x476c('0xc1')]=function(_0x1ca75,_0x54ab39){return db[_0x476c('0x3c')][_0x476c('0xc1')]()[_0x476c('0x2c')](respondWithResult(_0x54ab39,null))['catch'](handleError(_0x54ab39,null));};exports['addMessage']=function(_0x34f6ab,_0x1b57ca,_0x1dec48){return db[_0x476c('0xc2')][_0x476c('0x65')]({'where':{'id':_0x34f6ab['params']['id']}})[_0x476c('0x2c')](handleEntityNotFound(_0x1b57ca,null))[_0x476c('0x2c')](function(_0x516f66){if(_0x516f66){return _0x516f66[_0x476c('0xc3')](_0x34f6ab[_0x476c('0xc0')][_0x476c('0xc4')],_[_0x476c('0xc5')](_0x34f6ab[_0x476c('0xc0')],[_0x476c('0xc4'),'id'])||{});}})[_0x476c('0x2c')](respondWithResult(_0x1b57ca,null))[_0x476c('0x3a')](handleError(_0x1b57ca,null));};exports[_0x476c('0xc6')]=function(_0x44231e,_0x3ef1d1,_0x2523e2){var _0xb9af69={'raw':![],'where':{}};var _0x5e3c7f={};var _0x2b5cde={'count':0x0,'rows':[]};return db[_0x476c('0x3c')][_0x476c('0xc7')]({'where':{'id':_0x44231e[_0x476c('0xbb')]['id']}})[_0x476c('0x2c')](handleEntityNotFound(_0x3ef1d1,null))['then'](function(_0x5296ce){if(_0x5296ce){_0x5e3c7f['model']=_['keys'](db[_0x476c('0xc2')][_0x476c('0x3d')]);_0x5e3c7f[_0x476c('0x40')]=_[_0x476c('0x41')](_0x44231e[_0x476c('0x40')]);_0x5e3c7f[_0x476c('0x42')]=_[_0x476c('0x43')](_0x5e3c7f[_0x476c('0x44')],_0x5e3c7f[_0x476c('0x40')]);_0xb9af69[_0x476c('0x45')]=_[_0x476c('0x43')](_0x5e3c7f[_0x476c('0x44')],qs[_0x476c('0x46')](_0x44231e[_0x476c('0x40')]['fields']));_0xb9af69[_0x476c('0x45')]=_0xb9af69[_0x476c('0x45')]['length']?_0xb9af69[_0x476c('0x45')]:_0x5e3c7f[_0x476c('0x44')];if(!_0x44231e[_0x476c('0x40')][_0x476c('0xc8')](_0x476c('0x47'))){_0xb9af69[_0x476c('0x48')]=qs[_0x476c('0x48')](_0x44231e[_0x476c('0x40')][_0x476c('0x48')]);_0xb9af69['offset']=qs[_0x476c('0x24')](_0x44231e[_0x476c('0x40')][_0x476c('0x24')]);}_0xb9af69[_0x476c('0x95')]=qs[_0x476c('0x49')](_0x44231e[_0x476c('0x40')][_0x476c('0x49')]);_0xb9af69[_0x476c('0x4a')]=qs[_0x476c('0x42')](_[_0x476c('0xc9')](_0x44231e[_0x476c('0x40')],_0x5e3c7f[_0x476c('0x42')]));_0xb9af69['where'][_0x476c('0xb7')]=_0x5296ce['id'];if(_0x44231e['query'][_0x476c('0x88')]){_0xb9af69['where']=_[_0x476c('0xa2')](_0xb9af69[_0x476c('0x4a')],{'$or':_['map'](_0xb9af69[_0x476c('0x45')],function(_0x3178de){var _0x1bf4b1={};_0x1bf4b1[_0x3178de]={'$like':'%'+_0x44231e[_0x476c('0x40')][_0x476c('0x88')]+'%'};return _0x1bf4b1;})});}if(_0x44231e[_0x476c('0x40')][_0x476c('0xca')]){var _0x4e88e0=_0x44231e['query']['$gte'][_0x476c('0x37')](',');var _0x5b4dca={};_0x5b4dca[_0x4e88e0[0x0]]={'$gte':moment(_0x4e88e0[0x1])[_0x476c('0xcb')](_0x476c('0xcc'))};_0xb9af69[_0x476c('0x4a')]=_[_0x476c('0xa2')](_0xb9af69['where'],_0x5b4dca);}_0xb9af69=_[_0x476c('0xa2')]({},_0xb9af69,_0x44231e[_0x476c('0xbe')]);return db[_0x476c('0xc2')][_0x476c('0x26')]({'where':_0xb9af69[_0x476c('0x4a')]})[_0x476c('0x2c')](function(_0x3b16e5){_0x2b5cde[_0x476c('0x26')]=_0x3b16e5;if(_0x44231e[_0x476c('0x40')]['includeAll']){_0xb9af69[_0x476c('0xbd')]=[{'all':!![]}];}return db[_0x476c('0xc2')][_0x476c('0xcd')](_0xb9af69);})[_0x476c('0x2c')](function(_0x3ed6fe){_0x2b5cde[_0x476c('0xb9')]=_0x3ed6fe;return _0x2b5cde;});}})['then'](respondWithFilteredResult(_0x3ef1d1,_0xb9af69))[_0x476c('0x3a')](handleError(_0x3ef1d1,null));};exports['addTags']=function(_0x167d2d,_0x182fc1,_0x46ac5a){return db['OpenchannelInteraction']['find']({'where':{'id':_0x167d2d[_0x476c('0xbb')]['id']}})[_0x476c('0x2c')](handleEntityNotFound(_0x182fc1,null))['then'](function(_0x29829c){if(_0x29829c){return _0x29829c[_0x476c('0xce')](_0x167d2d['body'][_0x476c('0xc4')],_[_0x476c('0xc5')](_0x167d2d[_0x476c('0xc0')],[_0x476c('0xc4'),'id'])||{})[_0x476c('0xcf')](function(){return db[_0x476c('0xd0')][_0x476c('0xcd')]({'attributes':['id',_0x476c('0x4d'),_0x476c('0x4e')],'where':{'id':_0x167d2d[_0x476c('0xc0')][_0x476c('0xc4')]}});})['then'](function(_0x5c86dd){socket['emit'](_0x476c('0xd1'),{'id':Number(_0x167d2d['params']['id']),'tags':_0x5c86dd||[]});return{'id':Number(_0x167d2d[_0x476c('0xbb')]['id']),'tags':_0x5c86dd||[]};});}})[_0x476c('0x2c')](respondWithResult(_0x182fc1,null))[_0x476c('0x3a')](handleError(_0x182fc1,null));};exports[_0x476c('0xd2')]=function(_0x411268,_0x19766d,_0x3d4234){return db[_0x476c('0x3c')][_0x476c('0x65')]({'where':{'id':_0x411268['params']['id']}})[_0x476c('0x2c')](handleEntityNotFound(_0x19766d,null))[_0x476c('0x2c')](function(_0x54168c){if(_0x54168c){return _0x54168c['removeTags'](_0x411268[_0x476c('0x40')][_0x476c('0xc4')]);}})[_0x476c('0x2c')](respondWithStatusCode(_0x19766d,null))[_0x476c('0x3a')](handleError(_0x19766d,null));};exports['download']=function(_0x472334,_0x59f7d8){var _0xc6a92f=moment()[_0x476c('0xd3')]()['toString']();var _0xc2cb9a=path[_0x476c('0xd4')](config[_0x476c('0xd5')],_0x476c('0xd6'),'files','tmp');var _0x3903ab=path[_0x476c('0xd4')](config[_0x476c('0xd5')],_0x476c('0xd6'),_0x476c('0xd7'),_0x476c('0xd8'));var _0x27bb51=path[_0x476c('0xd4')](_0xc2cb9a,_0xc6a92f);var _0xb5d926=util[_0x476c('0xcb')]('transcript-%d-%s.zip',_0x472334[_0x476c('0xbb')]['id'],_0xc6a92f);var _0x5467f8=path[_0x476c('0xd4')](_0xc2cb9a,_0xb5d926);var _0x50cf2c=[];_0x50cf2c[_0x476c('0x39')]({'model':db[_0x476c('0x76')],'as':_0x476c('0x76'),'attributes':['id',_0x476c('0x34')],'raw':!![]});_0x50cf2c[_0x476c('0x39')]({'model':db[_0x476c('0xd9')],'as':_0x476c('0x69'),'attributes':['id',_0x476c('0xda'),'lastName'],'raw':!![]});if(_0x472334[_0x476c('0x40')][_0x476c('0xd8')]){_0x50cf2c[_0x476c('0x39')]({'model':db['Attachment'],'as':_0x476c('0xdb'),'raw':!![]});}var _0x525531=[{'model':db['OpenchannelMessage'],'as':_0x476c('0xdc'),'attributes':['id',_0x476c('0xc0'),_0x476c('0xdd'),_0x476c('0xde'),'secret',_0x476c('0x84')],'include':_0x50cf2c}];_0x525531[_0x476c('0x39')]({'model':db[_0x476c('0xdf')],'as':_0x476c('0xe0'),'attributes':['id',_0x476c('0x4d')]});_0x525531['push']({'model':db[_0x476c('0x76')],'as':'Owner','attributes':['id',_0x476c('0x34')]});return db['OpenchannelInteraction'][_0x476c('0x65')]({'where':{'id':_0x472334[_0x476c('0xbb')]['id']},'include':_0x525531})[_0x476c('0x2c')](handleEntityNotFound(_0x59f7d8,null))[_0x476c('0x2c')](function(_0x4717a4){if(_0x4717a4){var _0x359083=_0x4717a4[_0x476c('0xe1')]({'plain':!![]});fs[_0x476c('0xe2')](_0x27bb51);var _0x153b0e={'channel':'Openchannel','account':_0x359083['Account'][_0x476c('0x4d')],'agent':_0x359083[_0x476c('0xe3')]?_0x359083[_0x476c('0xe3')]['fullname']:_0x476c('0xe4'),'createdAt':moment(_0x359083[_0x476c('0xdd')])[_0x476c('0xcb')](_0x476c('0xcc'))[_0x476c('0xa1')](),'closedAt':_0x359083[_0x476c('0xe5')]?moment(_0x359083['closedAt'])[_0x476c('0xcb')](_0x476c('0xcc'))[_0x476c('0xa1')]():'','disposition':_0x359083[_0x476c('0xe6')],'visibility':_0x359083['threadId']?_0x476c('0xe7'):_0x476c('0xe8'),'messages':_(_0x359083[_0x476c('0xdc')])[_0x476c('0x88')]({'secret':![]})[_0x476c('0x33')](function(_0x501ca3){if(_0x501ca3[_0x476c('0xdb')]){var _0x4d186d=path[_0x476c('0xd4')](_0x3903ab,_0x501ca3[_0x476c('0xdb')]['basename']);if(fs['existsSync'](_0x4d186d)){fs['createReadStream'](_0x4d186d)[_0x476c('0xe9')](fs[_0x476c('0xea')](path[_0x476c('0xd4')](_0x27bb51,_0x501ca3[_0x476c('0xdb')][_0x476c('0xeb')])));}}return{'date':moment(_0x501ca3[_0x476c('0xdd')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x476c('0xa1')](),'sender':_0x501ca3[_0x476c('0xde')]==='out'?_0x501ca3[_0x476c('0x76')]?_0x501ca3[_0x476c('0x76')][_0x476c('0x34')]:'System':_0x501ca3[_0x476c('0x69')][_0x476c('0xda')]+(_0x501ca3['Contact']['lastName']?'\x20'+_0x501ca3['Contact'][_0x476c('0xec')]:''),'body':_0x501ca3[_0x476c('0xdb')]?_0x501ca3['Attachment'][_0x476c('0xeb')]:_0x501ca3[_0x476c('0xc0')],'direction':_0x501ca3[_0x476c('0xde')]==='out'?'A':'C','secret':_0x501ca3[_0x476c('0xed')],'read':_0x501ca3[_0x476c('0x84')],'attachment':_0x501ca3['Attachment']};})[_0x476c('0x66')]()};return ejs['renderFile'](path[_0x476c('0xd4')](config[_0x476c('0xd5')],_0x476c('0xd6'),'views','downloadInteraction.ejs'),{'interaction':_0x153b0e})[_0x476c('0x2c')](function(_0x53fb86){var _0x4be4a5=path[_0x476c('0xd4')](_0x27bb51,_0x476c('0xee')+_0x359083['id']+'-'+_0xc6a92f+_0x476c('0xef'));var _0x51da90={'path':_0x4be4a5,'channel':_0x476c('0xf0'),'interactionId':_0x359083['id']};return pdf['createPdfFromHTML'](_0x53fb86,_0x51da90);})['then'](function(){return new BPromise(function(_0x508f74,_0xd5e3f5){zipdir(_0x27bb51,{'saveTo':_0x5467f8},function(_0x1a65f0,_0x5c02ef){if(_0x1a65f0)return _0xd5e3f5(_0x1a65f0);return _0x508f74(_0x5c02ef);});})[_0x476c('0x2c')](function(){return new BPromise(function(_0x3456e9,_0xe3bd1c){rimraf(_0x27bb51,function(_0x5c9106){if(_0x5c9106)_0xe3bd1c(_0x5c9106);return _0x3456e9();});});})[_0x476c('0x2c')](function(){return _0x59f7d8[_0x476c('0xf1')](_0x5467f8,_0xb5d926,function(_0x521e23){if(_0x521e23){console[_0x476c('0xf2')]('err',_0x521e23);}else{fs[_0x476c('0xf3')](_0x5467f8);}});});});}else{return _0x59f7d8['sendStatus'](0xc8);}})[_0x476c('0x3a')](handleError(_0x59f7d8,null));};
\ No newline at end of file
index 1c7eed2..fa0a886 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf419=['save','remove','getUsers','then','setDataValue','Users','map','unreadMessages','emit','hasOwnProperty','exports','../../mysqldb','OpenchannelInteraction','setMaxListeners'];(function(_0x589661,_0x149d80){var _0x19b88a=function(_0xdffea1){while(--_0xdffea1){_0x589661['push'](_0x589661['shift']());}};_0x19b88a(++_0x149d80);}(_0xf419,0xc1));var _0x9f41=function(_0x370f4f,_0x3e31d3){_0x370f4f=_0x370f4f-0x0;var _0x5d4229=_0xf419[_0x370f4f];return _0x5d4229;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x9f41('0x0'))['db'][_0x9f41('0x1')];var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x9f41('0x2')](0x0);var events={'afterCreate':_0x9f41('0x3'),'afterUpdate':'update','afterDestroy':_0x9f41('0x4')};function emitEvent(_0x341cb1){return function(_0x35bc38,_0x3e72c4,_0x1c0567){_0x35bc38[_0x9f41('0x5')]({'attributes':['id'],'raw':!![]})[_0x9f41('0x6')](function(_0x4c629e){_0x35bc38[_0x9f41('0x7')](_0x9f41('0x8'),_0x4c629e[_0x9f41('0x9')](function(_0x965799){return{'id':_0x965799['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x35bc38['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9f41('0x6')](function(_0x1f3932){_0x35bc38[_0x9f41('0x7')](_0x9f41('0xa'),_0x1f3932['length']);OpenchannelInteractionEvents[_0x9f41('0xb')](_0x341cb1+':'+_0x35bc38['id'],_0x35bc38);OpenchannelInteractionEvents[_0x9f41('0xb')](_0x341cb1,_0x35bc38);_0x1c0567(null);})['catch'](_0x1c0567(null));};}for(var e in events){if(events[_0x9f41('0xc')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x9f41('0xd')]=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0xad0a=['length','emit','hook','exports','events','OpenchannelInteraction','../../mysqldb','setMaxListeners','save','update','remove','then','setDataValue','Users','map','findAll','unreadMessages'];(function(_0x50cd70,_0x505afc){var _0x399f46=function(_0x3664e0){while(--_0x3664e0){_0x50cd70['push'](_0x50cd70['shift']());}};_0x399f46(++_0x505afc);}(_0xad0a,0xe1));var _0xaad0=function(_0xc19ba8,_0x21716a){_0xc19ba8=_0xc19ba8-0x0;var _0x500e54=_0xad0a[_0xc19ba8];return _0x500e54;};'use strict';var EventEmitter=require(_0xaad0('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0xaad0('0x1')];var OpenchannelMessage=require(_0xaad0('0x2'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xaad0('0x3')](0x0);var events={'afterCreate':_0xaad0('0x4'),'afterUpdate':_0xaad0('0x5'),'afterDestroy':_0xaad0('0x6')};function emitEvent(_0x5423a4){return function(_0x3b094b,_0x14d81a,_0x2cc4b1){_0x3b094b['getUsers']({'attributes':['id'],'raw':!![]})[_0xaad0('0x7')](function(_0x57dc7c){_0x3b094b[_0xaad0('0x8')](_0xaad0('0x9'),_0x57dc7c[_0xaad0('0xa')](function(_0x2ee993){return{'id':_0x2ee993['id']};}));return OpenchannelMessage[_0xaad0('0xb')]({'where':{'OpenchannelInteractionId':_0x3b094b['id'],'direction':'in','read':![]},'raw':!![]});})[_0xaad0('0x7')](function(_0x4dc0b7){_0x3b094b[_0xaad0('0x8')](_0xaad0('0xc'),_0x4dc0b7[_0xaad0('0xd')]);OpenchannelInteractionEvents[_0xaad0('0xe')](_0x5423a4+':'+_0x3b094b['id'],_0x3b094b);OpenchannelInteractionEvents['emit'](_0x5423a4,_0x3b094b);_0x2cc4b1(null);})['catch'](_0x2cc4b1(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0xaad0('0xf')](e,emitEvent(event));}}module[_0xaad0('0x10')]=OpenchannelInteractionEvents;
\ No newline at end of file
index d526494..3738f4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ff4=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','lodash'];(function(_0x29724e,_0x4a1f71){var _0x333cc5=function(_0x472203){while(--_0x472203){_0x29724e['push'](_0x29724e['shift']());}};_0x333cc5(++_0x4a1f71);}(_0x0ff4,0xef));var _0x40ff=function(_0x2cd068,_0x7a0a83){_0x2cd068=_0x2cd068-0x0;var _0x1f2d00=_0x0ff4[_0x2cd068];return _0x1f2d00;};'use strict';var _=require(_0x40ff('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x40ff('0x1'));var moment=require(_0x40ff('0x2'));var BPromise=require(_0x40ff('0x3'));var rp=require(_0x40ff('0x4'));var fs=require('fs');var path=require(_0x40ff('0x5'));var rimraf=require(_0x40ff('0x6'));var config=require(_0x40ff('0x7'));var attributes=require(_0x40ff('0x8'));module[_0x40ff('0x9')]=function(_0x3748cc,_0x525269){return _0x3748cc[_0x40ff('0xa')]('OpenchannelInteraction',attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x40ff('0xb'),'collate':_0x40ff('0xc'),'hooks':{'beforeUpdate':function(_0x2cf517,_0x14be59,_0x251d9c){if(_0x2cf517[_0x40ff('0xd')](_0x40ff('0xe'))){_0x2cf517[_0x40ff('0xf')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x251d9c(null,_0x2cf517);}}});};
\ No newline at end of file
+var _0x8451=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','request-promise','rimraf','./openchannelInteraction.attributes','define','openchannel_interactions','utf8mb4','changed','closed','closedAt','format'];(function(_0x9aedb0,_0x1ddf6f){var _0x145a61=function(_0x4be476){while(--_0x4be476){_0x9aedb0['push'](_0x9aedb0['shift']());}};_0x145a61(++_0x1ddf6f);}(_0x8451,0x100));var _0x1845=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x8451[_0x5f0089];return _0x193892;};'use strict';var _=require(_0x1845('0x0'));var util=require(_0x1845('0x1'));var logger=require(_0x1845('0x2'))('api');var moment=require(_0x1845('0x3'));var BPromise=require('bluebird');var rp=require(_0x1845('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1845('0x5'));var config=require('../../config/environment');var attributes=require(_0x1845('0x6'));module['exports']=function(_0x222175,_0x310ff9){return _0x222175[_0x1845('0x7')]('OpenchannelInteraction',attributes,{'tableName':_0x1845('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1845('0x9'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x22c513,_0x52093f,_0x451163){if(_0x22c513[_0x1845('0xa')](_0x1845('0xb'))){_0x22c513[_0x1845('0xc')]=moment()[_0x1845('0xd')](_0x1845('0xe'));}_0x451163(null,_0x22c513);}}});};
\ No newline at end of file
index 827069f..4651682 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0cc9=['error','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','options','raw','where','attributes','limit','AddTagsToOpenchannelInteraction','find','addTags','body','ids','omit','spread','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4ca87d,_0x464586){var _0x338dfa=function(_0x2a0ca9){while(--_0x2a0ca9){_0x4ca87d['push'](_0x4ca87d['shift']());}};_0x338dfa(++_0x464586);}(_0x0cc9,0x67));var _0x90cc=function(_0x235563,_0x260ece){_0x235563=_0x235563-0x0;var _0x219be0=_0x0cc9[_0x235563];return _0x219be0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x90cc('0x0'));var BPromise=require(_0x90cc('0x1'));var rs=require(_0x90cc('0x2'));var fs=require('fs');var Redis=require(_0x90cc('0x3'));var db=require(_0x90cc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x90cc('0x5'))(_0x90cc('0x6'));var config=require('../../config/environment');var jayson=require(_0x90cc('0x7'));var client=jayson[_0x90cc('0x8')][_0x90cc('0x9')]({'port':0x232a});config[_0x90cc('0xa')]=_[_0x90cc('0xb')](config['redis'],{'host':_0x90cc('0xc'),'port':0x18eb});var socket=require(_0x90cc('0xd'))(new Redis(config['redis']));require(_0x90cc('0xe'))[_0x90cc('0xf')](socket);function respondWithRpcPromise(_0x40f0f4,_0x3a7edb,_0x298ab9){return new BPromise(function(_0x183a27,_0x24c630){return client['request'](_0x40f0f4,_0x298ab9)[_0x90cc('0x10')](function(_0x24797b){logger[_0x90cc('0x11')](_0x90cc('0x12'),_0x3a7edb,_0x90cc('0x13'));logger[_0x90cc('0x14')](_0x90cc('0x15'),_0x3a7edb,_0x90cc('0x13'),JSON[_0x90cc('0x16')](_0x24797b));if(_0x24797b['error']){if(_0x24797b[_0x90cc('0x17')]['code']===0x1f4){logger[_0x90cc('0x17')](_0x90cc('0x12'),_0x3a7edb,_0x24797b[_0x90cc('0x17')][_0x90cc('0x18')]);return _0x24c630(_0x24797b[_0x90cc('0x17')][_0x90cc('0x18')]);}logger[_0x90cc('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x3a7edb,_0x24797b[_0x90cc('0x17')][_0x90cc('0x18')]);return _0x183a27(_0x24797b[_0x90cc('0x17')][_0x90cc('0x18')]);}else{logger[_0x90cc('0x11')](_0x90cc('0x12'),_0x3a7edb,_0x90cc('0x13'));_0x183a27(_0x24797b[_0x90cc('0x19')]['message']);}})[_0x90cc('0x1a')](function(_0x2577f5){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x3a7edb,_0x2577f5);_0x24c630(_0x2577f5);});});}exports[_0x90cc('0x1b')]=function(_0x472152){var _0x562908=this;return new Promise(function(_0x3b1c5e,_0x44eacf){return db[_0x90cc('0x1c')]['update'](_0x472152['body'],{'raw':_0x472152['options']?_0x472152[_0x90cc('0x1d')][_0x90cc('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x472152[_0x90cc('0x1d')]?_0x472152[_0x90cc('0x1d')][_0x90cc('0x1f')]||null:null,'attributes':_0x472152['options']?_0x472152[_0x90cc('0x1d')][_0x90cc('0x20')]||null:null,'limit':_0x472152['options']?_0x472152[_0x90cc('0x1d')][_0x90cc('0x21')]||null:null})[_0x90cc('0x10')](function(_0x104338){logger[_0x90cc('0x11')](_0x90cc('0x1b'),_0x472152);logger['debug'](_0x90cc('0x1b'),_0x472152,JSON['stringify'](_0x104338));_0x3b1c5e(_0x104338);})['catch'](function(_0x38289d){logger[_0x90cc('0x17')](_0x90cc('0x1b'),_0x38289d[_0x90cc('0x18')],_0x472152);_0x44eacf(_0x562908[_0x90cc('0x17')](0x1f4,_0x38289d[_0x90cc('0x18')]));});});};exports[_0x90cc('0x22')]=function(_0x53f327){return new Promise(function(_0xc8548b,_0x5c636e){return db[_0x90cc('0x1c')][_0x90cc('0x23')]({'where':_0x53f327['options']?_0x53f327[_0x90cc('0x1d')]['where']||null:null})['then'](function(_0x3dc3f3){if(_0x3dc3f3){return _0x3dc3f3[_0x90cc('0x24')](_0x53f327[_0x90cc('0x25')][_0x90cc('0x26')],_[_0x90cc('0x27')](_0x53f327['body'],[_0x90cc('0x26'),'id'])||{});}})[_0x90cc('0x28')](function(_0x2d516b){logger[_0x90cc('0x11')](_0x90cc('0x29'),_0x53f327);logger[_0x90cc('0x14')]('AddTags',_0x53f327,JSON['stringify'](_0x2d516b));_0xc8548b(_0x2d516b);})[_0x90cc('0x1a')](function(_0x89a3e8){logger[_0x90cc('0x17')](_0x90cc('0x29'),_0x89a3e8['message'],_0x53f327);_0x5c636e(_this[_0x90cc('0x17')](0x1f4,_0x89a3e8['message']));});});};
\ No newline at end of file
+var _0xdf5e=['message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','AddTagsToOpenchannelInteraction','find','ids','omit','spread','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1d884d,_0x23fab6){var _0x7fa4ba=function(_0x33ff08){while(--_0x33ff08){_0x1d884d['push'](_0x1d884d['shift']());}};_0x7fa4ba(++_0x23fab6);}(_0xdf5e,0x130));var _0xedf5=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xdf5e[_0x54d4a8];return _0x3b321b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xedf5('0x0'));var BPromise=require(_0xedf5('0x1'));var rs=require(_0xedf5('0x2'));var fs=require('fs');var Redis=require(_0xedf5('0x3'));var db=require(_0xedf5('0x4'))['db'];var utils=require(_0xedf5('0x5'));var logger=require(_0xedf5('0x6'))(_0xedf5('0x7'));var config=require(_0xedf5('0x8'));var jayson=require(_0xedf5('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xedf5('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xedf5('0xb'))(new Redis(config['redis']));require(_0xedf5('0xc'))[_0xedf5('0xd')](socket);function respondWithRpcPromise(_0x14e22d,_0x2b341c,_0xad29a0){return new BPromise(function(_0x193a20,_0xa7a51f){return client[_0xedf5('0xe')](_0x14e22d,_0xad29a0)[_0xedf5('0xf')](function(_0x5f19af){logger[_0xedf5('0x10')](_0xedf5('0x11'),_0x2b341c,_0xedf5('0x12'));logger[_0xedf5('0x13')](_0xedf5('0x14'),_0x2b341c,_0xedf5('0x12'),JSON[_0xedf5('0x15')](_0x5f19af));if(_0x5f19af[_0xedf5('0x16')]){if(_0x5f19af['error'][_0xedf5('0x17')]===0x1f4){logger[_0xedf5('0x16')](_0xedf5('0x11'),_0x2b341c,_0x5f19af[_0xedf5('0x16')][_0xedf5('0x18')]);return _0xa7a51f(_0x5f19af[_0xedf5('0x16')][_0xedf5('0x18')]);}logger[_0xedf5('0x16')](_0xedf5('0x11'),_0x2b341c,_0x5f19af[_0xedf5('0x16')][_0xedf5('0x18')]);return _0x193a20(_0x5f19af['error'][_0xedf5('0x18')]);}else{logger['info'](_0xedf5('0x11'),_0x2b341c,_0xedf5('0x12'));_0x193a20(_0x5f19af[_0xedf5('0x19')][_0xedf5('0x18')]);}})[_0xedf5('0x1a')](function(_0x468863){logger[_0xedf5('0x16')](_0xedf5('0x11'),_0x2b341c,_0x468863);_0xa7a51f(_0x468863);});});}exports[_0xedf5('0x1b')]=function(_0x4ac898){var _0x2be5a0=this;return new Promise(function(_0x2be7d7,_0x8ebd69){return db[_0xedf5('0x1c')][_0xedf5('0x1d')](_0x4ac898[_0xedf5('0x1e')],{'raw':_0x4ac898[_0xedf5('0x1f')]?_0x4ac898['options'][_0xedf5('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ac898[_0xedf5('0x1f')]?_0x4ac898[_0xedf5('0x1f')][_0xedf5('0x21')]||null:null,'attributes':_0x4ac898['options']?_0x4ac898[_0xedf5('0x1f')][_0xedf5('0x22')]||null:null,'limit':_0x4ac898[_0xedf5('0x1f')]?_0x4ac898[_0xedf5('0x1f')]['limit']||null:null})[_0xedf5('0xf')](function(_0x3879d4){logger[_0xedf5('0x10')](_0xedf5('0x1b'),_0x4ac898);logger[_0xedf5('0x13')](_0xedf5('0x1b'),_0x4ac898,JSON['stringify'](_0x3879d4));_0x2be7d7(_0x3879d4);})[_0xedf5('0x1a')](function(_0x1132e0){logger[_0xedf5('0x16')](_0xedf5('0x1b'),_0x1132e0[_0xedf5('0x18')],_0x4ac898);_0x8ebd69(_0x2be5a0['error'](0x1f4,_0x1132e0[_0xedf5('0x18')]));});});};exports[_0xedf5('0x23')]=function(_0x219dd0){return new Promise(function(_0x379040,_0xd077e6){return db[_0xedf5('0x1c')][_0xedf5('0x24')]({'where':_0x219dd0[_0xedf5('0x1f')]?_0x219dd0[_0xedf5('0x1f')][_0xedf5('0x21')]||null:null})[_0xedf5('0xf')](function(_0x19026c){if(_0x19026c){return _0x19026c['addTags'](_0x219dd0['body'][_0xedf5('0x25')],_[_0xedf5('0x26')](_0x219dd0[_0xedf5('0x1e')],[_0xedf5('0x25'),'id'])||{});}})[_0xedf5('0x27')](function(_0x2250e3){logger[_0xedf5('0x10')]('AddTags',_0x219dd0);logger['debug'](_0xedf5('0x28'),_0x219dd0,JSON['stringify'](_0x2250e3));_0x379040(_0x2250e3);})[_0xedf5('0x1a')](function(_0x3de3fc){logger[_0xedf5('0x16')](_0xedf5('0x28'),_0x3de3fc[_0xedf5('0x18')],_0x219dd0);_0xd077e6(_this[_0xedf5('0x16')](0x1f4,_0x3de3fc[_0xedf5('0x18')]));});});};
\ No newline at end of file
index 8af69e4..a3dc110 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1004=['register','length','openchannelInteraction:','save','remove','update','emit','removeListener'];(function(_0xdf603b,_0x5e7dd4){var _0x285cba=function(_0x512071){while(--_0x512071){_0xdf603b['push'](_0xdf603b['shift']());}};_0x285cba(++_0x5e7dd4);}(_0x1004,0x93));var _0x4100=function(_0x2cecdd,_0x2de00a){_0x2cecdd=_0x2cecdd-0x0;var _0x30a10c=_0x1004[_0x2cecdd];return _0x30a10c;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x4100('0x0'),_0x4100('0x1'),_0x4100('0x2')];function createListener(_0x4a1382,_0xe80311){return function(_0x428866){_0xe80311[_0x4100('0x3')](_0x4a1382,_0x428866);};}function removeListener(_0x6cd843,_0x35b2c0){return function(){OpenchannelInteractionEvents[_0x4100('0x4')](_0x6cd843,_0x35b2c0);};}exports[_0x4100('0x5')]=function(_0x58ce25){for(var _0x980a49=0x0,_0x46471a=events[_0x4100('0x6')];_0x980a49<_0x46471a;_0x980a49++){var _0x47da04=events[_0x980a49];var _0x47f738=createListener(_0x4100('0x7')+_0x47da04,_0x58ce25);OpenchannelInteractionEvents['on'](_0x47da04,_0x47f738);}};
\ No newline at end of file
+var _0xc212=['update','removeListener','register','length','openchannelInteraction:','save','remove'];(function(_0x70b3fa,_0x2dabb6){var _0x15b825=function(_0x209983){while(--_0x209983){_0x70b3fa['push'](_0x70b3fa['shift']());}};_0x15b825(++_0x2dabb6);}(_0xc212,0x186));var _0x2c21=function(_0x417cea,_0x261761){_0x417cea=_0x417cea-0x0;var _0x22d92e=_0xc212[_0x417cea];return _0x22d92e;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x2c21('0x0'),_0x2c21('0x1'),_0x2c21('0x2')];function createListener(_0x1a92f2,_0x3ccb1a){return function(_0x37a63e){_0x3ccb1a['emit'](_0x1a92f2,_0x37a63e);};}function removeListener(_0x4caa59,_0x2780f8){return function(){OpenchannelInteractionEvents[_0x2c21('0x3')](_0x4caa59,_0x2780f8);};}exports[_0x2c21('0x4')]=function(_0x41289f){for(var _0x4ff3e2=0x0,_0x79be49=events[_0x2c21('0x5')];_0x4ff3e2<_0x79be49;_0x4ff3e2++){var _0x5a03a9=events[_0x4ff3e2];var _0x11a705=createListener(_0x2c21('0x6')+_0x5a03a9,_0x41289f);OpenchannelInteractionEvents['on'](_0x5a03a9,_0x11a705);}};
\ No newline at end of file
index 6a55ead..42d884c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_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'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router;
\ No newline at end of file
+var _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_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'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router;
\ No newline at end of file
index 7c0702c..c0b8eb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9000=['sequelize','exports','medium','BOOLEAN','ENUM','out','DATE','STRING','TEXT'];(function(_0x4f902a,_0x5a11b7){var _0xc7c2db=function(_0x2eb211){while(--_0x2eb211){_0x4f902a['push'](_0x4f902a['shift']());}};_0xc7c2db(++_0x5a11b7);}(_0x9000,0x19e));var _0x0900=function(_0x153136,_0x2be1b6){_0x153136=_0x153136-0x0;var _0x35abfd=_0x9000[_0x153136];return _0x35abfd;};'use strict';var Sequelize=require(_0x0900('0x0'));module[_0x0900('0x1')]={'body':{'type':Sequelize['TEXT'](_0x0900('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x0900('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x0900('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0900('0x4')]('in',_0x0900('0x5')),'defaultValue':_0x0900('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x0900('0x6')]},'providerName':{'type':Sequelize[_0x0900('0x7')]},'providerResponse':{'type':Sequelize[_0x0900('0x8')]}};
\ No newline at end of file
+var _0xcd31=['BOOLEAN','ENUM','out','DATE','STRING','exports','TEXT','medium'];(function(_0x16916f,_0x1655ee){var _0x536d2a=function(_0x8cdc62){while(--_0x8cdc62){_0x16916f['push'](_0x16916f['shift']());}};_0x536d2a(++_0x1655ee);}(_0xcd31,0x15d));var _0x1cd3=function(_0x5664fd,_0x58f991){_0x5664fd=_0x5664fd-0x0;var _0x95a400=_0xcd31[_0x5664fd];return _0x95a400;};'use strict';var Sequelize=require('sequelize');module[_0x1cd3('0x0')]={'body':{'type':Sequelize[_0x1cd3('0x1')](_0x1cd3('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x1cd3('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1cd3('0x4')]('in',_0x1cd3('0x5')),'defaultValue':_0x1cd3('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x1cd3('0x6')]},'providerName':{'type':Sequelize[_0x1cd3('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 4c76870..187bb74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb935=['moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','socket.io-emitter','redis','jayson/promise','client','http','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','error','code','message','catch','sendStatus','end','status','json','offset','undefined','count','limit','reject','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','OpenchannelMessage','includeAll','include','findAll','then','rows','params','find','create','body','describe','openchannel-interactions','accept','openchannel','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','SIP/%s','channel','motionChannel','EventManager','acceptmessage','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','email','interface','event','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x5af209,_0x291e6e){var _0x38cbbc=function(_0x2ef142){while(--_0x2ef142){_0x5af209['push'](_0x5af209['shift']());}};_0x38cbbc(++_0x291e6e);}(_0xb935,0x17f));var _0x5b93=function(_0x23cf38,_0x714503){_0x23cf38=_0x23cf38-0x0;var _0x5e8cd7=_0xb935[_0x23cf38];return _0x5e8cd7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5b93('0x0'));var zipdir=require(_0x5b93('0x1'));var jsonpatch=require(_0x5b93('0x2'));var rp=require(_0x5b93('0x3'));var moment=require(_0x5b93('0x4'));var BPromise=require(_0x5b93('0x5'));var Mustache=require(_0x5b93('0x6'));var util=require('util');var path=require(_0x5b93('0x7'));var sox=require(_0x5b93('0x8'));var csv=require(_0x5b93('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5b93('0xa'));var _=require(_0x5b93('0xb'));var squel=require(_0x5b93('0xc'));var crypto=require(_0x5b93('0xd'));var jsforce=require(_0x5b93('0xe'));var deskjs=require(_0x5b93('0xf'));var toCsv=require(_0x5b93('0x9'));var querystring=require(_0x5b93('0x10'));var Papa=require(_0x5b93('0x11'));var Redis=require(_0x5b93('0x12'));var authService=require(_0x5b93('0x13'));var qs=require(_0x5b93('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5b93('0x15'))(_0x5b93('0x16'));var utils=require(_0x5b93('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5b93('0x18'))['db'];config['redis']=_[_0x5b93('0x19')](config['redis'],{'host':_0x5b93('0x1a'),'port':0x18eb});var socket=require(_0x5b93('0x1b'))(new Redis(config[_0x5b93('0x1c')]));require('./openchannelMessage.socket')['register'](socket);var jayson=require(_0x5b93('0x1d'));var client=jayson[_0x5b93('0x1e')][_0x5b93('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x5b93('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x4594b0,_0x1d60df,_0x2e180e,_0x4524ae){return new BPromise(function(_0x5bc5a9,_0x1c9476){var _0x20ba66=_0x4524ae||client;return _0x20ba66['request'](_0x4594b0,_0x2e180e)['then'](function(_0xb6cd4c){logger[_0x5b93('0x20')](_0x5b93('0x21'),_0x1d60df,'request\x20sent');logger['debug']('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x1d60df,_0x5b93('0x22'),JSON['stringify'](_0xb6cd4c));if(_0xb6cd4c[_0x5b93('0x23')]){if(_0xb6cd4c[_0x5b93('0x23')][_0x5b93('0x24')]===0x1f4){logger[_0x5b93('0x23')](_0x5b93('0x21'),_0x1d60df,_0xb6cd4c[_0x5b93('0x23')]['message']);return _0x1c9476(_0xb6cd4c[_0x5b93('0x23')][_0x5b93('0x25')]);}logger[_0x5b93('0x23')](_0x5b93('0x21'),_0x1d60df,_0xb6cd4c[_0x5b93('0x23')]['message']);return _0x5bc5a9(_0xb6cd4c['error'][_0x5b93('0x25')]);}else{logger[_0x5b93('0x20')](_0x5b93('0x21'),_0x1d60df,_0x5b93('0x22'));_0x5bc5a9(_0xb6cd4c['result'][_0x5b93('0x25')]);}})[_0x5b93('0x26')](function(_0x20fbe5){logger[_0x5b93('0x23')](_0x5b93('0x21'),_0x1d60df,_0x20fbe5);_0x1c9476(_0x20fbe5);});});}function respondWithStatusCode(_0x5df90d,_0x4bf6b4){_0x4bf6b4=_0x4bf6b4||0xcc;return function(_0x4f4365){if(_0x4f4365){return _0x5df90d[_0x5b93('0x27')](_0x4bf6b4);}return _0x5df90d['status'](_0x4bf6b4)[_0x5b93('0x28')]();};}function respondWithResult(_0x509d60,_0x17d497){_0x17d497=_0x17d497||0xc8;return function(_0x18069){if(_0x18069){return _0x509d60[_0x5b93('0x29')](_0x17d497)[_0x5b93('0x2a')](_0x18069);}};}function respondWithFilteredResult(_0x2fc522,_0x3d5b92){return function(_0x157b66){if(_0x157b66){var _0x5b6f26=typeof _0x3d5b92[_0x5b93('0x2b')]===_0x5b93('0x2c')&&typeof _0x3d5b92['limit']===_0x5b93('0x2c');var _0x488c8f=_0x157b66[_0x5b93('0x2d')];var _0x498408=_0x5b6f26?0x0:_0x3d5b92['offset'];var _0x21271a=_0x5b6f26?_0x157b66[_0x5b93('0x2d')]:_0x3d5b92[_0x5b93('0x2b')]+_0x3d5b92[_0x5b93('0x2e')];var _0x1f10fe;if(_0x21271a>=_0x488c8f){_0x21271a=_0x488c8f;_0x1f10fe=0xc8;}else{_0x1f10fe=0xce;}_0x2fc522[_0x5b93('0x29')](_0x1f10fe);return _0x2fc522['set']('Content-Range',_0x498408+'-'+_0x21271a+'/'+_0x488c8f)[_0x5b93('0x2a')](_0x157b66);}return null;};}function patchUpdates(_0x25e9fa){return function(_0x1cfdf6){try{jsonpatch['apply'](_0x1cfdf6,_0x25e9fa,!![]);}catch(_0x3e76a7){return BPromise[_0x5b93('0x2f')](_0x3e76a7);}return _0x1cfdf6['save']();};}function saveUpdates(_0x3fa6b1,_0x47f153){return function(_0x3e4ad8){if(_0x3e4ad8){return _0x3e4ad8[_0x5b93('0x30')](_0x3fa6b1)['then'](function(_0x4d967b){return _0x4d967b;});}return null;};}function removeEntity(_0x8d2142,_0x20f244){return function(_0x1b16d6){if(_0x1b16d6){return _0x1b16d6[_0x5b93('0x31')]()['then'](function(){_0x8d2142[_0x5b93('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x175d6f,_0xabeb7a){return function(_0x1cdea8){if(!_0x1cdea8){_0x175d6f[_0x5b93('0x27')](0x194);}return _0x1cdea8;};}function handleError(_0x2859f2,_0x26b1cf){_0x26b1cf=_0x26b1cf||0x1f4;return function(_0x2e8c21){logger[_0x5b93('0x23')](_0x2e8c21[_0x5b93('0x32')]);if(_0x2e8c21[_0x5b93('0x33')]){delete _0x2e8c21[_0x5b93('0x33')];}_0x2859f2['status'](_0x26b1cf)[_0x5b93('0x34')](_0x2e8c21);};}exports[_0x5b93('0x35')]=function(_0x48b8ca,_0x16a342){var _0x5aa4aa={},_0x3144a8={},_0x1119ac={'count':0x0,'rows':[]};var _0x55920b=_[_0x5b93('0x36')](db['OpenchannelMessage'][_0x5b93('0x37')],function(_0x23c48e){return{'name':_0x23c48e[_0x5b93('0x38')],'type':_0x23c48e[_0x5b93('0x39')][_0x5b93('0x3a')]};});_0x3144a8[_0x5b93('0x3b')]=_[_0x5b93('0x36')](_0x55920b,'name');_0x3144a8[_0x5b93('0x3c')]=_[_0x5b93('0x3d')](_0x48b8ca[_0x5b93('0x3c')]);_0x3144a8[_0x5b93('0x3e')]=_[_0x5b93('0x3f')](_0x3144a8['model'],_0x3144a8[_0x5b93('0x3c')]);_0x5aa4aa[_0x5b93('0x40')]=_[_0x5b93('0x3f')](_0x3144a8[_0x5b93('0x3b')],qs[_0x5b93('0x41')](_0x48b8ca[_0x5b93('0x3c')][_0x5b93('0x41')]));_0x5aa4aa['attributes']=_0x5aa4aa[_0x5b93('0x40')][_0x5b93('0x42')]?_0x5aa4aa[_0x5b93('0x40')]:_0x3144a8[_0x5b93('0x3b')];if(!_0x48b8ca[_0x5b93('0x3c')]['hasOwnProperty'](_0x5b93('0x43'))){_0x5aa4aa[_0x5b93('0x2e')]=qs[_0x5b93('0x2e')](_0x48b8ca[_0x5b93('0x3c')][_0x5b93('0x2e')]);_0x5aa4aa[_0x5b93('0x2b')]=qs['offset'](_0x48b8ca[_0x5b93('0x3c')][_0x5b93('0x2b')]);}_0x5aa4aa['order']=qs[_0x5b93('0x44')](_0x48b8ca[_0x5b93('0x3c')][_0x5b93('0x44')]);_0x5aa4aa['where']=qs['filters'](_[_0x5b93('0x45')](_0x48b8ca[_0x5b93('0x3c')],_0x3144a8[_0x5b93('0x3e')]),_0x55920b);if(_0x48b8ca['query'][_0x5b93('0x46')]){_0x5aa4aa['where']=_[_0x5b93('0x47')](_0x5aa4aa[_0x5b93('0x48')],{'$or':_[_0x5b93('0x36')](_0x55920b,function(_0x286806){if(_0x286806[_0x5b93('0x39')]!==_0x5b93('0x49')){var _0x1894a4={};_0x1894a4[_0x286806['name']]={'$like':'%'+_0x48b8ca['query']['filter']+'%'};return _0x1894a4;}})});}_0x5aa4aa=_[_0x5b93('0x47')]({},_0x5aa4aa,_0x48b8ca[_0x5b93('0x4a')]);var _0x3089fd={'where':_0x5aa4aa[_0x5b93('0x48')]};return db[_0x5b93('0x4b')]['count'](_0x3089fd)['then'](function(_0x185bc3){_0x1119ac[_0x5b93('0x2d')]=_0x185bc3;if(_0x48b8ca['query'][_0x5b93('0x4c')]){_0x5aa4aa[_0x5b93('0x4d')]=[{'all':!![]}];}return db[_0x5b93('0x4b')][_0x5b93('0x4e')](_0x5aa4aa);})[_0x5b93('0x4f')](function(_0x130078){_0x1119ac[_0x5b93('0x50')]=_0x130078;return _0x1119ac;})[_0x5b93('0x4f')](respondWithFilteredResult(_0x16a342,_0x5aa4aa))[_0x5b93('0x26')](handleError(_0x16a342,null));};exports['show']=function(_0x4465b7,_0x186838){var _0x3a3783={'raw':!![],'where':{'id':_0x4465b7[_0x5b93('0x51')]['id']}},_0x55e5d2={};_0x55e5d2[_0x5b93('0x3b')]=_[_0x5b93('0x3d')](db[_0x5b93('0x4b')][_0x5b93('0x37')]);_0x55e5d2[_0x5b93('0x3c')]=_[_0x5b93('0x3d')](_0x4465b7['query']);_0x55e5d2['filters']=_['intersection'](_0x55e5d2[_0x5b93('0x3b')],_0x55e5d2[_0x5b93('0x3c')]);_0x3a3783['attributes']=_[_0x5b93('0x3f')](_0x55e5d2[_0x5b93('0x3b')],qs[_0x5b93('0x41')](_0x4465b7['query']['fields']));_0x3a3783[_0x5b93('0x40')]=_0x3a3783[_0x5b93('0x40')][_0x5b93('0x42')]?_0x3a3783[_0x5b93('0x40')]:_0x55e5d2[_0x5b93('0x3b')];if(_0x4465b7[_0x5b93('0x3c')]['includeAll']){_0x3a3783[_0x5b93('0x4d')]=[{'all':!![]}];}_0x3a3783=_[_0x5b93('0x47')]({},_0x3a3783,_0x4465b7[_0x5b93('0x4a')]);return db[_0x5b93('0x4b')][_0x5b93('0x52')](_0x3a3783)[_0x5b93('0x4f')](handleEntityNotFound(_0x186838,null))['then'](respondWithResult(_0x186838,null))[_0x5b93('0x26')](handleError(_0x186838,null));};exports[_0x5b93('0x53')]=function(_0x22146b,_0x408347){return db['OpenchannelMessage'][_0x5b93('0x53')](_0x22146b['body'],{})[_0x5b93('0x4f')](respondWithResult(_0x408347,0xc9))[_0x5b93('0x26')](handleError(_0x408347,null));};exports['update']=function(_0x162f91,_0x4f9903){if(_0x162f91[_0x5b93('0x54')]['id']){delete _0x162f91['body']['id'];}return db[_0x5b93('0x4b')]['find']({'where':{'id':_0x162f91['params']['id']}})[_0x5b93('0x4f')](handleEntityNotFound(_0x4f9903,null))[_0x5b93('0x4f')](saveUpdates(_0x162f91[_0x5b93('0x54')],null))[_0x5b93('0x4f')](respondWithResult(_0x4f9903,null))[_0x5b93('0x26')](handleError(_0x4f9903,null));};exports[_0x5b93('0x31')]=function(_0x44392a,_0x9c6faf){return db[_0x5b93('0x4b')][_0x5b93('0x52')]({'where':{'id':_0x44392a[_0x5b93('0x51')]['id']}})[_0x5b93('0x4f')](handleEntityNotFound(_0x9c6faf,null))[_0x5b93('0x4f')](removeEntity(_0x9c6faf,null))['catch'](handleError(_0x9c6faf,null));};exports[_0x5b93('0x55')]=function(_0x2d9499,_0x126f99){return db[_0x5b93('0x4b')][_0x5b93('0x55')]()[_0x5b93('0x4f')](respondWithResult(_0x126f99,null))[_0x5b93('0x26')](handleError(_0x126f99,null));};var interaction_log=require(_0x5b93('0x15'))(_0x5b93('0x56'));exports[_0x5b93('0x57')]=function(_0x2e204b,_0x483e5c,_0x18d04c){var _0x1b894f={'agent':{},'channel':_0x5b93('0x58')};if(_0x2e204b[_0x5b93('0x54')]['id']){delete _0x2e204b[_0x5b93('0x54')]['id'];}_0x2e204b[_0x5b93('0x54')]['read']=!![];_0x2e204b[_0x5b93('0x54')]['readAt']=moment()[_0x5b93('0x59')](_0x5b93('0x5a'));_0x2e204b['body'][_0x5b93('0x5b')]=_0x2e204b[_0x5b93('0x54')][_0x5b93('0x5b')]||_0x2e204b[_0x5b93('0x5c')]['id'];_0x1b894f[_0x5b93('0x5d')]['id']=_0x2e204b[_0x5b93('0x54')][_0x5b93('0x5b')];return db[_0x5b93('0x4b')][_0x5b93('0x52')]({'where':{'id':_0x2e204b['params']['id'],'UserId':null}})[_0x5b93('0x4f')](handleEntityNotFound(_0x483e5c,null))[_0x5b93('0x4f')](saveUpdates(_0x2e204b[_0x5b93('0x54')],null))['then'](function(_0x96fe68){if(_0x96fe68){_0x1b894f['message']=_0x96fe68[_0x5b93('0x5e')]({'plain':!![]});return db[_0x5b93('0x5f')][_0x5b93('0x52')]({'where':{'id':_0x96fe68['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x483e5c,null))[_0x5b93('0x4f')](function(_0x270651){if(_0x270651){return _0x270651[_0x5b93('0x30')]({'UserId':_0x2e204b['body'][_0x5b93('0x5b')],'read1stAt':_[_0x5b93('0x60')](_0x270651[_0x5b93('0x61')])?moment()[_0x5b93('0x59')](_0x5b93('0x5a')):undefined});}return null;})[_0x5b93('0x4f')](function(_0x31e344){if(_0x31e344){_0x1b894f[_0x5b93('0x62')]=_0x31e344[_0x5b93('0x5e')]({'plain':!![]});interaction_log[_0x5b93('0x20')](_0x5b93('0x63'),_0x2e204b[_0x5b93('0x5c')]['id'],_0x2e204b[_0x5b93('0x5c')][_0x5b93('0x33')],_0x2e204b['user']['role'],_0x1b894f[_0x5b93('0x62')]['id'],_0x2e204b[_0x5b93('0x54')]?JSON[_0x5b93('0x64')](_0x2e204b[_0x5b93('0x54')]):_0x5b93('0x65'));return respondWithRpcPromise(_0x5b93('0x66'),_0x5b93('0x67'),_0x1b894f);}return null;})[_0x5b93('0x4f')](function(_0x5e0bb0){var _0x164c87='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5e0bb0['message'][_0x5b93('0x68')];return db['sequelize'][_0x5b93('0x3c')](_0x164c87,{'type':db[_0x5b93('0x69')][_0x5b93('0x6a')][_0x5b93('0x6b')],'raw':!![]})[_0x5b93('0x4f')](function(_0x475223){return _0x475223;});})['then'](function(_0x43314e){if(_0x43314e){_0x1b894f['message'][_0x5b93('0x6c')]=_0x43314e[0x0];if(!_0x2e204b[_0x5b93('0x54')][_0x5b93('0x5b')])return;return db[_0x5b93('0x6d')]['find']({'where':{'id':_0x2e204b[_0x5b93('0x54')]['UserId'],'role':_0x5b93('0x5d')},'attributes':['id',_0x5b93('0x33'),_0x5b93('0x6e'),'email',_0x5b93('0x6f')],'raw':!![]});}return null;})[_0x5b93('0x4f')](function(_0x495583){if(!_0x495583)return null;_0x1b894f[_0x5b93('0x25')][_0x5b93('0x5d')]=_0x495583;return _0x1b894f;})[_0x5b93('0x4f')](function(_0x30f9c7){if(_0x30f9c7){if(_0x2e204b['body'][_0x5b93('0x70')]){_0x1b894f['message']['interface']=util[_0x5b93('0x59')](_0x5b93('0x71'),_0x2e204b[_0x5b93('0x5c')][_0x5b93('0x33')]);_0x1b894f['message'][_0x5b93('0x72')]=_0x1b894f[_0x5b93('0x72')];_0x1b894f[_0x5b93('0x25')][_0x5b93('0x73')]=_0x1b894f[_0x5b93('0x72')];_0x1b894f['message']['event']='accept';return respondWithRpcPromise('EventManager',_0x5b93('0x74'),{'event':_0x5b93('0x75'),'message':_0x1b894f[_0x5b93('0x25')]},client9002)[_0x5b93('0x4f')](function(){return _0x1b894f;});}return _0x1b894f;}return null;})[_0x5b93('0x4f')](respondWithResult(_0x483e5c,null))[_0x5b93('0x26')](handleError(_0x483e5c,null));};var interaction_log=require('../../config/logger')(_0x5b93('0x56'));exports[_0x5b93('0x2f')]=function(_0x472785,_0x3ad14d,_0x2b7229){var _0x577e3c={'agent':{},'channel':'openchannel'};if(_0x472785[_0x5b93('0x54')]['id']){delete _0x472785[_0x5b93('0x54')]['id'];}_0x472785[_0x5b93('0x54')][_0x5b93('0x5b')]=_0x472785[_0x5b93('0x54')]['UserId']||_0x472785[_0x5b93('0x5c')]['id'];_0x577e3c['agent']['id']=_0x472785[_0x5b93('0x54')][_0x5b93('0x5b')];return db[_0x5b93('0x4b')][_0x5b93('0x52')]({'where':{'id':_0x472785['params']['id'],'UserId':null}})[_0x5b93('0x4f')](handleEntityNotFound(_0x3ad14d,null))[_0x5b93('0x4f')](function(_0x33f155){if(_0x33f155){_0x577e3c[_0x5b93('0x25')]=_0x33f155['get']({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x33f155[_0x5b93('0x76')]}});}return null;})[_0x5b93('0x4f')](handleEntityNotFound(_0x3ad14d,null))[_0x5b93('0x4f')](function(_0x2c8b91){if(_0x2c8b91){_0x577e3c['interaction']=_0x2c8b91[_0x5b93('0x5e')]({'plain':!![]});interaction_log[_0x5b93('0x20')](_0x5b93('0x77'),_0x472785[_0x5b93('0x5c')]['id'],_0x472785[_0x5b93('0x5c')][_0x5b93('0x33')],_0x472785[_0x5b93('0x5c')][_0x5b93('0x78')],_0x577e3c[_0x5b93('0x62')]['id'],_0x472785[_0x5b93('0x54')]?JSON['stringify'](_0x472785[_0x5b93('0x54')]):'null');return respondWithRpcPromise(_0x5b93('0x79'),_0x5b93('0x7a'),_0x577e3c);}return null;})[_0x5b93('0x4f')](function(_0x3fb282){var _0x1590d1=_0x5b93('0x7b')+_0x3fb282[_0x5b93('0x25')]['ContactId'];return db[_0x5b93('0x7c')][_0x5b93('0x3c')](_0x1590d1,{'type':db[_0x5b93('0x69')]['QueryTypes'][_0x5b93('0x6b')],'raw':!![]})['then'](function(_0xed80c1){return _0xed80c1;});})[_0x5b93('0x4f')](function(_0x44e739){if(_0x44e739){_0x577e3c[_0x5b93('0x25')][_0x5b93('0x6c')]=_0x44e739[0x0];if(!_0x472785[_0x5b93('0x54')]['UserId'])return;return db['User'][_0x5b93('0x52')]({'where':{'id':_0x472785[_0x5b93('0x54')][_0x5b93('0x5b')],'role':_0x5b93('0x5d')},'attributes':['id',_0x5b93('0x33'),_0x5b93('0x6e'),_0x5b93('0x7d'),_0x5b93('0x6f')],'raw':!![]});}return null;})[_0x5b93('0x4f')](function(_0x49c017){if(!_0x49c017)return null;_0x577e3c[_0x5b93('0x25')][_0x5b93('0x5d')]=_0x49c017;return _0x577e3c;})[_0x5b93('0x4f')](function(_0x64e3ba){if(_0x64e3ba){_0x64e3ba[_0x5b93('0x25')][_0x5b93('0x7e')]=util['format'](_0x5b93('0x71'),_0x472785[_0x5b93('0x5c')][_0x5b93('0x33')]);_0x64e3ba[_0x5b93('0x25')][_0x5b93('0x72')]=_0x577e3c[_0x5b93('0x72')];_0x64e3ba[_0x5b93('0x25')][_0x5b93('0x73')]=_0x577e3c[_0x5b93('0x72')];_0x64e3ba[_0x5b93('0x25')][_0x5b93('0x7f')]='reject';respondWithRpcPromise('EventManager','EventManager',{'event':_0x5b93('0x80'),'message':_0x64e3ba[_0x5b93('0x25')]},client9002);return _0x577e3c;}return null;})[_0x5b93('0x4f')](respondWithResult(_0x3ad14d,null))['catch'](handleError(_0x3ad14d,null));};
\ No newline at end of file
+var _0xc44c=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','defaults','redis','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','http','client','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','destroy','stack','name','index','OpenchannelMessage','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','find','catch','create','body','params','describe','openchannel-interactions','accept','openchannel','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','OpenchannelInteraction','OpenchannelInteractionId','update','isNil','read1stAt','format','interaction','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','internal','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x4653f7,_0x3d3ae3){var _0x5454da=function(_0x448f55){while(--_0x448f55){_0x4653f7['push'](_0x4653f7['shift']());}};_0x5454da(++_0x3d3ae3);}(_0xc44c,0xfb));var _0xcc44=function(_0x2fa335,_0x59ea51){_0x2fa335=_0x2fa335-0x0;var _0x5eaf78=_0xc44c[_0x2fa335];return _0x5eaf78;};'use strict';var emlformat=require(_0xcc44('0x0'));var rimraf=require(_0xcc44('0x1'));var zipdir=require(_0xcc44('0x2'));var jsonpatch=require(_0xcc44('0x3'));var rp=require(_0xcc44('0x4'));var moment=require('moment');var BPromise=require(_0xcc44('0x5'));var Mustache=require(_0xcc44('0x6'));var util=require(_0xcc44('0x7'));var path=require(_0xcc44('0x8'));var sox=require(_0xcc44('0x9'));var csv=require(_0xcc44('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcc44('0xb'));var _=require(_0xcc44('0xc'));var squel=require(_0xcc44('0xd'));var crypto=require('crypto');var jsforce=require(_0xcc44('0xe'));var deskjs=require(_0xcc44('0xf'));var toCsv=require(_0xcc44('0xa'));var querystring=require(_0xcc44('0x10'));var Papa=require(_0xcc44('0x11'));var Redis=require(_0xcc44('0x12'));var authService=require(_0xcc44('0x13'));var qs=require(_0xcc44('0x14'));var as=require(_0xcc44('0x15'));var hardwareService=require(_0xcc44('0x16'));var logger=require(_0xcc44('0x17'))('api');var utils=require(_0xcc44('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcc44('0x19'))['db'];config['redis']=_[_0xcc44('0x1a')](config[_0xcc44('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xcc44('0x1c'))(new Redis(config[_0xcc44('0x1b')]));require(_0xcc44('0x1d'))[_0xcc44('0x1e')](socket);var jayson=require(_0xcc44('0x1f'));var client=jayson['client'][_0xcc44('0x20')]({'port':0x232c});var client9002=jayson[_0xcc44('0x21')][_0xcc44('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x59b0ee,_0x27feba,_0x2a4626,_0x46d6e9){return new BPromise(function(_0x2da8d6,_0xe6e047){var _0x267314=_0x46d6e9||client;return _0x267314[_0xcc44('0x22')](_0x59b0ee,_0x2a4626)[_0xcc44('0x23')](function(_0x591065){logger[_0xcc44('0x24')](_0xcc44('0x25'),_0x27feba,_0xcc44('0x26'));logger['debug']('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x27feba,'request\x20sent',JSON[_0xcc44('0x27')](_0x591065));if(_0x591065['error']){if(_0x591065['error'][_0xcc44('0x28')]===0x1f4){logger[_0xcc44('0x29')](_0xcc44('0x25'),_0x27feba,_0x591065[_0xcc44('0x29')][_0xcc44('0x2a')]);return _0xe6e047(_0x591065[_0xcc44('0x29')][_0xcc44('0x2a')]);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x27feba,_0x591065[_0xcc44('0x29')]['message']);return _0x2da8d6(_0x591065[_0xcc44('0x29')][_0xcc44('0x2a')]);}else{logger[_0xcc44('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x27feba,'request\x20sent');_0x2da8d6(_0x591065[_0xcc44('0x2b')][_0xcc44('0x2a')]);}})['catch'](function(_0x500c8e){logger[_0xcc44('0x29')]('OpenchannelMessage,\x20%s,\x20%s',_0x27feba,_0x500c8e);_0xe6e047(_0x500c8e);});});}function respondWithStatusCode(_0x4a09fd,_0xa4de9a){_0xa4de9a=_0xa4de9a||0xcc;return function(_0x3291e2){if(_0x3291e2){return _0x4a09fd[_0xcc44('0x2c')](_0xa4de9a);}return _0x4a09fd[_0xcc44('0x2d')](_0xa4de9a)[_0xcc44('0x2e')]();};}function respondWithResult(_0x2a20fa,_0x3bd615){_0x3bd615=_0x3bd615||0xc8;return function(_0x406b6d){if(_0x406b6d){return _0x2a20fa[_0xcc44('0x2d')](_0x3bd615)['json'](_0x406b6d);}};}function respondWithFilteredResult(_0x21de2b,_0x55eb54){return function(_0x57f508){if(_0x57f508){var _0x2c7606=typeof _0x55eb54[_0xcc44('0x2f')]===_0xcc44('0x30')&&typeof _0x55eb54[_0xcc44('0x31')]===_0xcc44('0x30');var _0x416c16=_0x57f508[_0xcc44('0x32')];var _0x556905=_0x2c7606?0x0:_0x55eb54[_0xcc44('0x2f')];var _0x1e76df=_0x2c7606?_0x57f508[_0xcc44('0x32')]:_0x55eb54[_0xcc44('0x2f')]+_0x55eb54['limit'];var _0x3978e1;if(_0x1e76df>=_0x416c16){_0x1e76df=_0x416c16;_0x3978e1=0xc8;}else{_0x3978e1=0xce;}_0x21de2b[_0xcc44('0x2d')](_0x3978e1);return _0x21de2b[_0xcc44('0x33')](_0xcc44('0x34'),_0x556905+'-'+_0x1e76df+'/'+_0x416c16)[_0xcc44('0x35')](_0x57f508);}return null;};}function patchUpdates(_0x18b74f){return function(_0x415636){try{jsonpatch['apply'](_0x415636,_0x18b74f,!![]);}catch(_0x9bcfd){return BPromise[_0xcc44('0x36')](_0x9bcfd);}return _0x415636[_0xcc44('0x37')]();};}function saveUpdates(_0x305a5f,_0x210b07){return function(_0x2a0def){if(_0x2a0def){return _0x2a0def['update'](_0x305a5f)['then'](function(_0xcc9978){return _0xcc9978;});}return null;};}function removeEntity(_0x1d3942,_0x403a5c){return function(_0x4c7e0d){if(_0x4c7e0d){return _0x4c7e0d[_0xcc44('0x38')]()[_0xcc44('0x23')](function(){_0x1d3942['status'](0xcc)[_0xcc44('0x2e')]();});}};}function handleEntityNotFound(_0x58ca43,_0x126901){return function(_0x33f4c7){if(!_0x33f4c7){_0x58ca43[_0xcc44('0x2c')](0x194);}return _0x33f4c7;};}function handleError(_0xb4ae0a,_0x5866cb){_0x5866cb=_0x5866cb||0x1f4;return function(_0x46485d){logger[_0xcc44('0x29')](_0x46485d[_0xcc44('0x39')]);if(_0x46485d[_0xcc44('0x3a')]){delete _0x46485d['name'];}_0xb4ae0a[_0xcc44('0x2d')](_0x5866cb)['send'](_0x46485d);};}exports[_0xcc44('0x3b')]=function(_0xb20050,_0x129d84){var _0x2eb56c={},_0x46be7c={},_0x7df693={'count':0x0,'rows':[]};var _0x2da793=_['map'](db[_0xcc44('0x3c')][_0xcc44('0x3d')],function(_0x383b56){return{'name':_0x383b56['fieldName'],'type':_0x383b56[_0xcc44('0x3e')][_0xcc44('0x3f')]};});_0x46be7c[_0xcc44('0x40')]=_[_0xcc44('0x41')](_0x2da793,_0xcc44('0x3a'));_0x46be7c[_0xcc44('0x42')]=_[_0xcc44('0x43')](_0xb20050[_0xcc44('0x42')]);_0x46be7c[_0xcc44('0x44')]=_[_0xcc44('0x45')](_0x46be7c[_0xcc44('0x40')],_0x46be7c[_0xcc44('0x42')]);_0x2eb56c[_0xcc44('0x46')]=_[_0xcc44('0x45')](_0x46be7c[_0xcc44('0x40')],qs['fields'](_0xb20050[_0xcc44('0x42')][_0xcc44('0x47')]));_0x2eb56c[_0xcc44('0x46')]=_0x2eb56c['attributes']['length']?_0x2eb56c['attributes']:_0x46be7c[_0xcc44('0x40')];if(!_0xb20050[_0xcc44('0x42')][_0xcc44('0x48')](_0xcc44('0x49'))){_0x2eb56c[_0xcc44('0x31')]=qs[_0xcc44('0x31')](_0xb20050[_0xcc44('0x42')][_0xcc44('0x31')]);_0x2eb56c[_0xcc44('0x2f')]=qs[_0xcc44('0x2f')](_0xb20050[_0xcc44('0x42')]['offset']);}_0x2eb56c[_0xcc44('0x4a')]=qs[_0xcc44('0x4b')](_0xb20050[_0xcc44('0x42')][_0xcc44('0x4b')]);_0x2eb56c[_0xcc44('0x4c')]=qs[_0xcc44('0x44')](_['pick'](_0xb20050[_0xcc44('0x42')],_0x46be7c[_0xcc44('0x44')]),_0x2da793);if(_0xb20050[_0xcc44('0x42')]['filter']){_0x2eb56c[_0xcc44('0x4c')]=_['merge'](_0x2eb56c[_0xcc44('0x4c')],{'$or':_[_0xcc44('0x41')](_0x2da793,function(_0x19ea16){if(_0x19ea16['type']!==_0xcc44('0x4d')){var _0x16b8f1={};_0x16b8f1[_0x19ea16[_0xcc44('0x3a')]]={'$like':'%'+_0xb20050[_0xcc44('0x42')][_0xcc44('0x4e')]+'%'};return _0x16b8f1;}})});}_0x2eb56c=_[_0xcc44('0x4f')]({},_0x2eb56c,_0xb20050[_0xcc44('0x50')]);var _0x5b94ea={'where':_0x2eb56c['where']};return db[_0xcc44('0x3c')][_0xcc44('0x32')](_0x5b94ea)[_0xcc44('0x23')](function(_0x182a83){_0x7df693[_0xcc44('0x32')]=_0x182a83;if(_0xb20050[_0xcc44('0x42')][_0xcc44('0x51')]){_0x2eb56c[_0xcc44('0x52')]=[{'all':!![]}];}return db[_0xcc44('0x3c')][_0xcc44('0x53')](_0x2eb56c);})['then'](function(_0x22c7a7){_0x7df693[_0xcc44('0x54')]=_0x22c7a7;return _0x7df693;})[_0xcc44('0x23')](respondWithFilteredResult(_0x129d84,_0x2eb56c))['catch'](handleError(_0x129d84,null));};exports[_0xcc44('0x55')]=function(_0x14338b,_0x5335a9){var _0x638651={'raw':!![],'where':{'id':_0x14338b['params']['id']}},_0x410396={};_0x410396[_0xcc44('0x40')]=_['keys'](db[_0xcc44('0x3c')][_0xcc44('0x3d')]);_0x410396['query']=_[_0xcc44('0x43')](_0x14338b[_0xcc44('0x42')]);_0x410396['filters']=_[_0xcc44('0x45')](_0x410396['model'],_0x410396[_0xcc44('0x42')]);_0x638651[_0xcc44('0x46')]=_['intersection'](_0x410396['model'],qs['fields'](_0x14338b['query'][_0xcc44('0x47')]));_0x638651['attributes']=_0x638651[_0xcc44('0x46')]['length']?_0x638651[_0xcc44('0x46')]:_0x410396[_0xcc44('0x40')];if(_0x14338b['query']['includeAll']){_0x638651[_0xcc44('0x52')]=[{'all':!![]}];}_0x638651=_['merge']({},_0x638651,_0x14338b['options']);return db['OpenchannelMessage'][_0xcc44('0x56')](_0x638651)[_0xcc44('0x23')](handleEntityNotFound(_0x5335a9,null))['then'](respondWithResult(_0x5335a9,null))[_0xcc44('0x57')](handleError(_0x5335a9,null));};exports[_0xcc44('0x58')]=function(_0x3886ee,_0x26fc60){return db[_0xcc44('0x3c')][_0xcc44('0x58')](_0x3886ee['body'],{})['then'](respondWithResult(_0x26fc60,0xc9))[_0xcc44('0x57')](handleError(_0x26fc60,null));};exports['update']=function(_0x18a945,_0x13221d){if(_0x18a945[_0xcc44('0x59')]['id']){delete _0x18a945['body']['id'];}return db[_0xcc44('0x3c')]['find']({'where':{'id':_0x18a945[_0xcc44('0x5a')]['id']}})['then'](handleEntityNotFound(_0x13221d,null))[_0xcc44('0x23')](saveUpdates(_0x18a945['body'],null))['then'](respondWithResult(_0x13221d,null))['catch'](handleError(_0x13221d,null));};exports[_0xcc44('0x38')]=function(_0x2f623a,_0x539dcd){return db[_0xcc44('0x3c')][_0xcc44('0x56')]({'where':{'id':_0x2f623a[_0xcc44('0x5a')]['id']}})[_0xcc44('0x23')](handleEntityNotFound(_0x539dcd,null))[_0xcc44('0x23')](removeEntity(_0x539dcd,null))[_0xcc44('0x57')](handleError(_0x539dcd,null));};exports[_0xcc44('0x5b')]=function(_0xb29a31,_0x164741){return db[_0xcc44('0x3c')][_0xcc44('0x5b')]()[_0xcc44('0x23')](respondWithResult(_0x164741,null))['catch'](handleError(_0x164741,null));};var interaction_log=require(_0xcc44('0x17'))(_0xcc44('0x5c'));exports[_0xcc44('0x5d')]=function(_0x55b1c5,_0x46e3df,_0x5a579b){var _0x275a1d={'agent':{},'channel':_0xcc44('0x5e')};if(_0x55b1c5[_0xcc44('0x59')]['id']){delete _0x55b1c5[_0xcc44('0x59')]['id'];}_0x55b1c5[_0xcc44('0x59')][_0xcc44('0x5f')]=!![];_0x55b1c5[_0xcc44('0x59')][_0xcc44('0x60')]=moment()['format'](_0xcc44('0x61'));_0x55b1c5['body'][_0xcc44('0x62')]=_0x55b1c5[_0xcc44('0x59')][_0xcc44('0x62')]||_0x55b1c5['user']['id'];_0x275a1d[_0xcc44('0x63')]['id']=_0x55b1c5[_0xcc44('0x59')][_0xcc44('0x62')];return db['OpenchannelMessage'][_0xcc44('0x56')]({'where':{'id':_0x55b1c5['params']['id'],'UserId':null}})[_0xcc44('0x23')](handleEntityNotFound(_0x46e3df,null))[_0xcc44('0x23')](saveUpdates(_0x55b1c5[_0xcc44('0x59')],null))[_0xcc44('0x23')](function(_0x1824eb){if(_0x1824eb){_0x275a1d[_0xcc44('0x2a')]=_0x1824eb[_0xcc44('0x64')]({'plain':!![]});return db[_0xcc44('0x65')][_0xcc44('0x56')]({'where':{'id':_0x1824eb[_0xcc44('0x66')]}});}return null;})[_0xcc44('0x23')](handleEntityNotFound(_0x46e3df,null))[_0xcc44('0x23')](function(_0x1b2ab6){if(_0x1b2ab6){return _0x1b2ab6[_0xcc44('0x67')]({'UserId':_0x55b1c5[_0xcc44('0x59')]['UserId'],'read1stAt':_[_0xcc44('0x68')](_0x1b2ab6[_0xcc44('0x69')])?moment()[_0xcc44('0x6a')](_0xcc44('0x61')):undefined});}return null;})[_0xcc44('0x23')](function(_0x274ea5){if(_0x274ea5){_0x275a1d[_0xcc44('0x6b')]=_0x274ea5[_0xcc44('0x64')]({'plain':!![]});interaction_log[_0xcc44('0x24')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x55b1c5['user']['id'],_0x55b1c5['user'][_0xcc44('0x3a')],_0x55b1c5[_0xcc44('0x6c')][_0xcc44('0x6d')],_0x275a1d[_0xcc44('0x6b')]['id'],_0x55b1c5[_0xcc44('0x59')]?JSON[_0xcc44('0x27')](_0x55b1c5[_0xcc44('0x59')]):_0xcc44('0x6e'));return respondWithRpcPromise(_0xcc44('0x6f'),_0xcc44('0x70'),_0x275a1d);}return null;})[_0xcc44('0x23')](function(_0x3286dd){var _0x4e0692=_0xcc44('0x71')+_0x3286dd['message']['ContactId'];return db[_0xcc44('0x72')][_0xcc44('0x42')](_0x4e0692,{'type':db[_0xcc44('0x73')][_0xcc44('0x74')][_0xcc44('0x75')],'raw':!![]})[_0xcc44('0x23')](function(_0x2105be){return _0x2105be;});})[_0xcc44('0x23')](function(_0x75a8e5){if(_0x75a8e5){_0x275a1d[_0xcc44('0x2a')][_0xcc44('0x76')]=_0x75a8e5[0x0];if(!_0x55b1c5[_0xcc44('0x59')][_0xcc44('0x62')])return;return db[_0xcc44('0x77')]['find']({'where':{'id':_0x55b1c5[_0xcc44('0x59')][_0xcc44('0x62')],'role':_0xcc44('0x63')},'attributes':['id',_0xcc44('0x3a'),_0xcc44('0x78'),_0xcc44('0x79'),'internal'],'raw':!![]});}return null;})['then'](function(_0x1a7ef6){if(!_0x1a7ef6)return null;_0x275a1d['message'][_0xcc44('0x63')]=_0x1a7ef6;return _0x275a1d;})[_0xcc44('0x23')](function(_0x4ab234){if(_0x4ab234){if(_0x55b1c5[_0xcc44('0x59')][_0xcc44('0x7a')]){_0x275a1d[_0xcc44('0x2a')][_0xcc44('0x7b')]=util[_0xcc44('0x6a')](_0xcc44('0x7c'),_0x55b1c5[_0xcc44('0x6c')][_0xcc44('0x3a')]);_0x275a1d[_0xcc44('0x2a')][_0xcc44('0x7d')]=_0x275a1d[_0xcc44('0x7d')];_0x275a1d[_0xcc44('0x2a')]['motionChannel']=_0x275a1d[_0xcc44('0x7d')];_0x275a1d[_0xcc44('0x2a')][_0xcc44('0x7e')]='accept';return respondWithRpcPromise('EventManager',_0xcc44('0x7f'),{'event':_0xcc44('0x80'),'message':_0x275a1d[_0xcc44('0x2a')]},client9002)[_0xcc44('0x23')](function(){return _0x275a1d;});}return _0x275a1d;}return null;})[_0xcc44('0x23')](respondWithResult(_0x46e3df,null))[_0xcc44('0x57')](handleError(_0x46e3df,null));};var interaction_log=require(_0xcc44('0x17'))(_0xcc44('0x5c'));exports[_0xcc44('0x36')]=function(_0x49ed39,_0x50bb2d,_0x5043db){var _0x47c4c9={'agent':{},'channel':_0xcc44('0x5e')};if(_0x49ed39[_0xcc44('0x59')]['id']){delete _0x49ed39[_0xcc44('0x59')]['id'];}_0x49ed39[_0xcc44('0x59')][_0xcc44('0x62')]=_0x49ed39[_0xcc44('0x59')]['UserId']||_0x49ed39[_0xcc44('0x6c')]['id'];_0x47c4c9['agent']['id']=_0x49ed39[_0xcc44('0x59')][_0xcc44('0x62')];return db[_0xcc44('0x3c')][_0xcc44('0x56')]({'where':{'id':_0x49ed39[_0xcc44('0x5a')]['id'],'UserId':null}})[_0xcc44('0x23')](handleEntityNotFound(_0x50bb2d,null))[_0xcc44('0x23')](function(_0x386a04){if(_0x386a04){_0x47c4c9[_0xcc44('0x2a')]=_0x386a04[_0xcc44('0x64')]({'plain':!![]});return db[_0xcc44('0x65')][_0xcc44('0x56')]({'where':{'id':_0x386a04[_0xcc44('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x50bb2d,null))[_0xcc44('0x23')](function(_0x3850be){if(_0x3850be){_0x47c4c9[_0xcc44('0x6b')]=_0x3850be[_0xcc44('0x64')]({'plain':!![]});interaction_log[_0xcc44('0x24')](_0xcc44('0x81'),_0x49ed39[_0xcc44('0x6c')]['id'],_0x49ed39['user'][_0xcc44('0x3a')],_0x49ed39['user'][_0xcc44('0x6d')],_0x47c4c9[_0xcc44('0x6b')]['id'],_0x49ed39[_0xcc44('0x59')]?JSON[_0xcc44('0x27')](_0x49ed39['body']):_0xcc44('0x6e'));return respondWithRpcPromise(_0xcc44('0x82'),_0xcc44('0x83'),_0x47c4c9);}return null;})['then'](function(_0x3cdba6){var _0xb9f28a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3cdba6[_0xcc44('0x2a')][_0xcc44('0x84')];return db[_0xcc44('0x72')][_0xcc44('0x42')](_0xb9f28a,{'type':db['Sequelize'][_0xcc44('0x74')][_0xcc44('0x75')],'raw':!![]})['then'](function(_0x2d8e6d){return _0x2d8e6d;});})[_0xcc44('0x23')](function(_0x24c3ba){if(_0x24c3ba){_0x47c4c9['message'][_0xcc44('0x76')]=_0x24c3ba[0x0];if(!_0x49ed39[_0xcc44('0x59')][_0xcc44('0x62')])return;return db[_0xcc44('0x77')][_0xcc44('0x56')]({'where':{'id':_0x49ed39[_0xcc44('0x59')][_0xcc44('0x62')],'role':_0xcc44('0x63')},'attributes':['id',_0xcc44('0x3a'),_0xcc44('0x78'),_0xcc44('0x79'),_0xcc44('0x85')],'raw':!![]});}return null;})[_0xcc44('0x23')](function(_0x2428c7){if(!_0x2428c7)return null;_0x47c4c9[_0xcc44('0x2a')][_0xcc44('0x63')]=_0x2428c7;return _0x47c4c9;})[_0xcc44('0x23')](function(_0x116f2a){if(_0x116f2a){_0x116f2a[_0xcc44('0x2a')][_0xcc44('0x7b')]=util['format'](_0xcc44('0x7c'),_0x49ed39[_0xcc44('0x6c')][_0xcc44('0x3a')]);_0x116f2a['message'][_0xcc44('0x7d')]=_0x47c4c9[_0xcc44('0x7d')];_0x116f2a[_0xcc44('0x2a')][_0xcc44('0x86')]=_0x47c4c9[_0xcc44('0x7d')];_0x116f2a['message']['event']=_0xcc44('0x36');respondWithRpcPromise('EventManager',_0xcc44('0x7f'),{'event':_0xcc44('0x87'),'message':_0x116f2a[_0xcc44('0x2a')]},client9002);return _0x47c4c9;}return null;})['then'](respondWithResult(_0x50bb2d,null))[_0xcc44('0x57')](handleError(_0x50bb2d,null));};
\ No newline at end of file
index 09e9b5c..a81aa0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x899b=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x4e0690,_0x25e881){var _0x57ea23=function(_0x384e33){while(--_0x384e33){_0x4e0690['push'](_0x4e0690['shift']());}};_0x57ea23(++_0x25e881);}(_0x899b,0x141));var _0xb899=function(_0x3187d3,_0x1d432c){_0x3187d3=_0x3187d3-0x0;var _0x129ccf=_0x899b[_0x3187d3];return _0x129ccf;};'use strict';var EventEmitter=require(_0xb899('0x0'));var OpenchannelMessage=require(_0xb899('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xb899('0x2')](0x0);var events={'afterCreate':_0xb899('0x3'),'afterUpdate':'update','afterDestroy':_0xb899('0x4')};function emitEvent(_0xa2fd10){return function(_0x2b6309,_0x5f9e5d,_0x4449ad){OpenchannelMessageEvents[_0xb899('0x5')](_0xa2fd10+':'+_0x2b6309['id'],_0x2b6309);OpenchannelMessageEvents[_0xb899('0x5')](_0xa2fd10,_0x2b6309);_0x4449ad(null);};}for(var e in events){if(events[_0xb899('0x6')](e)){var event=events[e];OpenchannelMessage[_0xb899('0x7')](e,emitEvent(event));}}module[_0xb899('0x8')]=OpenchannelMessageEvents;
\ No newline at end of file
+var _0x7b5b=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','OpenchannelMessage'];(function(_0x215659,_0x44d4f5){var _0x29e732=function(_0x5e2905){while(--_0x5e2905){_0x215659['push'](_0x215659['shift']());}};_0x29e732(++_0x44d4f5);}(_0x7b5b,0x165));var _0xb7b5=function(_0x1f9029,_0x599e51){_0x1f9029=_0x1f9029-0x0;var _0x17d1f7=_0x7b5b[_0x1f9029];return _0x17d1f7;};'use strict';var EventEmitter=require(_0xb7b5('0x0'));var OpenchannelMessage=require(_0xb7b5('0x1'))['db'][_0xb7b5('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb7b5('0x3'),'afterUpdate':'update','afterDestroy':_0xb7b5('0x4')};function emitEvent(_0xddce6a){return function(_0xd4707f,_0x1522af,_0x125296){OpenchannelMessageEvents[_0xb7b5('0x5')](_0xddce6a+':'+_0xd4707f['id'],_0xd4707f);OpenchannelMessageEvents[_0xb7b5('0x5')](_0xddce6a,_0xd4707f);_0x125296(null);};}for(var e in events){if(events[_0xb7b5('0x6')](e)){var event=events[e];OpenchannelMessage[_0xb7b5('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents;
\ No newline at end of file
index 3caf350..8401492 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb03e=['info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','method','GET','threadId','inspect','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','get','replyUri'];(function(_0x222550,_0x3c0a0c){var _0x58ac61=function(_0x4f7201){while(--_0x4f7201){_0x222550['push'](_0x222550['shift']());}};_0x58ac61(++_0x3c0a0c);}(_0xb03e,0x1eb));var _0xeb03=function(_0x569c85,_0x57e22c){_0x569c85=_0x569c85-0x0;var _0x2de35e=_0xb03e[_0x569c85];return _0x2de35e;};'use strict';var _=require('lodash');var util=require(_0xeb03('0x0'));var logger=require(_0xeb03('0x1'))(_0xeb03('0x2'));var moment=require(_0xeb03('0x3'));var BPromise=require(_0xeb03('0x4'));var rp=require(_0xeb03('0x5'));var fs=require('fs');var path=require(_0xeb03('0x6'));var rimraf=require(_0xeb03('0x7'));var config=require(_0xeb03('0x8'));var attributes=require(_0xeb03('0x9'));module[_0xeb03('0xa')]=function(_0xee2291,_0x4e1cea){return _0xee2291[_0xeb03('0xb')](_0xeb03('0xc'),attributes,{'tableName':_0xeb03('0xd'),'paranoid':![],'indexes':[{'name':_0xeb03('0xe'),'fields':[_0xeb03('0xf')],'type':_0xeb03('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5a8491,_0x403b77,_0x99f4e2){var _0x14cfa0=_0xee2291['models'];var _0x31af2c=_0x5a8491['get']({'plain':!![]});if(_0x31af2c[_0xeb03('0x11')][_0xeb03('0x12')]()==='in'||_0x31af2c[_0xeb03('0x11')][_0xeb03('0x12')]()===_0xeb03('0x13')&&!_0x31af2c[_0xeb03('0x14')]&&!_[_0xeb03('0x15')](_0x31af2c[_0xeb03('0x16')])){_0x14cfa0[_0xeb03('0x17')][_0xeb03('0x18')]({'where':{'id':_0x31af2c[_0xeb03('0x19')]}})[_0xeb03('0x1a')](function(_0x4d9c8e){if(_0x4d9c8e){_0x4d9c8e[_0xeb03('0x1b')]({'lastMsgAt':_0x31af2c[_0xeb03('0x1c')],'lastMsgDirection':_0x31af2c[_0xeb03('0x11')][_0xeb03('0x12')]()});}})['catch'](function(_0x15f4fe){console[_0xeb03('0x1d')](_0x15f4fe);});}if(_0x31af2c[_0xeb03('0x11')]==='out'&&!_0x31af2c[_0xeb03('0x14')]){var _0x46dd1b;_0x14cfa0[_0xeb03('0x1e')][_0xeb03('0x1f')]()[_0xeb03('0x1a')](function(_0x1b4cbd){return _0x14cfa0[_0xeb03('0x20')][_0xeb03('0x21')]({'where':{'id':_0x31af2c[_0xeb03('0x22')]},'include':[{'model':_0x14cfa0[_0xeb03('0x17')],'as':_0xeb03('0x23'),'where':{'id':_0x31af2c[_0xeb03('0x19')]},'limit':0x1,'include':[{'model':_0x14cfa0[_0xeb03('0x1e')],'as':_0xeb03('0x24'),'attributes':_['keys'](_0x1b4cbd)}]}]});})[_0xeb03('0x1a')](function(_0x3855dd){_0x46dd1b=_0x3855dd[_0xeb03('0x25')]({'plain':!![]});if(_0x46dd1b&&_0x46dd1b[_0xeb03('0x26')]){logger[_0xeb03('0x27')](_0xeb03('0x28'),_0xeb03('0x29'),util[_0xeb03('0x2a')](_0xeb03('0x2b'),_0x31af2c['id'],_0x46dd1b['replyUri']));if(_0x46dd1b[_0xeb03('0x23')]&&_0x46dd1b[_0xeb03('0x23')][_0xeb03('0x2c')]){_0x31af2c[_0xeb03('0x2d')]=_[_0xeb03('0x2e')](_0x46dd1b['Interactions'][0x0],_0xeb03('0x24'));_0x31af2c[_0xeb03('0x24')]=_0x46dd1b[_0xeb03('0x23')][0x0][_0xeb03('0x24')];}var _0x403b77={'method':_0xeb03('0x2f'),'uri':encodeURI(_0x46dd1b[_0xeb03('0x26')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x403b77[_0xeb03('0x30')]){case _0xeb03('0x31'):_0x403b77['qs']=_0x31af2c;break;case'POST':_0x403b77[_0xeb03('0xf')]=_0x31af2c;break;}return rp(_0x403b77)[_0xeb03('0x1a')](function(_0x2683f9){logger[_0xeb03('0x27')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0xeb03('0x2a')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x31af2c['id'],_0x46dd1b[_0xeb03('0x26')]));if(_0x2683f9[_0xeb03('0xf')][_0xeb03('0x32')]&&_0x2683f9['body'][_0xeb03('0x32')]!=_0x31af2c['Interaction']['threadId']){return _0x14cfa0['OpenchannelInteraction']['update']({'threadId':_0x2683f9[_0xeb03('0xf')][_0xeb03('0x32')]},{'logging':!![],'where':{'id':_0x31af2c['Interaction']['id']}});}else{return;}})['then'](function(){return _0x5a8491['update']({'read':!![]});})['catch'](function(_0x1e8009){logger[_0xeb03('0x1d')](_0xeb03('0x28'),_0xeb03('0x29'),util[_0xeb03('0x33')](_0x1e8009,{'showHidden':![],'depth':null}));_0x99f4e2();});}else{_0x99f4e2();}})['finally'](function(){_0x99f4e2();});}else{_0x99f4e2();}}},'charset':_0xeb03('0x34'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x6cb4=['define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','direction','toLowerCase','secret','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','get','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelMessage.attributes'];(function(_0x35f7db,_0x54269f){var _0x3a1b53=function(_0x459513){while(--_0x459513){_0x35f7db['push'](_0x35f7db['shift']());}};_0x3a1b53(++_0x54269f);}(_0x6cb4,0xff));var _0x46cb=function(_0x57ffd3,_0x5b19f8){_0x57ffd3=_0x57ffd3-0x0;var _0x534d1e=_0x6cb4[_0x57ffd3];return _0x534d1e;};'use strict';var _=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var logger=require(_0x46cb('0x2'))(_0x46cb('0x3'));var moment=require(_0x46cb('0x4'));var BPromise=require(_0x46cb('0x5'));var rp=require(_0x46cb('0x6'));var fs=require('fs');var path=require(_0x46cb('0x7'));var rimraf=require(_0x46cb('0x8'));var config=require('../../config/environment');var attributes=require(_0x46cb('0x9'));module['exports']=function(_0x3d9d3c,_0x4d9f1d){return _0x3d9d3c[_0x46cb('0xa')](_0x46cb('0xb'),attributes,{'tableName':_0x46cb('0xc'),'paranoid':![],'indexes':[{'name':_0x46cb('0xd'),'fields':[_0x46cb('0xe')],'type':_0x46cb('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x56258a,_0x3d7663,_0x34f9e9){var _0x48101c=_0x3d9d3c[_0x46cb('0x10')];var _0x106a87=_0x56258a['get']({'plain':!![]});if(_0x106a87[_0x46cb('0x11')][_0x46cb('0x12')]()==='in'||_0x106a87['direction']['toLowerCase']()==='out'&&!_0x106a87[_0x46cb('0x13')]&&!_[_0x46cb('0x14')](_0x106a87[_0x46cb('0x15')])){_0x48101c[_0x46cb('0x16')]['findOne']({'where':{'id':_0x106a87[_0x46cb('0x17')]}})[_0x46cb('0x18')](function(_0x2a1f9d){if(_0x2a1f9d){_0x2a1f9d[_0x46cb('0x19')]({'lastMsgAt':_0x106a87[_0x46cb('0x1a')],'lastMsgDirection':_0x106a87[_0x46cb('0x11')][_0x46cb('0x12')]()});}})[_0x46cb('0x1b')](function(_0x37d368){console[_0x46cb('0x1c')](_0x37d368);});}if(_0x106a87[_0x46cb('0x11')]==='out'&&!_0x106a87[_0x46cb('0x13')]){var _0x5796d2;_0x48101c[_0x46cb('0x1d')]['describe']()['then'](function(_0x4e3454){return _0x48101c[_0x46cb('0x1e')][_0x46cb('0x1f')]({'where':{'id':_0x106a87[_0x46cb('0x20')]},'include':[{'model':_0x48101c[_0x46cb('0x16')],'as':_0x46cb('0x21'),'where':{'id':_0x106a87[_0x46cb('0x17')]},'limit':0x1,'include':[{'model':_0x48101c[_0x46cb('0x1d')],'as':_0x46cb('0x22'),'attributes':_[_0x46cb('0x23')](_0x4e3454)}]}]});})[_0x46cb('0x18')](function(_0x149483){_0x5796d2=_0x149483[_0x46cb('0x24')]({'plain':!![]});if(_0x5796d2&&_0x5796d2[_0x46cb('0x25')]){logger[_0x46cb('0x26')](_0x46cb('0x27'),_0x46cb('0x28'),util[_0x46cb('0x29')](_0x46cb('0x2a'),_0x106a87['id'],_0x5796d2[_0x46cb('0x25')]));if(_0x5796d2[_0x46cb('0x21')]&&_0x5796d2[_0x46cb('0x21')][_0x46cb('0x2b')]){_0x106a87[_0x46cb('0x2c')]=_[_0x46cb('0x2d')](_0x5796d2[_0x46cb('0x21')][0x0],'Contact');_0x106a87['Contact']=_0x5796d2[_0x46cb('0x21')][0x0][_0x46cb('0x22')];}var _0x3d7663={'method':_0x46cb('0x2e'),'uri':encodeURI(_0x5796d2[_0x46cb('0x25')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3d7663['method']){case _0x46cb('0x2f'):_0x3d7663['qs']=_0x106a87;break;case'POST':_0x3d7663['body']=_0x106a87;break;}return rp(_0x3d7663)['then'](function(_0x180ce1){logger[_0x46cb('0x26')](_0x46cb('0x27'),_0x46cb('0x28'),util[_0x46cb('0x29')](_0x46cb('0x30'),_0x106a87['id'],_0x5796d2[_0x46cb('0x25')]));if(_0x180ce1[_0x46cb('0xe')][_0x46cb('0x31')]&&_0x180ce1[_0x46cb('0xe')][_0x46cb('0x31')]!=_0x106a87['Interaction'][_0x46cb('0x31')]){return _0x48101c[_0x46cb('0x16')]['update']({'threadId':_0x180ce1['body'][_0x46cb('0x31')]},{'logging':!![],'where':{'id':_0x106a87['Interaction']['id']}});}else{return;}})[_0x46cb('0x18')](function(){return _0x56258a[_0x46cb('0x19')]({'read':!![]});})[_0x46cb('0x1b')](function(_0xd96713){logger[_0x46cb('0x1c')](_0x46cb('0x27'),'afterCreate',util[_0x46cb('0x32')](_0xd96713,{'showHidden':![],'depth':null}));_0x34f9e9();});}else{_0x34f9e9();}})['finally'](function(){_0x34f9e9();});}else{_0x34f9e9();}}},'charset':_0x46cb('0x33'),'collate':_0x46cb('0x34')});};
\ No newline at end of file
index 8ca7c00..121ebcf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b0e=['message','result','OpenchannelMessage','create','body','options','CreateOpenchannelMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s'];(function(_0xd2a244,_0x52b368){var _0x5c0cc9=function(_0x4ad0bb){while(--_0x4ad0bb){_0xd2a244['push'](_0xd2a244['shift']());}};_0x5c0cc9(++_0x52b368);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5ae8f7,_0x330d91){_0x5ae8f7=_0x5ae8f7-0x0;var _0x54c636=_0x0b0e[_0x5ae8f7];return _0x54c636;};'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});config[_0xe0b0('0xc')]=_['defaults'](config['redis'],{'host':_0xe0b0('0xd'),'port':0x18eb});var socket=require(_0xe0b0('0xe'))(new Redis(config[_0xe0b0('0xc')]));require(_0xe0b0('0xf'))['register'](socket);function respondWithRpcPromise(_0x338e7c,_0x1dd3b8,_0x553d4f){return new BPromise(function(_0x1fef28,_0x2f32b6){return client['request'](_0x338e7c,_0x553d4f)[_0xe0b0('0x10')](function(_0x2cdad2){logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0xe0b0('0x12'));logger[_0xe0b0('0x13')](_0xe0b0('0x14'),_0x1dd3b8,_0xe0b0('0x12'),JSON[_0xe0b0('0x15')](_0x2cdad2));if(_0x2cdad2['error']){if(_0x2cdad2[_0xe0b0('0x16')][_0xe0b0('0x17')]===0x1f4){logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2[_0xe0b0('0x16')]['message']);return _0x2f32b6(_0x2cdad2[_0xe0b0('0x16')]['message']);}logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2['error'][_0xe0b0('0x19')]);return _0x1fef28(_0x2cdad2['error'][_0xe0b0('0x19')]);}else{logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,'request\x20sent');_0x1fef28(_0x2cdad2[_0xe0b0('0x1a')]['message']);}})['catch'](function(_0x4bce65){logger[_0xe0b0('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0x4bce65);_0x2f32b6(_0x4bce65);});});}exports['CreateOpenchannelMessage']=function(_0x10cde1){var _0x59dff5=this;return new Promise(function(_0x472286,_0x5dba2f){return db[_0xe0b0('0x1b')][_0xe0b0('0x1c')](_0x10cde1[_0xe0b0('0x1d')],{'raw':_0x10cde1[_0xe0b0('0x1e')]?_0x10cde1[_0xe0b0('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2fa820){logger['info'](_0xe0b0('0x1f'),_0x10cde1);logger[_0xe0b0('0x13')]('CreateOpenchannelMessage',_0x10cde1,JSON[_0xe0b0('0x15')](_0x2fa820));_0x472286(_0x2fa820);})['catch'](function(_0x2208d0){logger['error'](_0xe0b0('0x1f'),_0x2208d0['message'],_0x10cde1);_0x5dba2f(_0x59dff5[_0xe0b0('0x16')](0x1f4,_0x2208d0['message']));});});};
\ No newline at end of file
+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(_0x13df51,_0x5c63a7){var _0x27c283=function(_0x176f26){while(--_0x176f26){_0x13df51['push'](_0x13df51['shift']());}};_0x27c283(++_0x5c63a7);}(_0x1261,0x144));var _0x1126=function(_0x1d29f6,_0x45f6a0){_0x1d29f6=_0x1d29f6-0x0;var _0x491093=_0x1261[_0x1d29f6];return _0x491093;};'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
index 842a04d..bfa8078 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda2d=['remove','removeListener','register','length','save'];(function(_0x1bb889,_0x49c4b5){var _0xd8b76d=function(_0x1df471){while(--_0x1df471){_0x1bb889['push'](_0x1bb889['shift']());}};_0xd8b76d(++_0x49c4b5);}(_0xda2d,0xb3));var _0xdda2=function(_0x4cfbe4,_0x3e34e5){_0x4cfbe4=_0x4cfbe4-0x0;var _0x274b21=_0xda2d[_0x4cfbe4];return _0x274b21;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xdda2('0x0'),_0xdda2('0x1'),'update'];function createListener(_0x8c57ab,_0x5d4e03){return function(_0x3a3d37){_0x5d4e03['emit'](_0x8c57ab,_0x3a3d37);};}function removeListener(_0x6f07af,_0x30f5e0){return function(){OpenchannelMessageEvents[_0xdda2('0x2')](_0x6f07af,_0x30f5e0);};}exports[_0xdda2('0x3')]=function(_0x3205a7){for(var _0x4e69a0=0x0,_0x225f04=events[_0xdda2('0x4')];_0x4e69a0<_0x225f04;_0x4e69a0++){var _0x39918f=events[_0x4e69a0];var _0x2cb089=createListener('openchannelMessage:'+_0x39918f,_0x3205a7);OpenchannelMessageEvents['on'](_0x39918f,_0x2cb089);}};
\ No newline at end of file
+var _0x1052=['save','remove','update','emit','register','openchannelMessage:','./openchannelMessage.events'];(function(_0x36b037,_0x2b234e){var _0x409194=function(_0xddc9dc){while(--_0xddc9dc){_0x36b037['push'](_0x36b037['shift']());}};_0x409194(++_0x2b234e);}(_0x1052,0xf4));var _0x2105=function(_0xdac383,_0x505d99){_0xdac383=_0xdac383-0x0;var _0x3e783d=_0x1052[_0xdac383];return _0x3e783d;};'use strict';var OpenchannelMessageEvents=require(_0x2105('0x0'));var events=[_0x2105('0x1'),_0x2105('0x2'),_0x2105('0x3')];function createListener(_0x1644e8,_0x7d7b47){return function(_0x265e12){_0x7d7b47[_0x2105('0x4')](_0x1644e8,_0x265e12);};}function removeListener(_0x1e106c,_0x5c1e84){return function(){OpenchannelMessageEvents['removeListener'](_0x1e106c,_0x5c1e84);};}exports[_0x2105('0x5')]=function(_0x4a4e6b){for(var _0x126cd9=0x0,_0x9b262=events['length'];_0x126cd9<_0x9b262;_0x126cd9++){var _0x1e6ad5=events[_0x126cd9];var _0x20d2b4=createListener(_0x2105('0x6')+_0x1e6ad5,_0x4a4e6b);OpenchannelMessageEvents['on'](_0x1e6ad5,_0x20d2b4);}};
\ No newline at end of file
index 805be6c..35fa3d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d95=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','show','getMembers','getTeams','getAgents','create','post','/:id/teams','addTeams','/:id/users','addAgents','update','delete','destroy','exports','multer','connect-timeout','express'];(function(_0x439d59,_0x11ccdf){var _0x3670c7=function(_0x11cfcb){while(--_0x11cfcb){_0x439d59['push'](_0x439d59['shift']());}};_0x3670c7(++_0x11ccdf);}(_0x5d95,0x1d1));var _0x55d9=function(_0xcaecd9,_0x5d8a1c){_0xcaecd9=_0xcaecd9-0x0;var _0x246753=_0x5d95[_0xcaecd9];return _0x246753;};'use strict';var multer=require(_0x55d9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x55d9('0x1'));var express=require(_0x55d9('0x2'));var router=express[_0x55d9('0x3')]();var fs_extra=require(_0x55d9('0x4'));var auth=require(_0x55d9('0x5'));var interaction=require(_0x55d9('0x6'));var config=require('../../config/environment');var controller=require('./openchannelQueue.controller');router[_0x55d9('0x7')]('/',auth[_0x55d9('0x8')](),controller[_0x55d9('0x9')]);router[_0x55d9('0x7')](_0x55d9('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x55d9('0x7')](_0x55d9('0xb'),auth[_0x55d9('0x8')](),controller[_0x55d9('0xc')]);router[_0x55d9('0x7')]('/:id/members',auth[_0x55d9('0x8')](),controller[_0x55d9('0xd')]);router[_0x55d9('0x7')]('/:id/teams',auth[_0x55d9('0x8')](),controller[_0x55d9('0xe')]);router[_0x55d9('0x7')]('/:id/users',auth[_0x55d9('0x8')](),controller[_0x55d9('0xf')]);router['post']('/',auth[_0x55d9('0x8')](),controller[_0x55d9('0x10')]);router[_0x55d9('0x11')](_0x55d9('0x12'),auth['isAuthenticated'](),controller[_0x55d9('0x13')]);router[_0x55d9('0x11')](_0x55d9('0x14'),auth[_0x55d9('0x8')](),controller[_0x55d9('0x15')]);router['put']('/:id',auth[_0x55d9('0x8')](),controller[_0x55d9('0x16')]);router[_0x55d9('0x17')](_0x55d9('0xb'),auth['isAuthenticated'](),controller[_0x55d9('0x18')]);router[_0x55d9('0x17')](_0x55d9('0x12'),auth[_0x55d9('0x8')](),controller['removeTeams']);router[_0x55d9('0x17')]('/:id/users',auth[_0x55d9('0x8')](),controller['removeAgents']);module[_0x55d9('0x19')]=router;
\ No newline at end of file
+var _0x3b59=['getAgents','post','create','/:id/teams','addTeams','/:id/users','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','/describe','/:id','getMembers','getTeams'];(function(_0x2e2032,_0x2a2de4){var _0x157128=function(_0x57ecf2){while(--_0x57ecf2){_0x2e2032['push'](_0x2e2032['shift']());}};_0x157128(++_0x2a2de4);}(_0x3b59,0x1d8));var _0x93b5=function(_0x636f04,_0x49360a){_0x636f04=_0x636f04-0x0;var _0x1c6cae=_0x3b59[_0x636f04];return _0x1c6cae;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x93b5('0x0'));var express=require(_0x93b5('0x1'));var router=express[_0x93b5('0x2')]();var fs_extra=require(_0x93b5('0x3'));var auth=require(_0x93b5('0x4'));var interaction=require(_0x93b5('0x5'));var config=require(_0x93b5('0x6'));var controller=require(_0x93b5('0x7'));router[_0x93b5('0x8')]('/',auth[_0x93b5('0x9')](),controller['index']);router[_0x93b5('0x8')](_0x93b5('0xa'),auth[_0x93b5('0x9')](),controller['describe']);router['get'](_0x93b5('0xb'),auth[_0x93b5('0x9')](),controller['show']);router[_0x93b5('0x8')]('/:id/members',auth[_0x93b5('0x9')](),controller[_0x93b5('0xc')]);router[_0x93b5('0x8')]('/:id/teams',auth[_0x93b5('0x9')](),controller[_0x93b5('0xd')]);router[_0x93b5('0x8')]('/:id/users',auth[_0x93b5('0x9')](),controller[_0x93b5('0xe')]);router[_0x93b5('0xf')]('/',auth[_0x93b5('0x9')](),controller[_0x93b5('0x10')]);router[_0x93b5('0xf')](_0x93b5('0x11'),auth[_0x93b5('0x9')](),controller[_0x93b5('0x12')]);router['post'](_0x93b5('0x13'),auth[_0x93b5('0x9')](),controller[_0x93b5('0x14')]);router[_0x93b5('0x15')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x93b5('0x16')]('/:id',auth[_0x93b5('0x9')](),controller[_0x93b5('0x17')]);router['delete'](_0x93b5('0x11'),auth[_0x93b5('0x9')](),controller[_0x93b5('0x18')]);router[_0x93b5('0x16')](_0x93b5('0x13'),auth[_0x93b5('0x9')](),controller[_0x93b5('0x19')]);module[_0x93b5('0x1a')]=router;
\ No newline at end of file
index b2a54a1..a6509fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8506=['ENUM','rrmemory','beepall','roundrobin','exports','STRING','name','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8506,0x144));var _0x6850=function(_0x785fe1,_0x5b7dc9){_0x785fe1=_0x785fe1-0x0;var _0x190493=_0x8506[_0x785fe1];return _0x190493;};'use strict';var Sequelize=require('sequelize');module[_0x6850('0x0')]={'name':{'type':Sequelize[_0x6850('0x1')],'unique':_0x6850('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6850('0x1')]},'timeout':{'type':Sequelize[_0x6850('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6850('0x4')](_0x6850('0x5'),_0x6850('0x6'),_0x6850('0x7'))}};
\ No newline at end of file
+var _0x9e18=['ENUM','beepall','sequelize','exports','name','STRING','INTEGER'];(function(_0x20fdc1,_0xde1296){var _0x25397c=function(_0x814b51){while(--_0x814b51){_0x20fdc1['push'](_0x20fdc1['shift']());}};_0x25397c(++_0xde1296);}(_0x9e18,0xb1));var _0x89e1=function(_0x54e856,_0x313d5c){_0x54e856=_0x54e856-0x0;var _0x124873=_0x9e18[_0x54e856];return _0x124873;};'use strict';var Sequelize=require(_0x89e1('0x0'));module[_0x89e1('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x89e1('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x89e1('0x3')]},'timeout':{'type':Sequelize[_0x89e1('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x89e1('0x5')]('rrmemory',_0x89e1('0x6'),'roundrobin')}};
\ No newline at end of file
index a029768..d4e7ca0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x519e=['openchannelPause','updatedAt','%s/%s','SIP','createdAt','getTeams','Team','ids','Agents','online','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','includes','all','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','get','error','stack','name','map','OpenchannelQueue','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','body','destroy','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','User','UserId','agent'];(function(_0x12a346,_0x16f45b){var _0xea5f0a=function(_0x4e3b1d){while(--_0x4e3b1d){_0x12a346['push'](_0x12a346['shift']());}};_0xea5f0a(++_0x16f45b);}(_0x519e,0xac));var _0xe519=function(_0x5279f6,_0x4e84cb){_0x5279f6=_0x5279f6-0x0;var _0x13e44a=_0x519e[_0x5279f6];return _0x13e44a;};'use strict';var emlformat=require(_0xe519('0x0'));var rimraf=require(_0xe519('0x1'));var zipdir=require(_0xe519('0x2'));var jsonpatch=require(_0xe519('0x3'));var rp=require(_0xe519('0x4'));var moment=require(_0xe519('0x5'));var BPromise=require(_0xe519('0x6'));var Mustache=require(_0xe519('0x7'));var util=require(_0xe519('0x8'));var path=require(_0xe519('0x9'));var sox=require(_0xe519('0xa'));var csv=require(_0xe519('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe519('0xc'));var squel=require(_0xe519('0xd'));var crypto=require(_0xe519('0xe'));var jsforce=require(_0xe519('0xf'));var deskjs=require(_0xe519('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe519('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe519('0x12'));var hardwareService=require(_0xe519('0x13'));var logger=require('../../config/logger')(_0xe519('0x14'));var utils=require(_0xe519('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe519('0x16'));var db=require(_0xe519('0x17'))['db'];config[_0xe519('0x18')]=_[_0xe519('0x19')](config[_0xe519('0x18')],{'host':_0xe519('0x1a'),'port':0x18eb});var socket=require(_0xe519('0x1b'))(new Redis(config[_0xe519('0x18')]));require(_0xe519('0x1c'))[_0xe519('0x1d')](socket);function respondWithStatusCode(_0x1d8f49,_0x21fe9a){_0x21fe9a=_0x21fe9a||0xcc;return function(_0x403afb){if(_0x403afb){return _0x1d8f49[_0xe519('0x1e')](_0x21fe9a);}return _0x1d8f49[_0xe519('0x1f')](_0x21fe9a)[_0xe519('0x20')]();};}function respondWithResult(_0x14d25a,_0x527d41){_0x527d41=_0x527d41||0xc8;return function(_0x1dccc6){if(_0x1dccc6){return _0x14d25a['status'](_0x527d41)[_0xe519('0x21')](_0x1dccc6);}};}function respondWithFilteredResult(_0x5e4c48,_0x2ff214){return function(_0x30ba6a){if(_0x30ba6a){var _0x5a7af7=typeof _0x2ff214[_0xe519('0x22')]===_0xe519('0x23')&&typeof _0x2ff214[_0xe519('0x24')]===_0xe519('0x23');var _0x6235a7=_0x30ba6a[_0xe519('0x25')];var _0x4447fa=_0x5a7af7?0x0:_0x2ff214[_0xe519('0x22')];var _0x27e56e=_0x5a7af7?_0x30ba6a[_0xe519('0x25')]:_0x2ff214['offset']+_0x2ff214[_0xe519('0x24')];var _0x49da15;if(_0x27e56e>=_0x6235a7){_0x27e56e=_0x6235a7;_0x49da15=0xc8;}else{_0x49da15=0xce;}_0x5e4c48['status'](_0x49da15);return _0x5e4c48[_0xe519('0x26')](_0xe519('0x27'),_0x4447fa+'-'+_0x27e56e+'/'+_0x6235a7)[_0xe519('0x21')](_0x30ba6a);}return null;};}function patchUpdates(_0x11a992){return function(_0x409d69){try{jsonpatch[_0xe519('0x28')](_0x409d69,_0x11a992,!![]);}catch(_0x4ef4f5){return BPromise[_0xe519('0x29')](_0x4ef4f5);}return _0x409d69['save']();};}function saveUpdates(_0x37988b,_0xe6aa26){return function(_0x94e6bf){if(_0x94e6bf){return _0x94e6bf[_0xe519('0x2a')](_0x37988b)['then'](function(_0x2cf91d){return _0x2cf91d;});}return null;};}function removeEntity(_0x29832b,_0x52e138){return function(_0x44f781){if(_0x44f781){return _0x44f781['destroy']()[_0xe519('0x2b')](function(){var _0x39fe77=_0x44f781[_0xe519('0x2c')]({'plain':!![]});var _0xbad205='OpenchannelQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0xbad205,'resourceId':_0x39fe77['id']}})[_0xe519('0x2b')](function(){return _0x44f781;});})[_0xe519('0x2b')](function(){_0x29832b[_0xe519('0x1f')](0xcc)[_0xe519('0x20')]();});}};}function handleEntityNotFound(_0x25f4c9,_0xdaf49c){return function(_0x348ef3){if(!_0x348ef3){_0x25f4c9[_0xe519('0x1e')](0x194);}return _0x348ef3;};}function handleError(_0x10778a,_0x239341){_0x239341=_0x239341||0x1f4;return function(_0x48896f){logger[_0xe519('0x2d')](_0x48896f[_0xe519('0x2e')]);if(_0x48896f[_0xe519('0x2f')]){delete _0x48896f['name'];}_0x10778a[_0xe519('0x1f')](_0x239341)['send'](_0x48896f);};}exports['index']=function(_0x47f827,_0x32b0c3){var _0xe255ff={},_0x59dd27={},_0x3c37ed={'count':0x0,'rows':[]};var _0x2dd612=_[_0xe519('0x30')](db[_0xe519('0x31')][_0xe519('0x32')],function(_0x45a119){return{'name':_0x45a119['fieldName'],'type':_0x45a119[_0xe519('0x33')][_0xe519('0x34')]};});_0x59dd27[_0xe519('0x35')]=_[_0xe519('0x30')](_0x2dd612,_0xe519('0x2f'));_0x59dd27[_0xe519('0x36')]=_[_0xe519('0x37')](_0x47f827[_0xe519('0x36')]);_0x59dd27[_0xe519('0x38')]=_['intersection'](_0x59dd27[_0xe519('0x35')],_0x59dd27['query']);_0xe255ff[_0xe519('0x39')]=_[_0xe519('0x3a')](_0x59dd27[_0xe519('0x35')],qs[_0xe519('0x3b')](_0x47f827[_0xe519('0x36')]['fields']));_0xe255ff[_0xe519('0x39')]=_0xe255ff[_0xe519('0x39')][_0xe519('0x3c')]?_0xe255ff[_0xe519('0x39')]:_0x59dd27[_0xe519('0x35')];if(!_0x47f827[_0xe519('0x36')][_0xe519('0x3d')](_0xe519('0x3e'))){_0xe255ff[_0xe519('0x24')]=qs[_0xe519('0x24')](_0x47f827['query'][_0xe519('0x24')]);_0xe255ff[_0xe519('0x22')]=qs[_0xe519('0x22')](_0x47f827[_0xe519('0x36')][_0xe519('0x22')]);}_0xe255ff[_0xe519('0x3f')]=qs[_0xe519('0x40')](_0x47f827[_0xe519('0x36')][_0xe519('0x40')]);_0xe255ff[_0xe519('0x41')]=qs[_0xe519('0x38')](_[_0xe519('0x42')](_0x47f827['query'],_0x59dd27['filters']),_0x2dd612);if(_0x47f827[_0xe519('0x36')][_0xe519('0x43')]){_0xe255ff[_0xe519('0x41')]=_[_0xe519('0x44')](_0xe255ff['where'],{'$or':_[_0xe519('0x30')](_0x2dd612,function(_0x85dc81){if(_0x85dc81[_0xe519('0x33')]!=='VIRTUAL'){var _0x41c803={};_0x41c803[_0x85dc81['name']]={'$like':'%'+_0x47f827[_0xe519('0x36')]['filter']+'%'};return _0x41c803;}})});}_0xe255ff=_[_0xe519('0x44')]({},_0xe255ff,_0x47f827[_0xe519('0x45')]);var _0x3221b1={'where':_0xe255ff[_0xe519('0x41')]};return db[_0xe519('0x31')][_0xe519('0x25')](_0x3221b1)[_0xe519('0x2b')](function(_0x134b80){_0x3c37ed[_0xe519('0x25')]=_0x134b80;if(_0x47f827[_0xe519('0x36')][_0xe519('0x46')]){_0xe255ff[_0xe519('0x47')]=[{'all':!![]}];}return db[_0xe519('0x31')][_0xe519('0x48')](_0xe255ff);})[_0xe519('0x2b')](function(_0x8455e0){_0x3c37ed[_0xe519('0x49')]=_0x8455e0;return _0x3c37ed;})[_0xe519('0x2b')](respondWithFilteredResult(_0x32b0c3,_0xe255ff))[_0xe519('0x4a')](handleError(_0x32b0c3,null));};exports[_0xe519('0x4b')]=function(_0x33fd63,_0x55b908){var _0x47222f={'raw':!![],'where':{'id':_0x33fd63[_0xe519('0x4c')]['id']}},_0xc9d6bd={};_0xc9d6bd[_0xe519('0x35')]=_[_0xe519('0x37')](db[_0xe519('0x31')][_0xe519('0x32')]);_0xc9d6bd[_0xe519('0x36')]=_[_0xe519('0x37')](_0x33fd63[_0xe519('0x36')]);_0xc9d6bd[_0xe519('0x38')]=_['intersection'](_0xc9d6bd[_0xe519('0x35')],_0xc9d6bd[_0xe519('0x36')]);_0x47222f[_0xe519('0x39')]=_[_0xe519('0x3a')](_0xc9d6bd['model'],qs['fields'](_0x33fd63[_0xe519('0x36')][_0xe519('0x3b')]));_0x47222f[_0xe519('0x39')]=_0x47222f['attributes'][_0xe519('0x3c')]?_0x47222f[_0xe519('0x39')]:_0xc9d6bd[_0xe519('0x35')];if(_0x33fd63[_0xe519('0x36')][_0xe519('0x46')]){_0x47222f['include']=[{'all':!![]}];}_0x47222f=_[_0xe519('0x44')]({},_0x47222f,_0x33fd63[_0xe519('0x45')]);return db[_0xe519('0x31')][_0xe519('0x4d')](_0x47222f)[_0xe519('0x2b')](handleEntityNotFound(_0x55b908,null))[_0xe519('0x2b')](respondWithResult(_0x55b908,null))['catch'](handleError(_0x55b908,null));};exports[_0xe519('0x4e')]=function(_0xda48db,_0x5d25fc){return db[_0xe519('0x31')][_0xe519('0x4e')](_0xda48db['body'],{})['then'](function(_0x2aae0f){var _0x214040=_0xda48db[_0xe519('0x4f')][_0xe519('0x2c')]({'plain':!![]});if(!_0x214040)throw new Error(_0xe519('0x50'));if(_0x214040[_0xe519('0x51')]===_0xe519('0x4f')){var _0xdb76ca=_0x2aae0f[_0xe519('0x2c')]({'plain':!![]});var _0x8fadc1='OpenchannelQueues';return db[_0xe519('0x52')][_0xe519('0x4d')]({'where':{'name':_0x8fadc1,'userProfileId':_0x214040[_0xe519('0x53')]},'raw':!![]})[_0xe519('0x2b')](function(_0x5bb297){if(_0x5bb297&&_0x5bb297['autoAssociation']===0x0){return db['UserProfileResource'][_0xe519('0x4e')]({'name':_0xdb76ca[_0xe519('0x2f')],'resourceId':_0xdb76ca['id'],'type':_0x5bb297[_0xe519('0x2f')],'sectionId':_0x5bb297['id']},{})[_0xe519('0x2b')](function(){return _0x2aae0f;});}else{return _0x2aae0f;}})[_0xe519('0x4a')](function(_0x5ca1aa){logger[_0xe519('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ca1aa);throw _0x5ca1aa;});}return _0x2aae0f;})[_0xe519('0x2b')](respondWithResult(_0x5d25fc,0xc9))['catch'](handleError(_0x5d25fc,null));};exports['update']=function(_0x5d9def,_0x4e042f){if(_0x5d9def[_0xe519('0x54')]['id']){delete _0x5d9def['body']['id'];}return db[_0xe519('0x31')]['find']({'where':{'id':_0x5d9def[_0xe519('0x4c')]['id']}})[_0xe519('0x2b')](handleEntityNotFound(_0x4e042f,null))[_0xe519('0x2b')](saveUpdates(_0x5d9def[_0xe519('0x54')],null))[_0xe519('0x2b')](respondWithResult(_0x4e042f,null))[_0xe519('0x4a')](handleError(_0x4e042f,null));};exports[_0xe519('0x55')]=function(_0x354b1,_0x217460){return db[_0xe519('0x31')][_0xe519('0x4d')]({'where':{'id':_0x354b1[_0xe519('0x4c')]['id']}})['then'](handleEntityNotFound(_0x217460,null))[_0xe519('0x2b')](removeEntity(_0x217460,null))[_0xe519('0x4a')](handleError(_0x217460,null));};exports[_0xe519('0x56')]=function(_0x3bfedf,_0xfadb4e){return db[_0xe519('0x31')][_0xe519('0x56')]()[_0xe519('0x2b')](respondWithResult(_0xfadb4e,null))['catch'](handleError(_0xfadb4e,null));};exports[_0xe519('0x57')]=function(_0x4be537,_0x4fc909,_0x5cc152){var _0x108925={'raw':!![],'where':{}},_0x3abdeb={},_0x3a242c;return db[_0xe519('0x31')][_0xe519('0x58')]({'where':{'id':_0x4be537['params']['id']}})[_0xe519('0x2b')](handleEntityNotFound(_0x4fc909,null))[_0xe519('0x2b')](function(_0x2a3130){if(_0x2a3130){_0x3a242c=_0x2a3130[_0xe519('0x2c')]({'plain':!![]});_0x3abdeb[_0xe519('0x35')]=_[_0xe519('0x37')](db[_0xe519('0x59')][_0xe519('0x32')]);_0x3abdeb['query']=_['keys'](_0x4be537['query']);_0x3abdeb['filters']=_['intersection'](_0x3abdeb[_0xe519('0x35')],_0x3abdeb['query']);_0x108925[_0xe519('0x39')]=_[_0xe519('0x3a')](_0x3abdeb[_0xe519('0x35')],qs[_0xe519('0x3b')](_0x4be537[_0xe519('0x36')][_0xe519('0x3b')]));_0x108925[_0xe519('0x39')]=_0x108925['attributes'][_0xe519('0x3c')]?_0x108925[_0xe519('0x39')]:_0x3abdeb[_0xe519('0x35')];if(!_0x4be537[_0xe519('0x36')][_0xe519('0x3d')](_0xe519('0x3e'))){_0x108925[_0xe519('0x24')]=qs[_0xe519('0x24')](_0x4be537[_0xe519('0x36')]['limit']);_0x108925[_0xe519('0x22')]=qs['offset'](_0x4be537[_0xe519('0x36')][_0xe519('0x22')]);}_0x108925[_0xe519('0x3f')]=qs[_0xe519('0x40')](_0x4be537[_0xe519('0x36')][_0xe519('0x40')]);_0x108925[_0xe519('0x41')]=qs[_0xe519('0x38')](_[_0xe519('0x42')](_0x4be537[_0xe519('0x36')],_0x3abdeb['filters']));_0x108925['where'][_0xe519('0x5a')]=_0x2a3130['id'];if(_0x4be537[_0xe519('0x36')][_0xe519('0x43')]){_0x108925[_0xe519('0x41')]=_[_0xe519('0x44')](_0x108925[_0xe519('0x41')],{'$or':_[_0xe519('0x30')](_0x108925[_0xe519('0x39')],function(_0x34f0e6){var _0x3ec24={};_0x3ec24[_0x34f0e6]={'$like':'%'+_0x4be537[_0xe519('0x36')][_0xe519('0x43')]+'%'};return _0x3ec24;})});}_0x108925=_['merge']({},_0x108925,_0x4be537[_0xe519('0x45')]);return db[_0xe519('0x59')][_0xe519('0x48')](_0x108925);}})[_0xe519('0x2b')](function(_0x2eb09d){if(_0x2eb09d){return db[_0xe519('0x5b')]['findAndCountAll']({'where':{'id':_['map'](_0x2eb09d,_0xe519('0x5c')),'role':_0xe519('0x5d')},'attributes':['id',_0xe519('0x2f'),_0xe519('0x5e'),_0xe519('0x5f'),'createdAt']});}})[_0xe519('0x2b')](function(_0x17d3eb){if(_0x17d3eb){return{'count':_0x17d3eb['count'],'rows':_[_0xe519('0x30')](_0x17d3eb[_0xe519('0x49')],function(_0x5a219b){return{'membername':_0x5a219b[_0xe519('0x2f')],'UserId':_0x5a219b['id'],'queue_name':_0x3a242c[_0xe519('0x2f')],'OpenchannelQueueId':_0x3a242c['id'],'interface':util['format'](_0xe519('0x60'),_0xe519('0x61'),_0x5a219b[_0xe519('0x2f')]),'penalty':0x0,'paused':_0x5a219b[_0xe519('0x5e')],'createdAt':_0x5a219b[_0xe519('0x62')],'updatedAt':_0x5a219b[_0xe519('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4fc909,_0x108925))['catch'](handleError(_0x4fc909,null));};exports[_0xe519('0x63')]=function(_0x49e127,_0x2e628a,_0x5e5e47){var _0x56c22e={};var _0x37c6d4={};var _0x5a40d5;var _0x233e4f;return db[_0xe519('0x31')]['findOne']({'where':{'id':_0x49e127[_0xe519('0x4c')]['id']}})[_0xe519('0x2b')](handleEntityNotFound(_0x2e628a,null))[_0xe519('0x2b')](function(_0xe397bb){if(_0xe397bb){_0x5a40d5=_0xe397bb;_0x37c6d4[_0xe519('0x35')]=_['keys'](db[_0xe519('0x64')][_0xe519('0x32')]);_0x37c6d4[_0xe519('0x36')]=_[_0xe519('0x37')](_0x49e127[_0xe519('0x36')]);_0x37c6d4['filters']=_[_0xe519('0x3a')](_0x37c6d4[_0xe519('0x35')],_0x37c6d4[_0xe519('0x36')]);_0x56c22e[_0xe519('0x39')]=_[_0xe519('0x3a')](_0x37c6d4[_0xe519('0x35')],qs[_0xe519('0x3b')](_0x49e127[_0xe519('0x36')][_0xe519('0x3b')]));_0x56c22e[_0xe519('0x39')]=_0x56c22e['attributes']['length']?_0x56c22e[_0xe519('0x39')]:_0x37c6d4[_0xe519('0x35')];_0x56c22e['order']=qs['sort'](_0x49e127[_0xe519('0x36')][_0xe519('0x40')]);_0x56c22e[_0xe519('0x41')]=qs[_0xe519('0x38')](_[_0xe519('0x42')](_0x49e127['query'],_0x37c6d4[_0xe519('0x38')]));if(_0x49e127[_0xe519('0x36')][_0xe519('0x43')]){_0x56c22e['where']=_[_0xe519('0x44')](_0x56c22e[_0xe519('0x41')],{'$or':_[_0xe519('0x30')](_0x56c22e[_0xe519('0x39')],function(_0xb7dd10){var _0x2091ad={};_0x2091ad[_0xb7dd10]={'$like':'%'+_0x49e127[_0xe519('0x36')][_0xe519('0x43')]+'%'};return _0x2091ad;})});}_0x56c22e=_[_0xe519('0x44')]({},_0x56c22e,_0x49e127[_0xe519('0x45')]);return _0x5a40d5[_0xe519('0x63')](_0x56c22e);}})[_0xe519('0x2b')](function(_0x5a1083){if(_0x5a1083){_0x233e4f=_0x5a1083[_0xe519('0x3c')];if(!_0x49e127[_0xe519('0x36')][_0xe519('0x3d')](_0xe519('0x3e'))){_0x56c22e[_0xe519('0x24')]=qs[_0xe519('0x24')](_0x49e127['query'][_0xe519('0x24')]);_0x56c22e['offset']=qs[_0xe519('0x22')](_0x49e127['query'][_0xe519('0x22')]);}return _0x5a40d5[_0xe519('0x63')](_0x56c22e);}})[_0xe519('0x2b')](function(_0x465355){if(_0x465355){return _0x465355?{'count':_0x233e4f,'rows':_0x465355}:null;}})['then'](respondWithResult(_0x2e628a,null))['catch'](handleError(_0x2e628a,null));};exports['addTeams']=function(_0x29e5a2,_0x3b24c9,_0xaf7ce8){var _0x16bcf6=_0x29e5a2[_0xe519('0x54')][_0xe519('0x65')];return db[_0xe519('0x64')][_0xe519('0x48')]({'where':{'id':_0x16bcf6},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe519('0x66'),'attributes':['id',_0xe519('0x2f'),_0xe519('0x67'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x75678d){if(_0x75678d){var _0x51cea1=_[_0xe519('0x68')](_0x75678d,function(_0x133646){var _0x132fa7=_0x133646[_0xe519('0x2c')]({'plain':!![]});return _0x132fa7['Agents'];});return db['OpenchannelQueue'][_0xe519('0x4d')]({'where':{'id':_0x29e5a2[_0xe519('0x4c')]['id']}})[_0xe519('0x2b')](function(_0x3edccc){return db[_0xe519('0x69')][_0xe519('0x6a')](function(_0x4bd506){return _0x3edccc['addTeams'](_0x16bcf6,{'transaction':_0x4bd506})['then'](function(){return BPromise['each'](_0x51cea1,function(_0x501d92){return db[_0xe519('0x59')][_0xe519('0x6b')]({'where':{'UserId':_0x501d92['id'],'OpenchannelQueueId':_0x29e5a2[_0xe519('0x4c')]['id']},'transaction':_0x4bd506});});})['then'](function(){_0x51cea1[_0xe519('0x6c')](function(_0x227e8a){socket[_0xe519('0x6d')](_0xe519('0x6e'),{'UserId':_0x227e8a['id'],'OpenchannelQueueId':_0x3edccc['id']});});});});});}})[_0xe519('0x2b')](respondWithStatusCode(_0x3b24c9,null))['catch'](handleError(_0x3b24c9,null));};exports[_0xe519('0x6f')]=function(_0x124db5,_0x1b8144,_0x53821c){return db[_0xe519('0x64')]['findAll']({'where':{'id':_0x124db5[_0xe519('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0xe519('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xe519('0x2b')](handleEntityNotFound(_0x1b8144,null))[_0xe519('0x2b')](function(_0x3b69fa){var _0x22a4cf=_[_0xe519('0x30')](_0x3b69fa,'id');var _0x4aa87c=[];var _0x570a65=[];var _0x9022f1=squel[_0xe519('0x70')]();_0x9022f1[_0xe519('0x71')](_0xe519('0x72'))['from']('team_has_openchannel_queues','tq')[_0xe519('0x73')]('user_has_teams','ut',_0xe519('0x74'))['where']('OpenchannelQueueId\x20=\x20?',_0x124db5[_0xe519('0x4c')]['id']);for(var _0x34b48a=0x0;_0x34b48a<_0x3b69fa[_0xe519('0x3c')];_0x34b48a+=0x1){let _0x2878a4=_0x3b69fa[_0x34b48a];for(var _0x514a50=0x0;_0x514a50<_0x2878a4[_0xe519('0x66')][_0xe519('0x3c')];_0x514a50+=0x1){let _0x48737b=_0x2878a4[_0xe519('0x66')][_0x514a50];var _0x92b5ed=_0x9022f1[_0xe519('0x75')]();_0x92b5ed[_0xe519('0x41')](_0xe519('0x76'),_0x48737b['id']);_0x570a65[_0xe519('0x77')](db['sequelize']['query'](_0x92b5ed['toString'](),{'type':db[_0xe519('0x69')][_0xe519('0x78')][_0xe519('0x79')]})[_0xe519('0x2b')](function(_0x100ee2){if(_0x100ee2[_0xe519('0x3c')]===0x1){return _0x48737b['id'];}else{var _0x1adbef=_['every'](_[_0xe519('0x30')](_0x100ee2,_0xe519('0x7a')),function(_0x244206){return _[_0xe519('0x7b')](_0x22a4cf,_0x244206);});if(_0x1adbef){return _0x48737b['id'];}}}));}}return BPromise[_0xe519('0x7c')](_0x570a65)['then'](function(_0x28ba02){_0x4aa87c=_(_0x4aa87c)['union'](_0x28ba02)['compact']()[_0xe519('0x7d')]();return db[_0xe519('0x31')][_0xe519('0x4d')]({'where':{'id':_0x124db5[_0xe519('0x4c')]['id']}})[_0xe519('0x2b')](function(_0x1e30a1){return db[_0xe519('0x69')][_0xe519('0x6a')](function(_0x591ab1){return _0x1e30a1['removeTeams'](_0x124db5[_0xe519('0x36')]['ids'],{'transaction':_0x591ab1})[_0xe519('0x2b')](function(){if(!_[_0xe519('0x7e')](_0x4aa87c)){return _0x1e30a1[_0xe519('0x7f')](_0x4aa87c,{'transaction':_0x591ab1});}})[_0xe519('0x2b')](function(){_0x4aa87c[_0xe519('0x6c')](function(_0x38d9da){socket['emit'](_0xe519('0x80'),{'UserId':_0x38d9da,'OpenchannelQueueId':_0x1e30a1['id']});});});});});});})[_0xe519('0x2b')](respondWithStatusCode(_0x1b8144,null))[_0xe519('0x4a')](handleError(_0x1b8144,null));};exports[_0xe519('0x81')]=function(_0x329915,_0x2c0655,_0x5e3bc4){return db[_0xe519('0x31')][_0xe519('0x4d')]({'where':{'id':_0x329915[_0xe519('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2c0655,null))[_0xe519('0x2b')](function(_0xbf02b){if(_0xbf02b){return _0xbf02b[_0xe519('0x81')](_0x329915[_0xe519('0x54')][_0xe519('0x65')],_[_0xe519('0x82')](_0x329915[_0xe519('0x54')],[_0xe519('0x65'),'id'])||{})['spread'](function(_0x2bfe96){for(var _0x4f3761=0x0;_0x4f3761<_0x329915[_0xe519('0x54')]['ids'][_0xe519('0x3c')];_0x4f3761+=0x1){socket[_0xe519('0x6d')](_0xe519('0x6e'),{'UserId':Number(_0x329915[_0xe519('0x54')]['ids'][_0x4f3761]),'OpenchannelQueueId':Number(_0x329915[_0xe519('0x4c')]['id'])});}return _0x2bfe96;});}})[_0xe519('0x2b')](respondWithResult(_0x2c0655,null))['catch'](handleError(_0x2c0655,null));};exports[_0xe519('0x7f')]=function(_0x3abc27,_0x16ab62,_0x122bed){return db[_0xe519('0x31')][_0xe519('0x4d')]({'where':{'id':_0x3abc27[_0xe519('0x4c')]['id']}})[_0xe519('0x2b')](handleEntityNotFound(_0x16ab62,null))[_0xe519('0x2b')](function(_0x54000d){if(_0x54000d){return _0x54000d[_0xe519('0x7f')](_0x3abc27['query'][_0xe519('0x65')])[_0xe519('0x2b')](function(){if(_[_0xe519('0x83')](_0x3abc27['query'][_0xe519('0x65')])){for(var _0x8ed7df=0x0;_0x8ed7df<_0x3abc27[_0xe519('0x36')][_0xe519('0x65')][_0xe519('0x3c')];_0x8ed7df+=0x1){socket[_0xe519('0x6d')]('userOpenchannelQueue:remove',{'UserId':Number(_0x3abc27[_0xe519('0x36')][_0xe519('0x65')][_0x8ed7df]),'OpenchannelQueueId':Number(_0x3abc27['params']['id'])});}}else{socket[_0xe519('0x6d')](_0xe519('0x80'),{'UserId':Number(_0x3abc27[_0xe519('0x36')]['ids']),'OpenchannelQueueId':Number(_0x3abc27[_0xe519('0x4c')]['id'])});}});}})[_0xe519('0x2b')](respondWithStatusCode(_0x16ab62,null))[_0xe519('0x4a')](handleError(_0x16ab62,null));};exports[_0xe519('0x84')]=function(_0x2d6bbe,_0x26ab68,_0x2baf37){var _0x3699d3={};var _0x3fe250={};var _0x871a72;var _0x139002;return db[_0xe519('0x31')][_0xe519('0x58')]({'where':{'id':_0x2d6bbe[_0xe519('0x4c')]['id']}})['then'](handleEntityNotFound(_0x26ab68,null))[_0xe519('0x2b')](function(_0xe879b6){if(_0xe879b6){_0x871a72=_0xe879b6;_0x3fe250[_0xe519('0x35')]=_['keys'](db[_0xe519('0x5b')][_0xe519('0x32')]);_0x3fe250[_0xe519('0x36')]=_['keys'](_0x2d6bbe['query']);_0x3fe250[_0xe519('0x38')]=_['intersection'](_0x3fe250[_0xe519('0x35')],_0x3fe250['query']);_0x3699d3[_0xe519('0x39')]=_[_0xe519('0x3a')](_0x3fe250[_0xe519('0x35')],qs['fields'](_0x2d6bbe[_0xe519('0x36')]['fields']));_0x3699d3['attributes']=_0x3699d3['attributes']['length']?_0x3699d3['attributes']:_0x3fe250[_0xe519('0x35')];_0x3699d3[_0xe519('0x3f')]=qs[_0xe519('0x40')](_0x2d6bbe[_0xe519('0x36')][_0xe519('0x40')]);_0x3699d3['where']=qs['filters'](_[_0xe519('0x42')](_0x2d6bbe['query'],_0x3fe250['filters']));if(_0x2d6bbe[_0xe519('0x36')][_0xe519('0x43')]){_0x3699d3['where']=_[_0xe519('0x44')](_0x3699d3['where'],{'$or':_[_0xe519('0x30')](_0x3699d3[_0xe519('0x39')],function(_0x2ccab0){var _0x19bf90={};_0x19bf90[_0x2ccab0]={'$like':'%'+_0x2d6bbe[_0xe519('0x36')][_0xe519('0x43')]+'%'};return _0x19bf90;})});}_0x3699d3=_[_0xe519('0x44')]({},_0x3699d3,_0x2d6bbe[_0xe519('0x45')]);return _0x871a72[_0xe519('0x84')](_0x3699d3);}})[_0xe519('0x2b')](function(_0x367d4b){if(_0x367d4b){_0x139002=_0x367d4b['length'];if(!_0x2d6bbe[_0xe519('0x36')][_0xe519('0x3d')]('nolimit')){_0x3699d3[_0xe519('0x24')]=qs['limit'](_0x2d6bbe[_0xe519('0x36')][_0xe519('0x24')]);_0x3699d3[_0xe519('0x22')]=qs[_0xe519('0x22')](_0x2d6bbe[_0xe519('0x36')][_0xe519('0x22')]);}return _0x871a72[_0xe519('0x84')](_0x3699d3);}})[_0xe519('0x2b')](function(_0x70683d){if(_0x70683d){return _0x70683d?{'count':_0x139002,'rows':_0x70683d}:null;}})[_0xe519('0x2b')](respondWithResult(_0x26ab68,null))[_0xe519('0x4a')](handleError(_0x26ab68,null));};
\ No newline at end of file
+var _0x7837=['keys','filters','intersection','model','query','attributes','fields','length','order','sort','where','pick','filter','type','VIRTUAL','merge','OpenchannelQueue','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','OpenchannelQueues','UserProfileSection','find','userProfileId','autoAssociation','describe','getMembers','hasOwnProperty','nolimit','OpenchannelQueueId','UserOpenchannelQueue','createdAt','format','SIP','updatedAt','getTeams','Team','addTeams','ids','User','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','emit','userOpenchannelQueue:save','removeTeams','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','includes','all','union','compact','isEmpty','removeAgents','forEach','omit','spread','isArray','userOpenchannelQueue:remove','findOne','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','get','UserProfileResource','error','stack','name','map','key'];(function(_0x15a1af,_0x40e4ac){var _0x574500=function(_0x29df02){while(--_0x29df02){_0x15a1af['push'](_0x15a1af['shift']());}};_0x574500(++_0x40e4ac);}(_0x7837,0xdb));var _0x7783=function(_0x58c444,_0x1dc41f){_0x58c444=_0x58c444-0x0;var _0x37789e=_0x7837[_0x58c444];return _0x37789e;};'use strict';var emlformat=require(_0x7783('0x0'));var rimraf=require(_0x7783('0x1'));var zipdir=require(_0x7783('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7783('0x3'));var moment=require(_0x7783('0x4'));var BPromise=require(_0x7783('0x5'));var Mustache=require('mustache');var util=require(_0x7783('0x6'));var path=require(_0x7783('0x7'));var sox=require(_0x7783('0x8'));var csv=require('to-csv');var ejs=require(_0x7783('0x9'));var fs=require('fs');var fs_extra=require(_0x7783('0xa'));var _=require(_0x7783('0xb'));var squel=require(_0x7783('0xc'));var crypto=require('crypto');var jsforce=require(_0x7783('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7783('0xe'));var querystring=require(_0x7783('0xf'));var Papa=require(_0x7783('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7783('0x11'));var hardwareService=require(_0x7783('0x12'));var logger=require(_0x7783('0x13'))(_0x7783('0x14'));var utils=require(_0x7783('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7783('0x16'));var db=require(_0x7783('0x17'))['db'];config['redis']=_[_0x7783('0x18')](config[_0x7783('0x19')],{'host':_0x7783('0x1a'),'port':0x18eb});var socket=require(_0x7783('0x1b'))(new Redis(config['redis']));require('./openchannelQueue.socket')['register'](socket);function respondWithStatusCode(_0x112698,_0x1121f8){_0x1121f8=_0x1121f8||0xcc;return function(_0x266330){if(_0x266330){return _0x112698[_0x7783('0x1c')](_0x1121f8);}return _0x112698[_0x7783('0x1d')](_0x1121f8)[_0x7783('0x1e')]();};}function respondWithResult(_0xf64d69,_0x3c38a6){_0x3c38a6=_0x3c38a6||0xc8;return function(_0x21a532){if(_0x21a532){return _0xf64d69[_0x7783('0x1d')](_0x3c38a6)[_0x7783('0x1f')](_0x21a532);}};}function respondWithFilteredResult(_0x178f70,_0x37f256){return function(_0x4849c5){if(_0x4849c5){var _0x40e37c=typeof _0x37f256['offset']==='undefined'&&typeof _0x37f256[_0x7783('0x20')]===_0x7783('0x21');var _0x4fd279=_0x4849c5[_0x7783('0x22')];var _0x2434de=_0x40e37c?0x0:_0x37f256[_0x7783('0x23')];var _0x1dcd9a=_0x40e37c?_0x4849c5[_0x7783('0x22')]:_0x37f256[_0x7783('0x23')]+_0x37f256[_0x7783('0x20')];var _0x36f68d;if(_0x1dcd9a>=_0x4fd279){_0x1dcd9a=_0x4fd279;_0x36f68d=0xc8;}else{_0x36f68d=0xce;}_0x178f70[_0x7783('0x1d')](_0x36f68d);return _0x178f70[_0x7783('0x24')](_0x7783('0x25'),_0x2434de+'-'+_0x1dcd9a+'/'+_0x4fd279)[_0x7783('0x1f')](_0x4849c5);}return null;};}function patchUpdates(_0x30dfaa){return function(_0x1ca13a){try{jsonpatch[_0x7783('0x26')](_0x1ca13a,_0x30dfaa,!![]);}catch(_0x4a1dde){return BPromise['reject'](_0x4a1dde);}return _0x1ca13a[_0x7783('0x27')]();};}function saveUpdates(_0x461037,_0x350aba){return function(_0x4057c8){if(_0x4057c8){return _0x4057c8[_0x7783('0x28')](_0x461037)['then'](function(_0x4c5b50){return _0x4c5b50;});}return null;};}function removeEntity(_0x1cd663,_0x59a191){return function(_0x24d85f){if(_0x24d85f){return _0x24d85f['destroy']()[_0x7783('0x29')](function(){var _0x5c07f7=_0x24d85f[_0x7783('0x2a')]({'plain':!![]});var _0xfcda89='OpenchannelQueues';return db[_0x7783('0x2b')]['destroy']({'where':{'type':_0xfcda89,'resourceId':_0x5c07f7['id']}})['then'](function(){return _0x24d85f;});})[_0x7783('0x29')](function(){_0x1cd663[_0x7783('0x1d')](0xcc)[_0x7783('0x1e')]();});}};}function handleEntityNotFound(_0x4ac1f4,_0x40e796){return function(_0x3a0fbc){if(!_0x3a0fbc){_0x4ac1f4[_0x7783('0x1c')](0x194);}return _0x3a0fbc;};}function handleError(_0x4405c4,_0x38c4a6){_0x38c4a6=_0x38c4a6||0x1f4;return function(_0x57b831){logger[_0x7783('0x2c')](_0x57b831[_0x7783('0x2d')]);if(_0x57b831[_0x7783('0x2e')]){delete _0x57b831['name'];}_0x4405c4[_0x7783('0x1d')](_0x38c4a6)['send'](_0x57b831);};}exports['index']=function(_0x5a7505,_0x1ba4e3){var _0x394fc3={},_0x3e3f88={},_0x2e6ba9={'count':0x0,'rows':[]};var _0x26a742=_[_0x7783('0x2f')](db['OpenchannelQueue']['rawAttributes'],function(_0x3d8a48){return{'name':_0x3d8a48['fieldName'],'type':_0x3d8a48['type'][_0x7783('0x30')]};});_0x3e3f88['model']=_[_0x7783('0x2f')](_0x26a742,_0x7783('0x2e'));_0x3e3f88['query']=_[_0x7783('0x31')](_0x5a7505['query']);_0x3e3f88[_0x7783('0x32')]=_[_0x7783('0x33')](_0x3e3f88[_0x7783('0x34')],_0x3e3f88[_0x7783('0x35')]);_0x394fc3[_0x7783('0x36')]=_['intersection'](_0x3e3f88[_0x7783('0x34')],qs[_0x7783('0x37')](_0x5a7505[_0x7783('0x35')]['fields']));_0x394fc3[_0x7783('0x36')]=_0x394fc3[_0x7783('0x36')][_0x7783('0x38')]?_0x394fc3[_0x7783('0x36')]:_0x3e3f88[_0x7783('0x34')];if(!_0x5a7505['query']['hasOwnProperty']('nolimit')){_0x394fc3[_0x7783('0x20')]=qs[_0x7783('0x20')](_0x5a7505['query'][_0x7783('0x20')]);_0x394fc3[_0x7783('0x23')]=qs[_0x7783('0x23')](_0x5a7505[_0x7783('0x35')][_0x7783('0x23')]);}_0x394fc3[_0x7783('0x39')]=qs[_0x7783('0x3a')](_0x5a7505[_0x7783('0x35')][_0x7783('0x3a')]);_0x394fc3[_0x7783('0x3b')]=qs['filters'](_[_0x7783('0x3c')](_0x5a7505[_0x7783('0x35')],_0x3e3f88[_0x7783('0x32')]),_0x26a742);if(_0x5a7505['query'][_0x7783('0x3d')]){_0x394fc3[_0x7783('0x3b')]=_['merge'](_0x394fc3[_0x7783('0x3b')],{'$or':_['map'](_0x26a742,function(_0x4e5da8){if(_0x4e5da8[_0x7783('0x3e')]!==_0x7783('0x3f')){var _0x2a24ea={};_0x2a24ea[_0x4e5da8[_0x7783('0x2e')]]={'$like':'%'+_0x5a7505[_0x7783('0x35')][_0x7783('0x3d')]+'%'};return _0x2a24ea;}})});}_0x394fc3=_[_0x7783('0x40')]({},_0x394fc3,_0x5a7505['options']);var _0x167a68={'where':_0x394fc3[_0x7783('0x3b')]};return db[_0x7783('0x41')][_0x7783('0x22')](_0x167a68)[_0x7783('0x29')](function(_0x196057){_0x2e6ba9['count']=_0x196057;if(_0x5a7505[_0x7783('0x35')][_0x7783('0x42')]){_0x394fc3[_0x7783('0x43')]=[{'all':!![]}];}return db[_0x7783('0x41')][_0x7783('0x44')](_0x394fc3);})['then'](function(_0x1410a8){_0x2e6ba9[_0x7783('0x45')]=_0x1410a8;return _0x2e6ba9;})[_0x7783('0x29')](respondWithFilteredResult(_0x1ba4e3,_0x394fc3))[_0x7783('0x46')](handleError(_0x1ba4e3,null));};exports[_0x7783('0x47')]=function(_0x1335dc,_0x1e9609){var _0x4e0cf5={'raw':!![],'where':{'id':_0x1335dc[_0x7783('0x48')]['id']}},_0x2f5ec2={};_0x2f5ec2[_0x7783('0x34')]=_[_0x7783('0x31')](db['OpenchannelQueue'][_0x7783('0x49')]);_0x2f5ec2['query']=_[_0x7783('0x31')](_0x1335dc['query']);_0x2f5ec2[_0x7783('0x32')]=_[_0x7783('0x33')](_0x2f5ec2[_0x7783('0x34')],_0x2f5ec2[_0x7783('0x35')]);_0x4e0cf5['attributes']=_[_0x7783('0x33')](_0x2f5ec2[_0x7783('0x34')],qs[_0x7783('0x37')](_0x1335dc['query'][_0x7783('0x37')]));_0x4e0cf5['attributes']=_0x4e0cf5[_0x7783('0x36')][_0x7783('0x38')]?_0x4e0cf5['attributes']:_0x2f5ec2[_0x7783('0x34')];if(_0x1335dc[_0x7783('0x35')][_0x7783('0x42')]){_0x4e0cf5[_0x7783('0x43')]=[{'all':!![]}];}_0x4e0cf5=_[_0x7783('0x40')]({},_0x4e0cf5,_0x1335dc[_0x7783('0x4a')]);return db[_0x7783('0x41')]['find'](_0x4e0cf5)[_0x7783('0x29')](handleEntityNotFound(_0x1e9609,null))[_0x7783('0x29')](respondWithResult(_0x1e9609,null))['catch'](handleError(_0x1e9609,null));};exports[_0x7783('0x4b')]=function(_0x54680f,_0xcc6bd6){return db['OpenchannelQueue'][_0x7783('0x4b')](_0x54680f[_0x7783('0x4c')],{})['then'](function(_0x566fc4){var _0x3b5bb0=_0x54680f['user'][_0x7783('0x2a')]({'plain':!![]});if(!_0x3b5bb0)throw new Error(_0x7783('0x4d'));if(_0x3b5bb0['role']===_0x7783('0x4e')){var _0x1f71c9=_0x566fc4[_0x7783('0x2a')]({'plain':!![]});var _0x442700=_0x7783('0x4f');return db[_0x7783('0x50')][_0x7783('0x51')]({'where':{'name':_0x442700,'userProfileId':_0x3b5bb0[_0x7783('0x52')]},'raw':!![]})[_0x7783('0x29')](function(_0x2ab756){if(_0x2ab756&&_0x2ab756[_0x7783('0x53')]===0x0){return db[_0x7783('0x2b')][_0x7783('0x4b')]({'name':_0x1f71c9['name'],'resourceId':_0x1f71c9['id'],'type':_0x2ab756['name'],'sectionId':_0x2ab756['id']},{})[_0x7783('0x29')](function(){return _0x566fc4;});}else{return _0x566fc4;}})[_0x7783('0x46')](function(_0x3cdf9f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3cdf9f);throw _0x3cdf9f;});}return _0x566fc4;})[_0x7783('0x29')](respondWithResult(_0xcc6bd6,0xc9))[_0x7783('0x46')](handleError(_0xcc6bd6,null));};exports[_0x7783('0x28')]=function(_0x2bba6f,_0x5e029a){if(_0x2bba6f['body']['id']){delete _0x2bba6f['body']['id'];}return db[_0x7783('0x41')][_0x7783('0x51')]({'where':{'id':_0x2bba6f[_0x7783('0x48')]['id']}})[_0x7783('0x29')](handleEntityNotFound(_0x5e029a,null))[_0x7783('0x29')](saveUpdates(_0x2bba6f[_0x7783('0x4c')],null))['then'](respondWithResult(_0x5e029a,null))[_0x7783('0x46')](handleError(_0x5e029a,null));};exports['destroy']=function(_0x213f78,_0x15f0b2){return db['OpenchannelQueue'][_0x7783('0x51')]({'where':{'id':_0x213f78[_0x7783('0x48')]['id']}})[_0x7783('0x29')](handleEntityNotFound(_0x15f0b2,null))[_0x7783('0x29')](removeEntity(_0x15f0b2,null))[_0x7783('0x46')](handleError(_0x15f0b2,null));};exports[_0x7783('0x54')]=function(_0x48d387,_0x2da885){return db['OpenchannelQueue'][_0x7783('0x54')]()['then'](respondWithResult(_0x2da885,null))[_0x7783('0x46')](handleError(_0x2da885,null));};exports[_0x7783('0x55')]=function(_0xb4ff15,_0x440408,_0x2ff680){var _0x30bc44={'raw':!![],'where':{}},_0x22b011={},_0x39c8f3;return db['OpenchannelQueue']['findOne']({'where':{'id':_0xb4ff15[_0x7783('0x48')]['id']}})[_0x7783('0x29')](handleEntityNotFound(_0x440408,null))[_0x7783('0x29')](function(_0x4d92e4){if(_0x4d92e4){_0x39c8f3=_0x4d92e4[_0x7783('0x2a')]({'plain':!![]});_0x22b011[_0x7783('0x34')]=_[_0x7783('0x31')](db['UserOpenchannelQueue'][_0x7783('0x49')]);_0x22b011[_0x7783('0x35')]=_['keys'](_0xb4ff15[_0x7783('0x35')]);_0x22b011[_0x7783('0x32')]=_[_0x7783('0x33')](_0x22b011[_0x7783('0x34')],_0x22b011[_0x7783('0x35')]);_0x30bc44['attributes']=_[_0x7783('0x33')](_0x22b011['model'],qs[_0x7783('0x37')](_0xb4ff15[_0x7783('0x35')][_0x7783('0x37')]));_0x30bc44['attributes']=_0x30bc44[_0x7783('0x36')][_0x7783('0x38')]?_0x30bc44[_0x7783('0x36')]:_0x22b011['model'];if(!_0xb4ff15[_0x7783('0x35')][_0x7783('0x56')](_0x7783('0x57'))){_0x30bc44[_0x7783('0x20')]=qs[_0x7783('0x20')](_0xb4ff15['query'][_0x7783('0x20')]);_0x30bc44[_0x7783('0x23')]=qs[_0x7783('0x23')](_0xb4ff15[_0x7783('0x35')]['offset']);}_0x30bc44[_0x7783('0x39')]=qs[_0x7783('0x3a')](_0xb4ff15[_0x7783('0x35')][_0x7783('0x3a')]);_0x30bc44['where']=qs[_0x7783('0x32')](_['pick'](_0xb4ff15[_0x7783('0x35')],_0x22b011[_0x7783('0x32')]));_0x30bc44[_0x7783('0x3b')][_0x7783('0x58')]=_0x4d92e4['id'];if(_0xb4ff15[_0x7783('0x35')][_0x7783('0x3d')]){_0x30bc44['where']=_[_0x7783('0x40')](_0x30bc44[_0x7783('0x3b')],{'$or':_['map'](_0x30bc44[_0x7783('0x36')],function(_0x20cc01){var _0x584028={};_0x584028[_0x20cc01]={'$like':'%'+_0xb4ff15[_0x7783('0x35')]['filter']+'%'};return _0x584028;})});}_0x30bc44=_[_0x7783('0x40')]({},_0x30bc44,_0xb4ff15[_0x7783('0x4a')]);return db[_0x7783('0x59')][_0x7783('0x44')](_0x30bc44);}})['then'](function(_0x11c530){if(_0x11c530){return db['User']['findAndCountAll']({'where':{'id':_[_0x7783('0x2f')](_0x11c530,'UserId'),'role':'agent'},'attributes':['id',_0x7783('0x2e'),'openchannelPause','updatedAt',_0x7783('0x5a')]});}})[_0x7783('0x29')](function(_0x36830d){if(_0x36830d){return{'count':_0x36830d[_0x7783('0x22')],'rows':_['map'](_0x36830d[_0x7783('0x45')],function(_0x57cbf8){return{'membername':_0x57cbf8['name'],'UserId':_0x57cbf8['id'],'queue_name':_0x39c8f3[_0x7783('0x2e')],'OpenchannelQueueId':_0x39c8f3['id'],'interface':util[_0x7783('0x5b')]('%s/%s',_0x7783('0x5c'),_0x57cbf8[_0x7783('0x2e')]),'penalty':0x0,'paused':_0x57cbf8['openchannelPause'],'createdAt':_0x57cbf8[_0x7783('0x5a')],'updatedAt':_0x57cbf8[_0x7783('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7783('0x29')](respondWithFilteredResult(_0x440408,_0x30bc44))[_0x7783('0x46')](handleError(_0x440408,null));};exports[_0x7783('0x5e')]=function(_0x244ce3,_0x5f449d,_0x16328d){var _0x4f44e6={};var _0x1e6ca3={};var _0x303205;var _0x41d9d1;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x244ce3['params']['id']}})[_0x7783('0x29')](handleEntityNotFound(_0x5f449d,null))['then'](function(_0x3e6111){if(_0x3e6111){_0x303205=_0x3e6111;_0x1e6ca3[_0x7783('0x34')]=_[_0x7783('0x31')](db[_0x7783('0x5f')][_0x7783('0x49')]);_0x1e6ca3[_0x7783('0x35')]=_[_0x7783('0x31')](_0x244ce3[_0x7783('0x35')]);_0x1e6ca3['filters']=_[_0x7783('0x33')](_0x1e6ca3[_0x7783('0x34')],_0x1e6ca3[_0x7783('0x35')]);_0x4f44e6['attributes']=_[_0x7783('0x33')](_0x1e6ca3[_0x7783('0x34')],qs[_0x7783('0x37')](_0x244ce3[_0x7783('0x35')][_0x7783('0x37')]));_0x4f44e6[_0x7783('0x36')]=_0x4f44e6[_0x7783('0x36')][_0x7783('0x38')]?_0x4f44e6[_0x7783('0x36')]:_0x1e6ca3[_0x7783('0x34')];_0x4f44e6[_0x7783('0x39')]=qs['sort'](_0x244ce3[_0x7783('0x35')][_0x7783('0x3a')]);_0x4f44e6['where']=qs['filters'](_['pick'](_0x244ce3[_0x7783('0x35')],_0x1e6ca3[_0x7783('0x32')]));if(_0x244ce3['query'][_0x7783('0x3d')]){_0x4f44e6[_0x7783('0x3b')]=_[_0x7783('0x40')](_0x4f44e6[_0x7783('0x3b')],{'$or':_[_0x7783('0x2f')](_0x4f44e6[_0x7783('0x36')],function(_0x59db98){var _0x2b41b4={};_0x2b41b4[_0x59db98]={'$like':'%'+_0x244ce3[_0x7783('0x35')][_0x7783('0x3d')]+'%'};return _0x2b41b4;})});}_0x4f44e6=_[_0x7783('0x40')]({},_0x4f44e6,_0x244ce3[_0x7783('0x4a')]);return _0x303205[_0x7783('0x5e')](_0x4f44e6);}})[_0x7783('0x29')](function(_0x2e2d5a){if(_0x2e2d5a){_0x41d9d1=_0x2e2d5a['length'];if(!_0x244ce3[_0x7783('0x35')][_0x7783('0x56')](_0x7783('0x57'))){_0x4f44e6[_0x7783('0x20')]=qs[_0x7783('0x20')](_0x244ce3[_0x7783('0x35')][_0x7783('0x20')]);_0x4f44e6[_0x7783('0x23')]=qs['offset'](_0x244ce3[_0x7783('0x35')][_0x7783('0x23')]);}return _0x303205[_0x7783('0x5e')](_0x4f44e6);}})['then'](function(_0xb1f160){if(_0xb1f160){return _0xb1f160?{'count':_0x41d9d1,'rows':_0xb1f160}:null;}})[_0x7783('0x29')](respondWithResult(_0x5f449d,null))[_0x7783('0x46')](handleError(_0x5f449d,null));};exports[_0x7783('0x60')]=function(_0xb14a69,_0x4344fc,_0x560917){var _0x1b327d=_0xb14a69[_0x7783('0x4c')][_0x7783('0x61')];return db[_0x7783('0x5f')][_0x7783('0x44')]({'where':{'id':_0x1b327d},'attributes':['id'],'include':[{'model':db[_0x7783('0x62')],'as':'Agents','attributes':['id','name',_0x7783('0x63'),_0x7783('0x64'),_0x7783('0x65')],'raw':!![]}]})[_0x7783('0x29')](function(_0x20ce52){if(_0x20ce52){var _0x5a83cf=_[_0x7783('0x66')](_0x20ce52,function(_0x5a181a){var _0x176a46=_0x5a181a[_0x7783('0x2a')]({'plain':!![]});return _0x176a46[_0x7783('0x67')];});return db[_0x7783('0x41')][_0x7783('0x51')]({'where':{'id':_0xb14a69[_0x7783('0x48')]['id']}})[_0x7783('0x29')](function(_0x290d16){return db[_0x7783('0x68')][_0x7783('0x69')](function(_0x10ee34){return _0x290d16['addTeams'](_0x1b327d,{'transaction':_0x10ee34})[_0x7783('0x29')](function(){return BPromise[_0x7783('0x6a')](_0x5a83cf,function(_0x2e5948){return db[_0x7783('0x59')]['findOrCreate']({'where':{'UserId':_0x2e5948['id'],'OpenchannelQueueId':_0xb14a69[_0x7783('0x48')]['id']},'transaction':_0x10ee34});});})[_0x7783('0x29')](function(){_0x5a83cf['forEach'](function(_0x1ae2dc){socket[_0x7783('0x6b')](_0x7783('0x6c'),{'UserId':_0x1ae2dc['id'],'OpenchannelQueueId':_0x290d16['id']});});});});});}})['then'](respondWithStatusCode(_0x4344fc,null))[_0x7783('0x46')](handleError(_0x4344fc,null));};exports[_0x7783('0x6d')]=function(_0x20e32d,_0x1b487d,_0x1043eb){return db[_0x7783('0x5f')][_0x7783('0x44')]({'where':{'id':_0x20e32d[_0x7783('0x35')][_0x7783('0x61')]},'attributes':['id'],'include':[{'model':db[_0x7783('0x62')],'as':_0x7783('0x67'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1b487d,null))[_0x7783('0x29')](function(_0x2739bd){var _0x374bac=_[_0x7783('0x2f')](_0x2739bd,'id');var _0x563fb2=[];var _0x597107=[];var _0x839a83=squel['select']();_0x839a83['field'](_0x7783('0x6e'))[_0x7783('0x6f')](_0x7783('0x70'),'tq')[_0x7783('0x71')](_0x7783('0x72'),'ut',_0x7783('0x73'))[_0x7783('0x3b')]('OpenchannelQueueId\x20=\x20?',_0x20e32d['params']['id']);for(var _0x1ffe19=0x0;_0x1ffe19<_0x2739bd[_0x7783('0x38')];_0x1ffe19+=0x1){let _0x223700=_0x2739bd[_0x1ffe19];for(var _0xe57600=0x0;_0xe57600<_0x223700[_0x7783('0x67')]['length'];_0xe57600+=0x1){let _0x37323a=_0x223700['Agents'][_0xe57600];var _0x7deef7=_0x839a83['clone']();_0x7deef7[_0x7783('0x3b')](_0x7783('0x74'),_0x37323a['id']);_0x597107[_0x7783('0x75')](db[_0x7783('0x68')]['query'](_0x7deef7['toString'](),{'type':db['sequelize'][_0x7783('0x76')][_0x7783('0x77')]})['then'](function(_0x4af293){if(_0x4af293[_0x7783('0x38')]===0x1){return _0x37323a['id'];}else{var _0x3c9035=_[_0x7783('0x78')](_[_0x7783('0x2f')](_0x4af293,'TeamId'),function(_0x158417){return _[_0x7783('0x79')](_0x374bac,_0x158417);});if(_0x3c9035){return _0x37323a['id'];}}}));}}return BPromise[_0x7783('0x7a')](_0x597107)[_0x7783('0x29')](function(_0x4ac514){_0x563fb2=_(_0x563fb2)[_0x7783('0x7b')](_0x4ac514)[_0x7783('0x7c')]()['value']();return db[_0x7783('0x41')][_0x7783('0x51')]({'where':{'id':_0x20e32d['params']['id']}})['then'](function(_0x18e87a){return db['sequelize'][_0x7783('0x69')](function(_0x41f33c){return _0x18e87a['removeTeams'](_0x20e32d[_0x7783('0x35')][_0x7783('0x61')],{'transaction':_0x41f33c})['then'](function(){if(!_[_0x7783('0x7d')](_0x563fb2)){return _0x18e87a[_0x7783('0x7e')](_0x563fb2,{'transaction':_0x41f33c});}})[_0x7783('0x29')](function(){_0x563fb2[_0x7783('0x7f')](function(_0x2164be){socket[_0x7783('0x6b')]('userOpenchannelQueue:remove',{'UserId':_0x2164be,'OpenchannelQueueId':_0x18e87a['id']});});});});});});})['then'](respondWithStatusCode(_0x1b487d,null))[_0x7783('0x46')](handleError(_0x1b487d,null));};exports['addAgents']=function(_0x50b998,_0x3c83ab,_0x10127b){return db[_0x7783('0x41')][_0x7783('0x51')]({'where':{'id':_0x50b998[_0x7783('0x48')]['id']}})[_0x7783('0x29')](handleEntityNotFound(_0x3c83ab,null))[_0x7783('0x29')](function(_0x225119){if(_0x225119){return _0x225119['addAgents'](_0x50b998[_0x7783('0x4c')][_0x7783('0x61')],_[_0x7783('0x80')](_0x50b998[_0x7783('0x4c')],[_0x7783('0x61'),'id'])||{})[_0x7783('0x81')](function(_0x5666ac){for(var _0x4201e0=0x0;_0x4201e0<_0x50b998['body'][_0x7783('0x61')][_0x7783('0x38')];_0x4201e0+=0x1){socket[_0x7783('0x6b')]('userOpenchannelQueue:save',{'UserId':Number(_0x50b998[_0x7783('0x4c')][_0x7783('0x61')][_0x4201e0]),'OpenchannelQueueId':Number(_0x50b998['params']['id'])});}return _0x5666ac;});}})[_0x7783('0x29')](respondWithResult(_0x3c83ab,null))[_0x7783('0x46')](handleError(_0x3c83ab,null));};exports[_0x7783('0x7e')]=function(_0x2eccec,_0x4ff000,_0x4d313d){return db[_0x7783('0x41')][_0x7783('0x51')]({'where':{'id':_0x2eccec[_0x7783('0x48')]['id']}})[_0x7783('0x29')](handleEntityNotFound(_0x4ff000,null))['then'](function(_0x41df12){if(_0x41df12){return _0x41df12[_0x7783('0x7e')](_0x2eccec[_0x7783('0x35')][_0x7783('0x61')])[_0x7783('0x29')](function(){if(_[_0x7783('0x82')](_0x2eccec[_0x7783('0x35')][_0x7783('0x61')])){for(var _0x454534=0x0;_0x454534<_0x2eccec[_0x7783('0x35')]['ids']['length'];_0x454534+=0x1){socket[_0x7783('0x6b')]('userOpenchannelQueue:remove',{'UserId':Number(_0x2eccec[_0x7783('0x35')][_0x7783('0x61')][_0x454534]),'OpenchannelQueueId':Number(_0x2eccec[_0x7783('0x48')]['id'])});}}else{socket[_0x7783('0x6b')](_0x7783('0x83'),{'UserId':Number(_0x2eccec[_0x7783('0x35')][_0x7783('0x61')]),'OpenchannelQueueId':Number(_0x2eccec[_0x7783('0x48')]['id'])});}});}})[_0x7783('0x29')](respondWithStatusCode(_0x4ff000,null))['catch'](handleError(_0x4ff000,null));};exports['getAgents']=function(_0x203331,_0x30d8b3,_0x820c77){var _0x35fac8={};var _0xd95ad={};var _0x22f9c5;var _0x5df058;return db['OpenchannelQueue'][_0x7783('0x84')]({'where':{'id':_0x203331[_0x7783('0x48')]['id']}})[_0x7783('0x29')](handleEntityNotFound(_0x30d8b3,null))['then'](function(_0x321212){if(_0x321212){_0x22f9c5=_0x321212;_0xd95ad[_0x7783('0x34')]=_[_0x7783('0x31')](db['User'][_0x7783('0x49')]);_0xd95ad[_0x7783('0x35')]=_[_0x7783('0x31')](_0x203331[_0x7783('0x35')]);_0xd95ad[_0x7783('0x32')]=_[_0x7783('0x33')](_0xd95ad[_0x7783('0x34')],_0xd95ad['query']);_0x35fac8['attributes']=_[_0x7783('0x33')](_0xd95ad['model'],qs[_0x7783('0x37')](_0x203331[_0x7783('0x35')][_0x7783('0x37')]));_0x35fac8[_0x7783('0x36')]=_0x35fac8['attributes'][_0x7783('0x38')]?_0x35fac8[_0x7783('0x36')]:_0xd95ad[_0x7783('0x34')];_0x35fac8[_0x7783('0x39')]=qs[_0x7783('0x3a')](_0x203331['query'][_0x7783('0x3a')]);_0x35fac8[_0x7783('0x3b')]=qs[_0x7783('0x32')](_[_0x7783('0x3c')](_0x203331['query'],_0xd95ad[_0x7783('0x32')]));if(_0x203331[_0x7783('0x35')][_0x7783('0x3d')]){_0x35fac8[_0x7783('0x3b')]=_[_0x7783('0x40')](_0x35fac8['where'],{'$or':_['map'](_0x35fac8[_0x7783('0x36')],function(_0x20a061){var _0x4a862a={};_0x4a862a[_0x20a061]={'$like':'%'+_0x203331[_0x7783('0x35')][_0x7783('0x3d')]+'%'};return _0x4a862a;})});}_0x35fac8=_[_0x7783('0x40')]({},_0x35fac8,_0x203331[_0x7783('0x4a')]);return _0x22f9c5[_0x7783('0x85')](_0x35fac8);}})[_0x7783('0x29')](function(_0x2827bd){if(_0x2827bd){_0x5df058=_0x2827bd[_0x7783('0x38')];if(!_0x203331[_0x7783('0x35')][_0x7783('0x56')](_0x7783('0x57'))){_0x35fac8['limit']=qs[_0x7783('0x20')](_0x203331[_0x7783('0x35')][_0x7783('0x20')]);_0x35fac8[_0x7783('0x23')]=qs[_0x7783('0x23')](_0x203331[_0x7783('0x35')]['offset']);}return _0x22f9c5[_0x7783('0x85')](_0x35fac8);}})['then'](function(_0x1fc66b){if(_0x1fc66b){return _0x1fc66b?{'count':_0x5df058,'rows':_0x1fc66b}:null;}})[_0x7783('0x29')](respondWithResult(_0x30d8b3,null))[_0x7783('0x46')](handleError(_0x30d8b3,null));};
\ No newline at end of file
index a2bbcd8..df8edf0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d8d=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x5cd57d,_0x3e5b81){var _0x16d3fe=function(_0x19f50e){while(--_0x19f50e){_0x5cd57d['push'](_0x5cd57d['shift']());}};_0x16d3fe(++_0x3e5b81);}(_0x1d8d,0xf4));var _0xd1d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d8d[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xd1d8('0x0'));var OpenchannelQueue=require(_0xd1d8('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xd1d8('0x2')](0x0);var events={'afterCreate':_0xd1d8('0x3'),'afterUpdate':_0xd1d8('0x4'),'afterDestroy':_0xd1d8('0x5')};function emitEvent(_0xd85071){return function(_0x12f2cb,_0x41e382,_0x532349){OpenchannelQueueEvents['emit'](_0xd85071+':'+_0x12f2cb['id'],_0x12f2cb);OpenchannelQueueEvents[_0xd1d8('0x6')](_0xd85071,_0x12f2cb);_0x532349(null);};}for(var e in events){if(events[_0xd1d8('0x7')](e)){var event=events[e];OpenchannelQueue[_0xd1d8('0x8')](e,emitEvent(event));}}module[_0xd1d8('0x9')]=OpenchannelQueueEvents;
\ No newline at end of file
+var _0x8bc2=['save','update','emit','hasOwnProperty','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners'];(function(_0x3c41fb,_0x2ae079){var _0xe4e126=function(_0x246488){while(--_0x246488){_0x3c41fb['push'](_0x3c41fb['shift']());}};_0xe4e126(++_0x2ae079);}(_0x8bc2,0x137));var _0x28bc=function(_0xa00ecc,_0x4aa7b0){_0xa00ecc=_0xa00ecc-0x0;var _0x5c3a53=_0x8bc2[_0xa00ecc];return _0x5c3a53;};'use strict';var EventEmitter=require(_0x28bc('0x0'));var OpenchannelQueue=require(_0x28bc('0x1'))['db'][_0x28bc('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x28bc('0x3')](0x0);var events={'afterCreate':_0x28bc('0x4'),'afterUpdate':_0x28bc('0x5'),'afterDestroy':'remove'};function emitEvent(_0xd26a22){return function(_0x3c14b3,_0x2f4805,_0x7f71fc){OpenchannelQueueEvents[_0x28bc('0x6')](_0xd26a22+':'+_0x3c14b3['id'],_0x3c14b3);OpenchannelQueueEvents[_0x28bc('0x6')](_0xd26a22,_0x3c14b3);_0x7f71fc(null);};}for(var e in events){if(events[_0x28bc('0x7')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x28bc('0x8')]=OpenchannelQueueEvents;
\ No newline at end of file
index f9a56b5..58b4140 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef17=['api','moment','path','rimraf','../../config/environment','./openchannelQueue.attributes','define','openchannel_queues','lodash','util','../../config/logger'];(function(_0x1125a0,_0x1c8726){var _0x4df838=function(_0x1319a1){while(--_0x1319a1){_0x1125a0['push'](_0x1125a0['shift']());}};_0x4df838(++_0x1c8726);}(_0xef17,0x194));var _0x7ef1=function(_0x2fc479,_0x205d8d){_0x2fc479=_0x2fc479-0x0;var _0x48c844=_0xef17[_0x2fc479];return _0x48c844;};'use strict';var _=require(_0x7ef1('0x0'));var util=require(_0x7ef1('0x1'));var logger=require(_0x7ef1('0x2'))(_0x7ef1('0x3'));var moment=require(_0x7ef1('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7ef1('0x5'));var rimraf=require(_0x7ef1('0x6'));var config=require(_0x7ef1('0x7'));var attributes=require(_0x7ef1('0x8'));module['exports']=function(_0x203921,_0x559870){return _0x203921[_0x7ef1('0x9')]('OpenchannelQueue',attributes,{'tableName':_0x7ef1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc29f=['../../config/logger','bluebird','request-promise','path','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','lodash','util'];(function(_0x22bcae,_0x39378d){var _0x3a2fb9=function(_0x19618f){while(--_0x19618f){_0x22bcae['push'](_0x22bcae['shift']());}};_0x3a2fb9(++_0x39378d);}(_0xc29f,0x1a0));var _0xfc29=function(_0x22a2b4,_0x437e2c){_0x22a2b4=_0x22a2b4-0x0;var _0x53dfac=_0xc29f[_0x22a2b4];return _0x53dfac;};'use strict';var _=require(_0xfc29('0x0'));var util=require(_0xfc29('0x1'));var logger=require(_0xfc29('0x2'))('api');var moment=require('moment');var BPromise=require(_0xfc29('0x3'));var rp=require(_0xfc29('0x4'));var fs=require('fs');var path=require(_0xfc29('0x5'));var rimraf=require('rimraf');var config=require(_0xfc29('0x6'));var attributes=require(_0xfc29('0x7'));module[_0xfc29('0x8')]=function(_0x3cfb11,_0x162dba){return _0x3cfb11[_0xfc29('0x9')](_0xfc29('0xa'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 016332c..c81b52d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffdd=['then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','find','ShowOpenchannelQueue','stringify','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','socket.io-emitter','./openchannelQueue.socket','register','request'];(function(_0x1f0007,_0x5b1d96){var _0x3ce550=function(_0x2ca4b2){while(--_0x2ca4b2){_0x1f0007['push'](_0x1f0007['shift']());}};_0x3ce550(++_0x5b1d96);}(_0xffdd,0xfc));var _0xdffd=function(_0x43a36f,_0x339749){_0x43a36f=_0x43a36f-0x0;var _0x4702fb=_0xffdd[_0x43a36f];return _0x4702fb;};'use strict';var _=require('lodash');var util=require(_0xdffd('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdffd('0x1'));var fs=require('fs');var Redis=require(_0xdffd('0x2'));var db=require(_0xdffd('0x3'))['db'];var utils=require(_0xdffd('0x4'));var logger=require(_0xdffd('0x5'))(_0xdffd('0x6'));var config=require('../../config/environment');var jayson=require(_0xdffd('0x7'));var client=jayson[_0xdffd('0x8')]['http']({'port':0x232a});config[_0xdffd('0x9')]=_['defaults'](config[_0xdffd('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xdffd('0xa'))(new Redis(config[_0xdffd('0x9')]));require(_0xdffd('0xb'))[_0xdffd('0xc')](socket);function respondWithRpcPromise(_0x139e5d,_0x249eea,_0x20f225){return new BPromise(function(_0x3e896c,_0x185d64){return client[_0xdffd('0xd')](_0x139e5d,_0x20f225)[_0xdffd('0xe')](function(_0x38326b){logger[_0xdffd('0xf')](_0xdffd('0x10'),_0x249eea,_0xdffd('0x11'));logger[_0xdffd('0x12')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x249eea,_0xdffd('0x11'),JSON['stringify'](_0x38326b));if(_0x38326b[_0xdffd('0x13')]){if(_0x38326b[_0xdffd('0x13')][_0xdffd('0x14')]===0x1f4){logger[_0xdffd('0x13')](_0xdffd('0x10'),_0x249eea,_0x38326b[_0xdffd('0x13')][_0xdffd('0x15')]);return _0x185d64(_0x38326b['error'][_0xdffd('0x15')]);}logger['error'](_0xdffd('0x10'),_0x249eea,_0x38326b[_0xdffd('0x13')][_0xdffd('0x15')]);return _0x3e896c(_0x38326b['error']['message']);}else{logger[_0xdffd('0xf')](_0xdffd('0x10'),_0x249eea,'request\x20sent');_0x3e896c(_0x38326b[_0xdffd('0x16')][_0xdffd('0x15')]);}})[_0xdffd('0x17')](function(_0x11bda5){logger[_0xdffd('0x13')](_0xdffd('0x10'),_0x249eea,_0x11bda5);_0x185d64(_0x11bda5);});});}exports[_0xdffd('0x18')]=function(_0x4e1c93){var _0x4e6227=this;return new Promise(function(_0x31e225,_0x39ab44){return db[_0xdffd('0x19')][_0xdffd('0x1a')]({'raw':_0x4e1c93[_0xdffd('0x1b')]?_0x4e1c93['options'][_0xdffd('0x1c')]===undefined?!![]:![]:!![],'where':_0x4e1c93[_0xdffd('0x1b')]?_0x4e1c93[_0xdffd('0x1b')][_0xdffd('0x1d')]||null:null,'attributes':_0x4e1c93[_0xdffd('0x1b')]?_0x4e1c93[_0xdffd('0x1b')][_0xdffd('0x1e')]||null:null,'limit':_0x4e1c93['options']?_0x4e1c93[_0xdffd('0x1b')][_0xdffd('0x1f')]||null:null,'include':_0x4e1c93[_0xdffd('0x1b')]?_0x4e1c93[_0xdffd('0x1b')][_0xdffd('0x20')]?_[_0xdffd('0x21')](_0x4e1c93[_0xdffd('0x1b')][_0xdffd('0x20')],function(_0x2a8375){return{'model':db[_0x2a8375[_0xdffd('0x22')]],'as':_0x2a8375['as'],'attributes':_0x2a8375[_0xdffd('0x1e')],'include':_0x2a8375['include']?_[_0xdffd('0x21')](_0x2a8375['include'],function(_0xc21758){return{'model':db[_0xc21758[_0xdffd('0x22')]],'as':_0xc21758['as'],'attributes':_0xc21758[_0xdffd('0x1e')],'include':_0xc21758[_0xdffd('0x20')]?_[_0xdffd('0x21')](_0xc21758[_0xdffd('0x20')],function(_0x24b510){return{'model':db[_0x24b510[_0xdffd('0x22')]],'as':_0x24b510['as'],'attributes':_0x24b510[_0xdffd('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x429e58){logger[_0xdffd('0xf')]('GetOpenchannelQueue',_0x4e1c93);logger[_0xdffd('0x12')](_0xdffd('0x18'),_0x4e1c93,JSON['stringify'](_0x429e58));_0x31e225(_0x429e58);})[_0xdffd('0x17')](function(_0x71731a){logger[_0xdffd('0x13')]('GetOpenchannelQueue',_0x71731a[_0xdffd('0x15')],_0x4e1c93);_0x39ab44(_0x4e6227[_0xdffd('0x13')](0x1f4,_0x71731a[_0xdffd('0x15')]));});});};exports['ShowOpenchannelQueue']=function(_0x2b4166){var _0xd0ffa8=this;return new Promise(function(_0x412f94,_0x119be1){return db['OpenchannelQueue'][_0xdffd('0x23')]({'raw':_0x2b4166[_0xdffd('0x1b')]?_0x2b4166[_0xdffd('0x1b')][_0xdffd('0x1c')]===undefined?!![]:![]:!![],'where':_0x2b4166[_0xdffd('0x1b')]?_0x2b4166[_0xdffd('0x1b')][_0xdffd('0x1d')]||null:null,'attributes':_0x2b4166[_0xdffd('0x1b')]?_0x2b4166[_0xdffd('0x1b')][_0xdffd('0x1e')]||null:null,'include':_0x2b4166[_0xdffd('0x1b')]?_0x2b4166[_0xdffd('0x1b')][_0xdffd('0x20')]?_[_0xdffd('0x21')](_0x2b4166[_0xdffd('0x1b')][_0xdffd('0x20')],function(_0x571081){return{'model':db[_0x571081['model']],'as':_0x571081['as'],'attributes':_0x571081[_0xdffd('0x1e')],'include':_0x571081[_0xdffd('0x20')]?_[_0xdffd('0x21')](_0x571081['include'],function(_0x551909){return{'model':db[_0x551909[_0xdffd('0x22')]],'as':_0x551909['as'],'attributes':_0x551909[_0xdffd('0x1e')],'include':_0x551909[_0xdffd('0x20')]?_[_0xdffd('0x21')](_0x551909[_0xdffd('0x20')],function(_0x381903){return{'model':db[_0x381903['model']],'as':_0x381903['as'],'attributes':_0x381903['attributes']};}):[]};}):[]};}):[]:[]})[_0xdffd('0xe')](function(_0x48f127){logger[_0xdffd('0xf')](_0xdffd('0x24'),_0x2b4166);logger[_0xdffd('0x12')]('ShowOpenchannelQueue',_0x2b4166,JSON[_0xdffd('0x25')](_0x48f127));_0x412f94(_0x48f127);})['catch'](function(_0x2e8ac8){logger[_0xdffd('0x13')]('ShowOpenchannelQueue',_0x2e8ac8[_0xdffd('0x15')],_0x2b4166);_0x119be1(_0xd0ffa8[_0xdffd('0x13')](0x1f4,_0x2e8ac8[_0xdffd('0x15')]));});});};
\ No newline at end of file
+var _0x2a40=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','redis','./openchannelQueue.socket','request','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','catch','ShowOpenchannelQueue','find','then','lodash'];(function(_0x3648cc,_0x20530c){var _0x33fdc3=function(_0x5f1c66){while(--_0x5f1c66){_0x3648cc['push'](_0x3648cc['shift']());}};_0x33fdc3(++_0x20530c);}(_0x2a40,0x1c7));var _0x02a4=function(_0x500c0,_0xdb6a03){_0x500c0=_0x500c0-0x0;var _0xdd146f=_0x2a40[_0x500c0];return _0xdd146f;};'use strict';var _=require(_0x02a4('0x0'));var util=require(_0x02a4('0x1'));var moment=require(_0x02a4('0x2'));var BPromise=require(_0x02a4('0x3'));var rs=require(_0x02a4('0x4'));var fs=require('fs');var Redis=require(_0x02a4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x02a4('0x6'));var logger=require(_0x02a4('0x7'))(_0x02a4('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x02a4('0x9')][_0x02a4('0xa')]({'port':0x232a});config[_0x02a4('0xb')]=_['defaults'](config[_0x02a4('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x02a4('0xc'))['register'](socket);function respondWithRpcPromise(_0x422239,_0x4b7aa3,_0x24338a){return new BPromise(function(_0x522297,_0x3bef75){return client[_0x02a4('0xd')](_0x422239,_0x24338a)['then'](function(_0xe073a9){logger[_0x02a4('0xe')](_0x02a4('0xf'),_0x4b7aa3,_0x02a4('0x10'));logger['debug'](_0x02a4('0x11'),_0x4b7aa3,'request\x20sent',JSON[_0x02a4('0x12')](_0xe073a9));if(_0xe073a9[_0x02a4('0x13')]){if(_0xe073a9['error']['code']===0x1f4){logger[_0x02a4('0x13')](_0x02a4('0xf'),_0x4b7aa3,_0xe073a9[_0x02a4('0x13')][_0x02a4('0x14')]);return _0x3bef75(_0xe073a9[_0x02a4('0x13')]['message']);}logger[_0x02a4('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x4b7aa3,_0xe073a9[_0x02a4('0x13')][_0x02a4('0x14')]);return _0x522297(_0xe073a9[_0x02a4('0x13')][_0x02a4('0x14')]);}else{logger[_0x02a4('0xe')](_0x02a4('0xf'),_0x4b7aa3,'request\x20sent');_0x522297(_0xe073a9[_0x02a4('0x15')]['message']);}})['catch'](function(_0x2e747e){logger['error'](_0x02a4('0xf'),_0x4b7aa3,_0x2e747e);_0x3bef75(_0x2e747e);});});}exports[_0x02a4('0x16')]=function(_0x14934b){var _0x50838f=this;return new Promise(function(_0x3e0824,_0x2af121){return db[_0x02a4('0x17')][_0x02a4('0x18')]({'raw':_0x14934b[_0x02a4('0x19')]?_0x14934b[_0x02a4('0x19')][_0x02a4('0x1a')]===undefined?!![]:![]:!![],'where':_0x14934b[_0x02a4('0x19')]?_0x14934b['options'][_0x02a4('0x1b')]||null:null,'attributes':_0x14934b[_0x02a4('0x19')]?_0x14934b[_0x02a4('0x19')][_0x02a4('0x1c')]||null:null,'limit':_0x14934b[_0x02a4('0x19')]?_0x14934b[_0x02a4('0x19')][_0x02a4('0x1d')]||null:null,'include':_0x14934b[_0x02a4('0x19')]?_0x14934b[_0x02a4('0x19')][_0x02a4('0x1e')]?_[_0x02a4('0x1f')](_0x14934b[_0x02a4('0x19')][_0x02a4('0x1e')],function(_0xdd2031){return{'model':db[_0xdd2031[_0x02a4('0x20')]],'as':_0xdd2031['as'],'attributes':_0xdd2031[_0x02a4('0x1c')],'include':_0xdd2031[_0x02a4('0x1e')]?_[_0x02a4('0x1f')](_0xdd2031[_0x02a4('0x1e')],function(_0x210d91){return{'model':db[_0x210d91['model']],'as':_0x210d91['as'],'attributes':_0x210d91[_0x02a4('0x1c')],'include':_0x210d91[_0x02a4('0x1e')]?_[_0x02a4('0x1f')](_0x210d91[_0x02a4('0x1e')],function(_0xd80bfe){return{'model':db[_0xd80bfe[_0x02a4('0x20')]],'as':_0xd80bfe['as'],'attributes':_0xd80bfe[_0x02a4('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x17c3d4){logger['info'](_0x02a4('0x16'),_0x14934b);logger[_0x02a4('0x21')](_0x02a4('0x16'),_0x14934b,JSON[_0x02a4('0x12')](_0x17c3d4));_0x3e0824(_0x17c3d4);})[_0x02a4('0x22')](function(_0x5b4569){logger[_0x02a4('0x13')](_0x02a4('0x16'),_0x5b4569['message'],_0x14934b);_0x2af121(_0x50838f['error'](0x1f4,_0x5b4569['message']));});});};exports[_0x02a4('0x23')]=function(_0x520391){var _0x1f0697=this;return new Promise(function(_0x342022,_0x383874){return db[_0x02a4('0x17')][_0x02a4('0x24')]({'raw':_0x520391[_0x02a4('0x19')]?_0x520391[_0x02a4('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x520391[_0x02a4('0x19')]?_0x520391[_0x02a4('0x19')][_0x02a4('0x1b')]||null:null,'attributes':_0x520391[_0x02a4('0x19')]?_0x520391['options'][_0x02a4('0x1c')]||null:null,'include':_0x520391['options']?_0x520391[_0x02a4('0x19')][_0x02a4('0x1e')]?_['map'](_0x520391[_0x02a4('0x19')][_0x02a4('0x1e')],function(_0x24bec3){return{'model':db[_0x24bec3['model']],'as':_0x24bec3['as'],'attributes':_0x24bec3[_0x02a4('0x1c')],'include':_0x24bec3[_0x02a4('0x1e')]?_[_0x02a4('0x1f')](_0x24bec3[_0x02a4('0x1e')],function(_0x55339b){return{'model':db[_0x55339b[_0x02a4('0x20')]],'as':_0x55339b['as'],'attributes':_0x55339b['attributes'],'include':_0x55339b[_0x02a4('0x1e')]?_[_0x02a4('0x1f')](_0x55339b['include'],function(_0x533e72){return{'model':db[_0x533e72[_0x02a4('0x20')]],'as':_0x533e72['as'],'attributes':_0x533e72[_0x02a4('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x02a4('0x25')](function(_0x1e58fe){logger['info'](_0x02a4('0x23'),_0x520391);logger['debug'](_0x02a4('0x23'),_0x520391,JSON[_0x02a4('0x12')](_0x1e58fe));_0x342022(_0x1e58fe);})[_0x02a4('0x22')](function(_0x2993c0){logger[_0x02a4('0x13')](_0x02a4('0x23'),_0x2993c0['message'],_0x520391);_0x383874(_0x1f0697['error'](0x1f4,_0x2993c0['message']));});});};
\ No newline at end of file
index 3d3bc2e..cf34f4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5b5=['length','openchannelQueue:','./openchannelQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x5027b1,_0x1409a5){var _0x4a46cf=function(_0x121920){while(--_0x121920){_0x5027b1['push'](_0x5027b1['shift']());}};_0x4a46cf(++_0x1409a5);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x4c0622,_0x5dacaf){_0x4c0622=_0x4c0622-0x0;var _0x1799d8=_0xe5b5[_0x4c0622];return _0x1799d8;};'use strict';var OpenchannelQueueEvents=require(_0x5e5b('0x0'));var events=[_0x5e5b('0x1'),_0x5e5b('0x2'),_0x5e5b('0x3')];function createListener(_0x208070,_0x4263e){return function(_0x33e813){_0x4263e[_0x5e5b('0x4')](_0x208070,_0x33e813);};}function removeListener(_0xf20c6a,_0x20a50c){return function(){OpenchannelQueueEvents[_0x5e5b('0x5')](_0xf20c6a,_0x20a50c);};}exports[_0x5e5b('0x6')]=function(_0xf1fbe2){for(var _0x11e0e0=0x0,_0x545eb3=events[_0x5e5b('0x7')];_0x11e0e0<_0x545eb3;_0x11e0e0++){var _0xe089b1=events[_0x11e0e0];var _0xcbd478=createListener(_0x5e5b('0x8')+_0xe089b1,_0xf1fbe2);OpenchannelQueueEvents['on'](_0xe089b1,_0xcbd478);}};
\ No newline at end of file
+var _0x42c0=['register','./openchannelQueue.events','emit'];(function(_0x5c63f5,_0x3bef9e){var _0x5d757e=function(_0x24435d){while(--_0x24435d){_0x5c63f5['push'](_0x5c63f5['shift']());}};_0x5d757e(++_0x3bef9e);}(_0x42c0,0x1cf));var _0x042c=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x42c0[_0x27af45];return _0x18df21;};'use strict';var OpenchannelQueueEvents=require(_0x042c('0x0'));var events=['save','remove','update'];function createListener(_0x5a9b38,_0x3f3b4a){return function(_0x4e4b2e){_0x3f3b4a[_0x042c('0x1')](_0x5a9b38,_0x4e4b2e);};}function removeListener(_0x5e473f,_0x467edb){return function(){OpenchannelQueueEvents['removeListener'](_0x5e473f,_0x467edb);};}exports[_0x042c('0x2')]=function(_0x301dc8){for(var _0x3e9d32=0x0,_0xc6e34a=events['length'];_0x3e9d32<_0xc6e34a;_0x3e9d32++){var _0x17e3c5=events[_0x3e9d32];var _0x3420a7=createListener('openchannelQueue:'+_0x17e3c5,_0x301dc8);OpenchannelQueueEvents['on'](_0x17e3c5,_0x3420a7);}};
\ No newline at end of file
index edf1d04..c2200af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x501b=['/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index'];(function(_0x201920,_0x23a42e){var _0x11ca83=function(_0x14cde0){while(--_0x14cde0){_0x201920['push'](_0x201920['shift']());}};_0x11ca83(++_0x23a42e);}(_0x501b,0x13e));var _0xb501=function(_0x22204c,_0x53dbde){_0x22204c=_0x22204c-0x0;var _0x3bb3c3=_0x501b[_0x22204c];return _0x3bb3c3;};'use strict';var multer=require(_0xb501('0x0'));var util=require(_0xb501('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb501('0x2'));var router=express[_0xb501('0x3')]();var fs_extra=require(_0xb501('0x4'));var auth=require(_0xb501('0x5'));var interaction=require(_0xb501('0x6'));var config=require(_0xb501('0x7'));var controller=require(_0xb501('0x8'));router[_0xb501('0x9')]('/',auth[_0xb501('0xa')](),controller[_0xb501('0xb')]);router[_0xb501('0x9')](_0xb501('0xc'),auth[_0xb501('0xa')](),controller[_0xb501('0xd')]);router[_0xb501('0x9')](_0xb501('0xe'),auth['isAuthenticated'](),controller[_0xb501('0xf')]);router[_0xb501('0x10')]('/',auth[_0xb501('0xa')](),controller['create']);router[_0xb501('0x11')](_0xb501('0xe'),auth['isAuthenticated'](),controller[_0xb501('0x12')]);router[_0xb501('0x13')](_0xb501('0xe'),auth[_0xb501('0xa')](),controller[_0xb501('0x14')]);module[_0xb501('0x15')]=router;
\ No newline at end of file
+var _0xb84e=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','describe','show','post','create','/:id','update','delete','destroy','multer','util','path'];(function(_0x97688b,_0x24a0aa){var _0x4e0ca4=function(_0x1820e3){while(--_0x1820e3){_0x97688b['push'](_0x97688b['shift']());}};_0x4e0ca4(++_0x24a0aa);}(_0xb84e,0x165));var _0xeb84=function(_0x35485a,_0x91cdd4){_0x35485a=_0x35485a-0x0;var _0x5148e6=_0xb84e[_0x35485a];return _0x5148e6;};'use strict';var multer=require(_0xeb84('0x0'));var util=require(_0xeb84('0x1'));var path=require(_0xeb84('0x2'));var timeout=require(_0xeb84('0x3'));var express=require('express');var router=express[_0xeb84('0x4')]();var fs_extra=require(_0xeb84('0x5'));var auth=require(_0xeb84('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xeb84('0x7'));var controller=require(_0xeb84('0x8'));router[_0xeb84('0x9')]('/',auth[_0xeb84('0xa')](),controller[_0xeb84('0xb')]);router[_0xeb84('0x9')]('/describe',auth[_0xeb84('0xa')](),controller[_0xeb84('0xc')]);router[_0xeb84('0x9')]('/:id',auth[_0xeb84('0xa')](),controller[_0xeb84('0xd')]);router[_0xeb84('0xe')]('/',auth['isAuthenticated'](),controller[_0xeb84('0xf')]);router['put'](_0xeb84('0x10'),auth[_0xeb84('0xa')](),controller[_0xeb84('0x11')]);router[_0xeb84('0x12')](_0xeb84('0x10'),auth[_0xeb84('0xa')](),controller[_0xeb84('0x13')]);module['exports']=router;
\ No newline at end of file
index 330f297..76165d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb070=['STRING','DATE','moment','sequelize','exports'];(function(_0x59f0dc,_0x1e2497){var _0x5b5445=function(_0x57ca91){while(--_0x57ca91){_0x59f0dc['push'](_0x59f0dc['shift']());}};_0x5b5445(++_0x1e2497);}(_0xb070,0x174));var _0x0b07=function(_0x25d68d,_0x69adf9){_0x25d68d=_0x25d68d-0x0;var _0x3f5c89=_0xb070[_0x25d68d];return _0x3f5c89;};'use strict';var moment=require(_0x0b07('0x0'));var Sequelize=require(_0x0b07('0x1'));module[_0x0b07('0x2')]={'uniqueid':{'type':Sequelize[_0x0b07('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x0b07('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x0b07('0x4')]},'acceptAt':{'type':Sequelize[_0x0b07('0x4')]},'exitAt':{'type':Sequelize[_0x0b07('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x3123=['sequelize','STRING','DATE','moment'];(function(_0x578444,_0x239e6c){var _0x154c77=function(_0x475f11){while(--_0x475f11){_0x578444['push'](_0x578444['shift']());}};_0x154c77(++_0x239e6c);}(_0x3123,0x1f3));var _0x3312=function(_0x3b9a90,_0x42e652){_0x3b9a90=_0x3b9a90-0x0;var _0x5b765d=_0x3123[_0x3b9a90];return _0x5b765d;};'use strict';var moment=require(_0x3312('0x0'));var Sequelize=require(_0x3312('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x3312('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x3312('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x3312('0x3')]},'acceptAt':{'type':Sequelize[_0x3312('0x3')]},'exitAt':{'type':Sequelize[_0x3312('0x3')]},'reason':{'type':Sequelize[_0x3312('0x2')]}};
\ No newline at end of file
index 133034e..d2cf565 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x289d=['lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','order','sort','filters','pick','merge','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','fs-extra'];(function(_0x591db7,_0x150445){var _0x4ad760=function(_0x5dd24e){while(--_0x5dd24e){_0x591db7['push'](_0x591db7['shift']());}};_0x4ad760(++_0x150445);}(_0x289d,0x1a2));var _0xd289=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x289d[_0x3ce3c];return _0x55a2c9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd289('0x0'));var zipdir=require(_0xd289('0x1'));var jsonpatch=require(_0xd289('0x2'));var rp=require(_0xd289('0x3'));var moment=require(_0xd289('0x4'));var BPromise=require(_0xd289('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xd289('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd289('0x7'));var _=require(_0xd289('0x8'));var squel=require(_0xd289('0x9'));var crypto=require('crypto');var jsforce=require(_0xd289('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd289('0xb'));var Papa=require('papaparse');var Redis=require(_0xd289('0xc'));var authService=require(_0xd289('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xd289('0xe'));var hardwareService=require(_0xd289('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0xd289('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0xd289('0x11'));var db=require(_0xd289('0x12'))['db'];function respondWithStatusCode(_0x188791,_0x481f9b){_0x481f9b=_0x481f9b||0xcc;return function(_0x10a7be){if(_0x10a7be){return _0x188791['sendStatus'](_0x481f9b);}return _0x188791[_0xd289('0x13')](_0x481f9b)[_0xd289('0x14')]();};}function respondWithResult(_0x48ee4e,_0xa0f6fe){_0xa0f6fe=_0xa0f6fe||0xc8;return function(_0x113b4d){if(_0x113b4d){return _0x48ee4e[_0xd289('0x13')](_0xa0f6fe)[_0xd289('0x15')](_0x113b4d);}};}function respondWithFilteredResult(_0x5c8f94,_0x4cc167){return function(_0x37fb6d){if(_0x37fb6d){var _0xe87a2c=typeof _0x4cc167['offset']===_0xd289('0x16')&&typeof _0x4cc167[_0xd289('0x17')]===_0xd289('0x16');var _0x1c2029=_0x37fb6d[_0xd289('0x18')];var _0xe9aa10=_0xe87a2c?0x0:_0x4cc167['offset'];var _0x18dfd3=_0xe87a2c?_0x37fb6d['count']:_0x4cc167[_0xd289('0x19')]+_0x4cc167[_0xd289('0x17')];var _0x17849f;if(_0x18dfd3>=_0x1c2029){_0x18dfd3=_0x1c2029;_0x17849f=0xc8;}else{_0x17849f=0xce;}_0x5c8f94['status'](_0x17849f);return _0x5c8f94[_0xd289('0x1a')](_0xd289('0x1b'),_0xe9aa10+'-'+_0x18dfd3+'/'+_0x1c2029)[_0xd289('0x15')](_0x37fb6d);}return null;};}function patchUpdates(_0x5d5ff0){return function(_0x4d6f28){try{jsonpatch[_0xd289('0x1c')](_0x4d6f28,_0x5d5ff0,!![]);}catch(_0x5980e0){return BPromise[_0xd289('0x1d')](_0x5980e0);}return _0x4d6f28[_0xd289('0x1e')]();};}function saveUpdates(_0x338327,_0x1adfe2){return function(_0xe1f6a7){if(_0xe1f6a7){return _0xe1f6a7[_0xd289('0x1f')](_0x338327)[_0xd289('0x20')](function(_0x44dcd0){return _0x44dcd0;});}return null;};}function removeEntity(_0x34113b,_0x47ceed){return function(_0x5b5229){if(_0x5b5229){return _0x5b5229[_0xd289('0x21')]()[_0xd289('0x20')](function(){_0x34113b[_0xd289('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc78110,_0x26b29e){return function(_0x37bb9e){if(!_0x37bb9e){_0xc78110[_0xd289('0x22')](0x194);}return _0x37bb9e;};}function handleError(_0x1ebbeb,_0x2b60bf){_0x2b60bf=_0x2b60bf||0x1f4;return function(_0x23d4b5){logger[_0xd289('0x23')](_0x23d4b5[_0xd289('0x24')]);if(_0x23d4b5['name']){delete _0x23d4b5[_0xd289('0x25')];}_0x1ebbeb[_0xd289('0x13')](_0x2b60bf)['send'](_0x23d4b5);};}exports[_0xd289('0x26')]=function(_0xb13d76,_0x36492d){var _0x4f2a3a={},_0x670cbf={},_0x3a8bb0={'count':0x0,'rows':[]};var _0x1a0f2d=_[_0xd289('0x27')](db[_0xd289('0x28')][_0xd289('0x29')],function(_0x2a07fe){return{'name':_0x2a07fe[_0xd289('0x2a')],'type':_0x2a07fe[_0xd289('0x2b')]['key']};});_0x670cbf[_0xd289('0x2c')]=_[_0xd289('0x27')](_0x1a0f2d,'name');_0x670cbf[_0xd289('0x2d')]=_[_0xd289('0x2e')](_0xb13d76['query']);_0x670cbf['filters']=_[_0xd289('0x2f')](_0x670cbf[_0xd289('0x2c')],_0x670cbf[_0xd289('0x2d')]);_0x4f2a3a[_0xd289('0x30')]=_['intersection'](_0x670cbf[_0xd289('0x2c')],qs[_0xd289('0x31')](_0xb13d76[_0xd289('0x2d')][_0xd289('0x31')]));_0x4f2a3a[_0xd289('0x30')]=_0x4f2a3a[_0xd289('0x30')][_0xd289('0x32')]?_0x4f2a3a[_0xd289('0x30')]:_0x670cbf['model'];if(!_0xb13d76['query']['hasOwnProperty']('nolimit')){_0x4f2a3a[_0xd289('0x17')]=qs[_0xd289('0x17')](_0xb13d76[_0xd289('0x2d')][_0xd289('0x17')]);_0x4f2a3a[_0xd289('0x19')]=qs[_0xd289('0x19')](_0xb13d76[_0xd289('0x2d')][_0xd289('0x19')]);}_0x4f2a3a[_0xd289('0x33')]=qs[_0xd289('0x34')](_0xb13d76[_0xd289('0x2d')][_0xd289('0x34')]);_0x4f2a3a['where']=qs[_0xd289('0x35')](_[_0xd289('0x36')](_0xb13d76[_0xd289('0x2d')],_0x670cbf[_0xd289('0x35')]),_0x1a0f2d);if(_0xb13d76[_0xd289('0x2d')]['filter']){_0x4f2a3a['where']=_[_0xd289('0x37')](_0x4f2a3a[_0xd289('0x38')],{'$or':_['map'](_0x1a0f2d,function(_0x3c286c){if(_0x3c286c[_0xd289('0x2b')]!==_0xd289('0x39')){var _0x4d623f={};_0x4d623f[_0x3c286c['name']]={'$like':'%'+_0xb13d76[_0xd289('0x2d')][_0xd289('0x3a')]+'%'};return _0x4d623f;}})});}_0x4f2a3a=_[_0xd289('0x37')]({},_0x4f2a3a,_0xb13d76[_0xd289('0x3b')]);var _0x43b50a={'where':_0x4f2a3a[_0xd289('0x38')]};return db[_0xd289('0x28')][_0xd289('0x18')](_0x43b50a)[_0xd289('0x20')](function(_0x44f698){_0x3a8bb0[_0xd289('0x18')]=_0x44f698;if(_0xb13d76[_0xd289('0x2d')][_0xd289('0x3c')]){_0x4f2a3a[_0xd289('0x3d')]=[{'all':!![]}];}return db[_0xd289('0x28')][_0xd289('0x3e')](_0x4f2a3a);})[_0xd289('0x20')](function(_0x473d3c){_0x3a8bb0[_0xd289('0x3f')]=_0x473d3c;return _0x3a8bb0;})[_0xd289('0x20')](respondWithFilteredResult(_0x36492d,_0x4f2a3a))['catch'](handleError(_0x36492d,null));};exports[_0xd289('0x40')]=function(_0x392023,_0x3c7fc7){var _0x1d606b={'raw':!![],'where':{'id':_0x392023[_0xd289('0x41')]['id']}},_0x20f209={};_0x20f209['model']=_[_0xd289('0x2e')](db[_0xd289('0x28')][_0xd289('0x29')]);_0x20f209[_0xd289('0x2d')]=_['keys'](_0x392023['query']);_0x20f209[_0xd289('0x35')]=_['intersection'](_0x20f209['model'],_0x20f209['query']);_0x1d606b['attributes']=_[_0xd289('0x2f')](_0x20f209['model'],qs[_0xd289('0x31')](_0x392023[_0xd289('0x2d')]['fields']));_0x1d606b[_0xd289('0x30')]=_0x1d606b[_0xd289('0x30')][_0xd289('0x32')]?_0x1d606b[_0xd289('0x30')]:_0x20f209[_0xd289('0x2c')];if(_0x392023[_0xd289('0x2d')][_0xd289('0x3c')]){_0x1d606b[_0xd289('0x3d')]=[{'all':!![]}];}_0x1d606b=_['merge']({},_0x1d606b,_0x392023[_0xd289('0x3b')]);return db[_0xd289('0x28')][_0xd289('0x42')](_0x1d606b)['then'](handleEntityNotFound(_0x3c7fc7,null))[_0xd289('0x20')](respondWithResult(_0x3c7fc7,null))[_0xd289('0x43')](handleError(_0x3c7fc7,null));};exports[_0xd289('0x44')]=function(_0x470737,_0x5c5373){return db['OpenchannelQueueReport'][_0xd289('0x44')](_0x470737[_0xd289('0x45')],{})[_0xd289('0x20')](respondWithResult(_0x5c5373,0xc9))[_0xd289('0x43')](handleError(_0x5c5373,null));};exports[_0xd289('0x1f')]=function(_0x38fe6b,_0x512dc2){if(_0x38fe6b['body']['id']){delete _0x38fe6b['body']['id'];}return db[_0xd289('0x28')][_0xd289('0x42')]({'where':{'id':_0x38fe6b['params']['id']}})[_0xd289('0x20')](handleEntityNotFound(_0x512dc2,null))[_0xd289('0x20')](saveUpdates(_0x38fe6b[_0xd289('0x45')],null))[_0xd289('0x20')](respondWithResult(_0x512dc2,null))[_0xd289('0x43')](handleError(_0x512dc2,null));};exports['destroy']=function(_0x2bcf51,_0x5dbc6c){return db[_0xd289('0x28')][_0xd289('0x42')]({'where':{'id':_0x2bcf51[_0xd289('0x41')]['id']}})[_0xd289('0x20')](handleEntityNotFound(_0x5dbc6c,null))['then'](removeEntity(_0x5dbc6c,null))[_0xd289('0x43')](handleError(_0x5dbc6c,null));};exports[_0xd289('0x46')]=function(_0x44a822,_0x55e929){return db[_0xd289('0x28')]['describe']()['then'](respondWithResult(_0x55e929,null))[_0xd289('0x43')](handleError(_0x55e929,null));};
\ No newline at end of file
+var _0x95e1=['includeAll','include','rows','catch','show','params','find','create','body','update','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','json','offset','undefined','count','limit','set','Content-Range','save','then','status','end','sendStatus','error','stack','name','send','map','OpenchannelQueueReport','rawAttributes','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','filters','pick','where','filter','merge','options'];(function(_0x2be8a8,_0xb7ddc){var _0x50845f=function(_0x5302f9){while(--_0x5302f9){_0x2be8a8['push'](_0x2be8a8['shift']());}};_0x50845f(++_0xb7ddc);}(_0x95e1,0x183));var _0x195e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x95e1[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x195e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x195e('0x1'));var jsonpatch=require(_0x195e('0x2'));var rp=require(_0x195e('0x3'));var moment=require(_0x195e('0x4'));var BPromise=require(_0x195e('0x5'));var Mustache=require(_0x195e('0x6'));var util=require(_0x195e('0x7'));var path=require(_0x195e('0x8'));var sox=require(_0x195e('0x9'));var csv=require('to-csv');var ejs=require(_0x195e('0xa'));var fs=require('fs');var fs_extra=require(_0x195e('0xb'));var _=require(_0x195e('0xc'));var squel=require(_0x195e('0xd'));var crypto=require(_0x195e('0xe'));var jsforce=require(_0x195e('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x195e('0x10'));var Papa=require('papaparse');var Redis=require(_0x195e('0x11'));var authService=require(_0x195e('0x12'));var qs=require(_0x195e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x195e('0x14'));var logger=require(_0x195e('0x15'))('api');var utils=require(_0x195e('0x16'));var config=require(_0x195e('0x17'));var licenseUtil=require(_0x195e('0x18'));var db=require(_0x195e('0x19'))['db'];function respondWithStatusCode(_0xd1d758,_0x2d8321){_0x2d8321=_0x2d8321||0xcc;return function(_0x17f8ba){if(_0x17f8ba){return _0xd1d758['sendStatus'](_0x2d8321);}return _0xd1d758['status'](_0x2d8321)['end']();};}function respondWithResult(_0x562124,_0x26df61){_0x26df61=_0x26df61||0xc8;return function(_0x2ce7aa){if(_0x2ce7aa){return _0x562124['status'](_0x26df61)[_0x195e('0x1a')](_0x2ce7aa);}};}function respondWithFilteredResult(_0x89f1f0,_0x31782d){return function(_0x26120c){if(_0x26120c){var _0x484633=typeof _0x31782d[_0x195e('0x1b')]===_0x195e('0x1c')&&typeof _0x31782d['limit']===_0x195e('0x1c');var _0x483329=_0x26120c[_0x195e('0x1d')];var _0x2012ee=_0x484633?0x0:_0x31782d[_0x195e('0x1b')];var _0x409a0f=_0x484633?_0x26120c[_0x195e('0x1d')]:_0x31782d[_0x195e('0x1b')]+_0x31782d[_0x195e('0x1e')];var _0x10f7ee;if(_0x409a0f>=_0x483329){_0x409a0f=_0x483329;_0x10f7ee=0xc8;}else{_0x10f7ee=0xce;}_0x89f1f0['status'](_0x10f7ee);return _0x89f1f0[_0x195e('0x1f')](_0x195e('0x20'),_0x2012ee+'-'+_0x409a0f+'/'+_0x483329)[_0x195e('0x1a')](_0x26120c);}return null;};}function patchUpdates(_0xabb958){return function(_0x31a202){try{jsonpatch['apply'](_0x31a202,_0xabb958,!![]);}catch(_0x6ffc7a){return BPromise['reject'](_0x6ffc7a);}return _0x31a202[_0x195e('0x21')]();};}function saveUpdates(_0x31c637,_0x40c454){return function(_0x411715){if(_0x411715){return _0x411715['update'](_0x31c637)[_0x195e('0x22')](function(_0x39a747){return _0x39a747;});}return null;};}function removeEntity(_0x352e54,_0x482099){return function(_0x195796){if(_0x195796){return _0x195796['destroy']()['then'](function(){_0x352e54[_0x195e('0x23')](0xcc)[_0x195e('0x24')]();});}};}function handleEntityNotFound(_0x41c8d7,_0x4a1db0){return function(_0x569ed2){if(!_0x569ed2){_0x41c8d7[_0x195e('0x25')](0x194);}return _0x569ed2;};}function handleError(_0x363c5d,_0x4590e6){_0x4590e6=_0x4590e6||0x1f4;return function(_0x315d91){logger[_0x195e('0x26')](_0x315d91[_0x195e('0x27')]);if(_0x315d91[_0x195e('0x28')]){delete _0x315d91['name'];}_0x363c5d['status'](_0x4590e6)[_0x195e('0x29')](_0x315d91);};}exports['index']=function(_0xdbedff,_0x4efd91){var _0x1647b4={},_0x168c42={},_0x1fb3f3={'count':0x0,'rows':[]};var _0xc5bb9c=_[_0x195e('0x2a')](db[_0x195e('0x2b')][_0x195e('0x2c')],function(_0x479895){return{'name':_0x479895['fieldName'],'type':_0x479895[_0x195e('0x2d')][_0x195e('0x2e')]};});_0x168c42['model']=_[_0x195e('0x2a')](_0xc5bb9c,'name');_0x168c42[_0x195e('0x2f')]=_[_0x195e('0x30')](_0xdbedff[_0x195e('0x2f')]);_0x168c42['filters']=_[_0x195e('0x31')](_0x168c42['model'],_0x168c42[_0x195e('0x2f')]);_0x1647b4[_0x195e('0x32')]=_[_0x195e('0x31')](_0x168c42[_0x195e('0x33')],qs[_0x195e('0x34')](_0xdbedff['query'][_0x195e('0x34')]));_0x1647b4[_0x195e('0x32')]=_0x1647b4[_0x195e('0x32')][_0x195e('0x35')]?_0x1647b4[_0x195e('0x32')]:_0x168c42[_0x195e('0x33')];if(!_0xdbedff[_0x195e('0x2f')][_0x195e('0x36')]('nolimit')){_0x1647b4[_0x195e('0x1e')]=qs['limit'](_0xdbedff[_0x195e('0x2f')][_0x195e('0x1e')]);_0x1647b4[_0x195e('0x1b')]=qs[_0x195e('0x1b')](_0xdbedff['query'][_0x195e('0x1b')]);}_0x1647b4[_0x195e('0x37')]=qs['sort'](_0xdbedff[_0x195e('0x2f')][_0x195e('0x38')]);_0x1647b4['where']=qs[_0x195e('0x39')](_[_0x195e('0x3a')](_0xdbedff[_0x195e('0x2f')],_0x168c42['filters']),_0xc5bb9c);if(_0xdbedff[_0x195e('0x2f')]['filter']){_0x1647b4[_0x195e('0x3b')]=_['merge'](_0x1647b4[_0x195e('0x3b')],{'$or':_['map'](_0xc5bb9c,function(_0x3e3982){if(_0x3e3982[_0x195e('0x2d')]!=='VIRTUAL'){var _0x9be974={};_0x9be974[_0x3e3982[_0x195e('0x28')]]={'$like':'%'+_0xdbedff['query'][_0x195e('0x3c')]+'%'};return _0x9be974;}})});}_0x1647b4=_[_0x195e('0x3d')]({},_0x1647b4,_0xdbedff[_0x195e('0x3e')]);var _0x48eec5={'where':_0x1647b4['where']};return db[_0x195e('0x2b')]['count'](_0x48eec5)[_0x195e('0x22')](function(_0x2c5ae0){_0x1fb3f3[_0x195e('0x1d')]=_0x2c5ae0;if(_0xdbedff['query'][_0x195e('0x3f')]){_0x1647b4[_0x195e('0x40')]=[{'all':!![]}];}return db[_0x195e('0x2b')]['findAll'](_0x1647b4);})[_0x195e('0x22')](function(_0x2615eb){_0x1fb3f3[_0x195e('0x41')]=_0x2615eb;return _0x1fb3f3;})[_0x195e('0x22')](respondWithFilteredResult(_0x4efd91,_0x1647b4))[_0x195e('0x42')](handleError(_0x4efd91,null));};exports[_0x195e('0x43')]=function(_0x26df2c,_0x3139b2){var _0x367f3c={'raw':!![],'where':{'id':_0x26df2c[_0x195e('0x44')]['id']}},_0x46cc88={};_0x46cc88['model']=_[_0x195e('0x30')](db[_0x195e('0x2b')]['rawAttributes']);_0x46cc88[_0x195e('0x2f')]=_[_0x195e('0x30')](_0x26df2c['query']);_0x46cc88[_0x195e('0x39')]=_[_0x195e('0x31')](_0x46cc88['model'],_0x46cc88[_0x195e('0x2f')]);_0x367f3c[_0x195e('0x32')]=_['intersection'](_0x46cc88['model'],qs[_0x195e('0x34')](_0x26df2c[_0x195e('0x2f')][_0x195e('0x34')]));_0x367f3c['attributes']=_0x367f3c[_0x195e('0x32')]['length']?_0x367f3c['attributes']:_0x46cc88['model'];if(_0x26df2c[_0x195e('0x2f')][_0x195e('0x3f')]){_0x367f3c[_0x195e('0x40')]=[{'all':!![]}];}_0x367f3c=_[_0x195e('0x3d')]({},_0x367f3c,_0x26df2c['options']);return db[_0x195e('0x2b')][_0x195e('0x45')](_0x367f3c)[_0x195e('0x22')](handleEntityNotFound(_0x3139b2,null))[_0x195e('0x22')](respondWithResult(_0x3139b2,null))['catch'](handleError(_0x3139b2,null));};exports[_0x195e('0x46')]=function(_0x2c5749,_0x5f3327){return db[_0x195e('0x2b')][_0x195e('0x46')](_0x2c5749[_0x195e('0x47')],{})[_0x195e('0x22')](respondWithResult(_0x5f3327,0xc9))[_0x195e('0x42')](handleError(_0x5f3327,null));};exports[_0x195e('0x48')]=function(_0x31d90a,_0x5d38d3){if(_0x31d90a['body']['id']){delete _0x31d90a[_0x195e('0x47')]['id'];}return db[_0x195e('0x2b')][_0x195e('0x45')]({'where':{'id':_0x31d90a[_0x195e('0x44')]['id']}})['then'](handleEntityNotFound(_0x5d38d3,null))['then'](saveUpdates(_0x31d90a[_0x195e('0x47')],null))[_0x195e('0x22')](respondWithResult(_0x5d38d3,null))['catch'](handleError(_0x5d38d3,null));};exports[_0x195e('0x49')]=function(_0x12bba7,_0xc8d9f6){return db[_0x195e('0x2b')]['find']({'where':{'id':_0x12bba7[_0x195e('0x44')]['id']}})[_0x195e('0x22')](handleEntityNotFound(_0xc8d9f6,null))[_0x195e('0x22')](removeEntity(_0xc8d9f6,null))[_0x195e('0x42')](handleError(_0xc8d9f6,null));};exports[_0x195e('0x4a')]=function(_0x2eab0c,_0x53b954){return db[_0x195e('0x2b')][_0x195e('0x4a')]()[_0x195e('0x22')](respondWithResult(_0x53b954,null))['catch'](handleError(_0x53b954,null));};
\ No newline at end of file
index 4ebbf0f..6a7e5e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x370200,_0x4b2bd4){var _0xb7961b=function(_0x3b34a8){while(--_0x3b34a8){_0x370200['push'](_0x370200['shift']());}};_0xb7961b(++_0x4b2bd4);}(_0x7a54,0x106));var _0x47a5=function(_0x20ecc4,_0x6cd866){_0x20ecc4=_0x20ecc4-0x0;var _0x1bcfea=_0x7a54[_0x20ecc4];return _0x1bcfea;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0xafd652,_0x2780ee){var _0x217596=function(_0x78dcd8){while(--_0x78dcd8){_0xafd652['push'](_0xafd652['shift']());}};_0x217596(++_0x2780ee);}(_0xe14b,0x93));var _0xbe14=function(_0x35f843,_0x414c38){_0x35f843=_0x35f843-0x0;var _0x1dddae=_0xe14b[_0x35f843];return _0x1dddae;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 15dafdf..8346aea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf108=['options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','where','attributes','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','body'];(function(_0x59759b,_0x45e575){var _0x486222=function(_0x2bdbf2){while(--_0x2bdbf2){_0x59759b['push'](_0x59759b['shift']());}};_0x486222(++_0x45e575);}(_0xf108,0x1d9));var _0x8f10=function(_0x4dc6b5,_0x491a0e){_0x4dc6b5=_0x4dc6b5-0x0;var _0x3cf24d=_0xf108[_0x4dc6b5];return _0x3cf24d;};'use strict';var _=require(_0x8f10('0x0'));var util=require('util');var moment=require(_0x8f10('0x1'));var BPromise=require(_0x8f10('0x2'));var rs=require(_0x8f10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8f10('0x4'))(_0x8f10('0x5'));var config=require(_0x8f10('0x6'));var jayson=require(_0x8f10('0x7'));var client=jayson[_0x8f10('0x8')][_0x8f10('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x212efc,_0x38b45f,_0x9cf8af){return new BPromise(function(_0x22e5df,_0x3a5d06){return client['request'](_0x212efc,_0x9cf8af)[_0x8f10('0xa')](function(_0x1787d2){logger[_0x8f10('0xb')](_0x8f10('0xc'),_0x38b45f,_0x8f10('0xd'));logger[_0x8f10('0xe')](_0x8f10('0xf'),_0x38b45f,_0x8f10('0xd'),JSON[_0x8f10('0x10')](_0x1787d2));if(_0x1787d2[_0x8f10('0x11')]){if(_0x1787d2[_0x8f10('0x11')][_0x8f10('0x12')]===0x1f4){logger[_0x8f10('0x11')](_0x8f10('0xc'),_0x38b45f,_0x1787d2[_0x8f10('0x11')]['message']);return _0x3a5d06(_0x1787d2['error'][_0x8f10('0x13')]);}logger[_0x8f10('0x11')](_0x8f10('0xc'),_0x38b45f,_0x1787d2[_0x8f10('0x11')][_0x8f10('0x13')]);return _0x22e5df(_0x1787d2[_0x8f10('0x11')][_0x8f10('0x13')]);}else{logger[_0x8f10('0xb')](_0x8f10('0xc'),_0x38b45f,'request\x20sent');_0x22e5df(_0x1787d2[_0x8f10('0x14')][_0x8f10('0x13')]);}})[_0x8f10('0x15')](function(_0x52aafc){logger[_0x8f10('0x11')](_0x8f10('0xc'),_0x38b45f,_0x52aafc);_0x3a5d06(_0x52aafc);});});}exports['CreateOpenchannelQueueReport']=function(_0xdfd335){var _0x468bf3=this;return new Promise(function(_0x255e75,_0x3003ea){return db['OpenchannelQueueReport']['create'](_0xdfd335[_0x8f10('0x16')],{'raw':_0xdfd335[_0x8f10('0x17')]?_0xdfd335[_0x8f10('0x17')][_0x8f10('0x18')]===undefined?!![]:![]:!![]})[_0x8f10('0xa')](function(_0xfdb66e){logger[_0x8f10('0xb')](_0x8f10('0x19'),_0xdfd335);logger[_0x8f10('0xe')](_0x8f10('0x19'),_0xdfd335,JSON[_0x8f10('0x10')](_0xfdb66e));_0x255e75(_0xfdb66e);})['catch'](function(_0x2550e1){logger['error']('CreateOpenchannelQueueReport',_0x2550e1['message'],_0xdfd335);_0x3003ea(_0x468bf3[_0x8f10('0x11')](0x1f4,_0x2550e1['message']));});});};exports[_0x8f10('0x1a')]=function(_0xdaa7dd){var _0x2cbbf4=this;return new Promise(function(_0x39178d,_0x419cd7){return db[_0x8f10('0x1b')][_0x8f10('0x1c')](_0xdaa7dd[_0x8f10('0x16')],{'raw':_0xdaa7dd[_0x8f10('0x17')]?_0xdaa7dd[_0x8f10('0x17')][_0x8f10('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdaa7dd[_0x8f10('0x17')]?_0xdaa7dd[_0x8f10('0x17')][_0x8f10('0x1d')]||null:null,'attributes':_0xdaa7dd['options']?_0xdaa7dd[_0x8f10('0x17')][_0x8f10('0x1e')]||null:null,'limit':_0xdaa7dd['options']?_0xdaa7dd['options']['limit']||null:null})[_0x8f10('0xa')](function(_0x11db52){logger[_0x8f10('0xb')](_0x8f10('0x1a'),_0xdaa7dd);logger[_0x8f10('0xe')]('UpdateOpenchannelQueueReport',_0xdaa7dd,JSON[_0x8f10('0x10')](_0x11db52));_0x39178d(_0x11db52);})['catch'](function(_0x2f1ee1){logger[_0x8f10('0x11')](_0x8f10('0x1a'),_0x2f1ee1['message'],_0xdaa7dd);_0x419cd7(_0x2cbbf4[_0x8f10('0x11')](0x1f4,_0x2f1ee1['message']));});});};
\ No newline at end of file
+var _0x5ba3=['info','OpenchannelQueueReport,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','CreateOpenchannelQueueReport','create','body','options','raw','stringify','UpdateOpenchannelQueueReport','update','where','attributes','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then'];(function(_0x5c43c1,_0xc05487){var _0x6b0bf3=function(_0xb40a13){while(--_0xb40a13){_0x5c43c1['push'](_0x5c43c1['shift']());}};_0x6b0bf3(++_0xc05487);}(_0x5ba3,0x140));var _0x35ba=function(_0x4e5670,_0x4a7c40){_0x4e5670=_0x4e5670-0x0;var _0x21deca=_0x5ba3[_0x4e5670];return _0x21deca;};'use strict';var _=require(_0x35ba('0x0'));var util=require('util');var moment=require(_0x35ba('0x1'));var BPromise=require(_0x35ba('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35ba('0x3'));var db=require(_0x35ba('0x4'))['db'];var utils=require(_0x35ba('0x5'));var logger=require('../../config/logger')(_0x35ba('0x6'));var config=require(_0x35ba('0x7'));var jayson=require(_0x35ba('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x20cd5f,_0x3264d3,_0x380ffb){return new BPromise(function(_0x4c55f3,_0x22bed8){return client['request'](_0x20cd5f,_0x380ffb)[_0x35ba('0x9')](function(_0x366ddc){logger[_0x35ba('0xa')](_0x35ba('0xb'),_0x3264d3,'request\x20sent');logger[_0x35ba('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x3264d3,'request\x20sent',JSON['stringify'](_0x366ddc));if(_0x366ddc[_0x35ba('0xd')]){if(_0x366ddc[_0x35ba('0xd')][_0x35ba('0xe')]===0x1f4){logger[_0x35ba('0xd')](_0x35ba('0xb'),_0x3264d3,_0x366ddc[_0x35ba('0xd')][_0x35ba('0xf')]);return _0x22bed8(_0x366ddc[_0x35ba('0xd')]['message']);}logger[_0x35ba('0xd')](_0x35ba('0xb'),_0x3264d3,_0x366ddc[_0x35ba('0xd')][_0x35ba('0xf')]);return _0x4c55f3(_0x366ddc['error'][_0x35ba('0xf')]);}else{logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x3264d3,_0x35ba('0x10'));_0x4c55f3(_0x366ddc[_0x35ba('0x11')]['message']);}})[_0x35ba('0x12')](function(_0x2b6b71){logger[_0x35ba('0xd')](_0x35ba('0xb'),_0x3264d3,_0x2b6b71);_0x22bed8(_0x2b6b71);});});}exports[_0x35ba('0x13')]=function(_0x374f91){var _0x4e96c6=this;return new Promise(function(_0x423666,_0x247440){return db['OpenchannelQueueReport'][_0x35ba('0x14')](_0x374f91[_0x35ba('0x15')],{'raw':_0x374f91[_0x35ba('0x16')]?_0x374f91[_0x35ba('0x16')][_0x35ba('0x17')]===undefined?!![]:![]:!![]})[_0x35ba('0x9')](function(_0x3f5e92){logger[_0x35ba('0xa')](_0x35ba('0x13'),_0x374f91);logger[_0x35ba('0xc')](_0x35ba('0x13'),_0x374f91,JSON[_0x35ba('0x18')](_0x3f5e92));_0x423666(_0x3f5e92);})['catch'](function(_0x2d3b2b){logger[_0x35ba('0xd')](_0x35ba('0x13'),_0x2d3b2b[_0x35ba('0xf')],_0x374f91);_0x247440(_0x4e96c6[_0x35ba('0xd')](0x1f4,_0x2d3b2b[_0x35ba('0xf')]));});});};exports[_0x35ba('0x19')]=function(_0x439f43){var _0x547e3d=this;return new Promise(function(_0x2191b4,_0x53fd3d){return db['OpenchannelQueueReport'][_0x35ba('0x1a')](_0x439f43['body'],{'raw':_0x439f43[_0x35ba('0x16')]?_0x439f43[_0x35ba('0x16')][_0x35ba('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x439f43[_0x35ba('0x16')]?_0x439f43[_0x35ba('0x16')][_0x35ba('0x1b')]||null:null,'attributes':_0x439f43[_0x35ba('0x16')]?_0x439f43[_0x35ba('0x16')][_0x35ba('0x1c')]||null:null,'limit':_0x439f43[_0x35ba('0x16')]?_0x439f43[_0x35ba('0x16')][_0x35ba('0x1d')]||null:null})[_0x35ba('0x9')](function(_0x1914e6){logger[_0x35ba('0xa')](_0x35ba('0x19'),_0x439f43);logger['debug'](_0x35ba('0x19'),_0x439f43,JSON[_0x35ba('0x18')](_0x1914e6));_0x2191b4(_0x1914e6);})[_0x35ba('0x12')](function(_0x2185dd){logger[_0x35ba('0xd')](_0x35ba('0x19'),_0x2185dd[_0x35ba('0xf')],_0x439f43);_0x53fd3d(_0x547e3d[_0x35ba('0xd')](0x1f4,_0x2185dd[_0x35ba('0xf')]));});});};
\ No newline at end of file
index fbb1a17..36c63c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47bd=['get','index','/describe','isAuthenticated','describe','/:id','show','put','update','delete','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller'];(function(_0x438578,_0xeccb24){var _0x55f90b=function(_0x2ef1fd){while(--_0x2ef1fd){_0x438578['push'](_0x438578['shift']());}};_0x55f90b(++_0xeccb24);}(_0x47bd,0x116));var _0xd47b=function(_0x23edf6,_0x20e67b){_0x23edf6=_0x23edf6-0x0;var _0x3ba292=_0x47bd[_0x23edf6];return _0x3ba292;};'use strict';var multer=require('multer');var util=require(_0xd47b('0x0'));var path=require('path');var timeout=require(_0xd47b('0x1'));var express=require('express');var router=express[_0xd47b('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xd47b('0x3'));var interaction=require(_0xd47b('0x4'));var config=require(_0xd47b('0x5'));var controller=require(_0xd47b('0x6'));router[_0xd47b('0x7')]('/',auth['isAuthenticated'](),controller[_0xd47b('0x8')]);router[_0xd47b('0x7')](_0xd47b('0x9'),auth[_0xd47b('0xa')](),controller[_0xd47b('0xb')]);router['get'](_0xd47b('0xc'),auth['isAuthenticated'](),controller[_0xd47b('0xd')]);router['post']('/',auth[_0xd47b('0xa')](),controller['create']);router[_0xd47b('0xe')](_0xd47b('0xc'),auth[_0xd47b('0xa')](),controller[_0xd47b('0xf')]);router[_0xd47b('0x10')](_0xd47b('0xc'),auth[_0xd47b('0xa')](),controller[_0xd47b('0x11')]);module[_0xd47b('0x12')]=router;
\ No newline at end of file
+var _0x8ea0=['../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x4fe1c5,_0x5b324b){var _0x11822d=function(_0x5ec8f9){while(--_0x5ec8f9){_0x4fe1c5['push'](_0x4fe1c5['shift']());}};_0x11822d(++_0x5b324b);}(_0x8ea0,0xa2));var _0x08ea=function(_0x368c11,_0x130929){_0x368c11=_0x368c11-0x0;var _0x349f32=_0x8ea0[_0x368c11];return _0x349f32;};'use strict';var multer=require(_0x08ea('0x0'));var util=require(_0x08ea('0x1'));var path=require(_0x08ea('0x2'));var timeout=require('connect-timeout');var express=require(_0x08ea('0x3'));var router=express[_0x08ea('0x4')]();var fs_extra=require(_0x08ea('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x08ea('0x6'));var config=require(_0x08ea('0x7'));var controller=require(_0x08ea('0x8'));router[_0x08ea('0x9')]('/',auth[_0x08ea('0xa')](),controller[_0x08ea('0xb')]);router[_0x08ea('0x9')](_0x08ea('0xc'),auth[_0x08ea('0xa')](),controller[_0x08ea('0xd')]);router['get'](_0x08ea('0xe'),auth['isAuthenticated'](),controller[_0x08ea('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x08ea('0x10')]);router[_0x08ea('0x11')](_0x08ea('0xe'),auth[_0x08ea('0xa')](),controller[_0x08ea('0x12')]);router['delete']('/:id',auth[_0x08ea('0xa')](),controller[_0x08ea('0x13')]);module[_0x08ea('0x14')]=router;
\ No newline at end of file
index 61ebf8d..b83fd32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x1664c7,_0x3e4ec4){var _0x5b1f53=function(_0x16d8ba){while(--_0x16d8ba){_0x1664c7['push'](_0x1664c7['shift']());}};_0x5b1f53(++_0x3e4ec4);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x24e2a3,_0x534875){_0x24e2a3=_0x24e2a3-0x0;var _0x3e82f4=_0xf3cd[_0x24e2a3];return _0x3e82f4;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x449d0c,_0x579960){var _0x46b4ef=function(_0x4783c4){while(--_0x4783c4){_0x449d0c['push'](_0x449d0c['shift']());}};_0x46b4ef(++_0x579960);}(_0xedd9,0xfc));var _0x9edd=function(_0x4b2dc8,_0x1e0af9){_0x4b2dc8=_0x4b2dc8-0x0;var _0x50d88f=_0xedd9[_0x4b2dc8];return _0x50d88f;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
index 816ef70..fcba190 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d1c=['count','offset','limit','Content-Range','reject','update','then','end','sendStatus','stack','name','send','map','OpenchannelTransferReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','json','undefined'];(function(_0x5bccbf,_0x547e42){var _0x2158c6=function(_0x40f28a){while(--_0x40f28a){_0x5bccbf['push'](_0x5bccbf['shift']());}};_0x2158c6(++_0x547e42);}(_0x0d1c,0xc1));var _0xc0d1=function(_0x1c8d87,_0x3bdaad){_0x1c8d87=_0x1c8d87-0x0;var _0x2d2145=_0x0d1c[_0x1c8d87];return _0x2d2145;};'use strict';var emlformat=require(_0xc0d1('0x0'));var rimraf=require(_0xc0d1('0x1'));var zipdir=require(_0xc0d1('0x2'));var jsonpatch=require(_0xc0d1('0x3'));var rp=require(_0xc0d1('0x4'));var moment=require(_0xc0d1('0x5'));var BPromise=require(_0xc0d1('0x6'));var Mustache=require(_0xc0d1('0x7'));var util=require(_0xc0d1('0x8'));var path=require(_0xc0d1('0x9'));var sox=require(_0xc0d1('0xa'));var csv=require(_0xc0d1('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc0d1('0xc'));var _=require('lodash');var squel=require(_0xc0d1('0xd'));var crypto=require(_0xc0d1('0xe'));var jsforce=require(_0xc0d1('0xf'));var deskjs=require(_0xc0d1('0x10'));var toCsv=require('to-csv');var querystring=require(_0xc0d1('0x11'));var Papa=require(_0xc0d1('0x12'));var Redis=require('ioredis');var authService=require(_0xc0d1('0x13'));var qs=require(_0xc0d1('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc0d1('0x15'));var logger=require('../../config/logger')(_0xc0d1('0x16'));var utils=require(_0xc0d1('0x17'));var config=require(_0xc0d1('0x18'));var licenseUtil=require(_0xc0d1('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f1fb7,_0x28cba6){_0x28cba6=_0x28cba6||0xcc;return function(_0x1da0b3){if(_0x1da0b3){return _0x2f1fb7['sendStatus'](_0x28cba6);}return _0x2f1fb7[_0xc0d1('0x1a')](_0x28cba6)['end']();};}function respondWithResult(_0x50a31b,_0x29bdd9){_0x29bdd9=_0x29bdd9||0xc8;return function(_0x38f27b){if(_0x38f27b){return _0x50a31b['status'](_0x29bdd9)[_0xc0d1('0x1b')](_0x38f27b);}};}function respondWithFilteredResult(_0x4dd145,_0x5d98d7){return function(_0x29c7d8){if(_0x29c7d8){var _0x503413=typeof _0x5d98d7['offset']===_0xc0d1('0x1c')&&typeof _0x5d98d7['limit']===_0xc0d1('0x1c');var _0x503680=_0x29c7d8[_0xc0d1('0x1d')];var _0x1be9cd=_0x503413?0x0:_0x5d98d7[_0xc0d1('0x1e')];var _0xaa7ced=_0x503413?_0x29c7d8[_0xc0d1('0x1d')]:_0x5d98d7[_0xc0d1('0x1e')]+_0x5d98d7[_0xc0d1('0x1f')];var _0x377d2e;if(_0xaa7ced>=_0x503680){_0xaa7ced=_0x503680;_0x377d2e=0xc8;}else{_0x377d2e=0xce;}_0x4dd145[_0xc0d1('0x1a')](_0x377d2e);return _0x4dd145['set'](_0xc0d1('0x20'),_0x1be9cd+'-'+_0xaa7ced+'/'+_0x503680)[_0xc0d1('0x1b')](_0x29c7d8);}return null;};}function patchUpdates(_0x40c341){return function(_0x1b092e){try{jsonpatch['apply'](_0x1b092e,_0x40c341,!![]);}catch(_0x5baa12){return BPromise[_0xc0d1('0x21')](_0x5baa12);}return _0x1b092e['save']();};}function saveUpdates(_0x10436b,_0x3f6aab){return function(_0x590697){if(_0x590697){return _0x590697[_0xc0d1('0x22')](_0x10436b)['then'](function(_0x2878c0){return _0x2878c0;});}return null;};}function removeEntity(_0x2cf9b8,_0x3b62c0){return function(_0x17a93f){if(_0x17a93f){return _0x17a93f['destroy']()[_0xc0d1('0x23')](function(){_0x2cf9b8[_0xc0d1('0x1a')](0xcc)[_0xc0d1('0x24')]();});}};}function handleEntityNotFound(_0x3bc293,_0x4959a5){return function(_0x53b46c){if(!_0x53b46c){_0x3bc293[_0xc0d1('0x25')](0x194);}return _0x53b46c;};}function handleError(_0x43e09c,_0x2069e3){_0x2069e3=_0x2069e3||0x1f4;return function(_0x12bd17){logger['error'](_0x12bd17[_0xc0d1('0x26')]);if(_0x12bd17[_0xc0d1('0x27')]){delete _0x12bd17['name'];}_0x43e09c[_0xc0d1('0x1a')](_0x2069e3)[_0xc0d1('0x28')](_0x12bd17);};}exports['index']=function(_0x26767f,_0x4c4049){var _0x41252f={},_0x3a8322={},_0x2c750c={'count':0x0,'rows':[]};var _0x7f3514=_[_0xc0d1('0x29')](db[_0xc0d1('0x2a')][_0xc0d1('0x2b')],function(_0x132a94){return{'name':_0x132a94[_0xc0d1('0x2c')],'type':_0x132a94['type']['key']};});_0x3a8322[_0xc0d1('0x2d')]=_[_0xc0d1('0x29')](_0x7f3514,'name');_0x3a8322[_0xc0d1('0x2e')]=_[_0xc0d1('0x2f')](_0x26767f[_0xc0d1('0x2e')]);_0x3a8322[_0xc0d1('0x30')]=_[_0xc0d1('0x31')](_0x3a8322['model'],_0x3a8322[_0xc0d1('0x2e')]);_0x41252f[_0xc0d1('0x32')]=_[_0xc0d1('0x31')](_0x3a8322[_0xc0d1('0x2d')],qs[_0xc0d1('0x33')](_0x26767f[_0xc0d1('0x2e')][_0xc0d1('0x33')]));_0x41252f[_0xc0d1('0x32')]=_0x41252f[_0xc0d1('0x32')][_0xc0d1('0x34')]?_0x41252f['attributes']:_0x3a8322[_0xc0d1('0x2d')];if(!_0x26767f[_0xc0d1('0x2e')][_0xc0d1('0x35')](_0xc0d1('0x36'))){_0x41252f[_0xc0d1('0x1f')]=qs['limit'](_0x26767f['query'][_0xc0d1('0x1f')]);_0x41252f[_0xc0d1('0x1e')]=qs[_0xc0d1('0x1e')](_0x26767f[_0xc0d1('0x2e')]['offset']);}_0x41252f[_0xc0d1('0x37')]=qs['sort'](_0x26767f['query'][_0xc0d1('0x38')]);_0x41252f[_0xc0d1('0x39')]=qs['filters'](_[_0xc0d1('0x3a')](_0x26767f[_0xc0d1('0x2e')],_0x3a8322['filters']),_0x7f3514);if(_0x26767f[_0xc0d1('0x2e')][_0xc0d1('0x3b')]){_0x41252f[_0xc0d1('0x39')]=_[_0xc0d1('0x3c')](_0x41252f['where'],{'$or':_['map'](_0x7f3514,function(_0x463b48){if(_0x463b48['type']!==_0xc0d1('0x3d')){var _0xc956e1={};_0xc956e1[_0x463b48['name']]={'$like':'%'+_0x26767f[_0xc0d1('0x2e')][_0xc0d1('0x3b')]+'%'};return _0xc956e1;}})});}_0x41252f=_[_0xc0d1('0x3c')]({},_0x41252f,_0x26767f[_0xc0d1('0x3e')]);var _0x7cbfce={'where':_0x41252f[_0xc0d1('0x39')]};return db['OpenchannelTransferReport'][_0xc0d1('0x1d')](_0x7cbfce)['then'](function(_0x41ead4){_0x2c750c[_0xc0d1('0x1d')]=_0x41ead4;if(_0x26767f['query'][_0xc0d1('0x3f')]){_0x41252f[_0xc0d1('0x40')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xc0d1('0x41')](_0x41252f);})['then'](function(_0x12eee9){_0x2c750c[_0xc0d1('0x42')]=_0x12eee9;return _0x2c750c;})['then'](respondWithFilteredResult(_0x4c4049,_0x41252f))[_0xc0d1('0x43')](handleError(_0x4c4049,null));};exports[_0xc0d1('0x44')]=function(_0x595d52,_0x1d0790){var _0x637648={'raw':!![],'where':{'id':_0x595d52[_0xc0d1('0x45')]['id']}},_0x12c53d={};_0x12c53d[_0xc0d1('0x2d')]=_[_0xc0d1('0x2f')](db[_0xc0d1('0x2a')][_0xc0d1('0x2b')]);_0x12c53d[_0xc0d1('0x2e')]=_[_0xc0d1('0x2f')](_0x595d52[_0xc0d1('0x2e')]);_0x12c53d['filters']=_[_0xc0d1('0x31')](_0x12c53d[_0xc0d1('0x2d')],_0x12c53d[_0xc0d1('0x2e')]);_0x637648[_0xc0d1('0x32')]=_[_0xc0d1('0x31')](_0x12c53d[_0xc0d1('0x2d')],qs['fields'](_0x595d52[_0xc0d1('0x2e')][_0xc0d1('0x33')]));_0x637648['attributes']=_0x637648[_0xc0d1('0x32')]['length']?_0x637648[_0xc0d1('0x32')]:_0x12c53d[_0xc0d1('0x2d')];if(_0x595d52[_0xc0d1('0x2e')][_0xc0d1('0x3f')]){_0x637648[_0xc0d1('0x40')]=[{'all':!![]}];}_0x637648=_[_0xc0d1('0x3c')]({},_0x637648,_0x595d52[_0xc0d1('0x3e')]);return db[_0xc0d1('0x2a')][_0xc0d1('0x46')](_0x637648)[_0xc0d1('0x23')](handleEntityNotFound(_0x1d0790,null))[_0xc0d1('0x23')](respondWithResult(_0x1d0790,null))[_0xc0d1('0x43')](handleError(_0x1d0790,null));};exports[_0xc0d1('0x47')]=function(_0xc92ea3,_0x6152b5){return db[_0xc0d1('0x2a')][_0xc0d1('0x47')](_0xc92ea3[_0xc0d1('0x48')],{})[_0xc0d1('0x23')](respondWithResult(_0x6152b5,0xc9))['catch'](handleError(_0x6152b5,null));};exports[_0xc0d1('0x22')]=function(_0x31e14a,_0x51f543){if(_0x31e14a['body']['id']){delete _0x31e14a[_0xc0d1('0x48')]['id'];}return db[_0xc0d1('0x2a')][_0xc0d1('0x46')]({'where':{'id':_0x31e14a[_0xc0d1('0x45')]['id']}})[_0xc0d1('0x23')](handleEntityNotFound(_0x51f543,null))[_0xc0d1('0x23')](saveUpdates(_0x31e14a[_0xc0d1('0x48')],null))[_0xc0d1('0x23')](respondWithResult(_0x51f543,null))[_0xc0d1('0x43')](handleError(_0x51f543,null));};exports[_0xc0d1('0x49')]=function(_0x5c22c7,_0x2fff1e){return db[_0xc0d1('0x2a')]['find']({'where':{'id':_0x5c22c7[_0xc0d1('0x45')]['id']}})[_0xc0d1('0x23')](handleEntityNotFound(_0x2fff1e,null))[_0xc0d1('0x23')](removeEntity(_0x2fff1e,null))[_0xc0d1('0x43')](handleError(_0x2fff1e,null));};exports['describe']=function(_0x2f2e4d,_0x24976e){return db[_0xc0d1('0x2a')]['describe']()[_0xc0d1('0x23')](respondWithResult(_0x24976e,null))[_0xc0d1('0x43')](handleError(_0x24976e,null));};
\ No newline at end of file
+var _0xbe7e=['rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','include','findAll','catch','show','params','fields','includeAll','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','OpenchannelTransferReport'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xbe7e,0x106));var _0xebe7=function(_0x4b2975,_0x2be462){_0x4b2975=_0x4b2975-0x0;var _0x3bc9e8=_0xbe7e[_0x4b2975];return _0x3bc9e8;};'use strict';var emlformat=require(_0xebe7('0x0'));var rimraf=require(_0xebe7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xebe7('0x2'));var rp=require(_0xebe7('0x3'));var moment=require(_0xebe7('0x4'));var BPromise=require(_0xebe7('0x5'));var Mustache=require(_0xebe7('0x6'));var util=require(_0xebe7('0x7'));var path=require(_0xebe7('0x8'));var sox=require(_0xebe7('0x9'));var csv=require(_0xebe7('0xa'));var ejs=require(_0xebe7('0xb'));var fs=require('fs');var fs_extra=require(_0xebe7('0xc'));var _=require(_0xebe7('0xd'));var squel=require(_0xebe7('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xebe7('0xf'));var toCsv=require(_0xebe7('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xebe7('0x10'));var authService=require(_0xebe7('0x11'));var qs=require(_0xebe7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xebe7('0x13'));var logger=require(_0xebe7('0x14'))(_0xebe7('0x15'));var utils=require(_0xebe7('0x16'));var config=require(_0xebe7('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xebe7('0x18'))['db'];function respondWithStatusCode(_0x22d102,_0x59ec5e){_0x59ec5e=_0x59ec5e||0xcc;return function(_0x56208d){if(_0x56208d){return _0x22d102['sendStatus'](_0x59ec5e);}return _0x22d102[_0xebe7('0x19')](_0x59ec5e)[_0xebe7('0x1a')]();};}function respondWithResult(_0x288365,_0x4dcfe1){_0x4dcfe1=_0x4dcfe1||0xc8;return function(_0x13d705){if(_0x13d705){return _0x288365[_0xebe7('0x19')](_0x4dcfe1)[_0xebe7('0x1b')](_0x13d705);}};}function respondWithFilteredResult(_0x51a6e,_0xbb4f34){return function(_0x1a84f5){if(_0x1a84f5){var _0x52a659=typeof _0xbb4f34[_0xebe7('0x1c')]===_0xebe7('0x1d')&&typeof _0xbb4f34[_0xebe7('0x1e')]===_0xebe7('0x1d');var _0x21ceeb=_0x1a84f5[_0xebe7('0x1f')];var _0x4134d3=_0x52a659?0x0:_0xbb4f34['offset'];var _0x2f96e1=_0x52a659?_0x1a84f5[_0xebe7('0x1f')]:_0xbb4f34[_0xebe7('0x1c')]+_0xbb4f34[_0xebe7('0x1e')];var _0x4911b9;if(_0x2f96e1>=_0x21ceeb){_0x2f96e1=_0x21ceeb;_0x4911b9=0xc8;}else{_0x4911b9=0xce;}_0x51a6e[_0xebe7('0x19')](_0x4911b9);return _0x51a6e[_0xebe7('0x20')]('Content-Range',_0x4134d3+'-'+_0x2f96e1+'/'+_0x21ceeb)[_0xebe7('0x1b')](_0x1a84f5);}return null;};}function patchUpdates(_0xbe5b7c){return function(_0x3bc9a9){try{jsonpatch[_0xebe7('0x21')](_0x3bc9a9,_0xbe5b7c,!![]);}catch(_0x487be3){return BPromise[_0xebe7('0x22')](_0x487be3);}return _0x3bc9a9[_0xebe7('0x23')]();};}function saveUpdates(_0x17b245,_0xec8538){return function(_0x6a2947){if(_0x6a2947){return _0x6a2947[_0xebe7('0x24')](_0x17b245)['then'](function(_0x59c81d){return _0x59c81d;});}return null;};}function removeEntity(_0x5555a2,_0x1f323e){return function(_0x3d0eb6){if(_0x3d0eb6){return _0x3d0eb6['destroy']()[_0xebe7('0x25')](function(){_0x5555a2[_0xebe7('0x19')](0xcc)[_0xebe7('0x1a')]();});}};}function handleEntityNotFound(_0x50f2d6,_0x1af0f8){return function(_0x238383){if(!_0x238383){_0x50f2d6[_0xebe7('0x26')](0x194);}return _0x238383;};}function handleError(_0x7aa1cb,_0x368eb6){_0x368eb6=_0x368eb6||0x1f4;return function(_0x37cd86){logger[_0xebe7('0x27')](_0x37cd86[_0xebe7('0x28')]);if(_0x37cd86['name']){delete _0x37cd86[_0xebe7('0x29')];}_0x7aa1cb['status'](_0x368eb6)[_0xebe7('0x2a')](_0x37cd86);};}exports[_0xebe7('0x2b')]=function(_0xdae4dd,_0x3a2fb3){var _0xc3c70d={},_0x29baff={},_0x7c546c={'count':0x0,'rows':[]};var _0x16bdb4=_[_0xebe7('0x2c')](db[_0xebe7('0x2d')][_0xebe7('0x2e')],function(_0x1d24e7){return{'name':_0x1d24e7[_0xebe7('0x2f')],'type':_0x1d24e7['type']['key']};});_0x29baff[_0xebe7('0x30')]=_[_0xebe7('0x2c')](_0x16bdb4,'name');_0x29baff[_0xebe7('0x31')]=_[_0xebe7('0x32')](_0xdae4dd[_0xebe7('0x31')]);_0x29baff[_0xebe7('0x33')]=_[_0xebe7('0x34')](_0x29baff[_0xebe7('0x30')],_0x29baff['query']);_0xc3c70d[_0xebe7('0x35')]=_[_0xebe7('0x34')](_0x29baff[_0xebe7('0x30')],qs['fields'](_0xdae4dd[_0xebe7('0x31')]['fields']));_0xc3c70d[_0xebe7('0x35')]=_0xc3c70d[_0xebe7('0x35')][_0xebe7('0x36')]?_0xc3c70d['attributes']:_0x29baff[_0xebe7('0x30')];if(!_0xdae4dd[_0xebe7('0x31')][_0xebe7('0x37')](_0xebe7('0x38'))){_0xc3c70d['limit']=qs[_0xebe7('0x1e')](_0xdae4dd[_0xebe7('0x31')][_0xebe7('0x1e')]);_0xc3c70d[_0xebe7('0x1c')]=qs[_0xebe7('0x1c')](_0xdae4dd['query']['offset']);}_0xc3c70d[_0xebe7('0x39')]=qs[_0xebe7('0x3a')](_0xdae4dd[_0xebe7('0x31')][_0xebe7('0x3a')]);_0xc3c70d[_0xebe7('0x3b')]=qs[_0xebe7('0x33')](_[_0xebe7('0x3c')](_0xdae4dd[_0xebe7('0x31')],_0x29baff['filters']),_0x16bdb4);if(_0xdae4dd[_0xebe7('0x31')]['filter']){_0xc3c70d[_0xebe7('0x3b')]=_[_0xebe7('0x3d')](_0xc3c70d[_0xebe7('0x3b')],{'$or':_['map'](_0x16bdb4,function(_0x452e09){if(_0x452e09[_0xebe7('0x3e')]!==_0xebe7('0x3f')){var _0xc11c87={};_0xc11c87[_0x452e09[_0xebe7('0x29')]]={'$like':'%'+_0xdae4dd[_0xebe7('0x31')][_0xebe7('0x40')]+'%'};return _0xc11c87;}})});}_0xc3c70d=_[_0xebe7('0x3d')]({},_0xc3c70d,_0xdae4dd[_0xebe7('0x41')]);var _0x37ea99={'where':_0xc3c70d[_0xebe7('0x3b')]};return db['OpenchannelTransferReport'][_0xebe7('0x1f')](_0x37ea99)[_0xebe7('0x25')](function(_0x393fdc){_0x7c546c[_0xebe7('0x1f')]=_0x393fdc;if(_0xdae4dd['query']['includeAll']){_0xc3c70d[_0xebe7('0x42')]=[{'all':!![]}];}return db[_0xebe7('0x2d')][_0xebe7('0x43')](_0xc3c70d);})[_0xebe7('0x25')](function(_0x2616c1){_0x7c546c['rows']=_0x2616c1;return _0x7c546c;})[_0xebe7('0x25')](respondWithFilteredResult(_0x3a2fb3,_0xc3c70d))[_0xebe7('0x44')](handleError(_0x3a2fb3,null));};exports[_0xebe7('0x45')]=function(_0x5ab35a,_0x109c2e){var _0x44998c={'raw':!![],'where':{'id':_0x5ab35a[_0xebe7('0x46')]['id']}},_0x35b7e8={};_0x35b7e8['model']=_[_0xebe7('0x32')](db['OpenchannelTransferReport'][_0xebe7('0x2e')]);_0x35b7e8[_0xebe7('0x31')]=_[_0xebe7('0x32')](_0x5ab35a['query']);_0x35b7e8[_0xebe7('0x33')]=_['intersection'](_0x35b7e8[_0xebe7('0x30')],_0x35b7e8[_0xebe7('0x31')]);_0x44998c[_0xebe7('0x35')]=_['intersection'](_0x35b7e8[_0xebe7('0x30')],qs[_0xebe7('0x47')](_0x5ab35a['query'][_0xebe7('0x47')]));_0x44998c[_0xebe7('0x35')]=_0x44998c[_0xebe7('0x35')][_0xebe7('0x36')]?_0x44998c['attributes']:_0x35b7e8[_0xebe7('0x30')];if(_0x5ab35a['query'][_0xebe7('0x48')]){_0x44998c['include']=[{'all':!![]}];}_0x44998c=_[_0xebe7('0x3d')]({},_0x44998c,_0x5ab35a[_0xebe7('0x41')]);return db[_0xebe7('0x2d')]['find'](_0x44998c)['then'](handleEntityNotFound(_0x109c2e,null))[_0xebe7('0x25')](respondWithResult(_0x109c2e,null))[_0xebe7('0x44')](handleError(_0x109c2e,null));};exports[_0xebe7('0x49')]=function(_0x4ed7fc,_0x4b227a){return db['OpenchannelTransferReport']['create'](_0x4ed7fc[_0xebe7('0x4a')],{})[_0xebe7('0x25')](respondWithResult(_0x4b227a,0xc9))[_0xebe7('0x44')](handleError(_0x4b227a,null));};exports[_0xebe7('0x24')]=function(_0x1f1c48,_0x518288){if(_0x1f1c48[_0xebe7('0x4a')]['id']){delete _0x1f1c48[_0xebe7('0x4a')]['id'];}return db[_0xebe7('0x2d')][_0xebe7('0x4b')]({'where':{'id':_0x1f1c48['params']['id']}})[_0xebe7('0x25')](handleEntityNotFound(_0x518288,null))[_0xebe7('0x25')](saveUpdates(_0x1f1c48['body'],null))[_0xebe7('0x25')](respondWithResult(_0x518288,null))['catch'](handleError(_0x518288,null));};exports['destroy']=function(_0x359f32,_0x13857b){return db[_0xebe7('0x2d')][_0xebe7('0x4b')]({'where':{'id':_0x359f32[_0xebe7('0x46')]['id']}})['then'](handleEntityNotFound(_0x13857b,null))[_0xebe7('0x25')](removeEntity(_0x13857b,null))[_0xebe7('0x44')](handleError(_0x13857b,null));};exports[_0xebe7('0x4c')]=function(_0x4f01c0,_0x543416){return db[_0xebe7('0x2d')][_0xebe7('0x4c')]()[_0xebe7('0x25')](respondWithResult(_0x543416,null))['catch'](handleError(_0x543416,null));};
\ No newline at end of file
index 513e30b..af2d602 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66e2=['../../config/environment','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x316b7b,_0x5ba87e){var _0xcedfe1=function(_0x1c184e){while(--_0x1c184e){_0x316b7b['push'](_0x316b7b['shift']());}};_0xcedfe1(++_0x5ba87e);}(_0x66e2,0x172));var _0x266e=function(_0x4df667,_0x2d80ea){_0x4df667=_0x4df667-0x0;var _0x24ff9d=_0x66e2[_0x4df667];return _0x24ff9d;};'use strict';var _=require(_0x266e('0x0'));var util=require('util');var logger=require(_0x266e('0x1'))(_0x266e('0x2'));var moment=require('moment');var BPromise=require(_0x266e('0x3'));var rp=require(_0x266e('0x4'));var fs=require('fs');var path=require(_0x266e('0x5'));var rimraf=require(_0x266e('0x6'));var config=require(_0x266e('0x7'));var attributes=require(_0x266e('0x8'));module['exports']=function(_0x2ce15a,_0x401d0f){return _0x2ce15a[_0x266e('0x9')](_0x266e('0xa'),attributes,{'tableName':_0x266e('0xb'),'paranoid':![],'indexes':[{'name':_0x266e('0xc'),'fields':[_0x266e('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9e71=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid'];(function(_0x3ec333,_0x26bcbe){var _0x15ccb8=function(_0x2c4d0c){while(--_0x2c4d0c){_0x3ec333['push'](_0x3ec333['shift']());}};_0x15ccb8(++_0x26bcbe);}(_0x9e71,0x179));var _0x19e7=function(_0x3da95c,_0x252be5){_0x3da95c=_0x3da95c-0x0;var _0x2c8394=_0x9e71[_0x3da95c];return _0x2c8394;};'use strict';var _=require(_0x19e7('0x0'));var util=require(_0x19e7('0x1'));var logger=require(_0x19e7('0x2'))(_0x19e7('0x3'));var moment=require(_0x19e7('0x4'));var BPromise=require(_0x19e7('0x5'));var rp=require(_0x19e7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x19e7('0x7'));var config=require(_0x19e7('0x8'));var attributes=require('./openchannelTransferReport.attributes');module['exports']=function(_0x44cf7f,_0x489583){return _0x44cf7f[_0x19e7('0x9')](_0x19e7('0xa'),attributes,{'tableName':_0x19e7('0xb'),'paranoid':![],'indexes':[{'name':_0x19e7('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index cb6e218..d5b5760 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7a8=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','randomstring','ioredis'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xb7a8,0xec));var _0x8b7a=function(_0x19e1e0,_0x464f64){_0x19e1e0=_0x19e1e0-0x0;var _0x566cb1=_0xb7a8[_0x19e1e0];return _0x566cb1;};'use strict';var _=require('lodash');var util=require(_0x8b7a('0x0'));var moment=require(_0x8b7a('0x1'));var BPromise=require('bluebird');var rs=require(_0x8b7a('0x2'));var fs=require('fs');var Redis=require(_0x8b7a('0x3'));var db=require(_0x8b7a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b7a('0x5'))(_0x8b7a('0x6'));var config=require(_0x8b7a('0x7'));var jayson=require(_0x8b7a('0x8'));var client=jayson[_0x8b7a('0x9')][_0x8b7a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa539dd,_0x4045d9,_0x3e7238){return new BPromise(function(_0xec0881,_0x15b930){return client[_0x8b7a('0xb')](_0xa539dd,_0x3e7238)['then'](function(_0x138031){logger['info'](_0x8b7a('0xc'),_0x4045d9,_0x8b7a('0xd'));logger['debug'](_0x8b7a('0xe'),_0x4045d9,_0x8b7a('0xd'),JSON[_0x8b7a('0xf')](_0x138031));if(_0x138031['error']){if(_0x138031[_0x8b7a('0x10')]['code']===0x1f4){logger[_0x8b7a('0x10')](_0x8b7a('0xc'),_0x4045d9,_0x138031[_0x8b7a('0x10')][_0x8b7a('0x11')]);return _0x15b930(_0x138031['error'][_0x8b7a('0x11')]);}logger['error'](_0x8b7a('0xc'),_0x4045d9,_0x138031[_0x8b7a('0x10')][_0x8b7a('0x11')]);return _0xec0881(_0x138031['error']['message']);}else{logger['info'](_0x8b7a('0xc'),_0x4045d9,'request\x20sent');_0xec0881(_0x138031[_0x8b7a('0x12')][_0x8b7a('0x11')]);}})[_0x8b7a('0x13')](function(_0x21a0be){logger[_0x8b7a('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4045d9,_0x21a0be);_0x15b930(_0x21a0be);});});}
\ No newline at end of file
+var _0x0618=['jayson/promise','client','http','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xd2e88,_0x4c0089){var _0x39a606=function(_0x8ef50a){while(--_0x8ef50a){_0xd2e88['push'](_0xd2e88['shift']());}};_0x39a606(++_0x4c0089);}(_0x0618,0x1c6));var _0x8061=function(_0x35f78d,_0x91ac69){_0x35f78d=_0x35f78d-0x0;var _0x2e6772=_0x0618[_0x35f78d];return _0x2e6772;};'use strict';var _=require(_0x8061('0x0'));var util=require(_0x8061('0x1'));var moment=require('moment');var BPromise=require(_0x8061('0x2'));var rs=require(_0x8061('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8061('0x4'));var logger=require(_0x8061('0x5'))(_0x8061('0x6'));var config=require(_0x8061('0x7'));var jayson=require(_0x8061('0x8'));var client=jayson[_0x8061('0x9')][_0x8061('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9c161b,_0x2c5e9d,_0x3bb894){return new BPromise(function(_0x7bfd18,_0x483d55){return client[_0x8061('0xb')](_0x9c161b,_0x3bb894)['then'](function(_0x286122){logger[_0x8061('0xc')](_0x8061('0xd'),_0x2c5e9d,_0x8061('0xe'));logger[_0x8061('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x2c5e9d,'request\x20sent',JSON[_0x8061('0x10')](_0x286122));if(_0x286122[_0x8061('0x11')]){if(_0x286122['error']['code']===0x1f4){logger[_0x8061('0x11')](_0x8061('0xd'),_0x2c5e9d,_0x286122[_0x8061('0x11')][_0x8061('0x12')]);return _0x483d55(_0x286122[_0x8061('0x11')][_0x8061('0x12')]);}logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x2c5e9d,_0x286122[_0x8061('0x11')][_0x8061('0x12')]);return _0x7bfd18(_0x286122[_0x8061('0x11')][_0x8061('0x12')]);}else{logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x2c5e9d,_0x8061('0xe'));_0x7bfd18(_0x286122[_0x8061('0x13')][_0x8061('0x12')]);}})[_0x8061('0x14')](function(_0x127435){logger[_0x8061('0x11')](_0x8061('0xd'),_0x2c5e9d,_0x127435);_0x483d55(_0x127435);});});}
\ No newline at end of file
index f04659f..8e22393 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6059=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','post','create','update','delete'];(function(_0x21f667,_0x308dcd){var _0x4905d6=function(_0x1da082){while(--_0x1da082){_0x21f667['push'](_0x21f667['shift']());}};_0x4905d6(++_0x308dcd);}(_0x6059,0x1aa));var _0x9605=function(_0x5b2c7e,_0x3d22f0){_0x5b2c7e=_0x5b2c7e-0x0;var _0x5ec399=_0x6059[_0x5b2c7e];return _0x5ec399;};'use strict';var multer=require(_0x9605('0x0'));var util=require(_0x9605('0x1'));var path=require(_0x9605('0x2'));var timeout=require(_0x9605('0x3'));var express=require('express');var router=express[_0x9605('0x4')]();var fs_extra=require(_0x9605('0x5'));var auth=require(_0x9605('0x6'));var interaction=require(_0x9605('0x7'));var config=require(_0x9605('0x8'));var controller=require(_0x9605('0x9'));router[_0x9605('0xa')]('/',auth[_0x9605('0xb')](),controller['index']);router[_0x9605('0xa')]('/:id',auth[_0x9605('0xb')](),controller['show']);router[_0x9605('0xc')]('/',auth[_0x9605('0xb')](),controller[_0x9605('0xd')]);router['put']('/:id',auth[_0x9605('0xb')](),controller[_0x9605('0xe')]);router[_0x9605('0xf')]('/:id',auth[_0x9605('0xb')](),controller['destroy']);module[_0x9605('0x10')]=router;
\ No newline at end of file
+var _0xa712=['isAuthenticated','index','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get'];(function(_0x5e7be4,_0xb9496c){var _0x10a09=function(_0x24ca9b){while(--_0x24ca9b){_0x5e7be4['push'](_0x5e7be4['shift']());}};_0x10a09(++_0xb9496c);}(_0xa712,0xb1));var _0x2a71=function(_0x5c4f6b,_0x2cdfce){_0x5c4f6b=_0x5c4f6b-0x0;var _0x104c4e=_0xa712[_0x5c4f6b];return _0x104c4e;};'use strict';var multer=require(_0x2a71('0x0'));var util=require(_0x2a71('0x1'));var path=require(_0x2a71('0x2'));var timeout=require(_0x2a71('0x3'));var express=require(_0x2a71('0x4'));var router=express[_0x2a71('0x5')]();var fs_extra=require(_0x2a71('0x6'));var auth=require(_0x2a71('0x7'));var interaction=require(_0x2a71('0x8'));var config=require(_0x2a71('0x9'));var controller=require(_0x2a71('0xa'));router[_0x2a71('0xb')]('/',auth[_0x2a71('0xc')](),controller[_0x2a71('0xd')]);router[_0x2a71('0xb')]('/:id',auth[_0x2a71('0xc')](),controller['show']);router[_0x2a71('0xe')]('/',auth['isAuthenticated'](),controller[_0x2a71('0xf')]);router[_0x2a71('0x10')](_0x2a71('0x11'),auth['isAuthenticated'](),controller[_0x2a71('0x12')]);router[_0x2a71('0x13')](_0x2a71('0x11'),auth[_0x2a71('0xc')](),controller[_0x2a71('0x14')]);module['exports']=router;
\ No newline at end of file
index 1c61ed5..f6150ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b02=['sequelize','name'];(function(_0x5b4436,_0x59df67){var _0x4ed247=function(_0x4f9bd8){while(--_0x4f9bd8){_0x5b4436['push'](_0x5b4436['shift']());}};_0x4ed247(++_0x59df67);}(_0x0b02,0x1c2));var _0x20b0=function(_0x599d12,_0x5b1b0a){_0x599d12=_0x599d12-0x0;var _0x14a89b=_0x0b02[_0x599d12];return _0x14a89b;};'use strict';var Sequelize=require(_0x20b0('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x20b0('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2987=['name','sequelize','STRING'];(function(_0x43a9ea,_0x49381a){var _0x50f0a3=function(_0x11516){while(--_0x11516){_0x43a9ea['push'](_0x43a9ea['shift']());}};_0x50f0a3(++_0x49381a);}(_0x2987,0x172));var _0x7298=function(_0x31db02,_0x330986){_0x31db02=_0x31db02-0x0;var _0x1b2e55=_0x2987[_0x31db02];return _0x1b2e55;};'use strict';var Sequelize=require(_0x7298('0x0'));module['exports']={'name':{'type':Sequelize[_0x7298('0x1')],'unique':_0x7298('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x7298('0x1')]}};
\ No newline at end of file
index ce6c3f1..89dbafe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1960=['catch','show','params','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','set','reject','save','update','then','destroy','get','Pauses','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','merge','options','Pause','includeAll','findAll','rows'];(function(_0x10acd9,_0xb8ffb1){var _0x5b6f92=function(_0x528393){while(--_0x528393){_0x10acd9['push'](_0x10acd9['shift']());}};_0x5b6f92(++_0xb8ffb1);}(_0x1960,0x1ac));var _0x0196=function(_0x12fdda,_0x349e00){_0x12fdda=_0x12fdda-0x0;var _0x429023=_0x1960[_0x12fdda];return _0x429023;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0196('0x0'));var zipdir=require(_0x0196('0x1'));var jsonpatch=require(_0x0196('0x2'));var rp=require(_0x0196('0x3'));var moment=require('moment');var BPromise=require(_0x0196('0x4'));var Mustache=require(_0x0196('0x5'));var util=require(_0x0196('0x6'));var path=require(_0x0196('0x7'));var sox=require('sox');var csv=require(_0x0196('0x8'));var ejs=require(_0x0196('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0196('0xa'));var squel=require(_0x0196('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0196('0x8'));var querystring=require(_0x0196('0xc'));var Papa=require(_0x0196('0xd'));var Redis=require('ioredis');var authService=require(_0x0196('0xe'));var qs=require(_0x0196('0xf'));var as=require(_0x0196('0x10'));var hardwareService=require(_0x0196('0x11'));var logger=require(_0x0196('0x12'))(_0x0196('0x13'));var utils=require(_0x0196('0x14'));var config=require(_0x0196('0x15'));var licenseUtil=require(_0x0196('0x16'));var db=require(_0x0196('0x17'))['db'];function respondWithStatusCode(_0x5c2877,_0x1cbbe3){_0x1cbbe3=_0x1cbbe3||0xcc;return function(_0x2c2a56){if(_0x2c2a56){return _0x5c2877[_0x0196('0x18')](_0x1cbbe3);}return _0x5c2877[_0x0196('0x19')](_0x1cbbe3)[_0x0196('0x1a')]();};}function respondWithResult(_0x1b8f1b,_0xe4b78f){_0xe4b78f=_0xe4b78f||0xc8;return function(_0x2db071){if(_0x2db071){return _0x1b8f1b[_0x0196('0x19')](_0xe4b78f)[_0x0196('0x1b')](_0x2db071);}};}function respondWithFilteredResult(_0x49c37e,_0x59c1cc){return function(_0x15945a){if(_0x15945a){var _0xff5c9f=typeof _0x59c1cc['offset']==='undefined'&&typeof _0x59c1cc[_0x0196('0x1c')]===_0x0196('0x1d');var _0x1566eb=_0x15945a[_0x0196('0x1e')];var _0x7ba70=_0xff5c9f?0x0:_0x59c1cc['offset'];var _0x4ddd7c=_0xff5c9f?_0x15945a['count']:_0x59c1cc['offset']+_0x59c1cc[_0x0196('0x1c')];var _0xe9d326;if(_0x4ddd7c>=_0x1566eb){_0x4ddd7c=_0x1566eb;_0xe9d326=0xc8;}else{_0xe9d326=0xce;}_0x49c37e[_0x0196('0x19')](_0xe9d326);return _0x49c37e[_0x0196('0x1f')]('Content-Range',_0x7ba70+'-'+_0x4ddd7c+'/'+_0x1566eb)[_0x0196('0x1b')](_0x15945a);}return null;};}function patchUpdates(_0x21cfc2){return function(_0x40924f){try{jsonpatch['apply'](_0x40924f,_0x21cfc2,!![]);}catch(_0x2ca989){return BPromise[_0x0196('0x20')](_0x2ca989);}return _0x40924f[_0x0196('0x21')]();};}function saveUpdates(_0x72158b,_0x30e1a3){return function(_0x534688){if(_0x534688){return _0x534688[_0x0196('0x22')](_0x72158b)[_0x0196('0x23')](function(_0x521d4d){return _0x521d4d;});}return null;};}function removeEntity(_0x22d4b0,_0x79e0a0){return function(_0x3ae949){if(_0x3ae949){return _0x3ae949[_0x0196('0x24')]()['then'](function(){var _0x3335e7=_0x3ae949[_0x0196('0x25')]({'plain':!![]});var _0x1985a4=_0x0196('0x26');return db[_0x0196('0x27')]['destroy']({'where':{'type':_0x1985a4,'resourceId':_0x3335e7['id']}})['then'](function(){return _0x3ae949;});})[_0x0196('0x23')](function(){_0x22d4b0[_0x0196('0x19')](0xcc)[_0x0196('0x1a')]();});}};}function handleEntityNotFound(_0x516678,_0x138e23){return function(_0xf3fcc8){if(!_0xf3fcc8){_0x516678['sendStatus'](0x194);}return _0xf3fcc8;};}function handleError(_0x280d50,_0x142b45){_0x142b45=_0x142b45||0x1f4;return function(_0x1fdd64){logger[_0x0196('0x28')](_0x1fdd64[_0x0196('0x29')]);if(_0x1fdd64[_0x0196('0x2a')]){delete _0x1fdd64[_0x0196('0x2a')];}_0x280d50['status'](_0x142b45)[_0x0196('0x2b')](_0x1fdd64);};}exports[_0x0196('0x2c')]=function(_0x2dae68,_0x59fc2a){var _0x454b1d={},_0x2a4a17={},_0x5a53b0={'count':0x0,'rows':[]};var _0x31dbee=_[_0x0196('0x2d')](db['Pause'][_0x0196('0x2e')],function(_0x235e7f){return{'name':_0x235e7f[_0x0196('0x2f')],'type':_0x235e7f[_0x0196('0x30')][_0x0196('0x31')]};});_0x2a4a17[_0x0196('0x32')]=_[_0x0196('0x2d')](_0x31dbee,_0x0196('0x2a'));_0x2a4a17[_0x0196('0x33')]=_[_0x0196('0x34')](_0x2dae68[_0x0196('0x33')]);_0x2a4a17[_0x0196('0x35')]=_['intersection'](_0x2a4a17[_0x0196('0x32')],_0x2a4a17['query']);_0x454b1d[_0x0196('0x36')]=_[_0x0196('0x37')](_0x2a4a17[_0x0196('0x32')],qs[_0x0196('0x38')](_0x2dae68[_0x0196('0x33')][_0x0196('0x38')]));_0x454b1d[_0x0196('0x36')]=_0x454b1d[_0x0196('0x36')][_0x0196('0x39')]?_0x454b1d[_0x0196('0x36')]:_0x2a4a17['model'];if(!_0x2dae68[_0x0196('0x33')][_0x0196('0x3a')]('nolimit')){_0x454b1d[_0x0196('0x1c')]=qs[_0x0196('0x1c')](_0x2dae68[_0x0196('0x33')][_0x0196('0x1c')]);_0x454b1d['offset']=qs['offset'](_0x2dae68[_0x0196('0x33')]['offset']);}_0x454b1d['order']=qs[_0x0196('0x3b')](_0x2dae68[_0x0196('0x33')][_0x0196('0x3b')]);_0x454b1d['where']=qs['filters'](_[_0x0196('0x3c')](_0x2dae68[_0x0196('0x33')],_0x2a4a17['filters']),_0x31dbee);if(_0x2dae68['query'][_0x0196('0x3d')]){_0x454b1d[_0x0196('0x3e')]=_['merge'](_0x454b1d[_0x0196('0x3e')],{'$or':_[_0x0196('0x2d')](_0x31dbee,function(_0x4c73dd){if(_0x4c73dd['type']!==_0x0196('0x3f')){var _0x1cfc3c={};_0x1cfc3c[_0x4c73dd[_0x0196('0x2a')]]={'$like':'%'+_0x2dae68[_0x0196('0x33')]['filter']+'%'};return _0x1cfc3c;}})});}_0x454b1d=_[_0x0196('0x40')]({},_0x454b1d,_0x2dae68[_0x0196('0x41')]);var _0x25b4bb={'where':_0x454b1d['where']};return db[_0x0196('0x42')][_0x0196('0x1e')](_0x25b4bb)[_0x0196('0x23')](function(_0x2b500d){_0x5a53b0[_0x0196('0x1e')]=_0x2b500d;if(_0x2dae68[_0x0196('0x33')][_0x0196('0x43')]){_0x454b1d['include']=[{'all':!![]}];}return db['Pause'][_0x0196('0x44')](_0x454b1d);})['then'](function(_0x231d90){_0x5a53b0[_0x0196('0x45')]=_0x231d90;return _0x5a53b0;})[_0x0196('0x23')](respondWithFilteredResult(_0x59fc2a,_0x454b1d))[_0x0196('0x46')](handleError(_0x59fc2a,null));};exports[_0x0196('0x47')]=function(_0x12d51f,_0x50113a){var _0x42b9d1={'raw':!![],'where':{'id':_0x12d51f[_0x0196('0x48')]['id']}},_0x466808={};_0x466808[_0x0196('0x32')]=_[_0x0196('0x34')](db[_0x0196('0x42')][_0x0196('0x2e')]);_0x466808[_0x0196('0x33')]=_['keys'](_0x12d51f['query']);_0x466808['filters']=_['intersection'](_0x466808[_0x0196('0x32')],_0x466808[_0x0196('0x33')]);_0x42b9d1[_0x0196('0x36')]=_['intersection'](_0x466808[_0x0196('0x32')],qs['fields'](_0x12d51f[_0x0196('0x33')]['fields']));_0x42b9d1[_0x0196('0x36')]=_0x42b9d1['attributes'][_0x0196('0x39')]?_0x42b9d1[_0x0196('0x36')]:_0x466808['model'];if(_0x12d51f[_0x0196('0x33')]['includeAll']){_0x42b9d1[_0x0196('0x49')]=[{'all':!![]}];}_0x42b9d1=_[_0x0196('0x40')]({},_0x42b9d1,_0x12d51f[_0x0196('0x41')]);return db[_0x0196('0x42')][_0x0196('0x4a')](_0x42b9d1)[_0x0196('0x23')](handleEntityNotFound(_0x50113a,null))['then'](respondWithResult(_0x50113a,null))[_0x0196('0x46')](handleError(_0x50113a,null));};exports[_0x0196('0x4b')]=function(_0x3f8f17,_0x3d3e68){return db['Pause'][_0x0196('0x4b')](_0x3f8f17['body'],{})[_0x0196('0x23')](function(_0x137013){var _0x4031ef=_0x3f8f17[_0x0196('0x4c')]['get']({'plain':!![]});if(!_0x4031ef)throw new Error(_0x0196('0x4d'));if(_0x4031ef[_0x0196('0x4e')]===_0x0196('0x4c')){var _0x4d3ac6=_0x137013[_0x0196('0x25')]({'plain':!![]});var _0x139753=_0x0196('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x139753,'userProfileId':_0x4031ef[_0x0196('0x4f')]},'raw':!![]})[_0x0196('0x23')](function(_0x2ff21e){if(_0x2ff21e&&_0x2ff21e[_0x0196('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x4d3ac6[_0x0196('0x2a')],'resourceId':_0x4d3ac6['id'],'type':_0x2ff21e[_0x0196('0x2a')],'sectionId':_0x2ff21e['id']},{})['then'](function(){return _0x137013;});}else{return _0x137013;}})['catch'](function(_0x2eeadd){logger[_0x0196('0x28')](_0x0196('0x51'),_0x2eeadd);throw _0x2eeadd;});}return _0x137013;})[_0x0196('0x23')](respondWithResult(_0x3d3e68,0xc9))[_0x0196('0x46')](handleError(_0x3d3e68,null));};exports[_0x0196('0x22')]=function(_0x367487,_0x4568c1){if(_0x367487[_0x0196('0x52')]['id']){delete _0x367487[_0x0196('0x52')]['id'];}return db[_0x0196('0x42')][_0x0196('0x4a')]({'where':{'id':_0x367487[_0x0196('0x48')]['id']}})[_0x0196('0x23')](handleEntityNotFound(_0x4568c1,null))[_0x0196('0x23')](saveUpdates(_0x367487[_0x0196('0x52')],null))[_0x0196('0x23')](respondWithResult(_0x4568c1,null))[_0x0196('0x46')](handleError(_0x4568c1,null));};exports['destroy']=function(_0x9df453,_0x22abde){return db['Pause']['find']({'where':{'id':_0x9df453[_0x0196('0x48')]['id']}})[_0x0196('0x23')](handleEntityNotFound(_0x22abde,null))[_0x0196('0x23')](removeEntity(_0x22abde,null))['catch'](handleError(_0x22abde,null));};
\ No newline at end of file
+var _0xb9c1=['name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','Pause','includeAll','include','rows','params','rawAttributes','options','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','Pauses','UserProfileResource','sendStatus','error'];(function(_0x5b64a1,_0x2ec810){var _0x4b6f55=function(_0x44dd84){while(--_0x44dd84){_0x5b64a1['push'](_0x5b64a1['shift']());}};_0x4b6f55(++_0x2ec810);}(_0xb9c1,0x18d));var _0x1b9c=function(_0x52605d,_0x4fb60e){_0x52605d=_0x52605d-0x0;var _0x39c247=_0xb9c1[_0x52605d];return _0x39c247;};'use strict';var emlformat=require(_0x1b9c('0x0'));var rimraf=require(_0x1b9c('0x1'));var zipdir=require(_0x1b9c('0x2'));var jsonpatch=require(_0x1b9c('0x3'));var rp=require(_0x1b9c('0x4'));var moment=require(_0x1b9c('0x5'));var BPromise=require(_0x1b9c('0x6'));var Mustache=require(_0x1b9c('0x7'));var util=require(_0x1b9c('0x8'));var path=require(_0x1b9c('0x9'));var sox=require('sox');var csv=require(_0x1b9c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b9c('0xb'));var _=require(_0x1b9c('0xc'));var squel=require(_0x1b9c('0xd'));var crypto=require(_0x1b9c('0xe'));var jsforce=require(_0x1b9c('0xf'));var deskjs=require(_0x1b9c('0x10'));var toCsv=require(_0x1b9c('0xa'));var querystring=require(_0x1b9c('0x11'));var Papa=require(_0x1b9c('0x12'));var Redis=require(_0x1b9c('0x13'));var authService=require(_0x1b9c('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x1b9c('0x15'));var hardwareService=require(_0x1b9c('0x16'));var logger=require(_0x1b9c('0x17'))(_0x1b9c('0x18'));var utils=require(_0x1b9c('0x19'));var config=require(_0x1b9c('0x1a'));var licenseUtil=require(_0x1b9c('0x1b'));var db=require(_0x1b9c('0x1c'))['db'];function respondWithStatusCode(_0x3b0a1c,_0x32dff5){_0x32dff5=_0x32dff5||0xcc;return function(_0x38c6ad){if(_0x38c6ad){return _0x3b0a1c['sendStatus'](_0x32dff5);}return _0x3b0a1c['status'](_0x32dff5)[_0x1b9c('0x1d')]();};}function respondWithResult(_0xb2954a,_0xefc0f){_0xefc0f=_0xefc0f||0xc8;return function(_0x56d004){if(_0x56d004){return _0xb2954a[_0x1b9c('0x1e')](_0xefc0f)[_0x1b9c('0x1f')](_0x56d004);}};}function respondWithFilteredResult(_0x1ea506,_0x1ca706){return function(_0x3a4595){if(_0x3a4595){var _0x436a19=typeof _0x1ca706[_0x1b9c('0x20')]===_0x1b9c('0x21')&&typeof _0x1ca706['limit']===_0x1b9c('0x21');var _0x1c93fc=_0x3a4595[_0x1b9c('0x22')];var _0x30774f=_0x436a19?0x0:_0x1ca706['offset'];var _0xf08417=_0x436a19?_0x3a4595[_0x1b9c('0x22')]:_0x1ca706[_0x1b9c('0x20')]+_0x1ca706[_0x1b9c('0x23')];var _0x20bc0d;if(_0xf08417>=_0x1c93fc){_0xf08417=_0x1c93fc;_0x20bc0d=0xc8;}else{_0x20bc0d=0xce;}_0x1ea506[_0x1b9c('0x1e')](_0x20bc0d);return _0x1ea506['set'](_0x1b9c('0x24'),_0x30774f+'-'+_0xf08417+'/'+_0x1c93fc)[_0x1b9c('0x1f')](_0x3a4595);}return null;};}function patchUpdates(_0x16968d){return function(_0x5dbfed){try{jsonpatch[_0x1b9c('0x25')](_0x5dbfed,_0x16968d,!![]);}catch(_0x22e551){return BPromise[_0x1b9c('0x26')](_0x22e551);}return _0x5dbfed[_0x1b9c('0x27')]();};}function saveUpdates(_0x217a44,_0xe6f3cc){return function(_0x1c60bd){if(_0x1c60bd){return _0x1c60bd[_0x1b9c('0x28')](_0x217a44)[_0x1b9c('0x29')](function(_0xfa3ffa){return _0xfa3ffa;});}return null;};}function removeEntity(_0x445995,_0x3ed96a){return function(_0x11b070){if(_0x11b070){return _0x11b070[_0x1b9c('0x2a')]()[_0x1b9c('0x29')](function(){var _0x187e86=_0x11b070[_0x1b9c('0x2b')]({'plain':!![]});var _0x508fef=_0x1b9c('0x2c');return db[_0x1b9c('0x2d')][_0x1b9c('0x2a')]({'where':{'type':_0x508fef,'resourceId':_0x187e86['id']}})[_0x1b9c('0x29')](function(){return _0x11b070;});})[_0x1b9c('0x29')](function(){_0x445995[_0x1b9c('0x1e')](0xcc)[_0x1b9c('0x1d')]();});}};}function handleEntityNotFound(_0x559ccd,_0x2578b1){return function(_0x250eaf){if(!_0x250eaf){_0x559ccd[_0x1b9c('0x2e')](0x194);}return _0x250eaf;};}function handleError(_0x17b694,_0x4ae0ca){_0x4ae0ca=_0x4ae0ca||0x1f4;return function(_0x320e6c){logger[_0x1b9c('0x2f')](_0x320e6c['stack']);if(_0x320e6c[_0x1b9c('0x30')]){delete _0x320e6c['name'];}_0x17b694[_0x1b9c('0x1e')](_0x4ae0ca)[_0x1b9c('0x31')](_0x320e6c);};}exports[_0x1b9c('0x32')]=function(_0x1a7abd,_0x297256){var _0x36c318={},_0x14cf5d={},_0x37ac3d={'count':0x0,'rows':[]};var _0x208dad=_[_0x1b9c('0x33')](db['Pause']['rawAttributes'],function(_0x29c541){return{'name':_0x29c541[_0x1b9c('0x34')],'type':_0x29c541[_0x1b9c('0x35')][_0x1b9c('0x36')]};});_0x14cf5d[_0x1b9c('0x37')]=_[_0x1b9c('0x33')](_0x208dad,_0x1b9c('0x30'));_0x14cf5d[_0x1b9c('0x38')]=_[_0x1b9c('0x39')](_0x1a7abd['query']);_0x14cf5d[_0x1b9c('0x3a')]=_[_0x1b9c('0x3b')](_0x14cf5d[_0x1b9c('0x37')],_0x14cf5d['query']);_0x36c318[_0x1b9c('0x3c')]=_[_0x1b9c('0x3b')](_0x14cf5d['model'],qs[_0x1b9c('0x3d')](_0x1a7abd[_0x1b9c('0x38')]['fields']));_0x36c318[_0x1b9c('0x3c')]=_0x36c318[_0x1b9c('0x3c')][_0x1b9c('0x3e')]?_0x36c318[_0x1b9c('0x3c')]:_0x14cf5d[_0x1b9c('0x37')];if(!_0x1a7abd[_0x1b9c('0x38')]['hasOwnProperty'](_0x1b9c('0x3f'))){_0x36c318['limit']=qs[_0x1b9c('0x23')](_0x1a7abd[_0x1b9c('0x38')][_0x1b9c('0x23')]);_0x36c318[_0x1b9c('0x20')]=qs[_0x1b9c('0x20')](_0x1a7abd[_0x1b9c('0x38')][_0x1b9c('0x20')]);}_0x36c318[_0x1b9c('0x40')]=qs['sort'](_0x1a7abd[_0x1b9c('0x38')][_0x1b9c('0x41')]);_0x36c318[_0x1b9c('0x42')]=qs[_0x1b9c('0x3a')](_[_0x1b9c('0x43')](_0x1a7abd['query'],_0x14cf5d[_0x1b9c('0x3a')]),_0x208dad);if(_0x1a7abd[_0x1b9c('0x38')][_0x1b9c('0x44')]){_0x36c318[_0x1b9c('0x42')]=_[_0x1b9c('0x45')](_0x36c318[_0x1b9c('0x42')],{'$or':_[_0x1b9c('0x33')](_0x208dad,function(_0x5ef865){if(_0x5ef865[_0x1b9c('0x35')]!==_0x1b9c('0x46')){var _0x3f1331={};_0x3f1331[_0x5ef865[_0x1b9c('0x30')]]={'$like':'%'+_0x1a7abd[_0x1b9c('0x38')]['filter']+'%'};return _0x3f1331;}})});}_0x36c318=_['merge']({},_0x36c318,_0x1a7abd['options']);var _0x3f2684={'where':_0x36c318[_0x1b9c('0x42')]};return db[_0x1b9c('0x47')]['count'](_0x3f2684)['then'](function(_0x1ce590){_0x37ac3d[_0x1b9c('0x22')]=_0x1ce590;if(_0x1a7abd[_0x1b9c('0x38')][_0x1b9c('0x48')]){_0x36c318[_0x1b9c('0x49')]=[{'all':!![]}];}return db[_0x1b9c('0x47')]['findAll'](_0x36c318);})[_0x1b9c('0x29')](function(_0x351992){_0x37ac3d[_0x1b9c('0x4a')]=_0x351992;return _0x37ac3d;})['then'](respondWithFilteredResult(_0x297256,_0x36c318))['catch'](handleError(_0x297256,null));};exports['show']=function(_0x39b280,_0x3fa9fe){var _0x3fa1b2={'raw':!![],'where':{'id':_0x39b280[_0x1b9c('0x4b')]['id']}},_0xb4b546={};_0xb4b546[_0x1b9c('0x37')]=_[_0x1b9c('0x39')](db[_0x1b9c('0x47')][_0x1b9c('0x4c')]);_0xb4b546[_0x1b9c('0x38')]=_['keys'](_0x39b280[_0x1b9c('0x38')]);_0xb4b546[_0x1b9c('0x3a')]=_[_0x1b9c('0x3b')](_0xb4b546[_0x1b9c('0x37')],_0xb4b546[_0x1b9c('0x38')]);_0x3fa1b2['attributes']=_[_0x1b9c('0x3b')](_0xb4b546[_0x1b9c('0x37')],qs[_0x1b9c('0x3d')](_0x39b280[_0x1b9c('0x38')][_0x1b9c('0x3d')]));_0x3fa1b2[_0x1b9c('0x3c')]=_0x3fa1b2[_0x1b9c('0x3c')][_0x1b9c('0x3e')]?_0x3fa1b2[_0x1b9c('0x3c')]:_0xb4b546[_0x1b9c('0x37')];if(_0x39b280[_0x1b9c('0x38')][_0x1b9c('0x48')]){_0x3fa1b2[_0x1b9c('0x49')]=[{'all':!![]}];}_0x3fa1b2=_['merge']({},_0x3fa1b2,_0x39b280[_0x1b9c('0x4d')]);return db[_0x1b9c('0x47')][_0x1b9c('0x4e')](_0x3fa1b2)[_0x1b9c('0x29')](handleEntityNotFound(_0x3fa9fe,null))[_0x1b9c('0x29')](respondWithResult(_0x3fa9fe,null))[_0x1b9c('0x4f')](handleError(_0x3fa9fe,null));};exports[_0x1b9c('0x50')]=function(_0x2e007b,_0x384a3e){return db[_0x1b9c('0x47')][_0x1b9c('0x50')](_0x2e007b['body'],{})[_0x1b9c('0x29')](function(_0x2904bf){var _0x4919de=_0x2e007b[_0x1b9c('0x51')][_0x1b9c('0x2b')]({'plain':!![]});if(!_0x4919de)throw new Error(_0x1b9c('0x52'));if(_0x4919de[_0x1b9c('0x53')]===_0x1b9c('0x51')){var _0x92580c=_0x2904bf[_0x1b9c('0x2b')]({'plain':!![]});var _0x5b8fbd='Pauses';return db[_0x1b9c('0x54')]['find']({'where':{'name':_0x5b8fbd,'userProfileId':_0x4919de[_0x1b9c('0x55')]},'raw':!![]})['then'](function(_0x3106c4){if(_0x3106c4&&_0x3106c4[_0x1b9c('0x56')]===0x0){return db[_0x1b9c('0x2d')][_0x1b9c('0x50')]({'name':_0x92580c[_0x1b9c('0x30')],'resourceId':_0x92580c['id'],'type':_0x3106c4[_0x1b9c('0x30')],'sectionId':_0x3106c4['id']},{})[_0x1b9c('0x29')](function(){return _0x2904bf;});}else{return _0x2904bf;}})[_0x1b9c('0x4f')](function(_0x3adca6){logger[_0x1b9c('0x2f')](_0x1b9c('0x57'),_0x3adca6);throw _0x3adca6;});}return _0x2904bf;})['then'](respondWithResult(_0x384a3e,0xc9))['catch'](handleError(_0x384a3e,null));};exports['update']=function(_0x15e53d,_0x3d33f7){if(_0x15e53d[_0x1b9c('0x58')]['id']){delete _0x15e53d[_0x1b9c('0x58')]['id'];}return db[_0x1b9c('0x47')]['find']({'where':{'id':_0x15e53d[_0x1b9c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3d33f7,null))[_0x1b9c('0x29')](saveUpdates(_0x15e53d[_0x1b9c('0x58')],null))[_0x1b9c('0x29')](respondWithResult(_0x3d33f7,null))[_0x1b9c('0x4f')](handleError(_0x3d33f7,null));};exports['destroy']=function(_0x4155c4,_0x31f74b){return db[_0x1b9c('0x47')][_0x1b9c('0x4e')]({'where':{'id':_0x4155c4[_0x1b9c('0x4b')]['id']}})[_0x1b9c('0x29')](handleEntityNotFound(_0x31f74b,null))[_0x1b9c('0x29')](removeEntity(_0x31f74b,null))['catch'](handleError(_0x31f74b,null));};
\ No newline at end of file
index 941acb5..aff6e0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','tools_pauses','lodash'];(function(_0x5b2d55,_0x401971){var _0x20b9e2=function(_0xe4b0c6){while(--_0xe4b0c6){_0x5b2d55['push'](_0x5b2d55['shift']());}};_0x20b9e2(++_0x401971);}(_0xabce,0x103));var _0xeabc=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xabce[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('Pause',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6aa7=['Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x6aa7,0x178));var _0x76aa=function(_0x2916b8,_0x4b4926){_0x2916b8=_0x2916b8-0x0;var _0x2e2488=_0x6aa7[_0x2916b8];return _0x2e2488;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var moment=require(_0x76aa('0x3'));var BPromise=require(_0x76aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76aa('0x5'));var rimraf=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1aceaa,_0x4d53f6){return _0x1aceaa[_0x76aa('0x8')](_0x76aa('0x9'),attributes,{'tableName':_0x76aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 46fad45..51ae180 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(_0x4d5fb8,_0x2a9bc9){var _0x3fd4d9=function(_0x36d753){while(--_0x36d753){_0x4d5fb8['push'](_0x4d5fb8['shift']());}};_0x3fd4d9(++_0x2a9bc9);}(_0xb10b,0x12a));var _0xbb10=function(_0xe775be,_0x4822af){_0xe775be=_0xe775be-0x0;var _0x49e73c=_0xb10b[_0xe775be];return _0x49e73c;};'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(_0x5ae13d,_0x45f064){var _0x453324=function(_0x303a51){while(--_0x303a51){_0x5ae13d['push'](_0x5ae13d['shift']());}};_0x453324(++_0x45f064);}(_0xb10b,0x12a));var _0xbb10=function(_0x8cb31b,_0x509016){_0x8cb31b=_0x8cb31b-0x0;var _0x2ce32e=_0xb10b[_0x8cb31b];return _0x2ce32e;};'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 8cb5c7a..6d805de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c4e=['webhookGet','/:id','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','basename','now','extname','post','single','file','upload','webhookPost','put','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','isAuthenticated','index','get','/webhook'];(function(_0x589fee,_0x358efb){var _0x2f8f27=function(_0x4ffa07){while(--_0x4ffa07){_0x589fee['push'](_0x589fee['shift']());}};_0x2f8f27(++_0x358efb);}(_0x4c4e,0x152));var _0xe4c4=function(_0x51e3b7,_0x27e92c){_0x51e3b7=_0x51e3b7-0x0;var _0x2076f7=_0x4c4e[_0x51e3b7];return _0x2076f7;};'use strict';var multer=require(_0xe4c4('0x0'));var util=require('util');var path=require(_0xe4c4('0x1'));var timeout=require(_0xe4c4('0x2'));var express=require(_0xe4c4('0x3'));var router=express['Router']();var fs_extra=require(_0xe4c4('0x4'));var auth=require(_0xe4c4('0x5'));var interaction=require(_0xe4c4('0x6'));var config=require('../../config/environment');var controller=require(_0xe4c4('0x7'));router['get']('/',auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x9')]);router[_0xe4c4('0xa')](_0xe4c4('0xb'),controller[_0xe4c4('0xc')]);router[_0xe4c4('0xa')](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller['show']);router['get'](_0xe4c4('0xe'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0xf')]);var upload=multer({'storage':multer[_0xe4c4('0x10')]({'destination':function(_0x333c08,_0x2f4d5f,_0x50264f){_0x50264f(null,path[_0xe4c4('0x11')](config[_0xe4c4('0x12')],_0xe4c4('0x13')));},'filename':function(_0x2483d0,_0x50bfab,_0x262083){_0x50bfab[_0xe4c4('0x14')]=_0x50bfab['originalname'][_0xe4c4('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x262083(null,util[_0xe4c4('0x16')]('%s-%s%s',path[_0xe4c4('0x17')](_0x50bfab[_0xe4c4('0x14')],path['extname'](_0x50bfab[_0xe4c4('0x14')])),Date[_0xe4c4('0x18')](),path[_0xe4c4('0x19')](_0x50bfab[_0xe4c4('0x14')])));}})});router[_0xe4c4('0x1a')]('/',upload[_0xe4c4('0x1b')](_0xe4c4('0x1c')),controller[_0xe4c4('0x1d')]);router[_0xe4c4('0x1a')](_0xe4c4('0xb'),controller[_0xe4c4('0x1e')]);router[_0xe4c4('0x1f')](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x20')]);router['delete'](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x21')]);module[_0xe4c4('0x22')]=router;
\ No newline at end of file
+var _0xbec5=['get','index','/webhook','webhookGet','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','extname','now','post','upload','webhookPost','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./plugin.controller'];(function(_0x26cc2a,_0x14d310){var _0x1a5a06=function(_0x945a81){while(--_0x945a81){_0x26cc2a['push'](_0x26cc2a['shift']());}};_0x1a5a06(++_0x14d310);}(_0xbec5,0xe5));var _0x5bec=function(_0x303064,_0x12f0c2){_0x303064=_0x303064-0x0;var _0x5a1d3d=_0xbec5[_0x303064];return _0x5a1d3d;};'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'),controller[_0x5bec('0xc')]);router[_0x5bec('0x9')](_0x5bec('0xd'),auth[_0x5bec('0xe')](),controller[_0x5bec('0xf')]);router['get'](_0x5bec('0x10'),auth['isAuthenticated'](),controller[_0x5bec('0x11')]);var upload=multer({'storage':multer[_0x5bec('0x12')]({'destination':function(_0x117162,_0x4a5482,_0x288d1b){_0x288d1b(null,path[_0x5bec('0x13')](config[_0x5bec('0x14')],'server/files/plugins'));},'filename':function(_0x6bee21,_0x1c888f,_0x589d14){_0x1c888f[_0x5bec('0x15')]=_0x1c888f[_0x5bec('0x15')][_0x5bec('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x589d14(null,util[_0x5bec('0x17')](_0x5bec('0x18'),path[_0x5bec('0x19')](_0x1c888f[_0x5bec('0x15')],path[_0x5bec('0x1a')](_0x1c888f[_0x5bec('0x15')])),Date[_0x5bec('0x1b')](),path[_0x5bec('0x1a')](_0x1c888f[_0x5bec('0x15')])));}})});router[_0x5bec('0x1c')]('/',upload['single']('file'),controller[_0x5bec('0x1d')]);router[_0x5bec('0x1c')](_0x5bec('0xb'),controller[_0x5bec('0x1e')]);router['put']('/:id',auth[_0x5bec('0xe')](),controller[_0x5bec('0x1f')]);router['delete'](_0x5bec('0xd'),auth[_0x5bec('0xe')](),controller[_0x5bec('0x20')]);module[_0x5bec('0x21')]=router;
\ No newline at end of file
index 0794a58..b1bb4fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42b2=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','ENUM','html','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','agentOnly','always','never'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x42b2,0x9d));var _0x242b=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x42b2[_0x4243a3];return _0x1b2a33;};'use strict';var Sequelize=require(_0x242b('0x0'));module[_0x242b('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x242b('0x2')](_0x242b('0x3'),'script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x242b('0x4')]},'path':{'type':Sequelize[_0x242b('0x5')],'comment':_0x242b('0x6')},'active':{'type':Sequelize[_0x242b('0x7')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x242b('0x2')]('adminOnly',_0x242b('0x8'),_0x242b('0x9'),_0x242b('0xa')),'defaultValue':_0x242b('0x9'),'comment':_0x242b('0xb')},'icon':{'type':Sequelize[_0x242b('0x5')]},'adminUrl':{'type':Sequelize[_0x242b('0x5')]},'agentUrl':{'type':Sequelize[_0x242b('0x5')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x242b('0x5')]}};
\ No newline at end of file
+var _0x1013=['sequelize','exports','ENUM','script','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','STRING'];(function(_0x16a326,_0x3d0456){var _0x120392=function(_0x417dd5){while(--_0x417dd5){_0x16a326['push'](_0x16a326['shift']());}};_0x120392(++_0x3d0456);}(_0x1013,0xbd));var _0x3101=function(_0x28ed7d,_0x57109d){_0x28ed7d=_0x28ed7d-0x0;var _0x266d03=_0x1013[_0x28ed7d];return _0x266d03;};'use strict';var Sequelize=require(_0x3101('0x0'));module[_0x3101('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3101('0x2')]('html',_0x3101('0x3'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize['STRING'],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x3101('0x2')]('adminOnly',_0x3101('0x4'),_0x3101('0x5'),_0x3101('0x6')),'defaultValue':_0x3101('0x5'),'comment':_0x3101('0x7')},'icon':{'type':Sequelize[_0x3101('0x8')]},'adminUrl':{'type':Sequelize[_0x3101('0x8')]},'agentUrl':{'type':Sequelize[_0x3101('0x8')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 5f21f30..9dce4e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc19=['sort','filters','pick','filter','where','VIRTUAL','merge','options','findAll','rows','catch','show','params','fields','includeAll','find','download','path','root','format','%s.zip','code','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','glob','join','server/files/plugins','dirname','basename','attachments/**/*','finalize','close','existsSync','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','error','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','always','icon','icon-apps','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','test','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','update','delete','webhookGet','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','eml-format','rimraf','zip-dir','fast-json-patch','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./plugin.socket','sendStatus','status','json','offset','undefined','limit','count','set','save','then','destroy','get','Plugins','UserProfileResource','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','length','nolimit','order'];(function(_0x232b5e,_0x4c1c7f){var _0x2c8f33=function(_0x350d93){while(--_0x350d93){_0x232b5e['push'](_0x232b5e['shift']());}};_0x2c8f33(++_0x4c1c7f);}(_0xcc19,0x114));var _0x9cc1=function(_0x1b2cf0,_0x3e1559){_0x1b2cf0=_0x1b2cf0-0x0;var _0x566935=_0xcc19[_0x1b2cf0];return _0x566935;};'use strict';var emlformat=require(_0x9cc1('0x0'));var rimraf=require(_0x9cc1('0x1'));var zipdir=require(_0x9cc1('0x2'));var jsonpatch=require(_0x9cc1('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9cc1('0x4'));var util=require('util');var path=require('path');var sox=require(_0x9cc1('0x5'));var csv=require(_0x9cc1('0x6'));var ejs=require(_0x9cc1('0x7'));var fs=require('fs');var fs_extra=require(_0x9cc1('0x8'));var _=require(_0x9cc1('0x9'));var squel=require(_0x9cc1('0xa'));var crypto=require(_0x9cc1('0xb'));var jsforce=require(_0x9cc1('0xc'));var deskjs=require(_0x9cc1('0xd'));var toCsv=require(_0x9cc1('0x6'));var querystring=require(_0x9cc1('0xe'));var Papa=require(_0x9cc1('0xf'));var extract=require(_0x9cc1('0x10'));var rimraf=require(_0x9cc1('0x1'));var archiver=require(_0x9cc1('0x11'));var Redis=require('ioredis');var authService=require(_0x9cc1('0x12'));var qs=require(_0x9cc1('0x13'));var as=require(_0x9cc1('0x14'));var hardwareService=require(_0x9cc1('0x15'));var logger=require(_0x9cc1('0x16'))('api');var utils=require(_0x9cc1('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9cc1('0x18'));var db=require(_0x9cc1('0x19'))['db'];config[_0x9cc1('0x1a')]=_[_0x9cc1('0x1b')](config[_0x9cc1('0x1a')],{'host':_0x9cc1('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9cc1('0x1a')]));require(_0x9cc1('0x1d'))['register'](socket);function respondWithStatusCode(_0x261978,_0x4d4f96){_0x4d4f96=_0x4d4f96||0xcc;return function(_0x45e0ef){if(_0x45e0ef){return _0x261978[_0x9cc1('0x1e')](_0x4d4f96);}return _0x261978[_0x9cc1('0x1f')](_0x4d4f96)['end']();};}function respondWithResult(_0x3113fc,_0x4fade2){_0x4fade2=_0x4fade2||0xc8;return function(_0x59a2c1){if(_0x59a2c1){return _0x3113fc['status'](_0x4fade2)[_0x9cc1('0x20')](_0x59a2c1);}};}function respondWithFilteredResult(_0x4b2eb0,_0x2a5f23){return function(_0x5e4186){if(_0x5e4186){var _0x15324c=typeof _0x2a5f23[_0x9cc1('0x21')]===_0x9cc1('0x22')&&typeof _0x2a5f23[_0x9cc1('0x23')]===_0x9cc1('0x22');var _0x3a227f=_0x5e4186[_0x9cc1('0x24')];var _0x59a98c=_0x15324c?0x0:_0x2a5f23['offset'];var _0x4ebf5f=_0x15324c?_0x5e4186['count']:_0x2a5f23[_0x9cc1('0x21')]+_0x2a5f23[_0x9cc1('0x23')];var _0x5acaad;if(_0x4ebf5f>=_0x3a227f){_0x4ebf5f=_0x3a227f;_0x5acaad=0xc8;}else{_0x5acaad=0xce;}_0x4b2eb0[_0x9cc1('0x1f')](_0x5acaad);return _0x4b2eb0[_0x9cc1('0x25')]('Content-Range',_0x59a98c+'-'+_0x4ebf5f+'/'+_0x3a227f)[_0x9cc1('0x20')](_0x5e4186);}return null;};}function patchUpdates(_0x16376b){return function(_0x5bdc3d){try{jsonpatch['apply'](_0x5bdc3d,_0x16376b,!![]);}catch(_0x269555){return BPromise['reject'](_0x269555);}return _0x5bdc3d[_0x9cc1('0x26')]();};}function saveUpdates(_0x1d5fe1,_0x3b42d4){return function(_0x3bc4bc){if(_0x3bc4bc){return _0x3bc4bc['update'](_0x1d5fe1)[_0x9cc1('0x27')](function(_0x531fe4){return _0x531fe4;});}return null;};}function removeEntity(_0x40cf0b,_0x3471ef){return function(_0x23319c){if(_0x23319c){return _0x23319c[_0x9cc1('0x28')]()['then'](function(){var _0x3f8eee=_0x23319c[_0x9cc1('0x29')]({'plain':!![]});var _0x49002f=_0x9cc1('0x2a');return db[_0x9cc1('0x2b')][_0x9cc1('0x28')]({'where':{'type':_0x49002f,'resourceId':_0x3f8eee['id']}})['then'](function(){return _0x23319c;});})['then'](function(){_0x40cf0b[_0x9cc1('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x329dc3,_0x4424c8){return function(_0x539ce8){if(!_0x539ce8){_0x329dc3[_0x9cc1('0x1e')](0x194);}return _0x539ce8;};}function handleError(_0x3162a9,_0x1238e4){_0x1238e4=_0x1238e4||0x1f4;return function(_0x37bfb6){logger['error'](_0x37bfb6[_0x9cc1('0x2c')]);if(_0x37bfb6[_0x9cc1('0x2d')]){delete _0x37bfb6[_0x9cc1('0x2d')];}_0x3162a9[_0x9cc1('0x1f')](_0x1238e4)[_0x9cc1('0x2e')](_0x37bfb6);};}exports[_0x9cc1('0x2f')]=function(_0x5ef0e7,_0x1c9817){var _0x1f72b3={},_0x269fdf={},_0x29f75a={'count':0x0,'rows':[]};var _0x53214f=_[_0x9cc1('0x30')](db[_0x9cc1('0x31')][_0x9cc1('0x32')],function(_0x4c8294){return{'name':_0x4c8294[_0x9cc1('0x33')],'type':_0x4c8294[_0x9cc1('0x34')][_0x9cc1('0x35')]};});_0x269fdf['model']=_['map'](_0x53214f,_0x9cc1('0x2d'));_0x269fdf[_0x9cc1('0x36')]=_[_0x9cc1('0x37')](_0x5ef0e7['query']);_0x269fdf['filters']=_['intersection'](_0x269fdf[_0x9cc1('0x38')],_0x269fdf[_0x9cc1('0x36')]);_0x1f72b3[_0x9cc1('0x39')]=_[_0x9cc1('0x3a')](_0x269fdf['model'],qs['fields'](_0x5ef0e7[_0x9cc1('0x36')]['fields']));_0x1f72b3[_0x9cc1('0x39')]=_0x1f72b3[_0x9cc1('0x39')][_0x9cc1('0x3b')]?_0x1f72b3['attributes']:_0x269fdf['model'];if(!_0x5ef0e7[_0x9cc1('0x36')]['hasOwnProperty'](_0x9cc1('0x3c'))){_0x1f72b3['limit']=qs['limit'](_0x5ef0e7[_0x9cc1('0x36')][_0x9cc1('0x23')]);_0x1f72b3[_0x9cc1('0x21')]=qs[_0x9cc1('0x21')](_0x5ef0e7[_0x9cc1('0x36')][_0x9cc1('0x21')]);}_0x1f72b3[_0x9cc1('0x3d')]=qs[_0x9cc1('0x3e')](_0x5ef0e7[_0x9cc1('0x36')]['sort']);_0x1f72b3['where']=qs[_0x9cc1('0x3f')](_[_0x9cc1('0x40')](_0x5ef0e7[_0x9cc1('0x36')],_0x269fdf[_0x9cc1('0x3f')]),_0x53214f);if(_0x5ef0e7['query'][_0x9cc1('0x41')]){_0x1f72b3['where']=_['merge'](_0x1f72b3[_0x9cc1('0x42')],{'$or':_[_0x9cc1('0x30')](_0x53214f,function(_0xc9a780){if(_0xc9a780['type']!==_0x9cc1('0x43')){var _0x203e0f={};_0x203e0f[_0xc9a780[_0x9cc1('0x2d')]]={'$like':'%'+_0x5ef0e7['query'][_0x9cc1('0x41')]+'%'};return _0x203e0f;}})});}_0x1f72b3=_[_0x9cc1('0x44')]({},_0x1f72b3,_0x5ef0e7[_0x9cc1('0x45')]);var _0x1e92b7={'where':_0x1f72b3[_0x9cc1('0x42')]};return db['Plugin']['count'](_0x1e92b7)['then'](function(_0x5dc409){_0x29f75a[_0x9cc1('0x24')]=_0x5dc409;if(_0x5ef0e7[_0x9cc1('0x36')]['includeAll']){_0x1f72b3['include']=[{'all':!![]}];}return db[_0x9cc1('0x31')][_0x9cc1('0x46')](_0x1f72b3);})[_0x9cc1('0x27')](function(_0x477080){_0x29f75a[_0x9cc1('0x47')]=_0x477080;return _0x29f75a;})[_0x9cc1('0x27')](respondWithFilteredResult(_0x1c9817,_0x1f72b3))[_0x9cc1('0x48')](handleError(_0x1c9817,null));};exports[_0x9cc1('0x49')]=function(_0x17e226,_0x2365e5){var _0xf178d4={'raw':!![],'where':{'id':_0x17e226[_0x9cc1('0x4a')]['id']}},_0x1821a1={};_0x1821a1['model']=_['keys'](db[_0x9cc1('0x31')][_0x9cc1('0x32')]);_0x1821a1['query']=_[_0x9cc1('0x37')](_0x17e226[_0x9cc1('0x36')]);_0x1821a1[_0x9cc1('0x3f')]=_[_0x9cc1('0x3a')](_0x1821a1[_0x9cc1('0x38')],_0x1821a1['query']);_0xf178d4[_0x9cc1('0x39')]=_['intersection'](_0x1821a1[_0x9cc1('0x38')],qs['fields'](_0x17e226['query'][_0x9cc1('0x4b')]));_0xf178d4[_0x9cc1('0x39')]=_0xf178d4[_0x9cc1('0x39')][_0x9cc1('0x3b')]?_0xf178d4[_0x9cc1('0x39')]:_0x1821a1[_0x9cc1('0x38')];if(_0x17e226[_0x9cc1('0x36')][_0x9cc1('0x4c')]){_0xf178d4['include']=[{'all':!![]}];}_0xf178d4=_[_0x9cc1('0x44')]({},_0xf178d4,_0x17e226[_0x9cc1('0x45')]);return db['Plugin'][_0x9cc1('0x4d')](_0xf178d4)[_0x9cc1('0x27')](handleEntityNotFound(_0x2365e5,null))['then'](respondWithResult(_0x2365e5,null))[_0x9cc1('0x48')](handleError(_0x2365e5,null));};exports[_0x9cc1('0x4e')]=function(_0x545895,_0x10c73f,_0x1f7e83){return db[_0x9cc1('0x31')][_0x9cc1('0x4d')]({'where':{'id':_0x545895[_0x9cc1('0x4a')]['id']},'attributes':['name',_0x9cc1('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x10c73f,null))[_0x9cc1('0x27')](function(_0x258bd5){if(_0x258bd5){var _0x329a06=path['join'](config[_0x9cc1('0x50')],'server/files/plugins',util[_0x9cc1('0x51')](_0x9cc1('0x52'),path['basename'](_0x258bd5[_0x9cc1('0x4f')])));var _0x3c48ec=fs['createWriteStream'](_0x329a06);var _0x55f891=archiver('zip',{'zlib':{'level':0x9}});_0x55f891['on']('warning',function(_0x144eee){if(_0x144eee[_0x9cc1('0x53')]===_0x9cc1('0x54')){logger['error'](_0x144eee);}else{throw new db[(_0x9cc1('0x55'))]['Error'](_0x9cc1('0x56'));}});_0x55f891['on']('error',function(_0x5cf80c){throw new db[(_0x9cc1('0x55'))][(_0x9cc1('0x57'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x55f891['pipe'](_0x3c48ec);_0x55f891[_0x9cc1('0x58')]('**/*',{'cwd':path[_0x9cc1('0x59')](config['root'],_0x9cc1('0x5a'),path[_0x9cc1('0x5b')](_0x258bd5[_0x9cc1('0x4f')])),'ignore':[path[_0x9cc1('0x59')](path[_0x9cc1('0x5c')](_0x258bd5[_0x9cc1('0x4f')]),'node_modules/**/*'),path[_0x9cc1('0x59')](path[_0x9cc1('0x5c')](_0x258bd5[_0x9cc1('0x4f')]),_0x9cc1('0x5d'))],'nodir':!![]})[_0x9cc1('0x5e')]();_0x3c48ec['on'](_0x9cc1('0x5f'),function(){if(!fs[_0x9cc1('0x60')](_0x329a06)){throw new db[(_0x9cc1('0x55'))][(_0x9cc1('0x57'))]('Plugin\x20not\x20found');}return _0x10c73f[_0x9cc1('0x4e')](_0x329a06,util['format']('%s.zip',path['basename'](_0x258bd5[_0x9cc1('0x4f')])),function(_0x42968c){if(_0x42968c){throw new db[(_0x9cc1('0x55'))][(_0x9cc1('0x57'))](_0x9cc1('0x61'));}fs[_0x9cc1('0x62')](_0x329a06);logger[_0x9cc1('0x63')](_0x9cc1('0x64'));logger['info'](_0x9cc1('0x65'));});});}return null;})[_0x9cc1('0x48')](handleError(_0x10c73f,null));};exports[_0x9cc1('0x66')]=function(_0x57186d,_0x2b3744,_0x4b85a1){var _0x18ea26=path[_0x9cc1('0x5c')](_0x57186d[_0x9cc1('0x67')][_0x9cc1('0x68')],path[_0x9cc1('0x69')](_0x57186d[_0x9cc1('0x67')][_0x9cc1('0x68')]));var _0x564160=path[_0x9cc1('0x59')](config[_0x9cc1('0x50')],'server/files/plugins',_0x57186d['file'][_0x9cc1('0x68')]);var _0x1f76e7=path['join'](config[_0x9cc1('0x50')],'server/files/plugins',_0x18ea26);logger[_0x9cc1('0x63')](_0x9cc1('0x6a'),_0x564160);logger['info'](_0x9cc1('0x6b'),_0x1f76e7);try{fs[_0x9cc1('0x6c')](_0x564160,parseInt(_0x9cc1('0x6d'),0x8));extract(_0x564160,{'dir':_0x1f76e7},function(_0x480f58){if(_0x480f58){logger[_0x9cc1('0x6e')](_0x480f58);handleError(_0x480f58,!![]);};var _0x248a04=fs['readdirSync'](_0x1f76e7);if(_0x248a04[_0x9cc1('0x3b')]>0x1){removeReferences(_0x564160,_0x1f76e7);logger[_0x9cc1('0x6e')](_0x9cc1('0x6f'));return _0x4b85a1(new Error(_0x9cc1('0x6f')));}var _0x515001=fs[_0x9cc1('0x70')](path[_0x9cc1('0x59')](_0x1f76e7,_0x248a04[0x0]));if(_0x515001[_0x9cc1('0x71')]()){removeReferences(_0x564160,_0x1f76e7);logger['error'](_0x9cc1('0x6f'));return _0x4b85a1(new Error(_0x9cc1('0x6f')));}if(_0x515001[_0x9cc1('0x72')]()){var _0x4c26f1=fs['readdirSync'](path['join'](_0x1f76e7,_0x248a04[0x0]));if(_0x4c26f1[_0x9cc1('0x3b')]===0x0){removeReferences(_0x564160,_0x1f76e7);logger[_0x9cc1('0x6e')](_0x9cc1('0x6f'));return _0x4b85a1(new Error('Invalid\x20plugin\x20structure'));}var _0x23e902=_0x4c26f1[_0x9cc1('0x73')](function(_0x47d027){return _0x47d027===_0x9cc1('0x74');});if(!_0x23e902){return _0x4b85a1(new Error(_0x9cc1('0x75')));}var _0x1020ca=fs['readFileSync'](path[_0x9cc1('0x59')](_0x1f76e7,_0x248a04[0x0],_0x9cc1('0x74')));var _0xdc8360=JSON['parse'](_0x1020ca);if('undefined'==typeof _0xdc8360[_0x9cc1('0x2d')]){return _0x4b85a1(new Error(_0x9cc1('0x76')));}if(_0x9cc1('0x22')==typeof _0xdc8360[_0x9cc1('0x34')]){return _0x4b85a1(new Error(_0x9cc1('0x77')));}if(_0x9cc1('0x22')==typeof _0xdc8360[_0x9cc1('0x78')]){return _0x4b85a1(new Error(_0x9cc1('0x79')));}if(_0x9cc1('0x22')==typeof _0xdc8360[_0x9cc1('0x7a')]){return _0x4b85a1(new Error(_0x9cc1('0x7b')));}if(_0xdc8360[_0x9cc1('0x34')]===_0x9cc1('0x7c')){if('undefined'==typeof _0xdc8360[_0x9cc1('0x7a')][_0x9cc1('0x7d')]){return _0x4b85a1(new Error(_0x9cc1('0x7e')));}if(_0x9cc1('0x22')==typeof _0xdc8360['parameters'][_0x9cc1('0x7d')][_0x9cc1('0x7f')]&&_0x9cc1('0x22')==typeof _0xdc8360[_0x9cc1('0x7a')][_0x9cc1('0x7d')]['agent']){return _0x4b85a1(new Error(_0x9cc1('0x80')));}}else if(_0xdc8360['type']===_0x9cc1('0x81')){if('undefined'==typeof _0xdc8360[_0x9cc1('0x7a')][_0x9cc1('0x82')]){return _0x4b85a1(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x9cc1('0x22')==typeof _0xdc8360[_0x9cc1('0x7a')][_0x9cc1('0x83')]){return _0x4b85a1(new Error(_0x9cc1('0x84')));}}else{return _0x4b85a1(new Error(_0x9cc1('0x85')));}var _0xae13e4=_0xdc8360['name'];var _0x43b3cd=_0xdc8360[_0x9cc1('0x86')];var _0x3a93e5=_0xdc8360[_0x9cc1('0x34')];var _0xa08b63=_0xdc8360['sidebar']?_0xdc8360['sidebar']:_0x9cc1('0x87');var _0x7b5e70=_0xdc8360[_0x9cc1('0x88')]?_0xdc8360[_0x9cc1('0x88')]:_0x9cc1('0x89');var _0x4bec7d='';var _0x42d831='';var _0x35f3ec='';var _0x54664a='';var _0x16b562=_0xdc8360[_0x9cc1('0x78')];if(_0x3a93e5===_0x9cc1('0x7c')){if(_0x9cc1('0x22')!=typeof _0xdc8360[_0x9cc1('0x7a')]['views'][_0x9cc1('0x7f')]){var _0x3b6af8=_0xdc8360['parameters']['views']['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x3b6af8)){_0x4bec7d=path[_0x9cc1('0x59')](_0x9cc1('0x8a'),_0x18ea26,_0x248a04[0x0],_0x3b6af8);}else{_0x4bec7d=_0x3b6af8;}}else{logger[_0x9cc1('0x63')](_0x9cc1('0x8b'));}if('undefined'!=typeof _0xdc8360['parameters'][_0x9cc1('0x7d')][_0x9cc1('0x8c')]){var _0x3aa195=_0xdc8360[_0x9cc1('0x7a')]['views'][_0x9cc1('0x8c')];if(!/^(f|ht)tps?:\/\//i[_0x9cc1('0x8d')](_0x3aa195)){_0x42d831=path[_0x9cc1('0x59')](_0x9cc1('0x8a'),_0x18ea26,_0x248a04[0x0],_0x3aa195);}else{_0x42d831=_0x3aa195;}}else{logger[_0x9cc1('0x63')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x3a93e5===_0x9cc1('0x81')){_0x35f3ec=_0xdc8360[_0x9cc1('0x7a')][_0x9cc1('0x82')];_0x54664a=_0xdc8360[_0x9cc1('0x7a')][_0x9cc1('0x83')];if(_0x9cc1('0x22')!=typeof _0xdc8360[_0x9cc1('0x7a')]['views']){if('undefined'!=typeof _0xdc8360[_0x9cc1('0x7a')][_0x9cc1('0x7d')]['admin']){var _0x3b6af8=_0xdc8360[_0x9cc1('0x7a')][_0x9cc1('0x7d')][_0x9cc1('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x9cc1('0x8d')](_0x3b6af8)){_0x4bec7d=path[_0x9cc1('0x59')](_0x9cc1('0x8a'),_0x18ea26,_0x248a04[0x0],_0x3b6af8);}else{_0x4bec7d=_0x3b6af8;}}if(_0x9cc1('0x22')!=typeof _0xdc8360['parameters'][_0x9cc1('0x7d')][_0x9cc1('0x8c')]){var _0x3aa195=_0xdc8360[_0x9cc1('0x7a')]['views'][_0x9cc1('0x8c')];if(!/^(f|ht)tps?:\/\//i['test'](_0x3aa195)){_0x42d831=path[_0x9cc1('0x59')]('plugins',_0x18ea26,_0x248a04[0x0],_0x3aa195);}else{_0x42d831=_0x3aa195;}}}}var _0x1d3011={'name':_0xae13e4,'description':_0x43b3cd,'path':path[_0x9cc1('0x59')](_0x18ea26,_0x248a04[0x0]),'type':_0x3a93e5,'sidebar':_0xa08b63,'icon':_0x7b5e70,'adminUrl':_0x4bec7d,'agentUrl':_0x42d831,'scriptName':_0x35f3ec,'scriptPath':_0x54664a,'version':_0x16b562};removeReferences(_0x564160,null);return db[_0x9cc1('0x31')][_0x9cc1('0x8e')](_0x1d3011)[_0x9cc1('0x27')](function(_0x44ef81){var _0x1f0dd4={'role':_0x57186d[_0x9cc1('0x8f')][_0x9cc1('0x90')],'userProfileId':_0x57186d[_0x9cc1('0x8f')][_0x9cc1('0x91')]};if(!_0x1f0dd4)throw new Error(_0x9cc1('0x92'));if(_0x1f0dd4['role']===_0x9cc1('0x93')){var _0x30f638=_0x44ef81[_0x9cc1('0x29')]({'plain':!![]});return db[_0x9cc1('0x94')][_0x9cc1('0x4d')]({'where':{'name':'Plugins','userProfileId':_0x1f0dd4['userProfileId']},'raw':!![]})[_0x9cc1('0x27')](function(_0x299430){if(_0x299430&&_0x299430['autoAssociation']===0x0){return db[_0x9cc1('0x2b')]['create']({'name':_0x30f638[_0x9cc1('0x2d')],'resourceId':_0x30f638['id'],'type':_0x299430[_0x9cc1('0x2d')],'sectionId':_0x299430['id']},{})[_0x9cc1('0x27')](function(){return _0x44ef81;});}else{return _0x44ef81;}})[_0x9cc1('0x48')](function(_0x57e765){logger[_0x9cc1('0x6e')](_0x9cc1('0x95'),_0x57e765);throw _0x57e765;});}return _0x44ef81;})['then'](respondWithResult(_0x2b3744,null))[_0x9cc1('0x48')](handleError(_0x2b3744,null));}});}catch(_0x28fe6e){_0x2b3744[_0x9cc1('0x1f')](0x1f4)[_0x9cc1('0x2e')](_0x28fe6e);}};function removeReferences(_0x364f13,_0x554aed){try{if(_0x364f13){fs[_0x9cc1('0x62')](_0x364f13);logger[_0x9cc1('0x63')](_0x9cc1('0x96'));}if(_0x554aed){rimraf(_0x554aed,function(){});logger['info']('Extracted\x20folder\x20removed');}}catch(_0x4b028d){logger[_0x9cc1('0x6e')](_0x4b028d);}}exports[_0x9cc1('0x97')]=function(_0x368844,_0x1b5a74,_0x54339c){return db[_0x9cc1('0x31')][_0x9cc1('0x4d')]({'where':{'id':_0x368844['params']['id']}})[_0x9cc1('0x27')](handleEntityNotFound(_0x1b5a74,null))['then'](saveUpdates(_0x368844[_0x9cc1('0x8f')],null))[_0x9cc1('0x27')](respondWithResult(_0x1b5a74,null))[_0x9cc1('0x48')](handleError(_0x1b5a74,null));};exports[_0x9cc1('0x98')]=function(_0x4cf566,_0x560101,_0x39321c){return db[_0x9cc1('0x31')][_0x9cc1('0x4d')]({'where':{'id':_0x4cf566[_0x9cc1('0x4a')]['id']}})['then'](function(_0xdcd4a1){if(_0xdcd4a1){return _0xdcd4a1[_0x9cc1('0x28')]();}})[_0x9cc1('0x27')](function(_0x1a6443){rimraf(path[_0x9cc1('0x59')](config[_0x9cc1('0x50')],_0x9cc1('0x5a'),path[_0x9cc1('0x5b')](_0x1a6443[_0x9cc1('0x4f')])),function(){});return _0x1a6443;})['then'](handleEntityNotFound(_0x560101,null))['then'](respondWithStatusCode(_0x560101,null))[_0x9cc1('0x48')](handleError(_0x560101,null));};exports[_0x9cc1('0x99')]=function(_0x7392ab,_0x35e88d,_0x5083ef){return BPromise[_0x9cc1('0x9a')]()['then'](function(){if(!_0x7392ab['query'][_0x9cc1('0x4f')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x7392ab[_0x9cc1('0x36')][_0x9cc1('0x9b')]){throw new Error(_0x9cc1('0x9c'));}var _0x13d137=_0x7392ab['query'][_0x9cc1('0x9d')]?_0x7392ab[_0x9cc1('0x36')][_0x9cc1('0x9d')]+':'+_0x7392ab[_0x9cc1('0x36')][_0x9cc1('0x9b')]:_0x9cc1('0x9e')+_0x7392ab[_0x9cc1('0x36')][_0x9cc1('0x9b')];var _0x20a53a=_0x7392ab['query'][_0x9cc1('0x20')]?_0x7392ab['query'][_0x9cc1('0x20')]:!![];var _0x15c33d=_0x7392ab[_0x9cc1('0x36')]['encoding']?_0x7392ab[_0x9cc1('0x36')][_0x9cc1('0x9f')]:null;var _0x3a105a={'method':_0x7392ab[_0x9cc1('0xa0')],'uri':util[_0x9cc1('0x51')](_0x9cc1('0xa1'),_0x13d137,_0x7392ab[_0x9cc1('0x36')][_0x9cc1('0x4f')]),'json':_0x20a53a,'resolveWithFullResponse':!![],'encoding':_0x15c33d,'qs':_0x7392ab[_0x9cc1('0x36')]};if(_0x7392ab[_0x9cc1('0xa2')]){_0x3a105a[_0x9cc1('0xa2')]=_0x7392ab[_0x9cc1('0xa2')];if(_0x3a105a['headers'][_0x9cc1('0xa3')]){delete _0x3a105a[_0x9cc1('0xa2')][_0x9cc1('0xa3')];}}if(_0x3a105a[_0x9cc1('0xa2')][_0x9cc1('0xa4')]){delete _0x3a105a['headers']['content-type'];}return rp(_0x3a105a);})[_0x9cc1('0x27')](function(_0x51cf40){if(_0x51cf40){_0x35e88d[_0x9cc1('0x25')](_0x51cf40['headers']);logger[_0x9cc1('0x63')](_0x51cf40[_0x9cc1('0x8f')]);if(_[_0x9cc1('0xa5')](_0x7392ab[_0x9cc1('0x36')][_0x9cc1('0x4f')],'download')&&_0x51cf40[_0x9cc1('0xa6')]==0x1f4){return _0x35e88d[_0x9cc1('0x1e')](_0x51cf40[_0x9cc1('0xa6')]);}else{return _0x35e88d[_0x9cc1('0x1f')](_0x51cf40[_0x9cc1('0xa6')])['send'](_0x51cf40['body']);}}else{return _0x35e88d[_0x9cc1('0x1e')](0xc8);}})['catch'](handleError(_0x35e88d,null));};exports[_0x9cc1('0xa7')]=function(_0xcb4e4,_0x33bd3e,_0x347bfe){return BPromise[_0x9cc1('0x9a')]()['then'](function(){if(!_0xcb4e4[_0x9cc1('0x36')][_0x9cc1('0x4f')]){throw new Error(_0x9cc1('0xa8'));}if(!_0xcb4e4[_0x9cc1('0x36')][_0x9cc1('0x9b')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x35002e=_0xcb4e4['query'][_0x9cc1('0x9d')]?_0xcb4e4[_0x9cc1('0x36')]['hostname']+':'+_0xcb4e4['query']['port']:_0x9cc1('0x9e')+_0xcb4e4[_0x9cc1('0x36')]['port'];var _0x15903c=_0xcb4e4[_0x9cc1('0x36')][_0x9cc1('0x20')]?_0xcb4e4[_0x9cc1('0x36')]['json']:!![];var _0x39bbc3=_0xcb4e4['query']['encoding']?_0xcb4e4[_0x9cc1('0x36')][_0x9cc1('0x9f')]:null;var _0x3fa11b={'method':_0xcb4e4['method'],'uri':util[_0x9cc1('0x51')]('%s%s',_0x35002e,_0xcb4e4[_0x9cc1('0x36')]['path']),'json':_0x15903c,'resolveWithFullResponse':!![],'encoding':_0x39bbc3,'body':_0xcb4e4[_0x9cc1('0x8f')]};if(_0xcb4e4[_0x9cc1('0xa2')]){_0x3fa11b['headers']=_0xcb4e4[_0x9cc1('0xa2')];if(_0x3fa11b[_0x9cc1('0xa2')][_0x9cc1('0xa3')]){delete _0x3fa11b[_0x9cc1('0xa2')][_0x9cc1('0xa3')];}}if(_0x3fa11b['headers']['content-type']){delete _0x3fa11b[_0x9cc1('0xa2')][_0x9cc1('0xa4')];}return rp(_0x3fa11b);})[_0x9cc1('0x27')](function(_0x33b7cf){if(_0x33b7cf){_0x33bd3e[_0x9cc1('0x25')](_0x33b7cf[_0x9cc1('0xa2')]);logger['info'](_0x33b7cf[_0x9cc1('0x8f')]);return _0x33bd3e[_0x9cc1('0x1f')](_0x33b7cf[_0x9cc1('0xa6')])[_0x9cc1('0x2e')](_0x33b7cf[_0x9cc1('0x8f')]);}else{return _0x33bd3e[_0x9cc1('0x1e')](0xc8);}})[_0x9cc1('0x48')](handleError(_0x33bd3e,null));};
\ No newline at end of file
+var _0x6c16=['include','findAll','options','download','params','root','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','**/*','join','server/files/plugins','dirname','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','catch','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','undefined','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','parameters','views','admin','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','always','icon','icon-apps','html','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','script','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','Plugins','autoAssociation','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','statusCode','sendStatus','webhookPost','eml-format','rimraf','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','extract-zip','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','./plugin.socket','register','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','destroy','get','UserProfileResource','then','error','name','send','index','Plugin','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x6c16,0x1b9));var _0x66c1=function(_0x344d25,_0x904e8){_0x344d25=_0x344d25-0x0;var _0x393228=_0x6c16[_0x344d25];return _0x393228;};'use strict';var emlformat=require(_0x66c1('0x0'));var rimraf=require(_0x66c1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x66c1('0x2'));var rp=require('request-promise');var moment=require(_0x66c1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x66c1('0x4'));var util=require('util');var path=require(_0x66c1('0x5'));var sox=require(_0x66c1('0x6'));var csv=require(_0x66c1('0x7'));var ejs=require(_0x66c1('0x8'));var fs=require('fs');var fs_extra=require(_0x66c1('0x9'));var _=require(_0x66c1('0xa'));var squel=require(_0x66c1('0xb'));var crypto=require('crypto');var jsforce=require(_0x66c1('0xc'));var deskjs=require(_0x66c1('0xd'));var toCsv=require('to-csv');var querystring=require(_0x66c1('0xe'));var Papa=require('papaparse');var extract=require(_0x66c1('0xf'));var rimraf=require(_0x66c1('0x1'));var archiver=require('archiver');var Redis=require(_0x66c1('0x10'));var authService=require(_0x66c1('0x11'));var qs=require(_0x66c1('0x12'));var as=require(_0x66c1('0x13'));var hardwareService=require(_0x66c1('0x14'));var logger=require(_0x66c1('0x15'))(_0x66c1('0x16'));var utils=require(_0x66c1('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x66c1('0x18'));var db=require('../../mysqldb')['db'];config[_0x66c1('0x19')]=_['defaults'](config[_0x66c1('0x19')],{'host':_0x66c1('0x1a'),'port':0x18eb});var socket=require(_0x66c1('0x1b'))(new Redis(config['redis']));require(_0x66c1('0x1c'))[_0x66c1('0x1d')](socket);function respondWithStatusCode(_0x2a479a,_0x4666be){_0x4666be=_0x4666be||0xcc;return function(_0x4f9239){if(_0x4f9239){return _0x2a479a['sendStatus'](_0x4666be);}return _0x2a479a[_0x66c1('0x1e')](_0x4666be)[_0x66c1('0x1f')]();};}function respondWithResult(_0x186099,_0x3cab1d){_0x3cab1d=_0x3cab1d||0xc8;return function(_0xeca1d2){if(_0xeca1d2){return _0x186099['status'](_0x3cab1d)[_0x66c1('0x20')](_0xeca1d2);}};}function respondWithFilteredResult(_0x2ac4f4,_0x4201ac){return function(_0x40a594){if(_0x40a594){var _0x299e15=typeof _0x4201ac[_0x66c1('0x21')]==='undefined'&&typeof _0x4201ac[_0x66c1('0x22')]==='undefined';var _0x5033ad=_0x40a594[_0x66c1('0x23')];var _0x2b7d70=_0x299e15?0x0:_0x4201ac[_0x66c1('0x21')];var _0x27a217=_0x299e15?_0x40a594['count']:_0x4201ac[_0x66c1('0x21')]+_0x4201ac[_0x66c1('0x22')];var _0x3187bb;if(_0x27a217>=_0x5033ad){_0x27a217=_0x5033ad;_0x3187bb=0xc8;}else{_0x3187bb=0xce;}_0x2ac4f4[_0x66c1('0x1e')](_0x3187bb);return _0x2ac4f4[_0x66c1('0x24')](_0x66c1('0x25'),_0x2b7d70+'-'+_0x27a217+'/'+_0x5033ad)[_0x66c1('0x20')](_0x40a594);}return null;};}function patchUpdates(_0x31758b){return function(_0x2c27e6){try{jsonpatch[_0x66c1('0x26')](_0x2c27e6,_0x31758b,!![]);}catch(_0x468afd){return BPromise[_0x66c1('0x27')](_0x468afd);}return _0x2c27e6['save']();};}function saveUpdates(_0x142c8a,_0x2b56f4){return function(_0x140676){if(_0x140676){return _0x140676[_0x66c1('0x28')](_0x142c8a)['then'](function(_0x5c76b7){return _0x5c76b7;});}return null;};}function removeEntity(_0x111004,_0x47b525){return function(_0x1d1831){if(_0x1d1831){return _0x1d1831[_0x66c1('0x29')]()['then'](function(){var _0x568038=_0x1d1831[_0x66c1('0x2a')]({'plain':!![]});var _0x46a592='Plugins';return db[_0x66c1('0x2b')][_0x66c1('0x29')]({'where':{'type':_0x46a592,'resourceId':_0x568038['id']}})[_0x66c1('0x2c')](function(){return _0x1d1831;});})[_0x66c1('0x2c')](function(){_0x111004['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xce4f61,_0x9b4804){return function(_0x119609){if(!_0x119609){_0xce4f61['sendStatus'](0x194);}return _0x119609;};}function handleError(_0x1e1fe3,_0x5f2021){_0x5f2021=_0x5f2021||0x1f4;return function(_0x36ba6c){logger[_0x66c1('0x2d')](_0x36ba6c['stack']);if(_0x36ba6c[_0x66c1('0x2e')]){delete _0x36ba6c[_0x66c1('0x2e')];}_0x1e1fe3[_0x66c1('0x1e')](_0x5f2021)[_0x66c1('0x2f')](_0x36ba6c);};}exports[_0x66c1('0x30')]=function(_0x180fcb,_0x24e31e){var _0x530bac={},_0x352a69={},_0x9ed82b={'count':0x0,'rows':[]};var _0x6281ef=_['map'](db[_0x66c1('0x31')][_0x66c1('0x32')],function(_0xf0f9cc){return{'name':_0xf0f9cc[_0x66c1('0x33')],'type':_0xf0f9cc[_0x66c1('0x34')][_0x66c1('0x35')]};});_0x352a69[_0x66c1('0x36')]=_[_0x66c1('0x37')](_0x6281ef,_0x66c1('0x2e'));_0x352a69[_0x66c1('0x38')]=_[_0x66c1('0x39')](_0x180fcb['query']);_0x352a69[_0x66c1('0x3a')]=_[_0x66c1('0x3b')](_0x352a69[_0x66c1('0x36')],_0x352a69[_0x66c1('0x38')]);_0x530bac['attributes']=_[_0x66c1('0x3b')](_0x352a69[_0x66c1('0x36')],qs[_0x66c1('0x3c')](_0x180fcb[_0x66c1('0x38')][_0x66c1('0x3c')]));_0x530bac['attributes']=_0x530bac[_0x66c1('0x3d')][_0x66c1('0x3e')]?_0x530bac['attributes']:_0x352a69[_0x66c1('0x36')];if(!_0x180fcb[_0x66c1('0x38')][_0x66c1('0x3f')](_0x66c1('0x40'))){_0x530bac[_0x66c1('0x22')]=qs['limit'](_0x180fcb[_0x66c1('0x38')]['limit']);_0x530bac[_0x66c1('0x21')]=qs[_0x66c1('0x21')](_0x180fcb['query']['offset']);}_0x530bac[_0x66c1('0x41')]=qs[_0x66c1('0x42')](_0x180fcb[_0x66c1('0x38')][_0x66c1('0x42')]);_0x530bac[_0x66c1('0x43')]=qs[_0x66c1('0x3a')](_['pick'](_0x180fcb[_0x66c1('0x38')],_0x352a69['filters']),_0x6281ef);if(_0x180fcb[_0x66c1('0x38')][_0x66c1('0x44')]){_0x530bac[_0x66c1('0x43')]=_[_0x66c1('0x45')](_0x530bac['where'],{'$or':_[_0x66c1('0x37')](_0x6281ef,function(_0x204683){if(_0x204683[_0x66c1('0x34')]!==_0x66c1('0x46')){var _0x1c5717={};_0x1c5717[_0x204683[_0x66c1('0x2e')]]={'$like':'%'+_0x180fcb[_0x66c1('0x38')]['filter']+'%'};return _0x1c5717;}})});}_0x530bac=_[_0x66c1('0x45')]({},_0x530bac,_0x180fcb['options']);var _0x351219={'where':_0x530bac[_0x66c1('0x43')]};return db[_0x66c1('0x31')][_0x66c1('0x23')](_0x351219)[_0x66c1('0x2c')](function(_0x110a56){_0x9ed82b['count']=_0x110a56;if(_0x180fcb[_0x66c1('0x38')][_0x66c1('0x47')]){_0x530bac[_0x66c1('0x48')]=[{'all':!![]}];}return db[_0x66c1('0x31')][_0x66c1('0x49')](_0x530bac);})[_0x66c1('0x2c')](function(_0x1c469d){_0x9ed82b['rows']=_0x1c469d;return _0x9ed82b;})['then'](respondWithFilteredResult(_0x24e31e,_0x530bac))['catch'](handleError(_0x24e31e,null));};exports['show']=function(_0x9be0b0,_0x5204ce){var _0x2c3c47={'raw':!![],'where':{'id':_0x9be0b0['params']['id']}},_0x43d1f7={};_0x43d1f7['model']=_[_0x66c1('0x39')](db[_0x66c1('0x31')]['rawAttributes']);_0x43d1f7[_0x66c1('0x38')]=_[_0x66c1('0x39')](_0x9be0b0[_0x66c1('0x38')]);_0x43d1f7[_0x66c1('0x3a')]=_['intersection'](_0x43d1f7[_0x66c1('0x36')],_0x43d1f7['query']);_0x2c3c47[_0x66c1('0x3d')]=_[_0x66c1('0x3b')](_0x43d1f7[_0x66c1('0x36')],qs['fields'](_0x9be0b0['query']['fields']));_0x2c3c47[_0x66c1('0x3d')]=_0x2c3c47[_0x66c1('0x3d')]['length']?_0x2c3c47['attributes']:_0x43d1f7[_0x66c1('0x36')];if(_0x9be0b0[_0x66c1('0x38')][_0x66c1('0x47')]){_0x2c3c47['include']=[{'all':!![]}];}_0x2c3c47=_[_0x66c1('0x45')]({},_0x2c3c47,_0x9be0b0[_0x66c1('0x4a')]);return db[_0x66c1('0x31')]['find'](_0x2c3c47)[_0x66c1('0x2c')](handleEntityNotFound(_0x5204ce,null))[_0x66c1('0x2c')](respondWithResult(_0x5204ce,null))['catch'](handleError(_0x5204ce,null));};exports[_0x66c1('0x4b')]=function(_0x548444,_0x2b4a25,_0x43a9ad){return db['Plugin']['find']({'where':{'id':_0x548444[_0x66c1('0x4c')]['id']},'attributes':[_0x66c1('0x2e'),_0x66c1('0x5')],'raw':!![]})[_0x66c1('0x2c')](handleEntityNotFound(_0x2b4a25,null))[_0x66c1('0x2c')](function(_0x4370e7){if(_0x4370e7){var _0x128ead=path['join'](config[_0x66c1('0x4d')],'server/files/plugins',util[_0x66c1('0x4e')](_0x66c1('0x4f'),path[_0x66c1('0x50')](_0x4370e7['path'])));var _0x386f2b=fs[_0x66c1('0x51')](_0x128ead);var _0x5cbce8=archiver(_0x66c1('0x52'),{'zlib':{'level':0x9}});_0x5cbce8['on'](_0x66c1('0x53'),function(_0x497d23){if(_0x497d23[_0x66c1('0x54')]===_0x66c1('0x55')){logger[_0x66c1('0x2d')](_0x497d23);}else{throw new db[(_0x66c1('0x56'))][(_0x66c1('0x57'))](_0x66c1('0x58'));}});_0x5cbce8['on'](_0x66c1('0x2d'),function(_0x14de32){throw new db[(_0x66c1('0x56'))][(_0x66c1('0x57'))](_0x66c1('0x58'));});_0x5cbce8[_0x66c1('0x59')](_0x386f2b);_0x5cbce8['glob'](_0x66c1('0x5a'),{'cwd':path[_0x66c1('0x5b')](config['root'],_0x66c1('0x5c'),path[_0x66c1('0x5d')](_0x4370e7[_0x66c1('0x5')])),'ignore':[path['join'](path[_0x66c1('0x50')](_0x4370e7[_0x66c1('0x5')]),'node_modules/**/*'),path[_0x66c1('0x5b')](path[_0x66c1('0x50')](_0x4370e7['path']),'attachments/**/*')],'nodir':!![]})[_0x66c1('0x5e')]();_0x386f2b['on'](_0x66c1('0x5f'),function(){if(!fs[_0x66c1('0x60')](_0x128ead)){throw new db[(_0x66c1('0x56'))]['Error'](_0x66c1('0x61'));}return _0x2b4a25[_0x66c1('0x4b')](_0x128ead,util[_0x66c1('0x4e')](_0x66c1('0x4f'),path[_0x66c1('0x50')](_0x4370e7['path'])),function(_0x5574e5){if(_0x5574e5){throw new db['Sequelize'][(_0x66c1('0x57'))](_0x66c1('0x62'));}fs[_0x66c1('0x63')](_0x128ead);logger[_0x66c1('0x64')]('Download\x20completed');logger[_0x66c1('0x64')]('Temporary\x20file\x20removed');});});}return null;})[_0x66c1('0x65')](handleError(_0x2b4a25,null));};exports['upload']=function(_0x3dd06b,_0x21198b,_0x42764c){var _0x4b3487=path[_0x66c1('0x50')](_0x3dd06b[_0x66c1('0x66')][_0x66c1('0x67')],path[_0x66c1('0x68')](_0x3dd06b[_0x66c1('0x66')][_0x66c1('0x67')]));var _0x4989d6=path[_0x66c1('0x5b')](config[_0x66c1('0x4d')],'server/files/plugins',_0x3dd06b['file']['filename']);var _0x1c8117=path[_0x66c1('0x5b')](config[_0x66c1('0x4d')],_0x66c1('0x5c'),_0x4b3487);logger[_0x66c1('0x64')]('Plugin\x20upload\x20filepath:\x20%s',_0x4989d6);logger[_0x66c1('0x64')](_0x66c1('0x69'),_0x1c8117);try{fs[_0x66c1('0x6a')](_0x4989d6,parseInt(_0x66c1('0x6b'),0x8));extract(_0x4989d6,{'dir':_0x1c8117},function(_0x3bc4f7){if(_0x3bc4f7){logger['error'](_0x3bc4f7);handleError(_0x3bc4f7,!![]);};var _0x276fe1=fs[_0x66c1('0x6c')](_0x1c8117);if(_0x276fe1['length']>0x1){removeReferences(_0x4989d6,_0x1c8117);logger[_0x66c1('0x2d')](_0x66c1('0x6d'));return _0x42764c(new Error(_0x66c1('0x6d')));}var _0x30eae8=fs[_0x66c1('0x6e')](path[_0x66c1('0x5b')](_0x1c8117,_0x276fe1[0x0]));if(_0x30eae8[_0x66c1('0x6f')]()){removeReferences(_0x4989d6,_0x1c8117);logger[_0x66c1('0x2d')](_0x66c1('0x6d'));return _0x42764c(new Error('Invalid\x20plugin\x20structure'));}if(_0x30eae8[_0x66c1('0x70')]()){var _0x164581=fs[_0x66c1('0x6c')](path[_0x66c1('0x5b')](_0x1c8117,_0x276fe1[0x0]));if(_0x164581[_0x66c1('0x3e')]===0x0){removeReferences(_0x4989d6,_0x1c8117);logger[_0x66c1('0x2d')](_0x66c1('0x6d'));return _0x42764c(new Error(_0x66c1('0x6d')));}var _0x25fe24=_0x164581['some'](function(_0x1a9ac8){return _0x1a9ac8===_0x66c1('0x71');});if(!_0x25fe24){return _0x42764c(new Error(_0x66c1('0x72')));}var _0x454d8f=fs[_0x66c1('0x73')](path['join'](_0x1c8117,_0x276fe1[0x0],_0x66c1('0x71')));var _0x436e78=JSON[_0x66c1('0x74')](_0x454d8f);if('undefined'==typeof _0x436e78['name']){return _0x42764c(new Error(_0x66c1('0x75')));}if(_0x66c1('0x76')==typeof _0x436e78[_0x66c1('0x34')]){return _0x42764c(new Error(_0x66c1('0x77')));}if('undefined'==typeof _0x436e78[_0x66c1('0x78')]){return _0x42764c(new Error(_0x66c1('0x79')));}if(_0x66c1('0x76')==typeof _0x436e78['parameters']){return _0x42764c(new Error(_0x66c1('0x7a')));}if(_0x436e78[_0x66c1('0x34')]==='html'){if(_0x66c1('0x76')==typeof _0x436e78[_0x66c1('0x7b')][_0x66c1('0x7c')]){return _0x42764c(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x66c1('0x76')==typeof _0x436e78['parameters']['views'][_0x66c1('0x7d')]&&'undefined'==typeof _0x436e78[_0x66c1('0x7b')][_0x66c1('0x7c')]['agent']){return _0x42764c(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x436e78[_0x66c1('0x34')]==='script'){if(_0x66c1('0x76')==typeof _0x436e78[_0x66c1('0x7b')][_0x66c1('0x7e')]){return _0x42764c(new Error(_0x66c1('0x7f')));}if(_0x66c1('0x76')==typeof _0x436e78[_0x66c1('0x7b')][_0x66c1('0x80')]){return _0x42764c(new Error(_0x66c1('0x81')));}}else{return _0x42764c(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x30df44=_0x436e78['name'];var _0x191e76=_0x436e78[_0x66c1('0x82')];var _0x1e4530=_0x436e78[_0x66c1('0x34')];var _0x4fe8b7=_0x436e78[_0x66c1('0x83')]?_0x436e78[_0x66c1('0x83')]:_0x66c1('0x84');var _0x2559a1=_0x436e78[_0x66c1('0x85')]?_0x436e78[_0x66c1('0x85')]:_0x66c1('0x86');var _0x4ad377='';var _0x4aa632='';var _0x994262='';var _0x97e06a='';var _0x44c82d=_0x436e78[_0x66c1('0x78')];if(_0x1e4530===_0x66c1('0x87')){if(_0x66c1('0x76')!=typeof _0x436e78['parameters'][_0x66c1('0x7c')]['admin']){var _0x318194=_0x436e78['parameters']['views'][_0x66c1('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x66c1('0x88')](_0x318194)){_0x4ad377=path['join'](_0x66c1('0x89'),_0x4b3487,_0x276fe1[0x0],_0x318194);}else{_0x4ad377=_0x318194;}}else{logger[_0x66c1('0x64')](_0x66c1('0x8a'));}if(_0x66c1('0x76')!=typeof _0x436e78[_0x66c1('0x7b')]['views'][_0x66c1('0x8b')]){var _0x310825=_0x436e78[_0x66c1('0x7b')]['views']['agent'];if(!/^(f|ht)tps?:\/\//i[_0x66c1('0x88')](_0x310825)){_0x4aa632=path[_0x66c1('0x5b')]('plugins',_0x4b3487,_0x276fe1[0x0],_0x310825);}else{_0x4aa632=_0x310825;}}else{logger[_0x66c1('0x64')](_0x66c1('0x8c'));}}else if(_0x1e4530===_0x66c1('0x8d')){_0x994262=_0x436e78[_0x66c1('0x7b')][_0x66c1('0x7e')];_0x97e06a=_0x436e78[_0x66c1('0x7b')][_0x66c1('0x80')];if('undefined'!=typeof _0x436e78[_0x66c1('0x7b')][_0x66c1('0x7c')]){if(_0x66c1('0x76')!=typeof _0x436e78[_0x66c1('0x7b')]['views'][_0x66c1('0x7d')]){var _0x318194=_0x436e78[_0x66c1('0x7b')][_0x66c1('0x7c')][_0x66c1('0x7d')];if(!/^(f|ht)tps?:\/\//i['test'](_0x318194)){_0x4ad377=path[_0x66c1('0x5b')]('plugins',_0x4b3487,_0x276fe1[0x0],_0x318194);}else{_0x4ad377=_0x318194;}}if(_0x66c1('0x76')!=typeof _0x436e78[_0x66c1('0x7b')][_0x66c1('0x7c')][_0x66c1('0x8b')]){var _0x310825=_0x436e78[_0x66c1('0x7b')][_0x66c1('0x7c')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x66c1('0x88')](_0x310825)){_0x4aa632=path[_0x66c1('0x5b')](_0x66c1('0x89'),_0x4b3487,_0x276fe1[0x0],_0x310825);}else{_0x4aa632=_0x310825;}}}}var _0x39bae7={'name':_0x30df44,'description':_0x191e76,'path':path[_0x66c1('0x5b')](_0x4b3487,_0x276fe1[0x0]),'type':_0x1e4530,'sidebar':_0x4fe8b7,'icon':_0x2559a1,'adminUrl':_0x4ad377,'agentUrl':_0x4aa632,'scriptName':_0x994262,'scriptPath':_0x97e06a,'version':_0x44c82d};removeReferences(_0x4989d6,null);return db[_0x66c1('0x31')][_0x66c1('0x8e')](_0x39bae7)[_0x66c1('0x2c')](function(_0x4155e8){var _0x597537={'role':_0x3dd06b[_0x66c1('0x8f')][_0x66c1('0x90')],'userProfileId':_0x3dd06b['body'][_0x66c1('0x91')]};if(!_0x597537)throw new Error(_0x66c1('0x92'));if(_0x597537[_0x66c1('0x90')]===_0x66c1('0x93')){var _0x4d57c2=_0x4155e8[_0x66c1('0x2a')]({'plain':!![]});return db[_0x66c1('0x94')][_0x66c1('0x95')]({'where':{'name':_0x66c1('0x96'),'userProfileId':_0x597537['userProfileId']},'raw':!![]})[_0x66c1('0x2c')](function(_0x3d08ea){if(_0x3d08ea&&_0x3d08ea[_0x66c1('0x97')]===0x0){return db['UserProfileResource']['create']({'name':_0x4d57c2[_0x66c1('0x2e')],'resourceId':_0x4d57c2['id'],'type':_0x3d08ea[_0x66c1('0x2e')],'sectionId':_0x3d08ea['id']},{})[_0x66c1('0x2c')](function(){return _0x4155e8;});}else{return _0x4155e8;}})[_0x66c1('0x65')](function(_0x517fd5){logger[_0x66c1('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x517fd5);throw _0x517fd5;});}return _0x4155e8;})[_0x66c1('0x2c')](respondWithResult(_0x21198b,null))['catch'](handleError(_0x21198b,null));}});}catch(_0x5c0aac){_0x21198b[_0x66c1('0x1e')](0x1f4)[_0x66c1('0x2f')](_0x5c0aac);}};function removeReferences(_0x1e28e0,_0x153598){try{if(_0x1e28e0){fs[_0x66c1('0x63')](_0x1e28e0);logger['info'](_0x66c1('0x98'));}if(_0x153598){rimraf(_0x153598,function(){});logger[_0x66c1('0x64')](_0x66c1('0x99'));}}catch(_0x23d790){logger['error'](_0x23d790);}}exports[_0x66c1('0x28')]=function(_0x28416c,_0xcc45c3,_0x4588fe){return db[_0x66c1('0x31')][_0x66c1('0x95')]({'where':{'id':_0x28416c[_0x66c1('0x4c')]['id']}})[_0x66c1('0x2c')](handleEntityNotFound(_0xcc45c3,null))[_0x66c1('0x2c')](saveUpdates(_0x28416c[_0x66c1('0x8f')],null))[_0x66c1('0x2c')](respondWithResult(_0xcc45c3,null))[_0x66c1('0x65')](handleError(_0xcc45c3,null));};exports[_0x66c1('0x9a')]=function(_0x317f37,_0x29c27e,_0x3a4cc2){return db[_0x66c1('0x31')][_0x66c1('0x95')]({'where':{'id':_0x317f37['params']['id']}})[_0x66c1('0x2c')](function(_0x25a881){if(_0x25a881){return _0x25a881['destroy']();}})['then'](function(_0x3df449){rimraf(path[_0x66c1('0x5b')](config['root'],'server/files/plugins',path[_0x66c1('0x5d')](_0x3df449[_0x66c1('0x5')])),function(){});return _0x3df449;})['then'](handleEntityNotFound(_0x29c27e,null))[_0x66c1('0x2c')](respondWithStatusCode(_0x29c27e,null))[_0x66c1('0x65')](handleError(_0x29c27e,null));};exports[_0x66c1('0x9b')]=function(_0x1c2b17,_0x4d2199,_0x1b2dbd){return BPromise[_0x66c1('0x9c')]()['then'](function(){if(!_0x1c2b17[_0x66c1('0x38')][_0x66c1('0x5')]){throw new Error(_0x66c1('0x9d'));}if(!_0x1c2b17[_0x66c1('0x38')]['port']){throw new Error(_0x66c1('0x9e'));}var _0x62e71b=_0x1c2b17[_0x66c1('0x38')][_0x66c1('0x9f')]?_0x1c2b17[_0x66c1('0x38')][_0x66c1('0x9f')]+':'+_0x1c2b17['query'][_0x66c1('0xa0')]:_0x66c1('0xa1')+_0x1c2b17['query'][_0x66c1('0xa0')];var _0x1837d4=_0x1c2b17[_0x66c1('0x38')][_0x66c1('0x20')]?_0x1c2b17[_0x66c1('0x38')][_0x66c1('0x20')]:!![];var _0x63ff28=_0x1c2b17[_0x66c1('0x38')][_0x66c1('0xa2')]?_0x1c2b17[_0x66c1('0x38')][_0x66c1('0xa2')]:null;var _0x54e845={'method':_0x1c2b17[_0x66c1('0xa3')],'uri':util[_0x66c1('0x4e')](_0x66c1('0xa4'),_0x62e71b,_0x1c2b17['query'][_0x66c1('0x5')]),'json':_0x1837d4,'resolveWithFullResponse':!![],'encoding':_0x63ff28,'qs':_0x1c2b17[_0x66c1('0x38')]};if(_0x1c2b17[_0x66c1('0xa5')]){_0x54e845[_0x66c1('0xa5')]=_0x1c2b17['headers'];if(_0x54e845['headers']['content-length']){delete _0x54e845[_0x66c1('0xa5')][_0x66c1('0xa6')];}}if(_0x54e845[_0x66c1('0xa5')][_0x66c1('0xa7')]){delete _0x54e845[_0x66c1('0xa5')][_0x66c1('0xa7')];}return rp(_0x54e845);})[_0x66c1('0x2c')](function(_0x59e84c){if(_0x59e84c){_0x4d2199[_0x66c1('0x24')](_0x59e84c[_0x66c1('0xa5')]);logger[_0x66c1('0x64')](_0x59e84c['body']);if(_['endsWith'](_0x1c2b17[_0x66c1('0x38')]['path'],_0x66c1('0x4b'))&&_0x59e84c[_0x66c1('0xa8')]==0x1f4){return _0x4d2199[_0x66c1('0xa9')](_0x59e84c[_0x66c1('0xa8')]);}else{return _0x4d2199[_0x66c1('0x1e')](_0x59e84c[_0x66c1('0xa8')])['send'](_0x59e84c[_0x66c1('0x8f')]);}}else{return _0x4d2199[_0x66c1('0xa9')](0xc8);}})['catch'](handleError(_0x4d2199,null));};exports[_0x66c1('0xaa')]=function(_0x35377f,_0x3a55cf,_0x5a7e83){return BPromise[_0x66c1('0x9c')]()[_0x66c1('0x2c')](function(){if(!_0x35377f['query'][_0x66c1('0x5')]){throw new Error(_0x66c1('0x9d'));}if(!_0x35377f[_0x66c1('0x38')][_0x66c1('0xa0')]){throw new Error(_0x66c1('0x9e'));}var _0x2dfd3b=_0x35377f[_0x66c1('0x38')][_0x66c1('0x9f')]?_0x35377f[_0x66c1('0x38')][_0x66c1('0x9f')]+':'+_0x35377f[_0x66c1('0x38')]['port']:'http://localhost:'+_0x35377f[_0x66c1('0x38')][_0x66c1('0xa0')];var _0x3a3f8a=_0x35377f[_0x66c1('0x38')][_0x66c1('0x20')]?_0x35377f[_0x66c1('0x38')][_0x66c1('0x20')]:!![];var _0x54e5a4=_0x35377f[_0x66c1('0x38')]['encoding']?_0x35377f[_0x66c1('0x38')][_0x66c1('0xa2')]:null;var _0x2cb0a7={'method':_0x35377f['method'],'uri':util[_0x66c1('0x4e')](_0x66c1('0xa4'),_0x2dfd3b,_0x35377f[_0x66c1('0x38')][_0x66c1('0x5')]),'json':_0x3a3f8a,'resolveWithFullResponse':!![],'encoding':_0x54e5a4,'body':_0x35377f[_0x66c1('0x8f')]};if(_0x35377f['headers']){_0x2cb0a7[_0x66c1('0xa5')]=_0x35377f['headers'];if(_0x2cb0a7[_0x66c1('0xa5')][_0x66c1('0xa6')]){delete _0x2cb0a7[_0x66c1('0xa5')][_0x66c1('0xa6')];}}if(_0x2cb0a7['headers']['content-type']){delete _0x2cb0a7[_0x66c1('0xa5')][_0x66c1('0xa7')];}return rp(_0x2cb0a7);})['then'](function(_0xe48676){if(_0xe48676){_0x3a55cf['set'](_0xe48676[_0x66c1('0xa5')]);logger[_0x66c1('0x64')](_0xe48676['body']);return _0x3a55cf[_0x66c1('0x1e')](_0xe48676[_0x66c1('0xa8')])[_0x66c1('0x2f')](_0xe48676[_0x66c1('0x8f')]);}else{return _0x3a55cf['sendStatus'](0xc8);}})[_0x66c1('0x65')](handleError(_0x3a55cf,null));};
\ No newline at end of file
index 918a567..faa7518 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6ac=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','Plugin'];(function(_0x11413a,_0x2ad425){var _0x391c7c=function(_0x2d3988){while(--_0x2d3988){_0x11413a['push'](_0x11413a['shift']());}};_0x391c7c(++_0x2ad425);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x32385b,_0x63af4f){_0x32385b=_0x32385b-0x0;var _0x321218=_0xc6ac[_0x32385b];return _0x321218;};'use strict';var EventEmitter=require(_0xcc6a('0x0'));var Plugin=require(_0xcc6a('0x1'))['db'][_0xcc6a('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xcc6a('0x3')](0x0);var events={'afterCreate':_0xcc6a('0x4'),'afterUpdate':_0xcc6a('0x5'),'afterDestroy':_0xcc6a('0x6')};function emitEvent(_0x31bbcd){return function(_0x297643,_0x22ee99,_0x2f26ab){PluginEvents[_0xcc6a('0x7')](_0x31bbcd+':'+_0x297643['id'],_0x297643);PluginEvents[_0xcc6a('0x7')](_0x31bbcd,_0x297643);_0x2f26ab(null);};}for(var e in events){if(events[_0xcc6a('0x8')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0xcc6a('0x9')]=PluginEvents;
\ No newline at end of file
+var _0xf8af=['Plugin','setMaxListeners','save','update','hasOwnProperty','exports','events'];(function(_0x181d28,_0xdbb6e7){var _0x4e3e5e=function(_0x232041){while(--_0x232041){_0x181d28['push'](_0x181d28['shift']());}};_0x4e3e5e(++_0xdbb6e7);}(_0xf8af,0x8b));var _0xff8a=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xf8af[_0x3e5086];return _0xfeb102;};'use strict';var EventEmitter=require(_0xff8a('0x0'));var Plugin=require('../../mysqldb')['db'][_0xff8a('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xff8a('0x2')](0x0);var events={'afterCreate':_0xff8a('0x3'),'afterUpdate':_0xff8a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x7b1bb0){return function(_0x460bf6,_0x11cfa2,_0x3bd9c2){PluginEvents['emit'](_0x7b1bb0+':'+_0x460bf6['id'],_0x460bf6);PluginEvents['emit'](_0x7b1bb0,_0x460bf6);_0x3bd9c2(null);};}for(var e in events){if(events[_0xff8a('0x5')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0xff8a('0x6')]=PluginEvents;
\ No newline at end of file
index b0f7b9a..349349d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe1f=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','define','Plugin','plugins'];(function(_0x3150ab,_0x2bc06e){var _0x244414=function(_0x41096a){while(--_0x41096a){_0x3150ab['push'](_0x3150ab['shift']());}};_0x244414(++_0x2bc06e);}(_0xfe1f,0x1c3));var _0xffe1=function(_0xd839e7,_0x4209e9){_0xd839e7=_0xd839e7-0x0;var _0xc3cf23=_0xfe1f[_0xd839e7];return _0xc3cf23;};'use strict';var _=require(_0xffe1('0x0'));var util=require(_0xffe1('0x1'));var logger=require(_0xffe1('0x2'))(_0xffe1('0x3'));var moment=require(_0xffe1('0x4'));var BPromise=require(_0xffe1('0x5'));var rp=require(_0xffe1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xffe1('0x7'));var config=require('../../config/environment');var attributes=require('./plugin.attributes');module['exports']=function(_0x545c37,_0x506ec6){return _0x545c37[_0xffe1('0x8')](_0xffe1('0x9'),attributes,{'tableName':_0xffe1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x13a6=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin'];(function(_0x28e119,_0x18c655){var _0x18d03c=function(_0x241fb1){while(--_0x241fb1){_0x28e119['push'](_0x28e119['shift']());}};_0x18d03c(++_0x18c655);}(_0x13a6,0x9c));var _0x613a=function(_0x5ca51a,_0x11eda2){_0x5ca51a=_0x5ca51a-0x0;var _0x425471=_0x13a6[_0x5ca51a];return _0x425471;};'use strict';var _=require(_0x613a('0x0'));var util=require('util');var logger=require(_0x613a('0x1'))(_0x613a('0x2'));var moment=require(_0x613a('0x3'));var BPromise=require(_0x613a('0x4'));var rp=require(_0x613a('0x5'));var fs=require('fs');var path=require(_0x613a('0x6'));var rimraf=require(_0x613a('0x7'));var config=require(_0x613a('0x8'));var attributes=require(_0x613a('0x9'));module[_0x613a('0xa')]=function(_0x346f71,_0x44216c){return _0x346f71[_0x613a('0xb')](_0x613a('0xc'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2675b9c..6244e9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8ff=['lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreatePlugin','body','options','raw'];(function(_0x3a1105,_0x11146b){var _0x47bcf3=function(_0x265475){while(--_0x265475){_0x3a1105['push'](_0x3a1105['shift']());}};_0x47bcf3(++_0x11146b);}(_0xa8ff,0x110));var _0xfa8f=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0xa8ff[_0x1589dd];return _0x1bddd1;};'use strict';var _=require(_0xfa8f('0x0'));var util=require('util');var moment=require(_0xfa8f('0x1'));var BPromise=require('bluebird');var rs=require(_0xfa8f('0x2'));var fs=require('fs');var Redis=require(_0xfa8f('0x3'));var db=require(_0xfa8f('0x4'))['db'];var utils=require(_0xfa8f('0x5'));var logger=require(_0xfa8f('0x6'))(_0xfa8f('0x7'));var config=require(_0xfa8f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfa8f('0x9')][_0xfa8f('0xa')]({'port':0x232a});config[_0xfa8f('0xb')]=_[_0xfa8f('0xc')](config[_0xfa8f('0xb')],{'host':_0xfa8f('0xd'),'port':0x18eb});var socket=require(_0xfa8f('0xe'))(new Redis(config['redis']));require(_0xfa8f('0xf'))[_0xfa8f('0x10')](socket);function respondWithRpcPromise(_0x3d0932,_0x37b1aa,_0x4ceae1){return new BPromise(function(_0x48fd8a,_0x5b932c){return client[_0xfa8f('0x11')](_0x3d0932,_0x4ceae1)[_0xfa8f('0x12')](function(_0x46ca5c){logger[_0xfa8f('0x13')](_0xfa8f('0x14'),_0x37b1aa,_0xfa8f('0x15'));logger[_0xfa8f('0x16')](_0xfa8f('0x17'),_0x37b1aa,_0xfa8f('0x15'),JSON[_0xfa8f('0x18')](_0x46ca5c));if(_0x46ca5c[_0xfa8f('0x19')]){if(_0x46ca5c[_0xfa8f('0x19')][_0xfa8f('0x1a')]===0x1f4){logger[_0xfa8f('0x19')](_0xfa8f('0x14'),_0x37b1aa,_0x46ca5c[_0xfa8f('0x19')][_0xfa8f('0x1b')]);return _0x5b932c(_0x46ca5c[_0xfa8f('0x19')][_0xfa8f('0x1b')]);}logger[_0xfa8f('0x19')](_0xfa8f('0x14'),_0x37b1aa,_0x46ca5c[_0xfa8f('0x19')][_0xfa8f('0x1b')]);return _0x48fd8a(_0x46ca5c[_0xfa8f('0x19')]['message']);}else{logger[_0xfa8f('0x13')]('Plugin,\x20%s,\x20%s',_0x37b1aa,_0xfa8f('0x15'));_0x48fd8a(_0x46ca5c[_0xfa8f('0x1c')][_0xfa8f('0x1b')]);}})[_0xfa8f('0x1d')](function(_0x3ad1ba){logger[_0xfa8f('0x19')](_0xfa8f('0x14'),_0x37b1aa,_0x3ad1ba);_0x5b932c(_0x3ad1ba);});});}exports[_0xfa8f('0x1e')]=function(_0x173a04){var _0xaf85d5=this;return new Promise(function(_0x101dab,_0x4d133d){return db['Plugin']['create'](_0x173a04[_0xfa8f('0x1f')],{'raw':_0x173a04[_0xfa8f('0x20')]?_0x173a04[_0xfa8f('0x20')][_0xfa8f('0x21')]===undefined?!![]:![]:!![]})[_0xfa8f('0x12')](function(_0x322faf){logger[_0xfa8f('0x13')](_0xfa8f('0x1e'),_0x173a04);logger['debug'](_0xfa8f('0x1e'),_0x173a04,JSON[_0xfa8f('0x18')](_0x322faf));_0x101dab(_0x322faf);})[_0xfa8f('0x1d')](function(_0x2c24e5){logger[_0xfa8f('0x19')](_0xfa8f('0x1e'),_0x2c24e5[_0xfa8f('0x1b')],_0x173a04);_0x4d133d(_0xaf85d5[_0xfa8f('0x19')](0x1f4,_0x2c24e5[_0xfa8f('0x1b')]));});});};
\ No newline at end of file
+var _0x2884=['stringify','error','code','message','result','CreatePlugin','Plugin','create','options','raw','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','debug','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x57cc14,_0x5251f6){var _0x4cb999=function(_0x5725d4){while(--_0x5725d4){_0x57cc14['push'](_0x57cc14['shift']());}};_0x4cb999(++_0x5251f6);}(_0x2884,0x1eb));var _0x4288=function(_0x400da3,_0x55d4fa){_0x400da3=_0x400da3-0x0;var _0x1c7073=_0x2884[_0x400da3];return _0x1c7073;};'use strict';var _=require(_0x4288('0x0'));var util=require('util');var moment=require(_0x4288('0x1'));var BPromise=require(_0x4288('0x2'));var rs=require(_0x4288('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4288('0x4'))['db'];var utils=require(_0x4288('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4288('0x6'));var jayson=require(_0x4288('0x7'));var client=jayson[_0x4288('0x8')]['http']({'port':0x232a});config['redis']=_[_0x4288('0x9')](config['redis'],{'host':_0x4288('0xa'),'port':0x18eb});var socket=require(_0x4288('0xb'))(new Redis(config['redis']));require(_0x4288('0xc'))[_0x4288('0xd')](socket);function respondWithRpcPromise(_0x41794a,_0x55c9ee,_0x55a4f7){return new BPromise(function(_0x5c0e2d,_0x42a234){return client[_0x4288('0xe')](_0x41794a,_0x55a4f7)[_0x4288('0xf')](function(_0x2445eb){logger[_0x4288('0x10')](_0x4288('0x11'),_0x55c9ee,'request\x20sent');logger[_0x4288('0x12')](_0x4288('0x13'),_0x55c9ee,_0x4288('0x14'),JSON[_0x4288('0x15')](_0x2445eb));if(_0x2445eb['error']){if(_0x2445eb[_0x4288('0x16')][_0x4288('0x17')]===0x1f4){logger['error'](_0x4288('0x11'),_0x55c9ee,_0x2445eb['error'][_0x4288('0x18')]);return _0x42a234(_0x2445eb['error'][_0x4288('0x18')]);}logger[_0x4288('0x16')](_0x4288('0x11'),_0x55c9ee,_0x2445eb[_0x4288('0x16')][_0x4288('0x18')]);return _0x5c0e2d(_0x2445eb[_0x4288('0x16')][_0x4288('0x18')]);}else{logger[_0x4288('0x10')](_0x4288('0x11'),_0x55c9ee,'request\x20sent');_0x5c0e2d(_0x2445eb[_0x4288('0x19')][_0x4288('0x18')]);}})['catch'](function(_0x479d52){logger['error'](_0x4288('0x11'),_0x55c9ee,_0x479d52);_0x42a234(_0x479d52);});});}exports[_0x4288('0x1a')]=function(_0x5e891c){var _0x24b071=this;return new Promise(function(_0x51d472,_0x865365){return db[_0x4288('0x1b')][_0x4288('0x1c')](_0x5e891c['body'],{'raw':_0x5e891c[_0x4288('0x1d')]?_0x5e891c[_0x4288('0x1d')][_0x4288('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x4fc547){logger[_0x4288('0x10')](_0x4288('0x1a'),_0x5e891c);logger[_0x4288('0x12')](_0x4288('0x1a'),_0x5e891c,JSON[_0x4288('0x15')](_0x4fc547));_0x51d472(_0x4fc547);})[_0x4288('0x1f')](function(_0x500c1e){logger['error'](_0x4288('0x1a'),_0x500c1e[_0x4288('0x18')],_0x5e891c);_0x865365(_0x24b071['error'](0x1f4,_0x500c1e[_0x4288('0x18')]));});});};
\ No newline at end of file
index 0fe5a78..a852163 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf603=['./plugin.events','save','remove','update','emit','removeListener','register','length','plugin:'];(function(_0x14dc95,_0x112dd6){var _0x5a4598=function(_0x14aa88){while(--_0x14aa88){_0x14dc95['push'](_0x14dc95['shift']());}};_0x5a4598(++_0x112dd6);}(_0xf603,0x1a7));var _0x3f60=function(_0x4df471,_0x30e584){_0x4df471=_0x4df471-0x0;var _0x33179e=_0xf603[_0x4df471];return _0x33179e;};'use strict';var PluginEvents=require(_0x3f60('0x0'));var events=[_0x3f60('0x1'),_0x3f60('0x2'),_0x3f60('0x3')];function createListener(_0xe3f2b9,_0x500406){return function(_0x33acb9){_0x500406[_0x3f60('0x4')](_0xe3f2b9,_0x33acb9);};}function removeListener(_0x368c3a,_0x3a67e7){return function(){PluginEvents[_0x3f60('0x5')](_0x368c3a,_0x3a67e7);};}exports[_0x3f60('0x6')]=function(_0x395eb8){for(var _0x27f535=0x0,_0xf696b5=events[_0x3f60('0x7')];_0x27f535<_0xf696b5;_0x27f535++){var _0x2677c5=events[_0x27f535];var _0x446192=createListener(_0x3f60('0x8')+_0x2677c5,_0x395eb8);PluginEvents['on'](_0x2677c5,_0x446192);}};
\ No newline at end of file
+var _0x2e55=['removeListener','length','plugin:','./plugin.events','save','remove','update','emit'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x2e55,0x1bb));var _0x52e5=function(_0x1a3e23,_0xce45e){_0x1a3e23=_0x1a3e23-0x0;var _0x5ee0d8=_0x2e55[_0x1a3e23];return _0x5ee0d8;};'use strict';var PluginEvents=require(_0x52e5('0x0'));var events=[_0x52e5('0x1'),_0x52e5('0x2'),_0x52e5('0x3')];function createListener(_0x2449c8,_0x279604){return function(_0x355043){_0x279604[_0x52e5('0x4')](_0x2449c8,_0x355043);};}function removeListener(_0x464be9,_0x56daf4){return function(){PluginEvents[_0x52e5('0x5')](_0x464be9,_0x56daf4);};}exports['register']=function(_0x40c34c){for(var _0x229148=0x0,_0x961240=events[_0x52e5('0x6')];_0x229148<_0x961240;_0x229148++){var _0x261765=events[_0x229148];var _0x42c07b=createListener(_0x52e5('0x7')+_0x261765,_0x40c34c);PluginEvents['on'](_0x261765,_0x42c07b);}};
\ No newline at end of file
index 9d2d23a..03f072f 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(_0x145faf,_0x5ea4c2){var _0x4202da=function(_0x426201){while(--_0x426201){_0x145faf['push'](_0x145faf['shift']());}};_0x4202da(++_0x5ea4c2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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(_0x84e532,_0x59a0eb){var _0x2a8bfe=function(_0x53e0fe){while(--_0x53e0fe){_0x84e532['push'](_0x84e532['shift']());}};_0x2a8bfe(++_0x59a0eb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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 a12fdab..28dd83f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeffd=['dump','Unknown\x20id','lodash','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json','error','stack','name','send','npm\x20install','info','then','reject','express','motion2','length','params','catch','create','body','script','cwd','dirname','start','Missing\x20name\x20and/or\x20path','update','stop','hasOwnProperty'];(function(_0x9fe241,_0x45d6ea){var _0x20d722=function(_0x5d3395){while(--_0x5d3395){_0x9fe241['push'](_0x9fe241['shift']());}};_0x20d722(++_0x45d6ea);}(_0xeffd,0x6b));var _0xdeff=function(_0x2770e6,_0x174f56){_0x2770e6=_0x2770e6-0x0;var _0x59684a=_0xeffd[_0x2770e6];return _0x59684a;};'use strict';var _=require(_0xdeff('0x0'));var pm2=require('../../config/pm2');var logger=require(_0xdeff('0x1'))(_0xdeff('0x2'));var path=require(_0xdeff('0x3'));var exec=require(_0xdeff('0x4'))[_0xdeff('0x5')];var BPromise=require(_0xdeff('0x6'));function handleEntityNotFound(_0x298274,_0x2881fd){return function(_0x8315d4){if(!_0x8315d4){_0x298274[_0xdeff('0x7')](0x194);;}return _0x8315d4;};}function respondWithResult(_0x1ed641,_0x132631){_0x132631=_0x132631||0xc8;return function(_0x281ad7){if(_0x281ad7){return _0x1ed641[_0xdeff('0x8')](_0x132631)[_0xdeff('0x9')](_0x281ad7);}return null;};}function handleError(_0x12e953,_0x24897a){_0x24897a=_0x24897a||0x1f4;return function(_0x540ae6){logger[_0xdeff('0xa')](_0x540ae6[_0xdeff('0xb')]);if(_0x540ae6[_0xdeff('0xc')]){delete _0x540ae6['name'];}_0x12e953[_0xdeff('0x8')](_0x24897a)[_0xdeff('0xd')](_0x540ae6);};}function execChildProcess(){return new BPromise(function(_0x3c1482,_0x192195){exec(_0xdeff('0xe'),function(_0x256b73,_0x2e9783,_0x402075){logger['info'](_0x2e9783);logger[_0xdeff('0xf')](_0x402075);if(_0x256b73){logger[_0xdeff('0xa')](_0x256b73);return _0x192195(_0x256b73);}return _0x3c1482(_0x2e9783);});});}exports['index']=function(_0x2e614c,_0x4e7526){return pm2['list']()[_0xdeff('0x10')](function(_0x47410f){if(_0x47410f){var _0x1585e8=_[_0xdeff('0x11')](_0x47410f,function(_0x48f0e8){return _0x48f0e8[_0xdeff('0xc')]===_0xdeff('0x12')||_0x48f0e8[_0xdeff('0xc')]===_0xdeff('0x13');});return{'rows':_0x1585e8,'count':_0x1585e8[_0xdeff('0x14')]};}return null;})[_0xdeff('0x10')](respondWithResult(_0x4e7526,null))['catch'](handleError(_0x4e7526,null));};exports['show']=function(_0x7440af,_0x4cf724){return pm2['describe'](_0x7440af[_0xdeff('0x15')]['id'])[_0xdeff('0x10')](respondWithResult(_0x4cf724,null))['then'](handleEntityNotFound(_0x4cf724,null))[_0xdeff('0x16')](handleError(_0x4cf724,null));};exports[_0xdeff('0x17')]=function(_0x1ab1fa,_0x3a677a){if(_0x1ab1fa[_0xdeff('0x18')][_0xdeff('0xc')]&&_0x1ab1fa[_0xdeff('0x18')][_0xdeff('0x19')]){var _0x488faa=path['join'](__dirname,'../../files/plugins',_0x1ab1fa[_0xdeff('0x18')]['script']);var _0x189627=process[_0xdeff('0x1a')]();process['chdir'](path[_0xdeff('0x1b')](_0x488faa));return execChildProcess()[_0xdeff('0x10')](function(_0x4eb2a8){process['chdir'](_0x189627);return pm2[_0xdeff('0x1c')]({'name':_0x1ab1fa[_0xdeff('0x18')][_0xdeff('0xc')],'script':_0x488faa});})[_0xdeff('0x10')](function(_0x32add9){pm2['dump']();return _0x32add9[0x0];})[_0xdeff('0x10')](respondWithResult(_0x3a677a,0xc9))[_0xdeff('0x16')](handleError(_0x3a677a,null));}else{return _0x3a677a[_0xdeff('0x8')](0x1f4)[_0xdeff('0xd')]({'message':_0xdeff('0x1d')});}};exports[_0xdeff('0x1e')]=function(_0x3d0111,_0x52ea5d){if(_0x3d0111[_0xdeff('0x18')]['id']){delete _0x3d0111[_0xdeff('0x18')]['id'];}var _0x53b168={'online':'restart','stopped':_0xdeff('0x1f')};if(_0x53b168[_0xdeff('0x20')](_0x3d0111[_0xdeff('0x18')][_0xdeff('0x8')])){return pm2[_0x53b168[_0x3d0111[_0xdeff('0x18')][_0xdeff('0x8')]]](_0x3d0111[_0xdeff('0x15')]['id'])['then'](respondWithResult(_0x52ea5d,0xc8))[_0xdeff('0x16')](handleError(_0x52ea5d,null));}else{return _0x52ea5d[_0xdeff('0x8')](0x1f4)[_0xdeff('0xd')]({'message':'Unknown\x20status'});}};exports['destroy']=function(_0x346743,_0x505e3f){if(_0x346743[_0xdeff('0x18')]['id']){delete _0x346743[_0xdeff('0x18')]['id'];}if(_0x346743[_0xdeff('0x15')]['id']){return pm2['delete'](_0x346743[_0xdeff('0x15')]['id'])['then'](function(_0x4ba2b2){pm2[_0xdeff('0x21')]();return _0x4ba2b2[0x0];})[_0xdeff('0x10')](respondWithResult(_0x505e3f,null))[_0xdeff('0x16')](handleError(_0x505e3f,null));}else{return _0x505e3f[_0xdeff('0x8')](0x1f4)['send']({'message':_0xdeff('0x22')});}};
\ No newline at end of file
+var _0x16d2=['cwd','chdir','start','dump','update','stop','send','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json','error','stack','name','npm\x20install','info','index','list','express','motion2','length','then','catch','show','params','create','body','script','join'];(function(_0x446e71,_0x43dc1e){var _0x3fd150=function(_0x54e99e){while(--_0x54e99e){_0x446e71['push'](_0x446e71['shift']());}};_0x3fd150(++_0x43dc1e);}(_0x16d2,0x123));var _0x216d=function(_0x6ba442,_0x171341){_0x6ba442=_0x6ba442-0x0;var _0x277c57=_0x16d2[_0x6ba442];return _0x277c57;};'use strict';var _=require(_0x216d('0x0'));var pm2=require(_0x216d('0x1'));var logger=require(_0x216d('0x2'))(_0x216d('0x3'));var path=require(_0x216d('0x4'));var exec=require(_0x216d('0x5'))[_0x216d('0x6')];var BPromise=require(_0x216d('0x7'));function handleEntityNotFound(_0xfd7306,_0x593bb0){return function(_0x2c662d){if(!_0x2c662d){_0xfd7306[_0x216d('0x8')](0x194);;}return _0x2c662d;};}function respondWithResult(_0xef687c,_0x205101){_0x205101=_0x205101||0xc8;return function(_0x1dd8e2){if(_0x1dd8e2){return _0xef687c[_0x216d('0x9')](_0x205101)[_0x216d('0xa')](_0x1dd8e2);}return null;};}function handleError(_0x28da14,_0x57accc){_0x57accc=_0x57accc||0x1f4;return function(_0x22c7b3){logger[_0x216d('0xb')](_0x22c7b3[_0x216d('0xc')]);if(_0x22c7b3[_0x216d('0xd')]){delete _0x22c7b3[_0x216d('0xd')];}_0x28da14[_0x216d('0x9')](_0x57accc)['send'](_0x22c7b3);};}function execChildProcess(){return new BPromise(function(_0x7ca9c9,_0x50db30){exec(_0x216d('0xe'),function(_0x2e02ce,_0x332e30,_0x398970){logger[_0x216d('0xf')](_0x332e30);logger[_0x216d('0xf')](_0x398970);if(_0x2e02ce){logger['error'](_0x2e02ce);return _0x50db30(_0x2e02ce);}return _0x7ca9c9(_0x332e30);});});}exports[_0x216d('0x10')]=function(_0x4c07d0,_0x271bb1){return pm2[_0x216d('0x11')]()['then'](function(_0x165c19){if(_0x165c19){var _0x322e4b=_['reject'](_0x165c19,function(_0x1b3215){return _0x1b3215['name']===_0x216d('0x12')||_0x1b3215[_0x216d('0xd')]===_0x216d('0x13');});return{'rows':_0x322e4b,'count':_0x322e4b[_0x216d('0x14')]};}return null;})[_0x216d('0x15')](respondWithResult(_0x271bb1,null))[_0x216d('0x16')](handleError(_0x271bb1,null));};exports[_0x216d('0x17')]=function(_0x1496fe,_0x19fdac){return pm2['describe'](_0x1496fe[_0x216d('0x18')]['id'])['then'](respondWithResult(_0x19fdac,null))['then'](handleEntityNotFound(_0x19fdac,null))[_0x216d('0x16')](handleError(_0x19fdac,null));};exports[_0x216d('0x19')]=function(_0x574758,_0x3f32e0){if(_0x574758[_0x216d('0x1a')]['name']&&_0x574758[_0x216d('0x1a')][_0x216d('0x1b')]){var _0x430e81=path[_0x216d('0x1c')](__dirname,'../../files/plugins',_0x574758[_0x216d('0x1a')][_0x216d('0x1b')]);var _0x10f299=process[_0x216d('0x1d')]();process[_0x216d('0x1e')](path['dirname'](_0x430e81));return execChildProcess()[_0x216d('0x15')](function(_0x1bd4db){process[_0x216d('0x1e')](_0x10f299);return pm2[_0x216d('0x1f')]({'name':_0x574758[_0x216d('0x1a')]['name'],'script':_0x430e81});})[_0x216d('0x15')](function(_0xab672){pm2[_0x216d('0x20')]();return _0xab672[0x0];})['then'](respondWithResult(_0x3f32e0,0xc9))['catch'](handleError(_0x3f32e0,null));}else{return _0x3f32e0['status'](0x1f4)['send']({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x216d('0x21')]=function(_0x470d8a,_0x189413){if(_0x470d8a[_0x216d('0x1a')]['id']){delete _0x470d8a[_0x216d('0x1a')]['id'];}var _0x47fa6d={'online':'restart','stopped':_0x216d('0x22')};if(_0x47fa6d['hasOwnProperty'](_0x470d8a[_0x216d('0x1a')][_0x216d('0x9')])){return pm2[_0x47fa6d[_0x470d8a[_0x216d('0x1a')][_0x216d('0x9')]]](_0x470d8a[_0x216d('0x18')]['id'])[_0x216d('0x15')](respondWithResult(_0x189413,0xc8))[_0x216d('0x16')](handleError(_0x189413,null));}else{return _0x189413[_0x216d('0x9')](0x1f4)[_0x216d('0x23')]({'message':_0x216d('0x24')});}};exports[_0x216d('0x25')]=function(_0x260134,_0x4537fd){if(_0x260134['body']['id']){delete _0x260134[_0x216d('0x1a')]['id'];}if(_0x260134[_0x216d('0x18')]['id']){return pm2[_0x216d('0x26')](_0x260134['params']['id'])[_0x216d('0x15')](function(_0x1743ee){pm2[_0x216d('0x20')]();return _0x1743ee[0x0];})[_0x216d('0x15')](respondWithResult(_0x4537fd,null))['catch'](handleError(_0x4537fd,null));}else{return _0x4537fd[_0x216d('0x9')](0x1f4)[_0x216d('0x23')]({'message':_0x216d('0x27')});}};
\ No newline at end of file
index 3793ae1..57653bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19c9=['/queues','isAuthenticated','exports','express','../../components/auth/service','./realtime.controller'];(function(_0xae1a83,_0x1980d4){var _0xdb9da8=function(_0x36fc99){while(--_0x36fc99){_0xae1a83['push'](_0xae1a83['shift']());}};_0xdb9da8(++_0x1980d4);}(_0x19c9,0x1bf));var _0x919c=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x19c9[_0x710815];return _0x5b3b89;};'use strict';var express=require(_0x919c('0x0'));var router=express['Router']();var auth=require(_0x919c('0x1'));var controller=require(_0x919c('0x2'));router['get'](_0x919c('0x3'),auth[_0x919c('0x4')](),controller['getQueues']);module[_0x919c('0x5')]=router;
\ No newline at end of file
+var _0x1574=['express','Router','../../components/auth/service','./realtime.controller','/queues','isAuthenticated','getQueues','exports'];(function(_0x1e6659,_0x1f860c){var _0x4d16e4=function(_0x21c05a){while(--_0x21c05a){_0x1e6659['push'](_0x1e6659['shift']());}};_0x4d16e4(++_0x1f860c);}(_0x1574,0x148));var _0x4157=function(_0x1bad5d,_0x452ae5){_0x1bad5d=_0x1bad5d-0x0;var _0x122167=_0x1574[_0x1bad5d];return _0x122167;};'use strict';var express=require(_0x4157('0x0'));var router=express[_0x4157('0x1')]();var auth=require(_0x4157('0x2'));var controller=require(_0x4157('0x3'));router['get'](_0x4157('0x4'),auth[_0x4157('0x5')](),controller[_0x4157('0x6')]);module[_0x4157('0x7')]=router;
\ No newline at end of file
index 1cceb81..dcbcf85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a07=['dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','rows','get','paused','loggedInDb','find','merge','online','getMembers','length','UserId','User','Pause','findAll','agent','all','catch','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','../../mysqldb','client','http','offset','undefined','limit','count','status','set','Content-Range','error','stack','name','getQueues','mail','chat','openchannel','fax','whatsapp','voice','resolve','then','channel','includes','query','Invalid\x20channel','toLowerCase','Queue','map','rawAttributes','fieldName','type','key','getOptions','user','role','userProfileId','outbound','QueueCampaigns','startCase','Queues','filter','UserProfile','getResources','findAndCountAll','request','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','loggedIn','available','waiting','talking','push','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval'];(function(_0x2f8c3d,_0x3eff73){var _0x185933=function(_0x14a8a0){while(--_0x14a8a0){_0x2f8c3d['push'](_0x2f8c3d['shift']());}};_0x185933(++_0x3eff73);}(_0x2a07,0x74));var _0x72a0=function(_0x215ea3,_0x24d78){_0x215ea3=_0x215ea3-0x0;var _0x542d1d=_0x2a07[_0x215ea3];return _0x542d1d;};'use strict';var util=require(_0x72a0('0x0'));var _=require(_0x72a0('0x1'));var jayson=require(_0x72a0('0x2'));var qs=require(_0x72a0('0x3'));var logger=require(_0x72a0('0x4'))('api');var db=require(_0x72a0('0x5'))['db'];var client=jayson[_0x72a0('0x6')][_0x72a0('0x7')]({'port':0x232a});var routingClient=jayson[_0x72a0('0x6')][_0x72a0('0x7')]({'port':0x232c});function respondWithFilteredResult(_0xce74c,_0x3ccf6d){return function(_0x20dab9){if(_0x20dab9){var _0x193e3b=typeof _0x3ccf6d[_0x72a0('0x8')]===_0x72a0('0x9')&&typeof _0x3ccf6d[_0x72a0('0xa')]===_0x72a0('0x9');var _0x1d32e9=_0x20dab9[_0x72a0('0xb')];var _0x2bc45b=_0x193e3b?0x0:_0x3ccf6d['offset'];var _0x169dc2=_0x193e3b?_0x20dab9[_0x72a0('0xb')]:_0x3ccf6d['offset']+_0x3ccf6d[_0x72a0('0xa')];var _0x194488;if(_0x169dc2>=_0x1d32e9){_0x169dc2=_0x1d32e9;_0x194488=0xc8;}else{_0x194488=0xce;}_0xce74c[_0x72a0('0xc')](_0x194488);return _0xce74c[_0x72a0('0xd')](_0x72a0('0xe'),_0x2bc45b+'-'+_0x169dc2+'/'+_0x1d32e9)['json'](_0x20dab9);}return null;};}function handleError(_0x130797,_0x335b9f){_0x335b9f=_0x335b9f||0x1f4;return function(_0x123ca4){logger[_0x72a0('0xf')](_0x123ca4[_0x72a0('0x10')]);if(_0x123ca4[_0x72a0('0x11')]){delete _0x123ca4[_0x72a0('0x11')];}_0x130797['status'](_0x335b9f)['send'](_0x123ca4);};}exports[_0x72a0('0x12')]=function(_0x3cd89f,_0x19eaf9){var _0x1d1133=[_0x72a0('0x13'),_0x72a0('0x14'),'sms',_0x72a0('0x15'),_0x72a0('0x16'),_0x72a0('0x17'),_0x72a0('0x18')];var _0x2d1e95={'count':0x0,'rows':[]},_0x54495e={},_0x100d8f;Promise[_0x72a0('0x19')]()[_0x72a0('0x1a')](function(){if(_0x3cd89f['query'][_0x72a0('0x1b')]){if(!_[_0x72a0('0x1c')](_0x1d1133,_0x3cd89f[_0x72a0('0x1d')][_0x72a0('0x1b')]['toLowerCase']()))throw new Error(_0x72a0('0x1e'));_0x100d8f=_0x3cd89f['query'][_0x72a0('0x1b')][_0x72a0('0x1f')]();}var _0xde058c=_['startCase'](_0x100d8f)+_0x72a0('0x20');var _0x1849d1=_[_0x72a0('0x21')](db[_0xde058c][_0x72a0('0x22')],function(_0x5d6145){return{'name':_0x5d6145[_0x72a0('0x23')],'type':_0x5d6145[_0x72a0('0x24')][_0x72a0('0x25')]};});_0x54495e=qs[_0x72a0('0x26')](_0x1849d1,_0x3cd89f);if(_0x3cd89f[_0x72a0('0x27')][_0x72a0('0x28')]==='user'){var _0x4dd1a6={'params':{'id':_0x3cd89f[_0x72a0('0x27')][_0x72a0('0x29')]},'query':{'section':_0x100d8f===_0x72a0('0x18')&&_0x3cd89f[_0x72a0('0x1d')][_0x72a0('0x24')]===_0x72a0('0x2a')?_0x72a0('0x2b'):_[_0x72a0('0x2c')](_0x100d8f)+_0x72a0('0x2d'),'type':_0x3cd89f[_0x72a0('0x1d')]['type'],'nolimit':!![],'sort':_0x72a0('0x11'),'filter':_0x3cd89f[_0x72a0('0x1d')][_0x72a0('0x2e')]}};return db[_0x72a0('0x2f')][_0x72a0('0x30')](_0x4dd1a6);}return db[_0xde058c][_0x72a0('0x31')](_0x54495e);})[_0x72a0('0x1a')](function(_0x12eda2){_0x2d1e95[_0x72a0('0xb')]=_0x12eda2[_0x72a0('0xb')];var _0x4ba037=_0x100d8f===_0x72a0('0x18')?client:routingClient;return _0x4ba037[_0x72a0('0x32')](_[_0x72a0('0x2c')](_0x100d8f)+_0x72a0('0x2d'),_0x3cd89f)[_0x72a0('0x1a')](function(_0x19e783){if(_0x19e783[_0x72a0('0xf')])throw new Error(util['format'](_0x72a0('0x33'),_0x100d8f));var _0x2c884f=_0x19e783[_0x72a0('0x34')];var _0x197591=[_0x72a0('0x35'),_0x72a0('0x36'),_0x72a0('0x37'),_0x72a0('0x38'),'paused'];if(_0x100d8f===_0x72a0('0x18')&&_0x3cd89f[_0x72a0('0x1d')][_0x72a0('0x24')]==='outbound'){_0x197591[_0x72a0('0x39')]('pTalking',_0x72a0('0x3a'),_0x72a0('0x3b'),_0x72a0('0x3c'),_0x72a0('0x3d'),_0x72a0('0x3e'),_0x72a0('0x3f'),_0x72a0('0x40'),_0x72a0('0x41'),_0x72a0('0x42'),_0x72a0('0x43'),_0x72a0('0x44'),_0x72a0('0x45'),'dialPredictiveIntervalMaxThreshold',_0x72a0('0x46'),'predictiveIntervalAvailable',_0x72a0('0x47'),_0x72a0('0x48'),_0x72a0('0x49'),_0x72a0('0x4a'),_0x72a0('0x4b'),_0x72a0('0x4c'));}var _0x90b437=_0x12eda2[_0x72a0('0x4d')][_0x72a0('0x21')](function(_0x4c1f43){var _0x4a973a=_0x4c1f43[_0x72a0('0x4e')]({'plain':!![]});_0x4a973a[_0x72a0('0x4f')]=0x0;_0x4a973a[_0x72a0('0x50')]=0x0;_0x4a973a[_0x72a0('0x35')]=0x0;_0x4a973a[_0x72a0('0x36')]=0x0;_0x4a973a['paused']=0x0;_0x4a973a[_0x72a0('0x37')]=0x0;if(_0x100d8f===_0x72a0('0x18')){_0x4a973a['talking']=0x0;if(_0x3cd89f[_0x72a0('0x1d')]['type']==='outbound'){_0x4a973a['pTalking']=0x0;_0x4a973a[_0x72a0('0x3a')]=0x0;}}_0x4a973a['agents']=[];var _0x44b47b=_[_0x72a0('0x51')](_0x2c884f[_0x72a0('0x4d')],['id',_0x4a973a['id']]);if(_0x44b47b)_[_0x72a0('0x52')](_0x4a973a,_['pick'](_0x44b47b,_0x197591));if(_0x100d8f==='voice'){return _0x4c1f43['getAgents']({'attributes':['id','name',_0x72a0('0x53')],'joinTableAttributes':[],'raw':!![]})[_0x72a0('0x1a')](function(_0x4a7032){return _0x4c1f43[_0x72a0('0x54')]({'raw':!![]})[_0x72a0('0x1a')](function(_0x49414d){for(var _0x2a8ddf=0x0;_0x2a8ddf<_0x4a7032[_0x72a0('0x55')];_0x2a8ddf++){var _0x45cfbd=_[_0x72a0('0x51')](_0x49414d,[_0x72a0('0x56'),_0x4a7032[_0x2a8ddf]['id']]);var _0x341451={'id':_0x4a7032[_0x2a8ddf]['id'],'name':_0x4a7032[_0x2a8ddf]['name'],'online':Boolean(_0x4a7032[_0x2a8ddf][_0x72a0('0x53')]),'paused':_0x45cfbd?Boolean(_0x45cfbd['paused']):![]};if(_0x341451[_0x72a0('0x53')])_0x4a973a['loggedInDb']++;if(_0x341451[_0x72a0('0x4f')])_0x4a973a[_0x72a0('0x4f')]++;_0x4a973a['agents'][_0x72a0('0x39')](_0x341451);}return _0x4a973a;});});}else{var _0x506d65=_0x72a0('0x57')+_[_0x72a0('0x2c')](_0x100d8f)+_0x72a0('0x20');var _0x4afdd1=_0x100d8f+_0x72a0('0x58');return db[_0x506d65][_0x72a0('0x59')]({'where':{[_[_0x72a0('0x2c')](_0x100d8f)+'QueueId']:_0x4c1f43['id']},'raw':!![]})['then'](function(_0x117fd3){return db['User'][_0x72a0('0x59')]({'attributes':['id',_0x72a0('0x11'),_0x72a0('0x53'),_0x4afdd1],'where':{'id':_[_0x72a0('0x21')](_0x117fd3,_0x72a0('0x56')),'role':_0x72a0('0x5a')},'raw':!![]});})[_0x72a0('0x1a')](function(_0x2f068c){for(var _0x2efa92=0x0;_0x2efa92<_0x2f068c['length'];_0x2efa92++){var _0x4fae3d={'id':_0x2f068c[_0x2efa92]['id'],'name':_0x2f068c[_0x2efa92][_0x72a0('0x11')],'online':Boolean(_0x2f068c[_0x2efa92][_0x72a0('0x53')]),'paused':Boolean(_0x2f068c[_0x2efa92][_0x4afdd1])};if(_0x4fae3d[_0x72a0('0x53')])_0x4a973a[_0x72a0('0x50')]++;if(_0x4fae3d[_0x72a0('0x4f')])_0x4a973a[_0x72a0('0x4f')]++;_0x4a973a['agents']['push'](_0x4fae3d);}return _0x4a973a;});}});return Promise[_0x72a0('0x5b')](_0x90b437);});})[_0x72a0('0x1a')](function(_0xe38fb3){_0x2d1e95[_0x72a0('0x4d')]=_0xe38fb3;return _0x2d1e95;})[_0x72a0('0x1a')](respondWithFilteredResult(_0x19eaf9,_0x54495e))[_0x72a0('0x5c')](handleError(_0x19eaf9,null));};
\ No newline at end of file
+var _0x5162=['mail','chat','sms','openchannel','fax','voice','resolve','channel','includes','query','toLowerCase','Invalid\x20channel','startCase','Queue','fieldName','type','key','getOptions','user','role','userProfileId','outbound','QueueCampaigns','Queues','filter','UserProfile','getResources','findAndCountAll','request','then','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','loggedIn','available','talking','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','rows','map','get','paused','agents','find','merge','pick','getAgents','online','getMembers','length','UserId','loggedInDb','User','findAll','QueueId','all','catch','util','api','../../mysqldb','client','http','offset','undefined','limit','count','Content-Range','json','error','stack','name','status','send','getQueues'];(function(_0x2e9c83,_0x482cd5){var _0x58f892=function(_0x42a0f6){while(--_0x42a0f6){_0x2e9c83['push'](_0x2e9c83['shift']());}};_0x58f892(++_0x482cd5);}(_0x5162,0x103));var _0x2516=function(_0x2ccb91,_0xa2c1b4){_0x2ccb91=_0x2ccb91-0x0;var _0x4136ca=_0x5162[_0x2ccb91];return _0x4136ca;};'use strict';var util=require(_0x2516('0x0'));var _=require('lodash');var jayson=require('jayson/promise');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x2516('0x1'));var db=require(_0x2516('0x2'))['db'];var client=jayson[_0x2516('0x3')][_0x2516('0x4')]({'port':0x232a});var routingClient=jayson[_0x2516('0x3')][_0x2516('0x4')]({'port':0x232c});function respondWithFilteredResult(_0x3a7984,_0x5b71b5){return function(_0x48f411){if(_0x48f411){var _0x5beeb3=typeof _0x5b71b5[_0x2516('0x5')]===_0x2516('0x6')&&typeof _0x5b71b5[_0x2516('0x7')]===_0x2516('0x6');var _0x3abc5d=_0x48f411[_0x2516('0x8')];var _0x1cb817=_0x5beeb3?0x0:_0x5b71b5['offset'];var _0x409550=_0x5beeb3?_0x48f411[_0x2516('0x8')]:_0x5b71b5[_0x2516('0x5')]+_0x5b71b5['limit'];var _0x530b1b;if(_0x409550>=_0x3abc5d){_0x409550=_0x3abc5d;_0x530b1b=0xc8;}else{_0x530b1b=0xce;}_0x3a7984['status'](_0x530b1b);return _0x3a7984['set'](_0x2516('0x9'),_0x1cb817+'-'+_0x409550+'/'+_0x3abc5d)[_0x2516('0xa')](_0x48f411);}return null;};}function handleError(_0x310d1a,_0x3ef6ff){_0x3ef6ff=_0x3ef6ff||0x1f4;return function(_0x56c69c){logger[_0x2516('0xb')](_0x56c69c[_0x2516('0xc')]);if(_0x56c69c[_0x2516('0xd')]){delete _0x56c69c[_0x2516('0xd')];}_0x310d1a[_0x2516('0xe')](_0x3ef6ff)[_0x2516('0xf')](_0x56c69c);};}exports[_0x2516('0x10')]=function(_0x2edb47,_0x1b3c7e){var _0x181a28=[_0x2516('0x11'),_0x2516('0x12'),_0x2516('0x13'),_0x2516('0x14'),_0x2516('0x15'),'whatsapp',_0x2516('0x16')];var _0x1ced29={'count':0x0,'rows':[]},_0x1a1005={},_0x564d05;Promise[_0x2516('0x17')]()['then'](function(){if(_0x2edb47['query'][_0x2516('0x18')]){if(!_[_0x2516('0x19')](_0x181a28,_0x2edb47[_0x2516('0x1a')][_0x2516('0x18')][_0x2516('0x1b')]()))throw new Error(_0x2516('0x1c'));_0x564d05=_0x2edb47[_0x2516('0x1a')][_0x2516('0x18')][_0x2516('0x1b')]();}var _0x37485b=_[_0x2516('0x1d')](_0x564d05)+_0x2516('0x1e');var _0x1b0831=_['map'](db[_0x37485b]['rawAttributes'],function(_0x12db4d){return{'name':_0x12db4d[_0x2516('0x1f')],'type':_0x12db4d[_0x2516('0x20')][_0x2516('0x21')]};});_0x1a1005=qs[_0x2516('0x22')](_0x1b0831,_0x2edb47);if(_0x2edb47[_0x2516('0x23')][_0x2516('0x24')]===_0x2516('0x23')){var _0x4b1d4f={'params':{'id':_0x2edb47[_0x2516('0x23')][_0x2516('0x25')]},'query':{'section':_0x564d05===_0x2516('0x16')&&_0x2edb47[_0x2516('0x1a')]['type']===_0x2516('0x26')?_0x2516('0x27'):_[_0x2516('0x1d')](_0x564d05)+_0x2516('0x28'),'type':_0x2edb47[_0x2516('0x1a')]['type'],'nolimit':!![],'sort':_0x2516('0xd'),'filter':_0x2edb47[_0x2516('0x1a')][_0x2516('0x29')]}};return db[_0x2516('0x2a')][_0x2516('0x2b')](_0x4b1d4f);}return db[_0x37485b][_0x2516('0x2c')](_0x1a1005);})['then'](function(_0x136893){_0x1ced29[_0x2516('0x8')]=_0x136893['count'];var _0x19d90d=_0x564d05===_0x2516('0x16')?client:routingClient;return _0x19d90d[_0x2516('0x2d')](_[_0x2516('0x1d')](_0x564d05)+_0x2516('0x28'),_0x2edb47)[_0x2516('0x2e')](function(_0x2e92f2){if(_0x2e92f2[_0x2516('0xb')])throw new Error(util[_0x2516('0x2f')](_0x2516('0x30'),_0x564d05));var _0xc0d4a9=_0x2e92f2[_0x2516('0x31')];var _0x2a5346=[_0x2516('0x32'),_0x2516('0x33'),'waiting',_0x2516('0x34'),'paused'];if(_0x564d05===_0x2516('0x16')&&_0x2edb47['query'][_0x2516('0x20')]==='outbound'){_0x2a5346[_0x2516('0x35')](_0x2516('0x36'),_0x2516('0x37'),_0x2516('0x38'),_0x2516('0x39'),_0x2516('0x3a'),_0x2516('0x3b'),_0x2516('0x3c'),_0x2516('0x3d'),'erlangCalls',_0x2516('0x3e'),_0x2516('0x3f'),_0x2516('0x40'),_0x2516('0x41'),'dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold',_0x2516('0x42'),_0x2516('0x43'),_0x2516('0x44'),_0x2516('0x45'),_0x2516('0x46'),_0x2516('0x47'),_0x2516('0x48'));}var _0x1bc9ee=_0x136893[_0x2516('0x49')][_0x2516('0x4a')](function(_0x541d69){var _0x4844a1=_0x541d69[_0x2516('0x4b')]({'plain':!![]});_0x4844a1[_0x2516('0x4c')]=0x0;_0x4844a1['loggedInDb']=0x0;_0x4844a1['loggedIn']=0x0;_0x4844a1[_0x2516('0x33')]=0x0;_0x4844a1[_0x2516('0x4c')]=0x0;_0x4844a1['waiting']=0x0;if(_0x564d05===_0x2516('0x16')){_0x4844a1['talking']=0x0;if(_0x2edb47[_0x2516('0x1a')][_0x2516('0x20')]==='outbound'){_0x4844a1[_0x2516('0x36')]=0x0;_0x4844a1[_0x2516('0x37')]=0x0;}}_0x4844a1[_0x2516('0x4d')]=[];var _0x194c9d=_[_0x2516('0x4e')](_0xc0d4a9[_0x2516('0x49')],['id',_0x4844a1['id']]);if(_0x194c9d)_[_0x2516('0x4f')](_0x4844a1,_[_0x2516('0x50')](_0x194c9d,_0x2a5346));if(_0x564d05===_0x2516('0x16')){return _0x541d69[_0x2516('0x51')]({'attributes':['id',_0x2516('0xd'),_0x2516('0x52')],'joinTableAttributes':[],'raw':!![]})[_0x2516('0x2e')](function(_0x4c832b){return _0x541d69[_0x2516('0x53')]({'raw':!![]})[_0x2516('0x2e')](function(_0x5debf2){for(var _0xfd6236=0x0;_0xfd6236<_0x4c832b[_0x2516('0x54')];_0xfd6236++){var _0x2eadc7=_[_0x2516('0x4e')](_0x5debf2,[_0x2516('0x55'),_0x4c832b[_0xfd6236]['id']]);var _0x582cb6={'id':_0x4c832b[_0xfd6236]['id'],'name':_0x4c832b[_0xfd6236][_0x2516('0xd')],'online':Boolean(_0x4c832b[_0xfd6236][_0x2516('0x52')]),'paused':_0x2eadc7?Boolean(_0x2eadc7[_0x2516('0x4c')]):![]};if(_0x582cb6[_0x2516('0x52')])_0x4844a1[_0x2516('0x56')]++;if(_0x582cb6[_0x2516('0x4c')])_0x4844a1['paused']++;_0x4844a1[_0x2516('0x4d')][_0x2516('0x35')](_0x582cb6);}return _0x4844a1;});});}else{var _0xe64acc=_0x2516('0x57')+_[_0x2516('0x1d')](_0x564d05)+_0x2516('0x1e');var _0x18027f=_0x564d05+'Pause';return db[_0xe64acc][_0x2516('0x58')]({'where':{[_['startCase'](_0x564d05)+_0x2516('0x59')]:_0x541d69['id']},'raw':!![]})['then'](function(_0x396be6){return db[_0x2516('0x57')][_0x2516('0x58')]({'attributes':['id','name','online',_0x18027f],'where':{'id':_[_0x2516('0x4a')](_0x396be6,_0x2516('0x55')),'role':'agent'},'raw':!![]});})['then'](function(_0x33ed52){for(var _0x147e05=0x0;_0x147e05<_0x33ed52[_0x2516('0x54')];_0x147e05++){var _0x53e61c={'id':_0x33ed52[_0x147e05]['id'],'name':_0x33ed52[_0x147e05][_0x2516('0xd')],'online':Boolean(_0x33ed52[_0x147e05]['online']),'paused':Boolean(_0x33ed52[_0x147e05][_0x18027f])};if(_0x53e61c[_0x2516('0x52')])_0x4844a1[_0x2516('0x56')]++;if(_0x53e61c[_0x2516('0x4c')])_0x4844a1[_0x2516('0x4c')]++;_0x4844a1['agents'][_0x2516('0x35')](_0x53e61c);}return _0x4844a1;});}});return Promise[_0x2516('0x5a')](_0x1bc9ee);});})[_0x2516('0x2e')](function(_0x236048){_0x1ced29[_0x2516('0x49')]=_0x236048;return _0x1ced29;})['then'](respondWithFilteredResult(_0x1b3c7e,_0x1a1005))[_0x2516('0x5b')](handleError(_0x1b3c7e,null));};
\ No newline at end of file
index 3c674c2..9539b78 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(_0x365a40,_0x5c073e){var _0x1dd6d5=function(_0x2a1932){while(--_0x2a1932){_0x365a40['push'](_0x365a40['shift']());}};_0x1dd6d5(++_0x5c073e);}(_0x9c44,0x178));var _0x49c4=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x9c44[_0x18ab2a];return _0x16dcee;};'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(_0x20f9ab,_0x26a12e){var _0x138019=function(_0x2445b8){while(--_0x2445b8){_0x20f9ab['push'](_0x20f9ab['shift']());}};_0x138019(++_0x26a12e);}(_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 4139fd3..ec8cda7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcde7=['STRING','DATE','INTEGER'];(function(_0x178728,_0x3257cd){var _0x17a2da=function(_0x2bbc66){while(--_0x2bbc66){_0x178728['push'](_0x178728['shift']());}};_0x17a2da(++_0x3257cd);}(_0xcde7,0x65));var _0x7cde=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xcde7[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0x7cde('0x0')](0x2)},'statedesc':{'type':Sequelize[_0x7cde('0x1')]},'scheduledat':{'type':Sequelize[_0x7cde('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x7cde('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x7cde('0x1')]},'campaigntype':{'type':Sequelize[_0x7cde('0x1')]},'membername':{'type':Sequelize[_0x7cde('0x1')]}};
\ No newline at end of file
+var _0x307e=['DATE','sequelize','exports','INTEGER','STRING'];(function(_0x3c77b8,_0x43b354){var _0x1da9a2=function(_0x2e2a1a){while(--_0x2e2a1a){_0x3c77b8['push'](_0x3c77b8['shift']());}};_0x1da9a2(++_0x43b354);}(_0x307e,0xc9));var _0xe307=function(_0x50b72b,_0x25d8e9){_0x50b72b=_0x50b72b-0x0;var _0x3063a7=_0x307e[_0x50b72b];return _0x3063a7;};'use strict';var Sequelize=require(_0xe307('0x0'));module[_0xe307('0x1')]={'state':{'type':Sequelize[_0xe307('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xe307('0x3')]},'scheduledat':{'type':Sequelize[_0xe307('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xe307('0x4')]},'responsetime':{'type':Sequelize[_0xe307('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xe307('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xe307('0x3')]}};
\ No newline at end of file
index dcb83a6..99a7d8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04f2=['./reportAgentPreview.attributes','exports','define','ReportAgentPreview','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x5c5721,_0x23ed04){var _0x539568=function(_0x2cba73){while(--_0x2cba73){_0x5c5721['push'](_0x5c5721['shift']());}};_0x539568(++_0x23ed04);}(_0x04f2,0x108));var _0x204f=function(_0x483948,_0x1947db){_0x483948=_0x483948-0x0;var _0x1f6146=_0x04f2[_0x483948];return _0x1f6146;};'use strict';var _=require(_0x204f('0x0'));var util=require(_0x204f('0x1'));var logger=require(_0x204f('0x2'))(_0x204f('0x3'));var moment=require(_0x204f('0x4'));var BPromise=require('bluebird');var rp=require(_0x204f('0x5'));var fs=require('fs');var path=require(_0x204f('0x6'));var rimraf=require(_0x204f('0x7'));var config=require(_0x204f('0x8'));var attributes=require(_0x204f('0x9'));module[_0x204f('0xa')]=function(_0xe9ac8f,_0x16ac46){return _0xe9ac8f[_0x204f('0xb')](_0x204f('0xc'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x530a=['../../config/environment','exports','define','ReportAgentPreview','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x207c0a,_0x939576){var _0x173a55=function(_0x29c7bd){while(--_0x29c7bd){_0x207c0a['push'](_0x207c0a['shift']());}};_0x173a55(++_0x939576);}(_0x530a,0x1bc));var _0xa530=function(_0x8ffc80,_0x208e2b){_0x8ffc80=_0x8ffc80-0x0;var _0x5cd45a=_0x530a[_0x8ffc80];return _0x5cd45a;};'use strict';var _=require(_0xa530('0x0'));var util=require(_0xa530('0x1'));var logger=require('../../config/logger')(_0xa530('0x2'));var moment=require(_0xa530('0x3'));var BPromise=require('bluebird');var rp=require(_0xa530('0x4'));var fs=require('fs');var path=require(_0xa530('0x5'));var rimraf=require(_0xa530('0x6'));var config=require(_0xa530('0x7'));var attributes=require('./reportAgentPreview.attributes');module[_0xa530('0x8')]=function(_0x123dad,_0x35a769){return _0x123dad[_0xa530('0x9')](_0xa530('0xa'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6413945..60a54f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8091=['then','info','request\x20sent','error','code','ReportAgentPreview,\x20%s,\x20%s','message','result','CreateReportAgentPreview','create','options','raw','debug','stringify','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x365b2e,_0x4c01a0){var _0x4c2e94=function(_0x9cb498){while(--_0x9cb498){_0x365b2e['push'](_0x365b2e['shift']());}};_0x4c2e94(++_0x4c01a0);}(_0x8091,0x189));var _0x1809=function(_0x301796,_0xcc5d8e){_0x301796=_0x301796-0x0;var _0x1c801c=_0x8091[_0x301796];return _0x1c801c;};'use strict';var _=require(_0x1809('0x0'));var util=require(_0x1809('0x1'));var moment=require('moment');var BPromise=require(_0x1809('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1809('0x3'));var db=require(_0x1809('0x4'))['db'];var utils=require(_0x1809('0x5'));var logger=require('../../config/logger')(_0x1809('0x6'));var config=require(_0x1809('0x7'));var jayson=require(_0x1809('0x8'));var client=jayson[_0x1809('0x9')][_0x1809('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19f572,_0x3b462f,_0x3a3c30){return new BPromise(function(_0x264e54,_0x2c95ff){return client[_0x1809('0xb')](_0x19f572,_0x3a3c30)[_0x1809('0xc')](function(_0x567a93){logger[_0x1809('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x3b462f,'request\x20sent');logger['debug']('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x3b462f,_0x1809('0xe'),JSON['stringify'](_0x567a93));if(_0x567a93[_0x1809('0xf')]){if(_0x567a93['error'][_0x1809('0x10')]===0x1f4){logger[_0x1809('0xf')](_0x1809('0x11'),_0x3b462f,_0x567a93['error'][_0x1809('0x12')]);return _0x2c95ff(_0x567a93['error'][_0x1809('0x12')]);}logger['error'](_0x1809('0x11'),_0x3b462f,_0x567a93[_0x1809('0xf')][_0x1809('0x12')]);return _0x264e54(_0x567a93[_0x1809('0xf')][_0x1809('0x12')]);}else{logger[_0x1809('0xd')](_0x1809('0x11'),_0x3b462f,_0x1809('0xe'));_0x264e54(_0x567a93[_0x1809('0x13')][_0x1809('0x12')]);}})['catch'](function(_0x2702b6){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x3b462f,_0x2702b6);_0x2c95ff(_0x2702b6);});});}exports[_0x1809('0x14')]=function(_0x2cd3df){var _0x372ea5=this;return new Promise(function(_0x22a212,_0x2f2735){return db['ReportAgentPreview'][_0x1809('0x15')](_0x2cd3df['body'],{'raw':_0x2cd3df[_0x1809('0x16')]?_0x2cd3df['options'][_0x1809('0x17')]===undefined?!![]:![]:!![]})[_0x1809('0xc')](function(_0x1edd74){logger['info'](_0x1809('0x14'),_0x2cd3df);logger[_0x1809('0x18')]('CreateReportAgentPreview',_0x2cd3df,JSON[_0x1809('0x19')](_0x1edd74));_0x22a212(_0x1edd74);})[_0x1809('0x1a')](function(_0x3c5543){logger[_0x1809('0xf')](_0x1809('0x14'),_0x3c5543[_0x1809('0x12')],_0x2cd3df);_0x2f2735(_0x372ea5[_0x1809('0xf')](0x1f4,_0x3c5543['message']));});});};
\ No newline at end of file
+var _0x3ef3=['request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','body','options','raw','then','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ReportAgentPreview,\x20%s,\x20%s'];(function(_0x2f55b5,_0x387971){var _0x5d2a16=function(_0x44ef52){while(--_0x44ef52){_0x2f55b5['push'](_0x2f55b5['shift']());}};_0x5d2a16(++_0x387971);}(_0x3ef3,0x16b));var _0x33ef=function(_0x240e46,_0x141d91){_0x240e46=_0x240e46-0x0;var _0x9bc15e=_0x3ef3[_0x240e46];return _0x9bc15e;};'use strict';var _=require('lodash');var util=require(_0x33ef('0x0'));var moment=require(_0x33ef('0x1'));var BPromise=require(_0x33ef('0x2'));var rs=require(_0x33ef('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x33ef('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x33ef('0x5'))(_0x33ef('0x6'));var config=require(_0x33ef('0x7'));var jayson=require(_0x33ef('0x8'));var client=jayson[_0x33ef('0x9')][_0x33ef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36449b,_0x27beb2,_0xfaa416){return new BPromise(function(_0x1b56a0,_0x5bd8ee){return client[_0x33ef('0xb')](_0x36449b,_0xfaa416)['then'](function(_0x10e023){logger[_0x33ef('0xc')](_0x33ef('0xd'),_0x27beb2,_0x33ef('0xe'));logger[_0x33ef('0xf')](_0x33ef('0x10'),_0x27beb2,'request\x20sent',JSON[_0x33ef('0x11')](_0x10e023));if(_0x10e023['error']){if(_0x10e023[_0x33ef('0x12')][_0x33ef('0x13')]===0x1f4){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x27beb2,_0x10e023[_0x33ef('0x12')][_0x33ef('0x14')]);return _0x5bd8ee(_0x10e023['error']['message']);}logger[_0x33ef('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x27beb2,_0x10e023[_0x33ef('0x12')][_0x33ef('0x14')]);return _0x1b56a0(_0x10e023[_0x33ef('0x12')][_0x33ef('0x14')]);}else{logger[_0x33ef('0xc')](_0x33ef('0xd'),_0x27beb2,_0x33ef('0xe'));_0x1b56a0(_0x10e023[_0x33ef('0x15')][_0x33ef('0x14')]);}})[_0x33ef('0x16')](function(_0x1ce2df){logger[_0x33ef('0x12')](_0x33ef('0xd'),_0x27beb2,_0x1ce2df);_0x5bd8ee(_0x1ce2df);});});}exports[_0x33ef('0x17')]=function(_0x222149){var _0x803fe2=this;return new Promise(function(_0x2de684,_0x58eb54){return db[_0x33ef('0x18')]['create'](_0x222149[_0x33ef('0x19')],{'raw':_0x222149[_0x33ef('0x1a')]?_0x222149['options'][_0x33ef('0x1b')]===undefined?!![]:![]:!![]})[_0x33ef('0x1c')](function(_0x553d95){logger[_0x33ef('0xc')](_0x33ef('0x17'),_0x222149);logger[_0x33ef('0xf')](_0x33ef('0x17'),_0x222149,JSON[_0x33ef('0x11')](_0x553d95));_0x2de684(_0x553d95);})['catch'](function(_0x135b94){logger['error'](_0x33ef('0x17'),_0x135b94[_0x33ef('0x14')],_0x222149);_0x58eb54(_0x803fe2['error'](0x1f4,_0x135b94['message']));});});};
\ No newline at end of file
index 93bafaf..2da78f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09d7=['isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannel','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','outbound','/outbound/channels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','mail','showMailQueues','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','agentNotify','exports','multer','path','express','Router','get','/voice/channels'];(function(_0x1f71d8,_0x278518){var _0x10b045=function(_0x57aea4){while(--_0x57aea4){_0x1f71d8['push'](_0x1f71d8['shift']());}};_0x10b045(++_0x278518);}(_0x09d7,0x18a));var _0x709d=function(_0x367145,_0x44568f){_0x367145=_0x367145-0x0;var _0x1b5566=_0x09d7[_0x367145];return _0x1b5566;};'use strict';var multer=require(_0x709d('0x0'));var util=require('util');var path=require(_0x709d('0x1'));var express=require(_0x709d('0x2'));var router=express[_0x709d('0x3')]();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router[_0x709d('0x4')](_0x709d('0x5'),auth[_0x709d('0x6')](),controller[_0x709d('0x7')]);router['get'](_0x709d('0x8'),auth[_0x709d('0x6')](),controller[_0x709d('0x9')]);router['get'](_0x709d('0xa'),auth[_0x709d('0x6')](),controller[_0x709d('0xb')]);router['get'](_0x709d('0xc'),auth[_0x709d('0x6')](),controller[_0x709d('0xd')]);router[_0x709d('0x4')](_0x709d('0xe'),auth[_0x709d('0x6')](),controller[_0x709d('0xf')]);router[_0x709d('0x4')]('/mail/queues',auth['isAuthenticated'](),controller['mailQueues']);router[_0x709d('0x4')](_0x709d('0x10'),auth[_0x709d('0x6')](),controller[_0x709d('0x11')]);router[_0x709d('0x4')](_0x709d('0x12'),auth[_0x709d('0x6')](),controller[_0x709d('0x13')]);router[_0x709d('0x4')]('/sms/queues',auth[_0x709d('0x6')](),controller[_0x709d('0x14')]);router[_0x709d('0x4')](_0x709d('0x15'),auth[_0x709d('0x6')](),controller[_0x709d('0x16')]);router[_0x709d('0x4')](_0x709d('0x17'),auth[_0x709d('0x6')](),controller[_0x709d('0x18')]);router[_0x709d('0x4')](_0x709d('0x19'),auth[_0x709d('0x6')](),controller[_0x709d('0x1a')]);router[_0x709d('0x4')](_0x709d('0x1b'),auth[_0x709d('0x6')](),controller['voiceQueuesChannels']);router[_0x709d('0x4')]('/voice/queues/channels/:uniqueid',auth[_0x709d('0x6')](),controller[_0x709d('0x1c')]);router[_0x709d('0x4')]('/voice/queues/channels/:uniqueid/hangup',auth[_0x709d('0x6')](),controller['voiceQueuesChannelHangup']);router[_0x709d('0x4')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x709d('0x6')](),controller[_0x709d('0x1d')]);router['get'](_0x709d('0x1e'),auth[_0x709d('0x6')](),controller[_0x709d('0x1f')]);router[_0x709d('0x20')](_0x709d('0x1e'),auth['isAuthenticated'](),controller[_0x709d('0x21')]);router['get']('/outbound',auth[_0x709d('0x6')](),controller[_0x709d('0x22')]);router['get'](_0x709d('0x23'),auth[_0x709d('0x6')](),controller['outboundChannels']);router['get'](_0x709d('0x24'),auth[_0x709d('0x6')](),controller[_0x709d('0x25')]);router['put'](_0x709d('0x26'),auth['isAuthenticated'](),controller[_0x709d('0x27')]);router['get'](_0x709d('0x28'),auth[_0x709d('0x6')](),controller[_0x709d('0x29')]);router[_0x709d('0x4')]('/trunks',auth[_0x709d('0x6')](),controller[_0x709d('0x2a')]);router[_0x709d('0x4')]('/campaigns',auth['isAuthenticated'](),controller[_0x709d('0x2b')]);router[_0x709d('0x4')](_0x709d('0x2c'),auth[_0x709d('0x6')](),controller[_0x709d('0x2d')]);router[_0x709d('0x4')](_0x709d('0x2e'),auth[_0x709d('0x6')](),controller[_0x709d('0x2f')]);router['get']('/mail/queues/waitinginteractions',auth[_0x709d('0x6')](),controller[_0x709d('0x30')]);router[_0x709d('0x4')](_0x709d('0x31'),auth['isAuthenticated'](),controller[_0x709d('0x32')]);router[_0x709d('0x4')]('/openchannel/queues/:id/waitinginteractions',auth[_0x709d('0x6')](),controller[_0x709d('0x33')]);router['get'](_0x709d('0x34'),auth[_0x709d('0x6')](),controller['smsQueuesWaitingInteractions']);router[_0x709d('0x4')](_0x709d('0x35'),auth[_0x709d('0x6')](),controller[_0x709d('0x36')]);router[_0x709d('0x4')](_0x709d('0x37'),auth[_0x709d('0x6')](),controller[_0x709d('0x38')]);router[_0x709d('0x39')]('/mail/queues/:id/notify',auth[_0x709d('0x6')](),controller[_0x709d('0x3a')](_0x709d('0x3b')));router[_0x709d('0x4')]('/mail/queues/:id',auth[_0x709d('0x6')](),controller[_0x709d('0x3c')]);router[_0x709d('0x39')](_0x709d('0x3d'),auth[_0x709d('0x6')](),controller[_0x709d('0x3a')]('chat'));router[_0x709d('0x4')](_0x709d('0x3e'),auth[_0x709d('0x6')](),controller[_0x709d('0x3f')]);router['post'](_0x709d('0x40'),auth[_0x709d('0x6')](),controller[_0x709d('0x3a')](_0x709d('0x41')));router[_0x709d('0x4')](_0x709d('0x42'),auth[_0x709d('0x6')](),controller['showFaxQueues']);router['post'](_0x709d('0x43'),auth[_0x709d('0x6')](),controller[_0x709d('0x3a')](_0x709d('0x44')));router[_0x709d('0x4')](_0x709d('0x45'),auth['isAuthenticated'](),controller[_0x709d('0x46')]);router[_0x709d('0x39')](_0x709d('0x47'),auth[_0x709d('0x6')](),controller[_0x709d('0x3a')](_0x709d('0x48')));router[_0x709d('0x39')](_0x709d('0x49'),auth[_0x709d('0x6')](),controller['queueNotify'](_0x709d('0x4a')));router['get'](_0x709d('0x4b'),auth[_0x709d('0x6')](),controller[_0x709d('0x4c')]);router[_0x709d('0x4')]('/whatsapp/queues/:id',auth['isAuthenticated'](),controller[_0x709d('0x4d')]);router['post']('/agents/:id/notify',auth[_0x709d('0x6')](),controller[_0x709d('0x4e')]);module[_0x709d('0x4f')]=router;
\ No newline at end of file
+var _0x61a8=['multer','path','express','Router','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','mailQueues','mailAccounts','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','updateVoiceQueue','/outbound','outbound','outboundChannels','/agents','agents','put','/agents/:id/capacity','agentCapacity','/trunks','trunks','/campaigns','campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','fax','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','exports'];(function(_0x24abab,_0x5860aa){var _0x2fa984=function(_0x245510){while(--_0x245510){_0x24abab['push'](_0x24abab['shift']());}};_0x2fa984(++_0x5860aa);}(_0x61a8,0xed));var _0x861a=function(_0x3cae30,_0x5d8b99){_0x3cae30=_0x3cae30-0x0;var _0x263f77=_0x61a8[_0x3cae30];return _0x263f77;};'use strict';var multer=require(_0x861a('0x0'));var util=require('util');var path=require(_0x861a('0x1'));var express=require(_0x861a('0x2'));var router=express[_0x861a('0x3')]();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router[_0x861a('0x4')](_0x861a('0x5'),auth[_0x861a('0x6')](),controller[_0x861a('0x7')]);router[_0x861a('0x4')]('/voice/channels/:uniqueid/mixmonitor',auth[_0x861a('0x6')](),controller['voiceChannelMixMonitor']);router['get'](_0x861a('0x8'),auth[_0x861a('0x6')](),controller[_0x861a('0x9')]);router[_0x861a('0x4')](_0x861a('0xa'),auth[_0x861a('0x6')](),controller[_0x861a('0xb')]);router[_0x861a('0x4')](_0x861a('0xc'),auth[_0x861a('0x6')](),controller['chatQueues']);router[_0x861a('0x4')](_0x861a('0xd'),auth['isAuthenticated'](),controller[_0x861a('0xe')]);router[_0x861a('0x4')]('/mail/accounts',auth[_0x861a('0x6')](),controller[_0x861a('0xf')]);router['get']('/openchannel/queues',auth['isAuthenticated'](),controller['openchannelQueues']);router[_0x861a('0x4')](_0x861a('0x10'),auth[_0x861a('0x6')](),controller[_0x861a('0x11')]);router['get'](_0x861a('0x12'),auth[_0x861a('0x6')](),controller[_0x861a('0x13')]);router[_0x861a('0x4')]('/fax/queues',auth['isAuthenticated'](),controller[_0x861a('0x14')]);router['get']('/voice/queues/preview/:id',auth[_0x861a('0x6')](),controller[_0x861a('0x15')]);router[_0x861a('0x4')](_0x861a('0x16'),auth[_0x861a('0x6')](),controller[_0x861a('0x17')]);router['get'](_0x861a('0x18'),auth[_0x861a('0x6')](),controller['voiceQueuesChannel']);router[_0x861a('0x4')](_0x861a('0x19'),auth[_0x861a('0x6')](),controller['voiceQueuesChannelHangup']);router[_0x861a('0x4')](_0x861a('0x1a'),auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router[_0x861a('0x4')]('/voice/queues/:id',auth[_0x861a('0x6')](),controller['showVoiceQueues']);router['put'](_0x861a('0x1b'),auth[_0x861a('0x6')](),controller[_0x861a('0x1c')]);router['get'](_0x861a('0x1d'),auth['isAuthenticated'](),controller[_0x861a('0x1e')]);router['get']('/outbound/channels',auth[_0x861a('0x6')](),controller[_0x861a('0x1f')]);router[_0x861a('0x4')](_0x861a('0x20'),auth[_0x861a('0x6')](),controller[_0x861a('0x21')]);router[_0x861a('0x22')](_0x861a('0x23'),auth[_0x861a('0x6')](),controller[_0x861a('0x24')]);router[_0x861a('0x4')]('/telephones',auth['isAuthenticated'](),controller['telephones']);router[_0x861a('0x4')](_0x861a('0x25'),auth[_0x861a('0x6')](),controller[_0x861a('0x26')]);router[_0x861a('0x4')](_0x861a('0x27'),auth[_0x861a('0x6')](),controller[_0x861a('0x28')]);router['get'](_0x861a('0x29'),auth[_0x861a('0x6')](),controller['faxAccounts']);router[_0x861a('0x4')](_0x861a('0x2a'),auth[_0x861a('0x6')](),controller[_0x861a('0x2b')]);router[_0x861a('0x4')](_0x861a('0x2c'),auth[_0x861a('0x6')](),controller['mailQueuesWaitingInteractions']);router['get'](_0x861a('0x2d'),auth[_0x861a('0x6')](),controller[_0x861a('0x2e')]);router[_0x861a('0x4')](_0x861a('0x2f'),auth['isAuthenticated'](),controller[_0x861a('0x30')]);router[_0x861a('0x4')](_0x861a('0x31'),auth[_0x861a('0x6')](),controller[_0x861a('0x32')]);router['get']('/whatsapp/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x861a('0x33')]);router[_0x861a('0x4')](_0x861a('0x34'),auth[_0x861a('0x6')](),controller[_0x861a('0x35')]);router[_0x861a('0x36')](_0x861a('0x37'),auth[_0x861a('0x6')](),controller[_0x861a('0x38')](_0x861a('0x39')));router[_0x861a('0x4')](_0x861a('0x3a'),auth[_0x861a('0x6')](),controller[_0x861a('0x3b')]);router[_0x861a('0x36')](_0x861a('0x3c'),auth[_0x861a('0x6')](),controller[_0x861a('0x38')](_0x861a('0x3d')));router['get'](_0x861a('0x3e'),auth[_0x861a('0x6')](),controller[_0x861a('0x3f')]);router[_0x861a('0x36')]('/fax/queues/:id/notify',auth[_0x861a('0x6')](),controller['queueNotify'](_0x861a('0x40')));router[_0x861a('0x4')]('/fax/queues/:id',auth['isAuthenticated'](),controller[_0x861a('0x41')]);router[_0x861a('0x36')]('/openchannel/queues/:id/notify',auth[_0x861a('0x6')](),controller['queueNotify'](_0x861a('0x42')));router[_0x861a('0x4')](_0x861a('0x43'),auth[_0x861a('0x6')](),controller[_0x861a('0x44')]);router[_0x861a('0x36')](_0x861a('0x45'),auth['isAuthenticated'](),controller['queueNotify'](_0x861a('0x46')));router[_0x861a('0x36')](_0x861a('0x47'),auth[_0x861a('0x6')](),controller[_0x861a('0x38')](_0x861a('0x48')));router[_0x861a('0x4')](_0x861a('0x49'),auth[_0x861a('0x6')](),controller[_0x861a('0x4a')]);router[_0x861a('0x4')](_0x861a('0x4b'),auth[_0x861a('0x6')](),controller[_0x861a('0x4c')]);router[_0x861a('0x36')](_0x861a('0x4d'),auth[_0x861a('0x6')](),controller['agentNotify']);module[_0x861a('0x4e')]=router;
\ No newline at end of file
index 7100f51..24a50fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7da7=['value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Queue','findOne','isNil','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','MessageId','From','QueueId','TransferReport','create','Start','Account','queue','agentNotify','channel','User','Agent\x20not\x20found','InteractionId','bluebird','moment','lodash','../../config/logger','api','client','http','request','error','message','catch','status','json','name','send','find','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','VoiceChannelStopMixMonitor','params','then','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agentCapacity','interaction','user','hasOwnProperty','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','MemberReport','findOrCreate','SIP/%s','INTERACTION','agent','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','showWhatsappQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq'];(function(_0x1e6e4e,_0x2b1b09){var _0x3d746b=function(_0x4483dd){while(--_0x4483dd){_0x1e6e4e['push'](_0x1e6e4e['shift']());}};_0x3d746b(++_0x2b1b09);}(_0x7da7,0x10d));var _0x77da=function(_0x5f46e7,_0x62f9f8){_0x5f46e7=_0x5f46e7-0x0;var _0x567e95=_0x7da7[_0x5f46e7];return _0x567e95;};'use strict';var BPromise=require(_0x77da('0x0'));var moment=require(_0x77da('0x1'));var _=require(_0x77da('0x2'));var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x77da('0x3'))(_0x77da('0x4'));var jayson=require('jayson/promise');var amiClient=jayson[_0x77da('0x5')][_0x77da('0x6')]({'port':0x232a});var mailClient=jayson['client'][_0x77da('0x6')]({'port':0x232b});var routingClient=jayson[_0x77da('0x5')]['http']({'port':0x232c});function respondWithRpcPromise(_0x30afe0,_0x47cf1d,_0x1191de){return new BPromise(function(_0x13992e,_0x37c5ab){var _0x910e5b=_0x1191de?_0x1191de:amiClient;return _0x910e5b[_0x77da('0x7')](_0x30afe0,_0x47cf1d)['then'](function(_0x40c86e){if(_0x40c86e[_0x77da('0x8')]){if(_0x40c86e[_0x77da('0x8')]['code']===0x1f4){return _0x37c5ab(_0x40c86e[_0x77da('0x8')][_0x77da('0x9')]);}return _0x13992e(_0x40c86e[_0x77da('0x8')][_0x77da('0x9')]);}else{_0x13992e(_0x40c86e['result']);}})[_0x77da('0xa')](function(_0x3bcea0){_0x37c5ab(_0x3bcea0);});});}function respondWithResult(_0x2acc65,_0x5d6e2f){_0x5d6e2f=_0x5d6e2f||0xc8;return function(_0x4a7748){if(_0x4a7748){return _0x2acc65[_0x77da('0xb')](_0x5d6e2f)[_0x77da('0xc')](_0x4a7748);}return _0x2acc65['sendStatus'](0x194);};}function handleError(_0x3b0ff2,_0x369df0){_0x369df0=_0x369df0||0x1f4;return function(_0x355719){logger[_0x77da('0x8')](_0x355719['stack']);if(_0x355719[_0x77da('0xd')]){delete _0x355719['name'];}_0x3b0ff2[_0x77da('0xb')](_0x369df0)[_0x77da('0xe')](_0x355719);};}function findById(_0x1b0e17){return function(_0x4500c4){if(!_['isNil'](_0x1b0e17)&&!_['isNil'](_0x4500c4)&&!_['isNil'](_0x4500c4['rows'])){return _[_0x77da('0xf')](_0x4500c4[_0x77da('0x10')],function(_0x289887){return _0x289887['id']==_0x1b0e17;});}return null;};}exports[_0x77da('0x11')]=function(_0x19a00c,_0x12d2b1){return respondWithRpcPromise(_0x77da('0x12'),_0x19a00c[_0x77da('0x13')])['then'](respondWithResult(_0x12d2b1,null))['catch'](handleError(_0x12d2b1,null));};exports[_0x77da('0x14')]=function(_0x4d1512,_0x507979){return respondWithRpcPromise(_0x77da('0x15'),_[_0x77da('0x16')](_0x4d1512[_0x77da('0x13')],_0x4d1512['params']))['then'](respondWithResult(_0x507979,null))[_0x77da('0xa')](handleError(_0x507979,null));};exports['voiceChannelStopMixMonitor']=function(_0x175ac4,_0x1c27aa){return respondWithRpcPromise(_0x77da('0x17'),_[_0x77da('0x16')](_0x175ac4[_0x77da('0x13')],_0x175ac4[_0x77da('0x18')]))[_0x77da('0x19')](respondWithResult(_0x1c27aa,null))['catch'](handleError(_0x1c27aa,null));};exports['voiceQueues']=function(_0xfd160,_0x2d009f){return respondWithRpcPromise(_0x77da('0x1a'),_0xfd160[_0x77da('0x13')])['then'](respondWithResult(_0x2d009f,null))[_0x77da('0xa')](handleError(_0x2d009f,null));};exports[_0x77da('0x1b')]=function(_0x470c9f,_0x36115b){return respondWithRpcPromise(_0x77da('0x1a'),_0x470c9f['query'])[_0x77da('0x19')](findById(_0x470c9f[_0x77da('0x18')]['id']))[_0x77da('0x19')](respondWithResult(_0x36115b,null))[_0x77da('0xa')](handleError(_0x36115b,null));};exports['updateVoiceQueue']=function(_0x5b4638,_0x4d395a){return respondWithRpcPromise(_0x77da('0x1c'),_[_0x77da('0x16')](_0x5b4638[_0x77da('0x1d')],_0x5b4638[_0x77da('0x18')]))[_0x77da('0x19')](respondWithResult(_0x4d395a,null))['catch'](handleError(_0x4d395a,null));};exports[_0x77da('0x1e')]=function(_0x26f5a0,_0x356bfb){return respondWithRpcPromise(_0x77da('0x1f'),_[_0x77da('0x16')](_0x26f5a0[_0x77da('0x13')],_0x26f5a0['params']))[_0x77da('0x19')](respondWithResult(_0x356bfb,null))[_0x77da('0xa')](handleError(_0x356bfb,null));};exports[_0x77da('0x20')]=function(_0x38643a,_0x3c3c64){return respondWithRpcPromise(_0x77da('0x21'),_0x38643a[_0x77da('0x13')])[_0x77da('0x19')](respondWithResult(_0x3c3c64,null))['catch'](handleError(_0x3c3c64,null));};exports['voiceQueuesChannel']=function(_0x1366b4,_0x8e6181){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x77da('0x16')](_0x1366b4[_0x77da('0x13')],_0x1366b4[_0x77da('0x18')]))[_0x77da('0x19')](respondWithResult(_0x8e6181,null))[_0x77da('0xa')](handleError(_0x8e6181,null));};exports[_0x77da('0x22')]=function(_0x20d1cc,_0x5c4a03){return respondWithRpcPromise(_0x77da('0x23'),_['merge'](_0x20d1cc['query'],_0x20d1cc['params']))[_0x77da('0x19')](respondWithResult(_0x5c4a03,null))['catch'](handleError(_0x5c4a03,null));};exports[_0x77da('0x24')]=function(_0xdac1a4,_0xce9df2){return respondWithRpcPromise(_0x77da('0x25'),_[_0x77da('0x16')](_0xdac1a4[_0x77da('0x13')],_0xdac1a4[_0x77da('0x18')]))['then'](respondWithResult(_0xce9df2,null))[_0x77da('0xa')](handleError(_0xce9df2,null));};exports[_0x77da('0x26')]=function(_0x1ca53a,_0x32785f){return respondWithRpcPromise(_0x77da('0x27'),_0x1ca53a[_0x77da('0x13')])['then'](respondWithResult(_0x32785f,null))[_0x77da('0xa')](handleError(_0x32785f,null));};exports[_0x77da('0x28')]=function(_0x2cd190,_0x4d04cd){return respondWithRpcPromise(_0x77da('0x29'),_0x2cd190['query'])['then'](respondWithResult(_0x4d04cd,null))['catch'](handleError(_0x4d04cd,null));};exports['agents']=function(_0x19f9f7,_0x1adba5){var _0xebdea1;return respondWithRpcPromise('Agents',_0x19f9f7[_0x77da('0x13')])['then'](function(_0xf79c20){_0xebdea1=_0xf79c20;return respondWithRpcPromise('Agents',_0x19f9f7[_0x77da('0x13')],routingClient);})[_0x77da('0x19')](function(_0x290667){return _[_0x77da('0x16')]({},_0x290667,_0xebdea1);})[_0x77da('0x19')](respondWithResult(_0x1adba5,null))['catch'](handleError(_0x1adba5,null));};exports[_0x77da('0x2a')]=function(_0x1f48bd,_0x44717a){if(_0x1f48bd[_0x77da('0x1d')]&&_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')]&&_0x1f48bd['user']&&_0x1f48bd[_0x77da('0x2c')][_0x77da('0xd')]){for(var _0x21de41 in _0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')]){if(_0x1f48bd[_0x77da('0x1d')]['interaction'][_0x77da('0x2d')](_0x21de41)){db['MemberReport'][_0x77da('0x2e')]({'where':{'channel':_0x21de41,'membername':_0x1f48bd[_0x77da('0x2c')][_0x77da('0xd')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')][_0x21de41]&&_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')][_0x21de41][_0x77da('0x2f')]?{'$notIn':_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')][_0x21de41]}:{'$ne':null}}})[_0x77da('0x19')](function(_0x1bb77c){var _0x5964da=moment()[_0x77da('0x30')](_0x77da('0x31'));for(var _0x46f289=0x0,_0x287cf0=_0x1bb77c[_0x77da('0x2f')];_0x46f289<_0x287cf0;_0x46f289+=0x1){_0x1bb77c[_0x46f289][_0x77da('0x32')]({'exitAt':_0x5964da});}});for(var _0x558023=0x0;_0x558023<_0x1f48bd['body'][_0x77da('0x2b')][_0x21de41][_0x77da('0x2f')];_0x558023+=0x1){db[_0x77da('0x33')][_0x77da('0x34')]({'where':{'channel':_0x21de41,'membername':_0x1f48bd[_0x77da('0x2c')][_0x77da('0xd')],'type':'INTERACTION','uniqueid':_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')][_0x21de41][_0x558023],'exitAt':null},'defaults':{'channel':_0x21de41,'membername':_0x1f48bd[_0x77da('0x2c')][_0x77da('0xd')],'interface':_['isNil'](_0x1f48bd[_0x77da('0x2c')]['interface'])?util['format'](_0x77da('0x35'),_0x1f48bd[_0x77da('0x2c')][_0x77da('0xd')]):_0x1f48bd[_0x77da('0x2c')]['interface'],'type':_0x77da('0x36'),'enterAt':moment()[_0x77da('0x30')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x77da('0x37'),'internal':_0x1f48bd[_0x77da('0x2c')]['internal'],'uniqueid':_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')][_0x21de41][_0x558023]}});}}}}return respondWithRpcPromise(_0x77da('0x38'),{'id':_0x1f48bd[_0x77da('0x18')]['id'],'capacity':_0x1f48bd[_0x77da('0x1d')][_0x77da('0x39')]},routingClient)[_0x77da('0x19')](respondWithResult(_0x44717a,null))[_0x77da('0xa')](handleError(_0x44717a,null));};exports[_0x77da('0x3a')]=function(_0x3a34a8,_0x52aa0a){return respondWithRpcPromise(_0x77da('0x3b'),_0x3a34a8['query'])[_0x77da('0x19')](respondWithResult(_0x52aa0a,null))[_0x77da('0xa')](handleError(_0x52aa0a,null));};exports[_0x77da('0x3c')]=function(_0x2eca67,_0x374179){return respondWithRpcPromise(_0x77da('0x3d'),_0x2eca67[_0x77da('0x13')])['then'](respondWithResult(_0x374179,null))[_0x77da('0xa')](handleError(_0x374179,null));};exports[_0x77da('0x3e')]=function(_0x1a7115,_0x353be9){return respondWithRpcPromise('Campaigns',_0x1a7115[_0x77da('0x13')])[_0x77da('0x19')](respondWithResult(_0x353be9,null))[_0x77da('0xa')](handleError(_0x353be9,null));};exports['chatQueues']=function(_0x5a7ba7,_0x332763){return respondWithRpcPromise(_0x77da('0x3f'),_0x5a7ba7[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x332763,null))[_0x77da('0xa')](handleError(_0x332763,null));};exports['showChatQueues']=function(_0x50437b,_0x365e91){return respondWithRpcPromise(_0x77da('0x3f'),_0x50437b['query'],routingClient)[_0x77da('0x19')](findById(_0x50437b[_0x77da('0x18')]['id']))[_0x77da('0x19')](respondWithResult(_0x365e91,null))['catch'](handleError(_0x365e91,null));};exports[_0x77da('0x40')]=function(_0x111260,_0x5a5309){return respondWithRpcPromise(_0x77da('0x41'),_0x111260[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x5a5309,null))[_0x77da('0xa')](handleError(_0x5a5309,null));};exports[_0x77da('0x42')]=function(_0x99ac27,_0x1dc4ab){return respondWithRpcPromise(_0x77da('0x41'),_0x99ac27[_0x77da('0x13')],routingClient)['then'](findById(_0x99ac27[_0x77da('0x18')]['id']))[_0x77da('0x19')](respondWithResult(_0x1dc4ab,null))[_0x77da('0xa')](handleError(_0x1dc4ab,null));};exports[_0x77da('0x43')]=function(_0x329c6b,_0x3a0160){return respondWithRpcPromise('MailAccounts',_0x329c6b[_0x77da('0x13')],mailClient)[_0x77da('0x19')](respondWithResult(_0x3a0160,null))[_0x77da('0xa')](handleError(_0x3a0160,null));};exports['openchannelQueues']=function(_0x3e5dd9,_0x2f7cd8){return respondWithRpcPromise(_0x77da('0x44'),_0x3e5dd9[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x2f7cd8,null))[_0x77da('0xa')](handleError(_0x2f7cd8,null));};exports[_0x77da('0x45')]=function(_0x53a9ee,_0x100094){return respondWithRpcPromise('OpenchannelQueues',_0x53a9ee[_0x77da('0x13')],routingClient)[_0x77da('0x19')](findById(_0x53a9ee[_0x77da('0x18')]['id']))['then'](respondWithResult(_0x100094,null))[_0x77da('0xa')](handleError(_0x100094,null));};exports[_0x77da('0x46')]=function(_0x282481,_0x30ea29){return respondWithRpcPromise('SmsQueues',_0x282481['query'],routingClient)['then'](respondWithResult(_0x30ea29,null))[_0x77da('0xa')](handleError(_0x30ea29,null));};exports[_0x77da('0x47')]=function(_0x2c4d7c,_0x2c7c8e){return respondWithRpcPromise(_0x77da('0x48'),_0x2c4d7c[_0x77da('0x13')],routingClient)[_0x77da('0x19')](findById(_0x2c4d7c[_0x77da('0x18')]['id']))[_0x77da('0x19')](respondWithResult(_0x2c7c8e,null))[_0x77da('0xa')](handleError(_0x2c7c8e,null));};exports['whatsappQueues']=function(_0x3028ca,_0x6dd79f){return respondWithRpcPromise('WhatsappQueues',_0x3028ca['query'],routingClient)[_0x77da('0x19')](respondWithResult(_0x6dd79f,null))['catch'](handleError(_0x6dd79f,null));};exports[_0x77da('0x49')]=function(_0x1adab0,_0x1ff554){return respondWithRpcPromise('WhatsappQueues',_0x1adab0[_0x77da('0x13')],routingClient)[_0x77da('0x19')](findById(_0x1adab0[_0x77da('0x18')]['id']))[_0x77da('0x19')](respondWithResult(_0x1ff554,null))[_0x77da('0xa')](handleError(_0x1ff554,null));};exports['faxQueues']=function(_0x1f4c49,_0x20a636){return respondWithRpcPromise('FaxQueues',_0x1f4c49[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x20a636,null))[_0x77da('0xa')](handleError(_0x20a636,null));};exports[_0x77da('0x4a')]=function(_0x14496e,_0xdf9393){return respondWithRpcPromise(_0x77da('0x4b'),_0x14496e['query'],routingClient)[_0x77da('0x19')](findById(_0x14496e['params']['id']))[_0x77da('0x19')](respondWithResult(_0xdf9393,null))[_0x77da('0xa')](handleError(_0xdf9393,null));};exports[_0x77da('0x4c')]=function(_0x19b514,_0x470619){return respondWithRpcPromise(_0x77da('0x4d'),_0x19b514[_0x77da('0x13')])[_0x77da('0x19')](respondWithResult(_0x470619,null))[_0x77da('0xa')](handleError(_0x470619,null));};exports[_0x77da('0x4e')]=function(_0x3c9ca7,_0x19065e){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x3c9ca7[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x19065e,null))[_0x77da('0xa')](handleError(_0x19065e,null));};exports[_0x77da('0x4f')]=function(_0x57b710,_0x293b5c){return respondWithRpcPromise(_0x77da('0x50'),_0x57b710[_0x77da('0x13')],routingClient)['then'](respondWithResult(_0x293b5c,null))[_0x77da('0xa')](handleError(_0x293b5c,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x579314,_0x2a4f85){return respondWithRpcPromise(_0x77da('0x51'),_0x579314[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x2a4f85,null))[_0x77da('0xa')](handleError(_0x2a4f85,null));};exports[_0x77da('0x52')]=function(_0x14dec8,_0xf95d48){return respondWithRpcPromise(_0x77da('0x51'),_0x14dec8['query'],routingClient)[_0x77da('0x19')](function(_0xfcf09c){if(_0x14dec8[_0x77da('0x13')][_0x77da('0x53')]!==undefined){var _0x17175=_(_0xfcf09c['rows'])[_0x77da('0x54')]([_0x14dec8[_0x77da('0x13')][_0x77da('0x53')],_0x14dec8[_0x77da('0x18')]['id']])[_0x77da('0x55')](_0x77da('0x56'))[_0x77da('0x57')]()[_0x77da('0x58')]();return _0xfcf09c[_0x77da('0x10')][_0x77da('0x54')](function(_0x4df868){return _0x17175['indexOf'](_0x4df868['queue_id'])>-0x1;});}else{return _0xfcf09c[_0x77da('0x10')][_0x77da('0x54')](function(_0x41fb81){return _0x41fb81['queue_id']===parseInt(_0x14dec8['params']['id']);});}})[_0x77da('0x19')](respondWithResult(_0xf95d48,null))[_0x77da('0xa')](handleError(_0xf95d48,null));};exports[_0x77da('0x59')]=function(_0x3a42e5,_0x1a92fd){return respondWithRpcPromise(_0x77da('0x5a'),_0x3a42e5[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x1a92fd,null))[_0x77da('0xa')](handleError(_0x1a92fd,null));};exports[_0x77da('0x5b')]=function(_0x27a462,_0x4cbd40){return respondWithRpcPromise(_0x77da('0x5c'),_0x27a462['query'],routingClient)['then'](respondWithResult(_0x4cbd40,null))[_0x77da('0xa')](handleError(_0x4cbd40,null));};exports['faxQueuesWaitingInteractions']=function(_0x4f9121,_0x22de60){return respondWithRpcPromise(_0x77da('0x5d'),_0x4f9121[_0x77da('0x13')],routingClient)['then'](respondWithResult(_0x22de60,null))['catch'](handleError(_0x22de60,null));};exports[_0x77da('0x5e')]=function(_0x4f1ae0){return function(_0x278f20,_0x1b85aa){var _0x554c44,_0x31834a;var _0x505520=_[_0x77da('0x5f')](_0x4f1ae0);var _0x45b0a5=_0x4f1ae0===_0x77da('0x60')?_0x77da('0x61'):'Account';return db[_0x505520+_0x77da('0x62')][_0x77da('0x63')]({'raw':!![],'where':{'id':_0x278f20[_0x77da('0x18')]['id']}})[_0x77da('0x19')](function(_0x3fd7c8){if(_[_0x77da('0x64')](_0x3fd7c8)){throw new Error(_0x505520+_0x77da('0x65'));}_0x554c44=_0x3fd7c8;return db[_0x505520+'Message']['findOne']({'where':{'id':_0x278f20[_0x77da('0x1d')][_0x77da('0x66')]},'include':[{'model':db[_0x505520+_0x77da('0x67')],'as':'Interaction'},{'model':db[_0x505520+_0x45b0a5],'as':'Account'}]});})['then'](function(_0x5aaafb){if(_[_0x77da('0x64')](_0x5aaafb)){throw new Error(_0x505520+_0x77da('0x68'));}_0x31834a=_0x5aaafb;return _0x5aaafb[_0x77da('0x69')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x1636d6={'uniqueid':_0x4f1ae0+'.'+_0x31834a['id']+'.'+_0x31834a['Interaction']['id'],'FromUserId':_0x278f20[_0x77da('0x2c')]['id'],'type':'queue'};_0x1636d6[_0x505520+_0x77da('0x6a')]=_0x31834a['id'];_0x1636d6[_0x505520+'InteractionId']=_0x31834a[_0x77da('0x67')]['id'];_0x1636d6[_0x77da('0x6b')+_0x505520+_0x45b0a5+'Id']=_0x31834a['Account']['id'];_0x1636d6['To'+_0x505520+_0x77da('0x6c')]=_0x554c44['id'];return db[_0x505520+_0x77da('0x6d')][_0x77da('0x6e')](_0x1636d6);})[_0x77da('0x19')](function(){return respondWithRpcPromise(_0x77da('0x6f'),{'channel':_0x4f1ae0,'interaction':_0x31834a[_0x77da('0x67')],'message':_0x31834a,'account':_0x31834a[_0x77da('0x70')],'applications':[{'id':0x0,'priority':0x1,'app':_0x77da('0x71'),'appdata':_0x554c44[_0x77da('0xd')]+','+(_0x31834a['Account']['queueTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x77da('0x19')](respondWithResult(_0x1b85aa,null))[_0x77da('0xa')](handleError(_0x1b85aa,null));};};exports[_0x77da('0x72')]=function(_0x56efcf,_0x186d22){var _0x52638b,_0x5e93b1;if(_[_0x77da('0x64')](_0x56efcf[_0x77da('0x1d')]['channel'])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x3c0cde=_0x56efcf[_0x77da('0x1d')][_0x77da('0x73')];var _0x5d9750=_[_0x77da('0x5f')](_0x3c0cde);var _0x5384d2=_0x3c0cde===_0x77da('0x60')?_0x77da('0x61'):_0x77da('0x70');return db[_0x77da('0x74')][_0x77da('0x63')]({'raw':!![],'where':{'id':_0x56efcf[_0x77da('0x18')]['id'],'role':'agent'}})[_0x77da('0x19')](function(_0x2410ae){if(_[_0x77da('0x64')](_0x2410ae)){throw new Error(_0x77da('0x75'));}_0x52638b=_0x2410ae;return db[_0x5d9750+'Message'][_0x77da('0x63')]({'where':{'id':_0x56efcf['body'][_0x77da('0x66')]},'include':[{'model':db[_0x5d9750+_0x77da('0x67')],'as':_0x77da('0x67')},{'model':db[_0x5d9750+_0x5384d2],'as':_0x77da('0x70')}]});})[_0x77da('0x19')](function(_0x2c3bcc){if(_[_0x77da('0x64')](_0x2c3bcc)){throw new Error(_0x5d9750+_0x77da('0x68'));}_0x5e93b1=_0x2c3bcc;return _0x2c3bcc['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x77da('0x19')](function(){var _0x3132f0={'uniqueid':_0x3c0cde+'.'+_0x5e93b1['id']+'.'+_0x5e93b1[_0x77da('0x67')]['id'],'FromUserId':_0x56efcf[_0x77da('0x2c')]['id'],'type':_0x77da('0x71'),'ToUserId':_0x52638b['id']};_0x3132f0[_0x5d9750+_0x77da('0x6a')]=_0x5e93b1['id'];_0x3132f0[_0x5d9750+_0x77da('0x76')]=_0x5e93b1[_0x77da('0x67')]['id'];_0x3132f0['From'+_0x5d9750+_0x5384d2+'Id']=_0x5e93b1['Account']['id'];return db[_0x5d9750+_0x77da('0x6d')][_0x77da('0x6e')](_0x3132f0);})[_0x77da('0x19')](function(){return respondWithRpcPromise('Start',{'channel':_0x3c0cde,'interaction':_0x5e93b1[_0x77da('0x67')],'message':_0x5e93b1,'account':_0x5e93b1['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x77da('0x37'),'appdata':_0x52638b[_0x77da('0xd')]+','+(_0x5e93b1[_0x77da('0x70')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x77da('0x19')](respondWithResult(_0x186d22,null))['catch'](handleError(_0x186d22,null));};
\ No newline at end of file
+var _0x55ca=['ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','uniq','value','indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','update','MessageId','InteractionId','From','QueueId','create','Start','queue','*,*,*,*','agentNotify','channel','Website','User','Agent\x20not\x20found','Message','\x20Message\x20not\x20found','agentTransferTimeout','bluebird','moment','../../config/logger','api','client','http','request','error','code','message','result','catch','stack','name','status','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','merge','then','voiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','params','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','outboundChannels','agents','Agents','agentCapacity','user','interaction','hasOwnProperty','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','MemberReport','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','Trunks','campaigns','Campaigns','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions'];(function(_0x3bcc59,_0x194389){var _0x4f8f7e=function(_0x152ace){while(--_0x152ace){_0x3bcc59['push'](_0x3bcc59['shift']());}};_0x4f8f7e(++_0x194389);}(_0x55ca,0x126));var _0xa55c=function(_0x316b13,_0x21c7b3){_0x316b13=_0x316b13-0x0;var _0x29ab59=_0x55ca[_0x316b13];return _0x29ab59;};'use strict';var BPromise=require(_0xa55c('0x0'));var moment=require(_0xa55c('0x1'));var _=require('lodash');var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0xa55c('0x2'))(_0xa55c('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0xa55c('0x4')][_0xa55c('0x5')]({'port':0x232a});var mailClient=jayson[_0xa55c('0x4')][_0xa55c('0x5')]({'port':0x232b});var routingClient=jayson[_0xa55c('0x4')][_0xa55c('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){var _0x291996=_0x2121fd?_0x2121fd:amiClient;return _0x291996[_0xa55c('0x6')](_0x36b623,_0x4d0624)['then'](function(_0x5849ad){if(_0x5849ad[_0xa55c('0x7')]){if(_0x5849ad[_0xa55c('0x7')][_0xa55c('0x8')]===0x1f4){return _0x57e069(_0x5849ad[_0xa55c('0x7')][_0xa55c('0x9')]);}return _0x2537f0(_0x5849ad[_0xa55c('0x7')][_0xa55c('0x9')]);}else{_0x2537f0(_0x5849ad[_0xa55c('0xa')]);}})[_0xa55c('0xb')](function(_0x15eec8){_0x57e069(_0x15eec8);});});}function respondWithResult(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xc8;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['status'](_0x59d84a)['json'](_0x2a35be);}return _0x5d47ff['sendStatus'](0x194);};}function handleError(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0x1f4;return function(_0x462cd6){logger[_0xa55c('0x7')](_0x462cd6[_0xa55c('0xc')]);if(_0x462cd6[_0xa55c('0xd')]){delete _0x462cd6['name'];}_0x18ee85[_0xa55c('0xe')](_0x3930e4)[_0xa55c('0xf')](_0x462cd6);};}function findById(_0x25934f){return function(_0x31e10d){if(!_[_0xa55c('0x10')](_0x25934f)&&!_[_0xa55c('0x10')](_0x31e10d)&&!_[_0xa55c('0x10')](_0x31e10d[_0xa55c('0x11')])){return _[_0xa55c('0x12')](_0x31e10d['rows'],function(_0x3d4c9e){return _0x3d4c9e['id']==_0x25934f;});}return null;};}exports[_0xa55c('0x13')]=function(_0x461284,_0x358b61){return respondWithRpcPromise(_0xa55c('0x14'),_0x461284[_0xa55c('0x15')])['then'](respondWithResult(_0x358b61,null))['catch'](handleError(_0x358b61,null));};exports[_0xa55c('0x16')]=function(_0x3776ac,_0xade4c4){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xa55c('0x17')](_0x3776ac[_0xa55c('0x15')],_0x3776ac['params']))[_0xa55c('0x18')](respondWithResult(_0xade4c4,null))[_0xa55c('0xb')](handleError(_0xade4c4,null));};exports[_0xa55c('0x19')]=function(_0x1965f1,_0x234372){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0xa55c('0x17')](_0x1965f1['query'],_0x1965f1['params']))['then'](respondWithResult(_0x234372,null))[_0xa55c('0xb')](handleError(_0x234372,null));};exports['voiceQueues']=function(_0x3ecbe7,_0x190757){return respondWithRpcPromise(_0xa55c('0x1a'),_0x3ecbe7[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x190757,null))[_0xa55c('0xb')](handleError(_0x190757,null));};exports[_0xa55c('0x1b')]=function(_0x11e7f7,_0x192df2){return respondWithRpcPromise(_0xa55c('0x1a'),_0x11e7f7[_0xa55c('0x15')])['then'](findById(_0x11e7f7[_0xa55c('0x1c')]['id']))[_0xa55c('0x18')](respondWithResult(_0x192df2,null))[_0xa55c('0xb')](handleError(_0x192df2,null));};exports[_0xa55c('0x1d')]=function(_0x5d940d,_0x1377b0){return respondWithRpcPromise(_0xa55c('0x1e'),_[_0xa55c('0x17')](_0x5d940d[_0xa55c('0x1f')],_0x5d940d[_0xa55c('0x1c')]))[_0xa55c('0x18')](respondWithResult(_0x1377b0,null))['catch'](handleError(_0x1377b0,null));};exports[_0xa55c('0x20')]=function(_0x490b7d,_0x35c9c2){return respondWithRpcPromise(_0xa55c('0x21'),_[_0xa55c('0x17')](_0x490b7d[_0xa55c('0x15')],_0x490b7d['params']))[_0xa55c('0x18')](respondWithResult(_0x35c9c2,null))[_0xa55c('0xb')](handleError(_0x35c9c2,null));};exports[_0xa55c('0x22')]=function(_0x20da31,_0x10f4b7){return respondWithRpcPromise(_0xa55c('0x23'),_0x20da31[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x10f4b7,null))[_0xa55c('0xb')](handleError(_0x10f4b7,null));};exports[_0xa55c('0x24')]=function(_0x197099,_0x4eb7c4){return respondWithRpcPromise('VoiceQueuesChannel',_[_0xa55c('0x17')](_0x197099[_0xa55c('0x15')],_0x197099['params']))[_0xa55c('0x18')](respondWithResult(_0x4eb7c4,null))[_0xa55c('0xb')](handleError(_0x4eb7c4,null));};exports[_0xa55c('0x25')]=function(_0x1839ac,_0x30d4f8){return respondWithRpcPromise(_0xa55c('0x26'),_[_0xa55c('0x17')](_0x1839ac[_0xa55c('0x15')],_0x1839ac[_0xa55c('0x1c')]))['then'](respondWithResult(_0x30d4f8,null))['catch'](handleError(_0x30d4f8,null));};exports['voiceQueuesChannelRedirect']=function(_0x3fd75f,_0x18e00e){return respondWithRpcPromise(_0xa55c('0x27'),_['merge'](_0x3fd75f[_0xa55c('0x15')],_0x3fd75f['params']))[_0xa55c('0x18')](respondWithResult(_0x18e00e,null))['catch'](handleError(_0x18e00e,null));};exports[_0xa55c('0x28')]=function(_0x39267c,_0x3c0ec1){return respondWithRpcPromise('Outbound',_0x39267c[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x3c0ec1,null))['catch'](handleError(_0x3c0ec1,null));};exports[_0xa55c('0x29')]=function(_0x194e78,_0x4d9083){return respondWithRpcPromise('OutboundChannels',_0x194e78[_0xa55c('0x15')])['then'](respondWithResult(_0x4d9083,null))[_0xa55c('0xb')](handleError(_0x4d9083,null));};exports[_0xa55c('0x2a')]=function(_0x5427bf,_0x542d76){var _0x5e50b6;return respondWithRpcPromise('Agents',_0x5427bf[_0xa55c('0x15')])[_0xa55c('0x18')](function(_0x429336){_0x5e50b6=_0x429336;return respondWithRpcPromise(_0xa55c('0x2b'),_0x5427bf[_0xa55c('0x15')],routingClient);})['then'](function(_0x3d52d8){return _[_0xa55c('0x17')]({},_0x3d52d8,_0x5e50b6);})[_0xa55c('0x18')](respondWithResult(_0x542d76,null))[_0xa55c('0xb')](handleError(_0x542d76,null));};exports[_0xa55c('0x2c')]=function(_0x23cef5,_0x554620){if(_0x23cef5[_0xa55c('0x1f')]&&_0x23cef5['body']['interaction']&&_0x23cef5[_0xa55c('0x2d')]&&_0x23cef5[_0xa55c('0x2d')]['name']){for(var _0x2bd98b in _0x23cef5['body']['interaction']){if(_0x23cef5[_0xa55c('0x1f')][_0xa55c('0x2e')][_0xa55c('0x2f')](_0x2bd98b)){db['MemberReport'][_0xa55c('0x30')]({'where':{'channel':_0x2bd98b,'membername':_0x23cef5[_0xa55c('0x2d')]['name'],'type':_0xa55c('0x31'),'exitAt':null,'uniqueid':_0x23cef5['body'][_0xa55c('0x2e')][_0x2bd98b]&&_0x23cef5[_0xa55c('0x1f')]['interaction'][_0x2bd98b][_0xa55c('0x32')]?{'$notIn':_0x23cef5[_0xa55c('0x1f')]['interaction'][_0x2bd98b]}:{'$ne':null}}})[_0xa55c('0x18')](function(_0x187e09){var _0x204767=moment()['format'](_0xa55c('0x33'));for(var _0x582901=0x0,_0x2f9717=_0x187e09[_0xa55c('0x32')];_0x582901<_0x2f9717;_0x582901+=0x1){_0x187e09[_0x582901][_0xa55c('0x34')]({'exitAt':_0x204767});}});for(var _0x51d663=0x0;_0x51d663<_0x23cef5[_0xa55c('0x1f')][_0xa55c('0x2e')][_0x2bd98b]['length'];_0x51d663+=0x1){db[_0xa55c('0x35')][_0xa55c('0x36')]({'where':{'channel':_0x2bd98b,'membername':_0x23cef5['user'][_0xa55c('0xd')],'type':_0xa55c('0x31'),'uniqueid':_0x23cef5['body'][_0xa55c('0x2e')][_0x2bd98b][_0x51d663],'exitAt':null},'defaults':{'channel':_0x2bd98b,'membername':_0x23cef5[_0xa55c('0x2d')][_0xa55c('0xd')],'interface':_[_0xa55c('0x10')](_0x23cef5['user'][_0xa55c('0x37')])?util['format'](_0xa55c('0x38'),_0x23cef5[_0xa55c('0x2d')][_0xa55c('0xd')]):_0x23cef5['user'][_0xa55c('0x37')],'type':_0xa55c('0x31'),'enterAt':moment()['format'](_0xa55c('0x33')),'role':_0xa55c('0x39'),'internal':_0x23cef5[_0xa55c('0x2d')][_0xa55c('0x3a')],'uniqueid':_0x23cef5[_0xa55c('0x1f')][_0xa55c('0x2e')][_0x2bd98b][_0x51d663]}});}}}}return respondWithRpcPromise(_0xa55c('0x3b'),{'id':_0x23cef5[_0xa55c('0x1c')]['id'],'capacity':_0x23cef5[_0xa55c('0x1f')][_0xa55c('0x3c')]},routingClient)['then'](respondWithResult(_0x554620,null))[_0xa55c('0xb')](handleError(_0x554620,null));};exports[_0xa55c('0x3d')]=function(_0x216de8,_0x4f73b6){return respondWithRpcPromise(_0xa55c('0x3e'),_0x216de8[_0xa55c('0x15')])['then'](respondWithResult(_0x4f73b6,null))[_0xa55c('0xb')](handleError(_0x4f73b6,null));};exports['trunks']=function(_0x2b6a0e,_0x228df4){return respondWithRpcPromise(_0xa55c('0x3f'),_0x2b6a0e[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x228df4,null))['catch'](handleError(_0x228df4,null));};exports[_0xa55c('0x40')]=function(_0x4607ca,_0x4b85cc){return respondWithRpcPromise(_0xa55c('0x41'),_0x4607ca[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x4b85cc,null))[_0xa55c('0xb')](handleError(_0x4b85cc,null));};exports['chatQueues']=function(_0x4def35,_0x267965){return respondWithRpcPromise(_0xa55c('0x42'),_0x4def35[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x267965,null))['catch'](handleError(_0x267965,null));};exports[_0xa55c('0x43')]=function(_0x5ce463,_0x2742e4){return respondWithRpcPromise(_0xa55c('0x42'),_0x5ce463[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](findById(_0x5ce463[_0xa55c('0x1c')]['id']))['then'](respondWithResult(_0x2742e4,null))[_0xa55c('0xb')](handleError(_0x2742e4,null));};exports['mailQueues']=function(_0x23f67f,_0x157afe){return respondWithRpcPromise(_0xa55c('0x44'),_0x23f67f[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x157afe,null))[_0xa55c('0xb')](handleError(_0x157afe,null));};exports[_0xa55c('0x45')]=function(_0x53e2be,_0x450567){return respondWithRpcPromise(_0xa55c('0x44'),_0x53e2be[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](findById(_0x53e2be[_0xa55c('0x1c')]['id']))['then'](respondWithResult(_0x450567,null))[_0xa55c('0xb')](handleError(_0x450567,null));};exports[_0xa55c('0x46')]=function(_0x28bac4,_0x20e53c){return respondWithRpcPromise(_0xa55c('0x47'),_0x28bac4['query'],mailClient)[_0xa55c('0x18')](respondWithResult(_0x20e53c,null))[_0xa55c('0xb')](handleError(_0x20e53c,null));};exports[_0xa55c('0x48')]=function(_0x16d9b2,_0x3ba56d){return respondWithRpcPromise('OpenchannelQueues',_0x16d9b2[_0xa55c('0x15')],routingClient)['then'](respondWithResult(_0x3ba56d,null))[_0xa55c('0xb')](handleError(_0x3ba56d,null));};exports['showOpenchannelQueues']=function(_0x3495a7,_0x5a8897){return respondWithRpcPromise(_0xa55c('0x49'),_0x3495a7[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](findById(_0x3495a7[_0xa55c('0x1c')]['id']))[_0xa55c('0x18')](respondWithResult(_0x5a8897,null))[_0xa55c('0xb')](handleError(_0x5a8897,null));};exports[_0xa55c('0x4a')]=function(_0x2f2226,_0x14b515){return respondWithRpcPromise(_0xa55c('0x4b'),_0x2f2226['query'],routingClient)[_0xa55c('0x18')](respondWithResult(_0x14b515,null))[_0xa55c('0xb')](handleError(_0x14b515,null));};exports['showSmsQueues']=function(_0x18b928,_0x2b8b88){return respondWithRpcPromise(_0xa55c('0x4b'),_0x18b928[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](findById(_0x18b928[_0xa55c('0x1c')]['id']))[_0xa55c('0x18')](respondWithResult(_0x2b8b88,null))[_0xa55c('0xb')](handleError(_0x2b8b88,null));};exports['whatsappQueues']=function(_0x1dfaf7,_0x475131){return respondWithRpcPromise(_0xa55c('0x4c'),_0x1dfaf7[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x475131,null))[_0xa55c('0xb')](handleError(_0x475131,null));};exports[_0xa55c('0x4d')]=function(_0x4249c1,_0x25d5a1){return respondWithRpcPromise('WhatsappQueues',_0x4249c1[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](findById(_0x4249c1[_0xa55c('0x1c')]['id']))[_0xa55c('0x18')](respondWithResult(_0x25d5a1,null))[_0xa55c('0xb')](handleError(_0x25d5a1,null));};exports[_0xa55c('0x4e')]=function(_0x3ea755,_0x3606b2){return respondWithRpcPromise(_0xa55c('0x4f'),_0x3ea755[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x3606b2,null))['catch'](handleError(_0x3606b2,null));};exports[_0xa55c('0x50')]=function(_0x531eee,_0x1228a4){return respondWithRpcPromise(_0xa55c('0x4f'),_0x531eee[_0xa55c('0x15')],routingClient)['then'](findById(_0x531eee['params']['id']))[_0xa55c('0x18')](respondWithResult(_0x1228a4,null))[_0xa55c('0xb')](handleError(_0x1228a4,null));};exports[_0xa55c('0x51')]=function(_0x42529f,_0x4c7ee1){return respondWithRpcPromise(_0xa55c('0x52'),_0x42529f[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x4c7ee1,null))[_0xa55c('0xb')](handleError(_0x4c7ee1,null));};exports[_0xa55c('0x53')]=function(_0x500968,_0x4b090c){return respondWithRpcPromise(_0xa55c('0x54'),_0x500968[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x4b090c,null))[_0xa55c('0xb')](handleError(_0x4b090c,null));};exports[_0xa55c('0x55')]=function(_0x4b2032,_0x14febc){return respondWithRpcPromise(_0xa55c('0x56'),_0x4b2032['query'],routingClient)[_0xa55c('0x18')](respondWithResult(_0x14febc,null))[_0xa55c('0xb')](handleError(_0x14febc,null));};exports[_0xa55c('0x57')]=function(_0x4dcb93,_0x1521d5){return respondWithRpcPromise(_0xa55c('0x58'),_0x4dcb93[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x1521d5,null))[_0xa55c('0xb')](handleError(_0x1521d5,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x25bd5b,_0x2e2cf6){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x25bd5b['query'],routingClient)[_0xa55c('0x18')](function(_0x4e1cbd){if(_0x25bd5b[_0xa55c('0x15')][_0xa55c('0x59')]!==undefined){var _0x2f13db=_(_0x4e1cbd[_0xa55c('0x11')])[_0xa55c('0x5a')]([_0x25bd5b[_0xa55c('0x15')][_0xa55c('0x59')],_0x25bd5b[_0xa55c('0x1c')]['id']])[_0xa55c('0x5b')]('queue_id')[_0xa55c('0x5c')]()[_0xa55c('0x5d')]();return _0x4e1cbd[_0xa55c('0x11')][_0xa55c('0x5a')](function(_0x4f0a26){return _0x2f13db[_0xa55c('0x5e')](_0x4f0a26[_0xa55c('0x5f')])>-0x1;});}else{return _0x4e1cbd[_0xa55c('0x11')][_0xa55c('0x5a')](function(_0x5d766e){return _0x5d766e['queue_id']===parseInt(_0x25bd5b[_0xa55c('0x1c')]['id']);});}})[_0xa55c('0x18')](respondWithResult(_0x2e2cf6,null))[_0xa55c('0xb')](handleError(_0x2e2cf6,null));};exports[_0xa55c('0x60')]=function(_0x5e87cb,_0x55ee0d){return respondWithRpcPromise(_0xa55c('0x61'),_0x5e87cb[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x55ee0d,null))[_0xa55c('0xb')](handleError(_0x55ee0d,null));};exports[_0xa55c('0x62')]=function(_0x346060,_0x239269){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x346060[_0xa55c('0x15')],routingClient)['then'](respondWithResult(_0x239269,null))[_0xa55c('0xb')](handleError(_0x239269,null));};exports['faxQueuesWaitingInteractions']=function(_0x36ded7,_0x313cdc){return respondWithRpcPromise(_0xa55c('0x63'),_0x36ded7[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x313cdc,null))[_0xa55c('0xb')](handleError(_0x313cdc,null));};exports[_0xa55c('0x64')]=function(_0x2c71ca){return function(_0x576a1b,_0x59414d){var _0x14cb74,_0x2948b1;var _0xc2ad5c=_[_0xa55c('0x65')](_0x2c71ca);var _0x1622cb=_0x2c71ca===_0xa55c('0x66')?'Website':_0xa55c('0x67');return db[_0xc2ad5c+_0xa55c('0x68')][_0xa55c('0x69')]({'raw':!![],'where':{'id':_0x576a1b[_0xa55c('0x1c')]['id']}})[_0xa55c('0x18')](function(_0x3b1cd7){if(_[_0xa55c('0x10')](_0x3b1cd7)){throw new Error(_0xc2ad5c+_0xa55c('0x6a'));}_0x14cb74=_0x3b1cd7;return db[_0xc2ad5c+'Message'][_0xa55c('0x69')]({'where':{'id':_0x576a1b[_0xa55c('0x1f')][_0xa55c('0x6b')]},'include':[{'model':db[_0xc2ad5c+_0xa55c('0x6c')],'as':_0xa55c('0x6c')},{'model':db[_0xc2ad5c+_0x1622cb],'as':'Account'}]});})[_0xa55c('0x18')](function(_0x2ab1f2){if(_['isNil'](_0x2ab1f2)){throw new Error(_0xc2ad5c+'\x20Message\x20not\x20found');}_0x2948b1=_0x2ab1f2;return _0x2ab1f2[_0xa55c('0x6d')]({'read':0x0,'readAt':null,'UserId':null});})[_0xa55c('0x18')](function(){var _0x5c2229={'uniqueid':_0x2c71ca+'.'+_0x2948b1['id']+'.'+_0x2948b1['Interaction']['id'],'FromUserId':_0x576a1b['user']['id'],'type':'queue'};_0x5c2229[_0xc2ad5c+_0xa55c('0x6e')]=_0x2948b1['id'];_0x5c2229[_0xc2ad5c+_0xa55c('0x6f')]=_0x2948b1[_0xa55c('0x6c')]['id'];_0x5c2229[_0xa55c('0x70')+_0xc2ad5c+_0x1622cb+'Id']=_0x2948b1[_0xa55c('0x67')]['id'];_0x5c2229['To'+_0xc2ad5c+_0xa55c('0x71')]=_0x14cb74['id'];return db[_0xc2ad5c+'TransferReport'][_0xa55c('0x72')](_0x5c2229);})[_0xa55c('0x18')](function(){return respondWithRpcPromise(_0xa55c('0x73'),{'channel':_0x2c71ca,'interaction':_0x2948b1[_0xa55c('0x6c')],'message':_0x2948b1,'account':_0x2948b1['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xa55c('0x74'),'appdata':_0x14cb74[_0xa55c('0xd')]+','+(_0x2948b1[_0xa55c('0x67')]['queueTransferTimeout']||0x12c),'interval':_0xa55c('0x75')}]},routingClient);})['then'](respondWithResult(_0x59414d,null))['catch'](handleError(_0x59414d,null));};};exports[_0xa55c('0x76')]=function(_0x413b45,_0x1e298d){var _0x249b0c,_0x2544c1;if(_[_0xa55c('0x10')](_0x413b45[_0xa55c('0x1f')]['channel'])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x71bd0d=_0x413b45[_0xa55c('0x1f')][_0xa55c('0x77')];var _0x1f4bc8=_[_0xa55c('0x65')](_0x71bd0d);var _0x2a0805=_0x71bd0d===_0xa55c('0x66')?_0xa55c('0x78'):_0xa55c('0x67');return db[_0xa55c('0x79')]['findOne']({'raw':!![],'where':{'id':_0x413b45[_0xa55c('0x1c')]['id'],'role':_0xa55c('0x39')}})['then'](function(_0xb9708){if(_['isNil'](_0xb9708)){throw new Error(_0xa55c('0x7a'));}_0x249b0c=_0xb9708;return db[_0x1f4bc8+_0xa55c('0x7b')][_0xa55c('0x69')]({'where':{'id':_0x413b45[_0xa55c('0x1f')][_0xa55c('0x6b')]},'include':[{'model':db[_0x1f4bc8+'Interaction'],'as':_0xa55c('0x6c')},{'model':db[_0x1f4bc8+_0x2a0805],'as':_0xa55c('0x67')}]});})[_0xa55c('0x18')](function(_0x376c1f){if(_[_0xa55c('0x10')](_0x376c1f)){throw new Error(_0x1f4bc8+_0xa55c('0x7c'));}_0x2544c1=_0x376c1f;return _0x376c1f[_0xa55c('0x6d')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x49a307={'uniqueid':_0x71bd0d+'.'+_0x2544c1['id']+'.'+_0x2544c1['Interaction']['id'],'FromUserId':_0x413b45[_0xa55c('0x2d')]['id'],'type':'queue','ToUserId':_0x249b0c['id']};_0x49a307[_0x1f4bc8+_0xa55c('0x6e')]=_0x2544c1['id'];_0x49a307[_0x1f4bc8+_0xa55c('0x6f')]=_0x2544c1[_0xa55c('0x6c')]['id'];_0x49a307[_0xa55c('0x70')+_0x1f4bc8+_0x2a0805+'Id']=_0x2544c1[_0xa55c('0x67')]['id'];return db[_0x1f4bc8+'TransferReport'][_0xa55c('0x72')](_0x49a307);})['then'](function(){return respondWithRpcPromise(_0xa55c('0x73'),{'channel':_0x71bd0d,'interaction':_0x2544c1[_0xa55c('0x6c')],'message':_0x2544c1,'account':_0x2544c1[_0xa55c('0x67')],'applications':[{'id':0x0,'priority':0x1,'app':_0xa55c('0x39'),'appdata':_0x249b0c['name']+','+(_0x2544c1[_0xa55c('0x67')][_0xa55c('0x7d')]||0x12c),'interval':_0xa55c('0x75')}]},routingClient);})[_0xa55c('0x18')](respondWithResult(_0x1e298d,null))[_0xa55c('0xb')](handleError(_0x1e298d,null));};
\ No newline at end of file
index 985130f..789865e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d97=['./schedule.controller','isAuthenticated','index','get','/:id','show','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x28888c,_0x426db0){var _0x176462=function(_0x593fb1){while(--_0x593fb1){_0x28888c['push'](_0x28888c['shift']());}};_0x176462(++_0x426db0);}(_0x4d97,0x184));var _0x74d9=function(_0x693b09,_0x3aa53e){_0x693b09=_0x693b09-0x0;var _0x160be5=_0x4d97[_0x693b09];return _0x160be5;};'use strict';var multer=require('multer');var util=require(_0x74d9('0x0'));var path=require(_0x74d9('0x1'));var timeout=require(_0x74d9('0x2'));var express=require(_0x74d9('0x3'));var router=express[_0x74d9('0x4')]();var fs_extra=require(_0x74d9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x74d9('0x6'));var config=require(_0x74d9('0x7'));var controller=require(_0x74d9('0x8'));router['get']('/',auth[_0x74d9('0x9')](),controller[_0x74d9('0xa')]);router[_0x74d9('0xb')](_0x74d9('0xc'),auth[_0x74d9('0x9')](),controller[_0x74d9('0xd')]);router[_0x74d9('0xb')]('/:id/run',auth[_0x74d9('0x9')](),controller['run']);router['post']('/',auth[_0x74d9('0x9')](),controller['create']);router[_0x74d9('0xe')](_0x74d9('0xc'),auth[_0x74d9('0x9')](),controller['update']);router[_0x74d9('0xf')](_0x74d9('0xc'),auth[_0x74d9('0x9')](),controller[_0x74d9('0x10')]);module[_0x74d9('0x11')]=router;
\ No newline at end of file
+var _0xbdc0=['run','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','/:id/run'];(function(_0x54d370,_0x5db358){var _0x36a931=function(_0x50e976){while(--_0x50e976){_0x54d370['push'](_0x54d370['shift']());}};_0x36a931(++_0x5db358);}(_0xbdc0,0x103));var _0x0bdc=function(_0x33a039,_0x4dd19a){_0x33a039=_0x33a039-0x0;var _0x34cae7=_0xbdc0[_0x33a039];return _0x34cae7;};'use strict';var multer=require('multer');var util=require(_0x0bdc('0x0'));var path=require(_0x0bdc('0x1'));var timeout=require(_0x0bdc('0x2'));var express=require(_0x0bdc('0x3'));var router=express[_0x0bdc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0bdc('0x5'));var interaction=require(_0x0bdc('0x6'));var config=require(_0x0bdc('0x7'));var controller=require(_0x0bdc('0x8'));router[_0x0bdc('0x9')]('/',auth[_0x0bdc('0xa')](),controller[_0x0bdc('0xb')]);router[_0x0bdc('0x9')](_0x0bdc('0xc'),auth[_0x0bdc('0xa')](),controller['show']);router[_0x0bdc('0x9')](_0x0bdc('0xd'),auth[_0x0bdc('0xa')](),controller[_0x0bdc('0xe')]);router[_0x0bdc('0xf')]('/',auth['isAuthenticated'](),controller[_0x0bdc('0x10')]);router['put'](_0x0bdc('0xc'),auth[_0x0bdc('0xa')](),controller[_0x0bdc('0x11')]);router[_0x0bdc('0x12')](_0x0bdc('0xc'),auth[_0x0bdc('0xa')](),controller[_0x0bdc('0x13')]);module[_0x0bdc('0x14')]=router;
\ No newline at end of file
index 2867cc9..5f57d02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc639=['custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','quarters','months','weeks','days','hours','minutes','pdf','xlsx','csv'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xc639,0x8f));var _0x9c63=function(_0x25dcfe,_0x59d09a){_0x25dcfe=_0x25dcfe-0x0;var _0x9f9cc3=_0xc639[_0x25dcfe];return _0x9f9cc3;};'use strict';var Sequelize=require(_0x9c63('0x0'));module[_0x9c63('0x1')]={'name':{'type':Sequelize[_0x9c63('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9c63('0x2')]},'active':{'type':Sequelize[_0x9c63('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9c63('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x9c63('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x9c63('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x9c63('0x7')]('years',_0x9c63('0x8'),_0x9c63('0x9'),_0x9c63('0xa'),_0x9c63('0xb'),_0x9c63('0xc'),_0x9c63('0xd')),'allowNull':![],'defaultValue':_0x9c63('0xb')},'output':{'type':Sequelize['ENUM']('csv',_0x9c63('0xe'),_0x9c63('0xf')),'allowNull':![],'defaultValue':_0x9c63('0x10')},'type':{'type':Sequelize['ENUM'](_0x9c63('0x11'),_0x9c63('0x12')),'allowNull':![],'defaultValue':_0x9c63('0x11')},'sendMail':{'type':Sequelize[_0x9c63('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x9c63('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x9c63('0x13')]},'sendIfEmpty':{'type':Sequelize[_0x9c63('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x31da=['minutes','csv','pdf','xlsx','custom','default','TEXT','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','months','weeks','days','hours'];(function(_0x5700e7,_0x1bf281){var _0x79aee6=function(_0x276817){while(--_0x276817){_0x5700e7['push'](_0x5700e7['shift']());}};_0x79aee6(++_0x1bf281);}(_0x31da,0x196));var _0xa31d=function(_0x1ea9e8,_0x518c3e){_0x1ea9e8=_0x1ea9e8-0x0;var _0x16a9ec=_0x31da[_0x1ea9e8];return _0x16a9ec;};'use strict';var Sequelize=require('sequelize');module[_0xa31d('0x0')]={'name':{'type':Sequelize[_0xa31d('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xa31d('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xa31d('0x1')],'allowNull':![],'defaultValue':_0xa31d('0x3')},'startAt':{'type':Sequelize[_0xa31d('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xa31d('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xa31d('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xa31d('0x6')](_0xa31d('0x7'),'quarters',_0xa31d('0x8'),_0xa31d('0x9'),_0xa31d('0xa'),_0xa31d('0xb'),_0xa31d('0xc')),'allowNull':![],'defaultValue':_0xa31d('0xa')},'output':{'type':Sequelize[_0xa31d('0x6')](_0xa31d('0xd'),_0xa31d('0xe'),_0xa31d('0xf')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0xa31d('0x6')](_0xa31d('0x10'),_0xa31d('0x11')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xa31d('0x1')]},'cc':{'type':Sequelize[_0xa31d('0x12')]},'bcc':{'type':Sequelize[_0xa31d('0x12')]},'sendIfEmpty':{'type':Sequelize[_0xa31d('0x2')],'defaultValue':!![]}};
\ No newline at end of file
index fe933c0..72e6762 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x962b=['merge','filter','options','findAll','catch','params','include','find','create','body','user','Scheduler','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','get','UserProfileResource','destroy','stack','name','send','index','Schedule','rawAttributes','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x4afeb1,_0x19a2d4){var _0x2186e6=function(_0x4a1500){while(--_0x4a1500){_0x4afeb1['push'](_0x4afeb1['shift']());}};_0x2186e6(++_0x19a2d4);}(_0x962b,0x197));var _0xb962=function(_0x17e37b,_0x53018a){_0x17e37b=_0x17e37b-0x0;var _0x25553d=_0x962b[_0x17e37b];return _0x25553d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb962('0x0'));var jsonpatch=require(_0xb962('0x1'));var rp=require('request-promise');var moment=require(_0xb962('0x2'));var BPromise=require(_0xb962('0x3'));var Mustache=require('mustache');var util=require(_0xb962('0x4'));var path=require(_0xb962('0x5'));var sox=require('sox');var csv=require(_0xb962('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb962('0x7'));var _=require(_0xb962('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb962('0x9'));var deskjs=require(_0xb962('0xa'));var toCsv=require(_0xb962('0x6'));var querystring=require(_0xb962('0xb'));var Papa=require(_0xb962('0xc'));var Redis=require(_0xb962('0xd'));var authService=require(_0xb962('0xe'));var qs=require(_0xb962('0xf'));var as=require(_0xb962('0x10'));var hardwareService=require(_0xb962('0x11'));var logger=require('../../config/logger')(_0xb962('0x12'));var utils=require('../../config/utils');var config=require(_0xb962('0x13'));var licenseUtil=require(_0xb962('0x14'));var db=require(_0xb962('0x15'))['db'];function respondWithStatusCode(_0x47f49f,_0x3a3486){_0x3a3486=_0x3a3486||0xcc;return function(_0x2d700f){if(_0x2d700f){return _0x47f49f[_0xb962('0x16')](_0x3a3486);}return _0x47f49f[_0xb962('0x17')](_0x3a3486)[_0xb962('0x18')]();};}function respondWithResult(_0x594c2d,_0x46bc2e){_0x46bc2e=_0x46bc2e||0xc8;return function(_0x5ad93e){if(_0x5ad93e){return _0x594c2d[_0xb962('0x17')](_0x46bc2e)[_0xb962('0x19')](_0x5ad93e);}};}function respondWithFilteredResult(_0x368191,_0x470182){return function(_0x1c4370){if(_0x1c4370){var _0x41f3b2=typeof _0x470182[_0xb962('0x1a')]===_0xb962('0x1b')&&typeof _0x470182[_0xb962('0x1c')]==='undefined';var _0x5d16b4=_0x1c4370[_0xb962('0x1d')];var _0x6936cf=_0x41f3b2?0x0:_0x470182[_0xb962('0x1a')];var _0x198f97=_0x41f3b2?_0x1c4370[_0xb962('0x1d')]:_0x470182[_0xb962('0x1a')]+_0x470182[_0xb962('0x1c')];var _0x57e33e;if(_0x198f97>=_0x5d16b4){_0x198f97=_0x5d16b4;_0x57e33e=0xc8;}else{_0x57e33e=0xce;}_0x368191[_0xb962('0x17')](_0x57e33e);return _0x368191[_0xb962('0x1e')]('Content-Range',_0x6936cf+'-'+_0x198f97+'/'+_0x5d16b4)['json'](_0x1c4370);}return null;};}function patchUpdates(_0x25442b){return function(_0x73938a){try{jsonpatch[_0xb962('0x1f')](_0x73938a,_0x25442b,!![]);}catch(_0x1d565b){return BPromise[_0xb962('0x20')](_0x1d565b);}return _0x73938a['save']();};}function saveUpdates(_0x5cfabb,_0x581548){return function(_0x2d26af){if(_0x2d26af){return _0x2d26af[_0xb962('0x21')](_0x5cfabb)[_0xb962('0x22')](function(_0x2f0831){return _0x2f0831;});}return null;};}function removeEntity(_0xfc76a1,_0x5b6c92){return function(_0x364b7f){if(_0x364b7f){return _0x364b7f['destroy']()[_0xb962('0x22')](function(){var _0x49a763=_0x364b7f[_0xb962('0x23')]({'plain':!![]});var _0x1e40ab='Scheduler';return db[_0xb962('0x24')][_0xb962('0x25')]({'where':{'type':_0x1e40ab,'resourceId':_0x49a763['id']}})[_0xb962('0x22')](function(){return _0x364b7f;});})['then'](function(){_0xfc76a1['status'](0xcc)[_0xb962('0x18')]();});}};}function handleEntityNotFound(_0x46f09f,_0x4dc160){return function(_0x3e5402){if(!_0x3e5402){_0x46f09f[_0xb962('0x16')](0x194);}return _0x3e5402;};}function handleError(_0x68c94c,_0x8e5aa9){_0x8e5aa9=_0x8e5aa9||0x1f4;return function(_0x5b6de0){logger['error'](_0x5b6de0[_0xb962('0x26')]);if(_0x5b6de0['name']){delete _0x5b6de0[_0xb962('0x27')];}_0x68c94c[_0xb962('0x17')](_0x8e5aa9)[_0xb962('0x28')](_0x5b6de0);};}exports[_0xb962('0x29')]=function(_0x1bb4f3,_0x58c50d){var _0x15be83={},_0x521e18={},_0x1dc8a4={'count':0x0,'rows':[]};var _0x42eb86=_['map'](db[_0xb962('0x2a')][_0xb962('0x2b')],function(_0x2a41fc){return{'name':_0x2a41fc['fieldName'],'type':_0x2a41fc[_0xb962('0x2c')][_0xb962('0x2d')]};});_0x521e18[_0xb962('0x2e')]=_[_0xb962('0x2f')](_0x42eb86,_0xb962('0x27'));_0x521e18['query']=_[_0xb962('0x30')](_0x1bb4f3['query']);_0x521e18[_0xb962('0x31')]=_[_0xb962('0x32')](_0x521e18['model'],_0x521e18[_0xb962('0x33')]);_0x15be83[_0xb962('0x34')]=_[_0xb962('0x32')](_0x521e18[_0xb962('0x2e')],qs[_0xb962('0x35')](_0x1bb4f3['query']['fields']));_0x15be83[_0xb962('0x34')]=_0x15be83[_0xb962('0x34')][_0xb962('0x36')]?_0x15be83['attributes']:_0x521e18[_0xb962('0x2e')];if(!_0x1bb4f3['query'][_0xb962('0x37')](_0xb962('0x38'))){_0x15be83[_0xb962('0x1c')]=qs[_0xb962('0x1c')](_0x1bb4f3[_0xb962('0x33')][_0xb962('0x1c')]);_0x15be83['offset']=qs['offset'](_0x1bb4f3['query'][_0xb962('0x1a')]);}_0x15be83[_0xb962('0x39')]=qs[_0xb962('0x3a')](_0x1bb4f3[_0xb962('0x33')][_0xb962('0x3a')]);_0x15be83[_0xb962('0x3b')]=qs[_0xb962('0x31')](_[_0xb962('0x3c')](_0x1bb4f3[_0xb962('0x33')],_0x521e18[_0xb962('0x31')]),_0x42eb86);if(_0x1bb4f3[_0xb962('0x33')]['filter']){_0x15be83[_0xb962('0x3b')]=_[_0xb962('0x3d')](_0x15be83[_0xb962('0x3b')],{'$or':_[_0xb962('0x2f')](_0x42eb86,function(_0xc0db02){if(_0xc0db02[_0xb962('0x2c')]!=='VIRTUAL'){var _0x322520={};_0x322520[_0xc0db02['name']]={'$like':'%'+_0x1bb4f3['query'][_0xb962('0x3e')]+'%'};return _0x322520;}})});}_0x15be83=_[_0xb962('0x3d')]({},_0x15be83,_0x1bb4f3[_0xb962('0x3f')]);var _0x4028c4={'where':_0x15be83[_0xb962('0x3b')]};return db[_0xb962('0x2a')]['count'](_0x4028c4)['then'](function(_0x34f767){_0x1dc8a4[_0xb962('0x1d')]=_0x34f767;if(_0x1bb4f3['query']['includeAll']){_0x15be83['include']=[{'all':!![]}];}return db[_0xb962('0x2a')][_0xb962('0x40')](_0x15be83);})[_0xb962('0x22')](function(_0x3ff03f){_0x1dc8a4['rows']=_0x3ff03f;return _0x1dc8a4;})[_0xb962('0x22')](respondWithFilteredResult(_0x58c50d,_0x15be83))[_0xb962('0x41')](handleError(_0x58c50d,null));};exports['show']=function(_0x54556b,_0x128ff4){var _0x228861={'raw':![],'where':{'id':_0x54556b[_0xb962('0x42')]['id']}},_0x59a16a={};_0x59a16a[_0xb962('0x2e')]=_['keys'](db[_0xb962('0x2a')][_0xb962('0x2b')]);_0x59a16a['query']=_[_0xb962('0x30')](_0x54556b[_0xb962('0x33')]);_0x59a16a[_0xb962('0x31')]=_[_0xb962('0x32')](_0x59a16a[_0xb962('0x2e')],_0x59a16a['query']);_0x228861[_0xb962('0x34')]=_[_0xb962('0x32')](_0x59a16a[_0xb962('0x2e')],qs[_0xb962('0x35')](_0x54556b[_0xb962('0x33')][_0xb962('0x35')]));_0x228861[_0xb962('0x34')]=_0x228861['attributes']['length']?_0x228861[_0xb962('0x34')]:_0x59a16a[_0xb962('0x2e')];if(_0x54556b[_0xb962('0x33')]['includeAll']){_0x228861[_0xb962('0x43')]=[{'all':!![]}];}_0x228861=_[_0xb962('0x3d')]({},_0x228861,_0x54556b[_0xb962('0x3f')]);return db['Schedule'][_0xb962('0x44')](_0x228861)['then'](handleEntityNotFound(_0x128ff4,null))['then'](respondWithResult(_0x128ff4,null))[_0xb962('0x41')](handleError(_0x128ff4,null));};exports[_0xb962('0x45')]=function(_0x43e1a3,_0x587f96){return db['Schedule']['create'](_0x43e1a3[_0xb962('0x46')],{})['then'](function(_0x5f562f){var _0x49085d=_0x43e1a3[_0xb962('0x47')][_0xb962('0x23')]({'plain':!![]});if(!_0x49085d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49085d['role']===_0xb962('0x47')){var _0x53eefb=_0x5f562f[_0xb962('0x23')]({'plain':!![]});var _0x929399=_0xb962('0x48');return db[_0xb962('0x49')]['find']({'where':{'name':_0x929399,'userProfileId':_0x49085d['userProfileId']},'raw':!![]})['then'](function(_0x48234d){if(_0x48234d&&_0x48234d[_0xb962('0x4a')]===0x0){return db[_0xb962('0x24')]['create']({'name':_0x53eefb['name'],'resourceId':_0x53eefb['id'],'type':_0x48234d[_0xb962('0x27')],'sectionId':_0x48234d['id']},{})[_0xb962('0x22')](function(){return _0x5f562f;});}else{return _0x5f562f;}})['catch'](function(_0xb30a68){logger[_0xb962('0x4b')](_0xb962('0x4c'),_0xb30a68);throw _0xb30a68;});}return _0x5f562f;})['then'](respondWithResult(_0x587f96,0xc9))[_0xb962('0x41')](handleError(_0x587f96,null));};exports[_0xb962('0x21')]=function(_0x13d004,_0x39b192){if(_0x13d004[_0xb962('0x46')]['id']){delete _0x13d004[_0xb962('0x46')]['id'];}return db[_0xb962('0x2a')][_0xb962('0x44')]({'where':{'id':_0x13d004[_0xb962('0x42')]['id']}})[_0xb962('0x22')](handleEntityNotFound(_0x39b192,null))[_0xb962('0x22')](saveUpdates(_0x13d004[_0xb962('0x46')],null))[_0xb962('0x22')](respondWithResult(_0x39b192,null))[_0xb962('0x41')](handleError(_0x39b192,null));};exports[_0xb962('0x25')]=function(_0x2ea787,_0x574f21){return db['Schedule']['find']({'where':{'id':_0x2ea787[_0xb962('0x42')]['id']}})[_0xb962('0x22')](handleEntityNotFound(_0x574f21,null))[_0xb962('0x22')](removeEntity(_0x574f21,null))[_0xb962('0x41')](handleError(_0x574f21,null));};exports[_0xb962('0x4d')]=function(_0x5e5043,_0x7a0de5,_0x1291d5){var _0x52c48d=require('../../config/schedule');return db['Schedule']['find']({'where':{'id':_0x5e5043[_0xb962('0x42')]['id']},'raw':!![]})[_0xb962('0x22')](handleEntityNotFound(_0x7a0de5,null))[_0xb962('0x22')](function(){_0x52c48d[_0xb962('0x4d')](_0x5e5043[_0xb962('0x42')]['id']);})[_0xb962('0x22')](respondWithStatusCode(_0x7a0de5,null))[_0xb962('0x41')](handleError(_0x7a0de5,null));};
\ No newline at end of file
+var _0x6355=['desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','Scheduler','UserProfileResource','end','error','stack','name','send','index','map','Schedule','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','order','sort','where','pick','filters','merge','filter','options','include','findAll','rows','catch','show','params','keys','rawAttributes','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','rimraf','fast-json-patch','request-promise','moment','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x3a07c1,_0x34d57f){var _0x2bbe15=function(_0x5a02fb){while(--_0x5a02fb){_0x3a07c1['push'](_0x3a07c1['shift']());}};_0x2bbe15(++_0x34d57f);}(_0x6355,0xa4));var _0x5635=function(_0xd7ee0e,_0x2a69b0){_0xd7ee0e=_0xd7ee0e-0x0;var _0x5f2b3e=_0x6355[_0xd7ee0e];return _0x5f2b3e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5635('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5635('0x1'));var rp=require(_0x5635('0x2'));var moment=require(_0x5635('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5635('0x4'));var path=require('path');var sox=require(_0x5635('0x5'));var csv=require('to-csv');var ejs=require(_0x5635('0x6'));var fs=require('fs');var fs_extra=require(_0x5635('0x7'));var _=require(_0x5635('0x8'));var squel=require(_0x5635('0x9'));var crypto=require(_0x5635('0xa'));var jsforce=require(_0x5635('0xb'));var deskjs=require(_0x5635('0xc'));var toCsv=require(_0x5635('0xd'));var querystring=require(_0x5635('0xe'));var Papa=require(_0x5635('0xf'));var Redis=require(_0x5635('0x10'));var authService=require(_0x5635('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5635('0x12'));var hardwareService=require(_0x5635('0x13'));var logger=require(_0x5635('0x14'))(_0x5635('0x15'));var utils=require(_0x5635('0x16'));var config=require(_0x5635('0x17'));var licenseUtil=require(_0x5635('0x18'));var db=require(_0x5635('0x19'))['db'];function respondWithStatusCode(_0x3218da,_0x17d622){_0x17d622=_0x17d622||0xcc;return function(_0x16c4ff){if(_0x16c4ff){return _0x3218da[_0x5635('0x1a')](_0x17d622);}return _0x3218da[_0x5635('0x1b')](_0x17d622)['end']();};}function respondWithResult(_0x133495,_0x57fbdf){_0x57fbdf=_0x57fbdf||0xc8;return function(_0x2adbe2){if(_0x2adbe2){return _0x133495['status'](_0x57fbdf)[_0x5635('0x1c')](_0x2adbe2);}};}function respondWithFilteredResult(_0x2c88a7,_0x3415cf){return function(_0x5be125){if(_0x5be125){var _0xf38b2e=typeof _0x3415cf[_0x5635('0x1d')]===_0x5635('0x1e')&&typeof _0x3415cf[_0x5635('0x1f')]===_0x5635('0x1e');var _0xb78c98=_0x5be125[_0x5635('0x20')];var _0x7ca724=_0xf38b2e?0x0:_0x3415cf[_0x5635('0x1d')];var _0x8a24ed=_0xf38b2e?_0x5be125[_0x5635('0x20')]:_0x3415cf['offset']+_0x3415cf[_0x5635('0x1f')];var _0x202836;if(_0x8a24ed>=_0xb78c98){_0x8a24ed=_0xb78c98;_0x202836=0xc8;}else{_0x202836=0xce;}_0x2c88a7['status'](_0x202836);return _0x2c88a7[_0x5635('0x21')](_0x5635('0x22'),_0x7ca724+'-'+_0x8a24ed+'/'+_0xb78c98)['json'](_0x5be125);}return null;};}function patchUpdates(_0x23bb1c){return function(_0x55b89a){try{jsonpatch[_0x5635('0x23')](_0x55b89a,_0x23bb1c,!![]);}catch(_0xf47e22){return BPromise[_0x5635('0x24')](_0xf47e22);}return _0x55b89a[_0x5635('0x25')]();};}function saveUpdates(_0x350b08,_0x18d223){return function(_0x57304f){if(_0x57304f){return _0x57304f[_0x5635('0x26')](_0x350b08)[_0x5635('0x27')](function(_0x423c88){return _0x423c88;});}return null;};}function removeEntity(_0x40698a,_0x3feabf){return function(_0x1ec181){if(_0x1ec181){return _0x1ec181['destroy']()[_0x5635('0x27')](function(){var _0x9cfdee=_0x1ec181[_0x5635('0x28')]({'plain':!![]});var _0x2133a6=_0x5635('0x29');return db[_0x5635('0x2a')]['destroy']({'where':{'type':_0x2133a6,'resourceId':_0x9cfdee['id']}})['then'](function(){return _0x1ec181;});})[_0x5635('0x27')](function(){_0x40698a[_0x5635('0x1b')](0xcc)[_0x5635('0x2b')]();});}};}function handleEntityNotFound(_0x4c6c26,_0x52b0d0){return function(_0x5dddcb){if(!_0x5dddcb){_0x4c6c26['sendStatus'](0x194);}return _0x5dddcb;};}function handleError(_0x21641a,_0x2978c1){_0x2978c1=_0x2978c1||0x1f4;return function(_0xa67797){logger[_0x5635('0x2c')](_0xa67797[_0x5635('0x2d')]);if(_0xa67797[_0x5635('0x2e')]){delete _0xa67797[_0x5635('0x2e')];}_0x21641a[_0x5635('0x1b')](_0x2978c1)[_0x5635('0x2f')](_0xa67797);};}exports[_0x5635('0x30')]=function(_0x23a1b1,_0x4d0e21){var _0x34f974={},_0x12a830={},_0x58b0a8={'count':0x0,'rows':[]};var _0x3decc8=_[_0x5635('0x31')](db[_0x5635('0x32')]['rawAttributes'],function(_0xf9eeb8){return{'name':_0xf9eeb8[_0x5635('0x33')],'type':_0xf9eeb8[_0x5635('0x34')][_0x5635('0x35')]};});_0x12a830[_0x5635('0x36')]=_['map'](_0x3decc8,_0x5635('0x2e'));_0x12a830[_0x5635('0x37')]=_['keys'](_0x23a1b1[_0x5635('0x37')]);_0x12a830['filters']=_[_0x5635('0x38')](_0x12a830[_0x5635('0x36')],_0x12a830[_0x5635('0x37')]);_0x34f974[_0x5635('0x39')]=_['intersection'](_0x12a830[_0x5635('0x36')],qs[_0x5635('0x3a')](_0x23a1b1['query'][_0x5635('0x3a')]));_0x34f974['attributes']=_0x34f974[_0x5635('0x39')]['length']?_0x34f974['attributes']:_0x12a830[_0x5635('0x36')];if(!_0x23a1b1[_0x5635('0x37')]['hasOwnProperty'](_0x5635('0x3b'))){_0x34f974[_0x5635('0x1f')]=qs[_0x5635('0x1f')](_0x23a1b1['query'][_0x5635('0x1f')]);_0x34f974[_0x5635('0x1d')]=qs[_0x5635('0x1d')](_0x23a1b1[_0x5635('0x37')]['offset']);}_0x34f974[_0x5635('0x3c')]=qs[_0x5635('0x3d')](_0x23a1b1[_0x5635('0x37')]['sort']);_0x34f974[_0x5635('0x3e')]=qs['filters'](_[_0x5635('0x3f')](_0x23a1b1['query'],_0x12a830[_0x5635('0x40')]),_0x3decc8);if(_0x23a1b1[_0x5635('0x37')]['filter']){_0x34f974[_0x5635('0x3e')]=_[_0x5635('0x41')](_0x34f974['where'],{'$or':_[_0x5635('0x31')](_0x3decc8,function(_0x1de1ab){if(_0x1de1ab[_0x5635('0x34')]!=='VIRTUAL'){var _0x3a5ce3={};_0x3a5ce3[_0x1de1ab[_0x5635('0x2e')]]={'$like':'%'+_0x23a1b1[_0x5635('0x37')][_0x5635('0x42')]+'%'};return _0x3a5ce3;}})});}_0x34f974=_[_0x5635('0x41')]({},_0x34f974,_0x23a1b1[_0x5635('0x43')]);var _0xbf25d5={'where':_0x34f974[_0x5635('0x3e')]};return db[_0x5635('0x32')]['count'](_0xbf25d5)[_0x5635('0x27')](function(_0x243de2){_0x58b0a8[_0x5635('0x20')]=_0x243de2;if(_0x23a1b1[_0x5635('0x37')]['includeAll']){_0x34f974[_0x5635('0x44')]=[{'all':!![]}];}return db[_0x5635('0x32')][_0x5635('0x45')](_0x34f974);})['then'](function(_0x549c59){_0x58b0a8[_0x5635('0x46')]=_0x549c59;return _0x58b0a8;})['then'](respondWithFilteredResult(_0x4d0e21,_0x34f974))[_0x5635('0x47')](handleError(_0x4d0e21,null));};exports[_0x5635('0x48')]=function(_0x570c01,_0x19f7e7){var _0x294e89={'raw':![],'where':{'id':_0x570c01[_0x5635('0x49')]['id']}},_0x217e43={};_0x217e43['model']=_[_0x5635('0x4a')](db[_0x5635('0x32')][_0x5635('0x4b')]);_0x217e43[_0x5635('0x37')]=_[_0x5635('0x4a')](_0x570c01[_0x5635('0x37')]);_0x217e43['filters']=_[_0x5635('0x38')](_0x217e43[_0x5635('0x36')],_0x217e43['query']);_0x294e89['attributes']=_[_0x5635('0x38')](_0x217e43[_0x5635('0x36')],qs[_0x5635('0x3a')](_0x570c01[_0x5635('0x37')][_0x5635('0x3a')]));_0x294e89['attributes']=_0x294e89[_0x5635('0x39')][_0x5635('0x4c')]?_0x294e89['attributes']:_0x217e43['model'];if(_0x570c01['query'][_0x5635('0x4d')]){_0x294e89['include']=[{'all':!![]}];}_0x294e89=_['merge']({},_0x294e89,_0x570c01[_0x5635('0x43')]);return db[_0x5635('0x32')][_0x5635('0x4e')](_0x294e89)[_0x5635('0x27')](handleEntityNotFound(_0x19f7e7,null))['then'](respondWithResult(_0x19f7e7,null))[_0x5635('0x47')](handleError(_0x19f7e7,null));};exports[_0x5635('0x4f')]=function(_0x3dd045,_0x46f270){return db[_0x5635('0x32')][_0x5635('0x4f')](_0x3dd045[_0x5635('0x50')],{})['then'](function(_0x46b96a){var _0x1968e8=_0x3dd045[_0x5635('0x51')]['get']({'plain':!![]});if(!_0x1968e8)throw new Error(_0x5635('0x52'));if(_0x1968e8[_0x5635('0x53')]===_0x5635('0x51')){var _0x5efa2e=_0x46b96a[_0x5635('0x28')]({'plain':!![]});var _0x967bf9='Scheduler';return db['UserProfileSection'][_0x5635('0x4e')]({'where':{'name':_0x967bf9,'userProfileId':_0x1968e8[_0x5635('0x54')]},'raw':!![]})[_0x5635('0x27')](function(_0xe35cae){if(_0xe35cae&&_0xe35cae['autoAssociation']===0x0){return db[_0x5635('0x2a')]['create']({'name':_0x5efa2e[_0x5635('0x2e')],'resourceId':_0x5efa2e['id'],'type':_0xe35cae[_0x5635('0x2e')],'sectionId':_0xe35cae['id']},{})[_0x5635('0x27')](function(){return _0x46b96a;});}else{return _0x46b96a;}})[_0x5635('0x47')](function(_0x514f1c){logger['error'](_0x5635('0x55'),_0x514f1c);throw _0x514f1c;});}return _0x46b96a;})[_0x5635('0x27')](respondWithResult(_0x46f270,0xc9))[_0x5635('0x47')](handleError(_0x46f270,null));};exports[_0x5635('0x26')]=function(_0x20b921,_0x3ecaae){if(_0x20b921[_0x5635('0x50')]['id']){delete _0x20b921[_0x5635('0x50')]['id'];}return db[_0x5635('0x32')][_0x5635('0x4e')]({'where':{'id':_0x20b921[_0x5635('0x49')]['id']}})[_0x5635('0x27')](handleEntityNotFound(_0x3ecaae,null))[_0x5635('0x27')](saveUpdates(_0x20b921[_0x5635('0x50')],null))[_0x5635('0x27')](respondWithResult(_0x3ecaae,null))[_0x5635('0x47')](handleError(_0x3ecaae,null));};exports['destroy']=function(_0x305747,_0x43bf94){return db[_0x5635('0x32')][_0x5635('0x4e')]({'where':{'id':_0x305747[_0x5635('0x49')]['id']}})['then'](handleEntityNotFound(_0x43bf94,null))[_0x5635('0x27')](removeEntity(_0x43bf94,null))[_0x5635('0x47')](handleError(_0x43bf94,null));};exports[_0x5635('0x56')]=function(_0x13f9b8,_0x118744,_0x404f69){var _0x2248ae=require(_0x5635('0x57'));return db[_0x5635('0x32')][_0x5635('0x4e')]({'where':{'id':_0x13f9b8[_0x5635('0x49')]['id']},'raw':!![]})[_0x5635('0x27')](handleEntityNotFound(_0x118744,null))[_0x5635('0x27')](function(){_0x2248ae['run'](_0x13f9b8[_0x5635('0x49')]['id']);})[_0x5635('0x27')](respondWithStatusCode(_0x118744,null))[_0x5635('0x47')](handleError(_0x118744,null));};
\ No newline at end of file
index 2408274..f50aa87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e97=['util','api','bluebird','path','rimraf','exports','Schedule','tools_schedules'];(function(_0x4f0cce,_0x3a2d29){var _0xa29057=function(_0xb736f6){while(--_0xb736f6){_0x4f0cce['push'](_0x4f0cce['shift']());}};_0xa29057(++_0x3a2d29);}(_0x4e97,0x108));var _0x74e9=function(_0xfc8976,_0x2897dc){_0xfc8976=_0xfc8976-0x0;var _0x3fbb89=_0x4e97[_0xfc8976];return _0x3fbb89;};'use strict';var _=require('lodash');var util=require(_0x74e9('0x0'));var logger=require('../../config/logger')(_0x74e9('0x1'));var moment=require('moment');var BPromise=require(_0x74e9('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x74e9('0x3'));var rimraf=require(_0x74e9('0x4'));var config=require('../../config/environment');var attributes=require('./schedule.attributes');module[_0x74e9('0x5')]=function(_0x599897,_0x2b735a){return _0x599897['define'](_0x74e9('0x6'),attributes,{'tableName':_0x74e9('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7fa4=['lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./schedule.attributes','define','Schedule','tools_schedules'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0x7fa4,0x197));var _0x47fa=function(_0x52d042,_0x4c96a7){_0x52d042=_0x52d042-0x0;var _0x48b524=_0x7fa4[_0x52d042];return _0x48b524;};'use strict';var _=require(_0x47fa('0x0'));var util=require('util');var logger=require(_0x47fa('0x1'))(_0x47fa('0x2'));var moment=require(_0x47fa('0x3'));var BPromise=require('bluebird');var rp=require(_0x47fa('0x4'));var fs=require('fs');var path=require(_0x47fa('0x5'));var rimraf=require('rimraf');var config=require(_0x47fa('0x6'));var attributes=require(_0x47fa('0x7'));module['exports']=function(_0x395f61,_0x37abda){return _0x395f61[_0x47fa('0x8')](_0x47fa('0x9'),attributes,{'tableName':_0x47fa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2fc3f12..5a9fb1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5960=['Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info'];(function(_0x14d896,_0x53578b){var _0x28679a=function(_0x14921f){while(--_0x14921f){_0x14d896['push'](_0x14d896['shift']());}};_0x28679a(++_0x53578b);}(_0x5960,0x18a));var _0x0596=function(_0x50db6f,_0x1d5204){_0x50db6f=_0x50db6f-0x0;var _0x2babc4=_0x5960[_0x50db6f];return _0x2babc4;};'use strict';var _=require(_0x0596('0x0'));var util=require(_0x0596('0x1'));var moment=require(_0x0596('0x2'));var BPromise=require(_0x0596('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0596('0x4'));var db=require(_0x0596('0x5'))['db'];var utils=require(_0x0596('0x6'));var logger=require('../../config/logger')(_0x0596('0x7'));var config=require(_0x0596('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0596('0x9')][_0x0596('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49e4b6,_0x41c485,_0x5cc322){return new BPromise(function(_0x2ad8fc,_0x371e37){return client[_0x0596('0xb')](_0x49e4b6,_0x5cc322)[_0x0596('0xc')](function(_0x1770c4){logger[_0x0596('0xd')](_0x0596('0xe'),_0x41c485,'request\x20sent');logger[_0x0596('0xf')](_0x0596('0x10'),_0x41c485,_0x0596('0x11'),JSON[_0x0596('0x12')](_0x1770c4));if(_0x1770c4[_0x0596('0x13')]){if(_0x1770c4[_0x0596('0x13')][_0x0596('0x14')]===0x1f4){logger[_0x0596('0x13')]('Schedule,\x20%s,\x20%s',_0x41c485,_0x1770c4[_0x0596('0x13')][_0x0596('0x15')]);return _0x371e37(_0x1770c4[_0x0596('0x13')][_0x0596('0x15')]);}logger[_0x0596('0x13')](_0x0596('0xe'),_0x41c485,_0x1770c4[_0x0596('0x13')][_0x0596('0x15')]);return _0x2ad8fc(_0x1770c4[_0x0596('0x13')][_0x0596('0x15')]);}else{logger[_0x0596('0xd')](_0x0596('0xe'),_0x41c485,_0x0596('0x11'));_0x2ad8fc(_0x1770c4[_0x0596('0x16')]['message']);}})[_0x0596('0x17')](function(_0x105b76){logger[_0x0596('0x13')](_0x0596('0xe'),_0x41c485,_0x105b76);_0x371e37(_0x105b76);});});}
\ No newline at end of file
+var _0xc776=['bluebird','randomstring','ioredis','../../config/environment','client','http','request','info','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x396e47,_0x3c102d){var _0x1417e9=function(_0x649ff6){while(--_0x649ff6){_0x396e47['push'](_0x396e47['shift']());}};_0x1417e9(++_0x3c102d);}(_0xc776,0x1a1));var _0x6c77=function(_0xc5d72f,_0x32493a){_0xc5d72f=_0xc5d72f-0x0;var _0x571b6f=_0xc776[_0xc5d72f];return _0x571b6f;};'use strict';var _=require(_0x6c77('0x0'));var util=require(_0x6c77('0x1'));var moment=require(_0x6c77('0x2'));var BPromise=require(_0x6c77('0x3'));var rs=require(_0x6c77('0x4'));var fs=require('fs');var Redis=require(_0x6c77('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6c77('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6c77('0x7')][_0x6c77('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xf1654d,_0x47a1ab,_0x4f02de){return new BPromise(function(_0xb0b6ea,_0x586d2a){return client[_0x6c77('0x9')](_0xf1654d,_0x4f02de)['then'](function(_0x4f91ea){logger[_0x6c77('0xa')](_0x6c77('0xb'),_0x47a1ab,'request\x20sent');logger[_0x6c77('0xc')](_0x6c77('0xd'),_0x47a1ab,_0x6c77('0xe'),JSON[_0x6c77('0xf')](_0x4f91ea));if(_0x4f91ea[_0x6c77('0x10')]){if(_0x4f91ea[_0x6c77('0x10')][_0x6c77('0x11')]===0x1f4){logger['error'](_0x6c77('0xb'),_0x47a1ab,_0x4f91ea[_0x6c77('0x10')]['message']);return _0x586d2a(_0x4f91ea['error'][_0x6c77('0x12')]);}logger[_0x6c77('0x10')](_0x6c77('0xb'),_0x47a1ab,_0x4f91ea['error'][_0x6c77('0x12')]);return _0xb0b6ea(_0x4f91ea[_0x6c77('0x10')]['message']);}else{logger[_0x6c77('0xa')]('Schedule,\x20%s,\x20%s',_0x47a1ab,_0x6c77('0xe'));_0xb0b6ea(_0x4f91ea[_0x6c77('0x13')][_0x6c77('0x12')]);}})[_0x6c77('0x14')](function(_0x4fbcf8){logger[_0x6c77('0x10')]('Schedule,\x20%s,\x20%s',_0x47a1ab,_0x4fbcf8);_0x586d2a(_0x4fbcf8);});});}
\ No newline at end of file
index 8d9d398..22cf296 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf850=['../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','download','post','create','put','update','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0xf97939,_0x5ec5d2){var _0x5dafbc=function(_0x5801b9){while(--_0x5801b9){_0xf97939['push'](_0xf97939['shift']());}};_0x5dafbc(++_0x5ec5d2);}(_0xf850,0x9a));var _0x0f85=function(_0x1131ec,_0xc5a9a0){_0x1131ec=_0x1131ec-0x0;var _0x36c12a=_0xf850[_0x1131ec];return _0x36c12a;};'use strict';var multer=require('multer');var util=require(_0x0f85('0x0'));var path=require(_0x0f85('0x1'));var timeout=require(_0x0f85('0x2'));var express=require(_0x0f85('0x3'));var router=express['Router']();var fs_extra=require(_0x0f85('0x4'));var auth=require(_0x0f85('0x5'));var interaction=require(_0x0f85('0x6'));var config=require('../../config/environment');var controller=require('./screenRecording.controller');router[_0x0f85('0x7')]('/',auth[_0x0f85('0x8')](),controller[_0x0f85('0x9')]);router[_0x0f85('0x7')](_0x0f85('0xa'),auth['isAuthenticated'](),controller[_0x0f85('0xb')]);router[_0x0f85('0x7')](_0x0f85('0xc'),auth[_0x0f85('0x8')](),controller['show']);router['get'](_0x0f85('0xd'),auth[_0x0f85('0x8')](),controller[_0x0f85('0xe')]);router[_0x0f85('0xf')]('/',auth[_0x0f85('0x8')](),controller[_0x0f85('0x10')]);router[_0x0f85('0x11')](_0x0f85('0xc'),auth['isAuthenticated'](),controller[_0x0f85('0x12')]);router['delete'](_0x0f85('0xc'),auth[_0x0f85('0x8')](),controller['destroy']);module[_0x0f85('0x13')]=router;
\ No newline at end of file
+var _0x51aa=['./screenRecording.controller','get','index','/describe','isAuthenticated','/:id','/:id/download','download','post','create','update','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x58361c,_0x3e8833){var _0x423bcc=function(_0x4228a6){while(--_0x4228a6){_0x58361c['push'](_0x58361c['shift']());}};_0x423bcc(++_0x3e8833);}(_0x51aa,0x1ed));var _0xa51a=function(_0x114c82,_0x89fb23){_0x114c82=_0x114c82-0x0;var _0x10889c=_0x51aa[_0x114c82];return _0x10889c;};'use strict';var multer=require(_0xa51a('0x0'));var util=require('util');var path=require(_0xa51a('0x1'));var timeout=require(_0xa51a('0x2'));var express=require('express');var router=express[_0xa51a('0x3')]();var fs_extra=require(_0xa51a('0x4'));var auth=require(_0xa51a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa51a('0x6'));var controller=require(_0xa51a('0x7'));router[_0xa51a('0x8')]('/',auth['isAuthenticated'](),controller[_0xa51a('0x9')]);router[_0xa51a('0x8')](_0xa51a('0xa'),auth[_0xa51a('0xb')](),controller['describe']);router['get'](_0xa51a('0xc'),auth[_0xa51a('0xb')](),controller['show']);router[_0xa51a('0x8')](_0xa51a('0xd'),auth[_0xa51a('0xb')](),controller[_0xa51a('0xe')]);router[_0xa51a('0xf')]('/',auth[_0xa51a('0xb')](),controller[_0xa51a('0x10')]);router['put'](_0xa51a('0xc'),auth[_0xa51a('0xb')](),controller[_0xa51a('0x11')]);router[_0xa51a('0x12')](_0xa51a('0xc'),auth['isAuthenticated'](),controller[_0xa51a('0x13')]);module['exports']=router;
\ No newline at end of file
index 9e7e806..a5c15ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7334=['startedAt','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','toString','DATE','createdAt','sequelize','moment','path','VIRTUAL','value','extname','getDataValue','STRING','replace','setDataValue','INTEGER'];(function(_0x22646e,_0x25adf5){var _0xc7ab07=function(_0x1760ee){while(--_0x1760ee){_0x22646e['push'](_0x22646e['shift']());}};_0xc7ab07(++_0x25adf5);}(_0x7334,0x184));var _0x4733=function(_0x5cef3d,_0x2d5cba){_0x5cef3d=_0x5cef3d-0x0;var _0x2a8e65=_0x7334[_0x5cef3d];return _0x2a8e65;};'use strict';var Sequelize=require(_0x4733('0x0'));var moment=require(_0x4733('0x1'));var path=require(_0x4733('0x2'));var config=require('../../config/environment');module['exports']={'format':{'type':Sequelize[_0x4733('0x3')],'get':function(){return this['getDataValue'](_0x4733('0x4'))?path[_0x4733('0x5')](this[_0x4733('0x6')](_0x4733('0x4'))):undefined;}},'interactionid':{'type':Sequelize[_0x4733('0x7')]},'channel':{'type':Sequelize[_0x4733('0x7')]},'value':{'type':Sequelize[_0x4733('0x7')],'set':function(_0x283754){var _0x12cafa=_0x283754[_0x4733('0x8')](/\\/g,'/');this[_0x4733('0x9')](_0x4733('0x4'),_0x12cafa);}},'rating':{'type':Sequelize[_0x4733('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x4733('0xa')],'set':function(_0x2d5fde){this[_0x4733('0x9')](_0x4733('0xb'),moment()['subtract'](_0x2d5fde,'ms'));this[_0x4733('0x9')](_0x4733('0xc'),moment());this['setDataValue'](_0x4733('0xd'),_0x2d5fde);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x4733('0x6')](_0x4733('0xb')))[_0x4733('0xe')](_0x4733('0xf'))[_0x4733('0x10')]();}},'closedAt':{'type':Sequelize[_0x4733('0x11')],'get':function(){return moment(this[_0x4733('0x6')]('closedAt'))[_0x4733('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x4733('0x10')]();}},'createdAt':{'type':Sequelize[_0x4733('0x11')],'get':function(){return moment(this[_0x4733('0x6')](_0x4733('0x12')))[_0x4733('0xe')](_0x4733('0xf'))[_0x4733('0x10')]();}},'updatedAt':{'type':Sequelize[_0x4733('0x11')],'get':function(){return moment(this[_0x4733('0x6')]('updatedAt'))[_0x4733('0xe')](_0x4733('0xf'))['toString']();}}};
\ No newline at end of file
+var _0xbe9d=['extname','STRING','replace','INTEGER','startedAt','subtract','setDataValue','closedAt','duration','DATE','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','format','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value'];(function(_0x5a72f2,_0x72f5f){var _0x15b408=function(_0x585799){while(--_0x585799){_0x5a72f2['push'](_0x5a72f2['shift']());}};_0x15b408(++_0x72f5f);}(_0xbe9d,0x99));var _0xdbe9=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbe9d[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require(_0xdbe9('0x0'));var moment=require(_0xdbe9('0x1'));var path=require(_0xdbe9('0x2'));var config=require(_0xdbe9('0x3'));module[_0xdbe9('0x4')]={'format':{'type':Sequelize[_0xdbe9('0x5')],'get':function(){return this[_0xdbe9('0x6')](_0xdbe9('0x7'))?path[_0xdbe9('0x8')](this[_0xdbe9('0x6')](_0xdbe9('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0xdbe9('0x9')]},'channel':{'type':Sequelize[_0xdbe9('0x9')]},'value':{'type':Sequelize['STRING'],'set':function(_0x56e9be){var _0x3d5165=_0x56e9be[_0xdbe9('0xa')](/\\/g,'/');this['setDataValue'](_0xdbe9('0x7'),_0x3d5165);}},'rating':{'type':Sequelize[_0xdbe9('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xdbe9('0xb')],'set':function(_0x56470c){this['setDataValue'](_0xdbe9('0xc'),moment()[_0xdbe9('0xd')](_0x56470c,'ms'));this[_0xdbe9('0xe')](_0xdbe9('0xf'),moment());this['setDataValue'](_0xdbe9('0x10'),_0x56470c);}},'startedAt':{'type':Sequelize[_0xdbe9('0x11')],'get':function(){return moment(this[_0xdbe9('0x6')](_0xdbe9('0xc')))['format'](_0xdbe9('0x12'))['toString']();}},'closedAt':{'type':Sequelize[_0xdbe9('0x11')],'get':function(){return moment(this[_0xdbe9('0x6')](_0xdbe9('0xf')))['format'](_0xdbe9('0x12'))[_0xdbe9('0x13')]();}},'createdAt':{'type':Sequelize[_0xdbe9('0x11')],'get':function(){return moment(this['getDataValue'](_0xdbe9('0x14')))['format'](_0xdbe9('0x12'))[_0xdbe9('0x13')]();}},'updatedAt':{'type':Sequelize[_0xdbe9('0x11')],'get':function(){return moment(this['getDataValue'](_0xdbe9('0x15')))[_0xdbe9('0x16')](_0xdbe9('0x12'))['toString']();}}};
\ No newline at end of file
index e1ce800..4041ef9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cb9=['ValidationError','filename','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','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','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','filters','intersection','fields','attributes','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','findAll','rows','catch','show','keys','length','include','options','find','create','body','duration','createdAt','value','params','describe','download','../../components/encryptor','uniqueid','join','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','recording','root','Sequelize'];(function(_0x2ab276,_0x2fc401){var _0x46dfb1=function(_0x44f9fc){while(--_0x44f9fc){_0x2ab276['push'](_0x2ab276['shift']());}};_0x46dfb1(++_0x2fc401);}(_0x1cb9,0x14e));var _0x91cb=function(_0x44dc16,_0x287278){_0x44dc16=_0x44dc16-0x0;var _0x542e63=_0x1cb9[_0x44dc16];return _0x542e63;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];function respondWithStatusCode(_0x366f09,_0x4ba2f2){_0x4ba2f2=_0x4ba2f2||0xcc;return function(_0x20e6e0){if(_0x20e6e0){return _0x366f09[_0x91cb('0x19')](_0x4ba2f2);}return _0x366f09[_0x91cb('0x1a')](_0x4ba2f2)[_0x91cb('0x1b')]();};}function respondWithResult(_0x4a7d45,_0x4cc6ef){_0x4cc6ef=_0x4cc6ef||0xc8;return function(_0x4aae25){if(_0x4aae25){return _0x4a7d45[_0x91cb('0x1a')](_0x4cc6ef)['json'](_0x4aae25);}};}function respondWithFilteredResult(_0x528f73,_0x576369){return function(_0xc3629e){if(_0xc3629e){var _0x347980=typeof _0x576369['offset']===_0x91cb('0x1c')&&typeof _0x576369[_0x91cb('0x1d')]==='undefined';var _0xc594e3=_0xc3629e[_0x91cb('0x1e')];var _0x1cd34b=_0x347980?0x0:_0x576369[_0x91cb('0x1f')];var _0x5cc1c3=_0x347980?_0xc3629e[_0x91cb('0x1e')]:_0x576369[_0x91cb('0x1f')]+_0x576369['limit'];var _0x123847;if(_0x5cc1c3>=_0xc594e3){_0x5cc1c3=_0xc594e3;_0x123847=0xc8;}else{_0x123847=0xce;}_0x528f73['status'](_0x123847);return _0x528f73['set'](_0x91cb('0x20'),_0x1cd34b+'-'+_0x5cc1c3+'/'+_0xc594e3)[_0x91cb('0x21')](_0xc3629e);}return null;};}function patchUpdates(_0x56e409){return function(_0x51a1d5){try{jsonpatch['apply'](_0x51a1d5,_0x56e409,!![]);}catch(_0x438162){return BPromise[_0x91cb('0x22')](_0x438162);}return _0x51a1d5[_0x91cb('0x23')]();};}function saveUpdates(_0x1dbee2,_0x5c6a15){return function(_0x45c4b3){if(_0x45c4b3){return _0x45c4b3[_0x91cb('0x24')](_0x1dbee2)[_0x91cb('0x25')](function(_0x55fa78){return _0x55fa78;});}return null;};}function removeEntity(_0x26f18f,_0x1a7a54){return function(_0x2447e7){if(_0x2447e7){return _0x2447e7[_0x91cb('0x26')]()[_0x91cb('0x25')](function(){_0x26f18f[_0x91cb('0x1a')](0xcc)[_0x91cb('0x1b')]();});}};}function handleEntityNotFound(_0x423c4f,_0x264e9b){return function(_0x4c8438){if(!_0x4c8438){_0x423c4f['sendStatus'](0x194);}return _0x4c8438;};}function handleError(_0x234eb1,_0x554350){_0x554350=_0x554350||0x1f4;return function(_0x1c67d2){logger[_0x91cb('0x27')](_0x1c67d2[_0x91cb('0x28')]);if(_0x1c67d2['name']){delete _0x1c67d2[_0x91cb('0x29')];}_0x234eb1['status'](_0x554350)[_0x91cb('0x2a')](_0x1c67d2);};}exports[_0x91cb('0x2b')]=function(_0x3b3ee6,_0x2fb473){var _0x468908={},_0x504275={},_0x2f04a3={'count':0x0,'rows':[]};var _0x52670a=_[_0x91cb('0x2c')](db[_0x91cb('0x2d')][_0x91cb('0x2e')],function(_0x4944bd){return{'name':_0x4944bd[_0x91cb('0x2f')],'type':_0x4944bd[_0x91cb('0x30')][_0x91cb('0x31')]};});_0x504275[_0x91cb('0x32')]=_[_0x91cb('0x33')](_[_0x91cb('0x2c')](_0x52670a,_0x91cb('0x29')),[_0x91cb('0x34')]);_0x504275[_0x91cb('0x35')]=_['keys'](_0x3b3ee6[_0x91cb('0x35')]);_0x504275[_0x91cb('0x36')]=_[_0x91cb('0x37')](_0x504275[_0x91cb('0x32')],_0x504275[_0x91cb('0x35')]);_0x468908['attributes']=_[_0x91cb('0x37')](_0x504275[_0x91cb('0x32')],qs[_0x91cb('0x38')](_0x3b3ee6[_0x91cb('0x35')][_0x91cb('0x38')]));_0x468908['attributes']=_0x468908[_0x91cb('0x39')]['length']?_0x468908['attributes']:_0x504275['model'];if(!_0x3b3ee6[_0x91cb('0x35')]['hasOwnProperty'](_0x91cb('0x3a'))){_0x468908['limit']=qs['limit'](_0x3b3ee6[_0x91cb('0x35')][_0x91cb('0x1d')]);_0x468908[_0x91cb('0x1f')]=qs[_0x91cb('0x1f')](_0x3b3ee6[_0x91cb('0x35')]['offset']);}_0x468908[_0x91cb('0x3b')]=qs[_0x91cb('0x3c')](_0x3b3ee6[_0x91cb('0x35')][_0x91cb('0x3c')]);_0x468908['where']=qs['filters'](_[_0x91cb('0x3d')](_0x3b3ee6[_0x91cb('0x35')],_0x504275['filters']),_0x52670a);if(_0x3b3ee6[_0x91cb('0x35')][_0x91cb('0x3e')]){_0x468908['where']=_[_0x91cb('0x3f')](_0x468908[_0x91cb('0x40')],{'$or':_['map'](_0x52670a,function(_0x43d4fe){if(_0x43d4fe['type']!==_0x91cb('0x41')){var _0xabe6a3={};_0xabe6a3[_0x43d4fe[_0x91cb('0x29')]]={'$like':'%'+_0x3b3ee6[_0x91cb('0x35')][_0x91cb('0x3e')]+'%'};return _0xabe6a3;}})});}_0x468908=_[_0x91cb('0x3f')]({},_0x468908,_0x3b3ee6['options']);var _0xa90111={'where':_0x468908[_0x91cb('0x40')]};return db['ScreenRecording'][_0x91cb('0x1e')](_0xa90111)['then'](function(_0x2c6102){_0x2f04a3[_0x91cb('0x1e')]=_0x2c6102;if(_0x3b3ee6[_0x91cb('0x35')][_0x91cb('0x42')]){_0x468908['include']=[{'all':!![]}];}return db[_0x91cb('0x2d')][_0x91cb('0x43')](_0x468908);})[_0x91cb('0x25')](function(_0x37e777){_0x2f04a3[_0x91cb('0x44')]=_0x37e777;return _0x2f04a3;})[_0x91cb('0x25')](respondWithFilteredResult(_0x2fb473,_0x468908))[_0x91cb('0x45')](handleError(_0x2fb473,null));};exports[_0x91cb('0x46')]=function(_0x325dca,_0x3cc4c1){var _0x49bc42={'raw':![],'where':{'id':_0x325dca['params']['id']}},_0x16993f={};_0x16993f[_0x91cb('0x32')]=_['keys'](db[_0x91cb('0x2d')]['rawAttributes']);_0x16993f[_0x91cb('0x35')]=_[_0x91cb('0x47')](_0x325dca[_0x91cb('0x35')]);_0x16993f[_0x91cb('0x36')]=_['intersection'](_0x16993f[_0x91cb('0x32')],_0x16993f[_0x91cb('0x35')]);_0x49bc42['attributes']=_[_0x91cb('0x37')](_0x16993f[_0x91cb('0x32')],qs[_0x91cb('0x38')](_0x325dca[_0x91cb('0x35')][_0x91cb('0x38')]));_0x49bc42[_0x91cb('0x39')]=_0x49bc42[_0x91cb('0x39')][_0x91cb('0x48')]?_0x49bc42[_0x91cb('0x39')]:_0x16993f['model'];if(_0x325dca[_0x91cb('0x35')][_0x91cb('0x42')]){_0x49bc42[_0x91cb('0x49')]=[{'all':!![]}];}_0x49bc42=_[_0x91cb('0x3f')]({},_0x49bc42,_0x325dca[_0x91cb('0x4a')]);return db[_0x91cb('0x2d')][_0x91cb('0x4b')](_0x49bc42)[_0x91cb('0x25')](handleEntityNotFound(_0x3cc4c1,null))['then'](respondWithResult(_0x3cc4c1,null))[_0x91cb('0x45')](handleError(_0x3cc4c1,null));};exports[_0x91cb('0x4c')]=function(_0x2b8b7f,_0x3b8cfd){return db['ScreenRecording'][_0x91cb('0x4c')](_0x2b8b7f[_0x91cb('0x4d')],{})['then'](respondWithResult(_0x3b8cfd,0xc9))[_0x91cb('0x45')](handleError(_0x3b8cfd,null));};exports['update']=function(_0x2c419b,_0x4c0acd){if(_0x2c419b['body']['id']){delete _0x2c419b['body']['id'];}delete _0x2c419b[_0x91cb('0x4d')][_0x91cb('0x4e')];delete _0x2c419b[_0x91cb('0x4d')][_0x91cb('0x4f')];delete _0x2c419b[_0x91cb('0x4d')]['closedAt'];delete _0x2c419b['body'][_0x91cb('0x50')];return db[_0x91cb('0x2d')][_0x91cb('0x4b')]({'where':{'id':_0x2c419b[_0x91cb('0x51')]['id']}})['then'](handleEntityNotFound(_0x4c0acd,null))['then'](saveUpdates(_0x2c419b['body'],null))[_0x91cb('0x25')](respondWithResult(_0x4c0acd,null))['catch'](handleError(_0x4c0acd,null));};exports[_0x91cb('0x52')]=function(_0x4aa670,_0x21463a){return db[_0x91cb('0x2d')][_0x91cb('0x52')]()[_0x91cb('0x25')](respondWithResult(_0x21463a,null))[_0x91cb('0x45')](handleError(_0x21463a,null));};exports[_0x91cb('0x53')]=function(_0x3ec250,_0x30fd4e,_0xff7c3f){var _0x20fc0a=require(_0x91cb('0x54'));var _0x5752ed=![];var _0x1e445a={};if(_0x3ec250[_0x91cb('0x35')]['type']&&_0x3ec250[_0x91cb('0x35')][_0x91cb('0x30')]==='uniqueid'){_0x1e445a[_0x91cb('0x55')]=_0x3ec250[_0x91cb('0x51')]['id'];}else{_0x1e445a['id']=_0x3ec250[_0x91cb('0x51')]['id'];}return db[_0x91cb('0x2d')][_0x91cb('0x4b')]({'where':_0x1e445a,'attributes':['id',_0x91cb('0x50')],'raw':!![]})[_0x91cb('0x25')](handleEntityNotFound(_0x30fd4e,null))[_0x91cb('0x25')](function(_0x3320bd){if(_0x3320bd){var _0x93ef52=path[_0x91cb('0x56')](config['root'],_0x91cb('0x57'),_0x3320bd['value']);var _0x37221e=util['format'](_0x91cb('0x58'),_0x93ef52);if(fs[_0x91cb('0x59')](_0x37221e)){_0x5752ed=!![];return _0x20fc0a[_0x91cb('0x5a')](_0x37221e,_0x93ef52,config['secrets'][_0x91cb('0x5b')])[_0x91cb('0x25')](function(){return _0x3320bd;});}return _0x3320bd;}})['then'](function(_0xef4754){if(_0xef4754){var _0x102025=path[_0x91cb('0x56')](config[_0x91cb('0x5c')],'server/files/screen_recordings',_0xef4754[_0x91cb('0x50')]);if(!fs[_0x91cb('0x59')](_0x102025)){throw new db[(_0x91cb('0x5d'))][(_0x91cb('0x5e'))]('ScreenRecording\x20not\x20found');}if(_0xef4754[_0x91cb('0x5f')]){return _0x30fd4e[_0x91cb('0x53')](_0x102025,_0xef4754['filename']+path['extname'](_0x102025),function(){if(_0x5752ed){fs[_0x91cb('0x60')](_0x102025);}});}else{return _0x30fd4e['download'](_0x102025,function(_0x1180ac){if(_0x5752ed){fs[_0x91cb('0x60')](_0x102025);}});}}})['catch'](function(_0x4f19c8){if(_0x4f19c8[_0x91cb('0x61')]==='ScreenRecording\x20not\x20found'){_0x30fd4e[_0x91cb('0x1a')](0x194)[_0x91cb('0x2a')](_0x91cb('0x62'));}else{return handleError(_0x30fd4e,null);}});};exports['destroy']=function(_0x22fea8,_0x524400){return db[_0x91cb('0x2d')][_0x91cb('0x4b')]({'where':{'id':_0x22fea8[_0x91cb('0x51')]['id']}})[_0x91cb('0x25')](function(_0x483172){if(_[_0x91cb('0x63')](_0x483172)){throw new ReferenceError(_0x91cb('0x64'));}return _0x483172;})[_0x91cb('0x25')](function(_0x443c72){var _0xaf70c5=path[_0x91cb('0x56')](config[_0x91cb('0x5c')],_0x91cb('0x57'),_0x443c72[_0x91cb('0x50')]);logger[_0x91cb('0x65')](_0x91cb('0x66'),_0xaf70c5);if(!_[_0x91cb('0x63')](_0x443c72['value'])&&fs[_0x91cb('0x59')](_0xaf70c5)){logger[_0x91cb('0x65')](_0x91cb('0x67')+_0xaf70c5+_0x91cb('0x68'));fs[_0x91cb('0x69')](_0xaf70c5);}_0xaf70c5=_0xaf70c5+_0x91cb('0x6a');if(!_[_0x91cb('0x63')](_0x443c72['value'])&&fs[_0x91cb('0x59')](_0xaf70c5)){logger['info'](_0x91cb('0x67')+_0xaf70c5+_0x91cb('0x68'));fs[_0x91cb('0x69')](_0xaf70c5);}return _0x443c72;})[_0x91cb('0x25')](function(_0x48fcfe){if(!_0x48fcfe)throw new InternalError();return _0x48fcfe[_0x91cb('0x26')]();})[_0x91cb('0x25')](function(){_0x524400[_0x91cb('0x1a')](0xcc)[_0x91cb('0x1b')]();})[_0x91cb('0x45')](handleError(_0x524400,null));};
\ No newline at end of file
+var _0xb138=['format','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge','options','findAll','rows','catch','params','keys','includeAll','include','find','create','body','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model'];(function(_0x464bf8,_0x1af475){var _0x5e4ef7=function(_0x51d120){while(--_0x51d120){_0x464bf8['push'](_0x464bf8['shift']());}};_0x5e4ef7(++_0x1af475);}(_0xb138,0x1dd));var _0x8b13=function(_0x2a8ee5,_0x562354){_0x2a8ee5=_0x2a8ee5-0x0;var _0x58dc84=_0xb138[_0x2a8ee5];return _0x58dc84;};'use strict';var emlformat=require(_0x8b13('0x0'));var rimraf=require(_0x8b13('0x1'));var zipdir=require(_0x8b13('0x2'));var jsonpatch=require(_0x8b13('0x3'));var rp=require(_0x8b13('0x4'));var moment=require(_0x8b13('0x5'));var BPromise=require(_0x8b13('0x6'));var Mustache=require('mustache');var util=require(_0x8b13('0x7'));var path=require(_0x8b13('0x8'));var sox=require(_0x8b13('0x9'));var csv=require('to-csv');var ejs=require(_0x8b13('0xa'));var fs=require('fs');var fs_extra=require(_0x8b13('0xb'));var _=require('lodash');var squel=require(_0x8b13('0xc'));var crypto=require(_0x8b13('0xd'));var jsforce=require(_0x8b13('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8b13('0xf'));var querystring=require(_0x8b13('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8b13('0x11'));var qs=require(_0x8b13('0x12'));var as=require(_0x8b13('0x13'));var hardwareService=require(_0x8b13('0x14'));var logger=require(_0x8b13('0x15'))('api');var utils=require(_0x8b13('0x16'));var config=require(_0x8b13('0x17'));var licenseUtil=require(_0x8b13('0x18'));var db=require(_0x8b13('0x19'))['db'];function respondWithStatusCode(_0xb227e0,_0x1893b1){_0x1893b1=_0x1893b1||0xcc;return function(_0x58f97e){if(_0x58f97e){return _0xb227e0['sendStatus'](_0x1893b1);}return _0xb227e0[_0x8b13('0x1a')](_0x1893b1)[_0x8b13('0x1b')]();};}function respondWithResult(_0x5f12b5,_0x51a935){_0x51a935=_0x51a935||0xc8;return function(_0x479773){if(_0x479773){return _0x5f12b5[_0x8b13('0x1a')](_0x51a935)[_0x8b13('0x1c')](_0x479773);}};}function respondWithFilteredResult(_0xf29086,_0x2c615a){return function(_0x13f956){if(_0x13f956){var _0x542357=typeof _0x2c615a[_0x8b13('0x1d')]===_0x8b13('0x1e')&&typeof _0x2c615a[_0x8b13('0x1f')]===_0x8b13('0x1e');var _0x3eed21=_0x13f956[_0x8b13('0x20')];var _0x10fbde=_0x542357?0x0:_0x2c615a[_0x8b13('0x1d')];var _0x4989d3=_0x542357?_0x13f956['count']:_0x2c615a[_0x8b13('0x1d')]+_0x2c615a[_0x8b13('0x1f')];var _0x14a8ac;if(_0x4989d3>=_0x3eed21){_0x4989d3=_0x3eed21;_0x14a8ac=0xc8;}else{_0x14a8ac=0xce;}_0xf29086[_0x8b13('0x1a')](_0x14a8ac);return _0xf29086[_0x8b13('0x21')](_0x8b13('0x22'),_0x10fbde+'-'+_0x4989d3+'/'+_0x3eed21)['json'](_0x13f956);}return null;};}function patchUpdates(_0x1e8a48){return function(_0x3c4d4f){try{jsonpatch[_0x8b13('0x23')](_0x3c4d4f,_0x1e8a48,!![]);}catch(_0x54a309){return BPromise['reject'](_0x54a309);}return _0x3c4d4f[_0x8b13('0x24')]();};}function saveUpdates(_0xcb7621,_0x4f9902){return function(_0x3187ed){if(_0x3187ed){return _0x3187ed[_0x8b13('0x25')](_0xcb7621)[_0x8b13('0x26')](function(_0x213280){return _0x213280;});}return null;};}function removeEntity(_0xc05d5c,_0x583639){return function(_0x339271){if(_0x339271){return _0x339271[_0x8b13('0x27')]()['then'](function(){_0xc05d5c[_0x8b13('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x420772,_0x325d68){return function(_0x54786a){if(!_0x54786a){_0x420772[_0x8b13('0x28')](0x194);}return _0x54786a;};}function handleError(_0x3223d8,_0x4f8e58){_0x4f8e58=_0x4f8e58||0x1f4;return function(_0x134c5e){logger[_0x8b13('0x29')](_0x134c5e[_0x8b13('0x2a')]);if(_0x134c5e[_0x8b13('0x2b')]){delete _0x134c5e[_0x8b13('0x2b')];}_0x3223d8['status'](_0x4f8e58)[_0x8b13('0x2c')](_0x134c5e);};}exports[_0x8b13('0x2d')]=function(_0x3475d8,_0x1511bf){var _0x114b01={},_0x2bb51d={},_0x5ab161={'count':0x0,'rows':[]};var _0x35fdca=_[_0x8b13('0x2e')](db[_0x8b13('0x2f')][_0x8b13('0x30')],function(_0x23fde7){return{'name':_0x23fde7[_0x8b13('0x31')],'type':_0x23fde7[_0x8b13('0x32')][_0x8b13('0x33')]};});_0x2bb51d[_0x8b13('0x34')]=_['differenceBy'](_[_0x8b13('0x2e')](_0x35fdca,_0x8b13('0x2b')),[_0x8b13('0x35')]);_0x2bb51d[_0x8b13('0x36')]=_['keys'](_0x3475d8['query']);_0x2bb51d[_0x8b13('0x37')]=_['intersection'](_0x2bb51d['model'],_0x2bb51d[_0x8b13('0x36')]);_0x114b01['attributes']=_[_0x8b13('0x38')](_0x2bb51d[_0x8b13('0x34')],qs[_0x8b13('0x39')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x39')]));_0x114b01[_0x8b13('0x3a')]=_0x114b01[_0x8b13('0x3a')][_0x8b13('0x3b')]?_0x114b01[_0x8b13('0x3a')]:_0x2bb51d[_0x8b13('0x34')];if(!_0x3475d8['query'][_0x8b13('0x3c')](_0x8b13('0x3d'))){_0x114b01[_0x8b13('0x1f')]=qs[_0x8b13('0x1f')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x1f')]);_0x114b01[_0x8b13('0x1d')]=qs[_0x8b13('0x1d')](_0x3475d8['query'][_0x8b13('0x1d')]);}_0x114b01['order']=qs[_0x8b13('0x3e')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x3e')]);_0x114b01[_0x8b13('0x3f')]=qs[_0x8b13('0x37')](_[_0x8b13('0x40')](_0x3475d8['query'],_0x2bb51d['filters']),_0x35fdca);if(_0x3475d8[_0x8b13('0x36')]['filter']){_0x114b01[_0x8b13('0x3f')]=_['merge'](_0x114b01[_0x8b13('0x3f')],{'$or':_[_0x8b13('0x2e')](_0x35fdca,function(_0x29a359){if(_0x29a359[_0x8b13('0x32')]!==_0x8b13('0x41')){var _0x4e16e7={};_0x4e16e7[_0x29a359['name']]={'$like':'%'+_0x3475d8[_0x8b13('0x36')]['filter']+'%'};return _0x4e16e7;}})});}_0x114b01=_[_0x8b13('0x42')]({},_0x114b01,_0x3475d8[_0x8b13('0x43')]);var _0x4dc268={'where':_0x114b01[_0x8b13('0x3f')]};return db[_0x8b13('0x2f')][_0x8b13('0x20')](_0x4dc268)[_0x8b13('0x26')](function(_0x2f4e7f){_0x5ab161[_0x8b13('0x20')]=_0x2f4e7f;if(_0x3475d8[_0x8b13('0x36')]['includeAll']){_0x114b01['include']=[{'all':!![]}];}return db['ScreenRecording'][_0x8b13('0x44')](_0x114b01);})[_0x8b13('0x26')](function(_0x27cfe5){_0x5ab161[_0x8b13('0x45')]=_0x27cfe5;return _0x5ab161;})[_0x8b13('0x26')](respondWithFilteredResult(_0x1511bf,_0x114b01))[_0x8b13('0x46')](handleError(_0x1511bf,null));};exports['show']=function(_0x4342db,_0x50e535){var _0x13d0ef={'raw':![],'where':{'id':_0x4342db[_0x8b13('0x47')]['id']}},_0x5ce9c8={};_0x5ce9c8[_0x8b13('0x34')]=_[_0x8b13('0x48')](db[_0x8b13('0x2f')][_0x8b13('0x30')]);_0x5ce9c8[_0x8b13('0x36')]=_[_0x8b13('0x48')](_0x4342db['query']);_0x5ce9c8['filters']=_['intersection'](_0x5ce9c8[_0x8b13('0x34')],_0x5ce9c8[_0x8b13('0x36')]);_0x13d0ef[_0x8b13('0x3a')]=_[_0x8b13('0x38')](_0x5ce9c8['model'],qs['fields'](_0x4342db[_0x8b13('0x36')]['fields']));_0x13d0ef[_0x8b13('0x3a')]=_0x13d0ef[_0x8b13('0x3a')][_0x8b13('0x3b')]?_0x13d0ef[_0x8b13('0x3a')]:_0x5ce9c8[_0x8b13('0x34')];if(_0x4342db['query'][_0x8b13('0x49')]){_0x13d0ef[_0x8b13('0x4a')]=[{'all':!![]}];}_0x13d0ef=_[_0x8b13('0x42')]({},_0x13d0ef,_0x4342db[_0x8b13('0x43')]);return db[_0x8b13('0x2f')][_0x8b13('0x4b')](_0x13d0ef)[_0x8b13('0x26')](handleEntityNotFound(_0x50e535,null))[_0x8b13('0x26')](respondWithResult(_0x50e535,null))[_0x8b13('0x46')](handleError(_0x50e535,null));};exports['create']=function(_0x46d096,_0x59d863){return db[_0x8b13('0x2f')][_0x8b13('0x4c')](_0x46d096[_0x8b13('0x4d')],{})['then'](respondWithResult(_0x59d863,0xc9))[_0x8b13('0x46')](handleError(_0x59d863,null));};exports[_0x8b13('0x25')]=function(_0x257107,_0x4129c0){if(_0x257107[_0x8b13('0x4d')]['id']){delete _0x257107[_0x8b13('0x4d')]['id'];}delete _0x257107[_0x8b13('0x4d')]['duration'];delete _0x257107[_0x8b13('0x4d')]['createdAt'];delete _0x257107[_0x8b13('0x4d')][_0x8b13('0x4e')];delete _0x257107[_0x8b13('0x4d')][_0x8b13('0x4f')];return db[_0x8b13('0x2f')][_0x8b13('0x4b')]({'where':{'id':_0x257107[_0x8b13('0x47')]['id']}})[_0x8b13('0x26')](handleEntityNotFound(_0x4129c0,null))[_0x8b13('0x26')](saveUpdates(_0x257107[_0x8b13('0x4d')],null))[_0x8b13('0x26')](respondWithResult(_0x4129c0,null))[_0x8b13('0x46')](handleError(_0x4129c0,null));};exports[_0x8b13('0x50')]=function(_0x2bdfae,_0x42c29d){return db[_0x8b13('0x2f')][_0x8b13('0x50')]()['then'](respondWithResult(_0x42c29d,null))[_0x8b13('0x46')](handleError(_0x42c29d,null));};exports[_0x8b13('0x51')]=function(_0x4c19f6,_0x342fff,_0x328373){var _0x2fc00c=require(_0x8b13('0x52'));var _0x25cb45=![];var _0x12549b={};if(_0x4c19f6[_0x8b13('0x36')][_0x8b13('0x32')]&&_0x4c19f6[_0x8b13('0x36')][_0x8b13('0x32')]===_0x8b13('0x53')){_0x12549b[_0x8b13('0x53')]=_0x4c19f6[_0x8b13('0x47')]['id'];}else{_0x12549b['id']=_0x4c19f6[_0x8b13('0x47')]['id'];}return db[_0x8b13('0x2f')]['find']({'where':_0x12549b,'attributes':['id',_0x8b13('0x4f')],'raw':!![]})[_0x8b13('0x26')](handleEntityNotFound(_0x342fff,null))['then'](function(_0x11e8af){if(_0x11e8af){var _0x73aba5=path[_0x8b13('0x54')](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x11e8af['value']);var _0x1fd105=util[_0x8b13('0x35')](_0x8b13('0x57'),_0x73aba5);if(fs['existsSync'](_0x1fd105)){_0x25cb45=!![];return _0x2fc00c[_0x8b13('0x58')](_0x1fd105,_0x73aba5,config[_0x8b13('0x59')]['recording'])[_0x8b13('0x26')](function(){return _0x11e8af;});}return _0x11e8af;}})[_0x8b13('0x26')](function(_0x475c8d){if(_0x475c8d){var _0xd29067=path['join'](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x475c8d['value']);if(!fs[_0x8b13('0x5a')](_0xd29067)){throw new db[(_0x8b13('0x5b'))][(_0x8b13('0x5c'))](_0x8b13('0x5d'));}if(_0x475c8d['filename']){return _0x342fff[_0x8b13('0x51')](_0xd29067,_0x475c8d[_0x8b13('0x5e')]+path[_0x8b13('0x5f')](_0xd29067),function(){if(_0x25cb45){fs[_0x8b13('0x60')](_0xd29067);}});}else{return _0x342fff[_0x8b13('0x51')](_0xd29067,function(_0x2fff4e){if(_0x25cb45){fs['unlink'](_0xd29067);}});}}})[_0x8b13('0x46')](function(_0x1082d9){if(_0x1082d9[_0x8b13('0x61')]==='ScreenRecording\x20not\x20found'){_0x342fff[_0x8b13('0x1a')](0x194)[_0x8b13('0x2c')](_0x8b13('0x62'));}else{return handleError(_0x342fff,null);}});};exports[_0x8b13('0x27')]=function(_0x4d8f23,_0x59a6b3){return db['ScreenRecording']['find']({'where':{'id':_0x4d8f23['params']['id']}})[_0x8b13('0x26')](function(_0x1bc936){if(_['isNil'](_0x1bc936)){throw new ReferenceError(_0x8b13('0x63'));}return _0x1bc936;})['then'](function(_0x274bad){var _0x2d2fa3=path[_0x8b13('0x54')](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x274bad[_0x8b13('0x4f')]);logger[_0x8b13('0x64')]('cancellazione\x20fisica\x20documento\x20%s',_0x2d2fa3);if(!_[_0x8b13('0x65')](_0x274bad['value'])&&fs[_0x8b13('0x5a')](_0x2d2fa3)){logger[_0x8b13('0x64')](_0x8b13('0x66')+_0x2d2fa3+_0x8b13('0x67'));fs[_0x8b13('0x68')](_0x2d2fa3);}_0x2d2fa3=_0x2d2fa3+_0x8b13('0x69');if(!_[_0x8b13('0x65')](_0x274bad['value'])&&fs[_0x8b13('0x5a')](_0x2d2fa3)){logger['info'](_0x8b13('0x66')+_0x2d2fa3+_0x8b13('0x67'));fs[_0x8b13('0x68')](_0x2d2fa3);}return _0x274bad;})[_0x8b13('0x26')](function(_0x177a64){if(!_0x177a64)throw new InternalError();return _0x177a64['destroy']();})['then'](function(){_0x59a6b3[_0x8b13('0x1a')](0xcc)[_0x8b13('0x1b')]();})['catch'](handleError(_0x59a6b3,null));};
\ No newline at end of file
index 3823e54..9905680 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ea1=['api','moment','bluebird','request-promise','path','./screenRecording.attributes','exports','ScreenRecording','interactionid','lodash','util'];(function(_0x58795d,_0x4826af){var _0x4c7f8d=function(_0x4666e){while(--_0x4666e){_0x58795d['push'](_0x58795d['shift']());}};_0x4c7f8d(++_0x4826af);}(_0x6ea1,0x1b6));var _0x16ea=function(_0x46f3a8,_0x3d10bf){_0x46f3a8=_0x46f3a8-0x0;var _0x45918f=_0x6ea1[_0x46f3a8];return _0x45918f;};'use strict';var _=require(_0x16ea('0x0'));var util=require(_0x16ea('0x1'));var logger=require('../../config/logger')(_0x16ea('0x2'));var moment=require(_0x16ea('0x3'));var BPromise=require(_0x16ea('0x4'));var rp=require(_0x16ea('0x5'));var fs=require('fs');var path=require(_0x16ea('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x16ea('0x7'));module[_0x16ea('0x8')]=function(_0x1b137c,_0x33ebb4){return _0x1b137c['define'](_0x16ea('0x9'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x16ea('0xa'),'fields':[_0x16ea('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x23ef=['lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid'];(function(_0x406586,_0x405e97){var _0x453bf3=function(_0x396770){while(--_0x396770){_0x406586['push'](_0x406586['shift']());}};_0x453bf3(++_0x405e97);}(_0x23ef,0x179));var _0xf23e=function(_0x4366a3,_0x4e8c2f){_0x4366a3=_0x4366a3-0x0;var _0x357319=_0x23ef[_0x4366a3];return _0x357319;};'use strict';var _=require(_0xf23e('0x0'));var util=require(_0xf23e('0x1'));var logger=require(_0xf23e('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf23e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf23e('0x4'));var rimraf=require(_0xf23e('0x5'));var config=require(_0xf23e('0x6'));var attributes=require(_0xf23e('0x7'));module[_0xf23e('0x8')]=function(_0x57a972,_0x17f3fe){return _0x57a972[_0xf23e('0x9')](_0xf23e('0xa'),attributes,{'tableName':_0xf23e('0xb'),'paranoid':![],'indexes':[{'name':_0xf23e('0xc'),'fields':['interactionid']}],'timestamps':!![]});};
\ No newline at end of file
index 6ea97cd..ab0844f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6b4=['then','ScreenRecording,\x20%s,\x20%s','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3e083e,_0xb6ed4b){var _0x5ef262=function(_0x1a4d99){while(--_0x1a4d99){_0x3e083e['push'](_0x3e083e['shift']());}};_0x5ef262(++_0xb6ed4b);}(_0xf6b4,0x171));var _0x4f6b=function(_0x40c043,_0x1d064e){_0x40c043=_0x40c043-0x0;var _0x5c2c8d=_0xf6b4[_0x40c043];return _0x5c2c8d;};'use strict';var _=require(_0x4f6b('0x0'));var util=require(_0x4f6b('0x1'));var moment=require(_0x4f6b('0x2'));var BPromise=require(_0x4f6b('0x3'));var rs=require(_0x4f6b('0x4'));var fs=require('fs');var Redis=require(_0x4f6b('0x5'));var db=require(_0x4f6b('0x6'))['db'];var utils=require(_0x4f6b('0x7'));var logger=require(_0x4f6b('0x8'))(_0x4f6b('0x9'));var config=require(_0x4f6b('0xa'));var jayson=require(_0x4f6b('0xb'));var client=jayson[_0x4f6b('0xc')][_0x4f6b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x52d65c,_0x2356ab,_0xb9af97){return new BPromise(function(_0x338632,_0x890c23){return client[_0x4f6b('0xe')](_0x52d65c,_0xb9af97)[_0x4f6b('0xf')](function(_0x29fd54){logger['info'](_0x4f6b('0x10'),_0x2356ab,'request\x20sent');logger['debug'](_0x4f6b('0x11'),_0x2356ab,'request\x20sent',JSON[_0x4f6b('0x12')](_0x29fd54));if(_0x29fd54[_0x4f6b('0x13')]){if(_0x29fd54[_0x4f6b('0x13')][_0x4f6b('0x14')]===0x1f4){logger['error'](_0x4f6b('0x10'),_0x2356ab,_0x29fd54[_0x4f6b('0x13')][_0x4f6b('0x15')]);return _0x890c23(_0x29fd54['error'][_0x4f6b('0x15')]);}logger[_0x4f6b('0x13')]('ScreenRecording,\x20%s,\x20%s',_0x2356ab,_0x29fd54[_0x4f6b('0x13')]['message']);return _0x338632(_0x29fd54[_0x4f6b('0x13')][_0x4f6b('0x15')]);}else{logger['info'](_0x4f6b('0x10'),_0x2356ab,_0x4f6b('0x16'));_0x338632(_0x29fd54['result']['message']);}})[_0x4f6b('0x17')](function(_0x312f3){logger[_0x4f6b('0x13')](_0x4f6b('0x10'),_0x2356ab,_0x312f3);_0x890c23(_0x312f3);});});}
\ No newline at end of file
+var _0x6d24=['info','request\x20sent','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x10aad9,_0x6483d5){var _0x6108d2=function(_0x27a39e){while(--_0x27a39e){_0x10aad9['push'](_0x10aad9['shift']());}};_0x6108d2(++_0x6483d5);}(_0x6d24,0x68));var _0x46d2=function(_0x33cc25,_0x3a332e){_0x33cc25=_0x33cc25-0x0;var _0x8e1967=_0x6d24[_0x33cc25];return _0x8e1967;};'use strict';var _=require(_0x46d2('0x0'));var util=require(_0x46d2('0x1'));var moment=require(_0x46d2('0x2'));var BPromise=require(_0x46d2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x46d2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x46d2('0x5'))(_0x46d2('0x6'));var config=require('../../config/environment');var jayson=require(_0x46d2('0x7'));var client=jayson[_0x46d2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c7d70,_0x589772,_0x43fb68){return new BPromise(function(_0x45c55a,_0x5ca6f5){return client[_0x46d2('0x9')](_0x4c7d70,_0x43fb68)['then'](function(_0x521a93){logger[_0x46d2('0xa')]('ScreenRecording,\x20%s,\x20%s',_0x589772,'request\x20sent');logger['debug']('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x589772,_0x46d2('0xb'),JSON[_0x46d2('0xc')](_0x521a93));if(_0x521a93[_0x46d2('0xd')]){if(_0x521a93[_0x46d2('0xd')][_0x46d2('0xe')]===0x1f4){logger[_0x46d2('0xd')](_0x46d2('0xf'),_0x589772,_0x521a93['error']['message']);return _0x5ca6f5(_0x521a93['error'][_0x46d2('0x10')]);}logger[_0x46d2('0xd')](_0x46d2('0xf'),_0x589772,_0x521a93[_0x46d2('0xd')][_0x46d2('0x10')]);return _0x45c55a(_0x521a93[_0x46d2('0xd')][_0x46d2('0x10')]);}else{logger['info']('ScreenRecording,\x20%s,\x20%s',_0x589772,'request\x20sent');_0x45c55a(_0x521a93[_0x46d2('0x11')][_0x46d2('0x10')]);}})[_0x46d2('0x12')](function(_0x4e0c15){logger['error'](_0x46d2('0xf'),_0x589772,_0x4e0c15);_0x5ca6f5(_0x4e0c15);});});}
\ No newline at end of file
index 49b528e..ff68e81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa93d=['isAuthenticated','index','get','/now','/:id','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','getPreferred','getFavicon','diskStorage','join','%s%s','logo','originalname','post','single','file','root','server/files/images/logos/','logologin','extname','format','preferred','/:id/preferred','addPreferred','favicon','/:id/favicon','put','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller'];(function(_0x1521be,_0x34aa83){var _0x156a8e=function(_0x1b803c){while(--_0x1b803c){_0x1521be['push'](_0x1521be['shift']());}};_0x156a8e(++_0x34aa83);}(_0xa93d,0xe2));var _0xda93=function(_0x456717,_0x4e96eb){_0x456717=_0x456717-0x0;var _0x1bb0f4=_0xa93d[_0x456717];return _0x1bb0f4;};'use strict';var multer=require(_0xda93('0x0'));var util=require('util');var path=require(_0xda93('0x1'));var timeout=require(_0xda93('0x2'));var express=require('express');var router=express[_0xda93('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xda93('0x4'));var interaction=require(_0xda93('0x5'));var config=require(_0xda93('0x6'));var controller=require(_0xda93('0x7'));router['get']('/',auth[_0xda93('0x8')](),controller[_0xda93('0x9')]);router[_0xda93('0xa')](_0xda93('0xb'),controller['getDate']);router[_0xda93('0xa')](_0xda93('0xc'),controller['show']);router['get'](_0xda93('0xd'),controller[_0xda93('0xe')]);router[_0xda93('0xa')](_0xda93('0xf'),controller[_0xda93('0x10')]);router[_0xda93('0xa')](_0xda93('0x11'),controller['gdpr']);router[_0xda93('0xa')]('/:id/preferred',controller[_0xda93('0x12')]);router['get']('/:id/favicon',controller[_0xda93('0x13')]);var upload=multer({'storage':multer[_0xda93('0x14')]({'destination':function(_0x100ec1,_0x103950,_0x4a842c){_0x4a842c(null,path[_0xda93('0x15')](config['root'],'server/files/images/logos/'));},'filename':function(_0x17fe4e,_0x3e87b2,_0x574388){_0x574388(null,util['format'](_0xda93('0x16'),_0xda93('0x17'),path['extname'](_0x3e87b2[_0xda93('0x18')])));}})});router[_0xda93('0x19')](_0xda93('0xd'),upload[_0xda93('0x1a')](_0xda93('0x1b')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xba191f,_0x5cc258,_0x3b1634){_0x3b1634(null,path['join'](config[_0xda93('0x1c')],_0xda93('0x1d')));},'filename':function(_0x1be98c,_0x2937f2,_0xbf02c3){_0xbf02c3(null,util['format'](_0xda93('0x16'),_0xda93('0x1e'),path[_0xda93('0x1f')](_0x2937f2[_0xda93('0x18')])));}})});router[_0xda93('0x19')](_0xda93('0xf'),upload['single'](_0xda93('0x1b')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0xda93('0x14')]({'destination':function(_0x56d1b8,_0x455f89,_0x470202){_0x470202(null,path[_0xda93('0x15')](config['root'],_0xda93('0x1d')));},'filename':function(_0x26eb42,_0x154a6b,_0x58f502){_0x58f502(null,util[_0xda93('0x20')](_0xda93('0x16'),_0xda93('0x21'),path[_0xda93('0x1f')](_0x154a6b[_0xda93('0x18')])));}})});router[_0xda93('0x19')](_0xda93('0x22'),upload[_0xda93('0x1a')]('file'),controller[_0xda93('0x23')]);var upload=multer({'storage':multer[_0xda93('0x14')]({'destination':function(_0x2125f6,_0x1949fc,_0x5912cf){_0x5912cf(null,path[_0xda93('0x15')](config[_0xda93('0x1c')],_0xda93('0x1d')));},'filename':function(_0x12912e,_0xd6c425,_0x3835d4){_0x3835d4(null,util[_0xda93('0x20')](_0xda93('0x16'),_0xda93('0x24'),path[_0xda93('0x1f')](_0xd6c425[_0xda93('0x18')])));}})});router[_0xda93('0x19')](_0xda93('0x25'),upload['single']('file'),controller['addFavicon']);router[_0xda93('0x26')](_0xda93('0xc'),auth[_0xda93('0x8')](),controller['update']);module['exports']=router;
\ No newline at end of file
+var _0xe0ce=['index','/now','getDate','/:id','show','getLogo','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','/:id/favicon','getFavicon','diskStorage','root','server/files/images/logos/','format','%s%s','originalname','post','/:id/logo','file','addLogo','join','logologin','/:id/logo_login','single','addLogoLogin','preferred','addPreferred','favicon','extname','put','update','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xe0ce,0x1b7));var _0xee0c=function(_0x3e8bf8,_0x4e76d6){_0x3e8bf8=_0x3e8bf8-0x0;var _0x3391ce=_0xe0ce[_0x3e8bf8];return _0x3391ce;};'use strict';var multer=require(_0xee0c('0x0'));var util=require('util');var path=require(_0xee0c('0x1'));var timeout=require(_0xee0c('0x2'));var express=require(_0xee0c('0x3'));var router=express[_0xee0c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xee0c('0x5'));var interaction=require(_0xee0c('0x6'));var config=require(_0xee0c('0x7'));var controller=require(_0xee0c('0x8'));router[_0xee0c('0x9')]('/',auth[_0xee0c('0xa')](),controller[_0xee0c('0xb')]);router['get'](_0xee0c('0xc'),controller[_0xee0c('0xd')]);router[_0xee0c('0x9')](_0xee0c('0xe'),controller[_0xee0c('0xf')]);router[_0xee0c('0x9')]('/:id/logo',controller[_0xee0c('0x10')]);router['get']('/:id/logo_login',controller[_0xee0c('0x11')]);router[_0xee0c('0x9')](_0xee0c('0x12'),controller[_0xee0c('0x13')]);router[_0xee0c('0x9')](_0xee0c('0x14'),controller['getPreferred']);router[_0xee0c('0x9')](_0xee0c('0x15'),controller[_0xee0c('0x16')]);var upload=multer({'storage':multer[_0xee0c('0x17')]({'destination':function(_0x56f55f,_0x2214b1,_0xb5cc84){_0xb5cc84(null,path['join'](config[_0xee0c('0x18')],_0xee0c('0x19')));},'filename':function(_0x86ce5b,_0x4ee4b8,_0x381bf5){_0x381bf5(null,util[_0xee0c('0x1a')](_0xee0c('0x1b'),'logo',path['extname'](_0x4ee4b8[_0xee0c('0x1c')])));}})});router[_0xee0c('0x1d')](_0xee0c('0x1e'),upload['single'](_0xee0c('0x1f')),controller[_0xee0c('0x20')]);var upload=multer({'storage':multer[_0xee0c('0x17')]({'destination':function(_0x3b9232,_0x19e3dc,_0x386ba2){_0x386ba2(null,path[_0xee0c('0x21')](config['root'],_0xee0c('0x19')));},'filename':function(_0x6c2c9a,_0x5dbc5e,_0x5b6fff){_0x5b6fff(null,util['format'](_0xee0c('0x1b'),_0xee0c('0x22'),path['extname'](_0x5dbc5e['originalname'])));}})});router[_0xee0c('0x1d')](_0xee0c('0x23'),upload[_0xee0c('0x24')](_0xee0c('0x1f')),controller[_0xee0c('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x158c93,_0x3ca39d,_0x3d40e2){_0x3d40e2(null,path[_0xee0c('0x21')](config['root'],_0xee0c('0x19')));},'filename':function(_0x2fd8ff,_0x119dfe,_0x43610c){_0x43610c(null,util[_0xee0c('0x1a')]('%s%s',_0xee0c('0x26'),path['extname'](_0x119dfe[_0xee0c('0x1c')])));}})});router[_0xee0c('0x1d')](_0xee0c('0x14'),upload[_0xee0c('0x24')](_0xee0c('0x1f')),controller[_0xee0c('0x27')]);var upload=multer({'storage':multer[_0xee0c('0x17')]({'destination':function(_0x54ba85,_0x27ceb1,_0x1c831f){_0x1c831f(null,path[_0xee0c('0x21')](config[_0xee0c('0x18')],_0xee0c('0x19')));},'filename':function(_0x3865d7,_0x3c3486,_0x8394e8){_0x8394e8(null,util[_0xee0c('0x1a')](_0xee0c('0x1b'),_0xee0c('0x28'),path[_0xee0c('0x29')](_0x3c3486['originalname'])));}})});router[_0xee0c('0x1d')]('/:id/favicon',upload['single'](_0xee0c('0x1f')),controller['addFavicon']);router[_0xee0c('0x2a')](_0xee0c('0xe'),auth[_0xee0c('0xa')](),controller[_0xee0c('0x2b')]);module[_0xee0c('0x2c')]=router;
\ No newline at end of file
index 1687642..1f60678 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['INTEGER','min_internal','min_mailbox','STRING','BOOLEAN','alternate','UNSIGNED','sequelize','exports'];(function(_0x6752d0,_0xbb1c54){var _0x1bd082=function(_0x3fe7d9){while(--_0x3fe7d9){_0x6752d0['push'](_0x6752d0['shift']());}};_0x1bd082(++_0xbb1c54);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5a6a6c,_0x712963){_0x5a6a6c=_0x5a6a6c-0x0;var _0x8299df=_0x5f2f[_0x5a6a6c];return _0x8299df;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'min_internal':{'type':Sequelize[_0xf5f2('0x2')](0xb),'unique':_0xf5f2('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xf5f2('0x2')](0xb),'unique':_0xf5f2('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xf5f2('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xf5f2('0x5')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xf5f2('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xf5f2('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xf5f2('0x5')]},'turnaddr':{'type':Sequelize[_0xf5f2('0x5')]},'turnusername':{'type':Sequelize[_0xf5f2('0x5')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0xf5f2('0x5')]},'defaultPageTitle':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xf5f2('0x5')],'defaultValue':_0xf5f2('0x7')},'chatTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xf5f2('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xf5f2('0x2')]},'transcribeRegion':{'type':Sequelize[_0xf5f2('0x5')]},'sentiment':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xf5f2('0x2')]},'sentimentRegion':{'type':Sequelize[_0xf5f2('0x5')]},'language':{'type':Sequelize[_0xf5f2('0x5')]},'bucket':{'type':Sequelize[_0xf5f2('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xf5f2('0x2')](0x2)[_0xf5f2('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xf5f2('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xf5f2('0x2')](0x2)[_0xf5f2('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]}};
\ No newline at end of file
+var _0x5f2f=['INTEGER','min_internal','min_mailbox','STRING','BOOLEAN','alternate','UNSIGNED','sequelize','exports'];(function(_0xdab073,_0x52d0b3){var _0x5082db=function(_0x224b76){while(--_0x224b76){_0xdab073['push'](_0xdab073['shift']());}};_0x5082db(++_0x52d0b3);}(_0x5f2f,0x73));var _0xf5f2=function(_0x6e79ca,_0x536e91){_0x6e79ca=_0x6e79ca-0x0;var _0x2884ec=_0x5f2f[_0x6e79ca];return _0x2884ec;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'min_internal':{'type':Sequelize[_0xf5f2('0x2')](0xb),'unique':_0xf5f2('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xf5f2('0x2')](0xb),'unique':_0xf5f2('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xf5f2('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xf5f2('0x5')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xf5f2('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xf5f2('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xf5f2('0x5')]},'turnaddr':{'type':Sequelize[_0xf5f2('0x5')]},'turnusername':{'type':Sequelize[_0xf5f2('0x5')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0xf5f2('0x5')]},'defaultPageTitle':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xf5f2('0x5')],'defaultValue':_0xf5f2('0x7')},'chatTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xf5f2('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xf5f2('0x2')]},'transcribeRegion':{'type':Sequelize[_0xf5f2('0x5')]},'sentiment':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xf5f2('0x2')]},'sentimentRegion':{'type':Sequelize[_0xf5f2('0x5')]},'language':{'type':Sequelize[_0xf5f2('0x5')]},'bucket':{'type':Sequelize[_0xf5f2('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xf5f2('0x2')](0x2)[_0xf5f2('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xf5f2('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xf5f2('0x2')](0x2)[_0xf5f2('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]}};
\ No newline at end of file
index d81b93b..46b58a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8b2=['http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','Setting','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','params','body','addLogo','file','filename','logo','find','loginLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','ValidationError','upperFirst','\x20not\x20found','download','getLogoLogin','default_loginLogo.svg','custom','gdpr','securePassword','getPreferred','default_preferred.png','Sequelize','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise'];(function(_0x307d80,_0x2b74e7){var _0x47b263=function(_0x3a0986){while(--_0x3a0986){_0x307d80['push'](_0x307d80['shift']());}};_0x47b263(++_0x2b74e7);}(_0xf8b2,0x15e));var _0x2f8b=function(_0xdd0f2c,_0x47d12a){_0xdd0f2c=_0xdd0f2c-0x0;var _0xeeba3=_0xf8b2[_0xdd0f2c];return _0xeeba3;};'use strict';var emlformat=require(_0x2f8b('0x0'));var rimraf=require(_0x2f8b('0x1'));var zipdir=require(_0x2f8b('0x2'));var jsonpatch=require(_0x2f8b('0x3'));var rp=require(_0x2f8b('0x4'));var moment=require(_0x2f8b('0x5'));var BPromise=require(_0x2f8b('0x6'));var Mustache=require(_0x2f8b('0x7'));var util=require('util');var path=require('path');var sox=require(_0x2f8b('0x8'));var csv=require(_0x2f8b('0x9'));var ejs=require(_0x2f8b('0xa'));var fs=require('fs');var fs_extra=require(_0x2f8b('0xb'));var _=require(_0x2f8b('0xc'));var squel=require(_0x2f8b('0xd'));var crypto=require(_0x2f8b('0xe'));var jsforce=require(_0x2f8b('0xf'));var deskjs=require(_0x2f8b('0x10'));var toCsv=require('to-csv');var querystring=require(_0x2f8b('0x11'));var Papa=require(_0x2f8b('0x12'));var Redis=require(_0x2f8b('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x2f8b('0x14'));var as=require(_0x2f8b('0x15'));var hardwareService=require(_0x2f8b('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x2f8b('0x17'));var config=require(_0x2f8b('0x18'));var licenseUtil=require(_0x2f8b('0x19'));var db=require(_0x2f8b('0x1a'))['db'];var jayson=require(_0x2f8b('0x1b'));var client=jayson['client'][_0x2f8b('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x4d75d1,_0x40c097,_0x5e9eb1,_0x1b6a17){return new BPromise(function(_0x15634,_0xf9cbe0){var _0x19d5b3=_0x1b6a17||client;return _0x19d5b3[_0x2f8b('0x1d')](_0x4d75d1,_0x5e9eb1)[_0x2f8b('0x1e')](function(_0x532fe4){logger[_0x2f8b('0x1f')](_0x2f8b('0x20'),_0x40c097,_0x2f8b('0x21'));logger[_0x2f8b('0x22')](_0x2f8b('0x23'),_0x40c097,_0x2f8b('0x21'),JSON[_0x2f8b('0x24')](_0x532fe4));if(_0x532fe4[_0x2f8b('0x25')]){if(_0x532fe4[_0x2f8b('0x25')]['code']===0x1f4){logger[_0x2f8b('0x25')](_0x2f8b('0x20'),_0x40c097,_0x532fe4[_0x2f8b('0x25')]['message']);return _0xf9cbe0(_0x532fe4[_0x2f8b('0x25')]['message']);}logger[_0x2f8b('0x25')](_0x2f8b('0x20'),_0x40c097,_0x532fe4[_0x2f8b('0x25')][_0x2f8b('0x26')]);return _0x15634(_0x532fe4[_0x2f8b('0x25')]['message']);}else{logger[_0x2f8b('0x1f')](_0x2f8b('0x20'),_0x40c097,_0x2f8b('0x21'));_0x15634(_0x532fe4[_0x2f8b('0x27')][_0x2f8b('0x26')]);}})[_0x2f8b('0x28')](function(_0x68e81f){logger['error'](_0x2f8b('0x20'),_0x40c097,_0x68e81f);_0xf9cbe0(_0x68e81f);});});}function respondWithStatusCode(_0x23f73c,_0x3560c4){_0x3560c4=_0x3560c4||0xcc;return function(_0x41e12b){if(_0x41e12b){return _0x23f73c[_0x2f8b('0x29')](_0x3560c4);}return _0x23f73c['status'](_0x3560c4)[_0x2f8b('0x2a')]();};}function respondWithResult(_0xa30bd3,_0x152492){_0x152492=_0x152492||0xc8;return function(_0x46a95a){if(_0x46a95a){return _0xa30bd3[_0x2f8b('0x2b')](_0x152492)[_0x2f8b('0x2c')](_0x46a95a);}};}function respondWithFilteredResult(_0x45e313,_0x347f5a){return function(_0x4145b3){if(_0x4145b3){var _0x5642a2=typeof _0x347f5a[_0x2f8b('0x2d')]==='undefined'&&typeof _0x347f5a[_0x2f8b('0x2e')]===_0x2f8b('0x2f');var _0x16dab9=_0x4145b3[_0x2f8b('0x30')];var _0x72b23b=_0x5642a2?0x0:_0x347f5a['offset'];var _0x2cfbea=_0x5642a2?_0x4145b3['count']:_0x347f5a['offset']+_0x347f5a[_0x2f8b('0x2e')];var _0x294428;if(_0x2cfbea>=_0x16dab9){_0x2cfbea=_0x16dab9;_0x294428=0xc8;}else{_0x294428=0xce;}_0x45e313['status'](_0x294428);return _0x45e313[_0x2f8b('0x31')](_0x2f8b('0x32'),_0x72b23b+'-'+_0x2cfbea+'/'+_0x16dab9)[_0x2f8b('0x2c')](_0x4145b3);}return null;};}function patchUpdates(_0x9f39bc){return function(_0x1fe3d0){try{jsonpatch[_0x2f8b('0x33')](_0x1fe3d0,_0x9f39bc,!![]);}catch(_0x5b2879){return BPromise[_0x2f8b('0x34')](_0x5b2879);}return _0x1fe3d0[_0x2f8b('0x35')]();};}function saveUpdates(_0x296eac,_0x3279dc){return function(_0x1f886f){if(_0x1f886f){return _0x1f886f[_0x2f8b('0x36')](_0x296eac)[_0x2f8b('0x1e')](function(_0x58f30a){return _0x58f30a;});}return null;};}function removeEntity(_0x2e5510,_0x5593b0){return function(_0x24dec6){if(_0x24dec6){return _0x24dec6[_0x2f8b('0x37')]()[_0x2f8b('0x1e')](function(){_0x2e5510[_0x2f8b('0x2b')](0xcc)[_0x2f8b('0x2a')]();});}};}function handleEntityNotFound(_0x36c269,_0x407c2f){return function(_0x2e9786){if(!_0x2e9786){_0x36c269[_0x2f8b('0x29')](0x194);}return _0x2e9786;};}function handleError(_0x55970e,_0x5d3343){_0x5d3343=_0x5d3343||0x1f4;return function(_0x404f48){logger[_0x2f8b('0x25')](_0x404f48[_0x2f8b('0x38')]);if(_0x404f48[_0x2f8b('0x39')]){delete _0x404f48['name'];}_0x55970e[_0x2f8b('0x2b')](_0x5d3343)[_0x2f8b('0x3a')](_0x404f48);};}exports[_0x2f8b('0x3b')]=function(_0x270f1c,_0x23a53d){var _0x523419={},_0x56c05c={},_0x179952={'count':0x0,'rows':[]};var _0x25c805=_[_0x2f8b('0x3c')](db[_0x2f8b('0x3d')][_0x2f8b('0x3e')],function(_0x280745){return{'name':_0x280745[_0x2f8b('0x3f')],'type':_0x280745['type'][_0x2f8b('0x40')]};});_0x56c05c[_0x2f8b('0x41')]=_['map'](_0x25c805,_0x2f8b('0x39'));_0x56c05c[_0x2f8b('0x42')]=_[_0x2f8b('0x43')](_0x270f1c['query']);_0x56c05c[_0x2f8b('0x44')]=_[_0x2f8b('0x45')](_0x56c05c['model'],_0x56c05c[_0x2f8b('0x42')]);_0x523419[_0x2f8b('0x46')]=_['intersection'](_0x56c05c[_0x2f8b('0x41')],qs['fields'](_0x270f1c[_0x2f8b('0x42')][_0x2f8b('0x47')]));_0x523419['attributes']=_0x523419[_0x2f8b('0x46')][_0x2f8b('0x48')]?_0x523419[_0x2f8b('0x46')]:_0x56c05c['model'];if(!_0x270f1c[_0x2f8b('0x42')]['hasOwnProperty'](_0x2f8b('0x49'))){_0x523419[_0x2f8b('0x2e')]=qs[_0x2f8b('0x2e')](_0x270f1c[_0x2f8b('0x42')][_0x2f8b('0x2e')]);_0x523419[_0x2f8b('0x2d')]=qs[_0x2f8b('0x2d')](_0x270f1c[_0x2f8b('0x42')][_0x2f8b('0x2d')]);}_0x523419[_0x2f8b('0x4a')]=qs[_0x2f8b('0x4b')](_0x270f1c[_0x2f8b('0x42')][_0x2f8b('0x4b')]);_0x523419[_0x2f8b('0x4c')]=qs[_0x2f8b('0x44')](_[_0x2f8b('0x4d')](_0x270f1c[_0x2f8b('0x42')],_0x56c05c[_0x2f8b('0x44')]),_0x25c805);if(_0x270f1c[_0x2f8b('0x42')][_0x2f8b('0x4e')]){_0x523419[_0x2f8b('0x4c')]=_[_0x2f8b('0x4f')](_0x523419[_0x2f8b('0x4c')],{'$or':_[_0x2f8b('0x3c')](_0x25c805,function(_0x470015){if(_0x470015['type']!=='VIRTUAL'){var _0x5089d0={};_0x5089d0[_0x470015[_0x2f8b('0x39')]]={'$like':'%'+_0x270f1c['query'][_0x2f8b('0x4e')]+'%'};return _0x5089d0;}})});}_0x523419=_[_0x2f8b('0x4f')]({},_0x523419,_0x270f1c[_0x2f8b('0x50')]);var _0x5f0a8d={'where':_0x523419[_0x2f8b('0x4c')]};return db['Setting'][_0x2f8b('0x30')](_0x5f0a8d)['then'](function(_0x376f60){_0x179952[_0x2f8b('0x30')]=_0x376f60;if(_0x270f1c['query'][_0x2f8b('0x51')]){_0x523419[_0x2f8b('0x52')]=[{'all':!![]}];}return db[_0x2f8b('0x3d')][_0x2f8b('0x53')](_0x523419);})[_0x2f8b('0x1e')](function(_0x465d59){_0x179952[_0x2f8b('0x54')]=_0x465d59;return _0x179952;})[_0x2f8b('0x1e')](respondWithFilteredResult(_0x23a53d,_0x523419))[_0x2f8b('0x28')](handleError(_0x23a53d,null));};exports['show']=function(_0x2fdc75,_0x1fe33d){var _0x2d79f9={'raw':![],'where':{'id':_0x2fdc75[_0x2f8b('0x55')]['id']}},_0x1bb257={};_0x1bb257['model']=_[_0x2f8b('0x43')](db[_0x2f8b('0x3d')][_0x2f8b('0x3e')]);_0x1bb257['query']=_[_0x2f8b('0x43')](_0x2fdc75['query']);_0x1bb257[_0x2f8b('0x44')]=_[_0x2f8b('0x45')](_0x1bb257[_0x2f8b('0x41')],_0x1bb257[_0x2f8b('0x42')]);_0x2d79f9[_0x2f8b('0x46')]=_['intersection'](_0x1bb257['model'],qs['fields'](_0x2fdc75[_0x2f8b('0x42')][_0x2f8b('0x47')]));_0x2d79f9[_0x2f8b('0x46')]=_0x2d79f9[_0x2f8b('0x46')]['length']?_0x2d79f9['attributes']:_0x1bb257[_0x2f8b('0x41')];if(_0x2fdc75[_0x2f8b('0x42')][_0x2f8b('0x51')]){_0x2d79f9[_0x2f8b('0x52')]=[{'all':!![]}];}_0x2d79f9=_['merge']({},_0x2d79f9,_0x2fdc75[_0x2f8b('0x50')]);return db[_0x2f8b('0x3d')]['find'](_0x2d79f9)[_0x2f8b('0x1e')](handleEntityNotFound(_0x1fe33d,null))['then'](respondWithResult(_0x1fe33d,null))[_0x2f8b('0x28')](handleError(_0x1fe33d,null));};exports['update']=function(_0x2d3f1e,_0x1684db){if(_0x2d3f1e[_0x2f8b('0x56')]['id']){delete _0x2d3f1e['body']['id'];}return db[_0x2f8b('0x3d')]['find']({'where':{'id':_0x2d3f1e[_0x2f8b('0x55')]['id']}})['then'](handleEntityNotFound(_0x1684db,null))[_0x2f8b('0x1e')](saveUpdates(_0x2d3f1e[_0x2f8b('0x56')],null))[_0x2f8b('0x1e')](respondWithResult(_0x1684db,null))[_0x2f8b('0x28')](handleError(_0x1684db,null));};exports[_0x2f8b('0x57')]=function(_0xd1acee,_0x40457b,_0x132e8b){if(_0xd1acee['file']&&_0xd1acee[_0x2f8b('0x58')][_0x2f8b('0x59')]){_0xd1acee[_0x2f8b('0x56')][_0x2f8b('0x5a')]=_0xd1acee[_0x2f8b('0x58')][_0x2f8b('0x59')];}return db[_0x2f8b('0x3d')][_0x2f8b('0x5b')]({'where':{'id':_0xd1acee[_0x2f8b('0x55')]['id']}})[_0x2f8b('0x1e')](handleEntityNotFound(_0x40457b,null))[_0x2f8b('0x1e')](saveUpdates(_0xd1acee[_0x2f8b('0x56')],null))['then'](respondWithResult(_0x40457b,null))[_0x2f8b('0x28')](handleError(_0x40457b,null));};exports['addLogoLogin']=function(_0x2873fc,_0x390793,_0x3673ea){if(_0x2873fc[_0x2f8b('0x58')]&&_0x2873fc[_0x2f8b('0x58')]['filename']){_0x2873fc[_0x2f8b('0x56')][_0x2f8b('0x5c')]=_0x2873fc[_0x2f8b('0x58')][_0x2f8b('0x59')];}return db['Setting']['find']({'where':{'id':_0x2873fc[_0x2f8b('0x55')]['id']}})[_0x2f8b('0x1e')](handleEntityNotFound(_0x390793,null))[_0x2f8b('0x1e')](saveUpdates(_0x2873fc[_0x2f8b('0x56')],null))['then'](respondWithResult(_0x390793,null))[_0x2f8b('0x28')](handleError(_0x390793,null));};var utilLicense=require(_0x2f8b('0x19'));exports['getLogo']=function(_0x4c502d,_0x50246b,_0x3ff35d){var _0x5c4b6f=_0x2f8b('0x5d');var _0x61e2b1={'custom':![]};return utilLicense[_0x2f8b('0x5e')]()[_0x2f8b('0x1e')](function(_0x3dbd82){if(_0x3dbd82){_0x61e2b1=_0x3dbd82;}return db[_0x2f8b('0x3d')][_0x2f8b('0x5b')]({'where':{'id':_0x4c502d[_0x2f8b('0x55')]['id']},'attributes':['logo','loginLogo',_0x2f8b('0x5f'),_0x2f8b('0x60'),_0x2f8b('0x61'),_0x2f8b('0x62'),_0x2f8b('0x63'),_0x2f8b('0x64')],'raw':!![]});})[_0x2f8b('0x1e')](handleEntityNotFound(_0x50246b,null))[_0x2f8b('0x1e')](function(_0x4271a4){if(_0x4271a4){var _0x32cae9=_0x4271a4['logo']&&fs[_0x2f8b('0x65')](path[_0x2f8b('0x66')](config[_0x2f8b('0x67')],_0x5c4b6f,_[_0x2f8b('0x68')](_0x4271a4[_0x2f8b('0x5a')])))?path['join'](config[_0x2f8b('0x67')],_0x5c4b6f,_[_0x2f8b('0x68')](_0x4271a4['logo'])):path[_0x2f8b('0x66')](config['root'],_0x5c4b6f,_['toLower'](_0x2f8b('0x69')));var _0x37ffde=_0x2f8b('0x6a')+_['upperFirst'](_0x2f8b('0x5a'));if(_0x4271a4[_0x37ffde]||!_0x61e2b1['custom']){_0x32cae9=path[_0x2f8b('0x66')](config[_0x2f8b('0x67')],_0x5c4b6f,_[_0x2f8b('0x68')]('default_logo.svg'));}if(!fs[_0x2f8b('0x65')](_0x32cae9)){throw new db['Sequelize'][(_0x2f8b('0x6b'))](_[_0x2f8b('0x6c')]('logo')+_0x2f8b('0x6d'));}return _0x50246b[_0x2f8b('0x6e')](_0x32cae9);}})[_0x2f8b('0x28')](handleError(_0x50246b,null));};var utilLicense=require('../../config/license/util');exports[_0x2f8b('0x6f')]=function(_0x3c61d2,_0x174b21,_0x17c7e5){var _0x53f254=_0x2f8b('0x5d');var _0x385e90={'custom':![]};return utilLicense['getLicense']()[_0x2f8b('0x1e')](function(_0x4c006a){if(_0x4c006a){_0x385e90=_0x4c006a;}return db[_0x2f8b('0x3d')][_0x2f8b('0x5b')]({'where':{'id':_0x3c61d2['params']['id']},'attributes':['logo','loginLogo',_0x2f8b('0x5f'),_0x2f8b('0x60'),'defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x174b21,null))['then'](function(_0x450163){if(_0x450163){var _0xd34319=_0x450163[_0x2f8b('0x5c')]&&fs[_0x2f8b('0x65')](path[_0x2f8b('0x66')](config['root'],_0x53f254,_['toLower'](_0x450163[_0x2f8b('0x5c')])))?path[_0x2f8b('0x66')](config[_0x2f8b('0x67')],_0x53f254,_['toLower'](_0x450163['loginLogo'])):path['join'](config[_0x2f8b('0x67')],_0x53f254,_[_0x2f8b('0x68')](_0x2f8b('0x70')));var _0x4c4fbc=_0x2f8b('0x6a')+_[_0x2f8b('0x6c')](_0x2f8b('0x5c'));if(_0x450163[_0x4c4fbc]||!_0x385e90[_0x2f8b('0x71')]){_0xd34319=path[_0x2f8b('0x66')](config[_0x2f8b('0x67')],_0x53f254,_['toLower'](_0x2f8b('0x70')));}if(!fs[_0x2f8b('0x65')](_0xd34319)){throw new db['Sequelize'][(_0x2f8b('0x6b'))](_[_0x2f8b('0x6c')](_0x2f8b('0x5c'))+_0x2f8b('0x6d'));}return _0x174b21[_0x2f8b('0x6e')](_0xd34319);}})[_0x2f8b('0x28')](handleError(_0x174b21,null));};exports[_0x2f8b('0x72')]=function(_0x374067,_0x47d2ca){return db[_0x2f8b('0x3d')]['find']({'where':{'id':_0x374067[_0x2f8b('0x55')]['id']},'attributes':[_0x2f8b('0x73')]})['then'](respondWithResult(_0x47d2ca,null))[_0x2f8b('0x28')](handleError(_0x47d2ca,null));};exports['addPreferred']=function(_0x1097cc,_0x2432cd,_0x1ebbc8){if(_0x1097cc[_0x2f8b('0x58')]&&_0x1097cc['file'][_0x2f8b('0x59')]){_0x1097cc['body']['preferred']=_0x1097cc[_0x2f8b('0x58')][_0x2f8b('0x59')];}return db[_0x2f8b('0x3d')][_0x2f8b('0x5b')]({'where':{'id':_0x1097cc[_0x2f8b('0x55')]['id']}})[_0x2f8b('0x1e')](handleEntityNotFound(_0x2432cd,null))[_0x2f8b('0x1e')](saveUpdates(_0x1097cc[_0x2f8b('0x56')],null))['then'](respondWithResult(_0x2432cd,null))[_0x2f8b('0x28')](handleError(_0x2432cd,null));};var utilLicense=require(_0x2f8b('0x19'));exports[_0x2f8b('0x74')]=function(_0x45b128,_0x406ece,_0x381019){var _0x14f293='server/files/images/logos';var _0x292198={'custom':![]};return utilLicense['getLicense']()[_0x2f8b('0x1e')](function(_0x2ab594){if(_0x2ab594){_0x292198=_0x2ab594;}return db['Setting'][_0x2f8b('0x5b')]({'where':{'id':_0x45b128[_0x2f8b('0x55')]['id']},'attributes':[_0x2f8b('0x5a'),_0x2f8b('0x5c'),_0x2f8b('0x5f'),_0x2f8b('0x60'),'defaultLogo',_0x2f8b('0x62'),'defaultPreferred',_0x2f8b('0x64')],'raw':!![]});})['then'](handleEntityNotFound(_0x406ece,null))['then'](function(_0x260d55){if(_0x260d55){var _0x7e9f7=_0x260d55[_0x2f8b('0x5f')]&&fs[_0x2f8b('0x65')](path[_0x2f8b('0x66')](config[_0x2f8b('0x67')],_0x14f293,_[_0x2f8b('0x68')](_0x260d55[_0x2f8b('0x5f')])))?path[_0x2f8b('0x66')](config[_0x2f8b('0x67')],_0x14f293,_[_0x2f8b('0x68')](_0x260d55[_0x2f8b('0x5f')])):path[_0x2f8b('0x66')](config[_0x2f8b('0x67')],_0x14f293,_[_0x2f8b('0x68')]('default_preferred.png'));var _0xf0fae3='default'+_[_0x2f8b('0x6c')]('preferred');if(_0x260d55[_0xf0fae3]||!_0x292198[_0x2f8b('0x71')]||!_0x292198[_0x2f8b('0x5f')]){_0x7e9f7=path['join'](config[_0x2f8b('0x67')],_0x14f293,_[_0x2f8b('0x68')](_0x2f8b('0x75')));}if(!fs[_0x2f8b('0x65')](_0x7e9f7)){throw new db[(_0x2f8b('0x76'))][(_0x2f8b('0x6b'))](_[_0x2f8b('0x6c')](_0x2f8b('0x5f'))+_0x2f8b('0x6d'));}return _0x406ece[_0x2f8b('0x6e')](_0x7e9f7);}})[_0x2f8b('0x28')](handleError(_0x406ece,null));};exports['addFavicon']=function(_0x137985,_0x3fa544,_0x102aff){if(_0x137985['file']&&_0x137985[_0x2f8b('0x58')][_0x2f8b('0x59')]){_0x137985[_0x2f8b('0x56')][_0x2f8b('0x60')]=_0x137985[_0x2f8b('0x58')][_0x2f8b('0x59')];}return db[_0x2f8b('0x3d')][_0x2f8b('0x5b')]({'where':{'id':_0x137985['params']['id']}})['then'](handleEntityNotFound(_0x3fa544,null))['then'](saveUpdates(_0x137985[_0x2f8b('0x56')],null))[_0x2f8b('0x1e')](respondWithResult(_0x3fa544,null))[_0x2f8b('0x28')](handleError(_0x3fa544,null));};var utilLicense=require(_0x2f8b('0x19'));exports[_0x2f8b('0x77')]=function(_0x39afa6,_0x3d297e,_0x37fd6d){var _0x1fe14b=_0x2f8b('0x5d');var _0x366662={'custom':![]};return utilLicense[_0x2f8b('0x5e')]()[_0x2f8b('0x1e')](function(_0x9748bc){if(_0x9748bc){_0x366662=_0x9748bc;}return db[_0x2f8b('0x3d')][_0x2f8b('0x5b')]({'where':{'id':_0x39afa6['params']['id']},'attributes':[_0x2f8b('0x5a'),'loginLogo','preferred',_0x2f8b('0x60'),'defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x3d297e,null))['then'](function(_0x498c7e){if(_0x498c7e){var _0x3bf4d1=_0x498c7e[_0x2f8b('0x60')]&&fs[_0x2f8b('0x65')](path[_0x2f8b('0x66')](config[_0x2f8b('0x67')],_0x1fe14b,_[_0x2f8b('0x68')](_0x498c7e['favicon'])))?path['join'](config[_0x2f8b('0x67')],_0x1fe14b,_[_0x2f8b('0x68')](_0x498c7e[_0x2f8b('0x60')])):path['join'](config[_0x2f8b('0x67')],_0x1fe14b,_[_0x2f8b('0x68')](_0x2f8b('0x78')));var _0x56854a='default'+_[_0x2f8b('0x6c')](_0x2f8b('0x60'));if(_0x498c7e[_0x56854a]||!_0x366662[_0x2f8b('0x71')]){_0x3bf4d1=path['join'](config[_0x2f8b('0x67')],_0x1fe14b,_[_0x2f8b('0x68')]('default_favicon.ico'));}if(!fs[_0x2f8b('0x65')](_0x3bf4d1)){throw new db['Sequelize']['ValidationError'](_[_0x2f8b('0x6c')](_0x2f8b('0x60'))+'\x20not\x20found');}return _0x3d297e['download'](_0x3bf4d1);}})[_0x2f8b('0x28')](handleError(_0x3d297e,null));};exports[_0x2f8b('0x79')]=function(_0x3278f9,_0x43f156){var _0x2b0e98={'offset':moment()[_0x2f8b('0x7a')]()};_0x2b0e98[_0x2f8b('0x7b')]=moment()['utcOffset'](_0x2b0e98[_0x2f8b('0x2d')])[_0x2f8b('0x7c')](_0x2f8b('0x7d'));return _0x43f156[_0x2f8b('0x2b')](0xc8)['send'](_0x2b0e98);};
\ No newline at end of file
+var _0xdc8c=['Setting,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','stack','name','send','index','map','Setting','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','include','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','server/files/images/logos','getLicense','favicon','defaultLogo','defaultLoginLogo','defaultFavicon','existsSync','root','toLower','join','default_logo.svg','default','upperFirst','custom','ValidationError','\x20not\x20found','download','defaultPreferred','default_loginLogo.svg','Sequelize','gdpr','securePassword','preferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3154f6,_0xf93e8d){var _0x261d9f=function(_0x17759d){while(--_0x17759d){_0x3154f6['push'](_0x3154f6['shift']());}};_0x261d9f(++_0xf93e8d);}(_0xdc8c,0xd9));var _0xcdc8=function(_0x49c9eb,_0x25b227){_0x49c9eb=_0x49c9eb-0x0;var _0x29374c=_0xdc8c[_0x49c9eb];return _0x29374c;};'use strict';var emlformat=require(_0xcdc8('0x0'));var rimraf=require(_0xcdc8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcdc8('0x2'));var moment=require('moment');var BPromise=require(_0xcdc8('0x3'));var Mustache=require('mustache');var util=require(_0xcdc8('0x4'));var path=require(_0xcdc8('0x5'));var sox=require(_0xcdc8('0x6'));var csv=require('to-csv');var ejs=require(_0xcdc8('0x7'));var fs=require('fs');var fs_extra=require(_0xcdc8('0x8'));var _=require(_0xcdc8('0x9'));var squel=require(_0xcdc8('0xa'));var crypto=require(_0xcdc8('0xb'));var jsforce=require(_0xcdc8('0xc'));var deskjs=require(_0xcdc8('0xd'));var toCsv=require(_0xcdc8('0xe'));var querystring=require(_0xcdc8('0xf'));var Papa=require(_0xcdc8('0x10'));var Redis=require(_0xcdc8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xcdc8('0x12'));var as=require(_0xcdc8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcdc8('0x14'))(_0xcdc8('0x15'));var utils=require(_0xcdc8('0x16'));var config=require(_0xcdc8('0x17'));var licenseUtil=require(_0xcdc8('0x18'));var db=require(_0xcdc8('0x19'))['db'];var jayson=require(_0xcdc8('0x1a'));var client=jayson[_0xcdc8('0x1b')][_0xcdc8('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0xec7c11,_0x1120fb,_0xc9203e,_0x40f385){return new BPromise(function(_0x4349d3,_0x5264b5){var _0x192ca8=_0x40f385||client;return _0x192ca8[_0xcdc8('0x1d')](_0xec7c11,_0xc9203e)[_0xcdc8('0x1e')](function(_0x604383){logger[_0xcdc8('0x1f')](_0xcdc8('0x20'),_0x1120fb,_0xcdc8('0x21'));logger[_0xcdc8('0x22')](_0xcdc8('0x23'),_0x1120fb,_0xcdc8('0x21'),JSON['stringify'](_0x604383));if(_0x604383[_0xcdc8('0x24')]){if(_0x604383[_0xcdc8('0x24')][_0xcdc8('0x25')]===0x1f4){logger[_0xcdc8('0x24')](_0xcdc8('0x20'),_0x1120fb,_0x604383[_0xcdc8('0x24')][_0xcdc8('0x26')]);return _0x5264b5(_0x604383[_0xcdc8('0x24')][_0xcdc8('0x26')]);}logger[_0xcdc8('0x24')]('Setting,\x20%s,\x20%s',_0x1120fb,_0x604383['error'][_0xcdc8('0x26')]);return _0x4349d3(_0x604383[_0xcdc8('0x24')][_0xcdc8('0x26')]);}else{logger['info'](_0xcdc8('0x20'),_0x1120fb,'request\x20sent');_0x4349d3(_0x604383['result'][_0xcdc8('0x26')]);}})['catch'](function(_0xd545bc){logger['error'](_0xcdc8('0x20'),_0x1120fb,_0xd545bc);_0x5264b5(_0xd545bc);});});}function respondWithStatusCode(_0x564015,_0x56c9df){_0x56c9df=_0x56c9df||0xcc;return function(_0x194388){if(_0x194388){return _0x564015[_0xcdc8('0x27')](_0x56c9df);}return _0x564015[_0xcdc8('0x28')](_0x56c9df)[_0xcdc8('0x29')]();};}function respondWithResult(_0x3346b5,_0x5d2413){_0x5d2413=_0x5d2413||0xc8;return function(_0x159b90){if(_0x159b90){return _0x3346b5[_0xcdc8('0x28')](_0x5d2413)[_0xcdc8('0x2a')](_0x159b90);}};}function respondWithFilteredResult(_0x44afcb,_0x3c51b1){return function(_0x284c2e){if(_0x284c2e){var _0x165db7=typeof _0x3c51b1[_0xcdc8('0x2b')]===_0xcdc8('0x2c')&&typeof _0x3c51b1[_0xcdc8('0x2d')]===_0xcdc8('0x2c');var _0x4216c7=_0x284c2e[_0xcdc8('0x2e')];var _0x459841=_0x165db7?0x0:_0x3c51b1[_0xcdc8('0x2b')];var _0x36f232=_0x165db7?_0x284c2e[_0xcdc8('0x2e')]:_0x3c51b1[_0xcdc8('0x2b')]+_0x3c51b1[_0xcdc8('0x2d')];var _0x298d66;if(_0x36f232>=_0x4216c7){_0x36f232=_0x4216c7;_0x298d66=0xc8;}else{_0x298d66=0xce;}_0x44afcb[_0xcdc8('0x28')](_0x298d66);return _0x44afcb[_0xcdc8('0x2f')](_0xcdc8('0x30'),_0x459841+'-'+_0x36f232+'/'+_0x4216c7)[_0xcdc8('0x2a')](_0x284c2e);}return null;};}function patchUpdates(_0x63cb){return function(_0x4dc36d){try{jsonpatch['apply'](_0x4dc36d,_0x63cb,!![]);}catch(_0x39abde){return BPromise[_0xcdc8('0x31')](_0x39abde);}return _0x4dc36d['save']();};}function saveUpdates(_0x5c3aff,_0x2f8028){return function(_0x331fb0){if(_0x331fb0){return _0x331fb0[_0xcdc8('0x32')](_0x5c3aff)[_0xcdc8('0x1e')](function(_0x15a068){return _0x15a068;});}return null;};}function removeEntity(_0x423647,_0x1deee2){return function(_0x48c3fb){if(_0x48c3fb){return _0x48c3fb[_0xcdc8('0x33')]()[_0xcdc8('0x1e')](function(){_0x423647[_0xcdc8('0x28')](0xcc)[_0xcdc8('0x29')]();});}};}function handleEntityNotFound(_0x3714ec,_0x683c4){return function(_0x8d7c11){if(!_0x8d7c11){_0x3714ec[_0xcdc8('0x27')](0x194);}return _0x8d7c11;};}function handleError(_0x2f8451,_0x23ba31){_0x23ba31=_0x23ba31||0x1f4;return function(_0x2cc2c3){logger['error'](_0x2cc2c3[_0xcdc8('0x34')]);if(_0x2cc2c3['name']){delete _0x2cc2c3[_0xcdc8('0x35')];}_0x2f8451[_0xcdc8('0x28')](_0x23ba31)[_0xcdc8('0x36')](_0x2cc2c3);};}exports[_0xcdc8('0x37')]=function(_0x5bbff2,_0x336d4e){var _0x3729af={},_0x28fcd8={},_0x3c7929={'count':0x0,'rows':[]};var _0x11540a=_[_0xcdc8('0x38')](db[_0xcdc8('0x39')][_0xcdc8('0x3a')],function(_0x900cc5){return{'name':_0x900cc5['fieldName'],'type':_0x900cc5[_0xcdc8('0x3b')][_0xcdc8('0x3c')]};});_0x28fcd8['model']=_[_0xcdc8('0x38')](_0x11540a,_0xcdc8('0x35'));_0x28fcd8['query']=_[_0xcdc8('0x3d')](_0x5bbff2[_0xcdc8('0x3e')]);_0x28fcd8[_0xcdc8('0x3f')]=_[_0xcdc8('0x40')](_0x28fcd8[_0xcdc8('0x41')],_0x28fcd8[_0xcdc8('0x3e')]);_0x3729af[_0xcdc8('0x42')]=_[_0xcdc8('0x40')](_0x28fcd8['model'],qs[_0xcdc8('0x43')](_0x5bbff2['query'][_0xcdc8('0x43')]));_0x3729af[_0xcdc8('0x42')]=_0x3729af[_0xcdc8('0x42')][_0xcdc8('0x44')]?_0x3729af[_0xcdc8('0x42')]:_0x28fcd8[_0xcdc8('0x41')];if(!_0x5bbff2[_0xcdc8('0x3e')][_0xcdc8('0x45')](_0xcdc8('0x46'))){_0x3729af['limit']=qs[_0xcdc8('0x2d')](_0x5bbff2[_0xcdc8('0x3e')][_0xcdc8('0x2d')]);_0x3729af[_0xcdc8('0x2b')]=qs[_0xcdc8('0x2b')](_0x5bbff2[_0xcdc8('0x3e')][_0xcdc8('0x2b')]);}_0x3729af[_0xcdc8('0x47')]=qs[_0xcdc8('0x48')](_0x5bbff2['query']['sort']);_0x3729af['where']=qs[_0xcdc8('0x3f')](_[_0xcdc8('0x49')](_0x5bbff2[_0xcdc8('0x3e')],_0x28fcd8['filters']),_0x11540a);if(_0x5bbff2[_0xcdc8('0x3e')]['filter']){_0x3729af['where']=_[_0xcdc8('0x4a')](_0x3729af[_0xcdc8('0x4b')],{'$or':_['map'](_0x11540a,function(_0x5f0ba8){if(_0x5f0ba8[_0xcdc8('0x3b')]!==_0xcdc8('0x4c')){var _0x49e3d6={};_0x49e3d6[_0x5f0ba8[_0xcdc8('0x35')]]={'$like':'%'+_0x5bbff2[_0xcdc8('0x3e')][_0xcdc8('0x4d')]+'%'};return _0x49e3d6;}})});}_0x3729af=_['merge']({},_0x3729af,_0x5bbff2[_0xcdc8('0x4e')]);var _0x161aa1={'where':_0x3729af['where']};return db[_0xcdc8('0x39')][_0xcdc8('0x2e')](_0x161aa1)[_0xcdc8('0x1e')](function(_0x3021c3){_0x3c7929[_0xcdc8('0x2e')]=_0x3021c3;if(_0x5bbff2[_0xcdc8('0x3e')][_0xcdc8('0x4f')]){_0x3729af['include']=[{'all':!![]}];}return db[_0xcdc8('0x39')][_0xcdc8('0x50')](_0x3729af);})['then'](function(_0x363f6d){_0x3c7929['rows']=_0x363f6d;return _0x3c7929;})[_0xcdc8('0x1e')](respondWithFilteredResult(_0x336d4e,_0x3729af))[_0xcdc8('0x51')](handleError(_0x336d4e,null));};exports[_0xcdc8('0x52')]=function(_0x186759,_0x1d0b84){var _0x3e3c13={'raw':![],'where':{'id':_0x186759[_0xcdc8('0x53')]['id']}},_0x9cbe6a={};_0x9cbe6a[_0xcdc8('0x41')]=_[_0xcdc8('0x3d')](db['Setting'][_0xcdc8('0x3a')]);_0x9cbe6a[_0xcdc8('0x3e')]=_[_0xcdc8('0x3d')](_0x186759[_0xcdc8('0x3e')]);_0x9cbe6a['filters']=_[_0xcdc8('0x40')](_0x9cbe6a[_0xcdc8('0x41')],_0x9cbe6a[_0xcdc8('0x3e')]);_0x3e3c13['attributes']=_[_0xcdc8('0x40')](_0x9cbe6a[_0xcdc8('0x41')],qs[_0xcdc8('0x43')](_0x186759[_0xcdc8('0x3e')][_0xcdc8('0x43')]));_0x3e3c13['attributes']=_0x3e3c13[_0xcdc8('0x42')][_0xcdc8('0x44')]?_0x3e3c13[_0xcdc8('0x42')]:_0x9cbe6a[_0xcdc8('0x41')];if(_0x186759[_0xcdc8('0x3e')][_0xcdc8('0x4f')]){_0x3e3c13[_0xcdc8('0x54')]=[{'all':!![]}];}_0x3e3c13=_[_0xcdc8('0x4a')]({},_0x3e3c13,_0x186759[_0xcdc8('0x4e')]);return db[_0xcdc8('0x39')][_0xcdc8('0x55')](_0x3e3c13)['then'](handleEntityNotFound(_0x1d0b84,null))['then'](respondWithResult(_0x1d0b84,null))['catch'](handleError(_0x1d0b84,null));};exports['update']=function(_0x3489a1,_0x1834ee){if(_0x3489a1[_0xcdc8('0x56')]['id']){delete _0x3489a1[_0xcdc8('0x56')]['id'];}return db[_0xcdc8('0x39')]['find']({'where':{'id':_0x3489a1['params']['id']}})[_0xcdc8('0x1e')](handleEntityNotFound(_0x1834ee,null))[_0xcdc8('0x1e')](saveUpdates(_0x3489a1[_0xcdc8('0x56')],null))[_0xcdc8('0x1e')](respondWithResult(_0x1834ee,null))[_0xcdc8('0x51')](handleError(_0x1834ee,null));};exports[_0xcdc8('0x57')]=function(_0x11d200,_0x605727,_0x12c9e2){if(_0x11d200[_0xcdc8('0x58')]&&_0x11d200[_0xcdc8('0x58')][_0xcdc8('0x59')]){_0x11d200[_0xcdc8('0x56')][_0xcdc8('0x5a')]=_0x11d200[_0xcdc8('0x58')][_0xcdc8('0x59')];}return db[_0xcdc8('0x39')]['find']({'where':{'id':_0x11d200[_0xcdc8('0x53')]['id']}})[_0xcdc8('0x1e')](handleEntityNotFound(_0x605727,null))[_0xcdc8('0x1e')](saveUpdates(_0x11d200['body'],null))['then'](respondWithResult(_0x605727,null))['catch'](handleError(_0x605727,null));};exports[_0xcdc8('0x5b')]=function(_0x1b38b3,_0x1c0211,_0x155386){if(_0x1b38b3[_0xcdc8('0x58')]&&_0x1b38b3[_0xcdc8('0x58')][_0xcdc8('0x59')]){_0x1b38b3[_0xcdc8('0x56')][_0xcdc8('0x5c')]=_0x1b38b3['file'][_0xcdc8('0x59')];}return db[_0xcdc8('0x39')][_0xcdc8('0x55')]({'where':{'id':_0x1b38b3[_0xcdc8('0x53')]['id']}})['then'](handleEntityNotFound(_0x1c0211,null))[_0xcdc8('0x1e')](saveUpdates(_0x1b38b3['body'],null))[_0xcdc8('0x1e')](respondWithResult(_0x1c0211,null))['catch'](handleError(_0x1c0211,null));};var utilLicense=require(_0xcdc8('0x18'));exports['getLogo']=function(_0x539d7c,_0x5a6d53,_0x14f2ae){var _0x5cfc9b=_0xcdc8('0x5d');var _0x18b59b={'custom':![]};return utilLicense[_0xcdc8('0x5e')]()[_0xcdc8('0x1e')](function(_0x21c4d5){if(_0x21c4d5){_0x18b59b=_0x21c4d5;}return db['Setting'][_0xcdc8('0x55')]({'where':{'id':_0x539d7c[_0xcdc8('0x53')]['id']},'attributes':[_0xcdc8('0x5a'),_0xcdc8('0x5c'),'preferred',_0xcdc8('0x5f'),_0xcdc8('0x60'),_0xcdc8('0x61'),'defaultPreferred',_0xcdc8('0x62')],'raw':!![]});})[_0xcdc8('0x1e')](handleEntityNotFound(_0x5a6d53,null))[_0xcdc8('0x1e')](function(_0x192194){if(_0x192194){var _0x2badeb=_0x192194[_0xcdc8('0x5a')]&&fs[_0xcdc8('0x63')](path['join'](config[_0xcdc8('0x64')],_0x5cfc9b,_[_0xcdc8('0x65')](_0x192194[_0xcdc8('0x5a')])))?path[_0xcdc8('0x66')](config[_0xcdc8('0x64')],_0x5cfc9b,_[_0xcdc8('0x65')](_0x192194[_0xcdc8('0x5a')])):path[_0xcdc8('0x66')](config[_0xcdc8('0x64')],_0x5cfc9b,_[_0xcdc8('0x65')](_0xcdc8('0x67')));var _0x52f3ee=_0xcdc8('0x68')+_[_0xcdc8('0x69')](_0xcdc8('0x5a'));if(_0x192194[_0x52f3ee]||!_0x18b59b[_0xcdc8('0x6a')]){_0x2badeb=path[_0xcdc8('0x66')](config[_0xcdc8('0x64')],_0x5cfc9b,_['toLower']('default_logo.svg'));}if(!fs['existsSync'](_0x2badeb)){throw new db['Sequelize'][(_0xcdc8('0x6b'))](_[_0xcdc8('0x69')](_0xcdc8('0x5a'))+_0xcdc8('0x6c'));}return _0x5a6d53[_0xcdc8('0x6d')](_0x2badeb);}})[_0xcdc8('0x51')](handleError(_0x5a6d53,null));};var utilLicense=require(_0xcdc8('0x18'));exports['getLogoLogin']=function(_0x51da47,_0x106df7,_0xfa0d84){var _0x1a8851='server/files/images/logos';var _0x306dea={'custom':![]};return utilLicense[_0xcdc8('0x5e')]()[_0xcdc8('0x1e')](function(_0x15aecc){if(_0x15aecc){_0x306dea=_0x15aecc;}return db[_0xcdc8('0x39')][_0xcdc8('0x55')]({'where':{'id':_0x51da47['params']['id']},'attributes':[_0xcdc8('0x5a'),_0xcdc8('0x5c'),'preferred',_0xcdc8('0x5f'),_0xcdc8('0x60'),_0xcdc8('0x61'),_0xcdc8('0x6e'),'defaultFavicon'],'raw':!![]});})[_0xcdc8('0x1e')](handleEntityNotFound(_0x106df7,null))[_0xcdc8('0x1e')](function(_0x21afb1){if(_0x21afb1){var _0xbf151d=_0x21afb1[_0xcdc8('0x5c')]&&fs[_0xcdc8('0x63')](path['join'](config[_0xcdc8('0x64')],_0x1a8851,_[_0xcdc8('0x65')](_0x21afb1[_0xcdc8('0x5c')])))?path[_0xcdc8('0x66')](config[_0xcdc8('0x64')],_0x1a8851,_[_0xcdc8('0x65')](_0x21afb1[_0xcdc8('0x5c')])):path[_0xcdc8('0x66')](config[_0xcdc8('0x64')],_0x1a8851,_['toLower'](_0xcdc8('0x6f')));var _0x46cf45=_0xcdc8('0x68')+_[_0xcdc8('0x69')](_0xcdc8('0x5c'));if(_0x21afb1[_0x46cf45]||!_0x306dea[_0xcdc8('0x6a')]){_0xbf151d=path[_0xcdc8('0x66')](config[_0xcdc8('0x64')],_0x1a8851,_[_0xcdc8('0x65')](_0xcdc8('0x6f')));}if(!fs[_0xcdc8('0x63')](_0xbf151d)){throw new db[(_0xcdc8('0x70'))][(_0xcdc8('0x6b'))](_['upperFirst']('loginLogo')+_0xcdc8('0x6c'));}return _0x106df7[_0xcdc8('0x6d')](_0xbf151d);}})[_0xcdc8('0x51')](handleError(_0x106df7,null));};exports[_0xcdc8('0x71')]=function(_0x379e07,_0x49d9c4){return db[_0xcdc8('0x39')][_0xcdc8('0x55')]({'where':{'id':_0x379e07[_0xcdc8('0x53')]['id']},'attributes':[_0xcdc8('0x72')]})[_0xcdc8('0x1e')](respondWithResult(_0x49d9c4,null))[_0xcdc8('0x51')](handleError(_0x49d9c4,null));};exports['addPreferred']=function(_0x507912,_0x55808c,_0x28fcb3){if(_0x507912[_0xcdc8('0x58')]&&_0x507912[_0xcdc8('0x58')][_0xcdc8('0x59')]){_0x507912[_0xcdc8('0x56')][_0xcdc8('0x73')]=_0x507912[_0xcdc8('0x58')]['filename'];}return db['Setting']['find']({'where':{'id':_0x507912[_0xcdc8('0x53')]['id']}})[_0xcdc8('0x1e')](handleEntityNotFound(_0x55808c,null))[_0xcdc8('0x1e')](saveUpdates(_0x507912[_0xcdc8('0x56')],null))['then'](respondWithResult(_0x55808c,null))['catch'](handleError(_0x55808c,null));};var utilLicense=require('../../config/license/util');exports[_0xcdc8('0x74')]=function(_0x34a581,_0x38f561,_0x3d6e12){var _0x54c1e7='server/files/images/logos';var _0x344d22={'custom':![]};return utilLicense[_0xcdc8('0x5e')]()['then'](function(_0x3b3862){if(_0x3b3862){_0x344d22=_0x3b3862;}return db['Setting'][_0xcdc8('0x55')]({'where':{'id':_0x34a581['params']['id']},'attributes':[_0xcdc8('0x5a'),_0xcdc8('0x5c'),'preferred',_0xcdc8('0x5f'),_0xcdc8('0x60'),'defaultLoginLogo',_0xcdc8('0x6e'),_0xcdc8('0x62')],'raw':!![]});})[_0xcdc8('0x1e')](handleEntityNotFound(_0x38f561,null))[_0xcdc8('0x1e')](function(_0x37e6a3){if(_0x37e6a3){var _0x3d3252=_0x37e6a3[_0xcdc8('0x73')]&&fs[_0xcdc8('0x63')](path[_0xcdc8('0x66')](config['root'],_0x54c1e7,_['toLower'](_0x37e6a3['preferred'])))?path[_0xcdc8('0x66')](config[_0xcdc8('0x64')],_0x54c1e7,_['toLower'](_0x37e6a3[_0xcdc8('0x73')])):path[_0xcdc8('0x66')](config[_0xcdc8('0x64')],_0x54c1e7,_[_0xcdc8('0x65')](_0xcdc8('0x75')));var _0x422324=_0xcdc8('0x68')+_['upperFirst'](_0xcdc8('0x73'));if(_0x37e6a3[_0x422324]||!_0x344d22[_0xcdc8('0x6a')]||!_0x344d22[_0xcdc8('0x73')]){_0x3d3252=path[_0xcdc8('0x66')](config[_0xcdc8('0x64')],_0x54c1e7,_[_0xcdc8('0x65')](_0xcdc8('0x75')));}if(!fs['existsSync'](_0x3d3252)){throw new db['Sequelize']['ValidationError'](_['upperFirst'](_0xcdc8('0x73'))+_0xcdc8('0x6c'));}return _0x38f561[_0xcdc8('0x6d')](_0x3d3252);}})[_0xcdc8('0x51')](handleError(_0x38f561,null));};exports[_0xcdc8('0x76')]=function(_0x4e3198,_0x14da12,_0x49e18e){if(_0x4e3198[_0xcdc8('0x58')]&&_0x4e3198[_0xcdc8('0x58')][_0xcdc8('0x59')]){_0x4e3198['body'][_0xcdc8('0x5f')]=_0x4e3198[_0xcdc8('0x58')][_0xcdc8('0x59')];}return db[_0xcdc8('0x39')][_0xcdc8('0x55')]({'where':{'id':_0x4e3198[_0xcdc8('0x53')]['id']}})[_0xcdc8('0x1e')](handleEntityNotFound(_0x14da12,null))[_0xcdc8('0x1e')](saveUpdates(_0x4e3198[_0xcdc8('0x56')],null))[_0xcdc8('0x1e')](respondWithResult(_0x14da12,null))[_0xcdc8('0x51')](handleError(_0x14da12,null));};var utilLicense=require('../../config/license/util');exports[_0xcdc8('0x77')]=function(_0x31df73,_0x2dcdc5,_0x466c89){var _0x572756=_0xcdc8('0x5d');var _0x127eb0={'custom':![]};return utilLicense[_0xcdc8('0x5e')]()['then'](function(_0xd02ba8){if(_0xd02ba8){_0x127eb0=_0xd02ba8;}return db[_0xcdc8('0x39')][_0xcdc8('0x55')]({'where':{'id':_0x31df73['params']['id']},'attributes':[_0xcdc8('0x5a'),_0xcdc8('0x5c'),_0xcdc8('0x73'),_0xcdc8('0x5f'),_0xcdc8('0x60'),_0xcdc8('0x61'),_0xcdc8('0x6e'),_0xcdc8('0x62')],'raw':!![]});})[_0xcdc8('0x1e')](handleEntityNotFound(_0x2dcdc5,null))[_0xcdc8('0x1e')](function(_0x3612b0){if(_0x3612b0){var _0x240bf0=_0x3612b0[_0xcdc8('0x5f')]&&fs[_0xcdc8('0x63')](path[_0xcdc8('0x66')](config[_0xcdc8('0x64')],_0x572756,_[_0xcdc8('0x65')](_0x3612b0[_0xcdc8('0x5f')])))?path[_0xcdc8('0x66')](config[_0xcdc8('0x64')],_0x572756,_[_0xcdc8('0x65')](_0x3612b0[_0xcdc8('0x5f')])):path['join'](config[_0xcdc8('0x64')],_0x572756,_[_0xcdc8('0x65')](_0xcdc8('0x78')));var _0x159aaa=_0xcdc8('0x68')+_[_0xcdc8('0x69')]('favicon');if(_0x3612b0[_0x159aaa]||!_0x127eb0['custom']){_0x240bf0=path[_0xcdc8('0x66')](config['root'],_0x572756,_[_0xcdc8('0x65')]('default_favicon.ico'));}if(!fs['existsSync'](_0x240bf0)){throw new db[(_0xcdc8('0x70'))]['ValidationError'](_['upperFirst']('favicon')+_0xcdc8('0x6c'));}return _0x2dcdc5[_0xcdc8('0x6d')](_0x240bf0);}})[_0xcdc8('0x51')](handleError(_0x2dcdc5,null));};exports[_0xcdc8('0x79')]=function(_0x16bae0,_0x450fe1){var _0x298a38={'offset':moment()[_0xcdc8('0x7a')]()};_0x298a38[_0xcdc8('0x7b')]=moment()[_0xcdc8('0x7a')](_0x298a38[_0xcdc8('0x2b')])[_0xcdc8('0x7c')](_0xcdc8('0x7d'));return _0x450fe1[_0xcdc8('0x28')](0xc8)['send'](_0x298a38);};
\ No newline at end of file
index 9838d22..26e3400 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x55ca,0x126));var _0xa55c=function(_0x23fd09,_0x51c74c){_0x23fd09=_0x23fd09-0x0;var _0x5d8176=_0x55ca[_0x23fd09];return _0x5d8176;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Setting',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x339129,_0x86dcc6){var _0x1570df=function(_0x3b537e){while(--_0x3b537e){_0x339129['push'](_0x339129['shift']());}};_0x1570df(++_0x86dcc6);}(_0x55ca,0x126));var _0xa55c=function(_0xf3f1ed,_0x57e63e){_0xf3f1ed=_0xf3f1ed-0x0;var _0x3f5837=_0x55ca[_0xf3f1ed];return _0x3f5837;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Setting',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 442840c..c025d3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x350e=['util','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSetting','find','options','raw','where','attributes','include','model','map','lodash'];(function(_0x4bec2a,_0x47897d){var _0xca7411=function(_0x207770){while(--_0x207770){_0x4bec2a['push'](_0x4bec2a['shift']());}};_0xca7411(++_0x47897d);}(_0x350e,0x95));var _0xe350=function(_0x1dde0e,_0x2ef664){_0x1dde0e=_0x1dde0e-0x0;var _0x6871de=_0x350e[_0x1dde0e];return _0x6871de;};'use strict';var _=require(_0xe350('0x0'));var util=require(_0xe350('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe350('0x2'));var fs=require('fs');var Redis=require(_0xe350('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe350('0x4'))(_0xe350('0x5'));var config=require('../../config/environment');var jayson=require(_0xe350('0x6'));var client=jayson[_0xe350('0x7')][_0xe350('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3aff1c,_0x5ab816,_0x57cde2){return new BPromise(function(_0x1a30db,_0x2dfaaf){return client['request'](_0x3aff1c,_0x57cde2)[_0xe350('0x9')](function(_0x3b52c6){logger[_0xe350('0xa')](_0xe350('0xb'),_0x5ab816,_0xe350('0xc'));logger[_0xe350('0xd')](_0xe350('0xe'),_0x5ab816,_0xe350('0xc'),JSON[_0xe350('0xf')](_0x3b52c6));if(_0x3b52c6[_0xe350('0x10')]){if(_0x3b52c6['error'][_0xe350('0x11')]===0x1f4){logger['error'](_0xe350('0xb'),_0x5ab816,_0x3b52c6[_0xe350('0x10')][_0xe350('0x12')]);return _0x2dfaaf(_0x3b52c6['error']['message']);}logger[_0xe350('0x10')]('Setting,\x20%s,\x20%s',_0x5ab816,_0x3b52c6['error']['message']);return _0x1a30db(_0x3b52c6[_0xe350('0x10')][_0xe350('0x12')]);}else{logger['info'](_0xe350('0xb'),_0x5ab816,_0xe350('0xc'));_0x1a30db(_0x3b52c6[_0xe350('0x13')]['message']);}})[_0xe350('0x14')](function(_0x301ee1){logger['error'](_0xe350('0xb'),_0x5ab816,_0x301ee1);_0x2dfaaf(_0x301ee1);});});}exports[_0xe350('0x15')]=function(_0x5befe4){var _0x26563d=this;return new Promise(function(_0x4370dd,_0x502644){return db['Setting'][_0xe350('0x16')]({'raw':_0x5befe4[_0xe350('0x17')]?_0x5befe4[_0xe350('0x17')][_0xe350('0x18')]===undefined?!![]:![]:!![],'where':_0x5befe4['options']?_0x5befe4[_0xe350('0x17')][_0xe350('0x19')]||null:null,'attributes':_0x5befe4[_0xe350('0x17')]?_0x5befe4[_0xe350('0x17')][_0xe350('0x1a')]||null:null,'include':_0x5befe4['options']?_0x5befe4['options']['include']?_['map'](_0x5befe4[_0xe350('0x17')][_0xe350('0x1b')],function(_0x550182){return{'model':db[_0x550182[_0xe350('0x1c')]],'as':_0x550182['as'],'attributes':_0x550182['attributes'],'include':_0x550182['include']?_[_0xe350('0x1d')](_0x550182[_0xe350('0x1b')],function(_0x14d6a3){return{'model':db[_0x14d6a3['model']],'as':_0x14d6a3['as'],'attributes':_0x14d6a3['attributes'],'include':_0x14d6a3[_0xe350('0x1b')]?_[_0xe350('0x1d')](_0x14d6a3['include'],function(_0x3b1d29){return{'model':db[_0x3b1d29[_0xe350('0x1c')]],'as':_0x3b1d29['as'],'attributes':_0x3b1d29[_0xe350('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe350('0x9')](function(_0xfc1efd){logger['info']('ShowSetting',_0x5befe4);logger['debug'](_0xe350('0x15'),_0x5befe4,JSON[_0xe350('0xf')](_0xfc1efd));_0x4370dd(_0xfc1efd);})[_0xe350('0x14')](function(_0x1524d4){logger[_0xe350('0x10')](_0xe350('0x15'),_0x1524d4[_0xe350('0x12')],_0x5befe4);_0x502644(_0x26563d['error'](0x1f4,_0x1524d4['message']));});});};
\ No newline at end of file
+var _0xab88=['request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSetting','Setting','options','where','include','map','model','attributes','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xab88,0x71));var _0x8ab8=function(_0x15de7b,_0x1f9e4e){_0x15de7b=_0x15de7b-0x0;var _0x1456c4=_0xab88[_0x15de7b];return _0x1456c4;};'use strict';var _=require(_0x8ab8('0x0'));var util=require('util');var moment=require(_0x8ab8('0x1'));var BPromise=require(_0x8ab8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8ab8('0x3'));var db=require(_0x8ab8('0x4'))['db'];var utils=require(_0x8ab8('0x5'));var logger=require(_0x8ab8('0x6'))(_0x8ab8('0x7'));var config=require(_0x8ab8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8ab8('0x9')][_0x8ab8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b4937,_0x44d200,_0x255a1c){return new BPromise(function(_0x4509db,_0x37e064){return client[_0x8ab8('0xb')](_0x2b4937,_0x255a1c)[_0x8ab8('0xc')](function(_0x127351){logger[_0x8ab8('0xd')](_0x8ab8('0xe'),_0x44d200,_0x8ab8('0xf'));logger[_0x8ab8('0x10')](_0x8ab8('0x11'),_0x44d200,_0x8ab8('0xf'),JSON[_0x8ab8('0x12')](_0x127351));if(_0x127351[_0x8ab8('0x13')]){if(_0x127351[_0x8ab8('0x13')][_0x8ab8('0x14')]===0x1f4){logger[_0x8ab8('0x13')](_0x8ab8('0xe'),_0x44d200,_0x127351[_0x8ab8('0x13')]['message']);return _0x37e064(_0x127351[_0x8ab8('0x13')][_0x8ab8('0x15')]);}logger['error']('Setting,\x20%s,\x20%s',_0x44d200,_0x127351[_0x8ab8('0x13')][_0x8ab8('0x15')]);return _0x4509db(_0x127351[_0x8ab8('0x13')][_0x8ab8('0x15')]);}else{logger[_0x8ab8('0xd')](_0x8ab8('0xe'),_0x44d200,_0x8ab8('0xf'));_0x4509db(_0x127351['result'][_0x8ab8('0x15')]);}})[_0x8ab8('0x16')](function(_0x553318){logger[_0x8ab8('0x13')](_0x8ab8('0xe'),_0x44d200,_0x553318);_0x37e064(_0x553318);});});}exports[_0x8ab8('0x17')]=function(_0x4edfb5){var _0x555290=this;return new Promise(function(_0x196151,_0x2cacde){return db[_0x8ab8('0x18')]['find']({'raw':_0x4edfb5[_0x8ab8('0x19')]?_0x4edfb5['options']['raw']===undefined?!![]:![]:!![],'where':_0x4edfb5[_0x8ab8('0x19')]?_0x4edfb5[_0x8ab8('0x19')][_0x8ab8('0x1a')]||null:null,'attributes':_0x4edfb5[_0x8ab8('0x19')]?_0x4edfb5['options']['attributes']||null:null,'include':_0x4edfb5['options']?_0x4edfb5['options'][_0x8ab8('0x1b')]?_[_0x8ab8('0x1c')](_0x4edfb5[_0x8ab8('0x19')][_0x8ab8('0x1b')],function(_0x4ac40e){return{'model':db[_0x4ac40e[_0x8ab8('0x1d')]],'as':_0x4ac40e['as'],'attributes':_0x4ac40e['attributes'],'include':_0x4ac40e[_0x8ab8('0x1b')]?_[_0x8ab8('0x1c')](_0x4ac40e[_0x8ab8('0x1b')],function(_0x24f748){return{'model':db[_0x24f748['model']],'as':_0x24f748['as'],'attributes':_0x24f748['attributes'],'include':_0x24f748[_0x8ab8('0x1b')]?_['map'](_0x24f748[_0x8ab8('0x1b')],function(_0x3802cd){return{'model':db[_0x3802cd[_0x8ab8('0x1d')]],'as':_0x3802cd['as'],'attributes':_0x3802cd[_0x8ab8('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8ab8('0xc')](function(_0xb8e4ef){logger['info'](_0x8ab8('0x17'),_0x4edfb5);logger[_0x8ab8('0x10')]('ShowSetting',_0x4edfb5,JSON[_0x8ab8('0x12')](_0xb8e4ef));_0x196151(_0xb8e4ef);})['catch'](function(_0x40cad1){logger[_0x8ab8('0x13')](_0x8ab8('0x17'),_0x40cad1[_0x8ab8('0x15')],_0x4edfb5);_0x2cacde(_0x555290[_0x8ab8('0x13')](0x1f4,_0x40cad1[_0x8ab8('0x15')]));});});};
\ No newline at end of file
index 1cab2d9..7e6e4f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['statusGet','/:id/users','getAgents','post','addDisposition','addAnswer','notify','addApplications','/:id/send','send','status','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0x2ef8f1,_0x1280a3){var _0x17498d=function(_0xd20876){while(--_0xd20876){_0x2ef8f1['push'](_0x2ef8f1['shift']());}};_0x17498d(++_0x1280a3);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xc4aa[_0x4792c8];return _0x35edb1;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['describe']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['get'](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xf')]);router['get'](_0xac4a('0x10'),auth['isAuthenticated'](),controller[_0xac4a('0x11')]);router['get'](_0xac4a('0x12'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x13')]);router['get'](_0xac4a('0x14'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x15')]);router[_0xac4a('0x8')](_0xac4a('0x16'),controller[_0xac4a('0x17')]);router[_0xac4a('0x8')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x19')]);router[_0xac4a('0x1a')]('/',auth[_0xac4a('0x9')](),controller['create']);router[_0xac4a('0x1a')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1b')]);router[_0xac4a('0x1a')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1c')]);router['post']('/:id/notify',controller[_0xac4a('0x1d')]);router[_0xac4a('0x1a')](_0xac4a('0x12'),auth['isAuthenticated'](),controller[_0xac4a('0x1e')]);router[_0xac4a('0x1a')](_0xac4a('0x1f'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x20')]);router[_0xac4a('0x1a')](_0xac4a('0x16'),controller[_0xac4a('0x21')]);router['post'](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller['addAgents']);router[_0xac4a('0x22')](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x23')]);router['delete'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x24')]);router[_0xac4a('0x25')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x26')]);router[_0xac4a('0x25')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x27')]);router[_0xac4a('0x25')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x28')]);module[_0xac4a('0x29')]=router;
\ No newline at end of file
+var _0xe14b=['./smsAccount.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/send','send','put','update','/:id','destroy','removeDispositions','delete','/:id/users','removeAgents','multer','util','express','Router','../../components/auth/service'];(function(_0x4a2673,_0x1290a1){var _0x20f7ff=function(_0x48b1b3){while(--_0x48b1b3){_0x4a2673['push'](_0x4a2673['shift']());}};_0x20f7ff(++_0x1290a1);}(_0xe14b,0x93));var _0xbe14=function(_0x4b3661,_0x1be781){_0x4b3661=_0x4b3661-0x0;var _0x582d0c=_0xe14b[_0x4b3661];return _0x582d0c;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x6')](_0xbe14('0x10'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x6')](_0xbe14('0x12'),controller[_0xbe14('0x13')]);router[_0xbe14('0x6')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x14')]);router[_0xbe14('0x15')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x16')]);router['post'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x15')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);router['post'](_0xbe14('0x19'),controller[_0xbe14('0x1a')]);router[_0xbe14('0x15')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1b')]);router['post'](_0xbe14('0x1c'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1d')]);router[_0xbe14('0x15')](_0xbe14('0x12'),controller['status']);router[_0xbe14('0x15')]('/:id/users',auth[_0xbe14('0x7')](),controller['addAgents']);router[_0xbe14('0x1e')]('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0x1f')]);router['delete'](_0xbe14('0x20'),auth['isAuthenticated'](),controller[_0xbe14('0x21')]);router['delete'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x22')]);router[_0xbe14('0x23')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeAnswers']);router[_0xbe14('0x23')](_0xbe14('0x24'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x25')]);module['exports']=router;
\ No newline at end of file
index 64381f2..6ec89ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc35f=['connectel','clicksend','plivo','clickatell','csc','infobip','intelepeer','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','ENUM','twilio','skebby'];(function(_0x3b9382,_0x32d102){var _0x303c10=function(_0xd10b4){while(--_0xd10b4){_0x3b9382['push'](_0x3b9382['shift']());}};_0x303c10(++_0x32d102);}(_0xc35f,0x1b9));var _0xfc35=function(_0x45ca99,_0x33c8cc){_0x45ca99=_0x45ca99-0x0;var _0x48fd0e=_0xc35f[_0x45ca99];return _0x48fd0e;};'use strict';var Sequelize=require(_0xfc35('0x0'));var rs=require(_0xfc35('0x1'));module[_0xfc35('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xfc35('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xfc35('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0xfc35('0x4')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xfc35('0x5')]();}},'phone':{'type':Sequelize[_0xfc35('0x4')]},'type':{'type':Sequelize[_0xfc35('0x6')](_0xfc35('0x7'),_0xfc35('0x8'),_0xfc35('0x9'),_0xfc35('0xa'),_0xfc35('0xb'),_0xfc35('0xc'),'bandwidth',_0xfc35('0xd'),_0xfc35('0xe'),_0xfc35('0xf'))},'accountSid':{'type':Sequelize[_0xfc35('0x4')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xfc35('0x4')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0xfc35('0x4')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0xfc35('0x4')]},'accountId':{'type':Sequelize[_0xfc35('0x4')]},'senderString':{'type':Sequelize[_0xfc35('0x4')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xfc35('0x4')]},'notificationTemplate':{'type':Sequelize[_0xfc35('0x10')],'defaultValue':function(){return _0xfc35('0x11');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfc35('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfc35('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfc35('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfc35('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfc35('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xfc35('0x4')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfc35('0x13')],'comment':_0xfc35('0x14')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xfc35('0x15'),'set':function(_0x207654){if(!_0x207654)this[_0xfc35('0x16')](_0xfc35('0x17'),null);this[_0xfc35('0x16')](_0xfc35('0x18'),_0x207654);}}};
\ No newline at end of file
+var _0x8cdb=['setDataValue','mandatoryDisposition','randomstring','exports','name','STRING','generate','ENUM','twilio','skebby','connectel','clicksend','clickatell','bandwidth','csc','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x5a7d9d,_0x23a199){var _0x5079d9=function(_0x2dcdab){while(--_0x2dcdab){_0x5a7d9d['push'](_0x5a7d9d['shift']());}};_0x5079d9(++_0x23a199);}(_0x8cdb,0x120));var _0xb8cd=function(_0x100448,_0x7a65d7){_0x100448=_0x100448-0x0;var _0x52aaf4=_0x8cdb[_0x100448];return _0x52aaf4;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xb8cd('0x0'));module[_0xb8cd('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb8cd('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xb8cd('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xb8cd('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xb8cd('0x4')]();}},'phone':{'type':Sequelize[_0xb8cd('0x3')]},'type':{'type':Sequelize[_0xb8cd('0x5')](_0xb8cd('0x6'),_0xb8cd('0x7'),_0xb8cd('0x8'),_0xb8cd('0x9'),'plivo',_0xb8cd('0xa'),_0xb8cd('0xb'),_0xb8cd('0xc'),_0xb8cd('0xd'),_0xb8cd('0xe'))},'accountSid':{'type':Sequelize[_0xb8cd('0x3')]},'authId':{'type':Sequelize[_0xb8cd('0x3')]},'authToken':{'type':Sequelize[_0xb8cd('0x3')]},'smsMethod':{'type':Sequelize[_0xb8cd('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0xb8cd('0x3')]},'password':{'type':Sequelize[_0xb8cd('0x3')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0xb8cd('0x3')]},'accountId':{'type':Sequelize[_0xb8cd('0x3')]},'senderString':{'type':Sequelize[_0xb8cd('0x3')]},'deliveryReport':{'type':Sequelize[_0xb8cd('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0xb8cd('0x3')]},'notificationTemplate':{'type':Sequelize[_0xb8cd('0x10')],'defaultValue':function(){return _0xb8cd('0x11');}},'notificationSound':{'type':Sequelize[_0xb8cd('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb8cd('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb8cd('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb8cd('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb8cd('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb8cd('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xb8cd('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb8cd('0x12')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xb8cd('0x13'),'set':function(_0x36a444){if(!_0x36a444)this[_0xb8cd('0x14')]('mandatoryDispositionPauseId',null);this[_0xb8cd('0x14')](_0xb8cd('0x15'),_0x36a444);}}};
\ No newline at end of file
index 14479c8..5f64f60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x024e=['body','describe','params','Disposition','removeDispositions','addAnswer','SmsAccountId','CannedAnswer','getAnswers','findOne','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','ListId','mobile','twilio','from','Body','text','connectel','clicksend','messageId','plivo','From','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','replyMessageId','intelepeer','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','omit','SmsInteraction','interaction','created','push','close','unmanaged','*,*,*,*','SmsMessage','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','transaction','bulkCreate','getApplications','getInteractions','Contact','User','Owner','fullname','internal','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','DESC','out','Messages','dataValues','inspect','skebby_dispatch_id','statusInt','message_id','status_code','groupName','DELIVERED','bandwidth','redif','skebby','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','ids','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','end','status','json','undefined','limit','offset','count','Content-Range','apply','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','SmsAccounts','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x467e9e,_0x4a6888){var _0x10376a=function(_0x5f3437){while(--_0x5f3437){_0x467e9e['push'](_0x467e9e['shift']());}};_0x10376a(++_0x4a6888);}(_0x024e,0x155));var _0xe024=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0x024e[_0x500419];return _0x241c1a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe024('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe024('0x1'));var rp=require(_0xe024('0x2'));var moment=require(_0xe024('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe024('0x4'));var util=require(_0xe024('0x5'));var path=require('path');var sox=require(_0xe024('0x6'));var csv=require(_0xe024('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe024('0x8'));var _=require(_0xe024('0x9'));var squel=require(_0xe024('0xa'));var crypto=require('crypto');var jsforce=require(_0xe024('0xb'));var deskjs=require(_0xe024('0xc'));var toCsv=require(_0xe024('0x7'));var querystring=require(_0xe024('0xd'));var Papa=require(_0xe024('0xe'));var Redis=require('ioredis');var authService=require(_0xe024('0xf'));var qs=require(_0xe024('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe024('0x11'));var logger=require(_0xe024('0x12'))(_0xe024('0x13'));var utils=require(_0xe024('0x14'));var config=require(_0xe024('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe024('0x16'))['db'];config[_0xe024('0x17')]=_[_0xe024('0x18')](config[_0xe024('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xe024('0x19'))(new Redis(config[_0xe024('0x17')]));require(_0xe024('0x1a'))[_0xe024('0x1b')](socket);var jayson=require(_0xe024('0x1c'));var client=jayson[_0xe024('0x1d')]['http']({'port':0x232c});function respondWithRpcPromise(_0x4cd542,_0x11c720,_0x1d0c89,_0x5b44b4){return new BPromise(function(_0x408800,_0x468510){var _0x32db2c=_0x5b44b4||client;return _0x32db2c[_0xe024('0x1e')](_0x4cd542,_0x1d0c89)[_0xe024('0x1f')](function(_0x2556d5){logger[_0xe024('0x20')](_0xe024('0x21'),_0x11c720,'request\x20sent');logger[_0xe024('0x22')](_0xe024('0x23'),_0x11c720,_0xe024('0x24'),JSON[_0xe024('0x25')](_0x2556d5));if(_0x2556d5['error']){if(_0x2556d5[_0xe024('0x26')]['code']===0x1f4){logger[_0xe024('0x26')](_0xe024('0x21'),_0x11c720,_0x2556d5[_0xe024('0x26')][_0xe024('0x27')]);return _0x468510(_0x2556d5[_0xe024('0x26')]['message']);}logger[_0xe024('0x26')](_0xe024('0x21'),_0x11c720,_0x2556d5[_0xe024('0x26')]['message']);return _0x408800(_0x2556d5[_0xe024('0x26')][_0xe024('0x27')]);}else{logger[_0xe024('0x20')](_0xe024('0x21'),_0x11c720,_0xe024('0x24'));_0x408800(_0x2556d5[_0xe024('0x28')][_0xe024('0x27')]);}})[_0xe024('0x29')](function(_0x478a25){logger[_0xe024('0x26')](_0xe024('0x21'),_0x11c720,_0x478a25);_0x468510(_0x478a25);});});}function respondWithStatusCode(_0x321fc1,_0x1226d2){_0x1226d2=_0x1226d2||0xcc;return function(_0x8b4b82){if(_0x8b4b82){return _0x321fc1[_0xe024('0x2a')](_0x1226d2);}return _0x321fc1['status'](_0x1226d2)[_0xe024('0x2b')]();};}function respondWithResult(_0x478037,_0x180821){_0x180821=_0x180821||0xc8;return function(_0x4290cb){if(_0x4290cb){return _0x478037[_0xe024('0x2c')](_0x180821)[_0xe024('0x2d')](_0x4290cb);}};}function respondWithFilteredResult(_0x5796fb,_0x44a13d){return function(_0x5a8308){if(_0x5a8308){var _0x4ba1b2=typeof _0x44a13d['offset']===_0xe024('0x2e')&&typeof _0x44a13d[_0xe024('0x2f')]===_0xe024('0x2e');var _0x4cbedb=_0x5a8308['count'];var _0x54aca6=_0x4ba1b2?0x0:_0x44a13d[_0xe024('0x30')];var _0x2cb759=_0x4ba1b2?_0x5a8308[_0xe024('0x31')]:_0x44a13d[_0xe024('0x30')]+_0x44a13d['limit'];var _0xe4c96b;if(_0x2cb759>=_0x4cbedb){_0x2cb759=_0x4cbedb;_0xe4c96b=0xc8;}else{_0xe4c96b=0xce;}_0x5796fb[_0xe024('0x2c')](_0xe4c96b);return _0x5796fb['set'](_0xe024('0x32'),_0x54aca6+'-'+_0x2cb759+'/'+_0x4cbedb)[_0xe024('0x2d')](_0x5a8308);}return null;};}function patchUpdates(_0x118859){return function(_0x46ad9c){try{jsonpatch[_0xe024('0x33')](_0x46ad9c,_0x118859,!![]);}catch(_0x47366c){return BPromise['reject'](_0x47366c);}return _0x46ad9c['save']();};}function saveUpdates(_0x1e1132,_0x2bc0c9){return function(_0x3c1dd2){if(_0x3c1dd2){return _0x3c1dd2[_0xe024('0x34')](_0x1e1132)[_0xe024('0x1f')](function(_0x570bd4){return _0x570bd4;});}return null;};}function removeEntity(_0x2d33bf,_0x3c6be0){return function(_0x507258){if(_0x507258){return _0x507258[_0xe024('0x35')]()[_0xe024('0x1f')](function(){var _0x47af56=_0x507258[_0xe024('0x36')]({'plain':!![]});var _0x557fea='SmsAccounts';return db[_0xe024('0x37')][_0xe024('0x35')]({'where':{'type':_0x557fea,'resourceId':_0x47af56['id']}})[_0xe024('0x1f')](function(){return _0x507258;});})[_0xe024('0x1f')](function(){_0x2d33bf[_0xe024('0x2c')](0xcc)[_0xe024('0x2b')]();});}};}function handleEntityNotFound(_0x4874c5,_0x26a0fd){return function(_0x4a082a){if(!_0x4a082a){_0x4874c5[_0xe024('0x2a')](0x194);}return _0x4a082a;};}function handleError(_0xcd5ee2,_0x206da9){_0x206da9=_0x206da9||0x1f4;return function(_0x12b9f9){logger[_0xe024('0x26')](_0x12b9f9[_0xe024('0x38')]);if(_0x12b9f9[_0xe024('0x39')]){delete _0x12b9f9[_0xe024('0x39')];}_0xcd5ee2[_0xe024('0x2c')](_0x206da9)[_0xe024('0x3a')](_0x12b9f9);};}exports[_0xe024('0x3b')]=function(_0x19f235,_0x505363){var _0x2a6d12={'include':[{'model':db[_0xe024('0x3c')],'as':_0xe024('0x3d')}]},_0x1f6a33={},_0x438403={'count':0x0,'rows':[]};var _0x423d90=_[_0xe024('0x3e')](db[_0xe024('0x3f')]['rawAttributes'],function(_0x41414f){return{'name':_0x41414f[_0xe024('0x40')],'type':_0x41414f['type'][_0xe024('0x41')]};});_0x1f6a33[_0xe024('0x42')]=_['map'](_0x423d90,_0xe024('0x39'));_0x1f6a33[_0xe024('0x43')]=_[_0xe024('0x44')](_0x19f235[_0xe024('0x43')]);_0x1f6a33[_0xe024('0x45')]=_[_0xe024('0x46')](_0x1f6a33[_0xe024('0x42')],_0x1f6a33['query']);_0x2a6d12[_0xe024('0x47')]=_['intersection'](_0x1f6a33['model'],qs[_0xe024('0x48')](_0x19f235['query'][_0xe024('0x48')]));_0x2a6d12[_0xe024('0x47')]=_0x2a6d12[_0xe024('0x47')][_0xe024('0x49')]?_0x2a6d12[_0xe024('0x47')]:_0x1f6a33[_0xe024('0x42')];if(!_0x19f235[_0xe024('0x43')][_0xe024('0x4a')](_0xe024('0x4b'))){_0x2a6d12[_0xe024('0x2f')]=qs['limit'](_0x19f235['query'][_0xe024('0x2f')]);_0x2a6d12[_0xe024('0x30')]=qs[_0xe024('0x30')](_0x19f235['query'][_0xe024('0x30')]);}_0x2a6d12[_0xe024('0x4c')]=qs[_0xe024('0x4d')](_0x19f235[_0xe024('0x43')][_0xe024('0x4d')]);_0x2a6d12['where']=qs[_0xe024('0x45')](_[_0xe024('0x4e')](_0x19f235[_0xe024('0x43')],_0x1f6a33[_0xe024('0x45')]),_0x423d90);if(_0x19f235[_0xe024('0x43')][_0xe024('0x4f')]){_0x2a6d12[_0xe024('0x50')]=_[_0xe024('0x51')](_0x2a6d12[_0xe024('0x50')],{'$or':_[_0xe024('0x3e')](_0x423d90,function(_0x1e7ac1){if(_0x1e7ac1[_0xe024('0x52')]!==_0xe024('0x53')){var _0x55ac8f={};_0x55ac8f[_0x1e7ac1[_0xe024('0x39')]]={'$like':'%'+_0x19f235[_0xe024('0x43')][_0xe024('0x4f')]+'%'};return _0x55ac8f;}})});}_0x2a6d12=_[_0xe024('0x51')]({},_0x2a6d12,_0x19f235[_0xe024('0x54')]);var _0x397784={'where':_0x2a6d12[_0xe024('0x50')]};return db[_0xe024('0x3f')]['count'](_0x397784)[_0xe024('0x1f')](function(_0x1b246f){_0x438403[_0xe024('0x31')]=_0x1b246f;if(_0x19f235[_0xe024('0x43')][_0xe024('0x55')]){_0x2a6d12[_0xe024('0x56')]=[{'all':!![]}];}return db[_0xe024('0x3f')][_0xe024('0x57')](_0x2a6d12);})[_0xe024('0x1f')](function(_0x5519fd){_0x438403[_0xe024('0x58')]=_0x5519fd;return _0x438403;})[_0xe024('0x1f')](respondWithFilteredResult(_0x505363,_0x2a6d12))[_0xe024('0x29')](handleError(_0x505363,null));};exports[_0xe024('0x59')]=function(_0x25f0c2,_0x139f77){var _0x8e7b3b={'raw':![],'where':{'id':_0x25f0c2['params']['id']},'include':[{'model':db[_0xe024('0x3c')],'as':_0xe024('0x3d')}]},_0x4cb4b8={};_0x4cb4b8[_0xe024('0x42')]=_[_0xe024('0x44')](db['SmsAccount'][_0xe024('0x5a')]);_0x4cb4b8['query']=_['keys'](_0x25f0c2[_0xe024('0x43')]);_0x4cb4b8['filters']=_['intersection'](_0x4cb4b8[_0xe024('0x42')],_0x4cb4b8[_0xe024('0x43')]);_0x8e7b3b['attributes']=_['intersection'](_0x4cb4b8[_0xe024('0x42')],qs[_0xe024('0x48')](_0x25f0c2[_0xe024('0x43')][_0xe024('0x48')]));_0x8e7b3b[_0xe024('0x47')]=_0x8e7b3b[_0xe024('0x47')][_0xe024('0x49')]?_0x8e7b3b[_0xe024('0x47')]:_0x4cb4b8[_0xe024('0x42')];if(_0x25f0c2[_0xe024('0x43')][_0xe024('0x55')]){_0x8e7b3b['include']=[{'all':!![]}];}_0x8e7b3b=_[_0xe024('0x51')]({},_0x8e7b3b,_0x25f0c2[_0xe024('0x54')]);return db[_0xe024('0x3f')]['find'](_0x8e7b3b)['then'](handleEntityNotFound(_0x139f77,null))[_0xe024('0x1f')](respondWithResult(_0x139f77,null))[_0xe024('0x29')](handleError(_0x139f77,null));};exports[_0xe024('0x5b')]=function(_0x3d2b65,_0x178ef6){return db['SmsAccount'][_0xe024('0x5b')](_0x3d2b65['body'],{})[_0xe024('0x1f')](function(_0x41b536){var _0x5bd0af=_0x3d2b65['user'][_0xe024('0x36')]({'plain':!![]});if(!_0x5bd0af)throw new Error(_0xe024('0x5c'));if(_0x5bd0af[_0xe024('0x5d')]===_0xe024('0x5e')){var _0x388179=_0x41b536[_0xe024('0x36')]({'plain':!![]});var _0x4754ff=_0xe024('0x5f');return db[_0xe024('0x60')][_0xe024('0x61')]({'where':{'name':_0x4754ff,'userProfileId':_0x5bd0af[_0xe024('0x62')]},'raw':!![]})[_0xe024('0x1f')](function(_0x4a82d9){if(_0x4a82d9&&_0x4a82d9[_0xe024('0x63')]===0x0){return db['UserProfileResource']['create']({'name':_0x388179[_0xe024('0x39')],'resourceId':_0x388179['id'],'type':_0x4a82d9[_0xe024('0x39')],'sectionId':_0x4a82d9['id']},{})[_0xe024('0x1f')](function(){return _0x41b536;});}else{return _0x41b536;}})['catch'](function(_0x507606){logger['error'](_0xe024('0x64'),_0x507606);throw _0x507606;});}return _0x41b536;})['then'](respondWithResult(_0x178ef6,0xc9))[_0xe024('0x29')](handleError(_0x178ef6,null));};exports[_0xe024('0x34')]=function(_0x31de80,_0x506054){if(_0x31de80[_0xe024('0x65')]['id']){delete _0x31de80['body']['id'];}return db['SmsAccount'][_0xe024('0x61')]({'where':{'id':_0x31de80['params']['id']},'include':[{'model':db[_0xe024('0x3c')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x506054,null))[_0xe024('0x1f')](saveUpdates(_0x31de80[_0xe024('0x65')],null))[_0xe024('0x1f')](respondWithResult(_0x506054,null))[_0xe024('0x29')](handleError(_0x506054,null));};exports[_0xe024('0x35')]=function(_0x538d6a,_0xe0dae1){return db[_0xe024('0x3f')][_0xe024('0x61')]({'where':{'id':_0x538d6a['params']['id']}})['then'](handleEntityNotFound(_0xe0dae1,null))[_0xe024('0x1f')](removeEntity(_0xe0dae1,null))[_0xe024('0x29')](handleError(_0xe0dae1,null));};exports[_0xe024('0x66')]=function(_0x360aa5,_0xaa67fa){return db[_0xe024('0x3f')][_0xe024('0x66')]()[_0xe024('0x1f')](respondWithResult(_0xaa67fa,null))[_0xe024('0x29')](handleError(_0xaa67fa,null));};exports['addDisposition']=function(_0x5ddf2c,_0x1831f1,_0x471c40){if(_0x5ddf2c[_0xe024('0x65')]['id']){delete _0x5ddf2c[_0xe024('0x65')]['id'];}return db[_0xe024('0x3f')]['find']({'where':{'id':_0x5ddf2c[_0xe024('0x67')]['id']}})['then'](handleEntityNotFound(_0x1831f1,null))[_0xe024('0x1f')](function(_0x496fd2){if(_0x496fd2){_0x5ddf2c[_0xe024('0x65')]['SmsAccountId']=_0x496fd2['id'];return db[_0xe024('0x68')][_0xe024('0x5b')](_0x5ddf2c['body']);}})[_0xe024('0x1f')](respondWithResult(_0x1831f1,null))[_0xe024('0x29')](handleError(_0x1831f1,null));};exports['getDispositions']=function(_0xa13971,_0x315ff,_0xefe21e){var _0x4ec884={'raw':![],'where':{}};var _0x42d050={};var _0x5b6afa={'count':0x0,'rows':[]};return db[_0xe024('0x3f')]['findOne']({'where':{'id':_0xa13971[_0xe024('0x67')]['id']}})[_0xe024('0x1f')](handleEntityNotFound(_0x315ff,null))[_0xe024('0x1f')](function(_0x3e8c46){if(_0x3e8c46){_0x42d050['model']=_[_0xe024('0x44')](db[_0xe024('0x68')][_0xe024('0x5a')]);_0x42d050[_0xe024('0x43')]=_[_0xe024('0x44')](_0xa13971['query']);_0x42d050[_0xe024('0x45')]=_[_0xe024('0x46')](_0x42d050[_0xe024('0x42')],_0x42d050['query']);_0x4ec884['attributes']=_['intersection'](_0x42d050[_0xe024('0x42')],qs[_0xe024('0x48')](_0xa13971[_0xe024('0x43')][_0xe024('0x48')]));_0x4ec884['attributes']=_0x4ec884[_0xe024('0x47')]['length']?_0x4ec884['attributes']:_0x42d050[_0xe024('0x42')];if(!_0xa13971[_0xe024('0x43')][_0xe024('0x4a')]('nolimit')){_0x4ec884[_0xe024('0x2f')]=qs[_0xe024('0x2f')](_0xa13971[_0xe024('0x43')][_0xe024('0x2f')]);_0x4ec884[_0xe024('0x30')]=qs[_0xe024('0x30')](_0xa13971[_0xe024('0x43')][_0xe024('0x30')]);}_0x4ec884[_0xe024('0x4c')]=qs['sort'](_0xa13971['query'][_0xe024('0x4d')]);_0x4ec884['where']=qs[_0xe024('0x45')](_['pick'](_0xa13971[_0xe024('0x43')],_0x42d050[_0xe024('0x45')]));_0x4ec884['where']['SmsAccountId']=_0x3e8c46['id'];if(_0xa13971[_0xe024('0x43')][_0xe024('0x4f')]){_0x4ec884[_0xe024('0x50')]=_[_0xe024('0x51')](_0x4ec884[_0xe024('0x50')],{'$or':_[_0xe024('0x3e')](_0x4ec884[_0xe024('0x47')],function(_0x42f7f8){var _0x37651e={};_0x37651e[_0x42f7f8]={'$like':'%'+_0xa13971['query'][_0xe024('0x4f')]+'%'};return _0x37651e;})});}_0x4ec884=_[_0xe024('0x51')]({},_0x4ec884,_0xa13971[_0xe024('0x54')]);return db[_0xe024('0x68')][_0xe024('0x31')]({'where':_0x4ec884[_0xe024('0x50')]})[_0xe024('0x1f')](function(_0x156178){_0x5b6afa[_0xe024('0x31')]=_0x156178;if(_0xa13971[_0xe024('0x43')][_0xe024('0x55')]){_0x4ec884[_0xe024('0x56')]=[{'all':!![]}];}return db[_0xe024('0x68')][_0xe024('0x57')](_0x4ec884);})[_0xe024('0x1f')](function(_0x2309a7){_0x5b6afa[_0xe024('0x58')]=_0x2309a7;return _0x5b6afa;});}})[_0xe024('0x1f')](respondWithFilteredResult(_0x315ff,_0x4ec884))['catch'](handleError(_0x315ff,null));};exports['removeDispositions']=function(_0x3beb3a,_0x358579,_0x137808){return db[_0xe024('0x3f')][_0xe024('0x61')]({'where':{'id':_0x3beb3a[_0xe024('0x67')]['id']}})[_0xe024('0x1f')](handleEntityNotFound(_0x358579,null))['then'](function(_0x559421){if(_0x559421){return _0x559421[_0xe024('0x69')](_0x3beb3a[_0xe024('0x43')]['ids']);}})[_0xe024('0x1f')](respondWithStatusCode(_0x358579,null))['catch'](handleError(_0x358579,null));};exports[_0xe024('0x6a')]=function(_0x5f0682,_0x47f34f,_0x1b1def){if(_0x5f0682[_0xe024('0x65')]['id']){delete _0x5f0682['body']['id'];}return db[_0xe024('0x3f')][_0xe024('0x61')]({'where':{'id':_0x5f0682[_0xe024('0x67')]['id']}})[_0xe024('0x1f')](handleEntityNotFound(_0x47f34f,null))['then'](function(_0x507173){if(_0x507173){_0x5f0682[_0xe024('0x65')][_0xe024('0x6b')]=_0x507173['id'];return db[_0xe024('0x6c')][_0xe024('0x5b')](_0x5f0682[_0xe024('0x65')]);}})[_0xe024('0x1f')](respondWithResult(_0x47f34f,null))[_0xe024('0x29')](handleError(_0x47f34f,null));};exports[_0xe024('0x6d')]=function(_0x297f37,_0x13993e,_0x3d7580){var _0x4731d2={'raw':![],'where':{}};var _0x7a7931={};var _0x2b6627={'count':0x0,'rows':[]};return db[_0xe024('0x3f')][_0xe024('0x6e')]({'where':{'id':_0x297f37[_0xe024('0x67')]['id']}})['then'](handleEntityNotFound(_0x13993e,null))[_0xe024('0x1f')](function(_0x1742a7){if(_0x1742a7){_0x7a7931[_0xe024('0x42')]=_[_0xe024('0x44')](db['CannedAnswer'][_0xe024('0x5a')]);_0x7a7931[_0xe024('0x43')]=_[_0xe024('0x44')](_0x297f37[_0xe024('0x43')]);_0x7a7931[_0xe024('0x45')]=_[_0xe024('0x46')](_0x7a7931['model'],_0x7a7931[_0xe024('0x43')]);_0x4731d2['attributes']=_['intersection'](_0x7a7931[_0xe024('0x42')],qs['fields'](_0x297f37[_0xe024('0x43')][_0xe024('0x48')]));_0x4731d2['attributes']=_0x4731d2['attributes'][_0xe024('0x49')]?_0x4731d2[_0xe024('0x47')]:_0x7a7931['model'];if(!_0x297f37[_0xe024('0x43')][_0xe024('0x4a')]('nolimit')){_0x4731d2[_0xe024('0x2f')]=qs['limit'](_0x297f37[_0xe024('0x43')][_0xe024('0x2f')]);_0x4731d2[_0xe024('0x30')]=qs[_0xe024('0x30')](_0x297f37[_0xe024('0x43')][_0xe024('0x30')]);}_0x4731d2[_0xe024('0x4c')]=qs[_0xe024('0x4d')](_0x297f37[_0xe024('0x43')][_0xe024('0x4d')]);_0x4731d2[_0xe024('0x50')]=qs['filters'](_[_0xe024('0x4e')](_0x297f37[_0xe024('0x43')],_0x7a7931[_0xe024('0x45')]));_0x4731d2['where'][_0xe024('0x6b')]=_0x1742a7['id'];if(_0x297f37[_0xe024('0x43')][_0xe024('0x4f')]){_0x4731d2['where']=_[_0xe024('0x51')](_0x4731d2[_0xe024('0x50')],{'$or':_[_0xe024('0x3e')](_0x4731d2[_0xe024('0x47')],function(_0x153efe){var _0x132f67={};_0x132f67[_0x153efe]={'$like':'%'+_0x297f37[_0xe024('0x43')][_0xe024('0x4f')]+'%'};return _0x132f67;})});}_0x4731d2=_['merge']({},_0x4731d2,_0x297f37[_0xe024('0x54')]);return db[_0xe024('0x6c')][_0xe024('0x31')]({'where':_0x4731d2['where']})[_0xe024('0x1f')](function(_0xce30c6){_0x2b6627[_0xe024('0x31')]=_0xce30c6;if(_0x297f37[_0xe024('0x43')][_0xe024('0x55')]){_0x4731d2[_0xe024('0x56')]=[{'all':!![]}];}return db[_0xe024('0x6c')][_0xe024('0x57')](_0x4731d2);})[_0xe024('0x1f')](function(_0x505fbd){_0x2b6627[_0xe024('0x58')]=_0x505fbd;return _0x2b6627;});}})[_0xe024('0x1f')](respondWithFilteredResult(_0x13993e,_0x4731d2))[_0xe024('0x29')](handleError(_0x13993e,null));};exports[_0xe024('0x6f')]=function(_0xb72460,_0xdad160,_0x4b472b){return db['SmsAccount']['find']({'where':{'id':_0xb72460[_0xe024('0x67')]['id']}})[_0xe024('0x1f')](handleEntityNotFound(_0xdad160,null))[_0xe024('0x1f')](function(_0x39a869){if(_0x39a869){return _0x39a869[_0xe024('0x6f')](_0xb72460[_0xe024('0x43')]['ids']);}})['then'](respondWithStatusCode(_0xdad160,null))[_0xe024('0x29')](handleError(_0xdad160,null));};exports[_0xe024('0x70')]=function(_0x172732,_0x1332e8,_0x55367a){var _0x5a4da9={'channel':_0xe024('0x71')};var _0x494f60=[];var _0x52ddfd=[];var _0x48bb4a={};return db['SmsAccount'][_0xe024('0x61')]({'where':{'id':_0x172732[_0xe024('0x67')]['id']},'include':[{'model':db[_0xe024('0x72')],'as':_0xe024('0x73')}]})[_0xe024('0x1f')](handleEntityNotFound(_0x1332e8,null))['then'](function(_0x4d53bb){_0x5a4da9[_0xe024('0x74')]=_0x4d53bb;_0x5a4da9[_0xe024('0x75')]=_[_0xe024('0x76')](_0x4d53bb[_0xe024('0x73')],[_0xe024('0x77')],[_0xe024('0x78')]);if(_0x5a4da9[_0xe024('0x74')][_0xe024('0x73')]){delete _0x5a4da9['account']['Applications'];}return db[_0xe024('0x79')]['describe']();})[_0xe024('0x1f')](function(_0xa614f5){if(!_0xa614f5){throw new db[(_0xe024('0x7a'))][(_0xe024('0x7b'))](_0xe024('0x7c'));}_0x494f60=_['difference'](_[_0xe024('0x44')](_0xa614f5),['createdAt',_0xe024('0x7d')]);_0x52ddfd=_[_0xe024('0x7e')](_[_0xe024('0x44')](_0xa614f5),[_0xe024('0x7f'),'updatedAt','CompanyId',_0xe024('0x80')]);_0x5a4da9['body']={'mapKey':_0xe024('0x81')};if(_0x5a4da9[_0xe024('0x74')][_0xe024('0x52')]){switch(_0x5a4da9[_0xe024('0x74')][_0xe024('0x52')]){case _0xe024('0x82'):_0x5a4da9[_0xe024('0x65')][_0xe024('0x83')]=_0x172732[_0xe024('0x65')]['From'];_0x5a4da9['body']['body']=_0x172732[_0xe024('0x65')][_0xe024('0x84')];_0x5a4da9[_0xe024('0x65')]['messageId']=_0x172732[_0xe024('0x65')]['MessageSid'];break;case'skebby':_0x5a4da9['body'][_0xe024('0x83')]='+'+_0x172732[_0xe024('0x65')]['sender'];_0x5a4da9[_0xe024('0x65')][_0xe024('0x65')]=_0x172732[_0xe024('0x65')][_0xe024('0x85')];break;case _0xe024('0x86'):_0x5a4da9[_0xe024('0x65')]['from']=_0x172732[_0xe024('0x65')][_0xe024('0x83')];_0x5a4da9[_0xe024('0x65')][_0xe024('0x65')]=_0x172732[_0xe024('0x65')]['message'];break;case _0xe024('0x87'):_0x5a4da9[_0xe024('0x65')][_0xe024('0x83')]=_0x172732['body'][_0xe024('0x83')];_0x5a4da9[_0xe024('0x65')][_0xe024('0x65')]=_0x172732['body'][_0xe024('0x65')];_0x5a4da9[_0xe024('0x65')][_0xe024('0x88')]=_0x172732['body']['message_id'];break;case _0xe024('0x89'):_0x5a4da9['body']['from']=_0x172732[_0xe024('0x65')][_0xe024('0x8a')];_0x5a4da9[_0xe024('0x65')][_0xe024('0x65')]=_0x172732['body'][_0xe024('0x8b')];_0x5a4da9[_0xe024('0x65')]['messageId']=_0x172732[_0xe024('0x65')][_0xe024('0x8c')];break;case _0xe024('0x8d'):_0x5a4da9['body'][_0xe024('0x83')]='+'+_0x172732[_0xe024('0x65')]['results'][0x0][_0xe024('0x83')];_0x5a4da9[_0xe024('0x65')][_0xe024('0x65')]=_0x172732['body'][_0xe024('0x8e')][0x0][_0xe024('0x85')];_0x5a4da9[_0xe024('0x65')]['messageId']=_0x172732[_0xe024('0x65')][_0xe024('0x8e')][0x0]['messageId'];break;case _0xe024('0x8f'):_0x5a4da9[_0xe024('0x65')][_0xe024('0x83')]=_0x172732[_0xe024('0x65')][_0xe024('0x90')];_0x5a4da9[_0xe024('0x65')][_0xe024('0x65')]=_0x172732[_0xe024('0x65')][_0xe024('0x91')][_0xe024('0x27')];break;case _0xe024('0x92'):_0x5a4da9[_0xe024('0x65')][_0xe024('0x83')]=_0x172732['body']['fromNumber'];_0x5a4da9['body'][_0xe024('0x65')]=_0x172732['body'][_0xe024('0x85')];_0x5a4da9['body'][_0xe024('0x88')]=_0x172732[_0xe024('0x65')][_0xe024('0x93')];break;case'bandwidth':_0x5a4da9[_0xe024('0x65')][_0xe024('0x88')]=_0x172732['body'][0x0][_0xe024('0x27')]['id'];_0x5a4da9['body'][_0xe024('0x83')]=_0x172732[_0xe024('0x65')][0x0][_0xe024('0x27')][_0xe024('0x83')];_0x5a4da9['body'][_0xe024('0x65')]=_0x172732[_0xe024('0x65')][0x0][_0xe024('0x27')][_0xe024('0x85')];break;case _0xe024('0x94'):_0x5a4da9[_0xe024('0x65')][_0xe024('0x83')]=_0x172732['body'][_0xe024('0x83')];_0x5a4da9[_0xe024('0x65')][_0xe024('0x65')]=_0x172732[_0xe024('0x65')]['message'];_0x5a4da9[_0xe024('0x65')][_0xe024('0x88')]=_0x172732['body'][_0xe024('0x95')];break;}}if(_0x5a4da9['body']['id']){delete _0x5a4da9[_0xe024('0x65')]['id'];}if(_[_0xe024('0x96')](_0x5a4da9[_0xe024('0x65')][_0xe024('0x83')])){throw new db[(_0xe024('0x7a'))]['ValidationError'](_0xe024('0x97'));}if(_[_0xe024('0x96')](_0x5a4da9['body'][_0xe024('0x65')])||_0x5a4da9['body'][_0xe024('0x65')]===''){throw new db[(_0xe024('0x7a'))][(_0xe024('0x7b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xe024('0x96')](_0x5a4da9[_0xe024('0x65')]['mapKey'])){throw new db[(_0xe024('0x7a'))][(_0xe024('0x7b'))](_0xe024('0x98')+_0x52ddfd);}if(!_[_0xe024('0x99')](_0x52ddfd,_0x5a4da9[_0xe024('0x65')][_0xe024('0x9a')])){throw new db['Sequelize']['ValidationError'](_0xe024('0x9b')+_0x52ddfd);}_0x48bb4a[_0x5a4da9[_0xe024('0x65')][_0xe024('0x9a')]]=_0x5a4da9['body']['from'];return db[_0xe024('0x9c')][_0xe024('0x61')]({'where':{'id':_0x5a4da9[_0xe024('0x74')][_0xe024('0x80')]},'include':[{'model':db[_0xe024('0x79')],'as':_0xe024('0x9d'),'where':_0x48bb4a,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0xe024('0x1f')](handleEntityNotFound(_0x1332e8,null))[_0xe024('0x1f')](function(_0x2b74e4){if(_0x2b74e4){_0x5a4da9['list']=_[_0xe024('0x9e')](_0x2b74e4,[_0xe024('0x9d')]);if(_0x2b74e4[_0xe024('0x9d')][_0xe024('0x49')]){return _0x2b74e4['Contacts'][0x0];}var _0x2d1afd=_[_0xe024('0x18')](_0x5a4da9[_0xe024('0x65')],{'firstName':_0x5a4da9[_0xe024('0x65')][_0xe024('0x83')],'ListId':_0x2b74e4['id']});_0x2d1afd[_0x5a4da9[_0xe024('0x65')][_0xe024('0x9a')]]=_0x5a4da9[_0xe024('0x65')]['from'];return db[_0xe024('0x79')][_0xe024('0x5b')](_0x2d1afd,{'fields':_0x494f60,'raw':!![]});}})[_0xe024('0x1f')](handleEntityNotFound(_0x1332e8,null))['then'](function(_0x200dd2){if(_0x200dd2){_0x5a4da9['contact']=_0x200dd2;var _0x5d0883={'ContactId':_0x200dd2['id'],'phone':_0x5a4da9['body']['from'],'SmsAccountId':_0x172732[_0xe024('0x67')]['id']};var _0x191017={'ContactId':_0x200dd2['id'],'SmsAccountId':_0x172732[_0xe024('0x67')]['id'],'closed':![]};return db['SmsInteraction'][_0xe024('0x61')]({'where':_0x191017})[_0xe024('0x1f')](function(_0x1df2ec){if(_0x1df2ec){return[_0x1df2ec,![]];}return db[_0xe024('0x9f')][_0xe024('0x5b')](_0x5d0883)[_0xe024('0x1f')](function(_0xdb39c3){return[_0xdb39c3,!![]];});});}})['spread'](function(_0x2d1f80,_0x5022f0){_0x5a4da9[_0xe024('0xa0')]=_0x2d1f80['get']({'plain':!![]});_0x5a4da9[_0xe024('0xa0')][_0xe024('0xa1')]=![];if(_0x5022f0){if(_0x5a4da9[_0xe024('0x74')]['autoclose']){_0x5a4da9[_0xe024('0x75')][_0xe024('0xa2')]({'id':0x0,'priority':_0x5a4da9[_0xe024('0x75')][_0xe024('0x49')]+0x1,'app':_0xe024('0xa3'),'appdata':_0xe024('0xa4'),'interval':_0xe024('0xa5')});}_0x5a4da9['interaction'][_0xe024('0xa1')]=!![];}return db[_0xe024('0xa6')][_0xe024('0x5b')]({'phone':_0x5a4da9[_0xe024('0x65')][_0xe024('0x83')],'messageId':_0x5a4da9[_0xe024('0x65')][_0xe024('0x88')],'body':_0x5a4da9['body']['body'],'SmsAccountId':_0x172732[_0xe024('0x67')]['id'],'SmsInteractionId':_0x2d1f80['id'],'direction':'in','ContactId':_0x2d1f80['ContactId'],'AttachmentId':_0x5a4da9[_0xe024('0x65')]['AttachmentId']});})[_0xe024('0x1f')](function(_0x312ccf){_0x5a4da9['message']=_0x312ccf;if(_0x5a4da9[_0xe024('0xa0')]['UserId']){return db['User']['find']({'attributes':['id',_0xe024('0x39')],'where':{'id':_0x5a4da9[_0xe024('0xa0')]['UserId']}})[_0xe024('0x1f')](function(_0x52ff0a){if(_0x52ff0a){_0x5a4da9[_0xe024('0x75')]['unshift']({'id':0x0,'priority':0x0,'app':_0xe024('0xa7'),'appdata':_0x52ff0a[_0xe024('0x39')]+','+(_0x5a4da9[_0xe024('0x74')][_0xe024('0xa8')]||0xa),'interval':_0xe024('0xa5')});}return respondWithRpcPromise(_0xe024('0xa9'),_0xe024('0xaa'),_0x5a4da9);});}return respondWithRpcPromise(_0xe024('0xa9'),'startRouting',_0x5a4da9);})[_0xe024('0x1f')](function(_0x3fecae){if(_0x3fecae){var _0x43eb37=0xc8;var _0x17ff8b=_0xe024('0xab');logger[_0xe024('0x20')](_0xe024('0x23'),_0x17ff8b,_0x43eb37,_0xe024('0xac'));logger[_0xe024('0x22')](_0xe024('0xad'),_0x17ff8b,_0x43eb37,_0xe024('0xac'),JSON[_0xe024('0x25')](_0x3fecae));if(_0x5a4da9[_0xe024('0x74')][_0xe024('0x52')]===_0xe024('0x82')){return _0x1332e8[_0xe024('0x2c')](_0x43eb37)['set'](_0xe024('0xae'),_0xe024('0xaf'))['send'](_0xe024('0xb0'));}else{return _0x1332e8['status'](_0x43eb37)['json'](_0x3fecae);}}})['catch'](handleError(_0x1332e8,null));};exports['addApplications']=function(_0x48c42b,_0x4bd8c4,_0x441ab5){return db[_0xe024('0x3f')][_0xe024('0x6e')]({'where':{'id':_0x48c42b['params']['id']}})[_0xe024('0x1f')](handleEntityNotFound(_0x4bd8c4,null))[_0xe024('0x1f')](function(_0x2c54b8){if(_0x2c54b8){return db['sequelize'][_0xe024('0xb1')](function(_0x3a3f01){return db[_0xe024('0x72')][_0xe024('0x35')]({'where':{'SmsAccountId':_0x48c42b['params']['id']},'transaction':_0x3a3f01})['then'](function(_0x5a68ce){var _0x363520=_[_0xe024('0x3e')](_0x48c42b[_0xe024('0x65')],function(_0x472b93){_0x472b93['SmsAccountId']=_0x48c42b[_0xe024('0x67')]['id'];return _0x472b93;});return db[_0xe024('0x72')][_0xe024('0xb2')](_0x363520,{'transaction':_0x3a3f01});});})['then'](function(){return db['SmsApplication']['findAndCountAll']({'where':{'SmsAccountId':_0x48c42b[_0xe024('0x67')]['id']},'order':_0xe024('0x77')});});}})[_0xe024('0x1f')](respondWithResult(_0x4bd8c4,null))[_0xe024('0x29')](handleError(_0x4bd8c4,null));};exports[_0xe024('0xb3')]=function(_0x11ec06,_0x3a1355,_0x232a7f){var _0x4a369c={};var _0x4a516e={};var _0x38ff98;var _0x537001;return db[_0xe024('0x3f')][_0xe024('0x6e')]({'where':{'id':_0x11ec06[_0xe024('0x67')]['id']}})[_0xe024('0x1f')](handleEntityNotFound(_0x3a1355,null))['then'](function(_0x587c50){if(_0x587c50){_0x38ff98=_0x587c50;_0x4a516e[_0xe024('0x42')]=_[_0xe024('0x44')](db['SmsApplication'][_0xe024('0x5a')]);_0x4a516e[_0xe024('0x43')]=_[_0xe024('0x44')](_0x11ec06[_0xe024('0x43')]);_0x4a516e[_0xe024('0x45')]=_[_0xe024('0x46')](_0x4a516e[_0xe024('0x42')],_0x4a516e[_0xe024('0x43')]);_0x4a369c['attributes']=_[_0xe024('0x46')](_0x4a516e[_0xe024('0x42')],qs['fields'](_0x11ec06['query'][_0xe024('0x48')]));_0x4a369c[_0xe024('0x47')]=_0x4a369c[_0xe024('0x47')][_0xe024('0x49')]?_0x4a369c[_0xe024('0x47')]:_0x4a516e[_0xe024('0x42')];_0x4a369c['order']=qs[_0xe024('0x4d')](_0x11ec06[_0xe024('0x43')]['sort']);_0x4a369c[_0xe024('0x50')]=qs['filters'](_['pick'](_0x11ec06['query'],_0x4a516e['filters']));if(_0x11ec06[_0xe024('0x43')][_0xe024('0x4f')]){_0x4a369c[_0xe024('0x50')]=_[_0xe024('0x51')](_0x4a369c[_0xe024('0x50')],{'$or':_[_0xe024('0x3e')](_0x4a369c[_0xe024('0x47')],function(_0x4d6b81){var _0x17a50a={};_0x17a50a[_0x4d6b81]={'$like':'%'+_0x11ec06[_0xe024('0x43')]['filter']+'%'};return _0x17a50a;})});}_0x4a369c=_['merge']({},_0x4a369c,_0x11ec06[_0xe024('0x54')]);return _0x38ff98[_0xe024('0xb3')](_0x4a369c);}})['then'](function(_0x200b32){if(_0x200b32){_0x537001=_0x200b32['length'];if(!_0x11ec06[_0xe024('0x43')][_0xe024('0x4a')](_0xe024('0x4b'))){_0x4a369c[_0xe024('0x2f')]=qs['limit'](_0x11ec06['query'][_0xe024('0x2f')]);_0x4a369c[_0xe024('0x30')]=qs[_0xe024('0x30')](_0x11ec06[_0xe024('0x43')][_0xe024('0x30')]);}return _0x38ff98['getApplications'](_0x4a369c);}})[_0xe024('0x1f')](function(_0x5b7afc){if(_0x5b7afc){return _0x5b7afc?{'count':_0x537001,'rows':_0x5b7afc}:null;}})[_0xe024('0x1f')](respondWithResult(_0x3a1355,null))[_0xe024('0x29')](handleError(_0x3a1355,null));};exports[_0xe024('0xb4')]=function(_0x51e9d1,_0x45e3c5,_0x2ae907){var _0x257903={'raw':![],'where':{}};var _0x27a47e={};var _0x37b13a={'count':0x0,'rows':[]};return db[_0xe024('0x3f')][_0xe024('0x6e')]({'where':{'id':_0x51e9d1['params']['id']}})[_0xe024('0x1f')](handleEntityNotFound(_0x45e3c5,null))[_0xe024('0x1f')](function(_0x27d53b){if(_0x27d53b){_0x27a47e[_0xe024('0x42')]=_['keys'](db['SmsInteraction']['rawAttributes']);_0x27a47e['query']=_[_0xe024('0x44')](_0x51e9d1[_0xe024('0x43')]);_0x27a47e[_0xe024('0x45')]=_[_0xe024('0x46')](_0x27a47e['model'],_0x27a47e['query']);_0x257903[_0xe024('0x47')]=_['intersection'](_0x27a47e['model'],qs[_0xe024('0x48')](_0x51e9d1[_0xe024('0x43')]['fields']));_0x257903['attributes']=_0x257903[_0xe024('0x47')][_0xe024('0x49')]?_0x257903['attributes']:_0x27a47e[_0xe024('0x42')];if(!_0x51e9d1['query']['hasOwnProperty'](_0xe024('0x4b'))){_0x257903[_0xe024('0x2f')]=qs[_0xe024('0x2f')](_0x51e9d1[_0xe024('0x43')][_0xe024('0x2f')]);_0x257903[_0xe024('0x30')]=qs[_0xe024('0x30')](_0x51e9d1[_0xe024('0x43')][_0xe024('0x30')]);}_0x257903['order']=qs[_0xe024('0x4d')](_0x51e9d1[_0xe024('0x43')]['sort']);_0x257903[_0xe024('0x50')]=qs['filters'](_[_0xe024('0x4e')](_0x51e9d1['query'],_0x27a47e[_0xe024('0x45')]));_0x257903[_0xe024('0x50')][_0xe024('0x6b')]=_0x27d53b['id'];if(_0x51e9d1[_0xe024('0x43')]['filter']){_0x257903['where']=_[_0xe024('0x51')](_0x257903[_0xe024('0x50')],{'$or':_[_0xe024('0x3e')](_0x257903[_0xe024('0x47')],function(_0x4d5520){var _0x804c35={};_0x804c35[_0x4d5520]={'$like':'%'+_0x51e9d1[_0xe024('0x43')][_0xe024('0x4f')]+'%'};return _0x804c35;})});}_0x257903=_['merge']({},_0x257903,_0x51e9d1[_0xe024('0x54')]);return db[_0xe024('0x9f')][_0xe024('0x31')]({'where':_0x257903[_0xe024('0x50')]})[_0xe024('0x1f')](function(_0x1c824c){_0x37b13a[_0xe024('0x31')]=_0x1c824c;if(_0x51e9d1[_0xe024('0x43')][_0xe024('0x55')]){_0x257903[_0xe024('0x56')]=[{'model':db[_0xe024('0x79')],'as':_0xe024('0xb5'),'required':![]},{'model':db[_0xe024('0xb6')],'as':_0xe024('0xb7'),'attributes':['name',_0xe024('0xb8'),_0xe024('0xb9')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xe024('0x39'),_0xe024('0xba')],'where':_0x51e9d1[_0xe024('0x43')][_0xe024('0xbb')]?{'id':_0x51e9d1[_0xe024('0x43')][_0xe024('0xbb')]}:undefined,'required':_0x51e9d1[_0xe024('0x43')]['tag']?!![]:![]}];}return db[_0xe024('0x9f')][_0xe024('0x57')](_0x257903);})['then'](function(_0x12eebd){_0x37b13a[_0xe024('0x58')]=_0x12eebd;return _0x37b13a;});}})['then'](respondWithFilteredResult(_0x45e3c5,_0x257903))[_0xe024('0x29')](handleError(_0x45e3c5,null));};exports[_0xe024('0x3a')]=function(_0x3dfad8,_0x2cbf03,_0x553c03){var _0x5a3ef6,_0x568d5b,_0x1d776f;if(_[_0xe024('0x96')](_0x3dfad8[_0xe024('0x65')][_0xe024('0x65')])||_0x3dfad8[_0xe024('0x65')][_0xe024('0x65')]===''){throw new db['Sequelize']['ValidationError'](_0xe024('0xbc'));}if(_['isNil'](_0x3dfad8[_0xe024('0x65')]['to'])){throw new db[(_0xe024('0x7a'))][(_0xe024('0x7b'))](_0xe024('0xbd'));}_0x5a3ef6=_0x3dfad8[_0xe024('0x65')]['to'];return db[_0xe024('0x3f')]['find']({'where':{'id':_0x3dfad8[_0xe024('0x67')]['id']},'include':[{'model':db[_0xe024('0x9c')],'as':_0xe024('0xbe'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x5a3ef6},'limit':0x1,'order':[[_0xe024('0x7d'),_0xe024('0xbf')]]}]}]})[_0xe024('0x1f')](handleEntityNotFound(_0x2cbf03,null))[_0xe024('0x1f')](function(_0x33040a){if(_0x33040a&&_0x33040a[_0xe024('0xbe')]){_0x568d5b=_0x33040a[_0xe024('0x36')]({'plain':!![]});if(_0x568d5b[_0xe024('0xbe')]&&_0x568d5b[_0xe024('0xbe')][_0xe024('0x9d')][_0xe024('0x49')]){return _0x568d5b[_0xe024('0xbe')][_0xe024('0x9d')][0x0];}return db['CmContact'][_0xe024('0x5b')](_[_0xe024('0x18')](_0x3dfad8['body'],{'firstName':_0x5a3ef6,'mobile':_0x5a3ef6,'phone':_0x5a3ef6,'ListId':_0x568d5b[_0xe024('0x80')]}));}})[_0xe024('0x1f')](handleEntityNotFound(_0x2cbf03,null))[_0xe024('0x1f')](function(_0x322c48){if(_0x322c48){_0x1d776f=_0x322c48;return db[_0xe024('0x9f')][_0xe024('0x61')]({'where':{'ContactId':_0x1d776f['id'],'closed':![],'SmsAccountId':_0x568d5b['id']}})[_0xe024('0x1f')](function(_0x57bd96){if(_0x57bd96){return[_0x57bd96,![]];}return db[_0xe024('0x9f')]['create']({'UserId':_0x3dfad8[_0xe024('0x5e')]['id'],'ContactId':_0x1d776f['id'],'SmsAccountId':_0x568d5b['id'],'phone':_0x5a3ef6,'firstMsgDirection':_0xe024('0xc0'),'Messages':[_[_0xe024('0x51')](_0x3dfad8[_0xe024('0x65')],{'read':![],'body':_0x3dfad8[_0xe024('0x65')]['body'],'phone':_0x5a3ef6,'SmsAccountId':_0x568d5b['id'],'UserId':_0x3dfad8[_0xe024('0x5e')]['id'],'ContactId':_0x1d776f['id']})]},{'include':[{'model':db[_0xe024('0xa6')],'as':_0xe024('0xc1')}]})[_0xe024('0x1f')](function(_0x154ad6){return[_0x154ad6,!![]];});});}})['spread'](function(_0x40813d,_0x4a3342){if(_0x4a3342){return _0x40813d;}return db['SmsMessage']['create'](_[_0xe024('0x51')](_0x3dfad8[_0xe024('0x65')],{'read':![],'body':_0x3dfad8[_0xe024('0x65')][_0xe024('0x65')],'phone':_0x5a3ef6,'SmsAccountId':_0x568d5b['id'],'SmsInteractionId':_0x40813d['id'],'UserId':_0x3dfad8[_0xe024('0x5e')]['id'],'ContactId':_0x1d776f['id']}))[_0xe024('0x1f')](function(_0x435012){_0x40813d[_0xe024('0xc2')][_0xe024('0xc1')]=[];_0x40813d[_0xe024('0xc2')][_0xe024('0xc1')]['push'](_0x435012['dataValues']);return _0x40813d;});})[_0xe024('0x1f')](respondWithResult(_0x2cbf03,null))[_0xe024('0x29')](handleError(_0x2cbf03,null));};exports[_0xe024('0x2c')]=function(_0x45b84b,_0x520da2,_0x2e461c){if(_0x45b84b[_0xe024('0x65')]['id']){delete _0x45b84b[_0xe024('0x65')]['id'];}var _0x23a6c3,_0x43a3a7,_0x5caef5;return db[_0xe024('0x3f')][_0xe024('0x61')]({'where':{'id':_0x45b84b[_0xe024('0x67')]['id']}})[_0xe024('0x1f')](handleEntityNotFound(_0x520da2,null))[_0xe024('0x1f')](function(_0x5760c7){if(_0x5760c7){_0x5caef5=_0x5760c7;logger[_0xe024('0x22')](_0xe024('0x23'),_0xe024('0x2c'),'received\x20delivery\x20report\x20from',_0x5760c7['type'],util[_0xe024('0xc3')](_0x45b84b['body'],{'showHidden':![],'depth':null}));switch(_0x5760c7[_0xe024('0x52')]){case'skebby':if(_0x45b84b[_0xe024('0x65')][_0xe024('0xc4')]&&_0x45b84b[_0xe024('0x65')][_0xe024('0x2c')]){_0x43a3a7=_0x45b84b[_0xe024('0x65')]['status'];return db['SmsMessage'][_0xe024('0x61')]({'where':{'messageId':_0x45b84b[_0xe024('0x65')]['skebby_dispatch_id']}});}break;case _0xe024('0x86'):if(_0x45b84b[_0xe024('0x65')]['requestid']&&_0x45b84b[_0xe024('0x65')]['statusInt']){_0x43a3a7=_0x45b84b[_0xe024('0x65')][_0xe024('0xc5')];return db['SmsMessage'][_0xe024('0x61')]({'where':{'messageId':_0x45b84b['body']['requestid']}});}break;case _0xe024('0x87'):if(_0x45b84b[_0xe024('0x65')][_0xe024('0xc6')]&&_0x45b84b[_0xe024('0x65')]['status_code']){_0x43a3a7=_0x45b84b[_0xe024('0x65')][_0xe024('0xc7')];return db[_0xe024('0xa6')][_0xe024('0x61')]({'where':{'messageId':_0x45b84b[_0xe024('0x65')][_0xe024('0xc6')]}});}break;case'infobip':var _0x4889c=_0x45b84b[_0xe024('0x65')][_0xe024('0x8e')][0x0];if(_0x4889c[_0xe024('0x88')]&&_0x4889c[_0xe024('0x2c')][_0xe024('0xc8')]===_0xe024('0xc9')){_0x43a3a7=_0x4889c[_0xe024('0x2c')][_0xe024('0xc8')];return db['SmsMessage'][_0xe024('0x61')]({'where':{'messageId':_0x4889c[_0xe024('0x88')]}});}break;case _0xe024('0x92'):if(_0x45b84b[_0xe024('0x65')][_0xe024('0x88')]&&_0x45b84b[_0xe024('0x65')][_0xe024('0x2c')]){_0x43a3a7=_0x45b84b['body']['status'];return db[_0xe024('0xa6')][_0xe024('0x61')]({'where':{'messageId':_0x45b84b[_0xe024('0x65')][_0xe024('0x88')]}});}break;case _0xe024('0xca'):if(_0x45b84b[_0xe024('0x65')][0x0]['message']['id']){_0x43a3a7=_0x45b84b['body'][0x0][_0xe024('0x52')];return db[_0xe024('0xa6')][_0xe024('0x61')]({'where':{'messageId':_0x45b84b[_0xe024('0x65')][0x0][_0xe024('0x27')]['id']}});}break;case _0xe024('0x94'):if(_0x45b84b[_0xe024('0x65')]['redif']&&_0x45b84b['body'][_0xe024('0x2c')]){_0x43a3a7=_0x45b84b['body'][_0xe024('0x2c')];return db[_0xe024('0xa6')][_0xe024('0x61')]({'where':{'messageId':_0x45b84b[_0xe024('0x65')][_0xe024('0xcb')]}});}break;}}})[_0xe024('0x1f')](handleEntityNotFound(_0x520da2,null))[_0xe024('0x1f')](function(_0x5233cb){if(_0x5233cb){_0x23a6c3=_0x5233cb;switch(_0x5caef5[_0xe024('0x52')]){case'skebby':if(_0x43a3a7==='DELIVERED'){return _0x23a6c3[_0xe024('0x34')]({'read':!![]});}else{logger[_0xe024('0x26')](_0xe024('0x23'),_0xe024('0x2c'),_0xe024('0xcc'),util[_0xe024('0xc3')](_0x45b84b[_0xe024('0x65')],{'showHidden':![],'depth':null}));}break;case _0xe024('0x86'):if(_0x43a3a7==='1'){return _0x23a6c3['update']({'read':!![]});}else{logger[_0xe024('0x26')](_0xe024('0x23'),_0xe024('0x2c'),_0xe024('0xcc'),util[_0xe024('0xc3')](_0x45b84b[_0xe024('0x65')],{'showHidden':![],'depth':null}));}break;case _0xe024('0x87'):if(!_0x45b84b[_0xe024('0x65')]['error_code']&&_0x43a3a7>=0xc8&&_0x43a3a7<=0xce){return _0x23a6c3[_0xe024('0x34')]({'read':!![]});}else{logger['error'](_0xe024('0x23'),_0xe024('0x2c'),_0xe024('0x87'),util[_0xe024('0xc3')](_0x45b84b[_0xe024('0x65')],{'showHidden':![],'depth':null}));}break;case _0xe024('0x8d'):var _0xaca5cf=_0x45b84b[_0xe024('0x65')][_0xe024('0x8e')][0x0];if(_0xaca5cf[_0xe024('0x2c')]['groupName']==='DELIVERED'){return _0x23a6c3[_0xe024('0x34')]({'read':!![]});}else{logger[_0xe024('0x26')](_0xe024('0x23'),_0xe024('0x2c'),_0xe024('0x8d'),util[_0xe024('0xc3')](_0x45b84b['body'],{'showHidden':![],'depth':null}));}break;case _0xe024('0x92'):if(_0x43a3a7==_0xe024('0xcd')||_0x43a3a7==_0xe024('0xce')){return _0x23a6c3[_0xe024('0x34')]({'read':!![]});}else{logger[_0xe024('0x26')](_0xe024('0x23'),'status',_0xe024('0x92'),util[_0xe024('0xc3')](_0x45b84b[_0xe024('0x65')],{'showHidden':![],'depth':null}));}break;case _0xe024('0xca'):if(_0x43a3a7==_0xe024('0xcf')){return _0x23a6c3['update']({'read':!![]});}else{logger['error'](_0xe024('0x23'),_0xe024('0x2c'),_0xe024('0xca'),util[_0xe024('0xc3')](_0x45b84b[_0xe024('0x65')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x43a3a7===_0xe024('0xd0')||_0x43a3a7===_0xe024('0xd1')){return _0x23a6c3['update']({'read':!![]});}else{logger[_0xe024('0x26')](_0xe024('0x23'),'status',_0xe024('0x94'),util[_0xe024('0xc3')](_0x45b84b[_0xe024('0x65')],{'showHidden':![],'depth':null}));}break;}return _0x23a6c3;}})[_0xe024('0x1f')](respondWithResult(_0x520da2,null))[_0xe024('0x29')](handleError(_0x520da2,null));};exports[_0xe024('0xd2')]=function(_0x48114d,_0x22ebe2,_0x3010f8){var _0x1a1901,_0x40d5fb,_0xd80c6;return db['SmsAccount'][_0xe024('0x61')]({'where':{'id':_0x48114d[_0xe024('0x67')]['id']}})['then'](handleEntityNotFound(_0x22ebe2,null))[_0xe024('0x1f')](function(_0x1a00ac){if(_0x1a00ac){_0xd80c6=_0x1a00ac;logger[_0xe024('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xe024('0x2c'),_0xe024('0xd3'),_0x1a00ac[_0xe024('0x52')],util[_0xe024('0xc3')](_0x48114d[_0xe024('0x43')],{'showHidden':![],'depth':null}));switch(_0x1a00ac['type']){case'csc':if(_0x48114d['query'][_0xe024('0xd4')]&&_0x48114d[_0xe024('0x43')][_0xe024('0xd5')]){_0x40d5fb=_0x48114d['query'][_0xe024('0xd5')];return db[_0xe024('0xa6')][_0xe024('0x61')]({'where':{'messageId':_0x48114d[_0xe024('0x43')][_0xe024('0xd4')]}});}break;}}})[_0xe024('0x1f')](handleEntityNotFound(_0x22ebe2,null))['then'](function(_0x213fb1){if(_0x213fb1){_0x1a1901=_0x213fb1;switch(_0xd80c6[_0xe024('0x52')]){case'csc':if(_0x40d5fb==='2'||_0x40d5fb==='6'){return _0x1a1901[_0xe024('0x34')]({'read':!![]});}else{logger[_0xe024('0x26')](_0xe024('0x23'),_0xe024('0x2c'),_0xe024('0x8f'),util[_0xe024('0xc3')](_0x48114d['query'],{'showHidden':![],'depth':null}));};break;}return _0x1a1901;}})[_0xe024('0x1f')](respondWithResult(_0x22ebe2,null))['catch'](handleError(_0x22ebe2,null));};exports[_0xe024('0xd6')]=function(_0x451da5,_0x1080c1,_0x5c6406){return db['SmsAccount'][_0xe024('0x61')]({'where':{'id':_0x451da5[_0xe024('0x67')]['id']}})[_0xe024('0x1f')](handleEntityNotFound(_0x1080c1,null))[_0xe024('0x1f')](function(_0x41a304){if(_0x41a304){return _0x41a304[_0xe024('0xd6')](_0x451da5[_0xe024('0x65')][_0xe024('0xd7')],_['omit'](_0x451da5['body'],['ids','id'])||{})['spread'](function(_0x2348c8){for(var _0x348c1e=0x0;_0x348c1e<_0x451da5['body'][_0xe024('0xd7')]['length'];_0x348c1e+=0x1){socket[_0xe024('0xd8')]('userSmsAccount:save',{'UserId':Number(_0x451da5['body'][_0xe024('0xd7')][_0x348c1e]),'SmsAccountId':Number(_0x451da5['params']['id'])});}return _0x2348c8;});}})[_0xe024('0x1f')](respondWithResult(_0x1080c1,null))[_0xe024('0x29')](handleError(_0x1080c1,null));};exports[_0xe024('0xd9')]=function(_0x492a13,_0x25860b,_0x15f37e){return db[_0xe024('0x3f')][_0xe024('0x61')]({'where':{'id':_0x492a13[_0xe024('0x67')]['id']}})['then'](handleEntityNotFound(_0x25860b,null))[_0xe024('0x1f')](function(_0x2e207a){if(_0x2e207a){return _0x2e207a[_0xe024('0xd9')](_0x492a13[_0xe024('0x43')][_0xe024('0xd7')])[_0xe024('0x1f')](function(){if(_[_0xe024('0xda')](_0x492a13[_0xe024('0x43')][_0xe024('0xd7')])){for(var _0x3e1326=0x0;_0x3e1326<_0x492a13['query']['ids'][_0xe024('0x49')];_0x3e1326+=0x1){socket[_0xe024('0xd8')](_0xe024('0xdb'),{'UserId':Number(_0x492a13['query'][_0xe024('0xd7')][_0x3e1326]),'SmsAccountId':Number(_0x492a13['params']['id'])});}}else{socket[_0xe024('0xd8')](_0xe024('0xdb'),{'UserId':Number(_0x492a13[_0xe024('0x43')][_0xe024('0xd7')]),'SmsAccountId':Number(_0x492a13[_0xe024('0x67')]['id'])});}});}})['then'](respondWithStatusCode(_0x25860b,null))['catch'](handleError(_0x25860b,null));};exports['getAgents']=function(_0x343cd0,_0x15ab9e,_0x56caba){var _0x3cdd0a={};var _0x4dfd7e={};var _0x42adc3;var _0x21f418;return db['SmsAccount'][_0xe024('0x6e')]({'where':{'id':_0x343cd0[_0xe024('0x67')]['id']}})['then'](handleEntityNotFound(_0x15ab9e,null))['then'](function(_0x17a934){if(_0x17a934){_0x42adc3=_0x17a934;_0x4dfd7e[_0xe024('0x42')]=_[_0xe024('0x44')](db[_0xe024('0xb6')][_0xe024('0x5a')]);_0x4dfd7e[_0xe024('0x43')]=_[_0xe024('0x44')](_0x343cd0['query']);_0x4dfd7e[_0xe024('0x45')]=_[_0xe024('0x46')](_0x4dfd7e[_0xe024('0x42')],_0x4dfd7e[_0xe024('0x43')]);_0x3cdd0a[_0xe024('0x47')]=_[_0xe024('0x46')](_0x4dfd7e[_0xe024('0x42')],qs[_0xe024('0x48')](_0x343cd0['query']['fields']));_0x3cdd0a[_0xe024('0x47')]=_0x3cdd0a[_0xe024('0x47')][_0xe024('0x49')]?_0x3cdd0a[_0xe024('0x47')]:_0x4dfd7e['model'];_0x3cdd0a['order']=qs[_0xe024('0x4d')](_0x343cd0[_0xe024('0x43')][_0xe024('0x4d')]);_0x3cdd0a[_0xe024('0x50')]=qs['filters'](_[_0xe024('0x4e')](_0x343cd0[_0xe024('0x43')],_0x4dfd7e[_0xe024('0x45')]));if(_0x343cd0['query'][_0xe024('0x4f')]){_0x3cdd0a['where']=_[_0xe024('0x51')](_0x3cdd0a[_0xe024('0x50')],{'$or':_['map'](_0x3cdd0a['attributes'],function(_0x85acaa){var _0x2d92ed={};_0x2d92ed[_0x85acaa]={'$like':'%'+_0x343cd0[_0xe024('0x43')][_0xe024('0x4f')]+'%'};return _0x2d92ed;})});}_0x3cdd0a=_['merge']({},_0x3cdd0a,_0x343cd0[_0xe024('0x54')]);return _0x42adc3[_0xe024('0xdc')](_0x3cdd0a);}})['then'](function(_0x6f7111){if(_0x6f7111){_0x21f418=_0x6f7111['length'];if(!_0x343cd0[_0xe024('0x43')][_0xe024('0x4a')](_0xe024('0x4b'))){_0x3cdd0a[_0xe024('0x2f')]=qs['limit'](_0x343cd0[_0xe024('0x43')][_0xe024('0x2f')]);_0x3cdd0a[_0xe024('0x30')]=qs[_0xe024('0x30')](_0x343cd0[_0xe024('0x43')][_0xe024('0x30')]);}return _0x42adc3[_0xe024('0xdc')](_0x3cdd0a);}})['then'](function(_0x27b1a0){if(_0x27b1a0){return _0x27b1a0?{'count':_0x21f418,'rows':_0x27b1a0}:null;}})[_0xe024('0x1f')](respondWithResult(_0x15ab9e,null))['catch'](handleError(_0x15ab9e,null));};
\ No newline at end of file
+var _0x000c=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','SmsAccountId','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','order','removeAnswers','sms','SmsApplication','Applications','account','applications','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','type','twilio','From','messageId','from','text','connectel','clicksend','message_id','Text','MessageUUID','infobip','results','csc','segmentedMessage','clickatell','fromNumber','replyMessageId','intelepeer','refid','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','DESC','list','omit','Contacts','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','AttachmentId','UserId','agent','waitForTheAssignedAgent','Start','startRouting','debug','entity\x20found','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','priority','getApplications','getInteractions','Contact','User','Owner','fullname','internal','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','skebby','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','inspect','error_code','RECEIVED_BY_RECIPIENT','bandwidth','message-delivered','DELIVRD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','includeAll','include','rows','catch','keys','intersection','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','SmsAccounts','UserProfileSection','userProfileId'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0x000c,0x7d));var _0xc000=function(_0x319f09,_0x555c99){_0x319f09=_0x319f09-0x0;var _0x269422=_0x000c[_0x319f09];return _0x269422;};'use strict';var emlformat=require(_0xc000('0x0'));var rimraf=require(_0xc000('0x1'));var zipdir=require(_0xc000('0x2'));var jsonpatch=require(_0xc000('0x3'));var rp=require(_0xc000('0x4'));var moment=require(_0xc000('0x5'));var BPromise=require(_0xc000('0x6'));var Mustache=require(_0xc000('0x7'));var util=require('util');var path=require('path');var sox=require(_0xc000('0x8'));var csv=require(_0xc000('0x9'));var ejs=require(_0xc000('0xa'));var fs=require('fs');var fs_extra=require(_0xc000('0xb'));var _=require(_0xc000('0xc'));var squel=require(_0xc000('0xd'));var crypto=require('crypto');var jsforce=require(_0xc000('0xe'));var deskjs=require(_0xc000('0xf'));var toCsv=require(_0xc000('0x9'));var querystring=require(_0xc000('0x10'));var Papa=require(_0xc000('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc000('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc000('0x13'))('api');var utils=require(_0xc000('0x14'));var config=require(_0xc000('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc000('0x16'))['db'];config[_0xc000('0x17')]=_[_0xc000('0x18')](config['redis'],{'host':_0xc000('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc000('0x17')]));require(_0xc000('0x1a'))[_0xc000('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x1d1a05,_0x10a04c,_0x712baf,_0x87a518){return new BPromise(function(_0x27fc2d,_0x2a90ae){var _0xcbd2f8=_0x87a518||client;return _0xcbd2f8[_0xc000('0x1c')](_0x1d1a05,_0x712baf)[_0xc000('0x1d')](function(_0x5c030f){logger[_0xc000('0x1e')](_0xc000('0x1f'),_0x10a04c,'request\x20sent');logger['debug'](_0xc000('0x20'),_0x10a04c,'request\x20sent',JSON[_0xc000('0x21')](_0x5c030f));if(_0x5c030f[_0xc000('0x22')]){if(_0x5c030f[_0xc000('0x22')][_0xc000('0x23')]===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x10a04c,_0x5c030f[_0xc000('0x22')]['message']);return _0x2a90ae(_0x5c030f[_0xc000('0x22')][_0xc000('0x24')]);}logger[_0xc000('0x22')]('SmsAccount,\x20%s,\x20%s',_0x10a04c,_0x5c030f[_0xc000('0x22')]['message']);return _0x27fc2d(_0x5c030f['error'][_0xc000('0x24')]);}else{logger[_0xc000('0x1e')]('SmsAccount,\x20%s,\x20%s',_0x10a04c,'request\x20sent');_0x27fc2d(_0x5c030f[_0xc000('0x25')]['message']);}})['catch'](function(_0x486741){logger[_0xc000('0x22')]('SmsAccount,\x20%s,\x20%s',_0x10a04c,_0x486741);_0x2a90ae(_0x486741);});});}function respondWithStatusCode(_0x52e081,_0x8288af){_0x8288af=_0x8288af||0xcc;return function(_0x25c9b4){if(_0x25c9b4){return _0x52e081[_0xc000('0x26')](_0x8288af);}return _0x52e081[_0xc000('0x27')](_0x8288af)[_0xc000('0x28')]();};}function respondWithResult(_0x3915b6,_0x24ca79){_0x24ca79=_0x24ca79||0xc8;return function(_0x215ef6){if(_0x215ef6){return _0x3915b6[_0xc000('0x27')](_0x24ca79)[_0xc000('0x29')](_0x215ef6);}};}function respondWithFilteredResult(_0x28915d,_0x47058c){return function(_0x27b41a){if(_0x27b41a){var _0x2fbc26=typeof _0x47058c[_0xc000('0x2a')]===_0xc000('0x2b')&&typeof _0x47058c['limit']===_0xc000('0x2b');var _0x1c763a=_0x27b41a[_0xc000('0x2c')];var _0x1ddb33=_0x2fbc26?0x0:_0x47058c[_0xc000('0x2a')];var _0x2be652=_0x2fbc26?_0x27b41a[_0xc000('0x2c')]:_0x47058c[_0xc000('0x2a')]+_0x47058c[_0xc000('0x2d')];var _0x22b7e0;if(_0x2be652>=_0x1c763a){_0x2be652=_0x1c763a;_0x22b7e0=0xc8;}else{_0x22b7e0=0xce;}_0x28915d[_0xc000('0x27')](_0x22b7e0);return _0x28915d[_0xc000('0x2e')](_0xc000('0x2f'),_0x1ddb33+'-'+_0x2be652+'/'+_0x1c763a)[_0xc000('0x29')](_0x27b41a);}return null;};}function patchUpdates(_0x1990b8){return function(_0x1bbe90){try{jsonpatch[_0xc000('0x30')](_0x1bbe90,_0x1990b8,!![]);}catch(_0x1028fb){return BPromise[_0xc000('0x31')](_0x1028fb);}return _0x1bbe90[_0xc000('0x32')]();};}function saveUpdates(_0x438738,_0x2d65e0){return function(_0x5b3558){if(_0x5b3558){return _0x5b3558[_0xc000('0x33')](_0x438738)[_0xc000('0x1d')](function(_0x35e842){return _0x35e842;});}return null;};}function removeEntity(_0x3826e0,_0x48549b){return function(_0x1e385c){if(_0x1e385c){return _0x1e385c[_0xc000('0x34')]()[_0xc000('0x1d')](function(){var _0x2383d3=_0x1e385c['get']({'plain':!![]});var _0x5cbe2b='SmsAccounts';return db[_0xc000('0x35')][_0xc000('0x34')]({'where':{'type':_0x5cbe2b,'resourceId':_0x2383d3['id']}})['then'](function(){return _0x1e385c;});})['then'](function(){_0x3826e0[_0xc000('0x27')](0xcc)[_0xc000('0x28')]();});}};}function handleEntityNotFound(_0x287111,_0x5c73fc){return function(_0x35bde1){if(!_0x35bde1){_0x287111[_0xc000('0x26')](0x194);}return _0x35bde1;};}function handleError(_0x3f5704,_0x49b606){_0x49b606=_0x49b606||0x1f4;return function(_0x5122d6){logger[_0xc000('0x22')](_0x5122d6[_0xc000('0x36')]);if(_0x5122d6[_0xc000('0x37')]){delete _0x5122d6[_0xc000('0x37')];}_0x3f5704[_0xc000('0x27')](_0x49b606)[_0xc000('0x38')](_0x5122d6);};}exports['index']=function(_0x36f5a9,_0x37bdee){var _0x2a3dba={'include':[{'model':db[_0xc000('0x39')],'as':_0xc000('0x3a')}]},_0x16303c={},_0x58ef1d={'count':0x0,'rows':[]};var _0x3f21a6=_[_0xc000('0x3b')](db[_0xc000('0x3c')][_0xc000('0x3d')],function(_0x1413fc){return{'name':_0x1413fc[_0xc000('0x3e')],'type':_0x1413fc['type'][_0xc000('0x3f')]};});_0x16303c[_0xc000('0x40')]=_['map'](_0x3f21a6,_0xc000('0x37'));_0x16303c[_0xc000('0x41')]=_['keys'](_0x36f5a9[_0xc000('0x41')]);_0x16303c[_0xc000('0x42')]=_['intersection'](_0x16303c[_0xc000('0x40')],_0x16303c[_0xc000('0x41')]);_0x2a3dba[_0xc000('0x43')]=_['intersection'](_0x16303c['model'],qs[_0xc000('0x44')](_0x36f5a9['query'][_0xc000('0x44')]));_0x2a3dba['attributes']=_0x2a3dba[_0xc000('0x43')][_0xc000('0x45')]?_0x2a3dba[_0xc000('0x43')]:_0x16303c['model'];if(!_0x36f5a9[_0xc000('0x41')][_0xc000('0x46')](_0xc000('0x47'))){_0x2a3dba[_0xc000('0x2d')]=qs['limit'](_0x36f5a9[_0xc000('0x41')][_0xc000('0x2d')]);_0x2a3dba[_0xc000('0x2a')]=qs[_0xc000('0x2a')](_0x36f5a9[_0xc000('0x41')]['offset']);}_0x2a3dba['order']=qs[_0xc000('0x48')](_0x36f5a9['query']['sort']);_0x2a3dba['where']=qs[_0xc000('0x42')](_[_0xc000('0x49')](_0x36f5a9['query'],_0x16303c[_0xc000('0x42')]),_0x3f21a6);if(_0x36f5a9[_0xc000('0x41')][_0xc000('0x4a')]){_0x2a3dba[_0xc000('0x4b')]=_[_0xc000('0x4c')](_0x2a3dba[_0xc000('0x4b')],{'$or':_[_0xc000('0x3b')](_0x3f21a6,function(_0x25ca43){if(_0x25ca43['type']!=='VIRTUAL'){var _0xac0298={};_0xac0298[_0x25ca43[_0xc000('0x37')]]={'$like':'%'+_0x36f5a9['query'][_0xc000('0x4a')]+'%'};return _0xac0298;}})});}_0x2a3dba=_['merge']({},_0x2a3dba,_0x36f5a9['options']);var _0x5eabb4={'where':_0x2a3dba[_0xc000('0x4b')]};return db[_0xc000('0x3c')][_0xc000('0x2c')](_0x5eabb4)[_0xc000('0x1d')](function(_0x3edc2e){_0x58ef1d[_0xc000('0x2c')]=_0x3edc2e;if(_0x36f5a9['query'][_0xc000('0x4d')]){_0x2a3dba[_0xc000('0x4e')]=[{'all':!![]}];}return db[_0xc000('0x3c')]['findAll'](_0x2a3dba);})[_0xc000('0x1d')](function(_0x164b22){_0x58ef1d[_0xc000('0x4f')]=_0x164b22;return _0x58ef1d;})['then'](respondWithFilteredResult(_0x37bdee,_0x2a3dba))[_0xc000('0x50')](handleError(_0x37bdee,null));};exports['show']=function(_0x1290de,_0x1b1451){var _0xaf4334={'raw':![],'where':{'id':_0x1290de['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x244fe3={};_0x244fe3[_0xc000('0x40')]=_[_0xc000('0x51')](db[_0xc000('0x3c')][_0xc000('0x3d')]);_0x244fe3[_0xc000('0x41')]=_['keys'](_0x1290de[_0xc000('0x41')]);_0x244fe3[_0xc000('0x42')]=_[_0xc000('0x52')](_0x244fe3[_0xc000('0x40')],_0x244fe3[_0xc000('0x41')]);_0xaf4334[_0xc000('0x43')]=_[_0xc000('0x52')](_0x244fe3[_0xc000('0x40')],qs[_0xc000('0x44')](_0x1290de[_0xc000('0x41')][_0xc000('0x44')]));_0xaf4334[_0xc000('0x43')]=_0xaf4334[_0xc000('0x43')][_0xc000('0x45')]?_0xaf4334[_0xc000('0x43')]:_0x244fe3['model'];if(_0x1290de[_0xc000('0x41')]['includeAll']){_0xaf4334['include']=[{'all':!![]}];}_0xaf4334=_[_0xc000('0x4c')]({},_0xaf4334,_0x1290de[_0xc000('0x53')]);return db['SmsAccount'][_0xc000('0x54')](_0xaf4334)['then'](handleEntityNotFound(_0x1b1451,null))[_0xc000('0x1d')](respondWithResult(_0x1b1451,null))[_0xc000('0x50')](handleError(_0x1b1451,null));};exports[_0xc000('0x55')]=function(_0xc0d695,_0x1c1630){return db[_0xc000('0x3c')][_0xc000('0x55')](_0xc0d695[_0xc000('0x56')],{})['then'](function(_0x3781ed){var _0x2237cf=_0xc0d695[_0xc000('0x57')][_0xc000('0x58')]({'plain':!![]});if(!_0x2237cf)throw new Error(_0xc000('0x59'));if(_0x2237cf['role']==='user'){var _0x1af564=_0x3781ed[_0xc000('0x58')]({'plain':!![]});var _0x438714=_0xc000('0x5a');return db[_0xc000('0x5b')][_0xc000('0x54')]({'where':{'name':_0x438714,'userProfileId':_0x2237cf[_0xc000('0x5c')]},'raw':!![]})[_0xc000('0x1d')](function(_0x37c421){if(_0x37c421&&_0x37c421[_0xc000('0x5d')]===0x0){return db[_0xc000('0x35')][_0xc000('0x55')]({'name':_0x1af564[_0xc000('0x37')],'resourceId':_0x1af564['id'],'type':_0x37c421['name'],'sectionId':_0x37c421['id']},{})[_0xc000('0x1d')](function(){return _0x3781ed;});}else{return _0x3781ed;}})['catch'](function(_0x5a42f8){logger[_0xc000('0x22')](_0xc000('0x5e'),_0x5a42f8);throw _0x5a42f8;});}return _0x3781ed;})[_0xc000('0x1d')](respondWithResult(_0x1c1630,0xc9))[_0xc000('0x50')](handleError(_0x1c1630,null));};exports[_0xc000('0x33')]=function(_0x4e87fc,_0x45a567){if(_0x4e87fc[_0xc000('0x56')]['id']){delete _0x4e87fc[_0xc000('0x56')]['id'];}return db[_0xc000('0x3c')][_0xc000('0x54')]({'where':{'id':_0x4e87fc[_0xc000('0x5f')]['id']},'include':[{'model':db[_0xc000('0x39')],'as':_0xc000('0x3a')}]})[_0xc000('0x1d')](handleEntityNotFound(_0x45a567,null))[_0xc000('0x1d')](saveUpdates(_0x4e87fc[_0xc000('0x56')],null))[_0xc000('0x1d')](respondWithResult(_0x45a567,null))[_0xc000('0x50')](handleError(_0x45a567,null));};exports['destroy']=function(_0x14fc94,_0x4d4dc3){return db['SmsAccount'][_0xc000('0x54')]({'where':{'id':_0x14fc94[_0xc000('0x5f')]['id']}})[_0xc000('0x1d')](handleEntityNotFound(_0x4d4dc3,null))[_0xc000('0x1d')](removeEntity(_0x4d4dc3,null))['catch'](handleError(_0x4d4dc3,null));};exports[_0xc000('0x60')]=function(_0x82f774,_0xd9bb02){return db['SmsAccount'][_0xc000('0x60')]()[_0xc000('0x1d')](respondWithResult(_0xd9bb02,null))[_0xc000('0x50')](handleError(_0xd9bb02,null));};exports['addDisposition']=function(_0x4f9d85,_0x59196c,_0x16b340){if(_0x4f9d85[_0xc000('0x56')]['id']){delete _0x4f9d85[_0xc000('0x56')]['id'];}return db[_0xc000('0x3c')][_0xc000('0x54')]({'where':{'id':_0x4f9d85[_0xc000('0x5f')]['id']}})[_0xc000('0x1d')](handleEntityNotFound(_0x59196c,null))[_0xc000('0x1d')](function(_0x4d8972){if(_0x4d8972){_0x4f9d85[_0xc000('0x56')][_0xc000('0x61')]=_0x4d8972['id'];return db[_0xc000('0x62')][_0xc000('0x55')](_0x4f9d85['body']);}})[_0xc000('0x1d')](respondWithResult(_0x59196c,null))['catch'](handleError(_0x59196c,null));};exports[_0xc000('0x63')]=function(_0x1ef88d,_0x5d6104,_0x3a4202){var _0x4d97fe={'raw':![],'where':{}};var _0x1726e8={};var _0x331c77={'count':0x0,'rows':[]};return db[_0xc000('0x3c')][_0xc000('0x64')]({'where':{'id':_0x1ef88d[_0xc000('0x5f')]['id']}})[_0xc000('0x1d')](handleEntityNotFound(_0x5d6104,null))[_0xc000('0x1d')](function(_0x2d5c7c){if(_0x2d5c7c){_0x1726e8[_0xc000('0x40')]=_['keys'](db[_0xc000('0x62')]['rawAttributes']);_0x1726e8[_0xc000('0x41')]=_[_0xc000('0x51')](_0x1ef88d['query']);_0x1726e8[_0xc000('0x42')]=_[_0xc000('0x52')](_0x1726e8['model'],_0x1726e8[_0xc000('0x41')]);_0x4d97fe[_0xc000('0x43')]=_['intersection'](_0x1726e8['model'],qs[_0xc000('0x44')](_0x1ef88d[_0xc000('0x41')][_0xc000('0x44')]));_0x4d97fe[_0xc000('0x43')]=_0x4d97fe['attributes'][_0xc000('0x45')]?_0x4d97fe[_0xc000('0x43')]:_0x1726e8[_0xc000('0x40')];if(!_0x1ef88d[_0xc000('0x41')]['hasOwnProperty'](_0xc000('0x47'))){_0x4d97fe[_0xc000('0x2d')]=qs[_0xc000('0x2d')](_0x1ef88d['query'][_0xc000('0x2d')]);_0x4d97fe[_0xc000('0x2a')]=qs['offset'](_0x1ef88d[_0xc000('0x41')][_0xc000('0x2a')]);}_0x4d97fe['order']=qs[_0xc000('0x48')](_0x1ef88d['query'][_0xc000('0x48')]);_0x4d97fe[_0xc000('0x4b')]=qs[_0xc000('0x42')](_['pick'](_0x1ef88d['query'],_0x1726e8[_0xc000('0x42')]));_0x4d97fe[_0xc000('0x4b')][_0xc000('0x61')]=_0x2d5c7c['id'];if(_0x1ef88d['query'][_0xc000('0x4a')]){_0x4d97fe['where']=_[_0xc000('0x4c')](_0x4d97fe[_0xc000('0x4b')],{'$or':_[_0xc000('0x3b')](_0x4d97fe[_0xc000('0x43')],function(_0x48dd03){var _0x13b88b={};_0x13b88b[_0x48dd03]={'$like':'%'+_0x1ef88d[_0xc000('0x41')][_0xc000('0x4a')]+'%'};return _0x13b88b;})});}_0x4d97fe=_[_0xc000('0x4c')]({},_0x4d97fe,_0x1ef88d[_0xc000('0x53')]);return db[_0xc000('0x62')][_0xc000('0x2c')]({'where':_0x4d97fe[_0xc000('0x4b')]})['then'](function(_0x157eff){_0x331c77['count']=_0x157eff;if(_0x1ef88d[_0xc000('0x41')][_0xc000('0x4d')]){_0x4d97fe[_0xc000('0x4e')]=[{'all':!![]}];}return db[_0xc000('0x62')][_0xc000('0x65')](_0x4d97fe);})[_0xc000('0x1d')](function(_0x54694c){_0x331c77[_0xc000('0x4f')]=_0x54694c;return _0x331c77;});}})[_0xc000('0x1d')](respondWithFilteredResult(_0x5d6104,_0x4d97fe))[_0xc000('0x50')](handleError(_0x5d6104,null));};exports[_0xc000('0x66')]=function(_0x5d3283,_0x1e28ee,_0x495244){return db[_0xc000('0x3c')][_0xc000('0x54')]({'where':{'id':_0x5d3283[_0xc000('0x5f')]['id']}})[_0xc000('0x1d')](handleEntityNotFound(_0x1e28ee,null))[_0xc000('0x1d')](function(_0x7d8214){if(_0x7d8214){return _0x7d8214[_0xc000('0x66')](_0x5d3283['query'][_0xc000('0x67')]);}})['then'](respondWithStatusCode(_0x1e28ee,null))['catch'](handleError(_0x1e28ee,null));};exports[_0xc000('0x68')]=function(_0x42c4a3,_0x2bbb9b,_0x5aeaa5){if(_0x42c4a3[_0xc000('0x56')]['id']){delete _0x42c4a3[_0xc000('0x56')]['id'];}return db[_0xc000('0x3c')][_0xc000('0x54')]({'where':{'id':_0x42c4a3[_0xc000('0x5f')]['id']}})[_0xc000('0x1d')](handleEntityNotFound(_0x2bbb9b,null))[_0xc000('0x1d')](function(_0x154493){if(_0x154493){_0x42c4a3[_0xc000('0x56')][_0xc000('0x61')]=_0x154493['id'];return db[_0xc000('0x69')][_0xc000('0x55')](_0x42c4a3['body']);}})[_0xc000('0x1d')](respondWithResult(_0x2bbb9b,null))['catch'](handleError(_0x2bbb9b,null));};exports[_0xc000('0x6a')]=function(_0x4b778b,_0x4ae242,_0x153fd0){var _0x2858be={'raw':![],'where':{}};var _0x412c4a={};var _0x4caeb8={'count':0x0,'rows':[]};return db[_0xc000('0x3c')][_0xc000('0x64')]({'where':{'id':_0x4b778b[_0xc000('0x5f')]['id']}})[_0xc000('0x1d')](handleEntityNotFound(_0x4ae242,null))[_0xc000('0x1d')](function(_0x5f2dd7){if(_0x5f2dd7){_0x412c4a[_0xc000('0x40')]=_[_0xc000('0x51')](db['CannedAnswer'][_0xc000('0x3d')]);_0x412c4a[_0xc000('0x41')]=_[_0xc000('0x51')](_0x4b778b[_0xc000('0x41')]);_0x412c4a[_0xc000('0x42')]=_[_0xc000('0x52')](_0x412c4a['model'],_0x412c4a['query']);_0x2858be[_0xc000('0x43')]=_[_0xc000('0x52')](_0x412c4a[_0xc000('0x40')],qs['fields'](_0x4b778b[_0xc000('0x41')][_0xc000('0x44')]));_0x2858be[_0xc000('0x43')]=_0x2858be['attributes']['length']?_0x2858be[_0xc000('0x43')]:_0x412c4a[_0xc000('0x40')];if(!_0x4b778b['query'][_0xc000('0x46')](_0xc000('0x47'))){_0x2858be[_0xc000('0x2d')]=qs[_0xc000('0x2d')](_0x4b778b['query'][_0xc000('0x2d')]);_0x2858be['offset']=qs[_0xc000('0x2a')](_0x4b778b['query'][_0xc000('0x2a')]);}_0x2858be[_0xc000('0x6b')]=qs[_0xc000('0x48')](_0x4b778b[_0xc000('0x41')][_0xc000('0x48')]);_0x2858be[_0xc000('0x4b')]=qs['filters'](_[_0xc000('0x49')](_0x4b778b[_0xc000('0x41')],_0x412c4a['filters']));_0x2858be[_0xc000('0x4b')]['SmsAccountId']=_0x5f2dd7['id'];if(_0x4b778b[_0xc000('0x41')]['filter']){_0x2858be[_0xc000('0x4b')]=_['merge'](_0x2858be[_0xc000('0x4b')],{'$or':_['map'](_0x2858be['attributes'],function(_0x9cc70a){var _0x76af19={};_0x76af19[_0x9cc70a]={'$like':'%'+_0x4b778b[_0xc000('0x41')][_0xc000('0x4a')]+'%'};return _0x76af19;})});}_0x2858be=_[_0xc000('0x4c')]({},_0x2858be,_0x4b778b[_0xc000('0x53')]);return db['CannedAnswer'][_0xc000('0x2c')]({'where':_0x2858be['where']})[_0xc000('0x1d')](function(_0x72549e){_0x4caeb8[_0xc000('0x2c')]=_0x72549e;if(_0x4b778b[_0xc000('0x41')]['includeAll']){_0x2858be['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x2858be);})['then'](function(_0x14f08a){_0x4caeb8[_0xc000('0x4f')]=_0x14f08a;return _0x4caeb8;});}})['then'](respondWithFilteredResult(_0x4ae242,_0x2858be))[_0xc000('0x50')](handleError(_0x4ae242,null));};exports[_0xc000('0x6c')]=function(_0x2efddb,_0x4067c5,_0x5e3d77){return db['SmsAccount'][_0xc000('0x54')]({'where':{'id':_0x2efddb[_0xc000('0x5f')]['id']}})[_0xc000('0x1d')](handleEntityNotFound(_0x4067c5,null))['then'](function(_0x363f89){if(_0x363f89){return _0x363f89[_0xc000('0x6c')](_0x2efddb[_0xc000('0x41')][_0xc000('0x67')]);}})[_0xc000('0x1d')](respondWithStatusCode(_0x4067c5,null))[_0xc000('0x50')](handleError(_0x4067c5,null));};exports['notify']=function(_0x383142,_0x558dae,_0x23952d){var _0x53c727={'channel':_0xc000('0x6d')};var _0x581482=[];var _0x200d6b=[];var _0x4edab0={};return db['SmsAccount'][_0xc000('0x54')]({'where':{'id':_0x383142[_0xc000('0x5f')]['id']},'include':[{'model':db[_0xc000('0x6e')],'as':_0xc000('0x6f')}]})['then'](handleEntityNotFound(_0x558dae,null))['then'](function(_0x3dfba4){_0x53c727[_0xc000('0x70')]=_0x3dfba4;_0x53c727[_0xc000('0x71')]=_['orderBy'](_0x3dfba4[_0xc000('0x6f')],['priority'],[_0xc000('0x72')]);if(_0x53c727[_0xc000('0x70')]['Applications']){delete _0x53c727[_0xc000('0x70')][_0xc000('0x6f')];}return db[_0xc000('0x73')][_0xc000('0x60')]();})[_0xc000('0x1d')](function(_0x52feee){if(!_0x52feee){throw new db[(_0xc000('0x74'))]['ValidationError'](_0xc000('0x75'));}_0x581482=_[_0xc000('0x76')](_['keys'](_0x52feee),[_0xc000('0x77'),_0xc000('0x78')]);_0x200d6b=_[_0xc000('0x76')](_['keys'](_0x52feee),[_0xc000('0x77'),'updatedAt',_0xc000('0x79'),_0xc000('0x7a')]);_0x53c727[_0xc000('0x56')]={'mapKey':'mobile'};if(_0x53c727[_0xc000('0x70')][_0xc000('0x7b')]){switch(_0x53c727[_0xc000('0x70')][_0xc000('0x7b')]){case _0xc000('0x7c'):_0x53c727[_0xc000('0x56')]['from']=_0x383142[_0xc000('0x56')][_0xc000('0x7d')];_0x53c727[_0xc000('0x56')][_0xc000('0x56')]=_0x383142[_0xc000('0x56')]['Body'];_0x53c727[_0xc000('0x56')][_0xc000('0x7e')]=_0x383142[_0xc000('0x56')]['MessageSid'];break;case'skebby':_0x53c727[_0xc000('0x56')][_0xc000('0x7f')]='+'+_0x383142[_0xc000('0x56')]['sender'];_0x53c727['body'][_0xc000('0x56')]=_0x383142[_0xc000('0x56')][_0xc000('0x80')];break;case _0xc000('0x81'):_0x53c727['body'][_0xc000('0x7f')]=_0x383142[_0xc000('0x56')][_0xc000('0x7f')];_0x53c727[_0xc000('0x56')][_0xc000('0x56')]=_0x383142[_0xc000('0x56')]['message'];break;case _0xc000('0x82'):_0x53c727[_0xc000('0x56')][_0xc000('0x7f')]=_0x383142[_0xc000('0x56')]['from'];_0x53c727[_0xc000('0x56')][_0xc000('0x56')]=_0x383142[_0xc000('0x56')][_0xc000('0x56')];_0x53c727[_0xc000('0x56')]['messageId']=_0x383142[_0xc000('0x56')][_0xc000('0x83')];break;case'plivo':_0x53c727[_0xc000('0x56')][_0xc000('0x7f')]=_0x383142['body'][_0xc000('0x7d')];_0x53c727['body'][_0xc000('0x56')]=_0x383142[_0xc000('0x56')][_0xc000('0x84')];_0x53c727[_0xc000('0x56')][_0xc000('0x7e')]=_0x383142[_0xc000('0x56')][_0xc000('0x85')];break;case _0xc000('0x86'):_0x53c727['body'][_0xc000('0x7f')]='+'+_0x383142[_0xc000('0x56')][_0xc000('0x87')][0x0]['from'];_0x53c727['body'][_0xc000('0x56')]=_0x383142[_0xc000('0x56')][_0xc000('0x87')][0x0]['text'];_0x53c727[_0xc000('0x56')]['messageId']=_0x383142['body'][_0xc000('0x87')][0x0][_0xc000('0x7e')];break;case _0xc000('0x88'):_0x53c727[_0xc000('0x56')][_0xc000('0x7f')]=_0x383142['body']['originatingAddress'];_0x53c727['body'][_0xc000('0x56')]=_0x383142[_0xc000('0x56')][_0xc000('0x89')]['message'];break;case _0xc000('0x8a'):_0x53c727[_0xc000('0x56')][_0xc000('0x7f')]=_0x383142['body'][_0xc000('0x8b')];_0x53c727['body'][_0xc000('0x56')]=_0x383142[_0xc000('0x56')][_0xc000('0x80')];_0x53c727[_0xc000('0x56')][_0xc000('0x7e')]=_0x383142[_0xc000('0x56')][_0xc000('0x8c')];break;case'bandwidth':_0x53c727['body'][_0xc000('0x7e')]=_0x383142[_0xc000('0x56')][0x0]['message']['id'];_0x53c727['body'][_0xc000('0x7f')]=_0x383142[_0xc000('0x56')][0x0]['message'][_0xc000('0x7f')];_0x53c727[_0xc000('0x56')][_0xc000('0x56')]=_0x383142[_0xc000('0x56')][0x0]['message'][_0xc000('0x80')];break;case _0xc000('0x8d'):_0x53c727['body'][_0xc000('0x7f')]=_0x383142[_0xc000('0x56')][_0xc000('0x7f')];_0x53c727[_0xc000('0x56')]['body']=_0x383142[_0xc000('0x56')][_0xc000('0x24')];_0x53c727[_0xc000('0x56')][_0xc000('0x7e')]=_0x383142[_0xc000('0x56')][_0xc000('0x8e')];break;}}if(_0x53c727[_0xc000('0x56')]['id']){delete _0x53c727[_0xc000('0x56')]['id'];}if(_[_0xc000('0x8f')](_0x53c727[_0xc000('0x56')][_0xc000('0x7f')])){throw new db['Sequelize'][(_0xc000('0x90'))](_0xc000('0x91'));}if(_['isNil'](_0x53c727[_0xc000('0x56')][_0xc000('0x56')])||_0x53c727[_0xc000('0x56')][_0xc000('0x56')]===''){throw new db[(_0xc000('0x74'))][(_0xc000('0x90'))](_0xc000('0x92'));}if(_[_0xc000('0x8f')](_0x53c727[_0xc000('0x56')][_0xc000('0x93')])){throw new db[(_0xc000('0x74'))]['ValidationError'](_0xc000('0x94')+_0x200d6b);}if(!_[_0xc000('0x95')](_0x200d6b,_0x53c727[_0xc000('0x56')][_0xc000('0x93')])){throw new db[(_0xc000('0x74'))][(_0xc000('0x90'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x200d6b);}_0x4edab0[_0x53c727['body'][_0xc000('0x93')]]=_0x53c727['body'][_0xc000('0x7f')];return db[_0xc000('0x96')][_0xc000('0x54')]({'where':{'id':_0x53c727[_0xc000('0x70')][_0xc000('0x7a')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x4edab0,'limit':0x1,'order':[['updatedAt',_0xc000('0x97')]]}]});})[_0xc000('0x1d')](handleEntityNotFound(_0x558dae,null))['then'](function(_0x521680){if(_0x521680){_0x53c727[_0xc000('0x98')]=_[_0xc000('0x99')](_0x521680,[_0xc000('0x9a')]);if(_0x521680['Contacts']['length']){return _0x521680['Contacts'][0x0];}var _0x247b35=_[_0xc000('0x18')](_0x53c727[_0xc000('0x56')],{'firstName':_0x53c727[_0xc000('0x56')][_0xc000('0x7f')],'ListId':_0x521680['id']});_0x247b35[_0x53c727['body'][_0xc000('0x93')]]=_0x53c727[_0xc000('0x56')][_0xc000('0x7f')];return db[_0xc000('0x73')][_0xc000('0x55')](_0x247b35,{'fields':_0x581482,'raw':!![]});}})[_0xc000('0x1d')](handleEntityNotFound(_0x558dae,null))[_0xc000('0x1d')](function(_0x3dc161){if(_0x3dc161){_0x53c727[_0xc000('0x9b')]=_0x3dc161;var _0x529259={'ContactId':_0x3dc161['id'],'phone':_0x53c727[_0xc000('0x56')][_0xc000('0x7f')],'SmsAccountId':_0x383142[_0xc000('0x5f')]['id']};var _0x3b0bd8={'ContactId':_0x3dc161['id'],'SmsAccountId':_0x383142[_0xc000('0x5f')]['id'],'closed':![]};return db['SmsInteraction']['find']({'where':_0x3b0bd8})[_0xc000('0x1d')](function(_0x4cdf2a){if(_0x4cdf2a){return[_0x4cdf2a,![]];}return db[_0xc000('0x9c')]['create'](_0x529259)['then'](function(_0xb8374c){return[_0xb8374c,!![]];});});}})[_0xc000('0x9d')](function(_0x24ceb6,_0x2102e3){_0x53c727['interaction']=_0x24ceb6[_0xc000('0x58')]({'plain':!![]});_0x53c727[_0xc000('0x9e')][_0xc000('0x9f')]=![];if(_0x2102e3){if(_0x53c727['account'][_0xc000('0xa0')]){_0x53c727[_0xc000('0x71')][_0xc000('0xa1')]({'id':0x0,'priority':_0x53c727[_0xc000('0x71')][_0xc000('0x45')]+0x1,'app':_0xc000('0xa2'),'appdata':_0xc000('0xa3'),'interval':_0xc000('0xa4')});}_0x53c727['interaction'][_0xc000('0x9f')]=!![];}return db[_0xc000('0xa5')][_0xc000('0x55')]({'phone':_0x53c727['body']['from'],'messageId':_0x53c727[_0xc000('0x56')][_0xc000('0x7e')],'body':_0x53c727[_0xc000('0x56')][_0xc000('0x56')],'SmsAccountId':_0x383142[_0xc000('0x5f')]['id'],'SmsInteractionId':_0x24ceb6['id'],'direction':'in','ContactId':_0x24ceb6['ContactId'],'AttachmentId':_0x53c727['body'][_0xc000('0xa6')]});})[_0xc000('0x1d')](function(_0x5216de){_0x53c727[_0xc000('0x24')]=_0x5216de;if(_0x53c727['interaction'][_0xc000('0xa7')]){return db['User'][_0xc000('0x54')]({'attributes':['id',_0xc000('0x37')],'where':{'id':_0x53c727[_0xc000('0x9e')][_0xc000('0xa7')]}})[_0xc000('0x1d')](function(_0x22928b){if(_0x22928b){_0x53c727[_0xc000('0x71')]['unshift']({'id':0x0,'priority':0x0,'app':_0xc000('0xa8'),'appdata':_0x22928b[_0xc000('0x37')]+','+(_0x53c727['account'][_0xc000('0xa9')]||0xa),'interval':_0xc000('0xa4')});}return respondWithRpcPromise(_0xc000('0xaa'),_0xc000('0xab'),_0x53c727);});}return respondWithRpcPromise(_0xc000('0xaa'),_0xc000('0xab'),_0x53c727);})[_0xc000('0x1d')](function(_0x299523){if(_0x299523){var _0x338ac0=0xc8;var _0x4cb185='receiveMessage';logger[_0xc000('0x1e')](_0xc000('0x20'),_0x4cb185,_0x338ac0,'entity\x20found');logger[_0xc000('0xac')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x4cb185,_0x338ac0,_0xc000('0xad'),JSON[_0xc000('0x21')](_0x299523));if(_0x53c727[_0xc000('0x70')][_0xc000('0x7b')]===_0xc000('0x7c')){return _0x558dae[_0xc000('0x27')](_0x338ac0)[_0xc000('0x2e')]('Content-Type',_0xc000('0xae'))['send'](_0xc000('0xaf'));}else{return _0x558dae[_0xc000('0x27')](_0x338ac0)[_0xc000('0x29')](_0x299523);}}})['catch'](handleError(_0x558dae,null));};exports[_0xc000('0xb0')]=function(_0x40e264,_0x499b38,_0x251acf){return db[_0xc000('0x3c')][_0xc000('0x64')]({'where':{'id':_0x40e264[_0xc000('0x5f')]['id']}})[_0xc000('0x1d')](handleEntityNotFound(_0x499b38,null))[_0xc000('0x1d')](function(_0x365bb9){if(_0x365bb9){return db[_0xc000('0xb1')][_0xc000('0xb2')](function(_0x3b32c1){return db[_0xc000('0x6e')]['destroy']({'where':{'SmsAccountId':_0x40e264['params']['id']},'transaction':_0x3b32c1})[_0xc000('0x1d')](function(_0x15e641){var _0x4e196c=_[_0xc000('0x3b')](_0x40e264['body'],function(_0x34046c){_0x34046c['SmsAccountId']=_0x40e264['params']['id'];return _0x34046c;});return db[_0xc000('0x6e')][_0xc000('0xb3')](_0x4e196c,{'transaction':_0x3b32c1});});})[_0xc000('0x1d')](function(){return db[_0xc000('0x6e')][_0xc000('0xb4')]({'where':{'SmsAccountId':_0x40e264[_0xc000('0x5f')]['id']},'order':_0xc000('0xb5')});});}})[_0xc000('0x1d')](respondWithResult(_0x499b38,null))[_0xc000('0x50')](handleError(_0x499b38,null));};exports['getApplications']=function(_0x2c837a,_0xbb6983,_0x2f40bf){var _0x21a4d8={};var _0x1aca11={};var _0x363cfe;var _0x3a70e0;return db[_0xc000('0x3c')][_0xc000('0x64')]({'where':{'id':_0x2c837a[_0xc000('0x5f')]['id']}})[_0xc000('0x1d')](handleEntityNotFound(_0xbb6983,null))['then'](function(_0x19d0e3){if(_0x19d0e3){_0x363cfe=_0x19d0e3;_0x1aca11[_0xc000('0x40')]=_[_0xc000('0x51')](db[_0xc000('0x6e')][_0xc000('0x3d')]);_0x1aca11[_0xc000('0x41')]=_[_0xc000('0x51')](_0x2c837a[_0xc000('0x41')]);_0x1aca11[_0xc000('0x42')]=_[_0xc000('0x52')](_0x1aca11[_0xc000('0x40')],_0x1aca11[_0xc000('0x41')]);_0x21a4d8['attributes']=_[_0xc000('0x52')](_0x1aca11[_0xc000('0x40')],qs[_0xc000('0x44')](_0x2c837a['query'][_0xc000('0x44')]));_0x21a4d8[_0xc000('0x43')]=_0x21a4d8['attributes'][_0xc000('0x45')]?_0x21a4d8['attributes']:_0x1aca11[_0xc000('0x40')];_0x21a4d8['order']=qs[_0xc000('0x48')](_0x2c837a[_0xc000('0x41')]['sort']);_0x21a4d8[_0xc000('0x4b')]=qs['filters'](_[_0xc000('0x49')](_0x2c837a[_0xc000('0x41')],_0x1aca11[_0xc000('0x42')]));if(_0x2c837a[_0xc000('0x41')][_0xc000('0x4a')]){_0x21a4d8[_0xc000('0x4b')]=_[_0xc000('0x4c')](_0x21a4d8['where'],{'$or':_[_0xc000('0x3b')](_0x21a4d8['attributes'],function(_0x4d791e){var _0x4ce917={};_0x4ce917[_0x4d791e]={'$like':'%'+_0x2c837a[_0xc000('0x41')][_0xc000('0x4a')]+'%'};return _0x4ce917;})});}_0x21a4d8=_[_0xc000('0x4c')]({},_0x21a4d8,_0x2c837a[_0xc000('0x53')]);return _0x363cfe[_0xc000('0xb6')](_0x21a4d8);}})[_0xc000('0x1d')](function(_0x73e02){if(_0x73e02){_0x3a70e0=_0x73e02[_0xc000('0x45')];if(!_0x2c837a[_0xc000('0x41')][_0xc000('0x46')](_0xc000('0x47'))){_0x21a4d8[_0xc000('0x2d')]=qs[_0xc000('0x2d')](_0x2c837a[_0xc000('0x41')][_0xc000('0x2d')]);_0x21a4d8[_0xc000('0x2a')]=qs['offset'](_0x2c837a[_0xc000('0x41')]['offset']);}return _0x363cfe[_0xc000('0xb6')](_0x21a4d8);}})[_0xc000('0x1d')](function(_0x381b5f){if(_0x381b5f){return _0x381b5f?{'count':_0x3a70e0,'rows':_0x381b5f}:null;}})[_0xc000('0x1d')](respondWithResult(_0xbb6983,null))[_0xc000('0x50')](handleError(_0xbb6983,null));};exports[_0xc000('0xb7')]=function(_0x4ca087,_0x5dce8a,_0x249d23){var _0x2369a6={'raw':![],'where':{}};var _0x48945c={};var _0x261853={'count':0x0,'rows':[]};return db['SmsAccount'][_0xc000('0x64')]({'where':{'id':_0x4ca087[_0xc000('0x5f')]['id']}})['then'](handleEntityNotFound(_0x5dce8a,null))[_0xc000('0x1d')](function(_0x57e4d1){if(_0x57e4d1){_0x48945c[_0xc000('0x40')]=_[_0xc000('0x51')](db['SmsInteraction'][_0xc000('0x3d')]);_0x48945c['query']=_[_0xc000('0x51')](_0x4ca087['query']);_0x48945c[_0xc000('0x42')]=_[_0xc000('0x52')](_0x48945c[_0xc000('0x40')],_0x48945c[_0xc000('0x41')]);_0x2369a6[_0xc000('0x43')]=_[_0xc000('0x52')](_0x48945c[_0xc000('0x40')],qs[_0xc000('0x44')](_0x4ca087['query'][_0xc000('0x44')]));_0x2369a6[_0xc000('0x43')]=_0x2369a6[_0xc000('0x43')][_0xc000('0x45')]?_0x2369a6[_0xc000('0x43')]:_0x48945c['model'];if(!_0x4ca087['query']['hasOwnProperty']('nolimit')){_0x2369a6[_0xc000('0x2d')]=qs[_0xc000('0x2d')](_0x4ca087[_0xc000('0x41')][_0xc000('0x2d')]);_0x2369a6[_0xc000('0x2a')]=qs['offset'](_0x4ca087[_0xc000('0x41')][_0xc000('0x2a')]);}_0x2369a6[_0xc000('0x6b')]=qs[_0xc000('0x48')](_0x4ca087[_0xc000('0x41')][_0xc000('0x48')]);_0x2369a6[_0xc000('0x4b')]=qs[_0xc000('0x42')](_[_0xc000('0x49')](_0x4ca087[_0xc000('0x41')],_0x48945c['filters']));_0x2369a6[_0xc000('0x4b')][_0xc000('0x61')]=_0x57e4d1['id'];if(_0x4ca087[_0xc000('0x41')][_0xc000('0x4a')]){_0x2369a6[_0xc000('0x4b')]=_[_0xc000('0x4c')](_0x2369a6[_0xc000('0x4b')],{'$or':_[_0xc000('0x3b')](_0x2369a6['attributes'],function(_0x207d0e){var _0x58af70={};_0x58af70[_0x207d0e]={'$like':'%'+_0x4ca087[_0xc000('0x41')][_0xc000('0x4a')]+'%'};return _0x58af70;})});}_0x2369a6=_[_0xc000('0x4c')]({},_0x2369a6,_0x4ca087[_0xc000('0x53')]);return db['SmsInteraction'][_0xc000('0x2c')]({'where':_0x2369a6[_0xc000('0x4b')]})[_0xc000('0x1d')](function(_0x259f34){_0x261853['count']=_0x259f34;if(_0x4ca087[_0xc000('0x41')][_0xc000('0x4d')]){_0x2369a6[_0xc000('0x4e')]=[{'model':db['CmContact'],'as':_0xc000('0xb8'),'required':![]},{'model':db[_0xc000('0xb9')],'as':_0xc000('0xba'),'attributes':['name',_0xc000('0xbb'),_0xc000('0xbc')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name','color'],'where':_0x4ca087[_0xc000('0x41')][_0xc000('0xbd')]?{'id':_0x4ca087['query'][_0xc000('0xbd')]}:undefined,'required':_0x4ca087[_0xc000('0x41')][_0xc000('0xbd')]?!![]:![]}];}return db[_0xc000('0x9c')][_0xc000('0x65')](_0x2369a6);})[_0xc000('0x1d')](function(_0x323d32){_0x261853[_0xc000('0x4f')]=_0x323d32;return _0x261853;});}})[_0xc000('0x1d')](respondWithFilteredResult(_0x5dce8a,_0x2369a6))[_0xc000('0x50')](handleError(_0x5dce8a,null));};exports[_0xc000('0x38')]=function(_0x1099db,_0x4bdae2,_0x1c559c){var _0xf6de55,_0x3e552d,_0x54f67a;if(_['isNil'](_0x1099db['body'][_0xc000('0x56')])||_0x1099db[_0xc000('0x56')][_0xc000('0x56')]===''){throw new db[(_0xc000('0x74'))][(_0xc000('0x90'))](_0xc000('0x92'));}if(_[_0xc000('0x8f')](_0x1099db['body']['to'])){throw new db[(_0xc000('0x74'))]['ValidationError'](_0xc000('0xbe'));}_0xf6de55=_0x1099db[_0xc000('0x56')]['to'];return db[_0xc000('0x3c')][_0xc000('0x54')]({'where':{'id':_0x1099db[_0xc000('0x5f')]['id']},'include':[{'model':db['CmList'],'as':_0xc000('0xbf'),'include':[{'model':db[_0xc000('0x73')],'as':_0xc000('0x9a'),'where':{'mobile':_0xf6de55},'limit':0x1,'order':[[_0xc000('0x78'),_0xc000('0x97')]]}]}]})[_0xc000('0x1d')](handleEntityNotFound(_0x4bdae2,null))[_0xc000('0x1d')](function(_0x4dedad){if(_0x4dedad&&_0x4dedad[_0xc000('0xbf')]){_0x3e552d=_0x4dedad[_0xc000('0x58')]({'plain':!![]});if(_0x3e552d['List']&&_0x3e552d[_0xc000('0xbf')]['Contacts']['length']){return _0x3e552d[_0xc000('0xbf')][_0xc000('0x9a')][0x0];}return db[_0xc000('0x73')][_0xc000('0x55')](_[_0xc000('0x18')](_0x1099db[_0xc000('0x56')],{'firstName':_0xf6de55,'mobile':_0xf6de55,'phone':_0xf6de55,'ListId':_0x3e552d[_0xc000('0x7a')]}));}})[_0xc000('0x1d')](handleEntityNotFound(_0x4bdae2,null))[_0xc000('0x1d')](function(_0x11450a){if(_0x11450a){_0x54f67a=_0x11450a;return db[_0xc000('0x9c')][_0xc000('0x54')]({'where':{'ContactId':_0x54f67a['id'],'closed':![],'SmsAccountId':_0x3e552d['id']}})[_0xc000('0x1d')](function(_0x21c870){if(_0x21c870){return[_0x21c870,![]];}return db[_0xc000('0x9c')][_0xc000('0x55')]({'UserId':_0x1099db[_0xc000('0x57')]['id'],'ContactId':_0x54f67a['id'],'SmsAccountId':_0x3e552d['id'],'phone':_0xf6de55,'firstMsgDirection':_0xc000('0xc0'),'Messages':[_[_0xc000('0x4c')](_0x1099db[_0xc000('0x56')],{'read':![],'body':_0x1099db['body'][_0xc000('0x56')],'phone':_0xf6de55,'SmsAccountId':_0x3e552d['id'],'UserId':_0x1099db[_0xc000('0x57')]['id'],'ContactId':_0x54f67a['id']})]},{'include':[{'model':db[_0xc000('0xa5')],'as':_0xc000('0xc1')}]})[_0xc000('0x1d')](function(_0x25d5fb){return[_0x25d5fb,!![]];});});}})[_0xc000('0x9d')](function(_0x4bd0f9,_0x2c48e4){if(_0x2c48e4){return _0x4bd0f9;}return db[_0xc000('0xa5')]['create'](_[_0xc000('0x4c')](_0x1099db[_0xc000('0x56')],{'read':![],'body':_0x1099db[_0xc000('0x56')][_0xc000('0x56')],'phone':_0xf6de55,'SmsAccountId':_0x3e552d['id'],'SmsInteractionId':_0x4bd0f9['id'],'UserId':_0x1099db[_0xc000('0x57')]['id'],'ContactId':_0x54f67a['id']}))[_0xc000('0x1d')](function(_0x4f2ada){_0x4bd0f9['dataValues'][_0xc000('0xc1')]=[];_0x4bd0f9[_0xc000('0xc2')]['Messages'][_0xc000('0xa1')](_0x4f2ada[_0xc000('0xc2')]);return _0x4bd0f9;});})['then'](respondWithResult(_0x4bdae2,null))['catch'](handleError(_0x4bdae2,null));};exports[_0xc000('0x27')]=function(_0x4ce8c7,_0x333b37,_0x28a36b){if(_0x4ce8c7['body']['id']){delete _0x4ce8c7[_0xc000('0x56')]['id'];}var _0x3e306c,_0x16d8b4,_0x37bd49;return db[_0xc000('0x3c')][_0xc000('0x54')]({'where':{'id':_0x4ce8c7[_0xc000('0x5f')]['id']}})[_0xc000('0x1d')](handleEntityNotFound(_0x333b37,null))[_0xc000('0x1d')](function(_0x49367b){if(_0x49367b){_0x37bd49=_0x49367b;logger['debug'](_0xc000('0x20'),_0xc000('0x27'),'received\x20delivery\x20report\x20from',_0x49367b[_0xc000('0x7b')],util['inspect'](_0x4ce8c7[_0xc000('0x56')],{'showHidden':![],'depth':null}));switch(_0x49367b['type']){case _0xc000('0xc3'):if(_0x4ce8c7[_0xc000('0x56')][_0xc000('0xc4')]&&_0x4ce8c7['body']['status']){_0x16d8b4=_0x4ce8c7[_0xc000('0x56')]['status'];return db[_0xc000('0xa5')]['find']({'where':{'messageId':_0x4ce8c7['body'][_0xc000('0xc4')]}});}break;case _0xc000('0x81'):if(_0x4ce8c7[_0xc000('0x56')][_0xc000('0xc5')]&&_0x4ce8c7[_0xc000('0x56')][_0xc000('0xc6')]){_0x16d8b4=_0x4ce8c7[_0xc000('0x56')][_0xc000('0xc6')];return db[_0xc000('0xa5')][_0xc000('0x54')]({'where':{'messageId':_0x4ce8c7[_0xc000('0x56')][_0xc000('0xc5')]}});}break;case _0xc000('0x82'):if(_0x4ce8c7[_0xc000('0x56')][_0xc000('0x83')]&&_0x4ce8c7[_0xc000('0x56')][_0xc000('0xc7')]){_0x16d8b4=_0x4ce8c7[_0xc000('0x56')]['status_code'];return db[_0xc000('0xa5')][_0xc000('0x54')]({'where':{'messageId':_0x4ce8c7[_0xc000('0x56')][_0xc000('0x83')]}});}break;case _0xc000('0x86'):var _0x413f9c=_0x4ce8c7['body'][_0xc000('0x87')][0x0];if(_0x413f9c['messageId']&&_0x413f9c[_0xc000('0x27')][_0xc000('0xc8')]===_0xc000('0xc9')){_0x16d8b4=_0x413f9c[_0xc000('0x27')][_0xc000('0xc8')];return db['SmsMessage'][_0xc000('0x54')]({'where':{'messageId':_0x413f9c[_0xc000('0x7e')]}});}break;case _0xc000('0x8a'):if(_0x4ce8c7[_0xc000('0x56')]['messageId']&&_0x4ce8c7[_0xc000('0x56')][_0xc000('0x27')]){_0x16d8b4=_0x4ce8c7[_0xc000('0x56')][_0xc000('0x27')];return db[_0xc000('0xa5')][_0xc000('0x54')]({'where':{'messageId':_0x4ce8c7['body']['messageId']}});}break;case'bandwidth':if(_0x4ce8c7[_0xc000('0x56')][0x0][_0xc000('0x24')]['id']){_0x16d8b4=_0x4ce8c7[_0xc000('0x56')][0x0][_0xc000('0x7b')];return db[_0xc000('0xa5')][_0xc000('0x54')]({'where':{'messageId':_0x4ce8c7[_0xc000('0x56')][0x0][_0xc000('0x24')]['id']}});}break;case _0xc000('0x8d'):if(_0x4ce8c7['body']['redif']&&_0x4ce8c7['body'][_0xc000('0x27')]){_0x16d8b4=_0x4ce8c7[_0xc000('0x56')][_0xc000('0x27')];return db[_0xc000('0xa5')][_0xc000('0x54')]({'where':{'messageId':_0x4ce8c7['body']['redif']}});}break;}}})['then'](handleEntityNotFound(_0x333b37,null))[_0xc000('0x1d')](function(_0x140384){if(_0x140384){_0x3e306c=_0x140384;switch(_0x37bd49[_0xc000('0x7b')]){case _0xc000('0xc3'):if(_0x16d8b4===_0xc000('0xc9')){return _0x3e306c[_0xc000('0x33')]({'read':!![]});}else{logger['error'](_0xc000('0x20'),_0xc000('0x27'),'skebby',util[_0xc000('0xca')](_0x4ce8c7[_0xc000('0x56')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x16d8b4==='1'){return _0x3e306c[_0xc000('0x33')]({'read':!![]});}else{logger[_0xc000('0x22')](_0xc000('0x20'),_0xc000('0x27'),_0xc000('0xc3'),util[_0xc000('0xca')](_0x4ce8c7[_0xc000('0x56')],{'showHidden':![],'depth':null}));}break;case _0xc000('0x82'):if(!_0x4ce8c7[_0xc000('0x56')][_0xc000('0xcb')]&&_0x16d8b4>=0xc8&&_0x16d8b4<=0xce){return _0x3e306c[_0xc000('0x33')]({'read':!![]});}else{logger[_0xc000('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xc000('0x82'),util['inspect'](_0x4ce8c7[_0xc000('0x56')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0xe42beb=_0x4ce8c7[_0xc000('0x56')]['results'][0x0];if(_0xe42beb[_0xc000('0x27')]['groupName']===_0xc000('0xc9')){return _0x3e306c['update']({'read':!![]});}else{logger[_0xc000('0x22')](_0xc000('0x20'),_0xc000('0x27'),_0xc000('0x86'),util[_0xc000('0xca')](_0x4ce8c7[_0xc000('0x56')],{'showHidden':![],'depth':null}));}break;case _0xc000('0x8a'):if(_0x16d8b4=='DELIVERED_TO_GATEWAY'||_0x16d8b4==_0xc000('0xcc')){return _0x3e306c[_0xc000('0x33')]({'read':!![]});}else{logger['error'](_0xc000('0x20'),_0xc000('0x27'),_0xc000('0x8a'),util[_0xc000('0xca')](_0x4ce8c7[_0xc000('0x56')],{'showHidden':![],'depth':null}));}break;case _0xc000('0xcd'):if(_0x16d8b4==_0xc000('0xce')){return _0x3e306c[_0xc000('0x33')]({'read':!![]});}else{logger[_0xc000('0x22')](_0xc000('0x20'),_0xc000('0x27'),_0xc000('0xcd'),util[_0xc000('0xca')](_0x4ce8c7[_0xc000('0x56')],{'showHidden':![],'depth':null}));}break;case _0xc000('0x8d'):if(_0x16d8b4===_0xc000('0xcf')||_0x16d8b4==='ACCEPTD'){return _0x3e306c[_0xc000('0x33')]({'read':!![]});}else{logger[_0xc000('0x22')](_0xc000('0x20'),_0xc000('0x27'),_0xc000('0x8d'),util['inspect'](_0x4ce8c7[_0xc000('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x3e306c;}})[_0xc000('0x1d')](respondWithResult(_0x333b37,null))[_0xc000('0x50')](handleError(_0x333b37,null));};exports[_0xc000('0xd0')]=function(_0x53bab9,_0x46b93f,_0xd54e83){var _0x5733fe,_0x231348,_0x2cc4c4;return db[_0xc000('0x3c')][_0xc000('0x54')]({'where':{'id':_0x53bab9[_0xc000('0x5f')]['id']}})[_0xc000('0x1d')](handleEntityNotFound(_0x46b93f,null))['then'](function(_0x2f13e0){if(_0x2f13e0){_0x2cc4c4=_0x2f13e0;logger[_0xc000('0xac')](_0xc000('0x20'),_0xc000('0x27'),'received\x20delivery\x20report\x20from',_0x2f13e0['type'],util['inspect'](_0x53bab9[_0xc000('0x41')],{'showHidden':![],'depth':null}));switch(_0x2f13e0[_0xc000('0x7b')]){case _0xc000('0x88'):if(_0x53bab9[_0xc000('0x41')][_0xc000('0xd1')]&&_0x53bab9['query'][_0xc000('0xd2')]){_0x231348=_0x53bab9[_0xc000('0x41')][_0xc000('0xd2')];return db[_0xc000('0xa5')][_0xc000('0x54')]({'where':{'messageId':_0x53bab9[_0xc000('0x41')][_0xc000('0xd1')]}});}break;}}})['then'](handleEntityNotFound(_0x46b93f,null))[_0xc000('0x1d')](function(_0x115a44){if(_0x115a44){_0x5733fe=_0x115a44;switch(_0x2cc4c4['type']){case _0xc000('0x88'):if(_0x231348==='2'||_0x231348==='6'){return _0x5733fe['update']({'read':!![]});}else{logger[_0xc000('0x22')](_0xc000('0x20'),_0xc000('0x27'),'csc',util[_0xc000('0xca')](_0x53bab9[_0xc000('0x41')],{'showHidden':![],'depth':null}));};break;}return _0x5733fe;}})[_0xc000('0x1d')](respondWithResult(_0x46b93f,null))[_0xc000('0x50')](handleError(_0x46b93f,null));};exports[_0xc000('0xd3')]=function(_0x4fab58,_0x3d168b,_0x466e36){return db[_0xc000('0x3c')]['find']({'where':{'id':_0x4fab58['params']['id']}})['then'](handleEntityNotFound(_0x3d168b,null))[_0xc000('0x1d')](function(_0x4f7126){if(_0x4f7126){return _0x4f7126[_0xc000('0xd3')](_0x4fab58[_0xc000('0x56')][_0xc000('0x67')],_[_0xc000('0x99')](_0x4fab58[_0xc000('0x56')],[_0xc000('0x67'),'id'])||{})[_0xc000('0x9d')](function(_0x2fdc77){for(var _0x28ed5f=0x0;_0x28ed5f<_0x4fab58['body'][_0xc000('0x67')][_0xc000('0x45')];_0x28ed5f+=0x1){socket[_0xc000('0xd4')](_0xc000('0xd5'),{'UserId':Number(_0x4fab58[_0xc000('0x56')][_0xc000('0x67')][_0x28ed5f]),'SmsAccountId':Number(_0x4fab58[_0xc000('0x5f')]['id'])});}return _0x2fdc77;});}})[_0xc000('0x1d')](respondWithResult(_0x3d168b,null))[_0xc000('0x50')](handleError(_0x3d168b,null));};exports['removeAgents']=function(_0x29951e,_0x559279,_0x3e55c6){return db[_0xc000('0x3c')][_0xc000('0x54')]({'where':{'id':_0x29951e['params']['id']}})[_0xc000('0x1d')](handleEntityNotFound(_0x559279,null))[_0xc000('0x1d')](function(_0x154680){if(_0x154680){return _0x154680[_0xc000('0xd6')](_0x29951e[_0xc000('0x41')][_0xc000('0x67')])['then'](function(){if(_[_0xc000('0xd7')](_0x29951e[_0xc000('0x41')][_0xc000('0x67')])){for(var _0x56aa36=0x0;_0x56aa36<_0x29951e[_0xc000('0x41')][_0xc000('0x67')][_0xc000('0x45')];_0x56aa36+=0x1){socket['emit'](_0xc000('0xd8'),{'UserId':Number(_0x29951e[_0xc000('0x41')][_0xc000('0x67')][_0x56aa36]),'SmsAccountId':Number(_0x29951e[_0xc000('0x5f')]['id'])});}}else{socket['emit'](_0xc000('0xd8'),{'UserId':Number(_0x29951e[_0xc000('0x41')][_0xc000('0x67')]),'SmsAccountId':Number(_0x29951e['params']['id'])});}});}})[_0xc000('0x1d')](respondWithStatusCode(_0x559279,null))['catch'](handleError(_0x559279,null));};exports[_0xc000('0xd9')]=function(_0xd1fd6d,_0x2dc469,_0x279a2e){var _0x7e43eb={};var _0x2fc3d5={};var _0x42603b;var _0x330401;return db[_0xc000('0x3c')][_0xc000('0x64')]({'where':{'id':_0xd1fd6d['params']['id']}})[_0xc000('0x1d')](handleEntityNotFound(_0x2dc469,null))['then'](function(_0x51a766){if(_0x51a766){_0x42603b=_0x51a766;_0x2fc3d5[_0xc000('0x40')]=_['keys'](db[_0xc000('0xb9')][_0xc000('0x3d')]);_0x2fc3d5[_0xc000('0x41')]=_[_0xc000('0x51')](_0xd1fd6d[_0xc000('0x41')]);_0x2fc3d5[_0xc000('0x42')]=_[_0xc000('0x52')](_0x2fc3d5['model'],_0x2fc3d5[_0xc000('0x41')]);_0x7e43eb[_0xc000('0x43')]=_[_0xc000('0x52')](_0x2fc3d5[_0xc000('0x40')],qs[_0xc000('0x44')](_0xd1fd6d[_0xc000('0x41')]['fields']));_0x7e43eb[_0xc000('0x43')]=_0x7e43eb[_0xc000('0x43')][_0xc000('0x45')]?_0x7e43eb[_0xc000('0x43')]:_0x2fc3d5[_0xc000('0x40')];_0x7e43eb['order']=qs[_0xc000('0x48')](_0xd1fd6d[_0xc000('0x41')]['sort']);_0x7e43eb[_0xc000('0x4b')]=qs['filters'](_[_0xc000('0x49')](_0xd1fd6d[_0xc000('0x41')],_0x2fc3d5[_0xc000('0x42')]));if(_0xd1fd6d['query']['filter']){_0x7e43eb[_0xc000('0x4b')]=_[_0xc000('0x4c')](_0x7e43eb['where'],{'$or':_[_0xc000('0x3b')](_0x7e43eb[_0xc000('0x43')],function(_0x369cc8){var _0x3fd06d={};_0x3fd06d[_0x369cc8]={'$like':'%'+_0xd1fd6d[_0xc000('0x41')][_0xc000('0x4a')]+'%'};return _0x3fd06d;})});}_0x7e43eb=_[_0xc000('0x4c')]({},_0x7e43eb,_0xd1fd6d[_0xc000('0x53')]);return _0x42603b[_0xc000('0xd9')](_0x7e43eb);}})[_0xc000('0x1d')](function(_0xea26f4){if(_0xea26f4){_0x330401=_0xea26f4['length'];if(!_0xd1fd6d[_0xc000('0x41')][_0xc000('0x46')](_0xc000('0x47'))){_0x7e43eb[_0xc000('0x2d')]=qs['limit'](_0xd1fd6d[_0xc000('0x41')]['limit']);_0x7e43eb[_0xc000('0x2a')]=qs[_0xc000('0x2a')](_0xd1fd6d[_0xc000('0x41')][_0xc000('0x2a')]);}return _0x42603b[_0xc000('0xd9')](_0x7e43eb);}})[_0xc000('0x1d')](function(_0x2a9e3f){if(_0x2a9e3f){return _0x2a9e3f?{'count':_0x330401,'rows':_0x2a9e3f}:null;}})['then'](respondWithResult(_0x2dc469,null))[_0xc000('0x50')](handleError(_0x2dc469,null));};
\ No newline at end of file
index 9990166..57a5a83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b13=['SmsAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x5d6424,_0x3ad9cf){var _0x59ec84=function(_0x3aa1c3){while(--_0x3aa1c3){_0x5d6424['push'](_0x5d6424['shift']());}};_0x59ec84(++_0x3ad9cf);}(_0x6b13,0x131));var _0x36b1=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x6b13[_0x38537f];return _0x141e23;};'use strict';var EventEmitter=require(_0x36b1('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x36b1('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x36b1('0x2')](0x0);var events={'afterCreate':_0x36b1('0x3'),'afterUpdate':_0x36b1('0x4'),'afterDestroy':_0x36b1('0x5')};function emitEvent(_0x1eb799){return function(_0x359298,_0x9d2c41,_0x56d7b4){SmsAccountEvents[_0x36b1('0x6')](_0x1eb799+':'+_0x359298['id'],_0x359298);SmsAccountEvents[_0x36b1('0x6')](_0x1eb799,_0x359298);_0x56d7b4(null);};}for(var e in events){if(events[_0x36b1('0x7')](e)){var event=events[e];SmsAccount[_0x36b1('0x8')](e,emitEvent(event));}}module['exports']=SmsAccountEvents;
\ No newline at end of file
+var _0x14c7=['update','remove','exports','SmsAccount','setMaxListeners','save'];(function(_0x1aa13e,_0x12a40b){var _0x1144bd=function(_0x5f5cae){while(--_0x5f5cae){_0x1aa13e['push'](_0x1aa13e['shift']());}};_0x1144bd(++_0x12a40b);}(_0x14c7,0x1b3));var _0x714c=function(_0x3a8de1,_0x2e8c13){_0x3a8de1=_0x3a8de1-0x0;var _0x375c03=_0x14c7[_0x3a8de1];return _0x375c03;};'use strict';var EventEmitter=require('events');var SmsAccount=require('../../mysqldb')['db'][_0x714c('0x0')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x714c('0x1')](0x0);var events={'afterCreate':_0x714c('0x2'),'afterUpdate':_0x714c('0x3'),'afterDestroy':_0x714c('0x4')};function emitEvent(_0x253b45){return function(_0x3aa9ff,_0x1c99ec,_0x5be7fb){SmsAccountEvents['emit'](_0x253b45+':'+_0x3aa9ff['id'],_0x3aa9ff);SmsAccountEvents['emit'](_0x253b45,_0x3aa9ff);_0x5be7fb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x714c('0x5')]=SmsAccountEvents;
\ No newline at end of file
index f912f3d..937bcdc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x909d=['rimraf','../../config/environment','./smsAccount.attributes','exports','SmsAccount','sms_accounts','util','api','moment','bluebird','request-promise'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x909d,0x192));var _0xd909=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x909d[_0x58dc25];return _0x21b0a7;};'use strict';var _=require('lodash');var util=require(_0xd909('0x0'));var logger=require('../../config/logger')(_0xd909('0x1'));var moment=require(_0xd909('0x2'));var BPromise=require(_0xd909('0x3'));var rp=require(_0xd909('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd909('0x5'));var config=require(_0xd909('0x6'));var attributes=require(_0xd909('0x7'));module[_0xd909('0x8')]=function(_0x1aefea,_0x43cddb){return _0x1aefea['define'](_0xd909('0x9'),attributes,{'tableName':_0xd909('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd92a=['api','moment','request-promise','path','rimraf','define','SmsAccount','lodash'];(function(_0x5b5fe5,_0x46284e){var _0x2a5193=function(_0x13c1d9){while(--_0x13c1d9){_0x5b5fe5['push'](_0x5b5fe5['shift']());}};_0x2a5193(++_0x46284e);}(_0xd92a,0xaf));var _0xad92=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xd92a[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xad92('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xad92('0x1'));var moment=require(_0xad92('0x2'));var BPromise=require('bluebird');var rp=require(_0xad92('0x3'));var fs=require('fs');var path=require(_0xad92('0x4'));var rimraf=require(_0xad92('0x5'));var config=require('../../config/environment');var attributes=require('./smsAccount.attributes');module['exports']=function(_0x5e9ff4,_0x5521ea){return _0x5e9ff4[_0xad92('0x6')](_0xad92('0x7'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9760cd1..8ba8f88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b00=['options','raw','attributes','include','map','model','debug','stringify','catch','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','http','defaults','redis','localhost','./smsAccount.socket','register','then','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','ShowSmsAccount','SmsAccount','find'];(function(_0x43c683,_0x362f74){var _0x3a714d=function(_0x242c65){while(--_0x242c65){_0x43c683['push'](_0x43c683['shift']());}};_0x3a714d(++_0x362f74);}(_0x5b00,0x195));var _0x05b0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5b00[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x05b0('0x0'));var moment=require(_0x05b0('0x1'));var BPromise=require(_0x05b0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x05b0('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x05b0('0x4'))(_0x05b0('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x05b0('0x6')]({'port':0x232a});config['redis']=_[_0x05b0('0x7')](config[_0x05b0('0x8')],{'host':_0x05b0('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x05b0('0x8')]));require(_0x05b0('0xa'))[_0x05b0('0xb')](socket);function respondWithRpcPromise(_0x2bb611,_0x26e274,_0x224419){return new BPromise(function(_0x4cbef3,_0x1340a1){return client['request'](_0x2bb611,_0x224419)[_0x05b0('0xc')](function(_0x4edb70){logger['info'](_0x05b0('0xd'),_0x26e274,_0x05b0('0xe'));logger['debug'](_0x05b0('0xf'),_0x26e274,_0x05b0('0xe'),JSON['stringify'](_0x4edb70));if(_0x4edb70['error']){if(_0x4edb70[_0x05b0('0x10')][_0x05b0('0x11')]===0x1f4){logger[_0x05b0('0x10')]('SmsAccount,\x20%s,\x20%s',_0x26e274,_0x4edb70['error'][_0x05b0('0x12')]);return _0x1340a1(_0x4edb70[_0x05b0('0x10')][_0x05b0('0x12')]);}logger[_0x05b0('0x10')](_0x05b0('0xd'),_0x26e274,_0x4edb70[_0x05b0('0x10')][_0x05b0('0x12')]);return _0x4cbef3(_0x4edb70[_0x05b0('0x10')][_0x05b0('0x12')]);}else{logger[_0x05b0('0x13')](_0x05b0('0xd'),_0x26e274,_0x05b0('0xe'));_0x4cbef3(_0x4edb70[_0x05b0('0x14')]['message']);}})['catch'](function(_0x797564){logger['error'](_0x05b0('0xd'),_0x26e274,_0x797564);_0x1340a1(_0x797564);});});}exports[_0x05b0('0x15')]=function(_0x3c8162){var _0x591bbf=this;return new Promise(function(_0x569b82,_0x240363){return db[_0x05b0('0x16')][_0x05b0('0x17')]({'raw':_0x3c8162['options']?_0x3c8162[_0x05b0('0x18')][_0x05b0('0x19')]===undefined?!![]:![]:!![],'where':_0x3c8162['options']?_0x3c8162['options']['where']||null:null,'attributes':_0x3c8162[_0x05b0('0x18')]?_0x3c8162[_0x05b0('0x18')][_0x05b0('0x1a')]||null:null,'include':_0x3c8162[_0x05b0('0x18')]?_0x3c8162['options'][_0x05b0('0x1b')]?_[_0x05b0('0x1c')](_0x3c8162[_0x05b0('0x18')]['include'],function(_0xe4aabc){return{'model':db[_0xe4aabc[_0x05b0('0x1d')]],'as':_0xe4aabc['as'],'attributes':_0xe4aabc[_0x05b0('0x1a')],'include':_0xe4aabc['include']?_[_0x05b0('0x1c')](_0xe4aabc[_0x05b0('0x1b')],function(_0x2ccb26){return{'model':db[_0x2ccb26['model']],'as':_0x2ccb26['as'],'attributes':_0x2ccb26[_0x05b0('0x1a')],'include':_0x2ccb26[_0x05b0('0x1b')]?_['map'](_0x2ccb26[_0x05b0('0x1b')],function(_0x336fa4){return{'model':db[_0x336fa4['model']],'as':_0x336fa4['as'],'attributes':_0x336fa4['attributes']};}):[]};}):[]};}):[]:[]})[_0x05b0('0xc')](function(_0x1b3a5a){logger[_0x05b0('0x13')](_0x05b0('0x15'),_0x3c8162);logger[_0x05b0('0x1e')](_0x05b0('0x15'),_0x3c8162,JSON[_0x05b0('0x1f')](_0x1b3a5a));_0x569b82(_0x1b3a5a);})[_0x05b0('0x20')](function(_0x475f70){logger[_0x05b0('0x10')](_0x05b0('0x15'),_0x475f70[_0x05b0('0x12')],_0x3c8162);_0x240363(_0x591bbf['error'](0x1f4,_0x475f70['message']));});});};
\ No newline at end of file
+var _0xb6ea=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','SmsAccount','find','options','where','attributes','include','map','model','ShowSmsAccount','stringify','lodash','util','bluebird'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xb6ea,0xc0));var _0xab6e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb6ea[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xab6e('0x0'));var util=require(_0xab6e('0x1'));var moment=require('moment');var BPromise=require(_0xab6e('0x2'));var rs=require(_0xab6e('0x3'));var fs=require('fs');var Redis=require(_0xab6e('0x4'));var db=require(_0xab6e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xab6e('0x6'))(_0xab6e('0x7'));var config=require('../../config/environment');var jayson=require(_0xab6e('0x8'));var client=jayson[_0xab6e('0x9')][_0xab6e('0xa')]({'port':0x232a});config[_0xab6e('0xb')]=_[_0xab6e('0xc')](config[_0xab6e('0xb')],{'host':_0xab6e('0xd'),'port':0x18eb});var socket=require(_0xab6e('0xe'))(new Redis(config[_0xab6e('0xb')]));require(_0xab6e('0xf'))[_0xab6e('0x10')](socket);function respondWithRpcPromise(_0x4b6942,_0x19e272,_0x3fa196){return new BPromise(function(_0x27dc58,_0x35e11c){return client[_0xab6e('0x11')](_0x4b6942,_0x3fa196)[_0xab6e('0x12')](function(_0x396201){logger[_0xab6e('0x13')](_0xab6e('0x14'),_0x19e272,_0xab6e('0x15'));logger[_0xab6e('0x16')](_0xab6e('0x17'),_0x19e272,_0xab6e('0x15'),JSON['stringify'](_0x396201));if(_0x396201[_0xab6e('0x18')]){if(_0x396201[_0xab6e('0x18')][_0xab6e('0x19')]===0x1f4){logger[_0xab6e('0x18')]('SmsAccount,\x20%s,\x20%s',_0x19e272,_0x396201[_0xab6e('0x18')]['message']);return _0x35e11c(_0x396201[_0xab6e('0x18')][_0xab6e('0x1a')]);}logger[_0xab6e('0x18')](_0xab6e('0x14'),_0x19e272,_0x396201['error'][_0xab6e('0x1a')]);return _0x27dc58(_0x396201[_0xab6e('0x18')]['message']);}else{logger[_0xab6e('0x13')](_0xab6e('0x14'),_0x19e272,_0xab6e('0x15'));_0x27dc58(_0x396201[_0xab6e('0x1b')]['message']);}})[_0xab6e('0x1c')](function(_0x3134ff){logger['error'](_0xab6e('0x14'),_0x19e272,_0x3134ff);_0x35e11c(_0x3134ff);});});}exports['ShowSmsAccount']=function(_0x5d9069){var _0x5ac6ea=this;return new Promise(function(_0x551466,_0x4d855a){return db[_0xab6e('0x1d')][_0xab6e('0x1e')]({'raw':_0x5d9069[_0xab6e('0x1f')]?_0x5d9069[_0xab6e('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x5d9069[_0xab6e('0x1f')]?_0x5d9069['options'][_0xab6e('0x20')]||null:null,'attributes':_0x5d9069['options']?_0x5d9069[_0xab6e('0x1f')][_0xab6e('0x21')]||null:null,'include':_0x5d9069[_0xab6e('0x1f')]?_0x5d9069['options'][_0xab6e('0x22')]?_[_0xab6e('0x23')](_0x5d9069['options'][_0xab6e('0x22')],function(_0x99571e){return{'model':db[_0x99571e['model']],'as':_0x99571e['as'],'attributes':_0x99571e[_0xab6e('0x21')],'include':_0x99571e[_0xab6e('0x22')]?_['map'](_0x99571e[_0xab6e('0x22')],function(_0x171337){return{'model':db[_0x171337[_0xab6e('0x24')]],'as':_0x171337['as'],'attributes':_0x171337[_0xab6e('0x21')],'include':_0x171337[_0xab6e('0x22')]?_[_0xab6e('0x23')](_0x171337[_0xab6e('0x22')],function(_0x45bc4b){return{'model':db[_0x45bc4b[_0xab6e('0x24')]],'as':_0x45bc4b['as'],'attributes':_0x45bc4b['attributes']};}):[]};}):[]};}):[]:[]})[_0xab6e('0x12')](function(_0x1aa588){logger['info'](_0xab6e('0x25'),_0x5d9069);logger['debug'](_0xab6e('0x25'),_0x5d9069,JSON[_0xab6e('0x26')](_0x1aa588));_0x551466(_0x1aa588);})[_0xab6e('0x1c')](function(_0x11b45b){logger[_0xab6e('0x18')](_0xab6e('0x25'),_0x11b45b[_0xab6e('0x1a')],_0x5d9069);_0x4d855a(_0x5ac6ea[_0xab6e('0x18')](0x1f4,_0x11b45b['message']));});});};
\ No newline at end of file
index aa785e6..ad1633d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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 ef1f7a9..3e33916 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2f6167,_0x432253){var _0x2e2548=function(_0x1da10){while(--_0x1da10){_0x2f6167['push'](_0x2f6167['shift']());}};_0x2e2548(++_0x432253);}(_0x34e8,0x12c));var _0x834e=function(_0x48acac,_0x189179){_0x48acac=_0x48acac-0x0;var _0x3ddaf6=_0x34e8[_0x48acac];return _0x3ddaf6;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router;
\ No newline at end of file
+var _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x38ddb2,_0x1141e1){var _0x22ee32=function(_0x4f48d7){while(--_0x4f48d7){_0x38ddb2['push'](_0x38ddb2['shift']());}};_0x22ee32(++_0x1141e1);}(_0x3e74,0x175));var _0x43e7=function(_0x1f2e93,_0x3c2493){_0x1f2e93=_0x1f2e93-0x0;var _0x445f26=_0x3e74[_0x1f2e93];return _0x445f26;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router;
\ No newline at end of file
index 6a34d87..8ac56c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4537=['exports','INTEGER','TEXT','STRING','*,*,*,*'];(function(_0x52d861,_0x21f9b9){var _0x1a2023=function(_0x43d056){while(--_0x43d056){_0x52d861['push'](_0x52d861['shift']());}};_0x1a2023(++_0x21f9b9);}(_0x4537,0x1bd));var _0x7453=function(_0x78ceb1,_0xe581ec){_0x78ceb1=_0x78ceb1-0x0;var _0x2f724e=_0x4537[_0x78ceb1];return _0x2f724e;};'use strict';var Sequelize=require('sequelize');module[_0x7453('0x0')]={'priority':{'type':Sequelize[_0x7453('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x7453('0x2')]()},'description':{'type':Sequelize[_0x7453('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x7453('0x4')}};
\ No newline at end of file
+var _0x821c=['STRING','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x821c,0xa5));var _0xc821=function(_0x5685f7,_0x53e368){_0x5685f7=_0x5685f7-0x0;var _0x446dab=_0x821c[_0x5685f7];return _0x446dab;};'use strict';var Sequelize=require(_0xc821('0x0'));module[_0xc821('0x1')]={'priority':{'type':Sequelize[_0xc821('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xc821('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xc821('0x4')]()},'description':{'type':Sequelize[_0xc821('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xc821('0x5')}};
\ No newline at end of file
index e6366a4..c2e144a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b2d=['options','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','SmsApplication','rawAttributes','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x4b2d,0x12c));var _0xd4b2=function(_0x1e2080,_0x53283b){_0x1e2080=_0x1e2080-0x0;var _0x260111=_0x4b2d[_0x1e2080];return _0x260111;};'use strict';var emlformat=require(_0xd4b2('0x0'));var rimraf=require(_0xd4b2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd4b2('0x2'));var rp=require(_0xd4b2('0x3'));var moment=require('moment');var BPromise=require(_0xd4b2('0x4'));var Mustache=require(_0xd4b2('0x5'));var util=require(_0xd4b2('0x6'));var path=require(_0xd4b2('0x7'));var sox=require(_0xd4b2('0x8'));var csv=require(_0xd4b2('0x9'));var ejs=require(_0xd4b2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd4b2('0xb'));var squel=require(_0xd4b2('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd4b2('0x9'));var querystring=require(_0xd4b2('0xd'));var Papa=require(_0xd4b2('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd4b2('0xf'));var as=require(_0xd4b2('0x10'));var hardwareService=require(_0xd4b2('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xd4b2('0x12'));var config=require(_0xd4b2('0x13'));var licenseUtil=require(_0xd4b2('0x14'));var db=require(_0xd4b2('0x15'))['db'];function respondWithStatusCode(_0x1fad98,_0x319f28){_0x319f28=_0x319f28||0xcc;return function(_0x5c998b){if(_0x5c998b){return _0x1fad98[_0xd4b2('0x16')](_0x319f28);}return _0x1fad98[_0xd4b2('0x17')](_0x319f28)[_0xd4b2('0x18')]();};}function respondWithResult(_0x354840,_0x47ea0b){_0x47ea0b=_0x47ea0b||0xc8;return function(_0x295320){if(_0x295320){return _0x354840['status'](_0x47ea0b)[_0xd4b2('0x19')](_0x295320);}};}function respondWithFilteredResult(_0x9b92e0,_0x5da73f){return function(_0x419ace){if(_0x419ace){var _0xf8da17=typeof _0x5da73f[_0xd4b2('0x1a')]===_0xd4b2('0x1b')&&typeof _0x5da73f[_0xd4b2('0x1c')]==='undefined';var _0x3bc053=_0x419ace[_0xd4b2('0x1d')];var _0x34a543=_0xf8da17?0x0:_0x5da73f['offset'];var _0x9f89ac=_0xf8da17?_0x419ace[_0xd4b2('0x1d')]:_0x5da73f[_0xd4b2('0x1a')]+_0x5da73f[_0xd4b2('0x1c')];var _0x220258;if(_0x9f89ac>=_0x3bc053){_0x9f89ac=_0x3bc053;_0x220258=0xc8;}else{_0x220258=0xce;}_0x9b92e0[_0xd4b2('0x17')](_0x220258);return _0x9b92e0['set'](_0xd4b2('0x1e'),_0x34a543+'-'+_0x9f89ac+'/'+_0x3bc053)[_0xd4b2('0x19')](_0x419ace);}return null;};}function patchUpdates(_0x1229f7){return function(_0x244e49){try{jsonpatch[_0xd4b2('0x1f')](_0x244e49,_0x1229f7,!![]);}catch(_0x5558e4){return BPromise[_0xd4b2('0x20')](_0x5558e4);}return _0x244e49[_0xd4b2('0x21')]();};}function saveUpdates(_0x41b720,_0xafce2c){return function(_0x4cb038){if(_0x4cb038){return _0x4cb038[_0xd4b2('0x22')](_0x41b720)[_0xd4b2('0x23')](function(_0x3b0a7a){return _0x3b0a7a;});}return null;};}function removeEntity(_0x108b1f,_0x477a95){return function(_0xe96cd3){if(_0xe96cd3){return _0xe96cd3[_0xd4b2('0x24')]()['then'](function(){_0x108b1f[_0xd4b2('0x17')](0xcc)[_0xd4b2('0x18')]();});}};}function handleEntityNotFound(_0x47cfc2,_0x299b65){return function(_0x15dfd7){if(!_0x15dfd7){_0x47cfc2['sendStatus'](0x194);}return _0x15dfd7;};}function handleError(_0x4dfb25,_0x4a3db9){_0x4a3db9=_0x4a3db9||0x1f4;return function(_0x44b504){logger[_0xd4b2('0x25')](_0x44b504[_0xd4b2('0x26')]);if(_0x44b504['name']){delete _0x44b504[_0xd4b2('0x27')];}_0x4dfb25[_0xd4b2('0x17')](_0x4a3db9)[_0xd4b2('0x28')](_0x44b504);};}exports['index']=function(_0x210f4c,_0x17e5c8){var _0x2ce649={},_0x1e3876={},_0x314300={'count':0x0,'rows':[]};var _0x2bb528=_[_0xd4b2('0x29')](db[_0xd4b2('0x2a')][_0xd4b2('0x2b')],function(_0x3068c1){return{'name':_0x3068c1['fieldName'],'type':_0x3068c1[_0xd4b2('0x2c')][_0xd4b2('0x2d')]};});_0x1e3876[_0xd4b2('0x2e')]=_[_0xd4b2('0x29')](_0x2bb528,_0xd4b2('0x27'));_0x1e3876['query']=_[_0xd4b2('0x2f')](_0x210f4c[_0xd4b2('0x30')]);_0x1e3876['filters']=_[_0xd4b2('0x31')](_0x1e3876['model'],_0x1e3876['query']);_0x2ce649['attributes']=_[_0xd4b2('0x31')](_0x1e3876[_0xd4b2('0x2e')],qs[_0xd4b2('0x32')](_0x210f4c[_0xd4b2('0x30')][_0xd4b2('0x32')]));_0x2ce649[_0xd4b2('0x33')]=_0x2ce649[_0xd4b2('0x33')][_0xd4b2('0x34')]?_0x2ce649[_0xd4b2('0x33')]:_0x1e3876[_0xd4b2('0x2e')];if(!_0x210f4c[_0xd4b2('0x30')][_0xd4b2('0x35')](_0xd4b2('0x36'))){_0x2ce649[_0xd4b2('0x1c')]=qs['limit'](_0x210f4c[_0xd4b2('0x30')][_0xd4b2('0x1c')]);_0x2ce649['offset']=qs['offset'](_0x210f4c[_0xd4b2('0x30')][_0xd4b2('0x1a')]);}_0x2ce649[_0xd4b2('0x37')]=qs[_0xd4b2('0x38')](_0x210f4c[_0xd4b2('0x30')][_0xd4b2('0x38')]);_0x2ce649[_0xd4b2('0x39')]=qs[_0xd4b2('0x3a')](_[_0xd4b2('0x3b')](_0x210f4c['query'],_0x1e3876[_0xd4b2('0x3a')]),_0x2bb528);if(_0x210f4c[_0xd4b2('0x30')][_0xd4b2('0x3c')]){_0x2ce649[_0xd4b2('0x39')]=_[_0xd4b2('0x3d')](_0x2ce649[_0xd4b2('0x39')],{'$or':_['map'](_0x2bb528,function(_0x520631){if(_0x520631[_0xd4b2('0x2c')]!==_0xd4b2('0x3e')){var _0x406501={};_0x406501[_0x520631[_0xd4b2('0x27')]]={'$like':'%'+_0x210f4c[_0xd4b2('0x30')]['filter']+'%'};return _0x406501;}})});}_0x2ce649=_[_0xd4b2('0x3d')]({},_0x2ce649,_0x210f4c['options']);var _0x1504e4={'where':_0x2ce649[_0xd4b2('0x39')]};return db[_0xd4b2('0x2a')]['count'](_0x1504e4)[_0xd4b2('0x23')](function(_0x2035ea){_0x314300[_0xd4b2('0x1d')]=_0x2035ea;if(_0x210f4c[_0xd4b2('0x30')][_0xd4b2('0x3f')]){_0x2ce649[_0xd4b2('0x40')]=[{'all':!![]}];}return db[_0xd4b2('0x2a')][_0xd4b2('0x41')](_0x2ce649);})[_0xd4b2('0x23')](function(_0x55e85b){_0x314300[_0xd4b2('0x42')]=_0x55e85b;return _0x314300;})[_0xd4b2('0x23')](respondWithFilteredResult(_0x17e5c8,_0x2ce649))[_0xd4b2('0x43')](handleError(_0x17e5c8,null));};exports[_0xd4b2('0x44')]=function(_0x165441,_0x467de){var _0x51589b={'raw':!![],'where':{'id':_0x165441[_0xd4b2('0x45')]['id']}},_0x18009c={};_0x18009c[_0xd4b2('0x2e')]=_[_0xd4b2('0x2f')](db[_0xd4b2('0x2a')][_0xd4b2('0x2b')]);_0x18009c[_0xd4b2('0x30')]=_['keys'](_0x165441[_0xd4b2('0x30')]);_0x18009c['filters']=_[_0xd4b2('0x31')](_0x18009c['model'],_0x18009c[_0xd4b2('0x30')]);_0x51589b[_0xd4b2('0x33')]=_[_0xd4b2('0x31')](_0x18009c[_0xd4b2('0x2e')],qs[_0xd4b2('0x32')](_0x165441[_0xd4b2('0x30')][_0xd4b2('0x32')]));_0x51589b[_0xd4b2('0x33')]=_0x51589b[_0xd4b2('0x33')]['length']?_0x51589b['attributes']:_0x18009c[_0xd4b2('0x2e')];if(_0x165441['query']['includeAll']){_0x51589b[_0xd4b2('0x40')]=[{'all':!![]}];}_0x51589b=_['merge']({},_0x51589b,_0x165441[_0xd4b2('0x46')]);return db[_0xd4b2('0x2a')][_0xd4b2('0x47')](_0x51589b)[_0xd4b2('0x23')](handleEntityNotFound(_0x467de,null))['then'](respondWithResult(_0x467de,null))[_0xd4b2('0x43')](handleError(_0x467de,null));};exports[_0xd4b2('0x48')]=function(_0x236df1,_0x330afc){return db['SmsApplication'][_0xd4b2('0x48')](_0x236df1[_0xd4b2('0x49')],{})[_0xd4b2('0x23')](respondWithResult(_0x330afc,0xc9))[_0xd4b2('0x43')](handleError(_0x330afc,null));};exports[_0xd4b2('0x22')]=function(_0x2d14d8,_0x1a9ec6){if(_0x2d14d8[_0xd4b2('0x49')]['id']){delete _0x2d14d8[_0xd4b2('0x49')]['id'];}return db[_0xd4b2('0x2a')][_0xd4b2('0x47')]({'where':{'id':_0x2d14d8[_0xd4b2('0x45')]['id']}})['then'](handleEntityNotFound(_0x1a9ec6,null))[_0xd4b2('0x23')](saveUpdates(_0x2d14d8[_0xd4b2('0x49')],null))[_0xd4b2('0x23')](respondWithResult(_0x1a9ec6,null))[_0xd4b2('0x43')](handleError(_0x1a9ec6,null));};exports[_0xd4b2('0x24')]=function(_0x5e9403,_0x2f541c){return db[_0xd4b2('0x2a')]['find']({'where':{'id':_0x5e9403[_0xd4b2('0x45')]['id']}})['then'](handleEntityNotFound(_0x2f541c,null))[_0xd4b2('0x23')](removeEntity(_0x2f541c,null))['catch'](handleError(_0x2f541c,null));};
\ No newline at end of file
+var _0x3ba2=['includeAll','include','findAll','catch','show','params','intersection','find','create','body','update','destroy','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','save','then','end','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','order','sort','where','pick','filter','merge','options'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x3ba2,0x147));var _0x23ba=function(_0x3f1660,_0x2df909){_0x3f1660=_0x3f1660-0x0;var _0x55c246=_0x3ba2[_0x3f1660];return _0x55c246;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x23ba('0x0'));var zipdir=require(_0x23ba('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x23ba('0x2'));var moment=require(_0x23ba('0x3'));var BPromise=require(_0x23ba('0x4'));var Mustache=require('mustache');var util=require(_0x23ba('0x5'));var path=require(_0x23ba('0x6'));var sox=require('sox');var csv=require(_0x23ba('0x7'));var ejs=require(_0x23ba('0x8'));var fs=require('fs');var fs_extra=require(_0x23ba('0x9'));var _=require('lodash');var squel=require(_0x23ba('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x23ba('0xb'));var toCsv=require('to-csv');var querystring=require(_0x23ba('0xc'));var Papa=require(_0x23ba('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x23ba('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x23ba('0xf'));var utils=require(_0x23ba('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x23ba('0x11'))['db'];function respondWithStatusCode(_0x4371df,_0x1c7821){_0x1c7821=_0x1c7821||0xcc;return function(_0xd58ba6){if(_0xd58ba6){return _0x4371df[_0x23ba('0x12')](_0x1c7821);}return _0x4371df[_0x23ba('0x13')](_0x1c7821)['end']();};}function respondWithResult(_0x404a7f,_0x497515){_0x497515=_0x497515||0xc8;return function(_0x3eb221){if(_0x3eb221){return _0x404a7f['status'](_0x497515)['json'](_0x3eb221);}};}function respondWithFilteredResult(_0x164b64,_0x4c3bfb){return function(_0x5b44d1){if(_0x5b44d1){var _0x447526=typeof _0x4c3bfb[_0x23ba('0x14')]===_0x23ba('0x15')&&typeof _0x4c3bfb[_0x23ba('0x16')]===_0x23ba('0x15');var _0x3cc567=_0x5b44d1['count'];var _0x4ad629=_0x447526?0x0:_0x4c3bfb[_0x23ba('0x14')];var _0x3776ff=_0x447526?_0x5b44d1['count']:_0x4c3bfb[_0x23ba('0x14')]+_0x4c3bfb[_0x23ba('0x16')];var _0x3049df;if(_0x3776ff>=_0x3cc567){_0x3776ff=_0x3cc567;_0x3049df=0xc8;}else{_0x3049df=0xce;}_0x164b64[_0x23ba('0x13')](_0x3049df);return _0x164b64['set']('Content-Range',_0x4ad629+'-'+_0x3776ff+'/'+_0x3cc567)['json'](_0x5b44d1);}return null;};}function patchUpdates(_0x117ced){return function(_0xc28276){try{jsonpatch['apply'](_0xc28276,_0x117ced,!![]);}catch(_0x48e484){return BPromise['reject'](_0x48e484);}return _0xc28276[_0x23ba('0x17')]();};}function saveUpdates(_0x5e6d45,_0x2e43c7){return function(_0x20fade){if(_0x20fade){return _0x20fade['update'](_0x5e6d45)[_0x23ba('0x18')](function(_0x10aa86){return _0x10aa86;});}return null;};}function removeEntity(_0x2db9dd,_0x412f4f){return function(_0x4cb83e){if(_0x4cb83e){return _0x4cb83e['destroy']()[_0x23ba('0x18')](function(){_0x2db9dd[_0x23ba('0x13')](0xcc)[_0x23ba('0x19')]();});}};}function handleEntityNotFound(_0x2b6d1d,_0x17e058){return function(_0x29784a){if(!_0x29784a){_0x2b6d1d[_0x23ba('0x12')](0x194);}return _0x29784a;};}function handleError(_0x13b055,_0x39904e){_0x39904e=_0x39904e||0x1f4;return function(_0x408f9c){logger[_0x23ba('0x1a')](_0x408f9c[_0x23ba('0x1b')]);if(_0x408f9c['name']){delete _0x408f9c[_0x23ba('0x1c')];}_0x13b055['status'](_0x39904e)[_0x23ba('0x1d')](_0x408f9c);};}exports[_0x23ba('0x1e')]=function(_0x3c1096,_0x56539e){var _0x4aa51e={},_0x1031ca={},_0x49c427={'count':0x0,'rows':[]};var _0x4c710f=_[_0x23ba('0x1f')](db[_0x23ba('0x20')][_0x23ba('0x21')],function(_0x150cc9){return{'name':_0x150cc9[_0x23ba('0x22')],'type':_0x150cc9[_0x23ba('0x23')][_0x23ba('0x24')]};});_0x1031ca[_0x23ba('0x25')]=_[_0x23ba('0x1f')](_0x4c710f,_0x23ba('0x1c'));_0x1031ca[_0x23ba('0x26')]=_[_0x23ba('0x27')](_0x3c1096[_0x23ba('0x26')]);_0x1031ca[_0x23ba('0x28')]=_['intersection'](_0x1031ca[_0x23ba('0x25')],_0x1031ca['query']);_0x4aa51e[_0x23ba('0x29')]=_['intersection'](_0x1031ca[_0x23ba('0x25')],qs[_0x23ba('0x2a')](_0x3c1096['query']['fields']));_0x4aa51e[_0x23ba('0x29')]=_0x4aa51e[_0x23ba('0x29')][_0x23ba('0x2b')]?_0x4aa51e[_0x23ba('0x29')]:_0x1031ca[_0x23ba('0x25')];if(!_0x3c1096[_0x23ba('0x26')]['hasOwnProperty']('nolimit')){_0x4aa51e[_0x23ba('0x16')]=qs[_0x23ba('0x16')](_0x3c1096[_0x23ba('0x26')][_0x23ba('0x16')]);_0x4aa51e[_0x23ba('0x14')]=qs[_0x23ba('0x14')](_0x3c1096[_0x23ba('0x26')][_0x23ba('0x14')]);}_0x4aa51e[_0x23ba('0x2c')]=qs[_0x23ba('0x2d')](_0x3c1096[_0x23ba('0x26')][_0x23ba('0x2d')]);_0x4aa51e[_0x23ba('0x2e')]=qs[_0x23ba('0x28')](_[_0x23ba('0x2f')](_0x3c1096[_0x23ba('0x26')],_0x1031ca[_0x23ba('0x28')]),_0x4c710f);if(_0x3c1096[_0x23ba('0x26')][_0x23ba('0x30')]){_0x4aa51e[_0x23ba('0x2e')]=_[_0x23ba('0x31')](_0x4aa51e[_0x23ba('0x2e')],{'$or':_[_0x23ba('0x1f')](_0x4c710f,function(_0x5d8302){if(_0x5d8302['type']!=='VIRTUAL'){var _0x4d28b8={};_0x4d28b8[_0x5d8302[_0x23ba('0x1c')]]={'$like':'%'+_0x3c1096[_0x23ba('0x26')]['filter']+'%'};return _0x4d28b8;}})});}_0x4aa51e=_[_0x23ba('0x31')]({},_0x4aa51e,_0x3c1096[_0x23ba('0x32')]);var _0x204379={'where':_0x4aa51e[_0x23ba('0x2e')]};return db[_0x23ba('0x20')]['count'](_0x204379)['then'](function(_0x52056c){_0x49c427['count']=_0x52056c;if(_0x3c1096[_0x23ba('0x26')][_0x23ba('0x33')]){_0x4aa51e[_0x23ba('0x34')]=[{'all':!![]}];}return db['SmsApplication'][_0x23ba('0x35')](_0x4aa51e);})[_0x23ba('0x18')](function(_0x46cf85){_0x49c427['rows']=_0x46cf85;return _0x49c427;})['then'](respondWithFilteredResult(_0x56539e,_0x4aa51e))[_0x23ba('0x36')](handleError(_0x56539e,null));};exports[_0x23ba('0x37')]=function(_0x595c7d,_0x239151){var _0x159174={'raw':!![],'where':{'id':_0x595c7d[_0x23ba('0x38')]['id']}},_0x2c8cba={};_0x2c8cba[_0x23ba('0x25')]=_['keys'](db['SmsApplication'][_0x23ba('0x21')]);_0x2c8cba[_0x23ba('0x26')]=_[_0x23ba('0x27')](_0x595c7d[_0x23ba('0x26')]);_0x2c8cba[_0x23ba('0x28')]=_[_0x23ba('0x39')](_0x2c8cba[_0x23ba('0x25')],_0x2c8cba['query']);_0x159174[_0x23ba('0x29')]=_[_0x23ba('0x39')](_0x2c8cba['model'],qs['fields'](_0x595c7d[_0x23ba('0x26')][_0x23ba('0x2a')]));_0x159174['attributes']=_0x159174[_0x23ba('0x29')]['length']?_0x159174[_0x23ba('0x29')]:_0x2c8cba[_0x23ba('0x25')];if(_0x595c7d[_0x23ba('0x26')]['includeAll']){_0x159174[_0x23ba('0x34')]=[{'all':!![]}];}_0x159174=_[_0x23ba('0x31')]({},_0x159174,_0x595c7d[_0x23ba('0x32')]);return db[_0x23ba('0x20')][_0x23ba('0x3a')](_0x159174)[_0x23ba('0x18')](handleEntityNotFound(_0x239151,null))[_0x23ba('0x18')](respondWithResult(_0x239151,null))[_0x23ba('0x36')](handleError(_0x239151,null));};exports[_0x23ba('0x3b')]=function(_0x159aaa,_0x4f7d0f){return db[_0x23ba('0x20')][_0x23ba('0x3b')](_0x159aaa[_0x23ba('0x3c')],{})[_0x23ba('0x18')](respondWithResult(_0x4f7d0f,0xc9))[_0x23ba('0x36')](handleError(_0x4f7d0f,null));};exports[_0x23ba('0x3d')]=function(_0x5173cb,_0x408e83){if(_0x5173cb[_0x23ba('0x3c')]['id']){delete _0x5173cb[_0x23ba('0x3c')]['id'];}return db[_0x23ba('0x20')][_0x23ba('0x3a')]({'where':{'id':_0x5173cb[_0x23ba('0x38')]['id']}})[_0x23ba('0x18')](handleEntityNotFound(_0x408e83,null))[_0x23ba('0x18')](saveUpdates(_0x5173cb[_0x23ba('0x3c')],null))[_0x23ba('0x18')](respondWithResult(_0x408e83,null))[_0x23ba('0x36')](handleError(_0x408e83,null));};exports[_0x23ba('0x3e')]=function(_0x5240be,_0x183db5){return db[_0x23ba('0x20')][_0x23ba('0x3a')]({'where':{'id':_0x5240be['params']['id']}})[_0x23ba('0x18')](handleEntityNotFound(_0x183db5,null))[_0x23ba('0x18')](removeEntity(_0x183db5,null))[_0x23ba('0x36')](handleError(_0x183db5,null));};
\ No newline at end of file
index 187726c..efb83c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64a5=['rimraf','../../config/environment','./smsApplication.attributes','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','util','api','moment','path'];(function(_0x56f72b,_0x431af8){var _0x19c6fe=function(_0x51a833){while(--_0x51a833){_0x56f72b['push'](_0x56f72b['shift']());}};_0x19c6fe(++_0x431af8);}(_0x64a5,0x80));var _0x564a=function(_0x5a1036,_0x16525d){_0x5a1036=_0x5a1036-0x0;var _0x5453e1=_0x64a5[_0x5a1036];return _0x5453e1;};'use strict';var _=require('lodash');var util=require(_0x564a('0x0'));var logger=require('../../config/logger')(_0x564a('0x1'));var moment=require(_0x564a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x564a('0x3'));var rimraf=require(_0x564a('0x4'));var config=require(_0x564a('0x5'));var attributes=require(_0x564a('0x6'));module['exports']=function(_0x4be9f5,_0x418292){return _0x4be9f5['define'](_0x564a('0x7'),attributes,{'tableName':_0x564a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x564a('0x9'),'collate':_0x564a('0xa')});};
\ No newline at end of file
+var _0x6076=['../../config/logger','api','moment','bluebird','path','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash','util'];(function(_0x353222,_0x2e391e){var _0x4e304e=function(_0x1bc2d7){while(--_0x1bc2d7){_0x353222['push'](_0x353222['shift']());}};_0x4e304e(++_0x2e391e);}(_0x6076,0xb4));var _0x6607=function(_0x2fb35d,_0x4760a5){_0x2fb35d=_0x2fb35d-0x0;var _0x55e797=_0x6076[_0x2fb35d];return _0x55e797;};'use strict';var _=require(_0x6607('0x0'));var util=require(_0x6607('0x1'));var logger=require(_0x6607('0x2'))(_0x6607('0x3'));var moment=require(_0x6607('0x4'));var BPromise=require(_0x6607('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6607('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6607('0x7'));module[_0x6607('0x8')]=function(_0x25ad19,_0xe77a33){return _0x25ad19[_0x6607('0x9')](_0x6607('0xa'),attributes,{'tableName':_0x6607('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x6607('0xc')});};
\ No newline at end of file
index e0c61c0..94eef14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5204=['rpc','jayson/promise','client','http','request','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5204,0xdf));var _0x4520=function(_0x59f0dc,_0x1e2497){_0x59f0dc=_0x59f0dc-0x0;var _0x5b5445=_0x5204[_0x59f0dc];return _0x5b5445;};'use strict';var _=require(_0x4520('0x0'));var util=require(_0x4520('0x1'));var moment=require('moment');var BPromise=require(_0x4520('0x2'));var rs=require(_0x4520('0x3'));var fs=require('fs');var Redis=require(_0x4520('0x4'));var db=require(_0x4520('0x5'))['db'];var utils=require(_0x4520('0x6'));var logger=require('../../config/logger')(_0x4520('0x7'));var config=require('../../config/environment');var jayson=require(_0x4520('0x8'));var client=jayson[_0x4520('0x9')][_0x4520('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe741c2,_0x396d29,_0x446dc9){return new BPromise(function(_0x27890f,_0x55b44f){return client[_0x4520('0xb')](_0xe741c2,_0x446dc9)['then'](function(_0x168e62){logger[_0x4520('0xc')](_0x4520('0xd'),_0x396d29,_0x4520('0xe'));logger[_0x4520('0xf')](_0x4520('0x10'),_0x396d29,_0x4520('0xe'),JSON[_0x4520('0x11')](_0x168e62));if(_0x168e62[_0x4520('0x12')]){if(_0x168e62[_0x4520('0x12')][_0x4520('0x13')]===0x1f4){logger[_0x4520('0x12')](_0x4520('0xd'),_0x396d29,_0x168e62[_0x4520('0x12')][_0x4520('0x14')]);return _0x55b44f(_0x168e62[_0x4520('0x12')][_0x4520('0x14')]);}logger[_0x4520('0x12')](_0x4520('0xd'),_0x396d29,_0x168e62[_0x4520('0x12')][_0x4520('0x14')]);return _0x27890f(_0x168e62['error'][_0x4520('0x14')]);}else{logger[_0x4520('0xc')](_0x4520('0xd'),_0x396d29,_0x4520('0xe'));_0x27890f(_0x168e62[_0x4520('0x15')]['message']);}})[_0x4520('0x16')](function(_0x33ac29){logger[_0x4520('0x12')](_0x4520('0xd'),_0x396d29,_0x33ac29);_0x55b44f(_0x33ac29);});});}
\ No newline at end of file
+var _0x5b12=['SmsApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','client','request','then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0x5b12,0xa3));var _0x25b1=function(_0x477f58,_0x3f54d5){_0x477f58=_0x477f58-0x0;var _0x58a11f=_0x5b12[_0x477f58];return _0x58a11f;};'use strict';var _=require(_0x25b1('0x0'));var util=require(_0x25b1('0x1'));var moment=require(_0x25b1('0x2'));var BPromise=require('bluebird');var rs=require(_0x25b1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25b1('0x4'))['db'];var utils=require(_0x25b1('0x5'));var logger=require('../../config/logger')(_0x25b1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x25b1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bb95b,_0x1f715d,_0x28c980){return new BPromise(function(_0x451c66,_0x2a46e0){return client[_0x25b1('0x8')](_0x5bb95b,_0x28c980)[_0x25b1('0x9')](function(_0x3346ed){logger[_0x25b1('0xa')]('SmsApplication,\x20%s,\x20%s',_0x1f715d,_0x25b1('0xb'));logger[_0x25b1('0xc')](_0x25b1('0xd'),_0x1f715d,_0x25b1('0xb'),JSON[_0x25b1('0xe')](_0x3346ed));if(_0x3346ed[_0x25b1('0xf')]){if(_0x3346ed[_0x25b1('0xf')][_0x25b1('0x10')]===0x1f4){logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x3346ed[_0x25b1('0xf')][_0x25b1('0x12')]);return _0x2a46e0(_0x3346ed[_0x25b1('0xf')][_0x25b1('0x12')]);}logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x3346ed['error'][_0x25b1('0x12')]);return _0x451c66(_0x3346ed[_0x25b1('0xf')]['message']);}else{logger[_0x25b1('0xa')](_0x25b1('0x11'),_0x1f715d,_0x25b1('0xb'));_0x451c66(_0x3346ed['result']['message']);}})[_0x25b1('0x13')](function(_0x573ec2){logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x573ec2);_0x2a46e0(_0x573ec2);});});}
\ No newline at end of file
index 6d3591e..5458342 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6324=['isAuthenticated','index','describe','show','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','/:id','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get'];(function(_0x5bad90,_0x49df8d){var _0x5edb65=function(_0x1af1ba){while(--_0x1af1ba){_0x5bad90['push'](_0x5bad90['shift']());}};_0x5edb65(++_0x49df8d);}(_0x6324,0x142));var _0x4632=function(_0x3bd792,_0x171a3e){_0x3bd792=_0x3bd792-0x0;var _0x405c0f=_0x6324[_0x3bd792];return _0x405c0f;};'use strict';var multer=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var path=require(_0x4632('0x2'));var timeout=require(_0x4632('0x3'));var express=require('express');var router=express[_0x4632('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4632('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4632('0x6'));var controller=require('./smsInteraction.controller');router[_0x4632('0x7')]('/',auth[_0x4632('0x8')](),controller[_0x4632('0x9')]);router[_0x4632('0x7')]('/describe',auth[_0x4632('0x8')](),controller[_0x4632('0xa')]);router[_0x4632('0x7')]('/:id',auth[_0x4632('0x8')](),controller[_0x4632('0xb')]);router['get']('/:id/messages',auth[_0x4632('0x8')](),controller[_0x4632('0xc')]);router[_0x4632('0x7')](_0x4632('0xd'),auth[_0x4632('0x8')](),controller[_0x4632('0xe')]);router[_0x4632('0xf')]('/',auth[_0x4632('0x8')](),controller['create']);router[_0x4632('0xf')]('/:id/messages',auth[_0x4632('0x8')](),controller[_0x4632('0x10')]);router[_0x4632('0xf')](_0x4632('0x11'),auth['isAuthenticated'](),interaction[_0x4632('0x12')](_0x4632('0x13'),_0x4632('0x14')),controller[_0x4632('0x15')]);router[_0x4632('0x16')]('/:id',auth['isAuthenticated'](),interaction[_0x4632('0x12')](_0x4632('0x13'),_0x4632('0x17')),controller[_0x4632('0x18')]);router['delete'](_0x4632('0x19'),auth[_0x4632('0x8')](),interaction[_0x4632('0x12')]('sms',_0x4632('0x1a')),controller[_0x4632('0x1b')]);router['delete']('/:id/tags',auth[_0x4632('0x8')](),controller[_0x4632('0x1c')]);module[_0x4632('0x1d')]=router;
\ No newline at end of file
+var _0x7916=['smsinteraction:update','update','sms','destroy','delete','/:id/tags','removeTags','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','tracked','smsinteraction:addtags','put','/:id'];(function(_0x12d44c,_0xf11296){var _0x4fde20=function(_0x3c1ad6){while(--_0x3c1ad6){_0x12d44c['push'](_0x12d44c['shift']());}};_0x4fde20(++_0xf11296);}(_0x7916,0x128));var _0x6791=function(_0x51a9f6,_0x38992e){_0x51a9f6=_0x51a9f6-0x0;var _0x164641=_0x7916[_0x51a9f6];return _0x164641;};'use strict';var multer=require(_0x6791('0x0'));var util=require('util');var path=require(_0x6791('0x1'));var timeout=require(_0x6791('0x2'));var express=require('express');var router=express[_0x6791('0x3')]();var fs_extra=require(_0x6791('0x4'));var auth=require(_0x6791('0x5'));var interaction=require(_0x6791('0x6'));var config=require('../../config/environment');var controller=require(_0x6791('0x7'));router['get']('/',auth[_0x6791('0x8')](),controller[_0x6791('0x9')]);router['get'](_0x6791('0xa'),auth['isAuthenticated'](),controller[_0x6791('0xb')]);router['get']('/:id',auth[_0x6791('0x8')](),controller[_0x6791('0xc')]);router['get'](_0x6791('0xd'),auth[_0x6791('0x8')](),controller[_0x6791('0xe')]);router['get'](_0x6791('0xf'),auth[_0x6791('0x8')](),controller[_0x6791('0x10')]);router[_0x6791('0x11')]('/',auth[_0x6791('0x8')](),controller[_0x6791('0x12')]);router[_0x6791('0x11')](_0x6791('0xd'),auth[_0x6791('0x8')](),controller[_0x6791('0x13')]);router[_0x6791('0x11')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x6791('0x14')]('sms',_0x6791('0x15')),controller['addTags']);router[_0x6791('0x16')](_0x6791('0x17'),auth['isAuthenticated'](),interaction[_0x6791('0x14')]('sms',_0x6791('0x18')),controller[_0x6791('0x19')]);router['delete'](_0x6791('0x17'),auth[_0x6791('0x8')](),interaction['tracked'](_0x6791('0x1a'),'smsinteraction:destroy'),controller[_0x6791('0x1b')]);router[_0x6791('0x1c')](_0x6791('0x1d'),auth[_0x6791('0x8')](),controller[_0x6791('0x1e')]);module[_0x6791('0x1f')]=router;
\ No newline at end of file
index fa1f8ba..5727ff5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5292=['ENUM','out','sequelize','moment','BOOLEAN','STRING','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5292,0xf7));var _0x2529=function(_0x1a13b1,_0x4d1d25){_0x1a13b1=_0x1a13b1-0x0;var _0x395e05=_0x5292[_0x1a13b1];return _0x395e05;};'use strict';var Sequelize=require(_0x2529('0x0'));var moment=require(_0x2529('0x1'));module['exports']={'closed':{'type':Sequelize[_0x2529('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x2529('0x3')]},'secondDisposition':{'type':Sequelize[_0x2529('0x3')]},'thirdDisposition':{'type':Sequelize[_0x2529('0x3')]},'note':{'type':Sequelize[_0x2529('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x2529('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x2529('0x5')]('in',_0x2529('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xbea5=['DATE','STRING','out','sequelize','moment','BOOLEAN'];(function(_0x31c74a,_0x7a50c1){var _0x170048=function(_0x57fa00){while(--_0x57fa00){_0x31c74a['push'](_0x31c74a['shift']());}};_0x170048(++_0x7a50c1);}(_0xbea5,0x177));var _0x5bea=function(_0x5a7f64,_0x347d57){_0x5a7f64=_0x5a7f64-0x0;var _0x3d30f1=_0xbea5[_0x5a7f64];return _0x3d30f1;};'use strict';var Sequelize=require(_0x5bea('0x0'));var moment=require(_0x5bea('0x1'));module['exports']={'closed':{'type':Sequelize[_0x5bea('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5bea('0x3')]},'disposition':{'type':Sequelize[_0x5bea('0x4')]},'secondDisposition':{'type':Sequelize[_0x5bea('0x4')]},'thirdDisposition':{'type':Sequelize[_0x5bea('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x5bea('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x5bea('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x5bea('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 1dc5c8c..d521e9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4cc=['transcript-','.pdf','log','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','map','fullname','Tags','TagIds','split','forEach','push','SmsInteraction','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','field','from','tools_tags','select','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','sms_accounts','sms_messages','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','value','having','`\x20=\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','type','buildExpression','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','$gte','parse','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','i.SmsAccountId\x20IS\x20NOT\x20NULL','agent','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','SmsInteractionId','all','catch','show','merge','options','create','update','body','describe','addMessage','params','ids','omit','getMessages','findOne','SmsMessage','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','findAll','addTags','setTags','spread','color','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','User','CmContact','firstName','Messages','createdAt','secret','SmsAccount','Account','Owner','Sms','N.A.','closed','disposition','direction','out','lastName','renderFile','downloadInteraction.ejs'];(function(_0x26f273,_0x3dfa89){var _0x27d38b=function(_0x509c97){while(--_0x509c97){_0x26f273['push'](_0x26f273['shift']());}};_0x27d38b(++_0x3dfa89);}(_0xa4cc,0xed));var _0xca4c=function(_0x5a225d,_0x50de4f){_0x5a225d=_0x5a225d-0x0;var _0x3b8bd2=_0xa4cc[_0x5a225d];return _0x3b8bd2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca4c('0x0'));var zipdir=require(_0xca4c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xca4c('0x2'));var moment=require(_0xca4c('0x3'));var BPromise=require(_0xca4c('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xca4c('0x5'));var sox=require(_0xca4c('0x6'));var csv=require(_0xca4c('0x7'));var ejs=require(_0xca4c('0x8'));var fs=require('fs');var fs_extra=require(_0xca4c('0x9'));var _=require(_0xca4c('0xa'));var squel=require(_0xca4c('0xb'));var crypto=require('crypto');var jsforce=require(_0xca4c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xca4c('0x7'));var querystring=require(_0xca4c('0xd'));var Papa=require(_0xca4c('0xe'));var Redis=require(_0xca4c('0xf'));var authService=require(_0xca4c('0x10'));var qs=require(_0xca4c('0x11'));var as=require(_0xca4c('0x12'));var pdf=require(_0xca4c('0x13'));var hardwareService=require(_0xca4c('0x14'));var logger=require(_0xca4c('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xca4c('0x16'));var db=require(_0xca4c('0x17'))['db'];config[_0xca4c('0x18')]=_[_0xca4c('0x19')](config[_0xca4c('0x18')],{'host':_0xca4c('0x1a'),'port':0x18eb});var socket=require(_0xca4c('0x1b'))(new Redis(config[_0xca4c('0x18')]));require('./smsInteraction.socket')[_0xca4c('0x1c')](socket);function respondWithStatusCode(_0xdec45f,_0xd1a692){_0xd1a692=_0xd1a692||0xcc;return function(_0x1c6aee){if(_0x1c6aee){return _0xdec45f[_0xca4c('0x1d')](_0xd1a692);}return _0xdec45f[_0xca4c('0x1e')](_0xd1a692)[_0xca4c('0x1f')]();};}function respondWithResult(_0x5d04cf,_0x3ac47d){_0x3ac47d=_0x3ac47d||0xc8;return function(_0x1ba628){if(_0x1ba628){return _0x5d04cf[_0xca4c('0x1e')](_0x3ac47d)['json'](_0x1ba628);}};}function respondWithFilteredResult(_0x493be5,_0x261068){return function(_0x277dbf){if(_0x277dbf){var _0x19f814=typeof _0x261068[_0xca4c('0x20')]===_0xca4c('0x21')&&typeof _0x261068[_0xca4c('0x22')]===_0xca4c('0x21');var _0x39aa32=_0x277dbf[_0xca4c('0x23')];var _0x58a63d=_0x19f814?0x0:_0x261068['offset'];var _0x454be0=_0x19f814?_0x277dbf[_0xca4c('0x23')]:_0x261068[_0xca4c('0x20')]+_0x261068[_0xca4c('0x22')];var _0x3afdb2;if(_0x454be0>=_0x39aa32){_0x454be0=_0x39aa32;_0x3afdb2=0xc8;}else{_0x3afdb2=0xce;}_0x493be5[_0xca4c('0x1e')](_0x3afdb2);return _0x493be5[_0xca4c('0x24')](_0xca4c('0x25'),_0x58a63d+'-'+_0x454be0+'/'+_0x39aa32)[_0xca4c('0x26')](_0x277dbf);}return null;};}function patchUpdates(_0x43d339){return function(_0x4b1c6c){try{jsonpatch[_0xca4c('0x27')](_0x4b1c6c,_0x43d339,!![]);}catch(_0x7e41c8){return BPromise[_0xca4c('0x28')](_0x7e41c8);}return _0x4b1c6c[_0xca4c('0x29')]();};}function saveUpdates(_0x45cf72,_0x5285c8){return function(_0x463414){if(_0x463414){return _0x463414['update'](_0x45cf72)[_0xca4c('0x2a')](function(_0x506190){return _0x506190;});}return null;};}function removeEntity(_0x139207,_0x4a1f81){return function(_0x1947a0){if(_0x1947a0){return _0x1947a0[_0xca4c('0x2b')]()[_0xca4c('0x2a')](function(){_0x139207['status'](0xcc)[_0xca4c('0x1f')]();});}};}function handleEntityNotFound(_0x32a04d,_0x189815){return function(_0xfbd557){if(!_0xfbd557){_0x32a04d[_0xca4c('0x1d')](0x194);}return _0xfbd557;};}function handleError(_0xf4db43,_0x24a7e7){_0x24a7e7=_0x24a7e7||0x1f4;return function(_0x451db2){logger[_0xca4c('0x2c')](_0x451db2[_0xca4c('0x2d')]);if(_0x451db2[_0xca4c('0x2e')]){delete _0x451db2[_0xca4c('0x2e')];}_0xf4db43[_0xca4c('0x1e')](_0x24a7e7)[_0xca4c('0x2f')](_0x451db2);};}function getInteractionUsers(_0x315cee,_0x4cb8ac){return new BPromise(function(_0x29c188,_0x3e946b){try{if(_0x4cb8ac[_0x315cee['id']]){_0x315cee['Users']=_[_0xca4c('0x30')](_0x4cb8ac[_0x315cee['id']],function(_0x19efef){return{'id':_0x19efef['id'],'fullname':_0x19efef[_0xca4c('0x31')]};});}}catch(_0x3f4fd9){_0x3e946b(_0x3f4fd9);}_0x29c188(_0x315cee);});}function getInteractionTags(_0x23b4a1,_0x5f31b2){return new BPromise(function(_0x53070c,_0x4d1ba4){try{if(_0x23b4a1['TagIds']){_0x23b4a1[_0xca4c('0x32')]=[];_0x23b4a1[_0xca4c('0x33')][_0xca4c('0x34')](',')[_0xca4c('0x35')](function(_0x5dddc2){_0x23b4a1[_0xca4c('0x32')][_0xca4c('0x36')](_0x5f31b2[_0x5dddc2]);});}delete _0x23b4a1['TagIds'];}catch(_0x1c7244){_0x4d1ba4(_0x1c7244);}_0x53070c(_0x23b4a1);});}function updateSmsInteraction(_0xaed84a,_0x336df9,_0x1e1732){return new BPromise(function(_0x4232f9,_0x4040c1){return getInteractionUsers(_0xaed84a,_0x1e1732)[_0xca4c('0x2a')](function(_0x1b65f3){return getInteractionTags(_0x1b65f3,_0x336df9);})[_0xca4c('0x2a')](function(_0x25da69){_0x4232f9(_0x25da69);})['catch'](function(_0x129f88){_0x4040c1(_0x129f88);});});}exports['index']=function(_0x342c28,_0x340c64){var _0x467b78={},_0x284e7e={},_0x59dd2c={'count':0x0,'rows':[]};var _0xeb93ac=_[_0xca4c('0x30')](db[_0xca4c('0x37')][_0xca4c('0x38')],function(_0x515a84){return{'name':_0x515a84[_0xca4c('0x39')],'type':_0x515a84['type'][_0xca4c('0x3a')]};});_0x284e7e[_0xca4c('0x3b')]=_[_0xca4c('0x30')](_0xeb93ac,_0xca4c('0x2e'));_0x284e7e['query']=_[_0xca4c('0x3c')](_0x342c28[_0xca4c('0x3d')]);_0x284e7e[_0xca4c('0x3e')]=_[_0xca4c('0x3f')](_0x284e7e[_0xca4c('0x3b')],_0x284e7e[_0xca4c('0x3d')]);_0x467b78[_0xca4c('0x40')]=_[_0xca4c('0x3f')](_0x284e7e[_0xca4c('0x3b')],qs[_0xca4c('0x41')](_0x342c28[_0xca4c('0x3d')][_0xca4c('0x41')]));_0x467b78['attributes']=_0x467b78['attributes'][_0xca4c('0x42')]?_0x467b78[_0xca4c('0x40')]:_0x284e7e['model'];if(!_0x342c28[_0xca4c('0x3d')][_0xca4c('0x43')](_0xca4c('0x44'))){_0x467b78['limit']=qs['limit'](_0x342c28['query']['limit']);_0x467b78[_0xca4c('0x20')]=qs[_0xca4c('0x20')](_0x342c28[_0xca4c('0x3d')][_0xca4c('0x20')]);}_0x467b78[_0xca4c('0x45')]=qs['sort'](_0x342c28[_0xca4c('0x3d')][_0xca4c('0x46')]);_0x467b78[_0xca4c('0x47')]=qs['filters'](_[_0xca4c('0x48')](_0x342c28[_0xca4c('0x3d')],_0x284e7e[_0xca4c('0x3e')]),_0xeb93ac);var _0x2016b7=[];var _0x5e4110=squel['select']()[_0xca4c('0x49')]('id')[_0xca4c('0x49')]('name')['field']('color')[_0xca4c('0x4a')](_0xca4c('0x4b'));var _0x28f77b=squel[_0xca4c('0x4c')]()[_0xca4c('0x49')](_0xca4c('0x4d'))[_0xca4c('0x49')](_0xca4c('0x4e'))[_0xca4c('0x49')](_0xca4c('0x4f'))['from'](_0xca4c('0x50'),'ui')[_0xca4c('0x51')]('users','u',_0xca4c('0x52'));var _0x4ac49f=squel[_0xca4c('0x4c')]()[_0xca4c('0x4a')]('sms_interactions','i')[_0xca4c('0x51')](_0xca4c('0x53'),'c',_0xca4c('0x54'))[_0xca4c('0x51')](_0xca4c('0x55'),'o',_0xca4c('0x56'))['left_join'](_0xca4c('0x57'),'a','a.id\x20=\x20i.SmsAccountId')['left_join'](_0xca4c('0x58'),'me','me.SmsInteractionId\x20=\x20i.id')[_0xca4c('0x51')]('sms_interaction_has_tags','it',_0xca4c('0x59'))[_0xca4c('0x51')](_0xca4c('0x4b'),'t',_0xca4c('0x5a'));var _0x1c609a=squel[_0xca4c('0x5b')]();var _0x1723d1=[];var _0x5c72bb=squel[_0xca4c('0x5b')]();var _0x2e33ab;if(_0x342c28['query']['search']){_0x2e33ab=as[_0xca4c('0x5c')](_0x342c28[_0xca4c('0x3d')][_0xca4c('0x5d')]);var _0x5426c2=_0x2e33ab[_0xca4c('0x5e')];for(var _0xa32c56=0x0;_0xa32c56<_0x2e33ab['conditions'][_0xca4c('0x42')];_0xa32c56++){var _0x32dc15=_0x2e33ab[_0xca4c('0x5f')][_0xa32c56];var _0x4447db='i';var _0x2bd313=_[_0xca4c('0x60')](_0xeb93ac,[_0xca4c('0x2e'),_0x32dc15[_0xca4c('0x49')]]);if(!_0x2bd313){switch(_0x32dc15['field']){case'unreadMessages':if(_0x32dc15[_0xca4c('0x61')]==0x1){_0x4ac49f[_0xca4c('0x62')]('`'+_0x32dc15[_0xca4c('0x49')]+_0xca4c('0x63'));}else{_0x4ac49f[_0xca4c('0x62')]('`'+_0x32dc15[_0xca4c('0x49')]+'`\x20>\x200');}break;case _0xca4c('0x64'):if(_0x32dc15[_0xca4c('0x65')]==='$substring'){if(_0x32dc15[_0xca4c('0x61')]['split']('\x20')[_0xca4c('0x42')]>0x1){_0x1c609a[_0x5426c2](_0xca4c('0x66'),qs['getFullTextValue'](_0x32dc15[_0xca4c('0x61')]),null);}else{var _0x19c71d='%'+_0x32dc15[_0xca4c('0x61')]+'%';_0x1c609a[_0x5426c2]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x19c71d,_0x19c71d,_0x19c71d);}}else{_0x2bd313=_['find'](_0xeb93ac,[_0xca4c('0x2e'),_0xca4c('0x67')]);_0x32dc15[_0xca4c('0x49')]=_0xca4c('0x67');_0x1b819d=as['buildExpression'](_0x4447db,_0x2bd313['type'],_0x32dc15);_0x1c609a[_0x5426c2](_0x1b819d[_0xca4c('0x68')],_0x1b819d['value'][_0xca4c('0x69')],_0x1b819d[_0xca4c('0x61')][_0xca4c('0x1f')]);}break;case _0xca4c('0x6a'):var _0x119854=_0x32dc15[_0xca4c('0x61')][_0xca4c('0x34')](',')['map'](function(_0x14a85d){return Number(_0x14a85d);});_0x119854[_0xca4c('0x35')](function(_0x223191){_0x5c72bb['or'](_0xca4c('0x6b'),'%,'+_0x223191+',%');});_0x1723d1=_[_0xca4c('0x6c')](_0x1723d1,_0x119854);break;case'User':if(_0x32dc15[_0xca4c('0x65')]===_0xca4c('0x6d')){_0x1c609a[_0x5426c2](_0xca4c('0x6e'),'%'+_0x32dc15[_0xca4c('0x61')]+'%',null);}else{_0x2bd313=_[_0xca4c('0x60')](_0xeb93ac,[_0xca4c('0x2e'),_0xca4c('0x6f')]);_0x32dc15['field']=_0xca4c('0x6f');_0x1b819d=as['buildExpression'](_0x4447db,_0x2bd313[_0xca4c('0x70')],_0x32dc15);_0x1c609a[_0x5426c2](_0x1b819d['text'],_0x1b819d[_0xca4c('0x61')][_0xca4c('0x69')],_0x1b819d['value'][_0xca4c('0x1f')]);}break;case'body':_0x1b819d=as['buildExpression']('me',null,_0x32dc15);_0x1c609a[_0x5426c2](_0x1b819d[_0xca4c('0x68')],_0x1b819d[_0xca4c('0x61')][_0xca4c('0x69')],_0x1b819d[_0xca4c('0x61')][_0xca4c('0x1f')]);break;}}else{var _0x1b819d=as[_0xca4c('0x71')](_0x4447db,_0x2bd313[_0xca4c('0x70')],_0x32dc15);_0x1c609a[_0x5426c2](_0x1b819d[_0xca4c('0x68')],_0x1b819d[_0xca4c('0x61')]['start'],_0x1b819d['value'][_0xca4c('0x1f')]);}}}else{var _0x3a0f39=_(_0x342c28[_0xca4c('0x3d')])[_0xca4c('0x3c')]()[_0xca4c('0x30')](function(_0x2be28e){return _[_0xca4c('0x72')](_0xeb93ac,[_0xca4c('0x2e'),_0x2be28e])?_0x2be28e:undefined;})[_0xca4c('0x73')]()[_0xca4c('0x61')]();if(!_[_0xca4c('0x74')](_0x3a0f39)){_0x3a0f39[_0xca4c('0x35')](function(_0x3b0d26){if(_0x3b0d26===_0xca4c('0x75')){_0x4ac49f['where'](_0xca4c('0x76'),[]['concat'](_0x342c28['query'][_0x3b0d26]));}else if(_0x3b0d26==='createdAt'){var _0x1311ff=JSON['parse'](_0x342c28[_0xca4c('0x3d')][_0x3b0d26])[_0xca4c('0x77')];var _0x51f67e=JSON[_0xca4c('0x78')](_0x342c28[_0xca4c('0x3d')][_0x3b0d26])['$lte'];_0x4ac49f[_0xca4c('0x47')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1311ff,_0x51f67e);}else{if(_0x342c28[_0xca4c('0x3d')][_0x3b0d26]===_0xca4c('0x79')){_0x4ac49f['where']('i.'+_0x3b0d26+_0xca4c('0x7a'));}else{_0x4ac49f[_0xca4c('0x47')]('i.'+_0x3b0d26+'\x20=\x20?',_0x342c28[_0xca4c('0x3d')][_0x3b0d26]);}}});}if(_0x342c28[_0xca4c('0x3d')][_0xca4c('0x7b')]){if(_0x342c28[_0xca4c('0x3d')][_0xca4c('0x7b')]==0x1){_0x4ac49f[_0xca4c('0x62')](_0xca4c('0x7c'));}else{_0x4ac49f[_0xca4c('0x62')](_0xca4c('0x7d'));}}if(_0x342c28['query'][_0xca4c('0x7e')]){_0x1723d1=_[_0xca4c('0x7f')](_0x342c28[_0xca4c('0x3d')][_0xca4c('0x7e')])?_0x342c28['query']['tag']:new Array(_0x342c28[_0xca4c('0x3d')]['tag']);_0x1723d1['forEach'](function(_0x169432){_0x5c72bb['or'](_0xca4c('0x6b'),'%,'+_0x169432+',%');});}if(_0x342c28[_0xca4c('0x3d')][_0xca4c('0x80')]){var _0x283f01=_0x342c28['query']['filter'][_0xca4c('0x81')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x283f01)){_0x1c609a['or']('i.id\x20LIKE\x20?',_0x283f01+'%')['or'](_0xca4c('0x82'),_0x283f01+'%');}else{_0x1c609a['or'](_0xca4c('0x83'),qs[_0xca4c('0x84')](_0x283f01))['or'](_0xca4c('0x85'),_0x283f01+'%');}}}_0x4ac49f[_0xca4c('0x47')](_0x1c609a);_0x4ac49f['group']('i.id');var _0x4d1e09={'type':db[_0xca4c('0x86')][_0xca4c('0x87')][_0xca4c('0x88')],'raw':!![]};var _0x4328f1=_0x4ac49f[_0xca4c('0x89')]();_0x4328f1[_0xca4c('0x49')](_0xca4c('0x8a'));_0x4328f1[_0xca4c('0x49')](_0xca4c('0x8b'),_0xca4c('0x8c'));if(_0x467b78[_0xca4c('0x45')]){_0x467b78['order'][_0xca4c('0x35')](function(_0x55f7bd){var _0x838133=_0x55f7bd[0x0]===_0xca4c('0x8d')?_0x55f7bd[0x0]:'i.'+_0x55f7bd[0x0];_0x4ac49f[_0xca4c('0x45')](_0x838133,_0x55f7bd[0x1]===_0xca4c('0x8e')?![]:!![]);});}if(!_['isEmpty'](_0x1723d1)){_0x4ac49f[_0xca4c('0x62')](_0x5c72bb);_0x4328f1[_0xca4c('0x47')]('t.id\x20IN\x20?',_0x1723d1);}BPromise['resolve']()[_0xca4c('0x2a')](function(){if(!_0x2e33ab){if(_0x342c28[_0xca4c('0x3d')]['SmsAccountId'])return;_0x4328f1[_0xca4c('0x47')](_0xca4c('0x8f'));_0x4ac49f[_0xca4c('0x47')](_0xca4c('0x8f'));return;}if(_0x342c28['user']['role']!==_0xca4c('0x90'))return;return _0x342c28[_0xca4c('0x91')][_0xca4c('0x92')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2aaa0c){if(_[_0xca4c('0x74')](_0x2aaa0c)){_0x4328f1[_0xca4c('0x47')](_0xca4c('0x93'));_0x4ac49f[_0xca4c('0x47')](_0xca4c('0x93'));}else{_0x4328f1[_0xca4c('0x47')](_0xca4c('0x76'),_[_0xca4c('0x30')](_0x2aaa0c,'id'));_0x4ac49f['where'](_0xca4c('0x76'),_[_0xca4c('0x30')](_0x2aaa0c,'id'));}});})['then'](function(){if(_0x342c28[_0xca4c('0x91')]['role']===_0xca4c('0x90')&&!_0x2e33ab&&!_0x342c28['query'][_0xca4c('0x75')])return[];return db[_0xca4c('0x94')][_0xca4c('0x3d')](_0x4328f1[_0xca4c('0x95')](),_0x4d1e09);})[_0xca4c('0x2a')](function(_0x9217ea){_0x59dd2c[_0xca4c('0x23')]=_0x9217ea[_0xca4c('0x42')];if(_0x59dd2c[_0xca4c('0x23')]===0x0)return[];return db[_0xca4c('0x94')]['query'](_0x5e4110[_0xca4c('0x95')](),_0x4d1e09)[_0xca4c('0x2a')](function(_0x45a488){_0x2016b7=_[_0xca4c('0x96')](_0x45a488,'id');_0x4d1e09=_['merge'](_0x4d1e09,{'model':db[_0xca4c('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x342c28[_0xca4c('0x3d')][_0xca4c('0x41')]){_0x467b78['attributes'][_0xca4c('0x35')](function(_0xea649b){_0x4ac49f[_0xca4c('0x49')]('i.'+_0xea649b);});}else{_0x4ac49f[_0xca4c('0x49')](_0xca4c('0x8b'),'unreadMessages');_0x4ac49f[_0xca4c('0x49')](_0xca4c('0x97'),_0xca4c('0x98'));_0x4ac49f[_0xca4c('0x49')](_0xca4c('0x99'),_0xca4c('0x9a'));_0x4ac49f[_0xca4c('0x49')](_0xca4c('0x9b'),'contactName');_0x4ac49f[_0xca4c('0x49')](_0xca4c('0x9c'));_0x4ac49f[_0xca4c('0x49')](_0xca4c('0x9d'),_0xca4c('0x9e'));_0x4ac49f[_0xca4c('0x49')]('c.lastName',_0xca4c('0x9f'));_0x4ac49f[_0xca4c('0x49')](_0xca4c('0xa0'),_0xca4c('0xa1'));_0x4ac49f[_0xca4c('0x49')](_0xca4c('0xa2'),_0xca4c('0xa3'));_0x4ac49f['field']('c.mobile','Contact.mobile');_0x4ac49f[_0xca4c('0x49')](_0xca4c('0xa4'),_0xca4c('0xa5'));_0x4ac49f['field'](_0xca4c('0xa6'),_0xca4c('0xa7'));_0x4ac49f[_0xca4c('0x49')](_0xca4c('0xa8'),_0xca4c('0xa9'));_0x4ac49f[_0xca4c('0x49')](_0xca4c('0xaa'),_0xca4c('0x33'));}if(_0x467b78[_0xca4c('0x22')])_0x4ac49f[_0xca4c('0x22')](_0x467b78['limit']);if(_0x467b78[_0xca4c('0x20')])_0x4ac49f[_0xca4c('0x20')](_0x467b78[_0xca4c('0x20')]);return db[_0xca4c('0x94')]['query'](_0x4ac49f[_0xca4c('0x95')](),_0x4d1e09);})[_0xca4c('0x2a')](function(_0x3ba66d){if(_0x3ba66d['length']>0x0)_0x28f77b[_0xca4c('0x47')](_0xca4c('0xab'),_[_0xca4c('0x30')](_0x3ba66d,'id'));return db['sequelize']['query'](_0x28f77b['toString'](),_0x4d1e09)[_0xca4c('0x2a')](function(_0x1ae1c2){var _0x5a5cfd=_['groupBy'](_0x1ae1c2,_0xca4c('0xac'));var _0x423447=[];_0x3ba66d['forEach'](function(_0x13f125){_0x423447['push'](updateSmsInteraction(_0x13f125,_0x2016b7,_0x5a5cfd));});return BPromise[_0xca4c('0xad')](_0x423447);});});})[_0xca4c('0x2a')](function(_0x4577fb){_0x59dd2c['rows']=_0x4577fb;return _0x59dd2c;})['then'](respondWithFilteredResult(_0x340c64,_0x467b78))[_0xca4c('0xae')](handleError(_0x340c64,null));};exports[_0xca4c('0xaf')]=function(_0x2fd802,_0x2d4e23){var _0x681d17={'raw':![],'where':{'id':_0x2fd802['params']['id']}},_0x520e8a={};_0x520e8a[_0xca4c('0x3b')]=_[_0xca4c('0x3c')](db['SmsInteraction'][_0xca4c('0x38')]);_0x520e8a['query']=_[_0xca4c('0x3c')](_0x2fd802[_0xca4c('0x3d')]);_0x520e8a[_0xca4c('0x3e')]=_[_0xca4c('0x3f')](_0x520e8a[_0xca4c('0x3b')],_0x520e8a[_0xca4c('0x3d')]);_0x681d17[_0xca4c('0x40')]=_['intersection'](_0x520e8a[_0xca4c('0x3b')],qs[_0xca4c('0x41')](_0x2fd802[_0xca4c('0x3d')]['fields']));_0x681d17[_0xca4c('0x40')]=_0x681d17[_0xca4c('0x40')][_0xca4c('0x42')]?_0x681d17[_0xca4c('0x40')]:_0x520e8a[_0xca4c('0x3b')];if(_0x2fd802['query']['includeAll']){_0x681d17['include']=[{'all':!![]}];}_0x681d17=_[_0xca4c('0xb0')]({},_0x681d17,_0x2fd802[_0xca4c('0xb1')]);return db[_0xca4c('0x37')][_0xca4c('0x60')](_0x681d17)[_0xca4c('0x2a')](handleEntityNotFound(_0x2d4e23,null))[_0xca4c('0x2a')](respondWithResult(_0x2d4e23,null))[_0xca4c('0xae')](handleError(_0x2d4e23,null));};exports[_0xca4c('0xb2')]=function(_0x1efb80,_0x2bb9e9){return db[_0xca4c('0x37')]['create'](_0x1efb80['body'],{})[_0xca4c('0x2a')](respondWithResult(_0x2bb9e9,0xc9))[_0xca4c('0xae')](handleError(_0x2bb9e9,null));};exports[_0xca4c('0xb3')]=function(_0x1fc26c,_0x1d996d){if(_0x1fc26c[_0xca4c('0xb4')]['id']){delete _0x1fc26c['body']['id'];}return db[_0xca4c('0x37')][_0xca4c('0x60')]({'where':{'id':_0x1fc26c['params']['id']}})['then'](handleEntityNotFound(_0x1d996d,null))[_0xca4c('0x2a')](saveUpdates(_0x1fc26c[_0xca4c('0xb4')],null))[_0xca4c('0x2a')](respondWithResult(_0x1d996d,null))[_0xca4c('0xae')](handleError(_0x1d996d,null));};exports[_0xca4c('0x2b')]=function(_0x139272,_0x531b1b){return db[_0xca4c('0x37')][_0xca4c('0x60')]({'where':{'id':_0x139272['params']['id']}})[_0xca4c('0x2a')](handleEntityNotFound(_0x531b1b,null))[_0xca4c('0x2a')](removeEntity(_0x531b1b,null))[_0xca4c('0xae')](handleError(_0x531b1b,null));};exports[_0xca4c('0xb5')]=function(_0x46b9f3,_0x3f16d1){return db['SmsInteraction']['describe']()['then'](respondWithResult(_0x3f16d1,null))[_0xca4c('0xae')](handleError(_0x3f16d1,null));};exports[_0xca4c('0xb6')]=function(_0x1b3b10,_0x3f17a3,_0xb6a7e1){return db['SmsMessage'][_0xca4c('0x60')]({'where':{'id':_0x1b3b10[_0xca4c('0xb7')]['id']}})[_0xca4c('0x2a')](handleEntityNotFound(_0x3f17a3,null))[_0xca4c('0x2a')](function(_0x1d656a){if(_0x1d656a){return _0x1d656a[_0xca4c('0xb6')](_0x1b3b10[_0xca4c('0xb4')][_0xca4c('0xb8')],_[_0xca4c('0xb9')](_0x1b3b10[_0xca4c('0xb4')],['ids','id'])||{});}})[_0xca4c('0x2a')](respondWithResult(_0x3f17a3,null))[_0xca4c('0xae')](handleError(_0x3f17a3,null));};exports[_0xca4c('0xba')]=function(_0x16673f,_0x20d702,_0x2175a9){var _0x1a751a={'raw':![],'where':{}};var _0x1658fe={};var _0x42d061={'count':0x0,'rows':[]};return db[_0xca4c('0x37')][_0xca4c('0xbb')]({'where':{'id':_0x16673f[_0xca4c('0xb7')]['id']}})[_0xca4c('0x2a')](handleEntityNotFound(_0x20d702,null))[_0xca4c('0x2a')](function(_0x2d58b4){if(_0x2d58b4){_0x1658fe['model']=_[_0xca4c('0x3c')](db[_0xca4c('0xbc')][_0xca4c('0x38')]);_0x1658fe[_0xca4c('0x3d')]=_[_0xca4c('0x3c')](_0x16673f[_0xca4c('0x3d')]);_0x1658fe[_0xca4c('0x3e')]=_[_0xca4c('0x3f')](_0x1658fe[_0xca4c('0x3b')],_0x1658fe[_0xca4c('0x3d')]);_0x1a751a[_0xca4c('0x40')]=_[_0xca4c('0x3f')](_0x1658fe[_0xca4c('0x3b')],qs[_0xca4c('0x41')](_0x16673f[_0xca4c('0x3d')][_0xca4c('0x41')]));_0x1a751a[_0xca4c('0x40')]=_0x1a751a['attributes']['length']?_0x1a751a[_0xca4c('0x40')]:_0x1658fe[_0xca4c('0x3b')];if(!_0x16673f[_0xca4c('0x3d')][_0xca4c('0x43')](_0xca4c('0x44'))){_0x1a751a['limit']=qs[_0xca4c('0x22')](_0x16673f[_0xca4c('0x3d')][_0xca4c('0x22')]);_0x1a751a[_0xca4c('0x20')]=qs[_0xca4c('0x20')](_0x16673f[_0xca4c('0x3d')]['offset']);}_0x1a751a[_0xca4c('0x45')]=qs['sort'](_0x16673f[_0xca4c('0x3d')][_0xca4c('0x46')]);_0x1a751a[_0xca4c('0x47')]=qs[_0xca4c('0x3e')](_[_0xca4c('0x48')](_0x16673f[_0xca4c('0x3d')],_0x1658fe[_0xca4c('0x3e')]));_0x1a751a[_0xca4c('0x47')][_0xca4c('0xac')]=_0x2d58b4['id'];if(_0x16673f['query']['filter']){_0x1a751a['where']=_['merge'](_0x1a751a[_0xca4c('0x47')],{'$or':_[_0xca4c('0x30')](_0x1a751a['attributes'],function(_0x16d131){var _0x32910e={};_0x32910e[_0x16d131]={'$like':'%'+_0x16673f[_0xca4c('0x3d')][_0xca4c('0x80')]+'%'};return _0x32910e;})});}if(_0x16673f[_0xca4c('0x3d')][_0xca4c('0x77')]){var _0x28fcf1=_0x16673f[_0xca4c('0x3d')]['$gte'][_0xca4c('0x34')](',');var _0x5b86cd={};_0x5b86cd[_0x28fcf1[0x0]]={'$gte':moment(_0x28fcf1[0x1])[_0xca4c('0xbd')](_0xca4c('0xbe'))};_0x1a751a[_0xca4c('0x47')]=_[_0xca4c('0xb0')](_0x1a751a['where'],_0x5b86cd);}_0x1a751a=_['merge']({},_0x1a751a,_0x16673f[_0xca4c('0xb1')]);return db[_0xca4c('0xbc')][_0xca4c('0x23')]({'where':_0x1a751a[_0xca4c('0x47')]})[_0xca4c('0x2a')](function(_0x3d5c26){_0x42d061['count']=_0x3d5c26;if(_0x16673f[_0xca4c('0x3d')][_0xca4c('0xbf')]){_0x1a751a[_0xca4c('0xc0')]=[{'all':!![]}];}return db[_0xca4c('0xbc')][_0xca4c('0xc1')](_0x1a751a);})[_0xca4c('0x2a')](function(_0x2fcaca){_0x42d061['rows']=_0x2fcaca;return _0x42d061;});}})[_0xca4c('0x2a')](respondWithFilteredResult(_0x20d702,_0x1a751a))[_0xca4c('0xae')](handleError(_0x20d702,null));};exports[_0xca4c('0xc2')]=function(_0x186129,_0x54bcc3,_0x7bdcc6){return db['SmsInteraction']['find']({'where':{'id':_0x186129[_0xca4c('0xb7')]['id']}})['then'](handleEntityNotFound(_0x54bcc3,null))[_0xca4c('0x2a')](function(_0x532a00){if(_0x532a00){return _0x532a00[_0xca4c('0xc3')](_0x186129[_0xca4c('0xb4')][_0xca4c('0xb8')],_[_0xca4c('0xb9')](_0x186129[_0xca4c('0xb4')],[_0xca4c('0xb8'),'id'])||{})[_0xca4c('0xc4')](function(){return db[_0xca4c('0x6a')][_0xca4c('0xc1')]({'attributes':['id',_0xca4c('0x2e'),_0xca4c('0xc5')],'where':{'id':_0x186129[_0xca4c('0xb4')][_0xca4c('0xb8')]}});})[_0xca4c('0x2a')](function(_0x3838db){socket['emit'](_0xca4c('0xc6'),{'id':Number(_0x186129[_0xca4c('0xb7')]['id']),'tags':_0x3838db||[]});return{'id':Number(_0x186129['params']['id']),'tags':_0x3838db||[]};});}})[_0xca4c('0x2a')](respondWithResult(_0x54bcc3,null))[_0xca4c('0xae')](handleError(_0x54bcc3,null));};exports[_0xca4c('0xc7')]=function(_0x2039e1,_0xbf46be,_0x1ffa8a){return db[_0xca4c('0x37')][_0xca4c('0x60')]({'where':{'id':_0x2039e1[_0xca4c('0xb7')]['id']}})[_0xca4c('0x2a')](handleEntityNotFound(_0xbf46be,null))[_0xca4c('0x2a')](function(_0x34d303){if(_0x34d303){return _0x34d303[_0xca4c('0xc7')](_0x2039e1['query'][_0xca4c('0xb8')]);}})[_0xca4c('0x2a')](respondWithStatusCode(_0xbf46be,null))['catch'](handleError(_0xbf46be,null));};exports[_0xca4c('0xc8')]=function(_0x4c522e,_0x350b7f){var _0x2dcd57=moment()[_0xca4c('0xc9')]()[_0xca4c('0x95')]();var _0x4b250d=path[_0xca4c('0xca')](config[_0xca4c('0xcb')],_0xca4c('0xcc'),_0xca4c('0xcd'),_0xca4c('0xce'));var _0x2579a7=path[_0xca4c('0xca')](config[_0xca4c('0xcb')],'server',_0xca4c('0xcd'),_0xca4c('0xcf'));var _0x50c271=path[_0xca4c('0xca')](_0x4b250d,_0x2dcd57);var _0x444607=util[_0xca4c('0xbd')](_0xca4c('0xd0'),_0x4c522e[_0xca4c('0xb7')]['id'],_0x2dcd57);var _0x455f77=path[_0xca4c('0xca')](_0x4b250d,_0x444607);var _0x4b0724=[];_0x4b0724[_0xca4c('0x36')]({'model':db['User'],'as':_0xca4c('0xd1'),'attributes':['id',_0xca4c('0x31')],'raw':!![]});_0x4b0724[_0xca4c('0x36')]({'model':db[_0xca4c('0xd2')],'as':_0xca4c('0x64'),'attributes':['id',_0xca4c('0xd3'),'lastName'],'raw':!![]});var _0x4071aa=[{'model':db[_0xca4c('0xbc')],'as':_0xca4c('0xd4'),'attributes':['id',_0xca4c('0xb4'),_0xca4c('0xd5'),'direction',_0xca4c('0xd6'),_0xca4c('0x7b')],'include':_0x4b0724}];_0x4071aa['push']({'model':db[_0xca4c('0xd7')],'as':_0xca4c('0xd8'),'attributes':['id','name']});_0x4071aa[_0xca4c('0x36')]({'model':db[_0xca4c('0xd1')],'as':_0xca4c('0xd9'),'attributes':['id',_0xca4c('0x31')]});return db[_0xca4c('0x37')][_0xca4c('0x60')]({'where':{'id':_0x4c522e[_0xca4c('0xb7')]['id']},'include':_0x4071aa})[_0xca4c('0x2a')](handleEntityNotFound(_0x350b7f,null))[_0xca4c('0x2a')](function(_0x2402d1){if(_0x2402d1){var _0x2439df=_0x2402d1['get']({'plain':!![]});fs['mkdirSync'](_0x50c271);var _0x473654={'channel':_0xca4c('0xda'),'account':_0x2439df[_0xca4c('0xd8')][_0xca4c('0x2e')],'agent':_0x2439df[_0xca4c('0xd9')]?_0x2439df[_0xca4c('0xd9')]['fullname']:_0xca4c('0xdb'),'createdAt':moment(_0x2439df['createdAt'])[_0xca4c('0xbd')](_0xca4c('0xbe'))[_0xca4c('0x95')](),'closedAt':_0x2439df[_0xca4c('0xdc')]?moment(_0x2439df['closedAt'])[_0xca4c('0xbd')]('YYYY-MM-DD\x20HH:mm:ss')[_0xca4c('0x95')]():'','disposition':_0x2439df[_0xca4c('0xdd')],'messages':_(_0x2439df[_0xca4c('0xd4')])['filter']({'secret':![]})[_0xca4c('0x30')](function(_0x463826){return{'date':moment(_0x463826[_0xca4c('0xd5')])[_0xca4c('0xbd')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x463826[_0xca4c('0xde')]===_0xca4c('0xdf')?_0x463826[_0xca4c('0xd1')]?_0x463826['User'][_0xca4c('0x31')]:'System':_0x463826['Contact'][_0xca4c('0xd3')]+(_0x463826[_0xca4c('0x64')][_0xca4c('0xe0')]?'\x20'+_0x463826['Contact'][_0xca4c('0xe0')]:''),'body':_0x463826['body'],'direction':_0x463826['direction']===_0xca4c('0xdf')?'A':'C','secret':_0x463826[_0xca4c('0xd6')],'read':_0x463826[_0xca4c('0x7b')]};})[_0xca4c('0x61')]()};return ejs[_0xca4c('0xe1')](path['join'](config[_0xca4c('0xcb')],_0xca4c('0xcc'),'views',_0xca4c('0xe2')),{'interaction':_0x473654})[_0xca4c('0x2a')](function(_0x14a0ca){var _0x3762de=path[_0xca4c('0xca')](_0x50c271,_0xca4c('0xe3')+_0x2439df['id']+'-'+_0x2dcd57+_0xca4c('0xe4'));var _0x2d2616={'path':_0x3762de,'channel':_0xca4c('0xda'),'interactionId':_0x2439df['id']};return pdf['createPdfFromHTML'](_0x14a0ca,_0x2d2616);})[_0xca4c('0x2a')](function(){return new BPromise(function(_0x44a698,_0xd969fb){zipdir(_0x50c271,{'saveTo':_0x455f77},function(_0x12a7da,_0xe28066){if(_0x12a7da)return _0xd969fb(_0x12a7da);return _0x44a698(_0xe28066);});})[_0xca4c('0x2a')](function(){return new BPromise(function(_0x5c5358,_0x5875a3){rimraf(_0x50c271,function(_0x24a4e7){if(_0x24a4e7)_0x5875a3(_0x24a4e7);return _0x5c5358();});});})[_0xca4c('0x2a')](function(){return _0x350b7f[_0xca4c('0xc8')](_0x455f77,_0x444607,function(_0x41f6d1){if(_0x41f6d1){console[_0xca4c('0xe5')](_0xca4c('0xe6'),_0x41f6d1);}else{fs[_0xca4c('0xe7')](_0x455f77);}});});});}else{return _0x350b7f['sendStatus'](0xc8);}})[_0xca4c('0xae')](handleError(_0x350b7f,null));};
\ No newline at end of file
+var _0x2ba6=['error','stack','name','send','Users','map','fullname','TagIds','Tags','push','catch','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','select','field','color','tools_tags','u.id','u.fullname','ui.SmsInteractionId','from','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.SmsAccountId','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','expr','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\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','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','buildExpression','text','start','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','body','some','compact','isEmpty','SmsAccountId','where','i.SmsAccountId\x20IN\x20?','concat','createdAt','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','SmsInteractionId','all','show','params','SmsInteraction','includeAll','include','merge','options','create','destroy','describe','addMessage','SmsMessage','ids','omit','getMessages','hasOwnProperty','filter','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','spread','emit','removeTags','download','unix','join','root','server','files','tmp','attachments','Contact','firstName','lastName','Messages','direction','secret','SmsAccount','Account','get','mkdirSync','Sms','Owner','N.A.','closedAt','disposition','System','out','views','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','save','update','then'];(function(_0x12a87f,_0x2c18e4){var _0x2c5e04=function(_0x4d0aa6){while(--_0x4d0aa6){_0x12a87f['push'](_0x12a87f['shift']());}};_0x2c5e04(++_0x2c18e4);}(_0x2ba6,0x199));var _0x62ba=function(_0x8f3661,_0x26b9bb){_0x8f3661=_0x8f3661-0x0;var _0x32f28f=_0x2ba6[_0x8f3661];return _0x32f28f;};'use strict';var emlformat=require(_0x62ba('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x62ba('0x1'));var rp=require(_0x62ba('0x2'));var moment=require(_0x62ba('0x3'));var BPromise=require(_0x62ba('0x4'));var Mustache=require('mustache');var util=require(_0x62ba('0x5'));var path=require(_0x62ba('0x6'));var sox=require(_0x62ba('0x7'));var csv=require(_0x62ba('0x8'));var ejs=require(_0x62ba('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x62ba('0xa'));var crypto=require('crypto');var jsforce=require(_0x62ba('0xb'));var deskjs=require(_0x62ba('0xc'));var toCsv=require(_0x62ba('0x8'));var querystring=require(_0x62ba('0xd'));var Papa=require(_0x62ba('0xe'));var Redis=require('ioredis');var authService=require(_0x62ba('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x62ba('0x10'));var pdf=require(_0x62ba('0x11'));var hardwareService=require(_0x62ba('0x12'));var logger=require(_0x62ba('0x13'))(_0x62ba('0x14'));var utils=require(_0x62ba('0x15'));var config=require(_0x62ba('0x16'));var licenseUtil=require(_0x62ba('0x17'));var db=require(_0x62ba('0x18'))['db'];config[_0x62ba('0x19')]=_[_0x62ba('0x1a')](config[_0x62ba('0x19')],{'host':_0x62ba('0x1b'),'port':0x18eb});var socket=require(_0x62ba('0x1c'))(new Redis(config[_0x62ba('0x19')]));require(_0x62ba('0x1d'))[_0x62ba('0x1e')](socket);function respondWithStatusCode(_0x11f7b3,_0x592b9f){_0x592b9f=_0x592b9f||0xcc;return function(_0x1c670f){if(_0x1c670f){return _0x11f7b3[_0x62ba('0x1f')](_0x592b9f);}return _0x11f7b3[_0x62ba('0x20')](_0x592b9f)[_0x62ba('0x21')]();};}function respondWithResult(_0x364a67,_0x218965){_0x218965=_0x218965||0xc8;return function(_0x70e13){if(_0x70e13){return _0x364a67[_0x62ba('0x20')](_0x218965)[_0x62ba('0x22')](_0x70e13);}};}function respondWithFilteredResult(_0x21ce76,_0x5f407f){return function(_0x522eb4){if(_0x522eb4){var _0x52210f=typeof _0x5f407f[_0x62ba('0x23')]==='undefined'&&typeof _0x5f407f[_0x62ba('0x24')]===_0x62ba('0x25');var _0x476cb2=_0x522eb4[_0x62ba('0x26')];var _0x2b006b=_0x52210f?0x0:_0x5f407f[_0x62ba('0x23')];var _0x56725b=_0x52210f?_0x522eb4[_0x62ba('0x26')]:_0x5f407f['offset']+_0x5f407f[_0x62ba('0x24')];var _0x53d3b7;if(_0x56725b>=_0x476cb2){_0x56725b=_0x476cb2;_0x53d3b7=0xc8;}else{_0x53d3b7=0xce;}_0x21ce76['status'](_0x53d3b7);return _0x21ce76[_0x62ba('0x27')]('Content-Range',_0x2b006b+'-'+_0x56725b+'/'+_0x476cb2)[_0x62ba('0x22')](_0x522eb4);}return null;};}function patchUpdates(_0x1d4e29){return function(_0x49d5c6){try{jsonpatch['apply'](_0x49d5c6,_0x1d4e29,!![]);}catch(_0x235882){return BPromise['reject'](_0x235882);}return _0x49d5c6[_0x62ba('0x28')]();};}function saveUpdates(_0x4e5d2e,_0x1cc733){return function(_0x4c250b){if(_0x4c250b){return _0x4c250b[_0x62ba('0x29')](_0x4e5d2e)[_0x62ba('0x2a')](function(_0x1a9a56){return _0x1a9a56;});}return null;};}function removeEntity(_0x181436,_0x1b7dde){return function(_0x33e8e4){if(_0x33e8e4){return _0x33e8e4['destroy']()['then'](function(){_0x181436[_0x62ba('0x20')](0xcc)[_0x62ba('0x21')]();});}};}function handleEntityNotFound(_0x54c6ba,_0x36826d){return function(_0x30d214){if(!_0x30d214){_0x54c6ba[_0x62ba('0x1f')](0x194);}return _0x30d214;};}function handleError(_0x2bf493,_0x2915b7){_0x2915b7=_0x2915b7||0x1f4;return function(_0x2e5b87){logger[_0x62ba('0x2b')](_0x2e5b87[_0x62ba('0x2c')]);if(_0x2e5b87[_0x62ba('0x2d')]){delete _0x2e5b87[_0x62ba('0x2d')];}_0x2bf493['status'](_0x2915b7)[_0x62ba('0x2e')](_0x2e5b87);};}function getInteractionUsers(_0x49311a,_0x670084){return new BPromise(function(_0x368333,_0x5bf7a9){try{if(_0x670084[_0x49311a['id']]){_0x49311a[_0x62ba('0x2f')]=_[_0x62ba('0x30')](_0x670084[_0x49311a['id']],function(_0x40fc34){return{'id':_0x40fc34['id'],'fullname':_0x40fc34[_0x62ba('0x31')]};});}}catch(_0x1a524a){_0x5bf7a9(_0x1a524a);}_0x368333(_0x49311a);});}function getInteractionTags(_0x5c098c,_0x5397c8){return new BPromise(function(_0x3f581d,_0xedd897){try{if(_0x5c098c[_0x62ba('0x32')]){_0x5c098c['Tags']=[];_0x5c098c['TagIds']['split'](',')['forEach'](function(_0x308c31){_0x5c098c[_0x62ba('0x33')][_0x62ba('0x34')](_0x5397c8[_0x308c31]);});}delete _0x5c098c[_0x62ba('0x32')];}catch(_0x1f7599){_0xedd897(_0x1f7599);}_0x3f581d(_0x5c098c);});}function updateSmsInteraction(_0x3b7dcd,_0x508af2,_0x3694db){return new BPromise(function(_0x589647,_0x823a5f){return getInteractionUsers(_0x3b7dcd,_0x3694db)['then'](function(_0x38d9b9){return getInteractionTags(_0x38d9b9,_0x508af2);})['then'](function(_0x262b2c){_0x589647(_0x262b2c);})[_0x62ba('0x35')](function(_0x1f6e8c){_0x823a5f(_0x1f6e8c);});});}exports['index']=function(_0xf51b6b,_0x161ac8){var _0x126c98={},_0xe38c34={},_0x7f8038={'count':0x0,'rows':[]};var _0xc0f29b=_[_0x62ba('0x30')](db['SmsInteraction'][_0x62ba('0x36')],function(_0x4283c4){return{'name':_0x4283c4[_0x62ba('0x37')],'type':_0x4283c4[_0x62ba('0x38')][_0x62ba('0x39')]};});_0xe38c34[_0x62ba('0x3a')]=_['map'](_0xc0f29b,_0x62ba('0x2d'));_0xe38c34[_0x62ba('0x3b')]=_[_0x62ba('0x3c')](_0xf51b6b[_0x62ba('0x3b')]);_0xe38c34[_0x62ba('0x3d')]=_[_0x62ba('0x3e')](_0xe38c34[_0x62ba('0x3a')],_0xe38c34['query']);_0x126c98[_0x62ba('0x3f')]=_[_0x62ba('0x3e')](_0xe38c34[_0x62ba('0x3a')],qs[_0x62ba('0x40')](_0xf51b6b[_0x62ba('0x3b')][_0x62ba('0x40')]));_0x126c98[_0x62ba('0x3f')]=_0x126c98['attributes'][_0x62ba('0x41')]?_0x126c98[_0x62ba('0x3f')]:_0xe38c34[_0x62ba('0x3a')];if(!_0xf51b6b[_0x62ba('0x3b')]['hasOwnProperty'](_0x62ba('0x42'))){_0x126c98[_0x62ba('0x24')]=qs[_0x62ba('0x24')](_0xf51b6b[_0x62ba('0x3b')][_0x62ba('0x24')]);_0x126c98[_0x62ba('0x23')]=qs[_0x62ba('0x23')](_0xf51b6b[_0x62ba('0x3b')][_0x62ba('0x23')]);}_0x126c98[_0x62ba('0x43')]=qs[_0x62ba('0x44')](_0xf51b6b[_0x62ba('0x3b')][_0x62ba('0x44')]);_0x126c98['where']=qs[_0x62ba('0x3d')](_[_0x62ba('0x45')](_0xf51b6b[_0x62ba('0x3b')],_0xe38c34[_0x62ba('0x3d')]),_0xc0f29b);var _0x4f3dee=[];var _0x37c97a=squel[_0x62ba('0x46')]()[_0x62ba('0x47')]('id')['field']('name')['field'](_0x62ba('0x48'))['from'](_0x62ba('0x49'));var _0x1e1539=squel[_0x62ba('0x46')]()[_0x62ba('0x47')](_0x62ba('0x4a'))[_0x62ba('0x47')](_0x62ba('0x4b'))['field'](_0x62ba('0x4c'))[_0x62ba('0x4d')](_0x62ba('0x4e'),'ui')[_0x62ba('0x4f')](_0x62ba('0x50'),'u',_0x62ba('0x51'));var _0x3e78a2=squel['select']()[_0x62ba('0x4d')](_0x62ba('0x52'),'i')[_0x62ba('0x4f')](_0x62ba('0x53'),'c',_0x62ba('0x54'))['left_join'](_0x62ba('0x50'),'o',_0x62ba('0x55'))[_0x62ba('0x4f')]('sms_accounts','a',_0x62ba('0x56'))[_0x62ba('0x4f')]('sms_messages','me',_0x62ba('0x57'))[_0x62ba('0x4f')](_0x62ba('0x58'),'it',_0x62ba('0x59'))['left_join'](_0x62ba('0x49'),'t','t.id\x20=\x20it.TagId');var _0x285c61=squel['expr']();var _0x2ae52a=[];var _0x466d8c=squel[_0x62ba('0x5a')]();var _0xb22eec;if(_0xf51b6b['query']['search']){_0xb22eec=as[_0x62ba('0x5b')](_0xf51b6b[_0x62ba('0x3b')]['search']);var _0x9db8ed=_0xb22eec[_0x62ba('0x5c')];for(var _0x5cd152=0x0;_0x5cd152<_0xb22eec[_0x62ba('0x5d')][_0x62ba('0x41')];_0x5cd152++){var _0x429b46=_0xb22eec[_0x62ba('0x5d')][_0x5cd152];var _0x222a87='i';var _0x34a469=_['find'](_0xc0f29b,[_0x62ba('0x2d'),_0x429b46[_0x62ba('0x47')]]);if(!_0x34a469){switch(_0x429b46[_0x62ba('0x47')]){case _0x62ba('0x5e'):if(_0x429b46[_0x62ba('0x5f')]==0x1){_0x3e78a2[_0x62ba('0x60')]('`'+_0x429b46['field']+'`\x20=\x200');}else{_0x3e78a2['having']('`'+_0x429b46[_0x62ba('0x47')]+_0x62ba('0x61'));}break;case'Contact':if(_0x429b46[_0x62ba('0x62')]===_0x62ba('0x63')){if(_0x429b46[_0x62ba('0x5f')][_0x62ba('0x64')]('\x20')['length']>0x1){_0x285c61[_0x9db8ed](_0x62ba('0x65'),qs[_0x62ba('0x66')](_0x429b46['value']),null);}else{var _0x450b99='%'+_0x429b46[_0x62ba('0x5f')]+'%';_0x285c61[_0x9db8ed](_0x62ba('0x67'),_0x450b99,_0x450b99,_0x450b99);}}else{_0x34a469=_['find'](_0xc0f29b,[_0x62ba('0x2d'),'ContactId']);_0x429b46[_0x62ba('0x47')]='ContactId';_0x395687=as[_0x62ba('0x68')](_0x222a87,_0x34a469[_0x62ba('0x38')],_0x429b46);_0x285c61[_0x9db8ed](_0x395687[_0x62ba('0x69')],_0x395687['value'][_0x62ba('0x6a')],_0x395687[_0x62ba('0x5f')][_0x62ba('0x21')]);}break;case'Tag':var _0x232eb8=_0x429b46[_0x62ba('0x5f')][_0x62ba('0x64')](',')['map'](function(_0x23fb19){return Number(_0x23fb19);});_0x232eb8[_0x62ba('0x6b')](function(_0x5b8184){_0x466d8c['or'](_0x62ba('0x6c'),'%,'+_0x5b8184+',%');});_0x2ae52a=_['union'](_0x2ae52a,_0x232eb8);break;case _0x62ba('0x6d'):if(_0x429b46['operator']===_0x62ba('0x63')){_0x285c61[_0x9db8ed](_0x62ba('0x6e'),'%'+_0x429b46['value']+'%',null);}else{_0x34a469=_[_0x62ba('0x6f')](_0xc0f29b,[_0x62ba('0x2d'),'UserId']);_0x429b46[_0x62ba('0x47')]=_0x62ba('0x70');_0x395687=as['buildExpression'](_0x222a87,_0x34a469[_0x62ba('0x38')],_0x429b46);_0x285c61[_0x9db8ed](_0x395687[_0x62ba('0x69')],_0x395687[_0x62ba('0x5f')][_0x62ba('0x6a')],_0x395687[_0x62ba('0x5f')][_0x62ba('0x21')]);}break;case _0x62ba('0x71'):_0x395687=as[_0x62ba('0x68')]('me',null,_0x429b46);_0x285c61[_0x9db8ed](_0x395687['text'],_0x395687[_0x62ba('0x5f')][_0x62ba('0x6a')],_0x395687[_0x62ba('0x5f')][_0x62ba('0x21')]);break;}}else{var _0x395687=as['buildExpression'](_0x222a87,_0x34a469[_0x62ba('0x38')],_0x429b46);_0x285c61[_0x9db8ed](_0x395687[_0x62ba('0x69')],_0x395687['value'][_0x62ba('0x6a')],_0x395687[_0x62ba('0x5f')][_0x62ba('0x21')]);}}}else{var _0x37fe7a=_(_0xf51b6b['query'])[_0x62ba('0x3c')]()[_0x62ba('0x30')](function(_0xb91301){return _[_0x62ba('0x72')](_0xc0f29b,[_0x62ba('0x2d'),_0xb91301])?_0xb91301:undefined;})[_0x62ba('0x73')]()['value']();if(!_[_0x62ba('0x74')](_0x37fe7a)){_0x37fe7a[_0x62ba('0x6b')](function(_0x3f3421){if(_0x3f3421===_0x62ba('0x75')){_0x3e78a2[_0x62ba('0x76')](_0x62ba('0x77'),[][_0x62ba('0x78')](_0xf51b6b[_0x62ba('0x3b')][_0x3f3421]));}else if(_0x3f3421===_0x62ba('0x79')){var _0x5cf9fa=JSON['parse'](_0xf51b6b[_0x62ba('0x3b')][_0x3f3421])[_0x62ba('0x7a')];var _0x15507e=JSON[_0x62ba('0x7b')](_0xf51b6b[_0x62ba('0x3b')][_0x3f3421])['$lte'];_0x3e78a2[_0x62ba('0x76')](_0x62ba('0x7c'),_0x5cf9fa,_0x15507e);}else{if(_0xf51b6b[_0x62ba('0x3b')][_0x3f3421]==='null'){_0x3e78a2[_0x62ba('0x76')]('i.'+_0x3f3421+_0x62ba('0x7d'));}else{_0x3e78a2[_0x62ba('0x76')]('i.'+_0x3f3421+_0x62ba('0x7e'),_0xf51b6b['query'][_0x3f3421]);}}});}if(_0xf51b6b[_0x62ba('0x3b')][_0x62ba('0x7f')]){if(_0xf51b6b[_0x62ba('0x3b')][_0x62ba('0x7f')]==0x1){_0x3e78a2[_0x62ba('0x60')](_0x62ba('0x80'));}else{_0x3e78a2['having'](_0x62ba('0x81'));}}if(_0xf51b6b[_0x62ba('0x3b')][_0x62ba('0x82')]){_0x2ae52a=_['isArray'](_0xf51b6b['query'][_0x62ba('0x82')])?_0xf51b6b[_0x62ba('0x3b')][_0x62ba('0x82')]:new Array(_0xf51b6b[_0x62ba('0x3b')][_0x62ba('0x82')]);_0x2ae52a[_0x62ba('0x6b')](function(_0x32e56c){_0x466d8c['or'](_0x62ba('0x6c'),'%,'+_0x32e56c+',%');});}if(_0xf51b6b[_0x62ba('0x3b')]['filter']){var _0x3a6e19=_0xf51b6b[_0x62ba('0x3b')]['filter'][_0x62ba('0x83')]('\x5c','\x5c\x5c')[_0x62ba('0x83')](/'/g,'\x27\x27');if(qs[_0x62ba('0x84')](_0x3a6e19)){_0x285c61['or'](_0x62ba('0x85'),_0x3a6e19+'%')['or'](_0x62ba('0x86'),_0x3a6e19+'%');}else{_0x285c61['or'](_0x62ba('0x87'),qs[_0x62ba('0x66')](_0x3a6e19))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x3a6e19+'%');}}}_0x3e78a2[_0x62ba('0x76')](_0x285c61);_0x3e78a2[_0x62ba('0x88')](_0x62ba('0x89'));var _0x86a068={'type':db[_0x62ba('0x8a')][_0x62ba('0x8b')]['SELECT'],'raw':!![]};var _0x3aaaf4=_0x3e78a2['clone']();_0x3aaaf4[_0x62ba('0x47')](_0x62ba('0x89'));_0x3aaaf4[_0x62ba('0x47')](_0x62ba('0x8c'),_0x62ba('0x5e'));if(_0x126c98[_0x62ba('0x43')]){_0x126c98['order'][_0x62ba('0x6b')](function(_0x2371f3){var _0x135c47=_0x2371f3[0x0]===_0x62ba('0x8d')?_0x2371f3[0x0]:'i.'+_0x2371f3[0x0];_0x3e78a2[_0x62ba('0x43')](_0x135c47,_0x2371f3[0x1]===_0x62ba('0x8e')?![]:!![]);});}if(!_[_0x62ba('0x74')](_0x2ae52a)){_0x3e78a2[_0x62ba('0x60')](_0x466d8c);_0x3aaaf4[_0x62ba('0x76')]('t.id\x20IN\x20?',_0x2ae52a);}BPromise[_0x62ba('0x8f')]()[_0x62ba('0x2a')](function(){if(!_0xb22eec){if(_0xf51b6b[_0x62ba('0x3b')][_0x62ba('0x75')])return;_0x3aaaf4['where'](_0x62ba('0x90'));_0x3e78a2[_0x62ba('0x76')](_0x62ba('0x90'));return;}if(_0xf51b6b[_0x62ba('0x91')][_0x62ba('0x92')]!==_0x62ba('0x93'))return;return _0xf51b6b[_0x62ba('0x91')][_0x62ba('0x94')]({'attributes':['id'],'raw':!![]})[_0x62ba('0x2a')](function(_0xe2afec){if(_[_0x62ba('0x74')](_0xe2afec)){_0x3aaaf4[_0x62ba('0x76')](_0x62ba('0x95'));_0x3e78a2[_0x62ba('0x76')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x3aaaf4[_0x62ba('0x76')]('i.SmsAccountId\x20IN\x20?',_[_0x62ba('0x30')](_0xe2afec,'id'));_0x3e78a2[_0x62ba('0x76')](_0x62ba('0x77'),_[_0x62ba('0x30')](_0xe2afec,'id'));}});})[_0x62ba('0x2a')](function(){if(_0xf51b6b[_0x62ba('0x91')][_0x62ba('0x92')]==='agent'&&!_0xb22eec&&!_0xf51b6b[_0x62ba('0x3b')]['SmsAccountId'])return[];return db[_0x62ba('0x96')][_0x62ba('0x3b')](_0x3aaaf4['toString'](),_0x86a068);})[_0x62ba('0x2a')](function(_0x95308a){_0x7f8038['count']=_0x95308a[_0x62ba('0x41')];if(_0x7f8038[_0x62ba('0x26')]===0x0)return[];return db[_0x62ba('0x96')]['query'](_0x37c97a[_0x62ba('0x97')](),_0x86a068)[_0x62ba('0x2a')](function(_0x270536){_0x4f3dee=_[_0x62ba('0x98')](_0x270536,'id');_0x86a068=_['merge'](_0x86a068,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xf51b6b[_0x62ba('0x3b')][_0x62ba('0x40')]){_0x126c98[_0x62ba('0x3f')][_0x62ba('0x6b')](function(_0x29d751){_0x3e78a2[_0x62ba('0x47')]('i.'+_0x29d751);});}else{_0x3e78a2[_0x62ba('0x47')](_0x62ba('0x8c'),'unreadMessages');_0x3e78a2[_0x62ba('0x47')](_0x62ba('0x99'),'Account.key');_0x3e78a2[_0x62ba('0x47')]('a.mandatoryDisposition',_0x62ba('0x9a'));_0x3e78a2[_0x62ba('0x47')](_0x62ba('0x9b'),_0x62ba('0x8d'));_0x3e78a2['field']('i.*');_0x3e78a2[_0x62ba('0x47')](_0x62ba('0x9c'),'Contact.firstName');_0x3e78a2['field'](_0x62ba('0x9d'),_0x62ba('0x9e'));_0x3e78a2[_0x62ba('0x47')](_0x62ba('0x9f'),_0x62ba('0xa0'));_0x3e78a2[_0x62ba('0x47')]('c.phone','Contact.phone');_0x3e78a2[_0x62ba('0x47')]('c.mobile',_0x62ba('0xa1'));_0x3e78a2[_0x62ba('0x47')]('c.fax',_0x62ba('0xa2'));_0x3e78a2[_0x62ba('0x47')](_0x62ba('0xa3'),_0x62ba('0xa4'));_0x3e78a2['field'](_0x62ba('0xa5'),'Owner.internal');_0x3e78a2[_0x62ba('0x47')](_0x62ba('0xa6'),_0x62ba('0x32'));}if(_0x126c98[_0x62ba('0x24')])_0x3e78a2[_0x62ba('0x24')](_0x126c98[_0x62ba('0x24')]);if(_0x126c98[_0x62ba('0x23')])_0x3e78a2[_0x62ba('0x23')](_0x126c98[_0x62ba('0x23')]);return db['sequelize'][_0x62ba('0x3b')](_0x3e78a2[_0x62ba('0x97')](),_0x86a068);})[_0x62ba('0x2a')](function(_0x39232f){if(_0x39232f[_0x62ba('0x41')]>0x0)_0x1e1539[_0x62ba('0x76')]('ui.SmsInteractionId\x20IN\x20?',_[_0x62ba('0x30')](_0x39232f,'id'));return db[_0x62ba('0x96')][_0x62ba('0x3b')](_0x1e1539[_0x62ba('0x97')](),_0x86a068)[_0x62ba('0x2a')](function(_0x5f566d){var _0x39b31e=_['groupBy'](_0x5f566d,_0x62ba('0xa7'));var _0x35407a=[];_0x39232f[_0x62ba('0x6b')](function(_0x50eaf7){_0x35407a[_0x62ba('0x34')](updateSmsInteraction(_0x50eaf7,_0x4f3dee,_0x39b31e));});return BPromise[_0x62ba('0xa8')](_0x35407a);});});})[_0x62ba('0x2a')](function(_0x440dde){_0x7f8038['rows']=_0x440dde;return _0x7f8038;})['then'](respondWithFilteredResult(_0x161ac8,_0x126c98))[_0x62ba('0x35')](handleError(_0x161ac8,null));};exports[_0x62ba('0xa9')]=function(_0x5c2ca7,_0x45358b){var _0xdd41c2={'raw':![],'where':{'id':_0x5c2ca7[_0x62ba('0xaa')]['id']}},_0x12891a={};_0x12891a[_0x62ba('0x3a')]=_[_0x62ba('0x3c')](db[_0x62ba('0xab')][_0x62ba('0x36')]);_0x12891a[_0x62ba('0x3b')]=_[_0x62ba('0x3c')](_0x5c2ca7['query']);_0x12891a['filters']=_[_0x62ba('0x3e')](_0x12891a['model'],_0x12891a['query']);_0xdd41c2['attributes']=_[_0x62ba('0x3e')](_0x12891a[_0x62ba('0x3a')],qs[_0x62ba('0x40')](_0x5c2ca7[_0x62ba('0x3b')][_0x62ba('0x40')]));_0xdd41c2['attributes']=_0xdd41c2[_0x62ba('0x3f')]['length']?_0xdd41c2['attributes']:_0x12891a[_0x62ba('0x3a')];if(_0x5c2ca7[_0x62ba('0x3b')][_0x62ba('0xac')]){_0xdd41c2[_0x62ba('0xad')]=[{'all':!![]}];}_0xdd41c2=_[_0x62ba('0xae')]({},_0xdd41c2,_0x5c2ca7[_0x62ba('0xaf')]);return db[_0x62ba('0xab')][_0x62ba('0x6f')](_0xdd41c2)[_0x62ba('0x2a')](handleEntityNotFound(_0x45358b,null))['then'](respondWithResult(_0x45358b,null))[_0x62ba('0x35')](handleError(_0x45358b,null));};exports[_0x62ba('0xb0')]=function(_0x136da2,_0x48ce13){return db[_0x62ba('0xab')]['create'](_0x136da2[_0x62ba('0x71')],{})[_0x62ba('0x2a')](respondWithResult(_0x48ce13,0xc9))[_0x62ba('0x35')](handleError(_0x48ce13,null));};exports[_0x62ba('0x29')]=function(_0x48f411,_0x5a850b){if(_0x48f411[_0x62ba('0x71')]['id']){delete _0x48f411[_0x62ba('0x71')]['id'];}return db[_0x62ba('0xab')][_0x62ba('0x6f')]({'where':{'id':_0x48f411[_0x62ba('0xaa')]['id']}})[_0x62ba('0x2a')](handleEntityNotFound(_0x5a850b,null))[_0x62ba('0x2a')](saveUpdates(_0x48f411[_0x62ba('0x71')],null))[_0x62ba('0x2a')](respondWithResult(_0x5a850b,null))['catch'](handleError(_0x5a850b,null));};exports[_0x62ba('0xb1')]=function(_0x3018f8,_0x312a5a){return db[_0x62ba('0xab')]['find']({'where':{'id':_0x3018f8[_0x62ba('0xaa')]['id']}})['then'](handleEntityNotFound(_0x312a5a,null))[_0x62ba('0x2a')](removeEntity(_0x312a5a,null))[_0x62ba('0x35')](handleError(_0x312a5a,null));};exports[_0x62ba('0xb2')]=function(_0x5875c0,_0x27c47f){return db[_0x62ba('0xab')][_0x62ba('0xb2')]()['then'](respondWithResult(_0x27c47f,null))[_0x62ba('0x35')](handleError(_0x27c47f,null));};exports[_0x62ba('0xb3')]=function(_0x4b9083,_0x529c3e,_0x93fbc1){return db[_0x62ba('0xb4')]['find']({'where':{'id':_0x4b9083[_0x62ba('0xaa')]['id']}})[_0x62ba('0x2a')](handleEntityNotFound(_0x529c3e,null))[_0x62ba('0x2a')](function(_0xc2562e){if(_0xc2562e){return _0xc2562e[_0x62ba('0xb3')](_0x4b9083['body'][_0x62ba('0xb5')],_[_0x62ba('0xb6')](_0x4b9083[_0x62ba('0x71')],['ids','id'])||{});}})[_0x62ba('0x2a')](respondWithResult(_0x529c3e,null))[_0x62ba('0x35')](handleError(_0x529c3e,null));};exports[_0x62ba('0xb7')]=function(_0x5d2d34,_0xff3f48,_0x146180){var _0x46c34c={'raw':![],'where':{}};var _0x462299={};var _0x31d0aa={'count':0x0,'rows':[]};return db[_0x62ba('0xab')]['findOne']({'where':{'id':_0x5d2d34[_0x62ba('0xaa')]['id']}})[_0x62ba('0x2a')](handleEntityNotFound(_0xff3f48,null))[_0x62ba('0x2a')](function(_0x5d44c7){if(_0x5d44c7){_0x462299[_0x62ba('0x3a')]=_['keys'](db[_0x62ba('0xb4')][_0x62ba('0x36')]);_0x462299[_0x62ba('0x3b')]=_[_0x62ba('0x3c')](_0x5d2d34['query']);_0x462299[_0x62ba('0x3d')]=_[_0x62ba('0x3e')](_0x462299[_0x62ba('0x3a')],_0x462299[_0x62ba('0x3b')]);_0x46c34c['attributes']=_[_0x62ba('0x3e')](_0x462299[_0x62ba('0x3a')],qs[_0x62ba('0x40')](_0x5d2d34[_0x62ba('0x3b')][_0x62ba('0x40')]));_0x46c34c[_0x62ba('0x3f')]=_0x46c34c[_0x62ba('0x3f')]['length']?_0x46c34c[_0x62ba('0x3f')]:_0x462299[_0x62ba('0x3a')];if(!_0x5d2d34[_0x62ba('0x3b')][_0x62ba('0xb8')](_0x62ba('0x42'))){_0x46c34c[_0x62ba('0x24')]=qs[_0x62ba('0x24')](_0x5d2d34[_0x62ba('0x3b')][_0x62ba('0x24')]);_0x46c34c[_0x62ba('0x23')]=qs[_0x62ba('0x23')](_0x5d2d34['query'][_0x62ba('0x23')]);}_0x46c34c[_0x62ba('0x43')]=qs['sort'](_0x5d2d34[_0x62ba('0x3b')]['sort']);_0x46c34c[_0x62ba('0x76')]=qs['filters'](_[_0x62ba('0x45')](_0x5d2d34[_0x62ba('0x3b')],_0x462299['filters']));_0x46c34c[_0x62ba('0x76')]['SmsInteractionId']=_0x5d44c7['id'];if(_0x5d2d34['query'][_0x62ba('0xb9')]){_0x46c34c[_0x62ba('0x76')]=_[_0x62ba('0xae')](_0x46c34c['where'],{'$or':_[_0x62ba('0x30')](_0x46c34c['attributes'],function(_0x8fd9a5){var _0x136ecf={};_0x136ecf[_0x8fd9a5]={'$like':'%'+_0x5d2d34[_0x62ba('0x3b')][_0x62ba('0xb9')]+'%'};return _0x136ecf;})});}if(_0x5d2d34['query'][_0x62ba('0x7a')]){var _0x18384f=_0x5d2d34[_0x62ba('0x3b')][_0x62ba('0x7a')][_0x62ba('0x64')](',');var _0x2c8f5f={};_0x2c8f5f[_0x18384f[0x0]]={'$gte':moment(_0x18384f[0x1])[_0x62ba('0xba')](_0x62ba('0xbb'))};_0x46c34c[_0x62ba('0x76')]=_['merge'](_0x46c34c['where'],_0x2c8f5f);}_0x46c34c=_['merge']({},_0x46c34c,_0x5d2d34[_0x62ba('0xaf')]);return db[_0x62ba('0xb4')]['count']({'where':_0x46c34c[_0x62ba('0x76')]})[_0x62ba('0x2a')](function(_0x4e2478){_0x31d0aa[_0x62ba('0x26')]=_0x4e2478;if(_0x5d2d34[_0x62ba('0x3b')][_0x62ba('0xac')]){_0x46c34c['include']=[{'all':!![]}];}return db[_0x62ba('0xb4')][_0x62ba('0xbc')](_0x46c34c);})['then'](function(_0x273cb5){_0x31d0aa[_0x62ba('0xbd')]=_0x273cb5;return _0x31d0aa;});}})[_0x62ba('0x2a')](respondWithFilteredResult(_0xff3f48,_0x46c34c))[_0x62ba('0x35')](handleError(_0xff3f48,null));};exports[_0x62ba('0xbe')]=function(_0x3de014,_0x1048f1,_0x3ea29e){return db[_0x62ba('0xab')][_0x62ba('0x6f')]({'where':{'id':_0x3de014['params']['id']}})['then'](handleEntityNotFound(_0x1048f1,null))[_0x62ba('0x2a')](function(_0x17e01a){if(_0x17e01a){return _0x17e01a[_0x62ba('0xbf')](_0x3de014['body'][_0x62ba('0xb5')],_[_0x62ba('0xb6')](_0x3de014[_0x62ba('0x71')],[_0x62ba('0xb5'),'id'])||{})[_0x62ba('0xc0')](function(){return db['Tag']['findAll']({'attributes':['id',_0x62ba('0x2d'),_0x62ba('0x48')],'where':{'id':_0x3de014[_0x62ba('0x71')]['ids']}});})[_0x62ba('0x2a')](function(_0x585196){socket[_0x62ba('0xc1')]('smsInteractionTags:save',{'id':Number(_0x3de014[_0x62ba('0xaa')]['id']),'tags':_0x585196||[]});return{'id':Number(_0x3de014[_0x62ba('0xaa')]['id']),'tags':_0x585196||[]};});}})[_0x62ba('0x2a')](respondWithResult(_0x1048f1,null))[_0x62ba('0x35')](handleError(_0x1048f1,null));};exports[_0x62ba('0xc2')]=function(_0x5af143,_0x31264b,_0xed9c6d){return db[_0x62ba('0xab')][_0x62ba('0x6f')]({'where':{'id':_0x5af143[_0x62ba('0xaa')]['id']}})[_0x62ba('0x2a')](handleEntityNotFound(_0x31264b,null))[_0x62ba('0x2a')](function(_0x514ef1){if(_0x514ef1){return _0x514ef1['removeTags'](_0x5af143[_0x62ba('0x3b')]['ids']);}})['then'](respondWithStatusCode(_0x31264b,null))[_0x62ba('0x35')](handleError(_0x31264b,null));};exports[_0x62ba('0xc3')]=function(_0x5842fa,_0x20b17b){var _0x5ebbdc=moment()[_0x62ba('0xc4')]()[_0x62ba('0x97')]();var _0x4ab707=path[_0x62ba('0xc5')](config[_0x62ba('0xc6')],_0x62ba('0xc7'),_0x62ba('0xc8'),_0x62ba('0xc9'));var _0x16790f=path[_0x62ba('0xc5')](config[_0x62ba('0xc6')],_0x62ba('0xc7'),_0x62ba('0xc8'),_0x62ba('0xca'));var _0x2ad5ae=path[_0x62ba('0xc5')](_0x4ab707,_0x5ebbdc);var _0x10a937=util[_0x62ba('0xba')]('transcript-%d-%s.zip',_0x5842fa[_0x62ba('0xaa')]['id'],_0x5ebbdc);var _0x588d01=path['join'](_0x4ab707,_0x10a937);var _0x2c3d38=[];_0x2c3d38['push']({'model':db[_0x62ba('0x6d')],'as':_0x62ba('0x6d'),'attributes':['id',_0x62ba('0x31')],'raw':!![]});_0x2c3d38['push']({'model':db['CmContact'],'as':_0x62ba('0xcb'),'attributes':['id',_0x62ba('0xcc'),_0x62ba('0xcd')],'raw':!![]});var _0x1c4393=[{'model':db['SmsMessage'],'as':_0x62ba('0xce'),'attributes':['id','body',_0x62ba('0x79'),_0x62ba('0xcf'),_0x62ba('0xd0'),_0x62ba('0x7f')],'include':_0x2c3d38}];_0x1c4393['push']({'model':db[_0x62ba('0xd1')],'as':_0x62ba('0xd2'),'attributes':['id',_0x62ba('0x2d')]});_0x1c4393[_0x62ba('0x34')]({'model':db[_0x62ba('0x6d')],'as':'Owner','attributes':['id',_0x62ba('0x31')]});return db[_0x62ba('0xab')][_0x62ba('0x6f')]({'where':{'id':_0x5842fa['params']['id']},'include':_0x1c4393})['then'](handleEntityNotFound(_0x20b17b,null))['then'](function(_0x58532f){if(_0x58532f){var _0x104f28=_0x58532f[_0x62ba('0xd3')]({'plain':!![]});fs[_0x62ba('0xd4')](_0x2ad5ae);var _0x1c5dd9={'channel':_0x62ba('0xd5'),'account':_0x104f28[_0x62ba('0xd2')][_0x62ba('0x2d')],'agent':_0x104f28[_0x62ba('0xd6')]?_0x104f28[_0x62ba('0xd6')]['fullname']:_0x62ba('0xd7'),'createdAt':moment(_0x104f28[_0x62ba('0x79')])[_0x62ba('0xba')](_0x62ba('0xbb'))['toString'](),'closedAt':_0x104f28['closed']?moment(_0x104f28[_0x62ba('0xd8')])[_0x62ba('0xba')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x104f28[_0x62ba('0xd9')],'messages':_(_0x104f28[_0x62ba('0xce')])[_0x62ba('0xb9')]({'secret':![]})['map'](function(_0x3b555b){return{'date':moment(_0x3b555b['createdAt'])[_0x62ba('0xba')](_0x62ba('0xbb'))['toString'](),'sender':_0x3b555b['direction']==='out'?_0x3b555b[_0x62ba('0x6d')]?_0x3b555b['User'][_0x62ba('0x31')]:_0x62ba('0xda'):_0x3b555b[_0x62ba('0xcb')][_0x62ba('0xcc')]+(_0x3b555b[_0x62ba('0xcb')][_0x62ba('0xcd')]?'\x20'+_0x3b555b[_0x62ba('0xcb')]['lastName']:''),'body':_0x3b555b[_0x62ba('0x71')],'direction':_0x3b555b[_0x62ba('0xcf')]===_0x62ba('0xdb')?'A':'C','secret':_0x3b555b[_0x62ba('0xd0')],'read':_0x3b555b[_0x62ba('0x7f')]};})['value']()};return ejs['renderFile'](path[_0x62ba('0xc5')](config[_0x62ba('0xc6')],'server',_0x62ba('0xdc'),'downloadInteraction.ejs'),{'interaction':_0x1c5dd9})['then'](function(_0x353a2d){var _0xc6e880=path[_0x62ba('0xc5')](_0x2ad5ae,_0x62ba('0xdd')+_0x104f28['id']+'-'+_0x5ebbdc+_0x62ba('0xde'));var _0x245b03={'path':_0xc6e880,'channel':_0x62ba('0xd5'),'interactionId':_0x104f28['id']};return pdf[_0x62ba('0xdf')](_0x353a2d,_0x245b03);})['then'](function(){return new BPromise(function(_0x3f74c8,_0x58d04e){zipdir(_0x2ad5ae,{'saveTo':_0x588d01},function(_0x2fd803,_0x4e4c4a){if(_0x2fd803)return _0x58d04e(_0x2fd803);return _0x3f74c8(_0x4e4c4a);});})['then'](function(){return new BPromise(function(_0x2111bb,_0x157ff1){rimraf(_0x2ad5ae,function(_0x3e8694){if(_0x3e8694)_0x157ff1(_0x3e8694);return _0x2111bb();});});})[_0x62ba('0x2a')](function(){return _0x20b17b[_0x62ba('0xc3')](_0x588d01,_0x10a937,function(_0x1226d1){if(_0x1226d1){console['log'](_0x62ba('0xe0'),_0x1226d1);}else{fs[_0x62ba('0xe1')](_0x588d01);}});});});}else{return _0x20b17b['sendStatus'](0xc8);}})['catch'](handleError(_0x20b17b,null));};
\ No newline at end of file
index 5668170..7c2a973 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36ee=['getUsers','then','Users','findAll','setDataValue','length','emit','catch','hasOwnProperty','hook','exports','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove'];(function(_0x551b51,_0x2b0479){var _0x49a306=function(_0x52572c){while(--_0x52572c){_0x551b51['push'](_0x551b51['shift']());}};_0x49a306(++_0x2b0479);}(_0x36ee,0xe8));var _0xe36e=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x36ee[_0x3bf83f];return _0x22c4a9;};'use strict';var EventEmitter=require('events');var SmsInteraction=require('../../mysqldb')['db'][_0xe36e('0x0')];var SmsMessage=require('../../mysqldb')['db'][_0xe36e('0x1')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xe36e('0x2')](0x0);var events={'afterCreate':_0xe36e('0x3'),'afterUpdate':_0xe36e('0x4'),'afterDestroy':_0xe36e('0x5')};function emitEvent(_0x1118af){return function(_0x29e692,_0x3f29e1,_0x25a07d){_0x29e692[_0xe36e('0x6')]({'attributes':['id'],'raw':!![]})[_0xe36e('0x7')](function(_0x1aa596){_0x29e692['setDataValue'](_0xe36e('0x8'),_0x1aa596['map'](function(_0x2236e9){return{'id':_0x2236e9['id']};}));return SmsMessage[_0xe36e('0x9')]({'where':{'SmsInteractionId':_0x29e692['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe36e('0x7')](function(_0x47ce3a){_0x29e692[_0xe36e('0xa')]('unreadMessages',_0x47ce3a[_0xe36e('0xb')]);SmsInteractionEvents[_0xe36e('0xc')](_0x1118af+':'+_0x29e692['id'],_0x29e692);SmsInteractionEvents[_0xe36e('0xc')](_0x1118af,_0x29e692);_0x25a07d(null);})[_0xe36e('0xd')](_0x25a07d(null));};}for(var e in events){if(events[_0xe36e('0xe')](e)){var event=events[e];SmsInteraction[_0xe36e('0xf')](e,emitEvent(event));}}module[_0xe36e('0x10')]=SmsInteractionEvents;
\ No newline at end of file
+var _0x9f0e=['unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','SmsInteraction','SmsMessage','update','remove','then','setDataValue','map','findAll'];(function(_0x28b3d7,_0x17b41d){var _0x49619d=function(_0x51a700){while(--_0x51a700){_0x28b3d7['push'](_0x28b3d7['shift']());}};_0x49619d(++_0x17b41d);}(_0x9f0e,0x116));var _0xe9f0=function(_0x4f5f46,_0x2e37cf){_0x4f5f46=_0x4f5f46-0x0;var _0x5c06ec=_0x9f0e[_0x4f5f46];return _0x5c06ec;};'use strict';var EventEmitter=require(_0xe9f0('0x0'));var SmsInteraction=require(_0xe9f0('0x1'))['db'][_0xe9f0('0x2')];var SmsMessage=require(_0xe9f0('0x1'))['db'][_0xe9f0('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe9f0('0x4'),'afterDestroy':_0xe9f0('0x5')};function emitEvent(_0x3c589d){return function(_0x202d69,_0x1eed45,_0x50313d){_0x202d69['getUsers']({'attributes':['id'],'raw':!![]})[_0xe9f0('0x6')](function(_0x167198){_0x202d69[_0xe9f0('0x7')]('Users',_0x167198[_0xe9f0('0x8')](function(_0x335b82){return{'id':_0x335b82['id']};}));return SmsMessage[_0xe9f0('0x9')]({'where':{'SmsInteractionId':_0x202d69['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe9f0('0x6')](function(_0xa523c0){_0x202d69[_0xe9f0('0x7')](_0xe9f0('0xa'),_0xa523c0[_0xe9f0('0xb')]);SmsInteractionEvents[_0xe9f0('0xc')](_0x3c589d+':'+_0x202d69['id'],_0x202d69);SmsInteractionEvents['emit'](_0x3c589d,_0x202d69);_0x50313d(null);})[_0xe9f0('0xd')](_0x50313d(null));};}for(var e in events){if(events[_0xe9f0('0xe')](e)){var event=events[e];SmsInteraction[_0xe9f0('0xf')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents;
\ No newline at end of file
index b3a394b..a6f299b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe328=['api','moment','bluebird','path','../../config/environment','./smsInteraction.attributes','define','SmsInteraction','sms_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger'];(function(_0x2fc422,_0x9a8b25){var _0x10453a=function(_0x5c5c81){while(--_0x5c5c81){_0x2fc422['push'](_0x2fc422['shift']());}};_0x10453a(++_0x9a8b25);}(_0xe328,0x19d));var _0x8e32=function(_0x172c5e,_0x2ab13a){_0x172c5e=_0x172c5e-0x0;var _0x396cec=_0xe328[_0x172c5e];return _0x396cec;};'use strict';var _=require(_0x8e32('0x0'));var util=require(_0x8e32('0x1'));var logger=require(_0x8e32('0x2'))(_0x8e32('0x3'));var moment=require(_0x8e32('0x4'));var BPromise=require(_0x8e32('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8e32('0x6'));var rimraf=require('rimraf');var config=require(_0x8e32('0x7'));var attributes=require(_0x8e32('0x8'));module['exports']=function(_0x4cd5c2,_0x268b91){return _0x4cd5c2[_0x8e32('0x9')](_0x8e32('0xa'),attributes,{'tableName':_0x8e32('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4ebc0e,_0x596818,_0x48be00){if(_0x4ebc0e[_0x8e32('0xc')](_0x8e32('0xd'))){_0x4ebc0e[_0x8e32('0xe')]=moment()['format'](_0x8e32('0xf'));}_0x48be00(null,_0x4ebc0e);}}});};
\ No newline at end of file
+var _0x954e=['./smsInteraction.attributes','exports','define','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','api','request-promise','rimraf'];(function(_0x25997b,_0xeddec4){var _0x43f8e1=function(_0x3a1005){while(--_0x3a1005){_0x25997b['push'](_0x25997b['shift']());}};_0x43f8e1(++_0xeddec4);}(_0x954e,0x164));var _0xe954=function(_0x35761d,_0x3a1cbf){_0x35761d=_0x35761d-0x0;var _0x381548=_0x954e[_0x35761d];return _0x381548;};'use strict';var _=require(_0xe954('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe954('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe954('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe954('0x3'));var config=require('../../config/environment');var attributes=require(_0xe954('0x4'));module[_0xe954('0x5')]=function(_0xfbe304,_0xb5d57a){return _0xfbe304[_0xe954('0x6')]('SmsInteraction',attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xd29017,_0x3f19be,_0x3934be){if(_0xd29017[_0xe954('0x7')]('closed')){_0xd29017[_0xe954('0x8')]=moment()['format'](_0xe954('0x9'));}_0x3934be(null,_0xd29017);}}});};
\ No newline at end of file
index c9c4eef..9cfb7ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7da8=['find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','where','limit','stringify','AddTagsToSmsInteraction'];(function(_0x190fdb,_0x358a8b){var _0xf3fdec=function(_0x42c38b){while(--_0x42c38b){_0x190fdb['push'](_0x190fdb['shift']());}};_0xf3fdec(++_0x358a8b);}(_0x7da8,0x196));var _0x87da=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x7da8[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x87da('0x0'));var moment=require(_0x87da('0x1'));var BPromise=require(_0x87da('0x2'));var rs=require(_0x87da('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x87da('0x4'))(_0x87da('0x5'));var config=require(_0x87da('0x6'));var jayson=require(_0x87da('0x7'));var client=jayson['client'][_0x87da('0x8')]({'port':0x232a});config[_0x87da('0x9')]=_[_0x87da('0xa')](config[_0x87da('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x87da('0xb'))(new Redis(config['redis']));require(_0x87da('0xc'))[_0x87da('0xd')](socket);function respondWithRpcPromise(_0x261c34,_0x5de456,_0x1f2666){return new BPromise(function(_0x259490,_0x3dc1df){return client[_0x87da('0xe')](_0x261c34,_0x1f2666)[_0x87da('0xf')](function(_0x3dbc25){logger[_0x87da('0x10')](_0x87da('0x11'),_0x5de456,_0x87da('0x12'));logger[_0x87da('0x13')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x5de456,'request\x20sent',JSON['stringify'](_0x3dbc25));if(_0x3dbc25['error']){if(_0x3dbc25[_0x87da('0x14')][_0x87da('0x15')]===0x1f4){logger['error'](_0x87da('0x11'),_0x5de456,_0x3dbc25[_0x87da('0x14')]['message']);return _0x3dc1df(_0x3dbc25[_0x87da('0x14')]['message']);}logger[_0x87da('0x14')](_0x87da('0x11'),_0x5de456,_0x3dbc25[_0x87da('0x14')][_0x87da('0x16')]);return _0x259490(_0x3dbc25['error']['message']);}else{logger['info']('SmsInteraction,\x20%s,\x20%s',_0x5de456,'request\x20sent');_0x259490(_0x3dbc25[_0x87da('0x17')]['message']);}})[_0x87da('0x18')](function(_0x155b36){logger[_0x87da('0x14')](_0x87da('0x11'),_0x5de456,_0x155b36);_0x3dc1df(_0x155b36);});});}exports[_0x87da('0x19')]=function(_0x55a1b5){var _0x48b859=this;return new Promise(function(_0x6a86b9,_0x8ea6d2){return db[_0x87da('0x1a')][_0x87da('0x1b')](_0x55a1b5[_0x87da('0x1c')],{'raw':_0x55a1b5[_0x87da('0x1d')]?_0x55a1b5[_0x87da('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55a1b5[_0x87da('0x1d')]?_0x55a1b5['options'][_0x87da('0x1e')]||null:null,'attributes':_0x55a1b5[_0x87da('0x1d')]?_0x55a1b5[_0x87da('0x1d')]['attributes']||null:null,'limit':_0x55a1b5[_0x87da('0x1d')]?_0x55a1b5[_0x87da('0x1d')][_0x87da('0x1f')]||null:null})[_0x87da('0xf')](function(_0x3136b2){logger[_0x87da('0x10')](_0x87da('0x19'),_0x55a1b5);logger['debug']('UpdateSmsInteraction',_0x55a1b5,JSON[_0x87da('0x20')](_0x3136b2));_0x6a86b9(_0x3136b2);})[_0x87da('0x18')](function(_0x5f02d1){logger[_0x87da('0x14')](_0x87da('0x19'),_0x5f02d1['message'],_0x55a1b5);_0x8ea6d2(_0x48b859['error'](0x1f4,_0x5f02d1[_0x87da('0x16')]));});});};exports[_0x87da('0x21')]=function(_0xecd012){return new Promise(function(_0x1ec25e,_0x57d807){return db[_0x87da('0x1a')][_0x87da('0x22')]({'where':_0xecd012[_0x87da('0x1d')]?_0xecd012[_0x87da('0x1d')][_0x87da('0x1e')]||null:null})[_0x87da('0xf')](function(_0x365b06){if(_0x365b06){return _0x365b06[_0x87da('0x23')](_0xecd012[_0x87da('0x1c')][_0x87da('0x24')],_[_0x87da('0x25')](_0xecd012[_0x87da('0x1c')],[_0x87da('0x24'),'id'])||{});}})[_0x87da('0x26')](function(_0x5f243b){logger[_0x87da('0x10')](_0x87da('0x27'),_0xecd012);logger[_0x87da('0x13')](_0x87da('0x27'),_0xecd012,JSON[_0x87da('0x20')](_0x5f243b));_0x1ec25e(_0x5f243b);})[_0x87da('0x18')](function(_0x6be823){logger[_0x87da('0x14')]('AddTags',_0x6be823[_0x87da('0x16')],_0xecd012);_0x57d807(_this['error'](0x1f4,_0x6be823[_0x87da('0x16')]));});});};
\ No newline at end of file
+var _0xc6b0=['addTags','ids','omit','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./smsInteraction.socket','register','request','then','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','SmsInteraction,\x20%s,\x20%s','message','info','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','attributes','stringify','find','where'];(function(_0x817d9b,_0x3c37e3){var _0x2752e1=function(_0x2b434e){while(--_0x2b434e){_0x817d9b['push'](_0x817d9b['shift']());}};_0x2752e1(++_0x3c37e3);}(_0xc6b0,0x1f0));var _0x0c6b=function(_0x1694f0,_0x407ca2){_0x1694f0=_0x1694f0-0x0;var _0x2502bc=_0xc6b0[_0x1694f0];return _0x2502bc;};'use strict';var _=require(_0x0c6b('0x0'));var util=require(_0x0c6b('0x1'));var moment=require(_0x0c6b('0x2'));var BPromise=require('bluebird');var rs=require(_0x0c6b('0x3'));var fs=require('fs');var Redis=require(_0x0c6b('0x4'));var db=require(_0x0c6b('0x5'))['db'];var utils=require(_0x0c6b('0x6'));var logger=require('../../config/logger')(_0x0c6b('0x7'));var config=require(_0x0c6b('0x8'));var jayson=require(_0x0c6b('0x9'));var client=jayson['client'][_0x0c6b('0xa')]({'port':0x232a});config[_0x0c6b('0xb')]=_['defaults'](config[_0x0c6b('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x0c6b('0xc'))(new Redis(config['redis']));require(_0x0c6b('0xd'))[_0x0c6b('0xe')](socket);function respondWithRpcPromise(_0x4abb0d,_0x49d9b2,_0x460e0a){return new BPromise(function(_0x56710a,_0x31d988){return client[_0x0c6b('0xf')](_0x4abb0d,_0x460e0a)[_0x0c6b('0x10')](function(_0x31054f){logger['info']('SmsInteraction,\x20%s,\x20%s',_0x49d9b2,_0x0c6b('0x11'));logger[_0x0c6b('0x12')](_0x0c6b('0x13'),_0x49d9b2,_0x0c6b('0x11'),JSON['stringify'](_0x31054f));if(_0x31054f[_0x0c6b('0x14')]){if(_0x31054f[_0x0c6b('0x14')][_0x0c6b('0x15')]===0x1f4){logger['error'](_0x0c6b('0x16'),_0x49d9b2,_0x31054f['error'][_0x0c6b('0x17')]);return _0x31d988(_0x31054f[_0x0c6b('0x14')]['message']);}logger[_0x0c6b('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x49d9b2,_0x31054f[_0x0c6b('0x14')][_0x0c6b('0x17')]);return _0x56710a(_0x31054f[_0x0c6b('0x14')][_0x0c6b('0x17')]);}else{logger[_0x0c6b('0x18')](_0x0c6b('0x16'),_0x49d9b2,_0x0c6b('0x11'));_0x56710a(_0x31054f[_0x0c6b('0x19')][_0x0c6b('0x17')]);}})[_0x0c6b('0x1a')](function(_0x2f2be7){logger[_0x0c6b('0x14')](_0x0c6b('0x16'),_0x49d9b2,_0x2f2be7);_0x31d988(_0x2f2be7);});});}exports[_0x0c6b('0x1b')]=function(_0x5fa67){var _0x5558c9=this;return new Promise(function(_0x4d6b70,_0xdcc3ad){return db[_0x0c6b('0x1c')][_0x0c6b('0x1d')](_0x5fa67[_0x0c6b('0x1e')],{'raw':_0x5fa67['options']?_0x5fa67[_0x0c6b('0x1f')][_0x0c6b('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5fa67[_0x0c6b('0x1f')]?_0x5fa67[_0x0c6b('0x1f')]['where']||null:null,'attributes':_0x5fa67[_0x0c6b('0x1f')]?_0x5fa67['options'][_0x0c6b('0x21')]||null:null,'limit':_0x5fa67[_0x0c6b('0x1f')]?_0x5fa67['options']['limit']||null:null})[_0x0c6b('0x10')](function(_0x3af2fc){logger[_0x0c6b('0x18')](_0x0c6b('0x1b'),_0x5fa67);logger[_0x0c6b('0x12')](_0x0c6b('0x1b'),_0x5fa67,JSON[_0x0c6b('0x22')](_0x3af2fc));_0x4d6b70(_0x3af2fc);})[_0x0c6b('0x1a')](function(_0x444e3a){logger['error'](_0x0c6b('0x1b'),_0x444e3a[_0x0c6b('0x17')],_0x5fa67);_0xdcc3ad(_0x5558c9['error'](0x1f4,_0x444e3a[_0x0c6b('0x17')]));});});};exports['AddTagsToSmsInteraction']=function(_0x41940f){return new Promise(function(_0x423d54,_0x4259b9){return db['SmsInteraction'][_0x0c6b('0x23')]({'where':_0x41940f['options']?_0x41940f[_0x0c6b('0x1f')][_0x0c6b('0x24')]||null:null})[_0x0c6b('0x10')](function(_0x5cec47){if(_0x5cec47){return _0x5cec47[_0x0c6b('0x25')](_0x41940f[_0x0c6b('0x1e')][_0x0c6b('0x26')],_[_0x0c6b('0x27')](_0x41940f['body'],[_0x0c6b('0x26'),'id'])||{});}})['spread'](function(_0x41d1fa){logger[_0x0c6b('0x18')](_0x0c6b('0x28'),_0x41940f);logger[_0x0c6b('0x12')](_0x0c6b('0x28'),_0x41940f,JSON[_0x0c6b('0x22')](_0x41d1fa));_0x423d54(_0x41d1fa);})[_0x0c6b('0x1a')](function(_0x437cbd){logger['error'](_0x0c6b('0x28'),_0x437cbd[_0x0c6b('0x17')],_0x41940f);_0x4259b9(_this[_0x0c6b('0x14')](0x1f4,_0x437cbd[_0x0c6b('0x17')]));});});};
\ No newline at end of file
index 2d84636..06f9432 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69ee=['remove','update','emit','length','smsInteraction:','./smsInteraction.events','save'];(function(_0xae8eb1,_0x2099ad){var _0x4400df=function(_0x1a8f69){while(--_0x1a8f69){_0xae8eb1['push'](_0xae8eb1['shift']());}};_0x4400df(++_0x2099ad);}(_0x69ee,0x9f));var _0xe69e=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x69ee[_0x1035c1];return _0x308d67;};'use strict';var SmsInteractionEvents=require(_0xe69e('0x0'));var events=[_0xe69e('0x1'),_0xe69e('0x2'),_0xe69e('0x3')];function createListener(_0x3a6509,_0x5312b5){return function(_0x5e2ac4){_0x5312b5[_0xe69e('0x4')](_0x3a6509,_0x5e2ac4);};}function removeListener(_0x46b46c,_0x5185c4){return function(){SmsInteractionEvents['removeListener'](_0x46b46c,_0x5185c4);};}exports['register']=function(_0x1c8b08){for(var _0x46246c=0x0,_0x18e23a=events[_0xe69e('0x5')];_0x46246c<_0x18e23a;_0x46246c++){var _0x136a66=events[_0x46246c];var _0x312454=createListener(_0xe69e('0x6')+_0x136a66,_0x1c8b08);SmsInteractionEvents['on'](_0x136a66,_0x312454);}};
\ No newline at end of file
+var _0x7f37=['./smsInteraction.events','save','remove','update','emit','removeListener','register','length','smsInteraction:'];(function(_0x16a551,_0x5ef12a){var _0x3ee8ec=function(_0x3fba9b){while(--_0x3fba9b){_0x16a551['push'](_0x16a551['shift']());}};_0x3ee8ec(++_0x5ef12a);}(_0x7f37,0xab));var _0x77f3=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x7f37[_0x5d6456];return _0x4d66c1;};'use strict';var SmsInteractionEvents=require(_0x77f3('0x0'));var events=[_0x77f3('0x1'),_0x77f3('0x2'),_0x77f3('0x3')];function createListener(_0x4ddac3,_0x3b4ff0){return function(_0x540637){_0x3b4ff0[_0x77f3('0x4')](_0x4ddac3,_0x540637);};}function removeListener(_0xe6dc8,_0x5de9e2){return function(){SmsInteractionEvents[_0x77f3('0x5')](_0xe6dc8,_0x5de9e2);};}exports[_0x77f3('0x6')]=function(_0x1286d0){for(var _0x38e7b2=0x0,_0x3b7cc7=events[_0x77f3('0x7')];_0x38e7b2<_0x3b7cc7;_0x38e7b2++){var _0x564c8d=events[_0x38e7b2];var _0xf28330=createListener(_0x77f3('0x8')+_0x564c8d,_0x1286d0);SmsInteractionEvents['on'](_0x564c8d,_0xf28330);}};
\ No newline at end of file
index 26462d5..cbfae14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa33a=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','sms','smsmessage:create','create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','util'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa33a,0xd0));var _0xaa33=function(_0x3b8a3a,_0x457048){_0x3b8a3a=_0x3b8a3a-0x0;var _0xae7efa=_0xa33a[_0x3b8a3a];return _0xae7efa;};'use strict';var multer=require(_0xaa33('0x0'));var util=require(_0xaa33('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xaa33('0x2'));var router=express[_0xaa33('0x3')]();var fs_extra=require(_0xaa33('0x4'));var auth=require(_0xaa33('0x5'));var interaction=require(_0xaa33('0x6'));var config=require(_0xaa33('0x7'));var controller=require('./smsMessage.controller');router[_0xaa33('0x8')]('/',auth[_0xaa33('0x9')](),controller[_0xaa33('0xa')]);router['get'](_0xaa33('0xb'),auth['isAuthenticated'](),controller[_0xaa33('0xc')]);router[_0xaa33('0x8')](_0xaa33('0xd'),auth['isAuthenticated'](),controller[_0xaa33('0xe')]);router[_0xaa33('0xf')]('/',auth[_0xaa33('0x9')](),interaction[_0xaa33('0x10')](_0xaa33('0x11'),_0xaa33('0x12')),controller[_0xaa33('0x13')]);router[_0xaa33('0xf')](_0xaa33('0x14'),controller[_0xaa33('0x15')]);router[_0xaa33('0x16')]('/:id',auth[_0xaa33('0x9')](),controller[_0xaa33('0x17')]);router[_0xaa33('0x16')](_0xaa33('0x18'),auth[_0xaa33('0x9')](),controller[_0xaa33('0x19')]);router[_0xaa33('0x16')](_0xaa33('0x1a'),auth['isAuthenticated'](),controller[_0xaa33('0x1b')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xaa33('0x1c')]);module[_0xaa33('0x1d')]=router;
\ No newline at end of file
+var _0xe62d=['/describe','/:id','post','tracked','sms','/:id/status','status','put','/:id/accept','accept','reject','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./smsMessage.controller','isAuthenticated','index','get'];(function(_0x215c7f,_0x445791){var _0x5e0d70=function(_0x998e7a){while(--_0x998e7a){_0x215c7f['push'](_0x215c7f['shift']());}};_0x5e0d70(++_0x445791);}(_0xe62d,0xb6));var _0xde62=function(_0x55cf47,_0x3d037b){_0x55cf47=_0x55cf47-0x0;var _0x42bf2b=_0xe62d[_0x55cf47];return _0x42bf2b;};'use strict';var multer=require('multer');var util=require(_0xde62('0x0'));var path=require('path');var timeout=require(_0xde62('0x1'));var express=require(_0xde62('0x2'));var router=express[_0xde62('0x3')]();var fs_extra=require(_0xde62('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xde62('0x5'));var config=require('../../config/environment');var controller=require(_0xde62('0x6'));router['get']('/',auth[_0xde62('0x7')](),controller[_0xde62('0x8')]);router[_0xde62('0x9')](_0xde62('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xde62('0x9')](_0xde62('0xb'),auth[_0xde62('0x7')](),controller['show']);router[_0xde62('0xc')]('/',auth[_0xde62('0x7')](),interaction[_0xde62('0xd')](_0xde62('0xe'),'smsmessage:create'),controller['create']);router[_0xde62('0xc')](_0xde62('0xf'),controller[_0xde62('0x10')]);router[_0xde62('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xde62('0x11')](_0xde62('0x12'),auth[_0xde62('0x7')](),controller[_0xde62('0x13')]);router[_0xde62('0x11')]('/:id/reject',auth[_0xde62('0x7')](),controller[_0xde62('0x14')]);router[_0xde62('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xde62('0x16')]);module[_0xde62('0x17')]=router;
\ No newline at end of file
index 02228b3..52950c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f42=['STRING','DATE','BOOLEAN','sequelize','exports','TEXT','medium','ENUM','out'];(function(_0x33374d,_0x2dd106){var _0x9a23bb=function(_0x10ef87){while(--_0x10ef87){_0x33374d['push'](_0x33374d['shift']());}};_0x9a23bb(++_0x2dd106);}(_0x0f42,0xc9));var _0x20f4=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0f42[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require(_0x20f4('0x0'));module[_0x20f4('0x1')]={'body':{'type':Sequelize[_0x20f4('0x2')](_0x20f4('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x20f4('0x4')]('in','out'),'defaultValue':_0x20f4('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x20f4('0x6')](0xbe)},'phone':{'type':Sequelize[_0x20f4('0x6')]},'readAt':{'type':Sequelize[_0x20f4('0x7')]},'secret':{'type':Sequelize[_0x20f4('0x8')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x4b31=['STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x393b0a,_0x56e28a){var _0xfd8fb4=function(_0x41648b){while(--_0x41648b){_0x393b0a['push'](_0x393b0a['shift']());}};_0xfd8fb4(++_0x56e28a);}(_0x4b31,0x1c4));var _0x14b3=function(_0xf60cd0,_0x34bf81){_0xf60cd0=_0xf60cd0-0x0;var _0x32ad56=_0x4b31[_0xf60cd0];return _0x32ad56;};'use strict';var Sequelize=require(_0x14b3('0x0'));module[_0x14b3('0x1')]={'body':{'type':Sequelize[_0x14b3('0x2')](_0x14b3('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x14b3('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x14b3('0x5')]('in','out'),'defaultValue':_0x14b3('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x14b3('0x7')](0xbe)},'phone':{'type':Sequelize[_0x14b3('0x7')]},'readAt':{'type':Sequelize[_0x14b3('0x8')]},'secret':{'type':Sequelize[_0x14b3('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x14b3('0x7')]},'providerResponse':{'type':Sequelize[_0x14b3('0x2')]}};
\ No newline at end of file
index d6077f8..8bb3d5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f68=['SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','contact','SmsAccount','SmsAccountId','debug','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','indexOf','sent','delivered','Status','infobip','results','groupName','DELIVERED','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','redis','./smsMessage.socket','register','jayson/promise','client','http','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','json','offset','undefined','limit','Content-Range','save','update','destroy','then','sendStatus','stack','name','send','index','map','SmsMessage','rawAttributes','type','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','include','findAll','rows','show','params','includeAll','options','find','create','body','describe','accept','sms','format','UserId','get','SmsInteraction','SmsInteractionId','isNil','interaction','user','role','null','sequelize','Sequelize','QueryTypes','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','../../config/logger','sms-interactions','reject','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage'];(function(_0x4cba0c,_0x5cf192){var _0x4c66e3=function(_0x419abe){while(--_0x419abe){_0x4cba0c['push'](_0x4cba0c['shift']());}};_0x4c66e3(++_0x5cf192);}(_0x2f68,0x12b));var _0x82f6=function(_0x290f16,_0x2f1c75){_0x290f16=_0x290f16-0x0;var _0x16c352=_0x2f68[_0x290f16];return _0x16c352;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x82f6('0x0'));var zipdir=require(_0x82f6('0x1'));var jsonpatch=require(_0x82f6('0x2'));var rp=require(_0x82f6('0x3'));var moment=require(_0x82f6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x82f6('0x5'));var util=require(_0x82f6('0x6'));var path=require(_0x82f6('0x7'));var sox=require(_0x82f6('0x8'));var csv=require(_0x82f6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x82f6('0xa'));var squel=require('squel');var crypto=require(_0x82f6('0xb'));var jsforce=require(_0x82f6('0xc'));var deskjs=require(_0x82f6('0xd'));var toCsv=require('to-csv');var querystring=require(_0x82f6('0xe'));var Papa=require(_0x82f6('0xf'));var Redis=require(_0x82f6('0x10'));var authService=require(_0x82f6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x82f6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x82f6('0x13'));var utils=require('../../config/utils');var config=require(_0x82f6('0x14'));var licenseUtil=require(_0x82f6('0x15'));var db=require('../../mysqldb')['db'];config[_0x82f6('0x16')]=_['defaults'](config[_0x82f6('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x82f6('0x16')]));require(_0x82f6('0x17'))[_0x82f6('0x18')](socket);var jayson=require(_0x82f6('0x19'));var client=jayson[_0x82f6('0x1a')][_0x82f6('0x1b')]({'port':0x232c});var client9002=jayson[_0x82f6('0x1a')][_0x82f6('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x447987,_0x42ef53,_0x3ca73f,_0x446bf1){return new BPromise(function(_0x412d1f,_0x32e295){var _0x25df8c=_0x446bf1||client;return _0x25df8c[_0x82f6('0x1c')](_0x447987,_0x3ca73f)['then'](function(_0x2a16e2){logger[_0x82f6('0x1d')](_0x82f6('0x1e'),_0x42ef53,_0x82f6('0x1f'));logger['debug'](_0x82f6('0x20'),_0x42ef53,_0x82f6('0x1f'),JSON[_0x82f6('0x21')](_0x2a16e2));if(_0x2a16e2[_0x82f6('0x22')]){if(_0x2a16e2['error'][_0x82f6('0x23')]===0x1f4){logger[_0x82f6('0x22')]('SmsMessage,\x20%s,\x20%s',_0x42ef53,_0x2a16e2[_0x82f6('0x22')][_0x82f6('0x24')]);return _0x32e295(_0x2a16e2[_0x82f6('0x22')]['message']);}logger[_0x82f6('0x22')]('SmsMessage,\x20%s,\x20%s',_0x42ef53,_0x2a16e2[_0x82f6('0x22')]['message']);return _0x412d1f(_0x2a16e2[_0x82f6('0x22')][_0x82f6('0x24')]);}else{logger[_0x82f6('0x1d')](_0x82f6('0x1e'),_0x42ef53,_0x82f6('0x1f'));_0x412d1f(_0x2a16e2['result'][_0x82f6('0x24')]);}})[_0x82f6('0x25')](function(_0x574713){logger[_0x82f6('0x22')]('SmsMessage,\x20%s,\x20%s',_0x42ef53,_0x574713);_0x32e295(_0x574713);});});}function respondWithStatusCode(_0x248c3b,_0x3954e5){_0x3954e5=_0x3954e5||0xcc;return function(_0x15069b){if(_0x15069b){return _0x248c3b['sendStatus'](_0x3954e5);}return _0x248c3b[_0x82f6('0x26')](_0x3954e5)[_0x82f6('0x27')]();};}function respondWithResult(_0x547ce7,_0x3350f2){_0x3350f2=_0x3350f2||0xc8;return function(_0x1856af){if(_0x1856af){return _0x547ce7[_0x82f6('0x26')](_0x3350f2)[_0x82f6('0x28')](_0x1856af);}};}function respondWithFilteredResult(_0x285040,_0x4fde1b){return function(_0x164266){if(_0x164266){var _0x230998=typeof _0x4fde1b[_0x82f6('0x29')]===_0x82f6('0x2a')&&typeof _0x4fde1b[_0x82f6('0x2b')]==='undefined';var _0x18b21a=_0x164266['count'];var _0x3cb2de=_0x230998?0x0:_0x4fde1b['offset'];var _0x1fbfe1=_0x230998?_0x164266['count']:_0x4fde1b[_0x82f6('0x29')]+_0x4fde1b[_0x82f6('0x2b')];var _0x2a86a1;if(_0x1fbfe1>=_0x18b21a){_0x1fbfe1=_0x18b21a;_0x2a86a1=0xc8;}else{_0x2a86a1=0xce;}_0x285040[_0x82f6('0x26')](_0x2a86a1);return _0x285040['set'](_0x82f6('0x2c'),_0x3cb2de+'-'+_0x1fbfe1+'/'+_0x18b21a)['json'](_0x164266);}return null;};}function patchUpdates(_0x17dd31){return function(_0x239506){try{jsonpatch['apply'](_0x239506,_0x17dd31,!![]);}catch(_0x35ca2b){return BPromise['reject'](_0x35ca2b);}return _0x239506[_0x82f6('0x2d')]();};}function saveUpdates(_0x3d79cd,_0xcad2ba){return function(_0x3dcfbe){if(_0x3dcfbe){return _0x3dcfbe[_0x82f6('0x2e')](_0x3d79cd)['then'](function(_0x4ba8d5){return _0x4ba8d5;});}return null;};}function removeEntity(_0x19e40e,_0x41a60b){return function(_0x38185a){if(_0x38185a){return _0x38185a[_0x82f6('0x2f')]()[_0x82f6('0x30')](function(){_0x19e40e[_0x82f6('0x26')](0xcc)[_0x82f6('0x27')]();});}};}function handleEntityNotFound(_0x321b3b,_0x47e8a5){return function(_0x35868d){if(!_0x35868d){_0x321b3b[_0x82f6('0x31')](0x194);}return _0x35868d;};}function handleError(_0x67889f,_0x4f2fa6){_0x4f2fa6=_0x4f2fa6||0x1f4;return function(_0x2887bc){logger[_0x82f6('0x22')](_0x2887bc[_0x82f6('0x32')]);if(_0x2887bc[_0x82f6('0x33')]){delete _0x2887bc[_0x82f6('0x33')];}_0x67889f[_0x82f6('0x26')](_0x4f2fa6)[_0x82f6('0x34')](_0x2887bc);};}exports[_0x82f6('0x35')]=function(_0xb35b74,_0x547959){var _0x209edd={},_0x56d23d={},_0x443990={'count':0x0,'rows':[]};var _0xb9c20c=_[_0x82f6('0x36')](db[_0x82f6('0x37')][_0x82f6('0x38')],function(_0x19cb37){return{'name':_0x19cb37['fieldName'],'type':_0x19cb37[_0x82f6('0x39')][_0x82f6('0x3a')]};});_0x56d23d[_0x82f6('0x3b')]=_[_0x82f6('0x36')](_0xb9c20c,_0x82f6('0x33'));_0x56d23d['query']=_[_0x82f6('0x3c')](_0xb35b74['query']);_0x56d23d[_0x82f6('0x3d')]=_['intersection'](_0x56d23d[_0x82f6('0x3b')],_0x56d23d[_0x82f6('0x3e')]);_0x209edd[_0x82f6('0x3f')]=_[_0x82f6('0x40')](_0x56d23d['model'],qs['fields'](_0xb35b74[_0x82f6('0x3e')][_0x82f6('0x41')]));_0x209edd[_0x82f6('0x3f')]=_0x209edd[_0x82f6('0x3f')][_0x82f6('0x42')]?_0x209edd[_0x82f6('0x3f')]:_0x56d23d[_0x82f6('0x3b')];if(!_0xb35b74['query'][_0x82f6('0x43')](_0x82f6('0x44'))){_0x209edd[_0x82f6('0x2b')]=qs[_0x82f6('0x2b')](_0xb35b74['query'][_0x82f6('0x2b')]);_0x209edd[_0x82f6('0x29')]=qs[_0x82f6('0x29')](_0xb35b74[_0x82f6('0x3e')][_0x82f6('0x29')]);}_0x209edd[_0x82f6('0x45')]=qs[_0x82f6('0x46')](_0xb35b74[_0x82f6('0x3e')][_0x82f6('0x46')]);_0x209edd[_0x82f6('0x47')]=qs[_0x82f6('0x3d')](_[_0x82f6('0x48')](_0xb35b74[_0x82f6('0x3e')],_0x56d23d[_0x82f6('0x3d')]),_0xb9c20c);if(_0xb35b74[_0x82f6('0x3e')]['filter']){_0x209edd['where']=_[_0x82f6('0x49')](_0x209edd['where'],{'$or':_[_0x82f6('0x36')](_0xb9c20c,function(_0x2689a9){if(_0x2689a9[_0x82f6('0x39')]!=='VIRTUAL'){var _0x129a32={};_0x129a32[_0x2689a9[_0x82f6('0x33')]]={'$like':'%'+_0xb35b74['query']['filter']+'%'};return _0x129a32;}})});}_0x209edd=_[_0x82f6('0x49')]({},_0x209edd,_0xb35b74['options']);var _0x52ea1a={'where':_0x209edd[_0x82f6('0x47')]};return db['SmsMessage']['count'](_0x52ea1a)[_0x82f6('0x30')](function(_0x56e889){_0x443990['count']=_0x56e889;if(_0xb35b74[_0x82f6('0x3e')]['includeAll']){_0x209edd[_0x82f6('0x4a')]=[{'all':!![]}];}return db[_0x82f6('0x37')][_0x82f6('0x4b')](_0x209edd);})[_0x82f6('0x30')](function(_0x3d7b74){_0x443990[_0x82f6('0x4c')]=_0x3d7b74;return _0x443990;})['then'](respondWithFilteredResult(_0x547959,_0x209edd))['catch'](handleError(_0x547959,null));};exports[_0x82f6('0x4d')]=function(_0x334853,_0x27a312){var _0x3caab1={'raw':!![],'where':{'id':_0x334853[_0x82f6('0x4e')]['id']}},_0x1c0223={};_0x1c0223['model']=_[_0x82f6('0x3c')](db[_0x82f6('0x37')][_0x82f6('0x38')]);_0x1c0223['query']=_['keys'](_0x334853['query']);_0x1c0223['filters']=_['intersection'](_0x1c0223[_0x82f6('0x3b')],_0x1c0223[_0x82f6('0x3e')]);_0x3caab1[_0x82f6('0x3f')]=_[_0x82f6('0x40')](_0x1c0223[_0x82f6('0x3b')],qs[_0x82f6('0x41')](_0x334853[_0x82f6('0x3e')][_0x82f6('0x41')]));_0x3caab1[_0x82f6('0x3f')]=_0x3caab1[_0x82f6('0x3f')][_0x82f6('0x42')]?_0x3caab1[_0x82f6('0x3f')]:_0x1c0223['model'];if(_0x334853[_0x82f6('0x3e')][_0x82f6('0x4f')]){_0x3caab1[_0x82f6('0x4a')]=[{'all':!![]}];}_0x3caab1=_[_0x82f6('0x49')]({},_0x3caab1,_0x334853[_0x82f6('0x50')]);return db[_0x82f6('0x37')][_0x82f6('0x51')](_0x3caab1)[_0x82f6('0x30')](handleEntityNotFound(_0x27a312,null))[_0x82f6('0x30')](respondWithResult(_0x27a312,null))[_0x82f6('0x25')](handleError(_0x27a312,null));};exports['create']=function(_0x407a29,_0x545be0){return db['SmsMessage'][_0x82f6('0x52')](_0x407a29[_0x82f6('0x53')],{})['then'](respondWithResult(_0x545be0,0xc9))[_0x82f6('0x25')](handleError(_0x545be0,null));};exports['update']=function(_0x1fcaaf,_0x3ae5fd){if(_0x1fcaaf[_0x82f6('0x53')]['id']){delete _0x1fcaaf[_0x82f6('0x53')]['id'];}return db[_0x82f6('0x37')][_0x82f6('0x51')]({'where':{'id':_0x1fcaaf[_0x82f6('0x4e')]['id']}})[_0x82f6('0x30')](handleEntityNotFound(_0x3ae5fd,null))[_0x82f6('0x30')](saveUpdates(_0x1fcaaf[_0x82f6('0x53')],null))['then'](respondWithResult(_0x3ae5fd,null))[_0x82f6('0x25')](handleError(_0x3ae5fd,null));};exports['destroy']=function(_0x2b566b,_0x416d05){return db[_0x82f6('0x37')][_0x82f6('0x51')]({'where':{'id':_0x2b566b[_0x82f6('0x4e')]['id']}})[_0x82f6('0x30')](handleEntityNotFound(_0x416d05,null))[_0x82f6('0x30')](removeEntity(_0x416d05,null))[_0x82f6('0x25')](handleError(_0x416d05,null));};exports[_0x82f6('0x54')]=function(_0x430088,_0x87a2ee){return db['SmsMessage'][_0x82f6('0x54')]()[_0x82f6('0x30')](respondWithResult(_0x87a2ee,null))[_0x82f6('0x25')](handleError(_0x87a2ee,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports[_0x82f6('0x55')]=function(_0x1401bc,_0x3019b2,_0x129fea){var _0x3ce103={'agent':{},'channel':_0x82f6('0x56')};if(_0x1401bc[_0x82f6('0x53')]['id']){delete _0x1401bc[_0x82f6('0x53')]['id'];}_0x1401bc[_0x82f6('0x53')]['read']=!![];_0x1401bc[_0x82f6('0x53')]['readAt']=moment()[_0x82f6('0x57')]('YYYY-MM-DD\x20HH:mm:ss');_0x1401bc[_0x82f6('0x53')][_0x82f6('0x58')]=_0x1401bc[_0x82f6('0x53')][_0x82f6('0x58')]||_0x1401bc['user']['id'];_0x3ce103['agent']['id']=_0x1401bc[_0x82f6('0x53')][_0x82f6('0x58')];return db[_0x82f6('0x37')][_0x82f6('0x51')]({'where':{'id':_0x1401bc[_0x82f6('0x4e')]['id'],'UserId':null}})[_0x82f6('0x30')](handleEntityNotFound(_0x3019b2,null))['then'](saveUpdates(_0x1401bc[_0x82f6('0x53')],null))[_0x82f6('0x30')](function(_0x58702e){if(_0x58702e){_0x3ce103['message']=_0x58702e[_0x82f6('0x59')]({'plain':!![]});return db[_0x82f6('0x5a')][_0x82f6('0x51')]({'where':{'id':_0x58702e[_0x82f6('0x5b')]}});}return null;})['then'](handleEntityNotFound(_0x3019b2,null))[_0x82f6('0x30')](function(_0x1acea0){if(_0x1acea0){return _0x1acea0[_0x82f6('0x2e')]({'UserId':_0x1401bc[_0x82f6('0x53')][_0x82f6('0x58')],'read1stAt':_[_0x82f6('0x5c')](_0x1acea0['read1stAt'])?moment()[_0x82f6('0x57')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x82f6('0x30')](function(_0x5664f3){if(_0x5664f3){_0x3ce103[_0x82f6('0x5d')]=_0x5664f3[_0x82f6('0x59')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1401bc['user']['id'],_0x1401bc[_0x82f6('0x5e')][_0x82f6('0x33')],_0x1401bc[_0x82f6('0x5e')][_0x82f6('0x5f')],_0x3ce103[_0x82f6('0x5d')]['id'],_0x1401bc[_0x82f6('0x53')]?JSON[_0x82f6('0x21')](_0x1401bc[_0x82f6('0x53')]):_0x82f6('0x60'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x3ce103);}return null;})[_0x82f6('0x30')](function(_0x2ef543){var _0x5e631a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2ef543[_0x82f6('0x24')]['ContactId'];return db[_0x82f6('0x61')][_0x82f6('0x3e')](_0x5e631a,{'type':db[_0x82f6('0x62')][_0x82f6('0x63')]['SELECT'],'raw':!![]})[_0x82f6('0x30')](function(_0x2f0984){return _0x2f0984;});})[_0x82f6('0x30')](function(_0x21efb0){if(_0x21efb0){_0x3ce103[_0x82f6('0x24')]['contact']=_0x21efb0[0x0];if(!_0x1401bc[_0x82f6('0x53')]['UserId'])return;return db[_0x82f6('0x64')][_0x82f6('0x51')]({'where':{'id':_0x1401bc[_0x82f6('0x53')][_0x82f6('0x58')],'role':_0x82f6('0x65')},'attributes':['id','name',_0x82f6('0x66'),_0x82f6('0x67'),_0x82f6('0x68')],'raw':!![]});}return null;})[_0x82f6('0x30')](function(_0x1514aa){if(!_0x1514aa)return null;_0x3ce103[_0x82f6('0x24')][_0x82f6('0x65')]=_0x1514aa;return _0x3ce103;})[_0x82f6('0x30')](function(_0x391ad5){if(_0x391ad5){if(_0x1401bc[_0x82f6('0x53')][_0x82f6('0x69')]){_0x3ce103[_0x82f6('0x24')][_0x82f6('0x6a')]=util[_0x82f6('0x57')](_0x82f6('0x6b'),_0x1401bc[_0x82f6('0x5e')][_0x82f6('0x33')]);_0x3ce103[_0x82f6('0x24')][_0x82f6('0x6c')]=_0x3ce103['channel'];_0x3ce103[_0x82f6('0x24')][_0x82f6('0x6d')]=_0x3ce103[_0x82f6('0x6c')];_0x3ce103['message'][_0x82f6('0x6e')]=_0x82f6('0x55');return respondWithRpcPromise(_0x82f6('0x6f'),_0x82f6('0x6f'),{'event':'acceptmessage','message':_0x3ce103[_0x82f6('0x24')]},client9002)[_0x82f6('0x30')](function(){return _0x3ce103;});}return _0x3ce103;}return null;})['then'](respondWithResult(_0x3019b2,null))['catch'](handleError(_0x3019b2,null));};var interaction_log=require(_0x82f6('0x70'))(_0x82f6('0x71'));exports[_0x82f6('0x72')]=function(_0x3bc42a,_0x399b18,_0x5959e4){var _0x4f8463={'agent':{},'channel':_0x82f6('0x56')};if(_0x3bc42a['body']['id']){delete _0x3bc42a[_0x82f6('0x53')]['id'];}_0x3bc42a['body'][_0x82f6('0x58')]=_0x3bc42a[_0x82f6('0x53')]['UserId']||_0x3bc42a[_0x82f6('0x5e')]['id'];_0x4f8463[_0x82f6('0x65')]['id']=_0x3bc42a['body'][_0x82f6('0x58')];return db[_0x82f6('0x37')][_0x82f6('0x51')]({'where':{'id':_0x3bc42a[_0x82f6('0x4e')]['id'],'UserId':null}})[_0x82f6('0x30')](handleEntityNotFound(_0x399b18,null))[_0x82f6('0x30')](function(_0x5022d4){if(_0x5022d4){_0x4f8463['message']=_0x5022d4[_0x82f6('0x59')]({'plain':!![]});return db[_0x82f6('0x5a')]['find']({'where':{'id':_0x5022d4['SmsInteractionId']}});}return null;})[_0x82f6('0x30')](handleEntityNotFound(_0x399b18,null))[_0x82f6('0x30')](function(_0x1e8683){if(_0x1e8683){_0x4f8463['interaction']=_0x1e8683[_0x82f6('0x59')]({'plain':!![]});interaction_log[_0x82f6('0x1d')](_0x82f6('0x73'),_0x3bc42a['user']['id'],_0x3bc42a[_0x82f6('0x5e')][_0x82f6('0x33')],_0x3bc42a[_0x82f6('0x5e')][_0x82f6('0x5f')],_0x4f8463[_0x82f6('0x5d')]['id'],_0x3bc42a[_0x82f6('0x53')]?JSON[_0x82f6('0x21')](_0x3bc42a['body']):_0x82f6('0x60'));return respondWithRpcPromise(_0x82f6('0x74'),_0x82f6('0x75'),_0x4f8463);}return null;})[_0x82f6('0x30')](function(_0x34fd0c){var _0x5d715a=_0x82f6('0x76')+_0x34fd0c['message'][_0x82f6('0x77')];return db['sequelize']['query'](_0x5d715a,{'type':db[_0x82f6('0x62')]['QueryTypes']['SELECT'],'raw':!![]})[_0x82f6('0x30')](function(_0x1ffc0b){return _0x1ffc0b;});})[_0x82f6('0x30')](function(_0xf829cd){if(_0xf829cd){_0x4f8463[_0x82f6('0x24')][_0x82f6('0x78')]=_0xf829cd[0x0];if(!_0x3bc42a[_0x82f6('0x53')][_0x82f6('0x58')])return;return db[_0x82f6('0x64')][_0x82f6('0x51')]({'where':{'id':_0x3bc42a['body']['UserId'],'role':_0x82f6('0x65')},'attributes':['id','name','fullname',_0x82f6('0x67'),'internal'],'raw':!![]});}return null;})[_0x82f6('0x30')](function(_0x2c0fca){if(!_0x2c0fca)return null;_0x4f8463[_0x82f6('0x24')][_0x82f6('0x65')]=_0x2c0fca;return _0x4f8463;})[_0x82f6('0x30')](function(_0x2d8696){if(_0x2d8696){_0x2d8696[_0x82f6('0x24')]['interface']=util[_0x82f6('0x57')](_0x82f6('0x6b'),_0x3bc42a[_0x82f6('0x5e')][_0x82f6('0x33')]);_0x2d8696[_0x82f6('0x24')][_0x82f6('0x6c')]=_0x4f8463['channel'];_0x2d8696[_0x82f6('0x24')][_0x82f6('0x6d')]=_0x4f8463['channel'];_0x2d8696[_0x82f6('0x24')][_0x82f6('0x6e')]=_0x82f6('0x72');respondWithRpcPromise(_0x82f6('0x6f'),_0x82f6('0x6f'),{'event':'rejectmessage','message':_0x2d8696[_0x82f6('0x24')]},client9002);return _0x4f8463;}return null;})['then'](respondWithResult(_0x399b18,null))[_0x82f6('0x25')](handleError(_0x399b18,null));};exports[_0x82f6('0x26')]=function(_0x5c86b8,_0x3cf092,_0x242449){if(_0x5c86b8[_0x82f6('0x53')]['id']){delete _0x5c86b8['body']['id'];}var _0x146b53;return db[_0x82f6('0x37')]['find']({'where':{'id':_0x5c86b8[_0x82f6('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3cf092,null))[_0x82f6('0x30')](function(_0x49f926){if(_0x49f926){_0x146b53=_0x49f926;return db[_0x82f6('0x79')][_0x82f6('0x51')]({'where':{'id':_0x49f926[_0x82f6('0x7a')]}});}})[_0x82f6('0x30')](handleEntityNotFound(_0x3cf092,null))[_0x82f6('0x30')](function(_0x54ac7b){if(_0x54ac7b){logger[_0x82f6('0x7b')](_0x82f6('0x20'),'status',_0x82f6('0x7c'),_0x54ac7b[_0x82f6('0x39')],util[_0x82f6('0x7d')](_0x5c86b8['body'],{'showHidden':![],'depth':null}));switch(_0x54ac7b[_0x82f6('0x39')]){case _0x82f6('0x7e'):if(_0x5c86b8['body'][_0x82f6('0x7f')]&&_0x5c86b8[_0x82f6('0x53')][_0x82f6('0x7f')]===_0x146b53[_0x82f6('0x80')]){return _0x146b53['update']({'read':!![]});}else{logger[_0x82f6('0x22')](_0x82f6('0x81'),_0x82f6('0x26'),_0x82f6('0x7e'),util['inspect'](_0x5c86b8[_0x82f6('0x53')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x5c86b8[_0x82f6('0x53')]['MessageUUID']&&_0x5c86b8['body'][_0x82f6('0x82')]===_0x146b53['messageId']&&_[_0x82f6('0x83')]([_0x82f6('0x84'),_0x82f6('0x85')],_0x5c86b8['body'][_0x82f6('0x86')])>=0x0){return _0x146b53['update']({'read':!![]});}else{logger[_0x82f6('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x82f6('0x26'),'plivio',util['inspect'](_0x5c86b8['body'],{'showHidden':![],'depth':null}));}break;case _0x82f6('0x87'):var _0x5144fe=_0x5c86b8[_0x82f6('0x53')][_0x82f6('0x88')][0x0];if(_0x5144fe[_0x82f6('0x26')][_0x82f6('0x89')]===_0x82f6('0x8a')){return _0x146b53[_0x82f6('0x2e')]({'read':!![]});}else{logger[_0x82f6('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x82f6('0x26'),'infobip',util['inspect'](_0x5c86b8['body'],{'showHidden':![],'depth':null}));}break;}return _0x146b53;}})[_0x82f6('0x30')](respondWithResult(_0x3cf092,null))['catch'](handleError(_0x3cf092,null));};
\ No newline at end of file
+var _0x1f3c=['include','findAll','rows','show','params','fields','create','body','find','describe','sms-interactions','accept','format','YYYY-MM-DD\x20HH:mm:ss','agent','UserId','SmsInteractionId','isNil','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','fullname','email','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','reject','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','sequelize','contact','User','SIP/%s','SmsAccount','received\x20delivery\x20report\x20from','type','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','to-csv','fs-extra','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','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','catch','sendStatus','end','json','offset','limit','count','status','Content-Range','apply','save','update','destroy','name','send','index','map','SmsMessage','rawAttributes','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','includeAll'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1f3c,0xd7));var _0xc1f3=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x1f3c[_0x243b2f];return _0xcb3c2d;};'use strict';var emlformat=require(_0xc1f3('0x0'));var rimraf=require(_0xc1f3('0x1'));var zipdir=require(_0xc1f3('0x2'));var jsonpatch=require(_0xc1f3('0x3'));var rp=require(_0xc1f3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc1f3('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc1f3('0x6'));var _=require(_0xc1f3('0x7'));var squel=require('squel');var crypto=require(_0xc1f3('0x8'));var jsforce=require(_0xc1f3('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xc1f3('0x5'));var querystring=require(_0xc1f3('0xa'));var Papa=require(_0xc1f3('0xb'));var Redis=require(_0xc1f3('0xc'));var authService=require(_0xc1f3('0xd'));var qs=require(_0xc1f3('0xe'));var as=require(_0xc1f3('0xf'));var hardwareService=require(_0xc1f3('0x10'));var logger=require(_0xc1f3('0x11'))(_0xc1f3('0x12'));var utils=require(_0xc1f3('0x13'));var config=require(_0xc1f3('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xc1f3('0x15'))['db'];config['redis']=_[_0xc1f3('0x16')](config['redis'],{'host':_0xc1f3('0x17'),'port':0x18eb});var socket=require(_0xc1f3('0x18'))(new Redis(config[_0xc1f3('0x19')]));require(_0xc1f3('0x1a'))[_0xc1f3('0x1b')](socket);var jayson=require(_0xc1f3('0x1c'));var client=jayson[_0xc1f3('0x1d')][_0xc1f3('0x1e')]({'port':0x232c});var client9002=jayson[_0xc1f3('0x1d')][_0xc1f3('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3aee70,_0xd96b1a,_0x1d028c,_0x224405){return new BPromise(function(_0x1d0bbf,_0x18718f){var _0x292200=_0x224405||client;return _0x292200[_0xc1f3('0x1f')](_0x3aee70,_0x1d028c)[_0xc1f3('0x20')](function(_0x384e34){logger[_0xc1f3('0x21')](_0xc1f3('0x22'),_0xd96b1a,_0xc1f3('0x23'));logger[_0xc1f3('0x24')](_0xc1f3('0x25'),_0xd96b1a,_0xc1f3('0x23'),JSON[_0xc1f3('0x26')](_0x384e34));if(_0x384e34[_0xc1f3('0x27')]){if(_0x384e34[_0xc1f3('0x27')][_0xc1f3('0x28')]===0x1f4){logger[_0xc1f3('0x27')](_0xc1f3('0x22'),_0xd96b1a,_0x384e34[_0xc1f3('0x27')][_0xc1f3('0x29')]);return _0x18718f(_0x384e34[_0xc1f3('0x27')]['message']);}logger[_0xc1f3('0x27')](_0xc1f3('0x22'),_0xd96b1a,_0x384e34[_0xc1f3('0x27')][_0xc1f3('0x29')]);return _0x1d0bbf(_0x384e34['error']['message']);}else{logger['info'](_0xc1f3('0x22'),_0xd96b1a,_0xc1f3('0x23'));_0x1d0bbf(_0x384e34['result']['message']);}})[_0xc1f3('0x2a')](function(_0x32cc58){logger[_0xc1f3('0x27')](_0xc1f3('0x22'),_0xd96b1a,_0x32cc58);_0x18718f(_0x32cc58);});});}function respondWithStatusCode(_0x247273,_0xca9551){_0xca9551=_0xca9551||0xcc;return function(_0x4d8b22){if(_0x4d8b22){return _0x247273[_0xc1f3('0x2b')](_0xca9551);}return _0x247273['status'](_0xca9551)[_0xc1f3('0x2c')]();};}function respondWithResult(_0x5a308f,_0x3d6ffa){_0x3d6ffa=_0x3d6ffa||0xc8;return function(_0xe82fda){if(_0xe82fda){return _0x5a308f['status'](_0x3d6ffa)[_0xc1f3('0x2d')](_0xe82fda);}};}function respondWithFilteredResult(_0xa634b2,_0x48d8d9){return function(_0x5134e2){if(_0x5134e2){var _0xba1594=typeof _0x48d8d9[_0xc1f3('0x2e')]==='undefined'&&typeof _0x48d8d9[_0xc1f3('0x2f')]==='undefined';var _0x5c496b=_0x5134e2[_0xc1f3('0x30')];var _0x1f93eb=_0xba1594?0x0:_0x48d8d9['offset'];var _0x29e377=_0xba1594?_0x5134e2[_0xc1f3('0x30')]:_0x48d8d9[_0xc1f3('0x2e')]+_0x48d8d9[_0xc1f3('0x2f')];var _0x4511dc;if(_0x29e377>=_0x5c496b){_0x29e377=_0x5c496b;_0x4511dc=0xc8;}else{_0x4511dc=0xce;}_0xa634b2[_0xc1f3('0x31')](_0x4511dc);return _0xa634b2['set'](_0xc1f3('0x32'),_0x1f93eb+'-'+_0x29e377+'/'+_0x5c496b)[_0xc1f3('0x2d')](_0x5134e2);}return null;};}function patchUpdates(_0x3a682e){return function(_0x376188){try{jsonpatch[_0xc1f3('0x33')](_0x376188,_0x3a682e,!![]);}catch(_0x3d3651){return BPromise['reject'](_0x3d3651);}return _0x376188[_0xc1f3('0x34')]();};}function saveUpdates(_0x5ad983,_0x59cc66){return function(_0x39385f){if(_0x39385f){return _0x39385f[_0xc1f3('0x35')](_0x5ad983)[_0xc1f3('0x20')](function(_0x12f945){return _0x12f945;});}return null;};}function removeEntity(_0x5e058f,_0x76c393){return function(_0xbfc61b){if(_0xbfc61b){return _0xbfc61b[_0xc1f3('0x36')]()['then'](function(){_0x5e058f[_0xc1f3('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56eb94,_0x24c9ab){return function(_0x285b7e){if(!_0x285b7e){_0x56eb94[_0xc1f3('0x2b')](0x194);}return _0x285b7e;};}function handleError(_0x14f688,_0x5b8762){_0x5b8762=_0x5b8762||0x1f4;return function(_0x36494e){logger[_0xc1f3('0x27')](_0x36494e['stack']);if(_0x36494e['name']){delete _0x36494e[_0xc1f3('0x37')];}_0x14f688[_0xc1f3('0x31')](_0x5b8762)[_0xc1f3('0x38')](_0x36494e);};}exports[_0xc1f3('0x39')]=function(_0x17640c,_0x365654){var _0x255bc9={},_0x23c53b={},_0x4d71cc={'count':0x0,'rows':[]};var _0x30b90b=_[_0xc1f3('0x3a')](db[_0xc1f3('0x3b')][_0xc1f3('0x3c')],function(_0x28c2ab){return{'name':_0x28c2ab['fieldName'],'type':_0x28c2ab['type'][_0xc1f3('0x3d')]};});_0x23c53b[_0xc1f3('0x3e')]=_[_0xc1f3('0x3a')](_0x30b90b,_0xc1f3('0x37'));_0x23c53b[_0xc1f3('0x3f')]=_[_0xc1f3('0x40')](_0x17640c[_0xc1f3('0x3f')]);_0x23c53b['filters']=_[_0xc1f3('0x41')](_0x23c53b[_0xc1f3('0x3e')],_0x23c53b['query']);_0x255bc9[_0xc1f3('0x42')]=_[_0xc1f3('0x41')](_0x23c53b[_0xc1f3('0x3e')],qs['fields'](_0x17640c[_0xc1f3('0x3f')]['fields']));_0x255bc9[_0xc1f3('0x42')]=_0x255bc9[_0xc1f3('0x42')][_0xc1f3('0x43')]?_0x255bc9[_0xc1f3('0x42')]:_0x23c53b[_0xc1f3('0x3e')];if(!_0x17640c[_0xc1f3('0x3f')][_0xc1f3('0x44')](_0xc1f3('0x45'))){_0x255bc9[_0xc1f3('0x2f')]=qs['limit'](_0x17640c['query'][_0xc1f3('0x2f')]);_0x255bc9[_0xc1f3('0x2e')]=qs[_0xc1f3('0x2e')](_0x17640c[_0xc1f3('0x3f')][_0xc1f3('0x2e')]);}_0x255bc9[_0xc1f3('0x46')]=qs[_0xc1f3('0x47')](_0x17640c['query'][_0xc1f3('0x47')]);_0x255bc9[_0xc1f3('0x48')]=qs[_0xc1f3('0x49')](_[_0xc1f3('0x4a')](_0x17640c['query'],_0x23c53b[_0xc1f3('0x49')]),_0x30b90b);if(_0x17640c[_0xc1f3('0x3f')]['filter']){_0x255bc9[_0xc1f3('0x48')]=_[_0xc1f3('0x4b')](_0x255bc9[_0xc1f3('0x48')],{'$or':_[_0xc1f3('0x3a')](_0x30b90b,function(_0x3a1b67){if(_0x3a1b67['type']!=='VIRTUAL'){var _0x1aa9c4={};_0x1aa9c4[_0x3a1b67['name']]={'$like':'%'+_0x17640c[_0xc1f3('0x3f')][_0xc1f3('0x4c')]+'%'};return _0x1aa9c4;}})});}_0x255bc9=_[_0xc1f3('0x4b')]({},_0x255bc9,_0x17640c[_0xc1f3('0x4d')]);var _0x5adf0d={'where':_0x255bc9[_0xc1f3('0x48')]};return db[_0xc1f3('0x3b')][_0xc1f3('0x30')](_0x5adf0d)[_0xc1f3('0x20')](function(_0x21bb48){_0x4d71cc[_0xc1f3('0x30')]=_0x21bb48;if(_0x17640c['query'][_0xc1f3('0x4e')]){_0x255bc9[_0xc1f3('0x4f')]=[{'all':!![]}];}return db['SmsMessage'][_0xc1f3('0x50')](_0x255bc9);})['then'](function(_0x556c2a){_0x4d71cc[_0xc1f3('0x51')]=_0x556c2a;return _0x4d71cc;})[_0xc1f3('0x20')](respondWithFilteredResult(_0x365654,_0x255bc9))[_0xc1f3('0x2a')](handleError(_0x365654,null));};exports[_0xc1f3('0x52')]=function(_0x226ac6,_0x4f3d36){var _0x3f3e56={'raw':!![],'where':{'id':_0x226ac6[_0xc1f3('0x53')]['id']}},_0xddadbc={};_0xddadbc[_0xc1f3('0x3e')]=_[_0xc1f3('0x40')](db[_0xc1f3('0x3b')][_0xc1f3('0x3c')]);_0xddadbc[_0xc1f3('0x3f')]=_[_0xc1f3('0x40')](_0x226ac6[_0xc1f3('0x3f')]);_0xddadbc['filters']=_[_0xc1f3('0x41')](_0xddadbc[_0xc1f3('0x3e')],_0xddadbc['query']);_0x3f3e56[_0xc1f3('0x42')]=_[_0xc1f3('0x41')](_0xddadbc[_0xc1f3('0x3e')],qs[_0xc1f3('0x54')](_0x226ac6[_0xc1f3('0x3f')]['fields']));_0x3f3e56[_0xc1f3('0x42')]=_0x3f3e56[_0xc1f3('0x42')][_0xc1f3('0x43')]?_0x3f3e56[_0xc1f3('0x42')]:_0xddadbc['model'];if(_0x226ac6[_0xc1f3('0x3f')][_0xc1f3('0x4e')]){_0x3f3e56[_0xc1f3('0x4f')]=[{'all':!![]}];}_0x3f3e56=_[_0xc1f3('0x4b')]({},_0x3f3e56,_0x226ac6['options']);return db[_0xc1f3('0x3b')]['find'](_0x3f3e56)[_0xc1f3('0x20')](handleEntityNotFound(_0x4f3d36,null))[_0xc1f3('0x20')](respondWithResult(_0x4f3d36,null))[_0xc1f3('0x2a')](handleError(_0x4f3d36,null));};exports[_0xc1f3('0x55')]=function(_0x30a98a,_0x56b13e){return db[_0xc1f3('0x3b')][_0xc1f3('0x55')](_0x30a98a[_0xc1f3('0x56')],{})[_0xc1f3('0x20')](respondWithResult(_0x56b13e,0xc9))['catch'](handleError(_0x56b13e,null));};exports['update']=function(_0x5a892e,_0x351d91){if(_0x5a892e[_0xc1f3('0x56')]['id']){delete _0x5a892e[_0xc1f3('0x56')]['id'];}return db[_0xc1f3('0x3b')]['find']({'where':{'id':_0x5a892e[_0xc1f3('0x53')]['id']}})[_0xc1f3('0x20')](handleEntityNotFound(_0x351d91,null))[_0xc1f3('0x20')](saveUpdates(_0x5a892e[_0xc1f3('0x56')],null))[_0xc1f3('0x20')](respondWithResult(_0x351d91,null))[_0xc1f3('0x2a')](handleError(_0x351d91,null));};exports[_0xc1f3('0x36')]=function(_0x1c1f98,_0x26a404){return db[_0xc1f3('0x3b')][_0xc1f3('0x57')]({'where':{'id':_0x1c1f98[_0xc1f3('0x53')]['id']}})[_0xc1f3('0x20')](handleEntityNotFound(_0x26a404,null))[_0xc1f3('0x20')](removeEntity(_0x26a404,null))['catch'](handleError(_0x26a404,null));};exports[_0xc1f3('0x58')]=function(_0x5a180a,_0x51c871){return db['SmsMessage']['describe']()[_0xc1f3('0x20')](respondWithResult(_0x51c871,null))[_0xc1f3('0x2a')](handleError(_0x51c871,null));};var interaction_log=require(_0xc1f3('0x11'))(_0xc1f3('0x59'));exports[_0xc1f3('0x5a')]=function(_0x3d014c,_0x59e3b2,_0x3ed229){var _0x1fb566={'agent':{},'channel':'sms'};if(_0x3d014c['body']['id']){delete _0x3d014c[_0xc1f3('0x56')]['id'];}_0x3d014c[_0xc1f3('0x56')]['read']=!![];_0x3d014c['body']['readAt']=moment()[_0xc1f3('0x5b')](_0xc1f3('0x5c'));_0x3d014c['body']['UserId']=_0x3d014c[_0xc1f3('0x56')]['UserId']||_0x3d014c['user']['id'];_0x1fb566[_0xc1f3('0x5d')]['id']=_0x3d014c[_0xc1f3('0x56')][_0xc1f3('0x5e')];return db[_0xc1f3('0x3b')][_0xc1f3('0x57')]({'where':{'id':_0x3d014c[_0xc1f3('0x53')]['id'],'UserId':null}})[_0xc1f3('0x20')](handleEntityNotFound(_0x59e3b2,null))[_0xc1f3('0x20')](saveUpdates(_0x3d014c[_0xc1f3('0x56')],null))[_0xc1f3('0x20')](function(_0x4858d1){if(_0x4858d1){_0x1fb566[_0xc1f3('0x29')]=_0x4858d1['get']({'plain':!![]});return db['SmsInteraction'][_0xc1f3('0x57')]({'where':{'id':_0x4858d1[_0xc1f3('0x5f')]}});}return null;})[_0xc1f3('0x20')](handleEntityNotFound(_0x59e3b2,null))['then'](function(_0x8d1afc){if(_0x8d1afc){return _0x8d1afc['update']({'UserId':_0x3d014c[_0xc1f3('0x56')][_0xc1f3('0x5e')],'read1stAt':_[_0xc1f3('0x60')](_0x8d1afc['read1stAt'])?moment()[_0xc1f3('0x5b')](_0xc1f3('0x5c')):undefined});}return null;})['then'](function(_0x1dcd45){if(_0x1dcd45){_0x1fb566[_0xc1f3('0x61')]=_0x1dcd45[_0xc1f3('0x62')]({'plain':!![]});interaction_log[_0xc1f3('0x21')](_0xc1f3('0x63'),_0x3d014c[_0xc1f3('0x64')]['id'],_0x3d014c['user']['name'],_0x3d014c[_0xc1f3('0x64')][_0xc1f3('0x65')],_0x1fb566[_0xc1f3('0x61')]['id'],_0x3d014c[_0xc1f3('0x56')]?JSON[_0xc1f3('0x26')](_0x3d014c[_0xc1f3('0x56')]):'null');return respondWithRpcPromise(_0xc1f3('0x66'),_0xc1f3('0x67'),_0x1fb566);}return null;})[_0xc1f3('0x20')](function(_0x1ea368){var _0x5a017e=_0xc1f3('0x68')+_0x1ea368['message'][_0xc1f3('0x69')];return db['sequelize']['query'](_0x5a017e,{'type':db[_0xc1f3('0x6a')][_0xc1f3('0x6b')][_0xc1f3('0x6c')],'raw':!![]})[_0xc1f3('0x20')](function(_0x3741e9){return _0x3741e9;});})[_0xc1f3('0x20')](function(_0x28988e){if(_0x28988e){_0x1fb566[_0xc1f3('0x29')]['contact']=_0x28988e[0x0];if(!_0x3d014c[_0xc1f3('0x56')][_0xc1f3('0x5e')])return;return db['User'][_0xc1f3('0x57')]({'where':{'id':_0x3d014c['body'][_0xc1f3('0x5e')],'role':_0xc1f3('0x5d')},'attributes':['id',_0xc1f3('0x37'),_0xc1f3('0x6d'),_0xc1f3('0x6e'),_0xc1f3('0x6f')],'raw':!![]});}return null;})[_0xc1f3('0x20')](function(_0x2a3c59){if(!_0x2a3c59)return null;_0x1fb566[_0xc1f3('0x29')]['agent']=_0x2a3c59;return _0x1fb566;})[_0xc1f3('0x20')](function(_0x2341d9){if(_0x2341d9){if(_0x3d014c[_0xc1f3('0x56')][_0xc1f3('0x70')]){_0x1fb566[_0xc1f3('0x29')][_0xc1f3('0x71')]=util['format']('SIP/%s',_0x3d014c['user'][_0xc1f3('0x37')]);_0x1fb566[_0xc1f3('0x29')][_0xc1f3('0x72')]=_0x1fb566[_0xc1f3('0x72')];_0x1fb566['message'][_0xc1f3('0x73')]=_0x1fb566[_0xc1f3('0x72')];_0x1fb566[_0xc1f3('0x29')][_0xc1f3('0x74')]=_0xc1f3('0x5a');return respondWithRpcPromise(_0xc1f3('0x75'),'EventManager',{'event':_0xc1f3('0x76'),'message':_0x1fb566[_0xc1f3('0x29')]},client9002)[_0xc1f3('0x20')](function(){return _0x1fb566;});}return _0x1fb566;}return null;})[_0xc1f3('0x20')](respondWithResult(_0x59e3b2,null))[_0xc1f3('0x2a')](handleError(_0x59e3b2,null));};var interaction_log=require('../../config/logger')(_0xc1f3('0x59'));exports[_0xc1f3('0x77')]=function(_0x27c584,_0x4f7801,_0x5143e1){var _0x18fa9e={'agent':{},'channel':'sms'};if(_0x27c584[_0xc1f3('0x56')]['id']){delete _0x27c584[_0xc1f3('0x56')]['id'];}_0x27c584[_0xc1f3('0x56')]['UserId']=_0x27c584[_0xc1f3('0x56')][_0xc1f3('0x5e')]||_0x27c584[_0xc1f3('0x64')]['id'];_0x18fa9e[_0xc1f3('0x5d')]['id']=_0x27c584['body'][_0xc1f3('0x5e')];return db[_0xc1f3('0x3b')][_0xc1f3('0x57')]({'where':{'id':_0x27c584['params']['id'],'UserId':null}})[_0xc1f3('0x20')](handleEntityNotFound(_0x4f7801,null))[_0xc1f3('0x20')](function(_0x2ab773){if(_0x2ab773){_0x18fa9e[_0xc1f3('0x29')]=_0x2ab773[_0xc1f3('0x62')]({'plain':!![]});return db[_0xc1f3('0x78')][_0xc1f3('0x57')]({'where':{'id':_0x2ab773[_0xc1f3('0x5f')]}});}return null;})[_0xc1f3('0x20')](handleEntityNotFound(_0x4f7801,null))[_0xc1f3('0x20')](function(_0xabb11b){if(_0xabb11b){_0x18fa9e[_0xc1f3('0x61')]=_0xabb11b[_0xc1f3('0x62')]({'plain':!![]});interaction_log[_0xc1f3('0x21')](_0xc1f3('0x79'),_0x27c584[_0xc1f3('0x64')]['id'],_0x27c584[_0xc1f3('0x64')]['name'],_0x27c584[_0xc1f3('0x64')][_0xc1f3('0x65')],_0x18fa9e[_0xc1f3('0x61')]['id'],_0x27c584[_0xc1f3('0x56')]?JSON['stringify'](_0x27c584[_0xc1f3('0x56')]):_0xc1f3('0x7a'));return respondWithRpcPromise(_0xc1f3('0x7b'),_0xc1f3('0x7c'),_0x18fa9e);}return null;})[_0xc1f3('0x20')](function(_0x12bcad){var _0x12d5f2=_0xc1f3('0x68')+_0x12bcad[_0xc1f3('0x29')][_0xc1f3('0x69')];return db[_0xc1f3('0x7d')][_0xc1f3('0x3f')](_0x12d5f2,{'type':db[_0xc1f3('0x6a')][_0xc1f3('0x6b')][_0xc1f3('0x6c')],'raw':!![]})[_0xc1f3('0x20')](function(_0x4de1ad){return _0x4de1ad;});})[_0xc1f3('0x20')](function(_0x47df10){if(_0x47df10){_0x18fa9e['message'][_0xc1f3('0x7e')]=_0x47df10[0x0];if(!_0x27c584[_0xc1f3('0x56')][_0xc1f3('0x5e')])return;return db[_0xc1f3('0x7f')][_0xc1f3('0x57')]({'where':{'id':_0x27c584[_0xc1f3('0x56')][_0xc1f3('0x5e')],'role':_0xc1f3('0x5d')},'attributes':['id',_0xc1f3('0x37'),'fullname','email',_0xc1f3('0x6f')],'raw':!![]});}return null;})[_0xc1f3('0x20')](function(_0x575168){if(!_0x575168)return null;_0x18fa9e[_0xc1f3('0x29')][_0xc1f3('0x5d')]=_0x575168;return _0x18fa9e;})[_0xc1f3('0x20')](function(_0x2ae53f){if(_0x2ae53f){_0x2ae53f[_0xc1f3('0x29')]['interface']=util[_0xc1f3('0x5b')](_0xc1f3('0x80'),_0x27c584[_0xc1f3('0x64')][_0xc1f3('0x37')]);_0x2ae53f[_0xc1f3('0x29')][_0xc1f3('0x72')]=_0x18fa9e[_0xc1f3('0x72')];_0x2ae53f[_0xc1f3('0x29')][_0xc1f3('0x73')]=_0x18fa9e[_0xc1f3('0x72')];_0x2ae53f['message'][_0xc1f3('0x74')]='reject';respondWithRpcPromise(_0xc1f3('0x75'),_0xc1f3('0x75'),{'event':'rejectmessage','message':_0x2ae53f[_0xc1f3('0x29')]},client9002);return _0x18fa9e;}return null;})[_0xc1f3('0x20')](respondWithResult(_0x4f7801,null))['catch'](handleError(_0x4f7801,null));};exports['status']=function(_0x4776a7,_0xb21983,_0x1b2d6a){if(_0x4776a7[_0xc1f3('0x56')]['id']){delete _0x4776a7['body']['id'];}var _0x30f853;return db[_0xc1f3('0x3b')][_0xc1f3('0x57')]({'where':{'id':_0x4776a7[_0xc1f3('0x53')]['id']}})['then'](handleEntityNotFound(_0xb21983,null))['then'](function(_0xb52f9f){if(_0xb52f9f){_0x30f853=_0xb52f9f;return db[_0xc1f3('0x81')]['find']({'where':{'id':_0xb52f9f['SmsAccountId']}});}})[_0xc1f3('0x20')](handleEntityNotFound(_0xb21983,null))[_0xc1f3('0x20')](function(_0x2c8e93){if(_0x2c8e93){logger[_0xc1f3('0x24')](_0xc1f3('0x25'),_0xc1f3('0x31'),_0xc1f3('0x82'),_0x2c8e93[_0xc1f3('0x83')],util['inspect'](_0x4776a7[_0xc1f3('0x56')],{'showHidden':![],'depth':null}));switch(_0x2c8e93[_0xc1f3('0x83')]){case _0xc1f3('0x84'):if(_0x4776a7[_0xc1f3('0x56')][_0xc1f3('0x85')]&&_0x4776a7[_0xc1f3('0x56')]['MessageSid']===_0x30f853[_0xc1f3('0x86')]){return _0x30f853[_0xc1f3('0x35')]({'read':!![]});}else{logger[_0xc1f3('0x27')](_0xc1f3('0x87'),'status','twilio',util[_0xc1f3('0x88')](_0x4776a7[_0xc1f3('0x56')],{'showHidden':![],'depth':null}));}break;case _0xc1f3('0x89'):if(_0x4776a7[_0xc1f3('0x56')]['MessageUUID']&&_0x4776a7[_0xc1f3('0x56')][_0xc1f3('0x8a')]===_0x30f853[_0xc1f3('0x86')]&&_[_0xc1f3('0x8b')]([_0xc1f3('0x8c'),_0xc1f3('0x8d')],_0x4776a7['body'][_0xc1f3('0x8e')])>=0x0){return _0x30f853[_0xc1f3('0x35')]({'read':!![]});}else{logger[_0xc1f3('0x27')](_0xc1f3('0x87'),_0xc1f3('0x31'),_0xc1f3('0x8f'),util[_0xc1f3('0x88')](_0x4776a7[_0xc1f3('0x56')],{'showHidden':![],'depth':null}));}break;case _0xc1f3('0x90'):var _0x3c835c=_0x4776a7[_0xc1f3('0x56')][_0xc1f3('0x91')][0x0];if(_0x3c835c[_0xc1f3('0x31')]['groupName']===_0xc1f3('0x92')){return _0x30f853[_0xc1f3('0x35')]({'read':!![]});}else{logger[_0xc1f3('0x27')](_0xc1f3('0x87'),_0xc1f3('0x31'),_0xc1f3('0x90'),util['inspect'](_0x4776a7['body'],{'showHidden':![],'depth':null}));}break;}return _0x30f853;}})['then'](respondWithResult(_0xb21983,null))[_0xc1f3('0x2a')](handleError(_0xb21983,null));};
\ No newline at end of file
index bb97f9b..36d4e04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9ae=['hook','exports','events','SmsMessage','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x3e4285,_0x83a4f0){var _0xce09e7=function(_0x2f13ee){while(--_0x2f13ee){_0x3e4285['push'](_0x3e4285['shift']());}};_0xce09e7(++_0x83a4f0);}(_0xa9ae,0x8a));var _0xea9a=function(_0x5b654f,_0x538724){_0x5b654f=_0x5b654f-0x0;var _0x553212=_0xa9ae[_0x5b654f];return _0x553212;};'use strict';var EventEmitter=require(_0xea9a('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0xea9a('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xea9a('0x2')](0x0);var events={'afterCreate':_0xea9a('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x55868a){return function(_0x27d614,_0x1266b4,_0x2e3686){SmsMessageEvents[_0xea9a('0x4')](_0x55868a+':'+_0x27d614['id'],_0x27d614);SmsMessageEvents[_0xea9a('0x4')](_0x55868a,_0x27d614);_0x2e3686(null);};}for(var e in events){if(events[_0xea9a('0x5')](e)){var event=events[e];SmsMessage[_0xea9a('0x6')](e,emitEvent(event));}}module[_0xea9a('0x7')]=SmsMessageEvents;
\ No newline at end of file
+var _0x2587=['hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x50e593,_0x3ae998){var _0x3821d0=function(_0x53c295){while(--_0x53c295){_0x50e593['push'](_0x50e593['shift']());}};_0x3821d0(++_0x3ae998);}(_0x2587,0x14f));var _0x7258=function(_0x309f89,_0x4dcee4){_0x309f89=_0x309f89-0x0;var _0xbbbf35=_0x2587[_0x309f89];return _0xbbbf35;};'use strict';var EventEmitter=require(_0x7258('0x0'));var SmsMessage=require(_0x7258('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x7258('0x2')](0x0);var events={'afterCreate':_0x7258('0x3'),'afterUpdate':'update','afterDestroy':_0x7258('0x4')};function emitEvent(_0x38d842){return function(_0x1b981e,_0x53712d,_0x47e25f){SmsMessageEvents[_0x7258('0x5')](_0x38d842+':'+_0x1b981e['id'],_0x1b981e);SmsMessageEvents[_0x7258('0x5')](_0x38d842,_0x1b981e);_0x47e25f(null);};}for(var e in events){if(events[_0x7258('0x6')](e)){var event=events[e];SmsMessage[_0x7258('0x7')](e,emitEvent(event));}}module[_0x7258('0x8')]=SmsMessageEvents;
\ No newline at end of file
index bc0fc0f..5634190 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa7c=['secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','direction','catch','error','SmsAccount','SmsAccountId','then','type','twilio','accountSid','authToken','phone','remote','/api/sms/messages/','/status?token=','token','sid','update','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','smsMethod','sender','login?username=','username','&password=','password','GET','sms','POST','user_key','total_sent','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','http_code','data','queued_count','head','messages','deliveryReport','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','crypto','apiKey','login','text','timestamp','keys','sort','length','createHash','hex','signature=','/external/get/send.php?','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','application/json','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','toLowerCase','out'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xfa7c,0x15b));var _0xcfa7=function(_0x2aed4e,_0x5c0f33){_0x2aed4e=_0x2aed4e-0x0;var _0x57ea25=_0xfa7c[_0x2aed4e];return _0x57ea25;};'use strict';var _=require(_0xcfa7('0x0'));var util=require('util');var logger=require(_0xcfa7('0x1'))(_0xcfa7('0x2'));var moment=require(_0xcfa7('0x3'));var BPromise=require(_0xcfa7('0x4'));var rp=require(_0xcfa7('0x5'));var fs=require('fs');var path=require(_0xcfa7('0x6'));var rimraf=require(_0xcfa7('0x7'));var config=require(_0xcfa7('0x8'));var attributes=require('./smsMessage.attributes');module[_0xcfa7('0x9')]=function(_0x3bf816,_0x9d96a2){return _0x3bf816[_0xcfa7('0xa')]('SmsMessage',attributes,{'tableName':_0xcfa7('0xb'),'paranoid':![],'indexes':[{'name':_0xcfa7('0xc'),'fields':[_0xcfa7('0xc')]},{'name':_0xcfa7('0xd'),'fields':[_0xcfa7('0xe')],'type':_0xcfa7('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4ae349,_0x1c862b,_0x39ce6a){var _0x43700c=_0x3bf816[_0xcfa7('0x10')];var _0x240b3e=_0x4ae349['get']({'plain':!![]});if(_0x240b3e['direction'][_0xcfa7('0x11')]()==='in'||_0x240b3e['direction'][_0xcfa7('0x11')]()===_0xcfa7('0x12')&&!_0x240b3e[_0xcfa7('0x13')]&&!_[_0xcfa7('0x14')](_0x240b3e[_0xcfa7('0x15')])){_0x43700c[_0xcfa7('0x16')][_0xcfa7('0x17')]({'where':{'id':_0x240b3e[_0xcfa7('0x18')]}})['then'](function(_0x42500c){if(_0x42500c){_0x42500c['update']({'lastMsgAt':_0x240b3e['createdAt'],'lastMsgDirection':_0x240b3e[_0xcfa7('0x19')][_0xcfa7('0x11')]()});}})[_0xcfa7('0x1a')](function(_0x349679){console[_0xcfa7('0x1b')](_0x349679);});}if(_0x240b3e['direction']===_0xcfa7('0x12')&&!_0x240b3e[_0xcfa7('0x13')]){var _0x1236d5;_0x43700c[_0xcfa7('0x1c')]['find']({'where':{'id':_0x240b3e[_0xcfa7('0x1d')]},'raw':!![]})[_0xcfa7('0x1e')](function(_0x558a21){_0x1236d5=_0x558a21;if(_0x1236d5&&_0x1236d5['type']){switch(_0x1236d5[_0xcfa7('0x1f')]){case _0xcfa7('0x20'):var _0x1ce356=require(_0xcfa7('0x20'));if(_0x1236d5[_0xcfa7('0x21')]&&_0x1236d5[_0xcfa7('0x22')]&&_0x1236d5[_0xcfa7('0x23')]){var _0x602f15=new _0x1ce356(_0x1236d5['accountSid'],_0x1236d5[_0xcfa7('0x22')]);_0x602f15['messages']['create']({'body':_0x240b3e['body'],'to':_0x240b3e[_0xcfa7('0x23')],'from':_0x1236d5['phone'],'statusCallback':_0x1236d5[_0xcfa7('0x24')]+_0xcfa7('0x25')+_0x240b3e['id']+_0xcfa7('0x26')+_0x1236d5[_0xcfa7('0x27')]})[_0xcfa7('0x1e')](function(_0x2d00e1){if(_0x2d00e1[_0xcfa7('0x28')]){return _0x4ae349[_0xcfa7('0x29')]({'messageId':_0x2d00e1['sid']});}})[_0xcfa7('0x1a')](function(_0x222ce2){logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),'afterCreate',_0xcfa7('0x20'),util[_0xcfa7('0x2b')](_0x222ce2,{'showHidden':![],'depth':null}));});}else{logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),_0xcfa7('0x2c'),'twilio',_0xcfa7('0x2d'));}break;case _0xcfa7('0x2e'):var _0x347d17=_0xcfa7('0x2f');if(_0x1236d5['username']&&_0x1236d5['password']){var _0x569f4e={'recipient':[_0x240b3e[_0xcfa7('0x23')]],'message':_0x240b3e[_0xcfa7('0xe')],'message_type':_0x1236d5[_0xcfa7('0x30')]};if(_0x1236d5['smsMethod']&&_0x1236d5['smsMethod']!=='SI'){_0x569f4e[_0xcfa7('0x31')]=_0x1236d5['phone'];}var _0x22799c={'url':_0x347d17+_0xcfa7('0x32')+_0x1236d5[_0xcfa7('0x33')]+_0xcfa7('0x34')+_0x1236d5[_0xcfa7('0x35')],'method':_0xcfa7('0x36')};rp(_0x22799c)[_0xcfa7('0x1e')](function(_0xdea3ba){var _0x34bb00=_0xdea3ba['split'](';');var _0x4b3f8a={'user_key':_0x34bb00[0x0],'session_key':_0x34bb00[0x1]};_0x22799c={'url':_0x347d17+_0xcfa7('0x37'),'method':_0xcfa7('0x38'),'headers':{'user_key':_0x4b3f8a[_0xcfa7('0x39')],'Session_key':_0x4b3f8a['session_key']},'json':!![],'body':_0x569f4e};return rp(_0x22799c);})['then'](function(_0x204c27){if(_0x204c27[_0xcfa7('0x3a')]>=0x1){var _0x3d12fe={'messageId':_0x204c27['internal_order_id']};if(_0x1236d5[_0xcfa7('0x30')]!=='GP'||!_0x1236d5['deliveryReport']){_0x3d12fe[_0xcfa7('0x3b')]=!![];}return _0x4ae349['update'](_0x3d12fe);}else{return logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),_0xcfa7('0x2c'),_0xcfa7('0x2e'),util[_0xcfa7('0x2b')](_0x204c27,{'showHidden':![],'depth':null}));}})[_0xcfa7('0x1a')](function(_0x1156fb){return logger['error'](_0xcfa7('0x2a'),_0xcfa7('0x2c'),_0xcfa7('0x2e'),util[_0xcfa7('0x2b')](_0x1156fb,{'showHidden':![],'depth':null}));});}else{logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),_0xcfa7('0x2c'),_0xcfa7('0x2e'),_0xcfa7('0x3c'));}break;case _0xcfa7('0x3d'):if(_0x1236d5['authToken']){var _0x51678c={'recipient':_0x240b3e[_0xcfa7('0x23')],'message':_0x240b3e['body'],'sender':_0x1236d5[_0xcfa7('0x3e')]||_0x1236d5[_0xcfa7('0x23')],'authorization':_0x1236d5[_0xcfa7('0x22')]};var _0x1c862b={'method':_0xcfa7('0x38'),'uri':_0xcfa7('0x3f'),'body':_0x51678c,'json':!![]};rp(_0x1c862b)['then'](function(_0x118e38){var _0x41b014={'messageId':_0x118e38[_0xcfa7('0x40')]};if(!_0x1236d5['deliveryReport']){_0x41b014[_0xcfa7('0x3b')]=!![];}return _0x4ae349[_0xcfa7('0x29')](_0x41b014);})[_0xcfa7('0x1a')](function(_0x1c8fc6){logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),'afterCreate',_0xcfa7('0x3d'),util['inspect'](_0x1c8fc6,{'showHidden':![],'depth':null}));});}else{logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),'afterCreate',_0xcfa7('0x3d'),_0xcfa7('0x41'));}break;case'clicksend':if(_0x1236d5[_0xcfa7('0x33')]&&_0x1236d5['password']){var _0x51678c={'messages':[{'source':_0xcfa7('0x42'),'to':_0x240b3e['phone'],'body':_0x240b3e[_0xcfa7('0xe')],'from':_0x1236d5[_0xcfa7('0x3e')]||_0x1236d5[_0xcfa7('0x23')]}]};var _0x2333e9=util[_0xcfa7('0x43')](_0xcfa7('0x44'),_0x1236d5[_0xcfa7('0x33')],_0x1236d5[_0xcfa7('0x35')]);var _0x1c862b={'method':_0xcfa7('0x38'),'uri':_0xcfa7('0x45'),'body':_0x51678c,'headers':{'Authorization':util[_0xcfa7('0x43')](_0xcfa7('0x46'),new Buffer(_0x2333e9)[_0xcfa7('0x47')]('base64'))},'json':!![]};rp(_0x1c862b)[_0xcfa7('0x1e')](function(_0x4b9358){if(_0x4b9358[_0xcfa7('0x48')]>=0xc8&&_0x4b9358[_0xcfa7('0x48')]<=0xce){if(_0x4b9358[_0xcfa7('0x49')]&&_0x4b9358['data'][_0xcfa7('0x4a')]>0x0){var _0x3b1659=_[_0xcfa7('0x4b')](_0x4b9358[_0xcfa7('0x49')][_0xcfa7('0x4c')]);var _0x433fde={'messageId':_0x3b1659['message_id']};if(!_0x1236d5[_0xcfa7('0x4d')]){_0x433fde[_0xcfa7('0x3b')]=!![];}return _0x4ae349[_0xcfa7('0x29')](_0x433fde);}else{logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),_0xcfa7('0x2c'),_0xcfa7('0x4e'),util[_0xcfa7('0x2b')](_0x4b9358,{'showHidden':![],'depth':null}));}}else{logger[_0xcfa7('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xcfa7('0x2c'),_0xcfa7('0x4e'),util[_0xcfa7('0x2b')](_0x4b9358,{'showHidden':![],'depth':null}));}})[_0xcfa7('0x1a')](function(_0x63b433){logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),'afterCreate','clickSend',util[_0xcfa7('0x2b')](_0x63b433,{'showHidden':![],'depth':null}));});}else{logger[_0xcfa7('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xcfa7('0x2c'),_0xcfa7('0x4e'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xcfa7('0x4f'):if(_0x1236d5[_0xcfa7('0x50')]&&_0x1236d5[_0xcfa7('0x22')]){var _0x51678c={'dst':_0x240b3e[_0xcfa7('0x23')],'text':_0x240b3e[_0xcfa7('0xe')],'src':_0x1236d5['senderString']||_0x1236d5[_0xcfa7('0x23')],'url':_0x1236d5[_0xcfa7('0x24')]+_0xcfa7('0x25')+_0x240b3e['id']+_0xcfa7('0x26')+_0x1236d5['token']};var _0x2333e9=util[_0xcfa7('0x43')]('%s:%s',_0x1236d5[_0xcfa7('0x50')],_0x1236d5[_0xcfa7('0x22')]);var _0x1c862b={'method':_0xcfa7('0x38'),'uri':util[_0xcfa7('0x43')](_0xcfa7('0x51'),_0x1236d5['authId']),'body':_0x51678c,'headers':{'Authorization':util[_0xcfa7('0x43')](_0xcfa7('0x46'),new Buffer(_0x2333e9)[_0xcfa7('0x47')](_0xcfa7('0x52')))},'json':!![]};rp(_0x1c862b)['then'](function(_0x3766e7){var _0x56a3f1={'messageId':_0x3766e7[_0xcfa7('0x53')][0x0]};return _0x4ae349[_0xcfa7('0x29')](_0x56a3f1);})[_0xcfa7('0x1a')](function(_0x44f69d){logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),_0xcfa7('0x2c'),_0xcfa7('0x4f'),util[_0xcfa7('0x2b')](_0x44f69d,{'showHidden':![],'depth':null}));});}else{logger[_0xcfa7('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','plivo',_0xcfa7('0x54'));}break;case _0xcfa7('0x55'):if(_0x1236d5[_0xcfa7('0x33')]&&_0x1236d5[_0xcfa7('0x35')]){if(_0x1236d5[_0xcfa7('0x56')]){var _0x378cd1={'method':_0xcfa7('0x38'),'uri':_0x1236d5['baseUrl']+_0xcfa7('0x57'),'body':{'username':_0x1236d5[_0xcfa7('0x33')],'password':_0x1236d5[_0xcfa7('0x35')]},'json':!![]};return rp(_0x378cd1)[_0xcfa7('0x1e')](function(_0x5ebe68){var _0x558514={'method':_0xcfa7('0x38'),'uri':_0x1236d5[_0xcfa7('0x56')]+_0xcfa7('0x58'),'body':{'messages':[{'from':_0x1236d5[_0xcfa7('0x23')],'destinations':[{'to':_0x240b3e['phone']}],'text':_0x240b3e[_0xcfa7('0xe')],'notifyUrl':_0x1236d5[_0xcfa7('0x24')]+_0xcfa7('0x25')+_0x240b3e['id']+_0xcfa7('0x26')+_0x1236d5[_0xcfa7('0x27')],'notifyContentType':'application/json','callbackData':_0x1236d5[_0xcfa7('0x23')]+';'+_0x240b3e[_0xcfa7('0xe')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x5ebe68[_0xcfa7('0x27')]},'json':!![]};return rp(_0x558514)[_0xcfa7('0x1e')](function(_0x25564a){if(_0x25564a['messages']){var _0x2f94f6={'messageId':_0x25564a['messages'][0x0]['messageId']};if(!_0x1236d5['deliveryReport']){_0x2f94f6[_0xcfa7('0x3b')]=!![];}return _0x4ae349['update'](_0x2f94f6);}else{return logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),'afterCreate','infobip',util[_0xcfa7('0x2b')](_0x25564a,{'showHidden':![],'depth':null}));}});})[_0xcfa7('0x1a')](function(_0x11ccfc){return logger['error'](_0xcfa7('0x2a'),_0xcfa7('0x2c'),_0xcfa7('0x55'),util[_0xcfa7('0x2b')](_0x11ccfc,{'showHidden':![],'depth':null}));});}else{logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),_0xcfa7('0x2c'),'infobip','Missing\x20parameters:\x20base_url');}}else{logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),'afterCreate','infobip',_0xcfa7('0x3c'));}break;case'csc':var _0x259476=require(_0xcfa7('0x59'));if(_0x1236d5[_0xcfa7('0x5a')]){var _0x566733={};_0x566733[_0xcfa7('0x5b')]=_0x1236d5['username'];_0x566733[_0xcfa7('0x23')]=_0x240b3e['phone'];_0x566733[_0xcfa7('0x31')]=_0x1236d5[_0xcfa7('0x23')];_0x566733[_0xcfa7('0x5c')]=_0x240b3e[_0xcfa7('0xe')];_0x566733[_0xcfa7('0x5d')]=+new Date();var _0x52df0a='';var _0x65cf01='';var _0x1657c9=Object[_0xcfa7('0x5e')](_0x566733);_0x1657c9[_0xcfa7('0x5f')]();for(var _0x366483=0x0;_0x366483<_0x1657c9[_0xcfa7('0x60')];_0x366483++){if(_0x52df0a!=''){_0x52df0a+='&';}_0x52df0a+=_0x1657c9[_0x366483]+'='+encodeURIComponent(_0x566733[_0x1657c9[_0x366483]]);_0x65cf01+=_0x566733[_0x1657c9[_0x366483]];}_0x65cf01+=_0x1236d5[_0xcfa7('0x5a')];_0x65cf01=_0x259476[_0xcfa7('0x61')]('md5')[_0xcfa7('0x29')](_0x65cf01)['digest'](_0xcfa7('0x62'));if(_0x52df0a!==''){_0x52df0a+='&';}_0x52df0a+=_0xcfa7('0x63')+_0x65cf01;var _0x22799c={'method':_0xcfa7('0x36'),'uri':_0x1236d5[_0xcfa7('0x56')]+_0xcfa7('0x64')+_0x52df0a,'json':!![]};return rp(_0x22799c)[_0xcfa7('0x1e')](function(_0x47f1f8){var _0x40f218=Object[_0xcfa7('0x5e')](_0x47f1f8);if(_0x47f1f8[_0x40f218[0x0]][_0xcfa7('0x1b')]&&parseInt(_0x47f1f8[_0x40f218[0x0]][_0xcfa7('0x1b')])===0x0){var _0xccb69e={'messageId':_0x47f1f8[_0x40f218[0x0]]['id_sms']};if(!_0x1236d5[_0xcfa7('0x4d')]){_0xccb69e[_0xcfa7('0x3b')]=!![];}return _0x4ae349['update'](_0xccb69e);}else{return logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),'afterCreate',_0xcfa7('0x65'),util['inspect'](_0x47f1f8['error'],{'showHidden':![],'depth':null}));}})[_0xcfa7('0x1a')](function(_0x3fb1f9){return logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),_0xcfa7('0x2c'),_0xcfa7('0x65'),util[_0xcfa7('0x2b')](_0x3fb1f9,{'showHidden':![],'depth':null}));});}else{logger[_0xcfa7('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xcfa7('0x65'),_0xcfa7('0x66'));}break;case _0xcfa7('0x67'):if(_0x1236d5[_0xcfa7('0x5a')]){var _0x47f8e0={'method':_0xcfa7('0x38'),'uri':_0xcfa7('0x68'),'headers':{'Authorization':_0x1236d5[_0xcfa7('0x5a')]},'body':{'content':_0x240b3e[_0xcfa7('0xe')],'to':[_0x240b3e[_0xcfa7('0x23')]],'from':_0x1236d5[_0xcfa7('0x23')],'binary':![],'clientMessageId':_0xcfa7('0x69'),'charset':'UTF-8'},'json':!![]};rp(_0x47f8e0)['then'](function(_0x5f368d){if(!_0x5f368d[_0xcfa7('0x1b')]){var _0x1f06f3={'messageId':_0x5f368d[_0xcfa7('0x4c')][0x0]['apiMessageId']};if(!_0x1236d5[_0xcfa7('0x4d')]){_0x1f06f3[_0xcfa7('0x3b')]=!![];}return _0x4ae349[_0xcfa7('0x29')](_0x1f06f3);}else{return logger[_0xcfa7('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xcfa7('0x2c'),'clickatell',util[_0xcfa7('0x2b')](_0x5f368d[_0xcfa7('0x1b')],{'showHidden':![],'depth':null}));}})[_0xcfa7('0x1a')](function(_0x121a1b){return logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),_0xcfa7('0x2c'),_0xcfa7('0x67'),util[_0xcfa7('0x2b')](_0x121a1b,{'showHidden':![],'depth':null}));});}else{logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),_0xcfa7('0x2c'),_0xcfa7('0x67'),_0xcfa7('0x66'));}break;case _0xcfa7('0x6a'):if(_0x1236d5['username']&&_0x1236d5[_0xcfa7('0x35')]){var _0x2333e9=util[_0xcfa7('0x43')](_0xcfa7('0x44'),_0x1236d5[_0xcfa7('0x33')],_0x1236d5[_0xcfa7('0x35')]);var _0x1c862b={'method':_0xcfa7('0x38'),'uri':_0xcfa7('0x6b')+_0x1236d5[_0xcfa7('0x6c')]+_0xcfa7('0x6d'),'body':{'to':[_0x240b3e[_0xcfa7('0x23')]],'text':_0x240b3e[_0xcfa7('0xe')],'from':_0x1236d5[_0xcfa7('0x23')],'applicationId':_0x1236d5[_0xcfa7('0x6e')]},'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x2333e9)['toString'](_0xcfa7('0x52')))},'json':!![]};rp(_0x1c862b)['then'](function(_0x5ae924){if(_0x5ae924['id']){var _0x4d01f9={'messageId':_0x5ae924['id']};return _0x4ae349[_0xcfa7('0x29')](_0x4d01f9);}else{logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),_0xcfa7('0x2c'),_0xcfa7('0x6a'),util[_0xcfa7('0x2b')](_0x5ae924,{'showHidden':![],'depth':null}));}})['catch'](function(_0x34dcd7){logger['error'](_0xcfa7('0x2a'),_0xcfa7('0x2c'),'bandwidth',util[_0xcfa7('0x2b')](_0x34dcd7,{'showHidden':![],'depth':null}));});}else{logger[_0xcfa7('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xcfa7('0x2c'),_0xcfa7('0x6a'),_0xcfa7('0x3c'));}break;case _0xcfa7('0x6f'):if(_0x1236d5['apiKey']){var _0x5ecbfa={};var _0x22799c={'method':_0xcfa7('0x38'),'uri':_0xcfa7('0x70'),'headers':{'Authorization':_0xcfa7('0x71')+_0x1236d5[_0xcfa7('0x5a')],'Content-Type':'application/json'},'body':{'from':_0x1236d5[_0xcfa7('0x23')],'to':_0x240b3e[_0xcfa7('0x23')],'text':_0x240b3e[_0xcfa7('0xe')]},'json':!![]};return rp(_0x22799c)[_0xcfa7('0x1e')](function(_0x269a6f){if(_0x269a6f['code']==0xca){_0x5ecbfa[_0xcfa7('0x72')]=_0x269a6f;var _0x25f3e9={'method':_0xcfa7('0x38'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0xcfa7('0x71')+_0x1236d5[_0xcfa7('0x5a')],'Content-Type':_0xcfa7('0x73')},'body':{'refid':_0x5ecbfa[_0xcfa7('0x72')][_0xcfa7('0x74')]},'json':!![]};return rp(_0x25f3e9)[_0xcfa7('0x1e')](function(_0x369df9){_0x5ecbfa[_0xcfa7('0x75')]=_0x369df9;var _0x548693={'messageId':_0x5ecbfa['message'][_0xcfa7('0x74')],'read':!![]};return _0x4ae349[_0xcfa7('0x29')](_0x548693);});}else{return logger['error'](_0xcfa7('0x2a'),_0xcfa7('0x2c'),_0xcfa7('0x6f'),util[_0xcfa7('0x2b')](_0x269a6f,{'showHidden':![],'depth':null}));}})[_0xcfa7('0x1a')](function(_0x5df130){return logger[_0xcfa7('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xcfa7('0x2c'),_0xcfa7('0x6f'),util['inspect'](_0x5df130,{'showHidden':![],'depth':null}));});}else{return logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),_0xcfa7('0x2c'),_0xcfa7('0x6f'),_0xcfa7('0x76'));}break;}}})[_0xcfa7('0x77')](function(){_0x39ce6a();});}else{_0x39ce6a();}}},'charset':_0xcfa7('0x78'),'collate':_0xcfa7('0x79')});};
\ No newline at end of file
+var _0x4fdb=['Missing\x20parameters:\x20base_url','csc','login','sender','text','keys','sort','length','apiKey','md5','digest','hex','signature=','/external/get/send.php?','id_sms','https://platform.clickatell.com/messages','UTF-8','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','intelepeer','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','status','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsMessage.attributes','SmsMessage','sms_messages','messageId','body','FULLTEXT','models','get','toLowerCase','direction','out','isNil','UserId','SmsInteraction','SmsInteractionId','then','update','createdAt','error','secret','SmsAccount','find','SmsAccountId','twilio','accountSid','authToken','phone','/api/sms/messages/','token','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','login?username=','&password=','GET','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','https://smsapi.connectel.se/api/v2/send/','requestid','connectel','inspect','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','username','toString','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','/status?token=','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','remote','application/json','IBSSO\x20','messages','infobip'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x332475,_0x2049df){_0x332475=_0x332475-0x0;var _0x34d1eb=_0x4fdb[_0x332475];return _0x34d1eb;};'use strict';var _=require(_0xb4fd('0x0'));var util=require(_0xb4fd('0x1'));var logger=require(_0xb4fd('0x2'))(_0xb4fd('0x3'));var moment=require(_0xb4fd('0x4'));var BPromise=require(_0xb4fd('0x5'));var rp=require(_0xb4fd('0x6'));var fs=require('fs');var path=require(_0xb4fd('0x7'));var rimraf=require(_0xb4fd('0x8'));var config=require('../../config/environment');var attributes=require(_0xb4fd('0x9'));module['exports']=function(_0x14052b,_0x5d8b39){return _0x14052b['define'](_0xb4fd('0xa'),attributes,{'tableName':_0xb4fd('0xb'),'paranoid':![],'indexes':[{'name':_0xb4fd('0xc'),'fields':['messageId']},{'name':'fti_sms_messages','fields':[_0xb4fd('0xd')],'type':_0xb4fd('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x18c0f7,_0x4eb1ae,_0x1e1e16){var _0x17ac4b=_0x14052b[_0xb4fd('0xf')];var _0x23b08f=_0x18c0f7[_0xb4fd('0x10')]({'plain':!![]});if(_0x23b08f['direction'][_0xb4fd('0x11')]()==='in'||_0x23b08f[_0xb4fd('0x12')][_0xb4fd('0x11')]()===_0xb4fd('0x13')&&!_0x23b08f['secret']&&!_[_0xb4fd('0x14')](_0x23b08f[_0xb4fd('0x15')])){_0x17ac4b[_0xb4fd('0x16')]['findOne']({'where':{'id':_0x23b08f[_0xb4fd('0x17')]}})[_0xb4fd('0x18')](function(_0xc35d8d){if(_0xc35d8d){_0xc35d8d[_0xb4fd('0x19')]({'lastMsgAt':_0x23b08f[_0xb4fd('0x1a')],'lastMsgDirection':_0x23b08f[_0xb4fd('0x12')][_0xb4fd('0x11')]()});}})['catch'](function(_0x2076d5){console[_0xb4fd('0x1b')](_0x2076d5);});}if(_0x23b08f[_0xb4fd('0x12')]===_0xb4fd('0x13')&&!_0x23b08f[_0xb4fd('0x1c')]){var _0x137e51;_0x17ac4b[_0xb4fd('0x1d')][_0xb4fd('0x1e')]({'where':{'id':_0x23b08f[_0xb4fd('0x1f')]},'raw':!![]})[_0xb4fd('0x18')](function(_0x19f7b0){_0x137e51=_0x19f7b0;if(_0x137e51&&_0x137e51['type']){switch(_0x137e51['type']){case'twilio':var _0x5c14c0=require(_0xb4fd('0x20'));if(_0x137e51[_0xb4fd('0x21')]&&_0x137e51[_0xb4fd('0x22')]&&_0x137e51[_0xb4fd('0x23')]){var _0x458133=new _0x5c14c0(_0x137e51[_0xb4fd('0x21')],_0x137e51[_0xb4fd('0x22')]);_0x458133['messages']['create']({'body':_0x23b08f[_0xb4fd('0xd')],'to':_0x23b08f[_0xb4fd('0x23')],'from':_0x137e51[_0xb4fd('0x23')],'statusCallback':_0x137e51['remote']+_0xb4fd('0x24')+_0x23b08f['id']+'/status?token='+_0x137e51[_0xb4fd('0x25')]})['then'](function(_0x2a9c8c){if(_0x2a9c8c[_0xb4fd('0x26')]){return _0x18c0f7[_0xb4fd('0x19')]({'messageId':_0x2a9c8c[_0xb4fd('0x26')]});}})[_0xb4fd('0x27')](function(_0x456f35){logger[_0xb4fd('0x1b')](_0xb4fd('0x28'),'afterCreate','twilio',util['inspect'](_0x456f35,{'showHidden':![],'depth':null}));});}else{logger[_0xb4fd('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb4fd('0x29'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xb4fd('0x2a'):var _0x7c5313=_0xb4fd('0x2b');if(_0x137e51['username']&&_0x137e51[_0xb4fd('0x2c')]){var _0x477a53={'recipient':[_0x23b08f[_0xb4fd('0x23')]],'message':_0x23b08f[_0xb4fd('0xd')],'message_type':_0x137e51['smsMethod']};if(_0x137e51[_0xb4fd('0x2d')]&&_0x137e51[_0xb4fd('0x2d')]!=='SI'){_0x477a53['sender']=_0x137e51[_0xb4fd('0x23')];}var _0x57ce81={'url':_0x7c5313+_0xb4fd('0x2e')+_0x137e51['username']+_0xb4fd('0x2f')+_0x137e51[_0xb4fd('0x2c')],'method':_0xb4fd('0x30')};rp(_0x57ce81)['then'](function(_0x55eed3){var _0x4d7a63=_0x55eed3['split'](';');var _0x1eeb9c={'user_key':_0x4d7a63[0x0],'session_key':_0x4d7a63[0x1]};_0x57ce81={'url':_0x7c5313+_0xb4fd('0x31'),'method':_0xb4fd('0x32'),'headers':{'user_key':_0x1eeb9c[_0xb4fd('0x33')],'Session_key':_0x1eeb9c[_0xb4fd('0x34')]},'json':!![],'body':_0x477a53};return rp(_0x57ce81);})[_0xb4fd('0x18')](function(_0xbf95eb){if(_0xbf95eb[_0xb4fd('0x35')]>=0x1){var _0x16a08a={'messageId':_0xbf95eb[_0xb4fd('0x36')]};if(_0x137e51[_0xb4fd('0x2d')]!=='GP'||!_0x137e51[_0xb4fd('0x37')]){_0x16a08a[_0xb4fd('0x38')]=!![];}return _0x18c0f7[_0xb4fd('0x19')](_0x16a08a);}else{return logger[_0xb4fd('0x1b')](_0xb4fd('0x28'),_0xb4fd('0x29'),_0xb4fd('0x2a'),util['inspect'](_0xbf95eb,{'showHidden':![],'depth':null}));}})['catch'](function(_0x930751){return logger[_0xb4fd('0x1b')](_0xb4fd('0x28'),_0xb4fd('0x29'),_0xb4fd('0x2a'),util['inspect'](_0x930751,{'showHidden':![],'depth':null}));});}else{logger[_0xb4fd('0x1b')](_0xb4fd('0x28'),_0xb4fd('0x29'),_0xb4fd('0x2a'),_0xb4fd('0x39'));}break;case'connectel':if(_0x137e51[_0xb4fd('0x22')]){var _0x4bc6b2={'recipient':_0x23b08f[_0xb4fd('0x23')],'message':_0x23b08f[_0xb4fd('0xd')],'sender':_0x137e51['senderString']||_0x137e51['phone'],'authorization':_0x137e51[_0xb4fd('0x22')]};var _0x4eb1ae={'method':_0xb4fd('0x32'),'uri':_0xb4fd('0x3a'),'body':_0x4bc6b2,'json':!![]};rp(_0x4eb1ae)[_0xb4fd('0x18')](function(_0x2718a0){var _0x478cf3={'messageId':_0x2718a0[_0xb4fd('0x3b')]};if(!_0x137e51[_0xb4fd('0x37')]){_0x478cf3['read']=!![];}return _0x18c0f7[_0xb4fd('0x19')](_0x478cf3);})[_0xb4fd('0x27')](function(_0x17e024){logger[_0xb4fd('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb4fd('0x29'),_0xb4fd('0x3c'),util[_0xb4fd('0x3d')](_0x17e024,{'showHidden':![],'depth':null}));});}else{logger[_0xb4fd('0x1b')](_0xb4fd('0x28'),_0xb4fd('0x29'),'connectel',_0xb4fd('0x3e'));}break;case _0xb4fd('0x3f'):if(_0x137e51['username']&&_0x137e51[_0xb4fd('0x2c')]){var _0x4bc6b2={'messages':[{'source':_0xb4fd('0x40'),'to':_0x23b08f[_0xb4fd('0x23')],'body':_0x23b08f[_0xb4fd('0xd')],'from':_0x137e51['senderString']||_0x137e51[_0xb4fd('0x23')]}]};var _0x671ce5=util[_0xb4fd('0x41')]('%s:%s',_0x137e51[_0xb4fd('0x42')],_0x137e51['password']);var _0x4eb1ae={'method':_0xb4fd('0x32'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x4bc6b2,'headers':{'Authorization':util[_0xb4fd('0x41')]('Basic\x20%s',new Buffer(_0x671ce5)[_0xb4fd('0x43')](_0xb4fd('0x44')))},'json':!![]};rp(_0x4eb1ae)[_0xb4fd('0x18')](function(_0x5500ef){if(_0x5500ef[_0xb4fd('0x45')]>=0xc8&&_0x5500ef[_0xb4fd('0x45')]<=0xce){if(_0x5500ef[_0xb4fd('0x46')]&&_0x5500ef[_0xb4fd('0x46')][_0xb4fd('0x47')]>0x0){var _0x3415cd=_[_0xb4fd('0x48')](_0x5500ef['data']['messages']);var _0x1595f2={'messageId':_0x3415cd[_0xb4fd('0x49')]};if(!_0x137e51[_0xb4fd('0x37')]){_0x1595f2[_0xb4fd('0x38')]=!![];}return _0x18c0f7['update'](_0x1595f2);}else{logger[_0xb4fd('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xb4fd('0x4a'),util[_0xb4fd('0x3d')](_0x5500ef,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xb4fd('0x28'),_0xb4fd('0x29'),'clickSend',util[_0xb4fd('0x3d')](_0x5500ef,{'showHidden':![],'depth':null}));}})[_0xb4fd('0x27')](function(_0x3b6014){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb4fd('0x29'),_0xb4fd('0x4a'),util[_0xb4fd('0x3d')](_0x3b6014,{'showHidden':![],'depth':null}));});}else{logger[_0xb4fd('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb4fd('0x29'),_0xb4fd('0x4a'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xb4fd('0x4b'):if(_0x137e51[_0xb4fd('0x4c')]&&_0x137e51[_0xb4fd('0x22')]){var _0x4bc6b2={'dst':_0x23b08f[_0xb4fd('0x23')],'text':_0x23b08f[_0xb4fd('0xd')],'src':_0x137e51['senderString']||_0x137e51[_0xb4fd('0x23')],'url':_0x137e51['remote']+'/api/sms/messages/'+_0x23b08f['id']+_0xb4fd('0x4d')+_0x137e51[_0xb4fd('0x25')]};var _0x671ce5=util[_0xb4fd('0x41')](_0xb4fd('0x4e'),_0x137e51[_0xb4fd('0x4c')],_0x137e51[_0xb4fd('0x22')]);var _0x4eb1ae={'method':_0xb4fd('0x32'),'uri':util[_0xb4fd('0x41')](_0xb4fd('0x4f'),_0x137e51[_0xb4fd('0x4c')]),'body':_0x4bc6b2,'headers':{'Authorization':util[_0xb4fd('0x41')](_0xb4fd('0x50'),new Buffer(_0x671ce5)[_0xb4fd('0x43')]('base64'))},'json':!![]};rp(_0x4eb1ae)['then'](function(_0x130a5b){var _0x7c85e8={'messageId':_0x130a5b[_0xb4fd('0x51')][0x0]};return _0x18c0f7[_0xb4fd('0x19')](_0x7c85e8);})[_0xb4fd('0x27')](function(_0x5d1625){logger['error'](_0xb4fd('0x28'),_0xb4fd('0x29'),'plivo',util['inspect'](_0x5d1625,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xb4fd('0x28'),_0xb4fd('0x29'),_0xb4fd('0x4b'),_0xb4fd('0x52'));}break;case'infobip':if(_0x137e51['username']&&_0x137e51[_0xb4fd('0x2c')]){if(_0x137e51[_0xb4fd('0x53')]){var _0x22ec0d={'method':'POST','uri':_0x137e51[_0xb4fd('0x53')]+_0xb4fd('0x54'),'body':{'username':_0x137e51[_0xb4fd('0x42')],'password':_0x137e51[_0xb4fd('0x2c')]},'json':!![]};return rp(_0x22ec0d)['then'](function(_0x423112){var _0x16c8e6={'method':'POST','uri':_0x137e51[_0xb4fd('0x53')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x137e51[_0xb4fd('0x23')],'destinations':[{'to':_0x23b08f['phone']}],'text':_0x23b08f[_0xb4fd('0xd')],'notifyUrl':_0x137e51[_0xb4fd('0x55')]+_0xb4fd('0x24')+_0x23b08f['id']+_0xb4fd('0x4d')+_0x137e51[_0xb4fd('0x25')],'notifyContentType':_0xb4fd('0x56'),'callbackData':_0x137e51[_0xb4fd('0x23')]+';'+_0x23b08f[_0xb4fd('0xd')]}]},'headers':{'Authorization':_0xb4fd('0x57')+_0x423112[_0xb4fd('0x25')]},'json':!![]};return rp(_0x16c8e6)[_0xb4fd('0x18')](function(_0x40882b){if(_0x40882b[_0xb4fd('0x58')]){var _0x454acd={'messageId':_0x40882b['messages'][0x0][_0xb4fd('0xc')]};if(!_0x137e51['deliveryReport']){_0x454acd[_0xb4fd('0x38')]=!![];}return _0x18c0f7['update'](_0x454acd);}else{return logger[_0xb4fd('0x1b')](_0xb4fd('0x28'),_0xb4fd('0x29'),_0xb4fd('0x59'),util['inspect'](_0x40882b,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x23333c){return logger['error'](_0xb4fd('0x28'),_0xb4fd('0x29'),_0xb4fd('0x59'),util['inspect'](_0x23333c,{'showHidden':![],'depth':null}));});}else{logger[_0xb4fd('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb4fd('0x29'),_0xb4fd('0x59'),_0xb4fd('0x5a'));}}else{logger[_0xb4fd('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb4fd('0x29'),'infobip',_0xb4fd('0x39'));}break;case _0xb4fd('0x5b'):var _0x28a12c=require('crypto');if(_0x137e51['apiKey']){var _0x571571={};_0x571571[_0xb4fd('0x5c')]=_0x137e51['username'];_0x571571[_0xb4fd('0x23')]=_0x23b08f['phone'];_0x571571[_0xb4fd('0x5d')]=_0x137e51[_0xb4fd('0x23')];_0x571571[_0xb4fd('0x5e')]=_0x23b08f[_0xb4fd('0xd')];_0x571571['timestamp']=+new Date();var _0x216173='';var _0x155942='';var _0x5b4ebe=Object[_0xb4fd('0x5f')](_0x571571);_0x5b4ebe[_0xb4fd('0x60')]();for(var _0x5a2bf1=0x0;_0x5a2bf1<_0x5b4ebe[_0xb4fd('0x61')];_0x5a2bf1++){if(_0x216173!=''){_0x216173+='&';}_0x216173+=_0x5b4ebe[_0x5a2bf1]+'='+encodeURIComponent(_0x571571[_0x5b4ebe[_0x5a2bf1]]);_0x155942+=_0x571571[_0x5b4ebe[_0x5a2bf1]];}_0x155942+=_0x137e51[_0xb4fd('0x62')];_0x155942=_0x28a12c['createHash'](_0xb4fd('0x63'))[_0xb4fd('0x19')](_0x155942)[_0xb4fd('0x64')](_0xb4fd('0x65'));if(_0x216173!==''){_0x216173+='&';}_0x216173+=_0xb4fd('0x66')+_0x155942;var _0x57ce81={'method':'GET','uri':_0x137e51[_0xb4fd('0x53')]+_0xb4fd('0x67')+_0x216173,'json':!![]};return rp(_0x57ce81)[_0xb4fd('0x18')](function(_0xb0c444){var _0x3596f7=Object[_0xb4fd('0x5f')](_0xb0c444);if(_0xb0c444[_0x3596f7[0x0]][_0xb4fd('0x1b')]&&parseInt(_0xb0c444[_0x3596f7[0x0]][_0xb4fd('0x1b')])===0x0){var _0x4042c1={'messageId':_0xb0c444[_0x3596f7[0x0]][_0xb4fd('0x68')]};if(!_0x137e51[_0xb4fd('0x37')]){_0x4042c1[_0xb4fd('0x38')]=!![];}return _0x18c0f7[_0xb4fd('0x19')](_0x4042c1);}else{return logger[_0xb4fd('0x1b')](_0xb4fd('0x28'),'afterCreate',_0xb4fd('0x5b'),util[_0xb4fd('0x3d')](_0xb0c444[_0xb4fd('0x1b')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x462ae3){return logger['error'](_0xb4fd('0x28'),'afterCreate','csc',util['inspect'](_0x462ae3,{'showHidden':![],'depth':null}));});}else{logger[_0xb4fd('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xb4fd('0x5b'),'Missing\x20parameters:\x20apiKey');}break;case'clickatell':if(_0x137e51[_0xb4fd('0x62')]){var _0x53e09a={'method':_0xb4fd('0x32'),'uri':_0xb4fd('0x69'),'headers':{'Authorization':_0x137e51[_0xb4fd('0x62')]},'body':{'content':_0x23b08f[_0xb4fd('0xd')],'to':[_0x23b08f[_0xb4fd('0x23')]],'from':_0x137e51['phone'],'binary':![],'clientMessageId':'uuid','charset':_0xb4fd('0x6a')},'json':!![]};rp(_0x53e09a)[_0xb4fd('0x18')](function(_0x4d44ff){if(!_0x4d44ff[_0xb4fd('0x1b')]){var _0xc5c8b7={'messageId':_0x4d44ff[_0xb4fd('0x58')][0x0][_0xb4fd('0x6b')]};if(!_0x137e51['deliveryReport']){_0xc5c8b7[_0xb4fd('0x38')]=!![];}return _0x18c0f7[_0xb4fd('0x19')](_0xc5c8b7);}else{return logger[_0xb4fd('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb4fd('0x29'),_0xb4fd('0x6c'),util['inspect'](_0x4d44ff[_0xb4fd('0x1b')],{'showHidden':![],'depth':null}));}})[_0xb4fd('0x27')](function(_0xc171d9){return logger[_0xb4fd('0x1b')](_0xb4fd('0x28'),_0xb4fd('0x29'),_0xb4fd('0x6c'),util[_0xb4fd('0x3d')](_0xc171d9,{'showHidden':![],'depth':null}));});}else{logger[_0xb4fd('0x1b')](_0xb4fd('0x28'),'afterCreate',_0xb4fd('0x6c'),'Missing\x20parameters:\x20apiKey');}break;case _0xb4fd('0x6d'):if(_0x137e51[_0xb4fd('0x42')]&&_0x137e51[_0xb4fd('0x2c')]){var _0x671ce5=util[_0xb4fd('0x41')](_0xb4fd('0x4e'),_0x137e51[_0xb4fd('0x42')],_0x137e51[_0xb4fd('0x2c')]);var _0x4eb1ae={'method':_0xb4fd('0x32'),'uri':_0xb4fd('0x6e')+_0x137e51[_0xb4fd('0x6f')]+_0xb4fd('0x70'),'body':{'to':[_0x23b08f[_0xb4fd('0x23')]],'text':_0x23b08f['body'],'from':_0x137e51[_0xb4fd('0x23')],'applicationId':_0x137e51['applicationId']},'headers':{'Authorization':util[_0xb4fd('0x41')]('Basic\x20%s',new Buffer(_0x671ce5)[_0xb4fd('0x43')]('base64'))},'json':!![]};rp(_0x4eb1ae)[_0xb4fd('0x18')](function(_0x57deab){if(_0x57deab['id']){var _0x3c5042={'messageId':_0x57deab['id']};return _0x18c0f7[_0xb4fd('0x19')](_0x3c5042);}else{logger['error'](_0xb4fd('0x28'),_0xb4fd('0x29'),_0xb4fd('0x6d'),util[_0xb4fd('0x3d')](_0x57deab,{'showHidden':![],'depth':null}));}})[_0xb4fd('0x27')](function(_0x9ead9e){logger[_0xb4fd('0x1b')](_0xb4fd('0x28'),_0xb4fd('0x29'),_0xb4fd('0x6d'),util['inspect'](_0x9ead9e,{'showHidden':![],'depth':null}));});}else{logger[_0xb4fd('0x1b')](_0xb4fd('0x28'),_0xb4fd('0x29'),_0xb4fd('0x6d'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xb4fd('0x71'):if(_0x137e51[_0xb4fd('0x62')]){var _0x228d40={};var _0x57ce81={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':'Bearer\x20'+_0x137e51[_0xb4fd('0x62')],'Content-Type':_0xb4fd('0x56')},'body':{'from':_0x137e51['phone'],'to':_0x23b08f[_0xb4fd('0x23')],'text':_0x23b08f[_0xb4fd('0xd')]},'json':!![]};return rp(_0x57ce81)[_0xb4fd('0x18')](function(_0x4b18f3){if(_0x4b18f3[_0xb4fd('0x72')]==0xca){_0x228d40[_0xb4fd('0x73')]=_0x4b18f3;var _0x2efa1a={'method':_0xb4fd('0x32'),'uri':_0xb4fd('0x74'),'headers':{'Authorization':_0xb4fd('0x75')+_0x137e51['apiKey'],'Content-Type':_0xb4fd('0x56')},'body':{'refid':_0x228d40[_0xb4fd('0x73')][_0xb4fd('0x76')]},'json':!![]};return rp(_0x2efa1a)[_0xb4fd('0x18')](function(_0x5b7898){_0x228d40[_0xb4fd('0x77')]=_0x5b7898;var _0x36241d={'messageId':_0x228d40[_0xb4fd('0x73')][_0xb4fd('0x76')],'read':!![]};return _0x18c0f7[_0xb4fd('0x19')](_0x36241d);});}else{return logger[_0xb4fd('0x1b')](_0xb4fd('0x28'),'afterCreate',_0xb4fd('0x71'),util[_0xb4fd('0x3d')](_0x4b18f3,{'showHidden':![],'depth':null}));}})[_0xb4fd('0x27')](function(_0x8313a8){return logger[_0xb4fd('0x1b')](_0xb4fd('0x28'),_0xb4fd('0x29'),_0xb4fd('0x71'),util[_0xb4fd('0x3d')](_0x8313a8,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xb4fd('0x28'),_0xb4fd('0x29'),'intelepeer',_0xb4fd('0x78'));}break;}}})['finally'](function(){_0x1e1e16();});}else{_0x1e1e16();}}},'charset':_0xb4fd('0x79'),'collate':_0xb4fd('0x7a')});};
\ No newline at end of file
index 6287275..8ecb2d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76c6=['CreateSmsMessage','SmsMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x16efb2,_0x360c71){var _0x5976e8=function(_0x16798e){while(--_0x16798e){_0x16efb2['push'](_0x16efb2['shift']());}};_0x5976e8(++_0x360c71);}(_0x76c6,0xba));var _0x676c=function(_0x50819e,_0x505edd){_0x50819e=_0x50819e-0x0;var _0x4c95b2=_0x76c6[_0x50819e];return _0x4c95b2;};'use strict';var _=require(_0x676c('0x0'));var util=require(_0x676c('0x1'));var moment=require(_0x676c('0x2'));var BPromise=require(_0x676c('0x3'));var rs=require(_0x676c('0x4'));var fs=require('fs');var Redis=require(_0x676c('0x5'));var db=require(_0x676c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x676c('0x7'))(_0x676c('0x8'));var config=require(_0x676c('0x9'));var jayson=require(_0x676c('0xa'));var client=jayson[_0x676c('0xb')][_0x676c('0xc')]({'port':0x232a});config[_0x676c('0xd')]=_[_0x676c('0xe')](config[_0x676c('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x676c('0xf'))(new Redis(config[_0x676c('0xd')]));require(_0x676c('0x10'))[_0x676c('0x11')](socket);function respondWithRpcPromise(_0x17006c,_0xddf4c8,_0x4b566e){return new BPromise(function(_0x5a6887,_0x16905b){return client[_0x676c('0x12')](_0x17006c,_0x4b566e)[_0x676c('0x13')](function(_0x53d2c8){logger[_0x676c('0x14')](_0x676c('0x15'),_0xddf4c8,_0x676c('0x16'));logger[_0x676c('0x17')](_0x676c('0x18'),_0xddf4c8,_0x676c('0x16'),JSON[_0x676c('0x19')](_0x53d2c8));if(_0x53d2c8[_0x676c('0x1a')]){if(_0x53d2c8[_0x676c('0x1a')]['code']===0x1f4){logger[_0x676c('0x1a')]('SmsMessage,\x20%s,\x20%s',_0xddf4c8,_0x53d2c8[_0x676c('0x1a')][_0x676c('0x1b')]);return _0x16905b(_0x53d2c8[_0x676c('0x1a')][_0x676c('0x1b')]);}logger[_0x676c('0x1a')](_0x676c('0x15'),_0xddf4c8,_0x53d2c8[_0x676c('0x1a')][_0x676c('0x1b')]);return _0x5a6887(_0x53d2c8[_0x676c('0x1a')][_0x676c('0x1b')]);}else{logger[_0x676c('0x14')](_0x676c('0x15'),_0xddf4c8,_0x676c('0x16'));_0x5a6887(_0x53d2c8[_0x676c('0x1c')][_0x676c('0x1b')]);}})[_0x676c('0x1d')](function(_0x35373f){logger[_0x676c('0x1a')]('SmsMessage,\x20%s,\x20%s',_0xddf4c8,_0x35373f);_0x16905b(_0x35373f);});});}exports[_0x676c('0x1e')]=function(_0x4347b6){var _0x550939=this;return new Promise(function(_0x264bfb,_0x5a36d4){return db[_0x676c('0x1f')][_0x676c('0x20')](_0x4347b6[_0x676c('0x21')],{'raw':_0x4347b6[_0x676c('0x22')]?_0x4347b6[_0x676c('0x22')][_0x676c('0x23')]===undefined?!![]:![]:!![]})[_0x676c('0x13')](function(_0x32fde6){logger[_0x676c('0x14')]('CreateSmsMessage',_0x4347b6);logger[_0x676c('0x17')](_0x676c('0x1e'),_0x4347b6,JSON[_0x676c('0x19')](_0x32fde6));_0x264bfb(_0x32fde6);})['catch'](function(_0xc6b4eb){logger['error'](_0x676c('0x1e'),_0xc6b4eb[_0x676c('0x1b')],_0x4347b6);_0x5a36d4(_0x550939[_0x676c('0x1a')](0x1f4,_0xc6b4eb[_0x676c('0x1b')]));});});};
\ No newline at end of file
+var _0x9a8c=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','stringify','util','moment','bluebird','randomstring'];(function(_0x5cf4ea,_0x49625f){var _0x165f92=function(_0x2cf4d1){while(--_0x2cf4d1){_0x5cf4ea['push'](_0x5cf4ea['shift']());}};_0x165f92(++_0x49625f);}(_0x9a8c,0xce));var _0xc9a8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9a8c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xc9a8('0x0'));var moment=require(_0xc9a8('0x1'));var BPromise=require(_0xc9a8('0x2'));var rs=require(_0xc9a8('0x3'));var fs=require('fs');var Redis=require(_0xc9a8('0x4'));var db=require(_0xc9a8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc9a8('0x6'))(_0xc9a8('0x7'));var config=require('../../config/environment');var jayson=require(_0xc9a8('0x8'));var client=jayson[_0xc9a8('0x9')][_0xc9a8('0xa')]({'port':0x232a});config[_0xc9a8('0xb')]=_['defaults'](config['redis'],{'host':_0xc9a8('0xc'),'port':0x18eb});var socket=require(_0xc9a8('0xd'))(new Redis(config[_0xc9a8('0xb')]));require(_0xc9a8('0xe'))[_0xc9a8('0xf')](socket);function respondWithRpcPromise(_0x201ca9,_0x547da2,_0x51e8c6){return new BPromise(function(_0x3d22e4,_0x12df3b){return client[_0xc9a8('0x10')](_0x201ca9,_0x51e8c6)[_0xc9a8('0x11')](function(_0x2ee8b3){logger[_0xc9a8('0x12')](_0xc9a8('0x13'),_0x547da2,'request\x20sent');logger[_0xc9a8('0x14')](_0xc9a8('0x15'),_0x547da2,'request\x20sent',JSON['stringify'](_0x2ee8b3));if(_0x2ee8b3[_0xc9a8('0x16')]){if(_0x2ee8b3['error'][_0xc9a8('0x17')]===0x1f4){logger[_0xc9a8('0x16')](_0xc9a8('0x13'),_0x547da2,_0x2ee8b3[_0xc9a8('0x16')][_0xc9a8('0x18')]);return _0x12df3b(_0x2ee8b3[_0xc9a8('0x16')][_0xc9a8('0x18')]);}logger['error'](_0xc9a8('0x13'),_0x547da2,_0x2ee8b3['error'][_0xc9a8('0x18')]);return _0x3d22e4(_0x2ee8b3['error'][_0xc9a8('0x18')]);}else{logger[_0xc9a8('0x12')](_0xc9a8('0x13'),_0x547da2,_0xc9a8('0x19'));_0x3d22e4(_0x2ee8b3[_0xc9a8('0x1a')]['message']);}})[_0xc9a8('0x1b')](function(_0x45a877){logger[_0xc9a8('0x16')]('SmsMessage,\x20%s,\x20%s',_0x547da2,_0x45a877);_0x12df3b(_0x45a877);});});}exports[_0xc9a8('0x1c')]=function(_0x484ac8){var _0x1ef992=this;return new Promise(function(_0x437bea,_0xcf910f){return db[_0xc9a8('0x1d')][_0xc9a8('0x1e')](_0x484ac8[_0xc9a8('0x1f')],{'raw':_0x484ac8['options']?_0x484ac8[_0xc9a8('0x20')][_0xc9a8('0x21')]===undefined?!![]:![]:!![]})[_0xc9a8('0x11')](function(_0x257d77){logger[_0xc9a8('0x12')](_0xc9a8('0x1c'),_0x484ac8);logger['debug'](_0xc9a8('0x1c'),_0x484ac8,JSON[_0xc9a8('0x22')](_0x257d77));_0x437bea(_0x257d77);})[_0xc9a8('0x1b')](function(_0x4e9a4){logger[_0xc9a8('0x16')](_0xc9a8('0x1c'),_0x4e9a4[_0xc9a8('0x18')],_0x484ac8);_0xcf910f(_0x1ef992['error'](0x1f4,_0x4e9a4[_0xc9a8('0x18')]));});});};
\ No newline at end of file
index ceb3641..4318e28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe27e=['remove','update','emit','register','length'];(function(_0x38987f,_0xc79720){var _0x4cb697=function(_0x1af5ae){while(--_0x1af5ae){_0x38987f['push'](_0x38987f['shift']());}};_0x4cb697(++_0xc79720);}(_0xe27e,0x1c2));var _0xee27=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xe27e[_0x45783c];return _0x1161da;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=['save',_0xee27('0x0'),_0xee27('0x1')];function createListener(_0x4e1213,_0x2fa5f8){return function(_0x50faf6){_0x2fa5f8[_0xee27('0x2')](_0x4e1213,_0x50faf6);};}function removeListener(_0x4bfb1b,_0x120ba9){return function(){SmsMessageEvents['removeListener'](_0x4bfb1b,_0x120ba9);};}exports[_0xee27('0x3')]=function(_0x2aed64){for(var _0x442b7c=0x0,_0x537ec1=events[_0xee27('0x4')];_0x442b7c<_0x537ec1;_0x442b7c++){var _0x347fb3=events[_0x442b7c];var _0x384549=createListener('smsMessage:'+_0x347fb3,_0x2aed64);SmsMessageEvents['on'](_0x347fb3,_0x384549);}};
\ No newline at end of file
+var _0x105a=['save','update','emit','removeListener','length','smsMessage:','./smsMessage.events'];(function(_0x47bf90,_0xb9a03b){var _0x608d23=function(_0x1c4952){while(--_0x1c4952){_0x47bf90['push'](_0x47bf90['shift']());}};_0x608d23(++_0xb9a03b);}(_0x105a,0x19c));var _0xa105=function(_0xb72077,_0x2220ff){_0xb72077=_0xb72077-0x0;var _0x23a7c3=_0x105a[_0xb72077];return _0x23a7c3;};'use strict';var SmsMessageEvents=require(_0xa105('0x0'));var events=[_0xa105('0x1'),'remove',_0xa105('0x2')];function createListener(_0x50fb7d,_0x2d6773){return function(_0x3ac2a4){_0x2d6773[_0xa105('0x3')](_0x50fb7d,_0x3ac2a4);};}function removeListener(_0x546217,_0x354c8f){return function(){SmsMessageEvents[_0xa105('0x4')](_0x546217,_0x354c8f);};}exports['register']=function(_0x1c7cd7){for(var _0x29bb48=0x0,_0x4a796d=events[_0xa105('0x5')];_0x29bb48<_0x4a796d;_0x29bb48++){var _0x6c5ff4=events[_0x29bb48];var _0x27056a=createListener(_0xa105('0x6')+_0x6c5ff4,_0x1c7cd7);SmsMessageEvents['on'](_0x6c5ff4,_0x27056a);}};
\ No newline at end of file
index 28e2883..6aecc43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13b0=['/:id/users','post','create','addTeams','addAgents','update','delete','destroy','removeAgents','util','path','express','../../components/interaction/service','./smsQueue.controller','isAuthenticated','index','get','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x13b0,0xe1));var _0x013b=function(_0x584a8f,_0x330d6c){_0x584a8f=_0x584a8f-0x0;var _0x3913a1=_0x13b0[_0x584a8f];return _0x3913a1;};'use strict';var multer=require('multer');var util=require(_0x013b('0x0'));var path=require(_0x013b('0x1'));var timeout=require('connect-timeout');var express=require(_0x013b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x013b('0x3'));var config=require('../../config/environment');var controller=require(_0x013b('0x4'));router['get']('/',auth[_0x013b('0x5')](),controller[_0x013b('0x6')]);router[_0x013b('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x013b('0x8')]);router[_0x013b('0x7')](_0x013b('0x9'),auth[_0x013b('0x5')](),controller[_0x013b('0xa')]);router['get'](_0x013b('0xb'),auth[_0x013b('0x5')](),controller[_0x013b('0xc')]);router['get'](_0x013b('0xd'),auth[_0x013b('0x5')](),controller[_0x013b('0xe')]);router['get'](_0x013b('0xf'),auth['isAuthenticated'](),controller['getAgents']);router[_0x013b('0x10')]('/',auth[_0x013b('0x5')](),controller[_0x013b('0x11')]);router[_0x013b('0x10')](_0x013b('0xd'),auth[_0x013b('0x5')](),controller[_0x013b('0x12')]);router['post'](_0x013b('0xf'),auth[_0x013b('0x5')](),controller[_0x013b('0x13')]);router['put'](_0x013b('0x9'),auth['isAuthenticated'](),controller[_0x013b('0x14')]);router[_0x013b('0x15')](_0x013b('0x9'),auth['isAuthenticated'](),controller[_0x013b('0x16')]);router['delete'](_0x013b('0xd'),auth[_0x013b('0x5')](),controller['removeTeams']);router[_0x013b('0x15')](_0x013b('0xf'),auth[_0x013b('0x5')](),controller[_0x013b('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0x2472=['describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','destroy','removeTeams','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','/describe','isAuthenticated'];(function(_0x396fb3,_0x595c53){var _0x3d298f=function(_0x47870d){while(--_0x47870d){_0x396fb3['push'](_0x396fb3['shift']());}};_0x3d298f(++_0x595c53);}(_0x2472,0x88));var _0x2247=function(_0x32da2b,_0x38bc0a){_0x32da2b=_0x32da2b-0x0;var _0x5bc582=_0x2472[_0x32da2b];return _0x5bc582;};'use strict';var multer=require(_0x2247('0x0'));var util=require(_0x2247('0x1'));var path=require(_0x2247('0x2'));var timeout=require(_0x2247('0x3'));var express=require(_0x2247('0x4'));var router=express[_0x2247('0x5')]();var fs_extra=require(_0x2247('0x6'));var auth=require(_0x2247('0x7'));var interaction=require(_0x2247('0x8'));var config=require(_0x2247('0x9'));var controller=require(_0x2247('0xa'));router[_0x2247('0xb')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x2247('0xc'),auth[_0x2247('0xd')](),controller[_0x2247('0xe')]);router[_0x2247('0xb')](_0x2247('0xf'),auth[_0x2247('0xd')](),controller[_0x2247('0x10')]);router[_0x2247('0xb')](_0x2247('0x11'),auth[_0x2247('0xd')](),controller['getMembers']);router[_0x2247('0xb')](_0x2247('0x12'),auth[_0x2247('0xd')](),controller[_0x2247('0x13')]);router[_0x2247('0xb')](_0x2247('0x14'),auth[_0x2247('0xd')](),controller[_0x2247('0x15')]);router[_0x2247('0x16')]('/',auth[_0x2247('0xd')](),controller[_0x2247('0x17')]);router[_0x2247('0x16')](_0x2247('0x12'),auth[_0x2247('0xd')](),controller['addTeams']);router[_0x2247('0x16')]('/:id/users',auth[_0x2247('0xd')](),controller[_0x2247('0x18')]);router['put']('/:id',auth[_0x2247('0xd')](),controller['update']);router['delete'](_0x2247('0xf'),auth[_0x2247('0xd')](),controller[_0x2247('0x19')]);router['delete'](_0x2247('0x12'),auth['isAuthenticated'](),controller[_0x2247('0x1a')]);router[_0x2247('0x1b')](_0x2247('0x14'),auth['isAuthenticated'](),controller[_0x2247('0x1c')]);module[_0x2247('0x1d')]=router;
\ No newline at end of file
index d04bfe6..650f114 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4681=['roundrobin','sequelize','exports','STRING','name','INTEGER','rrmemory'];(function(_0x3cf4d3,_0x48065e){var _0x4e547b=function(_0x28f85a){while(--_0x28f85a){_0x3cf4d3['push'](_0x3cf4d3['shift']());}};_0x4e547b(++_0x48065e);}(_0x4681,0x9b));var _0x1468=function(_0x3d864a,_0x378ce5){_0x3d864a=_0x3d864a-0x0;var _0x26e087=_0x4681[_0x3d864a];return _0x26e087;};'use strict';var Sequelize=require(_0x1468('0x0'));module[_0x1468('0x1')]={'name':{'type':Sequelize[_0x1468('0x2')],'unique':_0x1468('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1468('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x1468('0x5'),'beepall',_0x1468('0x6'))}};
\ No newline at end of file
+var _0x7774=['roundrobin','exports','STRING','ENUM','beepall'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x7774,0x1b9));var _0x4777=function(_0x868b7c,_0xfa438b){_0x868b7c=_0x868b7c-0x0;var _0x21683c=_0x7774[_0x868b7c];return _0x21683c;};'use strict';var Sequelize=require('sequelize');module[_0x4777('0x0')]={'name':{'type':Sequelize[_0x4777('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4777('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4777('0x2')]('rrmemory',_0x4777('0x3'),_0x4777('0x4'))}};
\ No newline at end of file
index 6a01e94..2c8ef22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf0ba=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','SmsQueue','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','params','length','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','User','UserId','updatedAt','createdAt','format','%s/%s','smsPause','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','UserSmsQueue','findOrCreate','forEach','emit','userSmsQueue:save','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','all','union','value','removeTeams','isEmpty','userSmsQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x4da224,_0x2e68b7){var _0x1c4fee=function(_0x4be10b){while(--_0x4be10b){_0x4da224['push'](_0x4da224['shift']());}};_0x1c4fee(++_0x2e68b7);}(_0xf0ba,0x7a));var _0xaf0b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf0ba[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xaf0b('0x0'));var rimraf=require(_0xaf0b('0x1'));var zipdir=require(_0xaf0b('0x2'));var jsonpatch=require(_0xaf0b('0x3'));var rp=require(_0xaf0b('0x4'));var moment=require('moment');var BPromise=require(_0xaf0b('0x5'));var Mustache=require('mustache');var util=require(_0xaf0b('0x6'));var path=require(_0xaf0b('0x7'));var sox=require(_0xaf0b('0x8'));var csv=require(_0xaf0b('0x9'));var ejs=require(_0xaf0b('0xa'));var fs=require('fs');var fs_extra=require(_0xaf0b('0xb'));var _=require(_0xaf0b('0xc'));var squel=require(_0xaf0b('0xd'));var crypto=require(_0xaf0b('0xe'));var jsforce=require(_0xaf0b('0xf'));var deskjs=require(_0xaf0b('0x10'));var toCsv=require(_0xaf0b('0x9'));var querystring=require(_0xaf0b('0x11'));var Papa=require(_0xaf0b('0x12'));var Redis=require(_0xaf0b('0x13'));var authService=require(_0xaf0b('0x14'));var qs=require(_0xaf0b('0x15'));var as=require(_0xaf0b('0x16'));var hardwareService=require(_0xaf0b('0x17'));var logger=require('../../config/logger')(_0xaf0b('0x18'));var utils=require('../../config/utils');var config=require(_0xaf0b('0x19'));var licenseUtil=require(_0xaf0b('0x1a'));var db=require('../../mysqldb')['db'];config[_0xaf0b('0x1b')]=_[_0xaf0b('0x1c')](config[_0xaf0b('0x1b')],{'host':_0xaf0b('0x1d'),'port':0x18eb});var socket=require(_0xaf0b('0x1e'))(new Redis(config[_0xaf0b('0x1b')]));require('./smsQueue.socket')['register'](socket);function respondWithStatusCode(_0x5a273c,_0x573b83){_0x573b83=_0x573b83||0xcc;return function(_0x3b09db){if(_0x3b09db){return _0x5a273c[_0xaf0b('0x1f')](_0x573b83);}return _0x5a273c[_0xaf0b('0x20')](_0x573b83)[_0xaf0b('0x21')]();};}function respondWithResult(_0x584236,_0x27df68){_0x27df68=_0x27df68||0xc8;return function(_0x57656c){if(_0x57656c){return _0x584236['status'](_0x27df68)[_0xaf0b('0x22')](_0x57656c);}};}function respondWithFilteredResult(_0x23cd7e,_0x28d23c){return function(_0x8e462e){if(_0x8e462e){var _0x9362e0=typeof _0x28d23c[_0xaf0b('0x23')]==='undefined'&&typeof _0x28d23c[_0xaf0b('0x24')]===_0xaf0b('0x25');var _0x34f98c=_0x8e462e[_0xaf0b('0x26')];var _0x5a4894=_0x9362e0?0x0:_0x28d23c[_0xaf0b('0x23')];var _0x5735c6=_0x9362e0?_0x8e462e['count']:_0x28d23c[_0xaf0b('0x23')]+_0x28d23c[_0xaf0b('0x24')];var _0x344fbb;if(_0x5735c6>=_0x34f98c){_0x5735c6=_0x34f98c;_0x344fbb=0xc8;}else{_0x344fbb=0xce;}_0x23cd7e[_0xaf0b('0x20')](_0x344fbb);return _0x23cd7e[_0xaf0b('0x27')](_0xaf0b('0x28'),_0x5a4894+'-'+_0x5735c6+'/'+_0x34f98c)['json'](_0x8e462e);}return null;};}function patchUpdates(_0x51c93d){return function(_0x1e068){try{jsonpatch[_0xaf0b('0x29')](_0x1e068,_0x51c93d,!![]);}catch(_0x91fde){return BPromise[_0xaf0b('0x2a')](_0x91fde);}return _0x1e068[_0xaf0b('0x2b')]();};}function saveUpdates(_0x43157c,_0x5814ba){return function(_0x484bf8){if(_0x484bf8){return _0x484bf8[_0xaf0b('0x2c')](_0x43157c)[_0xaf0b('0x2d')](function(_0x4ba937){return _0x4ba937;});}return null;};}function removeEntity(_0x1e40cb,_0xb94d7b){return function(_0x542ec4){if(_0x542ec4){return _0x542ec4[_0xaf0b('0x2e')]()[_0xaf0b('0x2d')](function(){var _0x3106a4=_0x542ec4[_0xaf0b('0x2f')]({'plain':!![]});var _0x4c82dd=_0xaf0b('0x30');return db[_0xaf0b('0x31')][_0xaf0b('0x2e')]({'where':{'type':_0x4c82dd,'resourceId':_0x3106a4['id']}})[_0xaf0b('0x2d')](function(){return _0x542ec4;});})[_0xaf0b('0x2d')](function(){_0x1e40cb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xc8bc53,_0x1d03d8){return function(_0x74b60f){if(!_0x74b60f){_0xc8bc53[_0xaf0b('0x1f')](0x194);}return _0x74b60f;};}function handleError(_0x5a7621,_0x2cc44b){_0x2cc44b=_0x2cc44b||0x1f4;return function(_0x56aa64){logger[_0xaf0b('0x32')](_0x56aa64[_0xaf0b('0x33')]);if(_0x56aa64['name']){delete _0x56aa64[_0xaf0b('0x34')];}_0x5a7621[_0xaf0b('0x20')](_0x2cc44b)['send'](_0x56aa64);};}exports['index']=function(_0x1c1d67,_0x4092cd){var _0x2a1a9e={},_0x3d1300={},_0xa64943={'count':0x0,'rows':[]};var _0x163d97=_['map'](db[_0xaf0b('0x35')][_0xaf0b('0x36')],function(_0x11b466){return{'name':_0x11b466['fieldName'],'type':_0x11b466[_0xaf0b('0x37')][_0xaf0b('0x38')]};});_0x3d1300[_0xaf0b('0x39')]=_[_0xaf0b('0x3a')](_0x163d97,_0xaf0b('0x34'));_0x3d1300[_0xaf0b('0x3b')]=_[_0xaf0b('0x3c')](_0x1c1d67['query']);_0x3d1300[_0xaf0b('0x3d')]=_[_0xaf0b('0x3e')](_0x3d1300[_0xaf0b('0x39')],_0x3d1300[_0xaf0b('0x3b')]);_0x2a1a9e['attributes']=_[_0xaf0b('0x3e')](_0x3d1300[_0xaf0b('0x39')],qs[_0xaf0b('0x3f')](_0x1c1d67[_0xaf0b('0x3b')][_0xaf0b('0x3f')]));_0x2a1a9e['attributes']=_0x2a1a9e['attributes']['length']?_0x2a1a9e[_0xaf0b('0x40')]:_0x3d1300[_0xaf0b('0x39')];if(!_0x1c1d67['query'][_0xaf0b('0x41')](_0xaf0b('0x42'))){_0x2a1a9e['limit']=qs[_0xaf0b('0x24')](_0x1c1d67[_0xaf0b('0x3b')][_0xaf0b('0x24')]);_0x2a1a9e[_0xaf0b('0x23')]=qs[_0xaf0b('0x23')](_0x1c1d67[_0xaf0b('0x3b')][_0xaf0b('0x23')]);}_0x2a1a9e[_0xaf0b('0x43')]=qs[_0xaf0b('0x44')](_0x1c1d67[_0xaf0b('0x3b')][_0xaf0b('0x44')]);_0x2a1a9e[_0xaf0b('0x45')]=qs['filters'](_[_0xaf0b('0x46')](_0x1c1d67[_0xaf0b('0x3b')],_0x3d1300[_0xaf0b('0x3d')]),_0x163d97);if(_0x1c1d67[_0xaf0b('0x3b')]['filter']){_0x2a1a9e[_0xaf0b('0x45')]=_[_0xaf0b('0x47')](_0x2a1a9e[_0xaf0b('0x45')],{'$or':_[_0xaf0b('0x3a')](_0x163d97,function(_0x4a9eda){if(_0x4a9eda[_0xaf0b('0x37')]!==_0xaf0b('0x48')){var _0x382e25={};_0x382e25[_0x4a9eda[_0xaf0b('0x34')]]={'$like':'%'+_0x1c1d67[_0xaf0b('0x3b')][_0xaf0b('0x49')]+'%'};return _0x382e25;}})});}_0x2a1a9e=_[_0xaf0b('0x47')]({},_0x2a1a9e,_0x1c1d67[_0xaf0b('0x4a')]);var _0x4a5592={'where':_0x2a1a9e[_0xaf0b('0x45')]};return db[_0xaf0b('0x35')][_0xaf0b('0x26')](_0x4a5592)['then'](function(_0x4b3a4a){_0xa64943['count']=_0x4b3a4a;if(_0x1c1d67['query']['includeAll']){_0x2a1a9e[_0xaf0b('0x4b')]=[{'all':!![]}];}return db[_0xaf0b('0x35')][_0xaf0b('0x4c')](_0x2a1a9e);})[_0xaf0b('0x2d')](function(_0x40b0d6){_0xa64943[_0xaf0b('0x4d')]=_0x40b0d6;return _0xa64943;})[_0xaf0b('0x2d')](respondWithFilteredResult(_0x4092cd,_0x2a1a9e))[_0xaf0b('0x4e')](handleError(_0x4092cd,null));};exports['show']=function(_0x1e2155,_0x5d81ec){var _0x4c6e4e={'raw':!![],'where':{'id':_0x1e2155[_0xaf0b('0x4f')]['id']}},_0x271a18={};_0x271a18['model']=_[_0xaf0b('0x3c')](db['SmsQueue'][_0xaf0b('0x36')]);_0x271a18['query']=_[_0xaf0b('0x3c')](_0x1e2155[_0xaf0b('0x3b')]);_0x271a18[_0xaf0b('0x3d')]=_[_0xaf0b('0x3e')](_0x271a18['model'],_0x271a18[_0xaf0b('0x3b')]);_0x4c6e4e[_0xaf0b('0x40')]=_[_0xaf0b('0x3e')](_0x271a18[_0xaf0b('0x39')],qs[_0xaf0b('0x3f')](_0x1e2155[_0xaf0b('0x3b')][_0xaf0b('0x3f')]));_0x4c6e4e[_0xaf0b('0x40')]=_0x4c6e4e[_0xaf0b('0x40')][_0xaf0b('0x50')]?_0x4c6e4e[_0xaf0b('0x40')]:_0x271a18['model'];if(_0x1e2155[_0xaf0b('0x3b')][_0xaf0b('0x51')]){_0x4c6e4e[_0xaf0b('0x4b')]=[{'all':!![]}];}_0x4c6e4e=_[_0xaf0b('0x47')]({},_0x4c6e4e,_0x1e2155[_0xaf0b('0x4a')]);return db[_0xaf0b('0x35')][_0xaf0b('0x52')](_0x4c6e4e)[_0xaf0b('0x2d')](handleEntityNotFound(_0x5d81ec,null))[_0xaf0b('0x2d')](respondWithResult(_0x5d81ec,null))[_0xaf0b('0x4e')](handleError(_0x5d81ec,null));};exports[_0xaf0b('0x53')]=function(_0xb7410,_0x1749c1){return db[_0xaf0b('0x35')][_0xaf0b('0x53')](_0xb7410['body'],{})[_0xaf0b('0x2d')](function(_0x4ddc9c){var _0x4e4174=_0xb7410[_0xaf0b('0x54')]['get']({'plain':!![]});if(!_0x4e4174)throw new Error(_0xaf0b('0x55'));if(_0x4e4174[_0xaf0b('0x56')]===_0xaf0b('0x54')){var _0x1b7731=_0x4ddc9c[_0xaf0b('0x2f')]({'plain':!![]});var _0x581444='SmsQueues';return db['UserProfileSection'][_0xaf0b('0x52')]({'where':{'name':_0x581444,'userProfileId':_0x4e4174['userProfileId']},'raw':!![]})['then'](function(_0x41b331){if(_0x41b331&&_0x41b331[_0xaf0b('0x57')]===0x0){return db[_0xaf0b('0x31')][_0xaf0b('0x53')]({'name':_0x1b7731[_0xaf0b('0x34')],'resourceId':_0x1b7731['id'],'type':_0x41b331[_0xaf0b('0x34')],'sectionId':_0x41b331['id']},{})[_0xaf0b('0x2d')](function(){return _0x4ddc9c;});}else{return _0x4ddc9c;}})[_0xaf0b('0x4e')](function(_0x1e25ab){logger[_0xaf0b('0x32')](_0xaf0b('0x58'),_0x1e25ab);throw _0x1e25ab;});}return _0x4ddc9c;})[_0xaf0b('0x2d')](respondWithResult(_0x1749c1,0xc9))['catch'](handleError(_0x1749c1,null));};exports[_0xaf0b('0x2c')]=function(_0x44654c,_0xa82500){if(_0x44654c['body']['id']){delete _0x44654c[_0xaf0b('0x59')]['id'];}return db[_0xaf0b('0x35')]['find']({'where':{'id':_0x44654c[_0xaf0b('0x4f')]['id']}})[_0xaf0b('0x2d')](handleEntityNotFound(_0xa82500,null))[_0xaf0b('0x2d')](saveUpdates(_0x44654c[_0xaf0b('0x59')],null))['then'](respondWithResult(_0xa82500,null))[_0xaf0b('0x4e')](handleError(_0xa82500,null));};exports[_0xaf0b('0x2e')]=function(_0x55fe8d,_0x3d9df2){return db['SmsQueue'][_0xaf0b('0x52')]({'where':{'id':_0x55fe8d[_0xaf0b('0x4f')]['id']}})[_0xaf0b('0x2d')](handleEntityNotFound(_0x3d9df2,null))[_0xaf0b('0x2d')](removeEntity(_0x3d9df2,null))[_0xaf0b('0x4e')](handleError(_0x3d9df2,null));};exports[_0xaf0b('0x5a')]=function(_0x1d95d6,_0x2732a6){return db[_0xaf0b('0x35')][_0xaf0b('0x5a')]()[_0xaf0b('0x2d')](respondWithResult(_0x2732a6,null))['catch'](handleError(_0x2732a6,null));};exports[_0xaf0b('0x5b')]=function(_0x64c2ee,_0x34e774,_0x39f899){var _0x19f2b2={'raw':!![],'where':{}},_0x4b791c={},_0x2c915b;return db[_0xaf0b('0x35')][_0xaf0b('0x5c')]({'where':{'id':_0x64c2ee[_0xaf0b('0x4f')]['id']}})[_0xaf0b('0x2d')](handleEntityNotFound(_0x34e774,null))['then'](function(_0xec1cf7){if(_0xec1cf7){_0x2c915b=_0xec1cf7[_0xaf0b('0x2f')]({'plain':!![]});_0x4b791c[_0xaf0b('0x39')]=_[_0xaf0b('0x3c')](db['UserSmsQueue'][_0xaf0b('0x36')]);_0x4b791c['query']=_[_0xaf0b('0x3c')](_0x64c2ee['query']);_0x4b791c['filters']=_['intersection'](_0x4b791c[_0xaf0b('0x39')],_0x4b791c[_0xaf0b('0x3b')]);_0x19f2b2['attributes']=_['intersection'](_0x4b791c[_0xaf0b('0x39')],qs[_0xaf0b('0x3f')](_0x64c2ee[_0xaf0b('0x3b')][_0xaf0b('0x3f')]));_0x19f2b2[_0xaf0b('0x40')]=_0x19f2b2[_0xaf0b('0x40')]['length']?_0x19f2b2['attributes']:_0x4b791c['model'];if(!_0x64c2ee[_0xaf0b('0x3b')][_0xaf0b('0x41')]('nolimit')){_0x19f2b2[_0xaf0b('0x24')]=qs['limit'](_0x64c2ee[_0xaf0b('0x3b')][_0xaf0b('0x24')]);_0x19f2b2['offset']=qs[_0xaf0b('0x23')](_0x64c2ee['query'][_0xaf0b('0x23')]);}_0x19f2b2['order']=qs[_0xaf0b('0x44')](_0x64c2ee[_0xaf0b('0x3b')][_0xaf0b('0x44')]);_0x19f2b2[_0xaf0b('0x45')]=qs[_0xaf0b('0x3d')](_['pick'](_0x64c2ee['query'],_0x4b791c[_0xaf0b('0x3d')]));_0x19f2b2[_0xaf0b('0x45')]['SmsQueueId']=_0xec1cf7['id'];if(_0x64c2ee[_0xaf0b('0x3b')][_0xaf0b('0x49')]){_0x19f2b2[_0xaf0b('0x45')]=_['merge'](_0x19f2b2[_0xaf0b('0x45')],{'$or':_[_0xaf0b('0x3a')](_0x19f2b2['attributes'],function(_0x36d6c6){var _0x4a8880={};_0x4a8880[_0x36d6c6]={'$like':'%'+_0x64c2ee[_0xaf0b('0x3b')][_0xaf0b('0x49')]+'%'};return _0x4a8880;})});}_0x19f2b2=_[_0xaf0b('0x47')]({},_0x19f2b2,_0x64c2ee[_0xaf0b('0x4a')]);return db['UserSmsQueue'][_0xaf0b('0x4c')](_0x19f2b2);}})['then'](function(_0x1f1f5d){if(_0x1f1f5d){return db[_0xaf0b('0x5d')]['findAndCountAll']({'where':{'id':_[_0xaf0b('0x3a')](_0x1f1f5d,_0xaf0b('0x5e')),'role':'agent'},'attributes':['id',_0xaf0b('0x34'),'smsPause',_0xaf0b('0x5f'),_0xaf0b('0x60')]});}})['then'](function(_0x28ef69){if(_0x28ef69){return{'count':_0x28ef69[_0xaf0b('0x26')],'rows':_['map'](_0x28ef69[_0xaf0b('0x4d')],function(_0x1bc269){return{'membername':_0x1bc269['name'],'UserId':_0x1bc269['id'],'queue_name':_0x2c915b[_0xaf0b('0x34')],'SmsQueueId':_0x2c915b['id'],'interface':util[_0xaf0b('0x61')](_0xaf0b('0x62'),'SIP',_0x1bc269[_0xaf0b('0x34')]),'penalty':0x0,'paused':_0x1bc269[_0xaf0b('0x63')],'createdAt':_0x1bc269[_0xaf0b('0x60')],'updatedAt':_0x1bc269[_0xaf0b('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xaf0b('0x2d')](respondWithFilteredResult(_0x34e774,_0x19f2b2))[_0xaf0b('0x4e')](handleError(_0x34e774,null));};exports[_0xaf0b('0x64')]=function(_0x486152,_0x269fb3,_0x1e205f){var _0x5410be={};var _0x1bdbe2={};var _0x46ab03;var _0x4dc3f3;return db[_0xaf0b('0x35')][_0xaf0b('0x5c')]({'where':{'id':_0x486152[_0xaf0b('0x4f')]['id']}})[_0xaf0b('0x2d')](handleEntityNotFound(_0x269fb3,null))['then'](function(_0x560746){if(_0x560746){_0x46ab03=_0x560746;_0x1bdbe2[_0xaf0b('0x39')]=_[_0xaf0b('0x3c')](db[_0xaf0b('0x65')]['rawAttributes']);_0x1bdbe2['query']=_['keys'](_0x486152[_0xaf0b('0x3b')]);_0x1bdbe2[_0xaf0b('0x3d')]=_[_0xaf0b('0x3e')](_0x1bdbe2[_0xaf0b('0x39')],_0x1bdbe2['query']);_0x5410be[_0xaf0b('0x40')]=_[_0xaf0b('0x3e')](_0x1bdbe2[_0xaf0b('0x39')],qs[_0xaf0b('0x3f')](_0x486152[_0xaf0b('0x3b')]['fields']));_0x5410be[_0xaf0b('0x40')]=_0x5410be[_0xaf0b('0x40')]['length']?_0x5410be['attributes']:_0x1bdbe2[_0xaf0b('0x39')];_0x5410be['order']=qs[_0xaf0b('0x44')](_0x486152[_0xaf0b('0x3b')][_0xaf0b('0x44')]);_0x5410be[_0xaf0b('0x45')]=qs[_0xaf0b('0x3d')](_[_0xaf0b('0x46')](_0x486152['query'],_0x1bdbe2[_0xaf0b('0x3d')]));if(_0x486152[_0xaf0b('0x3b')][_0xaf0b('0x49')]){_0x5410be[_0xaf0b('0x45')]=_[_0xaf0b('0x47')](_0x5410be['where'],{'$or':_[_0xaf0b('0x3a')](_0x5410be[_0xaf0b('0x40')],function(_0x54ba50){var _0x422f95={};_0x422f95[_0x54ba50]={'$like':'%'+_0x486152[_0xaf0b('0x3b')][_0xaf0b('0x49')]+'%'};return _0x422f95;})});}_0x5410be=_[_0xaf0b('0x47')]({},_0x5410be,_0x486152['options']);return _0x46ab03[_0xaf0b('0x64')](_0x5410be);}})[_0xaf0b('0x2d')](function(_0x365a4f){if(_0x365a4f){_0x4dc3f3=_0x365a4f[_0xaf0b('0x50')];if(!_0x486152[_0xaf0b('0x3b')][_0xaf0b('0x41')]('nolimit')){_0x5410be[_0xaf0b('0x24')]=qs['limit'](_0x486152['query'][_0xaf0b('0x24')]);_0x5410be[_0xaf0b('0x23')]=qs[_0xaf0b('0x23')](_0x486152['query'][_0xaf0b('0x23')]);}return _0x46ab03[_0xaf0b('0x64')](_0x5410be);}})[_0xaf0b('0x2d')](function(_0x2b0d2a){if(_0x2b0d2a){return _0x2b0d2a?{'count':_0x4dc3f3,'rows':_0x2b0d2a}:null;}})[_0xaf0b('0x2d')](respondWithResult(_0x269fb3,null))['catch'](handleError(_0x269fb3,null));};exports[_0xaf0b('0x66')]=function(_0x257de8,_0x5dc534,_0x367764){var _0x303231=_0x257de8['body'][_0xaf0b('0x67')];return db[_0xaf0b('0x65')][_0xaf0b('0x4c')]({'where':{'id':_0x303231},'attributes':['id'],'include':[{'model':db[_0xaf0b('0x5d')],'as':_0xaf0b('0x68'),'attributes':['id',_0xaf0b('0x34'),_0xaf0b('0x69'),'voicePause',_0xaf0b('0x6a')],'raw':!![]}]})[_0xaf0b('0x2d')](function(_0x54581e){if(_0x54581e){var _0xb1937b=_[_0xaf0b('0x6b')](_0x54581e,function(_0x47194d){var _0x637865=_0x47194d['get']({'plain':!![]});return _0x637865[_0xaf0b('0x68')];});return db[_0xaf0b('0x35')][_0xaf0b('0x52')]({'where':{'id':_0x257de8['params']['id']}})[_0xaf0b('0x2d')](function(_0x1541ff){return db[_0xaf0b('0x6c')][_0xaf0b('0x6d')](function(_0x933ee){return _0x1541ff[_0xaf0b('0x66')](_0x303231,{'transaction':_0x933ee})[_0xaf0b('0x2d')](function(){return BPromise['each'](_0xb1937b,function(_0xaaf67b){return db[_0xaf0b('0x6e')][_0xaf0b('0x6f')]({'where':{'UserId':_0xaaf67b['id'],'SmsQueueId':_0x257de8[_0xaf0b('0x4f')]['id']},'transaction':_0x933ee});});})['then'](function(){_0xb1937b[_0xaf0b('0x70')](function(_0x322282){socket[_0xaf0b('0x71')](_0xaf0b('0x72'),{'UserId':_0x322282['id'],'SmsQueueId':_0x1541ff['id']});});});});});}})[_0xaf0b('0x2d')](respondWithStatusCode(_0x5dc534,null))['catch'](handleError(_0x5dc534,null));};exports['removeTeams']=function(_0x296b57,_0xdd19a4,_0x10dc6c){return db[_0xaf0b('0x65')][_0xaf0b('0x4c')]({'where':{'id':_0x296b57[_0xaf0b('0x3b')][_0xaf0b('0x67')]},'attributes':['id'],'include':[{'model':db[_0xaf0b('0x5d')],'as':_0xaf0b('0x68'),'attributes':['id'],'raw':!![]}]})[_0xaf0b('0x2d')](handleEntityNotFound(_0xdd19a4,null))[_0xaf0b('0x2d')](function(_0x5bd25c){var _0x5795dd=_['map'](_0x5bd25c,'id');var _0x63b1f7=[];var _0xd1470c=[];var _0xb96eba=squel[_0xaf0b('0x73')]();_0xb96eba[_0xaf0b('0x74')](_0xaf0b('0x75'))['from']('team_has_sms_queues','tq')[_0xaf0b('0x76')](_0xaf0b('0x77'),'ut',_0xaf0b('0x78'))['where']('SmsQueueId\x20=\x20?',_0x296b57['params']['id']);for(var _0xe8329a=0x0;_0xe8329a<_0x5bd25c[_0xaf0b('0x50')];_0xe8329a+=0x1){let _0x1d498c=_0x5bd25c[_0xe8329a];for(var _0x836252=0x0;_0x836252<_0x1d498c[_0xaf0b('0x68')][_0xaf0b('0x50')];_0x836252+=0x1){let _0x301151=_0x1d498c[_0xaf0b('0x68')][_0x836252];var _0x40d130=_0xb96eba[_0xaf0b('0x79')]();_0x40d130['where'](_0xaf0b('0x7a'),_0x301151['id']);_0xd1470c[_0xaf0b('0x7b')](db['sequelize'][_0xaf0b('0x3b')](_0x40d130['toString'](),{'type':db['sequelize'][_0xaf0b('0x7c')]['SELECT']})[_0xaf0b('0x2d')](function(_0x5a9253){if(_0x5a9253['length']===0x1){return _0x301151['id'];}else{var _0x980ac7=_[_0xaf0b('0x7d')](_['map'](_0x5a9253,_0xaf0b('0x7e')),function(_0x3f9f56){return _['includes'](_0x5795dd,_0x3f9f56);});if(_0x980ac7){return _0x301151['id'];}}}));}}return BPromise[_0xaf0b('0x7f')](_0xd1470c)['then'](function(_0x19478c){_0x63b1f7=_(_0x63b1f7)[_0xaf0b('0x80')](_0x19478c)['compact']()[_0xaf0b('0x81')]();return db[_0xaf0b('0x35')][_0xaf0b('0x52')]({'where':{'id':_0x296b57[_0xaf0b('0x4f')]['id']}})[_0xaf0b('0x2d')](function(_0x3bb05e){return db[_0xaf0b('0x6c')][_0xaf0b('0x6d')](function(_0xc26d20){return _0x3bb05e[_0xaf0b('0x82')](_0x296b57[_0xaf0b('0x3b')][_0xaf0b('0x67')],{'transaction':_0xc26d20})[_0xaf0b('0x2d')](function(){if(!_[_0xaf0b('0x83')](_0x63b1f7)){return _0x3bb05e['removeAgents'](_0x63b1f7,{'transaction':_0xc26d20});}})[_0xaf0b('0x2d')](function(){_0x63b1f7[_0xaf0b('0x70')](function(_0x43ebf9){socket[_0xaf0b('0x71')](_0xaf0b('0x84'),{'UserId':_0x43ebf9,'SmsQueueId':_0x3bb05e['id']});});});});});});})[_0xaf0b('0x2d')](respondWithStatusCode(_0xdd19a4,null))[_0xaf0b('0x4e')](handleError(_0xdd19a4,null));};exports['addAgents']=function(_0xecc2af,_0x3c5317,_0x2be32f){return db[_0xaf0b('0x35')]['find']({'where':{'id':_0xecc2af[_0xaf0b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3c5317,null))['then'](function(_0x73959a){if(_0x73959a){return _0x73959a[_0xaf0b('0x85')](_0xecc2af[_0xaf0b('0x59')][_0xaf0b('0x67')],_[_0xaf0b('0x86')](_0xecc2af['body'],[_0xaf0b('0x67'),'id'])||{})['spread'](function(_0x13e285){for(var _0x141c20=0x0;_0x141c20<_0xecc2af[_0xaf0b('0x59')]['ids']['length'];_0x141c20+=0x1){socket['emit'](_0xaf0b('0x72'),{'UserId':Number(_0xecc2af[_0xaf0b('0x59')]['ids'][_0x141c20]),'SmsQueueId':Number(_0xecc2af['params']['id'])});}return _0x13e285;});}})[_0xaf0b('0x2d')](respondWithResult(_0x3c5317,null))['catch'](handleError(_0x3c5317,null));};exports[_0xaf0b('0x87')]=function(_0xc507b,_0x591c80,_0x2e78ef){return db['SmsQueue'][_0xaf0b('0x52')]({'where':{'id':_0xc507b[_0xaf0b('0x4f')]['id']}})[_0xaf0b('0x2d')](handleEntityNotFound(_0x591c80,null))['then'](function(_0x375c8c){if(_0x375c8c){return _0x375c8c['removeAgents'](_0xc507b[_0xaf0b('0x3b')]['ids'])['then'](function(){if(_[_0xaf0b('0x88')](_0xc507b[_0xaf0b('0x3b')]['ids'])){for(var _0x5ce443=0x0;_0x5ce443<_0xc507b[_0xaf0b('0x3b')][_0xaf0b('0x67')]['length'];_0x5ce443+=0x1){socket[_0xaf0b('0x71')]('userSmsQueue:remove',{'UserId':Number(_0xc507b[_0xaf0b('0x3b')][_0xaf0b('0x67')][_0x5ce443]),'SmsQueueId':Number(_0xc507b[_0xaf0b('0x4f')]['id'])});}}else{socket['emit'](_0xaf0b('0x84'),{'UserId':Number(_0xc507b['query'][_0xaf0b('0x67')]),'SmsQueueId':Number(_0xc507b[_0xaf0b('0x4f')]['id'])});}});}})[_0xaf0b('0x2d')](respondWithStatusCode(_0x591c80,null))[_0xaf0b('0x4e')](handleError(_0x591c80,null));};exports['getAgents']=function(_0x59c250,_0x521132,_0x370cc0){var _0x16b33f={};var _0x41acaa={};var _0x432a84;var _0x8e325b;return db['SmsQueue'][_0xaf0b('0x5c')]({'where':{'id':_0x59c250[_0xaf0b('0x4f')]['id']}})[_0xaf0b('0x2d')](handleEntityNotFound(_0x521132,null))[_0xaf0b('0x2d')](function(_0x9a511d){if(_0x9a511d){_0x432a84=_0x9a511d;_0x41acaa[_0xaf0b('0x39')]=_[_0xaf0b('0x3c')](db[_0xaf0b('0x5d')][_0xaf0b('0x36')]);_0x41acaa[_0xaf0b('0x3b')]=_[_0xaf0b('0x3c')](_0x59c250[_0xaf0b('0x3b')]);_0x41acaa[_0xaf0b('0x3d')]=_[_0xaf0b('0x3e')](_0x41acaa[_0xaf0b('0x39')],_0x41acaa[_0xaf0b('0x3b')]);_0x16b33f['attributes']=_['intersection'](_0x41acaa[_0xaf0b('0x39')],qs[_0xaf0b('0x3f')](_0x59c250[_0xaf0b('0x3b')][_0xaf0b('0x3f')]));_0x16b33f[_0xaf0b('0x40')]=_0x16b33f[_0xaf0b('0x40')][_0xaf0b('0x50')]?_0x16b33f['attributes']:_0x41acaa[_0xaf0b('0x39')];_0x16b33f[_0xaf0b('0x43')]=qs[_0xaf0b('0x44')](_0x59c250[_0xaf0b('0x3b')][_0xaf0b('0x44')]);_0x16b33f[_0xaf0b('0x45')]=qs[_0xaf0b('0x3d')](_[_0xaf0b('0x46')](_0x59c250[_0xaf0b('0x3b')],_0x41acaa[_0xaf0b('0x3d')]));if(_0x59c250[_0xaf0b('0x3b')][_0xaf0b('0x49')]){_0x16b33f[_0xaf0b('0x45')]=_[_0xaf0b('0x47')](_0x16b33f['where'],{'$or':_[_0xaf0b('0x3a')](_0x16b33f[_0xaf0b('0x40')],function(_0x5771d7){var _0x35ab1e={};_0x35ab1e[_0x5771d7]={'$like':'%'+_0x59c250[_0xaf0b('0x3b')][_0xaf0b('0x49')]+'%'};return _0x35ab1e;})});}_0x16b33f=_[_0xaf0b('0x47')]({},_0x16b33f,_0x59c250[_0xaf0b('0x4a')]);return _0x432a84[_0xaf0b('0x89')](_0x16b33f);}})[_0xaf0b('0x2d')](function(_0xd53a41){if(_0xd53a41){_0x8e325b=_0xd53a41[_0xaf0b('0x50')];if(!_0x59c250[_0xaf0b('0x3b')][_0xaf0b('0x41')]('nolimit')){_0x16b33f[_0xaf0b('0x24')]=qs['limit'](_0x59c250[_0xaf0b('0x3b')][_0xaf0b('0x24')]);_0x16b33f[_0xaf0b('0x23')]=qs[_0xaf0b('0x23')](_0x59c250[_0xaf0b('0x3b')][_0xaf0b('0x23')]);}return _0x432a84[_0xaf0b('0x89')](_0x16b33f);}})['then'](function(_0x16588a){if(_0x16588a){return _0x16588a?{'count':_0x8e325b,'rows':_0x16588a}:null;}})[_0xaf0b('0x2d')](respondWithResult(_0x521132,null))['catch'](handleError(_0x521132,null));};
\ No newline at end of file
+var _0xad04=['every','all','union','value','removeTeams','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','getAgents','eml-format','rimraf','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','get','SmsQueues','UserProfileResource','destroy','error','stack','name','send','index','map','SmsQueue','rawAttributes','type','key','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','keys','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','UserSmsQueue','order','SmsQueueId','User','UserId','agent','smsPause','format','%s/%s','SIP','createdAt','updatedAt','getTeams','findOne','ids','Agents','interface','sequelize','transaction','addTeams','findOrCreate','forEach','emit','userSmsQueue:save','Team','select','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT'];(function(_0x14a513,_0x3239f){var _0x47236c=function(_0x394191){while(--_0x394191){_0x14a513['push'](_0x14a513['shift']());}};_0x47236c(++_0x3239f);}(_0xad04,0x96));var _0x4ad0=function(_0x4c53b8,_0x445335){_0x4c53b8=_0x4c53b8-0x0;var _0x7cd78b=_0xad04[_0x4c53b8];return _0x7cd78b;};'use strict';var emlformat=require(_0x4ad0('0x0'));var rimraf=require(_0x4ad0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4ad0('0x2'));var Mustache=require(_0x4ad0('0x3'));var util=require(_0x4ad0('0x4'));var path=require('path');var sox=require(_0x4ad0('0x5'));var csv=require(_0x4ad0('0x6'));var ejs=require(_0x4ad0('0x7'));var fs=require('fs');var fs_extra=require(_0x4ad0('0x8'));var _=require(_0x4ad0('0x9'));var squel=require(_0x4ad0('0xa'));var crypto=require(_0x4ad0('0xb'));var jsforce=require(_0x4ad0('0xc'));var deskjs=require(_0x4ad0('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4ad0('0xe'));var Redis=require(_0x4ad0('0xf'));var authService=require(_0x4ad0('0x10'));var qs=require(_0x4ad0('0x11'));var as=require(_0x4ad0('0x12'));var hardwareService=require(_0x4ad0('0x13'));var logger=require(_0x4ad0('0x14'))(_0x4ad0('0x15'));var utils=require('../../config/utils');var config=require(_0x4ad0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4ad0('0x17'))['db'];config[_0x4ad0('0x18')]=_[_0x4ad0('0x19')](config['redis'],{'host':_0x4ad0('0x1a'),'port':0x18eb});var socket=require(_0x4ad0('0x1b'))(new Redis(config['redis']));require(_0x4ad0('0x1c'))[_0x4ad0('0x1d')](socket);function respondWithStatusCode(_0x1ee87f,_0x1b18b1){_0x1b18b1=_0x1b18b1||0xcc;return function(_0x4d5272){if(_0x4d5272){return _0x1ee87f[_0x4ad0('0x1e')](_0x1b18b1);}return _0x1ee87f[_0x4ad0('0x1f')](_0x1b18b1)[_0x4ad0('0x20')]();};}function respondWithResult(_0x3b5001,_0x1c3065){_0x1c3065=_0x1c3065||0xc8;return function(_0x88383c){if(_0x88383c){return _0x3b5001['status'](_0x1c3065)[_0x4ad0('0x21')](_0x88383c);}};}function respondWithFilteredResult(_0x3a634c,_0x53c63b){return function(_0xcadde5){if(_0xcadde5){var _0x1a0a58=typeof _0x53c63b[_0x4ad0('0x22')]===_0x4ad0('0x23')&&typeof _0x53c63b['limit']===_0x4ad0('0x23');var _0x34317e=_0xcadde5['count'];var _0x5a5802=_0x1a0a58?0x0:_0x53c63b[_0x4ad0('0x22')];var _0x39e58b=_0x1a0a58?_0xcadde5[_0x4ad0('0x24')]:_0x53c63b[_0x4ad0('0x22')]+_0x53c63b[_0x4ad0('0x25')];var _0x2a45f6;if(_0x39e58b>=_0x34317e){_0x39e58b=_0x34317e;_0x2a45f6=0xc8;}else{_0x2a45f6=0xce;}_0x3a634c[_0x4ad0('0x1f')](_0x2a45f6);return _0x3a634c[_0x4ad0('0x26')](_0x4ad0('0x27'),_0x5a5802+'-'+_0x39e58b+'/'+_0x34317e)[_0x4ad0('0x21')](_0xcadde5);}return null;};}function patchUpdates(_0x5af5cf){return function(_0x106222){try{jsonpatch['apply'](_0x106222,_0x5af5cf,!![]);}catch(_0x1299ea){return BPromise[_0x4ad0('0x28')](_0x1299ea);}return _0x106222[_0x4ad0('0x29')]();};}function saveUpdates(_0x1f2398,_0x17274c){return function(_0x2f2e6b){if(_0x2f2e6b){return _0x2f2e6b[_0x4ad0('0x2a')](_0x1f2398)[_0x4ad0('0x2b')](function(_0x3b880c){return _0x3b880c;});}return null;};}function removeEntity(_0x56012d,_0x305cbc){return function(_0x263726){if(_0x263726){return _0x263726['destroy']()[_0x4ad0('0x2b')](function(){var _0x550f35=_0x263726[_0x4ad0('0x2c')]({'plain':!![]});var _0x3426a8=_0x4ad0('0x2d');return db[_0x4ad0('0x2e')][_0x4ad0('0x2f')]({'where':{'type':_0x3426a8,'resourceId':_0x550f35['id']}})[_0x4ad0('0x2b')](function(){return _0x263726;});})[_0x4ad0('0x2b')](function(){_0x56012d[_0x4ad0('0x1f')](0xcc)[_0x4ad0('0x20')]();});}};}function handleEntityNotFound(_0x692799,_0x4ec496){return function(_0x5df6c6){if(!_0x5df6c6){_0x692799[_0x4ad0('0x1e')](0x194);}return _0x5df6c6;};}function handleError(_0x5f1b23,_0x34cfc2){_0x34cfc2=_0x34cfc2||0x1f4;return function(_0x489d87){logger[_0x4ad0('0x30')](_0x489d87[_0x4ad0('0x31')]);if(_0x489d87[_0x4ad0('0x32')]){delete _0x489d87[_0x4ad0('0x32')];}_0x5f1b23[_0x4ad0('0x1f')](_0x34cfc2)[_0x4ad0('0x33')](_0x489d87);};}exports[_0x4ad0('0x34')]=function(_0xd4164b,_0x297712){var _0x1191d9={},_0x13e30c={},_0x1cbe18={'count':0x0,'rows':[]};var _0x5618d3=_[_0x4ad0('0x35')](db[_0x4ad0('0x36')][_0x4ad0('0x37')],function(_0x524d60){return{'name':_0x524d60['fieldName'],'type':_0x524d60[_0x4ad0('0x38')][_0x4ad0('0x39')]};});_0x13e30c['model']=_[_0x4ad0('0x35')](_0x5618d3,_0x4ad0('0x32'));_0x13e30c[_0x4ad0('0x3a')]=_['keys'](_0xd4164b[_0x4ad0('0x3a')]);_0x13e30c[_0x4ad0('0x3b')]=_['intersection'](_0x13e30c[_0x4ad0('0x3c')],_0x13e30c['query']);_0x1191d9['attributes']=_[_0x4ad0('0x3d')](_0x13e30c[_0x4ad0('0x3c')],qs[_0x4ad0('0x3e')](_0xd4164b[_0x4ad0('0x3a')][_0x4ad0('0x3e')]));_0x1191d9[_0x4ad0('0x3f')]=_0x1191d9[_0x4ad0('0x3f')][_0x4ad0('0x40')]?_0x1191d9[_0x4ad0('0x3f')]:_0x13e30c['model'];if(!_0xd4164b[_0x4ad0('0x3a')][_0x4ad0('0x41')](_0x4ad0('0x42'))){_0x1191d9['limit']=qs[_0x4ad0('0x25')](_0xd4164b['query'][_0x4ad0('0x25')]);_0x1191d9[_0x4ad0('0x22')]=qs[_0x4ad0('0x22')](_0xd4164b[_0x4ad0('0x3a')][_0x4ad0('0x22')]);}_0x1191d9['order']=qs[_0x4ad0('0x43')](_0xd4164b[_0x4ad0('0x3a')][_0x4ad0('0x43')]);_0x1191d9[_0x4ad0('0x44')]=qs[_0x4ad0('0x3b')](_[_0x4ad0('0x45')](_0xd4164b[_0x4ad0('0x3a')],_0x13e30c['filters']),_0x5618d3);if(_0xd4164b[_0x4ad0('0x3a')][_0x4ad0('0x46')]){_0x1191d9[_0x4ad0('0x44')]=_[_0x4ad0('0x47')](_0x1191d9[_0x4ad0('0x44')],{'$or':_['map'](_0x5618d3,function(_0x1203a4){if(_0x1203a4[_0x4ad0('0x38')]!=='VIRTUAL'){var _0xc9bc9e={};_0xc9bc9e[_0x1203a4[_0x4ad0('0x32')]]={'$like':'%'+_0xd4164b['query'][_0x4ad0('0x46')]+'%'};return _0xc9bc9e;}})});}_0x1191d9=_['merge']({},_0x1191d9,_0xd4164b[_0x4ad0('0x48')]);var _0xde843b={'where':_0x1191d9[_0x4ad0('0x44')]};return db[_0x4ad0('0x36')][_0x4ad0('0x24')](_0xde843b)[_0x4ad0('0x2b')](function(_0x417ef8){_0x1cbe18[_0x4ad0('0x24')]=_0x417ef8;if(_0xd4164b[_0x4ad0('0x3a')][_0x4ad0('0x49')]){_0x1191d9['include']=[{'all':!![]}];}return db[_0x4ad0('0x36')][_0x4ad0('0x4a')](_0x1191d9);})['then'](function(_0x56c2aa){_0x1cbe18[_0x4ad0('0x4b')]=_0x56c2aa;return _0x1cbe18;})[_0x4ad0('0x2b')](respondWithFilteredResult(_0x297712,_0x1191d9))[_0x4ad0('0x4c')](handleError(_0x297712,null));};exports[_0x4ad0('0x4d')]=function(_0x5470a1,_0x27ad09){var _0x35e0a4={'raw':!![],'where':{'id':_0x5470a1['params']['id']}},_0x1314f4={};_0x1314f4[_0x4ad0('0x3c')]=_[_0x4ad0('0x4e')](db[_0x4ad0('0x36')]['rawAttributes']);_0x1314f4[_0x4ad0('0x3a')]=_['keys'](_0x5470a1[_0x4ad0('0x3a')]);_0x1314f4['filters']=_[_0x4ad0('0x3d')](_0x1314f4[_0x4ad0('0x3c')],_0x1314f4[_0x4ad0('0x3a')]);_0x35e0a4[_0x4ad0('0x3f')]=_[_0x4ad0('0x3d')](_0x1314f4['model'],qs['fields'](_0x5470a1[_0x4ad0('0x3a')]['fields']));_0x35e0a4[_0x4ad0('0x3f')]=_0x35e0a4[_0x4ad0('0x3f')][_0x4ad0('0x40')]?_0x35e0a4['attributes']:_0x1314f4[_0x4ad0('0x3c')];if(_0x5470a1[_0x4ad0('0x3a')]['includeAll']){_0x35e0a4[_0x4ad0('0x4f')]=[{'all':!![]}];}_0x35e0a4=_['merge']({},_0x35e0a4,_0x5470a1[_0x4ad0('0x48')]);return db[_0x4ad0('0x36')]['find'](_0x35e0a4)[_0x4ad0('0x2b')](handleEntityNotFound(_0x27ad09,null))[_0x4ad0('0x2b')](respondWithResult(_0x27ad09,null))[_0x4ad0('0x4c')](handleError(_0x27ad09,null));};exports[_0x4ad0('0x50')]=function(_0x2dc8e0,_0x23cbf8){return db[_0x4ad0('0x36')][_0x4ad0('0x50')](_0x2dc8e0[_0x4ad0('0x51')],{})['then'](function(_0x37d816){var _0x4a38ab=_0x2dc8e0[_0x4ad0('0x52')]['get']({'plain':!![]});if(!_0x4a38ab)throw new Error(_0x4ad0('0x53'));if(_0x4a38ab[_0x4ad0('0x54')]===_0x4ad0('0x52')){var _0x5355ab=_0x37d816[_0x4ad0('0x2c')]({'plain':!![]});var _0x21a1ac=_0x4ad0('0x2d');return db[_0x4ad0('0x55')][_0x4ad0('0x56')]({'where':{'name':_0x21a1ac,'userProfileId':_0x4a38ab['userProfileId']},'raw':!![]})[_0x4ad0('0x2b')](function(_0x20db34){if(_0x20db34&&_0x20db34[_0x4ad0('0x57')]===0x0){return db[_0x4ad0('0x2e')][_0x4ad0('0x50')]({'name':_0x5355ab[_0x4ad0('0x32')],'resourceId':_0x5355ab['id'],'type':_0x20db34[_0x4ad0('0x32')],'sectionId':_0x20db34['id']},{})[_0x4ad0('0x2b')](function(){return _0x37d816;});}else{return _0x37d816;}})[_0x4ad0('0x4c')](function(_0x5a4bc2){logger[_0x4ad0('0x30')](_0x4ad0('0x58'),_0x5a4bc2);throw _0x5a4bc2;});}return _0x37d816;})[_0x4ad0('0x2b')](respondWithResult(_0x23cbf8,0xc9))['catch'](handleError(_0x23cbf8,null));};exports[_0x4ad0('0x2a')]=function(_0x37664e,_0x959612){if(_0x37664e[_0x4ad0('0x51')]['id']){delete _0x37664e[_0x4ad0('0x51')]['id'];}return db[_0x4ad0('0x36')][_0x4ad0('0x56')]({'where':{'id':_0x37664e[_0x4ad0('0x59')]['id']}})['then'](handleEntityNotFound(_0x959612,null))[_0x4ad0('0x2b')](saveUpdates(_0x37664e[_0x4ad0('0x51')],null))['then'](respondWithResult(_0x959612,null))[_0x4ad0('0x4c')](handleError(_0x959612,null));};exports[_0x4ad0('0x2f')]=function(_0x4aead4,_0x23030e){return db['SmsQueue'][_0x4ad0('0x56')]({'where':{'id':_0x4aead4[_0x4ad0('0x59')]['id']}})[_0x4ad0('0x2b')](handleEntityNotFound(_0x23030e,null))[_0x4ad0('0x2b')](removeEntity(_0x23030e,null))[_0x4ad0('0x4c')](handleError(_0x23030e,null));};exports[_0x4ad0('0x5a')]=function(_0x3cdd2b,_0x315abf){return db[_0x4ad0('0x36')][_0x4ad0('0x5a')]()[_0x4ad0('0x2b')](respondWithResult(_0x315abf,null))[_0x4ad0('0x4c')](handleError(_0x315abf,null));};exports[_0x4ad0('0x5b')]=function(_0x1e25a2,_0x179647,_0x50a18f){var _0x6f80e3={'raw':!![],'where':{}},_0x509fd0={},_0x24a233;return db['SmsQueue']['findOne']({'where':{'id':_0x1e25a2['params']['id']}})['then'](handleEntityNotFound(_0x179647,null))[_0x4ad0('0x2b')](function(_0x2e0540){if(_0x2e0540){_0x24a233=_0x2e0540[_0x4ad0('0x2c')]({'plain':!![]});_0x509fd0[_0x4ad0('0x3c')]=_[_0x4ad0('0x4e')](db[_0x4ad0('0x5c')][_0x4ad0('0x37')]);_0x509fd0[_0x4ad0('0x3a')]=_[_0x4ad0('0x4e')](_0x1e25a2[_0x4ad0('0x3a')]);_0x509fd0[_0x4ad0('0x3b')]=_[_0x4ad0('0x3d')](_0x509fd0[_0x4ad0('0x3c')],_0x509fd0[_0x4ad0('0x3a')]);_0x6f80e3[_0x4ad0('0x3f')]=_[_0x4ad0('0x3d')](_0x509fd0[_0x4ad0('0x3c')],qs['fields'](_0x1e25a2[_0x4ad0('0x3a')][_0x4ad0('0x3e')]));_0x6f80e3[_0x4ad0('0x3f')]=_0x6f80e3['attributes'][_0x4ad0('0x40')]?_0x6f80e3['attributes']:_0x509fd0[_0x4ad0('0x3c')];if(!_0x1e25a2[_0x4ad0('0x3a')]['hasOwnProperty']('nolimit')){_0x6f80e3[_0x4ad0('0x25')]=qs[_0x4ad0('0x25')](_0x1e25a2[_0x4ad0('0x3a')][_0x4ad0('0x25')]);_0x6f80e3[_0x4ad0('0x22')]=qs[_0x4ad0('0x22')](_0x1e25a2[_0x4ad0('0x3a')][_0x4ad0('0x22')]);}_0x6f80e3[_0x4ad0('0x5d')]=qs[_0x4ad0('0x43')](_0x1e25a2['query'][_0x4ad0('0x43')]);_0x6f80e3['where']=qs['filters'](_[_0x4ad0('0x45')](_0x1e25a2['query'],_0x509fd0[_0x4ad0('0x3b')]));_0x6f80e3[_0x4ad0('0x44')][_0x4ad0('0x5e')]=_0x2e0540['id'];if(_0x1e25a2[_0x4ad0('0x3a')][_0x4ad0('0x46')]){_0x6f80e3[_0x4ad0('0x44')]=_[_0x4ad0('0x47')](_0x6f80e3[_0x4ad0('0x44')],{'$or':_[_0x4ad0('0x35')](_0x6f80e3[_0x4ad0('0x3f')],function(_0x2afbc4){var _0xeab59={};_0xeab59[_0x2afbc4]={'$like':'%'+_0x1e25a2['query']['filter']+'%'};return _0xeab59;})});}_0x6f80e3=_[_0x4ad0('0x47')]({},_0x6f80e3,_0x1e25a2['options']);return db['UserSmsQueue'][_0x4ad0('0x4a')](_0x6f80e3);}})['then'](function(_0x379913){if(_0x379913){return db[_0x4ad0('0x5f')]['findAndCountAll']({'where':{'id':_['map'](_0x379913,_0x4ad0('0x60')),'role':_0x4ad0('0x61')},'attributes':['id',_0x4ad0('0x32'),_0x4ad0('0x62'),'updatedAt','createdAt']});}})['then'](function(_0x5ec857){if(_0x5ec857){return{'count':_0x5ec857['count'],'rows':_[_0x4ad0('0x35')](_0x5ec857[_0x4ad0('0x4b')],function(_0x246ac0){return{'membername':_0x246ac0['name'],'UserId':_0x246ac0['id'],'queue_name':_0x24a233[_0x4ad0('0x32')],'SmsQueueId':_0x24a233['id'],'interface':util[_0x4ad0('0x63')](_0x4ad0('0x64'),_0x4ad0('0x65'),_0x246ac0[_0x4ad0('0x32')]),'penalty':0x0,'paused':_0x246ac0[_0x4ad0('0x62')],'createdAt':_0x246ac0[_0x4ad0('0x66')],'updatedAt':_0x246ac0[_0x4ad0('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4ad0('0x2b')](respondWithFilteredResult(_0x179647,_0x6f80e3))['catch'](handleError(_0x179647,null));};exports[_0x4ad0('0x68')]=function(_0x5869eb,_0x445013,_0x55d603){var _0x5363a3={};var _0x28a731={};var _0x266138;var _0x44ede8;return db[_0x4ad0('0x36')][_0x4ad0('0x69')]({'where':{'id':_0x5869eb['params']['id']}})[_0x4ad0('0x2b')](handleEntityNotFound(_0x445013,null))['then'](function(_0x4e5b7d){if(_0x4e5b7d){_0x266138=_0x4e5b7d;_0x28a731[_0x4ad0('0x3c')]=_[_0x4ad0('0x4e')](db['Team'][_0x4ad0('0x37')]);_0x28a731[_0x4ad0('0x3a')]=_[_0x4ad0('0x4e')](_0x5869eb[_0x4ad0('0x3a')]);_0x28a731['filters']=_[_0x4ad0('0x3d')](_0x28a731[_0x4ad0('0x3c')],_0x28a731[_0x4ad0('0x3a')]);_0x5363a3['attributes']=_['intersection'](_0x28a731[_0x4ad0('0x3c')],qs[_0x4ad0('0x3e')](_0x5869eb[_0x4ad0('0x3a')][_0x4ad0('0x3e')]));_0x5363a3[_0x4ad0('0x3f')]=_0x5363a3[_0x4ad0('0x3f')]['length']?_0x5363a3[_0x4ad0('0x3f')]:_0x28a731[_0x4ad0('0x3c')];_0x5363a3['order']=qs[_0x4ad0('0x43')](_0x5869eb[_0x4ad0('0x3a')][_0x4ad0('0x43')]);_0x5363a3['where']=qs[_0x4ad0('0x3b')](_[_0x4ad0('0x45')](_0x5869eb[_0x4ad0('0x3a')],_0x28a731[_0x4ad0('0x3b')]));if(_0x5869eb[_0x4ad0('0x3a')]['filter']){_0x5363a3['where']=_[_0x4ad0('0x47')](_0x5363a3[_0x4ad0('0x44')],{'$or':_['map'](_0x5363a3[_0x4ad0('0x3f')],function(_0x33c17a){var _0x4ed51c={};_0x4ed51c[_0x33c17a]={'$like':'%'+_0x5869eb[_0x4ad0('0x3a')][_0x4ad0('0x46')]+'%'};return _0x4ed51c;})});}_0x5363a3=_[_0x4ad0('0x47')]({},_0x5363a3,_0x5869eb[_0x4ad0('0x48')]);return _0x266138[_0x4ad0('0x68')](_0x5363a3);}})[_0x4ad0('0x2b')](function(_0x11ede4){if(_0x11ede4){_0x44ede8=_0x11ede4[_0x4ad0('0x40')];if(!_0x5869eb[_0x4ad0('0x3a')][_0x4ad0('0x41')]('nolimit')){_0x5363a3[_0x4ad0('0x25')]=qs[_0x4ad0('0x25')](_0x5869eb[_0x4ad0('0x3a')]['limit']);_0x5363a3[_0x4ad0('0x22')]=qs[_0x4ad0('0x22')](_0x5869eb[_0x4ad0('0x3a')][_0x4ad0('0x22')]);}return _0x266138[_0x4ad0('0x68')](_0x5363a3);}})[_0x4ad0('0x2b')](function(_0x47f1ea){if(_0x47f1ea){return _0x47f1ea?{'count':_0x44ede8,'rows':_0x47f1ea}:null;}})[_0x4ad0('0x2b')](respondWithResult(_0x445013,null))['catch'](handleError(_0x445013,null));};exports['addTeams']=function(_0xf79e0b,_0x8d0787,_0x2ea500){var _0x411f95=_0xf79e0b[_0x4ad0('0x51')][_0x4ad0('0x6a')];return db['Team'][_0x4ad0('0x4a')]({'where':{'id':_0x411f95},'attributes':['id'],'include':[{'model':db[_0x4ad0('0x5f')],'as':_0x4ad0('0x6b'),'attributes':['id',_0x4ad0('0x32'),'online','voicePause',_0x4ad0('0x6c')],'raw':!![]}]})[_0x4ad0('0x2b')](function(_0x50b1dd){if(_0x50b1dd){var _0x3723fa=_['flatMap'](_0x50b1dd,function(_0x160c8d){var _0x240f7b=_0x160c8d['get']({'plain':!![]});return _0x240f7b[_0x4ad0('0x6b')];});return db['SmsQueue'][_0x4ad0('0x56')]({'where':{'id':_0xf79e0b[_0x4ad0('0x59')]['id']}})[_0x4ad0('0x2b')](function(_0x42f9eb){return db[_0x4ad0('0x6d')][_0x4ad0('0x6e')](function(_0x5a13e5){return _0x42f9eb[_0x4ad0('0x6f')](_0x411f95,{'transaction':_0x5a13e5})[_0x4ad0('0x2b')](function(){return BPromise['each'](_0x3723fa,function(_0x58da96){return db[_0x4ad0('0x5c')][_0x4ad0('0x70')]({'where':{'UserId':_0x58da96['id'],'SmsQueueId':_0xf79e0b[_0x4ad0('0x59')]['id']},'transaction':_0x5a13e5});});})['then'](function(){_0x3723fa[_0x4ad0('0x71')](function(_0x20c7d5){socket[_0x4ad0('0x72')](_0x4ad0('0x73'),{'UserId':_0x20c7d5['id'],'SmsQueueId':_0x42f9eb['id']});});});});});}})['then'](respondWithStatusCode(_0x8d0787,null))[_0x4ad0('0x4c')](handleError(_0x8d0787,null));};exports['removeTeams']=function(_0x2f0466,_0x3dae30,_0x4ae528){return db[_0x4ad0('0x74')][_0x4ad0('0x4a')]({'where':{'id':_0x2f0466[_0x4ad0('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db[_0x4ad0('0x5f')],'as':_0x4ad0('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x4ad0('0x2b')](handleEntityNotFound(_0x3dae30,null))[_0x4ad0('0x2b')](function(_0x57ee56){var _0xea8717=_[_0x4ad0('0x35')](_0x57ee56,'id');var _0x4ff155=[];var _0x50420a=[];var _0x1c0d06=squel[_0x4ad0('0x75')]();_0x1c0d06['field']('tq.TeamId')[_0x4ad0('0x76')](_0x4ad0('0x77'),'tq')[_0x4ad0('0x78')]('user_has_teams','ut',_0x4ad0('0x79'))[_0x4ad0('0x44')](_0x4ad0('0x7a'),_0x2f0466[_0x4ad0('0x59')]['id']);for(var _0x1461ad=0x0;_0x1461ad<_0x57ee56[_0x4ad0('0x40')];_0x1461ad+=0x1){let _0x18ed03=_0x57ee56[_0x1461ad];for(var _0x1d884=0x0;_0x1d884<_0x18ed03['Agents'][_0x4ad0('0x40')];_0x1d884+=0x1){let _0x4b2262=_0x18ed03[_0x4ad0('0x6b')][_0x1d884];var _0x2b3c76=_0x1c0d06[_0x4ad0('0x7b')]();_0x2b3c76[_0x4ad0('0x44')](_0x4ad0('0x7c'),_0x4b2262['id']);_0x50420a[_0x4ad0('0x7d')](db['sequelize'][_0x4ad0('0x3a')](_0x2b3c76[_0x4ad0('0x7e')](),{'type':db[_0x4ad0('0x6d')]['QueryTypes'][_0x4ad0('0x7f')]})['then'](function(_0x26efc3){if(_0x26efc3[_0x4ad0('0x40')]===0x1){return _0x4b2262['id'];}else{var _0x559a69=_[_0x4ad0('0x80')](_[_0x4ad0('0x35')](_0x26efc3,'TeamId'),function(_0x422ea6){return _['includes'](_0xea8717,_0x422ea6);});if(_0x559a69){return _0x4b2262['id'];}}}));}}return BPromise[_0x4ad0('0x81')](_0x50420a)[_0x4ad0('0x2b')](function(_0x21b6d0){_0x4ff155=_(_0x4ff155)[_0x4ad0('0x82')](_0x21b6d0)['compact']()[_0x4ad0('0x83')]();return db['SmsQueue'][_0x4ad0('0x56')]({'where':{'id':_0x2f0466['params']['id']}})[_0x4ad0('0x2b')](function(_0x47e51f){return db[_0x4ad0('0x6d')][_0x4ad0('0x6e')](function(_0x20b5a){return _0x47e51f[_0x4ad0('0x84')](_0x2f0466[_0x4ad0('0x3a')][_0x4ad0('0x6a')],{'transaction':_0x20b5a})[_0x4ad0('0x2b')](function(){if(!_[_0x4ad0('0x85')](_0x4ff155)){return _0x47e51f[_0x4ad0('0x86')](_0x4ff155,{'transaction':_0x20b5a});}})[_0x4ad0('0x2b')](function(){_0x4ff155[_0x4ad0('0x71')](function(_0xa3e3dc){socket['emit'](_0x4ad0('0x87'),{'UserId':_0xa3e3dc,'SmsQueueId':_0x47e51f['id']});});});});});});})[_0x4ad0('0x2b')](respondWithStatusCode(_0x3dae30,null))['catch'](handleError(_0x3dae30,null));};exports[_0x4ad0('0x88')]=function(_0x131080,_0x324f4b,_0x3159e0){return db[_0x4ad0('0x36')][_0x4ad0('0x56')]({'where':{'id':_0x131080[_0x4ad0('0x59')]['id']}})[_0x4ad0('0x2b')](handleEntityNotFound(_0x324f4b,null))['then'](function(_0x3a5c63){if(_0x3a5c63){return _0x3a5c63[_0x4ad0('0x88')](_0x131080[_0x4ad0('0x51')][_0x4ad0('0x6a')],_[_0x4ad0('0x89')](_0x131080['body'],['ids','id'])||{})['spread'](function(_0x25cf29){for(var _0x1b317c=0x0;_0x1b317c<_0x131080['body'][_0x4ad0('0x6a')]['length'];_0x1b317c+=0x1){socket[_0x4ad0('0x72')](_0x4ad0('0x73'),{'UserId':Number(_0x131080['body'][_0x4ad0('0x6a')][_0x1b317c]),'SmsQueueId':Number(_0x131080[_0x4ad0('0x59')]['id'])});}return _0x25cf29;});}})[_0x4ad0('0x2b')](respondWithResult(_0x324f4b,null))['catch'](handleError(_0x324f4b,null));};exports[_0x4ad0('0x86')]=function(_0x6c4639,_0x248fb2,_0x45d169){return db['SmsQueue'][_0x4ad0('0x56')]({'where':{'id':_0x6c4639[_0x4ad0('0x59')]['id']}})[_0x4ad0('0x2b')](handleEntityNotFound(_0x248fb2,null))['then'](function(_0x4a221a){if(_0x4a221a){return _0x4a221a[_0x4ad0('0x86')](_0x6c4639[_0x4ad0('0x3a')]['ids'])[_0x4ad0('0x2b')](function(){if(_['isArray'](_0x6c4639[_0x4ad0('0x3a')]['ids'])){for(var _0x129e9a=0x0;_0x129e9a<_0x6c4639[_0x4ad0('0x3a')][_0x4ad0('0x6a')][_0x4ad0('0x40')];_0x129e9a+=0x1){socket[_0x4ad0('0x72')](_0x4ad0('0x87'),{'UserId':Number(_0x6c4639[_0x4ad0('0x3a')][_0x4ad0('0x6a')][_0x129e9a]),'SmsQueueId':Number(_0x6c4639[_0x4ad0('0x59')]['id'])});}}else{socket[_0x4ad0('0x72')](_0x4ad0('0x87'),{'UserId':Number(_0x6c4639['query'][_0x4ad0('0x6a')]),'SmsQueueId':Number(_0x6c4639[_0x4ad0('0x59')]['id'])});}});}})[_0x4ad0('0x2b')](respondWithStatusCode(_0x248fb2,null))['catch'](handleError(_0x248fb2,null));};exports['getAgents']=function(_0xb0b73d,_0x1ac763,_0x15a8fe){var _0x4ce3c8={};var _0x503ddb={};var _0x2e7940;var _0x3d86fa;return db[_0x4ad0('0x36')]['findOne']({'where':{'id':_0xb0b73d[_0x4ad0('0x59')]['id']}})['then'](handleEntityNotFound(_0x1ac763,null))[_0x4ad0('0x2b')](function(_0x2a915b){if(_0x2a915b){_0x2e7940=_0x2a915b;_0x503ddb['model']=_[_0x4ad0('0x4e')](db[_0x4ad0('0x5f')]['rawAttributes']);_0x503ddb[_0x4ad0('0x3a')]=_['keys'](_0xb0b73d[_0x4ad0('0x3a')]);_0x503ddb[_0x4ad0('0x3b')]=_[_0x4ad0('0x3d')](_0x503ddb[_0x4ad0('0x3c')],_0x503ddb['query']);_0x4ce3c8[_0x4ad0('0x3f')]=_[_0x4ad0('0x3d')](_0x503ddb[_0x4ad0('0x3c')],qs[_0x4ad0('0x3e')](_0xb0b73d[_0x4ad0('0x3a')][_0x4ad0('0x3e')]));_0x4ce3c8[_0x4ad0('0x3f')]=_0x4ce3c8[_0x4ad0('0x3f')][_0x4ad0('0x40')]?_0x4ce3c8['attributes']:_0x503ddb[_0x4ad0('0x3c')];_0x4ce3c8['order']=qs[_0x4ad0('0x43')](_0xb0b73d[_0x4ad0('0x3a')][_0x4ad0('0x43')]);_0x4ce3c8[_0x4ad0('0x44')]=qs[_0x4ad0('0x3b')](_[_0x4ad0('0x45')](_0xb0b73d[_0x4ad0('0x3a')],_0x503ddb[_0x4ad0('0x3b')]));if(_0xb0b73d[_0x4ad0('0x3a')][_0x4ad0('0x46')]){_0x4ce3c8[_0x4ad0('0x44')]=_[_0x4ad0('0x47')](_0x4ce3c8[_0x4ad0('0x44')],{'$or':_[_0x4ad0('0x35')](_0x4ce3c8[_0x4ad0('0x3f')],function(_0x438142){var _0x59b690={};_0x59b690[_0x438142]={'$like':'%'+_0xb0b73d['query'][_0x4ad0('0x46')]+'%'};return _0x59b690;})});}_0x4ce3c8=_[_0x4ad0('0x47')]({},_0x4ce3c8,_0xb0b73d[_0x4ad0('0x48')]);return _0x2e7940['getAgents'](_0x4ce3c8);}})['then'](function(_0x144a23){if(_0x144a23){_0x3d86fa=_0x144a23[_0x4ad0('0x40')];if(!_0xb0b73d[_0x4ad0('0x3a')]['hasOwnProperty'](_0x4ad0('0x42'))){_0x4ce3c8[_0x4ad0('0x25')]=qs[_0x4ad0('0x25')](_0xb0b73d['query'][_0x4ad0('0x25')]);_0x4ce3c8[_0x4ad0('0x22')]=qs[_0x4ad0('0x22')](_0xb0b73d[_0x4ad0('0x3a')][_0x4ad0('0x22')]);}return _0x2e7940[_0x4ad0('0x8a')](_0x4ce3c8);}})[_0x4ad0('0x2b')](function(_0x2915f2){if(_0x2915f2){return _0x2915f2?{'count':_0x3d86fa,'rows':_0x2915f2}:null;}})[_0x4ad0('0x2b')](respondWithResult(_0x1ac763,null))['catch'](handleError(_0x1ac763,null));};
\ No newline at end of file
index a80ff53..2bb7d91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x438d=['exports','events','SmsQueue','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x112b40,_0x4f163c){var _0x6e5477=function(_0xcf83f4){while(--_0xcf83f4){_0x112b40['push'](_0x112b40['shift']());}};_0x6e5477(++_0x4f163c);}(_0x438d,0x1b9));var _0xd438=function(_0x14977c,_0x2c6d7e){_0x14977c=_0x14977c-0x0;var _0xafe01a=_0x438d[_0x14977c];return _0xafe01a;};'use strict';var EventEmitter=require(_0xd438('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0xd438('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xd438('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd438('0x3'),'afterDestroy':_0xd438('0x4')};function emitEvent(_0xdd9a72){return function(_0x2ef4d9,_0x5049cc,_0x14e345){SmsQueueEvents[_0xd438('0x5')](_0xdd9a72+':'+_0x2ef4d9['id'],_0x2ef4d9);SmsQueueEvents['emit'](_0xdd9a72,_0x2ef4d9);_0x14e345(null);};}for(var e in events){if(events[_0xd438('0x6')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0xd438('0x7')]=SmsQueueEvents;
\ No newline at end of file
+var _0x5dad=['hook','exports','events','../../mysqldb','SmsQueue','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x1c1081,_0xe2cb8c){var _0x506a1a=function(_0x16dede){while(--_0x16dede){_0x1c1081['push'](_0x1c1081['shift']());}};_0x506a1a(++_0xe2cb8c);}(_0x5dad,0x17e));var _0xd5da=function(_0x431f4b,_0x30c0b6){_0x431f4b=_0x431f4b-0x0;var _0xfcbc3c=_0x5dad[_0x431f4b];return _0xfcbc3c;};'use strict';var EventEmitter=require(_0xd5da('0x0'));var SmsQueue=require(_0xd5da('0x1'))['db'][_0xd5da('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xd5da('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd5da('0x4'),'afterDestroy':_0xd5da('0x5')};function emitEvent(_0x526b9d){return function(_0x58f7e9,_0x1df3e1,_0x5b41e4){SmsQueueEvents['emit'](_0x526b9d+':'+_0x58f7e9['id'],_0x58f7e9);SmsQueueEvents[_0xd5da('0x6')](_0x526b9d,_0x58f7e9);_0x5b41e4(null);};}for(var e in events){if(events[_0xd5da('0x7')](e)){var event=events[e];SmsQueue[_0xd5da('0x8')](e,emitEvent(event));}}module[_0xd5da('0x9')]=SmsQueueEvents;
\ No newline at end of file
index 3df7e8e..17c091e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaecc=['./smsQueue.attributes','define','SmsQueue','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0xaecc,0x184));var _0xcaec=function(_0x37e342,_0x160c8f){_0x37e342=_0x37e342-0x0;var _0x1768f9=_0xaecc[_0x37e342];return _0x1768f9;};'use strict';var _=require('lodash');var util=require(_0xcaec('0x0'));var logger=require(_0xcaec('0x1'))(_0xcaec('0x2'));var moment=require(_0xcaec('0x3'));var BPromise=require(_0xcaec('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcaec('0x5'));var rimraf=require(_0xcaec('0x6'));var config=require(_0xcaec('0x7'));var attributes=require(_0xcaec('0x8'));module['exports']=function(_0x2fce27,_0x27b94c){return _0x2fce27[_0xcaec('0x9')](_0xcaec('0xa'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x619d=['util','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','sms_queues','lodash'];(function(_0x1602ef,_0x447aba){var _0x5870ee=function(_0x4d94e7){while(--_0x4d94e7){_0x1602ef['push'](_0x1602ef['shift']());}};_0x5870ee(++_0x447aba);}(_0x619d,0x1b7));var _0xd619=function(_0x4c8be3,_0x3c3591){_0x4c8be3=_0x4c8be3-0x0;var _0x4b2ce1=_0x619d[_0x4c8be3];return _0x4b2ce1;};'use strict';var _=require(_0xd619('0x0'));var util=require(_0xd619('0x1'));var logger=require('../../config/logger')(_0xd619('0x2'));var moment=require(_0xd619('0x3'));var BPromise=require('bluebird');var rp=require(_0xd619('0x4'));var fs=require('fs');var path=require(_0xd619('0x5'));var rimraf=require(_0xd619('0x6'));var config=require(_0xd619('0x7'));var attributes=require('./smsQueue.attributes');module[_0xd619('0x8')]=function(_0x2f1321,_0x4e1d9c){return _0x2f1321[_0xd619('0x9')]('SmsQueue',attributes,{'tableName':_0xd619('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2575b75..a595441 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb235=['attributes','ShowSmsQueue','find','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','redis','defaults','localhost','socket.io-emitter','register','then','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','info','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','include','map','model'];(function(_0x272638,_0x42b993){var _0x19d027=function(_0x27ac44){while(--_0x27ac44){_0x272638['push'](_0x272638['shift']());}};_0x19d027(++_0x42b993);}(_0xb235,0x179));var _0x5b23=function(_0x4bf029,_0x3e24f6){_0x4bf029=_0x4bf029-0x0;var _0x359cf3=_0xb235[_0x4bf029];return _0x359cf3;};'use strict';var _=require(_0x5b23('0x0'));var util=require('util');var moment=require(_0x5b23('0x1'));var BPromise=require(_0x5b23('0x2'));var rs=require(_0x5b23('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b23('0x4'))['db'];var utils=require(_0x5b23('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x5b23('0x6')]=_[_0x5b23('0x7')](config[_0x5b23('0x6')],{'host':_0x5b23('0x8'),'port':0x18eb});var socket=require(_0x5b23('0x9'))(new Redis(config[_0x5b23('0x6')]));require('./smsQueue.socket')[_0x5b23('0xa')](socket);function respondWithRpcPromise(_0x49deb7,_0x41c762,_0x1c209f){return new BPromise(function(_0x2cae82,_0x13284b){return client['request'](_0x49deb7,_0x1c209f)[_0x5b23('0xb')](function(_0x4c29d0){logger['info']('SmsQueue,\x20%s,\x20%s',_0x41c762,_0x5b23('0xc'));logger[_0x5b23('0xd')](_0x5b23('0xe'),_0x41c762,_0x5b23('0xc'),JSON[_0x5b23('0xf')](_0x4c29d0));if(_0x4c29d0[_0x5b23('0x10')]){if(_0x4c29d0[_0x5b23('0x10')][_0x5b23('0x11')]===0x1f4){logger['error'](_0x5b23('0x12'),_0x41c762,_0x4c29d0[_0x5b23('0x10')][_0x5b23('0x13')]);return _0x13284b(_0x4c29d0[_0x5b23('0x10')][_0x5b23('0x13')]);}logger[_0x5b23('0x10')](_0x5b23('0x12'),_0x41c762,_0x4c29d0['error'][_0x5b23('0x13')]);return _0x2cae82(_0x4c29d0[_0x5b23('0x10')][_0x5b23('0x13')]);}else{logger[_0x5b23('0x14')](_0x5b23('0x12'),_0x41c762,_0x5b23('0xc'));_0x2cae82(_0x4c29d0['result'][_0x5b23('0x13')]);}})[_0x5b23('0x15')](function(_0x444601){logger[_0x5b23('0x10')](_0x5b23('0x12'),_0x41c762,_0x444601);_0x13284b(_0x444601);});});}exports[_0x5b23('0x16')]=function(_0x1e7812){var _0x31b5ce=this;return new Promise(function(_0x1e7d9b,_0x1eaf0c){return db[_0x5b23('0x17')][_0x5b23('0x18')]({'raw':_0x1e7812[_0x5b23('0x19')]?_0x1e7812[_0x5b23('0x19')][_0x5b23('0x1a')]===undefined?!![]:![]:!![],'where':_0x1e7812['options']?_0x1e7812['options'][_0x5b23('0x1b')]||null:null,'attributes':_0x1e7812['options']?_0x1e7812['options']['attributes']||null:null,'limit':_0x1e7812[_0x5b23('0x19')]?_0x1e7812['options']['limit']||null:null,'include':_0x1e7812[_0x5b23('0x19')]?_0x1e7812[_0x5b23('0x19')][_0x5b23('0x1c')]?_[_0x5b23('0x1d')](_0x1e7812[_0x5b23('0x19')][_0x5b23('0x1c')],function(_0x595715){return{'model':db[_0x595715[_0x5b23('0x1e')]],'as':_0x595715['as'],'attributes':_0x595715[_0x5b23('0x1f')],'include':_0x595715[_0x5b23('0x1c')]?_[_0x5b23('0x1d')](_0x595715[_0x5b23('0x1c')],function(_0x35d312){return{'model':db[_0x35d312[_0x5b23('0x1e')]],'as':_0x35d312['as'],'attributes':_0x35d312[_0x5b23('0x1f')],'include':_0x35d312[_0x5b23('0x1c')]?_[_0x5b23('0x1d')](_0x35d312['include'],function(_0x3e5111){return{'model':db[_0x3e5111[_0x5b23('0x1e')]],'as':_0x3e5111['as'],'attributes':_0x3e5111[_0x5b23('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5b23('0xb')](function(_0x3d20b1){logger[_0x5b23('0x14')](_0x5b23('0x16'),_0x1e7812);logger[_0x5b23('0xd')]('GetSmsQueue',_0x1e7812,JSON[_0x5b23('0xf')](_0x3d20b1));_0x1e7d9b(_0x3d20b1);})[_0x5b23('0x15')](function(_0x14afea){logger[_0x5b23('0x10')]('GetSmsQueue',_0x14afea[_0x5b23('0x13')],_0x1e7812);_0x1eaf0c(_0x31b5ce[_0x5b23('0x10')](0x1f4,_0x14afea[_0x5b23('0x13')]));});});};exports[_0x5b23('0x20')]=function(_0x4c061b){var _0xa01597=this;return new Promise(function(_0x4534cd,_0x52a0a5){return db[_0x5b23('0x17')][_0x5b23('0x21')]({'raw':_0x4c061b['options']?_0x4c061b['options']['raw']===undefined?!![]:![]:!![],'where':_0x4c061b[_0x5b23('0x19')]?_0x4c061b[_0x5b23('0x19')]['where']||null:null,'attributes':_0x4c061b[_0x5b23('0x19')]?_0x4c061b[_0x5b23('0x19')][_0x5b23('0x1f')]||null:null,'include':_0x4c061b[_0x5b23('0x19')]?_0x4c061b['options'][_0x5b23('0x1c')]?_[_0x5b23('0x1d')](_0x4c061b[_0x5b23('0x19')][_0x5b23('0x1c')],function(_0x5e68f9){return{'model':db[_0x5e68f9[_0x5b23('0x1e')]],'as':_0x5e68f9['as'],'attributes':_0x5e68f9[_0x5b23('0x1f')],'include':_0x5e68f9[_0x5b23('0x1c')]?_[_0x5b23('0x1d')](_0x5e68f9[_0x5b23('0x1c')],function(_0x680cad){return{'model':db[_0x680cad[_0x5b23('0x1e')]],'as':_0x680cad['as'],'attributes':_0x680cad[_0x5b23('0x1f')],'include':_0x680cad['include']?_[_0x5b23('0x1d')](_0x680cad['include'],function(_0x5361bd){return{'model':db[_0x5361bd[_0x5b23('0x1e')]],'as':_0x5361bd['as'],'attributes':_0x5361bd[_0x5b23('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5b23('0xb')](function(_0x258ae9){logger[_0x5b23('0x14')](_0x5b23('0x20'),_0x4c061b);logger[_0x5b23('0xd')]('ShowSmsQueue',_0x4c061b,JSON[_0x5b23('0xf')](_0x258ae9));_0x4534cd(_0x258ae9);})[_0x5b23('0x15')](function(_0x3850f1){logger[_0x5b23('0x10')](_0x5b23('0x20'),_0x3850f1[_0x5b23('0x13')],_0x4c061b);_0x52a0a5(_0xa01597[_0x5b23('0x10')](0x1f4,_0x3850f1['message']));});});};
\ No newline at end of file
+var _0x7a95=['rpc','client','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','request\x20sent','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','limit','map','include','model','attributes','debug','ShowSmsQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x505965,_0x1ed452){var _0x1b01c4=function(_0x4a6118){while(--_0x4a6118){_0x505965['push'](_0x505965['shift']());}};_0x1b01c4(++_0x1ed452);}(_0x7a95,0xee));var _0x57a9=function(_0x376d67,_0x44db80){_0x376d67=_0x376d67-0x0;var _0x49fff4=_0x7a95[_0x376d67];return _0x49fff4;};'use strict';var _=require(_0x57a9('0x0'));var util=require(_0x57a9('0x1'));var moment=require(_0x57a9('0x2'));var BPromise=require(_0x57a9('0x3'));var rs=require(_0x57a9('0x4'));var fs=require('fs');var Redis=require(_0x57a9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x57a9('0x6'));var logger=require(_0x57a9('0x7'))(_0x57a9('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x57a9('0x9')]['http']({'port':0x232a});config[_0x57a9('0xa')]=_[_0x57a9('0xb')](config[_0x57a9('0xa')],{'host':_0x57a9('0xc'),'port':0x18eb});var socket=require(_0x57a9('0xd'))(new Redis(config[_0x57a9('0xa')]));require(_0x57a9('0xe'))[_0x57a9('0xf')](socket);function respondWithRpcPromise(_0x4fc8ed,_0x20830c,_0x322a79){return new BPromise(function(_0x1277bd,_0x4c8fd6){return client[_0x57a9('0x10')](_0x4fc8ed,_0x322a79)[_0x57a9('0x11')](function(_0x43a92f){logger[_0x57a9('0x12')]('SmsQueue,\x20%s,\x20%s',_0x20830c,_0x57a9('0x13'));logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0x20830c,_0x57a9('0x13'),JSON[_0x57a9('0x14')](_0x43a92f));if(_0x43a92f[_0x57a9('0x15')]){if(_0x43a92f[_0x57a9('0x15')][_0x57a9('0x16')]===0x1f4){logger[_0x57a9('0x15')](_0x57a9('0x17'),_0x20830c,_0x43a92f[_0x57a9('0x15')][_0x57a9('0x18')]);return _0x4c8fd6(_0x43a92f[_0x57a9('0x15')]['message']);}logger[_0x57a9('0x15')]('SmsQueue,\x20%s,\x20%s',_0x20830c,_0x43a92f[_0x57a9('0x15')]['message']);return _0x1277bd(_0x43a92f[_0x57a9('0x15')][_0x57a9('0x18')]);}else{logger['info']('SmsQueue,\x20%s,\x20%s',_0x20830c,'request\x20sent');_0x1277bd(_0x43a92f[_0x57a9('0x19')][_0x57a9('0x18')]);}})[_0x57a9('0x1a')](function(_0x530fdc){logger[_0x57a9('0x15')](_0x57a9('0x17'),_0x20830c,_0x530fdc);_0x4c8fd6(_0x530fdc);});});}exports[_0x57a9('0x1b')]=function(_0x5ef462){var _0x294b71=this;return new Promise(function(_0x5d977f,_0x3262a2){return db[_0x57a9('0x1c')][_0x57a9('0x1d')]({'raw':_0x5ef462['options']?_0x5ef462[_0x57a9('0x1e')][_0x57a9('0x1f')]===undefined?!![]:![]:!![],'where':_0x5ef462[_0x57a9('0x1e')]?_0x5ef462['options'][_0x57a9('0x20')]||null:null,'attributes':_0x5ef462[_0x57a9('0x1e')]?_0x5ef462[_0x57a9('0x1e')]['attributes']||null:null,'limit':_0x5ef462['options']?_0x5ef462[_0x57a9('0x1e')][_0x57a9('0x21')]||null:null,'include':_0x5ef462[_0x57a9('0x1e')]?_0x5ef462[_0x57a9('0x1e')]['include']?_[_0x57a9('0x22')](_0x5ef462[_0x57a9('0x1e')][_0x57a9('0x23')],function(_0x2feba7){return{'model':db[_0x2feba7['model']],'as':_0x2feba7['as'],'attributes':_0x2feba7['attributes'],'include':_0x2feba7[_0x57a9('0x23')]?_['map'](_0x2feba7[_0x57a9('0x23')],function(_0x5806de){return{'model':db[_0x5806de[_0x57a9('0x24')]],'as':_0x5806de['as'],'attributes':_0x5806de[_0x57a9('0x25')],'include':_0x5806de[_0x57a9('0x23')]?_[_0x57a9('0x22')](_0x5806de[_0x57a9('0x23')],function(_0x554e3c){return{'model':db[_0x554e3c[_0x57a9('0x24')]],'as':_0x554e3c['as'],'attributes':_0x554e3c[_0x57a9('0x25')]};}):[]};}):[]};}):[]:[]})[_0x57a9('0x11')](function(_0x475565){logger[_0x57a9('0x12')](_0x57a9('0x1b'),_0x5ef462);logger[_0x57a9('0x26')](_0x57a9('0x1b'),_0x5ef462,JSON[_0x57a9('0x14')](_0x475565));_0x5d977f(_0x475565);})[_0x57a9('0x1a')](function(_0x25696f){logger[_0x57a9('0x15')](_0x57a9('0x1b'),_0x25696f[_0x57a9('0x18')],_0x5ef462);_0x3262a2(_0x294b71[_0x57a9('0x15')](0x1f4,_0x25696f[_0x57a9('0x18')]));});});};exports[_0x57a9('0x27')]=function(_0x440d4d){var _0x56a731=this;return new Promise(function(_0x4ea00d,_0xd8f20){return db[_0x57a9('0x1c')][_0x57a9('0x28')]({'raw':_0x440d4d[_0x57a9('0x1e')]?_0x440d4d[_0x57a9('0x1e')][_0x57a9('0x1f')]===undefined?!![]:![]:!![],'where':_0x440d4d[_0x57a9('0x1e')]?_0x440d4d[_0x57a9('0x1e')][_0x57a9('0x20')]||null:null,'attributes':_0x440d4d[_0x57a9('0x1e')]?_0x440d4d[_0x57a9('0x1e')][_0x57a9('0x25')]||null:null,'include':_0x440d4d[_0x57a9('0x1e')]?_0x440d4d['options'][_0x57a9('0x23')]?_[_0x57a9('0x22')](_0x440d4d[_0x57a9('0x1e')][_0x57a9('0x23')],function(_0x1dba30){return{'model':db[_0x1dba30[_0x57a9('0x24')]],'as':_0x1dba30['as'],'attributes':_0x1dba30['attributes'],'include':_0x1dba30[_0x57a9('0x23')]?_[_0x57a9('0x22')](_0x1dba30[_0x57a9('0x23')],function(_0x8e27b3){return{'model':db[_0x8e27b3['model']],'as':_0x8e27b3['as'],'attributes':_0x8e27b3[_0x57a9('0x25')],'include':_0x8e27b3[_0x57a9('0x23')]?_[_0x57a9('0x22')](_0x8e27b3[_0x57a9('0x23')],function(_0x169fa1){return{'model':db[_0x169fa1[_0x57a9('0x24')]],'as':_0x169fa1['as'],'attributes':_0x169fa1[_0x57a9('0x25')]};}):[]};}):[]};}):[]:[]})[_0x57a9('0x11')](function(_0x49c66e){logger[_0x57a9('0x12')](_0x57a9('0x27'),_0x440d4d);logger[_0x57a9('0x26')](_0x57a9('0x27'),_0x440d4d,JSON['stringify'](_0x49c66e));_0x4ea00d(_0x49c66e);})[_0x57a9('0x1a')](function(_0x22eed3){logger[_0x57a9('0x15')](_0x57a9('0x27'),_0x22eed3[_0x57a9('0x18')],_0x440d4d);_0xd8f20(_0x56a731[_0x57a9('0x15')](0x1f4,_0x22eed3[_0x57a9('0x18')]));});});};
\ No newline at end of file
index 3d8f956..5d871c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22fe=['length','smsQueue:','./smsQueue.events','save'];(function(_0x16acdd,_0x1dc796){var _0x466e45=function(_0x21e0fe){while(--_0x21e0fe){_0x16acdd['push'](_0x16acdd['shift']());}};_0x466e45(++_0x1dc796);}(_0x22fe,0x15a));var _0xe22f=function(_0x4494a4,_0x5d2edf){_0x4494a4=_0x4494a4-0x0;var _0x479cd5=_0x22fe[_0x4494a4];return _0x479cd5;};'use strict';var SmsQueueEvents=require(_0xe22f('0x0'));var events=[_0xe22f('0x1'),'remove','update'];function createListener(_0x507766,_0x40477f){return function(_0x436cb7){_0x40477f['emit'](_0x507766,_0x436cb7);};}function removeListener(_0x19dae5,_0x54f42f){return function(){SmsQueueEvents['removeListener'](_0x19dae5,_0x54f42f);};}exports['register']=function(_0x4bb7e4){for(var _0x1f89c4=0x0,_0x4f766b=events[_0xe22f('0x2')];_0x1f89c4<_0x4f766b;_0x1f89c4++){var _0xc4c27=events[_0x1f89c4];var _0x387dd4=createListener(_0xe22f('0x3')+_0xc4c27,_0x4bb7e4);SmsQueueEvents['on'](_0xc4c27,_0x387dd4);}};
\ No newline at end of file
+var _0x61ad=['emit','removeListener','length','smsQueue:','./smsQueue.events','save','remove','update'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x61ad,0x1b4));var _0xd61a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x61ad[_0x321bb2];return _0x9c12ed;};'use strict';var SmsQueueEvents=require(_0xd61a('0x0'));var events=[_0xd61a('0x1'),_0xd61a('0x2'),_0xd61a('0x3')];function createListener(_0x2bcdd0,_0x2b7e5d){return function(_0x58a278){_0x2b7e5d[_0xd61a('0x4')](_0x2bcdd0,_0x58a278);};}function removeListener(_0x1a44e3,_0x575e23){return function(){SmsQueueEvents[_0xd61a('0x5')](_0x1a44e3,_0x575e23);};}exports['register']=function(_0x2eb06d){for(var _0x40ebbf=0x0,_0xa9d28b=events[_0xd61a('0x6')];_0x40ebbf<_0xa9d28b;_0x40ebbf++){var _0x1a195d=events[_0x40ebbf];var _0x22e54f=createListener(_0xd61a('0x7')+_0x1a195d,_0x2eb06d);SmsQueueEvents['on'](_0x1a195d,_0x22e54f);}};
\ No newline at end of file
index 7bab7e2..0f4e561 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b9b=['../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show','post','create','update','delete','destroy','exports','util','express','../../components/auth/service','../../components/interaction/service'];(function(_0x538b4a,_0x4ef8b8){var _0x287276=function(_0x5d91ed){while(--_0x5d91ed){_0x538b4a['push'](_0x538b4a['shift']());}};_0x287276(++_0x4ef8b8);}(_0x6b9b,0x19a));var _0xb6b9=function(_0xcd46b1,_0xbb5494){_0xcd46b1=_0xcd46b1-0x0;var _0x531906=_0x6b9b[_0xcd46b1];return _0x531906;};'use strict';var multer=require('multer');var util=require(_0xb6b9('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb6b9('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb6b9('0x2'));var interaction=require(_0xb6b9('0x3'));var config=require(_0xb6b9('0x4'));var controller=require('./smsQueueReport.controller');router['get']('/',auth[_0xb6b9('0x5')](),controller[_0xb6b9('0x6')]);router['get'](_0xb6b9('0x7'),auth[_0xb6b9('0x5')](),controller[_0xb6b9('0x8')]);router[_0xb6b9('0x9')](_0xb6b9('0xa'),auth[_0xb6b9('0x5')](),controller[_0xb6b9('0xb')]);router[_0xb6b9('0xc')]('/',auth['isAuthenticated'](),controller[_0xb6b9('0xd')]);router['put'](_0xb6b9('0xa'),auth[_0xb6b9('0x5')](),controller[_0xb6b9('0xe')]);router[_0xb6b9('0xf')](_0xb6b9('0xa'),auth['isAuthenticated'](),controller[_0xb6b9('0x10')]);module[_0xb6b9('0x11')]=router;
\ No newline at end of file
+var _0x6a3b=['./smsQueueReport.controller','isAuthenticated','index','get','/describe','describe','show','post','create','put','update','delete','/:id','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x28df22,_0x5af00d){var _0x225ecb=function(_0x5b5079){while(--_0x5b5079){_0x28df22['push'](_0x28df22['shift']());}};_0x225ecb(++_0x5af00d);}(_0x6a3b,0x134));var _0xb6a3=function(_0x59b4a6,_0x321bd4){_0x59b4a6=_0x59b4a6-0x0;var _0x33d150=_0x6a3b[_0x59b4a6];return _0x33d150;};'use strict';var multer=require('multer');var util=require(_0xb6a3('0x0'));var path=require(_0xb6a3('0x1'));var timeout=require(_0xb6a3('0x2'));var express=require('express');var router=express[_0xb6a3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb6a3('0x4'));var interaction=require(_0xb6a3('0x5'));var config=require(_0xb6a3('0x6'));var controller=require(_0xb6a3('0x7'));router['get']('/',auth[_0xb6a3('0x8')](),controller[_0xb6a3('0x9')]);router[_0xb6a3('0xa')](_0xb6a3('0xb'),auth[_0xb6a3('0x8')](),controller[_0xb6a3('0xc')]);router[_0xb6a3('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xb6a3('0xd')]);router[_0xb6a3('0xe')]('/',auth[_0xb6a3('0x8')](),controller[_0xb6a3('0xf')]);router[_0xb6a3('0x10')]('/:id',auth[_0xb6a3('0x8')](),controller[_0xb6a3('0x11')]);router[_0xb6a3('0x12')](_0xb6a3('0x13'),auth[_0xb6a3('0x8')](),controller['destroy']);module[_0xb6a3('0x14')]=router;
\ No newline at end of file
index 766a2cd..e2350a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2d6=['DATE','sequelize','exports','STRING'];(function(_0x241b15,_0x1eb9b7){var _0x19eeb9=function(_0x997091){while(--_0x997091){_0x241b15['push'](_0x241b15['shift']());}};_0x19eeb9(++_0x1eb9b7);}(_0xc2d6,0x171));var _0x6c2d=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xc2d6[_0x5c351c];return _0x26f3b3;};'use strict';var moment=require('moment');var Sequelize=require(_0x6c2d('0x0'));module[_0x6c2d('0x1')]={'uniqueid':{'type':Sequelize[_0x6c2d('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x6c2d('0x2')]},'joinAt':{'type':Sequelize[_0x6c2d('0x3')]},'leaveAt':{'type':Sequelize[_0x6c2d('0x3')]},'acceptAt':{'type':Sequelize[_0x6c2d('0x3')]},'exitAt':{'type':Sequelize[_0x6c2d('0x3')]},'reason':{'type':Sequelize[_0x6c2d('0x2')]}};
\ No newline at end of file
+var _0x415d=['exports','STRING','DATE','moment'];(function(_0xcb98a7,_0x5a8f09){var _0xc17dba=function(_0xa75f10){while(--_0xa75f10){_0xcb98a7['push'](_0xcb98a7['shift']());}};_0xc17dba(++_0x5a8f09);}(_0x415d,0x1eb));var _0xd415=function(_0x3a8463,_0x516de1){_0x3a8463=_0x3a8463-0x0;var _0x18cbdf=_0x415d[_0x3a8463];return _0x18cbdf;};'use strict';var moment=require(_0xd415('0x0'));var Sequelize=require('sequelize');module[_0xd415('0x1')]={'uniqueid':{'type':Sequelize[_0xd415('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xd415('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xd415('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xd415('0x2')]}};
\ No newline at end of file
index 83d79ba..eaeb6d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb29b=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','SmsQueueReport','rawAttributes','fieldName','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','create','body','catch','describe','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x5c5e95,_0x740a18){var _0x55c9aa=function(_0x52c94e){while(--_0x52c94e){_0x5c5e95['push'](_0x5c5e95['shift']());}};_0x55c9aa(++_0x740a18);}(_0xb29b,0x1b2));var _0xbb29=function(_0x1be5a3,_0x1f80f2){_0x1be5a3=_0x1be5a3-0x0;var _0x53b728=_0xb29b[_0x1be5a3];return _0x53b728;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbb29('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbb29('0x1'));var moment=require(_0xbb29('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xbb29('0x3'));var util=require(_0xbb29('0x4'));var path=require(_0xbb29('0x5'));var sox=require(_0xbb29('0x6'));var csv=require(_0xbb29('0x7'));var ejs=require(_0xbb29('0x8'));var fs=require('fs');var fs_extra=require(_0xbb29('0x9'));var _=require(_0xbb29('0xa'));var squel=require(_0xbb29('0xb'));var crypto=require('crypto');var jsforce=require(_0xbb29('0xc'));var deskjs=require(_0xbb29('0xd'));var toCsv=require(_0xbb29('0x7'));var querystring=require(_0xbb29('0xe'));var Papa=require(_0xbb29('0xf'));var Redis=require(_0xbb29('0x10'));var authService=require(_0xbb29('0x11'));var qs=require(_0xbb29('0x12'));var as=require(_0xbb29('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbb29('0x14'))(_0xbb29('0x15'));var utils=require(_0xbb29('0x16'));var config=require(_0xbb29('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb29('0x18'))['db'];function respondWithStatusCode(_0x3790df,_0x3d6ba9){_0x3d6ba9=_0x3d6ba9||0xcc;return function(_0x4241fa){if(_0x4241fa){return _0x3790df[_0xbb29('0x19')](_0x3d6ba9);}return _0x3790df['status'](_0x3d6ba9)[_0xbb29('0x1a')]();};}function respondWithResult(_0xd4cee4,_0x37afcb){_0x37afcb=_0x37afcb||0xc8;return function(_0x4bbdbf){if(_0x4bbdbf){return _0xd4cee4[_0xbb29('0x1b')](_0x37afcb)[_0xbb29('0x1c')](_0x4bbdbf);}};}function respondWithFilteredResult(_0x542587,_0x3250bb){return function(_0x42baa6){if(_0x42baa6){var _0x2027b8=typeof _0x3250bb[_0xbb29('0x1d')]==='undefined'&&typeof _0x3250bb[_0xbb29('0x1e')]===_0xbb29('0x1f');var _0x5aa82e=_0x42baa6[_0xbb29('0x20')];var _0x251a9e=_0x2027b8?0x0:_0x3250bb[_0xbb29('0x1d')];var _0x58f7ed=_0x2027b8?_0x42baa6[_0xbb29('0x20')]:_0x3250bb[_0xbb29('0x1d')]+_0x3250bb[_0xbb29('0x1e')];var _0x11af44;if(_0x58f7ed>=_0x5aa82e){_0x58f7ed=_0x5aa82e;_0x11af44=0xc8;}else{_0x11af44=0xce;}_0x542587[_0xbb29('0x1b')](_0x11af44);return _0x542587[_0xbb29('0x21')]('Content-Range',_0x251a9e+'-'+_0x58f7ed+'/'+_0x5aa82e)[_0xbb29('0x1c')](_0x42baa6);}return null;};}function patchUpdates(_0x470147){return function(_0x287844){try{jsonpatch[_0xbb29('0x22')](_0x287844,_0x470147,!![]);}catch(_0xadaec8){return BPromise[_0xbb29('0x23')](_0xadaec8);}return _0x287844['save']();};}function saveUpdates(_0x1be353,_0x41debd){return function(_0x5f3cc6){if(_0x5f3cc6){return _0x5f3cc6[_0xbb29('0x24')](_0x1be353)[_0xbb29('0x25')](function(_0x45958c){return _0x45958c;});}return null;};}function removeEntity(_0x149612,_0x115a28){return function(_0x3957a6){if(_0x3957a6){return _0x3957a6[_0xbb29('0x26')]()[_0xbb29('0x25')](function(){_0x149612['status'](0xcc)[_0xbb29('0x1a')]();});}};}function handleEntityNotFound(_0x3887ff,_0x18d39d){return function(_0x7fea17){if(!_0x7fea17){_0x3887ff[_0xbb29('0x19')](0x194);}return _0x7fea17;};}function handleError(_0x306f47,_0x33f28d){_0x33f28d=_0x33f28d||0x1f4;return function(_0x369839){logger[_0xbb29('0x27')](_0x369839[_0xbb29('0x28')]);if(_0x369839['name']){delete _0x369839[_0xbb29('0x29')];}_0x306f47['status'](_0x33f28d)[_0xbb29('0x2a')](_0x369839);};}exports[_0xbb29('0x2b')]=function(_0x412407,_0x55b21c){var _0x334dbf={},_0x21e9d2={},_0x18a3cd={'count':0x0,'rows':[]};var _0x3561a6=_['map'](db[_0xbb29('0x2c')][_0xbb29('0x2d')],function(_0x35459d){return{'name':_0x35459d[_0xbb29('0x2e')],'type':_0x35459d['type']['key']};});_0x21e9d2[_0xbb29('0x2f')]=_[_0xbb29('0x30')](_0x3561a6,_0xbb29('0x29'));_0x21e9d2[_0xbb29('0x31')]=_[_0xbb29('0x32')](_0x412407[_0xbb29('0x31')]);_0x21e9d2['filters']=_[_0xbb29('0x33')](_0x21e9d2[_0xbb29('0x2f')],_0x21e9d2[_0xbb29('0x31')]);_0x334dbf[_0xbb29('0x34')]=_[_0xbb29('0x33')](_0x21e9d2[_0xbb29('0x2f')],qs[_0xbb29('0x35')](_0x412407[_0xbb29('0x31')]['fields']));_0x334dbf[_0xbb29('0x34')]=_0x334dbf['attributes'][_0xbb29('0x36')]?_0x334dbf[_0xbb29('0x34')]:_0x21e9d2[_0xbb29('0x2f')];if(!_0x412407[_0xbb29('0x31')]['hasOwnProperty'](_0xbb29('0x37'))){_0x334dbf['limit']=qs[_0xbb29('0x1e')](_0x412407[_0xbb29('0x31')]['limit']);_0x334dbf[_0xbb29('0x1d')]=qs[_0xbb29('0x1d')](_0x412407[_0xbb29('0x31')]['offset']);}_0x334dbf[_0xbb29('0x38')]=qs[_0xbb29('0x39')](_0x412407['query'][_0xbb29('0x39')]);_0x334dbf[_0xbb29('0x3a')]=qs[_0xbb29('0x3b')](_[_0xbb29('0x3c')](_0x412407[_0xbb29('0x31')],_0x21e9d2[_0xbb29('0x3b')]),_0x3561a6);if(_0x412407[_0xbb29('0x31')][_0xbb29('0x3d')]){_0x334dbf[_0xbb29('0x3a')]=_[_0xbb29('0x3e')](_0x334dbf[_0xbb29('0x3a')],{'$or':_[_0xbb29('0x30')](_0x3561a6,function(_0x43059d){if(_0x43059d['type']!==_0xbb29('0x3f')){var _0x1156b4={};_0x1156b4[_0x43059d[_0xbb29('0x29')]]={'$like':'%'+_0x412407[_0xbb29('0x31')][_0xbb29('0x3d')]+'%'};return _0x1156b4;}})});}_0x334dbf=_['merge']({},_0x334dbf,_0x412407['options']);var _0x2a8421={'where':_0x334dbf['where']};return db[_0xbb29('0x2c')][_0xbb29('0x20')](_0x2a8421)[_0xbb29('0x25')](function(_0x122096){_0x18a3cd[_0xbb29('0x20')]=_0x122096;if(_0x412407[_0xbb29('0x31')][_0xbb29('0x40')]){_0x334dbf[_0xbb29('0x41')]=[{'all':!![]}];}return db[_0xbb29('0x2c')][_0xbb29('0x42')](_0x334dbf);})[_0xbb29('0x25')](function(_0x23ebca){_0x18a3cd[_0xbb29('0x43')]=_0x23ebca;return _0x18a3cd;})[_0xbb29('0x25')](respondWithFilteredResult(_0x55b21c,_0x334dbf))['catch'](handleError(_0x55b21c,null));};exports[_0xbb29('0x44')]=function(_0x5e9cd7,_0xe8094e){var _0x446b66={'raw':!![],'where':{'id':_0x5e9cd7[_0xbb29('0x45')]['id']}},_0x36d9ab={};_0x36d9ab[_0xbb29('0x2f')]=_[_0xbb29('0x32')](db[_0xbb29('0x2c')]['rawAttributes']);_0x36d9ab[_0xbb29('0x31')]=_[_0xbb29('0x32')](_0x5e9cd7[_0xbb29('0x31')]);_0x36d9ab['filters']=_[_0xbb29('0x33')](_0x36d9ab['model'],_0x36d9ab[_0xbb29('0x31')]);_0x446b66[_0xbb29('0x34')]=_[_0xbb29('0x33')](_0x36d9ab[_0xbb29('0x2f')],qs['fields'](_0x5e9cd7[_0xbb29('0x31')][_0xbb29('0x35')]));_0x446b66[_0xbb29('0x34')]=_0x446b66['attributes'][_0xbb29('0x36')]?_0x446b66[_0xbb29('0x34')]:_0x36d9ab[_0xbb29('0x2f')];if(_0x5e9cd7[_0xbb29('0x31')][_0xbb29('0x40')]){_0x446b66['include']=[{'all':!![]}];}_0x446b66=_['merge']({},_0x446b66,_0x5e9cd7[_0xbb29('0x46')]);return db[_0xbb29('0x2c')][_0xbb29('0x47')](_0x446b66)[_0xbb29('0x25')](handleEntityNotFound(_0xe8094e,null))[_0xbb29('0x25')](respondWithResult(_0xe8094e,null))['catch'](handleError(_0xe8094e,null));};exports[_0xbb29('0x48')]=function(_0x56eee1,_0xa10d1c){return db[_0xbb29('0x2c')][_0xbb29('0x48')](_0x56eee1[_0xbb29('0x49')],{})['then'](respondWithResult(_0xa10d1c,0xc9))[_0xbb29('0x4a')](handleError(_0xa10d1c,null));};exports[_0xbb29('0x24')]=function(_0xd4396c,_0x5d5df4){if(_0xd4396c[_0xbb29('0x49')]['id']){delete _0xd4396c['body']['id'];}return db['SmsQueueReport']['find']({'where':{'id':_0xd4396c[_0xbb29('0x45')]['id']}})[_0xbb29('0x25')](handleEntityNotFound(_0x5d5df4,null))[_0xbb29('0x25')](saveUpdates(_0xd4396c['body'],null))[_0xbb29('0x25')](respondWithResult(_0x5d5df4,null))['catch'](handleError(_0x5d5df4,null));};exports[_0xbb29('0x26')]=function(_0xeb3a28,_0x45fb93){return db[_0xbb29('0x2c')][_0xbb29('0x47')]({'where':{'id':_0xeb3a28[_0xbb29('0x45')]['id']}})[_0xbb29('0x25')](handleEntityNotFound(_0x45fb93,null))[_0xbb29('0x25')](removeEntity(_0x45fb93,null))[_0xbb29('0x4a')](handleError(_0x45fb93,null));};exports[_0xbb29('0x4b')]=function(_0x3a33d5,_0x1cb677){return db[_0xbb29('0x2c')][_0xbb29('0x4b')]()['then'](respondWithResult(_0x1cb677,null))['catch'](handleError(_0x1cb677,null));};
\ No newline at end of file
+var _0xf66f=['options','SmsQueueReport','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','end','json','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','filter','merge','type','VIRTUAL'];(function(_0x121516,_0x51bde8){var _0x3b0eab=function(_0x375627){while(--_0x375627){_0x121516['push'](_0x121516['shift']());}};_0x3b0eab(++_0x51bde8);}(_0xf66f,0x141));var _0xff66=function(_0x280ae7,_0x456fb1){_0x280ae7=_0x280ae7-0x0;var _0x418b9e=_0xf66f[_0x280ae7];return _0x418b9e;};'use strict';var emlformat=require(_0xff66('0x0'));var rimraf=require(_0xff66('0x1'));var zipdir=require(_0xff66('0x2'));var jsonpatch=require(_0xff66('0x3'));var rp=require(_0xff66('0x4'));var moment=require(_0xff66('0x5'));var BPromise=require(_0xff66('0x6'));var Mustache=require(_0xff66('0x7'));var util=require(_0xff66('0x8'));var path=require(_0xff66('0x9'));var sox=require(_0xff66('0xa'));var csv=require(_0xff66('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff66('0xc'));var _=require(_0xff66('0xd'));var squel=require('squel');var crypto=require(_0xff66('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xff66('0xf'));var toCsv=require(_0xff66('0xb'));var querystring=require('querystring');var Papa=require(_0xff66('0x10'));var Redis=require(_0xff66('0x11'));var authService=require(_0xff66('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff66('0x13'));var logger=require('../../config/logger')(_0xff66('0x14'));var utils=require(_0xff66('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xff66('0x16'));var db=require(_0xff66('0x17'))['db'];function respondWithStatusCode(_0xe9b68f,_0x2a1f3e){_0x2a1f3e=_0x2a1f3e||0xcc;return function(_0x3d1023){if(_0x3d1023){return _0xe9b68f['sendStatus'](_0x2a1f3e);}return _0xe9b68f['status'](_0x2a1f3e)[_0xff66('0x18')]();};}function respondWithResult(_0x2565e,_0x1047bf){_0x1047bf=_0x1047bf||0xc8;return function(_0x490f23){if(_0x490f23){return _0x2565e['status'](_0x1047bf)[_0xff66('0x19')](_0x490f23);}};}function respondWithFilteredResult(_0x1149fe,_0x369fa8){return function(_0x4713c2){if(_0x4713c2){var _0x1b4799=typeof _0x369fa8['offset']===_0xff66('0x1a')&&typeof _0x369fa8[_0xff66('0x1b')]===_0xff66('0x1a');var _0xeb1789=_0x4713c2[_0xff66('0x1c')];var _0x1e2f6e=_0x1b4799?0x0:_0x369fa8['offset'];var _0x69b6f6=_0x1b4799?_0x4713c2[_0xff66('0x1c')]:_0x369fa8['offset']+_0x369fa8['limit'];var _0x351bcc;if(_0x69b6f6>=_0xeb1789){_0x69b6f6=_0xeb1789;_0x351bcc=0xc8;}else{_0x351bcc=0xce;}_0x1149fe[_0xff66('0x1d')](_0x351bcc);return _0x1149fe[_0xff66('0x1e')](_0xff66('0x1f'),_0x1e2f6e+'-'+_0x69b6f6+'/'+_0xeb1789)[_0xff66('0x19')](_0x4713c2);}return null;};}function patchUpdates(_0xbc021d){return function(_0x5af759){try{jsonpatch[_0xff66('0x20')](_0x5af759,_0xbc021d,!![]);}catch(_0x3a6ec7){return BPromise[_0xff66('0x21')](_0x3a6ec7);}return _0x5af759[_0xff66('0x22')]();};}function saveUpdates(_0xac510b,_0x342d1b){return function(_0x1e7238){if(_0x1e7238){return _0x1e7238[_0xff66('0x23')](_0xac510b)[_0xff66('0x24')](function(_0x5b7c39){return _0x5b7c39;});}return null;};}function removeEntity(_0x5706df,_0x4606d9){return function(_0x254100){if(_0x254100){return _0x254100[_0xff66('0x25')]()[_0xff66('0x24')](function(){_0x5706df[_0xff66('0x1d')](0xcc)[_0xff66('0x18')]();});}};}function handleEntityNotFound(_0x5e16c6,_0x525e0e){return function(_0x3a2a7c){if(!_0x3a2a7c){_0x5e16c6[_0xff66('0x26')](0x194);}return _0x3a2a7c;};}function handleError(_0x2131b8,_0x58f9cc){_0x58f9cc=_0x58f9cc||0x1f4;return function(_0x14a25d){logger['error'](_0x14a25d[_0xff66('0x27')]);if(_0x14a25d[_0xff66('0x28')]){delete _0x14a25d[_0xff66('0x28')];}_0x2131b8[_0xff66('0x1d')](_0x58f9cc)[_0xff66('0x29')](_0x14a25d);};}exports[_0xff66('0x2a')]=function(_0x2180dd,_0xca6042){var _0x324042={},_0xd0285d={},_0x5b3189={'count':0x0,'rows':[]};var _0x7a7c83=_[_0xff66('0x2b')](db['SmsQueueReport']['rawAttributes'],function(_0x3d5e82){return{'name':_0x3d5e82[_0xff66('0x2c')],'type':_0x3d5e82['type'][_0xff66('0x2d')]};});_0xd0285d[_0xff66('0x2e')]=_['map'](_0x7a7c83,_0xff66('0x28'));_0xd0285d[_0xff66('0x2f')]=_[_0xff66('0x30')](_0x2180dd[_0xff66('0x2f')]);_0xd0285d['filters']=_['intersection'](_0xd0285d[_0xff66('0x2e')],_0xd0285d[_0xff66('0x2f')]);_0x324042['attributes']=_[_0xff66('0x31')](_0xd0285d[_0xff66('0x2e')],qs[_0xff66('0x32')](_0x2180dd[_0xff66('0x2f')]['fields']));_0x324042[_0xff66('0x33')]=_0x324042[_0xff66('0x33')][_0xff66('0x34')]?_0x324042[_0xff66('0x33')]:_0xd0285d['model'];if(!_0x2180dd[_0xff66('0x2f')][_0xff66('0x35')](_0xff66('0x36'))){_0x324042[_0xff66('0x1b')]=qs[_0xff66('0x1b')](_0x2180dd[_0xff66('0x2f')][_0xff66('0x1b')]);_0x324042[_0xff66('0x37')]=qs[_0xff66('0x37')](_0x2180dd['query'][_0xff66('0x37')]);}_0x324042[_0xff66('0x38')]=qs[_0xff66('0x39')](_0x2180dd[_0xff66('0x2f')][_0xff66('0x39')]);_0x324042[_0xff66('0x3a')]=qs['filters'](_['pick'](_0x2180dd['query'],_0xd0285d[_0xff66('0x3b')]),_0x7a7c83);if(_0x2180dd[_0xff66('0x2f')][_0xff66('0x3c')]){_0x324042[_0xff66('0x3a')]=_[_0xff66('0x3d')](_0x324042['where'],{'$or':_[_0xff66('0x2b')](_0x7a7c83,function(_0x42c55f){if(_0x42c55f[_0xff66('0x3e')]!==_0xff66('0x3f')){var _0x336080={};_0x336080[_0x42c55f[_0xff66('0x28')]]={'$like':'%'+_0x2180dd[_0xff66('0x2f')][_0xff66('0x3c')]+'%'};return _0x336080;}})});}_0x324042=_[_0xff66('0x3d')]({},_0x324042,_0x2180dd[_0xff66('0x40')]);var _0x3f0825={'where':_0x324042['where']};return db[_0xff66('0x41')][_0xff66('0x1c')](_0x3f0825)['then'](function(_0x1b1b12){_0x5b3189[_0xff66('0x1c')]=_0x1b1b12;if(_0x2180dd[_0xff66('0x2f')]['includeAll']){_0x324042[_0xff66('0x42')]=[{'all':!![]}];}return db[_0xff66('0x41')][_0xff66('0x43')](_0x324042);})['then'](function(_0x11c961){_0x5b3189[_0xff66('0x44')]=_0x11c961;return _0x5b3189;})[_0xff66('0x24')](respondWithFilteredResult(_0xca6042,_0x324042))[_0xff66('0x45')](handleError(_0xca6042,null));};exports[_0xff66('0x46')]=function(_0x4b1c50,_0x3a9a58){var _0x295a7a={'raw':!![],'where':{'id':_0x4b1c50[_0xff66('0x47')]['id']}},_0x47b1d6={};_0x47b1d6[_0xff66('0x2e')]=_[_0xff66('0x30')](db[_0xff66('0x41')][_0xff66('0x48')]);_0x47b1d6[_0xff66('0x2f')]=_[_0xff66('0x30')](_0x4b1c50[_0xff66('0x2f')]);_0x47b1d6[_0xff66('0x3b')]=_[_0xff66('0x31')](_0x47b1d6[_0xff66('0x2e')],_0x47b1d6['query']);_0x295a7a[_0xff66('0x33')]=_[_0xff66('0x31')](_0x47b1d6['model'],qs[_0xff66('0x32')](_0x4b1c50['query'][_0xff66('0x32')]));_0x295a7a[_0xff66('0x33')]=_0x295a7a[_0xff66('0x33')][_0xff66('0x34')]?_0x295a7a['attributes']:_0x47b1d6[_0xff66('0x2e')];if(_0x4b1c50[_0xff66('0x2f')]['includeAll']){_0x295a7a[_0xff66('0x42')]=[{'all':!![]}];}_0x295a7a=_[_0xff66('0x3d')]({},_0x295a7a,_0x4b1c50['options']);return db[_0xff66('0x41')][_0xff66('0x49')](_0x295a7a)['then'](handleEntityNotFound(_0x3a9a58,null))[_0xff66('0x24')](respondWithResult(_0x3a9a58,null))[_0xff66('0x45')](handleError(_0x3a9a58,null));};exports[_0xff66('0x4a')]=function(_0x5cd6b2,_0x2c1f6d){return db['SmsQueueReport'][_0xff66('0x4a')](_0x5cd6b2[_0xff66('0x4b')],{})['then'](respondWithResult(_0x2c1f6d,0xc9))['catch'](handleError(_0x2c1f6d,null));};exports['update']=function(_0x4b6e6c,_0x5981c0){if(_0x4b6e6c[_0xff66('0x4b')]['id']){delete _0x4b6e6c[_0xff66('0x4b')]['id'];}return db[_0xff66('0x41')]['find']({'where':{'id':_0x4b6e6c[_0xff66('0x47')]['id']}})[_0xff66('0x24')](handleEntityNotFound(_0x5981c0,null))[_0xff66('0x24')](saveUpdates(_0x4b6e6c[_0xff66('0x4b')],null))[_0xff66('0x24')](respondWithResult(_0x5981c0,null))[_0xff66('0x45')](handleError(_0x5981c0,null));};exports['destroy']=function(_0x5e2f63,_0x3670be){return db['SmsQueueReport'][_0xff66('0x49')]({'where':{'id':_0x5e2f63['params']['id']}})[_0xff66('0x24')](handleEntityNotFound(_0x3670be,null))['then'](removeEntity(_0x3670be,null))['catch'](handleError(_0x3670be,null));};exports[_0xff66('0x4c')]=function(_0x70d430,_0x577b77){return db['SmsQueueReport'][_0xff66('0x4c')]()[_0xff66('0x24')](respondWithResult(_0x577b77,null))[_0xff66('0x45')](handleError(_0x577b77,null));};
\ No newline at end of file
index bb3715c..d90f541 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x4944a3,_0x40ab38){var _0x147c59=function(_0x44e1e2){while(--_0x44e1e2){_0x4944a3['push'](_0x4944a3['shift']());}};_0x147c59(++_0x40ab38);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5e6ea3,_0x9addd2){_0x5e6ea3=_0x5e6ea3-0x0;var _0x4048b5=_0xcb91[_0x5e6ea3];return _0x4048b5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x290a56,_0x5c540a){var _0x89610=function(_0x4e901f){while(--_0x4e901f){_0x290a56['push'](_0x290a56['shift']());}};_0x89610(++_0x5c540a);}(_0xe706,0xa3));var _0x6e70=function(_0x5f5cce,_0x138cc5){_0x5f5cce=_0x5f5cce-0x0;var _0x705ecf=_0xe706[_0x5f5cce];return _0x705ecf;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index 5472a2b..614c277 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b24=['where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','SmsQueueReport','create','body','options','raw','CreateSmsQueueReport','debug','UpdateSmsQueueReport'];(function(_0x4c98b9,_0x1ad11b){var _0x3a257a=function(_0x147857){while(--_0x147857){_0x4c98b9['push'](_0x4c98b9['shift']());}};_0x3a257a(++_0x1ad11b);}(_0x2b24,0x1d4));var _0x42b2=function(_0x542e70,_0x220f9c){_0x542e70=_0x542e70-0x0;var _0x24115c=_0x2b24[_0x542e70];return _0x24115c;};'use strict';var _=require(_0x42b2('0x0'));var util=require(_0x42b2('0x1'));var moment=require(_0x42b2('0x2'));var BPromise=require(_0x42b2('0x3'));var rs=require(_0x42b2('0x4'));var fs=require('fs');var Redis=require(_0x42b2('0x5'));var db=require(_0x42b2('0x6'))['db'];var utils=require(_0x42b2('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x42b2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b71b4,_0x3098dd,_0x807b1a){return new BPromise(function(_0x49458c,_0x262573){return client[_0x42b2('0x9')](_0x1b71b4,_0x807b1a)[_0x42b2('0xa')](function(_0x2d07fb){logger[_0x42b2('0xb')](_0x42b2('0xc'),_0x3098dd,_0x42b2('0xd'));logger['debug'](_0x42b2('0xe'),_0x3098dd,_0x42b2('0xd'),JSON[_0x42b2('0xf')](_0x2d07fb));if(_0x2d07fb[_0x42b2('0x10')]){if(_0x2d07fb[_0x42b2('0x10')]['code']===0x1f4){logger[_0x42b2('0x10')](_0x42b2('0xc'),_0x3098dd,_0x2d07fb['error']['message']);return _0x262573(_0x2d07fb[_0x42b2('0x10')][_0x42b2('0x11')]);}logger[_0x42b2('0x10')](_0x42b2('0xc'),_0x3098dd,_0x2d07fb['error'][_0x42b2('0x11')]);return _0x49458c(_0x2d07fb[_0x42b2('0x10')][_0x42b2('0x11')]);}else{logger[_0x42b2('0xb')](_0x42b2('0xc'),_0x3098dd,_0x42b2('0xd'));_0x49458c(_0x2d07fb[_0x42b2('0x12')][_0x42b2('0x11')]);}})[_0x42b2('0x13')](function(_0x2f4b96){logger[_0x42b2('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x3098dd,_0x2f4b96);_0x262573(_0x2f4b96);});});}exports['CreateSmsQueueReport']=function(_0x5277e5){var _0x1194d7=this;return new Promise(function(_0x54e530,_0x48b00d){return db[_0x42b2('0x14')][_0x42b2('0x15')](_0x5277e5[_0x42b2('0x16')],{'raw':_0x5277e5[_0x42b2('0x17')]?_0x5277e5[_0x42b2('0x17')][_0x42b2('0x18')]===undefined?!![]:![]:!![]})[_0x42b2('0xa')](function(_0x36f422){logger[_0x42b2('0xb')](_0x42b2('0x19'),_0x5277e5);logger[_0x42b2('0x1a')]('CreateSmsQueueReport',_0x5277e5,JSON[_0x42b2('0xf')](_0x36f422));_0x54e530(_0x36f422);})['catch'](function(_0x481482){logger['error'](_0x42b2('0x19'),_0x481482['message'],_0x5277e5);_0x48b00d(_0x1194d7[_0x42b2('0x10')](0x1f4,_0x481482[_0x42b2('0x11')]));});});};exports[_0x42b2('0x1b')]=function(_0x193afc){var _0x43a95f=this;return new Promise(function(_0x5cf621,_0x4d758d){return db[_0x42b2('0x14')]['update'](_0x193afc[_0x42b2('0x16')],{'raw':_0x193afc['options']?_0x193afc[_0x42b2('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x193afc['options']?_0x193afc[_0x42b2('0x17')][_0x42b2('0x1c')]||null:null,'attributes':_0x193afc['options']?_0x193afc['options'][_0x42b2('0x1d')]||null:null,'limit':_0x193afc[_0x42b2('0x17')]?_0x193afc[_0x42b2('0x17')][_0x42b2('0x1e')]||null:null})['then'](function(_0x25c74b){logger[_0x42b2('0xb')](_0x42b2('0x1b'),_0x193afc);logger[_0x42b2('0x1a')](_0x42b2('0x1b'),_0x193afc,JSON[_0x42b2('0xf')](_0x25c74b));_0x5cf621(_0x25c74b);})['catch'](function(_0x236d13){logger[_0x42b2('0x10')](_0x42b2('0x1b'),_0x236d13['message'],_0x193afc);_0x4d758d(_0x43a95f[_0x42b2('0x10')](0x1f4,_0x236d13[_0x42b2('0x11')]));});});};
\ No newline at end of file
+var _0xb25d=['jayson/promise','client','info','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','SmsQueueReport,\x20%s,\x20%s','message','catch','CreateSmsQueueReport','SmsQueueReport','body','options','raw','where','limit','then','UpdateSmsQueueReport','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x2f0396,_0x23837b){var _0x34cafd=function(_0x1a00a0){while(--_0x1a00a0){_0x2f0396['push'](_0x2f0396['shift']());}};_0x34cafd(++_0x23837b);}(_0xb25d,0x1f0));var _0xdb25=function(_0x385b04,_0x2ce85e){_0x385b04=_0x385b04-0x0;var _0x21ec67=_0xb25d[_0x385b04];return _0x21ec67;};'use strict';var _=require(_0xdb25('0x0'));var util=require(_0xdb25('0x1'));var moment=require(_0xdb25('0x2'));var BPromise=require('bluebird');var rs=require(_0xdb25('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb25('0x4'))['db'];var utils=require(_0xdb25('0x5'));var logger=require(_0xdb25('0x6'))('rpc');var config=require(_0xdb25('0x7'));var jayson=require(_0xdb25('0x8'));var client=jayson[_0xdb25('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2177b0,_0x2eba38,_0x5ca60e){return new BPromise(function(_0x31626b,_0x2a6d1c){return client['request'](_0x2177b0,_0x5ca60e)['then'](function(_0xbdf0db){logger[_0xdb25('0xa')]('SmsQueueReport,\x20%s,\x20%s',_0x2eba38,_0xdb25('0xb'));logger[_0xdb25('0xc')](_0xdb25('0xd'),_0x2eba38,_0xdb25('0xb'),JSON[_0xdb25('0xe')](_0xbdf0db));if(_0xbdf0db['error']){if(_0xbdf0db[_0xdb25('0xf')]['code']===0x1f4){logger[_0xdb25('0xf')](_0xdb25('0x10'),_0x2eba38,_0xbdf0db['error'][_0xdb25('0x11')]);return _0x2a6d1c(_0xbdf0db[_0xdb25('0xf')]['message']);}logger['error'](_0xdb25('0x10'),_0x2eba38,_0xbdf0db[_0xdb25('0xf')][_0xdb25('0x11')]);return _0x31626b(_0xbdf0db['error']['message']);}else{logger[_0xdb25('0xa')](_0xdb25('0x10'),_0x2eba38,_0xdb25('0xb'));_0x31626b(_0xbdf0db['result'][_0xdb25('0x11')]);}})[_0xdb25('0x12')](function(_0x2b113e){logger['error'](_0xdb25('0x10'),_0x2eba38,_0x2b113e);_0x2a6d1c(_0x2b113e);});});}exports[_0xdb25('0x13')]=function(_0x3f43d8){var _0x3f261c=this;return new Promise(function(_0x474116,_0x4792ed){return db[_0xdb25('0x14')]['create'](_0x3f43d8[_0xdb25('0x15')],{'raw':_0x3f43d8[_0xdb25('0x16')]?_0x3f43d8[_0xdb25('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x13cbff){logger[_0xdb25('0xa')](_0xdb25('0x13'),_0x3f43d8);logger[_0xdb25('0xc')]('CreateSmsQueueReport',_0x3f43d8,JSON[_0xdb25('0xe')](_0x13cbff));_0x474116(_0x13cbff);})[_0xdb25('0x12')](function(_0x46e0e3){logger[_0xdb25('0xf')]('CreateSmsQueueReport',_0x46e0e3[_0xdb25('0x11')],_0x3f43d8);_0x4792ed(_0x3f261c[_0xdb25('0xf')](0x1f4,_0x46e0e3[_0xdb25('0x11')]));});});};exports['UpdateSmsQueueReport']=function(_0x2bec8f){var _0x210fe8=this;return new Promise(function(_0x1944a0,_0x96c72b){return db['SmsQueueReport']['update'](_0x2bec8f[_0xdb25('0x15')],{'raw':_0x2bec8f[_0xdb25('0x16')]?_0x2bec8f[_0xdb25('0x16')][_0xdb25('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2bec8f[_0xdb25('0x16')]?_0x2bec8f[_0xdb25('0x16')][_0xdb25('0x18')]||null:null,'attributes':_0x2bec8f[_0xdb25('0x16')]?_0x2bec8f[_0xdb25('0x16')]['attributes']||null:null,'limit':_0x2bec8f['options']?_0x2bec8f[_0xdb25('0x16')][_0xdb25('0x19')]||null:null})[_0xdb25('0x1a')](function(_0x4ceeec){logger[_0xdb25('0xa')](_0xdb25('0x1b'),_0x2bec8f);logger['debug'](_0xdb25('0x1b'),_0x2bec8f,JSON[_0xdb25('0xe')](_0x4ceeec));_0x1944a0(_0x4ceeec);})['catch'](function(_0x498a7b){logger['error'](_0xdb25('0x1b'),_0x498a7b[_0xdb25('0x11')],_0x2bec8f);_0x96c72b(_0x210fe8[_0xdb25('0xf')](0x1f4,_0x498a7b['message']));});});};
\ No newline at end of file
index f82df3c..c73c7fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['create','put','update','delete','destroy','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x52e3c6,_0x1aede0){var _0x259d4e=function(_0x8bda47){while(--_0x8bda47){_0x52e3c6['push'](_0x52e3c6['shift']());}};_0x259d4e(++_0x1aede0);}(_0x55ca,0x126));var _0xa55c=function(_0x401b3e,_0xed8de5){_0x401b3e=_0x401b3e-0x0;var _0x4f290f=_0x55ca[_0x401b3e];return _0x4f290f;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xe')]);router[_0xa55c('0xf')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0xe0c3=['update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post'];(function(_0x33e7c3,_0x195049){var _0x1e19f6=function(_0x6cb1ee){while(--_0x6cb1ee){_0x33e7c3['push'](_0x33e7c3['shift']());}};_0x1e19f6(++_0x195049);}(_0xe0c3,0xea));var _0x3e0c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0c3[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x3e0c('0x0'));var util=require('util');var path=require(_0x3e0c('0x1'));var timeout=require(_0x3e0c('0x2'));var express=require(_0x3e0c('0x3'));var router=express[_0x3e0c('0x4')]();var fs_extra=require(_0x3e0c('0x5'));var auth=require(_0x3e0c('0x6'));var interaction=require(_0x3e0c('0x7'));var config=require(_0x3e0c('0x8'));var controller=require(_0x3e0c('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x3e0c('0xa')]);router[_0x3e0c('0xb')](_0x3e0c('0xc'),auth[_0x3e0c('0xd')](),controller[_0x3e0c('0xe')]);router[_0x3e0c('0xb')](_0x3e0c('0xf'),auth[_0x3e0c('0xd')](),controller[_0x3e0c('0x10')]);router[_0x3e0c('0x11')]('/',auth[_0x3e0c('0xd')](),controller['create']);router['put'](_0x3e0c('0xf'),auth[_0x3e0c('0xd')](),controller[_0x3e0c('0x12')]);router[_0x3e0c('0x13')](_0x3e0c('0xf'),auth[_0x3e0c('0xd')](),controller[_0x3e0c('0x14')]);module['exports']=router;
\ No newline at end of file
index c14b81c..0a36dfe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x13399d,_0x529b20){var _0x6f183=function(_0x280b79){while(--_0x280b79){_0x13399d['push'](_0x13399d['shift']());}};_0x6f183(++_0x529b20);}(_0xf4eb,0xec));var _0xbf4e=function(_0x4f0b9d,_0x11ffae){_0x4f0b9d=_0x4f0b9d-0x0;var _0x4327d1=_0xf4eb[_0x4f0b9d];return _0x4327d1;};'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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x5b9448,_0x5b9253){var _0x303709=function(_0x3e1407){while(--_0x3e1407){_0x5b9448['push'](_0x5b9448['shift']());}};_0x303709(++_0x5b9253);}(_0x70e0,0x17b));var _0x070e=function(_0x5df167,_0x478587){_0x5df167=_0x5df167-0x0;var _0x5a9c01=_0x70e0[_0x5df167];return _0x5a9c01;};'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 191ad53..2f9b77d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7cb8=['../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','sendStatus','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','SmsTransferReport','includeAll','include','rows','catch','show','params','find','create','body','destroy','describe','eml-format','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x7cb8,0x1a3));var _0x87cb=function(_0x32e5e5,_0x37c7ff){_0x32e5e5=_0x32e5e5-0x0;var _0x5cb8d3=_0x7cb8[_0x32e5e5];return _0x5cb8d3;};'use strict';var emlformat=require(_0x87cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x87cb('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x87cb('0x2'));var moment=require('moment');var BPromise=require(_0x87cb('0x3'));var Mustache=require(_0x87cb('0x4'));var util=require(_0x87cb('0x5'));var path=require('path');var sox=require(_0x87cb('0x6'));var csv=require(_0x87cb('0x7'));var ejs=require(_0x87cb('0x8'));var fs=require('fs');var fs_extra=require(_0x87cb('0x9'));var _=require(_0x87cb('0xa'));var squel=require('squel');var crypto=require(_0x87cb('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x87cb('0x7'));var querystring=require('querystring');var Papa=require(_0x87cb('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x87cb('0xd'));var as=require(_0x87cb('0xe'));var hardwareService=require(_0x87cb('0xf'));var logger=require(_0x87cb('0x10'))(_0x87cb('0x11'));var utils=require(_0x87cb('0x12'));var config=require(_0x87cb('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x87cb('0x14'))['db'];function respondWithStatusCode(_0x3751df,_0x237aa8){_0x237aa8=_0x237aa8||0xcc;return function(_0x33616c){if(_0x33616c){return _0x3751df['sendStatus'](_0x237aa8);}return _0x3751df['status'](_0x237aa8)[_0x87cb('0x15')]();};}function respondWithResult(_0x5bf995,_0x54d336){_0x54d336=_0x54d336||0xc8;return function(_0x5ac39d){if(_0x5ac39d){return _0x5bf995[_0x87cb('0x16')](_0x54d336)[_0x87cb('0x17')](_0x5ac39d);}};}function respondWithFilteredResult(_0xc0d7c2,_0x530415){return function(_0x5171c7){if(_0x5171c7){var _0x26991c=typeof _0x530415[_0x87cb('0x18')]===_0x87cb('0x19')&&typeof _0x530415[_0x87cb('0x1a')]===_0x87cb('0x19');var _0x208471=_0x5171c7[_0x87cb('0x1b')];var _0x1ac496=_0x26991c?0x0:_0x530415[_0x87cb('0x18')];var _0x3990a8=_0x26991c?_0x5171c7[_0x87cb('0x1b')]:_0x530415['offset']+_0x530415[_0x87cb('0x1a')];var _0x37a55d;if(_0x3990a8>=_0x208471){_0x3990a8=_0x208471;_0x37a55d=0xc8;}else{_0x37a55d=0xce;}_0xc0d7c2[_0x87cb('0x16')](_0x37a55d);return _0xc0d7c2[_0x87cb('0x1c')]('Content-Range',_0x1ac496+'-'+_0x3990a8+'/'+_0x208471)[_0x87cb('0x17')](_0x5171c7);}return null;};}function patchUpdates(_0x13e9e0){return function(_0x58721d){try{jsonpatch[_0x87cb('0x1d')](_0x58721d,_0x13e9e0,!![]);}catch(_0x5a9097){return BPromise[_0x87cb('0x1e')](_0x5a9097);}return _0x58721d[_0x87cb('0x1f')]();};}function saveUpdates(_0x2b6ffe,_0x4bb146){return function(_0x400720){if(_0x400720){return _0x400720[_0x87cb('0x20')](_0x2b6ffe)[_0x87cb('0x21')](function(_0x2eb347){return _0x2eb347;});}return null;};}function removeEntity(_0xe949c5,_0x5db335){return function(_0x4f5701){if(_0x4f5701){return _0x4f5701['destroy']()[_0x87cb('0x21')](function(){_0xe949c5[_0x87cb('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c83fb,_0x2249ad){return function(_0x666d53){if(!_0x666d53){_0x1c83fb[_0x87cb('0x22')](0x194);}return _0x666d53;};}function handleError(_0x597954,_0x1eb230){_0x1eb230=_0x1eb230||0x1f4;return function(_0x356b26){logger[_0x87cb('0x23')](_0x356b26[_0x87cb('0x24')]);if(_0x356b26[_0x87cb('0x25')]){delete _0x356b26[_0x87cb('0x25')];}_0x597954['status'](_0x1eb230)['send'](_0x356b26);};}exports[_0x87cb('0x26')]=function(_0x4aa417,_0x4b2e7e){var _0x142a81={},_0xc9d924={},_0x27424c={'count':0x0,'rows':[]};var _0x1b8ff4=_['map'](db['SmsTransferReport'][_0x87cb('0x27')],function(_0x10fdaa){return{'name':_0x10fdaa[_0x87cb('0x28')],'type':_0x10fdaa[_0x87cb('0x29')][_0x87cb('0x2a')]};});_0xc9d924[_0x87cb('0x2b')]=_[_0x87cb('0x2c')](_0x1b8ff4,_0x87cb('0x25'));_0xc9d924[_0x87cb('0x2d')]=_[_0x87cb('0x2e')](_0x4aa417[_0x87cb('0x2d')]);_0xc9d924['filters']=_[_0x87cb('0x2f')](_0xc9d924[_0x87cb('0x2b')],_0xc9d924['query']);_0x142a81['attributes']=_[_0x87cb('0x2f')](_0xc9d924[_0x87cb('0x2b')],qs[_0x87cb('0x30')](_0x4aa417[_0x87cb('0x2d')][_0x87cb('0x30')]));_0x142a81[_0x87cb('0x31')]=_0x142a81[_0x87cb('0x31')][_0x87cb('0x32')]?_0x142a81[_0x87cb('0x31')]:_0xc9d924[_0x87cb('0x2b')];if(!_0x4aa417['query']['hasOwnProperty'](_0x87cb('0x33'))){_0x142a81[_0x87cb('0x1a')]=qs['limit'](_0x4aa417[_0x87cb('0x2d')][_0x87cb('0x1a')]);_0x142a81[_0x87cb('0x18')]=qs['offset'](_0x4aa417['query'][_0x87cb('0x18')]);}_0x142a81[_0x87cb('0x34')]=qs[_0x87cb('0x35')](_0x4aa417[_0x87cb('0x2d')][_0x87cb('0x35')]);_0x142a81[_0x87cb('0x36')]=qs[_0x87cb('0x37')](_[_0x87cb('0x38')](_0x4aa417[_0x87cb('0x2d')],_0xc9d924[_0x87cb('0x37')]),_0x1b8ff4);if(_0x4aa417[_0x87cb('0x2d')][_0x87cb('0x39')]){_0x142a81[_0x87cb('0x36')]=_[_0x87cb('0x3a')](_0x142a81[_0x87cb('0x36')],{'$or':_['map'](_0x1b8ff4,function(_0x24a598){if(_0x24a598[_0x87cb('0x29')]!==_0x87cb('0x3b')){var _0x2ccf05={};_0x2ccf05[_0x24a598[_0x87cb('0x25')]]={'$like':'%'+_0x4aa417[_0x87cb('0x2d')][_0x87cb('0x39')]+'%'};return _0x2ccf05;}})});}_0x142a81=_[_0x87cb('0x3a')]({},_0x142a81,_0x4aa417[_0x87cb('0x3c')]);var _0x3fc0fd={'where':_0x142a81[_0x87cb('0x36')]};return db[_0x87cb('0x3d')]['count'](_0x3fc0fd)[_0x87cb('0x21')](function(_0x148d4e){_0x27424c['count']=_0x148d4e;if(_0x4aa417[_0x87cb('0x2d')][_0x87cb('0x3e')]){_0x142a81[_0x87cb('0x3f')]=[{'all':!![]}];}return db[_0x87cb('0x3d')]['findAll'](_0x142a81);})['then'](function(_0x85178f){_0x27424c[_0x87cb('0x40')]=_0x85178f;return _0x27424c;})[_0x87cb('0x21')](respondWithFilteredResult(_0x4b2e7e,_0x142a81))[_0x87cb('0x41')](handleError(_0x4b2e7e,null));};exports[_0x87cb('0x42')]=function(_0x2dcab2,_0x1959c8){var _0x4cafea={'raw':!![],'where':{'id':_0x2dcab2[_0x87cb('0x43')]['id']}},_0x5100b7={};_0x5100b7[_0x87cb('0x2b')]=_[_0x87cb('0x2e')](db['SmsTransferReport'][_0x87cb('0x27')]);_0x5100b7[_0x87cb('0x2d')]=_[_0x87cb('0x2e')](_0x2dcab2[_0x87cb('0x2d')]);_0x5100b7[_0x87cb('0x37')]=_[_0x87cb('0x2f')](_0x5100b7[_0x87cb('0x2b')],_0x5100b7[_0x87cb('0x2d')]);_0x4cafea[_0x87cb('0x31')]=_[_0x87cb('0x2f')](_0x5100b7[_0x87cb('0x2b')],qs[_0x87cb('0x30')](_0x2dcab2['query'][_0x87cb('0x30')]));_0x4cafea[_0x87cb('0x31')]=_0x4cafea[_0x87cb('0x31')][_0x87cb('0x32')]?_0x4cafea[_0x87cb('0x31')]:_0x5100b7[_0x87cb('0x2b')];if(_0x2dcab2[_0x87cb('0x2d')][_0x87cb('0x3e')]){_0x4cafea[_0x87cb('0x3f')]=[{'all':!![]}];}_0x4cafea=_[_0x87cb('0x3a')]({},_0x4cafea,_0x2dcab2[_0x87cb('0x3c')]);return db[_0x87cb('0x3d')][_0x87cb('0x44')](_0x4cafea)[_0x87cb('0x21')](handleEntityNotFound(_0x1959c8,null))[_0x87cb('0x21')](respondWithResult(_0x1959c8,null))['catch'](handleError(_0x1959c8,null));};exports[_0x87cb('0x45')]=function(_0x507174,_0x27da40){return db[_0x87cb('0x3d')][_0x87cb('0x45')](_0x507174[_0x87cb('0x46')],{})['then'](respondWithResult(_0x27da40,0xc9))[_0x87cb('0x41')](handleError(_0x27da40,null));};exports['update']=function(_0x482857,_0x4c2e3e){if(_0x482857[_0x87cb('0x46')]['id']){delete _0x482857[_0x87cb('0x46')]['id'];}return db[_0x87cb('0x3d')]['find']({'where':{'id':_0x482857['params']['id']}})[_0x87cb('0x21')](handleEntityNotFound(_0x4c2e3e,null))[_0x87cb('0x21')](saveUpdates(_0x482857['body'],null))[_0x87cb('0x21')](respondWithResult(_0x4c2e3e,null))[_0x87cb('0x41')](handleError(_0x4c2e3e,null));};exports[_0x87cb('0x47')]=function(_0xdb2b50,_0x1ca058){return db['SmsTransferReport'][_0x87cb('0x44')]({'where':{'id':_0xdb2b50[_0x87cb('0x43')]['id']}})[_0x87cb('0x21')](handleEntityNotFound(_0x1ca058,null))[_0x87cb('0x21')](removeEntity(_0x1ca058,null))[_0x87cb('0x41')](handleError(_0x1ca058,null));};exports[_0x87cb('0x48')]=function(_0x1bf159,_0x20ba32){return db['SmsTransferReport']['describe']()[_0x87cb('0x21')](respondWithResult(_0x20ba32,null))[_0x87cb('0x41')](handleError(_0x20ba32,null));};
\ No newline at end of file
+var _0x2635=['keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','body','destroy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','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/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','end','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','query'];(function(_0x30a34b,_0x5140b9){var _0x29fc8c=function(_0x49d435){while(--_0x49d435){_0x30a34b['push'](_0x30a34b['shift']());}};_0x29fc8c(++_0x5140b9);}(_0x2635,0x175));var _0x5263=function(_0x5b9bfb,_0x537cac){_0x5b9bfb=_0x5b9bfb-0x0;var _0xad636b=_0x2635[_0x5b9bfb];return _0xad636b;};'use strict';var emlformat=require(_0x5263('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5263('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5263('0x2'));var moment=require(_0x5263('0x3'));var BPromise=require(_0x5263('0x4'));var Mustache=require(_0x5263('0x5'));var util=require('util');var path=require(_0x5263('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5263('0x7'));var fs=require('fs');var fs_extra=require(_0x5263('0x8'));var _=require(_0x5263('0x9'));var squel=require(_0x5263('0xa'));var crypto=require(_0x5263('0xb'));var jsforce=require(_0x5263('0xc'));var deskjs=require(_0x5263('0xd'));var toCsv=require(_0x5263('0xe'));var querystring=require(_0x5263('0xf'));var Papa=require(_0x5263('0x10'));var Redis=require(_0x5263('0x11'));var authService=require(_0x5263('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5263('0x13'));var logger=require(_0x5263('0x14'))(_0x5263('0x15'));var utils=require(_0x5263('0x16'));var config=require(_0x5263('0x17'));var licenseUtil=require(_0x5263('0x18'));var db=require(_0x5263('0x19'))['db'];function respondWithStatusCode(_0x2a67c7,_0x5e1089){_0x5e1089=_0x5e1089||0xcc;return function(_0x22f19a){if(_0x22f19a){return _0x2a67c7['sendStatus'](_0x5e1089);}return _0x2a67c7[_0x5263('0x1a')](_0x5e1089)['end']();};}function respondWithResult(_0x243e4b,_0x47e2d8){_0x47e2d8=_0x47e2d8||0xc8;return function(_0x1d0733){if(_0x1d0733){return _0x243e4b['status'](_0x47e2d8)[_0x5263('0x1b')](_0x1d0733);}};}function respondWithFilteredResult(_0x3b75b0,_0x5afefe){return function(_0x23de24){if(_0x23de24){var _0x5cc00c=typeof _0x5afefe[_0x5263('0x1c')]===_0x5263('0x1d')&&typeof _0x5afefe[_0x5263('0x1e')]===_0x5263('0x1d');var _0x5f1d36=_0x23de24['count'];var _0x4663d0=_0x5cc00c?0x0:_0x5afefe['offset'];var _0x3219f3=_0x5cc00c?_0x23de24[_0x5263('0x1f')]:_0x5afefe[_0x5263('0x1c')]+_0x5afefe[_0x5263('0x1e')];var _0x2168f3;if(_0x3219f3>=_0x5f1d36){_0x3219f3=_0x5f1d36;_0x2168f3=0xc8;}else{_0x2168f3=0xce;}_0x3b75b0[_0x5263('0x1a')](_0x2168f3);return _0x3b75b0[_0x5263('0x20')](_0x5263('0x21'),_0x4663d0+'-'+_0x3219f3+'/'+_0x5f1d36)[_0x5263('0x1b')](_0x23de24);}return null;};}function patchUpdates(_0x2445a6){return function(_0x42197c){try{jsonpatch['apply'](_0x42197c,_0x2445a6,!![]);}catch(_0x468657){return BPromise['reject'](_0x468657);}return _0x42197c[_0x5263('0x22')]();};}function saveUpdates(_0x218a84,_0x34ae61){return function(_0x225828){if(_0x225828){return _0x225828[_0x5263('0x23')](_0x218a84)['then'](function(_0x2bacea){return _0x2bacea;});}return null;};}function removeEntity(_0x14d08f,_0x131970){return function(_0x70b8b5){if(_0x70b8b5){return _0x70b8b5['destroy']()[_0x5263('0x24')](function(){_0x14d08f['status'](0xcc)[_0x5263('0x25')]();});}};}function handleEntityNotFound(_0x1daa1e,_0x240c51){return function(_0x2a3c31){if(!_0x2a3c31){_0x1daa1e['sendStatus'](0x194);}return _0x2a3c31;};}function handleError(_0xcbbbba,_0x2a1dc6){_0x2a1dc6=_0x2a1dc6||0x1f4;return function(_0x3731e9){logger['error'](_0x3731e9[_0x5263('0x26')]);if(_0x3731e9[_0x5263('0x27')]){delete _0x3731e9[_0x5263('0x27')];}_0xcbbbba[_0x5263('0x1a')](_0x2a1dc6)[_0x5263('0x28')](_0x3731e9);};}exports[_0x5263('0x29')]=function(_0x524ffe,_0xe64d5b){var _0x5b840f={},_0x57b20d={},_0x2dc7b1={'count':0x0,'rows':[]};var _0x54a939=_[_0x5263('0x2a')](db[_0x5263('0x2b')][_0x5263('0x2c')],function(_0x57b55e){return{'name':_0x57b55e[_0x5263('0x2d')],'type':_0x57b55e['type']['key']};});_0x57b20d['model']=_['map'](_0x54a939,_0x5263('0x27'));_0x57b20d[_0x5263('0x2e')]=_[_0x5263('0x2f')](_0x524ffe[_0x5263('0x2e')]);_0x57b20d[_0x5263('0x30')]=_[_0x5263('0x31')](_0x57b20d['model'],_0x57b20d[_0x5263('0x2e')]);_0x5b840f['attributes']=_[_0x5263('0x31')](_0x57b20d[_0x5263('0x32')],qs[_0x5263('0x33')](_0x524ffe[_0x5263('0x2e')][_0x5263('0x33')]));_0x5b840f[_0x5263('0x34')]=_0x5b840f[_0x5263('0x34')][_0x5263('0x35')]?_0x5b840f[_0x5263('0x34')]:_0x57b20d['model'];if(!_0x524ffe['query'][_0x5263('0x36')]('nolimit')){_0x5b840f[_0x5263('0x1e')]=qs[_0x5263('0x1e')](_0x524ffe[_0x5263('0x2e')][_0x5263('0x1e')]);_0x5b840f['offset']=qs[_0x5263('0x1c')](_0x524ffe['query'][_0x5263('0x1c')]);}_0x5b840f[_0x5263('0x37')]=qs['sort'](_0x524ffe[_0x5263('0x2e')]['sort']);_0x5b840f[_0x5263('0x38')]=qs['filters'](_['pick'](_0x524ffe[_0x5263('0x2e')],_0x57b20d[_0x5263('0x30')]),_0x54a939);if(_0x524ffe[_0x5263('0x2e')][_0x5263('0x39')]){_0x5b840f[_0x5263('0x38')]=_['merge'](_0x5b840f[_0x5263('0x38')],{'$or':_[_0x5263('0x2a')](_0x54a939,function(_0x598d45){if(_0x598d45['type']!==_0x5263('0x3a')){var _0x54ac37={};_0x54ac37[_0x598d45['name']]={'$like':'%'+_0x524ffe[_0x5263('0x2e')][_0x5263('0x39')]+'%'};return _0x54ac37;}})});}_0x5b840f=_[_0x5263('0x3b')]({},_0x5b840f,_0x524ffe[_0x5263('0x3c')]);var _0x1d0cc7={'where':_0x5b840f[_0x5263('0x38')]};return db[_0x5263('0x2b')]['count'](_0x1d0cc7)['then'](function(_0x3e4821){_0x2dc7b1[_0x5263('0x1f')]=_0x3e4821;if(_0x524ffe[_0x5263('0x2e')][_0x5263('0x3d')]){_0x5b840f[_0x5263('0x3e')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x5263('0x3f')](_0x5b840f);})['then'](function(_0x1047cd){_0x2dc7b1['rows']=_0x1047cd;return _0x2dc7b1;})[_0x5263('0x24')](respondWithFilteredResult(_0xe64d5b,_0x5b840f))[_0x5263('0x40')](handleError(_0xe64d5b,null));};exports[_0x5263('0x41')]=function(_0xe3e6b3,_0x4dced9){var _0x1fb0f6={'raw':!![],'where':{'id':_0xe3e6b3[_0x5263('0x42')]['id']}},_0x3fa676={};_0x3fa676[_0x5263('0x32')]=_[_0x5263('0x2f')](db[_0x5263('0x2b')][_0x5263('0x2c')]);_0x3fa676[_0x5263('0x2e')]=_[_0x5263('0x2f')](_0xe3e6b3[_0x5263('0x2e')]);_0x3fa676[_0x5263('0x30')]=_[_0x5263('0x31')](_0x3fa676[_0x5263('0x32')],_0x3fa676['query']);_0x1fb0f6['attributes']=_[_0x5263('0x31')](_0x3fa676['model'],qs[_0x5263('0x33')](_0xe3e6b3[_0x5263('0x2e')]['fields']));_0x1fb0f6[_0x5263('0x34')]=_0x1fb0f6['attributes'][_0x5263('0x35')]?_0x1fb0f6[_0x5263('0x34')]:_0x3fa676[_0x5263('0x32')];if(_0xe3e6b3['query'][_0x5263('0x3d')]){_0x1fb0f6[_0x5263('0x3e')]=[{'all':!![]}];}_0x1fb0f6=_['merge']({},_0x1fb0f6,_0xe3e6b3[_0x5263('0x3c')]);return db['SmsTransferReport'][_0x5263('0x43')](_0x1fb0f6)[_0x5263('0x24')](handleEntityNotFound(_0x4dced9,null))['then'](respondWithResult(_0x4dced9,null))[_0x5263('0x40')](handleError(_0x4dced9,null));};exports['create']=function(_0x19f26a,_0x2eb0a6){return db[_0x5263('0x2b')]['create'](_0x19f26a[_0x5263('0x44')],{})[_0x5263('0x24')](respondWithResult(_0x2eb0a6,0xc9))['catch'](handleError(_0x2eb0a6,null));};exports[_0x5263('0x23')]=function(_0x5b415c,_0x1d3708){if(_0x5b415c[_0x5263('0x44')]['id']){delete _0x5b415c[_0x5263('0x44')]['id'];}return db['SmsTransferReport']['find']({'where':{'id':_0x5b415c[_0x5263('0x42')]['id']}})[_0x5263('0x24')](handleEntityNotFound(_0x1d3708,null))[_0x5263('0x24')](saveUpdates(_0x5b415c[_0x5263('0x44')],null))['then'](respondWithResult(_0x1d3708,null))[_0x5263('0x40')](handleError(_0x1d3708,null));};exports[_0x5263('0x45')]=function(_0x323e38,_0x4995ab){return db[_0x5263('0x2b')]['find']({'where':{'id':_0x323e38['params']['id']}})[_0x5263('0x24')](handleEntityNotFound(_0x4995ab,null))[_0x5263('0x24')](removeEntity(_0x4995ab,null))[_0x5263('0x40')](handleError(_0x4995ab,null));};exports['describe']=function(_0x5c6795,_0x3f42b6){return db[_0x5263('0x2b')]['describe']()[_0x5263('0x24')](respondWithResult(_0x3f42b6,null))[_0x5263('0x40')](handleError(_0x3f42b6,null));};
\ No newline at end of file
index 020c1ff..90d1270 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64e1=['lodash','util','../../config/logger','api','rimraf','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0x2f62aa,_0x108e95){var _0x1a341f=function(_0x3aedcf){while(--_0x3aedcf){_0x2f62aa['push'](_0x2f62aa['shift']());}};_0x1a341f(++_0x108e95);}(_0x64e1,0x9a));var _0x164e=function(_0x4c21c3,_0x169be1){_0x4c21c3=_0x4c21c3-0x0;var _0x486acd=_0x64e1[_0x4c21c3];return _0x486acd;};'use strict';var _=require(_0x164e('0x0'));var util=require(_0x164e('0x1'));var logger=require(_0x164e('0x2'))(_0x164e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x164e('0x4'));var config=require('../../config/environment');var attributes=require(_0x164e('0x5'));module[_0x164e('0x6')]=function(_0x2a6d51,_0x3505b2){return _0x2a6d51[_0x164e('0x7')](_0x164e('0x8'),attributes,{'tableName':_0x164e('0x9'),'paranoid':![],'indexes':[{'name':_0x164e('0xa'),'fields':[_0x164e('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6dd6=['bluebird','request-promise','path','rimraf','../../config/environment','exports','SmsTransferReport','report_sms_transfer','uniqueid','util','../../config/logger','api','moment'];(function(_0x49e533,_0x5daa8a){var _0x17769d=function(_0x22c440){while(--_0x22c440){_0x49e533['push'](_0x49e533['shift']());}};_0x17769d(++_0x5daa8a);}(_0x6dd6,0xcc));var _0x66dd=function(_0xea343d,_0x311197){_0xea343d=_0xea343d-0x0;var _0x2c6e9c=_0x6dd6[_0xea343d];return _0x2c6e9c;};'use strict';var _=require('lodash');var util=require(_0x66dd('0x0'));var logger=require(_0x66dd('0x1'))(_0x66dd('0x2'));var moment=require(_0x66dd('0x3'));var BPromise=require(_0x66dd('0x4'));var rp=require(_0x66dd('0x5'));var fs=require('fs');var path=require(_0x66dd('0x6'));var rimraf=require(_0x66dd('0x7'));var config=require(_0x66dd('0x8'));var attributes=require('./smsTransferReport.attributes');module[_0x66dd('0x9')]=function(_0x52de86,_0x2c45c7){return _0x52de86['define'](_0x66dd('0xa'),attributes,{'tableName':_0x66dd('0xb'),'paranoid':![],'indexes':[{'name':_0x66dd('0xc'),'fields':[_0x66dd('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index d56d525..0744e25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50d0=['code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x22a6a8,_0x2d2703){var _0x5286ae=function(_0x4aaeac){while(--_0x4aaeac){_0x22a6a8['push'](_0x22a6a8['shift']());}};_0x5286ae(++_0x2d2703);}(_0x50d0,0x101));var _0x050d=function(_0x174826,_0x2c53f2){_0x174826=_0x174826-0x0;var _0x522b3c=_0x50d0[_0x174826];return _0x522b3c;};'use strict';var _=require(_0x050d('0x0'));var util=require('util');var moment=require(_0x050d('0x1'));var BPromise=require(_0x050d('0x2'));var rs=require(_0x050d('0x3'));var fs=require('fs');var Redis=require(_0x050d('0x4'));var db=require(_0x050d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x050d('0x6'))(_0x050d('0x7'));var config=require(_0x050d('0x8'));var jayson=require(_0x050d('0x9'));var client=jayson[_0x050d('0xa')][_0x050d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x348909,_0x5535d6,_0x2b2faa){return new BPromise(function(_0x516f5d,_0x1d3dd6){return client[_0x050d('0xc')](_0x348909,_0x2b2faa)[_0x050d('0xd')](function(_0x4f2e84){logger[_0x050d('0xe')](_0x050d('0xf'),_0x5535d6,_0x050d('0x10'));logger['debug']('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x5535d6,_0x050d('0x10'),JSON[_0x050d('0x11')](_0x4f2e84));if(_0x4f2e84[_0x050d('0x12')]){if(_0x4f2e84[_0x050d('0x12')][_0x050d('0x13')]===0x1f4){logger[_0x050d('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x5535d6,_0x4f2e84['error'][_0x050d('0x14')]);return _0x1d3dd6(_0x4f2e84[_0x050d('0x12')][_0x050d('0x14')]);}logger[_0x050d('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x5535d6,_0x4f2e84['error']['message']);return _0x516f5d(_0x4f2e84['error']['message']);}else{logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x5535d6,'request\x20sent');_0x516f5d(_0x4f2e84[_0x050d('0x15')][_0x050d('0x14')]);}})[_0x050d('0x16')](function(_0x2001c6){logger[_0x050d('0x12')](_0x050d('0xf'),_0x5535d6,_0x2001c6);_0x1d3dd6(_0x2001c6);});});}
\ No newline at end of file
+var _0x0cd6=['../../config/utils','../../config/environment','jayson/promise','client','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0x4252fb,_0x2875b6){var _0x40b2ae=function(_0xf9ca79){while(--_0xf9ca79){_0x4252fb['push'](_0x4252fb['shift']());}};_0x40b2ae(++_0x2875b6);}(_0x0cd6,0x113));var _0x60cd=function(_0x19ac6e,_0x435862){_0x19ac6e=_0x19ac6e-0x0;var _0x1cdcf3=_0x0cd6[_0x19ac6e];return _0x1cdcf3;};'use strict';var _=require(_0x60cd('0x0'));var util=require(_0x60cd('0x1'));var moment=require('moment');var BPromise=require(_0x60cd('0x2'));var rs=require(_0x60cd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x60cd('0x4'))['db'];var utils=require(_0x60cd('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x60cd('0x6'));var jayson=require(_0x60cd('0x7'));var client=jayson[_0x60cd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x381044,_0x4b66cd,_0x1249cb){return new BPromise(function(_0x2c973,_0x160a7f){return client[_0x60cd('0x9')](_0x381044,_0x1249cb)[_0x60cd('0xa')](function(_0x3f2991){logger[_0x60cd('0xb')](_0x60cd('0xc'),_0x4b66cd,_0x60cd('0xd'));logger['debug'](_0x60cd('0xe'),_0x4b66cd,_0x60cd('0xd'),JSON['stringify'](_0x3f2991));if(_0x3f2991[_0x60cd('0xf')]){if(_0x3f2991['error'][_0x60cd('0x10')]===0x1f4){logger[_0x60cd('0xf')]('SmsTransferReport,\x20%s,\x20%s',_0x4b66cd,_0x3f2991[_0x60cd('0xf')][_0x60cd('0x11')]);return _0x160a7f(_0x3f2991[_0x60cd('0xf')]['message']);}logger[_0x60cd('0xf')](_0x60cd('0xc'),_0x4b66cd,_0x3f2991['error'][_0x60cd('0x11')]);return _0x2c973(_0x3f2991['error'][_0x60cd('0x11')]);}else{logger[_0x60cd('0xb')]('SmsTransferReport,\x20%s,\x20%s',_0x4b66cd,'request\x20sent');_0x2c973(_0x3f2991[_0x60cd('0x12')][_0x60cd('0x11')]);}})[_0x60cd('0x13')](function(_0x5d0125){logger[_0x60cd('0xf')](_0x60cd('0xc'),_0x4b66cd,_0x5d0125);_0x160a7f(_0x5d0125);});});}
\ No newline at end of file
index fbd8153..2665573 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x481f=['extname','now','post','single','file','put','/:id','update','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','./sound.controller','get','isAuthenticated','show','/:id/download','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename'];(function(_0x5d1d2d,_0x12dc3d){var _0x5e4cd1=function(_0x163219){while(--_0x163219){_0x5d1d2d['push'](_0x5d1d2d['shift']());}};_0x5e4cd1(++_0x12dc3d);}(_0x481f,0x9a));var _0xf481=function(_0x360ce6,_0x26ac83){_0x360ce6=_0x360ce6-0x0;var _0x4ad3fa=_0x481f[_0x360ce6];return _0x4ad3fa;};'use strict';var multer=require(_0xf481('0x0'));var util=require(_0xf481('0x1'));var path=require(_0xf481('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf481('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf481('0x4'));var interaction=require(_0xf481('0x5'));var config=require('../../config/environment');var controller=require(_0xf481('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xf481('0x7')]('/:id',auth[_0xf481('0x8')](),controller[_0xf481('0x9')]);router[_0xf481('0x7')](_0xf481('0xa'),auth[_0xf481('0x8')](),controller[_0xf481('0xb')]);var upload=multer({'storage':multer[_0xf481('0xc')]({'destination':function(_0x31f303,_0x2e461d,_0x283b48){_0x283b48(null,path[_0xf481('0xd')](config[_0xf481('0xe')],'server/files/sounds/original/'));},'filename':function(_0xcd7b56,_0x4df29a,_0x2079f8){_0x4df29a[_0xf481('0xf')]=_0x4df29a[_0xf481('0xf')][_0xf481('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2079f8(null,util[_0xf481('0x11')](_0xf481('0x12'),path[_0xf481('0x13')](_0x4df29a[_0xf481('0xf')],path[_0xf481('0x14')](_0x4df29a[_0xf481('0xf')])),Date[_0xf481('0x15')](),path[_0xf481('0x14')](_0x4df29a[_0xf481('0xf')])));}})});router[_0xf481('0x16')]('/',upload[_0xf481('0x17')](_0xf481('0x18')),controller['create']);router[_0xf481('0x19')](_0xf481('0x1a'),auth['isAuthenticated'](),controller[_0xf481('0x1b')]);router['delete'](_0xf481('0x1a'),auth['isAuthenticated'](),controller['delete']);module[_0xf481('0x1c')]=router;
\ No newline at end of file
+var _0xe1d3=['index','get','/:id','isAuthenticated','show','download','diskStorage','root','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./sound.controller'];(function(_0x188a93,_0xaf57db){var _0x23b40d=function(_0x599f63){while(--_0x599f63){_0x188a93['push'](_0x188a93['shift']());}};_0x23b40d(++_0xaf57db);}(_0xe1d3,0x160));var _0x3e1d=function(_0x534ce8,_0x17b58){_0x534ce8=_0x534ce8-0x0;var _0x3d9422=_0xe1d3[_0x534ce8];return _0x3d9422;};'use strict';var multer=require(_0x3e1d('0x0'));var util=require(_0x3e1d('0x1'));var path=require(_0x3e1d('0x2'));var timeout=require(_0x3e1d('0x3'));var express=require(_0x3e1d('0x4'));var router=express['Router']();var fs_extra=require(_0x3e1d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3e1d('0x6'));var config=require('../../config/environment');var controller=require(_0x3e1d('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x3e1d('0x8')]);router[_0x3e1d('0x9')](_0x3e1d('0xa'),auth[_0x3e1d('0xb')](),controller[_0x3e1d('0xc')]);router[_0x3e1d('0x9')]('/:id/download',auth[_0x3e1d('0xb')](),controller[_0x3e1d('0xd')]);var upload=multer({'storage':multer[_0x3e1d('0xe')]({'destination':function(_0x10e12f,_0x51d248,_0x5ad79c){_0x5ad79c(null,path['join'](config[_0x3e1d('0xf')],'server/files/sounds/original/'));},'filename':function(_0x2778b6,_0x3fcde3,_0x599117){_0x3fcde3[_0x3e1d('0x10')]=_0x3fcde3[_0x3e1d('0x10')][_0x3e1d('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x599117(null,util[_0x3e1d('0x12')](_0x3e1d('0x13'),path[_0x3e1d('0x14')](_0x3fcde3['originalname'],path[_0x3e1d('0x15')](_0x3fcde3[_0x3e1d('0x10')])),Date[_0x3e1d('0x16')](),path[_0x3e1d('0x15')](_0x3fcde3[_0x3e1d('0x10')])));}})});router[_0x3e1d('0x17')]('/',upload[_0x3e1d('0x18')](_0x3e1d('0x19')),controller['create']);router[_0x3e1d('0x1a')](_0x3e1d('0xa'),auth['isAuthenticated'](),controller[_0x3e1d('0x1b')]);router[_0x3e1d('0x1c')](_0x3e1d('0xa'),auth[_0x3e1d('0xb')](),controller[_0x3e1d('0x1c')]);module[_0x3e1d('0x1d')]=router;
\ No newline at end of file
index 8c82a1a..86870a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8648=['STRING','FLOAT','INTEGER','BIGINT','sequelize'];(function(_0x2c3d86,_0x4371ed){var _0x39894b=function(_0x5d933b){while(--_0x5d933b){_0x2c3d86['push'](_0x2c3d86['shift']());}};_0x39894b(++_0x4371ed);}(_0x8648,0xae));var _0x8864=function(_0x1794f7,_0x20884b){_0x1794f7=_0x1794f7-0x0;var _0x14c54b=_0x8648[_0x1794f7];return _0x14c54b;};'use strict';var Sequelize=require(_0x8864('0x0'));module['exports']={'name':{'type':Sequelize[_0x8864('0x1')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x8864('0x1')]},'display_name':{'type':Sequelize[_0x8864('0x1')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x8864('0x2')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x8864('0x3')]},'original_bitRate':{'type':Sequelize[_0x8864('0x4')]},'original_sampleRate':{'type':Sequelize[_0x8864('0x3')]},'converted_format':{'type':Sequelize[_0x8864('0x1')]},'converted_duration':{'type':Sequelize[_0x8864('0x2')]},'converted_sampleCount':{'type':Sequelize[_0x8864('0x4')]},'converted_channelCount':{'type':Sequelize[_0x8864('0x3')]},'converted_bitRate':{'type':Sequelize[_0x8864('0x4')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xec2f=['sequelize','exports','STRING','FLOAT','BIGINT','INTEGER'];(function(_0x6c9b2c,_0x2e1e98){var _0x2dbb9c=function(_0x421b99){while(--_0x421b99){_0x6c9b2c['push'](_0x6c9b2c['shift']());}};_0x2dbb9c(++_0x2e1e98);}(_0xec2f,0xa8));var _0xfec2=function(_0x4f8e84,_0x36adc9){_0x4f8e84=_0x4f8e84-0x0;var _0x2ab68f=_0xec2f[_0x4f8e84];return _0x2ab68f;};'use strict';var Sequelize=require(_0xfec2('0x0'));module[_0xfec2('0x1')]={'name':{'type':Sequelize[_0xfec2('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xfec2('0x2')]},'display_name':{'type':Sequelize[_0xfec2('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0xfec2('0x3')]},'original_sampleCount':{'type':Sequelize[_0xfec2('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0xfec2('0x4')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0xfec2('0x2')]},'converted_duration':{'type':Sequelize[_0xfec2('0x3')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0xfec2('0x5')]},'converted_bitRate':{'type':Sequelize[_0xfec2('0x4')]},'converted_sampleRate':{'type':Sequelize[_0xfec2('0x5')]}};
\ No newline at end of file
index 3091f20..f7c38b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2301=['original_bitRate','bitRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','pick','description','delete','original_format','eml-format','zip-dir','fast-json-patch','moment','mustache','util','ejs','fs-extra','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','set','Content-Range','save','destroy','then','get','Sounds','status','error','send','index','Sound','type','key','name','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','catch','download','save_name','join','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','root','%s.%s','converted_format','format','file','extname','originalname','basename','filename','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','wav','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','channelCount'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x2301,0x95));var _0x1230=function(_0x4496c1,_0x103294){_0x4496c1=_0x4496c1-0x0;var _0xa2da11=_0x2301[_0x4496c1];return _0xa2da11;};'use strict';var emlformat=require(_0x1230('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1230('0x1'));var jsonpatch=require(_0x1230('0x2'));var rp=require('request-promise');var moment=require(_0x1230('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1230('0x4'));var util=require(_0x1230('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1230('0x6'));var fs=require('fs');var fs_extra=require(_0x1230('0x7'));var _=require('lodash');var squel=require(_0x1230('0x8'));var crypto=require(_0x1230('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1230('0xa'));var Redis=require(_0x1230('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x1230('0xc'));var as=require(_0x1230('0xd'));var hardwareService=require(_0x1230('0xe'));var logger=require(_0x1230('0xf'))(_0x1230('0x10'));var utils=require(_0x1230('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1230('0x12'))['db'];function respondWithStatusCode(_0x17c1b0,_0x1e0c45){_0x1e0c45=_0x1e0c45||0xcc;return function(_0x43ea78){if(_0x43ea78){return _0x17c1b0[_0x1230('0x13')](_0x1e0c45);}return _0x17c1b0['status'](_0x1e0c45)[_0x1230('0x14')]();};}function respondWithResult(_0x25decc,_0x4f21ba){_0x4f21ba=_0x4f21ba||0xc8;return function(_0x5961ab){if(_0x5961ab){return _0x25decc['status'](_0x4f21ba)[_0x1230('0x15')](_0x5961ab);}};}function respondWithFilteredResult(_0x30fe4e,_0x353cc1){return function(_0x4d0aa4){if(_0x4d0aa4){var _0x3d8dbf=typeof _0x353cc1[_0x1230('0x16')]==='undefined'&&typeof _0x353cc1[_0x1230('0x17')]===_0x1230('0x18');var _0x38b60e=_0x4d0aa4[_0x1230('0x19')];var _0x2f6815=_0x3d8dbf?0x0:_0x353cc1[_0x1230('0x16')];var _0x355ae1=_0x3d8dbf?_0x4d0aa4[_0x1230('0x19')]:_0x353cc1[_0x1230('0x16')]+_0x353cc1[_0x1230('0x17')];var _0x433db8;if(_0x355ae1>=_0x38b60e){_0x355ae1=_0x38b60e;_0x433db8=0xc8;}else{_0x433db8=0xce;}_0x30fe4e['status'](_0x433db8);return _0x30fe4e[_0x1230('0x1a')](_0x1230('0x1b'),_0x2f6815+'-'+_0x355ae1+'/'+_0x38b60e)[_0x1230('0x15')](_0x4d0aa4);}return null;};}function patchUpdates(_0x853398){return function(_0x53d84d){try{jsonpatch['apply'](_0x53d84d,_0x853398,!![]);}catch(_0x2a6cf0){return BPromise['reject'](_0x2a6cf0);}return _0x53d84d[_0x1230('0x1c')]();};}function saveUpdates(_0x29083a,_0x16364f){return function(_0x696147){if(_0x696147){return _0x696147['update'](_0x29083a)['then'](function(_0x7a7f7){return _0x7a7f7;});}return null;};}function removeEntity(_0x3149fb,_0x3e2978){return function(_0x5c11e7){if(_0x5c11e7){return _0x5c11e7[_0x1230('0x1d')]()[_0x1230('0x1e')](function(){var _0x49385f=_0x5c11e7[_0x1230('0x1f')]({'plain':!![]});var _0x258cfc=_0x1230('0x20');return db['UserProfileResource'][_0x1230('0x1d')]({'where':{'type':_0x258cfc,'resourceId':_0x49385f['id']}})[_0x1230('0x1e')](function(){return _0x5c11e7;});})[_0x1230('0x1e')](function(){_0x3149fb[_0x1230('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x572082,_0x3e81c5){return function(_0x26bb67){if(!_0x26bb67){_0x572082[_0x1230('0x13')](0x194);}return _0x26bb67;};}function handleError(_0x40c279,_0x4dea84){_0x4dea84=_0x4dea84||0x1f4;return function(_0x31f1ad){logger[_0x1230('0x22')](_0x31f1ad['stack']);if(_0x31f1ad['name']){delete _0x31f1ad['name'];}_0x40c279[_0x1230('0x21')](_0x4dea84)[_0x1230('0x23')](_0x31f1ad);};}exports[_0x1230('0x24')]=function(_0x5032f9,_0x347bbf){var _0x4f7a18={},_0xf560c2={},_0x5c9d1c={'count':0x0,'rows':[]};var _0x3aff35=_['map'](db[_0x1230('0x25')]['rawAttributes'],function(_0x3c0516){return{'name':_0x3c0516['fieldName'],'type':_0x3c0516[_0x1230('0x26')][_0x1230('0x27')]};});_0xf560c2['model']=_['map'](_0x3aff35,_0x1230('0x28'));_0xf560c2[_0x1230('0x29')]=_[_0x1230('0x2a')](_0x5032f9[_0x1230('0x29')]);_0xf560c2[_0x1230('0x2b')]=_[_0x1230('0x2c')](_0xf560c2['model'],_0xf560c2[_0x1230('0x29')]);_0x4f7a18[_0x1230('0x2d')]=_[_0x1230('0x2c')](_0xf560c2[_0x1230('0x2e')],qs[_0x1230('0x2f')](_0x5032f9[_0x1230('0x29')][_0x1230('0x2f')]));_0x4f7a18[_0x1230('0x2d')]=_0x4f7a18['attributes'][_0x1230('0x30')]?_0x4f7a18[_0x1230('0x2d')]:_0xf560c2[_0x1230('0x2e')];if(!_0x5032f9[_0x1230('0x29')][_0x1230('0x31')](_0x1230('0x32'))){_0x4f7a18[_0x1230('0x17')]=qs['limit'](_0x5032f9[_0x1230('0x29')][_0x1230('0x17')]);_0x4f7a18['offset']=qs[_0x1230('0x16')](_0x5032f9['query'][_0x1230('0x16')]);}_0x4f7a18[_0x1230('0x33')]=qs[_0x1230('0x34')](_0x5032f9[_0x1230('0x29')][_0x1230('0x34')]);_0x4f7a18[_0x1230('0x35')]=qs[_0x1230('0x2b')](_['pick'](_0x5032f9[_0x1230('0x29')],_0xf560c2[_0x1230('0x2b')]),_0x3aff35);if(_0x5032f9[_0x1230('0x29')][_0x1230('0x36')]){_0x4f7a18[_0x1230('0x35')]=_[_0x1230('0x37')](_0x4f7a18[_0x1230('0x35')],{'$or':_[_0x1230('0x38')](_0x3aff35,function(_0x5131ee){if(_0x5131ee[_0x1230('0x26')]!==_0x1230('0x39')){var _0x45a5bb={};_0x45a5bb[_0x5131ee['name']]={'$like':'%'+_0x5032f9[_0x1230('0x29')][_0x1230('0x36')]+'%'};return _0x45a5bb;}})});}_0x4f7a18=_['merge']({},_0x4f7a18,_0x5032f9['options']);var _0x2ad713={'where':_0x4f7a18[_0x1230('0x35')]};return db['Sound'][_0x1230('0x19')](_0x2ad713)[_0x1230('0x1e')](function(_0x44ef7d){_0x5c9d1c['count']=_0x44ef7d;if(_0x5032f9['query'][_0x1230('0x3a')]){_0x4f7a18[_0x1230('0x3b')]=[{'all':!![]}];}return db[_0x1230('0x25')][_0x1230('0x3c')](_0x4f7a18);})[_0x1230('0x1e')](function(_0x33849e){_0x5c9d1c[_0x1230('0x3d')]=_0x33849e;return _0x5c9d1c;})[_0x1230('0x1e')](respondWithFilteredResult(_0x347bbf,_0x4f7a18))['catch'](handleError(_0x347bbf,null));};exports[_0x1230('0x3e')]=function(_0x2148c8,_0x3c05d6){var _0x4fd35f={'raw':!![],'where':{'id':_0x2148c8[_0x1230('0x3f')]['id']}},_0x5ce894={};_0x5ce894[_0x1230('0x2e')]=_[_0x1230('0x2a')](db[_0x1230('0x25')][_0x1230('0x40')]);_0x5ce894[_0x1230('0x29')]=_[_0x1230('0x2a')](_0x2148c8['query']);_0x5ce894[_0x1230('0x2b')]=_[_0x1230('0x2c')](_0x5ce894[_0x1230('0x2e')],_0x5ce894['query']);_0x4fd35f[_0x1230('0x2d')]=_[_0x1230('0x2c')](_0x5ce894[_0x1230('0x2e')],qs[_0x1230('0x2f')](_0x2148c8['query'][_0x1230('0x2f')]));_0x4fd35f[_0x1230('0x2d')]=_0x4fd35f[_0x1230('0x2d')]['length']?_0x4fd35f[_0x1230('0x2d')]:_0x5ce894[_0x1230('0x2e')];if(_0x2148c8[_0x1230('0x29')]['includeAll']){_0x4fd35f[_0x1230('0x3b')]=[{'all':!![]}];}_0x4fd35f=_[_0x1230('0x37')]({},_0x4fd35f,_0x2148c8[_0x1230('0x41')]);return db[_0x1230('0x25')][_0x1230('0x42')](_0x4fd35f)[_0x1230('0x1e')](handleEntityNotFound(_0x3c05d6,null))[_0x1230('0x1e')](respondWithResult(_0x3c05d6,null))[_0x1230('0x43')](handleError(_0x3c05d6,null));};exports[_0x1230('0x44')]=function(_0x43cf76,_0x5f0566,_0x24196c){return db['Sound'][_0x1230('0x42')]({'where':{'id':_0x43cf76[_0x1230('0x3f')]['id']},'attributes':[_0x1230('0x28'),_0x1230('0x45'),'converted_format'],'raw':!![]})[_0x1230('0x1e')](handleEntityNotFound(_0x5f0566,null))[_0x1230('0x1e')](function(_0x430179){if(_0x430179){if(!fs['existsSync'](path[_0x1230('0x46')](config['root'],_0x1230('0x47'),_0x430179[_0x1230('0x45')]+'.'+_0x430179['converted_format']))){throw new db[(_0x1230('0x48'))][(_0x1230('0x49'))](_0x1230('0x4a'));}return _0x5f0566[_0x1230('0x44')](path[_0x1230('0x46')](config[_0x1230('0x4b')],_0x1230('0x47'),util['format'](_0x1230('0x4c'),_0x430179[_0x1230('0x45')],_0x430179[_0x1230('0x4d')])),util[_0x1230('0x4e')]('%s.%s',_0x430179[_0x1230('0x28')],_0x430179[_0x1230('0x4d')]));}return null;})[_0x1230('0x43')](handleError(_0x5f0566,null));};exports['create']=function(_0x4de29c,_0x485c75,_0x8d9510){var _0x23e751={'name':path['basename'](_0x4de29c[_0x1230('0x4f')]['originalname'],path[_0x1230('0x50')](_0x4de29c[_0x1230('0x4f')][_0x1230('0x51')])),'save_name':path[_0x1230('0x52')](_0x4de29c[_0x1230('0x4f')][_0x1230('0x53')],path[_0x1230('0x50')](_0x4de29c['file'][_0x1230('0x53')])),'original_format':path['extname'](_0x4de29c['file'][_0x1230('0x51')])['substring'](0x1),'converted_format':'wav'};var _0x17cbed=path['join'](config[_0x1230('0x4b')],_0x1230('0x54'),_0x4de29c[_0x1230('0x4f')][_0x1230('0x53')]);var _0x393df7=path[_0x1230('0x46')](config['root'],'server/files/sounds/converted',util[_0x1230('0x4e')]('%s.%s',path[_0x1230('0x52')](_0x4de29c[_0x1230('0x4f')][_0x1230('0x53')],path[_0x1230('0x50')](_0x4de29c[_0x1230('0x4f')][_0x1230('0x53')])),_0x23e751[_0x1230('0x4d')]));logger[_0x1230('0x55')](_0x1230('0x56'),_0x17cbed);logger['info'](_0x1230('0x57'),_0x393df7);try{fs[_0x1230('0x58')](_0x17cbed,parseInt(_0x1230('0x59'),0x8));var _0x163ce5=sox[_0x1230('0x5a')](_0x17cbed,_0x393df7,{'sampleRate':0x1f40,'format':_0x1230('0x5b'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x163ce5['on'](_0x1230('0x22'),function(_0x1b4570){fs[_0x1230('0x5c')](_0x17cbed);_0x485c75[_0x1230('0x21')](0x1f4)[_0x1230('0x23')](_0x1b4570);});_0x163ce5['on'](_0x1230('0x5d'),function(_0x4c5584){_0x23e751[_0x1230('0x5e')]=isNaN(_0x4c5584[_0x1230('0x5f')])?null:_0x4c5584[_0x1230('0x5f')]*0x3e8;_0x23e751[_0x1230('0x60')]=isNaN(_0x4c5584['sampleCount'])?null:_0x4c5584[_0x1230('0x61')];_0x23e751['original_channelCount']=isNaN(_0x4c5584[_0x1230('0x62')])?null:_0x4c5584[_0x1230('0x62')];_0x23e751[_0x1230('0x63')]=isNaN(_0x4c5584['bitRate'])?null:_0x4c5584[_0x1230('0x64')];_0x23e751['original_sampleRate']=isNaN(_0x4c5584[_0x1230('0x65')])?null:_0x4c5584[_0x1230('0x65')];});_0x163ce5['on'](_0x1230('0x66'),function(_0x1fb3df){_0x23e751[_0x1230('0x67')]=isNaN(_0x1fb3df[_0x1230('0x5f')])?null:_0x1fb3df['duration']*0x3e8;_0x23e751[_0x1230('0x68')]=isNaN(_0x1fb3df[_0x1230('0x61')])?null:_0x1fb3df['sampleCount'];_0x23e751[_0x1230('0x69')]=isNaN(_0x1fb3df[_0x1230('0x62')])?null:_0x1fb3df[_0x1230('0x62')];_0x23e751[_0x1230('0x6a')]=isNaN(_0x1fb3df[_0x1230('0x64')])?null:_0x1fb3df[_0x1230('0x64')];_0x23e751[_0x1230('0x6b')]=isNaN(_0x1fb3df[_0x1230('0x65')])?null:_0x1fb3df[_0x1230('0x65')];});_0x163ce5['on'](_0x1230('0x14'),function(){fs[_0x1230('0x58')](_0x393df7,parseInt(_0x1230('0x59'),0x8));return db['Sound'][_0x1230('0x6c')](_0x23e751)[_0x1230('0x1e')](function(_0x5298a1){var _0x5bca13={'role':_0x4de29c[_0x1230('0x6d')]['role'],'userProfileId':_0x4de29c[_0x1230('0x6d')][_0x1230('0x6e')]};if(!_0x5bca13)throw new Error(_0x1230('0x6f'));if(_0x5bca13[_0x1230('0x70')]===_0x1230('0x71')){var _0x474aa1=_0x5298a1[_0x1230('0x1f')]({'plain':!![]});return db[_0x1230('0x72')][_0x1230('0x42')]({'where':{'name':_0x1230('0x20'),'userProfileId':_0x5bca13[_0x1230('0x6e')]},'raw':!![]})[_0x1230('0x1e')](function(_0xde1069){if(_0xde1069&&_0xde1069[_0x1230('0x73')]===0x0){return db[_0x1230('0x74')][_0x1230('0x6c')]({'name':_0x474aa1['name'],'resourceId':_0x474aa1['id'],'type':_0xde1069[_0x1230('0x28')],'sectionId':_0xde1069['id']},{})[_0x1230('0x1e')](function(){return _0x5298a1;});}else{return _0x5298a1;}})['catch'](function(_0x243a8f){logger['error'](_0x1230('0x75'),_0x243a8f);throw _0x243a8f;});}return _0x5298a1;})[_0x1230('0x1e')](respondWithResult(_0x485c75,null))[_0x1230('0x43')](handleError(_0x485c75,null));});_0x163ce5[_0x1230('0x76')]();}catch(_0xe50ee9){_0x485c75[_0x1230('0x21')](0x1f4)['send'](_0xe50ee9);}};exports[_0x1230('0x77')]=function(_0x2843f0,_0x49ed84,_0x123cbe){return db[_0x1230('0x25')][_0x1230('0x42')]({'where':{'id':_0x2843f0[_0x1230('0x3f')]['id']}})['then'](handleEntityNotFound(_0x49ed84,null))['then'](saveUpdates(_[_0x1230('0x78')](_0x2843f0['body'],[_0x1230('0x28'),_0x1230('0x79')]),null))['then'](respondWithResult(_0x49ed84,null))[_0x1230('0x43')](handleError(_0x49ed84,null));};exports[_0x1230('0x7a')]=function(_0x1b264e,_0x3d297e,_0x49ceee){return db[_0x1230('0x25')]['find']({'where':{'id':_0x1b264e[_0x1230('0x3f')]['id']}})[_0x1230('0x1e')](function(_0x368ab1){if(_0x368ab1){return _0x368ab1[_0x1230('0x1d')]();}})[_0x1230('0x1e')](function(_0x2a9e03){var _0x1010cf=path[_0x1230('0x46')](config[_0x1230('0x4b')],_0x1230('0x54'),util[_0x1230('0x4e')](_0x1230('0x4c'),_0x2a9e03[_0x1230('0x45')],_0x2a9e03[_0x1230('0x7b')]));var _0x2b71c9=path[_0x1230('0x46')](config[_0x1230('0x4b')],'server/files/sounds/converted',util[_0x1230('0x4e')](_0x1230('0x4c'),_0x2a9e03['save_name'],_0x2a9e03[_0x1230('0x4d')]));fs['unlinkSync'](_0x1010cf);fs[_0x1230('0x5c')](_0x2b71c9);return _0x2a9e03;})[_0x1230('0x1e')](function(_0x44ef54){if(_0x44ef54){return _0x3d297e[_0x1230('0x21')](0xcc)[_0x1230('0x14')]();}})[_0x1230('0x1e')](handleEntityNotFound(_0x3d297e,null))[_0x1230('0x43')](handleError(_0x3d297e,null));};
\ No newline at end of file
+var _0x6770=['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/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','get','error','stack','name','send','index','map','Sound','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','download','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','%s.%s','format','catch','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','unlinkSync','original_duration','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_sampleRate','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Sounds','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','description','delete','eml-format','rimraf','zip-dir','request-promise'];(function(_0x10c16d,_0x2b3e14){var _0x5896f4=function(_0x4306b9){while(--_0x4306b9){_0x10c16d['push'](_0x10c16d['shift']());}};_0x5896f4(++_0x2b3e14);}(_0x6770,0x7d));var _0x0677=function(_0x12f91c,_0xda1390){_0x12f91c=_0x12f91c-0x0;var _0x4daf5e=_0x6770[_0x12f91c];return _0x4daf5e;};'use strict';var emlformat=require(_0x0677('0x0'));var rimraf=require(_0x0677('0x1'));var zipdir=require(_0x0677('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0677('0x3'));var moment=require(_0x0677('0x4'));var BPromise=require(_0x0677('0x5'));var Mustache=require(_0x0677('0x6'));var util=require(_0x0677('0x7'));var path=require(_0x0677('0x8'));var sox=require(_0x0677('0x9'));var csv=require(_0x0677('0xa'));var ejs=require(_0x0677('0xb'));var fs=require('fs');var fs_extra=require(_0x0677('0xc'));var _=require(_0x0677('0xd'));var squel=require(_0x0677('0xe'));var crypto=require(_0x0677('0xf'));var jsforce=require(_0x0677('0x10'));var deskjs=require(_0x0677('0x11'));var toCsv=require(_0x0677('0xa'));var querystring=require(_0x0677('0x12'));var Papa=require('papaparse');var Redis=require(_0x0677('0x13'));var authService=require(_0x0677('0x14'));var qs=require(_0x0677('0x15'));var as=require(_0x0677('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0677('0x17'))(_0x0677('0x18'));var utils=require(_0x0677('0x19'));var config=require(_0x0677('0x1a'));var licenseUtil=require(_0x0677('0x1b'));var db=require(_0x0677('0x1c'))['db'];function respondWithStatusCode(_0x557dc7,_0x5a21c9){_0x5a21c9=_0x5a21c9||0xcc;return function(_0x525a85){if(_0x525a85){return _0x557dc7[_0x0677('0x1d')](_0x5a21c9);}return _0x557dc7['status'](_0x5a21c9)[_0x0677('0x1e')]();};}function respondWithResult(_0x37cd5b,_0x364191){_0x364191=_0x364191||0xc8;return function(_0x101204){if(_0x101204){return _0x37cd5b[_0x0677('0x1f')](_0x364191)[_0x0677('0x20')](_0x101204);}};}function respondWithFilteredResult(_0x1d6cda,_0x2d4135){return function(_0x468591){if(_0x468591){var _0x152d78=typeof _0x2d4135[_0x0677('0x21')]===_0x0677('0x22')&&typeof _0x2d4135[_0x0677('0x23')]===_0x0677('0x22');var _0x516197=_0x468591[_0x0677('0x24')];var _0x488654=_0x152d78?0x0:_0x2d4135[_0x0677('0x21')];var _0x1a26f1=_0x152d78?_0x468591[_0x0677('0x24')]:_0x2d4135[_0x0677('0x21')]+_0x2d4135[_0x0677('0x23')];var _0x4d97b1;if(_0x1a26f1>=_0x516197){_0x1a26f1=_0x516197;_0x4d97b1=0xc8;}else{_0x4d97b1=0xce;}_0x1d6cda[_0x0677('0x1f')](_0x4d97b1);return _0x1d6cda['set'](_0x0677('0x25'),_0x488654+'-'+_0x1a26f1+'/'+_0x516197)[_0x0677('0x20')](_0x468591);}return null;};}function patchUpdates(_0x2e926e){return function(_0x15fea5){try{jsonpatch[_0x0677('0x26')](_0x15fea5,_0x2e926e,!![]);}catch(_0x58c961){return BPromise[_0x0677('0x27')](_0x58c961);}return _0x15fea5[_0x0677('0x28')]();};}function saveUpdates(_0x3d69be,_0x4a41d0){return function(_0x21c61e){if(_0x21c61e){return _0x21c61e['update'](_0x3d69be)['then'](function(_0x2daa63){return _0x2daa63;});}return null;};}function removeEntity(_0x1cf56d,_0x532f2e){return function(_0x342f24){if(_0x342f24){return _0x342f24[_0x0677('0x29')]()[_0x0677('0x2a')](function(){var _0xb1f39e=_0x342f24[_0x0677('0x2b')]({'plain':!![]});var _0x14518b='Sounds';return db['UserProfileResource'][_0x0677('0x29')]({'where':{'type':_0x14518b,'resourceId':_0xb1f39e['id']}})[_0x0677('0x2a')](function(){return _0x342f24;});})[_0x0677('0x2a')](function(){_0x1cf56d[_0x0677('0x1f')](0xcc)[_0x0677('0x1e')]();});}};}function handleEntityNotFound(_0xbb0eb0,_0x2fffab){return function(_0x1faeea){if(!_0x1faeea){_0xbb0eb0[_0x0677('0x1d')](0x194);}return _0x1faeea;};}function handleError(_0x193ee4,_0x263ebe){_0x263ebe=_0x263ebe||0x1f4;return function(_0x363f0d){logger[_0x0677('0x2c')](_0x363f0d[_0x0677('0x2d')]);if(_0x363f0d[_0x0677('0x2e')]){delete _0x363f0d[_0x0677('0x2e')];}_0x193ee4[_0x0677('0x1f')](_0x263ebe)[_0x0677('0x2f')](_0x363f0d);};}exports[_0x0677('0x30')]=function(_0xa7178f,_0x58edee){var _0x5aaa4c={},_0x45118a={},_0x537fc8={'count':0x0,'rows':[]};var _0x2e9631=_[_0x0677('0x31')](db[_0x0677('0x32')]['rawAttributes'],function(_0x205ef7){return{'name':_0x205ef7[_0x0677('0x33')],'type':_0x205ef7[_0x0677('0x34')][_0x0677('0x35')]};});_0x45118a[_0x0677('0x36')]=_['map'](_0x2e9631,_0x0677('0x2e'));_0x45118a[_0x0677('0x37')]=_[_0x0677('0x38')](_0xa7178f[_0x0677('0x37')]);_0x45118a[_0x0677('0x39')]=_['intersection'](_0x45118a[_0x0677('0x36')],_0x45118a['query']);_0x5aaa4c[_0x0677('0x3a')]=_[_0x0677('0x3b')](_0x45118a[_0x0677('0x36')],qs[_0x0677('0x3c')](_0xa7178f[_0x0677('0x37')][_0x0677('0x3c')]));_0x5aaa4c[_0x0677('0x3a')]=_0x5aaa4c[_0x0677('0x3a')][_0x0677('0x3d')]?_0x5aaa4c[_0x0677('0x3a')]:_0x45118a[_0x0677('0x36')];if(!_0xa7178f['query'][_0x0677('0x3e')]('nolimit')){_0x5aaa4c[_0x0677('0x23')]=qs[_0x0677('0x23')](_0xa7178f['query'][_0x0677('0x23')]);_0x5aaa4c[_0x0677('0x21')]=qs[_0x0677('0x21')](_0xa7178f[_0x0677('0x37')]['offset']);}_0x5aaa4c['order']=qs[_0x0677('0x3f')](_0xa7178f['query']['sort']);_0x5aaa4c[_0x0677('0x40')]=qs['filters'](_[_0x0677('0x41')](_0xa7178f[_0x0677('0x37')],_0x45118a['filters']),_0x2e9631);if(_0xa7178f[_0x0677('0x37')][_0x0677('0x42')]){_0x5aaa4c[_0x0677('0x40')]=_[_0x0677('0x43')](_0x5aaa4c['where'],{'$or':_[_0x0677('0x31')](_0x2e9631,function(_0x1764f7){if(_0x1764f7[_0x0677('0x34')]!==_0x0677('0x44')){var _0x4071be={};_0x4071be[_0x1764f7[_0x0677('0x2e')]]={'$like':'%'+_0xa7178f['query']['filter']+'%'};return _0x4071be;}})});}_0x5aaa4c=_['merge']({},_0x5aaa4c,_0xa7178f[_0x0677('0x45')]);var _0x15322d={'where':_0x5aaa4c['where']};return db[_0x0677('0x32')][_0x0677('0x24')](_0x15322d)[_0x0677('0x2a')](function(_0x492f8a){_0x537fc8[_0x0677('0x24')]=_0x492f8a;if(_0xa7178f[_0x0677('0x37')]['includeAll']){_0x5aaa4c[_0x0677('0x46')]=[{'all':!![]}];}return db['Sound'][_0x0677('0x47')](_0x5aaa4c);})['then'](function(_0x442311){_0x537fc8[_0x0677('0x48')]=_0x442311;return _0x537fc8;})[_0x0677('0x2a')](respondWithFilteredResult(_0x58edee,_0x5aaa4c))['catch'](handleError(_0x58edee,null));};exports[_0x0677('0x49')]=function(_0x36feaf,_0x2a0c37){var _0x16381b={'raw':!![],'where':{'id':_0x36feaf[_0x0677('0x4a')]['id']}},_0x529bbf={};_0x529bbf[_0x0677('0x36')]=_['keys'](db[_0x0677('0x32')]['rawAttributes']);_0x529bbf[_0x0677('0x37')]=_['keys'](_0x36feaf['query']);_0x529bbf['filters']=_['intersection'](_0x529bbf[_0x0677('0x36')],_0x529bbf[_0x0677('0x37')]);_0x16381b[_0x0677('0x3a')]=_[_0x0677('0x3b')](_0x529bbf['model'],qs[_0x0677('0x3c')](_0x36feaf[_0x0677('0x37')][_0x0677('0x3c')]));_0x16381b[_0x0677('0x3a')]=_0x16381b[_0x0677('0x3a')][_0x0677('0x3d')]?_0x16381b[_0x0677('0x3a')]:_0x529bbf[_0x0677('0x36')];if(_0x36feaf[_0x0677('0x37')][_0x0677('0x4b')]){_0x16381b[_0x0677('0x46')]=[{'all':!![]}];}_0x16381b=_['merge']({},_0x16381b,_0x36feaf[_0x0677('0x45')]);return db[_0x0677('0x32')][_0x0677('0x4c')](_0x16381b)[_0x0677('0x2a')](handleEntityNotFound(_0x2a0c37,null))[_0x0677('0x2a')](respondWithResult(_0x2a0c37,null))['catch'](handleError(_0x2a0c37,null));};exports[_0x0677('0x4d')]=function(_0x139fe7,_0x3552e8,_0x13d875){return db[_0x0677('0x32')]['find']({'where':{'id':_0x139fe7[_0x0677('0x4a')]['id']},'attributes':[_0x0677('0x2e'),_0x0677('0x4e'),_0x0677('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x3552e8,null))[_0x0677('0x2a')](function(_0x493d41){if(_0x493d41){if(!fs[_0x0677('0x50')](path[_0x0677('0x51')](config[_0x0677('0x52')],_0x0677('0x53'),_0x493d41[_0x0677('0x4e')]+'.'+_0x493d41['converted_format']))){throw new db[(_0x0677('0x54'))][(_0x0677('0x55'))](_0x0677('0x56'));}return _0x3552e8[_0x0677('0x4d')](path[_0x0677('0x51')](config[_0x0677('0x52')],_0x0677('0x53'),util['format'](_0x0677('0x57'),_0x493d41[_0x0677('0x4e')],_0x493d41[_0x0677('0x4f')])),util[_0x0677('0x58')]('%s.%s',_0x493d41[_0x0677('0x2e')],_0x493d41[_0x0677('0x4f')]));}return null;})[_0x0677('0x59')](handleError(_0x3552e8,null));};exports[_0x0677('0x5a')]=function(_0x59f07c,_0x13680d,_0x4d598b){var _0x3f56f4={'name':path[_0x0677('0x5b')](_0x59f07c[_0x0677('0x5c')][_0x0677('0x5d')],path['extname'](_0x59f07c[_0x0677('0x5c')][_0x0677('0x5d')])),'save_name':path[_0x0677('0x5b')](_0x59f07c[_0x0677('0x5c')]['filename'],path[_0x0677('0x5e')](_0x59f07c[_0x0677('0x5c')][_0x0677('0x5f')])),'original_format':path[_0x0677('0x5e')](_0x59f07c['file'][_0x0677('0x5d')])[_0x0677('0x60')](0x1),'converted_format':_0x0677('0x61')};var _0x20ce09=path['join'](config[_0x0677('0x52')],_0x0677('0x62'),_0x59f07c[_0x0677('0x5c')][_0x0677('0x5f')]);var _0x4c1350=path[_0x0677('0x51')](config[_0x0677('0x52')],_0x0677('0x53'),util[_0x0677('0x58')](_0x0677('0x57'),path[_0x0677('0x5b')](_0x59f07c[_0x0677('0x5c')]['filename'],path[_0x0677('0x5e')](_0x59f07c[_0x0677('0x5c')][_0x0677('0x5f')])),_0x3f56f4[_0x0677('0x4f')]));logger[_0x0677('0x63')](_0x0677('0x64'),_0x20ce09);logger[_0x0677('0x63')]('Sound\x20upload\x20destination:\x20%s',_0x4c1350);try{fs[_0x0677('0x65')](_0x20ce09,parseInt('0777',0x8));var _0x24fb2c=sox['transcode'](_0x20ce09,_0x4c1350,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x24fb2c['on'](_0x0677('0x2c'),function(_0x2bc73d){fs[_0x0677('0x66')](_0x20ce09);_0x13680d[_0x0677('0x1f')](0x1f4)[_0x0677('0x2f')](_0x2bc73d);});_0x24fb2c['on']('src',function(_0x2a658b){_0x3f56f4[_0x0677('0x67')]=isNaN(_0x2a658b[_0x0677('0x68')])?null:_0x2a658b[_0x0677('0x68')]*0x3e8;_0x3f56f4[_0x0677('0x69')]=isNaN(_0x2a658b[_0x0677('0x6a')])?null:_0x2a658b[_0x0677('0x6a')];_0x3f56f4['original_channelCount']=isNaN(_0x2a658b['channelCount'])?null:_0x2a658b[_0x0677('0x6b')];_0x3f56f4[_0x0677('0x6c')]=isNaN(_0x2a658b[_0x0677('0x6d')])?null:_0x2a658b[_0x0677('0x6d')];_0x3f56f4[_0x0677('0x6e')]=isNaN(_0x2a658b[_0x0677('0x6f')])?null:_0x2a658b[_0x0677('0x6f')];});_0x24fb2c['on'](_0x0677('0x70'),function(_0x29ae02){_0x3f56f4[_0x0677('0x71')]=isNaN(_0x29ae02[_0x0677('0x68')])?null:_0x29ae02[_0x0677('0x68')]*0x3e8;_0x3f56f4[_0x0677('0x72')]=isNaN(_0x29ae02[_0x0677('0x6a')])?null:_0x29ae02[_0x0677('0x6a')];_0x3f56f4[_0x0677('0x73')]=isNaN(_0x29ae02['channelCount'])?null:_0x29ae02[_0x0677('0x6b')];_0x3f56f4['converted_bitRate']=isNaN(_0x29ae02[_0x0677('0x6d')])?null:_0x29ae02['bitRate'];_0x3f56f4[_0x0677('0x74')]=isNaN(_0x29ae02[_0x0677('0x6f')])?null:_0x29ae02['sampleRate'];});_0x24fb2c['on'](_0x0677('0x1e'),function(){fs['chmodSync'](_0x4c1350,parseInt('0777',0x8));return db[_0x0677('0x32')]['create'](_0x3f56f4)['then'](function(_0x3c549c){var _0x5915e4={'role':_0x59f07c[_0x0677('0x75')]['role'],'userProfileId':_0x59f07c[_0x0677('0x75')]['userProfileId']};if(!_0x5915e4)throw new Error(_0x0677('0x76'));if(_0x5915e4['role']===_0x0677('0x77')){var _0x34ca9a=_0x3c549c[_0x0677('0x2b')]({'plain':!![]});return db[_0x0677('0x78')][_0x0677('0x4c')]({'where':{'name':_0x0677('0x79'),'userProfileId':_0x5915e4[_0x0677('0x7a')]},'raw':!![]})[_0x0677('0x2a')](function(_0x1be23c){if(_0x1be23c&&_0x1be23c[_0x0677('0x7b')]===0x0){return db['UserProfileResource']['create']({'name':_0x34ca9a[_0x0677('0x2e')],'resourceId':_0x34ca9a['id'],'type':_0x1be23c['name'],'sectionId':_0x1be23c['id']},{})[_0x0677('0x2a')](function(){return _0x3c549c;});}else{return _0x3c549c;}})[_0x0677('0x59')](function(_0x587ec2){logger[_0x0677('0x2c')](_0x0677('0x7c'),_0x587ec2);throw _0x587ec2;});}return _0x3c549c;})[_0x0677('0x2a')](respondWithResult(_0x13680d,null))[_0x0677('0x59')](handleError(_0x13680d,null));});_0x24fb2c[_0x0677('0x7d')]();}catch(_0x4c5fe8){_0x13680d['status'](0x1f4)['send'](_0x4c5fe8);}};exports[_0x0677('0x7e')]=function(_0x2e2525,_0x4cdc9a,_0x7b0c8d){return db['Sound'][_0x0677('0x4c')]({'where':{'id':_0x2e2525[_0x0677('0x4a')]['id']}})[_0x0677('0x2a')](handleEntityNotFound(_0x4cdc9a,null))[_0x0677('0x2a')](saveUpdates(_[_0x0677('0x41')](_0x2e2525['body'],[_0x0677('0x2e'),_0x0677('0x7f')]),null))['then'](respondWithResult(_0x4cdc9a,null))[_0x0677('0x59')](handleError(_0x4cdc9a,null));};exports[_0x0677('0x80')]=function(_0x15e931,_0x3d8b00,_0x1262c4){return db[_0x0677('0x32')]['find']({'where':{'id':_0x15e931[_0x0677('0x4a')]['id']}})[_0x0677('0x2a')](function(_0x382da1){if(_0x382da1){return _0x382da1[_0x0677('0x29')]();}})[_0x0677('0x2a')](function(_0xee8243){var _0x208f1c=path['join'](config[_0x0677('0x52')],_0x0677('0x62'),util['format'](_0x0677('0x57'),_0xee8243[_0x0677('0x4e')],_0xee8243['original_format']));var _0xd8510d=path[_0x0677('0x51')](config[_0x0677('0x52')],_0x0677('0x53'),util[_0x0677('0x58')](_0x0677('0x57'),_0xee8243[_0x0677('0x4e')],_0xee8243[_0x0677('0x4f')]));fs['unlinkSync'](_0x208f1c);fs[_0x0677('0x66')](_0xd8510d);return _0xee8243;})[_0x0677('0x2a')](function(_0x3408d4){if(_0x3408d4){return _0x3d8b00[_0x0677('0x1f')](0xcc)[_0x0677('0x1e')]();}})[_0x0677('0x2a')](handleEntityNotFound(_0x3d8b00,null))[_0x0677('0x59')](handleError(_0x3d8b00,null));};
\ No newline at end of file
index 99938b4..f614307 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37fc=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./sound.attributes','exports','Sound','lodash','util'];(function(_0x27638d,_0x4094db){var _0x35da35=function(_0x538095){while(--_0x538095){_0x27638d['push'](_0x27638d['shift']());}};_0x35da35(++_0x4094db);}(_0x37fc,0xa3));var _0xc37f=function(_0xe3f0fc,_0x6146a9){_0xe3f0fc=_0xe3f0fc-0x0;var _0x25fa6f=_0x37fc[_0xe3f0fc];return _0x25fa6f;};'use strict';var _=require(_0xc37f('0x0'));var util=require(_0xc37f('0x1'));var logger=require(_0xc37f('0x2'))(_0xc37f('0x3'));var moment=require(_0xc37f('0x4'));var BPromise=require('bluebird');var rp=require(_0xc37f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc37f('0x6'));var config=require(_0xc37f('0x7'));var attributes=require(_0xc37f('0x8'));module[_0xc37f('0x9')]=function(_0x30896b,_0x1d5d0f){return _0x30896b['define'](_0xc37f('0xa'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb81e=['api','moment','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','util','../../config/logger'];(function(_0x5cfa6a,_0x4d69e8){var _0x204e10=function(_0x364f3a){while(--_0x364f3a){_0x5cfa6a['push'](_0x5cfa6a['shift']());}};_0x204e10(++_0x4d69e8);}(_0xb81e,0x177));var _0xeb81=function(_0x1de396,_0x4c4cdf){_0x1de396=_0x1de396-0x0;var _0x4f17b0=_0xb81e[_0x1de396];return _0x4f17b0;};'use strict';var _=require('lodash');var util=require(_0xeb81('0x0'));var logger=require(_0xeb81('0x1'))(_0xeb81('0x2'));var moment=require(_0xeb81('0x3'));var BPromise=require('bluebird');var rp=require(_0xeb81('0x4'));var fs=require('fs');var path=require(_0xeb81('0x5'));var rimraf=require(_0xeb81('0x6'));var config=require(_0xeb81('0x7'));var attributes=require(_0xeb81('0x8'));module[_0xeb81('0x9')]=function(_0x533d0b,_0x59a470){return _0x533d0b[_0xeb81('0xa')](_0xeb81('0xb'),attributes,{'tableName':_0xeb81('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b714e99..800d2ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb08=['request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','Sound','find','options','raw','where','attributes','include','map','model','ShowSound','stringify','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x44e7b9,_0xf7f5cc){var _0x1de7ac=function(_0x307551){while(--_0x307551){_0x44e7b9['push'](_0x44e7b9['shift']());}};_0x1de7ac(++_0xf7f5cc);}(_0xeb08,0xfe));var _0x8eb0=function(_0x1e5cc3,_0x238a87){_0x1e5cc3=_0x1e5cc3-0x0;var _0x15c596=_0xeb08[_0x1e5cc3];return _0x15c596;};'use strict';var _=require(_0x8eb0('0x0'));var util=require(_0x8eb0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8eb0('0x2'));var fs=require('fs');var Redis=require(_0x8eb0('0x3'));var db=require(_0x8eb0('0x4'))['db'];var utils=require(_0x8eb0('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x8eb0('0x6'));var jayson=require(_0x8eb0('0x7'));var client=jayson[_0x8eb0('0x8')][_0x8eb0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ac78f,_0x1a2e61,_0x5625bc){return new BPromise(function(_0x4e2cec,_0x4a51e3){return client[_0x8eb0('0xa')](_0x3ac78f,_0x5625bc)[_0x8eb0('0xb')](function(_0x2f7578){logger[_0x8eb0('0xc')](_0x8eb0('0xd'),_0x1a2e61,_0x8eb0('0xe'));logger[_0x8eb0('0xf')](_0x8eb0('0x10'),_0x1a2e61,'request\x20sent',JSON['stringify'](_0x2f7578));if(_0x2f7578[_0x8eb0('0x11')]){if(_0x2f7578[_0x8eb0('0x11')][_0x8eb0('0x12')]===0x1f4){logger['error'](_0x8eb0('0xd'),_0x1a2e61,_0x2f7578[_0x8eb0('0x11')][_0x8eb0('0x13')]);return _0x4a51e3(_0x2f7578[_0x8eb0('0x11')][_0x8eb0('0x13')]);}logger[_0x8eb0('0x11')](_0x8eb0('0xd'),_0x1a2e61,_0x2f7578[_0x8eb0('0x11')][_0x8eb0('0x13')]);return _0x4e2cec(_0x2f7578[_0x8eb0('0x11')][_0x8eb0('0x13')]);}else{logger[_0x8eb0('0xc')](_0x8eb0('0xd'),_0x1a2e61,_0x8eb0('0xe'));_0x4e2cec(_0x2f7578[_0x8eb0('0x14')]['message']);}})[_0x8eb0('0x15')](function(_0x179f52){logger[_0x8eb0('0x11')](_0x8eb0('0xd'),_0x1a2e61,_0x179f52);_0x4a51e3(_0x179f52);});});}exports['ShowSound']=function(_0x489172){var _0xc4f1aa=this;return new Promise(function(_0x2f4a5f,_0x49e287){return db[_0x8eb0('0x16')][_0x8eb0('0x17')]({'raw':_0x489172[_0x8eb0('0x18')]?_0x489172[_0x8eb0('0x18')][_0x8eb0('0x19')]===undefined?!![]:![]:!![],'where':_0x489172[_0x8eb0('0x18')]?_0x489172['options'][_0x8eb0('0x1a')]||null:null,'attributes':_0x489172[_0x8eb0('0x18')]?_0x489172[_0x8eb0('0x18')][_0x8eb0('0x1b')]||null:null,'include':_0x489172[_0x8eb0('0x18')]?_0x489172[_0x8eb0('0x18')][_0x8eb0('0x1c')]?_[_0x8eb0('0x1d')](_0x489172[_0x8eb0('0x18')][_0x8eb0('0x1c')],function(_0x579119){return{'model':db[_0x579119['model']],'as':_0x579119['as'],'attributes':_0x579119[_0x8eb0('0x1b')],'include':_0x579119[_0x8eb0('0x1c')]?_['map'](_0x579119[_0x8eb0('0x1c')],function(_0x4b7358){return{'model':db[_0x4b7358[_0x8eb0('0x1e')]],'as':_0x4b7358['as'],'attributes':_0x4b7358[_0x8eb0('0x1b')],'include':_0x4b7358[_0x8eb0('0x1c')]?_[_0x8eb0('0x1d')](_0x4b7358[_0x8eb0('0x1c')],function(_0x5d8e34){return{'model':db[_0x5d8e34[_0x8eb0('0x1e')]],'as':_0x5d8e34['as'],'attributes':_0x5d8e34[_0x8eb0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8eb0('0xb')](function(_0x466757){logger[_0x8eb0('0xc')](_0x8eb0('0x1f'),_0x489172);logger[_0x8eb0('0xf')](_0x8eb0('0x1f'),_0x489172,JSON[_0x8eb0('0x20')](_0x466757));_0x2f4a5f(_0x466757);})[_0x8eb0('0x15')](function(_0x5c51c9){logger[_0x8eb0('0x11')]('ShowSound',_0x5c51c9[_0x8eb0('0x13')],_0x489172);_0x49e287(_0xc4f1aa[_0x8eb0('0x11')](0x1f4,_0x5c51c9[_0x8eb0('0x13')]));});});};
\ No newline at end of file
+var _0x76ef=['request','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSound','find','raw','options','where','include','map','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x76ef,0x194));var _0xf76e=function(_0x2f12cb,_0x382a3a){_0x2f12cb=_0x2f12cb-0x0;var _0x4ef50e=_0x76ef[_0x2f12cb];return _0x4ef50e;};'use strict';var _=require(_0xf76e('0x0'));var util=require(_0xf76e('0x1'));var moment=require(_0xf76e('0x2'));var BPromise=require(_0xf76e('0x3'));var rs=require(_0xf76e('0x4'));var fs=require('fs');var Redis=require(_0xf76e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf76e('0x6'));var logger=require(_0xf76e('0x7'))(_0xf76e('0x8'));var config=require(_0xf76e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf76e('0xa')][_0xf76e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3bf384,_0xc608c0,_0x5106de){return new BPromise(function(_0x1d81b6,_0x40f165){return client[_0xf76e('0xc')](_0x3bf384,_0x5106de)['then'](function(_0x4c58a8){logger[_0xf76e('0xd')](_0xf76e('0xe'),_0xc608c0,_0xf76e('0xf'));logger[_0xf76e('0x10')](_0xf76e('0x11'),_0xc608c0,'request\x20sent',JSON[_0xf76e('0x12')](_0x4c58a8));if(_0x4c58a8['error']){if(_0x4c58a8[_0xf76e('0x13')][_0xf76e('0x14')]===0x1f4){logger[_0xf76e('0x13')]('Sound,\x20%s,\x20%s',_0xc608c0,_0x4c58a8['error'][_0xf76e('0x15')]);return _0x40f165(_0x4c58a8[_0xf76e('0x13')][_0xf76e('0x15')]);}logger[_0xf76e('0x13')]('Sound,\x20%s,\x20%s',_0xc608c0,_0x4c58a8[_0xf76e('0x13')][_0xf76e('0x15')]);return _0x1d81b6(_0x4c58a8[_0xf76e('0x13')][_0xf76e('0x15')]);}else{logger['info'](_0xf76e('0xe'),_0xc608c0,_0xf76e('0xf'));_0x1d81b6(_0x4c58a8['result'][_0xf76e('0x15')]);}})[_0xf76e('0x16')](function(_0xf9eb12){logger[_0xf76e('0x13')]('Sound,\x20%s,\x20%s',_0xc608c0,_0xf9eb12);_0x40f165(_0xf9eb12);});});}exports[_0xf76e('0x17')]=function(_0x44aeec){var _0x41ac2a=this;return new Promise(function(_0x5f3d87,_0x4d0b8f){return db['Sound'][_0xf76e('0x18')]({'raw':_0x44aeec['options']?_0x44aeec['options'][_0xf76e('0x19')]===undefined?!![]:![]:!![],'where':_0x44aeec[_0xf76e('0x1a')]?_0x44aeec[_0xf76e('0x1a')][_0xf76e('0x1b')]||null:null,'attributes':_0x44aeec[_0xf76e('0x1a')]?_0x44aeec[_0xf76e('0x1a')]['attributes']||null:null,'include':_0x44aeec[_0xf76e('0x1a')]?_0x44aeec[_0xf76e('0x1a')][_0xf76e('0x1c')]?_[_0xf76e('0x1d')](_0x44aeec['options'][_0xf76e('0x1c')],function(_0x1283e){return{'model':db[_0x1283e[_0xf76e('0x1e')]],'as':_0x1283e['as'],'attributes':_0x1283e[_0xf76e('0x1f')],'include':_0x1283e[_0xf76e('0x1c')]?_['map'](_0x1283e[_0xf76e('0x1c')],function(_0x4701d0){return{'model':db[_0x4701d0['model']],'as':_0x4701d0['as'],'attributes':_0x4701d0[_0xf76e('0x1f')],'include':_0x4701d0[_0xf76e('0x1c')]?_[_0xf76e('0x1d')](_0x4701d0[_0xf76e('0x1c')],function(_0x2abb5d){return{'model':db[_0x2abb5d[_0xf76e('0x1e')]],'as':_0x2abb5d['as'],'attributes':_0x2abb5d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f6cb2){logger[_0xf76e('0xd')](_0xf76e('0x17'),_0x44aeec);logger['debug'](_0xf76e('0x17'),_0x44aeec,JSON[_0xf76e('0x12')](_0x4f6cb2));_0x5f3d87(_0x4f6cb2);})[_0xf76e('0x16')](function(_0x5e1dea){logger[_0xf76e('0x13')](_0xf76e('0x17'),_0x5e1dea[_0xf76e('0x15')],_0x44aeec);_0x4d0b8f(_0x41ac2a[_0xf76e('0x13')](0x1f4,_0x5e1dea[_0xf76e('0x15')]));});});};
\ No newline at end of file
index a54a5f5..808a0d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','util','path'];(function(_0x5e2e20,_0x10c1d4){var _0x2df52c=function(_0x42662f){while(--_0x42662f){_0x5e2e20['push'](_0x5e2e20['shift']());}};_0x2df52c(++_0x10c1d4);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['show']);router[_0x0baf('0xd')]('/',auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0xf')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x11')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);module[_0x0baf('0x13')]=router;
\ No newline at end of file
+var _0x5f66=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','update','delete','destroy'];(function(_0x5acd05,_0xdcb73b){var _0x160b9e=function(_0x3bb9df){while(--_0x3bb9df){_0x5acd05['push'](_0x5acd05['shift']());}};_0x160b9e(++_0xdcb73b);}(_0x5f66,0x1a0));var _0x65f6=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x5f66[_0x31e29a];return _0x32d892;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./squareMessage.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0xb')]('/',auth[_0x65f6('0x8')](),controller[_0x65f6('0xc')]);router['put']('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0xe')](_0x65f6('0x9'),auth['isAuthenticated'](),controller[_0x65f6('0xf')]);module['exports']=router;
\ No newline at end of file
index dc89de0..bc3c8ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x900f=['ENUM','out','STRING','sequelize','TEXT','medium'];(function(_0x52d60e,_0x4bf337){var _0x5c47f2=function(_0x16a0d5){while(--_0x16a0d5){_0x52d60e['push'](_0x52d60e['shift']());}};_0x5c47f2(++_0x4bf337);}(_0x900f,0xb7));var _0xf900=function(_0x49e454,_0x22328f){_0x49e454=_0x49e454-0x0;var _0x21d045=_0x900f[_0x49e454];return _0x21d045;};'use strict';var Sequelize=require(_0xf900('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0xf900('0x1')](_0xf900('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0xf900('0x3')]('in','out'),'defaultValue':_0xf900('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0xf900('0x5')]},'providerResponse':{'type':Sequelize[_0xf900('0x1')]}};
\ No newline at end of file
+var _0x9b66=['TEXT','ENUM','out','STRING','sequelize','exports'];(function(_0x34ebf3,_0x5935c5){var _0x3a634d=function(_0x4f5d92){while(--_0x4f5d92){_0x34ebf3['push'](_0x34ebf3['shift']());}};_0x3a634d(++_0x5935c5);}(_0x9b66,0xa6));var _0x69b6=function(_0x51723e,_0x28d019){_0x51723e=_0x51723e-0x0;var _0x43936a=_0x9b66[_0x51723e];return _0x43936a;};'use strict';var Sequelize=require(_0x69b6('0x0'));module[_0x69b6('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x69b6('0x2')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x69b6('0x3')]('in',_0x69b6('0x4')),'defaultValue':_0x69b6('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0x69b6('0x5')]},'providerResponse':{'type':Sequelize[_0x69b6('0x2')]}};
\ No newline at end of file
index 0ce6064..17c86a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7a5=['name','send','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','create','body','find','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','apply','save','update','destroy','then'];(function(_0x2427f8,_0x50d4fa){var _0x10f634=function(_0x35db7a){while(--_0x35db7a){_0x2427f8['push'](_0x2427f8['shift']());}};_0x10f634(++_0x50d4fa);}(_0xb7a5,0x67));var _0x5b7a=function(_0xc5944f,_0x5df40c){_0xc5944f=_0xc5944f-0x0;var _0x16fa66=_0xb7a5[_0xc5944f];return _0x16fa66;};'use strict';var emlformat=require(_0x5b7a('0x0'));var rimraf=require(_0x5b7a('0x1'));var zipdir=require(_0x5b7a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5b7a('0x3'));var moment=require('moment');var BPromise=require(_0x5b7a('0x4'));var Mustache=require(_0x5b7a('0x5'));var util=require(_0x5b7a('0x6'));var path=require('path');var sox=require(_0x5b7a('0x7'));var csv=require(_0x5b7a('0x8'));var ejs=require(_0x5b7a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5b7a('0xa'));var crypto=require('crypto');var jsforce=require(_0x5b7a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5b7a('0x8'));var querystring=require(_0x5b7a('0xc'));var Papa=require('papaparse');var Redis=require(_0x5b7a('0xd'));var authService=require(_0x5b7a('0xe'));var qs=require(_0x5b7a('0xf'));var as=require(_0x5b7a('0x10'));var hardwareService=require(_0x5b7a('0x11'));var logger=require('../../config/logger')(_0x5b7a('0x12'));var utils=require(_0x5b7a('0x13'));var config=require(_0x5b7a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5b7a('0x15'))['db'];function respondWithStatusCode(_0x15be0e,_0x1e2342){_0x1e2342=_0x1e2342||0xcc;return function(_0x5ecf1f){if(_0x5ecf1f){return _0x15be0e[_0x5b7a('0x16')](_0x1e2342);}return _0x15be0e[_0x5b7a('0x17')](_0x1e2342)['end']();};}function respondWithResult(_0x233366,_0x9d502a){_0x9d502a=_0x9d502a||0xc8;return function(_0x56a804){if(_0x56a804){return _0x233366['status'](_0x9d502a)[_0x5b7a('0x18')](_0x56a804);}};}function respondWithFilteredResult(_0x5d5696,_0x442af3){return function(_0x87fbd6){if(_0x87fbd6){var _0x5209bf=typeof _0x442af3[_0x5b7a('0x19')]==='undefined'&&typeof _0x442af3[_0x5b7a('0x1a')]===_0x5b7a('0x1b');var _0x1dae34=_0x87fbd6[_0x5b7a('0x1c')];var _0x15fd1d=_0x5209bf?0x0:_0x442af3[_0x5b7a('0x19')];var _0x27c067=_0x5209bf?_0x87fbd6[_0x5b7a('0x1c')]:_0x442af3[_0x5b7a('0x19')]+_0x442af3[_0x5b7a('0x1a')];var _0x1a3a12;if(_0x27c067>=_0x1dae34){_0x27c067=_0x1dae34;_0x1a3a12=0xc8;}else{_0x1a3a12=0xce;}_0x5d5696['status'](_0x1a3a12);return _0x5d5696[_0x5b7a('0x1d')]('Content-Range',_0x15fd1d+'-'+_0x27c067+'/'+_0x1dae34)[_0x5b7a('0x18')](_0x87fbd6);}return null;};}function patchUpdates(_0x1e6d66){return function(_0xc678a5){try{jsonpatch[_0x5b7a('0x1e')](_0xc678a5,_0x1e6d66,!![]);}catch(_0x236684){return BPromise['reject'](_0x236684);}return _0xc678a5[_0x5b7a('0x1f')]();};}function saveUpdates(_0x511d87,_0x35b9ef){return function(_0x5374ce){if(_0x5374ce){return _0x5374ce[_0x5b7a('0x20')](_0x511d87)['then'](function(_0x1c1d4c){return _0x1c1d4c;});}return null;};}function removeEntity(_0x1762c3,_0x30f5a6){return function(_0x472ae8){if(_0x472ae8){return _0x472ae8[_0x5b7a('0x21')]()[_0x5b7a('0x22')](function(){_0x1762c3[_0x5b7a('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d42b3,_0x5b24ac){return function(_0x182d22){if(!_0x182d22){_0x3d42b3['sendStatus'](0x194);}return _0x182d22;};}function handleError(_0x1b5e49,_0x584251){_0x584251=_0x584251||0x1f4;return function(_0x42d62b){logger['error'](_0x42d62b['stack']);if(_0x42d62b[_0x5b7a('0x23')]){delete _0x42d62b[_0x5b7a('0x23')];}_0x1b5e49[_0x5b7a('0x17')](_0x584251)[_0x5b7a('0x24')](_0x42d62b);};}exports['index']=function(_0x56a3e4,_0x26bd82){var _0x16ca39={},_0x3d79a0={},_0x435b94={'count':0x0,'rows':[]};var _0x4326fc=_[_0x5b7a('0x25')](db[_0x5b7a('0x26')][_0x5b7a('0x27')],function(_0x18f68e){return{'name':_0x18f68e[_0x5b7a('0x28')],'type':_0x18f68e[_0x5b7a('0x29')][_0x5b7a('0x2a')]};});_0x3d79a0[_0x5b7a('0x2b')]=_[_0x5b7a('0x25')](_0x4326fc,_0x5b7a('0x23'));_0x3d79a0[_0x5b7a('0x2c')]=_['keys'](_0x56a3e4[_0x5b7a('0x2c')]);_0x3d79a0[_0x5b7a('0x2d')]=_[_0x5b7a('0x2e')](_0x3d79a0[_0x5b7a('0x2b')],_0x3d79a0['query']);_0x16ca39[_0x5b7a('0x2f')]=_[_0x5b7a('0x2e')](_0x3d79a0['model'],qs[_0x5b7a('0x30')](_0x56a3e4['query'][_0x5b7a('0x30')]));_0x16ca39['attributes']=_0x16ca39[_0x5b7a('0x2f')][_0x5b7a('0x31')]?_0x16ca39[_0x5b7a('0x2f')]:_0x3d79a0['model'];if(!_0x56a3e4[_0x5b7a('0x2c')][_0x5b7a('0x32')](_0x5b7a('0x33'))){_0x16ca39[_0x5b7a('0x1a')]=qs[_0x5b7a('0x1a')](_0x56a3e4[_0x5b7a('0x2c')][_0x5b7a('0x1a')]);_0x16ca39[_0x5b7a('0x19')]=qs[_0x5b7a('0x19')](_0x56a3e4[_0x5b7a('0x2c')][_0x5b7a('0x19')]);}_0x16ca39['order']=qs['sort'](_0x56a3e4['query'][_0x5b7a('0x34')]);_0x16ca39[_0x5b7a('0x35')]=qs[_0x5b7a('0x2d')](_[_0x5b7a('0x36')](_0x56a3e4[_0x5b7a('0x2c')],_0x3d79a0[_0x5b7a('0x2d')]),_0x4326fc);if(_0x56a3e4[_0x5b7a('0x2c')][_0x5b7a('0x37')]){_0x16ca39[_0x5b7a('0x35')]=_[_0x5b7a('0x38')](_0x16ca39[_0x5b7a('0x35')],{'$or':_[_0x5b7a('0x25')](_0x4326fc,function(_0x53eb47){if(_0x53eb47[_0x5b7a('0x29')]!==_0x5b7a('0x39')){var _0x5a1504={};_0x5a1504[_0x53eb47[_0x5b7a('0x23')]]={'$like':'%'+_0x56a3e4[_0x5b7a('0x2c')]['filter']+'%'};return _0x5a1504;}})});}_0x16ca39=_['merge']({},_0x16ca39,_0x56a3e4[_0x5b7a('0x3a')]);var _0x4d2d45={'where':_0x16ca39[_0x5b7a('0x35')]};return db['SquareMessage'][_0x5b7a('0x1c')](_0x4d2d45)[_0x5b7a('0x22')](function(_0x4c1542){_0x435b94[_0x5b7a('0x1c')]=_0x4c1542;if(_0x56a3e4['query'][_0x5b7a('0x3b')]){_0x16ca39[_0x5b7a('0x3c')]=[{'all':!![]}];}return db['SquareMessage'][_0x5b7a('0x3d')](_0x16ca39);})[_0x5b7a('0x22')](function(_0x2acbf0){_0x435b94[_0x5b7a('0x3e')]=_0x2acbf0;return _0x435b94;})[_0x5b7a('0x22')](respondWithFilteredResult(_0x26bd82,_0x16ca39))[_0x5b7a('0x3f')](handleError(_0x26bd82,null));};exports['show']=function(_0x4f5318,_0x1b5841){var _0x5cc671={'raw':!![],'where':{'id':_0x4f5318[_0x5b7a('0x40')]['id']}},_0x1f7987={};_0x1f7987['model']=_[_0x5b7a('0x41')](db[_0x5b7a('0x26')]['rawAttributes']);_0x1f7987[_0x5b7a('0x2c')]=_[_0x5b7a('0x41')](_0x4f5318[_0x5b7a('0x2c')]);_0x1f7987[_0x5b7a('0x2d')]=_['intersection'](_0x1f7987[_0x5b7a('0x2b')],_0x1f7987['query']);_0x5cc671[_0x5b7a('0x2f')]=_[_0x5b7a('0x2e')](_0x1f7987[_0x5b7a('0x2b')],qs[_0x5b7a('0x30')](_0x4f5318[_0x5b7a('0x2c')][_0x5b7a('0x30')]));_0x5cc671['attributes']=_0x5cc671[_0x5b7a('0x2f')][_0x5b7a('0x31')]?_0x5cc671[_0x5b7a('0x2f')]:_0x1f7987[_0x5b7a('0x2b')];if(_0x4f5318[_0x5b7a('0x2c')][_0x5b7a('0x3b')]){_0x5cc671[_0x5b7a('0x3c')]=[{'all':!![]}];}_0x5cc671=_[_0x5b7a('0x38')]({},_0x5cc671,_0x4f5318[_0x5b7a('0x3a')]);return db[_0x5b7a('0x26')]['find'](_0x5cc671)[_0x5b7a('0x22')](handleEntityNotFound(_0x1b5841,null))[_0x5b7a('0x22')](respondWithResult(_0x1b5841,null))[_0x5b7a('0x3f')](handleError(_0x1b5841,null));};exports[_0x5b7a('0x42')]=function(_0x50e98d,_0x570531){return db[_0x5b7a('0x26')][_0x5b7a('0x42')](_0x50e98d[_0x5b7a('0x43')],{})['then'](respondWithResult(_0x570531,0xc9))['catch'](handleError(_0x570531,null));};exports[_0x5b7a('0x20')]=function(_0x27cf07,_0x2408a5){if(_0x27cf07['body']['id']){delete _0x27cf07['body']['id'];}return db['SquareMessage'][_0x5b7a('0x44')]({'where':{'id':_0x27cf07['params']['id']}})[_0x5b7a('0x22')](handleEntityNotFound(_0x2408a5,null))[_0x5b7a('0x22')](saveUpdates(_0x27cf07[_0x5b7a('0x43')],null))[_0x5b7a('0x22')](respondWithResult(_0x2408a5,null))[_0x5b7a('0x3f')](handleError(_0x2408a5,null));};exports[_0x5b7a('0x21')]=function(_0x36942e,_0x167852){return db[_0x5b7a('0x26')]['find']({'where':{'id':_0x36942e['params']['id']}})[_0x5b7a('0x22')](handleEntityNotFound(_0x167852,null))[_0x5b7a('0x22')](removeEntity(_0x167852,null))['catch'](handleError(_0x167852,null));};
\ No newline at end of file
+var _0x5f88=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','limit','undefined','count','json','reject','save','update','then','destroy','error','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','show','params','keys','length','options','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x1c0f02,_0x248e33){var _0x5520fc=function(_0x2cbc86){while(--_0x2cbc86){_0x1c0f02['push'](_0x1c0f02['shift']());}};_0x5520fc(++_0x248e33);}(_0x5f88,0x1bb));var _0x85f8=function(_0x1027bc,_0x5484d4){_0x1027bc=_0x1027bc-0x0;var _0x48fcf1=_0x5f88[_0x1027bc];return _0x48fcf1;};'use strict';var emlformat=require(_0x85f8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x85f8('0x1'));var jsonpatch=require(_0x85f8('0x2'));var rp=require(_0x85f8('0x3'));var moment=require(_0x85f8('0x4'));var BPromise=require(_0x85f8('0x5'));var Mustache=require(_0x85f8('0x6'));var util=require('util');var path=require(_0x85f8('0x7'));var sox=require(_0x85f8('0x8'));var csv=require(_0x85f8('0x9'));var ejs=require(_0x85f8('0xa'));var fs=require('fs');var fs_extra=require(_0x85f8('0xb'));var _=require(_0x85f8('0xc'));var squel=require(_0x85f8('0xd'));var crypto=require('crypto');var jsforce=require(_0x85f8('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x85f8('0x9'));var querystring=require('querystring');var Papa=require(_0x85f8('0xf'));var Redis=require(_0x85f8('0x10'));var authService=require(_0x85f8('0x11'));var qs=require(_0x85f8('0x12'));var as=require(_0x85f8('0x13'));var hardwareService=require(_0x85f8('0x14'));var logger=require(_0x85f8('0x15'))(_0x85f8('0x16'));var utils=require(_0x85f8('0x17'));var config=require(_0x85f8('0x18'));var licenseUtil=require(_0x85f8('0x19'));var db=require(_0x85f8('0x1a'))['db'];function respondWithStatusCode(_0x31c633,_0x49132f){_0x49132f=_0x49132f||0xcc;return function(_0x22be91){if(_0x22be91){return _0x31c633[_0x85f8('0x1b')](_0x49132f);}return _0x31c633['status'](_0x49132f)[_0x85f8('0x1c')]();};}function respondWithResult(_0x5d3912,_0x1bdb03){_0x1bdb03=_0x1bdb03||0xc8;return function(_0x543268){if(_0x543268){return _0x5d3912[_0x85f8('0x1d')](_0x1bdb03)['json'](_0x543268);}};}function respondWithFilteredResult(_0x1ab625,_0x4cf729){return function(_0xe8c7e0){if(_0xe8c7e0){var _0x3d6c11=typeof _0x4cf729['offset']==='undefined'&&typeof _0x4cf729[_0x85f8('0x1e')]===_0x85f8('0x1f');var _0xe4515d=_0xe8c7e0[_0x85f8('0x20')];var _0x34e651=_0x3d6c11?0x0:_0x4cf729['offset'];var _0x5dd414=_0x3d6c11?_0xe8c7e0[_0x85f8('0x20')]:_0x4cf729['offset']+_0x4cf729[_0x85f8('0x1e')];var _0x2706b6;if(_0x5dd414>=_0xe4515d){_0x5dd414=_0xe4515d;_0x2706b6=0xc8;}else{_0x2706b6=0xce;}_0x1ab625[_0x85f8('0x1d')](_0x2706b6);return _0x1ab625['set']('Content-Range',_0x34e651+'-'+_0x5dd414+'/'+_0xe4515d)[_0x85f8('0x21')](_0xe8c7e0);}return null;};}function patchUpdates(_0x2ec074){return function(_0x4c8dd4){try{jsonpatch['apply'](_0x4c8dd4,_0x2ec074,!![]);}catch(_0x1a27eb){return BPromise[_0x85f8('0x22')](_0x1a27eb);}return _0x4c8dd4[_0x85f8('0x23')]();};}function saveUpdates(_0x1c014b,_0x23073a){return function(_0x38721e){if(_0x38721e){return _0x38721e[_0x85f8('0x24')](_0x1c014b)[_0x85f8('0x25')](function(_0x5780d4){return _0x5780d4;});}return null;};}function removeEntity(_0x1a2e37,_0x4536b8){return function(_0x1e3b05){if(_0x1e3b05){return _0x1e3b05[_0x85f8('0x26')]()[_0x85f8('0x25')](function(){_0x1a2e37[_0x85f8('0x1d')](0xcc)[_0x85f8('0x1c')]();});}};}function handleEntityNotFound(_0x24e676,_0xcb06c0){return function(_0x2cf9e8){if(!_0x2cf9e8){_0x24e676[_0x85f8('0x1b')](0x194);}return _0x2cf9e8;};}function handleError(_0xa7832a,_0x2c03ca){_0x2c03ca=_0x2c03ca||0x1f4;return function(_0x19d1f8){logger[_0x85f8('0x27')](_0x19d1f8['stack']);if(_0x19d1f8['name']){delete _0x19d1f8[_0x85f8('0x28')];}_0xa7832a[_0x85f8('0x1d')](_0x2c03ca)[_0x85f8('0x29')](_0x19d1f8);};}exports[_0x85f8('0x2a')]=function(_0x1e45d9,_0x4d2b2f){var _0x2f4097={},_0x1e2ffa={},_0x16e893={'count':0x0,'rows':[]};var _0x5d9eef=_[_0x85f8('0x2b')](db[_0x85f8('0x2c')][_0x85f8('0x2d')],function(_0x4efcd7){return{'name':_0x4efcd7[_0x85f8('0x2e')],'type':_0x4efcd7[_0x85f8('0x2f')][_0x85f8('0x30')]};});_0x1e2ffa['model']=_['map'](_0x5d9eef,_0x85f8('0x28'));_0x1e2ffa[_0x85f8('0x31')]=_['keys'](_0x1e45d9['query']);_0x1e2ffa[_0x85f8('0x32')]=_[_0x85f8('0x33')](_0x1e2ffa[_0x85f8('0x34')],_0x1e2ffa[_0x85f8('0x31')]);_0x2f4097[_0x85f8('0x35')]=_[_0x85f8('0x33')](_0x1e2ffa[_0x85f8('0x34')],qs[_0x85f8('0x36')](_0x1e45d9['query'][_0x85f8('0x36')]));_0x2f4097[_0x85f8('0x35')]=_0x2f4097[_0x85f8('0x35')]['length']?_0x2f4097[_0x85f8('0x35')]:_0x1e2ffa[_0x85f8('0x34')];if(!_0x1e45d9[_0x85f8('0x31')][_0x85f8('0x37')](_0x85f8('0x38'))){_0x2f4097[_0x85f8('0x1e')]=qs['limit'](_0x1e45d9[_0x85f8('0x31')]['limit']);_0x2f4097[_0x85f8('0x39')]=qs['offset'](_0x1e45d9['query'][_0x85f8('0x39')]);}_0x2f4097[_0x85f8('0x3a')]=qs['sort'](_0x1e45d9['query'][_0x85f8('0x3b')]);_0x2f4097[_0x85f8('0x3c')]=qs[_0x85f8('0x32')](_['pick'](_0x1e45d9[_0x85f8('0x31')],_0x1e2ffa['filters']),_0x5d9eef);if(_0x1e45d9['query']['filter']){_0x2f4097[_0x85f8('0x3c')]=_['merge'](_0x2f4097[_0x85f8('0x3c')],{'$or':_[_0x85f8('0x2b')](_0x5d9eef,function(_0x41952b){if(_0x41952b[_0x85f8('0x2f')]!==_0x85f8('0x3d')){var _0x11f3ab={};_0x11f3ab[_0x41952b[_0x85f8('0x28')]]={'$like':'%'+_0x1e45d9[_0x85f8('0x31')][_0x85f8('0x3e')]+'%'};return _0x11f3ab;}})});}_0x2f4097=_[_0x85f8('0x3f')]({},_0x2f4097,_0x1e45d9['options']);var _0x1757c1={'where':_0x2f4097[_0x85f8('0x3c')]};return db[_0x85f8('0x2c')]['count'](_0x1757c1)[_0x85f8('0x25')](function(_0x1bd113){_0x16e893['count']=_0x1bd113;if(_0x1e45d9['query'][_0x85f8('0x40')]){_0x2f4097[_0x85f8('0x41')]=[{'all':!![]}];}return db[_0x85f8('0x2c')][_0x85f8('0x42')](_0x2f4097);})['then'](function(_0x20e72b){_0x16e893[_0x85f8('0x43')]=_0x20e72b;return _0x16e893;})[_0x85f8('0x25')](respondWithFilteredResult(_0x4d2b2f,_0x2f4097))[_0x85f8('0x44')](handleError(_0x4d2b2f,null));};exports[_0x85f8('0x45')]=function(_0x2d22f8,_0x5fd4a4){var _0x26c506={'raw':!![],'where':{'id':_0x2d22f8[_0x85f8('0x46')]['id']}},_0x55b446={};_0x55b446[_0x85f8('0x34')]=_[_0x85f8('0x47')](db[_0x85f8('0x2c')][_0x85f8('0x2d')]);_0x55b446[_0x85f8('0x31')]=_[_0x85f8('0x47')](_0x2d22f8[_0x85f8('0x31')]);_0x55b446[_0x85f8('0x32')]=_[_0x85f8('0x33')](_0x55b446[_0x85f8('0x34')],_0x55b446[_0x85f8('0x31')]);_0x26c506[_0x85f8('0x35')]=_['intersection'](_0x55b446['model'],qs[_0x85f8('0x36')](_0x2d22f8[_0x85f8('0x31')][_0x85f8('0x36')]));_0x26c506[_0x85f8('0x35')]=_0x26c506[_0x85f8('0x35')][_0x85f8('0x48')]?_0x26c506[_0x85f8('0x35')]:_0x55b446[_0x85f8('0x34')];if(_0x2d22f8['query'][_0x85f8('0x40')]){_0x26c506[_0x85f8('0x41')]=[{'all':!![]}];}_0x26c506=_[_0x85f8('0x3f')]({},_0x26c506,_0x2d22f8[_0x85f8('0x49')]);return db['SquareMessage'][_0x85f8('0x4a')](_0x26c506)[_0x85f8('0x25')](handleEntityNotFound(_0x5fd4a4,null))[_0x85f8('0x25')](respondWithResult(_0x5fd4a4,null))[_0x85f8('0x44')](handleError(_0x5fd4a4,null));};exports[_0x85f8('0x4b')]=function(_0x42ece6,_0x5e39a4){return db['SquareMessage'][_0x85f8('0x4b')](_0x42ece6[_0x85f8('0x4c')],{})[_0x85f8('0x25')](respondWithResult(_0x5e39a4,0xc9))[_0x85f8('0x44')](handleError(_0x5e39a4,null));};exports[_0x85f8('0x24')]=function(_0x3ab071,_0x1bfd5d){if(_0x3ab071['body']['id']){delete _0x3ab071['body']['id'];}return db[_0x85f8('0x2c')][_0x85f8('0x4a')]({'where':{'id':_0x3ab071[_0x85f8('0x46')]['id']}})['then'](handleEntityNotFound(_0x1bfd5d,null))[_0x85f8('0x25')](saveUpdates(_0x3ab071[_0x85f8('0x4c')],null))[_0x85f8('0x25')](respondWithResult(_0x1bfd5d,null))[_0x85f8('0x44')](handleError(_0x1bfd5d,null));};exports[_0x85f8('0x26')]=function(_0x2e3a35,_0x54098b){return db['SquareMessage'][_0x85f8('0x4a')]({'where':{'id':_0x2e3a35[_0x85f8('0x46')]['id']}})['then'](handleEntityNotFound(_0x54098b,null))[_0x85f8('0x25')](removeEntity(_0x54098b,null))[_0x85f8('0x44')](handleError(_0x54098b,null));};
\ No newline at end of file
index db31838..6bc0f97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50df=['path','rimraf','./squareMessage.attributes','exports','define','square_messages','util','../../config/logger','api','moment','bluebird'];(function(_0x1acd0b,_0x51e8db){var _0x3e1ce0=function(_0x92785d){while(--_0x92785d){_0x1acd0b['push'](_0x1acd0b['shift']());}};_0x3e1ce0(++_0x51e8db);}(_0x50df,0x1ea));var _0xf50d=function(_0x224390,_0x1dd948){_0x224390=_0x224390-0x0;var _0x34a8db=_0x50df[_0x224390];return _0x34a8db;};'use strict';var _=require('lodash');var util=require(_0xf50d('0x0'));var logger=require(_0xf50d('0x1'))(_0xf50d('0x2'));var moment=require(_0xf50d('0x3'));var BPromise=require(_0xf50d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf50d('0x5'));var rimraf=require(_0xf50d('0x6'));var config=require('../../config/environment');var attributes=require(_0xf50d('0x7'));module[_0xf50d('0x8')]=function(_0x34b95d,_0x5472e8){return _0x34b95d[_0xf50d('0x9')]('SquareMessage',attributes,{'tableName':_0xf50d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbf05=['path','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','api','moment','bluebird'];(function(_0x4c0b94,_0x31aee5){var _0x221afa=function(_0xc8c263){while(--_0xc8c263){_0x4c0b94['push'](_0x4c0b94['shift']());}};_0x221afa(++_0x31aee5);}(_0xbf05,0x114));var _0x5bf0=function(_0x58aefd,_0x249251){_0x58aefd=_0x58aefd-0x0;var _0xdae2d7=_0xbf05[_0x58aefd];return _0xdae2d7;};'use strict';var _=require(_0x5bf0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5bf0('0x1'));var moment=require(_0x5bf0('0x2'));var BPromise=require(_0x5bf0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5bf0('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5bf0('0x5'));module[_0x5bf0('0x6')]=function(_0x4dc051,_0x553530){return _0x4dc051[_0x5bf0('0x7')](_0x5bf0('0x8'),attributes,{'tableName':_0x5bf0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 78aaf96..43831c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e74=['options','raw','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSquareMessage','SquareMessage','create'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x5e74,0x1bc));var _0x45e7=function(_0x27fb2f,_0x511fd6){_0x27fb2f=_0x27fb2f-0x0;var _0x3165b8=_0x5e74[_0x27fb2f];return _0x3165b8;};'use strict';var _=require(_0x45e7('0x0'));var util=require(_0x45e7('0x1'));var moment=require(_0x45e7('0x2'));var BPromise=require('bluebird');var rs=require(_0x45e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x45e7('0x4'))['db'];var utils=require(_0x45e7('0x5'));var logger=require('../../config/logger')(_0x45e7('0x6'));var config=require(_0x45e7('0x7'));var jayson=require(_0x45e7('0x8'));var client=jayson[_0x45e7('0x9')][_0x45e7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31858b,_0x119d37,_0x539088){return new BPromise(function(_0x20c455,_0x5f07ca){return client['request'](_0x31858b,_0x539088)['then'](function(_0x5831f3){logger[_0x45e7('0xb')](_0x45e7('0xc'),_0x119d37,_0x45e7('0xd'));logger[_0x45e7('0xe')](_0x45e7('0xf'),_0x119d37,_0x45e7('0xd'),JSON[_0x45e7('0x10')](_0x5831f3));if(_0x5831f3[_0x45e7('0x11')]){if(_0x5831f3['error'][_0x45e7('0x12')]===0x1f4){logger[_0x45e7('0x11')](_0x45e7('0xc'),_0x119d37,_0x5831f3['error'][_0x45e7('0x13')]);return _0x5f07ca(_0x5831f3[_0x45e7('0x11')][_0x45e7('0x13')]);}logger[_0x45e7('0x11')](_0x45e7('0xc'),_0x119d37,_0x5831f3[_0x45e7('0x11')]['message']);return _0x20c455(_0x5831f3[_0x45e7('0x11')][_0x45e7('0x13')]);}else{logger[_0x45e7('0xb')](_0x45e7('0xc'),_0x119d37,_0x45e7('0xd'));_0x20c455(_0x5831f3['result'][_0x45e7('0x13')]);}})[_0x45e7('0x14')](function(_0x10b3fa){logger[_0x45e7('0x11')](_0x45e7('0xc'),_0x119d37,_0x10b3fa);_0x5f07ca(_0x10b3fa);});});}exports[_0x45e7('0x15')]=function(_0x3ba587){var _0x55c949=this;return new Promise(function(_0x49f2fb,_0x187691){return db[_0x45e7('0x16')][_0x45e7('0x17')](_0x3ba587['body'],{'raw':_0x3ba587['options']?_0x3ba587[_0x45e7('0x18')][_0x45e7('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x3b39ba){logger[_0x45e7('0xb')](_0x45e7('0x15'),_0x3ba587);logger[_0x45e7('0xe')](_0x45e7('0x15'),_0x3ba587,JSON['stringify'](_0x3b39ba));_0x49f2fb(_0x3b39ba);})[_0x45e7('0x14')](function(_0x344a70){logger[_0x45e7('0x11')]('CreateSquareMessage',_0x344a70['message'],_0x3ba587);_0x187691(_0x55c949[_0x45e7('0x11')](0x1f4,_0x344a70[_0x45e7('0x13')]));});});};
\ No newline at end of file
+var _0x634d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateSquareMessage','SquareMessage','create','body','raw','lodash','util'];(function(_0x4501a6,_0x561517){var _0x309313=function(_0x3fa424){while(--_0x3fa424){_0x4501a6['push'](_0x4501a6['shift']());}};_0x309313(++_0x561517);}(_0x634d,0xbb));var _0xd634=function(_0x105e88,_0x54ff10){_0x105e88=_0x105e88-0x0;var _0x18e625=_0x634d[_0x105e88];return _0x18e625;};'use strict';var _=require(_0xd634('0x0'));var util=require(_0xd634('0x1'));var moment=require('moment');var BPromise=require(_0xd634('0x2'));var rs=require(_0xd634('0x3'));var fs=require('fs');var Redis=require(_0xd634('0x4'));var db=require(_0xd634('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd634('0x6'));var jayson=require(_0xd634('0x7'));var client=jayson[_0xd634('0x8')][_0xd634('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x38fe3b,_0x1e2d9a,_0x576e5d){return new BPromise(function(_0x1017c8,_0x41732e){return client[_0xd634('0xa')](_0x38fe3b,_0x576e5d)[_0xd634('0xb')](function(_0x5c889a){logger[_0xd634('0xc')](_0xd634('0xd'),_0x1e2d9a,'request\x20sent');logger[_0xd634('0xe')](_0xd634('0xf'),_0x1e2d9a,_0xd634('0x10'),JSON[_0xd634('0x11')](_0x5c889a));if(_0x5c889a[_0xd634('0x12')]){if(_0x5c889a[_0xd634('0x12')][_0xd634('0x13')]===0x1f4){logger['error'](_0xd634('0xd'),_0x1e2d9a,_0x5c889a[_0xd634('0x12')][_0xd634('0x14')]);return _0x41732e(_0x5c889a[_0xd634('0x12')][_0xd634('0x14')]);}logger[_0xd634('0x12')]('SquareMessage,\x20%s,\x20%s',_0x1e2d9a,_0x5c889a[_0xd634('0x12')]['message']);return _0x1017c8(_0x5c889a['error'][_0xd634('0x14')]);}else{logger[_0xd634('0xc')](_0xd634('0xd'),_0x1e2d9a,_0xd634('0x10'));_0x1017c8(_0x5c889a['result'][_0xd634('0x14')]);}})[_0xd634('0x15')](function(_0x119ad3){logger[_0xd634('0x12')]('SquareMessage,\x20%s,\x20%s',_0x1e2d9a,_0x119ad3);_0x41732e(_0x119ad3);});});}exports[_0xd634('0x16')]=function(_0x531224){var _0x4206d5=this;return new Promise(function(_0x550140,_0x1e41cc){return db[_0xd634('0x17')][_0xd634('0x18')](_0x531224[_0xd634('0x19')],{'raw':_0x531224['options']?_0x531224['options'][_0xd634('0x1a')]===undefined?!![]:![]:!![]})[_0xd634('0xb')](function(_0x5b845b){logger[_0xd634('0xc')](_0xd634('0x16'),_0x531224);logger[_0xd634('0xe')]('CreateSquareMessage',_0x531224,JSON[_0xd634('0x11')](_0x5b845b));_0x550140(_0x5b845b);})[_0xd634('0x15')](function(_0x306bb8){logger[_0xd634('0x12')](_0xd634('0x16'),_0x306bb8[_0xd634('0x14')],_0x531224);_0x1e41cc(_0x4206d5['error'](0x1f4,_0x306bb8['message']));});});};
\ No newline at end of file
index babf1f0..bce3727 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x289d=['15s','test','post','create','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x4260c1,_0x1b60e1){var _0x2fb592=function(_0x4a6c84){while(--_0x4a6c84){_0x4260c1['push'](_0x4260c1['shift']());}};_0x2fb592(++_0x1b60e1);}(_0x289d,0x16e));var _0xd289=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x289d[_0x37c22c];return _0x119d79;};'use strict';var multer=require(_0xd289('0x0'));var util=require(_0xd289('0x1'));var path=require(_0xd289('0x2'));var timeout=require(_0xd289('0x3'));var express=require(_0xd289('0x4'));var router=express[_0xd289('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd289('0x6'));var interaction=require(_0xd289('0x7'));var config=require(_0xd289('0x8'));var controller=require('./squareOdbc.controller');router[_0xd289('0x9')]('/',auth[_0xd289('0xa')](),controller[_0xd289('0xb')]);router[_0xd289('0x9')](_0xd289('0xc'),auth[_0xd289('0xa')](),controller[_0xd289('0xd')]);router[_0xd289('0x9')]('/:id/test',auth['isAuthenticated'](),timeout(_0xd289('0xe')),controller[_0xd289('0xf')]);router[_0xd289('0x10')]('/',auth[_0xd289('0xa')](),controller[_0xd289('0x11')]);router['put'](_0xd289('0xc'),auth['isAuthenticated'](),controller[_0xd289('0x12')]);router['delete'](_0xd289('0xc'),auth[_0xd289('0xa')](),controller['destroy']);module[_0xd289('0x13')]=router;
\ No newline at end of file
+var _0x946a=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','index','get','/:id','isAuthenticated','show','/:id/test','15s','test','create','put','destroy','path'];(function(_0x31b90f,_0x35ef73){var _0x15653b=function(_0x3b992f){while(--_0x3b992f){_0x31b90f['push'](_0x31b90f['shift']());}};_0x15653b(++_0x35ef73);}(_0x946a,0xe3));var _0xa946=function(_0x4152c4,_0x3cc091){_0x4152c4=_0x4152c4-0x0;var _0xc6d75a=_0x946a[_0x4152c4];return _0xc6d75a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa946('0x0'));var timeout=require(_0xa946('0x1'));var express=require('express');var router=express[_0xa946('0x2')]();var fs_extra=require(_0xa946('0x3'));var auth=require(_0xa946('0x4'));var interaction=require(_0xa946('0x5'));var config=require(_0xa946('0x6'));var controller=require(_0xa946('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xa946('0x8')]);router[_0xa946('0x9')](_0xa946('0xa'),auth[_0xa946('0xb')](),controller[_0xa946('0xc')]);router[_0xa946('0x9')](_0xa946('0xd'),auth[_0xa946('0xb')](),timeout(_0xa946('0xe')),controller[_0xa946('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa946('0x10')]);router[_0xa946('0x11')](_0xa946('0xa'),auth[_0xa946('0xb')](),controller['update']);router['delete'](_0xa946('0xa'),auth[_0xa946('0xb')](),controller[_0xa946('0x12')]);module['exports']=router;
\ No newline at end of file
index 18356ae..498a355 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe321=['sequelize','exports','STRING','name'];(function(_0x381864,_0x3c770e){var _0x5372f4=function(_0x552193){while(--_0x552193){_0x381864['push'](_0x381864['shift']());}};_0x5372f4(++_0x3c770e);}(_0xe321,0x1d8));var _0x1e32=function(_0x522c30,_0x55d91c){_0x522c30=_0x522c30-0x0;var _0x10f547=_0xe321[_0x522c30];return _0x10f547;};'use strict';var Sequelize=require(_0x1e32('0x0'));module[_0x1e32('0x1')]={'name':{'type':Sequelize[_0x1e32('0x2')],'unique':_0x1e32('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x1e32('0x2')]},'description':{'type':Sequelize[_0x1e32('0x2')]}};
\ No newline at end of file
+var _0x889d=['name','sequelize','exports','STRING'];(function(_0x2167c4,_0x3f2467){var _0x424dd0=function(_0x1a09cb){while(--_0x1a09cb){_0x2167c4['push'](_0x2167c4['shift']());}};_0x424dd0(++_0x3f2467);}(_0x889d,0x8d));var _0xd889=function(_0x2a4e92,_0x4c19d6){_0x2a4e92=_0x2a4e92-0x0;var _0x5964ab=_0x889d[_0x2a4e92];return _0x5964ab;};'use strict';var Sequelize=require(_0xd889('0x0'));module[_0xd889('0x1')]={'name':{'type':Sequelize[_0xd889('0x2')],'unique':_0xd889('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0xd889('0x2')]},'description':{'type':Sequelize[_0xd889('0x2')]}};
\ No newline at end of file
index 7e2997b..1f57371 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca62=['SquareOdbc','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ODBC','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','map'];(function(_0x470cdd,_0x4708cd){var _0x57fda7=function(_0x171462){while(--_0x171462){_0x470cdd['push'](_0x470cdd['shift']());}};_0x57fda7(++_0x4708cd);}(_0xca62,0x1d8));var _0x2ca6=function(_0x2e4f3c,_0x51485f){_0x2e4f3c=_0x2e4f3c-0x0;var _0x4e4f2a=_0xca62[_0x2e4f3c];return _0x4e4f2a;};'use strict';var emlformat=require(_0x2ca6('0x0'));var rimraf=require(_0x2ca6('0x1'));var zipdir=require(_0x2ca6('0x2'));var jsonpatch=require(_0x2ca6('0x3'));var rp=require(_0x2ca6('0x4'));var moment=require(_0x2ca6('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2ca6('0x6'));var path=require(_0x2ca6('0x7'));var sox=require('sox');var csv=require(_0x2ca6('0x8'));var ejs=require(_0x2ca6('0x9'));var fs=require('fs');var fs_extra=require(_0x2ca6('0xa'));var _=require(_0x2ca6('0xb'));var squel=require(_0x2ca6('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2ca6('0x8'));var querystring=require('querystring');var Papa=require(_0x2ca6('0xd'));var Redis=require('ioredis');var authService=require(_0x2ca6('0xe'));var qs=require(_0x2ca6('0xf'));var as=require(_0x2ca6('0x10'));var hardwareService=require(_0x2ca6('0x11'));var logger=require('../../config/logger')(_0x2ca6('0x12'));var utils=require(_0x2ca6('0x13'));var config=require(_0x2ca6('0x14'));var licenseUtil=require(_0x2ca6('0x15'));var db=require(_0x2ca6('0x16'))['db'];function respondWithStatusCode(_0x28983f,_0x20df86){_0x20df86=_0x20df86||0xcc;return function(_0x3e26f4){if(_0x3e26f4){return _0x28983f['sendStatus'](_0x20df86);}return _0x28983f['status'](_0x20df86)['end']();};}function respondWithResult(_0x4bdcbd,_0x370724){_0x370724=_0x370724||0xc8;return function(_0x1f203a){if(_0x1f203a){return _0x4bdcbd[_0x2ca6('0x17')](_0x370724)['json'](_0x1f203a);}};}function respondWithFilteredResult(_0x35f837,_0x5c5922){return function(_0xec07be){if(_0xec07be){var _0x1637e0=typeof _0x5c5922['offset']===_0x2ca6('0x18')&&typeof _0x5c5922[_0x2ca6('0x19')]===_0x2ca6('0x18');var _0x24e22f=_0xec07be[_0x2ca6('0x1a')];var _0x4be586=_0x1637e0?0x0:_0x5c5922[_0x2ca6('0x1b')];var _0x1645bd=_0x1637e0?_0xec07be[_0x2ca6('0x1a')]:_0x5c5922[_0x2ca6('0x1b')]+_0x5c5922[_0x2ca6('0x19')];var _0x8ddc7c;if(_0x1645bd>=_0x24e22f){_0x1645bd=_0x24e22f;_0x8ddc7c=0xc8;}else{_0x8ddc7c=0xce;}_0x35f837[_0x2ca6('0x17')](_0x8ddc7c);return _0x35f837[_0x2ca6('0x1c')](_0x2ca6('0x1d'),_0x4be586+'-'+_0x1645bd+'/'+_0x24e22f)[_0x2ca6('0x1e')](_0xec07be);}return null;};}function patchUpdates(_0x327405){return function(_0x5f262f){try{jsonpatch[_0x2ca6('0x1f')](_0x5f262f,_0x327405,!![]);}catch(_0xc208de){return BPromise[_0x2ca6('0x20')](_0xc208de);}return _0x5f262f['save']();};}function saveUpdates(_0x2ee841,_0x3b30f0){return function(_0x116535){if(_0x116535){return _0x116535['update'](_0x2ee841)[_0x2ca6('0x21')](function(_0x56217c){return _0x56217c;});}return null;};}function removeEntity(_0x2dac7b,_0x5311fc){return function(_0x3a9a51){if(_0x3a9a51){return _0x3a9a51[_0x2ca6('0x22')]()[_0x2ca6('0x21')](function(){var _0x45f7dd=_0x3a9a51[_0x2ca6('0x23')]({'plain':!![]});var _0x480f8b='ODBC';return db[_0x2ca6('0x24')][_0x2ca6('0x22')]({'where':{'type':_0x480f8b,'resourceId':_0x45f7dd['id']}})['then'](function(){return _0x3a9a51;});})[_0x2ca6('0x21')](function(){_0x2dac7b[_0x2ca6('0x17')](0xcc)[_0x2ca6('0x25')]();});}};}function handleEntityNotFound(_0xb6d5a1,_0x523be6){return function(_0x5b6a8b){if(!_0x5b6a8b){_0xb6d5a1['sendStatus'](0x194);}return _0x5b6a8b;};}function handleError(_0x4eefe0,_0x247b60){_0x247b60=_0x247b60||0x1f4;return function(_0x399eaf){logger[_0x2ca6('0x26')](_0x399eaf[_0x2ca6('0x27')]);if(_0x399eaf['name']){delete _0x399eaf[_0x2ca6('0x28')];}_0x4eefe0['status'](_0x247b60)[_0x2ca6('0x29')](_0x399eaf);};}exports[_0x2ca6('0x2a')]=function(_0x153d50,_0x52f9d4){var _0x5c4a76={},_0x3279a0={},_0x941011={'count':0x0,'rows':[]};var _0x3252c0=_[_0x2ca6('0x2b')](db[_0x2ca6('0x2c')][_0x2ca6('0x2d')],function(_0x5f5890){return{'name':_0x5f5890[_0x2ca6('0x2e')],'type':_0x5f5890[_0x2ca6('0x2f')][_0x2ca6('0x30')]};});_0x3279a0[_0x2ca6('0x31')]=_[_0x2ca6('0x2b')](_0x3252c0,_0x2ca6('0x28'));_0x3279a0[_0x2ca6('0x32')]=_[_0x2ca6('0x33')](_0x153d50[_0x2ca6('0x32')]);_0x3279a0[_0x2ca6('0x34')]=_[_0x2ca6('0x35')](_0x3279a0['model'],_0x3279a0['query']);_0x5c4a76[_0x2ca6('0x36')]=_[_0x2ca6('0x35')](_0x3279a0[_0x2ca6('0x31')],qs['fields'](_0x153d50['query'][_0x2ca6('0x37')]));_0x5c4a76['attributes']=_0x5c4a76['attributes'][_0x2ca6('0x38')]?_0x5c4a76[_0x2ca6('0x36')]:_0x3279a0['model'];if(!_0x153d50[_0x2ca6('0x32')][_0x2ca6('0x39')](_0x2ca6('0x3a'))){_0x5c4a76[_0x2ca6('0x19')]=qs[_0x2ca6('0x19')](_0x153d50[_0x2ca6('0x32')][_0x2ca6('0x19')]);_0x5c4a76[_0x2ca6('0x1b')]=qs[_0x2ca6('0x1b')](_0x153d50[_0x2ca6('0x32')][_0x2ca6('0x1b')]);}_0x5c4a76[_0x2ca6('0x3b')]=qs[_0x2ca6('0x3c')](_0x153d50[_0x2ca6('0x32')][_0x2ca6('0x3c')]);_0x5c4a76[_0x2ca6('0x3d')]=qs[_0x2ca6('0x34')](_[_0x2ca6('0x3e')](_0x153d50[_0x2ca6('0x32')],_0x3279a0[_0x2ca6('0x34')]),_0x3252c0);if(_0x153d50[_0x2ca6('0x32')][_0x2ca6('0x3f')]){_0x5c4a76[_0x2ca6('0x3d')]=_[_0x2ca6('0x40')](_0x5c4a76[_0x2ca6('0x3d')],{'$or':_[_0x2ca6('0x2b')](_0x3252c0,function(_0x1a25c3){if(_0x1a25c3[_0x2ca6('0x2f')]!==_0x2ca6('0x41')){var _0x13bbdf={};_0x13bbdf[_0x1a25c3[_0x2ca6('0x28')]]={'$like':'%'+_0x153d50[_0x2ca6('0x32')][_0x2ca6('0x3f')]+'%'};return _0x13bbdf;}})});}_0x5c4a76=_[_0x2ca6('0x40')]({},_0x5c4a76,_0x153d50['options']);var _0x6531c0={'where':_0x5c4a76[_0x2ca6('0x3d')]};return db[_0x2ca6('0x2c')][_0x2ca6('0x1a')](_0x6531c0)[_0x2ca6('0x21')](function(_0x3627f9){_0x941011[_0x2ca6('0x1a')]=_0x3627f9;if(_0x153d50[_0x2ca6('0x32')]['includeAll']){_0x5c4a76[_0x2ca6('0x42')]=[{'all':!![]}];}return db[_0x2ca6('0x2c')][_0x2ca6('0x43')](_0x5c4a76);})['then'](function(_0x58942b){_0x941011['rows']=_0x58942b;return _0x941011;})[_0x2ca6('0x21')](respondWithFilteredResult(_0x52f9d4,_0x5c4a76))[_0x2ca6('0x44')](handleError(_0x52f9d4,null));};exports[_0x2ca6('0x45')]=function(_0x558e4c,_0x31a896){var _0x104d46={'raw':!![],'where':{'id':_0x558e4c[_0x2ca6('0x46')]['id']}},_0x1108e0={};_0x1108e0[_0x2ca6('0x31')]=_[_0x2ca6('0x33')](db[_0x2ca6('0x2c')][_0x2ca6('0x2d')]);_0x1108e0[_0x2ca6('0x32')]=_['keys'](_0x558e4c[_0x2ca6('0x32')]);_0x1108e0['filters']=_[_0x2ca6('0x35')](_0x1108e0[_0x2ca6('0x31')],_0x1108e0['query']);_0x104d46[_0x2ca6('0x36')]=_[_0x2ca6('0x35')](_0x1108e0[_0x2ca6('0x31')],qs[_0x2ca6('0x37')](_0x558e4c['query'][_0x2ca6('0x37')]));_0x104d46['attributes']=_0x104d46[_0x2ca6('0x36')]['length']?_0x104d46['attributes']:_0x1108e0[_0x2ca6('0x31')];if(_0x558e4c['query']['includeAll']){_0x104d46['include']=[{'all':!![]}];}_0x104d46=_[_0x2ca6('0x40')]({},_0x104d46,_0x558e4c['options']);return db['SquareOdbc'][_0x2ca6('0x47')](_0x104d46)[_0x2ca6('0x21')](handleEntityNotFound(_0x31a896,null))[_0x2ca6('0x21')](respondWithResult(_0x31a896,null))[_0x2ca6('0x44')](handleError(_0x31a896,null));};exports[_0x2ca6('0x48')]=function(_0x564cf2,_0x7620ee){return db['SquareOdbc'][_0x2ca6('0x48')](_0x564cf2[_0x2ca6('0x49')],{})[_0x2ca6('0x21')](function(_0x431bdf){var _0x41ef53=_0x564cf2[_0x2ca6('0x4a')][_0x2ca6('0x23')]({'plain':!![]});if(!_0x41ef53)throw new Error(_0x2ca6('0x4b'));if(_0x41ef53[_0x2ca6('0x4c')]===_0x2ca6('0x4a')){var _0xe72305=_0x431bdf['get']({'plain':!![]});var _0x475c0e=_0x2ca6('0x4d');return db[_0x2ca6('0x4e')][_0x2ca6('0x47')]({'where':{'name':_0x475c0e,'userProfileId':_0x41ef53[_0x2ca6('0x4f')]},'raw':!![]})[_0x2ca6('0x21')](function(_0x3b7a9f){if(_0x3b7a9f&&_0x3b7a9f['autoAssociation']===0x0){return db[_0x2ca6('0x24')][_0x2ca6('0x48')]({'name':_0xe72305['name'],'resourceId':_0xe72305['id'],'type':_0x3b7a9f['name'],'sectionId':_0x3b7a9f['id']},{})[_0x2ca6('0x21')](function(){return _0x431bdf;});}else{return _0x431bdf;}})[_0x2ca6('0x44')](function(_0x44f532){logger[_0x2ca6('0x26')](_0x2ca6('0x50'),_0x44f532);throw _0x44f532;});}return _0x431bdf;})['then'](respondWithResult(_0x7620ee,0xc9))['catch'](handleError(_0x7620ee,null));};exports['update']=function(_0x33b326,_0x43a7e7){if(_0x33b326[_0x2ca6('0x49')]['id']){delete _0x33b326[_0x2ca6('0x49')]['id'];}return db[_0x2ca6('0x2c')]['find']({'where':{'id':_0x33b326[_0x2ca6('0x46')]['id']}})[_0x2ca6('0x21')](handleEntityNotFound(_0x43a7e7,null))[_0x2ca6('0x21')](saveUpdates(_0x33b326['body'],null))[_0x2ca6('0x21')](respondWithResult(_0x43a7e7,null))[_0x2ca6('0x44')](handleError(_0x43a7e7,null));};exports['destroy']=function(_0x1fbf86,_0x5ab427){return db[_0x2ca6('0x2c')][_0x2ca6('0x47')]({'where':{'id':_0x1fbf86[_0x2ca6('0x46')]['id']}})['then'](handleEntityNotFound(_0x5ab427,null))[_0x2ca6('0x21')](removeEntity(_0x5ab427,null))[_0x2ca6('0x44')](handleError(_0x5ab427,null));};exports[_0x2ca6('0x51')]=function(_0xe628b1,_0x4b8231,_0x1b0dd9){var _0x4a0ace;return db['SquareOdbc'][_0x2ca6('0x47')]({'where':{'id':_0xe628b1[_0x2ca6('0x46')]['id']},'attributes':['id',_0x2ca6('0x52')]})[_0x2ca6('0x21')](handleEntityNotFound(_0x4b8231,null))[_0x2ca6('0x21')](function(_0x49cf75){if(_0x49cf75){var _0x2c9b52=require(_0x2ca6('0x53'))();_0x2c9b52[_0x2ca6('0x54')](_0x49cf75['dsn']);_0x2c9b52[_0x2ca6('0x55')]();return _0x49cf75;}})[_0x2ca6('0x21')](respondWithResult(_0x4b8231,null))[_0x2ca6('0x44')](handleError(_0x4b8231,null));};
\ No newline at end of file
+var _0xddb2=['end','json','offset','undefined','limit','count','Content-Range','reject','then','destroy','get','ODBC','UserProfileResource','stack','index','map','SquareOdbc','type','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','test','dsn','odbc','closeSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x30db36,_0x149fa8){var _0x3f8e3=function(_0x26cfa1){while(--_0x26cfa1){_0x30db36['push'](_0x30db36['shift']());}};_0x3f8e3(++_0x149fa8);}(_0xddb2,0x195));var _0x2ddb=function(_0x150497,_0x3e3412){_0x150497=_0x150497-0x0;var _0x1d057a=_0xddb2[_0x150497];return _0x1d057a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2ddb('0x0'));var zipdir=require(_0x2ddb('0x1'));var jsonpatch=require(_0x2ddb('0x2'));var rp=require(_0x2ddb('0x3'));var moment=require(_0x2ddb('0x4'));var BPromise=require(_0x2ddb('0x5'));var Mustache=require(_0x2ddb('0x6'));var util=require(_0x2ddb('0x7'));var path=require('path');var sox=require(_0x2ddb('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2ddb('0x9'));var _=require(_0x2ddb('0xa'));var squel=require(_0x2ddb('0xb'));var crypto=require(_0x2ddb('0xc'));var jsforce=require(_0x2ddb('0xd'));var deskjs=require(_0x2ddb('0xe'));var toCsv=require(_0x2ddb('0xf'));var querystring=require(_0x2ddb('0x10'));var Papa=require('papaparse');var Redis=require(_0x2ddb('0x11'));var authService=require(_0x2ddb('0x12'));var qs=require(_0x2ddb('0x13'));var as=require(_0x2ddb('0x14'));var hardwareService=require(_0x2ddb('0x15'));var logger=require(_0x2ddb('0x16'))(_0x2ddb('0x17'));var utils=require(_0x2ddb('0x18'));var config=require(_0x2ddb('0x19'));var licenseUtil=require(_0x2ddb('0x1a'));var db=require(_0x2ddb('0x1b'))['db'];function respondWithStatusCode(_0x28970b,_0x4af57c){_0x4af57c=_0x4af57c||0xcc;return function(_0x4a501f){if(_0x4a501f){return _0x28970b[_0x2ddb('0x1c')](_0x4af57c);}return _0x28970b[_0x2ddb('0x1d')](_0x4af57c)[_0x2ddb('0x1e')]();};}function respondWithResult(_0x187da8,_0x1e3f0f){_0x1e3f0f=_0x1e3f0f||0xc8;return function(_0x25f6d4){if(_0x25f6d4){return _0x187da8[_0x2ddb('0x1d')](_0x1e3f0f)[_0x2ddb('0x1f')](_0x25f6d4);}};}function respondWithFilteredResult(_0x505c09,_0x4410f3){return function(_0x2bde97){if(_0x2bde97){var _0x269402=typeof _0x4410f3[_0x2ddb('0x20')]===_0x2ddb('0x21')&&typeof _0x4410f3[_0x2ddb('0x22')]===_0x2ddb('0x21');var _0x19e3aa=_0x2bde97[_0x2ddb('0x23')];var _0x2f4d98=_0x269402?0x0:_0x4410f3['offset'];var _0xe7b7a7=_0x269402?_0x2bde97[_0x2ddb('0x23')]:_0x4410f3['offset']+_0x4410f3[_0x2ddb('0x22')];var _0x52c457;if(_0xe7b7a7>=_0x19e3aa){_0xe7b7a7=_0x19e3aa;_0x52c457=0xc8;}else{_0x52c457=0xce;}_0x505c09[_0x2ddb('0x1d')](_0x52c457);return _0x505c09['set'](_0x2ddb('0x24'),_0x2f4d98+'-'+_0xe7b7a7+'/'+_0x19e3aa)['json'](_0x2bde97);}return null;};}function patchUpdates(_0x292f4e){return function(_0x37bbc9){try{jsonpatch['apply'](_0x37bbc9,_0x292f4e,!![]);}catch(_0x525838){return BPromise[_0x2ddb('0x25')](_0x525838);}return _0x37bbc9['save']();};}function saveUpdates(_0x35dbd2,_0x26c45c){return function(_0x359d86){if(_0x359d86){return _0x359d86['update'](_0x35dbd2)[_0x2ddb('0x26')](function(_0x221f76){return _0x221f76;});}return null;};}function removeEntity(_0x56fe12,_0x49cf76){return function(_0x1febb){if(_0x1febb){return _0x1febb[_0x2ddb('0x27')]()[_0x2ddb('0x26')](function(){var _0x57626a=_0x1febb[_0x2ddb('0x28')]({'plain':!![]});var _0x4f9978=_0x2ddb('0x29');return db[_0x2ddb('0x2a')][_0x2ddb('0x27')]({'where':{'type':_0x4f9978,'resourceId':_0x57626a['id']}})['then'](function(){return _0x1febb;});})[_0x2ddb('0x26')](function(){_0x56fe12[_0x2ddb('0x1d')](0xcc)[_0x2ddb('0x1e')]();});}};}function handleEntityNotFound(_0xc868d2,_0x44847d){return function(_0x2944a9){if(!_0x2944a9){_0xc868d2[_0x2ddb('0x1c')](0x194);}return _0x2944a9;};}function handleError(_0x3d5170,_0x34fc1c){_0x34fc1c=_0x34fc1c||0x1f4;return function(_0xcbcadc){logger['error'](_0xcbcadc[_0x2ddb('0x2b')]);if(_0xcbcadc['name']){delete _0xcbcadc['name'];}_0x3d5170['status'](_0x34fc1c)['send'](_0xcbcadc);};}exports[_0x2ddb('0x2c')]=function(_0x276e37,_0x421af2){var _0x4e0010={},_0x3aea23={},_0x21b55f={'count':0x0,'rows':[]};var _0x34542b=_[_0x2ddb('0x2d')](db[_0x2ddb('0x2e')]['rawAttributes'],function(_0x37ecb4){return{'name':_0x37ecb4['fieldName'],'type':_0x37ecb4[_0x2ddb('0x2f')]['key']};});_0x3aea23[_0x2ddb('0x30')]=_[_0x2ddb('0x2d')](_0x34542b,_0x2ddb('0x31'));_0x3aea23[_0x2ddb('0x32')]=_[_0x2ddb('0x33')](_0x276e37[_0x2ddb('0x32')]);_0x3aea23[_0x2ddb('0x34')]=_[_0x2ddb('0x35')](_0x3aea23[_0x2ddb('0x30')],_0x3aea23['query']);_0x4e0010['attributes']=_[_0x2ddb('0x35')](_0x3aea23[_0x2ddb('0x30')],qs[_0x2ddb('0x36')](_0x276e37['query'][_0x2ddb('0x36')]));_0x4e0010['attributes']=_0x4e0010[_0x2ddb('0x37')][_0x2ddb('0x38')]?_0x4e0010['attributes']:_0x3aea23[_0x2ddb('0x30')];if(!_0x276e37[_0x2ddb('0x32')][_0x2ddb('0x39')](_0x2ddb('0x3a'))){_0x4e0010[_0x2ddb('0x22')]=qs[_0x2ddb('0x22')](_0x276e37[_0x2ddb('0x32')][_0x2ddb('0x22')]);_0x4e0010['offset']=qs['offset'](_0x276e37[_0x2ddb('0x32')][_0x2ddb('0x20')]);}_0x4e0010[_0x2ddb('0x3b')]=qs[_0x2ddb('0x3c')](_0x276e37['query']['sort']);_0x4e0010[_0x2ddb('0x3d')]=qs['filters'](_['pick'](_0x276e37[_0x2ddb('0x32')],_0x3aea23[_0x2ddb('0x34')]),_0x34542b);if(_0x276e37[_0x2ddb('0x32')][_0x2ddb('0x3e')]){_0x4e0010[_0x2ddb('0x3d')]=_['merge'](_0x4e0010[_0x2ddb('0x3d')],{'$or':_['map'](_0x34542b,function(_0x13775e){if(_0x13775e[_0x2ddb('0x2f')]!==_0x2ddb('0x3f')){var _0x4ff1b7={};_0x4ff1b7[_0x13775e[_0x2ddb('0x31')]]={'$like':'%'+_0x276e37[_0x2ddb('0x32')][_0x2ddb('0x3e')]+'%'};return _0x4ff1b7;}})});}_0x4e0010=_[_0x2ddb('0x40')]({},_0x4e0010,_0x276e37['options']);var _0x32e618={'where':_0x4e0010[_0x2ddb('0x3d')]};return db['SquareOdbc'][_0x2ddb('0x23')](_0x32e618)[_0x2ddb('0x26')](function(_0x52b9d5){_0x21b55f[_0x2ddb('0x23')]=_0x52b9d5;if(_0x276e37['query'][_0x2ddb('0x41')]){_0x4e0010[_0x2ddb('0x42')]=[{'all':!![]}];}return db[_0x2ddb('0x2e')][_0x2ddb('0x43')](_0x4e0010);})['then'](function(_0x4975c9){_0x21b55f[_0x2ddb('0x44')]=_0x4975c9;return _0x21b55f;})[_0x2ddb('0x26')](respondWithFilteredResult(_0x421af2,_0x4e0010))[_0x2ddb('0x45')](handleError(_0x421af2,null));};exports[_0x2ddb('0x46')]=function(_0x232caf,_0x3bbe5c){var _0x3698dc={'raw':!![],'where':{'id':_0x232caf['params']['id']}},_0x4ce024={};_0x4ce024[_0x2ddb('0x30')]=_[_0x2ddb('0x33')](db['SquareOdbc'][_0x2ddb('0x47')]);_0x4ce024['query']=_['keys'](_0x232caf[_0x2ddb('0x32')]);_0x4ce024[_0x2ddb('0x34')]=_['intersection'](_0x4ce024[_0x2ddb('0x30')],_0x4ce024[_0x2ddb('0x32')]);_0x3698dc[_0x2ddb('0x37')]=_['intersection'](_0x4ce024[_0x2ddb('0x30')],qs['fields'](_0x232caf[_0x2ddb('0x32')][_0x2ddb('0x36')]));_0x3698dc['attributes']=_0x3698dc[_0x2ddb('0x37')]['length']?_0x3698dc['attributes']:_0x4ce024[_0x2ddb('0x30')];if(_0x232caf[_0x2ddb('0x32')]['includeAll']){_0x3698dc[_0x2ddb('0x42')]=[{'all':!![]}];}_0x3698dc=_[_0x2ddb('0x40')]({},_0x3698dc,_0x232caf['options']);return db[_0x2ddb('0x2e')][_0x2ddb('0x48')](_0x3698dc)[_0x2ddb('0x26')](handleEntityNotFound(_0x3bbe5c,null))[_0x2ddb('0x26')](respondWithResult(_0x3bbe5c,null))[_0x2ddb('0x45')](handleError(_0x3bbe5c,null));};exports[_0x2ddb('0x49')]=function(_0x1c73b5,_0x326f9f){return db[_0x2ddb('0x2e')][_0x2ddb('0x49')](_0x1c73b5['body'],{})['then'](function(_0x8831ed){var _0x4fe152=_0x1c73b5[_0x2ddb('0x4a')][_0x2ddb('0x28')]({'plain':!![]});if(!_0x4fe152)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4fe152[_0x2ddb('0x4b')]===_0x2ddb('0x4a')){var _0x6169b0=_0x8831ed[_0x2ddb('0x28')]({'plain':!![]});var _0x416f97='ODBC';return db[_0x2ddb('0x4c')]['find']({'where':{'name':_0x416f97,'userProfileId':_0x4fe152[_0x2ddb('0x4d')]},'raw':!![]})[_0x2ddb('0x26')](function(_0x44153e){if(_0x44153e&&_0x44153e['autoAssociation']===0x0){return db[_0x2ddb('0x2a')][_0x2ddb('0x49')]({'name':_0x6169b0[_0x2ddb('0x31')],'resourceId':_0x6169b0['id'],'type':_0x44153e['name'],'sectionId':_0x44153e['id']},{})[_0x2ddb('0x26')](function(){return _0x8831ed;});}else{return _0x8831ed;}})['catch'](function(_0x1d86eb){logger[_0x2ddb('0x4e')](_0x2ddb('0x4f'),_0x1d86eb);throw _0x1d86eb;});}return _0x8831ed;})[_0x2ddb('0x26')](respondWithResult(_0x326f9f,0xc9))[_0x2ddb('0x45')](handleError(_0x326f9f,null));};exports[_0x2ddb('0x50')]=function(_0x112314,_0x3967d9){if(_0x112314[_0x2ddb('0x51')]['id']){delete _0x112314[_0x2ddb('0x51')]['id'];}return db[_0x2ddb('0x2e')][_0x2ddb('0x48')]({'where':{'id':_0x112314[_0x2ddb('0x52')]['id']}})[_0x2ddb('0x26')](handleEntityNotFound(_0x3967d9,null))[_0x2ddb('0x26')](saveUpdates(_0x112314[_0x2ddb('0x51')],null))[_0x2ddb('0x26')](respondWithResult(_0x3967d9,null))[_0x2ddb('0x45')](handleError(_0x3967d9,null));};exports[_0x2ddb('0x27')]=function(_0xf0b5ee,_0x10d80a){return db[_0x2ddb('0x2e')][_0x2ddb('0x48')]({'where':{'id':_0xf0b5ee[_0x2ddb('0x52')]['id']}})[_0x2ddb('0x26')](handleEntityNotFound(_0x10d80a,null))[_0x2ddb('0x26')](removeEntity(_0x10d80a,null))['catch'](handleError(_0x10d80a,null));};exports[_0x2ddb('0x53')]=function(_0x476d05,_0x862035,_0x5e3a06){var _0x56aa3f;return db[_0x2ddb('0x2e')][_0x2ddb('0x48')]({'where':{'id':_0x476d05[_0x2ddb('0x52')]['id']},'attributes':['id',_0x2ddb('0x54')]})['then'](handleEntityNotFound(_0x862035,null))[_0x2ddb('0x26')](function(_0x4e49bb){if(_0x4e49bb){var _0x11bbdb=require(_0x2ddb('0x55'))();_0x11bbdb['openSync'](_0x4e49bb[_0x2ddb('0x54')]);_0x11bbdb[_0x2ddb('0x56')]();return _0x4e49bb;}})[_0x2ddb('0x26')](respondWithResult(_0x862035,null))[_0x2ddb('0x45')](handleError(_0x862035,null));};
\ No newline at end of file
index 82fc1dd..b4d3cfe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0266=['util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./squareOdbc.attributes','exports','SquareOdbc'];(function(_0xe2ebaa,_0x138483){var _0x563838=function(_0x542a4c){while(--_0x542a4c){_0xe2ebaa['push'](_0xe2ebaa['shift']());}};_0x563838(++_0x138483);}(_0x0266,0x1ea));var _0x6026=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x0266[_0x1b2ff7];return _0x31656a;};'use strict';var _=require('lodash');var util=require(_0x6026('0x0'));var logger=require(_0x6026('0x1'))(_0x6026('0x2'));var moment=require('moment');var BPromise=require(_0x6026('0x3'));var rp=require(_0x6026('0x4'));var fs=require('fs');var path=require(_0x6026('0x5'));var rimraf=require('rimraf');var config=require(_0x6026('0x6'));var attributes=require(_0x6026('0x7'));module[_0x6026('0x8')]=function(_0x5a54de,_0x21151f){return _0x5a54de['define'](_0x6026('0x9'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf01e=['moment','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','util','../../config/logger'];(function(_0x390e5c,_0x8b8d52){var _0x2cd34a=function(_0x1774a4){while(--_0x1774a4){_0x390e5c['push'](_0x390e5c['shift']());}};_0x2cd34a(++_0x8b8d52);}(_0xf01e,0xd6));var _0xef01=function(_0x2eb3db,_0x4a32c0){_0x2eb3db=_0x2eb3db-0x0;var _0x358f33=_0xf01e[_0x2eb3db];return _0x358f33;};'use strict';var _=require('lodash');var util=require(_0xef01('0x0'));var logger=require(_0xef01('0x1'))('api');var moment=require(_0xef01('0x2'));var BPromise=require('bluebird');var rp=require(_0xef01('0x3'));var fs=require('fs');var path=require(_0xef01('0x4'));var rimraf=require(_0xef01('0x5'));var config=require(_0xef01('0x6'));var attributes=require(_0xef01('0x7'));module[_0xef01('0x8')]=function(_0x2d2829,_0x2c7e8f){return _0x2d2829[_0xef01('0x9')](_0xef01('0xa'),attributes,{'tableName':_0xef01('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ea89494..8d514e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6861=['attributes','include','map','model','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','request\x20sent','stringify','error','code','message','SquareOdbc,\x20%s,\x20%s','info','result','ShowSquareOdbc','SquareOdbc','find','options','where'];(function(_0x5c53ac,_0x2c7657){var _0x5a4e57=function(_0x5d27b4){while(--_0x5d27b4){_0x5c53ac['push'](_0x5c53ac['shift']());}};_0x5a4e57(++_0x2c7657);}(_0x6861,0x127));var _0x1686=function(_0x221dd6,_0xea61e8){_0x221dd6=_0x221dd6-0x0;var _0x37aba1=_0x6861[_0x221dd6];return _0x37aba1;};'use strict';var _=require(_0x1686('0x0'));var util=require('util');var moment=require(_0x1686('0x1'));var BPromise=require('bluebird');var rs=require(_0x1686('0x2'));var fs=require('fs');var Redis=require(_0x1686('0x3'));var db=require(_0x1686('0x4'))['db'];var utils=require(_0x1686('0x5'));var logger=require(_0x1686('0x6'))(_0x1686('0x7'));var config=require('../../config/environment');var jayson=require(_0x1686('0x8'));var client=jayson[_0x1686('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54f6aa,_0x4dbf4b,_0xcdd067){return new BPromise(function(_0x577b5d,_0x585753){return client[_0x1686('0xa')](_0x54f6aa,_0xcdd067)['then'](function(_0x47ae21){logger['info']('SquareOdbc,\x20%s,\x20%s',_0x4dbf4b,_0x1686('0xb'));logger['debug']('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x4dbf4b,'request\x20sent',JSON[_0x1686('0xc')](_0x47ae21));if(_0x47ae21[_0x1686('0xd')]){if(_0x47ae21[_0x1686('0xd')][_0x1686('0xe')]===0x1f4){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x4dbf4b,_0x47ae21[_0x1686('0xd')]['message']);return _0x585753(_0x47ae21['error'][_0x1686('0xf')]);}logger[_0x1686('0xd')](_0x1686('0x10'),_0x4dbf4b,_0x47ae21[_0x1686('0xd')][_0x1686('0xf')]);return _0x577b5d(_0x47ae21[_0x1686('0xd')][_0x1686('0xf')]);}else{logger[_0x1686('0x11')](_0x1686('0x10'),_0x4dbf4b,'request\x20sent');_0x577b5d(_0x47ae21[_0x1686('0x12')][_0x1686('0xf')]);}})['catch'](function(_0x40f716){logger[_0x1686('0xd')](_0x1686('0x10'),_0x4dbf4b,_0x40f716);_0x585753(_0x40f716);});});}exports[_0x1686('0x13')]=function(_0x25af5c){var _0x3d55d1=this;return new Promise(function(_0x2f7b02,_0x3dc903){return db[_0x1686('0x14')][_0x1686('0x15')]({'raw':_0x25af5c[_0x1686('0x16')]?_0x25af5c[_0x1686('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x25af5c['options']?_0x25af5c[_0x1686('0x16')][_0x1686('0x17')]||null:null,'attributes':_0x25af5c[_0x1686('0x16')]?_0x25af5c['options'][_0x1686('0x18')]||null:null,'include':_0x25af5c[_0x1686('0x16')]?_0x25af5c['options'][_0x1686('0x19')]?_[_0x1686('0x1a')](_0x25af5c['options'][_0x1686('0x19')],function(_0x53d935){return{'model':db[_0x53d935[_0x1686('0x1b')]],'as':_0x53d935['as'],'attributes':_0x53d935['attributes'],'include':_0x53d935[_0x1686('0x19')]?_['map'](_0x53d935[_0x1686('0x19')],function(_0x12b473){return{'model':db[_0x12b473[_0x1686('0x1b')]],'as':_0x12b473['as'],'attributes':_0x12b473[_0x1686('0x18')],'include':_0x12b473[_0x1686('0x19')]?_[_0x1686('0x1a')](_0x12b473[_0x1686('0x19')],function(_0x57b685){return{'model':db[_0x57b685[_0x1686('0x1b')]],'as':_0x57b685['as'],'attributes':_0x57b685[_0x1686('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x252547){logger[_0x1686('0x11')](_0x1686('0x13'),_0x25af5c);logger['debug'](_0x1686('0x13'),_0x25af5c,JSON[_0x1686('0xc')](_0x252547));_0x2f7b02(_0x252547);})[_0x1686('0x1c')](function(_0x19c3e6){logger[_0x1686('0xd')]('ShowSquareOdbc',_0x19c3e6[_0x1686('0xf')],_0x25af5c);_0x3dc903(_0x3d55d1['error'](0x1f4,_0x19c3e6['message']));});});};
\ No newline at end of file
+var _0x84aa=['options','where','attributes','map','include','model','then','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','request\x20sent','debug','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','info','result','ShowSquareOdbc','find'];(function(_0x46becd,_0xd3cf52){var _0x4ebe1d=function(_0x49963a){while(--_0x49963a){_0x46becd['push'](_0x46becd['shift']());}};_0x4ebe1d(++_0xd3cf52);}(_0x84aa,0xc8));var _0xa84a=function(_0x34babd,_0x5f1cba){_0x34babd=_0x34babd-0x0;var _0x9faa8a=_0x84aa[_0x34babd];return _0x9faa8a;};'use strict';var _=require(_0xa84a('0x0'));var util=require(_0xa84a('0x1'));var moment=require('moment');var BPromise=require(_0xa84a('0x2'));var rs=require(_0xa84a('0x3'));var fs=require('fs');var Redis=require(_0xa84a('0x4'));var db=require(_0xa84a('0x5'))['db'];var utils=require(_0xa84a('0x6'));var logger=require(_0xa84a('0x7'))(_0xa84a('0x8'));var config=require(_0xa84a('0x9'));var jayson=require(_0xa84a('0xa'));var client=jayson[_0xa84a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e75ec,_0x38f783,_0x2e37d4){return new BPromise(function(_0x33499d,_0x5739ad){return client[_0xa84a('0xc')](_0x3e75ec,_0x2e37d4)['then'](function(_0x595361){logger['info']('SquareOdbc,\x20%s,\x20%s',_0x38f783,_0xa84a('0xd'));logger[_0xa84a('0xe')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x38f783,_0xa84a('0xd'),JSON[_0xa84a('0xf')](_0x595361));if(_0x595361['error']){if(_0x595361[_0xa84a('0x10')][_0xa84a('0x11')]===0x1f4){logger[_0xa84a('0x10')](_0xa84a('0x12'),_0x38f783,_0x595361[_0xa84a('0x10')][_0xa84a('0x13')]);return _0x5739ad(_0x595361['error'][_0xa84a('0x13')]);}logger['error'](_0xa84a('0x12'),_0x38f783,_0x595361['error'][_0xa84a('0x13')]);return _0x33499d(_0x595361[_0xa84a('0x10')][_0xa84a('0x13')]);}else{logger[_0xa84a('0x14')](_0xa84a('0x12'),_0x38f783,_0xa84a('0xd'));_0x33499d(_0x595361[_0xa84a('0x15')][_0xa84a('0x13')]);}})['catch'](function(_0x15e0f7){logger[_0xa84a('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x38f783,_0x15e0f7);_0x5739ad(_0x15e0f7);});});}exports[_0xa84a('0x16')]=function(_0x5f5dc5){var _0xddc002=this;return new Promise(function(_0x5c4887,_0x5a99ac){return db['SquareOdbc'][_0xa84a('0x17')]({'raw':_0x5f5dc5[_0xa84a('0x18')]?_0x5f5dc5[_0xa84a('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5f5dc5[_0xa84a('0x18')]?_0x5f5dc5['options'][_0xa84a('0x19')]||null:null,'attributes':_0x5f5dc5['options']?_0x5f5dc5[_0xa84a('0x18')][_0xa84a('0x1a')]||null:null,'include':_0x5f5dc5[_0xa84a('0x18')]?_0x5f5dc5[_0xa84a('0x18')]['include']?_[_0xa84a('0x1b')](_0x5f5dc5[_0xa84a('0x18')][_0xa84a('0x1c')],function(_0x750cdc){return{'model':db[_0x750cdc[_0xa84a('0x1d')]],'as':_0x750cdc['as'],'attributes':_0x750cdc['attributes'],'include':_0x750cdc[_0xa84a('0x1c')]?_[_0xa84a('0x1b')](_0x750cdc[_0xa84a('0x1c')],function(_0x563290){return{'model':db[_0x563290[_0xa84a('0x1d')]],'as':_0x563290['as'],'attributes':_0x563290[_0xa84a('0x1a')],'include':_0x563290[_0xa84a('0x1c')]?_['map'](_0x563290[_0xa84a('0x1c')],function(_0x400986){return{'model':db[_0x400986[_0xa84a('0x1d')]],'as':_0x400986['as'],'attributes':_0x400986[_0xa84a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa84a('0x1e')](function(_0x274d7d){logger[_0xa84a('0x14')]('ShowSquareOdbc',_0x5f5dc5);logger[_0xa84a('0xe')](_0xa84a('0x16'),_0x5f5dc5,JSON[_0xa84a('0xf')](_0x274d7d));_0x5c4887(_0x274d7d);})[_0xa84a('0x1f')](function(_0x2a7f97){logger[_0xa84a('0x10')](_0xa84a('0x16'),_0x2a7f97[_0xa84a('0x13')],_0x5f5dc5);_0x5a99ac(_0xddc002[_0xa84a('0x10')](0x1f4,_0x2a7f97[_0xa84a('0x13')]));});});};
\ No newline at end of file
index 69fd7fb..b37d7bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6d7=['/:id','show','/:id/users','getUsers','create','post','addUsers','put','update','delete','destroy','removeUsers','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index'];(function(_0x148d86,_0x4b2c19){var _0x2ab9e5=function(_0xa0e631){while(--_0xa0e631){_0x148d86['push'](_0x148d86['shift']());}};_0x2ab9e5(++_0x4b2c19);}(_0xc6d7,0x71));var _0x7c6d=function(_0x494390,_0x388e12){_0x494390=_0x494390-0x0;var _0x902cf9=_0xc6d7[_0x494390];return _0x902cf9;};'use strict';var multer=require(_0x7c6d('0x0'));var util=require(_0x7c6d('0x1'));var path=require(_0x7c6d('0x2'));var timeout=require(_0x7c6d('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7c6d('0x4'));var auth=require(_0x7c6d('0x5'));var interaction=require(_0x7c6d('0x6'));var config=require(_0x7c6d('0x7'));var controller=require(_0x7c6d('0x8'));router[_0x7c6d('0x9')]('/',auth[_0x7c6d('0xa')](),controller[_0x7c6d('0xb')]);router[_0x7c6d('0x9')](_0x7c6d('0xc'),auth[_0x7c6d('0xa')](),controller[_0x7c6d('0xd')]);router[_0x7c6d('0x9')](_0x7c6d('0xe'),auth['isAuthenticated'](),controller[_0x7c6d('0xf')]);router['post']('/',auth[_0x7c6d('0xa')](),controller[_0x7c6d('0x10')]);router[_0x7c6d('0x11')](_0x7c6d('0xe'),auth['isAuthenticated'](),controller[_0x7c6d('0x12')]);router[_0x7c6d('0x13')](_0x7c6d('0xc'),auth[_0x7c6d('0xa')](),controller[_0x7c6d('0x14')]);router[_0x7c6d('0x15')](_0x7c6d('0xc'),auth['isAuthenticated'](),controller[_0x7c6d('0x16')]);router[_0x7c6d('0x15')](_0x7c6d('0xe'),auth[_0x7c6d('0xa')](),controller[_0x7c6d('0x17')]);module[_0x7c6d('0x18')]=router;
\ No newline at end of file
+var _0xca73=['/:id','show','/:id/users','getUsers','post','addUsers','put','update','delete','destroy','removeUsers','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated'];(function(_0x45094e,_0xe85c5a){var _0x4a8e9f=function(_0x2fb2f0){while(--_0x2fb2f0){_0x45094e['push'](_0x45094e['shift']());}};_0x4a8e9f(++_0xe85c5a);}(_0xca73,0x1ee));var _0x3ca7=function(_0x1b1e67,_0x16b059){_0x1b1e67=_0x1b1e67-0x0;var _0x5b63d2=_0xca73[_0x1b1e67];return _0x5b63d2;};'use strict';var multer=require(_0x3ca7('0x0'));var util=require(_0x3ca7('0x1'));var path=require('path');var timeout=require(_0x3ca7('0x2'));var express=require(_0x3ca7('0x3'));var router=express[_0x3ca7('0x4')]();var fs_extra=require(_0x3ca7('0x5'));var auth=require(_0x3ca7('0x6'));var interaction=require(_0x3ca7('0x7'));var config=require(_0x3ca7('0x8'));var controller=require(_0x3ca7('0x9'));router[_0x3ca7('0xa')]('/',auth[_0x3ca7('0xb')](),controller['index']);router[_0x3ca7('0xa')](_0x3ca7('0xc'),auth[_0x3ca7('0xb')](),controller[_0x3ca7('0xd')]);router[_0x3ca7('0xa')](_0x3ca7('0xe'),auth['isAuthenticated'](),controller[_0x3ca7('0xf')]);router[_0x3ca7('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3ca7('0x10')](_0x3ca7('0xe'),auth[_0x3ca7('0xb')](),controller[_0x3ca7('0x11')]);router[_0x3ca7('0x12')](_0x3ca7('0xc'),auth[_0x3ca7('0xb')](),controller[_0x3ca7('0x13')]);router[_0x3ca7('0x14')](_0x3ca7('0xc'),auth[_0x3ca7('0xb')](),controller[_0x3ca7('0x15')]);router[_0x3ca7('0x14')]('/:id/users',auth[_0x3ca7('0xb')](),controller[_0x3ca7('0x16')]);module['exports']=router;
\ No newline at end of file
index f9e6692..2e97a81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec2b=['long','getDataValue','preproduction','toString','utf8','production','STRING','name','TEXT','BLOB'];(function(_0x1911ed,_0x4e8c73){var _0x11edaa=function(_0x216008){while(--_0x216008){_0x1911ed['push'](_0x1911ed['shift']());}};_0x11edaa(++_0x4e8c73);}(_0xec2b,0x1e6));var _0xbec2=function(_0x3e3f82,_0x535ba1){_0x3e3f82=_0x3e3f82-0x0;var _0x1b02dc=_0xec2b[_0x3e3f82];return _0x1b02dc;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xbec2('0x0')],'unique':_0xbec2('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0xbec2('0x0')]},'notes':{'type':Sequelize[_0xbec2('0x2')]},'preproduction':{'type':Sequelize[_0xbec2('0x3')](_0xbec2('0x4')),'get':function(){if(this[_0xbec2('0x5')](_0xbec2('0x6'))){return this[_0xbec2('0x5')](_0xbec2('0x6'))[_0xbec2('0x7')](_0xbec2('0x8'));}}},'production':{'type':Sequelize[_0xbec2('0x3')](_0xbec2('0x4')),'get':function(){if(this[_0xbec2('0x5')](_0xbec2('0x9'))){return this[_0xbec2('0x5')](_0xbec2('0x9'))[_0xbec2('0x7')](_0xbec2('0x8'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
+var _0x43d9=['name','STRING','BLOB','preproduction','getDataValue','toString','utf8','long','production','DATE','sequelize','exports'];(function(_0x216c8b,_0x7ab61){var _0xbc362c=function(_0x27418b){while(--_0x27418b){_0x216c8b['push'](_0x216c8b['shift']());}};_0xbc362c(++_0x7ab61);}(_0x43d9,0x17e));var _0x943d=function(_0x42be41,_0x108a41){_0x42be41=_0x42be41-0x0;var _0x23cc4a=_0x43d9[_0x42be41];return _0x23cc4a;};'use strict';var Sequelize=require(_0x943d('0x0'));module[_0x943d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x943d('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x943d('0x3')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x943d('0x4')]('long'),'get':function(){if(this['getDataValue'](_0x943d('0x5'))){return this[_0x943d('0x6')](_0x943d('0x5'))[_0x943d('0x7')](_0x943d('0x8'));}}},'production':{'type':Sequelize[_0x943d('0x4')](_0x943d('0x9')),'get':function(){if(this[_0x943d('0x6')](_0x943d('0xa'))){return this[_0x943d('0x6')]('production')['toString']('utf8');}}},'savedAt':{'type':Sequelize[_0x943d('0xb')]},'publishedAt':{'type':Sequelize[_0x943d('0xb')]}};
\ No newline at end of file
index 92577b2..cd032ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x666f=['emit','userSquareProject:remove','getUsers','User','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','SquareProjects','UserProfileResource','sendStatus','error','stack','name','send','map','SquareProject','rawAttributes','type','key','keys','filters','intersection','model','query','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','fields','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','update','body','addUsers','ids','omit','removeUsers'];(function(_0x460956,_0x1d613d){var _0x3b99e6=function(_0x2d4419){while(--_0x2d4419){_0x460956['push'](_0x460956['shift']());}};_0x3b99e6(++_0x1d613d);}(_0x666f,0x64));var _0xf666=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x666f[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf666('0x0'));var zipdir=require(_0xf666('0x1'));var jsonpatch=require(_0xf666('0x2'));var rp=require('request-promise');var moment=require(_0xf666('0x3'));var BPromise=require(_0xf666('0x4'));var Mustache=require(_0xf666('0x5'));var util=require(_0xf666('0x6'));var path=require('path');var sox=require(_0xf666('0x7'));var csv=require(_0xf666('0x8'));var ejs=require(_0xf666('0x9'));var fs=require('fs');var fs_extra=require(_0xf666('0xa'));var _=require(_0xf666('0xb'));var squel=require(_0xf666('0xc'));var crypto=require(_0xf666('0xd'));var jsforce=require(_0xf666('0xe'));var deskjs=require(_0xf666('0xf'));var toCsv=require(_0xf666('0x8'));var querystring=require(_0xf666('0x10'));var Papa=require(_0xf666('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf666('0x12'));var as=require(_0xf666('0x13'));var hardwareService=require(_0xf666('0x14'));var logger=require(_0xf666('0x15'))(_0xf666('0x16'));var utils=require(_0xf666('0x17'));var config=require(_0xf666('0x18'));var licenseUtil=require(_0xf666('0x19'));var db=require(_0xf666('0x1a'))['db'];config[_0xf666('0x1b')]=_['defaults'](config[_0xf666('0x1b')],{'host':_0xf666('0x1c'),'port':0x18eb});var socket=require(_0xf666('0x1d'))(new Redis(config[_0xf666('0x1b')]));require('./squareProject.socket')['register'](socket);function respondWithStatusCode(_0x1e65a7,_0x2d0892){_0x2d0892=_0x2d0892||0xcc;return function(_0x120278){if(_0x120278){return _0x1e65a7['sendStatus'](_0x2d0892);}return _0x1e65a7[_0xf666('0x1e')](_0x2d0892)[_0xf666('0x1f')]();};}function respondWithResult(_0xd281ca,_0x4fd94c){_0x4fd94c=_0x4fd94c||0xc8;return function(_0x15f6de){if(_0x15f6de){return _0xd281ca[_0xf666('0x1e')](_0x4fd94c)['json'](_0x15f6de);}};}function respondWithFilteredResult(_0x57a7df,_0x46dfe4){return function(_0x4e2096){if(_0x4e2096){var _0x1f27ae=typeof _0x46dfe4[_0xf666('0x20')]===_0xf666('0x21')&&typeof _0x46dfe4['limit']===_0xf666('0x21');var _0x41223f=_0x4e2096[_0xf666('0x22')];var _0x535107=_0x1f27ae?0x0:_0x46dfe4[_0xf666('0x20')];var _0x310356=_0x1f27ae?_0x4e2096[_0xf666('0x22')]:_0x46dfe4[_0xf666('0x20')]+_0x46dfe4[_0xf666('0x23')];var _0x8e909d;if(_0x310356>=_0x41223f){_0x310356=_0x41223f;_0x8e909d=0xc8;}else{_0x8e909d=0xce;}_0x57a7df[_0xf666('0x1e')](_0x8e909d);return _0x57a7df[_0xf666('0x24')](_0xf666('0x25'),_0x535107+'-'+_0x310356+'/'+_0x41223f)['json'](_0x4e2096);}return null;};}function patchUpdates(_0x4cf02b){return function(_0xe471ce){try{jsonpatch[_0xf666('0x26')](_0xe471ce,_0x4cf02b,!![]);}catch(_0x5d8dde){return BPromise[_0xf666('0x27')](_0x5d8dde);}return _0xe471ce[_0xf666('0x28')]();};}function saveUpdates(_0x1417ac,_0xf93710){return function(_0x4f1823){if(_0x4f1823){return _0x4f1823['update'](_0x1417ac)[_0xf666('0x29')](function(_0x258cb3){return _0x258cb3;});}return null;};}function removeEntity(_0x1d6084,_0x4e0825){return function(_0x4e24ad){if(_0x4e24ad){return _0x4e24ad[_0xf666('0x2a')]()[_0xf666('0x29')](function(){var _0xdbde5a=_0x4e24ad[_0xf666('0x2b')]({'plain':!![]});var _0x154175=_0xf666('0x2c');return db[_0xf666('0x2d')]['destroy']({'where':{'type':_0x154175,'resourceId':_0xdbde5a['id']}})[_0xf666('0x29')](function(){return _0x4e24ad;});})[_0xf666('0x29')](function(){_0x1d6084[_0xf666('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e6cce,_0x1751da){return function(_0x23a443){if(!_0x23a443){_0x1e6cce[_0xf666('0x2e')](0x194);}return _0x23a443;};}function handleError(_0x1eca78,_0x1e0432){_0x1e0432=_0x1e0432||0x1f4;return function(_0x79b2e4){logger[_0xf666('0x2f')](_0x79b2e4[_0xf666('0x30')]);if(_0x79b2e4[_0xf666('0x31')]){delete _0x79b2e4[_0xf666('0x31')];}_0x1eca78[_0xf666('0x1e')](_0x1e0432)[_0xf666('0x32')](_0x79b2e4);};}exports['index']=function(_0x17e71c,_0x44cee5){var _0x5003a9={},_0x59b363={},_0xd361aa={'count':0x0,'rows':[]};var _0x4fa7db=_[_0xf666('0x33')](db[_0xf666('0x34')][_0xf666('0x35')],function(_0x5a8d4b){return{'name':_0x5a8d4b['fieldName'],'type':_0x5a8d4b[_0xf666('0x36')][_0xf666('0x37')]};});_0x59b363['model']=_['map'](_0x4fa7db,_0xf666('0x31'));_0x59b363['query']=_[_0xf666('0x38')](_0x17e71c['query']);_0x59b363[_0xf666('0x39')]=_[_0xf666('0x3a')](_0x59b363[_0xf666('0x3b')],_0x59b363[_0xf666('0x3c')]);_0x5003a9[_0xf666('0x3d')]=_[_0xf666('0x3a')](_0x59b363[_0xf666('0x3b')],qs['fields'](_0x17e71c[_0xf666('0x3c')]['fields']));_0x5003a9['attributes']=_0x5003a9[_0xf666('0x3d')][_0xf666('0x3e')]?_0x5003a9['attributes']:_0x59b363[_0xf666('0x3b')];if(!_0x17e71c[_0xf666('0x3c')][_0xf666('0x3f')](_0xf666('0x40'))){_0x5003a9['limit']=qs['limit'](_0x17e71c[_0xf666('0x3c')][_0xf666('0x23')]);_0x5003a9[_0xf666('0x20')]=qs[_0xf666('0x20')](_0x17e71c[_0xf666('0x3c')][_0xf666('0x20')]);}_0x5003a9['order']=qs[_0xf666('0x41')](_0x17e71c[_0xf666('0x3c')]['sort']);_0x5003a9[_0xf666('0x42')]=qs[_0xf666('0x39')](_[_0xf666('0x43')](_0x17e71c[_0xf666('0x3c')],_0x59b363['filters']),_0x4fa7db);if(_0x17e71c['query'][_0xf666('0x44')]){_0x5003a9[_0xf666('0x42')]=_[_0xf666('0x45')](_0x5003a9[_0xf666('0x42')],{'$or':_[_0xf666('0x33')](_0x4fa7db,function(_0x3cf628){if(_0x3cf628['type']!=='VIRTUAL'){var _0x42cd6e={};_0x42cd6e[_0x3cf628[_0xf666('0x31')]]={'$like':'%'+_0x17e71c['query'][_0xf666('0x44')]+'%'};return _0x42cd6e;}})});}_0x5003a9=_[_0xf666('0x45')]({},_0x5003a9,_0x17e71c[_0xf666('0x46')]);var _0x41c70b={'where':_0x5003a9['where']};return db['SquareProject'][_0xf666('0x22')](_0x41c70b)[_0xf666('0x29')](function(_0x10cf92){_0xd361aa[_0xf666('0x22')]=_0x10cf92;if(_0x17e71c['query'][_0xf666('0x47')]){_0x5003a9['include']=[{'all':!![]}];}return db[_0xf666('0x34')][_0xf666('0x48')](_0x5003a9);})[_0xf666('0x29')](function(_0x31aa8e){_0xd361aa[_0xf666('0x49')]=_0x31aa8e;return _0xd361aa;})[_0xf666('0x29')](respondWithFilteredResult(_0x44cee5,_0x5003a9))[_0xf666('0x4a')](handleError(_0x44cee5,null));};exports[_0xf666('0x4b')]=function(_0x7e53a1,_0x30d0d6){var _0x3702e2={'raw':![],'where':{'id':_0x7e53a1[_0xf666('0x4c')]['id']}},_0x351cdf={};_0x351cdf[_0xf666('0x3b')]=_[_0xf666('0x38')](db['SquareProject'][_0xf666('0x35')]);_0x351cdf['query']=_[_0xf666('0x38')](_0x7e53a1['query']);_0x351cdf['filters']=_[_0xf666('0x3a')](_0x351cdf[_0xf666('0x3b')],_0x351cdf[_0xf666('0x3c')]);_0x3702e2[_0xf666('0x3d')]=_[_0xf666('0x3a')](_0x351cdf[_0xf666('0x3b')],qs[_0xf666('0x4d')](_0x7e53a1[_0xf666('0x3c')]['fields']));_0x3702e2[_0xf666('0x3d')]=_0x3702e2[_0xf666('0x3d')]['length']?_0x3702e2[_0xf666('0x3d')]:_0x351cdf[_0xf666('0x3b')];if(_0x7e53a1[_0xf666('0x3c')]['includeAll']){_0x3702e2[_0xf666('0x4e')]=[{'all':!![]}];}_0x3702e2=_[_0xf666('0x45')]({},_0x3702e2,_0x7e53a1[_0xf666('0x46')]);return db[_0xf666('0x34')][_0xf666('0x4f')](_0x3702e2)['then'](handleEntityNotFound(_0x30d0d6,null))[_0xf666('0x29')](respondWithResult(_0x30d0d6,null))[_0xf666('0x4a')](handleError(_0x30d0d6,null));};exports['create']=function(_0x423c75,_0xcf6f01){return db[_0xf666('0x34')][_0xf666('0x50')](_0x423c75['body'],{})['then'](function(_0x45df2d){var _0x12444c=_0x423c75['user'][_0xf666('0x2b')]({'plain':!![]});if(!_0x12444c)throw new Error(_0xf666('0x51'));if(_0x12444c['role']===_0xf666('0x52')){var _0x233a5e=_0x45df2d['get']({'plain':!![]});var _0x511d8a=_0xf666('0x2c');return db[_0xf666('0x53')]['find']({'where':{'name':_0x511d8a,'userProfileId':_0x12444c[_0xf666('0x54')]},'raw':!![]})[_0xf666('0x29')](function(_0x33af70){if(_0x33af70&&_0x33af70[_0xf666('0x55')]===0x0){return db['UserProfileResource'][_0xf666('0x50')]({'name':_0x233a5e[_0xf666('0x31')],'resourceId':_0x233a5e['id'],'type':_0x33af70[_0xf666('0x31')],'sectionId':_0x33af70['id']},{})[_0xf666('0x29')](function(){return _0x45df2d;});}else{return _0x45df2d;}})[_0xf666('0x4a')](function(_0x28e064){logger[_0xf666('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x28e064);throw _0x28e064;});}return _0x45df2d;})[_0xf666('0x29')](respondWithResult(_0xcf6f01,0xc9))[_0xf666('0x4a')](handleError(_0xcf6f01,null));};exports[_0xf666('0x56')]=function(_0x2f89b1,_0x545dda){if(_0x2f89b1[_0xf666('0x57')]['id']){delete _0x2f89b1[_0xf666('0x57')]['id'];}return db[_0xf666('0x34')]['find']({'where':{'id':_0x2f89b1[_0xf666('0x4c')]['id']}})[_0xf666('0x29')](handleEntityNotFound(_0x545dda,null))[_0xf666('0x29')](saveUpdates(_0x2f89b1[_0xf666('0x57')],null))[_0xf666('0x29')](respondWithResult(_0x545dda,null))[_0xf666('0x4a')](handleError(_0x545dda,null));};exports[_0xf666('0x2a')]=function(_0x2c0e5d,_0x3e11a6){return db[_0xf666('0x34')][_0xf666('0x4f')]({'where':{'id':_0x2c0e5d[_0xf666('0x4c')]['id']}})[_0xf666('0x29')](handleEntityNotFound(_0x3e11a6,null))['then'](removeEntity(_0x3e11a6,null))[_0xf666('0x4a')](handleError(_0x3e11a6,null));};exports[_0xf666('0x58')]=function(_0x27dc47,_0x1d3fb5,_0x3330ee){return db['SquareProject'][_0xf666('0x4f')]({'where':{'id':_0x27dc47[_0xf666('0x4c')]['id']}})[_0xf666('0x29')](handleEntityNotFound(_0x1d3fb5,null))[_0xf666('0x29')](function(_0x4ee3ed){if(_0x4ee3ed){return _0x4ee3ed[_0xf666('0x58')](_0x27dc47[_0xf666('0x57')][_0xf666('0x59')],_[_0xf666('0x5a')](_0x27dc47['body'],[_0xf666('0x59'),'id'])||{});}})[_0xf666('0x29')](respondWithResult(_0x1d3fb5,null))[_0xf666('0x4a')](handleError(_0x1d3fb5,null));};exports[_0xf666('0x5b')]=function(_0x1fec58,_0x2553f2,_0x4feefe){return db[_0xf666('0x34')][_0xf666('0x4f')]({'where':{'id':_0x1fec58[_0xf666('0x4c')]['id']}})[_0xf666('0x29')](handleEntityNotFound(_0x2553f2,null))[_0xf666('0x29')](function(_0x32d46b){if(_0x32d46b){return _0x32d46b[_0xf666('0x5b')](_0x1fec58[_0xf666('0x3c')][_0xf666('0x59')])[_0xf666('0x29')](function(){if(_['isArray'](_0x1fec58[_0xf666('0x3c')][_0xf666('0x59')])){for(var _0x35c9e4=0x0;_0x35c9e4<_0x1fec58['query'][_0xf666('0x59')][_0xf666('0x3e')];_0x35c9e4+=0x1){socket[_0xf666('0x5c')](_0xf666('0x5d'),{'UserId':Number(_0x1fec58['query'][_0xf666('0x59')][_0x35c9e4]),'SquareProjectId':Number(_0x1fec58['params']['id'])});}}else{socket[_0xf666('0x5c')]('userSquareProject:remove',{'UserId':Number(_0x1fec58[_0xf666('0x3c')][_0xf666('0x59')]),'SquareProjectId':Number(_0x1fec58[_0xf666('0x4c')]['id'])});}});}})[_0xf666('0x29')](respondWithStatusCode(_0x2553f2,null))[_0xf666('0x4a')](handleError(_0x2553f2,null));};exports[_0xf666('0x5e')]=function(_0x1acaab,_0x4decf6,_0xd57256){var _0x68c0a5={};var _0x2eb705={};var _0x2ebdbb;var _0x8c5318;return db[_0xf666('0x34')]['findOne']({'where':{'id':_0x1acaab[_0xf666('0x4c')]['id']}})[_0xf666('0x29')](handleEntityNotFound(_0x4decf6,null))[_0xf666('0x29')](function(_0x78fa36){if(_0x78fa36){_0x2ebdbb=_0x78fa36;_0x2eb705[_0xf666('0x3b')]=_[_0xf666('0x38')](db[_0xf666('0x5f')][_0xf666('0x35')]);_0x2eb705[_0xf666('0x3c')]=_[_0xf666('0x38')](_0x1acaab['query']);_0x2eb705[_0xf666('0x39')]=_['intersection'](_0x2eb705[_0xf666('0x3b')],_0x2eb705[_0xf666('0x3c')]);_0x68c0a5[_0xf666('0x3d')]=_[_0xf666('0x3a')](_0x2eb705[_0xf666('0x3b')],qs[_0xf666('0x4d')](_0x1acaab['query'][_0xf666('0x4d')]));_0x68c0a5[_0xf666('0x3d')]=_0x68c0a5[_0xf666('0x3d')]['length']?_0x68c0a5['attributes']:_0x2eb705[_0xf666('0x3b')];_0x68c0a5['order']=qs['sort'](_0x1acaab[_0xf666('0x3c')][_0xf666('0x41')]);_0x68c0a5[_0xf666('0x42')]=qs[_0xf666('0x39')](_[_0xf666('0x43')](_0x1acaab[_0xf666('0x3c')],_0x2eb705[_0xf666('0x39')]));if(_0x1acaab['query']['filter']){_0x68c0a5[_0xf666('0x42')]=_[_0xf666('0x45')](_0x68c0a5[_0xf666('0x42')],{'$or':_[_0xf666('0x33')](_0x68c0a5['attributes'],function(_0xb0af3a){var _0x3b9a00={};_0x3b9a00[_0xb0af3a]={'$like':'%'+_0x1acaab['query'][_0xf666('0x44')]+'%'};return _0x3b9a00;})});}_0x68c0a5=_['merge']({},_0x68c0a5,_0x1acaab[_0xf666('0x46')]);return _0x2ebdbb[_0xf666('0x5e')](_0x68c0a5);}})[_0xf666('0x29')](function(_0x1e3ba7){if(_0x1e3ba7){_0x8c5318=_0x1e3ba7[_0xf666('0x3e')];if(!_0x1acaab['query']['hasOwnProperty'](_0xf666('0x40'))){_0x68c0a5['limit']=qs[_0xf666('0x23')](_0x1acaab[_0xf666('0x3c')]['limit']);_0x68c0a5[_0xf666('0x20')]=qs[_0xf666('0x20')](_0x1acaab[_0xf666('0x3c')][_0xf666('0x20')]);}return _0x2ebdbb['getUsers'](_0x68c0a5);}})[_0xf666('0x29')](function(_0x5d2c09){if(_0x5d2c09){return _0x5d2c09?{'count':_0x8c5318,'rows':_0x5d2c09}:null;}})[_0xf666('0x29')](respondWithResult(_0x4decf6,null))['catch'](handleError(_0x4decf6,null));};
\ No newline at end of file
+var _0xe483=['userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','order','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','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','../../mysqldb','redis','defaults','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','SquareProjects','UserProfileResource','error','name','SquareProject','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','where','merge','map','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','include','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find'];(function(_0x458b57,_0x59514f){var _0x4b8799=function(_0x1c98a6){while(--_0x1c98a6){_0x458b57['push'](_0x458b57['shift']());}};_0x4b8799(++_0x59514f);}(_0xe483,0xd2));var _0x3e48=function(_0x255de9,_0x4ddef8){_0x255de9=_0x255de9-0x0;var _0x2d5bf8=_0xe483[_0x255de9];return _0x2d5bf8;};'use strict';var emlformat=require(_0x3e48('0x0'));var rimraf=require(_0x3e48('0x1'));var zipdir=require(_0x3e48('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3e48('0x3'));var moment=require(_0x3e48('0x4'));var BPromise=require(_0x3e48('0x5'));var Mustache=require('mustache');var util=require(_0x3e48('0x6'));var path=require(_0x3e48('0x7'));var sox=require(_0x3e48('0x8'));var csv=require(_0x3e48('0x9'));var ejs=require(_0x3e48('0xa'));var fs=require('fs');var fs_extra=require(_0x3e48('0xb'));var _=require('lodash');var squel=require(_0x3e48('0xc'));var crypto=require(_0x3e48('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3e48('0x9'));var querystring=require(_0x3e48('0xe'));var Papa=require(_0x3e48('0xf'));var Redis=require('ioredis');var authService=require(_0x3e48('0x10'));var qs=require(_0x3e48('0x11'));var as=require(_0x3e48('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3e48('0x13'))(_0x3e48('0x14'));var utils=require(_0x3e48('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3e48('0x16'))['db'];config[_0x3e48('0x17')]=_[_0x3e48('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3e48('0x19'))(new Redis(config[_0x3e48('0x17')]));require(_0x3e48('0x1a'))[_0x3e48('0x1b')](socket);function respondWithStatusCode(_0x50b7bb,_0x2d70e0){_0x2d70e0=_0x2d70e0||0xcc;return function(_0x3aee1d){if(_0x3aee1d){return _0x50b7bb[_0x3e48('0x1c')](_0x2d70e0);}return _0x50b7bb[_0x3e48('0x1d')](_0x2d70e0)[_0x3e48('0x1e')]();};}function respondWithResult(_0x1e443f,_0x423c42){_0x423c42=_0x423c42||0xc8;return function(_0x520dd6){if(_0x520dd6){return _0x1e443f[_0x3e48('0x1d')](_0x423c42)[_0x3e48('0x1f')](_0x520dd6);}};}function respondWithFilteredResult(_0x1db514,_0x593595){return function(_0x252948){if(_0x252948){var _0x9816ae=typeof _0x593595[_0x3e48('0x20')]===_0x3e48('0x21')&&typeof _0x593595[_0x3e48('0x22')]==='undefined';var _0x3d1d9e=_0x252948[_0x3e48('0x23')];var _0x4da08a=_0x9816ae?0x0:_0x593595['offset'];var _0x2bf8d7=_0x9816ae?_0x252948[_0x3e48('0x23')]:_0x593595[_0x3e48('0x20')]+_0x593595[_0x3e48('0x22')];var _0x2967e5;if(_0x2bf8d7>=_0x3d1d9e){_0x2bf8d7=_0x3d1d9e;_0x2967e5=0xc8;}else{_0x2967e5=0xce;}_0x1db514['status'](_0x2967e5);return _0x1db514[_0x3e48('0x24')](_0x3e48('0x25'),_0x4da08a+'-'+_0x2bf8d7+'/'+_0x3d1d9e)[_0x3e48('0x1f')](_0x252948);}return null;};}function patchUpdates(_0x4757f9){return function(_0x526dfd){try{jsonpatch[_0x3e48('0x26')](_0x526dfd,_0x4757f9,!![]);}catch(_0x283fbc){return BPromise[_0x3e48('0x27')](_0x283fbc);}return _0x526dfd[_0x3e48('0x28')]();};}function saveUpdates(_0x47e0d2,_0x147f0c){return function(_0x1fff3e){if(_0x1fff3e){return _0x1fff3e['update'](_0x47e0d2)[_0x3e48('0x29')](function(_0x2bafa2){return _0x2bafa2;});}return null;};}function removeEntity(_0x296aff,_0x48694a){return function(_0x820530){if(_0x820530){return _0x820530[_0x3e48('0x2a')]()['then'](function(){var _0x5088a7=_0x820530[_0x3e48('0x2b')]({'plain':!![]});var _0x5b7224=_0x3e48('0x2c');return db[_0x3e48('0x2d')][_0x3e48('0x2a')]({'where':{'type':_0x5b7224,'resourceId':_0x5088a7['id']}})[_0x3e48('0x29')](function(){return _0x820530;});})['then'](function(){_0x296aff[_0x3e48('0x1d')](0xcc)[_0x3e48('0x1e')]();});}};}function handleEntityNotFound(_0x28e178,_0x43de6a){return function(_0x1222b4){if(!_0x1222b4){_0x28e178[_0x3e48('0x1c')](0x194);}return _0x1222b4;};}function handleError(_0x37a543,_0x180c1a){_0x180c1a=_0x180c1a||0x1f4;return function(_0x407da0){logger[_0x3e48('0x2e')](_0x407da0['stack']);if(_0x407da0[_0x3e48('0x2f')]){delete _0x407da0['name'];}_0x37a543['status'](_0x180c1a)['send'](_0x407da0);};}exports['index']=function(_0x512f08,_0x34e261){var _0x32bfe8={},_0x285929={},_0x238e1e={'count':0x0,'rows':[]};var _0xbeef42=_['map'](db[_0x3e48('0x30')][_0x3e48('0x31')],function(_0x32aac5){return{'name':_0x32aac5['fieldName'],'type':_0x32aac5[_0x3e48('0x32')][_0x3e48('0x33')]};});_0x285929[_0x3e48('0x34')]=_['map'](_0xbeef42,_0x3e48('0x2f'));_0x285929['query']=_[_0x3e48('0x35')](_0x512f08[_0x3e48('0x36')]);_0x285929[_0x3e48('0x37')]=_['intersection'](_0x285929[_0x3e48('0x34')],_0x285929[_0x3e48('0x36')]);_0x32bfe8['attributes']=_[_0x3e48('0x38')](_0x285929[_0x3e48('0x34')],qs['fields'](_0x512f08['query'][_0x3e48('0x39')]));_0x32bfe8[_0x3e48('0x3a')]=_0x32bfe8['attributes'][_0x3e48('0x3b')]?_0x32bfe8[_0x3e48('0x3a')]:_0x285929[_0x3e48('0x34')];if(!_0x512f08[_0x3e48('0x36')][_0x3e48('0x3c')](_0x3e48('0x3d'))){_0x32bfe8[_0x3e48('0x22')]=qs[_0x3e48('0x22')](_0x512f08['query'][_0x3e48('0x22')]);_0x32bfe8[_0x3e48('0x20')]=qs[_0x3e48('0x20')](_0x512f08['query'][_0x3e48('0x20')]);}_0x32bfe8['order']=qs[_0x3e48('0x3e')](_0x512f08['query'][_0x3e48('0x3e')]);_0x32bfe8['where']=qs[_0x3e48('0x37')](_[_0x3e48('0x3f')](_0x512f08['query'],_0x285929['filters']),_0xbeef42);if(_0x512f08['query']['filter']){_0x32bfe8[_0x3e48('0x40')]=_[_0x3e48('0x41')](_0x32bfe8[_0x3e48('0x40')],{'$or':_[_0x3e48('0x42')](_0xbeef42,function(_0xad2806){if(_0xad2806[_0x3e48('0x32')]!==_0x3e48('0x43')){var _0x48397b={};_0x48397b[_0xad2806[_0x3e48('0x2f')]]={'$like':'%'+_0x512f08[_0x3e48('0x36')][_0x3e48('0x44')]+'%'};return _0x48397b;}})});}_0x32bfe8=_[_0x3e48('0x41')]({},_0x32bfe8,_0x512f08[_0x3e48('0x45')]);var _0x46fb8e={'where':_0x32bfe8[_0x3e48('0x40')]};return db[_0x3e48('0x30')][_0x3e48('0x23')](_0x46fb8e)[_0x3e48('0x29')](function(_0x7ececc){_0x238e1e[_0x3e48('0x23')]=_0x7ececc;if(_0x512f08[_0x3e48('0x36')][_0x3e48('0x46')]){_0x32bfe8['include']=[{'all':!![]}];}return db[_0x3e48('0x30')][_0x3e48('0x47')](_0x32bfe8);})['then'](function(_0x4dc326){_0x238e1e[_0x3e48('0x48')]=_0x4dc326;return _0x238e1e;})[_0x3e48('0x29')](respondWithFilteredResult(_0x34e261,_0x32bfe8))['catch'](handleError(_0x34e261,null));};exports[_0x3e48('0x49')]=function(_0xffa3de,_0x3c3a20){var _0x194da4={'raw':![],'where':{'id':_0xffa3de[_0x3e48('0x4a')]['id']}},_0x2e54be={};_0x2e54be[_0x3e48('0x34')]=_[_0x3e48('0x35')](db[_0x3e48('0x30')][_0x3e48('0x31')]);_0x2e54be[_0x3e48('0x36')]=_[_0x3e48('0x35')](_0xffa3de[_0x3e48('0x36')]);_0x2e54be[_0x3e48('0x37')]=_['intersection'](_0x2e54be['model'],_0x2e54be[_0x3e48('0x36')]);_0x194da4[_0x3e48('0x3a')]=_['intersection'](_0x2e54be[_0x3e48('0x34')],qs[_0x3e48('0x39')](_0xffa3de[_0x3e48('0x36')][_0x3e48('0x39')]));_0x194da4[_0x3e48('0x3a')]=_0x194da4[_0x3e48('0x3a')][_0x3e48('0x3b')]?_0x194da4[_0x3e48('0x3a')]:_0x2e54be[_0x3e48('0x34')];if(_0xffa3de[_0x3e48('0x36')][_0x3e48('0x46')]){_0x194da4[_0x3e48('0x4b')]=[{'all':!![]}];}_0x194da4=_[_0x3e48('0x41')]({},_0x194da4,_0xffa3de['options']);return db['SquareProject']['find'](_0x194da4)['then'](handleEntityNotFound(_0x3c3a20,null))[_0x3e48('0x29')](respondWithResult(_0x3c3a20,null))[_0x3e48('0x4c')](handleError(_0x3c3a20,null));};exports[_0x3e48('0x4d')]=function(_0x5cccd3,_0x19510d){return db[_0x3e48('0x30')]['create'](_0x5cccd3[_0x3e48('0x4e')],{})[_0x3e48('0x29')](function(_0x1a1969){var _0x4859b0=_0x5cccd3[_0x3e48('0x4f')][_0x3e48('0x2b')]({'plain':!![]});if(!_0x4859b0)throw new Error(_0x3e48('0x50'));if(_0x4859b0[_0x3e48('0x51')]===_0x3e48('0x4f')){var _0x6404b3=_0x1a1969[_0x3e48('0x2b')]({'plain':!![]});var _0x160d21='SquareProjects';return db[_0x3e48('0x52')][_0x3e48('0x53')]({'where':{'name':_0x160d21,'userProfileId':_0x4859b0[_0x3e48('0x54')]},'raw':!![]})[_0x3e48('0x29')](function(_0x171353){if(_0x171353&&_0x171353['autoAssociation']===0x0){return db['UserProfileResource'][_0x3e48('0x4d')]({'name':_0x6404b3[_0x3e48('0x2f')],'resourceId':_0x6404b3['id'],'type':_0x171353[_0x3e48('0x2f')],'sectionId':_0x171353['id']},{})['then'](function(){return _0x1a1969;});}else{return _0x1a1969;}})[_0x3e48('0x4c')](function(_0x3f48ad){logger[_0x3e48('0x2e')](_0x3e48('0x55'),_0x3f48ad);throw _0x3f48ad;});}return _0x1a1969;})[_0x3e48('0x29')](respondWithResult(_0x19510d,0xc9))[_0x3e48('0x4c')](handleError(_0x19510d,null));};exports[_0x3e48('0x56')]=function(_0x26f978,_0x1b8dd4){if(_0x26f978[_0x3e48('0x4e')]['id']){delete _0x26f978[_0x3e48('0x4e')]['id'];}return db[_0x3e48('0x30')][_0x3e48('0x53')]({'where':{'id':_0x26f978[_0x3e48('0x4a')]['id']}})[_0x3e48('0x29')](handleEntityNotFound(_0x1b8dd4,null))[_0x3e48('0x29')](saveUpdates(_0x26f978[_0x3e48('0x4e')],null))[_0x3e48('0x29')](respondWithResult(_0x1b8dd4,null))[_0x3e48('0x4c')](handleError(_0x1b8dd4,null));};exports[_0x3e48('0x2a')]=function(_0x1aaa8e,_0x1f95fb){return db[_0x3e48('0x30')][_0x3e48('0x53')]({'where':{'id':_0x1aaa8e[_0x3e48('0x4a')]['id']}})[_0x3e48('0x29')](handleEntityNotFound(_0x1f95fb,null))[_0x3e48('0x29')](removeEntity(_0x1f95fb,null))['catch'](handleError(_0x1f95fb,null));};exports[_0x3e48('0x57')]=function(_0x183489,_0x27b50c,_0x288657){return db[_0x3e48('0x30')][_0x3e48('0x53')]({'where':{'id':_0x183489[_0x3e48('0x4a')]['id']}})[_0x3e48('0x29')](handleEntityNotFound(_0x27b50c,null))['then'](function(_0x24db78){if(_0x24db78){return _0x24db78[_0x3e48('0x57')](_0x183489[_0x3e48('0x4e')][_0x3e48('0x58')],_[_0x3e48('0x59')](_0x183489['body'],[_0x3e48('0x58'),'id'])||{});}})[_0x3e48('0x29')](respondWithResult(_0x27b50c,null))[_0x3e48('0x4c')](handleError(_0x27b50c,null));};exports[_0x3e48('0x5a')]=function(_0x34ec02,_0x276183,_0x2a4909){return db[_0x3e48('0x30')]['find']({'where':{'id':_0x34ec02[_0x3e48('0x4a')]['id']}})[_0x3e48('0x29')](handleEntityNotFound(_0x276183,null))[_0x3e48('0x29')](function(_0x29dcdd){if(_0x29dcdd){return _0x29dcdd['removeUsers'](_0x34ec02[_0x3e48('0x36')]['ids'])[_0x3e48('0x29')](function(){if(_[_0x3e48('0x5b')](_0x34ec02[_0x3e48('0x36')][_0x3e48('0x58')])){for(var _0x17a676=0x0;_0x17a676<_0x34ec02['query'][_0x3e48('0x58')][_0x3e48('0x3b')];_0x17a676+=0x1){socket[_0x3e48('0x5c')](_0x3e48('0x5d'),{'UserId':Number(_0x34ec02[_0x3e48('0x36')][_0x3e48('0x58')][_0x17a676]),'SquareProjectId':Number(_0x34ec02[_0x3e48('0x4a')]['id'])});}}else{socket[_0x3e48('0x5c')](_0x3e48('0x5d'),{'UserId':Number(_0x34ec02[_0x3e48('0x36')][_0x3e48('0x58')]),'SquareProjectId':Number(_0x34ec02[_0x3e48('0x4a')]['id'])});}});}})[_0x3e48('0x29')](respondWithStatusCode(_0x276183,null))['catch'](handleError(_0x276183,null));};exports[_0x3e48('0x5e')]=function(_0x5a1c9d,_0x996b3d,_0x12a688){var _0x147e4c={};var _0xe88cd7={};var _0x3ec53d;var _0x5de901;return db[_0x3e48('0x30')][_0x3e48('0x5f')]({'where':{'id':_0x5a1c9d['params']['id']}})[_0x3e48('0x29')](handleEntityNotFound(_0x996b3d,null))['then'](function(_0x1781b9){if(_0x1781b9){_0x3ec53d=_0x1781b9;_0xe88cd7[_0x3e48('0x34')]=_[_0x3e48('0x35')](db[_0x3e48('0x60')][_0x3e48('0x31')]);_0xe88cd7[_0x3e48('0x36')]=_['keys'](_0x5a1c9d[_0x3e48('0x36')]);_0xe88cd7[_0x3e48('0x37')]=_[_0x3e48('0x38')](_0xe88cd7[_0x3e48('0x34')],_0xe88cd7[_0x3e48('0x36')]);_0x147e4c[_0x3e48('0x3a')]=_[_0x3e48('0x38')](_0xe88cd7[_0x3e48('0x34')],qs[_0x3e48('0x39')](_0x5a1c9d[_0x3e48('0x36')][_0x3e48('0x39')]));_0x147e4c[_0x3e48('0x3a')]=_0x147e4c[_0x3e48('0x3a')][_0x3e48('0x3b')]?_0x147e4c['attributes']:_0xe88cd7[_0x3e48('0x34')];_0x147e4c[_0x3e48('0x61')]=qs[_0x3e48('0x3e')](_0x5a1c9d[_0x3e48('0x36')][_0x3e48('0x3e')]);_0x147e4c[_0x3e48('0x40')]=qs[_0x3e48('0x37')](_[_0x3e48('0x3f')](_0x5a1c9d[_0x3e48('0x36')],_0xe88cd7[_0x3e48('0x37')]));if(_0x5a1c9d['query'][_0x3e48('0x44')]){_0x147e4c[_0x3e48('0x40')]=_[_0x3e48('0x41')](_0x147e4c[_0x3e48('0x40')],{'$or':_[_0x3e48('0x42')](_0x147e4c[_0x3e48('0x3a')],function(_0x4f2fbc){var _0x1de119={};_0x1de119[_0x4f2fbc]={'$like':'%'+_0x5a1c9d[_0x3e48('0x36')][_0x3e48('0x44')]+'%'};return _0x1de119;})});}_0x147e4c=_[_0x3e48('0x41')]({},_0x147e4c,_0x5a1c9d['options']);return _0x3ec53d[_0x3e48('0x5e')](_0x147e4c);}})['then'](function(_0x4fc596){if(_0x4fc596){_0x5de901=_0x4fc596['length'];if(!_0x5a1c9d[_0x3e48('0x36')]['hasOwnProperty'](_0x3e48('0x3d'))){_0x147e4c[_0x3e48('0x22')]=qs[_0x3e48('0x22')](_0x5a1c9d[_0x3e48('0x36')][_0x3e48('0x22')]);_0x147e4c[_0x3e48('0x20')]=qs[_0x3e48('0x20')](_0x5a1c9d[_0x3e48('0x36')]['offset']);}return _0x3ec53d['getUsers'](_0x147e4c);}})[_0x3e48('0x29')](function(_0x53960e){if(_0x53960e){return _0x53960e?{'count':_0x5de901,'rows':_0x53960e}:null;}})[_0x3e48('0x29')](respondWithResult(_0x996b3d,null))[_0x3e48('0x4c')](handleError(_0x996b3d,null));};
\ No newline at end of file
index 34c50bb..4069535 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb773=['save','remove','hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject','setMaxListeners'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xb773,0x71));var _0x3b77=function(_0x4baf98,_0xa7ebd9){_0x4baf98=_0x4baf98-0x0;var _0x5da718=_0xb773[_0x4baf98];return _0x5da718;};'use strict';var EventEmitter=require(_0x3b77('0x0'));var SquareProject=require(_0x3b77('0x1'))['db'][_0x3b77('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x3b77('0x3')](0x0);var events={'afterCreate':_0x3b77('0x4'),'afterUpdate':'update','afterDestroy':_0x3b77('0x5')};function emitEvent(_0xa182ea){return function(_0x56dc68,_0x2e5472,_0x3c50cd){SquareProjectEvents['emit'](_0xa182ea+':'+_0x56dc68['id'],_0x56dc68);SquareProjectEvents['emit'](_0xa182ea,_0x56dc68);_0x3c50cd(null);};}for(var e in events){if(events[_0x3b77('0x6')](e)){var event=events[e];SquareProject[_0x3b77('0x7')](e,emitEvent(event));}}module[_0x3b77('0x8')]=SquareProjectEvents;
\ No newline at end of file
+var _0x8187=['emit','hook','exports','events','../../mysqldb','setMaxListeners','remove'];(function(_0x4e5552,_0x19ec4e){var _0x60a338=function(_0x40c70e){while(--_0x40c70e){_0x4e5552['push'](_0x4e5552['shift']());}};_0x60a338(++_0x19ec4e);}(_0x8187,0xb9));var _0x7818=function(_0x3125f0,_0x16a51e){_0x3125f0=_0x3125f0-0x0;var _0x19cae4=_0x8187[_0x3125f0];return _0x19cae4;};'use strict';var EventEmitter=require(_0x7818('0x0'));var SquareProject=require(_0x7818('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x7818('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7818('0x3')};function emitEvent(_0x37221f){return function(_0x16fc84,_0x583299,_0x2d32a5){SquareProjectEvents[_0x7818('0x4')](_0x37221f+':'+_0x16fc84['id'],_0x16fc84);SquareProjectEvents[_0x7818('0x4')](_0x37221f,_0x16fc84);_0x2d32a5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x7818('0x5')](e,emitEvent(event));}}module[_0x7818('0x6')]=SquareProjectEvents;
\ No newline at end of file
index ca818e6..d881b2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x589a=['request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','moment','bluebird'];(function(_0x5cafc2,_0x534e3a){var _0x840ac4=function(_0x4c5989){while(--_0x4c5989){_0x5cafc2['push'](_0x5cafc2['shift']());}};_0x840ac4(++_0x534e3a);}(_0x589a,0x1e9));var _0xa589=function(_0xf2a4d1,_0x325e57){_0xf2a4d1=_0xf2a4d1-0x0;var _0x201cfd=_0x589a[_0xf2a4d1];return _0x201cfd;};'use strict';var _=require(_0xa589('0x0'));var util=require('util');var logger=require(_0xa589('0x1'))('api');var moment=require(_0xa589('0x2'));var BPromise=require(_0xa589('0x3'));var rp=require(_0xa589('0x4'));var fs=require('fs');var path=require(_0xa589('0x5'));var rimraf=require(_0xa589('0x6'));var config=require(_0xa589('0x7'));var attributes=require(_0xa589('0x8'));module[_0xa589('0x9')]=function(_0x1b889a,_0x421ce8){return _0x1b889a[_0xa589('0xa')]('SquareProject',attributes,{'tableName':_0xa589('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5bea03,_0x40552c,_0x51708b){if(_0x5bea03[_0xa589('0xc')](_0xa589('0xd'))){_0x5bea03[_0xa589('0xe')]=moment()[_0xa589('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x5bea03[_0xa589('0xc')]('production')){_0x5bea03['publishedAt']=moment()[_0xa589('0xf')](_0xa589('0x10'));}_0x51708b(null,_0x5bea03);}}});};
\ No newline at end of file
+var _0x7d30=['define','square_projects','changed','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3c9a89,_0x378778){var _0x1eb47b=function(_0x57998a){while(--_0x57998a){_0x3c9a89['push'](_0x3c9a89['shift']());}};_0x1eb47b(++_0x378778);}(_0x7d30,0xaf));var _0x07d3=function(_0x2ecf31,_0x1a7245){_0x2ecf31=_0x2ecf31-0x0;var _0x41c36f=_0x7d30[_0x2ecf31];return _0x41c36f;};'use strict';var _=require('lodash');var util=require(_0x07d3('0x0'));var logger=require('../../config/logger')(_0x07d3('0x1'));var moment=require(_0x07d3('0x2'));var BPromise=require(_0x07d3('0x3'));var rp=require(_0x07d3('0x4'));var fs=require('fs');var path=require(_0x07d3('0x5'));var rimraf=require(_0x07d3('0x6'));var config=require('../../config/environment');var attributes=require('./squareProject.attributes');module['exports']=function(_0x58a238,_0x5bc499){return _0x58a238[_0x07d3('0x7')]('SquareProject',attributes,{'tableName':_0x07d3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3ccbcc,_0x2d1d7a,_0x59608b){if(_0x3ccbcc[_0x07d3('0x9')]('preproduction')){_0x3ccbcc['savedAt']=moment()[_0x07d3('0xa')](_0x07d3('0xb'));}if(_0x3ccbcc['changed'](_0x07d3('0xc'))){_0x3ccbcc[_0x07d3('0xd')]=moment()[_0x07d3('0xa')](_0x07d3('0xb'));}_0x59608b(null,_0x3ccbcc);}}});};
\ No newline at end of file
index 1bd08ed..2f2d7eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4c2=['client','http','defaults','socket.io-emitter','./squareProject.socket','request','info','SquareProject,\x20%s,\x20%s','debug','SquareProject,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowSquareProject','SquareProject','find','options','raw','where','attributes','include','map','model','then','lodash','moment','../../config/logger','rpc','jayson/promise'];(function(_0x1ecbd5,_0xf05f7c){var _0x1be527=function(_0x6ca991){while(--_0x6ca991){_0x1ecbd5['push'](_0x1ecbd5['shift']());}};_0x1be527(++_0xf05f7c);}(_0xa4c2,0x9b));var _0x2a4c=function(_0x4be01f,_0x2cd166){_0x4be01f=_0x4be01f-0x0;var _0x15b16b=_0xa4c2[_0x4be01f];return _0x15b16b;};'use strict';var _=require(_0x2a4c('0x0'));var util=require('util');var moment=require(_0x2a4c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2a4c('0x2'))(_0x2a4c('0x3'));var config=require('../../config/environment');var jayson=require(_0x2a4c('0x4'));var client=jayson[_0x2a4c('0x5')][_0x2a4c('0x6')]({'port':0x232a});config['redis']=_[_0x2a4c('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2a4c('0x8'))(new Redis(config['redis']));require(_0x2a4c('0x9'))['register'](socket);function respondWithRpcPromise(_0x406ab8,_0x4948cd,_0x11e347){return new BPromise(function(_0x539cfa,_0x213183){return client[_0x2a4c('0xa')](_0x406ab8,_0x11e347)['then'](function(_0x7d69fc){logger[_0x2a4c('0xb')](_0x2a4c('0xc'),_0x4948cd,'request\x20sent');logger[_0x2a4c('0xd')](_0x2a4c('0xe'),_0x4948cd,_0x2a4c('0xf'),JSON['stringify'](_0x7d69fc));if(_0x7d69fc['error']){if(_0x7d69fc[_0x2a4c('0x10')][_0x2a4c('0x11')]===0x1f4){logger['error'](_0x2a4c('0xc'),_0x4948cd,_0x7d69fc[_0x2a4c('0x10')][_0x2a4c('0x12')]);return _0x213183(_0x7d69fc[_0x2a4c('0x10')][_0x2a4c('0x12')]);}logger[_0x2a4c('0x10')]('SquareProject,\x20%s,\x20%s',_0x4948cd,_0x7d69fc[_0x2a4c('0x10')][_0x2a4c('0x12')]);return _0x539cfa(_0x7d69fc[_0x2a4c('0x10')][_0x2a4c('0x12')]);}else{logger[_0x2a4c('0xb')](_0x2a4c('0xc'),_0x4948cd,_0x2a4c('0xf'));_0x539cfa(_0x7d69fc[_0x2a4c('0x13')]['message']);}})[_0x2a4c('0x14')](function(_0x456f09){logger['error'](_0x2a4c('0xc'),_0x4948cd,_0x456f09);_0x213183(_0x456f09);});});}exports[_0x2a4c('0x15')]=function(_0x4b5c8f){var _0x5f11d5=this;return new Promise(function(_0x4a10f6,_0x53ea2d){return db[_0x2a4c('0x16')][_0x2a4c('0x17')]({'raw':_0x4b5c8f[_0x2a4c('0x18')]?_0x4b5c8f[_0x2a4c('0x18')][_0x2a4c('0x19')]===undefined?!![]:![]:!![],'where':_0x4b5c8f[_0x2a4c('0x18')]?_0x4b5c8f[_0x2a4c('0x18')][_0x2a4c('0x1a')]||null:null,'attributes':_0x4b5c8f[_0x2a4c('0x18')]?_0x4b5c8f[_0x2a4c('0x18')][_0x2a4c('0x1b')]||null:null,'include':_0x4b5c8f[_0x2a4c('0x18')]?_0x4b5c8f[_0x2a4c('0x18')][_0x2a4c('0x1c')]?_[_0x2a4c('0x1d')](_0x4b5c8f[_0x2a4c('0x18')]['include'],function(_0x24c6cd){return{'model':db[_0x24c6cd[_0x2a4c('0x1e')]],'as':_0x24c6cd['as'],'attributes':_0x24c6cd[_0x2a4c('0x1b')],'include':_0x24c6cd[_0x2a4c('0x1c')]?_[_0x2a4c('0x1d')](_0x24c6cd[_0x2a4c('0x1c')],function(_0x4391c0){return{'model':db[_0x4391c0[_0x2a4c('0x1e')]],'as':_0x4391c0['as'],'attributes':_0x4391c0['attributes'],'include':_0x4391c0[_0x2a4c('0x1c')]?_['map'](_0x4391c0['include'],function(_0x2301f9){return{'model':db[_0x2301f9[_0x2a4c('0x1e')]],'as':_0x2301f9['as'],'attributes':_0x2301f9[_0x2a4c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2a4c('0x1f')](function(_0x46e0de){logger[_0x2a4c('0xb')](_0x2a4c('0x15'),_0x4b5c8f);logger[_0x2a4c('0xd')](_0x2a4c('0x15'),_0x4b5c8f,JSON['stringify'](_0x46e0de));_0x4a10f6(_0x46e0de);})[_0x2a4c('0x14')](function(_0x4544b9){logger[_0x2a4c('0x10')](_0x2a4c('0x15'),_0x4544b9[_0x2a4c('0x12')],_0x4b5c8f);_0x53ea2d(_0x5f11d5[_0x2a4c('0x10')](0x1f4,_0x4544b9[_0x2a4c('0x12')]));});});};
\ No newline at end of file
+var _0x7c39=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','request','then','info','SquareProject,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','ShowSquareProject','SquareProject','find','options','raw','attributes','map','include','model'];(function(_0x5c774b,_0x14d182){var _0x572a8d=function(_0x514c14){while(--_0x514c14){_0x5c774b['push'](_0x5c774b['shift']());}};_0x572a8d(++_0x14d182);}(_0x7c39,0xfc));var _0x97c3=function(_0x102241,_0x385f6e){_0x102241=_0x102241-0x0;var _0x52e04f=_0x7c39[_0x102241];return _0x52e04f;};'use strict';var _=require(_0x97c3('0x0'));var util=require(_0x97c3('0x1'));var moment=require(_0x97c3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x97c3('0x3'));var db=require(_0x97c3('0x4'))['db'];var utils=require(_0x97c3('0x5'));var logger=require(_0x97c3('0x6'))('rpc');var config=require(_0x97c3('0x7'));var jayson=require(_0x97c3('0x8'));var client=jayson[_0x97c3('0x9')]['http']({'port':0x232a});config[_0x97c3('0xa')]=_[_0x97c3('0xb')](config[_0x97c3('0xa')],{'host':_0x97c3('0xc'),'port':0x18eb});var socket=require(_0x97c3('0xd'))(new Redis(config['redis']));require(_0x97c3('0xe'))[_0x97c3('0xf')](socket);function respondWithRpcPromise(_0x4cee6a,_0x409425,_0x1b56b4){return new BPromise(function(_0x2c5736,_0x3d6606){return client[_0x97c3('0x10')](_0x4cee6a,_0x1b56b4)[_0x97c3('0x11')](function(_0xdaceb7){logger[_0x97c3('0x12')](_0x97c3('0x13'),_0x409425,'request\x20sent');logger[_0x97c3('0x14')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x409425,_0x97c3('0x15'),JSON[_0x97c3('0x16')](_0xdaceb7));if(_0xdaceb7[_0x97c3('0x17')]){if(_0xdaceb7['error']['code']===0x1f4){logger[_0x97c3('0x17')](_0x97c3('0x13'),_0x409425,_0xdaceb7[_0x97c3('0x17')]['message']);return _0x3d6606(_0xdaceb7['error']['message']);}logger[_0x97c3('0x17')]('SquareProject,\x20%s,\x20%s',_0x409425,_0xdaceb7[_0x97c3('0x17')][_0x97c3('0x18')]);return _0x2c5736(_0xdaceb7[_0x97c3('0x17')][_0x97c3('0x18')]);}else{logger[_0x97c3('0x12')](_0x97c3('0x13'),_0x409425,'request\x20sent');_0x2c5736(_0xdaceb7[_0x97c3('0x19')][_0x97c3('0x18')]);}})[_0x97c3('0x1a')](function(_0x1909c0){logger['error']('SquareProject,\x20%s,\x20%s',_0x409425,_0x1909c0);_0x3d6606(_0x1909c0);});});}exports[_0x97c3('0x1b')]=function(_0x181309){var _0x12a042=this;return new Promise(function(_0x3c4ae7,_0x33db33){return db[_0x97c3('0x1c')][_0x97c3('0x1d')]({'raw':_0x181309[_0x97c3('0x1e')]?_0x181309[_0x97c3('0x1e')][_0x97c3('0x1f')]===undefined?!![]:![]:!![],'where':_0x181309[_0x97c3('0x1e')]?_0x181309['options']['where']||null:null,'attributes':_0x181309[_0x97c3('0x1e')]?_0x181309[_0x97c3('0x1e')][_0x97c3('0x20')]||null:null,'include':_0x181309[_0x97c3('0x1e')]?_0x181309[_0x97c3('0x1e')]['include']?_[_0x97c3('0x21')](_0x181309[_0x97c3('0x1e')][_0x97c3('0x22')],function(_0x34ddfd){return{'model':db[_0x34ddfd[_0x97c3('0x23')]],'as':_0x34ddfd['as'],'attributes':_0x34ddfd[_0x97c3('0x20')],'include':_0x34ddfd[_0x97c3('0x22')]?_[_0x97c3('0x21')](_0x34ddfd[_0x97c3('0x22')],function(_0x27a33f){return{'model':db[_0x27a33f[_0x97c3('0x23')]],'as':_0x27a33f['as'],'attributes':_0x27a33f['attributes'],'include':_0x27a33f[_0x97c3('0x22')]?_[_0x97c3('0x21')](_0x27a33f[_0x97c3('0x22')],function(_0x25e5d6){return{'model':db[_0x25e5d6['model']],'as':_0x25e5d6['as'],'attributes':_0x25e5d6[_0x97c3('0x20')]};}):[]};}):[]};}):[]:[]})[_0x97c3('0x11')](function(_0x58e26c){logger['info'](_0x97c3('0x1b'),_0x181309);logger[_0x97c3('0x14')](_0x97c3('0x1b'),_0x181309,JSON[_0x97c3('0x16')](_0x58e26c));_0x3c4ae7(_0x58e26c);})['catch'](function(_0x45f2d5){logger[_0x97c3('0x17')](_0x97c3('0x1b'),_0x45f2d5[_0x97c3('0x18')],_0x181309);_0x33db33(_0x12a042[_0x97c3('0x17')](0x1f4,_0x45f2d5['message']));});});};
\ No newline at end of file
index e1f8374..0ab3626 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ee1=['length','./squareProject.events','save','update','removeListener','register'];(function(_0x31e72b,_0x569bd7){var _0x164fbf=function(_0x1e73e3){while(--_0x1e73e3){_0x31e72b['push'](_0x31e72b['shift']());}};_0x164fbf(++_0x569bd7);}(_0x9ee1,0xd3));var _0x19ee=function(_0x33e668,_0x31c483){_0x33e668=_0x33e668-0x0;var _0xb1cf46=_0x9ee1[_0x33e668];return _0xb1cf46;};'use strict';var SquareProjectEvents=require(_0x19ee('0x0'));var events=[_0x19ee('0x1'),'remove',_0x19ee('0x2')];function createListener(_0x5f46f5,_0x3513e1){return function(_0x3a1e5e){_0x3513e1['emit'](_0x5f46f5,_0x3a1e5e);};}function removeListener(_0x4d703f,_0x1ddffd){return function(){SquareProjectEvents[_0x19ee('0x3')](_0x4d703f,_0x1ddffd);};}exports[_0x19ee('0x4')]=function(_0x430637){for(var _0x1cb505=0x0,_0x49a3cb=events[_0x19ee('0x5')];_0x1cb505<_0x49a3cb;_0x1cb505++){var _0x1a942b=events[_0x1cb505];var _0x5f1c14=createListener('squareProject:'+_0x1a942b,_0x430637);SquareProjectEvents['on'](_0x1a942b,_0x5f1c14);}};
\ No newline at end of file
+var _0x5511=['remove','update','emit','removeListener','squareProject:','./squareProject.events','save'];(function(_0x1ae1fb,_0x81c2ec){var _0x57166=function(_0x48c137){while(--_0x48c137){_0x1ae1fb['push'](_0x1ae1fb['shift']());}};_0x57166(++_0x81c2ec);}(_0x5511,0x124));var _0x1551=function(_0x26986a,_0x168f62){_0x26986a=_0x26986a-0x0;var _0x361f12=_0x5511[_0x26986a];return _0x361f12;};'use strict';var SquareProjectEvents=require(_0x1551('0x0'));var events=[_0x1551('0x1'),_0x1551('0x2'),_0x1551('0x3')];function createListener(_0x1b7a2c,_0x4a466d){return function(_0x4e8cd4){_0x4a466d[_0x1551('0x4')](_0x1b7a2c,_0x4e8cd4);};}function removeListener(_0x1bc1e2,_0x429c8b){return function(){SquareProjectEvents[_0x1551('0x5')](_0x1bc1e2,_0x429c8b);};}exports['register']=function(_0x5912c3){for(var _0x1cd5fb=0x0,_0x4fb3bd=events['length'];_0x1cd5fb<_0x4fb3bd;_0x1cd5fb++){var _0x1dcb98=events[_0x1cd5fb];var _0x5df0c2=createListener(_0x1551('0x6')+_0x1dcb98,_0x5912c3);SquareProjectEvents['on'](_0x1dcb98,_0x5df0c2);}};
\ No newline at end of file
index 75da134..d96d6aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','post','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x1fc7c3,_0x3d1920){var _0x4aa618=function(_0xedd285){while(--_0xedd285){_0x1fc7c3['push'](_0x1fc7c3['shift']());}};_0x4aa618(++_0x3d1920);}(_0x7a54,0x106));var _0x47a5=function(_0x12e8cd,_0x170da6){_0x12e8cd=_0x12e8cd-0x0;var _0x2cab46=_0x7a54[_0x12e8cd];return _0x2cab46;};'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('0x9')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x47a5('0xd')]('/',auth[_0x47a5('0xc')](),controller['create']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);module[_0x47a5('0x12')]=router;
\ No newline at end of file
+var _0xc4aa=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','put','delete'];(function(_0x58afd3,_0x3caa18){var _0x270f8b=function(_0x130fe0){while(--_0x130fe0){_0x58afd3['push'](_0x58afd3['shift']());}};_0x270f8b(++_0x3caa18);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xc4aa[_0x209941];return _0x1e8729;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['show']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/:id',auth[_0xac4a('0x9')](),controller['update']);router[_0xac4a('0x10')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0x11')]);module[_0xac4a('0x12')]=router;
\ No newline at end of file
index 0eaff69..32f069e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46ed=['sequelize','exports','STRING','VIRTUAL','getDataValue','savePath','substring','lastIndexOf'];(function(_0xd9f102,_0x5a0d28){var _0x2652e4=function(_0x5021a1){while(--_0x5021a1){_0xd9f102['push'](_0xd9f102['shift']());}};_0x2652e4(++_0x5a0d28);}(_0x46ed,0x168));var _0xd46e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x46ed[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xd46e('0x2')]},'calleridname':{'type':Sequelize[_0xd46e('0x2')]},'context':{'type':Sequelize[_0xd46e('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xd46e('0x2')]},'accountcode':{'type':Sequelize[_0xd46e('0x2')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0xd46e('0x2')]},'saveName':{'type':Sequelize[_0xd46e('0x2')]},'filename':{'type':Sequelize[_0xd46e('0x2')]},'savePath':{'type':Sequelize[_0xd46e('0x2')]},'format':{'type':Sequelize[_0xd46e('0x3')],'get':function(){var _0x855f24='';var _0x437ea0=this[_0xd46e('0x4')](_0xd46e('0x5'));if(_0x437ea0){_0x855f24=_0x437ea0[_0xd46e('0x6')](_0x437ea0[_0xd46e('0x7')]('.'));}return _0x855f24;}}};
\ No newline at end of file
+var _0xa41a=['exports','STRING','getDataValue','substring','lastIndexOf','sequelize'];(function(_0x4c42ad,_0x472d2f){var _0x304771=function(_0x4b4acb){while(--_0x4b4acb){_0x4c42ad['push'](_0x4c42ad['shift']());}};_0x304771(++_0x472d2f);}(_0xa41a,0x6b));var _0xaa41=function(_0x4b84ef,_0x22f040){_0x4b84ef=_0x4b84ef-0x0;var _0x12df58=_0xa41a[_0x4b84ef];return _0x12df58;};'use strict';var Sequelize=require(_0xaa41('0x0'));module[_0xaa41('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xaa41('0x2')]},'calleridname':{'type':Sequelize[_0xaa41('0x2')]},'context':{'type':Sequelize[_0xaa41('0x2')]},'extension':{'type':Sequelize[_0xaa41('0x2')]},'priority':{'type':Sequelize[_0xaa41('0x2')]},'accountcode':{'type':Sequelize[_0xaa41('0x2')]},'dnid':{'type':Sequelize[_0xaa41('0x2')]},'projectName':{'type':Sequelize[_0xaa41('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0xaa41('0x2')]},'savePath':{'type':Sequelize[_0xaa41('0x2')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x5b1fff='';var _0x179545=this[_0xaa41('0x3')]('savePath');if(_0x179545){_0x5b1fff=_0x179545[_0xaa41('0x4')](_0x179545[_0xaa41('0x5')]('.'));}return _0x5b1fff;}}};
\ No newline at end of file
index 9c11ef4..af19a7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1de2=['save','update','then','destroy','stack','name','send','index','map','SquareRecording','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','rows','catch','params','rawAttributes','find','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','existsSync','decryptFile','secrets','recording','ValidationError','SquareRecording\x20not\x20found','extname','unlink','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject'];(function(_0x3b372a,_0x3f367c){var _0x58319a=function(_0x5ee3d4){while(--_0x5ee3d4){_0x3b372a['push'](_0x3b372a['shift']());}};_0x58319a(++_0x3f367c);}(_0x1de2,0x163));var _0x21de=function(_0x52666e,_0x5b3776){_0x52666e=_0x52666e-0x0;var _0x515330=_0x1de2[_0x52666e];return _0x515330;};'use strict';var emlformat=require(_0x21de('0x0'));var rimraf=require(_0x21de('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x21de('0x2'));var rp=require(_0x21de('0x3'));var moment=require('moment');var BPromise=require(_0x21de('0x4'));var Mustache=require(_0x21de('0x5'));var util=require(_0x21de('0x6'));var path=require('path');var sox=require(_0x21de('0x7'));var csv=require('to-csv');var ejs=require(_0x21de('0x8'));var fs=require('fs');var fs_extra=require(_0x21de('0x9'));var _=require(_0x21de('0xa'));var squel=require(_0x21de('0xb'));var crypto=require(_0x21de('0xc'));var jsforce=require(_0x21de('0xd'));var deskjs=require(_0x21de('0xe'));var toCsv=require(_0x21de('0xf'));var querystring=require('querystring');var Papa=require(_0x21de('0x10'));var Redis=require(_0x21de('0x11'));var authService=require(_0x21de('0x12'));var qs=require(_0x21de('0x13'));var as=require(_0x21de('0x14'));var hardwareService=require(_0x21de('0x15'));var logger=require('../../config/logger')(_0x21de('0x16'));var utils=require(_0x21de('0x17'));var config=require(_0x21de('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x21de('0x19'))['db'];function respondWithStatusCode(_0x3711b1,_0x276f4c){_0x276f4c=_0x276f4c||0xcc;return function(_0x1f4dcc){if(_0x1f4dcc){return _0x3711b1[_0x21de('0x1a')](_0x276f4c);}return _0x3711b1['status'](_0x276f4c)[_0x21de('0x1b')]();};}function respondWithResult(_0x4530b2,_0x4f19f2){_0x4f19f2=_0x4f19f2||0xc8;return function(_0x4e487a){if(_0x4e487a){return _0x4530b2[_0x21de('0x1c')](_0x4f19f2)[_0x21de('0x1d')](_0x4e487a);}};}function respondWithFilteredResult(_0x2e077c,_0x5506d1){return function(_0x97c43){if(_0x97c43){var _0x4a51ff=typeof _0x5506d1[_0x21de('0x1e')]===_0x21de('0x1f')&&typeof _0x5506d1['limit']==='undefined';var _0x54a6e6=_0x97c43['count'];var _0x497c1a=_0x4a51ff?0x0:_0x5506d1['offset'];var _0x4a7b61=_0x4a51ff?_0x97c43['count']:_0x5506d1['offset']+_0x5506d1[_0x21de('0x20')];var _0x8082c2;if(_0x4a7b61>=_0x54a6e6){_0x4a7b61=_0x54a6e6;_0x8082c2=0xc8;}else{_0x8082c2=0xce;}_0x2e077c[_0x21de('0x1c')](_0x8082c2);return _0x2e077c[_0x21de('0x21')](_0x21de('0x22'),_0x497c1a+'-'+_0x4a7b61+'/'+_0x54a6e6)[_0x21de('0x1d')](_0x97c43);}return null;};}function patchUpdates(_0x396fbf){return function(_0x4a12c1){try{jsonpatch[_0x21de('0x23')](_0x4a12c1,_0x396fbf,!![]);}catch(_0x529276){return BPromise[_0x21de('0x24')](_0x529276);}return _0x4a12c1[_0x21de('0x25')]();};}function saveUpdates(_0x1ea844,_0xaee86b){return function(_0x501169){if(_0x501169){return _0x501169[_0x21de('0x26')](_0x1ea844)[_0x21de('0x27')](function(_0x549a50){return _0x549a50;});}return null;};}function removeEntity(_0x5ed346,_0x588851){return function(_0x5e0bbe){if(_0x5e0bbe){return _0x5e0bbe[_0x21de('0x28')]()[_0x21de('0x27')](function(){_0x5ed346[_0x21de('0x1c')](0xcc)[_0x21de('0x1b')]();});}};}function handleEntityNotFound(_0x1676d0,_0x3a4f55){return function(_0x1327e8){if(!_0x1327e8){_0x1676d0['sendStatus'](0x194);}return _0x1327e8;};}function handleError(_0x17cdbc,_0x12a825){_0x12a825=_0x12a825||0x1f4;return function(_0x1c2e94){logger['error'](_0x1c2e94[_0x21de('0x29')]);if(_0x1c2e94[_0x21de('0x2a')]){delete _0x1c2e94[_0x21de('0x2a')];}_0x17cdbc[_0x21de('0x1c')](_0x12a825)[_0x21de('0x2b')](_0x1c2e94);};}exports[_0x21de('0x2c')]=function(_0x31274d,_0x2a67b9){var _0x193825={},_0x1055b9={},_0x5c1c5f={'count':0x0,'rows':[]};var _0x4a7630=_[_0x21de('0x2d')](db[_0x21de('0x2e')]['rawAttributes'],function(_0x2cbaef){return{'name':_0x2cbaef['fieldName'],'type':_0x2cbaef[_0x21de('0x2f')]['key']};});_0x1055b9['model']=_[_0x21de('0x2d')](_0x4a7630,_0x21de('0x2a'));_0x1055b9['query']=_[_0x21de('0x30')](_0x31274d[_0x21de('0x31')]);_0x1055b9[_0x21de('0x32')]=_[_0x21de('0x33')](_0x1055b9[_0x21de('0x34')],_0x1055b9[_0x21de('0x31')]);_0x193825[_0x21de('0x35')]=_['intersection'](_0x1055b9[_0x21de('0x34')],qs[_0x21de('0x36')](_0x31274d[_0x21de('0x31')]['fields']));_0x193825[_0x21de('0x35')]=_0x193825[_0x21de('0x35')][_0x21de('0x37')]?_0x193825[_0x21de('0x35')]:_0x1055b9[_0x21de('0x34')];if(!_0x31274d[_0x21de('0x31')][_0x21de('0x38')]('nolimit')){_0x193825[_0x21de('0x20')]=qs[_0x21de('0x20')](_0x31274d['query']['limit']);_0x193825[_0x21de('0x1e')]=qs['offset'](_0x31274d[_0x21de('0x31')][_0x21de('0x1e')]);}_0x193825[_0x21de('0x39')]=qs['sort'](_0x31274d[_0x21de('0x31')][_0x21de('0x3a')]);_0x193825[_0x21de('0x3b')]=qs[_0x21de('0x32')](_[_0x21de('0x3c')](_0x31274d[_0x21de('0x31')],_0x1055b9[_0x21de('0x32')]),_0x4a7630);if(_0x31274d[_0x21de('0x31')][_0x21de('0x3d')]){_0x193825[_0x21de('0x3b')]=_[_0x21de('0x3e')](_0x193825[_0x21de('0x3b')],{'$or':_[_0x21de('0x2d')](_0x4a7630,function(_0x8ee18f){if(_0x8ee18f[_0x21de('0x2f')]!==_0x21de('0x3f')){var _0x3d3451={};_0x3d3451[_0x8ee18f[_0x21de('0x2a')]]={'$like':'%'+_0x31274d[_0x21de('0x31')][_0x21de('0x3d')]+'%'};return _0x3d3451;}})});}_0x193825=_[_0x21de('0x3e')]({},_0x193825,_0x31274d[_0x21de('0x40')]);var _0x10c043={'where':_0x193825['where']};return db[_0x21de('0x2e')][_0x21de('0x41')](_0x10c043)[_0x21de('0x27')](function(_0x544006){_0x5c1c5f[_0x21de('0x41')]=_0x544006;if(_0x31274d[_0x21de('0x31')][_0x21de('0x42')]){_0x193825[_0x21de('0x43')]=[{'all':!![]}];}return db['SquareRecording']['findAll'](_0x193825);})[_0x21de('0x27')](function(_0xaaa91a){_0x5c1c5f[_0x21de('0x44')]=_0xaaa91a;return _0x5c1c5f;})[_0x21de('0x27')](respondWithFilteredResult(_0x2a67b9,_0x193825))[_0x21de('0x45')](handleError(_0x2a67b9,null));};exports['show']=function(_0x3ccd71,_0x233534){var _0x3f2e7e={'raw':!![],'where':{'id':_0x3ccd71[_0x21de('0x46')]['id']}},_0x3bc7de={};_0x3bc7de[_0x21de('0x34')]=_[_0x21de('0x30')](db[_0x21de('0x2e')][_0x21de('0x47')]);_0x3bc7de[_0x21de('0x31')]=_['keys'](_0x3ccd71[_0x21de('0x31')]);_0x3bc7de['filters']=_['intersection'](_0x3bc7de[_0x21de('0x34')],_0x3bc7de[_0x21de('0x31')]);_0x3f2e7e[_0x21de('0x35')]=_[_0x21de('0x33')](_0x3bc7de[_0x21de('0x34')],qs[_0x21de('0x36')](_0x3ccd71[_0x21de('0x31')][_0x21de('0x36')]));_0x3f2e7e[_0x21de('0x35')]=_0x3f2e7e[_0x21de('0x35')]['length']?_0x3f2e7e[_0x21de('0x35')]:_0x3bc7de['model'];if(_0x3ccd71[_0x21de('0x31')][_0x21de('0x42')]){_0x3f2e7e[_0x21de('0x43')]=[{'all':!![]}];}_0x3f2e7e=_['merge']({},_0x3f2e7e,_0x3ccd71[_0x21de('0x40')]);return db[_0x21de('0x2e')][_0x21de('0x48')](_0x3f2e7e)[_0x21de('0x27')](handleEntityNotFound(_0x233534,null))[_0x21de('0x27')](respondWithResult(_0x233534,null))[_0x21de('0x45')](handleError(_0x233534,null));};exports[_0x21de('0x49')]=function(_0x2f9c61,_0x488a69){return db['SquareRecording'][_0x21de('0x49')](_0x2f9c61[_0x21de('0x4a')],{})[_0x21de('0x27')](respondWithResult(_0x488a69,0xc9))[_0x21de('0x45')](handleError(_0x488a69,null));};exports[_0x21de('0x26')]=function(_0x573f08,_0x4b24e7){if(_0x573f08[_0x21de('0x4a')]['id']){delete _0x573f08[_0x21de('0x4a')]['id'];}return db[_0x21de('0x2e')][_0x21de('0x48')]({'where':{'id':_0x573f08[_0x21de('0x46')]['id']}})[_0x21de('0x27')](handleEntityNotFound(_0x4b24e7,null))['then'](saveUpdates(_0x573f08[_0x21de('0x4a')],null))['then'](respondWithResult(_0x4b24e7,null))[_0x21de('0x45')](handleError(_0x4b24e7,null));};exports[_0x21de('0x4b')]=function(_0x50b81a,_0x200d77,_0x2d412a){var _0x58fce4=require(_0x21de('0x4c'));var _0x17a365=![];var _0x1b3a15={};if(_0x50b81a[_0x21de('0x31')][_0x21de('0x2f')]&&_0x50b81a[_0x21de('0x31')][_0x21de('0x2f')]===_0x21de('0x4d')){_0x1b3a15[_0x21de('0x4d')]=_0x50b81a[_0x21de('0x46')]['id'];}else{_0x1b3a15['id']=_0x50b81a['params']['id'];}return db[_0x21de('0x2e')][_0x21de('0x48')]({'where':_0x1b3a15,'attributes':['id',_0x21de('0x4e'),_0x21de('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x200d77,null))['then'](function(_0x287aad){if(_0x287aad){var _0xb704a5=_0x287aad[_0x21de('0x4e')];var _0xa8bdb8=util[_0x21de('0x50')]('%s.cypher',_0xb704a5);if(fs[_0x21de('0x51')](_0xa8bdb8)){_0x17a365=!![];return _0x58fce4[_0x21de('0x52')](_0xa8bdb8,_0xb704a5,config[_0x21de('0x53')][_0x21de('0x54')])[_0x21de('0x27')](function(){return _0x287aad;});}return _0x287aad;}})[_0x21de('0x27')](function(_0x4e8e0d){if(_0x4e8e0d){var _0x19f6f7=_0x4e8e0d['savePath'];if(!fs[_0x21de('0x51')](_0x19f6f7)){throw new db['Sequelize'][(_0x21de('0x55'))](_0x21de('0x56'));}if(_0x4e8e0d[_0x21de('0x4f')]){return _0x200d77['download'](_0x19f6f7,_0x4e8e0d['filename']+path[_0x21de('0x57')](_0x19f6f7),function(){if(_0x17a365){fs[_0x21de('0x58')](_0x19f6f7);}});}else{return _0x200d77[_0x21de('0x4b')](_0x19f6f7,function(_0xd06021){if(_0x17a365){fs['unlink'](_0x19f6f7);}});}}})[_0x21de('0x45')](function(_0x3a499a){if(_0x3a499a['message']===_0x21de('0x56')){_0x200d77['status'](0x194)[_0x21de('0x2b')](_0x21de('0x59'));}else{return handleError(_0x200d77,null);}});};exports['destroy']=function(_0x35ee16,_0x39dc80){return db[_0x21de('0x2e')][_0x21de('0x48')]({'where':{'id':_0x35ee16['params']['id']}})[_0x21de('0x27')](function(_0x100a33){if(_[_0x21de('0x5a')](_0x100a33)){throw new ReferenceError(_0x21de('0x5b'));}return _0x100a33;})[_0x21de('0x27')](function(_0x227969){var _0x603fc8=_0x227969[_0x21de('0x4e')];logger[_0x21de('0x5c')](_0x21de('0x5d'),_0x603fc8);if(!_[_0x21de('0x5a')](_0x227969[_0x21de('0x4e')])&&fs[_0x21de('0x51')](_0x603fc8)){logger[_0x21de('0x5c')](_0x21de('0x5e')+_0x603fc8+_0x21de('0x5f'));fs[_0x21de('0x60')](_0x603fc8);}_0x603fc8=_0x603fc8+_0x21de('0x61');if(!_['isNil'](_0x227969[_0x21de('0x4e')])&&fs[_0x21de('0x51')](_0x603fc8)){logger[_0x21de('0x5c')](_0x21de('0x5e')+_0x603fc8+_0x21de('0x5f'));fs['unlinkSync'](_0x603fc8);}return _0x227969;})[_0x21de('0x27')](function(_0x5b8070){if(!_0x5b8070)throw new InternalError();return _0x5b8070[_0x21de('0x28')]();})['then'](function(){_0x39dc80[_0x21de('0x1c')](0xcc)[_0x21de('0x1b')]();})[_0x21de('0x45')](handleError(_0x39dc80,null));};
\ No newline at end of file
+var _0x3b90=['merge','options','includeAll','include','findAll','catch','show','params','find','create','body','download','../../components/encryptor','uniqueid','savePath','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','fast-json-patch','moment','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','update','then','destroy','error','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3b90,0x82));var _0x03b9=function(_0x4e8286,_0x4eaeb4){_0x4e8286=_0x4e8286-0x0;var _0x44a440=_0x3b90[_0x4e8286];return _0x44a440;};'use strict';var emlformat=require(_0x03b9('0x0'));var rimraf=require(_0x03b9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x03b9('0x2'));var rp=require('request-promise');var moment=require(_0x03b9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x03b9('0x4'));var util=require('util');var path=require(_0x03b9('0x5'));var sox=require(_0x03b9('0x6'));var csv=require(_0x03b9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x03b9('0x8'));var squel=require('squel');var crypto=require(_0x03b9('0x9'));var jsforce=require(_0x03b9('0xa'));var deskjs=require(_0x03b9('0xb'));var toCsv=require(_0x03b9('0x7'));var querystring=require(_0x03b9('0xc'));var Papa=require(_0x03b9('0xd'));var Redis=require(_0x03b9('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x03b9('0xf'));var as=require(_0x03b9('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x03b9('0x11'))(_0x03b9('0x12'));var utils=require(_0x03b9('0x13'));var config=require(_0x03b9('0x14'));var licenseUtil=require(_0x03b9('0x15'));var db=require(_0x03b9('0x16'))['db'];function respondWithStatusCode(_0x48a8c0,_0x273057){_0x273057=_0x273057||0xcc;return function(_0x1641ef){if(_0x1641ef){return _0x48a8c0[_0x03b9('0x17')](_0x273057);}return _0x48a8c0[_0x03b9('0x18')](_0x273057)[_0x03b9('0x19')]();};}function respondWithResult(_0x539539,_0xb8b897){_0xb8b897=_0xb8b897||0xc8;return function(_0x1e7fba){if(_0x1e7fba){return _0x539539['status'](_0xb8b897)['json'](_0x1e7fba);}};}function respondWithFilteredResult(_0x42c4f3,_0x49482c){return function(_0x1a20ae){if(_0x1a20ae){var _0x4fa459=typeof _0x49482c[_0x03b9('0x1a')]===_0x03b9('0x1b')&&typeof _0x49482c[_0x03b9('0x1c')]===_0x03b9('0x1b');var _0x211daf=_0x1a20ae[_0x03b9('0x1d')];var _0x185e4d=_0x4fa459?0x0:_0x49482c['offset'];var _0x1e7af6=_0x4fa459?_0x1a20ae['count']:_0x49482c[_0x03b9('0x1a')]+_0x49482c[_0x03b9('0x1c')];var _0xf25e9b;if(_0x1e7af6>=_0x211daf){_0x1e7af6=_0x211daf;_0xf25e9b=0xc8;}else{_0xf25e9b=0xce;}_0x42c4f3[_0x03b9('0x18')](_0xf25e9b);return _0x42c4f3['set'](_0x03b9('0x1e'),_0x185e4d+'-'+_0x1e7af6+'/'+_0x211daf)['json'](_0x1a20ae);}return null;};}function patchUpdates(_0xb404f2){return function(_0x282f7d){try{jsonpatch['apply'](_0x282f7d,_0xb404f2,!![]);}catch(_0x56c6de){return BPromise['reject'](_0x56c6de);}return _0x282f7d['save']();};}function saveUpdates(_0x1cf892,_0x5bef9e){return function(_0x2748a8){if(_0x2748a8){return _0x2748a8[_0x03b9('0x1f')](_0x1cf892)[_0x03b9('0x20')](function(_0x12cd26){return _0x12cd26;});}return null;};}function removeEntity(_0x220c60,_0x54662c){return function(_0x5c9054){if(_0x5c9054){return _0x5c9054[_0x03b9('0x21')]()[_0x03b9('0x20')](function(){_0x220c60[_0x03b9('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4277be,_0x19a361){return function(_0x41a807){if(!_0x41a807){_0x4277be['sendStatus'](0x194);}return _0x41a807;};}function handleError(_0x4bc046,_0x5a9105){_0x5a9105=_0x5a9105||0x1f4;return function(_0x1f6249){logger[_0x03b9('0x22')](_0x1f6249[_0x03b9('0x23')]);if(_0x1f6249[_0x03b9('0x24')]){delete _0x1f6249[_0x03b9('0x24')];}_0x4bc046[_0x03b9('0x18')](_0x5a9105)[_0x03b9('0x25')](_0x1f6249);};}exports[_0x03b9('0x26')]=function(_0x38ef50,_0x2ebb34){var _0x541eb1={},_0x456fc7={},_0x1686ec={'count':0x0,'rows':[]};var _0x27490d=_[_0x03b9('0x27')](db[_0x03b9('0x28')][_0x03b9('0x29')],function(_0x20dfec){return{'name':_0x20dfec[_0x03b9('0x2a')],'type':_0x20dfec[_0x03b9('0x2b')][_0x03b9('0x2c')]};});_0x456fc7[_0x03b9('0x2d')]=_[_0x03b9('0x27')](_0x27490d,_0x03b9('0x24'));_0x456fc7[_0x03b9('0x2e')]=_[_0x03b9('0x2f')](_0x38ef50['query']);_0x456fc7[_0x03b9('0x30')]=_[_0x03b9('0x31')](_0x456fc7[_0x03b9('0x2d')],_0x456fc7[_0x03b9('0x2e')]);_0x541eb1[_0x03b9('0x32')]=_[_0x03b9('0x31')](_0x456fc7['model'],qs[_0x03b9('0x33')](_0x38ef50['query'][_0x03b9('0x33')]));_0x541eb1[_0x03b9('0x32')]=_0x541eb1['attributes'][_0x03b9('0x34')]?_0x541eb1[_0x03b9('0x32')]:_0x456fc7[_0x03b9('0x2d')];if(!_0x38ef50[_0x03b9('0x2e')]['hasOwnProperty'](_0x03b9('0x35'))){_0x541eb1[_0x03b9('0x1c')]=qs['limit'](_0x38ef50[_0x03b9('0x2e')][_0x03b9('0x1c')]);_0x541eb1[_0x03b9('0x1a')]=qs[_0x03b9('0x1a')](_0x38ef50['query'][_0x03b9('0x1a')]);}_0x541eb1[_0x03b9('0x36')]=qs[_0x03b9('0x37')](_0x38ef50[_0x03b9('0x2e')]['sort']);_0x541eb1[_0x03b9('0x38')]=qs['filters'](_[_0x03b9('0x39')](_0x38ef50[_0x03b9('0x2e')],_0x456fc7[_0x03b9('0x30')]),_0x27490d);if(_0x38ef50[_0x03b9('0x2e')][_0x03b9('0x3a')]){_0x541eb1[_0x03b9('0x38')]=_['merge'](_0x541eb1['where'],{'$or':_[_0x03b9('0x27')](_0x27490d,function(_0x1951b2){if(_0x1951b2['type']!==_0x03b9('0x3b')){var _0x1e4099={};_0x1e4099[_0x1951b2[_0x03b9('0x24')]]={'$like':'%'+_0x38ef50[_0x03b9('0x2e')][_0x03b9('0x3a')]+'%'};return _0x1e4099;}})});}_0x541eb1=_[_0x03b9('0x3c')]({},_0x541eb1,_0x38ef50[_0x03b9('0x3d')]);var _0x33a5cf={'where':_0x541eb1[_0x03b9('0x38')]};return db[_0x03b9('0x28')][_0x03b9('0x1d')](_0x33a5cf)[_0x03b9('0x20')](function(_0x155fd6){_0x1686ec['count']=_0x155fd6;if(_0x38ef50[_0x03b9('0x2e')][_0x03b9('0x3e')]){_0x541eb1[_0x03b9('0x3f')]=[{'all':!![]}];}return db[_0x03b9('0x28')][_0x03b9('0x40')](_0x541eb1);})[_0x03b9('0x20')](function(_0x50d8ad){_0x1686ec['rows']=_0x50d8ad;return _0x1686ec;})[_0x03b9('0x20')](respondWithFilteredResult(_0x2ebb34,_0x541eb1))[_0x03b9('0x41')](handleError(_0x2ebb34,null));};exports[_0x03b9('0x42')]=function(_0x47314b,_0x26c09c){var _0x553aa9={'raw':!![],'where':{'id':_0x47314b[_0x03b9('0x43')]['id']}},_0x5c2cf4={};_0x5c2cf4[_0x03b9('0x2d')]=_[_0x03b9('0x2f')](db[_0x03b9('0x28')][_0x03b9('0x29')]);_0x5c2cf4[_0x03b9('0x2e')]=_[_0x03b9('0x2f')](_0x47314b['query']);_0x5c2cf4[_0x03b9('0x30')]=_[_0x03b9('0x31')](_0x5c2cf4[_0x03b9('0x2d')],_0x5c2cf4['query']);_0x553aa9[_0x03b9('0x32')]=_[_0x03b9('0x31')](_0x5c2cf4['model'],qs[_0x03b9('0x33')](_0x47314b['query'][_0x03b9('0x33')]));_0x553aa9[_0x03b9('0x32')]=_0x553aa9[_0x03b9('0x32')]['length']?_0x553aa9[_0x03b9('0x32')]:_0x5c2cf4[_0x03b9('0x2d')];if(_0x47314b[_0x03b9('0x2e')][_0x03b9('0x3e')]){_0x553aa9[_0x03b9('0x3f')]=[{'all':!![]}];}_0x553aa9=_[_0x03b9('0x3c')]({},_0x553aa9,_0x47314b[_0x03b9('0x3d')]);return db[_0x03b9('0x28')][_0x03b9('0x44')](_0x553aa9)[_0x03b9('0x20')](handleEntityNotFound(_0x26c09c,null))['then'](respondWithResult(_0x26c09c,null))[_0x03b9('0x41')](handleError(_0x26c09c,null));};exports[_0x03b9('0x45')]=function(_0x27848f,_0x40bd1b){return db['SquareRecording']['create'](_0x27848f['body'],{})[_0x03b9('0x20')](respondWithResult(_0x40bd1b,0xc9))[_0x03b9('0x41')](handleError(_0x40bd1b,null));};exports['update']=function(_0x552cc1,_0x31a5c3){if(_0x552cc1[_0x03b9('0x46')]['id']){delete _0x552cc1['body']['id'];}return db['SquareRecording'][_0x03b9('0x44')]({'where':{'id':_0x552cc1['params']['id']}})[_0x03b9('0x20')](handleEntityNotFound(_0x31a5c3,null))[_0x03b9('0x20')](saveUpdates(_0x552cc1[_0x03b9('0x46')],null))[_0x03b9('0x20')](respondWithResult(_0x31a5c3,null))[_0x03b9('0x41')](handleError(_0x31a5c3,null));};exports[_0x03b9('0x47')]=function(_0x3902e6,_0x5b09a2,_0x32bd5e){var _0xab1bb2=require(_0x03b9('0x48'));var _0x3072b7=![];var _0x3fd67d={};if(_0x3902e6[_0x03b9('0x2e')][_0x03b9('0x2b')]&&_0x3902e6[_0x03b9('0x2e')][_0x03b9('0x2b')]===_0x03b9('0x49')){_0x3fd67d[_0x03b9('0x49')]=_0x3902e6['params']['id'];}else{_0x3fd67d['id']=_0x3902e6[_0x03b9('0x43')]['id'];}return db[_0x03b9('0x28')][_0x03b9('0x44')]({'where':_0x3fd67d,'attributes':['id',_0x03b9('0x4a'),'filename'],'raw':!![]})[_0x03b9('0x20')](handleEntityNotFound(_0x5b09a2,null))[_0x03b9('0x20')](function(_0x27d1df){if(_0x27d1df){var _0x4fd348=_0x27d1df[_0x03b9('0x4a')];var _0x32e0c8=util[_0x03b9('0x4b')](_0x03b9('0x4c'),_0x4fd348);if(fs[_0x03b9('0x4d')](_0x32e0c8)){_0x3072b7=!![];return _0xab1bb2[_0x03b9('0x4e')](_0x32e0c8,_0x4fd348,config[_0x03b9('0x4f')][_0x03b9('0x50')])['then'](function(){return _0x27d1df;});}return _0x27d1df;}})[_0x03b9('0x20')](function(_0x19d7cf){if(_0x19d7cf){var _0x2eb01c=_0x19d7cf[_0x03b9('0x4a')];if(!fs[_0x03b9('0x4d')](_0x2eb01c)){throw new db[(_0x03b9('0x51'))][(_0x03b9('0x52'))](_0x03b9('0x53'));}if(_0x19d7cf['filename']){return _0x5b09a2['download'](_0x2eb01c,_0x19d7cf[_0x03b9('0x54')]+path[_0x03b9('0x55')](_0x2eb01c),function(){if(_0x3072b7){fs[_0x03b9('0x56')](_0x2eb01c);}});}else{return _0x5b09a2['download'](_0x2eb01c,function(_0x338720){if(_0x3072b7){fs[_0x03b9('0x56')](_0x2eb01c);}});}}})[_0x03b9('0x41')](function(_0x3d62bb){if(_0x3d62bb[_0x03b9('0x57')]===_0x03b9('0x53')){_0x5b09a2[_0x03b9('0x18')](0x194)[_0x03b9('0x25')](_0x03b9('0x58'));}else{return handleError(_0x5b09a2,null);}});};exports['destroy']=function(_0x448868,_0x80572f){return db[_0x03b9('0x28')]['find']({'where':{'id':_0x448868[_0x03b9('0x43')]['id']}})['then'](function(_0x43fe15){if(_[_0x03b9('0x59')](_0x43fe15)){throw new ReferenceError(_0x03b9('0x5a'));}return _0x43fe15;})[_0x03b9('0x20')](function(_0x41797a){var _0x48c562=_0x41797a[_0x03b9('0x4a')];logger[_0x03b9('0x5b')]('cancellazione\x20fisica\x20documento\x20%s',_0x48c562);if(!_[_0x03b9('0x59')](_0x41797a[_0x03b9('0x4a')])&&fs['existsSync'](_0x48c562)){logger[_0x03b9('0x5b')](_0x03b9('0x5c')+_0x48c562+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x03b9('0x5d')](_0x48c562);}_0x48c562=_0x48c562+'.cypher';if(!_[_0x03b9('0x59')](_0x41797a[_0x03b9('0x4a')])&&fs[_0x03b9('0x4d')](_0x48c562)){logger['info'](_0x03b9('0x5c')+_0x48c562+_0x03b9('0x5e'));fs[_0x03b9('0x5d')](_0x48c562);}return _0x41797a;})[_0x03b9('0x20')](function(_0x45e820){if(!_0x45e820)throw new InternalError();return _0x45e820['destroy']();})['then'](function(){_0x80572f[_0x03b9('0x18')](0xcc)[_0x03b9('0x19')]();})[_0x03b9('0x41')](handleError(_0x80572f,null));};
\ No newline at end of file
index 8a70789..50e4f70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0755=['rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x86653c,_0x360658){var _0x539d1f=function(_0x5a7b7e){while(--_0x5a7b7e){_0x86653c['push'](_0x86653c['shift']());}};_0x539d1f(++_0x360658);}(_0x0755,0x7c));var _0x5075=function(_0x3d8286,_0x47304d){_0x3d8286=_0x3d8286-0x0;var _0x137c9b=_0x0755[_0x3d8286];return _0x137c9b;};'use strict';var _=require(_0x5075('0x0'));var util=require(_0x5075('0x1'));var logger=require(_0x5075('0x2'))(_0x5075('0x3'));var moment=require(_0x5075('0x4'));var BPromise=require(_0x5075('0x5'));var rp=require(_0x5075('0x6'));var fs=require('fs');var path=require(_0x5075('0x7'));var rimraf=require(_0x5075('0x8'));var config=require(_0x5075('0x9'));var attributes=require('./squareRecording.attributes');module[_0x5075('0xa')]=function(_0x2a7be,_0x3f4fea){return _0x2a7be[_0x5075('0xb')]('SquareRecording',attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x16ce=['square_recordings','util','../../config/logger','api','moment','bluebird','request-promise','./squareRecording.attributes','define','SquareRecording'];(function(_0x16a82a,_0x1e00e4){var _0x401b80=function(_0x421dfc){while(--_0x421dfc){_0x16a82a['push'](_0x16a82a['shift']());}};_0x401b80(++_0x1e00e4);}(_0x16ce,0xfb));var _0xe16c=function(_0x2c3d32,_0x1e03dd){_0x2c3d32=_0x2c3d32-0x0;var _0x1bab0c=_0x16ce[_0x2c3d32];return _0x1bab0c;};'use strict';var _=require('lodash');var util=require(_0xe16c('0x0'));var logger=require(_0xe16c('0x1'))(_0xe16c('0x2'));var moment=require(_0xe16c('0x3'));var BPromise=require(_0xe16c('0x4'));var rp=require(_0xe16c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe16c('0x6'));module['exports']=function(_0x1707f9,_0x13ee4a){return _0x1707f9[_0xe16c('0x7')](_0xe16c('0x8'),attributes,{'tableName':_0xe16c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 28d1f61..041e6ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb4c=['options','lodash','moment','bluebird','randomstring','../../config/logger','rpc','client','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareRecording','create','body'];(function(_0x212fcc,_0x1a8867){var _0x4d8190=function(_0x347f7b){while(--_0x347f7b){_0x212fcc['push'](_0x212fcc['shift']());}};_0x4d8190(++_0x1a8867);}(_0xdb4c,0xf1));var _0xcdb4=function(_0x4ecefa,_0x56e320){_0x4ecefa=_0x4ecefa-0x0;var _0x78f983=_0xdb4c[_0x4ecefa];return _0x78f983;};'use strict';var _=require(_0xcdb4('0x0'));var util=require('util');var moment=require(_0xcdb4('0x1'));var BPromise=require(_0xcdb4('0x2'));var rs=require(_0xcdb4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcdb4('0x4'))(_0xcdb4('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcdb4('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3af510,_0x2fba7c,_0x5d982e){return new BPromise(function(_0x8bc06c,_0xe13aed){return client[_0xcdb4('0x7')](_0x3af510,_0x5d982e)[_0xcdb4('0x8')](function(_0x367cba){logger[_0xcdb4('0x9')](_0xcdb4('0xa'),_0x2fba7c,_0xcdb4('0xb'));logger[_0xcdb4('0xc')](_0xcdb4('0xd'),_0x2fba7c,_0xcdb4('0xb'),JSON[_0xcdb4('0xe')](_0x367cba));if(_0x367cba[_0xcdb4('0xf')]){if(_0x367cba[_0xcdb4('0xf')][_0xcdb4('0x10')]===0x1f4){logger[_0xcdb4('0xf')]('SquareRecording,\x20%s,\x20%s',_0x2fba7c,_0x367cba[_0xcdb4('0xf')][_0xcdb4('0x11')]);return _0xe13aed(_0x367cba[_0xcdb4('0xf')][_0xcdb4('0x11')]);}logger[_0xcdb4('0xf')](_0xcdb4('0xa'),_0x2fba7c,_0x367cba[_0xcdb4('0xf')][_0xcdb4('0x11')]);return _0x8bc06c(_0x367cba[_0xcdb4('0xf')][_0xcdb4('0x11')]);}else{logger[_0xcdb4('0x9')](_0xcdb4('0xa'),_0x2fba7c,_0xcdb4('0xb'));_0x8bc06c(_0x367cba[_0xcdb4('0x12')][_0xcdb4('0x11')]);}})[_0xcdb4('0x13')](function(_0x7e5a38){logger[_0xcdb4('0xf')](_0xcdb4('0xa'),_0x2fba7c,_0x7e5a38);_0xe13aed(_0x7e5a38);});});}exports[_0xcdb4('0x14')]=function(_0x561253){var _0x159d3c=this;return new Promise(function(_0x3a296d,_0x5a5260){return db['SquareRecording'][_0xcdb4('0x15')](_0x561253[_0xcdb4('0x16')],{'raw':_0x561253['options']?_0x561253[_0xcdb4('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x289a8){logger[_0xcdb4('0x9')](_0xcdb4('0x14'),_0x561253);logger[_0xcdb4('0xc')]('CreateSquareRecording',_0x561253,JSON[_0xcdb4('0xe')](_0x289a8));_0x3a296d(_0x289a8);})[_0xcdb4('0x13')](function(_0xf8fc2f){logger['error'](_0xcdb4('0x14'),_0xf8fc2f[_0xcdb4('0x11')],_0x561253);_0x5a5260(_0x159d3c[_0xcdb4('0xf')](0x1f4,_0xf8fc2f['message']));});});};
\ No newline at end of file
+var _0x94f9=['moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client','request','then','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','util'];(function(_0x22566a,_0x409733){var _0x47fff6=function(_0x15e481){while(--_0x15e481){_0x22566a['push'](_0x22566a['shift']());}};_0x47fff6(++_0x409733);}(_0x94f9,0x194));var _0x994f=function(_0x54c778,_0x4a859f){_0x54c778=_0x54c778-0x0;var _0x2c4be9=_0x94f9[_0x54c778];return _0x2c4be9;};'use strict';var _=require('lodash');var util=require(_0x994f('0x0'));var moment=require(_0x994f('0x1'));var BPromise=require(_0x994f('0x2'));var rs=require(_0x994f('0x3'));var fs=require('fs');var Redis=require(_0x994f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x994f('0x5'))('rpc');var config=require(_0x994f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x994f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x496b24,_0x1c8eb7,_0xff9a53){return new BPromise(function(_0x124a20,_0x4021c3){return client[_0x994f('0x8')](_0x496b24,_0xff9a53)[_0x994f('0x9')](function(_0x1605e0){logger[_0x994f('0xa')](_0x994f('0xb'),_0x1c8eb7,'request\x20sent');logger[_0x994f('0xc')](_0x994f('0xd'),_0x1c8eb7,_0x994f('0xe'),JSON[_0x994f('0xf')](_0x1605e0));if(_0x1605e0[_0x994f('0x10')]){if(_0x1605e0[_0x994f('0x10')][_0x994f('0x11')]===0x1f4){logger[_0x994f('0x10')](_0x994f('0xb'),_0x1c8eb7,_0x1605e0[_0x994f('0x10')][_0x994f('0x12')]);return _0x4021c3(_0x1605e0[_0x994f('0x10')]['message']);}logger[_0x994f('0x10')](_0x994f('0xb'),_0x1c8eb7,_0x1605e0[_0x994f('0x10')][_0x994f('0x12')]);return _0x124a20(_0x1605e0[_0x994f('0x10')][_0x994f('0x12')]);}else{logger['info'](_0x994f('0xb'),_0x1c8eb7,_0x994f('0xe'));_0x124a20(_0x1605e0[_0x994f('0x13')][_0x994f('0x12')]);}})[_0x994f('0x14')](function(_0x10c3d7){logger[_0x994f('0x10')](_0x994f('0xb'),_0x1c8eb7,_0x10c3d7);_0x4021c3(_0x10c3d7);});});}exports[_0x994f('0x15')]=function(_0x4da3e4){var _0x4008ee=this;return new Promise(function(_0x283c64,_0x2d598e){return db[_0x994f('0x16')][_0x994f('0x17')](_0x4da3e4[_0x994f('0x18')],{'raw':_0x4da3e4[_0x994f('0x19')]?_0x4da3e4[_0x994f('0x19')][_0x994f('0x1a')]===undefined?!![]:![]:!![]})[_0x994f('0x9')](function(_0x525445){logger['info'](_0x994f('0x15'),_0x4da3e4);logger[_0x994f('0xc')](_0x994f('0x15'),_0x4da3e4,JSON['stringify'](_0x525445));_0x283c64(_0x525445);})[_0x994f('0x14')](function(_0x17d714){logger[_0x994f('0x10')](_0x994f('0x15'),_0x17d714[_0x994f('0x12')],_0x4da3e4);_0x2d598e(_0x4008ee[_0x994f('0x10')](0x1f4,_0x17d714[_0x994f('0x12')]));});});};
\ No newline at end of file
index e5608ae..9428504 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x33f64c,_0x37c749){var _0x3f55e1=function(_0x5f1a85){while(--_0x5f1a85){_0x33f64c['push'](_0x33f64c['shift']());}};_0x3f55e1(++_0x37c749);}(_0xe706,0xa3));var _0x6e70=function(_0x19dd8a,_0x449861){_0x19dd8a=_0x19dd8a-0x0;var _0x212ccc=_0xe706[_0x19dd8a];return _0x212ccc;};'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'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router;
\ No newline at end of file
+var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','/describe','show','post'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
index 26dad29..5cafe4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61ea=['DATE','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x61ea,0x13d));var _0xa61e=function(_0x2a8a42,_0x4cc83a){_0x2a8a42=_0x2a8a42-0x0;var _0x5d35f2=_0x61ea[_0x2a8a42];return _0x5d35f2;};'use strict';var Sequelize=require(_0xa61e('0x0'));module[_0xa61e('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xa61e('0x2')]},'request':{'type':Sequelize[_0xa61e('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xa61e('0x2')]},'type':{'type':Sequelize[_0xa61e('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xa61e('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xa61e('0x2')]},'callington':{'type':Sequelize[_0xa61e('0x2')]},'callingtns':{'type':Sequelize[_0xa61e('0x2')]},'dnid':{'type':Sequelize[_0xa61e('0x2')]},'rdnis':{'type':Sequelize[_0xa61e('0x2')]},'context':{'type':Sequelize[_0xa61e('0x2')]},'extension':{'type':Sequelize[_0xa61e('0x2')]},'priority':{'type':Sequelize[_0xa61e('0x2')]},'enhanced':{'type':Sequelize[_0xa61e('0x2')]},'accountcode':{'type':Sequelize[_0xa61e('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xa61e('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x1dba=['sequelize','STRING','BOOLEAN'];(function(_0xf7b283,_0xd807fa){var _0x48ac64=function(_0x53e795){while(--_0x53e795){_0xf7b283['push'](_0xf7b283['shift']());}};_0x48ac64(++_0xd807fa);}(_0x1dba,0xf9));var _0xa1db=function(_0x406b38,_0x48f4be){_0x406b38=_0x406b38-0x0;var _0x2650cc=_0x1dba[_0x406b38];return _0x2650cc;};'use strict';var Sequelize=require(_0xa1db('0x0'));module['exports']={'network':{'type':Sequelize[_0xa1db('0x1')]},'network_script':{'type':Sequelize[_0xa1db('0x1')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xa1db('0x1')]},'type':{'type':Sequelize[_0xa1db('0x1')]},'uniqueid':{'type':Sequelize[_0xa1db('0x1')]},'version':{'type':Sequelize[_0xa1db('0x1')]},'callerid':{'type':Sequelize[_0xa1db('0x1')]},'calleridname':{'type':Sequelize[_0xa1db('0x1')]},'callingpres':{'type':Sequelize[_0xa1db('0x1')]},'callingani2':{'type':Sequelize[_0xa1db('0x1')]},'callington':{'type':Sequelize[_0xa1db('0x1')]},'callingtns':{'type':Sequelize[_0xa1db('0x1')]},'dnid':{'type':Sequelize[_0xa1db('0x1')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xa1db('0x1')]},'extension':{'type':Sequelize[_0xa1db('0x1')]},'priority':{'type':Sequelize[_0xa1db('0x1')]},'enhanced':{'type':Sequelize[_0xa1db('0x1')]},'accountcode':{'type':Sequelize[_0xa1db('0x1')]},'threadid':{'type':Sequelize[_0xa1db('0x1')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0xa1db('0x2')],'defaultValue':![]}};
\ No newline at end of file
index c0c548e..ce85897 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5edb=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','Content-Range','save','update','destroy','then','sendStatus','name','send','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','SquareReport','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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'];(function(_0x5457a4,_0x258eda){var _0x3ae8eb=function(_0xcc183){while(--_0xcc183){_0x5457a4['push'](_0x5457a4['shift']());}};_0x3ae8eb(++_0x258eda);}(_0x5edb,0xd0));var _0xb5ed=function(_0x338fad,_0x1d7cdd){_0x338fad=_0x338fad-0x0;var _0xaf44b1=_0x5edb[_0x338fad];return _0xaf44b1;};'use strict';var emlformat=require(_0xb5ed('0x0'));var rimraf=require(_0xb5ed('0x1'));var zipdir=require(_0xb5ed('0x2'));var jsonpatch=require(_0xb5ed('0x3'));var rp=require(_0xb5ed('0x4'));var moment=require(_0xb5ed('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xb5ed('0x6'));var sox=require(_0xb5ed('0x7'));var csv=require(_0xb5ed('0x8'));var ejs=require(_0xb5ed('0x9'));var fs=require('fs');var fs_extra=require(_0xb5ed('0xa'));var _=require(_0xb5ed('0xb'));var squel=require(_0xb5ed('0xc'));var crypto=require(_0xb5ed('0xd'));var jsforce=require(_0xb5ed('0xe'));var deskjs=require(_0xb5ed('0xf'));var toCsv=require(_0xb5ed('0x8'));var querystring=require(_0xb5ed('0x10'));var Papa=require(_0xb5ed('0x11'));var Redis=require(_0xb5ed('0x12'));var authService=require(_0xb5ed('0x13'));var qs=require(_0xb5ed('0x14'));var as=require(_0xb5ed('0x15'));var hardwareService=require(_0xb5ed('0x16'));var logger=require('../../config/logger')(_0xb5ed('0x17'));var utils=require(_0xb5ed('0x18'));var config=require(_0xb5ed('0x19'));var licenseUtil=require(_0xb5ed('0x1a'));var db=require(_0xb5ed('0x1b'))['db'];function respondWithStatusCode(_0x1509f0,_0x1e34b7){_0x1e34b7=_0x1e34b7||0xcc;return function(_0x2d8572){if(_0x2d8572){return _0x1509f0['sendStatus'](_0x1e34b7);}return _0x1509f0['status'](_0x1e34b7)[_0xb5ed('0x1c')]();};}function respondWithResult(_0x28ee7c,_0x2ff7aa){_0x2ff7aa=_0x2ff7aa||0xc8;return function(_0x539a32){if(_0x539a32){return _0x28ee7c[_0xb5ed('0x1d')](_0x2ff7aa)[_0xb5ed('0x1e')](_0x539a32);}};}function respondWithFilteredResult(_0x145c1b,_0xb826){return function(_0x5b5aec){if(_0x5b5aec){var _0x5d2124=typeof _0xb826[_0xb5ed('0x1f')]===_0xb5ed('0x20')&&typeof _0xb826[_0xb5ed('0x21')]===_0xb5ed('0x20');var _0x3ca313=_0x5b5aec[_0xb5ed('0x22')];var _0x3fe4d2=_0x5d2124?0x0:_0xb826[_0xb5ed('0x1f')];var _0x3939c3=_0x5d2124?_0x5b5aec[_0xb5ed('0x22')]:_0xb826['offset']+_0xb826[_0xb5ed('0x21')];var _0x1334e3;if(_0x3939c3>=_0x3ca313){_0x3939c3=_0x3ca313;_0x1334e3=0xc8;}else{_0x1334e3=0xce;}_0x145c1b[_0xb5ed('0x1d')](_0x1334e3);return _0x145c1b['set'](_0xb5ed('0x23'),_0x3fe4d2+'-'+_0x3939c3+'/'+_0x3ca313)[_0xb5ed('0x1e')](_0x5b5aec);}return null;};}function patchUpdates(_0x326243){return function(_0x129c54){try{jsonpatch['apply'](_0x129c54,_0x326243,!![]);}catch(_0x3bd9ab){return BPromise['reject'](_0x3bd9ab);}return _0x129c54[_0xb5ed('0x24')]();};}function saveUpdates(_0x57765f,_0xdeb926){return function(_0x3aac13){if(_0x3aac13){return _0x3aac13[_0xb5ed('0x25')](_0x57765f)['then'](function(_0x38b872){return _0x38b872;});}return null;};}function removeEntity(_0x83963b,_0x31b47c){return function(_0x419a4d){if(_0x419a4d){return _0x419a4d[_0xb5ed('0x26')]()[_0xb5ed('0x27')](function(){_0x83963b[_0xb5ed('0x1d')](0xcc)[_0xb5ed('0x1c')]();});}};}function handleEntityNotFound(_0x3fd5d8,_0x4aa6b4){return function(_0x12eb8d){if(!_0x12eb8d){_0x3fd5d8[_0xb5ed('0x28')](0x194);}return _0x12eb8d;};}function handleError(_0x57c2ac,_0x80b2e9){_0x80b2e9=_0x80b2e9||0x1f4;return function(_0x356113){logger['error'](_0x356113['stack']);if(_0x356113[_0xb5ed('0x29')]){delete _0x356113[_0xb5ed('0x29')];}_0x57c2ac['status'](_0x80b2e9)[_0xb5ed('0x2a')](_0x356113);};}exports['index']=function(_0x289f2a,_0x289b91){var _0x17b8ff={},_0x118313={},_0x5e83b0={'count':0x0,'rows':[]};var _0x4b45cb=_[_0xb5ed('0x2b')](db['SquareReport']['rawAttributes'],function(_0x4a118c){return{'name':_0x4a118c[_0xb5ed('0x2c')],'type':_0x4a118c[_0xb5ed('0x2d')][_0xb5ed('0x2e')]};});_0x118313[_0xb5ed('0x2f')]=_[_0xb5ed('0x2b')](_0x4b45cb,_0xb5ed('0x29'));_0x118313[_0xb5ed('0x30')]=_['keys'](_0x289f2a['query']);_0x118313[_0xb5ed('0x31')]=_[_0xb5ed('0x32')](_0x118313['model'],_0x118313[_0xb5ed('0x30')]);_0x17b8ff['attributes']=_[_0xb5ed('0x32')](_0x118313[_0xb5ed('0x2f')],qs[_0xb5ed('0x33')](_0x289f2a[_0xb5ed('0x30')][_0xb5ed('0x33')]));_0x17b8ff[_0xb5ed('0x34')]=_0x17b8ff[_0xb5ed('0x34')][_0xb5ed('0x35')]?_0x17b8ff['attributes']:_0x118313[_0xb5ed('0x2f')];if(!_0x289f2a[_0xb5ed('0x30')][_0xb5ed('0x36')](_0xb5ed('0x37'))){_0x17b8ff[_0xb5ed('0x21')]=qs[_0xb5ed('0x21')](_0x289f2a[_0xb5ed('0x30')][_0xb5ed('0x21')]);_0x17b8ff[_0xb5ed('0x1f')]=qs[_0xb5ed('0x1f')](_0x289f2a['query'][_0xb5ed('0x1f')]);}_0x17b8ff[_0xb5ed('0x38')]=qs[_0xb5ed('0x39')](_0x289f2a['query'][_0xb5ed('0x39')]);_0x17b8ff[_0xb5ed('0x3a')]=qs['filters'](_[_0xb5ed('0x3b')](_0x289f2a[_0xb5ed('0x30')],_0x118313[_0xb5ed('0x31')]),_0x4b45cb);if(_0x289f2a[_0xb5ed('0x30')][_0xb5ed('0x3c')]){_0x17b8ff[_0xb5ed('0x3a')]=_[_0xb5ed('0x3d')](_0x17b8ff['where'],{'$or':_[_0xb5ed('0x2b')](_0x4b45cb,function(_0x291d64){if(_0x291d64[_0xb5ed('0x2d')]!=='VIRTUAL'){var _0x5c91f4={};_0x5c91f4[_0x291d64[_0xb5ed('0x29')]]={'$like':'%'+_0x289f2a[_0xb5ed('0x30')][_0xb5ed('0x3c')]+'%'};return _0x5c91f4;}})});}_0x17b8ff=_['merge']({},_0x17b8ff,_0x289f2a[_0xb5ed('0x3e')]);var _0x460168={'where':_0x17b8ff[_0xb5ed('0x3a')]};return db[_0xb5ed('0x3f')]['count'](_0x460168)['then'](function(_0x5473a0){_0x5e83b0[_0xb5ed('0x22')]=_0x5473a0;if(_0x289f2a['query'][_0xb5ed('0x40')]){_0x17b8ff[_0xb5ed('0x41')]=[{'all':!![]}];}return db[_0xb5ed('0x3f')][_0xb5ed('0x42')](_0x17b8ff);})['then'](function(_0x1b6159){_0x5e83b0[_0xb5ed('0x43')]=_0x1b6159;return _0x5e83b0;})[_0xb5ed('0x27')](respondWithFilteredResult(_0x289b91,_0x17b8ff))[_0xb5ed('0x44')](handleError(_0x289b91,null));};exports[_0xb5ed('0x45')]=function(_0x46bc18,_0x3f41a2){var _0x3532b2={'raw':!![],'where':{'id':_0x46bc18[_0xb5ed('0x46')]['id']}},_0x2dfe04={};_0x2dfe04[_0xb5ed('0x2f')]=_[_0xb5ed('0x47')](db[_0xb5ed('0x3f')][_0xb5ed('0x48')]);_0x2dfe04[_0xb5ed('0x30')]=_[_0xb5ed('0x47')](_0x46bc18[_0xb5ed('0x30')]);_0x2dfe04[_0xb5ed('0x31')]=_[_0xb5ed('0x32')](_0x2dfe04[_0xb5ed('0x2f')],_0x2dfe04[_0xb5ed('0x30')]);_0x3532b2['attributes']=_[_0xb5ed('0x32')](_0x2dfe04['model'],qs[_0xb5ed('0x33')](_0x46bc18['query'][_0xb5ed('0x33')]));_0x3532b2[_0xb5ed('0x34')]=_0x3532b2[_0xb5ed('0x34')][_0xb5ed('0x35')]?_0x3532b2[_0xb5ed('0x34')]:_0x2dfe04[_0xb5ed('0x2f')];if(_0x46bc18[_0xb5ed('0x30')][_0xb5ed('0x40')]){_0x3532b2[_0xb5ed('0x41')]=[{'all':!![]}];}_0x3532b2=_[_0xb5ed('0x3d')]({},_0x3532b2,_0x46bc18[_0xb5ed('0x3e')]);return db[_0xb5ed('0x3f')][_0xb5ed('0x49')](_0x3532b2)[_0xb5ed('0x27')](handleEntityNotFound(_0x3f41a2,null))['then'](respondWithResult(_0x3f41a2,null))[_0xb5ed('0x44')](handleError(_0x3f41a2,null));};exports[_0xb5ed('0x4a')]=function(_0x55c090,_0x48d5a5){return db[_0xb5ed('0x3f')][_0xb5ed('0x4a')](_0x55c090[_0xb5ed('0x4b')],{})[_0xb5ed('0x27')](respondWithResult(_0x48d5a5,0xc9))['catch'](handleError(_0x48d5a5,null));};exports[_0xb5ed('0x25')]=function(_0x31faf4,_0x51f0ca){if(_0x31faf4[_0xb5ed('0x4b')]['id']){delete _0x31faf4['body']['id'];}return db[_0xb5ed('0x3f')]['find']({'where':{'id':_0x31faf4['params']['id']}})['then'](handleEntityNotFound(_0x51f0ca,null))[_0xb5ed('0x27')](saveUpdates(_0x31faf4[_0xb5ed('0x4b')],null))[_0xb5ed('0x27')](respondWithResult(_0x51f0ca,null))[_0xb5ed('0x44')](handleError(_0x51f0ca,null));};exports[_0xb5ed('0x26')]=function(_0x4e35cb,_0x20acd1){return db[_0xb5ed('0x3f')]['find']({'where':{'id':_0x4e35cb['params']['id']}})[_0xb5ed('0x27')](handleEntityNotFound(_0x20acd1,null))[_0xb5ed('0x27')](removeEntity(_0x20acd1,null))[_0xb5ed('0x44')](handleError(_0x20acd1,null));};exports[_0xb5ed('0x4c')]=function(_0x5e8571,_0xa61e31){return db[_0xb5ed('0x3f')][_0xb5ed('0x4c')]()['then'](respondWithResult(_0xa61e31,null))[_0xb5ed('0x44')](handleError(_0xa61e31,null));};
\ No newline at end of file
+var _0x2e27=['jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','index','map','SquareReport','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','filters','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x2e27,0xcf));var _0x72e2=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x2e27[_0x2be8c2];return _0x97f531;};'use strict';var emlformat=require(_0x72e2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x72e2('0x1'));var jsonpatch=require(_0x72e2('0x2'));var rp=require('request-promise');var moment=require(_0x72e2('0x3'));var BPromise=require(_0x72e2('0x4'));var Mustache=require(_0x72e2('0x5'));var util=require(_0x72e2('0x6'));var path=require('path');var sox=require(_0x72e2('0x7'));var csv=require(_0x72e2('0x8'));var ejs=require(_0x72e2('0x9'));var fs=require('fs');var fs_extra=require(_0x72e2('0xa'));var _=require(_0x72e2('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x72e2('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x72e2('0xd'));var Papa=require('papaparse');var Redis=require(_0x72e2('0xe'));var authService=require(_0x72e2('0xf'));var qs=require(_0x72e2('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x72e2('0x11'));var logger=require(_0x72e2('0x12'))(_0x72e2('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x72e2('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x232fef,_0x450cc7){_0x450cc7=_0x450cc7||0xcc;return function(_0x3ebc98){if(_0x3ebc98){return _0x232fef[_0x72e2('0x15')](_0x450cc7);}return _0x232fef[_0x72e2('0x16')](_0x450cc7)[_0x72e2('0x17')]();};}function respondWithResult(_0x23a591,_0x5b5ab1){_0x5b5ab1=_0x5b5ab1||0xc8;return function(_0x1dcf94){if(_0x1dcf94){return _0x23a591[_0x72e2('0x16')](_0x5b5ab1)[_0x72e2('0x18')](_0x1dcf94);}};}function respondWithFilteredResult(_0x128afc,_0x3f5d09){return function(_0x399d3b){if(_0x399d3b){var _0x484893=typeof _0x3f5d09[_0x72e2('0x19')]===_0x72e2('0x1a')&&typeof _0x3f5d09[_0x72e2('0x1b')]==='undefined';var _0x37fc1d=_0x399d3b[_0x72e2('0x1c')];var _0x1dfdcd=_0x484893?0x0:_0x3f5d09[_0x72e2('0x19')];var _0x3f4ab3=_0x484893?_0x399d3b[_0x72e2('0x1c')]:_0x3f5d09[_0x72e2('0x19')]+_0x3f5d09[_0x72e2('0x1b')];var _0x3c4dd9;if(_0x3f4ab3>=_0x37fc1d){_0x3f4ab3=_0x37fc1d;_0x3c4dd9=0xc8;}else{_0x3c4dd9=0xce;}_0x128afc[_0x72e2('0x16')](_0x3c4dd9);return _0x128afc[_0x72e2('0x1d')]('Content-Range',_0x1dfdcd+'-'+_0x3f4ab3+'/'+_0x37fc1d)['json'](_0x399d3b);}return null;};}function patchUpdates(_0x2c7e4b){return function(_0x17041a){try{jsonpatch[_0x72e2('0x1e')](_0x17041a,_0x2c7e4b,!![]);}catch(_0x26f384){return BPromise[_0x72e2('0x1f')](_0x26f384);}return _0x17041a[_0x72e2('0x20')]();};}function saveUpdates(_0x36b981,_0x4683a6){return function(_0x46b8f7){if(_0x46b8f7){return _0x46b8f7[_0x72e2('0x21')](_0x36b981)[_0x72e2('0x22')](function(_0x1fc411){return _0x1fc411;});}return null;};}function removeEntity(_0x2d1c9f,_0x39c70a){return function(_0x591644){if(_0x591644){return _0x591644['destroy']()[_0x72e2('0x22')](function(){_0x2d1c9f[_0x72e2('0x16')](0xcc)[_0x72e2('0x17')]();});}};}function handleEntityNotFound(_0x2379a7,_0x3b552f){return function(_0x24e3f7){if(!_0x24e3f7){_0x2379a7['sendStatus'](0x194);}return _0x24e3f7;};}function handleError(_0x2c6503,_0xb108eb){_0xb108eb=_0xb108eb||0x1f4;return function(_0x427c14){logger[_0x72e2('0x23')](_0x427c14[_0x72e2('0x24')]);if(_0x427c14[_0x72e2('0x25')]){delete _0x427c14['name'];}_0x2c6503['status'](_0xb108eb)['send'](_0x427c14);};}exports[_0x72e2('0x26')]=function(_0x3dcfd2,_0x158ddf){var _0x58e1a4={},_0x28a8b5={},_0x23c46b={'count':0x0,'rows':[]};var _0x20805f=_[_0x72e2('0x27')](db[_0x72e2('0x28')][_0x72e2('0x29')],function(_0x2e2083){return{'name':_0x2e2083[_0x72e2('0x2a')],'type':_0x2e2083[_0x72e2('0x2b')]['key']};});_0x28a8b5[_0x72e2('0x2c')]=_['map'](_0x20805f,_0x72e2('0x25'));_0x28a8b5[_0x72e2('0x2d')]=_['keys'](_0x3dcfd2[_0x72e2('0x2d')]);_0x28a8b5['filters']=_[_0x72e2('0x2e')](_0x28a8b5['model'],_0x28a8b5[_0x72e2('0x2d')]);_0x58e1a4[_0x72e2('0x2f')]=_[_0x72e2('0x2e')](_0x28a8b5[_0x72e2('0x2c')],qs[_0x72e2('0x30')](_0x3dcfd2[_0x72e2('0x2d')][_0x72e2('0x30')]));_0x58e1a4[_0x72e2('0x2f')]=_0x58e1a4[_0x72e2('0x2f')][_0x72e2('0x31')]?_0x58e1a4[_0x72e2('0x2f')]:_0x28a8b5[_0x72e2('0x2c')];if(!_0x3dcfd2[_0x72e2('0x2d')][_0x72e2('0x32')](_0x72e2('0x33'))){_0x58e1a4[_0x72e2('0x1b')]=qs['limit'](_0x3dcfd2[_0x72e2('0x2d')][_0x72e2('0x1b')]);_0x58e1a4[_0x72e2('0x19')]=qs[_0x72e2('0x19')](_0x3dcfd2[_0x72e2('0x2d')][_0x72e2('0x19')]);}_0x58e1a4[_0x72e2('0x34')]=qs[_0x72e2('0x35')](_0x3dcfd2[_0x72e2('0x2d')]['sort']);_0x58e1a4[_0x72e2('0x36')]=qs['filters'](_[_0x72e2('0x37')](_0x3dcfd2[_0x72e2('0x2d')],_0x28a8b5['filters']),_0x20805f);if(_0x3dcfd2[_0x72e2('0x2d')][_0x72e2('0x38')]){_0x58e1a4['where']=_[_0x72e2('0x39')](_0x58e1a4['where'],{'$or':_['map'](_0x20805f,function(_0x1efb4f){if(_0x1efb4f[_0x72e2('0x2b')]!==_0x72e2('0x3a')){var _0x5a52c0={};_0x5a52c0[_0x1efb4f[_0x72e2('0x25')]]={'$like':'%'+_0x3dcfd2['query'][_0x72e2('0x38')]+'%'};return _0x5a52c0;}})});}_0x58e1a4=_['merge']({},_0x58e1a4,_0x3dcfd2[_0x72e2('0x3b')]);var _0x4fde5c={'where':_0x58e1a4[_0x72e2('0x36')]};return db['SquareReport']['count'](_0x4fde5c)[_0x72e2('0x22')](function(_0x511adc){_0x23c46b[_0x72e2('0x1c')]=_0x511adc;if(_0x3dcfd2[_0x72e2('0x2d')][_0x72e2('0x3c')]){_0x58e1a4[_0x72e2('0x3d')]=[{'all':!![]}];}return db[_0x72e2('0x28')][_0x72e2('0x3e')](_0x58e1a4);})['then'](function(_0x1aebdb){_0x23c46b['rows']=_0x1aebdb;return _0x23c46b;})[_0x72e2('0x22')](respondWithFilteredResult(_0x158ddf,_0x58e1a4))[_0x72e2('0x3f')](handleError(_0x158ddf,null));};exports[_0x72e2('0x40')]=function(_0x181837,_0x5a2b8e){var _0x36beb5={'raw':!![],'where':{'id':_0x181837[_0x72e2('0x41')]['id']}},_0x5d53cc={};_0x5d53cc[_0x72e2('0x2c')]=_[_0x72e2('0x42')](db[_0x72e2('0x28')][_0x72e2('0x29')]);_0x5d53cc['query']=_[_0x72e2('0x42')](_0x181837[_0x72e2('0x2d')]);_0x5d53cc[_0x72e2('0x43')]=_['intersection'](_0x5d53cc[_0x72e2('0x2c')],_0x5d53cc['query']);_0x36beb5[_0x72e2('0x2f')]=_['intersection'](_0x5d53cc[_0x72e2('0x2c')],qs[_0x72e2('0x30')](_0x181837[_0x72e2('0x2d')][_0x72e2('0x30')]));_0x36beb5[_0x72e2('0x2f')]=_0x36beb5['attributes'][_0x72e2('0x31')]?_0x36beb5['attributes']:_0x5d53cc[_0x72e2('0x2c')];if(_0x181837[_0x72e2('0x2d')][_0x72e2('0x3c')]){_0x36beb5[_0x72e2('0x3d')]=[{'all':!![]}];}_0x36beb5=_['merge']({},_0x36beb5,_0x181837[_0x72e2('0x3b')]);return db[_0x72e2('0x28')][_0x72e2('0x44')](_0x36beb5)[_0x72e2('0x22')](handleEntityNotFound(_0x5a2b8e,null))[_0x72e2('0x22')](respondWithResult(_0x5a2b8e,null))['catch'](handleError(_0x5a2b8e,null));};exports[_0x72e2('0x45')]=function(_0x42498a,_0xb661fd){return db[_0x72e2('0x28')]['create'](_0x42498a[_0x72e2('0x46')],{})['then'](respondWithResult(_0xb661fd,0xc9))[_0x72e2('0x3f')](handleError(_0xb661fd,null));};exports[_0x72e2('0x21')]=function(_0x2c36b2,_0x54c55b){if(_0x2c36b2['body']['id']){delete _0x2c36b2[_0x72e2('0x46')]['id'];}return db[_0x72e2('0x28')][_0x72e2('0x44')]({'where':{'id':_0x2c36b2['params']['id']}})['then'](handleEntityNotFound(_0x54c55b,null))[_0x72e2('0x22')](saveUpdates(_0x2c36b2['body'],null))['then'](respondWithResult(_0x54c55b,null))[_0x72e2('0x3f')](handleError(_0x54c55b,null));};exports[_0x72e2('0x47')]=function(_0x3809b5,_0x58fcac){return db[_0x72e2('0x28')][_0x72e2('0x44')]({'where':{'id':_0x3809b5['params']['id']}})[_0x72e2('0x22')](handleEntityNotFound(_0x58fcac,null))['then'](removeEntity(_0x58fcac,null))[_0x72e2('0x3f')](handleError(_0x58fcac,null));};exports['describe']=function(_0x2c36c9,_0x23052a){return db[_0x72e2('0x28')][_0x72e2('0x48')]()[_0x72e2('0x22')](respondWithResult(_0x23052a,null))[_0x72e2('0x3f')](handleError(_0x23052a,null));};
\ No newline at end of file
index 0be05b0..aad0ecf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x279b=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','SquareReport','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x279b,0xfd));var _0xb279=function(_0xb238bd,_0x41d522){_0xb238bd=_0xb238bd-0x0;var _0x5eb235=_0x279b[_0xb238bd];return _0x5eb235;};'use strict';var _=require(_0xb279('0x0'));var util=require(_0xb279('0x1'));var logger=require(_0xb279('0x2'))(_0xb279('0x3'));var moment=require(_0xb279('0x4'));var BPromise=require(_0xb279('0x5'));var rp=require(_0xb279('0x6'));var fs=require('fs');var path=require(_0xb279('0x7'));var rimraf=require(_0xb279('0x8'));var config=require(_0xb279('0x9'));var attributes=require('./squareReport.attributes');module[_0xb279('0xa')]=function(_0x2cdf7d,_0x3c01c7){return _0x2cdf7d['define'](_0xb279('0xb'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0xb279('0xc'),'fields':[_0xb279('0xd'),_0xb279('0xe')]},{'name':_0xb279('0xf'),'fields':['leaveAt']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2707=['report_square','project_name','leaveAt','lodash','util','../../config/logger','api','moment','request-promise','./squareReport.attributes','exports','define','SquareReport'];(function(_0x4823a3,_0x207732){var _0x2ac4e5=function(_0x3ef95c){while(--_0x3ef95c){_0x4823a3['push'](_0x4823a3['shift']());}};_0x2ac4e5(++_0x207732);}(_0x2707,0x1d7));var _0x7270=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x2707[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x7270('0x0'));var util=require(_0x7270('0x1'));var logger=require(_0x7270('0x2'))(_0x7270('0x3'));var moment=require(_0x7270('0x4'));var BPromise=require('bluebird');var rp=require(_0x7270('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7270('0x6'));module[_0x7270('0x7')]=function(_0x2c8a25,_0xc6bfab){return _0x2c8a25[_0x7270('0x8')](_0x7270('0x9'),attributes,{'tableName':_0x7270('0xa'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid',_0x7270('0xb')]},{'name':_0x7270('0xc'),'fields':['leaveAt']}],'timestamps':!![]});};
\ No newline at end of file
index fa17b3a..cf59f69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffe8=['where','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareReport,\x20%s,\x20%s','catch','CreateSquareReport','SquareReport','create','options','then','info','UpdateSquareReport','update','body','raw'];(function(_0x43945d,_0x43d61c){var _0xfda9cb=function(_0x3898ed){while(--_0x3898ed){_0x43945d['push'](_0x43945d['shift']());}};_0xfda9cb(++_0x43d61c);}(_0xffe8,0x102));var _0x8ffe=function(_0x1509da,_0x1c9210){_0x1509da=_0x1509da-0x0;var _0x215383=_0xffe8[_0x1509da];return _0x215383;};'use strict';var _=require(_0x8ffe('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8ffe('0x1'));var rs=require(_0x8ffe('0x2'));var fs=require('fs');var Redis=require(_0x8ffe('0x3'));var db=require(_0x8ffe('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8ffe('0x5'))(_0x8ffe('0x6'));var config=require(_0x8ffe('0x7'));var jayson=require(_0x8ffe('0x8'));var client=jayson['client'][_0x8ffe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35aa02,_0x43741d,_0x1d0f0e){return new BPromise(function(_0x1ed671,_0x59d2f4){return client[_0x8ffe('0xa')](_0x35aa02,_0x1d0f0e)['then'](function(_0x3da7e6){logger['info']('SquareReport,\x20%s,\x20%s',_0x43741d,_0x8ffe('0xb'));logger[_0x8ffe('0xc')](_0x8ffe('0xd'),_0x43741d,_0x8ffe('0xb'),JSON[_0x8ffe('0xe')](_0x3da7e6));if(_0x3da7e6[_0x8ffe('0xf')]){if(_0x3da7e6[_0x8ffe('0xf')][_0x8ffe('0x10')]===0x1f4){logger['error']('SquareReport,\x20%s,\x20%s',_0x43741d,_0x3da7e6[_0x8ffe('0xf')][_0x8ffe('0x11')]);return _0x59d2f4(_0x3da7e6[_0x8ffe('0xf')]['message']);}logger[_0x8ffe('0xf')](_0x8ffe('0x12'),_0x43741d,_0x3da7e6[_0x8ffe('0xf')][_0x8ffe('0x11')]);return _0x1ed671(_0x3da7e6[_0x8ffe('0xf')][_0x8ffe('0x11')]);}else{logger['info'](_0x8ffe('0x12'),_0x43741d,'request\x20sent');_0x1ed671(_0x3da7e6['result'][_0x8ffe('0x11')]);}})[_0x8ffe('0x13')](function(_0x37fc6f){logger[_0x8ffe('0xf')]('SquareReport,\x20%s,\x20%s',_0x43741d,_0x37fc6f);_0x59d2f4(_0x37fc6f);});});}exports[_0x8ffe('0x14')]=function(_0x1816df){var _0x3f688e=this;return new Promise(function(_0x2f6886,_0x1c4525){return db[_0x8ffe('0x15')][_0x8ffe('0x16')](_0x1816df['body'],{'raw':_0x1816df[_0x8ffe('0x17')]?_0x1816df[_0x8ffe('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x8ffe('0x18')](function(_0x24487f){logger[_0x8ffe('0x19')](_0x8ffe('0x14'),_0x1816df);logger[_0x8ffe('0xc')](_0x8ffe('0x14'),_0x1816df,JSON[_0x8ffe('0xe')](_0x24487f));_0x2f6886(_0x24487f);})[_0x8ffe('0x13')](function(_0x4f0b0f){logger['error'](_0x8ffe('0x14'),_0x4f0b0f[_0x8ffe('0x11')],_0x1816df);_0x1c4525(_0x3f688e[_0x8ffe('0xf')](0x1f4,_0x4f0b0f[_0x8ffe('0x11')]));});});};exports[_0x8ffe('0x1a')]=function(_0x424ffb){var _0xb08627=this;return new Promise(function(_0x19786e,_0x1546fb){return db[_0x8ffe('0x15')][_0x8ffe('0x1b')](_0x424ffb[_0x8ffe('0x1c')],{'raw':_0x424ffb[_0x8ffe('0x17')]?_0x424ffb[_0x8ffe('0x17')][_0x8ffe('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x424ffb[_0x8ffe('0x17')]?_0x424ffb[_0x8ffe('0x17')][_0x8ffe('0x1e')]||null:null,'attributes':_0x424ffb['options']?_0x424ffb[_0x8ffe('0x17')]['attributes']||null:null,'limit':_0x424ffb[_0x8ffe('0x17')]?_0x424ffb[_0x8ffe('0x17')][_0x8ffe('0x1f')]||null:null})[_0x8ffe('0x18')](function(_0x54b8cd){logger[_0x8ffe('0x19')](_0x8ffe('0x1a'),_0x424ffb);logger[_0x8ffe('0xc')](_0x8ffe('0x1a'),_0x424ffb,JSON['stringify'](_0x54b8cd));_0x19786e(_0x54b8cd);})[_0x8ffe('0x13')](function(_0x22ae86){logger[_0x8ffe('0xf')](_0x8ffe('0x1a'),_0x22ae86[_0x8ffe('0x11')],_0x424ffb);_0x1546fb(_0xb08627[_0x8ffe('0xf')](0x1f4,_0x22ae86[_0x8ffe('0x11')]));});});};
\ No newline at end of file
+var _0xc16d=['error','code','SquareReport,\x20%s,\x20%s','message','result','CreateSquareReport','SquareReport','create','body','options','raw','catch','UpdateSquareReport','update','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','then','info','request\x20sent','debug','stringify'];(function(_0x3a4fcf,_0x3c0568){var _0x39d40d=function(_0x27760b){while(--_0x27760b){_0x3a4fcf['push'](_0x3a4fcf['shift']());}};_0x39d40d(++_0x3c0568);}(_0xc16d,0x71));var _0xdc16=function(_0x4b1d19,_0x16f585){_0x4b1d19=_0x4b1d19-0x0;var _0x256a3c=_0xc16d[_0x4b1d19];return _0x256a3c;};'use strict';var _=require(_0xdc16('0x0'));var util=require(_0xdc16('0x1'));var moment=require(_0xdc16('0x2'));var BPromise=require(_0xdc16('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdc16('0x4'));var db=require(_0xdc16('0x5'))['db'];var utils=require(_0xdc16('0x6'));var logger=require(_0xdc16('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdc16('0x8')][_0xdc16('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2cb2c2,_0x5200fe,_0x31f5be){return new BPromise(function(_0x5c5e13,_0x470fce){return client['request'](_0x2cb2c2,_0x31f5be)[_0xdc16('0xa')](function(_0x4f7380){logger[_0xdc16('0xb')]('SquareReport,\x20%s,\x20%s',_0x5200fe,_0xdc16('0xc'));logger[_0xdc16('0xd')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x5200fe,_0xdc16('0xc'),JSON[_0xdc16('0xe')](_0x4f7380));if(_0x4f7380[_0xdc16('0xf')]){if(_0x4f7380[_0xdc16('0xf')][_0xdc16('0x10')]===0x1f4){logger[_0xdc16('0xf')](_0xdc16('0x11'),_0x5200fe,_0x4f7380[_0xdc16('0xf')][_0xdc16('0x12')]);return _0x470fce(_0x4f7380[_0xdc16('0xf')][_0xdc16('0x12')]);}logger['error']('SquareReport,\x20%s,\x20%s',_0x5200fe,_0x4f7380['error'][_0xdc16('0x12')]);return _0x5c5e13(_0x4f7380[_0xdc16('0xf')][_0xdc16('0x12')]);}else{logger[_0xdc16('0xb')](_0xdc16('0x11'),_0x5200fe,'request\x20sent');_0x5c5e13(_0x4f7380[_0xdc16('0x13')][_0xdc16('0x12')]);}})['catch'](function(_0x22f79d){logger[_0xdc16('0xf')](_0xdc16('0x11'),_0x5200fe,_0x22f79d);_0x470fce(_0x22f79d);});});}exports[_0xdc16('0x14')]=function(_0x39fc56){var _0x45f0fe=this;return new Promise(function(_0x30df1e,_0x32336a){return db[_0xdc16('0x15')][_0xdc16('0x16')](_0x39fc56[_0xdc16('0x17')],{'raw':_0x39fc56[_0xdc16('0x18')]?_0x39fc56[_0xdc16('0x18')][_0xdc16('0x19')]===undefined?!![]:![]:!![]})[_0xdc16('0xa')](function(_0x568a63){logger[_0xdc16('0xb')]('CreateSquareReport',_0x39fc56);logger[_0xdc16('0xd')]('CreateSquareReport',_0x39fc56,JSON[_0xdc16('0xe')](_0x568a63));_0x30df1e(_0x568a63);})[_0xdc16('0x1a')](function(_0x5bcecc){logger['error']('CreateSquareReport',_0x5bcecc[_0xdc16('0x12')],_0x39fc56);_0x32336a(_0x45f0fe[_0xdc16('0xf')](0x1f4,_0x5bcecc[_0xdc16('0x12')]));});});};exports[_0xdc16('0x1b')]=function(_0x10dbd7){var _0xfbf45e=this;return new Promise(function(_0x1b15bc,_0x4c8aaa){return db['SquareReport'][_0xdc16('0x1c')](_0x10dbd7[_0xdc16('0x17')],{'raw':_0x10dbd7[_0xdc16('0x18')]?_0x10dbd7[_0xdc16('0x18')][_0xdc16('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10dbd7[_0xdc16('0x18')]?_0x10dbd7[_0xdc16('0x18')][_0xdc16('0x1d')]||null:null,'attributes':_0x10dbd7[_0xdc16('0x18')]?_0x10dbd7[_0xdc16('0x18')][_0xdc16('0x1e')]||null:null,'limit':_0x10dbd7['options']?_0x10dbd7[_0xdc16('0x18')][_0xdc16('0x1f')]||null:null})['then'](function(_0x4280e2){logger[_0xdc16('0xb')]('UpdateSquareReport',_0x10dbd7);logger[_0xdc16('0xd')]('UpdateSquareReport',_0x10dbd7,JSON['stringify'](_0x4280e2));_0x1b15bc(_0x4280e2);})[_0xdc16('0x1a')](function(_0x40c7a7){logger[_0xdc16('0xf')](_0xdc16('0x1b'),_0x40c7a7['message'],_0x10dbd7);_0x4c8aaa(_0xfbf45e[_0xdc16('0xf')](0x1f4,_0x40c7a7[_0xdc16('0x12')]));});});};
\ No newline at end of file
index d801c8c..495d7fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda84=['exports','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','/describe','/:id','show','delete'];(function(_0x7642c6,_0x424eca){var _0x13330f=function(_0x46e36c){while(--_0x46e36c){_0x7642c6['push'](_0x7642c6['shift']());}};_0x13330f(++_0x424eca);}(_0xda84,0x16d));var _0x4da8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xda84[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4da8('0x0'));var router=express[_0x4da8('0x1')]();var fs_extra=require(_0x4da8('0x2'));var auth=require(_0x4da8('0x3'));var interaction=require(_0x4da8('0x4'));var config=require(_0x4da8('0x5'));var controller=require(_0x4da8('0x6'));router[_0x4da8('0x7')]('/',auth[_0x4da8('0x8')](),controller['index']);router['get'](_0x4da8('0x9'),auth[_0x4da8('0x8')](),controller['describe']);router[_0x4da8('0x7')](_0x4da8('0xa'),auth['isAuthenticated'](),controller[_0x4da8('0xb')]);router['post']('/',auth[_0x4da8('0x8')](),controller['create']);router['put'](_0x4da8('0xa'),auth[_0x4da8('0x8')](),controller['update']);router[_0x4da8('0xc')](_0x4da8('0xa'),auth[_0x4da8('0x8')](),controller['destroy']);module[_0x4da8('0xd')]=router;
\ No newline at end of file
+var _0x5b30=['get','isAuthenticated','index','/describe','describe','post','create','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','./squareReportDetail.controller'];(function(_0x564742,_0x3e34c7){var _0x7839d4=function(_0x366159){while(--_0x366159){_0x564742['push'](_0x564742['shift']());}};_0x7839d4(++_0x3e34c7);}(_0x5b30,0x181));var _0x05b3=function(_0x27dfe7,_0x3acd6f){_0x27dfe7=_0x27dfe7-0x0;var _0x9d647c=_0x5b30[_0x27dfe7];return _0x9d647c;};'use strict';var multer=require(_0x05b3('0x0'));var util=require(_0x05b3('0x1'));var path=require(_0x05b3('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x05b3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x05b3('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x05b3('0x5'));router[_0x05b3('0x6')]('/',auth[_0x05b3('0x7')](),controller[_0x05b3('0x8')]);router[_0x05b3('0x6')](_0x05b3('0x9'),auth[_0x05b3('0x7')](),controller[_0x05b3('0xa')]);router['get']('/:id',auth[_0x05b3('0x7')](),controller['show']);router[_0x05b3('0xb')]('/',auth[_0x05b3('0x7')](),controller[_0x05b3('0xc')]);router['put'](_0x05b3('0xd'),auth[_0x05b3('0x7')](),controller[_0x05b3('0xe')]);router['delete'](_0x05b3('0xd'),auth[_0x05b3('0x7')](),controller[_0x05b3('0xf')]);module[_0x05b3('0x10')]=router;
\ No newline at end of file
index de33af9..bc934b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x121c=['TEXT','STRING'];(function(_0x4996d5,_0x123daf){var _0x4793f9=function(_0x30c7ec){while(--_0x30c7ec){_0x4996d5['push'](_0x4996d5['shift']());}};_0x4793f9(++_0x123daf);}(_0x121c,0x95));var _0xc121=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x121c[_0x1e3c16];return _0x47a0c9;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xc121('0x0')]},'node':{'type':Sequelize[_0xc121('0x0')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xc121('0x1')]},'project_name':{'type':Sequelize[_0xc121('0x0')]},'callerid':{'type':Sequelize[_0xc121('0x0')]}};
\ No newline at end of file
+var _0xfd09=['TEXT','sequelize','STRING'];(function(_0x2a2917,_0x5a6f95){var _0x1462cb=function(_0x3f245b){while(--_0x3f245b){_0x2a2917['push'](_0x2a2917['shift']());}};_0x1462cb(++_0x5a6f95);}(_0xfd09,0x1d8));var _0x9fd0=function(_0x54b458,_0x4da21b){_0x54b458=_0x54b458-0x0;var _0x18d704=_0xfd09[_0x54b458];return _0x18d704;};'use strict';var Sequelize=require(_0x9fd0('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x9fd0('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x9fd0('0x2')]},'project_name':{'type':Sequelize[_0x9fd0('0x1')]},'callerid':{'type':Sequelize[_0x9fd0('0x1')]}};
\ No newline at end of file
index 41ebee9..c02cb62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa131=['name','map','SquareDetailsReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','show','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack'];(function(_0x36dd2d,_0x58a38a){var _0x5cb99a=function(_0x19a76b){while(--_0x19a76b){_0x36dd2d['push'](_0x36dd2d['shift']());}};_0x5cb99a(++_0x58a38a);}(_0xa131,0x6b));var _0x1a13=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0xa131[_0x4bb66f];return _0xf2772f;};'use strict';var emlformat=require(_0x1a13('0x0'));var rimraf=require(_0x1a13('0x1'));var zipdir=require(_0x1a13('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1a13('0x3'));var moment=require(_0x1a13('0x4'));var BPromise=require(_0x1a13('0x5'));var Mustache=require(_0x1a13('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1a13('0x7'));var ejs=require(_0x1a13('0x8'));var fs=require('fs');var fs_extra=require(_0x1a13('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1a13('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1a13('0xb'));var toCsv=require(_0x1a13('0x7'));var querystring=require(_0x1a13('0xc'));var Papa=require(_0x1a13('0xd'));var Redis=require(_0x1a13('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1a13('0xf'));var hardwareService=require(_0x1a13('0x10'));var logger=require(_0x1a13('0x11'))(_0x1a13('0x12'));var utils=require(_0x1a13('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1a13('0x14'))['db'];function respondWithStatusCode(_0x51e0b7,_0x41b2fd){_0x41b2fd=_0x41b2fd||0xcc;return function(_0x2bb6d8){if(_0x2bb6d8){return _0x51e0b7[_0x1a13('0x15')](_0x41b2fd);}return _0x51e0b7[_0x1a13('0x16')](_0x41b2fd)[_0x1a13('0x17')]();};}function respondWithResult(_0x23eccf,_0x109450){_0x109450=_0x109450||0xc8;return function(_0x4f707c){if(_0x4f707c){return _0x23eccf[_0x1a13('0x16')](_0x109450)[_0x1a13('0x18')](_0x4f707c);}};}function respondWithFilteredResult(_0x4266e3,_0x3b83ec){return function(_0x33ed40){if(_0x33ed40){var _0x42eb57=typeof _0x3b83ec[_0x1a13('0x19')]===_0x1a13('0x1a')&&typeof _0x3b83ec[_0x1a13('0x1b')]==='undefined';var _0x4fe35c=_0x33ed40[_0x1a13('0x1c')];var _0x184212=_0x42eb57?0x0:_0x3b83ec[_0x1a13('0x19')];var _0x299a1c=_0x42eb57?_0x33ed40[_0x1a13('0x1c')]:_0x3b83ec['offset']+_0x3b83ec[_0x1a13('0x1b')];var _0x4c582c;if(_0x299a1c>=_0x4fe35c){_0x299a1c=_0x4fe35c;_0x4c582c=0xc8;}else{_0x4c582c=0xce;}_0x4266e3[_0x1a13('0x16')](_0x4c582c);return _0x4266e3[_0x1a13('0x1d')](_0x1a13('0x1e'),_0x184212+'-'+_0x299a1c+'/'+_0x4fe35c)[_0x1a13('0x18')](_0x33ed40);}return null;};}function patchUpdates(_0x5b1ab8){return function(_0x323983){try{jsonpatch[_0x1a13('0x1f')](_0x323983,_0x5b1ab8,!![]);}catch(_0x384db8){return BPromise[_0x1a13('0x20')](_0x384db8);}return _0x323983[_0x1a13('0x21')]();};}function saveUpdates(_0x3d25e6,_0x395bb2){return function(_0x3fd73e){if(_0x3fd73e){return _0x3fd73e[_0x1a13('0x22')](_0x3d25e6)[_0x1a13('0x23')](function(_0x4f4444){return _0x4f4444;});}return null;};}function removeEntity(_0x1f11da,_0x278a6f){return function(_0x11a4dc){if(_0x11a4dc){return _0x11a4dc[_0x1a13('0x24')]()['then'](function(){_0x1f11da['status'](0xcc)[_0x1a13('0x17')]();});}};}function handleEntityNotFound(_0x22d9d9,_0x5a42d4){return function(_0x5ad4c9){if(!_0x5ad4c9){_0x22d9d9['sendStatus'](0x194);}return _0x5ad4c9;};}function handleError(_0x33719f,_0x7b6390){_0x7b6390=_0x7b6390||0x1f4;return function(_0x1cbe08){logger[_0x1a13('0x25')](_0x1cbe08[_0x1a13('0x26')]);if(_0x1cbe08[_0x1a13('0x27')]){delete _0x1cbe08['name'];}_0x33719f[_0x1a13('0x16')](_0x7b6390)['send'](_0x1cbe08);};}exports['index']=function(_0x175f02,_0x449057){var _0x1645f6={},_0x2a65fb={},_0x13b499={'count':0x0,'rows':[]};var _0x163397=_[_0x1a13('0x28')](db[_0x1a13('0x29')][_0x1a13('0x2a')],function(_0x34b11c){return{'name':_0x34b11c[_0x1a13('0x2b')],'type':_0x34b11c[_0x1a13('0x2c')][_0x1a13('0x2d')]};});_0x2a65fb['model']=_[_0x1a13('0x28')](_0x163397,_0x1a13('0x27'));_0x2a65fb[_0x1a13('0x2e')]=_[_0x1a13('0x2f')](_0x175f02[_0x1a13('0x2e')]);_0x2a65fb[_0x1a13('0x30')]=_['intersection'](_0x2a65fb['model'],_0x2a65fb[_0x1a13('0x2e')]);_0x1645f6['attributes']=_[_0x1a13('0x31')](_0x2a65fb[_0x1a13('0x32')],qs[_0x1a13('0x33')](_0x175f02['query']['fields']));_0x1645f6[_0x1a13('0x34')]=_0x1645f6[_0x1a13('0x34')][_0x1a13('0x35')]?_0x1645f6[_0x1a13('0x34')]:_0x2a65fb[_0x1a13('0x32')];if(!_0x175f02[_0x1a13('0x2e')][_0x1a13('0x36')]('nolimit')){_0x1645f6[_0x1a13('0x1b')]=qs['limit'](_0x175f02[_0x1a13('0x2e')][_0x1a13('0x1b')]);_0x1645f6[_0x1a13('0x19')]=qs[_0x1a13('0x19')](_0x175f02[_0x1a13('0x2e')]['offset']);}_0x1645f6[_0x1a13('0x37')]=qs[_0x1a13('0x38')](_0x175f02[_0x1a13('0x2e')][_0x1a13('0x38')]);_0x1645f6[_0x1a13('0x39')]=qs[_0x1a13('0x30')](_[_0x1a13('0x3a')](_0x175f02[_0x1a13('0x2e')],_0x2a65fb[_0x1a13('0x30')]),_0x163397);if(_0x175f02[_0x1a13('0x2e')]['filter']){_0x1645f6['where']=_[_0x1a13('0x3b')](_0x1645f6[_0x1a13('0x39')],{'$or':_['map'](_0x163397,function(_0xbe66a2){if(_0xbe66a2[_0x1a13('0x2c')]!==_0x1a13('0x3c')){var _0x367d01={};_0x367d01[_0xbe66a2[_0x1a13('0x27')]]={'$like':'%'+_0x175f02['query'][_0x1a13('0x3d')]+'%'};return _0x367d01;}})});}_0x1645f6=_[_0x1a13('0x3b')]({},_0x1645f6,_0x175f02[_0x1a13('0x3e')]);var _0x1ebb81={'where':_0x1645f6[_0x1a13('0x39')]};return db[_0x1a13('0x29')]['count'](_0x1ebb81)[_0x1a13('0x23')](function(_0x51c487){_0x13b499[_0x1a13('0x1c')]=_0x51c487;if(_0x175f02['query'][_0x1a13('0x3f')]){_0x1645f6[_0x1a13('0x40')]=[{'all':!![]}];}return db['SquareDetailsReport']['findAll'](_0x1645f6);})[_0x1a13('0x23')](function(_0x109be0){_0x13b499[_0x1a13('0x41')]=_0x109be0;return _0x13b499;})['then'](respondWithFilteredResult(_0x449057,_0x1645f6))['catch'](handleError(_0x449057,null));};exports[_0x1a13('0x42')]=function(_0x47f8a6,_0x49b3ef){var _0x3c02e0={'raw':!![],'where':{'id':_0x47f8a6[_0x1a13('0x43')]['id']}},_0x1b9dd4={};_0x1b9dd4['model']=_[_0x1a13('0x2f')](db[_0x1a13('0x29')][_0x1a13('0x2a')]);_0x1b9dd4[_0x1a13('0x2e')]=_['keys'](_0x47f8a6['query']);_0x1b9dd4[_0x1a13('0x30')]=_[_0x1a13('0x31')](_0x1b9dd4[_0x1a13('0x32')],_0x1b9dd4['query']);_0x3c02e0[_0x1a13('0x34')]=_['intersection'](_0x1b9dd4[_0x1a13('0x32')],qs[_0x1a13('0x33')](_0x47f8a6[_0x1a13('0x2e')][_0x1a13('0x33')]));_0x3c02e0['attributes']=_0x3c02e0[_0x1a13('0x34')][_0x1a13('0x35')]?_0x3c02e0['attributes']:_0x1b9dd4['model'];if(_0x47f8a6[_0x1a13('0x2e')]['includeAll']){_0x3c02e0[_0x1a13('0x40')]=[{'all':!![]}];}_0x3c02e0=_['merge']({},_0x3c02e0,_0x47f8a6[_0x1a13('0x3e')]);return db[_0x1a13('0x29')][_0x1a13('0x44')](_0x3c02e0)[_0x1a13('0x23')](handleEntityNotFound(_0x49b3ef,null))[_0x1a13('0x23')](respondWithResult(_0x49b3ef,null))[_0x1a13('0x45')](handleError(_0x49b3ef,null));};exports['create']=function(_0x7289a2,_0x4f2790){return db[_0x1a13('0x29')][_0x1a13('0x46')](_0x7289a2['body'],{})[_0x1a13('0x23')](respondWithResult(_0x4f2790,0xc9))[_0x1a13('0x45')](handleError(_0x4f2790,null));};exports[_0x1a13('0x22')]=function(_0x554580,_0x53fb0a){if(_0x554580[_0x1a13('0x47')]['id']){delete _0x554580['body']['id'];}return db[_0x1a13('0x29')][_0x1a13('0x44')]({'where':{'id':_0x554580[_0x1a13('0x43')]['id']}})[_0x1a13('0x23')](handleEntityNotFound(_0x53fb0a,null))['then'](saveUpdates(_0x554580[_0x1a13('0x47')],null))[_0x1a13('0x23')](respondWithResult(_0x53fb0a,null))[_0x1a13('0x45')](handleError(_0x53fb0a,null));};exports[_0x1a13('0x24')]=function(_0x4ef122,_0x5a4931){return db['SquareDetailsReport']['find']({'where':{'id':_0x4ef122[_0x1a13('0x43')]['id']}})['then'](handleEntityNotFound(_0x5a4931,null))[_0x1a13('0x23')](removeEntity(_0x5a4931,null))[_0x1a13('0x45')](handleError(_0x5a4931,null));};exports[_0x1a13('0x48')]=function(_0x444824,_0x108824){return db[_0x1a13('0x29')]['describe']()[_0x1a13('0x23')](respondWithResult(_0x108824,null))['catch'](handleError(_0x108824,null));};
\ No newline at end of file
+var _0x4ef3=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','include','findAll','rows','keys','includeAll','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv'];(function(_0x3df249,_0x2f5acc){var _0x1dae1b=function(_0x28043f){while(--_0x28043f){_0x3df249['push'](_0x3df249['shift']());}};_0x1dae1b(++_0x2f5acc);}(_0x4ef3,0x1c9));var _0x34ef=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x4ef3[_0xefd519];return _0x4bb882;};'use strict';var emlformat=require(_0x34ef('0x0'));var rimraf=require(_0x34ef('0x1'));var zipdir=require(_0x34ef('0x2'));var jsonpatch=require(_0x34ef('0x3'));var rp=require(_0x34ef('0x4'));var moment=require(_0x34ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x34ef('0x6'));var util=require(_0x34ef('0x7'));var path=require(_0x34ef('0x8'));var sox=require(_0x34ef('0x9'));var csv=require(_0x34ef('0xa'));var ejs=require(_0x34ef('0xb'));var fs=require('fs');var fs_extra=require(_0x34ef('0xc'));var _=require(_0x34ef('0xd'));var squel=require(_0x34ef('0xe'));var crypto=require(_0x34ef('0xf'));var jsforce=require(_0x34ef('0x10'));var deskjs=require(_0x34ef('0x11'));var toCsv=require(_0x34ef('0xa'));var querystring=require('querystring');var Papa=require(_0x34ef('0x12'));var Redis=require('ioredis');var authService=require(_0x34ef('0x13'));var qs=require(_0x34ef('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x34ef('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x34ef('0x16'));var config=require(_0x34ef('0x17'));var licenseUtil=require(_0x34ef('0x18'));var db=require(_0x34ef('0x19'))['db'];function respondWithStatusCode(_0x7f1e02,_0x114214){_0x114214=_0x114214||0xcc;return function(_0x415958){if(_0x415958){return _0x7f1e02[_0x34ef('0x1a')](_0x114214);}return _0x7f1e02[_0x34ef('0x1b')](_0x114214)[_0x34ef('0x1c')]();};}function respondWithResult(_0x5ce6d7,_0x10fa30){_0x10fa30=_0x10fa30||0xc8;return function(_0x1fbe0a){if(_0x1fbe0a){return _0x5ce6d7[_0x34ef('0x1b')](_0x10fa30)[_0x34ef('0x1d')](_0x1fbe0a);}};}function respondWithFilteredResult(_0x3f511e,_0x13394c){return function(_0x10534c){if(_0x10534c){var _0x461e94=typeof _0x13394c[_0x34ef('0x1e')]===_0x34ef('0x1f')&&typeof _0x13394c[_0x34ef('0x20')]===_0x34ef('0x1f');var _0xdcc71f=_0x10534c['count'];var _0x2225be=_0x461e94?0x0:_0x13394c['offset'];var _0x2036c7=_0x461e94?_0x10534c[_0x34ef('0x21')]:_0x13394c[_0x34ef('0x1e')]+_0x13394c[_0x34ef('0x20')];var _0x3f8302;if(_0x2036c7>=_0xdcc71f){_0x2036c7=_0xdcc71f;_0x3f8302=0xc8;}else{_0x3f8302=0xce;}_0x3f511e[_0x34ef('0x1b')](_0x3f8302);return _0x3f511e[_0x34ef('0x22')](_0x34ef('0x23'),_0x2225be+'-'+_0x2036c7+'/'+_0xdcc71f)[_0x34ef('0x1d')](_0x10534c);}return null;};}function patchUpdates(_0x4541fa){return function(_0x29dd02){try{jsonpatch[_0x34ef('0x24')](_0x29dd02,_0x4541fa,!![]);}catch(_0x4fc940){return BPromise[_0x34ef('0x25')](_0x4fc940);}return _0x29dd02['save']();};}function saveUpdates(_0x52d983,_0x38d0bd){return function(_0x3fc328){if(_0x3fc328){return _0x3fc328[_0x34ef('0x26')](_0x52d983)[_0x34ef('0x27')](function(_0x52a15c){return _0x52a15c;});}return null;};}function removeEntity(_0x4a4356,_0x3525db){return function(_0x13b309){if(_0x13b309){return _0x13b309[_0x34ef('0x28')]()['then'](function(){_0x4a4356[_0x34ef('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d8145,_0x347b6c){return function(_0x37622c){if(!_0x37622c){_0x2d8145[_0x34ef('0x1a')](0x194);}return _0x37622c;};}function handleError(_0x8dcafc,_0x1d9c01){_0x1d9c01=_0x1d9c01||0x1f4;return function(_0x4fcaff){logger[_0x34ef('0x29')](_0x4fcaff[_0x34ef('0x2a')]);if(_0x4fcaff[_0x34ef('0x2b')]){delete _0x4fcaff['name'];}_0x8dcafc['status'](_0x1d9c01)[_0x34ef('0x2c')](_0x4fcaff);};}exports[_0x34ef('0x2d')]=function(_0x400875,_0x4e3531){var _0xc8aa3a={},_0x7f0e3e={},_0x41fc31={'count':0x0,'rows':[]};var _0x37d4bb=_[_0x34ef('0x2e')](db[_0x34ef('0x2f')][_0x34ef('0x30')],function(_0x90e9cf){return{'name':_0x90e9cf[_0x34ef('0x31')],'type':_0x90e9cf[_0x34ef('0x32')][_0x34ef('0x33')]};});_0x7f0e3e[_0x34ef('0x34')]=_[_0x34ef('0x2e')](_0x37d4bb,_0x34ef('0x2b'));_0x7f0e3e[_0x34ef('0x35')]=_['keys'](_0x400875['query']);_0x7f0e3e['filters']=_[_0x34ef('0x36')](_0x7f0e3e['model'],_0x7f0e3e[_0x34ef('0x35')]);_0xc8aa3a['attributes']=_[_0x34ef('0x36')](_0x7f0e3e[_0x34ef('0x34')],qs[_0x34ef('0x37')](_0x400875[_0x34ef('0x35')][_0x34ef('0x37')]));_0xc8aa3a['attributes']=_0xc8aa3a[_0x34ef('0x38')][_0x34ef('0x39')]?_0xc8aa3a[_0x34ef('0x38')]:_0x7f0e3e[_0x34ef('0x34')];if(!_0x400875[_0x34ef('0x35')][_0x34ef('0x3a')](_0x34ef('0x3b'))){_0xc8aa3a[_0x34ef('0x20')]=qs[_0x34ef('0x20')](_0x400875[_0x34ef('0x35')][_0x34ef('0x20')]);_0xc8aa3a[_0x34ef('0x1e')]=qs[_0x34ef('0x1e')](_0x400875[_0x34ef('0x35')][_0x34ef('0x1e')]);}_0xc8aa3a[_0x34ef('0x3c')]=qs[_0x34ef('0x3d')](_0x400875['query'][_0x34ef('0x3d')]);_0xc8aa3a['where']=qs[_0x34ef('0x3e')](_[_0x34ef('0x3f')](_0x400875[_0x34ef('0x35')],_0x7f0e3e[_0x34ef('0x3e')]),_0x37d4bb);if(_0x400875[_0x34ef('0x35')][_0x34ef('0x40')]){_0xc8aa3a[_0x34ef('0x41')]=_[_0x34ef('0x42')](_0xc8aa3a[_0x34ef('0x41')],{'$or':_[_0x34ef('0x2e')](_0x37d4bb,function(_0x4e5b87){if(_0x4e5b87[_0x34ef('0x32')]!=='VIRTUAL'){var _0x253e85={};_0x253e85[_0x4e5b87[_0x34ef('0x2b')]]={'$like':'%'+_0x400875[_0x34ef('0x35')][_0x34ef('0x40')]+'%'};return _0x253e85;}})});}_0xc8aa3a=_[_0x34ef('0x42')]({},_0xc8aa3a,_0x400875[_0x34ef('0x43')]);var _0x5873e9={'where':_0xc8aa3a['where']};return db[_0x34ef('0x2f')][_0x34ef('0x21')](_0x5873e9)['then'](function(_0x3cc3be){_0x41fc31[_0x34ef('0x21')]=_0x3cc3be;if(_0x400875[_0x34ef('0x35')]['includeAll']){_0xc8aa3a[_0x34ef('0x44')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0x34ef('0x45')](_0xc8aa3a);})[_0x34ef('0x27')](function(_0x3dba81){_0x41fc31[_0x34ef('0x46')]=_0x3dba81;return _0x41fc31;})['then'](respondWithFilteredResult(_0x4e3531,_0xc8aa3a))['catch'](handleError(_0x4e3531,null));};exports['show']=function(_0x5c31fa,_0x2f98ee){var _0x5ec9e2={'raw':!![],'where':{'id':_0x5c31fa['params']['id']}},_0x31632b={};_0x31632b['model']=_[_0x34ef('0x47')](db[_0x34ef('0x2f')][_0x34ef('0x30')]);_0x31632b[_0x34ef('0x35')]=_[_0x34ef('0x47')](_0x5c31fa[_0x34ef('0x35')]);_0x31632b[_0x34ef('0x3e')]=_['intersection'](_0x31632b[_0x34ef('0x34')],_0x31632b[_0x34ef('0x35')]);_0x5ec9e2[_0x34ef('0x38')]=_[_0x34ef('0x36')](_0x31632b[_0x34ef('0x34')],qs[_0x34ef('0x37')](_0x5c31fa[_0x34ef('0x35')]['fields']));_0x5ec9e2[_0x34ef('0x38')]=_0x5ec9e2[_0x34ef('0x38')][_0x34ef('0x39')]?_0x5ec9e2[_0x34ef('0x38')]:_0x31632b[_0x34ef('0x34')];if(_0x5c31fa['query'][_0x34ef('0x48')]){_0x5ec9e2[_0x34ef('0x44')]=[{'all':!![]}];}_0x5ec9e2=_[_0x34ef('0x42')]({},_0x5ec9e2,_0x5c31fa[_0x34ef('0x43')]);return db[_0x34ef('0x2f')][_0x34ef('0x49')](_0x5ec9e2)[_0x34ef('0x27')](handleEntityNotFound(_0x2f98ee,null))[_0x34ef('0x27')](respondWithResult(_0x2f98ee,null))[_0x34ef('0x4a')](handleError(_0x2f98ee,null));};exports[_0x34ef('0x4b')]=function(_0x5180e5,_0x2385ae){return db[_0x34ef('0x2f')]['create'](_0x5180e5[_0x34ef('0x4c')],{})[_0x34ef('0x27')](respondWithResult(_0x2385ae,0xc9))[_0x34ef('0x4a')](handleError(_0x2385ae,null));};exports[_0x34ef('0x26')]=function(_0x43e101,_0x311af4){if(_0x43e101[_0x34ef('0x4c')]['id']){delete _0x43e101[_0x34ef('0x4c')]['id'];}return db[_0x34ef('0x2f')]['find']({'where':{'id':_0x43e101[_0x34ef('0x4d')]['id']}})[_0x34ef('0x27')](handleEntityNotFound(_0x311af4,null))[_0x34ef('0x27')](saveUpdates(_0x43e101[_0x34ef('0x4c')],null))[_0x34ef('0x27')](respondWithResult(_0x311af4,null))['catch'](handleError(_0x311af4,null));};exports[_0x34ef('0x28')]=function(_0x11d5b8,_0x3c4d7c){return db[_0x34ef('0x2f')][_0x34ef('0x49')]({'where':{'id':_0x11d5b8[_0x34ef('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3c4d7c,null))[_0x34ef('0x27')](removeEntity(_0x3c4d7c,null))[_0x34ef('0x4a')](handleError(_0x3c4d7c,null));};exports['describe']=function(_0xd86962,_0x3e3d9e){return db[_0x34ef('0x2f')]['describe']()['then'](respondWithResult(_0x3e3d9e,null))['catch'](handleError(_0x3e3d9e,null));};
\ No newline at end of file
index 57ea6d4..8f78ec9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x607d=['util','../../config/logger','api','bluebird','request-promise','../../config/environment','exports','define','SquareDetailsReport','report_square_details'];(function(_0x30af6d,_0x1c2ae6){var _0x25d333=function(_0x1f93dc){while(--_0x1f93dc){_0x30af6d['push'](_0x30af6d['shift']());}};_0x25d333(++_0x1c2ae6);}(_0x607d,0xb4));var _0xd607=function(_0x302562,_0x3df446){_0x302562=_0x302562-0x0;var _0x1b7031=_0x607d[_0x302562];return _0x1b7031;};'use strict';var _=require('lodash');var util=require(_0xd607('0x0'));var logger=require(_0xd607('0x1'))(_0xd607('0x2'));var moment=require('moment');var BPromise=require(_0xd607('0x3'));var rp=require(_0xd607('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd607('0x5'));var attributes=require('./squareReportDetail.attributes');module[_0xd607('0x6')]=function(_0x4a5385,_0xdeb1e7){return _0x4a5385[_0xd607('0x7')](_0xd607('0x8'),attributes,{'tableName':_0xd607('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x90a3=['request-promise','path','rimraf','./squareReportDetail.attributes','SquareDetailsReport','util','../../config/logger','api','moment','bluebird'];(function(_0x5a6c4f,_0x41bb92){var _0x3f9aea=function(_0x5f0fc1){while(--_0x5f0fc1){_0x5a6c4f['push'](_0x5a6c4f['shift']());}};_0x3f9aea(++_0x41bb92);}(_0x90a3,0x1db));var _0x390a=function(_0x584525,_0x1fb3d8){_0x584525=_0x584525-0x0;var _0x4b73f9=_0x90a3[_0x584525];return _0x4b73f9;};'use strict';var _=require('lodash');var util=require(_0x390a('0x0'));var logger=require(_0x390a('0x1'))(_0x390a('0x2'));var moment=require(_0x390a('0x3'));var BPromise=require(_0x390a('0x4'));var rp=require(_0x390a('0x5'));var fs=require('fs');var path=require(_0x390a('0x6'));var rimraf=require(_0x390a('0x7'));var config=require('../../config/environment');var attributes=require(_0x390a('0x8'));module['exports']=function(_0x408ddf,_0x110ad8){return _0x408ddf['define'](_0x390a('0x9'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 25a0697..e6ae289 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e81=['stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s'];(function(_0x358c36,_0x28fc15){var _0x46d384=function(_0x5ca9d9){while(--_0x5ca9d9){_0x358c36['push'](_0x358c36['shift']());}};_0x46d384(++_0x28fc15);}(_0x4e81,0x1bc));var _0x14e8=function(_0x2c0be1,_0x1e88f2){_0x2c0be1=_0x2c0be1-0x0;var _0x3d4bd2=_0x4e81[_0x2c0be1];return _0x3d4bd2;};'use strict';var _=require(_0x14e8('0x0'));var util=require(_0x14e8('0x1'));var moment=require(_0x14e8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x14e8('0x3'))['db'];var utils=require(_0x14e8('0x4'));var logger=require(_0x14e8('0x5'))(_0x14e8('0x6'));var config=require(_0x14e8('0x7'));var jayson=require(_0x14e8('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e73d2,_0x449fa3,_0x21f860){return new BPromise(function(_0x3c1b93,_0x11ec3b){return client[_0x14e8('0x9')](_0x3e73d2,_0x21f860)[_0x14e8('0xa')](function(_0x1d8402){logger[_0x14e8('0xb')]('SquareDetailsReport,\x20%s,\x20%s',_0x449fa3,_0x14e8('0xc'));logger[_0x14e8('0xd')](_0x14e8('0xe'),_0x449fa3,_0x14e8('0xc'),JSON[_0x14e8('0xf')](_0x1d8402));if(_0x1d8402[_0x14e8('0x10')]){if(_0x1d8402[_0x14e8('0x10')][_0x14e8('0x11')]===0x1f4){logger['error'](_0x14e8('0x12'),_0x449fa3,_0x1d8402['error'][_0x14e8('0x13')]);return _0x11ec3b(_0x1d8402[_0x14e8('0x10')][_0x14e8('0x13')]);}logger['error'](_0x14e8('0x12'),_0x449fa3,_0x1d8402['error'][_0x14e8('0x13')]);return _0x3c1b93(_0x1d8402['error'][_0x14e8('0x13')]);}else{logger[_0x14e8('0xb')](_0x14e8('0x12'),_0x449fa3,_0x14e8('0xc'));_0x3c1b93(_0x1d8402['result'][_0x14e8('0x13')]);}})[_0x14e8('0x14')](function(_0x30581){logger[_0x14e8('0x10')](_0x14e8('0x12'),_0x449fa3,_0x30581);_0x11ec3b(_0x30581);});});}exports[_0x14e8('0x15')]=function(_0x10dc8b){var _0x462259=this;return new Promise(function(_0x5a38c1,_0x328c5a){return db[_0x14e8('0x16')][_0x14e8('0x17')](_0x10dc8b[_0x14e8('0x18')],{'raw':_0x10dc8b[_0x14e8('0x19')]?_0x10dc8b['options'][_0x14e8('0x1a')]===undefined?!![]:![]:!![]})[_0x14e8('0xa')](function(_0x2abfec){logger['info'](_0x14e8('0x15'),_0x10dc8b);logger['debug'](_0x14e8('0x15'),_0x10dc8b,JSON[_0x14e8('0xf')](_0x2abfec));_0x5a38c1(_0x2abfec);})[_0x14e8('0x14')](function(_0x117b00){logger[_0x14e8('0x10')]('CreateSquareDetailsReport',_0x117b00[_0x14e8('0x13')],_0x10dc8b);_0x328c5a(_0x462259['error'](0x1f4,_0x117b00[_0x14e8('0x13')]));});});};
\ No newline at end of file
+var _0x5b12=['../../config/utils','rpc','client','request','then','info','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','catch','CreateSquareDetailsReport','SquareDetailsReport','options','raw','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x227eea,_0x548ae8){var _0x3d9bc8=function(_0x1b984b){while(--_0x1b984b){_0x227eea['push'](_0x227eea['shift']());}};_0x3d9bc8(++_0x548ae8);}(_0x5b12,0xa3));var _0x25b1=function(_0x231395,_0x54d412){_0x231395=_0x231395-0x0;var _0x152097=_0x5b12[_0x231395];return _0x152097;};'use strict';var _=require(_0x25b1('0x0'));var util=require(_0x25b1('0x1'));var moment=require(_0x25b1('0x2'));var BPromise=require('bluebird');var rs=require(_0x25b1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25b1('0x4'))['db'];var utils=require(_0x25b1('0x5'));var logger=require('../../config/logger')(_0x25b1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x25b1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bb95b,_0x1f715d,_0x28c980){return new BPromise(function(_0x451c66,_0x2a46e0){return client[_0x25b1('0x8')](_0x5bb95b,_0x28c980)[_0x25b1('0x9')](function(_0x3346ed){logger[_0x25b1('0xa')]('SquareDetailsReport,\x20%s,\x20%s',_0x1f715d,_0x25b1('0xb'));logger[_0x25b1('0xc')](_0x25b1('0xd'),_0x1f715d,_0x25b1('0xb'),JSON[_0x25b1('0xe')](_0x3346ed));if(_0x3346ed[_0x25b1('0xf')]){if(_0x3346ed[_0x25b1('0xf')][_0x25b1('0x10')]===0x1f4){logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x3346ed[_0x25b1('0xf')][_0x25b1('0x12')]);return _0x2a46e0(_0x3346ed[_0x25b1('0xf')][_0x25b1('0x12')]);}logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x3346ed['error'][_0x25b1('0x12')]);return _0x451c66(_0x3346ed[_0x25b1('0xf')]['message']);}else{logger[_0x25b1('0xa')](_0x25b1('0x11'),_0x1f715d,_0x25b1('0xb'));_0x451c66(_0x3346ed['result']['message']);}})[_0x25b1('0x13')](function(_0x573ec2){logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x573ec2);_0x2a46e0(_0x573ec2);});});}exports[_0x25b1('0x14')]=function(_0x27ccc9){var _0x1f78c2=this;return new Promise(function(_0x2a7d14,_0x17024a){return db[_0x25b1('0x15')]['create'](_0x27ccc9['body'],{'raw':_0x27ccc9[_0x25b1('0x16')]?_0x27ccc9['options'][_0x25b1('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x3bfd7d){logger['info'](_0x25b1('0x14'),_0x27ccc9);logger['debug'](_0x25b1('0x14'),_0x27ccc9,JSON['stringify'](_0x3bfd7d));_0x2a7d14(_0x3bfd7d);})['catch'](function(_0x565cfd){logger[_0x25b1('0xf')](_0x25b1('0x14'),_0x565cfd['message'],_0x27ccc9);_0x17024a(_0x1f78c2[_0x25b1('0xf')](0x1f4,_0x565cfd[_0x25b1('0x12')]));});});};
\ No newline at end of file
index 445fd4e..667db69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfee0=['express','Router','./system.controller','get','index','/process/:pid/kill','isAuthenticated','killProcess','exports'];(function(_0x89a20e,_0x34e634){var _0x505b80=function(_0x6244c2){while(--_0x6244c2){_0x89a20e['push'](_0x89a20e['shift']());}};_0x505b80(++_0x34e634);}(_0xfee0,0xcf));var _0x0fee=function(_0x55ff3e,_0x41077f){_0x55ff3e=_0x55ff3e-0x0;var _0x2709eb=_0xfee0[_0x55ff3e];return _0x2709eb;};'use strict';var express=require(_0x0fee('0x0'));var router=express[_0x0fee('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x0fee('0x2'));router[_0x0fee('0x3')]('/',auth['isAuthenticated'](),controller[_0x0fee('0x4')]);router['get'](_0x0fee('0x5'),auth[_0x0fee('0x6')](),controller[_0x0fee('0x7')]);module[_0x0fee('0x8')]=router;
\ No newline at end of file
+var _0x7d97=['/process/:pid/kill','killProcess','exports','express','get','isAuthenticated','index'];(function(_0x374d66,_0x1856c6){var _0x16f12a=function(_0x5d7b13){while(--_0x5d7b13){_0x374d66['push'](_0x374d66['shift']());}};_0x16f12a(++_0x1856c6);}(_0x7d97,0x1e6));var _0x77d9=function(_0x18ea9b,_0x2e88e2){_0x18ea9b=_0x18ea9b-0x0;var _0x41bc76=_0x7d97[_0x18ea9b];return _0x41bc76;};'use strict';var express=require(_0x77d9('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./system.controller');router[_0x77d9('0x1')]('/',auth[_0x77d9('0x2')](),controller[_0x77d9('0x3')]);router[_0x77d9('0x1')](_0x77d9('0x4'),auth['isAuthenticated'](),controller[_0x77d9('0x5')]);module[_0x77d9('0x6')]=router;
\ No newline at end of file
index 26b4c9f..5cc5fa7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c3b=['components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','SIGINT','format','killProcess','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','then','json','catch'];(function(_0x31dde9,_0x12e816){var _0x1fbf2d=function(_0x1d1bf6){while(--_0x1d1bf6){_0x31dde9['push'](_0x31dde9['shift']());}};_0x1fbf2d(++_0x12e816);}(_0x3c3b,0x6e));var _0xb3c3=function(_0x3f51f2,_0xf795b9){_0x3f51f2=_0x3f51f2-0x0;var _0x23f2d9=_0x3c3b[_0x3f51f2];return _0x23f2d9;};'use strict';var info=require('systeminformation');var exec=require('child_process')['exec'];var logger=require(_0xb3c3('0x0'))(_0xb3c3('0x1'));var util=require(_0xb3c3('0x2'));var BPromise=require(_0xb3c3('0x3'));var _=require(_0xb3c3('0x4'));function handleError(_0x2fe8e,_0x14ba8e,_0x34c0b7){_0x14ba8e=_0x14ba8e||0x1f4;return function(_0x4d0a97){logger[_0xb3c3('0x5')](_0xb3c3('0x6'),_0x34c0b7,_0x14ba8e,util[_0xb3c3('0x7')](_0x4d0a97,{'showHidden':![],'depth':null}));delete _0x4d0a97[_0xb3c3('0x8')];_0x2fe8e[_0xb3c3('0x9')](_0x14ba8e)[_0xb3c3('0xa')](_0x4d0a97);};}exports[_0xb3c3('0xb')]=function(_0x531986,_0x52d2b9){return info['getAllData']()[_0xb3c3('0xc')](function(_0x368026){return _0x52d2b9[_0xb3c3('0x9')](0xc8)[_0xb3c3('0xd')](_0x368026);})[_0xb3c3('0xe')](function(_0x179cf7){return _0x52d2b9['status'](0x1f4)[_0xb3c3('0xd')](_0x179cf7);});};exports['killProcess']=function(_0x538190,_0x2e3400){var _0x106bfe=[_0xb3c3('0xf')];return new BPromise(function(_0x5c61b6,_0x56d931){return exec(util['format'](_0xb3c3('0x10'),_0x538190[_0xb3c3('0x11')][_0xb3c3('0x12')]),function(_0x3d20da,_0x520bfb,_0x4c3067){if(_0x3d20da){return _0x56d931(_0x3d20da);}return _0x5c61b6(_0x520bfb);});})[_0xb3c3('0xc')](function(_0x2fbeae){var _0x5be72c=![];var _0x3434aa=_0x2fbeae[_0xb3c3('0x13')](/\n/);for(var _0x140818=0x0,_0x492f68=_0x106bfe['length'];_0x140818<_0x492f68,_0x5be72c===![];_0x140818+=0x1){if(_0x2fbeae[_0xb3c3('0x14')](_0x106bfe[_0x140818])>=0x0){_0x5be72c=!![];}}if(!_0x5be72c){throw new Error(util['format'](_0xb3c3('0x15'),_0x538190[_0xb3c3('0x11')][_0xb3c3('0x12')]));}process['kill'](_0x538190[_0xb3c3('0x11')][_0xb3c3('0x12')],_0xb3c3('0x16'));return _0x2e3400[_0xb3c3('0x9')](0xc8)[_0xb3c3('0xd')]({'message':util[_0xb3c3('0x17')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x538190[_0xb3c3('0x11')][_0xb3c3('0x12')])});})['catch'](handleError(_0x2e3400,null,_0xb3c3('0x18')));};
\ No newline at end of file
+var _0x38cd=['ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','format','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','index','then','json','catch','killProcess','components/import/cm'];(function(_0x3d0c11,_0x2e9da0){var _0x5cd8a7=function(_0xca39c4){while(--_0xca39c4){_0x3d0c11['push'](_0x3d0c11['shift']());}};_0x5cd8a7(++_0x2e9da0);}(_0x38cd,0xf2));var _0xd38c=function(_0x59162a,_0x10e547){_0x59162a=_0x59162a-0x0;var _0x35e50d=_0x38cd[_0x59162a];return _0x35e50d;};'use strict';var info=require(_0xd38c('0x0'));var exec=require(_0xd38c('0x1'))[_0xd38c('0x2')];var logger=require(_0xd38c('0x3'))(_0xd38c('0x4'));var util=require(_0xd38c('0x5'));var BPromise=require(_0xd38c('0x6'));var _=require(_0xd38c('0x7'));function handleError(_0x1d19e6,_0x2abf21,_0x8600d){_0x2abf21=_0x2abf21||0x1f4;return function(_0x250b0e){logger[_0xd38c('0x8')](_0xd38c('0x9'),_0x8600d,_0x2abf21,util[_0xd38c('0xa')](_0x250b0e,{'showHidden':![],'depth':null}));delete _0x250b0e[_0xd38c('0xb')];_0x1d19e6[_0xd38c('0xc')](_0x2abf21)['send'](_0x250b0e);};}exports[_0xd38c('0xd')]=function(_0x2a5472,_0x23b020){return info['getAllData']()[_0xd38c('0xe')](function(_0x44251d){return _0x23b020[_0xd38c('0xc')](0xc8)[_0xd38c('0xf')](_0x44251d);})[_0xd38c('0x10')](function(_0x337be3){return _0x23b020['status'](0x1f4)[_0xd38c('0xf')](_0x337be3);});};exports[_0xd38c('0x11')]=function(_0x16d6f4,_0x299557){var _0x448545=[_0xd38c('0x12')];return new BPromise(function(_0x1dbb7c,_0x308c6e){return exec(util['format'](_0xd38c('0x13'),_0x16d6f4[_0xd38c('0x14')][_0xd38c('0x15')]),function(_0x55428f,_0x5781bf,_0x416cab){if(_0x55428f){return _0x308c6e(_0x55428f);}return _0x1dbb7c(_0x5781bf);});})['then'](function(_0x228a71){var _0x236f33=![];var _0x52b735=_0x228a71[_0xd38c('0x16')](/\n/);for(var _0x37d949=0x0,_0x2145b9=_0x448545[_0xd38c('0x17')];_0x37d949<_0x2145b9,_0x236f33===![];_0x37d949+=0x1){if(_0x228a71['indexOf'](_0x448545[_0x37d949])>=0x0){_0x236f33=!![];}}if(!_0x236f33){throw new Error(util[_0xd38c('0x18')](_0xd38c('0x19'),_0x16d6f4[_0xd38c('0x14')][_0xd38c('0x15')]));}process[_0xd38c('0x1a')](_0x16d6f4[_0xd38c('0x14')]['pid'],_0xd38c('0x1b'));return _0x299557['status'](0xc8)['json']({'message':util[_0xd38c('0x18')](_0xd38c('0x1c'),_0x16d6f4[_0xd38c('0x14')][_0xd38c('0x15')])});})['catch'](handleError(_0x299557,null,_0xd38c('0x11')));};
\ No newline at end of file
index 8bbe0ee..e60b52b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e83=['put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x770a81,_0x1737bc){var _0x5223ad=function(_0x16c892){while(--_0x16c892){_0x770a81['push'](_0x770a81['shift']());}};_0x5223ad(++_0x1737bc);}(_0x6e83,0x16d));var _0x36e8=function(_0x2881e2,_0x341293){_0x2881e2=_0x2881e2-0x0;var _0x5c1e1f=_0x6e83[_0x2881e2];return _0x5c1e1f;};'use strict';var multer=require(_0x36e8('0x0'));var util=require(_0x36e8('0x1'));var path=require(_0x36e8('0x2'));var timeout=require('connect-timeout');var express=require(_0x36e8('0x3'));var router=express[_0x36e8('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x36e8('0x5'));var config=require(_0x36e8('0x6'));var controller=require(_0x36e8('0x7'));router[_0x36e8('0x8')]('/',auth[_0x36e8('0x9')](),controller[_0x36e8('0xa')]);router['get'](_0x36e8('0xb'),auth[_0x36e8('0x9')](),controller[_0x36e8('0xc')]);router[_0x36e8('0xd')]('/',auth[_0x36e8('0x9')](),controller[_0x36e8('0xe')]);router[_0x36e8('0xf')](_0x36e8('0xb'),auth[_0x36e8('0x9')](),controller[_0x36e8('0x10')]);router[_0x36e8('0x11')](_0x36e8('0xb'),auth[_0x36e8('0x9')](),controller[_0x36e8('0x12')]);module[_0x36e8('0x13')]=router;
\ No newline at end of file
+var _0xaaae=['util','path','express','Router','fs-extra','../../components/interaction/service','./tag.controller','isAuthenticated','index','show','post','create','/:id','update','exports','multer'];(function(_0x190f48,_0x1e4c8c){var _0x4b0c45=function(_0x1bfd7e){while(--_0x1bfd7e){_0x190f48['push'](_0x190f48['shift']());}};_0x4b0c45(++_0x1e4c8c);}(_0xaaae,0x7f));var _0xeaaa=function(_0x81541b,_0x211950){_0x81541b=_0x81541b-0x0;var _0x5d6fcb=_0xaaae[_0x81541b];return _0x5d6fcb;};'use strict';var multer=require(_0xeaaa('0x0'));var util=require(_0xeaaa('0x1'));var path=require(_0xeaaa('0x2'));var timeout=require('connect-timeout');var express=require(_0xeaaa('0x3'));var router=express[_0xeaaa('0x4')]();var fs_extra=require(_0xeaaa('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xeaaa('0x6'));var config=require('../../config/environment');var controller=require(_0xeaaa('0x7'));router['get']('/',auth[_0xeaaa('0x8')](),controller[_0xeaaa('0x9')]);router['get']('/:id',auth[_0xeaaa('0x8')](),controller[_0xeaaa('0xa')]);router[_0xeaaa('0xb')]('/',auth['isAuthenticated'](),controller[_0xeaaa('0xc')]);router['put'](_0xeaaa('0xd'),auth[_0xeaaa('0x8')](),controller[_0xeaaa('0xe')]);router['delete'](_0xeaaa('0xd'),auth[_0xeaaa('0x8')](),controller['destroy']);module[_0xeaaa('0xf')]=router;
\ No newline at end of file
index aabe6af..ee9ff03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1752=['#0091EA','exports','STRING','name'];(function(_0x295fe9,_0x345828){var _0x3b80df=function(_0x85b4dc){while(--_0x85b4dc){_0x295fe9['push'](_0x295fe9['shift']());}};_0x3b80df(++_0x345828);}(_0x1752,0xa5));var _0x2175=function(_0x28e7b0,_0x2b2029){_0x28e7b0=_0x28e7b0-0x0;var _0x2397ef=_0x1752[_0x28e7b0];return _0x2397ef;};'use strict';var Sequelize=require('sequelize');module[_0x2175('0x0')]={'name':{'type':Sequelize[_0x2175('0x1')],'unique':_0x2175('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x2175('0x1')],'defaultValue':_0x2175('0x3')},'description':{'type':Sequelize[_0x2175('0x1')]}};
\ No newline at end of file
+var _0x7a52=['#0091EA','sequelize','STRING','name'];(function(_0x2a51b4,_0x4fe9f6){var _0x4ee0b8=function(_0x4e1a1c){while(--_0x4e1a1c){_0x2a51b4['push'](_0x2a51b4['shift']());}};_0x4ee0b8(++_0x4fe9f6);}(_0x7a52,0x1bd));var _0x27a5=function(_0x5039dd,_0x52f7e5){_0x5039dd=_0x5039dd-0x0;var _0x3b701b=_0x7a52[_0x5039dd];return _0x3b701b;};'use strict';var Sequelize=require(_0x27a5('0x0'));module['exports']={'name':{'type':Sequelize[_0x27a5('0x1')],'unique':_0x27a5('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x27a5('0x1')],'defaultValue':_0x27a5('0x3')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index ae71758..5352087 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x524a=['rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','count','status','set','Content-Range','apply','reject','save','update','then','Tags','UserProfileResource','destroy','stack','name','index','map','Tag','fieldName','model','query','filters','attributes','intersection','fields','length','limit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','keys','rawAttributes','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format'];(function(_0x5a4257,_0x3ae34d){var _0x3746a7=function(_0x31fff0){while(--_0x31fff0){_0x5a4257['push'](_0x5a4257['shift']());}};_0x3746a7(++_0x3ae34d);}(_0x524a,0xf5));var _0xa524=function(_0x6c5e4,_0x4fff35){_0x6c5e4=_0x6c5e4-0x0;var _0x4f83f5=_0x524a[_0x6c5e4];return _0x4f83f5;};'use strict';var emlformat=require(_0xa524('0x0'));var rimraf=require(_0xa524('0x1'));var zipdir=require(_0xa524('0x2'));var jsonpatch=require(_0xa524('0x3'));var rp=require('request-promise');var moment=require(_0xa524('0x4'));var BPromise=require(_0xa524('0x5'));var Mustache=require(_0xa524('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa524('0x7'));var csv=require(_0xa524('0x8'));var ejs=require(_0xa524('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa524('0xa'));var squel=require('squel');var crypto=require(_0xa524('0xb'));var jsforce=require(_0xa524('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa524('0x8'));var querystring=require(_0xa524('0xd'));var Papa=require(_0xa524('0xe'));var Redis=require(_0xa524('0xf'));var authService=require(_0xa524('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa524('0x11'));var hardwareService=require(_0xa524('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xa524('0x13'));var config=require(_0xa524('0x14'));var licenseUtil=require(_0xa524('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55117f,_0x14a0d6){_0x14a0d6=_0x14a0d6||0xcc;return function(_0x4aa46d){if(_0x4aa46d){return _0x55117f[_0xa524('0x16')](_0x14a0d6);}return _0x55117f['status'](_0x14a0d6)[_0xa524('0x17')]();};}function respondWithResult(_0x5c7e6a,_0x75bfe8){_0x75bfe8=_0x75bfe8||0xc8;return function(_0x281137){if(_0x281137){return _0x5c7e6a['status'](_0x75bfe8)[_0xa524('0x18')](_0x281137);}};}function respondWithFilteredResult(_0x15b14c,_0xe85361){return function(_0x1de01e){if(_0x1de01e){var _0x45347f=typeof _0xe85361[_0xa524('0x19')]===_0xa524('0x1a')&&typeof _0xe85361['limit']===_0xa524('0x1a');var _0x3d8494=_0x1de01e[_0xa524('0x1b')];var _0x3d6a0d=_0x45347f?0x0:_0xe85361[_0xa524('0x19')];var _0x805b93=_0x45347f?_0x1de01e[_0xa524('0x1b')]:_0xe85361[_0xa524('0x19')]+_0xe85361['limit'];var _0x304dea;if(_0x805b93>=_0x3d8494){_0x805b93=_0x3d8494;_0x304dea=0xc8;}else{_0x304dea=0xce;}_0x15b14c[_0xa524('0x1c')](_0x304dea);return _0x15b14c[_0xa524('0x1d')](_0xa524('0x1e'),_0x3d6a0d+'-'+_0x805b93+'/'+_0x3d8494)['json'](_0x1de01e);}return null;};}function patchUpdates(_0x5510fa){return function(_0x40f4bd){try{jsonpatch[_0xa524('0x1f')](_0x40f4bd,_0x5510fa,!![]);}catch(_0x21e114){return BPromise[_0xa524('0x20')](_0x21e114);}return _0x40f4bd[_0xa524('0x21')]();};}function saveUpdates(_0x3866e2,_0x4abffe){return function(_0x262eac){if(_0x262eac){return _0x262eac[_0xa524('0x22')](_0x3866e2)[_0xa524('0x23')](function(_0x40fb4b){return _0x40fb4b;});}return null;};}function removeEntity(_0x226784,_0x45cdcc){return function(_0x26e931){if(_0x26e931){return _0x26e931['destroy']()[_0xa524('0x23')](function(){var _0x221bf=_0x26e931['get']({'plain':!![]});var _0x47efb3=_0xa524('0x24');return db[_0xa524('0x25')][_0xa524('0x26')]({'where':{'type':_0x47efb3,'resourceId':_0x221bf['id']}})[_0xa524('0x23')](function(){return _0x26e931;});})[_0xa524('0x23')](function(){_0x226784['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1aeabc,_0x869b22){return function(_0x1582fa){if(!_0x1582fa){_0x1aeabc[_0xa524('0x16')](0x194);}return _0x1582fa;};}function handleError(_0x505c42,_0x1c84c6){_0x1c84c6=_0x1c84c6||0x1f4;return function(_0x32ba03){logger['error'](_0x32ba03[_0xa524('0x27')]);if(_0x32ba03[_0xa524('0x28')]){delete _0x32ba03['name'];}_0x505c42[_0xa524('0x1c')](_0x1c84c6)['send'](_0x32ba03);};}exports[_0xa524('0x29')]=function(_0x38e051,_0x45b846){var _0x238133={},_0x136e83={},_0x1c706b={'count':0x0,'rows':[]};var _0x4f6133=_[_0xa524('0x2a')](db[_0xa524('0x2b')]['rawAttributes'],function(_0x535e41){return{'name':_0x535e41[_0xa524('0x2c')],'type':_0x535e41['type']['key']};});_0x136e83[_0xa524('0x2d')]=_[_0xa524('0x2a')](_0x4f6133,_0xa524('0x28'));_0x136e83[_0xa524('0x2e')]=_['keys'](_0x38e051['query']);_0x136e83[_0xa524('0x2f')]=_['intersection'](_0x136e83['model'],_0x136e83[_0xa524('0x2e')]);_0x238133[_0xa524('0x30')]=_[_0xa524('0x31')](_0x136e83[_0xa524('0x2d')],qs[_0xa524('0x32')](_0x38e051[_0xa524('0x2e')][_0xa524('0x32')]));_0x238133[_0xa524('0x30')]=_0x238133[_0xa524('0x30')][_0xa524('0x33')]?_0x238133[_0xa524('0x30')]:_0x136e83[_0xa524('0x2d')];if(!_0x38e051['query']['hasOwnProperty']('nolimit')){_0x238133[_0xa524('0x34')]=qs[_0xa524('0x34')](_0x38e051['query'][_0xa524('0x34')]);_0x238133['offset']=qs[_0xa524('0x19')](_0x38e051[_0xa524('0x2e')]['offset']);}_0x238133[_0xa524('0x35')]=qs[_0xa524('0x36')](_0x38e051[_0xa524('0x2e')]['sort']);_0x238133[_0xa524('0x37')]=qs[_0xa524('0x2f')](_['pick'](_0x38e051[_0xa524('0x2e')],_0x136e83[_0xa524('0x2f')]),_0x4f6133);if(_0x38e051['query'][_0xa524('0x38')]){_0x238133[_0xa524('0x37')]=_['merge'](_0x238133[_0xa524('0x37')],{'$or':_[_0xa524('0x2a')](_0x4f6133,function(_0x186395){if(_0x186395[_0xa524('0x39')]!==_0xa524('0x3a')){var _0x38f87a={};_0x38f87a[_0x186395[_0xa524('0x28')]]={'$like':'%'+_0x38e051[_0xa524('0x2e')][_0xa524('0x38')]+'%'};return _0x38f87a;}})});}_0x238133=_[_0xa524('0x3b')]({},_0x238133,_0x38e051[_0xa524('0x3c')]);var _0x51cd09={'where':_0x238133[_0xa524('0x37')]};return db['Tag'][_0xa524('0x1b')](_0x51cd09)[_0xa524('0x23')](function(_0x35d92d){_0x1c706b[_0xa524('0x1b')]=_0x35d92d;if(_0x38e051[_0xa524('0x2e')][_0xa524('0x3d')]){_0x238133[_0xa524('0x3e')]=[{'all':!![]}];}return db[_0xa524('0x2b')][_0xa524('0x3f')](_0x238133);})[_0xa524('0x23')](function(_0x4a87d4){_0x1c706b[_0xa524('0x40')]=_0x4a87d4;return _0x1c706b;})[_0xa524('0x23')](respondWithFilteredResult(_0x45b846,_0x238133))['catch'](handleError(_0x45b846,null));};exports[_0xa524('0x41')]=function(_0x3f5564,_0x4885a4){var _0x492851={'raw':!![],'where':{'id':_0x3f5564['params']['id']}},_0x4dff4b={};_0x4dff4b['model']=_[_0xa524('0x42')](db[_0xa524('0x2b')][_0xa524('0x43')]);_0x4dff4b[_0xa524('0x2e')]=_['keys'](_0x3f5564[_0xa524('0x2e')]);_0x4dff4b[_0xa524('0x2f')]=_[_0xa524('0x31')](_0x4dff4b[_0xa524('0x2d')],_0x4dff4b['query']);_0x492851[_0xa524('0x30')]=_[_0xa524('0x31')](_0x4dff4b[_0xa524('0x2d')],qs[_0xa524('0x32')](_0x3f5564[_0xa524('0x2e')]['fields']));_0x492851[_0xa524('0x30')]=_0x492851[_0xa524('0x30')][_0xa524('0x33')]?_0x492851[_0xa524('0x30')]:_0x4dff4b[_0xa524('0x2d')];if(_0x3f5564[_0xa524('0x2e')][_0xa524('0x3d')]){_0x492851[_0xa524('0x3e')]=[{'all':!![]}];}_0x492851=_[_0xa524('0x3b')]({},_0x492851,_0x3f5564['options']);return db['Tag'][_0xa524('0x44')](_0x492851)[_0xa524('0x23')](handleEntityNotFound(_0x4885a4,null))[_0xa524('0x23')](respondWithResult(_0x4885a4,null))[_0xa524('0x45')](handleError(_0x4885a4,null));};exports[_0xa524('0x46')]=function(_0xddc80,_0x56e570){return db[_0xa524('0x2b')][_0xa524('0x46')](_0xddc80[_0xa524('0x47')],{})[_0xa524('0x23')](function(_0x24c7ef){var _0x451bbe=_0xddc80['user'][_0xa524('0x48')]({'plain':!![]});if(!_0x451bbe)throw new Error(_0xa524('0x49'));if(_0x451bbe[_0xa524('0x4a')]===_0xa524('0x4b')){var _0x25ffbd=_0x24c7ef[_0xa524('0x48')]({'plain':!![]});var _0xef18b7=_0xa524('0x24');return db[_0xa524('0x4c')][_0xa524('0x44')]({'where':{'name':_0xef18b7,'userProfileId':_0x451bbe[_0xa524('0x4d')]},'raw':!![]})[_0xa524('0x23')](function(_0x3a374f){if(_0x3a374f&&_0x3a374f[_0xa524('0x4e')]===0x0){return db[_0xa524('0x25')]['create']({'name':_0x25ffbd[_0xa524('0x28')],'resourceId':_0x25ffbd['id'],'type':_0x3a374f[_0xa524('0x28')],'sectionId':_0x3a374f['id']},{})['then'](function(){return _0x24c7ef;});}else{return _0x24c7ef;}})['catch'](function(_0x32844c){logger[_0xa524('0x4f')](_0xa524('0x50'),_0x32844c);throw _0x32844c;});}return _0x24c7ef;})[_0xa524('0x23')](respondWithResult(_0x56e570,0xc9))[_0xa524('0x45')](handleError(_0x56e570,null));};exports[_0xa524('0x22')]=function(_0x121fc5,_0x4e3709){if(_0x121fc5[_0xa524('0x47')]['id']){delete _0x121fc5[_0xa524('0x47')]['id'];}return db[_0xa524('0x2b')][_0xa524('0x44')]({'where':{'id':_0x121fc5[_0xa524('0x51')]['id']}})['then'](handleEntityNotFound(_0x4e3709,null))[_0xa524('0x23')](saveUpdates(_0x121fc5['body'],null))[_0xa524('0x23')](respondWithResult(_0x4e3709,null))[_0xa524('0x45')](handleError(_0x4e3709,null));};exports[_0xa524('0x26')]=function(_0x3f5694,_0x161393){return db[_0xa524('0x2b')][_0xa524('0x44')]({'where':{'id':_0x3f5694['params']['id']}})['then'](handleEntityNotFound(_0x161393,null))[_0xa524('0x23')](removeEntity(_0x161393,null))[_0xa524('0x45')](handleError(_0x161393,null));};
\ No newline at end of file
+var _0xcb91=['json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get','Tags','UserProfileResource','error','stack','name','send','Tag','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','includeAll','rows','catch','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','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'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x48f7cf,_0x4baa04){_0x48f7cf=_0x48f7cf-0x0;var _0xc201c0=_0xcb91[_0x48f7cf];return _0xc201c0;};'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(){var _0x10a419=_0x55b232[_0x1cb9('0x24')]({'plain':!![]});var _0x69b4c8=_0x1cb9('0x25');return db[_0x1cb9('0x26')]['destroy']({'where':{'type':_0x69b4c8,'resourceId':_0x10a419['id']}})[_0x1cb9('0x22')](function(){return _0x55b232;});})[_0x1cb9('0x22')](function(){_0x27db16['status'](0xcc)[_0x1cb9('0x18')]();});}};}function handleEntityNotFound(_0x21effa,_0x41a9a0){return function(_0x1804fd){if(!_0x1804fd){_0x21effa[_0x1cb9('0x16')](0x194);}return _0x1804fd;};}function handleError(_0x21d6f5,_0x2e28fe){_0x2e28fe=_0x2e28fe||0x1f4;return function(_0xb644b3){logger[_0x1cb9('0x27')](_0xb644b3[_0x1cb9('0x28')]);if(_0xb644b3['name']){delete _0xb644b3[_0x1cb9('0x29')];}_0x21d6f5['status'](_0x2e28fe)[_0x1cb9('0x2a')](_0xb644b3);};}exports['index']=function(_0x278327,_0x41011c){var _0x3cd7f5={},_0x2038aa={},_0x561d89={'count':0x0,'rows':[]};var _0x1c701f=_['map'](db[_0x1cb9('0x2b')][_0x1cb9('0x2c')],function(_0x4220d7){return{'name':_0x4220d7['fieldName'],'type':_0x4220d7[_0x1cb9('0x2d')]['key']};});_0x2038aa[_0x1cb9('0x2e')]=_['map'](_0x1c701f,_0x1cb9('0x29'));_0x2038aa[_0x1cb9('0x2f')]=_[_0x1cb9('0x30')](_0x278327[_0x1cb9('0x2f')]);_0x2038aa['filters']=_[_0x1cb9('0x31')](_0x2038aa[_0x1cb9('0x2e')],_0x2038aa[_0x1cb9('0x2f')]);_0x3cd7f5[_0x1cb9('0x32')]=_[_0x1cb9('0x31')](_0x2038aa[_0x1cb9('0x2e')],qs[_0x1cb9('0x33')](_0x278327[_0x1cb9('0x2f')][_0x1cb9('0x33')]));_0x3cd7f5[_0x1cb9('0x32')]=_0x3cd7f5[_0x1cb9('0x32')][_0x1cb9('0x34')]?_0x3cd7f5[_0x1cb9('0x32')]:_0x2038aa['model'];if(!_0x278327['query'][_0x1cb9('0x35')](_0x1cb9('0x36'))){_0x3cd7f5[_0x1cb9('0x1c')]=qs[_0x1cb9('0x1c')](_0x278327[_0x1cb9('0x2f')][_0x1cb9('0x1c')]);_0x3cd7f5[_0x1cb9('0x1a')]=qs[_0x1cb9('0x1a')](_0x278327['query'][_0x1cb9('0x1a')]);}_0x3cd7f5[_0x1cb9('0x37')]=qs[_0x1cb9('0x38')](_0x278327['query'][_0x1cb9('0x38')]);_0x3cd7f5['where']=qs[_0x1cb9('0x39')](_['pick'](_0x278327[_0x1cb9('0x2f')],_0x2038aa[_0x1cb9('0x39')]),_0x1c701f);if(_0x278327[_0x1cb9('0x2f')][_0x1cb9('0x3a')]){_0x3cd7f5[_0x1cb9('0x3b')]=_[_0x1cb9('0x3c')](_0x3cd7f5[_0x1cb9('0x3b')],{'$or':_['map'](_0x1c701f,function(_0x4ca19e){if(_0x4ca19e[_0x1cb9('0x2d')]!==_0x1cb9('0x3d')){var _0x7a0d8b={};_0x7a0d8b[_0x4ca19e[_0x1cb9('0x29')]]={'$like':'%'+_0x278327[_0x1cb9('0x2f')][_0x1cb9('0x3a')]+'%'};return _0x7a0d8b;}})});}_0x3cd7f5=_[_0x1cb9('0x3c')]({},_0x3cd7f5,_0x278327['options']);var _0xbcaa32={'where':_0x3cd7f5['where']};return db['Tag']['count'](_0xbcaa32)[_0x1cb9('0x22')](function(_0x397ff9){_0x561d89[_0x1cb9('0x1d')]=_0x397ff9;if(_0x278327[_0x1cb9('0x2f')][_0x1cb9('0x3e')]){_0x3cd7f5['include']=[{'all':!![]}];}return db[_0x1cb9('0x2b')]['findAll'](_0x3cd7f5);})[_0x1cb9('0x22')](function(_0x71db9d){_0x561d89[_0x1cb9('0x3f')]=_0x71db9d;return _0x561d89;})['then'](respondWithFilteredResult(_0x41011c,_0x3cd7f5))[_0x1cb9('0x40')](handleError(_0x41011c,null));};exports['show']=function(_0xda1a44,_0xbc36fc){var _0x51a898={'raw':!![],'where':{'id':_0xda1a44[_0x1cb9('0x41')]['id']}},_0x5839aa={};_0x5839aa[_0x1cb9('0x2e')]=_[_0x1cb9('0x30')](db[_0x1cb9('0x2b')][_0x1cb9('0x2c')]);_0x5839aa['query']=_[_0x1cb9('0x30')](_0xda1a44['query']);_0x5839aa['filters']=_['intersection'](_0x5839aa[_0x1cb9('0x2e')],_0x5839aa[_0x1cb9('0x2f')]);_0x51a898[_0x1cb9('0x32')]=_[_0x1cb9('0x31')](_0x5839aa[_0x1cb9('0x2e')],qs[_0x1cb9('0x33')](_0xda1a44[_0x1cb9('0x2f')][_0x1cb9('0x33')]));_0x51a898[_0x1cb9('0x32')]=_0x51a898[_0x1cb9('0x32')][_0x1cb9('0x34')]?_0x51a898['attributes']:_0x5839aa[_0x1cb9('0x2e')];if(_0xda1a44[_0x1cb9('0x2f')][_0x1cb9('0x3e')]){_0x51a898['include']=[{'all':!![]}];}_0x51a898=_[_0x1cb9('0x3c')]({},_0x51a898,_0xda1a44[_0x1cb9('0x42')]);return db[_0x1cb9('0x2b')][_0x1cb9('0x43')](_0x51a898)[_0x1cb9('0x22')](handleEntityNotFound(_0xbc36fc,null))['then'](respondWithResult(_0xbc36fc,null))[_0x1cb9('0x40')](handleError(_0xbc36fc,null));};exports['create']=function(_0x2eaa11,_0x4ac483){return db[_0x1cb9('0x2b')][_0x1cb9('0x44')](_0x2eaa11[_0x1cb9('0x45')],{})[_0x1cb9('0x22')](function(_0x56d0c5){var _0x298475=_0x2eaa11[_0x1cb9('0x46')][_0x1cb9('0x24')]({'plain':!![]});if(!_0x298475)throw new Error(_0x1cb9('0x47'));if(_0x298475[_0x1cb9('0x48')]===_0x1cb9('0x46')){var _0x17b92a=_0x56d0c5[_0x1cb9('0x24')]({'plain':!![]});var _0xbb500e=_0x1cb9('0x25');return db['UserProfileSection']['find']({'where':{'name':_0xbb500e,'userProfileId':_0x298475[_0x1cb9('0x49')]},'raw':!![]})[_0x1cb9('0x22')](function(_0x19e83a){if(_0x19e83a&&_0x19e83a[_0x1cb9('0x4a')]===0x0){return db[_0x1cb9('0x26')][_0x1cb9('0x44')]({'name':_0x17b92a[_0x1cb9('0x29')],'resourceId':_0x17b92a['id'],'type':_0x19e83a[_0x1cb9('0x29')],'sectionId':_0x19e83a['id']},{})[_0x1cb9('0x22')](function(){return _0x56d0c5;});}else{return _0x56d0c5;}})[_0x1cb9('0x40')](function(_0x4a4b87){logger[_0x1cb9('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a4b87);throw _0x4a4b87;});}return _0x56d0c5;})[_0x1cb9('0x22')](respondWithResult(_0x4ac483,0xc9))['catch'](handleError(_0x4ac483,null));};exports[_0x1cb9('0x21')]=function(_0x53c002,_0x5e5174){if(_0x53c002[_0x1cb9('0x45')]['id']){delete _0x53c002[_0x1cb9('0x45')]['id'];}return db[_0x1cb9('0x2b')]['find']({'where':{'id':_0x53c002[_0x1cb9('0x41')]['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x5e5174,null))['then'](saveUpdates(_0x53c002['body'],null))[_0x1cb9('0x22')](respondWithResult(_0x5e5174,null))[_0x1cb9('0x40')](handleError(_0x5e5174,null));};exports[_0x1cb9('0x23')]=function(_0x2b3f2a,_0x3de325){return db[_0x1cb9('0x2b')][_0x1cb9('0x43')]({'where':{'id':_0x2b3f2a['params']['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x3de325,null))[_0x1cb9('0x22')](removeEntity(_0x3de325,null))[_0x1cb9('0x40')](handleError(_0x3de325,null));};
\ No newline at end of file
index ee6324c..75d45a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb169=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','util'];(function(_0x562f75,_0x12ece1){var _0x574c95=function(_0x39e01c){while(--_0x39e01c){_0x562f75['push'](_0x562f75['shift']());}};_0x574c95(++_0x12ece1);}(_0xb169,0x117));var _0x9b16=function(_0x537501,_0x1509e4){_0x537501=_0x537501-0x0;var _0x54bfc2=_0xb169[_0x537501];return _0x54bfc2;};'use strict';var _=require('lodash');var util=require(_0x9b16('0x0'));var logger=require(_0x9b16('0x1'))(_0x9b16('0x2'));var moment=require(_0x9b16('0x3'));var BPromise=require(_0x9b16('0x4'));var rp=require(_0x9b16('0x5'));var fs=require('fs');var path=require(_0x9b16('0x6'));var rimraf=require(_0x9b16('0x7'));var config=require(_0x9b16('0x8'));var attributes=require(_0x9b16('0x9'));module[_0x9b16('0xa')]=function(_0x1547e6,_0x621902){return _0x1547e6[_0x9b16('0xb')](_0x9b16('0xc'),attributes,{'tableName':_0x9b16('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1545=['define','Tag','tools_tags','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./tag.attributes','exports'];(function(_0x200d1a,_0x33a0f3){var _0x35a57e=function(_0x2adaa5){while(--_0x2adaa5){_0x200d1a['push'](_0x200d1a['shift']());}};_0x35a57e(++_0x33a0f3);}(_0x1545,0x1b3));var _0x5154=function(_0x1631a0,_0xb2411b){_0x1631a0=_0x1631a0-0x0;var _0x814543=_0x1545[_0x1631a0];return _0x814543;};'use strict';var _=require(_0x5154('0x0'));var util=require(_0x5154('0x1'));var logger=require(_0x5154('0x2'))(_0x5154('0x3'));var moment=require(_0x5154('0x4'));var BPromise=require('bluebird');var rp=require(_0x5154('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5154('0x6'));var attributes=require(_0x5154('0x7'));module[_0x5154('0x8')]=function(_0x329b1e,_0x2d17d8){return _0x329b1e[_0x5154('0x9')](_0x5154('0xa'),attributes,{'tableName':_0x5154('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 03a1ee1..516da57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f17=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then','info','request\x20sent','debug','stringify','error','code','Tag,\x20%s,\x20%s','message','result','catch','lodash','moment'];(function(_0x3f2485,_0x1d8d18){var _0x4beea5=function(_0x563281){while(--_0x563281){_0x3f2485['push'](_0x3f2485['shift']());}};_0x4beea5(++_0x1d8d18);}(_0x4f17,0x9e));var _0x74f1=function(_0x4fabbe,_0xc514f3){_0x4fabbe=_0x4fabbe-0x0;var _0x5510dd=_0x4f17[_0x4fabbe];return _0x5510dd;};'use strict';var _=require(_0x74f1('0x0'));var util=require('util');var moment=require(_0x74f1('0x1'));var BPromise=require(_0x74f1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x74f1('0x3'));var db=require(_0x74f1('0x4'))['db'];var utils=require(_0x74f1('0x5'));var logger=require(_0x74f1('0x6'))(_0x74f1('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x74f1('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe54c30,_0x51effb,_0x34ec03){return new BPromise(function(_0x339d55,_0x3b4914){return client['request'](_0xe54c30,_0x34ec03)[_0x74f1('0x9')](function(_0x4c4e41){logger[_0x74f1('0xa')]('Tag,\x20%s,\x20%s',_0x51effb,_0x74f1('0xb'));logger[_0x74f1('0xc')]('Tag,\x20%s,\x20%s,\x20%s',_0x51effb,'request\x20sent',JSON[_0x74f1('0xd')](_0x4c4e41));if(_0x4c4e41[_0x74f1('0xe')]){if(_0x4c4e41[_0x74f1('0xe')][_0x74f1('0xf')]===0x1f4){logger[_0x74f1('0xe')](_0x74f1('0x10'),_0x51effb,_0x4c4e41[_0x74f1('0xe')][_0x74f1('0x11')]);return _0x3b4914(_0x4c4e41[_0x74f1('0xe')][_0x74f1('0x11')]);}logger['error'](_0x74f1('0x10'),_0x51effb,_0x4c4e41['error'][_0x74f1('0x11')]);return _0x339d55(_0x4c4e41['error'][_0x74f1('0x11')]);}else{logger[_0x74f1('0xa')](_0x74f1('0x10'),_0x51effb,_0x74f1('0xb'));_0x339d55(_0x4c4e41[_0x74f1('0x12')]['message']);}})[_0x74f1('0x13')](function(_0x10a0b1){logger['error'](_0x74f1('0x10'),_0x51effb,_0x10a0b1);_0x3b4914(_0x10a0b1);});});}
\ No newline at end of file
+var _0xf2cb=['util','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','info','Tag,\x20%s,\x20%s','debug','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x5804ae,_0x5240b6){var _0x1b2882=function(_0x42d9f3){while(--_0x42d9f3){_0x5804ae['push'](_0x5804ae['shift']());}};_0x1b2882(++_0x5240b6);}(_0xf2cb,0x130));var _0xbf2c=function(_0x227060,_0x3afa81){_0x227060=_0x227060-0x0;var _0x6cf9d8=_0xf2cb[_0x227060];return _0x6cf9d8;};'use strict';var _=require('lodash');var util=require(_0xbf2c('0x0'));var moment=require('moment');var BPromise=require(_0xbf2c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf2c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf2c('0x3'));var logger=require(_0xbf2c('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbf2c('0x5'));var client=jayson[_0xbf2c('0x6')][_0xbf2c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xaacd25,_0x516715,_0x16cf35){return new BPromise(function(_0x584a08,_0x25d0a6){return client['request'](_0xaacd25,_0x16cf35)['then'](function(_0x1601d5){logger[_0xbf2c('0x8')](_0xbf2c('0x9'),_0x516715,'request\x20sent');logger[_0xbf2c('0xa')](_0xbf2c('0xb'),_0x516715,_0xbf2c('0xc'),JSON[_0xbf2c('0xd')](_0x1601d5));if(_0x1601d5[_0xbf2c('0xe')]){if(_0x1601d5[_0xbf2c('0xe')][_0xbf2c('0xf')]===0x1f4){logger[_0xbf2c('0xe')]('Tag,\x20%s,\x20%s',_0x516715,_0x1601d5[_0xbf2c('0xe')][_0xbf2c('0x10')]);return _0x25d0a6(_0x1601d5[_0xbf2c('0xe')][_0xbf2c('0x10')]);}logger['error'](_0xbf2c('0x9'),_0x516715,_0x1601d5['error']['message']);return _0x584a08(_0x1601d5[_0xbf2c('0xe')]['message']);}else{logger['info'](_0xbf2c('0x9'),_0x516715,_0xbf2c('0xc'));_0x584a08(_0x1601d5[_0xbf2c('0x11')][_0xbf2c('0x10')]);}})[_0xbf2c('0x12')](function(_0x537084){logger[_0xbf2c('0xe')]('Tag,\x20%s,\x20%s',_0x516715,_0x537084);_0x25d0a6(_0x537084);});});}
\ No newline at end of file
index d769087..c018607 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 bf313b6..e54aa01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['STRING','name'];(function(_0x329d8d,_0x57a2b5){var _0x211dba=function(_0x299da2){while(--_0x299da2){_0x329d8d['push'](_0x329d8d['shift']());}};_0x211dba(++_0x57a2b5);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}};
\ No newline at end of file
+var _0x2032=['name','exports','STRING'];(function(_0x5b7b81,_0x47d77a){var _0x3addbe=function(_0x1f793a){while(--_0x1f793a){_0x5b7b81['push'](_0x5b7b81['shift']());}};_0x3addbe(++_0x47d77a);}(_0x2032,0xd9));var _0x2203=function(_0x4a9b28,_0x5ddb76){_0x4a9b28=_0x4a9b28-0x0;var _0x1bc7be=_0x2032[_0x4a9b28];return _0x1bc7be;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 1c4c2f1..22a1f74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ee3=['nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./team.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','error','stack','name','send','map','Team','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','where','merge','includeAll','include','rows','catch','show','options','create','user','get','Teams','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','destroy','sequelize','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','SmsQueueId','ChatQueueId','UserChatQueue','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','Queue','pick','toLowerCase','Queues','addQueues','add','removeQueues','remove','ids','addAgents','isArray','Voice','Chat','Mail','Sms','Openchannel','Whatsapp','transaction','through','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','findAll','online','interface','UserVoiceQueueRt','upsert','isNil','format','voicePause','all','removeAgents','Queue:remove','getAgents','findOne'];(function(_0x4df8c5,_0x5e0f78){var _0x5e3903=function(_0x55ce83){while(--_0x55ce83){_0x4df8c5['push'](_0x4df8c5['shift']());}};_0x5e3903(++_0x5e0f78);}(_0x3ee3,0x97));var _0x33ee=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x3ee3[_0x278e3c];return _0x3e2d9b;};'use strict';var emlformat=require(_0x33ee('0x0'));var rimraf=require(_0x33ee('0x1'));var zipdir=require(_0x33ee('0x2'));var jsonpatch=require(_0x33ee('0x3'));var rp=require(_0x33ee('0x4'));var moment=require('moment');var BPromise=require(_0x33ee('0x5'));var Mustache=require('mustache');var util=require(_0x33ee('0x6'));var path=require(_0x33ee('0x7'));var sox=require(_0x33ee('0x8'));var csv=require(_0x33ee('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x33ee('0xa'));var _=require('lodash');var squel=require(_0x33ee('0xb'));var crypto=require(_0x33ee('0xc'));var jsforce=require(_0x33ee('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x33ee('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x33ee('0xf'));var as=require(_0x33ee('0x10'));var hardwareService=require(_0x33ee('0x11'));var logger=require('../../config/logger')(_0x33ee('0x12'));var utils=require('../../config/utils');var config=require(_0x33ee('0x13'));var licenseUtil=require(_0x33ee('0x14'));var db=require(_0x33ee('0x15'))['db'];config['redis']=_[_0x33ee('0x16')](config[_0x33ee('0x17')],{'host':_0x33ee('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x33ee('0x19'))[_0x33ee('0x1a')](socket);function respondWithStatusCode(_0x27a2d8,_0x545376){_0x545376=_0x545376||0xcc;return function(_0x35a72a){if(_0x35a72a){return _0x27a2d8[_0x33ee('0x1b')](_0x545376);}return _0x27a2d8[_0x33ee('0x1c')](_0x545376)[_0x33ee('0x1d')]();};}function respondWithResult(_0x269106,_0x4ba9f3){_0x4ba9f3=_0x4ba9f3||0xc8;return function(_0x170ae9){if(_0x170ae9){return _0x269106[_0x33ee('0x1c')](_0x4ba9f3)[_0x33ee('0x1e')](_0x170ae9);}};}function respondWithFilteredResult(_0x436d72,_0x12fd8b){return function(_0x299490){if(_0x299490){var _0x253f9e=typeof _0x12fd8b[_0x33ee('0x1f')]===_0x33ee('0x20')&&typeof _0x12fd8b['limit']==='undefined';var _0x27ff4c=_0x299490[_0x33ee('0x21')];var _0x8ed750=_0x253f9e?0x0:_0x12fd8b[_0x33ee('0x1f')];var _0x23d827=_0x253f9e?_0x299490[_0x33ee('0x21')]:_0x12fd8b[_0x33ee('0x1f')]+_0x12fd8b[_0x33ee('0x22')];var _0x53e630;if(_0x23d827>=_0x27ff4c){_0x23d827=_0x27ff4c;_0x53e630=0xc8;}else{_0x53e630=0xce;}_0x436d72['status'](_0x53e630);return _0x436d72[_0x33ee('0x23')](_0x33ee('0x24'),_0x8ed750+'-'+_0x23d827+'/'+_0x27ff4c)[_0x33ee('0x1e')](_0x299490);}return null;};}function patchUpdates(_0x3d9223){return function(_0x14c0e1){try{jsonpatch['apply'](_0x14c0e1,_0x3d9223,!![]);}catch(_0x261f68){return BPromise[_0x33ee('0x25')](_0x261f68);}return _0x14c0e1[_0x33ee('0x26')]();};}function saveUpdates(_0x137790,_0x359991){return function(_0x4ee7ba){if(_0x4ee7ba){return _0x4ee7ba[_0x33ee('0x27')](_0x137790)[_0x33ee('0x28')](function(_0x2b8d83){return _0x2b8d83;});}return null;};}function handleEntityNotFound(_0x35590,_0x344d90){return function(_0x242619){if(!_0x242619){_0x35590[_0x33ee('0x1b')](0x194);}return _0x242619;};}function handleError(_0x4d0f41,_0x4a43eb){_0x4a43eb=_0x4a43eb||0x1f4;return function(_0x346882){logger[_0x33ee('0x29')](_0x346882[_0x33ee('0x2a')]);if(_0x346882[_0x33ee('0x2b')]){delete _0x346882[_0x33ee('0x2b')];}_0x4d0f41[_0x33ee('0x1c')](_0x4a43eb)[_0x33ee('0x2c')](_0x346882);};}exports['index']=function(_0x2d8369,_0x21ebb8){var _0x297ca9={},_0x2eed58={},_0x4bba92={'count':0x0,'rows':[]};var _0x4d2300=_[_0x33ee('0x2d')](db[_0x33ee('0x2e')][_0x33ee('0x2f')],function(_0x35015c){return{'name':_0x35015c['fieldName'],'type':_0x35015c[_0x33ee('0x30')][_0x33ee('0x31')]};});_0x2eed58[_0x33ee('0x32')]=_['map'](_0x4d2300,'name');_0x2eed58['query']=_[_0x33ee('0x33')](_0x2d8369[_0x33ee('0x34')]);_0x2eed58['filters']=_[_0x33ee('0x35')](_0x2eed58[_0x33ee('0x32')],_0x2eed58[_0x33ee('0x34')]);_0x297ca9[_0x33ee('0x36')]=_[_0x33ee('0x35')](_0x2eed58[_0x33ee('0x32')],qs['fields'](_0x2d8369[_0x33ee('0x34')][_0x33ee('0x37')]));_0x297ca9['attributes']=_0x297ca9[_0x33ee('0x36')][_0x33ee('0x38')]?_0x297ca9[_0x33ee('0x36')]:_0x2eed58[_0x33ee('0x32')];if(!_0x2d8369['query'][_0x33ee('0x39')]('nolimit')){_0x297ca9[_0x33ee('0x22')]=qs[_0x33ee('0x22')](_0x2d8369[_0x33ee('0x34')][_0x33ee('0x22')]);_0x297ca9[_0x33ee('0x1f')]=qs['offset'](_0x2d8369['query'][_0x33ee('0x1f')]);}_0x297ca9[_0x33ee('0x3a')]=qs[_0x33ee('0x3b')](_0x2d8369['query'][_0x33ee('0x3b')]);_0x297ca9['where']=qs[_0x33ee('0x3c')](_['pick'](_0x2d8369[_0x33ee('0x34')],_0x2eed58['filters']),_0x4d2300);if(_0x2d8369[_0x33ee('0x34')][_0x33ee('0x3d')]){_0x297ca9[_0x33ee('0x3e')]=_[_0x33ee('0x3f')](_0x297ca9['where'],{'$or':_['map'](_0x4d2300,function(_0x4983d){if(_0x4983d[_0x33ee('0x30')]!=='VIRTUAL'){var _0x389d82={};_0x389d82[_0x4983d[_0x33ee('0x2b')]]={'$like':'%'+_0x2d8369[_0x33ee('0x34')][_0x33ee('0x3d')]+'%'};return _0x389d82;}})});}_0x297ca9=_['merge']({},_0x297ca9,_0x2d8369['options']);var _0x1a3e9f={'where':_0x297ca9['where']};return db[_0x33ee('0x2e')][_0x33ee('0x21')](_0x1a3e9f)[_0x33ee('0x28')](function(_0x153732){_0x4bba92[_0x33ee('0x21')]=_0x153732;if(_0x2d8369[_0x33ee('0x34')][_0x33ee('0x40')]){_0x297ca9[_0x33ee('0x41')]=[{'all':!![]}];}return db[_0x33ee('0x2e')]['findAll'](_0x297ca9);})[_0x33ee('0x28')](function(_0x290a2e){_0x4bba92[_0x33ee('0x42')]=_0x290a2e;return _0x4bba92;})[_0x33ee('0x28')](respondWithFilteredResult(_0x21ebb8,_0x297ca9))[_0x33ee('0x43')](handleError(_0x21ebb8,null));};exports[_0x33ee('0x44')]=function(_0x2d8c89,_0xc98ebd){var _0x11c638={'raw':![],'where':{'id':_0x2d8c89['params']['id']}},_0xa72717={};_0xa72717[_0x33ee('0x32')]=_['keys'](db[_0x33ee('0x2e')][_0x33ee('0x2f')]);_0xa72717['query']=_[_0x33ee('0x33')](_0x2d8c89['query']);_0xa72717[_0x33ee('0x3c')]=_['intersection'](_0xa72717[_0x33ee('0x32')],_0xa72717[_0x33ee('0x34')]);_0x11c638['attributes']=_[_0x33ee('0x35')](_0xa72717['model'],qs[_0x33ee('0x37')](_0x2d8c89['query'][_0x33ee('0x37')]));_0x11c638[_0x33ee('0x36')]=_0x11c638['attributes']['length']?_0x11c638[_0x33ee('0x36')]:_0xa72717[_0x33ee('0x32')];if(_0x2d8c89[_0x33ee('0x34')][_0x33ee('0x40')]){_0x11c638[_0x33ee('0x41')]=[{'all':!![]}];}_0x11c638=_['merge']({},_0x11c638,_0x2d8c89[_0x33ee('0x45')]);return db['Team']['find'](_0x11c638)['then'](handleEntityNotFound(_0xc98ebd,null))[_0x33ee('0x28')](respondWithResult(_0xc98ebd,null))[_0x33ee('0x43')](handleError(_0xc98ebd,null));};exports['create']=function(_0x475871,_0x22fe4e){return db[_0x33ee('0x2e')][_0x33ee('0x46')](_0x475871['body'],{})[_0x33ee('0x28')](function(_0x364772){var _0x2e35b7=_0x475871[_0x33ee('0x47')][_0x33ee('0x48')]({'plain':!![]});if(!_0x2e35b7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e35b7['role']===_0x33ee('0x47')){var _0x58f0ea=_0x364772[_0x33ee('0x48')]({'plain':!![]});var _0x4b3aec=_0x33ee('0x49');return db[_0x33ee('0x4a')][_0x33ee('0x4b')]({'where':{'name':_0x4b3aec,'userProfileId':_0x2e35b7['userProfileId']},'raw':!![]})[_0x33ee('0x28')](function(_0x3be26e){if(_0x3be26e&&_0x3be26e[_0x33ee('0x4c')]===0x0){return db[_0x33ee('0x4d')][_0x33ee('0x46')]({'name':_0x58f0ea[_0x33ee('0x2b')],'resourceId':_0x58f0ea['id'],'type':_0x3be26e[_0x33ee('0x2b')],'sectionId':_0x3be26e['id']},{})[_0x33ee('0x28')](function(){return _0x364772;});}else{return _0x364772;}})['catch'](function(_0x141c50){logger[_0x33ee('0x29')](_0x33ee('0x4e'),_0x141c50);throw _0x141c50;});}return _0x364772;})[_0x33ee('0x28')](respondWithResult(_0x22fe4e,0xc9))[_0x33ee('0x43')](handleError(_0x22fe4e,null));};exports[_0x33ee('0x27')]=function(_0x282487,_0x4ba7b0){if(_0x282487[_0x33ee('0x4f')]['id']){delete _0x282487[_0x33ee('0x4f')]['id'];}return db[_0x33ee('0x2e')][_0x33ee('0x4b')]({'where':{'id':_0x282487[_0x33ee('0x50')]['id']}})[_0x33ee('0x28')](handleEntityNotFound(_0x4ba7b0,null))['then'](saveUpdates(_0x282487['body'],null))[_0x33ee('0x28')](respondWithResult(_0x4ba7b0,null))['catch'](handleError(_0x4ba7b0,null));};exports[_0x33ee('0x51')]=function(_0x417772,_0x2362fa){var _0x152f6e=_0x417772[_0x33ee('0x50')]['id'];var _0x474fee=[];return db[_0x33ee('0x52')]['transaction'](function(_0x40e480){var _0x2fb54c='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x152f6e;return db[_0x33ee('0x52')][_0x33ee('0x34')](_0x2fb54c,{'type':db[_0x33ee('0x53')][_0x33ee('0x54')][_0x33ee('0x55')],'raw':!![],'transaction':_0x40e480})[_0x33ee('0x28')](function(_0x46666c){_0x474fee=_['map'](_0x46666c,function(_0x219bdd){return Number(_0x219bdd[_0x33ee('0x56')]);});})['then'](function(){var _0x3299cc=_0x33ee('0x57')+_0x152f6e;return db[_0x33ee('0x52')]['query'](_0x3299cc,{'type':db[_0x33ee('0x53')]['QueryTypes'][_0x33ee('0x55')],'raw':!![],'transaction':_0x40e480});})[_0x33ee('0x28')](function(_0x49def0){var _0x359109=_[_0x33ee('0x2d')](_0x49def0,function(_0x375791){return Number(_0x375791[_0x33ee('0x58')]);});return db[_0x33ee('0x59')][_0x33ee('0x51')]({'where':{'UserId':{'$in':_0x474fee},'VoiceQueueId':{'$in':_0x359109}},'transaction':_0x40e480});})[_0x33ee('0x28')](function(){var _0x379133=_0x33ee('0x5a')+_0x152f6e;return db[_0x33ee('0x52')][_0x33ee('0x34')](_0x379133,{'type':db['Sequelize'][_0x33ee('0x54')][_0x33ee('0x55')],'raw':!![],'transaction':_0x40e480});})[_0x33ee('0x28')](function(_0xb5474f){var _0x4d9bfc=_['map'](_0xb5474f,function(_0x1b9cd1){return Number(_0x1b9cd1[_0x33ee('0x5b')]);});return db['UserMailQueue'][_0x33ee('0x51')]({'where':{'UserId':{'$in':_0x474fee},'MailQueueId':{'$in':_0x4d9bfc}},'transaction':_0x40e480});})[_0x33ee('0x28')](function(){var _0xf77263='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x152f6e;return db[_0x33ee('0x52')][_0x33ee('0x34')](_0xf77263,{'type':db[_0x33ee('0x53')][_0x33ee('0x54')][_0x33ee('0x55')],'raw':!![],'transaction':_0x40e480});})[_0x33ee('0x28')](function(_0x26efd8){var _0x49cbb2=_['map'](_0x26efd8,function(_0xe6fdf0){return Number(_0xe6fdf0[_0x33ee('0x5c')]);});return db['UserSmsQueue'][_0x33ee('0x51')]({'where':{'UserId':{'$in':_0x474fee},'SmsQueueId':{'$in':_0x49cbb2}},'transaction':_0x40e480});})[_0x33ee('0x28')](function(){var _0x2aa6c9='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x152f6e;return db[_0x33ee('0x52')]['query'](_0x2aa6c9,{'type':db[_0x33ee('0x53')]['QueryTypes'][_0x33ee('0x55')],'raw':!![],'transaction':_0x40e480});})[_0x33ee('0x28')](function(_0x3c8643){var _0xb5e210=_[_0x33ee('0x2d')](_0x3c8643,function(_0x2c0ef1){return Number(_0x2c0ef1[_0x33ee('0x5d')]);});return db[_0x33ee('0x5e')][_0x33ee('0x51')]({'where':{'UserId':{'$in':_0x474fee},'ChatQueueId':{'$in':_0xb5e210}},'transaction':_0x40e480});})[_0x33ee('0x28')](function(){var _0x38f4df='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x152f6e;return db[_0x33ee('0x52')][_0x33ee('0x34')](_0x38f4df,{'type':db[_0x33ee('0x53')][_0x33ee('0x54')][_0x33ee('0x55')],'raw':!![],'transaction':_0x40e480});})[_0x33ee('0x28')](function(_0x3e4658){var _0x4e80d0=_[_0x33ee('0x2d')](_0x3e4658,function(_0x59a2bd){return Number(_0x59a2bd[_0x33ee('0x5f')]);});return db[_0x33ee('0x60')][_0x33ee('0x51')]({'where':{'UserId':{'$in':_0x474fee},'FaxQueueId':{'$in':_0x4e80d0}},'transaction':_0x40e480});})[_0x33ee('0x28')](function(){var _0x246580=_0x33ee('0x61')+_0x152f6e;return db[_0x33ee('0x52')][_0x33ee('0x34')](_0x246580,{'type':db['Sequelize'][_0x33ee('0x54')][_0x33ee('0x55')],'raw':!![],'transaction':_0x40e480});})[_0x33ee('0x28')](function(_0x4cd6c6){var _0x5382b8=_[_0x33ee('0x2d')](_0x4cd6c6,function(_0x31976d){return Number(_0x31976d[_0x33ee('0x62')]);});return db[_0x33ee('0x63')][_0x33ee('0x51')]({'where':{'UserId':{'$in':_0x474fee},'OpenchannelQueueId':{'$in':_0x5382b8}},'transaction':_0x40e480});})[_0x33ee('0x28')](function(){var _0x237bc1=_0x33ee('0x64')+_0x152f6e;return db[_0x33ee('0x52')][_0x33ee('0x34')](_0x237bc1,{'type':db['Sequelize'][_0x33ee('0x54')][_0x33ee('0x55')],'raw':!![],'transaction':_0x40e480});})[_0x33ee('0x28')](function(_0x4181fc){var _0x362d09=_['map'](_0x4181fc,function(_0x57dbf9){return Number(_0x57dbf9['WhatsappQueueId']);});return db[_0x33ee('0x65')][_0x33ee('0x51')]({'where':{'UserId':{'$in':_0x474fee},'WhatsappQueueId':{'$in':_0x362d09}},'transaction':_0x40e480});})[_0x33ee('0x28')](function(){return db[_0x33ee('0x66')]['find']({'where':{'TeamId':_0x152f6e}});})[_0x33ee('0x28')](function(_0x246b36){if(_0x246b36===null){return;}return db[_0x33ee('0x67')][_0x33ee('0x51')]({'where':{'UserId':{'$in':_0x474fee},'VoicePrefixId':_0x246b36[_0x33ee('0x68')]},'transaction':_0x40e480});})[_0x33ee('0x28')](function(){return db[_0x33ee('0x2e')][_0x33ee('0x51')]({'where':{'id':_0x152f6e},'cascade':!![],'transaction':_0x40e480});})[_0x33ee('0x28')](function(_0x28d024){if(_0x28d024===0x0){_0x2362fa['sendStatus'](0x194);}else{return db[_0x33ee('0x4d')]['destroy']({'where':{'type':'Teams','resourceId':_0x152f6e},'cascade':!![],'transaction':_0x40e480})[_0x33ee('0x28')](function(){_0x2362fa[_0x33ee('0x1c')](0xcc)['end']();});}})[_0x33ee('0x43')](function(_0x326158){_0x2362fa[_0x33ee('0x1c')](0x1f4)[_0x33ee('0x2c')](_0x326158);});});};exports['getQueues']=function(_0x4bd590,_0x5f5973,_0x114134){return db['Team']['findOne']({'where':{'id':_0x4bd590['params']['id']}})[_0x33ee('0x28')](handleEntityNotFound(_0x5f5973,null))['then'](function(_0x4580ba){if(!_0x4bd590[_0x33ee('0x34')][_0x33ee('0x69')]||!utils[_0x33ee('0x6a')](_0x4bd590[_0x33ee('0x34')][_0x33ee('0x69')])){throw new db[(_0x33ee('0x53'))][(_0x33ee('0x6b'))](_0x33ee('0x6c'));}var _0x2de3ca={};var _0x47cc40={};_0x47cc40['model']=_['keys'](db[_[_0x33ee('0x6d')](_0x4bd590[_0x33ee('0x34')][_0x33ee('0x69')]['toLowerCase']())+_0x33ee('0x6e')]['rawAttributes']);_0x47cc40[_0x33ee('0x34')]=_[_0x33ee('0x33')](_0x4bd590['query']);_0x47cc40[_0x33ee('0x3c')]=_[_0x33ee('0x35')](_0x47cc40[_0x33ee('0x32')],_0x47cc40['query']);_0x2de3ca[_0x33ee('0x36')]=_[_0x33ee('0x35')](_0x47cc40['model'],qs[_0x33ee('0x37')](_0x4bd590[_0x33ee('0x34')][_0x33ee('0x37')]));_0x2de3ca[_0x33ee('0x36')]=_0x2de3ca[_0x33ee('0x36')][_0x33ee('0x38')]?_0x2de3ca[_0x33ee('0x36')]:_0x47cc40[_0x33ee('0x32')];_0x2de3ca['limit']=qs[_0x33ee('0x22')](_0x4bd590['query'][_0x33ee('0x22')]);_0x2de3ca['offset']=qs[_0x33ee('0x1f')](_0x4bd590[_0x33ee('0x34')]['offset']);_0x2de3ca[_0x33ee('0x3a')]=qs[_0x33ee('0x3b')](_0x4bd590['query'][_0x33ee('0x3b')]);_0x2de3ca[_0x33ee('0x3e')]=qs[_0x33ee('0x3c')](_[_0x33ee('0x6f')](_0x4bd590['query'],_0x47cc40[_0x33ee('0x3c')]));_0x2de3ca=_['merge']({},_0x2de3ca,_0x4bd590[_0x33ee('0x45')]);return _0x4580ba[_0x33ee('0x48')+_['capitalize'](_0x4bd590[_0x33ee('0x34')][_0x33ee('0x69')][_0x33ee('0x70')]())+_0x33ee('0x71')](_0x2de3ca);})[_0x33ee('0x28')](respondWithResult(_0x5f5973,null))[_0x33ee('0x43')](handleError(_0x5f5973,null));};exports[_0x33ee('0x72')]=function(_0x1db5fc,_0x2a296c,_0x41fcca){return db['Team']['findOne']({'where':{'id':_0x1db5fc[_0x33ee('0x50')]['id']}})[_0x33ee('0x28')](function(_0x503ce4){if(_0x503ce4){if(!_0x1db5fc[_0x33ee('0x4f')][_0x33ee('0x69')]||!utils[_0x33ee('0x6a')](_0x1db5fc[_0x33ee('0x4f')][_0x33ee('0x69')])){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}return _0x503ce4[_0x33ee('0x73')+_[_0x33ee('0x6d')](_0x1db5fc['body']['channel'][_0x33ee('0x70')]())+_0x33ee('0x71')](_0x1db5fc[_0x33ee('0x4f')]['ids']);}return null;})[_0x33ee('0x28')](handleEntityNotFound(_0x2a296c,null))[_0x33ee('0x28')](respondWithStatusCode(_0x2a296c,null))[_0x33ee('0x43')](handleError(_0x2a296c,null));};exports[_0x33ee('0x74')]=function(_0x2aade7,_0x39141c,_0x12e8a1){return db[_0x33ee('0x2e')]['findOne']({'where':{'id':_0x2aade7[_0x33ee('0x50')]['id']}})[_0x33ee('0x28')](function(_0xf86c00){if(_0xf86c00){if(!_0x2aade7['query'][_0x33ee('0x69')]||!utils[_0x33ee('0x6a')](_0x2aade7[_0x33ee('0x34')][_0x33ee('0x69')])){throw new db[(_0x33ee('0x53'))][(_0x33ee('0x6b'))](_0x33ee('0x6c'));}return _0xf86c00[_0x33ee('0x75')+_[_0x33ee('0x6d')](_0x2aade7[_0x33ee('0x34')][_0x33ee('0x69')][_0x33ee('0x70')]())+_0x33ee('0x71')](_0x2aade7['query'][_0x33ee('0x76')]);}return null;})[_0x33ee('0x28')](handleEntityNotFound(_0x39141c,null))[_0x33ee('0x28')](respondWithStatusCode(_0x39141c,null))[_0x33ee('0x43')](handleError(_0x39141c,null));};exports[_0x33ee('0x77')]=function(_0x3fa543,_0x249692){var _0x21b8d2=_[_0x33ee('0x78')](_0x3fa543[_0x33ee('0x4f')][_0x33ee('0x76')])?_0x3fa543[_0x33ee('0x4f')]['ids']:[_0x3fa543[_0x33ee('0x4f')][_0x33ee('0x76')]];var _0x5bd31b=_0x3fa543[_0x33ee('0x50')]['id'];return db[_0x33ee('0x2e')][_0x33ee('0x4b')]({'where':{'id':_0x5bd31b}})[_0x33ee('0x28')](handleEntityNotFound(_0x249692,null))['then'](function(_0x323b51){if(_0x323b51){var _0x226ebd=[_0x33ee('0x79'),_0x33ee('0x7a'),_0x33ee('0x7b'),_0x33ee('0x7c'),'Fax',_0x33ee('0x7d'),_0x33ee('0x7e')];return db[_0x33ee('0x52')][_0x33ee('0x7f')](function(_0x40766b){var _0x1aa3d9=_[_0x33ee('0x2d')](_0x226ebd,function(_0x514898){var _0x246ef0={'attributes':['id',_0x33ee('0x2b')]};if(_0x514898===_0x33ee('0x79')){_0x246ef0[_0x33ee('0x80')]={'attributes':[_0x33ee('0x81')]};}return _0x323b51['get'+_0x514898+_0x33ee('0x71')](_0x246ef0)[_0x33ee('0x28')](function(_0x1aa4e5){var _0x32a848=_[_0x33ee('0x2d')](_0x1aa4e5,function(_0x1b5e19){var _0x104270=_[_0x33ee('0x2d')](_0x21b8d2,function(_0x431c6e){var _0x1cddf3={'where':{'UserId':_0x431c6e,[_0x514898+_0x33ee('0x82')]:_0x1b5e19['id']},'transaction':_0x40766b};if(_0x514898==='Voice'){_0x1cddf3['defaults']={'penalty':_0x1b5e19[_0x33ee('0x83')]['penalty']};}return db[_0x33ee('0x84')+_0x514898+_0x33ee('0x6e')][_0x33ee('0x85')](_0x1cddf3)[_0x33ee('0x28')](function(){socket[_0x33ee('0x86')](_0x33ee('0x47')+_0x514898+_0x33ee('0x87'),{'UserId':_0x431c6e,[_0x514898+_0x33ee('0x82')]:_0x1b5e19['id']});if(_0x514898!==_0x33ee('0x79')){return;}return db[_0x33ee('0x84')][_0x33ee('0x88')]({'where':{'id':_0x21b8d2,'online':0x1},'attributes':['id',_0x33ee('0x2b'),_0x33ee('0x89'),'voicePause',_0x33ee('0x8a')],'raw':!![]})[_0x33ee('0x28')](function(_0x311344){var _0x429d6b=_[_0x33ee('0x2d')](_0x311344,function(_0x13ad84){return db[_0x33ee('0x8b')][_0x33ee('0x8c')]({'membername':_0x13ad84[_0x33ee('0x2b')],'UserId':_0x13ad84['id'],'queue_name':_0x1b5e19[_0x33ee('0x2b')],'VoiceQueueId':_0x1b5e19['id'],'interface':_[_0x33ee('0x8d')](_0x13ad84[_0x33ee('0x8a')])?util[_0x33ee('0x8e')]('SIP/%s',_0x13ad84['name']):_0x13ad84['interface'],'paused':_0x13ad84[_0x33ee('0x8f')]||![],'penalty':_0x1b5e19[_0x33ee('0x83')][_0x33ee('0x81')]},{'transaction':_0x40766b});});return Promise[_0x33ee('0x90')](_0x429d6b);});});});return Promise[_0x33ee('0x90')](_0x104270);});return Promise['all'](_0x32a848);})['then'](function(){return db[_0x33ee('0x66')]['findOne']({'where':{'teamId':_0x5bd31b}})[_0x33ee('0x28')](function(_0x1f6c3c){if(_0x1f6c3c){var _0x1519e1=_[_0x33ee('0x2d')](_0x21b8d2,function(_0x44685b){db[_0x33ee('0x67')][_0x33ee('0x8c')]({'UserId':_0x44685b,'VoicePrefixId':_0x1f6c3c['VoicePrefixId']});});return Promise[_0x33ee('0x90')](_0x1519e1);}});});});return Promise[_0x33ee('0x90')](_0x1aa3d9)[_0x33ee('0x28')](function(){return _0x323b51[_0x33ee('0x77')](_0x21b8d2,{'transaction':_0x40766b})['spread'](function(_0x499206){return _0x499206;});});});}})[_0x33ee('0x28')](respondWithResult(_0x249692,null))[_0x33ee('0x43')](handleError(_0x249692,null));};exports['removeAgents']=function(_0x5f568b,_0x172411){var _0x2bf299=_[_0x33ee('0x78')](_0x5f568b[_0x33ee('0x34')][_0x33ee('0x76')])?_0x5f568b[_0x33ee('0x34')][_0x33ee('0x76')]:[_0x5f568b[_0x33ee('0x34')][_0x33ee('0x76')]];var _0x5c646f=_0x5f568b[_0x33ee('0x50')]['id'];return db[_0x33ee('0x2e')][_0x33ee('0x4b')]({'where':{'id':_0x5c646f}})[_0x33ee('0x28')](handleEntityNotFound(_0x172411,null))[_0x33ee('0x28')](function(_0x311f02){if(_0x311f02){var _0x5b758c=[_0x33ee('0x79'),_0x33ee('0x7a'),_0x33ee('0x7b'),_0x33ee('0x7c'),'Fax',_0x33ee('0x7d'),_0x33ee('0x7e')];return db['sequelize'][_0x33ee('0x7f')](function(_0x3b28fb){var _0x38d237=_[_0x33ee('0x2d')](_0x5b758c,function(_0x48671f){var _0x4545e3={'attributes':['id',_0x33ee('0x2b')]};return _0x311f02[_0x33ee('0x48')+_0x48671f+_0x33ee('0x71')](_0x4545e3)[_0x33ee('0x28')](function(_0x5a4313){var _0x56bd57=_['map'](_0x5a4313,function(_0x535fbb){return _0x535fbb[_0x33ee('0x91')](_0x2bf299,{'transaction':_0x3b28fb})['then'](function(){var _0x547929=_['map'](_0x2bf299,function(_0x21acbb){socket[_0x33ee('0x86')](_0x33ee('0x47')+_0x48671f+_0x33ee('0x92'),{'UserId':Number(_0x21acbb),[_0x48671f+'QueueId']:_0x535fbb['id']});if(_0x48671f!==_0x33ee('0x79')){return;}return db[_0x33ee('0x8b')][_0x33ee('0x51')]({'where':{'VoiceQueueId':_0x535fbb['id'],'UserId':_0x21acbb},'transaction':_0x3b28fb});});return Promise['all'](_0x547929);});});return Promise[_0x33ee('0x90')](_0x56bd57);});});return Promise[_0x33ee('0x90')](_0x38d237)[_0x33ee('0x28')](function(){return _0x311f02[_0x33ee('0x91')](_0x2bf299,{'transaction':_0x3b28fb});})['then'](function(){return db[_0x33ee('0x66')]['findOne']({'where':{'teamId':_0x5c646f}})['then'](function(_0x1bbf85){if(_0x1bbf85){var _0x351482=_['map'](_0x2bf299,function(_0x13bb84){db['UserVoicePrefix'][_0x33ee('0x51')]({'where':{'UserId':_0x13bb84,'VoicePrefixId':_0x1bbf85['VoicePrefixId']}});});return Promise[_0x33ee('0x90')](_0x351482);}});});});}})[_0x33ee('0x28')](respondWithStatusCode(_0x172411,null))[_0x33ee('0x43')](handleError(_0x172411,null));};exports[_0x33ee('0x93')]=function(_0x9d094f,_0x57be37,_0x25354b){var _0x53b58e={};var _0x1bece7={};var _0x36a1e7;var _0xdbdff7;return db[_0x33ee('0x2e')][_0x33ee('0x94')]({'where':{'id':_0x9d094f[_0x33ee('0x50')]['id']}})[_0x33ee('0x28')](handleEntityNotFound(_0x57be37,null))['then'](function(_0x38abe7){if(_0x38abe7){_0x36a1e7=_0x38abe7;_0x1bece7['model']=_['keys'](db[_0x33ee('0x84')][_0x33ee('0x2f')]);_0x1bece7[_0x33ee('0x34')]=_[_0x33ee('0x33')](_0x9d094f[_0x33ee('0x34')]);_0x1bece7['filters']=_['intersection'](_0x1bece7[_0x33ee('0x32')],_0x1bece7[_0x33ee('0x34')]);_0x53b58e[_0x33ee('0x36')]=_['intersection'](_0x1bece7['model'],qs[_0x33ee('0x37')](_0x9d094f[_0x33ee('0x34')][_0x33ee('0x37')]));_0x53b58e[_0x33ee('0x36')]=_0x53b58e['attributes']['length']?_0x53b58e[_0x33ee('0x36')]:_0x1bece7[_0x33ee('0x32')];_0x53b58e[_0x33ee('0x3a')]=qs['sort'](_0x9d094f[_0x33ee('0x34')][_0x33ee('0x3b')]);_0x53b58e['where']=qs[_0x33ee('0x3c')](_[_0x33ee('0x6f')](_0x9d094f[_0x33ee('0x34')],_0x1bece7[_0x33ee('0x3c')]));if(_0x9d094f[_0x33ee('0x34')]['filter']){_0x53b58e[_0x33ee('0x3e')]=_[_0x33ee('0x3f')](_0x53b58e[_0x33ee('0x3e')],{'$or':_[_0x33ee('0x2d')](_0x53b58e[_0x33ee('0x36')],function(_0x1eb60b){var _0x1e99c0={};_0x1e99c0[_0x1eb60b]={'$like':'%'+_0x9d094f[_0x33ee('0x34')][_0x33ee('0x3d')]+'%'};return _0x1e99c0;})});}_0x53b58e=_['merge']({},_0x53b58e,_0x9d094f['options']);return _0x36a1e7[_0x33ee('0x93')](_0x53b58e);}})[_0x33ee('0x28')](function(_0x4ac052){if(_0x4ac052){_0xdbdff7=_0x4ac052['length'];if(!_0x9d094f[_0x33ee('0x34')][_0x33ee('0x39')](_0x33ee('0x95'))){_0x53b58e['limit']=qs[_0x33ee('0x22')](_0x9d094f['query']['limit']);_0x53b58e['offset']=qs['offset'](_0x9d094f[_0x33ee('0x34')]['offset']);}return _0x36a1e7[_0x33ee('0x93')](_0x53b58e);}})['then'](function(_0x2f1356){if(_0x2f1356){return _0x2f1356?{'count':_0xdbdff7,'rows':_0x2f1356}:null;}})[_0x33ee('0x28')](respondWithResult(_0x57be37,null))[_0x33ee('0x43')](handleError(_0x57be37,null));};
\ No newline at end of file
+var _0xb7ca=['SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','OpenchannelQueueId','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','end','getQueues','channel','isValidChannel','capitalize','toLowerCase','Queue','order','Queues','ValidationError','Unknown\x20channel','add','ids','removeQueues','findOne','remove','addAgents','isArray','Voice','Chat','Mail','Openchannel','Whatsapp','transaction','through','QueueId','TeamVoiceQueue','penalty','User','findOrCreate','emit','interface','UserVoiceQueueRt','upsert','format','SIP/%s','voicePause','all','spread','removeAgents','getAgents','hasOwnProperty','eml-format','rimraf','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','index','map','Team','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','pick','filter','where','VIRTUAL','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','merge','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes'];(function(_0x2b4448,_0x5bcc69){var _0xb4b465=function(_0x5ac741){while(--_0x5ac741){_0x2b4448['push'](_0x2b4448['shift']());}};_0xb4b465(++_0x5bcc69);}(_0xb7ca,0x178));var _0xab7c=function(_0x1c0d07,_0x38fe0d){_0x1c0d07=_0x1c0d07-0x0;var _0x2bd3ad=_0xb7ca[_0x1c0d07];return _0x2bd3ad;};'use strict';var emlformat=require(_0xab7c('0x0'));var rimraf=require(_0xab7c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xab7c('0x2'));var rp=require(_0xab7c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xab7c('0x4'));var path=require(_0xab7c('0x5'));var sox=require(_0xab7c('0x6'));var csv=require(_0xab7c('0x7'));var ejs=require(_0xab7c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xab7c('0x9'));var deskjs=require(_0xab7c('0xa'));var toCsv=require(_0xab7c('0x7'));var querystring=require(_0xab7c('0xb'));var Papa=require('papaparse');var Redis=require(_0xab7c('0xc'));var authService=require(_0xab7c('0xd'));var qs=require(_0xab7c('0xe'));var as=require(_0xab7c('0xf'));var hardwareService=require(_0xab7c('0x10'));var logger=require(_0xab7c('0x11'))(_0xab7c('0x12'));var utils=require(_0xab7c('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xab7c('0x14'));var db=require(_0xab7c('0x15'))['db'];config[_0xab7c('0x16')]=_[_0xab7c('0x17')](config['redis'],{'host':_0xab7c('0x18'),'port':0x18eb});var socket=require(_0xab7c('0x19'))(new Redis(config['redis']));require(_0xab7c('0x1a'))[_0xab7c('0x1b')](socket);function respondWithStatusCode(_0x28e4d9,_0x14dede){_0x14dede=_0x14dede||0xcc;return function(_0x674c09){if(_0x674c09){return _0x28e4d9['sendStatus'](_0x14dede);}return _0x28e4d9['status'](_0x14dede)['end']();};}function respondWithResult(_0xbf2d5f,_0x3cf844){_0x3cf844=_0x3cf844||0xc8;return function(_0x1f6289){if(_0x1f6289){return _0xbf2d5f[_0xab7c('0x1c')](_0x3cf844)[_0xab7c('0x1d')](_0x1f6289);}};}function respondWithFilteredResult(_0x548541,_0x21993c){return function(_0x14a812){if(_0x14a812){var _0x221a4c=typeof _0x21993c[_0xab7c('0x1e')]==='undefined'&&typeof _0x21993c[_0xab7c('0x1f')]===_0xab7c('0x20');var _0x1abc6a=_0x14a812[_0xab7c('0x21')];var _0x2fb8bd=_0x221a4c?0x0:_0x21993c[_0xab7c('0x1e')];var _0xc1a6c5=_0x221a4c?_0x14a812[_0xab7c('0x21')]:_0x21993c['offset']+_0x21993c[_0xab7c('0x1f')];var _0x13da1a;if(_0xc1a6c5>=_0x1abc6a){_0xc1a6c5=_0x1abc6a;_0x13da1a=0xc8;}else{_0x13da1a=0xce;}_0x548541[_0xab7c('0x1c')](_0x13da1a);return _0x548541[_0xab7c('0x22')](_0xab7c('0x23'),_0x2fb8bd+'-'+_0xc1a6c5+'/'+_0x1abc6a)[_0xab7c('0x1d')](_0x14a812);}return null;};}function patchUpdates(_0x146a03){return function(_0x239399){try{jsonpatch[_0xab7c('0x24')](_0x239399,_0x146a03,!![]);}catch(_0x59e6de){return BPromise[_0xab7c('0x25')](_0x59e6de);}return _0x239399[_0xab7c('0x26')]();};}function saveUpdates(_0x4d4aa1,_0x3c9e7a){return function(_0x443b3f){if(_0x443b3f){return _0x443b3f['update'](_0x4d4aa1)[_0xab7c('0x27')](function(_0x5b74f){return _0x5b74f;});}return null;};}function handleEntityNotFound(_0x351743,_0x1c6504){return function(_0x1d6321){if(!_0x1d6321){_0x351743[_0xab7c('0x28')](0x194);}return _0x1d6321;};}function handleError(_0x56ca83,_0x107cc0){_0x107cc0=_0x107cc0||0x1f4;return function(_0x2193c5){logger[_0xab7c('0x29')](_0x2193c5[_0xab7c('0x2a')]);if(_0x2193c5[_0xab7c('0x2b')]){delete _0x2193c5['name'];}_0x56ca83[_0xab7c('0x1c')](_0x107cc0)[_0xab7c('0x2c')](_0x2193c5);};}exports[_0xab7c('0x2d')]=function(_0x580875,_0x13aeb9){var _0x7f5a73={},_0x29e37c={},_0x5c33ed={'count':0x0,'rows':[]};var _0x193650=_[_0xab7c('0x2e')](db[_0xab7c('0x2f')]['rawAttributes'],function(_0x53d12b){return{'name':_0x53d12b[_0xab7c('0x30')],'type':_0x53d12b[_0xab7c('0x31')]['key']};});_0x29e37c[_0xab7c('0x32')]=_[_0xab7c('0x2e')](_0x193650,_0xab7c('0x2b'));_0x29e37c[_0xab7c('0x33')]=_[_0xab7c('0x34')](_0x580875['query']);_0x29e37c[_0xab7c('0x35')]=_[_0xab7c('0x36')](_0x29e37c[_0xab7c('0x32')],_0x29e37c[_0xab7c('0x33')]);_0x7f5a73[_0xab7c('0x37')]=_[_0xab7c('0x36')](_0x29e37c[_0xab7c('0x32')],qs[_0xab7c('0x38')](_0x580875[_0xab7c('0x33')][_0xab7c('0x38')]));_0x7f5a73[_0xab7c('0x37')]=_0x7f5a73[_0xab7c('0x37')]['length']?_0x7f5a73['attributes']:_0x29e37c[_0xab7c('0x32')];if(!_0x580875[_0xab7c('0x33')]['hasOwnProperty'](_0xab7c('0x39'))){_0x7f5a73[_0xab7c('0x1f')]=qs['limit'](_0x580875[_0xab7c('0x33')]['limit']);_0x7f5a73['offset']=qs['offset'](_0x580875['query'][_0xab7c('0x1e')]);}_0x7f5a73['order']=qs[_0xab7c('0x3a')](_0x580875['query'][_0xab7c('0x3a')]);_0x7f5a73['where']=qs[_0xab7c('0x35')](_[_0xab7c('0x3b')](_0x580875['query'],_0x29e37c[_0xab7c('0x35')]),_0x193650);if(_0x580875['query'][_0xab7c('0x3c')]){_0x7f5a73['where']=_['merge'](_0x7f5a73[_0xab7c('0x3d')],{'$or':_[_0xab7c('0x2e')](_0x193650,function(_0x27f0de){if(_0x27f0de[_0xab7c('0x31')]!==_0xab7c('0x3e')){var _0x48a57d={};_0x48a57d[_0x27f0de[_0xab7c('0x2b')]]={'$like':'%'+_0x580875[_0xab7c('0x33')][_0xab7c('0x3c')]+'%'};return _0x48a57d;}})});}_0x7f5a73=_['merge']({},_0x7f5a73,_0x580875['options']);var _0x33772e={'where':_0x7f5a73[_0xab7c('0x3d')]};return db[_0xab7c('0x2f')][_0xab7c('0x21')](_0x33772e)[_0xab7c('0x27')](function(_0x3f5521){_0x5c33ed[_0xab7c('0x21')]=_0x3f5521;if(_0x580875[_0xab7c('0x33')][_0xab7c('0x3f')]){_0x7f5a73['include']=[{'all':!![]}];}return db[_0xab7c('0x2f')][_0xab7c('0x40')](_0x7f5a73);})['then'](function(_0x3f48cc){_0x5c33ed[_0xab7c('0x41')]=_0x3f48cc;return _0x5c33ed;})[_0xab7c('0x27')](respondWithFilteredResult(_0x13aeb9,_0x7f5a73))[_0xab7c('0x42')](handleError(_0x13aeb9,null));};exports[_0xab7c('0x43')]=function(_0x277b80,_0x487ef9){var _0x37d4ca={'raw':![],'where':{'id':_0x277b80[_0xab7c('0x44')]['id']}},_0x37fe28={};_0x37fe28[_0xab7c('0x32')]=_[_0xab7c('0x34')](db[_0xab7c('0x2f')][_0xab7c('0x45')]);_0x37fe28[_0xab7c('0x33')]=_[_0xab7c('0x34')](_0x277b80[_0xab7c('0x33')]);_0x37fe28[_0xab7c('0x35')]=_[_0xab7c('0x36')](_0x37fe28[_0xab7c('0x32')],_0x37fe28[_0xab7c('0x33')]);_0x37d4ca[_0xab7c('0x37')]=_['intersection'](_0x37fe28[_0xab7c('0x32')],qs[_0xab7c('0x38')](_0x277b80[_0xab7c('0x33')][_0xab7c('0x38')]));_0x37d4ca[_0xab7c('0x37')]=_0x37d4ca['attributes'][_0xab7c('0x46')]?_0x37d4ca[_0xab7c('0x37')]:_0x37fe28[_0xab7c('0x32')];if(_0x277b80[_0xab7c('0x33')][_0xab7c('0x3f')]){_0x37d4ca[_0xab7c('0x47')]=[{'all':!![]}];}_0x37d4ca=_[_0xab7c('0x48')]({},_0x37d4ca,_0x277b80[_0xab7c('0x49')]);return db[_0xab7c('0x2f')][_0xab7c('0x4a')](_0x37d4ca)[_0xab7c('0x27')](handleEntityNotFound(_0x487ef9,null))[_0xab7c('0x27')](respondWithResult(_0x487ef9,null))[_0xab7c('0x42')](handleError(_0x487ef9,null));};exports[_0xab7c('0x4b')]=function(_0x105117,_0x5bddf7){return db[_0xab7c('0x2f')][_0xab7c('0x4b')](_0x105117['body'],{})[_0xab7c('0x27')](function(_0x1ad567){var _0x2453ee=_0x105117['user']['get']({'plain':!![]});if(!_0x2453ee)throw new Error(_0xab7c('0x4c'));if(_0x2453ee[_0xab7c('0x4d')]===_0xab7c('0x4e')){var _0x23f9dc=_0x1ad567[_0xab7c('0x4f')]({'plain':!![]});var _0x3fbf79=_0xab7c('0x50');return db[_0xab7c('0x51')][_0xab7c('0x4a')]({'where':{'name':_0x3fbf79,'userProfileId':_0x2453ee[_0xab7c('0x52')]},'raw':!![]})['then'](function(_0x3672c5){if(_0x3672c5&&_0x3672c5[_0xab7c('0x53')]===0x0){return db[_0xab7c('0x54')][_0xab7c('0x4b')]({'name':_0x23f9dc[_0xab7c('0x2b')],'resourceId':_0x23f9dc['id'],'type':_0x3672c5[_0xab7c('0x2b')],'sectionId':_0x3672c5['id']},{})[_0xab7c('0x27')](function(){return _0x1ad567;});}else{return _0x1ad567;}})['catch'](function(_0x8cb51f){logger['error'](_0xab7c('0x55'),_0x8cb51f);throw _0x8cb51f;});}return _0x1ad567;})['then'](respondWithResult(_0x5bddf7,0xc9))['catch'](handleError(_0x5bddf7,null));};exports[_0xab7c('0x56')]=function(_0x3ae43c,_0xbf229a){if(_0x3ae43c['body']['id']){delete _0x3ae43c[_0xab7c('0x57')]['id'];}return db[_0xab7c('0x2f')][_0xab7c('0x4a')]({'where':{'id':_0x3ae43c[_0xab7c('0x44')]['id']}})['then'](handleEntityNotFound(_0xbf229a,null))[_0xab7c('0x27')](saveUpdates(_0x3ae43c['body'],null))[_0xab7c('0x27')](respondWithResult(_0xbf229a,null))[_0xab7c('0x42')](handleError(_0xbf229a,null));};exports['destroy']=function(_0xa4f0fb,_0x4dd10b){var _0xfd05b6=_0xa4f0fb[_0xab7c('0x44')]['id'];var _0x15f2a9=[];return db[_0xab7c('0x58')]['transaction'](function(_0x3ad57f){var _0x40d246=_0xab7c('0x59')+_0xfd05b6;return db[_0xab7c('0x58')][_0xab7c('0x33')](_0x40d246,{'type':db[_0xab7c('0x5a')][_0xab7c('0x5b')][_0xab7c('0x5c')],'raw':!![],'transaction':_0x3ad57f})[_0xab7c('0x27')](function(_0x1b11c9){_0x15f2a9=_['map'](_0x1b11c9,function(_0x5b8657){return Number(_0x5b8657[_0xab7c('0x5d')]);});})[_0xab7c('0x27')](function(){var _0x565411=_0xab7c('0x5e')+_0xfd05b6;return db[_0xab7c('0x58')][_0xab7c('0x33')](_0x565411,{'type':db[_0xab7c('0x5a')][_0xab7c('0x5b')][_0xab7c('0x5c')],'raw':!![],'transaction':_0x3ad57f});})[_0xab7c('0x27')](function(_0x114686){var _0x39434e=_['map'](_0x114686,function(_0x237ea4){return Number(_0x237ea4[_0xab7c('0x5f')]);});return db['UserVoiceQueue'][_0xab7c('0x60')]({'where':{'UserId':{'$in':_0x15f2a9},'VoiceQueueId':{'$in':_0x39434e}},'transaction':_0x3ad57f});})[_0xab7c('0x27')](function(){var _0x35c2b0=_0xab7c('0x61')+_0xfd05b6;return db[_0xab7c('0x58')][_0xab7c('0x33')](_0x35c2b0,{'type':db['Sequelize'][_0xab7c('0x5b')][_0xab7c('0x5c')],'raw':!![],'transaction':_0x3ad57f});})[_0xab7c('0x27')](function(_0xbcd8a6){var _0xdc8292=_['map'](_0xbcd8a6,function(_0x347c8a){return Number(_0x347c8a[_0xab7c('0x62')]);});return db[_0xab7c('0x63')][_0xab7c('0x60')]({'where':{'UserId':{'$in':_0x15f2a9},'MailQueueId':{'$in':_0xdc8292}},'transaction':_0x3ad57f});})[_0xab7c('0x27')](function(){var _0x17b46f=_0xab7c('0x64')+_0xfd05b6;return db[_0xab7c('0x58')][_0xab7c('0x33')](_0x17b46f,{'type':db[_0xab7c('0x5a')][_0xab7c('0x5b')]['SELECT'],'raw':!![],'transaction':_0x3ad57f});})[_0xab7c('0x27')](function(_0x1010c4){var _0x388603=_[_0xab7c('0x2e')](_0x1010c4,function(_0x505cc2){return Number(_0x505cc2[_0xab7c('0x65')]);});return db[_0xab7c('0x66')][_0xab7c('0x60')]({'where':{'UserId':{'$in':_0x15f2a9},'SmsQueueId':{'$in':_0x388603}},'transaction':_0x3ad57f});})[_0xab7c('0x27')](function(){var _0x2e64a2=_0xab7c('0x67')+_0xfd05b6;return db[_0xab7c('0x58')][_0xab7c('0x33')](_0x2e64a2,{'type':db[_0xab7c('0x5a')][_0xab7c('0x5b')][_0xab7c('0x5c')],'raw':!![],'transaction':_0x3ad57f});})[_0xab7c('0x27')](function(_0x53a921){var _0x4e350a=_[_0xab7c('0x2e')](_0x53a921,function(_0x5efdc4){return Number(_0x5efdc4[_0xab7c('0x68')]);});return db['UserChatQueue']['destroy']({'where':{'UserId':{'$in':_0x15f2a9},'ChatQueueId':{'$in':_0x4e350a}},'transaction':_0x3ad57f});})[_0xab7c('0x27')](function(){var _0x56e5dd=_0xab7c('0x69')+_0xfd05b6;return db[_0xab7c('0x58')]['query'](_0x56e5dd,{'type':db[_0xab7c('0x5a')][_0xab7c('0x5b')][_0xab7c('0x5c')],'raw':!![],'transaction':_0x3ad57f});})['then'](function(_0x41d46a){var _0x270988=_[_0xab7c('0x2e')](_0x41d46a,function(_0x239b6b){return Number(_0x239b6b[_0xab7c('0x6a')]);});return db['UserFaxQueue'][_0xab7c('0x60')]({'where':{'UserId':{'$in':_0x15f2a9},'FaxQueueId':{'$in':_0x270988}},'transaction':_0x3ad57f});})[_0xab7c('0x27')](function(){var _0x286630='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0xfd05b6;return db[_0xab7c('0x58')][_0xab7c('0x33')](_0x286630,{'type':db[_0xab7c('0x5a')][_0xab7c('0x5b')][_0xab7c('0x5c')],'raw':!![],'transaction':_0x3ad57f});})['then'](function(_0x1182ca){var _0x5b7720=_[_0xab7c('0x2e')](_0x1182ca,function(_0x33be3b){return Number(_0x33be3b[_0xab7c('0x6b')]);});return db['UserOpenchannelQueue'][_0xab7c('0x60')]({'where':{'UserId':{'$in':_0x15f2a9},'OpenchannelQueueId':{'$in':_0x5b7720}},'transaction':_0x3ad57f});})[_0xab7c('0x27')](function(){var _0x341603=_0xab7c('0x6c')+_0xfd05b6;return db[_0xab7c('0x58')]['query'](_0x341603,{'type':db[_0xab7c('0x5a')]['QueryTypes'][_0xab7c('0x5c')],'raw':!![],'transaction':_0x3ad57f});})[_0xab7c('0x27')](function(_0x514e84){var _0x686a54=_[_0xab7c('0x2e')](_0x514e84,function(_0x1e37e0){return Number(_0x1e37e0[_0xab7c('0x6d')]);});return db[_0xab7c('0x6e')][_0xab7c('0x60')]({'where':{'UserId':{'$in':_0x15f2a9},'WhatsappQueueId':{'$in':_0x686a54}},'transaction':_0x3ad57f});})[_0xab7c('0x27')](function(){return db[_0xab7c('0x6f')][_0xab7c('0x4a')]({'where':{'TeamId':_0xfd05b6}});})[_0xab7c('0x27')](function(_0xc5d1b){if(_0xc5d1b===null){return;}return db[_0xab7c('0x70')][_0xab7c('0x60')]({'where':{'UserId':{'$in':_0x15f2a9},'VoicePrefixId':_0xc5d1b[_0xab7c('0x71')]},'transaction':_0x3ad57f});})[_0xab7c('0x27')](function(){return db[_0xab7c('0x2f')]['destroy']({'where':{'id':_0xfd05b6},'cascade':!![],'transaction':_0x3ad57f});})[_0xab7c('0x27')](function(_0x2cb30e){if(_0x2cb30e===0x0){_0x4dd10b[_0xab7c('0x28')](0x194);}else{return db['UserProfileResource']['destroy']({'where':{'type':_0xab7c('0x50'),'resourceId':_0xfd05b6},'cascade':!![],'transaction':_0x3ad57f})['then'](function(){_0x4dd10b[_0xab7c('0x1c')](0xcc)[_0xab7c('0x72')]();});}})[_0xab7c('0x42')](function(_0x510fc1){_0x4dd10b[_0xab7c('0x1c')](0x1f4)[_0xab7c('0x2c')](_0x510fc1);});});};exports[_0xab7c('0x73')]=function(_0x57e074,_0x8d9574,_0x5152d2){return db[_0xab7c('0x2f')]['findOne']({'where':{'id':_0x57e074[_0xab7c('0x44')]['id']}})['then'](handleEntityNotFound(_0x8d9574,null))[_0xab7c('0x27')](function(_0x4df834){if(!_0x57e074[_0xab7c('0x33')][_0xab7c('0x74')]||!utils[_0xab7c('0x75')](_0x57e074['query'][_0xab7c('0x74')])){throw new db[(_0xab7c('0x5a'))]['ValidationError']('Unknown\x20channel');}var _0x3caef7={};var _0x481c07={};_0x481c07[_0xab7c('0x32')]=_[_0xab7c('0x34')](db[_[_0xab7c('0x76')](_0x57e074['query'][_0xab7c('0x74')][_0xab7c('0x77')]())+_0xab7c('0x78')][_0xab7c('0x45')]);_0x481c07[_0xab7c('0x33')]=_['keys'](_0x57e074[_0xab7c('0x33')]);_0x481c07[_0xab7c('0x35')]=_[_0xab7c('0x36')](_0x481c07[_0xab7c('0x32')],_0x481c07[_0xab7c('0x33')]);_0x3caef7[_0xab7c('0x37')]=_[_0xab7c('0x36')](_0x481c07[_0xab7c('0x32')],qs['fields'](_0x57e074[_0xab7c('0x33')][_0xab7c('0x38')]));_0x3caef7[_0xab7c('0x37')]=_0x3caef7[_0xab7c('0x37')][_0xab7c('0x46')]?_0x3caef7['attributes']:_0x481c07[_0xab7c('0x32')];_0x3caef7[_0xab7c('0x1f')]=qs[_0xab7c('0x1f')](_0x57e074[_0xab7c('0x33')][_0xab7c('0x1f')]);_0x3caef7['offset']=qs['offset'](_0x57e074[_0xab7c('0x33')]['offset']);_0x3caef7[_0xab7c('0x79')]=qs[_0xab7c('0x3a')](_0x57e074[_0xab7c('0x33')][_0xab7c('0x3a')]);_0x3caef7[_0xab7c('0x3d')]=qs['filters'](_[_0xab7c('0x3b')](_0x57e074[_0xab7c('0x33')],_0x481c07[_0xab7c('0x35')]));_0x3caef7=_[_0xab7c('0x48')]({},_0x3caef7,_0x57e074[_0xab7c('0x49')]);return _0x4df834['get'+_[_0xab7c('0x76')](_0x57e074['query']['channel'][_0xab7c('0x77')]())+_0xab7c('0x7a')](_0x3caef7);})[_0xab7c('0x27')](respondWithResult(_0x8d9574,null))[_0xab7c('0x42')](handleError(_0x8d9574,null));};exports['addQueues']=function(_0x2906dd,_0x53b851,_0x3c1d33){return db[_0xab7c('0x2f')]['findOne']({'where':{'id':_0x2906dd[_0xab7c('0x44')]['id']}})['then'](function(_0x30fd29){if(_0x30fd29){if(!_0x2906dd[_0xab7c('0x57')][_0xab7c('0x74')]||!utils[_0xab7c('0x75')](_0x2906dd[_0xab7c('0x57')][_0xab7c('0x74')])){throw new db[(_0xab7c('0x5a'))][(_0xab7c('0x7b'))](_0xab7c('0x7c'));}return _0x30fd29[_0xab7c('0x7d')+_['capitalize'](_0x2906dd[_0xab7c('0x57')][_0xab7c('0x74')][_0xab7c('0x77')]())+_0xab7c('0x7a')](_0x2906dd[_0xab7c('0x57')][_0xab7c('0x7e')]);}return null;})[_0xab7c('0x27')](handleEntityNotFound(_0x53b851,null))['then'](respondWithStatusCode(_0x53b851,null))[_0xab7c('0x42')](handleError(_0x53b851,null));};exports[_0xab7c('0x7f')]=function(_0x11fd0f,_0x197fa6,_0x3c50a2){return db['Team'][_0xab7c('0x80')]({'where':{'id':_0x11fd0f[_0xab7c('0x44')]['id']}})[_0xab7c('0x27')](function(_0x5604cf){if(_0x5604cf){if(!_0x11fd0f[_0xab7c('0x33')][_0xab7c('0x74')]||!utils['isValidChannel'](_0x11fd0f[_0xab7c('0x33')][_0xab7c('0x74')])){throw new db[(_0xab7c('0x5a'))][(_0xab7c('0x7b'))](_0xab7c('0x7c'));}return _0x5604cf[_0xab7c('0x81')+_['capitalize'](_0x11fd0f['query']['channel']['toLowerCase']())+_0xab7c('0x7a')](_0x11fd0f[_0xab7c('0x33')][_0xab7c('0x7e')]);}return null;})[_0xab7c('0x27')](handleEntityNotFound(_0x197fa6,null))[_0xab7c('0x27')](respondWithStatusCode(_0x197fa6,null))[_0xab7c('0x42')](handleError(_0x197fa6,null));};exports[_0xab7c('0x82')]=function(_0xdd9753,_0xaceca7){var _0x52bf26=_[_0xab7c('0x83')](_0xdd9753[_0xab7c('0x57')][_0xab7c('0x7e')])?_0xdd9753[_0xab7c('0x57')][_0xab7c('0x7e')]:[_0xdd9753[_0xab7c('0x57')][_0xab7c('0x7e')]];var _0x393f9e=_0xdd9753[_0xab7c('0x44')]['id'];return db[_0xab7c('0x2f')]['find']({'where':{'id':_0x393f9e}})['then'](handleEntityNotFound(_0xaceca7,null))[_0xab7c('0x27')](function(_0x455a07){if(_0x455a07){var _0x642d13=[_0xab7c('0x84'),_0xab7c('0x85'),_0xab7c('0x86'),'Sms','Fax',_0xab7c('0x87'),_0xab7c('0x88')];return db[_0xab7c('0x58')][_0xab7c('0x89')](function(_0x269983){var _0x17a630=_[_0xab7c('0x2e')](_0x642d13,function(_0x1e1421){var _0x5c585c={'attributes':['id',_0xab7c('0x2b')]};if(_0x1e1421===_0xab7c('0x84')){_0x5c585c[_0xab7c('0x8a')]={'attributes':['penalty']};}return _0x455a07[_0xab7c('0x4f')+_0x1e1421+'Queues'](_0x5c585c)[_0xab7c('0x27')](function(_0x3aad87){var _0x415181=_[_0xab7c('0x2e')](_0x3aad87,function(_0x4884c6){var _0x3f0ba7=_['map'](_0x52bf26,function(_0x51a4ed){var _0xf4e8f8={'where':{'UserId':_0x51a4ed,[_0x1e1421+_0xab7c('0x8b')]:_0x4884c6['id']},'transaction':_0x269983};if(_0x1e1421===_0xab7c('0x84')){_0xf4e8f8[_0xab7c('0x17')]={'penalty':_0x4884c6[_0xab7c('0x8c')][_0xab7c('0x8d')]};}return db[_0xab7c('0x8e')+_0x1e1421+'Queue'][_0xab7c('0x8f')](_0xf4e8f8)[_0xab7c('0x27')](function(){socket[_0xab7c('0x90')](_0xab7c('0x4e')+_0x1e1421+'Queue:save',{'UserId':_0x51a4ed,[_0x1e1421+'QueueId']:_0x4884c6['id']});if(_0x1e1421!==_0xab7c('0x84')){return;}return db['User'][_0xab7c('0x40')]({'where':{'id':_0x52bf26,'online':0x1},'attributes':['id','name','online','voicePause',_0xab7c('0x91')],'raw':!![]})[_0xab7c('0x27')](function(_0x5e6e19){var _0x26d5dd=_[_0xab7c('0x2e')](_0x5e6e19,function(_0x36b1d9){return db[_0xab7c('0x92')][_0xab7c('0x93')]({'membername':_0x36b1d9[_0xab7c('0x2b')],'UserId':_0x36b1d9['id'],'queue_name':_0x4884c6[_0xab7c('0x2b')],'VoiceQueueId':_0x4884c6['id'],'interface':_['isNil'](_0x36b1d9[_0xab7c('0x91')])?util[_0xab7c('0x94')](_0xab7c('0x95'),_0x36b1d9['name']):_0x36b1d9[_0xab7c('0x91')],'paused':_0x36b1d9[_0xab7c('0x96')]||![],'penalty':_0x4884c6[_0xab7c('0x8c')][_0xab7c('0x8d')]},{'transaction':_0x269983});});return Promise['all'](_0x26d5dd);});});});return Promise[_0xab7c('0x97')](_0x3f0ba7);});return Promise[_0xab7c('0x97')](_0x415181);})[_0xab7c('0x27')](function(){return db[_0xab7c('0x6f')][_0xab7c('0x80')]({'where':{'teamId':_0x393f9e}})[_0xab7c('0x27')](function(_0x7686f0){if(_0x7686f0){var _0x134d99=_[_0xab7c('0x2e')](_0x52bf26,function(_0x1048f9){db[_0xab7c('0x70')][_0xab7c('0x93')]({'UserId':_0x1048f9,'VoicePrefixId':_0x7686f0['VoicePrefixId']});});return Promise[_0xab7c('0x97')](_0x134d99);}});});});return Promise[_0xab7c('0x97')](_0x17a630)['then'](function(){return _0x455a07[_0xab7c('0x82')](_0x52bf26,{'transaction':_0x269983})[_0xab7c('0x98')](function(_0x2eea42){return _0x2eea42;});});});}})[_0xab7c('0x27')](respondWithResult(_0xaceca7,null))['catch'](handleError(_0xaceca7,null));};exports[_0xab7c('0x99')]=function(_0x55747b,_0x4030f1){var _0xb6d6a=_['isArray'](_0x55747b[_0xab7c('0x33')][_0xab7c('0x7e')])?_0x55747b[_0xab7c('0x33')][_0xab7c('0x7e')]:[_0x55747b[_0xab7c('0x33')][_0xab7c('0x7e')]];var _0x57582b=_0x55747b[_0xab7c('0x44')]['id'];return db[_0xab7c('0x2f')]['find']({'where':{'id':_0x57582b}})[_0xab7c('0x27')](handleEntityNotFound(_0x4030f1,null))[_0xab7c('0x27')](function(_0x1da924){if(_0x1da924){var _0x459f77=['Voice',_0xab7c('0x85'),'Mail','Sms','Fax',_0xab7c('0x87'),_0xab7c('0x88')];return db['sequelize']['transaction'](function(_0x2bc23b){var _0x45fd24=_[_0xab7c('0x2e')](_0x459f77,function(_0x697c1b){var _0x51d08b={'attributes':['id',_0xab7c('0x2b')]};return _0x1da924[_0xab7c('0x4f')+_0x697c1b+_0xab7c('0x7a')](_0x51d08b)[_0xab7c('0x27')](function(_0x4ea577){var _0x48e14c=_[_0xab7c('0x2e')](_0x4ea577,function(_0x353db0){return _0x353db0[_0xab7c('0x99')](_0xb6d6a,{'transaction':_0x2bc23b})['then'](function(){var _0x860cc7=_[_0xab7c('0x2e')](_0xb6d6a,function(_0x17c33e){socket[_0xab7c('0x90')](_0xab7c('0x4e')+_0x697c1b+'Queue:remove',{'UserId':Number(_0x17c33e),[_0x697c1b+_0xab7c('0x8b')]:_0x353db0['id']});if(_0x697c1b!==_0xab7c('0x84')){return;}return db[_0xab7c('0x92')][_0xab7c('0x60')]({'where':{'VoiceQueueId':_0x353db0['id'],'UserId':_0x17c33e},'transaction':_0x2bc23b});});return Promise[_0xab7c('0x97')](_0x860cc7);});});return Promise[_0xab7c('0x97')](_0x48e14c);});});return Promise['all'](_0x45fd24)[_0xab7c('0x27')](function(){return _0x1da924[_0xab7c('0x99')](_0xb6d6a,{'transaction':_0x2bc23b});})[_0xab7c('0x27')](function(){return db['TeamVoicePrefix'][_0xab7c('0x80')]({'where':{'teamId':_0x57582b}})[_0xab7c('0x27')](function(_0x3bce51){if(_0x3bce51){var _0xb97f7b=_[_0xab7c('0x2e')](_0xb6d6a,function(_0x347923){db[_0xab7c('0x70')]['destroy']({'where':{'UserId':_0x347923,'VoicePrefixId':_0x3bce51[_0xab7c('0x71')]}});});return Promise['all'](_0xb97f7b);}});});});}})['then'](respondWithStatusCode(_0x4030f1,null))[_0xab7c('0x42')](handleError(_0x4030f1,null));};exports[_0xab7c('0x9a')]=function(_0x1f5acf,_0x40c745,_0x233a08){var _0x150565={};var _0x3a0c4a={};var _0x42382c;var _0x1843ea;return db[_0xab7c('0x2f')][_0xab7c('0x80')]({'where':{'id':_0x1f5acf[_0xab7c('0x44')]['id']}})[_0xab7c('0x27')](handleEntityNotFound(_0x40c745,null))[_0xab7c('0x27')](function(_0x15666c){if(_0x15666c){_0x42382c=_0x15666c;_0x3a0c4a[_0xab7c('0x32')]=_[_0xab7c('0x34')](db[_0xab7c('0x8e')][_0xab7c('0x45')]);_0x3a0c4a[_0xab7c('0x33')]=_[_0xab7c('0x34')](_0x1f5acf['query']);_0x3a0c4a[_0xab7c('0x35')]=_[_0xab7c('0x36')](_0x3a0c4a[_0xab7c('0x32')],_0x3a0c4a['query']);_0x150565[_0xab7c('0x37')]=_[_0xab7c('0x36')](_0x3a0c4a[_0xab7c('0x32')],qs['fields'](_0x1f5acf[_0xab7c('0x33')][_0xab7c('0x38')]));_0x150565[_0xab7c('0x37')]=_0x150565[_0xab7c('0x37')][_0xab7c('0x46')]?_0x150565[_0xab7c('0x37')]:_0x3a0c4a[_0xab7c('0x32')];_0x150565[_0xab7c('0x79')]=qs[_0xab7c('0x3a')](_0x1f5acf[_0xab7c('0x33')][_0xab7c('0x3a')]);_0x150565[_0xab7c('0x3d')]=qs[_0xab7c('0x35')](_[_0xab7c('0x3b')](_0x1f5acf['query'],_0x3a0c4a[_0xab7c('0x35')]));if(_0x1f5acf['query']['filter']){_0x150565['where']=_[_0xab7c('0x48')](_0x150565['where'],{'$or':_[_0xab7c('0x2e')](_0x150565[_0xab7c('0x37')],function(_0x268c61){var _0x297ebe={};_0x297ebe[_0x268c61]={'$like':'%'+_0x1f5acf[_0xab7c('0x33')]['filter']+'%'};return _0x297ebe;})});}_0x150565=_[_0xab7c('0x48')]({},_0x150565,_0x1f5acf[_0xab7c('0x49')]);return _0x42382c[_0xab7c('0x9a')](_0x150565);}})['then'](function(_0x582b66){if(_0x582b66){_0x1843ea=_0x582b66['length'];if(!_0x1f5acf[_0xab7c('0x33')][_0xab7c('0x9b')](_0xab7c('0x39'))){_0x150565['limit']=qs[_0xab7c('0x1f')](_0x1f5acf['query'][_0xab7c('0x1f')]);_0x150565['offset']=qs['offset'](_0x1f5acf[_0xab7c('0x33')][_0xab7c('0x1e')]);}return _0x42382c[_0xab7c('0x9a')](_0x150565);}})[_0xab7c('0x27')](function(_0x11ecf6){if(_0x11ecf6){return _0x11ecf6?{'count':_0x1843ea,'rows':_0x11ecf6}:null;}})[_0xab7c('0x27')](respondWithResult(_0x40c745,null))[_0xab7c('0x42')](handleError(_0x40c745,null));};
\ No newline at end of file
index db9bb1d..61dd20b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f61=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','Team'];(function(_0x50d290,_0x5862c2){var _0x5093f3=function(_0xef653){while(--_0xef653){_0x50d290['push'](_0x50d290['shift']());}};_0x5093f3(++_0x5862c2);}(_0x4f61,0x1a5));var _0x14f6=function(_0x538547,_0x2fe78d){_0x538547=_0x538547-0x0;var _0x4d23d9=_0x4f61[_0x538547];return _0x4d23d9;};'use strict';var EventEmitter=require(_0x14f6('0x0'));var Team=require('../../mysqldb')['db'][_0x14f6('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x14f6('0x2')](0x0);var events={'afterCreate':_0x14f6('0x3'),'afterUpdate':_0x14f6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x190f11){return function(_0x5ef40c,_0x30dcea,_0x2bd37f){TeamEvents[_0x14f6('0x5')](_0x190f11+':'+_0x5ef40c['id'],_0x5ef40c);TeamEvents[_0x14f6('0x5')](_0x190f11,_0x5ef40c);_0x2bd37f(null);};}for(var e in events){if(events[_0x14f6('0x6')](e)){var event=events[e];Team[_0x14f6('0x7')](e,emitEvent(event));}}module[_0x14f6('0x8')]=TeamEvents;
\ No newline at end of file
+var _0x638d=['emit','hook','events','../../mysqldb','Team','setMaxListeners','save','remove'];(function(_0x371ce1,_0xca105a){var _0x8cedbc=function(_0x383edf){while(--_0x383edf){_0x371ce1['push'](_0x371ce1['shift']());}};_0x8cedbc(++_0xca105a);}(_0x638d,0x1e2));var _0xd638=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x638d[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xd638('0x0'));var Team=require(_0xd638('0x1'))['db'][_0xd638('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xd638('0x3')](0x0);var events={'afterCreate':_0xd638('0x4'),'afterUpdate':'update','afterDestroy':_0xd638('0x5')};function emitEvent(_0x3f966d){return function(_0x120d12,_0x3e718e,_0x2957d7){TeamEvents[_0xd638('0x6')](_0x3f966d+':'+_0x120d12['id'],_0x120d12);TeamEvents[_0xd638('0x6')](_0x3f966d,_0x120d12);_0x2957d7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xd638('0x7')](e,emitEvent(event));}}module['exports']=TeamEvents;
\ No newline at end of file
index 13d69f6..e5dc6b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7ce=['../../config/environment','exports','define','Team','teams','util','moment','bluebird','path','rimraf'];(function(_0x17fd57,_0x2fce34){var _0x561372=function(_0x3acdb7){while(--_0x3acdb7){_0x17fd57['push'](_0x17fd57['shift']());}};_0x561372(++_0x2fce34);}(_0xe7ce,0x1a9));var _0xee7c=function(_0x1f77ac,_0x3bf5aa){_0x1f77ac=_0x1f77ac-0x0;var _0x355c1b=_0xe7ce[_0x1f77ac];return _0x355c1b;};'use strict';var _=require('lodash');var util=require(_0xee7c('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xee7c('0x1'));var BPromise=require(_0xee7c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xee7c('0x3'));var rimraf=require(_0xee7c('0x4'));var config=require(_0xee7c('0x5'));var attributes=require('./team.attributes');module[_0xee7c('0x6')]=function(_0x4bdf01,_0x41f3a4){return _0x4bdf01[_0xee7c('0x7')](_0xee7c('0x8'),attributes,{'tableName':_0xee7c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x04bd=['api','moment','path','rimraf','../../config/environment','./team.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x3e18c3,_0x2212de){var _0x39f28f=function(_0x4832df){while(--_0x4832df){_0x3e18c3['push'](_0x3e18c3['shift']());}};_0x39f28f(++_0x2212de);}(_0x04bd,0x19f));var _0xd04b=function(_0x277e5b,_0xbc5c4a){_0x277e5b=_0x277e5b-0x0;var _0x2d8d8e=_0x04bd[_0x277e5b];return _0x2d8d8e;};'use strict';var _=require(_0xd04b('0x0'));var util=require(_0xd04b('0x1'));var logger=require(_0xd04b('0x2'))(_0xd04b('0x3'));var moment=require(_0xd04b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd04b('0x5'));var rimraf=require(_0xd04b('0x6'));var config=require(_0xd04b('0x7'));var attributes=require(_0xd04b('0x8'));module[_0xd04b('0x9')]=function(_0x2c41f7,_0x3bb6e5){return _0x2c41f7[_0xd04b('0xa')]('Team',attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6ba04e2..1a01e36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fdd=['then','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request'];(function(_0x187394,_0x4c1132){var _0x724fe5=function(_0x2d9df5){while(--_0x2d9df5){_0x187394['push'](_0x187394['shift']());}};_0x724fe5(++_0x4c1132);}(_0x0fdd,0x9f));var _0xd0fd=function(_0x18f3d6,_0x2ac92e){_0x18f3d6=_0x18f3d6-0x0;var _0x3c8a51=_0x0fdd[_0x18f3d6];return _0x3c8a51;};'use strict';var _=require(_0xd0fd('0x0'));var util=require(_0xd0fd('0x1'));var moment=require(_0xd0fd('0x2'));var BPromise=require('bluebird');var rs=require(_0xd0fd('0x3'));var fs=require('fs');var Redis=require(_0xd0fd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd0fd('0x5'));var logger=require(_0xd0fd('0x6'))('rpc');var config=require(_0xd0fd('0x7'));var jayson=require(_0xd0fd('0x8'));var client=jayson[_0xd0fd('0x9')]['http']({'port':0x232a});config[_0xd0fd('0xa')]=_[_0xd0fd('0xb')](config['redis'],{'host':_0xd0fd('0xc'),'port':0x18eb});var socket=require(_0xd0fd('0xd'))(new Redis(config[_0xd0fd('0xa')]));require('./team.socket')[_0xd0fd('0xe')](socket);function respondWithRpcPromise(_0x3158bd,_0x36b98c,_0x1d4308){return new BPromise(function(_0x36d1f1,_0x2127de){return client[_0xd0fd('0xf')](_0x3158bd,_0x1d4308)[_0xd0fd('0x10')](function(_0xbe4b49){logger['info'](_0xd0fd('0x11'),_0x36b98c,_0xd0fd('0x12'));logger['debug'](_0xd0fd('0x13'),_0x36b98c,_0xd0fd('0x12'),JSON[_0xd0fd('0x14')](_0xbe4b49));if(_0xbe4b49[_0xd0fd('0x15')]){if(_0xbe4b49[_0xd0fd('0x15')]['code']===0x1f4){logger[_0xd0fd('0x15')]('Team,\x20%s,\x20%s',_0x36b98c,_0xbe4b49['error'][_0xd0fd('0x16')]);return _0x2127de(_0xbe4b49[_0xd0fd('0x15')][_0xd0fd('0x16')]);}logger['error'](_0xd0fd('0x11'),_0x36b98c,_0xbe4b49['error']['message']);return _0x36d1f1(_0xbe4b49[_0xd0fd('0x15')][_0xd0fd('0x16')]);}else{logger[_0xd0fd('0x17')](_0xd0fd('0x11'),_0x36b98c,'request\x20sent');_0x36d1f1(_0xbe4b49['result']['message']);}})[_0xd0fd('0x18')](function(_0x4310f3){logger[_0xd0fd('0x15')](_0xd0fd('0x11'),_0x36b98c,_0x4310f3);_0x2127de(_0x4310f3);});});}
\ No newline at end of file
+var _0x445a=['Team,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','redis','socket.io-emitter','./team.socket','register','request','then','info','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x215754,_0x1eb2c9){var _0x385dad=function(_0x179d07){while(--_0x179d07){_0x215754['push'](_0x215754['shift']());}};_0x385dad(++_0x1eb2c9);}(_0x445a,0x1e4));var _0xa445=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x445a[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xa445('0x0'));var util=require(_0xa445('0x1'));var moment=require(_0xa445('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa445('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa445('0x4'))(_0xa445('0x5'));var config=require(_0xa445('0x6'));var jayson=require(_0xa445('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xa445('0x8')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa445('0x9'))(new Redis(config[_0xa445('0x8')]));require(_0xa445('0xa'))[_0xa445('0xb')](socket);function respondWithRpcPromise(_0x737589,_0xd405f,_0x472f9d){return new BPromise(function(_0x286bc9,_0x263faa){return client[_0xa445('0xc')](_0x737589,_0x472f9d)[_0xa445('0xd')](function(_0x42be8a){logger[_0xa445('0xe')]('Team,\x20%s,\x20%s',_0xd405f,_0xa445('0xf'));logger['debug'](_0xa445('0x10'),_0xd405f,_0xa445('0xf'),JSON[_0xa445('0x11')](_0x42be8a));if(_0x42be8a[_0xa445('0x12')]){if(_0x42be8a[_0xa445('0x12')][_0xa445('0x13')]===0x1f4){logger[_0xa445('0x12')](_0xa445('0x14'),_0xd405f,_0x42be8a[_0xa445('0x12')][_0xa445('0x15')]);return _0x263faa(_0x42be8a[_0xa445('0x12')][_0xa445('0x15')]);}logger[_0xa445('0x12')](_0xa445('0x14'),_0xd405f,_0x42be8a[_0xa445('0x12')][_0xa445('0x15')]);return _0x286bc9(_0x42be8a['error'][_0xa445('0x15')]);}else{logger['info'](_0xa445('0x14'),_0xd405f,_0xa445('0xf'));_0x286bc9(_0x42be8a[_0xa445('0x16')]['message']);}})[_0xa445('0x17')](function(_0x1a6509){logger[_0xa445('0x12')](_0xa445('0x14'),_0xd405f,_0x1a6509);_0x263faa(_0x1a6509);});});}
\ No newline at end of file
index 0bb9755..4771dd5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x268c=['removeListener','register','length','team:','./team.events','remove','emit'];(function(_0x54f989,_0x593097){var _0x295079=function(_0x186080){while(--_0x186080){_0x54f989['push'](_0x54f989['shift']());}};_0x295079(++_0x593097);}(_0x268c,0xb3));var _0xc268=function(_0x4c80d7,_0x2bef29){_0x4c80d7=_0x4c80d7-0x0;var _0x3c5095=_0x268c[_0x4c80d7];return _0x3c5095;};'use strict';var TeamEvents=require(_0xc268('0x0'));var events=['save',_0xc268('0x1'),'update'];function createListener(_0x12d634,_0x498234){return function(_0x4f78a7){_0x498234[_0xc268('0x2')](_0x12d634,_0x4f78a7);};}function removeListener(_0x55edc9,_0x19f84f){return function(){TeamEvents[_0xc268('0x3')](_0x55edc9,_0x19f84f);};}exports[_0xc268('0x4')]=function(_0x3d0ecf){for(var _0x4e2a03=0x0,_0x4b843c=events[_0xc268('0x5')];_0x4e2a03<_0x4b843c;_0x4e2a03++){var _0x2f7f1b=events[_0x4e2a03];var _0x596f88=createListener(_0xc268('0x6')+_0x2f7f1b,_0x3d0ecf);TeamEvents['on'](_0x2f7f1b,_0x596f88);}};
\ No newline at end of file
+var _0x4760=['removeListener','register','length','team:','./team.events','remove','update','emit'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0x4760,0x1b4));var _0x0476=function(_0x1af354,_0x16b63d){_0x1af354=_0x1af354-0x0;var _0x6e9b04=_0x4760[_0x1af354];return _0x6e9b04;};'use strict';var TeamEvents=require(_0x0476('0x0'));var events=['save',_0x0476('0x1'),_0x0476('0x2')];function createListener(_0x34020c,_0x43de94){return function(_0x211149){_0x43de94[_0x0476('0x3')](_0x34020c,_0x211149);};}function removeListener(_0x4b6894,_0x2b50c8){return function(){TeamEvents[_0x0476('0x4')](_0x4b6894,_0x2b50c8);};}exports[_0x0476('0x5')]=function(_0x4ac5bb){for(var _0x188140=0x0,_0x30a8bf=events[_0x0476('0x6')];_0x188140<_0x30a8bf;_0x188140++){var _0x231929=events[_0x188140];var _0x367230=createListener(_0x0476('0x7')+_0x231929,_0x4ac5bb);TeamEvents['on'](_0x231929,_0x367230);}};
\ No newline at end of file
index e7d16f5..dd69381 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bdb=['INTEGER','sequelize'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x2bdb,0x105));var _0xb2bd=function(_0x5062aa,_0x306f56){_0x5062aa=_0x5062aa-0x0;var _0x14b88f=_0x2bdb[_0x5062aa];return _0x14b88f;};'use strict';var Sequelize=require(_0xb2bd('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0xb2bd('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x4fdc=['exports','INTEGER'];(function(_0x4b6f5c,_0x56f7ce){var _0x55548b=function(_0x125619){while(--_0x125619){_0x4b6f5c['push'](_0x4b6f5c['shift']());}};_0x55548b(++_0x56f7ce);}(_0x4fdc,0x84));var _0xc4fd=function(_0x32fdb4,_0xcbb10e){_0x32fdb4=_0x32fdb4-0x0;var _0x4a9f8d=_0x4fdc[_0x32fdb4];return _0x4a9f8d;};'use strict';var Sequelize=require('sequelize');module[_0xc4fd('0x0')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xc4fd('0x1')]}};
\ No newline at end of file
index c66eb13..f4f90af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4f4=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','define','TeamVoicePrefix','team_has_voice_prefixes','lodash'];(function(_0x258919,_0x1754e6){var _0xfbd68b=function(_0x3bc3e9){while(--_0x3bc3e9){_0x258919['push'](_0x258919['shift']());}};_0xfbd68b(++_0x1754e6);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x3102b8,_0x2ea126){_0x3102b8=_0x3102b8-0x0;var _0x1896b6=_0xd4f4[_0x3102b8];return _0x1896b6;};'use strict';var _=require(_0x4d4f('0x0'));var util=require(_0x4d4f('0x1'));var logger=require(_0x4d4f('0x2'))(_0x4d4f('0x3'));var moment=require(_0x4d4f('0x4'));var BPromise=require(_0x4d4f('0x5'));var rp=require(_0x4d4f('0x6'));var fs=require('fs');var path=require(_0x4d4f('0x7'));var rimraf=require(_0x4d4f('0x8'));var config=require(_0x4d4f('0x9'));var attributes=require(_0x4d4f('0xa'));module['exports']=function(_0x5f451b,_0x5e38d2){return _0x5f451b[_0x4d4f('0xb')](_0x4d4f('0xc'),attributes,{'tableName':_0x4d4f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x263f=['TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x263f,0x182));var _0xf263=function(_0x27b0da,_0x8ffb2b){_0x27b0da=_0x27b0da-0x0;var _0x8eb88e=_0x263f[_0x27b0da];return _0x8eb88e;};'use strict';var _=require(_0xf263('0x0'));var util=require(_0xf263('0x1'));var logger=require(_0xf263('0x2'))(_0xf263('0x3'));var moment=require(_0xf263('0x4'));var BPromise=require(_0xf263('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf263('0x6'));var rimraf=require(_0xf263('0x7'));var config=require(_0xf263('0x8'));var attributes=require('./teamVoicePrefix.attributes');module[_0xf263('0x9')]=function(_0xdb2fc1,_0x4c7ab2){return _0xdb2fc1['define'](_0xf263('0xa'),attributes,{'tableName':_0xf263('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6a4fde4..2f7f682 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(_0x5f4a99,_0xf04496){var _0x1d018d=function(_0x82c1e8){while(--_0x82c1e8){_0x5f4a99['push'](_0x5f4a99['shift']());}};_0x1d018d(++_0xf04496);}(_0x70e0,0x17b));var _0x070e=function(_0xe33a61,_0x32b5ac){_0xe33a61=_0xe33a61-0x0;var _0x144e50=_0x70e0[_0xe33a61];return _0x144e50;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x32aa22,_0x107371){var _0x2ecaae=function(_0x3d6a66){while(--_0x3d6a66){_0x32aa22['push'](_0x32aa22['shift']());}};_0x2ecaae(++_0x107371);}(_0xe706,0xa3));var _0x6e70=function(_0x16d2c7,_0x5bf3c0){_0x16d2c7=_0x16d2c7-0x0;var _0x1c9a0a=_0xe706[_0x16d2c7];return _0x1c9a0a;};'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 eed6837..d108379 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bce=['sequelize','exports'];(function(_0x4806f6,_0x4dfd93){var _0x578b9f=function(_0x14f84c){while(--_0x14f84c){_0x4806f6['push'](_0x4806f6['shift']());}};_0x578b9f(++_0x4dfd93);}(_0x2bce,0xd6));var _0xe2bc=function(_0xf8f6ca,_0x1a4675){_0xf8f6ca=_0xf8f6ca-0x0;var _0xe63532=_0x2bce[_0xf8f6ca];return _0xe63532;};'use strict';var Sequelize=require(_0xe2bc('0x0'));module[_0xe2bc('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x799b=['exports','INTEGER','sequelize'];(function(_0x45911a,_0x10f08a){var _0x23b7d7=function(_0x35a62){while(--_0x35a62){_0x45911a['push'](_0x45911a['shift']());}};_0x23b7d7(++_0x10f08a);}(_0x799b,0xcb));var _0xb799=function(_0x4b7c13,_0x2c5239){_0x4b7c13=_0x4b7c13-0x0;var _0x37e4ec=_0x799b[_0x4b7c13];return _0x37e4ec;};'use strict';var Sequelize=require(_0xb799('0x0'));module[_0xb799('0x1')]={'penalty':{'type':Sequelize[_0xb799('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 6e46a93..8a7537a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96a2=['bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','../../config/logger','api','moment'];(function(_0x68f7c1,_0x5415cf){var _0x55b284=function(_0x35d425){while(--_0x35d425){_0x68f7c1['push'](_0x68f7c1['shift']());}};_0x55b284(++_0x5415cf);}(_0x96a2,0x96));var _0x296a=function(_0x30046c,_0x391ab5){_0x30046c=_0x30046c-0x0;var _0x4de114=_0x96a2[_0x30046c];return _0x4de114;};'use strict';var _=require(_0x296a('0x0'));var util=require('util');var logger=require(_0x296a('0x1'))(_0x296a('0x2'));var moment=require(_0x296a('0x3'));var BPromise=require(_0x296a('0x4'));var rp=require(_0x296a('0x5'));var fs=require('fs');var path=require(_0x296a('0x6'));var rimraf=require(_0x296a('0x7'));var config=require(_0x296a('0x8'));var attributes=require(_0x296a('0x9'));module[_0x296a('0xa')]=function(_0x285be8,_0x31bb42){return _0x285be8[_0x296a('0xb')](_0x296a('0xc'),attributes,{'tableName':_0x296a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf041=['path','../../config/environment','define','TeamVoiceQueue','team_has_voice_queues','../../config/logger','api','moment','bluebird'];(function(_0x179c7b,_0x4b61bc){var _0xaf10cb=function(_0x1df885){while(--_0x1df885){_0x179c7b['push'](_0x179c7b['shift']());}};_0xaf10cb(++_0x4b61bc);}(_0xf041,0x15b));var _0x1f04=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf041[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1f04('0x0'))(_0x1f04('0x1'));var moment=require(_0x1f04('0x2'));var BPromise=require(_0x1f04('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1f04('0x4'));var rimraf=require('rimraf');var config=require(_0x1f04('0x5'));var attributes=require('./teamVoiceQueue.attributes');module['exports']=function(_0x25d578,_0x504d71){return _0x25d578[_0x1f04('0x6')](_0x1f04('0x7'),attributes,{'tableName':_0x1f04('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6618508..0e1b586 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xada2=['../../config/environment','jayson/promise','client','http','request','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x5c54c0,_0x3e3d6d){var _0x5a633b=function(_0x8413c5){while(--_0x8413c5){_0x5c54c0['push'](_0x5c54c0['shift']());}};_0x5a633b(++_0x3e3d6d);}(_0xada2,0xfd));var _0x2ada=function(_0x20d9a2,_0x5bb34d){_0x20d9a2=_0x20d9a2-0x0;var _0x5dad59=_0xada2[_0x20d9a2];return _0x5dad59;};'use strict';var _=require(_0x2ada('0x0'));var util=require(_0x2ada('0x1'));var moment=require(_0x2ada('0x2'));var BPromise=require(_0x2ada('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ada('0x4'));var db=require(_0x2ada('0x5'))['db'];var utils=require(_0x2ada('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x2ada('0x7'));var jayson=require(_0x2ada('0x8'));var client=jayson[_0x2ada('0x9')][_0x2ada('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa4b8b1,_0x3f3726,_0x4166d8){return new BPromise(function(_0x1deb4a,_0x1d204f){return client[_0x2ada('0xb')](_0xa4b8b1,_0x4166d8)['then'](function(_0x508398){logger[_0x2ada('0xc')](_0x2ada('0xd'),_0x3f3726,_0x2ada('0xe'));logger[_0x2ada('0xf')](_0x2ada('0x10'),_0x3f3726,_0x2ada('0xe'),JSON['stringify'](_0x508398));if(_0x508398[_0x2ada('0x11')]){if(_0x508398[_0x2ada('0x11')][_0x2ada('0x12')]===0x1f4){logger[_0x2ada('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x3f3726,_0x508398[_0x2ada('0x11')]['message']);return _0x1d204f(_0x508398[_0x2ada('0x11')][_0x2ada('0x13')]);}logger[_0x2ada('0x11')](_0x2ada('0xd'),_0x3f3726,_0x508398[_0x2ada('0x11')][_0x2ada('0x13')]);return _0x1deb4a(_0x508398[_0x2ada('0x11')][_0x2ada('0x13')]);}else{logger[_0x2ada('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x3f3726,_0x2ada('0xe'));_0x1deb4a(_0x508398['result'][_0x2ada('0x13')]);}})['catch'](function(_0x1f6622){logger[_0x2ada('0x11')](_0x2ada('0xd'),_0x3f3726,_0x1f6622);_0x1d204f(_0x1f6622);});});}
\ No newline at end of file
+var _0x0eaa=['http','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xea32f,_0x1ca14d){var _0x4618a2=function(_0x158d7e){while(--_0x158d7e){_0xea32f['push'](_0xea32f['shift']());}};_0x4618a2(++_0x1ca14d);}(_0x0eaa,0x1c5));var _0xa0ea=function(_0x204668,_0x46227d){_0x204668=_0x204668-0x0;var _0x59fc6f=_0x0eaa[_0x204668];return _0x59fc6f;};'use strict';var _=require(_0xa0ea('0x0'));var util=require(_0xa0ea('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa0ea('0x2'));var fs=require('fs');var Redis=require(_0xa0ea('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa0ea('0x4'));var logger=require(_0xa0ea('0x5'))(_0xa0ea('0x6'));var config=require(_0xa0ea('0x7'));var jayson=require(_0xa0ea('0x8'));var client=jayson['client'][_0xa0ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x521881,_0x4b8856,_0x361178){return new BPromise(function(_0x8632a1,_0x5b2adc){return client['request'](_0x521881,_0x361178)[_0xa0ea('0xa')](function(_0x2746f2){logger[_0xa0ea('0xb')](_0xa0ea('0xc'),_0x4b8856,_0xa0ea('0xd'));logger['debug'](_0xa0ea('0xe'),_0x4b8856,_0xa0ea('0xd'),JSON[_0xa0ea('0xf')](_0x2746f2));if(_0x2746f2[_0xa0ea('0x10')]){if(_0x2746f2['error'][_0xa0ea('0x11')]===0x1f4){logger[_0xa0ea('0x10')](_0xa0ea('0xc'),_0x4b8856,_0x2746f2[_0xa0ea('0x10')][_0xa0ea('0x12')]);return _0x5b2adc(_0x2746f2['error'][_0xa0ea('0x12')]);}logger[_0xa0ea('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x4b8856,_0x2746f2[_0xa0ea('0x10')][_0xa0ea('0x12')]);return _0x8632a1(_0x2746f2[_0xa0ea('0x10')][_0xa0ea('0x12')]);}else{logger['info'](_0xa0ea('0xc'),_0x4b8856,_0xa0ea('0xd'));_0x8632a1(_0x2746f2[_0xa0ea('0x13')][_0xa0ea('0x12')]);}})[_0xa0ea('0x14')](function(_0x34b94c){logger[_0xa0ea('0x10')](_0xa0ea('0xc'),_0x4b8856,_0x34b94c);_0x5b2adc(_0x34b94c);});});}
\ No newline at end of file
index 0f24d35..2c7b8b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d04=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./template.controller','get','isAuthenticated','show','post','create','put','update','destroy','exports'];(function(_0x4a39f2,_0x4ef331){var _0x1d8bc9=function(_0x44aa39){while(--_0x44aa39){_0x4a39f2['push'](_0x4a39f2['shift']());}};_0x1d8bc9(++_0x4ef331);}(_0x3d04,0xbe));var _0x43d0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3d04[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x43d0('0x0'));var util=require(_0x43d0('0x1'));var path=require(_0x43d0('0x2'));var timeout=require(_0x43d0('0x3'));var express=require(_0x43d0('0x4'));var router=express[_0x43d0('0x5')]();var fs_extra=require(_0x43d0('0x6'));var auth=require(_0x43d0('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x43d0('0x8'));var controller=require(_0x43d0('0x9'));router[_0x43d0('0xa')]('/',auth[_0x43d0('0xb')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x43d0('0xc')]);router[_0x43d0('0xd')]('/',auth[_0x43d0('0xb')](),controller[_0x43d0('0xe')]);router[_0x43d0('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x43d0('0x10')]);router['delete']('/:id',auth[_0x43d0('0xb')](),controller[_0x43d0('0x11')]);module[_0x43d0('0x12')]=router;
\ No newline at end of file
+var _0xa413=['isAuthenticated','index','/:id','show','post','create','update','destroy','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','./template.controller','get'];(function(_0x5b55a7,_0x36a996){var _0x3ce6ba=function(_0x523421){while(--_0x523421){_0x5b55a7['push'](_0x5b55a7['shift']());}};_0x3ce6ba(++_0x36a996);}(_0xa413,0x1e5));var _0x3a41=function(_0x365e7f,_0x3f33cc){_0x365e7f=_0x365e7f-0x0;var _0x54a681=_0xa413[_0x365e7f];return _0x54a681;};'use strict';var multer=require(_0x3a41('0x0'));var util=require('util');var path=require(_0x3a41('0x1'));var timeout=require('connect-timeout');var express=require(_0x3a41('0x2'));var router=express[_0x3a41('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3a41('0x4'));var config=require(_0x3a41('0x5'));var controller=require(_0x3a41('0x6'));router[_0x3a41('0x7')]('/',auth[_0x3a41('0x8')](),controller[_0x3a41('0x9')]);router[_0x3a41('0x7')](_0x3a41('0xa'),auth[_0x3a41('0x8')](),controller[_0x3a41('0xb')]);router[_0x3a41('0xc')]('/',auth['isAuthenticated'](),controller[_0x3a41('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3a41('0xe')]);router['delete'](_0x3a41('0xa'),auth['isAuthenticated'](),controller[_0x3a41('0xf')]);module[_0x3a41('0x10')]=router;
\ No newline at end of file
index a5f7931..b009914 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0236=['exports','STRING','TEXT','sequelize'];(function(_0x39cfa6,_0x17dec0){var _0x4c8e4d=function(_0x5327ef){while(--_0x5327ef){_0x39cfa6['push'](_0x39cfa6['shift']());}};_0x4c8e4d(++_0x17dec0);}(_0x0236,0x93));var _0x6023=function(_0x3ed2ef,_0x296c36){_0x3ed2ef=_0x3ed2ef-0x0;var _0x3f231f=_0x0236[_0x3ed2ef];return _0x3f231f;};'use strict';var Sequelize=require(_0x6023('0x0'));module[_0x6023('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6023('0x2')]},'html':{'type':Sequelize[_0x6023('0x3')]}};
\ No newline at end of file
+var _0xcc63=['sequelize','exports','STRING'];(function(_0x21bf0d,_0x91bf98){var _0x561491=function(_0x2e6102){while(--_0x2e6102){_0x21bf0d['push'](_0x21bf0d['shift']());}};_0x561491(++_0x91bf98);}(_0xcc63,0xc6));var _0x3cc6=function(_0x2a059a,_0xfa0685){_0x2a059a=_0x2a059a-0x0;var _0x181ef9=_0xcc63[_0x2a059a];return _0x181ef9;};'use strict';var Sequelize=require(_0x3cc6('0x0'));module[_0x3cc6('0x1')]={'name':{'type':Sequelize[_0x3cc6('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index ef4d51a..3edfa86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x679c=['includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','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','limit','count','set','apply','update','then','destroy','get','Templates','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','Template'];(function(_0x3ad9b3,_0x5c76e9){var _0x4ef8d1=function(_0x239036){while(--_0x239036){_0x3ad9b3['push'](_0x3ad9b3['shift']());}};_0x4ef8d1(++_0x5c76e9);}(_0x679c,0x106));var _0xc679=function(_0x255442,_0x4bba27){_0x255442=_0x255442-0x0;var _0x3089a6=_0x679c[_0x255442];return _0x3089a6;};'use strict';var emlformat=require(_0xc679('0x0'));var rimraf=require(_0xc679('0x1'));var zipdir=require(_0xc679('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc679('0x3'));var moment=require('moment');var BPromise=require(_0xc679('0x4'));var Mustache=require(_0xc679('0x5'));var util=require(_0xc679('0x6'));var path=require(_0xc679('0x7'));var sox=require(_0xc679('0x8'));var csv=require(_0xc679('0x9'));var ejs=require(_0xc679('0xa'));var fs=require('fs');var fs_extra=require(_0xc679('0xb'));var _=require('lodash');var squel=require(_0xc679('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc679('0xd'));var Papa=require(_0xc679('0xe'));var Redis=require('ioredis');var authService=require(_0xc679('0xf'));var qs=require(_0xc679('0x10'));var as=require(_0xc679('0x11'));var hardwareService=require(_0xc679('0x12'));var logger=require('../../config/logger')(_0xc679('0x13'));var utils=require(_0xc679('0x14'));var config=require(_0xc679('0x15'));var licenseUtil=require(_0xc679('0x16'));var db=require(_0xc679('0x17'))['db'];function respondWithStatusCode(_0x314da0,_0x213834){_0x213834=_0x213834||0xcc;return function(_0x18b234){if(_0x18b234){return _0x314da0[_0xc679('0x18')](_0x213834);}return _0x314da0[_0xc679('0x19')](_0x213834)[_0xc679('0x1a')]();};}function respondWithResult(_0x507849,_0x2a4d84){_0x2a4d84=_0x2a4d84||0xc8;return function(_0x59549c){if(_0x59549c){return _0x507849[_0xc679('0x19')](_0x2a4d84)[_0xc679('0x1b')](_0x59549c);}};}function respondWithFilteredResult(_0x122a00,_0x517388){return function(_0x588467){if(_0x588467){var _0x925ed5=typeof _0x517388[_0xc679('0x1c')]===_0xc679('0x1d')&&typeof _0x517388[_0xc679('0x1e')]===_0xc679('0x1d');var _0x2103ce=_0x588467[_0xc679('0x1f')];var _0x13f9e0=_0x925ed5?0x0:_0x517388[_0xc679('0x1c')];var _0x294c66=_0x925ed5?_0x588467[_0xc679('0x1f')]:_0x517388['offset']+_0x517388[_0xc679('0x1e')];var _0x51d914;if(_0x294c66>=_0x2103ce){_0x294c66=_0x2103ce;_0x51d914=0xc8;}else{_0x51d914=0xce;}_0x122a00['status'](_0x51d914);return _0x122a00[_0xc679('0x20')]('Content-Range',_0x13f9e0+'-'+_0x294c66+'/'+_0x2103ce)[_0xc679('0x1b')](_0x588467);}return null;};}function patchUpdates(_0x1ff2ec){return function(_0x41eef6){try{jsonpatch[_0xc679('0x21')](_0x41eef6,_0x1ff2ec,!![]);}catch(_0x51951f){return BPromise['reject'](_0x51951f);}return _0x41eef6['save']();};}function saveUpdates(_0x36403b,_0x3536ee){return function(_0x55bb35){if(_0x55bb35){return _0x55bb35[_0xc679('0x22')](_0x36403b)[_0xc679('0x23')](function(_0x38bcc2){return _0x38bcc2;});}return null;};}function removeEntity(_0x4e32bd,_0x10f551){return function(_0x506378){if(_0x506378){return _0x506378[_0xc679('0x24')]()['then'](function(){var _0x4a546d=_0x506378[_0xc679('0x25')]({'plain':!![]});var _0x20204b=_0xc679('0x26');return db['UserProfileResource'][_0xc679('0x24')]({'where':{'type':_0x20204b,'resourceId':_0x4a546d['id']}})[_0xc679('0x23')](function(){return _0x506378;});})[_0xc679('0x23')](function(){_0x4e32bd[_0xc679('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fee5c,_0x1f5466){return function(_0x3e703a){if(!_0x3e703a){_0x3fee5c[_0xc679('0x18')](0x194);}return _0x3e703a;};}function handleError(_0x4d34bf,_0x2d4b71){_0x2d4b71=_0x2d4b71||0x1f4;return function(_0x37818f){logger[_0xc679('0x27')](_0x37818f[_0xc679('0x28')]);if(_0x37818f['name']){delete _0x37818f[_0xc679('0x29')];}_0x4d34bf[_0xc679('0x19')](_0x2d4b71)[_0xc679('0x2a')](_0x37818f);};}exports[_0xc679('0x2b')]=function(_0x38a337,_0x1d5aba){var _0x30c647={},_0x1d89fa={},_0x2ee92d={'count':0x0,'rows':[]};var _0x3c1a53=_[_0xc679('0x2c')](db['Template'][_0xc679('0x2d')],function(_0x27fb9e){return{'name':_0x27fb9e[_0xc679('0x2e')],'type':_0x27fb9e['type'][_0xc679('0x2f')]};});_0x1d89fa['model']=_[_0xc679('0x2c')](_0x3c1a53,_0xc679('0x29'));_0x1d89fa[_0xc679('0x30')]=_[_0xc679('0x31')](_0x38a337[_0xc679('0x30')]);_0x1d89fa['filters']=_[_0xc679('0x32')](_0x1d89fa[_0xc679('0x33')],_0x1d89fa[_0xc679('0x30')]);_0x30c647['attributes']=_[_0xc679('0x32')](_0x1d89fa[_0xc679('0x33')],qs[_0xc679('0x34')](_0x38a337[_0xc679('0x30')][_0xc679('0x34')]));_0x30c647[_0xc679('0x35')]=_0x30c647[_0xc679('0x35')][_0xc679('0x36')]?_0x30c647[_0xc679('0x35')]:_0x1d89fa['model'];if(!_0x38a337['query'][_0xc679('0x37')](_0xc679('0x38'))){_0x30c647[_0xc679('0x1e')]=qs[_0xc679('0x1e')](_0x38a337['query'][_0xc679('0x1e')]);_0x30c647['offset']=qs['offset'](_0x38a337[_0xc679('0x30')][_0xc679('0x1c')]);}_0x30c647[_0xc679('0x39')]=qs[_0xc679('0x3a')](_0x38a337[_0xc679('0x30')]['sort']);_0x30c647[_0xc679('0x3b')]=qs[_0xc679('0x3c')](_['pick'](_0x38a337[_0xc679('0x30')],_0x1d89fa[_0xc679('0x3c')]),_0x3c1a53);if(_0x38a337['query'][_0xc679('0x3d')]){_0x30c647['where']=_[_0xc679('0x3e')](_0x30c647[_0xc679('0x3b')],{'$or':_[_0xc679('0x2c')](_0x3c1a53,function(_0x16964b){if(_0x16964b['type']!==_0xc679('0x3f')){var _0x46669c={};_0x46669c[_0x16964b[_0xc679('0x29')]]={'$like':'%'+_0x38a337[_0xc679('0x30')][_0xc679('0x3d')]+'%'};return _0x46669c;}})});}_0x30c647=_['merge']({},_0x30c647,_0x38a337[_0xc679('0x40')]);var _0xad2828={'where':_0x30c647['where']};return db[_0xc679('0x41')][_0xc679('0x1f')](_0xad2828)[_0xc679('0x23')](function(_0x167ddb){_0x2ee92d[_0xc679('0x1f')]=_0x167ddb;if(_0x38a337[_0xc679('0x30')][_0xc679('0x42')]){_0x30c647[_0xc679('0x43')]=[{'all':!![]}];}return db['Template'][_0xc679('0x44')](_0x30c647);})[_0xc679('0x23')](function(_0x3910c3){_0x2ee92d[_0xc679('0x45')]=_0x3910c3;return _0x2ee92d;})[_0xc679('0x23')](respondWithFilteredResult(_0x1d5aba,_0x30c647))[_0xc679('0x46')](handleError(_0x1d5aba,null));};exports[_0xc679('0x47')]=function(_0x3dddc6,_0x1153cf){var _0x522a9d={'raw':!![],'where':{'id':_0x3dddc6[_0xc679('0x48')]['id']}},_0xa613d6={};_0xa613d6[_0xc679('0x33')]=_[_0xc679('0x31')](db[_0xc679('0x41')][_0xc679('0x2d')]);_0xa613d6[_0xc679('0x30')]=_[_0xc679('0x31')](_0x3dddc6['query']);_0xa613d6[_0xc679('0x3c')]=_[_0xc679('0x32')](_0xa613d6[_0xc679('0x33')],_0xa613d6[_0xc679('0x30')]);_0x522a9d[_0xc679('0x35')]=_[_0xc679('0x32')](_0xa613d6[_0xc679('0x33')],qs[_0xc679('0x34')](_0x3dddc6[_0xc679('0x30')][_0xc679('0x34')]));_0x522a9d[_0xc679('0x35')]=_0x522a9d[_0xc679('0x35')][_0xc679('0x36')]?_0x522a9d['attributes']:_0xa613d6[_0xc679('0x33')];if(_0x3dddc6[_0xc679('0x30')][_0xc679('0x42')]){_0x522a9d[_0xc679('0x43')]=[{'all':!![]}];}_0x522a9d=_[_0xc679('0x3e')]({},_0x522a9d,_0x3dddc6[_0xc679('0x40')]);return db[_0xc679('0x41')]['find'](_0x522a9d)[_0xc679('0x23')](handleEntityNotFound(_0x1153cf,null))[_0xc679('0x23')](respondWithResult(_0x1153cf,null))['catch'](handleError(_0x1153cf,null));};exports[_0xc679('0x49')]=function(_0x16ad56,_0x2478f6){return db[_0xc679('0x41')]['create'](_0x16ad56[_0xc679('0x4a')],{})[_0xc679('0x23')](function(_0x3c2201){var _0x2f4f72=_0x16ad56[_0xc679('0x4b')]['get']({'plain':!![]});if(!_0x2f4f72)throw new Error(_0xc679('0x4c'));if(_0x2f4f72[_0xc679('0x4d')]==='user'){var _0x222287=_0x3c2201['get']({'plain':!![]});var _0x4d98f9=_0xc679('0x26');return db['UserProfileSection'][_0xc679('0x4e')]({'where':{'name':_0x4d98f9,'userProfileId':_0x2f4f72[_0xc679('0x4f')]},'raw':!![]})[_0xc679('0x23')](function(_0x4bc7af){if(_0x4bc7af&&_0x4bc7af[_0xc679('0x50')]===0x0){return db['UserProfileResource'][_0xc679('0x49')]({'name':_0x222287['name'],'resourceId':_0x222287['id'],'type':_0x4bc7af[_0xc679('0x29')],'sectionId':_0x4bc7af['id']},{})['then'](function(){return _0x3c2201;});}else{return _0x3c2201;}})[_0xc679('0x46')](function(_0x424dff){logger[_0xc679('0x27')](_0xc679('0x51'),_0x424dff);throw _0x424dff;});}return _0x3c2201;})[_0xc679('0x23')](respondWithResult(_0x2478f6,0xc9))[_0xc679('0x46')](handleError(_0x2478f6,null));};exports[_0xc679('0x22')]=function(_0x668cd7,_0x315645){if(_0x668cd7['body']['id']){delete _0x668cd7[_0xc679('0x4a')]['id'];}return db['Template'][_0xc679('0x4e')]({'where':{'id':_0x668cd7[_0xc679('0x48')]['id']}})[_0xc679('0x23')](handleEntityNotFound(_0x315645,null))[_0xc679('0x23')](saveUpdates(_0x668cd7['body'],null))[_0xc679('0x23')](respondWithResult(_0x315645,null))[_0xc679('0x46')](handleError(_0x315645,null));};exports[_0xc679('0x24')]=function(_0x5121cc,_0x30e68c){return db[_0xc679('0x41')][_0xc679('0x4e')]({'where':{'id':_0x5121cc[_0xc679('0x48')]['id']}})['then'](handleEntityNotFound(_0x30e68c,null))[_0xc679('0x23')](removeEntity(_0x30e68c,null))[_0xc679('0x46')](handleError(_0x30e68c,null));};
\ No newline at end of file
+var _0x9cbd=['update','Templates','destroy','then','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','Template','includeAll','findAll','catch','show','params','intersection','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','UserProfileResource','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x271987,_0x535d49){var _0x1123a9=function(_0xb5d351){while(--_0xb5d351){_0x271987['push'](_0x271987['shift']());}};_0x1123a9(++_0x535d49);}(_0x9cbd,0x181));var _0xd9cb=function(_0x1052a7,_0x248022){_0x1052a7=_0x1052a7-0x0;var _0x32141d=_0x9cbd[_0x1052a7];return _0x32141d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd9cb('0x0'));var zipdir=require(_0xd9cb('0x1'));var jsonpatch=require(_0xd9cb('0x2'));var rp=require(_0xd9cb('0x3'));var moment=require(_0xd9cb('0x4'));var BPromise=require(_0xd9cb('0x5'));var Mustache=require(_0xd9cb('0x6'));var util=require(_0xd9cb('0x7'));var path=require(_0xd9cb('0x8'));var sox=require(_0xd9cb('0x9'));var csv=require(_0xd9cb('0xa'));var ejs=require(_0xd9cb('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd9cb('0xc'));var crypto=require(_0xd9cb('0xd'));var jsforce=require(_0xd9cb('0xe'));var deskjs=require(_0xd9cb('0xf'));var toCsv=require(_0xd9cb('0xa'));var querystring=require('querystring');var Papa=require(_0xd9cb('0x10'));var Redis=require(_0xd9cb('0x11'));var authService=require(_0xd9cb('0x12'));var qs=require(_0xd9cb('0x13'));var as=require(_0xd9cb('0x14'));var hardwareService=require(_0xd9cb('0x15'));var logger=require(_0xd9cb('0x16'))(_0xd9cb('0x17'));var utils=require(_0xd9cb('0x18'));var config=require(_0xd9cb('0x19'));var licenseUtil=require(_0xd9cb('0x1a'));var db=require(_0xd9cb('0x1b'))['db'];function respondWithStatusCode(_0x48fa4b,_0x3d8d19){_0x3d8d19=_0x3d8d19||0xcc;return function(_0x2be1ea){if(_0x2be1ea){return _0x48fa4b[_0xd9cb('0x1c')](_0x3d8d19);}return _0x48fa4b['status'](_0x3d8d19)['end']();};}function respondWithResult(_0x327683,_0x17af4b){_0x17af4b=_0x17af4b||0xc8;return function(_0x4b7706){if(_0x4b7706){return _0x327683[_0xd9cb('0x1d')](_0x17af4b)[_0xd9cb('0x1e')](_0x4b7706);}};}function respondWithFilteredResult(_0x4bffbc,_0x424d6e){return function(_0x441e99){if(_0x441e99){var _0x53aa90=typeof _0x424d6e[_0xd9cb('0x1f')]===_0xd9cb('0x20')&&typeof _0x424d6e[_0xd9cb('0x21')]===_0xd9cb('0x20');var _0x29c286=_0x441e99[_0xd9cb('0x22')];var _0x4ee063=_0x53aa90?0x0:_0x424d6e['offset'];var _0x54773c=_0x53aa90?_0x441e99[_0xd9cb('0x22')]:_0x424d6e['offset']+_0x424d6e[_0xd9cb('0x21')];var _0x29591a;if(_0x54773c>=_0x29c286){_0x54773c=_0x29c286;_0x29591a=0xc8;}else{_0x29591a=0xce;}_0x4bffbc[_0xd9cb('0x1d')](_0x29591a);return _0x4bffbc[_0xd9cb('0x23')](_0xd9cb('0x24'),_0x4ee063+'-'+_0x54773c+'/'+_0x29c286)[_0xd9cb('0x1e')](_0x441e99);}return null;};}function patchUpdates(_0x229a87){return function(_0x11a2af){try{jsonpatch[_0xd9cb('0x25')](_0x11a2af,_0x229a87,!![]);}catch(_0xb6dabb){return BPromise[_0xd9cb('0x26')](_0xb6dabb);}return _0x11a2af[_0xd9cb('0x27')]();};}function saveUpdates(_0x5abaee,_0x2bd809){return function(_0x5376dc){if(_0x5376dc){return _0x5376dc[_0xd9cb('0x28')](_0x5abaee)['then'](function(_0x9e9f78){return _0x9e9f78;});}return null;};}function removeEntity(_0x4d6142,_0x2b0bd6){return function(_0x329918){if(_0x329918){return _0x329918['destroy']()['then'](function(){var _0xbae49e=_0x329918['get']({'plain':!![]});var _0x19dfd3=_0xd9cb('0x29');return db['UserProfileResource'][_0xd9cb('0x2a')]({'where':{'type':_0x19dfd3,'resourceId':_0xbae49e['id']}})[_0xd9cb('0x2b')](function(){return _0x329918;});})[_0xd9cb('0x2b')](function(){_0x4d6142[_0xd9cb('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4146e,_0x5b65ab){return function(_0x4c1cc5){if(!_0x4c1cc5){_0x4146e[_0xd9cb('0x1c')](0x194);}return _0x4c1cc5;};}function handleError(_0x4fc12e,_0x1076ab){_0x1076ab=_0x1076ab||0x1f4;return function(_0x54ac2b){logger['error'](_0x54ac2b[_0xd9cb('0x2c')]);if(_0x54ac2b['name']){delete _0x54ac2b[_0xd9cb('0x2d')];}_0x4fc12e['status'](_0x1076ab)['send'](_0x54ac2b);};}exports[_0xd9cb('0x2e')]=function(_0x19dacd,_0x2bf000){var _0x3db84a={},_0x5eb4e2={},_0x5b478c={'count':0x0,'rows':[]};var _0x2c4296=_[_0xd9cb('0x2f')](db['Template'][_0xd9cb('0x30')],function(_0x325a43){return{'name':_0x325a43[_0xd9cb('0x31')],'type':_0x325a43[_0xd9cb('0x32')][_0xd9cb('0x33')]};});_0x5eb4e2['model']=_[_0xd9cb('0x2f')](_0x2c4296,_0xd9cb('0x2d'));_0x5eb4e2[_0xd9cb('0x34')]=_[_0xd9cb('0x35')](_0x19dacd[_0xd9cb('0x34')]);_0x5eb4e2[_0xd9cb('0x36')]=_['intersection'](_0x5eb4e2[_0xd9cb('0x37')],_0x5eb4e2[_0xd9cb('0x34')]);_0x3db84a[_0xd9cb('0x38')]=_['intersection'](_0x5eb4e2['model'],qs[_0xd9cb('0x39')](_0x19dacd[_0xd9cb('0x34')]['fields']));_0x3db84a[_0xd9cb('0x38')]=_0x3db84a[_0xd9cb('0x38')][_0xd9cb('0x3a')]?_0x3db84a[_0xd9cb('0x38')]:_0x5eb4e2[_0xd9cb('0x37')];if(!_0x19dacd[_0xd9cb('0x34')][_0xd9cb('0x3b')](_0xd9cb('0x3c'))){_0x3db84a[_0xd9cb('0x21')]=qs['limit'](_0x19dacd[_0xd9cb('0x34')][_0xd9cb('0x21')]);_0x3db84a[_0xd9cb('0x1f')]=qs[_0xd9cb('0x1f')](_0x19dacd[_0xd9cb('0x34')][_0xd9cb('0x1f')]);}_0x3db84a[_0xd9cb('0x3d')]=qs[_0xd9cb('0x3e')](_0x19dacd['query'][_0xd9cb('0x3e')]);_0x3db84a[_0xd9cb('0x3f')]=qs['filters'](_['pick'](_0x19dacd[_0xd9cb('0x34')],_0x5eb4e2['filters']),_0x2c4296);if(_0x19dacd[_0xd9cb('0x34')]['filter']){_0x3db84a[_0xd9cb('0x3f')]=_[_0xd9cb('0x40')](_0x3db84a[_0xd9cb('0x3f')],{'$or':_['map'](_0x2c4296,function(_0x43ee30){if(_0x43ee30[_0xd9cb('0x32')]!==_0xd9cb('0x41')){var _0x4a815f={};_0x4a815f[_0x43ee30[_0xd9cb('0x2d')]]={'$like':'%'+_0x19dacd[_0xd9cb('0x34')]['filter']+'%'};return _0x4a815f;}})});}_0x3db84a=_[_0xd9cb('0x40')]({},_0x3db84a,_0x19dacd['options']);var _0x356c2f={'where':_0x3db84a[_0xd9cb('0x3f')]};return db[_0xd9cb('0x42')]['count'](_0x356c2f)['then'](function(_0x371b15){_0x5b478c['count']=_0x371b15;if(_0x19dacd[_0xd9cb('0x34')][_0xd9cb('0x43')]){_0x3db84a['include']=[{'all':!![]}];}return db[_0xd9cb('0x42')][_0xd9cb('0x44')](_0x3db84a);})['then'](function(_0x5757ad){_0x5b478c['rows']=_0x5757ad;return _0x5b478c;})['then'](respondWithFilteredResult(_0x2bf000,_0x3db84a))[_0xd9cb('0x45')](handleError(_0x2bf000,null));};exports[_0xd9cb('0x46')]=function(_0xe0ffda,_0xd94340){var _0x2ba650={'raw':!![],'where':{'id':_0xe0ffda[_0xd9cb('0x47')]['id']}},_0x38937d={};_0x38937d[_0xd9cb('0x37')]=_[_0xd9cb('0x35')](db[_0xd9cb('0x42')][_0xd9cb('0x30')]);_0x38937d[_0xd9cb('0x34')]=_[_0xd9cb('0x35')](_0xe0ffda[_0xd9cb('0x34')]);_0x38937d[_0xd9cb('0x36')]=_[_0xd9cb('0x48')](_0x38937d['model'],_0x38937d['query']);_0x2ba650[_0xd9cb('0x38')]=_[_0xd9cb('0x48')](_0x38937d[_0xd9cb('0x37')],qs[_0xd9cb('0x39')](_0xe0ffda[_0xd9cb('0x34')][_0xd9cb('0x39')]));_0x2ba650[_0xd9cb('0x38')]=_0x2ba650['attributes']['length']?_0x2ba650[_0xd9cb('0x38')]:_0x38937d[_0xd9cb('0x37')];if(_0xe0ffda[_0xd9cb('0x34')][_0xd9cb('0x43')]){_0x2ba650[_0xd9cb('0x49')]=[{'all':!![]}];}_0x2ba650=_[_0xd9cb('0x40')]({},_0x2ba650,_0xe0ffda[_0xd9cb('0x4a')]);return db[_0xd9cb('0x42')][_0xd9cb('0x4b')](_0x2ba650)[_0xd9cb('0x2b')](handleEntityNotFound(_0xd94340,null))[_0xd9cb('0x2b')](respondWithResult(_0xd94340,null))[_0xd9cb('0x45')](handleError(_0xd94340,null));};exports[_0xd9cb('0x4c')]=function(_0x4e7e42,_0x130d65){return db[_0xd9cb('0x42')]['create'](_0x4e7e42[_0xd9cb('0x4d')],{})['then'](function(_0x513302){var _0x1ed6d7=_0x4e7e42[_0xd9cb('0x4e')]['get']({'plain':!![]});if(!_0x1ed6d7)throw new Error(_0xd9cb('0x4f'));if(_0x1ed6d7[_0xd9cb('0x50')]===_0xd9cb('0x4e')){var _0x105f00=_0x513302[_0xd9cb('0x51')]({'plain':!![]});var _0x6ce5bb=_0xd9cb('0x29');return db[_0xd9cb('0x52')][_0xd9cb('0x4b')]({'where':{'name':_0x6ce5bb,'userProfileId':_0x1ed6d7[_0xd9cb('0x53')]},'raw':!![]})['then'](function(_0x4aade7){if(_0x4aade7&&_0x4aade7['autoAssociation']===0x0){return db[_0xd9cb('0x54')]['create']({'name':_0x105f00[_0xd9cb('0x2d')],'resourceId':_0x105f00['id'],'type':_0x4aade7['name'],'sectionId':_0x4aade7['id']},{})[_0xd9cb('0x2b')](function(){return _0x513302;});}else{return _0x513302;}})[_0xd9cb('0x45')](function(_0x2bdbf7){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2bdbf7);throw _0x2bdbf7;});}return _0x513302;})['then'](respondWithResult(_0x130d65,0xc9))['catch'](handleError(_0x130d65,null));};exports[_0xd9cb('0x28')]=function(_0xd7852d,_0x33e83d){if(_0xd7852d['body']['id']){delete _0xd7852d[_0xd9cb('0x4d')]['id'];}return db[_0xd9cb('0x42')][_0xd9cb('0x4b')]({'where':{'id':_0xd7852d[_0xd9cb('0x47')]['id']}})[_0xd9cb('0x2b')](handleEntityNotFound(_0x33e83d,null))[_0xd9cb('0x2b')](saveUpdates(_0xd7852d[_0xd9cb('0x4d')],null))[_0xd9cb('0x2b')](respondWithResult(_0x33e83d,null))[_0xd9cb('0x45')](handleError(_0x33e83d,null));};exports[_0xd9cb('0x2a')]=function(_0xa2b88,_0x4b8fd8){return db[_0xd9cb('0x42')][_0xd9cb('0x4b')]({'where':{'id':_0xa2b88[_0xd9cb('0x47')]['id']}})[_0xd9cb('0x2b')](handleEntityNotFound(_0x4b8fd8,null))[_0xd9cb('0x2b')](removeEntity(_0x4b8fd8,null))[_0xd9cb('0x45')](handleError(_0x4b8fd8,null));};
\ No newline at end of file
index 147809d..b0ea65a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x658e=['request-promise','path','rimraf','./template.attributes','define','Template','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3c0444,_0x5dad2d){var _0x456e6f=function(_0x496b30){while(--_0x496b30){_0x3c0444['push'](_0x3c0444['shift']());}};_0x456e6f(++_0x5dad2d);}(_0x658e,0xae));var _0xe658=function(_0x33d9a2,_0x5bf33c){_0x33d9a2=_0x33d9a2-0x0;var _0x4ac4ea=_0x658e[_0x33d9a2];return _0x4ac4ea;};'use strict';var _=require(_0xe658('0x0'));var util=require(_0xe658('0x1'));var logger=require(_0xe658('0x2'))(_0xe658('0x3'));var moment=require(_0xe658('0x4'));var BPromise=require(_0xe658('0x5'));var rp=require(_0xe658('0x6'));var fs=require('fs');var path=require(_0xe658('0x7'));var rimraf=require(_0xe658('0x8'));var config=require('../../config/environment');var attributes=require(_0xe658('0x9'));module['exports']=function(_0x369646,_0x29bab7){return _0x369646[_0xe658('0xa')](_0xe658('0xb'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6f87=['rimraf','../../config/environment','./template.attributes','define','Template','tools_templates','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0xd485f,_0x1379a6){var _0x5aaf2d=function(_0x5a1ee5){while(--_0x5a1ee5){_0xd485f['push'](_0xd485f['shift']());}};_0x5aaf2d(++_0x1379a6);}(_0x6f87,0x131));var _0x76f8=function(_0x293e2a,_0x2ecf0a){_0x293e2a=_0x293e2a-0x0;var _0xbfaf5a=_0x6f87[_0x293e2a];return _0xbfaf5a;};'use strict';var _=require(_0x76f8('0x0'));var util=require(_0x76f8('0x1'));var logger=require(_0x76f8('0x2'))(_0x76f8('0x3'));var moment=require(_0x76f8('0x4'));var BPromise=require('bluebird');var rp=require(_0x76f8('0x5'));var fs=require('fs');var path=require(_0x76f8('0x6'));var rimraf=require(_0x76f8('0x7'));var config=require(_0x76f8('0x8'));var attributes=require(_0x76f8('0x9'));module['exports']=function(_0x564d79,_0x54fbc5){return _0x564d79[_0x76f8('0xa')](_0x76f8('0xb'),attributes,{'tableName':_0x76f8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 002ce5f..e97426a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb870=['options','raw','where','limit','include','map','model','attributes','debug','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Template,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','Template,\x20%s,\x20%s','catch','GetTemplate','Template'];(function(_0x4dde61,_0x20e46b){var _0x23bf85=function(_0x227a2c){while(--_0x227a2c){_0x4dde61['push'](_0x4dde61['shift']());}};_0x23bf85(++_0x20e46b);}(_0xb870,0x13c));var _0x0b87=function(_0x29db36,_0x410ae9){_0x29db36=_0x29db36-0x0;var _0x234e87=_0xb870[_0x29db36];return _0x234e87;};'use strict';var _=require(_0x0b87('0x0'));var util=require('util');var moment=require(_0x0b87('0x1'));var BPromise=require(_0x0b87('0x2'));var rs=require(_0x0b87('0x3'));var fs=require('fs');var Redis=require(_0x0b87('0x4'));var db=require(_0x0b87('0x5'))['db'];var utils=require(_0x0b87('0x6'));var logger=require(_0x0b87('0x7'))(_0x0b87('0x8'));var config=require(_0x0b87('0x9'));var jayson=require(_0x0b87('0xa'));var client=jayson[_0x0b87('0xb')][_0x0b87('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3cbe7b,_0xabe5ba,_0x12482f){return new BPromise(function(_0x4caf43,_0x3790f2){return client['request'](_0x3cbe7b,_0x12482f)[_0x0b87('0xd')](function(_0x5e42b2){logger[_0x0b87('0xe')]('Template,\x20%s,\x20%s',_0xabe5ba,'request\x20sent');logger['debug'](_0x0b87('0xf'),_0xabe5ba,_0x0b87('0x10'),JSON['stringify'](_0x5e42b2));if(_0x5e42b2[_0x0b87('0x11')]){if(_0x5e42b2[_0x0b87('0x11')][_0x0b87('0x12')]===0x1f4){logger[_0x0b87('0x11')]('Template,\x20%s,\x20%s',_0xabe5ba,_0x5e42b2['error'][_0x0b87('0x13')]);return _0x3790f2(_0x5e42b2[_0x0b87('0x11')][_0x0b87('0x13')]);}logger[_0x0b87('0x11')]('Template,\x20%s,\x20%s',_0xabe5ba,_0x5e42b2[_0x0b87('0x11')][_0x0b87('0x13')]);return _0x4caf43(_0x5e42b2[_0x0b87('0x11')][_0x0b87('0x13')]);}else{logger[_0x0b87('0xe')](_0x0b87('0x14'),_0xabe5ba,'request\x20sent');_0x4caf43(_0x5e42b2['result']['message']);}})[_0x0b87('0x15')](function(_0x4abf21){logger[_0x0b87('0x11')](_0x0b87('0x14'),_0xabe5ba,_0x4abf21);_0x3790f2(_0x4abf21);});});}exports[_0x0b87('0x16')]=function(_0x4542f4){var _0x32d27a=this;return new Promise(function(_0x2e602,_0x771911){return db[_0x0b87('0x17')]['findAll']({'raw':_0x4542f4[_0x0b87('0x18')]?_0x4542f4['options'][_0x0b87('0x19')]===undefined?!![]:![]:!![],'where':_0x4542f4[_0x0b87('0x18')]?_0x4542f4[_0x0b87('0x18')][_0x0b87('0x1a')]||null:null,'attributes':_0x4542f4[_0x0b87('0x18')]?_0x4542f4['options']['attributes']||null:null,'limit':_0x4542f4[_0x0b87('0x18')]?_0x4542f4['options'][_0x0b87('0x1b')]||null:null,'include':_0x4542f4[_0x0b87('0x18')]?_0x4542f4[_0x0b87('0x18')][_0x0b87('0x1c')]?_[_0x0b87('0x1d')](_0x4542f4[_0x0b87('0x18')]['include'],function(_0x218a2d){return{'model':db[_0x218a2d[_0x0b87('0x1e')]],'as':_0x218a2d['as'],'attributes':_0x218a2d[_0x0b87('0x1f')],'include':_0x218a2d[_0x0b87('0x1c')]?_[_0x0b87('0x1d')](_0x218a2d[_0x0b87('0x1c')],function(_0x28f1e3){return{'model':db[_0x28f1e3[_0x0b87('0x1e')]],'as':_0x28f1e3['as'],'attributes':_0x28f1e3[_0x0b87('0x1f')],'include':_0x28f1e3['include']?_[_0x0b87('0x1d')](_0x28f1e3[_0x0b87('0x1c')],function(_0x13c26e){return{'model':db[_0x13c26e[_0x0b87('0x1e')]],'as':_0x13c26e['as'],'attributes':_0x13c26e[_0x0b87('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x853a01){logger[_0x0b87('0xe')](_0x0b87('0x16'),_0x4542f4);logger[_0x0b87('0x20')](_0x0b87('0x16'),_0x4542f4,JSON[_0x0b87('0x21')](_0x853a01));_0x2e602(_0x853a01);})[_0x0b87('0x15')](function(_0x55477a){logger['error'](_0x0b87('0x16'),_0x55477a[_0x0b87('0x13')],_0x4542f4);_0x771911(_0x32d27a[_0x0b87('0x11')](0x1f4,_0x55477a[_0x0b87('0x13')]));});});};
\ No newline at end of file
+var _0x1d28=['rpc','../../config/environment','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','Template','findAll','options','where','attributes','limit','include','map','model','GetTemplate','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5dbfaa,_0x4b9ca3){var _0x20449e=function(_0x45b18a){while(--_0x45b18a){_0x5dbfaa['push'](_0x5dbfaa['shift']());}};_0x20449e(++_0x4b9ca3);}(_0x1d28,0x164));var _0x81d2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d28[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x81d2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x81d2('0x1'));var rs=require(_0x81d2('0x2'));var fs=require('fs');var Redis=require(_0x81d2('0x3'));var db=require(_0x81d2('0x4'))['db'];var utils=require(_0x81d2('0x5'));var logger=require(_0x81d2('0x6'))(_0x81d2('0x7'));var config=require(_0x81d2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x81d2('0x9')][_0x81d2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cce9e,_0x30162b,_0xf1aa3){return new BPromise(function(_0x3add66,_0x5cdcd8){return client[_0x81d2('0xb')](_0x3cce9e,_0xf1aa3)[_0x81d2('0xc')](function(_0x2914e2){logger[_0x81d2('0xd')](_0x81d2('0xe'),_0x30162b,_0x81d2('0xf'));logger[_0x81d2('0x10')](_0x81d2('0x11'),_0x30162b,_0x81d2('0xf'),JSON[_0x81d2('0x12')](_0x2914e2));if(_0x2914e2[_0x81d2('0x13')]){if(_0x2914e2[_0x81d2('0x13')][_0x81d2('0x14')]===0x1f4){logger['error']('Template,\x20%s,\x20%s',_0x30162b,_0x2914e2[_0x81d2('0x13')][_0x81d2('0x15')]);return _0x5cdcd8(_0x2914e2['error'][_0x81d2('0x15')]);}logger[_0x81d2('0x13')](_0x81d2('0xe'),_0x30162b,_0x2914e2['error'][_0x81d2('0x15')]);return _0x3add66(_0x2914e2[_0x81d2('0x13')][_0x81d2('0x15')]);}else{logger[_0x81d2('0xd')](_0x81d2('0xe'),_0x30162b,_0x81d2('0xf'));_0x3add66(_0x2914e2['result'][_0x81d2('0x15')]);}})[_0x81d2('0x16')](function(_0x1ba358){logger['error']('Template,\x20%s,\x20%s',_0x30162b,_0x1ba358);_0x5cdcd8(_0x1ba358);});});}exports['GetTemplate']=function(_0x40b23f){var _0x4263c7=this;return new Promise(function(_0x376ae2,_0x4ed502){return db[_0x81d2('0x17')][_0x81d2('0x18')]({'raw':_0x40b23f[_0x81d2('0x19')]?_0x40b23f['options']['raw']===undefined?!![]:![]:!![],'where':_0x40b23f[_0x81d2('0x19')]?_0x40b23f[_0x81d2('0x19')][_0x81d2('0x1a')]||null:null,'attributes':_0x40b23f['options']?_0x40b23f[_0x81d2('0x19')][_0x81d2('0x1b')]||null:null,'limit':_0x40b23f[_0x81d2('0x19')]?_0x40b23f['options'][_0x81d2('0x1c')]||null:null,'include':_0x40b23f[_0x81d2('0x19')]?_0x40b23f[_0x81d2('0x19')][_0x81d2('0x1d')]?_[_0x81d2('0x1e')](_0x40b23f['options'][_0x81d2('0x1d')],function(_0x18cf0c){return{'model':db[_0x18cf0c['model']],'as':_0x18cf0c['as'],'attributes':_0x18cf0c[_0x81d2('0x1b')],'include':_0x18cf0c[_0x81d2('0x1d')]?_[_0x81d2('0x1e')](_0x18cf0c[_0x81d2('0x1d')],function(_0x110d24){return{'model':db[_0x110d24[_0x81d2('0x1f')]],'as':_0x110d24['as'],'attributes':_0x110d24[_0x81d2('0x1b')],'include':_0x110d24[_0x81d2('0x1d')]?_[_0x81d2('0x1e')](_0x110d24[_0x81d2('0x1d')],function(_0x2e4928){return{'model':db[_0x2e4928[_0x81d2('0x1f')]],'as':_0x2e4928['as'],'attributes':_0x2e4928[_0x81d2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x81d2('0xc')](function(_0x45a614){logger[_0x81d2('0xd')](_0x81d2('0x20'),_0x40b23f);logger[_0x81d2('0x10')](_0x81d2('0x20'),_0x40b23f,JSON[_0x81d2('0x12')](_0x45a614));_0x376ae2(_0x45a614);})[_0x81d2('0x16')](function(_0x391865){logger['error'](_0x81d2('0x20'),_0x391865[_0x81d2('0x15')],_0x40b23f);_0x4ed502(_0x4263c7[_0x81d2('0x13')](0x1f4,_0x391865[_0x81d2('0x15')]));});});};
\ No newline at end of file
index 0934da1..8f2ca25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x011a=['addAction','put','update','delete','exports','multer','util','express','fs-extra','../../components/interaction/service','./trigger.controller','get','isAuthenticated','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAnyCondition'];(function(_0x2e6ab8,_0x4ea85c){var _0x16cba0=function(_0x4b3776){while(--_0x4b3776){_0x2e6ab8['push'](_0x2e6ab8['shift']());}};_0x16cba0(++_0x4ea85c);}(_0x011a,0x16d));var _0xa011=function(_0xa76664,_0x5e32db){_0xa76664=_0xa76664-0x0;var _0x3f7743=_0x011a[_0xa76664];return _0x3f7743;};'use strict';var multer=require(_0xa011('0x0'));var util=require(_0xa011('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa011('0x2'));var router=express['Router']();var fs_extra=require(_0xa011('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa011('0x4'));var config=require('../../config/environment');var controller=require(_0xa011('0x5'));router[_0xa011('0x6')]('/',auth[_0xa011('0x7')](),controller['index']);router['get'](_0xa011('0x8'),auth[_0xa011('0x7')](),controller[_0xa011('0x9')]);router[_0xa011('0x6')](_0xa011('0xa'),auth[_0xa011('0x7')](),controller[_0xa011('0xb')]);router[_0xa011('0x6')](_0xa011('0xc'),auth['isAuthenticated'](),controller[_0xa011('0xd')]);router['get'](_0xa011('0xe'),auth[_0xa011('0x7')](),controller[_0xa011('0xf')]);router[_0xa011('0x10')]('/',auth['isAuthenticated'](),controller[_0xa011('0x11')]);router[_0xa011('0x10')]('/:id/all_conditions',auth[_0xa011('0x7')](),controller['addAllCondition']);router[_0xa011('0x10')](_0xa011('0xc'),auth[_0xa011('0x7')](),controller[_0xa011('0x12')]);router[_0xa011('0x10')]('/:id/actions',auth[_0xa011('0x7')](),controller[_0xa011('0x13')]);router[_0xa011('0x14')]('/:id',auth[_0xa011('0x7')](),controller[_0xa011('0x15')]);router[_0xa011('0x16')](_0xa011('0x8'),auth[_0xa011('0x7')](),controller['destroy']);module[_0xa011('0x17')]=router;
\ No newline at end of file
+var _0x5d20=['getAllConditions','getAnyConditions','/:id/actions','post','create','addAllCondition','/:id/any_conditions','addAction','update','delete','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','/:id/all_conditions'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x5d20,0xcb));var _0x05d2=function(_0x42c58f,_0x5cfb7e){_0x42c58f=_0x42c58f-0x0;var _0x296295=_0x5d20[_0x42c58f];return _0x296295;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x05d2('0x0'));var express=require('express');var router=express[_0x05d2('0x1')]();var fs_extra=require(_0x05d2('0x2'));var auth=require(_0x05d2('0x3'));var interaction=require(_0x05d2('0x4'));var config=require(_0x05d2('0x5'));var controller=require(_0x05d2('0x6'));router[_0x05d2('0x7')]('/',auth[_0x05d2('0x8')](),controller[_0x05d2('0x9')]);router['get'](_0x05d2('0xa'),auth[_0x05d2('0x8')](),controller[_0x05d2('0xb')]);router['get'](_0x05d2('0xc'),auth[_0x05d2('0x8')](),controller[_0x05d2('0xd')]);router[_0x05d2('0x7')]('/:id/any_conditions',auth['isAuthenticated'](),controller[_0x05d2('0xe')]);router['get'](_0x05d2('0xf'),auth[_0x05d2('0x8')](),controller['getActions']);router[_0x05d2('0x10')]('/',auth['isAuthenticated'](),controller[_0x05d2('0x11')]);router[_0x05d2('0x10')](_0x05d2('0xc'),auth[_0x05d2('0x8')](),controller[_0x05d2('0x12')]);router['post'](_0x05d2('0x13'),auth[_0x05d2('0x8')](),controller['addAnyCondition']);router[_0x05d2('0x10')]('/:id/actions',auth[_0x05d2('0x8')](),controller[_0x05d2('0x14')]);router['put'](_0x05d2('0xa'),auth[_0x05d2('0x8')](),controller[_0x05d2('0x15')]);router[_0x05d2('0x16')]('/:id',auth[_0x05d2('0x8')](),controller['destroy']);module[_0x05d2('0x17')]=router;
\ No newline at end of file
index 081c603..42fc918 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9005=['BOOLEAN','sequelize','STRING'];(function(_0xda6ad1,_0x5f09e3){var _0xedc3a5=function(_0x5459d7){while(--_0x5459d7){_0xda6ad1['push'](_0xda6ad1['shift']());}};_0xedc3a5(++_0x5f09e3);}(_0x9005,0x1c9));var _0x5900=function(_0x4ea597,_0x2eee6c){_0x4ea597=_0x4ea597-0x0;var _0x96df74=_0x9005[_0x4ea597];return _0x96df74;};'use strict';var Sequelize=require(_0x5900('0x0'));module['exports']={'name':{'type':Sequelize[_0x5900('0x1')]},'channel':{'type':Sequelize[_0x5900('0x1')]},'description':{'type':Sequelize[_0x5900('0x1')]},'status':{'type':Sequelize[_0x5900('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x6576=['sequelize','exports','STRING','BOOLEAN'];(function(_0x9b08a4,_0x5f58b7){var _0x54b037=function(_0x117855){while(--_0x117855){_0x9b08a4['push'](_0x9b08a4['shift']());}};_0x54b037(++_0x5f58b7);}(_0x6576,0xb8));var _0x6657=function(_0x2d8d69,_0x8e47ff){_0x2d8d69=_0x2d8d69-0x0;var _0x39ae22=_0x6576[_0x2d8d69];return _0x39ae22;};'use strict';var Sequelize=require(_0x6657('0x0'));module[_0x6657('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x6657('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x6657('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 845312e..796ed95 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3e5=['intersection','fields','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','keys','length','find','create','body','user','UserProfileSection','userProfileId','params','Condition','addAnyCondition','getAllConditions','findOne','getAnyConditions','hasOwnProperty','Action','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','get','Triggers','UserProfileResource','error','name','send','map','Trigger','fieldName','type','key','model','query','filters','attributes'];(function(_0x18e52b,_0x1fae35){var _0x3d3062=function(_0x133b14){while(--_0x133b14){_0x18e52b['push'](_0x18e52b['shift']());}};_0x3d3062(++_0x1fae35);}(_0xc3e5,0x125));var _0x5c3e=function(_0x1da723,_0x1ca46a){_0x1da723=_0x1da723-0x0;var _0x550358=_0xc3e5[_0x1da723];return _0x550358;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5c3e('0x0'));var jsonpatch=require(_0x5c3e('0x1'));var rp=require(_0x5c3e('0x2'));var moment=require(_0x5c3e('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5c3e('0x4'));var path=require(_0x5c3e('0x5'));var sox=require(_0x5c3e('0x6'));var csv=require(_0x5c3e('0x7'));var ejs=require(_0x5c3e('0x8'));var fs=require('fs');var fs_extra=require(_0x5c3e('0x9'));var _=require(_0x5c3e('0xa'));var squel=require(_0x5c3e('0xb'));var crypto=require(_0x5c3e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5c3e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5c3e('0xe'));var Papa=require(_0x5c3e('0xf'));var Redis=require(_0x5c3e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5c3e('0x11'));var as=require(_0x5c3e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5c3e('0x13'))(_0x5c3e('0x14'));var utils=require('../../config/utils');var config=require(_0x5c3e('0x15'));var licenseUtil=require(_0x5c3e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a6dec,_0x44a366){_0x44a366=_0x44a366||0xcc;return function(_0x4c3901){if(_0x4c3901){return _0x5a6dec['sendStatus'](_0x44a366);}return _0x5a6dec[_0x5c3e('0x17')](_0x44a366)[_0x5c3e('0x18')]();};}function respondWithResult(_0x52532d,_0x13d4f8){_0x13d4f8=_0x13d4f8||0xc8;return function(_0x33e026){if(_0x33e026){return _0x52532d[_0x5c3e('0x17')](_0x13d4f8)[_0x5c3e('0x19')](_0x33e026);}};}function respondWithFilteredResult(_0x225bcf,_0xc018bf){return function(_0x34e377){if(_0x34e377){var _0x5eb7ee=typeof _0xc018bf['offset']===_0x5c3e('0x1a')&&typeof _0xc018bf['limit']==='undefined';var _0x65cc99=_0x34e377[_0x5c3e('0x1b')];var _0x5d6d7e=_0x5eb7ee?0x0:_0xc018bf[_0x5c3e('0x1c')];var _0xc3f357=_0x5eb7ee?_0x34e377[_0x5c3e('0x1b')]:_0xc018bf[_0x5c3e('0x1c')]+_0xc018bf['limit'];var _0x54014a;if(_0xc3f357>=_0x65cc99){_0xc3f357=_0x65cc99;_0x54014a=0xc8;}else{_0x54014a=0xce;}_0x225bcf[_0x5c3e('0x17')](_0x54014a);return _0x225bcf[_0x5c3e('0x1d')](_0x5c3e('0x1e'),_0x5d6d7e+'-'+_0xc3f357+'/'+_0x65cc99)[_0x5c3e('0x19')](_0x34e377);}return null;};}function patchUpdates(_0x55b1d8){return function(_0x436f0f){try{jsonpatch[_0x5c3e('0x1f')](_0x436f0f,_0x55b1d8,!![]);}catch(_0x37d5b1){return BPromise['reject'](_0x37d5b1);}return _0x436f0f[_0x5c3e('0x20')]();};}function saveUpdates(_0x6e54d2,_0x45e615){return function(_0x124d8a){if(_0x124d8a){return _0x124d8a[_0x5c3e('0x21')](_0x6e54d2)[_0x5c3e('0x22')](function(_0x29a529){return _0x29a529;});}return null;};}function removeEntity(_0x3581d7,_0x25742f){return function(_0x1b89d5){if(_0x1b89d5){return _0x1b89d5[_0x5c3e('0x23')]()['then'](function(){var _0x53dc9a=_0x1b89d5[_0x5c3e('0x24')]({'plain':!![]});var _0xd577de=_0x5c3e('0x25');return db[_0x5c3e('0x26')][_0x5c3e('0x23')]({'where':{'type':_0xd577de,'resourceId':_0x53dc9a['id']}})[_0x5c3e('0x22')](function(){return _0x1b89d5;});})[_0x5c3e('0x22')](function(){_0x3581d7['status'](0xcc)[_0x5c3e('0x18')]();});}};}function handleEntityNotFound(_0x4ae1e3,_0x41eb5b){return function(_0xd84251){if(!_0xd84251){_0x4ae1e3['sendStatus'](0x194);}return _0xd84251;};}function handleError(_0x32fa2c,_0xa79cbc){_0xa79cbc=_0xa79cbc||0x1f4;return function(_0x42fee2){logger[_0x5c3e('0x27')](_0x42fee2['stack']);if(_0x42fee2[_0x5c3e('0x28')]){delete _0x42fee2['name'];}_0x32fa2c[_0x5c3e('0x17')](_0xa79cbc)[_0x5c3e('0x29')](_0x42fee2);};}exports['index']=function(_0x4e0eaf,_0x42b704){var _0x38e9a4={},_0x123af4={},_0x4fe6c1={'count':0x0,'rows':[]};var _0x5d9525=_[_0x5c3e('0x2a')](db[_0x5c3e('0x2b')]['rawAttributes'],function(_0x5f9970){return{'name':_0x5f9970[_0x5c3e('0x2c')],'type':_0x5f9970[_0x5c3e('0x2d')][_0x5c3e('0x2e')]};});_0x123af4[_0x5c3e('0x2f')]=_[_0x5c3e('0x2a')](_0x5d9525,_0x5c3e('0x28'));_0x123af4[_0x5c3e('0x30')]=_['keys'](_0x4e0eaf['query']);_0x123af4[_0x5c3e('0x31')]=_['intersection'](_0x123af4[_0x5c3e('0x2f')],_0x123af4[_0x5c3e('0x30')]);_0x38e9a4[_0x5c3e('0x32')]=_[_0x5c3e('0x33')](_0x123af4['model'],qs['fields'](_0x4e0eaf['query'][_0x5c3e('0x34')]));_0x38e9a4[_0x5c3e('0x32')]=_0x38e9a4[_0x5c3e('0x32')]['length']?_0x38e9a4[_0x5c3e('0x32')]:_0x123af4[_0x5c3e('0x2f')];if(!_0x4e0eaf[_0x5c3e('0x30')]['hasOwnProperty'](_0x5c3e('0x35'))){_0x38e9a4[_0x5c3e('0x36')]=qs['limit'](_0x4e0eaf[_0x5c3e('0x30')]['limit']);_0x38e9a4[_0x5c3e('0x1c')]=qs[_0x5c3e('0x1c')](_0x4e0eaf[_0x5c3e('0x30')]['offset']);}_0x38e9a4[_0x5c3e('0x37')]=qs['sort'](_0x4e0eaf[_0x5c3e('0x30')][_0x5c3e('0x38')]);_0x38e9a4[_0x5c3e('0x39')]=qs['filters'](_[_0x5c3e('0x3a')](_0x4e0eaf[_0x5c3e('0x30')],_0x123af4[_0x5c3e('0x31')]),_0x5d9525);if(_0x4e0eaf[_0x5c3e('0x30')][_0x5c3e('0x3b')]){_0x38e9a4[_0x5c3e('0x39')]=_[_0x5c3e('0x3c')](_0x38e9a4['where'],{'$or':_[_0x5c3e('0x2a')](_0x5d9525,function(_0x4bbf2d){if(_0x4bbf2d['type']!==_0x5c3e('0x3d')){var _0x131660={};_0x131660[_0x4bbf2d['name']]={'$like':'%'+_0x4e0eaf[_0x5c3e('0x30')][_0x5c3e('0x3b')]+'%'};return _0x131660;}})});}_0x38e9a4=_[_0x5c3e('0x3c')]({},_0x38e9a4,_0x4e0eaf[_0x5c3e('0x3e')]);var _0x3ad5cd={'where':_0x38e9a4['where']};return db[_0x5c3e('0x2b')][_0x5c3e('0x1b')](_0x3ad5cd)[_0x5c3e('0x22')](function(_0x492317){_0x4fe6c1[_0x5c3e('0x1b')]=_0x492317;if(_0x4e0eaf[_0x5c3e('0x30')][_0x5c3e('0x3f')]){_0x38e9a4[_0x5c3e('0x40')]=[{'all':!![]}];}return db[_0x5c3e('0x2b')][_0x5c3e('0x41')](_0x38e9a4);})[_0x5c3e('0x22')](function(_0x304355){_0x4fe6c1[_0x5c3e('0x42')]=_0x304355;return _0x4fe6c1;})[_0x5c3e('0x22')](respondWithFilteredResult(_0x42b704,_0x38e9a4))[_0x5c3e('0x43')](handleError(_0x42b704,null));};exports[_0x5c3e('0x44')]=function(_0x132c4b,_0x22fa29){var _0xba33e2={'raw':![],'where':{'id':_0x132c4b['params']['id']}},_0x262d66={};_0x262d66['model']=_['keys'](db[_0x5c3e('0x2b')][_0x5c3e('0x45')]);_0x262d66[_0x5c3e('0x30')]=_[_0x5c3e('0x46')](_0x132c4b[_0x5c3e('0x30')]);_0x262d66[_0x5c3e('0x31')]=_[_0x5c3e('0x33')](_0x262d66[_0x5c3e('0x2f')],_0x262d66[_0x5c3e('0x30')]);_0xba33e2['attributes']=_[_0x5c3e('0x33')](_0x262d66[_0x5c3e('0x2f')],qs[_0x5c3e('0x34')](_0x132c4b['query'][_0x5c3e('0x34')]));_0xba33e2[_0x5c3e('0x32')]=_0xba33e2['attributes'][_0x5c3e('0x47')]?_0xba33e2[_0x5c3e('0x32')]:_0x262d66[_0x5c3e('0x2f')];if(_0x132c4b[_0x5c3e('0x30')]['includeAll']){_0xba33e2[_0x5c3e('0x40')]=[{'all':!![]}];}_0xba33e2=_[_0x5c3e('0x3c')]({},_0xba33e2,_0x132c4b[_0x5c3e('0x3e')]);return db[_0x5c3e('0x2b')][_0x5c3e('0x48')](_0xba33e2)[_0x5c3e('0x22')](handleEntityNotFound(_0x22fa29,null))[_0x5c3e('0x22')](respondWithResult(_0x22fa29,null))[_0x5c3e('0x43')](handleError(_0x22fa29,null));};exports['create']=function(_0x51c9a3,_0x19a6d0){return db[_0x5c3e('0x2b')][_0x5c3e('0x49')](_0x51c9a3[_0x5c3e('0x4a')],{})['then'](function(_0x4e0b0e){var _0x312c8b=_0x51c9a3['user'][_0x5c3e('0x24')]({'plain':!![]});if(!_0x312c8b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x312c8b['role']===_0x5c3e('0x4b')){var _0x1a5990=_0x4e0b0e[_0x5c3e('0x24')]({'plain':!![]});var _0x483b3c=_0x5c3e('0x25');return db[_0x5c3e('0x4c')][_0x5c3e('0x48')]({'where':{'name':_0x483b3c,'userProfileId':_0x312c8b[_0x5c3e('0x4d')]},'raw':!![]})['then'](function(_0x2b4658){if(_0x2b4658&&_0x2b4658['autoAssociation']===0x0){return db[_0x5c3e('0x26')]['create']({'name':_0x1a5990[_0x5c3e('0x28')],'resourceId':_0x1a5990['id'],'type':_0x2b4658[_0x5c3e('0x28')],'sectionId':_0x2b4658['id']},{})['then'](function(){return _0x4e0b0e;});}else{return _0x4e0b0e;}})[_0x5c3e('0x43')](function(_0x59821b){logger[_0x5c3e('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x59821b);throw _0x59821b;});}return _0x4e0b0e;})[_0x5c3e('0x22')](respondWithResult(_0x19a6d0,0xc9))[_0x5c3e('0x43')](handleError(_0x19a6d0,null));};exports['update']=function(_0xba4964,_0x1339a4){if(_0xba4964[_0x5c3e('0x4a')]['id']){delete _0xba4964[_0x5c3e('0x4a')]['id'];}return db[_0x5c3e('0x2b')][_0x5c3e('0x48')]({'where':{'id':_0xba4964[_0x5c3e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1339a4,null))[_0x5c3e('0x22')](saveUpdates(_0xba4964['body'],null))['then'](respondWithResult(_0x1339a4,null))[_0x5c3e('0x43')](handleError(_0x1339a4,null));};exports[_0x5c3e('0x23')]=function(_0x5b69bb,_0xd01e6f){return db['Trigger'][_0x5c3e('0x48')]({'where':{'id':_0x5b69bb[_0x5c3e('0x4e')]['id']}})[_0x5c3e('0x22')](handleEntityNotFound(_0xd01e6f,null))[_0x5c3e('0x22')](removeEntity(_0xd01e6f,null))['catch'](handleError(_0xd01e6f,null));};exports['addAllCondition']=function(_0x443657,_0x1eb28e,_0x4cabed){if(_0x443657[_0x5c3e('0x4a')]['id']){delete _0x443657[_0x5c3e('0x4a')]['id'];}return db[_0x5c3e('0x2b')]['find']({'where':{'id':_0x443657[_0x5c3e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1eb28e,null))['then'](function(_0x2a4212){if(_0x2a4212){_0x443657['body']['TriggerAllId']=_0x2a4212['id'];return db[_0x5c3e('0x4f')][_0x5c3e('0x49')](_0x443657['body']);}})[_0x5c3e('0x22')](respondWithResult(_0x1eb28e,null))['catch'](handleError(_0x1eb28e,null));};exports[_0x5c3e('0x50')]=function(_0x45a7de,_0x1c65df,_0x44f105){if(_0x45a7de[_0x5c3e('0x4a')]['id']){delete _0x45a7de[_0x5c3e('0x4a')]['id'];}return db[_0x5c3e('0x2b')][_0x5c3e('0x48')]({'where':{'id':_0x45a7de[_0x5c3e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1c65df,null))[_0x5c3e('0x22')](function(_0x42bcac){if(_0x42bcac){_0x45a7de[_0x5c3e('0x4a')]['TriggerAnyId']=_0x42bcac['id'];return db[_0x5c3e('0x4f')]['create'](_0x45a7de[_0x5c3e('0x4a')]);}})[_0x5c3e('0x22')](respondWithResult(_0x1c65df,null))[_0x5c3e('0x43')](handleError(_0x1c65df,null));};exports[_0x5c3e('0x51')]=function(_0x5df55c,_0x56c429,_0x3e5ad8){var _0x4db4aa={};var _0x5a6c93={};var _0x4a09d3;var _0x43c40e;return db[_0x5c3e('0x2b')][_0x5c3e('0x52')]({'where':{'id':_0x5df55c[_0x5c3e('0x4e')]['id']}})[_0x5c3e('0x22')](handleEntityNotFound(_0x56c429,null))[_0x5c3e('0x22')](function(_0x40f5d2){if(_0x40f5d2){_0x4a09d3=_0x40f5d2;_0x5a6c93[_0x5c3e('0x2f')]=_[_0x5c3e('0x46')](db[_0x5c3e('0x4f')][_0x5c3e('0x45')]);_0x5a6c93[_0x5c3e('0x30')]=_['keys'](_0x5df55c['query']);_0x5a6c93['filters']=_[_0x5c3e('0x33')](_0x5a6c93[_0x5c3e('0x2f')],_0x5a6c93[_0x5c3e('0x30')]);_0x4db4aa['attributes']=_['intersection'](_0x5a6c93[_0x5c3e('0x2f')],qs[_0x5c3e('0x34')](_0x5df55c[_0x5c3e('0x30')][_0x5c3e('0x34')]));_0x4db4aa[_0x5c3e('0x32')]=_0x4db4aa[_0x5c3e('0x32')]['length']?_0x4db4aa['attributes']:_0x5a6c93['model'];_0x4db4aa[_0x5c3e('0x37')]=qs[_0x5c3e('0x38')](_0x5df55c[_0x5c3e('0x30')][_0x5c3e('0x38')]);_0x4db4aa[_0x5c3e('0x39')]=qs[_0x5c3e('0x31')](_[_0x5c3e('0x3a')](_0x5df55c[_0x5c3e('0x30')],_0x5a6c93['filters']));if(_0x5df55c[_0x5c3e('0x30')][_0x5c3e('0x3b')]){_0x4db4aa[_0x5c3e('0x39')]=_[_0x5c3e('0x3c')](_0x4db4aa[_0x5c3e('0x39')],{'$or':_[_0x5c3e('0x2a')](_0x4db4aa[_0x5c3e('0x32')],function(_0x1f2f50){var _0x203e00={};_0x203e00[_0x1f2f50]={'$like':'%'+_0x5df55c['query']['filter']+'%'};return _0x203e00;})});}_0x4db4aa=_['merge']({},_0x4db4aa,_0x5df55c[_0x5c3e('0x3e')]);return _0x4a09d3[_0x5c3e('0x51')](_0x4db4aa);}})[_0x5c3e('0x22')](function(_0x5268f3){if(_0x5268f3){_0x43c40e=_0x5268f3[_0x5c3e('0x47')];if(!_0x5df55c[_0x5c3e('0x30')]['hasOwnProperty'](_0x5c3e('0x35'))){_0x4db4aa[_0x5c3e('0x36')]=qs[_0x5c3e('0x36')](_0x5df55c[_0x5c3e('0x30')][_0x5c3e('0x36')]);_0x4db4aa[_0x5c3e('0x1c')]=qs['offset'](_0x5df55c[_0x5c3e('0x30')]['offset']);}return _0x4a09d3[_0x5c3e('0x51')](_0x4db4aa);}})['then'](function(_0x41318a){if(_0x41318a){return _0x41318a?{'count':_0x43c40e,'rows':_0x41318a}:null;}})['then'](respondWithResult(_0x56c429,null))[_0x5c3e('0x43')](handleError(_0x56c429,null));};exports[_0x5c3e('0x53')]=function(_0x218332,_0x538504,_0x455ad0){var _0xa126e={};var _0x5c2ae6={};var _0xc051a9;var _0x5c5401;return db[_0x5c3e('0x2b')]['findOne']({'where':{'id':_0x218332[_0x5c3e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x538504,null))[_0x5c3e('0x22')](function(_0x1bbd28){if(_0x1bbd28){_0xc051a9=_0x1bbd28;_0x5c2ae6[_0x5c3e('0x2f')]=_[_0x5c3e('0x46')](db[_0x5c3e('0x4f')][_0x5c3e('0x45')]);_0x5c2ae6[_0x5c3e('0x30')]=_[_0x5c3e('0x46')](_0x218332['query']);_0x5c2ae6[_0x5c3e('0x31')]=_[_0x5c3e('0x33')](_0x5c2ae6[_0x5c3e('0x2f')],_0x5c2ae6['query']);_0xa126e[_0x5c3e('0x32')]=_[_0x5c3e('0x33')](_0x5c2ae6[_0x5c3e('0x2f')],qs[_0x5c3e('0x34')](_0x218332[_0x5c3e('0x30')]['fields']));_0xa126e[_0x5c3e('0x32')]=_0xa126e[_0x5c3e('0x32')][_0x5c3e('0x47')]?_0xa126e[_0x5c3e('0x32')]:_0x5c2ae6[_0x5c3e('0x2f')];_0xa126e[_0x5c3e('0x37')]=qs['sort'](_0x218332['query'][_0x5c3e('0x38')]);_0xa126e[_0x5c3e('0x39')]=qs['filters'](_[_0x5c3e('0x3a')](_0x218332[_0x5c3e('0x30')],_0x5c2ae6[_0x5c3e('0x31')]));if(_0x218332[_0x5c3e('0x30')]['filter']){_0xa126e['where']=_[_0x5c3e('0x3c')](_0xa126e[_0x5c3e('0x39')],{'$or':_[_0x5c3e('0x2a')](_0xa126e['attributes'],function(_0x437db0){var _0x2f71ae={};_0x2f71ae[_0x437db0]={'$like':'%'+_0x218332[_0x5c3e('0x30')][_0x5c3e('0x3b')]+'%'};return _0x2f71ae;})});}_0xa126e=_[_0x5c3e('0x3c')]({},_0xa126e,_0x218332[_0x5c3e('0x3e')]);return _0xc051a9[_0x5c3e('0x53')](_0xa126e);}})[_0x5c3e('0x22')](function(_0x58e9a1){if(_0x58e9a1){_0x5c5401=_0x58e9a1[_0x5c3e('0x47')];if(!_0x218332[_0x5c3e('0x30')][_0x5c3e('0x54')](_0x5c3e('0x35'))){_0xa126e[_0x5c3e('0x36')]=qs[_0x5c3e('0x36')](_0x218332[_0x5c3e('0x30')][_0x5c3e('0x36')]);_0xa126e[_0x5c3e('0x1c')]=qs[_0x5c3e('0x1c')](_0x218332[_0x5c3e('0x30')][_0x5c3e('0x1c')]);}return _0xc051a9[_0x5c3e('0x53')](_0xa126e);}})[_0x5c3e('0x22')](function(_0x3491fb){if(_0x3491fb){return _0x3491fb?{'count':_0x5c5401,'rows':_0x3491fb}:null;}})[_0x5c3e('0x22')](respondWithResult(_0x538504,null))[_0x5c3e('0x43')](handleError(_0x538504,null));};exports['addAction']=function(_0x145dc6,_0x2ba459,_0x3e08e5){if(_0x145dc6[_0x5c3e('0x4a')]['id']){delete _0x145dc6[_0x5c3e('0x4a')]['id'];}return db[_0x5c3e('0x2b')]['find']({'where':{'id':_0x145dc6[_0x5c3e('0x4e')]['id']}})[_0x5c3e('0x22')](handleEntityNotFound(_0x2ba459,null))[_0x5c3e('0x22')](function(_0x3e3d25){if(_0x3e3d25){_0x145dc6[_0x5c3e('0x4a')]['TriggerId']=_0x3e3d25['id'];return db[_0x5c3e('0x55')][_0x5c3e('0x49')](_0x145dc6[_0x5c3e('0x4a')]);}})[_0x5c3e('0x22')](respondWithResult(_0x2ba459,null))['catch'](handleError(_0x2ba459,null));};exports['getActions']=function(_0x3579e1,_0x41caed,_0x1bd2d4){var _0xcf07aa={};var _0x2ce144={};var _0x82a4d9;var _0x426e1e;return db[_0x5c3e('0x2b')]['findOne']({'where':{'id':_0x3579e1[_0x5c3e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x41caed,null))[_0x5c3e('0x22')](function(_0x34b264){if(_0x34b264){_0x82a4d9=_0x34b264;_0x2ce144[_0x5c3e('0x2f')]=_[_0x5c3e('0x46')](db[_0x5c3e('0x55')][_0x5c3e('0x45')]);_0x2ce144['query']=_[_0x5c3e('0x46')](_0x3579e1[_0x5c3e('0x30')]);_0x2ce144[_0x5c3e('0x31')]=_[_0x5c3e('0x33')](_0x2ce144[_0x5c3e('0x2f')],_0x2ce144[_0x5c3e('0x30')]);_0xcf07aa[_0x5c3e('0x32')]=_['intersection'](_0x2ce144['model'],qs[_0x5c3e('0x34')](_0x3579e1[_0x5c3e('0x30')]['fields']));_0xcf07aa[_0x5c3e('0x32')]=_0xcf07aa[_0x5c3e('0x32')][_0x5c3e('0x47')]?_0xcf07aa['attributes']:_0x2ce144[_0x5c3e('0x2f')];_0xcf07aa[_0x5c3e('0x37')]=qs[_0x5c3e('0x38')](_0x3579e1[_0x5c3e('0x30')]['sort']);_0xcf07aa[_0x5c3e('0x39')]=qs[_0x5c3e('0x31')](_['pick'](_0x3579e1[_0x5c3e('0x30')],_0x2ce144[_0x5c3e('0x31')]));if(_0x3579e1[_0x5c3e('0x30')]['filter']){_0xcf07aa[_0x5c3e('0x39')]=_[_0x5c3e('0x3c')](_0xcf07aa[_0x5c3e('0x39')],{'$or':_[_0x5c3e('0x2a')](_0xcf07aa[_0x5c3e('0x32')],function(_0x571b06){var _0x58703a={};_0x58703a[_0x571b06]={'$like':'%'+_0x3579e1[_0x5c3e('0x30')]['filter']+'%'};return _0x58703a;})});}_0xcf07aa=_[_0x5c3e('0x3c')]({},_0xcf07aa,_0x3579e1[_0x5c3e('0x3e')]);return _0x82a4d9['getActions'](_0xcf07aa);}})[_0x5c3e('0x22')](function(_0x34156f){if(_0x34156f){_0x426e1e=_0x34156f[_0x5c3e('0x47')];if(!_0x3579e1['query']['hasOwnProperty'](_0x5c3e('0x35'))){_0xcf07aa[_0x5c3e('0x36')]=qs[_0x5c3e('0x36')](_0x3579e1[_0x5c3e('0x30')]['limit']);_0xcf07aa[_0x5c3e('0x1c')]=qs[_0x5c3e('0x1c')](_0x3579e1['query']['offset']);}return _0x82a4d9['getActions'](_0xcf07aa);}})[_0x5c3e('0x22')](function(_0x3cd035){if(_0x3cd035){return _0x3cd035?{'count':_0x426e1e,'rows':_0x3cd035}:null;}})[_0x5c3e('0x22')](respondWithResult(_0x41caed,null))[_0x5c3e('0x43')](handleError(_0x41caed,null));};
\ No newline at end of file
+var _0x71e3=['sort','pick','where','merge','VIRTUAL','filter','options','Trigger','includeAll','include','catch','keys','rawAttributes','find','create','body','user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','nolimit','getAnyConditions','findOne','addAction','TriggerId','Action','getActions','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','undefined','count','offset','status','set','apply','reject','update','then','get','Triggers','destroy','error','name','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','limit','order'];(function(_0x115621,_0x341cde){var _0x5ef5ce=function(_0x2ca3f2){while(--_0x2ca3f2){_0x115621['push'](_0x115621['shift']());}};_0x5ef5ce(++_0x341cde);}(_0x71e3,0xd4));var _0x371e=function(_0x56de14,_0x1c64f5){_0x56de14=_0x56de14-0x0;var _0xf5f389=_0x71e3[_0x56de14];return _0xf5f389;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x371e('0x0'));var zipdir=require(_0x371e('0x1'));var jsonpatch=require(_0x371e('0x2'));var rp=require('request-promise');var moment=require(_0x371e('0x3'));var BPromise=require(_0x371e('0x4'));var Mustache=require(_0x371e('0x5'));var util=require(_0x371e('0x6'));var path=require(_0x371e('0x7'));var sox=require('sox');var csv=require(_0x371e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x371e('0x9'));var crypto=require('crypto');var jsforce=require(_0x371e('0xa'));var deskjs=require(_0x371e('0xb'));var toCsv=require(_0x371e('0x8'));var querystring=require(_0x371e('0xc'));var Papa=require(_0x371e('0xd'));var Redis=require(_0x371e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x371e('0xf'));var as=require(_0x371e('0x10'));var hardwareService=require(_0x371e('0x11'));var logger=require('../../config/logger')(_0x371e('0x12'));var utils=require(_0x371e('0x13'));var config=require(_0x371e('0x14'));var licenseUtil=require(_0x371e('0x15'));var db=require(_0x371e('0x16'))['db'];function respondWithStatusCode(_0x379e47,_0x36239d){_0x36239d=_0x36239d||0xcc;return function(_0x317ee7){if(_0x317ee7){return _0x379e47[_0x371e('0x17')](_0x36239d);}return _0x379e47['status'](_0x36239d)['end']();};}function respondWithResult(_0x104cd0,_0x1017c2){_0x1017c2=_0x1017c2||0xc8;return function(_0xd653ec){if(_0xd653ec){return _0x104cd0['status'](_0x1017c2)[_0x371e('0x18')](_0xd653ec);}};}function respondWithFilteredResult(_0x5c164a,_0x465a3e){return function(_0x2b9587){if(_0x2b9587){var _0x2f14f9=typeof _0x465a3e['offset']===_0x371e('0x19')&&typeof _0x465a3e['limit']===_0x371e('0x19');var _0x467faf=_0x2b9587[_0x371e('0x1a')];var _0x3cdb2a=_0x2f14f9?0x0:_0x465a3e[_0x371e('0x1b')];var _0x3b1961=_0x2f14f9?_0x2b9587[_0x371e('0x1a')]:_0x465a3e[_0x371e('0x1b')]+_0x465a3e['limit'];var _0x5942ba;if(_0x3b1961>=_0x467faf){_0x3b1961=_0x467faf;_0x5942ba=0xc8;}else{_0x5942ba=0xce;}_0x5c164a[_0x371e('0x1c')](_0x5942ba);return _0x5c164a[_0x371e('0x1d')]('Content-Range',_0x3cdb2a+'-'+_0x3b1961+'/'+_0x467faf)[_0x371e('0x18')](_0x2b9587);}return null;};}function patchUpdates(_0x2ab56c){return function(_0x3e9728){try{jsonpatch[_0x371e('0x1e')](_0x3e9728,_0x2ab56c,!![]);}catch(_0x247be8){return BPromise[_0x371e('0x1f')](_0x247be8);}return _0x3e9728['save']();};}function saveUpdates(_0x5e4b97,_0x1cc280){return function(_0x5f52ab){if(_0x5f52ab){return _0x5f52ab[_0x371e('0x20')](_0x5e4b97)[_0x371e('0x21')](function(_0x515e18){return _0x515e18;});}return null;};}function removeEntity(_0x2e5f87,_0x4f97e8){return function(_0x49fd76){if(_0x49fd76){return _0x49fd76['destroy']()[_0x371e('0x21')](function(){var _0xa80d7b=_0x49fd76[_0x371e('0x22')]({'plain':!![]});var _0xccd374=_0x371e('0x23');return db['UserProfileResource'][_0x371e('0x24')]({'where':{'type':_0xccd374,'resourceId':_0xa80d7b['id']}})['then'](function(){return _0x49fd76;});})[_0x371e('0x21')](function(){_0x2e5f87[_0x371e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3de164,_0x29a49b){return function(_0x3716a4){if(!_0x3716a4){_0x3de164[_0x371e('0x17')](0x194);}return _0x3716a4;};}function handleError(_0xdaee23,_0x40b0ad){_0x40b0ad=_0x40b0ad||0x1f4;return function(_0x43bd27){logger[_0x371e('0x25')](_0x43bd27['stack']);if(_0x43bd27[_0x371e('0x26')]){delete _0x43bd27[_0x371e('0x26')];}_0xdaee23['status'](_0x40b0ad)['send'](_0x43bd27);};}exports['index']=function(_0x4909f5,_0x2ae3b7){var _0x32fd80={},_0x13a4c8={},_0x2aca12={'count':0x0,'rows':[]};var _0x6dba67=_[_0x371e('0x27')](db['Trigger']['rawAttributes'],function(_0x57fdab){return{'name':_0x57fdab[_0x371e('0x28')],'type':_0x57fdab[_0x371e('0x29')][_0x371e('0x2a')]};});_0x13a4c8[_0x371e('0x2b')]=_[_0x371e('0x27')](_0x6dba67,_0x371e('0x26'));_0x13a4c8[_0x371e('0x2c')]=_['keys'](_0x4909f5[_0x371e('0x2c')]);_0x13a4c8[_0x371e('0x2d')]=_[_0x371e('0x2e')](_0x13a4c8[_0x371e('0x2b')],_0x13a4c8[_0x371e('0x2c')]);_0x32fd80[_0x371e('0x2f')]=_['intersection'](_0x13a4c8[_0x371e('0x2b')],qs['fields'](_0x4909f5[_0x371e('0x2c')][_0x371e('0x30')]));_0x32fd80['attributes']=_0x32fd80[_0x371e('0x2f')][_0x371e('0x31')]?_0x32fd80['attributes']:_0x13a4c8[_0x371e('0x2b')];if(!_0x4909f5[_0x371e('0x2c')]['hasOwnProperty']('nolimit')){_0x32fd80[_0x371e('0x32')]=qs['limit'](_0x4909f5[_0x371e('0x2c')]['limit']);_0x32fd80[_0x371e('0x1b')]=qs[_0x371e('0x1b')](_0x4909f5[_0x371e('0x2c')][_0x371e('0x1b')]);}_0x32fd80[_0x371e('0x33')]=qs[_0x371e('0x34')](_0x4909f5[_0x371e('0x2c')][_0x371e('0x34')]);_0x32fd80['where']=qs[_0x371e('0x2d')](_[_0x371e('0x35')](_0x4909f5[_0x371e('0x2c')],_0x13a4c8[_0x371e('0x2d')]),_0x6dba67);if(_0x4909f5[_0x371e('0x2c')]['filter']){_0x32fd80[_0x371e('0x36')]=_[_0x371e('0x37')](_0x32fd80['where'],{'$or':_[_0x371e('0x27')](_0x6dba67,function(_0x3f7a30){if(_0x3f7a30['type']!==_0x371e('0x38')){var _0x4fdac9={};_0x4fdac9[_0x3f7a30['name']]={'$like':'%'+_0x4909f5['query'][_0x371e('0x39')]+'%'};return _0x4fdac9;}})});}_0x32fd80=_['merge']({},_0x32fd80,_0x4909f5[_0x371e('0x3a')]);var _0x1d46f7={'where':_0x32fd80[_0x371e('0x36')]};return db[_0x371e('0x3b')]['count'](_0x1d46f7)[_0x371e('0x21')](function(_0x5f19bb){_0x2aca12[_0x371e('0x1a')]=_0x5f19bb;if(_0x4909f5[_0x371e('0x2c')][_0x371e('0x3c')]){_0x32fd80[_0x371e('0x3d')]=[{'all':!![]}];}return db[_0x371e('0x3b')]['findAll'](_0x32fd80);})[_0x371e('0x21')](function(_0x79e837){_0x2aca12['rows']=_0x79e837;return _0x2aca12;})[_0x371e('0x21')](respondWithFilteredResult(_0x2ae3b7,_0x32fd80))[_0x371e('0x3e')](handleError(_0x2ae3b7,null));};exports['show']=function(_0x30fca1,_0x236a04){var _0x286455={'raw':![],'where':{'id':_0x30fca1['params']['id']}},_0x543a51={};_0x543a51[_0x371e('0x2b')]=_[_0x371e('0x3f')](db[_0x371e('0x3b')][_0x371e('0x40')]);_0x543a51['query']=_[_0x371e('0x3f')](_0x30fca1[_0x371e('0x2c')]);_0x543a51[_0x371e('0x2d')]=_['intersection'](_0x543a51['model'],_0x543a51['query']);_0x286455[_0x371e('0x2f')]=_[_0x371e('0x2e')](_0x543a51['model'],qs[_0x371e('0x30')](_0x30fca1['query']['fields']));_0x286455[_0x371e('0x2f')]=_0x286455[_0x371e('0x2f')][_0x371e('0x31')]?_0x286455[_0x371e('0x2f')]:_0x543a51[_0x371e('0x2b')];if(_0x30fca1['query'][_0x371e('0x3c')]){_0x286455[_0x371e('0x3d')]=[{'all':!![]}];}_0x286455=_[_0x371e('0x37')]({},_0x286455,_0x30fca1[_0x371e('0x3a')]);return db[_0x371e('0x3b')][_0x371e('0x41')](_0x286455)['then'](handleEntityNotFound(_0x236a04,null))['then'](respondWithResult(_0x236a04,null))[_0x371e('0x3e')](handleError(_0x236a04,null));};exports[_0x371e('0x42')]=function(_0x714300,_0x391bba){return db[_0x371e('0x3b')][_0x371e('0x42')](_0x714300[_0x371e('0x43')],{})['then'](function(_0x22c37c){var _0x28fbb3=_0x714300[_0x371e('0x44')][_0x371e('0x22')]({'plain':!![]});if(!_0x28fbb3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x28fbb3[_0x371e('0x45')]===_0x371e('0x44')){var _0x5571eb=_0x22c37c[_0x371e('0x22')]({'plain':!![]});var _0x4c6733=_0x371e('0x23');return db[_0x371e('0x46')][_0x371e('0x41')]({'where':{'name':_0x4c6733,'userProfileId':_0x28fbb3['userProfileId']},'raw':!![]})[_0x371e('0x21')](function(_0x44a79a){if(_0x44a79a&&_0x44a79a[_0x371e('0x47')]===0x0){return db[_0x371e('0x48')]['create']({'name':_0x5571eb[_0x371e('0x26')],'resourceId':_0x5571eb['id'],'type':_0x44a79a[_0x371e('0x26')],'sectionId':_0x44a79a['id']},{})['then'](function(){return _0x22c37c;});}else{return _0x22c37c;}})['catch'](function(_0x17c4fa){logger[_0x371e('0x25')](_0x371e('0x49'),_0x17c4fa);throw _0x17c4fa;});}return _0x22c37c;})[_0x371e('0x21')](respondWithResult(_0x391bba,0xc9))[_0x371e('0x3e')](handleError(_0x391bba,null));};exports['update']=function(_0x495fcb,_0x4227d2){if(_0x495fcb[_0x371e('0x43')]['id']){delete _0x495fcb['body']['id'];}return db[_0x371e('0x3b')][_0x371e('0x41')]({'where':{'id':_0x495fcb[_0x371e('0x4a')]['id']}})[_0x371e('0x21')](handleEntityNotFound(_0x4227d2,null))[_0x371e('0x21')](saveUpdates(_0x495fcb[_0x371e('0x43')],null))[_0x371e('0x21')](respondWithResult(_0x4227d2,null))[_0x371e('0x3e')](handleError(_0x4227d2,null));};exports[_0x371e('0x24')]=function(_0x7eddcc,_0x215f66){return db[_0x371e('0x3b')]['find']({'where':{'id':_0x7eddcc[_0x371e('0x4a')]['id']}})[_0x371e('0x21')](handleEntityNotFound(_0x215f66,null))[_0x371e('0x21')](removeEntity(_0x215f66,null))[_0x371e('0x3e')](handleError(_0x215f66,null));};exports[_0x371e('0x4b')]=function(_0x420ab0,_0x1d4e2d,_0x3f3921){if(_0x420ab0[_0x371e('0x43')]['id']){delete _0x420ab0['body']['id'];}return db['Trigger'][_0x371e('0x41')]({'where':{'id':_0x420ab0['params']['id']}})[_0x371e('0x21')](handleEntityNotFound(_0x1d4e2d,null))[_0x371e('0x21')](function(_0x232f5c){if(_0x232f5c){_0x420ab0[_0x371e('0x43')][_0x371e('0x4c')]=_0x232f5c['id'];return db[_0x371e('0x4d')]['create'](_0x420ab0['body']);}})['then'](respondWithResult(_0x1d4e2d,null))[_0x371e('0x3e')](handleError(_0x1d4e2d,null));};exports[_0x371e('0x4e')]=function(_0x108750,_0x5d4251,_0x403c34){if(_0x108750[_0x371e('0x43')]['id']){delete _0x108750[_0x371e('0x43')]['id'];}return db[_0x371e('0x3b')][_0x371e('0x41')]({'where':{'id':_0x108750[_0x371e('0x4a')]['id']}})[_0x371e('0x21')](handleEntityNotFound(_0x5d4251,null))[_0x371e('0x21')](function(_0x5ae0ea){if(_0x5ae0ea){_0x108750['body'][_0x371e('0x4f')]=_0x5ae0ea['id'];return db[_0x371e('0x4d')]['create'](_0x108750[_0x371e('0x43')]);}})[_0x371e('0x21')](respondWithResult(_0x5d4251,null))[_0x371e('0x3e')](handleError(_0x5d4251,null));};exports['getAllConditions']=function(_0x4fa71b,_0x134b28,_0x5a974a){var _0x3cf294={};var _0x1088cc={};var _0x3fb914;var _0x1d643d;return db['Trigger']['findOne']({'where':{'id':_0x4fa71b[_0x371e('0x4a')]['id']}})[_0x371e('0x21')](handleEntityNotFound(_0x134b28,null))[_0x371e('0x21')](function(_0x277a0b){if(_0x277a0b){_0x3fb914=_0x277a0b;_0x1088cc[_0x371e('0x2b')]=_[_0x371e('0x3f')](db[_0x371e('0x4d')][_0x371e('0x40')]);_0x1088cc['query']=_[_0x371e('0x3f')](_0x4fa71b['query']);_0x1088cc['filters']=_[_0x371e('0x2e')](_0x1088cc[_0x371e('0x2b')],_0x1088cc['query']);_0x3cf294[_0x371e('0x2f')]=_[_0x371e('0x2e')](_0x1088cc[_0x371e('0x2b')],qs['fields'](_0x4fa71b[_0x371e('0x2c')][_0x371e('0x30')]));_0x3cf294[_0x371e('0x2f')]=_0x3cf294[_0x371e('0x2f')][_0x371e('0x31')]?_0x3cf294['attributes']:_0x1088cc[_0x371e('0x2b')];_0x3cf294['order']=qs[_0x371e('0x34')](_0x4fa71b[_0x371e('0x2c')]['sort']);_0x3cf294[_0x371e('0x36')]=qs[_0x371e('0x2d')](_['pick'](_0x4fa71b['query'],_0x1088cc[_0x371e('0x2d')]));if(_0x4fa71b['query'][_0x371e('0x39')]){_0x3cf294[_0x371e('0x36')]=_[_0x371e('0x37')](_0x3cf294[_0x371e('0x36')],{'$or':_[_0x371e('0x27')](_0x3cf294['attributes'],function(_0x4eb893){var _0x4f3377={};_0x4f3377[_0x4eb893]={'$like':'%'+_0x4fa71b[_0x371e('0x2c')][_0x371e('0x39')]+'%'};return _0x4f3377;})});}_0x3cf294=_[_0x371e('0x37')]({},_0x3cf294,_0x4fa71b[_0x371e('0x3a')]);return _0x3fb914[_0x371e('0x50')](_0x3cf294);}})[_0x371e('0x21')](function(_0x18b434){if(_0x18b434){_0x1d643d=_0x18b434[_0x371e('0x31')];if(!_0x4fa71b[_0x371e('0x2c')]['hasOwnProperty'](_0x371e('0x51'))){_0x3cf294[_0x371e('0x32')]=qs[_0x371e('0x32')](_0x4fa71b[_0x371e('0x2c')]['limit']);_0x3cf294[_0x371e('0x1b')]=qs[_0x371e('0x1b')](_0x4fa71b['query'][_0x371e('0x1b')]);}return _0x3fb914[_0x371e('0x50')](_0x3cf294);}})[_0x371e('0x21')](function(_0x2e3f46){if(_0x2e3f46){return _0x2e3f46?{'count':_0x1d643d,'rows':_0x2e3f46}:null;}})[_0x371e('0x21')](respondWithResult(_0x134b28,null))[_0x371e('0x3e')](handleError(_0x134b28,null));};exports[_0x371e('0x52')]=function(_0x54e8e0,_0x252c84,_0x2a48b6){var _0x1aa6eb={};var _0x14c75e={};var _0x4a5755;var _0x5de311;return db[_0x371e('0x3b')][_0x371e('0x53')]({'where':{'id':_0x54e8e0[_0x371e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x252c84,null))['then'](function(_0x1ce166){if(_0x1ce166){_0x4a5755=_0x1ce166;_0x14c75e[_0x371e('0x2b')]=_[_0x371e('0x3f')](db[_0x371e('0x4d')][_0x371e('0x40')]);_0x14c75e['query']=_[_0x371e('0x3f')](_0x54e8e0[_0x371e('0x2c')]);_0x14c75e[_0x371e('0x2d')]=_[_0x371e('0x2e')](_0x14c75e[_0x371e('0x2b')],_0x14c75e['query']);_0x1aa6eb[_0x371e('0x2f')]=_[_0x371e('0x2e')](_0x14c75e[_0x371e('0x2b')],qs[_0x371e('0x30')](_0x54e8e0[_0x371e('0x2c')][_0x371e('0x30')]));_0x1aa6eb[_0x371e('0x2f')]=_0x1aa6eb['attributes'][_0x371e('0x31')]?_0x1aa6eb[_0x371e('0x2f')]:_0x14c75e[_0x371e('0x2b')];_0x1aa6eb[_0x371e('0x33')]=qs[_0x371e('0x34')](_0x54e8e0[_0x371e('0x2c')]['sort']);_0x1aa6eb[_0x371e('0x36')]=qs[_0x371e('0x2d')](_[_0x371e('0x35')](_0x54e8e0[_0x371e('0x2c')],_0x14c75e['filters']));if(_0x54e8e0[_0x371e('0x2c')][_0x371e('0x39')]){_0x1aa6eb['where']=_[_0x371e('0x37')](_0x1aa6eb[_0x371e('0x36')],{'$or':_[_0x371e('0x27')](_0x1aa6eb[_0x371e('0x2f')],function(_0x3f6433){var _0x6795ab={};_0x6795ab[_0x3f6433]={'$like':'%'+_0x54e8e0[_0x371e('0x2c')][_0x371e('0x39')]+'%'};return _0x6795ab;})});}_0x1aa6eb=_[_0x371e('0x37')]({},_0x1aa6eb,_0x54e8e0[_0x371e('0x3a')]);return _0x4a5755['getAnyConditions'](_0x1aa6eb);}})[_0x371e('0x21')](function(_0xf7f422){if(_0xf7f422){_0x5de311=_0xf7f422['length'];if(!_0x54e8e0['query']['hasOwnProperty']('nolimit')){_0x1aa6eb['limit']=qs['limit'](_0x54e8e0[_0x371e('0x2c')][_0x371e('0x32')]);_0x1aa6eb[_0x371e('0x1b')]=qs[_0x371e('0x1b')](_0x54e8e0[_0x371e('0x2c')][_0x371e('0x1b')]);}return _0x4a5755['getAnyConditions'](_0x1aa6eb);}})[_0x371e('0x21')](function(_0x5185e0){if(_0x5185e0){return _0x5185e0?{'count':_0x5de311,'rows':_0x5185e0}:null;}})[_0x371e('0x21')](respondWithResult(_0x252c84,null))['catch'](handleError(_0x252c84,null));};exports[_0x371e('0x54')]=function(_0x37be2a,_0x35b2b0,_0x173b52){if(_0x37be2a[_0x371e('0x43')]['id']){delete _0x37be2a[_0x371e('0x43')]['id'];}return db['Trigger'][_0x371e('0x41')]({'where':{'id':_0x37be2a[_0x371e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x35b2b0,null))['then'](function(_0x4a3c06){if(_0x4a3c06){_0x37be2a[_0x371e('0x43')][_0x371e('0x55')]=_0x4a3c06['id'];return db[_0x371e('0x56')][_0x371e('0x42')](_0x37be2a[_0x371e('0x43')]);}})['then'](respondWithResult(_0x35b2b0,null))['catch'](handleError(_0x35b2b0,null));};exports[_0x371e('0x57')]=function(_0x32939a,_0x29e5d4,_0x22bc6f){var _0x49ce70={};var _0x18bc97={};var _0x326532;var _0x53f50b;return db[_0x371e('0x3b')]['findOne']({'where':{'id':_0x32939a['params']['id']}})['then'](handleEntityNotFound(_0x29e5d4,null))[_0x371e('0x21')](function(_0x152926){if(_0x152926){_0x326532=_0x152926;_0x18bc97[_0x371e('0x2b')]=_[_0x371e('0x3f')](db[_0x371e('0x56')][_0x371e('0x40')]);_0x18bc97[_0x371e('0x2c')]=_[_0x371e('0x3f')](_0x32939a['query']);_0x18bc97[_0x371e('0x2d')]=_[_0x371e('0x2e')](_0x18bc97['model'],_0x18bc97[_0x371e('0x2c')]);_0x49ce70[_0x371e('0x2f')]=_[_0x371e('0x2e')](_0x18bc97[_0x371e('0x2b')],qs['fields'](_0x32939a[_0x371e('0x2c')][_0x371e('0x30')]));_0x49ce70[_0x371e('0x2f')]=_0x49ce70['attributes'][_0x371e('0x31')]?_0x49ce70[_0x371e('0x2f')]:_0x18bc97[_0x371e('0x2b')];_0x49ce70[_0x371e('0x33')]=qs['sort'](_0x32939a[_0x371e('0x2c')][_0x371e('0x34')]);_0x49ce70[_0x371e('0x36')]=qs[_0x371e('0x2d')](_[_0x371e('0x35')](_0x32939a[_0x371e('0x2c')],_0x18bc97[_0x371e('0x2d')]));if(_0x32939a[_0x371e('0x2c')][_0x371e('0x39')]){_0x49ce70[_0x371e('0x36')]=_['merge'](_0x49ce70[_0x371e('0x36')],{'$or':_[_0x371e('0x27')](_0x49ce70[_0x371e('0x2f')],function(_0x12921c){var _0x562d3c={};_0x562d3c[_0x12921c]={'$like':'%'+_0x32939a[_0x371e('0x2c')][_0x371e('0x39')]+'%'};return _0x562d3c;})});}_0x49ce70=_[_0x371e('0x37')]({},_0x49ce70,_0x32939a['options']);return _0x326532[_0x371e('0x57')](_0x49ce70);}})[_0x371e('0x21')](function(_0x427bdf){if(_0x427bdf){_0x53f50b=_0x427bdf[_0x371e('0x31')];if(!_0x32939a[_0x371e('0x2c')]['hasOwnProperty'](_0x371e('0x51'))){_0x49ce70[_0x371e('0x32')]=qs['limit'](_0x32939a[_0x371e('0x2c')]['limit']);_0x49ce70['offset']=qs['offset'](_0x32939a['query'][_0x371e('0x1b')]);}return _0x326532['getActions'](_0x49ce70);}})['then'](function(_0x1cb71a){if(_0x1cb71a){return _0x1cb71a?{'count':_0x53f50b,'rows':_0x1cb71a}:null;}})['then'](respondWithResult(_0x29e5d4,null))['catch'](handleError(_0x29e5d4,null));};
\ No newline at end of file
index 09dfbf1..d00d546 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18d6=['request-promise','rimraf','../../config/environment','exports','define','tools_triggers','lodash','util','api','moment','bluebird'];(function(_0x224ccd,_0x2a30f2){var _0x267265=function(_0x13c5c5){while(--_0x13c5c5){_0x224ccd['push'](_0x224ccd['shift']());}};_0x267265(++_0x2a30f2);}(_0x18d6,0x166));var _0x618d=function(_0x26458c,_0x27bcda){_0x26458c=_0x26458c-0x0;var _0x3bc991=_0x18d6[_0x26458c];return _0x3bc991;};'use strict';var _=require(_0x618d('0x0'));var util=require(_0x618d('0x1'));var logger=require('../../config/logger')(_0x618d('0x2'));var moment=require(_0x618d('0x3'));var BPromise=require(_0x618d('0x4'));var rp=require(_0x618d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x618d('0x6'));var config=require(_0x618d('0x7'));var attributes=require('./trigger.attributes');module[_0x618d('0x8')]=function(_0x55caad,_0xa89cff){return _0x55caad[_0x618d('0x9')]('Trigger',attributes,{'tableName':_0x618d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3fec=['tools_triggers','lodash','api','moment','request-promise','../../config/environment','exports','define','Trigger'];(function(_0x43cd5e,_0x305574){var _0x23b24b=function(_0x2d7a68){while(--_0x2d7a68){_0x43cd5e['push'](_0x43cd5e['shift']());}};_0x23b24b(++_0x305574);}(_0x3fec,0x1ba));var _0xc3fe=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3fec[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc3fe('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc3fe('0x1'));var moment=require(_0xc3fe('0x2'));var BPromise=require('bluebird');var rp=require(_0xc3fe('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc3fe('0x4'));var attributes=require('./trigger.attributes');module[_0xc3fe('0x5')]=function(_0x327d2f,_0x22dd19){return _0x327d2f[_0xc3fe('0x6')](_0xc3fe('0x7'),attributes,{'tableName':_0xc3fe('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 05abeb8..e8667ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x850d=['request\x20sent','result','catch','Trigger','options','raw','where','attributes','include','map','model','GetTrigger','debug','ShowTrigger','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x55c34e,_0x50b7e3){var _0x4a9b56=function(_0x8ed81d){while(--_0x8ed81d){_0x55c34e['push'](_0x55c34e['shift']());}};_0x4a9b56(++_0x50b7e3);}(_0x850d,0xda));var _0xd850=function(_0x45397c,_0x24c4f5){_0x45397c=_0x45397c-0x0;var _0x41c704=_0x850d[_0x45397c];return _0x41c704;};'use strict';var _=require('lodash');var util=require(_0xd850('0x0'));var moment=require(_0xd850('0x1'));var BPromise=require('bluebird');var rs=require(_0xd850('0x2'));var fs=require('fs');var Redis=require(_0xd850('0x3'));var db=require(_0xd850('0x4'))['db'];var utils=require(_0xd850('0x5'));var logger=require(_0xd850('0x6'))('rpc');var config=require(_0xd850('0x7'));var jayson=require(_0xd850('0x8'));var client=jayson[_0xd850('0x9')][_0xd850('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7c4aea,_0x26ab23,_0x5c06b3){return new BPromise(function(_0xefb31b,_0x18e768){return client[_0xd850('0xb')](_0x7c4aea,_0x5c06b3)[_0xd850('0xc')](function(_0x4693d1){logger[_0xd850('0xd')](_0xd850('0xe'),_0x26ab23,'request\x20sent');logger['debug'](_0xd850('0xf'),_0x26ab23,'request\x20sent',JSON[_0xd850('0x10')](_0x4693d1));if(_0x4693d1[_0xd850('0x11')]){if(_0x4693d1[_0xd850('0x11')][_0xd850('0x12')]===0x1f4){logger[_0xd850('0x11')]('Trigger,\x20%s,\x20%s',_0x26ab23,_0x4693d1[_0xd850('0x11')][_0xd850('0x13')]);return _0x18e768(_0x4693d1[_0xd850('0x11')][_0xd850('0x13')]);}logger[_0xd850('0x11')]('Trigger,\x20%s,\x20%s',_0x26ab23,_0x4693d1[_0xd850('0x11')][_0xd850('0x13')]);return _0xefb31b(_0x4693d1['error'][_0xd850('0x13')]);}else{logger['info'](_0xd850('0xe'),_0x26ab23,_0xd850('0x14'));_0xefb31b(_0x4693d1[_0xd850('0x15')][_0xd850('0x13')]);}})[_0xd850('0x16')](function(_0x5bee92){logger[_0xd850('0x11')]('Trigger,\x20%s,\x20%s',_0x26ab23,_0x5bee92);_0x18e768(_0x5bee92);});});}exports['GetTrigger']=function(_0x3652ed){var _0x470ed6=this;return new Promise(function(_0x2fee88,_0x5420b7){return db[_0xd850('0x17')]['findAll']({'raw':_0x3652ed['options']?_0x3652ed[_0xd850('0x18')][_0xd850('0x19')]===undefined?!![]:![]:!![],'where':_0x3652ed[_0xd850('0x18')]?_0x3652ed['options'][_0xd850('0x1a')]||null:null,'attributes':_0x3652ed[_0xd850('0x18')]?_0x3652ed[_0xd850('0x18')][_0xd850('0x1b')]||null:null,'limit':_0x3652ed[_0xd850('0x18')]?_0x3652ed[_0xd850('0x18')]['limit']||null:null,'include':_0x3652ed[_0xd850('0x18')]?_0x3652ed[_0xd850('0x18')][_0xd850('0x1c')]?_[_0xd850('0x1d')](_0x3652ed['options'][_0xd850('0x1c')],function(_0x1b069c){return{'model':db[_0x1b069c[_0xd850('0x1e')]],'as':_0x1b069c['as'],'attributes':_0x1b069c['attributes'],'include':_0x1b069c[_0xd850('0x1c')]?_[_0xd850('0x1d')](_0x1b069c['include'],function(_0x40c51a){return{'model':db[_0x40c51a[_0xd850('0x1e')]],'as':_0x40c51a['as'],'attributes':_0x40c51a[_0xd850('0x1b')],'include':_0x40c51a['include']?_['map'](_0x40c51a[_0xd850('0x1c')],function(_0x18d6d7){return{'model':db[_0x18d6d7['model']],'as':_0x18d6d7['as'],'attributes':_0x18d6d7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5c56ca){logger[_0xd850('0xd')](_0xd850('0x1f'),_0x3652ed);logger[_0xd850('0x20')](_0xd850('0x1f'),_0x3652ed,JSON[_0xd850('0x10')](_0x5c56ca));_0x2fee88(_0x5c56ca);})[_0xd850('0x16')](function(_0x61f792){logger[_0xd850('0x11')](_0xd850('0x1f'),_0x61f792[_0xd850('0x13')],_0x3652ed);_0x5420b7(_0x470ed6[_0xd850('0x11')](0x1f4,_0x61f792[_0xd850('0x13')]));});});};exports[_0xd850('0x21')]=function(_0x186c2f){var _0x586ac1=this;return new Promise(function(_0x4e1bd4,_0x229fd2){return db[_0xd850('0x17')]['find']({'raw':_0x186c2f[_0xd850('0x18')]?_0x186c2f['options'][_0xd850('0x19')]===undefined?!![]:![]:!![],'where':_0x186c2f[_0xd850('0x18')]?_0x186c2f[_0xd850('0x18')][_0xd850('0x1a')]||null:null,'attributes':_0x186c2f['options']?_0x186c2f[_0xd850('0x18')][_0xd850('0x1b')]||null:null,'include':_0x186c2f[_0xd850('0x18')]?_0x186c2f[_0xd850('0x18')][_0xd850('0x1c')]?_[_0xd850('0x1d')](_0x186c2f['options'][_0xd850('0x1c')],function(_0x9ed981){return{'model':db[_0x9ed981[_0xd850('0x1e')]],'as':_0x9ed981['as'],'attributes':_0x9ed981[_0xd850('0x1b')],'include':_0x9ed981[_0xd850('0x1c')]?_[_0xd850('0x1d')](_0x9ed981[_0xd850('0x1c')],function(_0x50095c){return{'model':db[_0x50095c[_0xd850('0x1e')]],'as':_0x50095c['as'],'attributes':_0x50095c[_0xd850('0x1b')],'include':_0x50095c[_0xd850('0x1c')]?_[_0xd850('0x1d')](_0x50095c[_0xd850('0x1c')],function(_0x129f87){return{'model':db[_0x129f87[_0xd850('0x1e')]],'as':_0x129f87['as'],'attributes':_0x129f87[_0xd850('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd850('0xc')](function(_0x386fd7){logger[_0xd850('0xd')](_0xd850('0x21'),_0x186c2f);logger[_0xd850('0x20')]('ShowTrigger',_0x186c2f,JSON['stringify'](_0x386fd7));_0x4e1bd4(_0x386fd7);})[_0xd850('0x16')](function(_0x48d84a){logger[_0xd850('0x11')](_0xd850('0x21'),_0x48d84a[_0xd850('0x13')],_0x186c2f);_0x229fd2(_0x586ac1[_0xd850('0x11')](0x1f4,_0x48d84a[_0xd850('0x13')]));});});};
\ No newline at end of file
+var _0xb079=['Trigger,\x20%s,\x20%s,\x20%s','stringify','error','Trigger,\x20%s,\x20%s','message','result','GetTrigger','Trigger','findAll','raw','options','where','attributes','limit','include','model','map','debug','catch','ShowTrigger','find','then','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','request\x20sent'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0xb079,0x126));var _0x9b07=function(_0x5654ed,_0x4514fa){_0x5654ed=_0x5654ed-0x0;var _0x2331c1=_0xb079[_0x5654ed];return _0x2331c1;};'use strict';var _=require('lodash');var util=require(_0x9b07('0x0'));var moment=require(_0x9b07('0x1'));var BPromise=require('bluebird');var rs=require(_0x9b07('0x2'));var fs=require('fs');var Redis=require(_0x9b07('0x3'));var db=require(_0x9b07('0x4'))['db'];var utils=require(_0x9b07('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x9b07('0x6'));var jayson=require(_0x9b07('0x7'));var client=jayson[_0x9b07('0x8')][_0x9b07('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c0b98,_0x19833b,_0x118e97){return new BPromise(function(_0x4afa44,_0x276bec){return client['request'](_0x5c0b98,_0x118e97)['then'](function(_0x3e9ee3){logger[_0x9b07('0xa')]('Trigger,\x20%s,\x20%s',_0x19833b,_0x9b07('0xb'));logger['debug'](_0x9b07('0xc'),_0x19833b,_0x9b07('0xb'),JSON[_0x9b07('0xd')](_0x3e9ee3));if(_0x3e9ee3[_0x9b07('0xe')]){if(_0x3e9ee3['error']['code']===0x1f4){logger[_0x9b07('0xe')](_0x9b07('0xf'),_0x19833b,_0x3e9ee3['error'][_0x9b07('0x10')]);return _0x276bec(_0x3e9ee3[_0x9b07('0xe')][_0x9b07('0x10')]);}logger[_0x9b07('0xe')]('Trigger,\x20%s,\x20%s',_0x19833b,_0x3e9ee3[_0x9b07('0xe')][_0x9b07('0x10')]);return _0x4afa44(_0x3e9ee3[_0x9b07('0xe')][_0x9b07('0x10')]);}else{logger[_0x9b07('0xa')](_0x9b07('0xf'),_0x19833b,_0x9b07('0xb'));_0x4afa44(_0x3e9ee3[_0x9b07('0x11')][_0x9b07('0x10')]);}})['catch'](function(_0x33a1e9){logger[_0x9b07('0xe')](_0x9b07('0xf'),_0x19833b,_0x33a1e9);_0x276bec(_0x33a1e9);});});}exports[_0x9b07('0x12')]=function(_0x329e01){var _0x48c338=this;return new Promise(function(_0x4d876e,_0x40f26b){return db[_0x9b07('0x13')][_0x9b07('0x14')]({'raw':_0x329e01['options']?_0x329e01['options'][_0x9b07('0x15')]===undefined?!![]:![]:!![],'where':_0x329e01[_0x9b07('0x16')]?_0x329e01[_0x9b07('0x16')][_0x9b07('0x17')]||null:null,'attributes':_0x329e01[_0x9b07('0x16')]?_0x329e01['options'][_0x9b07('0x18')]||null:null,'limit':_0x329e01[_0x9b07('0x16')]?_0x329e01[_0x9b07('0x16')][_0x9b07('0x19')]||null:null,'include':_0x329e01[_0x9b07('0x16')]?_0x329e01[_0x9b07('0x16')][_0x9b07('0x1a')]?_['map'](_0x329e01[_0x9b07('0x16')][_0x9b07('0x1a')],function(_0x2260ec){return{'model':db[_0x2260ec[_0x9b07('0x1b')]],'as':_0x2260ec['as'],'attributes':_0x2260ec['attributes'],'include':_0x2260ec[_0x9b07('0x1a')]?_[_0x9b07('0x1c')](_0x2260ec[_0x9b07('0x1a')],function(_0x1d1d14){return{'model':db[_0x1d1d14[_0x9b07('0x1b')]],'as':_0x1d1d14['as'],'attributes':_0x1d1d14[_0x9b07('0x18')],'include':_0x1d1d14[_0x9b07('0x1a')]?_[_0x9b07('0x1c')](_0x1d1d14[_0x9b07('0x1a')],function(_0x4f28f0){return{'model':db[_0x4f28f0[_0x9b07('0x1b')]],'as':_0x4f28f0['as'],'attributes':_0x4f28f0[_0x9b07('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x520354){logger[_0x9b07('0xa')]('GetTrigger',_0x329e01);logger[_0x9b07('0x1d')](_0x9b07('0x12'),_0x329e01,JSON[_0x9b07('0xd')](_0x520354));_0x4d876e(_0x520354);})[_0x9b07('0x1e')](function(_0x4e4f22){logger[_0x9b07('0xe')](_0x9b07('0x12'),_0x4e4f22[_0x9b07('0x10')],_0x329e01);_0x40f26b(_0x48c338[_0x9b07('0xe')](0x1f4,_0x4e4f22[_0x9b07('0x10')]));});});};exports[_0x9b07('0x1f')]=function(_0x4ffca7){var _0x279576=this;return new Promise(function(_0x44fff4,_0x2bfe57){return db[_0x9b07('0x13')][_0x9b07('0x20')]({'raw':_0x4ffca7[_0x9b07('0x16')]?_0x4ffca7[_0x9b07('0x16')][_0x9b07('0x15')]===undefined?!![]:![]:!![],'where':_0x4ffca7['options']?_0x4ffca7[_0x9b07('0x16')][_0x9b07('0x17')]||null:null,'attributes':_0x4ffca7['options']?_0x4ffca7[_0x9b07('0x16')][_0x9b07('0x18')]||null:null,'include':_0x4ffca7[_0x9b07('0x16')]?_0x4ffca7[_0x9b07('0x16')][_0x9b07('0x1a')]?_[_0x9b07('0x1c')](_0x4ffca7[_0x9b07('0x16')][_0x9b07('0x1a')],function(_0x2f36ed){return{'model':db[_0x2f36ed[_0x9b07('0x1b')]],'as':_0x2f36ed['as'],'attributes':_0x2f36ed['attributes'],'include':_0x2f36ed[_0x9b07('0x1a')]?_['map'](_0x2f36ed['include'],function(_0x74aff4){return{'model':db[_0x74aff4[_0x9b07('0x1b')]],'as':_0x74aff4['as'],'attributes':_0x74aff4['attributes'],'include':_0x74aff4['include']?_[_0x9b07('0x1c')](_0x74aff4[_0x9b07('0x1a')],function(_0x5cb70b){return{'model':db[_0x5cb70b[_0x9b07('0x1b')]],'as':_0x5cb70b['as'],'attributes':_0x5cb70b[_0x9b07('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9b07('0x21')](function(_0x2e6e6e){logger[_0x9b07('0xa')](_0x9b07('0x1f'),_0x4ffca7);logger['debug'](_0x9b07('0x1f'),_0x4ffca7,JSON[_0x9b07('0xd')](_0x2e6e6e));_0x44fff4(_0x2e6e6e);})['catch'](function(_0x40a3d2){logger['error'](_0x9b07('0x1f'),_0x40a3d2['message'],_0x4ffca7);_0x2bfe57(_0x279576['error'](0x1f4,_0x40a3d2[_0x9b07('0x10')]));});});};
\ No newline at end of file
index d5c5454..74653b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32fc=['/:id','update','delete','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trunk.controller','isAuthenticated','show','clone','post','put'];(function(_0x50ce61,_0x4a0267){var _0x5a8e3e=function(_0x3981ba){while(--_0x3981ba){_0x50ce61['push'](_0x50ce61['shift']());}};_0x5a8e3e(++_0x4a0267);}(_0x32fc,0x103));var _0xc32f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x32fc[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc32f('0x0'));var timeout=require(_0xc32f('0x1'));var express=require(_0xc32f('0x2'));var router=express[_0xc32f('0x3')]();var fs_extra=require(_0xc32f('0x4'));var auth=require(_0xc32f('0x5'));var interaction=require(_0xc32f('0x6'));var config=require('../../config/environment');var controller=require(_0xc32f('0x7'));router['get']('/',auth[_0xc32f('0x8')](),controller['index']);router['get']('/:id',auth[_0xc32f('0x8')](),controller[_0xc32f('0x9')]);router['post']('/:id/clone',auth['isAuthenticated'](),controller[_0xc32f('0xa')]);router[_0xc32f('0xb')]('/',auth[_0xc32f('0x8')](),controller['create']);router[_0xc32f('0xc')](_0xc32f('0xd'),auth[_0xc32f('0x8')](),controller[_0xc32f('0xe')]);router[_0xc32f('0xf')](_0xc32f('0xd'),auth[_0xc32f('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x9b02=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated','index','/:id','show','clone','post','put','update','delete','destroy'];(function(_0x24cf01,_0x584693){var _0x16f7b6=function(_0x43e097){while(--_0x43e097){_0x24cf01['push'](_0x24cf01['shift']());}};_0x16f7b6(++_0x584693);}(_0x9b02,0x1cf));var _0x29b0=function(_0x1e4748,_0x424633){_0x1e4748=_0x1e4748-0x0;var _0x241eab=_0x9b02[_0x1e4748];return _0x241eab;};'use strict';var multer=require(_0x29b0('0x0'));var util=require(_0x29b0('0x1'));var path=require(_0x29b0('0x2'));var timeout=require(_0x29b0('0x3'));var express=require(_0x29b0('0x4'));var router=express[_0x29b0('0x5')]();var fs_extra=require(_0x29b0('0x6'));var auth=require(_0x29b0('0x7'));var interaction=require(_0x29b0('0x8'));var config=require(_0x29b0('0x9'));var controller=require(_0x29b0('0xa'));router['get']('/',auth[_0x29b0('0xb')](),controller[_0x29b0('0xc')]);router['get'](_0x29b0('0xd'),auth[_0x29b0('0xb')](),controller[_0x29b0('0xe')]);router['post']('/:id/clone',auth[_0x29b0('0xb')](),controller[_0x29b0('0xf')]);router[_0x29b0('0x10')]('/',auth[_0x29b0('0xb')](),controller['create']);router[_0x29b0('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x29b0('0x12')]);router[_0x29b0('0x13')](_0x29b0('0xd'),auth[_0x29b0('0xb')](),controller[_0x29b0('0x14')]);module[_0x29b0('0x15')]=router;
\ No newline at end of file
index 0255cbe..5f77d41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cb4=['ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','setDataValue','join','getDataValue','transport','split','rfc2833','info','shortinfo','auto','yes','nonat','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','INTEGER','accept','refuse','originate','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','update','update,nonat','BOOLEAN','exports','STRING','name'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x4cb4,0xf2));var _0x44cb=function(_0x47c902,_0x220fd2){_0x47c902=_0x47c902-0x0;var _0x1ad6a0=_0x4cb4[_0x47c902];return _0x1ad6a0;};'use strict';var Sequelize=require('sequelize');module[_0x44cb('0x0')]={'name':{'type':Sequelize[_0x44cb('0x1')],'allowNull':![],'unique':_0x44cb('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x4'),_0x44cb('0x5'),_0x44cb('0x6')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x44cb('0x7')},'callingpres':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x8'),_0x44cb('0x9'),_0x44cb('0xa'),_0x44cb('0xb'),_0x44cb('0xc'),_0x44cb('0xd'),'PROHIB_FAILED_SCREEN',_0x44cb('0xe'))},'deny':{'type':Sequelize[_0x44cb('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x44cb('0x1')]},'md5secret':{'type':Sequelize[_0x44cb('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':'udp','set':function(_0x29f6d9){this[_0x44cb('0xf')]('transport',_0x29f6d9?_0x29f6d9[_0x44cb('0x10')](','):null);},'get':function(){return this[_0x44cb('0x11')](_0x44cb('0x12'))?this['getDataValue'](_0x44cb('0x12'))[_0x44cb('0x13')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x44cb('0x14'),_0x44cb('0x15'),_0x44cb('0x16'),'inband',_0x44cb('0x17')),'defaultValue':_0x44cb('0x14')},'directmedia':{'type':Sequelize['ENUM'](_0x44cb('0x18'),'no',_0x44cb('0x19'),'update','outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x44cb('0x1')],'defaultValue':'force_rport,comedia','set':function(_0x37cb72){this['setDataValue'](_0x44cb('0x1a'),_0x37cb72?_0x37cb72[_0x44cb('0x10')](','):null);},'get':function(){return this[_0x44cb('0x11')](_0x44cb('0x1a'))?this[_0x44cb('0x11')](_0x44cb('0x1a'))[_0x44cb('0x13')](','):null;},'comment':_0x44cb('0x1b')},'callgroup':{'type':Sequelize[_0x44cb('0x1')]},'namedcallgroup':{'type':Sequelize[_0x44cb('0x1')]},'pickupgroup':{'type':Sequelize[_0x44cb('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x44cb('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x44cb('0x1c')},'allow':{'type':Sequelize[_0x44cb('0x1')],'allowNull':![],'defaultValue':_0x44cb('0x1d'),'set':function(_0x5ad073){this[_0x44cb('0xf')](_0x44cb('0x1e'),_0x5ad073?_0x5ad073[_0x44cb('0x10')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x44cb('0x11')]('allow')?this[_0x44cb('0x11')](_0x44cb('0x1e'))[_0x44cb('0x13')](';'):null;},'comment':_0x44cb('0x1f')},'autoframing':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x18'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x44cb('0x20'),'set':function(_0x17246d){this[_0x44cb('0xf')]('insecure',_0x17246d?_0x17246d[_0x44cb('0x10')](','):null);},'get':function(){return this[_0x44cb('0x11')](_0x44cb('0x21'))?this[_0x44cb('0x11')]('insecure')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x44cb('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x18'),'no','never')},'promiscredir':{'type':Sequelize[_0x44cb('0x3')]('yes','no')},'useclientcode':{'type':Sequelize['ENUM'](_0x44cb('0x18'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x44cb('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x44cb('0x1')]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x44cb('0x18')},'busylevel':{'type':Sequelize[_0x44cb('0x22')](0xb)},'allowoverlap':{'type':Sequelize[_0x44cb('0x3')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x18'),'no')},'ignoresdpversion':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0x44cb('0x1')]},'template':{'type':Sequelize[_0x44cb('0x1')]},'videosupport':{'type':Sequelize[_0x44cb('0x3')]('yes','no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x44cb('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x18'),'no')},'mailbox':{'type':Sequelize[_0x44cb('0x1')]},'session_timers':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x23'),_0x44cb('0x24'),_0x44cb('0x25'))},'session_expires':{'type':Sequelize[_0x44cb('0x22')](0xb)},'session_minse':{'type':Sequelize[_0x44cb('0x22')](0xb)},'session_refresher':{'type':Sequelize[_0x44cb('0x3')]('uac',_0x44cb('0x26')),'defaultValue':_0x44cb('0x26')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x44cb('0x1')]},'fromdomain':{'type':Sequelize[_0x44cb('0x1')]},'fromuser':{'type':Sequelize[_0x44cb('0x1')]},'port':{'type':Sequelize[_0x44cb('0x22')](0x5)},'qualify':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x18'),'no'),'defaultValue':_0x44cb('0x18')},'keepalive':{'type':Sequelize[_0x44cb('0x22')](0xb)},'defaultip':{'type':Sequelize[_0x44cb('0x1')]},'defaultuser':{'type':Sequelize[_0x44cb('0x1')]},'rtptimeout':{'type':Sequelize[_0x44cb('0x22')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x44cb('0x22')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x44cb('0x22')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x44cb('0x18'),'no',_0x44cb('0x27')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x44cb('0x1')]},'timert1':{'type':Sequelize[_0x44cb('0x22')](0xb)},'timerb':{'type':Sequelize[_0x44cb('0x22')](0xb)},'qualifyfreq':{'type':Sequelize[_0x44cb('0x22')](0xb)},'contactpermit':{'type':Sequelize[_0x44cb('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x44cb('0x1')]},'maxforwards':{'type':Sequelize[_0x44cb('0x22')](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x18'),'no')},'force_avp':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x18'),'no')},'icesupport':{'type':Sequelize[_0x44cb('0x3')]('yes','no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x44cb('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0x44cb('0x3')]('yes','no',_0x44cb('0x28'),_0x44cb('0x29'))},'dtlsrekey':{'type':Sequelize[_0x44cb('0x22')](0xb)},'dtlscertfile':{'type':Sequelize[_0x44cb('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x44cb('0x1')]},'dtlscipher':{'type':Sequelize[_0x44cb('0x1')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x2a'),_0x44cb('0x2b'),_0x44cb('0x2c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x44cb('0x1')]},'usereqphone':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x44cb('0x1')]},'recordofffeature':{'type':Sequelize[_0x44cb('0x1')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x18'),'no')},'subscribemwi':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x18'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x44cb('0x1')]},'mohsuggest':{'type':Sequelize[_0x44cb('0x1')]},'parkinglot':{'type':Sequelize[_0x44cb('0x1')]},'description':{'type':Sequelize[_0x44cb('0x1')]},'host':{'type':Sequelize[_0x44cb('0x1')],'defaultValue':_0x44cb('0x2d')},'canreinvite':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x18'),'no',_0x44cb('0x19'),_0x44cb('0x2e'),_0x44cb('0x2f')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x44cb('0x1')]},'otherFields':{'type':Sequelize[_0x44cb('0x1')]},'active':{'type':Sequelize[_0x44cb('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x44cb('0x1')],'defaultValue':'no'}};
\ No newline at end of file
+var _0x096b=['user','friend','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','yes','nonat','outgoing','force_rport,comedia','setDataValue','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','active','passive','actpass','BOOLEAN','sequelize','exports','STRING','name','ENUM'];(function(_0x200f30,_0x1c8cb1){var _0x1d4dc7=function(_0x55669e){while(--_0x55669e){_0x200f30['push'](_0x200f30['shift']());}};_0x1d4dc7(++_0x1c8cb1);}(_0x096b,0x139));var _0xb096=function(_0x1cfa55,_0x20eeb5){_0x1cfa55=_0x1cfa55-0x0;var _0x3a8424=_0x096b[_0x1cfa55];return _0x3a8424;};'use strict';var Sequelize=require(_0xb096('0x0'));module[_0xb096('0x1')]={'name':{'type':Sequelize[_0xb096('0x2')],'allowNull':![],'unique':_0xb096('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xb096('0x4')]('friend',_0xb096('0x5'),'peer'),'allowNull':![],'defaultValue':_0xb096('0x6')},'context':{'type':Sequelize[_0xb096('0x2')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize['ENUM'](_0xb096('0x7'),'ALLOWED_PASSED_SCREEN',_0xb096('0x8'),_0xb096('0x9'),_0xb096('0xa'),'PROHIB_PASSED_SCREEN',_0xb096('0xb'),_0xb096('0xc'))},'deny':{'type':Sequelize[_0xb096('0x2')]},'permit':{'type':Sequelize[_0xb096('0x2')]},'secret':{'type':Sequelize[_0xb096('0x2')]},'md5secret':{'type':Sequelize[_0xb096('0x2')]},'remotesecret':{'type':Sequelize[_0xb096('0x2')]},'transport':{'type':Sequelize[_0xb096('0x2')],'defaultValue':_0xb096('0xd'),'set':function(_0x55a2ff){this['setDataValue'](_0xb096('0xe'),_0x55a2ff?_0x55a2ff[_0xb096('0xf')](','):null);},'get':function(){return this[_0xb096('0x10')](_0xb096('0xe'))?this[_0xb096('0x10')](_0xb096('0xe'))[_0xb096('0x11')](','):null;},'comment':_0xb096('0x12')},'dtmfmode':{'type':Sequelize[_0xb096('0x4')](_0xb096('0x13'),_0xb096('0x14'),_0xb096('0x15'),_0xb096('0x16'),'auto'),'defaultValue':_0xb096('0x13')},'directmedia':{'type':Sequelize[_0xb096('0x4')](_0xb096('0x17'),'no',_0xb096('0x18'),'update',_0xb096('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xb096('0x4')](_0xb096('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xb096('0x2')]},'directmediadeny':{'type':Sequelize[_0xb096('0x2')]},'nat':{'type':Sequelize[_0xb096('0x2')],'defaultValue':_0xb096('0x1a'),'set':function(_0x5d2c77){this[_0xb096('0x1b')]('nat',_0x5d2c77?_0x5d2c77[_0xb096('0xf')](','):null);},'get':function(){return this['getDataValue'](_0xb096('0x1c'))?this[_0xb096('0x10')]('nat')['split'](','):null;},'comment':_0xb096('0x1d')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xb096('0x2')]},'pickupgroup':{'type':Sequelize[_0xb096('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xb096('0x2')]},'language':{'type':Sequelize[_0xb096('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xb096('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xb096('0x2')],'defaultValue':_0xb096('0x1e')},'allow':{'type':Sequelize[_0xb096('0x2')],'allowNull':![],'defaultValue':_0xb096('0x1f'),'set':function(_0x17f91e){this[_0xb096('0x1b')](_0xb096('0x20'),_0x17f91e?_0x17f91e[_0xb096('0xf')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xb096('0x10')](_0xb096('0x20'))?this[_0xb096('0x10')](_0xb096('0x20'))['split'](';'):null;},'comment':_0xb096('0x21')},'autoframing':{'type':Sequelize['ENUM'](_0xb096('0x17'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0xb096('0x22'),'set':function(_0x1ee508){this[_0xb096('0x1b')]('insecure',_0x1ee508?_0x1ee508[_0xb096('0xf')](','):null);},'get':function(){return this['getDataValue'](_0xb096('0x23'))?this[_0xb096('0x10')]('insecure')[_0xb096('0x11')](','):null;},'comment':_0xb096('0x24')},'trustrpid':{'type':Sequelize[_0xb096('0x4')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xb096('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xb096('0x17'),'no',_0xb096('0x25'))},'promiscredir':{'type':Sequelize[_0xb096('0x4')](_0xb096('0x17'),'no')},'useclientcode':{'type':Sequelize['ENUM']('yes','no')},'accountcode':{'type':Sequelize[_0xb096('0x26')](0xb)},'setvar':{'type':Sequelize[_0xb096('0x2')]},'callerid':{'type':Sequelize[_0xb096('0x2')],'defaultValue':_0xb096('0x27')},'amaflags':{'type':Sequelize[_0xb096('0x2')]},'callcounter':{'type':Sequelize['ENUM'](_0xb096('0x17'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0xb096('0x4')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0xb096('0x4')]('yes','no')},'allowtransfer':{'type':Sequelize['ENUM'](_0xb096('0x17'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xb096('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0xb096('0x2')]},'template':{'type':Sequelize[_0xb096('0x2')]},'videosupport':{'type':Sequelize['ENUM'](_0xb096('0x17'),'no',_0xb096('0x28')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xb096('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xb096('0x17'),'no')},'mailbox':{'type':Sequelize[_0xb096('0x2')]},'session_timers':{'type':Sequelize[_0xb096('0x4')](_0xb096('0x29'),_0xb096('0x2a'),_0xb096('0x2b'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0xb096('0x26')](0xb)},'session_refresher':{'type':Sequelize[_0xb096('0x4')](_0xb096('0x2c'),_0xb096('0x2d')),'defaultValue':_0xb096('0x2d')},'t38pt_usertpsource':{'type':Sequelize[_0xb096('0x2')]},'regexten':{'type':Sequelize[_0xb096('0x2')]},'fromdomain':{'type':Sequelize[_0xb096('0x2')]},'fromuser':{'type':Sequelize[_0xb096('0x2')]},'port':{'type':Sequelize[_0xb096('0x26')](0x5)},'qualify':{'type':Sequelize[_0xb096('0x4')](_0xb096('0x17'),'no'),'defaultValue':_0xb096('0x17')},'keepalive':{'type':Sequelize[_0xb096('0x26')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0xb096('0x2')]},'rtptimeout':{'type':Sequelize[_0xb096('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xb096('0x26')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0xb096('0x4')](_0xb096('0x17'),'no',_0xb096('0x2e')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0xb096('0x2')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xb096('0x2')]},'contactacl':{'type':Sequelize[_0xb096('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0xb096('0x26')](0xb)},'encryption':{'type':Sequelize[_0xb096('0x4')](_0xb096('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xb096('0x4')](_0xb096('0x17'),'no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize[_0xb096('0x4')](_0xb096('0x17'),'no')},'dtlsenable':{'type':Sequelize['ENUM']('yes','no')},'dtlsverify':{'type':Sequelize[_0xb096('0x4')]('yes','no',_0xb096('0x2f'),_0xb096('0x30'))},'dtlsrekey':{'type':Sequelize[_0xb096('0x26')](0xb)},'dtlscertfile':{'type':Sequelize[_0xb096('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xb096('0x2')]},'dtlscipher':{'type':Sequelize[_0xb096('0x2')]},'dtlscafile':{'type':Sequelize[_0xb096('0x2')]},'dtlscapath':{'type':Sequelize[_0xb096('0x2')]},'dtlssetup':{'type':Sequelize[_0xb096('0x4')](_0xb096('0x31'),_0xb096('0x32'),_0xb096('0x33')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xb096('0x2')]},'usereqphone':{'type':Sequelize[_0xb096('0x4')](_0xb096('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0xb096('0x2')]},'call_limit':{'type':Sequelize[_0xb096('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xb096('0x4')](_0xb096('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0xb096('0x4')](_0xb096('0x17'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0xb096('0x2')]},'mohsuggest':{'type':Sequelize[_0xb096('0x2')]},'parkinglot':{'type':Sequelize[_0xb096('0x2')]},'description':{'type':Sequelize[_0xb096('0x2')]},'host':{'type':Sequelize[_0xb096('0x2')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize['ENUM'](_0xb096('0x17'),'no',_0xb096('0x18'),'update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0xb096('0x2')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xb096('0x34')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xb096('0x2')],'defaultValue':'no'}};
\ No newline at end of file
index a95eee6..b2a0422 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3cd=['length','limit','sort','where','filter','merge','options','Trunk','includeAll','include','findAll','show','find','clone','createdAt','updatedAt','omit','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Trunks','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','server/files/templates/registry.ejs','utf8','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','userProfileId','autoAssociation','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','undefined','offset','count','json','reject','save','update','get','UserProfileResource','destroy','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields'];(function(_0x8ddc9a,_0x574925){var _0x27d767=function(_0x3c9e33){while(--_0x3c9e33){_0x8ddc9a['push'](_0x8ddc9a['shift']());}};_0x27d767(++_0x574925);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x3a60b8,_0x47caab){_0x3a60b8=_0x3a60b8-0x0;var _0x4eb583=_0xf3cd[_0x3a60b8];return _0x4eb583;};'use strict';var emlformat=require(_0xdf3c('0x0'));var rimraf=require(_0xdf3c('0x1'));var zipdir=require(_0xdf3c('0x2'));var jsonpatch=require(_0xdf3c('0x3'));var rp=require(_0xdf3c('0x4'));var moment=require(_0xdf3c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdf3c('0x6'));var util=require(_0xdf3c('0x7'));var path=require(_0xdf3c('0x8'));var sox=require('sox');var csv=require(_0xdf3c('0x9'));var ejs=require(_0xdf3c('0xa'));var fs=require('fs');var fs_extra=require(_0xdf3c('0xb'));var _=require(_0xdf3c('0xc'));var squel=require(_0xdf3c('0xd'));var crypto=require(_0xdf3c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdf3c('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdf3c('0x10'));var Redis=require(_0xdf3c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdf3c('0x12'));var as=require(_0xdf3c('0x13'));var hardwareService=require(_0xdf3c('0x14'));var logger=require(_0xdf3c('0x15'))(_0xdf3c('0x16'));var utils=require(_0xdf3c('0x17'));var config=require(_0xdf3c('0x18'));var licenseUtil=require(_0xdf3c('0x19'));var db=require('../../mysqldb')['db'];var jayson=require(_0xdf3c('0x1a'));var client=jayson[_0xdf3c('0x1b')][_0xdf3c('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x17319c,_0x59e431,_0x2ae4ad,_0x461079){return new BPromise(function(_0x13ea5f,_0x5e0047){var _0x18aafa=_0x461079||client;return _0x18aafa[_0xdf3c('0x1d')](_0x17319c,_0x2ae4ad)[_0xdf3c('0x1e')](function(_0x4274fd){logger[_0xdf3c('0x1f')](_0xdf3c('0x20'),_0x59e431,_0xdf3c('0x21'));logger[_0xdf3c('0x22')](_0xdf3c('0x23'),_0x59e431,_0xdf3c('0x21'),JSON['stringify'](_0x4274fd));if(_0x4274fd[_0xdf3c('0x24')]){if(_0x4274fd[_0xdf3c('0x24')][_0xdf3c('0x25')]===0x1f4){logger[_0xdf3c('0x24')](_0xdf3c('0x20'),_0x59e431,_0x4274fd[_0xdf3c('0x24')][_0xdf3c('0x26')]);return _0x5e0047(_0x4274fd[_0xdf3c('0x24')][_0xdf3c('0x26')]);}logger[_0xdf3c('0x24')](_0xdf3c('0x20'),_0x59e431,_0x4274fd[_0xdf3c('0x24')][_0xdf3c('0x26')]);return _0x13ea5f(_0x4274fd['error']['message']);}else{logger[_0xdf3c('0x1f')]('Trunk,\x20%s,\x20%s',_0x59e431,_0xdf3c('0x21'));_0x13ea5f(_0x4274fd[_0xdf3c('0x27')][_0xdf3c('0x26')]);}})[_0xdf3c('0x28')](function(_0x33652f){logger[_0xdf3c('0x24')]('Trunk,\x20%s,\x20%s',_0x59e431,_0x33652f);_0x5e0047(_0x33652f);});});}function respondWithStatusCode(_0x22a164,_0x213d75){_0x213d75=_0x213d75||0xcc;return function(_0x13e3ca){if(_0x13e3ca){return _0x22a164[_0xdf3c('0x29')](_0x213d75);}return _0x22a164[_0xdf3c('0x2a')](_0x213d75)[_0xdf3c('0x2b')]();};}function respondWithResult(_0xef54cb,_0x155f54){_0x155f54=_0x155f54||0xc8;return function(_0x18cb46){if(_0x18cb46){return _0xef54cb[_0xdf3c('0x2a')](_0x155f54)['json'](_0x18cb46);}};}function respondWithFilteredResult(_0xd284d7,_0x153daa){return function(_0x4b57a4){if(_0x4b57a4){var _0xdc8962=typeof _0x153daa['offset']==='undefined'&&typeof _0x153daa['limit']===_0xdf3c('0x2c');var _0x186bba=_0x4b57a4['count'];var _0x5c3b5a=_0xdc8962?0x0:_0x153daa[_0xdf3c('0x2d')];var _0x1f2ce4=_0xdc8962?_0x4b57a4[_0xdf3c('0x2e')]:_0x153daa[_0xdf3c('0x2d')]+_0x153daa['limit'];var _0x43ce06;if(_0x1f2ce4>=_0x186bba){_0x1f2ce4=_0x186bba;_0x43ce06=0xc8;}else{_0x43ce06=0xce;}_0xd284d7[_0xdf3c('0x2a')](_0x43ce06);return _0xd284d7['set']('Content-Range',_0x5c3b5a+'-'+_0x1f2ce4+'/'+_0x186bba)[_0xdf3c('0x2f')](_0x4b57a4);}return null;};}function patchUpdates(_0x46f0e3){return function(_0x36937e){try{jsonpatch['apply'](_0x36937e,_0x46f0e3,!![]);}catch(_0x2355f6){return BPromise[_0xdf3c('0x30')](_0x2355f6);}return _0x36937e[_0xdf3c('0x31')]();};}function saveUpdates(_0x10099e,_0x575ae1){return function(_0xda0de0){if(_0xda0de0){return _0xda0de0[_0xdf3c('0x32')](_0x10099e)['then'](function(_0x40ae3d){return _0x40ae3d;});}return null;};}function removeEntity(_0x3daeda,_0x217a65){return function(_0x2287f){if(_0x2287f){return _0x2287f['destroy']()[_0xdf3c('0x1e')](function(){var _0x360d5c=_0x2287f[_0xdf3c('0x33')]({'plain':!![]});var _0x3b9ce8='Trunks';return db[_0xdf3c('0x34')][_0xdf3c('0x35')]({'where':{'type':_0x3b9ce8,'resourceId':_0x360d5c['id']}})['then'](function(){return _0x2287f;});})['then'](function(){_0x3daeda[_0xdf3c('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x216115,_0x5e8130){return function(_0x57faba){if(!_0x57faba){_0x216115['sendStatus'](0x194);}return _0x57faba;};}function handleError(_0x44a478,_0x2ee9ad){_0x2ee9ad=_0x2ee9ad||0x1f4;return function(_0x1d0b8a){logger[_0xdf3c('0x24')](_0x1d0b8a['stack']);if(_0x1d0b8a['name']){delete _0x1d0b8a[_0xdf3c('0x36')];}_0x44a478['status'](_0x2ee9ad)[_0xdf3c('0x37')](_0x1d0b8a);};}exports[_0xdf3c('0x38')]=function(_0x3628ae,_0xcdd731){var _0x1004e9={},_0x1e0cf2={},_0x1c7335={'count':0x0,'rows':[]};var _0x809f3d=_[_0xdf3c('0x39')](db['Trunk'][_0xdf3c('0x3a')],function(_0x54e689){return{'name':_0x54e689['fieldName'],'type':_0x54e689[_0xdf3c('0x3b')]['key']};});_0x1e0cf2[_0xdf3c('0x3c')]=_['map'](_0x809f3d,_0xdf3c('0x36'));_0x1e0cf2[_0xdf3c('0x3d')]=_[_0xdf3c('0x3e')](_0x3628ae[_0xdf3c('0x3d')]);_0x1e0cf2[_0xdf3c('0x3f')]=_[_0xdf3c('0x40')](_0x1e0cf2[_0xdf3c('0x3c')],_0x1e0cf2[_0xdf3c('0x3d')]);_0x1004e9[_0xdf3c('0x41')]=_[_0xdf3c('0x40')](_0x1e0cf2[_0xdf3c('0x3c')],qs[_0xdf3c('0x42')](_0x3628ae['query']['fields']));_0x1004e9[_0xdf3c('0x41')]=_0x1004e9['attributes'][_0xdf3c('0x43')]?_0x1004e9[_0xdf3c('0x41')]:_0x1e0cf2[_0xdf3c('0x3c')];if(!_0x3628ae[_0xdf3c('0x3d')]['hasOwnProperty']('nolimit')){_0x1004e9[_0xdf3c('0x44')]=qs[_0xdf3c('0x44')](_0x3628ae[_0xdf3c('0x3d')]['limit']);_0x1004e9[_0xdf3c('0x2d')]=qs[_0xdf3c('0x2d')](_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x2d')]);}_0x1004e9['order']=qs[_0xdf3c('0x45')](_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x45')]);_0x1004e9[_0xdf3c('0x46')]=qs[_0xdf3c('0x3f')](_['pick'](_0x3628ae[_0xdf3c('0x3d')],_0x1e0cf2[_0xdf3c('0x3f')]),_0x809f3d);if(_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x47')]){_0x1004e9[_0xdf3c('0x46')]=_[_0xdf3c('0x48')](_0x1004e9['where'],{'$or':_['map'](_0x809f3d,function(_0x2c6c6d){if(_0x2c6c6d[_0xdf3c('0x3b')]!=='VIRTUAL'){var _0x5c9885={};_0x5c9885[_0x2c6c6d[_0xdf3c('0x36')]]={'$like':'%'+_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x47')]+'%'};return _0x5c9885;}})});}_0x1004e9=_[_0xdf3c('0x48')]({},_0x1004e9,_0x3628ae[_0xdf3c('0x49')]);var _0x2dbf54={'where':_0x1004e9[_0xdf3c('0x46')]};return db[_0xdf3c('0x4a')][_0xdf3c('0x2e')](_0x2dbf54)['then'](function(_0x129c2a){_0x1c7335[_0xdf3c('0x2e')]=_0x129c2a;if(_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x4b')]){_0x1004e9[_0xdf3c('0x4c')]=[{'all':!![]}];}return db[_0xdf3c('0x4a')][_0xdf3c('0x4d')](_0x1004e9);})['then'](function(_0x1751a8){_0x1c7335['rows']=_0x1751a8;return _0x1c7335;})[_0xdf3c('0x1e')](respondWithFilteredResult(_0xcdd731,_0x1004e9))['catch'](handleError(_0xcdd731,null));};exports[_0xdf3c('0x4e')]=function(_0x28144f,_0x2ec575){var _0x94c5b9={'raw':![],'where':{'id':_0x28144f['params']['id']}},_0x5eef94={};_0x5eef94['model']=_[_0xdf3c('0x3e')](db['Trunk'][_0xdf3c('0x3a')]);_0x5eef94[_0xdf3c('0x3d')]=_[_0xdf3c('0x3e')](_0x28144f[_0xdf3c('0x3d')]);_0x5eef94[_0xdf3c('0x3f')]=_['intersection'](_0x5eef94['model'],_0x5eef94[_0xdf3c('0x3d')]);_0x94c5b9[_0xdf3c('0x41')]=_['intersection'](_0x5eef94[_0xdf3c('0x3c')],qs[_0xdf3c('0x42')](_0x28144f[_0xdf3c('0x3d')][_0xdf3c('0x42')]));_0x94c5b9[_0xdf3c('0x41')]=_0x94c5b9[_0xdf3c('0x41')][_0xdf3c('0x43')]?_0x94c5b9['attributes']:_0x5eef94['model'];if(_0x28144f[_0xdf3c('0x3d')][_0xdf3c('0x4b')]){_0x94c5b9[_0xdf3c('0x4c')]=[{'all':!![]}];}_0x94c5b9=_[_0xdf3c('0x48')]({},_0x94c5b9,_0x28144f[_0xdf3c('0x49')]);return db[_0xdf3c('0x4a')][_0xdf3c('0x4f')](_0x94c5b9)[_0xdf3c('0x1e')](handleEntityNotFound(_0x2ec575,null))[_0xdf3c('0x1e')](respondWithResult(_0x2ec575,null))[_0xdf3c('0x28')](handleError(_0x2ec575,null));};exports[_0xdf3c('0x50')]=function(_0x4cb28f,_0x1eebcf){var _0x47cb74={'where':{'id':_0x4cb28f['params']['id']}},_0x5e7247={};_0x5e7247['model']=_['keys'](db[_0xdf3c('0x4a')][_0xdf3c('0x3a')]);_0x47cb74['attributes']=_[_0xdf3c('0x40')](_0x5e7247[_0xdf3c('0x3c')],qs['fields'](_0x4cb28f[_0xdf3c('0x3d')][_0xdf3c('0x42')]));_0x47cb74[_0xdf3c('0x41')]=_0x47cb74[_0xdf3c('0x41')][_0xdf3c('0x43')]?_0x47cb74[_0xdf3c('0x41')]:_0x5e7247[_0xdf3c('0x3c')];if(_0x4cb28f[_0xdf3c('0x3d')][_0xdf3c('0x4b')]){_0x47cb74[_0xdf3c('0x4c')]=[{'all':!![]}];}_0x47cb74=_[_0xdf3c('0x48')]({},_0x47cb74,_0x4cb28f['options']);return db[_0xdf3c('0x4a')][_0xdf3c('0x4f')](_0x47cb74)[_0xdf3c('0x1e')](handleEntityNotFound(_0x1eebcf,null))['then'](function(_0x245c68){if(_0x245c68){var _0x3e327e=_0x245c68[_0xdf3c('0x33')]({'plain':!![]});_0x3e327e=qs['omit'](_0x3e327e,['id',_0xdf3c('0x51'),_0xdf3c('0x52')]);_0x4cb28f['body']=_[_0xdf3c('0x53')](_0x4cb28f['body'],['id',_0xdf3c('0x51'),_0xdf3c('0x52')]);return db[_0xdf3c('0x4a')][_0xdf3c('0x54')](_[_0xdf3c('0x48')](_0x3e327e,_0x4cb28f[_0xdf3c('0x55')]),{'include':_0x4cb28f[_0xdf3c('0x3d')][_0xdf3c('0x4b')]?[{'all':!![]}]:undefined})[_0xdf3c('0x1e')](function(_0x330730){var _0x283be2=_0x4cb28f[_0xdf3c('0x56')][_0xdf3c('0x33')]({'plain':!![]});if(!_0x283be2)throw new Error(_0xdf3c('0x57'));if(_0x283be2[_0xdf3c('0x58')]===_0xdf3c('0x56')){var _0xd7fb2d=_0x330730['get']({'plain':!![]});var _0x4dade5=_0xdf3c('0x59');return db[_0xdf3c('0x5a')][_0xdf3c('0x4f')]({'where':{'name':_0x4dade5,'userProfileId':_0x283be2['userProfileId']},'raw':!![]})[_0xdf3c('0x1e')](function(_0x5f2765){if(_0x5f2765&&_0x5f2765['autoAssociation']===0x0){return db[_0xdf3c('0x34')][_0xdf3c('0x54')]({'name':_0xd7fb2d[_0xdf3c('0x36')],'resourceId':_0xd7fb2d['id'],'type':_0x5f2765[_0xdf3c('0x36')],'sectionId':_0x5f2765['id']},{})[_0xdf3c('0x1e')](function(){return _0x330730;});}else{return _0x330730;}})[_0xdf3c('0x28')](function(_0x1a31d7){logger[_0xdf3c('0x24')](_0xdf3c('0x5b'),_0x1a31d7);throw _0x1a31d7;});}return _0x330730;});}})[_0xdf3c('0x1e')](respondWithResult(_0x1eebcf,0xc9))[_0xdf3c('0x28')](handleError(_0x1eebcf,null));};exports[_0xdf3c('0x54')]=function(_0x34000c,_0x4be79a,_0x3febac){var _0x2cb0f5;return db[_0xdf3c('0x4a')][_0xdf3c('0x54')](_0x34000c[_0xdf3c('0x55')],{'raw':!![]})['then'](function(_0x18bf4f){_0x2cb0f5=_0x18bf4f;return db[_0xdf3c('0x4a')][_0xdf3c('0x4d')]({'raw':!![]});})[_0xdf3c('0x1e')](function(_0x1efa9c){var _0x50805c=fs[_0xdf3c('0x5c')](path[_0xdf3c('0x5d')](config[_0xdf3c('0x5e')],_0xdf3c('0x5f')),'utf8');var _0xb867a1=fs[_0xdf3c('0x5c')](path[_0xdf3c('0x5d')](config[_0xdf3c('0x5e')],_0xdf3c('0x60')),_0xdf3c('0x61'));var _0x19c851=ejs['render'](_0x50805c,{'trunks':_0x1efa9c||[]});fs[_0xdf3c('0x62')](_0xdf3c('0x63'),_0x19c851);if(_0x2cb0f5['registry']){var _0x52a2e1=ejs[_0xdf3c('0x64')](_0xb867a1,{'trunks':_0x1efa9c||[]});fs[_0xdf3c('0x62')](_0xdf3c('0x65'),_0x52a2e1);}})[_0xdf3c('0x1e')](function(){return respondWithRpcPromise(_0xdf3c('0x66'),_0xdf3c('0x54'),{'module':_0xdf3c('0x67')});})[_0xdf3c('0x1e')](function(){var _0x5e6606=_0x34000c[_0xdf3c('0x56')][_0xdf3c('0x33')]({'plain':!![]});if(!_0x5e6606)throw new Error(_0xdf3c('0x57'));if(_0x5e6606['role']===_0xdf3c('0x56')){var _0x354ff4=_0x2cb0f5[_0xdf3c('0x33')]({'plain':!![]});return db['UserProfileSection'][_0xdf3c('0x4f')]({'where':{'name':_0xdf3c('0x59'),'userProfileId':_0x5e6606[_0xdf3c('0x68')]},'raw':!![]})[_0xdf3c('0x1e')](function(_0xe01538){if(_0xe01538&&_0xe01538[_0xdf3c('0x69')]===0x0){return db['UserProfileResource']['create']({'name':_0x354ff4['name'],'resourceId':_0x354ff4['id'],'type':_0xe01538['name'],'sectionId':_0xe01538['id']},{})['then'](function(){return _0x2cb0f5;});}else{return _0x2cb0f5;}})[_0xdf3c('0x28')](function(_0x3f43a0){logger[_0xdf3c('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f43a0);throw _0x3f43a0;});}return _0x2cb0f5;})[_0xdf3c('0x1e')](respondWithResult(_0x4be79a,0xc9))[_0xdf3c('0x28')](handleError(_0x4be79a,null));};exports[_0xdf3c('0x32')]=function(_0x51e8c6,_0x591936,_0x233718){var _0x4e3517;return db[_0xdf3c('0x4a')]['find']({'where':{'id':_0x51e8c6[_0xdf3c('0x6a')]['id']}})[_0xdf3c('0x1e')](handleEntityNotFound(_0x591936,null))[_0xdf3c('0x1e')](saveUpdates(_0x51e8c6[_0xdf3c('0x55')],null))['then'](function(_0x5148f6){if(_0x5148f6){_0x4e3517=_0x5148f6;return db[_0xdf3c('0x4a')][_0xdf3c('0x4d')]({'raw':!![]});}})[_0xdf3c('0x1e')](function(_0x12a7b0){if(_0x12a7b0){var _0x39d9f0=fs[_0xdf3c('0x5c')](path['join'](config[_0xdf3c('0x5e')],'server/files/templates/trunk.ejs'),_0xdf3c('0x61'));var _0x9c761a=fs[_0xdf3c('0x5c')](path[_0xdf3c('0x5d')](config[_0xdf3c('0x5e')],'server/files/templates/registry.ejs'),_0xdf3c('0x61'));var _0x5c27cc=ejs[_0xdf3c('0x64')](_0x39d9f0,{'trunks':_0x12a7b0||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x5c27cc);var _0x53b0c3=ejs['render'](_0x9c761a,{'trunks':_0x12a7b0||[]});fs[_0xdf3c('0x62')](_0xdf3c('0x65'),_0x53b0c3);return respondWithRpcPromise(_0xdf3c('0x66'),_0xdf3c('0x32'),{'module':_0xdf3c('0x67')});}return null;})[_0xdf3c('0x1e')](function(_0x5c8e5e){if(_0x5c8e5e){return _0x4e3517;}})[_0xdf3c('0x1e')](respondWithResult(_0x591936,null))['catch'](handleError(_0x591936,null));};exports[_0xdf3c('0x35')]=function(_0x389708,_0x2e5f82,_0x15a057){var _0x320452;return db[_0xdf3c('0x4a')][_0xdf3c('0x4f')]({'where':{'id':_0x389708[_0xdf3c('0x6a')]['id']}})[_0xdf3c('0x1e')](handleEntityNotFound(_0x2e5f82,null))[_0xdf3c('0x1e')](removeEntity(_0x2e5f82,null))[_0xdf3c('0x1e')](function(){return db[_0xdf3c('0x4a')][_0xdf3c('0x4d')]({'raw':!![]});})[_0xdf3c('0x1e')](function(_0x55fd73){var _0x118ab5=fs[_0xdf3c('0x5c')](path[_0xdf3c('0x5d')](config[_0xdf3c('0x5e')],'server/files/templates/trunk.ejs'),_0xdf3c('0x61'));var _0x1c8fe4=fs['readFileSync'](path['join'](config[_0xdf3c('0x5e')],_0xdf3c('0x60')),_0xdf3c('0x61'));var _0x1aaf8b=ejs[_0xdf3c('0x64')](_0x118ab5,{'trunks':_0x55fd73});var _0x56fc77=ejs[_0xdf3c('0x64')](_0x1c8fe4,{'trunks':_0x55fd73});fs[_0xdf3c('0x62')](_0xdf3c('0x63'),_0x1aaf8b);fs[_0xdf3c('0x62')](_0xdf3c('0x65'),_0x56fc77);return respondWithRpcPromise(_0xdf3c('0x66'),'destroy',{'module':_0xdf3c('0x67')});})[_0xdf3c('0x28')](handleError(_0x2e5f82,null));};
\ No newline at end of file
+var _0x9c44=['key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','clone','find','omit','createdAt','body','updatedAt','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','params','/etc/asterisk/sip_xcally_registers.conf','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','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','get','Trunks','destroy','stack','name','send','index','Trunk','rawAttributes','fieldName','type'];(function(_0x4cf88d,_0x5de590){var _0x1f49c0=function(_0x3aba91){while(--_0x3aba91){_0x4cf88d['push'](_0x4cf88d['shift']());}};_0x1f49c0(++_0x5de590);}(_0x9c44,0x178));var _0x49c4=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x9c44[_0x13e741];return _0x3f8bb3;};'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'];var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x16')][_0x49c4('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x5f2fd9,_0x1909fe,_0x280996,_0x21f15a){return new BPromise(function(_0x2decee,_0x12777c){var _0x18211c=_0x21f15a||client;return _0x18211c[_0x49c4('0x18')](_0x5f2fd9,_0x280996)[_0x49c4('0x19')](function(_0x58d177){logger[_0x49c4('0x1a')](_0x49c4('0x1b'),_0x1909fe,_0x49c4('0x1c'));logger[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x1909fe,'request\x20sent',JSON[_0x49c4('0x1f')](_0x58d177));if(_0x58d177[_0x49c4('0x20')]){if(_0x58d177['error']['code']===0x1f4){logger[_0x49c4('0x20')](_0x49c4('0x1b'),_0x1909fe,_0x58d177[_0x49c4('0x20')]['message']);return _0x12777c(_0x58d177[_0x49c4('0x20')]['message']);}logger[_0x49c4('0x20')](_0x49c4('0x1b'),_0x1909fe,_0x58d177[_0x49c4('0x20')][_0x49c4('0x21')]);return _0x2decee(_0x58d177[_0x49c4('0x20')][_0x49c4('0x21')]);}else{logger[_0x49c4('0x1a')](_0x49c4('0x1b'),_0x1909fe,_0x49c4('0x1c'));_0x2decee(_0x58d177['result']['message']);}})['catch'](function(_0x1c99b1){logger['error']('Trunk,\x20%s,\x20%s',_0x1909fe,_0x1c99b1);_0x12777c(_0x1c99b1);});});}function respondWithStatusCode(_0x2263ae,_0x15581b){_0x15581b=_0x15581b||0xcc;return function(_0x26c640){if(_0x26c640){return _0x2263ae[_0x49c4('0x22')](_0x15581b);}return _0x2263ae['status'](_0x15581b)['end']();};}function respondWithResult(_0x180276,_0x9cb797){_0x9cb797=_0x9cb797||0xc8;return function(_0x565423){if(_0x565423){return _0x180276[_0x49c4('0x23')](_0x9cb797)[_0x49c4('0x24')](_0x565423);}};}function respondWithFilteredResult(_0x210159,_0xa7a826){return function(_0x531d92){if(_0x531d92){var _0x543ea2=typeof _0xa7a826[_0x49c4('0x25')]==='undefined'&&typeof _0xa7a826[_0x49c4('0x26')]===_0x49c4('0x27');var _0x3f1708=_0x531d92[_0x49c4('0x28')];var _0x5987ae=_0x543ea2?0x0:_0xa7a826[_0x49c4('0x25')];var _0x2b2793=_0x543ea2?_0x531d92[_0x49c4('0x28')]:_0xa7a826[_0x49c4('0x25')]+_0xa7a826[_0x49c4('0x26')];var _0x29f835;if(_0x2b2793>=_0x3f1708){_0x2b2793=_0x3f1708;_0x29f835=0xc8;}else{_0x29f835=0xce;}_0x210159[_0x49c4('0x23')](_0x29f835);return _0x210159[_0x49c4('0x29')](_0x49c4('0x2a'),_0x5987ae+'-'+_0x2b2793+'/'+_0x3f1708)[_0x49c4('0x24')](_0x531d92);}return null;};}function patchUpdates(_0x46f7ea){return function(_0x4ea6ea){try{jsonpatch['apply'](_0x4ea6ea,_0x46f7ea,!![]);}catch(_0x59eb84){return BPromise[_0x49c4('0x2b')](_0x59eb84);}return _0x4ea6ea[_0x49c4('0x2c')]();};}function saveUpdates(_0x1eb035,_0x27e467){return function(_0x28eb47){if(_0x28eb47){return _0x28eb47['update'](_0x1eb035)[_0x49c4('0x19')](function(_0x116eb4){return _0x116eb4;});}return null;};}function removeEntity(_0x2e7a69,_0x24bba9){return function(_0x58e252){if(_0x58e252){return _0x58e252['destroy']()[_0x49c4('0x19')](function(){var _0x9a1bed=_0x58e252[_0x49c4('0x2d')]({'plain':!![]});var _0x13b3b4=_0x49c4('0x2e');return db['UserProfileResource'][_0x49c4('0x2f')]({'where':{'type':_0x13b3b4,'resourceId':_0x9a1bed['id']}})[_0x49c4('0x19')](function(){return _0x58e252;});})[_0x49c4('0x19')](function(){_0x2e7a69['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x85dce2,_0x1991e9){return function(_0x3bec0a){if(!_0x3bec0a){_0x85dce2[_0x49c4('0x22')](0x194);}return _0x3bec0a;};}function handleError(_0x2b45a1,_0x2cf897){_0x2cf897=_0x2cf897||0x1f4;return function(_0x1d1557){logger[_0x49c4('0x20')](_0x1d1557[_0x49c4('0x30')]);if(_0x1d1557['name']){delete _0x1d1557[_0x49c4('0x31')];}_0x2b45a1['status'](_0x2cf897)[_0x49c4('0x32')](_0x1d1557);};}exports[_0x49c4('0x33')]=function(_0x2625a6,_0x1c2830){var _0x4ed4f8={},_0x335f0c={},_0x31f3ff={'count':0x0,'rows':[]};var _0x1c910a=_['map'](db[_0x49c4('0x34')][_0x49c4('0x35')],function(_0x178987){return{'name':_0x178987[_0x49c4('0x36')],'type':_0x178987[_0x49c4('0x37')][_0x49c4('0x38')]};});_0x335f0c[_0x49c4('0x39')]=_[_0x49c4('0x3a')](_0x1c910a,_0x49c4('0x31'));_0x335f0c[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2625a6['query']);_0x335f0c[_0x49c4('0x3d')]=_[_0x49c4('0x3e')](_0x335f0c[_0x49c4('0x39')],_0x335f0c[_0x49c4('0x3b')]);_0x4ed4f8[_0x49c4('0x3f')]=_[_0x49c4('0x3e')](_0x335f0c[_0x49c4('0x39')],qs[_0x49c4('0x40')](_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x40')]));_0x4ed4f8[_0x49c4('0x3f')]=_0x4ed4f8[_0x49c4('0x3f')][_0x49c4('0x41')]?_0x4ed4f8['attributes']:_0x335f0c[_0x49c4('0x39')];if(!_0x2625a6['query'][_0x49c4('0x42')](_0x49c4('0x43'))){_0x4ed4f8[_0x49c4('0x26')]=qs[_0x49c4('0x26')](_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x26')]);_0x4ed4f8['offset']=qs['offset'](_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x25')]);}_0x4ed4f8[_0x49c4('0x44')]=qs[_0x49c4('0x45')](_0x2625a6['query'][_0x49c4('0x45')]);_0x4ed4f8[_0x49c4('0x46')]=qs[_0x49c4('0x3d')](_[_0x49c4('0x47')](_0x2625a6[_0x49c4('0x3b')],_0x335f0c[_0x49c4('0x3d')]),_0x1c910a);if(_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x48')]){_0x4ed4f8[_0x49c4('0x46')]=_['merge'](_0x4ed4f8[_0x49c4('0x46')],{'$or':_['map'](_0x1c910a,function(_0x33696e){if(_0x33696e[_0x49c4('0x37')]!==_0x49c4('0x49')){var _0x258abe={};_0x258abe[_0x33696e[_0x49c4('0x31')]]={'$like':'%'+_0x2625a6['query'][_0x49c4('0x48')]+'%'};return _0x258abe;}})});}_0x4ed4f8=_[_0x49c4('0x4a')]({},_0x4ed4f8,_0x2625a6[_0x49c4('0x4b')]);var _0x254d07={'where':_0x4ed4f8[_0x49c4('0x46')]};return db[_0x49c4('0x34')][_0x49c4('0x28')](_0x254d07)['then'](function(_0x3bac1b){_0x31f3ff['count']=_0x3bac1b;if(_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x4c')]){_0x4ed4f8[_0x49c4('0x4d')]=[{'all':!![]}];}return db[_0x49c4('0x34')][_0x49c4('0x4e')](_0x4ed4f8);})[_0x49c4('0x19')](function(_0x2c6be1){_0x31f3ff['rows']=_0x2c6be1;return _0x31f3ff;})[_0x49c4('0x19')](respondWithFilteredResult(_0x1c2830,_0x4ed4f8))[_0x49c4('0x4f')](handleError(_0x1c2830,null));};exports['show']=function(_0x1e1ac4,_0xaece5f){var _0xfbe179={'raw':![],'where':{'id':_0x1e1ac4['params']['id']}},_0x242afc={};_0x242afc['model']=_[_0x49c4('0x3c')](db['Trunk'][_0x49c4('0x35')]);_0x242afc[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x1e1ac4[_0x49c4('0x3b')]);_0x242afc[_0x49c4('0x3d')]=_[_0x49c4('0x3e')](_0x242afc[_0x49c4('0x39')],_0x242afc['query']);_0xfbe179[_0x49c4('0x3f')]=_[_0x49c4('0x3e')](_0x242afc[_0x49c4('0x39')],qs[_0x49c4('0x40')](_0x1e1ac4[_0x49c4('0x3b')][_0x49c4('0x40')]));_0xfbe179[_0x49c4('0x3f')]=_0xfbe179[_0x49c4('0x3f')][_0x49c4('0x41')]?_0xfbe179[_0x49c4('0x3f')]:_0x242afc['model'];if(_0x1e1ac4['query'][_0x49c4('0x4c')]){_0xfbe179[_0x49c4('0x4d')]=[{'all':!![]}];}_0xfbe179=_['merge']({},_0xfbe179,_0x1e1ac4['options']);return db[_0x49c4('0x34')]['find'](_0xfbe179)['then'](handleEntityNotFound(_0xaece5f,null))[_0x49c4('0x19')](respondWithResult(_0xaece5f,null))[_0x49c4('0x4f')](handleError(_0xaece5f,null));};exports[_0x49c4('0x50')]=function(_0x38c480,_0x2884ca){var _0x16949a={'where':{'id':_0x38c480['params']['id']}},_0x35724e={};_0x35724e[_0x49c4('0x39')]=_[_0x49c4('0x3c')](db[_0x49c4('0x34')][_0x49c4('0x35')]);_0x16949a[_0x49c4('0x3f')]=_[_0x49c4('0x3e')](_0x35724e['model'],qs['fields'](_0x38c480[_0x49c4('0x3b')][_0x49c4('0x40')]));_0x16949a[_0x49c4('0x3f')]=_0x16949a[_0x49c4('0x3f')][_0x49c4('0x41')]?_0x16949a[_0x49c4('0x3f')]:_0x35724e[_0x49c4('0x39')];if(_0x38c480['query'][_0x49c4('0x4c')]){_0x16949a[_0x49c4('0x4d')]=[{'all':!![]}];}_0x16949a=_['merge']({},_0x16949a,_0x38c480[_0x49c4('0x4b')]);return db['Trunk'][_0x49c4('0x51')](_0x16949a)[_0x49c4('0x19')](handleEntityNotFound(_0x2884ca,null))[_0x49c4('0x19')](function(_0x2fe89a){if(_0x2fe89a){var _0x845f7e=_0x2fe89a[_0x49c4('0x2d')]({'plain':!![]});_0x845f7e=qs[_0x49c4('0x52')](_0x845f7e,['id',_0x49c4('0x53'),'updatedAt']);_0x38c480[_0x49c4('0x54')]=_[_0x49c4('0x52')](_0x38c480['body'],['id',_0x49c4('0x53'),_0x49c4('0x55')]);return db['Trunk'][_0x49c4('0x56')](_[_0x49c4('0x4a')](_0x845f7e,_0x38c480['body']),{'include':_0x38c480['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0xc43386){var _0x54947d=_0x38c480[_0x49c4('0x57')][_0x49c4('0x2d')]({'plain':!![]});if(!_0x54947d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54947d[_0x49c4('0x58')]===_0x49c4('0x57')){var _0x5ac9f0=_0xc43386[_0x49c4('0x2d')]({'plain':!![]});var _0x3dcf4c=_0x49c4('0x2e');return db[_0x49c4('0x59')]['find']({'where':{'name':_0x3dcf4c,'userProfileId':_0x54947d[_0x49c4('0x5a')]},'raw':!![]})[_0x49c4('0x19')](function(_0x3cc604){if(_0x3cc604&&_0x3cc604[_0x49c4('0x5b')]===0x0){return db['UserProfileResource'][_0x49c4('0x56')]({'name':_0x5ac9f0['name'],'resourceId':_0x5ac9f0['id'],'type':_0x3cc604['name'],'sectionId':_0x3cc604['id']},{})['then'](function(){return _0xc43386;});}else{return _0xc43386;}})['catch'](function(_0x302251){logger[_0x49c4('0x20')](_0x49c4('0x5c'),_0x302251);throw _0x302251;});}return _0xc43386;});}})[_0x49c4('0x19')](respondWithResult(_0x2884ca,0xc9))['catch'](handleError(_0x2884ca,null));};exports['create']=function(_0x340523,_0x109b81,_0x342326){var _0x295ad0;return db[_0x49c4('0x34')][_0x49c4('0x56')](_0x340523[_0x49c4('0x54')],{'raw':!![]})[_0x49c4('0x19')](function(_0x4d49e0){_0x295ad0=_0x4d49e0;return db[_0x49c4('0x34')]['findAll']({'raw':!![]});})[_0x49c4('0x19')](function(_0x264902){var _0x1a5d4c=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x60')),_0x49c4('0x61'));var _0x13d951=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x62')),_0x49c4('0x61'));var _0x2d5f63=ejs[_0x49c4('0x63')](_0x1a5d4c,{'trunks':_0x264902||[]});fs[_0x49c4('0x64')](_0x49c4('0x65'),_0x2d5f63);if(_0x295ad0['registry']){var _0x5ec201=ejs[_0x49c4('0x63')](_0x13d951,{'trunks':_0x264902||[]});fs[_0x49c4('0x64')]('/etc/asterisk/sip_xcally_registers.conf',_0x5ec201);}})[_0x49c4('0x19')](function(){return respondWithRpcPromise(_0x49c4('0x66'),_0x49c4('0x56'),{'module':_0x49c4('0x67')});})['then'](function(){var _0x5a14a5=_0x340523['user'][_0x49c4('0x2d')]({'plain':!![]});if(!_0x5a14a5)throw new Error(_0x49c4('0x68'));if(_0x5a14a5[_0x49c4('0x58')]===_0x49c4('0x57')){var _0x118fc4=_0x295ad0[_0x49c4('0x2d')]({'plain':!![]});return db[_0x49c4('0x59')][_0x49c4('0x51')]({'where':{'name':_0x49c4('0x2e'),'userProfileId':_0x5a14a5['userProfileId']},'raw':!![]})[_0x49c4('0x19')](function(_0x10fb84){if(_0x10fb84&&_0x10fb84[_0x49c4('0x5b')]===0x0){return db['UserProfileResource'][_0x49c4('0x56')]({'name':_0x118fc4[_0x49c4('0x31')],'resourceId':_0x118fc4['id'],'type':_0x10fb84[_0x49c4('0x31')],'sectionId':_0x10fb84['id']},{})[_0x49c4('0x19')](function(){return _0x295ad0;});}else{return _0x295ad0;}})[_0x49c4('0x4f')](function(_0x2fd749){logger[_0x49c4('0x20')](_0x49c4('0x5c'),_0x2fd749);throw _0x2fd749;});}return _0x295ad0;})['then'](respondWithResult(_0x109b81,0xc9))[_0x49c4('0x4f')](handleError(_0x109b81,null));};exports[_0x49c4('0x69')]=function(_0x85540f,_0x18e82b,_0x1e948a){var _0x4a204d;return db['Trunk'][_0x49c4('0x51')]({'where':{'id':_0x85540f['params']['id']}})[_0x49c4('0x19')](handleEntityNotFound(_0x18e82b,null))['then'](saveUpdates(_0x85540f[_0x49c4('0x54')],null))[_0x49c4('0x19')](function(_0x3b03dd){if(_0x3b03dd){_0x4a204d=_0x3b03dd;return db[_0x49c4('0x34')]['findAll']({'raw':!![]});}})[_0x49c4('0x19')](function(_0x38d7d3){if(_0x38d7d3){var _0x2ceada=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x60')),_0x49c4('0x61'));var _0x46477f=fs[_0x49c4('0x5d')](path['join'](config[_0x49c4('0x5f')],_0x49c4('0x62')),'utf8');var _0x15bee0=ejs['render'](_0x2ceada,{'trunks':_0x38d7d3||[]});fs[_0x49c4('0x64')](_0x49c4('0x65'),_0x15bee0);var _0x1f14a6=ejs[_0x49c4('0x63')](_0x46477f,{'trunks':_0x38d7d3||[]});fs[_0x49c4('0x64')]('/etc/asterisk/sip_xcally_registers.conf',_0x1f14a6);return respondWithRpcPromise(_0x49c4('0x66'),_0x49c4('0x69'),{'module':'chan_sip.so'});}return null;})[_0x49c4('0x19')](function(_0x167e41){if(_0x167e41){return _0x4a204d;}})['then'](respondWithResult(_0x18e82b,null))[_0x49c4('0x4f')](handleError(_0x18e82b,null));};exports[_0x49c4('0x2f')]=function(_0x57b137,_0x37fef1,_0x993d00){var _0x25989a;return db[_0x49c4('0x34')]['find']({'where':{'id':_0x57b137[_0x49c4('0x6a')]['id']}})[_0x49c4('0x19')](handleEntityNotFound(_0x37fef1,null))['then'](removeEntity(_0x37fef1,null))[_0x49c4('0x19')](function(){return db['Trunk']['findAll']({'raw':!![]});})[_0x49c4('0x19')](function(_0x507078){var _0x50fd24=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config['root'],_0x49c4('0x60')),'utf8');var _0x578f4b=fs['readFileSync'](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x62')),_0x49c4('0x61'));var _0x4a5f0b=ejs['render'](_0x50fd24,{'trunks':_0x507078});var _0x348693=ejs['render'](_0x578f4b,{'trunks':_0x507078});fs[_0x49c4('0x64')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4a5f0b);fs[_0x49c4('0x64')](_0x49c4('0x6b'),_0x348693);return respondWithRpcPromise(_0x49c4('0x66'),_0x49c4('0x2f'),{'module':_0x49c4('0x67')});})[_0x49c4('0x4f')](handleError(_0x37fef1,null));};
\ No newline at end of file
index cb845b7..f6a5a27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd5a=['api','path','rimraf','../../config/environment','./trunk.attributes','exports','Trunk','tools_trunks','lodash','util'];(function(_0x5c5b2f,_0x560121){var _0x553cf5=function(_0x1b50ec){while(--_0x1b50ec){_0x5c5b2f['push'](_0x5c5b2f['shift']());}};_0x553cf5(++_0x560121);}(_0xbd5a,0x15c));var _0xabd5=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xbd5a[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0xabd5('0x0'));var util=require(_0xabd5('0x1'));var logger=require('../../config/logger')(_0xabd5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xabd5('0x3'));var rimraf=require(_0xabd5('0x4'));var config=require(_0xabd5('0x5'));var attributes=require(_0xabd5('0x6'));module[_0xabd5('0x7')]=function(_0x13d977,_0x2fa5dc){return _0x13d977['define'](_0xabd5('0x8'),attributes,{'tableName':_0xabd5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8fa8=['./trunk.attributes','exports','define','Trunk','lodash','util','api','bluebird','request-promise'];(function(_0x368e09,_0x2c1517){var _0x14b7df=function(_0x5002af){while(--_0x5002af){_0x368e09['push'](_0x368e09['shift']());}};_0x14b7df(++_0x2c1517);}(_0x8fa8,0x136));var _0x88fa=function(_0x304645,_0x17e126){_0x304645=_0x304645-0x0;var _0x375434=_0x8fa8[_0x304645];return _0x375434;};'use strict';var _=require(_0x88fa('0x0'));var util=require(_0x88fa('0x1'));var logger=require('../../config/logger')(_0x88fa('0x2'));var moment=require('moment');var BPromise=require(_0x88fa('0x3'));var rp=require(_0x88fa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x88fa('0x5'));module[_0x88fa('0x6')]=function(_0x983bcb,_0x4f6f1c){return _0x983bcb[_0x88fa('0x7')](_0x88fa('0x8'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5033400..3d207f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e3c=['attributes','limit','include','map','model','GetTrunk','catch','ShowTrunk','find','where','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','Trunk','findAll','options','raw'];(function(_0x1d3062,_0x3dcbe2){var _0x581c72=function(_0x204c60){while(--_0x204c60){_0x1d3062['push'](_0x1d3062['shift']());}};_0x581c72(++_0x3dcbe2);}(_0x8e3c,0x14e));var _0xc8e3=function(_0x33a6b0,_0x1a54fe){_0x33a6b0=_0x33a6b0-0x0;var _0xee3433=_0x8e3c[_0x33a6b0];return _0xee3433;};'use strict';var _=require(_0xc8e3('0x0'));var util=require(_0xc8e3('0x1'));var moment=require(_0xc8e3('0x2'));var BPromise=require(_0xc8e3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc8e3('0x4'));var db=require(_0xc8e3('0x5'))['db'];var utils=require(_0xc8e3('0x6'));var logger=require(_0xc8e3('0x7'))(_0xc8e3('0x8'));var config=require(_0xc8e3('0x9'));var jayson=require(_0xc8e3('0xa'));var client=jayson[_0xc8e3('0xb')][_0xc8e3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1aee6c,_0x1e29df,_0x4cee22){return new BPromise(function(_0x8681bb,_0x4db1ef){return client[_0xc8e3('0xd')](_0x1aee6c,_0x4cee22)[_0xc8e3('0xe')](function(_0x59d2a7){logger[_0xc8e3('0xf')](_0xc8e3('0x10'),_0x1e29df,_0xc8e3('0x11'));logger[_0xc8e3('0x12')]('Trunk,\x20%s,\x20%s,\x20%s',_0x1e29df,'request\x20sent',JSON[_0xc8e3('0x13')](_0x59d2a7));if(_0x59d2a7[_0xc8e3('0x14')]){if(_0x59d2a7[_0xc8e3('0x14')]['code']===0x1f4){logger[_0xc8e3('0x14')](_0xc8e3('0x10'),_0x1e29df,_0x59d2a7['error']['message']);return _0x4db1ef(_0x59d2a7['error'][_0xc8e3('0x15')]);}logger[_0xc8e3('0x14')](_0xc8e3('0x10'),_0x1e29df,_0x59d2a7[_0xc8e3('0x14')][_0xc8e3('0x15')]);return _0x8681bb(_0x59d2a7[_0xc8e3('0x14')][_0xc8e3('0x15')]);}else{logger['info'](_0xc8e3('0x10'),_0x1e29df,'request\x20sent');_0x8681bb(_0x59d2a7['result'][_0xc8e3('0x15')]);}})['catch'](function(_0x1a363c){logger[_0xc8e3('0x14')](_0xc8e3('0x10'),_0x1e29df,_0x1a363c);_0x4db1ef(_0x1a363c);});});}exports['GetTrunk']=function(_0x3545f7){var _0x30ebf0=this;return new Promise(function(_0x5d3a8c,_0x40660b){return db[_0xc8e3('0x16')][_0xc8e3('0x17')]({'raw':_0x3545f7[_0xc8e3('0x18')]?_0x3545f7[_0xc8e3('0x18')][_0xc8e3('0x19')]===undefined?!![]:![]:!![],'where':_0x3545f7[_0xc8e3('0x18')]?_0x3545f7['options']['where']||null:null,'attributes':_0x3545f7[_0xc8e3('0x18')]?_0x3545f7[_0xc8e3('0x18')][_0xc8e3('0x1a')]||null:null,'limit':_0x3545f7['options']?_0x3545f7[_0xc8e3('0x18')][_0xc8e3('0x1b')]||null:null,'include':_0x3545f7[_0xc8e3('0x18')]?_0x3545f7[_0xc8e3('0x18')][_0xc8e3('0x1c')]?_[_0xc8e3('0x1d')](_0x3545f7['options'][_0xc8e3('0x1c')],function(_0x53a00c){return{'model':db[_0x53a00c[_0xc8e3('0x1e')]],'as':_0x53a00c['as'],'attributes':_0x53a00c[_0xc8e3('0x1a')],'include':_0x53a00c[_0xc8e3('0x1c')]?_[_0xc8e3('0x1d')](_0x53a00c['include'],function(_0x9f5ba){return{'model':db[_0x9f5ba[_0xc8e3('0x1e')]],'as':_0x9f5ba['as'],'attributes':_0x9f5ba[_0xc8e3('0x1a')],'include':_0x9f5ba[_0xc8e3('0x1c')]?_[_0xc8e3('0x1d')](_0x9f5ba['include'],function(_0x5a4068){return{'model':db[_0x5a4068[_0xc8e3('0x1e')]],'as':_0x5a4068['as'],'attributes':_0x5a4068[_0xc8e3('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d3300){logger[_0xc8e3('0xf')](_0xc8e3('0x1f'),_0x3545f7);logger[_0xc8e3('0x12')](_0xc8e3('0x1f'),_0x3545f7,JSON[_0xc8e3('0x13')](_0x2d3300));_0x5d3a8c(_0x2d3300);})[_0xc8e3('0x20')](function(_0x8bdd7e){logger[_0xc8e3('0x14')](_0xc8e3('0x1f'),_0x8bdd7e['message'],_0x3545f7);_0x40660b(_0x30ebf0[_0xc8e3('0x14')](0x1f4,_0x8bdd7e[_0xc8e3('0x15')]));});});};exports[_0xc8e3('0x21')]=function(_0x3a2c61){var _0x537208=this;return new Promise(function(_0x376aba,_0x457553){return db[_0xc8e3('0x16')][_0xc8e3('0x22')]({'raw':_0x3a2c61[_0xc8e3('0x18')]?_0x3a2c61[_0xc8e3('0x18')][_0xc8e3('0x19')]===undefined?!![]:![]:!![],'where':_0x3a2c61[_0xc8e3('0x18')]?_0x3a2c61[_0xc8e3('0x18')][_0xc8e3('0x23')]||null:null,'attributes':_0x3a2c61[_0xc8e3('0x18')]?_0x3a2c61['options'][_0xc8e3('0x1a')]||null:null,'include':_0x3a2c61['options']?_0x3a2c61['options'][_0xc8e3('0x1c')]?_['map'](_0x3a2c61[_0xc8e3('0x18')][_0xc8e3('0x1c')],function(_0x2af839){return{'model':db[_0x2af839[_0xc8e3('0x1e')]],'as':_0x2af839['as'],'attributes':_0x2af839[_0xc8e3('0x1a')],'include':_0x2af839['include']?_[_0xc8e3('0x1d')](_0x2af839[_0xc8e3('0x1c')],function(_0x23d48a){return{'model':db[_0x23d48a[_0xc8e3('0x1e')]],'as':_0x23d48a['as'],'attributes':_0x23d48a[_0xc8e3('0x1a')],'include':_0x23d48a[_0xc8e3('0x1c')]?_[_0xc8e3('0x1d')](_0x23d48a[_0xc8e3('0x1c')],function(_0x36026c){return{'model':db[_0x36026c[_0xc8e3('0x1e')]],'as':_0x36026c['as'],'attributes':_0x36026c[_0xc8e3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc8e3('0xe')](function(_0x12f07e){logger['info'](_0xc8e3('0x21'),_0x3a2c61);logger[_0xc8e3('0x12')]('ShowTrunk',_0x3a2c61,JSON['stringify'](_0x12f07e));_0x376aba(_0x12f07e);})['catch'](function(_0x95e504){logger[_0xc8e3('0x14')](_0xc8e3('0x21'),_0x95e504['message'],_0x3a2c61);_0x457553(_0x537208[_0xc8e3('0x14')](0x1f4,_0x95e504['message']));});});};
\ No newline at end of file
+var _0xdfea=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetTrunk','options','raw','where','include','map','attributes','model','ShowTrunk','Trunk','find','lodash'];(function(_0x411867,_0x51844d){var _0x5a3daf=function(_0x45a0f7){while(--_0x45a0f7){_0x411867['push'](_0x411867['shift']());}};_0x5a3daf(++_0x51844d);}(_0xdfea,0x1cd));var _0xadfe=function(_0xdea3f8,_0x571b85){_0xdea3f8=_0xdea3f8-0x0;var _0x268fb5=_0xdfea[_0xdea3f8];return _0x268fb5;};'use strict';var _=require(_0xadfe('0x0'));var util=require(_0xadfe('0x1'));var moment=require('moment');var BPromise=require(_0xadfe('0x2'));var rs=require(_0xadfe('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xadfe('0x4'))['db'];var utils=require(_0xadfe('0x5'));var logger=require(_0xadfe('0x6'))(_0xadfe('0x7'));var config=require('../../config/environment');var jayson=require(_0xadfe('0x8'));var client=jayson['client'][_0xadfe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15d3b1,_0x253e70,_0x238db5){return new BPromise(function(_0x4ba44f,_0x2bdbf0){return client['request'](_0x15d3b1,_0x238db5)[_0xadfe('0xa')](function(_0x1863e1){logger[_0xadfe('0xb')](_0xadfe('0xc'),_0x253e70,'request\x20sent');logger[_0xadfe('0xd')](_0xadfe('0xe'),_0x253e70,_0xadfe('0xf'),JSON[_0xadfe('0x10')](_0x1863e1));if(_0x1863e1[_0xadfe('0x11')]){if(_0x1863e1['error'][_0xadfe('0x12')]===0x1f4){logger['error'](_0xadfe('0xc'),_0x253e70,_0x1863e1[_0xadfe('0x11')][_0xadfe('0x13')]);return _0x2bdbf0(_0x1863e1[_0xadfe('0x11')][_0xadfe('0x13')]);}logger[_0xadfe('0x11')]('Trunk,\x20%s,\x20%s',_0x253e70,_0x1863e1[_0xadfe('0x11')][_0xadfe('0x13')]);return _0x4ba44f(_0x1863e1['error'][_0xadfe('0x13')]);}else{logger[_0xadfe('0xb')]('Trunk,\x20%s,\x20%s',_0x253e70,'request\x20sent');_0x4ba44f(_0x1863e1[_0xadfe('0x14')][_0xadfe('0x13')]);}})[_0xadfe('0x15')](function(_0x1fa58f){logger[_0xadfe('0x11')](_0xadfe('0xc'),_0x253e70,_0x1fa58f);_0x2bdbf0(_0x1fa58f);});});}exports[_0xadfe('0x16')]=function(_0x3f09c2){var _0x272814=this;return new Promise(function(_0x14219e,_0x338c6f){return db['Trunk']['findAll']({'raw':_0x3f09c2[_0xadfe('0x17')]?_0x3f09c2[_0xadfe('0x17')][_0xadfe('0x18')]===undefined?!![]:![]:!![],'where':_0x3f09c2[_0xadfe('0x17')]?_0x3f09c2[_0xadfe('0x17')][_0xadfe('0x19')]||null:null,'attributes':_0x3f09c2[_0xadfe('0x17')]?_0x3f09c2['options']['attributes']||null:null,'limit':_0x3f09c2[_0xadfe('0x17')]?_0x3f09c2[_0xadfe('0x17')]['limit']||null:null,'include':_0x3f09c2[_0xadfe('0x17')]?_0x3f09c2[_0xadfe('0x17')][_0xadfe('0x1a')]?_[_0xadfe('0x1b')](_0x3f09c2[_0xadfe('0x17')][_0xadfe('0x1a')],function(_0x176a04){return{'model':db[_0x176a04['model']],'as':_0x176a04['as'],'attributes':_0x176a04[_0xadfe('0x1c')],'include':_0x176a04['include']?_[_0xadfe('0x1b')](_0x176a04[_0xadfe('0x1a')],function(_0x1c747b){return{'model':db[_0x1c747b['model']],'as':_0x1c747b['as'],'attributes':_0x1c747b[_0xadfe('0x1c')],'include':_0x1c747b[_0xadfe('0x1a')]?_['map'](_0x1c747b['include'],function(_0x382a22){return{'model':db[_0x382a22[_0xadfe('0x1d')]],'as':_0x382a22['as'],'attributes':_0x382a22[_0xadfe('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xadfe('0xa')](function(_0x41f181){logger[_0xadfe('0xb')](_0xadfe('0x16'),_0x3f09c2);logger[_0xadfe('0xd')]('GetTrunk',_0x3f09c2,JSON[_0xadfe('0x10')](_0x41f181));_0x14219e(_0x41f181);})[_0xadfe('0x15')](function(_0x52f5ed){logger['error'](_0xadfe('0x16'),_0x52f5ed[_0xadfe('0x13')],_0x3f09c2);_0x338c6f(_0x272814['error'](0x1f4,_0x52f5ed[_0xadfe('0x13')]));});});};exports[_0xadfe('0x1e')]=function(_0x51bc69){var _0x43f900=this;return new Promise(function(_0x180987,_0x2a1c49){return db[_0xadfe('0x1f')][_0xadfe('0x20')]({'raw':_0x51bc69[_0xadfe('0x17')]?_0x51bc69['options'][_0xadfe('0x18')]===undefined?!![]:![]:!![],'where':_0x51bc69[_0xadfe('0x17')]?_0x51bc69[_0xadfe('0x17')][_0xadfe('0x19')]||null:null,'attributes':_0x51bc69[_0xadfe('0x17')]?_0x51bc69[_0xadfe('0x17')]['attributes']||null:null,'include':_0x51bc69[_0xadfe('0x17')]?_0x51bc69['options'][_0xadfe('0x1a')]?_['map'](_0x51bc69[_0xadfe('0x17')]['include'],function(_0x4b4c65){return{'model':db[_0x4b4c65['model']],'as':_0x4b4c65['as'],'attributes':_0x4b4c65[_0xadfe('0x1c')],'include':_0x4b4c65[_0xadfe('0x1a')]?_[_0xadfe('0x1b')](_0x4b4c65['include'],function(_0x58645b){return{'model':db[_0x58645b[_0xadfe('0x1d')]],'as':_0x58645b['as'],'attributes':_0x58645b[_0xadfe('0x1c')],'include':_0x58645b[_0xadfe('0x1a')]?_[_0xadfe('0x1b')](_0x58645b[_0xadfe('0x1a')],function(_0x535f2f){return{'model':db[_0x535f2f['model']],'as':_0x535f2f['as'],'attributes':_0x535f2f[_0xadfe('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xadfe('0xa')](function(_0x300c74){logger['info'](_0xadfe('0x1e'),_0x51bc69);logger[_0xadfe('0xd')](_0xadfe('0x1e'),_0x51bc69,JSON[_0xadfe('0x10')](_0x300c74));_0x180987(_0x300c74);})[_0xadfe('0x15')](function(_0x5ca023){logger['error'](_0xadfe('0x1e'),_0x5ca023[_0xadfe('0x13')],_0x51bc69);_0x2a1c49(_0x43f900[_0xadfe('0x11')](0x1f4,_0x5ca023['message']));});});};
\ No newline at end of file
index 8091fc5..0b478b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff20=['getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','/:id/openchannel_accounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','bulkCreate','diskStorage','join','server/files/images/','format','%s-%s','now','originalname','single','file','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','addFaxAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','/:id/whatsapp_accounts','addSquareProjects','createApiKey','put','update','changePassword','delete','removeQueues','removeTeams','/:id','destroy','removeChatInteractions','/:id/mail_interactions','removeSmsInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeWhatsappAccounts','exports','multer','path','connect-timeout','Router','./user.controller','get','isAuthenticated','index','describe','/whoami','whoami','show','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','/:id/queues','/:id/queues_rt','/:id/groups','/:id/recordings','getRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions'];(function(_0x331872,_0x3ccaa5){var _0x396f4f=function(_0x4486c4){while(--_0x4486c4){_0x331872['push'](_0x331872['shift']());}};_0x396f4f(++_0x3ccaa5);}(_0xff20,0x19f));var _0x0ff2=function(_0x112498,_0x1440c8){_0x112498=_0x112498-0x0;var _0x520e4f=_0xff20[_0x112498];return _0x520e4f;};'use strict';var multer=require(_0x0ff2('0x0'));var util=require('util');var path=require(_0x0ff2('0x1'));var timeout=require(_0x0ff2('0x2'));var express=require('express');var router=express[_0x0ff2('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(_0x0ff2('0x4'));router[_0x0ff2('0x5')]('/',auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x7')]);router[_0x0ff2('0x5')]('/describe',auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x8')]);router[_0x0ff2('0x5')](_0x0ff2('0x9'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0xa')]);router[_0x0ff2('0x5')]('/presence',auth[_0x0ff2('0x6')](),controller['getPresence']);router[_0x0ff2('0x5')]('/:id',auth[_0x0ff2('0x6')](),controller[_0x0ff2('0xb')]);router[_0x0ff2('0x5')](_0x0ff2('0xc'),controller[_0x0ff2('0xd')]);router[_0x0ff2('0x5')](_0x0ff2('0xe'),auth[_0x0ff2('0x6')](),controller['getOpenTabs']);router['get'](_0x0ff2('0xf'),auth[_0x0ff2('0x6')](),controller['getContacts']);router[_0x0ff2('0x5')](_0x0ff2('0x10'),auth[_0x0ff2('0x6')](),controller['getQueues']);router[_0x0ff2('0x5')](_0x0ff2('0x11'),auth['isAuthenticated'](),controller['getVoiceQueuesRt']);router[_0x0ff2('0x5')](_0x0ff2('0x12'),auth[_0x0ff2('0x6')](),controller['getGroups']);router[_0x0ff2('0x5')](_0x0ff2('0x13'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x14')]);router[_0x0ff2('0x5')]('/:id/screen_recordings',auth[_0x0ff2('0x6')](),controller['getScreenRecordings']);router[_0x0ff2('0x5')](_0x0ff2('0x15'),auth['isAuthenticated'](),controller[_0x0ff2('0x16')]);router[_0x0ff2('0x5')](_0x0ff2('0x17'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x18')]);router[_0x0ff2('0x5')]('/:id/mail/interactions',auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x19')]);router[_0x0ff2('0x5')](_0x0ff2('0x1a'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x1b')]);router[_0x0ff2('0x5')](_0x0ff2('0x1c'),auth['isAuthenticated'](),controller[_0x0ff2('0x1d')]);router['get'](_0x0ff2('0x1e'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x1f')]);router['get'](_0x0ff2('0x20'),auth['isAuthenticated'](),controller[_0x0ff2('0x21')]);router[_0x0ff2('0x5')](_0x0ff2('0x22'),auth['isAuthenticated'](),controller[_0x0ff2('0x23')]);router[_0x0ff2('0x5')](_0x0ff2('0x24'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x25')]);router['get'](_0x0ff2('0x26'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x27')]);router[_0x0ff2('0x5')](_0x0ff2('0x28'),auth[_0x0ff2('0x6')](),controller['getFaxAccounts']);router['get'](_0x0ff2('0x29'),auth[_0x0ff2('0x6')](),controller['getMailAccounts']);router[_0x0ff2('0x5')](_0x0ff2('0x2a'),auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router['get'](_0x0ff2('0x2b'),auth['isAuthenticated'](),controller['getSmsAccounts']);router[_0x0ff2('0x5')](_0x0ff2('0x2c'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x2d')]);router[_0x0ff2('0x5')]('/:id/whatsapp_accounts',auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x2e')]);router[_0x0ff2('0x5')](_0x0ff2('0x2f'),auth[_0x0ff2('0x6')](),controller['getSquareProjects']);router['get'](_0x0ff2('0x30'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x31')]);router[_0x0ff2('0x5')](_0x0ff2('0x32'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x33')]);router[_0x0ff2('0x34')]('/:id/contacts',auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x35')]);router['post']('/',auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x36')]);router['post'](_0x0ff2('0x37'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x38')]);router[_0x0ff2('0x34')]('/:id/queues',auth['isAuthenticated'](),controller['addQueues']);var upload=multer({'storage':multer[_0x0ff2('0x39')]({'destination':function(_0x4d687a,_0x26e763,_0x428b79){_0x428b79(null,path[_0x0ff2('0x3a')](config['root'],_0x0ff2('0x3b')));},'filename':function(_0x325c53,_0x407104,_0xe1e20a){_0xe1e20a(null,util[_0x0ff2('0x3c')](_0x0ff2('0x3d'),Date[_0x0ff2('0x3e')](),_0x407104[_0x0ff2('0x3f')]));}})});router[_0x0ff2('0x34')](_0x0ff2('0xc'),upload[_0x0ff2('0x40')](_0x0ff2('0x41')),controller['addAvatar']);router['post']('/:id/login',auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x42')]);router[_0x0ff2('0x34')](_0x0ff2('0x43'),auth['isAuthenticated'](),controller[_0x0ff2('0x44')]);router[_0x0ff2('0x34')](_0x0ff2('0x45'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x46')]);router['post'](_0x0ff2('0x47'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x48')]);router[_0x0ff2('0x34')](_0x0ff2('0x20'),auth['isAuthenticated'](),controller[_0x0ff2('0x49')]);router[_0x0ff2('0x34')](_0x0ff2('0x4a'),auth['isAuthenticated'](),controller[_0x0ff2('0x4b')]);router[_0x0ff2('0x34')]('/:id/mail_interactions',auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x4c')]);router[_0x0ff2('0x34')](_0x0ff2('0x4d'),auth['isAuthenticated'](),controller[_0x0ff2('0x4e')]);router[_0x0ff2('0x34')](_0x0ff2('0x4f'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x50')]);router['post'](_0x0ff2('0x51'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x52')]);router[_0x0ff2('0x34')]('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller[_0x0ff2('0x53')]);router[_0x0ff2('0x34')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x0ff2('0x54')]);router[_0x0ff2('0x34')](_0x0ff2('0x29'),auth['isAuthenticated'](),controller['addMailAccounts']);router[_0x0ff2('0x34')](_0x0ff2('0x2a'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x55')]);router[_0x0ff2('0x34')]('/:id/sms_accounts',auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x56')]);router[_0x0ff2('0x34')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x0ff2('0x57')]);router[_0x0ff2('0x34')](_0x0ff2('0x58'),auth[_0x0ff2('0x6')](),controller['addWhatsappAccounts']);router['post']('/:id/square_projects',auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x59')]);router[_0x0ff2('0x34')](_0x0ff2('0x32'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x5a')]);router[_0x0ff2('0x5b')]('/:id',auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x5c')]);router['put']('/:id/password',auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x5d')]);router[_0x0ff2('0x5e')](_0x0ff2('0x10'),auth['isAuthenticated'](),controller[_0x0ff2('0x5f')]);router[_0x0ff2('0x5e')](_0x0ff2('0x20'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x60')]);router[_0x0ff2('0x5e')](_0x0ff2('0x61'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x62')]);router[_0x0ff2('0x5e')]('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0x0ff2('0x63')]);router[_0x0ff2('0x5e')](_0x0ff2('0x64'),auth[_0x0ff2('0x6')](),controller['removeMailInteractions']);router[_0x0ff2('0x5e')](_0x0ff2('0x4d'),auth[_0x0ff2('0x6')](),controller['removeFaxInteractions']);router[_0x0ff2('0x5e')](_0x0ff2('0x4f'),auth['isAuthenticated'](),controller[_0x0ff2('0x65')]);router[_0x0ff2('0x5e')](_0x0ff2('0x51'),auth['isAuthenticated'](),controller[_0x0ff2('0x66')]);router[_0x0ff2('0x5e')](_0x0ff2('0x67'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x68')]);router['delete']('/:id/fax_accounts',auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x69')]);router[_0x0ff2('0x5e')](_0x0ff2('0x29'),auth['isAuthenticated'](),controller['removeMailAccounts']);router[_0x0ff2('0x5e')](_0x0ff2('0x2a'),auth['isAuthenticated'](),controller[_0x0ff2('0x6a')]);router[_0x0ff2('0x5e')](_0x0ff2('0x2b'),auth['isAuthenticated'](),controller[_0x0ff2('0x6b')]);router[_0x0ff2('0x5e')]('/:id/chat_websites',auth['isAuthenticated'](),controller['removeChatWebsites']);router['delete'](_0x0ff2('0x58'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x6c')]);router[_0x0ff2('0x5e')](_0x0ff2('0x2f'),auth['isAuthenticated'](),controller['removeSquareProjects']);router[_0x0ff2('0x5e')](_0x0ff2('0x32'),auth[_0x0ff2('0x6')](),controller['removeApiKey']);module[_0x0ff2('0x6d')]=router;
\ No newline at end of file
+var _0x7774=['logout','/:id/pause','/:id/unpause','unpause','addChatInteractions','/:id/mail_interactions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','put','update','changePassword','delete','removeQueues','destroy','/:id/chat_interactions','/:id/fax_interactions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','whoami','/presence','getPresence','/:id','show','getAvatar','/:id/open_tabs','getContacts','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','/:id/contacts','addContacts','post','bulkCreate','/:id/queues','addQueues','diskStorage','root','server/files/images/','format','%s-%s','originalname','/:id/avatar','single','addAvatar','/:id/login','login'];(function(_0x87ce2e,_0x444182){var _0x4a6659=function(_0x9180cf){while(--_0x9180cf){_0x87ce2e['push'](_0x87ce2e['shift']());}};_0x4a6659(++_0x444182);}(_0x7774,0x104));var _0x4777=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x7774[_0xc6be3a];return _0x56a310;};'use strict';var multer=require(_0x4777('0x0'));var util=require(_0x4777('0x1'));var path=require(_0x4777('0x2'));var timeout=require('connect-timeout');var express=require(_0x4777('0x3'));var router=express['Router']();var fs_extra=require(_0x4777('0x4'));var auth=require(_0x4777('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4777('0x6'));var controller=require(_0x4777('0x7'));router[_0x4777('0x8')]('/',auth[_0x4777('0x9')](),controller[_0x4777('0xa')]);router[_0x4777('0x8')](_0x4777('0xb'),auth['isAuthenticated'](),controller[_0x4777('0xc')]);router[_0x4777('0x8')]('/whoami',auth[_0x4777('0x9')](),controller[_0x4777('0xd')]);router['get'](_0x4777('0xe'),auth[_0x4777('0x9')](),controller[_0x4777('0xf')]);router[_0x4777('0x8')](_0x4777('0x10'),auth[_0x4777('0x9')](),controller[_0x4777('0x11')]);router['get']('/:id/avatar',controller[_0x4777('0x12')]);router['get'](_0x4777('0x13'),auth[_0x4777('0x9')](),controller['getOpenTabs']);router[_0x4777('0x8')]('/:id/contacts',auth[_0x4777('0x9')](),controller[_0x4777('0x14')]);router[_0x4777('0x8')]('/:id/queues',auth[_0x4777('0x9')](),controller[_0x4777('0x15')]);router[_0x4777('0x8')](_0x4777('0x16'),auth[_0x4777('0x9')](),controller[_0x4777('0x17')]);router[_0x4777('0x8')](_0x4777('0x18'),auth[_0x4777('0x9')](),controller['getGroups']);router[_0x4777('0x8')]('/:id/recordings',auth[_0x4777('0x9')](),controller['getRecordings']);router['get'](_0x4777('0x19'),auth[_0x4777('0x9')](),controller[_0x4777('0x1a')]);router[_0x4777('0x8')](_0x4777('0x1b'),auth[_0x4777('0x9')](),controller[_0x4777('0x1c')]);router[_0x4777('0x8')](_0x4777('0x1d'),auth[_0x4777('0x9')](),controller[_0x4777('0x1e')]);router[_0x4777('0x8')]('/:id/mail/interactions',auth[_0x4777('0x9')](),controller['getMailInteractions']);router[_0x4777('0x8')]('/:id/sms/interactions',auth[_0x4777('0x9')](),controller['getSmsInteractions']);router[_0x4777('0x8')]('/:id/fax/interactions',auth['isAuthenticated'](),controller[_0x4777('0x1f')]);router[_0x4777('0x8')](_0x4777('0x20'),auth[_0x4777('0x9')](),controller[_0x4777('0x21')]);router[_0x4777('0x8')](_0x4777('0x22'),auth[_0x4777('0x9')](),controller['getTeams']);router[_0x4777('0x8')](_0x4777('0x23'),auth['isAuthenticated'](),controller[_0x4777('0x24')]);router['get'](_0x4777('0x25'),auth[_0x4777('0x9')](),controller[_0x4777('0x26')]);router['get'](_0x4777('0x27'),auth[_0x4777('0x9')](),controller[_0x4777('0x28')]);router[_0x4777('0x8')](_0x4777('0x29'),auth[_0x4777('0x9')](),controller[_0x4777('0x2a')]);router[_0x4777('0x8')](_0x4777('0x2b'),auth[_0x4777('0x9')](),controller[_0x4777('0x2c')]);router[_0x4777('0x8')](_0x4777('0x2d'),auth[_0x4777('0x9')](),controller[_0x4777('0x2e')]);router['get'](_0x4777('0x2f'),auth[_0x4777('0x9')](),controller[_0x4777('0x30')]);router[_0x4777('0x8')](_0x4777('0x31'),auth['isAuthenticated'](),controller[_0x4777('0x32')]);router[_0x4777('0x8')](_0x4777('0x33'),auth[_0x4777('0x9')](),controller[_0x4777('0x34')]);router['get'](_0x4777('0x35'),auth[_0x4777('0x9')](),controller[_0x4777('0x36')]);router[_0x4777('0x8')](_0x4777('0x37'),auth[_0x4777('0x9')](),controller[_0x4777('0x38')]);router[_0x4777('0x8')](_0x4777('0x39'),auth[_0x4777('0x9')](),controller[_0x4777('0x3a')]);router['post'](_0x4777('0x3b'),auth['isAuthenticated'](),controller[_0x4777('0x3c')]);router[_0x4777('0x3d')]('/',auth[_0x4777('0x9')](),controller['create']);router[_0x4777('0x3d')]('/create_many',auth[_0x4777('0x9')](),controller[_0x4777('0x3e')]);router[_0x4777('0x3d')](_0x4777('0x3f'),auth[_0x4777('0x9')](),controller[_0x4777('0x40')]);var upload=multer({'storage':multer[_0x4777('0x41')]({'destination':function(_0x19f968,_0x347e82,_0x2ac581){_0x2ac581(null,path['join'](config[_0x4777('0x42')],_0x4777('0x43')));},'filename':function(_0x9fb5e2,_0x478190,_0x236083){_0x236083(null,util[_0x4777('0x44')](_0x4777('0x45'),Date['now'](),_0x478190[_0x4777('0x46')]));}})});router[_0x4777('0x3d')](_0x4777('0x47'),upload[_0x4777('0x48')]('file'),controller[_0x4777('0x49')]);router[_0x4777('0x3d')](_0x4777('0x4a'),auth[_0x4777('0x9')](),controller[_0x4777('0x4b')]);router[_0x4777('0x3d')]('/:id/logout',auth[_0x4777('0x9')](),controller[_0x4777('0x4c')]);router[_0x4777('0x3d')](_0x4777('0x4d'),auth[_0x4777('0x9')](),controller['pause']);router[_0x4777('0x3d')](_0x4777('0x4e'),auth[_0x4777('0x9')](),controller[_0x4777('0x4f')]);router[_0x4777('0x3d')](_0x4777('0x22'),auth[_0x4777('0x9')](),controller['addTeams']);router[_0x4777('0x3d')]('/:id/chat_interactions',auth[_0x4777('0x9')](),controller[_0x4777('0x50')]);router['post'](_0x4777('0x51'),auth[_0x4777('0x9')](),controller['addMailInteractions']);router[_0x4777('0x3d')]('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0x4777('0x52')]);router['post'](_0x4777('0x53'),auth[_0x4777('0x9')](),controller['addSmsInteractions']);router[_0x4777('0x3d')](_0x4777('0x54'),auth[_0x4777('0x9')](),controller[_0x4777('0x55')]);router[_0x4777('0x3d')](_0x4777('0x56'),auth[_0x4777('0x9')](),controller[_0x4777('0x57')]);router[_0x4777('0x3d')](_0x4777('0x29'),auth['isAuthenticated'](),controller['addFaxAccounts']);router['post'](_0x4777('0x2b'),auth[_0x4777('0x9')](),controller[_0x4777('0x58')]);router[_0x4777('0x3d')](_0x4777('0x2d'),auth[_0x4777('0x9')](),controller[_0x4777('0x59')]);router[_0x4777('0x3d')](_0x4777('0x2f'),auth[_0x4777('0x9')](),controller[_0x4777('0x5a')]);router[_0x4777('0x3d')](_0x4777('0x31'),auth[_0x4777('0x9')](),controller[_0x4777('0x5b')]);router[_0x4777('0x3d')](_0x4777('0x33'),auth['isAuthenticated'](),controller[_0x4777('0x5c')]);router['post'](_0x4777('0x35'),auth['isAuthenticated'](),controller[_0x4777('0x5d')]);router[_0x4777('0x3d')](_0x4777('0x39'),auth[_0x4777('0x9')](),controller[_0x4777('0x5e')]);router[_0x4777('0x5f')](_0x4777('0x10'),auth[_0x4777('0x9')](),controller[_0x4777('0x60')]);router[_0x4777('0x5f')]('/:id/password',auth[_0x4777('0x9')](),controller[_0x4777('0x61')]);router[_0x4777('0x62')](_0x4777('0x3f'),auth['isAuthenticated'](),controller[_0x4777('0x63')]);router[_0x4777('0x62')]('/:id/teams',auth[_0x4777('0x9')](),controller['removeTeams']);router[_0x4777('0x62')](_0x4777('0x10'),auth[_0x4777('0x9')](),controller[_0x4777('0x64')]);router[_0x4777('0x62')](_0x4777('0x65'),auth[_0x4777('0x9')](),controller['removeChatInteractions']);router['delete'](_0x4777('0x51'),auth['isAuthenticated'](),controller['removeMailInteractions']);router['delete'](_0x4777('0x66'),auth[_0x4777('0x9')](),controller['removeFaxInteractions']);router[_0x4777('0x62')](_0x4777('0x53'),auth[_0x4777('0x9')](),controller['removeSmsInteractions']);router[_0x4777('0x62')](_0x4777('0x54'),auth['isAuthenticated'](),controller[_0x4777('0x67')]);router['delete']('/:id/whatsapp_interactions',auth[_0x4777('0x9')](),controller['removeWhatsappInteractions']);router[_0x4777('0x62')](_0x4777('0x29'),auth['isAuthenticated'](),controller[_0x4777('0x68')]);router[_0x4777('0x62')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x4777('0x69')]);router[_0x4777('0x62')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0x4777('0x6a')]);router[_0x4777('0x62')](_0x4777('0x2f'),auth['isAuthenticated'](),controller[_0x4777('0x6b')]);router[_0x4777('0x62')](_0x4777('0x31'),auth['isAuthenticated'](),controller[_0x4777('0x6c')]);router[_0x4777('0x62')](_0x4777('0x33'),auth[_0x4777('0x9')](),controller[_0x4777('0x6d')]);router['delete'](_0x4777('0x35'),auth[_0x4777('0x9')](),controller['removeSquareProjects']);router['delete']('/:id/api_key',auth['isAuthenticated'](),controller[_0x4777('0x6e')]);module[_0x4777('0x6f')]=router;
\ No newline at end of file
index d29de5a..b35d355 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf494=['avpf','force_avp','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','icesupport','dtlsenable','actpass','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','phoneBarEnableScreenRecordingByAgent','false','screenrecording','loginAttempts','blockedAt','sequelize','moment','util','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','toLowerCase','user','agent','local','INTEGER','accountcode','fullname','BOOLEAN','DATE','friend','peer','from-sip','ENUM','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','always','accept','refuse','originate','uac','uas','certificate','active','passive','TEXT','showWebBar','wss','encryption'];(function(_0x24eb67,_0x4857db){var _0x188041=function(_0x2e2519){while(--_0x2e2519){_0x24eb67['push'](_0x24eb67['shift']());}};_0x188041(++_0x4857db);}(_0xf494,0x1c6));var _0x4f49=function(_0x182e6f,_0x404471){_0x182e6f=_0x182e6f-0x0;var _0x118edc=_0xf494[_0x182e6f];return _0x118edc;};'use strict';var Sequelize=require(_0x4f49('0x0'));var moment=require(_0x4f49('0x1'));var util=require(_0x4f49('0x2'));var _=require('lodash');module[_0x4f49('0x3')]={'name':{'type':Sequelize[_0x4f49('0x4')],'allowNull':![],'unique':_0x4f49('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x25677c){this[_0x4f49('0x6')](_0x4f49('0x5'),_0x25677c);this[_0x4f49('0x6')](_0x4f49('0x7'),_0x25677c);},'comment':_0x4f49('0x8')},'fullname':{'type':Sequelize[_0x4f49('0x4')],'allowNull':![],'set':function(_0x42b0e8){this['setDataValue']('fullname',_0x42b0e8);this[_0x4f49('0x6')](_0x4f49('0x9'),util[_0x4f49('0xa')](_0x4f49('0xb'),_0x42b0e8,this[_0x4f49('0xc')](_0x4f49('0xd'))));}},'alias':{'type':Sequelize[_0x4f49('0x4')]},'email':{'type':Sequelize[_0x4f49('0x4')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x3e464f){if(_0x3e464f){this[_0x4f49('0x6')]('email',_0x3e464f[_0x4f49('0xe')]());}}},'role':{'type':Sequelize['ENUM']('admin',_0x4f49('0xf'),_0x4f49('0x10'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0x4f49('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x4f49('0x4')],'defaultValue':_0x4f49('0x11')},'internal':{'type':Sequelize[_0x4f49('0x12')](0xb),'allowNull':![],'unique':_0x4f49('0xd'),'set':function(_0x2f0131){this[_0x4f49('0x6')]('internal',_0x2f0131);this[_0x4f49('0x6')](_0x4f49('0x13'),_0x2f0131);this[_0x4f49('0x6')]('callerid',util['format'](_0x4f49('0xb'),this[_0x4f49('0xc')](_0x4f49('0x14')),_0x2f0131));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x4f49('0x4')]},'mobile':{'type':Sequelize[_0x4f49('0x4')]},'address':{'type':Sequelize[_0x4f49('0x4')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x4f49('0x16')]},'voicePause':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x4f49('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x4f49('0x16')]},'chatCapacity':{'type':Sequelize[_0x4f49('0x12')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x4f49('0x12')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x4f49('0x12')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x4f49('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x4f49('0x12')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x4f49('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x4f49('0x12')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x4f49('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x4f49('0x12')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0x4f49('0x17'),_0x4f49('0xf'),_0x4f49('0x18')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![],'defaultValue':_0x4f49('0x19')},'callingpres':{'type':Sequelize[_0x4f49('0x1a')]('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0x4f49('0x1b'),_0x4f49('0x1c'),_0x4f49('0x1d'),'PROHIB_PASSED_SCREEN',_0x4f49('0x1e'),_0x4f49('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![],'defaultValue':_0x4f49('0x20'),'set':function(_0x310ee2){this[_0x4f49('0x6')](_0x4f49('0x21'),_0x310ee2?_0x310ee2[_0x4f49('0x22')](','):null);},'get':function(){return this[_0x4f49('0xc')](_0x4f49('0x21'))?this[_0x4f49('0xc')](_0x4f49('0x21'))[_0x4f49('0x23')](','):null;},'comment':_0x4f49('0x24')},'dtmfmode':{'type':Sequelize['ENUM'](_0x4f49('0x25'),_0x4f49('0x26'),_0x4f49('0x27'),_0x4f49('0x28'),_0x4f49('0x29')),'allowNull':!![],'defaultValue':_0x4f49('0x25')},'directmedia':{'type':Sequelize[_0x4f49('0x1a')](_0x4f49('0x2a'),'no',_0x4f49('0x2b'),_0x4f49('0x2c'),_0x4f49('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x4f49('0x1a')](_0x4f49('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![],'defaultValue':_0x4f49('0x2e'),'set':function(_0x26014f){this[_0x4f49('0x6')](_0x4f49('0x2f'),_0x26014f?_0x26014f[_0x4f49('0x22')](','):null);},'get':function(){return this[_0x4f49('0xc')](_0x4f49('0x2f'))?this[_0x4f49('0xc')](_0x4f49('0x2f'))[_0x4f49('0x23')](','):null;},'comment':_0x4f49('0x30')},'callgroup':{'type':Sequelize[_0x4f49('0x4')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x4f49('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x4f49('0x4')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x4f49('0x4')]},'disallow':{'type':Sequelize[_0x4f49('0x4')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x4f49('0x4')],'allowNull':![],'defaultValue':_0x4f49('0x31'),'set':function(_0x2548ad){this[_0x4f49('0x6')](_0x4f49('0x32'),_0x2548ad?_0x2548ad[_0x4f49('0x22')](';'):_0x4f49('0x31'));},'get':function(){return this['getDataValue']('allow')?this['getDataValue'](_0x4f49('0x32'))[_0x4f49('0x23')](';'):null;},'comment':_0x4f49('0x33')},'autoframing':{'type':Sequelize[_0x4f49('0x1a')](_0x4f49('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![],'set':function(_0x38aff8){this[_0x4f49('0x6')](_0x4f49('0x34'),_0x38aff8?_0x38aff8['join'](','):null);},'get':function(){return this['getDataValue'](_0x4f49('0x34'))?this[_0x4f49('0xc')](_0x4f49('0x34'))['split'](','):null;},'comment':_0x4f49('0x35')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x4f49('0x1a')](_0x4f49('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x4f49('0x1a')]('yes','no',_0x4f49('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x4f49('0x1a')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x4f49('0x1a')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x4f49('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x4f49('0x1a')](_0x4f49('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x4f49('0x2a')},'busylevel':{'type':Sequelize[_0x4f49('0x12')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x4f49('0x1a')](_0x4f49('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x4f49('0x1a')](_0x4f49('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x4f49('0x1a')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x4f49('0x1a')](_0x4f49('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x4f49('0x2a'),'no',_0x4f49('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x4f49('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x4f49('0x1a')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x4f49('0x1a')](_0x4f49('0x38'),_0x4f49('0x39'),_0x4f49('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x4f49('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x4f49('0x12')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x4f49('0x1a')](_0x4f49('0x3b'),_0x4f49('0x3c')),'allowNull':!![],'defaultValue':_0x4f49('0x3c')},'t38pt_usertpsource':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x4f49('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x4f49('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x4f49('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x4f49('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x4f49('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x4f49('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x4f49('0x12')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x4f49('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x4f49('0x12')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x4f49('0x12')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x4f49('0x1a')](_0x4f49('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x4f49('0x1a')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x4f49('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x4f49('0x1a')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x4f49('0x1a')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x4f49('0x2a'),'no','fingerprint',_0x4f49('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x4f49('0x1a')](_0x4f49('0x3e'),_0x4f49('0x3f'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x4f49('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x4f49('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x4f49('0x1a')](_0x4f49('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0x4f49('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x4f49('0x1a')](_0x4f49('0x2a'),'no',_0x4f49('0x2b'),_0x4f49('0x2c'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x4f49('0x16')]},'passwordResetAt':{'type':Sequelize[_0x4f49('0x16')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x4f49('0x40')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x1dade6){this[_0x4f49('0x6')](_0x4f49('0x41'),_0x1dade6);var _0x196552=this['get']({'plain':!![]});switch(_0x1dade6){case 0x0:case 0x1:var _0x22df72=_0x196552[_0x4f49('0x21')]?_['isArray'](_0x196552[_0x4f49('0x21')])?_0x196552[_0x4f49('0x21')][_0x4f49('0x22')]():_0x196552[_0x4f49('0x21')]:_0x4f49('0x20');if(_0x22df72===_0x4f49('0x42')){_0x22df72=_0x4f49('0x20');}this[_0x4f49('0x6')]('transport',_0x22df72);this[_0x4f49('0x6')](_0x4f49('0x43'),'no');this[_0x4f49('0x6')](_0x4f49('0x44'),null);this[_0x4f49('0x6')](_0x4f49('0x45'),null);this[_0x4f49('0x6')]('icesupport',null);this[_0x4f49('0x6')]('dtlsenable',null);this[_0x4f49('0x6')](_0x4f49('0x46'),null);this[_0x4f49('0x6')](_0x4f49('0x47'),null);this[_0x4f49('0x6')](_0x4f49('0x48'),null);this[_0x4f49('0x6')](_0x4f49('0x49'),null);this[_0x4f49('0x6')](_0x4f49('0x4a'),'no');break;case 0x2:this['setDataValue'](_0x4f49('0x21'),_0x4f49('0x42'));this[_0x4f49('0x6')](_0x4f49('0x43'),'yes');this['setDataValue'](_0x4f49('0x44'),'yes');this[_0x4f49('0x6')](_0x4f49('0x45'),_0x4f49('0x2a'));this[_0x4f49('0x6')](_0x4f49('0x4b'),_0x4f49('0x2a'));this[_0x4f49('0x6')](_0x4f49('0x4c'),_0x4f49('0x2a'));this[_0x4f49('0x6')](_0x4f49('0x46'),'no');this[_0x4f49('0x6')](_0x4f49('0x47'),_0x4f49('0x4d'));this[_0x4f49('0x6')](_0x4f49('0x48'),_0x196552[_0x4f49('0x48')]||_0x4f49('0x4e'));this[_0x4f49('0x6')](_0x4f49('0x49'),_0x196552[_0x4f49('0x49')]||_0x4f49('0x4f'));this[_0x4f49('0x6')](_0x4f49('0x4a'),_0x4f49('0x2a'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x3e9460){this['setDataValue'](_0x4f49('0x50'),_0x3e9460?_0x3e9460[_0x4f49('0x22')](','):[]);},'get':function(){return this[_0x4f49('0xc')](_0x4f49('0x50'))?_[_0x4f49('0x51')](this[_0x4f49('0xc')](_0x4f49('0x50'))[_0x4f49('0x23')](','),function(_0x3ee01a){return parseInt(_0x3ee01a,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x4f49('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x4f49('0x12')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x4f49('0x1a')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x4f49('0x4')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x4f49('0xc')](_0x4f49('0x52'))?this['getDataValue'](_0x4f49('0x52')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0x4f49('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x3ecc94){if(typeof _0x3ecc94==='string'){var _0x50c06e=_0x3ecc94==='1'?!![]:_0x3ecc94==='0'?![]:_0x3ecc94==='true'?!![]:_0x3ecc94===_0x4f49('0x53')?![]:![];this[_0x4f49('0x6')](_0x4f49('0x54'),_0x50c06e);}else{this[_0x4f49('0x6')]('screenrecording',_0x3ecc94);}}},'blocked':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![],'set':function(_0x4e1c67){this[_0x4f49('0x6')]('blocked',_0x4e1c67);if(_0x4e1c67===!![]){this[_0x4f49('0x6')]('blockedAt',moment());this['setDataValue'](_0x4f49('0x55'),0x0);}else{this[_0x4f49('0x6')](_0x4f49('0x56'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x4f49('0x12')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x96fd=['String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','always','refuse','originate','uas','fingerprint','active','passive','actpass','update','TEXT','showWebBar','get','isArray','wss','encryption','avpf','force_avp','dtlsenable','dtlsverify','dtlsprivatekey','rtcp_mux','icesupport','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','moment','lodash','exports','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','STRING','email','toLowerCase','ENUM','admin','telephone','INTEGER','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','friend','user','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','rfc2833','yes','nonat','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow'];(function(_0x5cfab2,_0x2b6fdd){var _0x2abcec=function(_0x563665){while(--_0x563665){_0x5cfab2['push'](_0x5cfab2['shift']());}};_0x2abcec(++_0x2b6fdd);}(_0x96fd,0x1e9));var _0xd96f=function(_0x9fe3ce,_0x24796e){_0x9fe3ce=_0x9fe3ce-0x0;var _0x7aa9a0=_0x96fd[_0x9fe3ce];return _0x7aa9a0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xd96f('0x0'));var util=require('util');var _=require(_0xd96f('0x1'));module[_0xd96f('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd96f('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x110958){this[_0xd96f('0x4')](_0xd96f('0x3'),_0x110958);this['setDataValue'](_0xd96f('0x5'),_0x110958);},'comment':_0xd96f('0x6')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0xe6000a){this[_0xd96f('0x4')](_0xd96f('0x7'),_0xe6000a);this[_0xd96f('0x4')](_0xd96f('0x8'),util[_0xd96f('0x9')](_0xd96f('0xa'),_0xe6000a,this[_0xd96f('0xb')](_0xd96f('0xc'))));}},'alias':{'type':Sequelize[_0xd96f('0xd')]},'email':{'type':Sequelize[_0xd96f('0xd')],'allowNull':![],'unique':_0xd96f('0xe'),'validate':{'isEmail':!![]},'set':function(_0x37ac24){if(_0x37ac24){this[_0xd96f('0x4')](_0xd96f('0xe'),_0x37ac24[_0xd96f('0xf')]());}}},'role':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x11'),'user','agent',_0xd96f('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0xd96f('0xd')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0xd96f('0x13')](0xb),'allowNull':![],'unique':_0xd96f('0xc'),'set':function(_0xbbff79){this[_0xd96f('0x4')](_0xd96f('0xc'),_0xbbff79);this[_0xd96f('0x4')](_0xd96f('0x14'),_0xbbff79);this[_0xd96f('0x4')](_0xd96f('0x8'),util[_0xd96f('0x9')]('\x22%s\x22\x20<%s>',this[_0xd96f('0xb')](_0xd96f('0x7')),_0xbbff79));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xd96f('0xd')]},'mobile':{'type':Sequelize[_0xd96f('0xd')]},'address':{'type':Sequelize[_0xd96f('0xd')]},'zipcode':{'type':Sequelize[_0xd96f('0xd')]},'userpic':{'type':Sequelize[_0xd96f('0xd')]},'city':{'type':Sequelize[_0xd96f('0xd')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xd96f('0x16')]},'voicePause':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xd96f('0xd')],'defaultValue':_0xd96f('0x17')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0xd96f('0x13')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xd96f('0x13')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xd96f('0x13')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xd96f('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xd96f('0x13')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xd96f('0x13')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'host':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'port':{'type':Sequelize[_0xd96f('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xd96f('0x13')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xd96f('0x13')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x18'),_0xd96f('0x19'),_0xd96f('0x1a')),'allowNull':!![],'defaultValue':_0xd96f('0x18')},'context':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![],'defaultValue':_0xd96f('0x1b')},'callingpres':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x1c'),_0xd96f('0x1d'),_0xd96f('0x1e'),_0xd96f('0x1f'),_0xd96f('0x20'),'PROHIB_PASSED_SCREEN',_0xd96f('0x21'),_0xd96f('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xd96f('0x23'),'set':function(_0x5cea25){this[_0xd96f('0x4')]('transport',_0x5cea25?_0x5cea25[_0xd96f('0x24')](','):null);},'get':function(){return this[_0xd96f('0xb')](_0xd96f('0x25'))?this[_0xd96f('0xb')](_0xd96f('0x25'))[_0xd96f('0x26')](','):null;},'comment':_0xd96f('0x27')},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833',_0xd96f('0x28'),'shortinfo','inband','auto'),'allowNull':!![],'defaultValue':_0xd96f('0x29')},'directmedia':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no',_0xd96f('0x2b'),'update',_0xd96f('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'nat':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![],'defaultValue':_0xd96f('0x2d'),'set':function(_0x301bdb){this[_0xd96f('0x4')](_0xd96f('0x2e'),_0x301bdb?_0x301bdb[_0xd96f('0x24')](','):null);},'get':function(){return this[_0xd96f('0xb')]('nat')?this[_0xd96f('0xb')](_0xd96f('0x2e'))[_0xd96f('0x26')](','):null;},'comment':_0xd96f('0x2f')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xd96f('0xd')]},'pickupgroup':{'type':Sequelize[_0xd96f('0xd')]},'namedpickupgroup':{'type':Sequelize[_0xd96f('0xd')]},'language':{'type':Sequelize[_0xd96f('0xd')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd96f('0x30')},'allow':{'type':Sequelize[_0xd96f('0xd')],'allowNull':![],'defaultValue':_0xd96f('0x31'),'set':function(_0x4621e1){this['setDataValue'](_0xd96f('0x32'),_0x4621e1?_0x4621e1[_0xd96f('0x24')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xd96f('0xb')](_0xd96f('0x32'))?this[_0xd96f('0xb')](_0xd96f('0x32'))['split'](';'):null;},'comment':_0xd96f('0x33')},'autoframing':{'type':Sequelize['ENUM'](_0xd96f('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![],'set':function(_0x3ced69){this[_0xd96f('0x4')]('insecure',_0x3ced69?_0x3ced69[_0xd96f('0x24')](','):null);},'get':function(){return this[_0xd96f('0xb')](_0xd96f('0x34'))?this[_0xd96f('0xb')](_0xd96f('0x34'))[_0xd96f('0x26')](','):null;},'comment':_0xd96f('0x35')},'trustrpid':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no',_0xd96f('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xd96f('0x10')]('yes','no'),'allowNull':!![],'defaultValue':_0xd96f('0x2a')},'busylevel':{'type':Sequelize[_0xd96f('0x13')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xd96f('0x10')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xd96f('0x10')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'template':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no',_0xd96f('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xd96f('0x13')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xd96f('0x10')]('accept',_0xd96f('0x38'),_0xd96f('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xd96f('0x13')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xd96f('0x10')]('uac',_0xd96f('0x3a')),'allowNull':!![],'defaultValue':_0xd96f('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no'),'allowNull':!![],'defaultValue':_0xd96f('0x2a')},'keepalive':{'type':Sequelize[_0xd96f('0x13')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xd96f('0x13')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xd96f('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xd96f('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0xd96f('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xd96f('0x13')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xd96f('0x13')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xd96f('0x13')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xd96f('0x10')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xd96f('0x10')]('yes','no',_0xd96f('0x3b'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xd96f('0x13')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x3c'),_0xd96f('0x3d'),_0xd96f('0x3e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0xd96f('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xd96f('0x13')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xd96f('0x10')]('yes','no',_0xd96f('0x2b'),_0xd96f('0x3f'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xd96f('0xd')]},'resetPasswordExpires':{'type':Sequelize[_0xd96f('0x16')]},'passwordResetAt':{'type':Sequelize[_0xd96f('0x16')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xd96f('0x40')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x3896de){this['setDataValue'](_0xd96f('0x41'),_0x3896de);var _0x2f1f67=this[_0xd96f('0x42')]({'plain':!![]});switch(_0x3896de){case 0x0:case 0x1:var _0x53c62b=_0x2f1f67[_0xd96f('0x25')]?_[_0xd96f('0x43')](_0x2f1f67[_0xd96f('0x25')])?_0x2f1f67[_0xd96f('0x25')][_0xd96f('0x24')]():_0x2f1f67[_0xd96f('0x25')]:_0xd96f('0x23');if(_0x53c62b===_0xd96f('0x44')){_0x53c62b=_0xd96f('0x23');}this[_0xd96f('0x4')](_0xd96f('0x25'),_0x53c62b);this[_0xd96f('0x4')](_0xd96f('0x45'),'no');this[_0xd96f('0x4')](_0xd96f('0x46'),null);this[_0xd96f('0x4')](_0xd96f('0x47'),null);this['setDataValue']('icesupport',null);this[_0xd96f('0x4')](_0xd96f('0x48'),null);this[_0xd96f('0x4')](_0xd96f('0x49'),null);this[_0xd96f('0x4')]('dtlssetup',null);this[_0xd96f('0x4')]('dtlscertfile',null);this['setDataValue'](_0xd96f('0x4a'),null);this[_0xd96f('0x4')](_0xd96f('0x4b'),'no');break;case 0x2:this[_0xd96f('0x4')]('transport',_0xd96f('0x44'));this['setDataValue']('encryption',_0xd96f('0x2a'));this['setDataValue']('avpf','yes');this[_0xd96f('0x4')](_0xd96f('0x47'),'yes');this[_0xd96f('0x4')](_0xd96f('0x4c'),_0xd96f('0x2a'));this[_0xd96f('0x4')](_0xd96f('0x48'),_0xd96f('0x2a'));this[_0xd96f('0x4')](_0xd96f('0x49'),'no');this[_0xd96f('0x4')]('dtlssetup','actpass');this[_0xd96f('0x4')](_0xd96f('0x4d'),_0x2f1f67[_0xd96f('0x4d')]||_0xd96f('0x4e'));this[_0xd96f('0x4')](_0xd96f('0x4a'),_0x2f1f67[_0xd96f('0x4a')]||_0xd96f('0x4f'));this[_0xd96f('0x4')](_0xd96f('0x4b'),_0xd96f('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0xd96f('0x40')],'set':function(_0x36852f){this[_0xd96f('0x4')]('permissions',_0x36852f?_0x36852f[_0xd96f('0x24')](','):[]);},'get':function(){return this[_0xd96f('0xb')](_0xd96f('0x50'))?_[_0xd96f('0x51')](this[_0xd96f('0xb')](_0xd96f('0x50'))['split'](','),function(_0x19e272){return parseInt(_0x19e272,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0xd96f('0xd')]},'phoneBarBusyNumber':{'type':Sequelize[_0xd96f('0xd')]},'phoneBarUnconditional':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xd96f('0x13')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0xd96f('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xd96f('0xd')]},'phoneBarEnableJaws':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xd96f('0x52')],'get':function(){return this[_0xd96f('0xb')](_0xd96f('0x53'))?this[_0xd96f('0xb')](_0xd96f('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0xd96f('0xd')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x398c07){if(typeof _0x398c07==='string'){var _0x1ef7fb=_0x398c07==='1'?!![]:_0x398c07==='0'?![]:_0x398c07==='true'?!![]:_0x398c07===_0xd96f('0x54')?![]:![];this[_0xd96f('0x4')](_0xd96f('0x55'),_0x1ef7fb);}else{this[_0xd96f('0x4')](_0xd96f('0x55'),_0x398c07);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x3798fe){this[_0xd96f('0x4')](_0xd96f('0x56'),_0x3798fe);if(_0x3798fe===!![]){this[_0xd96f('0x4')](_0xd96f('0x57'),moment());this[_0xd96f('0x4')](_0xd96f('0x58'),0x0);}else{this[_0xd96f('0x4')](_0xd96f('0x57'),null);}}},'blockedAt':{'type':Sequelize[_0xd96f('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xd96f('0x13')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xd96f('0x13')](0x5)[_0xd96f('0x59')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':!![]}};
\ No newline at end of file
index dd0419d..569267e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafc4=['user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$in','$notIn','$like','$notLike','$iLike','$contains','$contained','$any','lastName','dialActive','VoiceQueue','CmHopper','retrieveApiKey','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','generateApiKey','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','teams','queues','inbound','lower','col','desc','asc','substring','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','http','offline','unknown','unavailable','voiceStatus','busy','charAt','toUpperCase','slice','select','field','ui.','InteractionId','ui.createdAt','_interactions','ui.UserId\x20=\x20?','toString','moment','util','lodash','squel','jayson/promise','ioredis','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','./user.socket','register','redis','defaults','localhost','request','then','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','offset','undefined','limit','count','json','update','destroy','get','role','admin','Users','user','Agents','agent','Telephones','telephone','filter','map','includes','find','value','UserProfileResource','end','stack','name','index','User','rawAttributes','fieldName','type','key','password','salt','getOptions','where','includeAll','include','attributes','push','rows','query','openTabs','true','length','chat','sms','dataValues','fax','mail','all','params','model','differenceBy','keys','filters','intersection','fields','merge','options','openchannel','body','describe','addContacts','ids','omit','findById','securePassword','validatePasswordPattern','max','internal','isNil','min_internal','sequelize','QueryTypes','SELECT','from','voicemail','mailbox','fullname','email','permissions','102','110','104','105','108','109','100','111','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','VoiceMail','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','each','isEmpty','oldPassword','newPassword','Sequelize','ValidationError','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','addQueues','channel','loginInPause','voicePause','interface','isValidChannel','add','capitalize','toLowerCase','penalty','spread','QueueId','emit','Queue:save','voice','online','format','SIP/%s','UserVoiceQueueRt','removeQueues','Unknown\x20channel','remove','Queues','isArray','Queue:remove','userpic','getAvatar','join','root','server/files/images/logos/default_profile.png','server/files/images/','download','getOpenTabs','whatsapp','ChatOpenTabs','CHAT','createdAt','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','CmContact','order','sort','pick','getContacts','hasOwnProperty','CmList','Tag','Tags','color','tag','nolimit','Queue','Unknown\x20role','findAll','getVoiceQueuesRt','getGroups','ChatGroup','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','ChatInteraction','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','getWhatsappInteractions','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','upsert','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','device','PAUSE','LOGININPAUSE','concat','isMiddleware','resolve','logout','pause','QueuePause','getChannels','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsapppause','pauseType','lastPauseAt','manual','set','%s%s','getTeams','Team','addTeams','Voice','getChatQueues','setDataValue','Chat','getMailQueues','Mail','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','addAgent','getDataValue','TeamVoicePrefix','UserVoicePrefix','removeTeams','removeAgent','VoicePrefixId','getLists','getAgents','values','send','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','user_has_mail_interactions:save','removeMailInteractions'];(function(_0xac60a4,_0x4132c6){var _0x18c0d0=function(_0x71e979){while(--_0x71e979){_0xac60a4['push'](_0xac60a4['shift']());}};_0x18c0d0(++_0x4132c6);}(_0xafc4,0x69));var _0x4afc=function(_0x584c5b,_0x5bb06e){_0x584c5b=_0x584c5b-0x0;var _0x516695=_0xafc4[_0x584c5b];return _0x516695;};'use strict';var moment=require(_0x4afc('0x0'));var BPromise=require('bluebird');var util=require(_0x4afc('0x1'));var path=require('path');var fs=require('fs');var _=require(_0x4afc('0x2'));var squel=require(_0x4afc('0x3'));var jayson=require(_0x4afc('0x4'));var Redis=require(_0x4afc('0x5'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x4afc('0x6'));var utils=require(_0x4afc('0x7'));var config=require(_0x4afc('0x8'));var licenseUtil=require(_0x4afc('0x9'));var db=require(_0x4afc('0xa'))['db'];var socket=require(_0x4afc('0xb'))(new Redis(config['redis']));require(_0x4afc('0xc'))[_0x4afc('0xd')](socket);config[_0x4afc('0xe')]=_[_0x4afc('0xf')](config[_0x4afc('0xe')],{'host':_0x4afc('0x10'),'port':0x18eb});var client=jayson['client']['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x7f127f,_0x49222e,_0x281230,_0x225793){return new BPromise(function(_0x49b56f,_0x38b322){var _0x3fb54a=_0x225793||client;return _0x3fb54a[_0x4afc('0x11')](_0x7f127f,_0x281230)[_0x4afc('0x12')](function(_0x1d8f98){logger[_0x4afc('0x13')](_0x4afc('0x14'),_0x49222e,_0x4afc('0x15'));logger['debug'](_0x4afc('0x16'),_0x49222e,_0x4afc('0x15'),JSON[_0x4afc('0x17')](_0x1d8f98));if(_0x1d8f98[_0x4afc('0x18')]){if(_0x1d8f98['error']['code']===0x1f4){logger[_0x4afc('0x18')]('User,\x20%s,\x20%s',_0x49222e,_0x1d8f98[_0x4afc('0x18')][_0x4afc('0x19')]);return _0x38b322(_0x1d8f98[_0x4afc('0x18')][_0x4afc('0x19')]);}logger[_0x4afc('0x18')](_0x4afc('0x14'),_0x49222e,_0x1d8f98[_0x4afc('0x18')][_0x4afc('0x19')]);return _0x49b56f(_0x1d8f98[_0x4afc('0x18')][_0x4afc('0x19')]);}else{logger[_0x4afc('0x13')]('User,\x20%s,\x20%s',_0x49222e,_0x4afc('0x15'));_0x49b56f(_0x1d8f98[_0x4afc('0x1a')][_0x4afc('0x19')]);}})[_0x4afc('0x1b')](function(_0x557a7e){logger[_0x4afc('0x18')](_0x4afc('0x14'),_0x49222e,_0x557a7e);_0x38b322(_0x557a7e);});});}function respondWithStatusCode(_0x2de6e9,_0x280587){_0x280587=_0x280587||0xcc;return function(_0x1559b8){if(_0x1559b8){return _0x2de6e9[_0x4afc('0x1c')](_0x280587);}return _0x2de6e9[_0x4afc('0x1d')](_0x280587)['end']();};}function respondWithResult(_0x5403e4,_0x3ecf2d){_0x3ecf2d=_0x3ecf2d||0xc8;return function(_0x57f37c){if(_0x57f37c){return _0x5403e4[_0x4afc('0x1d')](_0x3ecf2d)['json'](_0x57f37c);}};}function respondWithFilteredResult(_0x1aa676,_0x2a0314){return function(_0x1e454e){if(_0x1e454e){var _0x2876f2=typeof _0x2a0314[_0x4afc('0x1e')]===_0x4afc('0x1f')&&typeof _0x2a0314[_0x4afc('0x20')]===_0x4afc('0x1f');var _0x2bb837=_0x1e454e[_0x4afc('0x21')];var _0x4e8273=_0x2876f2?0x0:_0x2a0314[_0x4afc('0x1e')];var _0x35f5b3=_0x2876f2?_0x1e454e['count']:_0x2a0314[_0x4afc('0x1e')]+_0x2a0314[_0x4afc('0x20')];var _0x2d6112;if(_0x35f5b3>=_0x2bb837){_0x35f5b3=_0x2bb837;_0x2d6112=0xc8;}else{_0x2d6112=0xce;}_0x1aa676['status'](_0x2d6112);return _0x1aa676['set']('Content-Range',_0x4e8273+'-'+_0x35f5b3+'/'+_0x2bb837)[_0x4afc('0x22')](_0x1e454e);}return null;};}function saveUpdates(_0x5db47e){return function(_0x5e4747){if(_0x5e4747){return _0x5e4747[_0x4afc('0x23')](_0x5db47e)[_0x4afc('0x12')](function(_0x494fe7){return _0x494fe7;});}return null;};}function removeEntity(_0x514278){return function(_0x52e3dd){if(_0x52e3dd){return _0x52e3dd[_0x4afc('0x24')]()[_0x4afc('0x12')](function(){var _0x17a43d=_0x52e3dd[_0x4afc('0x25')]({'plain':!![]});if(_0x17a43d[_0x4afc('0x26')]===_0x4afc('0x27'))return;var _0x566389=[{'name':_0x4afc('0x28'),'value':_0x4afc('0x29'),'ignore':!![]},{'name':_0x4afc('0x2a'),'value':_0x4afc('0x2b'),'ignore':![]},{'name':_0x4afc('0x2c'),'value':_0x4afc('0x2d'),'ignore':![]}];var _0xbabe1e=_(_0x566389)[_0x4afc('0x2e')]('ignore')[_0x4afc('0x2f')]('value')['value']();if(_[_0x4afc('0x30')](_0xbabe1e,_0x17a43d[_0x4afc('0x26')])){return;}var _0x266f7f=_[_0x4afc('0x31')](_0x566389,[_0x4afc('0x32'),_0x17a43d[_0x4afc('0x26')]])['name'];return db[_0x4afc('0x33')][_0x4afc('0x24')]({'where':{'type':_0x266f7f,'resourceId':_0x17a43d['id']}})[_0x4afc('0x12')](function(){return _0x52e3dd;});})[_0x4afc('0x12')](function(){_0x514278[_0x4afc('0x1d')](0xcc)[_0x4afc('0x34')]();});}};}function handleEntityNotFound(_0x48f0c6){return function(_0x22eea2){if(!_0x22eea2){_0x48f0c6[_0x4afc('0x1c')](0x194);}return _0x22eea2;};}function handleError(_0x91565d,_0x283bc2){_0x283bc2=_0x283bc2||0x1f4;return function(_0x499464){logger['error'](_0x499464[_0x4afc('0x35')]);if(_0x499464[_0x4afc('0x36')]){delete _0x499464[_0x4afc('0x36')];}_0x91565d['status'](_0x283bc2)['send'](_0x499464);};}exports[_0x4afc('0x37')]=function(_0x4a06cf,_0x5947bb){var _0x295b53={},_0x1dc853={'count':0x0,'rows':[]};var _0x2be40e=_(db[_0x4afc('0x38')][_0x4afc('0x39')])[_0x4afc('0x2f')](function(_0x453e12){return{'name':_0x453e12[_0x4afc('0x3a')],'type':_0x453e12[_0x4afc('0x3b')][_0x4afc('0x3c')]};})[_0x4afc('0x2e')](function(_0x3ef2aa){return!_[_0x4afc('0x30')]([_0x4afc('0x3d'),_0x4afc('0x3e')],_0x3ef2aa['name']);})[_0x4afc('0x32')]();_0x295b53=qs[_0x4afc('0x3f')](_0x2be40e,_0x4a06cf);var _0x4357a6={'where':_0x295b53[_0x4afc('0x40')]};return db[_0x4afc('0x38')][_0x4afc('0x21')](_0x4357a6)[_0x4afc('0x12')](function(_0x50d53f){_0x1dc853['count']=_0x50d53f;if(_0x4a06cf['query'][_0x4afc('0x41')]){_0x295b53[_0x4afc('0x42')]=[{'all':!![]}];}if(!_['includes'](_0x295b53[_0x4afc('0x43')],'id')){_0x295b53[_0x4afc('0x43')][_0x4afc('0x44')]('id');}return db[_0x4afc('0x38')]['findAll'](_0x295b53);})[_0x4afc('0x12')](function(_0x45c9c3){_0x1dc853[_0x4afc('0x45')]=_0x45c9c3;if(_0x4a06cf[_0x4afc('0x46')][_0x4afc('0x47')]===_0x4afc('0x48')){var _0x51dca0=[];for(var _0x1e6f95=0x0;_0x1e6f95<_0x1dc853['rows'][_0x4afc('0x49')];_0x1e6f95++){_0x51dca0[_0x4afc('0x44')](get_open_tabs(_0x4afc('0x4a'),_0x1dc853['rows'][_0x1e6f95]['dataValues']));_0x51dca0[_0x4afc('0x44')](get_open_tabs(_0x4afc('0x4b'),_0x1dc853[_0x4afc('0x45')][_0x1e6f95][_0x4afc('0x4c')]));_0x51dca0[_0x4afc('0x44')](get_open_tabs(_0x4afc('0x4d'),_0x1dc853[_0x4afc('0x45')][_0x1e6f95][_0x4afc('0x4c')]));_0x51dca0['push'](get_open_tabs(_0x4afc('0x4e'),_0x1dc853[_0x4afc('0x45')][_0x1e6f95]['dataValues']));_0x51dca0[_0x4afc('0x44')](get_open_tabs('openchannel',_0x1dc853[_0x4afc('0x45')][_0x1e6f95][_0x4afc('0x4c')]));_0x51dca0[_0x4afc('0x44')](get_open_tabs('whatsapp',_0x1dc853[_0x4afc('0x45')][_0x1e6f95][_0x4afc('0x4c')]));}return BPromise[_0x4afc('0x4f')](_0x51dca0)[_0x4afc('0x12')](function(_0x4772db){return _0x1dc853;});}else{return _0x1dc853;}})[_0x4afc('0x12')](respondWithFilteredResult(_0x5947bb,_0x295b53))['catch'](handleError(_0x5947bb,null));};exports['show']=function(_0x4f4e46,_0x32f3b9){var _0x1c5661={'raw':![],'where':{'id':_0x4f4e46[_0x4afc('0x50')]['id']}},_0x42e274={};_0x42e274[_0x4afc('0x51')]=_[_0x4afc('0x52')](_[_0x4afc('0x53')](db[_0x4afc('0x38')][_0x4afc('0x39')]),[_0x4afc('0x3d'),'salt']);_0x42e274[_0x4afc('0x46')]=_['keys'](_0x4f4e46['query']);_0x42e274[_0x4afc('0x54')]=_['intersection'](_0x42e274[_0x4afc('0x51')],_0x42e274[_0x4afc('0x46')]);_0x1c5661[_0x4afc('0x43')]=_[_0x4afc('0x55')](_0x42e274['model'],qs[_0x4afc('0x56')](_0x4f4e46['query'][_0x4afc('0x56')]));_0x1c5661[_0x4afc('0x43')]=_0x1c5661[_0x4afc('0x43')][_0x4afc('0x49')]?_0x1c5661[_0x4afc('0x43')]:_0x42e274[_0x4afc('0x51')];if(_0x4f4e46[_0x4afc('0x46')][_0x4afc('0x41')]){_0x1c5661[_0x4afc('0x42')]=[{'all':!![]}];}_0x1c5661=_[_0x4afc('0x57')]({},_0x1c5661,_0x4f4e46[_0x4afc('0x58')]);if(!_[_0x4afc('0x30')](_0x1c5661['attributes'],'id')){_0x1c5661[_0x4afc('0x43')][_0x4afc('0x44')]('id');}return db[_0x4afc('0x38')][_0x4afc('0x31')](_0x1c5661)[_0x4afc('0x12')](handleEntityNotFound(_0x32f3b9,null))[_0x4afc('0x12')](function(_0x2fd538){var _0x10c254=[];values=_0x2fd538;if(_0x4f4e46[_0x4afc('0x46')][_0x4afc('0x47')]===_0x4afc('0x48')){_0x10c254[_0x4afc('0x44')](get_open_tabs(_0x4afc('0x4a'),_0x2fd538['dataValues']));_0x10c254[_0x4afc('0x44')](get_open_tabs('sms',_0x2fd538[_0x4afc('0x4c')]));_0x10c254[_0x4afc('0x44')](get_open_tabs(_0x4afc('0x59'),_0x2fd538[_0x4afc('0x4c')]));_0x10c254['push'](get_open_tabs('whatsapp',_0x2fd538[_0x4afc('0x4c')]));_0x10c254[_0x4afc('0x44')](get_open_tabs('fax',_0x2fd538[_0x4afc('0x4c')]));_0x10c254[_0x4afc('0x44')](get_open_tabs(_0x4afc('0x4e'),_0x2fd538[_0x4afc('0x4c')]));return BPromise[_0x4afc('0x4f')](_0x10c254);}else{return values;}})[_0x4afc('0x12')](function(_0x154797){return values;})[_0x4afc('0x12')](respondWithResult(_0x32f3b9,null))[_0x4afc('0x1b')](handleError(_0x32f3b9,null));};exports[_0x4afc('0x23')]=function(_0x4295a5,_0x1a4d15){if(_0x4295a5[_0x4afc('0x5a')]['id']){delete _0x4295a5[_0x4afc('0x5a')]['id'];}delete _0x4295a5['body'][_0x4afc('0x26')];return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0x4295a5[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x1a4d15,null))[_0x4afc('0x12')](saveUpdates(_0x4295a5[_0x4afc('0x5a')],null))['then'](respondWithResult(_0x1a4d15,null))[_0x4afc('0x1b')](handleError(_0x1a4d15,null));};exports[_0x4afc('0x5b')]=function(_0x543dce,_0x4b3439){return db[_0x4afc('0x38')][_0x4afc('0x5b')]()[_0x4afc('0x12')](respondWithResult(_0x4b3439,null))[_0x4afc('0x1b')](handleError(_0x4b3439,null));};exports[_0x4afc('0x5c')]=function(_0x193850,_0x37cfa6){return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0x193850[_0x4afc('0x50')]['id']}})['then'](handleEntityNotFound(_0x37cfa6,null))['then'](function(_0x458533){if(_0x458533){return _0x458533[_0x4afc('0x5c')](_0x193850['body'][_0x4afc('0x5d')],_[_0x4afc('0x5e')](_0x193850['body'],['ids','id'])||{});}})[_0x4afc('0x12')](respondWithResult(_0x37cfa6,null))[_0x4afc('0x1b')](handleError(_0x37cfa6,null));};function validateUser(_0x576ea0){return new BPromise(function(_0x53792a,_0x3875f8){if(_0x576ea0['internal'])return _0x53792a(_0x576ea0);return db['Setting'][_0x4afc('0x5f')](0x1)[_0x4afc('0x12')](function(_0x53f9ca){if(_0x53f9ca[_0x4afc('0x60')])authService[_0x4afc('0x61')](_0x576ea0[_0x4afc('0x3d')]);db[_0x4afc('0x38')][_0x4afc('0x62')](_0x4afc('0x63'))['then'](function(_0x25969c){if(_[_0x4afc('0x64')](_0x25969c)){_0x576ea0[_0x4afc('0x63')]=_0x53f9ca['min_internal']||0x1;return;}if(_['isNil'](_0x53f9ca['min_internal'])||_0x53f9ca[_0x4afc('0x65')]===_0x25969c){_0x576ea0[_0x4afc('0x63')]=_0x25969c+0x1;return;}if(_0x53f9ca[_0x4afc('0x65')]>_0x25969c){_0x576ea0['internal']=_0x53f9ca[_0x4afc('0x65')];return;}return db['sequelize']['query']('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x4afc('0x66')][_0x4afc('0x67')][_0x4afc('0x68')]})['then'](function(_0x1e56b7){if(_0x1e56b7&&_0x1e56b7[_0x4afc('0x49')]){for(var _0x18ab12=0x0,_0x5e3e9b=_0x1e56b7[_0x4afc('0x49')];_0x18ab12<_0x5e3e9b&&_[_0x4afc('0x64')](_0x576ea0[_0x4afc('0x63')]);_0x18ab12++){if(_0x53f9ca[_0x4afc('0x65')]<=_0x1e56b7[_0x18ab12][_0x4afc('0x69')]){_0x576ea0['internal']=_0x1e56b7[_0x18ab12]['from'];}else if(_0x53f9ca[_0x4afc('0x65')]>_0x1e56b7[_0x18ab12][_0x4afc('0x69')]&&_0x53f9ca[_0x4afc('0x65')]<=_0x1e56b7[_0x18ab12]['to']){_0x576ea0['internal']=_0x53f9ca[_0x4afc('0x65')];}}}if(_[_0x4afc('0x64')](_0x576ea0[_0x4afc('0x63')])){_0x576ea0[_0x4afc('0x63')]=_0x25969c+0x1;}return _0x53792a(_0x576ea0);});});})[_0x4afc('0x1b')](function(_0x4bc6e5){_0x3875f8(_0x4bc6e5);});});}function updateUser(_0x1ef397){return new BPromise(function(_0x8ba1da,_0x517efb){try{if(_0x1ef397[_0x4afc('0x6a')]){_0x1ef397[_0x4afc('0x6b')]=_0x1ef397[_0x4afc('0x63')];_0x1ef397['VoiceMail']={'mailbox':_0x1ef397[_0x4afc('0x63')],'password':_0x1ef397[_0x4afc('0x3d')],'fullname':_0x1ef397[_0x4afc('0x6c')],'email':_0x1ef397[_0x4afc('0x6d')]};}if(_0x1ef397[_0x4afc('0x26')]===_0x4afc('0x2b')){if(!_0x1ef397[_0x4afc('0x6e')])_0x1ef397[_0x4afc('0x6e')]=['101',_0x4afc('0x6f'),'103','113',_0x4afc('0x70'),_0x4afc('0x71'),_0x4afc('0x72'),'106','107',_0x4afc('0x73'),_0x4afc('0x74'),_0x4afc('0x75'),_0x4afc('0x76'),_0x4afc('0x77'),_0x4afc('0x78')];}_0x8ba1da(_0x1ef397);}catch(_0x4701ca){_0x517efb(_0x4701ca);}});}exports[_0x4afc('0x79')]=function(_0x5fd3e1,_0x396cb5){if(_0x5fd3e1[_0x4afc('0x29')][_0x4afc('0x26')]===_0x4afc('0x2b'))throw new Error(_0x4afc('0x7a'));if(_0x5fd3e1[_0x4afc('0x5a')][_0x4afc('0x26')]==='user'&&_0x5fd3e1[_0x4afc('0x29')][_0x4afc('0x26')]!==_0x4afc('0x27')){throw new Error(_0x4afc('0x7b'));}if(_0x5fd3e1[_0x4afc('0x5a')][_0x4afc('0x26')]===_0x4afc('0x27')&&_0x5fd3e1[_0x4afc('0x29')][_0x4afc('0x26')]!=='admin'){throw new Error(_0x4afc('0x7c'));}return licenseUtil[_0x4afc('0x7d')]([_0x5fd3e1[_0x4afc('0x5a')]])[_0x4afc('0x12')](function(){return validateUser(_0x5fd3e1['body']);})[_0x4afc('0x12')](function(_0x56b862){return updateUser(_0x56b862)[_0x4afc('0x12')](function(_0x4956b2){if(_0x4956b2[_0x4afc('0x26')]===_0x4afc('0x27')){_0x4956b2[_0x4afc('0x7e')]=_0x5fd3e1[_0x4afc('0x29')][_0x4afc('0x7e')];delete _0x4956b2[_0x4afc('0x7f')];}return _0x4956b2;});})['then'](function(_0xbbcbf4){return db[_0x4afc('0x38')]['create'](_0xbbcbf4,{'include':[{'model':db[_0x4afc('0x80')],'as':_0x4afc('0x80')}]});})[_0x4afc('0x12')](function(_0x4affde){if(_0x5fd3e1[_0x4afc('0x5a')][_0x4afc('0x26')]===_0x4afc('0x29'))return _0x4affde;if(_0x5fd3e1[_0x4afc('0x29')]['role']!==_0x4afc('0x29'))return _0x4affde;return db[_0x4afc('0x81')]['find']({'where':{'name':_0x4affde[_0x4afc('0x26')]===_0x4afc('0x2b')?_0x4afc('0x2a'):'Telephones','userProfileId':_0x5fd3e1['user'][_0x4afc('0x7f')]},'raw':!![]})[_0x4afc('0x12')](function(_0x1c0483){if(!_0x1c0483||_0x1c0483[_0x4afc('0x82')]!=0x0)return _0x4affde;return db[_0x4afc('0x33')][_0x4afc('0x79')]({'name':_0x4affde[_0x4afc('0x36')],'resourceId':_0x4affde['id'],'type':_0x1c0483[_0x4afc('0x36')],'sectionId':_0x1c0483['id']},{})[_0x4afc('0x12')](function(){return _0x4affde;});})[_0x4afc('0x1b')](function(_0x32a7a3){logger[_0x4afc('0x18')](_0x4afc('0x83'),_0x32a7a3);throw _0x32a7a3;});})[_0x4afc('0x12')](respondWithResult(_0x396cb5,0xc9))[_0x4afc('0x1b')](handleError(_0x396cb5,null));};exports[_0x4afc('0x84')]=function(_0x5d0ae9,_0x165a35){var _0x105ab7=_0x5d0ae9['body'];var _0xd8f88a=[];if(_0x5d0ae9['user']['role']===_0x4afc('0x2b'))throw new Error('Unauthorized');if(_['some'](_0x105ab7,[_0x4afc('0x26'),'user'])&&_0x5d0ae9[_0x4afc('0x29')]['role']!==_0x4afc('0x27')){throw new Error(_0x4afc('0x7b'));}if(_[_0x4afc('0x85')](_0x105ab7,[_0x4afc('0x26'),_0x4afc('0x27')])&&_0x5d0ae9['user'][_0x4afc('0x26')]!==_0x4afc('0x27')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil['checkUserLimits'](_0x105ab7)[_0x4afc('0x12')](function(){return validateUser(_0x105ab7[0x0]);})[_0x4afc('0x12')](function(){for(var _0x373e9c=0x1;_0x373e9c<_0x105ab7[_0x4afc('0x49')];_0x373e9c++){var _0x4596ed=_0x105ab7[_0x373e9c-0x1]['internal'];if(!_0x105ab7[_0x373e9c][_0x4afc('0x63')])_0x105ab7[_0x373e9c][_0x4afc('0x63')]=_0x4596ed+0x1;_0xd8f88a[_0x4afc('0x44')](validateUser(_0x105ab7[_0x373e9c]));}return BPromise[_0x4afc('0x4f')](_0xd8f88a);})['then'](function(){_0xd8f88a=[];for(var _0x114e0f=0x0;_0x114e0f<_0x105ab7['length'];_0x114e0f++){_0xd8f88a[_0x4afc('0x44')](updateUser(_0x105ab7[_0x114e0f]));}return BPromise[_0x4afc('0x4f')](_0xd8f88a);})[_0x4afc('0x12')](function(){return BPromise[_0x4afc('0x86')](_0x105ab7,function(_0xa580ad){return db[_0x4afc('0x38')][_0x4afc('0x79')](_0xa580ad,{'include':[{'model':db[_0x4afc('0x80')],'as':_0x4afc('0x80')}]})[_0x4afc('0x12')](function(_0x27dd60){_0xa580ad['id']=_0x27dd60['id'];return _0xa580ad;});});})['then'](function(_0x26a924){if(_0x5d0ae9['body'][_0x4afc('0x26')]==='user')return _0x26a924;if(_0x5d0ae9['user'][_0x4afc('0x26')]!=='user')return _0x26a924;var _0x512f92=_[_0x4afc('0x85')](_0x26a924,function(_0x489c9d){return _0x489c9d[_0x4afc('0x26')]===_0x4afc('0x2b')||_0x489c9d['role']===_0x4afc('0x2d');});if(!_0x512f92)return _0x26a924;return db[_0x4afc('0x81')]['findAll']({'where':{'name':{'$or':[_0x4afc('0x2a'),_0x4afc('0x2c')]},'userProfileId':_0x5d0ae9[_0x4afc('0x29')]['userProfileId']},'raw':!![]})[_0x4afc('0x12')](function(_0x298c87){if(_[_0x4afc('0x87')](_0x298c87)||!_[_0x4afc('0x85')](_0x298c87,[_0x4afc('0x82'),0x0]))return _0x26a924;_0xd8f88a=[];var _0xbdeb7d=_(_0x298c87)['map'](function(_0x4daf24){if(_0x4daf24[_0x4afc('0x82')]===0x1)return;return _0x4daf24[_0x4afc('0x36')]==='Agents'?_0x4afc('0x2b'):_0x4afc('0x2d');})['compact']()[_0x4afc('0x32')]();for(var _0x102fd8=0x0;_0x102fd8<_0x26a924[_0x4afc('0x49')];_0x102fd8++){if(!_[_0x4afc('0x30')](_0xbdeb7d,_0x26a924[_0x102fd8][_0x4afc('0x26')]))return;var _0x4b1bbc=_0x26a924[_0x102fd8][_0x4afc('0x26')]===_0x4afc('0x2b')?_0x4afc('0x2a'):_0x4afc('0x2c');_0xd8f88a[_0x4afc('0x44')](db['UserProfileResource'][_0x4afc('0x79')]({'name':_0x26a924[_0x102fd8][_0x4afc('0x36')],'resourceId':_0x26a924[_0x102fd8]['id'],'type':_0x4b1bbc,'sectionId':_[_0x4afc('0x31')](_0x298c87,['name',_0x4b1bbc])['id']},{}));}return BPromise[_0x4afc('0x4f')](_0xd8f88a);});})[_0x4afc('0x12')](respondWithResult(_0x165a35,0xc9))['catch'](handleError(_0x165a35,null));};exports['changePassword']=function(_0x4c27a2,_0x1119a9){if(_0x4c27a2[_0x4afc('0x5a')]['id']){delete _0x4c27a2['body']['id'];}return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0x4c27a2['params']['id']}})[_0x4afc('0x12')](function(_0x37a056){if(!_0x37a056)return null;if(_0x37a056['id']===_0x4c27a2[_0x4afc('0x29')]['id']){if(!_0x4c27a2[_0x4afc('0x5a')][_0x4afc('0x88')]||!_0x4c27a2[_0x4afc('0x5a')][_0x4afc('0x89')]){throw new db[(_0x4afc('0x8a'))][(_0x4afc('0x8b'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x37a056[_0x4afc('0x8c')](_0x4c27a2[_0x4afc('0x5a')][_0x4afc('0x88')])){throw new db[(_0x4afc('0x8a'))]['ValidationError'](_0x4afc('0x8d'));}if(_0x4c27a2[_0x4afc('0x5a')]['oldPassword']===_0x4c27a2['body']['newPassword']){throw new db[(_0x4afc('0x8a'))][(_0x4afc('0x8b'))](_0x4afc('0x8e'));}}else if(_0x4c27a2['user'][_0x4afc('0x26')]===_0x4afc('0x27')){if(!_0x4c27a2[_0x4afc('0x5a')]['newPassword']){throw new db[(_0x4afc('0x8a'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x4c27a2[_0x4afc('0x29')][_0x4afc('0x26')]===_0x4afc('0x29')){if(!_0x4c27a2['body'][_0x4afc('0x89')]){throw new db[(_0x4afc('0x8a'))][(_0x4afc('0x8b'))](_0x4afc('0x8f'));}if(_0x37a056[_0x4afc('0x26')]!==_0x4afc('0x2b')){throw new db[(_0x4afc('0x8a'))][(_0x4afc('0x8b'))](_0x4afc('0x7a'));}}else{throw new db['Sequelize']['ValidationError'](_0x4afc('0x7a'));}return _0x37a056;})[_0x4afc('0x12')](handleEntityNotFound(_0x1119a9,null))[_0x4afc('0x12')](function(_0x2b3bbb){return db['Setting'][_0x4afc('0x90')]({'attributes':['id','securePassword','enforcePasswordHistory','passwordHistoryLimit']})[_0x4afc('0x12')](function(_0x449529){if(_0x449529[_0x4afc('0x60')])authService[_0x4afc('0x61')](_0x4c27a2[_0x4afc('0x5a')][_0x4afc('0x89')]);if(!_0x449529[_0x4afc('0x91')]||!_0x2b3bbb[_0x4afc('0x92')])return _0x2b3bbb;authService[_0x4afc('0x93')](_0x4c27a2[_0x4afc('0x5a')][_0x4afc('0x89')],_0x2b3bbb[_0x4afc('0x92')],_0x449529[_0x4afc('0x94')]);return _0x2b3bbb;})['then'](saveUpdates({'password':_0x4c27a2[_0x4afc('0x5a')][_0x4afc('0x89')],'passwordResetAt':_0x4c27a2[_0x4afc('0x29')]['id']==_0x4c27a2[_0x4afc('0x50')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x4c27a2[_0x4afc('0x5a')][_0x4afc('0x89')],_0x2b3bbb['previousPasswords'])},null));})[_0x4afc('0x12')](respondWithResult(_0x1119a9,null))[_0x4afc('0x1b')](handleError(_0x1119a9,null));};exports[_0x4afc('0x95')]=function(_0x46f5c1,_0x504eae){var _0x42f066=_0x46f5c1[_0x4afc('0x5a')][_0x4afc('0x96')];return db['User'][_0x4afc('0x31')]({'where':{'id':_0x46f5c1[_0x4afc('0x50')]['id']},'attributes':['id','name',_0x4afc('0x26'),'online',_0x4afc('0x97'),_0x4afc('0x98'),_0x4afc('0x99')]})[_0x4afc('0x12')](handleEntityNotFound(_0x504eae,null))[_0x4afc('0x12')](function(_0x2f5d0b){if(_0x2f5d0b){if(!utils[_0x4afc('0x9a')](_0x42f066)){throw new db[(_0x4afc('0x8a'))]['ValidationError']('Unknown\x20channel');}return _0x2f5d0b[_0x4afc('0x9b')+_[_0x4afc('0x9c')](_0x42f066[_0x4afc('0x9d')]())+'Queues'](_0x46f5c1[_0x4afc('0x5a')][_0x4afc('0x5d')],{'penalty':_0x46f5c1['body'][_0x4afc('0x9e')]||0x0})[_0x4afc('0x9f')](function(_0x173149){for(var _0x5ca9fe=0x0;_0x5ca9fe<_0x46f5c1[_0x4afc('0x5a')][_0x4afc('0x5d')][_0x4afc('0x49')];_0x5ca9fe+=0x1){var _0x53d197={'UserId':Number(_0x46f5c1[_0x4afc('0x50')]['id'])};_0x53d197[_[_0x4afc('0x9c')](_0x42f066[_0x4afc('0x9d')]())+_0x4afc('0xa0')]=Number(_0x46f5c1[_0x4afc('0x5a')][_0x4afc('0x5d')][_0x5ca9fe]);socket[_0x4afc('0xa1')](_0x4afc('0x29')+_[_0x4afc('0x9c')](_0x42f066['toLowerCase']())+_0x4afc('0xa2'),_0x53d197);}return _0x173149;})[_0x4afc('0x12')](function(){if(_0x42f066===_0x4afc('0xa3')){return db['VoiceQueue']['findAll']({'where':{'id':_0x46f5c1[_0x4afc('0x5a')][_0x4afc('0x5d')]||[]},'raw':!![],'attributes':['id',_0x4afc('0x36')]});}})[_0x4afc('0x12')](function(_0xc8fba2){var _0x4118f3=_0x2f5d0b[_0x4afc('0x25')]({'plain':!![]});var _0x1cb863=[];if(_0x42f066===_0x4afc('0xa3')&&_0x4118f3['role']===_0x4afc('0x2b')&&_0x4118f3[_0x4afc('0xa4')]){for(var _0x456618=0x0;_0x456618<_0xc8fba2['length'];_0x456618+=0x1){_0x1cb863[_0x4afc('0x44')]({'membername':_0x4118f3[_0x4afc('0x36')],'UserId':_0x4118f3['id'],'queue_name':_0xc8fba2[_0x456618][_0x4afc('0x36')],'VoiceQueueId':_0xc8fba2[_0x456618]['id'],'interface':_['isNil'](_0x4118f3[_0x4afc('0x99')])?util[_0x4afc('0xa5')](_0x4afc('0xa6'),_0x4118f3[_0x4afc('0x36')]):_0x4118f3[_0x4afc('0x99')],'paused':_0x4118f3[_0x4afc('0x98')]||![],'penalty':_0x46f5c1['body'][_0x4afc('0x9e')]||0x0});}return BPromise['each'](_0x1cb863,function(_0x5b721b){return db[_0x4afc('0xa7')]['upsert'](_0x5b721b);});}return _0x2f5d0b;});}})[_0x4afc('0x12')](respondWithStatusCode(_0x504eae,null))[_0x4afc('0x1b')](handleError(_0x504eae,null));};exports[_0x4afc('0xa8')]=function(_0x1191ac,_0x5bbeab){var _0x455a57;return db['User'][_0x4afc('0x31')]({'where':{'id':_0x1191ac[_0x4afc('0x50')]['id']},'attributes':['id','name',_0x4afc('0x26')]})[_0x4afc('0x12')](handleEntityNotFound(_0x5bbeab,null))[_0x4afc('0x12')](function(_0x205e1b){if(_0x205e1b){_0x455a57=_0x205e1b;if(!_0x1191ac['query'][_0x4afc('0x96')]||!utils['isValidChannel'](_0x1191ac[_0x4afc('0x46')][_0x4afc('0x96')])){throw new db['Sequelize'][(_0x4afc('0x8b'))](_0x4afc('0xa9'));}return _0x205e1b[_0x4afc('0xaa')+_[_0x4afc('0x9c')](_0x1191ac['query'][_0x4afc('0x96')]['toLowerCase']())+_0x4afc('0xab')](_0x1191ac[_0x4afc('0x46')][_0x4afc('0x5d')]);}})[_0x4afc('0x12')](function(_0x1fc5d8){if(_[_0x4afc('0xac')](_0x1191ac['query']['ids'])){for(var _0x1f0e12=0x0;_0x1f0e12<_0x1191ac[_0x4afc('0x46')][_0x4afc('0x5d')][_0x4afc('0x49')];_0x1f0e12+=0x1){var _0x43fcf3={'UserId':Number(_0x1191ac[_0x4afc('0x50')]['id'])};_0x43fcf3[_['capitalize'](_0x1191ac[_0x4afc('0x46')][_0x4afc('0x96')][_0x4afc('0x9d')]())+_0x4afc('0xa0')]=Number(_0x1191ac[_0x4afc('0x46')]['ids'][_0x1f0e12]);socket[_0x4afc('0xa1')](_0x4afc('0x29')+_[_0x4afc('0x9c')](_0x1191ac['query'][_0x4afc('0x96')][_0x4afc('0x9d')]())+_0x4afc('0xad'),_0x43fcf3);}}else{var _0x43fcf3={'UserId':Number(_0x1191ac[_0x4afc('0x50')]['id'])};_0x43fcf3[_[_0x4afc('0x9c')](_0x1191ac[_0x4afc('0x46')][_0x4afc('0x96')]['toLowerCase']())+_0x4afc('0xa0')]=Number(_0x1191ac[_0x4afc('0x46')][_0x4afc('0x5d')]);socket[_0x4afc('0xa1')](_0x4afc('0x29')+_[_0x4afc('0x9c')](_0x1191ac[_0x4afc('0x46')]['channel'][_0x4afc('0x9d')]())+_0x4afc('0xad'),_0x43fcf3);}return _0x1fc5d8;})[_0x4afc('0x12')](function(){if(_0x1191ac[_0x4afc('0x46')][_0x4afc('0x96')]===_0x4afc('0xa3')){return db[_0x4afc('0xa7')]['destroy']({'where':{'UserId':_0x1191ac['params']['id'],'VoiceQueueId':_0x1191ac[_0x4afc('0x46')]['ids']},'individualHooks':!![]})[_0x4afc('0x12')](function(){return _0x455a57;});}return _0x455a57;})[_0x4afc('0x12')](respondWithStatusCode(_0x5bbeab,null))[_0x4afc('0x1b')](handleError(_0x5bbeab,null));};exports['addAvatar']=function(_0x75a628,_0x1ea1cb){_0x75a628[_0x4afc('0x5a')][_0x4afc('0xae')]=_0x75a628['file']['filename'];return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0x75a628[_0x4afc('0x50')]['id']}})['then'](handleEntityNotFound(_0x1ea1cb,null))[_0x4afc('0x12')](saveUpdates(_0x75a628['body'],null))[_0x4afc('0x12')](respondWithResult(_0x1ea1cb,null))['catch'](handleError(_0x1ea1cb,null));};exports[_0x4afc('0xaf')]=function(_0x54ea16,_0x1d79cd){var _0x4ba3a9=path[_0x4afc('0xb0')](config[_0x4afc('0xb1')],_0x4afc('0xb2'));return db['User'][_0x4afc('0x31')]({'where':{'id':_0x54ea16['params']['id']},'attributes':['id',_0x4afc('0xae')],'raw':!![]})['then'](handleEntityNotFound(_0x1d79cd,null))[_0x4afc('0x12')](function(_0x2257f3){if(_0x2257f3){if(_['isNil'](_0x2257f3[_0x4afc('0xae')])){return _0x1d79cd['download'](_0x4ba3a9);}else{if(!fs['existsSync'](path[_0x4afc('0xb0')](config[_0x4afc('0xb1')],_0x4afc('0xb3'),_0x2257f3[_0x4afc('0xae')]))){return _0x1d79cd[_0x4afc('0xb4')](_0x4ba3a9);}return _0x1d79cd[_0x4afc('0xb4')](path[_0x4afc('0xb0')](config[_0x4afc('0xb1')],_0x4afc('0xb3'),_0x2257f3['userpic']));}}})[_0x4afc('0x1b')](handleError(_0x1d79cd,null));};exports[_0x4afc('0xb5')]=function(_0x280319,_0x1e6529){return db[_0x4afc('0x38')]['find']({'where':{'id':_0x280319[_0x4afc('0x50')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x1e6529,null))[_0x4afc('0x12')](function(_0x14c79c){var _0x4df52a=[];values=_0x14c79c[_0x4afc('0x4c')];_0x4df52a[_0x4afc('0x44')](get_open_tabs('chat',_0x14c79c[_0x4afc('0x4c')]));_0x4df52a[_0x4afc('0x44')](get_open_tabs(_0x4afc('0x4b'),_0x14c79c['dataValues']));_0x4df52a['push'](get_open_tabs(_0x4afc('0x59'),_0x14c79c[_0x4afc('0x4c')]));_0x4df52a[_0x4afc('0x44')](get_open_tabs(_0x4afc('0xb6'),_0x14c79c[_0x4afc('0x4c')]));_0x4df52a[_0x4afc('0x44')](get_open_tabs(_0x4afc('0x4d'),_0x14c79c['dataValues']));_0x4df52a[_0x4afc('0x44')](get_open_tabs(_0x4afc('0x4e'),_0x14c79c[_0x4afc('0x4c')]));return BPromise[_0x4afc('0x4f')](_0x4df52a);})[_0x4afc('0x12')](function(_0x31f863){var _0x46f93b=[];if(_0x31f863){for(var _0x444586=0x0;_0x444586<values[_0x4afc('0xb7')]['length'];_0x444586++){var _0x41bd1d=values[_0x4afc('0xb7')][_0x444586];_0x46f93b[_0x4afc('0x44')]({'channel':_0x4afc('0xb8'),'id':_0x41bd1d['id'],'createdAt':_0x41bd1d[_0x4afc('0xb9')]});}for(var _0x444586=0x0;_0x444586<values['FaxOpenTabs'][_0x4afc('0x49')];_0x444586++){var _0x41bd1d=values['FaxOpenTabs'][_0x444586];_0x46f93b[_0x4afc('0x44')]({'channel':_0x4afc('0xba'),'id':_0x41bd1d['id'],'createdAt':_0x41bd1d['createdAt']});}for(var _0x444586=0x0;_0x444586<values[_0x4afc('0xbb')]['length'];_0x444586++){var _0x41bd1d=values[_0x4afc('0xbb')][_0x444586];_0x46f93b[_0x4afc('0x44')]({'channel':_0x4afc('0xbc'),'id':_0x41bd1d['id'],'createdAt':_0x41bd1d[_0x4afc('0xb9')]});}for(var _0x444586=0x0;_0x444586<values['MailOpenTabs'][_0x4afc('0x49')];_0x444586++){var _0x41bd1d=values[_0x4afc('0xbd')][_0x444586];_0x46f93b['push']({'channel':'MAIL','id':_0x41bd1d['id'],'createdAt':_0x41bd1d['createdAt']});}for(var _0x444586=0x0;_0x444586<values[_0x4afc('0xbe')][_0x4afc('0x49')];_0x444586++){var _0x41bd1d=values[_0x4afc('0xbe')][_0x444586];_0x46f93b['push']({'channel':_0x4afc('0xbf'),'id':_0x41bd1d['id'],'createdAt':_0x41bd1d[_0x4afc('0xb9')]});}for(var _0x444586=0x0;_0x444586<values[_0x4afc('0xc0')]['length'];_0x444586++){var _0x41bd1d=values[_0x4afc('0xc0')][_0x444586];_0x46f93b[_0x4afc('0x44')]({'channel':_0x4afc('0xc1'),'id':_0x41bd1d['id'],'createdAt':_0x41bd1d[_0x4afc('0xb9')]});}var _0x313fd4={'count':_0x46f93b['length'],'rows':_0x46f93b};return _0x313fd4;}else return null;})[_0x4afc('0x12')](respondWithResult(_0x1e6529,null))[_0x4afc('0x1b')](handleError(_0x1e6529,null));};exports['getContacts']=function(_0x3d3842,_0x4ac560){var _0x4cb98b={};var _0x30a93f={};var _0x1258b7;var _0x10d378;return db[_0x4afc('0x38')][_0x4afc('0x90')]({'where':{'id':_0x3d3842[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x4ac560,null))['then'](function(_0x253e57){if(_0x253e57){_0x1258b7=_0x253e57;_0x30a93f[_0x4afc('0x51')]=_['keys'](db[_0x4afc('0xc2')][_0x4afc('0x39')]);_0x30a93f['query']=_[_0x4afc('0x53')](_0x3d3842[_0x4afc('0x46')]);_0x30a93f[_0x4afc('0x54')]=_['intersection'](_0x30a93f[_0x4afc('0x51')],_0x30a93f[_0x4afc('0x46')]);_0x4cb98b[_0x4afc('0x43')]=_['intersection'](_0x30a93f['model'],qs[_0x4afc('0x56')](_0x3d3842['query'][_0x4afc('0x56')]));_0x4cb98b[_0x4afc('0x43')]=_0x4cb98b[_0x4afc('0x43')]['length']?_0x4cb98b['attributes']:_0x30a93f[_0x4afc('0x51')];_0x4cb98b[_0x4afc('0xc3')]=qs[_0x4afc('0xc4')](_0x3d3842[_0x4afc('0x46')][_0x4afc('0xc4')]);_0x4cb98b[_0x4afc('0x40')]=qs['filters'](_[_0x4afc('0xc5')](_0x3d3842[_0x4afc('0x46')],_0x30a93f[_0x4afc('0x54')]));if(_0x3d3842[_0x4afc('0x46')][_0x4afc('0x2e')]){_0x4cb98b['where']=_[_0x4afc('0x57')](_0x4cb98b[_0x4afc('0x40')],{'$or':_[_0x4afc('0x2f')](_0x4cb98b['attributes'],function(_0x15ee30){var _0x133d22={};_0x133d22[_0x15ee30]={'$like':'%'+_0x3d3842['query']['filter']+'%'};return _0x133d22;})});}_0x4cb98b=_[_0x4afc('0x57')]({},_0x4cb98b,_0x3d3842[_0x4afc('0x58')]);return _0x1258b7[_0x4afc('0xc6')](_0x4cb98b);}})[_0x4afc('0x12')](function(_0x35a448){if(_0x35a448){_0x10d378=_0x35a448[_0x4afc('0x49')];if(_0x3d3842[_0x4afc('0x46')][_0x4afc('0xc7')]('includeAll')){_0x4cb98b[_0x4afc('0x42')]=[{'model':db[_0x4afc('0xc8')],'as':'List','required':![]},{'model':db[_0x4afc('0xc9')],'as':_0x4afc('0xca'),'attributes':['id',_0x4afc('0x36'),_0x4afc('0xcb')],'where':_0x3d3842[_0x4afc('0x46')][_0x4afc('0xcc')]?{'id':_0x3d3842['query'][_0x4afc('0xcc')]}:undefined,'required':_0x3d3842[_0x4afc('0x46')][_0x4afc('0xcc')]?!![]:![]}];}if(!_0x3d3842[_0x4afc('0x46')]['hasOwnProperty'](_0x4afc('0xcd'))){_0x4cb98b[_0x4afc('0x20')]=qs[_0x4afc('0x20')](_0x3d3842[_0x4afc('0x46')]['limit']);_0x4cb98b[_0x4afc('0x1e')]=qs[_0x4afc('0x1e')](_0x3d3842[_0x4afc('0x46')][_0x4afc('0x1e')]);}return _0x1258b7[_0x4afc('0xc6')](_0x4cb98b);}})[_0x4afc('0x12')](function(_0x32f847){if(_0x32f847){return _0x32f847?{'count':_0x10d378,'rows':_0x32f847}:null;}})['then'](respondWithResult(_0x4ac560,null))['catch'](handleError(_0x4ac560,null));};exports['getQueues']=function(_0x37d689,_0x5d8273){var _0x27b9f3;var _0x4e05af;var _0x462734={};var _0x30a586;return db[_0x4afc('0x38')]['findOne']({'where':{'id':_0x37d689[_0x4afc('0x50')]['id']},'attributes':['id',_0x4afc('0x36'),_0x4afc('0x26')]})[_0x4afc('0x12')](handleEntityNotFound(_0x5d8273,null))['then'](function(_0x44c475){if(!utils[_0x4afc('0x9a')](_0x37d689[_0x4afc('0x46')]['channel'])){throw new db[(_0x4afc('0x8a'))][(_0x4afc('0x8b'))]('Unknown\x20channel');}_0x27b9f3=_0x44c475;var _0x43f64e={};_0x43f64e[_0x4afc('0x51')]=_[_0x4afc('0x53')](db[_[_0x4afc('0x9c')](_0x37d689[_0x4afc('0x46')]['channel'])+'Queue'][_0x4afc('0x39')]);_0x43f64e[_0x4afc('0x46')]=_[_0x4afc('0x53')](_0x37d689[_0x4afc('0x46')]);_0x43f64e[_0x4afc('0x54')]=_[_0x4afc('0x55')](_0x43f64e[_0x4afc('0x51')],_0x43f64e[_0x4afc('0x46')]);_0x462734[_0x4afc('0x43')]=_[_0x4afc('0x55')](_0x43f64e['model'],qs[_0x4afc('0x56')](_0x37d689[_0x4afc('0x46')][_0x4afc('0x56')]));_0x462734[_0x4afc('0x43')]=_0x462734[_0x4afc('0x43')][_0x4afc('0x49')]?_0x462734[_0x4afc('0x43')]:_0x43f64e['model'];_0x462734[_0x4afc('0xc3')]=qs[_0x4afc('0xc4')](_0x37d689[_0x4afc('0x46')]['sort']);_0x462734['where']=qs['filters'](_['pick'](_0x37d689['query'],_0x43f64e[_0x4afc('0x54')]));if(_0x37d689['query'][_0x4afc('0x2e')]){_0x462734[_0x4afc('0x40')]=_[_0x4afc('0x57')](_0x462734['where'],{'$or':_[_0x4afc('0x2f')](_0x462734[_0x4afc('0x43')],function(_0x469e5c){var _0x2b9f4c={};_0x2b9f4c[_0x469e5c]={'$like':'%'+_0x37d689[_0x4afc('0x46')][_0x4afc('0x2e')]+'%'};return _0x2b9f4c;})});}_0x462734=_[_0x4afc('0x57')]({},_0x462734,_0x37d689[_0x4afc('0x58')]);switch(_0x27b9f3['role']){case _0x4afc('0x27'):return db[_[_0x4afc('0x9c')](_0x37d689['query'][_0x4afc('0x96')])+_0x4afc('0xce')]['findAll'](_0x462734);case'user':case _0x4afc('0x2b'):return _0x27b9f3[_0x4afc('0x25')+_[_0x4afc('0x9c')](_0x37d689[_0x4afc('0x46')]['channel'])+_0x4afc('0xab')](_0x462734);default:throw new db[(_0x4afc('0x8a'))][(_0x4afc('0x8b'))](_0x4afc('0xcf'));}})['then'](function(_0x516e83){_0x30a586=_0x516e83['length'];if(!_0x37d689[_0x4afc('0x46')][_0x4afc('0xc7')]('nolimit')){_0x462734[_0x4afc('0x20')]=qs['limit'](_0x37d689['query'][_0x4afc('0x20')]);_0x462734['offset']=qs[_0x4afc('0x1e')](_0x37d689[_0x4afc('0x46')][_0x4afc('0x1e')]);}switch(_0x27b9f3[_0x4afc('0x26')]){case _0x4afc('0x27'):return db[_['capitalize'](_0x37d689[_0x4afc('0x46')]['channel'])+_0x4afc('0xce')][_0x4afc('0xd0')](_0x462734);case _0x4afc('0x29'):case _0x4afc('0x2b'):return _0x27b9f3[_0x4afc('0x25')+_['capitalize'](_0x37d689[_0x4afc('0x46')][_0x4afc('0x96')])+_0x4afc('0xab')](_0x462734);}})[_0x4afc('0x12')](function(_0x57ea48){return{'count':_0x30a586,'rows':_0x57ea48};})[_0x4afc('0x12')](respondWithResult(_0x5d8273,null))[_0x4afc('0x1b')](handleError(_0x5d8273,null));};exports['getVoiceQueuesRt']=function(_0x27ba2b,_0x4ace83){var _0x588d22={};var _0x6ba82={};var _0x109e1c;var _0x1f074e;return db[_0x4afc('0x38')][_0x4afc('0x90')]({'where':{'id':_0x27ba2b[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x4ace83,null))[_0x4afc('0x12')](function(_0x1ea800){if(_0x1ea800){_0x109e1c=_0x1ea800;_0x6ba82[_0x4afc('0x51')]=_['keys'](db[_0x4afc('0xa7')][_0x4afc('0x39')]);_0x6ba82[_0x4afc('0x46')]=_[_0x4afc('0x53')](_0x27ba2b['query']);_0x6ba82[_0x4afc('0x54')]=_[_0x4afc('0x55')](_0x6ba82[_0x4afc('0x51')],_0x6ba82[_0x4afc('0x46')]);_0x588d22[_0x4afc('0x43')]=_[_0x4afc('0x55')](_0x6ba82[_0x4afc('0x51')],qs['fields'](_0x27ba2b['query']['fields']));_0x588d22['attributes']=_0x588d22[_0x4afc('0x43')][_0x4afc('0x49')]?_0x588d22[_0x4afc('0x43')]:_0x6ba82[_0x4afc('0x51')];_0x588d22[_0x4afc('0xc3')]=qs[_0x4afc('0xc4')](_0x27ba2b[_0x4afc('0x46')]['sort']);_0x588d22[_0x4afc('0x40')]=qs[_0x4afc('0x54')](_[_0x4afc('0xc5')](_0x27ba2b[_0x4afc('0x46')],_0x6ba82[_0x4afc('0x54')]));if(_0x27ba2b[_0x4afc('0x46')][_0x4afc('0x2e')]){_0x588d22['where']=_['merge'](_0x588d22[_0x4afc('0x40')],{'$or':_[_0x4afc('0x2f')](_0x588d22[_0x4afc('0x43')],function(_0xa1b979){var _0xef44ed={};_0xef44ed[_0xa1b979]={'$like':'%'+_0x27ba2b[_0x4afc('0x46')][_0x4afc('0x2e')]+'%'};return _0xef44ed;})});}_0x588d22=_[_0x4afc('0x57')]({},_0x588d22,_0x27ba2b[_0x4afc('0x58')]);return _0x109e1c[_0x4afc('0xd1')](_0x588d22);}})['then'](function(_0x2c2408){if(_0x2c2408){_0x1f074e=_0x2c2408[_0x4afc('0x49')];if(!_0x27ba2b[_0x4afc('0x46')][_0x4afc('0xc7')](_0x4afc('0xcd'))){_0x588d22[_0x4afc('0x20')]=qs[_0x4afc('0x20')](_0x27ba2b[_0x4afc('0x46')][_0x4afc('0x20')]);_0x588d22[_0x4afc('0x1e')]=qs[_0x4afc('0x1e')](_0x27ba2b[_0x4afc('0x46')][_0x4afc('0x1e')]);}return _0x109e1c[_0x4afc('0xd1')](_0x588d22);}})['then'](function(_0x2c72e9){if(_0x2c72e9){return _0x2c72e9?{'count':_0x1f074e,'rows':_0x2c72e9}:null;}})[_0x4afc('0x12')](respondWithResult(_0x4ace83,null))[_0x4afc('0x1b')](handleError(_0x4ace83,null));};exports[_0x4afc('0xd2')]=function(_0xf2c7ac,_0x483907){var _0x5749b0={};var _0x8ee261={};var _0x14393c;var _0x17f4ae;return db['User'][_0x4afc('0x90')]({'where':{'id':_0xf2c7ac[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x483907,null))[_0x4afc('0x12')](function(_0xae6119){if(_0xae6119){_0x14393c=_0xae6119;_0x8ee261[_0x4afc('0x51')]=_['keys'](db[_0x4afc('0xd3')][_0x4afc('0x39')]);_0x8ee261[_0x4afc('0x46')]=_[_0x4afc('0x53')](_0xf2c7ac[_0x4afc('0x46')]);_0x8ee261[_0x4afc('0x54')]=_[_0x4afc('0x55')](_0x8ee261[_0x4afc('0x51')],_0x8ee261[_0x4afc('0x46')]);_0x5749b0[_0x4afc('0x43')]=_[_0x4afc('0x55')](_0x8ee261[_0x4afc('0x51')],qs[_0x4afc('0x56')](_0xf2c7ac['query'][_0x4afc('0x56')]));_0x5749b0[_0x4afc('0x43')]=_0x5749b0[_0x4afc('0x43')][_0x4afc('0x49')]?_0x5749b0[_0x4afc('0x43')]:_0x8ee261[_0x4afc('0x51')];_0x5749b0['order']=qs['sort'](_0xf2c7ac[_0x4afc('0x46')]['sort']);_0x5749b0[_0x4afc('0x40')]=qs[_0x4afc('0x54')](_[_0x4afc('0xc5')](_0xf2c7ac[_0x4afc('0x46')],_0x8ee261[_0x4afc('0x54')]));if(_0xf2c7ac[_0x4afc('0x46')]['filter']){_0x5749b0['where']=_[_0x4afc('0x57')](_0x5749b0['where'],{'$or':_['map'](_0x5749b0['attributes'],function(_0x3c6bf5){var _0x52edc5={};_0x52edc5[_0x3c6bf5]={'$like':'%'+_0xf2c7ac['query'][_0x4afc('0x2e')]+'%'};return _0x52edc5;})});}_0x5749b0=_[_0x4afc('0x57')]({},_0x5749b0,_0xf2c7ac[_0x4afc('0x58')]);return _0x14393c[_0x4afc('0xd2')](_0x5749b0);}})['then'](function(_0x4bdac0){if(_0x4bdac0){_0x17f4ae=_0x4bdac0[_0x4afc('0x49')];if(!_0xf2c7ac[_0x4afc('0x46')][_0x4afc('0xc7')](_0x4afc('0xcd'))){_0x5749b0[_0x4afc('0x20')]=qs[_0x4afc('0x20')](_0xf2c7ac[_0x4afc('0x46')][_0x4afc('0x20')]);_0x5749b0['offset']=qs[_0x4afc('0x1e')](_0xf2c7ac[_0x4afc('0x46')]['offset']);}return _0x14393c[_0x4afc('0xd2')](_0x5749b0);}})[_0x4afc('0x12')](function(_0x1bd92){if(_0x1bd92){return _0x1bd92?{'count':_0x17f4ae,'rows':_0x1bd92}:null;}})[_0x4afc('0x12')](respondWithResult(_0x483907,null))['catch'](handleError(_0x483907,null));};exports['getRecordings']=function(_0x34a3d3,_0x32a093){var _0x435fe2={'raw':!![],'where':{}};var _0x357686={};var _0x51229c={'count':0x0,'rows':[]};return db['User'][_0x4afc('0x90')]({'where':{'id':_0x34a3d3['params']['id']}})['then'](handleEntityNotFound(_0x32a093,null))['then'](function(_0x3d0d88){if(_0x3d0d88){_0x357686[_0x4afc('0x51')]=_[_0x4afc('0x53')](db[_0x4afc('0xd4')][_0x4afc('0x39')]);_0x357686[_0x4afc('0x46')]=_[_0x4afc('0x53')](_0x34a3d3[_0x4afc('0x46')]);_0x357686[_0x4afc('0x54')]=_[_0x4afc('0x55')](_0x357686[_0x4afc('0x51')],_0x357686[_0x4afc('0x46')]);_0x435fe2[_0x4afc('0x43')]=_[_0x4afc('0x55')](_0x357686[_0x4afc('0x51')],qs['fields'](_0x34a3d3['query'][_0x4afc('0x56')]));_0x435fe2[_0x4afc('0x43')]=_0x435fe2[_0x4afc('0x43')]['length']?_0x435fe2[_0x4afc('0x43')]:_0x357686[_0x4afc('0x51')];if(!_0x34a3d3['query'][_0x4afc('0xc7')](_0x4afc('0xcd'))){_0x435fe2[_0x4afc('0x20')]=qs[_0x4afc('0x20')](_0x34a3d3[_0x4afc('0x46')][_0x4afc('0x20')]);_0x435fe2[_0x4afc('0x1e')]=qs[_0x4afc('0x1e')](_0x34a3d3[_0x4afc('0x46')]['offset']);}_0x435fe2[_0x4afc('0xc3')]=qs['sort'](_0x34a3d3[_0x4afc('0x46')][_0x4afc('0xc4')]);_0x435fe2[_0x4afc('0x40')]=qs['filters'](_[_0x4afc('0xc5')](_0x34a3d3[_0x4afc('0x46')],_0x357686[_0x4afc('0x54')]));_0x435fe2[_0x4afc('0x40')][_0x4afc('0xd5')]=_0x3d0d88['id'];if(_0x34a3d3[_0x4afc('0x46')][_0x4afc('0x2e')]){_0x435fe2[_0x4afc('0x40')]=_['merge'](_0x435fe2[_0x4afc('0x40')],{'$or':_['map'](_0x435fe2['attributes'],function(_0x24188f){var _0x5c72f0={};_0x5c72f0[_0x24188f]={'$like':'%'+_0x34a3d3[_0x4afc('0x46')][_0x4afc('0x2e')]+'%'};return _0x5c72f0;})});}_0x435fe2=_[_0x4afc('0x57')]({},_0x435fe2,_0x34a3d3[_0x4afc('0x58')]);return db[_0x4afc('0xd4')][_0x4afc('0x21')]({'where':_0x435fe2[_0x4afc('0x40')]})[_0x4afc('0x12')](function(_0x567377){_0x51229c[_0x4afc('0x21')]=_0x567377;if(_0x34a3d3['query'][_0x4afc('0x41')]){_0x435fe2[_0x4afc('0x42')]=[{'all':!![]}];}return db[_0x4afc('0xd4')][_0x4afc('0xd0')](_0x435fe2);})[_0x4afc('0x12')](function(_0xfc07f8){_0x51229c[_0x4afc('0x45')]=_0xfc07f8;return _0x51229c;});}})[_0x4afc('0x12')](respondWithFilteredResult(_0x32a093,_0x435fe2))[_0x4afc('0x1b')](handleError(_0x32a093,null));};exports[_0x4afc('0xd6')]=function(_0x352f22,_0x1c0de1){var _0xf341ff={'raw':!![],'where':{}};var _0xe5cce1={};var _0x422111={'count':0x0,'rows':[]};return db['User'][_0x4afc('0x90')]({'where':{'id':_0x352f22['params']['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x1c0de1,null))[_0x4afc('0x12')](function(_0xb1e983){if(_0xb1e983){_0xe5cce1[_0x4afc('0x51')]=_[_0x4afc('0x53')](db[_0x4afc('0xd7')][_0x4afc('0x39')]);_0xe5cce1['query']=_[_0x4afc('0x53')](_0x352f22[_0x4afc('0x46')]);_0xe5cce1['filters']=_[_0x4afc('0x55')](_0xe5cce1[_0x4afc('0x51')],_0xe5cce1[_0x4afc('0x46')]);_0xf341ff[_0x4afc('0x43')]=_['intersection'](_0xe5cce1[_0x4afc('0x51')],qs[_0x4afc('0x56')](_0x352f22[_0x4afc('0x46')]['fields']));_0xf341ff['attributes']=_0xf341ff[_0x4afc('0x43')][_0x4afc('0x49')]?_0xf341ff[_0x4afc('0x43')]:_0xe5cce1['model'];if(!_0x352f22[_0x4afc('0x46')][_0x4afc('0xc7')](_0x4afc('0xcd'))){_0xf341ff[_0x4afc('0x20')]=qs[_0x4afc('0x20')](_0x352f22['query'][_0x4afc('0x20')]);_0xf341ff[_0x4afc('0x1e')]=qs[_0x4afc('0x1e')](_0x352f22[_0x4afc('0x46')]['offset']);}_0xf341ff[_0x4afc('0xc3')]=qs[_0x4afc('0xc4')](_0x352f22[_0x4afc('0x46')]['sort']);_0xf341ff['where']=qs[_0x4afc('0x54')](_[_0x4afc('0xc5')](_0x352f22[_0x4afc('0x46')],_0xe5cce1[_0x4afc('0x54')]));_0xf341ff[_0x4afc('0x40')][_0x4afc('0xd5')]=_0xb1e983['id'];if(_0x352f22[_0x4afc('0x46')][_0x4afc('0x2e')]){_0xf341ff[_0x4afc('0x40')]=_['merge'](_0xf341ff[_0x4afc('0x40')],{'$or':_[_0x4afc('0x2f')](_0xf341ff[_0x4afc('0x43')],function(_0x215cdd){var _0x48017e={};_0x48017e[_0x215cdd]={'$like':'%'+_0x352f22[_0x4afc('0x46')][_0x4afc('0x2e')]+'%'};return _0x48017e;})});}_0xf341ff=_[_0x4afc('0x57')]({},_0xf341ff,_0x352f22[_0x4afc('0x58')]);return db[_0x4afc('0xd7')][_0x4afc('0x21')]({'where':_0xf341ff[_0x4afc('0x40')]})[_0x4afc('0x12')](function(_0x417ae8){_0x422111[_0x4afc('0x21')]=_0x417ae8;if(_0x352f22[_0x4afc('0x46')]['includeAll']){_0xf341ff[_0x4afc('0x42')]=[{'all':!![]}];}return db[_0x4afc('0xd7')]['findAll'](_0xf341ff);})['then'](function(_0x52e013){_0x422111[_0x4afc('0x45')]=_0x52e013;return _0x422111;});}})[_0x4afc('0x12')](respondWithFilteredResult(_0x1c0de1,_0xf341ff))[_0x4afc('0x1b')](handleError(_0x1c0de1,null));};exports['getChatInteractions']=function(_0x118a09,_0x3305ec){var _0x170cab={};var _0x2ea4df={};var _0x29f115;var _0x39f011;return db[_0x4afc('0x38')][_0x4afc('0x90')]({'where':{'id':_0x118a09[_0x4afc('0x50')]['id']}})['then'](handleEntityNotFound(_0x3305ec,null))['then'](function(_0x274773){if(_0x274773){_0x29f115=_0x274773;_0x2ea4df['model']=_[_0x4afc('0x53')](db[_0x4afc('0xd8')][_0x4afc('0x39')]);_0x2ea4df[_0x4afc('0x46')]=_['keys'](_0x118a09[_0x4afc('0x46')]);_0x2ea4df[_0x4afc('0x54')]=_[_0x4afc('0x55')](_0x2ea4df[_0x4afc('0x51')],_0x2ea4df['query']);_0x170cab[_0x4afc('0x43')]=_[_0x4afc('0x55')](_0x2ea4df['model'],qs['fields'](_0x118a09[_0x4afc('0x46')]['fields']));_0x170cab[_0x4afc('0x43')]=_0x170cab['attributes'][_0x4afc('0x49')]?_0x170cab[_0x4afc('0x43')]:_0x2ea4df[_0x4afc('0x51')];_0x170cab[_0x4afc('0xc3')]=qs[_0x4afc('0xc4')](_0x118a09['query']['sort']);_0x170cab['where']=qs[_0x4afc('0x54')](_[_0x4afc('0xc5')](_0x118a09[_0x4afc('0x46')],_0x2ea4df[_0x4afc('0x54')]));if(_0x118a09[_0x4afc('0x46')][_0x4afc('0x2e')]){_0x170cab['where']=_[_0x4afc('0x57')](_0x170cab[_0x4afc('0x40')],{'$or':_[_0x4afc('0x2f')](_0x170cab[_0x4afc('0x43')],function(_0x259ba2){var _0x1e39dd={};_0x1e39dd[_0x259ba2]={'$like':'%'+_0x118a09['query']['filter']+'%'};return _0x1e39dd;})});}_0x170cab=_['merge']({},_0x170cab,_0x118a09[_0x4afc('0x58')]);return _0x29f115['getChatInteractions'](_0x170cab);}})[_0x4afc('0x12')](function(_0x520337){if(_0x520337){_0x39f011=_0x520337['length'];if(!_0x118a09[_0x4afc('0x46')][_0x4afc('0xc7')](_0x4afc('0xcd'))){_0x170cab[_0x4afc('0x20')]=qs[_0x4afc('0x20')](_0x118a09[_0x4afc('0x46')]['limit']);_0x170cab[_0x4afc('0x1e')]=qs[_0x4afc('0x1e')](_0x118a09['query'][_0x4afc('0x1e')]);}return _0x29f115[_0x4afc('0xd9')](_0x170cab);}})[_0x4afc('0x12')](function(_0x47e0bb){if(_0x47e0bb){return _0x47e0bb?{'count':_0x39f011,'rows':_0x47e0bb}:null;}})[_0x4afc('0x12')](respondWithResult(_0x3305ec,null))[_0x4afc('0x1b')](handleError(_0x3305ec,null));};exports[_0x4afc('0xda')]=function(_0x298466,_0x4268df){var _0x22d6d0={};var _0xb432b4={};var _0x1713fd;var _0x3b7648;return db[_0x4afc('0x38')][_0x4afc('0x90')]({'where':{'id':_0x298466[_0x4afc('0x50')]['id']}})['then'](handleEntityNotFound(_0x4268df,null))['then'](function(_0x5cbf5c){if(_0x5cbf5c){_0x1713fd=_0x5cbf5c;_0xb432b4[_0x4afc('0x51')]=_[_0x4afc('0x53')](db[_0x4afc('0xdb')][_0x4afc('0x39')]);_0xb432b4[_0x4afc('0x46')]=_['keys'](_0x298466[_0x4afc('0x46')]);_0xb432b4[_0x4afc('0x54')]=_[_0x4afc('0x55')](_0xb432b4['model'],_0xb432b4['query']);_0x22d6d0['attributes']=_[_0x4afc('0x55')](_0xb432b4[_0x4afc('0x51')],qs[_0x4afc('0x56')](_0x298466[_0x4afc('0x46')][_0x4afc('0x56')]));_0x22d6d0[_0x4afc('0x43')]=_0x22d6d0['attributes']['length']?_0x22d6d0['attributes']:_0xb432b4[_0x4afc('0x51')];_0x22d6d0[_0x4afc('0xc3')]=qs[_0x4afc('0xc4')](_0x298466[_0x4afc('0x46')]['sort']);_0x22d6d0[_0x4afc('0x40')]=qs[_0x4afc('0x54')](_[_0x4afc('0xc5')](_0x298466['query'],_0xb432b4[_0x4afc('0x54')]));if(_0x298466[_0x4afc('0x46')][_0x4afc('0x2e')]){_0x22d6d0[_0x4afc('0x40')]=_['merge'](_0x22d6d0['where'],{'$or':_[_0x4afc('0x2f')](_0x22d6d0[_0x4afc('0x43')],function(_0x375f24){var _0x5d0e3a={};_0x5d0e3a[_0x375f24]={'$like':'%'+_0x298466['query'][_0x4afc('0x2e')]+'%'};return _0x5d0e3a;})});}_0x22d6d0=_['merge']({},_0x22d6d0,_0x298466[_0x4afc('0x58')]);return _0x1713fd[_0x4afc('0xda')](_0x22d6d0);}})['then'](function(_0x13d4a4){if(_0x13d4a4){_0x3b7648=_0x13d4a4[_0x4afc('0x49')];if(!_0x298466[_0x4afc('0x46')]['hasOwnProperty'](_0x4afc('0xcd'))){_0x22d6d0[_0x4afc('0x20')]=qs['limit'](_0x298466[_0x4afc('0x46')]['limit']);_0x22d6d0['offset']=qs['offset'](_0x298466[_0x4afc('0x46')]['offset']);}return _0x1713fd[_0x4afc('0xda')](_0x22d6d0);}})['then'](function(_0x5780a3){if(_0x5780a3){return _0x5780a3?{'count':_0x3b7648,'rows':_0x5780a3}:null;}})[_0x4afc('0x12')](respondWithResult(_0x4268df,null))['catch'](handleError(_0x4268df,null));};exports['getMailInteractions']=function(_0x34785d,_0x561809){var _0x42d2b5={'raw':!![],'where':{}};var _0x2ec86c={};var _0x1aa3e3={'count':0x0,'rows':[]};return db[_0x4afc('0x38')][_0x4afc('0x90')]({'where':{'id':_0x34785d[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x561809,null))['then'](function(_0x5866c6){if(_0x5866c6){_0x2ec86c['model']=_['keys'](db[_0x4afc('0xdc')]['rawAttributes']);_0x2ec86c['query']=_[_0x4afc('0x53')](_0x34785d[_0x4afc('0x46')]);_0x2ec86c[_0x4afc('0x54')]=_[_0x4afc('0x55')](_0x2ec86c[_0x4afc('0x51')],_0x2ec86c['query']);_0x42d2b5[_0x4afc('0x43')]=_[_0x4afc('0x55')](_0x2ec86c[_0x4afc('0x51')],qs[_0x4afc('0x56')](_0x34785d[_0x4afc('0x46')][_0x4afc('0x56')]));_0x42d2b5['attributes']=_0x42d2b5[_0x4afc('0x43')][_0x4afc('0x49')]?_0x42d2b5['attributes']:_0x2ec86c[_0x4afc('0x51')];if(!_0x34785d[_0x4afc('0x46')][_0x4afc('0xc7')](_0x4afc('0xcd'))){_0x42d2b5[_0x4afc('0x20')]=qs[_0x4afc('0x20')](_0x34785d[_0x4afc('0x46')][_0x4afc('0x20')]);_0x42d2b5[_0x4afc('0x1e')]=qs[_0x4afc('0x1e')](_0x34785d[_0x4afc('0x46')][_0x4afc('0x1e')]);}_0x42d2b5[_0x4afc('0xc3')]=qs[_0x4afc('0xc4')](_0x34785d[_0x4afc('0x46')]['sort']);_0x42d2b5['where']=qs[_0x4afc('0x54')](_[_0x4afc('0xc5')](_0x34785d['query'],_0x2ec86c[_0x4afc('0x54')]));_0x42d2b5['where']['UserId']=_0x5866c6['id'];if(_0x34785d['query'][_0x4afc('0x2e')]){_0x42d2b5['where']=_[_0x4afc('0x57')](_0x42d2b5[_0x4afc('0x40')],{'$or':_[_0x4afc('0x2f')](_0x42d2b5[_0x4afc('0x43')],function(_0x515c5a){var _0x542683={};_0x542683[_0x515c5a]={'$like':'%'+_0x34785d['query'][_0x4afc('0x2e')]+'%'};return _0x542683;})});}_0x42d2b5=_[_0x4afc('0x57')]({},_0x42d2b5,_0x34785d[_0x4afc('0x58')]);return db[_0x4afc('0xdc')][_0x4afc('0x21')]({'where':_0x42d2b5[_0x4afc('0x40')]})[_0x4afc('0x12')](function(_0x394664){_0x1aa3e3[_0x4afc('0x21')]=_0x394664;if(_0x34785d['query'][_0x4afc('0x41')]){_0x42d2b5[_0x4afc('0x42')]=[{'all':!![]}];}return db['MailInteraction'][_0x4afc('0xd0')](_0x42d2b5);})['then'](function(_0x3186f8){_0x1aa3e3['rows']=_0x3186f8;return _0x1aa3e3;});}})[_0x4afc('0x12')](respondWithFilteredResult(_0x561809,_0x42d2b5))['catch'](handleError(_0x561809,null));};exports['getSmsInteractions']=function(_0x503222,_0x4bebe8){var _0x177089={};var _0x29f4b5={};var _0x430b9e;var _0x20340f;return db['User'][_0x4afc('0x90')]({'where':{'id':_0x503222[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x4bebe8,null))[_0x4afc('0x12')](function(_0x27f37e){if(_0x27f37e){_0x430b9e=_0x27f37e;_0x29f4b5[_0x4afc('0x51')]=_[_0x4afc('0x53')](db['SmsInteraction'][_0x4afc('0x39')]);_0x29f4b5[_0x4afc('0x46')]=_[_0x4afc('0x53')](_0x503222[_0x4afc('0x46')]);_0x29f4b5[_0x4afc('0x54')]=_[_0x4afc('0x55')](_0x29f4b5[_0x4afc('0x51')],_0x29f4b5[_0x4afc('0x46')]);_0x177089[_0x4afc('0x43')]=_[_0x4afc('0x55')](_0x29f4b5['model'],qs[_0x4afc('0x56')](_0x503222[_0x4afc('0x46')][_0x4afc('0x56')]));_0x177089['attributes']=_0x177089[_0x4afc('0x43')][_0x4afc('0x49')]?_0x177089[_0x4afc('0x43')]:_0x29f4b5[_0x4afc('0x51')];_0x177089['order']=qs['sort'](_0x503222[_0x4afc('0x46')]['sort']);_0x177089[_0x4afc('0x40')]=qs[_0x4afc('0x54')](_['pick'](_0x503222[_0x4afc('0x46')],_0x29f4b5['filters']));if(_0x503222[_0x4afc('0x46')][_0x4afc('0x2e')]){_0x177089[_0x4afc('0x40')]=_[_0x4afc('0x57')](_0x177089[_0x4afc('0x40')],{'$or':_[_0x4afc('0x2f')](_0x177089[_0x4afc('0x43')],function(_0x5c3f54){var _0x478719={};_0x478719[_0x5c3f54]={'$like':'%'+_0x503222[_0x4afc('0x46')][_0x4afc('0x2e')]+'%'};return _0x478719;})});}_0x177089=_[_0x4afc('0x57')]({},_0x177089,_0x503222[_0x4afc('0x58')]);return _0x430b9e[_0x4afc('0xdd')](_0x177089);}})['then'](function(_0x445c3f){if(_0x445c3f){_0x20340f=_0x445c3f[_0x4afc('0x49')];if(!_0x503222[_0x4afc('0x46')][_0x4afc('0xc7')]('nolimit')){_0x177089[_0x4afc('0x20')]=qs[_0x4afc('0x20')](_0x503222[_0x4afc('0x46')][_0x4afc('0x20')]);_0x177089[_0x4afc('0x1e')]=qs[_0x4afc('0x1e')](_0x503222[_0x4afc('0x46')][_0x4afc('0x1e')]);}return _0x430b9e['getSmsInteractions'](_0x177089);}})[_0x4afc('0x12')](function(_0x5024a5){if(_0x5024a5){return _0x5024a5?{'count':_0x20340f,'rows':_0x5024a5}:null;}})[_0x4afc('0x12')](respondWithResult(_0x4bebe8,null))['catch'](handleError(_0x4bebe8,null));};exports[_0x4afc('0xde')]=function(_0x5aa79a,_0x572cb7){var _0x3859cc={};var _0x2c1ca2={};var _0x2d99f8;var _0x48e77f;return db[_0x4afc('0x38')][_0x4afc('0x90')]({'where':{'id':_0x5aa79a[_0x4afc('0x50')]['id']}})['then'](handleEntityNotFound(_0x572cb7,null))[_0x4afc('0x12')](function(_0x2ac118){if(_0x2ac118){_0x2d99f8=_0x2ac118;_0x2c1ca2['model']=_[_0x4afc('0x53')](db[_0x4afc('0xdf')][_0x4afc('0x39')]);_0x2c1ca2['query']=_['keys'](_0x5aa79a['query']);_0x2c1ca2[_0x4afc('0x54')]=_[_0x4afc('0x55')](_0x2c1ca2[_0x4afc('0x51')],_0x2c1ca2[_0x4afc('0x46')]);_0x3859cc[_0x4afc('0x43')]=_[_0x4afc('0x55')](_0x2c1ca2[_0x4afc('0x51')],qs[_0x4afc('0x56')](_0x5aa79a['query']['fields']));_0x3859cc[_0x4afc('0x43')]=_0x3859cc[_0x4afc('0x43')][_0x4afc('0x49')]?_0x3859cc['attributes']:_0x2c1ca2[_0x4afc('0x51')];_0x3859cc[_0x4afc('0xc3')]=qs[_0x4afc('0xc4')](_0x5aa79a[_0x4afc('0x46')]['sort']);_0x3859cc['where']=qs[_0x4afc('0x54')](_[_0x4afc('0xc5')](_0x5aa79a[_0x4afc('0x46')],_0x2c1ca2[_0x4afc('0x54')]));if(_0x5aa79a[_0x4afc('0x46')][_0x4afc('0x2e')]){_0x3859cc['where']=_[_0x4afc('0x57')](_0x3859cc['where'],{'$or':_['map'](_0x3859cc[_0x4afc('0x43')],function(_0x354889){var _0x32269b={};_0x32269b[_0x354889]={'$like':'%'+_0x5aa79a[_0x4afc('0x46')][_0x4afc('0x2e')]+'%'};return _0x32269b;})});}_0x3859cc=_['merge']({},_0x3859cc,_0x5aa79a[_0x4afc('0x58')]);return _0x2d99f8[_0x4afc('0xde')](_0x3859cc);}})[_0x4afc('0x12')](function(_0x2a3f70){if(_0x2a3f70){_0x48e77f=_0x2a3f70[_0x4afc('0x49')];if(!_0x5aa79a['query'][_0x4afc('0xc7')]('nolimit')){_0x3859cc[_0x4afc('0x20')]=qs['limit'](_0x5aa79a[_0x4afc('0x46')][_0x4afc('0x20')]);_0x3859cc[_0x4afc('0x1e')]=qs[_0x4afc('0x1e')](_0x5aa79a[_0x4afc('0x46')]['offset']);}return _0x2d99f8[_0x4afc('0xde')](_0x3859cc);}})[_0x4afc('0x12')](function(_0x41340e){if(_0x41340e){return _0x41340e?{'count':_0x48e77f,'rows':_0x41340e}:null;}})[_0x4afc('0x12')](respondWithResult(_0x572cb7,null))[_0x4afc('0x1b')](handleError(_0x572cb7,null));};exports[_0x4afc('0xe0')]=function(_0x17cb33,_0x35723e){var _0x22d0f5={};var _0x36c4fc={};var _0x4b4ede;var _0x1f2a94;return db[_0x4afc('0x38')][_0x4afc('0x90')]({'where':{'id':_0x17cb33['params']['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x35723e,null))['then'](function(_0x2dfdc3){if(_0x2dfdc3){_0x4b4ede=_0x2dfdc3;_0x36c4fc[_0x4afc('0x51')]=_['keys'](db['WhatsappInteraction'][_0x4afc('0x39')]);_0x36c4fc['query']=_[_0x4afc('0x53')](_0x17cb33[_0x4afc('0x46')]);_0x36c4fc[_0x4afc('0x54')]=_['intersection'](_0x36c4fc[_0x4afc('0x51')],_0x36c4fc[_0x4afc('0x46')]);_0x22d0f5['attributes']=_['intersection'](_0x36c4fc[_0x4afc('0x51')],qs[_0x4afc('0x56')](_0x17cb33[_0x4afc('0x46')][_0x4afc('0x56')]));_0x22d0f5[_0x4afc('0x43')]=_0x22d0f5[_0x4afc('0x43')][_0x4afc('0x49')]?_0x22d0f5['attributes']:_0x36c4fc['model'];_0x22d0f5[_0x4afc('0xc3')]=qs[_0x4afc('0xc4')](_0x17cb33[_0x4afc('0x46')][_0x4afc('0xc4')]);_0x22d0f5[_0x4afc('0x40')]=qs['filters'](_[_0x4afc('0xc5')](_0x17cb33[_0x4afc('0x46')],_0x36c4fc[_0x4afc('0x54')]));if(_0x17cb33[_0x4afc('0x46')]['filter']){_0x22d0f5[_0x4afc('0x40')]=_['merge'](_0x22d0f5[_0x4afc('0x40')],{'$or':_[_0x4afc('0x2f')](_0x22d0f5[_0x4afc('0x43')],function(_0x413368){var _0x5c3467={};_0x5c3467[_0x413368]={'$like':'%'+_0x17cb33[_0x4afc('0x46')][_0x4afc('0x2e')]+'%'};return _0x5c3467;})});}_0x22d0f5=_[_0x4afc('0x57')]({},_0x22d0f5,_0x17cb33['options']);return _0x4b4ede[_0x4afc('0xe0')](_0x22d0f5);}})[_0x4afc('0x12')](function(_0x549d33){if(_0x549d33){_0x1f2a94=_0x549d33[_0x4afc('0x49')];if(!_0x17cb33[_0x4afc('0x46')]['hasOwnProperty'](_0x4afc('0xcd'))){_0x22d0f5[_0x4afc('0x20')]=qs[_0x4afc('0x20')](_0x17cb33[_0x4afc('0x46')][_0x4afc('0x20')]);_0x22d0f5[_0x4afc('0x1e')]=qs[_0x4afc('0x1e')](_0x17cb33[_0x4afc('0x46')]['offset']);}return _0x4b4ede[_0x4afc('0xe0')](_0x22d0f5);}})[_0x4afc('0x12')](function(_0x42e854){if(_0x42e854){return _0x42e854?{'count':_0x1f2a94,'rows':_0x42e854}:null;}})[_0x4afc('0x12')](respondWithResult(_0x35723e,null))[_0x4afc('0x1b')](handleError(_0x35723e,null));};exports[_0x4afc('0xe1')]=function(_0x2def3d,_0x5a5624,_0x3d8385){var _0x56eb0a;var _0x2a827d;var _0x3a85ae;var _0xf1d45c=!_[_0x4afc('0x64')](_0x2def3d[_0x4afc('0x50')]['id'])?_0x2def3d[_0x4afc('0x50')]['id']:!_[_0x4afc('0x64')](_0x2def3d[_0x4afc('0x29')]['id'])?_0x2def3d[_0x4afc('0x29')]['id']:null;return db['User'][_0x4afc('0x31')]({'where':{'id':_0xf1d45c,'role':{'$or':[_0x4afc('0x27'),_0x4afc('0x29'),_0x4afc('0x2b')]}},'attributes':['id',_0x4afc('0x36'),_0x4afc('0xe2'),_0x4afc('0xe3'),_0x4afc('0x26'),_0x4afc('0x63'),_0x4afc('0x97')]})[_0x4afc('0x12')](function(_0x438110){if(_0x438110){if(_0x438110[_0x4afc('0x26')]==='agent'){_0x56eb0a=_0x438110;if(_0x2def3d[_0x4afc('0x5a')][_0x4afc('0x99')]){_0x3a85ae=util['format'](_0x4afc('0xe4'),_0x56eb0a[_0x2def3d[_0x4afc('0x5a')][_0x4afc('0x99')]]);}else if(_0x2def3d[_0x4afc('0x5a')][_0x4afc('0xe5')]){_0x3a85ae=util['format'](_0x4afc('0xa6'),_0x2def3d[_0x4afc('0x5a')][_0x4afc('0xe5')]);}else{_0x3a85ae=util[_0x4afc('0xa5')](_0x4afc('0xa6'),_0x56eb0a[_0x4afc('0x36')]);}socket['to'](util['format'](_0x4afc('0xe6'),_0x56eb0a[_0x4afc('0x36')]))[_0x4afc('0xa1')](_0x4afc('0xe7'),{'user':{'id':_0x56eb0a['id'],'name':_0x56eb0a[_0x4afc('0x36')]},'ip':_0x2def3d[_0x4afc('0xe8')]['x-forwarded-for']||_0x2def3d[_0x4afc('0xe9')][_0x4afc('0xea')]||_0x2def3d[_0x4afc('0xeb')][_0x4afc('0xea')]||_0x2def3d[_0x4afc('0xe9')][_0x4afc('0xeb')]['remoteAddress']});return db[_0x4afc('0xa7')][_0x4afc('0x24')]({'where':{'membername':_0x56eb0a[_0x4afc('0x36')]},'individualHooks':!![]});}}else{throw new db[(_0x4afc('0x8a'))][(_0x4afc('0x8b'))](_0x4afc('0xec'));}})[_0x4afc('0x12')](function(){if(_0x56eb0a){return _0x56eb0a[_0x4afc('0xed')]({'raw':!![]});}})[_0x4afc('0x12')](function(_0x10a4b0){if(_0x56eb0a){var _0x32af65=[];if(_0x10a4b0){_0x2a827d=_0x10a4b0;if(_0x2a827d[_0x4afc('0x49')]){for(var _0x1f2cc9=0x0;_0x1f2cc9<_0x2a827d[_0x4afc('0x49')];_0x1f2cc9++){_0x32af65[_0x4afc('0x44')]({'membername':_0x56eb0a[_0x4afc('0x36')],'UserId':_0x56eb0a['id'],'queue_name':_0x2a827d[_0x1f2cc9][_0x4afc('0x36')],'VoiceQueueId':_0x2a827d[_0x1f2cc9]['id'],'interface':_0x3a85ae,'paused':_0x56eb0a[_0x4afc('0x97')]||![],'penalty':_0x2a827d[_0x1f2cc9][_0x4afc('0xee')]||0x0});}return BPromise['each'](_0x32af65,function(_0x17576c){return db[_0x4afc('0xa7')][_0x4afc('0xef')](_0x17576c);});}}}})[_0x4afc('0x12')](function(){if(_0x56eb0a){return db[_0x4afc('0xf0')][_0x4afc('0xd0')]({'where':{'membername':_0x56eb0a[_0x4afc('0x36')],'exitAt':null}});}})[_0x4afc('0x12')](function(_0xe7ba1f){if(_0x56eb0a){var _0x1df825=[];_0xe7ba1f[_0x4afc('0xf1')](function(_0x30af13){_0x1df825['push'](_0x30af13[_0x4afc('0x23')]({'exitAt':moment()[_0x4afc('0xa5')](_0x4afc('0xf2'))}));});return BPromise[_0x4afc('0x4f')](_0x1df825);}})[_0x4afc('0x12')](function(){if(_0x56eb0a){var _0x4eeed2=[];var _0x357d47=[];var _0x3ac087=utils['getChannels']();var _0x435d5c={'membername':_0x56eb0a[_0x4afc('0x36')],'interface':_0x3a85ae,'enterAt':moment()[_0x4afc('0xa5')](_0x4afc('0xf2')),'role':_0x56eb0a[_0x4afc('0x26')],'internal':_0x56eb0a[_0x4afc('0x63')]};_0x3ac087[_0x4afc('0xf1')](function(_0x33d0e2){_0x4eeed2[_0x4afc('0x44')](_['merge']({'channel':_0x33d0e2,'type':'LOGIN','data1':_0x2def3d[_0x4afc('0x5a')][_0x4afc('0xf3')],'data2':_0x3a85ae},_0x435d5c));if(_0x56eb0a['loginInPause']){_0x357d47['push'](_[_0x4afc('0x57')]({'channel':_0x33d0e2,'type':_0x4afc('0xf4'),'data1':_0x4afc('0xf5')},_0x435d5c));}});return db[_0x4afc('0xf0')][_0x4afc('0x84')](_0x4eeed2[_0x4afc('0xf6')](_0x357d47),{'individualHooks':!![]});}})[_0x4afc('0x12')](function(){if(_0x56eb0a){return _0x56eb0a[_0x4afc('0x23')]({'online':!![],'lastLoginAt':moment()['format'](_0x4afc('0xf2')),'voicePause':_0x56eb0a[_0x4afc('0x97')]||![],'mailPause':_0x56eb0a[_0x4afc('0x97')]||![],'chatPause':_0x56eb0a['loginInPause']||![],'faxPause':_0x56eb0a['loginInPause']||![],'smsPause':_0x56eb0a[_0x4afc('0x97')]||![],'openchannelPause':_0x56eb0a['loginInPause']||![],'whatsappPause':_0x56eb0a[_0x4afc('0x97')]||![],'pauseType':_0x56eb0a[_0x4afc('0x97')]?_0x4afc('0xf5'):null,'interface':_0x3a85ae,'lastPauseAt':moment()[_0x4afc('0xa5')](_0x4afc('0xf2'))});}})[_0x4afc('0x12')](function(_0x58b218){if(_0x2def3d[_0x4afc('0xf7')]){return _0x3d8385();}else{return BPromise[_0x4afc('0xf8')](_0x58b218)[_0x4afc('0x12')](respondWithResult(_0x5a5624,null));}})[_0x4afc('0x1b')](handleError(_0x5a5624,null));};exports[_0x4afc('0xf9')]=function(_0x2b40c0,_0x46310c){var _0x5f22db;return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0x2b40c0['params']['id'],'role':_0x4afc('0x2b')},'attributes':['id','name',_0x4afc('0x26')]})[_0x4afc('0x12')](handleEntityNotFound(_0x46310c,null))[_0x4afc('0x12')](function(_0x40cc7b){if(_0x40cc7b){_0x5f22db=_0x40cc7b;return db[_0x4afc('0xa7')][_0x4afc('0x24')]({'where':{'membername':_0x5f22db[_0x4afc('0x36')]},'individualHooks':!![]});}})[_0x4afc('0x12')](function(){return db[_0x4afc('0xf0')]['findAll']({'where':{'membername':_0x5f22db[_0x4afc('0x36')],'exitAt':null}});})[_0x4afc('0x12')](function(_0x3a160a){var _0xb43e79=[];_0x3a160a['forEach'](function(_0x1303da){_0xb43e79[_0x4afc('0x44')](_0x1303da[_0x4afc('0x23')]({'exitAt':moment()[_0x4afc('0xa5')](_0x4afc('0xf2'))}));});return BPromise[_0x4afc('0x4f')](_0xb43e79);})[_0x4afc('0x12')](function(){return _0x5f22db['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x46310c,null))[_0x4afc('0x1b')](handleError(_0x46310c,null));};exports[_0x4afc('0xfa')]=function(_0x311bb1,_0x39a6c9){var _0x4baa3f;return db[_0x4afc('0xa7')][_0x4afc('0x23')]({'paused':0x1},{'where':{'UserId':_0x311bb1['params']['id']},'individualHooks':!![]})[_0x4afc('0x12')](function(){return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0x311bb1['params']['id'],'role':_0x4afc('0x2b')},'attributes':['id',_0x4afc('0x36'),_0x4afc('0x26'),_0x4afc('0x63'),_0x4afc('0x99')]});})['then'](handleEntityNotFound(_0x39a6c9,null))['then'](function(_0xdf708b){if(_0xdf708b){_0x4baa3f=_0xdf708b;return respondWithRpcPromise(_0x4afc('0xfb'),_0x4afc('0xfa'),{'id':_0x4baa3f['id'],'name':_0x4baa3f[_0x4afc('0x36')],'pause':!![]});}})[_0x4afc('0x12')](function(){if(_0x4baa3f){return db[_0x4afc('0xf0')][_0x4afc('0xd0')]({'where':{'membername':_0x4baa3f[_0x4afc('0x36')],'type':_0x4afc('0xf4'),'exitAt':null}});}})[_0x4afc('0x12')](function(_0x3bf3be){if(_0x3bf3be[_0x4afc('0x49')]){var _0x10678f=moment()['format'](_0x4afc('0xf2'));for(var _0x28657e=0x0,_0x2623eb=_0x3bf3be[_0x4afc('0x49')];_0x28657e<_0x2623eb;_0x28657e++){_0x3bf3be[_0x28657e]['updateAttributes']({'exitAt':_0x10678f});}}})['then'](function(){var _0x30d57f=[];var _0x2f7637=utils[_0x4afc('0xfc')]();_0x2f7637[_0x4afc('0xf1')](function(_0x29a4e3){_0x30d57f['push']({'channel':_0x29a4e3,'membername':_0x4baa3f[_0x4afc('0x36')],'interface':_[_0x4afc('0x64')](_0x4baa3f['interface'])?util[_0x4afc('0xa5')](_0x4afc('0xa6'),_0x4baa3f[_0x4afc('0x36')]):_0x4baa3f['interface'],'type':_0x4afc('0xf4'),'enterAt':moment()[_0x4afc('0xa5')](_0x4afc('0xf2')),'data1':_0x311bb1[_0x4afc('0x5a')][_0x4afc('0x3b')]||'DEFAULT\x20PAUSE','role':_0x4baa3f[_0x4afc('0x26')],'internal':_0x4baa3f[_0x4afc('0x63')]});});return db[_0x4afc('0xf0')][_0x4afc('0x84')](_0x30d57f,{'individualHooks':!![]});})[_0x4afc('0x12')](function(){return _0x4baa3f[_0x4afc('0x23')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x311bb1[_0x4afc('0x5a')][_0x4afc('0x3b')]||_0x4afc('0xfd'),'lastPauseAt':moment()['format'](_0x4afc('0xf2'))});})[_0x4afc('0x12')](respondWithResult(_0x39a6c9,null))[_0x4afc('0x1b')](handleError(_0x39a6c9,null));};exports[_0x4afc('0xfe')]=function(_0x397064,_0x133048){var _0x4d1783;return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0x397064[_0x4afc('0x50')]['id']},'attributes':['id',_0x4afc('0x36'),'role',_0x4afc('0x98'),_0x4afc('0xff'),_0x4afc('0x100'),_0x4afc('0x101'),_0x4afc('0x102'),_0x4afc('0x103'),_0x4afc('0x104'),_0x4afc('0x105'),_0x4afc('0x106')]})[_0x4afc('0x12')](handleEntityNotFound(_0x133048,null))[_0x4afc('0x12')](function(_0x130820){if(_0x130820){_0x4d1783=_0x130820;if(_0x397064['body']['channel']&&!utils[_0x4afc('0x9a')](_0x397064[_0x4afc('0x5a')][_0x4afc('0x96')])){throw new db[(_0x4afc('0x8a'))]['ValidationError']('Unknown\x20channel');}switch(_0x397064[_0x4afc('0x5a')][_0x4afc('0x96')]){case'voice':return respondWithRpcPromise(_0x4afc('0xfb'),_0x4afc('0xfe'),{'id':_0x4d1783['id'],'name':_0x4d1783[_0x4afc('0x36')],'pause':![]})[_0x4afc('0x12')](function(){return db[_0x4afc('0xa7')]['update']({'paused':0x0},{'where':{'UserId':_0x4d1783['id']},'individualHooks':!![]});})[_0x4afc('0x12')](function(){return db[_0x4afc('0xf0')][_0x4afc('0x31')]({'where':{'channel':_0x397064[_0x4afc('0x5a')]['channel'],'membername':_0x4d1783['name'],'type':_0x4afc('0xf4'),'exitAt':null}});})[_0x4afc('0x12')](function(_0x47c223){if(_0x47c223){return _0x47c223['update']({'exitAt':moment()[_0x4afc('0xa5')](_0x4afc('0xf2')),'data2':_0x4afc('0x107')},{'individualHooks':!![]});}return null;})[_0x4afc('0x12')](function(){return _0x4d1783['update']({'voicePause':![]});});case _0x4afc('0x4e'):case _0x4afc('0x4a'):case'fax':case'sms':case'whatsapp':case'openchannel':return db[_0x4afc('0xf0')][_0x4afc('0x31')]({'where':{'channel':_0x397064[_0x4afc('0x5a')][_0x4afc('0x96')],'membername':_0x4d1783[_0x4afc('0x36')],'type':_0x4afc('0xf4'),'exitAt':null}})['then'](function(_0x14a78a){if(_0x14a78a){return _0x14a78a['update']({'exitAt':moment()[_0x4afc('0xa5')](_0x4afc('0xf2')),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0x4afc('0x12')](function(){var _0x4fa182={};_[_0x4afc('0x108')](_0x4fa182,util[_0x4afc('0xa5')](_0x4afc('0x109'),_0x397064['body'][_0x4afc('0x96')],'Pause'),![]);return _0x4d1783[_0x4afc('0x23')](_0x4fa182);});default:return respondWithRpcPromise(_0x4afc('0xfb'),_0x4afc('0xfe'),{'id':_0x4d1783['id'],'name':_0x4d1783[_0x4afc('0x36')],'pause':![]})['then'](function(){return db[_0x4afc('0xa7')][_0x4afc('0x23')]({'paused':0x0},{'where':{'UserId':_0x4d1783['id']}});})['then'](function(){return db[_0x4afc('0xf0')][_0x4afc('0xd0')]({'where':{'membername':_0x4d1783[_0x4afc('0x36')],'type':_0x4afc('0xf4'),'exitAt':null}});})[_0x4afc('0x12')](function(_0x3876fc){var _0x4e5371=[];_0x3876fc['forEach'](function(_0x382ad2){_0x4e5371[_0x4afc('0x44')](_0x382ad2[_0x4afc('0x23')]({'exitAt':moment()[_0x4afc('0xa5')](_0x4afc('0xf2')),'data2':_0x4afc('0x107')}));});return BPromise[_0x4afc('0x4f')](_0x4e5371);})['then'](function(){return _0x4d1783[_0x4afc('0x23')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x4afc('0x12')](respondWithResult(_0x133048,null))[_0x4afc('0x1b')](handleError(_0x133048,null));};exports[_0x4afc('0x10a')]=function(_0x58cc51,_0x2d1ee1){var _0x3e9536={};var _0x46b2e7={};var _0x9c6534;var _0x3fab9e;return db[_0x4afc('0x38')][_0x4afc('0x90')]({'where':{'id':_0x58cc51[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x2d1ee1,null))[_0x4afc('0x12')](function(_0x4f487e){if(_0x4f487e){_0x9c6534=_0x4f487e;_0x46b2e7[_0x4afc('0x51')]=_[_0x4afc('0x53')](db[_0x4afc('0x10b')][_0x4afc('0x39')]);_0x46b2e7[_0x4afc('0x46')]=_[_0x4afc('0x53')](_0x58cc51[_0x4afc('0x46')]);_0x46b2e7[_0x4afc('0x54')]=_[_0x4afc('0x55')](_0x46b2e7[_0x4afc('0x51')],_0x46b2e7[_0x4afc('0x46')]);_0x3e9536[_0x4afc('0x43')]=_[_0x4afc('0x55')](_0x46b2e7[_0x4afc('0x51')],qs[_0x4afc('0x56')](_0x58cc51['query'][_0x4afc('0x56')]));_0x3e9536['attributes']=_0x3e9536[_0x4afc('0x43')]['length']?_0x3e9536[_0x4afc('0x43')]:_0x46b2e7[_0x4afc('0x51')];_0x3e9536[_0x4afc('0xc3')]=qs[_0x4afc('0xc4')](_0x58cc51['query']['sort']);_0x3e9536[_0x4afc('0x40')]=qs['filters'](_[_0x4afc('0xc5')](_0x58cc51[_0x4afc('0x46')],_0x46b2e7[_0x4afc('0x54')]));if(_0x58cc51[_0x4afc('0x46')][_0x4afc('0x2e')]){_0x3e9536[_0x4afc('0x40')]=_['merge'](_0x3e9536[_0x4afc('0x40')],{'$or':_[_0x4afc('0x2f')](_0x3e9536[_0x4afc('0x43')],function(_0x355e67){var _0x43faa4={};_0x43faa4[_0x355e67]={'$like':'%'+_0x58cc51[_0x4afc('0x46')]['filter']+'%'};return _0x43faa4;})});}_0x3e9536=_[_0x4afc('0x57')]({},_0x3e9536,_0x58cc51[_0x4afc('0x58')]);return _0x9c6534['getTeams'](_0x3e9536);}})['then'](function(_0x3a2661){if(_0x3a2661){_0x3fab9e=_0x3a2661[_0x4afc('0x49')];if(!_0x58cc51['query'][_0x4afc('0xc7')](_0x4afc('0xcd'))){_0x3e9536[_0x4afc('0x20')]=qs[_0x4afc('0x20')](_0x58cc51[_0x4afc('0x46')]['limit']);_0x3e9536[_0x4afc('0x1e')]=qs[_0x4afc('0x1e')](_0x58cc51[_0x4afc('0x46')][_0x4afc('0x1e')]);}return _0x9c6534[_0x4afc('0x10a')](_0x3e9536);}})[_0x4afc('0x12')](function(_0x5edc1c){if(_0x5edc1c){return _0x5edc1c?{'count':_0x3fab9e,'rows':_0x5edc1c}:null;}})[_0x4afc('0x12')](respondWithResult(_0x2d1ee1,null))[_0x4afc('0x1b')](handleError(_0x2d1ee1,null));};exports['addTeams']=function(_0x5d44c7,_0x4b70cb){return db['User']['find']({'where':{'id':_0x5d44c7[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x4b70cb,null))[_0x4afc('0x12')](function(_0xa20838){if(_0xa20838){var _0x4f2947=_0xa20838[_0x4afc('0x25')]({'plain':!![]});return _0xa20838[_0x4afc('0x10c')](_0x5d44c7[_0x4afc('0x5a')][_0x4afc('0x5d')],_[_0x4afc('0x5e')](_0x5d44c7['body'],[_0x4afc('0x5d'),'id'])||{})[_0x4afc('0x12')](function(){for(var _0x332056=0x0;_0x332056<_0x5d44c7['body']['ids'][_0x4afc('0x49')];_0x332056++){var _0x199fd8=[];var _0xcbf49d={};db[_0x4afc('0x10b')][_0x4afc('0x90')]({'where':{'id':_0x5d44c7[_0x4afc('0x5a')][_0x4afc('0x5d')][_0x332056]}})['then'](function(_0x49f682){_0xcbf49d=_0x49f682['dataValues'];_0x199fd8[_0x4afc('0x44')](_0x49f682['getVoiceQueues']()['then'](function(_0x4656a0){for(var _0x464ad8=0x0;_0x464ad8<_0x4656a0[_0x4afc('0x49')];_0x464ad8++){_0x4656a0[_0x464ad8]['setDataValue'](_0x4afc('0x96'),_0x4afc('0x10d'));}return _0x4656a0;}));_0x199fd8[_0x4afc('0x44')](_0x49f682[_0x4afc('0x10e')]()[_0x4afc('0x12')](function(_0x16a434){for(var _0x422da2=0x0;_0x422da2<_0x16a434[_0x4afc('0x49')];_0x422da2++){_0x16a434[_0x422da2][_0x4afc('0x10f')]('channel',_0x4afc('0x110'));}return _0x16a434;}));_0x199fd8['push'](_0x49f682[_0x4afc('0x111')]()['then'](function(_0x2f9b54){for(var _0x2d4e0e=0x0;_0x2d4e0e<_0x2f9b54[_0x4afc('0x49')];_0x2d4e0e++){_0x2f9b54[_0x2d4e0e][_0x4afc('0x10f')](_0x4afc('0x96'),_0x4afc('0x112'));}return _0x2f9b54;}));_0x199fd8['push'](_0x49f682[_0x4afc('0x113')]()[_0x4afc('0x12')](function(_0x5b4f52){for(var _0x5af786=0x0;_0x5af786<_0x5b4f52['length'];_0x5af786++){_0x5b4f52[_0x5af786][_0x4afc('0x10f')](_0x4afc('0x96'),_0x4afc('0x114'));}return _0x5b4f52;}));_0x199fd8[_0x4afc('0x44')](_0x49f682[_0x4afc('0x115')]()[_0x4afc('0x12')](function(_0x25fc47){for(var _0x5da18=0x0;_0x5da18<_0x25fc47['length'];_0x5da18++){_0x25fc47[_0x5da18][_0x4afc('0x10f')](_0x4afc('0x96'),_0x4afc('0x116'));}return _0x25fc47;}));_0x199fd8[_0x4afc('0x44')](_0x49f682[_0x4afc('0x117')]()[_0x4afc('0x12')](function(_0x1890f4){for(var _0x1e1ddd=0x0;_0x1e1ddd<_0x1890f4[_0x4afc('0x49')];_0x1e1ddd++){_0x1890f4[_0x1e1ddd]['setDataValue'](_0x4afc('0x96'),_0x4afc('0x118'));}return _0x1890f4;}));_0x199fd8[_0x4afc('0x44')](_0x49f682[_0x4afc('0x119')]()[_0x4afc('0x12')](function(_0x24e508){for(var _0xc5b2ac=0x0;_0xc5b2ac<_0x24e508[_0x4afc('0x49')];_0xc5b2ac++){_0x24e508[_0xc5b2ac][_0x4afc('0x10f')](_0x4afc('0x96'),_0x4afc('0x11a'));}return _0x24e508;}));return BPromise['all'](_0x199fd8);})[_0x4afc('0x12')](function(_0x42e26d){var _0x429e5c=_[_0x4afc('0x11b')](_0x42e26d);_0x199fd8=[];return db[_0x4afc('0x66')][_0x4afc('0x11c')](function(_0x581d3a){for(var _0x318da6=0x0;_0x318da6<_0x429e5c[_0x4afc('0x49')];_0x318da6++){_0x199fd8['push'](_0x429e5c[_0x318da6][_0x4afc('0x11d')](_0x4f2947['id']),{'transaction':_0x581d3a});}return BPromise[_0x4afc('0x4f')](_0x199fd8)['then'](function(){if(_0x4f2947[_0x4afc('0xa4')]){return BPromise[_0x4afc('0x86')](_[_0x4afc('0x2e')](_0x429e5c,function(_0x68340f){return _0x68340f[_0x4afc('0x11e')](_0x4afc('0x96'))===_0x4afc('0x10d');}),function(_0x14e2df){return db['UserVoiceQueueRt'][_0x4afc('0xef')]({'membername':_0x4f2947[_0x4afc('0x36')],'UserId':_0x4f2947['id'],'queue_name':_0x14e2df[_0x4afc('0x36')],'VoiceQueueId':_0x14e2df['id'],'interface':_[_0x4afc('0x64')](_0x4f2947['interface'])?util[_0x4afc('0xa5')](_0x4afc('0xa6'),_0x4f2947['name']):_0x4f2947['interface'],'paused':_0x4f2947[_0x4afc('0x98')]||![],'penalty':_0x4f2947[_0x4afc('0x9e')]},{'transaction':_0x581d3a});});}else{return;}})[_0x4afc('0x12')](function(){for(var _0x12bb08=0x0;_0x12bb08<_0x429e5c[_0x4afc('0x49')];_0x12bb08++){var _0x30328e=_0x429e5c[_0x12bb08][_0x4afc('0x11e')](_0x4afc('0x96'));var _0x6039e0=_0x30328e+'QueueId';socket['emit'](_0x4afc('0x29')+_0x30328e+_0x4afc('0xa2'),{'UserId':_0x4f2947['id'],['queueField']:_0x429e5c[_0x12bb08]['id']});}});});})[_0x4afc('0x12')](function(){db[_0x4afc('0x11f')][_0x4afc('0x90')]({'where':{'teamId':_0xcbf49d['id']}})['then'](function(_0x70521a){if(_0x70521a){db[_0x4afc('0x120')][_0x4afc('0x79')]({'UserId':_0x5d44c7['params']['id'],'VoicePrefixId':_0x70521a['VoicePrefixId']});}});});}});}})[_0x4afc('0x12')](respondWithStatusCode(_0x4b70cb,null))[_0x4afc('0x1b')](handleError(_0x4b70cb,null));};exports[_0x4afc('0x121')]=function(_0x3bcd5a,_0x269978){return db['User']['findOne']({'where':{'id':_0x3bcd5a[_0x4afc('0x50')]['id']}})['then'](handleEntityNotFound(_0x269978,null))[_0x4afc('0x12')](function(_0x54ea77){if(_0x54ea77){var _0x15d7e0=_0x54ea77[_0x4afc('0x25')]({'plain':!![]});var _0x3a2047=_0x3bcd5a['query'][_0x4afc('0x5d')];return _0x54ea77[_0x4afc('0x121')](_0x3a2047)[_0x4afc('0x12')](function(){for(var _0x5b83fb=0x0;_0x5b83fb<_0x3a2047[_0x4afc('0x49')];_0x5b83fb++){var _0x17f318=[];var _0x1bcc01={};db[_0x4afc('0x10b')]['findOne']({'where':{'id':_0x3a2047[_0x5b83fb]}})[_0x4afc('0x12')](function(_0x5e0eff){_0x1bcc01=_0x5e0eff['dataValues'];_0x17f318['push'](_0x5e0eff[_0x4afc('0xed')]()[_0x4afc('0x12')](function(_0xdf6808){for(var _0x32a48f=0x0;_0x32a48f<_0xdf6808['length'];_0x32a48f++){_0xdf6808[_0x32a48f][_0x4afc('0x10f')](_0x4afc('0x96'),'Voice');}return _0xdf6808;}));_0x17f318[_0x4afc('0x44')](_0x5e0eff[_0x4afc('0x10e')]()[_0x4afc('0x12')](function(_0x5bdb93){for(var _0x50abae=0x0;_0x50abae<_0x5bdb93['length'];_0x50abae++){_0x5bdb93[_0x50abae][_0x4afc('0x10f')]('channel',_0x4afc('0x110'));}return _0x5bdb93;}));_0x17f318[_0x4afc('0x44')](_0x5e0eff['getMailQueues']()[_0x4afc('0x12')](function(_0x189d77){for(var _0x4fa7b7=0x0;_0x4fa7b7<_0x189d77[_0x4afc('0x49')];_0x4fa7b7++){_0x189d77[_0x4fa7b7]['setDataValue'](_0x4afc('0x96'),'Mail');}return _0x189d77;}));_0x17f318[_0x4afc('0x44')](_0x5e0eff[_0x4afc('0x113')]()[_0x4afc('0x12')](function(_0xe0435d){for(var _0x1d6cf4=0x0;_0x1d6cf4<_0xe0435d[_0x4afc('0x49')];_0x1d6cf4++){_0xe0435d[_0x1d6cf4]['setDataValue'](_0x4afc('0x96'),_0x4afc('0x114'));}return _0xe0435d;}));_0x17f318[_0x4afc('0x44')](_0x5e0eff[_0x4afc('0x115')]()[_0x4afc('0x12')](function(_0x4cfdc9){for(var _0x50cc37=0x0;_0x50cc37<_0x4cfdc9['length'];_0x50cc37++){_0x4cfdc9[_0x50cc37][_0x4afc('0x10f')]('channel',_0x4afc('0x116'));}return _0x4cfdc9;}));_0x17f318[_0x4afc('0x44')](_0x5e0eff[_0x4afc('0x117')]()[_0x4afc('0x12')](function(_0x550f47){for(var _0x1d33b7=0x0;_0x1d33b7<_0x550f47[_0x4afc('0x49')];_0x1d33b7++){_0x550f47[_0x1d33b7][_0x4afc('0x10f')]('channel',_0x4afc('0x118'));}return _0x550f47;}));_0x17f318[_0x4afc('0x44')](_0x5e0eff[_0x4afc('0x119')]()[_0x4afc('0x12')](function(_0x5ee897){for(var _0x5c6313=0x0;_0x5c6313<_0x5ee897[_0x4afc('0x49')];_0x5c6313++){_0x5ee897[_0x5c6313][_0x4afc('0x10f')](_0x4afc('0x96'),'Openchannel');}return _0x5ee897;}));return BPromise['all'](_0x17f318);})[_0x4afc('0x12')](function(_0x7611ab){var _0x3efdfe=_[_0x4afc('0x11b')](_0x7611ab);_0x17f318=[];return db[_0x4afc('0x66')][_0x4afc('0x11c')](function(_0x4742d8){for(var _0x389a20=0x0;_0x389a20<_0x3efdfe[_0x4afc('0x49')];_0x389a20++){_0x17f318[_0x4afc('0x44')](_0x3efdfe[_0x389a20][_0x4afc('0x122')](_0x15d7e0['id']),{'transaction':_0x4742d8});}return BPromise[_0x4afc('0x4f')](_0x17f318)[_0x4afc('0x12')](function(){if(_0x15d7e0[_0x4afc('0xa4')]){return BPromise['each'](_['filter'](_0x3efdfe,function(_0x572619){return _0x572619[_0x4afc('0x11e')](_0x4afc('0x96'))==='Voice';}),function(_0x689130){return db[_0x4afc('0xa7')][_0x4afc('0x24')]({'where':{'VoiceQueueId':_0x689130['id'],'UserId':_0x15d7e0['id']},'transaction':_0x4742d8});});}else{return;}})[_0x4afc('0x12')](function(){db[_0x4afc('0x11f')]['findOne']({'where':{'teamId':_0x1bcc01['id']}})[_0x4afc('0x12')](function(_0x26626a){if(_0x26626a){return db[_0x4afc('0x120')]['destroy']({'where':{'UserId':_0x15d7e0['id'],'VoicePrefixId':_0x26626a[_0x4afc('0x4c')][_0x4afc('0x123')]}});}});})['then'](function(){for(var _0x532d6a=0x0;_0x532d6a<_0x3efdfe['length'];_0x532d6a++){var _0x1de888=_0x3efdfe[_0x532d6a][_0x4afc('0x11e')](_0x4afc('0x96'));var _0x353b1f=_0x1de888+_0x4afc('0xa0');socket[_0x4afc('0xa1')]('user'+_0x1de888+'Queue:remove',{'UserId':_0x15d7e0['id'],['queueField']:_0x3efdfe[_0x532d6a]['id']});}});});});}});}})[_0x4afc('0x12')](respondWithStatusCode(_0x269978,null))['catch'](handleError(_0x269978,null));};exports[_0x4afc('0x124')]=function(_0xb0771d,_0x10b3bf){var _0xbde174={};var _0xedf1fb={};var _0x340b7e;var _0x4389c1;return db[_0x4afc('0x38')]['findOne']({'where':{'id':_0xb0771d['params']['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x10b3bf,null))['then'](function(_0x52b5ae){if(_0x52b5ae){_0x340b7e=_0x52b5ae;_0xedf1fb[_0x4afc('0x51')]=_[_0x4afc('0x53')](db['CmList'][_0x4afc('0x39')]);_0xedf1fb[_0x4afc('0x46')]=_[_0x4afc('0x53')](_0xb0771d['query']);_0xedf1fb[_0x4afc('0x54')]=_[_0x4afc('0x55')](_0xedf1fb[_0x4afc('0x51')],_0xedf1fb['query']);_0xbde174[_0x4afc('0x43')]=_[_0x4afc('0x55')](_0xedf1fb[_0x4afc('0x51')],qs['fields'](_0xb0771d[_0x4afc('0x46')][_0x4afc('0x56')]));_0xbde174[_0x4afc('0x43')]=_0xbde174[_0x4afc('0x43')]['length']?_0xbde174[_0x4afc('0x43')]:_0xedf1fb['model'];_0xbde174[_0x4afc('0xc3')]=qs[_0x4afc('0xc4')](_0xb0771d[_0x4afc('0x46')]['sort']);_0xbde174[_0x4afc('0x40')]=qs[_0x4afc('0x54')](_[_0x4afc('0xc5')](_0xb0771d[_0x4afc('0x46')],_0xedf1fb[_0x4afc('0x54')]));if(_0xb0771d[_0x4afc('0x46')][_0x4afc('0x2e')]){_0xbde174[_0x4afc('0x40')]=_['merge'](_0xbde174[_0x4afc('0x40')],{'$or':_['map'](_0xbde174[_0x4afc('0x43')],function(_0x2b4938){var _0x243f28={};_0x243f28[_0x2b4938]={'$like':'%'+_0xb0771d['query'][_0x4afc('0x2e')]+'%'};return _0x243f28;})});}_0xbde174=_['merge']({},_0xbde174,_0xb0771d[_0x4afc('0x58')]);return _0x340b7e[_0x4afc('0x124')](_0xbde174);}})['then'](function(_0x5143cc){if(_0x5143cc){_0x4389c1=_0x5143cc[_0x4afc('0x49')];if(!_0xb0771d[_0x4afc('0x46')][_0x4afc('0xc7')](_0x4afc('0xcd'))){_0xbde174[_0x4afc('0x20')]=qs['limit'](_0xb0771d[_0x4afc('0x46')][_0x4afc('0x20')]);_0xbde174[_0x4afc('0x1e')]=qs[_0x4afc('0x1e')](_0xb0771d['query'][_0x4afc('0x1e')]);}return _0x340b7e[_0x4afc('0x124')](_0xbde174);}})['then'](function(_0x47e847){if(_0x47e847){return _0x47e847?{'count':_0x4389c1,'rows':_0x47e847}:null;}})[_0x4afc('0x12')](respondWithResult(_0x10b3bf,null))['catch'](handleError(_0x10b3bf,null));};exports[_0x4afc('0x125')]=function(_0x537f54,_0xba85ff){var _0x499838={};var _0x478ca6={};var _0x3a52c6;var _0x2cf812;return db[_0x4afc('0x38')][_0x4afc('0x90')]({'where':{'id':_0x537f54[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0xba85ff,null))[_0x4afc('0x12')](function(_0x37924d){if(_0x37924d){_0x3a52c6=_0x37924d;_0x478ca6[_0x4afc('0x51')]=_[_0x4afc('0x53')](db[_0x4afc('0x38')]['rawAttributes']);_0x478ca6[_0x4afc('0x46')]=_[_0x4afc('0x53')](_0x537f54[_0x4afc('0x46')]);_0x478ca6[_0x4afc('0x54')]=_['intersection'](_0x478ca6[_0x4afc('0x51')],_0x478ca6[_0x4afc('0x46')]);_0x499838['attributes']=_['intersection'](_0x478ca6['model'],qs[_0x4afc('0x56')](_0x537f54[_0x4afc('0x46')][_0x4afc('0x56')]));_0x499838[_0x4afc('0x43')]=_0x499838[_0x4afc('0x43')][_0x4afc('0x49')]?_0x499838[_0x4afc('0x43')]:_0x478ca6[_0x4afc('0x51')];_0x499838['order']=qs[_0x4afc('0xc4')](_0x537f54[_0x4afc('0x46')]['sort']);_0x499838['where']=qs['filters'](_[_0x4afc('0xc5')](_0x537f54[_0x4afc('0x46')],_0x478ca6['filters']));if(_0x537f54[_0x4afc('0x46')][_0x4afc('0x2e')]){_0x499838[_0x4afc('0x40')]=_['merge'](_0x499838[_0x4afc('0x40')],{'$or':_[_0x4afc('0x2f')](_0x499838[_0x4afc('0x43')],function(_0x5513c3){var _0x4c94a1={};_0x4c94a1[_0x5513c3]={'$like':'%'+_0x537f54[_0x4afc('0x46')][_0x4afc('0x2e')]+'%'};return _0x4c94a1;})});}_0x499838['model']=db['User'];_0x499838['as']=_0x4afc('0x2a');_0x499838=_[_0x4afc('0x57')]({},_0x499838,_0x537f54[_0x4afc('0x58')]);return _0x3a52c6[_0x4afc('0xed')]({'include':[_0x499838]});}})[_0x4afc('0x12')](function(_0x3c9d31){if(_0x3c9d31){var _0x5cabb8={},_0x422523=[],_0x1b0af7=0x0;for(var _0x2a597f=0x0;_0x2a597f<_0x3c9d31[_0x4afc('0x49')];_0x2a597f+=0x1){for(var _0x298453=0x0,_0x110424;_0x298453<_0x3c9d31[_0x2a597f]['Agents'][_0x4afc('0x49')];_0x298453+=0x1){_0x110424=_0x3c9d31[_0x2a597f][_0x4afc('0x2a')][_0x298453][_0x4afc('0x25')]({'plain':!![]});_0x5cabb8[_0x110424['id']]=_0x110424;}}_0x5cabb8=_[_0x4afc('0x126')](_0x5cabb8);for(var _0x59636d=qs[_0x4afc('0x1e')](_0x537f54[_0x4afc('0x46')][_0x4afc('0x1e')]);_0x59636d<_0x5cabb8[_0x4afc('0x49')]&&_0x422523[_0x4afc('0x49')]<qs['limit'](_0x537f54['query'][_0x4afc('0x20')]);_0x59636d+=0x1){if(_0x5cabb8[_0x59636d]){_0x422523['push'](_0x5cabb8[_0x59636d]);}}return{'count':_0x5cabb8[_0x4afc('0x49')],'rows':_0x422523};}})[_0x4afc('0x12')](respondWithResult(_0xba85ff,null))[_0x4afc('0x1b')](handleError(_0xba85ff,null));};exports[_0x4afc('0x24')]=function(_0x58b146,_0x3b5e42){if(_0x58b146[_0x4afc('0x29')]['id']==_0x58b146[_0x4afc('0x50')]['id']){return _0x3b5e42[_0x4afc('0x1d')](0x1f4)[_0x4afc('0x127')]({'message':_0x4afc('0x128')});}return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0x58b146[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x3b5e42,null))[_0x4afc('0x12')](removeEntity(_0x3b5e42,null))[_0x4afc('0x1b')](handleError(_0x3b5e42,null));};exports[_0x4afc('0x129')]=function(_0x1270c9,_0xb5cf48){return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0x1270c9[_0x4afc('0x50')]['id']}})['then'](handleEntityNotFound(_0xb5cf48,null))[_0x4afc('0x12')](function(_0x4fcbf4){if(_0x4fcbf4){return _0x4fcbf4['addChatInteractions'](_0x1270c9[_0x4afc('0x5a')]['ids'],_[_0x4afc('0x5e')](_0x1270c9[_0x4afc('0x5a')],[_0x4afc('0x5d'),'id'])||{})['spread'](function(){for(var _0xee6f3=0x0;_0xee6f3<_0x1270c9[_0x4afc('0x5a')][_0x4afc('0x5d')][_0x4afc('0x49')];_0xee6f3+=0x1){socket[_0x4afc('0xa1')](_0x4afc('0x12a'),{'ChatInteractionId':Number(_0x1270c9[_0x4afc('0x5a')][_0x4afc('0x5d')][_0xee6f3]),'UserId':Number(_0x1270c9[_0x4afc('0x50')]['id'])});}return _0x1270c9[_0x4afc('0x5a')][_0x4afc('0x5d')];});}})[_0x4afc('0x12')](respondWithResult(_0xb5cf48,null))[_0x4afc('0x1b')](handleError(_0xb5cf48,null));};exports['removeChatInteractions']=function(_0x761f36,_0x3b028c){return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0x761f36[_0x4afc('0x50')]['id']}})['then'](handleEntityNotFound(_0x3b028c,null))[_0x4afc('0x12')](function(_0x2ba979){if(_0x2ba979){return _0x2ba979[_0x4afc('0x12b')](_0x761f36[_0x4afc('0x46')][_0x4afc('0x5d')])[_0x4afc('0x12')](function(){if(_['isArray'](_0x761f36[_0x4afc('0x46')]['ids'])){for(var _0x24b9ac=0x0;_0x24b9ac<_0x761f36[_0x4afc('0x46')][_0x4afc('0x5d')][_0x4afc('0x49')];_0x24b9ac+=0x1){socket[_0x4afc('0xa1')](_0x4afc('0x12c'),{'ChatInteractionId':Number(_0x761f36[_0x4afc('0x46')][_0x4afc('0x5d')][_0x24b9ac]),'UserId':Number(_0x761f36[_0x4afc('0x50')]['id'])});}}else{socket['emit'](_0x4afc('0x12c'),{'ChatInteractionId':Number(_0x761f36['query'][_0x4afc('0x5d')]),'UserId':Number(_0x761f36[_0x4afc('0x50')]['id'])});}});}})[_0x4afc('0x12')](respondWithStatusCode(_0x3b028c,null))['catch'](handleError(_0x3b028c,null));};exports['addMailInteractions']=function(_0x16124c,_0x4639ee){return db['User'][_0x4afc('0x31')]({'where':{'id':_0x16124c[_0x4afc('0x50')]['id']}})['then'](handleEntityNotFound(_0x4639ee,null))[_0x4afc('0x12')](function(_0xe6b27c){if(_0xe6b27c){return _0xe6b27c['addMailInteractions'](_0x16124c[_0x4afc('0x5a')][_0x4afc('0x5d')],_[_0x4afc('0x5e')](_0x16124c[_0x4afc('0x5a')],[_0x4afc('0x5d'),'id'])||{})[_0x4afc('0x9f')](function(){for(var _0x351edb=0x0;_0x351edb<_0x16124c['body']['ids'][_0x4afc('0x49')];_0x351edb+=0x1){socket['emit'](_0x4afc('0x12d'),{'MailInteractionId':Number(_0x16124c[_0x4afc('0x5a')][_0x4afc('0x5d')][_0x351edb]),'UserId':Number(_0x16124c[_0x4afc('0x50')]['id'])});}return _0x16124c[_0x4afc('0x5a')][_0x4afc('0x5d')];});}})['then'](respondWithResult(_0x4639ee,null))['catch'](handleError(_0x4639ee,null));};exports[_0x4afc('0x12e')]=function(_0x5c65ae,_0x5fbae8){return db[_0x4afc('0x38')]['find']({'where':{'id':_0x5c65ae[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x5fbae8,null))[_0x4afc('0x12')](function(_0x7efc52){if(_0x7efc52){return _0x7efc52[_0x4afc('0x12e')](_0x5c65ae[_0x4afc('0x46')][_0x4afc('0x5d')])['then'](function(){if(_[_0x4afc('0xac')](_0x5c65ae[_0x4afc('0x46')][_0x4afc('0x5d')])){for(var _0x1b4109=0x0;_0x1b4109<_0x5c65ae[_0x4afc('0x46')]['ids'][_0x4afc('0x49')];_0x1b4109+=0x1){socket[_0x4afc('0xa1')](_0x4afc('0x12f'),{'MailInteractionId':Number(_0x5c65ae[_0x4afc('0x46')][_0x4afc('0x5d')][_0x1b4109]),'UserId':Number(_0x5c65ae[_0x4afc('0x50')]['id'])});}}else{socket[_0x4afc('0xa1')](_0x4afc('0x12f'),{'MailInteractionId':Number(_0x5c65ae[_0x4afc('0x46')][_0x4afc('0x5d')]),'UserId':Number(_0x5c65ae[_0x4afc('0x50')]['id'])});}});}})['then'](respondWithStatusCode(_0x5fbae8,null))[_0x4afc('0x1b')](handleError(_0x5fbae8,null));};exports[_0x4afc('0x130')]=function(_0x1c2610,_0xa92c5a){return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0x1c2610[_0x4afc('0x50')]['id']}})['then'](handleEntityNotFound(_0xa92c5a,null))[_0x4afc('0x12')](function(_0x4676c4){if(_0x4676c4){return _0x4676c4[_0x4afc('0x130')](_0x1c2610[_0x4afc('0x5a')][_0x4afc('0x5d')],_['omit'](_0x1c2610[_0x4afc('0x5a')],[_0x4afc('0x5d'),'id'])||{})[_0x4afc('0x9f')](function(){for(var _0x561718=0x0;_0x561718<_0x1c2610[_0x4afc('0x5a')][_0x4afc('0x5d')][_0x4afc('0x49')];_0x561718+=0x1){socket['emit'](_0x4afc('0x131'),{'FaxInteractionId':Number(_0x1c2610[_0x4afc('0x5a')]['ids'][_0x561718]),'UserId':Number(_0x1c2610[_0x4afc('0x50')]['id'])});}return _0x1c2610[_0x4afc('0x5a')]['ids'];});}})[_0x4afc('0x12')](respondWithResult(_0xa92c5a,null))['catch'](handleError(_0xa92c5a,null));};exports['removeFaxInteractions']=function(_0x47d3e8,_0xa0c516){return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0x47d3e8[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0xa0c516,null))['then'](function(_0x38ec15){if(_0x38ec15){return _0x38ec15['removeFaxInteractions'](_0x47d3e8['query'][_0x4afc('0x5d')])[_0x4afc('0x12')](function(){if(_[_0x4afc('0xac')](_0x47d3e8['query'][_0x4afc('0x5d')])){for(var _0x4b5692=0x0;_0x4b5692<_0x47d3e8[_0x4afc('0x46')][_0x4afc('0x5d')]['length'];_0x4b5692+=0x1){socket['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x47d3e8['query'][_0x4afc('0x5d')][_0x4b5692]),'UserId':Number(_0x47d3e8[_0x4afc('0x50')]['id'])});}}else{socket[_0x4afc('0xa1')](_0x4afc('0x132'),{'FaxInteractionId':Number(_0x47d3e8['query'][_0x4afc('0x5d')]),'UserId':Number(_0x47d3e8[_0x4afc('0x50')]['id'])});}});}})[_0x4afc('0x12')](respondWithStatusCode(_0xa0c516,null))[_0x4afc('0x1b')](handleError(_0xa0c516,null));};exports[_0x4afc('0x133')]=function(_0x133a59,_0x2719ea){return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0x133a59[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x2719ea,null))[_0x4afc('0x12')](function(_0x4cc1f1){if(_0x4cc1f1){return _0x4cc1f1[_0x4afc('0x133')](_0x133a59[_0x4afc('0x5a')][_0x4afc('0x5d')],_['omit'](_0x133a59[_0x4afc('0x5a')],['ids','id'])||{})[_0x4afc('0x9f')](function(){for(var _0x18a0a5=0x0;_0x18a0a5<_0x133a59['body'][_0x4afc('0x5d')][_0x4afc('0x49')];_0x18a0a5+=0x1){socket['emit'](_0x4afc('0x134'),{'SmsInteractionId':Number(_0x133a59[_0x4afc('0x5a')][_0x4afc('0x5d')][_0x18a0a5]),'UserId':Number(_0x133a59[_0x4afc('0x50')]['id'])});}return _0x133a59[_0x4afc('0x5a')][_0x4afc('0x5d')];});}})['then'](respondWithResult(_0x2719ea,null))[_0x4afc('0x1b')](handleError(_0x2719ea,null));};exports[_0x4afc('0x135')]=function(_0x36aa3f,_0x14d944){return db[_0x4afc('0x38')]['find']({'where':{'id':_0x36aa3f[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x14d944,null))['then'](function(_0x5d244d){if(_0x5d244d){return _0x5d244d[_0x4afc('0x135')](_0x36aa3f['query'][_0x4afc('0x5d')])[_0x4afc('0x12')](function(){if(_[_0x4afc('0xac')](_0x36aa3f[_0x4afc('0x46')]['ids'])){for(var _0x2cfca9=0x0;_0x2cfca9<_0x36aa3f[_0x4afc('0x46')][_0x4afc('0x5d')][_0x4afc('0x49')];_0x2cfca9+=0x1){socket[_0x4afc('0xa1')](_0x4afc('0x136'),{'SmsInteractionId':Number(_0x36aa3f[_0x4afc('0x46')][_0x4afc('0x5d')][_0x2cfca9]),'UserId':Number(_0x36aa3f[_0x4afc('0x50')]['id'])});}}else{socket[_0x4afc('0xa1')](_0x4afc('0x136'),{'SmsInteractionId':Number(_0x36aa3f['query'][_0x4afc('0x5d')]),'UserId':Number(_0x36aa3f['params']['id'])});}});}})['then'](respondWithStatusCode(_0x14d944,null))[_0x4afc('0x1b')](handleError(_0x14d944,null));};exports[_0x4afc('0x137')]=function(_0x3eed6e,_0x26f349){return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0x3eed6e[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x26f349,null))['then'](function(_0x357940){if(_0x357940){return _0x357940[_0x4afc('0x137')](_0x3eed6e[_0x4afc('0x5a')][_0x4afc('0x5d')],_[_0x4afc('0x5e')](_0x3eed6e[_0x4afc('0x5a')],[_0x4afc('0x5d'),'id'])||{})[_0x4afc('0x9f')](function(){for(var _0x31bd83=0x0;_0x31bd83<_0x3eed6e['body'][_0x4afc('0x5d')][_0x4afc('0x49')];_0x31bd83+=0x1){socket['emit'](_0x4afc('0x138'),{'OpenchannelInteractionId':Number(_0x3eed6e[_0x4afc('0x5a')][_0x4afc('0x5d')][_0x31bd83]),'UserId':Number(_0x3eed6e[_0x4afc('0x50')]['id'])});}return _0x3eed6e[_0x4afc('0x5a')][_0x4afc('0x5d')];});}})['then'](respondWithResult(_0x26f349,null))[_0x4afc('0x1b')](handleError(_0x26f349,null));};exports[_0x4afc('0x139')]=function(_0x542b98,_0x3802a9){return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0x542b98[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x3802a9,null))[_0x4afc('0x12')](function(_0x326446){if(_0x326446){return _0x326446[_0x4afc('0x139')](_0x542b98[_0x4afc('0x46')][_0x4afc('0x5d')])[_0x4afc('0x12')](function(){if(_[_0x4afc('0xac')](_0x542b98[_0x4afc('0x46')][_0x4afc('0x5d')])){for(var _0x14add6=0x0;_0x14add6<_0x542b98[_0x4afc('0x46')][_0x4afc('0x5d')][_0x4afc('0x49')];_0x14add6+=0x1){socket[_0x4afc('0xa1')](_0x4afc('0x13a'),{'OpenchannelInteractionId':Number(_0x542b98[_0x4afc('0x46')][_0x4afc('0x5d')][_0x14add6]),'UserId':Number(_0x542b98['params']['id'])});}}else{socket['emit'](_0x4afc('0x13a'),{'OpenchannelInteractionId':Number(_0x542b98['query'][_0x4afc('0x5d')]),'UserId':Number(_0x542b98[_0x4afc('0x50')]['id'])});}});}})[_0x4afc('0x12')](respondWithStatusCode(_0x3802a9,null))['catch'](handleError(_0x3802a9,null));};exports['addWhatsappInteractions']=function(_0x5d7e56,_0x2d08a5){return db['User'][_0x4afc('0x31')]({'where':{'id':_0x5d7e56[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x2d08a5,null))[_0x4afc('0x12')](function(_0x3d89bf){if(_0x3d89bf){return _0x3d89bf[_0x4afc('0x13b')](_0x5d7e56[_0x4afc('0x5a')]['ids'],_['omit'](_0x5d7e56['body'],['ids','id'])||{})[_0x4afc('0x9f')](function(){for(var _0x2bb38d=0x0;_0x2bb38d<_0x5d7e56[_0x4afc('0x5a')][_0x4afc('0x5d')][_0x4afc('0x49')];_0x2bb38d+=0x1){socket[_0x4afc('0xa1')](_0x4afc('0x13c'),{'WhatsappInteractionId':Number(_0x5d7e56[_0x4afc('0x5a')][_0x4afc('0x5d')][_0x2bb38d]),'UserId':Number(_0x5d7e56[_0x4afc('0x50')]['id'])});}return _0x5d7e56['body'][_0x4afc('0x5d')];});}})[_0x4afc('0x12')](respondWithResult(_0x2d08a5,null))[_0x4afc('0x1b')](handleError(_0x2d08a5,null));};exports[_0x4afc('0x13d')]=function(_0xc503a9,_0x560769){return db['User'][_0x4afc('0x31')]({'where':{'id':_0xc503a9[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x560769,null))[_0x4afc('0x12')](function(_0x3226d3){if(_0x3226d3){return _0x3226d3[_0x4afc('0x13d')](_0xc503a9[_0x4afc('0x46')][_0x4afc('0x5d')]);}})['then'](respondWithStatusCode(_0x560769,null))[_0x4afc('0x1b')](handleError(_0x560769,null));};exports[_0x4afc('0x13e')]=function(_0x4119d7,_0x40dd10){var _0x2bf372={};var _0x523def={};var _0x5c593e;var _0x32e257;return db[_0x4afc('0x38')][_0x4afc('0x90')]({'where':{'id':_0x4119d7[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x40dd10,null))[_0x4afc('0x12')](function(_0x582495){if(_0x582495){_0x5c593e=_0x582495;_0x523def[_0x4afc('0x51')]=_[_0x4afc('0x53')](db[_0x4afc('0x13f')]['rawAttributes']);_0x523def[_0x4afc('0x46')]=_[_0x4afc('0x53')](_0x4119d7['query']);_0x523def[_0x4afc('0x54')]=_[_0x4afc('0x55')](_0x523def[_0x4afc('0x51')],_0x523def[_0x4afc('0x46')]);_0x2bf372[_0x4afc('0x43')]=_[_0x4afc('0x55')](_0x523def[_0x4afc('0x51')],qs[_0x4afc('0x56')](_0x4119d7[_0x4afc('0x46')]['fields']));_0x2bf372['attributes']=_0x2bf372['attributes'][_0x4afc('0x49')]?_0x2bf372[_0x4afc('0x43')]:_0x523def[_0x4afc('0x51')];_0x2bf372[_0x4afc('0xc3')]=qs['sort'](_0x4119d7[_0x4afc('0x46')][_0x4afc('0xc4')]);_0x2bf372['where']=qs[_0x4afc('0x54')](_[_0x4afc('0xc5')](_0x4119d7[_0x4afc('0x46')],_0x523def[_0x4afc('0x54')]));if(_0x4119d7[_0x4afc('0x46')][_0x4afc('0x2e')]){_0x2bf372[_0x4afc('0x40')]=_[_0x4afc('0x57')](_0x2bf372['where'],{'$or':_[_0x4afc('0x2f')](_0x2bf372[_0x4afc('0x43')],function(_0x30ebde){var _0x5b98b6={};_0x5b98b6[_0x30ebde]={'$like':'%'+_0x4119d7['query'][_0x4afc('0x2e')]+'%'};return _0x5b98b6;})});}_0x2bf372=_['merge']({},_0x2bf372,_0x4119d7[_0x4afc('0x58')]);return _0x5c593e[_0x4afc('0x13e')](_0x2bf372);}})['then'](function(_0x4ff346){if(_0x4ff346){_0x32e257=_0x4ff346['length'];if(!_0x4119d7[_0x4afc('0x46')][_0x4afc('0xc7')](_0x4afc('0xcd'))){_0x2bf372[_0x4afc('0x20')]=qs[_0x4afc('0x20')](_0x4119d7[_0x4afc('0x46')][_0x4afc('0x20')]);_0x2bf372['offset']=qs[_0x4afc('0x1e')](_0x4119d7['query'][_0x4afc('0x1e')]);}return _0x5c593e[_0x4afc('0x13e')](_0x2bf372);}})['then'](function(_0x22de5b){if(_0x22de5b){return _0x22de5b?{'count':_0x32e257,'rows':_0x22de5b}:null;}})['then'](respondWithResult(_0x40dd10,null))['catch'](handleError(_0x40dd10,null));};exports[_0x4afc('0x140')]=function(_0x293343,_0x42976b){var _0x5a69d9={};var _0x2274ee={};var _0x4b55b4;var _0x464841;return db[_0x4afc('0x38')][_0x4afc('0x90')]({'where':{'id':_0x293343[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x42976b,null))[_0x4afc('0x12')](function(_0xa3bb49){if(_0xa3bb49){_0x4b55b4=_0xa3bb49;_0x2274ee[_0x4afc('0x51')]=_[_0x4afc('0x53')](db[_0x4afc('0x141')][_0x4afc('0x39')]);_0x2274ee[_0x4afc('0x46')]=_[_0x4afc('0x53')](_0x293343[_0x4afc('0x46')]);_0x2274ee[_0x4afc('0x54')]=_['intersection'](_0x2274ee['model'],_0x2274ee[_0x4afc('0x46')]);_0x5a69d9[_0x4afc('0x43')]=_[_0x4afc('0x55')](_0x2274ee[_0x4afc('0x51')],qs[_0x4afc('0x56')](_0x293343[_0x4afc('0x46')][_0x4afc('0x56')]));_0x5a69d9[_0x4afc('0x43')]=_0x5a69d9[_0x4afc('0x43')][_0x4afc('0x49')]?_0x5a69d9[_0x4afc('0x43')]:_0x2274ee[_0x4afc('0x51')];_0x5a69d9[_0x4afc('0xc3')]=qs['sort'](_0x293343[_0x4afc('0x46')][_0x4afc('0xc4')]);_0x5a69d9[_0x4afc('0x40')]=qs[_0x4afc('0x54')](_[_0x4afc('0xc5')](_0x293343[_0x4afc('0x46')],_0x2274ee[_0x4afc('0x54')]));if(_0x293343[_0x4afc('0x46')][_0x4afc('0x2e')]){_0x5a69d9[_0x4afc('0x40')]=_[_0x4afc('0x57')](_0x5a69d9[_0x4afc('0x40')],{'$or':_['map'](_0x5a69d9[_0x4afc('0x43')],function(_0x3a25eb){var _0x1c79e5={};_0x1c79e5[_0x3a25eb]={'$like':'%'+_0x293343[_0x4afc('0x46')][_0x4afc('0x2e')]+'%'};return _0x1c79e5;})});}_0x5a69d9=_[_0x4afc('0x57')]({},_0x5a69d9,_0x293343[_0x4afc('0x58')]);return _0x4b55b4[_0x4afc('0x140')](_0x5a69d9);}})[_0x4afc('0x12')](function(_0x2fe703){if(_0x2fe703){_0x464841=_0x2fe703[_0x4afc('0x49')];if(!_0x293343['query'][_0x4afc('0xc7')](_0x4afc('0xcd'))){_0x5a69d9[_0x4afc('0x20')]=qs['limit'](_0x293343['query'][_0x4afc('0x20')]);_0x5a69d9[_0x4afc('0x1e')]=qs[_0x4afc('0x1e')](_0x293343[_0x4afc('0x46')][_0x4afc('0x1e')]);}return _0x4b55b4['getFaxAccounts'](_0x5a69d9);}})['then'](function(_0x3ba01f){if(_0x3ba01f){return _0x3ba01f?{'count':_0x464841,'rows':_0x3ba01f}:null;}})['then'](respondWithResult(_0x42976b,null))[_0x4afc('0x1b')](handleError(_0x42976b,null));};exports['addFaxAccounts']=function(_0x4bd20a,_0xedc0e5){return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0x4bd20a[_0x4afc('0x50')]['id']}})['then'](handleEntityNotFound(_0xedc0e5,null))[_0x4afc('0x12')](function(_0x5e923c){if(_0x5e923c){return _0x5e923c[_0x4afc('0x142')](_0x4bd20a[_0x4afc('0x5a')]['ids'],_['omit'](_0x4bd20a[_0x4afc('0x5a')],[_0x4afc('0x5d'),'id'])||{});}})[_0x4afc('0x12')](respondWithResult(_0xedc0e5,null))['catch'](handleError(_0xedc0e5,null));};exports[_0x4afc('0x143')]=function(_0x1a198f,_0x45fda4){return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0x1a198f[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x45fda4,null))[_0x4afc('0x12')](function(_0x557063){if(_0x557063){return _0x557063[_0x4afc('0x143')](_0x1a198f[_0x4afc('0x46')][_0x4afc('0x5d')]);}})[_0x4afc('0x12')](respondWithStatusCode(_0x45fda4,null))[_0x4afc('0x1b')](handleError(_0x45fda4,null));};exports['getMailAccounts']=function(_0x1ed243,_0x4e5450){var _0x5524bc={};var _0x3ebe62={};var _0x118ed2;var _0x8028a6;return db[_0x4afc('0x38')][_0x4afc('0x90')]({'where':{'id':_0x1ed243['params']['id']}})['then'](handleEntityNotFound(_0x4e5450,null))[_0x4afc('0x12')](function(_0x380cc3){if(_0x380cc3){_0x118ed2=_0x380cc3;_0x3ebe62[_0x4afc('0x51')]=_['keys'](db['MailAccount'][_0x4afc('0x39')]);_0x3ebe62[_0x4afc('0x46')]=_[_0x4afc('0x53')](_0x1ed243['query']);_0x3ebe62[_0x4afc('0x54')]=_[_0x4afc('0x55')](_0x3ebe62[_0x4afc('0x51')],_0x3ebe62['query']);_0x5524bc[_0x4afc('0x43')]=_[_0x4afc('0x55')](_0x3ebe62[_0x4afc('0x51')],qs[_0x4afc('0x56')](_0x1ed243[_0x4afc('0x46')][_0x4afc('0x56')]));_0x5524bc[_0x4afc('0x43')]=_0x5524bc[_0x4afc('0x43')][_0x4afc('0x49')]?_0x5524bc[_0x4afc('0x43')]:_0x3ebe62['model'];_0x5524bc[_0x4afc('0xc3')]=qs[_0x4afc('0xc4')](_0x1ed243[_0x4afc('0x46')][_0x4afc('0xc4')]);_0x5524bc[_0x4afc('0x40')]=qs[_0x4afc('0x54')](_[_0x4afc('0xc5')](_0x1ed243[_0x4afc('0x46')],_0x3ebe62[_0x4afc('0x54')]));if(_0x1ed243[_0x4afc('0x46')][_0x4afc('0x2e')]){_0x5524bc[_0x4afc('0x40')]=_[_0x4afc('0x57')](_0x5524bc[_0x4afc('0x40')],{'$or':_[_0x4afc('0x2f')](_0x5524bc[_0x4afc('0x43')],function(_0x5e6360){var _0x317148={};_0x317148[_0x5e6360]={'$like':'%'+_0x1ed243['query'][_0x4afc('0x2e')]+'%'};return _0x317148;})});}_0x5524bc=_['merge']({},_0x5524bc,_0x1ed243['options']);return _0x118ed2[_0x4afc('0x144')](_0x5524bc);}})[_0x4afc('0x12')](function(_0x2a9a46){if(_0x2a9a46){_0x8028a6=_0x2a9a46[_0x4afc('0x49')];if(!_0x1ed243[_0x4afc('0x46')][_0x4afc('0xc7')](_0x4afc('0xcd'))){_0x5524bc[_0x4afc('0x20')]=qs['limit'](_0x1ed243[_0x4afc('0x46')][_0x4afc('0x20')]);_0x5524bc[_0x4afc('0x1e')]=qs[_0x4afc('0x1e')](_0x1ed243['query'][_0x4afc('0x1e')]);}return _0x118ed2['getMailAccounts'](_0x5524bc);}})[_0x4afc('0x12')](function(_0x31f11d){if(_0x31f11d){return _0x31f11d?{'count':_0x8028a6,'rows':_0x31f11d}:null;}})[_0x4afc('0x12')](respondWithResult(_0x4e5450,null))[_0x4afc('0x1b')](handleError(_0x4e5450,null));};exports['addMailAccounts']=function(_0x5c1c39,_0x50e657){return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0x5c1c39[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x50e657,null))['then'](function(_0x50b131){if(_0x50b131){return _0x50b131[_0x4afc('0x145')](_0x5c1c39[_0x4afc('0x5a')]['ids'],_[_0x4afc('0x5e')](_0x5c1c39['body'],[_0x4afc('0x5d'),'id'])||{});}})['then'](respondWithResult(_0x50e657,null))[_0x4afc('0x1b')](handleError(_0x50e657,null));};exports[_0x4afc('0x146')]=function(_0x39bf00,_0x1acb0b){return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0x39bf00[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x1acb0b,null))[_0x4afc('0x12')](function(_0xba5017){if(_0xba5017){return _0xba5017[_0x4afc('0x146')](_0x39bf00[_0x4afc('0x46')][_0x4afc('0x5d')]);}})[_0x4afc('0x12')](respondWithStatusCode(_0x1acb0b,null))['catch'](handleError(_0x1acb0b,null));};exports[_0x4afc('0x147')]=function(_0x54a205,_0xc08ffb){var _0x39215a={};var _0x4c742f={};var _0x3a321c;var _0x75275;return db['User'][_0x4afc('0x90')]({'where':{'id':_0x54a205[_0x4afc('0x50')]['id']}})['then'](handleEntityNotFound(_0xc08ffb,null))[_0x4afc('0x12')](function(_0x5e2ea2){if(_0x5e2ea2){_0x3a321c=_0x5e2ea2;_0x4c742f[_0x4afc('0x51')]=_[_0x4afc('0x53')](db[_0x4afc('0x148')][_0x4afc('0x39')]);_0x4c742f[_0x4afc('0x46')]=_[_0x4afc('0x53')](_0x54a205['query']);_0x4c742f[_0x4afc('0x54')]=_[_0x4afc('0x55')](_0x4c742f[_0x4afc('0x51')],_0x4c742f['query']);_0x39215a[_0x4afc('0x43')]=_[_0x4afc('0x55')](_0x4c742f[_0x4afc('0x51')],qs['fields'](_0x54a205[_0x4afc('0x46')][_0x4afc('0x56')]));_0x39215a[_0x4afc('0x43')]=_0x39215a[_0x4afc('0x43')][_0x4afc('0x49')]?_0x39215a[_0x4afc('0x43')]:_0x4c742f[_0x4afc('0x51')];_0x39215a[_0x4afc('0xc3')]=qs[_0x4afc('0xc4')](_0x54a205['query'][_0x4afc('0xc4')]);_0x39215a[_0x4afc('0x40')]=qs[_0x4afc('0x54')](_[_0x4afc('0xc5')](_0x54a205['query'],_0x4c742f['filters']));if(_0x54a205['query'][_0x4afc('0x2e')]){_0x39215a[_0x4afc('0x40')]=_['merge'](_0x39215a['where'],{'$or':_[_0x4afc('0x2f')](_0x39215a['attributes'],function(_0x3d28f7){var _0x56b4d7={};_0x56b4d7[_0x3d28f7]={'$like':'%'+_0x54a205[_0x4afc('0x46')][_0x4afc('0x2e')]+'%'};return _0x56b4d7;})});}_0x39215a=_[_0x4afc('0x57')]({},_0x39215a,_0x54a205['options']);return _0x3a321c['getOpenchannelAccounts'](_0x39215a);}})[_0x4afc('0x12')](function(_0x4fa2c9){if(_0x4fa2c9){_0x75275=_0x4fa2c9[_0x4afc('0x49')];if(!_0x54a205['query']['hasOwnProperty'](_0x4afc('0xcd'))){_0x39215a[_0x4afc('0x20')]=qs[_0x4afc('0x20')](_0x54a205[_0x4afc('0x46')][_0x4afc('0x20')]);_0x39215a[_0x4afc('0x1e')]=qs[_0x4afc('0x1e')](_0x54a205[_0x4afc('0x46')][_0x4afc('0x1e')]);}return _0x3a321c['getOpenchannelAccounts'](_0x39215a);}})[_0x4afc('0x12')](function(_0x33939d){if(_0x33939d){return _0x33939d?{'count':_0x75275,'rows':_0x33939d}:null;}})[_0x4afc('0x12')](respondWithResult(_0xc08ffb,null))[_0x4afc('0x1b')](handleError(_0xc08ffb,null));};exports[_0x4afc('0x149')]=function(_0x19c81a,_0x2a982f){return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0x19c81a['params']['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x2a982f,null))[_0x4afc('0x12')](function(_0x2c199e){if(_0x2c199e){return _0x2c199e[_0x4afc('0x149')](_0x19c81a[_0x4afc('0x5a')]['ids'],_['omit'](_0x19c81a[_0x4afc('0x5a')],['ids','id'])||{});}})[_0x4afc('0x12')](respondWithResult(_0x2a982f,null))[_0x4afc('0x1b')](handleError(_0x2a982f,null));};exports[_0x4afc('0x14a')]=function(_0x1b2af7,_0x8fc443){return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0x1b2af7['params']['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x8fc443,null))[_0x4afc('0x12')](function(_0x29ed23){if(_0x29ed23){return _0x29ed23[_0x4afc('0x14a')](_0x1b2af7[_0x4afc('0x46')][_0x4afc('0x5d')]);}})[_0x4afc('0x12')](respondWithStatusCode(_0x8fc443,null))[_0x4afc('0x1b')](handleError(_0x8fc443,null));};exports['getSmsAccounts']=function(_0x3c95e7,_0x1aa361){var _0xeb5538={};var _0x2f0ae9={};var _0x5a4b7e;var _0x380c27;return db[_0x4afc('0x38')][_0x4afc('0x90')]({'where':{'id':_0x3c95e7[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x1aa361,null))[_0x4afc('0x12')](function(_0x2f7136){if(_0x2f7136){_0x5a4b7e=_0x2f7136;_0x2f0ae9['model']=_['keys'](db[_0x4afc('0x14b')]['rawAttributes']);_0x2f0ae9[_0x4afc('0x46')]=_[_0x4afc('0x53')](_0x3c95e7['query']);_0x2f0ae9[_0x4afc('0x54')]=_[_0x4afc('0x55')](_0x2f0ae9[_0x4afc('0x51')],_0x2f0ae9[_0x4afc('0x46')]);_0xeb5538[_0x4afc('0x43')]=_['intersection'](_0x2f0ae9[_0x4afc('0x51')],qs[_0x4afc('0x56')](_0x3c95e7[_0x4afc('0x46')]['fields']));_0xeb5538['attributes']=_0xeb5538[_0x4afc('0x43')][_0x4afc('0x49')]?_0xeb5538[_0x4afc('0x43')]:_0x2f0ae9[_0x4afc('0x51')];_0xeb5538[_0x4afc('0xc3')]=qs[_0x4afc('0xc4')](_0x3c95e7[_0x4afc('0x46')]['sort']);_0xeb5538[_0x4afc('0x40')]=qs[_0x4afc('0x54')](_[_0x4afc('0xc5')](_0x3c95e7[_0x4afc('0x46')],_0x2f0ae9[_0x4afc('0x54')]));if(_0x3c95e7['query']['filter']){_0xeb5538['where']=_[_0x4afc('0x57')](_0xeb5538[_0x4afc('0x40')],{'$or':_[_0x4afc('0x2f')](_0xeb5538[_0x4afc('0x43')],function(_0x49059a){var _0x981a={};_0x981a[_0x49059a]={'$like':'%'+_0x3c95e7[_0x4afc('0x46')][_0x4afc('0x2e')]+'%'};return _0x981a;})});}_0xeb5538=_[_0x4afc('0x57')]({},_0xeb5538,_0x3c95e7[_0x4afc('0x58')]);return _0x5a4b7e[_0x4afc('0x14c')](_0xeb5538);}})[_0x4afc('0x12')](function(_0x134636){if(_0x134636){_0x380c27=_0x134636[_0x4afc('0x49')];if(!_0x3c95e7[_0x4afc('0x46')][_0x4afc('0xc7')]('nolimit')){_0xeb5538[_0x4afc('0x20')]=qs[_0x4afc('0x20')](_0x3c95e7[_0x4afc('0x46')][_0x4afc('0x20')]);_0xeb5538[_0x4afc('0x1e')]=qs[_0x4afc('0x1e')](_0x3c95e7['query'][_0x4afc('0x1e')]);}return _0x5a4b7e['getSmsAccounts'](_0xeb5538);}})[_0x4afc('0x12')](function(_0x25a2dd){if(_0x25a2dd){return _0x25a2dd?{'count':_0x380c27,'rows':_0x25a2dd}:null;}})['then'](respondWithResult(_0x1aa361,null))['catch'](handleError(_0x1aa361,null));};exports[_0x4afc('0x14d')]=function(_0x5870f2,_0x2957ab){return db['User'][_0x4afc('0x31')]({'where':{'id':_0x5870f2[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x2957ab,null))[_0x4afc('0x12')](function(_0x57bcf1){if(_0x57bcf1){return _0x57bcf1[_0x4afc('0x14d')](_0x5870f2['body']['ids'],_[_0x4afc('0x5e')](_0x5870f2[_0x4afc('0x5a')],[_0x4afc('0x5d'),'id'])||{});}})[_0x4afc('0x12')](respondWithResult(_0x2957ab,null))[_0x4afc('0x1b')](handleError(_0x2957ab,null));};exports['removeSmsAccounts']=function(_0xccd830,_0x42c6cb){return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0xccd830['params']['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x42c6cb,null))[_0x4afc('0x12')](function(_0x1f4428){if(_0x1f4428){return _0x1f4428[_0x4afc('0x14e')](_0xccd830[_0x4afc('0x46')][_0x4afc('0x5d')]);}})['then'](respondWithStatusCode(_0x42c6cb,null))[_0x4afc('0x1b')](handleError(_0x42c6cb,null));};exports['getChatWebsites']=function(_0x40c8eb,_0x2d64e8){var _0x2962ec={};var _0x5e8355={};var _0x58911f;var _0x47f795;return db[_0x4afc('0x38')][_0x4afc('0x90')]({'where':{'id':_0x40c8eb['params']['id']}})['then'](handleEntityNotFound(_0x2d64e8,null))[_0x4afc('0x12')](function(_0x5c6658){if(_0x5c6658){_0x58911f=_0x5c6658;_0x5e8355['model']=_[_0x4afc('0x53')](db[_0x4afc('0x14f')][_0x4afc('0x39')]);_0x5e8355[_0x4afc('0x46')]=_[_0x4afc('0x53')](_0x40c8eb[_0x4afc('0x46')]);_0x5e8355[_0x4afc('0x54')]=_[_0x4afc('0x55')](_0x5e8355['model'],_0x5e8355[_0x4afc('0x46')]);_0x2962ec[_0x4afc('0x43')]=_['intersection'](_0x5e8355[_0x4afc('0x51')],qs['fields'](_0x40c8eb['query']['fields']));_0x2962ec[_0x4afc('0x43')]=_0x2962ec[_0x4afc('0x43')][_0x4afc('0x49')]?_0x2962ec['attributes']:_0x5e8355[_0x4afc('0x51')];_0x2962ec['order']=qs['sort'](_0x40c8eb[_0x4afc('0x46')][_0x4afc('0xc4')]);_0x2962ec[_0x4afc('0x40')]=qs[_0x4afc('0x54')](_['pick'](_0x40c8eb[_0x4afc('0x46')],_0x5e8355[_0x4afc('0x54')]));if(_0x40c8eb[_0x4afc('0x46')][_0x4afc('0x2e')]){_0x2962ec['where']=_['merge'](_0x2962ec[_0x4afc('0x40')],{'$or':_[_0x4afc('0x2f')](_0x2962ec[_0x4afc('0x43')],function(_0x24a222){var _0x4b75b3={};_0x4b75b3[_0x24a222]={'$like':'%'+_0x40c8eb[_0x4afc('0x46')]['filter']+'%'};return _0x4b75b3;})});}_0x2962ec=_[_0x4afc('0x57')]({},_0x2962ec,_0x40c8eb['options']);return _0x58911f[_0x4afc('0x150')](_0x2962ec);}})['then'](function(_0x2bbd84){if(_0x2bbd84){_0x47f795=_0x2bbd84[_0x4afc('0x49')];if(!_0x40c8eb[_0x4afc('0x46')][_0x4afc('0xc7')](_0x4afc('0xcd'))){_0x2962ec['limit']=qs['limit'](_0x40c8eb[_0x4afc('0x46')][_0x4afc('0x20')]);_0x2962ec[_0x4afc('0x1e')]=qs[_0x4afc('0x1e')](_0x40c8eb['query']['offset']);}return _0x58911f[_0x4afc('0x150')](_0x2962ec);}})[_0x4afc('0x12')](function(_0x2bc1a2){if(_0x2bc1a2){return _0x2bc1a2?{'count':_0x47f795,'rows':_0x2bc1a2}:null;}})[_0x4afc('0x12')](respondWithResult(_0x2d64e8,null))[_0x4afc('0x1b')](handleError(_0x2d64e8,null));};exports[_0x4afc('0x151')]=function(_0x25eab2,_0x33a321){return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0x25eab2[_0x4afc('0x50')]['id']}})['then'](handleEntityNotFound(_0x33a321,null))[_0x4afc('0x12')](function(_0x557417){if(_0x557417){return _0x557417[_0x4afc('0x151')](_0x25eab2[_0x4afc('0x5a')][_0x4afc('0x5d')],_['omit'](_0x25eab2[_0x4afc('0x5a')],['ids','id'])||{});}})[_0x4afc('0x12')](respondWithResult(_0x33a321,null))[_0x4afc('0x1b')](handleError(_0x33a321,null));};exports[_0x4afc('0x152')]=function(_0x44a6ce,_0x5dac36){return db[_0x4afc('0x38')]['find']({'where':{'id':_0x44a6ce[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x5dac36,null))['then'](function(_0x32a3e6){if(_0x32a3e6){return _0x32a3e6[_0x4afc('0x152')](_0x44a6ce[_0x4afc('0x46')][_0x4afc('0x5d')]);}})[_0x4afc('0x12')](respondWithStatusCode(_0x5dac36,null))['catch'](handleError(_0x5dac36,null));};exports['getWhatsappAccounts']=function(_0x127fd9,_0x353bf1){var _0x3e160f={};var _0x15d4f2={};var _0x47964f;var _0x1081eb;return db[_0x4afc('0x38')][_0x4afc('0x90')]({'where':{'id':_0x127fd9[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x353bf1,null))[_0x4afc('0x12')](function(_0x8e007b){if(_0x8e007b){_0x47964f=_0x8e007b;_0x15d4f2[_0x4afc('0x51')]=_['keys'](db[_0x4afc('0x153')]['rawAttributes']);_0x15d4f2['query']=_[_0x4afc('0x53')](_0x127fd9[_0x4afc('0x46')]);_0x15d4f2[_0x4afc('0x54')]=_[_0x4afc('0x55')](_0x15d4f2['model'],_0x15d4f2[_0x4afc('0x46')]);_0x3e160f[_0x4afc('0x43')]=_[_0x4afc('0x55')](_0x15d4f2[_0x4afc('0x51')],qs[_0x4afc('0x56')](_0x127fd9['query']['fields']));_0x3e160f[_0x4afc('0x43')]=_0x3e160f[_0x4afc('0x43')]['length']?_0x3e160f[_0x4afc('0x43')]:_0x15d4f2[_0x4afc('0x51')];_0x3e160f[_0x4afc('0xc3')]=qs[_0x4afc('0xc4')](_0x127fd9[_0x4afc('0x46')][_0x4afc('0xc4')]);_0x3e160f['where']=qs[_0x4afc('0x54')](_['pick'](_0x127fd9[_0x4afc('0x46')],_0x15d4f2['filters']));if(_0x127fd9['query'][_0x4afc('0x2e')]){_0x3e160f[_0x4afc('0x40')]=_[_0x4afc('0x57')](_0x3e160f[_0x4afc('0x40')],{'$or':_['map'](_0x3e160f['attributes'],function(_0x1aa696){var _0x4f87e7={};_0x4f87e7[_0x1aa696]={'$like':'%'+_0x127fd9[_0x4afc('0x46')][_0x4afc('0x2e')]+'%'};return _0x4f87e7;})});}_0x3e160f=_[_0x4afc('0x57')]({},_0x3e160f,_0x127fd9[_0x4afc('0x58')]);return _0x47964f['getWhatsappAccounts'](_0x3e160f);}})[_0x4afc('0x12')](function(_0x404cec){if(_0x404cec){_0x1081eb=_0x404cec[_0x4afc('0x49')];if(!_0x127fd9[_0x4afc('0x46')][_0x4afc('0xc7')](_0x4afc('0xcd'))){_0x3e160f[_0x4afc('0x20')]=qs['limit'](_0x127fd9[_0x4afc('0x46')][_0x4afc('0x20')]);_0x3e160f[_0x4afc('0x1e')]=qs['offset'](_0x127fd9[_0x4afc('0x46')][_0x4afc('0x1e')]);}return _0x47964f[_0x4afc('0x154')](_0x3e160f);}})['then'](function(_0xa8bc83){if(_0xa8bc83){return _0xa8bc83?{'count':_0x1081eb,'rows':_0xa8bc83}:null;}})[_0x4afc('0x12')](respondWithResult(_0x353bf1,null))[_0x4afc('0x1b')](handleError(_0x353bf1,null));};exports['addWhatsappAccounts']=function(_0x3d8103,_0x50b864){return db['User']['find']({'where':{'id':_0x3d8103[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x50b864,null))['then'](function(_0x19e4c5){if(_0x19e4c5){return _0x19e4c5[_0x4afc('0x155')](_0x3d8103['body'][_0x4afc('0x5d')],_[_0x4afc('0x5e')](_0x3d8103[_0x4afc('0x5a')],[_0x4afc('0x5d'),'id'])||{});}})[_0x4afc('0x12')](respondWithResult(_0x50b864,null))[_0x4afc('0x1b')](handleError(_0x50b864,null));};exports['removeWhatsappAccounts']=function(_0xb51dae,_0x5b844b){return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0xb51dae[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x5b844b,null))['then'](function(_0x147c3d){if(_0x147c3d){return _0x147c3d[_0x4afc('0x156')](_0xb51dae[_0x4afc('0x46')][_0x4afc('0x5d')]);}})[_0x4afc('0x12')](respondWithStatusCode(_0x5b844b,null))['catch'](handleError(_0x5b844b,null));};exports[_0x4afc('0x157')]=function(_0xfc4b88,_0x179324){var _0x401431={};var _0x33f9b8={};var _0x4223e5;var _0x1e3e27;return db[_0x4afc('0x38')][_0x4afc('0x90')]({'where':{'id':_0xfc4b88['params']['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x179324,null))['then'](function(_0x2784e3){if(_0x2784e3){_0x4223e5=_0x2784e3;_0x33f9b8[_0x4afc('0x51')]=_[_0x4afc('0x53')](db[_0x4afc('0x158')][_0x4afc('0x39')]);_0x33f9b8[_0x4afc('0x46')]=_[_0x4afc('0x53')](_0xfc4b88[_0x4afc('0x46')]);_0x33f9b8[_0x4afc('0x54')]=_[_0x4afc('0x55')](_0x33f9b8[_0x4afc('0x51')],_0x33f9b8[_0x4afc('0x46')]);_0x401431['attributes']=_[_0x4afc('0x55')](_0x33f9b8[_0x4afc('0x51')],qs[_0x4afc('0x56')](_0xfc4b88[_0x4afc('0x46')][_0x4afc('0x56')]));_0x401431[_0x4afc('0x43')]=_0x401431[_0x4afc('0x43')][_0x4afc('0x49')]?_0x401431[_0x4afc('0x43')]:_0x33f9b8[_0x4afc('0x51')];_0x401431[_0x4afc('0xc3')]=qs['sort'](_0xfc4b88[_0x4afc('0x46')][_0x4afc('0xc4')]);_0x401431[_0x4afc('0x40')]=qs[_0x4afc('0x54')](_[_0x4afc('0xc5')](_0xfc4b88['query'],_0x33f9b8[_0x4afc('0x54')]));if(_0xfc4b88['query'][_0x4afc('0x2e')]){_0x401431[_0x4afc('0x40')]=_[_0x4afc('0x57')](_0x401431[_0x4afc('0x40')],{'$or':_[_0x4afc('0x2f')](_0x401431['attributes'],function(_0x29952b){var _0x1f725c={};_0x1f725c[_0x29952b]={'$like':'%'+_0xfc4b88[_0x4afc('0x46')]['filter']+'%'};return _0x1f725c;})});}_0x401431=_[_0x4afc('0x57')]({},_0x401431,_0xfc4b88[_0x4afc('0x58')]);return _0x4223e5[_0x4afc('0x157')](_0x401431);}})['then'](function(_0x5af6f6){if(_0x5af6f6){_0x1e3e27=_0x5af6f6[_0x4afc('0x49')];if(!_0xfc4b88[_0x4afc('0x46')]['hasOwnProperty']('nolimit')){_0x401431[_0x4afc('0x20')]=qs[_0x4afc('0x20')](_0xfc4b88[_0x4afc('0x46')][_0x4afc('0x20')]);_0x401431['offset']=qs[_0x4afc('0x1e')](_0xfc4b88[_0x4afc('0x46')][_0x4afc('0x1e')]);}return _0x4223e5[_0x4afc('0x157')](_0x401431);}})['then'](function(_0x122c22){if(_0x122c22){return _0x122c22?{'count':_0x1e3e27,'rows':_0x122c22}:null;}})[_0x4afc('0x12')](respondWithResult(_0x179324,null))[_0x4afc('0x1b')](handleError(_0x179324,null));};exports['addSquareProjects']=function(_0x7291f,_0x3aa008){return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0x7291f[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x3aa008,null))[_0x4afc('0x12')](function(_0x3303f9){if(_0x3303f9){return _0x3303f9[_0x4afc('0x159')](_0x7291f[_0x4afc('0x5a')]['ids'],_[_0x4afc('0x5e')](_0x7291f[_0x4afc('0x5a')],[_0x4afc('0x5d'),'id'])||{});}})['then'](respondWithResult(_0x3aa008,null))['catch'](handleError(_0x3aa008,null));};exports[_0x4afc('0x15a')]=function(_0x1c4d1a,_0x38384a){return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0x1c4d1a[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x38384a,null))[_0x4afc('0x12')](function(_0x321dd4){if(_0x321dd4){return _0x321dd4['removeSquareProjects'](_0x1c4d1a['query'][_0x4afc('0x5d')]);}})[_0x4afc('0x12')](respondWithStatusCode(_0x38384a,null))[_0x4afc('0x1b')](handleError(_0x38384a,null));};exports[_0x4afc('0x15b')]=function(_0x47d415,_0x5239b0){var _0x1a71b4={},_0x19cb36={},_0x5d0a4c={'count':0x0,'rows':[]};var _0x3c956c=db['CmHopper'][_0x4afc('0x39')];_0x19cb36['model']=_[_0x4afc('0x53')](_0x3c956c);_0x19cb36[_0x4afc('0x46')]=_[_0x4afc('0x53')](_0x47d415['query']);_0x19cb36[_0x4afc('0x54')]=_[_0x4afc('0x55')](_0x19cb36['model'],_0x19cb36[_0x4afc('0x46')]);_0x19cb36[_0x4afc('0x54')]=_[_0x4afc('0xf6')](_0x19cb36['filters'],[_0x4afc('0x15c'),_0x4afc('0x15d'),_0x4afc('0x15e'),_0x4afc('0x15f'),_0x4afc('0x160'),_0x4afc('0x161'),_0x4afc('0x162'),_0x4afc('0x163'),_0x4afc('0x164'),_0x4afc('0x165'),'$notBetween',_0x4afc('0x166'),_0x4afc('0x167'),_0x4afc('0x168'),_0x4afc('0x169'),_0x4afc('0x16a'),'$notILike',_0x4afc('0x168'),'$overlap',_0x4afc('0x16b'),_0x4afc('0x16c'),_0x4afc('0x16d')]);_0x1a71b4[_0x4afc('0x43')]=_[_0x4afc('0x55')](_0x19cb36[_0x4afc('0x51')],qs[_0x4afc('0x56')](_0x47d415['query']['fields']));_0x1a71b4['attributes']=_0x1a71b4[_0x4afc('0x43')][_0x4afc('0x49')]?_0x1a71b4[_0x4afc('0x43')]:_0x19cb36[_0x4afc('0x51')];if(!_0x47d415[_0x4afc('0x46')]['hasOwnProperty'](_0x4afc('0xcd'))){_0x1a71b4[_0x4afc('0x20')]=qs[_0x4afc('0x20')](_0x47d415[_0x4afc('0x46')]['limit']);_0x1a71b4[_0x4afc('0x1e')]=qs['offset'](_0x47d415[_0x4afc('0x46')][_0x4afc('0x1e')]);}_0x1a71b4[_0x4afc('0xc3')]=qs[_0x4afc('0xc4')](_0x47d415[_0x4afc('0x46')]['sort']);_0x1a71b4['where']=qs['filters'](_[_0x4afc('0xc5')](_0x47d415[_0x4afc('0x46')],_0x19cb36[_0x4afc('0x54')]));if(_0x47d415[_0x4afc('0x46')][_0x4afc('0x2e')]){_0x1a71b4[_0x4afc('0x40')]=_['merge'](_0x1a71b4['where'],{'$or':_['map'](_0x1a71b4[_0x4afc('0x43')],function(_0x280333){var _0x832883={};_0x832883[_0x280333]={'$like':'%'+_0x47d415[_0x4afc('0x46')][_0x4afc('0x2e')]+'%'};return _0x832883;})});}_0x1a71b4[_0x4afc('0x40')]={'$and':[_0x1a71b4['where'],{'$or':[{'UserId':_0x47d415[_0x4afc('0x50')]['id']},{'OwnerId':_0x47d415[_0x4afc('0x50')]['id']}]}]};_0x1a71b4=_['merge']({},_0x1a71b4,_0x47d415['options']);var _0x25540c={'where':_0x1a71b4[_0x4afc('0x40')]};return db['CmHopper'][_0x4afc('0x21')](_0x25540c)['then'](function(_0x2dffa8){_0x5d0a4c['count']=_0x2dffa8;if(_0x47d415[_0x4afc('0x46')][_0x4afc('0x41')]){_0x1a71b4['include']=[{'attributes':['id','firstName',_0x4afc('0x16e'),_0x4afc('0xe2')],'model':db['CmContact'],'as':'Contact'},{'attributes':['id',_0x4afc('0x36'),_0x4afc('0x16f')],'model':db[_0x4afc('0x170')],'as':_0x4afc('0xce')}];}return db[_0x4afc('0x171')][_0x4afc('0xd0')](_0x1a71b4);})['then'](function(_0x327e95){_0x5d0a4c[_0x4afc('0x45')]=_0x327e95;return _0x5d0a4c;})['then'](respondWithFilteredResult(_0x5239b0,_0x1a71b4))['catch'](handleError(_0x5239b0,null));};exports['getApiKey']=function(_0x1727c1,_0x59dae2){if(!_[_0x4afc('0x64')](_0x1727c1[_0x4afc('0x29')]['id'])&&(_0x1727c1['user']['role']==_0x4afc('0x27')||_0x1727c1[_0x4afc('0x29')][_0x4afc('0x26')]==_0x4afc('0x29'))){return db[_0x4afc('0x38')][_0x4afc('0x90')]({'where':{'id':_0x1727c1[_0x4afc('0x50')]['id']},'raw':!![]})[_0x4afc('0x12')](function(_0x4c66c5){return authService[_0x4afc('0x172')](_0x4c66c5);})[_0x4afc('0x12')](function(_0x2626f5){if(_0x2626f5){return _0x59dae2[_0x4afc('0x1d')](0xc8)[_0x4afc('0x22')]({'api_key':_0x2626f5[_0x4afc('0x173')]});}else{return _0x59dae2[_0x4afc('0x1d')](0xcc)[_0x4afc('0x22')]({'message':'No\x20API\x20access\x20key\x20found!'});}})[_0x4afc('0x1b')](handleError(_0x59dae2,0x193));}else{return _0x59dae2['status'](0x191)[_0x4afc('0x22')]({'message':_0x4afc('0x174')});}};exports['createApiKey']=function(_0x1bbeac,_0x29f93f){if(!_[_0x4afc('0x64')](_0x1bbeac[_0x4afc('0x29')]['id'])&&(_0x1bbeac['user'][_0x4afc('0x26')]==_0x4afc('0x27')||_0x1bbeac['user'][_0x4afc('0x26')]==_0x4afc('0x29'))){return db['User'][_0x4afc('0x31')]({'where':{'id':_0x1bbeac[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](function(_0x4c5680){return authService[_0x4afc('0x175')](_0x4c5680);})[_0x4afc('0x12')](function(_0x23869f){return db[_0x4afc('0x38')][_0x4afc('0x23')]({'apiKeyIat':_0x23869f['iat'],'apiKeyNonce':_0x23869f[_0x4afc('0x176')]},{'where':{'id':_0x1bbeac[_0x4afc('0x50')]['id']}})['then'](function(){return _0x29f93f[_0x4afc('0x1d')](0xc8)[_0x4afc('0x22')]({'api_key':_0x23869f[_0x4afc('0x173')]});});})[_0x4afc('0x1b')](handleError(_0x29f93f,0x193));}else{return _0x29f93f[_0x4afc('0x1d')](0x191)[_0x4afc('0x22')]({'message':_0x4afc('0x174')});}};exports[_0x4afc('0x177')]=function(_0x273ed9,_0x39461e){if(!_[_0x4afc('0x64')](_0x273ed9[_0x4afc('0x29')]['id'])&&(_0x273ed9[_0x4afc('0x29')][_0x4afc('0x26')]==_0x4afc('0x27')||_0x273ed9[_0x4afc('0x29')][_0x4afc('0x26')]==_0x4afc('0x29'))){return db['User'][_0x4afc('0x31')]({'where':{'id':_0x273ed9[_0x4afc('0x50')]['id']}})['then'](handleEntityNotFound(_0x39461e,null))[_0x4afc('0x12')](function(_0xd46894){if(_0xd46894&&_0xd46894[_0x4afc('0x178')]&&_0xd46894[_0x4afc('0x179')])return _0xd46894;else throw{'message':_0x4afc('0x17a')};})['then'](function(_0x574d7d){return db[_0x4afc('0x38')][_0x4afc('0x23')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x273ed9['params']['id']}});})['then'](respondWithStatusCode(_0x39461e,0xc8))['catch'](handleError(_0x39461e,0x193));}else{return _0x39461e['status'](0x191)[_0x4afc('0x22')]({'message':_0x4afc('0x174')});}};exports[_0x4afc('0x17b')]=function(_0x149b45,_0x5a9ea6){var _0x245660=_0x149b45[_0x4afc('0x29')][_0x4afc('0x25')]({'plain':!![]});if(!_0x245660){return _0x5a9ea6[_0x4afc('0x1d')](0x191)[_0x4afc('0x127')](_0x4afc('0x17c'));}else{return _0x5a9ea6[_0x4afc('0x1d')](0xc8)[_0x4afc('0x22')](_0x245660);}};exports['getPresence']=function(_0x57cad9,_0x3616d8){var _0x475f94={'offset':0x0},_0x1a735c={'count':0x0,'rows':[]};Promise[_0x4afc('0xf8')]()[_0x4afc('0x12')](function(){if(!_0x57cad9[_0x4afc('0x46')][_0x4afc('0x2e')]&&!_0x57cad9[_0x4afc('0x46')][_0x4afc('0x17d')]&&!_0x57cad9['query']['queues'])return[];return Promise['resolve']()[_0x4afc('0x12')](function(){var _0x471768=[];if(!_[_0x4afc('0x87')](_0x57cad9[_0x4afc('0x46')][_0x4afc('0x17d')])){_0x471768['push'](db[_0x4afc('0x10b')][_0x4afc('0xd0')]({'attributes':['id',_0x4afc('0x36')],'where':{'id':_0x57cad9['query'][_0x4afc('0x17d')]}}));}if(!_[_0x4afc('0x87')](_0x57cad9[_0x4afc('0x46')][_0x4afc('0x17e')])){_0x471768[_0x4afc('0x44')](db[_0x4afc('0x170')][_0x4afc('0xd0')]({'attributes':['id',_0x4afc('0x36')],'type':_0x4afc('0x17f'),'where':{'id':_0x57cad9['query'][_0x4afc('0x17e')]}}));}return Promise[_0x4afc('0x4f')](_0x471768);})[_0x4afc('0x12')](function(_0x48f203){var _0x5bfa67=_[_0x4afc('0x11b')](_0x48f203)[_0x4afc('0x2f')](function(_0x30cd83){return _0x30cd83[_0x4afc('0x125')]({'attributes':['id',_0x4afc('0x36'),_0x4afc('0x63'),_0x4afc('0xa4')],'raw':!![]});});return Promise[_0x4afc('0x4f')](_0x5bfa67);})[_0x4afc('0x12')](function(_0xa0a42){var _0x1a1620=_[_0x4afc('0x11b')](_0xa0a42);if(!_0x57cad9[_0x4afc('0x46')]['filter'])return _0x1a1620;if(_[_0x4afc('0x87')](_0x1a1620)){return db[_0x4afc('0x38')][_0x4afc('0xd0')]({'attributes':['id',_0x4afc('0x36'),_0x4afc('0x63'),'online'],'where':{'role':_0x4afc('0x2b'),'$or':[db['sequelize'][_0x4afc('0x40')](db[_0x4afc('0x66')]['fn'](_0x4afc('0x180'),db[_0x4afc('0x66')][_0x4afc('0x181')](_0x4afc('0x36'))),{'$like':'%'+_0x57cad9['query'][_0x4afc('0x2e')][_0x4afc('0x9d')]()+'%'}),{'internal':{'$like':'%'+_0x57cad9[_0x4afc('0x46')][_0x4afc('0x2e')]+'%'}}]},'raw':!![]});}else{return _(_0x1a1620)['flatten']()[_0x4afc('0x2e')](function(_0x3c044c){return _0x3c044c['name'][_0x4afc('0x9d')]()[_0x4afc('0x30')](_0x57cad9[_0x4afc('0x46')][_0x4afc('0x2e')]['toLowerCase']())||_0x3c044c['internal']['toString']()[_0x4afc('0x30')](_0x57cad9[_0x4afc('0x46')][_0x4afc('0x2e')]);})[_0x4afc('0x32')]();}})[_0x4afc('0x12')](function(_0x467629){var _0x4e7f73=_0x4afc('0x36');var _0x3771ba='asc';if(_0x57cad9[_0x4afc('0x46')][_0x4afc('0xc4')]){var _0x3771ba=_0x57cad9[_0x4afc('0x46')][_0x4afc('0xc4')][0x0]==='-'?_0x4afc('0x182'):_0x4afc('0x183');var _0x4e7f73=_0x3771ba===_0x4afc('0x183')?_0x57cad9[_0x4afc('0x46')]['sort']:_0x57cad9[_0x4afc('0x46')][_0x4afc('0xc4')][_0x4afc('0x184')](0x1);}return _(_0x467629)['uniqBy']('id')[_0x4afc('0x185')]([function(_0x58449e){return _0x4e7f73===_0x4afc('0x36')?_0x58449e[_0x4e7f73][_0x4afc('0x9d')]():_0x58449e[_0x4e7f73];}],[_0x3771ba])[_0x4afc('0x2f')](function(_0x37ca93){return _[_0x4afc('0xc5')](_0x37ca93,['id',_0x4afc('0x36'),_0x4afc('0x63'),_0x4afc('0xa4')]);})['value']();})[_0x4afc('0x12')](function(_0x31df4b){return client[_0x4afc('0x11')](_0x4afc('0x2a'),_0x57cad9)[_0x4afc('0x12')](function(_0x2684e9){if(_0x2684e9[_0x4afc('0x18')])throw new Error(_0x4afc('0x186'));var _0x39102b=_0x2684e9[_0x4afc('0x1a')];var _0x3c0846=jayson['client'][_0x4afc('0x187')]({'port':0x232c});return _0x3c0846['request'](_0x4afc('0x2a'),_0x57cad9)[_0x4afc('0x12')](function(_0x19213c){if(_0x19213c['error'])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x560a34=_0x19213c[_0x4afc('0x1a')];return _[_0x4afc('0x57')]({},_0x560a34,_0x39102b);});})[_0x4afc('0x12')](function(_0x1cd985){return _[_0x4afc('0x2f')](_0x31df4b,function(_0x4dadf1){var _0x4fd91b=_[_0x4afc('0x31')](_0x1cd985[_0x4afc('0x45')],['id',_0x4dadf1['id']]);if(!_0x4fd91b||!_0x4dadf1[_0x4afc('0xa4')]){_0x4dadf1[_0x4afc('0x1d')]=_0x4afc('0x188');}else if(_0x4fd91b[_0x4afc('0x98')]){_0x4dadf1[_0x4afc('0x1d')]=_0x4afc('0xfa');}else{_0x4dadf1[_0x4afc('0x1d')]=_[_0x4afc('0x30')](['idle',_0x4afc('0x189'),_0x4afc('0x18a'),'ringing',null,undefined],_0x4fd91b[_0x4afc('0x18b')])?'online':_0x4afc('0x18c');}return _0x4dadf1;});});});})[_0x4afc('0x12')](function(_0x363160){if(!_0x57cad9[_0x4afc('0x46')]['hasOwnProperty'](_0x4afc('0xcd'))){_0x475f94[_0x4afc('0x20')]=qs['limit'](_0x57cad9[_0x4afc('0x46')][_0x4afc('0x20')]||0xa);_0x475f94[_0x4afc('0x1e')]=qs[_0x4afc('0x1e')](_0x57cad9['query'][_0x4afc('0x1e')]);}_0x1a735c[_0x4afc('0x21')]=_0x363160[_0x4afc('0x49')];_0x1a735c['rows']=_0x475f94[_0x4afc('0x20')]?_0x363160['slice'](_0x475f94[_0x4afc('0x1e')],_0x475f94[_0x4afc('0x1e')]+_0x475f94[_0x4afc('0x20')]):_0x363160;return _0x1a735c;})['then'](respondWithFilteredResult(_0x3616d8,_0x475f94))[_0x4afc('0x1b')](handleError(_0x3616d8,null));};function get_open_tabs(_0x438e9d,_0x545fb1){var _0x5e9d2a=_0x438e9d[_0x4afc('0x18d')](0x0)[_0x4afc('0x18e')]()+_0x438e9d[_0x4afc('0x18f')](0x1);var _0x459f7f={'type':db[_0x4afc('0x8a')][_0x4afc('0x67')][_0x4afc('0x68')],'raw':!![]};return new BPromise(function(_0x1dd170,_0x5c6401){var _0x3a0577=squel[_0x4afc('0x190')]()[_0x4afc('0x191')](_0x4afc('0x192')+_0x5e9d2a+_0x4afc('0x193'),'id')[_0x4afc('0x191')](_0x4afc('0x194'))['from']('user_has_'+_0x438e9d+_0x4afc('0x195'),'ui')['where'](_0x4afc('0x196'),_0x545fb1['id']);return db[_0x4afc('0x66')][_0x4afc('0x46')](_0x3a0577[_0x4afc('0x197')](),_0x459f7f)[_0x4afc('0x12')](function(_0x2b7f1c){_0x545fb1[_0x5e9d2a+'OpenTabs']=_0x2b7f1c;_0x1dd170(_0x2b7f1c);})[_0x4afc('0x1b')](function(_0x20c30c){_0x5c6401(_0x20c30c);});});};
\ No newline at end of file
+var _0x4137=['add','capitalize','toLowerCase','Queues','penalty','spread','QueueId','Queue:save','voice','VoiceQueue','SIP/%s','voicePause','Unknown\x20channel','remove','isArray','Queue:remove','emit','addAvatar','filename','getAvatar','join','server/files/images/logos/default_profile.png','userpic','download','existsSync','root','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','FaxOpenTabs','createdAt','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','getContacts','CmContact','order','where','pick','merge','options','CmList','List','Tag','Tags','color','tag','hasOwnProperty','nolimit','getQueues','sort','Unknown\x20role','Queue','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','OpenchannelInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','phone','LOCAL/%s@from-sip/n','intrf','format','user:%s','user:forcelogout','headers','x-forwarded-for','remoteAddress','socket','connection','UserVoiceQueueRt','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','PAUSE','LOGININPAUSE','MemberReport','isMiddleware','resolve','pause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','faxPause','openchannelPause','smsPause','pauseType','manual','Pause','getTeams','Team','addTeams','setDataValue','getChatQueues','Chat','getMailQueues','Mail','getSmsQueues','Sms','getWhatsappQueues','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','getDataValue','upsert','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','Voice','Whatsapp','removeAgent','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','concat','$or','$gte','$lt','$lte','$ne','$eq','$not','$in','$notIn','$like','$notLike','$iLike','$contains','$contained','CmHopper','lastName','Contact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','getPresence','queues','teams','inbound','lower','col','asc','desc','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unavailable','voiceStatus','slice','charAt','toUpperCase','SELECT','select','ui.','InteractionId','field','ui.UserId\x20=\x20?','toString','OpenTabs','moment','bluebird','util','path','lodash','squel','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','./user.socket','register','defaults','redis','client','http','request','then','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','User,\x20%s,\x20%s','message','request\x20sent','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','destroy','get','role','admin','Users','user','Agents','Telephones','telephone','filter','ignore','value','includes','name','UserProfileResource','end','stack','send','User','rawAttributes','map','fieldName','type','key','getOptions','query','includeAll','include','attributes','push','findAll','rows','openTabs','true','length','chat','dataValues','sms','fax','mail','openchannel','whatsapp','all','differenceBy','password','salt','keys','filters','intersection','model','fields','find','update','body','params','describe','addContacts','ids','omit','catch','internal','findById','securePassword','validatePasswordPattern','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','from','mailbox','VoiceMail','fullname','agent','permissions','101','102','103','113','110','104','105','106','107','109','100','111','114','115','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','checkUserLimits','settingsEnabled','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','Unauthorized','some','each','isEmpty','oldPassword','newPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Sequelize','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','passwordHistoryLimit','enforcePasswordHistory','previousPasswords','validatePasswordHistory','addQueues','channel','online','loginInPause','interface','isValidChannel'];(function(_0x44bccb,_0x36c19e){var _0x401284=function(_0x2581d8){while(--_0x2581d8){_0x44bccb['push'](_0x44bccb['shift']());}};_0x401284(++_0x36c19e);}(_0x4137,0xf8));var _0x7413=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x4137[_0x59ee6f];return _0x4c0979;};'use strict';var moment=require(_0x7413('0x0'));var BPromise=require(_0x7413('0x1'));var util=require(_0x7413('0x2'));var path=require(_0x7413('0x3'));var fs=require('fs');var _=require(_0x7413('0x4'));var squel=require(_0x7413('0x5'));var jayson=require(_0x7413('0x6'));var Redis=require(_0x7413('0x7'));var authService=require(_0x7413('0x8'));var qs=require(_0x7413('0x9'));var logger=require(_0x7413('0xa'))(_0x7413('0xb'));var utils=require('../../config/utils');var config=require(_0x7413('0xc'));var licenseUtil=require(_0x7413('0xd'));var db=require(_0x7413('0xe'))['db'];var socket=require(_0x7413('0xf'))(new Redis(config['redis']));require(_0x7413('0x10'))[_0x7413('0x11')](socket);config['redis']=_[_0x7413('0x12')](config[_0x7413('0x13')],{'host':'localhost','port':0x18eb});var client=jayson[_0x7413('0x14')][_0x7413('0x15')]({'port':0x232a});var values;function respondWithRpcPromise(_0x737ab4,_0x3e026b,_0x14212d,_0x5a1e62){return new BPromise(function(_0xa25d72,_0x32034c){var _0x4bf07d=_0x5a1e62||client;return _0x4bf07d[_0x7413('0x16')](_0x737ab4,_0x14212d)[_0x7413('0x17')](function(_0x13e6bd){logger['info']('User,\x20%s,\x20%s',_0x3e026b,'request\x20sent');logger[_0x7413('0x18')](_0x7413('0x19'),_0x3e026b,'request\x20sent',JSON[_0x7413('0x1a')](_0x13e6bd));if(_0x13e6bd[_0x7413('0x1b')]){if(_0x13e6bd['error'][_0x7413('0x1c')]===0x1f4){logger['error']('User,\x20%s,\x20%s',_0x3e026b,_0x13e6bd[_0x7413('0x1b')]['message']);return _0x32034c(_0x13e6bd[_0x7413('0x1b')]['message']);}logger[_0x7413('0x1b')](_0x7413('0x1d'),_0x3e026b,_0x13e6bd[_0x7413('0x1b')][_0x7413('0x1e')]);return _0xa25d72(_0x13e6bd[_0x7413('0x1b')][_0x7413('0x1e')]);}else{logger['info'](_0x7413('0x1d'),_0x3e026b,_0x7413('0x1f'));_0xa25d72(_0x13e6bd[_0x7413('0x20')][_0x7413('0x1e')]);}})['catch'](function(_0x239d0e){logger[_0x7413('0x1b')](_0x7413('0x1d'),_0x3e026b,_0x239d0e);_0x32034c(_0x239d0e);});});}function respondWithStatusCode(_0x20d3d2,_0x409392){_0x409392=_0x409392||0xcc;return function(_0x2d220f){if(_0x2d220f){return _0x20d3d2[_0x7413('0x21')](_0x409392);}return _0x20d3d2[_0x7413('0x22')](_0x409392)['end']();};}function respondWithResult(_0x5f12a2,_0x138508){_0x138508=_0x138508||0xc8;return function(_0x599654){if(_0x599654){return _0x5f12a2[_0x7413('0x22')](_0x138508)[_0x7413('0x23')](_0x599654);}};}function respondWithFilteredResult(_0x3b0c81,_0x2fc0f4){return function(_0x1d46e9){if(_0x1d46e9){var _0x346ce8=typeof _0x2fc0f4[_0x7413('0x24')]===_0x7413('0x25')&&typeof _0x2fc0f4[_0x7413('0x26')]==='undefined';var _0x5cb15f=_0x1d46e9[_0x7413('0x27')];var _0x48c2dc=_0x346ce8?0x0:_0x2fc0f4[_0x7413('0x24')];var _0x71cbb4=_0x346ce8?_0x1d46e9[_0x7413('0x27')]:_0x2fc0f4['offset']+_0x2fc0f4[_0x7413('0x26')];var _0x896552;if(_0x71cbb4>=_0x5cb15f){_0x71cbb4=_0x5cb15f;_0x896552=0xc8;}else{_0x896552=0xce;}_0x3b0c81[_0x7413('0x22')](_0x896552);return _0x3b0c81[_0x7413('0x28')](_0x7413('0x29'),_0x48c2dc+'-'+_0x71cbb4+'/'+_0x5cb15f)[_0x7413('0x23')](_0x1d46e9);}return null;};}function saveUpdates(_0x5eb4d9){return function(_0x24dce7){if(_0x24dce7){return _0x24dce7['update'](_0x5eb4d9)[_0x7413('0x17')](function(_0x23e682){return _0x23e682;});}return null;};}function removeEntity(_0xae2969){return function(_0x13a836){if(_0x13a836){return _0x13a836[_0x7413('0x2a')]()[_0x7413('0x17')](function(){var _0x5bb3ea=_0x13a836[_0x7413('0x2b')]({'plain':!![]});if(_0x5bb3ea[_0x7413('0x2c')]===_0x7413('0x2d'))return;var _0x31ae6a=[{'name':_0x7413('0x2e'),'value':_0x7413('0x2f'),'ignore':!![]},{'name':_0x7413('0x30'),'value':'agent','ignore':![]},{'name':_0x7413('0x31'),'value':_0x7413('0x32'),'ignore':![]}];var _0x41c7db=_(_0x31ae6a)[_0x7413('0x33')](_0x7413('0x34'))['map'](_0x7413('0x35'))['value']();if(_[_0x7413('0x36')](_0x41c7db,_0x5bb3ea[_0x7413('0x2c')])){return;}var _0x1cc4d8=_['find'](_0x31ae6a,[_0x7413('0x35'),_0x5bb3ea['role']])[_0x7413('0x37')];return db[_0x7413('0x38')]['destroy']({'where':{'type':_0x1cc4d8,'resourceId':_0x5bb3ea['id']}})['then'](function(){return _0x13a836;});})[_0x7413('0x17')](function(){_0xae2969[_0x7413('0x22')](0xcc)[_0x7413('0x39')]();});}};}function handleEntityNotFound(_0x513334){return function(_0x4dd1ce){if(!_0x4dd1ce){_0x513334[_0x7413('0x21')](0x194);}return _0x4dd1ce;};}function handleError(_0x5a92ab,_0x50aa24){_0x50aa24=_0x50aa24||0x1f4;return function(_0xda3035){logger['error'](_0xda3035[_0x7413('0x3a')]);if(_0xda3035[_0x7413('0x37')]){delete _0xda3035[_0x7413('0x37')];}_0x5a92ab[_0x7413('0x22')](_0x50aa24)[_0x7413('0x3b')](_0xda3035);};}exports['index']=function(_0xa58bd2,_0x8dc047){var _0x44e8b5={},_0xfa34ef={'count':0x0,'rows':[]};var _0x245777=_(db[_0x7413('0x3c')][_0x7413('0x3d')])[_0x7413('0x3e')](function(_0x5993d){return{'name':_0x5993d[_0x7413('0x3f')],'type':_0x5993d[_0x7413('0x40')][_0x7413('0x41')]};})['filter'](function(_0x31f8){return!_['includes'](['password','salt'],_0x31f8['name']);})['value']();_0x44e8b5=qs[_0x7413('0x42')](_0x245777,_0xa58bd2);var _0x4c1770={'where':_0x44e8b5['where']};return db[_0x7413('0x3c')]['count'](_0x4c1770)['then'](function(_0x3d92ec){_0xfa34ef[_0x7413('0x27')]=_0x3d92ec;if(_0xa58bd2[_0x7413('0x43')][_0x7413('0x44')]){_0x44e8b5[_0x7413('0x45')]=[{'all':!![]}];}if(!_['includes'](_0x44e8b5[_0x7413('0x46')],'id')){_0x44e8b5['attributes'][_0x7413('0x47')]('id');}return db[_0x7413('0x3c')][_0x7413('0x48')](_0x44e8b5);})[_0x7413('0x17')](function(_0x3f7da2){_0xfa34ef[_0x7413('0x49')]=_0x3f7da2;if(_0xa58bd2[_0x7413('0x43')][_0x7413('0x4a')]===_0x7413('0x4b')){var _0x1dd908=[];for(var _0x38cd61=0x0;_0x38cd61<_0xfa34ef[_0x7413('0x49')][_0x7413('0x4c')];_0x38cd61++){_0x1dd908['push'](get_open_tabs(_0x7413('0x4d'),_0xfa34ef[_0x7413('0x49')][_0x38cd61][_0x7413('0x4e')]));_0x1dd908[_0x7413('0x47')](get_open_tabs(_0x7413('0x4f'),_0xfa34ef[_0x7413('0x49')][_0x38cd61][_0x7413('0x4e')]));_0x1dd908[_0x7413('0x47')](get_open_tabs(_0x7413('0x50'),_0xfa34ef[_0x7413('0x49')][_0x38cd61][_0x7413('0x4e')]));_0x1dd908['push'](get_open_tabs(_0x7413('0x51'),_0xfa34ef['rows'][_0x38cd61][_0x7413('0x4e')]));_0x1dd908[_0x7413('0x47')](get_open_tabs(_0x7413('0x52'),_0xfa34ef[_0x7413('0x49')][_0x38cd61][_0x7413('0x4e')]));_0x1dd908[_0x7413('0x47')](get_open_tabs(_0x7413('0x53'),_0xfa34ef[_0x7413('0x49')][_0x38cd61][_0x7413('0x4e')]));}return BPromise[_0x7413('0x54')](_0x1dd908)['then'](function(_0x513657){return _0xfa34ef;});}else{return _0xfa34ef;}})[_0x7413('0x17')](respondWithFilteredResult(_0x8dc047,_0x44e8b5))['catch'](handleError(_0x8dc047,null));};exports['show']=function(_0x27d2b6,_0x208338){var _0x5cb3bb={'raw':![],'where':{'id':_0x27d2b6['params']['id']}},_0x2aa12c={};_0x2aa12c['model']=_[_0x7413('0x55')](_['keys'](db[_0x7413('0x3c')][_0x7413('0x3d')]),[_0x7413('0x56'),_0x7413('0x57')]);_0x2aa12c[_0x7413('0x43')]=_[_0x7413('0x58')](_0x27d2b6[_0x7413('0x43')]);_0x2aa12c[_0x7413('0x59')]=_[_0x7413('0x5a')](_0x2aa12c[_0x7413('0x5b')],_0x2aa12c['query']);_0x5cb3bb[_0x7413('0x46')]=_['intersection'](_0x2aa12c['model'],qs['fields'](_0x27d2b6[_0x7413('0x43')][_0x7413('0x5c')]));_0x5cb3bb[_0x7413('0x46')]=_0x5cb3bb[_0x7413('0x46')]['length']?_0x5cb3bb['attributes']:_0x2aa12c[_0x7413('0x5b')];if(_0x27d2b6['query'][_0x7413('0x44')]){_0x5cb3bb['include']=[{'all':!![]}];}_0x5cb3bb=_['merge']({},_0x5cb3bb,_0x27d2b6['options']);if(!_['includes'](_0x5cb3bb['attributes'],'id')){_0x5cb3bb[_0x7413('0x46')][_0x7413('0x47')]('id');}return db[_0x7413('0x3c')][_0x7413('0x5d')](_0x5cb3bb)[_0x7413('0x17')](handleEntityNotFound(_0x208338,null))['then'](function(_0x33017d){var _0x1762b0=[];values=_0x33017d;if(_0x27d2b6[_0x7413('0x43')]['openTabs']===_0x7413('0x4b')){_0x1762b0['push'](get_open_tabs('chat',_0x33017d[_0x7413('0x4e')]));_0x1762b0[_0x7413('0x47')](get_open_tabs(_0x7413('0x4f'),_0x33017d[_0x7413('0x4e')]));_0x1762b0[_0x7413('0x47')](get_open_tabs(_0x7413('0x52'),_0x33017d['dataValues']));_0x1762b0[_0x7413('0x47')](get_open_tabs('whatsapp',_0x33017d[_0x7413('0x4e')]));_0x1762b0['push'](get_open_tabs(_0x7413('0x50'),_0x33017d['dataValues']));_0x1762b0[_0x7413('0x47')](get_open_tabs(_0x7413('0x51'),_0x33017d['dataValues']));return BPromise[_0x7413('0x54')](_0x1762b0);}else{return values;}})['then'](function(_0xf01452){return values;})[_0x7413('0x17')](respondWithResult(_0x208338,null))['catch'](handleError(_0x208338,null));};exports[_0x7413('0x5e')]=function(_0x12048c,_0x59d639){if(_0x12048c[_0x7413('0x5f')]['id']){delete _0x12048c[_0x7413('0x5f')]['id'];}delete _0x12048c['body'][_0x7413('0x2c')];return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x12048c[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x59d639,null))[_0x7413('0x17')](saveUpdates(_0x12048c[_0x7413('0x5f')],null))[_0x7413('0x17')](respondWithResult(_0x59d639,null))['catch'](handleError(_0x59d639,null));};exports[_0x7413('0x61')]=function(_0x4ca888,_0x3808d3){return db[_0x7413('0x3c')][_0x7413('0x61')]()[_0x7413('0x17')](respondWithResult(_0x3808d3,null))['catch'](handleError(_0x3808d3,null));};exports['addContacts']=function(_0x559ce3,_0x56b090){return db['User'][_0x7413('0x5d')]({'where':{'id':_0x559ce3[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x56b090,null))['then'](function(_0x3c20db){if(_0x3c20db){return _0x3c20db[_0x7413('0x62')](_0x559ce3[_0x7413('0x5f')][_0x7413('0x63')],_[_0x7413('0x64')](_0x559ce3[_0x7413('0x5f')],[_0x7413('0x63'),'id'])||{});}})[_0x7413('0x17')](respondWithResult(_0x56b090,null))[_0x7413('0x65')](handleError(_0x56b090,null));};function validateUser(_0x47512d){return new BPromise(function(_0x3f9cfd,_0x1264f3){if(_0x47512d[_0x7413('0x66')])return _0x3f9cfd(_0x47512d);return db['Setting'][_0x7413('0x67')](0x1)[_0x7413('0x17')](function(_0x4cab22){if(_0x4cab22[_0x7413('0x68')])authService[_0x7413('0x69')](_0x47512d[_0x7413('0x56')]);db[_0x7413('0x3c')][_0x7413('0x6a')](_0x7413('0x66'))['then'](function(_0x61e533){if(_[_0x7413('0x6b')](_0x61e533)){_0x47512d['internal']=_0x4cab22[_0x7413('0x6c')]||0x1;return;}if(_['isNil'](_0x4cab22['min_internal'])||_0x4cab22[_0x7413('0x6c')]===_0x61e533){_0x47512d[_0x7413('0x66')]=_0x61e533+0x1;return;}if(_0x4cab22[_0x7413('0x6c')]>_0x61e533){_0x47512d[_0x7413('0x66')]=_0x4cab22[_0x7413('0x6c')];return;}return db[_0x7413('0x6d')][_0x7413('0x43')](_0x7413('0x6e'),{'type':db['sequelize'][_0x7413('0x6f')]['SELECT']})[_0x7413('0x17')](function(_0x3deb37){if(_0x3deb37&&_0x3deb37[_0x7413('0x4c')]){for(var _0x3054f5=0x0,_0x2c4664=_0x3deb37[_0x7413('0x4c')];_0x3054f5<_0x2c4664&&_[_0x7413('0x6b')](_0x47512d[_0x7413('0x66')]);_0x3054f5++){if(_0x4cab22[_0x7413('0x6c')]<=_0x3deb37[_0x3054f5]['from']){_0x47512d[_0x7413('0x66')]=_0x3deb37[_0x3054f5][_0x7413('0x70')];}else if(_0x4cab22['min_internal']>_0x3deb37[_0x3054f5][_0x7413('0x70')]&&_0x4cab22[_0x7413('0x6c')]<=_0x3deb37[_0x3054f5]['to']){_0x47512d['internal']=_0x4cab22[_0x7413('0x6c')];}}}if(_['isNil'](_0x47512d[_0x7413('0x66')])){_0x47512d[_0x7413('0x66')]=_0x61e533+0x1;}return _0x3f9cfd(_0x47512d);});});})['catch'](function(_0x51f2c3){_0x1264f3(_0x51f2c3);});});}function updateUser(_0x227a66){return new BPromise(function(_0x19fe72,_0x34ec9a){try{if(_0x227a66['voicemail']){_0x227a66[_0x7413('0x71')]=_0x227a66[_0x7413('0x66')];_0x227a66[_0x7413('0x72')]={'mailbox':_0x227a66[_0x7413('0x66')],'password':_0x227a66[_0x7413('0x56')],'fullname':_0x227a66[_0x7413('0x73')],'email':_0x227a66['email']};}if(_0x227a66[_0x7413('0x2c')]===_0x7413('0x74')){if(!_0x227a66[_0x7413('0x75')])_0x227a66['permissions']=[_0x7413('0x76'),_0x7413('0x77'),_0x7413('0x78'),_0x7413('0x79'),_0x7413('0x7a'),_0x7413('0x7b'),_0x7413('0x7c'),_0x7413('0x7d'),_0x7413('0x7e'),'108',_0x7413('0x7f'),_0x7413('0x80'),_0x7413('0x81'),_0x7413('0x82'),_0x7413('0x83')];}_0x19fe72(_0x227a66);}catch(_0x3b7d16){_0x34ec9a(_0x3b7d16);}});}exports['create']=function(_0x3e6393,_0x56d20e){if(_0x3e6393['user'][_0x7413('0x2c')]===_0x7413('0x74'))throw new Error('Unauthorized');if(_0x3e6393[_0x7413('0x5f')][_0x7413('0x2c')]===_0x7413('0x2f')&&_0x3e6393[_0x7413('0x2f')][_0x7413('0x2c')]!==_0x7413('0x2d')){throw new Error(_0x7413('0x84'));}if(_0x3e6393[_0x7413('0x5f')]['role']===_0x7413('0x2d')&&_0x3e6393['user'][_0x7413('0x2c')]!==_0x7413('0x2d')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x7413('0x85')]([_0x3e6393[_0x7413('0x5f')]])[_0x7413('0x17')](function(){return validateUser(_0x3e6393[_0x7413('0x5f')]);})[_0x7413('0x17')](function(_0x3920b5){return updateUser(_0x3920b5)[_0x7413('0x17')](function(_0x12fbb2){if(_0x12fbb2[_0x7413('0x2c')]===_0x7413('0x2d')){_0x12fbb2['settingsEnabled']=_0x3e6393[_0x7413('0x2f')][_0x7413('0x86')];delete _0x12fbb2['userProfileId'];}return _0x12fbb2;});})['then'](function(_0x544fa2){return db[_0x7413('0x3c')]['create'](_0x544fa2,{'include':[{'model':db[_0x7413('0x72')],'as':_0x7413('0x72')}]});})[_0x7413('0x17')](function(_0x36cd29){if(_0x3e6393[_0x7413('0x5f')][_0x7413('0x2c')]===_0x7413('0x2f'))return _0x36cd29;if(_0x3e6393[_0x7413('0x2f')][_0x7413('0x2c')]!=='user')return _0x36cd29;return db[_0x7413('0x87')][_0x7413('0x5d')]({'where':{'name':_0x36cd29[_0x7413('0x2c')]==='agent'?_0x7413('0x30'):_0x7413('0x31'),'userProfileId':_0x3e6393[_0x7413('0x2f')][_0x7413('0x88')]},'raw':!![]})[_0x7413('0x17')](function(_0x19a777){if(!_0x19a777||_0x19a777[_0x7413('0x89')]!=0x0)return _0x36cd29;return db[_0x7413('0x38')][_0x7413('0x8a')]({'name':_0x36cd29[_0x7413('0x37')],'resourceId':_0x36cd29['id'],'type':_0x19a777['name'],'sectionId':_0x19a777['id']},{})[_0x7413('0x17')](function(){return _0x36cd29;});})[_0x7413('0x65')](function(_0x4d2aed){logger[_0x7413('0x1b')](_0x7413('0x8b'),_0x4d2aed);throw _0x4d2aed;});})['then'](respondWithResult(_0x56d20e,0xc9))[_0x7413('0x65')](handleError(_0x56d20e,null));};exports[_0x7413('0x8c')]=function(_0x230191,_0x47fbf0){var _0x36d8cf=_0x230191['body'];var _0x466ec8=[];if(_0x230191[_0x7413('0x2f')][_0x7413('0x2c')]===_0x7413('0x74'))throw new Error(_0x7413('0x8d'));if(_[_0x7413('0x8e')](_0x36d8cf,['role',_0x7413('0x2f')])&&_0x230191[_0x7413('0x2f')][_0x7413('0x2c')]!==_0x7413('0x2d')){throw new Error(_0x7413('0x84'));}if(_['some'](_0x36d8cf,[_0x7413('0x2c'),_0x7413('0x2d')])&&_0x230191[_0x7413('0x2f')][_0x7413('0x2c')]!==_0x7413('0x2d')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil['checkUserLimits'](_0x36d8cf)[_0x7413('0x17')](function(){return validateUser(_0x36d8cf[0x0]);})[_0x7413('0x17')](function(){for(var _0x389ce1=0x1;_0x389ce1<_0x36d8cf[_0x7413('0x4c')];_0x389ce1++){var _0x4ec202=_0x36d8cf[_0x389ce1-0x1]['internal'];if(!_0x36d8cf[_0x389ce1][_0x7413('0x66')])_0x36d8cf[_0x389ce1][_0x7413('0x66')]=_0x4ec202+0x1;_0x466ec8[_0x7413('0x47')](validateUser(_0x36d8cf[_0x389ce1]));}return BPromise['all'](_0x466ec8);})['then'](function(){_0x466ec8=[];for(var _0x2d71c8=0x0;_0x2d71c8<_0x36d8cf[_0x7413('0x4c')];_0x2d71c8++){_0x466ec8[_0x7413('0x47')](updateUser(_0x36d8cf[_0x2d71c8]));}return BPromise[_0x7413('0x54')](_0x466ec8);})[_0x7413('0x17')](function(){return BPromise[_0x7413('0x8f')](_0x36d8cf,function(_0x5fd045){return db['User']['create'](_0x5fd045,{'include':[{'model':db[_0x7413('0x72')],'as':_0x7413('0x72')}]})['then'](function(_0x2016de){_0x5fd045['id']=_0x2016de['id'];return _0x5fd045;});});})[_0x7413('0x17')](function(_0x35389e){if(_0x230191[_0x7413('0x5f')][_0x7413('0x2c')]===_0x7413('0x2f'))return _0x35389e;if(_0x230191[_0x7413('0x2f')][_0x7413('0x2c')]!==_0x7413('0x2f'))return _0x35389e;var _0x5802e0=_[_0x7413('0x8e')](_0x35389e,function(_0x3baf5c){return _0x3baf5c[_0x7413('0x2c')]===_0x7413('0x74')||_0x3baf5c[_0x7413('0x2c')]===_0x7413('0x32');});if(!_0x5802e0)return _0x35389e;return db['UserProfileSection']['findAll']({'where':{'name':{'$or':['Agents',_0x7413('0x31')]},'userProfileId':_0x230191[_0x7413('0x2f')][_0x7413('0x88')]},'raw':!![]})[_0x7413('0x17')](function(_0x29c329){if(_[_0x7413('0x90')](_0x29c329)||!_[_0x7413('0x8e')](_0x29c329,[_0x7413('0x89'),0x0]))return _0x35389e;_0x466ec8=[];var _0x4e872e=_(_0x29c329)[_0x7413('0x3e')](function(_0x4ef245){if(_0x4ef245[_0x7413('0x89')]===0x1)return;return _0x4ef245[_0x7413('0x37')]===_0x7413('0x30')?_0x7413('0x74'):_0x7413('0x32');})['compact']()[_0x7413('0x35')]();for(var _0xdbb32=0x0;_0xdbb32<_0x35389e[_0x7413('0x4c')];_0xdbb32++){if(!_[_0x7413('0x36')](_0x4e872e,_0x35389e[_0xdbb32][_0x7413('0x2c')]))return;var _0x38f6cc=_0x35389e[_0xdbb32][_0x7413('0x2c')]===_0x7413('0x74')?_0x7413('0x30'):_0x7413('0x31');_0x466ec8[_0x7413('0x47')](db[_0x7413('0x38')][_0x7413('0x8a')]({'name':_0x35389e[_0xdbb32][_0x7413('0x37')],'resourceId':_0x35389e[_0xdbb32]['id'],'type':_0x38f6cc,'sectionId':_[_0x7413('0x5d')](_0x29c329,['name',_0x38f6cc])['id']},{}));}return BPromise['all'](_0x466ec8);});})[_0x7413('0x17')](respondWithResult(_0x47fbf0,0xc9))[_0x7413('0x65')](handleError(_0x47fbf0,null));};exports['changePassword']=function(_0x2144b3,_0x571a6c){if(_0x2144b3[_0x7413('0x5f')]['id']){delete _0x2144b3[_0x7413('0x5f')]['id'];}return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x2144b3[_0x7413('0x60')]['id']}})[_0x7413('0x17')](function(_0x10024a){if(!_0x10024a)return null;if(_0x10024a['id']===_0x2144b3[_0x7413('0x2f')]['id']){if(!_0x2144b3['body'][_0x7413('0x91')]||!_0x2144b3['body'][_0x7413('0x92')]){throw new db['Sequelize'][(_0x7413('0x93'))](_0x7413('0x94'));}if(!_0x10024a[_0x7413('0x95')](_0x2144b3['body'][_0x7413('0x91')])){throw new db[(_0x7413('0x96'))][(_0x7413('0x93'))](_0x7413('0x97'));}if(_0x2144b3[_0x7413('0x5f')][_0x7413('0x91')]===_0x2144b3['body'][_0x7413('0x92')]){throw new db['Sequelize']['ValidationError'](_0x7413('0x98'));}}else if(_0x2144b3[_0x7413('0x2f')][_0x7413('0x2c')]==='admin'){if(!_0x2144b3[_0x7413('0x5f')][_0x7413('0x92')]){throw new db[(_0x7413('0x96'))][(_0x7413('0x93'))](_0x7413('0x99'));}}else if(_0x2144b3[_0x7413('0x2f')]['role']==='user'){if(!_0x2144b3['body'][_0x7413('0x92')]){throw new db[(_0x7413('0x96'))]['ValidationError'](_0x7413('0x99'));}if(_0x10024a[_0x7413('0x2c')]!==_0x7413('0x74')){throw new db[(_0x7413('0x96'))]['ValidationError'](_0x7413('0x8d'));}}else{throw new db[(_0x7413('0x96'))]['ValidationError'](_0x7413('0x8d'));}return _0x10024a;})[_0x7413('0x17')](handleEntityNotFound(_0x571a6c,null))[_0x7413('0x17')](function(_0x3819d3){return db['Setting'][_0x7413('0x9a')]({'attributes':['id',_0x7413('0x68'),'enforcePasswordHistory',_0x7413('0x9b')]})[_0x7413('0x17')](function(_0x570989){if(_0x570989[_0x7413('0x68')])authService['validatePasswordPattern'](_0x2144b3[_0x7413('0x5f')][_0x7413('0x92')]);if(!_0x570989[_0x7413('0x9c')]||!_0x3819d3[_0x7413('0x9d')])return _0x3819d3;authService[_0x7413('0x9e')](_0x2144b3[_0x7413('0x5f')][_0x7413('0x92')],_0x3819d3[_0x7413('0x9d')],_0x570989['passwordHistoryLimit']);return _0x3819d3;})[_0x7413('0x17')](saveUpdates({'password':_0x2144b3['body']['newPassword'],'passwordResetAt':_0x2144b3[_0x7413('0x2f')]['id']==_0x2144b3[_0x7413('0x60')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x2144b3[_0x7413('0x5f')][_0x7413('0x92')],_0x3819d3[_0x7413('0x9d')])},null));})[_0x7413('0x17')](respondWithResult(_0x571a6c,null))[_0x7413('0x65')](handleError(_0x571a6c,null));};exports[_0x7413('0x9f')]=function(_0x5ca6c3,_0x2c1a90){var _0x337540=_0x5ca6c3[_0x7413('0x5f')][_0x7413('0xa0')];return db['User'][_0x7413('0x5d')]({'where':{'id':_0x5ca6c3[_0x7413('0x60')]['id']},'attributes':['id','name',_0x7413('0x2c'),_0x7413('0xa1'),_0x7413('0xa2'),'voicePause',_0x7413('0xa3')]})[_0x7413('0x17')](handleEntityNotFound(_0x2c1a90,null))[_0x7413('0x17')](function(_0x1aa397){if(_0x1aa397){if(!utils[_0x7413('0xa4')](_0x337540)){throw new db[(_0x7413('0x96'))]['ValidationError']('Unknown\x20channel');}return _0x1aa397[_0x7413('0xa5')+_[_0x7413('0xa6')](_0x337540[_0x7413('0xa7')]())+_0x7413('0xa8')](_0x5ca6c3['body'][_0x7413('0x63')],{'penalty':_0x5ca6c3[_0x7413('0x5f')][_0x7413('0xa9')]||0x0})[_0x7413('0xaa')](function(_0x57b209){for(var _0x56422f=0x0;_0x56422f<_0x5ca6c3[_0x7413('0x5f')][_0x7413('0x63')]['length'];_0x56422f+=0x1){var _0x1eeb5c={'UserId':Number(_0x5ca6c3[_0x7413('0x60')]['id'])};_0x1eeb5c[_['capitalize'](_0x337540[_0x7413('0xa7')]())+_0x7413('0xab')]=Number(_0x5ca6c3[_0x7413('0x5f')][_0x7413('0x63')][_0x56422f]);socket['emit']('user'+_['capitalize'](_0x337540['toLowerCase']())+_0x7413('0xac'),_0x1eeb5c);}return _0x57b209;})[_0x7413('0x17')](function(){if(_0x337540===_0x7413('0xad')){return db[_0x7413('0xae')][_0x7413('0x48')]({'where':{'id':_0x5ca6c3[_0x7413('0x5f')][_0x7413('0x63')]||[]},'raw':!![],'attributes':['id',_0x7413('0x37')]});}})[_0x7413('0x17')](function(_0x321ce){var _0x19a1f6=_0x1aa397['get']({'plain':!![]});var _0x5d6c8b=[];if(_0x337540==='voice'&&_0x19a1f6[_0x7413('0x2c')]===_0x7413('0x74')&&_0x19a1f6[_0x7413('0xa1')]){for(var _0x4c6236=0x0;_0x4c6236<_0x321ce['length'];_0x4c6236+=0x1){_0x5d6c8b[_0x7413('0x47')]({'membername':_0x19a1f6[_0x7413('0x37')],'UserId':_0x19a1f6['id'],'queue_name':_0x321ce[_0x4c6236][_0x7413('0x37')],'VoiceQueueId':_0x321ce[_0x4c6236]['id'],'interface':_['isNil'](_0x19a1f6[_0x7413('0xa3')])?util['format'](_0x7413('0xaf'),_0x19a1f6[_0x7413('0x37')]):_0x19a1f6[_0x7413('0xa3')],'paused':_0x19a1f6[_0x7413('0xb0')]||![],'penalty':_0x5ca6c3['body']['penalty']||0x0});}return BPromise['each'](_0x5d6c8b,function(_0x48a547){return db['UserVoiceQueueRt']['upsert'](_0x48a547);});}return _0x1aa397;});}})[_0x7413('0x17')](respondWithStatusCode(_0x2c1a90,null))[_0x7413('0x65')](handleError(_0x2c1a90,null));};exports['removeQueues']=function(_0x2304bc,_0x34b2e2){var _0x545c7e;return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x2304bc[_0x7413('0x60')]['id']},'attributes':['id','name','role']})['then'](handleEntityNotFound(_0x34b2e2,null))[_0x7413('0x17')](function(_0xb1d14b){if(_0xb1d14b){_0x545c7e=_0xb1d14b;if(!_0x2304bc[_0x7413('0x43')][_0x7413('0xa0')]||!utils[_0x7413('0xa4')](_0x2304bc['query']['channel'])){throw new db[(_0x7413('0x96'))][(_0x7413('0x93'))](_0x7413('0xb1'));}return _0xb1d14b[_0x7413('0xb2')+_['capitalize'](_0x2304bc[_0x7413('0x43')][_0x7413('0xa0')][_0x7413('0xa7')]())+_0x7413('0xa8')](_0x2304bc[_0x7413('0x43')][_0x7413('0x63')]);}})[_0x7413('0x17')](function(_0x2ee4f8){if(_[_0x7413('0xb3')](_0x2304bc[_0x7413('0x43')]['ids'])){for(var _0xb42506=0x0;_0xb42506<_0x2304bc[_0x7413('0x43')][_0x7413('0x63')][_0x7413('0x4c')];_0xb42506+=0x1){var _0x1b03f8={'UserId':Number(_0x2304bc[_0x7413('0x60')]['id'])};_0x1b03f8[_['capitalize'](_0x2304bc[_0x7413('0x43')][_0x7413('0xa0')][_0x7413('0xa7')]())+_0x7413('0xab')]=Number(_0x2304bc[_0x7413('0x43')][_0x7413('0x63')][_0xb42506]);socket['emit']('user'+_[_0x7413('0xa6')](_0x2304bc[_0x7413('0x43')][_0x7413('0xa0')][_0x7413('0xa7')]())+_0x7413('0xb4'),_0x1b03f8);}}else{var _0x1b03f8={'UserId':Number(_0x2304bc['params']['id'])};_0x1b03f8[_['capitalize'](_0x2304bc[_0x7413('0x43')][_0x7413('0xa0')][_0x7413('0xa7')]())+_0x7413('0xab')]=Number(_0x2304bc['query'][_0x7413('0x63')]);socket[_0x7413('0xb5')]('user'+_[_0x7413('0xa6')](_0x2304bc[_0x7413('0x43')][_0x7413('0xa0')][_0x7413('0xa7')]())+'Queue:remove',_0x1b03f8);}return _0x2ee4f8;})[_0x7413('0x17')](function(){if(_0x2304bc[_0x7413('0x43')][_0x7413('0xa0')]===_0x7413('0xad')){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x2304bc[_0x7413('0x60')]['id'],'VoiceQueueId':_0x2304bc[_0x7413('0x43')][_0x7413('0x63')]},'individualHooks':!![]})[_0x7413('0x17')](function(){return _0x545c7e;});}return _0x545c7e;})[_0x7413('0x17')](respondWithStatusCode(_0x34b2e2,null))[_0x7413('0x65')](handleError(_0x34b2e2,null));};exports[_0x7413('0xb6')]=function(_0x56a565,_0x2ec725){_0x56a565[_0x7413('0x5f')]['userpic']=_0x56a565['file'][_0x7413('0xb7')];return db['User']['find']({'where':{'id':_0x56a565[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x2ec725,null))[_0x7413('0x17')](saveUpdates(_0x56a565[_0x7413('0x5f')],null))[_0x7413('0x17')](respondWithResult(_0x2ec725,null))[_0x7413('0x65')](handleError(_0x2ec725,null));};exports[_0x7413('0xb8')]=function(_0x12fcf7,_0x4f01ef){var _0x3d0eee=path[_0x7413('0xb9')](config['root'],_0x7413('0xba'));return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x12fcf7[_0x7413('0x60')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x7413('0x17')](handleEntityNotFound(_0x4f01ef,null))[_0x7413('0x17')](function(_0x714cde){if(_0x714cde){if(_['isNil'](_0x714cde[_0x7413('0xbb')])){return _0x4f01ef[_0x7413('0xbc')](_0x3d0eee);}else{if(!fs[_0x7413('0xbd')](path['join'](config[_0x7413('0xbe')],'server/files/images/',_0x714cde[_0x7413('0xbb')]))){return _0x4f01ef['download'](_0x3d0eee);}return _0x4f01ef['download'](path[_0x7413('0xb9')](config[_0x7413('0xbe')],_0x7413('0xbf'),_0x714cde[_0x7413('0xbb')]));}}})['catch'](handleError(_0x4f01ef,null));};exports[_0x7413('0xc0')]=function(_0x5477e9,_0x237b80){return db[_0x7413('0x3c')]['find']({'where':{'id':_0x5477e9[_0x7413('0x60')]['id']},'attributes':['id']})[_0x7413('0x17')](handleEntityNotFound(_0x237b80,null))[_0x7413('0x17')](function(_0x11e565){var _0xf04ba3=[];values=_0x11e565[_0x7413('0x4e')];_0xf04ba3[_0x7413('0x47')](get_open_tabs(_0x7413('0x4d'),_0x11e565[_0x7413('0x4e')]));_0xf04ba3[_0x7413('0x47')](get_open_tabs(_0x7413('0x4f'),_0x11e565[_0x7413('0x4e')]));_0xf04ba3[_0x7413('0x47')](get_open_tabs(_0x7413('0x52'),_0x11e565[_0x7413('0x4e')]));_0xf04ba3[_0x7413('0x47')](get_open_tabs('whatsapp',_0x11e565['dataValues']));_0xf04ba3[_0x7413('0x47')](get_open_tabs(_0x7413('0x50'),_0x11e565['dataValues']));_0xf04ba3[_0x7413('0x47')](get_open_tabs('mail',_0x11e565['dataValues']));return BPromise[_0x7413('0x54')](_0xf04ba3);})['then'](function(_0x39dc56){var _0xb939e=[];if(_0x39dc56){for(var _0x52b81a=0x0;_0x52b81a<values[_0x7413('0xc1')]['length'];_0x52b81a++){var _0x50ec4a=values[_0x7413('0xc1')][_0x52b81a];_0xb939e[_0x7413('0x47')]({'channel':_0x7413('0xc2'),'id':_0x50ec4a['id'],'createdAt':_0x50ec4a['createdAt']});}for(var _0x52b81a=0x0;_0x52b81a<values[_0x7413('0xc3')][_0x7413('0x4c')];_0x52b81a++){var _0x50ec4a=values['FaxOpenTabs'][_0x52b81a];_0xb939e[_0x7413('0x47')]({'channel':'FAX','id':_0x50ec4a['id'],'createdAt':_0x50ec4a[_0x7413('0xc4')]});}for(var _0x52b81a=0x0;_0x52b81a<values['OpenchannelOpenTabs'][_0x7413('0x4c')];_0x52b81a++){var _0x50ec4a=values['OpenchannelOpenTabs'][_0x52b81a];_0xb939e[_0x7413('0x47')]({'channel':_0x7413('0xc5'),'id':_0x50ec4a['id'],'createdAt':_0x50ec4a[_0x7413('0xc4')]});}for(var _0x52b81a=0x0;_0x52b81a<values[_0x7413('0xc6')]['length'];_0x52b81a++){var _0x50ec4a=values['MailOpenTabs'][_0x52b81a];_0xb939e[_0x7413('0x47')]({'channel':_0x7413('0xc7'),'id':_0x50ec4a['id'],'createdAt':_0x50ec4a[_0x7413('0xc4')]});}for(var _0x52b81a=0x0;_0x52b81a<values[_0x7413('0xc8')][_0x7413('0x4c')];_0x52b81a++){var _0x50ec4a=values[_0x7413('0xc8')][_0x52b81a];_0xb939e[_0x7413('0x47')]({'channel':_0x7413('0xc9'),'id':_0x50ec4a['id'],'createdAt':_0x50ec4a['createdAt']});}for(var _0x52b81a=0x0;_0x52b81a<values[_0x7413('0xca')]['length'];_0x52b81a++){var _0x50ec4a=values['WhatsappOpenTabs'][_0x52b81a];_0xb939e[_0x7413('0x47')]({'channel':_0x7413('0xcb'),'id':_0x50ec4a['id'],'createdAt':_0x50ec4a[_0x7413('0xc4')]});}var _0x28799c={'count':_0xb939e['length'],'rows':_0xb939e};return _0x28799c;}else return null;})[_0x7413('0x17')](respondWithResult(_0x237b80,null))[_0x7413('0x65')](handleError(_0x237b80,null));};exports[_0x7413('0xcc')]=function(_0x29044a,_0x53808c){var _0x22614a={};var _0x1687c4={};var _0x305310;var _0x252057;return db['User']['findOne']({'where':{'id':_0x29044a['params']['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x53808c,null))['then'](function(_0x5ba34c){if(_0x5ba34c){_0x305310=_0x5ba34c;_0x1687c4[_0x7413('0x5b')]=_[_0x7413('0x58')](db[_0x7413('0xcd')]['rawAttributes']);_0x1687c4[_0x7413('0x43')]=_[_0x7413('0x58')](_0x29044a[_0x7413('0x43')]);_0x1687c4[_0x7413('0x59')]=_[_0x7413('0x5a')](_0x1687c4['model'],_0x1687c4[_0x7413('0x43')]);_0x22614a['attributes']=_['intersection'](_0x1687c4[_0x7413('0x5b')],qs['fields'](_0x29044a[_0x7413('0x43')][_0x7413('0x5c')]));_0x22614a['attributes']=_0x22614a['attributes'][_0x7413('0x4c')]?_0x22614a[_0x7413('0x46')]:_0x1687c4[_0x7413('0x5b')];_0x22614a[_0x7413('0xce')]=qs['sort'](_0x29044a['query']['sort']);_0x22614a[_0x7413('0xcf')]=qs['filters'](_[_0x7413('0xd0')](_0x29044a['query'],_0x1687c4[_0x7413('0x59')]));if(_0x29044a['query']['filter']){_0x22614a[_0x7413('0xcf')]=_['merge'](_0x22614a[_0x7413('0xcf')],{'$or':_[_0x7413('0x3e')](_0x22614a['attributes'],function(_0x5aa386){var _0x54f885={};_0x54f885[_0x5aa386]={'$like':'%'+_0x29044a[_0x7413('0x43')]['filter']+'%'};return _0x54f885;})});}_0x22614a=_[_0x7413('0xd1')]({},_0x22614a,_0x29044a[_0x7413('0xd2')]);return _0x305310[_0x7413('0xcc')](_0x22614a);}})[_0x7413('0x17')](function(_0x327153){if(_0x327153){_0x252057=_0x327153[_0x7413('0x4c')];if(_0x29044a['query']['hasOwnProperty']('includeAll')){_0x22614a[_0x7413('0x45')]=[{'model':db[_0x7413('0xd3')],'as':_0x7413('0xd4'),'required':![]},{'model':db[_0x7413('0xd5')],'as':_0x7413('0xd6'),'attributes':['id',_0x7413('0x37'),_0x7413('0xd7')],'where':_0x29044a[_0x7413('0x43')][_0x7413('0xd8')]?{'id':_0x29044a[_0x7413('0x43')][_0x7413('0xd8')]}:undefined,'required':_0x29044a[_0x7413('0x43')][_0x7413('0xd8')]?!![]:![]}];}if(!_0x29044a[_0x7413('0x43')][_0x7413('0xd9')](_0x7413('0xda'))){_0x22614a[_0x7413('0x26')]=qs[_0x7413('0x26')](_0x29044a[_0x7413('0x43')][_0x7413('0x26')]);_0x22614a[_0x7413('0x24')]=qs[_0x7413('0x24')](_0x29044a['query'][_0x7413('0x24')]);}return _0x305310[_0x7413('0xcc')](_0x22614a);}})[_0x7413('0x17')](function(_0x113a33){if(_0x113a33){return _0x113a33?{'count':_0x252057,'rows':_0x113a33}:null;}})[_0x7413('0x17')](respondWithResult(_0x53808c,null))['catch'](handleError(_0x53808c,null));};exports[_0x7413('0xdb')]=function(_0x202ea6,_0x22ff37){var _0x345b86;var _0x564491;var _0x5ecd20={};var _0x27014c;return db[_0x7413('0x3c')][_0x7413('0x9a')]({'where':{'id':_0x202ea6[_0x7413('0x60')]['id']},'attributes':['id',_0x7413('0x37'),_0x7413('0x2c')]})[_0x7413('0x17')](handleEntityNotFound(_0x22ff37,null))[_0x7413('0x17')](function(_0x39334b){if(!utils[_0x7413('0xa4')](_0x202ea6[_0x7413('0x43')]['channel'])){throw new db[(_0x7413('0x96'))][(_0x7413('0x93'))](_0x7413('0xb1'));}_0x345b86=_0x39334b;var _0x37d5f0={};_0x37d5f0['model']=_[_0x7413('0x58')](db[_[_0x7413('0xa6')](_0x202ea6[_0x7413('0x43')][_0x7413('0xa0')])+'Queue'][_0x7413('0x3d')]);_0x37d5f0[_0x7413('0x43')]=_[_0x7413('0x58')](_0x202ea6[_0x7413('0x43')]);_0x37d5f0[_0x7413('0x59')]=_[_0x7413('0x5a')](_0x37d5f0['model'],_0x37d5f0[_0x7413('0x43')]);_0x5ecd20[_0x7413('0x46')]=_['intersection'](_0x37d5f0[_0x7413('0x5b')],qs[_0x7413('0x5c')](_0x202ea6['query'][_0x7413('0x5c')]));_0x5ecd20['attributes']=_0x5ecd20[_0x7413('0x46')][_0x7413('0x4c')]?_0x5ecd20[_0x7413('0x46')]:_0x37d5f0[_0x7413('0x5b')];_0x5ecd20[_0x7413('0xce')]=qs[_0x7413('0xdc')](_0x202ea6['query']['sort']);_0x5ecd20['where']=qs[_0x7413('0x59')](_['pick'](_0x202ea6[_0x7413('0x43')],_0x37d5f0['filters']));if(_0x202ea6['query'][_0x7413('0x33')]){_0x5ecd20[_0x7413('0xcf')]=_[_0x7413('0xd1')](_0x5ecd20['where'],{'$or':_[_0x7413('0x3e')](_0x5ecd20[_0x7413('0x46')],function(_0x5bedea){var _0x1e86a3={};_0x1e86a3[_0x5bedea]={'$like':'%'+_0x202ea6['query'][_0x7413('0x33')]+'%'};return _0x1e86a3;})});}_0x5ecd20=_[_0x7413('0xd1')]({},_0x5ecd20,_0x202ea6[_0x7413('0xd2')]);switch(_0x345b86[_0x7413('0x2c')]){case'admin':return db[_[_0x7413('0xa6')](_0x202ea6[_0x7413('0x43')][_0x7413('0xa0')])+'Queue'][_0x7413('0x48')](_0x5ecd20);case _0x7413('0x2f'):case _0x7413('0x74'):return _0x345b86[_0x7413('0x2b')+_[_0x7413('0xa6')](_0x202ea6['query'][_0x7413('0xa0')])+_0x7413('0xa8')](_0x5ecd20);default:throw new db[(_0x7413('0x96'))][(_0x7413('0x93'))](_0x7413('0xdd'));}})['then'](function(_0x395276){_0x27014c=_0x395276[_0x7413('0x4c')];if(!_0x202ea6[_0x7413('0x43')][_0x7413('0xd9')](_0x7413('0xda'))){_0x5ecd20[_0x7413('0x26')]=qs[_0x7413('0x26')](_0x202ea6[_0x7413('0x43')][_0x7413('0x26')]);_0x5ecd20[_0x7413('0x24')]=qs[_0x7413('0x24')](_0x202ea6[_0x7413('0x43')]['offset']);}switch(_0x345b86[_0x7413('0x2c')]){case'admin':return db[_['capitalize'](_0x202ea6[_0x7413('0x43')][_0x7413('0xa0')])+_0x7413('0xde')][_0x7413('0x48')](_0x5ecd20);case _0x7413('0x2f'):case _0x7413('0x74'):return _0x345b86[_0x7413('0x2b')+_[_0x7413('0xa6')](_0x202ea6[_0x7413('0x43')][_0x7413('0xa0')])+'Queues'](_0x5ecd20);}})[_0x7413('0x17')](function(_0x2c0834){return{'count':_0x27014c,'rows':_0x2c0834};})['then'](respondWithResult(_0x22ff37,null))[_0x7413('0x65')](handleError(_0x22ff37,null));};exports[_0x7413('0xdf')]=function(_0xa05eeb,_0x22afdc){var _0x519552={};var _0x32c013={};var _0x3413f4;var _0x7354d;return db[_0x7413('0x3c')][_0x7413('0x9a')]({'where':{'id':_0xa05eeb[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x22afdc,null))['then'](function(_0x287260){if(_0x287260){_0x3413f4=_0x287260;_0x32c013[_0x7413('0x5b')]=_['keys'](db['UserVoiceQueueRt']['rawAttributes']);_0x32c013[_0x7413('0x43')]=_[_0x7413('0x58')](_0xa05eeb[_0x7413('0x43')]);_0x32c013[_0x7413('0x59')]=_[_0x7413('0x5a')](_0x32c013['model'],_0x32c013['query']);_0x519552[_0x7413('0x46')]=_[_0x7413('0x5a')](_0x32c013['model'],qs[_0x7413('0x5c')](_0xa05eeb[_0x7413('0x43')][_0x7413('0x5c')]));_0x519552[_0x7413('0x46')]=_0x519552['attributes'][_0x7413('0x4c')]?_0x519552[_0x7413('0x46')]:_0x32c013[_0x7413('0x5b')];_0x519552[_0x7413('0xce')]=qs[_0x7413('0xdc')](_0xa05eeb['query'][_0x7413('0xdc')]);_0x519552[_0x7413('0xcf')]=qs[_0x7413('0x59')](_[_0x7413('0xd0')](_0xa05eeb[_0x7413('0x43')],_0x32c013[_0x7413('0x59')]));if(_0xa05eeb[_0x7413('0x43')]['filter']){_0x519552[_0x7413('0xcf')]=_[_0x7413('0xd1')](_0x519552[_0x7413('0xcf')],{'$or':_[_0x7413('0x3e')](_0x519552[_0x7413('0x46')],function(_0x8259d){var _0x443536={};_0x443536[_0x8259d]={'$like':'%'+_0xa05eeb[_0x7413('0x43')][_0x7413('0x33')]+'%'};return _0x443536;})});}_0x519552=_[_0x7413('0xd1')]({},_0x519552,_0xa05eeb[_0x7413('0xd2')]);return _0x3413f4[_0x7413('0xdf')](_0x519552);}})[_0x7413('0x17')](function(_0x32f158){if(_0x32f158){_0x7354d=_0x32f158[_0x7413('0x4c')];if(!_0xa05eeb['query']['hasOwnProperty'](_0x7413('0xda'))){_0x519552[_0x7413('0x26')]=qs[_0x7413('0x26')](_0xa05eeb[_0x7413('0x43')][_0x7413('0x26')]);_0x519552[_0x7413('0x24')]=qs[_0x7413('0x24')](_0xa05eeb[_0x7413('0x43')][_0x7413('0x24')]);}return _0x3413f4[_0x7413('0xdf')](_0x519552);}})[_0x7413('0x17')](function(_0x204fad){if(_0x204fad){return _0x204fad?{'count':_0x7354d,'rows':_0x204fad}:null;}})[_0x7413('0x17')](respondWithResult(_0x22afdc,null))[_0x7413('0x65')](handleError(_0x22afdc,null));};exports[_0x7413('0xe0')]=function(_0x359415,_0x32eaf9){var _0x45d288={};var _0x41e791={};var _0x4e0f79;var _0x5227cc;return db[_0x7413('0x3c')][_0x7413('0x9a')]({'where':{'id':_0x359415[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x32eaf9,null))[_0x7413('0x17')](function(_0x314dd0){if(_0x314dd0){_0x4e0f79=_0x314dd0;_0x41e791[_0x7413('0x5b')]=_[_0x7413('0x58')](db[_0x7413('0xe1')][_0x7413('0x3d')]);_0x41e791[_0x7413('0x43')]=_[_0x7413('0x58')](_0x359415[_0x7413('0x43')]);_0x41e791[_0x7413('0x59')]=_[_0x7413('0x5a')](_0x41e791[_0x7413('0x5b')],_0x41e791[_0x7413('0x43')]);_0x45d288[_0x7413('0x46')]=_[_0x7413('0x5a')](_0x41e791[_0x7413('0x5b')],qs[_0x7413('0x5c')](_0x359415[_0x7413('0x43')][_0x7413('0x5c')]));_0x45d288['attributes']=_0x45d288[_0x7413('0x46')][_0x7413('0x4c')]?_0x45d288['attributes']:_0x41e791[_0x7413('0x5b')];_0x45d288[_0x7413('0xce')]=qs[_0x7413('0xdc')](_0x359415[_0x7413('0x43')][_0x7413('0xdc')]);_0x45d288['where']=qs['filters'](_[_0x7413('0xd0')](_0x359415['query'],_0x41e791[_0x7413('0x59')]));if(_0x359415[_0x7413('0x43')][_0x7413('0x33')]){_0x45d288['where']=_['merge'](_0x45d288[_0x7413('0xcf')],{'$or':_[_0x7413('0x3e')](_0x45d288[_0x7413('0x46')],function(_0x3af924){var _0x518cbd={};_0x518cbd[_0x3af924]={'$like':'%'+_0x359415['query'][_0x7413('0x33')]+'%'};return _0x518cbd;})});}_0x45d288=_[_0x7413('0xd1')]({},_0x45d288,_0x359415['options']);return _0x4e0f79['getGroups'](_0x45d288);}})[_0x7413('0x17')](function(_0x29132d){if(_0x29132d){_0x5227cc=_0x29132d['length'];if(!_0x359415['query'][_0x7413('0xd9')](_0x7413('0xda'))){_0x45d288[_0x7413('0x26')]=qs[_0x7413('0x26')](_0x359415[_0x7413('0x43')]['limit']);_0x45d288[_0x7413('0x24')]=qs[_0x7413('0x24')](_0x359415[_0x7413('0x43')][_0x7413('0x24')]);}return _0x4e0f79[_0x7413('0xe0')](_0x45d288);}})['then'](function(_0x45aee6){if(_0x45aee6){return _0x45aee6?{'count':_0x5227cc,'rows':_0x45aee6}:null;}})[_0x7413('0x17')](respondWithResult(_0x32eaf9,null))[_0x7413('0x65')](handleError(_0x32eaf9,null));};exports[_0x7413('0xe2')]=function(_0x5b5286,_0x5c3fc6){var _0x32a14b={'raw':!![],'where':{}};var _0x44aa62={};var _0x39f036={'count':0x0,'rows':[]};return db[_0x7413('0x3c')][_0x7413('0x9a')]({'where':{'id':_0x5b5286['params']['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x5c3fc6,null))['then'](function(_0x5c5437){if(_0x5c5437){_0x44aa62[_0x7413('0x5b')]=_['keys'](db[_0x7413('0xe3')][_0x7413('0x3d')]);_0x44aa62[_0x7413('0x43')]=_[_0x7413('0x58')](_0x5b5286[_0x7413('0x43')]);_0x44aa62['filters']=_[_0x7413('0x5a')](_0x44aa62[_0x7413('0x5b')],_0x44aa62[_0x7413('0x43')]);_0x32a14b[_0x7413('0x46')]=_['intersection'](_0x44aa62[_0x7413('0x5b')],qs[_0x7413('0x5c')](_0x5b5286[_0x7413('0x43')][_0x7413('0x5c')]));_0x32a14b[_0x7413('0x46')]=_0x32a14b[_0x7413('0x46')]['length']?_0x32a14b[_0x7413('0x46')]:_0x44aa62[_0x7413('0x5b')];if(!_0x5b5286[_0x7413('0x43')][_0x7413('0xd9')]('nolimit')){_0x32a14b[_0x7413('0x26')]=qs[_0x7413('0x26')](_0x5b5286[_0x7413('0x43')][_0x7413('0x26')]);_0x32a14b[_0x7413('0x24')]=qs[_0x7413('0x24')](_0x5b5286['query']['offset']);}_0x32a14b[_0x7413('0xce')]=qs['sort'](_0x5b5286[_0x7413('0x43')][_0x7413('0xdc')]);_0x32a14b['where']=qs[_0x7413('0x59')](_[_0x7413('0xd0')](_0x5b5286['query'],_0x44aa62[_0x7413('0x59')]));_0x32a14b[_0x7413('0xcf')][_0x7413('0xe4')]=_0x5c5437['id'];if(_0x5b5286['query'][_0x7413('0x33')]){_0x32a14b[_0x7413('0xcf')]=_[_0x7413('0xd1')](_0x32a14b[_0x7413('0xcf')],{'$or':_[_0x7413('0x3e')](_0x32a14b['attributes'],function(_0xc5372d){var _0x1a8e4e={};_0x1a8e4e[_0xc5372d]={'$like':'%'+_0x5b5286['query'][_0x7413('0x33')]+'%'};return _0x1a8e4e;})});}_0x32a14b=_['merge']({},_0x32a14b,_0x5b5286[_0x7413('0xd2')]);return db['VoiceRecording'][_0x7413('0x27')]({'where':_0x32a14b[_0x7413('0xcf')]})[_0x7413('0x17')](function(_0x26b141){_0x39f036['count']=_0x26b141;if(_0x5b5286[_0x7413('0x43')][_0x7413('0x44')]){_0x32a14b[_0x7413('0x45')]=[{'all':!![]}];}return db[_0x7413('0xe3')]['findAll'](_0x32a14b);})[_0x7413('0x17')](function(_0x398fc9){_0x39f036[_0x7413('0x49')]=_0x398fc9;return _0x39f036;});}})['then'](respondWithFilteredResult(_0x5c3fc6,_0x32a14b))[_0x7413('0x65')](handleError(_0x5c3fc6,null));};exports[_0x7413('0xe5')]=function(_0x4c076a,_0x5cedbd){var _0x2a865c={'raw':!![],'where':{}};var _0x3a9b8a={};var _0x3ad4a9={'count':0x0,'rows':[]};return db[_0x7413('0x3c')][_0x7413('0x9a')]({'where':{'id':_0x4c076a[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x5cedbd,null))[_0x7413('0x17')](function(_0x3cdbbd){if(_0x3cdbbd){_0x3a9b8a[_0x7413('0x5b')]=_[_0x7413('0x58')](db[_0x7413('0xe6')]['rawAttributes']);_0x3a9b8a[_0x7413('0x43')]=_[_0x7413('0x58')](_0x4c076a[_0x7413('0x43')]);_0x3a9b8a['filters']=_[_0x7413('0x5a')](_0x3a9b8a['model'],_0x3a9b8a[_0x7413('0x43')]);_0x2a865c[_0x7413('0x46')]=_[_0x7413('0x5a')](_0x3a9b8a['model'],qs[_0x7413('0x5c')](_0x4c076a[_0x7413('0x43')][_0x7413('0x5c')]));_0x2a865c[_0x7413('0x46')]=_0x2a865c['attributes'][_0x7413('0x4c')]?_0x2a865c['attributes']:_0x3a9b8a[_0x7413('0x5b')];if(!_0x4c076a[_0x7413('0x43')][_0x7413('0xd9')](_0x7413('0xda'))){_0x2a865c[_0x7413('0x26')]=qs[_0x7413('0x26')](_0x4c076a[_0x7413('0x43')]['limit']);_0x2a865c[_0x7413('0x24')]=qs[_0x7413('0x24')](_0x4c076a[_0x7413('0x43')][_0x7413('0x24')]);}_0x2a865c['order']=qs[_0x7413('0xdc')](_0x4c076a[_0x7413('0x43')][_0x7413('0xdc')]);_0x2a865c[_0x7413('0xcf')]=qs[_0x7413('0x59')](_['pick'](_0x4c076a[_0x7413('0x43')],_0x3a9b8a[_0x7413('0x59')]));_0x2a865c[_0x7413('0xcf')]['UserId']=_0x3cdbbd['id'];if(_0x4c076a['query'][_0x7413('0x33')]){_0x2a865c[_0x7413('0xcf')]=_[_0x7413('0xd1')](_0x2a865c['where'],{'$or':_[_0x7413('0x3e')](_0x2a865c[_0x7413('0x46')],function(_0x4c5e39){var _0x553aeb={};_0x553aeb[_0x4c5e39]={'$like':'%'+_0x4c076a['query'][_0x7413('0x33')]+'%'};return _0x553aeb;})});}_0x2a865c=_[_0x7413('0xd1')]({},_0x2a865c,_0x4c076a['options']);return db[_0x7413('0xe6')][_0x7413('0x27')]({'where':_0x2a865c[_0x7413('0xcf')]})[_0x7413('0x17')](function(_0x2bac37){_0x3ad4a9[_0x7413('0x27')]=_0x2bac37;if(_0x4c076a[_0x7413('0x43')]['includeAll']){_0x2a865c['include']=[{'all':!![]}];}return db[_0x7413('0xe6')][_0x7413('0x48')](_0x2a865c);})[_0x7413('0x17')](function(_0x224e99){_0x3ad4a9[_0x7413('0x49')]=_0x224e99;return _0x3ad4a9;});}})[_0x7413('0x17')](respondWithFilteredResult(_0x5cedbd,_0x2a865c))[_0x7413('0x65')](handleError(_0x5cedbd,null));};exports[_0x7413('0xe7')]=function(_0x59109c,_0x1dd0de){var _0x1d67b0={};var _0x424195={};var _0x463ab8;var _0x33ee15;return db[_0x7413('0x3c')][_0x7413('0x9a')]({'where':{'id':_0x59109c[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x1dd0de,null))['then'](function(_0x2ff0d6){if(_0x2ff0d6){_0x463ab8=_0x2ff0d6;_0x424195[_0x7413('0x5b')]=_['keys'](db[_0x7413('0xe8')]['rawAttributes']);_0x424195[_0x7413('0x43')]=_[_0x7413('0x58')](_0x59109c[_0x7413('0x43')]);_0x424195[_0x7413('0x59')]=_[_0x7413('0x5a')](_0x424195[_0x7413('0x5b')],_0x424195[_0x7413('0x43')]);_0x1d67b0[_0x7413('0x46')]=_['intersection'](_0x424195[_0x7413('0x5b')],qs[_0x7413('0x5c')](_0x59109c[_0x7413('0x43')][_0x7413('0x5c')]));_0x1d67b0['attributes']=_0x1d67b0[_0x7413('0x46')][_0x7413('0x4c')]?_0x1d67b0['attributes']:_0x424195[_0x7413('0x5b')];_0x1d67b0[_0x7413('0xce')]=qs[_0x7413('0xdc')](_0x59109c[_0x7413('0x43')][_0x7413('0xdc')]);_0x1d67b0['where']=qs[_0x7413('0x59')](_[_0x7413('0xd0')](_0x59109c[_0x7413('0x43')],_0x424195[_0x7413('0x59')]));if(_0x59109c[_0x7413('0x43')][_0x7413('0x33')]){_0x1d67b0[_0x7413('0xcf')]=_[_0x7413('0xd1')](_0x1d67b0[_0x7413('0xcf')],{'$or':_[_0x7413('0x3e')](_0x1d67b0[_0x7413('0x46')],function(_0x313bf4){var _0x38b8a6={};_0x38b8a6[_0x313bf4]={'$like':'%'+_0x59109c[_0x7413('0x43')][_0x7413('0x33')]+'%'};return _0x38b8a6;})});}_0x1d67b0=_[_0x7413('0xd1')]({},_0x1d67b0,_0x59109c[_0x7413('0xd2')]);return _0x463ab8[_0x7413('0xe7')](_0x1d67b0);}})['then'](function(_0x5a07e7){if(_0x5a07e7){_0x33ee15=_0x5a07e7[_0x7413('0x4c')];if(!_0x59109c[_0x7413('0x43')][_0x7413('0xd9')](_0x7413('0xda'))){_0x1d67b0[_0x7413('0x26')]=qs[_0x7413('0x26')](_0x59109c[_0x7413('0x43')][_0x7413('0x26')]);_0x1d67b0['offset']=qs['offset'](_0x59109c[_0x7413('0x43')][_0x7413('0x24')]);}return _0x463ab8['getChatInteractions'](_0x1d67b0);}})[_0x7413('0x17')](function(_0x524419){if(_0x524419){return _0x524419?{'count':_0x33ee15,'rows':_0x524419}:null;}})[_0x7413('0x17')](respondWithResult(_0x1dd0de,null))[_0x7413('0x65')](handleError(_0x1dd0de,null));};exports['getOpenchannelInteractions']=function(_0x1d101,_0x1457d2){var _0x575b53={};var _0x1a9542={};var _0x2194d0;var _0x822fe4;return db[_0x7413('0x3c')][_0x7413('0x9a')]({'where':{'id':_0x1d101['params']['id']}})['then'](handleEntityNotFound(_0x1457d2,null))[_0x7413('0x17')](function(_0xabd5df){if(_0xabd5df){_0x2194d0=_0xabd5df;_0x1a9542['model']=_[_0x7413('0x58')](db[_0x7413('0xe9')][_0x7413('0x3d')]);_0x1a9542['query']=_['keys'](_0x1d101[_0x7413('0x43')]);_0x1a9542[_0x7413('0x59')]=_[_0x7413('0x5a')](_0x1a9542[_0x7413('0x5b')],_0x1a9542['query']);_0x575b53['attributes']=_['intersection'](_0x1a9542['model'],qs['fields'](_0x1d101[_0x7413('0x43')]['fields']));_0x575b53['attributes']=_0x575b53[_0x7413('0x46')]['length']?_0x575b53[_0x7413('0x46')]:_0x1a9542[_0x7413('0x5b')];_0x575b53[_0x7413('0xce')]=qs[_0x7413('0xdc')](_0x1d101[_0x7413('0x43')]['sort']);_0x575b53[_0x7413('0xcf')]=qs[_0x7413('0x59')](_[_0x7413('0xd0')](_0x1d101[_0x7413('0x43')],_0x1a9542[_0x7413('0x59')]));if(_0x1d101[_0x7413('0x43')][_0x7413('0x33')]){_0x575b53['where']=_[_0x7413('0xd1')](_0x575b53[_0x7413('0xcf')],{'$or':_[_0x7413('0x3e')](_0x575b53[_0x7413('0x46')],function(_0x397f57){var _0x322552={};_0x322552[_0x397f57]={'$like':'%'+_0x1d101[_0x7413('0x43')][_0x7413('0x33')]+'%'};return _0x322552;})});}_0x575b53=_[_0x7413('0xd1')]({},_0x575b53,_0x1d101[_0x7413('0xd2')]);return _0x2194d0[_0x7413('0xea')](_0x575b53);}})['then'](function(_0x503cda){if(_0x503cda){_0x822fe4=_0x503cda[_0x7413('0x4c')];if(!_0x1d101[_0x7413('0x43')]['hasOwnProperty'](_0x7413('0xda'))){_0x575b53['limit']=qs[_0x7413('0x26')](_0x1d101[_0x7413('0x43')][_0x7413('0x26')]);_0x575b53[_0x7413('0x24')]=qs[_0x7413('0x24')](_0x1d101[_0x7413('0x43')]['offset']);}return _0x2194d0['getOpenchannelInteractions'](_0x575b53);}})[_0x7413('0x17')](function(_0x375e06){if(_0x375e06){return _0x375e06?{'count':_0x822fe4,'rows':_0x375e06}:null;}})[_0x7413('0x17')](respondWithResult(_0x1457d2,null))[_0x7413('0x65')](handleError(_0x1457d2,null));};exports[_0x7413('0xeb')]=function(_0x2304c9,_0x19c5ef){var _0xf61f3f={'raw':!![],'where':{}};var _0x28fd63={};var _0x5cd2b7={'count':0x0,'rows':[]};return db[_0x7413('0x3c')]['findOne']({'where':{'id':_0x2304c9[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x19c5ef,null))[_0x7413('0x17')](function(_0xa64332){if(_0xa64332){_0x28fd63[_0x7413('0x5b')]=_[_0x7413('0x58')](db['MailInteraction'][_0x7413('0x3d')]);_0x28fd63['query']=_[_0x7413('0x58')](_0x2304c9['query']);_0x28fd63['filters']=_[_0x7413('0x5a')](_0x28fd63[_0x7413('0x5b')],_0x28fd63[_0x7413('0x43')]);_0xf61f3f[_0x7413('0x46')]=_[_0x7413('0x5a')](_0x28fd63['model'],qs[_0x7413('0x5c')](_0x2304c9[_0x7413('0x43')][_0x7413('0x5c')]));_0xf61f3f[_0x7413('0x46')]=_0xf61f3f[_0x7413('0x46')][_0x7413('0x4c')]?_0xf61f3f[_0x7413('0x46')]:_0x28fd63['model'];if(!_0x2304c9['query'][_0x7413('0xd9')](_0x7413('0xda'))){_0xf61f3f[_0x7413('0x26')]=qs['limit'](_0x2304c9['query'][_0x7413('0x26')]);_0xf61f3f['offset']=qs['offset'](_0x2304c9[_0x7413('0x43')][_0x7413('0x24')]);}_0xf61f3f['order']=qs[_0x7413('0xdc')](_0x2304c9[_0x7413('0x43')]['sort']);_0xf61f3f[_0x7413('0xcf')]=qs['filters'](_[_0x7413('0xd0')](_0x2304c9[_0x7413('0x43')],_0x28fd63[_0x7413('0x59')]));_0xf61f3f[_0x7413('0xcf')]['UserId']=_0xa64332['id'];if(_0x2304c9[_0x7413('0x43')]['filter']){_0xf61f3f[_0x7413('0xcf')]=_['merge'](_0xf61f3f[_0x7413('0xcf')],{'$or':_['map'](_0xf61f3f['attributes'],function(_0x350ff6){var _0x23dab0={};_0x23dab0[_0x350ff6]={'$like':'%'+_0x2304c9[_0x7413('0x43')][_0x7413('0x33')]+'%'};return _0x23dab0;})});}_0xf61f3f=_['merge']({},_0xf61f3f,_0x2304c9[_0x7413('0xd2')]);return db[_0x7413('0xec')][_0x7413('0x27')]({'where':_0xf61f3f[_0x7413('0xcf')]})[_0x7413('0x17')](function(_0x331d5e){_0x5cd2b7[_0x7413('0x27')]=_0x331d5e;if(_0x2304c9[_0x7413('0x43')][_0x7413('0x44')]){_0xf61f3f[_0x7413('0x45')]=[{'all':!![]}];}return db['MailInteraction'][_0x7413('0x48')](_0xf61f3f);})['then'](function(_0x48b428){_0x5cd2b7[_0x7413('0x49')]=_0x48b428;return _0x5cd2b7;});}})[_0x7413('0x17')](respondWithFilteredResult(_0x19c5ef,_0xf61f3f))['catch'](handleError(_0x19c5ef,null));};exports[_0x7413('0xed')]=function(_0x48581c,_0x51c798){var _0x3c7135={};var _0x420c27={};var _0x2591f0;var _0x5f2216;return db['User'][_0x7413('0x9a')]({'where':{'id':_0x48581c[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x51c798,null))[_0x7413('0x17')](function(_0x6e9324){if(_0x6e9324){_0x2591f0=_0x6e9324;_0x420c27['model']=_[_0x7413('0x58')](db[_0x7413('0xee')]['rawAttributes']);_0x420c27['query']=_[_0x7413('0x58')](_0x48581c['query']);_0x420c27[_0x7413('0x59')]=_['intersection'](_0x420c27[_0x7413('0x5b')],_0x420c27[_0x7413('0x43')]);_0x3c7135['attributes']=_[_0x7413('0x5a')](_0x420c27[_0x7413('0x5b')],qs[_0x7413('0x5c')](_0x48581c[_0x7413('0x43')][_0x7413('0x5c')]));_0x3c7135[_0x7413('0x46')]=_0x3c7135[_0x7413('0x46')][_0x7413('0x4c')]?_0x3c7135[_0x7413('0x46')]:_0x420c27[_0x7413('0x5b')];_0x3c7135[_0x7413('0xce')]=qs[_0x7413('0xdc')](_0x48581c[_0x7413('0x43')]['sort']);_0x3c7135[_0x7413('0xcf')]=qs[_0x7413('0x59')](_[_0x7413('0xd0')](_0x48581c[_0x7413('0x43')],_0x420c27[_0x7413('0x59')]));if(_0x48581c[_0x7413('0x43')][_0x7413('0x33')]){_0x3c7135[_0x7413('0xcf')]=_[_0x7413('0xd1')](_0x3c7135['where'],{'$or':_[_0x7413('0x3e')](_0x3c7135[_0x7413('0x46')],function(_0x3ae3f8){var _0x1288cd={};_0x1288cd[_0x3ae3f8]={'$like':'%'+_0x48581c[_0x7413('0x43')][_0x7413('0x33')]+'%'};return _0x1288cd;})});}_0x3c7135=_[_0x7413('0xd1')]({},_0x3c7135,_0x48581c[_0x7413('0xd2')]);return _0x2591f0['getSmsInteractions'](_0x3c7135);}})[_0x7413('0x17')](function(_0x5d7e89){if(_0x5d7e89){_0x5f2216=_0x5d7e89[_0x7413('0x4c')];if(!_0x48581c[_0x7413('0x43')][_0x7413('0xd9')](_0x7413('0xda'))){_0x3c7135[_0x7413('0x26')]=qs[_0x7413('0x26')](_0x48581c[_0x7413('0x43')][_0x7413('0x26')]);_0x3c7135['offset']=qs['offset'](_0x48581c[_0x7413('0x43')][_0x7413('0x24')]);}return _0x2591f0[_0x7413('0xed')](_0x3c7135);}})['then'](function(_0x2dcf81){if(_0x2dcf81){return _0x2dcf81?{'count':_0x5f2216,'rows':_0x2dcf81}:null;}})[_0x7413('0x17')](respondWithResult(_0x51c798,null))[_0x7413('0x65')](handleError(_0x51c798,null));};exports[_0x7413('0xef')]=function(_0x5b660b,_0x25544a){var _0x1cbf8f={};var _0x2ce094={};var _0x882e4a;var _0x4bd57b;return db[_0x7413('0x3c')][_0x7413('0x9a')]({'where':{'id':_0x5b660b[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x25544a,null))[_0x7413('0x17')](function(_0x53ff44){if(_0x53ff44){_0x882e4a=_0x53ff44;_0x2ce094[_0x7413('0x5b')]=_[_0x7413('0x58')](db['FaxInteraction'][_0x7413('0x3d')]);_0x2ce094[_0x7413('0x43')]=_[_0x7413('0x58')](_0x5b660b[_0x7413('0x43')]);_0x2ce094[_0x7413('0x59')]=_[_0x7413('0x5a')](_0x2ce094[_0x7413('0x5b')],_0x2ce094[_0x7413('0x43')]);_0x1cbf8f[_0x7413('0x46')]=_['intersection'](_0x2ce094[_0x7413('0x5b')],qs[_0x7413('0x5c')](_0x5b660b[_0x7413('0x43')][_0x7413('0x5c')]));_0x1cbf8f[_0x7413('0x46')]=_0x1cbf8f[_0x7413('0x46')][_0x7413('0x4c')]?_0x1cbf8f[_0x7413('0x46')]:_0x2ce094['model'];_0x1cbf8f[_0x7413('0xce')]=qs[_0x7413('0xdc')](_0x5b660b[_0x7413('0x43')]['sort']);_0x1cbf8f['where']=qs[_0x7413('0x59')](_[_0x7413('0xd0')](_0x5b660b[_0x7413('0x43')],_0x2ce094['filters']));if(_0x5b660b[_0x7413('0x43')][_0x7413('0x33')]){_0x1cbf8f[_0x7413('0xcf')]=_['merge'](_0x1cbf8f['where'],{'$or':_['map'](_0x1cbf8f[_0x7413('0x46')],function(_0x17a953){var _0x35c5e0={};_0x35c5e0[_0x17a953]={'$like':'%'+_0x5b660b[_0x7413('0x43')]['filter']+'%'};return _0x35c5e0;})});}_0x1cbf8f=_['merge']({},_0x1cbf8f,_0x5b660b['options']);return _0x882e4a[_0x7413('0xef')](_0x1cbf8f);}})['then'](function(_0x551d4b){if(_0x551d4b){_0x4bd57b=_0x551d4b[_0x7413('0x4c')];if(!_0x5b660b[_0x7413('0x43')][_0x7413('0xd9')](_0x7413('0xda'))){_0x1cbf8f[_0x7413('0x26')]=qs[_0x7413('0x26')](_0x5b660b['query'][_0x7413('0x26')]);_0x1cbf8f[_0x7413('0x24')]=qs[_0x7413('0x24')](_0x5b660b['query']['offset']);}return _0x882e4a['getFaxInteractions'](_0x1cbf8f);}})['then'](function(_0x5e2586){if(_0x5e2586){return _0x5e2586?{'count':_0x4bd57b,'rows':_0x5e2586}:null;}})[_0x7413('0x17')](respondWithResult(_0x25544a,null))[_0x7413('0x65')](handleError(_0x25544a,null));};exports[_0x7413('0xf0')]=function(_0x20542a,_0x2714fd){var _0x93711={};var _0x123276={};var _0x4e0926;var _0x432c02;return db[_0x7413('0x3c')][_0x7413('0x9a')]({'where':{'id':_0x20542a[_0x7413('0x60')]['id']}})['then'](handleEntityNotFound(_0x2714fd,null))[_0x7413('0x17')](function(_0x3d5d60){if(_0x3d5d60){_0x4e0926=_0x3d5d60;_0x123276['model']=_[_0x7413('0x58')](db[_0x7413('0xf1')][_0x7413('0x3d')]);_0x123276[_0x7413('0x43')]=_[_0x7413('0x58')](_0x20542a[_0x7413('0x43')]);_0x123276['filters']=_[_0x7413('0x5a')](_0x123276[_0x7413('0x5b')],_0x123276[_0x7413('0x43')]);_0x93711[_0x7413('0x46')]=_['intersection'](_0x123276[_0x7413('0x5b')],qs['fields'](_0x20542a['query'][_0x7413('0x5c')]));_0x93711['attributes']=_0x93711['attributes'][_0x7413('0x4c')]?_0x93711[_0x7413('0x46')]:_0x123276[_0x7413('0x5b')];_0x93711[_0x7413('0xce')]=qs[_0x7413('0xdc')](_0x20542a[_0x7413('0x43')][_0x7413('0xdc')]);_0x93711[_0x7413('0xcf')]=qs[_0x7413('0x59')](_['pick'](_0x20542a[_0x7413('0x43')],_0x123276[_0x7413('0x59')]));if(_0x20542a[_0x7413('0x43')]['filter']){_0x93711[_0x7413('0xcf')]=_[_0x7413('0xd1')](_0x93711[_0x7413('0xcf')],{'$or':_[_0x7413('0x3e')](_0x93711[_0x7413('0x46')],function(_0x342905){var _0x668ea8={};_0x668ea8[_0x342905]={'$like':'%'+_0x20542a[_0x7413('0x43')][_0x7413('0x33')]+'%'};return _0x668ea8;})});}_0x93711=_[_0x7413('0xd1')]({},_0x93711,_0x20542a['options']);return _0x4e0926[_0x7413('0xf0')](_0x93711);}})[_0x7413('0x17')](function(_0x53f4d3){if(_0x53f4d3){_0x432c02=_0x53f4d3[_0x7413('0x4c')];if(!_0x20542a[_0x7413('0x43')][_0x7413('0xd9')]('nolimit')){_0x93711['limit']=qs[_0x7413('0x26')](_0x20542a[_0x7413('0x43')]['limit']);_0x93711['offset']=qs['offset'](_0x20542a['query']['offset']);}return _0x4e0926[_0x7413('0xf0')](_0x93711);}})[_0x7413('0x17')](function(_0x2564fa){if(_0x2564fa){return _0x2564fa?{'count':_0x432c02,'rows':_0x2564fa}:null;}})[_0x7413('0x17')](respondWithResult(_0x2714fd,null))[_0x7413('0x65')](handleError(_0x2714fd,null));};exports['login']=function(_0x268b37,_0x4a2bcd,_0x5896f5){var _0xe1abf5;var _0x9f576c;var _0x3b8278;var _0x1621e4=!_[_0x7413('0x6b')](_0x268b37[_0x7413('0x60')]['id'])?_0x268b37['params']['id']:!_[_0x7413('0x6b')](_0x268b37[_0x7413('0x2f')]['id'])?_0x268b37[_0x7413('0x2f')]['id']:null;return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x1621e4,'role':{'$or':[_0x7413('0x2d'),_0x7413('0x2f'),'agent']}},'attributes':['id','name',_0x7413('0xf2'),'mobile',_0x7413('0x2c'),_0x7413('0x66'),_0x7413('0xa2')]})[_0x7413('0x17')](function(_0x34fdb2){if(_0x34fdb2){if(_0x34fdb2['role']===_0x7413('0x74')){_0xe1abf5=_0x34fdb2;if(_0x268b37[_0x7413('0x5f')][_0x7413('0xa3')]){_0x3b8278=util['format'](_0x7413('0xf3'),_0xe1abf5[_0x268b37[_0x7413('0x5f')]['interface']]);}else if(_0x268b37['body'][_0x7413('0xf4')]){_0x3b8278=util[_0x7413('0xf5')](_0x7413('0xaf'),_0x268b37[_0x7413('0x5f')][_0x7413('0xf4')]);}else{_0x3b8278=util[_0x7413('0xf5')](_0x7413('0xaf'),_0xe1abf5[_0x7413('0x37')]);}socket['to'](util['format'](_0x7413('0xf6'),_0xe1abf5[_0x7413('0x37')]))[_0x7413('0xb5')](_0x7413('0xf7'),{'user':{'id':_0xe1abf5['id'],'name':_0xe1abf5[_0x7413('0x37')]},'ip':_0x268b37[_0x7413('0xf8')][_0x7413('0xf9')]||_0x268b37['connection'][_0x7413('0xfa')]||_0x268b37[_0x7413('0xfb')][_0x7413('0xfa')]||_0x268b37[_0x7413('0xfc')][_0x7413('0xfb')][_0x7413('0xfa')]});return db[_0x7413('0xfd')]['destroy']({'where':{'membername':_0xe1abf5[_0x7413('0x37')]},'individualHooks':!![]});}}else{throw new db[(_0x7413('0x96'))][(_0x7413('0x93'))](_0x7413('0xfe'));}})[_0x7413('0x17')](function(){if(_0xe1abf5){return _0xe1abf5[_0x7413('0xff')]({'raw':!![]});}})[_0x7413('0x17')](function(_0x1e8e1a){if(_0xe1abf5){var _0x59236b=[];if(_0x1e8e1a){_0x9f576c=_0x1e8e1a;if(_0x9f576c['length']){for(var _0x30296b=0x0;_0x30296b<_0x9f576c['length'];_0x30296b++){_0x59236b[_0x7413('0x47')]({'membername':_0xe1abf5[_0x7413('0x37')],'UserId':_0xe1abf5['id'],'queue_name':_0x9f576c[_0x30296b]['name'],'VoiceQueueId':_0x9f576c[_0x30296b]['id'],'interface':_0x3b8278,'paused':_0xe1abf5['loginInPause']||![],'penalty':_0x9f576c[_0x30296b]['UserVoiceQueue.penalty']||0x0});}return BPromise['each'](_0x59236b,function(_0x32f29b){return db[_0x7413('0xfd')]['upsert'](_0x32f29b);});}}}})[_0x7413('0x17')](function(){if(_0xe1abf5){return db['MemberReport'][_0x7413('0x48')]({'where':{'membername':_0xe1abf5['name'],'exitAt':null}});}})[_0x7413('0x17')](function(_0x325759){if(_0xe1abf5){var _0x2691a5=[];_0x325759[_0x7413('0x100')](function(_0x1a274){_0x2691a5[_0x7413('0x47')](_0x1a274[_0x7413('0x5e')]({'exitAt':moment()[_0x7413('0xf5')](_0x7413('0x101'))}));});return BPromise['all'](_0x2691a5);}})[_0x7413('0x17')](function(){if(_0xe1abf5){var _0x2103cb=[];var _0x4355a5=[];var _0x452a94=utils[_0x7413('0x102')]();var _0x1da3da={'membername':_0xe1abf5[_0x7413('0x37')],'interface':_0x3b8278,'enterAt':moment()[_0x7413('0xf5')](_0x7413('0x101')),'role':_0xe1abf5[_0x7413('0x2c')],'internal':_0xe1abf5[_0x7413('0x66')]};_0x452a94[_0x7413('0x100')](function(_0x4c8893){_0x2103cb['push'](_[_0x7413('0xd1')]({'channel':_0x4c8893,'type':_0x7413('0x103'),'data1':_0x268b37['body'][_0x7413('0x104')],'data2':_0x3b8278},_0x1da3da));if(_0xe1abf5['loginInPause']){_0x4355a5[_0x7413('0x47')](_[_0x7413('0xd1')]({'channel':_0x4c8893,'type':_0x7413('0x105'),'data1':_0x7413('0x106')},_0x1da3da));}});return db[_0x7413('0x107')][_0x7413('0x8c')](_0x2103cb['concat'](_0x4355a5),{'individualHooks':!![]});}})[_0x7413('0x17')](function(){if(_0xe1abf5){return _0xe1abf5['update']({'online':!![],'lastLoginAt':moment()[_0x7413('0xf5')](_0x7413('0x101')),'voicePause':_0xe1abf5[_0x7413('0xa2')]||![],'mailPause':_0xe1abf5['loginInPause']||![],'chatPause':_0xe1abf5[_0x7413('0xa2')]||![],'faxPause':_0xe1abf5[_0x7413('0xa2')]||![],'smsPause':_0xe1abf5[_0x7413('0xa2')]||![],'openchannelPause':_0xe1abf5[_0x7413('0xa2')]||![],'whatsappPause':_0xe1abf5[_0x7413('0xa2')]||![],'pauseType':_0xe1abf5['loginInPause']?_0x7413('0x106'):null,'interface':_0x3b8278,'lastPauseAt':moment()[_0x7413('0xf5')](_0x7413('0x101'))});}})[_0x7413('0x17')](function(_0x3aa688){if(_0x268b37[_0x7413('0x108')]){return _0x5896f5();}else{return BPromise[_0x7413('0x109')](_0x3aa688)[_0x7413('0x17')](respondWithResult(_0x4a2bcd,null));}})[_0x7413('0x65')](handleError(_0x4a2bcd,null));};exports['logout']=function(_0x33d60e,_0x3e68e6){var _0x5d1b12;return db['User'][_0x7413('0x5d')]({'where':{'id':_0x33d60e[_0x7413('0x60')]['id'],'role':'agent'},'attributes':['id',_0x7413('0x37'),'role']})[_0x7413('0x17')](handleEntityNotFound(_0x3e68e6,null))[_0x7413('0x17')](function(_0x402d4d){if(_0x402d4d){_0x5d1b12=_0x402d4d;return db[_0x7413('0xfd')][_0x7413('0x2a')]({'where':{'membername':_0x5d1b12['name']},'individualHooks':!![]});}})[_0x7413('0x17')](function(){return db[_0x7413('0x107')][_0x7413('0x48')]({'where':{'membername':_0x5d1b12[_0x7413('0x37')],'exitAt':null}});})[_0x7413('0x17')](function(_0x40aea9){var _0xad24f4=[];_0x40aea9[_0x7413('0x100')](function(_0x43addd){_0xad24f4[_0x7413('0x47')](_0x43addd['update']({'exitAt':moment()[_0x7413('0xf5')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x7413('0x54')](_0xad24f4);})[_0x7413('0x17')](function(){return _0x5d1b12['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x7413('0x17')](respondWithResult(_0x3e68e6,null))['catch'](handleError(_0x3e68e6,null));};exports[_0x7413('0x10a')]=function(_0x2c770b,_0x34f84e){var _0xa06a24;return db[_0x7413('0xfd')]['update']({'paused':0x1},{'where':{'UserId':_0x2c770b[_0x7413('0x60')]['id']},'individualHooks':!![]})[_0x7413('0x17')](function(){return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x2c770b[_0x7413('0x60')]['id'],'role':'agent'},'attributes':['id',_0x7413('0x37'),_0x7413('0x2c'),'internal',_0x7413('0xa3')]});})[_0x7413('0x17')](handleEntityNotFound(_0x34f84e,null))[_0x7413('0x17')](function(_0x3abe14){if(_0x3abe14){_0xa06a24=_0x3abe14;return respondWithRpcPromise('QueuePause',_0x7413('0x10a'),{'id':_0xa06a24['id'],'name':_0xa06a24[_0x7413('0x37')],'pause':!![]});}})[_0x7413('0x17')](function(){if(_0xa06a24){return db[_0x7413('0x107')][_0x7413('0x48')]({'where':{'membername':_0xa06a24[_0x7413('0x37')],'type':_0x7413('0x105'),'exitAt':null}});}})[_0x7413('0x17')](function(_0x307687){if(_0x307687['length']){var _0x50fd03=moment()['format'](_0x7413('0x101'));for(var _0x120eef=0x0,_0x1920d2=_0x307687[_0x7413('0x4c')];_0x120eef<_0x1920d2;_0x120eef++){_0x307687[_0x120eef][_0x7413('0x10b')]({'exitAt':_0x50fd03});}}})[_0x7413('0x17')](function(){var _0x4542a2=[];var _0x561726=utils[_0x7413('0x102')]();_0x561726['forEach'](function(_0x580e3a){_0x4542a2[_0x7413('0x47')]({'channel':_0x580e3a,'membername':_0xa06a24[_0x7413('0x37')],'interface':_['isNil'](_0xa06a24[_0x7413('0xa3')])?util['format'](_0x7413('0xaf'),_0xa06a24[_0x7413('0x37')]):_0xa06a24[_0x7413('0xa3')],'type':_0x7413('0x105'),'enterAt':moment()[_0x7413('0xf5')](_0x7413('0x101')),'data1':_0x2c770b[_0x7413('0x5f')]['type']||_0x7413('0x10c'),'role':_0xa06a24['role'],'internal':_0xa06a24[_0x7413('0x66')]});});return db[_0x7413('0x107')]['bulkCreate'](_0x4542a2,{'individualHooks':!![]});})['then'](function(){return _0xa06a24[_0x7413('0x5e')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x2c770b[_0x7413('0x5f')][_0x7413('0x40')]||_0x7413('0x10c'),'lastPauseAt':moment()[_0x7413('0xf5')](_0x7413('0x101'))});})['then'](respondWithResult(_0x34f84e,null))['catch'](handleError(_0x34f84e,null));};exports[_0x7413('0x10d')]=function(_0x1f6755,_0x2fb541){var _0x5a7ceb;return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x1f6755['params']['id']},'attributes':['id',_0x7413('0x37'),'role',_0x7413('0xb0'),_0x7413('0x10e'),'chatPause',_0x7413('0x10f'),_0x7413('0x110'),_0x7413('0x111'),'whatsapppause',_0x7413('0x112'),'lastPauseAt']})[_0x7413('0x17')](handleEntityNotFound(_0x2fb541,null))[_0x7413('0x17')](function(_0x2467cc){if(_0x2467cc){_0x5a7ceb=_0x2467cc;if(_0x1f6755[_0x7413('0x5f')]['channel']&&!utils['isValidChannel'](_0x1f6755[_0x7413('0x5f')][_0x7413('0xa0')])){throw new db['Sequelize']['ValidationError'](_0x7413('0xb1'));}switch(_0x1f6755['body'][_0x7413('0xa0')]){case _0x7413('0xad'):return respondWithRpcPromise('QueuePause',_0x7413('0x10d'),{'id':_0x5a7ceb['id'],'name':_0x5a7ceb[_0x7413('0x37')],'pause':![]})['then'](function(){return db[_0x7413('0xfd')]['update']({'paused':0x0},{'where':{'UserId':_0x5a7ceb['id']},'individualHooks':!![]});})[_0x7413('0x17')](function(){return db[_0x7413('0x107')][_0x7413('0x5d')]({'where':{'channel':_0x1f6755[_0x7413('0x5f')][_0x7413('0xa0')],'membername':_0x5a7ceb[_0x7413('0x37')],'type':_0x7413('0x105'),'exitAt':null}});})['then'](function(_0x1017c8){if(_0x1017c8){return _0x1017c8[_0x7413('0x5e')]({'exitAt':moment()[_0x7413('0xf5')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0x7413('0x17')](function(){return _0x5a7ceb['update']({'voicePause':![]});});case'mail':case _0x7413('0x4d'):case _0x7413('0x50'):case _0x7413('0x4f'):case'whatsapp':case _0x7413('0x52'):return db[_0x7413('0x107')][_0x7413('0x5d')]({'where':{'channel':_0x1f6755[_0x7413('0x5f')]['channel'],'membername':_0x5a7ceb[_0x7413('0x37')],'type':_0x7413('0x105'),'exitAt':null}})[_0x7413('0x17')](function(_0x2bdea2){if(_0x2bdea2){return _0x2bdea2[_0x7413('0x5e')]({'exitAt':moment()[_0x7413('0xf5')](_0x7413('0x101')),'data2':_0x7413('0x113')},{'individualHooks':!![]});}return null;})[_0x7413('0x17')](function(){var _0x437a50={};_['set'](_0x437a50,util['format']('%s%s',_0x1f6755[_0x7413('0x5f')][_0x7413('0xa0')],_0x7413('0x114')),![]);return _0x5a7ceb[_0x7413('0x5e')](_0x437a50);});default:return respondWithRpcPromise('QueuePause',_0x7413('0x10d'),{'id':_0x5a7ceb['id'],'name':_0x5a7ceb[_0x7413('0x37')],'pause':![]})[_0x7413('0x17')](function(){return db[_0x7413('0xfd')]['update']({'paused':0x0},{'where':{'UserId':_0x5a7ceb['id']}});})[_0x7413('0x17')](function(){return db[_0x7413('0x107')][_0x7413('0x48')]({'where':{'membername':_0x5a7ceb['name'],'type':'PAUSE','exitAt':null}});})['then'](function(_0x263653){var _0x41c6bd=[];_0x263653[_0x7413('0x100')](function(_0x4e05c6){_0x41c6bd[_0x7413('0x47')](_0x4e05c6[_0x7413('0x5e')]({'exitAt':moment()[_0x7413('0xf5')](_0x7413('0x101')),'data2':_0x7413('0x113')}));});return BPromise[_0x7413('0x54')](_0x41c6bd);})['then'](function(){return _0x5a7ceb[_0x7413('0x5e')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})['then'](respondWithResult(_0x2fb541,null))[_0x7413('0x65')](handleError(_0x2fb541,null));};exports[_0x7413('0x115')]=function(_0x3d9890,_0x9617a0){var _0x5cfca2={};var _0x286789={};var _0x167259;var _0x471cbe;return db['User'][_0x7413('0x9a')]({'where':{'id':_0x3d9890[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x9617a0,null))[_0x7413('0x17')](function(_0x5f0c9f){if(_0x5f0c9f){_0x167259=_0x5f0c9f;_0x286789[_0x7413('0x5b')]=_['keys'](db[_0x7413('0x116')][_0x7413('0x3d')]);_0x286789[_0x7413('0x43')]=_[_0x7413('0x58')](_0x3d9890[_0x7413('0x43')]);_0x286789[_0x7413('0x59')]=_[_0x7413('0x5a')](_0x286789[_0x7413('0x5b')],_0x286789[_0x7413('0x43')]);_0x5cfca2['attributes']=_[_0x7413('0x5a')](_0x286789[_0x7413('0x5b')],qs[_0x7413('0x5c')](_0x3d9890[_0x7413('0x43')][_0x7413('0x5c')]));_0x5cfca2[_0x7413('0x46')]=_0x5cfca2[_0x7413('0x46')][_0x7413('0x4c')]?_0x5cfca2[_0x7413('0x46')]:_0x286789[_0x7413('0x5b')];_0x5cfca2['order']=qs[_0x7413('0xdc')](_0x3d9890[_0x7413('0x43')][_0x7413('0xdc')]);_0x5cfca2['where']=qs[_0x7413('0x59')](_[_0x7413('0xd0')](_0x3d9890['query'],_0x286789['filters']));if(_0x3d9890[_0x7413('0x43')][_0x7413('0x33')]){_0x5cfca2['where']=_[_0x7413('0xd1')](_0x5cfca2[_0x7413('0xcf')],{'$or':_[_0x7413('0x3e')](_0x5cfca2[_0x7413('0x46')],function(_0x200acc){var _0x3247d9={};_0x3247d9[_0x200acc]={'$like':'%'+_0x3d9890[_0x7413('0x43')][_0x7413('0x33')]+'%'};return _0x3247d9;})});}_0x5cfca2=_['merge']({},_0x5cfca2,_0x3d9890[_0x7413('0xd2')]);return _0x167259[_0x7413('0x115')](_0x5cfca2);}})[_0x7413('0x17')](function(_0x39ac2d){if(_0x39ac2d){_0x471cbe=_0x39ac2d[_0x7413('0x4c')];if(!_0x3d9890['query'][_0x7413('0xd9')](_0x7413('0xda'))){_0x5cfca2[_0x7413('0x26')]=qs['limit'](_0x3d9890['query'][_0x7413('0x26')]);_0x5cfca2[_0x7413('0x24')]=qs['offset'](_0x3d9890[_0x7413('0x43')][_0x7413('0x24')]);}return _0x167259[_0x7413('0x115')](_0x5cfca2);}})[_0x7413('0x17')](function(_0x52b9f4){if(_0x52b9f4){return _0x52b9f4?{'count':_0x471cbe,'rows':_0x52b9f4}:null;}})[_0x7413('0x17')](respondWithResult(_0x9617a0,null))['catch'](handleError(_0x9617a0,null));};exports[_0x7413('0x117')]=function(_0x125b03,_0x252790){return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x125b03[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x252790,null))['then'](function(_0x11870a){if(_0x11870a){var _0x3c8961=_0x11870a[_0x7413('0x2b')]({'plain':!![]});return _0x11870a[_0x7413('0x117')](_0x125b03[_0x7413('0x5f')][_0x7413('0x63')],_[_0x7413('0x64')](_0x125b03[_0x7413('0x5f')],['ids','id'])||{})[_0x7413('0x17')](function(){for(var _0x5c96d6=0x0;_0x5c96d6<_0x125b03['body'][_0x7413('0x63')][_0x7413('0x4c')];_0x5c96d6++){var _0x3f094c=[];var _0x4c58c4={};db[_0x7413('0x116')][_0x7413('0x9a')]({'where':{'id':_0x125b03[_0x7413('0x5f')]['ids'][_0x5c96d6]}})[_0x7413('0x17')](function(_0x47a5bb){_0x4c58c4=_0x47a5bb['dataValues'];_0x3f094c[_0x7413('0x47')](_0x47a5bb[_0x7413('0xff')]()[_0x7413('0x17')](function(_0x3ca653){for(var _0x1d266d=0x0;_0x1d266d<_0x3ca653[_0x7413('0x4c')];_0x1d266d++){_0x3ca653[_0x1d266d][_0x7413('0x118')](_0x7413('0xa0'),'Voice');}return _0x3ca653;}));_0x3f094c[_0x7413('0x47')](_0x47a5bb[_0x7413('0x119')]()[_0x7413('0x17')](function(_0x316f09){for(var _0x109a26=0x0;_0x109a26<_0x316f09['length'];_0x109a26++){_0x316f09[_0x109a26][_0x7413('0x118')](_0x7413('0xa0'),_0x7413('0x11a'));}return _0x316f09;}));_0x3f094c['push'](_0x47a5bb[_0x7413('0x11b')]()['then'](function(_0x29d96b){for(var _0x1e3b87=0x0;_0x1e3b87<_0x29d96b['length'];_0x1e3b87++){_0x29d96b[_0x1e3b87]['setDataValue'](_0x7413('0xa0'),_0x7413('0x11c'));}return _0x29d96b;}));_0x3f094c[_0x7413('0x47')](_0x47a5bb[_0x7413('0x11d')]()['then'](function(_0x128c3f){for(var _0x57bfc8=0x0;_0x57bfc8<_0x128c3f['length'];_0x57bfc8++){_0x128c3f[_0x57bfc8][_0x7413('0x118')]('channel',_0x7413('0x11e'));}return _0x128c3f;}));_0x3f094c['push'](_0x47a5bb[_0x7413('0x11f')]()[_0x7413('0x17')](function(_0x156cbf){for(var _0x30c3a9=0x0;_0x30c3a9<_0x156cbf[_0x7413('0x4c')];_0x30c3a9++){_0x156cbf[_0x30c3a9][_0x7413('0x118')]('channel','Whatsapp');}return _0x156cbf;}));_0x3f094c[_0x7413('0x47')](_0x47a5bb[_0x7413('0x120')]()['then'](function(_0x289f58){for(var _0x162873=0x0;_0x162873<_0x289f58['length'];_0x162873++){_0x289f58[_0x162873][_0x7413('0x118')](_0x7413('0xa0'),_0x7413('0x121'));}return _0x289f58;}));_0x3f094c[_0x7413('0x47')](_0x47a5bb[_0x7413('0x122')]()['then'](function(_0x21023a){for(var _0x6f7b2b=0x0;_0x6f7b2b<_0x21023a['length'];_0x6f7b2b++){_0x21023a[_0x6f7b2b][_0x7413('0x118')](_0x7413('0xa0'),_0x7413('0x123'));}return _0x21023a;}));return BPromise[_0x7413('0x54')](_0x3f094c);})[_0x7413('0x17')](function(_0x5d7e45){var _0x50f244=_[_0x7413('0x124')](_0x5d7e45);_0x3f094c=[];return db[_0x7413('0x6d')][_0x7413('0x125')](function(_0x4c39dc){for(var _0x3aa24f=0x0;_0x3aa24f<_0x50f244['length'];_0x3aa24f++){_0x3f094c[_0x7413('0x47')](_0x50f244[_0x3aa24f]['addAgent'](_0x3c8961['id']),{'transaction':_0x4c39dc});}return BPromise[_0x7413('0x54')](_0x3f094c)[_0x7413('0x17')](function(){if(_0x3c8961[_0x7413('0xa1')]){return BPromise['each'](_[_0x7413('0x33')](_0x50f244,function(_0x4c9ba3){return _0x4c9ba3[_0x7413('0x126')](_0x7413('0xa0'))==='Voice';}),function(_0x1d62e5){return db[_0x7413('0xfd')][_0x7413('0x127')]({'membername':_0x3c8961[_0x7413('0x37')],'UserId':_0x3c8961['id'],'queue_name':_0x1d62e5[_0x7413('0x37')],'VoiceQueueId':_0x1d62e5['id'],'interface':_[_0x7413('0x6b')](_0x3c8961['interface'])?util['format'](_0x7413('0xaf'),_0x3c8961[_0x7413('0x37')]):_0x3c8961[_0x7413('0xa3')],'paused':_0x3c8961['voicePause']||![],'penalty':_0x3c8961[_0x7413('0xa9')]},{'transaction':_0x4c39dc});});}else{return;}})['then'](function(){for(var _0x3af571=0x0;_0x3af571<_0x50f244['length'];_0x3af571++){var _0x2bd54b=_0x50f244[_0x3af571]['getDataValue'](_0x7413('0xa0'));var _0x2abed9=_0x2bd54b+'QueueId';socket[_0x7413('0xb5')](_0x7413('0x2f')+_0x2bd54b+_0x7413('0xac'),{'UserId':_0x3c8961['id'],['queueField']:_0x50f244[_0x3af571]['id']});}});});})[_0x7413('0x17')](function(){db[_0x7413('0x128')][_0x7413('0x9a')]({'where':{'teamId':_0x4c58c4['id']}})[_0x7413('0x17')](function(_0x5ebb9a){if(_0x5ebb9a){db[_0x7413('0x129')][_0x7413('0x8a')]({'UserId':_0x125b03['params']['id'],'VoicePrefixId':_0x5ebb9a[_0x7413('0x12a')]});}});});}});}})[_0x7413('0x17')](respondWithStatusCode(_0x252790,null))[_0x7413('0x65')](handleError(_0x252790,null));};exports[_0x7413('0x12b')]=function(_0x10b4bf,_0x22a6a4){return db[_0x7413('0x3c')][_0x7413('0x9a')]({'where':{'id':_0x10b4bf[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x22a6a4,null))[_0x7413('0x17')](function(_0x573003){if(_0x573003){var _0x573dda=_0x573003['get']({'plain':!![]});var _0x5a7ebf=_0x10b4bf['query']['ids'];return _0x573003[_0x7413('0x12b')](_0x5a7ebf)[_0x7413('0x17')](function(){for(var _0x5b6774=0x0;_0x5b6774<_0x5a7ebf['length'];_0x5b6774++){var _0x30313a=[];var _0x9e2591={};db['Team']['findOne']({'where':{'id':_0x5a7ebf[_0x5b6774]}})[_0x7413('0x17')](function(_0x1094a2){_0x9e2591=_0x1094a2[_0x7413('0x4e')];_0x30313a[_0x7413('0x47')](_0x1094a2[_0x7413('0xff')]()[_0x7413('0x17')](function(_0x5a948b){for(var _0x24f842=0x0;_0x24f842<_0x5a948b[_0x7413('0x4c')];_0x24f842++){_0x5a948b[_0x24f842]['setDataValue']('channel',_0x7413('0x12c'));}return _0x5a948b;}));_0x30313a[_0x7413('0x47')](_0x1094a2[_0x7413('0x119')]()[_0x7413('0x17')](function(_0x31fd4b){for(var _0x2530bb=0x0;_0x2530bb<_0x31fd4b[_0x7413('0x4c')];_0x2530bb++){_0x31fd4b[_0x2530bb]['setDataValue'](_0x7413('0xa0'),_0x7413('0x11a'));}return _0x31fd4b;}));_0x30313a[_0x7413('0x47')](_0x1094a2['getMailQueues']()['then'](function(_0x359c12){for(var _0xc65250=0x0;_0xc65250<_0x359c12[_0x7413('0x4c')];_0xc65250++){_0x359c12[_0xc65250]['setDataValue'](_0x7413('0xa0'),_0x7413('0x11c'));}return _0x359c12;}));_0x30313a[_0x7413('0x47')](_0x1094a2[_0x7413('0x11d')]()[_0x7413('0x17')](function(_0x54867c){for(var _0x5a521c=0x0;_0x5a521c<_0x54867c[_0x7413('0x4c')];_0x5a521c++){_0x54867c[_0x5a521c]['setDataValue'](_0x7413('0xa0'),_0x7413('0x11e'));}return _0x54867c;}));_0x30313a['push'](_0x1094a2[_0x7413('0x11f')]()[_0x7413('0x17')](function(_0xea16a5){for(var _0x3f9d49=0x0;_0x3f9d49<_0xea16a5[_0x7413('0x4c')];_0x3f9d49++){_0xea16a5[_0x3f9d49][_0x7413('0x118')]('channel',_0x7413('0x12d'));}return _0xea16a5;}));_0x30313a[_0x7413('0x47')](_0x1094a2['getFaxQueues']()[_0x7413('0x17')](function(_0x406f5c){for(var _0x2e59bf=0x0;_0x2e59bf<_0x406f5c[_0x7413('0x4c')];_0x2e59bf++){_0x406f5c[_0x2e59bf][_0x7413('0x118')](_0x7413('0xa0'),_0x7413('0x121'));}return _0x406f5c;}));_0x30313a[_0x7413('0x47')](_0x1094a2[_0x7413('0x122')]()[_0x7413('0x17')](function(_0x2eaf0c){for(var _0x359fe2=0x0;_0x359fe2<_0x2eaf0c[_0x7413('0x4c')];_0x359fe2++){_0x2eaf0c[_0x359fe2][_0x7413('0x118')](_0x7413('0xa0'),_0x7413('0x123'));}return _0x2eaf0c;}));return BPromise[_0x7413('0x54')](_0x30313a);})[_0x7413('0x17')](function(_0x77c730){var _0x1446e2=_[_0x7413('0x124')](_0x77c730);_0x30313a=[];return db['sequelize'][_0x7413('0x125')](function(_0x477740){for(var _0x55f70e=0x0;_0x55f70e<_0x1446e2[_0x7413('0x4c')];_0x55f70e++){_0x30313a[_0x7413('0x47')](_0x1446e2[_0x55f70e][_0x7413('0x12e')](_0x573dda['id']),{'transaction':_0x477740});}return BPromise['all'](_0x30313a)[_0x7413('0x17')](function(){if(_0x573dda[_0x7413('0xa1')]){return BPromise[_0x7413('0x8f')](_[_0x7413('0x33')](_0x1446e2,function(_0x37407b){return _0x37407b[_0x7413('0x126')](_0x7413('0xa0'))===_0x7413('0x12c');}),function(_0x3dbc2f){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x3dbc2f['id'],'UserId':_0x573dda['id']},'transaction':_0x477740});});}else{return;}})[_0x7413('0x17')](function(){db[_0x7413('0x128')][_0x7413('0x9a')]({'where':{'teamId':_0x9e2591['id']}})[_0x7413('0x17')](function(_0x235e37){if(_0x235e37){return db[_0x7413('0x129')][_0x7413('0x2a')]({'where':{'UserId':_0x573dda['id'],'VoicePrefixId':_0x235e37[_0x7413('0x4e')]['VoicePrefixId']}});}});})[_0x7413('0x17')](function(){for(var _0x3f058b=0x0;_0x3f058b<_0x1446e2[_0x7413('0x4c')];_0x3f058b++){var _0x556bd2=_0x1446e2[_0x3f058b][_0x7413('0x126')](_0x7413('0xa0'));var _0x32afe8=_0x556bd2+_0x7413('0xab');socket['emit']('user'+_0x556bd2+_0x7413('0xb4'),{'UserId':_0x573dda['id'],['queueField']:_0x1446e2[_0x3f058b]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x22a6a4,null))['catch'](handleError(_0x22a6a4,null));};exports['getLists']=function(_0x41e5e3,_0x45f7cf){var _0x44a71f={};var _0x19ae3b={};var _0x3f8887;var _0x3e2ce6;return db[_0x7413('0x3c')][_0x7413('0x9a')]({'where':{'id':_0x41e5e3['params']['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x45f7cf,null))[_0x7413('0x17')](function(_0x19b5a7){if(_0x19b5a7){_0x3f8887=_0x19b5a7;_0x19ae3b[_0x7413('0x5b')]=_[_0x7413('0x58')](db[_0x7413('0xd3')][_0x7413('0x3d')]);_0x19ae3b[_0x7413('0x43')]=_[_0x7413('0x58')](_0x41e5e3[_0x7413('0x43')]);_0x19ae3b[_0x7413('0x59')]=_[_0x7413('0x5a')](_0x19ae3b[_0x7413('0x5b')],_0x19ae3b['query']);_0x44a71f['attributes']=_[_0x7413('0x5a')](_0x19ae3b[_0x7413('0x5b')],qs[_0x7413('0x5c')](_0x41e5e3[_0x7413('0x43')][_0x7413('0x5c')]));_0x44a71f['attributes']=_0x44a71f[_0x7413('0x46')][_0x7413('0x4c')]?_0x44a71f[_0x7413('0x46')]:_0x19ae3b['model'];_0x44a71f[_0x7413('0xce')]=qs['sort'](_0x41e5e3['query'][_0x7413('0xdc')]);_0x44a71f[_0x7413('0xcf')]=qs[_0x7413('0x59')](_[_0x7413('0xd0')](_0x41e5e3[_0x7413('0x43')],_0x19ae3b['filters']));if(_0x41e5e3[_0x7413('0x43')]['filter']){_0x44a71f['where']=_['merge'](_0x44a71f[_0x7413('0xcf')],{'$or':_[_0x7413('0x3e')](_0x44a71f[_0x7413('0x46')],function(_0x430b63){var _0x5f2e2e={};_0x5f2e2e[_0x430b63]={'$like':'%'+_0x41e5e3[_0x7413('0x43')][_0x7413('0x33')]+'%'};return _0x5f2e2e;})});}_0x44a71f=_[_0x7413('0xd1')]({},_0x44a71f,_0x41e5e3[_0x7413('0xd2')]);return _0x3f8887['getLists'](_0x44a71f);}})[_0x7413('0x17')](function(_0x53cb3d){if(_0x53cb3d){_0x3e2ce6=_0x53cb3d['length'];if(!_0x41e5e3['query'][_0x7413('0xd9')](_0x7413('0xda'))){_0x44a71f[_0x7413('0x26')]=qs[_0x7413('0x26')](_0x41e5e3[_0x7413('0x43')][_0x7413('0x26')]);_0x44a71f[_0x7413('0x24')]=qs[_0x7413('0x24')](_0x41e5e3[_0x7413('0x43')][_0x7413('0x24')]);}return _0x3f8887[_0x7413('0x12f')](_0x44a71f);}})[_0x7413('0x17')](function(_0x1ad09e){if(_0x1ad09e){return _0x1ad09e?{'count':_0x3e2ce6,'rows':_0x1ad09e}:null;}})['then'](respondWithResult(_0x45f7cf,null))[_0x7413('0x65')](handleError(_0x45f7cf,null));};exports[_0x7413('0x130')]=function(_0x5b2e42,_0x139eca){var _0xe736f1={};var _0x2f3129={};var _0x401ded;var _0x51888d;return db['User'][_0x7413('0x9a')]({'where':{'id':_0x5b2e42[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x139eca,null))[_0x7413('0x17')](function(_0xdac2dd){if(_0xdac2dd){_0x401ded=_0xdac2dd;_0x2f3129[_0x7413('0x5b')]=_[_0x7413('0x58')](db[_0x7413('0x3c')][_0x7413('0x3d')]);_0x2f3129[_0x7413('0x43')]=_[_0x7413('0x58')](_0x5b2e42[_0x7413('0x43')]);_0x2f3129['filters']=_['intersection'](_0x2f3129[_0x7413('0x5b')],_0x2f3129['query']);_0xe736f1[_0x7413('0x46')]=_[_0x7413('0x5a')](_0x2f3129[_0x7413('0x5b')],qs[_0x7413('0x5c')](_0x5b2e42[_0x7413('0x43')][_0x7413('0x5c')]));_0xe736f1[_0x7413('0x46')]=_0xe736f1[_0x7413('0x46')][_0x7413('0x4c')]?_0xe736f1[_0x7413('0x46')]:_0x2f3129[_0x7413('0x5b')];_0xe736f1[_0x7413('0xce')]=qs['sort'](_0x5b2e42[_0x7413('0x43')][_0x7413('0xdc')]);_0xe736f1[_0x7413('0xcf')]=qs[_0x7413('0x59')](_[_0x7413('0xd0')](_0x5b2e42[_0x7413('0x43')],_0x2f3129['filters']));if(_0x5b2e42['query'][_0x7413('0x33')]){_0xe736f1[_0x7413('0xcf')]=_[_0x7413('0xd1')](_0xe736f1[_0x7413('0xcf')],{'$or':_['map'](_0xe736f1['attributes'],function(_0x4be5ad){var _0xde2163={};_0xde2163[_0x4be5ad]={'$like':'%'+_0x5b2e42[_0x7413('0x43')]['filter']+'%'};return _0xde2163;})});}_0xe736f1[_0x7413('0x5b')]=db[_0x7413('0x3c')];_0xe736f1['as']=_0x7413('0x30');_0xe736f1=_[_0x7413('0xd1')]({},_0xe736f1,_0x5b2e42[_0x7413('0xd2')]);return _0x401ded['getVoiceQueues']({'include':[_0xe736f1]});}})[_0x7413('0x17')](function(_0x524eec){if(_0x524eec){var _0x19608a={},_0x56c624=[],_0x44c349=0x0;for(var _0x1f744c=0x0;_0x1f744c<_0x524eec[_0x7413('0x4c')];_0x1f744c+=0x1){for(var _0x55d033=0x0,_0x3df180;_0x55d033<_0x524eec[_0x1f744c][_0x7413('0x30')]['length'];_0x55d033+=0x1){_0x3df180=_0x524eec[_0x1f744c][_0x7413('0x30')][_0x55d033]['get']({'plain':!![]});_0x19608a[_0x3df180['id']]=_0x3df180;}}_0x19608a=_[_0x7413('0x131')](_0x19608a);for(var _0x226d97=qs[_0x7413('0x24')](_0x5b2e42[_0x7413('0x43')][_0x7413('0x24')]);_0x226d97<_0x19608a[_0x7413('0x4c')]&&_0x56c624['length']<qs[_0x7413('0x26')](_0x5b2e42[_0x7413('0x43')]['limit']);_0x226d97+=0x1){if(_0x19608a[_0x226d97]){_0x56c624[_0x7413('0x47')](_0x19608a[_0x226d97]);}}return{'count':_0x19608a['length'],'rows':_0x56c624};}})[_0x7413('0x17')](respondWithResult(_0x139eca,null))[_0x7413('0x65')](handleError(_0x139eca,null));};exports['destroy']=function(_0x5f31aa,_0x1aa948){if(_0x5f31aa['user']['id']==_0x5f31aa['params']['id']){return _0x1aa948[_0x7413('0x22')](0x1f4)['send']({'message':_0x7413('0x132')});}return db['User'][_0x7413('0x5d')]({'where':{'id':_0x5f31aa[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x1aa948,null))['then'](removeEntity(_0x1aa948,null))[_0x7413('0x65')](handleError(_0x1aa948,null));};exports['addChatInteractions']=function(_0xd690bf,_0x41d0b6){return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0xd690bf[_0x7413('0x60')]['id']}})['then'](handleEntityNotFound(_0x41d0b6,null))[_0x7413('0x17')](function(_0x307844){if(_0x307844){return _0x307844[_0x7413('0x133')](_0xd690bf[_0x7413('0x5f')][_0x7413('0x63')],_[_0x7413('0x64')](_0xd690bf[_0x7413('0x5f')],[_0x7413('0x63'),'id'])||{})[_0x7413('0xaa')](function(){for(var _0x25ff0d=0x0;_0x25ff0d<_0xd690bf[_0x7413('0x5f')][_0x7413('0x63')]['length'];_0x25ff0d+=0x1){socket[_0x7413('0xb5')](_0x7413('0x134'),{'ChatInteractionId':Number(_0xd690bf[_0x7413('0x5f')][_0x7413('0x63')][_0x25ff0d]),'UserId':Number(_0xd690bf[_0x7413('0x60')]['id'])});}return _0xd690bf[_0x7413('0x5f')][_0x7413('0x63')];});}})[_0x7413('0x17')](respondWithResult(_0x41d0b6,null))[_0x7413('0x65')](handleError(_0x41d0b6,null));};exports[_0x7413('0x135')]=function(_0x1de6e5,_0x31305d){return db[_0x7413('0x3c')]['find']({'where':{'id':_0x1de6e5[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x31305d,null))[_0x7413('0x17')](function(_0x4dd46e){if(_0x4dd46e){return _0x4dd46e[_0x7413('0x135')](_0x1de6e5[_0x7413('0x43')][_0x7413('0x63')])[_0x7413('0x17')](function(){if(_['isArray'](_0x1de6e5['query'][_0x7413('0x63')])){for(var _0x134a3d=0x0;_0x134a3d<_0x1de6e5[_0x7413('0x43')]['ids'][_0x7413('0x4c')];_0x134a3d+=0x1){socket['emit'](_0x7413('0x136'),{'ChatInteractionId':Number(_0x1de6e5['query'][_0x7413('0x63')][_0x134a3d]),'UserId':Number(_0x1de6e5[_0x7413('0x60')]['id'])});}}else{socket[_0x7413('0xb5')](_0x7413('0x136'),{'ChatInteractionId':Number(_0x1de6e5[_0x7413('0x43')]['ids']),'UserId':Number(_0x1de6e5['params']['id'])});}});}})[_0x7413('0x17')](respondWithStatusCode(_0x31305d,null))[_0x7413('0x65')](handleError(_0x31305d,null));};exports[_0x7413('0x137')]=function(_0x1294db,_0x4d2fac){return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x1294db[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x4d2fac,null))[_0x7413('0x17')](function(_0x3ae2be){if(_0x3ae2be){return _0x3ae2be[_0x7413('0x137')](_0x1294db[_0x7413('0x5f')][_0x7413('0x63')],_[_0x7413('0x64')](_0x1294db[_0x7413('0x5f')],[_0x7413('0x63'),'id'])||{})['spread'](function(){for(var _0x6f513f=0x0;_0x6f513f<_0x1294db[_0x7413('0x5f')]['ids'][_0x7413('0x4c')];_0x6f513f+=0x1){socket[_0x7413('0xb5')](_0x7413('0x138'),{'MailInteractionId':Number(_0x1294db[_0x7413('0x5f')][_0x7413('0x63')][_0x6f513f]),'UserId':Number(_0x1294db[_0x7413('0x60')]['id'])});}return _0x1294db[_0x7413('0x5f')][_0x7413('0x63')];});}})['then'](respondWithResult(_0x4d2fac,null))[_0x7413('0x65')](handleError(_0x4d2fac,null));};exports[_0x7413('0x139')]=function(_0x3f9003,_0x26a667){return db[_0x7413('0x3c')]['find']({'where':{'id':_0x3f9003['params']['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x26a667,null))['then'](function(_0x262eb6){if(_0x262eb6){return _0x262eb6[_0x7413('0x139')](_0x3f9003[_0x7413('0x43')][_0x7413('0x63')])[_0x7413('0x17')](function(){if(_[_0x7413('0xb3')](_0x3f9003['query']['ids'])){for(var _0x570003=0x0;_0x570003<_0x3f9003[_0x7413('0x43')][_0x7413('0x63')][_0x7413('0x4c')];_0x570003+=0x1){socket[_0x7413('0xb5')](_0x7413('0x13a'),{'MailInteractionId':Number(_0x3f9003[_0x7413('0x43')][_0x7413('0x63')][_0x570003]),'UserId':Number(_0x3f9003['params']['id'])});}}else{socket[_0x7413('0xb5')](_0x7413('0x13a'),{'MailInteractionId':Number(_0x3f9003[_0x7413('0x43')][_0x7413('0x63')]),'UserId':Number(_0x3f9003[_0x7413('0x60')]['id'])});}});}})[_0x7413('0x17')](respondWithStatusCode(_0x26a667,null))['catch'](handleError(_0x26a667,null));};exports[_0x7413('0x13b')]=function(_0x5b9801,_0x31fb80){return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x5b9801[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x31fb80,null))['then'](function(_0x52d7c3){if(_0x52d7c3){return _0x52d7c3[_0x7413('0x13b')](_0x5b9801[_0x7413('0x5f')][_0x7413('0x63')],_[_0x7413('0x64')](_0x5b9801['body'],[_0x7413('0x63'),'id'])||{})[_0x7413('0xaa')](function(){for(var _0xb2ecb2=0x0;_0xb2ecb2<_0x5b9801[_0x7413('0x5f')][_0x7413('0x63')][_0x7413('0x4c')];_0xb2ecb2+=0x1){socket[_0x7413('0xb5')](_0x7413('0x13c'),{'FaxInteractionId':Number(_0x5b9801[_0x7413('0x5f')][_0x7413('0x63')][_0xb2ecb2]),'UserId':Number(_0x5b9801[_0x7413('0x60')]['id'])});}return _0x5b9801[_0x7413('0x5f')][_0x7413('0x63')];});}})[_0x7413('0x17')](respondWithResult(_0x31fb80,null))[_0x7413('0x65')](handleError(_0x31fb80,null));};exports[_0x7413('0x13d')]=function(_0x5e09e6,_0x4c38b6){return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x5e09e6[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x4c38b6,null))[_0x7413('0x17')](function(_0x34d3f4){if(_0x34d3f4){return _0x34d3f4[_0x7413('0x13d')](_0x5e09e6[_0x7413('0x43')][_0x7413('0x63')])[_0x7413('0x17')](function(){if(_['isArray'](_0x5e09e6[_0x7413('0x43')]['ids'])){for(var _0x2beaaf=0x0;_0x2beaaf<_0x5e09e6['query'][_0x7413('0x63')][_0x7413('0x4c')];_0x2beaaf+=0x1){socket[_0x7413('0xb5')](_0x7413('0x13e'),{'FaxInteractionId':Number(_0x5e09e6[_0x7413('0x43')][_0x7413('0x63')][_0x2beaaf]),'UserId':Number(_0x5e09e6[_0x7413('0x60')]['id'])});}}else{socket['emit'](_0x7413('0x13e'),{'FaxInteractionId':Number(_0x5e09e6[_0x7413('0x43')]['ids']),'UserId':Number(_0x5e09e6['params']['id'])});}});}})[_0x7413('0x17')](respondWithStatusCode(_0x4c38b6,null))[_0x7413('0x65')](handleError(_0x4c38b6,null));};exports[_0x7413('0x13f')]=function(_0x522712,_0x5f5564){return db['User'][_0x7413('0x5d')]({'where':{'id':_0x522712[_0x7413('0x60')]['id']}})['then'](handleEntityNotFound(_0x5f5564,null))[_0x7413('0x17')](function(_0x3ef827){if(_0x3ef827){return _0x3ef827[_0x7413('0x13f')](_0x522712['body'][_0x7413('0x63')],_['omit'](_0x522712[_0x7413('0x5f')],['ids','id'])||{})[_0x7413('0xaa')](function(){for(var _0x7e19c8=0x0;_0x7e19c8<_0x522712['body'][_0x7413('0x63')][_0x7413('0x4c')];_0x7e19c8+=0x1){socket[_0x7413('0xb5')](_0x7413('0x140'),{'SmsInteractionId':Number(_0x522712['body'][_0x7413('0x63')][_0x7e19c8]),'UserId':Number(_0x522712[_0x7413('0x60')]['id'])});}return _0x522712[_0x7413('0x5f')][_0x7413('0x63')];});}})['then'](respondWithResult(_0x5f5564,null))[_0x7413('0x65')](handleError(_0x5f5564,null));};exports['removeSmsInteractions']=function(_0x1f5387,_0x88de78){return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x1f5387[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x88de78,null))[_0x7413('0x17')](function(_0x562849){if(_0x562849){return _0x562849[_0x7413('0x141')](_0x1f5387['query'][_0x7413('0x63')])[_0x7413('0x17')](function(){if(_[_0x7413('0xb3')](_0x1f5387[_0x7413('0x43')][_0x7413('0x63')])){for(var _0x5bc90c=0x0;_0x5bc90c<_0x1f5387['query'][_0x7413('0x63')][_0x7413('0x4c')];_0x5bc90c+=0x1){socket[_0x7413('0xb5')](_0x7413('0x142'),{'SmsInteractionId':Number(_0x1f5387[_0x7413('0x43')]['ids'][_0x5bc90c]),'UserId':Number(_0x1f5387['params']['id'])});}}else{socket['emit'](_0x7413('0x142'),{'SmsInteractionId':Number(_0x1f5387[_0x7413('0x43')][_0x7413('0x63')]),'UserId':Number(_0x1f5387[_0x7413('0x60')]['id'])});}});}})[_0x7413('0x17')](respondWithStatusCode(_0x88de78,null))[_0x7413('0x65')](handleError(_0x88de78,null));};exports[_0x7413('0x143')]=function(_0x5ec0b1,_0x250096){return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x5ec0b1['params']['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x250096,null))[_0x7413('0x17')](function(_0x14f1e5){if(_0x14f1e5){return _0x14f1e5[_0x7413('0x143')](_0x5ec0b1['body'][_0x7413('0x63')],_['omit'](_0x5ec0b1[_0x7413('0x5f')],['ids','id'])||{})[_0x7413('0xaa')](function(){for(var _0x2cd1f7=0x0;_0x2cd1f7<_0x5ec0b1[_0x7413('0x5f')][_0x7413('0x63')][_0x7413('0x4c')];_0x2cd1f7+=0x1){socket[_0x7413('0xb5')](_0x7413('0x144'),{'OpenchannelInteractionId':Number(_0x5ec0b1[_0x7413('0x5f')][_0x7413('0x63')][_0x2cd1f7]),'UserId':Number(_0x5ec0b1['params']['id'])});}return _0x5ec0b1['body'][_0x7413('0x63')];});}})[_0x7413('0x17')](respondWithResult(_0x250096,null))['catch'](handleError(_0x250096,null));};exports['removeOpenchannelInteractions']=function(_0xa4d97f,_0xf323ea){return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0xa4d97f[_0x7413('0x60')]['id']}})['then'](handleEntityNotFound(_0xf323ea,null))[_0x7413('0x17')](function(_0x5002d8){if(_0x5002d8){return _0x5002d8['removeOpenchannelInteractions'](_0xa4d97f[_0x7413('0x43')]['ids'])[_0x7413('0x17')](function(){if(_[_0x7413('0xb3')](_0xa4d97f['query'][_0x7413('0x63')])){for(var _0x1f8ce4=0x0;_0x1f8ce4<_0xa4d97f[_0x7413('0x43')]['ids']['length'];_0x1f8ce4+=0x1){socket['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0xa4d97f[_0x7413('0x43')][_0x7413('0x63')][_0x1f8ce4]),'UserId':Number(_0xa4d97f['params']['id'])});}}else{socket[_0x7413('0xb5')](_0x7413('0x145'),{'OpenchannelInteractionId':Number(_0xa4d97f['query'][_0x7413('0x63')]),'UserId':Number(_0xa4d97f[_0x7413('0x60')]['id'])});}});}})[_0x7413('0x17')](respondWithStatusCode(_0xf323ea,null))[_0x7413('0x65')](handleError(_0xf323ea,null));};exports[_0x7413('0x146')]=function(_0x4e3007,_0x271a53){return db['User'][_0x7413('0x5d')]({'where':{'id':_0x4e3007[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x271a53,null))['then'](function(_0x925024){if(_0x925024){return _0x925024['addWhatsappInteractions'](_0x4e3007[_0x7413('0x5f')][_0x7413('0x63')],_[_0x7413('0x64')](_0x4e3007[_0x7413('0x5f')],[_0x7413('0x63'),'id'])||{})['spread'](function(){for(var _0x3fbc77=0x0;_0x3fbc77<_0x4e3007[_0x7413('0x5f')][_0x7413('0x63')]['length'];_0x3fbc77+=0x1){socket[_0x7413('0xb5')](_0x7413('0x147'),{'WhatsappInteractionId':Number(_0x4e3007[_0x7413('0x5f')][_0x7413('0x63')][_0x3fbc77]),'UserId':Number(_0x4e3007[_0x7413('0x60')]['id'])});}return _0x4e3007[_0x7413('0x5f')][_0x7413('0x63')];});}})[_0x7413('0x17')](respondWithResult(_0x271a53,null))[_0x7413('0x65')](handleError(_0x271a53,null));};exports[_0x7413('0x148')]=function(_0x4dccee,_0x283c11){return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x4dccee['params']['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x283c11,null))[_0x7413('0x17')](function(_0xe582bd){if(_0xe582bd){return _0xe582bd[_0x7413('0x148')](_0x4dccee[_0x7413('0x43')][_0x7413('0x63')]);}})[_0x7413('0x17')](respondWithStatusCode(_0x283c11,null))['catch'](handleError(_0x283c11,null));};exports[_0x7413('0x149')]=function(_0x5b5f5f,_0x10ee66){var _0x195434={};var _0x431315={};var _0x2726c;var _0x59dc1a;return db['User'][_0x7413('0x9a')]({'where':{'id':_0x5b5f5f[_0x7413('0x60')]['id']}})['then'](handleEntityNotFound(_0x10ee66,null))['then'](function(_0x487213){if(_0x487213){_0x2726c=_0x487213;_0x431315[_0x7413('0x5b')]=_[_0x7413('0x58')](db[_0x7413('0x14a')][_0x7413('0x3d')]);_0x431315['query']=_['keys'](_0x5b5f5f[_0x7413('0x43')]);_0x431315[_0x7413('0x59')]=_['intersection'](_0x431315['model'],_0x431315[_0x7413('0x43')]);_0x195434[_0x7413('0x46')]=_[_0x7413('0x5a')](_0x431315[_0x7413('0x5b')],qs['fields'](_0x5b5f5f[_0x7413('0x43')][_0x7413('0x5c')]));_0x195434['attributes']=_0x195434[_0x7413('0x46')][_0x7413('0x4c')]?_0x195434[_0x7413('0x46')]:_0x431315['model'];_0x195434[_0x7413('0xce')]=qs[_0x7413('0xdc')](_0x5b5f5f[_0x7413('0x43')][_0x7413('0xdc')]);_0x195434[_0x7413('0xcf')]=qs['filters'](_[_0x7413('0xd0')](_0x5b5f5f[_0x7413('0x43')],_0x431315[_0x7413('0x59')]));if(_0x5b5f5f[_0x7413('0x43')][_0x7413('0x33')]){_0x195434['where']=_['merge'](_0x195434['where'],{'$or':_[_0x7413('0x3e')](_0x195434['attributes'],function(_0x5dd93c){var _0x566b29={};_0x566b29[_0x5dd93c]={'$like':'%'+_0x5b5f5f['query'][_0x7413('0x33')]+'%'};return _0x566b29;})});}_0x195434=_[_0x7413('0xd1')]({},_0x195434,_0x5b5f5f[_0x7413('0xd2')]);return _0x2726c[_0x7413('0x149')](_0x195434);}})['then'](function(_0x29ea83){if(_0x29ea83){_0x59dc1a=_0x29ea83[_0x7413('0x4c')];if(!_0x5b5f5f[_0x7413('0x43')]['hasOwnProperty'](_0x7413('0xda'))){_0x195434[_0x7413('0x26')]=qs['limit'](_0x5b5f5f['query'][_0x7413('0x26')]);_0x195434['offset']=qs[_0x7413('0x24')](_0x5b5f5f[_0x7413('0x43')]['offset']);}return _0x2726c[_0x7413('0x149')](_0x195434);}})['then'](function(_0x11bde8){if(_0x11bde8){return _0x11bde8?{'count':_0x59dc1a,'rows':_0x11bde8}:null;}})[_0x7413('0x17')](respondWithResult(_0x10ee66,null))[_0x7413('0x65')](handleError(_0x10ee66,null));};exports[_0x7413('0x14b')]=function(_0x12c0be,_0x3b084a){var _0x32d134={};var _0x120c7d={};var _0x213c4a;var _0x444e74;return db['User'][_0x7413('0x9a')]({'where':{'id':_0x12c0be['params']['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x3b084a,null))[_0x7413('0x17')](function(_0x9f5e94){if(_0x9f5e94){_0x213c4a=_0x9f5e94;_0x120c7d[_0x7413('0x5b')]=_[_0x7413('0x58')](db[_0x7413('0x14c')][_0x7413('0x3d')]);_0x120c7d[_0x7413('0x43')]=_[_0x7413('0x58')](_0x12c0be[_0x7413('0x43')]);_0x120c7d[_0x7413('0x59')]=_[_0x7413('0x5a')](_0x120c7d[_0x7413('0x5b')],_0x120c7d[_0x7413('0x43')]);_0x32d134[_0x7413('0x46')]=_['intersection'](_0x120c7d[_0x7413('0x5b')],qs[_0x7413('0x5c')](_0x12c0be[_0x7413('0x43')][_0x7413('0x5c')]));_0x32d134['attributes']=_0x32d134[_0x7413('0x46')][_0x7413('0x4c')]?_0x32d134[_0x7413('0x46')]:_0x120c7d[_0x7413('0x5b')];_0x32d134[_0x7413('0xce')]=qs[_0x7413('0xdc')](_0x12c0be['query']['sort']);_0x32d134[_0x7413('0xcf')]=qs['filters'](_[_0x7413('0xd0')](_0x12c0be['query'],_0x120c7d[_0x7413('0x59')]));if(_0x12c0be[_0x7413('0x43')][_0x7413('0x33')]){_0x32d134[_0x7413('0xcf')]=_[_0x7413('0xd1')](_0x32d134[_0x7413('0xcf')],{'$or':_[_0x7413('0x3e')](_0x32d134[_0x7413('0x46')],function(_0x3f9405){var _0x2f4dd1={};_0x2f4dd1[_0x3f9405]={'$like':'%'+_0x12c0be[_0x7413('0x43')][_0x7413('0x33')]+'%'};return _0x2f4dd1;})});}_0x32d134=_[_0x7413('0xd1')]({},_0x32d134,_0x12c0be[_0x7413('0xd2')]);return _0x213c4a[_0x7413('0x14b')](_0x32d134);}})['then'](function(_0x34e271){if(_0x34e271){_0x444e74=_0x34e271[_0x7413('0x4c')];if(!_0x12c0be[_0x7413('0x43')]['hasOwnProperty'](_0x7413('0xda'))){_0x32d134['limit']=qs[_0x7413('0x26')](_0x12c0be[_0x7413('0x43')][_0x7413('0x26')]);_0x32d134['offset']=qs[_0x7413('0x24')](_0x12c0be[_0x7413('0x43')]['offset']);}return _0x213c4a[_0x7413('0x14b')](_0x32d134);}})[_0x7413('0x17')](function(_0x1f8d4d){if(_0x1f8d4d){return _0x1f8d4d?{'count':_0x444e74,'rows':_0x1f8d4d}:null;}})[_0x7413('0x17')](respondWithResult(_0x3b084a,null))[_0x7413('0x65')](handleError(_0x3b084a,null));};exports['addFaxAccounts']=function(_0x22cd35,_0x1cd437){return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x22cd35['params']['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x1cd437,null))[_0x7413('0x17')](function(_0x35c3f8){if(_0x35c3f8){return _0x35c3f8[_0x7413('0x14d')](_0x22cd35[_0x7413('0x5f')]['ids'],_[_0x7413('0x64')](_0x22cd35[_0x7413('0x5f')],['ids','id'])||{});}})['then'](respondWithResult(_0x1cd437,null))[_0x7413('0x65')](handleError(_0x1cd437,null));};exports[_0x7413('0x14e')]=function(_0x15b34d,_0x4e21fe){return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x15b34d[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x4e21fe,null))[_0x7413('0x17')](function(_0x1e66f2){if(_0x1e66f2){return _0x1e66f2[_0x7413('0x14e')](_0x15b34d['query'][_0x7413('0x63')]);}})['then'](respondWithStatusCode(_0x4e21fe,null))[_0x7413('0x65')](handleError(_0x4e21fe,null));};exports[_0x7413('0x14f')]=function(_0x10faab,_0x3f8172){var _0x54c693={};var _0x2b698c={};var _0xd7442b;var _0x2153c1;return db['User']['findOne']({'where':{'id':_0x10faab[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x3f8172,null))['then'](function(_0x20189e){if(_0x20189e){_0xd7442b=_0x20189e;_0x2b698c['model']=_['keys'](db[_0x7413('0x150')][_0x7413('0x3d')]);_0x2b698c[_0x7413('0x43')]=_[_0x7413('0x58')](_0x10faab[_0x7413('0x43')]);_0x2b698c[_0x7413('0x59')]=_[_0x7413('0x5a')](_0x2b698c[_0x7413('0x5b')],_0x2b698c[_0x7413('0x43')]);_0x54c693[_0x7413('0x46')]=_['intersection'](_0x2b698c['model'],qs['fields'](_0x10faab[_0x7413('0x43')][_0x7413('0x5c')]));_0x54c693[_0x7413('0x46')]=_0x54c693[_0x7413('0x46')][_0x7413('0x4c')]?_0x54c693[_0x7413('0x46')]:_0x2b698c[_0x7413('0x5b')];_0x54c693[_0x7413('0xce')]=qs[_0x7413('0xdc')](_0x10faab[_0x7413('0x43')][_0x7413('0xdc')]);_0x54c693[_0x7413('0xcf')]=qs[_0x7413('0x59')](_[_0x7413('0xd0')](_0x10faab['query'],_0x2b698c['filters']));if(_0x10faab[_0x7413('0x43')][_0x7413('0x33')]){_0x54c693[_0x7413('0xcf')]=_['merge'](_0x54c693[_0x7413('0xcf')],{'$or':_[_0x7413('0x3e')](_0x54c693[_0x7413('0x46')],function(_0x4c027){var _0x181af7={};_0x181af7[_0x4c027]={'$like':'%'+_0x10faab[_0x7413('0x43')]['filter']+'%'};return _0x181af7;})});}_0x54c693=_['merge']({},_0x54c693,_0x10faab[_0x7413('0xd2')]);return _0xd7442b['getMailAccounts'](_0x54c693);}})[_0x7413('0x17')](function(_0x274340){if(_0x274340){_0x2153c1=_0x274340[_0x7413('0x4c')];if(!_0x10faab[_0x7413('0x43')][_0x7413('0xd9')]('nolimit')){_0x54c693['limit']=qs[_0x7413('0x26')](_0x10faab[_0x7413('0x43')][_0x7413('0x26')]);_0x54c693['offset']=qs[_0x7413('0x24')](_0x10faab[_0x7413('0x43')]['offset']);}return _0xd7442b[_0x7413('0x14f')](_0x54c693);}})[_0x7413('0x17')](function(_0x1a4388){if(_0x1a4388){return _0x1a4388?{'count':_0x2153c1,'rows':_0x1a4388}:null;}})[_0x7413('0x17')](respondWithResult(_0x3f8172,null))[_0x7413('0x65')](handleError(_0x3f8172,null));};exports['addMailAccounts']=function(_0x5af9c5,_0x3177cb){return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x5af9c5['params']['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x3177cb,null))[_0x7413('0x17')](function(_0xa036e6){if(_0xa036e6){return _0xa036e6[_0x7413('0x151')](_0x5af9c5[_0x7413('0x5f')]['ids'],_[_0x7413('0x64')](_0x5af9c5[_0x7413('0x5f')],['ids','id'])||{});}})[_0x7413('0x17')](respondWithResult(_0x3177cb,null))[_0x7413('0x65')](handleError(_0x3177cb,null));};exports[_0x7413('0x152')]=function(_0x5a9885,_0x2ff31d){return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x5a9885[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x2ff31d,null))[_0x7413('0x17')](function(_0x248a8b){if(_0x248a8b){return _0x248a8b[_0x7413('0x152')](_0x5a9885[_0x7413('0x43')][_0x7413('0x63')]);}})[_0x7413('0x17')](respondWithStatusCode(_0x2ff31d,null))[_0x7413('0x65')](handleError(_0x2ff31d,null));};exports[_0x7413('0x153')]=function(_0x52ee27,_0x426e75){var _0x2702ec={};var _0x476e1b={};var _0x302221;var _0x238ee5;return db[_0x7413('0x3c')][_0x7413('0x9a')]({'where':{'id':_0x52ee27[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x426e75,null))[_0x7413('0x17')](function(_0x106e40){if(_0x106e40){_0x302221=_0x106e40;_0x476e1b[_0x7413('0x5b')]=_['keys'](db[_0x7413('0x154')][_0x7413('0x3d')]);_0x476e1b[_0x7413('0x43')]=_['keys'](_0x52ee27[_0x7413('0x43')]);_0x476e1b[_0x7413('0x59')]=_[_0x7413('0x5a')](_0x476e1b[_0x7413('0x5b')],_0x476e1b[_0x7413('0x43')]);_0x2702ec[_0x7413('0x46')]=_[_0x7413('0x5a')](_0x476e1b[_0x7413('0x5b')],qs[_0x7413('0x5c')](_0x52ee27[_0x7413('0x43')][_0x7413('0x5c')]));_0x2702ec[_0x7413('0x46')]=_0x2702ec[_0x7413('0x46')]['length']?_0x2702ec[_0x7413('0x46')]:_0x476e1b[_0x7413('0x5b')];_0x2702ec[_0x7413('0xce')]=qs[_0x7413('0xdc')](_0x52ee27[_0x7413('0x43')]['sort']);_0x2702ec[_0x7413('0xcf')]=qs[_0x7413('0x59')](_[_0x7413('0xd0')](_0x52ee27[_0x7413('0x43')],_0x476e1b[_0x7413('0x59')]));if(_0x52ee27[_0x7413('0x43')][_0x7413('0x33')]){_0x2702ec['where']=_[_0x7413('0xd1')](_0x2702ec[_0x7413('0xcf')],{'$or':_[_0x7413('0x3e')](_0x2702ec[_0x7413('0x46')],function(_0x78531f){var _0x2bcc26={};_0x2bcc26[_0x78531f]={'$like':'%'+_0x52ee27['query']['filter']+'%'};return _0x2bcc26;})});}_0x2702ec=_['merge']({},_0x2702ec,_0x52ee27[_0x7413('0xd2')]);return _0x302221[_0x7413('0x153')](_0x2702ec);}})[_0x7413('0x17')](function(_0x4d1a9a){if(_0x4d1a9a){_0x238ee5=_0x4d1a9a[_0x7413('0x4c')];if(!_0x52ee27[_0x7413('0x43')][_0x7413('0xd9')](_0x7413('0xda'))){_0x2702ec[_0x7413('0x26')]=qs[_0x7413('0x26')](_0x52ee27[_0x7413('0x43')][_0x7413('0x26')]);_0x2702ec['offset']=qs[_0x7413('0x24')](_0x52ee27[_0x7413('0x43')][_0x7413('0x24')]);}return _0x302221['getOpenchannelAccounts'](_0x2702ec);}})['then'](function(_0x177152){if(_0x177152){return _0x177152?{'count':_0x238ee5,'rows':_0x177152}:null;}})[_0x7413('0x17')](respondWithResult(_0x426e75,null))[_0x7413('0x65')](handleError(_0x426e75,null));};exports[_0x7413('0x155')]=function(_0x3ccfaa,_0x23e024){return db['User'][_0x7413('0x5d')]({'where':{'id':_0x3ccfaa[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x23e024,null))[_0x7413('0x17')](function(_0x28b721){if(_0x28b721){return _0x28b721[_0x7413('0x155')](_0x3ccfaa[_0x7413('0x5f')][_0x7413('0x63')],_[_0x7413('0x64')](_0x3ccfaa[_0x7413('0x5f')],['ids','id'])||{});}})[_0x7413('0x17')](respondWithResult(_0x23e024,null))['catch'](handleError(_0x23e024,null));};exports['removeOpenchannelAccounts']=function(_0x2df142,_0x3a5a7f){return db['User']['find']({'where':{'id':_0x2df142[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x3a5a7f,null))[_0x7413('0x17')](function(_0x2eb3fd){if(_0x2eb3fd){return _0x2eb3fd[_0x7413('0x156')](_0x2df142['query'][_0x7413('0x63')]);}})[_0x7413('0x17')](respondWithStatusCode(_0x3a5a7f,null))[_0x7413('0x65')](handleError(_0x3a5a7f,null));};exports[_0x7413('0x157')]=function(_0x23c4a4,_0x581577){var _0x47b0bb={};var _0x4e10dc={};var _0x16bc7c;var _0x5005c6;return db[_0x7413('0x3c')][_0x7413('0x9a')]({'where':{'id':_0x23c4a4[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x581577,null))[_0x7413('0x17')](function(_0x5b415d){if(_0x5b415d){_0x16bc7c=_0x5b415d;_0x4e10dc[_0x7413('0x5b')]=_[_0x7413('0x58')](db['SmsAccount'][_0x7413('0x3d')]);_0x4e10dc[_0x7413('0x43')]=_[_0x7413('0x58')](_0x23c4a4[_0x7413('0x43')]);_0x4e10dc[_0x7413('0x59')]=_[_0x7413('0x5a')](_0x4e10dc[_0x7413('0x5b')],_0x4e10dc[_0x7413('0x43')]);_0x47b0bb[_0x7413('0x46')]=_[_0x7413('0x5a')](_0x4e10dc[_0x7413('0x5b')],qs['fields'](_0x23c4a4[_0x7413('0x43')][_0x7413('0x5c')]));_0x47b0bb[_0x7413('0x46')]=_0x47b0bb[_0x7413('0x46')][_0x7413('0x4c')]?_0x47b0bb[_0x7413('0x46')]:_0x4e10dc[_0x7413('0x5b')];_0x47b0bb[_0x7413('0xce')]=qs[_0x7413('0xdc')](_0x23c4a4[_0x7413('0x43')]['sort']);_0x47b0bb[_0x7413('0xcf')]=qs[_0x7413('0x59')](_['pick'](_0x23c4a4[_0x7413('0x43')],_0x4e10dc['filters']));if(_0x23c4a4[_0x7413('0x43')][_0x7413('0x33')]){_0x47b0bb['where']=_[_0x7413('0xd1')](_0x47b0bb['where'],{'$or':_['map'](_0x47b0bb[_0x7413('0x46')],function(_0x4ea91c){var _0x3743d6={};_0x3743d6[_0x4ea91c]={'$like':'%'+_0x23c4a4[_0x7413('0x43')][_0x7413('0x33')]+'%'};return _0x3743d6;})});}_0x47b0bb=_[_0x7413('0xd1')]({},_0x47b0bb,_0x23c4a4[_0x7413('0xd2')]);return _0x16bc7c['getSmsAccounts'](_0x47b0bb);}})[_0x7413('0x17')](function(_0x21db02){if(_0x21db02){_0x5005c6=_0x21db02[_0x7413('0x4c')];if(!_0x23c4a4[_0x7413('0x43')][_0x7413('0xd9')](_0x7413('0xda'))){_0x47b0bb[_0x7413('0x26')]=qs[_0x7413('0x26')](_0x23c4a4[_0x7413('0x43')][_0x7413('0x26')]);_0x47b0bb[_0x7413('0x24')]=qs[_0x7413('0x24')](_0x23c4a4[_0x7413('0x43')]['offset']);}return _0x16bc7c[_0x7413('0x157')](_0x47b0bb);}})[_0x7413('0x17')](function(_0x59006b){if(_0x59006b){return _0x59006b?{'count':_0x5005c6,'rows':_0x59006b}:null;}})[_0x7413('0x17')](respondWithResult(_0x581577,null))[_0x7413('0x65')](handleError(_0x581577,null));};exports['addSmsAccounts']=function(_0xedbb4e,_0x285dd0){return db['User'][_0x7413('0x5d')]({'where':{'id':_0xedbb4e[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x285dd0,null))['then'](function(_0x352e52){if(_0x352e52){return _0x352e52[_0x7413('0x158')](_0xedbb4e[_0x7413('0x5f')]['ids'],_[_0x7413('0x64')](_0xedbb4e[_0x7413('0x5f')],[_0x7413('0x63'),'id'])||{});}})[_0x7413('0x17')](respondWithResult(_0x285dd0,null))['catch'](handleError(_0x285dd0,null));};exports['removeSmsAccounts']=function(_0x3455d8,_0x6c6f6){return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x3455d8[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x6c6f6,null))['then'](function(_0x5b8c8e){if(_0x5b8c8e){return _0x5b8c8e[_0x7413('0x159')](_0x3455d8[_0x7413('0x43')][_0x7413('0x63')]);}})['then'](respondWithStatusCode(_0x6c6f6,null))[_0x7413('0x65')](handleError(_0x6c6f6,null));};exports[_0x7413('0x15a')]=function(_0x38118d,_0x5f0f5a){var _0x5123c1={};var _0x1858b5={};var _0x14d5a2;var _0x3c7ed6;return db[_0x7413('0x3c')][_0x7413('0x9a')]({'where':{'id':_0x38118d[_0x7413('0x60')]['id']}})['then'](handleEntityNotFound(_0x5f0f5a,null))[_0x7413('0x17')](function(_0x17fe59){if(_0x17fe59){_0x14d5a2=_0x17fe59;_0x1858b5[_0x7413('0x5b')]=_['keys'](db['ChatWebsite'][_0x7413('0x3d')]);_0x1858b5[_0x7413('0x43')]=_['keys'](_0x38118d[_0x7413('0x43')]);_0x1858b5[_0x7413('0x59')]=_['intersection'](_0x1858b5['model'],_0x1858b5[_0x7413('0x43')]);_0x5123c1[_0x7413('0x46')]=_['intersection'](_0x1858b5[_0x7413('0x5b')],qs['fields'](_0x38118d[_0x7413('0x43')][_0x7413('0x5c')]));_0x5123c1[_0x7413('0x46')]=_0x5123c1[_0x7413('0x46')]['length']?_0x5123c1[_0x7413('0x46')]:_0x1858b5[_0x7413('0x5b')];_0x5123c1[_0x7413('0xce')]=qs[_0x7413('0xdc')](_0x38118d['query'][_0x7413('0xdc')]);_0x5123c1[_0x7413('0xcf')]=qs[_0x7413('0x59')](_[_0x7413('0xd0')](_0x38118d['query'],_0x1858b5[_0x7413('0x59')]));if(_0x38118d[_0x7413('0x43')]['filter']){_0x5123c1['where']=_[_0x7413('0xd1')](_0x5123c1[_0x7413('0xcf')],{'$or':_[_0x7413('0x3e')](_0x5123c1[_0x7413('0x46')],function(_0x377e7f){var _0x98a9d8={};_0x98a9d8[_0x377e7f]={'$like':'%'+_0x38118d[_0x7413('0x43')][_0x7413('0x33')]+'%'};return _0x98a9d8;})});}_0x5123c1=_[_0x7413('0xd1')]({},_0x5123c1,_0x38118d['options']);return _0x14d5a2['getChatWebsites'](_0x5123c1);}})[_0x7413('0x17')](function(_0x53d8eb){if(_0x53d8eb){_0x3c7ed6=_0x53d8eb['length'];if(!_0x38118d['query'][_0x7413('0xd9')](_0x7413('0xda'))){_0x5123c1[_0x7413('0x26')]=qs[_0x7413('0x26')](_0x38118d[_0x7413('0x43')][_0x7413('0x26')]);_0x5123c1[_0x7413('0x24')]=qs[_0x7413('0x24')](_0x38118d[_0x7413('0x43')]['offset']);}return _0x14d5a2[_0x7413('0x15a')](_0x5123c1);}})['then'](function(_0x384a92){if(_0x384a92){return _0x384a92?{'count':_0x3c7ed6,'rows':_0x384a92}:null;}})['then'](respondWithResult(_0x5f0f5a,null))[_0x7413('0x65')](handleError(_0x5f0f5a,null));};exports[_0x7413('0x15b')]=function(_0x402377,_0x5c5556){return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x402377['params']['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x5c5556,null))['then'](function(_0x55ed9f){if(_0x55ed9f){return _0x55ed9f[_0x7413('0x15b')](_0x402377[_0x7413('0x5f')]['ids'],_[_0x7413('0x64')](_0x402377[_0x7413('0x5f')],[_0x7413('0x63'),'id'])||{});}})[_0x7413('0x17')](respondWithResult(_0x5c5556,null))['catch'](handleError(_0x5c5556,null));};exports['removeChatWebsites']=function(_0x47646a,_0x534984){return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x47646a[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x534984,null))[_0x7413('0x17')](function(_0xa7ce22){if(_0xa7ce22){return _0xa7ce22[_0x7413('0x15c')](_0x47646a[_0x7413('0x43')][_0x7413('0x63')]);}})[_0x7413('0x17')](respondWithStatusCode(_0x534984,null))[_0x7413('0x65')](handleError(_0x534984,null));};exports[_0x7413('0x15d')]=function(_0x174a7e,_0x22cb35){var _0x54ff1a={};var _0x4aed1d={};var _0x1e743f;var _0xdf7177;return db['User'][_0x7413('0x9a')]({'where':{'id':_0x174a7e['params']['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x22cb35,null))[_0x7413('0x17')](function(_0x33d354){if(_0x33d354){_0x1e743f=_0x33d354;_0x4aed1d[_0x7413('0x5b')]=_['keys'](db[_0x7413('0x15e')][_0x7413('0x3d')]);_0x4aed1d['query']=_[_0x7413('0x58')](_0x174a7e[_0x7413('0x43')]);_0x4aed1d[_0x7413('0x59')]=_[_0x7413('0x5a')](_0x4aed1d[_0x7413('0x5b')],_0x4aed1d['query']);_0x54ff1a['attributes']=_[_0x7413('0x5a')](_0x4aed1d[_0x7413('0x5b')],qs[_0x7413('0x5c')](_0x174a7e[_0x7413('0x43')]['fields']));_0x54ff1a[_0x7413('0x46')]=_0x54ff1a[_0x7413('0x46')][_0x7413('0x4c')]?_0x54ff1a[_0x7413('0x46')]:_0x4aed1d[_0x7413('0x5b')];_0x54ff1a[_0x7413('0xce')]=qs[_0x7413('0xdc')](_0x174a7e[_0x7413('0x43')][_0x7413('0xdc')]);_0x54ff1a[_0x7413('0xcf')]=qs[_0x7413('0x59')](_[_0x7413('0xd0')](_0x174a7e[_0x7413('0x43')],_0x4aed1d[_0x7413('0x59')]));if(_0x174a7e[_0x7413('0x43')]['filter']){_0x54ff1a[_0x7413('0xcf')]=_[_0x7413('0xd1')](_0x54ff1a[_0x7413('0xcf')],{'$or':_['map'](_0x54ff1a['attributes'],function(_0x206390){var _0x3698ad={};_0x3698ad[_0x206390]={'$like':'%'+_0x174a7e[_0x7413('0x43')][_0x7413('0x33')]+'%'};return _0x3698ad;})});}_0x54ff1a=_[_0x7413('0xd1')]({},_0x54ff1a,_0x174a7e[_0x7413('0xd2')]);return _0x1e743f[_0x7413('0x15d')](_0x54ff1a);}})[_0x7413('0x17')](function(_0x4d86c8){if(_0x4d86c8){_0xdf7177=_0x4d86c8['length'];if(!_0x174a7e['query'][_0x7413('0xd9')](_0x7413('0xda'))){_0x54ff1a[_0x7413('0x26')]=qs[_0x7413('0x26')](_0x174a7e[_0x7413('0x43')][_0x7413('0x26')]);_0x54ff1a['offset']=qs[_0x7413('0x24')](_0x174a7e[_0x7413('0x43')][_0x7413('0x24')]);}return _0x1e743f['getWhatsappAccounts'](_0x54ff1a);}})[_0x7413('0x17')](function(_0x5addb6){if(_0x5addb6){return _0x5addb6?{'count':_0xdf7177,'rows':_0x5addb6}:null;}})[_0x7413('0x17')](respondWithResult(_0x22cb35,null))[_0x7413('0x65')](handleError(_0x22cb35,null));};exports[_0x7413('0x15f')]=function(_0x4f3334,_0x25dd60){return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x4f3334['params']['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x25dd60,null))[_0x7413('0x17')](function(_0x29851e){if(_0x29851e){return _0x29851e[_0x7413('0x15f')](_0x4f3334['body'][_0x7413('0x63')],_[_0x7413('0x64')](_0x4f3334[_0x7413('0x5f')],[_0x7413('0x63'),'id'])||{});}})[_0x7413('0x17')](respondWithResult(_0x25dd60,null))[_0x7413('0x65')](handleError(_0x25dd60,null));};exports[_0x7413('0x160')]=function(_0x5114c1,_0x2bf85d){return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x5114c1[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x2bf85d,null))[_0x7413('0x17')](function(_0x1fdcb0){if(_0x1fdcb0){return _0x1fdcb0['removeWhatsappAccounts'](_0x5114c1[_0x7413('0x43')][_0x7413('0x63')]);}})[_0x7413('0x17')](respondWithStatusCode(_0x2bf85d,null))[_0x7413('0x65')](handleError(_0x2bf85d,null));};exports[_0x7413('0x161')]=function(_0x897d50,_0x2c1962){var _0x10f00c={};var _0x309b39={};var _0x4a3fa1;var _0x158d45;return db[_0x7413('0x3c')]['findOne']({'where':{'id':_0x897d50[_0x7413('0x60')]['id']}})['then'](handleEntityNotFound(_0x2c1962,null))['then'](function(_0x58410e){if(_0x58410e){_0x4a3fa1=_0x58410e;_0x309b39[_0x7413('0x5b')]=_['keys'](db[_0x7413('0x162')]['rawAttributes']);_0x309b39[_0x7413('0x43')]=_['keys'](_0x897d50[_0x7413('0x43')]);_0x309b39[_0x7413('0x59')]=_[_0x7413('0x5a')](_0x309b39['model'],_0x309b39['query']);_0x10f00c[_0x7413('0x46')]=_[_0x7413('0x5a')](_0x309b39[_0x7413('0x5b')],qs[_0x7413('0x5c')](_0x897d50[_0x7413('0x43')]['fields']));_0x10f00c[_0x7413('0x46')]=_0x10f00c[_0x7413('0x46')][_0x7413('0x4c')]?_0x10f00c[_0x7413('0x46')]:_0x309b39[_0x7413('0x5b')];_0x10f00c[_0x7413('0xce')]=qs[_0x7413('0xdc')](_0x897d50[_0x7413('0x43')][_0x7413('0xdc')]);_0x10f00c['where']=qs[_0x7413('0x59')](_[_0x7413('0xd0')](_0x897d50['query'],_0x309b39[_0x7413('0x59')]));if(_0x897d50[_0x7413('0x43')][_0x7413('0x33')]){_0x10f00c['where']=_['merge'](_0x10f00c[_0x7413('0xcf')],{'$or':_[_0x7413('0x3e')](_0x10f00c[_0x7413('0x46')],function(_0x2bb7cc){var _0x5c6e4d={};_0x5c6e4d[_0x2bb7cc]={'$like':'%'+_0x897d50[_0x7413('0x43')][_0x7413('0x33')]+'%'};return _0x5c6e4d;})});}_0x10f00c=_[_0x7413('0xd1')]({},_0x10f00c,_0x897d50[_0x7413('0xd2')]);return _0x4a3fa1[_0x7413('0x161')](_0x10f00c);}})['then'](function(_0xca5ead){if(_0xca5ead){_0x158d45=_0xca5ead[_0x7413('0x4c')];if(!_0x897d50['query'][_0x7413('0xd9')]('nolimit')){_0x10f00c[_0x7413('0x26')]=qs[_0x7413('0x26')](_0x897d50[_0x7413('0x43')][_0x7413('0x26')]);_0x10f00c[_0x7413('0x24')]=qs[_0x7413('0x24')](_0x897d50[_0x7413('0x43')][_0x7413('0x24')]);}return _0x4a3fa1[_0x7413('0x161')](_0x10f00c);}})[_0x7413('0x17')](function(_0x3c6368){if(_0x3c6368){return _0x3c6368?{'count':_0x158d45,'rows':_0x3c6368}:null;}})[_0x7413('0x17')](respondWithResult(_0x2c1962,null))[_0x7413('0x65')](handleError(_0x2c1962,null));};exports[_0x7413('0x163')]=function(_0x13069c,_0xc84ed0){return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x13069c['params']['id']}})['then'](handleEntityNotFound(_0xc84ed0,null))['then'](function(_0x407b68){if(_0x407b68){return _0x407b68[_0x7413('0x163')](_0x13069c[_0x7413('0x5f')]['ids'],_[_0x7413('0x64')](_0x13069c[_0x7413('0x5f')],[_0x7413('0x63'),'id'])||{});}})[_0x7413('0x17')](respondWithResult(_0xc84ed0,null))[_0x7413('0x65')](handleError(_0xc84ed0,null));};exports['removeSquareProjects']=function(_0x5ed441,_0x72610d){return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x5ed441[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x72610d,null))['then'](function(_0x15bacc){if(_0x15bacc){return _0x15bacc[_0x7413('0x164')](_0x5ed441[_0x7413('0x43')][_0x7413('0x63')]);}})[_0x7413('0x17')](respondWithStatusCode(_0x72610d,null))['catch'](handleError(_0x72610d,null));};exports[_0x7413('0x165')]=function(_0x2ea11b,_0x39db26){var _0xff466e={},_0x1d2856={},_0x5a9e28={'count':0x0,'rows':[]};var _0x5ba84e=db['CmHopper'][_0x7413('0x3d')];_0x1d2856[_0x7413('0x5b')]=_[_0x7413('0x58')](_0x5ba84e);_0x1d2856[_0x7413('0x43')]=_['keys'](_0x2ea11b[_0x7413('0x43')]);_0x1d2856['filters']=_[_0x7413('0x5a')](_0x1d2856[_0x7413('0x5b')],_0x1d2856[_0x7413('0x43')]);_0x1d2856[_0x7413('0x59')]=_[_0x7413('0x166')](_0x1d2856[_0x7413('0x59')],['$and',_0x7413('0x167'),'$gt',_0x7413('0x168'),_0x7413('0x169'),_0x7413('0x16a'),_0x7413('0x16b'),_0x7413('0x16c'),_0x7413('0x16d'),'$between','$notBetween',_0x7413('0x16e'),_0x7413('0x16f'),_0x7413('0x170'),_0x7413('0x171'),_0x7413('0x172'),'$notILike','$like','$overlap',_0x7413('0x173'),_0x7413('0x174'),'$any']);_0xff466e[_0x7413('0x46')]=_[_0x7413('0x5a')](_0x1d2856[_0x7413('0x5b')],qs[_0x7413('0x5c')](_0x2ea11b[_0x7413('0x43')][_0x7413('0x5c')]));_0xff466e['attributes']=_0xff466e[_0x7413('0x46')][_0x7413('0x4c')]?_0xff466e[_0x7413('0x46')]:_0x1d2856[_0x7413('0x5b')];if(!_0x2ea11b[_0x7413('0x43')]['hasOwnProperty'](_0x7413('0xda'))){_0xff466e[_0x7413('0x26')]=qs[_0x7413('0x26')](_0x2ea11b['query']['limit']);_0xff466e[_0x7413('0x24')]=qs[_0x7413('0x24')](_0x2ea11b[_0x7413('0x43')]['offset']);}_0xff466e[_0x7413('0xce')]=qs[_0x7413('0xdc')](_0x2ea11b[_0x7413('0x43')]['sort']);_0xff466e[_0x7413('0xcf')]=qs[_0x7413('0x59')](_[_0x7413('0xd0')](_0x2ea11b[_0x7413('0x43')],_0x1d2856['filters']));if(_0x2ea11b[_0x7413('0x43')]['filter']){_0xff466e[_0x7413('0xcf')]=_['merge'](_0xff466e[_0x7413('0xcf')],{'$or':_['map'](_0xff466e[_0x7413('0x46')],function(_0x3f28f5){var _0x175695={};_0x175695[_0x3f28f5]={'$like':'%'+_0x2ea11b[_0x7413('0x43')]['filter']+'%'};return _0x175695;})});}_0xff466e[_0x7413('0xcf')]={'$and':[_0xff466e[_0x7413('0xcf')],{'$or':[{'UserId':_0x2ea11b[_0x7413('0x60')]['id']},{'OwnerId':_0x2ea11b[_0x7413('0x60')]['id']}]}]};_0xff466e=_[_0x7413('0xd1')]({},_0xff466e,_0x2ea11b[_0x7413('0xd2')]);var _0x376a13={'where':_0xff466e[_0x7413('0xcf')]};return db[_0x7413('0x175')]['count'](_0x376a13)['then'](function(_0x30c934){_0x5a9e28[_0x7413('0x27')]=_0x30c934;if(_0x2ea11b[_0x7413('0x43')][_0x7413('0x44')]){_0xff466e[_0x7413('0x45')]=[{'attributes':['id','firstName',_0x7413('0x176'),_0x7413('0xf2')],'model':db[_0x7413('0xcd')],'as':_0x7413('0x177')},{'attributes':['id','name',_0x7413('0x178')],'model':db[_0x7413('0xae')],'as':'Queue'}];}return db[_0x7413('0x175')][_0x7413('0x48')](_0xff466e);})[_0x7413('0x17')](function(_0x293f09){_0x5a9e28[_0x7413('0x49')]=_0x293f09;return _0x5a9e28;})[_0x7413('0x17')](respondWithFilteredResult(_0x39db26,_0xff466e))[_0x7413('0x65')](handleError(_0x39db26,null));};exports[_0x7413('0x179')]=function(_0x46cdd4,_0x37bba9){if(!_[_0x7413('0x6b')](_0x46cdd4['user']['id'])&&(_0x46cdd4[_0x7413('0x2f')][_0x7413('0x2c')]==_0x7413('0x2d')||_0x46cdd4[_0x7413('0x2f')]['role']==_0x7413('0x2f'))){return db[_0x7413('0x3c')]['findOne']({'where':{'id':_0x46cdd4[_0x7413('0x60')]['id']},'raw':!![]})['then'](function(_0x5dddc4){return authService[_0x7413('0x17a')](_0x5dddc4);})[_0x7413('0x17')](function(_0x449e6d){if(_0x449e6d){return _0x37bba9[_0x7413('0x22')](0xc8)[_0x7413('0x23')]({'api_key':_0x449e6d[_0x7413('0x17b')]});}else{return _0x37bba9['status'](0xcc)[_0x7413('0x23')]({'message':_0x7413('0x17c')});}})[_0x7413('0x65')](handleError(_0x37bba9,0x193));}else{return _0x37bba9[_0x7413('0x22')](0x191)[_0x7413('0x23')]({'message':_0x7413('0x17d')});}};exports['createApiKey']=function(_0x492945,_0x376fdf){if(!_[_0x7413('0x6b')](_0x492945[_0x7413('0x2f')]['id'])&&(_0x492945[_0x7413('0x2f')][_0x7413('0x2c')]=='admin'||_0x492945[_0x7413('0x2f')][_0x7413('0x2c')]==_0x7413('0x2f'))){return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x492945['params']['id']}})[_0x7413('0x17')](function(_0x4ceab1){return authService[_0x7413('0x17e')](_0x4ceab1);})['then'](function(_0x5ddac6){return db[_0x7413('0x3c')][_0x7413('0x5e')]({'apiKeyIat':_0x5ddac6[_0x7413('0x17f')],'apiKeyNonce':_0x5ddac6[_0x7413('0x180')]},{'where':{'id':_0x492945[_0x7413('0x60')]['id']}})[_0x7413('0x17')](function(){return _0x376fdf[_0x7413('0x22')](0xc8)['json']({'api_key':_0x5ddac6[_0x7413('0x17b')]});});})['catch'](handleError(_0x376fdf,0x193));}else{return _0x376fdf[_0x7413('0x22')](0x191)[_0x7413('0x23')]({'message':_0x7413('0x17d')});}};exports[_0x7413('0x181')]=function(_0xb2306b,_0x197bd9){if(!_[_0x7413('0x6b')](_0xb2306b[_0x7413('0x2f')]['id'])&&(_0xb2306b['user'][_0x7413('0x2c')]=='admin'||_0xb2306b[_0x7413('0x2f')]['role']==_0x7413('0x2f'))){return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0xb2306b['params']['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x197bd9,null))[_0x7413('0x17')](function(_0x3457ad){if(_0x3457ad&&_0x3457ad[_0x7413('0x182')]&&_0x3457ad[_0x7413('0x183')])return _0x3457ad;else throw{'message':_0x7413('0x184')};})[_0x7413('0x17')](function(_0xcf3ea8){return db[_0x7413('0x3c')][_0x7413('0x5e')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0xb2306b[_0x7413('0x60')]['id']}});})['then'](respondWithStatusCode(_0x197bd9,0xc8))[_0x7413('0x65')](handleError(_0x197bd9,0x193));}else{return _0x197bd9[_0x7413('0x22')](0x191)['json']({'message':_0x7413('0x17d')});}};exports['whoami']=function(_0x2aa4d3,_0x10a56a){var _0x4b4fb6=_0x2aa4d3[_0x7413('0x2f')][_0x7413('0x2b')]({'plain':!![]});if(!_0x4b4fb6){return _0x10a56a[_0x7413('0x22')](0x191)[_0x7413('0x3b')]('Unable\x20to\x20retrieve\x20the\x20current\x20user');}else{return _0x10a56a[_0x7413('0x22')](0xc8)[_0x7413('0x23')](_0x4b4fb6);}};exports[_0x7413('0x185')]=function(_0x1f56b8,_0x2a7585){var _0x2dbff9={'offset':0x0},_0x3cfb61={'count':0x0,'rows':[]};Promise[_0x7413('0x109')]()[_0x7413('0x17')](function(){if(!_0x1f56b8['query'][_0x7413('0x33')]&&!_0x1f56b8[_0x7413('0x43')]['teams']&&!_0x1f56b8['query'][_0x7413('0x186')])return[];return Promise[_0x7413('0x109')]()[_0x7413('0x17')](function(){var _0x651860=[];if(!_[_0x7413('0x90')](_0x1f56b8[_0x7413('0x43')][_0x7413('0x187')])){_0x651860[_0x7413('0x47')](db[_0x7413('0x116')][_0x7413('0x48')]({'attributes':['id','name'],'where':{'id':_0x1f56b8[_0x7413('0x43')][_0x7413('0x187')]}}));}if(!_[_0x7413('0x90')](_0x1f56b8[_0x7413('0x43')][_0x7413('0x186')])){_0x651860[_0x7413('0x47')](db[_0x7413('0xae')]['findAll']({'attributes':['id','name'],'type':_0x7413('0x188'),'where':{'id':_0x1f56b8[_0x7413('0x43')][_0x7413('0x186')]}}));}return Promise[_0x7413('0x54')](_0x651860);})[_0x7413('0x17')](function(_0xf0820b){var _0x5eb284=_[_0x7413('0x124')](_0xf0820b)[_0x7413('0x3e')](function(_0x299d4e){return _0x299d4e[_0x7413('0x130')]({'attributes':['id',_0x7413('0x37'),'internal',_0x7413('0xa1')],'raw':!![]});});return Promise[_0x7413('0x54')](_0x5eb284);})[_0x7413('0x17')](function(_0x5550f1){var _0x32cc44=_['flatten'](_0x5550f1);if(!_0x1f56b8['query']['filter'])return _0x32cc44;if(_[_0x7413('0x90')](_0x32cc44)){return db[_0x7413('0x3c')]['findAll']({'attributes':['id','name',_0x7413('0x66'),'online'],'where':{'role':_0x7413('0x74'),'$or':[db[_0x7413('0x6d')]['where'](db['sequelize']['fn'](_0x7413('0x189'),db[_0x7413('0x6d')][_0x7413('0x18a')](_0x7413('0x37'))),{'$like':'%'+_0x1f56b8[_0x7413('0x43')]['filter'][_0x7413('0xa7')]()+'%'}),{'internal':{'$like':'%'+_0x1f56b8[_0x7413('0x43')][_0x7413('0x33')]+'%'}}]},'raw':!![]});}else{return _(_0x32cc44)['flatten']()[_0x7413('0x33')](function(_0x411020){return _0x411020[_0x7413('0x37')][_0x7413('0xa7')]()['includes'](_0x1f56b8[_0x7413('0x43')][_0x7413('0x33')]['toLowerCase']())||_0x411020[_0x7413('0x66')]['toString']()['includes'](_0x1f56b8[_0x7413('0x43')][_0x7413('0x33')]);})[_0x7413('0x35')]();}})[_0x7413('0x17')](function(_0x44e650){var _0x599a20=_0x7413('0x37');var _0xdb3c26=_0x7413('0x18b');if(_0x1f56b8[_0x7413('0x43')]['sort']){var _0xdb3c26=_0x1f56b8[_0x7413('0x43')][_0x7413('0xdc')][0x0]==='-'?_0x7413('0x18c'):_0x7413('0x18b');var _0x599a20=_0xdb3c26==='asc'?_0x1f56b8['query'][_0x7413('0xdc')]:_0x1f56b8[_0x7413('0x43')][_0x7413('0xdc')]['substring'](0x1);}return _(_0x44e650)['uniqBy']('id')['orderBy']([function(_0x4247ce){return _0x599a20===_0x7413('0x37')?_0x4247ce[_0x599a20]['toLowerCase']():_0x4247ce[_0x599a20];}],[_0xdb3c26])[_0x7413('0x3e')](function(_0x90262e){return _[_0x7413('0xd0')](_0x90262e,['id',_0x7413('0x37'),_0x7413('0x66'),'online']);})[_0x7413('0x35')]();})[_0x7413('0x17')](function(_0xf7bd51){return client[_0x7413('0x16')](_0x7413('0x30'),_0x1f56b8)[_0x7413('0x17')](function(_0x3f24e5){if(_0x3f24e5['error'])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x2772e9=_0x3f24e5['result'];var _0x4c8791=jayson[_0x7413('0x14')][_0x7413('0x15')]({'port':0x232c});return _0x4c8791[_0x7413('0x16')]('Agents',_0x1f56b8)[_0x7413('0x17')](function(_0x4793b3){if(_0x4793b3['error'])throw new Error(_0x7413('0x18d'));var _0x51163e=_0x4793b3['result'];return _['merge']({},_0x51163e,_0x2772e9);});})['then'](function(_0x208625){return _['map'](_0xf7bd51,function(_0x43210c){var _0x58063f=_[_0x7413('0x5d')](_0x208625[_0x7413('0x49')],['id',_0x43210c['id']]);if(!_0x58063f||!_0x43210c[_0x7413('0xa1')]){_0x43210c[_0x7413('0x22')]=_0x7413('0x18e');}else if(_0x58063f[_0x7413('0xb0')]){_0x43210c[_0x7413('0x22')]=_0x7413('0x10a');}else{_0x43210c['status']=_[_0x7413('0x36')]([_0x7413('0x18f'),'unknown',_0x7413('0x190'),'ringing',null,undefined],_0x58063f[_0x7413('0x191')])?_0x7413('0xa1'):'busy';}return _0x43210c;});});});})[_0x7413('0x17')](function(_0x30b256){if(!_0x1f56b8[_0x7413('0x43')]['hasOwnProperty'](_0x7413('0xda'))){_0x2dbff9[_0x7413('0x26')]=qs[_0x7413('0x26')](_0x1f56b8['query'][_0x7413('0x26')]||0xa);_0x2dbff9[_0x7413('0x24')]=qs[_0x7413('0x24')](_0x1f56b8[_0x7413('0x43')][_0x7413('0x24')]);}_0x3cfb61[_0x7413('0x27')]=_0x30b256[_0x7413('0x4c')];_0x3cfb61[_0x7413('0x49')]=_0x2dbff9[_0x7413('0x26')]?_0x30b256[_0x7413('0x192')](_0x2dbff9[_0x7413('0x24')],_0x2dbff9[_0x7413('0x24')]+_0x2dbff9[_0x7413('0x26')]):_0x30b256;return _0x3cfb61;})[_0x7413('0x17')](respondWithFilteredResult(_0x2a7585,_0x2dbff9))[_0x7413('0x65')](handleError(_0x2a7585,null));};function get_open_tabs(_0x1f8379,_0x24cac7){var _0x3cb797=_0x1f8379[_0x7413('0x193')](0x0)[_0x7413('0x194')]()+_0x1f8379['slice'](0x1);var _0x29de0b={'type':db[_0x7413('0x96')][_0x7413('0x6f')][_0x7413('0x195')],'raw':!![]};return new BPromise(function(_0x41cb43,_0x38da37){var _0xd1e3e9=squel[_0x7413('0x196')]()['field'](_0x7413('0x197')+_0x3cb797+_0x7413('0x198'),'id')[_0x7413('0x199')]('ui.createdAt')[_0x7413('0x70')]('user_has_'+_0x1f8379+'_interactions','ui')['where'](_0x7413('0x19a'),_0x24cac7['id']);return db['sequelize'][_0x7413('0x43')](_0xd1e3e9[_0x7413('0x19b')](),_0x29de0b)['then'](function(_0x5502c3){_0x24cac7[_0x3cb797+_0x7413('0x19c')]=_0x5502c3;_0x41cb43(_0x5502c3);})[_0x7413('0x65')](function(_0x132aa5){_0x38da37(_0x132aa5);});});};
\ No newline at end of file
index aa15b4b..eebaa2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a87=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','User'];(function(_0x5a240d,_0x127abc){var _0xea1946=function(_0x17d3ab){while(--_0x17d3ab){_0x5a240d['push'](_0x5a240d['shift']());}};_0xea1946(++_0x127abc);}(_0x2a87,0x142));var _0x72a8=function(_0x437808,_0x5d54e4){_0x437808=_0x437808-0x0;var _0x3752ac=_0x2a87[_0x437808];return _0x3752ac;};'use strict';var EventEmitter=require('events');var User=require(_0x72a8('0x0'))['db'][_0x72a8('0x1')];var UserEvents=new EventEmitter();UserEvents[_0x72a8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x72a8('0x3'),'afterDestroy':_0x72a8('0x4')};function emitEvent(_0x4c038b){return function(_0x4c4477,_0x39a2ec,_0x3c5c17){UserEvents[_0x72a8('0x5')](_0x4c038b+':'+_0x4c4477['id'],_0x4c4477);UserEvents[_0x72a8('0x5')](_0x4c038b,_0x4c4477);_0x3c5c17(null);};}for(var e in events){if(events[_0x72a8('0x6')](e)){var event=events[e];User[_0x72a8('0x7')](e,emitEvent(event));}}module[_0x72a8('0x8')]=UserEvents;
\ No newline at end of file
+var _0xcdea=['emit','hasOwnProperty','hook','exports','events','User','setMaxListeners','save','update','remove'];(function(_0xfb8b50,_0x5e151c){var _0x20f2ce=function(_0x2f2529){while(--_0x2f2529){_0xfb8b50['push'](_0xfb8b50['shift']());}};_0x20f2ce(++_0x5e151c);}(_0xcdea,0xea));var _0xacde=function(_0x1f0679,_0x53d43c){_0x1f0679=_0x1f0679-0x0;var _0x3dc3a4=_0xcdea[_0x1f0679];return _0x3dc3a4;};'use strict';var EventEmitter=require(_0xacde('0x0'));var User=require('../../mysqldb')['db'][_0xacde('0x1')];var UserEvents=new EventEmitter();UserEvents[_0xacde('0x2')](0x0);var events={'afterCreate':_0xacde('0x3'),'afterUpdate':_0xacde('0x4'),'afterDestroy':_0xacde('0x5')};function emitEvent(_0x555b0e){return function(_0x4af514,_0x344b3e,_0x4d4409){UserEvents[_0xacde('0x6')](_0x555b0e+':'+_0x4af514['id'],_0x4af514);UserEvents['emit'](_0x555b0e,_0x4af514);_0x4d4409(null);};}for(var e in events){if(events[_0xacde('0x7')](e)){var event=events[e];User[_0xacde('0x8')](e,emitEvent(event));}}module[_0xacde('0x9')]=UserEvents;
\ No newline at end of file
index 1daf8c3..aec5c2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f9a=['VoiceChanSpy','findAll','then','internal','concat','catch','exports','models','define','User','users','userProfileId','undefined','privacyEnabled','updateMd5Password','updatePassword','resolve','changed','UserProfile','VoiceExtension','bulkCreate','destroy','context','encryptPassword','function','Missing\x20Callback','randomBytes','toString','base64','salt','sha1','pbkdf2','indexOf','provider','Invalid\x20password','makeSalt','md5secret',':asterisk:','bluebird','crypto','util','md5','google','length','from-sip','system','format','%s%s','prefix','push','merge','Set','CDR(type)=%s','chanspy','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','wav','gsm','CDR(type)=internal','extensionMonitor','includes','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s','Dial','SIP/%s,,tTxX','Hangup','priority','defaults'];(function(_0x4a3591,_0x1407f5){var _0x3e9c34=function(_0x5a8244){while(--_0x5a8244){_0x4a3591['push'](_0x4a3591['shift']());}};_0x3e9c34(++_0x1407f5);}(_0x7f9a,0x74));var _0xa7f9=function(_0x50cb12,_0x5787c2){_0x50cb12=_0x50cb12-0x0;var _0x4baa4f=_0x7f9a[_0x50cb12];return _0x4baa4f;};'use strict';var BPromise=require(_0xa7f9('0x0'));var crypto=require(_0xa7f9('0x1'));var util=require(_0xa7f9('0x2'));var md5=require(_0xa7f9('0x3'));var _=require('lodash');var attributes=require('./user.attributes');var authTypes=[_0xa7f9('0x4')];var validatePresenceOf=function(_0x354122){return _0x354122&&_0x354122[_0xa7f9('0x5')];};var getChanSpyApplications=function(_0x1bd516,_0x5f582c,_0x59041f){var _0x538d29={'context':_0x1bd516['context']||_0xa7f9('0x6'),'type':_0xa7f9('0x7'),'isApp':![],'UserId':_0x1bd516['id']};var _0x3f48d=[];for(var _0x50f9b1=0x0,_0x66c5fc=0x1;_0x50f9b1<_0x59041f[_0xa7f9('0x5')];_0x50f9b1++,_0x66c5fc=0x1){var _0x431cca={'exten':util[_0xa7f9('0x8')](_0xa7f9('0x9'),_0x59041f[_0x50f9b1][_0xa7f9('0xa')],_0x5f582c),'ChanSpyId':_0x59041f[_0x50f9b1]['id']};_0x3f48d[_0xa7f9('0xb')](_[_0xa7f9('0xc')]({'app':_0xa7f9('0xd'),'appdata':util[_0xa7f9('0x8')](_0xa7f9('0xe'),_0xa7f9('0xf')),'priority':_0x66c5fc++},_0x538d29,_0x431cca));if(_0x59041f[_0x50f9b1]['record']){_0x3f48d[_0xa7f9('0xb')](_[_0xa7f9('0xc')]({'app':_0xa7f9('0x10'),'appdata':util[_0xa7f9('0x8')](_0xa7f9('0x11'),_0x59041f[_0x50f9b1][_0xa7f9('0x12')]),'priority':_0x66c5fc++},_0x538d29,_0x431cca));}if(_0x59041f[_0x50f9b1][_0xa7f9('0x13')]){_0x3f48d[_0xa7f9('0xb')](_['merge']({'app':_0xa7f9('0x14'),'appdata':_0x59041f[_0x50f9b1][_0xa7f9('0x15')],'priority':_0x66c5fc++},_0x538d29,_0x431cca));}_0x3f48d[_0xa7f9('0xb')](_[_0xa7f9('0xc')]({'app':_0xa7f9('0x16'),'appdata':util[_0xa7f9('0x8')](_0xa7f9('0x17'),_0x1bd516[_0xa7f9('0x18')],_0x59041f[_0x50f9b1]['options']?_0x59041f[_0x50f9b1][_0xa7f9('0x19')][_0xa7f9('0x1a')](''):''),'priority':_0x66c5fc++},_0x538d29,_0x431cca));if(_0x59041f[_0x50f9b1]['record']){_0x3f48d['push'](_[_0xa7f9('0xc')]({'app':_0xa7f9('0x1b'),'priority':_0x66c5fc++},_0x538d29,_0x431cca));}}return _0x3f48d;};var getUserApplications=function(_0x15b553,_0x4c86ae){var _0x301cf1=[_0xa7f9('0x1c'),'WAV',_0xa7f9('0x1d')];var _0x590ce2={'context':_0x15b553['context']||_0xa7f9('0x6'),'exten':_0x4c86ae,'type':'system','isApp':![],'UserId':_0x15b553['id']};var _0xdef793=[{'app':_0xa7f9('0xd'),'appdata':_0xa7f9('0x1e')}];if(_0x15b553[_0xa7f9('0x1f')]&&_[_0xa7f9('0x20')](_0x301cf1,_0x15b553[_0xa7f9('0x1f')])){_0xdef793['push']({'app':'Set','appdata':_0xa7f9('0x21')});_0xdef793['push']({'app':_0xa7f9('0xd'),'appdata':util[_0xa7f9('0x8')](_0xa7f9('0x22'),_0x15b553[_0xa7f9('0x1f')])});_0xdef793[_0xa7f9('0xb')]({'app':'Dial','appdata':util[_0xa7f9('0x8')]('SIP/%s,,tTxXU(xcally-mixmonitor-context)',_0x15b553[_0xa7f9('0x18')])});}else{_0xdef793[_0xa7f9('0xb')]({'app':_0xa7f9('0x23'),'appdata':util[_0xa7f9('0x8')](_0xa7f9('0x24'),_0x15b553['name'])});}_0xdef793[_0xa7f9('0xb')]({'app':_0xa7f9('0x25')});for(var _0x412c92=0x0;_0x412c92<_0xdef793[_0xa7f9('0x5')];_0x412c92++){_0xdef793[_0x412c92][_0xa7f9('0x26')]=_0x412c92+0x1;_0xdef793[_0x412c92]=_[_0xa7f9('0x27')](_0xdef793[_0x412c92],_0x590ce2);}return _0xdef793;};var getChanSpyPromise=function(_0x5df440,_0x10601e){return new BPromise(function(_0x129f0f,_0x4a76e2){return _0x5df440[_0xa7f9('0x28')][_0xa7f9('0x29')]()[_0xa7f9('0x2a')](function(_0x4bd56b){if(_0x4bd56b){var _0x85ee5=getChanSpyApplications(_0x10601e,_0x10601e['internal'],_0x4bd56b);if(_0x10601e[_0xa7f9('0x2b')]!=_0x10601e[_0xa7f9('0x18')]){_0x85ee5=_0x85ee5[_0xa7f9('0x2c')](getChanSpyApplications(_0x10601e,_0x10601e[_0xa7f9('0x18')],_0x4bd56b));}return _0x129f0f(_0x85ee5);}return _0x129f0f([]);})[_0xa7f9('0x2d')](function(_0x853f78){_0x4a76e2(_0x853f78);});});};module[_0xa7f9('0x2e')]=function(_0x198b98,_0x327a4a){var _0xcc581b=_0x198b98[_0xa7f9('0x2f')];return _0x198b98[_0xa7f9('0x30')](_0xa7f9('0x31'),attributes,{'tableName':_0xa7f9('0x32'),'charset':'utf8','collate':'utf8_bin','hooks':{'beforeCreate':function(_0x30e0bb,_0xe6ba58,_0x881827){var _0x410dc2=typeof _0x30e0bb[_0xa7f9('0x33')]===_0xa7f9('0x34')?BPromise['resolve'](null):_0xcc581b['UserProfile']['find']({'where':{'id':_0x30e0bb[_0xa7f9('0x33')]}});_0x410dc2[_0xa7f9('0x2a')](function(_0x3cfb68){if(_0x3cfb68){_0x30e0bb[_0xa7f9('0x35')]=_0x3cfb68[_0xa7f9('0x35')];}})[_0xa7f9('0x2a')](function(){_0x30e0bb[_0xa7f9('0x36')]();_0x30e0bb[_0xa7f9('0x37')](_0x881827);})['catch'](function(_0x5ce8d0){_0x881827(_0x5ce8d0);});},'beforeUpdate':function(_0x1ebac1,_0x43b5b9,_0x4dcc21){Promise[_0xa7f9('0x38')]()[_0xa7f9('0x2a')](function(){if(_0x1ebac1[_0xa7f9('0x39')](_0xa7f9('0x33'))===![])return;return _0xcc581b[_0xa7f9('0x3a')]['find']({'where':{'id':_0x1ebac1[_0xa7f9('0x33')]}})['then'](function(_0x20b4bb){if(_0x20b4bb)_0x1ebac1['privacyEnabled']=_0x20b4bb[_0xa7f9('0x35')];return;});})[_0xa7f9('0x2a')](function(){if(_0x1ebac1['changed']('password')){_0x1ebac1[_0xa7f9('0x36')]();return _0x1ebac1[_0xa7f9('0x37')](_0x4dcc21);}_0x4dcc21();})[_0xa7f9('0x2d')](function(_0x535fd1){_0x4dcc21(_0x535fd1);});},'afterCreate':function(_0x1c495a,_0x55385b,_0x5208b2){var _0x1750a3=getUserApplications(_0x1c495a,_0x1c495a[_0xa7f9('0x2b')]);if(_0x1c495a[_0xa7f9('0x2b')]!=_0x1c495a[_0xa7f9('0x18')]){_0x1750a3=_0x1750a3[_0xa7f9('0x2c')](getUserApplications(_0x1c495a,_0x1c495a[_0xa7f9('0x18')]));}return _0xcc581b[_0xa7f9('0x3b')][_0xa7f9('0x3c')](_0x1750a3)[_0xa7f9('0x2a')](function(){if(_0x1c495a[_0xa7f9('0xf')]){return getChanSpyPromise(_0xcc581b,_0x1c495a);}})[_0xa7f9('0x2a')](function(_0x37a3c3){if(_0x37a3c3&&_0x37a3c3[_0xa7f9('0x5')]){return _0xcc581b[_0xa7f9('0x3b')]['bulkCreate'](_0x37a3c3);}})['then'](function(){_0x5208b2();})['catch'](function(_0xcb298c){_0x5208b2(_0xcb298c);});},'afterUpdate':function(_0xb53134,_0xb03475,_0x236b23){return BPromise[_0xa7f9('0x38')]()[_0xa7f9('0x2a')](function(){if(_0xb53134['changed'](_0xa7f9('0xf'))||_0xb53134['changed']('context')){return _0xcc581b[_0xa7f9('0x3b')][_0xa7f9('0x3d')]({'where':{'UserId':_0xb53134['id'],'type':'system','ChanSpyId':{'$ne':null}}})[_0xa7f9('0x2a')](function(){if(_0xb53134[_0xa7f9('0xf')]){return getChanSpyPromise(_0xcc581b,_0xb53134)['then'](function(_0x17112f){if(_0x17112f&&_0x17112f[_0xa7f9('0x5')]){return _0xcc581b[_0xa7f9('0x3b')][_0xa7f9('0x3c')](_0x17112f);}});}});}})[_0xa7f9('0x2a')](function(){if(_0xb53134[_0xa7f9('0x39')](_0xa7f9('0x1f'))||_0xb53134[_0xa7f9('0x39')](_0xa7f9('0x3e'))){return _0xcc581b[_0xa7f9('0x3b')][_0xa7f9('0x3d')]({'where':{'UserId':_0xb53134['id'],'type':_0xa7f9('0x7'),'ChanSpyId':null}})['then'](function(){var _0x187051=getUserApplications(_0xb53134,_0xb53134['internal']);if(_0xb53134[_0xa7f9('0x2b')]!=_0xb53134[_0xa7f9('0x18')]){_0x187051=_0x187051[_0xa7f9('0x2c')](getUserApplications(_0xb53134,_0xb53134[_0xa7f9('0x18')]));}return _0xcc581b['VoiceExtension']['bulkCreate'](_0x187051);});}})[_0xa7f9('0x2a')](function(){_0x236b23();})[_0xa7f9('0x2d')](function(_0x31d175){_0x236b23(_0x31d175);});},'afterDestroy':function(_0x333190,_0x4ffcd0){return _0xcc581b[_0xa7f9('0x3b')][_0xa7f9('0x3d')]({'where':{'UserId':_0x333190['id'],'type':'system'}});}},'instanceMethods':{'authenticate':function(_0x27371e,_0x4c99c6){if(!_0x4c99c6){return this[_0xa7f9('0x15')]===this[_0xa7f9('0x3f')](_0x27371e);}var _0x1355b6=this;this[_0xa7f9('0x3f')](_0x27371e,function(_0x3aa05c,_0x3ac44e){if(_0x3aa05c){_0x4c99c6(_0x3aa05c);}if(_0x1355b6[_0xa7f9('0x15')]===_0x3ac44e){_0x4c99c6(null,!![]);}else{_0x4c99c6(null,![]);}});},'makeSalt':function(_0x26fdb8,_0x2f59a3){var _0x1b68cb=0x10;if(typeof arguments[0x0]===_0xa7f9('0x40')){_0x2f59a3=arguments[0x0];_0x26fdb8=_0x1b68cb;}else if(typeof arguments[0x1]===_0xa7f9('0x40')){_0x2f59a3=arguments[0x1];}else{throw new Error(_0xa7f9('0x41'));}if(!_0x26fdb8){_0x26fdb8=_0x1b68cb;}return crypto[_0xa7f9('0x42')](_0x26fdb8,function(_0x987eeb,_0x5963d2){if(_0x987eeb){_0x2f59a3(_0x987eeb);}return _0x2f59a3(null,_0x5963d2[_0xa7f9('0x43')](_0xa7f9('0x44')));});},'encryptPassword':function(_0xc49e86,_0x1344c7){if(!_0xc49e86||!this[_0xa7f9('0x45')]){return _0x1344c7?_0x1344c7(null):null;}var _0x5befd0=0x2710;var _0x258c8e=0x40;var _0x38dbe4=new Buffer(this[_0xa7f9('0x45')],_0xa7f9('0x44'));if(!_0x1344c7){return crypto['pbkdf2Sync'](_0xc49e86,_0x38dbe4,_0x5befd0,_0x258c8e,_0xa7f9('0x46'))[_0xa7f9('0x43')]('base64');}return crypto[_0xa7f9('0x47')](_0xc49e86,_0x38dbe4,_0x5befd0,_0x258c8e,_0xa7f9('0x46'),function(_0x14ae91,_0x15705d){if(_0x14ae91){_0x1344c7(_0x14ae91);}return _0x1344c7(null,_0x15705d[_0xa7f9('0x43')](_0xa7f9('0x44')));});},'updatePassword':function(_0x23bf0d){if(!this['password']){return _0x23bf0d(null);}if(!validatePresenceOf(this['password'])&&authTypes[_0xa7f9('0x48')](this[_0xa7f9('0x49')])===-0x1){_0x23bf0d(new Error(_0xa7f9('0x4a')));}var _0x54ebba=this;this[_0xa7f9('0x4b')](function(_0x387d59,_0x63401d){if(_0x387d59){return _0x23bf0d(_0x387d59);}_0x54ebba[_0xa7f9('0x45')]=_0x63401d;_0x54ebba[_0xa7f9('0x3f')](_0x54ebba['password'],function(_0x215246,_0x4ee3ec){if(_0x215246){_0x23bf0d(_0x215246);}_0x54ebba[_0xa7f9('0x15')]=_0x4ee3ec;_0x23bf0d(null);});});},'updateMd5Password':function(){this[_0xa7f9('0x4c')]=md5(this[_0xa7f9('0x18')]+_0xa7f9('0x4d')+this['password']);return this['md5secret'];}}});};
\ No newline at end of file
+var _0x8116=['options','join','StopMixMonitor','wav','WAV','gsm','context','system','CDR(type)=internal','extensionMonitor','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s','SIP/%s,,tTxXU(xcally-mixmonitor-context)','name','Dial','Hangup','priority','defaults','VoiceChanSpy','internal','concat','catch','models','User','utf8','userProfileId','undefined','UserProfile','find','privacyEnabled','then','resolve','changed','password','updateMd5Password','updatePassword','VoiceExtension','bulkCreate','destroy','encryptPassword','function','Missing\x20Callback','randomBytes','salt','base64','toString','pbkdf2','sha1','indexOf','makeSalt','md5secret','bluebird','crypto','lodash','./user.attributes','google','length','from-sip','format','%s%s','push','merge','Set','CDR(type)=%s','chanspy','record','${UNIQUEID}.%s,a','auth','ChanSpy','SIP/%s,%s'];(function(_0x37f212,_0x9bf1b2){var _0x57ba32=function(_0xb71a58){while(--_0xb71a58){_0x37f212['push'](_0x37f212['shift']());}};_0x57ba32(++_0x9bf1b2);}(_0x8116,0x105));var _0x6811=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8116[_0x321bb2];return _0x9c12ed;};'use strict';var BPromise=require(_0x6811('0x0'));var crypto=require(_0x6811('0x1'));var util=require('util');var md5=require('md5');var _=require(_0x6811('0x2'));var attributes=require(_0x6811('0x3'));var authTypes=[_0x6811('0x4')];var validatePresenceOf=function(_0x2653fb){return _0x2653fb&&_0x2653fb[_0x6811('0x5')];};var getChanSpyApplications=function(_0x1a5159,_0x274566,_0x45b0c5){var _0xfa7cb8={'context':_0x1a5159['context']||_0x6811('0x6'),'type':'system','isApp':![],'UserId':_0x1a5159['id']};var _0x4191bd=[];for(var _0x21e1b7=0x0,_0x540b27=0x1;_0x21e1b7<_0x45b0c5['length'];_0x21e1b7++,_0x540b27=0x1){var _0x33b3ab={'exten':util[_0x6811('0x7')](_0x6811('0x8'),_0x45b0c5[_0x21e1b7]['prefix'],_0x274566),'ChanSpyId':_0x45b0c5[_0x21e1b7]['id']};_0x4191bd[_0x6811('0x9')](_[_0x6811('0xa')]({'app':_0x6811('0xb'),'appdata':util[_0x6811('0x7')](_0x6811('0xc'),_0x6811('0xd')),'priority':_0x540b27++},_0xfa7cb8,_0x33b3ab));if(_0x45b0c5[_0x21e1b7][_0x6811('0xe')]){_0x4191bd[_0x6811('0x9')](_[_0x6811('0xa')]({'app':'MixMonitor','appdata':util[_0x6811('0x7')](_0x6811('0xf'),_0x45b0c5[_0x21e1b7]['recordingFormat']),'priority':_0x540b27++},_0xfa7cb8,_0x33b3ab));}if(_0x45b0c5[_0x21e1b7][_0x6811('0x10')]){_0x4191bd['push'](_[_0x6811('0xa')]({'app':'Authenticate','appdata':_0x45b0c5[_0x21e1b7]['password'],'priority':_0x540b27++},_0xfa7cb8,_0x33b3ab));}_0x4191bd['push'](_[_0x6811('0xa')]({'app':_0x6811('0x11'),'appdata':util[_0x6811('0x7')](_0x6811('0x12'),_0x1a5159['name'],_0x45b0c5[_0x21e1b7][_0x6811('0x13')]?_0x45b0c5[_0x21e1b7][_0x6811('0x13')][_0x6811('0x14')](''):''),'priority':_0x540b27++},_0xfa7cb8,_0x33b3ab));if(_0x45b0c5[_0x21e1b7][_0x6811('0xe')]){_0x4191bd[_0x6811('0x9')](_[_0x6811('0xa')]({'app':_0x6811('0x15'),'priority':_0x540b27++},_0xfa7cb8,_0x33b3ab));}}return _0x4191bd;};var getUserApplications=function(_0x504ef8,_0x9f6ee3){var _0x3a9492=[_0x6811('0x16'),_0x6811('0x17'),_0x6811('0x18')];var _0x50e899={'context':_0x504ef8[_0x6811('0x19')]||_0x6811('0x6'),'exten':_0x9f6ee3,'type':_0x6811('0x1a'),'isApp':![],'UserId':_0x504ef8['id']};var _0x2fe922=[{'app':_0x6811('0xb'),'appdata':_0x6811('0x1b')}];if(_0x504ef8[_0x6811('0x1c')]&&_['includes'](_0x3a9492,_0x504ef8[_0x6811('0x1c')])){_0x2fe922['push']({'app':_0x6811('0xb'),'appdata':_0x6811('0x1d')});_0x2fe922[_0x6811('0x9')]({'app':_0x6811('0xb'),'appdata':util[_0x6811('0x7')](_0x6811('0x1e'),_0x504ef8['extensionMonitor'])});_0x2fe922['push']({'app':'Dial','appdata':util[_0x6811('0x7')](_0x6811('0x1f'),_0x504ef8[_0x6811('0x20')])});}else{_0x2fe922[_0x6811('0x9')]({'app':_0x6811('0x21'),'appdata':util[_0x6811('0x7')]('SIP/%s,,tTxX',_0x504ef8[_0x6811('0x20')])});}_0x2fe922[_0x6811('0x9')]({'app':_0x6811('0x22')});for(var _0x3f72e3=0x0;_0x3f72e3<_0x2fe922[_0x6811('0x5')];_0x3f72e3++){_0x2fe922[_0x3f72e3][_0x6811('0x23')]=_0x3f72e3+0x1;_0x2fe922[_0x3f72e3]=_[_0x6811('0x24')](_0x2fe922[_0x3f72e3],_0x50e899);}return _0x2fe922;};var getChanSpyPromise=function(_0x406077,_0xafa88f){return new BPromise(function(_0x2293f9,_0x5578c5){return _0x406077[_0x6811('0x25')]['findAll']()['then'](function(_0x46d8d4){if(_0x46d8d4){var _0x3d0046=getChanSpyApplications(_0xafa88f,_0xafa88f[_0x6811('0x26')],_0x46d8d4);if(_0xafa88f[_0x6811('0x26')]!=_0xafa88f[_0x6811('0x20')]){_0x3d0046=_0x3d0046[_0x6811('0x27')](getChanSpyApplications(_0xafa88f,_0xafa88f[_0x6811('0x20')],_0x46d8d4));}return _0x2293f9(_0x3d0046);}return _0x2293f9([]);})[_0x6811('0x28')](function(_0x4cebf4){_0x5578c5(_0x4cebf4);});});};module['exports']=function(_0x561bf2,_0x35670b){var _0x2adc8c=_0x561bf2[_0x6811('0x29')];return _0x561bf2['define'](_0x6811('0x2a'),attributes,{'tableName':'users','charset':_0x6811('0x2b'),'collate':'utf8_bin','hooks':{'beforeCreate':function(_0x4e998c,_0x2b383f,_0x5280c5){var _0xa86f7c=typeof _0x4e998c[_0x6811('0x2c')]===_0x6811('0x2d')?BPromise['resolve'](null):_0x2adc8c[_0x6811('0x2e')][_0x6811('0x2f')]({'where':{'id':_0x4e998c['userProfileId']}});_0xa86f7c['then'](function(_0x199f47){if(_0x199f47){_0x4e998c[_0x6811('0x30')]=_0x199f47[_0x6811('0x30')];}})[_0x6811('0x31')](function(){_0x4e998c['updateMd5Password']();_0x4e998c['updatePassword'](_0x5280c5);})[_0x6811('0x28')](function(_0x13a99c){_0x5280c5(_0x13a99c);});},'beforeUpdate':function(_0x285985,_0x27bac2,_0x4616ab){Promise[_0x6811('0x32')]()['then'](function(){if(_0x285985[_0x6811('0x33')](_0x6811('0x2c'))===![])return;return _0x2adc8c[_0x6811('0x2e')][_0x6811('0x2f')]({'where':{'id':_0x285985[_0x6811('0x2c')]}})[_0x6811('0x31')](function(_0x5ed0e9){if(_0x5ed0e9)_0x285985[_0x6811('0x30')]=_0x5ed0e9[_0x6811('0x30')];return;});})[_0x6811('0x31')](function(){if(_0x285985[_0x6811('0x33')](_0x6811('0x34'))){_0x285985[_0x6811('0x35')]();return _0x285985[_0x6811('0x36')](_0x4616ab);}_0x4616ab();})[_0x6811('0x28')](function(_0x30f2c6){_0x4616ab(_0x30f2c6);});},'afterCreate':function(_0x224280,_0x384bda,_0x206766){var _0x43fcb0=getUserApplications(_0x224280,_0x224280[_0x6811('0x26')]);if(_0x224280[_0x6811('0x26')]!=_0x224280['name']){_0x43fcb0=_0x43fcb0['concat'](getUserApplications(_0x224280,_0x224280['name']));}return _0x2adc8c[_0x6811('0x37')][_0x6811('0x38')](_0x43fcb0)[_0x6811('0x31')](function(){if(_0x224280[_0x6811('0xd')]){return getChanSpyPromise(_0x2adc8c,_0x224280);}})['then'](function(_0x3ed03e){if(_0x3ed03e&&_0x3ed03e[_0x6811('0x5')]){return _0x2adc8c[_0x6811('0x37')]['bulkCreate'](_0x3ed03e);}})[_0x6811('0x31')](function(){_0x206766();})[_0x6811('0x28')](function(_0x57b233){_0x206766(_0x57b233);});},'afterUpdate':function(_0x27f66f,_0x5607c7,_0x58b2fa){return BPromise[_0x6811('0x32')]()[_0x6811('0x31')](function(){if(_0x27f66f[_0x6811('0x33')]('chanspy')||_0x27f66f[_0x6811('0x33')](_0x6811('0x19'))){return _0x2adc8c[_0x6811('0x37')][_0x6811('0x39')]({'where':{'UserId':_0x27f66f['id'],'type':_0x6811('0x1a'),'ChanSpyId':{'$ne':null}}})[_0x6811('0x31')](function(){if(_0x27f66f[_0x6811('0xd')]){return getChanSpyPromise(_0x2adc8c,_0x27f66f)['then'](function(_0x38f4b5){if(_0x38f4b5&&_0x38f4b5[_0x6811('0x5')]){return _0x2adc8c[_0x6811('0x37')][_0x6811('0x38')](_0x38f4b5);}});}});}})[_0x6811('0x31')](function(){if(_0x27f66f[_0x6811('0x33')]('extensionMonitor')||_0x27f66f['changed'](_0x6811('0x19'))){return _0x2adc8c[_0x6811('0x37')][_0x6811('0x39')]({'where':{'UserId':_0x27f66f['id'],'type':_0x6811('0x1a'),'ChanSpyId':null}})[_0x6811('0x31')](function(){var _0x3615ab=getUserApplications(_0x27f66f,_0x27f66f[_0x6811('0x26')]);if(_0x27f66f[_0x6811('0x26')]!=_0x27f66f[_0x6811('0x20')]){_0x3615ab=_0x3615ab[_0x6811('0x27')](getUserApplications(_0x27f66f,_0x27f66f[_0x6811('0x20')]));}return _0x2adc8c[_0x6811('0x37')][_0x6811('0x38')](_0x3615ab);});}})[_0x6811('0x31')](function(){_0x58b2fa();})['catch'](function(_0x1fbef5){_0x58b2fa(_0x1fbef5);});},'afterDestroy':function(_0x332e07,_0x10bb2e){return _0x2adc8c['VoiceExtension'][_0x6811('0x39')]({'where':{'UserId':_0x332e07['id'],'type':_0x6811('0x1a')}});}},'instanceMethods':{'authenticate':function(_0x432c66,_0x423ae6){if(!_0x423ae6){return this[_0x6811('0x34')]===this[_0x6811('0x3a')](_0x432c66);}var _0x49190b=this;this[_0x6811('0x3a')](_0x432c66,function(_0x17e2b4,_0x2275ef){if(_0x17e2b4){_0x423ae6(_0x17e2b4);}if(_0x49190b['password']===_0x2275ef){_0x423ae6(null,!![]);}else{_0x423ae6(null,![]);}});},'makeSalt':function(_0x2afcea,_0x4f626d){var _0x2f1761=0x10;if(typeof arguments[0x0]===_0x6811('0x3b')){_0x4f626d=arguments[0x0];_0x2afcea=_0x2f1761;}else if(typeof arguments[0x1]===_0x6811('0x3b')){_0x4f626d=arguments[0x1];}else{throw new Error(_0x6811('0x3c'));}if(!_0x2afcea){_0x2afcea=_0x2f1761;}return crypto[_0x6811('0x3d')](_0x2afcea,function(_0x465248,_0x4e33cc){if(_0x465248){_0x4f626d(_0x465248);}return _0x4f626d(null,_0x4e33cc['toString']('base64'));});},'encryptPassword':function(_0x2da4ad,_0x158b1d){if(!_0x2da4ad||!this[_0x6811('0x3e')]){return _0x158b1d?_0x158b1d(null):null;}var _0x49cc5c=0x2710;var _0xd2712=0x40;var _0x165063=new Buffer(this[_0x6811('0x3e')],_0x6811('0x3f'));if(!_0x158b1d){return crypto['pbkdf2Sync'](_0x2da4ad,_0x165063,_0x49cc5c,_0xd2712,'sha1')[_0x6811('0x40')](_0x6811('0x3f'));}return crypto[_0x6811('0x41')](_0x2da4ad,_0x165063,_0x49cc5c,_0xd2712,_0x6811('0x42'),function(_0x490c66,_0x30b863){if(_0x490c66){_0x158b1d(_0x490c66);}return _0x158b1d(null,_0x30b863[_0x6811('0x40')](_0x6811('0x3f')));});},'updatePassword':function(_0x4ab7c8){if(!this['password']){return _0x4ab7c8(null);}if(!validatePresenceOf(this[_0x6811('0x34')])&&authTypes[_0x6811('0x43')](this['provider'])===-0x1){_0x4ab7c8(new Error('Invalid\x20password'));}var _0x3f01d1=this;this[_0x6811('0x44')](function(_0x207692,_0xed4ce0){if(_0x207692){return _0x4ab7c8(_0x207692);}_0x3f01d1['salt']=_0xed4ce0;_0x3f01d1['encryptPassword'](_0x3f01d1[_0x6811('0x34')],function(_0x5147e6,_0xf8c511){if(_0x5147e6){_0x4ab7c8(_0x5147e6);}_0x3f01d1['password']=_0xf8c511;_0x4ab7c8(null);});});},'updateMd5Password':function(){this[_0x6811('0x45')]=md5(this['name']+':asterisk:'+this[_0x6811('0x34')]);return this['md5secret'];}}});};
\ No newline at end of file
index 09d9232..8ea2fdf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb764=['forEach','push','SIP/%s','PAUSE','YYYY-MM-DD\x20HH:mm:ss','body','type','DEFAULT\x20PAUSE','MemberReport','update','catch','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','voice','mail','chat','fax','openchannel','system','%s%s','Pause','all','LogoutUser','destroy','LoginUser','phone','loginInPause','count','agent','../../config/license/util','getLicense','agents','getVoiceQueues','upsert','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','http','redis','localhost','register','request','then','info','request\x20sent','debug','stringify','error','code','User,\x20%s,\x20%s','message','GetUser','User','findAll','options','where','attributes','limit','include','map','model','find','raw','ShowUser','name','role','internal','interface','UserVoiceQueueRt','length','format','getChannels'];(function(_0x19a0e1,_0x113519){var _0x4499ef=function(_0x51ea1c){while(--_0x51ea1c){_0x19a0e1['push'](_0x19a0e1['shift']());}};_0x4499ef(++_0x113519);}(_0xb764,0x7f));var _0x4b76=function(_0x7aa314,_0x10ea28){_0x7aa314=_0x7aa314-0x0;var _0x3ff9bd=_0xb764[_0x7aa314];return _0x3ff9bd;};'use strict';var _=require(_0x4b76('0x0'));var util=require(_0x4b76('0x1'));var moment=require(_0x4b76('0x2'));var BPromise=require(_0x4b76('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4b76('0x4'));var db=require(_0x4b76('0x5'))['db'];var utils=require(_0x4b76('0x6'));var logger=require('../../config/logger')(_0x4b76('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4b76('0x8')]({'port':0x232a});config[_0x4b76('0x9')]=_['defaults'](config['redis'],{'host':_0x4b76('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4b76('0x9')]));require('./user.socket')[_0x4b76('0xb')](socket);function respondWithRpcPromise(_0x2ad4e2,_0x38c8af,_0x3d92b9){return new BPromise(function(_0xcde8e7,_0x346a7a){return client[_0x4b76('0xc')](_0x2ad4e2,_0x3d92b9)[_0x4b76('0xd')](function(_0x3b0cf9){logger[_0x4b76('0xe')]('User,\x20%s,\x20%s',_0x38c8af,_0x4b76('0xf'));logger[_0x4b76('0x10')]('User,\x20%s,\x20%s,\x20%s',_0x38c8af,_0x4b76('0xf'),JSON[_0x4b76('0x11')](_0x3b0cf9));if(_0x3b0cf9[_0x4b76('0x12')]){if(_0x3b0cf9[_0x4b76('0x12')][_0x4b76('0x13')]===0x1f4){logger[_0x4b76('0x12')](_0x4b76('0x14'),_0x38c8af,_0x3b0cf9[_0x4b76('0x12')]['message']);return _0x346a7a(_0x3b0cf9[_0x4b76('0x12')][_0x4b76('0x15')]);}logger[_0x4b76('0x12')](_0x4b76('0x14'),_0x38c8af,_0x3b0cf9[_0x4b76('0x12')][_0x4b76('0x15')]);return _0xcde8e7(_0x3b0cf9['error']['message']);}else{logger['info'](_0x4b76('0x14'),_0x38c8af,_0x4b76('0xf'));_0xcde8e7(_0x3b0cf9['result'][_0x4b76('0x15')]);}})['catch'](function(_0x419dd0){logger[_0x4b76('0x12')](_0x4b76('0x14'),_0x38c8af,_0x419dd0);_0x346a7a(_0x419dd0);});});}exports[_0x4b76('0x16')]=function(_0x4b61ad){var _0xca2aa7=this;return new Promise(function(_0x3ecf1f,_0x14451f){return db[_0x4b76('0x17')][_0x4b76('0x18')]({'raw':_0x4b61ad[_0x4b76('0x19')]?_0x4b61ad[_0x4b76('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4b61ad[_0x4b76('0x19')]?_0x4b61ad[_0x4b76('0x19')][_0x4b76('0x1a')]||null:null,'attributes':_0x4b61ad[_0x4b76('0x19')]?_0x4b61ad[_0x4b76('0x19')][_0x4b76('0x1b')]||null:null,'limit':_0x4b61ad[_0x4b76('0x19')]?_0x4b61ad['options'][_0x4b76('0x1c')]||null:null,'include':_0x4b61ad[_0x4b76('0x19')]?_0x4b61ad[_0x4b76('0x19')][_0x4b76('0x1d')]?_[_0x4b76('0x1e')](_0x4b61ad['options'][_0x4b76('0x1d')],function(_0x2aa743){return{'model':db[_0x2aa743[_0x4b76('0x1f')]],'as':_0x2aa743['as'],'attributes':_0x2aa743[_0x4b76('0x1b')],'include':_0x2aa743[_0x4b76('0x1d')]?_[_0x4b76('0x1e')](_0x2aa743[_0x4b76('0x1d')],function(_0x194cc5){return{'model':db[_0x194cc5[_0x4b76('0x1f')]],'as':_0x194cc5['as'],'attributes':_0x194cc5['attributes'],'include':_0x194cc5[_0x4b76('0x1d')]?_[_0x4b76('0x1e')](_0x194cc5[_0x4b76('0x1d')],function(_0x2a8f5d){return{'model':db[_0x2a8f5d[_0x4b76('0x1f')]],'as':_0x2a8f5d['as'],'attributes':_0x2a8f5d[_0x4b76('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd6a772){logger['info'](_0x4b76('0x16'),_0x4b61ad);logger[_0x4b76('0x10')](_0x4b76('0x16'),_0x4b61ad,JSON[_0x4b76('0x11')](_0xd6a772));_0x3ecf1f(_0xd6a772);})['catch'](function(_0x16ea09){logger[_0x4b76('0x12')](_0x4b76('0x16'),_0x16ea09[_0x4b76('0x15')],_0x4b61ad);_0x14451f(_0xca2aa7[_0x4b76('0x12')](0x1f4,_0x16ea09[_0x4b76('0x15')]));});});};exports['ShowUser']=function(_0x502e39){var _0xfa0283=this;return new Promise(function(_0xf6b6db,_0x551998){return db[_0x4b76('0x17')][_0x4b76('0x20')]({'raw':_0x502e39['options']?_0x502e39[_0x4b76('0x19')][_0x4b76('0x21')]===undefined?!![]:![]:!![],'where':_0x502e39[_0x4b76('0x19')]?_0x502e39[_0x4b76('0x19')]['where']||null:null,'attributes':_0x502e39[_0x4b76('0x19')]?_0x502e39['options'][_0x4b76('0x1b')]||null:null,'include':_0x502e39['options']?_0x502e39[_0x4b76('0x19')]['include']?_[_0x4b76('0x1e')](_0x502e39[_0x4b76('0x19')][_0x4b76('0x1d')],function(_0x2577dd){return{'model':db[_0x2577dd['model']],'as':_0x2577dd['as'],'attributes':_0x2577dd[_0x4b76('0x1b')],'include':_0x2577dd[_0x4b76('0x1d')]?_[_0x4b76('0x1e')](_0x2577dd['include'],function(_0x538f36){return{'model':db[_0x538f36[_0x4b76('0x1f')]],'as':_0x538f36['as'],'attributes':_0x538f36[_0x4b76('0x1b')],'include':_0x538f36['include']?_[_0x4b76('0x1e')](_0x538f36[_0x4b76('0x1d')],function(_0x577098){return{'model':db[_0x577098[_0x4b76('0x1f')]],'as':_0x577098['as'],'attributes':_0x577098['attributes']};}):[]};}):[]};}):[]:[]})[_0x4b76('0xd')](function(_0x5c15ad){logger['info'](_0x4b76('0x22'),_0x502e39);logger[_0x4b76('0x10')](_0x4b76('0x22'),_0x502e39,JSON[_0x4b76('0x11')](_0x5c15ad));_0xf6b6db(_0x5c15ad);})['catch'](function(_0x3d9e0c){logger[_0x4b76('0x12')]('ShowUser',_0x3d9e0c[_0x4b76('0x15')],_0x502e39);_0x551998(_0xfa0283[_0x4b76('0x12')](0x1f4,_0x3d9e0c['message']));});});};exports['PauseUser']=function(_0x594788){var _0x4fa866=this;return new Promise(function(_0x3bd005,_0x2afc0b){var _0x4bacaf;return db[_0x4b76('0x17')][_0x4b76('0x20')]({'where':_0x594788[_0x4b76('0x19')][_0x4b76('0x1a')]||{},'attributes':['id',_0x4b76('0x23'),_0x4b76('0x24'),_0x4b76('0x25'),_0x4b76('0x26')]})['then'](function(_0x794375){if(_0x794375){_0x4bacaf=_0x794375;return db[_0x4b76('0x27')]['update']({'paused':0x1},{'where':{'UserId':_0x4bacaf['id']},'individualHooks':!![]});}})[_0x4b76('0xd')](function(){if(_0x4bacaf){return db['MemberReport'][_0x4b76('0x18')]({'where':{'membername':_0x4bacaf[_0x4b76('0x23')],'type':'PAUSE','exitAt':null}});}})[_0x4b76('0xd')](function(_0x1d9f03){if(_0x4bacaf){if(_0x1d9f03&&_0x1d9f03[_0x4b76('0x28')]){var _0x3dafc6=moment()[_0x4b76('0x29')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x4a8288=0x0,_0x21c7b3=_0x1d9f03[_0x4b76('0x28')];_0x4a8288<_0x21c7b3;_0x4a8288++){_0x1d9f03[_0x4a8288]['updateAttributes']({'exitAt':_0x3dafc6});}}}})[_0x4b76('0xd')](function(){if(_0x4bacaf){var _0x320c17=[];var _0x28e975=utils[_0x4b76('0x2a')]();_0x28e975[_0x4b76('0x2b')](function(_0x1d81df){_0x320c17[_0x4b76('0x2c')]({'channel':_0x1d81df,'membername':_0x4bacaf[_0x4b76('0x23')],'interface':_['isNil'](_0x4bacaf['interface'])?util[_0x4b76('0x29')](_0x4b76('0x2d'),_0x4bacaf[_0x4b76('0x23')]):_0x4bacaf[_0x4b76('0x26')],'type':_0x4b76('0x2e'),'enterAt':moment()['format'](_0x4b76('0x2f')),'data1':_0x594788[_0x4b76('0x30')][_0x4b76('0x31')]||_0x4b76('0x32'),'role':_0x4bacaf[_0x4b76('0x24')],'internal':_0x4bacaf['internal'],'uniqueid':_0x594788[_0x4b76('0x30')]['uniqueid']||null});});return db[_0x4b76('0x33')]['bulkCreate'](_0x320c17,{'individualHooks':!![]});}})[_0x4b76('0xd')](function(){if(_0x4bacaf){return _0x4bacaf[_0x4b76('0x34')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x594788[_0x4b76('0x30')]['type']||_0x4b76('0x32'),'lastPauseAt':moment()[_0x4b76('0x29')](_0x4b76('0x2f'))});}})[_0x4b76('0xd')](function(_0x2fab08){_0x3bd005(_0x2fab08);})[_0x4b76('0x35')](function(_0x5c54b9){_0x2afc0b(_0x4fa866[_0x4b76('0x12')](0x1f4,_0x5c54b9[_0x4b76('0x15')]));});});};exports[_0x4b76('0x36')]=function(_0x6bd606){var _0x42769b=this;return new Promise(function(_0x2c3a7f,_0x37f956){var _0x51c9da;return db[_0x4b76('0x17')][_0x4b76('0x37')]({'where':_0x6bd606[_0x4b76('0x19')]['where']||{},'attributes':['id',_0x4b76('0x23')]})['then'](function(_0x2df2a7){if(_0x2df2a7){_0x51c9da=_0x2df2a7;if(_0x6bd606[_0x4b76('0x30')][_0x4b76('0x38')]&&!utils[_0x4b76('0x39')](_0x6bd606[_0x4b76('0x30')]['channel'])){throw new Error(_0x4b76('0x3a'));}switch(_0x6bd606[_0x4b76('0x30')][_0x4b76('0x38')]){case _0x4b76('0x3b'):return db[_0x4b76('0x27')][_0x4b76('0x34')]({'paused':0x0},{'where':{'UserId':_0x51c9da['id']}})['then'](function(){return db[_0x4b76('0x33')]['find']({'where':{'channel':_0x6bd606[_0x4b76('0x30')][_0x4b76('0x38')],'membername':_0x51c9da[_0x4b76('0x23')],'type':_0x4b76('0x2e'),'exitAt':null}});})[_0x4b76('0xd')](function(_0x539d2a){if(_0x539d2a){return _0x539d2a[_0x4b76('0x34')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':'system'},{'individualHooks':!![]});}return null;})[_0x4b76('0xd')](function(){return _0x51c9da[_0x4b76('0x34')]({'voicePause':![]});});case _0x4b76('0x3c'):case _0x4b76('0x3d'):case _0x4b76('0x3e'):case'sms':case _0x4b76('0x3f'):case'whatsapp':return db['MemberReport'][_0x4b76('0x20')]({'where':{'channel':_0x6bd606[_0x4b76('0x30')][_0x4b76('0x38')],'membername':_0x51c9da[_0x4b76('0x23')],'type':_0x4b76('0x2e'),'exitAt':null}})[_0x4b76('0xd')](function(_0xbd7878){return _0xbd7878['update']({'exitAt':moment()[_0x4b76('0x29')](_0x4b76('0x2f')),'data2':_0x4b76('0x40')},{'individualHooks':!![]});})[_0x4b76('0xd')](function(){var _0x125ee3={};_['set'](_0x125ee3,util['format'](_0x4b76('0x41'),_0x6bd606[_0x4b76('0x30')][_0x4b76('0x38')],_0x4b76('0x42')),![]);return _0x51c9da[_0x4b76('0x34')](_0x125ee3);});default:return db[_0x4b76('0x27')][_0x4b76('0x34')]({'paused':0x0},{'where':{'UserId':_0x51c9da['id']}})[_0x4b76('0xd')](function(){return db['MemberReport'][_0x4b76('0x18')]({'where':{'membername':_0x51c9da['name'],'type':_0x4b76('0x2e'),'exitAt':null}});})[_0x4b76('0xd')](function(_0x2df662){var _0x415070=[];_0x2df662[_0x4b76('0x2b')](function(_0x2cd1e5){_0x415070['push'](_0x2cd1e5[_0x4b76('0x34')]({'exitAt':moment()[_0x4b76('0x29')](_0x4b76('0x2f')),'data2':_0x4b76('0x40')}));});return BPromise[_0x4b76('0x43')](_0x415070);})[_0x4b76('0xd')](function(){return _0x51c9da[_0x4b76('0x34')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x4b76('0xd')](function(_0x57dd76){_0x2c3a7f(_0x57dd76);})[_0x4b76('0x35')](function(_0x18d015){_0x37f956(_0x42769b[_0x4b76('0x12')](0x1f4,_0x18d015[_0x4b76('0x15')]));});});};exports[_0x4b76('0x44')]=function(_0x5d113b){var _0x33d1ce=this;return new Promise(function(_0x32300d,_0x1ee389){var _0x2b8597;return db[_0x4b76('0x17')][_0x4b76('0x37')]({'where':_0x5d113b[_0x4b76('0x19')]['where']||{},'attributes':['id',_0x4b76('0x23')]})[_0x4b76('0xd')](function(_0x24f90a){if(_0x24f90a){_0x2b8597=_0x24f90a;return db['UserVoiceQueueRt'][_0x4b76('0x45')]({'where':{'membername':_0x2b8597[_0x4b76('0x23')]},'individualHooks':!![]});}})[_0x4b76('0xd')](function(){if(_0x2b8597){return db[_0x4b76('0x33')][_0x4b76('0x18')]({'where':{'membername':_0x2b8597[_0x4b76('0x23')],'exitAt':null}});}})[_0x4b76('0xd')](function(_0x3be91d){if(_0x2b8597){if(_0x3be91d&&_0x3be91d[_0x4b76('0x28')]){var _0x240430=[];_0x3be91d[_0x4b76('0x2b')](function(_0x56ed9a){_0x240430['push'](_0x56ed9a['update']({'exitAt':moment()['format'](_0x4b76('0x2f'))}));});return BPromise['all'](_0x240430);}}})[_0x4b76('0xd')](function(){if(_0x2b8597){return _0x2b8597[_0x4b76('0x34')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x409c54){_0x32300d(_0x409c54);})[_0x4b76('0x35')](function(_0x2e5cf1){_0x1ee389(_0x33d1ce[_0x4b76('0x12')](0x1f4,_0x2e5cf1['message']));});});};exports[_0x4b76('0x46')]=function(_0xad33d1){var _0x46bbe7=this;return new Promise(function(_0x289261,_0x250c0f){var _0x456d0f;var _0x201e76;var _0x450f22;var _0x45df9f;return db['User'][_0x4b76('0x37')]({'where':_0xad33d1[_0x4b76('0x19')][_0x4b76('0x1a')]||{},'attributes':['id','name',_0x4b76('0x24'),'mobile',_0x4b76('0x47'),_0x4b76('0x25'),_0x4b76('0x48'),_0x4b76('0x26')]})[_0x4b76('0xd')](function(_0x2e86d2){if(_0x2e86d2){_0x456d0f=_0x2e86d2;_0x45df9f=_0xad33d1[_0x4b76('0x30')][_0x4b76('0x26')]?_0xad33d1[_0x4b76('0x30')][_0x4b76('0x26')]:util[_0x4b76('0x29')](_0x4b76('0x2d'),_0x456d0f[_0x4b76('0x23')]);return db[_0x4b76('0x17')][_0x4b76('0x49')]({'where':{'role':_0x4b76('0x4a'),'online':!![],'id':{'$ne':_0x456d0f['id']}}});}})['then'](function(_0x45b26a){if(_0x45b26a){_0x450f22=_0x45b26a;return require(_0x4b76('0x4b'))[_0x4b76('0x4c')]();}})['then'](function(_0x3d0f80){if(_0x3d0f80&&_0x3d0f80[_0x4b76('0x4d')]&&_0x450f22>=_0x3d0f80[_0x4b76('0x4d')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x4b76('0xd')](function(){if(_0x456d0f){return db['UserVoiceQueueRt'][_0x4b76('0x45')]({'where':{'membername':_0x456d0f[_0x4b76('0x23')]},'individualHooks':!![]});}})[_0x4b76('0xd')](function(){if(_0x456d0f){return _0x456d0f[_0x4b76('0x4e')]({'raw':!![]});}})['then'](function(_0x491d71){if(_0x456d0f){if(_0x491d71){var _0x3640f1=[];_0x201e76=_0x491d71;if(_0x201e76[_0x4b76('0x28')]){for(var _0x4875dd=0x0;_0x4875dd<_0x201e76[_0x4b76('0x28')];_0x4875dd++){_0x3640f1['push'](db[_0x4b76('0x27')][_0x4b76('0x4f')]({'membername':_0x456d0f['name'],'UserId':_0x456d0f['id'],'queue_name':_0x201e76[_0x4875dd][_0x4b76('0x23')],'VoiceQueueId':_0x201e76[_0x4875dd]['id'],'interface':_0x45df9f,'paused':_0x456d0f['loginInPause']||![],'penalty':_0x201e76[_0x4875dd]['UserVoiceQueue.penalty']||0x0}));}return BPromise['all'](_0x3640f1);}}}})[_0x4b76('0xd')](function(){if(_0x456d0f){return db[_0x4b76('0x33')][_0x4b76('0x18')]({'where':{'membername':_0x456d0f[_0x4b76('0x23')],'exitAt':null}});}})[_0x4b76('0xd')](function(_0x20767e){if(_0x456d0f){if(_0x20767e&&_0x20767e['length']){var _0x4d50c4=[];_0x20767e[_0x4b76('0x2b')](function(_0x5d8d58){_0x4d50c4['push'](_0x5d8d58[_0x4b76('0x34')]({'exitAt':moment()[_0x4b76('0x29')](_0x4b76('0x2f'))}));});return BPromise['all'](_0x4d50c4);}}})['then'](function(_0x4d16db){if(_0x456d0f){var _0x3132d8=[];var _0x5a8935=[];var _0x297d61=utils[_0x4b76('0x2a')]();var _0x283363={'membername':_0x456d0f[_0x4b76('0x23')],'interface':_0x45df9f,'enterAt':moment()[_0x4b76('0x29')](_0x4b76('0x2f')),'role':_0x456d0f[_0x4b76('0x24')],'internal':_0x456d0f['internal']};_0x297d61[_0x4b76('0x2b')](function(_0x34ab83){_0x3132d8[_0x4b76('0x2c')](_[_0x4b76('0x50')]({'channel':_0x34ab83,'type':_0x4b76('0x51'),'data1':_0x4b76('0x52'),'data2':_0x45df9f},_0x283363));if(_0x456d0f[_0x4b76('0x48')]){_0x5a8935[_0x4b76('0x2c')](_['merge']({'channel':_0x34ab83,'type':'PAUSE','data1':_0x4b76('0x53')},_0x283363));}});return db[_0x4b76('0x33')]['bulkCreate'](_0x3132d8[_0x4b76('0x54')](_0x5a8935),{'individualHooks':!![]});}})[_0x4b76('0xd')](function(){if(_0x456d0f){return _0x456d0f['update']({'online':!![],'lastLoginAt':moment()[_0x4b76('0x29')](_0x4b76('0x2f')),'voicePause':_0x456d0f[_0x4b76('0x48')]||![],'mailPause':_0x456d0f['loginInPause']||![],'chatPause':_0x456d0f[_0x4b76('0x48')]||![],'faxPause':_0x456d0f[_0x4b76('0x48')]||![],'smsPause':_0x456d0f[_0x4b76('0x48')]||![],'openchannelPause':_0x456d0f['loginInPause']||![],'pauseType':_0x456d0f[_0x4b76('0x48')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x4b76('0x29')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x45df9f});}})['then'](function(_0x184701){_0x289261(_0x184701);})[_0x4b76('0x35')](function(_0x55020e){_0x250c0f(_0x46bbe7['error'](0x1f4,_0x55020e[_0x4b76('0x15')]));});});};
\ No newline at end of file
+var _0x5a68=['debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetUser','User','findAll','options','raw','attributes','include','model','map','then','ShowUser','find','where','PauseUser','role','interface','MemberReport','name','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','isNil','SIP/%s','PAUSE','body','type','DEFAULT\x20PAUSE','internal','uniqueid','bulkCreate','update','catch','UnpauseUser','channel','isValidChannel','Unknown\x20channel','voice','UserVoiceQueueRt','system','mail','chat','fax','sms','openchannel','whatsapp','set','%s%s','forEach','push','all','LogoutUser','findOne','LoginUser','mobile','phone','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','destroy','getVoiceQueues','upsert','loginInPause','callysquare','merge','LOGININPAUSE','concat','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','info','User,\x20%s,\x20%s','request\x20sent'];(function(_0x132cdd,_0xb8b12){var _0x3df4fc=function(_0x44b17a){while(--_0x44b17a){_0x132cdd['push'](_0x132cdd['shift']());}};_0x3df4fc(++_0xb8b12);}(_0x5a68,0x1bf));var _0x85a6=function(_0x5d07f1,_0x24027b){_0x5d07f1=_0x5d07f1-0x0;var _0x1b05d5=_0x5a68[_0x5d07f1];return _0x1b05d5;};'use strict';var _=require(_0x85a6('0x0'));var util=require(_0x85a6('0x1'));var moment=require(_0x85a6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x85a6('0x3'));var db=require(_0x85a6('0x4'))['db'];var utils=require(_0x85a6('0x5'));var logger=require(_0x85a6('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x85a6('0x7'));var client=jayson['client'][_0x85a6('0x8')]({'port':0x232a});config[_0x85a6('0x9')]=_[_0x85a6('0xa')](config[_0x85a6('0x9')],{'host':_0x85a6('0xb'),'port':0x18eb});var socket=require(_0x85a6('0xc'))(new Redis(config[_0x85a6('0x9')]));require('./user.socket')[_0x85a6('0xd')](socket);function respondWithRpcPromise(_0x594534,_0x3f9c26,_0x585809){return new BPromise(function(_0x3b248c,_0x4cb331){return client[_0x85a6('0xe')](_0x594534,_0x585809)['then'](function(_0x3dd8ae){logger[_0x85a6('0xf')](_0x85a6('0x10'),_0x3f9c26,_0x85a6('0x11'));logger[_0x85a6('0x12')](_0x85a6('0x13'),_0x3f9c26,_0x85a6('0x11'),JSON[_0x85a6('0x14')](_0x3dd8ae));if(_0x3dd8ae[_0x85a6('0x15')]){if(_0x3dd8ae[_0x85a6('0x15')][_0x85a6('0x16')]===0x1f4){logger['error'](_0x85a6('0x10'),_0x3f9c26,_0x3dd8ae[_0x85a6('0x15')][_0x85a6('0x17')]);return _0x4cb331(_0x3dd8ae[_0x85a6('0x15')][_0x85a6('0x17')]);}logger[_0x85a6('0x15')](_0x85a6('0x10'),_0x3f9c26,_0x3dd8ae[_0x85a6('0x15')][_0x85a6('0x17')]);return _0x3b248c(_0x3dd8ae['error']['message']);}else{logger[_0x85a6('0xf')](_0x85a6('0x10'),_0x3f9c26,_0x85a6('0x11'));_0x3b248c(_0x3dd8ae[_0x85a6('0x18')][_0x85a6('0x17')]);}})['catch'](function(_0x119075){logger[_0x85a6('0x15')](_0x85a6('0x10'),_0x3f9c26,_0x119075);_0x4cb331(_0x119075);});});}exports[_0x85a6('0x19')]=function(_0x5a1385){var _0x29de15=this;return new Promise(function(_0x4c8a25,_0x1a925d){return db[_0x85a6('0x1a')][_0x85a6('0x1b')]({'raw':_0x5a1385[_0x85a6('0x1c')]?_0x5a1385['options'][_0x85a6('0x1d')]===undefined?!![]:![]:!![],'where':_0x5a1385[_0x85a6('0x1c')]?_0x5a1385[_0x85a6('0x1c')]['where']||null:null,'attributes':_0x5a1385[_0x85a6('0x1c')]?_0x5a1385['options'][_0x85a6('0x1e')]||null:null,'limit':_0x5a1385[_0x85a6('0x1c')]?_0x5a1385[_0x85a6('0x1c')]['limit']||null:null,'include':_0x5a1385[_0x85a6('0x1c')]?_0x5a1385['options'][_0x85a6('0x1f')]?_['map'](_0x5a1385['options'][_0x85a6('0x1f')],function(_0xdfd82f){return{'model':db[_0xdfd82f[_0x85a6('0x20')]],'as':_0xdfd82f['as'],'attributes':_0xdfd82f[_0x85a6('0x1e')],'include':_0xdfd82f[_0x85a6('0x1f')]?_[_0x85a6('0x21')](_0xdfd82f['include'],function(_0x229fc3){return{'model':db[_0x229fc3[_0x85a6('0x20')]],'as':_0x229fc3['as'],'attributes':_0x229fc3[_0x85a6('0x1e')],'include':_0x229fc3[_0x85a6('0x1f')]?_['map'](_0x229fc3[_0x85a6('0x1f')],function(_0x2193e6){return{'model':db[_0x2193e6[_0x85a6('0x20')]],'as':_0x2193e6['as'],'attributes':_0x2193e6[_0x85a6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x85a6('0x22')](function(_0x516e55){logger[_0x85a6('0xf')](_0x85a6('0x19'),_0x5a1385);logger[_0x85a6('0x12')](_0x85a6('0x19'),_0x5a1385,JSON['stringify'](_0x516e55));_0x4c8a25(_0x516e55);})['catch'](function(_0x3eed33){logger[_0x85a6('0x15')](_0x85a6('0x19'),_0x3eed33[_0x85a6('0x17')],_0x5a1385);_0x1a925d(_0x29de15[_0x85a6('0x15')](0x1f4,_0x3eed33['message']));});});};exports[_0x85a6('0x23')]=function(_0x8fdaeb){var _0x58789f=this;return new Promise(function(_0x110e64,_0x2dd242){return db[_0x85a6('0x1a')][_0x85a6('0x24')]({'raw':_0x8fdaeb[_0x85a6('0x1c')]?_0x8fdaeb['options'][_0x85a6('0x1d')]===undefined?!![]:![]:!![],'where':_0x8fdaeb['options']?_0x8fdaeb['options'][_0x85a6('0x25')]||null:null,'attributes':_0x8fdaeb[_0x85a6('0x1c')]?_0x8fdaeb['options'][_0x85a6('0x1e')]||null:null,'include':_0x8fdaeb[_0x85a6('0x1c')]?_0x8fdaeb[_0x85a6('0x1c')]['include']?_[_0x85a6('0x21')](_0x8fdaeb[_0x85a6('0x1c')][_0x85a6('0x1f')],function(_0x2d2f8c){return{'model':db[_0x2d2f8c['model']],'as':_0x2d2f8c['as'],'attributes':_0x2d2f8c['attributes'],'include':_0x2d2f8c[_0x85a6('0x1f')]?_[_0x85a6('0x21')](_0x2d2f8c[_0x85a6('0x1f')],function(_0x1ed507){return{'model':db[_0x1ed507[_0x85a6('0x20')]],'as':_0x1ed507['as'],'attributes':_0x1ed507[_0x85a6('0x1e')],'include':_0x1ed507[_0x85a6('0x1f')]?_['map'](_0x1ed507[_0x85a6('0x1f')],function(_0x27076c){return{'model':db[_0x27076c[_0x85a6('0x20')]],'as':_0x27076c['as'],'attributes':_0x27076c['attributes']};}):[]};}):[]};}):[]:[]})[_0x85a6('0x22')](function(_0x82416a){logger[_0x85a6('0xf')](_0x85a6('0x23'),_0x8fdaeb);logger[_0x85a6('0x12')]('ShowUser',_0x8fdaeb,JSON['stringify'](_0x82416a));_0x110e64(_0x82416a);})['catch'](function(_0x909990){logger['error'](_0x85a6('0x23'),_0x909990[_0x85a6('0x17')],_0x8fdaeb);_0x2dd242(_0x58789f[_0x85a6('0x15')](0x1f4,_0x909990[_0x85a6('0x17')]));});});};exports[_0x85a6('0x26')]=function(_0x31eb5a){var _0x5e06dc=this;return new Promise(function(_0x30405b,_0x2bc550){var _0x4b6b34;return db[_0x85a6('0x1a')][_0x85a6('0x24')]({'where':_0x31eb5a['options'][_0x85a6('0x25')]||{},'attributes':['id','name',_0x85a6('0x27'),'internal',_0x85a6('0x28')]})['then'](function(_0x23a293){if(_0x23a293){_0x4b6b34=_0x23a293;return db['UserVoiceQueueRt']['update']({'paused':0x1},{'where':{'UserId':_0x4b6b34['id']},'individualHooks':!![]});}})[_0x85a6('0x22')](function(){if(_0x4b6b34){return db[_0x85a6('0x29')][_0x85a6('0x1b')]({'where':{'membername':_0x4b6b34[_0x85a6('0x2a')],'type':'PAUSE','exitAt':null}});}})[_0x85a6('0x22')](function(_0xafc30f){if(_0x4b6b34){if(_0xafc30f&&_0xafc30f[_0x85a6('0x2b')]){var _0x5660e4=moment()[_0x85a6('0x2c')](_0x85a6('0x2d'));for(var _0xdd238f=0x0,_0x4c79a2=_0xafc30f['length'];_0xdd238f<_0x4c79a2;_0xdd238f++){_0xafc30f[_0xdd238f][_0x85a6('0x2e')]({'exitAt':_0x5660e4});}}}})[_0x85a6('0x22')](function(){if(_0x4b6b34){var _0x32aca8=[];var _0x754586=utils[_0x85a6('0x2f')]();_0x754586['forEach'](function(_0x1de42c){_0x32aca8['push']({'channel':_0x1de42c,'membername':_0x4b6b34[_0x85a6('0x2a')],'interface':_[_0x85a6('0x30')](_0x4b6b34['interface'])?util[_0x85a6('0x2c')](_0x85a6('0x31'),_0x4b6b34['name']):_0x4b6b34['interface'],'type':_0x85a6('0x32'),'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x31eb5a[_0x85a6('0x33')][_0x85a6('0x34')]||_0x85a6('0x35'),'role':_0x4b6b34[_0x85a6('0x27')],'internal':_0x4b6b34[_0x85a6('0x36')],'uniqueid':_0x31eb5a[_0x85a6('0x33')][_0x85a6('0x37')]||null});});return db[_0x85a6('0x29')][_0x85a6('0x38')](_0x32aca8,{'individualHooks':!![]});}})['then'](function(){if(_0x4b6b34){return _0x4b6b34[_0x85a6('0x39')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x31eb5a[_0x85a6('0x33')][_0x85a6('0x34')]||_0x85a6('0x35'),'lastPauseAt':moment()[_0x85a6('0x2c')](_0x85a6('0x2d'))});}})[_0x85a6('0x22')](function(_0x88801f){_0x30405b(_0x88801f);})[_0x85a6('0x3a')](function(_0xe169c){_0x2bc550(_0x5e06dc['error'](0x1f4,_0xe169c[_0x85a6('0x17')]));});});};exports[_0x85a6('0x3b')]=function(_0x54d57c){var _0x3d7277=this;return new Promise(function(_0x4e13df,_0x3d0fcc){var _0x34a5f1;return db[_0x85a6('0x1a')]['findOne']({'where':_0x54d57c[_0x85a6('0x1c')][_0x85a6('0x25')]||{},'attributes':['id',_0x85a6('0x2a')]})[_0x85a6('0x22')](function(_0x1391e2){if(_0x1391e2){_0x34a5f1=_0x1391e2;if(_0x54d57c[_0x85a6('0x33')][_0x85a6('0x3c')]&&!utils[_0x85a6('0x3d')](_0x54d57c[_0x85a6('0x33')][_0x85a6('0x3c')])){throw new Error(_0x85a6('0x3e'));}switch(_0x54d57c['body'][_0x85a6('0x3c')]){case _0x85a6('0x3f'):return db[_0x85a6('0x40')][_0x85a6('0x39')]({'paused':0x0},{'where':{'UserId':_0x34a5f1['id']}})['then'](function(){return db[_0x85a6('0x29')][_0x85a6('0x24')]({'where':{'channel':_0x54d57c[_0x85a6('0x33')]['channel'],'membername':_0x34a5f1[_0x85a6('0x2a')],'type':_0x85a6('0x32'),'exitAt':null}});})[_0x85a6('0x22')](function(_0x26e088){if(_0x26e088){return _0x26e088[_0x85a6('0x39')]({'exitAt':moment()[_0x85a6('0x2c')](_0x85a6('0x2d')),'data2':_0x85a6('0x41')},{'individualHooks':!![]});}return null;})[_0x85a6('0x22')](function(){return _0x34a5f1[_0x85a6('0x39')]({'voicePause':![]});});case _0x85a6('0x42'):case _0x85a6('0x43'):case _0x85a6('0x44'):case _0x85a6('0x45'):case _0x85a6('0x46'):case _0x85a6('0x47'):return db[_0x85a6('0x29')][_0x85a6('0x24')]({'where':{'channel':_0x54d57c[_0x85a6('0x33')][_0x85a6('0x3c')],'membername':_0x34a5f1[_0x85a6('0x2a')],'type':_0x85a6('0x32'),'exitAt':null}})[_0x85a6('0x22')](function(_0x3b2282){return _0x3b2282[_0x85a6('0x39')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x85a6('0x41')},{'individualHooks':!![]});})[_0x85a6('0x22')](function(){var _0x2be726={};_[_0x85a6('0x48')](_0x2be726,util[_0x85a6('0x2c')](_0x85a6('0x49'),_0x54d57c['body'][_0x85a6('0x3c')],'Pause'),![]);return _0x34a5f1[_0x85a6('0x39')](_0x2be726);});default:return db[_0x85a6('0x40')][_0x85a6('0x39')]({'paused':0x0},{'where':{'UserId':_0x34a5f1['id']}})[_0x85a6('0x22')](function(){return db[_0x85a6('0x29')][_0x85a6('0x1b')]({'where':{'membername':_0x34a5f1['name'],'type':_0x85a6('0x32'),'exitAt':null}});})['then'](function(_0x59fcf6){var _0xb18ce7=[];_0x59fcf6[_0x85a6('0x4a')](function(_0x313bd1){_0xb18ce7[_0x85a6('0x4b')](_0x313bd1[_0x85a6('0x39')]({'exitAt':moment()[_0x85a6('0x2c')](_0x85a6('0x2d')),'data2':_0x85a6('0x41')}));});return BPromise[_0x85a6('0x4c')](_0xb18ce7);})[_0x85a6('0x22')](function(){return _0x34a5f1[_0x85a6('0x39')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x85a6('0x22')](function(_0x52d0cd){_0x4e13df(_0x52d0cd);})[_0x85a6('0x3a')](function(_0x3c6b8e){_0x3d0fcc(_0x3d7277['error'](0x1f4,_0x3c6b8e['message']));});});};exports[_0x85a6('0x4d')]=function(_0x291214){var _0x52bd4e=this;return new Promise(function(_0x4a3ed9,_0x383c17){var _0x30b29c;return db[_0x85a6('0x1a')][_0x85a6('0x4e')]({'where':_0x291214[_0x85a6('0x1c')]['where']||{},'attributes':['id','name']})[_0x85a6('0x22')](function(_0x3a037f){if(_0x3a037f){_0x30b29c=_0x3a037f;return db[_0x85a6('0x40')]['destroy']({'where':{'membername':_0x30b29c[_0x85a6('0x2a')]},'individualHooks':!![]});}})[_0x85a6('0x22')](function(){if(_0x30b29c){return db[_0x85a6('0x29')][_0x85a6('0x1b')]({'where':{'membername':_0x30b29c['name'],'exitAt':null}});}})['then'](function(_0x3f8fcc){if(_0x30b29c){if(_0x3f8fcc&&_0x3f8fcc[_0x85a6('0x2b')]){var _0x38b774=[];_0x3f8fcc['forEach'](function(_0x56913b){_0x38b774[_0x85a6('0x4b')](_0x56913b[_0x85a6('0x39')]({'exitAt':moment()[_0x85a6('0x2c')](_0x85a6('0x2d'))}));});return BPromise[_0x85a6('0x4c')](_0x38b774);}}})[_0x85a6('0x22')](function(){if(_0x30b29c){return _0x30b29c[_0x85a6('0x39')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x3c6972){_0x4a3ed9(_0x3c6972);})['catch'](function(_0x117ff1){_0x383c17(_0x52bd4e[_0x85a6('0x15')](0x1f4,_0x117ff1['message']));});});};exports[_0x85a6('0x4f')]=function(_0x1685e8){var _0x3e1410=this;return new Promise(function(_0xa5d81b,_0x2cc4a9){var _0x5fe651;var _0x3e6acb;var _0x92fdad;var _0x1a32f1;return db['User'][_0x85a6('0x4e')]({'where':_0x1685e8['options'][_0x85a6('0x25')]||{},'attributes':['id',_0x85a6('0x2a'),'role',_0x85a6('0x50'),_0x85a6('0x51'),'internal','loginInPause',_0x85a6('0x28')]})[_0x85a6('0x22')](function(_0x2a5845){if(_0x2a5845){_0x5fe651=_0x2a5845;_0x1a32f1=_0x1685e8[_0x85a6('0x33')][_0x85a6('0x28')]?_0x1685e8[_0x85a6('0x33')]['interface']:util['format']('SIP/%s',_0x5fe651['name']);return db[_0x85a6('0x1a')]['count']({'where':{'role':'agent','online':!![],'id':{'$ne':_0x5fe651['id']}}});}})[_0x85a6('0x22')](function(_0x35c839){if(_0x35c839){_0x92fdad=_0x35c839;return require('../../config/license/util')[_0x85a6('0x52')]();}})['then'](function(_0x436edb){if(_0x436edb&&_0x436edb[_0x85a6('0x53')]&&_0x92fdad>=_0x436edb[_0x85a6('0x53')]){throw new Error(_0x85a6('0x54'));}})[_0x85a6('0x22')](function(){if(_0x5fe651){return db['UserVoiceQueueRt'][_0x85a6('0x55')]({'where':{'membername':_0x5fe651[_0x85a6('0x2a')]},'individualHooks':!![]});}})[_0x85a6('0x22')](function(){if(_0x5fe651){return _0x5fe651[_0x85a6('0x56')]({'raw':!![]});}})[_0x85a6('0x22')](function(_0x97f10){if(_0x5fe651){if(_0x97f10){var _0x37db18=[];_0x3e6acb=_0x97f10;if(_0x3e6acb[_0x85a6('0x2b')]){for(var _0x8fdd0e=0x0;_0x8fdd0e<_0x3e6acb['length'];_0x8fdd0e++){_0x37db18[_0x85a6('0x4b')](db[_0x85a6('0x40')][_0x85a6('0x57')]({'membername':_0x5fe651['name'],'UserId':_0x5fe651['id'],'queue_name':_0x3e6acb[_0x8fdd0e][_0x85a6('0x2a')],'VoiceQueueId':_0x3e6acb[_0x8fdd0e]['id'],'interface':_0x1a32f1,'paused':_0x5fe651[_0x85a6('0x58')]||![],'penalty':_0x3e6acb[_0x8fdd0e]['UserVoiceQueue.penalty']||0x0}));}return BPromise['all'](_0x37db18);}}}})[_0x85a6('0x22')](function(){if(_0x5fe651){return db['MemberReport']['findAll']({'where':{'membername':_0x5fe651[_0x85a6('0x2a')],'exitAt':null}});}})[_0x85a6('0x22')](function(_0x378cc3){if(_0x5fe651){if(_0x378cc3&&_0x378cc3[_0x85a6('0x2b')]){var _0x17d528=[];_0x378cc3[_0x85a6('0x4a')](function(_0x282fd9){_0x17d528['push'](_0x282fd9[_0x85a6('0x39')]({'exitAt':moment()[_0x85a6('0x2c')](_0x85a6('0x2d'))}));});return BPromise['all'](_0x17d528);}}})[_0x85a6('0x22')](function(_0xa54c0d){if(_0x5fe651){var _0x45ee49=[];var _0x2c7143=[];var _0x234e54=utils[_0x85a6('0x2f')]();var _0x5169e9={'membername':_0x5fe651['name'],'interface':_0x1a32f1,'enterAt':moment()[_0x85a6('0x2c')](_0x85a6('0x2d')),'role':_0x5fe651[_0x85a6('0x27')],'internal':_0x5fe651['internal']};_0x234e54[_0x85a6('0x4a')](function(_0x46d922){_0x45ee49[_0x85a6('0x4b')](_['merge']({'channel':_0x46d922,'type':'LOGIN','data1':_0x85a6('0x59'),'data2':_0x1a32f1},_0x5169e9));if(_0x5fe651[_0x85a6('0x58')]){_0x2c7143['push'](_[_0x85a6('0x5a')]({'channel':_0x46d922,'type':_0x85a6('0x32'),'data1':_0x85a6('0x5b')},_0x5169e9));}});return db[_0x85a6('0x29')][_0x85a6('0x38')](_0x45ee49[_0x85a6('0x5c')](_0x2c7143),{'individualHooks':!![]});}})[_0x85a6('0x22')](function(){if(_0x5fe651){return _0x5fe651[_0x85a6('0x39')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x5fe651[_0x85a6('0x58')]||![],'mailPause':_0x5fe651[_0x85a6('0x58')]||![],'chatPause':_0x5fe651[_0x85a6('0x58')]||![],'faxPause':_0x5fe651[_0x85a6('0x58')]||![],'smsPause':_0x5fe651['loginInPause']||![],'openchannelPause':_0x5fe651[_0x85a6('0x58')]||![],'pauseType':_0x5fe651[_0x85a6('0x58')]?_0x85a6('0x5b'):null,'lastPauseAt':moment()['format'](_0x85a6('0x2d')),'interface':_0x1a32f1});}})[_0x85a6('0x22')](function(_0x18f372){_0xa5d81b(_0x18f372);})['catch'](function(_0x51c182){_0x2cc4a9(_0x3e1410[_0x85a6('0x15')](0x1f4,_0x51c182[_0x85a6('0x17')]));});});};
\ No newline at end of file
index 2201f05..8337718 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60ef=['emit','removeListener','register','length','user:','./user.events','save','update'];(function(_0x4ea2dc,_0x48f726){var _0x6fe04=function(_0x2f423f){while(--_0x2f423f){_0x4ea2dc['push'](_0x4ea2dc['shift']());}};_0x6fe04(++_0x48f726);}(_0x60ef,0x7d));var _0xf60e=function(_0x1cd8ed,_0x16aed0){_0x1cd8ed=_0x1cd8ed-0x0;var _0x259a1d=_0x60ef[_0x1cd8ed];return _0x259a1d;};'use strict';var UserEvents=require(_0xf60e('0x0'));var events=[_0xf60e('0x1'),'remove',_0xf60e('0x2')];function createListener(_0x5ec678,_0x17f75b){return function(_0x428a7a){_0x17f75b[_0xf60e('0x3')](_0x5ec678,_0x428a7a);};}function removeListener(_0x64c54c,_0x5ee522){return function(){UserEvents[_0xf60e('0x4')](_0x64c54c,_0x5ee522);};}exports[_0xf60e('0x5')]=function(_0x70e16f){for(var _0x534cbe=0x0,_0x14554f=events[_0xf60e('0x6')];_0x534cbe<_0x14554f;_0x534cbe++){var _0x4d1b93=events[_0x534cbe];var _0x1601c9=createListener(_0xf60e('0x7')+_0x4d1b93,_0x70e16f);UserEvents['on'](_0x4d1b93,_0x1601c9);}};
\ No newline at end of file
+var _0xeb9f=['length','./user.events','remove','update','removeListener','register'];(function(_0x318fbe,_0x1fa59a){var _0x567981=function(_0x2e21c9){while(--_0x2e21c9){_0x318fbe['push'](_0x318fbe['shift']());}};_0x567981(++_0x1fa59a);}(_0xeb9f,0xcd));var _0xfeb9=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xeb9f[_0x4fbfd9];return _0x31dc94;};'use strict';var UserEvents=require(_0xfeb9('0x0'));var events=['save',_0xfeb9('0x1'),_0xfeb9('0x2')];function createListener(_0x4c08fa,_0x154535){return function(_0x214c18){_0x154535['emit'](_0x4c08fa,_0x214c18);};}function removeListener(_0x4ec4af,_0x48a752){return function(){UserEvents[_0xfeb9('0x3')](_0x4ec4af,_0x48a752);};}exports[_0xfeb9('0x4')]=function(_0xc565d3){for(var _0x28a20f=0x0,_0x29a40f=events[_0xfeb9('0x5')];_0x28a20f<_0x29a40f;_0x28a20f++){var _0x2f394d=events[_0x28a20f];var _0x402f79=createListener('user:'+_0x2f394d,_0xc565d3);UserEvents['on'](_0x2f394d,_0x402f79);}};
\ No newline at end of file
index 8f3e103..4673c41 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(_0x15ab15,_0x1ab4c0){var _0x2952d2=function(_0x368b2a){while(--_0x368b2a){_0x15ab15['push'](_0x15ab15['shift']());}};_0x2952d2(++_0x1ab4c0);}(_0xe706,0xa3));var _0x6e70=function(_0x5cc9ae,_0x116739){_0x5cc9ae=_0x5cc9ae-0x0;var _0xef9aa1=_0xe706[_0x5cc9ae];return _0xef9aa1;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router;
\ No newline at end of file
+var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x37c4af,_0x30622f){var _0x554849=function(_0x365001){while(--_0x365001){_0x37c4af['push'](_0x37c4af['shift']());}};_0x554849(++_0x30622f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
index 081eeea..8bde1a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a8b=['INTEGER','exports'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0x5a8b,0x16d));var _0xb5a8=function(_0x132d91,_0x4c98a8){_0x132d91=_0x132d91-0x0;var _0x233c3d=_0x5a8b[_0x132d91];return _0x233c3d;};'use strict';var Sequelize=require('sequelize');module[_0xb5a8('0x0')]={'penalty':{'type':Sequelize[_0xb5a8('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x53c8=['sequelize','exports','INTEGER'];(function(_0x1bd751,_0x1e3ca3){var _0x48c93c=function(_0x1e6b91){while(--_0x1e6b91){_0x1bd751['push'](_0x1bd751['shift']());}};_0x48c93c(++_0x1e3ca3);}(_0x53c8,0xdb));var _0x853c=function(_0x4f84c3,_0x6d094d){_0x4f84c3=_0x4f84c3-0x0;var _0x460f9f=_0x53c8[_0x4f84c3];return _0x460f9f;};'use strict';var Sequelize=require(_0x853c('0x0'));module[_0x853c('0x1')]={'penalty':{'type':Sequelize[_0x853c('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 302ffcc..095ce6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1fce=['api','moment','bluebird','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','user_has_chat_queues','lodash','util','../../config/logger'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x1fce,0x10e));var _0xe1fc=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x1fce[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0xe1fc('0x0'));var util=require(_0xe1fc('0x1'));var logger=require(_0xe1fc('0x2'))(_0xe1fc('0x3'));var moment=require(_0xe1fc('0x4'));var BPromise=require(_0xe1fc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe1fc('0x6'));var rimraf=require(_0xe1fc('0x7'));var config=require(_0xe1fc('0x8'));var attributes=require(_0xe1fc('0x9'));module[_0xe1fc('0xa')]=function(_0x345253,_0x2ec785){return _0x345253[_0xe1fc('0xb')]('UserChatQueue',attributes,{'tableName':_0xe1fc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4aba=['define','UserChatQueue','user_has_chat_queues','lodash','util','api','moment','bluebird','request-promise','../../config/environment','./userChatQueue.attributes','exports'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x4aba,0x183));var _0xa4ab=function(_0x5724dc,_0x2465af){_0x5724dc=_0x5724dc-0x0;var _0x294b7f=_0x4aba[_0x5724dc];return _0x294b7f;};'use strict';var _=require(_0xa4ab('0x0'));var util=require(_0xa4ab('0x1'));var logger=require('../../config/logger')(_0xa4ab('0x2'));var moment=require(_0xa4ab('0x3'));var BPromise=require(_0xa4ab('0x4'));var rp=require(_0xa4ab('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa4ab('0x6'));var attributes=require(_0xa4ab('0x7'));module[_0xa4ab('0x8')]=function(_0x15aaa7,_0x1b2d1d){return _0x15aaa7[_0xa4ab('0x9')](_0xa4ab('0xa'),attributes,{'tableName':_0xa4ab('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a467c00..01fc002 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01cd=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1c518c,_0x383352){var _0x2650cb=function(_0x45fe77){while(--_0x45fe77){_0x1c518c['push'](_0x1c518c['shift']());}};_0x2650cb(++_0x383352);}(_0x01cd,0x169));var _0xd01c=function(_0x363560,_0x156d88){_0x363560=_0x363560-0x0;var _0x18a1a2=_0x01cd[_0x363560];return _0x18a1a2;};'use strict';var _=require(_0xd01c('0x0'));var util=require(_0xd01c('0x1'));var moment=require(_0xd01c('0x2'));var BPromise=require(_0xd01c('0x3'));var rs=require(_0xd01c('0x4'));var fs=require('fs');var Redis=require(_0xd01c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd01c('0x6'));var logger=require(_0xd01c('0x7'))(_0xd01c('0x8'));var config=require(_0xd01c('0x9'));var jayson=require(_0xd01c('0xa'));var client=jayson['client'][_0xd01c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x305b63,_0x1732ad,_0x1cafc2){return new BPromise(function(_0x128233,_0x5c4ce6){return client[_0xd01c('0xc')](_0x305b63,_0x1cafc2)[_0xd01c('0xd')](function(_0x4e8976){logger[_0xd01c('0xe')](_0xd01c('0xf'),_0x1732ad,_0xd01c('0x10'));logger[_0xd01c('0x11')](_0xd01c('0x12'),_0x1732ad,_0xd01c('0x10'),JSON[_0xd01c('0x13')](_0x4e8976));if(_0x4e8976[_0xd01c('0x14')]){if(_0x4e8976[_0xd01c('0x14')][_0xd01c('0x15')]===0x1f4){logger['error'](_0xd01c('0xf'),_0x1732ad,_0x4e8976['error'][_0xd01c('0x16')]);return _0x5c4ce6(_0x4e8976['error'][_0xd01c('0x16')]);}logger[_0xd01c('0x14')](_0xd01c('0xf'),_0x1732ad,_0x4e8976[_0xd01c('0x14')][_0xd01c('0x16')]);return _0x128233(_0x4e8976[_0xd01c('0x14')][_0xd01c('0x16')]);}else{logger[_0xd01c('0xe')](_0xd01c('0xf'),_0x1732ad,'request\x20sent');_0x128233(_0x4e8976[_0xd01c('0x17')][_0xd01c('0x16')]);}})['catch'](function(_0x172904){logger[_0xd01c('0x14')](_0xd01c('0xf'),_0x1732ad,_0x172904);_0x5c4ce6(_0x172904);});});}
\ No newline at end of file
+var _0x7b4e=['error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3f88e3,_0x5d313e){var _0x4e0159=function(_0x556e04){while(--_0x556e04){_0x3f88e3['push'](_0x3f88e3['shift']());}};_0x4e0159(++_0x5d313e);}(_0x7b4e,0x143));var _0xe7b4=function(_0x3f0a2b,_0x13d5f8){_0x3f0a2b=_0x3f0a2b-0x0;var _0x496dee=_0x7b4e[_0x3f0a2b];return _0x496dee;};'use strict';var _=require(_0xe7b4('0x0'));var util=require('util');var moment=require(_0xe7b4('0x1'));var BPromise=require(_0xe7b4('0x2'));var rs=require(_0xe7b4('0x3'));var fs=require('fs');var Redis=require(_0xe7b4('0x4'));var db=require(_0xe7b4('0x5'))['db'];var utils=require(_0xe7b4('0x6'));var logger=require('../../config/logger')(_0xe7b4('0x7'));var config=require(_0xe7b4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe7b4('0x9')][_0xe7b4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x438ce9,_0x16fc9b,_0x21bb8a){return new BPromise(function(_0xde3730,_0x24717a){return client[_0xe7b4('0xb')](_0x438ce9,_0x21bb8a)[_0xe7b4('0xc')](function(_0x18519f){logger[_0xe7b4('0xd')](_0xe7b4('0xe'),_0x16fc9b,_0xe7b4('0xf'));logger[_0xe7b4('0x10')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x16fc9b,_0xe7b4('0xf'),JSON['stringify'](_0x18519f));if(_0x18519f[_0xe7b4('0x11')]){if(_0x18519f[_0xe7b4('0x11')]['code']===0x1f4){logger['error'](_0xe7b4('0xe'),_0x16fc9b,_0x18519f[_0xe7b4('0x11')]['message']);return _0x24717a(_0x18519f['error'][_0xe7b4('0x12')]);}logger[_0xe7b4('0x11')](_0xe7b4('0xe'),_0x16fc9b,_0x18519f['error'][_0xe7b4('0x12')]);return _0xde3730(_0x18519f[_0xe7b4('0x11')][_0xe7b4('0x12')]);}else{logger[_0xe7b4('0xd')](_0xe7b4('0xe'),_0x16fc9b,_0xe7b4('0xf'));_0xde3730(_0x18519f['result'][_0xe7b4('0x12')]);}})[_0xe7b4('0x13')](function(_0x17359f){logger['error'](_0xe7b4('0xe'),_0x16fc9b,_0x17359f);_0x24717a(_0x17359f);});});}
\ No newline at end of file
index 83c7fad..03a418e 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(_0x5d8654,_0x4175a9){var _0x39572b=function(_0x4ad6e7){while(--_0x4ad6e7){_0x5d8654['push'](_0x5d8654['shift']());}};_0x39572b(++_0x4175a9);}(_0xe706,0xa3));var _0x6e70=function(_0x314085,_0x4235c6){_0x314085=_0x314085-0x0;var _0x26190a=_0xe706[_0x314085];return _0x26190a;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router;
\ No newline at end of file
+var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x45b3b7,_0x2b645e){var _0x2849dd=function(_0x2e79bd){while(--_0x2e79bd){_0x45b3b7['push'](_0x45b3b7['shift']());}};_0x2849dd(++_0x2b645e);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'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 9631aee..4dd7f5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb630=['STRING','exports','INTEGER'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xb630,0xe8));var _0x0b63=function(_0x1d2adf,_0x8b056f){_0x1d2adf=_0x1d2adf-0x0;var _0x431bd7=_0xb630[_0x1d2adf];return _0x431bd7;};'use strict';var Sequelize=require('sequelize');module[_0x0b63('0x0')]={'penalty':{'type':Sequelize[_0x0b63('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x0b63('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x0b63('0x2')]}};
\ No newline at end of file
+var _0x6e3c=['INTEGER'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x6e3c,0xd5));var _0xc6e3=function(_0x9884e3,_0x34a043){_0x9884e3=_0x9884e3-0x0;var _0x6e3ec=_0x6e3c[_0x9884e3];return _0x6e3ec;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xc6e3('0x0')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xc6e3('0x0')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 330d320..2929477 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb739=['define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','path','rimraf','../../config/environment'];(function(_0x6b888e,_0x420fed){var _0x17d0f6=function(_0x42675a){while(--_0x42675a){_0x6b888e['push'](_0x6b888e['shift']());}};_0x17d0f6(++_0x420fed);}(_0xb739,0x12f));var _0x9b73=function(_0x579ded,_0x30e765){_0x579ded=_0x579ded-0x0;var _0x2d88d9=_0xb739[_0x579ded];return _0x2d88d9;};'use strict';var _=require(_0x9b73('0x0'));var util=require(_0x9b73('0x1'));var logger=require(_0x9b73('0x2'))(_0x9b73('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9b73('0x4'));var rimraf=require(_0x9b73('0x5'));var config=require(_0x9b73('0x6'));var attributes=require('./userFaxQueue.attributes');module['exports']=function(_0x551ea1,_0x15c7e3){return _0x551ea1[_0x9b73('0x7')](_0x9b73('0x8'),attributes,{'tableName':_0x9b73('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3599=['../../config/environment','./userFaxQueue.attributes','exports','UserFaxQueue','user_has_fax_queues','util','../../config/logger','moment','rimraf'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x3599,0xf8));var _0x9359=function(_0x4cd91b,_0x4fe507){_0x4cd91b=_0x4cd91b-0x0;var _0x2a0054=_0x3599[_0x4cd91b];return _0x2a0054;};'use strict';var _=require('lodash');var util=require(_0x9359('0x0'));var logger=require(_0x9359('0x1'))('api');var moment=require(_0x9359('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9359('0x3'));var config=require(_0x9359('0x4'));var attributes=require(_0x9359('0x5'));module[_0x9359('0x6')]=function(_0x3bc797,_0x161c26){return _0x3bc797['define'](_0x9359('0x7'),attributes,{'tableName':_0x9359('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7c5ffb6..bf0cafb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5945=['UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','UserFaxQueue,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x1128cd,_0x3391de){var _0x3b46d8=function(_0x378fd5){while(--_0x378fd5){_0x1128cd['push'](_0x1128cd['shift']());}};_0x3b46d8(++_0x3391de);}(_0x5945,0x86));var _0x5594=function(_0x272e18,_0x75e43c){_0x272e18=_0x272e18-0x0;var _0x572ca9=_0x5945[_0x272e18];return _0x572ca9;};'use strict';var _=require(_0x5594('0x0'));var util=require('util');var moment=require(_0x5594('0x1'));var BPromise=require(_0x5594('0x2'));var rs=require(_0x5594('0x3'));var fs=require('fs');var Redis=require(_0x5594('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5594('0x5'));var logger=require(_0x5594('0x6'))(_0x5594('0x7'));var config=require(_0x5594('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5594('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d6798,_0x19e0ba,_0x374d85){return new BPromise(function(_0x247439,_0x482345){return client[_0x5594('0xa')](_0x4d6798,_0x374d85)[_0x5594('0xb')](function(_0x4a3aa8){logger[_0x5594('0xc')]('UserFaxQueue,\x20%s,\x20%s',_0x19e0ba,'request\x20sent');logger['debug'](_0x5594('0xd'),_0x19e0ba,_0x5594('0xe'),JSON[_0x5594('0xf')](_0x4a3aa8));if(_0x4a3aa8[_0x5594('0x10')]){if(_0x4a3aa8[_0x5594('0x10')]['code']===0x1f4){logger[_0x5594('0x10')](_0x5594('0x11'),_0x19e0ba,_0x4a3aa8[_0x5594('0x10')][_0x5594('0x12')]);return _0x482345(_0x4a3aa8['error']['message']);}logger['error'](_0x5594('0x11'),_0x19e0ba,_0x4a3aa8[_0x5594('0x10')][_0x5594('0x12')]);return _0x247439(_0x4a3aa8[_0x5594('0x10')][_0x5594('0x12')]);}else{logger['info'](_0x5594('0x11'),_0x19e0ba,_0x5594('0xe'));_0x247439(_0x4a3aa8[_0x5594('0x13')][_0x5594('0x12')]);}})[_0x5594('0x14')](function(_0x2a9e45){logger[_0x5594('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x19e0ba,_0x2a9e45);_0x482345(_0x2a9e45);});});}
\ No newline at end of file
+var _0xc2dc=['info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xc2dc,0x1ed));var _0xcc2d=function(_0x4178af,_0x388652){_0x4178af=_0x4178af-0x0;var _0x20f4b1=_0xc2dc[_0x4178af];return _0x20f4b1;};'use strict';var _=require('lodash');var util=require(_0xcc2d('0x0'));var moment=require('moment');var BPromise=require(_0xcc2d('0x1'));var rs=require(_0xcc2d('0x2'));var fs=require('fs');var Redis=require(_0xcc2d('0x3'));var db=require(_0xcc2d('0x4'))['db'];var utils=require(_0xcc2d('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xcc2d('0x6'));var jayson=require(_0xcc2d('0x7'));var client=jayson[_0xcc2d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe4d6c6,_0x300c03,_0x71ad2f){return new BPromise(function(_0x563f0a,_0x4fe44f){return client[_0xcc2d('0x9')](_0xe4d6c6,_0x71ad2f)[_0xcc2d('0xa')](function(_0x3fc08b){logger[_0xcc2d('0xb')](_0xcc2d('0xc'),_0x300c03,_0xcc2d('0xd'));logger['debug'](_0xcc2d('0xe'),_0x300c03,_0xcc2d('0xd'),JSON[_0xcc2d('0xf')](_0x3fc08b));if(_0x3fc08b['error']){if(_0x3fc08b[_0xcc2d('0x10')][_0xcc2d('0x11')]===0x1f4){logger['error'](_0xcc2d('0xc'),_0x300c03,_0x3fc08b['error'][_0xcc2d('0x12')]);return _0x4fe44f(_0x3fc08b[_0xcc2d('0x10')]['message']);}logger[_0xcc2d('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x300c03,_0x3fc08b[_0xcc2d('0x10')][_0xcc2d('0x12')]);return _0x563f0a(_0x3fc08b[_0xcc2d('0x10')][_0xcc2d('0x12')]);}else{logger['info'](_0xcc2d('0xc'),_0x300c03,_0xcc2d('0xd'));_0x563f0a(_0x3fc08b[_0xcc2d('0x13')][_0xcc2d('0x12')]);}})[_0xcc2d('0x14')](function(_0x50d3d1){logger[_0xcc2d('0x10')](_0xcc2d('0xc'),_0x300c03,_0x50d3d1);_0x4fe44f(_0x50d3d1);});});}
\ No newline at end of file
index b30da48..e32a319 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(_0x5ce7fb,_0x69333e){var _0x146f07=function(_0x335e71){while(--_0x335e71){_0x5ce7fb['push'](_0x5ce7fb['shift']());}};_0x146f07(++_0x69333e);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
+var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xd7b331,_0x23f99d){var _0x225ef9=function(_0x3ac16a){while(--_0x3ac16a){_0xd7b331['push'](_0xd7b331['shift']());}};_0x225ef9(++_0x23f99d);}(_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
index 7a7ddc5..35b3112 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33af=['INTEGER','sequelize','exports'];(function(_0x49d27a,_0x166543){var _0x3f0b62=function(_0x4eb485){while(--_0x4eb485){_0x49d27a['push'](_0x49d27a['shift']());}};_0x3f0b62(++_0x166543);}(_0x33af,0xa3));var _0xf33a=function(_0x65d12e,_0x4b0a30){_0x65d12e=_0x65d12e-0x0;var _0x4274e0=_0x33af[_0x65d12e];return _0x4274e0;};'use strict';var Sequelize=require(_0xf33a('0x0'));module[_0xf33a('0x1')]={'penalty':{'type':Sequelize[_0xf33a('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x89d4=['INTEGER','sequelize','exports'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x89d4,0xc1));var _0x489d=function(_0x35c5a8,_0x8ecb48){_0x35c5a8=_0x35c5a8-0x0;var _0x34782c=_0x89d4[_0x35c5a8];return _0x34782c;};'use strict';var Sequelize=require(_0x489d('0x0'));module[_0x489d('0x1')]={'penalty':{'type':Sequelize[_0x489d('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 4ce0bae..3d0cb6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf0f5=['request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','UserMailQueue','util','../../config/logger','bluebird'];(function(_0x1b1c65,_0x23ca6d){var _0x1b86d9=function(_0x1e8559){while(--_0x1e8559){_0x1b1c65['push'](_0x1b1c65['shift']());}};_0x1b86d9(++_0x23ca6d);}(_0xf0f5,0x1bf));var _0x5f0f=function(_0x3d2c06,_0x3cc8f3){_0x3d2c06=_0x3d2c06-0x0;var _0x36c85f=_0xf0f5[_0x3d2c06];return _0x36c85f;};'use strict';var _=require('lodash');var util=require(_0x5f0f('0x0'));var logger=require(_0x5f0f('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5f0f('0x2'));var rp=require(_0x5f0f('0x3'));var fs=require('fs');var path=require(_0x5f0f('0x4'));var rimraf=require(_0x5f0f('0x5'));var config=require(_0x5f0f('0x6'));var attributes=require(_0x5f0f('0x7'));module['exports']=function(_0x3f167a,_0x4fc3f5){return _0x3f167a['define'](_0x5f0f('0x8'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb084=['api','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','define','UserMailQueue','lodash','../../config/logger'];(function(_0x239c5c,_0x1327c5){var _0x4672a8=function(_0x1cec43){while(--_0x1cec43){_0x239c5c['push'](_0x239c5c['shift']());}};_0x4672a8(++_0x1327c5);}(_0xb084,0x1c0));var _0x4b08=function(_0x3a1fd0,_0x2328f0){_0x3a1fd0=_0x3a1fd0-0x0;var _0x2fab36=_0xb084[_0x3a1fd0];return _0x2fab36;};'use strict';var _=require(_0x4b08('0x0'));var util=require('util');var logger=require(_0x4b08('0x1'))(_0x4b08('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4b08('0x3'));var fs=require('fs');var path=require(_0x4b08('0x4'));var rimraf=require(_0x4b08('0x5'));var config=require(_0x4b08('0x6'));var attributes=require(_0x4b08('0x7'));module['exports']=function(_0x271cab,_0x40363f){return _0x271cab[_0x4b08('0x8')](_0x4b08('0x9'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ecbea77..235fdaa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x7f7bf9,_0x3b6057){var _0x51fee6=function(_0x3aefe5){while(--_0x3aefe5){_0x7f7bf9['push'](_0x7f7bf9['shift']());}};_0x51fee6(++_0x3b6057);}(_0x00bb,0x1d8));var _0xb00b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x00bb[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});}
\ No newline at end of file
+var _0xa41a=['rpc','../../config/environment','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x493623,_0x39d028){var _0x5cf00d=function(_0x36c1fa){while(--_0x36c1fa){_0x493623['push'](_0x493623['shift']());}};_0x5cf00d(++_0x39d028);}(_0xa41a,0x6b));var _0xaa41=function(_0x28cfad,_0x431c7e){_0x28cfad=_0x28cfad-0x0;var _0x1ddea3=_0xa41a[_0x28cfad];return _0x1ddea3;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}
\ No newline at end of file
index 5618a75..848b01a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x764a=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','util','path','connect-timeout','express'];(function(_0x12dfac,_0x4e2e81){var _0x50b300=function(_0x258624){while(--_0x258624){_0x12dfac['push'](_0x12dfac['shift']());}};_0x50b300(++_0x4e2e81);}(_0x764a,0x192));var _0xa764=function(_0x466038,_0x1e1e6f){_0x466038=_0x466038-0x0;var _0x2f9df2=_0x764a[_0x466038];return _0x2f9df2;};'use strict';var multer=require('multer');var util=require(_0xa764('0x0'));var path=require(_0xa764('0x1'));var timeout=require(_0xa764('0x2'));var express=require(_0xa764('0x3'));var router=express[_0xa764('0x4')]();var fs_extra=require(_0xa764('0x5'));var auth=require(_0xa764('0x6'));var interaction=require(_0xa764('0x7'));var config=require(_0xa764('0x8'));var controller=require(_0xa764('0x9'));router[_0xa764('0xa')]('/',auth[_0xa764('0xb')](),controller[_0xa764('0xc')]);module[_0xa764('0xd')]=router;
\ No newline at end of file
+var _0x793f=['../../components/auth/service','../../components/interaction/service','post','isAuthenticated','exports','connect-timeout','express','Router','fs-extra'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x793f,0x12e));var _0xf793=function(_0x348295,_0x3daf50){_0x348295=_0x348295-0x0;var _0x32b929=_0x793f[_0x348295];return _0x32b929;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xf793('0x0'));var express=require(_0xf793('0x1'));var router=express[_0xf793('0x2')]();var fs_extra=require(_0xf793('0x3'));var auth=require(_0xf793('0x4'));var interaction=require(_0xf793('0x5'));var config=require('../../config/environment');var controller=require('./userNotification.controller');router[_0xf793('0x6')]('/',auth[_0xf793('0x7')](),controller['sendUserNotification']);module[_0xf793('0x8')]=router;
\ No newline at end of file
index b29207d..66bb66b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b76=['exports','TEXT','STRING','BOOLEAN'];(function(_0x3f2427,_0x4229cf){var _0x39c52a=function(_0x31454b){while(--_0x31454b){_0x3f2427['push'](_0x3f2427['shift']());}};_0x39c52a(++_0x4229cf);}(_0x1b76,0x150));var _0x61b7=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x1b76[_0x3c4737];return _0x2bb926;};'use strict';var Sequelize=require('sequelize');module[_0x61b7('0x0')]={'body':{'type':Sequelize[_0x61b7('0x1')]},'senderName':{'type':Sequelize[_0x61b7('0x2')]},'recipientsId':{'type':Sequelize[_0x61b7('0x1')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x61b7('0x3')]}};
\ No newline at end of file
+var _0x4e8a=['exports','TEXT','STRING','BOOLEAN'];(function(_0x1cdc10,_0x4c2794){var _0x2ed8f8=function(_0x58e1d5){while(--_0x58e1d5){_0x1cdc10['push'](_0x1cdc10['shift']());}};_0x2ed8f8(++_0x4c2794);}(_0x4e8a,0x6c));var _0xa4e8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4e8a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xa4e8('0x0')]={'body':{'type':Sequelize[_0xa4e8('0x1')]},'senderName':{'type':Sequelize[_0xa4e8('0x2')]},'recipientsId':{'type':Sequelize[_0xa4e8('0x1')]},'recipientsDescription':{'type':Sequelize[_0xa4e8('0x2')]},'beep':{'type':Sequelize[_0xa4e8('0x3')]}};
\ No newline at end of file
index 4726df1..8daa6cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcaad=['toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','fullname','recipientsDescription','beep','SenderId','recipientsId','sortBy','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','findOne','startCase','User','union','ids','queue','replace','Queue','push','all','flatten','catch','getAgents','map','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','register','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','Missing\x20\x27recipients\x27\x20parameter','parse','recipients','error','Invalid\x20\x27recipients\x27\x20object','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','includes'];(function(_0x13c554,_0xb5f3ec){var _0x4da0fd=function(_0x4d232a){while(--_0x4d232a){_0x13c554['push'](_0x13c554['shift']());}};_0x4da0fd(++_0xb5f3ec);}(_0xcaad,0x84));var _0xdcaa=function(_0x217a3e,_0x55aa51){_0x217a3e=_0x217a3e-0x0;var _0x33a803=_0xcaad[_0x217a3e];return _0x33a803;};'use strict';var emlformat=require(_0xdcaa('0x0'));var rimraf=require(_0xdcaa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdcaa('0x2'));var moment=require('moment');var BPromise=require(_0xdcaa('0x3'));var Mustache=require(_0xdcaa('0x4'));var util=require(_0xdcaa('0x5'));var path=require(_0xdcaa('0x6'));var sox=require(_0xdcaa('0x7'));var csv=require(_0xdcaa('0x8'));var ejs=require(_0xdcaa('0x9'));var fs=require('fs');var fs_extra=require(_0xdcaa('0xa'));var _=require(_0xdcaa('0xb'));var squel=require(_0xdcaa('0xc'));var crypto=require('crypto');var jsforce=require(_0xdcaa('0xd'));var deskjs=require(_0xdcaa('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdcaa('0xf'));var Papa=require(_0xdcaa('0x10'));var Redis=require(_0xdcaa('0x11'));var authService=require(_0xdcaa('0x12'));var qs=require(_0xdcaa('0x13'));var as=require(_0xdcaa('0x14'));var hardwareService=require(_0xdcaa('0x15'));var logger=require(_0xdcaa('0x16'))('api');var utils=require(_0xdcaa('0x17'));var config=require(_0xdcaa('0x18'));var licenseUtil=require(_0xdcaa('0x19'));var db=require(_0xdcaa('0x1a'))['db'];config['redis']=_[_0xdcaa('0x1b')](config['redis'],{'host':_0xdcaa('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userNotification.socket')[_0xdcaa('0x1d')](socket);function respondWithStatusCode(_0x6d6f1c,_0x3c5401){_0x3c5401=_0x3c5401||0xcc;return function(_0x423fff){if(_0x423fff){return _0x6d6f1c['sendStatus'](_0x3c5401);}return _0x6d6f1c[_0xdcaa('0x1e')](_0x3c5401)['end']();};}function respondWithResult(_0x554f98,_0x19798d){_0x19798d=_0x19798d||0xc8;return function(_0x51acd4){if(_0x51acd4){return _0x554f98[_0xdcaa('0x1e')](_0x19798d)[_0xdcaa('0x1f')](_0x51acd4);}};}function respondWithFilteredResult(_0x8f0e40,_0x4c469b){return function(_0x43508c){if(_0x43508c){var _0x3d6d72=typeof _0x4c469b[_0xdcaa('0x20')]===_0xdcaa('0x21')&&typeof _0x4c469b['limit']===_0xdcaa('0x21');var _0x4e5b44=_0x43508c[_0xdcaa('0x22')];var _0x387af1=_0x3d6d72?0x0:_0x4c469b[_0xdcaa('0x20')];var _0x2de71f=_0x3d6d72?_0x43508c[_0xdcaa('0x22')]:_0x4c469b[_0xdcaa('0x20')]+_0x4c469b[_0xdcaa('0x23')];var _0x3fbd20;if(_0x2de71f>=_0x4e5b44){_0x2de71f=_0x4e5b44;_0x3fbd20=0xc8;}else{_0x3fbd20=0xce;}_0x8f0e40[_0xdcaa('0x1e')](_0x3fbd20);return _0x8f0e40[_0xdcaa('0x24')]('Content-Range',_0x387af1+'-'+_0x2de71f+'/'+_0x4e5b44)[_0xdcaa('0x1f')](_0x43508c);}return null;};}function patchUpdates(_0x106aca){return function(_0x796735){try{jsonpatch[_0xdcaa('0x25')](_0x796735,_0x106aca,!![]);}catch(_0x2f8441){return BPromise[_0xdcaa('0x26')](_0x2f8441);}return _0x796735[_0xdcaa('0x27')]();};}function saveUpdates(_0x445804,_0x3c8696){return function(_0xb03a7d){if(_0xb03a7d){return _0xb03a7d[_0xdcaa('0x28')](_0x445804)[_0xdcaa('0x29')](function(_0x468a4f){return _0x468a4f;});}return null;};}function removeEntity(_0x1ee8c4,_0x193b16){return function(_0x52da75){if(_0x52da75){return _0x52da75[_0xdcaa('0x2a')]()[_0xdcaa('0x29')](function(){_0x1ee8c4['status'](0xcc)[_0xdcaa('0x2b')]();});}};}function handleEntityNotFound(_0x4a24c5,_0x342717){return function(_0xc61f3){if(!_0xc61f3){_0x4a24c5[_0xdcaa('0x2c')](0x194);}return _0xc61f3;};}function handleError(_0x2e72db,_0x14b6a9){_0x14b6a9=_0x14b6a9||0x1f4;return function(_0x44b796){logger['error'](_0x44b796[_0xdcaa('0x2d')]);if(_0x44b796[_0xdcaa('0x2e')]){delete _0x44b796[_0xdcaa('0x2e')];}_0x2e72db[_0xdcaa('0x1e')](_0x14b6a9)[_0xdcaa('0x2f')](_0x44b796);};}exports[_0xdcaa('0x30')]=function(_0x2bb937,_0x2d3754,_0x4318ce){if(!_0x2bb937[_0xdcaa('0x31')][_0xdcaa('0x32')](_0xdcaa('0x33'))&&!_0x2bb937[_0xdcaa('0x31')][_0xdcaa('0x32')](_0xdcaa('0x34'))){throw new db[(_0xdcaa('0x35'))][(_0xdcaa('0x36'))](_0xdcaa('0x37'));}else{if(_0x2bb937['body'][_0xdcaa('0x32')](_0xdcaa('0x34'))&&!_0x2bb937[_0xdcaa('0x31')][_0xdcaa('0x32')](_0xdcaa('0x38'))){throw new db[(_0xdcaa('0x35'))][(_0xdcaa('0x36'))](_0xdcaa('0x39'));}if(!_0x2bb937[_0xdcaa('0x31')][_0xdcaa('0x32')]('recipients')){throw new db[(_0xdcaa('0x35'))]['ValidationError'](_0xdcaa('0x3a'));}else{try{var _0x48de06=JSON[_0xdcaa('0x3b')](_0x2bb937[_0xdcaa('0x31')][_0xdcaa('0x3c')]);}catch(_0x182b48){logger[_0xdcaa('0x3d')](_0x182b48);throw new db[(_0xdcaa('0x35'))][(_0xdcaa('0x36'))](_0xdcaa('0x3e'));}var _0x58957a=['chatqueue','faxqueue',_0xdcaa('0x3f'),_0xdcaa('0x40'),_0xdcaa('0x41'),_0xdcaa('0x42'),_0xdcaa('0x43'),_0xdcaa('0x44'),'user'];if(_['some'](_0x48de06,function(_0x528b79){return!_[_0xdcaa('0x45')](_0x58957a,_0x528b79['model'][_0xdcaa('0x46')]());})){throw new db[(_0xdcaa('0x35'))]['ValidationError'](_0xdcaa('0x47'));}}}var _0x54cbb8={};_0x54cbb8['senderName']=_0x2bb937[_0xdcaa('0x31')][_0xdcaa('0x32')](_0xdcaa('0x48'))?_0x2bb937[_0xdcaa('0x31')]['senderName']:_0x2bb937[_0xdcaa('0x49')][_0xdcaa('0x4a')];_0x54cbb8[_0xdcaa('0x4b')]=_['isEmpty'](_0x2bb937['body'][_0xdcaa('0x4b')])?null:_0x2bb937['body'][_0xdcaa('0x4b')];_0x54cbb8[_0xdcaa('0x4c')]=_0x2bb937[_0xdcaa('0x31')][_0xdcaa('0x4c')]||![];_0x54cbb8[_0xdcaa('0x4d')]=_0x2bb937[_0xdcaa('0x49')]['id'];return getContent(_0x2bb937['body'])[_0xdcaa('0x29')](function(_0x3b2cf3){_0x54cbb8['body']=_0x3b2cf3;return getRecipients(_0x48de06);})[_0xdcaa('0x29')](function(_0x15ffc5){_0x54cbb8[_0xdcaa('0x4e')]=_[_0xdcaa('0x4f')](_0x15ffc5)['join'](',');return db['sequelize'][_0xdcaa('0x50')](function(_0x4fc4ab){return db[_0xdcaa('0x51')][_0xdcaa('0x52')](_0x54cbb8,{'raw':!![],'transaction':_0x4fc4ab})[_0xdcaa('0x29')](function(_0x4d6361){var _0x517671={'sender':_0x54cbb8[_0xdcaa('0x48')],'description':_0x54cbb8['recipientsDescription'],'content':_0x54cbb8[_0xdcaa('0x31')],'beep':_0x54cbb8[_0xdcaa('0x4c')]};_0x15ffc5[_0xdcaa('0x53')](function(_0x5f2e70){_0x517671[_0xdcaa('0x54')]=_0x5f2e70;socket[_0xdcaa('0x55')](_0xdcaa('0x56'),_0x517671);});return _0x4d6361;});});})[_0xdcaa('0x29')](respondWithResult(_0x2d3754,0xc9))['catch'](handleError(_0x2d3754,null));};function getContent(_0x4dbe6a){return new BPromise(function(_0x33f101,_0x2984cf){if(_0x4dbe6a['text']){_0x33f101(_0x4dbe6a[_0xdcaa('0x33')]);return;}return db['Template'][_0xdcaa('0x57')]({'attributes':['html'],'where':{'id':_0x4dbe6a[_0xdcaa('0x34')]},'raw':!![]})[_0xdcaa('0x29')](function(_0xe7407b){if(!_0xe7407b)throw new db[(_0xdcaa('0x35'))][(_0xdcaa('0x36'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x20a7e0=Mustache['render'](_0xe7407b['html'],_0x4dbe6a[_0xdcaa('0x38')]);_0x33f101(_0x20a7e0);})['catch'](function(_0x26fd67){_0x2984cf(_0x26fd67);});});}function getRecipients(_0x44a9b){return new BPromise(function(_0x301452,_0x187b46){var _0xbf1926=[];var _0x39826f=[];_0x44a9b[_0xdcaa('0x53')](function(_0x46696d){var _0x13a887=_[_0xdcaa('0x58')](_0x46696d['model']['toLowerCase']());if(_0x13a887===_0xdcaa('0x59')){_0xbf1926=_[_0xdcaa('0x5a')](_0xbf1926,_0x46696d[_0xdcaa('0x5b')]);}else{if(_[_0xdcaa('0x45')](_0x13a887,_0xdcaa('0x5c')))_0x13a887=_0x13a887[_0xdcaa('0x5d')](_0xdcaa('0x5c'),_0xdcaa('0x5e'));_0x46696d[_0xdcaa('0x5b')][_0xdcaa('0x53')](function(_0x3bd3dc){_0x39826f[_0xdcaa('0x5f')](getAgents(_0x13a887,_0x3bd3dc));});}});return BPromise[_0xdcaa('0x60')](_0x39826f)[_0xdcaa('0x29')](function(_0x4ab3db){_0xbf1926=_[_0xdcaa('0x5a')](_0xbf1926,_[_0xdcaa('0x61')](_0x4ab3db));_0x301452(_0xbf1926);})[_0xdcaa('0x62')](function(_0x58bd18){_0x187b46(_0x58bd18);});});}function getAgents(_0x4c782c,_0x494d09){return new BPromise(function(_0x241eea,_0x40dfb0){return db[_0x4c782c][_0xdcaa('0x57')]({'where':{'id':_0x494d09}})['then'](function(_0x15fe53){return _0x15fe53[_0xdcaa('0x63')]({'attributes':['id'],'raw':!![]})[_0xdcaa('0x29')](function(_0x1ba204){var _0x51e428=_[_0xdcaa('0x64')](_0x1ba204,'id');_0x241eea(_0x51e428);});})['catch'](function(_0x44217b){_0x40dfb0(_0x44217b);});});}
\ No newline at end of file
+var _0x39ba=['text','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','view','union','ids','queue','Queue','forEach','push','flatten','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','send','sendUserNotification','body','hasOwnProperty','TemplateId','ValidationError','Sequelize','Missing\x20\x27view\x27\x20parameter','Missing\x20\x27recipients\x27\x20parameter','parse','recipients','mailqueue','openchannelqueue','smsqueue','whatsappqueue','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','sortBy','join','transaction','UserNotification','recipient','emit','userNotification:send','catch'];(function(_0x1d349c,_0x17bfef){var _0x2668dc=function(_0x21694d){while(--_0x21694d){_0x1d349c['push'](_0x1d349c['shift']());}};_0x2668dc(++_0x17bfef);}(_0x39ba,0x6c));var _0xa39b=function(_0x2a1962,_0x4c8d1d){_0x2a1962=_0x2a1962-0x0;var _0x3b0f51=_0x39ba[_0x2a1962];return _0x3b0f51;};'use strict';var emlformat=require(_0xa39b('0x0'));var rimraf=require(_0xa39b('0x1'));var zipdir=require(_0xa39b('0x2'));var jsonpatch=require(_0xa39b('0x3'));var rp=require(_0xa39b('0x4'));var moment=require(_0xa39b('0x5'));var BPromise=require(_0xa39b('0x6'));var Mustache=require(_0xa39b('0x7'));var util=require(_0xa39b('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xa39b('0x9'));var ejs=require(_0xa39b('0xa'));var fs=require('fs');var fs_extra=require(_0xa39b('0xb'));var _=require(_0xa39b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa39b('0xd'));var toCsv=require(_0xa39b('0x9'));var querystring=require(_0xa39b('0xe'));var Papa=require('papaparse');var Redis=require(_0xa39b('0xf'));var authService=require(_0xa39b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa39b('0x11'));var hardwareService=require(_0xa39b('0x12'));var logger=require(_0xa39b('0x13'))(_0xa39b('0x14'));var utils=require('../../config/utils');var config=require(_0xa39b('0x15'));var licenseUtil=require(_0xa39b('0x16'));var db=require(_0xa39b('0x17'))['db'];config['redis']=_[_0xa39b('0x18')](config[_0xa39b('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xa39b('0x1a'))(new Redis(config[_0xa39b('0x19')]));require(_0xa39b('0x1b'))[_0xa39b('0x1c')](socket);function respondWithStatusCode(_0x18c14d,_0x17cb4a){_0x17cb4a=_0x17cb4a||0xcc;return function(_0x45173b){if(_0x45173b){return _0x18c14d[_0xa39b('0x1d')](_0x17cb4a);}return _0x18c14d[_0xa39b('0x1e')](_0x17cb4a)[_0xa39b('0x1f')]();};}function respondWithResult(_0x26da94,_0x7f855a){_0x7f855a=_0x7f855a||0xc8;return function(_0x59e0e3){if(_0x59e0e3){return _0x26da94[_0xa39b('0x1e')](_0x7f855a)[_0xa39b('0x20')](_0x59e0e3);}};}function respondWithFilteredResult(_0xfad3e,_0x479f06){return function(_0x39f357){if(_0x39f357){var _0x3b6c5a=typeof _0x479f06[_0xa39b('0x21')]===_0xa39b('0x22')&&typeof _0x479f06[_0xa39b('0x23')]===_0xa39b('0x22');var _0x1dc035=_0x39f357[_0xa39b('0x24')];var _0x4b2f0a=_0x3b6c5a?0x0:_0x479f06['offset'];var _0x598e98=_0x3b6c5a?_0x39f357[_0xa39b('0x24')]:_0x479f06[_0xa39b('0x21')]+_0x479f06['limit'];var _0x7ab644;if(_0x598e98>=_0x1dc035){_0x598e98=_0x1dc035;_0x7ab644=0xc8;}else{_0x7ab644=0xce;}_0xfad3e[_0xa39b('0x1e')](_0x7ab644);return _0xfad3e[_0xa39b('0x25')]('Content-Range',_0x4b2f0a+'-'+_0x598e98+'/'+_0x1dc035)[_0xa39b('0x20')](_0x39f357);}return null;};}function patchUpdates(_0x4daf7d){return function(_0x22637e){try{jsonpatch[_0xa39b('0x26')](_0x22637e,_0x4daf7d,!![]);}catch(_0x1421ea){return BPromise[_0xa39b('0x27')](_0x1421ea);}return _0x22637e[_0xa39b('0x28')]();};}function saveUpdates(_0x24f0f4,_0x6c7233){return function(_0x595738){if(_0x595738){return _0x595738[_0xa39b('0x29')](_0x24f0f4)[_0xa39b('0x2a')](function(_0x4d3e75){return _0x4d3e75;});}return null;};}function removeEntity(_0x5f345c,_0x325fd2){return function(_0xb2e1d0){if(_0xb2e1d0){return _0xb2e1d0['destroy']()[_0xa39b('0x2a')](function(){_0x5f345c[_0xa39b('0x1e')](0xcc)[_0xa39b('0x1f')]();});}};}function handleEntityNotFound(_0x27bbf2,_0x2b9fc8){return function(_0x3d0360){if(!_0x3d0360){_0x27bbf2[_0xa39b('0x1d')](0x194);}return _0x3d0360;};}function handleError(_0x43b218,_0x1b5fec){_0x1b5fec=_0x1b5fec||0x1f4;return function(_0x18e314){logger[_0xa39b('0x2b')](_0x18e314[_0xa39b('0x2c')]);if(_0x18e314[_0xa39b('0x2d')]){delete _0x18e314[_0xa39b('0x2d')];}_0x43b218[_0xa39b('0x1e')](_0x1b5fec)[_0xa39b('0x2e')](_0x18e314);};}exports[_0xa39b('0x2f')]=function(_0x38f52b,_0x43c7a2,_0xe92bb5){if(!_0x38f52b[_0xa39b('0x30')][_0xa39b('0x31')]('text')&&!_0x38f52b[_0xa39b('0x30')][_0xa39b('0x31')](_0xa39b('0x32'))){throw new db['Sequelize'][(_0xa39b('0x33'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x38f52b[_0xa39b('0x30')]['hasOwnProperty']('TemplateId')&&!_0x38f52b[_0xa39b('0x30')][_0xa39b('0x31')]('view')){throw new db[(_0xa39b('0x34'))]['ValidationError'](_0xa39b('0x35'));}if(!_0x38f52b[_0xa39b('0x30')][_0xa39b('0x31')]('recipients')){throw new db[(_0xa39b('0x34'))]['ValidationError'](_0xa39b('0x36'));}else{try{var _0x4f27ac=JSON[_0xa39b('0x37')](_0x38f52b[_0xa39b('0x30')][_0xa39b('0x38')]);}catch(_0x2dd7e5){logger[_0xa39b('0x2b')](_0x2dd7e5);throw new db['Sequelize'][(_0xa39b('0x33'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x57bb09=['chatqueue','faxqueue',_0xa39b('0x39'),_0xa39b('0x3a'),_0xa39b('0x3b'),'voicequeue',_0xa39b('0x3c'),'team',_0xa39b('0x3d')];if(_[_0xa39b('0x3e')](_0x4f27ac,function(_0x54e61d){return!_[_0xa39b('0x3f')](_0x57bb09,_0x54e61d[_0xa39b('0x40')][_0xa39b('0x41')]());})){throw new db[(_0xa39b('0x34'))]['ValidationError'](_0xa39b('0x42'));}}}var _0x2d20bc={};_0x2d20bc[_0xa39b('0x43')]=_0x38f52b[_0xa39b('0x30')][_0xa39b('0x31')]('senderName')?_0x38f52b[_0xa39b('0x30')][_0xa39b('0x43')]:_0x38f52b[_0xa39b('0x3d')][_0xa39b('0x44')];_0x2d20bc[_0xa39b('0x45')]=_['isEmpty'](_0x38f52b['body'][_0xa39b('0x45')])?null:_0x38f52b['body'][_0xa39b('0x45')];_0x2d20bc['beep']=_0x38f52b[_0xa39b('0x30')][_0xa39b('0x46')]||![];_0x2d20bc[_0xa39b('0x47')]=_0x38f52b['user']['id'];return getContent(_0x38f52b['body'])['then'](function(_0x5b06f1){_0x2d20bc['body']=_0x5b06f1;return getRecipients(_0x4f27ac);})['then'](function(_0x65a043){_0x2d20bc['recipientsId']=_[_0xa39b('0x48')](_0x65a043)[_0xa39b('0x49')](',');return db['sequelize'][_0xa39b('0x4a')](function(_0x4cc3d4){return db[_0xa39b('0x4b')]['create'](_0x2d20bc,{'raw':!![],'transaction':_0x4cc3d4})[_0xa39b('0x2a')](function(_0x5baa30){var _0x3aea97={'sender':_0x2d20bc['senderName'],'description':_0x2d20bc[_0xa39b('0x45')],'content':_0x2d20bc[_0xa39b('0x30')],'beep':_0x2d20bc[_0xa39b('0x46')]};_0x65a043['forEach'](function(_0xea5814){_0x3aea97[_0xa39b('0x4c')]=_0xea5814;socket[_0xa39b('0x4d')](_0xa39b('0x4e'),_0x3aea97);});return _0x5baa30;});});})[_0xa39b('0x2a')](respondWithResult(_0x43c7a2,0xc9))[_0xa39b('0x4f')](handleError(_0x43c7a2,null));};function getContent(_0x63ee3){return new BPromise(function(_0x5af5b2,_0x1616fe){if(_0x63ee3[_0xa39b('0x50')]){_0x5af5b2(_0x63ee3[_0xa39b('0x50')]);return;}return db[_0xa39b('0x51')][_0xa39b('0x52')]({'attributes':[_0xa39b('0x53')],'where':{'id':_0x63ee3[_0xa39b('0x32')]},'raw':!![]})['then'](function(_0x7a588){if(!_0x7a588)throw new db[(_0xa39b('0x34'))][(_0xa39b('0x33'))](_0xa39b('0x54'));var _0x48a93e=Mustache['render'](_0x7a588['html'],_0x63ee3[_0xa39b('0x55')]);_0x5af5b2(_0x48a93e);})[_0xa39b('0x4f')](function(_0x18fa18){_0x1616fe(_0x18fa18);});});}function getRecipients(_0x4cb9da){return new BPromise(function(_0x50a352,_0xc4c26d){var _0x5449ff=[];var _0x181219=[];_0x4cb9da['forEach'](function(_0xf6de3e){var _0x5e650e=_['startCase'](_0xf6de3e['model'][_0xa39b('0x41')]());if(_0x5e650e==='User'){_0x5449ff=_[_0xa39b('0x56')](_0x5449ff,_0xf6de3e[_0xa39b('0x57')]);}else{if(_[_0xa39b('0x3f')](_0x5e650e,_0xa39b('0x58')))_0x5e650e=_0x5e650e['replace'](_0xa39b('0x58'),_0xa39b('0x59'));_0xf6de3e[_0xa39b('0x57')][_0xa39b('0x5a')](function(_0x2a4985){_0x181219[_0xa39b('0x5b')](getAgents(_0x5e650e,_0x2a4985));});}});return BPromise['all'](_0x181219)['then'](function(_0x1bc4b1){_0x5449ff=_[_0xa39b('0x56')](_0x5449ff,_[_0xa39b('0x5c')](_0x1bc4b1));_0x50a352(_0x5449ff);})[_0xa39b('0x4f')](function(_0x41f910){_0xc4c26d(_0x41f910);});});}function getAgents(_0x48df87,_0x970c8b){return new BPromise(function(_0x15b469,_0x4c23ac){return db[_0x48df87][_0xa39b('0x52')]({'where':{'id':_0x970c8b}})[_0xa39b('0x2a')](function(_0x4dee6b){return _0x4dee6b[_0xa39b('0x5d')]({'attributes':['id'],'raw':!![]})[_0xa39b('0x2a')](function(_0x291dfc){var _0x161ed=_['map'](_0x291dfc,'id');_0x15b469(_0x161ed);});})[_0xa39b('0x4f')](function(_0x3a8633){_0x4c23ac(_0x3a8633);});});}
\ No newline at end of file
index f2bf8aa..37cd763 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bab=['events','../../mysqldb','UserNotification','setMaxListeners','remove','emit','hasOwnProperty','hook','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1bab,0x15f));var _0xb1ba=function(_0x7e790d,_0x392135){_0x7e790d=_0x7e790d-0x0;var _0x1c289d=_0x1bab[_0x7e790d];return _0x1c289d;};'use strict';var EventEmitter=require(_0xb1ba('0x0'));var UserNotification=require(_0xb1ba('0x1'))['db'][_0xb1ba('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xb1ba('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb1ba('0x4')};function emitEvent(_0x1cd02a){return function(_0x55d6be,_0x4be7ba,_0x3dbbfd){UserNotificationEvents['emit'](_0x1cd02a+':'+_0x55d6be['id'],_0x55d6be);UserNotificationEvents[_0xb1ba('0x5')](_0x1cd02a,_0x55d6be);_0x3dbbfd(null);};}for(var e in events){if(events[_0xb1ba('0x6')](e)){var event=events[e];UserNotification[_0xb1ba('0x7')](e,emitEvent(event));}}module[_0xb1ba('0x8')]=UserNotificationEvents;
\ No newline at end of file
+var _0x212e=['hook','exports','events','save','update','remove','emit','hasOwnProperty'];(function(_0x3457b4,_0x4cd8f9){var _0xaa8fa9=function(_0x51897a){while(--_0x51897a){_0x3457b4['push'](_0x3457b4['shift']());}};_0xaa8fa9(++_0x4cd8f9);}(_0x212e,0x13a));var _0xe212=function(_0x5404f6,_0x5900a7){_0x5404f6=_0x5404f6-0x0;var _0x13230b=_0x212e[_0x5404f6];return _0x13230b;};'use strict';var EventEmitter=require(_0xe212('0x0'));var UserNotification=require('../../mysqldb')['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe212('0x1'),'afterUpdate':_0xe212('0x2'),'afterDestroy':_0xe212('0x3')};function emitEvent(_0x46127e){return function(_0x5d550a,_0x42533d,_0x49836e){UserNotificationEvents[_0xe212('0x4')](_0x46127e+':'+_0x5d550a['id'],_0x5d550a);UserNotificationEvents[_0xe212('0x4')](_0x46127e,_0x5d550a);_0x49836e(null);};}for(var e in events){if(events[_0xe212('0x5')](e)){var event=events[e];UserNotification[_0xe212('0x6')](e,emitEvent(event));}}module[_0xe212('0x7')]=UserNotificationEvents;
\ No newline at end of file
index e6ce8cc..3828965 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c94=['util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x4b2b03,_0xbf34ee){var _0x1bf0ed=function(_0x562785){while(--_0x562785){_0x4b2b03['push'](_0x4b2b03['shift']());}};_0x1bf0ed(++_0xbf34ee);}(_0x3c94,0x111));var _0x43c9=function(_0x246115,_0x398123){_0x246115=_0x246115-0x0;var _0x385878=_0x3c94[_0x246115];return _0x385878;};'use strict';var _=require('lodash');var util=require(_0x43c9('0x0'));var logger=require('../../config/logger')(_0x43c9('0x1'));var moment=require('moment');var BPromise=require(_0x43c9('0x2'));var rp=require(_0x43c9('0x3'));var fs=require('fs');var path=require(_0x43c9('0x4'));var rimraf=require(_0x43c9('0x5'));var config=require(_0x43c9('0x6'));var attributes=require('./userNotification.attributes');module[_0x43c9('0x7')]=function(_0xfd7d8c,_0x5de54c){return _0xfd7d8c[_0x43c9('0x8')](_0x43c9('0x9'),attributes,{'tableName':_0x43c9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x43c9('0xb'),'collate':_0x43c9('0xc')});};
\ No newline at end of file
+var _0xbb8c=['path','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x3bac2b,_0x2de937){var _0xc43b6a=function(_0x1e4726){while(--_0x1e4726){_0x3bac2b['push'](_0x3bac2b['shift']());}};_0xc43b6a(++_0x2de937);}(_0xbb8c,0x14b));var _0xcbb8=function(_0x33ff99,_0x3150b7){_0x33ff99=_0x33ff99-0x0;var _0x539da6=_0xbb8c[_0x33ff99];return _0x539da6;};'use strict';var _=require(_0xcbb8('0x0'));var util=require(_0xcbb8('0x1'));var logger=require(_0xcbb8('0x2'))('api');var moment=require('moment');var BPromise=require(_0xcbb8('0x3'));var rp=require(_0xcbb8('0x4'));var fs=require('fs');var path=require(_0xcbb8('0x5'));var rimraf=require('rimraf');var config=require(_0xcbb8('0x6'));var attributes=require(_0xcbb8('0x7'));module[_0xcbb8('0x8')]=function(_0x46d7e2,_0x4e575a){return _0x46d7e2[_0xcbb8('0x9')](_0xcbb8('0xa'),attributes,{'tableName':_0xcbb8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcbb8('0xc'),'collate':_0xcbb8('0xd')});};
\ No newline at end of file
index 74c47e2..128d44f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7481=['message','UserNotification,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','redis','defaults','localhost','./userNotification.socket','register','request','then','info','request\x20sent','debug','stringify','code','error'];(function(_0x14bd4b,_0x2b01c4){var _0x344c11=function(_0x54c3f6){while(--_0x54c3f6){_0x14bd4b['push'](_0x14bd4b['shift']());}};_0x344c11(++_0x2b01c4);}(_0x7481,0x117));var _0x1748=function(_0x40701a,_0x154124){_0x40701a=_0x40701a-0x0;var _0x56ca72=_0x7481[_0x40701a];return _0x56ca72;};'use strict';var _=require('lodash');var util=require(_0x1748('0x0'));var moment=require(_0x1748('0x1'));var BPromise=require(_0x1748('0x2'));var rs=require(_0x1748('0x3'));var fs=require('fs');var Redis=require(_0x1748('0x4'));var db=require(_0x1748('0x5'))['db'];var utils=require(_0x1748('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1748('0x7')]['http']({'port':0x232a});config[_0x1748('0x8')]=_[_0x1748('0x9')](config[_0x1748('0x8')],{'host':_0x1748('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1748('0x8')]));require(_0x1748('0xb'))[_0x1748('0xc')](socket);function respondWithRpcPromise(_0x400e88,_0x492c2c,_0x347dc8){return new BPromise(function(_0x4888b5,_0x15191e){return client[_0x1748('0xd')](_0x400e88,_0x347dc8)[_0x1748('0xe')](function(_0x453ea1){logger[_0x1748('0xf')]('UserNotification,\x20%s,\x20%s',_0x492c2c,_0x1748('0x10'));logger[_0x1748('0x11')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x492c2c,'request\x20sent',JSON[_0x1748('0x12')](_0x453ea1));if(_0x453ea1['error']){if(_0x453ea1['error'][_0x1748('0x13')]===0x1f4){logger[_0x1748('0x14')]('UserNotification,\x20%s,\x20%s',_0x492c2c,_0x453ea1[_0x1748('0x14')]['message']);return _0x15191e(_0x453ea1['error'][_0x1748('0x15')]);}logger['error']('UserNotification,\x20%s,\x20%s',_0x492c2c,_0x453ea1[_0x1748('0x14')]['message']);return _0x4888b5(_0x453ea1[_0x1748('0x14')][_0x1748('0x15')]);}else{logger[_0x1748('0xf')](_0x1748('0x16'),_0x492c2c,_0x1748('0x10'));_0x4888b5(_0x453ea1[_0x1748('0x17')]['message']);}})[_0x1748('0x18')](function(_0x3f03f4){logger[_0x1748('0x14')](_0x1748('0x16'),_0x492c2c,_0x3f03f4);_0x15191e(_0x3f03f4);});});}
\ No newline at end of file
+var _0xcad6=['util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./userNotification.socket','register','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','code','error','message','result','lodash'];(function(_0x461fec,_0x204c56){var _0x2dece8=function(_0xd10069){while(--_0xd10069){_0x461fec['push'](_0x461fec['shift']());}};_0x2dece8(++_0x204c56);}(_0xcad6,0x83));var _0x6cad=function(_0x41d134,_0x2b2c81){_0x41d134=_0x41d134-0x0;var _0x8f5b28=_0xcad6[_0x41d134];return _0x8f5b28;};'use strict';var _=require(_0x6cad('0x0'));var util=require(_0x6cad('0x1'));var moment=require('moment');var BPromise=require(_0x6cad('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6cad('0x3'));var logger=require(_0x6cad('0x4'))(_0x6cad('0x5'));var config=require(_0x6cad('0x6'));var jayson=require(_0x6cad('0x7'));var client=jayson[_0x6cad('0x8')][_0x6cad('0x9')]({'port':0x232a});config[_0x6cad('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6cad('0xa')]));require(_0x6cad('0xb'))[_0x6cad('0xc')](socket);function respondWithRpcPromise(_0x2bca6b,_0x37fef6,_0x5f532b){return new BPromise(function(_0x3ce926,_0x38ce85){return client['request'](_0x2bca6b,_0x5f532b)[_0x6cad('0xd')](function(_0x5ac734){logger[_0x6cad('0xe')](_0x6cad('0xf'),_0x37fef6,_0x6cad('0x10'));logger[_0x6cad('0x11')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x37fef6,_0x6cad('0x10'),JSON['stringify'](_0x5ac734));if(_0x5ac734['error']){if(_0x5ac734['error'][_0x6cad('0x12')]===0x1f4){logger['error'](_0x6cad('0xf'),_0x37fef6,_0x5ac734[_0x6cad('0x13')][_0x6cad('0x14')]);return _0x38ce85(_0x5ac734[_0x6cad('0x13')][_0x6cad('0x14')]);}logger[_0x6cad('0x13')]('UserNotification,\x20%s,\x20%s',_0x37fef6,_0x5ac734['error'][_0x6cad('0x14')]);return _0x3ce926(_0x5ac734[_0x6cad('0x13')][_0x6cad('0x14')]);}else{logger[_0x6cad('0xe')](_0x6cad('0xf'),_0x37fef6,_0x6cad('0x10'));_0x3ce926(_0x5ac734[_0x6cad('0x15')][_0x6cad('0x14')]);}})['catch'](function(_0x345515){logger[_0x6cad('0x13')](_0x6cad('0xf'),_0x37fef6,_0x345515);_0x38ce85(_0x345515);});});}
\ No newline at end of file
index 68032ad..73d125d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe417=['removeListener','register','length','save','update','emit'];(function(_0xca4e9,_0x4724ed){var _0x24d0b5=function(_0x44bba9){while(--_0x44bba9){_0xca4e9['push'](_0xca4e9['shift']());}};_0x24d0b5(++_0x4724ed);}(_0xe417,0x117));var _0x7e41=function(_0x5aa373,_0x54c7f4){_0x5aa373=_0x5aa373-0x0;var _0x590e8e=_0xe417[_0x5aa373];return _0x590e8e;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0x7e41('0x0'),'remove',_0x7e41('0x1')];function createListener(_0x30ce87,_0xc99d64){return function(_0x4bcea3){_0xc99d64[_0x7e41('0x2')](_0x30ce87,_0x4bcea3);};}function removeListener(_0x4b2368,_0x36b720){return function(){UserNotificationEvents[_0x7e41('0x3')](_0x4b2368,_0x36b720);};}exports[_0x7e41('0x4')]=function(_0x10080f){for(var _0x2a22d6=0x0,_0x544f6b=events[_0x7e41('0x5')];_0x2a22d6<_0x544f6b;_0x2a22d6++){var _0xe66599=events[_0x2a22d6];var _0x57c1d7=createListener('userNotification:'+_0xe66599,_0x10080f);UserNotificationEvents['on'](_0xe66599,_0x57c1d7);}};
\ No newline at end of file
+var _0xe5a3=['removeListener','register','length','userNotification:','save','remove'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xe5a3,0x1d2));var _0x3e5a=function(_0x149002,_0x5dd1a1){_0x149002=_0x149002-0x0;var _0x34a418=_0xe5a3[_0x149002];return _0x34a418;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0x3e5a('0x0'),_0x3e5a('0x1'),'update'];function createListener(_0x368e7f,_0x4115ee){return function(_0x2cb45d){_0x4115ee['emit'](_0x368e7f,_0x2cb45d);};}function removeListener(_0x5c3fb6,_0x1bba21){return function(){UserNotificationEvents[_0x3e5a('0x2')](_0x5c3fb6,_0x1bba21);};}exports[_0x3e5a('0x3')]=function(_0x4db4ae){for(var _0x2c7c18=0x0,_0x5b9eec=events[_0x3e5a('0x4')];_0x2c7c18<_0x5b9eec;_0x2c7c18++){var _0x3e5181=events[_0x2c7c18];var _0x11b5be=createListener(_0x3e5a('0x5')+_0x3e5181,_0x4db4ae);UserNotificationEvents['on'](_0x3e5181,_0x11b5be);}};
\ No newline at end of file
index 99bf8c9..e5b2bef 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(_0x251681,_0x42c6f7){var _0x2c0f75=function(_0x365f49){while(--_0x365f49){_0x251681['push'](_0x251681['shift']());}};_0x2c0f75(++_0x42c6f7);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
+var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4e55a9,_0x241b22){var _0x4a9b67=function(_0x2a3bd1){while(--_0x2a3bd1){_0x4e55a9['push'](_0x4e55a9['shift']());}};_0x4a9b67(++_0x241b22);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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 e0b1a2b..9dc1487 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x696d=['INTEGER','exports'];(function(_0x50c7d6,_0x43aaed){var _0x4e1b11=function(_0x247a15){while(--_0x247a15){_0x50c7d6['push'](_0x50c7d6['shift']());}};_0x4e1b11(++_0x43aaed);}(_0x696d,0xdd));var _0xd696=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x696d[_0x13b02f];return _0x12e9a6;};'use strict';var Sequelize=require('sequelize');module[_0xd696('0x0')]={'penalty':{'type':Sequelize[_0xd696('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x60ed=['exports','INTEGER'];(function(_0x188b61,_0x3f0ed4){var _0x5517ec=function(_0x4f83e0){while(--_0x4f83e0){_0x188b61['push'](_0x188b61['shift']());}};_0x5517ec(++_0x3f0ed4);}(_0x60ed,0x118));var _0xd60e=function(_0x32ae65,_0x3e867c){_0x32ae65=_0x32ae65-0x0;var _0x3af0de=_0x60ed[_0x32ae65];return _0x3af0de;};'use strict';var Sequelize=require('sequelize');module[_0xd60e('0x0')]={'penalty':{'type':Sequelize[_0xd60e('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index 6d6b7e5..65a6e23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3d6=['lodash','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue'];(function(_0xce8f48,_0x896914){var _0x75515=function(_0xb99307){while(--_0xb99307){_0xce8f48['push'](_0xce8f48['shift']());}};_0x75515(++_0x896914);}(_0xb3d6,0xa8));var _0x6b3d=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xb3d6[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x6b3d('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6b3d('0x1'));var rimraf=require(_0x6b3d('0x2'));var config=require(_0x6b3d('0x3'));var attributes=require(_0x6b3d('0x4'));module[_0x6b3d('0x5')]=function(_0xf94659,_0x28f54c){return _0xf94659[_0x6b3d('0x6')](_0x6b3d('0x7'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf32d=['define','UserOpenchannelQueue','user_has_openchannel_queues','../../config/logger','api','request-promise','path','../../config/environment','./userOpenchannelQueue.attributes','exports'];(function(_0x1d230d,_0x312764){var _0x284ee9=function(_0x4ffde8){while(--_0x4ffde8){_0x1d230d['push'](_0x1d230d['shift']());}};_0x284ee9(++_0x312764);}(_0xf32d,0x189));var _0xdf32=function(_0x30d8a5,_0x213cc3){_0x30d8a5=_0x30d8a5-0x0;var _0x476221=_0xf32d[_0x30d8a5];return _0x476221;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdf32('0x0'))(_0xdf32('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdf32('0x2'));var fs=require('fs');var path=require(_0xdf32('0x3'));var rimraf=require('rimraf');var config=require(_0xdf32('0x4'));var attributes=require(_0xdf32('0x5'));module[_0xdf32('0x6')]=function(_0x4db9e9,_0x5a7a90){return _0x4db9e9[_0xdf32('0x7')](_0xdf32('0x8'),attributes,{'tableName':_0xdf32('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 46a39e0..c7aa3a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd227=['request\x20sent','error','message','UserOpenchannelQueue,\x20%s,\x20%s','info','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x5f226b,_0x1477be){var _0x31406d=function(_0x258dad){while(--_0x258dad){_0x5f226b['push'](_0x5f226b['shift']());}};_0x31406d(++_0x1477be);}(_0xd227,0xa6));var _0x7d22=function(_0xa1e2fd,_0x1c9305){_0xa1e2fd=_0xa1e2fd-0x0;var _0x218880=_0xd227[_0xa1e2fd];return _0x218880;};'use strict';var _=require('lodash');var util=require(_0x7d22('0x0'));var moment=require(_0x7d22('0x1'));var BPromise=require(_0x7d22('0x2'));var rs=require(_0x7d22('0x3'));var fs=require('fs');var Redis=require(_0x7d22('0x4'));var db=require(_0x7d22('0x5'))['db'];var utils=require(_0x7d22('0x6'));var logger=require(_0x7d22('0x7'))(_0x7d22('0x8'));var config=require(_0x7d22('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7d22('0xa')][_0x7d22('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b093e,_0x42a6d7,_0x160c40){return new BPromise(function(_0x55b19e,_0x3c14dd){return client[_0x7d22('0xc')](_0x4b093e,_0x160c40)[_0x7d22('0xd')](function(_0x53d047){logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x42a6d7,'request\x20sent');logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x42a6d7,_0x7d22('0xe'),JSON['stringify'](_0x53d047));if(_0x53d047[_0x7d22('0xf')]){if(_0x53d047[_0x7d22('0xf')]['code']===0x1f4){logger[_0x7d22('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x42a6d7,_0x53d047[_0x7d22('0xf')][_0x7d22('0x10')]);return _0x3c14dd(_0x53d047[_0x7d22('0xf')]['message']);}logger['error'](_0x7d22('0x11'),_0x42a6d7,_0x53d047[_0x7d22('0xf')][_0x7d22('0x10')]);return _0x55b19e(_0x53d047[_0x7d22('0xf')]['message']);}else{logger[_0x7d22('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x42a6d7,_0x7d22('0xe'));_0x55b19e(_0x53d047['result'][_0x7d22('0x10')]);}})[_0x7d22('0x13')](function(_0x19af31){logger['error'](_0x7d22('0x11'),_0x42a6d7,_0x19af31);_0x3c14dd(_0x19af31);});});}
\ No newline at end of file
+var _0x973c=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1f9a83,_0x304e0f){var _0x2b0e33=function(_0x3d8941){while(--_0x3d8941){_0x1f9a83['push'](_0x1f9a83['shift']());}};_0x2b0e33(++_0x304e0f);}(_0x973c,0x105));var _0xc973=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x973c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc973('0x0'));var util=require(_0xc973('0x1'));var moment=require(_0xc973('0x2'));var BPromise=require(_0xc973('0x3'));var rs=require(_0xc973('0x4'));var fs=require('fs');var Redis=require(_0xc973('0x5'));var db=require(_0xc973('0x6'))['db'];var utils=require(_0xc973('0x7'));var logger=require(_0xc973('0x8'))(_0xc973('0x9'));var config=require(_0xc973('0xa'));var jayson=require(_0xc973('0xb'));var client=jayson[_0xc973('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4bc515,_0x4f3be4,_0x58a1e2){return new BPromise(function(_0x2a94ae,_0x1eccf5){return client[_0xc973('0xd')](_0x4bc515,_0x58a1e2)[_0xc973('0xe')](function(_0x1f5297){logger[_0xc973('0xf')](_0xc973('0x10'),_0x4f3be4,_0xc973('0x11'));logger[_0xc973('0x12')](_0xc973('0x13'),_0x4f3be4,_0xc973('0x11'),JSON[_0xc973('0x14')](_0x1f5297));if(_0x1f5297[_0xc973('0x15')]){if(_0x1f5297['error'][_0xc973('0x16')]===0x1f4){logger[_0xc973('0x15')](_0xc973('0x10'),_0x4f3be4,_0x1f5297[_0xc973('0x15')]['message']);return _0x1eccf5(_0x1f5297[_0xc973('0x15')][_0xc973('0x17')]);}logger[_0xc973('0x15')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x4f3be4,_0x1f5297[_0xc973('0x15')][_0xc973('0x17')]);return _0x2a94ae(_0x1f5297[_0xc973('0x15')]['message']);}else{logger[_0xc973('0xf')](_0xc973('0x10'),_0x4f3be4,_0xc973('0x11'));_0x2a94ae(_0x1f5297[_0xc973('0x18')][_0xc973('0x17')]);}})[_0xc973('0x19')](function(_0x3f23a4){logger[_0xc973('0x15')](_0xc973('0x10'),_0x4f3be4,_0x3f23a4);_0x1eccf5(_0x3f23a4);});});}
\ No newline at end of file
index 8c1bed6..fac20f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36ce=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','put','destroy','delete','removeResources','exports'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x36ce,0x17a));var _0xe36c=function(_0xf20d0b,_0x443e0d){_0xf20d0b=_0xf20d0b-0x0;var _0x2bbf32=_0x36ce[_0xf20d0b];return _0x2bbf32;};'use strict';var multer=require('multer');var util=require(_0xe36c('0x0'));var path=require('path');var timeout=require(_0xe36c('0x1'));var express=require(_0xe36c('0x2'));var router=express[_0xe36c('0x3')]();var fs_extra=require(_0xe36c('0x4'));var auth=require(_0xe36c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe36c('0x6'));var controller=require('./userProfile.controller');router[_0xe36c('0x7')]('/',auth[_0xe36c('0x8')](),controller[_0xe36c('0x9')]);router['get']('/describe',auth[_0xe36c('0x8')](),controller[_0xe36c('0xa')]);router[_0xe36c('0x7')](_0xe36c('0xb'),auth[_0xe36c('0x8')](),controller[_0xe36c('0xc')]);router[_0xe36c('0x7')](_0xe36c('0xd'),auth[_0xe36c('0x8')](),controller[_0xe36c('0xe')]);router[_0xe36c('0x7')](_0xe36c('0xf'),auth[_0xe36c('0x8')](),controller[_0xe36c('0x10')]);router[_0xe36c('0x11')]('/',auth[_0xe36c('0x8')](),controller[_0xe36c('0x12')]);router[_0xe36c('0x11')](_0xe36c('0x13'),auth['isAuthenticated'](),controller[_0xe36c('0x14')]);router[_0xe36c('0x11')](_0xe36c('0xd'),auth[_0xe36c('0x8')](),controller[_0xe36c('0x15')]);router[_0xe36c('0x11')]('/:id/resources',auth[_0xe36c('0x8')](),controller['addResources']);router[_0xe36c('0x16')](_0xe36c('0xb'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xe36c('0x8')](),controller[_0xe36c('0x17')]);router[_0xe36c('0x18')](_0xe36c('0xd'),auth['isAuthenticated'](),controller['removeSections']);router[_0xe36c('0x18')]('/:id/resources',auth[_0xe36c('0x8')](),controller[_0xe36c('0x19')]);module[_0xe36c('0x1a')]=router;
\ No newline at end of file
+var _0xcc9f=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','isAuthenticated','index','/describe','get','/:id','/:id/sections','getSections','/:id/resources','getResources','post','clone','addSections','put','update','delete','removeSections','removeResources','exports'];(function(_0x417b8b,_0x3b8353){var _0x36f0e8=function(_0x131439){while(--_0x131439){_0x417b8b['push'](_0x417b8b['shift']());}};_0x36f0e8(++_0x3b8353);}(_0xcc9f,0x1a4));var _0xfcc9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcc9f[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xfcc9('0x0'));var util=require(_0xfcc9('0x1'));var path=require('path');var timeout=require(_0xfcc9('0x2'));var express=require(_0xfcc9('0x3'));var router=express[_0xfcc9('0x4')]();var fs_extra=require(_0xfcc9('0x5'));var auth=require(_0xfcc9('0x6'));var interaction=require(_0xfcc9('0x7'));var config=require(_0xfcc9('0x8'));var controller=require(_0xfcc9('0x9'));router['get']('/',auth[_0xfcc9('0xa')](),controller[_0xfcc9('0xb')]);router['get'](_0xfcc9('0xc'),auth[_0xfcc9('0xa')](),controller['describe']);router[_0xfcc9('0xd')](_0xfcc9('0xe'),auth[_0xfcc9('0xa')](),controller['show']);router['get'](_0xfcc9('0xf'),auth[_0xfcc9('0xa')](),controller[_0xfcc9('0x10')]);router[_0xfcc9('0xd')](_0xfcc9('0x11'),auth['isAuthenticated'](),controller[_0xfcc9('0x12')]);router[_0xfcc9('0x13')]('/',auth[_0xfcc9('0xa')](),controller['create']);router[_0xfcc9('0x13')]('/:id/clone',auth[_0xfcc9('0xa')](),controller[_0xfcc9('0x14')]);router[_0xfcc9('0x13')]('/:id/sections',auth[_0xfcc9('0xa')](),controller[_0xfcc9('0x15')]);router['post'](_0xfcc9('0x11'),auth['isAuthenticated'](),controller['addResources']);router[_0xfcc9('0x16')]('/:id',auth[_0xfcc9('0xa')](),controller[_0xfcc9('0x17')]);router[_0xfcc9('0x18')](_0xfcc9('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0xfcc9('0x18')](_0xfcc9('0xf'),auth[_0xfcc9('0xa')](),controller[_0xfcc9('0x19')]);router[_0xfcc9('0x18')](_0xfcc9('0x11'),auth[_0xfcc9('0xa')](),controller[_0xfcc9('0x1a')]);module[_0xfcc9('0x1b')]=router;
\ No newline at end of file
index 53b56cd..3e82200 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfec3=['exports','name','STRING','setDataValue','crudPermissions','join','getDataValue','split','BOOLEAN'];(function(_0x1bfe41,_0x5e58a3){var _0x51ad92=function(_0x5be64d){while(--_0x5be64d){_0x1bfe41['push'](_0x1bfe41['shift']());}};_0x51ad92(++_0x5e58a3);}(_0xfec3,0x168));var _0x3fec=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfec3[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0x3fec('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3fec('0x1')},'crudPermissions':{'type':Sequelize[_0x3fec('0x2')],'set':function(_0xaa01cc){this[_0x3fec('0x3')](_0x3fec('0x4'),_0xaa01cc?_0xaa01cc[_0x3fec('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x3fec('0x4'))?this[_0x3fec('0x6')](_0x3fec('0x4'))[_0x3fec('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x3fec('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x3fec('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x3fec('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x3fec('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x78e9=['crudPermissions','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','join','getDataValue'];(function(_0x2e0528,_0x358957){var _0x564fd4=function(_0x47b201){while(--_0x47b201){_0x2e0528['push'](_0x2e0528['shift']());}};_0x564fd4(++_0x358957);}(_0x78e9,0x11b));var _0x978e=function(_0x36efb6,_0x3d50ba){_0x36efb6=_0x36efb6-0x0;var _0x470de1=_0x78e9[_0x36efb6];return _0x470de1;};'use strict';var Sequelize=require(_0x978e('0x0'));module[_0x978e('0x1')]={'name':{'type':Sequelize[_0x978e('0x2')],'allowNull':![],'unique':_0x978e('0x3')},'crudPermissions':{'type':Sequelize[_0x978e('0x2')],'set':function(_0x52daac){this[_0x978e('0x4')]('crudPermissions',_0x52daac?_0x52daac[_0x978e('0x5')](''):[]);},'get':function(){return this[_0x978e('0x6')](_0x978e('0x7'))?this[_0x978e('0x6')](_0x978e('0x7'))[_0x978e('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x978e('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x978e('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x978e('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x978e('0x9')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x978e('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x978e('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x978e('0x9')],'defaultValue':!![]}};
\ No newline at end of file
index 7b3a807..727ba4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8374=['UserProfileResource','userProfileId','Resources','describe','addSections','sectionId','push','removeSections','ids','getSections','enabled','includes','subsections','findOne','Dashboard','forEach','resourceId','Plugin','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','./userProfile.socket','status','end','json','offset','undefined','limit','count','Content-Range','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','rows','catch','show','params','UserProfile','includeAll','find','create','clone','omit','createdAt','updatedAt','crudPermissions','body','sequelize','transaction','get','UserProfileSection','findAll','each','autoAssociation'];(function(_0xb24fad,_0xd58756){var _0x173226=function(_0x33b4d6){while(--_0x33b4d6){_0xb24fad['push'](_0xb24fad['shift']());}};_0x173226(++_0xd58756);}(_0x8374,0x174));var _0x4837=function(_0x4f83a6,_0x565831){_0x4f83a6=_0x4f83a6-0x0;var _0x580556=_0x8374[_0x4f83a6];return _0x580556;};'use strict';var emlformat=require(_0x4837('0x0'));var rimraf=require(_0x4837('0x1'));var zipdir=require(_0x4837('0x2'));var jsonpatch=require(_0x4837('0x3'));var rp=require(_0x4837('0x4'));var moment=require(_0x4837('0x5'));var BPromise=require(_0x4837('0x6'));var Mustache=require(_0x4837('0x7'));var util=require(_0x4837('0x8'));var path=require(_0x4837('0x9'));var sox=require(_0x4837('0xa'));var csv=require(_0x4837('0xb'));var ejs=require(_0x4837('0xc'));var fs=require('fs');var fs_extra=require(_0x4837('0xd'));var _=require('lodash');var squel=require(_0x4837('0xe'));var crypto=require('crypto');var jsforce=require(_0x4837('0xf'));var deskjs=require(_0x4837('0x10'));var toCsv=require(_0x4837('0xb'));var querystring=require(_0x4837('0x11'));var Papa=require(_0x4837('0x12'));var Redis=require(_0x4837('0x13'));var authService=require(_0x4837('0x14'));var qs=require(_0x4837('0x15'));var as=require(_0x4837('0x16'));var hardwareService=require(_0x4837('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x4837('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x4837('0x19'));var db=require(_0x4837('0x1a'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x4837('0x1b'),'port':0x18eb});var socket=require(_0x4837('0x1c'))(new Redis(config[_0x4837('0x1d')]));require(_0x4837('0x1e'))['register'](socket);function respondWithStatusCode(_0x3609d5,_0x12da7a){_0x12da7a=_0x12da7a||0xcc;return function(_0x39e5f6){if(_0x39e5f6){return _0x3609d5['sendStatus'](_0x12da7a);}return _0x3609d5[_0x4837('0x1f')](_0x12da7a)[_0x4837('0x20')]();};}function respondWithResult(_0x5d49b6,_0x216899){_0x216899=_0x216899||0xc8;return function(_0x3a6cd1){if(_0x3a6cd1){return _0x5d49b6[_0x4837('0x1f')](_0x216899)[_0x4837('0x21')](_0x3a6cd1);}};}function respondWithFilteredResult(_0x27460b,_0x2505ce){return function(_0x48b61b){if(_0x48b61b){var _0xf21681=typeof _0x2505ce[_0x4837('0x22')]===_0x4837('0x23')&&typeof _0x2505ce[_0x4837('0x24')]===_0x4837('0x23');var _0x2c1ddf=_0x48b61b[_0x4837('0x25')];var _0x4b482d=_0xf21681?0x0:_0x2505ce['offset'];var _0xdb5a0d=_0xf21681?_0x48b61b[_0x4837('0x25')]:_0x2505ce[_0x4837('0x22')]+_0x2505ce[_0x4837('0x24')];var _0x5e8f16;if(_0xdb5a0d>=_0x2c1ddf){_0xdb5a0d=_0x2c1ddf;_0x5e8f16=0xc8;}else{_0x5e8f16=0xce;}_0x27460b[_0x4837('0x1f')](_0x5e8f16);return _0x27460b['set'](_0x4837('0x26'),_0x4b482d+'-'+_0xdb5a0d+'/'+_0x2c1ddf)['json'](_0x48b61b);}return null;};}function patchUpdates(_0x55d6fa){return function(_0x2b5f1f){try{jsonpatch['apply'](_0x2b5f1f,_0x55d6fa,!![]);}catch(_0x4988f5){return BPromise['reject'](_0x4988f5);}return _0x2b5f1f[_0x4837('0x27')]();};}function saveUpdates(_0x2d820a,_0x4bbfbd){return function(_0x36b841){if(_0x36b841){return _0x36b841[_0x4837('0x28')](_0x2d820a)['then'](function(_0x3fa5ad){return _0x3fa5ad;});}return null;};}function removeEntity(_0x127ab9,_0x4d4278){return function(_0x2f1f0a){if(_0x2f1f0a){return _0x2f1f0a[_0x4837('0x29')]()[_0x4837('0x2a')](function(){_0x127ab9[_0x4837('0x1f')](0xcc)[_0x4837('0x20')]();});}};}function handleEntityNotFound(_0x5c07db,_0x2a7dfd){return function(_0x153bc7){if(!_0x153bc7){_0x5c07db[_0x4837('0x2b')](0x194);}return _0x153bc7;};}function handleError(_0x314bee,_0x569d19){_0x569d19=_0x569d19||0x1f4;return function(_0x17266c){logger[_0x4837('0x2c')](_0x17266c[_0x4837('0x2d')]);if(_0x17266c['name']){delete _0x17266c[_0x4837('0x2e')];}_0x314bee[_0x4837('0x1f')](_0x569d19)[_0x4837('0x2f')](_0x17266c);};}exports[_0x4837('0x30')]=function(_0x594039,_0x18c7a7){var _0xf3e0d7={},_0x139e3c={},_0xccb861={'count':0x0,'rows':[]};var _0x569ae1=_[_0x4837('0x31')](db['UserProfile'][_0x4837('0x32')],function(_0x57a511){return{'name':_0x57a511[_0x4837('0x33')],'type':_0x57a511[_0x4837('0x34')][_0x4837('0x35')]};});_0x139e3c['model']=_['map'](_0x569ae1,_0x4837('0x2e'));_0x139e3c[_0x4837('0x36')]=_[_0x4837('0x37')](_0x594039[_0x4837('0x36')]);_0x139e3c[_0x4837('0x38')]=_['intersection'](_0x139e3c[_0x4837('0x39')],_0x139e3c[_0x4837('0x36')]);_0xf3e0d7['attributes']=_[_0x4837('0x3a')](_0x139e3c['model'],qs[_0x4837('0x3b')](_0x594039['query']['fields']));_0xf3e0d7[_0x4837('0x3c')]=_0xf3e0d7[_0x4837('0x3c')][_0x4837('0x3d')]?_0xf3e0d7['attributes']:_0x139e3c[_0x4837('0x39')];if(!_0x594039[_0x4837('0x36')]['hasOwnProperty'](_0x4837('0x3e'))){_0xf3e0d7['limit']=qs[_0x4837('0x24')](_0x594039[_0x4837('0x36')][_0x4837('0x24')]);_0xf3e0d7[_0x4837('0x22')]=qs['offset'](_0x594039[_0x4837('0x36')][_0x4837('0x22')]);}_0xf3e0d7[_0x4837('0x3f')]=qs[_0x4837('0x40')](_0x594039[_0x4837('0x36')][_0x4837('0x40')]);_0xf3e0d7['where']=qs[_0x4837('0x38')](_['pick'](_0x594039[_0x4837('0x36')],_0x139e3c[_0x4837('0x38')]),_0x569ae1);if(_0x594039['query']['filter']){_0xf3e0d7[_0x4837('0x41')]=_[_0x4837('0x42')](_0xf3e0d7[_0x4837('0x41')],{'$or':_[_0x4837('0x31')](_0x569ae1,function(_0x45cda5){if(_0x45cda5[_0x4837('0x34')]!==_0x4837('0x43')){var _0xb44dd={};_0xb44dd[_0x45cda5[_0x4837('0x2e')]]={'$like':'%'+_0x594039[_0x4837('0x36')][_0x4837('0x44')]+'%'};return _0xb44dd;}})});}_0xf3e0d7=_[_0x4837('0x42')]({},_0xf3e0d7,_0x594039[_0x4837('0x45')]);var _0x416ecc={'where':_0xf3e0d7['where']};return db['UserProfile'][_0x4837('0x25')](_0x416ecc)[_0x4837('0x2a')](function(_0x4d2b7e){_0xccb861[_0x4837('0x25')]=_0x4d2b7e;if(_0x594039['query']['includeAll']){_0xf3e0d7[_0x4837('0x46')]=[{'all':!![]}];}return db['UserProfile']['findAll'](_0xf3e0d7);})[_0x4837('0x2a')](function(_0x230f85){_0xccb861[_0x4837('0x47')]=_0x230f85;return _0xccb861;})['then'](respondWithFilteredResult(_0x18c7a7,_0xf3e0d7))[_0x4837('0x48')](handleError(_0x18c7a7,null));};exports[_0x4837('0x49')]=function(_0x545818,_0x16fc81){var _0x41e653={'raw':![],'where':{'id':_0x545818[_0x4837('0x4a')]['id']}},_0x264e60={};_0x264e60[_0x4837('0x39')]=_[_0x4837('0x37')](db[_0x4837('0x4b')][_0x4837('0x32')]);_0x264e60[_0x4837('0x36')]=_[_0x4837('0x37')](_0x545818[_0x4837('0x36')]);_0x264e60[_0x4837('0x38')]=_[_0x4837('0x3a')](_0x264e60[_0x4837('0x39')],_0x264e60[_0x4837('0x36')]);_0x41e653['attributes']=_[_0x4837('0x3a')](_0x264e60[_0x4837('0x39')],qs[_0x4837('0x3b')](_0x545818[_0x4837('0x36')]['fields']));_0x41e653[_0x4837('0x3c')]=_0x41e653[_0x4837('0x3c')]['length']?_0x41e653['attributes']:_0x264e60[_0x4837('0x39')];if(_0x545818[_0x4837('0x36')][_0x4837('0x4c')]){_0x41e653['include']=[{'all':!![]}];}_0x41e653=_[_0x4837('0x42')]({},_0x41e653,_0x545818[_0x4837('0x45')]);return db[_0x4837('0x4b')][_0x4837('0x4d')](_0x41e653)[_0x4837('0x2a')](handleEntityNotFound(_0x16fc81,null))[_0x4837('0x2a')](respondWithResult(_0x16fc81,null))[_0x4837('0x48')](handleError(_0x16fc81,null));};exports[_0x4837('0x4e')]=function(_0x38d55e,_0x5aa7cf){return db['UserProfile'][_0x4837('0x4e')](_0x38d55e['body'],{})[_0x4837('0x2a')](respondWithResult(_0x5aa7cf,0xc9))[_0x4837('0x48')](handleError(_0x5aa7cf,null));};exports[_0x4837('0x4f')]=function(_0x2ff7de,_0x32384d){var _0x20f8c7={'where':{'id':_0x2ff7de[_0x4837('0x4a')]['id']}},_0x5c68e5={};_0x5c68e5[_0x4837('0x39')]=_[_0x4837('0x37')](db[_0x4837('0x4b')]['rawAttributes']);_0x20f8c7[_0x4837('0x3c')]=_[_0x4837('0x3a')](_0x5c68e5[_0x4837('0x39')],qs[_0x4837('0x3b')](_0x2ff7de[_0x4837('0x36')][_0x4837('0x3b')]));_0x20f8c7['attributes']=_0x20f8c7[_0x4837('0x3c')][_0x4837('0x3d')]?_0x20f8c7['attributes']:_0x5c68e5[_0x4837('0x39')];if(_0x2ff7de[_0x4837('0x36')][_0x4837('0x4c')]){_0x20f8c7[_0x4837('0x46')]=[{'all':!![]}];}_0x20f8c7=_['merge']({},_0x20f8c7,_0x2ff7de[_0x4837('0x45')]);return db[_0x4837('0x4b')][_0x4837('0x4d')](_0x20f8c7)[_0x4837('0x2a')](handleEntityNotFound(_0x32384d,null))[_0x4837('0x2a')](function(_0x1466ff){if(_0x1466ff){var _0x3e1e4e=_0x1466ff['get']({'plain':!![]});_0x3e1e4e=qs[_0x4837('0x50')](_0x3e1e4e,['id',_0x4837('0x51'),_0x4837('0x52'),_0x4837('0x53')]);_0x2ff7de[_0x4837('0x54')]=_[_0x4837('0x50')](_0x2ff7de[_0x4837('0x54')],['id','createdAt',_0x4837('0x52')]);return db[_0x4837('0x55')][_0x4837('0x56')](function(_0x1ad4c3){return db[_0x4837('0x4b')][_0x4837('0x4e')](_[_0x4837('0x42')](_0x3e1e4e,_0x2ff7de[_0x4837('0x54')]),{'include':_0x2ff7de[_0x4837('0x36')][_0x4837('0x4c')]?[{'all':!![]}]:undefined,'transaction':_0x1ad4c3})[_0x4837('0x2a')](function(_0x27ab33){var _0x41784e=_0x27ab33[_0x4837('0x57')]({'plain':!![]});return db[_0x4837('0x58')][_0x4837('0x59')]({'where':{'userProfileId':_0x2ff7de['params']['id']},'raw':!![]})[_0x4837('0x2a')](function(_0x431b6c){if(_0x431b6c){return BPromise[_0x4837('0x5a')](_0x431b6c,function(_0x569f45){return new BPromise(function(_0x1482b1,_0x39d564){if(_0x569f45['autoAssociation']===null||_0x569f45[_0x4837('0x5b')]===0x1)_0x1482b1(null);return db[_0x4837('0x5c')]['findAll']({'where':{'sectionId':_0x569f45['id']},'raw':!![]})[_0x4837('0x2a')](function(_0x27809e){var _0x5db106=_[_0x4837('0x31')](_0x27809e,function(_0x1d0c61){return qs[_0x4837('0x50')](_0x1d0c61,['id',_0x4837('0x51'),_0x4837('0x52'),'sectionId']);});_0x1482b1(_0x5db106);})[_0x4837('0x48')](function(_0x8d1722){_0x39d564(_0x8d1722);});})[_0x4837('0x2a')](function(_0x28b8e2){var _0x1bbea9=qs[_0x4837('0x50')](_0x569f45,['id',_0x4837('0x51'),_0x4837('0x52')]);_0x1bbea9[_0x4837('0x5d')]=_0x41784e['id'];if(_0x28b8e2)_0x1bbea9[_0x4837('0x5e')]=_0x28b8e2;return _0x1bbea9;})[_0x4837('0x2a')](function(_0x19d8de){return db[_0x4837('0x58')][_0x4837('0x4e')](_0x19d8de,{'include':[{'model':db['UserProfileResource'],'as':_0x4837('0x5e')}],'raw':!![],'transaction':_0x1ad4c3});});})[_0x4837('0x2a')](function(){return _0x41784e;});}});});});}})[_0x4837('0x2a')](respondWithResult(_0x32384d,0xc9))[_0x4837('0x48')](handleError(_0x32384d,null));};exports[_0x4837('0x28')]=function(_0x5736b2,_0x33e44e){if(_0x5736b2[_0x4837('0x54')]['id']){delete _0x5736b2[_0x4837('0x54')]['id'];}return db[_0x4837('0x4b')]['find']({'where':{'id':_0x5736b2[_0x4837('0x4a')]['id']}})['then'](handleEntityNotFound(_0x33e44e,null))[_0x4837('0x2a')](saveUpdates(_0x5736b2[_0x4837('0x54')],null))[_0x4837('0x2a')](respondWithResult(_0x33e44e,null))[_0x4837('0x48')](handleError(_0x33e44e,null));};exports[_0x4837('0x29')]=function(_0x3d028e,_0x3df022){return db[_0x4837('0x4b')][_0x4837('0x4d')]({'where':{'id':_0x3d028e[_0x4837('0x4a')]['id']}})[_0x4837('0x2a')](handleEntityNotFound(_0x3df022,null))[_0x4837('0x2a')](removeEntity(_0x3df022,null))[_0x4837('0x48')](handleError(_0x3df022,null));};exports[_0x4837('0x5f')]=function(_0x243d4d,_0x2184e4){return db[_0x4837('0x4b')][_0x4837('0x5f')]()[_0x4837('0x2a')](respondWithResult(_0x2184e4,null))['catch'](handleError(_0x2184e4,null));};exports[_0x4837('0x60')]=function(_0xc1b9fd,_0x2e45ea){var _0x2f8dd4=_0xc1b9fd[_0x4837('0x54')];return db['UserProfile'][_0x4837('0x4d')]({'where':{'id':_0xc1b9fd[_0x4837('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2e45ea,null))['then'](function(_0x579167){if(_0x579167){return db[_0x4837('0x55')][_0x4837('0x56')](function(_0x58af6c){return db[_0x4837('0x58')][_0x4837('0x29')]({'where':{'userProfileId':_0xc1b9fd[_0x4837('0x4a')]['id'],'sectionId':_[_0x4837('0x31')](_0x2f8dd4,function(_0x5aa1bc){return _0x5aa1bc[_0x4837('0x61')];})},'transaction':_0x58af6c})[_0x4837('0x2a')](function(){var _0x5aa178=_['map'](_0x2f8dd4,function(_0x262175){_0x262175[_0x4837('0x5d')]=_0xc1b9fd['params']['id'];return _0x262175;});var _0xa7a1e7=[];return BPromise[_0x4837('0x5a')](_0x5aa178,function(_0xcd6099){return db[_0x4837('0x58')]['create'](_0xcd6099,{'include':[{'model':db[_0x4837('0x5c')],'as':_0x4837('0x5e')}],'raw':!![],'transaction':_0x58af6c})[_0x4837('0x2a')](function(_0x2f4ff1){_0xa7a1e7[_0x4837('0x62')](_0x2f4ff1[_0x4837('0x57')]({'plain':!![]}));});})[_0x4837('0x2a')](function(){return _0xa7a1e7;});});});}})[_0x4837('0x2a')](function(_0x2b089a){return _0x2b089a;})[_0x4837('0x2a')](respondWithResult(_0x2e45ea,null))[_0x4837('0x48')](handleError(_0x2e45ea,null));};exports[_0x4837('0x63')]=function(_0x588157,_0x27400d){var _0x2bb6a8;return db[_0x4837('0x4b')][_0x4837('0x4d')]({'where':{'id':_0x588157[_0x4837('0x4a')]['id']},'attributes':['id',_0x4837('0x2e')]})[_0x4837('0x2a')](handleEntityNotFound(_0x27400d,null))[_0x4837('0x2a')](function(_0x3d3701){if(_0x3d3701){_0x2bb6a8=_0x3d3701;return db[_0x4837('0x58')]['destroy']({'where':{'userProfileId':_0x588157[_0x4837('0x4a')]['id'],'sectionId':_0x588157[_0x4837('0x36')][_0x4837('0x64')]}});}})['then'](function(){return _0x2bb6a8;})[_0x4837('0x2a')](respondWithStatusCode(_0x27400d,null))[_0x4837('0x48')](handleError(_0x27400d,null));};exports[_0x4837('0x65')]=function(_0x115851,_0x2f0e6f){var _0x5d4778=[];var _0x11b6e8=[];return db[_0x4837('0x58')]['findAll']({'where':{'userProfileId':_0x115851['params']['id']},'raw':!![]})[_0x4837('0x2a')](function(_0x244889){_0x5d4778=_[_0x4837('0x44')](_0x244889,function(_0x4fd436){return _0x4fd436[_0x4837('0x66')]===0x1||_[_0x4837('0x67')]([0x3eb,0x709],_0x4fd436[_0x4837('0x61')]);});if(!_['isEmpty'](_0x5d4778)){return _['map'](_0x5d4778,function(_0x501538){return _0x501538[_0x4837('0x61')];});}else{return;}})[_0x4837('0x2a')](function(_0x2e546f){if(_0x2e546f)_0x11b6e8=_0x2e546f;if(_['includes'](_0x11b6e8,0x64)){var _0x3c7fa9=_[_0x4837('0x4d')](_0x5d4778,{'sectionId':0x64});return hasDefaultDashboard(_0x3c7fa9)[_0x4837('0x2a')](function(_0x15362b){return _['map'](_0x5d4778,function(_0x105408){if(_0x105408[_0x4837('0x61')]===0x64){_0x105408[_0x4837('0x68')]=_0x15362b;}return _0x105408;});});}else{return;}})[_0x4837('0x2a')](function(_0x2c179a){if(_0x2c179a)_0x5d4778=_0x2c179a;if(_[_0x4837('0x67')](_0x11b6e8,0x3eb)){var _0x94fbd0=_[_0x4837('0x4d')](_0x5d4778,{'sectionId':0x3eb});return getCustomDashboards(_0x94fbd0)['then'](function(_0x66543b){return _[_0x4837('0x31')](_0x5d4778,function(_0x4281d5){if(_0x94fbd0[_0x4837('0x66')]){if(_0x4281d5['sectionId']===0x3eb){_0x4281d5[_0x4837('0x68')]=_0x66543b;}}else{if(_0x4281d5['sectionId']===0x64){_0x4281d5[_0x4837('0x68')]=_0x66543b;}}return _0x4281d5;});});}else{return;}})[_0x4837('0x2a')](function(_0x1f5a1c){if(_0x1f5a1c)_0x5d4778=_0x1f5a1c;if(_[_0x4837('0x67')](_0x11b6e8,0x709)){var _0x5399d5=_[_0x4837('0x4d')](_0x5d4778,{'sectionId':0x709});return getPlugins(_0x5399d5)[_0x4837('0x2a')](function(_0x26e12b){if(_0x5399d5[_0x4837('0x66')]){return _[_0x4837('0x31')](_0x5d4778,function(_0x3e5a22){if(_0x3e5a22[_0x4837('0x61')]===0x709){_0x3e5a22[_0x4837('0x68')]=_0x26e12b;}return _0x3e5a22;});}else{var _0x339001={'sectionId':0x76c,'enabled':0x1,'subsections':_0x26e12b};var _0x365d5d=_['map'](_0x5d4778);_0x365d5d['push'](_0x339001);return _0x365d5d;}});}else{return;}})['then'](function(_0x6a9f78){if(_0x6a9f78)_0x5d4778=_0x6a9f78;return _[_0x4837('0x44')](_0x5d4778,[_0x4837('0x66'),0x1]);})[_0x4837('0x2a')](respondWithResult(_0x2f0e6f,null))['catch'](handleError(_0x2f0e6f,null));};function hasDefaultDashboard(_0x59c44d){var _0xd9c2b8=[0x65];return new BPromise(function(_0x1b526e,_0x1afbc6){try{if(_0x59c44d[_0x4837('0x5b')]){_0x1b526e(_0xd9c2b8);}else{return db['UserProfileResource'][_0x4837('0x69')]({'where':{'sectionId':_0x59c44d['id']},'raw':!![]})[_0x4837('0x2a')](function(_0x19d959){_0x19d959?_0x1b526e(_0xd9c2b8):_0x1b526e();});}}catch(_0x4b215e){_0x1afbc6(_0x4b215e);}});}function getCustomDashboards(_0x79eccb){var _0x1e1bde=[];return new BPromise(function(_0x4b1e9a,_0x33b2b7){try{if(_0x79eccb[_0x4837('0x5b')]){return db[_0x4837('0x6a')][_0x4837('0x59')]({'raw':!![]})[_0x4837('0x2a')](function(_0x2bc115){_0x2bc115['forEach'](function(_0x37b7f6){_0x1e1bde[_0x4837('0x62')](_0x37b7f6['id']+0x1869f);});_0x4b1e9a(_0x1e1bde);});}else{return db[_0x4837('0x5c')]['findAll']({'where':{'sectionId':_0x79eccb['id']},'raw':!![]})[_0x4837('0x2a')](function(_0x43cd65){_0x43cd65[_0x4837('0x6b')](function(_0x358cba){_0x1e1bde[_0x4837('0x62')](_0x358cba[_0x4837('0x6c')]+0x1869f);});_0x4b1e9a(_0x1e1bde);});}}catch(_0x65380f){_0x33b2b7(_0x65380f);}});}function getPlugins(_0x269d31){var _0x4441d6=[];return new BPromise(function(_0x45e1d1,_0x3b1803){try{if(_0x269d31[_0x4837('0x5b')]){return db[_0x4837('0x6d')][_0x4837('0x59')]({'raw':!![]})['then'](function(_0x2b5163){_0x2b5163[_0x4837('0x6b')](function(_0xc27390){_0x4441d6[_0x4837('0x62')](_0xc27390['id']+0x15b38);});_0x45e1d1(_0x4441d6);});}else{return db[_0x4837('0x5c')][_0x4837('0x59')]({'where':{'sectionId':_0x269d31['id']},'raw':!![]})[_0x4837('0x2a')](function(_0x162341){_0x162341[_0x4837('0x6b')](function(_0x347ae0){_0x4441d6[_0x4837('0x62')](_0x347ae0[_0x4837('0x6c')]+0x15b38);});_0x45e1d1(_0x4441d6);});}}catch(_0xd56713){_0x3b1803(_0xd56713);}});}exports['addResources']=function(_0x2c25e1,_0x2725c7){return db[_0x4837('0x4b')][_0x4837('0x4d')]({'where':{'id':_0x2c25e1['params']['id']}})['then'](handleEntityNotFound(_0x2725c7,null))[_0x4837('0x2a')](function(_0x3ad43c){if(_0x3ad43c){return db[_0x4837('0x55')][_0x4837('0x56')](function(_0xc4416f){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x2c25e1[_0x4837('0x4a')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0xb3c48e){if(_0xb3c48e){return db[_0x4837('0x58')][_0x4837('0x29')]({'where':{'userProfileId':_0x2c25e1[_0x4837('0x4a')]['id'],'id':_[_0x4837('0x31')](_0xb3c48e,function(_0x3d0ac1){return _0x3d0ac1['id'];})},'transaction':_0xc4416f});}})[_0x4837('0x2a')](function(_0x3b5246){var _0x3c1272=_['map'](_0x2c25e1[_0x4837('0x54')],function(_0x12faaf){_0x12faaf['userProfileId']=_0x2c25e1[_0x4837('0x4a')]['id'];return _0x12faaf;});return db[_0x4837('0x58')][_0x4837('0x6e')](_0x3c1272,{'raw':!![],'transaction':_0xc4416f});})[_0x4837('0x2a')](function(_0x200ce1){var _0x17d5d5=_['filter'](_['map'](_0x200ce1,function(_0x47c60e){return _0x47c60e[_0x4837('0x57')]({'plain':!![]});}),{'includeAll':![]});if(_0x17d5d5){return db[_0x4837('0x58')][_0x4837('0x59')]({'where':{'userProfileId':_0x2c25e1['params']['id'],'sectionId':_[_0x4837('0x31')](_0x17d5d5,function(_0x2b06ed){return _0x2b06ed[_0x4837('0x61')];})},'attributes':['id',_0x4837('0x61')],'raw':!![]})[_0x4837('0x2a')](function(_0x1bc0b4){var _0x4a378b=_[_0x4837('0x31')](_0x2c25e1[_0x4837('0x54')],function(_0x49a5d0){_0x49a5d0[_0x4837('0x5d')]=_0x2c25e1['params']['id'];return _0x49a5d0;});return db['UserProfileResource']['bulkCreate'](_0x4a378b,{'raw':!![],'transaction':_0xc4416f});});}})[_0x4837('0x48')](handleError(_0x2725c7,null));});}})[_0x4837('0x2a')](function(_0x1dd2b3){var _0x24b41a=_[_0x4837('0x31')](_0x1dd2b3,function(_0x3faa98){return _0x3faa98['get']({'plain':!![]});});})[_0x4837('0x2a')](respondWithResult(_0x2725c7,null))[_0x4837('0x48')](handleError(_0x2725c7,null));};exports[_0x4837('0x6f')]=function(_0x101ca6,_0x372020,_0x4052d8){return db['UserProfile']['find']({'where':{'id':_0x101ca6[_0x4837('0x4a')]['id']}})[_0x4837('0x2a')](handleEntityNotFound(_0x372020,null))[_0x4837('0x2a')](function(_0x58ec7d){if(_0x58ec7d){return _0x58ec7d[_0x4837('0x6f')](_0x101ca6[_0x4837('0x36')][_0x4837('0x64')]);}})[_0x4837('0x2a')](respondWithStatusCode(_0x372020,null))[_0x4837('0x48')](handleError(_0x372020,null));};exports[_0x4837('0x70')]=function(_0x44df41,_0x217565){var _0x411663={};if(!_0x44df41[_0x4837('0x36')][_0x4837('0x71')])throw new Error(_0x4837('0x72'));if(!_0x44df41[_0x4837('0x36')]['hasOwnProperty'](_0x4837('0x3e'))){_0x411663[_0x4837('0x24')]=qs['limit'](_0x44df41[_0x4837('0x36')]['limit']);_0x411663[_0x4837('0x22')]=qs[_0x4837('0x22')](_0x44df41[_0x4837('0x36')][_0x4837('0x22')]);}return db[_0x4837('0x4b')]['find']({'where':{'id':_0x44df41[_0x4837('0x4a')]['id']}})[_0x4837('0x2a')](function(_0x4b5f0b){if(!_0x4b5f0b)throw new Error(_0x4837('0x73')+_0x44df41['params']['id']);return db[_0x4837('0x4b')][_0x4837('0x70')](_0x44df41);})[_0x4837('0x2a')](respondWithFilteredResult(_0x217565,_0x411663))[_0x4837('0x48')](handleError(_0x217565,null));};
\ No newline at end of file
+var _0x337f=['nolimit','order','sort','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','params','length','includeAll','options','find','create','body','clone','rawAttributes','get','omit','updatedAt','crudPermissions','createdAt','sequelize','transaction','UserProfileSection','autoAssociation','UserProfileResource','Resources','destroy','describe','addSections','each','push','removeSections','ids','getSections','enabled','includes','sectionId','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','userProfileId','bulkCreate','removeResources','section','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','limit','undefined','count','offset','set','apply','save','update','then','error','stack','name','index','map','UserProfile','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0x337f,0x11c));var _0xf337=function(_0x42b02c,_0x5c7b99){_0x42b02c=_0x42b02c-0x0;var _0x105518=_0x337f[_0x42b02c];return _0x105518;};'use strict';var emlformat=require(_0xf337('0x0'));var rimraf=require(_0xf337('0x1'));var zipdir=require(_0xf337('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf337('0x3'));var moment=require(_0xf337('0x4'));var BPromise=require(_0xf337('0x5'));var Mustache=require('mustache');var util=require(_0xf337('0x6'));var path=require(_0xf337('0x7'));var sox=require('sox');var csv=require(_0xf337('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf337('0x9'));var _=require('lodash');var squel=require(_0xf337('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf337('0xb'));var toCsv=require(_0xf337('0x8'));var querystring=require(_0xf337('0xc'));var Papa=require(_0xf337('0xd'));var Redis=require(_0xf337('0xe'));var authService=require(_0xf337('0xf'));var qs=require(_0xf337('0x10'));var as=require(_0xf337('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf337('0x12'))(_0xf337('0x13'));var utils=require(_0xf337('0x14'));var config=require(_0xf337('0x15'));var licenseUtil=require(_0xf337('0x16'));var db=require(_0xf337('0x17'))['db'];config[_0xf337('0x18')]=_[_0xf337('0x19')](config[_0xf337('0x18')],{'host':_0xf337('0x1a'),'port':0x18eb});var socket=require(_0xf337('0x1b'))(new Redis(config[_0xf337('0x18')]));require('./userProfile.socket')[_0xf337('0x1c')](socket);function respondWithStatusCode(_0x3873ea,_0x40931b){_0x40931b=_0x40931b||0xcc;return function(_0x4f8c79){if(_0x4f8c79){return _0x3873ea[_0xf337('0x1d')](_0x40931b);}return _0x3873ea[_0xf337('0x1e')](_0x40931b)['end']();};}function respondWithResult(_0x1147e4,_0x39146c){_0x39146c=_0x39146c||0xc8;return function(_0x100cb0){if(_0x100cb0){return _0x1147e4['status'](_0x39146c)[_0xf337('0x1f')](_0x100cb0);}};}function respondWithFilteredResult(_0x4d7237,_0x2e9954){return function(_0x3269af){if(_0x3269af){var _0x383327=typeof _0x2e9954['offset']==='undefined'&&typeof _0x2e9954[_0xf337('0x20')]===_0xf337('0x21');var _0x193607=_0x3269af[_0xf337('0x22')];var _0x8858fe=_0x383327?0x0:_0x2e9954[_0xf337('0x23')];var _0x1621d7=_0x383327?_0x3269af[_0xf337('0x22')]:_0x2e9954[_0xf337('0x23')]+_0x2e9954[_0xf337('0x20')];var _0x3ae507;if(_0x1621d7>=_0x193607){_0x1621d7=_0x193607;_0x3ae507=0xc8;}else{_0x3ae507=0xce;}_0x4d7237[_0xf337('0x1e')](_0x3ae507);return _0x4d7237[_0xf337('0x24')]('Content-Range',_0x8858fe+'-'+_0x1621d7+'/'+_0x193607)[_0xf337('0x1f')](_0x3269af);}return null;};}function patchUpdates(_0x4e4191){return function(_0x50e7c8){try{jsonpatch[_0xf337('0x25')](_0x50e7c8,_0x4e4191,!![]);}catch(_0xcfabf2){return BPromise['reject'](_0xcfabf2);}return _0x50e7c8[_0xf337('0x26')]();};}function saveUpdates(_0x3880b4,_0x48f81e){return function(_0x5648de){if(_0x5648de){return _0x5648de[_0xf337('0x27')](_0x3880b4)['then'](function(_0x4e906a){return _0x4e906a;});}return null;};}function removeEntity(_0x5c047b,_0x2fec03){return function(_0x578fbd){if(_0x578fbd){return _0x578fbd['destroy']()[_0xf337('0x28')](function(){_0x5c047b[_0xf337('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57b357,_0x1f28ff){return function(_0x1d76c1){if(!_0x1d76c1){_0x57b357[_0xf337('0x1d')](0x194);}return _0x1d76c1;};}function handleError(_0x311eb2,_0x4d1242){_0x4d1242=_0x4d1242||0x1f4;return function(_0x208892){logger[_0xf337('0x29')](_0x208892[_0xf337('0x2a')]);if(_0x208892[_0xf337('0x2b')]){delete _0x208892[_0xf337('0x2b')];}_0x311eb2[_0xf337('0x1e')](_0x4d1242)['send'](_0x208892);};}exports[_0xf337('0x2c')]=function(_0x4464c1,_0x1f9966){var _0x16cc27={},_0x2c87f9={},_0x59f7da={'count':0x0,'rows':[]};var _0x27f0f7=_[_0xf337('0x2d')](db[_0xf337('0x2e')]['rawAttributes'],function(_0x326b2d){return{'name':_0x326b2d[_0xf337('0x2f')],'type':_0x326b2d[_0xf337('0x30')][_0xf337('0x31')]};});_0x2c87f9[_0xf337('0x32')]=_['map'](_0x27f0f7,'name');_0x2c87f9['query']=_[_0xf337('0x33')](_0x4464c1[_0xf337('0x34')]);_0x2c87f9[_0xf337('0x35')]=_[_0xf337('0x36')](_0x2c87f9['model'],_0x2c87f9[_0xf337('0x34')]);_0x16cc27['attributes']=_[_0xf337('0x36')](_0x2c87f9[_0xf337('0x32')],qs[_0xf337('0x37')](_0x4464c1[_0xf337('0x34')][_0xf337('0x37')]));_0x16cc27[_0xf337('0x38')]=_0x16cc27[_0xf337('0x38')]['length']?_0x16cc27[_0xf337('0x38')]:_0x2c87f9[_0xf337('0x32')];if(!_0x4464c1[_0xf337('0x34')][_0xf337('0x39')](_0xf337('0x3a'))){_0x16cc27['limit']=qs[_0xf337('0x20')](_0x4464c1[_0xf337('0x34')]['limit']);_0x16cc27[_0xf337('0x23')]=qs[_0xf337('0x23')](_0x4464c1[_0xf337('0x34')]['offset']);}_0x16cc27[_0xf337('0x3b')]=qs[_0xf337('0x3c')](_0x4464c1['query'][_0xf337('0x3c')]);_0x16cc27['where']=qs[_0xf337('0x35')](_['pick'](_0x4464c1[_0xf337('0x34')],_0x2c87f9[_0xf337('0x35')]),_0x27f0f7);if(_0x4464c1[_0xf337('0x34')][_0xf337('0x3d')]){_0x16cc27[_0xf337('0x3e')]=_[_0xf337('0x3f')](_0x16cc27['where'],{'$or':_['map'](_0x27f0f7,function(_0x1ff5b3){if(_0x1ff5b3[_0xf337('0x30')]!==_0xf337('0x40')){var _0x44390b={};_0x44390b[_0x1ff5b3[_0xf337('0x2b')]]={'$like':'%'+_0x4464c1[_0xf337('0x34')][_0xf337('0x3d')]+'%'};return _0x44390b;}})});}_0x16cc27=_[_0xf337('0x3f')]({},_0x16cc27,_0x4464c1['options']);var _0x38cbb5={'where':_0x16cc27[_0xf337('0x3e')]};return db[_0xf337('0x2e')][_0xf337('0x22')](_0x38cbb5)['then'](function(_0x57fcb0){_0x59f7da[_0xf337('0x22')]=_0x57fcb0;if(_0x4464c1[_0xf337('0x34')]['includeAll']){_0x16cc27[_0xf337('0x41')]=[{'all':!![]}];}return db[_0xf337('0x2e')][_0xf337('0x42')](_0x16cc27);})[_0xf337('0x28')](function(_0x5b626c){_0x59f7da[_0xf337('0x43')]=_0x5b626c;return _0x59f7da;})[_0xf337('0x28')](respondWithFilteredResult(_0x1f9966,_0x16cc27))[_0xf337('0x44')](handleError(_0x1f9966,null));};exports[_0xf337('0x45')]=function(_0x37a046,_0x46a89f){var _0x12b503={'raw':![],'where':{'id':_0x37a046[_0xf337('0x46')]['id']}},_0x3809d2={};_0x3809d2['model']=_['keys'](db[_0xf337('0x2e')]['rawAttributes']);_0x3809d2[_0xf337('0x34')]=_[_0xf337('0x33')](_0x37a046[_0xf337('0x34')]);_0x3809d2[_0xf337('0x35')]=_['intersection'](_0x3809d2['model'],_0x3809d2[_0xf337('0x34')]);_0x12b503[_0xf337('0x38')]=_['intersection'](_0x3809d2['model'],qs[_0xf337('0x37')](_0x37a046[_0xf337('0x34')][_0xf337('0x37')]));_0x12b503[_0xf337('0x38')]=_0x12b503[_0xf337('0x38')][_0xf337('0x47')]?_0x12b503[_0xf337('0x38')]:_0x3809d2['model'];if(_0x37a046['query'][_0xf337('0x48')]){_0x12b503[_0xf337('0x41')]=[{'all':!![]}];}_0x12b503=_[_0xf337('0x3f')]({},_0x12b503,_0x37a046[_0xf337('0x49')]);return db[_0xf337('0x2e')][_0xf337('0x4a')](_0x12b503)['then'](handleEntityNotFound(_0x46a89f,null))[_0xf337('0x28')](respondWithResult(_0x46a89f,null))[_0xf337('0x44')](handleError(_0x46a89f,null));};exports[_0xf337('0x4b')]=function(_0x54e944,_0x1ebf58){return db[_0xf337('0x2e')]['create'](_0x54e944[_0xf337('0x4c')],{})[_0xf337('0x28')](respondWithResult(_0x1ebf58,0xc9))[_0xf337('0x44')](handleError(_0x1ebf58,null));};exports[_0xf337('0x4d')]=function(_0x1a6233,_0x443c3a){var _0xc77813={'where':{'id':_0x1a6233['params']['id']}},_0x4c6b0e={};_0x4c6b0e[_0xf337('0x32')]=_[_0xf337('0x33')](db[_0xf337('0x2e')][_0xf337('0x4e')]);_0xc77813[_0xf337('0x38')]=_[_0xf337('0x36')](_0x4c6b0e[_0xf337('0x32')],qs[_0xf337('0x37')](_0x1a6233['query'][_0xf337('0x37')]));_0xc77813[_0xf337('0x38')]=_0xc77813[_0xf337('0x38')][_0xf337('0x47')]?_0xc77813[_0xf337('0x38')]:_0x4c6b0e[_0xf337('0x32')];if(_0x1a6233['query'][_0xf337('0x48')]){_0xc77813[_0xf337('0x41')]=[{'all':!![]}];}_0xc77813=_[_0xf337('0x3f')]({},_0xc77813,_0x1a6233['options']);return db[_0xf337('0x2e')]['find'](_0xc77813)[_0xf337('0x28')](handleEntityNotFound(_0x443c3a,null))[_0xf337('0x28')](function(_0x395441){if(_0x395441){var _0x199fc9=_0x395441[_0xf337('0x4f')]({'plain':!![]});_0x199fc9=qs[_0xf337('0x50')](_0x199fc9,['id','createdAt',_0xf337('0x51'),_0xf337('0x52')]);_0x1a6233['body']=_[_0xf337('0x50')](_0x1a6233[_0xf337('0x4c')],['id',_0xf337('0x53'),_0xf337('0x51')]);return db[_0xf337('0x54')][_0xf337('0x55')](function(_0x230370){return db['UserProfile'][_0xf337('0x4b')](_[_0xf337('0x3f')](_0x199fc9,_0x1a6233['body']),{'include':_0x1a6233[_0xf337('0x34')][_0xf337('0x48')]?[{'all':!![]}]:undefined,'transaction':_0x230370})[_0xf337('0x28')](function(_0xe8faba){var _0x2c2821=_0xe8faba[_0xf337('0x4f')]({'plain':!![]});return db[_0xf337('0x56')][_0xf337('0x42')]({'where':{'userProfileId':_0x1a6233[_0xf337('0x46')]['id']},'raw':!![]})[_0xf337('0x28')](function(_0x556e7c){if(_0x556e7c){return BPromise['each'](_0x556e7c,function(_0x12b5e0){return new BPromise(function(_0x35f15a,_0x397b93){if(_0x12b5e0['autoAssociation']===null||_0x12b5e0[_0xf337('0x57')]===0x1)_0x35f15a(null);return db[_0xf337('0x58')][_0xf337('0x42')]({'where':{'sectionId':_0x12b5e0['id']},'raw':!![]})[_0xf337('0x28')](function(_0x1feb22){var _0x2e8897=_[_0xf337('0x2d')](_0x1feb22,function(_0x8ff31b){return qs[_0xf337('0x50')](_0x8ff31b,['id',_0xf337('0x53'),_0xf337('0x51'),'sectionId']);});_0x35f15a(_0x2e8897);})[_0xf337('0x44')](function(_0x2e0a67){_0x397b93(_0x2e0a67);});})['then'](function(_0x5bb2cc){var _0x3ff9d1=qs['omit'](_0x12b5e0,['id',_0xf337('0x53'),_0xf337('0x51')]);_0x3ff9d1['userProfileId']=_0x2c2821['id'];if(_0x5bb2cc)_0x3ff9d1[_0xf337('0x59')]=_0x5bb2cc;return _0x3ff9d1;})[_0xf337('0x28')](function(_0x5bade3){return db[_0xf337('0x56')][_0xf337('0x4b')](_0x5bade3,{'include':[{'model':db[_0xf337('0x58')],'as':_0xf337('0x59')}],'raw':!![],'transaction':_0x230370});});})[_0xf337('0x28')](function(){return _0x2c2821;});}});});});}})[_0xf337('0x28')](respondWithResult(_0x443c3a,0xc9))[_0xf337('0x44')](handleError(_0x443c3a,null));};exports[_0xf337('0x27')]=function(_0x3bb5fe,_0x3a71ab){if(_0x3bb5fe[_0xf337('0x4c')]['id']){delete _0x3bb5fe[_0xf337('0x4c')]['id'];}return db['UserProfile']['find']({'where':{'id':_0x3bb5fe[_0xf337('0x46')]['id']}})['then'](handleEntityNotFound(_0x3a71ab,null))['then'](saveUpdates(_0x3bb5fe['body'],null))[_0xf337('0x28')](respondWithResult(_0x3a71ab,null))[_0xf337('0x44')](handleError(_0x3a71ab,null));};exports[_0xf337('0x5a')]=function(_0x11b171,_0x392323){return db['UserProfile']['find']({'where':{'id':_0x11b171['params']['id']}})[_0xf337('0x28')](handleEntityNotFound(_0x392323,null))[_0xf337('0x28')](removeEntity(_0x392323,null))[_0xf337('0x44')](handleError(_0x392323,null));};exports[_0xf337('0x5b')]=function(_0x3180f5,_0x410cc6){return db['UserProfile'][_0xf337('0x5b')]()['then'](respondWithResult(_0x410cc6,null))[_0xf337('0x44')](handleError(_0x410cc6,null));};exports[_0xf337('0x5c')]=function(_0x4189ac,_0x880027){var _0x426da1=_0x4189ac[_0xf337('0x4c')];return db[_0xf337('0x2e')][_0xf337('0x4a')]({'where':{'id':_0x4189ac[_0xf337('0x46')]['id']}})[_0xf337('0x28')](handleEntityNotFound(_0x880027,null))[_0xf337('0x28')](function(_0x1afcf7){if(_0x1afcf7){return db[_0xf337('0x54')][_0xf337('0x55')](function(_0x12c934){return db[_0xf337('0x56')][_0xf337('0x5a')]({'where':{'userProfileId':_0x4189ac['params']['id'],'sectionId':_[_0xf337('0x2d')](_0x426da1,function(_0x50af6c){return _0x50af6c['sectionId'];})},'transaction':_0x12c934})[_0xf337('0x28')](function(){var _0x1a80f9=_[_0xf337('0x2d')](_0x426da1,function(_0x385ed3){_0x385ed3['userProfileId']=_0x4189ac[_0xf337('0x46')]['id'];return _0x385ed3;});var _0x59461c=[];return BPromise[_0xf337('0x5d')](_0x1a80f9,function(_0x5b4016){return db[_0xf337('0x56')][_0xf337('0x4b')](_0x5b4016,{'include':[{'model':db[_0xf337('0x58')],'as':'Resources'}],'raw':!![],'transaction':_0x12c934})[_0xf337('0x28')](function(_0x447a68){_0x59461c[_0xf337('0x5e')](_0x447a68[_0xf337('0x4f')]({'plain':!![]}));});})[_0xf337('0x28')](function(){return _0x59461c;});});});}})[_0xf337('0x28')](function(_0xfdf2b3){return _0xfdf2b3;})[_0xf337('0x28')](respondWithResult(_0x880027,null))['catch'](handleError(_0x880027,null));};exports[_0xf337('0x5f')]=function(_0x1dc30c,_0x536934){var _0x1d61ec;return db[_0xf337('0x2e')][_0xf337('0x4a')]({'where':{'id':_0x1dc30c[_0xf337('0x46')]['id']},'attributes':['id',_0xf337('0x2b')]})[_0xf337('0x28')](handleEntityNotFound(_0x536934,null))[_0xf337('0x28')](function(_0x3d01bf){if(_0x3d01bf){_0x1d61ec=_0x3d01bf;return db[_0xf337('0x56')][_0xf337('0x5a')]({'where':{'userProfileId':_0x1dc30c[_0xf337('0x46')]['id'],'sectionId':_0x1dc30c['query'][_0xf337('0x60')]}});}})[_0xf337('0x28')](function(){return _0x1d61ec;})[_0xf337('0x28')](respondWithStatusCode(_0x536934,null))[_0xf337('0x44')](handleError(_0x536934,null));};exports[_0xf337('0x61')]=function(_0x4473c3,_0x17f9ac){var _0x2a02cb=[];var _0x2994fe=[];return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x4473c3[_0xf337('0x46')]['id']},'raw':!![]})[_0xf337('0x28')](function(_0x4d3c08){_0x2a02cb=_[_0xf337('0x3d')](_0x4d3c08,function(_0x5e1c5b){return _0x5e1c5b[_0xf337('0x62')]===0x1||_[_0xf337('0x63')]([0x3eb,0x709],_0x5e1c5b[_0xf337('0x64')]);});if(!_['isEmpty'](_0x2a02cb)){return _[_0xf337('0x2d')](_0x2a02cb,function(_0x1bb73a){return _0x1bb73a[_0xf337('0x64')];});}else{return;}})[_0xf337('0x28')](function(_0x2e7587){if(_0x2e7587)_0x2994fe=_0x2e7587;if(_[_0xf337('0x63')](_0x2994fe,0x64)){var _0x3b7b19=_[_0xf337('0x4a')](_0x2a02cb,{'sectionId':0x64});return hasDefaultDashboard(_0x3b7b19)[_0xf337('0x28')](function(_0x35e569){return _[_0xf337('0x2d')](_0x2a02cb,function(_0x1339c8){if(_0x1339c8[_0xf337('0x64')]===0x64){_0x1339c8[_0xf337('0x65')]=_0x35e569;}return _0x1339c8;});});}else{return;}})[_0xf337('0x28')](function(_0x4c40b7){if(_0x4c40b7)_0x2a02cb=_0x4c40b7;if(_['includes'](_0x2994fe,0x3eb)){var _0x24fc53=_[_0xf337('0x4a')](_0x2a02cb,{'sectionId':0x3eb});return getCustomDashboards(_0x24fc53)['then'](function(_0x52964b){return _['map'](_0x2a02cb,function(_0x570ce5){if(_0x24fc53[_0xf337('0x62')]){if(_0x570ce5[_0xf337('0x64')]===0x3eb){_0x570ce5[_0xf337('0x65')]=_0x52964b;}}else{if(_0x570ce5['sectionId']===0x64){_0x570ce5['subsections']=_0x52964b;}}return _0x570ce5;});});}else{return;}})['then'](function(_0x335756){if(_0x335756)_0x2a02cb=_0x335756;if(_[_0xf337('0x63')](_0x2994fe,0x709)){var _0x1711a4=_[_0xf337('0x4a')](_0x2a02cb,{'sectionId':0x709});return getPlugins(_0x1711a4)[_0xf337('0x28')](function(_0x262e55){if(_0x1711a4[_0xf337('0x62')]){return _[_0xf337('0x2d')](_0x2a02cb,function(_0x329c45){if(_0x329c45[_0xf337('0x64')]===0x709){_0x329c45[_0xf337('0x65')]=_0x262e55;}return _0x329c45;});}else{var _0x464d22={'sectionId':0x76c,'enabled':0x1,'subsections':_0x262e55};var _0x1cb92c=_[_0xf337('0x2d')](_0x2a02cb);_0x1cb92c[_0xf337('0x5e')](_0x464d22);return _0x1cb92c;}});}else{return;}})[_0xf337('0x28')](function(_0x5ee9b5){if(_0x5ee9b5)_0x2a02cb=_0x5ee9b5;return _[_0xf337('0x3d')](_0x2a02cb,[_0xf337('0x62'),0x1]);})['then'](respondWithResult(_0x17f9ac,null))[_0xf337('0x44')](handleError(_0x17f9ac,null));};function hasDefaultDashboard(_0x4ac82e){var _0x19480c=[0x65];return new BPromise(function(_0x480c82,_0x1d9319){try{if(_0x4ac82e[_0xf337('0x57')]){_0x480c82(_0x19480c);}else{return db[_0xf337('0x58')][_0xf337('0x66')]({'where':{'sectionId':_0x4ac82e['id']},'raw':!![]})['then'](function(_0x4a8bd6){_0x4a8bd6?_0x480c82(_0x19480c):_0x480c82();});}}catch(_0xad9378){_0x1d9319(_0xad9378);}});}function getCustomDashboards(_0x3aa0cd){var _0x4dc955=[];return new BPromise(function(_0x444db8,_0x3d79e2){try{if(_0x3aa0cd[_0xf337('0x57')]){return db[_0xf337('0x67')][_0xf337('0x42')]({'raw':!![]})[_0xf337('0x28')](function(_0x3d75b8){_0x3d75b8[_0xf337('0x68')](function(_0x4b91a9){_0x4dc955[_0xf337('0x5e')](_0x4b91a9['id']+0x1869f);});_0x444db8(_0x4dc955);});}else{return db[_0xf337('0x58')][_0xf337('0x42')]({'where':{'sectionId':_0x3aa0cd['id']},'raw':!![]})[_0xf337('0x28')](function(_0x515c0c){_0x515c0c[_0xf337('0x68')](function(_0x3862c5){_0x4dc955[_0xf337('0x5e')](_0x3862c5[_0xf337('0x69')]+0x1869f);});_0x444db8(_0x4dc955);});}}catch(_0x608080){_0x3d79e2(_0x608080);}});}function getPlugins(_0x54be21){var _0x495eae=[];return new BPromise(function(_0x5224d1,_0xb13a97){try{if(_0x54be21['autoAssociation']){return db[_0xf337('0x6a')][_0xf337('0x42')]({'raw':!![]})[_0xf337('0x28')](function(_0x493b06){_0x493b06['forEach'](function(_0x55213d){_0x495eae[_0xf337('0x5e')](_0x55213d['id']+0x15b38);});_0x5224d1(_0x495eae);});}else{return db[_0xf337('0x58')]['findAll']({'where':{'sectionId':_0x54be21['id']},'raw':!![]})[_0xf337('0x28')](function(_0x35570a){_0x35570a[_0xf337('0x68')](function(_0x3841b3){_0x495eae[_0xf337('0x5e')](_0x3841b3['resourceId']+0x15b38);});_0x5224d1(_0x495eae);});}}catch(_0x3ac4fb){_0xb13a97(_0x3ac4fb);}});}exports[_0xf337('0x6b')]=function(_0x186afd,_0x10b1dd){return db['UserProfile'][_0xf337('0x4a')]({'where':{'id':_0x186afd[_0xf337('0x46')]['id']}})[_0xf337('0x28')](handleEntityNotFound(_0x10b1dd,null))[_0xf337('0x28')](function(_0x17abd6){if(_0x17abd6){return db[_0xf337('0x54')][_0xf337('0x55')](function(_0x219212){return db[_0xf337('0x56')][_0xf337('0x42')]({'where':{'userProfileId':_0x186afd[_0xf337('0x46')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x580be4){if(_0x580be4){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x186afd[_0xf337('0x46')]['id'],'id':_[_0xf337('0x2d')](_0x580be4,function(_0x28a77f){return _0x28a77f['id'];})},'transaction':_0x219212});}})['then'](function(_0x2d4c1e){var _0x2b54e5=_['map'](_0x186afd[_0xf337('0x4c')],function(_0x3c4876){_0x3c4876[_0xf337('0x6c')]=_0x186afd['params']['id'];return _0x3c4876;});return db['UserProfileSection'][_0xf337('0x6d')](_0x2b54e5,{'raw':!![],'transaction':_0x219212});})['then'](function(_0x5b33d4){var _0x37bca1=_[_0xf337('0x3d')](_['map'](_0x5b33d4,function(_0x262932){return _0x262932[_0xf337('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0x37bca1){return db[_0xf337('0x56')][_0xf337('0x42')]({'where':{'userProfileId':_0x186afd[_0xf337('0x46')]['id'],'sectionId':_[_0xf337('0x2d')](_0x37bca1,function(_0x2e8d6d){return _0x2e8d6d[_0xf337('0x64')];})},'attributes':['id','sectionId'],'raw':!![]})[_0xf337('0x28')](function(_0x417aca){var _0x2207b1=_['map'](_0x186afd[_0xf337('0x4c')],function(_0x19ccff){_0x19ccff[_0xf337('0x6c')]=_0x186afd['params']['id'];return _0x19ccff;});return db[_0xf337('0x58')]['bulkCreate'](_0x2207b1,{'raw':!![],'transaction':_0x219212});});}})[_0xf337('0x44')](handleError(_0x10b1dd,null));});}})[_0xf337('0x28')](function(_0x353859){var _0x41f78e=_[_0xf337('0x2d')](_0x353859,function(_0x3bb9e1){return _0x3bb9e1[_0xf337('0x4f')]({'plain':!![]});});})[_0xf337('0x28')](respondWithResult(_0x10b1dd,null))[_0xf337('0x44')](handleError(_0x10b1dd,null));};exports[_0xf337('0x6e')]=function(_0x12189a,_0x511879,_0x1f2e7c){return db[_0xf337('0x2e')][_0xf337('0x4a')]({'where':{'id':_0x12189a[_0xf337('0x46')]['id']}})[_0xf337('0x28')](handleEntityNotFound(_0x511879,null))[_0xf337('0x28')](function(_0x4f6843){if(_0x4f6843){return _0x4f6843[_0xf337('0x6e')](_0x12189a['query']['ids']);}})[_0xf337('0x28')](respondWithStatusCode(_0x511879,null))[_0xf337('0x44')](handleError(_0x511879,null));};exports['getResources']=function(_0x18d0a8,_0x1fac8c){var _0x28462c={};if(!_0x18d0a8[_0xf337('0x34')][_0xf337('0x6f')])throw new Error('Missing\x20section\x20parameter');if(!_0x18d0a8[_0xf337('0x34')][_0xf337('0x39')](_0xf337('0x3a'))){_0x28462c[_0xf337('0x20')]=qs[_0xf337('0x20')](_0x18d0a8['query'][_0xf337('0x20')]);_0x28462c['offset']=qs[_0xf337('0x23')](_0x18d0a8['query'][_0xf337('0x23')]);}return db[_0xf337('0x2e')]['find']({'where':{'id':_0x18d0a8['params']['id']}})[_0xf337('0x28')](function(_0x5e2b57){if(!_0x5e2b57)throw new Error(_0xf337('0x70')+_0x18d0a8[_0xf337('0x46')]['id']);return db['UserProfile'][_0xf337('0x71')](_0x18d0a8);})['then'](respondWithFilteredResult(_0x1fac8c,_0x28462c))[_0xf337('0x44')](handleError(_0x1fac8c,null));};
\ No newline at end of file
index dc70df6..fd7e7ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x073d=['hook','exports','../../mysqldb','UserProfile','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x18b940,_0x9644de){var _0x538f1c=function(_0x4c888f){while(--_0x4c888f){_0x18b940['push'](_0x18b940['shift']());}};_0x538f1c(++_0x9644de);}(_0x073d,0xd2));var _0xd073=function(_0x2a880e,_0x44beb7){_0x2a880e=_0x2a880e-0x0;var _0x45e0ce=_0x073d[_0x2a880e];return _0x45e0ce;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xd073('0x0'))['db'][_0xd073('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xd073('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd073('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3ad2eb){return function(_0x423dc8,_0x494f81,_0x11bd94){UserProfileEvents[_0xd073('0x4')](_0x3ad2eb+':'+_0x423dc8['id'],_0x423dc8);UserProfileEvents[_0xd073('0x4')](_0x3ad2eb,_0x423dc8);_0x11bd94(null);};}for(var e in events){if(events[_0xd073('0x5')](e)){var event=events[e];UserProfile[_0xd073('0x6')](e,emitEvent(event));}}module[_0xd073('0x7')]=UserProfileEvents;
\ No newline at end of file
+var _0xc6a2=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x5e2c0f,_0x5f1654){var _0x723dfa=function(_0x17c063){while(--_0x17c063){_0x5e2c0f['push'](_0x5e2c0f['shift']());}};_0x723dfa(++_0x5f1654);}(_0xc6a2,0x69));var _0x2c6a=function(_0x4a5193,_0x2a7bf8){_0x4a5193=_0x4a5193-0x0;var _0x33a1b9=_0xc6a2[_0x4a5193];return _0x33a1b9;};'use strict';var EventEmitter=require(_0x2c6a('0x0'));var UserProfile=require(_0x2c6a('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x2c6a('0x2')](0x0);var events={'afterCreate':_0x2c6a('0x3'),'afterUpdate':_0x2c6a('0x4'),'afterDestroy':_0x2c6a('0x5')};function emitEvent(_0x121b96){return function(_0xc93e9a,_0x3b1269,_0x1d2cfd){UserProfileEvents[_0x2c6a('0x6')](_0x121b96+':'+_0xc93e9a['id'],_0xc93e9a);UserProfileEvents[_0x2c6a('0x6')](_0x121b96,_0xc93e9a);_0x1d2cfd(null);};}for(var e in events){if(events[_0x2c6a('0x7')](e)){var event=events[e];UserProfile[_0x2c6a('0x8')](e,emitEvent(event));}}module[_0x2c6a('0x9')]=UserProfileEvents;
\ No newline at end of file
index ec81f96..667b4e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf55=['VoiceRecording','Agents','membername','User','agent','Telephones','role','telephone','VoiceQueues','queue','VoiceQueue','QueueCampaigns','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','mailqueues','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','whatsappaccounts','teams','Team','voicequeues','users','telephones','admin','user','ZendeskAccount','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','vtigeraccounts','dispositions','Disposition','customdashboards','intervals','pauses','Pause','scheduler','Schedule','sounds','Sound','Tag','templates','Template','triggers','Trigger','Trunk','variables','Variable','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','section','isEmpty','length','push','find','params','all','ignore','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','nolimit','limit','offset','order','sort','key','VIRTUAL','foreignKey','forEach','merge','options','includeAll','include','default','DefaultReports','CustomReports','count','rows','color','tag','ThroughTags','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','squel','exports','models','filter','field','findAll','then','catch','value','model','associatedResources','name','UserProfileResource','map','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projects','JscriptyProject','contacts','CmContact','Lists','lists','CmList','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','VoiceExtension','contexts','voicemails','VoiceMail','voicerecordings'];(function(_0x1106bf,_0x30713c){var _0x4fb6f5=function(_0x1e990e){while(--_0x1e990e){_0x1106bf['push'](_0x1106bf['shift']());}};_0x4fb6f5(++_0x30713c);}(_0xdf55,0x83));var _0x5df5=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xdf55[_0x387777];return _0x3f84c0;};'use strict';var _=require(_0x5df5('0x0'));var attributes=require(_0x5df5('0x1'));var qs=require('../../components/parsers/qs');var squel=require(_0x5df5('0x2'));module[_0x5df5('0x3')]=function(_0x538c78){var _0x3f503b=_0x538c78[_0x5df5('0x4')];function _0x381a4c(_0x521007,_0x289af4){return new Promise(function(_0x417341,_0x27ec86){if(!_0x289af4)return _0x417341(null);var _0x476e21=_0x289af4[_0x5df5('0x5')]?{[_0x289af4[_0x5df5('0x5')][_0x5df5('0x6')]]:_0x289af4[_0x5df5('0x5')]['value']}:undefined;return _0x3f503b[_0x521007][_0x5df5('0x7')]({'where':_0x476e21,'raw':!![]})[_0x5df5('0x8')](function(_0x41941e){_0x289af4['associatedResources']=_['map'](_0x41941e,'id');_0x417341(_0x289af4);})[_0x5df5('0x9')](function(_0x4e80bd){_0x27ec86(_0x4e80bd);});});}function _0x45ad13(_0x3cd0c0,_0x491350){return new Promise(function(_0x59d273,_0x40322d){var _0xba664a=_0x3cd0c0[_0x5df5('0x5')]?{[_0x3cd0c0[_0x5df5('0x5')][_0x5df5('0x6')]]:_0x3cd0c0[_0x5df5('0x5')][_0x5df5('0xa')]}:undefined;return _0x3f503b[_0x3cd0c0[_0x5df5('0xb')]][_0x5df5('0x7')]({'where':_0xba664a,'raw':!![]})[_0x5df5('0x8')](function(_0x555d3f){_0x491350[_0x5df5('0xc')]=_['map'](_0x555d3f,function(_0x13eb03){return _0x13eb03[_0x5df5('0xd')];});_0x59d273(_0x491350);})[_0x5df5('0x9')](function(_0x3657c8){_0x40322d(_0x3657c8);});});}function _0x282d53(_0x4e74c4,_0x27b3fb,_0x457205){if(!_0x27b3fb)return Promise['resolve'](null);return new Promise(function(_0x9a52c9,_0x45813f){return _0x3f503b[_0x5df5('0xe')][_0x5df5('0x7')]({'where':{'sectionId':_0x27b3fb['id']},'raw':!![]})[_0x5df5('0x8')](function(_0x4b499d){if(_0x4e74c4['field']&&_0x4e74c4[_0x5df5('0x6')]!=='id'){_0x27b3fb['associatedResources']=_[_0x5df5('0xf')](_0x4b499d,function(_0x40a8f5){return _0x40a8f5[_0x4e74c4[_0x5df5('0x6')]];});}else{if(_0x457205===_0x5df5('0x10')){_0x27b3fb[_0x5df5('0xc')]=_['map'](_0x4b499d,function(_0x1d6474){return{'id':_0x1d6474[_0x5df5('0x11')],'type':_0x1d6474[_0x5df5('0x12')]};});}else{_0x27b3fb[_0x5df5('0xc')]=_[_0x5df5('0xf')](_0x4b499d,function(_0x382999){return _0x382999['resourceId'];});}}_0x9a52c9(_0x27b3fb);})[_0x5df5('0x9')](function(_0x2e862d){_0x45813f(_0x2e862d);});});}function _0x8742a7(_0x446bba,_0x5ca542){var _0x4358ba={'parentSections':[]};switch(_0x446bba[_0x5df5('0x13')]()){case _0x5df5('0x14'):_0x4358ba['childModel']='SquareProject';break;case'odbc':_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x16');break;case _0x5df5('0x17'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x18');_0x4358ba[_0x5df5('0x19')]=[{'name':_0x5df5('0x1a'),'field':_0x5df5('0xd'),'foreignKey':'projectName'}];break;case _0x5df5('0x1b'):_0x4358ba['childModel']=_0x5df5('0x1c');break;case _0x5df5('0x1d'):_0x4358ba['childModel']=_0x5df5('0x1e');_0x4358ba['parentSections']=[{'name':_0x5df5('0x1f'),'field':'id','foreignKey':'ListId'}];break;case _0x5df5('0x20'):_0x4358ba['childModel']=_0x5df5('0x21');break;case'companies':_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x22');break;case _0x5df5('0x23'):_0x4358ba['childModel']=_0x5df5('0x24');break;case _0x5df5('0x25'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x26');break;case _0x5df5('0x27'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x28');break;case'faxqueues':_0x4358ba['childModel']=_0x5df5('0x29');break;case _0x5df5('0x2a'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x2b');break;case _0x5df5('0x2c'):case _0x5df5('0x2d'):case'outboundroutes':_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x2e');break;case _0x5df5('0x2f'):_0x4358ba[_0x5df5('0x15')]='VoiceContext';break;case _0x5df5('0x30'):_0x4358ba['childModel']=_0x5df5('0x31');break;case _0x5df5('0x32'):_0x4358ba['childModel']=_0x5df5('0x33');_0x4358ba['parentSections']=[{'name':_0x5df5('0x34'),'field':_0x5df5('0xd'),'foreignKey':_0x5df5('0x35'),'model':_0x5df5('0x36'),'filter':{'field':'role','value':[_0x5df5('0x37')]}},{'name':_0x5df5('0x38'),'field':_0x5df5('0xd'),'foreignKey':_0x5df5('0x35'),'model':'User','filter':{'field':_0x5df5('0x39'),'value':[_0x5df5('0x3a')]}},{'name':_0x5df5('0x3b'),'field':_0x5df5('0xd'),'foreignKey':_0x5df5('0x3c'),'model':_0x5df5('0x3d'),'filter':{'field':_0x5df5('0x12'),'value':['inbound']}},{'name':_0x5df5('0x3e'),'field':_0x5df5('0xd'),'foreignKey':'queue','model':_0x5df5('0x3d'),'filter':{'field':_0x5df5('0x12'),'value':['outbound']}}];break;case _0x5df5('0x3f'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x40');break;case _0x5df5('0x41'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x42');break;case _0x5df5('0x43'):_0x4358ba[_0x5df5('0x15')]='VoicePrefix';break;case'ivrcampaigns':_0x4358ba[_0x5df5('0x15')]='Campaign';break;case _0x5df5('0x44'):_0x4358ba[_0x5df5('0x15')]='MailQueue';break;case _0x5df5('0x45'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x46');break;case _0x5df5('0x47'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x48');break;case _0x5df5('0x49'):_0x4358ba[_0x5df5('0x15')]='OpenchannelQueue';break;case _0x5df5('0x4a'):_0x4358ba['childModel']=_0x5df5('0x4b');break;case _0x5df5('0x4c'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x4d');break;case _0x5df5('0x4e'):_0x4358ba['childModel']=_0x5df5('0x4f');break;case _0x5df5('0x50'):_0x4358ba[_0x5df5('0x15')]='WhatsappQueue';break;case _0x5df5('0x51'):_0x4358ba[_0x5df5('0x15')]='WhatsappAccount';break;case _0x5df5('0x52'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x53');break;case _0x5df5('0x54'):case'queuecampaigns':_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x3d');if(_0x5ca542){_0x4358ba['parentSections']=[{'name':_0x5df5('0x3b')},{'name':_0x5df5('0x3e')}];}break;case _0x5df5('0x55'):case'agents':case _0x5df5('0x56'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x36');if(_0x5ca542){_0x4358ba[_0x5df5('0x19')]=[{'name':'Users','filter':{'field':_0x5df5('0x39'),'value':[_0x5df5('0x57'),_0x5df5('0x58')]},'ignore':!![]},{'name':_0x5df5('0x34')},{'name':_0x5df5('0x38')}];}break;case'zendeskaccounts':_0x4358ba['childModel']=_0x5df5('0x59');break;case'salesforceaccounts':_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x5a');break;case _0x5df5('0x5b'):_0x4358ba[_0x5df5('0x15')]='FreshdeskAccount';break;case _0x5df5('0x5c'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x5d');break;case _0x5df5('0x5e'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x5f');break;case'zohoaccounts':_0x4358ba[_0x5df5('0x15')]='ZohoAccount';break;case _0x5df5('0x60'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x36');break;case'cannedanswers':_0x4358ba[_0x5df5('0x15')]='CannedAnswer';break;case _0x5df5('0x61'):_0x4358ba['childModel']=_0x5df5('0x62');break;case _0x5df5('0x63'):_0x4358ba[_0x5df5('0x15')]='Dashboard';break;case _0x5df5('0x64'):_0x4358ba[_0x5df5('0x15')]='Interval';break;case _0x5df5('0x65'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x66');break;case _0x5df5('0x67'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x68');break;case _0x5df5('0x69'):_0x4358ba['childModel']=_0x5df5('0x6a');break;case'tags':_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x6b');break;case _0x5df5('0x6c'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x6d');break;case _0x5df5('0x6e'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x6f');break;case'trunks':_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x70');break;case _0x5df5('0x71'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x72');break;case'plugins':_0x4358ba[_0x5df5('0x15')]='Plugin';break;case'extractedreports':_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x10');_0x4358ba[_0x5df5('0x19')]=[{'name':_0x5df5('0x73'),'field':'id','foreignKey':_0x5df5('0x74')}];break;case _0x5df5('0x75'):_0x4358ba['childModel']=_0x5df5('0x76');break;}return _0x4358ba;}function _0xac9e68(_0x533996,_0x5b3375){var _0x7fdce7=_0x533996[_0x5df5('0x77')](0x0)[_0x5df5('0x78')]()+_0x533996[_0x5df5('0x79')](0x1);var _0x8cc729={'type':_0x3f503b[_0x5df5('0x7a')]['QueryTypes']['SELECT'],'raw':!![]};return new Promise(function(_0x5b9dd8,_0x2236bd){var _0x43fccb=squel['select']()[_0x5df5('0x6')](_0x5df5('0x7b')+_0x7fdce7+_0x5df5('0x7c'),'id')[_0x5df5('0x6')](_0x5df5('0x7d'))[_0x5df5('0x7e')](_0x5df5('0x7f')+_0x533996+_0x5df5('0x80'),'ui')[_0x5df5('0x81')]('ui.UserId\x20=\x20?',_0x5b3375['id']);return _0x3f503b[_0x5df5('0x82')][_0x5df5('0x83')](_0x43fccb[_0x5df5('0x84')](),_0x8cc729)[_0x5df5('0x8')](function(_0x2fc9b4){_0x5b3375[_0x7fdce7+_0x5df5('0x85')]=_0x2fc9b4;_0x5b9dd8(_0x2fc9b4);})[_0x5df5('0x9')](function(_0x457fb4){_0x2236bd(_0x457fb4);});});}return _0x538c78[_0x5df5('0x86')](_0x5df5('0x87'),attributes,{'tableName':_0x5df5('0x88'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x3b0289){var _0x4e782b={'raw':![],'where':{}};var _0x209780={};var _0x260980={'count':0x0,'rows':[]};var _0x5b6a79=_0x3b0289[_0x5df5('0x83')][_0x5df5('0x89')];var _0xbcea82=_0x3b0289[_0x5df5('0x83')]['mergeResources']||![];var _0x1ea684=_0x8742a7(_0x5b6a79,_0xbcea82);if(!_0x1ea684[_0x5df5('0x15')])throw new Error('Invalid\x20section\x20\x27'+_0x5b6a79+'\x27');var _0x54e677=[{'name':_0x5b6a79}];if(!_[_0x5df5('0x8a')](_0x1ea684[_0x5df5('0x19')]))_0x54e677=_0x1ea684[_0x5df5('0x19')];var _0x542ed5=[];for(var _0x4edb86=0x0;_0x4edb86<_0x54e677[_0x5df5('0x8b')];_0x4edb86++){_0x542ed5[_0x5df5('0x8c')](_0x3f503b['UserProfileSection'][_0x5df5('0x8d')]({'where':{'userProfileId':_0x3b0289[_0x5df5('0x8e')]['id'],'name':_0x54e677[_0x4edb86][_0x5df5('0xd')]},'raw':!![]}));}return Promise[_0x5df5('0x8f')](_0x542ed5)[_0x5df5('0x8')](function(_0x52b7ec){var _0x9674a7=_[_0x5df5('0x5')](_0x52b7ec,function(_0x1daf21){return _0x1daf21?_0x1daf21:undefined;});var _0x2398b3=_['filter'](_0x54e677,[_0x5df5('0x90'),!![]]);var _0x577955=_[_0x5df5('0x8a')](_0x9674a7)&&_[_0x5df5('0x8a')](_0x2398b3)?null:_['union'](_0x2398b3,_0x9674a7);if(!_0x577955)return null;var _0x1dc6b1=[];for(var _0x5ed4a6=0x0;_0x5ed4a6<_0x577955[_0x5df5('0x8b')];_0x5ed4a6++){var _0x4fff11=_[_0x5df5('0x8d')](_0x54e677,function(_0x3b8aaf){return _0x577955[_0x5ed4a6]?_0x3b8aaf[_0x5df5('0xd')]===_0x577955[_0x5ed4a6][_0x5df5('0xd')]:null;});if(_0x4fff11){if(_0x577955[_0x5ed4a6][_0x5df5('0x90')]){_0x1dc6b1[_0x5df5('0x8c')](_0x381a4c(_0x1ea684['childModel'],_0x577955[_0x5ed4a6]));}else{if(!_0x577955[_0x5ed4a6][_0x5df5('0x91')]){_0x1dc6b1[_0x5df5('0x8c')](_0x282d53(_0x4fff11,_0x577955[_0x5ed4a6],_0x1ea684[_0x5df5('0x15')]));}else{if(_0x4fff11['model']){_0x1dc6b1[_0x5df5('0x8c')](_0x45ad13(_0x4fff11,_0x577955[_0x5ed4a6]));}}}}}return Promise[_0x5df5('0x8f')](_0x1dc6b1);})[_0x5df5('0x8')](function(_0x1e2a3b){var _0x382f60=_0x1e2a3b;var _0x6e375f=null;if(_0x382f60){_0x6e375f=_0x382f60['length']===0x1?_0x382f60[0x0]:null;}if(!_0x6e375f&&!_0x382f60)return _0x260980;var _0x482ac5=_0x3f503b[_0x1ea684[_0x5df5('0x15')]][_0x5df5('0x92')];_0x209780[_0x5df5('0xb')]=_[_0x5df5('0x93')](_0x482ac5);_0x209780[_0x5df5('0x83')]=_['keys'](_0x3b0289[_0x5df5('0x83')]);_0x209780[_0x5df5('0x94')]=_[_0x5df5('0x95')](_0x209780['model'],_0x209780[_0x5df5('0x83')]);_0x4e782b[_0x5df5('0x96')]=_[_0x5df5('0x95')](_0x209780[_0x5df5('0xb')],qs[_0x5df5('0x97')](_0x3b0289[_0x5df5('0x83')][_0x5df5('0x97')]));_0x4e782b[_0x5df5('0x96')]=_0x4e782b[_0x5df5('0x96')]['length']?_0x4e782b[_0x5df5('0x96')]:_0x209780[_0x5df5('0xb')];if(!_0x3b0289[_0x5df5('0x83')]['hasOwnProperty'](_0x5df5('0x98'))){_0x4e782b[_0x5df5('0x99')]=qs['limit'](_0x3b0289[_0x5df5('0x83')][_0x5df5('0x99')]);_0x4e782b[_0x5df5('0x9a')]=qs['offset'](_0x3b0289[_0x5df5('0x83')]['offset']);}_0x4e782b[_0x5df5('0x9b')]=qs[_0x5df5('0x9c')](_0x3b0289[_0x5df5('0x83')][_0x5df5('0x9c')]);_0x4e782b[_0x5df5('0x81')]=qs[_0x5df5('0x94')](_['pick'](_0x3b0289[_0x5df5('0x83')],_0x209780[_0x5df5('0x94')]));if(_0x3b0289['query'][_0x5df5('0x5')]){_0x4e782b['where']=_['merge'](_0x4e782b[_0x5df5('0x81')],{'$or':_['map'](_0x482ac5,function(_0x22dfa8){if(_0x22dfa8[_0x5df5('0x12')][_0x5df5('0x9d')]!==_0x5df5('0x9e')){var _0x453238={};_0x453238[_0x22dfa8[_0x5df5('0x6')]]={'$like':'%'+_0x3b0289['query'][_0x5df5('0x5')]+'%'};return _0x453238;}})});}var _0x36d635=[];var _0x68cbcc=null;var _0x58afa3={};if(_0x6e375f){_0x68cbcc=_[_0x5df5('0x8d')](_0x54e677,[_0x5df5('0xd'),_0x6e375f['name']]);if(_0x68cbcc[_0x5df5('0x6')]){_0x58afa3={};if(_0x1ea684[_0x5df5('0x15')]===_0x5df5('0x10')){_0x58afa3[_0x68cbcc[_0x5df5('0x9f')]]=_[_0x5df5('0xf')](_0x6e375f['associatedResources'],'id');}else{_0x58afa3[_0x68cbcc[_0x5df5('0x9f')]]=_0x6e375f['associatedResources'];}_0x36d635[_0x5df5('0x8c')](_0x58afa3);}else{_0x4e782b['where']['id']=_0x6e375f[_0x5df5('0xc')];}}else{for(var _0x168289=0x0;_0x168289<_0x382f60[_0x5df5('0x8b')];_0x168289++){_0x68cbcc=_[_0x5df5('0x8d')](_0x54e677,[_0x5df5('0xd'),_0x382f60[_0x168289]['name']]);if(_0x68cbcc['field']){_0x58afa3={};_0x58afa3[_0x68cbcc[_0x5df5('0x9f')]]=_0x382f60[_0x168289][_0x5df5('0xc')];_0x36d635[_0x5df5('0x8c')](_0x58afa3);}else{if(!_0x4e782b[_0x5df5('0x81')]['id'])_0x4e782b[_0x5df5('0x81')]['id']=[];_0x382f60[_0x168289]['associatedResources'][_0x5df5('0xa0')](function(_0xdceef4){_0x4e782b[_0x5df5('0x81')]['id'][_0x5df5('0x8c')](_0xdceef4);});}}}if(!_[_0x5df5('0x8a')](_0x36d635)){_0x4e782b[_0x5df5('0x81')]=_[_0x5df5('0xa1')](_0x4e782b[_0x5df5('0x81')],{'$and':{'$or':_0x36d635}});}_0x4e782b=_[_0x5df5('0xa1')]({},_0x4e782b,_0x3b0289[_0x5df5('0xa2')]);if(_0x6e375f&&!_0x6e375f[_0x5df5('0x91')]&&_0x1ea684['childModel']==='AnalyticExtractedReport'){if(_0x3b0289['query'][_0x5df5('0xa3')]){_0x4e782b[_0x5df5('0xa4')]=[{'all':!![]}];}return _0x3f503b[_0x1ea684['childModel']][_0x5df5('0x7')](_0x4e782b)[_0x5df5('0x8')](function(_0x1e1d34){var _0xc91201=[];_0x1e1d34[_0x5df5('0xa0')](function(_0x26bbe0){var _0x36d8ee;switch(_0x26bbe0['reportType']){case _0x5df5('0xa5'):_0x36d8ee=_[_0x5df5('0x8d')](_0x6e375f[_0x5df5('0xc')],function(_0x1fc3c4){return _0x1fc3c4['id']===_0x26bbe0[_0x5df5('0x74')]&&_0x1fc3c4[_0x5df5('0x12')]===_0x5df5('0xa6');});break;case'custom':_0x36d8ee=_[_0x5df5('0x8d')](_0x6e375f[_0x5df5('0xc')],function(_0x2ed5b9){return _0x2ed5b9['id']===_0x26bbe0[_0x5df5('0x74')]&&_0x2ed5b9[_0x5df5('0x12')]===_0x5df5('0xa7');});break;}if(_0x36d8ee)_0xc91201[_0x5df5('0x8c')](_0x26bbe0);});_0x260980[_0x5df5('0xa8')]=_0xc91201['length'];_0x260980[_0x5df5('0xa9')]=_0xc91201;return _0x260980;});}else{return _0x3f503b[_0x1ea684[_0x5df5('0x15')]]['count']({'where':_0x4e782b[_0x5df5('0x81')]})[_0x5df5('0x8')](function(_0x25a2e9){_0x260980[_0x5df5('0xa8')]=_0x25a2e9;if(_0x3b0289[_0x5df5('0x83')]['includeAll']){if(_0x1ea684[_0x5df5('0x15')]===_0x5df5('0x1e')){_0x4e782b[_0x5df5('0xa4')]=[{'model':_0x3f503b['Tag'],'as':'Tags','attributes':['id',_0x5df5('0xd'),_0x5df5('0xaa')],'required':_0x3b0289[_0x5df5('0x83')][_0x5df5('0xab')]?!![]:![]},{'model':_0x3f503b[_0x5df5('0x6b')],'as':_0x5df5('0xac'),'attributes':['id','name','color'],'through':_0x3b0289['query'][_0x5df5('0xab')]?{'attributes':[],'where':{'TagId':_0x3b0289[_0x5df5('0x83')][_0x5df5('0xab')]||undefined}}:{},'required':_0x3b0289['query'][_0x5df5('0xab')]?!![]:![]}];}else{_0x4e782b['include']=[{'all':!![]}];}}return _0x3f503b[_0x1ea684[_0x5df5('0x15')]][_0x5df5('0x7')](_0x4e782b);})['then'](function(_0x18281b){_0x260980[_0x5df5('0xa9')]=_0x18281b;if(_0x5b6a79==='Agents'&&_0x3b0289[_0x5df5('0x83')][_0x5df5('0xad')]===_0x5df5('0xae')){var _0x9fffdb=[];for(var _0x5372c8=0x0;_0x5372c8<_0x260980['rows'][_0x5df5('0x8b')];_0x5372c8++){_0x9fffdb[_0x5df5('0x8c')](_0xac9e68(_0x5df5('0xaf'),_0x260980['rows'][_0x5372c8][_0x5df5('0xb0')]));_0x9fffdb[_0x5df5('0x8c')](_0xac9e68(_0x5df5('0xb1'),_0x260980[_0x5df5('0xa9')][_0x5372c8][_0x5df5('0xb0')]));_0x9fffdb['push'](_0xac9e68(_0x5df5('0xb2'),_0x260980[_0x5df5('0xa9')][_0x5372c8][_0x5df5('0xb0')]));_0x9fffdb[_0x5df5('0x8c')](_0xac9e68(_0x5df5('0xb3'),_0x260980[_0x5df5('0xa9')][_0x5372c8][_0x5df5('0xb0')]));_0x9fffdb[_0x5df5('0x8c')](_0xac9e68(_0x5df5('0xb4'),_0x260980[_0x5df5('0xa9')][_0x5372c8]['dataValues']));_0x9fffdb[_0x5df5('0x8c')](_0xac9e68(_0x5df5('0xb5'),_0x260980['rows'][_0x5372c8][_0x5df5('0xb0')]));}return Promise[_0x5df5('0x8f')](_0x9fffdb)['then'](function(){return _0x260980;});}return _0x260980;});}});}}});};
\ No newline at end of file
+var _0xb016=['SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','Lists','ListId','lists','CmList','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','voicemails','VoiceMail','voicerecordings','Agents','name','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','QueueCampaigns','outbound','musiconholds','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','MailSubstatus','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','Team','voicequeues','queuecampaigns','users','agents','telephones','admin','user','zendeskaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','deskaccounts','vtigeraccounts','cannedanswers','dispositions','Disposition','Dashboard','Interval','pauses','Sound','Tag','Template','triggers','Trigger','variables','Variable','Plugin','extractedreports','Reports','reportId','AnalyticMetric','charAt','toUpperCase','Sequelize','QueryTypes','select','ui.','InteractionId','ui.createdAt','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','define','UserProfile','user_profiles','section','Invalid\x20section\x20\x27','isEmpty','push','UserProfileSection','find','all','ignore','union','length','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','offset','order','sort','key','VIRTUAL','foreignKey','forEach','merge','options','includeAll','include','reportType','default','custom','CustomReports','count','rows','CmContact','Tags','color','tag','ThroughTags','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','exports','models','field','filter','then','associatedResources','map','catch','value','model','resolve','UserProfileResource','findAll','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc'];(function(_0x5655ab,_0x32197a){var _0x587792=function(_0x3b97c7){while(--_0x3b97c7){_0x5655ab['push'](_0x5655ab['shift']());}};_0x587792(++_0x32197a);}(_0xb016,0x159));var _0x6b01=function(_0x124a29,_0x3f92ca){_0x124a29=_0x124a29-0x0;var _0x473691=_0xb016[_0x124a29];return _0x473691;};'use strict';var _=require(_0x6b01('0x0'));var attributes=require(_0x6b01('0x1'));var qs=require('../../components/parsers/qs');var squel=require('squel');module[_0x6b01('0x2')]=function(_0x531b6a){var _0x160a7d=_0x531b6a[_0x6b01('0x3')];function _0x161b59(_0x3b9de1,_0x5964ca){return new Promise(function(_0x1b7dd6,_0x65407a){if(!_0x5964ca)return _0x1b7dd6(null);var _0x192b2d=_0x5964ca['filter']?{[_0x5964ca['filter'][_0x6b01('0x4')]]:_0x5964ca[_0x6b01('0x5')]['value']}:undefined;return _0x160a7d[_0x3b9de1]['findAll']({'where':_0x192b2d,'raw':!![]})[_0x6b01('0x6')](function(_0x1cb3a6){_0x5964ca[_0x6b01('0x7')]=_[_0x6b01('0x8')](_0x1cb3a6,'id');_0x1b7dd6(_0x5964ca);})[_0x6b01('0x9')](function(_0x5bed15){_0x65407a(_0x5bed15);});});}function _0x4b4a4d(_0x4627ef,_0x24049f){return new Promise(function(_0x2660c7,_0x5a8817){var _0x200614=_0x4627ef['filter']?{[_0x4627ef['filter'][_0x6b01('0x4')]]:_0x4627ef['filter'][_0x6b01('0xa')]}:undefined;return _0x160a7d[_0x4627ef[_0x6b01('0xb')]]['findAll']({'where':_0x200614,'raw':!![]})[_0x6b01('0x6')](function(_0x4ea5fa){_0x24049f['associatedResources']=_['map'](_0x4ea5fa,function(_0x3d4666){return _0x3d4666['name'];});_0x2660c7(_0x24049f);})['catch'](function(_0x3a259f){_0x5a8817(_0x3a259f);});});}function _0x327e86(_0x20dd83,_0x41efa3,_0x3d7045){if(!_0x41efa3)return Promise[_0x6b01('0xc')](null);return new Promise(function(_0x122769,_0x33ffe8){return _0x160a7d[_0x6b01('0xd')][_0x6b01('0xe')]({'where':{'sectionId':_0x41efa3['id']},'raw':!![]})[_0x6b01('0x6')](function(_0x4f2d08){if(_0x20dd83[_0x6b01('0x4')]&&_0x20dd83[_0x6b01('0x4')]!=='id'){_0x41efa3[_0x6b01('0x7')]=_[_0x6b01('0x8')](_0x4f2d08,function(_0x5a7d75){return _0x5a7d75[_0x20dd83[_0x6b01('0x4')]];});}else{if(_0x3d7045===_0x6b01('0xf')){_0x41efa3[_0x6b01('0x7')]=_['map'](_0x4f2d08,function(_0x3029e2){return{'id':_0x3029e2[_0x6b01('0x10')],'type':_0x3029e2[_0x6b01('0x11')]};});}else{_0x41efa3[_0x6b01('0x7')]=_[_0x6b01('0x8')](_0x4f2d08,function(_0x181b09){return _0x181b09[_0x6b01('0x10')];});}}_0x122769(_0x41efa3);})['catch'](function(_0x7caa07){_0x33ffe8(_0x7caa07);});});}function _0xcf9200(_0x42c990,_0x51243c){var _0x399808={'parentSections':[]};switch(_0x42c990[_0x6b01('0x12')]()){case _0x6b01('0x13'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x15');break;case _0x6b01('0x16'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x17');break;case _0x6b01('0x18'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x19');_0x399808[_0x6b01('0x1a')]=[{'name':_0x6b01('0x1b'),'field':'name','foreignKey':_0x6b01('0x1c')}];break;case _0x6b01('0x1d'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x1e');break;case _0x6b01('0x1f'):_0x399808['childModel']='CmContact';_0x399808[_0x6b01('0x1a')]=[{'name':_0x6b01('0x20'),'field':'id','foreignKey':_0x6b01('0x21')}];break;case _0x6b01('0x22'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x23');break;case'companies':_0x399808[_0x6b01('0x14')]='CmCompany';break;case _0x6b01('0x24'):_0x399808['childModel']=_0x6b01('0x25');break;case _0x6b01('0x26'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x27');break;case _0x6b01('0x28'):_0x399808['childModel']=_0x6b01('0x29');break;case _0x6b01('0x2a'):_0x399808[_0x6b01('0x14')]='FaxQueue';break;case'faxaccounts':_0x399808[_0x6b01('0x14')]='FaxAccount';break;case _0x6b01('0x2b'):case _0x6b01('0x2c'):case _0x6b01('0x2d'):_0x399808['childModel']=_0x6b01('0x2e');break;case _0x6b01('0x2f'):_0x399808[_0x6b01('0x14')]='VoiceContext';break;case _0x6b01('0x30'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x31');break;case _0x6b01('0x32'):_0x399808[_0x6b01('0x14')]='VoiceRecording';_0x399808[_0x6b01('0x1a')]=[{'name':_0x6b01('0x33'),'field':_0x6b01('0x34'),'foreignKey':_0x6b01('0x35'),'model':_0x6b01('0x36'),'filter':{'field':_0x6b01('0x37'),'value':[_0x6b01('0x38')]}},{'name':_0x6b01('0x39'),'field':'name','foreignKey':_0x6b01('0x35'),'model':'User','filter':{'field':_0x6b01('0x37'),'value':[_0x6b01('0x3a')]}},{'name':_0x6b01('0x3b'),'field':_0x6b01('0x34'),'foreignKey':_0x6b01('0x3c'),'model':_0x6b01('0x3d'),'filter':{'field':_0x6b01('0x11'),'value':['inbound']}},{'name':_0x6b01('0x3e'),'field':_0x6b01('0x34'),'foreignKey':_0x6b01('0x3c'),'model':_0x6b01('0x3d'),'filter':{'field':_0x6b01('0x11'),'value':[_0x6b01('0x3f')]}}];break;case _0x6b01('0x40'):_0x399808[_0x6b01('0x14')]='VoiceMusicOnHold';break;case _0x6b01('0x41'):_0x399808['childModel']=_0x6b01('0x42');break;case _0x6b01('0x43'):_0x399808['childModel']=_0x6b01('0x44');break;case _0x6b01('0x45'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x46');break;case _0x6b01('0x47'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x48');break;case _0x6b01('0x49'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x4a');break;case'mailsubstatuses':_0x399808[_0x6b01('0x14')]=_0x6b01('0x4b');break;case'openchannelqueues':_0x399808['childModel']=_0x6b01('0x4c');break;case _0x6b01('0x4d'):_0x399808['childModel']=_0x6b01('0x4e');break;case _0x6b01('0x4f'):_0x399808['childModel']=_0x6b01('0x50');break;case'smsaccounts':_0x399808[_0x6b01('0x14')]=_0x6b01('0x51');break;case _0x6b01('0x52'):_0x399808['childModel']=_0x6b01('0x53');break;case _0x6b01('0x54'):_0x399808['childModel']='WhatsappAccount';break;case'teams':_0x399808[_0x6b01('0x14')]=_0x6b01('0x55');break;case _0x6b01('0x56'):case _0x6b01('0x57'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x3d');if(_0x51243c){_0x399808['parentSections']=[{'name':_0x6b01('0x3b')},{'name':_0x6b01('0x3e')}];}break;case _0x6b01('0x58'):case _0x6b01('0x59'):case _0x6b01('0x5a'):_0x399808[_0x6b01('0x14')]='User';if(_0x51243c){_0x399808[_0x6b01('0x1a')]=[{'name':'Users','filter':{'field':'role','value':[_0x6b01('0x5b'),_0x6b01('0x5c')]},'ignore':!![]},{'name':'Agents'},{'name':_0x6b01('0x39')}];}break;case _0x6b01('0x5d'):_0x399808[_0x6b01('0x14')]='ZendeskAccount';break;case'salesforceaccounts':_0x399808['childModel']=_0x6b01('0x5e');break;case _0x6b01('0x5f'):_0x399808['childModel']=_0x6b01('0x60');break;case'sugarcrmaccounts':_0x399808['childModel']='SugarcrmAccount';break;case _0x6b01('0x61'):_0x399808[_0x6b01('0x14')]='DeskAccount';break;case'zohoaccounts':_0x399808[_0x6b01('0x14')]='ZohoAccount';break;case _0x6b01('0x62'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x36');break;case _0x6b01('0x63'):_0x399808[_0x6b01('0x14')]='CannedAnswer';break;case _0x6b01('0x64'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x65');break;case'customdashboards':_0x399808[_0x6b01('0x14')]=_0x6b01('0x66');break;case'intervals':_0x399808[_0x6b01('0x14')]=_0x6b01('0x67');break;case _0x6b01('0x68'):_0x399808[_0x6b01('0x14')]='Pause';break;case'scheduler':_0x399808[_0x6b01('0x14')]='Schedule';break;case'sounds':_0x399808[_0x6b01('0x14')]=_0x6b01('0x69');break;case'tags':_0x399808[_0x6b01('0x14')]=_0x6b01('0x6a');break;case'templates':_0x399808[_0x6b01('0x14')]=_0x6b01('0x6b');break;case _0x6b01('0x6c'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x6d');break;case'trunks':_0x399808[_0x6b01('0x14')]='Trunk';break;case _0x6b01('0x6e'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x6f');break;case'plugins':_0x399808[_0x6b01('0x14')]=_0x6b01('0x70');break;case _0x6b01('0x71'):_0x399808[_0x6b01('0x14')]='AnalyticExtractedReport';_0x399808[_0x6b01('0x1a')]=[{'name':_0x6b01('0x72'),'field':'id','foreignKey':_0x6b01('0x73')}];break;case'metrics':_0x399808['childModel']=_0x6b01('0x74');break;}return _0x399808;}function _0x1aefc2(_0x11cbcc,_0x4e1702){var _0x21b99f=_0x11cbcc[_0x6b01('0x75')](0x0)[_0x6b01('0x76')]()+_0x11cbcc['slice'](0x1);var _0x54b3ae={'type':_0x160a7d[_0x6b01('0x77')][_0x6b01('0x78')]['SELECT'],'raw':!![]};return new Promise(function(_0x3e16e8,_0x3faa54){var _0xe6d027=squel[_0x6b01('0x79')]()[_0x6b01('0x4')](_0x6b01('0x7a')+_0x21b99f+_0x6b01('0x7b'),'id')[_0x6b01('0x4')](_0x6b01('0x7c'))['from'](_0x6b01('0x7d')+_0x11cbcc+_0x6b01('0x7e'),'ui')[_0x6b01('0x7f')](_0x6b01('0x80'),_0x4e1702['id']);return _0x160a7d[_0x6b01('0x81')][_0x6b01('0x82')](_0xe6d027[_0x6b01('0x83')](),_0x54b3ae)[_0x6b01('0x6')](function(_0x281e55){_0x4e1702[_0x21b99f+'OpenTabs']=_0x281e55;_0x3e16e8(_0x281e55);})[_0x6b01('0x9')](function(_0x25b39b){_0x3faa54(_0x25b39b);});});}return _0x531b6a[_0x6b01('0x84')](_0x6b01('0x85'),attributes,{'tableName':_0x6b01('0x86'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x1dda2f){var _0x4c84cc={'raw':![],'where':{}};var _0x523102={};var _0x38ae38={'count':0x0,'rows':[]};var _0x270128=_0x1dda2f[_0x6b01('0x82')][_0x6b01('0x87')];var _0x728ae2=_0x1dda2f[_0x6b01('0x82')]['mergeResources']||![];var _0x2bd87d=_0xcf9200(_0x270128,_0x728ae2);if(!_0x2bd87d[_0x6b01('0x14')])throw new Error(_0x6b01('0x88')+_0x270128+'\x27');var _0x44c3d1=[{'name':_0x270128}];if(!_[_0x6b01('0x89')](_0x2bd87d[_0x6b01('0x1a')]))_0x44c3d1=_0x2bd87d[_0x6b01('0x1a')];var _0x582bff=[];for(var _0x3ea965=0x0;_0x3ea965<_0x44c3d1['length'];_0x3ea965++){_0x582bff[_0x6b01('0x8a')](_0x160a7d[_0x6b01('0x8b')][_0x6b01('0x8c')]({'where':{'userProfileId':_0x1dda2f['params']['id'],'name':_0x44c3d1[_0x3ea965][_0x6b01('0x34')]},'raw':!![]}));}return Promise[_0x6b01('0x8d')](_0x582bff)[_0x6b01('0x6')](function(_0x14742e){var _0xa29570=_[_0x6b01('0x5')](_0x14742e,function(_0xdb2660){return _0xdb2660?_0xdb2660:undefined;});var _0x17481f=_[_0x6b01('0x5')](_0x44c3d1,[_0x6b01('0x8e'),!![]]);var _0x350e68=_[_0x6b01('0x89')](_0xa29570)&&_[_0x6b01('0x89')](_0x17481f)?null:_[_0x6b01('0x8f')](_0x17481f,_0xa29570);if(!_0x350e68)return null;var _0x207e0a=[];for(var _0x13ceac=0x0;_0x13ceac<_0x350e68[_0x6b01('0x90')];_0x13ceac++){var _0x3f077f=_[_0x6b01('0x8c')](_0x44c3d1,function(_0x4a8fcb){return _0x350e68[_0x13ceac]?_0x4a8fcb[_0x6b01('0x34')]===_0x350e68[_0x13ceac][_0x6b01('0x34')]:null;});if(_0x3f077f){if(_0x350e68[_0x13ceac][_0x6b01('0x8e')]){_0x207e0a[_0x6b01('0x8a')](_0x161b59(_0x2bd87d[_0x6b01('0x14')],_0x350e68[_0x13ceac]));}else{if(!_0x350e68[_0x13ceac][_0x6b01('0x91')]){_0x207e0a[_0x6b01('0x8a')](_0x327e86(_0x3f077f,_0x350e68[_0x13ceac],_0x2bd87d[_0x6b01('0x14')]));}else{if(_0x3f077f[_0x6b01('0xb')]){_0x207e0a[_0x6b01('0x8a')](_0x4b4a4d(_0x3f077f,_0x350e68[_0x13ceac]));}}}}}return Promise[_0x6b01('0x8d')](_0x207e0a);})[_0x6b01('0x6')](function(_0x468a0b){var _0x30171f=_0x468a0b;var _0x1a0bb7=null;if(_0x30171f){_0x1a0bb7=_0x30171f['length']===0x1?_0x30171f[0x0]:null;}if(!_0x1a0bb7&&!_0x30171f)return _0x38ae38;var _0xbcba19=_0x160a7d[_0x2bd87d[_0x6b01('0x14')]][_0x6b01('0x92')];_0x523102[_0x6b01('0xb')]=_[_0x6b01('0x93')](_0xbcba19);_0x523102[_0x6b01('0x82')]=_[_0x6b01('0x93')](_0x1dda2f[_0x6b01('0x82')]);_0x523102[_0x6b01('0x94')]=_[_0x6b01('0x95')](_0x523102[_0x6b01('0xb')],_0x523102[_0x6b01('0x82')]);_0x4c84cc[_0x6b01('0x96')]=_[_0x6b01('0x95')](_0x523102[_0x6b01('0xb')],qs[_0x6b01('0x97')](_0x1dda2f[_0x6b01('0x82')][_0x6b01('0x97')]));_0x4c84cc[_0x6b01('0x96')]=_0x4c84cc[_0x6b01('0x96')]['length']?_0x4c84cc['attributes']:_0x523102['model'];if(!_0x1dda2f['query'][_0x6b01('0x98')]('nolimit')){_0x4c84cc['limit']=qs['limit'](_0x1dda2f[_0x6b01('0x82')]['limit']);_0x4c84cc[_0x6b01('0x99')]=qs[_0x6b01('0x99')](_0x1dda2f[_0x6b01('0x82')][_0x6b01('0x99')]);}_0x4c84cc[_0x6b01('0x9a')]=qs['sort'](_0x1dda2f['query'][_0x6b01('0x9b')]);_0x4c84cc[_0x6b01('0x7f')]=qs[_0x6b01('0x94')](_['pick'](_0x1dda2f[_0x6b01('0x82')],_0x523102[_0x6b01('0x94')]));if(_0x1dda2f[_0x6b01('0x82')][_0x6b01('0x5')]){_0x4c84cc[_0x6b01('0x7f')]=_['merge'](_0x4c84cc[_0x6b01('0x7f')],{'$or':_['map'](_0xbcba19,function(_0x1a03e4){if(_0x1a03e4[_0x6b01('0x11')][_0x6b01('0x9c')]!==_0x6b01('0x9d')){var _0x16a427={};_0x16a427[_0x1a03e4['field']]={'$like':'%'+_0x1dda2f[_0x6b01('0x82')][_0x6b01('0x5')]+'%'};return _0x16a427;}})});}var _0xb133fc=[];var _0x8b2514=null;var _0x4dbd69={};if(_0x1a0bb7){_0x8b2514=_[_0x6b01('0x8c')](_0x44c3d1,[_0x6b01('0x34'),_0x1a0bb7[_0x6b01('0x34')]]);if(_0x8b2514[_0x6b01('0x4')]){_0x4dbd69={};if(_0x2bd87d[_0x6b01('0x14')]===_0x6b01('0xf')){_0x4dbd69[_0x8b2514['foreignKey']]=_['map'](_0x1a0bb7['associatedResources'],'id');}else{_0x4dbd69[_0x8b2514[_0x6b01('0x9e')]]=_0x1a0bb7[_0x6b01('0x7')];}_0xb133fc['push'](_0x4dbd69);}else{_0x4c84cc[_0x6b01('0x7f')]['id']=_0x1a0bb7[_0x6b01('0x7')];}}else{for(var _0x34c971=0x0;_0x34c971<_0x30171f[_0x6b01('0x90')];_0x34c971++){_0x8b2514=_['find'](_0x44c3d1,[_0x6b01('0x34'),_0x30171f[_0x34c971]['name']]);if(_0x8b2514[_0x6b01('0x4')]){_0x4dbd69={};_0x4dbd69[_0x8b2514['foreignKey']]=_0x30171f[_0x34c971][_0x6b01('0x7')];_0xb133fc['push'](_0x4dbd69);}else{if(!_0x4c84cc[_0x6b01('0x7f')]['id'])_0x4c84cc[_0x6b01('0x7f')]['id']=[];_0x30171f[_0x34c971][_0x6b01('0x7')][_0x6b01('0x9f')](function(_0x12b0d8){_0x4c84cc[_0x6b01('0x7f')]['id'][_0x6b01('0x8a')](_0x12b0d8);});}}}if(!_['isEmpty'](_0xb133fc)){_0x4c84cc[_0x6b01('0x7f')]=_['merge'](_0x4c84cc[_0x6b01('0x7f')],{'$and':{'$or':_0xb133fc}});}_0x4c84cc=_[_0x6b01('0xa0')]({},_0x4c84cc,_0x1dda2f[_0x6b01('0xa1')]);if(_0x1a0bb7&&!_0x1a0bb7[_0x6b01('0x91')]&&_0x2bd87d[_0x6b01('0x14')]===_0x6b01('0xf')){if(_0x1dda2f[_0x6b01('0x82')][_0x6b01('0xa2')]){_0x4c84cc[_0x6b01('0xa3')]=[{'all':!![]}];}return _0x160a7d[_0x2bd87d[_0x6b01('0x14')]][_0x6b01('0xe')](_0x4c84cc)['then'](function(_0x1e9300){var _0x4091a8=[];_0x1e9300[_0x6b01('0x9f')](function(_0x41c2a9){var _0x5ac0b6;switch(_0x41c2a9[_0x6b01('0xa4')]){case _0x6b01('0xa5'):_0x5ac0b6=_[_0x6b01('0x8c')](_0x1a0bb7[_0x6b01('0x7')],function(_0x3c4424){return _0x3c4424['id']===_0x41c2a9['reportId']&&_0x3c4424[_0x6b01('0x11')]==='DefaultReports';});break;case _0x6b01('0xa6'):_0x5ac0b6=_[_0x6b01('0x8c')](_0x1a0bb7[_0x6b01('0x7')],function(_0x7b8545){return _0x7b8545['id']===_0x41c2a9[_0x6b01('0x73')]&&_0x7b8545[_0x6b01('0x11')]===_0x6b01('0xa7');});break;}if(_0x5ac0b6)_0x4091a8[_0x6b01('0x8a')](_0x41c2a9);});_0x38ae38[_0x6b01('0xa8')]=_0x4091a8[_0x6b01('0x90')];_0x38ae38[_0x6b01('0xa9')]=_0x4091a8;return _0x38ae38;});}else{return _0x160a7d[_0x2bd87d[_0x6b01('0x14')]][_0x6b01('0xa8')]({'where':_0x4c84cc[_0x6b01('0x7f')]})['then'](function(_0x2f180){_0x38ae38['count']=_0x2f180;if(_0x1dda2f['query'][_0x6b01('0xa2')]){if(_0x2bd87d[_0x6b01('0x14')]===_0x6b01('0xaa')){_0x4c84cc[_0x6b01('0xa3')]=[{'model':_0x160a7d['Tag'],'as':_0x6b01('0xab'),'attributes':['id',_0x6b01('0x34'),_0x6b01('0xac')],'required':_0x1dda2f['query'][_0x6b01('0xad')]?!![]:![]},{'model':_0x160a7d[_0x6b01('0x6a')],'as':_0x6b01('0xae'),'attributes':['id',_0x6b01('0x34'),_0x6b01('0xac')],'through':_0x1dda2f[_0x6b01('0x82')][_0x6b01('0xad')]?{'attributes':[],'where':{'TagId':_0x1dda2f[_0x6b01('0x82')]['tag']||undefined}}:{},'required':_0x1dda2f[_0x6b01('0x82')][_0x6b01('0xad')]?!![]:![]}];}else{_0x4c84cc[_0x6b01('0xa3')]=[{'all':!![]}];}}return _0x160a7d[_0x2bd87d[_0x6b01('0x14')]]['findAll'](_0x4c84cc);})['then'](function(_0x33fa1d){_0x38ae38[_0x6b01('0xa9')]=_0x33fa1d;if(_0x270128===_0x6b01('0x33')&&_0x1dda2f[_0x6b01('0x82')][_0x6b01('0xaf')]===_0x6b01('0xb0')){var _0x1343af=[];for(var _0x29c507=0x0;_0x29c507<_0x38ae38['rows'][_0x6b01('0x90')];_0x29c507++){_0x1343af[_0x6b01('0x8a')](_0x1aefc2(_0x6b01('0xb1'),_0x38ae38[_0x6b01('0xa9')][_0x29c507][_0x6b01('0xb2')]));_0x1343af[_0x6b01('0x8a')](_0x1aefc2(_0x6b01('0xb3'),_0x38ae38['rows'][_0x29c507][_0x6b01('0xb2')]));_0x1343af['push'](_0x1aefc2(_0x6b01('0xb4'),_0x38ae38[_0x6b01('0xa9')][_0x29c507][_0x6b01('0xb2')]));_0x1343af[_0x6b01('0x8a')](_0x1aefc2(_0x6b01('0xb5'),_0x38ae38['rows'][_0x29c507][_0x6b01('0xb2')]));_0x1343af['push'](_0x1aefc2(_0x6b01('0xb6'),_0x38ae38[_0x6b01('0xa9')][_0x29c507]['dataValues']));_0x1343af[_0x6b01('0x8a')](_0x1aefc2(_0x6b01('0xb7'),_0x38ae38[_0x6b01('0xa9')][_0x29c507][_0x6b01('0xb2')]));}return Promise[_0x6b01('0x8d')](_0x1343af)['then'](function(){return _0x38ae38;});}return _0x38ae38;});}});}}});};
\ No newline at end of file
index 29df077..43387df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7374=['../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x532ff1,_0x49ae13){var _0x5579a3=function(_0x2319b1){while(--_0x2319b1){_0x532ff1['push'](_0x532ff1['shift']());}};_0x5579a3(++_0x49ae13);}(_0x7374,0x1b9));var _0x4737=function(_0x5e517d,_0x23201a){_0x5e517d=_0x5e517d-0x0;var _0x55f5da=_0x7374[_0x5e517d];return _0x55f5da;};'use strict';var _=require(_0x4737('0x0'));var util=require(_0x4737('0x1'));var moment=require(_0x4737('0x2'));var BPromise=require(_0x4737('0x3'));var rs=require(_0x4737('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4737('0x5'))['db'];var utils=require(_0x4737('0x6'));var logger=require(_0x4737('0x7'))(_0x4737('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4737('0x9')][_0x4737('0xa')]({'port':0x232a});config[_0x4737('0xb')]=_[_0x4737('0xc')](config['redis'],{'host':_0x4737('0xd'),'port':0x18eb});var socket=require(_0x4737('0xe'))(new Redis(config[_0x4737('0xb')]));require(_0x4737('0xf'))[_0x4737('0x10')](socket);function respondWithRpcPromise(_0x548637,_0x10dabc,_0x3a51a8){return new BPromise(function(_0x2367aa,_0x4f54ca){return client['request'](_0x548637,_0x3a51a8)[_0x4737('0x11')](function(_0x1a7840){logger[_0x4737('0x12')](_0x4737('0x13'),_0x10dabc,_0x4737('0x14'));logger[_0x4737('0x15')](_0x4737('0x16'),_0x10dabc,_0x4737('0x14'),JSON[_0x4737('0x17')](_0x1a7840));if(_0x1a7840['error']){if(_0x1a7840[_0x4737('0x18')][_0x4737('0x19')]===0x1f4){logger[_0x4737('0x18')](_0x4737('0x13'),_0x10dabc,_0x1a7840[_0x4737('0x18')]['message']);return _0x4f54ca(_0x1a7840['error'][_0x4737('0x1a')]);}logger['error'](_0x4737('0x13'),_0x10dabc,_0x1a7840[_0x4737('0x18')]['message']);return _0x2367aa(_0x1a7840[_0x4737('0x18')][_0x4737('0x1a')]);}else{logger[_0x4737('0x12')]('UserProfile,\x20%s,\x20%s',_0x10dabc,_0x4737('0x14'));_0x2367aa(_0x1a7840['result'][_0x4737('0x1a')]);}})[_0x4737('0x1b')](function(_0x2d247e){logger[_0x4737('0x18')](_0x4737('0x13'),_0x10dabc,_0x2d247e);_0x4f54ca(_0x2d247e);});});}
\ No newline at end of file
+var _0x97ce=['util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash'];(function(_0x1eefef,_0x406aad){var _0x1df25d=function(_0x4a3b84){while(--_0x4a3b84){_0x1eefef['push'](_0x1eefef['shift']());}};_0x1df25d(++_0x406aad);}(_0x97ce,0x151));var _0xe97c=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x97ce[_0x5834bc];return _0x3e183a;};'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});config[_0xe97c('0xb')]=_['defaults'](config[_0xe97c('0xb')],{'host':_0xe97c('0xc'),'port':0x18eb});var socket=require(_0xe97c('0xd'))(new Redis(config['redis']));require(_0xe97c('0xe'))['register'](socket);function respondWithRpcPromise(_0x40ef69,_0x2e732d,_0xbe3b8a){return new BPromise(function(_0x23e6a2,_0x43e557){return client[_0xe97c('0xf')](_0x40ef69,_0xbe3b8a)[_0xe97c('0x10')](function(_0x5bb134){logger[_0xe97c('0x11')](_0xe97c('0x12'),_0x2e732d,_0xe97c('0x13'));logger[_0xe97c('0x14')](_0xe97c('0x15'),_0x2e732d,_0xe97c('0x13'),JSON[_0xe97c('0x16')](_0x5bb134));if(_0x5bb134[_0xe97c('0x17')]){if(_0x5bb134[_0xe97c('0x17')]['code']===0x1f4){logger['error'](_0xe97c('0x12'),_0x2e732d,_0x5bb134['error'][_0xe97c('0x18')]);return _0x43e557(_0x5bb134[_0xe97c('0x17')]['message']);}logger['error'](_0xe97c('0x12'),_0x2e732d,_0x5bb134[_0xe97c('0x17')][_0xe97c('0x18')]);return _0x23e6a2(_0x5bb134[_0xe97c('0x17')]['message']);}else{logger['info']('UserProfile,\x20%s,\x20%s',_0x2e732d,_0xe97c('0x13'));_0x23e6a2(_0x5bb134[_0xe97c('0x19')][_0xe97c('0x18')]);}})['catch'](function(_0x3bdf2e){logger[_0xe97c('0x17')](_0xe97c('0x12'),_0x2e732d,_0x3bdf2e);_0x43e557(_0x3bdf2e);});});}
\ No newline at end of file
index 9584354..5622019 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa410=['length','./userProfile.events','save','update','emit','removeListener'];(function(_0x5a5864,_0x19f580){var _0x20801f=function(_0x1b1fa7){while(--_0x1b1fa7){_0x5a5864['push'](_0x5a5864['shift']());}};_0x20801f(++_0x19f580);}(_0xa410,0x121));var _0x0a41=function(_0x402529,_0x398245){_0x402529=_0x402529-0x0;var _0x3bd450=_0xa410[_0x402529];return _0x3bd450;};'use strict';var UserProfileEvents=require(_0x0a41('0x0'));var events=[_0x0a41('0x1'),'remove',_0x0a41('0x2')];function createListener(_0x1557d8,_0x1513e5){return function(_0x1d508b){_0x1513e5[_0x0a41('0x3')](_0x1557d8,_0x1d508b);};}function removeListener(_0x24c3e5,_0x15b31e){return function(){UserProfileEvents[_0x0a41('0x4')](_0x24c3e5,_0x15b31e);};}exports['register']=function(_0x50a002){for(var _0x46f103=0x0,_0x2ec284=events[_0x0a41('0x5')];_0x46f103<_0x2ec284;_0x46f103++){var _0x335a53=events[_0x46f103];var _0x19354c=createListener('userProfile:'+_0x335a53,_0x50a002);UserProfileEvents['on'](_0x335a53,_0x19354c);}};
\ No newline at end of file
+var _0xbaba=['remove','emit','register','length','userProfile:','save'];(function(_0x55d9b2,_0x1c4d7e){var _0x18c0cb=function(_0xfbba85){while(--_0xfbba85){_0x55d9b2['push'](_0x55d9b2['shift']());}};_0x18c0cb(++_0x1c4d7e);}(_0xbaba,0xb9));var _0xabab=function(_0x3101b8,_0x599336){_0x3101b8=_0x3101b8-0x0;var _0x4f2aa3=_0xbaba[_0x3101b8];return _0x4f2aa3;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xabab('0x0'),_0xabab('0x1'),'update'];function createListener(_0x472ad2,_0x4bd800){return function(_0x27f67b){_0x4bd800[_0xabab('0x2')](_0x472ad2,_0x27f67b);};}function removeListener(_0x377804,_0x501353){return function(){UserProfileEvents['removeListener'](_0x377804,_0x501353);};}exports[_0xabab('0x3')]=function(_0x135c13){for(var _0x26664e=0x0,_0x11326c=events[_0xabab('0x4')];_0x26664e<_0x11326c;_0x26664e++){var _0xd1299b=events[_0x26664e];var _0x10084c=createListener(_0xabab('0x5')+_0xd1299b,_0x135c13);UserProfileEvents['on'](_0xd1299b,_0x10084c);}};
\ No newline at end of file
index e5941a1..dcf2075 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9b5=['/:id','show','post','create','put','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xe9b5,0x104));var _0x5e9b=function(_0x3facc9,_0x4d0cc){_0x3facc9=_0x3facc9-0x0;var _0x3e0708=_0xe9b5[_0x3facc9];return _0x3e0708;};'use strict';var multer=require(_0x5e9b('0x0'));var util=require('util');var path=require(_0x5e9b('0x1'));var timeout=require('connect-timeout');var express=require(_0x5e9b('0x2'));var router=express[_0x5e9b('0x3')]();var fs_extra=require(_0x5e9b('0x4'));var auth=require(_0x5e9b('0x5'));var interaction=require(_0x5e9b('0x6'));var config=require('../../config/environment');var controller=require(_0x5e9b('0x7'));router['get']('/',auth[_0x5e9b('0x8')](),controller[_0x5e9b('0x9')]);router[_0x5e9b('0xa')](_0x5e9b('0xb'),auth[_0x5e9b('0x8')](),controller[_0x5e9b('0xc')]);router[_0x5e9b('0xa')](_0x5e9b('0xd'),auth[_0x5e9b('0x8')](),controller[_0x5e9b('0xe')]);router[_0x5e9b('0xf')]('/',auth[_0x5e9b('0x8')](),controller[_0x5e9b('0x10')]);router[_0x5e9b('0x11')]('/:id',auth[_0x5e9b('0x8')](),controller[_0x5e9b('0x12')]);router[_0x5e9b('0x13')](_0x5e9b('0xd'),auth['isAuthenticated'](),controller[_0x5e9b('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xd877=['express','Router','../../config/environment','get','isAuthenticated','index','/describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3520ab,_0x2c3d27){var _0x3ce66e=function(_0x5936e7){while(--_0x5936e7){_0x3520ab['push'](_0x3520ab['shift']());}};_0x3ce66e(++_0x2c3d27);}(_0xd877,0x1d7));var _0x7d87=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xd877[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0x7d87('0x0'));var util=require(_0x7d87('0x1'));var path=require(_0x7d87('0x2'));var timeout=require(_0x7d87('0x3'));var express=require(_0x7d87('0x4'));var router=express[_0x7d87('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7d87('0x6'));var controller=require('./userProfileResource.controller');router[_0x7d87('0x7')]('/',auth[_0x7d87('0x8')](),controller[_0x7d87('0x9')]);router['get'](_0x7d87('0xa'),auth[_0x7d87('0x8')](),controller['describe']);router['get'](_0x7d87('0xb'),auth[_0x7d87('0x8')](),controller['show']);router[_0x7d87('0xc')]('/',auth[_0x7d87('0x8')](),controller[_0x7d87('0xd')]);router[_0x7d87('0xe')](_0x7d87('0xb'),auth[_0x7d87('0x8')](),controller[_0x7d87('0xf')]);router[_0x7d87('0x10')](_0x7d87('0xb'),auth[_0x7d87('0x8')](),controller[_0x7d87('0x11')]);module[_0x7d87('0x12')]=router;
\ No newline at end of file
index 3f70c1c..1049365 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6b0=['STRING','INTEGER','sequelize','exports'];(function(_0x4be52a,_0x5548d4){var _0x5e24e7=function(_0x2cf03e){while(--_0x2cf03e){_0x4be52a['push'](_0x4be52a['shift']());}};_0x5e24e7(++_0x5548d4);}(_0xc6b0,0x1de));var _0x0c6b=function(_0x1d64fe,_0x21e967){_0x1d64fe=_0x1d64fe-0x0;var _0x27bd64=_0xc6b0[_0x1d64fe];return _0x27bd64;};'use strict';var Sequelize=require(_0x0c6b('0x0'));module[_0x0c6b('0x1')]={'name':{'type':Sequelize[_0x0c6b('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x0c6b('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x0c6b('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x2795=['STRING','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2795,0x181));var _0x5279=function(_0x33af41,_0x1b3a30){_0x33af41=_0x33af41-0x0;var _0x5dcc8d=_0x2795[_0x33af41];return _0x5dcc8d;};'use strict';var Sequelize=require('sequelize');module[_0x5279('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x5279('0x1')],'allowNull':![]}};
\ No newline at end of file
index 5c0efe0..c6525b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafc4=['update','destroy','then','stack','name','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','VIRTUAL','options','UserProfileResource','includeAll','catch','show','params','create','body','find','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x5c2e5e,_0x2bc00e){var _0x46a5da=function(_0xf0fa38){while(--_0xf0fa38){_0x5c2e5e['push'](_0x5c2e5e['shift']());}};_0x46a5da(++_0x2bc00e);}(_0xafc4,0x69));var _0x4afc=function(_0x1dcf63,_0x154061){_0x1dcf63=_0x1dcf63-0x0;var _0x509682=_0xafc4[_0x1dcf63];return _0x509682;};'use strict';var emlformat=require(_0x4afc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4afc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4afc('0x2'));var moment=require(_0x4afc('0x3'));var BPromise=require(_0x4afc('0x4'));var Mustache=require(_0x4afc('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4afc('0x6'));var ejs=require(_0x4afc('0x7'));var fs=require('fs');var fs_extra=require(_0x4afc('0x8'));var _=require(_0x4afc('0x9'));var squel=require(_0x4afc('0xa'));var crypto=require(_0x4afc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4afc('0xc'));var toCsv=require(_0x4afc('0x6'));var querystring=require(_0x4afc('0xd'));var Papa=require(_0x4afc('0xe'));var Redis=require(_0x4afc('0xf'));var authService=require(_0x4afc('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4afc('0x11'));var logger=require('../../config/logger')(_0x4afc('0x12'));var utils=require(_0x4afc('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x4afc('0x14'));var db=require(_0x4afc('0x15'))['db'];function respondWithStatusCode(_0x2b191c,_0x2768bf){_0x2768bf=_0x2768bf||0xcc;return function(_0x1d8f98){if(_0x1d8f98){return _0x2b191c[_0x4afc('0x16')](_0x2768bf);}return _0x2b191c[_0x4afc('0x17')](_0x2768bf)[_0x4afc('0x18')]();};}function respondWithResult(_0x5effb4,_0x26f3f1){_0x26f3f1=_0x26f3f1||0xc8;return function(_0x429fd8){if(_0x429fd8){return _0x5effb4[_0x4afc('0x17')](_0x26f3f1)[_0x4afc('0x19')](_0x429fd8);}};}function respondWithFilteredResult(_0x5f2dc9,_0x4e32e8){return function(_0x2452ae){if(_0x2452ae){var _0x4f3127=typeof _0x4e32e8[_0x4afc('0x1a')]===_0x4afc('0x1b')&&typeof _0x4e32e8[_0x4afc('0x1c')]===_0x4afc('0x1b');var _0x3a306f=_0x2452ae[_0x4afc('0x1d')];var _0x22f809=_0x4f3127?0x0:_0x4e32e8[_0x4afc('0x1a')];var _0x16365f=_0x4f3127?_0x2452ae[_0x4afc('0x1d')]:_0x4e32e8[_0x4afc('0x1a')]+_0x4e32e8['limit'];var _0x1a8f49;if(_0x16365f>=_0x3a306f){_0x16365f=_0x3a306f;_0x1a8f49=0xc8;}else{_0x1a8f49=0xce;}_0x5f2dc9[_0x4afc('0x17')](_0x1a8f49);return _0x5f2dc9[_0x4afc('0x1e')](_0x4afc('0x1f'),_0x22f809+'-'+_0x16365f+'/'+_0x3a306f)['json'](_0x2452ae);}return null;};}function patchUpdates(_0x3bddc0){return function(_0x30eda3){try{jsonpatch[_0x4afc('0x20')](_0x30eda3,_0x3bddc0,!![]);}catch(_0x280587){return BPromise[_0x4afc('0x21')](_0x280587);}return _0x30eda3[_0x4afc('0x22')]();};}function saveUpdates(_0x3ad7a5,_0x573a75){return function(_0x5403e4){if(_0x5403e4){return _0x5403e4[_0x4afc('0x23')](_0x3ad7a5)['then'](function(_0x37debf){return _0x37debf;});}return null;};}function removeEntity(_0x4e9a48,_0x1aa676){return function(_0x2a0314){if(_0x2a0314){return _0x2a0314[_0x4afc('0x24')]()[_0x4afc('0x25')](function(){_0x4e9a48[_0x4afc('0x17')](0xcc)[_0x4afc('0x18')]();});}};}function handleEntityNotFound(_0x40a0db,_0x383a71){return function(_0x2bb837){if(!_0x2bb837){_0x40a0db[_0x4afc('0x16')](0x194);}return _0x2bb837;};}function handleError(_0x4e8273,_0x359c07){_0x359c07=_0x359c07||0x1f4;return function(_0x35f5b3){logger['error'](_0x35f5b3[_0x4afc('0x26')]);if(_0x35f5b3[_0x4afc('0x27')]){delete _0x35f5b3[_0x4afc('0x27')];}_0x4e8273['status'](_0x359c07)['send'](_0x35f5b3);};}exports['index']=function(_0x426e9d,_0x5db47e){var _0x5e4747={},_0xd26d2f={},_0x628e42={'count':0x0,'rows':[]};var _0x494fe7=_['map'](db['UserProfileResource'][_0x4afc('0x28')],function(_0x34434a){return{'name':_0x34434a[_0x4afc('0x29')],'type':_0x34434a[_0x4afc('0x2a')][_0x4afc('0x2b')]};});_0xd26d2f[_0x4afc('0x2c')]=_['map'](_0x494fe7,_0x4afc('0x27'));_0xd26d2f[_0x4afc('0x2d')]=_[_0x4afc('0x2e')](_0x426e9d[_0x4afc('0x2d')]);_0xd26d2f[_0x4afc('0x2f')]=_[_0x4afc('0x30')](_0xd26d2f[_0x4afc('0x2c')],_0xd26d2f[_0x4afc('0x2d')]);_0x5e4747['attributes']=_[_0x4afc('0x30')](_0xd26d2f['model'],qs['fields'](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x31')]));_0x5e4747[_0x4afc('0x32')]=_0x5e4747[_0x4afc('0x32')][_0x4afc('0x33')]?_0x5e4747[_0x4afc('0x32')]:_0xd26d2f['model'];if(!_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x34')](_0x4afc('0x35'))){_0x5e4747[_0x4afc('0x1c')]=qs[_0x4afc('0x1c')](_0x426e9d[_0x4afc('0x2d')]['limit']);_0x5e4747[_0x4afc('0x1a')]=qs[_0x4afc('0x1a')](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x1a')]);}_0x5e4747['order']=qs['sort'](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x36')]);_0x5e4747[_0x4afc('0x37')]=qs['filters'](_['pick'](_0x426e9d[_0x4afc('0x2d')],_0xd26d2f['filters']),_0x494fe7);if(_0x426e9d['query'][_0x4afc('0x38')]){_0x5e4747[_0x4afc('0x37')]=_[_0x4afc('0x39')](_0x5e4747[_0x4afc('0x37')],{'$or':_[_0x4afc('0x3a')](_0x494fe7,function(_0x4420fb){if(_0x4420fb[_0x4afc('0x2a')]!==_0x4afc('0x3b')){var _0x3ccc5a={};_0x3ccc5a[_0x4420fb[_0x4afc('0x27')]]={'$like':'%'+_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x38')]+'%'};return _0x3ccc5a;}})});}_0x5e4747=_[_0x4afc('0x39')]({},_0x5e4747,_0x426e9d[_0x4afc('0x3c')]);var _0x46dd2a={'where':_0x5e4747['where']};return db[_0x4afc('0x3d')][_0x4afc('0x1d')](_0x46dd2a)[_0x4afc('0x25')](function(_0xe6db12){_0x628e42[_0x4afc('0x1d')]=_0xe6db12;if(_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x3e')]){_0x5e4747['include']=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x5e4747);})[_0x4afc('0x25')](function(_0x105c03){_0x628e42['rows']=_0x105c03;return _0x628e42;})[_0x4afc('0x25')](respondWithFilteredResult(_0x5db47e,_0x5e4747))[_0x4afc('0x3f')](handleError(_0x5db47e,null));};exports[_0x4afc('0x40')]=function(_0x397996,_0x545109){var _0x12b5db={'raw':![],'where':{'id':_0x397996[_0x4afc('0x41')]['id']}},_0x45c9c3={};_0x45c9c3[_0x4afc('0x2c')]=_[_0x4afc('0x2e')](db[_0x4afc('0x3d')]['rawAttributes']);_0x45c9c3[_0x4afc('0x2d')]=_['keys'](_0x397996[_0x4afc('0x2d')]);_0x45c9c3[_0x4afc('0x2f')]=_[_0x4afc('0x30')](_0x45c9c3['model'],_0x45c9c3['query']);_0x12b5db[_0x4afc('0x32')]=_[_0x4afc('0x30')](_0x45c9c3[_0x4afc('0x2c')],qs[_0x4afc('0x31')](_0x397996[_0x4afc('0x2d')][_0x4afc('0x31')]));_0x12b5db[_0x4afc('0x32')]=_0x12b5db[_0x4afc('0x32')]['length']?_0x12b5db[_0x4afc('0x32')]:_0x45c9c3[_0x4afc('0x2c')];if(_0x397996['query'][_0x4afc('0x3e')]){_0x12b5db['include']=[{'all':!![]}];}_0x12b5db=_[_0x4afc('0x39')]({},_0x12b5db,_0x397996[_0x4afc('0x3c')]);return db[_0x4afc('0x3d')]['find'](_0x12b5db)[_0x4afc('0x25')](handleEntityNotFound(_0x545109,null))[_0x4afc('0x25')](respondWithResult(_0x545109,null))[_0x4afc('0x3f')](handleError(_0x545109,null));};exports[_0x4afc('0x42')]=function(_0x4772db,_0x19a0ac){return db['UserProfileResource']['create'](_0x4772db['body'],{})[_0x4afc('0x25')](respondWithResult(_0x19a0ac,0xc9))[_0x4afc('0x3f')](handleError(_0x19a0ac,null));};exports[_0x4afc('0x23')]=function(_0x269c24,_0xb5cca9){if(_0x269c24[_0x4afc('0x43')]['id']){delete _0x269c24[_0x4afc('0x43')]['id'];}return db[_0x4afc('0x3d')][_0x4afc('0x44')]({'where':{'id':_0x269c24[_0x4afc('0x41')]['id']}})['then'](handleEntityNotFound(_0xb5cca9,null))[_0x4afc('0x25')](saveUpdates(_0x269c24['body'],null))['then'](respondWithResult(_0xb5cca9,null))[_0x4afc('0x3f')](handleError(_0xb5cca9,null));};exports['destroy']=function(_0x428d78,_0x355198){return db[_0x4afc('0x3d')][_0x4afc('0x44')]({'where':{'id':_0x428d78['params']['id']}})[_0x4afc('0x25')](handleEntityNotFound(_0x355198,null))['then'](removeEntity(_0x355198,null))[_0x4afc('0x3f')](handleError(_0x355198,null));};exports[_0x4afc('0x45')]=function(_0x3625c9,_0x387834){return db[_0x4afc('0x3d')][_0x4afc('0x45')]()[_0x4afc('0x25')](respondWithResult(_0x387834,null))[_0x4afc('0x3f')](handleError(_0x387834,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(_0x4dadd0,_0xd02549){var _0x3daaac=function(_0x58347d){while(--_0x58347d){_0x4dadd0['push'](_0x4dadd0['shift']());}};_0x3daaac(++_0xd02549);}(_0x7880,0x1f4));var _0x0788=function(_0x5758c9,_0x3e7929){_0x5758c9=_0x5758c9-0x0;var _0x46892f=_0x7880[_0x5758c9];return _0x46892f;};'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 9674174..bcd8e04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f9c=['./userProfileResource.attributes','define','UserProfileResource','user_profile_has_resources','resourceId','sectionId','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x3520a3,_0x585b4e){var _0x266257=function(_0x4d763a){while(--_0x4d763a){_0x3520a3['push'](_0x3520a3['shift']());}};_0x266257(++_0x585b4e);}(_0x0f9c,0x11e));var _0xc0f9=function(_0x392d59,_0x28ad04){_0x392d59=_0x392d59-0x0;var _0xe38011=_0x0f9c[_0x392d59];return _0xe38011;};'use strict';var _=require(_0xc0f9('0x0'));var util=require(_0xc0f9('0x1'));var logger=require(_0xc0f9('0x2'))('api');var moment=require(_0xc0f9('0x3'));var BPromise=require('bluebird');var rp=require(_0xc0f9('0x4'));var fs=require('fs');var path=require(_0xc0f9('0x5'));var rimraf=require(_0xc0f9('0x6'));var config=require(_0xc0f9('0x7'));var attributes=require(_0xc0f9('0x8'));module['exports']=function(_0x278c5b,_0x345ef7){return _0x278c5b[_0xc0f9('0x9')](_0xc0f9('0xa'),attributes,{'tableName':_0xc0f9('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xc0f9('0xc'),_0xc0f9('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x497d=['lodash','../../config/logger','api','bluebird','request-promise','rimraf','./userProfileResource.attributes','define','user_profile_has_resources','compositeIndex','resourceId','sectionId'];(function(_0x441bbb,_0x1e4865){var _0x28b70c=function(_0x1c45ab){while(--_0x1c45ab){_0x441bbb['push'](_0x441bbb['shift']());}};_0x28b70c(++_0x1e4865);}(_0x497d,0x1e0));var _0xd497=function(_0x5beca8,_0xb41c0){_0x5beca8=_0x5beca8-0x0;var _0x125989=_0x497d[_0x5beca8];return _0x125989;};'use strict';var _=require(_0xd497('0x0'));var util=require('util');var logger=require(_0xd497('0x1'))(_0xd497('0x2'));var moment=require('moment');var BPromise=require(_0xd497('0x3'));var rp=require(_0xd497('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd497('0x5'));var config=require('../../config/environment');var attributes=require(_0xd497('0x6'));module['exports']=function(_0x1f3151,_0x256652){return _0x1f3151[_0xd497('0x7')]('UserProfileResource',attributes,{'tableName':_0xd497('0x8'),'paranoid':![],'indexes':[{'name':_0xd497('0x9'),'fields':[_0xd497('0xa'),_0xd497('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index f0f3da6..e636844 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf51f=['../../config/logger','rpc','../../config/environment','client','request','then','info','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','UserProfileResource,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf51f,0x191));var _0xff51=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0xf51f[_0x266618];return _0x54dbf5;};'use strict';var _=require('lodash');var util=require(_0xff51('0x0'));var moment=require(_0xff51('0x1'));var BPromise=require(_0xff51('0x2'));var rs=require(_0xff51('0x3'));var fs=require('fs');var Redis=require(_0xff51('0x4'));var db=require(_0xff51('0x5'))['db'];var utils=require(_0xff51('0x6'));var logger=require(_0xff51('0x7'))(_0xff51('0x8'));var config=require(_0xff51('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xff51('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2993eb,_0x3f0a14,_0x3bacd7){return new BPromise(function(_0x1842cd,_0x51621a){return client[_0xff51('0xb')](_0x2993eb,_0x3bacd7)[_0xff51('0xc')](function(_0x222cb7){logger[_0xff51('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x3f0a14,'request\x20sent');logger[_0xff51('0xe')](_0xff51('0xf'),_0x3f0a14,_0xff51('0x10'),JSON[_0xff51('0x11')](_0x222cb7));if(_0x222cb7['error']){if(_0x222cb7[_0xff51('0x12')][_0xff51('0x13')]===0x1f4){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x3f0a14,_0x222cb7['error'][_0xff51('0x14')]);return _0x51621a(_0x222cb7[_0xff51('0x12')]['message']);}logger[_0xff51('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x3f0a14,_0x222cb7['error'][_0xff51('0x14')]);return _0x1842cd(_0x222cb7[_0xff51('0x12')][_0xff51('0x14')]);}else{logger[_0xff51('0xd')](_0xff51('0x15'),_0x3f0a14,_0xff51('0x10'));_0x1842cd(_0x222cb7[_0xff51('0x16')][_0xff51('0x14')]);}})[_0xff51('0x17')](function(_0x1cc92f){logger[_0xff51('0x12')](_0xff51('0x15'),_0x3f0a14,_0x1cc92f);_0x51621a(_0x1cc92f);});});}
\ No newline at end of file
+var _0x14d0=['catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','result'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0x14d0,0x127));var _0x014d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x14d0[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x014d('0x0'));var util=require(_0x014d('0x1'));var moment=require(_0x014d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x014d('0x3'))['db'];var utils=require(_0x014d('0x4'));var logger=require(_0x014d('0x5'))('rpc');var config=require(_0x014d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x014d('0x7')][_0x014d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x19fc90,_0x5ddde7,_0x5aecf7){return new BPromise(function(_0x3df439,_0x948a6d){return client[_0x014d('0x9')](_0x19fc90,_0x5aecf7)[_0x014d('0xa')](function(_0x5a9b6c){logger['info']('UserProfileResource,\x20%s,\x20%s',_0x5ddde7,_0x014d('0xb'));logger[_0x014d('0xc')](_0x014d('0xd'),_0x5ddde7,_0x014d('0xb'),JSON[_0x014d('0xe')](_0x5a9b6c));if(_0x5a9b6c[_0x014d('0xf')]){if(_0x5a9b6c[_0x014d('0xf')][_0x014d('0x10')]===0x1f4){logger[_0x014d('0xf')](_0x014d('0x11'),_0x5ddde7,_0x5a9b6c[_0x014d('0xf')][_0x014d('0x12')]);return _0x948a6d(_0x5a9b6c[_0x014d('0xf')][_0x014d('0x12')]);}logger[_0x014d('0xf')]('UserProfileResource,\x20%s,\x20%s',_0x5ddde7,_0x5a9b6c[_0x014d('0xf')]['message']);return _0x3df439(_0x5a9b6c['error'][_0x014d('0x12')]);}else{logger['info'](_0x014d('0x11'),_0x5ddde7,_0x014d('0xb'));_0x3df439(_0x5a9b6c[_0x014d('0x13')][_0x014d('0x12')]);}})[_0x014d('0x14')](function(_0x42a664){logger[_0x014d('0xf')]('UserProfileResource,\x20%s,\x20%s',_0x5ddde7,_0x42a664);_0x948a6d(_0x42a664);});});}
\ No newline at end of file
index 9f6c291..46c4581 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ce6=['get','/describe','describe','/:id','show','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./userProfileSection.controller','isAuthenticated','index'];(function(_0x47a338,_0x107230){var _0x1283e7=function(_0x5a4a89){while(--_0x5a4a89){_0x47a338['push'](_0x47a338['shift']());}};_0x1283e7(++_0x107230);}(_0x3ce6,0x184));var _0x63ce=function(_0x4d5fa8,_0x324f94){_0x4d5fa8=_0x4d5fa8-0x0;var _0x43a6db=_0x3ce6[_0x4d5fa8];return _0x43a6db;};'use strict';var multer=require(_0x63ce('0x0'));var util=require(_0x63ce('0x1'));var path=require(_0x63ce('0x2'));var timeout=require(_0x63ce('0x3'));var express=require(_0x63ce('0x4'));var router=express['Router']();var fs_extra=require(_0x63ce('0x5'));var auth=require(_0x63ce('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x63ce('0x7'));var controller=require(_0x63ce('0x8'));router['get']('/',auth[_0x63ce('0x9')](),controller[_0x63ce('0xa')]);router[_0x63ce('0xb')](_0x63ce('0xc'),auth[_0x63ce('0x9')](),controller[_0x63ce('0xd')]);router['get'](_0x63ce('0xe'),auth[_0x63ce('0x9')](),controller[_0x63ce('0xf')]);router[_0x63ce('0x10')]('/',auth[_0x63ce('0x9')](),controller['create']);router[_0x63ce('0x11')](_0x63ce('0xe'),auth[_0x63ce('0x9')](),controller[_0x63ce('0x12')]);router['delete'](_0x63ce('0xe'),auth[_0x63ce('0x9')](),controller[_0x63ce('0x13')]);module[_0x63ce('0x14')]=router;
\ No newline at end of file
+var _0x06f9=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports','util','path','connect-timeout','express'];(function(_0x4997f8,_0x4a999e){var _0x229f51=function(_0x2a6085){while(--_0x2a6085){_0x4997f8['push'](_0x4997f8['shift']());}};_0x229f51(++_0x4a999e);}(_0x06f9,0x176));var _0x906f=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x06f9[_0xdea41a];return _0x15d0d8;};'use strict';var multer=require('multer');var util=require(_0x906f('0x0'));var path=require(_0x906f('0x1'));var timeout=require(_0x906f('0x2'));var express=require(_0x906f('0x3'));var router=express[_0x906f('0x4')]();var fs_extra=require(_0x906f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x906f('0x6'));var config=require(_0x906f('0x7'));var controller=require('./userProfileSection.controller');router[_0x906f('0x8')]('/',auth[_0x906f('0x9')](),controller[_0x906f('0xa')]);router[_0x906f('0x8')](_0x906f('0xb'),auth[_0x906f('0x9')](),controller[_0x906f('0xc')]);router[_0x906f('0x8')](_0x906f('0xd'),auth['isAuthenticated'](),controller[_0x906f('0xe')]);router[_0x906f('0xf')]('/',auth[_0x906f('0x9')](),controller[_0x906f('0x10')]);router[_0x906f('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x906f('0x12')]);router['delete'](_0x906f('0xd'),auth['isAuthenticated'](),controller[_0x906f('0x13')]);module[_0x906f('0x14')]=router;
\ No newline at end of file
index 8abbfc7..f2e2069 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['split','exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue'];(function(_0x2e0510,_0xa03d49){var _0x1fadff=function(_0x1b7c70){while(--_0x1b7c70){_0x2e0510['push'](_0x2e0510['shift']());}};_0x1fadff(++_0xa03d49);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x0baf('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x0baf('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x0baf('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x232cc7){this[_0x0baf('0x4')](_0x0baf('0x5'),_0x232cc7?_0x232cc7[_0x0baf('0x6')](''):[]);},'get':function(){return this[_0x0baf('0x7')](_0x0baf('0x5'))?this[_0x0baf('0x7')](_0x0baf('0x5'))[_0x0baf('0x8')](''):[];}}};
\ No newline at end of file
+var _0x84a0=['STRING','BOOLEAN','setDataValue','crudPermissions','getDataValue','split','sequelize','exports'];(function(_0x67f95e,_0x3ca797){var _0x538f5a=function(_0xc919e9){while(--_0xc919e9){_0x67f95e['push'](_0x67f95e['shift']());}};_0x538f5a(++_0x3ca797);}(_0x84a0,0x66));var _0x084a=function(_0x1cd65a,_0x29fa8f){_0x1cd65a=_0x1cd65a-0x0;var _0xf93849=_0x84a0[_0x1cd65a];return _0xf93849;};'use strict';var Sequelize=require(_0x084a('0x0'));module[_0x084a('0x1')]={'name':{'type':Sequelize[_0x084a('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x084a('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x084a('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x084a('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x58a814){this[_0x084a('0x4')](_0x084a('0x5'),_0x58a814?_0x58a814['join'](''):[]);},'get':function(){return this[_0x084a('0x6')](_0x084a('0x5'))?this[_0x084a('0x6')](_0x084a('0x5'))[_0x084a('0x7')](''):[];}}};
\ No newline at end of file
index ab60784..745f155 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa82b=['fieldName','type','key','map','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','save','destroy','then','error','stack','name','send','index','UserProfileSection'];(function(_0x144d58,_0x413faf){var _0x405260=function(_0x1320b4){while(--_0x1320b4){_0x144d58['push'](_0x144d58['shift']());}};_0x405260(++_0x413faf);}(_0xa82b,0xff));var _0xba82=function(_0x2ccb91,_0xa2c1b4){_0x2ccb91=_0x2ccb91-0x0;var _0x4136ca=_0xa82b[_0x2ccb91];return _0x4136ca;};'use strict';var emlformat=require(_0xba82('0x0'));var rimraf=require(_0xba82('0x1'));var zipdir=require(_0xba82('0x2'));var jsonpatch=require(_0xba82('0x3'));var rp=require(_0xba82('0x4'));var moment=require(_0xba82('0x5'));var BPromise=require(_0xba82('0x6'));var Mustache=require(_0xba82('0x7'));var util=require('util');var path=require(_0xba82('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xba82('0x9'));var fs=require('fs');var fs_extra=require(_0xba82('0xa'));var _=require('lodash');var squel=require(_0xba82('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xba82('0xc'));var toCsv=require('to-csv');var querystring=require(_0xba82('0xd'));var Papa=require(_0xba82('0xe'));var Redis=require(_0xba82('0xf'));var authService=require(_0xba82('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xba82('0x11'));var hardwareService=require(_0xba82('0x12'));var logger=require(_0xba82('0x13'))(_0xba82('0x14'));var utils=require(_0xba82('0x15'));var config=require(_0xba82('0x16'));var licenseUtil=require(_0xba82('0x17'));var db=require(_0xba82('0x18'))['db'];function respondWithStatusCode(_0x4f6df9,_0x3e7b18){_0x3e7b18=_0x3e7b18||0xcc;return function(_0x3830bd){if(_0x3830bd){return _0x4f6df9[_0xba82('0x19')](_0x3e7b18);}return _0x4f6df9[_0xba82('0x1a')](_0x3e7b18)['end']();};}function respondWithResult(_0xce9c59,_0x234906){_0x234906=_0x234906||0xc8;return function(_0x3d95de){if(_0x3d95de){return _0xce9c59[_0xba82('0x1a')](_0x234906)['json'](_0x3d95de);}};}function respondWithFilteredResult(_0x3473a6,_0x8c32df){return function(_0x273d67){if(_0x273d67){var _0x159fba=typeof _0x8c32df[_0xba82('0x1b')]==='undefined'&&typeof _0x8c32df['limit']===_0xba82('0x1c');var _0x503839=_0x273d67[_0xba82('0x1d')];var _0x5642dd=_0x159fba?0x0:_0x8c32df[_0xba82('0x1b')];var _0x2e2f78=_0x159fba?_0x273d67['count']:_0x8c32df[_0xba82('0x1b')]+_0x8c32df[_0xba82('0x1e')];var _0x3307b7;if(_0x2e2f78>=_0x503839){_0x2e2f78=_0x503839;_0x3307b7=0xc8;}else{_0x3307b7=0xce;}_0x3473a6[_0xba82('0x1a')](_0x3307b7);return _0x3473a6[_0xba82('0x1f')]('Content-Range',_0x5642dd+'-'+_0x2e2f78+'/'+_0x503839)['json'](_0x273d67);}return null;};}function patchUpdates(_0xfc40e9){return function(_0x57cd36){try{jsonpatch['apply'](_0x57cd36,_0xfc40e9,!![]);}catch(_0x4c59e2){return BPromise['reject'](_0x4c59e2);}return _0x57cd36[_0xba82('0x20')]();};}function saveUpdates(_0x5edcec,_0x4e5dd3){return function(_0x1382dc){if(_0x1382dc){return _0x1382dc['update'](_0x5edcec)['then'](function(_0x2d4f0e){return _0x2d4f0e;});}return null;};}function removeEntity(_0x21fde4,_0x1ca96f){return function(_0x4c3699){if(_0x4c3699){return _0x4c3699[_0xba82('0x21')]()[_0xba82('0x22')](function(){_0x21fde4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x556c3c,_0x24dea8){return function(_0x382abe){if(!_0x382abe){_0x556c3c[_0xba82('0x19')](0x194);}return _0x382abe;};}function handleError(_0x35a90d,_0x44ebfc){_0x44ebfc=_0x44ebfc||0x1f4;return function(_0x57d731){logger[_0xba82('0x23')](_0x57d731[_0xba82('0x24')]);if(_0x57d731[_0xba82('0x25')]){delete _0x57d731[_0xba82('0x25')];}_0x35a90d[_0xba82('0x1a')](_0x44ebfc)[_0xba82('0x26')](_0x57d731);};}exports[_0xba82('0x27')]=function(_0x4ca84e,_0x2514f4){var _0x2f5709={},_0x2a3ec4={},_0x581f08={'count':0x0,'rows':[]};var _0x4124e8=_['map'](db[_0xba82('0x28')]['rawAttributes'],function(_0x3a873d){return{'name':_0x3a873d[_0xba82('0x29')],'type':_0x3a873d[_0xba82('0x2a')][_0xba82('0x2b')]};});_0x2a3ec4['model']=_[_0xba82('0x2c')](_0x4124e8,_0xba82('0x25'));_0x2a3ec4['query']=_[_0xba82('0x2d')](_0x4ca84e[_0xba82('0x2e')]);_0x2a3ec4[_0xba82('0x2f')]=_[_0xba82('0x30')](_0x2a3ec4['model'],_0x2a3ec4['query']);_0x2f5709[_0xba82('0x31')]=_['intersection'](_0x2a3ec4[_0xba82('0x32')],qs[_0xba82('0x33')](_0x4ca84e[_0xba82('0x2e')][_0xba82('0x33')]));_0x2f5709[_0xba82('0x31')]=_0x2f5709[_0xba82('0x31')][_0xba82('0x34')]?_0x2f5709['attributes']:_0x2a3ec4[_0xba82('0x32')];if(!_0x4ca84e[_0xba82('0x2e')][_0xba82('0x35')](_0xba82('0x36'))){_0x2f5709[_0xba82('0x1e')]=qs[_0xba82('0x1e')](_0x4ca84e[_0xba82('0x2e')]['limit']);_0x2f5709['offset']=qs[_0xba82('0x1b')](_0x4ca84e['query']['offset']);}_0x2f5709['order']=qs[_0xba82('0x37')](_0x4ca84e['query'][_0xba82('0x37')]);_0x2f5709[_0xba82('0x38')]=qs[_0xba82('0x2f')](_[_0xba82('0x39')](_0x4ca84e[_0xba82('0x2e')],_0x2a3ec4[_0xba82('0x2f')]),_0x4124e8);if(_0x4ca84e[_0xba82('0x2e')]['filter']){_0x2f5709['where']=_[_0xba82('0x3a')](_0x2f5709[_0xba82('0x38')],{'$or':_[_0xba82('0x2c')](_0x4124e8,function(_0x53970c){if(_0x53970c['type']!==_0xba82('0x3b')){var _0x464761={};_0x464761[_0x53970c[_0xba82('0x25')]]={'$like':'%'+_0x4ca84e['query'][_0xba82('0x3c')]+'%'};return _0x464761;}})});}_0x2f5709=_['merge']({},_0x2f5709,_0x4ca84e[_0xba82('0x3d')]);var _0x2125f3={'where':_0x2f5709['where']};return db[_0xba82('0x28')][_0xba82('0x1d')](_0x2125f3)[_0xba82('0x22')](function(_0x54de56){_0x581f08[_0xba82('0x1d')]=_0x54de56;if(_0x4ca84e[_0xba82('0x2e')][_0xba82('0x3e')]){_0x2f5709[_0xba82('0x3f')]=[{'all':!![]}];}return db[_0xba82('0x28')][_0xba82('0x40')](_0x2f5709);})['then'](function(_0x558ec3){_0x581f08[_0xba82('0x41')]=_0x558ec3;return _0x581f08;})['then'](respondWithFilteredResult(_0x2514f4,_0x2f5709))['catch'](handleError(_0x2514f4,null));};exports[_0xba82('0x42')]=function(_0x5cff16,_0x25f2dd){var _0x27f6a1={'raw':![],'where':{'id':_0x5cff16[_0xba82('0x43')]['id']}},_0x240a65={};_0x240a65['model']=_[_0xba82('0x2d')](db[_0xba82('0x28')][_0xba82('0x44')]);_0x240a65[_0xba82('0x2e')]=_[_0xba82('0x2d')](_0x5cff16['query']);_0x240a65[_0xba82('0x2f')]=_['intersection'](_0x240a65['model'],_0x240a65[_0xba82('0x2e')]);_0x27f6a1[_0xba82('0x31')]=_['intersection'](_0x240a65['model'],qs[_0xba82('0x33')](_0x5cff16[_0xba82('0x2e')][_0xba82('0x33')]));_0x27f6a1[_0xba82('0x31')]=_0x27f6a1['attributes'][_0xba82('0x34')]?_0x27f6a1[_0xba82('0x31')]:_0x240a65['model'];if(_0x5cff16[_0xba82('0x2e')][_0xba82('0x3e')]){_0x27f6a1[_0xba82('0x3f')]=[{'all':!![]}];}_0x27f6a1=_[_0xba82('0x3a')]({},_0x27f6a1,_0x5cff16[_0xba82('0x3d')]);return db[_0xba82('0x28')][_0xba82('0x45')](_0x27f6a1)[_0xba82('0x22')](handleEntityNotFound(_0x25f2dd,null))[_0xba82('0x22')](respondWithResult(_0x25f2dd,null))[_0xba82('0x46')](handleError(_0x25f2dd,null));};exports['create']=function(_0x2b6afd,_0x2cd532){return db[_0xba82('0x28')][_0xba82('0x47')](_0x2b6afd[_0xba82('0x48')],{})['then'](respondWithResult(_0x2cd532,0xc9))[_0xba82('0x46')](handleError(_0x2cd532,null));};exports['update']=function(_0xc9eb57,_0x2ef564){if(_0xc9eb57[_0xba82('0x48')]['id']){delete _0xc9eb57[_0xba82('0x48')]['id'];}return db[_0xba82('0x28')]['find']({'where':{'id':_0xc9eb57[_0xba82('0x43')]['id']}})[_0xba82('0x22')](handleEntityNotFound(_0x2ef564,null))[_0xba82('0x22')](saveUpdates(_0xc9eb57['body'],null))[_0xba82('0x22')](respondWithResult(_0x2ef564,null))[_0xba82('0x46')](handleError(_0x2ef564,null));};exports[_0xba82('0x21')]=function(_0x12ce6f,_0x2fda89){return db['UserProfileSection'][_0xba82('0x45')]({'where':{'id':_0x12ce6f[_0xba82('0x43')]['id']}})['then'](handleEntityNotFound(_0x2fda89,null))['then'](removeEntity(_0x2fda89,null))[_0xba82('0x46')](handleError(_0x2fda89,null));};exports[_0xba82('0x49')]=function(_0x4b5883,_0x2ad5d9){return db[_0xba82('0x28')][_0xba82('0x49')]()[_0xba82('0x22')](respondWithResult(_0x2ad5d9,null))['catch'](handleError(_0x2ad5d9,null));};
\ No newline at end of file
+var _0x6136=['UserProfileSection','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','pick','where','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','Content-Range','apply','reject','update','destroy','then','end','error','stack','name','send','index'];(function(_0x55c16d,_0x5dca6a){var _0x58f6c2=function(_0x25616e){while(--_0x25616e){_0x55c16d['push'](_0x55c16d['shift']());}};_0x58f6c2(++_0x5dca6a);}(_0x6136,0x131));var _0x6613=function(_0x26c3e3,_0x345e3d){_0x26c3e3=_0x26c3e3-0x0;var _0x4b5782=_0x6136[_0x26c3e3];return _0x4b5782;};'use strict';var emlformat=require(_0x6613('0x0'));var rimraf=require(_0x6613('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6613('0x2'));var rp=require('request-promise');var moment=require(_0x6613('0x3'));var BPromise=require(_0x6613('0x4'));var Mustache=require(_0x6613('0x5'));var util=require('util');var path=require(_0x6613('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6613('0x7'));var _=require(_0x6613('0x8'));var squel=require(_0x6613('0x9'));var crypto=require('crypto');var jsforce=require(_0x6613('0xa'));var deskjs=require(_0x6613('0xb'));var toCsv=require('to-csv');var querystring=require(_0x6613('0xc'));var Papa=require(_0x6613('0xd'));var Redis=require(_0x6613('0xe'));var authService=require(_0x6613('0xf'));var qs=require(_0x6613('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6613('0x11'))('api');var utils=require(_0x6613('0x12'));var config=require(_0x6613('0x13'));var licenseUtil=require(_0x6613('0x14'));var db=require(_0x6613('0x15'))['db'];function respondWithStatusCode(_0x5e1aa7,_0x5302bd){_0x5302bd=_0x5302bd||0xcc;return function(_0x2d98f3){if(_0x2d98f3){return _0x5e1aa7[_0x6613('0x16')](_0x5302bd);}return _0x5e1aa7[_0x6613('0x17')](_0x5302bd)['end']();};}function respondWithResult(_0xf3eb50,_0x1f8626){_0x1f8626=_0x1f8626||0xc8;return function(_0x4fefca){if(_0x4fefca){return _0xf3eb50[_0x6613('0x17')](_0x1f8626)['json'](_0x4fefca);}};}function respondWithFilteredResult(_0x357c03,_0x283e48){return function(_0x597186){if(_0x597186){var _0x5a9149=typeof _0x283e48[_0x6613('0x18')]==='undefined'&&typeof _0x283e48[_0x6613('0x19')]===_0x6613('0x1a');var _0x329eb4=_0x597186[_0x6613('0x1b')];var _0x5ee220=_0x5a9149?0x0:_0x283e48[_0x6613('0x18')];var _0x16b251=_0x5a9149?_0x597186['count']:_0x283e48[_0x6613('0x18')]+_0x283e48[_0x6613('0x19')];var _0x4cca44;if(_0x16b251>=_0x329eb4){_0x16b251=_0x329eb4;_0x4cca44=0xc8;}else{_0x4cca44=0xce;}_0x357c03[_0x6613('0x17')](_0x4cca44);return _0x357c03['set'](_0x6613('0x1c'),_0x5ee220+'-'+_0x16b251+'/'+_0x329eb4)['json'](_0x597186);}return null;};}function patchUpdates(_0x33b0cd){return function(_0x343cab){try{jsonpatch[_0x6613('0x1d')](_0x343cab,_0x33b0cd,!![]);}catch(_0x3d8d04){return BPromise[_0x6613('0x1e')](_0x3d8d04);}return _0x343cab['save']();};}function saveUpdates(_0x51de8c,_0x241668){return function(_0x2db5c1){if(_0x2db5c1){return _0x2db5c1[_0x6613('0x1f')](_0x51de8c)['then'](function(_0x1ceac4){return _0x1ceac4;});}return null;};}function removeEntity(_0x17e03e,_0x5bade6){return function(_0x181147){if(_0x181147){return _0x181147[_0x6613('0x20')]()[_0x6613('0x21')](function(){_0x17e03e['status'](0xcc)[_0x6613('0x22')]();});}};}function handleEntityNotFound(_0xad243e,_0x5d3e22){return function(_0x5cb6be){if(!_0x5cb6be){_0xad243e['sendStatus'](0x194);}return _0x5cb6be;};}function handleError(_0x51d8e2,_0x4c5e10){_0x4c5e10=_0x4c5e10||0x1f4;return function(_0x40f5de){logger[_0x6613('0x23')](_0x40f5de[_0x6613('0x24')]);if(_0x40f5de[_0x6613('0x25')]){delete _0x40f5de['name'];}_0x51d8e2[_0x6613('0x17')](_0x4c5e10)[_0x6613('0x26')](_0x40f5de);};}exports[_0x6613('0x27')]=function(_0x355c85,_0xe2b32c){var _0x12e192={},_0x5ed440={},_0x348293={'count':0x0,'rows':[]};var _0x986292=_['map'](db[_0x6613('0x28')]['rawAttributes'],function(_0x213405){return{'name':_0x213405[_0x6613('0x29')],'type':_0x213405[_0x6613('0x2a')][_0x6613('0x2b')]};});_0x5ed440[_0x6613('0x2c')]=_['map'](_0x986292,'name');_0x5ed440[_0x6613('0x2d')]=_[_0x6613('0x2e')](_0x355c85[_0x6613('0x2d')]);_0x5ed440[_0x6613('0x2f')]=_['intersection'](_0x5ed440[_0x6613('0x2c')],_0x5ed440[_0x6613('0x2d')]);_0x12e192[_0x6613('0x30')]=_[_0x6613('0x31')](_0x5ed440[_0x6613('0x2c')],qs[_0x6613('0x32')](_0x355c85[_0x6613('0x2d')]['fields']));_0x12e192[_0x6613('0x30')]=_0x12e192[_0x6613('0x30')][_0x6613('0x33')]?_0x12e192[_0x6613('0x30')]:_0x5ed440[_0x6613('0x2c')];if(!_0x355c85[_0x6613('0x2d')]['hasOwnProperty'](_0x6613('0x34'))){_0x12e192['limit']=qs[_0x6613('0x19')](_0x355c85['query'][_0x6613('0x19')]);_0x12e192[_0x6613('0x18')]=qs[_0x6613('0x18')](_0x355c85[_0x6613('0x2d')][_0x6613('0x18')]);}_0x12e192['order']=qs['sort'](_0x355c85[_0x6613('0x2d')][_0x6613('0x35')]);_0x12e192['where']=qs[_0x6613('0x2f')](_[_0x6613('0x36')](_0x355c85[_0x6613('0x2d')],_0x5ed440[_0x6613('0x2f')]),_0x986292);if(_0x355c85[_0x6613('0x2d')]['filter']){_0x12e192[_0x6613('0x37')]=_[_0x6613('0x38')](_0x12e192[_0x6613('0x37')],{'$or':_['map'](_0x986292,function(_0x100169){if(_0x100169[_0x6613('0x2a')]!=='VIRTUAL'){var _0x569a0e={};_0x569a0e[_0x100169[_0x6613('0x25')]]={'$like':'%'+_0x355c85[_0x6613('0x2d')]['filter']+'%'};return _0x569a0e;}})});}_0x12e192=_[_0x6613('0x38')]({},_0x12e192,_0x355c85[_0x6613('0x39')]);var _0xf4d246={'where':_0x12e192[_0x6613('0x37')]};return db[_0x6613('0x28')][_0x6613('0x1b')](_0xf4d246)[_0x6613('0x21')](function(_0x1b548a){_0x348293[_0x6613('0x1b')]=_0x1b548a;if(_0x355c85[_0x6613('0x2d')][_0x6613('0x3a')]){_0x12e192[_0x6613('0x3b')]=[{'all':!![]}];}return db['UserProfileSection'][_0x6613('0x3c')](_0x12e192);})['then'](function(_0x4c0550){_0x348293[_0x6613('0x3d')]=_0x4c0550;return _0x348293;})[_0x6613('0x21')](respondWithFilteredResult(_0xe2b32c,_0x12e192))[_0x6613('0x3e')](handleError(_0xe2b32c,null));};exports[_0x6613('0x3f')]=function(_0x17cdf0,_0x3fa9dd){var _0x42c5bd={'raw':![],'where':{'id':_0x17cdf0[_0x6613('0x40')]['id']}},_0x32f811={};_0x32f811[_0x6613('0x2c')]=_[_0x6613('0x2e')](db[_0x6613('0x28')]['rawAttributes']);_0x32f811[_0x6613('0x2d')]=_[_0x6613('0x2e')](_0x17cdf0[_0x6613('0x2d')]);_0x32f811[_0x6613('0x2f')]=_[_0x6613('0x31')](_0x32f811[_0x6613('0x2c')],_0x32f811['query']);_0x42c5bd[_0x6613('0x30')]=_[_0x6613('0x31')](_0x32f811[_0x6613('0x2c')],qs[_0x6613('0x32')](_0x17cdf0[_0x6613('0x2d')][_0x6613('0x32')]));_0x42c5bd[_0x6613('0x30')]=_0x42c5bd['attributes'][_0x6613('0x33')]?_0x42c5bd[_0x6613('0x30')]:_0x32f811[_0x6613('0x2c')];if(_0x17cdf0['query'][_0x6613('0x3a')]){_0x42c5bd[_0x6613('0x3b')]=[{'all':!![]}];}_0x42c5bd=_[_0x6613('0x38')]({},_0x42c5bd,_0x17cdf0[_0x6613('0x39')]);return db[_0x6613('0x28')]['find'](_0x42c5bd)[_0x6613('0x21')](handleEntityNotFound(_0x3fa9dd,null))[_0x6613('0x21')](respondWithResult(_0x3fa9dd,null))[_0x6613('0x3e')](handleError(_0x3fa9dd,null));};exports[_0x6613('0x41')]=function(_0x285f7f,_0x4a5742){return db[_0x6613('0x28')]['create'](_0x285f7f['body'],{})['then'](respondWithResult(_0x4a5742,0xc9))['catch'](handleError(_0x4a5742,null));};exports[_0x6613('0x1f')]=function(_0x2b5d3f,_0x32fa4b){if(_0x2b5d3f[_0x6613('0x42')]['id']){delete _0x2b5d3f[_0x6613('0x42')]['id'];}return db[_0x6613('0x28')][_0x6613('0x43')]({'where':{'id':_0x2b5d3f[_0x6613('0x40')]['id']}})[_0x6613('0x21')](handleEntityNotFound(_0x32fa4b,null))[_0x6613('0x21')](saveUpdates(_0x2b5d3f[_0x6613('0x42')],null))[_0x6613('0x21')](respondWithResult(_0x32fa4b,null))[_0x6613('0x3e')](handleError(_0x32fa4b,null));};exports[_0x6613('0x20')]=function(_0x1e9536,_0x21b25f){return db[_0x6613('0x28')][_0x6613('0x43')]({'where':{'id':_0x1e9536[_0x6613('0x40')]['id']}})[_0x6613('0x21')](handleEntityNotFound(_0x21b25f,null))[_0x6613('0x21')](removeEntity(_0x21b25f,null))[_0x6613('0x3e')](handleError(_0x21b25f,null));};exports[_0x6613('0x44')]=function(_0x1f93d2,_0x56a507){return db[_0x6613('0x28')]['describe']()['then'](respondWithResult(_0x56a507,null))[_0x6613('0x3e')](handleError(_0x56a507,null));};
\ No newline at end of file
index 1c80805..8c5c027 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5dcd=['exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./userProfileSection.attributes'];(function(_0x158a82,_0x1f0dd7){var _0xa0b2d3=function(_0x4e8d58){while(--_0x4e8d58){_0x158a82['push'](_0x158a82['shift']());}};_0xa0b2d3(++_0x1f0dd7);}(_0x5dcd,0xbb));var _0xd5dc=function(_0x504e77,_0x2fbb13){_0x504e77=_0x504e77-0x0;var _0x1fe761=_0x5dcd[_0x504e77];return _0x1fe761;};'use strict';var _=require(_0xd5dc('0x0'));var util=require(_0xd5dc('0x1'));var logger=require(_0xd5dc('0x2'))(_0xd5dc('0x3'));var moment=require(_0xd5dc('0x4'));var BPromise=require(_0xd5dc('0x5'));var rp=require(_0xd5dc('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd5dc('0x7'));module[_0xd5dc('0x8')]=function(_0x405d74,_0x5d71f8){return _0x405d74[_0xd5dc('0x9')](_0xd5dc('0xa'),attributes,{'tableName':_0xd5dc('0xb'),'paranoid':![],'indexes':[{'name':_0xd5dc('0xc'),'fields':[_0xd5dc('0xd'),_0xd5dc('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x33db=['sectionId','userProfileId','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./userProfileSection.attributes','exports','UserProfileSection','user_profile_has_sections'];(function(_0x329e44,_0x2bec9b){var _0xe0eaac=function(_0x2fe957){while(--_0x2fe957){_0x329e44['push'](_0x329e44['shift']());}};_0xe0eaac(++_0x2bec9b);}(_0x33db,0x17c));var _0xb33d=function(_0x1ef4ee,_0xd87a11){_0x1ef4ee=_0x1ef4ee-0x0;var _0xabf86f=_0x33db[_0x1ef4ee];return _0xabf86f;};'use strict';var _=require(_0xb33d('0x0'));var util=require(_0xb33d('0x1'));var logger=require(_0xb33d('0x2'))('api');var moment=require(_0xb33d('0x3'));var BPromise=require(_0xb33d('0x4'));var rp=require(_0xb33d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb33d('0x6'));var config=require(_0xb33d('0x7'));var attributes=require(_0xb33d('0x8'));module[_0xb33d('0x9')]=function(_0x5377b3,_0x433632){return _0x5377b3['define'](_0xb33d('0xa'),attributes,{'tableName':_0xb33d('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xb33d('0xc'),_0xb33d('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 81163b5..9784efa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x325e=['code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','request','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x54c913,_0x3b9057){var _0x4fd1aa=function(_0x40f435){while(--_0x40f435){_0x54c913['push'](_0x54c913['shift']());}};_0x4fd1aa(++_0x3b9057);}(_0x325e,0xc1));var _0xe325=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x325e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe325('0x0'));var util=require(_0xe325('0x1'));var moment=require('moment');var BPromise=require(_0xe325('0x2'));var rs=require(_0xe325('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe325('0x4'))['db'];var utils=require(_0xe325('0x5'));var logger=require(_0xe325('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe325('0x7')][_0xe325('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2ec995,_0x16ca23,_0x57b62c){return new BPromise(function(_0x3da76a,_0x2987be){return client[_0xe325('0x9')](_0x2ec995,_0x57b62c)['then'](function(_0x21efd9){logger[_0xe325('0xa')](_0xe325('0xb'),_0x16ca23,_0xe325('0xc'));logger['debug'](_0xe325('0xd'),_0x16ca23,_0xe325('0xc'),JSON[_0xe325('0xe')](_0x21efd9));if(_0x21efd9[_0xe325('0xf')]){if(_0x21efd9[_0xe325('0xf')][_0xe325('0x10')]===0x1f4){logger[_0xe325('0xf')](_0xe325('0xb'),_0x16ca23,_0x21efd9[_0xe325('0xf')][_0xe325('0x11')]);return _0x2987be(_0x21efd9[_0xe325('0xf')][_0xe325('0x11')]);}logger[_0xe325('0xf')](_0xe325('0xb'),_0x16ca23,_0x21efd9[_0xe325('0xf')][_0xe325('0x11')]);return _0x3da76a(_0x21efd9['error'][_0xe325('0x11')]);}else{logger['info'](_0xe325('0xb'),_0x16ca23,_0xe325('0xc'));_0x3da76a(_0x21efd9['result'][_0xe325('0x11')]);}})[_0xe325('0x12')](function(_0x58a1d2){logger['error'](_0xe325('0xb'),_0x16ca23,_0x58a1d2);_0x2987be(_0x58a1d2);});});}
\ No newline at end of file
+var _0xe9a2=['request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s'];(function(_0x2fd0f0,_0x4b634e){var _0x57f71a=function(_0x400d6f){while(--_0x400d6f){_0x2fd0f0['push'](_0x2fd0f0['shift']());}};_0x57f71a(++_0x4b634e);}(_0xe9a2,0x71));var _0x2e9a=function(_0x46f02b,_0x4e0f71){_0x46f02b=_0x46f02b-0x0;var _0x124c6f=_0xe9a2[_0x46f02b];return _0x124c6f;};'use strict';var _=require(_0x2e9a('0x0'));var util=require(_0x2e9a('0x1'));var moment=require(_0x2e9a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2e9a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2e9a('0x4'));var logger=require('../../config/logger')(_0x2e9a('0x5'));var config=require(_0x2e9a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2e9a('0x7')][_0x2e9a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4bdf65,_0x39aa91,_0x2a9275){return new BPromise(function(_0x2e7c1f,_0x2f1fa3){return client[_0x2e9a('0x9')](_0x4bdf65,_0x2a9275)[_0x2e9a('0xa')](function(_0x4b6906){logger[_0x2e9a('0xb')](_0x2e9a('0xc'),_0x39aa91,_0x2e9a('0xd'));logger[_0x2e9a('0xe')](_0x2e9a('0xf'),_0x39aa91,'request\x20sent',JSON[_0x2e9a('0x10')](_0x4b6906));if(_0x4b6906['error']){if(_0x4b6906[_0x2e9a('0x11')]['code']===0x1f4){logger[_0x2e9a('0x11')](_0x2e9a('0xc'),_0x39aa91,_0x4b6906[_0x2e9a('0x11')]['message']);return _0x2f1fa3(_0x4b6906['error'][_0x2e9a('0x12')]);}logger[_0x2e9a('0x11')](_0x2e9a('0xc'),_0x39aa91,_0x4b6906[_0x2e9a('0x11')]['message']);return _0x2e7c1f(_0x4b6906[_0x2e9a('0x11')][_0x2e9a('0x12')]);}else{logger['info'](_0x2e9a('0xc'),_0x39aa91,_0x2e9a('0xd'));_0x2e7c1f(_0x4b6906[_0x2e9a('0x13')][_0x2e9a('0x12')]);}})[_0x2e9a('0x14')](function(_0x35fe81){logger[_0x2e9a('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x39aa91,_0x35fe81);_0x2f1fa3(_0x35fe81);});});}
\ No newline at end of file
index 6953c92..abf3cc9 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(_0x1f0eb6,_0x3c763c){var _0xef43e3=function(_0x1139f7){while(--_0x1139f7){_0x1f0eb6['push'](_0x1f0eb6['shift']());}};_0xef43e3(++_0x3c763c);}(_0x70e0,0x17b));var _0x070e=function(_0x29314d,_0x440e36){_0x29314d=_0x29314d-0x0;var _0x4db8e4=_0x70e0[_0x29314d];return _0x4db8e4;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
+var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5db2e5,_0x5ade38){var _0x40953f=function(_0x9b8c5a){while(--_0x9b8c5a){_0x5db2e5['push'](_0x5db2e5['shift']());}};_0x40953f(++_0x5ade38);}(_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 0570195..cd3eb16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b1f=['sequelize','exports','INTEGER'];(function(_0x2b5748,_0x54a916){var _0x83300a=function(_0x2733d2){while(--_0x2733d2){_0x2b5748['push'](_0x2b5748['shift']());}};_0x83300a(++_0x54a916);}(_0x7b1f,0xab));var _0xf7b1=function(_0x282712,_0x489bbe){_0x282712=_0x282712-0x0;var _0xc1c850=_0x7b1f[_0x282712];return _0xc1c850;};'use strict';var Sequelize=require(_0xf7b1('0x0'));module[_0xf7b1('0x1')]={'penalty':{'type':Sequelize[_0xf7b1('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x4e45=['INTEGER','sequelize','exports'];(function(_0x45aa72,_0x8af642){var _0x75adaa=function(_0x1f6809){while(--_0x1f6809){_0x45aa72['push'](_0x45aa72['shift']());}};_0x75adaa(++_0x8af642);}(_0x4e45,0x124));var _0x54e4=function(_0x5ca7ee,_0x4c4c48){_0x5ca7ee=_0x5ca7ee-0x0;var _0x47123f=_0x4e45[_0x5ca7ee];return _0x47123f;};'use strict';var Sequelize=require(_0x54e4('0x0'));module[_0x54e4('0x1')]={'penalty':{'type':Sequelize[_0x54e4('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 737fd23..09cf263 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x187d=['define','UserSmsQueue','user_has_sms_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userSmsQueue.attributes'];(function(_0x216ef2,_0x3abfbe){var _0x317198=function(_0x3ea85d){while(--_0x3ea85d){_0x216ef2['push'](_0x216ef2['shift']());}};_0x317198(++_0x3abfbe);}(_0x187d,0x93));var _0xd187=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x187d[_0x20c9b2];return _0x2c6030;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var logger=require(_0xd187('0x1'))(_0xd187('0x2'));var moment=require(_0xd187('0x3'));var BPromise=require(_0xd187('0x4'));var rp=require(_0xd187('0x5'));var fs=require('fs');var path=require(_0xd187('0x6'));var rimraf=require('rimraf');var config=require(_0xd187('0x7'));var attributes=require(_0xd187('0x8'));module['exports']=function(_0x1d2533,_0x58ee7){return _0x1d2533[_0xd187('0x9')](_0xd187('0xa'),attributes,{'tableName':_0xd187('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9fe7=['path','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','lodash','util','api','bluebird','request-promise'];(function(_0x3f7b32,_0x541303){var _0x512f77=function(_0x56b8bf){while(--_0x56b8bf){_0x3f7b32['push'](_0x3f7b32['shift']());}};_0x512f77(++_0x541303);}(_0x9fe7,0x1df));var _0x79fe=function(_0x52dd16,_0x158c3e){_0x52dd16=_0x52dd16-0x0;var _0x56f6ba=_0x9fe7[_0x52dd16];return _0x56f6ba;};'use strict';var _=require(_0x79fe('0x0'));var util=require(_0x79fe('0x1'));var logger=require('../../config/logger')(_0x79fe('0x2'));var moment=require('moment');var BPromise=require(_0x79fe('0x3'));var rp=require(_0x79fe('0x4'));var fs=require('fs');var path=require(_0x79fe('0x5'));var rimraf=require('rimraf');var config=require(_0x79fe('0x6'));var attributes=require(_0x79fe('0x7'));module[_0x79fe('0x8')]=function(_0x4af9f6,_0x3cec9c){return _0x4af9f6[_0x79fe('0x9')](_0x79fe('0xa'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b127f74..358f0ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd082=['message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserSmsQueue,\x20%s,\x20%s'];(function(_0x1cb009,_0x2a8616){var _0x4f4085=function(_0x5e2aaa){while(--_0x5e2aaa){_0x1cb009['push'](_0x1cb009['shift']());}};_0x4f4085(++_0x2a8616);}(_0xd082,0x17d));var _0x2d08=function(_0x2d6678,_0x5ba756){_0x2d6678=_0x2d6678-0x0;var _0x2daa5a=_0xd082[_0x2d6678];return _0x2daa5a;};'use strict';var _=require('lodash');var util=require(_0x2d08('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2d08('0x1'));var fs=require('fs');var Redis=require(_0x2d08('0x2'));var db=require(_0x2d08('0x3'))['db'];var utils=require(_0x2d08('0x4'));var logger=require('../../config/logger')(_0x2d08('0x5'));var config=require(_0x2d08('0x6'));var jayson=require(_0x2d08('0x7'));var client=jayson[_0x2d08('0x8')][_0x2d08('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d3854,_0x17071b,_0x668051){return new BPromise(function(_0x19856f,_0x50ccb3){return client['request'](_0x4d3854,_0x668051)['then'](function(_0x408485){logger[_0x2d08('0xa')]('UserSmsQueue,\x20%s,\x20%s',_0x17071b,_0x2d08('0xb'));logger[_0x2d08('0xc')](_0x2d08('0xd'),_0x17071b,'request\x20sent',JSON[_0x2d08('0xe')](_0x408485));if(_0x408485['error']){if(_0x408485[_0x2d08('0xf')][_0x2d08('0x10')]===0x1f4){logger[_0x2d08('0xf')](_0x2d08('0x11'),_0x17071b,_0x408485['error'][_0x2d08('0x12')]);return _0x50ccb3(_0x408485['error'][_0x2d08('0x12')]);}logger[_0x2d08('0xf')](_0x2d08('0x11'),_0x17071b,_0x408485[_0x2d08('0xf')][_0x2d08('0x12')]);return _0x19856f(_0x408485[_0x2d08('0xf')]['message']);}else{logger[_0x2d08('0xa')](_0x2d08('0x11'),_0x17071b,_0x2d08('0xb'));_0x19856f(_0x408485[_0x2d08('0x13')][_0x2d08('0x12')]);}})[_0x2d08('0x14')](function(_0x3fde5d){logger['error'](_0x2d08('0x11'),_0x17071b,_0x3fde5d);_0x50ccb3(_0x3fde5d);});});}
\ No newline at end of file
+var _0x681a=['util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserSmsQueue,\x20%s,\x20%s','message','result','lodash'];(function(_0x1415f7,_0x31626a){var _0x2c14ac=function(_0x22572c){while(--_0x22572c){_0x1415f7['push'](_0x1415f7['shift']());}};_0x2c14ac(++_0x31626a);}(_0x681a,0x103));var _0xa681=function(_0x3bc3b4,_0x5acff4){_0x3bc3b4=_0x3bc3b4-0x0;var _0x4c546b=_0x681a[_0x3bc3b4];return _0x4c546b;};'use strict';var _=require(_0xa681('0x0'));var util=require(_0xa681('0x1'));var moment=require(_0xa681('0x2'));var BPromise=require(_0xa681('0x3'));var rs=require(_0xa681('0x4'));var fs=require('fs');var Redis=require(_0xa681('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa681('0x6'))(_0xa681('0x7'));var config=require('../../config/environment');var jayson=require(_0xa681('0x8'));var client=jayson[_0xa681('0x9')][_0xa681('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59fc27,_0x580946,_0x30d5a0){return new BPromise(function(_0x40b183,_0x1c6f38){return client[_0xa681('0xb')](_0x59fc27,_0x30d5a0)['then'](function(_0x4f56e4){logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x580946,_0xa681('0xc'));logger[_0xa681('0xd')](_0xa681('0xe'),_0x580946,_0xa681('0xc'),JSON[_0xa681('0xf')](_0x4f56e4));if(_0x4f56e4[_0xa681('0x10')]){if(_0x4f56e4['error']['code']===0x1f4){logger[_0xa681('0x10')](_0xa681('0x11'),_0x580946,_0x4f56e4['error']['message']);return _0x1c6f38(_0x4f56e4['error'][_0xa681('0x12')]);}logger[_0xa681('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x580946,_0x4f56e4[_0xa681('0x10')][_0xa681('0x12')]);return _0x40b183(_0x4f56e4[_0xa681('0x10')]['message']);}else{logger['info'](_0xa681('0x11'),_0x580946,_0xa681('0xc'));_0x40b183(_0x4f56e4[_0xa681('0x13')][_0xa681('0x12')]);}})['catch'](function(_0x5b954c){logger[_0xa681('0x10')](_0xa681('0x11'),_0x580946,_0x5b954c);_0x1c6f38(_0x5b954c);});});}
\ No newline at end of file
index 4070f75..095d3d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9896=['exports','INTEGER','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9896,0x98));var _0x6989=function(_0x109da6,_0xefd780){_0x109da6=_0x109da6-0x0;var _0x318a22=_0x9896[_0x109da6];return _0x318a22;};'use strict';var Sequelize=require(_0x6989('0x0'));module[_0x6989('0x1')]={'UserId':{'type':Sequelize[_0x6989('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x6989('0x2')]}};
\ No newline at end of file
+var _0xcfc0=['INTEGER','sequelize','exports'];(function(_0x2adb27,_0xb9de11){var _0x1e5a0c=function(_0x2a4d9b){while(--_0x2a4d9b){_0x2adb27['push'](_0x2adb27['shift']());}};_0x1e5a0c(++_0xb9de11);}(_0xcfc0,0x88));var _0x0cfc=function(_0x4cb684,_0x37e236){_0x4cb684=_0x4cb684-0x0;var _0x17b482=_0xcfc0[_0x4cb684];return _0x17b482;};'use strict';var Sequelize=require(_0x0cfc('0x0'));module[_0x0cfc('0x1')]={'UserId':{'type':Sequelize[_0x0cfc('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x0cfc('0x2')]}};
\ No newline at end of file
index 049c8a3..b111e7f 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(_0x9b21e0,_0x25130a){var _0x2e4ddf=function(_0x2ef4dd){while(--_0x2ef4dd){_0x9b21e0['push'](_0x9b21e0['shift']());}};_0x2e4ddf(++_0x25130a);}(_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':'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(_0x4a65e4,_0x374b0e){var _0x4bfd48=function(_0x2ab567){while(--_0x2ab567){_0x4a65e4['push'](_0x4a65e4['shift']());}};_0x4bfd48(++_0x374b0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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 294a6e8..578bf4b 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(_0x742767,_0xfee16a){var _0xa89319=function(_0x2647dd){while(--_0x2647dd){_0x742767['push'](_0x742767['shift']());}};_0xa89319(++_0xfee16a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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(_0x22e3d1,_0x28f853){var _0x320471=function(_0x469a78){while(--_0x469a78){_0x22e3d1['push'](_0x22e3d1['shift']());}};_0x320471(++_0x28f853);}(_0x70e0,0x17b));var _0x070e=function(_0x583c56,_0x5cc77c){_0x583c56=_0x583c56-0x0;var _0x4794ce=_0x70e0[_0x583c56];return _0x4794ce;};'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 efad0e7..c8b1213 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c7b=['exports','sequelize'];(function(_0x1477cf,_0xa2f31d){var _0xe3e3ac=function(_0x22b11b){while(--_0x22b11b){_0x1477cf['push'](_0x1477cf['shift']());}};_0xe3e3ac(++_0xa2f31d);}(_0x2c7b,0x1af));var _0xb2c7=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x2c7b[_0xa1e3e3];return _0xc980e9;};'use strict';var Sequelize=require(_0xb2c7('0x0'));module[_0xb2c7('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x8303=['sequelize','exports'];(function(_0x52a103,_0x18b19e){var _0x5d606c=function(_0x420222){while(--_0x420222){_0x52a103['push'](_0x52a103['shift']());}};_0x5d606c(++_0x18b19e);}(_0x8303,0x176));var _0x3830=function(_0x431127,_0x4661af){_0x431127=_0x431127-0x0;var _0x17488d=_0x8303[_0x431127];return _0x17488d;};'use strict';var Sequelize=require(_0x3830('0x0'));module[_0x3830('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 9f0c644..5a2217e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa96=['user_has_voice_queues','lodash','util','path','rimraf','../../config/environment','./userVoiceQueue.attributes'];(function(_0x214890,_0x2562c0){var _0x760050=function(_0x29742c){while(--_0x29742c){_0x214890['push'](_0x214890['shift']());}};_0x760050(++_0x2562c0);}(_0xfa96,0xa9));var _0x6fa9=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xfa96[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0x6fa9('0x0'));var util=require(_0x6fa9('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6fa9('0x2'));var rimraf=require(_0x6fa9('0x3'));var config=require(_0x6fa9('0x4'));var attributes=require(_0x6fa9('0x5'));module['exports']=function(_0x1059b3,_0x48f92c){return _0x1059b3['define']('UserVoiceQueue',attributes,{'tableName':_0x6fa9('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7d16=['UserVoiceQueue','user_has_voice_queues','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./userVoiceQueue.attributes','exports','define'];(function(_0x4d2c1b,_0x5ef6a1){var _0x3487be=function(_0x4522ba){while(--_0x4522ba){_0x4d2c1b['push'](_0x4d2c1b['shift']());}};_0x3487be(++_0x5ef6a1);}(_0x7d16,0x19a));var _0x67d1=function(_0x2f33f7,_0x158200){_0x2f33f7=_0x2f33f7-0x0;var _0x185c5f=_0x7d16[_0x2f33f7];return _0x185c5f;};'use strict';var _=require(_0x67d1('0x0'));var util=require('util');var logger=require(_0x67d1('0x1'))(_0x67d1('0x2'));var moment=require('moment');var BPromise=require(_0x67d1('0x3'));var rp=require(_0x67d1('0x4'));var fs=require('fs');var path=require(_0x67d1('0x5'));var rimraf=require('rimraf');var config=require(_0x67d1('0x6'));var attributes=require(_0x67d1('0x7'));module[_0x67d1('0x8')]=function(_0x484f85,_0x37d8b8){return _0x484f85[_0x67d1('0x9')](_0x67d1('0xa'),attributes,{'tableName':_0x67d1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1020da2..204657d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf524=['http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1d0948,_0x29a5ad){var _0x405614=function(_0x1ac2af){while(--_0x1ac2af){_0x1d0948['push'](_0x1d0948['shift']());}};_0x405614(++_0x29a5ad);}(_0xf524,0xef));var _0x4f52=function(_0x1a87b3,_0x45ba68){_0x1a87b3=_0x1a87b3-0x0;var _0x37e84d=_0xf524[_0x1a87b3];return _0x37e84d;};'use strict';var _=require(_0x4f52('0x0'));var util=require(_0x4f52('0x1'));var moment=require(_0x4f52('0x2'));var BPromise=require(_0x4f52('0x3'));var rs=require(_0x4f52('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4f52('0x5'))['db'];var utils=require(_0x4f52('0x6'));var logger=require(_0x4f52('0x7'))(_0x4f52('0x8'));var config=require(_0x4f52('0x9'));var jayson=require(_0x4f52('0xa'));var client=jayson['client'][_0x4f52('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x489e50,_0x3b3f3d,_0x46f68e){return new BPromise(function(_0x22e89a,_0x357819){return client[_0x4f52('0xc')](_0x489e50,_0x46f68e)[_0x4f52('0xd')](function(_0x355901){logger[_0x4f52('0xe')](_0x4f52('0xf'),_0x3b3f3d,_0x4f52('0x10'));logger[_0x4f52('0x11')](_0x4f52('0x12'),_0x3b3f3d,_0x4f52('0x10'),JSON[_0x4f52('0x13')](_0x355901));if(_0x355901[_0x4f52('0x14')]){if(_0x355901[_0x4f52('0x14')][_0x4f52('0x15')]===0x1f4){logger[_0x4f52('0x14')]('UserVoiceQueue,\x20%s,\x20%s',_0x3b3f3d,_0x355901[_0x4f52('0x14')][_0x4f52('0x16')]);return _0x357819(_0x355901['error'][_0x4f52('0x16')]);}logger[_0x4f52('0x14')](_0x4f52('0xf'),_0x3b3f3d,_0x355901['error']['message']);return _0x22e89a(_0x355901['error'][_0x4f52('0x16')]);}else{logger[_0x4f52('0xe')](_0x4f52('0xf'),_0x3b3f3d,'request\x20sent');_0x22e89a(_0x355901[_0x4f52('0x17')][_0x4f52('0x16')]);}})[_0x4f52('0x18')](function(_0x249ad1){logger[_0x4f52('0x14')](_0x4f52('0xf'),_0x3b3f3d,_0x249ad1);_0x357819(_0x249ad1);});});}
\ No newline at end of file
+var _0x21c2=['http','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x21c2,0x75));var _0x221c=function(_0x4ce6ea,_0x140fb0){_0x4ce6ea=_0x4ce6ea-0x0;var _0xf8d28=_0x21c2[_0x4ce6ea];return _0xf8d28;};'use strict';var _=require(_0x221c('0x0'));var util=require('util');var moment=require(_0x221c('0x1'));var BPromise=require(_0x221c('0x2'));var rs=require(_0x221c('0x3'));var fs=require('fs');var Redis=require(_0x221c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x221c('0x5'))(_0x221c('0x6'));var config=require(_0x221c('0x7'));var jayson=require(_0x221c('0x8'));var client=jayson['client'][_0x221c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b6d40,_0x3c3958,_0x1f0d83){return new BPromise(function(_0x582049,_0x46e8cf){return client[_0x221c('0xa')](_0x4b6d40,_0x1f0d83)[_0x221c('0xb')](function(_0xe11649){logger['info'](_0x221c('0xc'),_0x3c3958,_0x221c('0xd'));logger[_0x221c('0xe')](_0x221c('0xf'),_0x3c3958,'request\x20sent',JSON[_0x221c('0x10')](_0xe11649));if(_0xe11649['error']){if(_0xe11649['error'][_0x221c('0x11')]===0x1f4){logger[_0x221c('0x12')](_0x221c('0xc'),_0x3c3958,_0xe11649[_0x221c('0x12')]['message']);return _0x46e8cf(_0xe11649[_0x221c('0x12')][_0x221c('0x13')]);}logger[_0x221c('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x3c3958,_0xe11649[_0x221c('0x12')][_0x221c('0x13')]);return _0x582049(_0xe11649['error']['message']);}else{logger[_0x221c('0x14')](_0x221c('0xc'),_0x3c3958,_0x221c('0xd'));_0x582049(_0xe11649['result'][_0x221c('0x13')]);}})['catch'](function(_0x4616b5){logger[_0x221c('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x3c3958,_0x4616b5);_0x46e8cf(_0x4616b5);});});}
\ No newline at end of file
index 3a1c83c..693ce84 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(_0x4c9cf2,_0x42dad9){var _0x2c25c8=function(_0x2582b0){while(--_0x2582b0){_0x4c9cf2['push'](_0x4c9cf2['shift']());}};_0x2c25c8(++_0x42dad9);}(_0x70e0,0x17b));var _0x070e=function(_0x16202f,_0x21794f){_0x16202f=_0x16202f-0x0;var _0x37056d=_0x70e0[_0x16202f];return _0x37056d;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4fafa9,_0x24152d){var _0xb86f34=function(_0x399d5b){while(--_0x399d5b){_0x4fafa9['push'](_0x4fafa9['shift']());}};_0xb86f34(++_0x24152d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2ac4af,_0x288c53){_0x2ac4af=_0x2ac4af-0x0;var _0x3a36df=_0xcb91[_0x2ac4af];return _0x3a36df;};'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 303281a..a73ad46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd90=['queue_interface','Required\x20by\x20Asterisk','sequelize','exports','INTEGER','STRING'];(function(_0x6aeb0a,_0x343141){var _0x541946=function(_0x59e95c){while(--_0x59e95c){_0x6aeb0a['push'](_0x6aeb0a['shift']());}};_0x541946(++_0x343141);}(_0xcd90,0x8c));var _0x0cd9=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xcd90[_0x9df060];return _0x338dfe;};'use strict';var Sequelize=require(_0x0cd9('0x0'));module[_0x0cd9('0x1')]={'uniqueid':{'type':Sequelize[_0x0cd9('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x0cd9('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x0cd9('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0cd9('0x4'),'comment':_0x0cd9('0x5')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x0cd9('0x3')],'allowNull':![],'unique':_0x0cd9('0x4'),'comment':_0x0cd9('0x5')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x0cd9('0x5')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}};
\ No newline at end of file
+var _0x816f=['Required\x20by\x20Asterisk','INTEGER','queue_interface','exports','STRING'];(function(_0x5ae733,_0xbd346a){var _0x4f5ce8=function(_0x103415){while(--_0x103415){_0x5ae733['push'](_0x5ae733['shift']());}};_0x4f5ce8(++_0xbd346a);}(_0x816f,0x116));var _0xf816=function(_0x3289ed,_0x29c15){_0x3289ed=_0x3289ed-0x0;var _0x4ebeff=_0x816f[_0x3289ed];return _0x4ebeff;};'use strict';var Sequelize=require('sequelize');module[_0xf816('0x0')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xf816('0x1')],'allowNull':![],'comment':_0xf816('0x2')},'UserId':{'type':Sequelize[_0xf816('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf816('0x4'),'comment':_0xf816('0x2')},'VoiceQueueId':{'type':Sequelize[_0xf816('0x3')],'allowNull':![]},'interface':{'type':Sequelize[_0xf816('0x1')],'allowNull':![],'unique':_0xf816('0x4'),'comment':_0xf816('0x2')},'penalty':{'type':Sequelize[_0xf816('0x3')](0xb),'defaultValue':0x0,'comment':_0xf816('0x2')},'paused':{'type':Sequelize[_0xf816('0x3')](0xb),'defaultValue':0x0,'comment':_0xf816('0x2')}};
\ No newline at end of file
index 51b0207..1c62f61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14c0=['hasOwnProperty','events','UserVoiceQueueRt','setMaxListeners','save','update','emit'];(function(_0x10dbf6,_0x3ff964){var _0x452147=function(_0x7476e0){while(--_0x7476e0){_0x10dbf6['push'](_0x10dbf6['shift']());}};_0x452147(++_0x3ff964);}(_0x14c0,0x1b3));var _0x014c=function(_0x5f037f,_0x3af88e){_0x5f037f=_0x5f037f-0x0;var _0x52c046=_0x14c0[_0x5f037f];return _0x52c046;};'use strict';var EventEmitter=require(_0x014c('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x014c('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x014c('0x2')](0x0);var events={'afterCreate':_0x014c('0x3'),'afterUpdate':_0x014c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2cc21c){return function(_0x4c920c,_0x126453,_0x583470){UserVoiceQueueRtEvents['emit'](_0x2cc21c+':'+_0x4c920c['id'],_0x4c920c);UserVoiceQueueRtEvents[_0x014c('0x5')](_0x2cc21c,_0x4c920c);_0x583470(null);};}for(var e in events){if(events[_0x014c('0x6')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents;
\ No newline at end of file
+var _0xe703=['hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt','save','update','remove','emit'];(function(_0x219781,_0x5971ec){var _0x243a6a=function(_0xdc0495){while(--_0xdc0495){_0x219781['push'](_0x219781['shift']());}};_0x243a6a(++_0x5971ec);}(_0xe703,0x1bb));var _0x3e70=function(_0x5a559c,_0xb34e0b){_0x5a559c=_0x5a559c-0x0;var _0x1a4bd9=_0xe703[_0x5a559c];return _0x1a4bd9;};'use strict';var EventEmitter=require(_0x3e70('0x0'));var UserVoiceQueueRt=require(_0x3e70('0x1'))['db'][_0x3e70('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3e70('0x3'),'afterUpdate':_0x3e70('0x4'),'afterDestroy':_0x3e70('0x5')};function emitEvent(_0x562d95){return function(_0x5346c7,_0x21c012,_0x80ae1f){UserVoiceQueueRtEvents[_0x3e70('0x6')](_0x562d95+':'+_0x5346c7['id'],_0x5346c7);UserVoiceQueueRtEvents[_0x3e70('0x6')](_0x562d95,_0x5346c7);_0x80ae1f(null);};}for(var e in events){if(events[_0x3e70('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x3e70('0x8')](e,emitEvent(event));}}module[_0x3e70('0x9')]=UserVoiceQueueRtEvents;
\ No newline at end of file
index c90f61e..acdec7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e37=['./userVoiceQueueRt.attributes','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x9b7a64,_0x38d4a8){var _0x33fd98=function(_0x15c82b){while(--_0x15c82b){_0x9b7a64['push'](_0x9b7a64['shift']());}};_0x33fd98(++_0x38d4a8);}(_0x8e37,0x1ba));var _0x78e3=function(_0x364fca,_0x416884){_0x364fca=_0x364fca-0x0;var _0x238b50=_0x8e37[_0x364fca];return _0x238b50;};'use strict';var _=require(_0x78e3('0x0'));var util=require(_0x78e3('0x1'));var logger=require(_0x78e3('0x2'))(_0x78e3('0x3'));var moment=require(_0x78e3('0x4'));var BPromise=require(_0x78e3('0x5'));var rp=require(_0x78e3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x78e3('0x7'));var config=require('../../config/environment');var attributes=require(_0x78e3('0x8'));module['exports']=function(_0x267605,_0x3a12a8){return _0x267605[_0x78e3('0x9')]('UserVoiceQueueRt',attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x974a=['util','api','bluebird','request-promise','path','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt'];(function(_0x1d882b,_0xee1c34){var _0x43110d=function(_0x201e55){while(--_0x201e55){_0x1d882b['push'](_0x1d882b['shift']());}};_0x43110d(++_0xee1c34);}(_0x974a,0x129));var _0xa974=function(_0x482b65,_0x4f7234){_0x482b65=_0x482b65-0x0;var _0x374375=_0x974a[_0x482b65];return _0x374375;};'use strict';var _=require('lodash');var util=require(_0xa974('0x0'));var logger=require('../../config/logger')(_0xa974('0x1'));var moment=require('moment');var BPromise=require(_0xa974('0x2'));var rp=require(_0xa974('0x3'));var fs=require('fs');var path=require(_0xa974('0x4'));var rimraf=require('rimraf');var config=require(_0xa974('0x5'));var attributes=require(_0xa974('0x6'));module[_0xa974('0x7')]=function(_0xdd46eb,_0x554c4f){return _0xdd46eb[_0xa974('0x8')](_0xa974('0x9'),attributes,{'tableName':_0xa974('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 30feae8..2b7b7e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaba2=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','./userVoiceQueueRt.socket','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','stringify','util','bluebird','randomstring','ioredis'];(function(_0x42ab4d,_0x30c9d5){var _0x234f1a=function(_0x1790ba){while(--_0x1790ba){_0x42ab4d['push'](_0x42ab4d['shift']());}};_0x234f1a(++_0x30c9d5);}(_0xaba2,0x1d0));var _0x2aba=function(_0x1b4ed0,_0x576ea8){_0x1b4ed0=_0x1b4ed0-0x0;var _0x52bcd4=_0xaba2[_0x1b4ed0];return _0x52bcd4;};'use strict';var _=require('lodash');var util=require(_0x2aba('0x0'));var moment=require('moment');var BPromise=require(_0x2aba('0x1'));var rs=require(_0x2aba('0x2'));var fs=require('fs');var Redis=require(_0x2aba('0x3'));var db=require(_0x2aba('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2aba('0x5'))(_0x2aba('0x6'));var config=require(_0x2aba('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2aba('0x8')][_0x2aba('0x9')]({'port':0x232a});config[_0x2aba('0xa')]=_[_0x2aba('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2aba('0xa')]));require(_0x2aba('0xc'))['register'](socket);function respondWithRpcPromise(_0x2c7d92,_0x3e223f,_0x1e8529){return new BPromise(function(_0x46bbcf,_0x291807){return client[_0x2aba('0xd')](_0x2c7d92,_0x1e8529)[_0x2aba('0xe')](function(_0x5649cb){logger[_0x2aba('0xf')](_0x2aba('0x10'),_0x3e223f,_0x2aba('0x11'));logger[_0x2aba('0x12')](_0x2aba('0x13'),_0x3e223f,_0x2aba('0x11'),JSON['stringify'](_0x5649cb));if(_0x5649cb[_0x2aba('0x14')]){if(_0x5649cb[_0x2aba('0x14')]['code']===0x1f4){logger[_0x2aba('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3e223f,_0x5649cb[_0x2aba('0x14')][_0x2aba('0x15')]);return _0x291807(_0x5649cb[_0x2aba('0x14')][_0x2aba('0x15')]);}logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x3e223f,_0x5649cb[_0x2aba('0x14')][_0x2aba('0x15')]);return _0x46bbcf(_0x5649cb[_0x2aba('0x14')][_0x2aba('0x15')]);}else{logger[_0x2aba('0xf')](_0x2aba('0x10'),_0x3e223f,_0x2aba('0x11'));_0x46bbcf(_0x5649cb[_0x2aba('0x16')]['message']);}})[_0x2aba('0x17')](function(_0x437de2){logger[_0x2aba('0x14')](_0x2aba('0x10'),_0x3e223f,_0x437de2);_0x291807(_0x437de2);});});}exports[_0x2aba('0x18')]=function(_0x1b4276){var _0x50b0b9=this;return new Promise(function(_0x5d0f29,_0x194622){return db[_0x2aba('0x19')][_0x2aba('0x1a')]({'raw':_0x1b4276[_0x2aba('0x1b')]?_0x1b4276[_0x2aba('0x1b')][_0x2aba('0x1c')]===undefined?!![]:![]:!![],'where':_0x1b4276['options']?_0x1b4276['options'][_0x2aba('0x1d')]||null:null,'attributes':[[db[_0x2aba('0x1e')]['fn'](_0x2aba('0x1f'),db['sequelize']['fn']('IF',db[_0x2aba('0x1e')][_0x2aba('0x20')](_0x2aba('0x21')))),_0x2aba('0x22')]]})[_0x2aba('0xe')](function(_0x39376a){logger[_0x2aba('0xf')](_0x2aba('0x18'),_0x1b4276);logger[_0x2aba('0x12')](_0x2aba('0x18'),_0x1b4276,JSON[_0x2aba('0x23')](_0x39376a));_0x5d0f29(_0x39376a);})['catch'](function(_0x15fd8d){logger[_0x2aba('0x14')](_0x2aba('0x18'),_0x15fd8d[_0x2aba('0x15')],_0x1b4276);_0x194622(_0x50b0b9[_0x2aba('0x14')](0x1f4,_0x15fd8d[_0x2aba('0x15')]));});});};
\ No newline at end of file
+var _0x8913=['findAll','options','where','sequelize','COUNT','outboundQueuePauses','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8913,0x153));var _0x3891=function(_0x23e086,_0x591cbd){_0x23e086=_0x23e086-0x0;var _0x40033c=_0x8913[_0x23e086];return _0x40033c;};'use strict';var _=require(_0x3891('0x0'));var util=require(_0x3891('0x1'));var moment=require(_0x3891('0x2'));var BPromise=require(_0x3891('0x3'));var rs=require(_0x3891('0x4'));var fs=require('fs');var Redis=require(_0x3891('0x5'));var db=require(_0x3891('0x6'))['db'];var utils=require(_0x3891('0x7'));var logger=require('../../config/logger')(_0x3891('0x8'));var config=require(_0x3891('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3891('0xa')][_0x3891('0xb')]({'port':0x232a});config[_0x3891('0xc')]=_[_0x3891('0xd')](config['redis'],{'host':_0x3891('0xe'),'port':0x18eb});var socket=require(_0x3891('0xf'))(new Redis(config[_0x3891('0xc')]));require('./userVoiceQueueRt.socket')[_0x3891('0x10')](socket);function respondWithRpcPromise(_0x438342,_0x591c63,_0x358f31){return new BPromise(function(_0x5553bd,_0x31f959){return client[_0x3891('0x11')](_0x438342,_0x358f31)[_0x3891('0x12')](function(_0x2c9389){logger[_0x3891('0x13')](_0x3891('0x14'),_0x591c63,_0x3891('0x15'));logger[_0x3891('0x16')](_0x3891('0x17'),_0x591c63,'request\x20sent',JSON[_0x3891('0x18')](_0x2c9389));if(_0x2c9389[_0x3891('0x19')]){if(_0x2c9389['error'][_0x3891('0x1a')]===0x1f4){logger[_0x3891('0x19')](_0x3891('0x14'),_0x591c63,_0x2c9389[_0x3891('0x19')]['message']);return _0x31f959(_0x2c9389[_0x3891('0x19')][_0x3891('0x1b')]);}logger[_0x3891('0x19')](_0x3891('0x14'),_0x591c63,_0x2c9389['error'][_0x3891('0x1b')]);return _0x5553bd(_0x2c9389[_0x3891('0x19')][_0x3891('0x1b')]);}else{logger[_0x3891('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x591c63,_0x3891('0x15'));_0x5553bd(_0x2c9389['result'][_0x3891('0x1b')]);}})[_0x3891('0x1c')](function(_0x384b7d){logger[_0x3891('0x19')](_0x3891('0x14'),_0x591c63,_0x384b7d);_0x31f959(_0x384b7d);});});}exports[_0x3891('0x1d')]=function(_0x3ebf19){var _0x5e417b=this;return new Promise(function(_0x58443a,_0x85673c){return db[_0x3891('0x1e')][_0x3891('0x1f')]({'raw':_0x3ebf19[_0x3891('0x20')]?_0x3ebf19[_0x3891('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x3ebf19[_0x3891('0x20')]?_0x3ebf19[_0x3891('0x20')][_0x3891('0x21')]||null:null,'attributes':[[db[_0x3891('0x22')]['fn'](_0x3891('0x23'),db[_0x3891('0x22')]['fn']('IF',db[_0x3891('0x22')]['literal']('`paused`\x20=\x201,\x201,\x20null'))),_0x3891('0x24')]]})[_0x3891('0x12')](function(_0x3b130d){logger[_0x3891('0x13')](_0x3891('0x1d'),_0x3ebf19);logger[_0x3891('0x16')](_0x3891('0x1d'),_0x3ebf19,JSON[_0x3891('0x18')](_0x3b130d));_0x58443a(_0x3b130d);})[_0x3891('0x1c')](function(_0x2fff65){logger[_0x3891('0x19')](_0x3891('0x1d'),_0x2fff65[_0x3891('0x1b')],_0x3ebf19);_0x85673c(_0x5e417b[_0x3891('0x19')](0x1f4,_0x2fff65['message']));});});};
\ No newline at end of file
index 2d69f51..113a479 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d95=['save','update','emit','./userVoiceQueueRt.events'];(function(_0x19dd8a,_0x449861){var _0x212ccc=function(_0x4f52b6){while(--_0x4f52b6){_0x19dd8a['push'](_0x19dd8a['shift']());}};_0x212ccc(++_0x449861);}(_0x5d95,0x77));var _0x55d9=function(_0x2e038c,_0x336ca3){_0x2e038c=_0x2e038c-0x0;var _0x217730=_0x5d95[_0x2e038c];return _0x217730;};'use strict';var UserVoiceQueueRtEvents=require(_0x55d9('0x0'));var events=[_0x55d9('0x1'),'remove',_0x55d9('0x2')];function createListener(_0x2f84cc,_0x1c3868){return function(_0x2cc4fd){_0x1c3868[_0x55d9('0x3')](_0x2f84cc,_0x2cc4fd);};}function removeListener(_0x536e6d,_0xabfc0e){return function(){UserVoiceQueueRtEvents['removeListener'](_0x536e6d,_0xabfc0e);};}exports['register']=function(_0x25957e){for(var _0x4244b4=0x0,_0x5b4471=events['length'];_0x4244b4<_0x5b4471;_0x4244b4++){var _0x5d0b9d=events[_0x4244b4];var _0x5e52f8=createListener('userVoiceQueueRt:'+_0x5d0b9d,_0x25957e);UserVoiceQueueRtEvents['on'](_0x5d0b9d,_0x5e52f8);}};
\ No newline at end of file
+var _0x02ca=['emit','removeListener','register','length','./userVoiceQueueRt.events','remove','update'];(function(_0x3c9df8,_0x387a5d){var _0x3c8cd3=function(_0x4a0541){while(--_0x4a0541){_0x3c9df8['push'](_0x3c9df8['shift']());}};_0x3c8cd3(++_0x387a5d);}(_0x02ca,0x97));var _0xa02c=function(_0x426443,_0x3fa1ad){_0x426443=_0x426443-0x0;var _0x489c8f=_0x02ca[_0x426443];return _0x489c8f;};'use strict';var UserVoiceQueueRtEvents=require(_0xa02c('0x0'));var events=['save',_0xa02c('0x1'),_0xa02c('0x2')];function createListener(_0x306f43,_0x182120){return function(_0x573a2b){_0x182120[_0xa02c('0x3')](_0x306f43,_0x573a2b);};}function removeListener(_0x18c88a,_0x31c03a){return function(){UserVoiceQueueRtEvents[_0xa02c('0x4')](_0x18c88a,_0x31c03a);};}exports[_0xa02c('0x5')]=function(_0x46533c){for(var _0xa0f1fe=0x0,_0x29c64a=events[_0xa02c('0x6')];_0xa0f1fe<_0x29c64a;_0xa0f1fe++){var _0x2b96c5=events[_0xa0f1fe];var _0x4033b9=createListener('userVoiceQueueRt:'+_0x2b96c5,_0x46533c);UserVoiceQueueRtEvents['on'](_0x2b96c5,_0x4033b9);}};
\ No newline at end of file
index 5ae8aae..19c7001 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(_0x2511c6,_0x5859ca){var _0x10a803=function(_0x3fb3a2){while(--_0x3fb3a2){_0x2511c6['push'](_0x2511c6['shift']());}};_0x10a803(++_0x5859ca);}(_0x9c44,0x178));var _0x49c4=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9c44[_0x1035c1];return _0x308d67;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x2ec2ae,_0x4c92d3){var _0x45122b=function(_0x56f448){while(--_0x56f448){_0x2ec2ae['push'](_0x2ec2ae['shift']());}};_0x45122b(++_0x4c92d3);}(_0xedd9,0xfc));var _0x9edd=function(_0x56e363,_0x146efe){_0x56e363=_0x56e363-0x0;var _0x11e555=_0xedd9[_0x56e363];return _0x11e555;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router;
\ No newline at end of file
index b7d31cc..d083fb3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb0e=['INTEGER','sequelize','exports'];(function(_0x3a7b0d,_0x492b27){var _0x50843c=function(_0x93a01c){while(--_0x93a01c){_0x3a7b0d['push'](_0x3a7b0d['shift']());}};_0x50843c(++_0x492b27);}(_0xfb0e,0x13c));var _0xefb0=function(_0x10df18,_0x13338c){_0x10df18=_0x10df18-0x0;var _0x1f9a1d=_0xfb0e[_0x10df18];return _0x1f9a1d;};'use strict';var Sequelize=require(_0xefb0('0x0'));module[_0xefb0('0x1')]={'penalty':{'type':Sequelize[_0xefb0('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xd4d4=['INTEGER','exports'];(function(_0x3da9cb,_0x196122){var _0x43cea1=function(_0x4b1ded){while(--_0x4b1ded){_0x3da9cb['push'](_0x3da9cb['shift']());}};_0x43cea1(++_0x196122);}(_0xd4d4,0x1db));var _0x4d4d=function(_0x59f2e8,_0x1c9b66){_0x59f2e8=_0x59f2e8-0x0;var _0x26b2cc=_0xd4d4[_0x59f2e8];return _0x26b2cc;};'use strict';var Sequelize=require('sequelize');module[_0x4d4d('0x0')]={'penalty':{'type':Sequelize[_0x4d4d('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index 324a154..61ea870 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40fe=['path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','UserWhatsappQueue','util','../../config/logger','api','moment','request-promise'];(function(_0xf49632,_0x4b18ff){var _0x45ca81=function(_0x36556d){while(--_0x36556d){_0xf49632['push'](_0xf49632['shift']());}};_0x45ca81(++_0x4b18ff);}(_0x40fe,0x8a));var _0xe40f=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x40fe[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var util=require(_0xe40f('0x0'));var logger=require(_0xe40f('0x1'))(_0xe40f('0x2'));var moment=require(_0xe40f('0x3'));var BPromise=require('bluebird');var rp=require(_0xe40f('0x4'));var fs=require('fs');var path=require(_0xe40f('0x5'));var rimraf=require(_0xe40f('0x6'));var config=require(_0xe40f('0x7'));var attributes=require(_0xe40f('0x8'));module[_0xe40f('0x9')]=function(_0x1c0a86,_0x4120f0){return _0x1c0a86['define'](_0xe40f('0xa'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1626=['api','moment','path','rimraf','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash'];(function(_0x42378f,_0x4b6eaa){var _0x2d531a=function(_0x22ebd0){while(--_0x22ebd0){_0x42378f['push'](_0x42378f['shift']());}};_0x2d531a(++_0x4b6eaa);}(_0x1626,0x1c1));var _0x6162=function(_0x3c5f8d,_0x39891f){_0x3c5f8d=_0x3c5f8d-0x0;var _0x3b7beb=_0x1626[_0x3c5f8d];return _0x3b7beb;};'use strict';var _=require(_0x6162('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6162('0x1'));var moment=require(_0x6162('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6162('0x3'));var rimraf=require(_0x6162('0x4'));var config=require('../../config/environment');var attributes=require(_0x6162('0x5'));module[_0x6162('0x6')]=function(_0x27f59c,_0x270312){return _0x27f59c[_0x6162('0x7')](_0x6162('0x8'),attributes,{'tableName':_0x6162('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 93f01d9..1f86ee4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf2c=['UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4fd411,_0x5ca504){var _0x1ebdcb=function(_0x1e7f58){while(--_0x1e7f58){_0x4fd411['push'](_0x4fd411['shift']());}};_0x1ebdcb(++_0x5ca504);}(_0xcf2c,0x156));var _0xccf2=function(_0x4f4e4b,_0x46ea73){_0x4f4e4b=_0x4f4e4b-0x0;var _0x23a628=_0xcf2c[_0x4f4e4b];return _0x23a628;};'use strict';var _=require('lodash');var util=require(_0xccf2('0x0'));var moment=require(_0xccf2('0x1'));var BPromise=require(_0xccf2('0x2'));var rs=require(_0xccf2('0x3'));var fs=require('fs');var Redis=require(_0xccf2('0x4'));var db=require(_0xccf2('0x5'))['db'];var utils=require(_0xccf2('0x6'));var logger=require(_0xccf2('0x7'))(_0xccf2('0x8'));var config=require(_0xccf2('0x9'));var jayson=require(_0xccf2('0xa'));var client=jayson[_0xccf2('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9f2420,_0x1118e3,_0x1ce29e){return new BPromise(function(_0x2ec384,_0x5a5ad8){return client[_0xccf2('0xc')](_0x9f2420,_0x1ce29e)[_0xccf2('0xd')](function(_0x43821e){logger[_0xccf2('0xe')](_0xccf2('0xf'),_0x1118e3,_0xccf2('0x10'));logger[_0xccf2('0x11')](_0xccf2('0x12'),_0x1118e3,_0xccf2('0x10'),JSON[_0xccf2('0x13')](_0x43821e));if(_0x43821e[_0xccf2('0x14')]){if(_0x43821e['error'][_0xccf2('0x15')]===0x1f4){logger['error'](_0xccf2('0xf'),_0x1118e3,_0x43821e[_0xccf2('0x14')][_0xccf2('0x16')]);return _0x5a5ad8(_0x43821e[_0xccf2('0x14')][_0xccf2('0x16')]);}logger[_0xccf2('0x14')](_0xccf2('0xf'),_0x1118e3,_0x43821e[_0xccf2('0x14')]['message']);return _0x2ec384(_0x43821e[_0xccf2('0x14')]['message']);}else{logger[_0xccf2('0xe')](_0xccf2('0xf'),_0x1118e3,_0xccf2('0x10'));_0x2ec384(_0x43821e[_0xccf2('0x17')][_0xccf2('0x16')]);}})['catch'](function(_0x598102){logger[_0xccf2('0x14')]('UserWhatsappQueue,\x20%s,\x20%s',_0x1118e3,_0x598102);_0x5a5ad8(_0x598102);});});}
\ No newline at end of file
+var _0x7989=['../../config/logger','../../config/environment','jayson/promise','client','http','request','info','UserWhatsappQueue,\x20%s,\x20%s','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','result','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1c31a9,_0x35c105){var _0x14187a=function(_0x481c81){while(--_0x481c81){_0x1c31a9['push'](_0x1c31a9['shift']());}};_0x14187a(++_0x35c105);}(_0x7989,0x19b));var _0x9798=function(_0x19921b,_0x5c0c2d){_0x19921b=_0x19921b-0x0;var _0x273545=_0x7989[_0x19921b];return _0x273545;};'use strict';var _=require(_0x9798('0x0'));var util=require(_0x9798('0x1'));var moment=require(_0x9798('0x2'));var BPromise=require('bluebird');var rs=require(_0x9798('0x3'));var fs=require('fs');var Redis=require(_0x9798('0x4'));var db=require(_0x9798('0x5'))['db'];var utils=require(_0x9798('0x6'));var logger=require(_0x9798('0x7'))('rpc');var config=require(_0x9798('0x8'));var jayson=require(_0x9798('0x9'));var client=jayson[_0x9798('0xa')][_0x9798('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2560aa,_0x4bbd7d,_0x51cec0){return new BPromise(function(_0x1e406c,_0xe1d8d1){return client[_0x9798('0xc')](_0x2560aa,_0x51cec0)['then'](function(_0x5accc4){logger[_0x9798('0xd')](_0x9798('0xe'),_0x4bbd7d,'request\x20sent');logger['debug'](_0x9798('0xf'),_0x4bbd7d,'request\x20sent',JSON[_0x9798('0x10')](_0x5accc4));if(_0x5accc4[_0x9798('0x11')]){if(_0x5accc4['error'][_0x9798('0x12')]===0x1f4){logger[_0x9798('0x11')](_0x9798('0xe'),_0x4bbd7d,_0x5accc4[_0x9798('0x11')]['message']);return _0xe1d8d1(_0x5accc4['error']['message']);}logger['error'](_0x9798('0xe'),_0x4bbd7d,_0x5accc4[_0x9798('0x11')]['message']);return _0x1e406c(_0x5accc4[_0x9798('0x11')]['message']);}else{logger[_0x9798('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x4bbd7d,'request\x20sent');_0x1e406c(_0x5accc4[_0x9798('0x13')][_0x9798('0x14')]);}})[_0x9798('0x15')](function(_0x268339){logger[_0x9798('0x11')](_0x9798('0xe'),_0x4bbd7d,_0x268339);_0xe1d8d1(_0x268339);});});}
\ No newline at end of file
index ea31cf1..aee5445 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x03ce=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1c61c3,_0x1656f0){var _0x3c580f=function(_0x1ef129){while(--_0x1ef129){_0x1c61c3['push'](_0x1c61c3['shift']());}};_0x3c580f(++_0x1656f0);}(_0x03ce,0x1a1));var _0xe03c=function(_0x1ec425,_0x129273){_0x1ec425=_0x1ec425-0x0;var _0x39eeb3=_0x03ce[_0x1ec425];return _0x39eeb3;};'use strict';var multer=require(_0xe03c('0x0'));var util=require(_0xe03c('0x1'));var path=require(_0xe03c('0x2'));var timeout=require(_0xe03c('0x3'));var express=require('express');var router=express[_0xe03c('0x4')]();var fs_extra=require(_0xe03c('0x5'));var auth=require(_0xe03c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe03c('0x7'));var controller=require(_0xe03c('0x8'));router[_0xe03c('0x9')]('/',auth[_0xe03c('0xa')](),controller[_0xe03c('0xb')]);router[_0xe03c('0x9')](_0xe03c('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xe03c('0xd')]('/',auth[_0xe03c('0xa')](),controller[_0xe03c('0xe')]);router[_0xe03c('0xf')](_0xe03c('0xc'),auth[_0xe03c('0xa')](),controller[_0xe03c('0x10')]);router[_0xe03c('0x11')]('/:id',auth[_0xe03c('0xa')](),controller[_0xe03c('0x12')]);module[_0xe03c('0x13')]=router;
\ No newline at end of file
+var _0x79d3=['../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','post','put','delete','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x10bbb8,_0x19e2eb){var _0x2026a0=function(_0x36420e){while(--_0x36420e){_0x10bbb8['push'](_0x10bbb8['shift']());}};_0x2026a0(++_0x19e2eb);}(_0x79d3,0x15f));var _0x379d=function(_0x5df59f,_0xf11a72){_0x5df59f=_0x5df59f-0x0;var _0x190e3b=_0x79d3[_0x5df59f];return _0x190e3b;};'use strict';var multer=require(_0x379d('0x0'));var util=require('util');var path=require(_0x379d('0x1'));var timeout=require('connect-timeout');var express=require(_0x379d('0x2'));var router=express[_0x379d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x379d('0x4'));var interaction=require(_0x379d('0x5'));var config=require(_0x379d('0x6'));var controller=require(_0x379d('0x7'));router[_0x379d('0x8')]('/',auth[_0x379d('0x9')](),controller[_0x379d('0xa')]);router['get'](_0x379d('0xb'),auth['isAuthenticated'](),controller[_0x379d('0xc')]);router[_0x379d('0xd')]('/',auth[_0x379d('0x9')](),controller['create']);router[_0x379d('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x379d('0xf')](_0x379d('0xb'),auth[_0x379d('0x9')](),controller['destroy']);module[_0x379d('0x10')]=router;
\ No newline at end of file
index 22af1d4..2e5cfb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75f3=['STRING','exports'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x75f3,0xc5));var _0x375f=function(_0x66797e,_0x58ce63){_0x66797e=_0x66797e-0x0;var _0x27d938=_0x75f3[_0x66797e];return _0x27d938;};'use strict';var Sequelize=require('sequelize');module[_0x375f('0x0')]={'name':{'type':Sequelize[_0x375f('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x375f('0x1')]}};
\ No newline at end of file
+var _0xa215=['name','sequelize','STRING'];(function(_0x4b77a4,_0x238eef){var _0x434550=function(_0x24ae69){while(--_0x24ae69){_0x4b77a4['push'](_0x4b77a4['shift']());}};_0x434550(++_0x238eef);}(_0xa215,0x142));var _0x5a21=function(_0x304fbd,_0x401f58){_0x304fbd=_0x304fbd-0x0;var _0x3a4448=_0xa215[_0x304fbd];return _0x3a4448;};'use strict';var Sequelize=require(_0x5a21('0x0'));module['exports']={'name':{'type':Sequelize[_0x5a21('0x1')],'unique':_0x5a21('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 458688f..d55be2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0de=['../../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','Variables','UserProfileResource','destroy','error','stack','name','send','index','Variable','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','merge','map','VIRTUAL','filter','options','then','include','findAll','catch','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x124d5f,_0x234a03){var _0x21ff3a=function(_0x402108){while(--_0x402108){_0x124d5f['push'](_0x124d5f['shift']());}};_0x21ff3a(++_0x234a03);}(_0xa0de,0x91));var _0xea0d=function(_0x585d0f,_0x9efedc){_0x585d0f=_0x585d0f-0x0;var _0xc34ec8=_0xa0de[_0x585d0f];return _0xc34ec8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xea0d('0x0'));var zipdir=require(_0xea0d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xea0d('0x2'));var moment=require(_0xea0d('0x3'));var BPromise=require(_0xea0d('0x4'));var Mustache=require(_0xea0d('0x5'));var util=require(_0xea0d('0x6'));var path=require(_0xea0d('0x7'));var sox=require(_0xea0d('0x8'));var csv=require('to-csv');var ejs=require(_0xea0d('0x9'));var fs=require('fs');var fs_extra=require(_0xea0d('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xea0d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xea0d('0xc'));var querystring=require(_0xea0d('0xd'));var Papa=require(_0xea0d('0xe'));var Redis=require(_0xea0d('0xf'));var authService=require(_0xea0d('0x10'));var qs=require(_0xea0d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xea0d('0x12'));var logger=require(_0xea0d('0x13'))(_0xea0d('0x14'));var utils=require(_0xea0d('0x15'));var config=require(_0xea0d('0x16'));var licenseUtil=require(_0xea0d('0x17'));var db=require(_0xea0d('0x18'))['db'];function respondWithStatusCode(_0x130123,_0x4ea4df){_0x4ea4df=_0x4ea4df||0xcc;return function(_0x1cb1fd){if(_0x1cb1fd){return _0x130123[_0xea0d('0x19')](_0x4ea4df);}return _0x130123[_0xea0d('0x1a')](_0x4ea4df)[_0xea0d('0x1b')]();};}function respondWithResult(_0x34e442,_0x1c6ba2){_0x1c6ba2=_0x1c6ba2||0xc8;return function(_0x1ca459){if(_0x1ca459){return _0x34e442[_0xea0d('0x1a')](_0x1c6ba2)[_0xea0d('0x1c')](_0x1ca459);}};}function respondWithFilteredResult(_0x11bfd6,_0x29abc2){return function(_0x33501b){if(_0x33501b){var _0x3e6567=typeof _0x29abc2[_0xea0d('0x1d')]===_0xea0d('0x1e')&&typeof _0x29abc2[_0xea0d('0x1f')]===_0xea0d('0x1e');var _0x50d30b=_0x33501b[_0xea0d('0x20')];var _0x562e24=_0x3e6567?0x0:_0x29abc2['offset'];var _0x572274=_0x3e6567?_0x33501b[_0xea0d('0x20')]:_0x29abc2[_0xea0d('0x1d')]+_0x29abc2[_0xea0d('0x1f')];var _0x143c1e;if(_0x572274>=_0x50d30b){_0x572274=_0x50d30b;_0x143c1e=0xc8;}else{_0x143c1e=0xce;}_0x11bfd6['status'](_0x143c1e);return _0x11bfd6[_0xea0d('0x21')](_0xea0d('0x22'),_0x562e24+'-'+_0x572274+'/'+_0x50d30b)['json'](_0x33501b);}return null;};}function patchUpdates(_0x12c8b1){return function(_0x2dc18e){try{jsonpatch[_0xea0d('0x23')](_0x2dc18e,_0x12c8b1,!![]);}catch(_0x1664af){return BPromise[_0xea0d('0x24')](_0x1664af);}return _0x2dc18e[_0xea0d('0x25')]();};}function saveUpdates(_0x4f1aec,_0x2f3615){return function(_0x12d01f){if(_0x12d01f){return _0x12d01f[_0xea0d('0x26')](_0x4f1aec)['then'](function(_0x474d67){return _0x474d67;});}return null;};}function removeEntity(_0x887ad,_0x273814){return function(_0x4e0e7b){if(_0x4e0e7b){return _0x4e0e7b['destroy']()['then'](function(){var _0x421d9d=_0x4e0e7b['get']({'plain':!![]});var _0x579185=_0xea0d('0x27');return db[_0xea0d('0x28')][_0xea0d('0x29')]({'where':{'type':_0x579185,'resourceId':_0x421d9d['id']}})['then'](function(){return _0x4e0e7b;});})['then'](function(){_0x887ad['status'](0xcc)[_0xea0d('0x1b')]();});}};}function handleEntityNotFound(_0x4571d6,_0x2f7ba0){return function(_0x543fcd){if(!_0x543fcd){_0x4571d6[_0xea0d('0x19')](0x194);}return _0x543fcd;};}function handleError(_0x1a0d3b,_0x5bb88f){_0x5bb88f=_0x5bb88f||0x1f4;return function(_0x4f223b){logger[_0xea0d('0x2a')](_0x4f223b[_0xea0d('0x2b')]);if(_0x4f223b[_0xea0d('0x2c')]){delete _0x4f223b['name'];}_0x1a0d3b['status'](_0x5bb88f)[_0xea0d('0x2d')](_0x4f223b);};}exports[_0xea0d('0x2e')]=function(_0x57ab94,_0x13c9a5){var _0x14582a={},_0x4035a7={},_0x27a2d6={'count':0x0,'rows':[]};var _0x7ffdd8=_['map'](db[_0xea0d('0x2f')]['rawAttributes'],function(_0x1e9e5c){return{'name':_0x1e9e5c[_0xea0d('0x30')],'type':_0x1e9e5c['type'][_0xea0d('0x31')]};});_0x4035a7[_0xea0d('0x32')]=_['map'](_0x7ffdd8,_0xea0d('0x2c'));_0x4035a7[_0xea0d('0x33')]=_[_0xea0d('0x34')](_0x57ab94[_0xea0d('0x33')]);_0x4035a7['filters']=_[_0xea0d('0x35')](_0x4035a7[_0xea0d('0x32')],_0x4035a7[_0xea0d('0x33')]);_0x14582a[_0xea0d('0x36')]=_[_0xea0d('0x35')](_0x4035a7[_0xea0d('0x32')],qs[_0xea0d('0x37')](_0x57ab94['query'][_0xea0d('0x37')]));_0x14582a['attributes']=_0x14582a[_0xea0d('0x36')][_0xea0d('0x38')]?_0x14582a[_0xea0d('0x36')]:_0x4035a7[_0xea0d('0x32')];if(!_0x57ab94[_0xea0d('0x33')][_0xea0d('0x39')](_0xea0d('0x3a'))){_0x14582a[_0xea0d('0x1f')]=qs[_0xea0d('0x1f')](_0x57ab94['query'][_0xea0d('0x1f')]);_0x14582a[_0xea0d('0x1d')]=qs[_0xea0d('0x1d')](_0x57ab94['query'][_0xea0d('0x1d')]);}_0x14582a['order']=qs[_0xea0d('0x3b')](_0x57ab94[_0xea0d('0x33')][_0xea0d('0x3b')]);_0x14582a[_0xea0d('0x3c')]=qs['filters'](_[_0xea0d('0x3d')](_0x57ab94['query'],_0x4035a7[_0xea0d('0x3e')]),_0x7ffdd8);if(_0x57ab94[_0xea0d('0x33')]['filter']){_0x14582a['where']=_[_0xea0d('0x3f')](_0x14582a['where'],{'$or':_[_0xea0d('0x40')](_0x7ffdd8,function(_0x16166a){if(_0x16166a['type']!==_0xea0d('0x41')){var _0x51be25={};_0x51be25[_0x16166a[_0xea0d('0x2c')]]={'$like':'%'+_0x57ab94[_0xea0d('0x33')][_0xea0d('0x42')]+'%'};return _0x51be25;}})});}_0x14582a=_[_0xea0d('0x3f')]({},_0x14582a,_0x57ab94[_0xea0d('0x43')]);var _0x3d9ee2={'where':_0x14582a[_0xea0d('0x3c')]};return db[_0xea0d('0x2f')][_0xea0d('0x20')](_0x3d9ee2)[_0xea0d('0x44')](function(_0x217d99){_0x27a2d6[_0xea0d('0x20')]=_0x217d99;if(_0x57ab94[_0xea0d('0x33')]['includeAll']){_0x14582a[_0xea0d('0x45')]=[{'all':!![]}];}return db['Variable'][_0xea0d('0x46')](_0x14582a);})[_0xea0d('0x44')](function(_0x168276){_0x27a2d6['rows']=_0x168276;return _0x27a2d6;})[_0xea0d('0x44')](respondWithFilteredResult(_0x13c9a5,_0x14582a))[_0xea0d('0x47')](handleError(_0x13c9a5,null));};exports['show']=function(_0x1c6bfd,_0x34cd09){var _0x4fe931={'raw':!![],'where':{'id':_0x1c6bfd[_0xea0d('0x48')]['id']}},_0x5baf5f={};_0x5baf5f['model']=_[_0xea0d('0x34')](db[_0xea0d('0x2f')]['rawAttributes']);_0x5baf5f[_0xea0d('0x33')]=_[_0xea0d('0x34')](_0x1c6bfd['query']);_0x5baf5f[_0xea0d('0x3e')]=_[_0xea0d('0x35')](_0x5baf5f['model'],_0x5baf5f[_0xea0d('0x33')]);_0x4fe931[_0xea0d('0x36')]=_[_0xea0d('0x35')](_0x5baf5f[_0xea0d('0x32')],qs['fields'](_0x1c6bfd[_0xea0d('0x33')]['fields']));_0x4fe931[_0xea0d('0x36')]=_0x4fe931[_0xea0d('0x36')][_0xea0d('0x38')]?_0x4fe931['attributes']:_0x5baf5f[_0xea0d('0x32')];if(_0x1c6bfd[_0xea0d('0x33')]['includeAll']){_0x4fe931[_0xea0d('0x45')]=[{'all':!![]}];}_0x4fe931=_['merge']({},_0x4fe931,_0x1c6bfd['options']);return db[_0xea0d('0x2f')][_0xea0d('0x49')](_0x4fe931)[_0xea0d('0x44')](handleEntityNotFound(_0x34cd09,null))[_0xea0d('0x44')](respondWithResult(_0x34cd09,null))[_0xea0d('0x47')](handleError(_0x34cd09,null));};exports[_0xea0d('0x4a')]=function(_0x2def18,_0x2c9416){return db[_0xea0d('0x2f')]['create'](_0x2def18[_0xea0d('0x4b')],{})['then'](function(_0x2dadd5){var _0x9132e6=_0x2def18[_0xea0d('0x4c')][_0xea0d('0x4d')]({'plain':!![]});if(!_0x9132e6)throw new Error(_0xea0d('0x4e'));if(_0x9132e6[_0xea0d('0x4f')]===_0xea0d('0x4c')){var _0x3d4f2a=_0x2dadd5[_0xea0d('0x4d')]({'plain':!![]});var _0x424b1f='Variables';return db['UserProfileSection'][_0xea0d('0x49')]({'where':{'name':_0x424b1f,'userProfileId':_0x9132e6[_0xea0d('0x50')]},'raw':!![]})[_0xea0d('0x44')](function(_0x2afcbf){if(_0x2afcbf&&_0x2afcbf[_0xea0d('0x51')]===0x0){return db[_0xea0d('0x28')][_0xea0d('0x4a')]({'name':_0x3d4f2a['name'],'resourceId':_0x3d4f2a['id'],'type':_0x2afcbf['name'],'sectionId':_0x2afcbf['id']},{})['then'](function(){return _0x2dadd5;});}else{return _0x2dadd5;}})['catch'](function(_0x2aa97a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2aa97a);throw _0x2aa97a;});}return _0x2dadd5;})[_0xea0d('0x44')](respondWithResult(_0x2c9416,0xc9))[_0xea0d('0x47')](handleError(_0x2c9416,null));};exports[_0xea0d('0x26')]=function(_0x2592da,_0x579896){if(_0x2592da[_0xea0d('0x4b')]['id']){delete _0x2592da[_0xea0d('0x4b')]['id'];}return db['Variable']['find']({'where':{'id':_0x2592da[_0xea0d('0x48')]['id']}})[_0xea0d('0x44')](handleEntityNotFound(_0x579896,null))[_0xea0d('0x44')](saveUpdates(_0x2592da[_0xea0d('0x4b')],null))[_0xea0d('0x44')](respondWithResult(_0x579896,null))['catch'](handleError(_0x579896,null));};exports[_0xea0d('0x29')]=function(_0xed995c,_0x1e3119){return db[_0xea0d('0x2f')][_0xea0d('0x49')]({'where':{'id':_0xed995c[_0xea0d('0x48')]['id']}})[_0xea0d('0x44')](handleEntityNotFound(_0x1e3119,null))[_0xea0d('0x44')](removeEntity(_0x1e3119,null))['catch'](handleError(_0x1e3119,null));};
\ No newline at end of file
+var _0x4adc=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','keys','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','get','Variables','UserProfileResource','destroy','error','name','send','index','map','Variable','rawAttributes','type','model','query'];(function(_0x2e807d,_0x169e7a){var _0x271ff7=function(_0xdf1cf7){while(--_0xdf1cf7){_0x2e807d['push'](_0x2e807d['shift']());}};_0x271ff7(++_0x169e7a);}(_0x4adc,0x1f2));var _0xc4ad=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4adc[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0xc4ad('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc4ad('0x1'));var moment=require(_0xc4ad('0x2'));var BPromise=require(_0xc4ad('0x3'));var Mustache=require(_0xc4ad('0x4'));var util=require(_0xc4ad('0x5'));var path=require('path');var sox=require(_0xc4ad('0x6'));var csv=require(_0xc4ad('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc4ad('0x8'));var _=require(_0xc4ad('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc4ad('0xa'));var toCsv=require(_0xc4ad('0x7'));var querystring=require(_0xc4ad('0xb'));var Papa=require(_0xc4ad('0xc'));var Redis=require('ioredis');var authService=require(_0xc4ad('0xd'));var qs=require(_0xc4ad('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc4ad('0xf'));var logger=require('../../config/logger')(_0xc4ad('0x10'));var utils=require(_0xc4ad('0x11'));var config=require(_0xc4ad('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc4ad('0x13'))['db'];function respondWithStatusCode(_0x1a9829,_0x4b0463){_0x4b0463=_0x4b0463||0xcc;return function(_0x350801){if(_0x350801){return _0x1a9829[_0xc4ad('0x14')](_0x4b0463);}return _0x1a9829[_0xc4ad('0x15')](_0x4b0463)[_0xc4ad('0x16')]();};}function respondWithResult(_0xf9eb8b,_0xd7d748){_0xd7d748=_0xd7d748||0xc8;return function(_0x3d923f){if(_0x3d923f){return _0xf9eb8b[_0xc4ad('0x15')](_0xd7d748)['json'](_0x3d923f);}};}function respondWithFilteredResult(_0x2cfd93,_0x5b799f){return function(_0x1fe885){if(_0x1fe885){var _0x320e7d=typeof _0x5b799f[_0xc4ad('0x17')]===_0xc4ad('0x18')&&typeof _0x5b799f[_0xc4ad('0x19')]===_0xc4ad('0x18');var _0x44582b=_0x1fe885[_0xc4ad('0x1a')];var _0x2650f4=_0x320e7d?0x0:_0x5b799f[_0xc4ad('0x17')];var _0x38db0f=_0x320e7d?_0x1fe885[_0xc4ad('0x1a')]:_0x5b799f['offset']+_0x5b799f[_0xc4ad('0x19')];var _0x2a2c91;if(_0x38db0f>=_0x44582b){_0x38db0f=_0x44582b;_0x2a2c91=0xc8;}else{_0x2a2c91=0xce;}_0x2cfd93['status'](_0x2a2c91);return _0x2cfd93[_0xc4ad('0x1b')](_0xc4ad('0x1c'),_0x2650f4+'-'+_0x38db0f+'/'+_0x44582b)[_0xc4ad('0x1d')](_0x1fe885);}return null;};}function patchUpdates(_0x7187b9){return function(_0x1dd00a){try{jsonpatch[_0xc4ad('0x1e')](_0x1dd00a,_0x7187b9,!![]);}catch(_0x21894f){return BPromise[_0xc4ad('0x1f')](_0x21894f);}return _0x1dd00a['save']();};}function saveUpdates(_0x2b9278,_0x4ad7ee){return function(_0x455d87){if(_0x455d87){return _0x455d87[_0xc4ad('0x20')](_0x2b9278)[_0xc4ad('0x21')](function(_0x15e432){return _0x15e432;});}return null;};}function removeEntity(_0x5c090f,_0x293b61){return function(_0x5d84b8){if(_0x5d84b8){return _0x5d84b8['destroy']()[_0xc4ad('0x21')](function(){var _0x184990=_0x5d84b8[_0xc4ad('0x22')]({'plain':!![]});var _0x80caa8=_0xc4ad('0x23');return db[_0xc4ad('0x24')][_0xc4ad('0x25')]({'where':{'type':_0x80caa8,'resourceId':_0x184990['id']}})[_0xc4ad('0x21')](function(){return _0x5d84b8;});})[_0xc4ad('0x21')](function(){_0x5c090f[_0xc4ad('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38b1a6,_0x50ff35){return function(_0x3ebada){if(!_0x3ebada){_0x38b1a6[_0xc4ad('0x14')](0x194);}return _0x3ebada;};}function handleError(_0x2d6c05,_0x272965){_0x272965=_0x272965||0x1f4;return function(_0x5ace5e){logger[_0xc4ad('0x26')](_0x5ace5e['stack']);if(_0x5ace5e[_0xc4ad('0x27')]){delete _0x5ace5e[_0xc4ad('0x27')];}_0x2d6c05['status'](_0x272965)[_0xc4ad('0x28')](_0x5ace5e);};}exports[_0xc4ad('0x29')]=function(_0x3d67c5,_0x7200fa){var _0x5427a4={},_0x369d70={},_0x120023={'count':0x0,'rows':[]};var _0x53c892=_[_0xc4ad('0x2a')](db[_0xc4ad('0x2b')][_0xc4ad('0x2c')],function(_0x37b3db){return{'name':_0x37b3db['fieldName'],'type':_0x37b3db[_0xc4ad('0x2d')]['key']};});_0x369d70[_0xc4ad('0x2e')]=_[_0xc4ad('0x2a')](_0x53c892,_0xc4ad('0x27'));_0x369d70[_0xc4ad('0x2f')]=_['keys'](_0x3d67c5[_0xc4ad('0x2f')]);_0x369d70['filters']=_['intersection'](_0x369d70[_0xc4ad('0x2e')],_0x369d70[_0xc4ad('0x2f')]);_0x5427a4['attributes']=_[_0xc4ad('0x30')](_0x369d70[_0xc4ad('0x2e')],qs[_0xc4ad('0x31')](_0x3d67c5[_0xc4ad('0x2f')][_0xc4ad('0x31')]));_0x5427a4[_0xc4ad('0x32')]=_0x5427a4[_0xc4ad('0x32')][_0xc4ad('0x33')]?_0x5427a4['attributes']:_0x369d70[_0xc4ad('0x2e')];if(!_0x3d67c5[_0xc4ad('0x2f')][_0xc4ad('0x34')](_0xc4ad('0x35'))){_0x5427a4[_0xc4ad('0x19')]=qs[_0xc4ad('0x19')](_0x3d67c5['query'][_0xc4ad('0x19')]);_0x5427a4['offset']=qs[_0xc4ad('0x17')](_0x3d67c5['query']['offset']);}_0x5427a4[_0xc4ad('0x36')]=qs['sort'](_0x3d67c5[_0xc4ad('0x2f')][_0xc4ad('0x37')]);_0x5427a4[_0xc4ad('0x38')]=qs[_0xc4ad('0x39')](_[_0xc4ad('0x3a')](_0x3d67c5['query'],_0x369d70[_0xc4ad('0x39')]),_0x53c892);if(_0x3d67c5['query'][_0xc4ad('0x3b')]){_0x5427a4[_0xc4ad('0x38')]=_['merge'](_0x5427a4[_0xc4ad('0x38')],{'$or':_[_0xc4ad('0x2a')](_0x53c892,function(_0x697e83){if(_0x697e83[_0xc4ad('0x2d')]!==_0xc4ad('0x3c')){var _0x57385c={};_0x57385c[_0x697e83['name']]={'$like':'%'+_0x3d67c5[_0xc4ad('0x2f')]['filter']+'%'};return _0x57385c;}})});}_0x5427a4=_[_0xc4ad('0x3d')]({},_0x5427a4,_0x3d67c5[_0xc4ad('0x3e')]);var _0x3d5e3e={'where':_0x5427a4[_0xc4ad('0x38')]};return db['Variable'][_0xc4ad('0x1a')](_0x3d5e3e)[_0xc4ad('0x21')](function(_0x39ae4b){_0x120023[_0xc4ad('0x1a')]=_0x39ae4b;if(_0x3d67c5[_0xc4ad('0x2f')][_0xc4ad('0x3f')]){_0x5427a4[_0xc4ad('0x40')]=[{'all':!![]}];}return db[_0xc4ad('0x2b')][_0xc4ad('0x41')](_0x5427a4);})[_0xc4ad('0x21')](function(_0x36989d){_0x120023['rows']=_0x36989d;return _0x120023;})[_0xc4ad('0x21')](respondWithFilteredResult(_0x7200fa,_0x5427a4))[_0xc4ad('0x42')](handleError(_0x7200fa,null));};exports['show']=function(_0x1ec76f,_0x375d5d){var _0x3f8b69={'raw':!![],'where':{'id':_0x1ec76f[_0xc4ad('0x43')]['id']}},_0x2c31bd={};_0x2c31bd[_0xc4ad('0x2e')]=_[_0xc4ad('0x44')](db[_0xc4ad('0x2b')][_0xc4ad('0x2c')]);_0x2c31bd[_0xc4ad('0x2f')]=_[_0xc4ad('0x44')](_0x1ec76f[_0xc4ad('0x2f')]);_0x2c31bd[_0xc4ad('0x39')]=_[_0xc4ad('0x30')](_0x2c31bd['model'],_0x2c31bd['query']);_0x3f8b69[_0xc4ad('0x32')]=_[_0xc4ad('0x30')](_0x2c31bd[_0xc4ad('0x2e')],qs[_0xc4ad('0x31')](_0x1ec76f[_0xc4ad('0x2f')][_0xc4ad('0x31')]));_0x3f8b69[_0xc4ad('0x32')]=_0x3f8b69[_0xc4ad('0x32')][_0xc4ad('0x33')]?_0x3f8b69[_0xc4ad('0x32')]:_0x2c31bd[_0xc4ad('0x2e')];if(_0x1ec76f[_0xc4ad('0x2f')][_0xc4ad('0x3f')]){_0x3f8b69[_0xc4ad('0x40')]=[{'all':!![]}];}_0x3f8b69=_[_0xc4ad('0x3d')]({},_0x3f8b69,_0x1ec76f[_0xc4ad('0x3e')]);return db[_0xc4ad('0x2b')][_0xc4ad('0x45')](_0x3f8b69)['then'](handleEntityNotFound(_0x375d5d,null))[_0xc4ad('0x21')](respondWithResult(_0x375d5d,null))[_0xc4ad('0x42')](handleError(_0x375d5d,null));};exports['create']=function(_0x178933,_0x5d0ef4){return db[_0xc4ad('0x2b')][_0xc4ad('0x46')](_0x178933[_0xc4ad('0x47')],{})[_0xc4ad('0x21')](function(_0x2b8cfa){var _0x452d4d=_0x178933[_0xc4ad('0x48')][_0xc4ad('0x22')]({'plain':!![]});if(!_0x452d4d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x452d4d[_0xc4ad('0x49')]===_0xc4ad('0x48')){var _0x2d90a7=_0x2b8cfa[_0xc4ad('0x22')]({'plain':!![]});var _0x19c83f=_0xc4ad('0x23');return db[_0xc4ad('0x4a')]['find']({'where':{'name':_0x19c83f,'userProfileId':_0x452d4d[_0xc4ad('0x4b')]},'raw':!![]})[_0xc4ad('0x21')](function(_0x560bb8){if(_0x560bb8&&_0x560bb8[_0xc4ad('0x4c')]===0x0){return db[_0xc4ad('0x24')]['create']({'name':_0x2d90a7[_0xc4ad('0x27')],'resourceId':_0x2d90a7['id'],'type':_0x560bb8['name'],'sectionId':_0x560bb8['id']},{})[_0xc4ad('0x21')](function(){return _0x2b8cfa;});}else{return _0x2b8cfa;}})[_0xc4ad('0x42')](function(_0x3f9fc5){logger['error'](_0xc4ad('0x4d'),_0x3f9fc5);throw _0x3f9fc5;});}return _0x2b8cfa;})['then'](respondWithResult(_0x5d0ef4,0xc9))[_0xc4ad('0x42')](handleError(_0x5d0ef4,null));};exports[_0xc4ad('0x20')]=function(_0x93b8e9,_0x4afcef){if(_0x93b8e9[_0xc4ad('0x47')]['id']){delete _0x93b8e9[_0xc4ad('0x47')]['id'];}return db['Variable'][_0xc4ad('0x45')]({'where':{'id':_0x93b8e9[_0xc4ad('0x43')]['id']}})[_0xc4ad('0x21')](handleEntityNotFound(_0x4afcef,null))[_0xc4ad('0x21')](saveUpdates(_0x93b8e9[_0xc4ad('0x47')],null))[_0xc4ad('0x21')](respondWithResult(_0x4afcef,null))[_0xc4ad('0x42')](handleError(_0x4afcef,null));};exports['destroy']=function(_0x106d5,_0x460109){return db[_0xc4ad('0x2b')]['find']({'where':{'id':_0x106d5[_0xc4ad('0x43')]['id']}})[_0xc4ad('0x21')](handleEntityNotFound(_0x460109,null))[_0xc4ad('0x21')](removeEntity(_0x460109,null))[_0xc4ad('0x42')](handleError(_0x460109,null));};
\ No newline at end of file
index 709ed48..5b6ff81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeecc=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./variable.attributes','exports','Variable','tools_variables'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0xeecc,0x108));var _0xceec=function(_0x38136e,_0x9567fa){_0x38136e=_0x38136e-0x0;var _0x3befb6=_0xeecc[_0x38136e];return _0x3befb6;};'use strict';var _=require('lodash');var util=require(_0xceec('0x0'));var logger=require(_0xceec('0x1'))(_0xceec('0x2'));var moment=require(_0xceec('0x3'));var BPromise=require(_0xceec('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xceec('0x5'));var rimraf=require(_0xceec('0x6'));var config=require(_0xceec('0x7'));var attributes=require(_0xceec('0x8'));module[_0xceec('0x9')]=function(_0x490c93,_0x34d95a){return _0x490c93['define'](_0xceec('0xa'),attributes,{'tableName':_0xceec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7d75=['../../config/environment','./variable.attributes','exports','define','lodash','util','../../config/logger','moment','path','rimraf'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7d75,0x1bc));var _0x57d7=function(_0x3649c8,_0xccd9ce){_0x3649c8=_0x3649c8-0x0;var _0xafbe3b=_0x7d75[_0x3649c8];return _0xafbe3b;};'use strict';var _=require(_0x57d7('0x0'));var util=require(_0x57d7('0x1'));var logger=require(_0x57d7('0x2'))('api');var moment=require(_0x57d7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x57d7('0x4'));var rimraf=require(_0x57d7('0x5'));var config=require(_0x57d7('0x6'));var attributes=require(_0x57d7('0x7'));module[_0x57d7('0x8')]=function(_0x2341a7,_0x33e61a){return _0x2341a7[_0x57d7('0x9')]('Variable',attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 11f5833..75430d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','Variable,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','ShowVariable','Variable','raw','options','include','model','attributes','map','then','stringify','lodash'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x326f,0xd1));var _0xf326=function(_0x4f7fb5,_0x48c0d5){_0x4f7fb5=_0x4f7fb5-0x0;var _0x5cc5c9=_0x326f[_0x4f7fb5];return _0x5cc5c9;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('Variable,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('Variable,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['find']({'raw':_0x453100['options']?_0x453100['options'][_0xf326('0x16')]===undefined?!![]:![]:!![],'where':_0x453100[_0xf326('0x17')]?_0x453100['options']['where']||null:null,'attributes':_0x453100[_0xf326('0x17')]?_0x453100['options']['attributes']||null:null,'include':_0x453100[_0xf326('0x17')]?_0x453100[_0xf326('0x17')]['include']?_['map'](_0x453100[_0xf326('0x17')][_0xf326('0x18')],function(_0x5f21a2){return{'model':db[_0x5f21a2[_0xf326('0x19')]],'as':_0x5f21a2['as'],'attributes':_0x5f21a2[_0xf326('0x1a')],'include':_0x5f21a2[_0xf326('0x18')]?_[_0xf326('0x1b')](_0x5f21a2[_0xf326('0x18')],function(_0x2049ec){return{'model':db[_0x2049ec['model']],'as':_0x2049ec['as'],'attributes':_0x2049ec['attributes'],'include':_0x2049ec['include']?_[_0xf326('0x1b')](_0x2049ec[_0xf326('0x18')],function(_0x2cd45a){return{'model':db[_0x2cd45a[_0xf326('0x19')]],'as':_0x2cd45a['as'],'attributes':_0x2cd45a[_0xf326('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf326('0x1c')](function(_0x5217d4){logger[_0xf326('0xb')](_0xf326('0x14'),_0x453100);logger[_0xf326('0xe')]('ShowVariable',_0x453100,JSON[_0xf326('0x1d')](_0x5217d4));_0x31ffb9(_0x5217d4);})['catch'](function(_0x4a9abf){logger[_0xf326('0xf')](_0xf326('0x14'),_0x4a9abf[_0xf326('0x11')],_0x453100);_0xcef2b5(_0x18bee3['error'](0x1f4,_0x4a9abf[_0xf326('0x11')]));});});};
\ No newline at end of file
+var _0xa41a=['debug','Variable,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowVariable','options','raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xa41a,0x6b));var _0xaa41=function(_0x52363f,_0x33c7e4){_0x52363f=_0x52363f-0x0;var _0x519d77=_0xa41a[_0x52363f];return _0x519d77;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}exports[_0xaa41('0x17')]=function(_0xd20ddf){var _0x29efe5=this;return new Promise(function(_0x46e6d3,_0x150ddf){return db['Variable']['find']({'raw':_0xd20ddf[_0xaa41('0x18')]?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x19')]===undefined?!![]:![]:!![],'where':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1a')]||null:null,'attributes':_0xd20ddf['options']?_0xd20ddf['options'][_0xaa41('0x1b')]||null:null,'include':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')],function(_0x4eb01f){return{'model':db[_0x4eb01f[_0xaa41('0x1e')]],'as':_0x4eb01f['as'],'attributes':_0x4eb01f[_0xaa41('0x1b')],'include':_0x4eb01f[_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0x4eb01f[_0xaa41('0x1c')],function(_0xa1f024){return{'model':db[_0xa1f024['model']],'as':_0xa1f024['as'],'attributes':_0xa1f024['attributes'],'include':_0xa1f024[_0xaa41('0x1c')]?_['map'](_0xa1f024['include'],function(_0x12e362){return{'model':db[_0x12e362['model']],'as':_0x12e362['as'],'attributes':_0x12e362['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa41('0xd')](function(_0x9c8c21){logger[_0xaa41('0xe')](_0xaa41('0x17'),_0xd20ddf);logger[_0xaa41('0x11')](_0xaa41('0x17'),_0xd20ddf,JSON['stringify'](_0x9c8c21));_0x46e6d3(_0x9c8c21);})[_0xaa41('0x16')](function(_0x1f0275){logger[_0xaa41('0x13')](_0xaa41('0x17'),_0x1f0275[_0xaa41('0x14')],_0xd20ddf);_0x150ddf(_0x29efe5[_0xaa41('0x13')](0x1f4,_0x1f0275[_0xaa41('0x14')]));});});};
\ No newline at end of file
index 49c95ac..71944ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46e3=['/migrations','migrations','exports','express','Router','./version.controller','get','index','/fetch','fetch','/reset','isAuthenticated','canUpdate','pull','/restart','restart'];(function(_0x138c22,_0x33b565){var _0x33a940=function(_0x24bd3c){while(--_0x24bd3c){_0x138c22['push'](_0x138c22['shift']());}};_0x33a940(++_0x33b565);}(_0x46e3,0xa3));var _0x346e=function(_0x46b67e,_0x5a0b4d){_0x46b67e=_0x46b67e-0x0;var _0x3ff1f9=_0x46e3[_0x46b67e];return _0x3ff1f9;};'use strict';var express=require(_0x346e('0x0'));var router=express[_0x346e('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x346e('0x2'));router[_0x346e('0x3')]('/',controller[_0x346e('0x4')]);router[_0x346e('0x3')](_0x346e('0x5'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x346e('0x6')]);router[_0x346e('0x3')](_0x346e('0x7'),auth[_0x346e('0x8')](),auth[_0x346e('0x9')](),controller['reset']);router['get']('/pull',auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x346e('0xa')]);router[_0x346e('0x3')](_0x346e('0xb'),auth[_0x346e('0x8')](),controller[_0x346e('0xc')]);router[_0x346e('0x3')](_0x346e('0xd'),controller[_0x346e('0xe')]);module[_0x346e('0xf')]=router;
\ No newline at end of file
+var _0xfac1=['/reset','reset','restart','/migrations','exports','express','Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch'];(function(_0x2062bf,_0xef8bc4){var _0x328ee6=function(_0x568ed1){while(--_0x568ed1){_0x2062bf['push'](_0x2062bf['shift']());}};_0x328ee6(++_0xef8bc4);}(_0xfac1,0x1e5));var _0x1fac=function(_0x1fc82b,_0x5150a6){_0x1fc82b=_0x1fc82b-0x0;var _0x4c6679=_0xfac1[_0x1fc82b];return _0x4c6679;};'use strict';var express=require(_0x1fac('0x0'));var router=express[_0x1fac('0x1')]();var auth=require(_0x1fac('0x2'));var controller=require(_0x1fac('0x3'));router[_0x1fac('0x4')]('/',controller[_0x1fac('0x5')]);router[_0x1fac('0x4')](_0x1fac('0x6'),auth[_0x1fac('0x7')](),auth[_0x1fac('0x8')](),controller[_0x1fac('0x9')]);router[_0x1fac('0x4')](_0x1fac('0xa'),auth[_0x1fac('0x7')](),auth[_0x1fac('0x8')](),controller[_0x1fac('0xb')]);router[_0x1fac('0x4')]('/pull',auth[_0x1fac('0x7')](),auth[_0x1fac('0x8')](),controller['pull']);router['get']('/restart',auth[_0x1fac('0x7')](),controller[_0x1fac('0xc')]);router[_0x1fac('0x4')](_0x1fac('0xd'),controller['migrations']);module[_0x1fac('0xe')]=router;
\ No newline at end of file
index 1922fb8..26d66f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb888=['server','replace','push','length','Migration','sequelize','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','\x20to\x20','last','catch','Database\x20already\x20up-to-date','umzug','lodash','pkginfo','version','child_process','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','root','index','exports','query','latest','fetch','tags','2.0.0','status','json','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join'];(function(_0xd0aaf9,_0x24b1e9){var _0x143211=function(_0x3819dc){while(--_0x3819dc){_0xd0aaf9['push'](_0xd0aaf9['shift']());}};_0x143211(++_0x24b1e9);}(_0xb888,0x1ce));var _0x8b88=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb888[_0x20a584];return _0x4b41a8;};'use strict';var Umzug=require(_0x8b88('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x8b88('0x1'));var pkginfo=require(_0x8b88('0x2'))(module,_0x8b88('0x3'));var compareVersions=require('compare-versions');var exec=require(_0x8b88('0x4'))['exec'];var db=require(_0x8b88('0x5'))['db'];var config=require(_0x8b88('0x6'));var pm2=require(_0x8b88('0x7'));var logger=require('../../config/logger')(_0x8b88('0x8'));var git=require(_0x8b88('0x9'))(config[_0x8b88('0xa')]);exports[_0x8b88('0xb')]=function(_0x240297,_0x4acbbe){var _0x133897={'current':module[_0x8b88('0xc')][_0x8b88('0x3')],'phonebar':0x2};if(_0x240297[_0x8b88('0xd')]&&_0x240297['query'][_0x8b88('0xe')]){return git[_0x8b88('0xf')]()[_0x8b88('0x10')](function(_0x293cf4,_0x53234c){_0x133897[_0x8b88('0xe')]=(_0x293cf4?module[_0x8b88('0xc')][_0x8b88('0x3')]:_0x53234c[_0x8b88('0xe')])||_0x8b88('0x11');return _0x4acbbe[_0x8b88('0x12')](0xc8)[_0x8b88('0x13')](_0x133897);});}else{return _0x4acbbe[_0x8b88('0x12')](0xc8)[_0x8b88('0x13')](_0x133897);}};exports[_0x8b88('0xf')]=function(_0x4890dd,_0x1b1dc1){return git[_0x8b88('0xf')]([_0x8b88('0x14'),_0x8b88('0x15')],function(_0x52b940){if(_0x52b940){logger[_0x8b88('0x16')](_0x52b940);return _0x1b1dc1[_0x8b88('0x12')](0x1f4)[_0x8b88('0x13')](_0x52b940);}logger[_0x8b88('0x17')](_0x8b88('0x18'));return _0x1b1dc1['status'](0xc8)[_0x8b88('0x13')]({'output':_0x8b88('0x19')});});};exports[_0x8b88('0x1a')]=function(_0x2f1173,_0x9ad161){return git[_0x8b88('0x1a')]([_0x8b88('0x1b'),_0x8b88('0x1c')],function(_0x1dcd4c){if(_0x1dcd4c){logger['error'](_0x1dcd4c);return _0x9ad161[_0x8b88('0x12')](0x1f4)[_0x8b88('0x13')](_0x1dcd4c);}logger[_0x8b88('0x17')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x9ad161['status'](0xc8)['json']({'output':_0x8b88('0x1d')});});};exports[_0x8b88('0x1e')]=function(_0x3b314f,_0x1f77cc){exec('npm\x20install\x20--production',function(_0x2305f2,_0x2917db,_0x286f8e){logger['info'](_0x2917db);logger[_0x8b88('0x17')](_0x286f8e);if(_0x2305f2){logger[_0x8b88('0x16')](_0x2305f2);return _0x1f77cc[_0x8b88('0x12')](0x1f4)[_0x8b88('0x13')](_0x2305f2);}return _0x1f77cc[_0x8b88('0x12')](0xc8)[_0x8b88('0x13')]({'output':_0x2917db});});};exports['restart']=function(_0x367cce,_0x3e08bf){return pm2[_0x8b88('0x1f')](_0x8b88('0x20'))['then'](function(_0x22aa3c){logger[_0x8b88('0x17')](_0x8b88('0x21'),_0x22aa3c);return _0x3e08bf[_0x8b88('0x12')](0xc8)[_0x8b88('0x13')]({'output':_0x8b88('0x22')});})['catch'](function(_0x4aab16){logger['error'](_0x4aab16);return _0x3e08bf['status'](0x1f4)['json'](_0x4aab16);});};exports[_0x8b88('0x23')]=function(_0x37090f,_0x2db763){var _0x1b15e0=fs[_0x8b88('0x24')](path[_0x8b88('0x25')](config[_0x8b88('0xa')],_0x8b88('0x26'),_0x8b88('0x23')));var _0x985ba9=[];for(var _0x26eba2=0x0;_0x26eba2<_0x1b15e0['length'];_0x26eba2++){var _0x1283bd=_0x1b15e0[_0x26eba2][_0x8b88('0x27')]('.js','');if(compareVersions(module['exports'][_0x8b88('0x3')],_0x1283bd)===-0x1){_0x985ba9[_0x8b88('0x28')](_0x1283bd);}}if(_0x985ba9[_0x8b88('0x29')]){var _0x531ed6=_0x985ba9['sort'](compareVersions);var _0x2ccdc5=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x8b88('0x2a')],'modelName':_0x8b88('0x2a'),'columnName':_0x8b88('0x3')},'migrations':{'params':[db[_0x8b88('0x2b')][_0x8b88('0x2c')](),db['sequelize']['constructor'],function(){throw new Error(_0x8b88('0x2d'));}],'path':path[_0x8b88('0x25')](config[_0x8b88('0xa')],_0x8b88('0x26'),_0x8b88('0x23')),'pattern':/\.js$/}});_0x2ccdc5['up']({'migrations':_['map'](_0x531ed6,function(_0x255fb9){return _0x255fb9+'.js';})})['then'](function(){return _0x2db763[_0x8b88('0x12')](0xc8)[_0x8b88('0x13')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x8b88('0xc')][_0x8b88('0x3')]+_0x8b88('0x2e')+_[_0x8b88('0x2f')](_0x531ed6),'migrations':_['join'](_0x531ed6)});})[_0x8b88('0x30')](function(_0x31f3e7){if(_0x31f3e7 instanceof db[_0x8b88('0x2b')]['UniqueConstraintError']){return _0x2db763[_0x8b88('0x12')](0xc8)[_0x8b88('0x13')]({'output':_0x8b88('0x31')});}else{return _0x2db763[_0x8b88('0x12')](0x1f4)[_0x8b88('0x13')](_0x31f3e7);}});}else{return _0x2db763[_0x8b88('0x12')](0xc8)[_0x8b88('0x13')]({'output':_0x8b88('0x31')});}};
\ No newline at end of file
+var _0xb8e9=['pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','join','server','length','replace','.js','push','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','Database\x20already\x20up-to-date','umzug','path','pkginfo','version','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','root','index','exports','query','latest','fetch','2.0.0','json','origin','error','status','git\x20fetch','git\x20fetch\x20origin\x20master','--hard','FETCH_HEAD','info','pull','restart','motion2'];(function(_0x4aabc1,_0x15e9b0){var _0x302c36=function(_0x5d2280){while(--_0x5d2280){_0x4aabc1['push'](_0x4aabc1['shift']());}};_0x302c36(++_0x15e9b0);}(_0xb8e9,0x133));var _0x9b8e=function(_0x4bdfc6,_0x4c2991){_0x4bdfc6=_0x4bdfc6-0x0;var _0x5091d0=_0xb8e9[_0x4bdfc6];return _0x5091d0;};'use strict';var Umzug=require(_0x9b8e('0x0'));var path=require(_0x9b8e('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x9b8e('0x2'))(module,_0x9b8e('0x3'));var compareVersions=require(_0x9b8e('0x4'));var exec=require(_0x9b8e('0x5'))['exec'];var db=require(_0x9b8e('0x6'))['db'];var config=require(_0x9b8e('0x7'));var pm2=require(_0x9b8e('0x8'));var logger=require(_0x9b8e('0x9'))('update');var git=require('simple-git')(config[_0x9b8e('0xa')]);exports[_0x9b8e('0xb')]=function(_0x288d85,_0x1975e1){var _0x521068={'current':module[_0x9b8e('0xc')][_0x9b8e('0x3')],'phonebar':0x2};if(_0x288d85[_0x9b8e('0xd')]&&_0x288d85[_0x9b8e('0xd')][_0x9b8e('0xe')]){return git[_0x9b8e('0xf')]()['tags'](function(_0x19db98,_0x530a1c){_0x521068[_0x9b8e('0xe')]=(_0x19db98?module[_0x9b8e('0xc')][_0x9b8e('0x3')]:_0x530a1c[_0x9b8e('0xe')])||_0x9b8e('0x10');return _0x1975e1['status'](0xc8)[_0x9b8e('0x11')](_0x521068);});}else{return _0x1975e1['status'](0xc8)[_0x9b8e('0x11')](_0x521068);}};exports[_0x9b8e('0xf')]=function(_0x39fea8,_0x1d341d){return git[_0x9b8e('0xf')]([_0x9b8e('0x12'),'master'],function(_0x285566){if(_0x285566){logger[_0x9b8e('0x13')](_0x285566);return _0x1d341d[_0x9b8e('0x14')](0x1f4)[_0x9b8e('0x11')](_0x285566);}logger['info'](_0x9b8e('0x15'));return _0x1d341d[_0x9b8e('0x14')](0xc8)[_0x9b8e('0x11')]({'output':_0x9b8e('0x16')});});};exports['reset']=function(_0x383006,_0x2cbcfe){return git['reset']([_0x9b8e('0x17'),_0x9b8e('0x18')],function(_0x563c20){if(_0x563c20){logger[_0x9b8e('0x13')](_0x563c20);return _0x2cbcfe['status'](0x1f4)[_0x9b8e('0x11')](_0x563c20);}logger[_0x9b8e('0x19')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x2cbcfe[_0x9b8e('0x14')](0xc8)['json']({'output':'git\x20reset\x20--hard'});});};exports[_0x9b8e('0x1a')]=function(_0x29dd30,_0xc83a00){exec('npm\x20install\x20--production',function(_0x1af4d0,_0x560c8e,_0x1bdd1e){logger[_0x9b8e('0x19')](_0x560c8e);logger['info'](_0x1bdd1e);if(_0x1af4d0){logger[_0x9b8e('0x13')](_0x1af4d0);return _0xc83a00[_0x9b8e('0x14')](0x1f4)[_0x9b8e('0x11')](_0x1af4d0);}return _0xc83a00['status'](0xc8)[_0x9b8e('0x11')]({'output':_0x560c8e});});};exports[_0x9b8e('0x1b')]=function(_0x11d4fe,_0x460d7f){return pm2[_0x9b8e('0x1b')](_0x9b8e('0x1c'))['then'](function(_0x592bfb){logger[_0x9b8e('0x19')](_0x9b8e('0x1d'),_0x592bfb);return _0x460d7f[_0x9b8e('0x14')](0xc8)['json']({'output':_0x9b8e('0x1e')});})[_0x9b8e('0x1f')](function(_0x5cfcaf){logger[_0x9b8e('0x13')](_0x5cfcaf);return _0x460d7f[_0x9b8e('0x14')](0x1f4)[_0x9b8e('0x11')](_0x5cfcaf);});};exports[_0x9b8e('0x20')]=function(_0x56390f,_0x292ddf){var _0x3bdb60=fs['readdirSync'](path[_0x9b8e('0x21')](config[_0x9b8e('0xa')],_0x9b8e('0x22'),_0x9b8e('0x20')));var _0x284f0d=[];for(var _0x2d00e0=0x0;_0x2d00e0<_0x3bdb60[_0x9b8e('0x23')];_0x2d00e0++){var _0x4b8bbc=_0x3bdb60[_0x2d00e0][_0x9b8e('0x24')](_0x9b8e('0x25'),'');if(compareVersions(module[_0x9b8e('0xc')]['version'],_0x4b8bbc)===-0x1){_0x284f0d[_0x9b8e('0x26')](_0x4b8bbc);}}if(_0x284f0d['length']){var _0x21052f=_0x284f0d['sort'](compareVersions);var _0x54c5f0=new Umzug({'storage':_0x9b8e('0x27'),'storageOptions':{'model':db['Migration'],'modelName':_0x9b8e('0x28'),'columnName':_0x9b8e('0x3')},'migrations':{'params':[db[_0x9b8e('0x27')][_0x9b8e('0x29')](),db[_0x9b8e('0x27')][_0x9b8e('0x2a')],function(){throw new Error(_0x9b8e('0x2b'));}],'path':path['join'](config['root'],_0x9b8e('0x22'),_0x9b8e('0x20')),'pattern':/\.js$/}});_0x54c5f0['up']({'migrations':_[_0x9b8e('0x2c')](_0x21052f,function(_0x74bd63){return _0x74bd63+_0x9b8e('0x25');})})['then'](function(){return _0x292ddf[_0x9b8e('0x14')](0xc8)['json']({'output':_0x9b8e('0x2d')+module[_0x9b8e('0xc')][_0x9b8e('0x3')]+_0x9b8e('0x2e')+_['last'](_0x21052f),'migrations':_[_0x9b8e('0x21')](_0x21052f)});})[_0x9b8e('0x1f')](function(_0x375d22){if(_0x375d22 instanceof db['sequelize']['UniqueConstraintError']){return _0x292ddf[_0x9b8e('0x14')](0xc8)[_0x9b8e('0x11')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x292ddf[_0x9b8e('0x14')](0x1f4)[_0x9b8e('0x11')](_0x375d22);}});}else{return _0x292ddf[_0x9b8e('0x14')](0xc8)[_0x9b8e('0x11')]({'output':_0x9b8e('0x2f')});}};
\ No newline at end of file
index e46ac6b..b6665c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd1=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceAgentReport.controller','get','index','/describe','/:id','isAuthenticated','post','create','put','update','destroy','exports'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0xedd1,0x1e0));var _0x1edd=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0xedd1[_0xc0a3d3];return _0x3386e8;};'use strict';var multer=require(_0x1edd('0x0'));var util=require(_0x1edd('0x1'));var path=require(_0x1edd('0x2'));var timeout=require(_0x1edd('0x3'));var express=require('express');var router=express[_0x1edd('0x4')]();var fs_extra=require(_0x1edd('0x5'));var auth=require(_0x1edd('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1edd('0x7'));var controller=require(_0x1edd('0x8'));router[_0x1edd('0x9')]('/',auth['isAuthenticated'](),controller[_0x1edd('0xa')]);router[_0x1edd('0x9')](_0x1edd('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x1edd('0x9')](_0x1edd('0xc'),auth[_0x1edd('0xd')](),controller['show']);router[_0x1edd('0xe')]('/',auth[_0x1edd('0xd')](),controller[_0x1edd('0xf')]);router[_0x1edd('0x10')]('/:id',auth[_0x1edd('0xd')](),controller[_0x1edd('0x11')]);router['delete'](_0x1edd('0xc'),auth[_0x1edd('0xd')](),controller[_0x1edd('0x12')]);module[_0x1edd('0x13')]=router;
\ No newline at end of file
+var _0x89c1=['/:id','show','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','index','get','isAuthenticated','describe'];(function(_0xb68772,_0x5253ac){var _0x4189bb=function(_0x1b0cf3){while(--_0x1b0cf3){_0xb68772['push'](_0xb68772['shift']());}};_0x4189bb(++_0x5253ac);}(_0x89c1,0xef));var _0x189c=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x89c1[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require('multer');var util=require(_0x189c('0x0'));var path=require(_0x189c('0x1'));var timeout=require(_0x189c('0x2'));var express=require(_0x189c('0x3'));var router=express[_0x189c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x189c('0x5'));var interaction=require(_0x189c('0x6'));var config=require(_0x189c('0x7'));var controller=require(_0x189c('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x189c('0x9')]);router[_0x189c('0xa')]('/describe',auth[_0x189c('0xb')](),controller[_0x189c('0xc')]);router[_0x189c('0xa')](_0x189c('0xd'),auth[_0x189c('0xb')](),controller[_0x189c('0xe')]);router[_0x189c('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x189c('0x10')](_0x189c('0xd'),auth['isAuthenticated'](),controller[_0x189c('0x11')]);router[_0x189c('0x12')](_0x189c('0xd'),auth[_0x189c('0xb')](),controller[_0x189c('0x13')]);module[_0x189c('0x14')]=router;
\ No newline at end of file
index dbbab68..f547aa6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaebd=['STRING','DATE','INTEGER','BOOLEAN','sequelize'];(function(_0x23427d,_0x3c995e){var _0x4b1f91=function(_0x45815c){while(--_0x45815c){_0x23427d['push'](_0x23427d['shift']());}};_0x4b1f91(++_0x3c995e);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x5a2e96,_0x31b475){_0x5a2e96=_0x5a2e96-0x0;var _0x35769f=_0xaebd[_0x5a2e96];return _0x35769f;};'use strict';var Sequelize=require(_0xdaeb('0x0'));module['exports']={'type':{'type':Sequelize[_0xdaeb('0x1')]},'uniqueid':{'type':Sequelize[_0xdaeb('0x1')]},'calleridnum':{'type':Sequelize[_0xdaeb('0x1')]},'calleridname':{'type':Sequelize[_0xdaeb('0x1')]},'queue':{'type':Sequelize[_0xdaeb('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xdaeb('0x1')]},'agentcalledAt':{'type':Sequelize[_0xdaeb('0x2')]},'agentconnectAt':{'type':Sequelize[_0xdaeb('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xdaeb('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xdaeb('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xdaeb('0x3')]},'agentcomplete':{'type':Sequelize[_0xdaeb('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xdaeb('0x3')]},'agentacw':{'type':Sequelize[_0xdaeb('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xdaeb('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0xdaeb('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xdaeb('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xdaeb('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xdaeb('0x1')]},'accountcode':{'type':Sequelize[_0xdaeb('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xdaeb('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xdaeb('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xdaeb('0x1')]},'destcalleridnum':{'type':Sequelize[_0xdaeb('0x1')]},'destcalleridname':{'type':Sequelize[_0xdaeb('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xdaeb('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xdaeb('0x1')]},'destlanguage':{'type':Sequelize[_0xdaeb('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xdaeb('0x1')]},'destpriority':{'type':Sequelize[_0xdaeb('0x1')]},'destuniqueid':{'type':Sequelize[_0xdaeb('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xdaeb('0x1')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xdaeb('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xdaeb('0x1')]},'agententerreason':{'type':Sequelize[_0xdaeb('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xac35=['exports','STRING','DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x725a4c,_0x102507){var _0x37b2cc=function(_0x505fc9){while(--_0x505fc9){_0x725a4c['push'](_0x725a4c['shift']());}};_0x37b2cc(++_0x102507);}(_0xac35,0x141));var _0x5ac3=function(_0x2e8f23,_0x44090d){_0x2e8f23=_0x2e8f23-0x0;var _0x1f2e52=_0xac35[_0x2e8f23];return _0x1f2e52;};'use strict';var Sequelize=require(_0x5ac3('0x0'));module[_0x5ac3('0x1')]={'type':{'type':Sequelize[_0x5ac3('0x2')]},'uniqueid':{'type':Sequelize[_0x5ac3('0x2')]},'calleridnum':{'type':Sequelize[_0x5ac3('0x2')]},'calleridname':{'type':Sequelize[_0x5ac3('0x2')]},'queue':{'type':Sequelize[_0x5ac3('0x2')]},'interface':{'type':Sequelize[_0x5ac3('0x2')]},'membername':{'type':Sequelize[_0x5ac3('0x2')]},'agentcalledAt':{'type':Sequelize[_0x5ac3('0x3')]},'agentconnectAt':{'type':Sequelize[_0x5ac3('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x5ac3('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x5ac3('0x3')]},'agentdumpAt':{'type':Sequelize[_0x5ac3('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x5ac3('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x5ac3('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x5ac3('0x5')]},'agentacw':{'type':Sequelize[_0x5ac3('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x5ac3('0x5')]},'reason':{'type':Sequelize[_0x5ac3('0x2')]},'lastevent':{'type':Sequelize[_0x5ac3('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x5ac3('0x5')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x5ac3('0x2')]},'connectedlinename':{'type':Sequelize[_0x5ac3('0x2')]},'language':{'type':Sequelize[_0x5ac3('0x2')]},'accountcode':{'type':Sequelize[_0x5ac3('0x2')]},'context':{'type':Sequelize[_0x5ac3('0x2')]},'exten':{'type':Sequelize[_0x5ac3('0x2')]},'priority':{'type':Sequelize[_0x5ac3('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x5ac3('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0x5ac3('0x2')]},'destcalleridnum':{'type':Sequelize[_0x5ac3('0x2')]},'destcalleridname':{'type':Sequelize[_0x5ac3('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x5ac3('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x5ac3('0x2')]},'destlanguage':{'type':Sequelize[_0x5ac3('0x2')]},'destaccountcode':{'type':Sequelize[_0x5ac3('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x5ac3('0x2')]},'destuniqueid':{'type':Sequelize[_0x5ac3('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x5ac3('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x5ac3('0x2')],'comment':_0x5ac3('0x6')},'transferexten':{'type':Sequelize[_0x5ac3('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x5ac3('0x5')],'defaultValue':0x0}};
\ No newline at end of file
index 19172ff..1938848 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(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};
\ No newline at end of file
+var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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 f70ea1a..a3e0bb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd59=['destuniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent'];(function(_0x4d26b8,_0x40a431){var _0x23e837=function(_0x4fed66){while(--_0x4fed66){_0x4d26b8['push'](_0x4d26b8['shift']());}};_0x23e837(++_0x40a431);}(_0xcd59,0x14b));var _0x9cd5=function(_0x3f4cd0,_0x303070){_0x3f4cd0=_0x3f4cd0-0x0;var _0x3f9f01=_0xcd59[_0x3f4cd0];return _0x3f9f01;};'use strict';var _=require(_0x9cd5('0x0'));var util=require(_0x9cd5('0x1'));var logger=require(_0x9cd5('0x2'))(_0x9cd5('0x3'));var moment=require(_0x9cd5('0x4'));var BPromise=require(_0x9cd5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9cd5('0x6'));var rimraf=require(_0x9cd5('0x7'));var config=require(_0x9cd5('0x8'));var attributes=require(_0x9cd5('0x9'));module[_0x9cd5('0xa')]=function(_0x2db192,_0x46277c){return _0x2db192[_0x9cd5('0xb')](_0x9cd5('0xc'),attributes,{'tableName':_0x9cd5('0xd'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x9cd5('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf3cc=['report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./voiceAgentReport.attributes','define','VoiceAgentReport'];(function(_0x5ca5bc,_0x5b8a9d){var _0x26ca86=function(_0x1ad9a6){while(--_0x1ad9a6){_0x5ca5bc['push'](_0x5ca5bc['shift']());}};_0x26ca86(++_0x5b8a9d);}(_0xf3cc,0x10d));var _0xcf3c=function(_0x1314d4,_0xb0b16d){_0x1314d4=_0x1314d4-0x0;var _0x584ba5=_0xf3cc[_0x1314d4];return _0x584ba5;};'use strict';var _=require(_0xcf3c('0x0'));var util=require(_0xcf3c('0x1'));var logger=require(_0xcf3c('0x2'))(_0xcf3c('0x3'));var moment=require('moment');var BPromise=require(_0xcf3c('0x4'));var rp=require(_0xcf3c('0x5'));var fs=require('fs');var path=require(_0xcf3c('0x6'));var rimraf=require('rimraf');var config=require(_0xcf3c('0x7'));var attributes=require(_0xcf3c('0x8'));module['exports']=function(_0x41f804,_0x2b5cae){return _0x41f804[_0xcf3c('0x9')](_0xcf3c('0xa'),attributes,{'tableName':_0xcf3c('0xb'),'paranoid':![],'indexes':[{'fields':[_0xcf3c('0xc'),_0xcf3c('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 85074fa..aa13e2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41c0=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','VoiceAgentReport','body','options','raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x116895,_0xf2457e){var _0x51b0d9=function(_0x5e38f6){while(--_0x5e38f6){_0x116895['push'](_0x116895['shift']());}};_0x51b0d9(++_0xf2457e);}(_0x41c0,0x11a));var _0x041c=function(_0x3496d3,_0x4467a2){_0x3496d3=_0x3496d3-0x0;var _0x509096=_0x41c0[_0x3496d3];return _0x509096;};'use strict';var _=require(_0x041c('0x0'));var util=require(_0x041c('0x1'));var moment=require(_0x041c('0x2'));var BPromise=require(_0x041c('0x3'));var rs=require(_0x041c('0x4'));var fs=require('fs');var Redis=require(_0x041c('0x5'));var db=require(_0x041c('0x6'))['db'];var utils=require(_0x041c('0x7'));var logger=require(_0x041c('0x8'))(_0x041c('0x9'));var config=require(_0x041c('0xa'));var jayson=require(_0x041c('0xb'));var client=jayson[_0x041c('0xc')][_0x041c('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x13e61e,_0x483375,_0x544c7e){return new BPromise(function(_0x890dc3,_0xd44566){return client['request'](_0x13e61e,_0x544c7e)[_0x041c('0xe')](function(_0x5217ac){logger['info'](_0x041c('0xf'),_0x483375,_0x041c('0x10'));logger[_0x041c('0x11')](_0x041c('0x12'),_0x483375,'request\x20sent',JSON[_0x041c('0x13')](_0x5217ac));if(_0x5217ac['error']){if(_0x5217ac['error'][_0x041c('0x14')]===0x1f4){logger['error'](_0x041c('0xf'),_0x483375,_0x5217ac[_0x041c('0x15')][_0x041c('0x16')]);return _0xd44566(_0x5217ac[_0x041c('0x15')][_0x041c('0x16')]);}logger[_0x041c('0x15')](_0x041c('0xf'),_0x483375,_0x5217ac['error'][_0x041c('0x16')]);return _0x890dc3(_0x5217ac[_0x041c('0x15')][_0x041c('0x16')]);}else{logger[_0x041c('0x17')]('VoiceAgentReport,\x20%s,\x20%s',_0x483375,'request\x20sent');_0x890dc3(_0x5217ac[_0x041c('0x18')][_0x041c('0x16')]);}})[_0x041c('0x19')](function(_0x13cbfa){logger[_0x041c('0x15')]('VoiceAgentReport,\x20%s,\x20%s',_0x483375,_0x13cbfa);_0xd44566(_0x13cbfa);});});}exports['CreateVoiceAgentReport']=function(_0x3393fa){var _0xb368e9=this;return new Promise(function(_0x516a54,_0x30e364){return db[_0x041c('0x1a')]['create'](_0x3393fa[_0x041c('0x1b')],{'raw':_0x3393fa[_0x041c('0x1c')]?_0x3393fa[_0x041c('0x1c')][_0x041c('0x1d')]===undefined?!![]:![]:!![]})[_0x041c('0xe')](function(_0x2b70a4){logger[_0x041c('0x17')](_0x041c('0x1e'),_0x3393fa);logger['debug']('CreateVoiceAgentReport',_0x3393fa,JSON[_0x041c('0x13')](_0x2b70a4));_0x516a54(_0x2b70a4);})['catch'](function(_0x1856fc){logger[_0x041c('0x15')](_0x041c('0x1e'),_0x1856fc['message'],_0x3393fa);_0x30e364(_0xb368e9[_0x041c('0x15')](0x1f4,_0x1856fc[_0x041c('0x16')]));});});};exports[_0x041c('0x1f')]=function(_0x2781b6){var _0x2263a9=this;return new Promise(function(_0x4a3784,_0x3287bb){return db['VoiceAgentReport'][_0x041c('0x20')](_0x2781b6[_0x041c('0x1b')],{'raw':_0x2781b6[_0x041c('0x1c')]?_0x2781b6[_0x041c('0x1c')][_0x041c('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2781b6[_0x041c('0x1c')]?_0x2781b6[_0x041c('0x1c')][_0x041c('0x21')]||null:null,'attributes':_0x2781b6[_0x041c('0x1c')]?_0x2781b6[_0x041c('0x1c')][_0x041c('0x22')]||null:null,'limit':_0x2781b6[_0x041c('0x1c')]?_0x2781b6['options'][_0x041c('0x23')]||null:null})[_0x041c('0xe')](function(_0x28261a){logger[_0x041c('0x17')](_0x041c('0x1f'),_0x2781b6);logger['debug'](_0x041c('0x1f'),_0x2781b6,JSON[_0x041c('0x13')](_0x28261a));_0x4a3784(_0x28261a);})[_0x041c('0x19')](function(_0x4ec011){logger[_0x041c('0x15')](_0x041c('0x1f'),_0x4ec011[_0x041c('0x16')],_0x2781b6);_0x3287bb(_0x2263a9['error'](0x1f4,_0x4ec011[_0x041c('0x16')]));});});};
\ No newline at end of file
+var _0x1d4c=['debug','catch','UpdateVoiceAgentReport','update','raw','where','attributes','limit','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','VoiceAgentReport','create','body','options','CreateVoiceAgentReport'];(function(_0x6d6a66,_0x2924af){var _0x11eb6e=function(_0x52e55a){while(--_0x52e55a){_0x6d6a66['push'](_0x6d6a66['shift']());}};_0x11eb6e(++_0x2924af);}(_0x1d4c,0x13a));var _0xc1d4=function(_0x139de8,_0x53f05c){_0x139de8=_0x139de8-0x0;var _0x3a0dc4=_0x1d4c[_0x139de8];return _0x3a0dc4;};'use strict';var _=require(_0xc1d4('0x0'));var util=require(_0xc1d4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1d4('0x2'));var db=require(_0xc1d4('0x3'))['db'];var utils=require(_0xc1d4('0x4'));var logger=require(_0xc1d4('0x5'))(_0xc1d4('0x6'));var config=require(_0xc1d4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc1d4('0x8')][_0xc1d4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31cc00,_0x46dcba,_0x1401f1){return new BPromise(function(_0x671af2,_0x4daf1b){return client[_0xc1d4('0xa')](_0x31cc00,_0x1401f1)[_0xc1d4('0xb')](function(_0x2ad679){logger[_0xc1d4('0xc')](_0xc1d4('0xd'),_0x46dcba,'request\x20sent');logger['debug'](_0xc1d4('0xe'),_0x46dcba,'request\x20sent',JSON[_0xc1d4('0xf')](_0x2ad679));if(_0x2ad679[_0xc1d4('0x10')]){if(_0x2ad679[_0xc1d4('0x10')][_0xc1d4('0x11')]===0x1f4){logger[_0xc1d4('0x10')](_0xc1d4('0xd'),_0x46dcba,_0x2ad679['error'][_0xc1d4('0x12')]);return _0x4daf1b(_0x2ad679['error']['message']);}logger['error'](_0xc1d4('0xd'),_0x46dcba,_0x2ad679['error'][_0xc1d4('0x12')]);return _0x671af2(_0x2ad679[_0xc1d4('0x10')]['message']);}else{logger[_0xc1d4('0xc')](_0xc1d4('0xd'),_0x46dcba,_0xc1d4('0x13'));_0x671af2(_0x2ad679[_0xc1d4('0x14')][_0xc1d4('0x12')]);}})['catch'](function(_0x872d6e){logger[_0xc1d4('0x10')](_0xc1d4('0xd'),_0x46dcba,_0x872d6e);_0x4daf1b(_0x872d6e);});});}exports['CreateVoiceAgentReport']=function(_0x4b3477){var _0x314d6d=this;return new Promise(function(_0x5a413d,_0x30be6e){return db[_0xc1d4('0x15')][_0xc1d4('0x16')](_0x4b3477[_0xc1d4('0x17')],{'raw':_0x4b3477[_0xc1d4('0x18')]?_0x4b3477[_0xc1d4('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xc1d4('0xb')](function(_0x1aec20){logger['info'](_0xc1d4('0x19'),_0x4b3477);logger[_0xc1d4('0x1a')](_0xc1d4('0x19'),_0x4b3477,JSON[_0xc1d4('0xf')](_0x1aec20));_0x5a413d(_0x1aec20);})[_0xc1d4('0x1b')](function(_0x4802f8){logger[_0xc1d4('0x10')]('CreateVoiceAgentReport',_0x4802f8[_0xc1d4('0x12')],_0x4b3477);_0x30be6e(_0x314d6d[_0xc1d4('0x10')](0x1f4,_0x4802f8[_0xc1d4('0x12')]));});});};exports[_0xc1d4('0x1c')]=function(_0x41dd82){var _0x8bffe4=this;return new Promise(function(_0x5a9251,_0x49fa5e){return db[_0xc1d4('0x15')][_0xc1d4('0x1d')](_0x41dd82[_0xc1d4('0x17')],{'raw':_0x41dd82[_0xc1d4('0x18')]?_0x41dd82[_0xc1d4('0x18')][_0xc1d4('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41dd82[_0xc1d4('0x18')]?_0x41dd82[_0xc1d4('0x18')][_0xc1d4('0x1f')]||null:null,'attributes':_0x41dd82['options']?_0x41dd82[_0xc1d4('0x18')][_0xc1d4('0x20')]||null:null,'limit':_0x41dd82[_0xc1d4('0x18')]?_0x41dd82[_0xc1d4('0x18')][_0xc1d4('0x21')]||null:null})[_0xc1d4('0xb')](function(_0x4f7f7e){logger[_0xc1d4('0xc')](_0xc1d4('0x1c'),_0x41dd82);logger[_0xc1d4('0x1a')](_0xc1d4('0x1c'),_0x41dd82,JSON[_0xc1d4('0xf')](_0x4f7f7e));_0x5a9251(_0x4f7f7e);})[_0xc1d4('0x1b')](function(_0x2aa6f5){logger[_0xc1d4('0x10')](_0xc1d4('0x1c'),_0x2aa6f5[_0xc1d4('0x12')],_0x41dd82);_0x49fa5e(_0x8bffe4[_0xc1d4('0x10')](0x1f4,_0x2aa6f5[_0xc1d4('0x12')]));});});};
\ No newline at end of file
index 29ad571..efe30c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x277c=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','/:id','show','post','create','update','delete','destroy','multer','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x277c,0x153));var _0xc277=function(_0x47e48e,_0x38882d){_0x47e48e=_0x47e48e-0x0;var _0x468e15=_0x277c[_0x47e48e];return _0x468e15;};'use strict';var multer=require(_0xc277('0x0'));var util=require('util');var path=require(_0xc277('0x1'));var timeout=require(_0xc277('0x2'));var express=require(_0xc277('0x3'));var router=express[_0xc277('0x4')]();var fs_extra=require(_0xc277('0x5'));var auth=require(_0xc277('0x6'));var interaction=require(_0xc277('0x7'));var config=require(_0xc277('0x8'));var controller=require('./voiceCallReport.controller');router['get']('/',auth[_0xc277('0x9')](),controller['index']);router[_0xc277('0xa')]('/describe',auth[_0xc277('0x9')](),controller[_0xc277('0xb')]);router['get'](_0xc277('0xc'),auth[_0xc277('0x9')](),controller[_0xc277('0xd')]);router[_0xc277('0xe')]('/',auth[_0xc277('0x9')](),controller[_0xc277('0xf')]);router['put']('/:id',auth[_0xc277('0x9')](),controller[_0xc277('0x10')]);router[_0xc277('0x11')](_0xc277('0xc'),auth['isAuthenticated'](),controller[_0xc277('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x8ef6=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x339ee7,_0x16f0b8){var _0x4e28b0=function(_0x32b62e){while(--_0x32b62e){_0x339ee7['push'](_0x339ee7['shift']());}};_0x4e28b0(++_0x16f0b8);}(_0x8ef6,0xf2));var _0x68ef=function(_0x30ff41,_0x5116f2){_0x30ff41=_0x30ff41-0x0;var _0x243701=_0x8ef6[_0x30ff41];return _0x243701;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var fs_extra=require(_0x68ef('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var controller=require(_0x68ef('0x9'));router[_0x68ef('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x68ef('0xa')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller['describe']);router[_0x68ef('0xa')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0xe')]);router[_0x68ef('0xf')]('/',auth[_0x68ef('0xc')](),controller[_0x68ef('0x10')]);router[_0x68ef('0x11')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x12')]);router[_0x68ef('0x13')]('/:id',auth[_0x68ef('0xc')](),controller[_0x68ef('0x14')]);module[_0x68ef('0x15')]=router;
\ No newline at end of file
index 7cacc1b..60ba154 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9d0=['INTEGER','sequelize','exports','STRING','ENUM','inbound','internal','outbound','TEXT','DATE'];(function(_0x4a6102,_0xedf422){var _0x416650=function(_0x4be9ec){while(--_0x4be9ec){_0x4a6102['push'](_0x4a6102['shift']());}};_0x416650(++_0xedf422);}(_0xa9d0,0x1eb));var _0x0a9d=function(_0x2a0c7e,_0x5b27d4){_0x2a0c7e=_0x2a0c7e-0x0;var _0x57e929=_0xa9d0[_0x2a0c7e];return _0x57e929;};'use strict';var Sequelize=require(_0x0a9d('0x0'));module[_0x0a9d('0x1')]={'uniqueid':{'type':Sequelize[_0x0a9d('0x2')]},'type':{'type':Sequelize[_0x0a9d('0x3')](_0x0a9d('0x4'),_0x0a9d('0x5'),_0x0a9d('0x6'),'inbound-fax','outbound-fax','dialer')},'tag':{'type':Sequelize[_0x0a9d('0x2')]},'accountcode':{'type':Sequelize[_0x0a9d('0x2')]},'source':{'type':Sequelize[_0x0a9d('0x2')]},'destination':{'type':Sequelize[_0x0a9d('0x2')]},'destinationcontext':{'type':Sequelize[_0x0a9d('0x2')]},'callerid':{'type':Sequelize[_0x0a9d('0x2')]},'channel':{'type':Sequelize[_0x0a9d('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x0a9d('0x2')]},'lastdata':{'type':Sequelize[_0x0a9d('0x7')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x0a9d('0x8')]},'answertime':{'type':Sequelize[_0x0a9d('0x8')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x0a9d('0x9')]},'mohtime':{'type':Sequelize[_0x0a9d('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0a9d('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x0a9d('0x2')]},'userDisposition':{'type':Sequelize[_0x0a9d('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x0a9d('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x0a9d('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x0a9d('0x2')]},'routeid':{'type':Sequelize[_0x0a9d('0x9')]},'sipcallid':{'type':Sequelize[_0x0a9d('0x2')]}};
\ No newline at end of file
+var _0x4f81=['outbound','inbound-fax','outbound-fax','dialer','DATE','INTEGER','STRING','inbound','internal'];(function(_0x5137dd,_0x55c6cb){var _0x11dea6=function(_0x290bce){while(--_0x290bce){_0x5137dd['push'](_0x5137dd['shift']());}};_0x11dea6(++_0x55c6cb);}(_0x4f81,0x1e3));var _0x14f8=function(_0x5392a7,_0x3dd841){_0x5392a7=_0x5392a7-0x0;var _0xba6fc4=_0x4f81[_0x5392a7];return _0xba6fc4;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x14f8('0x0')]},'type':{'type':Sequelize['ENUM'](_0x14f8('0x1'),_0x14f8('0x2'),_0x14f8('0x3'),_0x14f8('0x4'),_0x14f8('0x5'),_0x14f8('0x6'))},'tag':{'type':Sequelize[_0x14f8('0x0')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x14f8('0x0')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x14f8('0x0')]},'callerid':{'type':Sequelize[_0x14f8('0x0')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x14f8('0x0')]},'lastapplication':{'type':Sequelize[_0x14f8('0x0')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x14f8('0x7')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x14f8('0x7')]},'duration':{'type':Sequelize[_0x14f8('0x8')]},'billableseconds':{'type':Sequelize[_0x14f8('0x8')]},'mohtime':{'type':Sequelize[_0x14f8('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x14f8('0x0')]},'amaflags':{'type':Sequelize[_0x14f8('0x0')]},'userfield':{'type':Sequelize[_0x14f8('0x0')]},'userDisposition':{'type':Sequelize[_0x14f8('0x0')]},'userSecondDisposition':{'type':Sequelize[_0x14f8('0x0')]},'userThirdDisposition':{'type':Sequelize[_0x14f8('0x0')]},'note':{'type':Sequelize[_0x14f8('0x0')]},'prefix':{'type':Sequelize[_0x14f8('0x0')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x14f8('0x0')]}};
\ No newline at end of file
index acdcd55..e2a2303 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x12ca5f,_0x223d98){var _0xfc3ae9=function(_0x1928fb){while(--_0x1928fb){_0x12ca5f['push'](_0x12ca5f['shift']());}};_0xfc3ae9(++_0x223d98);}(_0x2ef3,0xba));var _0x32ef=function(_0x4003e1,_0x4bc295){_0x4003e1=_0x4003e1-0x0;var _0x3d864b=_0x2ef3[_0x4003e1];return _0x3d864b;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));};
\ No newline at end of file
+var _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));};
\ No newline at end of file
index 77623fc..0e7543f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf911=['VoiceCallReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceCallReport.attributes','exports','define'];(function(_0x2d7529,_0x344e62){var _0x511e66=function(_0x5e5ba2){while(--_0x5e5ba2){_0x2d7529['push'](_0x2d7529['shift']());}};_0x511e66(++_0x344e62);}(_0xf911,0xe2));var _0x1f91=function(_0x246b48,_0x35a292){_0x246b48=_0x246b48-0x0;var _0x3ba4d8=_0xf911[_0x246b48];return _0x3ba4d8;};'use strict';var _=require(_0x1f91('0x0'));var util=require(_0x1f91('0x1'));var logger=require(_0x1f91('0x2'))(_0x1f91('0x3'));var moment=require(_0x1f91('0x4'));var BPromise=require(_0x1f91('0x5'));var rp=require(_0x1f91('0x6'));var fs=require('fs');var path=require(_0x1f91('0x7'));var rimraf=require('rimraf');var config=require(_0x1f91('0x8'));var attributes=require(_0x1f91('0x9'));module[_0x1f91('0xa')]=function(_0x3a431c,_0x5deea8){return _0x3a431c[_0x1f91('0xb')](_0x1f91('0xc'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x1f91('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd60b=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','lodash'];(function(_0x2bd88d,_0x2d5dc3){var _0x5516d4=function(_0x1272c8){while(--_0x1272c8){_0x2bd88d['push'](_0x2bd88d['shift']());}};_0x5516d4(++_0x2d5dc3);}(_0xd60b,0x6f));var _0xbd60=function(_0x126a6a,_0x2b30a4){_0x126a6a=_0x126a6a-0x0;var _0x35f89c=_0xd60b[_0x126a6a];return _0x35f89c;};'use strict';var _=require(_0xbd60('0x0'));var util=require(_0xbd60('0x1'));var logger=require(_0xbd60('0x2'))(_0xbd60('0x3'));var moment=require(_0xbd60('0x4'));var BPromise=require(_0xbd60('0x5'));var rp=require(_0xbd60('0x6'));var fs=require('fs');var path=require(_0xbd60('0x7'));var rimraf=require(_0xbd60('0x8'));var config=require(_0xbd60('0x9'));var attributes=require(_0xbd60('0xa'));module[_0xbd60('0xb')]=function(_0x1ee3f8,_0xe0a9f8){return _0x1ee3f8[_0xbd60('0xc')](_0xbd60('0xd'),attributes,{'tableName':_0xbd60('0xe'),'paranoid':![],'indexes':[{'fields':[_0xbd60('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
index fd10422..1b89622 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe957=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VoiceCallReport,\x20%s,\x20%s','message','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','attributes','include','map','model','then','create','body','CreateVoiceCallReport','stringify','UpdateVoiceCallReport','update','where','limit','catch','lodash','moment','bluebird','randomstring'];(function(_0x2261a1,_0x5a5ba9){var _0xe8987d=function(_0x389d1f){while(--_0x389d1f){_0x2261a1['push'](_0x2261a1['shift']());}};_0xe8987d(++_0x5a5ba9);}(_0xe957,0x114));var _0x7e95=function(_0x3b3dab,_0x4b9fb0){_0x3b3dab=_0x3b3dab-0x0;var _0x1fab57=_0xe957[_0x3b3dab];return _0x1fab57;};'use strict';var _=require(_0x7e95('0x0'));var util=require('util');var moment=require(_0x7e95('0x1'));var BPromise=require(_0x7e95('0x2'));var rs=require(_0x7e95('0x3'));var fs=require('fs');var Redis=require(_0x7e95('0x4'));var db=require(_0x7e95('0x5'))['db'];var utils=require(_0x7e95('0x6'));var logger=require(_0x7e95('0x7'))(_0x7e95('0x8'));var config=require(_0x7e95('0x9'));var jayson=require(_0x7e95('0xa'));var client=jayson['client'][_0x7e95('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53e306,_0x49d28f,_0x5d7d49){return new BPromise(function(_0x21905d,_0x36ba85){return client[_0x7e95('0xc')](_0x53e306,_0x5d7d49)['then'](function(_0x210ba4){logger[_0x7e95('0xd')]('VoiceCallReport,\x20%s,\x20%s',_0x49d28f,'request\x20sent');logger[_0x7e95('0xe')](_0x7e95('0xf'),_0x49d28f,_0x7e95('0x10'),JSON['stringify'](_0x210ba4));if(_0x210ba4[_0x7e95('0x11')]){if(_0x210ba4[_0x7e95('0x11')][_0x7e95('0x12')]===0x1f4){logger[_0x7e95('0x11')](_0x7e95('0x13'),_0x49d28f,_0x210ba4[_0x7e95('0x11')]['message']);return _0x36ba85(_0x210ba4[_0x7e95('0x11')][_0x7e95('0x14')]);}logger[_0x7e95('0x11')](_0x7e95('0x13'),_0x49d28f,_0x210ba4[_0x7e95('0x11')][_0x7e95('0x14')]);return _0x21905d(_0x210ba4[_0x7e95('0x11')][_0x7e95('0x14')]);}else{logger[_0x7e95('0xd')](_0x7e95('0x13'),_0x49d28f,_0x7e95('0x10'));_0x21905d(_0x210ba4['result']['message']);}})['catch'](function(_0x21f885){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x49d28f,_0x21f885);_0x36ba85(_0x21f885);});});}exports[_0x7e95('0x15')]=function(_0x5d2581){var _0x3ad059=this;return new Promise(function(_0x286646,_0x554e86){return db[_0x7e95('0x16')][_0x7e95('0x17')]({'raw':_0x5d2581[_0x7e95('0x18')]?_0x5d2581[_0x7e95('0x18')][_0x7e95('0x19')]===undefined?!![]:![]:!![],'where':_0x5d2581[_0x7e95('0x18')]?_0x5d2581['options']['where']||null:null,'attributes':_0x5d2581[_0x7e95('0x18')]?_0x5d2581[_0x7e95('0x18')][_0x7e95('0x1a')]||null:null,'limit':_0x5d2581[_0x7e95('0x18')]?_0x5d2581[_0x7e95('0x18')]['limit']||null:null,'include':_0x5d2581[_0x7e95('0x18')]?_0x5d2581[_0x7e95('0x18')][_0x7e95('0x1b')]?_[_0x7e95('0x1c')](_0x5d2581[_0x7e95('0x18')]['include'],function(_0x89962c){return{'model':db[_0x89962c['model']],'as':_0x89962c['as'],'attributes':_0x89962c[_0x7e95('0x1a')],'include':_0x89962c[_0x7e95('0x1b')]?_[_0x7e95('0x1c')](_0x89962c[_0x7e95('0x1b')],function(_0x2a34cf){return{'model':db[_0x2a34cf[_0x7e95('0x1d')]],'as':_0x2a34cf['as'],'attributes':_0x2a34cf[_0x7e95('0x1a')],'include':_0x2a34cf[_0x7e95('0x1b')]?_[_0x7e95('0x1c')](_0x2a34cf[_0x7e95('0x1b')],function(_0x50caf6){return{'model':db[_0x50caf6[_0x7e95('0x1d')]],'as':_0x50caf6['as'],'attributes':_0x50caf6['attributes']};}):[]};}):[]};}):[]:[]})[_0x7e95('0x1e')](function(_0x33bed9){logger['info'](_0x7e95('0x15'),_0x5d2581);logger[_0x7e95('0xe')](_0x7e95('0x15'),_0x5d2581,JSON['stringify'](_0x33bed9));_0x286646(_0x33bed9);})['catch'](function(_0x454580){logger[_0x7e95('0x11')]('GetVoiceCallReport',_0x454580['message'],_0x5d2581);_0x554e86(_0x3ad059[_0x7e95('0x11')](0x1f4,_0x454580[_0x7e95('0x14')]));});});};exports['CreateVoiceCallReport']=function(_0x3a57a2){var _0x2d8721=this;return new Promise(function(_0x3a9552,_0x370e9a){return db[_0x7e95('0x16')][_0x7e95('0x1f')](_0x3a57a2[_0x7e95('0x20')],{'raw':_0x3a57a2[_0x7e95('0x18')]?_0x3a57a2[_0x7e95('0x18')][_0x7e95('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x2e2e09){logger[_0x7e95('0xd')](_0x7e95('0x21'),_0x3a57a2);logger[_0x7e95('0xe')](_0x7e95('0x21'),_0x3a57a2,JSON[_0x7e95('0x22')](_0x2e2e09));_0x3a9552(_0x2e2e09);})['catch'](function(_0x203de9){logger[_0x7e95('0x11')](_0x7e95('0x21'),_0x203de9[_0x7e95('0x14')],_0x3a57a2);_0x370e9a(_0x2d8721[_0x7e95('0x11')](0x1f4,_0x203de9[_0x7e95('0x14')]));});});};exports[_0x7e95('0x23')]=function(_0x15bc0d){var _0xbbee1a=this;return new Promise(function(_0x8a47b3,_0x206656){return db[_0x7e95('0x16')][_0x7e95('0x24')](_0x15bc0d[_0x7e95('0x20')],{'raw':_0x15bc0d[_0x7e95('0x18')]?_0x15bc0d[_0x7e95('0x18')][_0x7e95('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15bc0d['options']?_0x15bc0d[_0x7e95('0x18')][_0x7e95('0x25')]||null:null,'attributes':_0x15bc0d[_0x7e95('0x18')]?_0x15bc0d[_0x7e95('0x18')][_0x7e95('0x1a')]||null:null,'limit':_0x15bc0d[_0x7e95('0x18')]?_0x15bc0d[_0x7e95('0x18')][_0x7e95('0x26')]||null:null})[_0x7e95('0x1e')](function(_0x2f3e85){logger[_0x7e95('0xd')]('UpdateVoiceCallReport',_0x15bc0d);logger[_0x7e95('0xe')](_0x7e95('0x23'),_0x15bc0d,JSON[_0x7e95('0x22')](_0x2f3e85));_0x8a47b3(_0x2f3e85);})[_0x7e95('0x27')](function(_0x148157){logger[_0x7e95('0x11')](_0x7e95('0x23'),_0x148157['message'],_0x15bc0d);_0x206656(_0xbbee1a[_0x7e95('0x11')](0x1f4,_0x148157[_0x7e95('0x14')]));});});};
\ No newline at end of file
+var _0x04fc=['randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','request','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','VoiceCallReport','options','raw','where','attributes','include','map','model','catch','GetVoiceCallReport','CreateVoiceCallReport','body','UpdateVoiceCallReport','limit','lodash','util'];(function(_0x4958e4,_0x3119f7){var _0x14d031=function(_0x51fd79){while(--_0x51fd79){_0x4958e4['push'](_0x4958e4['shift']());}};_0x14d031(++_0x3119f7);}(_0x04fc,0x127));var _0xc04f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x04fc[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc04f('0x0'));var util=require(_0xc04f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc04f('0x2'));var fs=require('fs');var Redis=require(_0xc04f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc04f('0x4'))(_0xc04f('0x5'));var config=require(_0xc04f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc04f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a7d51,_0x2941e1,_0x12d16a){return new BPromise(function(_0x313410,_0x7762d8){return client[_0xc04f('0x8')](_0x3a7d51,_0x12d16a)[_0xc04f('0x9')](function(_0x5ec28f){logger['info'](_0xc04f('0xa'),_0x2941e1,_0xc04f('0xb'));logger[_0xc04f('0xc')](_0xc04f('0xd'),_0x2941e1,'request\x20sent',JSON[_0xc04f('0xe')](_0x5ec28f));if(_0x5ec28f['error']){if(_0x5ec28f[_0xc04f('0xf')][_0xc04f('0x10')]===0x1f4){logger[_0xc04f('0xf')](_0xc04f('0xa'),_0x2941e1,_0x5ec28f[_0xc04f('0xf')][_0xc04f('0x11')]);return _0x7762d8(_0x5ec28f[_0xc04f('0xf')][_0xc04f('0x11')]);}logger[_0xc04f('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x2941e1,_0x5ec28f[_0xc04f('0xf')]['message']);return _0x313410(_0x5ec28f[_0xc04f('0xf')][_0xc04f('0x11')]);}else{logger[_0xc04f('0x12')](_0xc04f('0xa'),_0x2941e1,_0xc04f('0xb'));_0x313410(_0x5ec28f['result'][_0xc04f('0x11')]);}})['catch'](function(_0x45e4d4){logger[_0xc04f('0xf')](_0xc04f('0xa'),_0x2941e1,_0x45e4d4);_0x7762d8(_0x45e4d4);});});}exports['GetVoiceCallReport']=function(_0x25235f){var _0x280548=this;return new Promise(function(_0x3d1c4a,_0x259c1b){return db[_0xc04f('0x13')]['findAll']({'raw':_0x25235f[_0xc04f('0x14')]?_0x25235f[_0xc04f('0x14')][_0xc04f('0x15')]===undefined?!![]:![]:!![],'where':_0x25235f['options']?_0x25235f[_0xc04f('0x14')][_0xc04f('0x16')]||null:null,'attributes':_0x25235f[_0xc04f('0x14')]?_0x25235f[_0xc04f('0x14')][_0xc04f('0x17')]||null:null,'limit':_0x25235f[_0xc04f('0x14')]?_0x25235f['options']['limit']||null:null,'include':_0x25235f[_0xc04f('0x14')]?_0x25235f[_0xc04f('0x14')][_0xc04f('0x18')]?_[_0xc04f('0x19')](_0x25235f[_0xc04f('0x14')]['include'],function(_0x3d8ba4){return{'model':db[_0x3d8ba4[_0xc04f('0x1a')]],'as':_0x3d8ba4['as'],'attributes':_0x3d8ba4[_0xc04f('0x17')],'include':_0x3d8ba4[_0xc04f('0x18')]?_['map'](_0x3d8ba4['include'],function(_0x3f4214){return{'model':db[_0x3f4214['model']],'as':_0x3f4214['as'],'attributes':_0x3f4214[_0xc04f('0x17')],'include':_0x3f4214[_0xc04f('0x18')]?_[_0xc04f('0x19')](_0x3f4214[_0xc04f('0x18')],function(_0x1ac70d){return{'model':db[_0x1ac70d['model']],'as':_0x1ac70d['as'],'attributes':_0x1ac70d[_0xc04f('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc04f('0x9')](function(_0x337fc7){logger[_0xc04f('0x12')]('GetVoiceCallReport',_0x25235f);logger[_0xc04f('0xc')]('GetVoiceCallReport',_0x25235f,JSON[_0xc04f('0xe')](_0x337fc7));_0x3d1c4a(_0x337fc7);})[_0xc04f('0x1b')](function(_0x51354f){logger[_0xc04f('0xf')](_0xc04f('0x1c'),_0x51354f[_0xc04f('0x11')],_0x25235f);_0x259c1b(_0x280548[_0xc04f('0xf')](0x1f4,_0x51354f[_0xc04f('0x11')]));});});};exports[_0xc04f('0x1d')]=function(_0x34c585){var _0x3f2460=this;return new Promise(function(_0x53da7e,_0x3ccbaa){return db[_0xc04f('0x13')]['create'](_0x34c585[_0xc04f('0x1e')],{'raw':_0x34c585[_0xc04f('0x14')]?_0x34c585[_0xc04f('0x14')][_0xc04f('0x15')]===undefined?!![]:![]:!![]})[_0xc04f('0x9')](function(_0x1afb27){logger[_0xc04f('0x12')](_0xc04f('0x1d'),_0x34c585);logger[_0xc04f('0xc')](_0xc04f('0x1d'),_0x34c585,JSON[_0xc04f('0xe')](_0x1afb27));_0x53da7e(_0x1afb27);})[_0xc04f('0x1b')](function(_0x42ab06){logger['error'](_0xc04f('0x1d'),_0x42ab06[_0xc04f('0x11')],_0x34c585);_0x3ccbaa(_0x3f2460['error'](0x1f4,_0x42ab06[_0xc04f('0x11')]));});});};exports[_0xc04f('0x1f')]=function(_0xbd14d4){var _0x1c6cf6=this;return new Promise(function(_0x29642b,_0x3a3ff3){return db[_0xc04f('0x13')]['update'](_0xbd14d4[_0xc04f('0x1e')],{'raw':_0xbd14d4[_0xc04f('0x14')]?_0xbd14d4[_0xc04f('0x14')][_0xc04f('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbd14d4[_0xc04f('0x14')]?_0xbd14d4[_0xc04f('0x14')][_0xc04f('0x16')]||null:null,'attributes':_0xbd14d4['options']?_0xbd14d4['options'][_0xc04f('0x17')]||null:null,'limit':_0xbd14d4[_0xc04f('0x14')]?_0xbd14d4[_0xc04f('0x14')][_0xc04f('0x20')]||null:null})[_0xc04f('0x9')](function(_0x4f612a){logger[_0xc04f('0x12')](_0xc04f('0x1f'),_0xbd14d4);logger['debug'](_0xc04f('0x1f'),_0xbd14d4,JSON['stringify'](_0x4f612a));_0x29642b(_0x4f612a);})[_0xc04f('0x1b')](function(_0x22c25c){logger[_0xc04f('0xf')](_0xc04f('0x1f'),_0x22c25c[_0xc04f('0x11')],_0xbd14d4);_0x3a3ff3(_0x1c6cf6[_0xc04f('0xf')](0x1f4,_0x22c25c[_0xc04f('0x11')]));});});};
\ No newline at end of file
index 68faa6f..590d8d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31b9=['./voiceChanSpy.controller','get','isAuthenticated','index','show','post','/:id','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x59514c,_0x2a8f92){var _0xa94316=function(_0x1c0fdf){while(--_0x1c0fdf){_0x59514c['push'](_0x59514c['shift']());}};_0xa94316(++_0x2a8f92);}(_0x31b9,0x1d2));var _0x931b=function(_0x13e623,_0x2daa29){_0x13e623=_0x13e623-0x0;var _0x2a78e6=_0x31b9[_0x13e623];return _0x2a78e6;};'use strict';var multer=require(_0x931b('0x0'));var util=require(_0x931b('0x1'));var path=require(_0x931b('0x2'));var timeout=require(_0x931b('0x3'));var express=require(_0x931b('0x4'));var router=express['Router']();var fs_extra=require(_0x931b('0x5'));var auth=require(_0x931b('0x6'));var interaction=require(_0x931b('0x7'));var config=require(_0x931b('0x8'));var controller=require(_0x931b('0x9'));router[_0x931b('0xa')]('/',auth[_0x931b('0xb')](),controller[_0x931b('0xc')]);router[_0x931b('0xa')]('/:id',auth[_0x931b('0xb')](),controller[_0x931b('0xd')]);router[_0x931b('0xe')]('/',auth[_0x931b('0xb')](),controller['create']);router['put'](_0x931b('0xf'),auth[_0x931b('0xb')](),controller[_0x931b('0x10')]);router[_0x931b('0x11')](_0x931b('0xf'),auth[_0x931b('0xb')](),controller['destroy']);module[_0x931b('0x12')]=router;
\ No newline at end of file
+var _0x2098=['create','put','/:id','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','index','show','post','isAuthenticated'];(function(_0x52e363,_0x48062a){var _0x3fc2b5=function(_0x1b0cf9){while(--_0x1b0cf9){_0x52e363['push'](_0x52e363['shift']());}};_0x3fc2b5(++_0x48062a);}(_0x2098,0x1be));var _0x8209=function(_0x130aa0,_0x33e55e){_0x130aa0=_0x130aa0-0x0;var _0x282a25=_0x2098[_0x130aa0];return _0x282a25;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8209('0x0'));var timeout=require(_0x8209('0x1'));var express=require(_0x8209('0x2'));var router=express[_0x8209('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8209('0x4'));var interaction=require(_0x8209('0x5'));var config=require(_0x8209('0x6'));var controller=require(_0x8209('0x7'));router[_0x8209('0x8')]('/',auth['isAuthenticated'](),controller[_0x8209('0x9')]);router[_0x8209('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x8209('0xa')]);router[_0x8209('0xb')]('/',auth[_0x8209('0xc')](),controller[_0x8209('0xd')]);router[_0x8209('0xe')](_0x8209('0xf'),auth[_0x8209('0xc')](),controller['update']);router['delete'](_0x8209('0xf'),auth['isAuthenticated'](),controller[_0x8209('0x10')]);module['exports']=router;
\ No newline at end of file
index e14871d..ea42250 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc81e=['split','BOOLEAN','exports','STRING','name','setDataValue','options','getDataValue'];(function(_0x4e7bd6,_0x4f8bdd){var _0x431fbb=function(_0x1cef7b){while(--_0x1cef7b){_0x4e7bd6['push'](_0x4e7bd6['shift']());}};_0x431fbb(++_0x4f8bdd);}(_0xc81e,0xea));var _0xec81=function(_0x2c0dc0,_0x19900d){_0x2c0dc0=_0x2c0dc0-0x0;var _0x4c0990=_0xc81e[_0x2c0dc0];return _0x4c0990;};'use strict';var Sequelize=require('sequelize');module[_0xec81('0x0')]={'name':{'type':Sequelize[_0xec81('0x1')]},'prefix':{'type':Sequelize[_0xec81('0x1')],'unique':_0xec81('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0xec81('0x1')],'set':function(_0x8f4e44){this[_0xec81('0x3')](_0xec81('0x4'),_0x8f4e44?_0x8f4e44['join'](''):[]);},'get':function(){return this['getDataValue'](_0xec81('0x4'))?this[_0xec81('0x5')](_0xec81('0x4'))[_0xec81('0x6')](''):[];}},'auth':{'type':Sequelize[_0xec81('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0xec81('0x1')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xec81('0x1')]}};
\ No newline at end of file
+var _0x9a99=['options','join','getDataValue','split','BOOLEAN','exports','STRING','setDataValue'];(function(_0x253d11,_0x48c682){var _0x1cf554=function(_0x5f2b42){while(--_0x5f2b42){_0x253d11['push'](_0x253d11['shift']());}};_0x1cf554(++_0x48c682);}(_0x9a99,0xf5));var _0x99a9=function(_0x20e9e7,_0x2cbc13){_0x20e9e7=_0x20e9e7-0x0;var _0x183679=_0x9a99[_0x20e9e7];return _0x183679;};'use strict';var Sequelize=require('sequelize');module[_0x99a9('0x0')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x99a9('0x1')],'unique':'name','allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x10e00c){this[_0x99a9('0x2')](_0x99a9('0x3'),_0x10e00c?_0x10e00c[_0x99a9('0x4')](''):[]);},'get':function(){return this[_0x99a9('0x5')](_0x99a9('0x3'))?this[_0x99a9('0x5')](_0x99a9('0x3'))[_0x99a9('0x6')](''):[];}},'auth':{'type':Sequelize[_0x99a9('0x7')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x99a9('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x99a9('0x1')]},'description':{'type':Sequelize[_0x99a9('0x1')]}};
\ No newline at end of file
index 8591d05..bb50624 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f49=['stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','VoiceChanSpy','count','includeAll','include','findAll','show','params','rawAttributes','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','update','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','offset','undefined','status','Content-Range','apply','destroy','get','ChanSpies','UserProfileResource','then','end','error'];(function(_0x2393fc,_0x3c390f){var _0x4424e3=function(_0x4b9f70){while(--_0x4b9f70){_0x2393fc['push'](_0x2393fc['shift']());}};_0x4424e3(++_0x3c390f);}(_0x3f49,0x11f));var _0x93f4=function(_0x388f4b,_0x1907f9){_0x388f4b=_0x388f4b-0x0;var _0x5548e2=_0x3f49[_0x388f4b];return _0x5548e2;};'use strict';var emlformat=require(_0x93f4('0x0'));var rimraf=require(_0x93f4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x93f4('0x2'));var rp=require(_0x93f4('0x3'));var moment=require(_0x93f4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x93f4('0x5'));var util=require(_0x93f4('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x93f4('0x7'));var ejs=require(_0x93f4('0x8'));var fs=require('fs');var fs_extra=require(_0x93f4('0x9'));var _=require('lodash');var squel=require(_0x93f4('0xa'));var crypto=require('crypto');var jsforce=require(_0x93f4('0xb'));var deskjs=require(_0x93f4('0xc'));var toCsv=require(_0x93f4('0x7'));var querystring=require(_0x93f4('0xd'));var Papa=require(_0x93f4('0xe'));var Redis=require(_0x93f4('0xf'));var authService=require(_0x93f4('0x10'));var qs=require(_0x93f4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x93f4('0x12'))(_0x93f4('0x13'));var utils=require(_0x93f4('0x14'));var config=require(_0x93f4('0x15'));var licenseUtil=require(_0x93f4('0x16'));var db=require(_0x93f4('0x17'))['db'];function respondWithStatusCode(_0x3109b7,_0x1d2edb){_0x1d2edb=_0x1d2edb||0xcc;return function(_0x54e7c6){if(_0x54e7c6){return _0x3109b7[_0x93f4('0x18')](_0x1d2edb);}return _0x3109b7['status'](_0x1d2edb)['end']();};}function respondWithResult(_0x86a454,_0x1d63ef){_0x1d63ef=_0x1d63ef||0xc8;return function(_0x1f8832){if(_0x1f8832){return _0x86a454['status'](_0x1d63ef)['json'](_0x1f8832);}};}function respondWithFilteredResult(_0x356da0,_0x40f50a){return function(_0x3fdf23){if(_0x3fdf23){var _0x5e4e32=typeof _0x40f50a[_0x93f4('0x19')]===_0x93f4('0x1a')&&typeof _0x40f50a['limit']===_0x93f4('0x1a');var _0x4d5a48=_0x3fdf23['count'];var _0x1d4773=_0x5e4e32?0x0:_0x40f50a['offset'];var _0x38d8b6=_0x5e4e32?_0x3fdf23['count']:_0x40f50a['offset']+_0x40f50a['limit'];var _0x1daa01;if(_0x38d8b6>=_0x4d5a48){_0x38d8b6=_0x4d5a48;_0x1daa01=0xc8;}else{_0x1daa01=0xce;}_0x356da0[_0x93f4('0x1b')](_0x1daa01);return _0x356da0['set'](_0x93f4('0x1c'),_0x1d4773+'-'+_0x38d8b6+'/'+_0x4d5a48)['json'](_0x3fdf23);}return null;};}function patchUpdates(_0x3ead08){return function(_0x3182d6){try{jsonpatch[_0x93f4('0x1d')](_0x3182d6,_0x3ead08,!![]);}catch(_0xde41e6){return BPromise['reject'](_0xde41e6);}return _0x3182d6['save']();};}function saveUpdates(_0x16f885,_0x432f99){return function(_0x5b0de8){if(_0x5b0de8){return _0x5b0de8['update'](_0x16f885)['then'](function(_0x145e90){return _0x145e90;});}return null;};}function removeEntity(_0x3301b5,_0x475f0b){return function(_0x4c87e3){if(_0x4c87e3){return _0x4c87e3[_0x93f4('0x1e')]()['then'](function(){var _0x20e337=_0x4c87e3[_0x93f4('0x1f')]({'plain':!![]});var _0x5afabf=_0x93f4('0x20');return db[_0x93f4('0x21')][_0x93f4('0x1e')]({'where':{'type':_0x5afabf,'resourceId':_0x20e337['id']}})[_0x93f4('0x22')](function(){return _0x4c87e3;});})['then'](function(){_0x3301b5[_0x93f4('0x1b')](0xcc)[_0x93f4('0x23')]();});}};}function handleEntityNotFound(_0x2fa1b1,_0x353ab7){return function(_0x590d52){if(!_0x590d52){_0x2fa1b1[_0x93f4('0x18')](0x194);}return _0x590d52;};}function handleError(_0x9aba61,_0x30606b){_0x30606b=_0x30606b||0x1f4;return function(_0x7f57d6){logger[_0x93f4('0x24')](_0x7f57d6[_0x93f4('0x25')]);if(_0x7f57d6[_0x93f4('0x26')]){delete _0x7f57d6[_0x93f4('0x26')];}_0x9aba61['status'](_0x30606b)[_0x93f4('0x27')](_0x7f57d6);};}exports[_0x93f4('0x28')]=function(_0x5268ba,_0x52fe96){var _0xd27b64={},_0x551bf9={},_0x40ae22={'count':0x0,'rows':[]};var _0x5c1c6f=_[_0x93f4('0x29')](db['VoiceChanSpy']['rawAttributes'],function(_0x277267){return{'name':_0x277267[_0x93f4('0x2a')],'type':_0x277267[_0x93f4('0x2b')]['key']};});_0x551bf9[_0x93f4('0x2c')]=_[_0x93f4('0x29')](_0x5c1c6f,_0x93f4('0x26'));_0x551bf9[_0x93f4('0x2d')]=_[_0x93f4('0x2e')](_0x5268ba[_0x93f4('0x2d')]);_0x551bf9[_0x93f4('0x2f')]=_[_0x93f4('0x30')](_0x551bf9['model'],_0x551bf9[_0x93f4('0x2d')]);_0xd27b64[_0x93f4('0x31')]=_['intersection'](_0x551bf9[_0x93f4('0x2c')],qs[_0x93f4('0x32')](_0x5268ba['query']['fields']));_0xd27b64[_0x93f4('0x31')]=_0xd27b64[_0x93f4('0x31')][_0x93f4('0x33')]?_0xd27b64[_0x93f4('0x31')]:_0x551bf9[_0x93f4('0x2c')];if(!_0x5268ba[_0x93f4('0x2d')][_0x93f4('0x34')](_0x93f4('0x35'))){_0xd27b64[_0x93f4('0x36')]=qs[_0x93f4('0x36')](_0x5268ba[_0x93f4('0x2d')][_0x93f4('0x36')]);_0xd27b64[_0x93f4('0x19')]=qs[_0x93f4('0x19')](_0x5268ba[_0x93f4('0x2d')][_0x93f4('0x19')]);}_0xd27b64[_0x93f4('0x37')]=qs[_0x93f4('0x38')](_0x5268ba['query'][_0x93f4('0x38')]);_0xd27b64['where']=qs[_0x93f4('0x2f')](_[_0x93f4('0x39')](_0x5268ba[_0x93f4('0x2d')],_0x551bf9[_0x93f4('0x2f')]),_0x5c1c6f);if(_0x5268ba[_0x93f4('0x2d')][_0x93f4('0x3a')]){_0xd27b64[_0x93f4('0x3b')]=_[_0x93f4('0x3c')](_0xd27b64[_0x93f4('0x3b')],{'$or':_[_0x93f4('0x29')](_0x5c1c6f,function(_0x20b814){if(_0x20b814[_0x93f4('0x2b')]!==_0x93f4('0x3d')){var _0x36482e={};_0x36482e[_0x20b814[_0x93f4('0x26')]]={'$like':'%'+_0x5268ba['query']['filter']+'%'};return _0x36482e;}})});}_0xd27b64=_['merge']({},_0xd27b64,_0x5268ba[_0x93f4('0x3e')]);var _0x435ecf={'where':_0xd27b64[_0x93f4('0x3b')]};return db[_0x93f4('0x3f')]['count'](_0x435ecf)[_0x93f4('0x22')](function(_0x130227){_0x40ae22[_0x93f4('0x40')]=_0x130227;if(_0x5268ba[_0x93f4('0x2d')][_0x93f4('0x41')]){_0xd27b64[_0x93f4('0x42')]=[{'all':!![]}];}return db[_0x93f4('0x3f')][_0x93f4('0x43')](_0xd27b64);})[_0x93f4('0x22')](function(_0x26ef4b){_0x40ae22['rows']=_0x26ef4b;return _0x40ae22;})[_0x93f4('0x22')](respondWithFilteredResult(_0x52fe96,_0xd27b64))['catch'](handleError(_0x52fe96,null));};exports[_0x93f4('0x44')]=function(_0x1135ca,_0x4009f6){var _0x5555b4={'raw':![],'where':{'id':_0x1135ca[_0x93f4('0x45')]['id']}},_0x2c05ee={};_0x2c05ee[_0x93f4('0x2c')]=_[_0x93f4('0x2e')](db['VoiceChanSpy'][_0x93f4('0x46')]);_0x2c05ee[_0x93f4('0x2d')]=_[_0x93f4('0x2e')](_0x1135ca['query']);_0x2c05ee[_0x93f4('0x2f')]=_[_0x93f4('0x30')](_0x2c05ee[_0x93f4('0x2c')],_0x2c05ee[_0x93f4('0x2d')]);_0x5555b4[_0x93f4('0x31')]=_[_0x93f4('0x30')](_0x2c05ee[_0x93f4('0x2c')],qs[_0x93f4('0x32')](_0x1135ca[_0x93f4('0x2d')][_0x93f4('0x32')]));_0x5555b4[_0x93f4('0x31')]=_0x5555b4[_0x93f4('0x31')][_0x93f4('0x33')]?_0x5555b4[_0x93f4('0x31')]:_0x2c05ee[_0x93f4('0x2c')];if(_0x1135ca['query'][_0x93f4('0x41')]){_0x5555b4[_0x93f4('0x42')]=[{'all':!![]}];}_0x5555b4=_[_0x93f4('0x3c')]({},_0x5555b4,_0x1135ca[_0x93f4('0x3e')]);return db[_0x93f4('0x3f')][_0x93f4('0x47')](_0x5555b4)['then'](handleEntityNotFound(_0x4009f6,null))[_0x93f4('0x22')](respondWithResult(_0x4009f6,null))[_0x93f4('0x48')](handleError(_0x4009f6,null));};exports['create']=function(_0x171439,_0x2c8a13){return db[_0x93f4('0x3f')][_0x93f4('0x49')](_0x171439['body'],{})[_0x93f4('0x22')](function(_0x3f8c47){var _0x467e5b=_0x171439['user'][_0x93f4('0x1f')]({'plain':!![]});if(!_0x467e5b)throw new Error(_0x93f4('0x4a'));if(_0x467e5b[_0x93f4('0x4b')]===_0x93f4('0x4c')){var _0x501808=_0x3f8c47['get']({'plain':!![]});var _0x108487=_0x93f4('0x20');return db[_0x93f4('0x4d')][_0x93f4('0x47')]({'where':{'name':_0x108487,'userProfileId':_0x467e5b[_0x93f4('0x4e')]},'raw':!![]})[_0x93f4('0x22')](function(_0x340f19){if(_0x340f19&&_0x340f19['autoAssociation']===0x0){return db[_0x93f4('0x21')][_0x93f4('0x49')]({'name':_0x501808[_0x93f4('0x26')],'resourceId':_0x501808['id'],'type':_0x340f19[_0x93f4('0x26')],'sectionId':_0x340f19['id']},{})[_0x93f4('0x22')](function(){return _0x3f8c47;});}else{return _0x3f8c47;}})[_0x93f4('0x48')](function(_0x203607){logger[_0x93f4('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x203607);throw _0x203607;});}return _0x3f8c47;})['then'](respondWithResult(_0x2c8a13,0xc9))['catch'](handleError(_0x2c8a13,null));};exports[_0x93f4('0x4f')]=function(_0x1d8c1,_0x350771){if(_0x1d8c1[_0x93f4('0x50')]['id']){delete _0x1d8c1['body']['id'];}return db[_0x93f4('0x3f')][_0x93f4('0x47')]({'where':{'id':_0x1d8c1[_0x93f4('0x45')]['id']}})[_0x93f4('0x22')](handleEntityNotFound(_0x350771,null))[_0x93f4('0x22')](saveUpdates(_0x1d8c1['body'],null))[_0x93f4('0x22')](respondWithResult(_0x350771,null))[_0x93f4('0x48')](handleError(_0x350771,null));};exports[_0x93f4('0x1e')]=function(_0x502f9c,_0x58fe66){return db[_0x93f4('0x3f')]['find']({'where':{'id':_0x502f9c[_0x93f4('0x45')]['id']}})[_0x93f4('0x22')](handleEntityNotFound(_0x58fe66,null))[_0x93f4('0x22')](removeEntity(_0x58fe66,null))[_0x93f4('0x48')](handleError(_0x58fe66,null));};
\ No newline at end of file
+var _0x4ded=['name','index','map','VoiceChanSpy','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','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','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','error'];(function(_0x32cf96,_0x7502d5){var _0x125cc1=function(_0x376987){while(--_0x376987){_0x32cf96['push'](_0x32cf96['shift']());}};_0x125cc1(++_0x7502d5);}(_0x4ded,0x116));var _0xd4de=function(_0x456588,_0x49cfef){_0x456588=_0x456588-0x0;var _0x587056=_0x4ded[_0x456588];return _0x587056;};'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'];function respondWithStatusCode(_0x104dad,_0x2aa09d){_0x2aa09d=_0x2aa09d||0xcc;return function(_0x3ffc72){if(_0x3ffc72){return _0x104dad[_0xd4de('0x18')](_0x2aa09d);}return _0x104dad[_0xd4de('0x19')](_0x2aa09d)[_0xd4de('0x1a')]();};}function respondWithResult(_0x3e3735,_0x37cb9f){_0x37cb9f=_0x37cb9f||0xc8;return function(_0x691ba9){if(_0x691ba9){return _0x3e3735[_0xd4de('0x19')](_0x37cb9f)[_0xd4de('0x1b')](_0x691ba9);}};}function respondWithFilteredResult(_0xbb4f7e,_0x102e5b){return function(_0xa7c18b){if(_0xa7c18b){var _0x325fba=typeof _0x102e5b['offset']==='undefined'&&typeof _0x102e5b[_0xd4de('0x1c')]===_0xd4de('0x1d');var _0x17b377=_0xa7c18b[_0xd4de('0x1e')];var _0x5b1d1c=_0x325fba?0x0:_0x102e5b['offset'];var _0x1e91d5=_0x325fba?_0xa7c18b['count']:_0x102e5b[_0xd4de('0x1f')]+_0x102e5b[_0xd4de('0x1c')];var _0x50b9e3;if(_0x1e91d5>=_0x17b377){_0x1e91d5=_0x17b377;_0x50b9e3=0xc8;}else{_0x50b9e3=0xce;}_0xbb4f7e[_0xd4de('0x19')](_0x50b9e3);return _0xbb4f7e['set'](_0xd4de('0x20'),_0x5b1d1c+'-'+_0x1e91d5+'/'+_0x17b377)[_0xd4de('0x1b')](_0xa7c18b);}return null;};}function patchUpdates(_0x2bad14){return function(_0x8e8712){try{jsonpatch['apply'](_0x8e8712,_0x2bad14,!![]);}catch(_0x318658){return BPromise[_0xd4de('0x21')](_0x318658);}return _0x8e8712[_0xd4de('0x22')]();};}function saveUpdates(_0xdb3fc,_0x1c631a){return function(_0x2d092a){if(_0x2d092a){return _0x2d092a[_0xd4de('0x23')](_0xdb3fc)[_0xd4de('0x24')](function(_0x2f9de6){return _0x2f9de6;});}return null;};}function removeEntity(_0x413f68,_0x534b37){return function(_0xad333f){if(_0xad333f){return _0xad333f[_0xd4de('0x25')]()[_0xd4de('0x24')](function(){var _0x22970c=_0xad333f[_0xd4de('0x26')]({'plain':!![]});var _0x984904=_0xd4de('0x27');return db[_0xd4de('0x28')][_0xd4de('0x25')]({'where':{'type':_0x984904,'resourceId':_0x22970c['id']}})[_0xd4de('0x24')](function(){return _0xad333f;});})[_0xd4de('0x24')](function(){_0x413f68[_0xd4de('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe64e4e,_0x35e2fc){return function(_0x5005b0){if(!_0x5005b0){_0xe64e4e[_0xd4de('0x18')](0x194);}return _0x5005b0;};}function handleError(_0x59b3c5,_0x44b710){_0x44b710=_0x44b710||0x1f4;return function(_0x32e407){logger[_0xd4de('0x29')](_0x32e407['stack']);if(_0x32e407[_0xd4de('0x2a')]){delete _0x32e407[_0xd4de('0x2a')];}_0x59b3c5[_0xd4de('0x19')](_0x44b710)['send'](_0x32e407);};}exports[_0xd4de('0x2b')]=function(_0x1804c7,_0x55f9f9){var _0x5103b5={},_0x5706fe={},_0x3f6491={'count':0x0,'rows':[]};var _0x496795=_[_0xd4de('0x2c')](db[_0xd4de('0x2d')][_0xd4de('0x2e')],function(_0x2e08eb){return{'name':_0x2e08eb['fieldName'],'type':_0x2e08eb[_0xd4de('0x2f')][_0xd4de('0x30')]};});_0x5706fe['model']=_[_0xd4de('0x2c')](_0x496795,_0xd4de('0x2a'));_0x5706fe['query']=_['keys'](_0x1804c7[_0xd4de('0x31')]);_0x5706fe[_0xd4de('0x32')]=_[_0xd4de('0x33')](_0x5706fe[_0xd4de('0x34')],_0x5706fe['query']);_0x5103b5[_0xd4de('0x35')]=_[_0xd4de('0x33')](_0x5706fe['model'],qs[_0xd4de('0x36')](_0x1804c7[_0xd4de('0x31')][_0xd4de('0x36')]));_0x5103b5[_0xd4de('0x35')]=_0x5103b5[_0xd4de('0x35')][_0xd4de('0x37')]?_0x5103b5['attributes']:_0x5706fe['model'];if(!_0x1804c7[_0xd4de('0x31')][_0xd4de('0x38')](_0xd4de('0x39'))){_0x5103b5['limit']=qs[_0xd4de('0x1c')](_0x1804c7[_0xd4de('0x31')]['limit']);_0x5103b5[_0xd4de('0x1f')]=qs[_0xd4de('0x1f')](_0x1804c7[_0xd4de('0x31')][_0xd4de('0x1f')]);}_0x5103b5['order']=qs['sort'](_0x1804c7[_0xd4de('0x31')]['sort']);_0x5103b5[_0xd4de('0x3a')]=qs['filters'](_[_0xd4de('0x3b')](_0x1804c7[_0xd4de('0x31')],_0x5706fe[_0xd4de('0x32')]),_0x496795);if(_0x1804c7[_0xd4de('0x31')]['filter']){_0x5103b5[_0xd4de('0x3a')]=_['merge'](_0x5103b5[_0xd4de('0x3a')],{'$or':_[_0xd4de('0x2c')](_0x496795,function(_0x7f17b9){if(_0x7f17b9[_0xd4de('0x2f')]!==_0xd4de('0x3c')){var _0x13c256={};_0x13c256[_0x7f17b9[_0xd4de('0x2a')]]={'$like':'%'+_0x1804c7['query'][_0xd4de('0x3d')]+'%'};return _0x13c256;}})});}_0x5103b5=_[_0xd4de('0x3e')]({},_0x5103b5,_0x1804c7[_0xd4de('0x3f')]);var _0x2ec1fa={'where':_0x5103b5[_0xd4de('0x3a')]};return db['VoiceChanSpy'][_0xd4de('0x1e')](_0x2ec1fa)[_0xd4de('0x24')](function(_0x2294e2){_0x3f6491['count']=_0x2294e2;if(_0x1804c7[_0xd4de('0x31')][_0xd4de('0x40')]){_0x5103b5[_0xd4de('0x41')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0xd4de('0x42')](_0x5103b5);})[_0xd4de('0x24')](function(_0x419c49){_0x3f6491[_0xd4de('0x43')]=_0x419c49;return _0x3f6491;})[_0xd4de('0x24')](respondWithFilteredResult(_0x55f9f9,_0x5103b5))[_0xd4de('0x44')](handleError(_0x55f9f9,null));};exports[_0xd4de('0x45')]=function(_0x5ecbbd,_0x43b542){var _0x164bde={'raw':![],'where':{'id':_0x5ecbbd['params']['id']}},_0x58082a={};_0x58082a[_0xd4de('0x34')]=_[_0xd4de('0x46')](db[_0xd4de('0x2d')]['rawAttributes']);_0x58082a['query']=_[_0xd4de('0x46')](_0x5ecbbd[_0xd4de('0x31')]);_0x58082a['filters']=_[_0xd4de('0x33')](_0x58082a[_0xd4de('0x34')],_0x58082a[_0xd4de('0x31')]);_0x164bde[_0xd4de('0x35')]=_['intersection'](_0x58082a[_0xd4de('0x34')],qs[_0xd4de('0x36')](_0x5ecbbd[_0xd4de('0x31')][_0xd4de('0x36')]));_0x164bde[_0xd4de('0x35')]=_0x164bde[_0xd4de('0x35')]['length']?_0x164bde[_0xd4de('0x35')]:_0x58082a[_0xd4de('0x34')];if(_0x5ecbbd[_0xd4de('0x31')][_0xd4de('0x40')]){_0x164bde[_0xd4de('0x41')]=[{'all':!![]}];}_0x164bde=_[_0xd4de('0x3e')]({},_0x164bde,_0x5ecbbd[_0xd4de('0x3f')]);return db[_0xd4de('0x2d')][_0xd4de('0x47')](_0x164bde)[_0xd4de('0x24')](handleEntityNotFound(_0x43b542,null))['then'](respondWithResult(_0x43b542,null))[_0xd4de('0x44')](handleError(_0x43b542,null));};exports[_0xd4de('0x48')]=function(_0x178daf,_0x518bfe){return db[_0xd4de('0x2d')][_0xd4de('0x48')](_0x178daf[_0xd4de('0x49')],{})[_0xd4de('0x24')](function(_0x42e58e){var _0xa24bb7=_0x178daf[_0xd4de('0x4a')][_0xd4de('0x26')]({'plain':!![]});if(!_0xa24bb7)throw new Error(_0xd4de('0x4b'));if(_0xa24bb7[_0xd4de('0x4c')]==='user'){var _0x3e4c7f=_0x42e58e[_0xd4de('0x26')]({'plain':!![]});var _0x215f85=_0xd4de('0x27');return db[_0xd4de('0x4d')]['find']({'where':{'name':_0x215f85,'userProfileId':_0xa24bb7['userProfileId']},'raw':!![]})[_0xd4de('0x24')](function(_0x2deedb){if(_0x2deedb&&_0x2deedb['autoAssociation']===0x0){return db['UserProfileResource'][_0xd4de('0x48')]({'name':_0x3e4c7f[_0xd4de('0x2a')],'resourceId':_0x3e4c7f['id'],'type':_0x2deedb[_0xd4de('0x2a')],'sectionId':_0x2deedb['id']},{})[_0xd4de('0x24')](function(){return _0x42e58e;});}else{return _0x42e58e;}})[_0xd4de('0x44')](function(_0x15c8cd){logger[_0xd4de('0x29')](_0xd4de('0x4e'),_0x15c8cd);throw _0x15c8cd;});}return _0x42e58e;})[_0xd4de('0x24')](respondWithResult(_0x518bfe,0xc9))[_0xd4de('0x44')](handleError(_0x518bfe,null));};exports[_0xd4de('0x23')]=function(_0x2e1780,_0x56c13e){if(_0x2e1780[_0xd4de('0x49')]['id']){delete _0x2e1780[_0xd4de('0x49')]['id'];}return db[_0xd4de('0x2d')][_0xd4de('0x47')]({'where':{'id':_0x2e1780[_0xd4de('0x4f')]['id']}})[_0xd4de('0x24')](handleEntityNotFound(_0x56c13e,null))['then'](saveUpdates(_0x2e1780[_0xd4de('0x49')],null))['then'](respondWithResult(_0x56c13e,null))['catch'](handleError(_0x56c13e,null));};exports[_0xd4de('0x25')]=function(_0xd79781,_0x2d1e45){return db[_0xd4de('0x2d')]['find']({'where':{'id':_0xd79781[_0xd4de('0x4f')]['id']}})[_0xd4de('0x24')](handleEntityNotFound(_0x2d1e45,null))[_0xd4de('0x24')](removeEntity(_0x2d1e45,null))[_0xd4de('0x44')](handleError(_0x2d1e45,null));};
\ No newline at end of file
index 03d57f9..63d9667 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c2f=['length','concat','internal','findAll','agent','then','models','define','VoiceChanSpy','voice_chanspy','bulkCreate','VoiceExtension','destroy','catch','lodash','util','bluebird','./voiceChanSpy.attributes','context','format','%s%s','system','push','Set','CDR(type)=%s','record','${UNIQUEID}.%s,a','recordingFormat','auth','merge','Authenticate','password','name','options','join','StopMixMonitor'];(function(_0x39d819,_0x2842c0){var _0x2f47a3=function(_0x527490){while(--_0x527490){_0x39d819['push'](_0x39d819['shift']());}};_0x2f47a3(++_0x2842c0);}(_0x8c2f,0x176));var _0xf8c2=function(_0x4baae3,_0x5f0235){_0x4baae3=_0x4baae3-0x0;var _0x454819=_0x8c2f[_0x4baae3];return _0x454819;};'use strict';var _=require(_0xf8c2('0x0'));var util=require(_0xf8c2('0x1'));var BPromise=require(_0xf8c2('0x2'));var attributes=require(_0xf8c2('0x3'));var getUserApplications=function(_0x3eaa5c,_0x393bbf,_0x5e4d9b){var _0x2e46d7=0x1;var _0x49487f=[];var _0x595364={'context':_0x393bbf[_0xf8c2('0x4')]||'from-sip','exten':util[_0xf8c2('0x5')](_0xf8c2('0x6'),_0x3eaa5c['prefix'],_0x5e4d9b),'type':_0xf8c2('0x7'),'isApp':![],'ChanSpyId':_0x3eaa5c['id'],'UserId':_0x393bbf['id']};_0x49487f[_0xf8c2('0x8')](_['merge']({'app':_0xf8c2('0x9'),'appdata':util[_0xf8c2('0x5')](_0xf8c2('0xa'),'chanspy'),'priority':_0x2e46d7++},_0x595364));if(_0x3eaa5c[_0xf8c2('0xb')]){_0x49487f['push'](_['merge']({'app':'MixMonitor','appdata':util[_0xf8c2('0x5')](_0xf8c2('0xc'),_0x3eaa5c[_0xf8c2('0xd')]),'priority':_0x2e46d7++},_0x595364));}if(_0x3eaa5c[_0xf8c2('0xe')]){_0x49487f[_0xf8c2('0x8')](_[_0xf8c2('0xf')]({'app':_0xf8c2('0x10'),'appdata':_0x3eaa5c[_0xf8c2('0x11')],'priority':_0x2e46d7++},_0x595364));}_0x49487f['push'](_[_0xf8c2('0xf')]({'app':'ChanSpy','appdata':util[_0xf8c2('0x5')]('SIP/%s,%s',_0x393bbf[_0xf8c2('0x12')],_0x3eaa5c[_0xf8c2('0x13')]?_0x3eaa5c[_0xf8c2('0x13')][_0xf8c2('0x14')](''):''),'priority':_0x2e46d7++},_0x595364));if(_0x3eaa5c['record']){_0x49487f[_0xf8c2('0x8')](_[_0xf8c2('0xf')]({'app':_0xf8c2('0x15'),'priority':_0x2e46d7++},_0x595364));}return _0x49487f;};var getChanSpyApplications=function(_0x237fc6,_0x5621fb){var _0x20a737=[];for(var _0x4282b7=0x0,_0x4c6bde=0x1;_0x4282b7<_0x5621fb[_0xf8c2('0x16')];_0x4282b7++,_0x4c6bde=0x1){_0x20a737=_0x20a737[_0xf8c2('0x17')](getUserApplications(_0x237fc6,_0x5621fb[_0x4282b7],_0x5621fb[_0x4282b7][_0xf8c2('0x18')]));if(_0x5621fb[_0x4282b7][_0xf8c2('0x18')]!=_0x5621fb[_0x4282b7][_0xf8c2('0x12')]){_0x20a737=_0x20a737[_0xf8c2('0x17')](getUserApplications(_0x237fc6,_0x5621fb[_0x4282b7],_0x5621fb[_0x4282b7][_0xf8c2('0x12')]));}}return _0x20a737;};var getChanSpyPromise=function(_0x1c97ae,_0x3616b5){return new BPromise(function(_0xbcd6ce,_0x4c1372){return _0x1c97ae['User'][_0xf8c2('0x19')]({'attributes':['id',_0xf8c2('0x12'),_0xf8c2('0x18')],'where':{'role':_0xf8c2('0x1a'),'chanspy':!![]},'raw':!![]})[_0xf8c2('0x1b')](function(_0x18ef5c){if(_0x18ef5c){return _0xbcd6ce(getChanSpyApplications(_0x3616b5,_0x18ef5c));}return _0xbcd6ce([]);})['catch'](function(_0x46d75a){_0x4c1372(_0x46d75a);});});};module['exports']=function(_0x2432e7,_0x37ed79){var _0x9b5b15=_0x2432e7[_0xf8c2('0x1c')];return _0x2432e7[_0xf8c2('0x1d')](_0xf8c2('0x1e'),attributes,{'tableName':_0xf8c2('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2561f0,_0x89cee7,_0xb54c48){return getChanSpyPromise(_0x9b5b15,_0x2561f0)[_0xf8c2('0x1b')](function(_0x66771){if(_0x66771&&_0x66771[_0xf8c2('0x16')]){return _0x9b5b15['VoiceExtension'][_0xf8c2('0x20')](_0x66771);}})[_0xf8c2('0x1b')](function(){_0xb54c48();})['catch'](function(_0x2e744d){_0xb54c48(_0x2e744d);});},'afterUpdate':function(_0x21fe60,_0x14257b,_0x3c82f2){return _0x9b5b15[_0xf8c2('0x21')][_0xf8c2('0x22')]({'where':{'ChanSpyId':_0x21fe60['id']}})[_0xf8c2('0x1b')](function(){return getChanSpyPromise(_0x9b5b15,_0x21fe60);})[_0xf8c2('0x1b')](function(_0x20372e){if(_0x20372e&&_0x20372e[_0xf8c2('0x16')]){return _0x9b5b15[_0xf8c2('0x21')][_0xf8c2('0x20')](_0x20372e);}})[_0xf8c2('0x1b')](function(){_0x3c82f2();})[_0xf8c2('0x23')](function(_0x78e47c){_0x3c82f2(_0x78e47c);});},'afterDestroy':function(_0x18fcab,_0x1955e2,_0x14a8b6){return _0x9b5b15[_0xf8c2('0x21')][_0xf8c2('0x22')]({'where':{'ChanSpyId':_0x18fcab['id']}})[_0xf8c2('0x1b')](function(){_0x14a8b6();})['catch'](function(_0x2a9a87){_0x14a8b6(_0x2a9a87);});}}});};
\ No newline at end of file
+var _0x5e15=['lodash','util','bluebird','./voiceChanSpy.attributes','context','prefix','system','push','merge','format','CDR(type)=%s','chanspy','record','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','concat','internal','findAll','agent','then','catch','exports','define','voice_chanspy','length','VoiceExtension','bulkCreate','destroy'];(function(_0x5957f2,_0x193f34){var _0x1ea23a=function(_0x522709){while(--_0x522709){_0x5957f2['push'](_0x5957f2['shift']());}};_0x1ea23a(++_0x193f34);}(_0x5e15,0x103));var _0x55e1=function(_0x3f17b7,_0x1e5b9a){_0x3f17b7=_0x3f17b7-0x0;var _0x31dded=_0x5e15[_0x3f17b7];return _0x31dded;};'use strict';var _=require(_0x55e1('0x0'));var util=require(_0x55e1('0x1'));var BPromise=require(_0x55e1('0x2'));var attributes=require(_0x55e1('0x3'));var getUserApplications=function(_0x3d2b3b,_0x4d9839,_0x53cdcc){var _0x548a79=0x1;var _0x38dd0c=[];var _0x109113={'context':_0x4d9839[_0x55e1('0x4')]||'from-sip','exten':util['format']('%s%s',_0x3d2b3b[_0x55e1('0x5')],_0x53cdcc),'type':_0x55e1('0x6'),'isApp':![],'ChanSpyId':_0x3d2b3b['id'],'UserId':_0x4d9839['id']};_0x38dd0c[_0x55e1('0x7')](_[_0x55e1('0x8')]({'app':'Set','appdata':util[_0x55e1('0x9')](_0x55e1('0xa'),_0x55e1('0xb')),'priority':_0x548a79++},_0x109113));if(_0x3d2b3b[_0x55e1('0xc')]){_0x38dd0c['push'](_[_0x55e1('0x8')]({'app':'MixMonitor','appdata':util[_0x55e1('0x9')](_0x55e1('0xd'),_0x3d2b3b[_0x55e1('0xe')]),'priority':_0x548a79++},_0x109113));}if(_0x3d2b3b[_0x55e1('0xf')]){_0x38dd0c[_0x55e1('0x7')](_[_0x55e1('0x8')]({'app':_0x55e1('0x10'),'appdata':_0x3d2b3b[_0x55e1('0x11')],'priority':_0x548a79++},_0x109113));}_0x38dd0c['push'](_['merge']({'app':_0x55e1('0x12'),'appdata':util[_0x55e1('0x9')](_0x55e1('0x13'),_0x4d9839[_0x55e1('0x14')],_0x3d2b3b[_0x55e1('0x15')]?_0x3d2b3b['options'][_0x55e1('0x16')](''):''),'priority':_0x548a79++},_0x109113));if(_0x3d2b3b['record']){_0x38dd0c[_0x55e1('0x7')](_[_0x55e1('0x8')]({'app':_0x55e1('0x17'),'priority':_0x548a79++},_0x109113));}return _0x38dd0c;};var getChanSpyApplications=function(_0xc679d5,_0x1fd248){var _0x567761=[];for(var _0x180cdf=0x0,_0x4411f4=0x1;_0x180cdf<_0x1fd248['length'];_0x180cdf++,_0x4411f4=0x1){_0x567761=_0x567761[_0x55e1('0x18')](getUserApplications(_0xc679d5,_0x1fd248[_0x180cdf],_0x1fd248[_0x180cdf][_0x55e1('0x19')]));if(_0x1fd248[_0x180cdf][_0x55e1('0x19')]!=_0x1fd248[_0x180cdf][_0x55e1('0x14')]){_0x567761=_0x567761[_0x55e1('0x18')](getUserApplications(_0xc679d5,_0x1fd248[_0x180cdf],_0x1fd248[_0x180cdf]['name']));}}return _0x567761;};var getChanSpyPromise=function(_0x45e288,_0x55709a){return new BPromise(function(_0x20ef2c,_0x4103b3){return _0x45e288['User'][_0x55e1('0x1a')]({'attributes':['id',_0x55e1('0x14'),_0x55e1('0x19')],'where':{'role':_0x55e1('0x1b'),'chanspy':!![]},'raw':!![]})[_0x55e1('0x1c')](function(_0x5f498c){if(_0x5f498c){return _0x20ef2c(getChanSpyApplications(_0x55709a,_0x5f498c));}return _0x20ef2c([]);})[_0x55e1('0x1d')](function(_0x57398f){_0x4103b3(_0x57398f);});});};module[_0x55e1('0x1e')]=function(_0xc66d01,_0x59bb9f){var _0x83d49e=_0xc66d01['models'];return _0xc66d01[_0x55e1('0x1f')]('VoiceChanSpy',attributes,{'tableName':_0x55e1('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x50d190,_0x393bd0,_0x815c77){return getChanSpyPromise(_0x83d49e,_0x50d190)[_0x55e1('0x1c')](function(_0x222460){if(_0x222460&&_0x222460[_0x55e1('0x21')]){return _0x83d49e[_0x55e1('0x22')][_0x55e1('0x23')](_0x222460);}})[_0x55e1('0x1c')](function(){_0x815c77();})[_0x55e1('0x1d')](function(_0x85c284){_0x815c77(_0x85c284);});},'afterUpdate':function(_0x586f25,_0x2fe7f1,_0x2c4881){return _0x83d49e[_0x55e1('0x22')][_0x55e1('0x24')]({'where':{'ChanSpyId':_0x586f25['id']}})[_0x55e1('0x1c')](function(){return getChanSpyPromise(_0x83d49e,_0x586f25);})['then'](function(_0x52d3c8){if(_0x52d3c8&&_0x52d3c8[_0x55e1('0x21')]){return _0x83d49e[_0x55e1('0x22')][_0x55e1('0x23')](_0x52d3c8);}})[_0x55e1('0x1c')](function(){_0x2c4881();})['catch'](function(_0x5d3787){_0x2c4881(_0x5d3787);});},'afterDestroy':function(_0x32a7b7,_0x5e13d0,_0x372e41){return _0x83d49e[_0x55e1('0x22')][_0x55e1('0x24')]({'where':{'ChanSpyId':_0x32a7b7['id']}})['then'](function(){_0x372e41();})['catch'](function(_0x2c9cec){_0x372e41(_0x2c9cec);});}}});};
\ No newline at end of file
index 3f99ded..64fd4a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39cb=['code','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x39cb,0x1bd));var _0xb39c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x39cb[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0xb39c('0x0'));var moment=require(_0xb39c('0x1'));var BPromise=require('bluebird');var rs=require(_0xb39c('0x2'));var fs=require('fs');var Redis=require(_0xb39c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb39c('0x4'));var logger=require(_0xb39c('0x5'))(_0xb39c('0x6'));var config=require(_0xb39c('0x7'));var jayson=require(_0xb39c('0x8'));var client=jayson['client'][_0xb39c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fc868,_0x40112f,_0x3f2fbe){return new BPromise(function(_0x47d6d7,_0x5ae14a){return client[_0xb39c('0xa')](_0x2fc868,_0x3f2fbe)[_0xb39c('0xb')](function(_0x3ffb94){logger[_0xb39c('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x40112f,'request\x20sent');logger['debug'](_0xb39c('0xd'),_0x40112f,_0xb39c('0xe'),JSON[_0xb39c('0xf')](_0x3ffb94));if(_0x3ffb94[_0xb39c('0x10')]){if(_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x11')]===0x1f4){logger[_0xb39c('0x10')](_0xb39c('0x12'),_0x40112f,_0x3ffb94['error'][_0xb39c('0x13')]);return _0x5ae14a(_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x13')]);}logger['error'](_0xb39c('0x12'),_0x40112f,_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x13')]);return _0x47d6d7(_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x13')]);}else{logger[_0xb39c('0xc')](_0xb39c('0x12'),_0x40112f,'request\x20sent');_0x47d6d7(_0x3ffb94[_0xb39c('0x14')][_0xb39c('0x13')]);}})[_0xb39c('0x15')](function(_0x1c2c5f){logger[_0xb39c('0x10')](_0xb39c('0x12'),_0x40112f,_0x1c2c5f);_0x5ae14a(_0x1c2c5f);});});}
\ No newline at end of file
+var _0x6b20=['request','VoiceChanSpy,\x20%s,\x20%s','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3f8e30,_0x2c65b5){var _0x33381c=function(_0x3e0db2){while(--_0x3e0db2){_0x3f8e30['push'](_0x3f8e30['shift']());}};_0x33381c(++_0x2c65b5);}(_0x6b20,0xd1));var _0x06b2=function(_0x3e3ba1,_0x28e378){_0x3e3ba1=_0x3e3ba1-0x0;var _0x5eab6e=_0x6b20[_0x3e3ba1];return _0x5eab6e;};'use strict';var _=require(_0x06b2('0x0'));var util=require(_0x06b2('0x1'));var moment=require('moment');var BPromise=require(_0x06b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06b2('0x3'));var db=require(_0x06b2('0x4'))['db'];var utils=require(_0x06b2('0x5'));var logger=require('../../config/logger')(_0x06b2('0x6'));var config=require(_0x06b2('0x7'));var jayson=require(_0x06b2('0x8'));var client=jayson[_0x06b2('0x9')][_0x06b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37b825,_0x26a325,_0x4e6d3b){return new BPromise(function(_0x21cd31,_0x1828e4){return client[_0x06b2('0xb')](_0x37b825,_0x4e6d3b)['then'](function(_0x37ace0){logger['info'](_0x06b2('0xc'),_0x26a325,'request\x20sent');logger['debug'](_0x06b2('0xd'),_0x26a325,_0x06b2('0xe'),JSON['stringify'](_0x37ace0));if(_0x37ace0[_0x06b2('0xf')]){if(_0x37ace0[_0x06b2('0xf')][_0x06b2('0x10')]===0x1f4){logger[_0x06b2('0xf')](_0x06b2('0xc'),_0x26a325,_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);return _0x1828e4(_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);}logger[_0x06b2('0xf')](_0x06b2('0xc'),_0x26a325,_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);return _0x21cd31(_0x37ace0['error'][_0x06b2('0x11')]);}else{logger[_0x06b2('0x12')](_0x06b2('0xc'),_0x26a325,_0x06b2('0xe'));_0x21cd31(_0x37ace0[_0x06b2('0x13')][_0x06b2('0x11')]);}})['catch'](function(_0x17e69b){logger[_0x06b2('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x26a325,_0x17e69b);_0x1828e4(_0x17e69b);});});}
\ No newline at end of file
index 5b54b73..d2179c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b28=['get','/:id','show','create','put','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated','index'];(function(_0x63d046,_0x47dd4f){var _0x4596ce=function(_0x19126d){while(--_0x19126d){_0x63d046['push'](_0x63d046['shift']());}};_0x4596ce(++_0x47dd4f);}(_0x0b28,0x73));var _0x80b2=function(_0x4ab3fb,_0x776775){_0x4ab3fb=_0x4ab3fb-0x0;var _0x34fe1e=_0x0b28[_0x4ab3fb];return _0x34fe1e;};'use strict';var multer=require(_0x80b2('0x0'));var util=require(_0x80b2('0x1'));var path=require('path');var timeout=require(_0x80b2('0x2'));var express=require(_0x80b2('0x3'));var router=express[_0x80b2('0x4')]();var fs_extra=require(_0x80b2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x80b2('0x6'));var config=require(_0x80b2('0x7'));var controller=require(_0x80b2('0x8'));router['get']('/',auth[_0x80b2('0x9')](),controller[_0x80b2('0xa')]);router[_0x80b2('0xb')](_0x80b2('0xc'),auth['isAuthenticated'](),controller[_0x80b2('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x80b2('0xe')]);router[_0x80b2('0xf')](_0x80b2('0xc'),auth[_0x80b2('0x9')](),controller[_0x80b2('0x10')]);router['delete']('/:id',auth[_0x80b2('0x9')](),controller[_0x80b2('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xed2a=['fs-extra','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','show','post','put','/:id','update','delete','exports','util','path','Router'];(function(_0x127518,_0x1871cb){var _0x255ef6=function(_0x3d36a3){while(--_0x3d36a3){_0x127518['push'](_0x127518['shift']());}};_0x255ef6(++_0x1871cb);}(_0xed2a,0x1cd));var _0xaed2=function(_0x4fd752,_0x136358){_0x4fd752=_0x4fd752-0x0;var _0x2fb574=_0xed2a[_0x4fd752];return _0x2fb574;};'use strict';var multer=require('multer');var util=require(_0xaed2('0x0'));var path=require(_0xaed2('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xaed2('0x2')]();var fs_extra=require(_0xaed2('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xaed2('0x4'));var controller=require(_0xaed2('0x5'));router[_0xaed2('0x6')]('/',auth[_0xaed2('0x7')](),controller[_0xaed2('0x8')]);router['get']('/:id',auth[_0xaed2('0x7')](),controller[_0xaed2('0x9')]);router[_0xaed2('0xa')]('/',auth[_0xaed2('0x7')](),controller['create']);router[_0xaed2('0xb')](_0xaed2('0xc'),auth[_0xaed2('0x7')](),controller[_0xaed2('0xd')]);router[_0xaed2('0xe')](_0xaed2('0xc'),auth[_0xaed2('0x7')](),controller['destroy']);module[_0xaed2('0xf')]=router;
\ No newline at end of file
index 21638e9..5c11cd7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd81e=['sequelize','exports','name','STRING','BOOLEAN'];(function(_0x7384c7,_0x3aa650){var _0x56645d=function(_0x2f8bae){while(--_0x2f8bae){_0x7384c7['push'](_0x7384c7['shift']());}};_0x56645d(++_0x3aa650);}(_0xd81e,0xf0));var _0xed81=function(_0xacdfd8,_0x540dd6){_0xacdfd8=_0xacdfd8-0x0;var _0x29c8b7=_0xd81e[_0xacdfd8];return _0x29c8b7;};'use strict';var Sequelize=require(_0xed81('0x0'));module[_0xed81('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xed81('0x2')},'description':{'type':Sequelize[_0xed81('0x3')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xed81('0x4')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x4d88=['sequelize','exports','STRING','name','BOOLEAN'];(function(_0x1ee1d4,_0x425984){var _0x128ccc=function(_0x2e1efb){while(--_0x2e1efb){_0x1ee1d4['push'](_0x1ee1d4['shift']());}};_0x128ccc(++_0x425984);}(_0x4d88,0x195));var _0x84d8=function(_0x1474bb,_0x486735){_0x1474bb=_0x1474bb-0x0;var _0x1cea7c=_0x4d88[_0x1474bb];return _0x1cea7c;};'use strict';var Sequelize=require(_0x84d8('0x0'));module[_0x84d8('0x1')]={'name':{'type':Sequelize[_0x84d8('0x2')],'unique':_0x84d8('0x3')},'description':{'type':Sequelize[_0x84d8('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x84d8('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index 74918c4..9f2d000 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x989d=['result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','Contexts','UserProfileResource','destroy','end','name','index','map','VoiceContext','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','create','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x4b4e9b,_0x2ecc4a){var _0x59ed16=function(_0x3ff94d){while(--_0x3ff94d){_0x4b4e9b['push'](_0x4b4e9b['shift']());}};_0x59ed16(++_0x2ecc4a);}(_0x989d,0x177));var _0xd989=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x989d[_0x1203f];return _0x365f0a;};'use strict';var emlformat=require(_0xd989('0x0'));var rimraf=require(_0xd989('0x1'));var zipdir=require(_0xd989('0x2'));var jsonpatch=require(_0xd989('0x3'));var rp=require(_0xd989('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd989('0x5'));var util=require(_0xd989('0x6'));var path=require(_0xd989('0x7'));var sox=require(_0xd989('0x8'));var csv=require(_0xd989('0x9'));var ejs=require(_0xd989('0xa'));var fs=require('fs');var fs_extra=require(_0xd989('0xb'));var _=require(_0xd989('0xc'));var squel=require(_0xd989('0xd'));var crypto=require(_0xd989('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd989('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd989('0x10'));var Papa=require(_0xd989('0x11'));var Redis=require(_0xd989('0x12'));var authService=require(_0xd989('0x13'));var qs=require(_0xd989('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd989('0x15'));var logger=require('../../config/logger')(_0xd989('0x16'));var utils=require('../../config/utils');var config=require(_0xd989('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xd989('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed429,_0x55d922,_0x183e7a,_0x55f0bc){return new BPromise(function(_0x14f00,_0x32c656){var _0x3ff4bc=_0x55f0bc||client;return _0x3ff4bc['request'](_0x4ed429,_0x183e7a)['then'](function(_0x96f4f3){logger[_0xd989('0x19')](_0xd989('0x1a'),_0x55d922,_0xd989('0x1b'));logger[_0xd989('0x1c')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x55d922,'request\x20sent',JSON[_0xd989('0x1d')](_0x96f4f3));if(_0x96f4f3['error']){if(_0x96f4f3[_0xd989('0x1e')][_0xd989('0x1f')]===0x1f4){logger[_0xd989('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x55d922,_0x96f4f3[_0xd989('0x1e')]['message']);return _0x32c656(_0x96f4f3[_0xd989('0x1e')][_0xd989('0x20')]);}logger[_0xd989('0x1e')](_0xd989('0x1a'),_0x55d922,_0x96f4f3['error'][_0xd989('0x20')]);return _0x14f00(_0x96f4f3[_0xd989('0x1e')]['message']);}else{logger[_0xd989('0x19')](_0xd989('0x1a'),_0x55d922,_0xd989('0x1b'));_0x14f00(_0x96f4f3[_0xd989('0x21')][_0xd989('0x20')]);}})['catch'](function(_0xe87fa6){logger['error'](_0xd989('0x1a'),_0x55d922,_0xe87fa6);_0x32c656(_0xe87fa6);});});}function respondWithStatusCode(_0x513d51,_0x1c4c7a){_0x1c4c7a=_0x1c4c7a||0xcc;return function(_0x456bfd){if(_0x456bfd){return _0x513d51[_0xd989('0x22')](_0x1c4c7a);}return _0x513d51[_0xd989('0x23')](_0x1c4c7a)['end']();};}function respondWithResult(_0x2e99ec,_0x10ec53){_0x10ec53=_0x10ec53||0xc8;return function(_0x8457de){if(_0x8457de){return _0x2e99ec[_0xd989('0x23')](_0x10ec53)[_0xd989('0x24')](_0x8457de);}};}function respondWithFilteredResult(_0x4816c9,_0x4696bf){return function(_0x3bb7fa){if(_0x3bb7fa){var _0x5e4756=typeof _0x4696bf[_0xd989('0x25')]===_0xd989('0x26')&&typeof _0x4696bf[_0xd989('0x27')]===_0xd989('0x26');var _0x295931=_0x3bb7fa[_0xd989('0x28')];var _0x32881=_0x5e4756?0x0:_0x4696bf[_0xd989('0x25')];var _0x55f0a3=_0x5e4756?_0x3bb7fa[_0xd989('0x28')]:_0x4696bf[_0xd989('0x25')]+_0x4696bf['limit'];var _0x10ac1f;if(_0x55f0a3>=_0x295931){_0x55f0a3=_0x295931;_0x10ac1f=0xc8;}else{_0x10ac1f=0xce;}_0x4816c9[_0xd989('0x23')](_0x10ac1f);return _0x4816c9[_0xd989('0x29')](_0xd989('0x2a'),_0x32881+'-'+_0x55f0a3+'/'+_0x295931)[_0xd989('0x24')](_0x3bb7fa);}return null;};}function patchUpdates(_0x2d6d3c){return function(_0x29b6b0){try{jsonpatch[_0xd989('0x2b')](_0x29b6b0,_0x2d6d3c,!![]);}catch(_0x1f9a2e){return BPromise[_0xd989('0x2c')](_0x1f9a2e);}return _0x29b6b0[_0xd989('0x2d')]();};}function saveUpdates(_0x4fa514,_0x278383){return function(_0x23eff8){if(_0x23eff8){return _0x23eff8[_0xd989('0x2e')](_0x4fa514)[_0xd989('0x2f')](function(_0x5f356d){return _0x5f356d;});}return null;};}function removeEntity(_0x430f46,_0x291378){return function(_0x7aee41){if(_0x7aee41){return _0x7aee41['destroy']()[_0xd989('0x2f')](function(){var _0x1c854e=_0x7aee41[_0xd989('0x30')]({'plain':!![]});var _0x52f064=_0xd989('0x31');return db[_0xd989('0x32')][_0xd989('0x33')]({'where':{'type':_0x52f064,'resourceId':_0x1c854e['id']}})[_0xd989('0x2f')](function(){return _0x7aee41;});})[_0xd989('0x2f')](function(){_0x430f46[_0xd989('0x23')](0xcc)[_0xd989('0x34')]();});}};}function handleEntityNotFound(_0x26bcee,_0xd76701){return function(_0x1495d7){if(!_0x1495d7){_0x26bcee[_0xd989('0x22')](0x194);}return _0x1495d7;};}function handleError(_0x2bf843,_0xedcda1){_0xedcda1=_0xedcda1||0x1f4;return function(_0x240e13){logger[_0xd989('0x1e')](_0x240e13['stack']);if(_0x240e13['name']){delete _0x240e13[_0xd989('0x35')];}_0x2bf843[_0xd989('0x23')](_0xedcda1)['send'](_0x240e13);};}exports[_0xd989('0x36')]=function(_0x34495d,_0x2565dd){var _0x3f87d8={},_0xdc57e={},_0x2ae6bb={'count':0x0,'rows':[]};var _0x2c3e75=_[_0xd989('0x37')](db[_0xd989('0x38')][_0xd989('0x39')],function(_0x6b8ac7){return{'name':_0x6b8ac7[_0xd989('0x3a')],'type':_0x6b8ac7[_0xd989('0x3b')][_0xd989('0x3c')]};});_0xdc57e[_0xd989('0x3d')]=_[_0xd989('0x37')](_0x2c3e75,_0xd989('0x35'));_0xdc57e[_0xd989('0x3e')]=_[_0xd989('0x3f')](_0x34495d[_0xd989('0x3e')]);_0xdc57e[_0xd989('0x40')]=_[_0xd989('0x41')](_0xdc57e[_0xd989('0x3d')],_0xdc57e[_0xd989('0x3e')]);_0x3f87d8[_0xd989('0x42')]=_[_0xd989('0x41')](_0xdc57e[_0xd989('0x3d')],qs[_0xd989('0x43')](_0x34495d['query'][_0xd989('0x43')]));_0x3f87d8[_0xd989('0x42')]=_0x3f87d8[_0xd989('0x42')][_0xd989('0x44')]?_0x3f87d8[_0xd989('0x42')]:_0xdc57e['model'];if(!_0x34495d['query']['hasOwnProperty'](_0xd989('0x45'))){_0x3f87d8[_0xd989('0x27')]=qs['limit'](_0x34495d[_0xd989('0x3e')]['limit']);_0x3f87d8[_0xd989('0x25')]=qs[_0xd989('0x25')](_0x34495d[_0xd989('0x3e')]['offset']);}_0x3f87d8['order']=qs[_0xd989('0x46')](_0x34495d[_0xd989('0x3e')][_0xd989('0x46')]);_0x3f87d8[_0xd989('0x47')]=qs[_0xd989('0x40')](_[_0xd989('0x48')](_0x34495d[_0xd989('0x3e')],_0xdc57e[_0xd989('0x40')]),_0x2c3e75);if(_0x34495d[_0xd989('0x3e')][_0xd989('0x49')]){_0x3f87d8[_0xd989('0x47')]=_[_0xd989('0x4a')](_0x3f87d8[_0xd989('0x47')],{'$or':_[_0xd989('0x37')](_0x2c3e75,function(_0x423674){if(_0x423674[_0xd989('0x3b')]!==_0xd989('0x4b')){var _0x3317c9={};_0x3317c9[_0x423674[_0xd989('0x35')]]={'$like':'%'+_0x34495d[_0xd989('0x3e')]['filter']+'%'};return _0x3317c9;}})});}_0x3f87d8=_[_0xd989('0x4a')]({},_0x3f87d8,_0x34495d[_0xd989('0x4c')]);var _0x4c47be={'where':_0x3f87d8[_0xd989('0x47')]};return db[_0xd989('0x38')][_0xd989('0x28')](_0x4c47be)['then'](function(_0x2d78a7){_0x2ae6bb['count']=_0x2d78a7;if(_0x34495d[_0xd989('0x3e')][_0xd989('0x4d')]){_0x3f87d8[_0xd989('0x4e')]=[{'all':!![]}];}return db[_0xd989('0x38')][_0xd989('0x4f')](_0x3f87d8);})['then'](function(_0x2e6a97){_0x2ae6bb[_0xd989('0x50')]=_0x2e6a97;return _0x2ae6bb;})['then'](respondWithFilteredResult(_0x2565dd,_0x3f87d8))['catch'](handleError(_0x2565dd,null));};exports[_0xd989('0x51')]=function(_0x3b4df0,_0x21bb34){var _0x166359={'raw':![],'where':{'id':_0x3b4df0[_0xd989('0x52')]['id']}},_0xb8428={};_0xb8428[_0xd989('0x3d')]=_[_0xd989('0x3f')](db[_0xd989('0x38')][_0xd989('0x39')]);_0xb8428[_0xd989('0x3e')]=_[_0xd989('0x3f')](_0x3b4df0[_0xd989('0x3e')]);_0xb8428[_0xd989('0x40')]=_[_0xd989('0x41')](_0xb8428[_0xd989('0x3d')],_0xb8428['query']);_0x166359['attributes']=_[_0xd989('0x41')](_0xb8428[_0xd989('0x3d')],qs[_0xd989('0x43')](_0x3b4df0[_0xd989('0x3e')]['fields']));_0x166359['attributes']=_0x166359[_0xd989('0x42')][_0xd989('0x44')]?_0x166359[_0xd989('0x42')]:_0xb8428[_0xd989('0x3d')];if(_0x3b4df0[_0xd989('0x3e')][_0xd989('0x4d')]){_0x166359[_0xd989('0x4e')]=[{'all':!![]}];}_0x166359=_['merge']({},_0x166359,_0x3b4df0[_0xd989('0x4c')]);return db['VoiceContext']['find'](_0x166359)['then'](handleEntityNotFound(_0x21bb34,null))['then'](respondWithResult(_0x21bb34,null))['catch'](handleError(_0x21bb34,null));};exports[_0xd989('0x53')]=function(_0x490dc8,_0x644bcb,_0x4f4a82){var _0x10294d;return db[_0xd989('0x38')][_0xd989('0x53')](_0x490dc8['body'],{'raw':!![]})['then'](function(_0x485d78){_0x10294d=_0x485d78;return db[_0xd989('0x38')][_0xd989('0x4f')]({'raw':!![]});})[_0xd989('0x2f')](function(_0x4d7dce){var _0x4abd8f=fs[_0xd989('0x54')](path[_0xd989('0x55')](config[_0xd989('0x56')],_0xd989('0x57')),_0xd989('0x58'));var _0x1416f3=ejs[_0xd989('0x59')](_0x4abd8f,{'contexts':_0x4d7dce||[]});fs[_0xd989('0x5a')](_0xd989('0x5b'),_0x1416f3);})[_0xd989('0x2f')](function(){return respondWithRpcPromise(_0xd989('0x5c'),_0xd989('0x53'),{'module':_0xd989('0x5d')});})[_0xd989('0x2f')](function(){var _0x194900=_0x490dc8[_0xd989('0x5e')][_0xd989('0x30')]({'plain':!![]});if(!_0x194900)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x194900[_0xd989('0x5f')]===_0xd989('0x5e')){var _0x441b43=_0x10294d[_0xd989('0x30')]({'plain':!![]});return db[_0xd989('0x60')][_0xd989('0x61')]({'where':{'name':_0xd989('0x31'),'userProfileId':_0x194900[_0xd989('0x62')]},'raw':!![]})[_0xd989('0x2f')](function(_0x39b997){if(_0x39b997&&_0x39b997[_0xd989('0x63')]===0x0){return db[_0xd989('0x32')][_0xd989('0x53')]({'name':_0x441b43[_0xd989('0x35')],'resourceId':_0x441b43['id'],'type':_0x39b997[_0xd989('0x35')],'sectionId':_0x39b997['id']},{})[_0xd989('0x2f')](function(){return _0x10294d;});}else{return _0x10294d;}})['catch'](function(_0x463f46){logger[_0xd989('0x1e')](_0xd989('0x64'),_0x463f46);throw _0x463f46;});}return _0x10294d;})[_0xd989('0x2f')](respondWithResult(_0x644bcb,0xc9))['catch'](handleError(_0x644bcb,null));};exports[_0xd989('0x2e')]=function(_0x42907f,_0x382a8c,_0x363d97){var _0x22387e;return db[_0xd989('0x38')]['find']({'where':{'id':_0x42907f[_0xd989('0x52')]['id']}})[_0xd989('0x2f')](handleEntityNotFound(_0x382a8c,null))['then'](saveUpdates(_0x42907f['body'],null))[_0xd989('0x2f')](function(_0x36e50f){if(_0x36e50f){_0x22387e=_0x36e50f;return db[_0xd989('0x38')][_0xd989('0x4f')]({'raw':!![]});}})[_0xd989('0x2f')](function(_0x148352){var _0x557d10=fs[_0xd989('0x54')](path[_0xd989('0x55')](config[_0xd989('0x56')],_0xd989('0x57')),_0xd989('0x58'));var _0x3de922=ejs[_0xd989('0x59')](_0x557d10,{'contexts':_0x148352||[]});fs[_0xd989('0x5a')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x3de922);})[_0xd989('0x2f')](function(){return respondWithRpcPromise(_0xd989('0x5c'),_0xd989('0x2e'),{'module':_0xd989('0x5d')});})[_0xd989('0x2f')](function(){return _0x22387e;})[_0xd989('0x2f')](respondWithResult(_0x382a8c,null))[_0xd989('0x65')](handleError(_0x382a8c,null));};exports[_0xd989('0x33')]=function(_0x11aa45,_0x2d5212,_0x5d6373){var _0x199633;return db[_0xd989('0x38')][_0xd989('0x61')]({'where':{'id':_0x11aa45[_0xd989('0x52')]['id']}})['then'](handleEntityNotFound(_0x2d5212,null))['then'](removeEntity(_0x2d5212,null))[_0xd989('0x2f')](function(){return db['VoiceContext']['findAll']({'raw':!![]});})[_0xd989('0x2f')](function(_0xc26c14){var _0x5968ef=fs['readFileSync'](path[_0xd989('0x55')](config['root'],_0xd989('0x57')),_0xd989('0x58'));var _0x4bc417=ejs[_0xd989('0x59')](_0x5968ef,{'contexts':_0xc26c14});fs[_0xd989('0x5a')](_0xd989('0x5b'),_0x4bc417);return respondWithRpcPromise(_0xd989('0x5c'),_0xd989('0x33'),{'module':_0xd989('0x5d')});})[_0xd989('0x65')](handleError(_0x2d5212,null));};
\ No newline at end of file
+var _0x89a4=['filters','pick','merge','VIRTUAL','filter','include','findAll','rows','show','options','find','body','readFileSync','join','root','server/files/templates/context.ejs','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','utf8','chan_sip.so','eml-format','zip-dir','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','destroy','get','Contexts','UserProfileResource','end','stack','name','index','map','VoiceContext','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','nolimit','sort','where'];(function(_0x214ffc,_0x430a6d){var _0x366bbf=function(_0x243368){while(--_0x243368){_0x214ffc['push'](_0x214ffc['shift']());}};_0x366bbf(++_0x430a6d);}(_0x89a4,0xe6));var _0x489a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x89a4[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x489a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x489a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x489a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x489a('0x3'));var util=require(_0x489a('0x4'));var path=require(_0x489a('0x5'));var sox=require('sox');var csv=require(_0x489a('0x6'));var ejs=require(_0x489a('0x7'));var fs=require('fs');var fs_extra=require(_0x489a('0x8'));var _=require(_0x489a('0x9'));var squel=require('squel');var crypto=require(_0x489a('0xa'));var jsforce=require(_0x489a('0xb'));var deskjs=require(_0x489a('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x489a('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x489a('0xe'));var as=require(_0x489a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x489a('0x10'))(_0x489a('0x11'));var utils=require(_0x489a('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x489a('0x13'));var db=require(_0x489a('0x14'))['db'];var jayson=require(_0x489a('0x15'));var client=jayson[_0x489a('0x16')][_0x489a('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x114af2,_0x550c8b,_0x226aa3,_0x55e287){return new BPromise(function(_0x2a0202,_0x5f00ff){var _0x12da41=_0x55e287||client;return _0x12da41[_0x489a('0x18')](_0x114af2,_0x226aa3)[_0x489a('0x19')](function(_0xdf5325){logger[_0x489a('0x1a')]('VoiceContext,\x20%s,\x20%s',_0x550c8b,_0x489a('0x1b'));logger[_0x489a('0x1c')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x550c8b,'request\x20sent',JSON['stringify'](_0xdf5325));if(_0xdf5325[_0x489a('0x1d')]){if(_0xdf5325[_0x489a('0x1d')][_0x489a('0x1e')]===0x1f4){logger[_0x489a('0x1d')](_0x489a('0x1f'),_0x550c8b,_0xdf5325[_0x489a('0x1d')]['message']);return _0x5f00ff(_0xdf5325[_0x489a('0x1d')]['message']);}logger[_0x489a('0x1d')]('VoiceContext,\x20%s,\x20%s',_0x550c8b,_0xdf5325['error'][_0x489a('0x20')]);return _0x2a0202(_0xdf5325[_0x489a('0x1d')][_0x489a('0x20')]);}else{logger[_0x489a('0x1a')](_0x489a('0x1f'),_0x550c8b,_0x489a('0x1b'));_0x2a0202(_0xdf5325[_0x489a('0x21')][_0x489a('0x20')]);}})[_0x489a('0x22')](function(_0x217e41){logger[_0x489a('0x1d')](_0x489a('0x1f'),_0x550c8b,_0x217e41);_0x5f00ff(_0x217e41);});});}function respondWithStatusCode(_0x571a71,_0x5dfbd9){_0x5dfbd9=_0x5dfbd9||0xcc;return function(_0x2b5357){if(_0x2b5357){return _0x571a71[_0x489a('0x23')](_0x5dfbd9);}return _0x571a71[_0x489a('0x24')](_0x5dfbd9)['end']();};}function respondWithResult(_0x2f1621,_0x362dab){_0x362dab=_0x362dab||0xc8;return function(_0x49aebe){if(_0x49aebe){return _0x2f1621['status'](_0x362dab)['json'](_0x49aebe);}};}function respondWithFilteredResult(_0x345d01,_0x18340c){return function(_0xab23a2){if(_0xab23a2){var _0x310713=typeof _0x18340c[_0x489a('0x25')]===_0x489a('0x26')&&typeof _0x18340c['limit']==='undefined';var _0x6955ca=_0xab23a2[_0x489a('0x27')];var _0xb9b770=_0x310713?0x0:_0x18340c['offset'];var _0x34689e=_0x310713?_0xab23a2[_0x489a('0x27')]:_0x18340c[_0x489a('0x25')]+_0x18340c[_0x489a('0x28')];var _0x181820;if(_0x34689e>=_0x6955ca){_0x34689e=_0x6955ca;_0x181820=0xc8;}else{_0x181820=0xce;}_0x345d01[_0x489a('0x24')](_0x181820);return _0x345d01[_0x489a('0x29')](_0x489a('0x2a'),_0xb9b770+'-'+_0x34689e+'/'+_0x6955ca)[_0x489a('0x2b')](_0xab23a2);}return null;};}function patchUpdates(_0x195583){return function(_0x475326){try{jsonpatch['apply'](_0x475326,_0x195583,!![]);}catch(_0x5c8e88){return BPromise[_0x489a('0x2c')](_0x5c8e88);}return _0x475326[_0x489a('0x2d')]();};}function saveUpdates(_0x3fbbd6,_0x55fb19){return function(_0x7b50f1){if(_0x7b50f1){return _0x7b50f1[_0x489a('0x2e')](_0x3fbbd6)['then'](function(_0x4286ad){return _0x4286ad;});}return null;};}function removeEntity(_0x38cba6,_0x8027f7){return function(_0x4d4ae9){if(_0x4d4ae9){return _0x4d4ae9[_0x489a('0x2f')]()[_0x489a('0x19')](function(){var _0x4ccf90=_0x4d4ae9[_0x489a('0x30')]({'plain':!![]});var _0x39532a=_0x489a('0x31');return db[_0x489a('0x32')]['destroy']({'where':{'type':_0x39532a,'resourceId':_0x4ccf90['id']}})[_0x489a('0x19')](function(){return _0x4d4ae9;});})[_0x489a('0x19')](function(){_0x38cba6['status'](0xcc)[_0x489a('0x33')]();});}};}function handleEntityNotFound(_0x588ba6,_0x1d625c){return function(_0x1bc431){if(!_0x1bc431){_0x588ba6[_0x489a('0x23')](0x194);}return _0x1bc431;};}function handleError(_0x354643,_0x33e64b){_0x33e64b=_0x33e64b||0x1f4;return function(_0x5af286){logger[_0x489a('0x1d')](_0x5af286[_0x489a('0x34')]);if(_0x5af286[_0x489a('0x35')]){delete _0x5af286[_0x489a('0x35')];}_0x354643[_0x489a('0x24')](_0x33e64b)['send'](_0x5af286);};}exports[_0x489a('0x36')]=function(_0x1348fb,_0x68b2f9){var _0x12beac={},_0x54c766={},_0x6d3e77={'count':0x0,'rows':[]};var _0x2db35e=_[_0x489a('0x37')](db[_0x489a('0x38')][_0x489a('0x39')],function(_0x2ea41f){return{'name':_0x2ea41f[_0x489a('0x3a')],'type':_0x2ea41f[_0x489a('0x3b')]['key']};});_0x54c766[_0x489a('0x3c')]=_[_0x489a('0x37')](_0x2db35e,'name');_0x54c766[_0x489a('0x3d')]=_[_0x489a('0x3e')](_0x1348fb[_0x489a('0x3d')]);_0x54c766['filters']=_[_0x489a('0x3f')](_0x54c766[_0x489a('0x3c')],_0x54c766[_0x489a('0x3d')]);_0x12beac['attributes']=_[_0x489a('0x3f')](_0x54c766[_0x489a('0x3c')],qs[_0x489a('0x40')](_0x1348fb['query']['fields']));_0x12beac[_0x489a('0x41')]=_0x12beac['attributes'][_0x489a('0x42')]?_0x12beac[_0x489a('0x41')]:_0x54c766['model'];if(!_0x1348fb['query']['hasOwnProperty'](_0x489a('0x43'))){_0x12beac[_0x489a('0x28')]=qs[_0x489a('0x28')](_0x1348fb['query'][_0x489a('0x28')]);_0x12beac[_0x489a('0x25')]=qs[_0x489a('0x25')](_0x1348fb[_0x489a('0x3d')]['offset']);}_0x12beac['order']=qs[_0x489a('0x44')](_0x1348fb[_0x489a('0x3d')][_0x489a('0x44')]);_0x12beac[_0x489a('0x45')]=qs[_0x489a('0x46')](_[_0x489a('0x47')](_0x1348fb[_0x489a('0x3d')],_0x54c766['filters']),_0x2db35e);if(_0x1348fb['query']['filter']){_0x12beac[_0x489a('0x45')]=_[_0x489a('0x48')](_0x12beac[_0x489a('0x45')],{'$or':_[_0x489a('0x37')](_0x2db35e,function(_0x5e4746){if(_0x5e4746['type']!==_0x489a('0x49')){var _0x37c8a9={};_0x37c8a9[_0x5e4746['name']]={'$like':'%'+_0x1348fb[_0x489a('0x3d')][_0x489a('0x4a')]+'%'};return _0x37c8a9;}})});}_0x12beac=_[_0x489a('0x48')]({},_0x12beac,_0x1348fb['options']);var _0x1e4bf2={'where':_0x12beac[_0x489a('0x45')]};return db[_0x489a('0x38')][_0x489a('0x27')](_0x1e4bf2)['then'](function(_0x158ead){_0x6d3e77[_0x489a('0x27')]=_0x158ead;if(_0x1348fb[_0x489a('0x3d')]['includeAll']){_0x12beac[_0x489a('0x4b')]=[{'all':!![]}];}return db[_0x489a('0x38')][_0x489a('0x4c')](_0x12beac);})[_0x489a('0x19')](function(_0x22cb8d){_0x6d3e77[_0x489a('0x4d')]=_0x22cb8d;return _0x6d3e77;})[_0x489a('0x19')](respondWithFilteredResult(_0x68b2f9,_0x12beac))[_0x489a('0x22')](handleError(_0x68b2f9,null));};exports[_0x489a('0x4e')]=function(_0x2e2213,_0x5572c9){var _0x28f135={'raw':![],'where':{'id':_0x2e2213['params']['id']}},_0x5b8c95={};_0x5b8c95[_0x489a('0x3c')]=_[_0x489a('0x3e')](db[_0x489a('0x38')]['rawAttributes']);_0x5b8c95['query']=_[_0x489a('0x3e')](_0x2e2213[_0x489a('0x3d')]);_0x5b8c95['filters']=_[_0x489a('0x3f')](_0x5b8c95[_0x489a('0x3c')],_0x5b8c95[_0x489a('0x3d')]);_0x28f135[_0x489a('0x41')]=_['intersection'](_0x5b8c95[_0x489a('0x3c')],qs[_0x489a('0x40')](_0x2e2213[_0x489a('0x3d')]['fields']));_0x28f135['attributes']=_0x28f135[_0x489a('0x41')][_0x489a('0x42')]?_0x28f135[_0x489a('0x41')]:_0x5b8c95['model'];if(_0x2e2213[_0x489a('0x3d')]['includeAll']){_0x28f135[_0x489a('0x4b')]=[{'all':!![]}];}_0x28f135=_[_0x489a('0x48')]({},_0x28f135,_0x2e2213[_0x489a('0x4f')]);return db[_0x489a('0x38')][_0x489a('0x50')](_0x28f135)[_0x489a('0x19')](handleEntityNotFound(_0x5572c9,null))['then'](respondWithResult(_0x5572c9,null))[_0x489a('0x22')](handleError(_0x5572c9,null));};exports['create']=function(_0xa99ea4,_0x356f5d,_0x4236e4){var _0x15a538;return db[_0x489a('0x38')]['create'](_0xa99ea4[_0x489a('0x51')],{'raw':!![]})[_0x489a('0x19')](function(_0x25093f){_0x15a538=_0x25093f;return db[_0x489a('0x38')][_0x489a('0x4c')]({'raw':!![]});})[_0x489a('0x19')](function(_0xde1237){var _0xee7910=fs[_0x489a('0x52')](path[_0x489a('0x53')](config[_0x489a('0x54')],_0x489a('0x55')),'utf8');var _0x3aea71=ejs[_0x489a('0x56')](_0xee7910,{'contexts':_0xde1237||[]});fs[_0x489a('0x57')](_0x489a('0x58'),_0x3aea71);})[_0x489a('0x19')](function(){return respondWithRpcPromise(_0x489a('0x59'),'create',{'module':'chan_sip.so'});})[_0x489a('0x19')](function(){var _0x25dc5d=_0xa99ea4[_0x489a('0x5a')]['get']({'plain':!![]});if(!_0x25dc5d)throw new Error(_0x489a('0x5b'));if(_0x25dc5d[_0x489a('0x5c')]===_0x489a('0x5a')){var _0x3f6cc7=_0x15a538[_0x489a('0x30')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x489a('0x31'),'userProfileId':_0x25dc5d[_0x489a('0x5d')]},'raw':!![]})[_0x489a('0x19')](function(_0x105a64){if(_0x105a64&&_0x105a64[_0x489a('0x5e')]===0x0){return db['UserProfileResource'][_0x489a('0x5f')]({'name':_0x3f6cc7[_0x489a('0x35')],'resourceId':_0x3f6cc7['id'],'type':_0x105a64[_0x489a('0x35')],'sectionId':_0x105a64['id']},{})[_0x489a('0x19')](function(){return _0x15a538;});}else{return _0x15a538;}})[_0x489a('0x22')](function(_0x2c999d){logger['error'](_0x489a('0x60'),_0x2c999d);throw _0x2c999d;});}return _0x15a538;})[_0x489a('0x19')](respondWithResult(_0x356f5d,0xc9))[_0x489a('0x22')](handleError(_0x356f5d,null));};exports[_0x489a('0x2e')]=function(_0x4240bb,_0x45f2db,_0x8695f6){var _0x3fa1ff;return db[_0x489a('0x38')]['find']({'where':{'id':_0x4240bb[_0x489a('0x61')]['id']}})[_0x489a('0x19')](handleEntityNotFound(_0x45f2db,null))[_0x489a('0x19')](saveUpdates(_0x4240bb['body'],null))[_0x489a('0x19')](function(_0x32b163){if(_0x32b163){_0x3fa1ff=_0x32b163;return db[_0x489a('0x38')][_0x489a('0x4c')]({'raw':!![]});}})[_0x489a('0x19')](function(_0x47c68f){var _0x1ed7da=fs[_0x489a('0x52')](path[_0x489a('0x53')](config['root'],_0x489a('0x55')),_0x489a('0x62'));var _0x5c91fe=ejs[_0x489a('0x56')](_0x1ed7da,{'contexts':_0x47c68f||[]});fs['writeFileSync'](_0x489a('0x58'),_0x5c91fe);})[_0x489a('0x19')](function(){return respondWithRpcPromise(_0x489a('0x59'),_0x489a('0x2e'),{'module':_0x489a('0x63')});})[_0x489a('0x19')](function(){return _0x3fa1ff;})[_0x489a('0x19')](respondWithResult(_0x45f2db,null))[_0x489a('0x22')](handleError(_0x45f2db,null));};exports[_0x489a('0x2f')]=function(_0x18b8a3,_0x24dd1a,_0x34d12c){var _0x513b36;return db[_0x489a('0x38')][_0x489a('0x50')]({'where':{'id':_0x18b8a3[_0x489a('0x61')]['id']}})[_0x489a('0x19')](handleEntityNotFound(_0x24dd1a,null))[_0x489a('0x19')](removeEntity(_0x24dd1a,null))[_0x489a('0x19')](function(){return db['VoiceContext'][_0x489a('0x4c')]({'raw':!![]});})[_0x489a('0x19')](function(_0x359656){var _0x3ee5ce=fs['readFileSync'](path[_0x489a('0x53')](config[_0x489a('0x54')],_0x489a('0x55')),_0x489a('0x62'));var _0x3138d3=ejs[_0x489a('0x56')](_0x3ee5ce,{'contexts':_0x359656});fs[_0x489a('0x57')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x3138d3);return respondWithRpcPromise(_0x489a('0x59'),'destroy',{'module':_0x489a('0x63')});})[_0x489a('0x22')](handleError(_0x24dd1a,null));};
\ No newline at end of file
index ff27ee4..c41ea19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2580=['exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./voiceContext.attributes'];(function(_0x5a1522,_0x46e359){var _0x30326c=function(_0x413dbb){while(--_0x413dbb){_0x5a1522['push'](_0x5a1522['shift']());}};_0x30326c(++_0x46e359);}(_0x2580,0x156));var _0x0258=function(_0x4ae743,_0x56b609){_0x4ae743=_0x4ae743-0x0;var _0x186442=_0x2580[_0x4ae743];return _0x186442;};'use strict';var _=require(_0x0258('0x0'));var util=require(_0x0258('0x1'));var logger=require(_0x0258('0x2'))('api');var moment=require(_0x0258('0x3'));var BPromise=require(_0x0258('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0258('0x5'));var rimraf=require(_0x0258('0x6'));var config=require(_0x0258('0x7'));var attributes=require(_0x0258('0x8'));module[_0x0258('0x9')]=function(_0x62628f,_0x1f53a4){return _0x62628f[_0x0258('0xa')](_0x0258('0xb'),attributes,{'tableName':_0x0258('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb4c3=['VoiceContext','voice_contexts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceContext.attributes'];(function(_0x9df20b,_0x444cfb){var _0x553c95=function(_0x4fc621){while(--_0x4fc621){_0x9df20b['push'](_0x9df20b['shift']());}};_0x553c95(++_0x444cfb);}(_0xb4c3,0x115));var _0x3b4c=function(_0x1bc9e4,_0x2f200e){_0x1bc9e4=_0x1bc9e4-0x0;var _0x1815d3=_0xb4c3[_0x1bc9e4];return _0x1815d3;};'use strict';var _=require(_0x3b4c('0x0'));var util=require('util');var logger=require(_0x3b4c('0x1'))(_0x3b4c('0x2'));var moment=require(_0x3b4c('0x3'));var BPromise=require(_0x3b4c('0x4'));var rp=require(_0x3b4c('0x5'));var fs=require('fs');var path=require(_0x3b4c('0x6'));var rimraf=require(_0x3b4c('0x7'));var config=require('../../config/environment');var attributes=require(_0x3b4c('0x8'));module['exports']=function(_0x27922e,_0x714b84){return _0x27922e['define'](_0x3b4c('0x9'),attributes,{'tableName':_0x3b4c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8ade532..722850f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb12d=['rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceContext,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x23187e,_0x35ace6){var _0x54ffb4=function(_0x302a3a){while(--_0x302a3a){_0x23187e['push'](_0x23187e['shift']());}};_0x54ffb4(++_0x35ace6);}(_0xb12d,0x124));var _0xdb12=function(_0x296809,_0x1c9665){_0x296809=_0x296809-0x0;var _0x18c0d3=_0xb12d[_0x296809];return _0x18c0d3;};'use strict';var _=require(_0xdb12('0x0'));var util=require(_0xdb12('0x1'));var moment=require(_0xdb12('0x2'));var BPromise=require('bluebird');var rs=require(_0xdb12('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb12('0x4'))['db'];var utils=require(_0xdb12('0x5'));var logger=require(_0xdb12('0x6'))(_0xdb12('0x7'));var config=require(_0xdb12('0x8'));var jayson=require(_0xdb12('0x9'));var client=jayson['client'][_0xdb12('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19e73f,_0x27eb31,_0x3872c3){return new BPromise(function(_0x11385d,_0x11d97c){return client[_0xdb12('0xb')](_0x19e73f,_0x3872c3)[_0xdb12('0xc')](function(_0x54eb5b){logger[_0xdb12('0xd')]('VoiceContext,\x20%s,\x20%s',_0x27eb31,_0xdb12('0xe'));logger[_0xdb12('0xf')](_0xdb12('0x10'),_0x27eb31,'request\x20sent',JSON[_0xdb12('0x11')](_0x54eb5b));if(_0x54eb5b[_0xdb12('0x12')]){if(_0x54eb5b[_0xdb12('0x12')]['code']===0x1f4){logger[_0xdb12('0x12')]('VoiceContext,\x20%s,\x20%s',_0x27eb31,_0x54eb5b[_0xdb12('0x12')][_0xdb12('0x13')]);return _0x11d97c(_0x54eb5b[_0xdb12('0x12')]['message']);}logger[_0xdb12('0x12')](_0xdb12('0x14'),_0x27eb31,_0x54eb5b['error'][_0xdb12('0x13')]);return _0x11385d(_0x54eb5b['error'][_0xdb12('0x13')]);}else{logger[_0xdb12('0xd')]('VoiceContext,\x20%s,\x20%s',_0x27eb31,_0xdb12('0xe'));_0x11385d(_0x54eb5b[_0xdb12('0x15')][_0xdb12('0x13')]);}})[_0xdb12('0x16')](function(_0x504cf5){logger['error'](_0xdb12('0x14'),_0x27eb31,_0x504cf5);_0x11d97c(_0x504cf5);});});}
\ No newline at end of file
+var _0x8603=['message','info','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','error'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x8603,0x190));var _0x3860=function(_0x27e357,_0x596b3c){_0x27e357=_0x27e357-0x0;var _0x1451bf=_0x8603[_0x27e357];return _0x1451bf;};'use strict';var _=require('lodash');var util=require(_0x3860('0x0'));var moment=require(_0x3860('0x1'));var BPromise=require(_0x3860('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3860('0x3'))['db'];var utils=require(_0x3860('0x4'));var logger=require(_0x3860('0x5'))('rpc');var config=require(_0x3860('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3860('0x7')][_0x3860('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1eca44,_0xd3ce26,_0x472bf2){return new BPromise(function(_0x4aba10,_0x5c7350){return client['request'](_0x1eca44,_0x472bf2)[_0x3860('0x9')](function(_0x441dc4){logger['info'](_0x3860('0xa'),_0xd3ce26,_0x3860('0xb'));logger['debug'](_0x3860('0xc'),_0xd3ce26,_0x3860('0xb'),JSON['stringify'](_0x441dc4));if(_0x441dc4[_0x3860('0xd')]){if(_0x441dc4[_0x3860('0xd')]['code']===0x1f4){logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);return _0x5c7350(_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);}logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);return _0x4aba10(_0x441dc4['error'][_0x3860('0xe')]);}else{logger[_0x3860('0xf')](_0x3860('0xa'),_0xd3ce26,_0x3860('0xb'));_0x4aba10(_0x441dc4[_0x3860('0x10')][_0x3860('0xe')]);}})[_0x3860('0x11')](function(_0x378305){logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x378305);_0x5c7350(_0x378305);});});}
\ No newline at end of file
index 3e0a459..4d1e4de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6364=['update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create','put'];(function(_0x1260f1,_0x37f79d){var _0x53c9f2=function(_0x291594){while(--_0x291594){_0x1260f1['push'](_0x1260f1['shift']());}};_0x53c9f2(++_0x37f79d);}(_0x6364,0x8f));var _0x4636=function(_0xfc757b,_0x300fe8){_0xfc757b=_0xfc757b-0x0;var _0x4b5a07=_0x6364[_0xfc757b];return _0x4b5a07;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4636('0x0'));var timeout=require(_0x4636('0x1'));var express=require(_0x4636('0x2'));var router=express[_0x4636('0x3')]();var fs_extra=require(_0x4636('0x4'));var auth=require(_0x4636('0x5'));var interaction=require(_0x4636('0x6'));var config=require(_0x4636('0x7'));var controller=require('./voiceDialReport.controller');router[_0x4636('0x8')]('/',auth[_0x4636('0x9')](),controller[_0x4636('0xa')]);router[_0x4636('0x8')](_0x4636('0xb'),auth['isAuthenticated'](),controller[_0x4636('0xc')]);router[_0x4636('0x8')](_0x4636('0xd'),auth[_0x4636('0x9')](),controller['show']);router[_0x4636('0xe')]('/',auth[_0x4636('0x9')](),controller[_0x4636('0xf')]);router[_0x4636('0x10')](_0x4636('0xd'),auth['isAuthenticated'](),controller[_0x4636('0x11')]);router[_0x4636('0x12')](_0x4636('0xd'),auth[_0x4636('0x9')](),controller['destroy']);module[_0x4636('0x13')]=router;
\ No newline at end of file
+var _0x51d3=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','get','/describe','describe','/:id','show','post','put','update','delete','destroy'];(function(_0x51cc2b,_0x56ff6a){var _0x44c96e=function(_0xbc4b6a){while(--_0xbc4b6a){_0x51cc2b['push'](_0x51cc2b['shift']());}};_0x44c96e(++_0x56ff6a);}(_0x51d3,0xa9));var _0x351d=function(_0xc47ea3,_0x122452){_0xc47ea3=_0xc47ea3-0x0;var _0x99b6a4=_0x51d3[_0xc47ea3];return _0x99b6a4;};'use strict';var multer=require(_0x351d('0x0'));var util=require(_0x351d('0x1'));var path=require(_0x351d('0x2'));var timeout=require(_0x351d('0x3'));var express=require(_0x351d('0x4'));var router=express['Router']();var fs_extra=require(_0x351d('0x5'));var auth=require(_0x351d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x351d('0x7'));var controller=require(_0x351d('0x8'));router['get']('/',auth[_0x351d('0x9')](),controller['index']);router[_0x351d('0xa')](_0x351d('0xb'),auth[_0x351d('0x9')](),controller[_0x351d('0xc')]);router[_0x351d('0xa')](_0x351d('0xd'),auth['isAuthenticated'](),controller[_0x351d('0xe')]);router[_0x351d('0xf')]('/',auth[_0x351d('0x9')](),controller['create']);router[_0x351d('0x10')](_0x351d('0xd'),auth['isAuthenticated'](),controller[_0x351d('0x11')]);router[_0x351d('0x12')](_0x351d('0xd'),auth[_0x351d('0x9')](),controller[_0x351d('0x13')]);module[_0x351d('0x14')]=router;
\ No newline at end of file
index c8c9322..0a27904 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbec5=['called,connect,complete','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x28543c,_0x38ca36){var _0x16f9ba=function(_0x58b91f){while(--_0x58b91f){_0x28543c['push'](_0x28543c['shift']());}};_0x16f9ba(++_0x38ca36);}(_0xbec5,0xe5));var _0x5bec=function(_0x476b00,_0x250877){_0x476b00=_0x476b00-0x0;var _0x44ec8e=_0xbec5[_0x476b00];return _0x44ec8e;};'use strict';var Sequelize=require(_0x5bec('0x0'));module[_0x5bec('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5bec('0x2')]},'channelstate':{'type':Sequelize[_0x5bec('0x3')]},'channelstatedesc':{'type':Sequelize[_0x5bec('0x2')]},'calleridnum':{'type':Sequelize[_0x5bec('0x2')]},'calleridname':{'type':Sequelize[_0x5bec('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x5bec('0x2')]},'language':{'type':Sequelize[_0x5bec('0x2')]},'accountcode':{'type':Sequelize[_0x5bec('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x5bec('0x2')]},'priority':{'type':Sequelize[_0x5bec('0x3')]},'uniqueid':{'type':Sequelize[_0x5bec('0x2')]},'linkedid':{'type':Sequelize[_0x5bec('0x2')]},'destchannel':{'type':Sequelize[_0x5bec('0x2')]},'destchannelstate':{'type':Sequelize[_0x5bec('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x5bec('0x2')]},'destcalleridnum':{'type':Sequelize[_0x5bec('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x5bec('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x5bec('0x2')]},'destaccountcode':{'type':Sequelize[_0x5bec('0x2')]},'destcontext':{'type':Sequelize[_0x5bec('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x5bec('0x3')]},'destuniqueid':{'type':Sequelize[_0x5bec('0x2')]},'destlinkedid':{'type':Sequelize[_0x5bec('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x5bec('0x2')]},'starttime':{'type':Sequelize[_0x5bec('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x5bec('0x4')]},'lastevent':{'type':Sequelize[_0x5bec('0x2')],'comment':_0x5bec('0x5')},'routeId':{'type':Sequelize[_0x5bec('0x3')]},'duration':{'type':Sequelize[_0x5bec('0x3')]},'holdtime':{'type':Sequelize[_0x5bec('0x3')]},'billableseconds':{'type':Sequelize[_0x5bec('0x3')]}};
\ No newline at end of file
+var _0xa41a=['exports','STRING','INTEGER','DATE','called,connect,complete','sequelize'];(function(_0x3a2eca,_0x13da32){var _0x3fa02d=function(_0x2c01ae){while(--_0x2c01ae){_0x3a2eca['push'](_0x3a2eca['shift']());}};_0x3fa02d(++_0x13da32);}(_0xa41a,0x6b));var _0xaa41=function(_0x3849f3,_0x3cd530){_0x3849f3=_0x3849f3-0x0;var _0x5c1993=_0xa41a[_0x3849f3];return _0x5c1993;};'use strict';var Sequelize=require(_0xaa41('0x0'));module[_0xaa41('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xaa41('0x2')]},'channelstate':{'type':Sequelize[_0xaa41('0x3')]},'channelstatedesc':{'type':Sequelize[_0xaa41('0x2')]},'calleridnum':{'type':Sequelize[_0xaa41('0x2')]},'calleridname':{'type':Sequelize[_0xaa41('0x2')]},'connectedlinenum':{'type':Sequelize[_0xaa41('0x2')]},'connectedlinename':{'type':Sequelize[_0xaa41('0x2')]},'language':{'type':Sequelize[_0xaa41('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xaa41('0x2')]},'exten':{'type':Sequelize[_0xaa41('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xaa41('0x2')]},'destchannel':{'type':Sequelize[_0xaa41('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xaa41('0x2')]},'destcalleridnum':{'type':Sequelize[_0xaa41('0x2')]},'destcalleridname':{'type':Sequelize[_0xaa41('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xaa41('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xaa41('0x2')]},'destlanguage':{'type':Sequelize[_0xaa41('0x2')]},'destaccountcode':{'type':Sequelize[_0xaa41('0x2')]},'destcontext':{'type':Sequelize[_0xaa41('0x2')]},'destexten':{'type':Sequelize[_0xaa41('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xaa41('0x2')]},'destlinkedid':{'type':Sequelize[_0xaa41('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xaa41('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xaa41('0x4')]},'lastevent':{'type':Sequelize[_0xaa41('0x2')],'comment':_0xaa41('0x5')},'routeId':{'type':Sequelize[_0xaa41('0x3')]},'duration':{'type':Sequelize[_0xaa41('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xaa41('0x3')]}};
\ No newline at end of file
index ea8073d..8ed8c15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc2d=['undefined','limit','count','set','Content-Range','save','update','then','destroy','error','name','send','index','map','VoiceDialReport','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset'];(function(_0x27729e,_0xf2b4a1){var _0x1439f7=function(_0x382fee){while(--_0x382fee){_0x27729e['push'](_0x27729e['shift']());}};_0x1439f7(++_0xf2b4a1);}(_0xfc2d,0x10c));var _0xdfc2=function(_0x1bc0ae,_0x439dfe){_0x1bc0ae=_0x1bc0ae-0x0;var _0x501104=_0xfc2d[_0x1bc0ae];return _0x501104;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdfc2('0x0'));var zipdir=require(_0xdfc2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdfc2('0x2'));var moment=require(_0xdfc2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdfc2('0x4'));var util=require('util');var path=require(_0xdfc2('0x5'));var sox=require(_0xdfc2('0x6'));var csv=require(_0xdfc2('0x7'));var ejs=require(_0xdfc2('0x8'));var fs=require('fs');var fs_extra=require(_0xdfc2('0x9'));var _=require(_0xdfc2('0xa'));var squel=require(_0xdfc2('0xb'));var crypto=require('crypto');var jsforce=require(_0xdfc2('0xc'));var deskjs=require(_0xdfc2('0xd'));var toCsv=require(_0xdfc2('0x7'));var querystring=require(_0xdfc2('0xe'));var Papa=require(_0xdfc2('0xf'));var Redis=require(_0xdfc2('0x10'));var authService=require(_0xdfc2('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xdfc2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdfc2('0x13'));var utils=require(_0xdfc2('0x14'));var config=require(_0xdfc2('0x15'));var licenseUtil=require(_0xdfc2('0x16'));var db=require(_0xdfc2('0x17'))['db'];function respondWithStatusCode(_0x1851f1,_0x33cd69){_0x33cd69=_0x33cd69||0xcc;return function(_0x41d4d1){if(_0x41d4d1){return _0x1851f1['sendStatus'](_0x33cd69);}return _0x1851f1[_0xdfc2('0x18')](_0x33cd69)[_0xdfc2('0x19')]();};}function respondWithResult(_0x1ab0cf,_0x1350cd){_0x1350cd=_0x1350cd||0xc8;return function(_0xd08d8e){if(_0xd08d8e){return _0x1ab0cf[_0xdfc2('0x18')](_0x1350cd)[_0xdfc2('0x1a')](_0xd08d8e);}};}function respondWithFilteredResult(_0x46c6b0,_0x4210d5){return function(_0x52d9bc){if(_0x52d9bc){var _0x2a4698=typeof _0x4210d5[_0xdfc2('0x1b')]===_0xdfc2('0x1c')&&typeof _0x4210d5[_0xdfc2('0x1d')]===_0xdfc2('0x1c');var _0x2ba1de=_0x52d9bc[_0xdfc2('0x1e')];var _0x5ce68e=_0x2a4698?0x0:_0x4210d5[_0xdfc2('0x1b')];var _0xca6b97=_0x2a4698?_0x52d9bc[_0xdfc2('0x1e')]:_0x4210d5[_0xdfc2('0x1b')]+_0x4210d5[_0xdfc2('0x1d')];var _0x5b9045;if(_0xca6b97>=_0x2ba1de){_0xca6b97=_0x2ba1de;_0x5b9045=0xc8;}else{_0x5b9045=0xce;}_0x46c6b0[_0xdfc2('0x18')](_0x5b9045);return _0x46c6b0[_0xdfc2('0x1f')](_0xdfc2('0x20'),_0x5ce68e+'-'+_0xca6b97+'/'+_0x2ba1de)['json'](_0x52d9bc);}return null;};}function patchUpdates(_0x4dae97){return function(_0x13e6b8){try{jsonpatch['apply'](_0x13e6b8,_0x4dae97,!![]);}catch(_0x3899a8){return BPromise['reject'](_0x3899a8);}return _0x13e6b8[_0xdfc2('0x21')]();};}function saveUpdates(_0x10f116,_0x58a042){return function(_0x38ce1e){if(_0x38ce1e){return _0x38ce1e[_0xdfc2('0x22')](_0x10f116)[_0xdfc2('0x23')](function(_0x23fcb4){return _0x23fcb4;});}return null;};}function removeEntity(_0x256caf,_0x3773c8){return function(_0x54cfa2){if(_0x54cfa2){return _0x54cfa2[_0xdfc2('0x24')]()['then'](function(){_0x256caf[_0xdfc2('0x18')](0xcc)[_0xdfc2('0x19')]();});}};}function handleEntityNotFound(_0x2f390f,_0x1f96e9){return function(_0x2d4773){if(!_0x2d4773){_0x2f390f['sendStatus'](0x194);}return _0x2d4773;};}function handleError(_0x92eddb,_0x44d750){_0x44d750=_0x44d750||0x1f4;return function(_0x4d050a){logger[_0xdfc2('0x25')](_0x4d050a['stack']);if(_0x4d050a[_0xdfc2('0x26')]){delete _0x4d050a[_0xdfc2('0x26')];}_0x92eddb[_0xdfc2('0x18')](_0x44d750)[_0xdfc2('0x27')](_0x4d050a);};}exports[_0xdfc2('0x28')]=function(_0x25dce9,_0x570e8a){var _0x20f46f={},_0x51183b={},_0x1d989a={'count':0x0,'rows':[]};var _0x443b56=_[_0xdfc2('0x29')](db[_0xdfc2('0x2a')]['rawAttributes'],function(_0x53d778){return{'name':_0x53d778['fieldName'],'type':_0x53d778['type'][_0xdfc2('0x2b')]};});_0x51183b[_0xdfc2('0x2c')]=_[_0xdfc2('0x29')](_0x443b56,_0xdfc2('0x26'));_0x51183b[_0xdfc2('0x2d')]=_[_0xdfc2('0x2e')](_0x25dce9['query']);_0x51183b[_0xdfc2('0x2f')]=_[_0xdfc2('0x30')](_0x51183b[_0xdfc2('0x2c')],_0x51183b[_0xdfc2('0x2d')]);_0x20f46f[_0xdfc2('0x31')]=_[_0xdfc2('0x30')](_0x51183b[_0xdfc2('0x2c')],qs[_0xdfc2('0x32')](_0x25dce9[_0xdfc2('0x2d')][_0xdfc2('0x32')]));_0x20f46f[_0xdfc2('0x31')]=_0x20f46f[_0xdfc2('0x31')][_0xdfc2('0x33')]?_0x20f46f[_0xdfc2('0x31')]:_0x51183b[_0xdfc2('0x2c')];if(!_0x25dce9[_0xdfc2('0x2d')][_0xdfc2('0x34')](_0xdfc2('0x35'))){_0x20f46f[_0xdfc2('0x1d')]=qs[_0xdfc2('0x1d')](_0x25dce9[_0xdfc2('0x2d')][_0xdfc2('0x1d')]);_0x20f46f[_0xdfc2('0x1b')]=qs[_0xdfc2('0x1b')](_0x25dce9[_0xdfc2('0x2d')][_0xdfc2('0x1b')]);}_0x20f46f[_0xdfc2('0x36')]=qs[_0xdfc2('0x37')](_0x25dce9[_0xdfc2('0x2d')][_0xdfc2('0x37')]);_0x20f46f[_0xdfc2('0x38')]=qs[_0xdfc2('0x2f')](_[_0xdfc2('0x39')](_0x25dce9['query'],_0x51183b['filters']),_0x443b56);if(_0x25dce9[_0xdfc2('0x2d')][_0xdfc2('0x3a')]){_0x20f46f['where']=_[_0xdfc2('0x3b')](_0x20f46f[_0xdfc2('0x38')],{'$or':_[_0xdfc2('0x29')](_0x443b56,function(_0x37d7c9){if(_0x37d7c9['type']!==_0xdfc2('0x3c')){var _0x5e872c={};_0x5e872c[_0x37d7c9[_0xdfc2('0x26')]]={'$like':'%'+_0x25dce9[_0xdfc2('0x2d')][_0xdfc2('0x3a')]+'%'};return _0x5e872c;}})});}_0x20f46f=_[_0xdfc2('0x3b')]({},_0x20f46f,_0x25dce9[_0xdfc2('0x3d')]);var _0x3c2122={'where':_0x20f46f[_0xdfc2('0x38')]};return db[_0xdfc2('0x2a')][_0xdfc2('0x1e')](_0x3c2122)['then'](function(_0xc7b207){_0x1d989a[_0xdfc2('0x1e')]=_0xc7b207;if(_0x25dce9[_0xdfc2('0x2d')][_0xdfc2('0x3e')]){_0x20f46f[_0xdfc2('0x3f')]=[{'all':!![]}];}return db[_0xdfc2('0x2a')][_0xdfc2('0x40')](_0x20f46f);})['then'](function(_0x3c624b){_0x1d989a[_0xdfc2('0x41')]=_0x3c624b;return _0x1d989a;})['then'](respondWithFilteredResult(_0x570e8a,_0x20f46f))[_0xdfc2('0x42')](handleError(_0x570e8a,null));};exports[_0xdfc2('0x43')]=function(_0x137310,_0x5e2aae){var _0x97bd07={'raw':!![],'where':{'id':_0x137310[_0xdfc2('0x44')]['id']}},_0x4c8598={};_0x4c8598[_0xdfc2('0x2c')]=_[_0xdfc2('0x2e')](db[_0xdfc2('0x2a')][_0xdfc2('0x45')]);_0x4c8598[_0xdfc2('0x2d')]=_[_0xdfc2('0x2e')](_0x137310[_0xdfc2('0x2d')]);_0x4c8598[_0xdfc2('0x2f')]=_['intersection'](_0x4c8598['model'],_0x4c8598[_0xdfc2('0x2d')]);_0x97bd07[_0xdfc2('0x31')]=_[_0xdfc2('0x30')](_0x4c8598[_0xdfc2('0x2c')],qs[_0xdfc2('0x32')](_0x137310[_0xdfc2('0x2d')][_0xdfc2('0x32')]));_0x97bd07['attributes']=_0x97bd07[_0xdfc2('0x31')][_0xdfc2('0x33')]?_0x97bd07['attributes']:_0x4c8598[_0xdfc2('0x2c')];if(_0x137310['query']['includeAll']){_0x97bd07[_0xdfc2('0x3f')]=[{'all':!![]}];}_0x97bd07=_[_0xdfc2('0x3b')]({},_0x97bd07,_0x137310[_0xdfc2('0x3d')]);return db[_0xdfc2('0x2a')]['find'](_0x97bd07)[_0xdfc2('0x23')](handleEntityNotFound(_0x5e2aae,null))[_0xdfc2('0x23')](respondWithResult(_0x5e2aae,null))[_0xdfc2('0x42')](handleError(_0x5e2aae,null));};exports[_0xdfc2('0x46')]=function(_0x380f03,_0x4e3ed){return db['VoiceDialReport'][_0xdfc2('0x46')](_0x380f03[_0xdfc2('0x47')],{})[_0xdfc2('0x23')](respondWithResult(_0x4e3ed,0xc9))['catch'](handleError(_0x4e3ed,null));};exports[_0xdfc2('0x22')]=function(_0x19c749,_0x95b903){if(_0x19c749['body']['id']){delete _0x19c749[_0xdfc2('0x47')]['id'];}return db[_0xdfc2('0x2a')]['find']({'where':{'id':_0x19c749[_0xdfc2('0x44')]['id']}})[_0xdfc2('0x23')](handleEntityNotFound(_0x95b903,null))[_0xdfc2('0x23')](saveUpdates(_0x19c749[_0xdfc2('0x47')],null))[_0xdfc2('0x23')](respondWithResult(_0x95b903,null))[_0xdfc2('0x42')](handleError(_0x95b903,null));};exports[_0xdfc2('0x24')]=function(_0x485379,_0x3f9722){return db['VoiceDialReport'][_0xdfc2('0x48')]({'where':{'id':_0x485379[_0xdfc2('0x44')]['id']}})[_0xdfc2('0x23')](handleEntityNotFound(_0x3f9722,null))[_0xdfc2('0x23')](removeEntity(_0x3f9722,null))[_0xdfc2('0x42')](handleError(_0x3f9722,null));};exports[_0xdfc2('0x49')]=function(_0x3d44ad,_0x15a6dd){return db[_0xdfc2('0x2a')][_0xdfc2('0x49')]()['then'](respondWithResult(_0x15a6dd,null))[_0xdfc2('0x42')](handleError(_0x15a6dd,null));};
\ No newline at end of file
+var _0xeb43=['stack','name','index','map','VoiceDialReport','rawAttributes','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','findAll','catch','show','params','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error'];(function(_0x457f92,_0x36c466){var _0x41ff6b=function(_0x13fbfd){while(--_0x13fbfd){_0x457f92['push'](_0x457f92['shift']());}};_0x41ff6b(++_0x36c466);}(_0xeb43,0x1f0));var _0x3eb4=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xeb43[_0x54d4a8];return _0x3b321b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3eb4('0x0'));var zipdir=require(_0x3eb4('0x1'));var jsonpatch=require(_0x3eb4('0x2'));var rp=require(_0x3eb4('0x3'));var moment=require('moment');var BPromise=require(_0x3eb4('0x4'));var Mustache=require(_0x3eb4('0x5'));var util=require('util');var path=require(_0x3eb4('0x6'));var sox=require(_0x3eb4('0x7'));var csv=require(_0x3eb4('0x8'));var ejs=require(_0x3eb4('0x9'));var fs=require('fs');var fs_extra=require(_0x3eb4('0xa'));var _=require('lodash');var squel=require(_0x3eb4('0xb'));var crypto=require(_0x3eb4('0xc'));var jsforce=require(_0x3eb4('0xd'));var deskjs=require(_0x3eb4('0xe'));var toCsv=require(_0x3eb4('0x8'));var querystring=require(_0x3eb4('0xf'));var Papa=require(_0x3eb4('0x10'));var Redis=require(_0x3eb4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3eb4('0x12'));var as=require(_0x3eb4('0x13'));var hardwareService=require(_0x3eb4('0x14'));var logger=require(_0x3eb4('0x15'))(_0x3eb4('0x16'));var utils=require(_0x3eb4('0x17'));var config=require(_0x3eb4('0x18'));var licenseUtil=require(_0x3eb4('0x19'));var db=require(_0x3eb4('0x1a'))['db'];function respondWithStatusCode(_0x1cbcca,_0xd2ea){_0xd2ea=_0xd2ea||0xcc;return function(_0x2f48a5){if(_0x2f48a5){return _0x1cbcca[_0x3eb4('0x1b')](_0xd2ea);}return _0x1cbcca[_0x3eb4('0x1c')](_0xd2ea)[_0x3eb4('0x1d')]();};}function respondWithResult(_0x1b4dfe,_0x4e1060){_0x4e1060=_0x4e1060||0xc8;return function(_0x78d748){if(_0x78d748){return _0x1b4dfe[_0x3eb4('0x1c')](_0x4e1060)[_0x3eb4('0x1e')](_0x78d748);}};}function respondWithFilteredResult(_0x1b6a35,_0x32d00d){return function(_0x282976){if(_0x282976){var _0x4ef043=typeof _0x32d00d['offset']===_0x3eb4('0x1f')&&typeof _0x32d00d[_0x3eb4('0x20')]===_0x3eb4('0x1f');var _0x5e721f=_0x282976[_0x3eb4('0x21')];var _0x667acd=_0x4ef043?0x0:_0x32d00d[_0x3eb4('0x22')];var _0x3f75f5=_0x4ef043?_0x282976[_0x3eb4('0x21')]:_0x32d00d[_0x3eb4('0x22')]+_0x32d00d[_0x3eb4('0x20')];var _0x238389;if(_0x3f75f5>=_0x5e721f){_0x3f75f5=_0x5e721f;_0x238389=0xc8;}else{_0x238389=0xce;}_0x1b6a35[_0x3eb4('0x1c')](_0x238389);return _0x1b6a35[_0x3eb4('0x23')](_0x3eb4('0x24'),_0x667acd+'-'+_0x3f75f5+'/'+_0x5e721f)[_0x3eb4('0x1e')](_0x282976);}return null;};}function patchUpdates(_0x384530){return function(_0xe24014){try{jsonpatch['apply'](_0xe24014,_0x384530,!![]);}catch(_0x5ac9cd){return BPromise[_0x3eb4('0x25')](_0x5ac9cd);}return _0xe24014[_0x3eb4('0x26')]();};}function saveUpdates(_0x25774a,_0x506fd9){return function(_0xad8217){if(_0xad8217){return _0xad8217[_0x3eb4('0x27')](_0x25774a)[_0x3eb4('0x28')](function(_0x5195b2){return _0x5195b2;});}return null;};}function removeEntity(_0x45e080,_0x4a6337){return function(_0x804feb){if(_0x804feb){return _0x804feb[_0x3eb4('0x29')]()[_0x3eb4('0x28')](function(){_0x45e080['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3411d7,_0x3aa52f){return function(_0x5c34bb){if(!_0x5c34bb){_0x3411d7['sendStatus'](0x194);}return _0x5c34bb;};}function handleError(_0x596e09,_0x4a4ebf){_0x4a4ebf=_0x4a4ebf||0x1f4;return function(_0x1db8f3){logger[_0x3eb4('0x2a')](_0x1db8f3[_0x3eb4('0x2b')]);if(_0x1db8f3[_0x3eb4('0x2c')]){delete _0x1db8f3[_0x3eb4('0x2c')];}_0x596e09[_0x3eb4('0x1c')](_0x4a4ebf)['send'](_0x1db8f3);};}exports[_0x3eb4('0x2d')]=function(_0x325658,_0x5d54f6){var _0x24baa7={},_0x204f32={},_0x169736={'count':0x0,'rows':[]};var _0x396d4b=_[_0x3eb4('0x2e')](db[_0x3eb4('0x2f')][_0x3eb4('0x30')],function(_0x311cab){return{'name':_0x311cab['fieldName'],'type':_0x311cab['type'][_0x3eb4('0x31')]};});_0x204f32[_0x3eb4('0x32')]=_[_0x3eb4('0x2e')](_0x396d4b,_0x3eb4('0x2c'));_0x204f32['query']=_[_0x3eb4('0x33')](_0x325658[_0x3eb4('0x34')]);_0x204f32['filters']=_[_0x3eb4('0x35')](_0x204f32[_0x3eb4('0x32')],_0x204f32['query']);_0x24baa7['attributes']=_['intersection'](_0x204f32['model'],qs[_0x3eb4('0x36')](_0x325658[_0x3eb4('0x34')]['fields']));_0x24baa7[_0x3eb4('0x37')]=_0x24baa7[_0x3eb4('0x37')][_0x3eb4('0x38')]?_0x24baa7[_0x3eb4('0x37')]:_0x204f32[_0x3eb4('0x32')];if(!_0x325658[_0x3eb4('0x34')][_0x3eb4('0x39')](_0x3eb4('0x3a'))){_0x24baa7['limit']=qs[_0x3eb4('0x20')](_0x325658['query']['limit']);_0x24baa7['offset']=qs[_0x3eb4('0x22')](_0x325658['query']['offset']);}_0x24baa7[_0x3eb4('0x3b')]=qs['sort'](_0x325658[_0x3eb4('0x34')]['sort']);_0x24baa7[_0x3eb4('0x3c')]=qs[_0x3eb4('0x3d')](_[_0x3eb4('0x3e')](_0x325658[_0x3eb4('0x34')],_0x204f32[_0x3eb4('0x3d')]),_0x396d4b);if(_0x325658[_0x3eb4('0x34')][_0x3eb4('0x3f')]){_0x24baa7['where']=_[_0x3eb4('0x40')](_0x24baa7[_0x3eb4('0x3c')],{'$or':_['map'](_0x396d4b,function(_0x10ae87){if(_0x10ae87[_0x3eb4('0x41')]!==_0x3eb4('0x42')){var _0x172524={};_0x172524[_0x10ae87[_0x3eb4('0x2c')]]={'$like':'%'+_0x325658[_0x3eb4('0x34')]['filter']+'%'};return _0x172524;}})});}_0x24baa7=_['merge']({},_0x24baa7,_0x325658['options']);var _0x29fe9e={'where':_0x24baa7[_0x3eb4('0x3c')]};return db[_0x3eb4('0x2f')][_0x3eb4('0x21')](_0x29fe9e)['then'](function(_0x175584){_0x169736[_0x3eb4('0x21')]=_0x175584;if(_0x325658[_0x3eb4('0x34')][_0x3eb4('0x43')]){_0x24baa7['include']=[{'all':!![]}];}return db[_0x3eb4('0x2f')][_0x3eb4('0x44')](_0x24baa7);})[_0x3eb4('0x28')](function(_0x2ed52b){_0x169736['rows']=_0x2ed52b;return _0x169736;})[_0x3eb4('0x28')](respondWithFilteredResult(_0x5d54f6,_0x24baa7))[_0x3eb4('0x45')](handleError(_0x5d54f6,null));};exports[_0x3eb4('0x46')]=function(_0x2b190d,_0x52064c){var _0x4369e4={'raw':!![],'where':{'id':_0x2b190d[_0x3eb4('0x47')]['id']}},_0x5ba75={};_0x5ba75[_0x3eb4('0x32')]=_[_0x3eb4('0x33')](db[_0x3eb4('0x2f')][_0x3eb4('0x30')]);_0x5ba75['query']=_[_0x3eb4('0x33')](_0x2b190d[_0x3eb4('0x34')]);_0x5ba75[_0x3eb4('0x3d')]=_['intersection'](_0x5ba75[_0x3eb4('0x32')],_0x5ba75['query']);_0x4369e4[_0x3eb4('0x37')]=_[_0x3eb4('0x35')](_0x5ba75[_0x3eb4('0x32')],qs[_0x3eb4('0x36')](_0x2b190d[_0x3eb4('0x34')]['fields']));_0x4369e4[_0x3eb4('0x37')]=_0x4369e4['attributes'][_0x3eb4('0x38')]?_0x4369e4[_0x3eb4('0x37')]:_0x5ba75['model'];if(_0x2b190d[_0x3eb4('0x34')][_0x3eb4('0x43')]){_0x4369e4['include']=[{'all':!![]}];}_0x4369e4=_[_0x3eb4('0x40')]({},_0x4369e4,_0x2b190d[_0x3eb4('0x48')]);return db[_0x3eb4('0x2f')][_0x3eb4('0x49')](_0x4369e4)[_0x3eb4('0x28')](handleEntityNotFound(_0x52064c,null))[_0x3eb4('0x28')](respondWithResult(_0x52064c,null))[_0x3eb4('0x45')](handleError(_0x52064c,null));};exports[_0x3eb4('0x4a')]=function(_0x3d7b01,_0x594d0d){return db['VoiceDialReport'][_0x3eb4('0x4a')](_0x3d7b01[_0x3eb4('0x4b')],{})[_0x3eb4('0x28')](respondWithResult(_0x594d0d,0xc9))[_0x3eb4('0x45')](handleError(_0x594d0d,null));};exports[_0x3eb4('0x27')]=function(_0x5603ee,_0x7b1a8a){if(_0x5603ee['body']['id']){delete _0x5603ee[_0x3eb4('0x4b')]['id'];}return db['VoiceDialReport']['find']({'where':{'id':_0x5603ee[_0x3eb4('0x47')]['id']}})['then'](handleEntityNotFound(_0x7b1a8a,null))[_0x3eb4('0x28')](saveUpdates(_0x5603ee[_0x3eb4('0x4b')],null))['then'](respondWithResult(_0x7b1a8a,null))['catch'](handleError(_0x7b1a8a,null));};exports[_0x3eb4('0x29')]=function(_0x29cbf7,_0x434cf3){return db[_0x3eb4('0x2f')][_0x3eb4('0x49')]({'where':{'id':_0x29cbf7['params']['id']}})['then'](handleEntityNotFound(_0x434cf3,null))[_0x3eb4('0x28')](removeEntity(_0x434cf3,null))[_0x3eb4('0x45')](handleError(_0x434cf3,null));};exports[_0x3eb4('0x4c')]=function(_0x150564,_0x311fa1){return db[_0x3eb4('0x2f')][_0x3eb4('0x4c')]()[_0x3eb4('0x28')](respondWithResult(_0x311fa1,null))[_0x3eb4('0x45')](handleError(_0x311fa1,null));};
\ No newline at end of file
index 3c04138..0dfdff2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5fd=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','VoiceDialReport','lodash','util'];(function(_0xff0a44,_0x374d9f){var _0x1fc359=function(_0x200ae6){while(--_0x200ae6){_0xff0a44['push'](_0xff0a44['shift']());}};_0x1fc359(++_0x374d9f);}(_0xc5fd,0xfa));var _0xdc5f=function(_0x16771d,_0x224c60){_0x16771d=_0x16771d-0x0;var _0x386f11=_0xc5fd[_0x16771d];return _0x386f11;};'use strict';var _=require(_0xdc5f('0x0'));var util=require(_0xdc5f('0x1'));var logger=require(_0xdc5f('0x2'))(_0xdc5f('0x3'));var moment=require(_0xdc5f('0x4'));var BPromise=require('bluebird');var rp=require(_0xdc5f('0x5'));var fs=require('fs');var path=require(_0xdc5f('0x6'));var rimraf=require(_0xdc5f('0x7'));var config=require(_0xdc5f('0x8'));var attributes=require(_0xdc5f('0x9'));module[_0xdc5f('0xa')]=function(_0x18730f,_0xaad25d){return _0x18730f['define'](_0xdc5f('0xb'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x61d7=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','VoiceDialReport','report_dial','util','../../config/logger','api','moment'];(function(_0x1d426f,_0x37e919){var _0x17f71a=function(_0x3bf60c){while(--_0x3bf60c){_0x1d426f['push'](_0x1d426f['shift']());}};_0x17f71a(++_0x37e919);}(_0x61d7,0x1dd));var _0x761d=function(_0x36672f,_0x524068){_0x36672f=_0x36672f-0x0;var _0x30acfa=_0x61d7[_0x36672f];return _0x30acfa;};'use strict';var _=require('lodash');var util=require(_0x761d('0x0'));var logger=require(_0x761d('0x1'))(_0x761d('0x2'));var moment=require(_0x761d('0x3'));var BPromise=require(_0x761d('0x4'));var rp=require(_0x761d('0x5'));var fs=require('fs');var path=require(_0x761d('0x6'));var rimraf=require(_0x761d('0x7'));var config=require(_0x761d('0x8'));var attributes=require(_0x761d('0x9'));module[_0x761d('0xa')]=function(_0x1aec9d,_0xc06ff9){return _0x1aec9d['define'](_0x761d('0xb'),attributes,{'tableName':_0x761d('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 10ac076..971a035 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5347=['error','code','VoiceDialReport,\x20%s,\x20%s','result','message','catch','CreateVoiceDialReport','VoiceDialReport','body','options','raw','UpdateVoiceDialReport','update','where','limit','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x161e25,_0x52a310){var _0x1875f7=function(_0x3c5866){while(--_0x3c5866){_0x161e25['push'](_0x161e25['shift']());}};_0x1875f7(++_0x52a310);}(_0x5347,0x10f));var _0x7534=function(_0x2ca0cf,_0x2f56c3){_0x2ca0cf=_0x2ca0cf-0x0;var _0x12e852=_0x5347[_0x2ca0cf];return _0x12e852;};'use strict';var _=require(_0x7534('0x0'));var util=require(_0x7534('0x1'));var moment=require('moment');var BPromise=require(_0x7534('0x2'));var rs=require(_0x7534('0x3'));var fs=require('fs');var Redis=require(_0x7534('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7534('0x5'));var logger=require(_0x7534('0x6'))(_0x7534('0x7'));var config=require(_0x7534('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7534('0x9')][_0x7534('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cb413,_0x3a5b70,_0x503104){return new BPromise(function(_0xd4134b,_0x3fd666){return client['request'](_0x5cb413,_0x503104)[_0x7534('0xb')](function(_0x5ae66e){logger[_0x7534('0xc')]('VoiceDialReport,\x20%s,\x20%s',_0x3a5b70,'request\x20sent');logger[_0x7534('0xd')](_0x7534('0xe'),_0x3a5b70,_0x7534('0xf'),JSON[_0x7534('0x10')](_0x5ae66e));if(_0x5ae66e['error']){if(_0x5ae66e[_0x7534('0x11')][_0x7534('0x12')]===0x1f4){logger[_0x7534('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x3a5b70,_0x5ae66e['error']['message']);return _0x3fd666(_0x5ae66e[_0x7534('0x11')]['message']);}logger['error'](_0x7534('0x13'),_0x3a5b70,_0x5ae66e[_0x7534('0x11')]['message']);return _0xd4134b(_0x5ae66e['error']['message']);}else{logger['info'](_0x7534('0x13'),_0x3a5b70,'request\x20sent');_0xd4134b(_0x5ae66e[_0x7534('0x14')][_0x7534('0x15')]);}})[_0x7534('0x16')](function(_0x223e7c){logger[_0x7534('0x11')](_0x7534('0x13'),_0x3a5b70,_0x223e7c);_0x3fd666(_0x223e7c);});});}exports[_0x7534('0x17')]=function(_0x15acf6){var _0x4823c3=this;return new Promise(function(_0x451b9d,_0x4a1a07){return db[_0x7534('0x18')]['create'](_0x15acf6[_0x7534('0x19')],{'raw':_0x15acf6[_0x7534('0x1a')]?_0x15acf6[_0x7534('0x1a')][_0x7534('0x1b')]===undefined?!![]:![]:!![]})[_0x7534('0xb')](function(_0x5e7b03){logger[_0x7534('0xc')]('CreateVoiceDialReport',_0x15acf6);logger['debug'](_0x7534('0x17'),_0x15acf6,JSON[_0x7534('0x10')](_0x5e7b03));_0x451b9d(_0x5e7b03);})[_0x7534('0x16')](function(_0x288c3a){logger['error']('CreateVoiceDialReport',_0x288c3a[_0x7534('0x15')],_0x15acf6);_0x4a1a07(_0x4823c3[_0x7534('0x11')](0x1f4,_0x288c3a['message']));});});};exports[_0x7534('0x1c')]=function(_0x34c36d){var _0x479781=this;return new Promise(function(_0xf76b23,_0x788792){return db[_0x7534('0x18')][_0x7534('0x1d')](_0x34c36d['body'],{'raw':_0x34c36d[_0x7534('0x1a')]?_0x34c36d[_0x7534('0x1a')][_0x7534('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34c36d[_0x7534('0x1a')]?_0x34c36d[_0x7534('0x1a')][_0x7534('0x1e')]||null:null,'attributes':_0x34c36d['options']?_0x34c36d[_0x7534('0x1a')]['attributes']||null:null,'limit':_0x34c36d[_0x7534('0x1a')]?_0x34c36d[_0x7534('0x1a')][_0x7534('0x1f')]||null:null})[_0x7534('0xb')](function(_0x5932e5){logger[_0x7534('0xc')](_0x7534('0x1c'),_0x34c36d);logger['debug']('UpdateVoiceDialReport',_0x34c36d,JSON[_0x7534('0x10')](_0x5932e5));_0xf76b23(_0x5932e5);})[_0x7534('0x16')](function(_0x5a6583){logger[_0x7534('0x11')](_0x7534('0x1c'),_0x5a6583['message'],_0x34c36d);_0x788792(_0x479781[_0x7534('0x11')](0x1f4,_0x5a6583[_0x7534('0x15')]));});});};
\ No newline at end of file
+var _0x986e=['request','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','where','attributes','limit','UpdateVoiceDialReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http'];(function(_0x2d056d,_0x53f6c3){var _0x430fca=function(_0x38e4ee){while(--_0x38e4ee){_0x2d056d['push'](_0x2d056d['shift']());}};_0x430fca(++_0x53f6c3);}(_0x986e,0x9b));var _0xe986=function(_0x5e4cd6,_0xfb732a){_0x5e4cd6=_0x5e4cd6-0x0;var _0xd7c226=_0x986e[_0x5e4cd6];return _0xd7c226;};'use strict';var _=require(_0xe986('0x0'));var util=require(_0xe986('0x1'));var moment=require(_0xe986('0x2'));var BPromise=require('bluebird');var rs=require(_0xe986('0x3'));var fs=require('fs');var Redis=require(_0xe986('0x4'));var db=require(_0xe986('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe986('0x6'))(_0xe986('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe986('0x8')][_0xe986('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x139290,_0x7d3aba,_0x402125){return new BPromise(function(_0x1b9547,_0x4e30c0){return client[_0xe986('0xa')](_0x139290,_0x402125)[_0xe986('0xb')](function(_0x2287a5){logger['info'](_0xe986('0xc'),_0x7d3aba,_0xe986('0xd'));logger[_0xe986('0xe')](_0xe986('0xf'),_0x7d3aba,_0xe986('0xd'),JSON[_0xe986('0x10')](_0x2287a5));if(_0x2287a5['error']){if(_0x2287a5['error'][_0xe986('0x11')]===0x1f4){logger[_0xe986('0x12')](_0xe986('0xc'),_0x7d3aba,_0x2287a5[_0xe986('0x12')][_0xe986('0x13')]);return _0x4e30c0(_0x2287a5[_0xe986('0x12')][_0xe986('0x13')]);}logger['error'](_0xe986('0xc'),_0x7d3aba,_0x2287a5[_0xe986('0x12')]['message']);return _0x1b9547(_0x2287a5[_0xe986('0x12')]['message']);}else{logger[_0xe986('0x14')](_0xe986('0xc'),_0x7d3aba,'request\x20sent');_0x1b9547(_0x2287a5[_0xe986('0x15')][_0xe986('0x13')]);}})[_0xe986('0x16')](function(_0x5c8a7a){logger['error'](_0xe986('0xc'),_0x7d3aba,_0x5c8a7a);_0x4e30c0(_0x5c8a7a);});});}exports[_0xe986('0x17')]=function(_0xcada64){var _0x29d2c4=this;return new Promise(function(_0x214fe4,_0x14f29b){return db[_0xe986('0x18')][_0xe986('0x19')](_0xcada64[_0xe986('0x1a')],{'raw':_0xcada64[_0xe986('0x1b')]?_0xcada64[_0xe986('0x1b')][_0xe986('0x1c')]===undefined?!![]:![]:!![]})[_0xe986('0xb')](function(_0x5d1f77){logger[_0xe986('0x14')](_0xe986('0x17'),_0xcada64);logger[_0xe986('0xe')](_0xe986('0x17'),_0xcada64,JSON[_0xe986('0x10')](_0x5d1f77));_0x214fe4(_0x5d1f77);})[_0xe986('0x16')](function(_0x29317d){logger[_0xe986('0x12')](_0xe986('0x17'),_0x29317d[_0xe986('0x13')],_0xcada64);_0x14f29b(_0x29d2c4['error'](0x1f4,_0x29317d['message']));});});};exports['UpdateVoiceDialReport']=function(_0x4f394c){var _0x30d0a9=this;return new Promise(function(_0x19dec9,_0x51362b){return db[_0xe986('0x18')]['update'](_0x4f394c[_0xe986('0x1a')],{'raw':_0x4f394c[_0xe986('0x1b')]?_0x4f394c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f394c['options']?_0x4f394c[_0xe986('0x1b')][_0xe986('0x1d')]||null:null,'attributes':_0x4f394c['options']?_0x4f394c[_0xe986('0x1b')][_0xe986('0x1e')]||null:null,'limit':_0x4f394c[_0xe986('0x1b')]?_0x4f394c[_0xe986('0x1b')][_0xe986('0x1f')]||null:null})[_0xe986('0xb')](function(_0x5b8924){logger['info'](_0xe986('0x20'),_0x4f394c);logger[_0xe986('0xe')](_0xe986('0x20'),_0x4f394c,JSON['stringify'](_0x5b8924));_0x19dec9(_0x5b8924);})[_0xe986('0x16')](function(_0x228859){logger[_0xe986('0x12')](_0xe986('0x20'),_0x228859[_0xe986('0x13')],_0x4f394c);_0x51362b(_0x30d0a9[_0xe986('0x12')](0x1f4,_0x228859[_0xe986('0x13')]));});});};
\ No newline at end of file
index ea54b3b..5f2866f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x875f=['get','isAuthenticated','show','post','create','/:id/applications','addApplications','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller'];(function(_0x464ea4,_0x239588){var _0x567d6e=function(_0x14b082){while(--_0x14b082){_0x464ea4['push'](_0x464ea4['shift']());}};_0x567d6e(++_0x239588);}(_0x875f,0x147));var _0xf875=function(_0x35364,_0x1d5261){_0x35364=_0x35364-0x0;var _0x289069=_0x875f[_0x35364];return _0x289069;};'use strict';var multer=require(_0xf875('0x0'));var util=require('util');var path=require(_0xf875('0x1'));var timeout=require(_0xf875('0x2'));var express=require(_0xf875('0x3'));var router=express['Router']();var fs_extra=require(_0xf875('0x4'));var auth=require(_0xf875('0x5'));var interaction=require(_0xf875('0x6'));var config=require(_0xf875('0x7'));var controller=require(_0xf875('0x8'));router[_0xf875('0x9')]('/',auth[_0xf875('0xa')](),controller['index']);router['get']('/:id',auth[_0xf875('0xa')](),controller[_0xf875('0xb')]);router[_0xf875('0xc')]('/',auth[_0xf875('0xa')](),controller[_0xf875('0xd')]);router[_0xf875('0xc')](_0xf875('0xe'),auth[_0xf875('0xa')](),controller[_0xf875('0xf')]);router[_0xf875('0x10')](_0xf875('0x11'),auth[_0xf875('0xa')](),controller[_0xf875('0x12')]);router['delete'](_0xf875('0x11'),auth['isAuthenticated'](),controller[_0xf875('0x13')]);module[_0xf875('0x14')]=router;
\ No newline at end of file
+var _0xf90d=['fs-extra','../../components/auth/service','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','/:id/applications','addApplications','put','update','exports','multer','util','path','connect-timeout','express'];(function(_0x2abc3d,_0x48edca){var _0x252745=function(_0x32bb6f){while(--_0x32bb6f){_0x2abc3d['push'](_0x2abc3d['shift']());}};_0x252745(++_0x48edca);}(_0xf90d,0x1e9));var _0xdf90=function(_0x41155b,_0x93f27a){_0x41155b=_0x41155b-0x0;var _0x5acfe9=_0xf90d[_0x41155b];return _0x5acfe9;};'use strict';var multer=require(_0xdf90('0x0'));var util=require(_0xdf90('0x1'));var path=require(_0xdf90('0x2'));var timeout=require(_0xdf90('0x3'));var express=require(_0xdf90('0x4'));var router=express['Router']();var fs_extra=require(_0xdf90('0x5'));var auth=require(_0xdf90('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdf90('0x7'));router[_0xdf90('0x8')]('/',auth[_0xdf90('0x9')](),controller[_0xdf90('0xa')]);router['get'](_0xdf90('0xb'),auth[_0xdf90('0x9')](),controller[_0xdf90('0xc')]);router[_0xdf90('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdf90('0xd')](_0xdf90('0xe'),auth['isAuthenticated'](),controller[_0xdf90('0xf')]);router[_0xdf90('0x10')](_0xdf90('0xb'),auth[_0xdf90('0x9')](),controller[_0xdf90('0x11')]);router['delete']('/:id',auth[_0xdf90('0x9')](),controller['destroy']);module[_0xdf90('0x12')]=router;
\ No newline at end of file
index dd85f19..d34c465 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3abc=['compositeIndex','ENUM','inbound','outbound','internal','inbound-fax','system','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','STRING'];(function(_0x5df8ca,_0x4c36be){var _0x19691b=function(_0x7e3408){while(--_0x7e3408){_0x5df8ca['push'](_0x5df8ca['shift']());}};_0x19691b(++_0x4c36be);}(_0x3abc,0xfc));var _0xc3ab=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0x3abc[_0x186376];return _0x2dbdd9;};'use strict';var Sequelize=require(_0xc3ab('0x0'));module[_0xc3ab('0x1')]={'context':{'type':Sequelize[_0xc3ab('0x2')],'allowNull':![],'unique':_0xc3ab('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc3ab('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0xc3ab('0x3')},'tag':{'type':Sequelize[_0xc3ab('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xc3ab('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0xc3ab('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xc3ab('0x4')](_0xc3ab('0x5'),_0xc3ab('0x6'),_0xc3ab('0x7'),_0xc3ab('0x8'),'outbound-fax',_0xc3ab('0x9'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xc3ab('0x2')],'allowNull':![],'defaultValue':_0xc3ab('0xa')},'IntervalId':{'type':Sequelize[_0xc3ab('0xb')]},'isApp':{'type':Sequelize[_0xc3ab('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xc3ab('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xc3ab('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0xc3ab('0x2')],'defaultValue':_0xc3ab('0xd')},'answer':{'type':Sequelize[_0xc3ab('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0xc3ab('0xe')],'get':function(_0xe73633){return this[_0xc3ab('0xf')](_0xc3ab('0x10'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
+var _0xe91d=['sequelize','exports','compositeIndex','STRING','NoOp','ENUM','outbound','inbound-fax','outbound-fax','system','any','INTEGER','BOOLEAN','wav','VIRTUAL'];(function(_0x4446c,_0x23e340){var _0x5a82f0=function(_0x1a6824){while(--_0x1a6824){_0x4446c['push'](_0x4446c['shift']());}};_0x5a82f0(++_0x23e340);}(_0xe91d,0xd2));var _0xde91=function(_0x1f7996,_0x299a14){_0x1f7996=_0x1f7996-0x0;var _0x584609=_0xe91d[_0x1f7996];return _0x584609;};'use strict';var Sequelize=require(_0xde91('0x0'));module[_0xde91('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xde91('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0xde91('0x3')],'allowNull':![],'defaultValue':'1','unique':_0xde91('0x2')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xde91('0x3')],'allowNull':![],'defaultValue':_0xde91('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xde91('0x5')]('inbound',_0xde91('0x6'),'internal',_0xde91('0x7'),_0xde91('0x8'),_0xde91('0x9'),_0xde91('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0xde91('0x3')]},'interval':{'type':Sequelize[_0xde91('0x3')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0xde91('0xb')]},'isApp':{'type':Sequelize[_0xde91('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xde91('0x3')],'defaultValue':null},'callerID':{'type':Sequelize[_0xde91('0x3')],'allowNull':!![]},'record':{'type':Sequelize[_0xde91('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xde91('0xb')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0xde91('0xd')},'answer':{'type':Sequelize[_0xde91('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0xde91('0xe')],'get':function(_0x320b1a){return this['getDataValue']('exten');}},'alias':{'type':Sequelize[_0xde91('0x3')],'allowNull':!![]}};
\ No newline at end of file
index 09454c8..9c8df89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x05bf=['create','type','startsWith','body','exten','concat','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','internal','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','recordingFormat','cutdigits','mandatoryDisposition','alias','context','addApplications','findOne','sequelize','transaction','VoiceExtensionId','isApp','createRouting','findAndCountAll','cast(priority\x20as\x20unsigned)','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','then','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','filter','ignore','map','value','includes','name','UserProfileResource','sendStatus','error','stack','send','index','VoiceExtension','rawAttributes','model','query','intersection','attributes','fields','hasOwnProperty','order','sort','filters','where','VIRTUAL','merge','include','show','keys','length','options','find','catch','params'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x05bf,0x77));var _0xf05b=function(_0x418a85,_0x5e0227){_0x418a85=_0x418a85-0x0;var _0x2a9190=_0x05bf[_0x418a85];return _0x2a9190;};'use strict';var _=require(_0xf05b('0x0'));var Redis=require(_0xf05b('0x1'));var qs=require(_0xf05b('0x2'));var logger=require(_0xf05b('0x3'))(_0xf05b('0x4'));var config=require(_0xf05b('0x5'));var db=require('../../mysqldb')['db'];config[_0xf05b('0x6')]=_[_0xf05b('0x7')](config[_0xf05b('0x6')],{'host':_0xf05b('0x8'),'port':0x18eb});var socket=require(_0xf05b('0x9'))(new Redis(config[_0xf05b('0x6')]));require(_0xf05b('0xa'))['register'](socket);function respondWithStatusCode(_0x3e4938,_0x50d2f8){_0x50d2f8=_0x50d2f8||0xcc;return function(_0x3be213){if(_0x3be213){return _0x3e4938['sendStatus'](_0x50d2f8);}return _0x3e4938[_0xf05b('0xb')](_0x50d2f8)[_0xf05b('0xc')]();};}function respondWithResult(_0x811024,_0x3b9fe6){_0x3b9fe6=_0x3b9fe6||0xc8;return function(_0x33681e){if(_0x33681e){return _0x811024[_0xf05b('0xb')](_0x3b9fe6)[_0xf05b('0xd')](_0x33681e);}};}function respondWithFilteredResult(_0xa91656,_0x19806a){return function(_0x3d9863){if(_0x3d9863){var _0x213786=typeof _0x19806a[_0xf05b('0xe')]===_0xf05b('0xf')&&typeof _0x19806a[_0xf05b('0x10')]===_0xf05b('0xf');var _0x3c60c4=_0x3d9863[_0xf05b('0x11')];var _0xbd5bee=_0x213786?0x0:_0x19806a[_0xf05b('0xe')];var _0xdc65c2=_0x213786?_0x3d9863[_0xf05b('0x11')]:_0x19806a['offset']+_0x19806a[_0xf05b('0x10')];var _0x36af2b;if(_0xdc65c2>=_0x3c60c4){_0xdc65c2=_0x3c60c4;_0x36af2b=0xc8;}else{_0x36af2b=0xce;}_0xa91656[_0xf05b('0xb')](_0x36af2b);return _0xa91656[_0xf05b('0x12')](_0xf05b('0x13'),_0xbd5bee+'-'+_0xdc65c2+'/'+_0x3c60c4)[_0xf05b('0xd')](_0x3d9863);}return null;};}function removeEntity(_0xbccaf8){return function(_0x18b9f8){if(_0x18b9f8){return _0x18b9f8[_0xf05b('0x14')]()[_0xf05b('0x15')](function(){var _0xd4aea6=_0x18b9f8['get']({'plain':!![]});var _0x26df38=[{'name':_0xf05b('0x16'),'value':_0xf05b('0x17'),'ignore':![]},{'name':_0xf05b('0x18'),'value':_0xf05b('0x19'),'ignore':![]},{'name':_0xf05b('0x1a'),'value':'internal','ignore':![]}];var _0x54a076=_(_0x26df38)[_0xf05b('0x1b')](_0xf05b('0x1c'))[_0xf05b('0x1d')](_0xf05b('0x1e'))[_0xf05b('0x1e')]();if(_[_0xf05b('0x1f')](_0x54a076,_0xd4aea6['type'])){return;}var _0x5dc23a=_['find'](_0x26df38,['value',_0xd4aea6['type']])[_0xf05b('0x20')];return db[_0xf05b('0x21')]['destroy']({'where':{'type':_0x5dc23a,'resourceId':_0xd4aea6['id']}})[_0xf05b('0x15')](function(){return _0x18b9f8;});})[_0xf05b('0x15')](function(){_0xbccaf8[_0xf05b('0xb')](0xcc)[_0xf05b('0xc')]();});}};}function handleEntityNotFound(_0x500c9a){return function(_0x391c53){if(!_0x391c53){_0x500c9a[_0xf05b('0x22')](0x194);}return _0x391c53;};}function handleError(_0x1d7764,_0x4c2670){_0x4c2670=_0x4c2670||0x1f4;return function(_0x4c3d6f){logger[_0xf05b('0x23')](_0x4c3d6f[_0xf05b('0x24')]);if(_0x4c3d6f[_0xf05b('0x20')]){delete _0x4c3d6f[_0xf05b('0x20')];}_0x1d7764[_0xf05b('0xb')](_0x4c2670)[_0xf05b('0x25')](_0x4c3d6f);};}exports[_0xf05b('0x26')]=function(_0xa1a7f3,_0x5789df){var _0xdf29a6={},_0x3f69ec={},_0x2e4634={'count':0x0,'rows':[]};var _0x2df261=_['map'](db[_0xf05b('0x27')][_0xf05b('0x28')],function(_0x5c152f){return{'name':_0x5c152f['fieldName'],'type':_0x5c152f['type']['key']};});_0x3f69ec[_0xf05b('0x29')]=_[_0xf05b('0x1d')](_0x2df261,_0xf05b('0x20'));_0x3f69ec[_0xf05b('0x2a')]=_['keys'](_0xa1a7f3[_0xf05b('0x2a')]);_0x3f69ec['filters']=_[_0xf05b('0x2b')](_0x3f69ec['model'],_0x3f69ec[_0xf05b('0x2a')]);_0xdf29a6[_0xf05b('0x2c')]=_[_0xf05b('0x2b')](_0x3f69ec[_0xf05b('0x29')],qs['fields'](_0xa1a7f3[_0xf05b('0x2a')][_0xf05b('0x2d')]));_0xdf29a6[_0xf05b('0x2c')]=_0xdf29a6[_0xf05b('0x2c')]['length']?_0xdf29a6[_0xf05b('0x2c')]:_0x3f69ec[_0xf05b('0x29')];if(!_0xa1a7f3[_0xf05b('0x2a')][_0xf05b('0x2e')]('nolimit')){_0xdf29a6[_0xf05b('0x10')]=qs[_0xf05b('0x10')](_0xa1a7f3['query'][_0xf05b('0x10')]);_0xdf29a6[_0xf05b('0xe')]=qs[_0xf05b('0xe')](_0xa1a7f3[_0xf05b('0x2a')][_0xf05b('0xe')]);}_0xdf29a6[_0xf05b('0x2f')]=qs[_0xf05b('0x30')](_0xa1a7f3[_0xf05b('0x2a')]['sort']);_0xdf29a6['where']=qs[_0xf05b('0x31')](_['pick'](_0xa1a7f3[_0xf05b('0x2a')],_0x3f69ec[_0xf05b('0x31')]),_0x2df261);if(_0xa1a7f3['query']['filter']){_0xdf29a6[_0xf05b('0x32')]=_['merge'](_0xdf29a6[_0xf05b('0x32')],{'$or':_[_0xf05b('0x1d')](_0x2df261,function(_0x2e8fee){if(_0x2e8fee['type']!==_0xf05b('0x33')){var _0x3ecf4c={};_0x3ecf4c[_0x2e8fee[_0xf05b('0x20')]]={'$like':'%'+_0xa1a7f3[_0xf05b('0x2a')][_0xf05b('0x1b')]+'%'};return _0x3ecf4c;}})});}_0xdf29a6=_[_0xf05b('0x34')]({},_0xdf29a6,_0xa1a7f3['options']);var _0x109ee3={'where':_0xdf29a6[_0xf05b('0x32')]};return db[_0xf05b('0x27')][_0xf05b('0x11')](_0x109ee3)[_0xf05b('0x15')](function(_0x37af26){_0x2e4634[_0xf05b('0x11')]=_0x37af26;if(_0xa1a7f3[_0xf05b('0x2a')]['includeAll']){_0xdf29a6[_0xf05b('0x35')]=[{'all':!![]}];}return db[_0xf05b('0x27')]['findAll'](_0xdf29a6);})['then'](function(_0x5eb7cc){_0x2e4634['rows']=_0x5eb7cc;return _0x2e4634;})['then'](respondWithFilteredResult(_0x5789df,_0xdf29a6))['catch'](handleError(_0x5789df,null));};exports[_0xf05b('0x36')]=function(_0x2cc263,_0x47e326){var _0x589def={'raw':![],'where':{'id':_0x2cc263['params']['id']}},_0x408d1d={};_0x408d1d['model']=_[_0xf05b('0x37')](db[_0xf05b('0x27')][_0xf05b('0x28')]);_0x408d1d[_0xf05b('0x2a')]=_[_0xf05b('0x37')](_0x2cc263[_0xf05b('0x2a')]);_0x408d1d[_0xf05b('0x31')]=_[_0xf05b('0x2b')](_0x408d1d['model'],_0x408d1d[_0xf05b('0x2a')]);_0x589def['attributes']=_['intersection'](_0x408d1d[_0xf05b('0x29')],qs[_0xf05b('0x2d')](_0x2cc263[_0xf05b('0x2a')][_0xf05b('0x2d')]));_0x589def['attributes']=_0x589def['attributes'][_0xf05b('0x38')]?_0x589def[_0xf05b('0x2c')]:_0x408d1d['model'];if(_0x2cc263[_0xf05b('0x2a')]['includeAll']){_0x589def[_0xf05b('0x35')]=[{'all':!![]}];}_0x589def=_[_0xf05b('0x34')]({},_0x589def,_0x2cc263[_0xf05b('0x39')]);return db[_0xf05b('0x27')][_0xf05b('0x3a')](_0x589def)[_0xf05b('0x15')](handleEntityNotFound(_0x47e326,null))[_0xf05b('0x15')](respondWithResult(_0x47e326,null))[_0xf05b('0x3b')](handleError(_0x47e326,null));};exports['destroy']=function(_0x41ba35,_0x3361a6){return db[_0xf05b('0x27')][_0xf05b('0x3a')]({'where':{'id':_0x41ba35[_0xf05b('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3361a6,null))[_0xf05b('0x15')](removeEntity(_0x3361a6,null))[_0xf05b('0x3b')](handleError(_0x3361a6,null));};exports[_0xf05b('0x3d')]=function(_0x1d09f5,_0x71f9f7){if(_0x1d09f5['body'][_0xf05b('0x3e')]===_0xf05b('0x19')&&!_[_0xf05b('0x3f')](_0x1d09f5[_0xf05b('0x40')][_0xf05b('0x41')],'_')){_0x1d09f5[_0xf05b('0x40')][_0xf05b('0x41')]='_'[_0xf05b('0x42')](_0x1d09f5[_0xf05b('0x40')][_0xf05b('0x41')]);}return db[_0xf05b('0x27')]['create'](_0x1d09f5[_0xf05b('0x40')],{'raw':![]})[_0xf05b('0x15')](function(_0x369e89){var _0x5a2cac=_0x1d09f5['user'][_0xf05b('0x43')]({'plain':!![]});if(!_0x5a2cac)throw new Error(_0xf05b('0x44'));if(_0x5a2cac[_0xf05b('0x45')]==='user'){var _0x406767=_0x369e89[_0xf05b('0x43')]({'plain':!![]});var _0x14ca0e=[{'name':_0xf05b('0x16'),'value':'inbound'},{'name':'OutboundRoutes','value':'outbound'},{'name':_0xf05b('0x1a'),'value':_0xf05b('0x46')}];var _0x4f073e=_[_0xf05b('0x3a')](_0x14ca0e,[_0xf05b('0x1e'),_0x406767[_0xf05b('0x3e')]])['name'];return db[_0xf05b('0x47')]['find']({'where':{'name':_0x4f073e,'userProfileId':_0x5a2cac[_0xf05b('0x48')]},'raw':!![]})[_0xf05b('0x15')](function(_0x508e06){if(_0x508e06&&_0x508e06[_0xf05b('0x49')]===0x0){return db[_0xf05b('0x21')][_0xf05b('0x3d')]({'name':_0x406767[_0xf05b('0x20')],'resourceId':_0x406767['id'],'type':_0x508e06[_0xf05b('0x20')],'sectionId':_0x508e06['id']},{})['then'](function(){return _0x369e89;});}else{return _0x369e89;}})[_0xf05b('0x3b')](function(_0x496029){logger[_0xf05b('0x23')](_0xf05b('0x4a'),_0x496029);throw _0x496029;});}return _0x369e89;})['then'](respondWithResult(_0x71f9f7,0xc9))[_0xf05b('0x3b')](handleError(_0x71f9f7,null));};exports['update']=function(_0x32c929,_0x3ad2b4){if(_0x32c929[_0xf05b('0x40')]['id']){delete _0x32c929[_0xf05b('0x40')]['id'];}return db[_0xf05b('0x27')][_0xf05b('0x3a')]({'where':{'id':_0x32c929[_0xf05b('0x3c')]['id']}})[_0xf05b('0x15')](handleEntityNotFound(_0x3ad2b4,null))['then'](function(_0xf8ea8e){if(_0xf8ea8e){return db[_0xf05b('0x27')]['update'](_['pick'](_0x32c929[_0xf05b('0x40')],[_0xf05b('0x41'),'context',_0xf05b('0x4b'),_0xf05b('0x4c'),_0xf05b('0x4d'),_0xf05b('0x4e'),_0xf05b('0x4f')]),{'where':{'context':_0xf8ea8e[_0xf05b('0x50')],'exten':_0xf8ea8e[_0xf05b('0x41')]},'individualHooks':!![]})[_0xf05b('0x15')](function(_0x511d28){return _0x511d28;});}return null;})[_0xf05b('0x15')](respondWithStatusCode(_0x3ad2b4,null))['catch'](handleError(_0x3ad2b4,null));};exports[_0xf05b('0x51')]=function(_0x15023f,_0xb62737){return db[_0xf05b('0x27')][_0xf05b('0x52')]({'where':{'id':_0x15023f['params']['id']}})[_0xf05b('0x15')](function(_0x36827d){if(_0x36827d){return db[_0xf05b('0x53')][_0xf05b('0x54')](function(_0x54bbb1){return db[_0xf05b('0x27')][_0xf05b('0x14')]({'where':{'VoiceExtensionId':_0x15023f[_0xf05b('0x3c')]['id']},'transaction':_0x54bbb1})['then'](function(){var _0x19ea95=_['map'](_0x15023f[_0xf05b('0x40')],function(_0x43a0ed){_0x43a0ed[_0xf05b('0x55')]=_0x15023f['params']['id'];_0x43a0ed[_0xf05b('0x56')]=!![];return _0x43a0ed;});return _0x36827d[_0xf05b('0x57')](_0x19ea95);})[_0xf05b('0x15')](function(_0x2c0b44){console['log']('LOG\x20~\x20.then\x20~\x20routing',_0x2c0b44);return db[_0xf05b('0x27')]['bulkCreate'](_0x2c0b44,{'transaction':_0x54bbb1});});})[_0xf05b('0x15')](function(){return db['VoiceExtension'][_0xf05b('0x58')]({'where':{'isApp':!![],'VoiceExtensionId':_0x15023f[_0xf05b('0x3c')]['id']},'order':_0xf05b('0x59')});});}})[_0xf05b('0x15')](respondWithResult(_0xb62737,null))[_0xf05b('0x3b')](handleError(_0xb62737,null));};
\ No newline at end of file
+var _0xbca8=['catch','params','keys','rawAttributes','destroy','create','startsWith','exten','body','concat','user','InboundRoutes','OutboundRoutes','internal','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','context','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','findOne','VoiceExtensionId','log','LOG\x20~\x20.then\x20~\x20routing','findAndCountAll','cast(priority\x20as\x20unsigned)','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','then','get','outbound','InternalRoutes','value','includes','type','find','name','UserProfileResource','error','index','VoiceExtension','fieldName','key','map','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','filter','where','merge','options','includeAll','include','findAll'];(function(_0x2c8bf6,_0x56eab8){var _0x11efa8=function(_0x3f43f0){while(--_0x3f43f0){_0x2c8bf6['push'](_0x2c8bf6['shift']());}};_0x11efa8(++_0x56eab8);}(_0xbca8,0xcc));var _0x8bca=function(_0x28ce9c,_0x1c5669){_0x28ce9c=_0x28ce9c-0x0;var _0x9b7417=_0xbca8[_0x28ce9c];return _0x9b7417;};'use strict';var _=require(_0x8bca('0x0'));var Redis=require(_0x8bca('0x1'));var qs=require(_0x8bca('0x2'));var logger=require(_0x8bca('0x3'))(_0x8bca('0x4'));var config=require('../../config/environment');var db=require(_0x8bca('0x5'))['db'];config[_0x8bca('0x6')]=_[_0x8bca('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8bca('0x8'))(new Redis(config[_0x8bca('0x6')]));require(_0x8bca('0x9'))[_0x8bca('0xa')](socket);function respondWithStatusCode(_0x4b3267,_0x3fdccf){_0x3fdccf=_0x3fdccf||0xcc;return function(_0x38e241){if(_0x38e241){return _0x4b3267[_0x8bca('0xb')](_0x3fdccf);}return _0x4b3267[_0x8bca('0xc')](_0x3fdccf)[_0x8bca('0xd')]();};}function respondWithResult(_0xe266ca,_0x229cc4){_0x229cc4=_0x229cc4||0xc8;return function(_0x4ee4a0){if(_0x4ee4a0){return _0xe266ca['status'](_0x229cc4)[_0x8bca('0xe')](_0x4ee4a0);}};}function respondWithFilteredResult(_0x38c607,_0x4ece4f){return function(_0x493890){if(_0x493890){var _0x31afa0=typeof _0x4ece4f['offset']===_0x8bca('0xf')&&typeof _0x4ece4f[_0x8bca('0x10')]==='undefined';var _0x62c6d1=_0x493890[_0x8bca('0x11')];var _0xc65875=_0x31afa0?0x0:_0x4ece4f[_0x8bca('0x12')];var _0x5d32dc=_0x31afa0?_0x493890['count']:_0x4ece4f[_0x8bca('0x12')]+_0x4ece4f['limit'];var _0x25691b;if(_0x5d32dc>=_0x62c6d1){_0x5d32dc=_0x62c6d1;_0x25691b=0xc8;}else{_0x25691b=0xce;}_0x38c607[_0x8bca('0xc')](_0x25691b);return _0x38c607[_0x8bca('0x13')](_0x8bca('0x14'),_0xc65875+'-'+_0x5d32dc+'/'+_0x62c6d1)[_0x8bca('0xe')](_0x493890);}return null;};}function removeEntity(_0x1c78d5){return function(_0x487305){if(_0x487305){return _0x487305['destroy']()[_0x8bca('0x15')](function(){var _0x4d3cc3=_0x487305[_0x8bca('0x16')]({'plain':!![]});var _0x25c5c1=[{'name':'InboundRoutes','value':'inbound','ignore':![]},{'name':'OutboundRoutes','value':_0x8bca('0x17'),'ignore':![]},{'name':_0x8bca('0x18'),'value':'internal','ignore':![]}];var _0x1a834c=_(_0x25c5c1)['filter']('ignore')['map'](_0x8bca('0x19'))[_0x8bca('0x19')]();if(_[_0x8bca('0x1a')](_0x1a834c,_0x4d3cc3[_0x8bca('0x1b')])){return;}var _0x2d64cd=_[_0x8bca('0x1c')](_0x25c5c1,['value',_0x4d3cc3[_0x8bca('0x1b')]])[_0x8bca('0x1d')];return db[_0x8bca('0x1e')]['destroy']({'where':{'type':_0x2d64cd,'resourceId':_0x4d3cc3['id']}})[_0x8bca('0x15')](function(){return _0x487305;});})['then'](function(){_0x1c78d5[_0x8bca('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e3522){return function(_0x3be409){if(!_0x3be409){_0x2e3522[_0x8bca('0xb')](0x194);}return _0x3be409;};}function handleError(_0x8620e2,_0x5d0b07){_0x5d0b07=_0x5d0b07||0x1f4;return function(_0x3a7498){logger[_0x8bca('0x1f')](_0x3a7498['stack']);if(_0x3a7498['name']){delete _0x3a7498[_0x8bca('0x1d')];}_0x8620e2[_0x8bca('0xc')](_0x5d0b07)['send'](_0x3a7498);};}exports[_0x8bca('0x20')]=function(_0x706106,_0x103b53){var _0x344eae={},_0x3cf3e5={},_0x54ccae={'count':0x0,'rows':[]};var _0x4767b5=_['map'](db[_0x8bca('0x21')]['rawAttributes'],function(_0x18ff94){return{'name':_0x18ff94[_0x8bca('0x22')],'type':_0x18ff94[_0x8bca('0x1b')][_0x8bca('0x23')]};});_0x3cf3e5['model']=_[_0x8bca('0x24')](_0x4767b5,_0x8bca('0x1d'));_0x3cf3e5[_0x8bca('0x25')]=_['keys'](_0x706106['query']);_0x3cf3e5['filters']=_[_0x8bca('0x26')](_0x3cf3e5[_0x8bca('0x27')],_0x3cf3e5[_0x8bca('0x25')]);_0x344eae['attributes']=_[_0x8bca('0x26')](_0x3cf3e5[_0x8bca('0x27')],qs['fields'](_0x706106[_0x8bca('0x25')][_0x8bca('0x28')]));_0x344eae[_0x8bca('0x29')]=_0x344eae[_0x8bca('0x29')][_0x8bca('0x2a')]?_0x344eae['attributes']:_0x3cf3e5[_0x8bca('0x27')];if(!_0x706106[_0x8bca('0x25')][_0x8bca('0x2b')](_0x8bca('0x2c'))){_0x344eae[_0x8bca('0x10')]=qs['limit'](_0x706106[_0x8bca('0x25')]['limit']);_0x344eae['offset']=qs[_0x8bca('0x12')](_0x706106[_0x8bca('0x25')]['offset']);}_0x344eae['order']=qs[_0x8bca('0x2d')](_0x706106[_0x8bca('0x25')][_0x8bca('0x2d')]);_0x344eae['where']=qs[_0x8bca('0x2e')](_['pick'](_0x706106[_0x8bca('0x25')],_0x3cf3e5[_0x8bca('0x2e')]),_0x4767b5);if(_0x706106['query'][_0x8bca('0x2f')]){_0x344eae[_0x8bca('0x30')]=_[_0x8bca('0x31')](_0x344eae['where'],{'$or':_[_0x8bca('0x24')](_0x4767b5,function(_0x2bbc9a){if(_0x2bbc9a['type']!=='VIRTUAL'){var _0x1e5cdf={};_0x1e5cdf[_0x2bbc9a[_0x8bca('0x1d')]]={'$like':'%'+_0x706106['query']['filter']+'%'};return _0x1e5cdf;}})});}_0x344eae=_[_0x8bca('0x31')]({},_0x344eae,_0x706106[_0x8bca('0x32')]);var _0x38bf1d={'where':_0x344eae[_0x8bca('0x30')]};return db[_0x8bca('0x21')][_0x8bca('0x11')](_0x38bf1d)['then'](function(_0x150b0d){_0x54ccae[_0x8bca('0x11')]=_0x150b0d;if(_0x706106[_0x8bca('0x25')][_0x8bca('0x33')]){_0x344eae[_0x8bca('0x34')]=[{'all':!![]}];}return db[_0x8bca('0x21')][_0x8bca('0x35')](_0x344eae);})[_0x8bca('0x15')](function(_0x508d16){_0x54ccae['rows']=_0x508d16;return _0x54ccae;})[_0x8bca('0x15')](respondWithFilteredResult(_0x103b53,_0x344eae))[_0x8bca('0x36')](handleError(_0x103b53,null));};exports['show']=function(_0x31314c,_0x2bc3ff){var _0x1e1c64={'raw':![],'where':{'id':_0x31314c[_0x8bca('0x37')]['id']}},_0x342561={};_0x342561[_0x8bca('0x27')]=_[_0x8bca('0x38')](db[_0x8bca('0x21')][_0x8bca('0x39')]);_0x342561['query']=_[_0x8bca('0x38')](_0x31314c['query']);_0x342561[_0x8bca('0x2e')]=_[_0x8bca('0x26')](_0x342561[_0x8bca('0x27')],_0x342561[_0x8bca('0x25')]);_0x1e1c64[_0x8bca('0x29')]=_[_0x8bca('0x26')](_0x342561['model'],qs[_0x8bca('0x28')](_0x31314c[_0x8bca('0x25')]['fields']));_0x1e1c64[_0x8bca('0x29')]=_0x1e1c64['attributes']['length']?_0x1e1c64['attributes']:_0x342561['model'];if(_0x31314c[_0x8bca('0x25')][_0x8bca('0x33')]){_0x1e1c64[_0x8bca('0x34')]=[{'all':!![]}];}_0x1e1c64=_[_0x8bca('0x31')]({},_0x1e1c64,_0x31314c['options']);return db[_0x8bca('0x21')][_0x8bca('0x1c')](_0x1e1c64)[_0x8bca('0x15')](handleEntityNotFound(_0x2bc3ff,null))[_0x8bca('0x15')](respondWithResult(_0x2bc3ff,null))['catch'](handleError(_0x2bc3ff,null));};exports[_0x8bca('0x3a')]=function(_0x3b279e,_0x39835e){return db[_0x8bca('0x21')][_0x8bca('0x1c')]({'where':{'id':_0x3b279e[_0x8bca('0x37')]['id']}})[_0x8bca('0x15')](handleEntityNotFound(_0x39835e,null))[_0x8bca('0x15')](removeEntity(_0x39835e,null))['catch'](handleError(_0x39835e,null));};exports[_0x8bca('0x3b')]=function(_0x154270,_0x504e67){if(_0x154270['body'][_0x8bca('0x1b')]===_0x8bca('0x17')&&!_[_0x8bca('0x3c')](_0x154270['body'][_0x8bca('0x3d')],'_')){_0x154270[_0x8bca('0x3e')]['exten']='_'[_0x8bca('0x3f')](_0x154270[_0x8bca('0x3e')][_0x8bca('0x3d')]);}return db[_0x8bca('0x21')]['create'](_0x154270[_0x8bca('0x3e')],{'raw':![]})[_0x8bca('0x15')](function(_0x4a1380){var _0x3174b0=_0x154270[_0x8bca('0x40')][_0x8bca('0x16')]({'plain':!![]});if(!_0x3174b0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3174b0['role']==='user'){var _0xcd371e=_0x4a1380['get']({'plain':!![]});var _0x3547bd=[{'name':_0x8bca('0x41'),'value':'inbound'},{'name':_0x8bca('0x42'),'value':_0x8bca('0x17')},{'name':'InternalRoutes','value':_0x8bca('0x43')}];var _0x31e871=_['find'](_0x3547bd,['value',_0xcd371e['type']])[_0x8bca('0x1d')];return db[_0x8bca('0x44')][_0x8bca('0x1c')]({'where':{'name':_0x31e871,'userProfileId':_0x3174b0[_0x8bca('0x45')]},'raw':!![]})['then'](function(_0xc2ec12){if(_0xc2ec12&&_0xc2ec12[_0x8bca('0x46')]===0x0){return db[_0x8bca('0x1e')][_0x8bca('0x3b')]({'name':_0xcd371e[_0x8bca('0x1d')],'resourceId':_0xcd371e['id'],'type':_0xc2ec12[_0x8bca('0x1d')],'sectionId':_0xc2ec12['id']},{})[_0x8bca('0x15')](function(){return _0x4a1380;});}else{return _0x4a1380;}})[_0x8bca('0x36')](function(_0x47427f){logger[_0x8bca('0x1f')](_0x8bca('0x47'),_0x47427f);throw _0x47427f;});}return _0x4a1380;})[_0x8bca('0x15')](respondWithResult(_0x504e67,0xc9))[_0x8bca('0x36')](handleError(_0x504e67,null));};exports[_0x8bca('0x48')]=function(_0x3e1227,_0x5647b3){if(_0x3e1227[_0x8bca('0x3e')]['id']){delete _0x3e1227[_0x8bca('0x3e')]['id'];}return db['VoiceExtension'][_0x8bca('0x1c')]({'where':{'id':_0x3e1227[_0x8bca('0x37')]['id']}})[_0x8bca('0x15')](handleEntityNotFound(_0x5647b3,null))[_0x8bca('0x15')](function(_0xc2825d){if(_0xc2825d){return db[_0x8bca('0x21')][_0x8bca('0x48')](_[_0x8bca('0x49')](_0x3e1227[_0x8bca('0x3e')],[_0x8bca('0x3d'),_0x8bca('0x4a'),'description',_0x8bca('0x4b'),_0x8bca('0x4c'),_0x8bca('0x4d'),_0x8bca('0x4e')]),{'where':{'context':_0xc2825d['context'],'exten':_0xc2825d[_0x8bca('0x3d')]},'individualHooks':!![]})[_0x8bca('0x15')](function(_0x4171bf){return _0x4171bf;});}return null;})[_0x8bca('0x15')](respondWithStatusCode(_0x5647b3,null))['catch'](handleError(_0x5647b3,null));};exports[_0x8bca('0x4f')]=function(_0x29f017,_0x3d9693){return db[_0x8bca('0x21')][_0x8bca('0x50')]({'where':{'id':_0x29f017[_0x8bca('0x37')]['id']}})[_0x8bca('0x15')](function(_0x1284a5){if(_0x1284a5){return db['sequelize']['transaction'](function(_0x3a1ba7){return db[_0x8bca('0x21')][_0x8bca('0x3a')]({'where':{'VoiceExtensionId':_0x29f017[_0x8bca('0x37')]['id']},'transaction':_0x3a1ba7})[_0x8bca('0x15')](function(){var _0x2a1a7a=_['map'](_0x29f017[_0x8bca('0x3e')],function(_0x53e01e){_0x53e01e[_0x8bca('0x51')]=_0x29f017['params']['id'];_0x53e01e['isApp']=!![];return _0x53e01e;});return _0x1284a5['createRouting'](_0x2a1a7a);})[_0x8bca('0x15')](function(_0x381003){console[_0x8bca('0x52')](_0x8bca('0x53'),_0x381003);return db[_0x8bca('0x21')]['bulkCreate'](_0x381003,{'transaction':_0x3a1ba7});});})[_0x8bca('0x15')](function(){return db[_0x8bca('0x21')][_0x8bca('0x54')]({'where':{'isApp':!![],'VoiceExtensionId':_0x29f017[_0x8bca('0x37')]['id']},'order':_0x8bca('0x55')});});}})[_0x8bca('0x15')](respondWithResult(_0x3d9693,null))['catch'](handleError(_0x3d9693,null));};
\ No newline at end of file
index 57578e7..5932e92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69e5=['hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x4ef2b1,_0x31fffa){var _0xec4cf8=function(_0x4b34c8){while(--_0x4b34c8){_0x4ef2b1['push'](_0x4ef2b1['shift']());}};_0xec4cf8(++_0x31fffa);}(_0x69e5,0x9b));var _0x569e=function(_0x231dda,_0x5b04cc){_0x231dda=_0x231dda-0x0;var _0x3f88cb=_0x69e5[_0x231dda];return _0x3f88cb;};'use strict';var EventEmitter=require(_0x569e('0x0'));var VoiceExtension=require(_0x569e('0x1'))['db'][_0x569e('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x569e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x569e('0x4')};function emitEvent(_0x5e0416){return function(_0x49165a,_0x35815c,_0x3ef89b){VoiceExtensionEvents[_0x569e('0x5')](_0x5e0416+':'+_0x49165a['id'],_0x49165a);VoiceExtensionEvents[_0x569e('0x5')](_0x5e0416,_0x49165a);_0x3ef89b(null);};}for(var e in events){if(events[_0x569e('0x6')](e)){var event=events[e];VoiceExtension[_0x569e('0x7')](e,emitEvent(event));}}module[_0x569e('0x8')]=VoiceExtensionEvents;
\ No newline at end of file
+var _0xb0db=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','VoiceExtension'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb0db,0x8a));var _0xbb0d=function(_0xe946d4,_0x2f9bee){_0xe946d4=_0xe946d4-0x0;var _0x2eb263=_0xb0db[_0xe946d4];return _0x2eb263;};'use strict';var EventEmitter=require(_0xbb0d('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0xbb0d('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xbb0d('0x2')](0x0);var events={'afterCreate':_0xbb0d('0x3'),'afterUpdate':_0xbb0d('0x4'),'afterDestroy':_0xbb0d('0x5')};function emitEvent(_0xa034fa){return function(_0x1bc1cd,_0x4c824d,_0x5dcd63){VoiceExtensionEvents[_0xbb0d('0x6')](_0xa034fa+':'+_0x1bc1cd['id'],_0x1bc1cd);VoiceExtensionEvents[_0xbb0d('0x6')](_0xa034fa,_0x1bc1cd);_0x5dcd63(null);};}for(var e in events){if(events[_0xbb0d('0x7')](e)){var event=events[e];VoiceExtension[_0xbb0d('0x8')](e,emitEvent(event));}}module[_0xbb0d('0x9')]=VoiceExtensionEvents;
\ No newline at end of file
index bce68ed..b0a79c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e63=['replace','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','hasOwnProperty','answer','queue','playback','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','GotoIfTime',',${EXTEN},','appType','outboundDial','appdata','priority','concat','last','define','get','Hangup','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','alias','NoOp','No\x20alias\x20set','push','inbound','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(routeAlias)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','trunk','options','split','length','name','param','phone','prefix','join','U(xcally-mixmonitor-context)'];(function(_0x2b76f4,_0x520109){var _0x31546a=function(_0x30fad8){while(--_0x30fad8){_0x2b76f4['push'](_0x2b76f4['shift']());}};_0x31546a(++_0x520109);}(_0x2e63,0x14d));var _0x32e6=function(_0x5ccdd5,_0x137596){_0x5ccdd5=_0x5ccdd5-0x0;var _0x2bb303=_0x2e63[_0x5ccdd5];return _0x2bb303;};'use strict';var _=require('lodash');var attributes=require(_0x32e6('0x0'));module[_0x32e6('0x1')]=function(_0x359d55){var _0x1722f1=_0x359d55[_0x32e6('0x2')];function _0x477974(_0x434065){var _0x48714b=0x2;var _0x1866ff=[{'type':_0x434065[_0x32e6('0x3')],'app':_0x32e6('0x4'),'appdata':_0x32e6('0x5')+_0x434065[_0x32e6('0x3')],'context':_0x434065[_0x32e6('0x6')],'exten':_0x434065[_0x32e6('0x7')],'priority':_0x48714b++,'VoiceExtensionId':_0x434065['id']},{'type':_0x434065[_0x32e6('0x3')],'app':_0x434065[_0x32e6('0x8')]?_0x32e6('0x4'):_0x32e6('0x9'),'appdata':_0x434065[_0x32e6('0x8')]?'CDR(routeAlias)='+_0x434065[_0x32e6('0x8')]:_0x32e6('0xa'),'context':_0x434065[_0x32e6('0x6')],'exten':_0x434065[_0x32e6('0x7')],'priority':_0x48714b++,'VoiceExtensionId':_0x434065['id']}];if(_0x434065[_0x32e6('0x3')]==='inbound'){_0x1866ff[_0x32e6('0xb')]({'type':_0x32e6('0xc'),'app':_0x32e6('0x4'),'appdata':_0x32e6('0xd')+_0x434065['id'],'context':_0x434065['context'],'exten':_0x434065['exten'],'priority':_0x48714b++,'VoiceExtensionId':_0x434065['id']});}_0x1866ff[_0x32e6('0xb')]({'type':_0x434065['type'],'app':_0x32e6('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x434065[_0x32e6('0x6')],'exten':_0x434065[_0x32e6('0x7')],'priority':_0x48714b++,'VoiceExtensionId':_0x434065['id']},{'type':_0x434065[_0x32e6('0x3')],'app':_0x32e6('0x4'),'appdata':_0x32e6('0xe'),'context':_0x434065[_0x32e6('0x6')],'exten':_0x434065[_0x32e6('0x7')],'priority':_0x48714b++,'VoiceExtensionId':_0x434065['id']},{'type':_0x434065[_0x32e6('0x3')],'app':_0x32e6('0x4'),'appdata':_0x32e6('0xf'),'context':_0x434065[_0x32e6('0x6')],'exten':_0x434065[_0x32e6('0x7')],'priority':_0x48714b++,'VoiceExtensionId':_0x434065['id']});return _0x1866ff;}function _0x353be7(_0x55e47f){var _0x25264d=0x2;var _0x45a344=[{'type':_0x32e6('0x10'),'app':_0x32e6('0x4'),'appdata':_0x32e6('0x11'),'context':_0x55e47f[_0x32e6('0x6')],'exten':_0x55e47f['exten'],'priority':_0x25264d++,'VoiceExtensionId':_0x55e47f['id']},{'type':_0x32e6('0x10'),'app':_0x55e47f[_0x32e6('0x8')]?_0x32e6('0x4'):_0x32e6('0x9'),'appdata':_0x55e47f[_0x32e6('0x8')]?_0x32e6('0x12')+_0x55e47f[_0x32e6('0x8')]:_0x32e6('0xa'),'context':_0x55e47f[_0x32e6('0x6')],'exten':_0x55e47f['exten'],'priority':_0x25264d++,'VoiceExtensionId':_0x55e47f['id']},{'type':_0x32e6('0x10'),'app':'Set','appdata':'CDR(destination)='+(_0x55e47f['cutdigits']?'${EXTEN:'+_0x55e47f[_0x32e6('0x13')]+'}':_0x32e6('0x14')),'context':_0x55e47f[_0x32e6('0x6')],'exten':_0x55e47f[_0x32e6('0x7')],'priority':_0x25264d++,'VoiceExtensionId':_0x55e47f['id']},{'type':_0x32e6('0x10'),'app':_0x32e6('0x4'),'appdata':_0x32e6('0xd')+_0x55e47f['id'],'context':_0x55e47f[_0x32e6('0x6')],'exten':_0x55e47f[_0x32e6('0x7')],'priority':_0x25264d++,'VoiceExtensionId':_0x55e47f['id']},{'type':_0x32e6('0x10'),'app':_0x32e6('0x15'),'appdata':_0x32e6('0x16')+(_0x25264d+0x2)+_0x32e6('0x17')+(_0x25264d+0x1)+')','context':_0x55e47f[_0x32e6('0x6')],'exten':_0x55e47f['exten'],'priority':_0x25264d++,'VoiceExtensionId':_0x55e47f['id']},{'type':_0x32e6('0x10'),'app':_0x32e6('0x4'),'appdata':_0x55e47f[_0x32e6('0x13')]?_0x32e6('0x18')+_0x55e47f[_0x32e6('0x13')]+'}':_0x32e6('0x19'),'context':_0x55e47f[_0x32e6('0x6')],'exten':_0x55e47f['exten'],'priority':_0x25264d++,'VoiceExtensionId':_0x55e47f['id']},{'type':_0x32e6('0x10'),'app':_0x32e6('0x4'),'appdata':_0x32e6('0x1a'),'context':_0x55e47f[_0x32e6('0x6')],'exten':_0x55e47f[_0x32e6('0x7')],'priority':_0x25264d++,'VoiceExtensionId':_0x55e47f['id']},{'type':'outbound','app':_0x32e6('0x4'),'appdata':_0x32e6('0xe'),'context':_0x55e47f[_0x32e6('0x6')],'exten':_0x55e47f['exten'],'priority':_0x25264d++,'VoiceExtensionId':_0x55e47f['id']},{'type':'outbound','app':_0x32e6('0x4'),'appdata':_0x32e6('0xf'),'context':_0x55e47f[_0x32e6('0x6')],'exten':_0x55e47f[_0x32e6('0x7')],'priority':_0x25264d++,'VoiceExtensionId':_0x55e47f['id']},{'type':'outbound','app':_0x32e6('0x4'),'appdata':_0x32e6('0x1b')+_0x55e47f['id'],'context':_0x55e47f[_0x32e6('0x6')],'exten':_0x55e47f[_0x32e6('0x7')],'priority':_0x25264d++,'VoiceExtensionId':_0x55e47f['id']}];if(_0x55e47f['hasOwnProperty'](_0x32e6('0x1c'))&&_0x55e47f['recordingFormat']!==_0x32e6('0x1d')){_0x45a344['push']({'type':_0x32e6('0x10'),'app':_0x32e6('0x4'),'appdata':_0x32e6('0x1e'),'context':_0x55e47f['context'],'exten':_0x55e47f[_0x32e6('0x7')],'priority':_0x25264d++,'VoiceExtensionId':_0x55e47f['id']},{'type':_0x32e6('0x10'),'app':_0x32e6('0x4'),'appdata':_0x32e6('0x1f')+_0x55e47f[_0x32e6('0x1c')]||'wav','context':_0x55e47f['context'],'exten':_0x55e47f['exten'],'priority':_0x25264d++,'VoiceExtensionId':_0x55e47f['id']});}return _0x45a344;}function _0x5c483e(_0x28751c,_0x35d2e4){var _0x341e1f=[{'name':_0x32e6('0x20'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0x32e6('0x21'),'param':0x2},{'name':'url','param':0x3}];var _0x43ac97={};var _0x184479=_0x35d2e4[_0x32e6('0x22')](',');var _0x50307e=[];for(var _0x42f928=0x0;_0x42f928<_0x341e1f[_0x32e6('0x23')];_0x42f928++){switch(_0x341e1f[_0x42f928][_0x32e6('0x24')]){case _0x32e6('0x20'):_0x43ac97[_0x32e6('0x20')]=_0x184479[_0x341e1f[_0x42f928][_0x32e6('0x25')]]['split']('/')[0x1];_0x43ac97[_0x32e6('0x26')]=_0x184479[_0x341e1f[_0x42f928][_0x32e6('0x25')]][_0x32e6('0x22')]('/')[0x2];_0x43ac97[_0x32e6('0x27')]=_0x43ac97['phone']?_0x43ac97['phone']['split']('$')[0x0]:undefined;_0x43ac97['phone']=_0x28751c['cutdigits']?(_0x43ac97[_0x32e6('0x27')]||'')+'${EXTEN:'+_0x28751c[_0x32e6('0x13')]+'}':(_0x43ac97[_0x32e6('0x27')]||'')+'${EXTEN}';_0x50307e[_0x341e1f[_0x42f928]['param']]=['SIP',_0x43ac97[_0x32e6('0x20')],_0x43ac97['phone']][_0x32e6('0x28')]('/');break;case'options':_0x43ac97[_0x32e6('0x21')]=_0x184479[_0x341e1f[_0x42f928]['param']];if(_0x28751c[_0x32e6('0x1c')]!==_0x32e6('0x1d')){if(_0x43ac97[_0x32e6('0x21')]['indexOf'](_0x32e6('0x29'))<0x0){_0x43ac97['options']+='U(xcally-mixmonitor-context)';}}else{_0x43ac97['options']=_0x43ac97[_0x32e6('0x21')][_0x32e6('0x2a')](_0x32e6('0x29'),'');}_0x50307e[_0x341e1f[_0x42f928][_0x32e6('0x25')]]=_0x43ac97[_0x32e6('0x21')];break;default:_0x50307e[_0x341e1f[_0x42f928][_0x32e6('0x25')]]=_0x184479[_0x341e1f[_0x42f928][_0x32e6('0x25')]];}}return _0x50307e['join'](',');}function _0x5e2ac3(_0x117acf,_0x93dbcb,_0x20d43a){return new Promise(function(_0x13b5d1,_0x2d47c4){var _0x43f391=[];if(_['isEmpty'](_0x93dbcb))return _0x13b5d1(_0x43f391);_0x1722f1[_0x32e6('0x2b')][_0x32e6('0x2c')]({'attributes':['id',_0x32e6('0x2d'),_0x32e6('0x2e')],'raw':!![]})[_0x32e6('0x2f')](function(_0x5d3927){for(var _0x445637=0x0,_0x37725e=0x0;_0x445637<_0x93dbcb[_0x32e6('0x23')];_0x445637++,_0x37725e=0x0){var _0x5eaf5e=_0x93dbcb[_0x445637];var _0x563db8=[];var _0x3d6a3a=[];delete _0x5eaf5e['id'];if(_0x5eaf5e[_0x32e6('0x2d')]!==_0x32e6('0x30')){_0x5eaf5e[_0x32e6('0x31')]=[_0x5eaf5e['interval']];}else{_0x5eaf5e[_0x32e6('0x31')]=_0x5eaf5e[_0x32e6('0x2e')]?_[_0x32e6('0x32')](_[_0x32e6('0x33')](_0x5d3927,{'IntervalId':_0x5eaf5e['IntervalId']}),_0x32e6('0x2d')):[];}_0x5eaf5e['context']=_0x117acf[_0x32e6('0x6')];_0x5eaf5e[_0x32e6('0x7')]=_0x117acf[_0x32e6('0x7')];if(_0x5eaf5e[_0x32e6('0x3')])_0x5eaf5e[_0x32e6('0x3')]=_0x5eaf5e['type'][_0x32e6('0x34')]();if(_0x117acf[_0x32e6('0x3')]===_0x32e6('0x10')){if(_0x5eaf5e['hasOwnProperty'](_0x32e6('0x35'))&&_0x5eaf5e[_0x32e6('0x35')]&&_0x5eaf5e[_0x32e6('0x35')]!=='--'){_0x563db8[_0x32e6('0xb')]({'type':_0x5eaf5e[_0x32e6('0x3')][_0x32e6('0x34')](),'app':_0x32e6('0x4'),'appdata':'CDR(tag)='+_0x5eaf5e[_0x32e6('0x35')],'context':_0x117acf[_0x32e6('0x6')],'exten':_0x117acf['exten'],'priority':_0x5eaf5e[_0x32e6('0x31')][_0x32e6('0x23')]+_0x20d43a+_0x37725e++,'VoiceExtensionId':_0x117acf['id']});}_0x563db8['push']({'type':_0x5eaf5e['type'][_0x32e6('0x34')](),'app':_0x32e6('0x15'),'appdata':_0x32e6('0x36')+(_0x5eaf5e[_0x32e6('0x37')]?'Set(CALLERID(all)='+_0x5eaf5e[_0x32e6('0x37')]+')':_0x32e6('0x38')),'context':_0x117acf['context'],'exten':_0x117acf[_0x32e6('0x7')],'priority':_0x5eaf5e[_0x32e6('0x31')][_0x32e6('0x23')]+_0x20d43a+_0x37725e++,'VoiceExtensionId':_0x117acf['id']});}else{if(_0x5eaf5e[_0x32e6('0x39')](_0x32e6('0x3a'))){if([_0x32e6('0x3b'),_0x32e6('0x3c')]['includes'](_0x5eaf5e['app'][_0x32e6('0x34')]())&&_0x5eaf5e['appType']!==_0x32e6('0x3d')){if(_0x5eaf5e[_0x32e6('0x3a')]){_0x563db8['push']({'type':_0x5eaf5e[_0x32e6('0x3')]['toLowerCase'](),'app':'ExecIf','appdata':_0x32e6('0x3e'),'context':_0x117acf['context'],'exten':_0x117acf[_0x32e6('0x7')],'priority':_0x5eaf5e[_0x32e6('0x31')][_0x32e6('0x23')]+_0x20d43a+_0x37725e++,'VoiceExtensionId':_0x117acf['id']});_0x563db8[_0x32e6('0xb')]({'type':_0x5eaf5e[_0x32e6('0x3')][_0x32e6('0x34')](),'app':'Set','appdata':_0x32e6('0x3f'),'context':_0x117acf[_0x32e6('0x6')],'exten':_0x117acf['exten'],'priority':_0x5eaf5e['intervals'][_0x32e6('0x23')]+_0x20d43a+_0x37725e++,'VoiceExtensionId':_0x117acf['id']});}else{_0x563db8['push']({'type':_0x5eaf5e[_0x32e6('0x3')][_0x32e6('0x34')](),'app':_0x32e6('0x15'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x117acf['context'],'exten':_0x117acf[_0x32e6('0x7')],'priority':_0x5eaf5e[_0x32e6('0x31')]['length']+_0x20d43a+_0x37725e++,'VoiceExtensionId':_0x117acf['id']});_0x563db8['push']({'type':_0x5eaf5e[_0x32e6('0x3')][_0x32e6('0x34')](),'app':_0x32e6('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x117acf[_0x32e6('0x6')],'exten':_0x117acf[_0x32e6('0x7')],'priority':_0x5eaf5e[_0x32e6('0x31')]['length']+_0x20d43a+_0x37725e++,'VoiceExtensionId':_0x117acf['id']});}}}}for(var _0x3a676f=0x0;_0x3a676f<_0x5eaf5e[_0x32e6('0x31')]['length'];_0x3a676f++){var _0x3e26db=_0x20d43a+_0x5eaf5e[_0x32e6('0x31')][_0x32e6('0x23')];var _0x2b7914=_0x3a676f===_0x5eaf5e[_0x32e6('0x31')][_0x32e6('0x23')]-0x1?_0x20d43a+_0x563db8[_0x32e6('0x23')]+_0x3d6a3a[_0x32e6('0x23')]+0x2:_0x20d43a+_0x3a676f+0x1;_0x563db8['splice'](_0x3a676f,0x0,{'type':_0x117acf[_0x32e6('0x3')],'app':_0x32e6('0x40'),'appdata':_0x5eaf5e['intervals'][_0x3a676f]+'?'+_0x117acf[_0x32e6('0x6')]+',${EXTEN},'+_0x3e26db+':'+_0x117acf[_0x32e6('0x6')]+_0x32e6('0x41')+_0x2b7914,'exten':_0x117acf[_0x32e6('0x7')],'context':_0x117acf[_0x32e6('0x6')],'priority':_0x20d43a+_0x3a676f,'VoiceExtensionId':_0x117acf['id']});}if(_0x5eaf5e[_0x32e6('0x42')]===_0x32e6('0x43'))_0x5eaf5e[_0x32e6('0x44')]=_0x5c483e(_0x117acf,_0x5eaf5e['appdata']);_0x5eaf5e[_0x32e6('0x45')]=_0x563db8[_0x32e6('0x23')]?_['last'](_0x563db8)['priority']+0x1:_0x20d43a;_0x43f391=_[_0x32e6('0x46')](_0x43f391,_0x563db8,[_0x5eaf5e],_0x3d6a3a);_0x20d43a=_[_0x32e6('0x47')](_0x43f391)[_0x32e6('0x45')]+0x1;}return _0x13b5d1(_0x43f391);})['catch'](function(_0xa2a1af){_0x2d47c4(_0xa2a1af);});});}return _0x359d55[_0x32e6('0x48')]('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x29bc7b){var _0x2d60c8=this[_0x32e6('0x49')]({'plain':!![]});var _0x386a85=_0x2d60c8[_0x32e6('0x3')]===_0x32e6('0x10')?_0x353be7(_0x2d60c8):_0x477974(_0x2d60c8);return _0x5e2ac3(_0x2d60c8,_0x29bc7b,_[_0x32e6('0x47')](_0x386a85)['priority']+0x1)[_0x32e6('0x2f')](function(_0x40b778){var _0x342bba=_[_0x32e6('0x46')](_0x386a85,_0x40b778);_0x342bba['push']({'type':_0x2d60c8[_0x32e6('0x3')],'app':_0x32e6('0x4a'),'exten':_0x2d60c8[_0x32e6('0x7')],'context':_0x2d60c8['context'],'priority':_['last'](_0x342bba)[_0x32e6('0x45')]+0x1,'VoiceExtensionId':_0x2d60c8['id']});return _0x342bba;});}}});};
\ No newline at end of file
+var _0xecd0=['IntervalId','*,*,*,*','intervals','filter','toLowerCase','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','app','appType','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','catch','VoiceExtension','voice_extensions','get','then','concat','Hangup','lodash','./voiceExtension.attributes','exports','Set','CDR(type)=','type','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','url','length','name','param','split','prefix','phone','join','options','none','indexOf','U(xcally-mixmonitor-context)','replace','findAll','interval'];(function(_0x588e6d,_0x4f39f7){var _0x383e74=function(_0x3694fc){while(--_0x3694fc){_0x588e6d['push'](_0x588e6d['shift']());}};_0x383e74(++_0x4f39f7);}(_0xecd0,0x162));var _0x0ecd=function(_0x39e2d7,_0x1b15f6){_0x39e2d7=_0x39e2d7-0x0;var _0x413d0d=_0xecd0[_0x39e2d7];return _0x413d0d;};'use strict';var _=require(_0x0ecd('0x0'));var attributes=require(_0x0ecd('0x1'));module[_0x0ecd('0x2')]=function(_0x1e2773){var _0x41cf87=_0x1e2773['models'];function _0x4068f0(_0xe490c){var _0x18c51d=0x2;var _0x8df9d1=[{'type':_0xe490c['type'],'app':_0x0ecd('0x3'),'appdata':_0x0ecd('0x4')+_0xe490c[_0x0ecd('0x5')],'context':_0xe490c[_0x0ecd('0x6')],'exten':_0xe490c[_0x0ecd('0x7')],'priority':_0x18c51d++,'VoiceExtensionId':_0xe490c['id']},{'type':_0xe490c[_0x0ecd('0x5')],'app':_0xe490c[_0x0ecd('0x8')]?_0x0ecd('0x3'):_0x0ecd('0x9'),'appdata':_0xe490c[_0x0ecd('0x8')]?_0x0ecd('0xa')+_0xe490c[_0x0ecd('0x8')]:_0x0ecd('0xb'),'context':_0xe490c[_0x0ecd('0x6')],'exten':_0xe490c[_0x0ecd('0x7')],'priority':_0x18c51d++,'VoiceExtensionId':_0xe490c['id']}];if(_0xe490c['type']===_0x0ecd('0xc')){_0x8df9d1[_0x0ecd('0xd')]({'type':_0x0ecd('0xc'),'app':_0x0ecd('0x3'),'appdata':_0x0ecd('0xe')+_0xe490c['id'],'context':_0xe490c['context'],'exten':_0xe490c[_0x0ecd('0x7')],'priority':_0x18c51d++,'VoiceExtensionId':_0xe490c['id']});}_0x8df9d1['push']({'type':_0xe490c['type'],'app':_0x0ecd('0x3'),'appdata':_0x0ecd('0xf'),'context':_0xe490c['context'],'exten':_0xe490c['exten'],'priority':_0x18c51d++,'VoiceExtensionId':_0xe490c['id']},{'type':_0xe490c[_0x0ecd('0x5')],'app':_0x0ecd('0x3'),'appdata':_0x0ecd('0x10'),'context':_0xe490c[_0x0ecd('0x6')],'exten':_0xe490c['exten'],'priority':_0x18c51d++,'VoiceExtensionId':_0xe490c['id']},{'type':_0xe490c['type'],'app':_0x0ecd('0x3'),'appdata':_0x0ecd('0x11'),'context':_0xe490c['context'],'exten':_0xe490c['exten'],'priority':_0x18c51d++,'VoiceExtensionId':_0xe490c['id']});return _0x8df9d1;}function _0x3088dc(_0x1e337a){var _0x13e519=0x2;var _0x4dbf65=[{'type':_0x0ecd('0x12'),'app':_0x0ecd('0x3'),'appdata':_0x0ecd('0x13'),'context':_0x1e337a['context'],'exten':_0x1e337a[_0x0ecd('0x7')],'priority':_0x13e519++,'VoiceExtensionId':_0x1e337a['id']},{'type':_0x0ecd('0x12'),'app':_0x1e337a[_0x0ecd('0x8')]?_0x0ecd('0x3'):_0x0ecd('0x9'),'appdata':_0x1e337a[_0x0ecd('0x8')]?'CDR(routeAlias)='+_0x1e337a[_0x0ecd('0x8')]:_0x0ecd('0xb'),'context':_0x1e337a[_0x0ecd('0x6')],'exten':_0x1e337a['exten'],'priority':_0x13e519++,'VoiceExtensionId':_0x1e337a['id']},{'type':'outbound','app':_0x0ecd('0x3'),'appdata':_0x0ecd('0x14')+(_0x1e337a[_0x0ecd('0x15')]?_0x0ecd('0x16')+_0x1e337a[_0x0ecd('0x15')]+'}':_0x0ecd('0x17')),'context':_0x1e337a[_0x0ecd('0x6')],'exten':_0x1e337a['exten'],'priority':_0x13e519++,'VoiceExtensionId':_0x1e337a['id']},{'type':_0x0ecd('0x12'),'app':_0x0ecd('0x3'),'appdata':_0x0ecd('0xe')+_0x1e337a['id'],'context':_0x1e337a[_0x0ecd('0x6')],'exten':_0x1e337a[_0x0ecd('0x7')],'priority':_0x13e519++,'VoiceExtensionId':_0x1e337a['id']},{'type':_0x0ecd('0x12'),'app':_0x0ecd('0x18'),'appdata':_0x0ecd('0x19')+(_0x13e519+0x2)+_0x0ecd('0x1a')+(_0x13e519+0x1)+')','context':_0x1e337a[_0x0ecd('0x6')],'exten':_0x1e337a['exten'],'priority':_0x13e519++,'VoiceExtensionId':_0x1e337a['id']},{'type':_0x0ecd('0x12'),'app':_0x0ecd('0x3'),'appdata':_0x1e337a['cutdigits']?_0x0ecd('0x1b')+_0x1e337a[_0x0ecd('0x15')]+'}':_0x0ecd('0x1c'),'context':_0x1e337a[_0x0ecd('0x6')],'exten':_0x1e337a[_0x0ecd('0x7')],'priority':_0x13e519++,'VoiceExtensionId':_0x1e337a['id']},{'type':_0x0ecd('0x12'),'app':'Set','appdata':_0x0ecd('0xf'),'context':_0x1e337a['context'],'exten':_0x1e337a['exten'],'priority':_0x13e519++,'VoiceExtensionId':_0x1e337a['id']},{'type':_0x0ecd('0x12'),'app':_0x0ecd('0x3'),'appdata':_0x0ecd('0x10'),'context':_0x1e337a[_0x0ecd('0x6')],'exten':_0x1e337a['exten'],'priority':_0x13e519++,'VoiceExtensionId':_0x1e337a['id']},{'type':_0x0ecd('0x12'),'app':'Set','appdata':_0x0ecd('0x11'),'context':_0x1e337a[_0x0ecd('0x6')],'exten':_0x1e337a[_0x0ecd('0x7')],'priority':_0x13e519++,'VoiceExtensionId':_0x1e337a['id']},{'type':_0x0ecd('0x12'),'app':_0x0ecd('0x3'),'appdata':_0x0ecd('0x1d')+_0x1e337a['id'],'context':_0x1e337a[_0x0ecd('0x6')],'exten':_0x1e337a[_0x0ecd('0x7')],'priority':_0x13e519++,'VoiceExtensionId':_0x1e337a['id']}];if(_0x1e337a[_0x0ecd('0x1e')](_0x0ecd('0x1f'))&&_0x1e337a[_0x0ecd('0x1f')]!=='none'){_0x4dbf65[_0x0ecd('0xd')]({'type':_0x0ecd('0x12'),'app':_0x0ecd('0x3'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x1e337a['context'],'exten':_0x1e337a[_0x0ecd('0x7')],'priority':_0x13e519++,'VoiceExtensionId':_0x1e337a['id']},{'type':'outbound','app':_0x0ecd('0x3'),'appdata':_0x0ecd('0x20')+_0x1e337a[_0x0ecd('0x1f')]||_0x0ecd('0x21'),'context':_0x1e337a[_0x0ecd('0x6')],'exten':_0x1e337a['exten'],'priority':_0x13e519++,'VoiceExtensionId':_0x1e337a['id']});}return _0x4dbf65;}function _0x3d7fa9(_0x57e739,_0x5c75ba){var _0x47d6b1=[{'name':_0x0ecd('0x22'),'param':0x0},{'name':_0x0ecd('0x23'),'param':0x1},{'name':'options','param':0x2},{'name':_0x0ecd('0x24'),'param':0x3}];var _0x215c39={};var _0x5b9eaf=_0x5c75ba['split'](',');var _0xad6bba=[];for(var _0x5eb941=0x0;_0x5eb941<_0x47d6b1[_0x0ecd('0x25')];_0x5eb941++){switch(_0x47d6b1[_0x5eb941][_0x0ecd('0x26')]){case _0x0ecd('0x22'):_0x215c39[_0x0ecd('0x22')]=_0x5b9eaf[_0x47d6b1[_0x5eb941][_0x0ecd('0x27')]][_0x0ecd('0x28')]('/')[0x1];_0x215c39['phone']=_0x5b9eaf[_0x47d6b1[_0x5eb941]['param']]['split']('/')[0x2];_0x215c39[_0x0ecd('0x29')]=_0x215c39[_0x0ecd('0x2a')]?_0x215c39[_0x0ecd('0x2a')][_0x0ecd('0x28')]('$')[0x0]:undefined;_0x215c39[_0x0ecd('0x2a')]=_0x57e739[_0x0ecd('0x15')]?(_0x215c39[_0x0ecd('0x29')]||'')+_0x0ecd('0x16')+_0x57e739[_0x0ecd('0x15')]+'}':(_0x215c39['prefix']||'')+_0x0ecd('0x17');_0xad6bba[_0x47d6b1[_0x5eb941]['param']]=['SIP',_0x215c39[_0x0ecd('0x22')],_0x215c39[_0x0ecd('0x2a')]][_0x0ecd('0x2b')]('/');break;case _0x0ecd('0x2c'):_0x215c39[_0x0ecd('0x2c')]=_0x5b9eaf[_0x47d6b1[_0x5eb941]['param']];if(_0x57e739[_0x0ecd('0x1f')]!==_0x0ecd('0x2d')){if(_0x215c39[_0x0ecd('0x2c')][_0x0ecd('0x2e')](_0x0ecd('0x2f'))<0x0){_0x215c39['options']+=_0x0ecd('0x2f');}}else{_0x215c39[_0x0ecd('0x2c')]=_0x215c39[_0x0ecd('0x2c')][_0x0ecd('0x30')](_0x0ecd('0x2f'),'');}_0xad6bba[_0x47d6b1[_0x5eb941]['param']]=_0x215c39[_0x0ecd('0x2c')];break;default:_0xad6bba[_0x47d6b1[_0x5eb941][_0x0ecd('0x27')]]=_0x5b9eaf[_0x47d6b1[_0x5eb941][_0x0ecd('0x27')]];}}return _0xad6bba[_0x0ecd('0x2b')](',');}function _0x5b12ba(_0x25bb2d,_0x2dcb37,_0x203354){return new Promise(function(_0x2dbb3c,_0x348131){var _0x59c9ee=[];if(_['isEmpty'](_0x2dcb37))return _0x2dbb3c(_0x59c9ee);_0x41cf87['Interval'][_0x0ecd('0x31')]({'attributes':['id',_0x0ecd('0x32'),_0x0ecd('0x33')],'raw':!![]})['then'](function(_0x3bdbeb){for(var _0x1710d9=0x0,_0x20c03a=0x0;_0x1710d9<_0x2dcb37[_0x0ecd('0x25')];_0x1710d9++,_0x20c03a=0x0){var _0x425b63=_0x2dcb37[_0x1710d9];var _0x289533=[];var _0x31460a=[];delete _0x425b63['id'];if(_0x425b63[_0x0ecd('0x32')]!==_0x0ecd('0x34')){_0x425b63[_0x0ecd('0x35')]=[_0x425b63[_0x0ecd('0x32')]];}else{_0x425b63[_0x0ecd('0x35')]=_0x425b63[_0x0ecd('0x33')]?_['map'](_[_0x0ecd('0x36')](_0x3bdbeb,{'IntervalId':_0x425b63[_0x0ecd('0x33')]}),'interval'):[];}_0x425b63['context']=_0x25bb2d[_0x0ecd('0x6')];_0x425b63[_0x0ecd('0x7')]=_0x25bb2d[_0x0ecd('0x7')];if(_0x425b63[_0x0ecd('0x5')])_0x425b63[_0x0ecd('0x5')]=_0x425b63[_0x0ecd('0x5')][_0x0ecd('0x37')]();if(_0x25bb2d['type']===_0x0ecd('0x12')){if(_0x425b63[_0x0ecd('0x1e')]('tag')&&_0x425b63[_0x0ecd('0x38')]&&_0x425b63[_0x0ecd('0x38')]!=='--'){_0x289533['push']({'type':_0x425b63[_0x0ecd('0x5')][_0x0ecd('0x37')](),'app':'Set','appdata':'CDR(tag)='+_0x425b63[_0x0ecd('0x38')],'context':_0x25bb2d[_0x0ecd('0x6')],'exten':_0x25bb2d[_0x0ecd('0x7')],'priority':_0x425b63[_0x0ecd('0x35')][_0x0ecd('0x25')]+_0x203354+_0x20c03a++,'VoiceExtensionId':_0x25bb2d['id']});}_0x289533[_0x0ecd('0xd')]({'type':_0x425b63[_0x0ecd('0x5')]['toLowerCase'](),'app':_0x0ecd('0x18'),'appdata':_0x0ecd('0x39')+(_0x425b63[_0x0ecd('0x3a')]?_0x0ecd('0x3b')+_0x425b63[_0x0ecd('0x3a')]+')':_0x0ecd('0x3c')),'context':_0x25bb2d[_0x0ecd('0x6')],'exten':_0x25bb2d[_0x0ecd('0x7')],'priority':_0x425b63['intervals'][_0x0ecd('0x25')]+_0x203354+_0x20c03a++,'VoiceExtensionId':_0x25bb2d['id']});}else{if(_0x425b63[_0x0ecd('0x1e')](_0x0ecd('0x3d'))){if([_0x0ecd('0x3e'),'playback']['includes'](_0x425b63[_0x0ecd('0x3f')][_0x0ecd('0x37')]())&&_0x425b63[_0x0ecd('0x40')]!=='custom'){if(_0x425b63[_0x0ecd('0x3d')]){_0x289533[_0x0ecd('0xd')]({'type':_0x425b63['type']['toLowerCase'](),'app':_0x0ecd('0x18'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x25bb2d['context'],'exten':_0x25bb2d[_0x0ecd('0x7')],'priority':_0x425b63[_0x0ecd('0x35')][_0x0ecd('0x25')]+_0x203354+_0x20c03a++,'VoiceExtensionId':_0x25bb2d['id']});_0x289533[_0x0ecd('0xd')]({'type':_0x425b63[_0x0ecd('0x5')][_0x0ecd('0x37')](),'app':_0x0ecd('0x3'),'appdata':_0x0ecd('0x41'),'context':_0x25bb2d[_0x0ecd('0x6')],'exten':_0x25bb2d['exten'],'priority':_0x425b63[_0x0ecd('0x35')][_0x0ecd('0x25')]+_0x203354+_0x20c03a++,'VoiceExtensionId':_0x25bb2d['id']});}else{_0x289533[_0x0ecd('0xd')]({'type':_0x425b63[_0x0ecd('0x5')]['toLowerCase'](),'app':'ExecIf','appdata':_0x0ecd('0x42'),'context':_0x25bb2d[_0x0ecd('0x6')],'exten':_0x25bb2d[_0x0ecd('0x7')],'priority':_0x425b63[_0x0ecd('0x35')]['length']+_0x203354+_0x20c03a++,'VoiceExtensionId':_0x25bb2d['id']});_0x289533[_0x0ecd('0xd')]({'type':_0x425b63[_0x0ecd('0x5')][_0x0ecd('0x37')](),'app':_0x0ecd('0x3'),'appdata':_0x0ecd('0x43'),'context':_0x25bb2d[_0x0ecd('0x6')],'exten':_0x25bb2d[_0x0ecd('0x7')],'priority':_0x425b63['intervals'][_0x0ecd('0x25')]+_0x203354+_0x20c03a++,'VoiceExtensionId':_0x25bb2d['id']});}}}}for(var _0x477d1b=0x0;_0x477d1b<_0x425b63[_0x0ecd('0x35')][_0x0ecd('0x25')];_0x477d1b++){var _0x2582f6=_0x203354+_0x425b63['intervals'][_0x0ecd('0x25')];var _0x47d4fb=_0x477d1b===_0x425b63['intervals']['length']-0x1?_0x203354+_0x289533['length']+_0x31460a[_0x0ecd('0x25')]+0x2:_0x203354+_0x477d1b+0x1;_0x289533['splice'](_0x477d1b,0x0,{'type':_0x25bb2d[_0x0ecd('0x5')],'app':_0x0ecd('0x44'),'appdata':_0x425b63['intervals'][_0x477d1b]+'?'+_0x25bb2d[_0x0ecd('0x6')]+_0x0ecd('0x45')+_0x2582f6+':'+_0x25bb2d[_0x0ecd('0x6')]+_0x0ecd('0x45')+_0x47d4fb,'exten':_0x25bb2d[_0x0ecd('0x7')],'context':_0x25bb2d[_0x0ecd('0x6')],'priority':_0x203354+_0x477d1b,'VoiceExtensionId':_0x25bb2d['id']});}if(_0x425b63[_0x0ecd('0x40')]===_0x0ecd('0x46'))_0x425b63['appdata']=_0x3d7fa9(_0x25bb2d,_0x425b63[_0x0ecd('0x47')]);_0x425b63[_0x0ecd('0x48')]=_0x289533['length']?_[_0x0ecd('0x49')](_0x289533)[_0x0ecd('0x48')]+0x1:_0x203354;_0x59c9ee=_['concat'](_0x59c9ee,_0x289533,[_0x425b63],_0x31460a);_0x203354=_[_0x0ecd('0x49')](_0x59c9ee)[_0x0ecd('0x48')]+0x1;}return _0x2dbb3c(_0x59c9ee);})[_0x0ecd('0x4a')](function(_0x2e9471){_0x348131(_0x2e9471);});});}return _0x1e2773['define'](_0x0ecd('0x4b'),attributes,{'tableName':_0x0ecd('0x4c'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x37289b){var _0xdb3a34=this[_0x0ecd('0x4d')]({'plain':!![]});var _0x4016fc=_0xdb3a34[_0x0ecd('0x5')]==='outbound'?_0x3088dc(_0xdb3a34):_0x4068f0(_0xdb3a34);return _0x5b12ba(_0xdb3a34,_0x37289b,_[_0x0ecd('0x49')](_0x4016fc)[_0x0ecd('0x48')]+0x1)[_0x0ecd('0x4e')](function(_0x3fa7a5){var _0x23ded0=_[_0x0ecd('0x4f')](_0x4016fc,_0x3fa7a5);_0x23ded0[_0x0ecd('0xd')]({'type':_0xdb3a34[_0x0ecd('0x5')],'app':_0x0ecd('0x50'),'exten':_0xdb3a34[_0x0ecd('0x7')],'context':_0xdb3a34['context'],'priority':_[_0x0ecd('0x49')](_0x23ded0)[_0x0ecd('0x48')]+0x1,'VoiceExtensionId':_0xdb3a34['id']});return _0x23ded0;});}}});};
\ No newline at end of file
index 35af68b..c45b23a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa280=['defaults','localhost','socket.io-emitter','./voiceExtension.socket','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','message','catch','GetVoiceExtension','VoiceExtension','options','raw','where','include','map','model','attributes','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x896ce,_0x288208){var _0x4fc85a=function(_0x457c72){while(--_0x457c72){_0x896ce['push'](_0x896ce['shift']());}};_0x4fc85a(++_0x288208);}(_0xa280,0xc4));var _0x0a28=function(_0x4666a9,_0x570375){_0x4666a9=_0x4666a9-0x0;var _0x155559=_0xa280[_0x4666a9];return _0x155559;};'use strict';var _=require(_0x0a28('0x0'));var util=require(_0x0a28('0x1'));var moment=require('moment');var BPromise=require(_0x0a28('0x2'));var rs=require(_0x0a28('0x3'));var fs=require('fs');var Redis=require(_0x0a28('0x4'));var db=require(_0x0a28('0x5'))['db'];var utils=require(_0x0a28('0x6'));var logger=require(_0x0a28('0x7'))(_0x0a28('0x8'));var config=require(_0x0a28('0x9'));var jayson=require(_0x0a28('0xa'));var client=jayson[_0x0a28('0xb')][_0x0a28('0xc')]({'port':0x232a});config[_0x0a28('0xd')]=_[_0x0a28('0xe')](config[_0x0a28('0xd')],{'host':_0x0a28('0xf'),'port':0x18eb});var socket=require(_0x0a28('0x10'))(new Redis(config[_0x0a28('0xd')]));require(_0x0a28('0x11'))['register'](socket);function respondWithRpcPromise(_0x11b36e,_0x28bca7,_0x48cbf1){return new BPromise(function(_0x30e340,_0x1ad1ef){return client['request'](_0x11b36e,_0x48cbf1)['then'](function(_0x1a8ad4){logger[_0x0a28('0x12')](_0x0a28('0x13'),_0x28bca7,_0x0a28('0x14'));logger[_0x0a28('0x15')](_0x0a28('0x16'),_0x28bca7,_0x0a28('0x14'),JSON['stringify'](_0x1a8ad4));if(_0x1a8ad4[_0x0a28('0x17')]){if(_0x1a8ad4[_0x0a28('0x17')]['code']===0x1f4){logger[_0x0a28('0x17')](_0x0a28('0x13'),_0x28bca7,_0x1a8ad4[_0x0a28('0x17')][_0x0a28('0x18')]);return _0x1ad1ef(_0x1a8ad4['error'][_0x0a28('0x18')]);}logger[_0x0a28('0x17')](_0x0a28('0x13'),_0x28bca7,_0x1a8ad4[_0x0a28('0x17')]['message']);return _0x30e340(_0x1a8ad4[_0x0a28('0x17')][_0x0a28('0x18')]);}else{logger[_0x0a28('0x12')](_0x0a28('0x13'),_0x28bca7,'request\x20sent');_0x30e340(_0x1a8ad4['result'][_0x0a28('0x18')]);}})[_0x0a28('0x19')](function(_0x169bb6){logger['error'](_0x0a28('0x13'),_0x28bca7,_0x169bb6);_0x1ad1ef(_0x169bb6);});});}exports[_0x0a28('0x1a')]=function(_0xb5d7f5){var _0x54661d=this;return new Promise(function(_0x6d727c,_0x709adc){return db[_0x0a28('0x1b')]['findAll']({'raw':_0xb5d7f5[_0x0a28('0x1c')]?_0xb5d7f5[_0x0a28('0x1c')][_0x0a28('0x1d')]===undefined?!![]:![]:!![],'where':_0xb5d7f5[_0x0a28('0x1c')]?_0xb5d7f5[_0x0a28('0x1c')][_0x0a28('0x1e')]||null:null,'attributes':_0xb5d7f5[_0x0a28('0x1c')]?_0xb5d7f5[_0x0a28('0x1c')]['attributes']||null:null,'limit':_0xb5d7f5[_0x0a28('0x1c')]?_0xb5d7f5[_0x0a28('0x1c')]['limit']||null:null,'include':_0xb5d7f5['options']?_0xb5d7f5['options'][_0x0a28('0x1f')]?_[_0x0a28('0x20')](_0xb5d7f5[_0x0a28('0x1c')][_0x0a28('0x1f')],function(_0x356864){return{'model':db[_0x356864[_0x0a28('0x21')]],'as':_0x356864['as'],'attributes':_0x356864['attributes'],'include':_0x356864['include']?_[_0x0a28('0x20')](_0x356864['include'],function(_0x509563){return{'model':db[_0x509563[_0x0a28('0x21')]],'as':_0x509563['as'],'attributes':_0x509563[_0x0a28('0x22')],'include':_0x509563[_0x0a28('0x1f')]?_[_0x0a28('0x20')](_0x509563[_0x0a28('0x1f')],function(_0x3745b2){return{'model':db[_0x3745b2[_0x0a28('0x21')]],'as':_0x3745b2['as'],'attributes':_0x3745b2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x14cd0d){logger[_0x0a28('0x12')](_0x0a28('0x1a'),_0xb5d7f5);logger['debug'](_0x0a28('0x1a'),_0xb5d7f5,JSON['stringify'](_0x14cd0d));_0x6d727c(_0x14cd0d);})[_0x0a28('0x19')](function(_0x33b9fe){logger[_0x0a28('0x17')](_0x0a28('0x1a'),_0x33b9fe['message'],_0xb5d7f5);_0x709adc(_0x54661d[_0x0a28('0x17')](0x1f4,_0x33b9fe['message']));});});};
\ No newline at end of file
+var _0x9b69=['socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','error','message','result','catch','GetVoiceExtension','options','raw','where','attributes','limit','include','map','model','debug','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost'];(function(_0x2b9ac4,_0x11eba5){var _0x4ba700=function(_0x34071e){while(--_0x34071e){_0x2b9ac4['push'](_0x2b9ac4['shift']());}};_0x4ba700(++_0x11eba5);}(_0x9b69,0xa3));var _0x99b6=function(_0x31907a,_0x3fa1cd){_0x31907a=_0x31907a-0x0;var _0x451db4=_0x9b69[_0x31907a];return _0x451db4;};'use strict';var _=require(_0x99b6('0x0'));var util=require(_0x99b6('0x1'));var moment=require(_0x99b6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x99b6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x99b6('0x4'));var logger=require(_0x99b6('0x5'))(_0x99b6('0x6'));var config=require('../../config/environment');var jayson=require(_0x99b6('0x7'));var client=jayson['client'][_0x99b6('0x8')]({'port':0x232a});config[_0x99b6('0x9')]=_[_0x99b6('0xa')](config[_0x99b6('0x9')],{'host':_0x99b6('0xb'),'port':0x18eb});var socket=require(_0x99b6('0xc'))(new Redis(config[_0x99b6('0x9')]));require(_0x99b6('0xd'))[_0x99b6('0xe')](socket);function respondWithRpcPromise(_0x400c81,_0x3081f5,_0x3f2d8e){return new BPromise(function(_0x3af521,_0x6b24b1){return client[_0x99b6('0xf')](_0x400c81,_0x3f2d8e)[_0x99b6('0x10')](function(_0x409539){logger[_0x99b6('0x11')](_0x99b6('0x12'),_0x3081f5,_0x99b6('0x13'));logger['debug']('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x3081f5,'request\x20sent',JSON['stringify'](_0x409539));if(_0x409539['error']){if(_0x409539['error']['code']===0x1f4){logger[_0x99b6('0x14')](_0x99b6('0x12'),_0x3081f5,_0x409539[_0x99b6('0x14')]['message']);return _0x6b24b1(_0x409539[_0x99b6('0x14')][_0x99b6('0x15')]);}logger[_0x99b6('0x14')](_0x99b6('0x12'),_0x3081f5,_0x409539['error'][_0x99b6('0x15')]);return _0x3af521(_0x409539[_0x99b6('0x14')][_0x99b6('0x15')]);}else{logger[_0x99b6('0x11')](_0x99b6('0x12'),_0x3081f5,_0x99b6('0x13'));_0x3af521(_0x409539[_0x99b6('0x16')][_0x99b6('0x15')]);}})[_0x99b6('0x17')](function(_0x547488){logger[_0x99b6('0x14')](_0x99b6('0x12'),_0x3081f5,_0x547488);_0x6b24b1(_0x547488);});});}exports[_0x99b6('0x18')]=function(_0x2036bb){var _0x34476d=this;return new Promise(function(_0xc65470,_0x35b47a){return db['VoiceExtension']['findAll']({'raw':_0x2036bb[_0x99b6('0x19')]?_0x2036bb[_0x99b6('0x19')][_0x99b6('0x1a')]===undefined?!![]:![]:!![],'where':_0x2036bb[_0x99b6('0x19')]?_0x2036bb['options'][_0x99b6('0x1b')]||null:null,'attributes':_0x2036bb[_0x99b6('0x19')]?_0x2036bb[_0x99b6('0x19')][_0x99b6('0x1c')]||null:null,'limit':_0x2036bb[_0x99b6('0x19')]?_0x2036bb[_0x99b6('0x19')][_0x99b6('0x1d')]||null:null,'include':_0x2036bb[_0x99b6('0x19')]?_0x2036bb[_0x99b6('0x19')][_0x99b6('0x1e')]?_[_0x99b6('0x1f')](_0x2036bb[_0x99b6('0x19')][_0x99b6('0x1e')],function(_0x58176f){return{'model':db[_0x58176f[_0x99b6('0x20')]],'as':_0x58176f['as'],'attributes':_0x58176f['attributes'],'include':_0x58176f[_0x99b6('0x1e')]?_['map'](_0x58176f[_0x99b6('0x1e')],function(_0x246b17){return{'model':db[_0x246b17['model']],'as':_0x246b17['as'],'attributes':_0x246b17['attributes'],'include':_0x246b17[_0x99b6('0x1e')]?_[_0x99b6('0x1f')](_0x246b17[_0x99b6('0x1e')],function(_0x48f796){return{'model':db[_0x48f796['model']],'as':_0x48f796['as'],'attributes':_0x48f796['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x9b1901){logger[_0x99b6('0x11')]('GetVoiceExtension',_0x2036bb);logger[_0x99b6('0x21')](_0x99b6('0x18'),_0x2036bb,JSON[_0x99b6('0x22')](_0x9b1901));_0xc65470(_0x9b1901);})[_0x99b6('0x17')](function(_0x200caf){logger['error'](_0x99b6('0x18'),_0x200caf[_0x99b6('0x15')],_0x2036bb);_0x35b47a(_0x34476d[_0x99b6('0x14')](0x1f4,_0x200caf[_0x99b6('0x15')]));});});};
\ No newline at end of file
index e9fb7c1..e9ea633 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4975=['length','./voiceExtension.events','remove','update','emit','removeListener','register'];(function(_0x11bb78,_0x197011){var _0x3194f0=function(_0x16f848){while(--_0x16f848){_0x11bb78['push'](_0x11bb78['shift']());}};_0x3194f0(++_0x197011);}(_0x4975,0x86));var _0x5497=function(_0x5c6eea,_0xe6a45f){_0x5c6eea=_0x5c6eea-0x0;var _0x51ba27=_0x4975[_0x5c6eea];return _0x51ba27;};'use strict';var VoiceExtensionEvents=require(_0x5497('0x0'));var events=['save',_0x5497('0x1'),_0x5497('0x2')];function createListener(_0xfc7927,_0x349f5f){return function(_0x135f6f){_0x349f5f[_0x5497('0x3')](_0xfc7927,_0x135f6f);};}function removeListener(_0x14cecb,_0xeb31af){return function(){VoiceExtensionEvents[_0x5497('0x4')](_0x14cecb,_0xeb31af);};}exports[_0x5497('0x5')]=function(_0x539a27){for(var _0x37e48d=0x0,_0x4f563d=events[_0x5497('0x6')];_0x37e48d<_0x4f563d;_0x37e48d++){var _0x674a2a=events[_0x37e48d];var _0x368e8b=createListener('voiceExtension:'+_0x674a2a,_0x539a27);VoiceExtensionEvents['on'](_0x674a2a,_0x368e8b);}};
\ No newline at end of file
+var _0x5fc3=['./voiceExtension.events','save','update','emit','removeListener','register','voiceExtension:'];(function(_0x442c23,_0x2d8c52){var _0x165b59=function(_0x4608b4){while(--_0x4608b4){_0x442c23['push'](_0x442c23['shift']());}};_0x165b59(++_0x2d8c52);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1d7300,_0x17f109){_0x1d7300=_0x1d7300-0x0;var _0x46ee98=_0x5fc3[_0x1d7300];return _0x46ee98;};'use strict';var VoiceExtensionEvents=require(_0x35fc('0x0'));var events=[_0x35fc('0x1'),'remove',_0x35fc('0x2')];function createListener(_0x2ac6da,_0x196bc2){return function(_0x91d024){_0x196bc2[_0x35fc('0x3')](_0x2ac6da,_0x91d024);};}function removeListener(_0x5e75e6,_0x2d1404){return function(){VoiceExtensionEvents[_0x35fc('0x4')](_0x5e75e6,_0x2d1404);};}exports[_0x35fc('0x5')]=function(_0x5b85ad){for(var _0x5754be=0x0,_0x19a0d1=events['length'];_0x5754be<_0x19a0d1;_0x5754be++){var _0x16e153=events[_0x5754be];var _0x27524f=createListener(_0x35fc('0x6')+_0x16e153,_0x5b85ad);VoiceExtensionEvents['on'](_0x16e153,_0x27524f);}};
\ No newline at end of file
index 1b25ca9..569c041 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a07=['getMessages','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages'];(function(_0x267c52,_0x3c0df3){var _0x46c47b=function(_0x3c3740){while(--_0x3c3740){_0x267c52['push'](_0x267c52['shift']());}};_0x46c47b(++_0x3c0df3);}(_0x2a07,0x74));var _0x72a0=function(_0x4e6ef9,_0x22a04e){_0x4e6ef9=_0x4e6ef9-0x0;var _0x331c37=_0x2a07[_0x4e6ef9];return _0x331c37;};'use strict';var multer=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var path=require(_0x72a0('0x2'));var timeout=require(_0x72a0('0x3'));var express=require(_0x72a0('0x4'));var router=express['Router']();var fs_extra=require(_0x72a0('0x5'));var auth=require(_0x72a0('0x6'));var interaction=require(_0x72a0('0x7'));var config=require(_0x72a0('0x8'));var controller=require(_0x72a0('0x9'));router[_0x72a0('0xa')]('/',auth[_0x72a0('0xb')](),controller[_0x72a0('0xc')]);router[_0x72a0('0xa')](_0x72a0('0xd'),auth[_0x72a0('0xb')](),controller[_0x72a0('0xe')]);router[_0x72a0('0xa')](_0x72a0('0xf'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x10')]);router['post']('/',auth[_0x72a0('0xb')](),controller[_0x72a0('0x11')]);router['put'](_0x72a0('0xd'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x12')]);router[_0x72a0('0x13')](_0x72a0('0xd'),auth['isAuthenticated'](),controller[_0x72a0('0x14')]);module[_0x72a0('0x15')]=router;
\ No newline at end of file
+var _0x741c=['get','isAuthenticated','index','/:id','/:id/messages','getMessages','create','put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./voiceMail.controller'];(function(_0x519d64,_0x57faff){var _0x21c409=function(_0x144656){while(--_0x144656){_0x519d64['push'](_0x519d64['shift']());}};_0x21c409(++_0x57faff);}(_0x741c,0x196));var _0xc741=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x741c[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0xc741('0x0'));var util=require(_0xc741('0x1'));var path=require(_0xc741('0x2'));var timeout=require(_0xc741('0x3'));var express=require(_0xc741('0x4'));var router=express[_0xc741('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc741('0x6'));var config=require('../../config/environment');var controller=require(_0xc741('0x7'));router[_0xc741('0x8')]('/',auth[_0xc741('0x9')](),controller[_0xc741('0xa')]);router[_0xc741('0x8')](_0xc741('0xb'),auth[_0xc741('0x9')](),controller['show']);router[_0xc741('0x8')](_0xc741('0xc'),auth['isAuthenticated'](),controller[_0xc741('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc741('0xe')]);router[_0xc741('0xf')](_0xc741('0xb'),auth[_0xc741('0x9')](),controller[_0xc741('0x10')]);router[_0xc741('0x11')](_0xc741('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index d0efa37..a5f4f95 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4e4=['getDataValue','fullname','exports','from-voicemail','contest_mailbox','STRING','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL'];(function(_0x352bbc,_0x4e1f26){var _0x1a1091=function(_0x52059e){while(--_0x52059e){_0x352bbc['push'](_0x352bbc['shift']());}};_0x1a1091(++_0x4e1f26);}(_0xc4e4,0x1de));var _0x4c4e=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xc4e4[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require('sequelize');module[_0x4c4e('0x0')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':_0x4c4e('0x1'),'unique':_0x4c4e('0x2')},'mailbox':{'type':Sequelize[_0x4c4e('0x3')],'defaultValue':'','allowNull':![],'unique':_0x4c4e('0x2')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x4c4e('0x3')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x3f1c34){this[_0x4c4e('0x4')](_0x4c4e('0x5'),typeof _0x3f1c34===_0x4c4e('0x6')&&_0x3f1c34[_0x4c4e('0x7')]()?_0x3f1c34[_0x4c4e('0x7')]():null);}},'pager':{'type':Sequelize[_0x4c4e('0x3')]},'tz':{'type':Sequelize[_0x4c4e('0x3')],'defaultValue':_0x4c4e('0x8')},'attach':{'type':Sequelize[_0x4c4e('0x9')](_0x4c4e('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x4c4e('0x9')](_0x4c4e('0xa'),'no'),'defaultValue':_0x4c4e('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x4c4e('0x3')]},'callback':{'type':Sequelize[_0x4c4e('0x3')]},'review':{'type':Sequelize[_0x4c4e('0x9')](_0x4c4e('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x4c4e('0x9')](_0x4c4e('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x4c4e('0x9')](_0x4c4e('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x4c4e('0x9')](_0x4c4e('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x4c4e('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x4c4e('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x4c4e('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x4c4e('0xa'),'no'),'defaultValue':_0x4c4e('0xa'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x4c4e('0x9')](_0x4c4e('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x4c4e('0x9')](_0x4c4e('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x4c4e('0xc')},'emailsubject':{'type':Sequelize[_0x4c4e('0x3')]},'emailbody':{'type':Sequelize[_0x4c4e('0x3')]},'maxsecs':{'type':Sequelize[_0x4c4e('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x4c4e('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x4c4e('0xe')],'get':function(){return this[_0x4c4e('0xf')](_0x4c4e('0x10'))+'\x20-\x20'+this['getDataValue']('mailbox');}}};
\ No newline at end of file
+var _0x4ae2=['yes','TINYINT(4)','INTEGER','getDataValue','fullname','\x20-\x20','mailbox','STRING','from-voicemail','contest_mailbox','email','trim','central','ENUM'];(function(_0x4f8434,_0x562ed5){var _0x5bd5e4=function(_0x3adab6){while(--_0x3adab6){_0x4f8434['push'](_0x4f8434['shift']());}};_0x5bd5e4(++_0x562ed5);}(_0x4ae2,0x157));var _0x24ae=function(_0x343dfb,_0xed8587){_0x343dfb=_0x343dfb-0x0;var _0x297fe2=_0x4ae2[_0x343dfb];return _0x297fe2;};'use strict';var Sequelize=require('sequelize');module['exports']={'customer_id':{'type':Sequelize[_0x24ae('0x0')]},'context':{'type':Sequelize[_0x24ae('0x0')],'defaultValue':_0x24ae('0x1'),'unique':_0x24ae('0x2')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x24ae('0x2')},'password':{'type':Sequelize[_0x24ae('0x0')]},'fullname':{'type':Sequelize[_0x24ae('0x0')]},'email':{'type':Sequelize[_0x24ae('0x0')],'validate':{'isEmail':!![]},'set':function(_0x576a70){this['setDataValue'](_0x24ae('0x3'),typeof _0x576a70==='string'&&_0x576a70[_0x24ae('0x4')]()?_0x576a70['trim']():null);}},'pager':{'type':Sequelize[_0x24ae('0x0')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x24ae('0x5')},'attach':{'type':Sequelize[_0x24ae('0x6')](_0x24ae('0x7'),'no'),'defaultValue':_0x24ae('0x7'),'allowNull':![]},'saycid':{'type':Sequelize[_0x24ae('0x6')](_0x24ae('0x7'),'no'),'defaultValue':_0x24ae('0x7'),'allowNull':![]},'dialout':{'type':Sequelize[_0x24ae('0x0')]},'callback':{'type':Sequelize[_0x24ae('0x0')]},'review':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x24ae('0x6')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x24ae('0x6')](_0x24ae('0x7'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x24ae('0x6')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x24ae('0x8'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x24ae('0x6')](_0x24ae('0x7'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x24ae('0x6')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x24ae('0x6')](_0x24ae('0x7'),'no'),'defaultValue':_0x24ae('0x7'),'allowNull':![]},'forcename':{'type':Sequelize[_0x24ae('0x6')](_0x24ae('0x7'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x24ae('0x6')](_0x24ae('0x7'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x24ae('0x6')](_0x24ae('0x7'),'no'),'defaultValue':_0x24ae('0x7'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x24ae('0x0')]},'emailbody':{'type':Sequelize[_0x24ae('0x0')]},'maxsecs':{'type':Sequelize[_0x24ae('0x9')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x24ae('0x9')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x24ae('0xa')](_0x24ae('0xb'))+_0x24ae('0xc')+this[_0x24ae('0xa')](_0x24ae('0xd'));}}};
\ No newline at end of file
index d498897..7b1ccec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3266=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Voicemails','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','nolimit','mailbox','VoiceMailMessage','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','count','set','Content-Range','save','update','then','destroy','get','error','stack','name','send','index','VoiceMail','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','length','find'];(function(_0x52eb08,_0x781b6b){var _0x375109=function(_0x3d518a){while(--_0x3d518a){_0x52eb08['push'](_0x52eb08['shift']());}};_0x375109(++_0x781b6b);}(_0x3266,0x6a));var _0x6326=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0x3266[_0x46ae5a];return _0x434986;};'use strict';var emlformat=require(_0x6326('0x0'));var rimraf=require(_0x6326('0x1'));var zipdir=require(_0x6326('0x2'));var jsonpatch=require(_0x6326('0x3'));var rp=require(_0x6326('0x4'));var moment=require(_0x6326('0x5'));var BPromise=require(_0x6326('0x6'));var Mustache=require(_0x6326('0x7'));var util=require(_0x6326('0x8'));var path=require('path');var sox=require(_0x6326('0x9'));var csv=require('to-csv');var ejs=require(_0x6326('0xa'));var fs=require('fs');var fs_extra=require(_0x6326('0xb'));var _=require(_0x6326('0xc'));var squel=require('squel');var crypto=require(_0x6326('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6326('0xe'));var toCsv=require(_0x6326('0xf'));var querystring=require(_0x6326('0x10'));var Papa=require(_0x6326('0x11'));var Redis=require(_0x6326('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6326('0x13'));var as=require(_0x6326('0x14'));var hardwareService=require(_0x6326('0x15'));var logger=require(_0x6326('0x16'))(_0x6326('0x17'));var utils=require(_0x6326('0x18'));var config=require(_0x6326('0x19'));var licenseUtil=require(_0x6326('0x1a'));var db=require(_0x6326('0x1b'))['db'];function respondWithStatusCode(_0x379358,_0x5c07e1){_0x5c07e1=_0x5c07e1||0xcc;return function(_0x5381d0){if(_0x5381d0){return _0x379358[_0x6326('0x1c')](_0x5c07e1);}return _0x379358[_0x6326('0x1d')](_0x5c07e1)['end']();};}function respondWithResult(_0x425878,_0x4caef3){_0x4caef3=_0x4caef3||0xc8;return function(_0x2d2d9b){if(_0x2d2d9b){return _0x425878[_0x6326('0x1d')](_0x4caef3)[_0x6326('0x1e')](_0x2d2d9b);}};}function respondWithFilteredResult(_0x41c352,_0x1ed3a3){return function(_0x2c1879){if(_0x2c1879){var _0x55923a=typeof _0x1ed3a3[_0x6326('0x1f')]==='undefined'&&typeof _0x1ed3a3['limit']==='undefined';var _0x51e7b9=_0x2c1879['count'];var _0x58e960=_0x55923a?0x0:_0x1ed3a3[_0x6326('0x1f')];var _0x1f4c11=_0x55923a?_0x2c1879[_0x6326('0x20')]:_0x1ed3a3['offset']+_0x1ed3a3['limit'];var _0x954ed5;if(_0x1f4c11>=_0x51e7b9){_0x1f4c11=_0x51e7b9;_0x954ed5=0xc8;}else{_0x954ed5=0xce;}_0x41c352[_0x6326('0x1d')](_0x954ed5);return _0x41c352[_0x6326('0x21')](_0x6326('0x22'),_0x58e960+'-'+_0x1f4c11+'/'+_0x51e7b9)[_0x6326('0x1e')](_0x2c1879);}return null;};}function patchUpdates(_0x25957a){return function(_0x21ee7d){try{jsonpatch['apply'](_0x21ee7d,_0x25957a,!![]);}catch(_0x22307f){return BPromise['reject'](_0x22307f);}return _0x21ee7d[_0x6326('0x23')]();};}function saveUpdates(_0x3c6cfa,_0x2482ef){return function(_0x24fb78){if(_0x24fb78){return _0x24fb78[_0x6326('0x24')](_0x3c6cfa)[_0x6326('0x25')](function(_0x225555){return _0x225555;});}return null;};}function removeEntity(_0x429bb0,_0x4781cc){return function(_0x2d0d00){if(_0x2d0d00){return _0x2d0d00[_0x6326('0x26')]()['then'](function(){var _0x72d020=_0x2d0d00[_0x6326('0x27')]({'plain':!![]});var _0x575701='Voicemails';return db['UserProfileResource'][_0x6326('0x26')]({'where':{'type':_0x575701,'resourceId':_0x72d020['id']}})['then'](function(){return _0x2d0d00;});})[_0x6326('0x25')](function(){_0x429bb0[_0x6326('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15e33d,_0x21ec69){return function(_0xb68fec){if(!_0xb68fec){_0x15e33d[_0x6326('0x1c')](0x194);}return _0xb68fec;};}function handleError(_0x2d2180,_0x45d037){_0x45d037=_0x45d037||0x1f4;return function(_0x40e036){logger[_0x6326('0x28')](_0x40e036[_0x6326('0x29')]);if(_0x40e036[_0x6326('0x2a')]){delete _0x40e036[_0x6326('0x2a')];}_0x2d2180[_0x6326('0x1d')](_0x45d037)[_0x6326('0x2b')](_0x40e036);};}exports[_0x6326('0x2c')]=function(_0x2e0445,_0x20c5ab){var _0x520e57={},_0x2bf5ef={},_0x47303c={'count':0x0,'rows':[]};var _0x1f8982=_['map'](db[_0x6326('0x2d')]['rawAttributes'],function(_0x4e703a){return{'name':_0x4e703a[_0x6326('0x2e')],'type':_0x4e703a[_0x6326('0x2f')][_0x6326('0x30')]};});_0x2bf5ef[_0x6326('0x31')]=_[_0x6326('0x32')](_0x1f8982,_0x6326('0x2a'));_0x2bf5ef[_0x6326('0x33')]=_[_0x6326('0x34')](_0x2e0445[_0x6326('0x33')]);_0x2bf5ef[_0x6326('0x35')]=_[_0x6326('0x36')](_0x2bf5ef[_0x6326('0x31')],_0x2bf5ef['query']);_0x520e57[_0x6326('0x37')]=_[_0x6326('0x36')](_0x2bf5ef['model'],qs[_0x6326('0x38')](_0x2e0445[_0x6326('0x33')][_0x6326('0x38')]));_0x520e57['attributes']=_0x520e57[_0x6326('0x37')]['length']?_0x520e57['attributes']:_0x2bf5ef[_0x6326('0x31')];if(!_0x2e0445[_0x6326('0x33')][_0x6326('0x39')]('nolimit')){_0x520e57[_0x6326('0x3a')]=qs['limit'](_0x2e0445[_0x6326('0x33')]['limit']);_0x520e57[_0x6326('0x1f')]=qs[_0x6326('0x1f')](_0x2e0445[_0x6326('0x33')][_0x6326('0x1f')]);}_0x520e57[_0x6326('0x3b')]=qs[_0x6326('0x3c')](_0x2e0445['query'][_0x6326('0x3c')]);_0x520e57[_0x6326('0x3d')]=qs['filters'](_[_0x6326('0x3e')](_0x2e0445['query'],_0x2bf5ef['filters']),_0x1f8982);if(_0x2e0445[_0x6326('0x33')][_0x6326('0x3f')]){_0x520e57[_0x6326('0x3d')]=_[_0x6326('0x40')](_0x520e57[_0x6326('0x3d')],{'$or':_[_0x6326('0x32')](_0x1f8982,function(_0x5de1c3){if(_0x5de1c3['type']!==_0x6326('0x41')){var _0x5b68af={};_0x5b68af[_0x5de1c3[_0x6326('0x2a')]]={'$like':'%'+_0x2e0445['query'][_0x6326('0x3f')]+'%'};return _0x5b68af;}})});}_0x520e57=_[_0x6326('0x40')]({},_0x520e57,_0x2e0445[_0x6326('0x42')]);var _0x1da798={'where':_0x520e57[_0x6326('0x3d')]};return db[_0x6326('0x2d')][_0x6326('0x20')](_0x1da798)[_0x6326('0x25')](function(_0x3b089b){_0x47303c[_0x6326('0x20')]=_0x3b089b;if(_0x2e0445[_0x6326('0x33')]['includeAll']){_0x520e57[_0x6326('0x43')]=[{'all':!![]}];}return db['VoiceMail'][_0x6326('0x44')](_0x520e57);})[_0x6326('0x25')](function(_0x16fc33){_0x47303c[_0x6326('0x45')]=_0x16fc33;return _0x47303c;})['then'](respondWithFilteredResult(_0x20c5ab,_0x520e57))[_0x6326('0x46')](handleError(_0x20c5ab,null));};exports[_0x6326('0x47')]=function(_0x562d5f,_0x12703d){var _0xe6a992={'raw':!![],'where':{'id':_0x562d5f[_0x6326('0x48')]['id']}},_0x7a5057={};_0x7a5057['model']=_[_0x6326('0x34')](db[_0x6326('0x2d')][_0x6326('0x49')]);_0x7a5057[_0x6326('0x33')]=_[_0x6326('0x34')](_0x562d5f[_0x6326('0x33')]);_0x7a5057[_0x6326('0x35')]=_['intersection'](_0x7a5057[_0x6326('0x31')],_0x7a5057[_0x6326('0x33')]);_0xe6a992[_0x6326('0x37')]=_[_0x6326('0x36')](_0x7a5057['model'],qs[_0x6326('0x38')](_0x562d5f['query'][_0x6326('0x38')]));_0xe6a992[_0x6326('0x37')]=_0xe6a992[_0x6326('0x37')][_0x6326('0x4a')]?_0xe6a992[_0x6326('0x37')]:_0x7a5057['model'];if(_0x562d5f[_0x6326('0x33')]['includeAll']){_0xe6a992['include']=[{'all':!![]}];}_0xe6a992=_[_0x6326('0x40')]({},_0xe6a992,_0x562d5f[_0x6326('0x42')]);return db['VoiceMail'][_0x6326('0x4b')](_0xe6a992)[_0x6326('0x25')](handleEntityNotFound(_0x12703d,null))[_0x6326('0x25')](respondWithResult(_0x12703d,null))[_0x6326('0x46')](handleError(_0x12703d,null));};exports[_0x6326('0x4c')]=function(_0x4f8dc0,_0x4af0ee){return db[_0x6326('0x2d')][_0x6326('0x4c')](_0x4f8dc0[_0x6326('0x4d')],{})[_0x6326('0x25')](function(_0x210a1b){var _0x318d19=_0x4f8dc0[_0x6326('0x4e')]['get']({'plain':!![]});if(!_0x318d19)throw new Error(_0x6326('0x4f'));if(_0x318d19[_0x6326('0x50')]===_0x6326('0x4e')){var _0x3e7674=_0x210a1b[_0x6326('0x27')]({'plain':!![]});var _0x4ff8e6=_0x6326('0x51');return db['UserProfileSection'][_0x6326('0x4b')]({'where':{'name':_0x4ff8e6,'userProfileId':_0x318d19[_0x6326('0x52')]},'raw':!![]})['then'](function(_0x37b045){if(_0x37b045&&_0x37b045['autoAssociation']===0x0){return db[_0x6326('0x53')][_0x6326('0x4c')]({'name':_0x3e7674[_0x6326('0x2a')],'resourceId':_0x3e7674['id'],'type':_0x37b045[_0x6326('0x2a')],'sectionId':_0x37b045['id']},{})['then'](function(){return _0x210a1b;});}else{return _0x210a1b;}})[_0x6326('0x46')](function(_0xbe6b3e){logger['error'](_0x6326('0x54'),_0xbe6b3e);throw _0xbe6b3e;});}return _0x210a1b;})[_0x6326('0x25')](respondWithResult(_0x4af0ee,0xc9))[_0x6326('0x46')](handleError(_0x4af0ee,null));};exports['update']=function(_0x2bece1,_0x2ac64b){if(_0x2bece1['body']['id']){delete _0x2bece1[_0x6326('0x4d')]['id'];}return db['VoiceMail'][_0x6326('0x4b')]({'where':{'id':_0x2bece1[_0x6326('0x48')]['id']}})[_0x6326('0x25')](handleEntityNotFound(_0x2ac64b,null))[_0x6326('0x25')](saveUpdates(_0x2bece1[_0x6326('0x4d')],null))[_0x6326('0x25')](respondWithResult(_0x2ac64b,null))[_0x6326('0x46')](handleError(_0x2ac64b,null));};exports['destroy']=function(_0x51adce,_0x4d4de7){return db[_0x6326('0x2d')]['find']({'where':{'id':_0x51adce[_0x6326('0x48')]['id']}})[_0x6326('0x25')](handleEntityNotFound(_0x4d4de7,null))[_0x6326('0x25')](removeEntity(_0x4d4de7,null))[_0x6326('0x46')](handleError(_0x4d4de7,null));};exports[_0x6326('0x55')]=function(_0x4b5bc6,_0x23bf64,_0x2e4244){return db['VoiceMail'][_0x6326('0x56')]({'where':{'id':_0x4b5bc6[_0x6326('0x48')]['id']}})[_0x6326('0x25')](handleEntityNotFound(_0x23bf64,null))[_0x6326('0x25')](function(_0x45e3d5){var _0x36f2f5;var _0x320d43={},_0x2f624f={};_0x2f624f[_0x6326('0x31')]=_[_0x6326('0x34')](db['VoiceMailMessage'][_0x6326('0x49')]);_0x2f624f[_0x6326('0x33')]=_[_0x6326('0x34')](_0x4b5bc6[_0x6326('0x33')]);_0x2f624f['filters']=_['intersection'](_0x2f624f[_0x6326('0x31')],_0x2f624f[_0x6326('0x33')]);_0x320d43[_0x6326('0x37')]=_[_0x6326('0x36')](_0x2f624f[_0x6326('0x31')],qs['fields'](_0x4b5bc6['query'][_0x6326('0x38')]));_0x320d43[_0x6326('0x37')]=_0x320d43[_0x6326('0x37')][_0x6326('0x4a')]?_0x320d43['attributes']:_0x2f624f[_0x6326('0x31')];if(!_0x4b5bc6[_0x6326('0x33')][_0x6326('0x39')](_0x6326('0x57'))){_0x320d43[_0x6326('0x3a')]=qs[_0x6326('0x3a')](_0x4b5bc6['query'][_0x6326('0x3a')]);_0x320d43['offset']=qs[_0x6326('0x1f')](_0x4b5bc6[_0x6326('0x33')]['offset']);}_0x320d43[_0x6326('0x3b')]=qs[_0x6326('0x3c')](_0x4b5bc6[_0x6326('0x33')][_0x6326('0x3c')]);_0x320d43[_0x6326('0x3d')]=qs[_0x6326('0x35')](_[_0x6326('0x3e')](_0x4b5bc6[_0x6326('0x33')],_0x2f624f[_0x6326('0x35')]));if(_0x4b5bc6[_0x6326('0x33')]['filter']){_0x320d43[_0x6326('0x3d')]=_[_0x6326('0x40')](_0x320d43[_0x6326('0x3d')],{'$or':_[_0x6326('0x32')](_0x320d43[_0x6326('0x37')],function(_0x5599da){var _0x299795={};_0x299795[_0x5599da]={'$like':'%'+_0x4b5bc6[_0x6326('0x33')][_0x6326('0x3f')]+'%'};return _0x299795;})});}_0x320d43[_0x6326('0x3d')]=_[_0x6326('0x40')](_0x320d43['where'],{'mailboxuser':_0x45e3d5[_0x6326('0x58')]});_0x320d43=_['merge']({},_0x320d43,_0x4b5bc6['options']);return db[_0x6326('0x59')][_0x6326('0x5a')](_0x320d43)[_0x6326('0x25')](respondWithFilteredResult(_0x23bf64,_0x320d43));})[_0x6326('0x46')](handleError(_0x23bf64,null));};
\ No newline at end of file
+var _0xa74f=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','json','reject','save','destroy','then','Voicemails','UserProfileResource','error','stack','send','map','VoiceMail','rawAttributes','fieldName','type','key','model','name','query','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','rows','catch','show','params','keys','include','find','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','findOne','VoiceMailMessage','hasOwnProperty','nolimit','mailbox','options','findAndCountAll','zip-dir','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x2995da,_0x4d1339){var _0x2019bd=function(_0x130412){while(--_0x130412){_0x2995da['push'](_0x2995da['shift']());}};_0x2019bd(++_0x4d1339);}(_0xa74f,0x9a));var _0xfa74=function(_0x163742,_0x467e36){_0x163742=_0x163742-0x0;var _0x1152ac=_0xa74f[_0x163742];return _0x1152ac;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfa74('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfa74('0x1'));var BPromise=require(_0xfa74('0x2'));var Mustache=require(_0xfa74('0x3'));var util=require(_0xfa74('0x4'));var path=require('path');var sox=require(_0xfa74('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfa74('0x6'));var _=require(_0xfa74('0x7'));var squel=require(_0xfa74('0x8'));var crypto=require(_0xfa74('0x9'));var jsforce=require(_0xfa74('0xa'));var deskjs=require(_0xfa74('0xb'));var toCsv=require('to-csv');var querystring=require(_0xfa74('0xc'));var Papa=require(_0xfa74('0xd'));var Redis=require(_0xfa74('0xe'));var authService=require(_0xfa74('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xfa74('0x10'));var hardwareService=require(_0xfa74('0x11'));var logger=require('../../config/logger')(_0xfa74('0x12'));var utils=require(_0xfa74('0x13'));var config=require(_0xfa74('0x14'));var licenseUtil=require(_0xfa74('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23591a,_0x998585){_0x998585=_0x998585||0xcc;return function(_0x78173f){if(_0x78173f){return _0x23591a[_0xfa74('0x16')](_0x998585);}return _0x23591a['status'](_0x998585)[_0xfa74('0x17')]();};}function respondWithResult(_0x33cda3,_0x3eb49b){_0x3eb49b=_0x3eb49b||0xc8;return function(_0x3947ca){if(_0x3947ca){return _0x33cda3[_0xfa74('0x18')](_0x3eb49b)['json'](_0x3947ca);}};}function respondWithFilteredResult(_0x199d20,_0x13d911){return function(_0x947da6){if(_0x947da6){var _0x1f1de0=typeof _0x13d911[_0xfa74('0x19')]===_0xfa74('0x1a')&&typeof _0x13d911[_0xfa74('0x1b')]==='undefined';var _0x58a67a=_0x947da6[_0xfa74('0x1c')];var _0x51dda1=_0x1f1de0?0x0:_0x13d911['offset'];var _0x31d3c1=_0x1f1de0?_0x947da6[_0xfa74('0x1c')]:_0x13d911[_0xfa74('0x19')]+_0x13d911['limit'];var _0x3bede6;if(_0x31d3c1>=_0x58a67a){_0x31d3c1=_0x58a67a;_0x3bede6=0xc8;}else{_0x3bede6=0xce;}_0x199d20[_0xfa74('0x18')](_0x3bede6);return _0x199d20[_0xfa74('0x1d')]('Content-Range',_0x51dda1+'-'+_0x31d3c1+'/'+_0x58a67a)[_0xfa74('0x1e')](_0x947da6);}return null;};}function patchUpdates(_0x302eb4){return function(_0x2e6c33){try{jsonpatch['apply'](_0x2e6c33,_0x302eb4,!![]);}catch(_0x5466ca){return BPromise[_0xfa74('0x1f')](_0x5466ca);}return _0x2e6c33[_0xfa74('0x20')]();};}function saveUpdates(_0x9932db,_0xeaaa19){return function(_0x1a453d){if(_0x1a453d){return _0x1a453d['update'](_0x9932db)['then'](function(_0x3721bf){return _0x3721bf;});}return null;};}function removeEntity(_0x5aa8a7,_0x48cbd3){return function(_0x529810){if(_0x529810){return _0x529810[_0xfa74('0x21')]()[_0xfa74('0x22')](function(){var _0x42d9bf=_0x529810['get']({'plain':!![]});var _0x530f99=_0xfa74('0x23');return db[_0xfa74('0x24')]['destroy']({'where':{'type':_0x530f99,'resourceId':_0x42d9bf['id']}})[_0xfa74('0x22')](function(){return _0x529810;});})['then'](function(){_0x5aa8a7[_0xfa74('0x18')](0xcc)[_0xfa74('0x17')]();});}};}function handleEntityNotFound(_0x55d8e4,_0x298388){return function(_0x1130de){if(!_0x1130de){_0x55d8e4[_0xfa74('0x16')](0x194);}return _0x1130de;};}function handleError(_0x218c86,_0x4f7337){_0x4f7337=_0x4f7337||0x1f4;return function(_0xd9c55d){logger[_0xfa74('0x25')](_0xd9c55d[_0xfa74('0x26')]);if(_0xd9c55d['name']){delete _0xd9c55d['name'];}_0x218c86[_0xfa74('0x18')](_0x4f7337)[_0xfa74('0x27')](_0xd9c55d);};}exports['index']=function(_0x4b38fc,_0x343466){var _0x564060={},_0x2238d4={},_0x4d6d0a={'count':0x0,'rows':[]};var _0x363173=_[_0xfa74('0x28')](db[_0xfa74('0x29')][_0xfa74('0x2a')],function(_0x4c506f){return{'name':_0x4c506f[_0xfa74('0x2b')],'type':_0x4c506f[_0xfa74('0x2c')][_0xfa74('0x2d')]};});_0x2238d4[_0xfa74('0x2e')]=_[_0xfa74('0x28')](_0x363173,_0xfa74('0x2f'));_0x2238d4[_0xfa74('0x30')]=_['keys'](_0x4b38fc[_0xfa74('0x30')]);_0x2238d4['filters']=_[_0xfa74('0x31')](_0x2238d4[_0xfa74('0x2e')],_0x2238d4[_0xfa74('0x30')]);_0x564060[_0xfa74('0x32')]=_['intersection'](_0x2238d4['model'],qs[_0xfa74('0x33')](_0x4b38fc[_0xfa74('0x30')][_0xfa74('0x33')]));_0x564060[_0xfa74('0x32')]=_0x564060['attributes'][_0xfa74('0x34')]?_0x564060[_0xfa74('0x32')]:_0x2238d4['model'];if(!_0x4b38fc['query']['hasOwnProperty']('nolimit')){_0x564060['limit']=qs[_0xfa74('0x1b')](_0x4b38fc[_0xfa74('0x30')][_0xfa74('0x1b')]);_0x564060[_0xfa74('0x19')]=qs[_0xfa74('0x19')](_0x4b38fc[_0xfa74('0x30')][_0xfa74('0x19')]);}_0x564060[_0xfa74('0x35')]=qs[_0xfa74('0x36')](_0x4b38fc['query'][_0xfa74('0x36')]);_0x564060[_0xfa74('0x37')]=qs[_0xfa74('0x38')](_[_0xfa74('0x39')](_0x4b38fc[_0xfa74('0x30')],_0x2238d4[_0xfa74('0x38')]),_0x363173);if(_0x4b38fc['query'][_0xfa74('0x3a')]){_0x564060[_0xfa74('0x37')]=_[_0xfa74('0x3b')](_0x564060[_0xfa74('0x37')],{'$or':_['map'](_0x363173,function(_0x207566){if(_0x207566[_0xfa74('0x2c')]!==_0xfa74('0x3c')){var _0x35f252={};_0x35f252[_0x207566['name']]={'$like':'%'+_0x4b38fc[_0xfa74('0x30')][_0xfa74('0x3a')]+'%'};return _0x35f252;}})});}_0x564060=_[_0xfa74('0x3b')]({},_0x564060,_0x4b38fc['options']);var _0x5d32bc={'where':_0x564060[_0xfa74('0x37')]};return db[_0xfa74('0x29')][_0xfa74('0x1c')](_0x5d32bc)[_0xfa74('0x22')](function(_0x55f4e3){_0x4d6d0a[_0xfa74('0x1c')]=_0x55f4e3;if(_0x4b38fc[_0xfa74('0x30')]['includeAll']){_0x564060['include']=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x564060);})[_0xfa74('0x22')](function(_0x3098ca){_0x4d6d0a[_0xfa74('0x3d')]=_0x3098ca;return _0x4d6d0a;})[_0xfa74('0x22')](respondWithFilteredResult(_0x343466,_0x564060))[_0xfa74('0x3e')](handleError(_0x343466,null));};exports[_0xfa74('0x3f')]=function(_0x7735c5,_0x5aac45){var _0x274062={'raw':!![],'where':{'id':_0x7735c5[_0xfa74('0x40')]['id']}},_0x3938c1={};_0x3938c1[_0xfa74('0x2e')]=_[_0xfa74('0x41')](db['VoiceMail'][_0xfa74('0x2a')]);_0x3938c1[_0xfa74('0x30')]=_[_0xfa74('0x41')](_0x7735c5[_0xfa74('0x30')]);_0x3938c1[_0xfa74('0x38')]=_[_0xfa74('0x31')](_0x3938c1[_0xfa74('0x2e')],_0x3938c1[_0xfa74('0x30')]);_0x274062[_0xfa74('0x32')]=_[_0xfa74('0x31')](_0x3938c1['model'],qs[_0xfa74('0x33')](_0x7735c5['query'][_0xfa74('0x33')]));_0x274062[_0xfa74('0x32')]=_0x274062[_0xfa74('0x32')][_0xfa74('0x34')]?_0x274062['attributes']:_0x3938c1[_0xfa74('0x2e')];if(_0x7735c5[_0xfa74('0x30')]['includeAll']){_0x274062[_0xfa74('0x42')]=[{'all':!![]}];}_0x274062=_[_0xfa74('0x3b')]({},_0x274062,_0x7735c5['options']);return db[_0xfa74('0x29')][_0xfa74('0x43')](_0x274062)[_0xfa74('0x22')](handleEntityNotFound(_0x5aac45,null))[_0xfa74('0x22')](respondWithResult(_0x5aac45,null))[_0xfa74('0x3e')](handleError(_0x5aac45,null));};exports['create']=function(_0x54e06c,_0x36f6ca){return db[_0xfa74('0x29')]['create'](_0x54e06c[_0xfa74('0x44')],{})[_0xfa74('0x22')](function(_0x3100f2){var _0x4ca49e=_0x54e06c['user'][_0xfa74('0x45')]({'plain':!![]});if(!_0x4ca49e)throw new Error(_0xfa74('0x46'));if(_0x4ca49e[_0xfa74('0x47')]===_0xfa74('0x48')){var _0x36508a=_0x3100f2[_0xfa74('0x45')]({'plain':!![]});var _0x2d217d=_0xfa74('0x23');return db['UserProfileSection'][_0xfa74('0x43')]({'where':{'name':_0x2d217d,'userProfileId':_0x4ca49e[_0xfa74('0x49')]},'raw':!![]})[_0xfa74('0x22')](function(_0x2654b5){if(_0x2654b5&&_0x2654b5['autoAssociation']===0x0){return db['UserProfileResource'][_0xfa74('0x4a')]({'name':_0x36508a['name'],'resourceId':_0x36508a['id'],'type':_0x2654b5[_0xfa74('0x2f')],'sectionId':_0x2654b5['id']},{})[_0xfa74('0x22')](function(){return _0x3100f2;});}else{return _0x3100f2;}})[_0xfa74('0x3e')](function(_0x33e31e){logger[_0xfa74('0x25')](_0xfa74('0x4b'),_0x33e31e);throw _0x33e31e;});}return _0x3100f2;})[_0xfa74('0x22')](respondWithResult(_0x36f6ca,0xc9))['catch'](handleError(_0x36f6ca,null));};exports[_0xfa74('0x4c')]=function(_0x4bcee3,_0x21d7c5){if(_0x4bcee3['body']['id']){delete _0x4bcee3['body']['id'];}return db[_0xfa74('0x29')][_0xfa74('0x43')]({'where':{'id':_0x4bcee3['params']['id']}})['then'](handleEntityNotFound(_0x21d7c5,null))[_0xfa74('0x22')](saveUpdates(_0x4bcee3[_0xfa74('0x44')],null))[_0xfa74('0x22')](respondWithResult(_0x21d7c5,null))[_0xfa74('0x3e')](handleError(_0x21d7c5,null));};exports[_0xfa74('0x21')]=function(_0xfc3547,_0x1198f3){return db[_0xfa74('0x29')][_0xfa74('0x43')]({'where':{'id':_0xfc3547[_0xfa74('0x40')]['id']}})['then'](handleEntityNotFound(_0x1198f3,null))[_0xfa74('0x22')](removeEntity(_0x1198f3,null))[_0xfa74('0x3e')](handleError(_0x1198f3,null));};exports['getMessages']=function(_0x550974,_0x3d88dc,_0x2e7262){return db[_0xfa74('0x29')][_0xfa74('0x4d')]({'where':{'id':_0x550974[_0xfa74('0x40')]['id']}})['then'](handleEntityNotFound(_0x3d88dc,null))[_0xfa74('0x22')](function(_0x4d6235){var _0x26b398;var _0x2fff37={},_0x375bf7={};_0x375bf7['model']=_['keys'](db[_0xfa74('0x4e')][_0xfa74('0x2a')]);_0x375bf7[_0xfa74('0x30')]=_[_0xfa74('0x41')](_0x550974['query']);_0x375bf7[_0xfa74('0x38')]=_[_0xfa74('0x31')](_0x375bf7['model'],_0x375bf7[_0xfa74('0x30')]);_0x2fff37[_0xfa74('0x32')]=_[_0xfa74('0x31')](_0x375bf7[_0xfa74('0x2e')],qs['fields'](_0x550974[_0xfa74('0x30')]['fields']));_0x2fff37[_0xfa74('0x32')]=_0x2fff37[_0xfa74('0x32')][_0xfa74('0x34')]?_0x2fff37[_0xfa74('0x32')]:_0x375bf7[_0xfa74('0x2e')];if(!_0x550974[_0xfa74('0x30')][_0xfa74('0x4f')](_0xfa74('0x50'))){_0x2fff37[_0xfa74('0x1b')]=qs[_0xfa74('0x1b')](_0x550974[_0xfa74('0x30')][_0xfa74('0x1b')]);_0x2fff37[_0xfa74('0x19')]=qs[_0xfa74('0x19')](_0x550974[_0xfa74('0x30')]['offset']);}_0x2fff37[_0xfa74('0x35')]=qs[_0xfa74('0x36')](_0x550974['query']['sort']);_0x2fff37[_0xfa74('0x37')]=qs['filters'](_[_0xfa74('0x39')](_0x550974[_0xfa74('0x30')],_0x375bf7[_0xfa74('0x38')]));if(_0x550974['query'][_0xfa74('0x3a')]){_0x2fff37['where']=_['merge'](_0x2fff37[_0xfa74('0x37')],{'$or':_[_0xfa74('0x28')](_0x2fff37[_0xfa74('0x32')],function(_0x414e31){var _0x474c7d={};_0x474c7d[_0x414e31]={'$like':'%'+_0x550974[_0xfa74('0x30')][_0xfa74('0x3a')]+'%'};return _0x474c7d;})});}_0x2fff37[_0xfa74('0x37')]=_[_0xfa74('0x3b')](_0x2fff37[_0xfa74('0x37')],{'mailboxuser':_0x4d6235[_0xfa74('0x51')]});_0x2fff37=_['merge']({},_0x2fff37,_0x550974[_0xfa74('0x52')]);return db['VoiceMailMessage'][_0xfa74('0x53')](_0x2fff37)[_0xfa74('0x22')](respondWithFilteredResult(_0x3d88dc,_0x2fff37));})[_0xfa74('0x3e')](handleError(_0x3d88dc,null));};
\ No newline at end of file
index 6a1b03d..fbf3ea7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9c7=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','lodash'];(function(_0x104a84,_0x285970){var _0x4973ff=function(_0x5064e7){while(--_0x5064e7){_0x104a84['push'](_0x104a84['shift']());}};_0x4973ff(++_0x285970);}(_0xa9c7,0x158));var _0x7a9c=function(_0x20845e,_0x211e78){_0x20845e=_0x20845e-0x0;var _0x28cf2b=_0xa9c7[_0x20845e];return _0x28cf2b;};'use strict';var _=require(_0x7a9c('0x0'));var util=require(_0x7a9c('0x1'));var logger=require(_0x7a9c('0x2'))(_0x7a9c('0x3'));var moment=require('moment');var BPromise=require(_0x7a9c('0x4'));var rp=require(_0x7a9c('0x5'));var fs=require('fs');var path=require(_0x7a9c('0x6'));var rimraf=require(_0x7a9c('0x7'));var config=require('../../config/environment');var attributes=require(_0x7a9c('0x8'));module[_0x7a9c('0x9')]=function(_0x105347,_0x38c98d){return _0x105347[_0x7a9c('0xa')](_0x7a9c('0xb'),attributes,{'tableName':_0x7a9c('0xc'),'paranoid':![],'indexes':[{'name':_0x7a9c('0xd'),'fields':[_0x7a9c('0xe'),'context']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4b10=['mailbox','context','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','VoiceMail','voice_voicemail','mailbox_context'];(function(_0x12f3be,_0x32796a){var _0x551fa4=function(_0x5622ec){while(--_0x5622ec){_0x12f3be['push'](_0x12f3be['shift']());}};_0x551fa4(++_0x32796a);}(_0x4b10,0x132));var _0x04b1=function(_0x14aa83,_0x41aa42){_0x14aa83=_0x14aa83-0x0;var _0x14ddbd=_0x4b10[_0x14aa83];return _0x14ddbd;};'use strict';var _=require(_0x04b1('0x0'));var util=require(_0x04b1('0x1'));var logger=require(_0x04b1('0x2'))(_0x04b1('0x3'));var moment=require(_0x04b1('0x4'));var BPromise=require(_0x04b1('0x5'));var rp=require(_0x04b1('0x6'));var fs=require('fs');var path=require(_0x04b1('0x7'));var rimraf=require(_0x04b1('0x8'));var config=require(_0x04b1('0x9'));var attributes=require(_0x04b1('0xa'));module['exports']=function(_0x22b5cf,_0x33e7c7){return _0x22b5cf['define'](_0x04b1('0xb'),attributes,{'tableName':_0x04b1('0xc'),'paranoid':![],'indexes':[{'name':_0x04b1('0xd'),'fields':[_0x04b1('0xe'),_0x04b1('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
index 8763fea..eca403d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7635=['VoiceMail,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','stringify','error'];(function(_0x286b9e,_0x46a607){var _0x525987=function(_0x21005f){while(--_0x21005f){_0x286b9e['push'](_0x286b9e['shift']());}};_0x525987(++_0x46a607);}(_0x7635,0x1a6));var _0x5763=function(_0x1fa126,_0x2bb034){_0x1fa126=_0x1fa126-0x0;var _0x309ce6=_0x7635[_0x1fa126];return _0x309ce6;};'use strict';var _=require(_0x5763('0x0'));var util=require(_0x5763('0x1'));var moment=require(_0x5763('0x2'));var BPromise=require(_0x5763('0x3'));var rs=require(_0x5763('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5763('0x5'))['db'];var utils=require(_0x5763('0x6'));var logger=require('../../config/logger')(_0x5763('0x7'));var config=require(_0x5763('0x8'));var jayson=require(_0x5763('0x9'));var client=jayson[_0x5763('0xa')][_0x5763('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5121b7,_0x1764e0,_0x4fc956){return new BPromise(function(_0x2ed316,_0x3edf12){return client[_0x5763('0xc')](_0x5121b7,_0x4fc956)[_0x5763('0xd')](function(_0x46d0cc){logger['info']('VoiceMail,\x20%s,\x20%s',_0x1764e0,'request\x20sent');logger[_0x5763('0xe')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x1764e0,_0x5763('0xf'),JSON[_0x5763('0x10')](_0x46d0cc));if(_0x46d0cc['error']){if(_0x46d0cc[_0x5763('0x11')]['code']===0x1f4){logger['error'](_0x5763('0x12'),_0x1764e0,_0x46d0cc['error'][_0x5763('0x13')]);return _0x3edf12(_0x46d0cc[_0x5763('0x11')][_0x5763('0x13')]);}logger[_0x5763('0x11')]('VoiceMail,\x20%s,\x20%s',_0x1764e0,_0x46d0cc[_0x5763('0x11')][_0x5763('0x13')]);return _0x2ed316(_0x46d0cc[_0x5763('0x11')][_0x5763('0x13')]);}else{logger[_0x5763('0x14')]('VoiceMail,\x20%s,\x20%s',_0x1764e0,_0x5763('0xf'));_0x2ed316(_0x46d0cc['result'][_0x5763('0x13')]);}})[_0x5763('0x15')](function(_0x215e05){logger[_0x5763('0x11')](_0x5763('0x12'),_0x1764e0,_0x215e05);_0x3edf12(_0x215e05);});});}
\ No newline at end of file
+var _0xa8a0=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util'];(function(_0x2849d3,_0x558165){var _0x39ace3=function(_0x33c311){while(--_0x33c311){_0x2849d3['push'](_0x2849d3['shift']());}};_0x39ace3(++_0x558165);}(_0xa8a0,0x166));var _0x0a8a=function(_0x182fc4,_0x22cdae){_0x182fc4=_0x182fc4-0x0;var _0x2c0726=_0xa8a0[_0x182fc4];return _0x2c0726;};'use strict';var _=require(_0x0a8a('0x0'));var util=require(_0x0a8a('0x1'));var moment=require(_0x0a8a('0x2'));var BPromise=require(_0x0a8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0a8a('0x4'))['db'];var utils=require(_0x0a8a('0x5'));var logger=require(_0x0a8a('0x6'))(_0x0a8a('0x7'));var config=require('../../config/environment');var jayson=require(_0x0a8a('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xba56cd,_0x4c352c,_0x1645f4){return new BPromise(function(_0x53db0e,_0x3e9214){return client['request'](_0xba56cd,_0x1645f4)[_0x0a8a('0x9')](function(_0x54fe60){logger[_0x0a8a('0xa')](_0x0a8a('0xb'),_0x4c352c,_0x0a8a('0xc'));logger['debug']('VoiceMail,\x20%s,\x20%s,\x20%s',_0x4c352c,_0x0a8a('0xc'),JSON[_0x0a8a('0xd')](_0x54fe60));if(_0x54fe60[_0x0a8a('0xe')]){if(_0x54fe60['error'][_0x0a8a('0xf')]===0x1f4){logger[_0x0a8a('0xe')](_0x0a8a('0xb'),_0x4c352c,_0x54fe60[_0x0a8a('0xe')][_0x0a8a('0x10')]);return _0x3e9214(_0x54fe60[_0x0a8a('0xe')]['message']);}logger[_0x0a8a('0xe')]('VoiceMail,\x20%s,\x20%s',_0x4c352c,_0x54fe60['error'][_0x0a8a('0x10')]);return _0x53db0e(_0x54fe60[_0x0a8a('0xe')][_0x0a8a('0x10')]);}else{logger[_0x0a8a('0xa')](_0x0a8a('0xb'),_0x4c352c,_0x0a8a('0xc'));_0x53db0e(_0x54fe60['result'][_0x0a8a('0x10')]);}})[_0x0a8a('0x11')](function(_0x88bd84){logger[_0x0a8a('0xe')](_0x0a8a('0xb'),_0x4c352c,_0x88bd84);_0x3e9214(_0x88bd84);});});}
\ No newline at end of file
index 163e5af..1328964 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3520=['../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','post','update','delete','destroy','multer','connect-timeout','express'];(function(_0x36f86d,_0x565083){var _0x59b305=function(_0x448eba){while(--_0x448eba){_0x36f86d['push'](_0x36f86d['shift']());}};_0x59b305(++_0x565083);}(_0x3520,0x1bd));var _0x0352=function(_0x50460d,_0x390b0f){_0x50460d=_0x50460d-0x0;var _0x3bb777=_0x3520[_0x50460d];return _0x3bb777;};'use strict';var multer=require(_0x0352('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0352('0x1'));var express=require(_0x0352('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(_0x0352('0x3'));var controller=require('./voiceMailMessage.controller');router[_0x0352('0x4')]('/',auth[_0x0352('0x5')](),controller['index']);router[_0x0352('0x4')](_0x0352('0x6'),auth['isAuthenticated'](),controller[_0x0352('0x7')]);router[_0x0352('0x4')](_0x0352('0x8'),auth['isAuthenticated'](),controller[_0x0352('0x9')]);router[_0x0352('0xa')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x0352('0x6'),auth[_0x0352('0x5')](),controller[_0x0352('0xb')]);router[_0x0352('0xc')](_0x0352('0x6'),auth[_0x0352('0x5')](),controller[_0x0352('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0x46c6=['destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','post','create','put','update','/:id'];(function(_0x243649,_0x570f7a){var _0x422791=function(_0x238526){while(--_0x238526){_0x243649['push'](_0x243649['shift']());}};_0x422791(++_0x570f7a);}(_0x46c6,0x100));var _0x646c=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x46c6[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require(_0x646c('0x0'));var path=require(_0x646c('0x1'));var timeout=require(_0x646c('0x2'));var express=require(_0x646c('0x3'));var router=express[_0x646c('0x4')]();var fs_extra=require(_0x646c('0x5'));var auth=require(_0x646c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x646c('0x7'));var controller=require('./voiceMailMessage.controller');router[_0x646c('0x8')]('/',auth[_0x646c('0x9')](),controller[_0x646c('0xa')]);router['get']('/:id',auth[_0x646c('0x9')](),controller['show']);router[_0x646c('0x8')]('/:id/download',auth[_0x646c('0x9')](),controller['download']);router[_0x646c('0xb')]('/',auth[_0x646c('0x9')](),controller[_0x646c('0xc')]);router[_0x646c('0xd')]('/:id',auth[_0x646c('0x9')](),controller[_0x646c('0xe')]);router['delete'](_0x646c('0xf'),auth['isAuthenticated'](),controller[_0x646c('0x10')]);module['exports']=router;
\ No newline at end of file
index 8d9f034..3097a0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4ff=['VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports'];(function(_0x29b279,_0x4a305c){var _0x5ab324=function(_0x89c098){while(--_0x89c098){_0x29b279['push'](_0x29b279['shift']());}};_0x5ab324(++_0x4a305c);}(_0xc4ff,0x95));var _0xfc4f=function(_0x362abb,_0x12504a){_0x362abb=_0x362abb-0x0;var _0x398e13=_0xc4ff[_0x362abb];return _0x398e13;};'use strict';var Sequelize=require('sequelize');module[_0xfc4f('0x0')]={'name':{'type':Sequelize[_0xfc4f('0x1')],'get':function(_0x20f5dc){return this[_0xfc4f('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xfc4f('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xfc4f('0x4')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xfc4f('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xfc4f('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xfc4f('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xfc4f('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xfc4f('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xfc4f('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xfc4f('0x5')](_0xfc4f('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xfc4f('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xfc4f('0x4')],'defaultValue':''},'stamp':{'type':_0xfc4f('0x7'),'defaultValue':Sequelize[_0xfc4f('0x8')](_0xfc4f('0x9'))}};
\ No newline at end of file
+var _0x72dd=['STRING','BLOB','long','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL','getDataValue','INTEGER'];(function(_0x5ccc89,_0x82a7f){var _0x5c53ca=function(_0x3a7619){while(--_0x3a7619){_0x5ccc89['push'](_0x5ccc89['shift']());}};_0x5c53ca(++_0x82a7f);}(_0x72dd,0xe6));var _0xd72d=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x72dd[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0xd72d('0x0'));module['exports']={'name':{'type':Sequelize[_0xd72d('0x1')],'get':function(_0x2d18df){return this[_0xd72d('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xd72d('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xd72d('0x4')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xd72d('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xd72d('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xd72d('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xd72d('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xd72d('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xd72d('0x5')](_0xd72d('0x6')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xd72d('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0xd72d('0x7')](_0xd72d('0x8'))}};
\ No newline at end of file
index ed17459..7def748 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa671=['request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','Content-Range','apply','reject','save','then','destroy','sendStatus','name','send','index','map','VoiceMailMessage','fieldName','key','model','differenceBy','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','include','show','params','rawAttributes','intersection','find','create','catch','update','body','download','recording','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','msg_id','attachment;\x20filename=\x22','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0xd61bf7,_0x572afc){var _0x36fd5d=function(_0x6ccbdf){while(--_0x6ccbdf){_0xd61bf7['push'](_0xd61bf7['shift']());}};_0x36fd5d(++_0x572afc);}(_0xa671,0x9c));var _0x1a67=function(_0x1a8396,_0x280126){_0x1a8396=_0x1a8396-0x0;var _0x29ce3=_0xa671[_0x1a8396];return _0x29ce3;};'use strict';var emlformat=require(_0x1a67('0x0'));var rimraf=require(_0x1a67('0x1'));var zipdir=require(_0x1a67('0x2'));var jsonpatch=require(_0x1a67('0x3'));var rp=require(_0x1a67('0x4'));var moment=require('moment');var BPromise=require(_0x1a67('0x5'));var Mustache=require(_0x1a67('0x6'));var util=require(_0x1a67('0x7'));var path=require('path');var sox=require(_0x1a67('0x8'));var csv=require(_0x1a67('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1a67('0xa'));var _=require(_0x1a67('0xb'));var squel=require('squel');var crypto=require(_0x1a67('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1a67('0xd'));var toCsv=require(_0x1a67('0x9'));var querystring=require(_0x1a67('0xe'));var Papa=require(_0x1a67('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1a67('0x10'));var as=require(_0x1a67('0x11'));var hardwareService=require(_0x1a67('0x12'));var logger=require(_0x1a67('0x13'))(_0x1a67('0x14'));var utils=require(_0x1a67('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1a67('0x16'));var db=require(_0x1a67('0x17'))['db'];function respondWithStatusCode(_0x57eb72,_0x4ad06a){_0x4ad06a=_0x4ad06a||0xcc;return function(_0xbfe168){if(_0xbfe168){return _0x57eb72['sendStatus'](_0x4ad06a);}return _0x57eb72['status'](_0x4ad06a)[_0x1a67('0x18')]();};}function respondWithResult(_0x42fcc5,_0x5a85b2){_0x5a85b2=_0x5a85b2||0xc8;return function(_0x2bd675){if(_0x2bd675){return _0x42fcc5[_0x1a67('0x19')](_0x5a85b2)[_0x1a67('0x1a')](_0x2bd675);}};}function respondWithFilteredResult(_0xd2d7,_0xe5035a){return function(_0x975271){if(_0x975271){var _0x8391f1=typeof _0xe5035a[_0x1a67('0x1b')]===_0x1a67('0x1c')&&typeof _0xe5035a[_0x1a67('0x1d')]===_0x1a67('0x1c');var _0x1179cc=_0x975271['count'];var _0xaf9f88=_0x8391f1?0x0:_0xe5035a[_0x1a67('0x1b')];var _0x286288=_0x8391f1?_0x975271['count']:_0xe5035a[_0x1a67('0x1b')]+_0xe5035a[_0x1a67('0x1d')];var _0x3dfeaa;if(_0x286288>=_0x1179cc){_0x286288=_0x1179cc;_0x3dfeaa=0xc8;}else{_0x3dfeaa=0xce;}_0xd2d7[_0x1a67('0x19')](_0x3dfeaa);return _0xd2d7['set'](_0x1a67('0x1e'),_0xaf9f88+'-'+_0x286288+'/'+_0x1179cc)[_0x1a67('0x1a')](_0x975271);}return null;};}function patchUpdates(_0x3ed77c){return function(_0x2570e0){try{jsonpatch[_0x1a67('0x1f')](_0x2570e0,_0x3ed77c,!![]);}catch(_0x10b701){return BPromise[_0x1a67('0x20')](_0x10b701);}return _0x2570e0[_0x1a67('0x21')]();};}function saveUpdates(_0x787275,_0x35bd88){return function(_0x5e449b){if(_0x5e449b){return _0x5e449b['update'](_0x787275)[_0x1a67('0x22')](function(_0x20a9d2){return _0x20a9d2;});}return null;};}function removeEntity(_0x3a3664,_0x5613eb){return function(_0x4375ac){if(_0x4375ac){return _0x4375ac[_0x1a67('0x23')]()[_0x1a67('0x22')](function(){_0x3a3664[_0x1a67('0x19')](0xcc)[_0x1a67('0x18')]();});}};}function handleEntityNotFound(_0xcef8f5,_0x1a5fda){return function(_0x1cfd12){if(!_0x1cfd12){_0xcef8f5[_0x1a67('0x24')](0x194);}return _0x1cfd12;};}function handleError(_0x53666d,_0x3d52a0){_0x3d52a0=_0x3d52a0||0x1f4;return function(_0x49f979){logger['error'](_0x49f979['stack']);if(_0x49f979[_0x1a67('0x25')]){delete _0x49f979[_0x1a67('0x25')];}_0x53666d[_0x1a67('0x19')](_0x3d52a0)[_0x1a67('0x26')](_0x49f979);};}exports[_0x1a67('0x27')]=function(_0x8e6695,_0x5938bf){var _0x497c01={},_0x241364={},_0x45cdfe={'count':0x0,'rows':[]};var _0x1efb0f=_[_0x1a67('0x28')](db[_0x1a67('0x29')]['rawAttributes'],function(_0x5ac843){return{'name':_0x5ac843[_0x1a67('0x2a')],'type':_0x5ac843['type'][_0x1a67('0x2b')]};});_0x241364[_0x1a67('0x2c')]=_[_0x1a67('0x2d')](_[_0x1a67('0x28')](_0x1efb0f,_0x1a67('0x25')),[_0x1a67('0x25')]);_0x241364[_0x1a67('0x2e')]=_[_0x1a67('0x2f')](_0x8e6695[_0x1a67('0x2e')]);_0x241364[_0x1a67('0x30')]=_['intersection'](_0x241364[_0x1a67('0x2c')],_0x241364['query']);_0x497c01[_0x1a67('0x31')]=_['intersection'](_0x241364[_0x1a67('0x2c')],qs[_0x1a67('0x32')](_0x8e6695[_0x1a67('0x2e')][_0x1a67('0x32')]));_0x497c01[_0x1a67('0x31')]=_0x497c01['attributes'][_0x1a67('0x33')]?_0x497c01[_0x1a67('0x31')]:_0x241364[_0x1a67('0x2c')];if(!_0x8e6695[_0x1a67('0x2e')][_0x1a67('0x34')](_0x1a67('0x35'))){_0x497c01[_0x1a67('0x1d')]=qs[_0x1a67('0x1d')](_0x8e6695[_0x1a67('0x2e')][_0x1a67('0x1d')]);_0x497c01[_0x1a67('0x1b')]=qs[_0x1a67('0x1b')](_0x8e6695[_0x1a67('0x2e')][_0x1a67('0x1b')]);}_0x497c01[_0x1a67('0x36')]=qs[_0x1a67('0x37')](_0x8e6695[_0x1a67('0x2e')][_0x1a67('0x37')]);_0x497c01['where']=qs[_0x1a67('0x30')](_[_0x1a67('0x38')](_0x8e6695[_0x1a67('0x2e')],_0x241364[_0x1a67('0x30')]),_0x1efb0f);if(_0x8e6695[_0x1a67('0x2e')][_0x1a67('0x39')]){_0x497c01[_0x1a67('0x3a')]=_[_0x1a67('0x3b')](_0x497c01['where'],{'$or':_[_0x1a67('0x28')](_0x1efb0f,function(_0x27309d){if(_0x27309d['type']!==_0x1a67('0x3c')){var _0x3545a3={};_0x3545a3[_0x27309d[_0x1a67('0x25')]]={'$like':'%'+_0x8e6695[_0x1a67('0x2e')][_0x1a67('0x39')]+'%'};return _0x3545a3;}})});}_0x497c01=_[_0x1a67('0x3b')]({},_0x497c01,_0x8e6695[_0x1a67('0x3d')]);var _0x3991ea={'where':_0x497c01[_0x1a67('0x3a')]};return db[_0x1a67('0x29')][_0x1a67('0x3e')](_0x3991ea)[_0x1a67('0x22')](function(_0x46fbf5){_0x45cdfe[_0x1a67('0x3e')]=_0x46fbf5;if(_0x8e6695[_0x1a67('0x2e')]['includeAll']){_0x497c01[_0x1a67('0x3f')]=[{'all':!![]}];}return db[_0x1a67('0x29')]['findAll'](_0x497c01);})[_0x1a67('0x22')](function(_0xe1d23a){_0x45cdfe['rows']=_0xe1d23a;return _0x45cdfe;})[_0x1a67('0x22')](respondWithFilteredResult(_0x5938bf,_0x497c01))['catch'](handleError(_0x5938bf,null));};exports[_0x1a67('0x40')]=function(_0x1f00d2,_0x474b3d){var _0x2fdeb3={'raw':!![],'where':{'id':_0x1f00d2[_0x1a67('0x41')]['id']}},_0x5de4a0={};_0x5de4a0[_0x1a67('0x2c')]=_['keys'](db[_0x1a67('0x29')][_0x1a67('0x42')]);_0x5de4a0[_0x1a67('0x2e')]=_[_0x1a67('0x2f')](_0x1f00d2[_0x1a67('0x2e')]);_0x5de4a0['filters']=_[_0x1a67('0x43')](_0x5de4a0[_0x1a67('0x2c')],_0x5de4a0['query']);_0x2fdeb3['attributes']=_[_0x1a67('0x43')](_0x5de4a0[_0x1a67('0x2c')],qs['fields'](_0x1f00d2[_0x1a67('0x2e')][_0x1a67('0x32')]));_0x2fdeb3[_0x1a67('0x31')]=_0x2fdeb3[_0x1a67('0x31')][_0x1a67('0x33')]?_0x2fdeb3['attributes']:_0x5de4a0[_0x1a67('0x2c')];if(_0x1f00d2[_0x1a67('0x2e')]['includeAll']){_0x2fdeb3[_0x1a67('0x3f')]=[{'all':!![]}];}_0x2fdeb3=_[_0x1a67('0x3b')]({},_0x2fdeb3,_0x1f00d2[_0x1a67('0x3d')]);return db[_0x1a67('0x29')][_0x1a67('0x44')](_0x2fdeb3)['then'](handleEntityNotFound(_0x474b3d,null))[_0x1a67('0x22')](respondWithResult(_0x474b3d,null))['catch'](handleError(_0x474b3d,null));};exports[_0x1a67('0x45')]=function(_0x127453,_0x312abe){return db['VoiceMailMessage']['create'](_0x127453['body'],{})[_0x1a67('0x22')](respondWithResult(_0x312abe,0xc9))[_0x1a67('0x46')](handleError(_0x312abe,null));};exports[_0x1a67('0x47')]=function(_0x50c8ba,_0x139f0c){if(_0x50c8ba[_0x1a67('0x48')]['id']){delete _0x50c8ba[_0x1a67('0x48')]['id'];}return db[_0x1a67('0x29')][_0x1a67('0x44')]({'where':{'id':_0x50c8ba[_0x1a67('0x41')]['id']}})[_0x1a67('0x22')](handleEntityNotFound(_0x139f0c,null))[_0x1a67('0x22')](saveUpdates(_0x50c8ba['body'],null))[_0x1a67('0x22')](respondWithResult(_0x139f0c,null))['catch'](handleError(_0x139f0c,null));};exports[_0x1a67('0x23')]=function(_0x4a8f57,_0x3b4010){return db[_0x1a67('0x29')]['find']({'where':{'id':_0x4a8f57[_0x1a67('0x41')]['id']}})['then'](handleEntityNotFound(_0x3b4010,null))[_0x1a67('0x22')](removeEntity(_0x3b4010,null))[_0x1a67('0x46')](handleError(_0x3b4010,null));};exports[_0x1a67('0x49')]=function(_0x2c14ac,_0x35530d,_0x4258e1){return db[_0x1a67('0x29')]['find']({'where':{'id':_0x2c14ac[_0x1a67('0x41')]['id']},'attributes':['id',_0x1a67('0x4a'),'msg_id']})[_0x1a67('0x22')](handleEntityNotFound(_0x35530d,null))[_0x1a67('0x22')](function(_0x26de40){if(_0x26de40){if(!_0x26de40[_0x1a67('0x4a')]){throw new db['Sequelize'][(_0x1a67('0x4b'))](_0x1a67('0x4c'));}var _0x1765fd={'Content-Type':_0x1a67('0x4d'),'Content-Disposition':'attachment'};if(_0x26de40[_0x1a67('0x4e')]){_0x1765fd['Content-Disposition']=_0x1a67('0x4f')+_0x26de40[_0x1a67('0x4e')]+'.wav\x22';}_0x35530d['set'](_0x1765fd);return _0x35530d[_0x1a67('0x26')](new Buffer(_0x26de40[_0x1a67('0x4a')]));}})[_0x1a67('0x46')](handleError(_0x35530d,null));};
\ No newline at end of file
+var _0xf9b5=['fields','options','find','create','body','download','msg_id','recording','ValidationError','audio/wav','attachment','attachment;\x20filename=\x22','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','reject','save','then','destroy','error','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','key','differenceBy','query','keys','filters','model','attributes','intersection','length','hasOwnProperty','order','sort','filter','merge','type','VIRTUAL','where','includeAll','include','findAll','rows','catch','params'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf9b5,0xa6));var _0x5f9b=function(_0x12ab9c,_0x1ad557){_0x12ab9c=_0x12ab9c-0x0;var _0x2a3e39=_0xf9b5[_0x12ab9c];return _0x2a3e39;};'use strict';var emlformat=require(_0x5f9b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5f9b('0x1'));var rp=require(_0x5f9b('0x2'));var moment=require('moment');var BPromise=require(_0x5f9b('0x3'));var Mustache=require(_0x5f9b('0x4'));var util=require(_0x5f9b('0x5'));var path=require(_0x5f9b('0x6'));var sox=require('sox');var csv=require(_0x5f9b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5f9b('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5f9b('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x5f9b('0xa'));var toCsv=require(_0x5f9b('0x7'));var querystring=require(_0x5f9b('0xb'));var Papa=require(_0x5f9b('0xc'));var Redis=require('ioredis');var authService=require(_0x5f9b('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5f9b('0xe'));var logger=require(_0x5f9b('0xf'))('api');var utils=require(_0x5f9b('0x10'));var config=require(_0x5f9b('0x11'));var licenseUtil=require(_0x5f9b('0x12'));var db=require(_0x5f9b('0x13'))['db'];function respondWithStatusCode(_0x734f05,_0x452965){_0x452965=_0x452965||0xcc;return function(_0x17b15d){if(_0x17b15d){return _0x734f05[_0x5f9b('0x14')](_0x452965);}return _0x734f05[_0x5f9b('0x15')](_0x452965)[_0x5f9b('0x16')]();};}function respondWithResult(_0x533789,_0x113613){_0x113613=_0x113613||0xc8;return function(_0x2fd5c8){if(_0x2fd5c8){return _0x533789['status'](_0x113613)[_0x5f9b('0x17')](_0x2fd5c8);}};}function respondWithFilteredResult(_0x1f1871,_0x5a58ae){return function(_0x52e805){if(_0x52e805){var _0x44c2c4=typeof _0x5a58ae['offset']==='undefined'&&typeof _0x5a58ae[_0x5f9b('0x18')]===_0x5f9b('0x19');var _0x4e6fda=_0x52e805[_0x5f9b('0x1a')];var _0x4fbf4d=_0x44c2c4?0x0:_0x5a58ae[_0x5f9b('0x1b')];var _0x30a2ea=_0x44c2c4?_0x52e805[_0x5f9b('0x1a')]:_0x5a58ae[_0x5f9b('0x1b')]+_0x5a58ae[_0x5f9b('0x18')];var _0x1393c6;if(_0x30a2ea>=_0x4e6fda){_0x30a2ea=_0x4e6fda;_0x1393c6=0xc8;}else{_0x1393c6=0xce;}_0x1f1871[_0x5f9b('0x15')](_0x1393c6);return _0x1f1871[_0x5f9b('0x1c')]('Content-Range',_0x4fbf4d+'-'+_0x30a2ea+'/'+_0x4e6fda)['json'](_0x52e805);}return null;};}function patchUpdates(_0x708bc0){return function(_0x58674a){try{jsonpatch[_0x5f9b('0x1d')](_0x58674a,_0x708bc0,!![]);}catch(_0x5e5ce2){return BPromise[_0x5f9b('0x1e')](_0x5e5ce2);}return _0x58674a[_0x5f9b('0x1f')]();};}function saveUpdates(_0x2ef04b,_0x293a0b){return function(_0x15087a){if(_0x15087a){return _0x15087a['update'](_0x2ef04b)[_0x5f9b('0x20')](function(_0x1db538){return _0x1db538;});}return null;};}function removeEntity(_0x305b23,_0x51fc3f){return function(_0x1be85c){if(_0x1be85c){return _0x1be85c[_0x5f9b('0x21')]()[_0x5f9b('0x20')](function(){_0x305b23[_0x5f9b('0x15')](0xcc)[_0x5f9b('0x16')]();});}};}function handleEntityNotFound(_0x4072e2,_0x8c27c7){return function(_0x365df4){if(!_0x365df4){_0x4072e2['sendStatus'](0x194);}return _0x365df4;};}function handleError(_0x95ce7a,_0x4fbeab){_0x4fbeab=_0x4fbeab||0x1f4;return function(_0x3b0654){logger[_0x5f9b('0x22')](_0x3b0654['stack']);if(_0x3b0654[_0x5f9b('0x23')]){delete _0x3b0654['name'];}_0x95ce7a[_0x5f9b('0x15')](_0x4fbeab)[_0x5f9b('0x24')](_0x3b0654);};}exports[_0x5f9b('0x25')]=function(_0x329043,_0xe50f2c){var _0x43a028={},_0x533cf4={},_0xa6d4ef={'count':0x0,'rows':[]};var _0x49f1ab=_[_0x5f9b('0x26')](db[_0x5f9b('0x27')][_0x5f9b('0x28')],function(_0x51cc46){return{'name':_0x51cc46[_0x5f9b('0x29')],'type':_0x51cc46['type'][_0x5f9b('0x2a')]};});_0x533cf4['model']=_[_0x5f9b('0x2b')](_[_0x5f9b('0x26')](_0x49f1ab,_0x5f9b('0x23')),[_0x5f9b('0x23')]);_0x533cf4[_0x5f9b('0x2c')]=_[_0x5f9b('0x2d')](_0x329043[_0x5f9b('0x2c')]);_0x533cf4[_0x5f9b('0x2e')]=_['intersection'](_0x533cf4[_0x5f9b('0x2f')],_0x533cf4[_0x5f9b('0x2c')]);_0x43a028[_0x5f9b('0x30')]=_[_0x5f9b('0x31')](_0x533cf4[_0x5f9b('0x2f')],qs['fields'](_0x329043[_0x5f9b('0x2c')]['fields']));_0x43a028[_0x5f9b('0x30')]=_0x43a028[_0x5f9b('0x30')][_0x5f9b('0x32')]?_0x43a028[_0x5f9b('0x30')]:_0x533cf4[_0x5f9b('0x2f')];if(!_0x329043[_0x5f9b('0x2c')][_0x5f9b('0x33')]('nolimit')){_0x43a028[_0x5f9b('0x18')]=qs[_0x5f9b('0x18')](_0x329043[_0x5f9b('0x2c')][_0x5f9b('0x18')]);_0x43a028[_0x5f9b('0x1b')]=qs[_0x5f9b('0x1b')](_0x329043['query'][_0x5f9b('0x1b')]);}_0x43a028[_0x5f9b('0x34')]=qs[_0x5f9b('0x35')](_0x329043[_0x5f9b('0x2c')][_0x5f9b('0x35')]);_0x43a028['where']=qs[_0x5f9b('0x2e')](_['pick'](_0x329043[_0x5f9b('0x2c')],_0x533cf4[_0x5f9b('0x2e')]),_0x49f1ab);if(_0x329043[_0x5f9b('0x2c')][_0x5f9b('0x36')]){_0x43a028['where']=_[_0x5f9b('0x37')](_0x43a028['where'],{'$or':_[_0x5f9b('0x26')](_0x49f1ab,function(_0x177467){if(_0x177467[_0x5f9b('0x38')]!==_0x5f9b('0x39')){var _0x304026={};_0x304026[_0x177467['name']]={'$like':'%'+_0x329043['query'][_0x5f9b('0x36')]+'%'};return _0x304026;}})});}_0x43a028=_[_0x5f9b('0x37')]({},_0x43a028,_0x329043['options']);var _0x1270e6={'where':_0x43a028[_0x5f9b('0x3a')]};return db['VoiceMailMessage']['count'](_0x1270e6)[_0x5f9b('0x20')](function(_0x34817a){_0xa6d4ef['count']=_0x34817a;if(_0x329043[_0x5f9b('0x2c')][_0x5f9b('0x3b')]){_0x43a028[_0x5f9b('0x3c')]=[{'all':!![]}];}return db[_0x5f9b('0x27')][_0x5f9b('0x3d')](_0x43a028);})[_0x5f9b('0x20')](function(_0x5f54d4){_0xa6d4ef[_0x5f9b('0x3e')]=_0x5f54d4;return _0xa6d4ef;})['then'](respondWithFilteredResult(_0xe50f2c,_0x43a028))[_0x5f9b('0x3f')](handleError(_0xe50f2c,null));};exports['show']=function(_0x56b877,_0x2f11be){var _0x2d6e5d={'raw':!![],'where':{'id':_0x56b877[_0x5f9b('0x40')]['id']}},_0x498061={};_0x498061[_0x5f9b('0x2f')]=_[_0x5f9b('0x2d')](db[_0x5f9b('0x27')][_0x5f9b('0x28')]);_0x498061[_0x5f9b('0x2c')]=_['keys'](_0x56b877['query']);_0x498061['filters']=_[_0x5f9b('0x31')](_0x498061[_0x5f9b('0x2f')],_0x498061['query']);_0x2d6e5d[_0x5f9b('0x30')]=_[_0x5f9b('0x31')](_0x498061[_0x5f9b('0x2f')],qs[_0x5f9b('0x41')](_0x56b877[_0x5f9b('0x2c')][_0x5f9b('0x41')]));_0x2d6e5d[_0x5f9b('0x30')]=_0x2d6e5d[_0x5f9b('0x30')][_0x5f9b('0x32')]?_0x2d6e5d['attributes']:_0x498061[_0x5f9b('0x2f')];if(_0x56b877[_0x5f9b('0x2c')][_0x5f9b('0x3b')]){_0x2d6e5d['include']=[{'all':!![]}];}_0x2d6e5d=_['merge']({},_0x2d6e5d,_0x56b877[_0x5f9b('0x42')]);return db[_0x5f9b('0x27')][_0x5f9b('0x43')](_0x2d6e5d)[_0x5f9b('0x20')](handleEntityNotFound(_0x2f11be,null))[_0x5f9b('0x20')](respondWithResult(_0x2f11be,null))[_0x5f9b('0x3f')](handleError(_0x2f11be,null));};exports[_0x5f9b('0x44')]=function(_0x164760,_0x20fc16){return db[_0x5f9b('0x27')]['create'](_0x164760[_0x5f9b('0x45')],{})[_0x5f9b('0x20')](respondWithResult(_0x20fc16,0xc9))[_0x5f9b('0x3f')](handleError(_0x20fc16,null));};exports['update']=function(_0x3af502,_0x4c7fda){if(_0x3af502[_0x5f9b('0x45')]['id']){delete _0x3af502[_0x5f9b('0x45')]['id'];}return db[_0x5f9b('0x27')][_0x5f9b('0x43')]({'where':{'id':_0x3af502['params']['id']}})[_0x5f9b('0x20')](handleEntityNotFound(_0x4c7fda,null))[_0x5f9b('0x20')](saveUpdates(_0x3af502['body'],null))[_0x5f9b('0x20')](respondWithResult(_0x4c7fda,null))[_0x5f9b('0x3f')](handleError(_0x4c7fda,null));};exports['destroy']=function(_0x5acfa9,_0x2baefb){return db['VoiceMailMessage'][_0x5f9b('0x43')]({'where':{'id':_0x5acfa9['params']['id']}})[_0x5f9b('0x20')](handleEntityNotFound(_0x2baefb,null))['then'](removeEntity(_0x2baefb,null))[_0x5f9b('0x3f')](handleError(_0x2baefb,null));};exports[_0x5f9b('0x46')]=function(_0x12895b,_0x1e2bf2,_0x16859a){return db[_0x5f9b('0x27')][_0x5f9b('0x43')]({'where':{'id':_0x12895b['params']['id']},'attributes':['id','recording',_0x5f9b('0x47')]})[_0x5f9b('0x20')](handleEntityNotFound(_0x1e2bf2,null))[_0x5f9b('0x20')](function(_0x4519b6){if(_0x4519b6){if(!_0x4519b6[_0x5f9b('0x48')]){throw new db['Sequelize'][(_0x5f9b('0x49'))]('VoiceMailMessage\x20not\x20found');}var _0x61b250={'Content-Type':_0x5f9b('0x4a'),'Content-Disposition':_0x5f9b('0x4b')};if(_0x4519b6[_0x5f9b('0x47')]){_0x61b250['Content-Disposition']=_0x5f9b('0x4c')+_0x4519b6[_0x5f9b('0x47')]+'.wav\x22';}_0x1e2bf2[_0x5f9b('0x1c')](_0x61b250);return _0x1e2bf2[_0x5f9b('0x24')](new Buffer(_0x4519b6[_0x5f9b('0x48')]));}})['catch'](handleError(_0x1e2bf2,null));};
\ No newline at end of file
index a591888..a8ba555 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2570=['util','../../config/logger','api','moment','bluebird','request-promise','path','./voiceMailMessage.attributes','exports','VoiceMailMessage','dir','lodash'];(function(_0x4a74d6,_0x226bed){var _0x308b76=function(_0x576180){while(--_0x576180){_0x4a74d6['push'](_0x4a74d6['shift']());}};_0x308b76(++_0x226bed);}(_0x2570,0x14f));var _0x0257=function(_0x19ac6d,_0x3fe806){_0x19ac6d=_0x19ac6d-0x0;var _0x11a628=_0x2570[_0x19ac6d];return _0x11a628;};'use strict';var _=require(_0x0257('0x0'));var util=require(_0x0257('0x1'));var logger=require(_0x0257('0x2'))(_0x0257('0x3'));var moment=require(_0x0257('0x4'));var BPromise=require(_0x0257('0x5'));var rp=require(_0x0257('0x6'));var fs=require('fs');var path=require(_0x0257('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0257('0x8'));module[_0x0257('0x9')]=function(_0x270b49,_0x33a034){return _0x270b49['define'](_0x0257('0xa'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':'dir','fields':[_0x0257('0xb')]}],'timestamps':![]});};
\ No newline at end of file
+var _0xc86b=['voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','define','VoiceMailMessage'];(function(_0x3f0486,_0xe58b52){var _0xb70e91=function(_0x4882ed){while(--_0x4882ed){_0x3f0486['push'](_0x3f0486['shift']());}};_0xb70e91(++_0xe58b52);}(_0xc86b,0x89));var _0xbc86=function(_0x424ef4,_0x330fa0){_0x424ef4=_0x424ef4-0x0;var _0x40cb6f=_0xc86b[_0x424ef4];return _0x40cb6f;};'use strict';var _=require(_0xbc86('0x0'));var util=require(_0xbc86('0x1'));var logger=require(_0xbc86('0x2'))(_0xbc86('0x3'));var moment=require(_0xbc86('0x4'));var BPromise=require(_0xbc86('0x5'));var rp=require(_0xbc86('0x6'));var fs=require('fs');var path=require(_0xbc86('0x7'));var rimraf=require(_0xbc86('0x8'));var config=require(_0xbc86('0x9'));var attributes=require(_0xbc86('0xa'));module['exports']=function(_0x4929af,_0x5091bd){return _0x4929af[_0xbc86('0xb')](_0xbc86('0xc'),attributes,{'tableName':_0xbc86('0xd'),'paranoid':![],'indexes':[{'name':_0xbc86('0xe'),'fields':[_0xbc86('0xe')]}],'timestamps':![]});};
\ No newline at end of file
index 17f12ca..817ef3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc30b=['request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc30b,0x120));var _0xbc30=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xc30b[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0xbc30('0x0'));var util=require(_0xbc30('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbc30('0x2'));var fs=require('fs');var Redis=require(_0xbc30('0x3'));var db=require(_0xbc30('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbc30('0x5'))(_0xbc30('0x6'));var config=require(_0xbc30('0x7'));var jayson=require(_0xbc30('0x8'));var client=jayson[_0xbc30('0x9')][_0xbc30('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1bacca,_0x2dd0cb,_0x5409ab){return new BPromise(function(_0x343502,_0x18480d){return client[_0xbc30('0xb')](_0x1bacca,_0x5409ab)[_0xbc30('0xc')](function(_0x3e8ea4){logger[_0xbc30('0xd')](_0xbc30('0xe'),_0x2dd0cb,_0xbc30('0xf'));logger[_0xbc30('0x10')](_0xbc30('0x11'),_0x2dd0cb,_0xbc30('0xf'),JSON['stringify'](_0x3e8ea4));if(_0x3e8ea4[_0xbc30('0x12')]){if(_0x3e8ea4[_0xbc30('0x12')][_0xbc30('0x13')]===0x1f4){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x2dd0cb,_0x3e8ea4[_0xbc30('0x12')][_0xbc30('0x14')]);return _0x18480d(_0x3e8ea4[_0xbc30('0x12')]['message']);}logger[_0xbc30('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x2dd0cb,_0x3e8ea4[_0xbc30('0x12')][_0xbc30('0x14')]);return _0x343502(_0x3e8ea4[_0xbc30('0x12')][_0xbc30('0x14')]);}else{logger[_0xbc30('0xd')]('VoiceMailMessage,\x20%s,\x20%s',_0x2dd0cb,'request\x20sent');_0x343502(_0x3e8ea4[_0xbc30('0x15')][_0xbc30('0x14')]);}})[_0xbc30('0x16')](function(_0xdf7be1){logger[_0xbc30('0x12')](_0xbc30('0xe'),_0x2dd0cb,_0xdf7be1);_0x18480d(_0xdf7be1);});});}
\ No newline at end of file
+var _0xb672=['ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb672,0xb3));var _0x2b67=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xb672[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x2b67('0x0'));var util=require(_0x2b67('0x1'));var moment=require(_0x2b67('0x2'));var BPromise=require(_0x2b67('0x3'));var rs=require(_0x2b67('0x4'));var fs=require('fs');var Redis=require(_0x2b67('0x5'));var db=require(_0x2b67('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2b67('0x7'));var config=require('../../config/environment');var jayson=require(_0x2b67('0x8'));var client=jayson[_0x2b67('0x9')][_0x2b67('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c8d10,_0x4c14db,_0x18a7bb){return new BPromise(function(_0x23f7d5,_0x2d5f6e){return client[_0x2b67('0xb')](_0x2c8d10,_0x18a7bb)[_0x2b67('0xc')](function(_0x188095){logger[_0x2b67('0xd')]('VoiceMailMessage,\x20%s,\x20%s',_0x4c14db,_0x2b67('0xe'));logger[_0x2b67('0xf')](_0x2b67('0x10'),_0x4c14db,_0x2b67('0xe'),JSON[_0x2b67('0x11')](_0x188095));if(_0x188095['error']){if(_0x188095[_0x2b67('0x12')][_0x2b67('0x13')]===0x1f4){logger[_0x2b67('0x12')](_0x2b67('0x14'),_0x4c14db,_0x188095[_0x2b67('0x12')][_0x2b67('0x15')]);return _0x2d5f6e(_0x188095[_0x2b67('0x12')][_0x2b67('0x15')]);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x4c14db,_0x188095['error'][_0x2b67('0x15')]);return _0x23f7d5(_0x188095[_0x2b67('0x12')][_0x2b67('0x15')]);}else{logger[_0x2b67('0xd')](_0x2b67('0x14'),_0x4c14db,'request\x20sent');_0x23f7d5(_0x188095['result'][_0x2b67('0x15')]);}})[_0x2b67('0x16')](function(_0x2332cf){logger[_0x2b67('0x12')](_0x2b67('0x14'),_0x4c14db,_0x2332cf);_0x2d5f6e(_0x2332cf);});});}
\ No newline at end of file
index 3100db5..31f6b08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87eb=['create','post','addSound','/:id','update','delete','destroy','/:id/sounds/:id2','removeSound','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','isAuthenticated','index','show','get','/:id/sounds'];(function(_0x202aa2,_0x584b66){var _0x4e8000=function(_0x400b30){while(--_0x400b30){_0x202aa2['push'](_0x202aa2['shift']());}};_0x4e8000(++_0x584b66);}(_0x87eb,0x81));var _0xb87e=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x87eb[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require(_0xb87e('0x0'));var util=require(_0xb87e('0x1'));var path=require(_0xb87e('0x2'));var timeout=require(_0xb87e('0x3'));var express=require(_0xb87e('0x4'));var router=express[_0xb87e('0x5')]();var fs_extra=require(_0xb87e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xb87e('0x7'));var config=require(_0xb87e('0x8'));var controller=require(_0xb87e('0x9'));router['get']('/',auth[_0xb87e('0xa')](),controller[_0xb87e('0xb')]);router['get']('/:id',auth[_0xb87e('0xa')](),controller[_0xb87e('0xc')]);router[_0xb87e('0xd')](_0xb87e('0xe'),auth['isAuthenticated'](),controller['getSounds']);router['post']('/',auth[_0xb87e('0xa')](),controller[_0xb87e('0xf')]);router[_0xb87e('0x10')]('/:id/sounds',auth[_0xb87e('0xa')](),controller[_0xb87e('0x11')]);router['put'](_0xb87e('0x12'),auth[_0xb87e('0xa')](),controller[_0xb87e('0x13')]);router[_0xb87e('0x14')](_0xb87e('0x12'),auth[_0xb87e('0xa')](),controller[_0xb87e('0x15')]);router[_0xb87e('0x14')](_0xb87e('0x16'),auth[_0xb87e('0xa')](),controller[_0xb87e('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0x1b4d=['addSound','put','update','delete','/:id/sounds/:id2','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','/:id/sounds','getSounds','post','create'];(function(_0x39f5bf,_0x565f0f){var _0x4c964f=function(_0x19446b){while(--_0x19446b){_0x39f5bf['push'](_0x39f5bf['shift']());}};_0x4c964f(++_0x565f0f);}(_0x1b4d,0x10d));var _0xd1b4=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x1b4d[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require(_0xd1b4('0x0'));var util=require('util');var path=require(_0xd1b4('0x1'));var timeout=require(_0xd1b4('0x2'));var express=require(_0xd1b4('0x3'));var router=express[_0xd1b4('0x4')]();var fs_extra=require(_0xd1b4('0x5'));var auth=require(_0xd1b4('0x6'));var interaction=require(_0xd1b4('0x7'));var config=require(_0xd1b4('0x8'));var controller=require(_0xd1b4('0x9'));router[_0xd1b4('0xa')]('/',auth[_0xd1b4('0xb')](),controller['index']);router[_0xd1b4('0xa')](_0xd1b4('0xc'),auth[_0xd1b4('0xb')](),controller['show']);router[_0xd1b4('0xa')](_0xd1b4('0xd'),auth[_0xd1b4('0xb')](),controller[_0xd1b4('0xe')]);router[_0xd1b4('0xf')]('/',auth[_0xd1b4('0xb')](),controller[_0xd1b4('0x10')]);router[_0xd1b4('0xf')](_0xd1b4('0xd'),auth[_0xd1b4('0xb')](),controller[_0xd1b4('0x11')]);router[_0xd1b4('0x12')](_0xd1b4('0xc'),auth[_0xd1b4('0xb')](),controller[_0xd1b4('0x13')]);router['delete'](_0xd1b4('0xc'),auth[_0xd1b4('0xb')](),controller['destroy']);router[_0xd1b4('0x14')](_0xd1b4('0x15'),auth[_0xd1b4('0xb')](),controller['removeSound']);module['exports']=router;
\ No newline at end of file
index eedef7e..af05b7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0c7=['BOOLEAN','sequelize','exports','STRING','name','custom','files','mp3nb','quietmp3nb','alpha'];(function(_0x14d402,_0x5d4672){var _0x27e28d=function(_0x2db5f5){while(--_0x2db5f5){_0x14d402['push'](_0x14d402['shift']());}};_0x27e28d(++_0x5d4672);}(_0xa0c7,0x14b));var _0x7a0c=function(_0x251304,_0x4faf19){_0x251304=_0x251304-0x0;var _0x201b58=_0xa0c7[_0x251304];return _0x201b58;};'use strict';var Sequelize=require(_0x7a0c('0x0'));module[_0x7a0c('0x1')]={'name':{'type':Sequelize[_0x7a0c('0x2')],'allowNull':![],'unique':_0x7a0c('0x3')},'mode':{'type':Sequelize['ENUM'](_0x7a0c('0x4'),_0x7a0c('0x5'),_0x7a0c('0x6'),_0x7a0c('0x7'),'quietmp3','mp3'),'allowNull':!![],'defaultValue':_0x7a0c('0x5')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x7a0c('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x7a0c('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x7a0c('0x2')],'allowNull':!![],'defaultValue':_0x7a0c('0x8')},'format':{'type':Sequelize[_0x7a0c('0x2')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x7a0c('0x9')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x166c=['custom','files','mp3nb','quietmp3nb','quietmp3','mp3','STRING','TIMESTAMP','BOOLEAN','sequelize','exports','name'];(function(_0x25cf1e,_0x4067f3){var _0x584129=function(_0x3cf8d4){while(--_0x3cf8d4){_0x25cf1e['push'](_0x25cf1e['shift']());}};_0x584129(++_0x4067f3);}(_0x166c,0x17d));var _0xc166=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x166c[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xc166('0x0'));module[_0xc166('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc166('0x2')},'mode':{'type':Sequelize['ENUM'](_0xc166('0x3'),_0xc166('0x4'),_0xc166('0x5'),_0xc166('0x6'),_0xc166('0x7'),_0xc166('0x8')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0xc166('0x9')],'allowNull':!![]},'application':{'type':Sequelize[_0xc166('0x9')],'allowNull':!![]},'digit':{'type':Sequelize[_0xc166('0x9')],'allowNull':!![]},'sort':{'type':Sequelize[_0xc166('0x9')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0xc166('0xa')},'defaultEntry':{'type':Sequelize[_0xc166('0xb')],'defaultValue':0x0}};
\ No newline at end of file
index 3e20564..90f2da2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbad2=['bluebird','mustache','util','path','sox','ejs','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','count','set','Content-Range','json','reject','save','update','then','destroy','get','MusicOnHolds','error','stack','name','send','map','VoiceMusicOnHold','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','find','body','create','transaction','files','directory','join','root','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','readdirSync','forEach','rmdirSync','Sequelize','ValidationError','addSound','findOne','createdAt','server/files/sounds/converted','format','%s.%s','basename','save_name','converted_format','symlinkSync','message','removeSound','id2','Sound','order','pick','getSounds','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x18a091,_0x288fbc){var _0x2d94c1=function(_0x4fec8d){while(--_0x4fec8d){_0x18a091['push'](_0x18a091['shift']());}};_0x2d94c1(++_0x288fbc);}(_0xbad2,0xde));var _0x2bad=function(_0x5e7308,_0x384a22){_0x5e7308=_0x5e7308-0x0;var _0x330e7e=_0xbad2[_0x5e7308];return _0x330e7e;};'use strict';var emlformat=require(_0x2bad('0x0'));var rimraf=require(_0x2bad('0x1'));var zipdir=require(_0x2bad('0x2'));var jsonpatch=require(_0x2bad('0x3'));var rp=require(_0x2bad('0x4'));var moment=require(_0x2bad('0x5'));var BPromise=require(_0x2bad('0x6'));var Mustache=require(_0x2bad('0x7'));var util=require(_0x2bad('0x8'));var path=require(_0x2bad('0x9'));var sox=require(_0x2bad('0xa'));var csv=require('to-csv');var ejs=require(_0x2bad('0xb'));var fs=require('fs');var fs_extra=require(_0x2bad('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2bad('0xd'));var deskjs=require(_0x2bad('0xe'));var toCsv=require(_0x2bad('0xf'));var querystring=require(_0x2bad('0x10'));var Papa=require(_0x2bad('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2bad('0x12'));var as=require(_0x2bad('0x13'));var hardwareService=require(_0x2bad('0x14'));var logger=require(_0x2bad('0x15'))(_0x2bad('0x16'));var utils=require(_0x2bad('0x17'));var config=require(_0x2bad('0x18'));var licenseUtil=require(_0x2bad('0x19'));var db=require(_0x2bad('0x1a'))['db'];function respondWithStatusCode(_0x54fd81,_0x34a382){_0x34a382=_0x34a382||0xcc;return function(_0x517b77){if(_0x517b77){return _0x54fd81[_0x2bad('0x1b')](_0x34a382);}return _0x54fd81['status'](_0x34a382)[_0x2bad('0x1c')]();};}function respondWithResult(_0x5d7569,_0x2381ee){_0x2381ee=_0x2381ee||0xc8;return function(_0x5b2044){if(_0x5b2044){return _0x5d7569[_0x2bad('0x1d')](_0x2381ee)['json'](_0x5b2044);}};}function respondWithFilteredResult(_0x17f7d9,_0xe8ab02){return function(_0x2d3ac7){if(_0x2d3ac7){var _0x3b1ec9=typeof _0xe8ab02[_0x2bad('0x1e')]==='undefined'&&typeof _0xe8ab02[_0x2bad('0x1f')]==='undefined';var _0x212965=_0x2d3ac7[_0x2bad('0x20')];var _0x408b3a=_0x3b1ec9?0x0:_0xe8ab02[_0x2bad('0x1e')];var _0x5958c5=_0x3b1ec9?_0x2d3ac7[_0x2bad('0x20')]:_0xe8ab02['offset']+_0xe8ab02[_0x2bad('0x1f')];var _0x59b0ec;if(_0x5958c5>=_0x212965){_0x5958c5=_0x212965;_0x59b0ec=0xc8;}else{_0x59b0ec=0xce;}_0x17f7d9[_0x2bad('0x1d')](_0x59b0ec);return _0x17f7d9[_0x2bad('0x21')](_0x2bad('0x22'),_0x408b3a+'-'+_0x5958c5+'/'+_0x212965)[_0x2bad('0x23')](_0x2d3ac7);}return null;};}function patchUpdates(_0xbb5fdb){return function(_0x3d65dc){try{jsonpatch['apply'](_0x3d65dc,_0xbb5fdb,!![]);}catch(_0x31b6da){return BPromise[_0x2bad('0x24')](_0x31b6da);}return _0x3d65dc[_0x2bad('0x25')]();};}function saveUpdates(_0x485238,_0x5a9e80){return function(_0x2c3a30){if(_0x2c3a30){return _0x2c3a30[_0x2bad('0x26')](_0x485238)[_0x2bad('0x27')](function(_0x392457){return _0x392457;});}return null;};}function removeEntity(_0xe6d322,_0x52c235){return function(_0x5554c3){if(_0x5554c3){return _0x5554c3[_0x2bad('0x28')]()[_0x2bad('0x27')](function(){var _0x3ac4b6=_0x5554c3[_0x2bad('0x29')]({'plain':!![]});var _0x2d0269=_0x2bad('0x2a');return db['UserProfileResource'][_0x2bad('0x28')]({'where':{'type':_0x2d0269,'resourceId':_0x3ac4b6['id']}})[_0x2bad('0x27')](function(){return _0x5554c3;});})[_0x2bad('0x27')](function(){_0xe6d322[_0x2bad('0x1d')](0xcc)[_0x2bad('0x1c')]();});}};}function handleEntityNotFound(_0x12fd05,_0x4aa0f4){return function(_0x20572b){if(!_0x20572b){_0x12fd05[_0x2bad('0x1b')](0x194);}return _0x20572b;};}function handleError(_0x14e41f,_0x7ed74){_0x7ed74=_0x7ed74||0x1f4;return function(_0x31e112){logger[_0x2bad('0x2b')](_0x31e112[_0x2bad('0x2c')]);if(_0x31e112['name']){delete _0x31e112[_0x2bad('0x2d')];}_0x14e41f[_0x2bad('0x1d')](_0x7ed74)[_0x2bad('0x2e')](_0x31e112);};}exports['index']=function(_0x552de7,_0x1b7b7c){var _0x154d89={},_0x280c34={},_0x3bfaf0={'count':0x0,'rows':[]};var _0x485e1c=_[_0x2bad('0x2f')](db[_0x2bad('0x30')][_0x2bad('0x31')],function(_0x147da9){return{'name':_0x147da9[_0x2bad('0x32')],'type':_0x147da9[_0x2bad('0x33')]['key']};});_0x280c34[_0x2bad('0x34')]=_['map'](_0x485e1c,_0x2bad('0x2d'));_0x280c34['query']=_[_0x2bad('0x35')](_0x552de7[_0x2bad('0x36')]);_0x280c34['filters']=_[_0x2bad('0x37')](_0x280c34[_0x2bad('0x34')],_0x280c34[_0x2bad('0x36')]);_0x154d89[_0x2bad('0x38')]=_[_0x2bad('0x37')](_0x280c34[_0x2bad('0x34')],qs['fields'](_0x552de7[_0x2bad('0x36')][_0x2bad('0x39')]));_0x154d89[_0x2bad('0x38')]=_0x154d89[_0x2bad('0x38')][_0x2bad('0x3a')]?_0x154d89[_0x2bad('0x38')]:_0x280c34[_0x2bad('0x34')];if(!_0x552de7[_0x2bad('0x36')][_0x2bad('0x3b')]('nolimit')){_0x154d89[_0x2bad('0x1f')]=qs[_0x2bad('0x1f')](_0x552de7[_0x2bad('0x36')][_0x2bad('0x1f')]);_0x154d89[_0x2bad('0x1e')]=qs[_0x2bad('0x1e')](_0x552de7['query'][_0x2bad('0x1e')]);}_0x154d89['order']=qs['sort'](_0x552de7[_0x2bad('0x36')][_0x2bad('0x3c')]);delete _0x552de7['query'][_0x2bad('0x3c')];_0x154d89[_0x2bad('0x3d')]=qs[_0x2bad('0x3e')](_['pick'](_0x552de7[_0x2bad('0x36')],_0x280c34[_0x2bad('0x3e')]),_0x485e1c);if(_0x552de7[_0x2bad('0x36')]['filter']){_0x154d89[_0x2bad('0x3d')]=_[_0x2bad('0x3f')](_0x154d89[_0x2bad('0x3d')],{'$or':_[_0x2bad('0x2f')](_0x485e1c,function(_0x41b4a5){if(_0x41b4a5[_0x2bad('0x33')]!==_0x2bad('0x40')){var _0x5c682c={};_0x5c682c[_0x41b4a5[_0x2bad('0x2d')]]={'$like':'%'+_0x552de7[_0x2bad('0x36')][_0x2bad('0x41')]+'%'};return _0x5c682c;}})});}_0x154d89=_[_0x2bad('0x3f')]({},_0x154d89,_0x552de7[_0x2bad('0x42')]);var _0x11e581={'where':_0x154d89['where']};return db[_0x2bad('0x30')][_0x2bad('0x20')](_0x11e581)[_0x2bad('0x27')](function(_0x49a893){_0x3bfaf0[_0x2bad('0x20')]=_0x49a893;if(_0x552de7['query'][_0x2bad('0x43')]){_0x154d89[_0x2bad('0x44')]=[{'all':!![]}];}return db[_0x2bad('0x30')][_0x2bad('0x45')](_0x154d89);})[_0x2bad('0x27')](function(_0x289391){_0x3bfaf0['rows']=_0x289391;return _0x3bfaf0;})['then'](respondWithFilteredResult(_0x1b7b7c,_0x154d89))[_0x2bad('0x46')](handleError(_0x1b7b7c,null));};exports[_0x2bad('0x47')]=function(_0x110287,_0x2e7ff9){var _0x1188d9={'raw':![],'where':{'id':_0x110287[_0x2bad('0x48')]['id']}},_0x8b72f3={};_0x8b72f3[_0x2bad('0x34')]=_['keys'](db[_0x2bad('0x30')][_0x2bad('0x31')]);_0x8b72f3[_0x2bad('0x36')]=_[_0x2bad('0x35')](_0x110287[_0x2bad('0x36')]);_0x8b72f3[_0x2bad('0x3e')]=_['intersection'](_0x8b72f3[_0x2bad('0x34')],_0x8b72f3[_0x2bad('0x36')]);_0x1188d9['attributes']=_['intersection'](_0x8b72f3['model'],qs[_0x2bad('0x39')](_0x110287['query']['fields']));_0x1188d9[_0x2bad('0x38')]=_0x1188d9[_0x2bad('0x38')][_0x2bad('0x3a')]?_0x1188d9[_0x2bad('0x38')]:_0x8b72f3[_0x2bad('0x34')];if(_0x110287[_0x2bad('0x36')][_0x2bad('0x43')]){_0x1188d9['include']=[{'all':!![]}];}_0x1188d9=_[_0x2bad('0x3f')]({},_0x1188d9,_0x110287[_0x2bad('0x42')]);return db['VoiceMusicOnHold'][_0x2bad('0x49')](_0x1188d9)[_0x2bad('0x27')](handleEntityNotFound(_0x2e7ff9,null))[_0x2bad('0x27')](respondWithResult(_0x2e7ff9,null))[_0x2bad('0x46')](handleError(_0x2e7ff9,null));};exports['update']=function(_0x1ed830,_0x5764b8){if(_0x1ed830['body']['id']){delete _0x1ed830[_0x2bad('0x4a')]['id'];}return db[_0x2bad('0x30')]['find']({'where':{'id':_0x1ed830[_0x2bad('0x48')]['id']}})[_0x2bad('0x27')](handleEntityNotFound(_0x5764b8,null))[_0x2bad('0x27')](saveUpdates(_0x1ed830[_0x2bad('0x4a')],null))['then'](respondWithResult(_0x5764b8,null))['catch'](handleError(_0x5764b8,null));};exports[_0x2bad('0x4b')]=function(_0xbc9ae,_0x37222c,_0x548253){return db['sequelize'][_0x2bad('0x4c')](function(_0x3ec288){if(_0xbc9ae['body']['mode']===_0x2bad('0x4d')){_0xbc9ae[_0x2bad('0x4a')][_0x2bad('0x4e')]=path[_0x2bad('0x4f')](config[_0x2bad('0x50')],'server/files/moh',_0xbc9ae['body'][_0x2bad('0x2d')]);}return db[_0x2bad('0x30')][_0x2bad('0x4b')](_0xbc9ae[_0x2bad('0x4a')],{'transaction':_0x3ec288})[_0x2bad('0x27')](function(_0x2c5cb7){if(_0xbc9ae[_0x2bad('0x4a')]['mode']==='files'){fs[_0x2bad('0x51')](_0x2c5cb7[_0x2bad('0x4e')],parseInt(_0x2bad('0x52'),0x8));}var _0x41111a=_0xbc9ae[_0x2bad('0x53')][_0x2bad('0x29')]({'plain':!![]});if(!_0x41111a)throw new Error(_0x2bad('0x54'));if(_0x41111a[_0x2bad('0x55')]===_0x2bad('0x53')){var _0xfc9e3d=_0x2c5cb7[_0x2bad('0x29')]({'plain':!![]});return db[_0x2bad('0x56')][_0x2bad('0x49')]({'where':{'name':_0x2bad('0x2a'),'userProfileId':_0x41111a[_0x2bad('0x57')]},'raw':!![]})[_0x2bad('0x27')](function(_0x10d03e){if(_0x10d03e&&_0x10d03e['autoAssociation']===0x0){return db[_0x2bad('0x58')]['create']({'name':_0xfc9e3d[_0x2bad('0x2d')],'resourceId':_0xfc9e3d['id'],'type':_0x10d03e[_0x2bad('0x2d')],'sectionId':_0x10d03e['id']},{})['then'](function(){return _0x2c5cb7;});}else{return _0x2c5cb7;}})[_0x2bad('0x46')](function(_0x1f48ca){logger['error'](_0x2bad('0x59'),_0x1f48ca);});}return _0x2c5cb7;});})[_0x2bad('0x27')](respondWithResult(_0x37222c,0xc9))[_0x2bad('0x46')](handleError(_0x37222c,null));};exports[_0x2bad('0x28')]=function(_0x165755,_0x4bdce9,_0xd40c4b){var _0x2fcb3a;return db[_0x2bad('0x30')][_0x2bad('0x49')]({'where':{'id':_0x165755[_0x2bad('0x48')]['id']}})[_0x2bad('0x27')](function(_0x3a47c2){if(_0x3a47c2){return db[_0x2bad('0x5a')][_0x2bad('0x4c')](function(_0x8d5782){return _0x3a47c2[_0x2bad('0x28')]({'transaction':_0x8d5782,'raw':!![]})[_0x2bad('0x27')](function(_0x267832){if(_0x267832[_0x2bad('0x4e')]){fs[_0x2bad('0x5b')](_0x267832['directory'])[_0x2bad('0x5c')](function(_0x231455){fs['unlinkSync'](path[_0x2bad('0x4f')](_0x267832[_0x2bad('0x4e')],_0x231455));});fs[_0x2bad('0x5d')](_0x267832['directory']);}return _0x267832;});})[_0x2bad('0x46')](function(_0x42c9f2){throw new db[(_0x2bad('0x5e'))][(_0x2bad('0x5f'))](_0x42c9f2['message']);});}})[_0x2bad('0x27')](handleEntityNotFound(_0x4bdce9,null))[_0x2bad('0x27')](removeEntity(_0x4bdce9,null))[_0x2bad('0x46')](handleError(_0x4bdce9,null));};exports[_0x2bad('0x60')]=function(_0x1cb962,_0x56973f,_0x3dbb5a){return db[_0x2bad('0x5a')][_0x2bad('0x4c')](function(_0x1d4c5c){var _0x3ef05b;return db[_0x2bad('0x30')][_0x2bad('0x49')]({'where':{'id':_0x1cb962[_0x2bad('0x48')]['id']}})['then'](function(_0x139ecc){if(_0x139ecc){_0x3ef05b=_0x139ecc;return _0x139ecc[_0x2bad('0x60')](_0x1cb962['body']['id'],{'transaction':_0x1d4c5c});}})[_0x2bad('0x27')](function(_0x2936da){if(_0x2936da){return db['Sound'][_0x2bad('0x61')]({'where':{'id':_0x1cb962['body']['id']},'attributes':['id',_0x2bad('0x2d'),'save_name','converted_format',_0x2bad('0x62')],'raw':!![]});}})[_0x2bad('0x27')](function(_0x4d4a6d){if(_0x4d4a6d){var _0x4107fe=path[_0x2bad('0x4f')](config['root'],_0x2bad('0x63'),util[_0x2bad('0x64')](_0x2bad('0x65'),path[_0x2bad('0x66')](_0x4d4a6d[_0x2bad('0x67')],path['extname'](_0x4d4a6d['save_name'])),_0x4d4a6d['converted_format']));var _0xa6b242=path[_0x2bad('0x4f')](config[_0x2bad('0x50')],'server/files/moh',_0x3ef05b[_0x2bad('0x2d')],util[_0x2bad('0x64')](_0x2bad('0x65'),_0x4d4a6d[_0x2bad('0x2d')],_0x4d4a6d[_0x2bad('0x68')]));fs[_0x2bad('0x69')](_0x4107fe,_0xa6b242);return _0x4d4a6d;}})[_0x2bad('0x46')](function(_0x5b2658){throw new db[(_0x2bad('0x5e'))][(_0x2bad('0x5f'))](_0x5b2658[_0x2bad('0x6a')]);});})[_0x2bad('0x27')](handleEntityNotFound(_0x56973f,null))[_0x2bad('0x27')](respondWithResult(_0x56973f,0xc9))[_0x2bad('0x46')](handleError(_0x56973f,null));};exports[_0x2bad('0x6b')]=function(_0x25a50c,_0x451a2f,_0x4a17b1){return db[_0x2bad('0x5a')][_0x2bad('0x4c')](function(_0x94af35){var _0x32a552;return db[_0x2bad('0x30')][_0x2bad('0x61')]({'where':{'id':_0x25a50c[_0x2bad('0x48')]['id']}})[_0x2bad('0x27')](handleEntityNotFound(_0x451a2f,null))['then'](function(_0x51fc29){if(_0x51fc29){_0x32a552=_0x51fc29;return _0x51fc29[_0x2bad('0x6b')](_0x25a50c[_0x2bad('0x48')]['id2']);}})[_0x2bad('0x27')](function(_0x8e7c05){if(_0x8e7c05){return db['Sound'][_0x2bad('0x61')]({'where':{'id':_0x25a50c['params'][_0x2bad('0x6c')]},'attributes':['id',_0x2bad('0x2d'),_0x2bad('0x67'),_0x2bad('0x68'),_0x2bad('0x62')],'raw':!![]});}})[_0x2bad('0x27')](function(_0x3730b2){if(_0x3730b2){fs['unlinkSync'](path['join'](_0x32a552[_0x2bad('0x4e')],util[_0x2bad('0x64')](_0x2bad('0x65'),_0x3730b2[_0x2bad('0x2d')],_0x3730b2['converted_format'])));return _0x3730b2;}})[_0x2bad('0x46')](function(_0x5001c5){throw new db['Sequelize'][(_0x2bad('0x5f'))](_0x5001c5['message']);});})[_0x2bad('0x27')](handleEntityNotFound(_0x451a2f,null))[_0x2bad('0x27')](respondWithStatusCode(_0x451a2f,0xcc))[_0x2bad('0x46')](handleError(_0x451a2f,null));};exports['getSounds']=function(_0x3ed105,_0x5203fe,_0x31965b){var _0x1be3ae={};var _0x2d11e4={};var _0x17a134;var _0xab39d;return db[_0x2bad('0x30')][_0x2bad('0x61')]({'where':{'id':_0x3ed105[_0x2bad('0x48')]['id']}})[_0x2bad('0x27')](handleEntityNotFound(_0x5203fe,null))[_0x2bad('0x27')](function(_0x8e098e){if(_0x8e098e){_0x17a134=_0x8e098e;_0x2d11e4[_0x2bad('0x34')]=_[_0x2bad('0x35')](db[_0x2bad('0x6d')][_0x2bad('0x31')]);_0x2d11e4['query']=_['keys'](_0x3ed105[_0x2bad('0x36')]);_0x2d11e4[_0x2bad('0x3e')]=_[_0x2bad('0x37')](_0x2d11e4[_0x2bad('0x34')],_0x2d11e4[_0x2bad('0x36')]);_0x1be3ae[_0x2bad('0x38')]=_['intersection'](_0x2d11e4['model'],qs[_0x2bad('0x39')](_0x3ed105['query'][_0x2bad('0x39')]));_0x1be3ae[_0x2bad('0x38')]=_0x1be3ae[_0x2bad('0x38')]['length']?_0x1be3ae[_0x2bad('0x38')]:_0x2d11e4['model'];_0x1be3ae[_0x2bad('0x6e')]=qs['sort'](_0x3ed105[_0x2bad('0x36')][_0x2bad('0x3c')]);_0x1be3ae[_0x2bad('0x3d')]=qs[_0x2bad('0x3e')](_[_0x2bad('0x6f')](_0x3ed105[_0x2bad('0x36')],_0x2d11e4[_0x2bad('0x3e')]));if(_0x3ed105['query'][_0x2bad('0x41')]){_0x1be3ae[_0x2bad('0x3d')]=_['merge'](_0x1be3ae[_0x2bad('0x3d')],{'$or':_['map'](_0x1be3ae['attributes'],function(_0xc8050e){var _0x1c1b2a={};_0x1c1b2a[_0xc8050e]={'$like':'%'+_0x3ed105[_0x2bad('0x36')][_0x2bad('0x41')]+'%'};return _0x1c1b2a;})});}_0x1be3ae=_[_0x2bad('0x3f')]({},_0x1be3ae,_0x3ed105['options']);return _0x17a134[_0x2bad('0x70')](_0x1be3ae);}})[_0x2bad('0x27')](function(_0x4daf0a){if(_0x4daf0a){_0xab39d=_0x4daf0a[_0x2bad('0x3a')];if(!_0x3ed105[_0x2bad('0x36')]['hasOwnProperty'](_0x2bad('0x71'))){_0x1be3ae[_0x2bad('0x1f')]=qs[_0x2bad('0x1f')](_0x3ed105[_0x2bad('0x36')][_0x2bad('0x1f')]);_0x1be3ae['offset']=qs['offset'](_0x3ed105[_0x2bad('0x36')][_0x2bad('0x1e')]);}return _0x17a134['getSounds'](_0x1be3ae);}})[_0x2bad('0x27')](function(_0x10547a){if(_0x10547a){return _0x10547a?{'count':_0xab39d,'rows':_0x10547a}:null;}})[_0x2bad('0x27')](respondWithResult(_0x5203fe,null))[_0x2bad('0x46')](handleError(_0x5203fe,null));};
\ No newline at end of file
+var _0xa621=['show','include','find','update','body','params','create','sequelize','transaction','mode','directory','join','server/files/moh','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','destroy','unlinkSync','rmdirSync','ValidationError','message','addSound','findOne','save_name','converted_format','root','%s.%s','basename','extname','symlinkSync','Sequelize','removeSound','id2','createdAt','format','getSounds','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','save','then','get','MusicOnHolds','UserProfileResource','error','stack','name','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','rows','catch'];(function(_0x5db1ae,_0x4dc6cd){var _0x11ad60=function(_0x372ced){while(--_0x372ced){_0x5db1ae['push'](_0x5db1ae['shift']());}};_0x11ad60(++_0x4dc6cd);}(_0xa621,0x1cb));var _0x1a62=function(_0x1b354e,_0x562b4b){_0x1b354e=_0x1b354e-0x0;var _0x4b99db=_0xa621[_0x1b354e];return _0x4b99db;};'use strict';var emlformat=require(_0x1a62('0x0'));var rimraf=require(_0x1a62('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1a62('0x2'));var rp=require(_0x1a62('0x3'));var moment=require(_0x1a62('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1a62('0x5'));var util=require(_0x1a62('0x6'));var path=require(_0x1a62('0x7'));var sox=require('sox');var csv=require(_0x1a62('0x8'));var ejs=require(_0x1a62('0x9'));var fs=require('fs');var fs_extra=require(_0x1a62('0xa'));var _=require(_0x1a62('0xb'));var squel=require(_0x1a62('0xc'));var crypto=require('crypto');var jsforce=require(_0x1a62('0xd'));var deskjs=require(_0x1a62('0xe'));var toCsv=require(_0x1a62('0x8'));var querystring=require(_0x1a62('0xf'));var Papa=require(_0x1a62('0x10'));var Redis=require(_0x1a62('0x11'));var authService=require(_0x1a62('0x12'));var qs=require(_0x1a62('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1a62('0x14'));var utils=require('../../config/utils');var config=require(_0x1a62('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e244a,_0x4eef12){_0x4eef12=_0x4eef12||0xcc;return function(_0x8030af){if(_0x8030af){return _0x2e244a[_0x1a62('0x16')](_0x4eef12);}return _0x2e244a[_0x1a62('0x17')](_0x4eef12)[_0x1a62('0x18')]();};}function respondWithResult(_0x353e93,_0xfc239b){_0xfc239b=_0xfc239b||0xc8;return function(_0x39a3f9){if(_0x39a3f9){return _0x353e93[_0x1a62('0x17')](_0xfc239b)[_0x1a62('0x19')](_0x39a3f9);}};}function respondWithFilteredResult(_0xce1555,_0xb89126){return function(_0x3b3dab){if(_0x3b3dab){var _0x545b9a=typeof _0xb89126[_0x1a62('0x1a')]==='undefined'&&typeof _0xb89126[_0x1a62('0x1b')]==='undefined';var _0xeafecc=_0x3b3dab[_0x1a62('0x1c')];var _0x52cd44=_0x545b9a?0x0:_0xb89126[_0x1a62('0x1a')];var _0x3d66bb=_0x545b9a?_0x3b3dab[_0x1a62('0x1c')]:_0xb89126['offset']+_0xb89126[_0x1a62('0x1b')];var _0x4042e6;if(_0x3d66bb>=_0xeafecc){_0x3d66bb=_0xeafecc;_0x4042e6=0xc8;}else{_0x4042e6=0xce;}_0xce1555[_0x1a62('0x17')](_0x4042e6);return _0xce1555[_0x1a62('0x1d')](_0x1a62('0x1e'),_0x52cd44+'-'+_0x3d66bb+'/'+_0xeafecc)[_0x1a62('0x19')](_0x3b3dab);}return null;};}function patchUpdates(_0x4c1a41){return function(_0x398457){try{jsonpatch[_0x1a62('0x1f')](_0x398457,_0x4c1a41,!![]);}catch(_0x1297de){return BPromise['reject'](_0x1297de);}return _0x398457[_0x1a62('0x20')]();};}function saveUpdates(_0xd9484f,_0x3a9eee){return function(_0x1aeedb){if(_0x1aeedb){return _0x1aeedb['update'](_0xd9484f)['then'](function(_0x1dab5b){return _0x1dab5b;});}return null;};}function removeEntity(_0x15ff36,_0x32507d){return function(_0x192f10){if(_0x192f10){return _0x192f10['destroy']()[_0x1a62('0x21')](function(){var _0x20c87c=_0x192f10[_0x1a62('0x22')]({'plain':!![]});var _0x4f83ce=_0x1a62('0x23');return db[_0x1a62('0x24')]['destroy']({'where':{'type':_0x4f83ce,'resourceId':_0x20c87c['id']}})[_0x1a62('0x21')](function(){return _0x192f10;});})[_0x1a62('0x21')](function(){_0x15ff36[_0x1a62('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cab12,_0x5ca2d1){return function(_0x42b3eb){if(!_0x42b3eb){_0x1cab12['sendStatus'](0x194);}return _0x42b3eb;};}function handleError(_0x21eae4,_0x418bff){_0x418bff=_0x418bff||0x1f4;return function(_0x4a2643){logger[_0x1a62('0x25')](_0x4a2643[_0x1a62('0x26')]);if(_0x4a2643['name']){delete _0x4a2643[_0x1a62('0x27')];}_0x21eae4[_0x1a62('0x17')](_0x418bff)['send'](_0x4a2643);};}exports[_0x1a62('0x28')]=function(_0x12a2ca,_0x3f3ee4){var _0x2806f9={},_0xffbc1d={},_0x407f4d={'count':0x0,'rows':[]};var _0x35fb35=_[_0x1a62('0x29')](db[_0x1a62('0x2a')][_0x1a62('0x2b')],function(_0xc5f6ec){return{'name':_0xc5f6ec[_0x1a62('0x2c')],'type':_0xc5f6ec[_0x1a62('0x2d')][_0x1a62('0x2e')]};});_0xffbc1d[_0x1a62('0x2f')]=_['map'](_0x35fb35,_0x1a62('0x27'));_0xffbc1d[_0x1a62('0x30')]=_[_0x1a62('0x31')](_0x12a2ca[_0x1a62('0x30')]);_0xffbc1d[_0x1a62('0x32')]=_[_0x1a62('0x33')](_0xffbc1d[_0x1a62('0x2f')],_0xffbc1d[_0x1a62('0x30')]);_0x2806f9[_0x1a62('0x34')]=_[_0x1a62('0x33')](_0xffbc1d[_0x1a62('0x2f')],qs['fields'](_0x12a2ca[_0x1a62('0x30')][_0x1a62('0x35')]));_0x2806f9['attributes']=_0x2806f9[_0x1a62('0x34')][_0x1a62('0x36')]?_0x2806f9[_0x1a62('0x34')]:_0xffbc1d['model'];if(!_0x12a2ca[_0x1a62('0x30')]['hasOwnProperty'](_0x1a62('0x37'))){_0x2806f9[_0x1a62('0x1b')]=qs[_0x1a62('0x1b')](_0x12a2ca[_0x1a62('0x30')]['limit']);_0x2806f9[_0x1a62('0x1a')]=qs[_0x1a62('0x1a')](_0x12a2ca[_0x1a62('0x30')][_0x1a62('0x1a')]);}_0x2806f9[_0x1a62('0x38')]=qs['sort'](_0x12a2ca['query'][_0x1a62('0x39')]);delete _0x12a2ca[_0x1a62('0x30')]['sort'];_0x2806f9[_0x1a62('0x3a')]=qs[_0x1a62('0x32')](_[_0x1a62('0x3b')](_0x12a2ca[_0x1a62('0x30')],_0xffbc1d[_0x1a62('0x32')]),_0x35fb35);if(_0x12a2ca[_0x1a62('0x30')]['filter']){_0x2806f9[_0x1a62('0x3a')]=_['merge'](_0x2806f9['where'],{'$or':_[_0x1a62('0x29')](_0x35fb35,function(_0x235368){if(_0x235368['type']!=='VIRTUAL'){var _0x4152c6={};_0x4152c6[_0x235368[_0x1a62('0x27')]]={'$like':'%'+_0x12a2ca['query'][_0x1a62('0x3c')]+'%'};return _0x4152c6;}})});}_0x2806f9=_[_0x1a62('0x3d')]({},_0x2806f9,_0x12a2ca[_0x1a62('0x3e')]);var _0x32854e={'where':_0x2806f9[_0x1a62('0x3a')]};return db[_0x1a62('0x2a')][_0x1a62('0x1c')](_0x32854e)['then'](function(_0x444a1a){_0x407f4d['count']=_0x444a1a;if(_0x12a2ca[_0x1a62('0x30')][_0x1a62('0x3f')]){_0x2806f9['include']=[{'all':!![]}];}return db[_0x1a62('0x2a')]['findAll'](_0x2806f9);})[_0x1a62('0x21')](function(_0xff9e9){_0x407f4d[_0x1a62('0x40')]=_0xff9e9;return _0x407f4d;})[_0x1a62('0x21')](respondWithFilteredResult(_0x3f3ee4,_0x2806f9))[_0x1a62('0x41')](handleError(_0x3f3ee4,null));};exports[_0x1a62('0x42')]=function(_0x4bcbed,_0x3bc330){var _0x4bdcec={'raw':![],'where':{'id':_0x4bcbed['params']['id']}},_0x350949={};_0x350949[_0x1a62('0x2f')]=_[_0x1a62('0x31')](db['VoiceMusicOnHold'][_0x1a62('0x2b')]);_0x350949['query']=_[_0x1a62('0x31')](_0x4bcbed[_0x1a62('0x30')]);_0x350949[_0x1a62('0x32')]=_[_0x1a62('0x33')](_0x350949[_0x1a62('0x2f')],_0x350949[_0x1a62('0x30')]);_0x4bdcec['attributes']=_['intersection'](_0x350949[_0x1a62('0x2f')],qs[_0x1a62('0x35')](_0x4bcbed[_0x1a62('0x30')][_0x1a62('0x35')]));_0x4bdcec[_0x1a62('0x34')]=_0x4bdcec[_0x1a62('0x34')][_0x1a62('0x36')]?_0x4bdcec[_0x1a62('0x34')]:_0x350949[_0x1a62('0x2f')];if(_0x4bcbed[_0x1a62('0x30')][_0x1a62('0x3f')]){_0x4bdcec[_0x1a62('0x43')]=[{'all':!![]}];}_0x4bdcec=_[_0x1a62('0x3d')]({},_0x4bdcec,_0x4bcbed[_0x1a62('0x3e')]);return db[_0x1a62('0x2a')][_0x1a62('0x44')](_0x4bdcec)['then'](handleEntityNotFound(_0x3bc330,null))[_0x1a62('0x21')](respondWithResult(_0x3bc330,null))[_0x1a62('0x41')](handleError(_0x3bc330,null));};exports[_0x1a62('0x45')]=function(_0x782a27,_0x2da2ea){if(_0x782a27[_0x1a62('0x46')]['id']){delete _0x782a27[_0x1a62('0x46')]['id'];}return db['VoiceMusicOnHold'][_0x1a62('0x44')]({'where':{'id':_0x782a27[_0x1a62('0x47')]['id']}})[_0x1a62('0x21')](handleEntityNotFound(_0x2da2ea,null))['then'](saveUpdates(_0x782a27['body'],null))[_0x1a62('0x21')](respondWithResult(_0x2da2ea,null))[_0x1a62('0x41')](handleError(_0x2da2ea,null));};exports[_0x1a62('0x48')]=function(_0x179652,_0x16038a,_0x596ba5){return db[_0x1a62('0x49')][_0x1a62('0x4a')](function(_0x60b10b){if(_0x179652[_0x1a62('0x46')][_0x1a62('0x4b')]==='files'){_0x179652['body'][_0x1a62('0x4c')]=path[_0x1a62('0x4d')](config['root'],_0x1a62('0x4e'),_0x179652[_0x1a62('0x46')][_0x1a62('0x27')]);}return db[_0x1a62('0x2a')]['create'](_0x179652[_0x1a62('0x46')],{'transaction':_0x60b10b})['then'](function(_0xd8c079){if(_0x179652[_0x1a62('0x46')][_0x1a62('0x4b')]==='files'){fs['mkdirSync'](_0xd8c079[_0x1a62('0x4c')],parseInt(_0x1a62('0x4f'),0x8));}var _0x45ef0d=_0x179652[_0x1a62('0x50')][_0x1a62('0x22')]({'plain':!![]});if(!_0x45ef0d)throw new Error(_0x1a62('0x51'));if(_0x45ef0d['role']==='user'){var _0x55e396=_0xd8c079[_0x1a62('0x22')]({'plain':!![]});return db[_0x1a62('0x52')][_0x1a62('0x44')]({'where':{'name':'MusicOnHolds','userProfileId':_0x45ef0d[_0x1a62('0x53')]},'raw':!![]})[_0x1a62('0x21')](function(_0x8de542){if(_0x8de542&&_0x8de542[_0x1a62('0x54')]===0x0){return db[_0x1a62('0x24')][_0x1a62('0x48')]({'name':_0x55e396['name'],'resourceId':_0x55e396['id'],'type':_0x8de542[_0x1a62('0x27')],'sectionId':_0x8de542['id']},{})['then'](function(){return _0xd8c079;});}else{return _0xd8c079;}})[_0x1a62('0x41')](function(_0x2ef527){logger[_0x1a62('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ef527);});}return _0xd8c079;});})[_0x1a62('0x21')](respondWithResult(_0x16038a,0xc9))[_0x1a62('0x41')](handleError(_0x16038a,null));};exports['destroy']=function(_0x55862e,_0x2b558d,_0x5a38c7){var _0x4f079b;return db[_0x1a62('0x2a')][_0x1a62('0x44')]({'where':{'id':_0x55862e[_0x1a62('0x47')]['id']}})[_0x1a62('0x21')](function(_0x1aebf0){if(_0x1aebf0){return db['sequelize']['transaction'](function(_0x3f8b2a){return _0x1aebf0[_0x1a62('0x55')]({'transaction':_0x3f8b2a,'raw':!![]})[_0x1a62('0x21')](function(_0x24034d){if(_0x24034d[_0x1a62('0x4c')]){fs['readdirSync'](_0x24034d[_0x1a62('0x4c')])['forEach'](function(_0x1fc2fc){fs[_0x1a62('0x56')](path[_0x1a62('0x4d')](_0x24034d['directory'],_0x1fc2fc));});fs[_0x1a62('0x57')](_0x24034d[_0x1a62('0x4c')]);}return _0x24034d;});})['catch'](function(_0x3319bf){throw new db['Sequelize'][(_0x1a62('0x58'))](_0x3319bf[_0x1a62('0x59')]);});}})[_0x1a62('0x21')](handleEntityNotFound(_0x2b558d,null))[_0x1a62('0x21')](removeEntity(_0x2b558d,null))['catch'](handleError(_0x2b558d,null));};exports[_0x1a62('0x5a')]=function(_0x5a3539,_0xbdadff,_0x35dfb9){return db[_0x1a62('0x49')][_0x1a62('0x4a')](function(_0x5137fa){var _0x55460e;return db[_0x1a62('0x2a')][_0x1a62('0x44')]({'where':{'id':_0x5a3539[_0x1a62('0x47')]['id']}})['then'](function(_0x440304){if(_0x440304){_0x55460e=_0x440304;return _0x440304['addSound'](_0x5a3539[_0x1a62('0x46')]['id'],{'transaction':_0x5137fa});}})[_0x1a62('0x21')](function(_0x539f7f){if(_0x539f7f){return db['Sound'][_0x1a62('0x5b')]({'where':{'id':_0x5a3539[_0x1a62('0x46')]['id']},'attributes':['id','name',_0x1a62('0x5c'),_0x1a62('0x5d'),'createdAt'],'raw':!![]});}})[_0x1a62('0x21')](function(_0x8f0db5){if(_0x8f0db5){var _0x110d17=path[_0x1a62('0x4d')](config[_0x1a62('0x5e')],'server/files/sounds/converted',util['format'](_0x1a62('0x5f'),path[_0x1a62('0x60')](_0x8f0db5['save_name'],path[_0x1a62('0x61')](_0x8f0db5['save_name'])),_0x8f0db5['converted_format']));var _0x46d6b6=path[_0x1a62('0x4d')](config[_0x1a62('0x5e')],_0x1a62('0x4e'),_0x55460e[_0x1a62('0x27')],util['format'](_0x1a62('0x5f'),_0x8f0db5[_0x1a62('0x27')],_0x8f0db5[_0x1a62('0x5d')]));fs[_0x1a62('0x62')](_0x110d17,_0x46d6b6);return _0x8f0db5;}})[_0x1a62('0x41')](function(_0x53010a){throw new db[(_0x1a62('0x63'))]['ValidationError'](_0x53010a[_0x1a62('0x59')]);});})[_0x1a62('0x21')](handleEntityNotFound(_0xbdadff,null))[_0x1a62('0x21')](respondWithResult(_0xbdadff,0xc9))[_0x1a62('0x41')](handleError(_0xbdadff,null));};exports[_0x1a62('0x64')]=function(_0x415c48,_0x996f7c,_0x5f3d42){return db[_0x1a62('0x49')]['transaction'](function(_0x517eef){var _0x1d21e1;return db[_0x1a62('0x2a')][_0x1a62('0x5b')]({'where':{'id':_0x415c48['params']['id']}})[_0x1a62('0x21')](handleEntityNotFound(_0x996f7c,null))[_0x1a62('0x21')](function(_0x5842d7){if(_0x5842d7){_0x1d21e1=_0x5842d7;return _0x5842d7['removeSound'](_0x415c48[_0x1a62('0x47')][_0x1a62('0x65')]);}})['then'](function(_0x28ab10){if(_0x28ab10){return db['Sound'][_0x1a62('0x5b')]({'where':{'id':_0x415c48['params'][_0x1a62('0x65')]},'attributes':['id',_0x1a62('0x27'),'save_name','converted_format',_0x1a62('0x66')],'raw':!![]});}})[_0x1a62('0x21')](function(_0x29b75d){if(_0x29b75d){fs[_0x1a62('0x56')](path[_0x1a62('0x4d')](_0x1d21e1[_0x1a62('0x4c')],util[_0x1a62('0x67')](_0x1a62('0x5f'),_0x29b75d[_0x1a62('0x27')],_0x29b75d[_0x1a62('0x5d')])));return _0x29b75d;}})[_0x1a62('0x41')](function(_0x33c295){throw new db[(_0x1a62('0x63'))][(_0x1a62('0x58'))](_0x33c295[_0x1a62('0x59')]);});})[_0x1a62('0x21')](handleEntityNotFound(_0x996f7c,null))[_0x1a62('0x21')](respondWithStatusCode(_0x996f7c,0xcc))['catch'](handleError(_0x996f7c,null));};exports[_0x1a62('0x68')]=function(_0x2db10a,_0x28a3ba,_0x203766){var _0x1d7d0a={};var _0x305571={};var _0x2b31e5;var _0x4f529e;return db[_0x1a62('0x2a')][_0x1a62('0x5b')]({'where':{'id':_0x2db10a[_0x1a62('0x47')]['id']}})[_0x1a62('0x21')](handleEntityNotFound(_0x28a3ba,null))['then'](function(_0x3500ce){if(_0x3500ce){_0x2b31e5=_0x3500ce;_0x305571['model']=_['keys'](db['Sound'][_0x1a62('0x2b')]);_0x305571[_0x1a62('0x30')]=_['keys'](_0x2db10a[_0x1a62('0x30')]);_0x305571['filters']=_[_0x1a62('0x33')](_0x305571[_0x1a62('0x2f')],_0x305571['query']);_0x1d7d0a['attributes']=_[_0x1a62('0x33')](_0x305571[_0x1a62('0x2f')],qs[_0x1a62('0x35')](_0x2db10a[_0x1a62('0x30')][_0x1a62('0x35')]));_0x1d7d0a[_0x1a62('0x34')]=_0x1d7d0a[_0x1a62('0x34')][_0x1a62('0x36')]?_0x1d7d0a[_0x1a62('0x34')]:_0x305571['model'];_0x1d7d0a['order']=qs[_0x1a62('0x39')](_0x2db10a['query']['sort']);_0x1d7d0a[_0x1a62('0x3a')]=qs['filters'](_['pick'](_0x2db10a['query'],_0x305571[_0x1a62('0x32')]));if(_0x2db10a['query'][_0x1a62('0x3c')]){_0x1d7d0a[_0x1a62('0x3a')]=_[_0x1a62('0x3d')](_0x1d7d0a[_0x1a62('0x3a')],{'$or':_[_0x1a62('0x29')](_0x1d7d0a[_0x1a62('0x34')],function(_0x1777d3){var _0x545222={};_0x545222[_0x1777d3]={'$like':'%'+_0x2db10a[_0x1a62('0x30')][_0x1a62('0x3c')]+'%'};return _0x545222;})});}_0x1d7d0a=_[_0x1a62('0x3d')]({},_0x1d7d0a,_0x2db10a[_0x1a62('0x3e')]);return _0x2b31e5[_0x1a62('0x68')](_0x1d7d0a);}})[_0x1a62('0x21')](function(_0x5a4fd9){if(_0x5a4fd9){_0x4f529e=_0x5a4fd9[_0x1a62('0x36')];if(!_0x2db10a[_0x1a62('0x30')]['hasOwnProperty'](_0x1a62('0x37'))){_0x1d7d0a[_0x1a62('0x1b')]=qs[_0x1a62('0x1b')](_0x2db10a[_0x1a62('0x30')]['limit']);_0x1d7d0a[_0x1a62('0x1a')]=qs[_0x1a62('0x1a')](_0x2db10a['query'][_0x1a62('0x1a')]);}return _0x2b31e5['getSounds'](_0x1d7d0a);}})[_0x1a62('0x21')](function(_0x1a0283){if(_0x1a0283){return _0x1a0283?{'count':_0x4f529e,'rows':_0x1a0283}:null;}})[_0x1a62('0x21')](respondWithResult(_0x28a3ba,null))['catch'](handleError(_0x28a3ba,null));};
\ No newline at end of file
index 25a3d2e..78e75f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6cad=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x176df2,_0x480f3b){var _0x33af50=function(_0x274c08){while(--_0x274c08){_0x176df2['push'](_0x176df2['shift']());}};_0x33af50(++_0x480f3b);}(_0x6cad,0x195));var _0xd6ca=function(_0x1b9c6a,_0x2239f0){_0x1b9c6a=_0x1b9c6a-0x0;var _0x555950=_0x6cad[_0x1b9c6a];return _0x555950;};'use strict';var _=require(_0xd6ca('0x0'));var util=require(_0xd6ca('0x1'));var logger=require(_0xd6ca('0x2'))('api');var moment=require(_0xd6ca('0x3'));var BPromise=require(_0xd6ca('0x4'));var rp=require(_0xd6ca('0x5'));var fs=require('fs');var path=require(_0xd6ca('0x6'));var rimraf=require('rimraf');var config=require(_0xd6ca('0x7'));var attributes=require('./voiceMusicOnHold.attributes');module[_0xd6ca('0x8')]=function(_0x1f04a0,_0x31eb07){return _0x1f04a0['define']('VoiceMusicOnHold',attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8940=['../../config/environment','./voiceMusicOnHold.attributes','exports','define','voice_musiconhold','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x4af98c,_0x145289){var _0x2fe6fc=function(_0x53e398){while(--_0x53e398){_0x4af98c['push'](_0x4af98c['shift']());}};_0x2fe6fc(++_0x145289);}(_0x8940,0xa1));var _0x0894=function(_0x97f5de,_0x1d0828){_0x97f5de=_0x97f5de-0x0;var _0x3df004=_0x8940[_0x97f5de];return _0x3df004;};'use strict';var _=require(_0x0894('0x0'));var util=require(_0x0894('0x1'));var logger=require('../../config/logger')(_0x0894('0x2'));var moment=require(_0x0894('0x3'));var BPromise=require('bluebird');var rp=require(_0x0894('0x4'));var fs=require('fs');var path=require(_0x0894('0x5'));var rimraf=require(_0x0894('0x6'));var config=require(_0x0894('0x7'));var attributes=require(_0x0894('0x8'));module[_0x0894('0x9')]=function(_0x1ae04a,_0x4eba8e){return _0x1ae04a[_0x0894('0xa')]('VoiceMusicOnHold',attributes,{'tableName':_0x0894('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9e56bbd..70da460 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1643a4,_0x33927b){var _0x2d8d63=function(_0x26d1e1){while(--_0x26d1e1){_0x1643a4['push'](_0x1643a4['shift']());}};_0x2d8d63(++_0x33927b);}(_0x70e0,0x17b));var _0x070e=function(_0x5debd6,_0x4bae8e){_0x5debd6=_0x5debd6-0x0;var _0x50f2d8=_0x70e0[_0x5debd6];return _0x50f2d8;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});}
\ No newline at end of file
+var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','VoiceMusicOnHold,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x2c394a,_0x4a27a8){var _0x42c0a9=function(_0x396d5c){while(--_0x396d5c){_0x2c394a['push'](_0x2c394a['shift']());}};_0x42c0a9(++_0x4a27a8);}(_0x9c44,0x178));var _0x49c4=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9c44[_0x4b055c];return _0x4b62bb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});}
\ No newline at end of file
index f1c6d31..39d84f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd765=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voicePrefix.controller','isAuthenticated','index','get','/describe','describe','show','/:id/users','/:id/teams','post','addTeams','put','/:id','update','destroy','removeAgents','exports','multer','util'];(function(_0x50abc1,_0xda3f4f){var _0x1bce0a=function(_0x37564a){while(--_0x37564a){_0x50abc1['push'](_0x50abc1['shift']());}};_0x1bce0a(++_0xda3f4f);}(_0xd765,0xdf));var _0x5d76=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xd765[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0x5d76('0x0'));var util=require(_0x5d76('0x1'));var path=require(_0x5d76('0x2'));var timeout=require(_0x5d76('0x3'));var express=require(_0x5d76('0x4'));var router=express[_0x5d76('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5d76('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5d76('0x7'));var controller=require(_0x5d76('0x8'));router['get']('/',auth[_0x5d76('0x9')](),controller[_0x5d76('0xa')]);router[_0x5d76('0xb')](_0x5d76('0xc'),auth[_0x5d76('0x9')](),controller[_0x5d76('0xd')]);router['get']('/:id',auth[_0x5d76('0x9')](),controller[_0x5d76('0xe')]);router[_0x5d76('0xb')](_0x5d76('0xf'),auth['isAuthenticated'](),controller['getAgents']);router[_0x5d76('0xb')](_0x5d76('0x10'),auth[_0x5d76('0x9')](),controller['getTeams']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x5d76('0x11')](_0x5d76('0xf'),auth[_0x5d76('0x9')](),controller['addAgents']);router[_0x5d76('0x11')](_0x5d76('0x10'),auth['isAuthenticated'](),controller[_0x5d76('0x12')]);router[_0x5d76('0x13')](_0x5d76('0x14'),auth[_0x5d76('0x9')](),controller[_0x5d76('0x15')]);router['delete'](_0x5d76('0x14'),auth[_0x5d76('0x9')](),controller[_0x5d76('0x16')]);router['delete'](_0x5d76('0xf'),auth[_0x5d76('0x9')](),controller[_0x5d76('0x17')]);router['delete'](_0x5d76('0x10'),auth[_0x5d76('0x9')](),controller['removeTeams']);module[_0x5d76('0x18')]=router;
\ No newline at end of file
+var _0x1cc7=['isAuthenticated','get','/describe','describe','show','/:id/teams','getTeams','post','addTeams','put','update','delete','/:id','destroy','removeAgents','removeTeams','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x14deb0,_0x1daddf){var _0x3c1435=function(_0x709f25){while(--_0x709f25){_0x14deb0['push'](_0x14deb0['shift']());}};_0x3c1435(++_0x1daddf);}(_0x1cc7,0x15a));var _0x71cc=function(_0xf8a524,_0x5032fd){_0xf8a524=_0xf8a524-0x0;var _0x4c6c97=_0x1cc7[_0xf8a524];return _0x4c6c97;};'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('express');var router=express['Router']();var fs_extra=require(_0x71cc('0x3'));var auth=require(_0x71cc('0x4'));var interaction=require(_0x71cc('0x5'));var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router['get']('/',auth[_0x71cc('0x6')](),controller['index']);router[_0x71cc('0x7')](_0x71cc('0x8'),auth[_0x71cc('0x6')](),controller[_0x71cc('0x9')]);router[_0x71cc('0x7')]('/:id',auth[_0x71cc('0x6')](),controller[_0x71cc('0xa')]);router[_0x71cc('0x7')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['get'](_0x71cc('0xb'),auth[_0x71cc('0x6')](),controller[_0x71cc('0xc')]);router['post']('/',auth[_0x71cc('0x6')](),controller['create']);router[_0x71cc('0xd')]('/:id/users',auth[_0x71cc('0x6')](),controller['addAgents']);router[_0x71cc('0xd')](_0x71cc('0xb'),auth[_0x71cc('0x6')](),controller[_0x71cc('0xe')]);router[_0x71cc('0xf')]('/:id',auth[_0x71cc('0x6')](),controller[_0x71cc('0x10')]);router[_0x71cc('0x11')](_0x71cc('0x12'),auth[_0x71cc('0x6')](),controller[_0x71cc('0x13')]);router[_0x71cc('0x11')]('/:id/users',auth[_0x71cc('0x6')](),controller[_0x71cc('0x14')]);router[_0x71cc('0x11')](_0x71cc('0xb'),auth[_0x71cc('0x6')](),controller[_0x71cc('0x15')]);module['exports']=router;
\ No newline at end of file
index 3385de0..c2c461b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0d3=['system-','getDataValue','INTEGER','exports','STRING','VIRTUAL'];(function(_0x9e708d,_0x31a917){var _0x399fb2=function(_0x1b5228){while(--_0x1b5228){_0x9e708d['push'](_0x9e708d['shift']());}};_0x399fb2(++_0x31a917);}(_0xd0d3,0x17d));var _0x3d0d=function(_0x229d6c,_0x236d39){_0x229d6c=_0x229d6c-0x0;var _0x44e913=_0xd0d3[_0x229d6c];return _0x44e913;};'use strict';var Sequelize=require('sequelize');module[_0x3d0d('0x0')]={'name':{'type':Sequelize[_0x3d0d('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x3d0d('0x2')],'get':function(_0x2a33de){return _0x3d0d('0x3')+this[_0x3d0d('0x4')]('name')+'-';}},'description':{'type':Sequelize[_0x3d0d('0x1')]},'callerIdAll':{'type':Sequelize[_0x3d0d('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x3d0d('0x5')]}};
\ No newline at end of file
+var _0x9e94=['name','system-','getDataValue','INTEGER','sequelize','STRING'];(function(_0x5f2de3,_0x2587e3){var _0xed8641=function(_0x7ee7e1){while(--_0x7ee7e1){_0x5f2de3['push'](_0x5f2de3['shift']());}};_0xed8641(++_0x2587e3);}(_0x9e94,0x1f0));var _0x49e9=function(_0x5a8cbb,_0x2c7319){_0x5a8cbb=_0x5a8cbb-0x0;var _0x5bc059=_0x9e94[_0x5a8cbb];return _0x5bc059;};'use strict';var Sequelize=require(_0x49e9('0x0'));module['exports']={'name':{'type':Sequelize[_0x49e9('0x1')],'allowNull':![],'unique':_0x49e9('0x2')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x594880){return _0x49e9('0x3')+this[_0x49e9('0x4')]('name')+'-';}},'description':{'type':Sequelize[_0x49e9('0x1')]},'callerIdAll':{'type':Sequelize[_0x49e9('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x49e9('0x5')]}};
\ No newline at end of file
index 1473c95..8834d0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x583c=['fast-json-patch','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','map','VoicePrefix','fieldName','type','model','query','keys','filters','attributes','fields','nolimit','order','sort','pick','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','rawAttributes','intersection','length','include','find','describe','create','sequelize','transaction','body','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','VoicePrefixes','userProfileId','autoAssociation','exten','app','system','Voice\x20Prefix\x20Extension','priority','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','context','${EXTEN:','charAt','system-','VoiceExtension','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','findOne','User','filter','Team','hasOwnProperty','getTeams','addTeams','Agents','online','voicePause','flatMap','each','UserVoicePrefix','removeTeams','select','tq.TeamId','from','team_has_voice_prefixes','join','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','every','all','union','compact','value','isEmpty','forEach','eml-format','rimraf','zip-dir'];(function(_0x747260,_0x554f9e){var _0x334ed9=function(_0x54bd41){while(--_0x54bd41){_0x747260['push'](_0x747260['shift']());}};_0x334ed9(++_0x554f9e);}(_0x583c,0x12b));var _0xc583=function(_0xf2628e,_0x521bf7){_0xf2628e=_0xf2628e-0x0;var _0x13863a=_0x583c[_0xf2628e];return _0x13863a;};'use strict';var emlformat=require(_0xc583('0x0'));var rimraf=require(_0xc583('0x1'));var zipdir=require(_0xc583('0x2'));var jsonpatch=require(_0xc583('0x3'));var rp=require('request-promise');var moment=require(_0xc583('0x4'));var BPromise=require(_0xc583('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc583('0x6'));var sox=require(_0xc583('0x7'));var csv=require('to-csv');var ejs=require(_0xc583('0x8'));var fs=require('fs');var fs_extra=require(_0xc583('0x9'));var _=require(_0xc583('0xa'));var squel=require(_0xc583('0xb'));var crypto=require('crypto');var jsforce=require(_0xc583('0xc'));var deskjs=require(_0xc583('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc583('0xe'));var Papa=require(_0xc583('0xf'));var Redis=require(_0xc583('0x10'));var authService=require(_0xc583('0x11'));var qs=require(_0xc583('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc583('0x13'));var logger=require(_0xc583('0x14'))('api');var utils=require(_0xc583('0x15'));var config=require(_0xc583('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc583('0x17'))['db'];config[_0xc583('0x18')]=_[_0xc583('0x19')](config[_0xc583('0x18')],{'host':_0xc583('0x1a'),'port':0x18eb});var socket=require(_0xc583('0x1b'))(new Redis(config[_0xc583('0x18')]));require(_0xc583('0x1c'))[_0xc583('0x1d')](socket);function respondWithStatusCode(_0x5403a3,_0x21cf25){_0x21cf25=_0x21cf25||0xcc;return function(_0x51ecd7){if(_0x51ecd7){return _0x5403a3[_0xc583('0x1e')](_0x21cf25);}return _0x5403a3[_0xc583('0x1f')](_0x21cf25)['end']();};}function respondWithResult(_0x263552,_0x311ad5){_0x311ad5=_0x311ad5||0xc8;return function(_0x5b1871){if(_0x5b1871){return _0x263552[_0xc583('0x1f')](_0x311ad5)[_0xc583('0x20')](_0x5b1871);}};}function respondWithFilteredResult(_0x5127fa,_0x21cf22){return function(_0x8a2d84){if(_0x8a2d84){var _0x12aac2=typeof _0x21cf22[_0xc583('0x21')]==='undefined'&&typeof _0x21cf22[_0xc583('0x22')]==='undefined';var _0x227ec2=_0x8a2d84[_0xc583('0x23')];var _0xfd9a60=_0x12aac2?0x0:_0x21cf22[_0xc583('0x21')];var _0x1052b5=_0x12aac2?_0x8a2d84[_0xc583('0x23')]:_0x21cf22[_0xc583('0x21')]+_0x21cf22[_0xc583('0x22')];var _0x37fcd4;if(_0x1052b5>=_0x227ec2){_0x1052b5=_0x227ec2;_0x37fcd4=0xc8;}else{_0x37fcd4=0xce;}_0x5127fa[_0xc583('0x1f')](_0x37fcd4);return _0x5127fa[_0xc583('0x24')](_0xc583('0x25'),_0xfd9a60+'-'+_0x1052b5+'/'+_0x227ec2)[_0xc583('0x20')](_0x8a2d84);}return null;};}function patchUpdates(_0x478ee1){return function(_0x542256){try{jsonpatch[_0xc583('0x26')](_0x542256,_0x478ee1,!![]);}catch(_0x3e075c){return BPromise[_0xc583('0x27')](_0x3e075c);}return _0x542256['save']();};}function saveUpdates(_0x1521e2,_0x959500){return function(_0x37f156){if(_0x37f156){return _0x37f156[_0xc583('0x28')](_0x1521e2)[_0xc583('0x29')](function(_0x48c95e){return _0x48c95e;});}return null;};}function removeEntity(_0x4cad36,_0x45871c){return function(_0x4f366b){if(_0x4f366b){return _0x4f366b[_0xc583('0x2a')]()[_0xc583('0x29')](function(){var _0xbabf24=_0x4f366b[_0xc583('0x2b')]({'plain':!![]});var _0x24aab5='VoicePrefixes';return db[_0xc583('0x2c')][_0xc583('0x2a')]({'where':{'type':_0x24aab5,'resourceId':_0xbabf24['id']}})['then'](function(){return _0x4f366b;});})[_0xc583('0x29')](function(){_0x4cad36['status'](0xcc)[_0xc583('0x2d')]();});}};}function handleEntityNotFound(_0x8d4ecb,_0x1c80b1){return function(_0x3ed083){if(!_0x3ed083){_0x8d4ecb[_0xc583('0x1e')](0x194);}return _0x3ed083;};}function handleError(_0x19079b,_0x113b39){_0x113b39=_0x113b39||0x1f4;return function(_0x4a87b5){logger[_0xc583('0x2e')](_0x4a87b5[_0xc583('0x2f')]);if(_0x4a87b5[_0xc583('0x30')]){delete _0x4a87b5[_0xc583('0x30')];}_0x19079b[_0xc583('0x1f')](_0x113b39)[_0xc583('0x31')](_0x4a87b5);};}exports['index']=function(_0x2246dd,_0x58d97f){var _0x510931={},_0x299551={},_0x2df18d={'count':0x0,'rows':[]};var _0x20bbce=_[_0xc583('0x32')](db[_0xc583('0x33')]['rawAttributes'],function(_0x3e41c0){return{'name':_0x3e41c0[_0xc583('0x34')],'type':_0x3e41c0[_0xc583('0x35')]['key']};});_0x299551[_0xc583('0x36')]=_['map'](_0x20bbce,_0xc583('0x30'));_0x299551[_0xc583('0x37')]=_[_0xc583('0x38')](_0x2246dd[_0xc583('0x37')]);_0x299551[_0xc583('0x39')]=_['intersection'](_0x299551[_0xc583('0x36')],_0x299551['query']);_0x510931[_0xc583('0x3a')]=_['intersection'](_0x299551[_0xc583('0x36')],qs[_0xc583('0x3b')](_0x2246dd[_0xc583('0x37')][_0xc583('0x3b')]));_0x510931[_0xc583('0x3a')]=_0x510931[_0xc583('0x3a')]['length']?_0x510931['attributes']:_0x299551[_0xc583('0x36')];if(!_0x2246dd[_0xc583('0x37')]['hasOwnProperty'](_0xc583('0x3c'))){_0x510931[_0xc583('0x22')]=qs[_0xc583('0x22')](_0x2246dd[_0xc583('0x37')][_0xc583('0x22')]);_0x510931[_0xc583('0x21')]=qs['offset'](_0x2246dd[_0xc583('0x37')]['offset']);}_0x510931[_0xc583('0x3d')]=qs[_0xc583('0x3e')](_0x2246dd[_0xc583('0x37')]['sort']);_0x510931['where']=qs['filters'](_[_0xc583('0x3f')](_0x2246dd[_0xc583('0x37')],_0x299551[_0xc583('0x39')]),_0x20bbce);if(_0x2246dd[_0xc583('0x37')]['filter']){_0x510931[_0xc583('0x40')]=_[_0xc583('0x41')](_0x510931['where'],{'$or':_['map'](_0x20bbce,function(_0x1ea5da){if(_0x1ea5da['type']!==_0xc583('0x42')){var _0x1ec6f9={};_0x1ec6f9[_0x1ea5da[_0xc583('0x30')]]={'$like':'%'+_0x2246dd[_0xc583('0x37')]['filter']+'%'};return _0x1ec6f9;}})});}_0x510931=_[_0xc583('0x41')]({},_0x510931,_0x2246dd[_0xc583('0x43')]);var _0x39c5ab={'where':_0x510931[_0xc583('0x40')]};return db[_0xc583('0x33')]['count'](_0x39c5ab)[_0xc583('0x29')](function(_0x5f5a97){_0x2df18d['count']=_0x5f5a97;if(_0x2246dd[_0xc583('0x37')][_0xc583('0x44')]){_0x510931['include']=[{'all':!![]}];}return db['VoicePrefix'][_0xc583('0x45')](_0x510931);})[_0xc583('0x29')](function(_0x7d1b29){_0x2df18d[_0xc583('0x46')]=_0x7d1b29;return _0x2df18d;})['then'](respondWithFilteredResult(_0x58d97f,_0x510931))[_0xc583('0x47')](handleError(_0x58d97f,null));};exports['show']=function(_0x8c8209,_0x4edac2){var _0x28ab1a={'raw':![],'where':{'id':_0x8c8209[_0xc583('0x48')]['id']}},_0x14e9ad={};_0x14e9ad[_0xc583('0x36')]=_[_0xc583('0x38')](db['VoicePrefix'][_0xc583('0x49')]);_0x14e9ad[_0xc583('0x37')]=_[_0xc583('0x38')](_0x8c8209['query']);_0x14e9ad['filters']=_['intersection'](_0x14e9ad[_0xc583('0x36')],_0x14e9ad['query']);_0x28ab1a[_0xc583('0x3a')]=_[_0xc583('0x4a')](_0x14e9ad[_0xc583('0x36')],qs[_0xc583('0x3b')](_0x8c8209[_0xc583('0x37')][_0xc583('0x3b')]));_0x28ab1a[_0xc583('0x3a')]=_0x28ab1a[_0xc583('0x3a')][_0xc583('0x4b')]?_0x28ab1a[_0xc583('0x3a')]:_0x14e9ad[_0xc583('0x36')];if(_0x8c8209['query'][_0xc583('0x44')]){_0x28ab1a[_0xc583('0x4c')]=[{'all':!![]}];}_0x28ab1a=_[_0xc583('0x41')]({},_0x28ab1a,_0x8c8209[_0xc583('0x43')]);return db['VoicePrefix'][_0xc583('0x4d')](_0x28ab1a)[_0xc583('0x29')](handleEntityNotFound(_0x4edac2,null))[_0xc583('0x29')](respondWithResult(_0x4edac2,null))[_0xc583('0x47')](handleError(_0x4edac2,null));};exports[_0xc583('0x2a')]=function(_0x22da88,_0x3f60ae){return db[_0xc583('0x33')][_0xc583('0x4d')]({'where':{'id':_0x22da88['params']['id']}})[_0xc583('0x29')](handleEntityNotFound(_0x3f60ae,null))[_0xc583('0x29')](removeEntity(_0x3f60ae,null))[_0xc583('0x47')](handleError(_0x3f60ae,null));};exports[_0xc583('0x4e')]=function(_0x3c442e,_0xc42b2a){return db[_0xc583('0x33')][_0xc583('0x4e')]()[_0xc583('0x29')](respondWithResult(_0xc42b2a,null))[_0xc583('0x47')](handleError(_0xc42b2a,null));};exports[_0xc583('0x4f')]=function(_0x7be0b3,_0x305239){var _0x4c486b;return db[_0xc583('0x50')][_0xc583('0x51')](function(_0x44413e){return db[_0xc583('0x33')][_0xc583('0x4f')](_0x7be0b3[_0xc583('0x52')],{'transaction':_0x44413e})[_0xc583('0x29')](function(_0x1aff76){_0x4c486b=_0x1aff76[_0xc583('0x2b')]({'plain':!![]});return db['VoiceExtension'][_0xc583('0x4d')]({'where':{'id':_0x4c486b[_0xc583('0x53')]},'raw':!![]})[_0xc583('0x29')](function(_0x59ce34){return createVoicePrefixExtensions(_0x4c486b,_0x59ce34,_0x44413e);});});})['then'](function(){var _0x2bb764=_0x7be0b3['user'][_0xc583('0x2b')]({'plain':!![]});if(!_0x2bb764)throw new Error(_0xc583('0x54'));if(_0x2bb764['role']==='user'){var _0x282290=_0x4c486b;return db[_0xc583('0x55')][_0xc583('0x4d')]({'where':{'name':_0xc583('0x56'),'userProfileId':_0x2bb764[_0xc583('0x57')]},'raw':!![]})[_0xc583('0x29')](function(_0x3e2758){if(_0x3e2758&&_0x3e2758[_0xc583('0x58')]===0x0){return db['UserProfileResource'][_0xc583('0x4f')]({'name':_0x282290[_0xc583('0x30')],'resourceId':_0x282290['id'],'type':_0x3e2758[_0xc583('0x30')],'sectionId':_0x3e2758['id']},{})[_0xc583('0x29')](function(){return _0x4c486b;});}else{return _0x4c486b;}})['catch'](function(_0x43fda1){logger[_0xc583('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x43fda1);throw _0x43fda1;});}return _0x4c486b;})['then'](respondWithResult(_0x305239,null))[_0xc583('0x47')](handleError(_0x305239,null));};function Extension(_0x5ccfe7,_0x30b1e0,_0x1ba5cc,_0x40e8a6){this['context']='from-sip';this[_0xc583('0x59')]=_0x5ccfe7;this[_0xc583('0x5a')]=_0x1ba5cc;this[_0xc583('0x35')]=_0xc583('0x5b');this['description']=_0xc583('0x5c');this[_0xc583('0x5d')]=_0x30b1e0;this['appdata']=_0x40e8a6;}function createVoicePrefixExtensions(_0x508f4b,_0x28013a,_0x579c62){return new BPromise(function(_0x5df37d,_0x507f18){var _0x415b0f=new Extension(formatPrefixName(_0x508f4b[_0xc583('0x5e')]),0x1,_0xc583('0x5f'),_0xc583('0x60'));_0x415b0f['VoicePrefixId']=_0x508f4b['id'];return db['VoiceExtension'][_0xc583('0x4f')](_0x415b0f,{'transaction':_0x579c62})[_0xc583('0x29')](function(_0x599663){var _0x52cd21=_0x599663[_0xc583('0x2b')]({'plain':!![]});var _0x48f217=_[_0xc583('0x32')](addVoicePrefixExtensions(_0x508f4b,_0x28013a),function(_0x43f208){_0x43f208['VoiceExtensionId']=_0x52cd21['id'];_0x43f208[_0xc583('0x61')]=_0x508f4b['id'];return _0x43f208;});return db['VoiceExtension'][_0xc583('0x62')](_0x48f217,{'transaction':_0x579c62})[_0xc583('0x29')](function(_0x4b3f49){if(!_0x4b3f49){return _0x507f18(_0xc583('0x63'));}else{return _0x5df37d(_0x4b3f49);}})[_0xc583('0x47')](function(_0x20783b){return _0x507f18(_0x20783b);});});;});};function addVoicePrefixExtensions(_0xf4bc67,_0x1b5003){var _0x330a8e=[];var _0x37613c=formatPrefixName(_0xf4bc67[_0xc583('0x5e')]);_0x330a8e['push'](new Extension(_0x37613c,0x2,'Set','CDR(prefix)='+_0xf4bc67[_0xc583('0x30')]));if(_0xf4bc67['callerIdAll']){_0x330a8e[_0xc583('0x64')](new Extension(_0x37613c,0x3,_0xc583('0x65'),_0xc583('0x66')+_0xf4bc67[_0xc583('0x67')]));}else{_0x330a8e[_0xc583('0x64')](new Extension(_0x37613c,0x3,_0xc583('0x5f'),_0xc583('0x68')));}_0x330a8e[_0xc583('0x64')](new Extension(_0x37613c,0x4,'goto',_0x1b5003[_0xc583('0x69')]+','+_0xc583('0x6a')+(0x8+_0xf4bc67[_0xc583('0x30')][_0xc583('0x4b')])+'}'+','+0x1));return _0x330a8e;}function formatPrefixName(_0x41a064){var _0xb243ac='_';for(var _0x548f1c=0x0;_0x548f1c<_0x41a064[_0xc583('0x4b')];_0x548f1c++){if(_0x41a064[_0xc583('0x6b')](_0x548f1c)=='-'){_0xb243ac+=_0x41a064[_0xc583('0x6b')](_0x548f1c);}else{_0xb243ac+='['+_0x41a064[_0xc583('0x6b')](_0x548f1c)+']';}}_0xb243ac+='.';return _0xb243ac;}exports[_0xc583('0x28')]=function(_0x2b719f,_0x547d2f,_0x3e4616){var _0x1b6948=_0x2b719f[_0xc583('0x52')];_0x1b6948['prefix']=_0xc583('0x6c')+_0x1b6948['name']+'-';return db[_0xc583('0x50')][_0xc583('0x51')](function(_0x240174){return db[_0xc583('0x33')][_0xc583('0x28')](_0x1b6948,{'where':{'id':_0x1b6948['id']},'transaction':_0x240174})[_0xc583('0x29')](function(){return db[_0xc583('0x6d')]['destroy']({'where':{'VoicePrefixId':_0x1b6948['id']},'transaction':_0x240174})['then'](function(){return db['VoiceExtension']['find']({'where':{'id':_0x1b6948[_0xc583('0x53')]},'raw':!![]})[_0xc583('0x29')](function(_0x3a2a5c){return createVoicePrefixExtensions(_0x1b6948,_0x3a2a5c,_0x240174);});});});})[_0xc583('0x29')](function(){return db[_0xc583('0x33')][_0xc583('0x6e')](_0x1b6948['id']);})[_0xc583('0x29')](respondWithResult(_0x547d2f,null))[_0xc583('0x47')](handleError(_0x547d2f,null));};exports[_0xc583('0x6f')]=function(_0x1b8304,_0x4c9516,_0x22b75d){return db[_0xc583('0x33')]['find']({'where':{'id':_0x1b8304['params']['id']}})['then'](handleEntityNotFound(_0x4c9516,null))[_0xc583('0x29')](function(_0x10037e){if(_0x10037e){return _0x10037e[_0xc583('0x6f')](_0x1b8304[_0xc583('0x52')][_0xc583('0x70')],_[_0xc583('0x71')](_0x1b8304[_0xc583('0x52')],[_0xc583('0x70'),'id'])||{})[_0xc583('0x72')](function(_0x516fcb){for(var _0x442844=0x0;_0x442844<_0x1b8304[_0xc583('0x52')]['ids'][_0xc583('0x4b')];_0x442844+=0x1){socket[_0xc583('0x73')](_0xc583('0x74'),{'UserId':Number(_0x1b8304[_0xc583('0x52')][_0xc583('0x70')][_0x442844]),'VoicePrefixId':Number(_0x1b8304['params']['id'])});}return _0x516fcb;});}})[_0xc583('0x29')](respondWithResult(_0x4c9516,null))[_0xc583('0x47')](handleError(_0x4c9516,null));};exports[_0xc583('0x75')]=function(_0x2f0aa9,_0x50ef13,_0x4d6582){return db['VoicePrefix'][_0xc583('0x4d')]({'where':{'id':_0x2f0aa9['params']['id']}})['then'](handleEntityNotFound(_0x50ef13,null))['then'](function(_0x1c7323){if(_0x1c7323){return _0x1c7323[_0xc583('0x75')](_0x2f0aa9[_0xc583('0x37')][_0xc583('0x70')])[_0xc583('0x29')](function(){if(_['isArray'](_0x2f0aa9[_0xc583('0x37')][_0xc583('0x70')])){for(var _0x9a09b0=0x0;_0x9a09b0<_0x2f0aa9['query'][_0xc583('0x70')][_0xc583('0x4b')];_0x9a09b0+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x2f0aa9[_0xc583('0x37')][_0xc583('0x70')][_0x9a09b0]),'VoicePrefixId':Number(_0x2f0aa9[_0xc583('0x48')]['id'])});}}else{socket[_0xc583('0x73')](_0xc583('0x76'),{'UserId':Number(_0x2f0aa9[_0xc583('0x37')][_0xc583('0x70')]),'VoicePrefixId':Number(_0x2f0aa9[_0xc583('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x50ef13,null))[_0xc583('0x47')](handleError(_0x50ef13,null));};exports[_0xc583('0x77')]=function(_0x3ea593,_0x3eabb9,_0x674d99){var _0x2b98b7={};var _0x20c4e6={};var _0x149051;var _0x1f0ab4;return db[_0xc583('0x33')][_0xc583('0x78')]({'where':{'id':_0x3ea593[_0xc583('0x48')]['id']}})[_0xc583('0x29')](handleEntityNotFound(_0x3eabb9,null))[_0xc583('0x29')](function(_0x42ff52){if(_0x42ff52){_0x149051=_0x42ff52;_0x20c4e6[_0xc583('0x36')]=_[_0xc583('0x38')](db[_0xc583('0x79')][_0xc583('0x49')]);_0x20c4e6[_0xc583('0x37')]=_[_0xc583('0x38')](_0x3ea593[_0xc583('0x37')]);_0x20c4e6[_0xc583('0x39')]=_[_0xc583('0x4a')](_0x20c4e6['model'],_0x20c4e6['query']);_0x2b98b7[_0xc583('0x3a')]=_[_0xc583('0x4a')](_0x20c4e6['model'],qs['fields'](_0x3ea593[_0xc583('0x37')][_0xc583('0x3b')]));_0x2b98b7['attributes']=_0x2b98b7['attributes'][_0xc583('0x4b')]?_0x2b98b7[_0xc583('0x3a')]:_0x20c4e6[_0xc583('0x36')];_0x2b98b7['order']=qs['sort'](_0x3ea593[_0xc583('0x37')][_0xc583('0x3e')]);_0x2b98b7[_0xc583('0x40')]=qs['filters'](_[_0xc583('0x3f')](_0x3ea593[_0xc583('0x37')],_0x20c4e6['filters']));if(_0x3ea593[_0xc583('0x37')][_0xc583('0x7a')]){_0x2b98b7[_0xc583('0x40')]=_[_0xc583('0x41')](_0x2b98b7[_0xc583('0x40')],{'$or':_[_0xc583('0x32')](_0x2b98b7[_0xc583('0x3a')],function(_0x47e7f8){var _0x4a2671={};_0x4a2671[_0x47e7f8]={'$like':'%'+_0x3ea593['query'][_0xc583('0x7a')]+'%'};return _0x4a2671;})});}_0x2b98b7=_[_0xc583('0x41')]({},_0x2b98b7,_0x3ea593[_0xc583('0x43')]);return _0x149051[_0xc583('0x77')](_0x2b98b7);}})[_0xc583('0x29')](function(_0x3ab1a1){if(_0x3ab1a1){_0x1f0ab4=_0x3ab1a1[_0xc583('0x4b')];if(!_0x3ea593[_0xc583('0x37')]['hasOwnProperty'](_0xc583('0x3c'))){_0x2b98b7[_0xc583('0x22')]=qs[_0xc583('0x22')](_0x3ea593[_0xc583('0x37')]['limit']);_0x2b98b7['offset']=qs['offset'](_0x3ea593[_0xc583('0x37')][_0xc583('0x21')]);}return _0x149051[_0xc583('0x77')](_0x2b98b7);}})[_0xc583('0x29')](function(_0x3a04a6){if(_0x3a04a6){return _0x3a04a6?{'count':_0x1f0ab4,'rows':_0x3a04a6}:null;}})[_0xc583('0x29')](respondWithResult(_0x3eabb9,null))['catch'](handleError(_0x3eabb9,null));};exports['getTeams']=function(_0x1907ff,_0x422848,_0x492e13){var _0xc11b2e={};var _0x1a2a0d={};var _0x2f6ea4;var _0x3e4c37;return db[_0xc583('0x33')][_0xc583('0x78')]({'where':{'id':_0x1907ff['params']['id']}})[_0xc583('0x29')](handleEntityNotFound(_0x422848,null))[_0xc583('0x29')](function(_0x3eb4a8){if(_0x3eb4a8){_0x2f6ea4=_0x3eb4a8;_0x1a2a0d[_0xc583('0x36')]=_[_0xc583('0x38')](db[_0xc583('0x7b')][_0xc583('0x49')]);_0x1a2a0d[_0xc583('0x37')]=_[_0xc583('0x38')](_0x1907ff[_0xc583('0x37')]);_0x1a2a0d['filters']=_[_0xc583('0x4a')](_0x1a2a0d[_0xc583('0x36')],_0x1a2a0d[_0xc583('0x37')]);_0xc11b2e['attributes']=_[_0xc583('0x4a')](_0x1a2a0d['model'],qs[_0xc583('0x3b')](_0x1907ff[_0xc583('0x37')][_0xc583('0x3b')]));_0xc11b2e[_0xc583('0x3a')]=_0xc11b2e[_0xc583('0x3a')][_0xc583('0x4b')]?_0xc11b2e[_0xc583('0x3a')]:_0x1a2a0d['model'];_0xc11b2e[_0xc583('0x3d')]=qs['sort'](_0x1907ff[_0xc583('0x37')]['sort']);_0xc11b2e[_0xc583('0x40')]=qs[_0xc583('0x39')](_[_0xc583('0x3f')](_0x1907ff[_0xc583('0x37')],_0x1a2a0d[_0xc583('0x39')]));if(_0x1907ff[_0xc583('0x37')][_0xc583('0x7a')]){_0xc11b2e[_0xc583('0x40')]=_['merge'](_0xc11b2e[_0xc583('0x40')],{'$or':_[_0xc583('0x32')](_0xc11b2e[_0xc583('0x3a')],function(_0x3ae684){var _0x424cd7={};_0x424cd7[_0x3ae684]={'$like':'%'+_0x1907ff['query'][_0xc583('0x7a')]+'%'};return _0x424cd7;})});}_0xc11b2e=_[_0xc583('0x41')]({},_0xc11b2e,_0x1907ff[_0xc583('0x43')]);return _0x2f6ea4['getTeams'](_0xc11b2e);}})['then'](function(_0xbbdcc4){if(_0xbbdcc4){_0x3e4c37=_0xbbdcc4[_0xc583('0x4b')];if(!_0x1907ff[_0xc583('0x37')][_0xc583('0x7c')](_0xc583('0x3c'))){_0xc11b2e[_0xc583('0x22')]=qs['limit'](_0x1907ff[_0xc583('0x37')][_0xc583('0x22')]);_0xc11b2e[_0xc583('0x21')]=qs[_0xc583('0x21')](_0x1907ff[_0xc583('0x37')]['offset']);}return _0x2f6ea4[_0xc583('0x7d')](_0xc11b2e);}})['then'](function(_0x1371a2){if(_0x1371a2){return _0x1371a2?{'count':_0x3e4c37,'rows':_0x1371a2}:null;}})['then'](respondWithResult(_0x422848,null))[_0xc583('0x47')](handleError(_0x422848,null));};exports[_0xc583('0x7e')]=function(_0x5b9b20,_0x5ebdb6,_0x1f1dfc){var _0x3f8a4e=_0x5b9b20[_0xc583('0x52')][_0xc583('0x70')];var _0x43e533;return db['Team'][_0xc583('0x45')]({'where':{'id':_0x3f8a4e},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc583('0x7f'),'attributes':['id',_0xc583('0x30'),_0xc583('0x80'),_0xc583('0x81'),'interface'],'raw':!![]}]})['then'](function(_0x54f43b){if(_0x54f43b){_0x43e533=_0x54f43b;var _0x1cbdea=_[_0xc583('0x82')](_0x54f43b,function(_0x2afb8c){var _0x5252a8=_0x2afb8c[_0xc583('0x2b')]({'plain':!![]});return _0x5252a8[_0xc583('0x7f')];});return db['VoicePrefix'][_0xc583('0x4d')]({'where':{'id':_0x5b9b20['params']['id']}})[_0xc583('0x29')](function(_0x3d1570){return db[_0xc583('0x50')][_0xc583('0x51')](function(_0x48e574){return _0x3d1570[_0xc583('0x7e')](_0x3f8a4e,{'transaction':_0x48e574})[_0xc583('0x29')](function(){return BPromise[_0xc583('0x83')](_0x43e533,function(_0x499821){return db['TeamVoicePrefix']['upsert']({'TeamId':_0x499821['id'],'VoicePrefixId':_0x5b9b20[_0xc583('0x48')]['id']},{'transaction':_0x48e574});});})[_0xc583('0x29')](function(){return BPromise['each'](_0x1cbdea,function(_0x363a8e){return db[_0xc583('0x84')]['findOrCreate']({'where':{'UserId':_0x363a8e['id'],'VoicePrefixId':_0x5b9b20['params']['id']},'transaction':_0x48e574});});})[_0xc583('0x29')](function(){_0x1cbdea['forEach'](function(_0x790cd1){socket[_0xc583('0x73')](_0xc583('0x74'),{'UserId':_0x790cd1['id'],'VoicePrefixId':_0x3d1570['id']});});});});});}})[_0xc583('0x29')](respondWithStatusCode(_0x5ebdb6,null))[_0xc583('0x47')](handleError(_0x5ebdb6,null));};exports[_0xc583('0x85')]=function(_0x59781d,_0x3bcbce,_0x1628f4){return db[_0xc583('0x7b')][_0xc583('0x45')]({'where':{'id':_0x59781d[_0xc583('0x37')][_0xc583('0x70')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc583('0x7f'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3bcbce,null))[_0xc583('0x29')](function(_0x146b9c){var _0x4a6c7c=_['map'](_0x146b9c,'id');var _0x42b5a5=[];var _0x583588=[];var _0x564e57=squel[_0xc583('0x86')]();_0x564e57['field'](_0xc583('0x87'))[_0xc583('0x88')](_0xc583('0x89'),'tq')[_0xc583('0x8a')]('user_has_teams','ut',_0xc583('0x8b'))[_0xc583('0x40')](_0xc583('0x8c'),_0x59781d[_0xc583('0x48')]['id']);for(var _0x162607=0x0;_0x162607<_0x146b9c[_0xc583('0x4b')];_0x162607+=0x1){let _0x39a000=_0x146b9c[_0x162607];for(var _0x63eee8=0x0;_0x63eee8<_0x39a000[_0xc583('0x7f')][_0xc583('0x4b')];_0x63eee8+=0x1){let _0x459caf=_0x39a000[_0xc583('0x7f')][_0x63eee8];var _0x4075bd=_0x564e57['clone']();_0x4075bd[_0xc583('0x40')](_0xc583('0x8d'),_0x459caf['id']);_0x583588[_0xc583('0x64')](db[_0xc583('0x50')][_0xc583('0x37')](_0x4075bd[_0xc583('0x8e')](),{'type':db[_0xc583('0x50')][_0xc583('0x8f')]['SELECT']})[_0xc583('0x29')](function(_0x7ac229){if(_0x7ac229['length']===0x1){return _0x459caf['id'];}else{var _0x56cc96=_[_0xc583('0x90')](_[_0xc583('0x32')](_0x7ac229,'TeamId'),function(_0x25dde6){return _['includes'](_0x4a6c7c,_0x25dde6);});if(_0x56cc96){return _0x459caf['id'];}}}));}}return BPromise[_0xc583('0x91')](_0x583588)[_0xc583('0x29')](function(_0x1de88f){_0x42b5a5=_(_0x42b5a5)[_0xc583('0x92')](_0x1de88f)[_0xc583('0x93')]()[_0xc583('0x94')]();return db[_0xc583('0x33')]['find']({'where':{'id':_0x59781d['params']['id']}})[_0xc583('0x29')](function(_0x592b63){return db[_0xc583('0x50')]['transaction'](function(_0x440079){return _0x592b63[_0xc583('0x85')](_0x59781d['query'][_0xc583('0x70')],{'transaction':_0x440079})[_0xc583('0x29')](function(){if(!_[_0xc583('0x95')](_0x42b5a5)){return _0x592b63[_0xc583('0x75')](_0x42b5a5,{'transaction':_0x440079});}})['then'](function(){_0x42b5a5[_0xc583('0x96')](function(_0x182c40){socket[_0xc583('0x73')]('userVoicePrefix:remove',{'UserId':_0x182c40,'VoicePrefixId':_0x592b63['id']});});});});});});})[_0xc583('0x29')](respondWithStatusCode(_0x3bcbce,null))[_0xc583('0x47')](handleError(_0x3bcbce,null));};
\ No newline at end of file
+var _0x087b=['status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','VoicePrefixes','UserProfileResource','end','error','stack','name','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','merge','VIRTUAL','where','include','catch','options','find','describe','create','sequelize','transaction','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','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','Set','CDR(prefix)=','callerIdAll','push','No\x20callerid\x20available','context','charAt','body','system-','findById','addAgents','params','omit','ids','spread','removeAgents','isArray','emit','userVoicePrefix:remove','findOne','User','pick','getAgents','nolimit','getTeams','Team','addTeams','findAll','interface','flatMap','Agents','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','userVoicePrefix:save','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','union','compact','value','removeTeams','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus'];(function(_0x37f31f,_0x3138af){var _0x35c6ce=function(_0x4ea057){while(--_0x4ea057){_0x37f31f['push'](_0x37f31f['shift']());}};_0x35c6ce(++_0x3138af);}(_0x087b,0x11a));var _0xb087=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0x087b[_0x26f702];return _0x11417d;};'use strict';var emlformat=require(_0xb087('0x0'));var rimraf=require(_0xb087('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb087('0x2'));var moment=require('moment');var BPromise=require(_0xb087('0x3'));var Mustache=require(_0xb087('0x4'));var util=require(_0xb087('0x5'));var path=require(_0xb087('0x6'));var sox=require(_0xb087('0x7'));var csv=require(_0xb087('0x8'));var ejs=require(_0xb087('0x9'));var fs=require('fs');var fs_extra=require(_0xb087('0xa'));var _=require(_0xb087('0xb'));var squel=require(_0xb087('0xc'));var crypto=require(_0xb087('0xd'));var jsforce=require(_0xb087('0xe'));var deskjs=require(_0xb087('0xf'));var toCsv=require(_0xb087('0x8'));var querystring=require(_0xb087('0x10'));var Papa=require(_0xb087('0x11'));var Redis=require(_0xb087('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb087('0x13'));var as=require(_0xb087('0x14'));var hardwareService=require(_0xb087('0x15'));var logger=require(_0xb087('0x16'))(_0xb087('0x17'));var utils=require(_0xb087('0x18'));var config=require(_0xb087('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xb087('0x1a'))['db'];config[_0xb087('0x1b')]=_[_0xb087('0x1c')](config['redis'],{'host':_0xb087('0x1d'),'port':0x18eb});var socket=require(_0xb087('0x1e'))(new Redis(config[_0xb087('0x1b')]));require(_0xb087('0x1f'))[_0xb087('0x20')](socket);function respondWithStatusCode(_0x12d0db,_0x5e9757){_0x5e9757=_0x5e9757||0xcc;return function(_0x5147e3){if(_0x5147e3){return _0x12d0db[_0xb087('0x21')](_0x5e9757);}return _0x12d0db[_0xb087('0x22')](_0x5e9757)['end']();};}function respondWithResult(_0x43e576,_0x412b48){_0x412b48=_0x412b48||0xc8;return function(_0x597478){if(_0x597478){return _0x43e576[_0xb087('0x22')](_0x412b48)[_0xb087('0x23')](_0x597478);}};}function respondWithFilteredResult(_0x2e9e74,_0x5bb80b){return function(_0x330005){if(_0x330005){var _0x3c680f=typeof _0x5bb80b[_0xb087('0x24')]===_0xb087('0x25')&&typeof _0x5bb80b['limit']===_0xb087('0x25');var _0x28428e=_0x330005[_0xb087('0x26')];var _0x23c1b6=_0x3c680f?0x0:_0x5bb80b['offset'];var _0x5aeab1=_0x3c680f?_0x330005['count']:_0x5bb80b['offset']+_0x5bb80b[_0xb087('0x27')];var _0x17be8e;if(_0x5aeab1>=_0x28428e){_0x5aeab1=_0x28428e;_0x17be8e=0xc8;}else{_0x17be8e=0xce;}_0x2e9e74[_0xb087('0x22')](_0x17be8e);return _0x2e9e74[_0xb087('0x28')](_0xb087('0x29'),_0x23c1b6+'-'+_0x5aeab1+'/'+_0x28428e)[_0xb087('0x23')](_0x330005);}return null;};}function patchUpdates(_0x31ae01){return function(_0x5587f7){try{jsonpatch[_0xb087('0x2a')](_0x5587f7,_0x31ae01,!![]);}catch(_0x466397){return BPromise[_0xb087('0x2b')](_0x466397);}return _0x5587f7[_0xb087('0x2c')]();};}function saveUpdates(_0x3ad74e,_0x4d9028){return function(_0x183eab){if(_0x183eab){return _0x183eab[_0xb087('0x2d')](_0x3ad74e)['then'](function(_0x5a2dc6){return _0x5a2dc6;});}return null;};}function removeEntity(_0x50745a,_0x598b99){return function(_0x5a4ee0){if(_0x5a4ee0){return _0x5a4ee0[_0xb087('0x2e')]()[_0xb087('0x2f')](function(){var _0x1d124f=_0x5a4ee0[_0xb087('0x30')]({'plain':!![]});var _0xd9ec66=_0xb087('0x31');return db[_0xb087('0x32')][_0xb087('0x2e')]({'where':{'type':_0xd9ec66,'resourceId':_0x1d124f['id']}})[_0xb087('0x2f')](function(){return _0x5a4ee0;});})[_0xb087('0x2f')](function(){_0x50745a[_0xb087('0x22')](0xcc)[_0xb087('0x33')]();});}};}function handleEntityNotFound(_0xb0baf6,_0x263259){return function(_0x593b78){if(!_0x593b78){_0xb0baf6[_0xb087('0x21')](0x194);}return _0x593b78;};}function handleError(_0x1335d9,_0x20183f){_0x20183f=_0x20183f||0x1f4;return function(_0x15c9ac){logger[_0xb087('0x34')](_0x15c9ac[_0xb087('0x35')]);if(_0x15c9ac[_0xb087('0x36')]){delete _0x15c9ac[_0xb087('0x36')];}_0x1335d9['status'](_0x20183f)['send'](_0x15c9ac);};}exports[_0xb087('0x37')]=function(_0xedd164,_0x4cb5a8){var _0x60bfe2={},_0x7d3776={},_0x2a48d3={'count':0x0,'rows':[]};var _0x32b20d=_[_0xb087('0x38')](db[_0xb087('0x39')][_0xb087('0x3a')],function(_0x3b7ace){return{'name':_0x3b7ace[_0xb087('0x3b')],'type':_0x3b7ace[_0xb087('0x3c')][_0xb087('0x3d')]};});_0x7d3776[_0xb087('0x3e')]=_['map'](_0x32b20d,_0xb087('0x36'));_0x7d3776['query']=_[_0xb087('0x3f')](_0xedd164[_0xb087('0x40')]);_0x7d3776[_0xb087('0x41')]=_[_0xb087('0x42')](_0x7d3776[_0xb087('0x3e')],_0x7d3776[_0xb087('0x40')]);_0x60bfe2[_0xb087('0x43')]=_[_0xb087('0x42')](_0x7d3776[_0xb087('0x3e')],qs['fields'](_0xedd164['query'][_0xb087('0x44')]));_0x60bfe2[_0xb087('0x43')]=_0x60bfe2[_0xb087('0x43')][_0xb087('0x45')]?_0x60bfe2[_0xb087('0x43')]:_0x7d3776['model'];if(!_0xedd164[_0xb087('0x40')][_0xb087('0x46')]('nolimit')){_0x60bfe2['limit']=qs[_0xb087('0x27')](_0xedd164[_0xb087('0x40')][_0xb087('0x27')]);_0x60bfe2['offset']=qs[_0xb087('0x24')](_0xedd164[_0xb087('0x40')][_0xb087('0x24')]);}_0x60bfe2[_0xb087('0x47')]=qs[_0xb087('0x48')](_0xedd164['query'][_0xb087('0x48')]);_0x60bfe2['where']=qs[_0xb087('0x41')](_['pick'](_0xedd164[_0xb087('0x40')],_0x7d3776[_0xb087('0x41')]),_0x32b20d);if(_0xedd164['query'][_0xb087('0x49')]){_0x60bfe2['where']=_[_0xb087('0x4a')](_0x60bfe2['where'],{'$or':_[_0xb087('0x38')](_0x32b20d,function(_0x326934){if(_0x326934[_0xb087('0x3c')]!==_0xb087('0x4b')){var _0x1785e0={};_0x1785e0[_0x326934[_0xb087('0x36')]]={'$like':'%'+_0xedd164[_0xb087('0x40')]['filter']+'%'};return _0x1785e0;}})});}_0x60bfe2=_[_0xb087('0x4a')]({},_0x60bfe2,_0xedd164['options']);var _0x2a2b9c={'where':_0x60bfe2[_0xb087('0x4c')]};return db['VoicePrefix'][_0xb087('0x26')](_0x2a2b9c)[_0xb087('0x2f')](function(_0x7650c5){_0x2a48d3['count']=_0x7650c5;if(_0xedd164[_0xb087('0x40')]['includeAll']){_0x60bfe2[_0xb087('0x4d')]=[{'all':!![]}];}return db[_0xb087('0x39')]['findAll'](_0x60bfe2);})[_0xb087('0x2f')](function(_0x302ce7){_0x2a48d3['rows']=_0x302ce7;return _0x2a48d3;})[_0xb087('0x2f')](respondWithFilteredResult(_0x4cb5a8,_0x60bfe2))[_0xb087('0x4e')](handleError(_0x4cb5a8,null));};exports['show']=function(_0x93ada7,_0x46c713){var _0x1d7f80={'raw':![],'where':{'id':_0x93ada7['params']['id']}},_0x174c10={};_0x174c10['model']=_[_0xb087('0x3f')](db[_0xb087('0x39')][_0xb087('0x3a')]);_0x174c10[_0xb087('0x40')]=_[_0xb087('0x3f')](_0x93ada7[_0xb087('0x40')]);_0x174c10['filters']=_['intersection'](_0x174c10[_0xb087('0x3e')],_0x174c10['query']);_0x1d7f80[_0xb087('0x43')]=_[_0xb087('0x42')](_0x174c10[_0xb087('0x3e')],qs[_0xb087('0x44')](_0x93ada7['query'][_0xb087('0x44')]));_0x1d7f80['attributes']=_0x1d7f80[_0xb087('0x43')][_0xb087('0x45')]?_0x1d7f80[_0xb087('0x43')]:_0x174c10[_0xb087('0x3e')];if(_0x93ada7[_0xb087('0x40')]['includeAll']){_0x1d7f80[_0xb087('0x4d')]=[{'all':!![]}];}_0x1d7f80=_[_0xb087('0x4a')]({},_0x1d7f80,_0x93ada7[_0xb087('0x4f')]);return db['VoicePrefix'][_0xb087('0x50')](_0x1d7f80)['then'](handleEntityNotFound(_0x46c713,null))['then'](respondWithResult(_0x46c713,null))[_0xb087('0x4e')](handleError(_0x46c713,null));};exports[_0xb087('0x2e')]=function(_0x5eacf3,_0x4362d4){return db[_0xb087('0x39')][_0xb087('0x50')]({'where':{'id':_0x5eacf3['params']['id']}})['then'](handleEntityNotFound(_0x4362d4,null))[_0xb087('0x2f')](removeEntity(_0x4362d4,null))['catch'](handleError(_0x4362d4,null));};exports['describe']=function(_0x1e52e4,_0x3bafca){return db[_0xb087('0x39')][_0xb087('0x51')]()[_0xb087('0x2f')](respondWithResult(_0x3bafca,null))[_0xb087('0x4e')](handleError(_0x3bafca,null));};exports[_0xb087('0x52')]=function(_0xfb8827,_0x1fe178){var _0x18d93b;return db[_0xb087('0x53')][_0xb087('0x54')](function(_0x55e653){return db[_0xb087('0x39')][_0xb087('0x52')](_0xfb8827['body'],{'transaction':_0x55e653})[_0xb087('0x2f')](function(_0x458301){_0x18d93b=_0x458301[_0xb087('0x30')]({'plain':!![]});return db[_0xb087('0x55')][_0xb087('0x50')]({'where':{'id':_0x18d93b[_0xb087('0x56')]},'raw':!![]})[_0xb087('0x2f')](function(_0x298169){return createVoicePrefixExtensions(_0x18d93b,_0x298169,_0x55e653);});});})[_0xb087('0x2f')](function(){var _0x357616=_0xfb8827[_0xb087('0x57')]['get']({'plain':!![]});if(!_0x357616)throw new Error(_0xb087('0x58'));if(_0x357616['role']===_0xb087('0x57')){var _0x575cc4=_0x18d93b;return db[_0xb087('0x59')][_0xb087('0x50')]({'where':{'name':_0xb087('0x31'),'userProfileId':_0x357616[_0xb087('0x5a')]},'raw':!![]})[_0xb087('0x2f')](function(_0x465ef6){if(_0x465ef6&&_0x465ef6[_0xb087('0x5b')]===0x0){return db[_0xb087('0x32')][_0xb087('0x52')]({'name':_0x575cc4[_0xb087('0x36')],'resourceId':_0x575cc4['id'],'type':_0x465ef6[_0xb087('0x36')],'sectionId':_0x465ef6['id']},{})[_0xb087('0x2f')](function(){return _0x18d93b;});}else{return _0x18d93b;}})[_0xb087('0x4e')](function(_0x22be05){logger[_0xb087('0x34')](_0xb087('0x5c'),_0x22be05);throw _0x22be05;});}return _0x18d93b;})[_0xb087('0x2f')](respondWithResult(_0x1fe178,null))[_0xb087('0x4e')](handleError(_0x1fe178,null));};function Extension(_0x40ff74,_0xe3cb2,_0x4053c8,_0x459c5b){this['context']=_0xb087('0x5d');this[_0xb087('0x5e')]=_0x40ff74;this[_0xb087('0x5f')]=_0x4053c8;this['type']=_0xb087('0x60');this[_0xb087('0x61')]='Voice\x20Prefix\x20Extension';this[_0xb087('0x62')]=_0xe3cb2;this[_0xb087('0x63')]=_0x459c5b;}function createVoicePrefixExtensions(_0x2e3a14,_0x596264,_0x133c58){return new BPromise(function(_0x257894,_0x3d7f74){var _0x43ef22=new Extension(formatPrefixName(_0x2e3a14[_0xb087('0x64')]),0x1,_0xb087('0x65'),_0xb087('0x66'));_0x43ef22[_0xb087('0x67')]=_0x2e3a14['id'];return db['VoiceExtension'][_0xb087('0x52')](_0x43ef22,{'transaction':_0x133c58})[_0xb087('0x2f')](function(_0x44548f){var _0x47b2c7=_0x44548f[_0xb087('0x30')]({'plain':!![]});var _0x4a26d0=_['map'](addVoicePrefixExtensions(_0x2e3a14,_0x596264),function(_0x3516d4){_0x3516d4[_0xb087('0x56')]=_0x47b2c7['id'];_0x3516d4['VoicePrefixId']=_0x2e3a14['id'];return _0x3516d4;});return db[_0xb087('0x55')]['bulkCreate'](_0x4a26d0,{'transaction':_0x133c58})[_0xb087('0x2f')](function(_0x1a8237){if(!_0x1a8237){return _0x3d7f74('Extensions\x20creation\x20failed');}else{return _0x257894(_0x1a8237);}})['catch'](function(_0x22219d){return _0x3d7f74(_0x22219d);});});;});};function addVoicePrefixExtensions(_0x5c43c8,_0x5ede2e){var _0x3c97ab=[];var _0x52d72a=formatPrefixName(_0x5c43c8[_0xb087('0x64')]);_0x3c97ab['push'](new Extension(_0x52d72a,0x2,_0xb087('0x68'),_0xb087('0x69')+_0x5c43c8[_0xb087('0x36')]));if(_0x5c43c8[_0xb087('0x6a')]){_0x3c97ab[_0xb087('0x6b')](new Extension(_0x52d72a,0x3,_0xb087('0x68'),'PREFIX-CALLERIDALL='+_0x5c43c8[_0xb087('0x6a')]));}else{_0x3c97ab['push'](new Extension(_0x52d72a,0x3,_0xb087('0x65'),_0xb087('0x6c')));}_0x3c97ab[_0xb087('0x6b')](new Extension(_0x52d72a,0x4,'goto',_0x5ede2e[_0xb087('0x6d')]+','+'${EXTEN:'+(0x8+_0x5c43c8[_0xb087('0x36')][_0xb087('0x45')])+'}'+','+0x1));return _0x3c97ab;}function formatPrefixName(_0x66f15b){var _0x2ee63f='_';for(var _0x16cb87=0x0;_0x16cb87<_0x66f15b[_0xb087('0x45')];_0x16cb87++){if(_0x66f15b['charAt'](_0x16cb87)=='-'){_0x2ee63f+=_0x66f15b[_0xb087('0x6e')](_0x16cb87);}else{_0x2ee63f+='['+_0x66f15b[_0xb087('0x6e')](_0x16cb87)+']';}}_0x2ee63f+='.';return _0x2ee63f;}exports['update']=function(_0x25a45f,_0x58de88,_0x19238d){var _0x38f5d2=_0x25a45f[_0xb087('0x6f')];_0x38f5d2[_0xb087('0x64')]=_0xb087('0x70')+_0x38f5d2[_0xb087('0x36')]+'-';return db[_0xb087('0x53')][_0xb087('0x54')](function(_0x509ee7){return db['VoicePrefix']['update'](_0x38f5d2,{'where':{'id':_0x38f5d2['id']},'transaction':_0x509ee7})[_0xb087('0x2f')](function(){return db['VoiceExtension'][_0xb087('0x2e')]({'where':{'VoicePrefixId':_0x38f5d2['id']},'transaction':_0x509ee7})['then'](function(){return db[_0xb087('0x55')][_0xb087('0x50')]({'where':{'id':_0x38f5d2[_0xb087('0x56')]},'raw':!![]})[_0xb087('0x2f')](function(_0x49d0d3){return createVoicePrefixExtensions(_0x38f5d2,_0x49d0d3,_0x509ee7);});});});})[_0xb087('0x2f')](function(){return db['VoicePrefix'][_0xb087('0x71')](_0x38f5d2['id']);})[_0xb087('0x2f')](respondWithResult(_0x58de88,null))[_0xb087('0x4e')](handleError(_0x58de88,null));};exports[_0xb087('0x72')]=function(_0x5b5ad3,_0x49d26a,_0x38f296){return db['VoicePrefix'][_0xb087('0x50')]({'where':{'id':_0x5b5ad3[_0xb087('0x73')]['id']}})[_0xb087('0x2f')](handleEntityNotFound(_0x49d26a,null))[_0xb087('0x2f')](function(_0x4a9193){if(_0x4a9193){return _0x4a9193['addAgents'](_0x5b5ad3[_0xb087('0x6f')]['ids'],_[_0xb087('0x74')](_0x5b5ad3[_0xb087('0x6f')],[_0xb087('0x75'),'id'])||{})[_0xb087('0x76')](function(_0x142b0f){for(var _0x581ad4=0x0;_0x581ad4<_0x5b5ad3[_0xb087('0x6f')][_0xb087('0x75')]['length'];_0x581ad4+=0x1){socket['emit']('userVoicePrefix:save',{'UserId':Number(_0x5b5ad3[_0xb087('0x6f')][_0xb087('0x75')][_0x581ad4]),'VoicePrefixId':Number(_0x5b5ad3[_0xb087('0x73')]['id'])});}return _0x142b0f;});}})[_0xb087('0x2f')](respondWithResult(_0x49d26a,null))[_0xb087('0x4e')](handleError(_0x49d26a,null));};exports[_0xb087('0x77')]=function(_0x47ea48,_0xd1f58a,_0x25e097){return db[_0xb087('0x39')][_0xb087('0x50')]({'where':{'id':_0x47ea48[_0xb087('0x73')]['id']}})[_0xb087('0x2f')](handleEntityNotFound(_0xd1f58a,null))[_0xb087('0x2f')](function(_0x50454b){if(_0x50454b){return _0x50454b[_0xb087('0x77')](_0x47ea48[_0xb087('0x40')][_0xb087('0x75')])['then'](function(){if(_[_0xb087('0x78')](_0x47ea48['query'][_0xb087('0x75')])){for(var _0x5fb869=0x0;_0x5fb869<_0x47ea48[_0xb087('0x40')][_0xb087('0x75')][_0xb087('0x45')];_0x5fb869+=0x1){socket[_0xb087('0x79')]('userVoicePrefix:remove',{'UserId':Number(_0x47ea48['query'][_0xb087('0x75')][_0x5fb869]),'VoicePrefixId':Number(_0x47ea48[_0xb087('0x73')]['id'])});}}else{socket['emit'](_0xb087('0x7a'),{'UserId':Number(_0x47ea48[_0xb087('0x40')][_0xb087('0x75')]),'VoicePrefixId':Number(_0x47ea48[_0xb087('0x73')]['id'])});}});}})[_0xb087('0x2f')](respondWithStatusCode(_0xd1f58a,null))[_0xb087('0x4e')](handleError(_0xd1f58a,null));};exports['getAgents']=function(_0x15ff29,_0x141859,_0x2c92f6){var _0x3114ce={};var _0x416e05={};var _0x3d6d1a;var _0xf286de;return db[_0xb087('0x39')][_0xb087('0x7b')]({'where':{'id':_0x15ff29['params']['id']}})[_0xb087('0x2f')](handleEntityNotFound(_0x141859,null))['then'](function(_0x2a32d0){if(_0x2a32d0){_0x3d6d1a=_0x2a32d0;_0x416e05[_0xb087('0x3e')]=_['keys'](db[_0xb087('0x7c')][_0xb087('0x3a')]);_0x416e05[_0xb087('0x40')]=_[_0xb087('0x3f')](_0x15ff29[_0xb087('0x40')]);_0x416e05[_0xb087('0x41')]=_['intersection'](_0x416e05[_0xb087('0x3e')],_0x416e05[_0xb087('0x40')]);_0x3114ce[_0xb087('0x43')]=_[_0xb087('0x42')](_0x416e05[_0xb087('0x3e')],qs['fields'](_0x15ff29[_0xb087('0x40')][_0xb087('0x44')]));_0x3114ce[_0xb087('0x43')]=_0x3114ce[_0xb087('0x43')][_0xb087('0x45')]?_0x3114ce[_0xb087('0x43')]:_0x416e05[_0xb087('0x3e')];_0x3114ce[_0xb087('0x47')]=qs[_0xb087('0x48')](_0x15ff29[_0xb087('0x40')][_0xb087('0x48')]);_0x3114ce['where']=qs['filters'](_[_0xb087('0x7d')](_0x15ff29[_0xb087('0x40')],_0x416e05[_0xb087('0x41')]));if(_0x15ff29[_0xb087('0x40')][_0xb087('0x49')]){_0x3114ce['where']=_[_0xb087('0x4a')](_0x3114ce[_0xb087('0x4c')],{'$or':_[_0xb087('0x38')](_0x3114ce[_0xb087('0x43')],function(_0x3e58be){var _0xbe2a4c={};_0xbe2a4c[_0x3e58be]={'$like':'%'+_0x15ff29['query'][_0xb087('0x49')]+'%'};return _0xbe2a4c;})});}_0x3114ce=_['merge']({},_0x3114ce,_0x15ff29['options']);return _0x3d6d1a[_0xb087('0x7e')](_0x3114ce);}})[_0xb087('0x2f')](function(_0x3a446d){if(_0x3a446d){_0xf286de=_0x3a446d[_0xb087('0x45')];if(!_0x15ff29['query'][_0xb087('0x46')](_0xb087('0x7f'))){_0x3114ce['limit']=qs[_0xb087('0x27')](_0x15ff29['query']['limit']);_0x3114ce[_0xb087('0x24')]=qs[_0xb087('0x24')](_0x15ff29[_0xb087('0x40')][_0xb087('0x24')]);}return _0x3d6d1a[_0xb087('0x7e')](_0x3114ce);}})['then'](function(_0x3cf818){if(_0x3cf818){return _0x3cf818?{'count':_0xf286de,'rows':_0x3cf818}:null;}})[_0xb087('0x2f')](respondWithResult(_0x141859,null))[_0xb087('0x4e')](handleError(_0x141859,null));};exports[_0xb087('0x80')]=function(_0x48e2c6,_0x489b1f,_0x544a68){var _0x5ebb4f={};var _0x17f0af={};var _0x3296c9;var _0x10e4b6;return db[_0xb087('0x39')][_0xb087('0x7b')]({'where':{'id':_0x48e2c6[_0xb087('0x73')]['id']}})[_0xb087('0x2f')](handleEntityNotFound(_0x489b1f,null))['then'](function(_0x5d45e7){if(_0x5d45e7){_0x3296c9=_0x5d45e7;_0x17f0af[_0xb087('0x3e')]=_[_0xb087('0x3f')](db[_0xb087('0x81')][_0xb087('0x3a')]);_0x17f0af['query']=_[_0xb087('0x3f')](_0x48e2c6['query']);_0x17f0af[_0xb087('0x41')]=_['intersection'](_0x17f0af[_0xb087('0x3e')],_0x17f0af[_0xb087('0x40')]);_0x5ebb4f[_0xb087('0x43')]=_[_0xb087('0x42')](_0x17f0af['model'],qs[_0xb087('0x44')](_0x48e2c6['query']['fields']));_0x5ebb4f['attributes']=_0x5ebb4f[_0xb087('0x43')]['length']?_0x5ebb4f[_0xb087('0x43')]:_0x17f0af[_0xb087('0x3e')];_0x5ebb4f[_0xb087('0x47')]=qs[_0xb087('0x48')](_0x48e2c6[_0xb087('0x40')][_0xb087('0x48')]);_0x5ebb4f[_0xb087('0x4c')]=qs[_0xb087('0x41')](_[_0xb087('0x7d')](_0x48e2c6[_0xb087('0x40')],_0x17f0af[_0xb087('0x41')]));if(_0x48e2c6[_0xb087('0x40')][_0xb087('0x49')]){_0x5ebb4f[_0xb087('0x4c')]=_[_0xb087('0x4a')](_0x5ebb4f[_0xb087('0x4c')],{'$or':_[_0xb087('0x38')](_0x5ebb4f[_0xb087('0x43')],function(_0x4e42eb){var _0x15e2f9={};_0x15e2f9[_0x4e42eb]={'$like':'%'+_0x48e2c6['query'][_0xb087('0x49')]+'%'};return _0x15e2f9;})});}_0x5ebb4f=_[_0xb087('0x4a')]({},_0x5ebb4f,_0x48e2c6[_0xb087('0x4f')]);return _0x3296c9[_0xb087('0x80')](_0x5ebb4f);}})[_0xb087('0x2f')](function(_0x2e4d22){if(_0x2e4d22){_0x10e4b6=_0x2e4d22[_0xb087('0x45')];if(!_0x48e2c6['query']['hasOwnProperty']('nolimit')){_0x5ebb4f[_0xb087('0x27')]=qs[_0xb087('0x27')](_0x48e2c6[_0xb087('0x40')][_0xb087('0x27')]);_0x5ebb4f[_0xb087('0x24')]=qs[_0xb087('0x24')](_0x48e2c6[_0xb087('0x40')][_0xb087('0x24')]);}return _0x3296c9[_0xb087('0x80')](_0x5ebb4f);}})['then'](function(_0x2de517){if(_0x2de517){return _0x2de517?{'count':_0x10e4b6,'rows':_0x2de517}:null;}})['then'](respondWithResult(_0x489b1f,null))[_0xb087('0x4e')](handleError(_0x489b1f,null));};exports[_0xb087('0x82')]=function(_0x597d80,_0x4c3aef,_0x2f2597){var _0x2ae274=_0x597d80[_0xb087('0x6f')][_0xb087('0x75')];var _0x5069f2;return db[_0xb087('0x81')][_0xb087('0x83')]({'where':{'id':_0x2ae274},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xb087('0x36'),'online','voicePause',_0xb087('0x84')],'raw':!![]}]})['then'](function(_0x4059ac){if(_0x4059ac){_0x5069f2=_0x4059ac;var _0x12976c=_[_0xb087('0x85')](_0x4059ac,function(_0x1e48cc){var _0x2de831=_0x1e48cc[_0xb087('0x30')]({'plain':!![]});return _0x2de831[_0xb087('0x86')];});return db[_0xb087('0x39')]['find']({'where':{'id':_0x597d80[_0xb087('0x73')]['id']}})['then'](function(_0x5acf13){return db[_0xb087('0x53')][_0xb087('0x54')](function(_0x1fdb0f){return _0x5acf13['addTeams'](_0x2ae274,{'transaction':_0x1fdb0f})[_0xb087('0x2f')](function(){return BPromise[_0xb087('0x87')](_0x5069f2,function(_0x313d4b){return db[_0xb087('0x88')]['upsert']({'TeamId':_0x313d4b['id'],'VoicePrefixId':_0x597d80[_0xb087('0x73')]['id']},{'transaction':_0x1fdb0f});});})[_0xb087('0x2f')](function(){return BPromise[_0xb087('0x87')](_0x12976c,function(_0x46f5e6){return db[_0xb087('0x89')][_0xb087('0x8a')]({'where':{'UserId':_0x46f5e6['id'],'VoicePrefixId':_0x597d80[_0xb087('0x73')]['id']},'transaction':_0x1fdb0f});});})['then'](function(){_0x12976c[_0xb087('0x8b')](function(_0xfc3490){socket[_0xb087('0x79')](_0xb087('0x8c'),{'UserId':_0xfc3490['id'],'VoicePrefixId':_0x5acf13['id']});});});});});}})[_0xb087('0x2f')](respondWithStatusCode(_0x4c3aef,null))[_0xb087('0x4e')](handleError(_0x4c3aef,null));};exports['removeTeams']=function(_0x44c8cb,_0x15bbda,_0x149020){return db['Team']['findAll']({'where':{'id':_0x44c8cb[_0xb087('0x40')][_0xb087('0x75')]},'attributes':['id'],'include':[{'model':db[_0xb087('0x7c')],'as':_0xb087('0x86'),'attributes':['id'],'raw':!![]}]})[_0xb087('0x2f')](handleEntityNotFound(_0x15bbda,null))[_0xb087('0x2f')](function(_0x42528a){var _0x2795e9=_[_0xb087('0x38')](_0x42528a,'id');var _0xa58050=[];var _0x5ef263=[];var _0x1a7486=squel[_0xb087('0x8d')]();_0x1a7486[_0xb087('0x8e')](_0xb087('0x8f'))[_0xb087('0x90')]('team_has_voice_prefixes','tq')[_0xb087('0x91')](_0xb087('0x92'),'ut',_0xb087('0x93'))[_0xb087('0x4c')]('VoicePrefixId\x20=\x20?',_0x44c8cb[_0xb087('0x73')]['id']);for(var _0x547968=0x0;_0x547968<_0x42528a[_0xb087('0x45')];_0x547968+=0x1){let _0x532682=_0x42528a[_0x547968];for(var _0x5f4312=0x0;_0x5f4312<_0x532682[_0xb087('0x86')][_0xb087('0x45')];_0x5f4312+=0x1){let _0x1cb959=_0x532682['Agents'][_0x5f4312];var _0x595faa=_0x1a7486[_0xb087('0x94')]();_0x595faa[_0xb087('0x4c')](_0xb087('0x95'),_0x1cb959['id']);_0x5ef263[_0xb087('0x6b')](db[_0xb087('0x53')]['query'](_0x595faa[_0xb087('0x96')](),{'type':db[_0xb087('0x53')][_0xb087('0x97')][_0xb087('0x98')]})[_0xb087('0x2f')](function(_0x14737){if(_0x14737['length']===0x1){return _0x1cb959['id'];}else{var _0x5777d0=_[_0xb087('0x99')](_[_0xb087('0x38')](_0x14737,'TeamId'),function(_0x1f28dd){return _['includes'](_0x2795e9,_0x1f28dd);});if(_0x5777d0){return _0x1cb959['id'];}}}));}}return BPromise['all'](_0x5ef263)[_0xb087('0x2f')](function(_0x3193c8){_0xa58050=_(_0xa58050)[_0xb087('0x9a')](_0x3193c8)[_0xb087('0x9b')]()[_0xb087('0x9c')]();return db[_0xb087('0x39')][_0xb087('0x50')]({'where':{'id':_0x44c8cb[_0xb087('0x73')]['id']}})[_0xb087('0x2f')](function(_0xff9c0c){return db['sequelize']['transaction'](function(_0x5e704a){return _0xff9c0c[_0xb087('0x9d')](_0x44c8cb['query'][_0xb087('0x75')],{'transaction':_0x5e704a})['then'](function(){if(!_['isEmpty'](_0xa58050)){return _0xff9c0c[_0xb087('0x77')](_0xa58050,{'transaction':_0x5e704a});}})[_0xb087('0x2f')](function(){_0xa58050[_0xb087('0x8b')](function(_0x170d9e){socket[_0xb087('0x79')](_0xb087('0x7a'),{'UserId':_0x170d9e,'VoicePrefixId':_0xff9c0c['id']});});});});});});})[_0xb087('0x2f')](respondWithStatusCode(_0x15bbda,null))[_0xb087('0x4e')](handleError(_0x15bbda,null));};
\ No newline at end of file
index b5e736b..07bb58c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2663=['VoicePrefix','setMaxListeners','update','remove','emit','exports','../../mysqldb'];(function(_0x161ab7,_0x5d1568){var _0x4c7294=function(_0x3e94b9){while(--_0x3e94b9){_0x161ab7['push'](_0x161ab7['shift']());}};_0x4c7294(++_0x5d1568);}(_0x2663,0x141));var _0x3266=function(_0x382bdd,_0x4e0534){_0x382bdd=_0x382bdd-0x0;var _0x1f29d8=_0x2663[_0x382bdd];return _0x1f29d8;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x3266('0x0'))['db'][_0x3266('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x3266('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3266('0x3'),'afterDestroy':_0x3266('0x4')};function emitEvent(_0x177c02){return function(_0xe6d2d6,_0x112d7e,_0x282aed){VoicePrefixEvents[_0x3266('0x5')](_0x177c02+':'+_0xe6d2d6['id'],_0xe6d2d6);VoicePrefixEvents['emit'](_0x177c02,_0xe6d2d6);_0x282aed(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x3266('0x6')]=VoicePrefixEvents;
\ No newline at end of file
+var _0x4aa0=['../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2842c6,_0x407235){var _0x406000=function(_0x101ac9){while(--_0x101ac9){_0x2842c6['push'](_0x2842c6['shift']());}};_0x406000(++_0x407235);}(_0x4aa0,0x1c2));var _0x04aa=function(_0xf188ce,_0x142e1e){_0xf188ce=_0xf188ce-0x0;var _0x550f88=_0x4aa0[_0xf188ce];return _0x550f88;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x04aa('0x0'))['db'][_0x04aa('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x04aa('0x2')](0x0);var events={'afterCreate':_0x04aa('0x3'),'afterUpdate':_0x04aa('0x4'),'afterDestroy':_0x04aa('0x5')};function emitEvent(_0x48707f){return function(_0xcf71e7,_0x29875d,_0x376ab){VoicePrefixEvents[_0x04aa('0x6')](_0x48707f+':'+_0xcf71e7['id'],_0xcf71e7);VoicePrefixEvents[_0x04aa('0x6')](_0x48707f,_0xcf71e7);_0x376ab(null);};}for(var e in events){if(events[_0x04aa('0x7')](e)){var event=events[e];VoicePrefix[_0x04aa('0x8')](e,emitEvent(event));}}module[_0x04aa('0x9')]=VoicePrefixEvents;
\ No newline at end of file
index 03d0983..5c4b4ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x266a=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','define','VoicePrefix','voice_prefixes','lodash'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x266a,0x103));var _0xa266=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x266a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa266('0x0'));var util=require(_0xa266('0x1'));var logger=require('../../config/logger')(_0xa266('0x2'));var moment=require(_0xa266('0x3'));var BPromise=require(_0xa266('0x4'));var rp=require(_0xa266('0x5'));var fs=require('fs');var path=require(_0xa266('0x6'));var rimraf=require(_0xa266('0x7'));var config=require(_0xa266('0x8'));var attributes=require(_0xa266('0x9'));module['exports']=function(_0x41ae2f,_0x485154){return _0x41ae2f[_0xa266('0xa')](_0xa266('0xb'),attributes,{'tableName':_0xa266('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1940=['request-promise','path','rimraf','./voicePrefix.attributes','define','voice_prefixes','lodash','util','../../config/logger'];(function(_0x47b5c3,_0x51619d){var _0x51c28d=function(_0x4329de){while(--_0x4329de){_0x47b5c3['push'](_0x47b5c3['shift']());}};_0x51c28d(++_0x51619d);}(_0x1940,0x10b));var _0x0194=function(_0x4ec520,_0x15fee2){_0x4ec520=_0x4ec520-0x0;var _0xed49d7=_0x1940[_0x4ec520];return _0xed49d7;};'use strict';var _=require(_0x0194('0x0'));var util=require(_0x0194('0x1'));var logger=require(_0x0194('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0194('0x3'));var fs=require('fs');var path=require(_0x0194('0x4'));var rimraf=require(_0x0194('0x5'));var config=require('../../config/environment');var attributes=require(_0x0194('0x6'));module['exports']=function(_0x4cef56,_0x22475d){return _0x4cef56[_0x0194('0x7')]('VoicePrefix',attributes,{'tableName':_0x0194('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8ec5306..6f03266 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf0f4=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./voicePrefix.socket','register','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','randomstring','ioredis','../../config/utils'];(function(_0x13f05f,_0x1c4b2f){var _0x585afd=function(_0x119d6d){while(--_0x119d6d){_0x13f05f['push'](_0x13f05f['shift']());}};_0x585afd(++_0x1c4b2f);}(_0xf0f4,0x182));var _0x4f0f=function(_0x410d40,_0x564f4b){_0x410d40=_0x410d40-0x0;var _0x4895d7=_0xf0f4[_0x410d40];return _0x4895d7;};'use strict';var _=require('lodash');var util=require(_0x4f0f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4f0f('0x1'));var fs=require('fs');var Redis=require(_0x4f0f('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x4f0f('0x3'));var logger=require(_0x4f0f('0x4'))(_0x4f0f('0x5'));var config=require(_0x4f0f('0x6'));var jayson=require(_0x4f0f('0x7'));var client=jayson[_0x4f0f('0x8')][_0x4f0f('0x9')]({'port':0x232a});config['redis']=_[_0x4f0f('0xa')](config[_0x4f0f('0xb')],{'host':_0x4f0f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4f0f('0xb')]));require(_0x4f0f('0xd'))[_0x4f0f('0xe')](socket);function respondWithRpcPromise(_0x3754fc,_0x343c30,_0xb41508){return new BPromise(function(_0x9533a3,_0x2b2e49){return client['request'](_0x3754fc,_0xb41508)[_0x4f0f('0xf')](function(_0x315d01){logger[_0x4f0f('0x10')](_0x4f0f('0x11'),_0x343c30,_0x4f0f('0x12'));logger[_0x4f0f('0x13')](_0x4f0f('0x14'),_0x343c30,_0x4f0f('0x12'),JSON[_0x4f0f('0x15')](_0x315d01));if(_0x315d01[_0x4f0f('0x16')]){if(_0x315d01[_0x4f0f('0x16')]['code']===0x1f4){logger[_0x4f0f('0x16')](_0x4f0f('0x11'),_0x343c30,_0x315d01[_0x4f0f('0x16')][_0x4f0f('0x17')]);return _0x2b2e49(_0x315d01['error'][_0x4f0f('0x17')]);}logger[_0x4f0f('0x16')](_0x4f0f('0x11'),_0x343c30,_0x315d01[_0x4f0f('0x16')][_0x4f0f('0x17')]);return _0x9533a3(_0x315d01['error'][_0x4f0f('0x17')]);}else{logger[_0x4f0f('0x10')](_0x4f0f('0x11'),_0x343c30,'request\x20sent');_0x9533a3(_0x315d01[_0x4f0f('0x18')][_0x4f0f('0x17')]);}})[_0x4f0f('0x19')](function(_0x5f5363){logger[_0x4f0f('0x16')](_0x4f0f('0x11'),_0x343c30,_0x5f5363);_0x2b2e49(_0x5f5363);});});}
\ No newline at end of file
+var _0xf470=['register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket'];(function(_0x42b428,_0x4346d9){var _0x3128df=function(_0x4fa6b4){while(--_0x4fa6b4){_0x42b428['push'](_0x42b428['shift']());}};_0x3128df(++_0x4346d9);}(_0xf470,0xfd));var _0x0f47=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0xf470[_0x101e7b];return _0x4995c0;};'use strict';var _=require(_0x0f47('0x0'));var util=require(_0x0f47('0x1'));var moment=require(_0x0f47('0x2'));var BPromise=require(_0x0f47('0x3'));var rs=require(_0x0f47('0x4'));var fs=require('fs');var Redis=require(_0x0f47('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0f47('0x6'));var logger=require(_0x0f47('0x7'))('rpc');var config=require(_0x0f47('0x8'));var jayson=require(_0x0f47('0x9'));var client=jayson[_0x0f47('0xa')][_0x0f47('0xb')]({'port':0x232a});config[_0x0f47('0xc')]=_[_0x0f47('0xd')](config[_0x0f47('0xc')],{'host':_0x0f47('0xe'),'port':0x18eb});var socket=require(_0x0f47('0xf'))(new Redis(config[_0x0f47('0xc')]));require(_0x0f47('0x10'))[_0x0f47('0x11')](socket);function respondWithRpcPromise(_0x6900a,_0x2256e5,_0x440449){return new BPromise(function(_0x2196d2,_0x3a78c8){return client[_0x0f47('0x12')](_0x6900a,_0x440449)[_0x0f47('0x13')](function(_0x4bfa8f){logger[_0x0f47('0x14')](_0x0f47('0x15'),_0x2256e5,_0x0f47('0x16'));logger[_0x0f47('0x17')](_0x0f47('0x18'),_0x2256e5,'request\x20sent',JSON['stringify'](_0x4bfa8f));if(_0x4bfa8f[_0x0f47('0x19')]){if(_0x4bfa8f[_0x0f47('0x19')][_0x0f47('0x1a')]===0x1f4){logger[_0x0f47('0x19')](_0x0f47('0x15'),_0x2256e5,_0x4bfa8f['error'][_0x0f47('0x1b')]);return _0x3a78c8(_0x4bfa8f['error']['message']);}logger[_0x0f47('0x19')](_0x0f47('0x15'),_0x2256e5,_0x4bfa8f[_0x0f47('0x19')][_0x0f47('0x1b')]);return _0x2196d2(_0x4bfa8f[_0x0f47('0x19')][_0x0f47('0x1b')]);}else{logger[_0x0f47('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x2256e5,_0x0f47('0x16'));_0x2196d2(_0x4bfa8f[_0x0f47('0x1c')]['message']);}})[_0x0f47('0x1d')](function(_0x2e2f35){logger[_0x0f47('0x19')](_0x0f47('0x15'),_0x2256e5,_0x2e2f35);_0x3a78c8(_0x2e2f35);});});}
\ No newline at end of file
index 0752888..eda7f6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f73=['register','length','./voicePrefix.events','save','remove','emit'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x0f73,0x146));var _0x30f7=function(_0x3fd6cb,_0x573459){_0x3fd6cb=_0x3fd6cb-0x0;var _0x4cc4e9=_0x0f73[_0x3fd6cb];return _0x4cc4e9;};'use strict';var VoicePrefixEvents=require(_0x30f7('0x0'));var events=[_0x30f7('0x1'),_0x30f7('0x2'),'update'];function createListener(_0x4c2a71,_0x3dd283){return function(_0x3f09ff){_0x3dd283[_0x30f7('0x3')](_0x4c2a71,_0x3f09ff);};}function removeListener(_0x2cb0f6,_0x2be91f){return function(){VoicePrefixEvents['removeListener'](_0x2cb0f6,_0x2be91f);};}exports[_0x30f7('0x4')]=function(_0x593fe7){for(var _0x49b5b8=0x0,_0x38ad1d=events[_0x30f7('0x5')];_0x49b5b8<_0x38ad1d;_0x49b5b8++){var _0x2de5e7=events[_0x49b5b8];var _0x7e377e=createListener('voicePrefix:'+_0x2de5e7,_0x593fe7);VoicePrefixEvents['on'](_0x2de5e7,_0x7e377e);}};
\ No newline at end of file
+var _0x949d=['./voicePrefix.events','save','remove','update','emit','removeListener'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x949d,0x162));var _0xd949=function(_0x1716dc,_0x2d61ab){_0x1716dc=_0x1716dc-0x0;var _0x1694cb=_0x949d[_0x1716dc];return _0x1694cb;};'use strict';var VoicePrefixEvents=require(_0xd949('0x0'));var events=[_0xd949('0x1'),_0xd949('0x2'),_0xd949('0x3')];function createListener(_0x59c4ae,_0x5c5854){return function(_0x2024d0){_0x5c5854[_0xd949('0x4')](_0x59c4ae,_0x2024d0);};}function removeListener(_0x596628,_0x2768a3){return function(){VoicePrefixEvents[_0xd949('0x5')](_0x596628,_0x2768a3);};}exports['register']=function(_0x3d2be5){for(var _0x416d5e=0x0,_0x6e8175=events['length'];_0x416d5e<_0x6e8175;_0x416d5e++){var _0x208942=events[_0x416d5e];var _0x158cc2=createListener('voicePrefix:'+_0x208942,_0x3d2be5);VoicePrefixEvents['on'](_0x208942,_0x158cc2);}};
\ No newline at end of file
index 06b6cef..53fb950 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c29=['/:id/users','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','create','post','/:id/clone','addAgents','addLists','addBlackLists','put','destroy','delete','removeBlackLists','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','show','/:id/hoppers','isAuthenticated','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams'];(function(_0x5dbdbc,_0x35fee0){var _0x258f29=function(_0x265af9){while(--_0x265af9){_0x5dbdbc['push'](_0x5dbdbc['shift']());}};_0x258f29(++_0x35fee0);}(_0x0c29,0xd3));var _0x90c2=function(_0x196e1b,_0x55fa06){_0x196e1b=_0x196e1b-0x0;var _0x5e1f18=_0x0c29[_0x196e1b];return _0x5e1f18;};'use strict';var multer=require(_0x90c2('0x0'));var util=require(_0x90c2('0x1'));var path=require(_0x90c2('0x2'));var timeout=require(_0x90c2('0x3'));var express=require(_0x90c2('0x4'));var router=express['Router']();var fs_extra=require(_0x90c2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x90c2('0x6'));var config=require(_0x90c2('0x7'));var controller=require(_0x90c2('0x8'));router[_0x90c2('0x9')]('/',auth['isAuthenticated'](),controller[_0x90c2('0xa')]);router[_0x90c2('0x9')](_0x90c2('0xb'),auth['isAuthenticated'](),controller[_0x90c2('0xc')]);router[_0x90c2('0x9')](_0x90c2('0xd'),auth[_0x90c2('0xe')](),controller[_0x90c2('0xf')]);router[_0x90c2('0x9')]('/:id/hopper_histories',auth[_0x90c2('0xe')](),controller[_0x90c2('0x10')]);router['get'](_0x90c2('0x11'),auth['isAuthenticated'](),controller[_0x90c2('0x12')]);router[_0x90c2('0x9')](_0x90c2('0x13'),auth[_0x90c2('0xe')](),controller[_0x90c2('0x14')]);router[_0x90c2('0x9')](_0x90c2('0x15'),auth[_0x90c2('0xe')](),controller[_0x90c2('0x16')]);router['get'](_0x90c2('0x17'),auth[_0x90c2('0xe')](),controller['getAgents']);router[_0x90c2('0x9')](_0x90c2('0x18'),auth['isAuthenticated'](),controller[_0x90c2('0x19')]);router[_0x90c2('0x9')](_0x90c2('0x1a'),auth[_0x90c2('0xe')](),controller['getLists']);router['get'](_0x90c2('0x1b'),auth['isAuthenticated'](),controller[_0x90c2('0x1c')]);router['post']('/',auth[_0x90c2('0xe')](),controller[_0x90c2('0x1d')]);router[_0x90c2('0x1e')](_0x90c2('0x1f'),auth['isAuthenticated'](),controller['clone']);router['post'](_0x90c2('0x15'),auth[_0x90c2('0xe')](),controller['addTeams']);router[_0x90c2('0x1e')](_0x90c2('0x17'),auth[_0x90c2('0xe')](),controller[_0x90c2('0x20')]);router[_0x90c2('0x1e')](_0x90c2('0x1a'),auth[_0x90c2('0xe')](),controller[_0x90c2('0x21')]);router[_0x90c2('0x1e')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x90c2('0x22')]);router[_0x90c2('0x23')](_0x90c2('0xb'),auth[_0x90c2('0xe')](),controller['update']);router['delete'](_0x90c2('0xb'),auth[_0x90c2('0xe')](),controller[_0x90c2('0x24')]);router[_0x90c2('0x25')](_0x90c2('0x15'),auth[_0x90c2('0xe')](),controller['removeTeams']);router[_0x90c2('0x25')](_0x90c2('0x17'),auth['isAuthenticated'](),controller['removeAgents']);router[_0x90c2('0x25')]('/:id/lists',auth[_0x90c2('0xe')](),controller['removeLists']);router[_0x90c2('0x25')](_0x90c2('0x1b'),auth[_0x90c2('0xe')](),controller[_0x90c2('0x26')]);module['exports']=router;
\ No newline at end of file
+var _0xd301=['exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','getAgents','/:id/lists','/:id/blacklists','post','create','/:id/users','addAgents','addBlackLists','put','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists'];(function(_0x19d24e,_0x48638d){var _0x28c4f2=function(_0x48972d){while(--_0x48972d){_0x19d24e['push'](_0x19d24e['shift']());}};_0x28c4f2(++_0x48638d);}(_0xd301,0x104));var _0x1d30=function(_0x120bc0,_0x40e780){_0x120bc0=_0x120bc0-0x0;var _0x49d52a=_0xd301[_0x120bc0];return _0x49d52a;};'use strict';var multer=require(_0x1d30('0x0'));var util=require('util');var path=require(_0x1d30('0x1'));var timeout=require(_0x1d30('0x2'));var express=require('express');var router=express[_0x1d30('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1d30('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1d30('0x5'));var controller=require(_0x1d30('0x6'));router[_0x1d30('0x7')]('/',auth[_0x1d30('0x8')](),controller[_0x1d30('0x9')]);router['get'](_0x1d30('0xa'),auth[_0x1d30('0x8')](),controller[_0x1d30('0xb')]);router[_0x1d30('0x7')](_0x1d30('0xc'),auth['isAuthenticated'](),controller[_0x1d30('0xd')]);router[_0x1d30('0x7')](_0x1d30('0xe'),auth[_0x1d30('0x8')](),controller[_0x1d30('0xf')]);router[_0x1d30('0x7')](_0x1d30('0x10'),auth[_0x1d30('0x8')](),controller['getHopperFinals']);router['get'](_0x1d30('0x11'),auth[_0x1d30('0x8')](),controller[_0x1d30('0x12')]);router[_0x1d30('0x7')](_0x1d30('0x13'),auth[_0x1d30('0x8')](),controller[_0x1d30('0x14')]);router['get']('/:id/users',auth[_0x1d30('0x8')](),controller[_0x1d30('0x15')]);router[_0x1d30('0x7')]('/:id/members',auth[_0x1d30('0x8')](),controller['getMembers']);router[_0x1d30('0x7')](_0x1d30('0x16'),auth['isAuthenticated'](),controller['getLists']);router[_0x1d30('0x7')](_0x1d30('0x17'),auth[_0x1d30('0x8')](),controller['getBlackLists']);router[_0x1d30('0x18')]('/',auth[_0x1d30('0x8')](),controller[_0x1d30('0x19')]);router[_0x1d30('0x18')]('/:id/clone',auth[_0x1d30('0x8')](),controller['clone']);router[_0x1d30('0x18')](_0x1d30('0x13'),auth[_0x1d30('0x8')](),controller['addTeams']);router[_0x1d30('0x18')](_0x1d30('0x1a'),auth[_0x1d30('0x8')](),controller[_0x1d30('0x1b')]);router[_0x1d30('0x18')](_0x1d30('0x16'),auth[_0x1d30('0x8')](),controller['addLists']);router[_0x1d30('0x18')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x1d30('0x1c')]);router[_0x1d30('0x1d')]('/:id',auth[_0x1d30('0x8')](),controller[_0x1d30('0x1e')]);router[_0x1d30('0x1f')](_0x1d30('0xa'),auth[_0x1d30('0x8')](),controller['destroy']);router['delete'](_0x1d30('0x13'),auth[_0x1d30('0x8')](),controller[_0x1d30('0x20')]);router[_0x1d30('0x1f')](_0x1d30('0x1a'),auth[_0x1d30('0x8')](),controller[_0x1d30('0x21')]);router[_0x1d30('0x1f')](_0x1d30('0x16'),auth['isAuthenticated'](),controller[_0x1d30('0x22')]);router[_0x1d30('0x1f')](_0x1d30('0x17'),auth[_0x1d30('0x8')](),controller[_0x1d30('0x23')]);module[_0x1d30('0x24')]=router;
\ No newline at end of file
index ce131eb..403f56a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa992=['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)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#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\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','sequelize','ENUM','inbound','default','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','ringall','setDataValue','strategy','getDataValue','type','dialMethod','booked','predictive','power','INTEGER','STRING','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','dropRate','Only\x20for\x20predictive\x20method.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'];(function(_0x408f95,_0x2735d0){var _0x2a52be=function(_0x1894c0){while(--_0x1894c0){_0x408f95['push'](_0x408f95['shift']());}};_0x2a52be(++_0x2735d0);}(_0xa992,0xc4));var _0x2a99=function(_0xcbc780,_0x424cf7){_0xcbc780=_0xcbc780-0x0;var _0x521cde=_0xa992[_0xcbc780];return _0x521cde;};'use strict';var Sequelize=require(_0x2a99('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x2a99('0x1')](_0x2a99('0x2'),'outbound'),'allowNull':![],'defaultValue':_0x2a99('0x2')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x2a99('0x3')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x2a99('0x1')]('rr','ringall',_0x2a99('0x4'),_0x2a99('0x5'),_0x2a99('0x6'),_0x2a99('0x7'),_0x2a99('0x8'),_0x2a99('0x9'),_0x2a99('0xa')),'allowNull':![],'defaultValue':_0x2a99('0xb'),'set':function(_0x9b413c){this[_0x2a99('0xc')](_0x2a99('0xd'),_0x9b413c?_0x9b413c:_0x2a99('0x7'));},'get':function(){var _0x4f53b0=this[_0x2a99('0xe')](_0x2a99('0xf'));var _0x3b9994=this[_0x2a99('0xe')](_0x2a99('0x10'));var _0x10efab=this[_0x2a99('0xe')]('strategy');if(_0x4f53b0===_0x2a99('0x2')){return _0x10efab;}if(_0x3b9994===_0x2a99('0x11')&&_0x10efab===_0x2a99('0x7')||_0x3b9994===_0x2a99('0x11')&&_0x10efab==='roundrobin'){return _0x10efab;}if(_0x3b9994==='progressive'||_0x3b9994===_0x2a99('0x12')||_0x3b9994===_0x2a99('0x13')){return _0x10efab;}return null;}},'servicelevel':{'type':Sequelize[_0x2a99('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x2a99('0x15')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x2a99('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x2a99('0x15')]},'weight':{'type':Sequelize[_0x2a99('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x2a99('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x2a99('0x1')](_0x2a99('0x16'),'no'),'defaultValue':_0x2a99('0x16')},'autopause':{'type':Sequelize[_0x2a99('0x1')](_0x2a99('0x16'),'no',_0x2a99('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x2a99('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0x2a99('0x1')](_0x2a99('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x2a99('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x2a99('0x1')](_0x2a99('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x2a99('0x1')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x2a99('0x1')](_0x2a99('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x2a99('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x2a99('0x15')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x2a99('0x15')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x2a99('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x2a99('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x2a99('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x2a99('0x1')](_0x2a99('0x16'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x2a99('0x1')](_0x2a99('0x16'),'no',_0x2a99('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x2a99('0x15')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x2a99('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x2a99('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x2a99('0x1')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x2a99('0x15')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x2a99('0x15')]},'queue_youarenext':{'type':Sequelize[_0x2a99('0x15')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x2a99('0x15')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x2a99('0x15')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x2a99('0x15')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x2a99('0x15')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x2a99('0x15')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x2a99('0x15')]},'queue_quantity1':{'type':Sequelize[_0x2a99('0x15')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x2a99('0x19')],'set':function(_0x307c53){this[_0x2a99('0xc')](_0x2a99('0x1a'),_0x307c53?_0x307c53[_0x2a99('0x1b')](','):[]);},'get':function(){return this[_0x2a99('0xe')](_0x2a99('0x1a'))?this[_0x2a99('0xe')](_0x2a99('0x1a'))[_0x2a99('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x2a99('0x15')],'defaultValue':_0x2a99('0x16'),'set':function(_0x2c4763){this[_0x2a99('0xc')](_0x2a99('0x1d'),_0x2c4763?_0x2c4763[_0x2a99('0x1b')](','):undefined);},'get':function(){return this['getDataValue'](_0x2a99('0x1d'))?this[_0x2a99('0xe')]('joinempty')[_0x2a99('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x2a99('0x15')],'defaultValue':'no','set':function(_0x4f5bcd){this[_0x2a99('0xc')](_0x2a99('0x1e'),_0x4f5bcd?_0x4f5bcd[_0x2a99('0x1b')](','):undefined);},'get':function(){return this['getDataValue']('leavewhenempty')?this[_0x2a99('0xe')](_0x2a99('0x1e'))[_0x2a99('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x2a99('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x2a99('0x1')](_0x2a99('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x2a99('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x2a99('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x2a99('0x15')]},'description':{'type':Sequelize[_0x2a99('0x15')]},'acw':{'type':Sequelize[_0x2a99('0x1f')],'defaultValue':0x0,'set':function(_0x52d67c){this[_0x2a99('0xc')](_0x2a99('0x20'),_0x52d67c);if(_0x52d67c){if(this[_0x2a99('0xe')](_0x2a99('0x21'))<0x2){this['setDataValue'](_0x2a99('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x2a99('0x1f')],'defaultValue':0x0,'comment':_0x2a99('0x22')},'dialMethod':{'type':Sequelize[_0x2a99('0x1')]('preview',_0x2a99('0x23'),_0x2a99('0x13'),_0x2a99('0x12'),_0x2a99('0x11')),'defaultValue':_0x2a99('0x23'),'comment':_0x2a99('0x24')},'dialLimitChannel':{'type':Sequelize[_0x2a99('0x14')](0x4)[_0x2a99('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x2a99('0x26')},'dialLimitQueue':{'type':Sequelize[_0x2a99('0x14')](0x4)[_0x2a99('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x2a99('0x27')},'dialPowerLevel':{'type':Sequelize[_0x2a99('0x28')](0x2)[_0x2a99('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM']('agentBusyFactor',_0x2a99('0x29')),'defaultValue':'dropRate','comment':_0x2a99('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x2a99('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x2a99('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0x2a99('0x15')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x2a99('0x15')]},'dialOriginateTimeout':{'type':Sequelize[_0x2a99('0x14')](0x3)[_0x2a99('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2a99('0x2c')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':'tTxX','comment':_0x2a99('0x2d')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x2a99('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x2a99('0x15')],'comment':_0x2a99('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2a99('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2a99('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x2a99('0x14')](0x5)[_0x2a99('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x2a99('0x14')](0x3)[_0x2a99('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2a99('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2a99('0x30')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2a99('0x25')],'defaultValue':0x3,'comment':_0x2a99('0x31')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2a99('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x2a99('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x2a99('0x32')},'dialTimezone':{'type':Sequelize[_0x2a99('0x15')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x2a99('0x33')},'dialPrefix':{'type':Sequelize[_0x2a99('0x15')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x2a99('0x1')](_0x2a99('0x34'),_0x2a99('0x35'),_0x2a99('0x36')),'defaultValue':_0x2a99('0x34')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x2a99('0x37')},'dialAMDInitialSilence':{'type':Sequelize[_0x2a99('0x14')](0x9)[_0x2a99('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x2a99('0x38')},'dialAMDGreeting':{'type':Sequelize[_0x2a99('0x14')](0x9)[_0x2a99('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x2a99('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x2a99('0x14')](0x9)[_0x2a99('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x2a99('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x2a99('0x14')](0x9)[_0x2a99('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2a99('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x2a99('0x14')](0x9)[_0x2a99('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x2a99('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x2a99('0x14')](0x9)[_0x2a99('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x2a99('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x2a99('0x14')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x2a99('0x3e')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x2a99('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x2a99('0x3f')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x2a99('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2a99('0x40')},'dialRecallMeTimeout':{'type':Sequelize[_0x2a99('0x14')](0x5)[_0x2a99('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x2a99('0x41')},'dialRecallInQueue':{'type':Sequelize[_0x2a99('0x1f')],'defaultValue':0x0,'comment':_0x2a99('0x42')},'dialOrderByScheduledAt':{'type':Sequelize[_0x2a99('0x1')](_0x2a99('0x43'),_0x2a99('0x44')),'defaultValue':_0x2a99('0x43')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x2a99('0x2e')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x2a99('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x2a99('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2a99('0x45')},'dialCutDigit':{'type':Sequelize[_0x2a99('0x14')](0x3)[_0x2a99('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2a99('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x2a99('0x14')](0x3)[_0x2a99('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x2a99('0x14')](0x5)[_0x2a99('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x2a99('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2a99('0x47')},'dialDropRetryFrequency':{'type':Sequelize[_0x2a99('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2a99('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x2a99('0x14')](0x3)[_0x2a99('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2a99('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x2a99('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2a99('0x4a')},'dialMachineMaxRetry':{'type':Sequelize[_0x2a99('0x14')](0x3)[_0x2a99('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2a99('0x4b')},'dialMachineRetryFrequency':{'type':Sequelize[_0x2a99('0x14')](0x5)[_0x2a99('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2a99('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2a99('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2a99('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2a99('0x14')],'allowNull':!![],'comment':_0x2a99('0x4e')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x2a99('0x4f'),'set':function(_0x5a2cb4){if(!_0x5a2cb4)this[_0x2a99('0xc')]('mandatoryDispositionPauseId',null);this[_0x2a99('0xc')]('mandatoryDisposition',_0x5a2cb4);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x2a99('0x14')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x2a99('0x14')](0x3)[_0x2a99('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}};
\ No newline at end of file
+var _0xa1a5=['Active/Disactive\x20Campaign','preview','power','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','Active/Disactive\x20AMD','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','getDataValue','type','dialMethod','booked','progressive','predictive','INTEGER','yes','all','TEXT','join','periodic_announce','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime'];(function(_0x41b44b,_0x708978){var _0x39b73e=function(_0x130485){while(--_0x130485){_0x41b44b['push'](_0x41b44b['shift']());}};_0x39b73e(++_0x708978);}(_0xa1a5,0x1b8));var _0x5a1a=function(_0x4073be,_0x373d69){_0x4073be=_0x4073be-0x0;var _0x538318=_0xa1a5[_0x4073be];return _0x538318;};'use strict';var Sequelize=require(_0x5a1a('0x0'));module['exports']={'name':{'type':Sequelize[_0x5a1a('0x1')],'allowNull':![],'unique':_0x5a1a('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x5a1a('0x3')](_0x5a1a('0x4'),_0x5a1a('0x5')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x5a1a('0x1')],'defaultValue':_0x5a1a('0x6')},'announce':{'type':Sequelize[_0x5a1a('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0x5a1a('0x3')]('rr',_0x5a1a('0x7'),_0x5a1a('0x8'),_0x5a1a('0x9'),'random',_0x5a1a('0xa'),_0x5a1a('0xb'),_0x5a1a('0xc'),_0x5a1a('0xd')),'allowNull':![],'defaultValue':_0x5a1a('0x7'),'set':function(_0x1c9374){this[_0x5a1a('0xe')](_0x5a1a('0xf'),_0x1c9374?_0x1c9374:_0x5a1a('0xa'));},'get':function(){var _0x57c5ca=this[_0x5a1a('0x10')](_0x5a1a('0x11'));var _0x1474c2=this['getDataValue'](_0x5a1a('0x12'));var _0x4b6e4c=this['getDataValue']('strategy');if(_0x57c5ca===_0x5a1a('0x4')){return _0x4b6e4c;}if(_0x1474c2===_0x5a1a('0x13')&&_0x4b6e4c===_0x5a1a('0xa')||_0x1474c2===_0x5a1a('0x13')&&_0x4b6e4c==='roundrobin'){return _0x4b6e4c;}if(_0x1474c2===_0x5a1a('0x14')||_0x1474c2===_0x5a1a('0x15')||_0x1474c2==='power'){return _0x4b6e4c;}return null;}},'servicelevel':{'type':Sequelize[_0x5a1a('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x5a1a('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x5a1a('0x16')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x5a1a('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x5a1a('0x1')]},'weight':{'type':Sequelize[_0x5a1a('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x5a1a('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x5a1a('0x3')](_0x5a1a('0x17'),'no'),'defaultValue':_0x5a1a('0x17')},'autopause':{'type':Sequelize[_0x5a1a('0x3')]('yes','no',_0x5a1a('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x5a1a('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x5a1a('0x3')](_0x5a1a('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x5a1a('0x3')](_0x5a1a('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x5a1a('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x5a1a('0x3')](_0x5a1a('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x5a1a('0x3')](_0x5a1a('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x5a1a('0x3')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x5a1a('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x5a1a('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x5a1a('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x5a1a('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x5a1a('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x5a1a('0x3')](_0x5a1a('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x5a1a('0x17'),'no'),'defaultValue':_0x5a1a('0x17')},'announce_holdtime':{'type':Sequelize[_0x5a1a('0x3')](_0x5a1a('0x17'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x5a1a('0x3')](_0x5a1a('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x5a1a('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x5a1a('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x5a1a('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x5a1a('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x5a1a('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x5a1a('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x5a1a('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x5a1a('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x5a1a('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x5a1a('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x5a1a('0x1')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x5a1a('0x1')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x5a1a('0x1')]},'periodic_announce':{'type':Sequelize[_0x5a1a('0x19')],'set':function(_0x1af6d4){this[_0x5a1a('0xe')]('periodic_announce',_0x1af6d4?_0x1af6d4[_0x5a1a('0x1a')](','):[]);},'get':function(){return this[_0x5a1a('0x10')]('periodic_announce')?this['getDataValue'](_0x5a1a('0x1b'))['split'](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x5a1a('0x17'),'set':function(_0x18cfd6){this['setDataValue']('joinempty',_0x18cfd6?_0x18cfd6['join'](','):undefined);},'get':function(){return this[_0x5a1a('0x10')](_0x5a1a('0x1c'))?this['getDataValue']('joinempty')[_0x5a1a('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0xd836a8){this[_0x5a1a('0xe')]('leavewhenempty',_0xd836a8?_0xd836a8[_0x5a1a('0x1a')](','):undefined);},'get':function(){return this['getDataValue']('leavewhenempty')?this[_0x5a1a('0x10')](_0x5a1a('0x1e'))[_0x5a1a('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x5a1a('0x3')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x5a1a('0x3')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x5a1a('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x5a1a('0x3')](_0x5a1a('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x5a1a('0x1')]},'description':{'type':Sequelize[_0x5a1a('0x1')]},'acw':{'type':Sequelize[_0x5a1a('0x1f')],'defaultValue':0x0,'set':function(_0x541e20){this['setDataValue'](_0x5a1a('0x20'),_0x541e20);if(_0x541e20){if(this[_0x5a1a('0x10')](_0x5a1a('0x21'))<0x2){this[_0x5a1a('0xe')](_0x5a1a('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x5a1a('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x5a1a('0x1f')],'defaultValue':0x0,'comment':_0x5a1a('0x22')},'dialMethod':{'type':Sequelize[_0x5a1a('0x3')](_0x5a1a('0x23'),_0x5a1a('0x14'),_0x5a1a('0x24'),_0x5a1a('0x15'),'booked'),'defaultValue':'progressive','comment':_0x5a1a('0x25')},'dialLimitChannel':{'type':Sequelize[_0x5a1a('0x16')](0x4)[_0x5a1a('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x5a1a('0x27')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x5a1a('0x28')},'dialPowerLevel':{'type':Sequelize[_0x5a1a('0x29')](0x2)[_0x5a1a('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x5a1a('0x3')](_0x5a1a('0x2a'),_0x5a1a('0x2b')),'defaultValue':_0x5a1a('0x2b'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x5a1a('0x29')](0x2)[_0x5a1a('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x5a1a('0x2c')},'dialPredictiveInterval':{'type':Sequelize[_0x5a1a('0x16')](0x3)[_0x5a1a('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x5a1a('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x5a1a('0x16')](0x3)[_0x5a1a('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x5a1a('0x1')],'defaultValue':_0x5a1a('0x2d'),'comment':_0x5a1a('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0x5a1a('0x16')](0x3)[_0x5a1a('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5a1a('0x2f')},'dialQueueProject':{'type':Sequelize[_0x5a1a('0x1')],'comment':_0x5a1a('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0x5a1a('0x16')](0x3)[_0x5a1a('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5a1a('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x5a1a('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5a1a('0x32')},'dialBusyMaxRetry':{'type':Sequelize[_0x5a1a('0x16')](0x3)[_0x5a1a('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5a1a('0x33')},'dialBusyRetryFrequency':{'type':Sequelize[_0x5a1a('0x16')](0x5)[_0x5a1a('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5a1a('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5a1a('0x26')],'defaultValue':0x3,'comment':_0x5a1a('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x5a1a('0x16')](0x5)[_0x5a1a('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5a1a('0x36')},'dialGlobalMaxRetry':{'type':Sequelize[_0x5a1a('0x16')](0x3)[_0x5a1a('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5a1a('0x37')},'dialTimezone':{'type':Sequelize[_0x5a1a('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x5a1a('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x5a1a('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x5a1a('0x38'),_0x5a1a('0x39'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x5a1a('0x1f')],'defaultValue':0x0,'comment':_0x5a1a('0x3a')},'dialAMDInitialSilence':{'type':Sequelize[_0x5a1a('0x16')](0x9)[_0x5a1a('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x5a1a('0x16')](0x9)[_0x5a1a('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x5a1a('0x16')](0x9)[_0x5a1a('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x5a1a('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5a1a('0x16')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x5a1a('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5a1a('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5a1a('0x16')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5a1a('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5a1a('0x16')](0x9)[_0x5a1a('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x5a1a('0x16')](0x5)[_0x5a1a('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5a1a('0x16')](0x9)[_0x5a1a('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5a1a('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x5a1a('0x16')](0x5)[_0x5a1a('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x5a1a('0x1f')],'defaultValue':0x0,'comment':_0x5a1a('0x3f')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x5a1a('0x40'),_0x5a1a('0x41')),'defaultValue':_0x5a1a('0x40')},'dialQueueProject2':{'type':Sequelize[_0x5a1a('0x1')],'comment':_0x5a1a('0x30')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x5a1a('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x5a1a('0x16')](0x3)[_0x5a1a('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5a1a('0x42')},'dialCutDigit':{'type':Sequelize[_0x5a1a('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x5a1a('0x16')](0x3)[_0x5a1a('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5a1a('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x5a1a('0x16')](0x5)[_0x5a1a('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5a1a('0x44')},'dialDropMaxRetry':{'type':Sequelize[_0x5a1a('0x16')](0x3)[_0x5a1a('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5a1a('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x5a1a('0x16')](0x5)[_0x5a1a('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5a1a('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x5a1a('0x16')](0x3)[_0x5a1a('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5a1a('0x47')},'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[_0x5a1a('0x16')](0x3)[_0x5a1a('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5a1a('0x48')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5a1a('0x49')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x5a1a('0x16')](0x3)[_0x5a1a('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5a1a('0x4a')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5a1a('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5a1a('0x4b')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5a1a('0x16')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x5a1a('0x1f')],'defaultValue':![],'comment':_0x5a1a('0x4c'),'set':function(_0x5e4288){if(!_0x5e4288)this[_0x5a1a('0xe')](_0x5a1a('0x4d'),null);this['setDataValue'](_0x5a1a('0x4e'),_0x5e4288);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x5a1a('0x16')](0x3)[_0x5a1a('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x5a1a('0x16')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}};
\ No newline at end of file
index c2f50f7..10036d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87dc=['index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','where','merge','map','VIRTUAL','include','VoiceQueue','catch','params','length','includeAll','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','omit','createdAt','userProfileId','error','update','getHoppers','findOne','CmHopper','nolimit','pick','VoiceQueueId','findAll','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','order','getHopperBlacks','CmHopperBlack','getTeams','Team','User','Agents','voicePause','flatMap','penalty','sequelize','transaction','addTeams','each','TeamVoiceQueue','upsert','UserVoiceQueue','UserVoiceQueueRt','isNil','format','SIP/%s','interface','forEach','emit','userVoiceQueue:save','removeTeams','field','tq.TeamId','team_has_voice_queues','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','all','compact','ids','isEmpty','removeAgents','addAgents','online','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','always','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','select','CmListId','NOW()','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','cm_contacts','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','value','includes','UserProfileResource','end','stack','name'];(function(_0x3ad0cc,_0x4565ef){var _0x2af3d0=function(_0x1cbb93){while(--_0x1cbb93){_0x3ad0cc['push'](_0x3ad0cc['shift']());}};_0x2af3d0(++_0x4565ef);}(_0x87dc,0x81));var _0xc87d=function(_0x44d51f,_0x13c2e8){_0x44d51f=_0x44d51f-0x0;var _0x3c7b7d=_0x87dc[_0x44d51f];return _0x3c7b7d;};'use strict';var emlformat=require(_0xc87d('0x0'));var rimraf=require(_0xc87d('0x1'));var zipdir=require(_0xc87d('0x2'));var jsonpatch=require(_0xc87d('0x3'));var rp=require(_0xc87d('0x4'));var moment=require(_0xc87d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc87d('0x6'));var util=require(_0xc87d('0x7'));var path=require(_0xc87d('0x8'));var sox=require(_0xc87d('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc87d('0xa'));var _=require(_0xc87d('0xb'));var squel=require(_0xc87d('0xc'));var crypto=require(_0xc87d('0xd'));var jsforce=require(_0xc87d('0xe'));var deskjs=require(_0xc87d('0xf'));var toCsv=require(_0xc87d('0x10'));var querystring=require('querystring');var Papa=require(_0xc87d('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc87d('0x12'));var hardwareService=require(_0xc87d('0x13'));var logger=require('../../config/logger')(_0xc87d('0x14'));var utils=require(_0xc87d('0x15'));var config=require(_0xc87d('0x16'));var licenseUtil=require(_0xc87d('0x17'));var db=require(_0xc87d('0x18'))['db'];config['redis']=_[_0xc87d('0x19')](config[_0xc87d('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xc87d('0x1b'))(new Redis(config[_0xc87d('0x1a')]));require(_0xc87d('0x1c'))[_0xc87d('0x1d')](socket);function respondWithStatusCode(_0x39e27c,_0xcd7656){_0xcd7656=_0xcd7656||0xcc;return function(_0x3ecc44){if(_0x3ecc44){return _0x39e27c[_0xc87d('0x1e')](_0xcd7656);}return _0x39e27c[_0xc87d('0x1f')](_0xcd7656)['end']();};}function respondWithResult(_0xbaf7eb,_0xf38d2e){_0xf38d2e=_0xf38d2e||0xc8;return function(_0x27402b){if(_0x27402b){return _0xbaf7eb[_0xc87d('0x1f')](_0xf38d2e)[_0xc87d('0x20')](_0x27402b);}};}function respondWithFilteredResult(_0x4b0691,_0x238ff5){return function(_0x2cd19b){if(_0x2cd19b){var _0x5778b4=typeof _0x238ff5[_0xc87d('0x21')]===_0xc87d('0x22')&&typeof _0x238ff5[_0xc87d('0x23')]===_0xc87d('0x22');var _0x3015c3=_0x2cd19b[_0xc87d('0x24')];var _0x597e6d=_0x5778b4?0x0:_0x238ff5[_0xc87d('0x21')];var _0x4fe976=_0x5778b4?_0x2cd19b[_0xc87d('0x24')]:_0x238ff5['offset']+_0x238ff5[_0xc87d('0x23')];var _0x9e805c;if(_0x4fe976>=_0x3015c3){_0x4fe976=_0x3015c3;_0x9e805c=0xc8;}else{_0x9e805c=0xce;}_0x4b0691[_0xc87d('0x1f')](_0x9e805c);return _0x4b0691[_0xc87d('0x25')]('Content-Range',_0x597e6d+'-'+_0x4fe976+'/'+_0x3015c3)[_0xc87d('0x20')](_0x2cd19b);}return null;};}function patchUpdates(_0x369a7e){return function(_0xc30b65){try{jsonpatch[_0xc87d('0x26')](_0xc30b65,_0x369a7e,!![]);}catch(_0x5b1f56){return BPromise['reject'](_0x5b1f56);}return _0xc30b65[_0xc87d('0x27')]();};}function saveUpdates(_0x4ff0c2,_0x433cda){return function(_0x5d4f39){if(_0x5d4f39){return _0x5d4f39['update'](_0x4ff0c2)[_0xc87d('0x28')](function(_0x196876){return _0x196876;});}return null;};}function removeEntity(_0x240171,_0x23ac82){return function(_0xe3f491){if(_0xe3f491){return _0xe3f491[_0xc87d('0x29')]()['then'](function(){var _0xdc43c=_0xe3f491[_0xc87d('0x2a')]({'plain':!![]});var _0x37849e=[{'name':_0xc87d('0x2b'),'value':_0xc87d('0x2c'),'ignore':![]},{'name':_0xc87d('0x2d'),'value':_0xc87d('0x2e'),'ignore':![]}];var _0x113201=_(_0x37849e)[_0xc87d('0x2f')](_0xc87d('0x30'))['map'](_0xc87d('0x31'))[_0xc87d('0x31')]();if(_[_0xc87d('0x32')](_0x113201,_0xdc43c['type'])){return;}var _0x46ab62=_['find'](_0x37849e,[_0xc87d('0x31'),_0xdc43c['type']])['name'];return db[_0xc87d('0x33')][_0xc87d('0x29')]({'where':{'type':_0x46ab62,'resourceId':_0xdc43c['id']}})['then'](function(){return _0xe3f491;});})[_0xc87d('0x28')](function(){_0x240171[_0xc87d('0x1f')](0xcc)[_0xc87d('0x34')]();});}};}function handleEntityNotFound(_0x1c12bb,_0x4781ea){return function(_0x3ea46f){if(!_0x3ea46f){_0x1c12bb[_0xc87d('0x1e')](0x194);}return _0x3ea46f;};}function handleError(_0x351da0,_0x425b99){_0x425b99=_0x425b99||0x1f4;return function(_0x3776e9){logger['error'](_0x3776e9[_0xc87d('0x35')]);if(_0x3776e9['name']){delete _0x3776e9[_0xc87d('0x36')];}_0x351da0[_0xc87d('0x1f')](_0x425b99)['send'](_0x3776e9);};}exports[_0xc87d('0x37')]=function(_0x3cf083,_0xf330c5){var _0xe81e7f={},_0xf94654={},_0x4b9d49={'count':0x0,'rows':[]};var _0x111c21=_['map'](db['VoiceQueue'][_0xc87d('0x38')],function(_0x5c6b45){return{'name':_0x5c6b45[_0xc87d('0x39')],'type':_0x5c6b45[_0xc87d('0x3a')][_0xc87d('0x3b')]};});_0xf94654[_0xc87d('0x3c')]=_['map'](_0x111c21,_0xc87d('0x36'));_0xf94654[_0xc87d('0x3d')]=_[_0xc87d('0x3e')](_0x3cf083['query']);_0xf94654[_0xc87d('0x3f')]=_[_0xc87d('0x40')](_0xf94654[_0xc87d('0x3c')],_0xf94654[_0xc87d('0x3d')]);_0xe81e7f['attributes']=_[_0xc87d('0x40')](_0xf94654[_0xc87d('0x3c')],qs[_0xc87d('0x41')](_0x3cf083[_0xc87d('0x3d')][_0xc87d('0x41')]));_0xe81e7f['attributes']=_0xe81e7f[_0xc87d('0x42')]['length']?_0xe81e7f[_0xc87d('0x42')]:_0xf94654['model'];if(!_0x3cf083[_0xc87d('0x3d')][_0xc87d('0x43')]('nolimit')){_0xe81e7f[_0xc87d('0x23')]=qs[_0xc87d('0x23')](_0x3cf083[_0xc87d('0x3d')]['limit']);_0xe81e7f[_0xc87d('0x21')]=qs[_0xc87d('0x21')](_0x3cf083[_0xc87d('0x3d')][_0xc87d('0x21')]);}_0xe81e7f['order']=qs['sort'](_0x3cf083[_0xc87d('0x3d')][_0xc87d('0x44')]);_0xe81e7f['where']=qs[_0xc87d('0x3f')](_['pick'](_0x3cf083['query'],_0xf94654['filters']),_0x111c21);if(_0x3cf083[_0xc87d('0x3d')][_0xc87d('0x2f')]){_0xe81e7f[_0xc87d('0x45')]=_[_0xc87d('0x46')](_0xe81e7f[_0xc87d('0x45')],{'$or':_[_0xc87d('0x47')](_0x111c21,function(_0x4e32cc){if(_0x4e32cc['type']!==_0xc87d('0x48')){var _0x28f3d7={};_0x28f3d7[_0x4e32cc[_0xc87d('0x36')]]={'$like':'%'+_0x3cf083[_0xc87d('0x3d')]['filter']+'%'};return _0x28f3d7;}})});}_0xe81e7f=_['merge']({},_0xe81e7f,_0x3cf083['options']);var _0x2a0aef={'where':_0xe81e7f[_0xc87d('0x45')]};return db['VoiceQueue']['count'](_0x2a0aef)[_0xc87d('0x28')](function(_0x538830){_0x4b9d49[_0xc87d('0x24')]=_0x538830;if(_0x3cf083[_0xc87d('0x3d')]['includeAll']){_0xe81e7f[_0xc87d('0x49')]=[{'all':!![]}];}return db[_0xc87d('0x4a')]['findAll'](_0xe81e7f);})['then'](function(_0x221282){_0x4b9d49['rows']=_0x221282;return _0x4b9d49;})[_0xc87d('0x28')](respondWithFilteredResult(_0xf330c5,_0xe81e7f))[_0xc87d('0x4b')](handleError(_0xf330c5,null));};exports['show']=function(_0x4561d7,_0x165177){var _0x5f324c={'raw':![],'where':{'id':_0x4561d7[_0xc87d('0x4c')]['id']}},_0x685e0f={};_0x685e0f[_0xc87d('0x3c')]=_['keys'](db['VoiceQueue']['rawAttributes']);_0x685e0f['query']=_[_0xc87d('0x3e')](_0x4561d7['query']);_0x685e0f[_0xc87d('0x3f')]=_[_0xc87d('0x40')](_0x685e0f[_0xc87d('0x3c')],_0x685e0f[_0xc87d('0x3d')]);_0x5f324c[_0xc87d('0x42')]=_[_0xc87d('0x40')](_0x685e0f[_0xc87d('0x3c')],qs[_0xc87d('0x41')](_0x4561d7[_0xc87d('0x3d')][_0xc87d('0x41')]));_0x5f324c['attributes']=_0x5f324c[_0xc87d('0x42')][_0xc87d('0x4d')]?_0x5f324c[_0xc87d('0x42')]:_0x685e0f[_0xc87d('0x3c')];if(_0x4561d7[_0xc87d('0x3d')][_0xc87d('0x4e')]){_0x5f324c['include']=[{'all':!![]}];}_0x5f324c=_[_0xc87d('0x46')]({},_0x5f324c,_0x4561d7[_0xc87d('0x4f')]);return db[_0xc87d('0x4a')]['find'](_0x5f324c)[_0xc87d('0x28')](handleEntityNotFound(_0x165177,null))[_0xc87d('0x28')](respondWithResult(_0x165177,null))[_0xc87d('0x4b')](handleError(_0x165177,null));};exports['create']=function(_0x34ea6c,_0x4f597f){return db['VoiceQueue'][_0xc87d('0x50')](_0x34ea6c[_0xc87d('0x51')],{})['then'](function(_0x1bf008){var _0x4c1acc=_0x34ea6c['user'][_0xc87d('0x2a')]({'plain':!![]});if(!_0x4c1acc)throw new Error(_0xc87d('0x52'));if(_0x4c1acc[_0xc87d('0x53')]===_0xc87d('0x54')){var _0x5977cc=_0x1bf008[_0xc87d('0x2a')]({'plain':!![]});var _0x1c9286=[{'name':_0xc87d('0x2b'),'value':'inbound'},{'name':_0xc87d('0x2d'),'value':_0xc87d('0x2e')}];var _0x448c7c=_['find'](_0x1c9286,[_0xc87d('0x31'),_0x5977cc[_0xc87d('0x3a')]])[_0xc87d('0x36')];return db[_0xc87d('0x55')][_0xc87d('0x56')]({'where':{'name':_0x448c7c,'userProfileId':_0x4c1acc['userProfileId']},'raw':!![]})['then'](function(_0x19e285){if(_0x19e285&&_0x19e285[_0xc87d('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x5977cc[_0xc87d('0x36')],'resourceId':_0x5977cc['id'],'type':_0x19e285[_0xc87d('0x36')],'sectionId':_0x19e285['id']},{})[_0xc87d('0x28')](function(){return _0x1bf008;});}else{return _0x1bf008;}})[_0xc87d('0x4b')](function(_0x5cf90c){logger['error'](_0xc87d('0x58'),_0x5cf90c);throw _0x5cf90c;});}return _0x1bf008;})[_0xc87d('0x28')](respondWithResult(_0x4f597f,0xc9))['catch'](handleError(_0x4f597f,null));};exports[_0xc87d('0x59')]=function(_0x3f48c4,_0x271884){var _0x859e11={'where':{'id':_0x3f48c4['params']['id']}},_0x1796f9={};_0x1796f9[_0xc87d('0x3c')]=_[_0xc87d('0x3e')](db['VoiceQueue'][_0xc87d('0x38')]);_0x859e11[_0xc87d('0x42')]=_[_0xc87d('0x40')](_0x1796f9['model'],qs[_0xc87d('0x41')](_0x3f48c4['query'][_0xc87d('0x41')]));_0x859e11[_0xc87d('0x42')]=_0x859e11[_0xc87d('0x42')][_0xc87d('0x4d')]?_0x859e11[_0xc87d('0x42')]:_0x1796f9['model'];if(_0x3f48c4[_0xc87d('0x3d')][_0xc87d('0x4e')]){_0x859e11[_0xc87d('0x49')]=[{'all':!![]}];}_0x859e11=_[_0xc87d('0x46')]({},_0x859e11,_0x3f48c4[_0xc87d('0x4f')]);return db[_0xc87d('0x4a')][_0xc87d('0x56')](_0x859e11)[_0xc87d('0x28')](handleEntityNotFound(_0x271884,null))[_0xc87d('0x28')](function(_0x4db09f){if(_0x4db09f){var _0x586de3=_0x4db09f[_0xc87d('0x2a')]({'plain':!![]});_0x586de3=qs['omit'](_0x586de3,['id','createdAt',_0xc87d('0x5a')]);_0x3f48c4[_0xc87d('0x51')]=_[_0xc87d('0x5b')](_0x3f48c4['body'],['id',_0xc87d('0x5c'),_0xc87d('0x5a')]);return db['VoiceQueue'][_0xc87d('0x50')](_[_0xc87d('0x46')](_0x586de3,_0x3f48c4['body']),{'include':_0x3f48c4[_0xc87d('0x3d')][_0xc87d('0x4e')]?[{'all':!![]}]:undefined})['then'](function(_0x2e1cf6){var _0xee9aa6=_0x3f48c4['user'][_0xc87d('0x2a')]({'plain':!![]});if(!_0xee9aa6)throw new Error(_0xc87d('0x52'));if(_0xee9aa6[_0xc87d('0x53')]===_0xc87d('0x54')){var _0x12b384=_0x2e1cf6[_0xc87d('0x2a')]({'plain':!![]});var _0x436012=[{'name':_0xc87d('0x2b'),'value':'inbound'},{'name':_0xc87d('0x2d'),'value':'outbound'}];var _0x21e2a1=_['find'](_0x436012,[_0xc87d('0x31'),_0x12b384['type']])[_0xc87d('0x36')];return db[_0xc87d('0x55')][_0xc87d('0x56')]({'where':{'name':_0x21e2a1,'userProfileId':_0xee9aa6[_0xc87d('0x5d')]},'raw':!![]})[_0xc87d('0x28')](function(_0x5e85d1){if(_0x5e85d1&&_0x5e85d1['autoAssociation']===0x0){return db[_0xc87d('0x33')][_0xc87d('0x50')]({'name':_0x12b384[_0xc87d('0x36')],'resourceId':_0x12b384['id'],'type':_0x5e85d1['name'],'sectionId':_0x5e85d1['id']},{})[_0xc87d('0x28')](function(){return _0x2e1cf6;});}else{return _0x2e1cf6;}})[_0xc87d('0x4b')](function(_0x4c777c){logger[_0xc87d('0x5e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c777c);throw _0x4c777c;});}return _0x2e1cf6;});}})[_0xc87d('0x28')](respondWithResult(_0x271884,0xc9))[_0xc87d('0x4b')](handleError(_0x271884,null));};exports[_0xc87d('0x5f')]=function(_0x588f18,_0x177d82){if(_0x588f18['body']['id']){delete _0x588f18[_0xc87d('0x51')]['id'];}return db[_0xc87d('0x4a')][_0xc87d('0x56')]({'where':{'id':_0x588f18[_0xc87d('0x4c')]['id']}})[_0xc87d('0x28')](handleEntityNotFound(_0x177d82,null))['then'](saveUpdates(_0x588f18[_0xc87d('0x51')],null))['then'](respondWithResult(_0x177d82,null))[_0xc87d('0x4b')](handleError(_0x177d82,null));};exports[_0xc87d('0x29')]=function(_0x3307fd,_0x3c178c){return db[_0xc87d('0x4a')][_0xc87d('0x56')]({'where':{'id':_0x3307fd[_0xc87d('0x4c')]['id']}})[_0xc87d('0x28')](handleEntityNotFound(_0x3c178c,null))['then'](removeEntity(_0x3c178c,null))[_0xc87d('0x4b')](handleError(_0x3c178c,null));};exports[_0xc87d('0x60')]=function(_0x3e564b,_0x29541b,_0x22f31c){var _0x18c3a2={'raw':![],'where':{}};var _0x3ac30d={};var _0x5b166b={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xc87d('0x61')]({'where':{'id':_0x3e564b[_0xc87d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x29541b,null))[_0xc87d('0x28')](function(_0x2c8607){if(_0x2c8607){_0x3ac30d[_0xc87d('0x3c')]=_[_0xc87d('0x3e')](db[_0xc87d('0x62')][_0xc87d('0x38')]);_0x3ac30d[_0xc87d('0x3d')]=_[_0xc87d('0x3e')](_0x3e564b['query']);_0x3ac30d[_0xc87d('0x3f')]=_['intersection'](_0x3ac30d[_0xc87d('0x3c')],_0x3ac30d[_0xc87d('0x3d')]);_0x18c3a2['attributes']=_[_0xc87d('0x40')](_0x3ac30d[_0xc87d('0x3c')],qs[_0xc87d('0x41')](_0x3e564b[_0xc87d('0x3d')][_0xc87d('0x41')]));_0x18c3a2['attributes']=_0x18c3a2[_0xc87d('0x42')][_0xc87d('0x4d')]?_0x18c3a2[_0xc87d('0x42')]:_0x3ac30d[_0xc87d('0x3c')];if(!_0x3e564b[_0xc87d('0x3d')][_0xc87d('0x43')](_0xc87d('0x63'))){_0x18c3a2[_0xc87d('0x23')]=qs[_0xc87d('0x23')](_0x3e564b['query']['limit']);_0x18c3a2[_0xc87d('0x21')]=qs['offset'](_0x3e564b[_0xc87d('0x3d')]['offset']);}_0x18c3a2['order']=qs[_0xc87d('0x44')](_0x3e564b[_0xc87d('0x3d')]['sort']);_0x18c3a2[_0xc87d('0x45')]=qs[_0xc87d('0x3f')](_[_0xc87d('0x64')](_0x3e564b[_0xc87d('0x3d')],_0x3ac30d['filters']));_0x18c3a2[_0xc87d('0x45')][_0xc87d('0x65')]=_0x2c8607['id'];if(_0x3e564b[_0xc87d('0x3d')][_0xc87d('0x2f')]){_0x18c3a2[_0xc87d('0x45')]=_[_0xc87d('0x46')](_0x18c3a2[_0xc87d('0x45')],{'$or':_[_0xc87d('0x47')](_0x18c3a2[_0xc87d('0x42')],function(_0x4121fb){var _0x46fa17={};_0x46fa17[_0x4121fb]={'$like':'%'+_0x3e564b[_0xc87d('0x3d')][_0xc87d('0x2f')]+'%'};return _0x46fa17;})});}_0x18c3a2=_[_0xc87d('0x46')]({},_0x18c3a2,_0x3e564b[_0xc87d('0x4f')]);return db[_0xc87d('0x62')]['count']({'where':_0x18c3a2[_0xc87d('0x45')]})[_0xc87d('0x28')](function(_0x355161){_0x5b166b[_0xc87d('0x24')]=_0x355161;if(_0x3e564b[_0xc87d('0x3d')][_0xc87d('0x4e')]){_0x18c3a2[_0xc87d('0x49')]=[{'all':!![]}];}return db[_0xc87d('0x62')][_0xc87d('0x66')](_0x18c3a2);})[_0xc87d('0x28')](function(_0x3589d0){_0x5b166b[_0xc87d('0x67')]=_0x3589d0;return _0x5b166b;});}})[_0xc87d('0x28')](respondWithFilteredResult(_0x29541b,_0x18c3a2))[_0xc87d('0x4b')](handleError(_0x29541b,null));};exports[_0xc87d('0x68')]=function(_0x2d7cfb,_0x308a6d,_0x55bba1){var _0xe922c0={'raw':!![],'where':{}};var _0x30767a={};var _0xfc944={'count':0x0,'rows':[]};return db[_0xc87d('0x4a')][_0xc87d('0x61')]({'where':{'id':_0x2d7cfb['params']['id']}})[_0xc87d('0x28')](handleEntityNotFound(_0x308a6d,null))[_0xc87d('0x28')](function(_0x524738){if(_0x524738){_0x30767a[_0xc87d('0x3c')]=_[_0xc87d('0x3e')](db[_0xc87d('0x69')]['rawAttributes']);_0x30767a[_0xc87d('0x3d')]=_[_0xc87d('0x3e')](_0x2d7cfb[_0xc87d('0x3d')]);_0x30767a[_0xc87d('0x3f')]=_[_0xc87d('0x40')](_0x30767a[_0xc87d('0x3c')],_0x30767a[_0xc87d('0x3d')]);_0xe922c0[_0xc87d('0x42')]=_[_0xc87d('0x40')](_0x30767a[_0xc87d('0x3c')],qs['fields'](_0x2d7cfb[_0xc87d('0x3d')][_0xc87d('0x41')]));_0xe922c0[_0xc87d('0x42')]=_0xe922c0['attributes'][_0xc87d('0x4d')]?_0xe922c0[_0xc87d('0x42')]:_0x30767a[_0xc87d('0x3c')];if(!_0x2d7cfb['query']['hasOwnProperty']('nolimit')){_0xe922c0[_0xc87d('0x23')]=qs[_0xc87d('0x23')](_0x2d7cfb[_0xc87d('0x3d')]['limit']);_0xe922c0['offset']=qs[_0xc87d('0x21')](_0x2d7cfb[_0xc87d('0x3d')][_0xc87d('0x21')]);}_0xe922c0['order']=qs[_0xc87d('0x44')](_0x2d7cfb['query'][_0xc87d('0x44')]);_0xe922c0[_0xc87d('0x45')]=qs['filters'](_['pick'](_0x2d7cfb[_0xc87d('0x3d')],_0x30767a[_0xc87d('0x3f')]));_0xe922c0[_0xc87d('0x45')][_0xc87d('0x65')]=_0x524738['id'];if(_0x2d7cfb['query'][_0xc87d('0x2f')]){_0xe922c0['where']=_['merge'](_0xe922c0[_0xc87d('0x45')],{'$or':_[_0xc87d('0x47')](_0xe922c0[_0xc87d('0x42')],function(_0x5cb5ba){var _0x1fd8d9={};_0x1fd8d9[_0x5cb5ba]={'$like':'%'+_0x2d7cfb[_0xc87d('0x3d')][_0xc87d('0x2f')]+'%'};return _0x1fd8d9;})});}_0xe922c0=_[_0xc87d('0x46')]({},_0xe922c0,_0x2d7cfb['options']);return db[_0xc87d('0x69')][_0xc87d('0x24')]({'where':_0xe922c0[_0xc87d('0x45')]})[_0xc87d('0x28')](function(_0x4d1880){_0xfc944[_0xc87d('0x24')]=_0x4d1880;if(_0x2d7cfb['query']['includeAll']){_0xe922c0[_0xc87d('0x49')]=[{'all':!![]}];}return db[_0xc87d('0x69')][_0xc87d('0x66')](_0xe922c0);})[_0xc87d('0x28')](function(_0x1c6d99){_0xfc944['rows']=_0x1c6d99;return _0xfc944;});}})[_0xc87d('0x28')](respondWithFilteredResult(_0x308a6d,_0xe922c0))[_0xc87d('0x4b')](handleError(_0x308a6d,null));};exports[_0xc87d('0x6a')]=function(_0x1fa11f,_0x22f05f,_0x41a71b){var _0x47e7af={'raw':!![],'where':{}};var _0x11c81e={};var _0x44e9a5={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xc87d('0x61')]({'where':{'id':_0x1fa11f['params']['id']}})[_0xc87d('0x28')](handleEntityNotFound(_0x22f05f,null))['then'](function(_0xfd6b3d){if(_0xfd6b3d){_0x11c81e[_0xc87d('0x3c')]=_[_0xc87d('0x3e')](db[_0xc87d('0x6b')]['rawAttributes']);_0x11c81e[_0xc87d('0x3d')]=_[_0xc87d('0x3e')](_0x1fa11f[_0xc87d('0x3d')]);_0x11c81e[_0xc87d('0x3f')]=_[_0xc87d('0x40')](_0x11c81e[_0xc87d('0x3c')],_0x11c81e['query']);_0x47e7af['attributes']=_[_0xc87d('0x40')](_0x11c81e['model'],qs[_0xc87d('0x41')](_0x1fa11f['query']['fields']));_0x47e7af[_0xc87d('0x42')]=_0x47e7af[_0xc87d('0x42')][_0xc87d('0x4d')]?_0x47e7af[_0xc87d('0x42')]:_0x11c81e[_0xc87d('0x3c')];if(!_0x1fa11f[_0xc87d('0x3d')][_0xc87d('0x43')]('nolimit')){_0x47e7af[_0xc87d('0x23')]=qs[_0xc87d('0x23')](_0x1fa11f[_0xc87d('0x3d')][_0xc87d('0x23')]);_0x47e7af['offset']=qs['offset'](_0x1fa11f['query'][_0xc87d('0x21')]);}_0x47e7af[_0xc87d('0x6c')]=qs['sort'](_0x1fa11f['query'][_0xc87d('0x44')]);_0x47e7af[_0xc87d('0x45')]=qs[_0xc87d('0x3f')](_['pick'](_0x1fa11f[_0xc87d('0x3d')],_0x11c81e[_0xc87d('0x3f')]));_0x47e7af['where'][_0xc87d('0x65')]=_0xfd6b3d['id'];if(_0x1fa11f[_0xc87d('0x3d')][_0xc87d('0x2f')]){_0x47e7af['where']=_[_0xc87d('0x46')](_0x47e7af['where'],{'$or':_[_0xc87d('0x47')](_0x47e7af[_0xc87d('0x42')],function(_0x4e314b){var _0x5d0dbe={};_0x5d0dbe[_0x4e314b]={'$like':'%'+_0x1fa11f[_0xc87d('0x3d')][_0xc87d('0x2f')]+'%'};return _0x5d0dbe;})});}_0x47e7af=_['merge']({},_0x47e7af,_0x1fa11f[_0xc87d('0x4f')]);return db[_0xc87d('0x6b')][_0xc87d('0x24')]({'where':_0x47e7af[_0xc87d('0x45')]})[_0xc87d('0x28')](function(_0x6d253f){_0x44e9a5[_0xc87d('0x24')]=_0x6d253f;if(_0x1fa11f['query']['includeAll']){_0x47e7af[_0xc87d('0x49')]=[{'all':!![]}];}return db[_0xc87d('0x6b')]['findAll'](_0x47e7af);})[_0xc87d('0x28')](function(_0x17d15b){_0x44e9a5[_0xc87d('0x67')]=_0x17d15b;return _0x44e9a5;});}})[_0xc87d('0x28')](respondWithFilteredResult(_0x22f05f,_0x47e7af))['catch'](handleError(_0x22f05f,null));};exports[_0xc87d('0x6d')]=function(_0x3d6f7e,_0x1e2b3d,_0x27674b){var _0x54fedc={'raw':!![],'where':{}};var _0x445723={};var _0x5adfc8={'count':0x0,'rows':[]};return db[_0xc87d('0x4a')][_0xc87d('0x61')]({'where':{'id':_0x3d6f7e['params']['id']}})[_0xc87d('0x28')](handleEntityNotFound(_0x1e2b3d,null))['then'](function(_0x534da0){if(_0x534da0){_0x445723[_0xc87d('0x3c')]=_[_0xc87d('0x3e')](db[_0xc87d('0x6e')][_0xc87d('0x38')]);_0x445723[_0xc87d('0x3d')]=_[_0xc87d('0x3e')](_0x3d6f7e['query']);_0x445723['filters']=_['intersection'](_0x445723['model'],_0x445723[_0xc87d('0x3d')]);_0x54fedc[_0xc87d('0x42')]=_[_0xc87d('0x40')](_0x445723[_0xc87d('0x3c')],qs[_0xc87d('0x41')](_0x3d6f7e[_0xc87d('0x3d')]['fields']));_0x54fedc[_0xc87d('0x42')]=_0x54fedc[_0xc87d('0x42')][_0xc87d('0x4d')]?_0x54fedc[_0xc87d('0x42')]:_0x445723[_0xc87d('0x3c')];if(!_0x3d6f7e[_0xc87d('0x3d')][_0xc87d('0x43')](_0xc87d('0x63'))){_0x54fedc[_0xc87d('0x23')]=qs[_0xc87d('0x23')](_0x3d6f7e[_0xc87d('0x3d')]['limit']);_0x54fedc[_0xc87d('0x21')]=qs[_0xc87d('0x21')](_0x3d6f7e[_0xc87d('0x3d')]['offset']);}_0x54fedc['order']=qs[_0xc87d('0x44')](_0x3d6f7e['query'][_0xc87d('0x44')]);_0x54fedc[_0xc87d('0x45')]=qs[_0xc87d('0x3f')](_[_0xc87d('0x64')](_0x3d6f7e[_0xc87d('0x3d')],_0x445723[_0xc87d('0x3f')]));_0x54fedc[_0xc87d('0x45')]['VoiceQueueId']=_0x534da0['id'];if(_0x3d6f7e[_0xc87d('0x3d')][_0xc87d('0x2f')]){_0x54fedc['where']=_[_0xc87d('0x46')](_0x54fedc[_0xc87d('0x45')],{'$or':_[_0xc87d('0x47')](_0x54fedc[_0xc87d('0x42')],function(_0x239027){var _0x581aae={};_0x581aae[_0x239027]={'$like':'%'+_0x3d6f7e[_0xc87d('0x3d')][_0xc87d('0x2f')]+'%'};return _0x581aae;})});}_0x54fedc=_[_0xc87d('0x46')]({},_0x54fedc,_0x3d6f7e[_0xc87d('0x4f')]);return db[_0xc87d('0x6e')][_0xc87d('0x24')]({'where':_0x54fedc[_0xc87d('0x45')]})[_0xc87d('0x28')](function(_0x290cc6){_0x5adfc8[_0xc87d('0x24')]=_0x290cc6;if(_0x3d6f7e[_0xc87d('0x3d')][_0xc87d('0x4e')]){_0x54fedc['include']=[{'all':!![]}];}return db[_0xc87d('0x6e')][_0xc87d('0x66')](_0x54fedc);})[_0xc87d('0x28')](function(_0x2beecc){_0x5adfc8[_0xc87d('0x67')]=_0x2beecc;return _0x5adfc8;});}})['then'](respondWithFilteredResult(_0x1e2b3d,_0x54fedc))['catch'](handleError(_0x1e2b3d,null));};exports[_0xc87d('0x6f')]=function(_0x24b293,_0x1e6b22,_0x2a3e35){var _0x77f7cb={};var _0x11a69e={};var _0x31e68f;var _0x1813ea;return db[_0xc87d('0x4a')][_0xc87d('0x61')]({'where':{'id':_0x24b293[_0xc87d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1e6b22,null))[_0xc87d('0x28')](function(_0x370a9a){if(_0x370a9a){_0x31e68f=_0x370a9a;_0x11a69e[_0xc87d('0x3c')]=_[_0xc87d('0x3e')](db[_0xc87d('0x70')][_0xc87d('0x38')]);_0x11a69e['query']=_[_0xc87d('0x3e')](_0x24b293['query']);_0x11a69e['filters']=_[_0xc87d('0x40')](_0x11a69e['model'],_0x11a69e[_0xc87d('0x3d')]);_0x77f7cb[_0xc87d('0x42')]=_['intersection'](_0x11a69e[_0xc87d('0x3c')],qs[_0xc87d('0x41')](_0x24b293[_0xc87d('0x3d')][_0xc87d('0x41')]));_0x77f7cb[_0xc87d('0x42')]=_0x77f7cb[_0xc87d('0x42')]['length']?_0x77f7cb[_0xc87d('0x42')]:_0x11a69e[_0xc87d('0x3c')];_0x77f7cb[_0xc87d('0x6c')]=qs[_0xc87d('0x44')](_0x24b293[_0xc87d('0x3d')][_0xc87d('0x44')]);_0x77f7cb[_0xc87d('0x45')]=qs[_0xc87d('0x3f')](_[_0xc87d('0x64')](_0x24b293[_0xc87d('0x3d')],_0x11a69e[_0xc87d('0x3f')]));if(_0x24b293[_0xc87d('0x3d')][_0xc87d('0x2f')]){_0x77f7cb['where']=_[_0xc87d('0x46')](_0x77f7cb[_0xc87d('0x45')],{'$or':_['map'](_0x77f7cb[_0xc87d('0x42')],function(_0x4e7850){var _0x218223={};_0x218223[_0x4e7850]={'$like':'%'+_0x24b293[_0xc87d('0x3d')]['filter']+'%'};return _0x218223;})});}_0x77f7cb=_[_0xc87d('0x46')]({},_0x77f7cb,_0x24b293[_0xc87d('0x4f')]);return _0x31e68f['getTeams'](_0x77f7cb);}})[_0xc87d('0x28')](function(_0x316e2e){if(_0x316e2e){_0x1813ea=_0x316e2e[_0xc87d('0x4d')];if(!_0x24b293[_0xc87d('0x3d')][_0xc87d('0x43')](_0xc87d('0x63'))){_0x77f7cb['limit']=qs[_0xc87d('0x23')](_0x24b293[_0xc87d('0x3d')][_0xc87d('0x23')]);_0x77f7cb[_0xc87d('0x21')]=qs[_0xc87d('0x21')](_0x24b293[_0xc87d('0x3d')][_0xc87d('0x21')]);}return _0x31e68f['getTeams'](_0x77f7cb);}})[_0xc87d('0x28')](function(_0x22dfa6){if(_0x22dfa6){return _0x22dfa6?{'count':_0x1813ea,'rows':_0x22dfa6}:null;}})[_0xc87d('0x28')](respondWithResult(_0x1e6b22,null))[_0xc87d('0x4b')](handleError(_0x1e6b22,null));};exports['addTeams']=function(_0x4e8d3f,_0x3ac0b4,_0x3b847e){var _0x54c63c=_0x4e8d3f['body']['teams'];var _0xe8f1f4=_[_0xc87d('0x47')](_0x54c63c,'id');return db[_0xc87d('0x70')][_0xc87d('0x66')]({'where':{'id':_0xe8f1f4},'attributes':['id'],'include':[{'model':db[_0xc87d('0x71')],'as':_0xc87d('0x72'),'attributes':['id',_0xc87d('0x36'),'online',_0xc87d('0x73'),'interface'],'raw':!![]}]})[_0xc87d('0x28')](function(_0x50cb34){if(_0x50cb34){var _0xf1f72b=_[_0xc87d('0x74')](_0x50cb34,function(_0x1b2519){var _0x6f157d=_0x1b2519['get']({'plain':!![]});_0x6f157d[_0xc87d('0x72')]['forEach'](function(_0x2cff21){_0x2cff21[_0xc87d('0x75')]=_[_0xc87d('0x56')](_0x54c63c,{'id':_0x6f157d['id']})[_0xc87d('0x75')];});return _0x6f157d['Agents'];});return db[_0xc87d('0x4a')][_0xc87d('0x56')]({'where':{'id':_0x4e8d3f[_0xc87d('0x4c')]['id']}})[_0xc87d('0x28')](function(_0x253cc3){return db[_0xc87d('0x76')][_0xc87d('0x77')](function(_0x131a92){return _0x253cc3[_0xc87d('0x78')](_0xe8f1f4,{'transaction':_0x131a92})[_0xc87d('0x28')](function(){return BPromise[_0xc87d('0x79')](_0x54c63c,function(_0x2ac05a){return db[_0xc87d('0x7a')][_0xc87d('0x7b')]({'TeamId':_0x2ac05a['id'],'VoiceQueueId':_0x4e8d3f[_0xc87d('0x4c')]['id'],'penalty':_0x2ac05a[_0xc87d('0x75')]},{'transaction':_0x131a92});});})[_0xc87d('0x28')](function(){return BPromise['each'](_0xf1f72b,function(_0x311af0){return db[_0xc87d('0x7c')]['findOrCreate']({'where':{'UserId':_0x311af0['id'],'VoiceQueueId':_0x4e8d3f[_0xc87d('0x4c')]['id']},'defaults':{'penalty':_0x311af0[_0xc87d('0x75')]},'transaction':_0x131a92});});})[_0xc87d('0x28')](function(){return BPromise['each'](_[_0xc87d('0x2f')](_0xf1f72b,{'online':!![]}),function(_0x5a0f92){return db[_0xc87d('0x7d')][_0xc87d('0x7b')]({'membername':_0x5a0f92['name'],'UserId':_0x5a0f92['id'],'queue_name':_0x253cc3['name'],'VoiceQueueId':_0x253cc3['id'],'interface':_[_0xc87d('0x7e')](_0x5a0f92['interface'])?util[_0xc87d('0x7f')](_0xc87d('0x80'),_0x5a0f92[_0xc87d('0x36')]):_0x5a0f92[_0xc87d('0x81')],'paused':_0x5a0f92[_0xc87d('0x73')]||![],'penalty':_0x5a0f92['penalty']},{'transaction':_0x131a92});});})['then'](function(){_0xf1f72b[_0xc87d('0x82')](function(_0x25e79a){socket[_0xc87d('0x83')](_0xc87d('0x84'),{'UserId':_0x25e79a['id'],'VoiceQueueId':_0x253cc3['id']});});});});});}})['then'](respondWithStatusCode(_0x3ac0b4,null))[_0xc87d('0x4b')](handleError(_0x3ac0b4,null));};exports[_0xc87d('0x85')]=function(_0x33625e,_0x14a16b,_0x32f5d5){return db['Team'][_0xc87d('0x66')]({'where':{'id':_0x33625e['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc87d('0x72'),'attributes':['id'],'raw':!![]}]})[_0xc87d('0x28')](handleEntityNotFound(_0x14a16b,null))[_0xc87d('0x28')](function(_0x1cb034){var _0x18f00a=_[_0xc87d('0x47')](_0x1cb034,'id');var _0x5e6304=[];var _0x1b1683=[];var _0x54c1ac=squel['select']();_0x54c1ac[_0xc87d('0x86')](_0xc87d('0x87'))['from'](_0xc87d('0x88'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xc87d('0x45')]('VoiceQueueId\x20=\x20?',_0x33625e[_0xc87d('0x4c')]['id']);for(var _0x8e6585=0x0;_0x8e6585<_0x1cb034['length'];_0x8e6585+=0x1){let _0x1bb969=_0x1cb034[_0x8e6585];for(var _0x529c48=0x0;_0x529c48<_0x1bb969[_0xc87d('0x72')][_0xc87d('0x4d')];_0x529c48+=0x1){let _0x5aa4d3=_0x1bb969[_0xc87d('0x72')][_0x529c48];var _0x1670bc=_0x54c1ac[_0xc87d('0x59')]();_0x1670bc[_0xc87d('0x45')](_0xc87d('0x89'),_0x5aa4d3['id']);_0x1b1683[_0xc87d('0x8a')](db[_0xc87d('0x76')]['query'](_0x1670bc[_0xc87d('0x8b')](),{'type':db[_0xc87d('0x76')][_0xc87d('0x8c')]['SELECT']})[_0xc87d('0x28')](function(_0x55c350){if(_0x55c350[_0xc87d('0x4d')]===0x1){return _0x5aa4d3['id'];}else{var _0x8588f8=_[_0xc87d('0x8d')](_['map'](_0x55c350,'TeamId'),function(_0x5f4e85){return _[_0xc87d('0x32')](_0x18f00a,_0x5f4e85);});if(_0x8588f8){return _0x5aa4d3['id'];}}}));}}return BPromise[_0xc87d('0x8e')](_0x1b1683)[_0xc87d('0x28')](function(_0x570d71){_0x5e6304=_(_0x5e6304)['union'](_0x570d71)[_0xc87d('0x8f')]()[_0xc87d('0x31')]();return db['VoiceQueue']['find']({'where':{'id':_0x33625e[_0xc87d('0x4c')]['id']}})['then'](function(_0x5c246f){return db[_0xc87d('0x76')][_0xc87d('0x77')](function(_0x38a7d1){return _0x5c246f[_0xc87d('0x85')](_0x33625e[_0xc87d('0x3d')][_0xc87d('0x90')],{'transaction':_0x38a7d1})[_0xc87d('0x28')](function(){if(!_[_0xc87d('0x91')](_0x5e6304)){return _0x5c246f[_0xc87d('0x92')](_0x5e6304,{'transaction':_0x38a7d1})[_0xc87d('0x28')](function(){return db[_0xc87d('0x7d')][_0xc87d('0x29')]({'where':{'VoiceQueueId':_0x33625e[_0xc87d('0x4c')]['id'],'UserId':_0x5e6304},'transaction':_0x38a7d1});});}})[_0xc87d('0x28')](function(){_0x5e6304[_0xc87d('0x82')](function(_0x2af86f){socket['emit']('userVoiceQueue:remove',{'UserId':_0x2af86f,'VoiceQueueId':_0x5c246f['id']});});});});});});})['then'](respondWithStatusCode(_0x14a16b,null))[_0xc87d('0x4b')](handleError(_0x14a16b,null));};exports[_0xc87d('0x93')]=function(_0x167f0f,_0x37aa65,_0x5e854c){var _0xb2345,_0x127ff3;return db[_0xc87d('0x4a')]['find']({'where':{'id':_0x167f0f[_0xc87d('0x4c')]['id']}})[_0xc87d('0x28')](handleEntityNotFound(_0x37aa65,null))[_0xc87d('0x28')](function(_0x481fdb){if(_0x481fdb){_0x127ff3=_0x481fdb;return _0x481fdb[_0xc87d('0x93')](_0x167f0f[_0xc87d('0x51')][_0xc87d('0x90')],_[_0xc87d('0x5b')](_0x167f0f['body'],[_0xc87d('0x90'),'id'])||{})['spread'](function(_0x12761f){for(var _0x112ae0=0x0;_0x112ae0<_0x167f0f[_0xc87d('0x51')][_0xc87d('0x90')][_0xc87d('0x4d')];_0x112ae0+=0x1){socket[_0xc87d('0x83')]('userVoiceQueue:save',{'UserId':Number(_0x167f0f[_0xc87d('0x51')][_0xc87d('0x90')][_0x112ae0]),'VoiceQueueId':Number(_0x167f0f['params']['id'])});}return _0x12761f;});}})[_0xc87d('0x28')](function(_0x508279){_0xb2345=_0x508279||[];if(_0x127ff3){return db[_0xc87d('0x71')]['findAll']({'where':{'id':_0x167f0f[_0xc87d('0x51')][_0xc87d('0x90')]},'attributes':['id',_0xc87d('0x36'),_0xc87d('0x94'),_0xc87d('0x73'),'interface'],'raw':!![]});}})[_0xc87d('0x28')](function(_0x1c3b99){if(!_[_0xc87d('0x91')](_0x1c3b99)){var _0x4ac3bb=[];for(var _0x2d33ef=0x0;_0x2d33ef<_0x1c3b99[_0xc87d('0x4d')];_0x2d33ef++){if(_0x1c3b99[_0x2d33ef][_0xc87d('0x94')]){_0x4ac3bb[_0xc87d('0x8a')](db[_0xc87d('0x7d')][_0xc87d('0x7b')]({'membername':_0x1c3b99[_0x2d33ef][_0xc87d('0x36')],'UserId':_0x1c3b99[_0x2d33ef]['id'],'queue_name':_0x127ff3[_0xc87d('0x36')],'VoiceQueueId':_0x127ff3['id'],'interface':_['isNil'](_0x1c3b99[_0x2d33ef]['interface'])?util[_0xc87d('0x7f')](_0xc87d('0x80'),_0x1c3b99[_0x2d33ef]['name']):_0x1c3b99[_0x2d33ef][_0xc87d('0x81')],'paused':_0x1c3b99[_0x2d33ef][_0xc87d('0x73')]||![],'penalty':_0x167f0f[_0xc87d('0x51')][_0xc87d('0x75')]||0x0}));}}return BPromise[_0xc87d('0x8e')](_0x4ac3bb);}})[_0xc87d('0x28')](function(){return _0xb2345;})[_0xc87d('0x28')](respondWithResult(_0x37aa65,null))[_0xc87d('0x4b')](handleError(_0x37aa65,null));};exports[_0xc87d('0x92')]=function(_0x85e26b,_0x1fb4da,_0x2ac783){return db['VoiceQueue'][_0xc87d('0x56')]({'where':{'id':_0x85e26b['params']['id']}})[_0xc87d('0x28')](handleEntityNotFound(_0x1fb4da,null))[_0xc87d('0x28')](function(_0x5a4d59){if(_0x5a4d59){return _0x5a4d59[_0xc87d('0x92')](_0x85e26b[_0xc87d('0x3d')][_0xc87d('0x90')])[_0xc87d('0x28')](function(){if(_[_0xc87d('0x95')](_0x85e26b['query'][_0xc87d('0x90')])){for(var _0x37eb13=0x0;_0x37eb13<_0x85e26b[_0xc87d('0x3d')]['ids'][_0xc87d('0x4d')];_0x37eb13+=0x1){socket[_0xc87d('0x83')]('userVoiceQueue:remove',{'UserId':Number(_0x85e26b['query'][_0xc87d('0x90')][_0x37eb13]),'VoiceQueueId':Number(_0x85e26b[_0xc87d('0x4c')]['id'])});}}else{socket['emit'](_0xc87d('0x96'),{'UserId':Number(_0x85e26b[_0xc87d('0x3d')][_0xc87d('0x90')]),'VoiceQueueId':Number(_0x85e26b[_0xc87d('0x4c')]['id'])});}});}})[_0xc87d('0x28')](function(_0x37458b){return db[_0xc87d('0x7d')][_0xc87d('0x29')]({'where':{'VoiceQueueId':_0x85e26b[_0xc87d('0x4c')]['id'],'UserId':_0x85e26b['query'][_0xc87d('0x90')]}})[_0xc87d('0x28')](function(){return _0x37458b;});})[_0xc87d('0x28')](respondWithStatusCode(_0x1fb4da,null))['catch'](handleError(_0x1fb4da,null));};exports[_0xc87d('0x97')]=function(_0x860afb,_0x178dc6,_0x3f019d){var _0x43a66b={};var _0x190735={};var _0x18195d;var _0xf10c6a;return db[_0xc87d('0x4a')][_0xc87d('0x61')]({'where':{'id':_0x860afb['params']['id']}})[_0xc87d('0x28')](handleEntityNotFound(_0x178dc6,null))['then'](function(_0x3f5300){if(_0x3f5300){_0x18195d=_0x3f5300;_0x190735[_0xc87d('0x3c')]=_[_0xc87d('0x3e')](db['User'][_0xc87d('0x38')]);_0x190735[_0xc87d('0x3d')]=_['keys'](_0x860afb[_0xc87d('0x3d')]);_0x190735[_0xc87d('0x3f')]=_[_0xc87d('0x40')](_0x190735['model'],_0x190735[_0xc87d('0x3d')]);_0x43a66b[_0xc87d('0x42')]=_[_0xc87d('0x40')](_0x190735[_0xc87d('0x3c')],qs[_0xc87d('0x41')](_0x860afb[_0xc87d('0x3d')][_0xc87d('0x41')]));_0x43a66b['attributes']=_0x43a66b[_0xc87d('0x42')]['length']?_0x43a66b['attributes']:_0x190735[_0xc87d('0x3c')];_0x43a66b[_0xc87d('0x6c')]=qs[_0xc87d('0x44')](_0x860afb[_0xc87d('0x3d')][_0xc87d('0x44')]);_0x43a66b[_0xc87d('0x45')]=qs[_0xc87d('0x3f')](_[_0xc87d('0x64')](_0x860afb[_0xc87d('0x3d')],_0x190735[_0xc87d('0x3f')]));if(_0x860afb[_0xc87d('0x3d')][_0xc87d('0x2f')]){_0x43a66b[_0xc87d('0x45')]=_['merge'](_0x43a66b[_0xc87d('0x45')],{'$or':_[_0xc87d('0x47')](_0x43a66b[_0xc87d('0x42')],function(_0x594b50){var _0x204c2f={};_0x204c2f[_0x594b50]={'$like':'%'+_0x860afb[_0xc87d('0x3d')][_0xc87d('0x2f')]+'%'};return _0x204c2f;})});}_0x43a66b=_[_0xc87d('0x46')]({},_0x43a66b,_0x860afb[_0xc87d('0x4f')]);return _0x18195d[_0xc87d('0x97')](_0x43a66b);}})[_0xc87d('0x28')](function(_0xbe92ec){if(_0xbe92ec){_0xf10c6a=_0xbe92ec[_0xc87d('0x4d')];if(!_0x860afb['query']['hasOwnProperty'](_0xc87d('0x63'))){_0x43a66b[_0xc87d('0x23')]=qs[_0xc87d('0x23')](_0x860afb['query'][_0xc87d('0x23')]);_0x43a66b[_0xc87d('0x21')]=qs['offset'](_0x860afb[_0xc87d('0x3d')][_0xc87d('0x21')]);}return _0x18195d['getAgents'](_0x43a66b);}})['then'](function(_0x1168fc){if(_0x1168fc){return _0x1168fc?{'count':_0xf10c6a,'rows':_0x1168fc}:null;}})['then'](respondWithResult(_0x178dc6,null))[_0xc87d('0x4b')](handleError(_0x178dc6,null));};exports[_0xc87d('0x98')]=function(_0x2d4430,_0x2ad3c2,_0xa3a796){var _0x32b190={};var _0x1103c6={};var _0x20c747;var _0x29c65d;return db['VoiceQueue'][_0xc87d('0x61')]({'where':{'id':_0x2d4430[_0xc87d('0x4c')]['id']}})[_0xc87d('0x28')](handleEntityNotFound(_0x2ad3c2,null))['then'](function(_0x3b608e){if(_0x3b608e){_0x20c747=_0x3b608e;_0x1103c6[_0xc87d('0x3c')]=_['keys'](db[_0xc87d('0x7d')][_0xc87d('0x38')]);_0x1103c6[_0xc87d('0x3d')]=_[_0xc87d('0x3e')](_0x2d4430[_0xc87d('0x3d')]);_0x1103c6[_0xc87d('0x3f')]=_[_0xc87d('0x40')](_0x1103c6[_0xc87d('0x3c')],_0x1103c6['query']);_0x32b190['attributes']=_[_0xc87d('0x40')](_0x1103c6[_0xc87d('0x3c')],qs[_0xc87d('0x41')](_0x2d4430[_0xc87d('0x3d')]['fields']));_0x32b190[_0xc87d('0x42')]=_0x32b190[_0xc87d('0x42')]['length']?_0x32b190[_0xc87d('0x42')]:_0x1103c6['model'];_0x32b190[_0xc87d('0x6c')]=qs['sort'](_0x2d4430['query'][_0xc87d('0x44')]);_0x32b190['where']=qs[_0xc87d('0x3f')](_['pick'](_0x2d4430[_0xc87d('0x3d')],_0x1103c6[_0xc87d('0x3f')]));if(_0x2d4430[_0xc87d('0x3d')][_0xc87d('0x2f')]){_0x32b190[_0xc87d('0x45')]=_['merge'](_0x32b190[_0xc87d('0x45')],{'$or':_[_0xc87d('0x47')](_0x32b190['attributes'],function(_0x438d2c){var _0x1a8cdc={};_0x1a8cdc[_0x438d2c]={'$like':'%'+_0x2d4430[_0xc87d('0x3d')][_0xc87d('0x2f')]+'%'};return _0x1a8cdc;})});}_0x32b190=_[_0xc87d('0x46')]({},_0x32b190,_0x2d4430[_0xc87d('0x4f')]);return _0x20c747[_0xc87d('0x98')](_0x32b190);}})['then'](function(_0x22761b){if(_0x22761b){_0x29c65d=_0x22761b[_0xc87d('0x4d')];if(!_0x2d4430[_0xc87d('0x3d')][_0xc87d('0x43')](_0xc87d('0x63'))){_0x32b190['limit']=qs['limit'](_0x2d4430[_0xc87d('0x3d')][_0xc87d('0x23')]);_0x32b190['offset']=qs[_0xc87d('0x21')](_0x2d4430['query'][_0xc87d('0x21')]);}return _0x20c747[_0xc87d('0x98')](_0x32b190);}})['then'](function(_0x378689){return _0x378689?{'count':_0x29c65d,'rows':_0x378689}:null;})[_0xc87d('0x28')](respondWithResult(_0x2ad3c2,null))[_0xc87d('0x4b')](handleError(_0x2ad3c2,null));};exports[_0xc87d('0x99')]=function(_0x19550d,_0x5b242a,_0x160b2d){var _0x352b5a={};var _0x2023f6={};var _0x4d8e8c;var _0x16d8b0;return db[_0xc87d('0x4a')][_0xc87d('0x61')]({'where':{'id':_0x19550d['params']['id']}})[_0xc87d('0x28')](handleEntityNotFound(_0x5b242a,null))[_0xc87d('0x28')](function(_0x28b4ab){if(_0x28b4ab){_0x4d8e8c=_0x28b4ab;_0x2023f6['model']=_[_0xc87d('0x3e')](db['CmList']['rawAttributes']);_0x2023f6[_0xc87d('0x3d')]=_[_0xc87d('0x3e')](_0x19550d[_0xc87d('0x3d')]);_0x2023f6[_0xc87d('0x3f')]=_[_0xc87d('0x40')](_0x2023f6['model'],_0x2023f6[_0xc87d('0x3d')]);_0x352b5a[_0xc87d('0x42')]=_['intersection'](_0x2023f6[_0xc87d('0x3c')],qs[_0xc87d('0x41')](_0x19550d[_0xc87d('0x3d')][_0xc87d('0x41')]));_0x352b5a[_0xc87d('0x42')]=_0x352b5a[_0xc87d('0x42')][_0xc87d('0x4d')]?_0x352b5a[_0xc87d('0x42')]:_0x2023f6['model'];_0x352b5a[_0xc87d('0x6c')]=qs['sort'](_0x19550d[_0xc87d('0x3d')][_0xc87d('0x44')]);_0x352b5a[_0xc87d('0x45')]=qs['filters'](_[_0xc87d('0x64')](_0x19550d[_0xc87d('0x3d')],_0x2023f6['filters']));if(_0x19550d['query'][_0xc87d('0x2f')]){_0x352b5a[_0xc87d('0x45')]=_[_0xc87d('0x46')](_0x352b5a[_0xc87d('0x45')],{'$or':_[_0xc87d('0x47')](_0x352b5a[_0xc87d('0x42')],function(_0x89fa1c){var _0x20a443={};_0x20a443[_0x89fa1c]={'$like':'%'+_0x19550d[_0xc87d('0x3d')][_0xc87d('0x2f')]+'%'};return _0x20a443;})});}_0x352b5a=_[_0xc87d('0x46')]({},_0x352b5a,_0x19550d[_0xc87d('0x4f')]);return _0x4d8e8c['getLists'](_0x352b5a);}})[_0xc87d('0x28')](function(_0xb33b58){if(_0xb33b58){_0x16d8b0=_0xb33b58[_0xc87d('0x4d')];if(!_0x19550d[_0xc87d('0x3d')]['hasOwnProperty']('nolimit')){_0x352b5a[_0xc87d('0x23')]=qs[_0xc87d('0x23')](_0x19550d[_0xc87d('0x3d')][_0xc87d('0x23')]);_0x352b5a[_0xc87d('0x21')]=qs[_0xc87d('0x21')](_0x19550d[_0xc87d('0x3d')][_0xc87d('0x21')]);}return _0x4d8e8c[_0xc87d('0x99')](_0x352b5a);}})[_0xc87d('0x28')](function(_0x4d3819){if(_0x4d3819){return _0x4d3819?{'count':_0x16d8b0,'rows':_0x4d3819}:null;}})['then'](respondWithResult(_0x5b242a,null))[_0xc87d('0x4b')](handleError(_0x5b242a,null));};exports[_0xc87d('0x9a')]=function(_0x4f11a8,_0x4cdbfa,_0x297b7e){var _0x1ef3b7,_0xae61da;return db[_0xc87d('0x4a')][_0xc87d('0x56')]({'where':{'id':_0x4f11a8[_0xc87d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4cdbfa,null))[_0xc87d('0x28')](function(_0x1f83da){if(_0x1f83da){_0xae61da=_0x1f83da;return _0x1f83da[_0xc87d('0x9a')](_0x4f11a8['body'][_0xc87d('0x90')],_[_0xc87d('0x5b')](_0x4f11a8[_0xc87d('0x51')],[_0xc87d('0x90'),'id'])||{});}return null;})['spread'](function(_0x344329){var _0x5d11d0;_0x1ef3b7=_0x344329||[];var _0x426436=[];if(_0x344329){for(var _0x49c452=0x0;_0x49c452<_0x344329[_0xc87d('0x4d')];_0x49c452+=0x1){var _0x3dc775=_0x344329[_0x49c452][_0xc87d('0x2a')]({'plain':!![]});_0xae61da[_0xc87d('0x9b')]=_0x4f11a8[_0xc87d('0x51')]['dialCheckDuplicateType']?_0x4f11a8[_0xc87d('0x51')][_0xc87d('0x9b')]:_0xae61da[_0xc87d('0x9b')];switch(_0xae61da[_0xc87d('0x9b')]){case _0xc87d('0x9c'):_0x5d11d0=squel[_0xc87d('0x9d')]()[_0xc87d('0x9e')]('cm_hopper')[_0xc87d('0x9f')]([_0xc87d('0xa0'),_0xc87d('0xa1'),_0xc87d('0xa2'),_0xc87d('0xa3'),'VoiceQueueId','createdAt',_0xc87d('0x5a')],squel[_0xc87d('0xa4')]()[_0xc87d('0x86')](_0xc87d('0xa0'),'phone')['field']('NOW()','scheduledAt')['field']('id','ContactId')['field'](_0x3dc775[_0xc87d('0xa5')][_0xc87d('0x8b')](),_0xc87d('0xa3'))['field'](_0x4f11a8[_0xc87d('0x4c')]['id']['toString'](),_0xc87d('0x65'))['field'](_0xc87d('0xa6'),_0xc87d('0x5c'))[_0xc87d('0x86')](_0xc87d('0xa6'),_0xc87d('0x5a'))['from']('cm_contacts')[_0xc87d('0x45')](_0xc87d('0xa7'))[_0xc87d('0x45')](_0xc87d('0xa8'),_0x3dc775['CmListId'][_0xc87d('0x8b')]())[_0xc87d('0x45')](_0xc87d('0xa9'))[_0xc87d('0x45')](_0xc87d('0xaa'),squel[_0xc87d('0xa4')]()[_0xc87d('0x86')](_0xc87d('0xab'))[_0xc87d('0xac')](_0xc87d('0xad'))[_0xc87d('0x45')](_0xc87d('0xae'),_0x4f11a8[_0xc87d('0x4c')]['id'][_0xc87d('0x8b')]()))[_0xc87d('0x45')](_0xc87d('0xaa'),squel[_0xc87d('0xa4')]()[_0xc87d('0x86')](_0xc87d('0xaf'))[_0xc87d('0xac')](_0xc87d('0xb0'))[_0xc87d('0x45')](_0xc87d('0xae'),_0x4f11a8[_0xc87d('0x4c')]['id'][_0xc87d('0x8b')]())))[_0xc87d('0x8b')]();break;case _0xc87d('0xb1'):_0x5d11d0=squel['insert']()['into'](_0xc87d('0xb0'))[_0xc87d('0x9f')](['phone',_0xc87d('0xa1'),'ContactId',_0xc87d('0xa3'),_0xc87d('0x65'),'createdAt',_0xc87d('0x5a')],squel[_0xc87d('0xa4')]()[_0xc87d('0x86')](_0xc87d('0xa0'),_0xc87d('0xa0'))[_0xc87d('0x86')](_0xc87d('0xa6'),_0xc87d('0xa1'))[_0xc87d('0x86')]('id',_0xc87d('0xa2'))[_0xc87d('0x86')](_0x3dc775['CmListId'][_0xc87d('0x8b')](),_0xc87d('0xa3'))[_0xc87d('0x86')](_0x4f11a8[_0xc87d('0x4c')]['id']['toString'](),_0xc87d('0x65'))[_0xc87d('0x86')]('NOW()',_0xc87d('0x5c'))[_0xc87d('0x86')](_0xc87d('0xa6'),_0xc87d('0x5a'))[_0xc87d('0xac')]('cm_contacts')[_0xc87d('0x45')](_0xc87d('0xa7'))[_0xc87d('0x45')](_0xc87d('0xa8'),_0x3dc775[_0xc87d('0xa5')]['toString']())[_0xc87d('0x45')]('phone\x20IS\x20NOT\x20NULL')[_0xc87d('0x45')]('phone\x20NOT\x20IN\x20(?)',squel[_0xc87d('0xa4')]()[_0xc87d('0x86')](_0xc87d('0xaf'))['from'](_0xc87d('0xb0'))[_0xc87d('0x45')](_0xc87d('0xae'),_0x4f11a8['params']['id'][_0xc87d('0x8b')]())))[_0xc87d('0x8b')]();break;default:_0x5d11d0=squel['insert']()[_0xc87d('0x9e')](_0xc87d('0xb0'))[_0xc87d('0x9f')](['phone',_0xc87d('0xa1'),_0xc87d('0xa2'),_0xc87d('0xa3'),_0xc87d('0x65'),_0xc87d('0x5c'),_0xc87d('0x5a')],squel['select']()[_0xc87d('0x86')](_0xc87d('0xa0'),_0xc87d('0xa0'))[_0xc87d('0x86')](_0xc87d('0xa6'),_0xc87d('0xa1'))[_0xc87d('0x86')]('id',_0xc87d('0xa2'))['field'](_0x3dc775[_0xc87d('0xa5')][_0xc87d('0x8b')](),_0xc87d('0xa3'))[_0xc87d('0x86')](_0x4f11a8[_0xc87d('0x4c')]['id']['toString'](),_0xc87d('0x65'))[_0xc87d('0x86')](_0xc87d('0xa6'),_0xc87d('0x5c'))['field'](_0xc87d('0xa6'),'updatedAt')[_0xc87d('0xac')](_0xc87d('0xb2'))[_0xc87d('0x45')](_0xc87d('0xa7'))['where'](_0xc87d('0xa8'),_0x3dc775['CmListId'][_0xc87d('0x8b')]())[_0xc87d('0x45')]('phone\x20IS\x20NOT\x20NULL'))[_0xc87d('0x8b')]();}_0x426436[_0xc87d('0x8a')](db[_0xc87d('0x76')]['query'](_0x5d11d0));}return BPromise[_0xc87d('0x8e')](_0x426436);}})['then'](function(){return _0x1ef3b7;})['then'](respondWithResult(_0x4cdbfa,null))[_0xc87d('0x4b')](handleError(_0x4cdbfa,null));};exports['removeLists']=function(_0xa34b2c,_0x2f942f,_0x2e88e1){return db['VoiceQueue']['find']({'where':{'id':_0xa34b2c[_0xc87d('0x4c')]['id']}})[_0xc87d('0x28')](handleEntityNotFound(_0x2f942f,null))[_0xc87d('0x28')](function(_0x15d14a){if(_0x15d14a){return _0x15d14a['removeLists'](_0xa34b2c[_0xc87d('0x3d')]['ids']);}})[_0xc87d('0x28')](function(_0x41d697){if(_0x41d697){return db[_0xc87d('0x62')]['destroy']({'where':{'ListId':_0xa34b2c[_0xc87d('0x3d')]['ids'],'VoiceQueueId':_0xa34b2c[_0xc87d('0x4c')]['id']}})[_0xc87d('0x28')](function(){return _0x41d697;});}})['then'](respondWithStatusCode(_0x2f942f,null))[_0xc87d('0x4b')](handleError(_0x2f942f,null));};exports[_0xc87d('0xb3')]=function(_0x248d05,_0xe3ce4d,_0x1949e1){var _0x4c0d73={};var _0x553f08={};var _0x4aeead;var _0x4717d9;return db[_0xc87d('0x4a')][_0xc87d('0x61')]({'where':{'id':_0x248d05[_0xc87d('0x4c')]['id']}})[_0xc87d('0x28')](handleEntityNotFound(_0xe3ce4d,null))[_0xc87d('0x28')](function(_0x560b0a){if(_0x560b0a){_0x4aeead=_0x560b0a;_0x553f08['model']=_[_0xc87d('0x3e')](db['CmList'][_0xc87d('0x38')]);_0x553f08[_0xc87d('0x3d')]=_['keys'](_0x248d05[_0xc87d('0x3d')]);_0x553f08[_0xc87d('0x3f')]=_[_0xc87d('0x40')](_0x553f08['model'],_0x553f08['query']);_0x4c0d73[_0xc87d('0x42')]=_['intersection'](_0x553f08[_0xc87d('0x3c')],qs['fields'](_0x248d05[_0xc87d('0x3d')][_0xc87d('0x41')]));_0x4c0d73[_0xc87d('0x42')]=_0x4c0d73['attributes'][_0xc87d('0x4d')]?_0x4c0d73['attributes']:_0x553f08[_0xc87d('0x3c')];_0x4c0d73[_0xc87d('0x6c')]=qs[_0xc87d('0x44')](_0x248d05[_0xc87d('0x3d')][_0xc87d('0x44')]);_0x4c0d73[_0xc87d('0x45')]=qs[_0xc87d('0x3f')](_[_0xc87d('0x64')](_0x248d05[_0xc87d('0x3d')],_0x553f08[_0xc87d('0x3f')]));if(_0x248d05[_0xc87d('0x3d')]['filter']){_0x4c0d73[_0xc87d('0x45')]=_['merge'](_0x4c0d73[_0xc87d('0x45')],{'$or':_[_0xc87d('0x47')](_0x4c0d73[_0xc87d('0x42')],function(_0x192586){var _0x498dc6={};_0x498dc6[_0x192586]={'$like':'%'+_0x248d05['query'][_0xc87d('0x2f')]+'%'};return _0x498dc6;})});}_0x4c0d73=_[_0xc87d('0x46')]({},_0x4c0d73,_0x248d05[_0xc87d('0x4f')]);return _0x4aeead[_0xc87d('0xb3')](_0x4c0d73);}})[_0xc87d('0x28')](function(_0xb6a338){if(_0xb6a338){_0x4717d9=_0xb6a338['length'];if(!_0x248d05[_0xc87d('0x3d')]['hasOwnProperty'](_0xc87d('0x63'))){_0x4c0d73[_0xc87d('0x23')]=qs[_0xc87d('0x23')](_0x248d05[_0xc87d('0x3d')][_0xc87d('0x23')]);_0x4c0d73[_0xc87d('0x21')]=qs[_0xc87d('0x21')](_0x248d05['query'][_0xc87d('0x21')]);}return _0x4aeead[_0xc87d('0xb3')](_0x4c0d73);}})[_0xc87d('0x28')](function(_0x3f0acd){if(_0x3f0acd){return _0x3f0acd?{'count':_0x4717d9,'rows':_0x3f0acd}:null;}})[_0xc87d('0x28')](respondWithResult(_0xe3ce4d,null))[_0xc87d('0x4b')](handleError(_0xe3ce4d,null));};exports['addBlackLists']=function(_0x4cdf4e,_0x319c42,_0x4fed68){var _0x5d00c3,_0x31e8a4;return db[_0xc87d('0x4a')][_0xc87d('0x56')]({'where':{'id':_0x4cdf4e[_0xc87d('0x4c')]['id']}})[_0xc87d('0x28')](handleEntityNotFound(_0x319c42,null))[_0xc87d('0x28')](function(_0x5f3c5e){if(_0x5f3c5e){_0x31e8a4=_0x5f3c5e;return _0x5f3c5e[_0xc87d('0xb4')](_0x4cdf4e['body']['ids'],_[_0xc87d('0x5b')](_0x4cdf4e[_0xc87d('0x51')],['ids','id'])||{});}return null;})[_0xc87d('0xb5')](function(_0x535cac){var _0xb863b9;_0x5d00c3=_0x535cac||[];var _0x32ca3e=[];if(_0x535cac){for(var _0x121567=0x0;_0x121567<_0x535cac['length'];_0x121567+=0x1){var _0x18125f=_0x535cac[_0x121567]['get']({'plain':!![]});_0xb863b9=squel[_0xc87d('0x9d')]()[_0xc87d('0x9e')](_0xc87d('0xb6'))[_0xc87d('0x9f')](['phone','ContactId','ListId',_0xc87d('0x65'),_0xc87d('0x5c'),_0xc87d('0x5a')],squel[_0xc87d('0xa4')]()[_0xc87d('0x86')]('phone',_0xc87d('0xa0'))[_0xc87d('0x86')]('id',_0xc87d('0xa2'))[_0xc87d('0x86')](_0x18125f['CmListId']['toString'](),_0xc87d('0xa3'))['field'](_0x4cdf4e[_0xc87d('0x4c')]['id'][_0xc87d('0x8b')](),'VoiceQueueId')[_0xc87d('0x86')]('NOW()',_0xc87d('0x5c'))[_0xc87d('0x86')]('NOW()','updatedAt')[_0xc87d('0xac')](_0xc87d('0xb2'))['where'](_0xc87d('0xa7'))[_0xc87d('0x45')](_0xc87d('0xa8'),_0x18125f['CmListId'][_0xc87d('0x8b')]())[_0xc87d('0x45')](_0xc87d('0xa9')))[_0xc87d('0x8b')]();_0x32ca3e['push'](db[_0xc87d('0x76')][_0xc87d('0x3d')](_0xb863b9));}return BPromise[_0xc87d('0x8e')](_0x32ca3e);}})['then'](function(){return _0x5d00c3;})[_0xc87d('0x28')](respondWithResult(_0x319c42,null))[_0xc87d('0x4b')](handleError(_0x319c42,null));};exports[_0xc87d('0xb7')]=function(_0x2bac8e,_0x111749,_0x4d6652){return db[_0xc87d('0x4a')]['find']({'where':{'id':_0x2bac8e[_0xc87d('0x4c')]['id']}})[_0xc87d('0x28')](handleEntityNotFound(_0x111749,null))[_0xc87d('0x28')](function(_0x5bd53b){if(_0x5bd53b){return _0x5bd53b[_0xc87d('0xb7')](_0x2bac8e['query'][_0xc87d('0x90')]);}})[_0xc87d('0x28')](function(_0xcc20bd){if(_0xcc20bd){return db[_0xc87d('0x6e')][_0xc87d('0x29')]({'where':{'ListId':_0x2bac8e[_0xc87d('0x3d')][_0xc87d('0x90')],'VoiceQueueId':_0x2bac8e[_0xc87d('0x4c')]['id']}})['then'](function(){return _0xcc20bd;});}})['then'](respondWithStatusCode(_0x111749,null))[_0xc87d('0x4b')](handleError(_0x111749,null));};
\ No newline at end of file
+var _0x23e3=['isEmpty','removeAgents','emit','userVoiceQueue:remove','addAgents','spread','userVoiceQueue:save','UserVoiceQueueRt','all','isArray','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','always','into','fromQuery','phone','scheduledAt','ContactId','field','CmListId','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','insert','ListId','phone\x20IS\x20NOT\x20NULL','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voiceQueue.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','inbound','outbound','ignore','value','includes','type','find','name','UserProfileResource','destroy','sendStatus','error','stack','send','index','map','VoiceQueue','rawAttributes','key','model','query','intersection','attributes','fields','length','nolimit','order','where','filters','filter','merge','options','include','show','keys','includeAll','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','QueueCampaigns','UserProfileSection','userProfileId','autoAssociation','clone','params','omit','createdAt','updatedAt','VoiceQueues','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','CmHopper','hasOwnProperty','sort','pick','VoiceQueueId','findAll','rows','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','User','online','voicePause','interface','Agents','forEach','penalty','sequelize','transaction','each','upsert','UserVoiceQueue','findOrCreate','isNil','format','SIP/%s','removeTeams','ids','select','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','union','compact'];(function(_0x2fa355,_0x2345ec){var _0x1b7887=function(_0x144383){while(--_0x144383){_0x2fa355['push'](_0x2fa355['shift']());}};_0x1b7887(++_0x2345ec);}(_0x23e3,0x19b));var _0x323e=function(_0x2e0d08,_0x4fb8a8){_0x2e0d08=_0x2e0d08-0x0;var _0x556593=_0x23e3[_0x2e0d08];return _0x556593;};'use strict';var emlformat=require(_0x323e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x323e('0x1'));var rp=require(_0x323e('0x2'));var moment=require(_0x323e('0x3'));var BPromise=require(_0x323e('0x4'));var Mustache=require(_0x323e('0x5'));var util=require('util');var path=require('path');var sox=require(_0x323e('0x6'));var csv=require(_0x323e('0x7'));var ejs=require(_0x323e('0x8'));var fs=require('fs');var fs_extra=require(_0x323e('0x9'));var _=require(_0x323e('0xa'));var squel=require(_0x323e('0xb'));var crypto=require(_0x323e('0xc'));var jsforce=require(_0x323e('0xd'));var deskjs=require(_0x323e('0xe'));var toCsv=require(_0x323e('0x7'));var querystring=require(_0x323e('0xf'));var Papa=require(_0x323e('0x10'));var Redis=require(_0x323e('0x11'));var authService=require(_0x323e('0x12'));var qs=require(_0x323e('0x13'));var as=require(_0x323e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x323e('0x15'))('api');var utils=require(_0x323e('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x323e('0x17'));var db=require(_0x323e('0x18'))['db'];config[_0x323e('0x19')]=_[_0x323e('0x1a')](config[_0x323e('0x19')],{'host':_0x323e('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x323e('0x19')]));require(_0x323e('0x1c'))[_0x323e('0x1d')](socket);function respondWithStatusCode(_0x4a4ecd,_0x175721){_0x175721=_0x175721||0xcc;return function(_0x203763){if(_0x203763){return _0x4a4ecd['sendStatus'](_0x175721);}return _0x4a4ecd[_0x323e('0x1e')](_0x175721)[_0x323e('0x1f')]();};}function respondWithResult(_0x350707,_0x43638f){_0x43638f=_0x43638f||0xc8;return function(_0x3f45da){if(_0x3f45da){return _0x350707[_0x323e('0x1e')](_0x43638f)[_0x323e('0x20')](_0x3f45da);}};}function respondWithFilteredResult(_0x92da10,_0x1aaf29){return function(_0x57fbf5){if(_0x57fbf5){var _0x1bfa55=typeof _0x1aaf29[_0x323e('0x21')]===_0x323e('0x22')&&typeof _0x1aaf29[_0x323e('0x23')]===_0x323e('0x22');var _0x5c4bc7=_0x57fbf5[_0x323e('0x24')];var _0x1271b7=_0x1bfa55?0x0:_0x1aaf29[_0x323e('0x21')];var _0x545e25=_0x1bfa55?_0x57fbf5[_0x323e('0x24')]:_0x1aaf29[_0x323e('0x21')]+_0x1aaf29['limit'];var _0x23333d;if(_0x545e25>=_0x5c4bc7){_0x545e25=_0x5c4bc7;_0x23333d=0xc8;}else{_0x23333d=0xce;}_0x92da10[_0x323e('0x1e')](_0x23333d);return _0x92da10[_0x323e('0x25')](_0x323e('0x26'),_0x1271b7+'-'+_0x545e25+'/'+_0x5c4bc7)['json'](_0x57fbf5);}return null;};}function patchUpdates(_0x1e675c){return function(_0x275d23){try{jsonpatch[_0x323e('0x27')](_0x275d23,_0x1e675c,!![]);}catch(_0x55e765){return BPromise['reject'](_0x55e765);}return _0x275d23['save']();};}function saveUpdates(_0x2d6cc9,_0x348a74){return function(_0x5499f9){if(_0x5499f9){return _0x5499f9[_0x323e('0x28')](_0x2d6cc9)[_0x323e('0x29')](function(_0x4b45dd){return _0x4b45dd;});}return null;};}function removeEntity(_0xc9c327,_0x3726f9){return function(_0x33616b){if(_0x33616b){return _0x33616b['destroy']()[_0x323e('0x29')](function(){var _0x2f9b24=_0x33616b['get']({'plain':!![]});var _0x1bf0af=[{'name':'VoiceQueues','value':_0x323e('0x2a'),'ignore':![]},{'name':'QueueCampaigns','value':_0x323e('0x2b'),'ignore':![]}];var _0x1610af=_(_0x1bf0af)['filter'](_0x323e('0x2c'))['map'](_0x323e('0x2d'))[_0x323e('0x2d')]();if(_[_0x323e('0x2e')](_0x1610af,_0x2f9b24[_0x323e('0x2f')])){return;}var _0x3c9e65=_[_0x323e('0x30')](_0x1bf0af,[_0x323e('0x2d'),_0x2f9b24[_0x323e('0x2f')]])[_0x323e('0x31')];return db[_0x323e('0x32')][_0x323e('0x33')]({'where':{'type':_0x3c9e65,'resourceId':_0x2f9b24['id']}})[_0x323e('0x29')](function(){return _0x33616b;});})[_0x323e('0x29')](function(){_0xc9c327[_0x323e('0x1e')](0xcc)[_0x323e('0x1f')]();});}};}function handleEntityNotFound(_0x489b5d,_0x25a0ee){return function(_0x151c32){if(!_0x151c32){_0x489b5d[_0x323e('0x34')](0x194);}return _0x151c32;};}function handleError(_0xd1c1fa,_0x2fc49e){_0x2fc49e=_0x2fc49e||0x1f4;return function(_0x45fe06){logger[_0x323e('0x35')](_0x45fe06[_0x323e('0x36')]);if(_0x45fe06[_0x323e('0x31')]){delete _0x45fe06[_0x323e('0x31')];}_0xd1c1fa['status'](_0x2fc49e)[_0x323e('0x37')](_0x45fe06);};}exports[_0x323e('0x38')]=function(_0x553f0b,_0x1a094b){var _0x8402c2={},_0x569fd6={},_0x4f1eea={'count':0x0,'rows':[]};var _0x513d5c=_[_0x323e('0x39')](db[_0x323e('0x3a')][_0x323e('0x3b')],function(_0x36eaaa){return{'name':_0x36eaaa['fieldName'],'type':_0x36eaaa['type'][_0x323e('0x3c')]};});_0x569fd6[_0x323e('0x3d')]=_[_0x323e('0x39')](_0x513d5c,_0x323e('0x31'));_0x569fd6[_0x323e('0x3e')]=_['keys'](_0x553f0b[_0x323e('0x3e')]);_0x569fd6['filters']=_[_0x323e('0x3f')](_0x569fd6['model'],_0x569fd6[_0x323e('0x3e')]);_0x8402c2[_0x323e('0x40')]=_[_0x323e('0x3f')](_0x569fd6['model'],qs[_0x323e('0x41')](_0x553f0b[_0x323e('0x3e')][_0x323e('0x41')]));_0x8402c2['attributes']=_0x8402c2[_0x323e('0x40')][_0x323e('0x42')]?_0x8402c2[_0x323e('0x40')]:_0x569fd6[_0x323e('0x3d')];if(!_0x553f0b['query']['hasOwnProperty'](_0x323e('0x43'))){_0x8402c2['limit']=qs['limit'](_0x553f0b[_0x323e('0x3e')][_0x323e('0x23')]);_0x8402c2[_0x323e('0x21')]=qs['offset'](_0x553f0b[_0x323e('0x3e')]['offset']);}_0x8402c2[_0x323e('0x44')]=qs['sort'](_0x553f0b[_0x323e('0x3e')]['sort']);_0x8402c2[_0x323e('0x45')]=qs[_0x323e('0x46')](_['pick'](_0x553f0b[_0x323e('0x3e')],_0x569fd6[_0x323e('0x46')]),_0x513d5c);if(_0x553f0b[_0x323e('0x3e')][_0x323e('0x47')]){_0x8402c2[_0x323e('0x45')]=_[_0x323e('0x48')](_0x8402c2[_0x323e('0x45')],{'$or':_[_0x323e('0x39')](_0x513d5c,function(_0x289bab){if(_0x289bab['type']!=='VIRTUAL'){var _0x2cb9cd={};_0x2cb9cd[_0x289bab[_0x323e('0x31')]]={'$like':'%'+_0x553f0b[_0x323e('0x3e')][_0x323e('0x47')]+'%'};return _0x2cb9cd;}})});}_0x8402c2=_[_0x323e('0x48')]({},_0x8402c2,_0x553f0b[_0x323e('0x49')]);var _0x39a214={'where':_0x8402c2[_0x323e('0x45')]};return db['VoiceQueue'][_0x323e('0x24')](_0x39a214)[_0x323e('0x29')](function(_0x31743f){_0x4f1eea[_0x323e('0x24')]=_0x31743f;if(_0x553f0b[_0x323e('0x3e')]['includeAll']){_0x8402c2[_0x323e('0x4a')]=[{'all':!![]}];}return db['VoiceQueue']['findAll'](_0x8402c2);})[_0x323e('0x29')](function(_0x5f2313){_0x4f1eea['rows']=_0x5f2313;return _0x4f1eea;})[_0x323e('0x29')](respondWithFilteredResult(_0x1a094b,_0x8402c2))['catch'](handleError(_0x1a094b,null));};exports[_0x323e('0x4b')]=function(_0x3391ef,_0x34a7a3){var _0x37d7b0={'raw':![],'where':{'id':_0x3391ef['params']['id']}},_0x21f41c={};_0x21f41c[_0x323e('0x3d')]=_[_0x323e('0x4c')](db[_0x323e('0x3a')][_0x323e('0x3b')]);_0x21f41c[_0x323e('0x3e')]=_[_0x323e('0x4c')](_0x3391ef[_0x323e('0x3e')]);_0x21f41c[_0x323e('0x46')]=_[_0x323e('0x3f')](_0x21f41c[_0x323e('0x3d')],_0x21f41c[_0x323e('0x3e')]);_0x37d7b0[_0x323e('0x40')]=_[_0x323e('0x3f')](_0x21f41c[_0x323e('0x3d')],qs['fields'](_0x3391ef['query'][_0x323e('0x41')]));_0x37d7b0[_0x323e('0x40')]=_0x37d7b0[_0x323e('0x40')][_0x323e('0x42')]?_0x37d7b0[_0x323e('0x40')]:_0x21f41c[_0x323e('0x3d')];if(_0x3391ef['query'][_0x323e('0x4d')]){_0x37d7b0[_0x323e('0x4a')]=[{'all':!![]}];}_0x37d7b0=_[_0x323e('0x48')]({},_0x37d7b0,_0x3391ef[_0x323e('0x49')]);return db[_0x323e('0x3a')][_0x323e('0x30')](_0x37d7b0)[_0x323e('0x29')](handleEntityNotFound(_0x34a7a3,null))[_0x323e('0x29')](respondWithResult(_0x34a7a3,null))[_0x323e('0x4e')](handleError(_0x34a7a3,null));};exports[_0x323e('0x4f')]=function(_0x37dd53,_0x5099ae){return db[_0x323e('0x3a')]['create'](_0x37dd53[_0x323e('0x50')],{})[_0x323e('0x29')](function(_0x6246de){var _0x2930bb=_0x37dd53[_0x323e('0x51')][_0x323e('0x52')]({'plain':!![]});if(!_0x2930bb)throw new Error(_0x323e('0x53'));if(_0x2930bb[_0x323e('0x54')]===_0x323e('0x51')){var _0x3c69b2=_0x6246de[_0x323e('0x52')]({'plain':!![]});var _0x70c24f=[{'name':'VoiceQueues','value':_0x323e('0x2a')},{'name':_0x323e('0x55'),'value':_0x323e('0x2b')}];var _0x20e4b5=_[_0x323e('0x30')](_0x70c24f,[_0x323e('0x2d'),_0x3c69b2[_0x323e('0x2f')]])[_0x323e('0x31')];return db[_0x323e('0x56')]['find']({'where':{'name':_0x20e4b5,'userProfileId':_0x2930bb[_0x323e('0x57')]},'raw':!![]})[_0x323e('0x29')](function(_0x5e2dbb){if(_0x5e2dbb&&_0x5e2dbb[_0x323e('0x58')]===0x0){return db[_0x323e('0x32')][_0x323e('0x4f')]({'name':_0x3c69b2[_0x323e('0x31')],'resourceId':_0x3c69b2['id'],'type':_0x5e2dbb['name'],'sectionId':_0x5e2dbb['id']},{})[_0x323e('0x29')](function(){return _0x6246de;});}else{return _0x6246de;}})[_0x323e('0x4e')](function(_0x161d57){logger[_0x323e('0x35')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x161d57);throw _0x161d57;});}return _0x6246de;})[_0x323e('0x29')](respondWithResult(_0x5099ae,0xc9))[_0x323e('0x4e')](handleError(_0x5099ae,null));};exports[_0x323e('0x59')]=function(_0xd5552c,_0x5cee60){var _0x3e9d2e={'where':{'id':_0xd5552c[_0x323e('0x5a')]['id']}},_0x58fe90={};_0x58fe90['model']=_['keys'](db[_0x323e('0x3a')][_0x323e('0x3b')]);_0x3e9d2e[_0x323e('0x40')]=_[_0x323e('0x3f')](_0x58fe90[_0x323e('0x3d')],qs[_0x323e('0x41')](_0xd5552c['query']['fields']));_0x3e9d2e['attributes']=_0x3e9d2e[_0x323e('0x40')]['length']?_0x3e9d2e[_0x323e('0x40')]:_0x58fe90[_0x323e('0x3d')];if(_0xd5552c[_0x323e('0x3e')][_0x323e('0x4d')]){_0x3e9d2e[_0x323e('0x4a')]=[{'all':!![]}];}_0x3e9d2e=_[_0x323e('0x48')]({},_0x3e9d2e,_0xd5552c['options']);return db[_0x323e('0x3a')]['find'](_0x3e9d2e)[_0x323e('0x29')](handleEntityNotFound(_0x5cee60,null))[_0x323e('0x29')](function(_0x548f63){if(_0x548f63){var _0x2e4ef6=_0x548f63[_0x323e('0x52')]({'plain':!![]});_0x2e4ef6=qs[_0x323e('0x5b')](_0x2e4ef6,['id',_0x323e('0x5c'),'updatedAt']);_0xd5552c['body']=_[_0x323e('0x5b')](_0xd5552c[_0x323e('0x50')],['id','createdAt',_0x323e('0x5d')]);return db[_0x323e('0x3a')]['create'](_['merge'](_0x2e4ef6,_0xd5552c[_0x323e('0x50')]),{'include':_0xd5552c[_0x323e('0x3e')][_0x323e('0x4d')]?[{'all':!![]}]:undefined})[_0x323e('0x29')](function(_0x3deae9){var _0x2c2628=_0xd5552c[_0x323e('0x51')][_0x323e('0x52')]({'plain':!![]});if(!_0x2c2628)throw new Error(_0x323e('0x53'));if(_0x2c2628[_0x323e('0x54')]==='user'){var _0x2c8f49=_0x3deae9['get']({'plain':!![]});var _0x5f2f12=[{'name':_0x323e('0x5e'),'value':_0x323e('0x2a')},{'name':_0x323e('0x55'),'value':_0x323e('0x2b')}];var _0x421942=_[_0x323e('0x30')](_0x5f2f12,[_0x323e('0x2d'),_0x2c8f49[_0x323e('0x2f')]])[_0x323e('0x31')];return db[_0x323e('0x56')][_0x323e('0x30')]({'where':{'name':_0x421942,'userProfileId':_0x2c2628[_0x323e('0x57')]},'raw':!![]})[_0x323e('0x29')](function(_0x2b9317){if(_0x2b9317&&_0x2b9317[_0x323e('0x58')]===0x0){return db[_0x323e('0x32')][_0x323e('0x4f')]({'name':_0x2c8f49['name'],'resourceId':_0x2c8f49['id'],'type':_0x2b9317[_0x323e('0x31')],'sectionId':_0x2b9317['id']},{})[_0x323e('0x29')](function(){return _0x3deae9;});}else{return _0x3deae9;}})[_0x323e('0x4e')](function(_0x5836c3){logger[_0x323e('0x35')](_0x323e('0x5f'),_0x5836c3);throw _0x5836c3;});}return _0x3deae9;});}})['then'](respondWithResult(_0x5cee60,0xc9))[_0x323e('0x4e')](handleError(_0x5cee60,null));};exports[_0x323e('0x28')]=function(_0x85add2,_0x244748){if(_0x85add2[_0x323e('0x50')]['id']){delete _0x85add2[_0x323e('0x50')]['id'];}return db[_0x323e('0x3a')][_0x323e('0x30')]({'where':{'id':_0x85add2['params']['id']}})[_0x323e('0x29')](handleEntityNotFound(_0x244748,null))[_0x323e('0x29')](saveUpdates(_0x85add2['body'],null))[_0x323e('0x29')](respondWithResult(_0x244748,null))[_0x323e('0x4e')](handleError(_0x244748,null));};exports['destroy']=function(_0x1a5144,_0x4958c5){return db['VoiceQueue'][_0x323e('0x30')]({'where':{'id':_0x1a5144[_0x323e('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4958c5,null))[_0x323e('0x29')](removeEntity(_0x4958c5,null))[_0x323e('0x4e')](handleError(_0x4958c5,null));};exports['getHoppers']=function(_0x2a3b5f,_0x31dbe7,_0x574a0d){var _0x4b68dd={'raw':![],'where':{}};var _0x3c7d55={};var _0xdb85d5={'count':0x0,'rows':[]};return db[_0x323e('0x3a')][_0x323e('0x60')]({'where':{'id':_0x2a3b5f[_0x323e('0x5a')]['id']}})[_0x323e('0x29')](handleEntityNotFound(_0x31dbe7,null))[_0x323e('0x29')](function(_0x151feb){if(_0x151feb){_0x3c7d55[_0x323e('0x3d')]=_[_0x323e('0x4c')](db[_0x323e('0x61')]['rawAttributes']);_0x3c7d55[_0x323e('0x3e')]=_[_0x323e('0x4c')](_0x2a3b5f[_0x323e('0x3e')]);_0x3c7d55['filters']=_[_0x323e('0x3f')](_0x3c7d55[_0x323e('0x3d')],_0x3c7d55['query']);_0x4b68dd[_0x323e('0x40')]=_[_0x323e('0x3f')](_0x3c7d55[_0x323e('0x3d')],qs['fields'](_0x2a3b5f[_0x323e('0x3e')][_0x323e('0x41')]));_0x4b68dd[_0x323e('0x40')]=_0x4b68dd['attributes'][_0x323e('0x42')]?_0x4b68dd[_0x323e('0x40')]:_0x3c7d55[_0x323e('0x3d')];if(!_0x2a3b5f['query'][_0x323e('0x62')](_0x323e('0x43'))){_0x4b68dd[_0x323e('0x23')]=qs[_0x323e('0x23')](_0x2a3b5f[_0x323e('0x3e')]['limit']);_0x4b68dd[_0x323e('0x21')]=qs[_0x323e('0x21')](_0x2a3b5f['query'][_0x323e('0x21')]);}_0x4b68dd[_0x323e('0x44')]=qs[_0x323e('0x63')](_0x2a3b5f['query']['sort']);_0x4b68dd['where']=qs[_0x323e('0x46')](_[_0x323e('0x64')](_0x2a3b5f[_0x323e('0x3e')],_0x3c7d55['filters']));_0x4b68dd[_0x323e('0x45')][_0x323e('0x65')]=_0x151feb['id'];if(_0x2a3b5f['query'][_0x323e('0x47')]){_0x4b68dd[_0x323e('0x45')]=_[_0x323e('0x48')](_0x4b68dd['where'],{'$or':_[_0x323e('0x39')](_0x4b68dd[_0x323e('0x40')],function(_0x16d01d){var _0x4b2106={};_0x4b2106[_0x16d01d]={'$like':'%'+_0x2a3b5f[_0x323e('0x3e')]['filter']+'%'};return _0x4b2106;})});}_0x4b68dd=_['merge']({},_0x4b68dd,_0x2a3b5f[_0x323e('0x49')]);return db['CmHopper'][_0x323e('0x24')]({'where':_0x4b68dd[_0x323e('0x45')]})[_0x323e('0x29')](function(_0x16f729){_0xdb85d5[_0x323e('0x24')]=_0x16f729;if(_0x2a3b5f['query'][_0x323e('0x4d')]){_0x4b68dd[_0x323e('0x4a')]=[{'all':!![]}];}return db['CmHopper'][_0x323e('0x66')](_0x4b68dd);})[_0x323e('0x29')](function(_0x3c7a64){_0xdb85d5[_0x323e('0x67')]=_0x3c7a64;return _0xdb85d5;});}})[_0x323e('0x29')](respondWithFilteredResult(_0x31dbe7,_0x4b68dd))[_0x323e('0x4e')](handleError(_0x31dbe7,null));};exports['getHopperHistories']=function(_0x1d1a49,_0x4f5900,_0x20725d){var _0x256620={'raw':!![],'where':{}};var _0x221a96={};var _0x2e093d={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x323e('0x60')]({'where':{'id':_0x1d1a49[_0x323e('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4f5900,null))['then'](function(_0x23765c){if(_0x23765c){_0x221a96[_0x323e('0x3d')]=_[_0x323e('0x4c')](db['CmHopperHistory'][_0x323e('0x3b')]);_0x221a96['query']=_[_0x323e('0x4c')](_0x1d1a49[_0x323e('0x3e')]);_0x221a96['filters']=_[_0x323e('0x3f')](_0x221a96[_0x323e('0x3d')],_0x221a96[_0x323e('0x3e')]);_0x256620[_0x323e('0x40')]=_['intersection'](_0x221a96[_0x323e('0x3d')],qs[_0x323e('0x41')](_0x1d1a49[_0x323e('0x3e')][_0x323e('0x41')]));_0x256620[_0x323e('0x40')]=_0x256620['attributes'][_0x323e('0x42')]?_0x256620['attributes']:_0x221a96[_0x323e('0x3d')];if(!_0x1d1a49[_0x323e('0x3e')]['hasOwnProperty']('nolimit')){_0x256620[_0x323e('0x23')]=qs['limit'](_0x1d1a49[_0x323e('0x3e')]['limit']);_0x256620[_0x323e('0x21')]=qs['offset'](_0x1d1a49['query'][_0x323e('0x21')]);}_0x256620[_0x323e('0x44')]=qs['sort'](_0x1d1a49[_0x323e('0x3e')][_0x323e('0x63')]);_0x256620[_0x323e('0x45')]=qs[_0x323e('0x46')](_[_0x323e('0x64')](_0x1d1a49[_0x323e('0x3e')],_0x221a96[_0x323e('0x46')]));_0x256620[_0x323e('0x45')][_0x323e('0x65')]=_0x23765c['id'];if(_0x1d1a49[_0x323e('0x3e')]['filter']){_0x256620[_0x323e('0x45')]=_['merge'](_0x256620[_0x323e('0x45')],{'$or':_[_0x323e('0x39')](_0x256620[_0x323e('0x40')],function(_0x411d8e){var _0x5f2777={};_0x5f2777[_0x411d8e]={'$like':'%'+_0x1d1a49[_0x323e('0x3e')][_0x323e('0x47')]+'%'};return _0x5f2777;})});}_0x256620=_['merge']({},_0x256620,_0x1d1a49[_0x323e('0x49')]);return db[_0x323e('0x68')][_0x323e('0x24')]({'where':_0x256620[_0x323e('0x45')]})[_0x323e('0x29')](function(_0x1b92ab){_0x2e093d['count']=_0x1b92ab;if(_0x1d1a49[_0x323e('0x3e')]['includeAll']){_0x256620[_0x323e('0x4a')]=[{'all':!![]}];}return db[_0x323e('0x68')][_0x323e('0x66')](_0x256620);})[_0x323e('0x29')](function(_0x3ff866){_0x2e093d[_0x323e('0x67')]=_0x3ff866;return _0x2e093d;});}})['then'](respondWithFilteredResult(_0x4f5900,_0x256620))['catch'](handleError(_0x4f5900,null));};exports[_0x323e('0x69')]=function(_0x14075d,_0x8b3957,_0x3127b1){var _0x41a5fe={'raw':!![],'where':{}};var _0x3a13e5={};var _0x2ab1ee={'count':0x0,'rows':[]};return db[_0x323e('0x3a')][_0x323e('0x60')]({'where':{'id':_0x14075d[_0x323e('0x5a')]['id']}})[_0x323e('0x29')](handleEntityNotFound(_0x8b3957,null))['then'](function(_0x2a63eb){if(_0x2a63eb){_0x3a13e5[_0x323e('0x3d')]=_[_0x323e('0x4c')](db['CmHopperFinal'][_0x323e('0x3b')]);_0x3a13e5[_0x323e('0x3e')]=_[_0x323e('0x4c')](_0x14075d[_0x323e('0x3e')]);_0x3a13e5['filters']=_[_0x323e('0x3f')](_0x3a13e5['model'],_0x3a13e5[_0x323e('0x3e')]);_0x41a5fe[_0x323e('0x40')]=_[_0x323e('0x3f')](_0x3a13e5[_0x323e('0x3d')],qs[_0x323e('0x41')](_0x14075d['query'][_0x323e('0x41')]));_0x41a5fe[_0x323e('0x40')]=_0x41a5fe['attributes']['length']?_0x41a5fe['attributes']:_0x3a13e5[_0x323e('0x3d')];if(!_0x14075d[_0x323e('0x3e')][_0x323e('0x62')](_0x323e('0x43'))){_0x41a5fe['limit']=qs[_0x323e('0x23')](_0x14075d[_0x323e('0x3e')][_0x323e('0x23')]);_0x41a5fe[_0x323e('0x21')]=qs[_0x323e('0x21')](_0x14075d[_0x323e('0x3e')][_0x323e('0x21')]);}_0x41a5fe[_0x323e('0x44')]=qs['sort'](_0x14075d['query'][_0x323e('0x63')]);_0x41a5fe[_0x323e('0x45')]=qs[_0x323e('0x46')](_['pick'](_0x14075d[_0x323e('0x3e')],_0x3a13e5[_0x323e('0x46')]));_0x41a5fe[_0x323e('0x45')][_0x323e('0x65')]=_0x2a63eb['id'];if(_0x14075d['query'][_0x323e('0x47')]){_0x41a5fe[_0x323e('0x45')]=_[_0x323e('0x48')](_0x41a5fe[_0x323e('0x45')],{'$or':_[_0x323e('0x39')](_0x41a5fe['attributes'],function(_0x3fcb72){var _0xff923c={};_0xff923c[_0x3fcb72]={'$like':'%'+_0x14075d[_0x323e('0x3e')][_0x323e('0x47')]+'%'};return _0xff923c;})});}_0x41a5fe=_[_0x323e('0x48')]({},_0x41a5fe,_0x14075d[_0x323e('0x49')]);return db[_0x323e('0x6a')][_0x323e('0x24')]({'where':_0x41a5fe[_0x323e('0x45')]})['then'](function(_0xb38c46){_0x2ab1ee[_0x323e('0x24')]=_0xb38c46;if(_0x14075d['query'][_0x323e('0x4d')]){_0x41a5fe[_0x323e('0x4a')]=[{'all':!![]}];}return db[_0x323e('0x6a')]['findAll'](_0x41a5fe);})[_0x323e('0x29')](function(_0x1f56ed){_0x2ab1ee[_0x323e('0x67')]=_0x1f56ed;return _0x2ab1ee;});}})[_0x323e('0x29')](respondWithFilteredResult(_0x8b3957,_0x41a5fe))[_0x323e('0x4e')](handleError(_0x8b3957,null));};exports[_0x323e('0x6b')]=function(_0x1980c0,_0x49b0b6,_0x3f1b7b){var _0x2ab95e={'raw':!![],'where':{}};var _0x5dc98f={};var _0x1152e0={'count':0x0,'rows':[]};return db[_0x323e('0x3a')]['findOne']({'where':{'id':_0x1980c0[_0x323e('0x5a')]['id']}})[_0x323e('0x29')](handleEntityNotFound(_0x49b0b6,null))[_0x323e('0x29')](function(_0x5ee4d3){if(_0x5ee4d3){_0x5dc98f['model']=_[_0x323e('0x4c')](db['CmHopperBlack'][_0x323e('0x3b')]);_0x5dc98f[_0x323e('0x3e')]=_[_0x323e('0x4c')](_0x1980c0[_0x323e('0x3e')]);_0x5dc98f[_0x323e('0x46')]=_[_0x323e('0x3f')](_0x5dc98f[_0x323e('0x3d')],_0x5dc98f[_0x323e('0x3e')]);_0x2ab95e[_0x323e('0x40')]=_[_0x323e('0x3f')](_0x5dc98f[_0x323e('0x3d')],qs['fields'](_0x1980c0[_0x323e('0x3e')][_0x323e('0x41')]));_0x2ab95e[_0x323e('0x40')]=_0x2ab95e[_0x323e('0x40')]['length']?_0x2ab95e[_0x323e('0x40')]:_0x5dc98f[_0x323e('0x3d')];if(!_0x1980c0[_0x323e('0x3e')][_0x323e('0x62')](_0x323e('0x43'))){_0x2ab95e[_0x323e('0x23')]=qs[_0x323e('0x23')](_0x1980c0['query'][_0x323e('0x23')]);_0x2ab95e[_0x323e('0x21')]=qs[_0x323e('0x21')](_0x1980c0[_0x323e('0x3e')][_0x323e('0x21')]);}_0x2ab95e[_0x323e('0x44')]=qs[_0x323e('0x63')](_0x1980c0[_0x323e('0x3e')][_0x323e('0x63')]);_0x2ab95e[_0x323e('0x45')]=qs[_0x323e('0x46')](_[_0x323e('0x64')](_0x1980c0[_0x323e('0x3e')],_0x5dc98f['filters']));_0x2ab95e['where'][_0x323e('0x65')]=_0x5ee4d3['id'];if(_0x1980c0[_0x323e('0x3e')][_0x323e('0x47')]){_0x2ab95e[_0x323e('0x45')]=_[_0x323e('0x48')](_0x2ab95e[_0x323e('0x45')],{'$or':_[_0x323e('0x39')](_0x2ab95e[_0x323e('0x40')],function(_0x5307ff){var _0x54a0d0={};_0x54a0d0[_0x5307ff]={'$like':'%'+_0x1980c0['query']['filter']+'%'};return _0x54a0d0;})});}_0x2ab95e=_['merge']({},_0x2ab95e,_0x1980c0['options']);return db['CmHopperBlack'][_0x323e('0x24')]({'where':_0x2ab95e[_0x323e('0x45')]})[_0x323e('0x29')](function(_0x3fcdda){_0x1152e0['count']=_0x3fcdda;if(_0x1980c0['query'][_0x323e('0x4d')]){_0x2ab95e[_0x323e('0x4a')]=[{'all':!![]}];}return db[_0x323e('0x6c')][_0x323e('0x66')](_0x2ab95e);})['then'](function(_0x35e889){_0x1152e0[_0x323e('0x67')]=_0x35e889;return _0x1152e0;});}})[_0x323e('0x29')](respondWithFilteredResult(_0x49b0b6,_0x2ab95e))['catch'](handleError(_0x49b0b6,null));};exports[_0x323e('0x6d')]=function(_0x214ab1,_0x53d94a,_0x3bdab5){var _0x50efdd={};var _0x435fcb={};var _0x45a43f;var _0x154bd6;return db['VoiceQueue'][_0x323e('0x60')]({'where':{'id':_0x214ab1[_0x323e('0x5a')]['id']}})[_0x323e('0x29')](handleEntityNotFound(_0x53d94a,null))[_0x323e('0x29')](function(_0x4324a2){if(_0x4324a2){_0x45a43f=_0x4324a2;_0x435fcb['model']=_[_0x323e('0x4c')](db[_0x323e('0x6e')][_0x323e('0x3b')]);_0x435fcb[_0x323e('0x3e')]=_[_0x323e('0x4c')](_0x214ab1[_0x323e('0x3e')]);_0x435fcb[_0x323e('0x46')]=_[_0x323e('0x3f')](_0x435fcb['model'],_0x435fcb['query']);_0x50efdd['attributes']=_[_0x323e('0x3f')](_0x435fcb[_0x323e('0x3d')],qs[_0x323e('0x41')](_0x214ab1[_0x323e('0x3e')]['fields']));_0x50efdd['attributes']=_0x50efdd[_0x323e('0x40')][_0x323e('0x42')]?_0x50efdd['attributes']:_0x435fcb[_0x323e('0x3d')];_0x50efdd['order']=qs[_0x323e('0x63')](_0x214ab1['query'][_0x323e('0x63')]);_0x50efdd[_0x323e('0x45')]=qs[_0x323e('0x46')](_[_0x323e('0x64')](_0x214ab1[_0x323e('0x3e')],_0x435fcb[_0x323e('0x46')]));if(_0x214ab1[_0x323e('0x3e')][_0x323e('0x47')]){_0x50efdd['where']=_[_0x323e('0x48')](_0x50efdd[_0x323e('0x45')],{'$or':_[_0x323e('0x39')](_0x50efdd['attributes'],function(_0x3dad5a){var _0x6e85f1={};_0x6e85f1[_0x3dad5a]={'$like':'%'+_0x214ab1['query']['filter']+'%'};return _0x6e85f1;})});}_0x50efdd=_['merge']({},_0x50efdd,_0x214ab1['options']);return _0x45a43f[_0x323e('0x6d')](_0x50efdd);}})['then'](function(_0x35d966){if(_0x35d966){_0x154bd6=_0x35d966['length'];if(!_0x214ab1['query'][_0x323e('0x62')](_0x323e('0x43'))){_0x50efdd['limit']=qs[_0x323e('0x23')](_0x214ab1[_0x323e('0x3e')][_0x323e('0x23')]);_0x50efdd['offset']=qs['offset'](_0x214ab1[_0x323e('0x3e')][_0x323e('0x21')]);}return _0x45a43f['getTeams'](_0x50efdd);}})[_0x323e('0x29')](function(_0x500c29){if(_0x500c29){return _0x500c29?{'count':_0x154bd6,'rows':_0x500c29}:null;}})['then'](respondWithResult(_0x53d94a,null))['catch'](handleError(_0x53d94a,null));};exports['addTeams']=function(_0x40f833,_0x20b6b0,_0xc8a6eb){var _0x7e9c4=_0x40f833['body']['teams'];var _0x4e45e6=_[_0x323e('0x39')](_0x7e9c4,'id');return db['Team']['findAll']({'where':{'id':_0x4e45e6},'attributes':['id'],'include':[{'model':db[_0x323e('0x6f')],'as':'Agents','attributes':['id','name',_0x323e('0x70'),_0x323e('0x71'),_0x323e('0x72')],'raw':!![]}]})['then'](function(_0x1e1547){if(_0x1e1547){var _0x107d76=_['flatMap'](_0x1e1547,function(_0x2473a2){var _0x11b4fb=_0x2473a2[_0x323e('0x52')]({'plain':!![]});_0x11b4fb[_0x323e('0x73')][_0x323e('0x74')](function(_0x1c40a2){_0x1c40a2[_0x323e('0x75')]=_[_0x323e('0x30')](_0x7e9c4,{'id':_0x11b4fb['id']})[_0x323e('0x75')];});return _0x11b4fb[_0x323e('0x73')];});return db[_0x323e('0x3a')][_0x323e('0x30')]({'where':{'id':_0x40f833[_0x323e('0x5a')]['id']}})['then'](function(_0x34543a){return db[_0x323e('0x76')][_0x323e('0x77')](function(_0x31d74d){return _0x34543a['addTeams'](_0x4e45e6,{'transaction':_0x31d74d})[_0x323e('0x29')](function(){return BPromise[_0x323e('0x78')](_0x7e9c4,function(_0x421170){return db['TeamVoiceQueue'][_0x323e('0x79')]({'TeamId':_0x421170['id'],'VoiceQueueId':_0x40f833[_0x323e('0x5a')]['id'],'penalty':_0x421170['penalty']},{'transaction':_0x31d74d});});})[_0x323e('0x29')](function(){return BPromise[_0x323e('0x78')](_0x107d76,function(_0x1d9ecf){return db[_0x323e('0x7a')][_0x323e('0x7b')]({'where':{'UserId':_0x1d9ecf['id'],'VoiceQueueId':_0x40f833[_0x323e('0x5a')]['id']},'defaults':{'penalty':_0x1d9ecf[_0x323e('0x75')]},'transaction':_0x31d74d});});})[_0x323e('0x29')](function(){return BPromise[_0x323e('0x78')](_[_0x323e('0x47')](_0x107d76,{'online':!![]}),function(_0x5e1bc9){return db['UserVoiceQueueRt'][_0x323e('0x79')]({'membername':_0x5e1bc9['name'],'UserId':_0x5e1bc9['id'],'queue_name':_0x34543a[_0x323e('0x31')],'VoiceQueueId':_0x34543a['id'],'interface':_[_0x323e('0x7c')](_0x5e1bc9['interface'])?util[_0x323e('0x7d')](_0x323e('0x7e'),_0x5e1bc9['name']):_0x5e1bc9[_0x323e('0x72')],'paused':_0x5e1bc9[_0x323e('0x71')]||![],'penalty':_0x5e1bc9[_0x323e('0x75')]},{'transaction':_0x31d74d});});})[_0x323e('0x29')](function(){_0x107d76[_0x323e('0x74')](function(_0x196b50){socket['emit']('userVoiceQueue:save',{'UserId':_0x196b50['id'],'VoiceQueueId':_0x34543a['id']});});});});});}})[_0x323e('0x29')](respondWithStatusCode(_0x20b6b0,null))['catch'](handleError(_0x20b6b0,null));};exports[_0x323e('0x7f')]=function(_0x504d6b,_0x5225ca,_0x35c4e0){return db[_0x323e('0x6e')]['findAll']({'where':{'id':_0x504d6b[_0x323e('0x3e')][_0x323e('0x80')]},'attributes':['id'],'include':[{'model':db[_0x323e('0x6f')],'as':_0x323e('0x73'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5225ca,null))[_0x323e('0x29')](function(_0x590723){var _0x4a2dd7=_[_0x323e('0x39')](_0x590723,'id');var _0xe380ab=[];var _0xcb9558=[];var _0x57b304=squel[_0x323e('0x81')]();_0x57b304['field']('tq.TeamId')[_0x323e('0x82')](_0x323e('0x83'),'tq')[_0x323e('0x84')](_0x323e('0x85'),'ut',_0x323e('0x86'))[_0x323e('0x45')](_0x323e('0x87'),_0x504d6b[_0x323e('0x5a')]['id']);for(var _0xb17532=0x0;_0xb17532<_0x590723['length'];_0xb17532+=0x1){let _0xe60e53=_0x590723[_0xb17532];for(var _0x4036a8=0x0;_0x4036a8<_0xe60e53['Agents'][_0x323e('0x42')];_0x4036a8+=0x1){let _0x102f93=_0xe60e53[_0x323e('0x73')][_0x4036a8];var _0x3dbf61=_0x57b304['clone']();_0x3dbf61[_0x323e('0x45')]('ut.UserId\x20=\x20?',_0x102f93['id']);_0xcb9558[_0x323e('0x88')](db[_0x323e('0x76')]['query'](_0x3dbf61[_0x323e('0x89')](),{'type':db[_0x323e('0x76')][_0x323e('0x8a')][_0x323e('0x8b')]})[_0x323e('0x29')](function(_0x459ef6){if(_0x459ef6[_0x323e('0x42')]===0x1){return _0x102f93['id'];}else{var _0x33b262=_[_0x323e('0x8c')](_[_0x323e('0x39')](_0x459ef6,_0x323e('0x8d')),function(_0x33c889){return _['includes'](_0x4a2dd7,_0x33c889);});if(_0x33b262){return _0x102f93['id'];}}}));}}return BPromise['all'](_0xcb9558)[_0x323e('0x29')](function(_0x2ffec0){_0xe380ab=_(_0xe380ab)[_0x323e('0x8e')](_0x2ffec0)[_0x323e('0x8f')]()[_0x323e('0x2d')]();return db[_0x323e('0x3a')][_0x323e('0x30')]({'where':{'id':_0x504d6b[_0x323e('0x5a')]['id']}})[_0x323e('0x29')](function(_0xb13357){return db[_0x323e('0x76')]['transaction'](function(_0x1095f2){return _0xb13357[_0x323e('0x7f')](_0x504d6b[_0x323e('0x3e')][_0x323e('0x80')],{'transaction':_0x1095f2})[_0x323e('0x29')](function(){if(!_[_0x323e('0x90')](_0xe380ab)){return _0xb13357[_0x323e('0x91')](_0xe380ab,{'transaction':_0x1095f2})[_0x323e('0x29')](function(){return db['UserVoiceQueueRt'][_0x323e('0x33')]({'where':{'VoiceQueueId':_0x504d6b[_0x323e('0x5a')]['id'],'UserId':_0xe380ab},'transaction':_0x1095f2});});}})[_0x323e('0x29')](function(){_0xe380ab[_0x323e('0x74')](function(_0x5dbffc){socket[_0x323e('0x92')](_0x323e('0x93'),{'UserId':_0x5dbffc,'VoiceQueueId':_0xb13357['id']});});});});});});})[_0x323e('0x29')](respondWithStatusCode(_0x5225ca,null))[_0x323e('0x4e')](handleError(_0x5225ca,null));};exports[_0x323e('0x94')]=function(_0x534e9b,_0x2daf53,_0x640a51){var _0x45be91,_0x568ed8;return db['VoiceQueue'][_0x323e('0x30')]({'where':{'id':_0x534e9b[_0x323e('0x5a')]['id']}})[_0x323e('0x29')](handleEntityNotFound(_0x2daf53,null))[_0x323e('0x29')](function(_0x517149){if(_0x517149){_0x568ed8=_0x517149;return _0x517149[_0x323e('0x94')](_0x534e9b[_0x323e('0x50')][_0x323e('0x80')],_[_0x323e('0x5b')](_0x534e9b[_0x323e('0x50')],[_0x323e('0x80'),'id'])||{})[_0x323e('0x95')](function(_0x5c0bb1){for(var _0x338e47=0x0;_0x338e47<_0x534e9b[_0x323e('0x50')][_0x323e('0x80')]['length'];_0x338e47+=0x1){socket[_0x323e('0x92')](_0x323e('0x96'),{'UserId':Number(_0x534e9b[_0x323e('0x50')][_0x323e('0x80')][_0x338e47]),'VoiceQueueId':Number(_0x534e9b['params']['id'])});}return _0x5c0bb1;});}})[_0x323e('0x29')](function(_0x17074f){_0x45be91=_0x17074f||[];if(_0x568ed8){return db['User']['findAll']({'where':{'id':_0x534e9b[_0x323e('0x50')]['ids']},'attributes':['id',_0x323e('0x31'),_0x323e('0x70'),_0x323e('0x71'),'interface'],'raw':!![]});}})[_0x323e('0x29')](function(_0x34bbfc){if(!_['isEmpty'](_0x34bbfc)){var _0x4f9f99=[];for(var _0x5dd761=0x0;_0x5dd761<_0x34bbfc['length'];_0x5dd761++){if(_0x34bbfc[_0x5dd761][_0x323e('0x70')]){_0x4f9f99[_0x323e('0x88')](db[_0x323e('0x97')][_0x323e('0x79')]({'membername':_0x34bbfc[_0x5dd761][_0x323e('0x31')],'UserId':_0x34bbfc[_0x5dd761]['id'],'queue_name':_0x568ed8[_0x323e('0x31')],'VoiceQueueId':_0x568ed8['id'],'interface':_[_0x323e('0x7c')](_0x34bbfc[_0x5dd761]['interface'])?util[_0x323e('0x7d')](_0x323e('0x7e'),_0x34bbfc[_0x5dd761][_0x323e('0x31')]):_0x34bbfc[_0x5dd761][_0x323e('0x72')],'paused':_0x34bbfc[_0x5dd761][_0x323e('0x71')]||![],'penalty':_0x534e9b[_0x323e('0x50')][_0x323e('0x75')]||0x0}));}}return BPromise[_0x323e('0x98')](_0x4f9f99);}})['then'](function(){return _0x45be91;})[_0x323e('0x29')](respondWithResult(_0x2daf53,null))['catch'](handleError(_0x2daf53,null));};exports[_0x323e('0x91')]=function(_0x2e7b30,_0xaca419,_0xe13081){return db[_0x323e('0x3a')]['find']({'where':{'id':_0x2e7b30[_0x323e('0x5a')]['id']}})[_0x323e('0x29')](handleEntityNotFound(_0xaca419,null))[_0x323e('0x29')](function(_0x450aa6){if(_0x450aa6){return _0x450aa6[_0x323e('0x91')](_0x2e7b30[_0x323e('0x3e')][_0x323e('0x80')])[_0x323e('0x29')](function(){if(_[_0x323e('0x99')](_0x2e7b30[_0x323e('0x3e')][_0x323e('0x80')])){for(var _0x4f953b=0x0;_0x4f953b<_0x2e7b30[_0x323e('0x3e')][_0x323e('0x80')][_0x323e('0x42')];_0x4f953b+=0x1){socket[_0x323e('0x92')](_0x323e('0x93'),{'UserId':Number(_0x2e7b30['query'][_0x323e('0x80')][_0x4f953b]),'VoiceQueueId':Number(_0x2e7b30[_0x323e('0x5a')]['id'])});}}else{socket[_0x323e('0x92')]('userVoiceQueue:remove',{'UserId':Number(_0x2e7b30['query'][_0x323e('0x80')]),'VoiceQueueId':Number(_0x2e7b30[_0x323e('0x5a')]['id'])});}});}})[_0x323e('0x29')](function(_0x25f0f4){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x2e7b30[_0x323e('0x5a')]['id'],'UserId':_0x2e7b30[_0x323e('0x3e')][_0x323e('0x80')]}})[_0x323e('0x29')](function(){return _0x25f0f4;});})[_0x323e('0x29')](respondWithStatusCode(_0xaca419,null))[_0x323e('0x4e')](handleError(_0xaca419,null));};exports[_0x323e('0x9a')]=function(_0x3cc685,_0x4efb66,_0x2b4986){var _0x25dd5b={};var _0x146ccf={};var _0x1353f7;var _0xfcb262;return db['VoiceQueue']['findOne']({'where':{'id':_0x3cc685[_0x323e('0x5a')]['id']}})[_0x323e('0x29')](handleEntityNotFound(_0x4efb66,null))[_0x323e('0x29')](function(_0xca9a2b){if(_0xca9a2b){_0x1353f7=_0xca9a2b;_0x146ccf[_0x323e('0x3d')]=_[_0x323e('0x4c')](db[_0x323e('0x6f')][_0x323e('0x3b')]);_0x146ccf[_0x323e('0x3e')]=_[_0x323e('0x4c')](_0x3cc685[_0x323e('0x3e')]);_0x146ccf[_0x323e('0x46')]=_[_0x323e('0x3f')](_0x146ccf[_0x323e('0x3d')],_0x146ccf[_0x323e('0x3e')]);_0x25dd5b['attributes']=_[_0x323e('0x3f')](_0x146ccf[_0x323e('0x3d')],qs[_0x323e('0x41')](_0x3cc685[_0x323e('0x3e')][_0x323e('0x41')]));_0x25dd5b['attributes']=_0x25dd5b[_0x323e('0x40')][_0x323e('0x42')]?_0x25dd5b['attributes']:_0x146ccf[_0x323e('0x3d')];_0x25dd5b[_0x323e('0x44')]=qs[_0x323e('0x63')](_0x3cc685[_0x323e('0x3e')][_0x323e('0x63')]);_0x25dd5b[_0x323e('0x45')]=qs[_0x323e('0x46')](_[_0x323e('0x64')](_0x3cc685[_0x323e('0x3e')],_0x146ccf['filters']));if(_0x3cc685[_0x323e('0x3e')][_0x323e('0x47')]){_0x25dd5b[_0x323e('0x45')]=_[_0x323e('0x48')](_0x25dd5b['where'],{'$or':_[_0x323e('0x39')](_0x25dd5b[_0x323e('0x40')],function(_0x2c9c81){var _0x293e9b={};_0x293e9b[_0x2c9c81]={'$like':'%'+_0x3cc685[_0x323e('0x3e')][_0x323e('0x47')]+'%'};return _0x293e9b;})});}_0x25dd5b=_['merge']({},_0x25dd5b,_0x3cc685[_0x323e('0x49')]);return _0x1353f7[_0x323e('0x9a')](_0x25dd5b);}})[_0x323e('0x29')](function(_0x1a05e6){if(_0x1a05e6){_0xfcb262=_0x1a05e6[_0x323e('0x42')];if(!_0x3cc685['query'][_0x323e('0x62')](_0x323e('0x43'))){_0x25dd5b[_0x323e('0x23')]=qs[_0x323e('0x23')](_0x3cc685[_0x323e('0x3e')][_0x323e('0x23')]);_0x25dd5b[_0x323e('0x21')]=qs[_0x323e('0x21')](_0x3cc685[_0x323e('0x3e')][_0x323e('0x21')]);}return _0x1353f7[_0x323e('0x9a')](_0x25dd5b);}})[_0x323e('0x29')](function(_0x5e141c){if(_0x5e141c){return _0x5e141c?{'count':_0xfcb262,'rows':_0x5e141c}:null;}})[_0x323e('0x29')](respondWithResult(_0x4efb66,null))[_0x323e('0x4e')](handleError(_0x4efb66,null));};exports[_0x323e('0x9b')]=function(_0x3e98a9,_0x26df8e,_0x54d27d){var _0x580d56={};var _0x1840b3={};var _0x578104;var _0x3dc5c7;return db[_0x323e('0x3a')][_0x323e('0x60')]({'where':{'id':_0x3e98a9[_0x323e('0x5a')]['id']}})[_0x323e('0x29')](handleEntityNotFound(_0x26df8e,null))[_0x323e('0x29')](function(_0x582284){if(_0x582284){_0x578104=_0x582284;_0x1840b3[_0x323e('0x3d')]=_['keys'](db[_0x323e('0x97')][_0x323e('0x3b')]);_0x1840b3[_0x323e('0x3e')]=_[_0x323e('0x4c')](_0x3e98a9[_0x323e('0x3e')]);_0x1840b3[_0x323e('0x46')]=_[_0x323e('0x3f')](_0x1840b3['model'],_0x1840b3[_0x323e('0x3e')]);_0x580d56['attributes']=_[_0x323e('0x3f')](_0x1840b3[_0x323e('0x3d')],qs['fields'](_0x3e98a9[_0x323e('0x3e')][_0x323e('0x41')]));_0x580d56[_0x323e('0x40')]=_0x580d56[_0x323e('0x40')][_0x323e('0x42')]?_0x580d56[_0x323e('0x40')]:_0x1840b3['model'];_0x580d56[_0x323e('0x44')]=qs[_0x323e('0x63')](_0x3e98a9[_0x323e('0x3e')][_0x323e('0x63')]);_0x580d56[_0x323e('0x45')]=qs[_0x323e('0x46')](_[_0x323e('0x64')](_0x3e98a9[_0x323e('0x3e')],_0x1840b3[_0x323e('0x46')]));if(_0x3e98a9['query'][_0x323e('0x47')]){_0x580d56['where']=_[_0x323e('0x48')](_0x580d56[_0x323e('0x45')],{'$or':_[_0x323e('0x39')](_0x580d56[_0x323e('0x40')],function(_0x687a8a){var _0x4c25df={};_0x4c25df[_0x687a8a]={'$like':'%'+_0x3e98a9[_0x323e('0x3e')][_0x323e('0x47')]+'%'};return _0x4c25df;})});}_0x580d56=_['merge']({},_0x580d56,_0x3e98a9[_0x323e('0x49')]);return _0x578104[_0x323e('0x9b')](_0x580d56);}})[_0x323e('0x29')](function(_0x5c5d19){if(_0x5c5d19){_0x3dc5c7=_0x5c5d19[_0x323e('0x42')];if(!_0x3e98a9[_0x323e('0x3e')][_0x323e('0x62')]('nolimit')){_0x580d56[_0x323e('0x23')]=qs['limit'](_0x3e98a9[_0x323e('0x3e')][_0x323e('0x23')]);_0x580d56[_0x323e('0x21')]=qs[_0x323e('0x21')](_0x3e98a9[_0x323e('0x3e')][_0x323e('0x21')]);}return _0x578104[_0x323e('0x9b')](_0x580d56);}})[_0x323e('0x29')](function(_0x1fe4bf){return _0x1fe4bf?{'count':_0x3dc5c7,'rows':_0x1fe4bf}:null;})[_0x323e('0x29')](respondWithResult(_0x26df8e,null))['catch'](handleError(_0x26df8e,null));};exports['getLists']=function(_0x286831,_0xd59b96,_0x30f041){var _0x3bb0ae={};var _0x1ead42={};var _0x2d88a8;var _0x3cdf21;return db['VoiceQueue'][_0x323e('0x60')]({'where':{'id':_0x286831['params']['id']}})['then'](handleEntityNotFound(_0xd59b96,null))['then'](function(_0x23570b){if(_0x23570b){_0x2d88a8=_0x23570b;_0x1ead42[_0x323e('0x3d')]=_[_0x323e('0x4c')](db['CmList'][_0x323e('0x3b')]);_0x1ead42[_0x323e('0x3e')]=_[_0x323e('0x4c')](_0x286831[_0x323e('0x3e')]);_0x1ead42[_0x323e('0x46')]=_[_0x323e('0x3f')](_0x1ead42[_0x323e('0x3d')],_0x1ead42[_0x323e('0x3e')]);_0x3bb0ae[_0x323e('0x40')]=_[_0x323e('0x3f')](_0x1ead42[_0x323e('0x3d')],qs[_0x323e('0x41')](_0x286831[_0x323e('0x3e')][_0x323e('0x41')]));_0x3bb0ae[_0x323e('0x40')]=_0x3bb0ae[_0x323e('0x40')]['length']?_0x3bb0ae[_0x323e('0x40')]:_0x1ead42[_0x323e('0x3d')];_0x3bb0ae['order']=qs[_0x323e('0x63')](_0x286831[_0x323e('0x3e')]['sort']);_0x3bb0ae[_0x323e('0x45')]=qs['filters'](_[_0x323e('0x64')](_0x286831[_0x323e('0x3e')],_0x1ead42[_0x323e('0x46')]));if(_0x286831[_0x323e('0x3e')][_0x323e('0x47')]){_0x3bb0ae[_0x323e('0x45')]=_[_0x323e('0x48')](_0x3bb0ae[_0x323e('0x45')],{'$or':_[_0x323e('0x39')](_0x3bb0ae[_0x323e('0x40')],function(_0x3a060d){var _0x361ffb={};_0x361ffb[_0x3a060d]={'$like':'%'+_0x286831[_0x323e('0x3e')][_0x323e('0x47')]+'%'};return _0x361ffb;})});}_0x3bb0ae=_['merge']({},_0x3bb0ae,_0x286831[_0x323e('0x49')]);return _0x2d88a8[_0x323e('0x9c')](_0x3bb0ae);}})[_0x323e('0x29')](function(_0x5b5bd2){if(_0x5b5bd2){_0x3cdf21=_0x5b5bd2[_0x323e('0x42')];if(!_0x286831[_0x323e('0x3e')]['hasOwnProperty'](_0x323e('0x43'))){_0x3bb0ae[_0x323e('0x23')]=qs[_0x323e('0x23')](_0x286831['query'][_0x323e('0x23')]);_0x3bb0ae[_0x323e('0x21')]=qs[_0x323e('0x21')](_0x286831[_0x323e('0x3e')][_0x323e('0x21')]);}return _0x2d88a8[_0x323e('0x9c')](_0x3bb0ae);}})['then'](function(_0x2df562){if(_0x2df562){return _0x2df562?{'count':_0x3cdf21,'rows':_0x2df562}:null;}})[_0x323e('0x29')](respondWithResult(_0xd59b96,null))[_0x323e('0x4e')](handleError(_0xd59b96,null));};exports[_0x323e('0x9d')]=function(_0x71d006,_0x4463ea,_0xdc810b){var _0x5db545,_0x41ef4c;return db[_0x323e('0x3a')][_0x323e('0x30')]({'where':{'id':_0x71d006[_0x323e('0x5a')]['id']}})[_0x323e('0x29')](handleEntityNotFound(_0x4463ea,null))[_0x323e('0x29')](function(_0x578567){if(_0x578567){_0x41ef4c=_0x578567;return _0x578567[_0x323e('0x9d')](_0x71d006[_0x323e('0x50')][_0x323e('0x80')],_[_0x323e('0x5b')](_0x71d006['body'],['ids','id'])||{});}return null;})[_0x323e('0x95')](function(_0x42e715){var _0x5f2903;_0x5db545=_0x42e715||[];var _0x552807=[];if(_0x42e715){for(var _0x51c0f2=0x0;_0x51c0f2<_0x42e715[_0x323e('0x42')];_0x51c0f2+=0x1){var _0x215b62=_0x42e715[_0x51c0f2][_0x323e('0x52')]({'plain':!![]});_0x41ef4c[_0x323e('0x9e')]=_0x71d006[_0x323e('0x50')]['dialCheckDuplicateType']?_0x71d006[_0x323e('0x50')][_0x323e('0x9e')]:_0x41ef4c[_0x323e('0x9e')];switch(_0x41ef4c[_0x323e('0x9e')]){case _0x323e('0x9f'):_0x5f2903=squel['insert']()[_0x323e('0xa0')]('cm_hopper')[_0x323e('0xa1')]([_0x323e('0xa2'),_0x323e('0xa3'),_0x323e('0xa4'),'ListId',_0x323e('0x65'),_0x323e('0x5c'),'updatedAt'],squel[_0x323e('0x81')]()[_0x323e('0xa5')]('phone',_0x323e('0xa2'))[_0x323e('0xa5')]('NOW()',_0x323e('0xa3'))[_0x323e('0xa5')]('id',_0x323e('0xa4'))[_0x323e('0xa5')](_0x215b62[_0x323e('0xa6')][_0x323e('0x89')](),'ListId')['field'](_0x71d006[_0x323e('0x5a')]['id'][_0x323e('0x89')](),_0x323e('0x65'))[_0x323e('0xa5')](_0x323e('0xa7'),_0x323e('0x5c'))[_0x323e('0xa5')](_0x323e('0xa7'),_0x323e('0x5d'))[_0x323e('0x82')](_0x323e('0xa8'))['where'](_0x323e('0xa9'))['where'](_0x323e('0xaa'),_0x215b62[_0x323e('0xa6')]['toString']())[_0x323e('0x45')]('phone\x20IS\x20NOT\x20NULL')[_0x323e('0x45')](_0x323e('0xab'),squel[_0x323e('0x81')]()[_0x323e('0xa5')](_0x323e('0xac'))['from']('cm_hopper_final')[_0x323e('0x45')](_0x323e('0x87'),_0x71d006[_0x323e('0x5a')]['id'][_0x323e('0x89')]()))[_0x323e('0x45')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x323e('0xa5')](_0x323e('0xad'))[_0x323e('0x82')](_0x323e('0xae'))[_0x323e('0x45')](_0x323e('0x87'),_0x71d006['params']['id'][_0x323e('0x89')]())))[_0x323e('0x89')]();break;case _0x323e('0xaf'):_0x5f2903=squel[_0x323e('0xb0')]()[_0x323e('0xa0')](_0x323e('0xae'))['fromQuery']([_0x323e('0xa2'),_0x323e('0xa3'),_0x323e('0xa4'),'ListId',_0x323e('0x65'),_0x323e('0x5c'),_0x323e('0x5d')],squel[_0x323e('0x81')]()['field'](_0x323e('0xa2'),_0x323e('0xa2'))[_0x323e('0xa5')](_0x323e('0xa7'),'scheduledAt')[_0x323e('0xa5')]('id',_0x323e('0xa4'))[_0x323e('0xa5')](_0x215b62['CmListId'][_0x323e('0x89')](),'ListId')[_0x323e('0xa5')](_0x71d006[_0x323e('0x5a')]['id'][_0x323e('0x89')](),'VoiceQueueId')['field'](_0x323e('0xa7'),'createdAt')[_0x323e('0xa5')](_0x323e('0xa7'),_0x323e('0x5d'))[_0x323e('0x82')](_0x323e('0xa8'))[_0x323e('0x45')](_0x323e('0xa9'))[_0x323e('0x45')](_0x323e('0xaa'),_0x215b62[_0x323e('0xa6')][_0x323e('0x89')]())[_0x323e('0x45')]('phone\x20IS\x20NOT\x20NULL')[_0x323e('0x45')](_0x323e('0xab'),squel['select']()['field'](_0x323e('0xad'))[_0x323e('0x82')](_0x323e('0xae'))[_0x323e('0x45')](_0x323e('0x87'),_0x71d006[_0x323e('0x5a')]['id'][_0x323e('0x89')]())))[_0x323e('0x89')]();break;default:_0x5f2903=squel[_0x323e('0xb0')]()[_0x323e('0xa0')](_0x323e('0xae'))[_0x323e('0xa1')]([_0x323e('0xa2'),'scheduledAt',_0x323e('0xa4'),_0x323e('0xb1'),_0x323e('0x65'),_0x323e('0x5c'),_0x323e('0x5d')],squel[_0x323e('0x81')]()[_0x323e('0xa5')](_0x323e('0xa2'),_0x323e('0xa2'))[_0x323e('0xa5')](_0x323e('0xa7'),_0x323e('0xa3'))['field']('id',_0x323e('0xa4'))[_0x323e('0xa5')](_0x215b62['CmListId'][_0x323e('0x89')](),_0x323e('0xb1'))[_0x323e('0xa5')](_0x71d006['params']['id']['toString'](),_0x323e('0x65'))[_0x323e('0xa5')](_0x323e('0xa7'),_0x323e('0x5c'))[_0x323e('0xa5')](_0x323e('0xa7'),'updatedAt')[_0x323e('0x82')](_0x323e('0xa8'))['where'](_0x323e('0xa9'))[_0x323e('0x45')](_0x323e('0xaa'),_0x215b62[_0x323e('0xa6')][_0x323e('0x89')]())['where'](_0x323e('0xb2')))[_0x323e('0x89')]();}_0x552807[_0x323e('0x88')](db[_0x323e('0x76')][_0x323e('0x3e')](_0x5f2903));}return BPromise[_0x323e('0x98')](_0x552807);}})[_0x323e('0x29')](function(){return _0x5db545;})[_0x323e('0x29')](respondWithResult(_0x4463ea,null))['catch'](handleError(_0x4463ea,null));};exports[_0x323e('0xb3')]=function(_0x35fcf6,_0x14534a,_0x23842f){return db['VoiceQueue'][_0x323e('0x30')]({'where':{'id':_0x35fcf6[_0x323e('0x5a')]['id']}})['then'](handleEntityNotFound(_0x14534a,null))['then'](function(_0x2a600e){if(_0x2a600e){return _0x2a600e[_0x323e('0xb3')](_0x35fcf6[_0x323e('0x3e')]['ids']);}})[_0x323e('0x29')](function(_0x7d2d66){if(_0x7d2d66){return db[_0x323e('0x61')][_0x323e('0x33')]({'where':{'ListId':_0x35fcf6['query'][_0x323e('0x80')],'VoiceQueueId':_0x35fcf6[_0x323e('0x5a')]['id']}})[_0x323e('0x29')](function(){return _0x7d2d66;});}})[_0x323e('0x29')](respondWithStatusCode(_0x14534a,null))[_0x323e('0x4e')](handleError(_0x14534a,null));};exports[_0x323e('0xb4')]=function(_0x57c229,_0x41fc4c,_0x1eee16){var _0x40bf10={};var _0x428078={};var _0x2c9b5a;var _0x41eb6b;return db[_0x323e('0x3a')][_0x323e('0x60')]({'where':{'id':_0x57c229[_0x323e('0x5a')]['id']}})[_0x323e('0x29')](handleEntityNotFound(_0x41fc4c,null))[_0x323e('0x29')](function(_0x5134c7){if(_0x5134c7){_0x2c9b5a=_0x5134c7;_0x428078[_0x323e('0x3d')]=_[_0x323e('0x4c')](db[_0x323e('0xb5')][_0x323e('0x3b')]);_0x428078['query']=_[_0x323e('0x4c')](_0x57c229[_0x323e('0x3e')]);_0x428078[_0x323e('0x46')]=_[_0x323e('0x3f')](_0x428078['model'],_0x428078[_0x323e('0x3e')]);_0x40bf10[_0x323e('0x40')]=_['intersection'](_0x428078[_0x323e('0x3d')],qs['fields'](_0x57c229[_0x323e('0x3e')]['fields']));_0x40bf10['attributes']=_0x40bf10[_0x323e('0x40')][_0x323e('0x42')]?_0x40bf10['attributes']:_0x428078[_0x323e('0x3d')];_0x40bf10[_0x323e('0x44')]=qs[_0x323e('0x63')](_0x57c229[_0x323e('0x3e')][_0x323e('0x63')]);_0x40bf10[_0x323e('0x45')]=qs[_0x323e('0x46')](_['pick'](_0x57c229['query'],_0x428078[_0x323e('0x46')]));if(_0x57c229['query']['filter']){_0x40bf10['where']=_[_0x323e('0x48')](_0x40bf10['where'],{'$or':_[_0x323e('0x39')](_0x40bf10[_0x323e('0x40')],function(_0x1e7c4d){var _0x25d8e5={};_0x25d8e5[_0x1e7c4d]={'$like':'%'+_0x57c229['query'][_0x323e('0x47')]+'%'};return _0x25d8e5;})});}_0x40bf10=_['merge']({},_0x40bf10,_0x57c229[_0x323e('0x49')]);return _0x2c9b5a[_0x323e('0xb4')](_0x40bf10);}})[_0x323e('0x29')](function(_0x2b804d){if(_0x2b804d){_0x41eb6b=_0x2b804d[_0x323e('0x42')];if(!_0x57c229[_0x323e('0x3e')]['hasOwnProperty']('nolimit')){_0x40bf10['limit']=qs[_0x323e('0x23')](_0x57c229['query'][_0x323e('0x23')]);_0x40bf10[_0x323e('0x21')]=qs['offset'](_0x57c229[_0x323e('0x3e')][_0x323e('0x21')]);}return _0x2c9b5a[_0x323e('0xb4')](_0x40bf10);}})['then'](function(_0x367c0f){if(_0x367c0f){return _0x367c0f?{'count':_0x41eb6b,'rows':_0x367c0f}:null;}})['then'](respondWithResult(_0x41fc4c,null))[_0x323e('0x4e')](handleError(_0x41fc4c,null));};exports[_0x323e('0xb6')]=function(_0x1d6473,_0x1ccc9e,_0x41909f){var _0x5ab07e,_0x5afbca;return db[_0x323e('0x3a')]['find']({'where':{'id':_0x1d6473['params']['id']}})[_0x323e('0x29')](handleEntityNotFound(_0x1ccc9e,null))['then'](function(_0x3b81a4){if(_0x3b81a4){_0x5afbca=_0x3b81a4;return _0x3b81a4[_0x323e('0xb6')](_0x1d6473[_0x323e('0x50')][_0x323e('0x80')],_[_0x323e('0x5b')](_0x1d6473['body'],[_0x323e('0x80'),'id'])||{});}return null;})[_0x323e('0x95')](function(_0x5053bb){var _0x23c0f9;_0x5ab07e=_0x5053bb||[];var _0x1e358d=[];if(_0x5053bb){for(var _0x1746b6=0x0;_0x1746b6<_0x5053bb[_0x323e('0x42')];_0x1746b6+=0x1){var _0x3c8846=_0x5053bb[_0x1746b6][_0x323e('0x52')]({'plain':!![]});_0x23c0f9=squel[_0x323e('0xb0')]()[_0x323e('0xa0')](_0x323e('0xb7'))[_0x323e('0xa1')]([_0x323e('0xa2'),'ContactId','ListId',_0x323e('0x65'),_0x323e('0x5c'),_0x323e('0x5d')],squel[_0x323e('0x81')]()[_0x323e('0xa5')](_0x323e('0xa2'),_0x323e('0xa2'))[_0x323e('0xa5')]('id',_0x323e('0xa4'))['field'](_0x3c8846[_0x323e('0xa6')][_0x323e('0x89')](),_0x323e('0xb1'))['field'](_0x1d6473[_0x323e('0x5a')]['id']['toString'](),_0x323e('0x65'))[_0x323e('0xa5')](_0x323e('0xa7'),_0x323e('0x5c'))['field']('NOW()',_0x323e('0x5d'))[_0x323e('0x82')](_0x323e('0xa8'))[_0x323e('0x45')]('deletedAt\x20IS\x20NULL')['where'](_0x323e('0xaa'),_0x3c8846['CmListId'][_0x323e('0x89')]())[_0x323e('0x45')](_0x323e('0xb2')))['toString']();_0x1e358d['push'](db[_0x323e('0x76')][_0x323e('0x3e')](_0x23c0f9));}return BPromise['all'](_0x1e358d);}})['then'](function(){return _0x5ab07e;})['then'](respondWithResult(_0x1ccc9e,null))[_0x323e('0x4e')](handleError(_0x1ccc9e,null));};exports[_0x323e('0xb8')]=function(_0x5c65fa,_0x189dd4,_0x1eb5ac){return db[_0x323e('0x3a')]['find']({'where':{'id':_0x5c65fa[_0x323e('0x5a')]['id']}})[_0x323e('0x29')](handleEntityNotFound(_0x189dd4,null))['then'](function(_0x398f25){if(_0x398f25){return _0x398f25[_0x323e('0xb8')](_0x5c65fa[_0x323e('0x3e')]['ids']);}})[_0x323e('0x29')](function(_0x243e1a){if(_0x243e1a){return db[_0x323e('0x6c')][_0x323e('0x33')]({'where':{'ListId':_0x5c65fa[_0x323e('0x3e')][_0x323e('0x80')],'VoiceQueueId':_0x5c65fa[_0x323e('0x5a')]['id']}})[_0x323e('0x29')](function(){return _0x243e1a;});}})[_0x323e('0x29')](respondWithStatusCode(_0x189dd4,null))[_0x323e('0x4e')](handleError(_0x189dd4,null));};
\ No newline at end of file
index 43b9423..f62bca3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54ea=['update','remove','hook','exports','events','VoiceQueue','setMaxListeners','save'];(function(_0x1ae1fb,_0x81c2ec){var _0x57166=function(_0x48c137){while(--_0x48c137){_0x1ae1fb['push'](_0x1ae1fb['shift']());}};_0x57166(++_0x81c2ec);}(_0x54ea,0x1f4));var _0xa54e=function(_0x181759,_0x539f81){_0x181759=_0x181759-0x0;var _0x4a7806=_0x54ea[_0x181759];return _0x4a7806;};'use strict';var EventEmitter=require(_0xa54e('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0xa54e('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xa54e('0x2')](0x0);var events={'afterCreate':_0xa54e('0x3'),'afterUpdate':_0xa54e('0x4'),'afterDestroy':_0xa54e('0x5')};function emitEvent(_0x3b18db){return function(_0x286898,_0x30c830,_0x26af4a){VoiceQueueEvents['emit'](_0x3b18db+':'+_0x286898['id'],_0x286898);VoiceQueueEvents['emit'](_0x3b18db,_0x286898);_0x26af4a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xa54e('0x6')](e,emitEvent(event));}}module[_0xa54e('0x7')]=VoiceQueueEvents;
\ No newline at end of file
+var _0x8ee3=['hasOwnProperty','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','update','remove'];(function(_0x2d1e4d,_0x307ff6){var _0x6272e7=function(_0x2df480){while(--_0x2df480){_0x2d1e4d['push'](_0x2d1e4d['shift']());}};_0x6272e7(++_0x307ff6);}(_0x8ee3,0x11a));var _0x38ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ee3[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x38ee('0x0'));var VoiceQueue=require(_0x38ee('0x1'))['db'][_0x38ee('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x38ee('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x38ee('0x4'),'afterDestroy':_0x38ee('0x5')};function emitEvent(_0x229819){return function(_0xd3c3,_0x32715f,_0x2fbf99){VoiceQueueEvents['emit'](_0x229819+':'+_0xd3c3['id'],_0xd3c3);VoiceQueueEvents['emit'](_0x229819,_0xd3c3);_0x2fbf99(null);};}for(var e in events){if(events[_0x38ee('0x6')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x38ee('0x7')]=VoiceQueueEvents;
\ No newline at end of file
index 102f973..c44aa7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x20dd9b,_0x3c0fb8){var _0x2de3b0=function(_0x5673d2){while(--_0x5673d2){_0x20dd9b['push'](_0x20dd9b['shift']());}};_0x2de3b0(++_0x3c0fb8);}(_0x008c,0x188));var _0xc008=function(_0x1c3a1a,_0xfa88ee){_0x1c3a1a=_0x1c3a1a-0x0;var _0x37eb4e=_0x008c[_0x1c3a1a];return _0x37eb4e;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x4cce65,_0x40021e){var _0x4d1b45=function(_0x54d290){while(--_0x54d290){_0x4cce65['push'](_0x4cce65['shift']());}};_0x4d1b45(++_0x40021e);}(_0x008c,0x188));var _0xc008=function(_0x4a4d88,_0x2be95a){_0x4a4d88=_0x4a4d88-0x0;var _0x479329=_0x008c[_0x4a4d88];return _0x479329;};'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 6f844b3..4cf6cae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59f3=['defaults','socket.io-emitter','./voiceQueue.socket','register','then','info','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','GetVoiceQueue','VoiceQueue','options','where','attributes','limit','map','include','model','ShowVoiceQueue','find','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis'];(function(_0x8560d3,_0x26a504){var _0x33b1b5=function(_0x3a2cad){while(--_0x3a2cad){_0x8560d3['push'](_0x8560d3['shift']());}};_0x33b1b5(++_0x26a504);}(_0x59f3,0x133));var _0x359f=function(_0x2f31b1,_0x17daa8){_0x2f31b1=_0x2f31b1-0x0;var _0x448988=_0x59f3[_0x2f31b1];return _0x448988;};'use strict';var _=require(_0x359f('0x0'));var util=require(_0x359f('0x1'));var moment=require('moment');var BPromise=require(_0x359f('0x2'));var rs=require(_0x359f('0x3'));var fs=require('fs');var Redis=require(_0x359f('0x4'));var db=require(_0x359f('0x5'))['db'];var utils=require(_0x359f('0x6'));var logger=require(_0x359f('0x7'))('rpc');var config=require(_0x359f('0x8'));var jayson=require(_0x359f('0x9'));var client=jayson[_0x359f('0xa')][_0x359f('0xb')]({'port':0x232a});config[_0x359f('0xc')]=_[_0x359f('0xd')](config[_0x359f('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x359f('0xe'))(new Redis(config[_0x359f('0xc')]));require(_0x359f('0xf'))[_0x359f('0x10')](socket);function respondWithRpcPromise(_0x5715c0,_0x1cf5ed,_0x43f667){return new BPromise(function(_0xbfa764,_0x2b4f30){return client['request'](_0x5715c0,_0x43f667)[_0x359f('0x11')](function(_0x3672e5){logger[_0x359f('0x12')](_0x359f('0x13'),_0x1cf5ed,'request\x20sent');logger[_0x359f('0x14')](_0x359f('0x15'),_0x1cf5ed,'request\x20sent',JSON[_0x359f('0x16')](_0x3672e5));if(_0x3672e5[_0x359f('0x17')]){if(_0x3672e5['error'][_0x359f('0x18')]===0x1f4){logger[_0x359f('0x17')](_0x359f('0x13'),_0x1cf5ed,_0x3672e5[_0x359f('0x17')]['message']);return _0x2b4f30(_0x3672e5['error'][_0x359f('0x19')]);}logger[_0x359f('0x17')]('VoiceQueue,\x20%s,\x20%s',_0x1cf5ed,_0x3672e5['error']['message']);return _0xbfa764(_0x3672e5[_0x359f('0x17')][_0x359f('0x19')]);}else{logger[_0x359f('0x12')](_0x359f('0x13'),_0x1cf5ed,_0x359f('0x1a'));_0xbfa764(_0x3672e5['result'][_0x359f('0x19')]);}})[_0x359f('0x1b')](function(_0x48552a){logger[_0x359f('0x17')](_0x359f('0x13'),_0x1cf5ed,_0x48552a);_0x2b4f30(_0x48552a);});});}exports[_0x359f('0x1c')]=function(_0x29ea63){var _0x986338=this;return new Promise(function(_0x2df8bc,_0x25981){return db[_0x359f('0x1d')]['findAll']({'raw':_0x29ea63[_0x359f('0x1e')]?_0x29ea63['options']['raw']===undefined?!![]:![]:!![],'where':_0x29ea63[_0x359f('0x1e')]?_0x29ea63['options'][_0x359f('0x1f')]||null:null,'attributes':_0x29ea63['options']?_0x29ea63[_0x359f('0x1e')][_0x359f('0x20')]||null:null,'limit':_0x29ea63[_0x359f('0x1e')]?_0x29ea63['options'][_0x359f('0x21')]||null:null,'include':_0x29ea63[_0x359f('0x1e')]?_0x29ea63[_0x359f('0x1e')]['include']?_[_0x359f('0x22')](_0x29ea63[_0x359f('0x1e')][_0x359f('0x23')],function(_0x3d3ee1){return{'model':db[_0x3d3ee1[_0x359f('0x24')]],'as':_0x3d3ee1['as'],'attributes':_0x3d3ee1[_0x359f('0x20')],'include':_0x3d3ee1[_0x359f('0x23')]?_[_0x359f('0x22')](_0x3d3ee1[_0x359f('0x23')],function(_0x2b2b0e){return{'model':db[_0x2b2b0e[_0x359f('0x24')]],'as':_0x2b2b0e['as'],'attributes':_0x2b2b0e[_0x359f('0x20')],'include':_0x2b2b0e[_0x359f('0x23')]?_[_0x359f('0x22')](_0x2b2b0e[_0x359f('0x23')],function(_0x4d122c){return{'model':db[_0x4d122c[_0x359f('0x24')]],'as':_0x4d122c['as'],'attributes':_0x4d122c[_0x359f('0x20')]};}):[]};}):[]};}):[]:[]})[_0x359f('0x11')](function(_0x595184){logger[_0x359f('0x12')](_0x359f('0x1c'),_0x29ea63);logger[_0x359f('0x14')](_0x359f('0x1c'),_0x29ea63,JSON[_0x359f('0x16')](_0x595184));_0x2df8bc(_0x595184);})[_0x359f('0x1b')](function(_0x1d9f9a){logger[_0x359f('0x17')](_0x359f('0x1c'),_0x1d9f9a['message'],_0x29ea63);_0x25981(_0x986338['error'](0x1f4,_0x1d9f9a[_0x359f('0x19')]));});});};exports[_0x359f('0x25')]=function(_0x39f468){var _0x2535a8=this;return new Promise(function(_0x2e966e,_0x53b83e){return db[_0x359f('0x1d')][_0x359f('0x26')]({'raw':_0x39f468[_0x359f('0x1e')]?_0x39f468[_0x359f('0x1e')][_0x359f('0x27')]===undefined?!![]:![]:!![],'where':_0x39f468[_0x359f('0x1e')]?_0x39f468[_0x359f('0x1e')]['where']||null:null,'attributes':_0x39f468['options']?_0x39f468['options'][_0x359f('0x20')]||null:null,'include':_0x39f468[_0x359f('0x1e')]?_0x39f468[_0x359f('0x1e')][_0x359f('0x23')]?_[_0x359f('0x22')](_0x39f468[_0x359f('0x1e')][_0x359f('0x23')],function(_0x579fd9){return{'model':db[_0x579fd9[_0x359f('0x24')]],'as':_0x579fd9['as'],'attributes':_0x579fd9[_0x359f('0x20')],'include':_0x579fd9[_0x359f('0x23')]?_[_0x359f('0x22')](_0x579fd9[_0x359f('0x23')],function(_0x1f3eaa){return{'model':db[_0x1f3eaa['model']],'as':_0x1f3eaa['as'],'attributes':_0x1f3eaa['attributes'],'include':_0x1f3eaa[_0x359f('0x23')]?_['map'](_0x1f3eaa[_0x359f('0x23')],function(_0x3514dc){return{'model':db[_0x3514dc['model']],'as':_0x3514dc['as'],'attributes':_0x3514dc[_0x359f('0x20')]};}):[]};}):[]};}):[]:[]})[_0x359f('0x11')](function(_0x558de3){logger[_0x359f('0x12')](_0x359f('0x25'),_0x39f468);logger[_0x359f('0x14')]('ShowVoiceQueue',_0x39f468,JSON[_0x359f('0x16')](_0x558de3));_0x2e966e(_0x558de3);})['catch'](function(_0x4f4266){logger[_0x359f('0x17')]('ShowVoiceQueue',_0x4f4266[_0x359f('0x19')],_0x39f468);_0x53b83e(_0x2535a8['error'](0x1f4,_0x4f4266[_0x359f('0x19')]));});});};
\ No newline at end of file
+var _0xedde=['../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceQueue,\x20%s,\x20%s','message','result','catch','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','GetVoiceQueue','ShowVoiceQueue','find','moment','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x16b906,_0x12b7d4){var _0x300a0b=function(_0x38f3db){while(--_0x38f3db){_0x16b906['push'](_0x16b906['shift']());}};_0x300a0b(++_0x12b7d4);}(_0xedde,0x1cf));var _0xeedd=function(_0x2e8d36,_0x18b852){_0x2e8d36=_0x2e8d36-0x0;var _0x2e7551=_0xedde[_0x2e8d36];return _0x2e7551;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xeedd('0x0'));var BPromise=require('bluebird');var rs=require(_0xeedd('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeedd('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xeedd('0x3'))(_0xeedd('0x4'));var config=require(_0xeedd('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xeedd('0x6')]['http']({'port':0x232a});config[_0xeedd('0x7')]=_[_0xeedd('0x8')](config[_0xeedd('0x7')],{'host':_0xeedd('0x9'),'port':0x18eb});var socket=require(_0xeedd('0xa'))(new Redis(config[_0xeedd('0x7')]));require(_0xeedd('0xb'))[_0xeedd('0xc')](socket);function respondWithRpcPromise(_0x6dc3bd,_0x4b6a7e,_0x1cc859){return new BPromise(function(_0x4538e1,_0xf5a492){return client[_0xeedd('0xd')](_0x6dc3bd,_0x1cc859)[_0xeedd('0xe')](function(_0x2662a5){logger[_0xeedd('0xf')]('VoiceQueue,\x20%s,\x20%s',_0x4b6a7e,'request\x20sent');logger['debug'](_0xeedd('0x10'),_0x4b6a7e,_0xeedd('0x11'),JSON[_0xeedd('0x12')](_0x2662a5));if(_0x2662a5[_0xeedd('0x13')]){if(_0x2662a5[_0xeedd('0x13')][_0xeedd('0x14')]===0x1f4){logger['error'](_0xeedd('0x15'),_0x4b6a7e,_0x2662a5[_0xeedd('0x13')]['message']);return _0xf5a492(_0x2662a5['error'][_0xeedd('0x16')]);}logger[_0xeedd('0x13')](_0xeedd('0x15'),_0x4b6a7e,_0x2662a5[_0xeedd('0x13')][_0xeedd('0x16')]);return _0x4538e1(_0x2662a5['error'][_0xeedd('0x16')]);}else{logger[_0xeedd('0xf')](_0xeedd('0x15'),_0x4b6a7e,_0xeedd('0x11'));_0x4538e1(_0x2662a5[_0xeedd('0x17')][_0xeedd('0x16')]);}})[_0xeedd('0x18')](function(_0x1d6a82){logger[_0xeedd('0x13')](_0xeedd('0x15'),_0x4b6a7e,_0x1d6a82);_0xf5a492(_0x1d6a82);});});}exports['GetVoiceQueue']=function(_0x526cd3){var _0x2e5f26=this;return new Promise(function(_0x1e0e1c,_0x3efc7c){return db[_0xeedd('0x19')][_0xeedd('0x1a')]({'raw':_0x526cd3[_0xeedd('0x1b')]?_0x526cd3['options'][_0xeedd('0x1c')]===undefined?!![]:![]:!![],'where':_0x526cd3['options']?_0x526cd3[_0xeedd('0x1b')][_0xeedd('0x1d')]||null:null,'attributes':_0x526cd3['options']?_0x526cd3['options'][_0xeedd('0x1e')]||null:null,'limit':_0x526cd3[_0xeedd('0x1b')]?_0x526cd3[_0xeedd('0x1b')][_0xeedd('0x1f')]||null:null,'include':_0x526cd3['options']?_0x526cd3[_0xeedd('0x1b')][_0xeedd('0x20')]?_[_0xeedd('0x21')](_0x526cd3[_0xeedd('0x1b')]['include'],function(_0x3468b0){return{'model':db[_0x3468b0[_0xeedd('0x22')]],'as':_0x3468b0['as'],'attributes':_0x3468b0['attributes'],'include':_0x3468b0[_0xeedd('0x20')]?_[_0xeedd('0x21')](_0x3468b0['include'],function(_0x1c1020){return{'model':db[_0x1c1020[_0xeedd('0x22')]],'as':_0x1c1020['as'],'attributes':_0x1c1020[_0xeedd('0x1e')],'include':_0x1c1020[_0xeedd('0x20')]?_[_0xeedd('0x21')](_0x1c1020[_0xeedd('0x20')],function(_0xed87b4){return{'model':db[_0xed87b4[_0xeedd('0x22')]],'as':_0xed87b4['as'],'attributes':_0xed87b4[_0xeedd('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xeedd('0xe')](function(_0x39fea4){logger[_0xeedd('0xf')]('GetVoiceQueue',_0x526cd3);logger[_0xeedd('0x23')](_0xeedd('0x24'),_0x526cd3,JSON['stringify'](_0x39fea4));_0x1e0e1c(_0x39fea4);})[_0xeedd('0x18')](function(_0x4e99be){logger[_0xeedd('0x13')](_0xeedd('0x24'),_0x4e99be[_0xeedd('0x16')],_0x526cd3);_0x3efc7c(_0x2e5f26[_0xeedd('0x13')](0x1f4,_0x4e99be[_0xeedd('0x16')]));});});};exports[_0xeedd('0x25')]=function(_0x4e8210){var _0xc55c02=this;return new Promise(function(_0x5b1a09,_0x426c7e){return db[_0xeedd('0x19')][_0xeedd('0x26')]({'raw':_0x4e8210[_0xeedd('0x1b')]?_0x4e8210['options']['raw']===undefined?!![]:![]:!![],'where':_0x4e8210[_0xeedd('0x1b')]?_0x4e8210['options'][_0xeedd('0x1d')]||null:null,'attributes':_0x4e8210[_0xeedd('0x1b')]?_0x4e8210[_0xeedd('0x1b')][_0xeedd('0x1e')]||null:null,'include':_0x4e8210[_0xeedd('0x1b')]?_0x4e8210['options'][_0xeedd('0x20')]?_[_0xeedd('0x21')](_0x4e8210[_0xeedd('0x1b')][_0xeedd('0x20')],function(_0x4190a9){return{'model':db[_0x4190a9['model']],'as':_0x4190a9['as'],'attributes':_0x4190a9[_0xeedd('0x1e')],'include':_0x4190a9[_0xeedd('0x20')]?_[_0xeedd('0x21')](_0x4190a9[_0xeedd('0x20')],function(_0x3108fa){return{'model':db[_0x3108fa[_0xeedd('0x22')]],'as':_0x3108fa['as'],'attributes':_0x3108fa[_0xeedd('0x1e')],'include':_0x3108fa[_0xeedd('0x20')]?_[_0xeedd('0x21')](_0x3108fa[_0xeedd('0x20')],function(_0x41938c){return{'model':db[_0x41938c['model']],'as':_0x41938c['as'],'attributes':_0x41938c[_0xeedd('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xeedd('0xe')](function(_0x186bd0){logger['info'](_0xeedd('0x25'),_0x4e8210);logger[_0xeedd('0x23')](_0xeedd('0x25'),_0x4e8210,JSON[_0xeedd('0x12')](_0x186bd0));_0x5b1a09(_0x186bd0);})[_0xeedd('0x18')](function(_0x747b96){logger['error']('ShowVoiceQueue',_0x747b96[_0xeedd('0x16')],_0x4e8210);_0x426c7e(_0xc55c02[_0xeedd('0x13')](0x1f4,_0x747b96['message']));});});};
\ No newline at end of file
index c3ea6a5..0f7525c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe46f=['remove','update','emit','removeListener','register','length','voiceQueue:','./voiceQueue.events','save'];(function(_0x2c74af,_0x4ccc63){var _0x39eba1=function(_0x50b499){while(--_0x50b499){_0x2c74af['push'](_0x2c74af['shift']());}};_0x39eba1(++_0x4ccc63);}(_0xe46f,0xb2));var _0xfe46=function(_0x35db17,_0x8d64da){_0x35db17=_0x35db17-0x0;var _0x73f088=_0xe46f[_0x35db17];return _0x73f088;};'use strict';var VoiceQueueEvents=require(_0xfe46('0x0'));var events=[_0xfe46('0x1'),_0xfe46('0x2'),_0xfe46('0x3')];function createListener(_0x398f8d,_0x1aa764){return function(_0x40fa60){_0x1aa764[_0xfe46('0x4')](_0x398f8d,_0x40fa60);};}function removeListener(_0x64c171,_0x3c4568){return function(){VoiceQueueEvents[_0xfe46('0x5')](_0x64c171,_0x3c4568);};}exports[_0xfe46('0x6')]=function(_0x4fbe39){for(var _0xe789e4=0x0,_0x57a72b=events[_0xfe46('0x7')];_0xe789e4<_0x57a72b;_0xe789e4++){var _0x951023=events[_0xe789e4];var _0x484209=createListener(_0xfe46('0x8')+_0x951023,_0x4fbe39);VoiceQueueEvents['on'](_0x951023,_0x484209);}};
\ No newline at end of file
+var _0xb5ef=['voiceQueue:','./voiceQueue.events','save','remove','emit','removeListener','register'];(function(_0x480bc8,_0x1fac40){var _0x28c245=function(_0x22a049){while(--_0x22a049){_0x480bc8['push'](_0x480bc8['shift']());}};_0x28c245(++_0x1fac40);}(_0xb5ef,0x174));var _0xfb5e=function(_0x34a51c,_0x1d33b1){_0x34a51c=_0x34a51c-0x0;var _0x42a951=_0xb5ef[_0x34a51c];return _0x42a951;};'use strict';var VoiceQueueEvents=require(_0xfb5e('0x0'));var events=[_0xfb5e('0x1'),_0xfb5e('0x2'),'update'];function createListener(_0x4ac88e,_0x4a925b){return function(_0x2370cc){_0x4a925b[_0xfb5e('0x3')](_0x4ac88e,_0x2370cc);};}function removeListener(_0x20cad2,_0x5b5e49){return function(){VoiceQueueEvents[_0xfb5e('0x4')](_0x20cad2,_0x5b5e49);};}exports[_0xfb5e('0x5')]=function(_0x247032){for(var _0x294a9e=0x0,_0x53fec1=events['length'];_0x294a9e<_0x53fec1;_0x294a9e++){var _0x13f2d0=events[_0x294a9e];var _0x4909c3=createListener(_0xfb5e('0x6')+_0x13f2d0,_0x247032);VoiceQueueEvents['on'](_0x13f2d0,_0x4909c3);}};
\ No newline at end of file
index 0e7499d..fe2f139 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0cc3=['./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','/:id','show','create','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x0cc3,0xc9));var _0x30cc=function(_0x565ccd,_0x26bd28){_0x565ccd=_0x565ccd-0x0;var _0x1ee82b=_0x0cc3[_0x565ccd];return _0x1ee82b;};'use strict';var multer=require(_0x30cc('0x0'));var util=require(_0x30cc('0x1'));var path=require(_0x30cc('0x2'));var timeout=require(_0x30cc('0x3'));var express=require('express');var router=express[_0x30cc('0x4')]();var fs_extra=require(_0x30cc('0x5'));var auth=require(_0x30cc('0x6'));var interaction=require(_0x30cc('0x7'));var config=require(_0x30cc('0x8'));var controller=require(_0x30cc('0x9'));router[_0x30cc('0xa')]('/',auth[_0x30cc('0xb')](),controller[_0x30cc('0xc')]);router[_0x30cc('0xa')](_0x30cc('0xd'),auth[_0x30cc('0xb')](),controller[_0x30cc('0xe')]);router[_0x30cc('0xa')](_0x30cc('0xf'),auth[_0x30cc('0xb')](),controller['getVoiceQueuesReport']);router[_0x30cc('0xa')](_0x30cc('0x10'),auth[_0x30cc('0xb')](),controller[_0x30cc('0x11')]);router['post']('/',auth[_0x30cc('0xb')](),controller[_0x30cc('0x12')]);router['put'](_0x30cc('0x10'),auth[_0x30cc('0xb')](),controller[_0x30cc('0x13')]);router[_0x30cc('0x14')]('/:id',auth[_0x30cc('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x378b=['show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','/:id'];(function(_0x5a82b1,_0x187a2f){var _0x563732=function(_0x82f21d){while(--_0x82f21d){_0x5a82b1['push'](_0x5a82b1['shift']());}};_0x563732(++_0x187a2f);}(_0x378b,0xc7));var _0xb378=function(_0x50be52,_0x525a70){_0x50be52=_0x50be52-0x0;var _0x2bf2e0=_0x378b[_0x50be52];return _0x2bf2e0;};'use strict';var multer=require(_0xb378('0x0'));var util=require(_0xb378('0x1'));var path=require(_0xb378('0x2'));var timeout=require(_0xb378('0x3'));var express=require('express');var router=express[_0xb378('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb378('0x5'));var interaction=require(_0xb378('0x6'));var config=require(_0xb378('0x7'));var controller=require(_0xb378('0x8'));router[_0xb378('0x9')]('/',auth[_0xb378('0xa')](),controller[_0xb378('0xb')]);router[_0xb378('0x9')](_0xb378('0xc'),auth['isAuthenticated'](),controller[_0xb378('0xd')]);router[_0xb378('0x9')](_0xb378('0xe'),auth[_0xb378('0xa')](),controller[_0xb378('0xf')]);router[_0xb378('0x9')](_0xb378('0x10'),auth['isAuthenticated'](),controller[_0xb378('0x11')]);router['post']('/',auth[_0xb378('0xa')](),controller[_0xb378('0x12')]);router[_0xb378('0x13')](_0xb378('0x10'),auth['isAuthenticated'](),controller[_0xb378('0x14')]);router[_0xb378('0x15')](_0xb378('0x10'),auth[_0xb378('0xa')](),controller[_0xb378('0x16')]);module[_0xb378('0x17')]=router;
\ No newline at end of file
index 0528cb1..ec8d56a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f15=['BOOLEAN','DATE','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','holdtime','INTEGER'];(function(_0x317089,_0x34da97){var _0x614b82=function(_0x1ac371){while(--_0x1ac371){_0x317089['push'](_0x317089['shift']());}};_0x614b82(++_0x34da97);}(_0x4f15,0x121));var _0x54f1=function(_0x4e88a9,_0x4c5bbb){_0x4e88a9=_0x4e88a9-0x0;var _0x17994c=_0x4f15[_0x4e88a9];return _0x17994c;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x54f1('0x0')]={'type':{'type':Sequelize[_0x54f1('0x1')]},'uniqueid':{'type':Sequelize[_0x54f1('0x1')]},'calleridnum':{'type':Sequelize[_0x54f1('0x1')]},'calleridname':{'type':Sequelize[_0x54f1('0x1')]},'queue':{'type':Sequelize[_0x54f1('0x1')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x544419){var _0x3f8a25=moment(_0x544419);var _0x3f7f4b=moment(this[_0x54f1('0x2')](_0x54f1('0x3')))[_0x54f1('0x4')](_0x54f1('0x5'));var _0x3f5e8e=_0x3f8a25[_0x54f1('0x6')](_0x3f7f4b,_0x54f1('0x7'));this['setDataValue']('queuecallerleaveAt',_0x544419);this[_0x54f1('0x8')](_0x54f1('0x9'),_0x3f5e8e||null);}},'position':{'type':Sequelize[_0x54f1('0xa')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x54f1('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x54f1('0xc')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x54f1('0xc')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x54f1('0xd')},'originalposition':{'type':Sequelize[_0x54f1('0xa')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x54f1('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x54f1('0x1')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x54f1('0xa')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x54f1('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x54f1('0x1')],'comment':_0x54f1('0xe')},'transferexten':{'type':Sequelize[_0x54f1('0x1')]},'transferuniqueid':{'type':Sequelize[_0x54f1('0x1')]},'disposition':{'type':Sequelize[_0x54f1('0x1')]},'secondDisposition':{'type':Sequelize[_0x54f1('0x1')]},'thirdDisposition':{'type':Sequelize[_0x54f1('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0x54f1('0xa')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x263e=['format','YYYY-MM-DD\x20HH:mm:ss','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x263e,0x19e));var _0xe263=function(_0x52a6e3,_0x4a73b4){_0x52a6e3=_0x52a6e3-0x0;var _0x8910d0=_0x263e[_0x52a6e3];return _0x8910d0;};'use strict';var Sequelize=require(_0xe263('0x0'));var moment=require(_0xe263('0x1'));module[_0xe263('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xe263('0x3')]},'calleridname':{'type':Sequelize[_0xe263('0x3')]},'queue':{'type':Sequelize[_0xe263('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0xe263('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0xe263('0x4')],'set':function(_0x16a8a3){var _0x4a8190=moment(_0x16a8a3);var _0x326e5e=moment(this[_0xe263('0x5')]('queuecallerjoinAt'))[_0xe263('0x6')](_0xe263('0x7'));var _0xb59d1=_0x4a8190['diff'](_0x326e5e,'seconds');this[_0xe263('0x8')](_0xe263('0x9'),_0x16a8a3);this[_0xe263('0x8')](_0xe263('0xa'),_0xb59d1||null);}},'position':{'type':Sequelize[_0xe263('0xb')]},'count':{'type':Sequelize[_0xe263('0xb')]},'queuecallerabandon':{'type':Sequelize[_0xe263('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xe263('0x4')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xe263('0x4')]},'queuecallerexit':{'type':Sequelize[_0xe263('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xe263('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0xe263('0x3')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0xe263('0x3')]},'connectedlinenum':{'type':Sequelize[_0xe263('0x3')]},'connectedlinename':{'type':Sequelize[_0xe263('0x3')]},'accountcode':{'type':Sequelize[_0xe263('0x3')]},'context':{'type':Sequelize[_0xe263('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xe263('0x3')]},'holdtime':{'type':Sequelize[_0xe263('0xb')]},'mohtime':{'type':Sequelize[_0xe263('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xe263('0x3')]},'transfer':{'type':Sequelize[_0xe263('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xe263('0x3')],'comment':_0xe263('0xd')},'transferexten':{'type':Sequelize[_0xe263('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xe263('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 6108aa5..d3511e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb73b=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','save','update','destroy','then','end','error','stack','name','send','index','VoiceQueueReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','keys','catch','create','body','find','params','describe','hasOwnProperty','nolimit','findAll','getVoiceQueuesReport','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0x1b91c7,_0x539acd){var _0xbbe014=function(_0x57ff15){while(--_0x57ff15){_0x1b91c7['push'](_0x1b91c7['shift']());}};_0xbbe014(++_0x539acd);}(_0xb73b,0x1d0));var _0xbb73=function(_0x5e66a3,_0x473531){_0x5e66a3=_0x5e66a3-0x0;var _0x13d7e6=_0xb73b[_0x5e66a3];return _0x13d7e6;};'use strict';var emlformat=require(_0xbb73('0x0'));var rimraf=require(_0xbb73('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb73('0x2'));var rp=require(_0xbb73('0x3'));var moment=require(_0xbb73('0x4'));var BPromise=require(_0xbb73('0x5'));var Mustache=require(_0xbb73('0x6'));var util=require('util');var path=require(_0xbb73('0x7'));var sox=require('sox');var csv=require(_0xbb73('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb73('0x9'));var squel=require(_0xbb73('0xa'));var crypto=require(_0xbb73('0xb'));var jsforce=require(_0xbb73('0xc'));var deskjs=require(_0xbb73('0xd'));var toCsv=require(_0xbb73('0x8'));var querystring=require(_0xbb73('0xe'));var Papa=require('papaparse');var Redis=require(_0xbb73('0xf'));var authService=require(_0xbb73('0x10'));var qs=require(_0xbb73('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb73('0x12'));var logger=require(_0xbb73('0x13'))(_0xbb73('0x14'));var utils=require(_0xbb73('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xbb73('0x16')]=_[_0xbb73('0x17')](config[_0xbb73('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xbb73('0x18'))(new Redis(config[_0xbb73('0x16')]));require(_0xbb73('0x19'))[_0xbb73('0x1a')](socket);function respondWithStatusCode(_0x1ad771,_0x9cc989){_0x9cc989=_0x9cc989||0xcc;return function(_0x1d9f0f){if(_0x1d9f0f){return _0x1ad771[_0xbb73('0x1b')](_0x9cc989);}return _0x1ad771[_0xbb73('0x1c')](_0x9cc989)['end']();};}function respondWithResult(_0x18ff38,_0x244e96){_0x244e96=_0x244e96||0xc8;return function(_0x5e8c95){if(_0x5e8c95){return _0x18ff38['status'](_0x244e96)['json'](_0x5e8c95);}};}function respondWithFilteredResult(_0x52d8ec,_0x17fea6){return function(_0xa862e7){if(_0xa862e7){var _0x3b5745=typeof _0x17fea6[_0xbb73('0x1d')]===_0xbb73('0x1e')&&typeof _0x17fea6[_0xbb73('0x1f')]===_0xbb73('0x1e');var _0x41b308=_0xa862e7[_0xbb73('0x20')];var _0x441802=_0x3b5745?0x0:_0x17fea6[_0xbb73('0x1d')];var _0x183e5d=_0x3b5745?_0xa862e7['count']:_0x17fea6['offset']+_0x17fea6[_0xbb73('0x1f')];var _0x181684;if(_0x183e5d>=_0x41b308){_0x183e5d=_0x41b308;_0x181684=0xc8;}else{_0x181684=0xce;}_0x52d8ec[_0xbb73('0x1c')](_0x181684);return _0x52d8ec[_0xbb73('0x21')](_0xbb73('0x22'),_0x441802+'-'+_0x183e5d+'/'+_0x41b308)[_0xbb73('0x23')](_0xa862e7);}return null;};}function patchUpdates(_0x34ecfe){return function(_0x138e1d){try{jsonpatch['apply'](_0x138e1d,_0x34ecfe,!![]);}catch(_0x18249d){return BPromise['reject'](_0x18249d);}return _0x138e1d[_0xbb73('0x24')]();};}function saveUpdates(_0x3750d5,_0x2b2755){return function(_0xd13d98){if(_0xd13d98){return _0xd13d98[_0xbb73('0x25')](_0x3750d5)['then'](function(_0x5bcccf){return _0x5bcccf;});}return null;};}function removeEntity(_0x18678b,_0x7c79f1){return function(_0x31d96e){if(_0x31d96e){return _0x31d96e[_0xbb73('0x26')]()[_0xbb73('0x27')](function(){_0x18678b[_0xbb73('0x1c')](0xcc)[_0xbb73('0x28')]();});}};}function handleEntityNotFound(_0x5c3b26,_0x3fa7a4){return function(_0x4f8256){if(!_0x4f8256){_0x5c3b26[_0xbb73('0x1b')](0x194);}return _0x4f8256;};}function handleError(_0x1b944d,_0x5f1597){_0x5f1597=_0x5f1597||0x1f4;return function(_0x199b99){logger[_0xbb73('0x29')](_0x199b99[_0xbb73('0x2a')]);if(_0x199b99[_0xbb73('0x2b')]){delete _0x199b99[_0xbb73('0x2b')];}_0x1b944d[_0xbb73('0x1c')](_0x5f1597)[_0xbb73('0x2c')](_0x199b99);};}exports[_0xbb73('0x2d')]=function(_0x42a92e,_0x2fbddf){var _0x4b0856={},_0x1edac3={},_0x23ffc5={'count':0x0,'rows':[]};var _0x5672ff=_['map'](db[_0xbb73('0x2e')][_0xbb73('0x2f')],function(_0xc3db66){return{'name':_0xc3db66[_0xbb73('0x30')],'type':_0xc3db66[_0xbb73('0x31')][_0xbb73('0x32')]};});_0x1edac3[_0xbb73('0x33')]=_[_0xbb73('0x34')](_0x5672ff,_0xbb73('0x2b'));_0x1edac3['query']=_['keys'](_0x42a92e[_0xbb73('0x35')]);_0x1edac3[_0xbb73('0x36')]=_[_0xbb73('0x37')](_0x1edac3[_0xbb73('0x33')],_0x1edac3[_0xbb73('0x35')]);_0x4b0856[_0xbb73('0x38')]=_[_0xbb73('0x37')](_0x1edac3[_0xbb73('0x33')],qs['fields'](_0x42a92e[_0xbb73('0x35')][_0xbb73('0x39')]));_0x4b0856[_0xbb73('0x38')]=_0x4b0856[_0xbb73('0x38')][_0xbb73('0x3a')]?_0x4b0856['attributes']:_0x1edac3[_0xbb73('0x33')];if(!_0x42a92e[_0xbb73('0x35')]['hasOwnProperty']('nolimit')){_0x4b0856[_0xbb73('0x1f')]=qs[_0xbb73('0x1f')](_0x42a92e[_0xbb73('0x35')][_0xbb73('0x1f')]);_0x4b0856[_0xbb73('0x1d')]=qs[_0xbb73('0x1d')](_0x42a92e[_0xbb73('0x35')][_0xbb73('0x1d')]);}_0x4b0856['order']=qs[_0xbb73('0x3b')](_0x42a92e['query'][_0xbb73('0x3b')]);_0x4b0856[_0xbb73('0x3c')]=qs['filters'](_[_0xbb73('0x3d')](_0x42a92e[_0xbb73('0x35')],_0x1edac3[_0xbb73('0x36')]),_0x5672ff);if(_0x42a92e[_0xbb73('0x35')][_0xbb73('0x3e')]){_0x4b0856[_0xbb73('0x3c')]=_[_0xbb73('0x3f')](_0x4b0856[_0xbb73('0x3c')],{'$or':_[_0xbb73('0x34')](_0x5672ff,function(_0x56b886){if(_0x56b886[_0xbb73('0x31')]!==_0xbb73('0x40')){var _0x23a077={};_0x23a077[_0x56b886[_0xbb73('0x2b')]]={'$like':'%'+_0x42a92e[_0xbb73('0x35')]['filter']+'%'};return _0x23a077;}})});}_0x4b0856=_[_0xbb73('0x3f')]({},_0x4b0856,_0x42a92e[_0xbb73('0x41')]);var _0x5a8a8a={'where':_0x4b0856['where']};return db['VoiceQueueReport']['count'](_0x5a8a8a)[_0xbb73('0x27')](function(_0x4d87cc){_0x23ffc5[_0xbb73('0x20')]=_0x4d87cc;if(_0x42a92e['query'][_0xbb73('0x42')]){_0x4b0856[_0xbb73('0x43')]=[{'all':!![]}];}return db[_0xbb73('0x2e')]['findAll'](_0x4b0856);})['then'](function(_0x12eaca){_0x23ffc5[_0xbb73('0x44')]=_0x12eaca;return _0x23ffc5;})[_0xbb73('0x27')](respondWithFilteredResult(_0x2fbddf,_0x4b0856))['catch'](handleError(_0x2fbddf,null));};exports['show']=function(_0x524c3a,_0x5a3748){var _0x205797={'raw':![],'where':{'id':_0x524c3a['params']['id']}},_0x3cc98a={};_0x3cc98a['model']=_[_0xbb73('0x45')](db[_0xbb73('0x2e')][_0xbb73('0x2f')]);_0x3cc98a[_0xbb73('0x35')]=_[_0xbb73('0x45')](_0x524c3a[_0xbb73('0x35')]);_0x3cc98a[_0xbb73('0x36')]=_[_0xbb73('0x37')](_0x3cc98a[_0xbb73('0x33')],_0x3cc98a[_0xbb73('0x35')]);_0x205797[_0xbb73('0x38')]=_[_0xbb73('0x37')](_0x3cc98a[_0xbb73('0x33')],qs[_0xbb73('0x39')](_0x524c3a[_0xbb73('0x35')][_0xbb73('0x39')]));_0x205797['attributes']=_0x205797[_0xbb73('0x38')][_0xbb73('0x3a')]?_0x205797[_0xbb73('0x38')]:_0x3cc98a['model'];if(_0x524c3a['query'][_0xbb73('0x42')]){_0x205797['include']=[{'all':!![]}];}_0x205797=_[_0xbb73('0x3f')]({},_0x205797,_0x524c3a['options']);return db[_0xbb73('0x2e')]['find'](_0x205797)[_0xbb73('0x27')](handleEntityNotFound(_0x5a3748,null))['then'](respondWithResult(_0x5a3748,null))[_0xbb73('0x46')](handleError(_0x5a3748,null));};exports[_0xbb73('0x47')]=function(_0x252c8b,_0x27cd33){return db[_0xbb73('0x2e')]['create'](_0x252c8b[_0xbb73('0x48')],{})[_0xbb73('0x27')](respondWithResult(_0x27cd33,0xc9))[_0xbb73('0x46')](handleError(_0x27cd33,null));};exports[_0xbb73('0x25')]=function(_0x3ddfe5,_0x3c199f){if(_0x3ddfe5[_0xbb73('0x48')]['id']){delete _0x3ddfe5[_0xbb73('0x48')]['id'];}return db[_0xbb73('0x2e')][_0xbb73('0x49')]({'where':{'id':_0x3ddfe5['params']['id']}})[_0xbb73('0x27')](handleEntityNotFound(_0x3c199f,null))[_0xbb73('0x27')](saveUpdates(_0x3ddfe5['body'],null))[_0xbb73('0x27')](respondWithResult(_0x3c199f,null))['catch'](handleError(_0x3c199f,null));};exports[_0xbb73('0x26')]=function(_0x11067b,_0x37800e){return db[_0xbb73('0x2e')]['find']({'where':{'id':_0x11067b[_0xbb73('0x4a')]['id']}})['then'](handleEntityNotFound(_0x37800e,null))[_0xbb73('0x27')](removeEntity(_0x37800e,null))[_0xbb73('0x46')](handleError(_0x37800e,null));};exports[_0xbb73('0x4b')]=function(_0x53874d,_0x434270){return db[_0xbb73('0x2e')]['describe']()['then'](respondWithResult(_0x434270,null))['catch'](handleError(_0x434270,null));};exports['getVoiceQueuesReport']=function(_0x72648e,_0x598f19){var _0x2f6000={},_0x5ab6f1={},_0x3cfbe0={'count':0x0,'rows':[]};_0x5ab6f1[_0xbb73('0x33')]=_[_0xbb73('0x45')](db[_0xbb73('0x2e')]['rawAttributes']);_0x5ab6f1[_0xbb73('0x35')]=_['keys'](_0x72648e[_0xbb73('0x35')]);_0x5ab6f1[_0xbb73('0x36')]=_[_0xbb73('0x37')](_0x5ab6f1[_0xbb73('0x33')],_0x5ab6f1[_0xbb73('0x35')]);_0x2f6000[_0xbb73('0x38')]=_[_0xbb73('0x37')](_0x5ab6f1[_0xbb73('0x33')],qs[_0xbb73('0x39')](_0x72648e['query'][_0xbb73('0x39')]));_0x2f6000[_0xbb73('0x38')]=_0x2f6000[_0xbb73('0x38')]['length']?_0x2f6000[_0xbb73('0x38')]:_0x5ab6f1['model'];if(!_0x72648e['query'][_0xbb73('0x4c')](_0xbb73('0x4d'))){_0x2f6000[_0xbb73('0x1f')]=qs[_0xbb73('0x1f')](_0x72648e[_0xbb73('0x35')][_0xbb73('0x1f')]);_0x2f6000['offset']=qs['offset'](_0x72648e[_0xbb73('0x35')]['offset']);}_0x2f6000['order']=qs[_0xbb73('0x3b')](_0x72648e[_0xbb73('0x35')][_0xbb73('0x3b')]);_0x2f6000[_0xbb73('0x3c')]=qs['filters'](_[_0xbb73('0x3d')](_0x72648e['query'],_0x5ab6f1[_0xbb73('0x36')]));if(_0x72648e[_0xbb73('0x35')][_0xbb73('0x3e')]){_0x2f6000[_0xbb73('0x3c')]=_[_0xbb73('0x3f')](_0x2f6000[_0xbb73('0x3c')],{'$or':_[_0xbb73('0x34')](_0x2f6000[_0xbb73('0x38')],function(_0x1b24a0){var _0x16dedf={};_0x16dedf[_0x1b24a0]={'$like':'%'+_0x72648e[_0xbb73('0x35')][_0xbb73('0x3e')]+'%'};return _0x16dedf;})});}_0x2f6000=_['merge']({},_0x2f6000,_0x72648e[_0xbb73('0x41')]);var _0x23cda9={'where':_0x2f6000[_0xbb73('0x3c')]};return db[_0xbb73('0x2e')][_0xbb73('0x20')](_0x23cda9)[_0xbb73('0x27')](function(_0x70c299){_0x3cfbe0[_0xbb73('0x20')]=_0x70c299;if(_0x72648e[_0xbb73('0x35')][_0xbb73('0x42')]){_0x2f6000['include']=[{'all':!![]}];}return db[_0xbb73('0x2e')][_0xbb73('0x4e')](_0x2f6000);})[_0xbb73('0x27')](function(_0x206190){_0x3cfbe0[_0xbb73('0x44')]=_0x206190;return _0x3cfbe0;})[_0xbb73('0x27')](respondWithFilteredResult(_0x598f19,_0x2f6000,_0xbb73('0x4f')))['catch'](handleError(_0x598f19,null,_0xbb73('0x4f')));};
\ No newline at end of file
+var _0xcc26=['stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','find','create','catch','body','params','destroy','describe','getVoiceQueuesReport','order','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','redis','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then'];(function(_0x1bd227,_0x1519e9){var _0x3f3dcf=function(_0x182b0b){while(--_0x182b0b){_0x1bd227['push'](_0x1bd227['shift']());}};_0x3f3dcf(++_0x1519e9);}(_0xcc26,0x7e));var _0x6cc2=function(_0x324012,_0x23f45f){_0x324012=_0x324012-0x0;var _0x435cf2=_0xcc26[_0x324012];return _0x435cf2;};'use strict';var emlformat=require(_0x6cc2('0x0'));var rimraf=require(_0x6cc2('0x1'));var zipdir=require(_0x6cc2('0x2'));var jsonpatch=require(_0x6cc2('0x3'));var rp=require(_0x6cc2('0x4'));var moment=require('moment');var BPromise=require(_0x6cc2('0x5'));var Mustache=require(_0x6cc2('0x6'));var util=require(_0x6cc2('0x7'));var path=require('path');var sox=require(_0x6cc2('0x8'));var csv=require(_0x6cc2('0x9'));var ejs=require(_0x6cc2('0xa'));var fs=require('fs');var fs_extra=require(_0x6cc2('0xb'));var _=require(_0x6cc2('0xc'));var squel=require('squel');var crypto=require(_0x6cc2('0xd'));var jsforce=require(_0x6cc2('0xe'));var deskjs=require(_0x6cc2('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6cc2('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6cc2('0x11'));var qs=require(_0x6cc2('0x12'));var as=require(_0x6cc2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6cc2('0x14'))(_0x6cc2('0x15'));var utils=require(_0x6cc2('0x16'));var config=require(_0x6cc2('0x17'));var licenseUtil=require(_0x6cc2('0x18'));var db=require(_0x6cc2('0x19'))['db'];config['redis']=_[_0x6cc2('0x1a')](config['redis'],{'host':_0x6cc2('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6cc2('0x1c')]));require(_0x6cc2('0x1d'))[_0x6cc2('0x1e')](socket);function respondWithStatusCode(_0x2b0b70,_0x37da4d){_0x37da4d=_0x37da4d||0xcc;return function(_0x19460d){if(_0x19460d){return _0x2b0b70[_0x6cc2('0x1f')](_0x37da4d);}return _0x2b0b70[_0x6cc2('0x20')](_0x37da4d)[_0x6cc2('0x21')]();};}function respondWithResult(_0x4d4bcc,_0x1f0b0f){_0x1f0b0f=_0x1f0b0f||0xc8;return function(_0x370fc0){if(_0x370fc0){return _0x4d4bcc[_0x6cc2('0x20')](_0x1f0b0f)[_0x6cc2('0x22')](_0x370fc0);}};}function respondWithFilteredResult(_0x493cfd,_0x244260){return function(_0xf9bd11){if(_0xf9bd11){var _0x4f1748=typeof _0x244260[_0x6cc2('0x23')]===_0x6cc2('0x24')&&typeof _0x244260['limit']==='undefined';var _0x35e449=_0xf9bd11['count'];var _0x120e77=_0x4f1748?0x0:_0x244260[_0x6cc2('0x23')];var _0x4106d7=_0x4f1748?_0xf9bd11[_0x6cc2('0x25')]:_0x244260['offset']+_0x244260[_0x6cc2('0x26')];var _0x179a11;if(_0x4106d7>=_0x35e449){_0x4106d7=_0x35e449;_0x179a11=0xc8;}else{_0x179a11=0xce;}_0x493cfd[_0x6cc2('0x20')](_0x179a11);return _0x493cfd['set'](_0x6cc2('0x27'),_0x120e77+'-'+_0x4106d7+'/'+_0x35e449)['json'](_0xf9bd11);}return null;};}function patchUpdates(_0x237f42){return function(_0x1e5b85){try{jsonpatch[_0x6cc2('0x28')](_0x1e5b85,_0x237f42,!![]);}catch(_0x5454e6){return BPromise[_0x6cc2('0x29')](_0x5454e6);}return _0x1e5b85['save']();};}function saveUpdates(_0x56dcef,_0x573400){return function(_0x3d30a2){if(_0x3d30a2){return _0x3d30a2[_0x6cc2('0x2a')](_0x56dcef)['then'](function(_0x14e88f){return _0x14e88f;});}return null;};}function removeEntity(_0x3a94f5,_0x3844fc){return function(_0xd95bfe){if(_0xd95bfe){return _0xd95bfe['destroy']()[_0x6cc2('0x2b')](function(){_0x3a94f5[_0x6cc2('0x20')](0xcc)[_0x6cc2('0x21')]();});}};}function handleEntityNotFound(_0x16240d,_0x52ed01){return function(_0x56e6c5){if(!_0x56e6c5){_0x16240d[_0x6cc2('0x1f')](0x194);}return _0x56e6c5;};}function handleError(_0x416294,_0x2a4765){_0x2a4765=_0x2a4765||0x1f4;return function(_0x31022f){logger['error'](_0x31022f[_0x6cc2('0x2c')]);if(_0x31022f[_0x6cc2('0x2d')]){delete _0x31022f['name'];}_0x416294[_0x6cc2('0x20')](_0x2a4765)[_0x6cc2('0x2e')](_0x31022f);};}exports[_0x6cc2('0x2f')]=function(_0x1ab368,_0x215e63){var _0xc731f8={},_0x5da62a={},_0x2f0ea8={'count':0x0,'rows':[]};var _0x30dc50=_[_0x6cc2('0x30')](db[_0x6cc2('0x31')][_0x6cc2('0x32')],function(_0xdb3c2e){return{'name':_0xdb3c2e[_0x6cc2('0x33')],'type':_0xdb3c2e[_0x6cc2('0x34')][_0x6cc2('0x35')]};});_0x5da62a[_0x6cc2('0x36')]=_['map'](_0x30dc50,_0x6cc2('0x2d'));_0x5da62a[_0x6cc2('0x37')]=_[_0x6cc2('0x38')](_0x1ab368[_0x6cc2('0x37')]);_0x5da62a[_0x6cc2('0x39')]=_[_0x6cc2('0x3a')](_0x5da62a[_0x6cc2('0x36')],_0x5da62a['query']);_0xc731f8['attributes']=_[_0x6cc2('0x3a')](_0x5da62a['model'],qs[_0x6cc2('0x3b')](_0x1ab368[_0x6cc2('0x37')][_0x6cc2('0x3b')]));_0xc731f8[_0x6cc2('0x3c')]=_0xc731f8[_0x6cc2('0x3c')][_0x6cc2('0x3d')]?_0xc731f8[_0x6cc2('0x3c')]:_0x5da62a[_0x6cc2('0x36')];if(!_0x1ab368['query'][_0x6cc2('0x3e')](_0x6cc2('0x3f'))){_0xc731f8[_0x6cc2('0x26')]=qs[_0x6cc2('0x26')](_0x1ab368['query'][_0x6cc2('0x26')]);_0xc731f8[_0x6cc2('0x23')]=qs[_0x6cc2('0x23')](_0x1ab368[_0x6cc2('0x37')][_0x6cc2('0x23')]);}_0xc731f8['order']=qs[_0x6cc2('0x40')](_0x1ab368[_0x6cc2('0x37')]['sort']);_0xc731f8[_0x6cc2('0x41')]=qs['filters'](_[_0x6cc2('0x42')](_0x1ab368[_0x6cc2('0x37')],_0x5da62a[_0x6cc2('0x39')]),_0x30dc50);if(_0x1ab368[_0x6cc2('0x37')][_0x6cc2('0x43')]){_0xc731f8[_0x6cc2('0x41')]=_[_0x6cc2('0x44')](_0xc731f8['where'],{'$or':_[_0x6cc2('0x30')](_0x30dc50,function(_0x3dbbb8){if(_0x3dbbb8[_0x6cc2('0x34')]!==_0x6cc2('0x45')){var _0x6f08b6={};_0x6f08b6[_0x3dbbb8[_0x6cc2('0x2d')]]={'$like':'%'+_0x1ab368[_0x6cc2('0x37')][_0x6cc2('0x43')]+'%'};return _0x6f08b6;}})});}_0xc731f8=_['merge']({},_0xc731f8,_0x1ab368[_0x6cc2('0x46')]);var _0xb44eda={'where':_0xc731f8['where']};return db[_0x6cc2('0x31')]['count'](_0xb44eda)['then'](function(_0x5295f0){_0x2f0ea8[_0x6cc2('0x25')]=_0x5295f0;if(_0x1ab368[_0x6cc2('0x37')][_0x6cc2('0x47')]){_0xc731f8[_0x6cc2('0x48')]=[{'all':!![]}];}return db[_0x6cc2('0x31')]['findAll'](_0xc731f8);})[_0x6cc2('0x2b')](function(_0x2d6681){_0x2f0ea8[_0x6cc2('0x49')]=_0x2d6681;return _0x2f0ea8;})[_0x6cc2('0x2b')](respondWithFilteredResult(_0x215e63,_0xc731f8))['catch'](handleError(_0x215e63,null));};exports[_0x6cc2('0x4a')]=function(_0x4816bc,_0x517f6c){var _0x23b72f={'raw':![],'where':{'id':_0x4816bc['params']['id']}},_0x49f0ec={};_0x49f0ec['model']=_['keys'](db[_0x6cc2('0x31')][_0x6cc2('0x32')]);_0x49f0ec['query']=_[_0x6cc2('0x38')](_0x4816bc[_0x6cc2('0x37')]);_0x49f0ec[_0x6cc2('0x39')]=_['intersection'](_0x49f0ec['model'],_0x49f0ec[_0x6cc2('0x37')]);_0x23b72f[_0x6cc2('0x3c')]=_[_0x6cc2('0x3a')](_0x49f0ec[_0x6cc2('0x36')],qs['fields'](_0x4816bc[_0x6cc2('0x37')][_0x6cc2('0x3b')]));_0x23b72f['attributes']=_0x23b72f[_0x6cc2('0x3c')][_0x6cc2('0x3d')]?_0x23b72f[_0x6cc2('0x3c')]:_0x49f0ec[_0x6cc2('0x36')];if(_0x4816bc[_0x6cc2('0x37')][_0x6cc2('0x47')]){_0x23b72f[_0x6cc2('0x48')]=[{'all':!![]}];}_0x23b72f=_['merge']({},_0x23b72f,_0x4816bc[_0x6cc2('0x46')]);return db[_0x6cc2('0x31')][_0x6cc2('0x4b')](_0x23b72f)[_0x6cc2('0x2b')](handleEntityNotFound(_0x517f6c,null))[_0x6cc2('0x2b')](respondWithResult(_0x517f6c,null))['catch'](handleError(_0x517f6c,null));};exports[_0x6cc2('0x4c')]=function(_0x295cf3,_0x332a2b){return db['VoiceQueueReport'][_0x6cc2('0x4c')](_0x295cf3['body'],{})[_0x6cc2('0x2b')](respondWithResult(_0x332a2b,0xc9))[_0x6cc2('0x4d')](handleError(_0x332a2b,null));};exports[_0x6cc2('0x2a')]=function(_0x154964,_0x558d2){if(_0x154964['body']['id']){delete _0x154964[_0x6cc2('0x4e')]['id'];}return db[_0x6cc2('0x31')]['find']({'where':{'id':_0x154964[_0x6cc2('0x4f')]['id']}})['then'](handleEntityNotFound(_0x558d2,null))[_0x6cc2('0x2b')](saveUpdates(_0x154964['body'],null))[_0x6cc2('0x2b')](respondWithResult(_0x558d2,null))['catch'](handleError(_0x558d2,null));};exports[_0x6cc2('0x50')]=function(_0x401481,_0x2d3541){return db[_0x6cc2('0x31')][_0x6cc2('0x4b')]({'where':{'id':_0x401481[_0x6cc2('0x4f')]['id']}})[_0x6cc2('0x2b')](handleEntityNotFound(_0x2d3541,null))[_0x6cc2('0x2b')](removeEntity(_0x2d3541,null))[_0x6cc2('0x4d')](handleError(_0x2d3541,null));};exports[_0x6cc2('0x51')]=function(_0x5c887a,_0x52e15b){return db['VoiceQueueReport'][_0x6cc2('0x51')]()[_0x6cc2('0x2b')](respondWithResult(_0x52e15b,null))[_0x6cc2('0x4d')](handleError(_0x52e15b,null));};exports[_0x6cc2('0x52')]=function(_0x1485f7,_0x5e2907){var _0x3a1fca={},_0x20dae9={},_0x5d6bcf={'count':0x0,'rows':[]};_0x20dae9[_0x6cc2('0x36')]=_[_0x6cc2('0x38')](db[_0x6cc2('0x31')][_0x6cc2('0x32')]);_0x20dae9[_0x6cc2('0x37')]=_[_0x6cc2('0x38')](_0x1485f7[_0x6cc2('0x37')]);_0x20dae9['filters']=_[_0x6cc2('0x3a')](_0x20dae9[_0x6cc2('0x36')],_0x20dae9[_0x6cc2('0x37')]);_0x3a1fca['attributes']=_[_0x6cc2('0x3a')](_0x20dae9['model'],qs[_0x6cc2('0x3b')](_0x1485f7['query']['fields']));_0x3a1fca['attributes']=_0x3a1fca[_0x6cc2('0x3c')][_0x6cc2('0x3d')]?_0x3a1fca['attributes']:_0x20dae9['model'];if(!_0x1485f7[_0x6cc2('0x37')][_0x6cc2('0x3e')]('nolimit')){_0x3a1fca[_0x6cc2('0x26')]=qs[_0x6cc2('0x26')](_0x1485f7[_0x6cc2('0x37')][_0x6cc2('0x26')]);_0x3a1fca[_0x6cc2('0x23')]=qs['offset'](_0x1485f7[_0x6cc2('0x37')][_0x6cc2('0x23')]);}_0x3a1fca[_0x6cc2('0x53')]=qs[_0x6cc2('0x40')](_0x1485f7['query'][_0x6cc2('0x40')]);_0x3a1fca[_0x6cc2('0x41')]=qs[_0x6cc2('0x39')](_[_0x6cc2('0x42')](_0x1485f7[_0x6cc2('0x37')],_0x20dae9[_0x6cc2('0x39')]));if(_0x1485f7[_0x6cc2('0x37')]['filter']){_0x3a1fca[_0x6cc2('0x41')]=_[_0x6cc2('0x44')](_0x3a1fca['where'],{'$or':_[_0x6cc2('0x30')](_0x3a1fca['attributes'],function(_0x36348f){var _0x4573c4={};_0x4573c4[_0x36348f]={'$like':'%'+_0x1485f7[_0x6cc2('0x37')][_0x6cc2('0x43')]+'%'};return _0x4573c4;})});}_0x3a1fca=_[_0x6cc2('0x44')]({},_0x3a1fca,_0x1485f7[_0x6cc2('0x46')]);var _0x5bc825={'where':_0x3a1fca[_0x6cc2('0x41')]};return db[_0x6cc2('0x31')]['count'](_0x5bc825)[_0x6cc2('0x2b')](function(_0x142867){_0x5d6bcf[_0x6cc2('0x25')]=_0x142867;if(_0x1485f7[_0x6cc2('0x37')][_0x6cc2('0x47')]){_0x3a1fca['include']=[{'all':!![]}];}return db[_0x6cc2('0x31')][_0x6cc2('0x54')](_0x3a1fca);})['then'](function(_0x5cb06b){_0x5d6bcf[_0x6cc2('0x49')]=_0x5cb06b;return _0x5d6bcf;})['then'](respondWithFilteredResult(_0x5e2907,_0x3a1fca,_0x6cc2('0x52')))[_0x6cc2('0x4d')](handleError(_0x5e2907,null,_0x6cc2('0x52')));};
\ No newline at end of file
index 0505ff9..0df593c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b81=['remove','emit','hasOwnProperty','../../mysqldb','VoiceQueueReport','setMaxListeners','save'];(function(_0x270b99,_0x3e327a){var _0xa3cef6=function(_0x1ac4dc){while(--_0x1ac4dc){_0x270b99['push'](_0x270b99['shift']());}};_0xa3cef6(++_0x3e327a);}(_0x4b81,0x161));var _0x14b8=function(_0x162c8f,_0x27b261){_0x162c8f=_0x162c8f-0x0;var _0x3f6112=_0x4b81[_0x162c8f];return _0x3f6112;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0x14b8('0x0'))['db'][_0x14b8('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x14b8('0x2')](0x0);var events={'afterCreate':_0x14b8('0x3'),'afterUpdate':'update','afterDestroy':_0x14b8('0x4')};function emitEvent(_0x46a719){return function(_0x9aaaf4,_0x255cd8,_0x1f7775){VoiceQueueReportEvents['emit'](_0x46a719+':'+_0x9aaaf4['id'],_0x9aaaf4);VoiceQueueReportEvents[_0x14b8('0x5')](_0x46a719,_0x9aaaf4);_0x1f7775(null);};}for(var e in events){if(events[_0x14b8('0x6')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents;
\ No newline at end of file
+var _0xcdb0=['VoiceQueueReport','save','update','remove','emit','exports','events','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcdb0,0x16e));var _0x0cdb=function(_0x37f64f,_0x2a476a){_0x37f64f=_0x37f64f-0x0;var _0x11f3ad=_0xcdb0[_0x37f64f];return _0x11f3ad;};'use strict';var EventEmitter=require(_0x0cdb('0x0'));var VoiceQueueReport=require(_0x0cdb('0x1'))['db'][_0x0cdb('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0cdb('0x3'),'afterUpdate':_0x0cdb('0x4'),'afterDestroy':_0x0cdb('0x5')};function emitEvent(_0x1afec0){return function(_0x331923,_0x27d610,_0x439139){VoiceQueueReportEvents[_0x0cdb('0x6')](_0x1afec0+':'+_0x331923['id'],_0x331923);VoiceQueueReportEvents[_0x0cdb('0x6')](_0x1afec0,_0x331923);_0x439139(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x0cdb('0x7')]=VoiceQueueReportEvents;
\ No newline at end of file
index 1eb3e0c..8eff718 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11df=['../../config/environment','exports','define','VoiceQueueReport','report_queue','calleridnum','util','api','moment','request-promise','path','rimraf'];(function(_0x2b17ef,_0x8a3257){var _0x449f17=function(_0x5ddeca){while(--_0x5ddeca){_0x2b17ef['push'](_0x2b17ef['shift']());}};_0x449f17(++_0x8a3257);}(_0x11df,0x126));var _0xf11d=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x11df[_0x433a86];return _0x23000c;};'use strict';var _=require('lodash');var util=require(_0xf11d('0x0'));var logger=require('../../config/logger')(_0xf11d('0x1'));var moment=require(_0xf11d('0x2'));var BPromise=require('bluebird');var rp=require(_0xf11d('0x3'));var fs=require('fs');var path=require(_0xf11d('0x4'));var rimraf=require(_0xf11d('0x5'));var config=require(_0xf11d('0x6'));var attributes=require('./voiceQueueReport.attributes');module[_0xf11d('0x7')]=function(_0x1559b1,_0x9b2ca8){return _0x1559b1[_0xf11d('0x8')](_0xf11d('0x9'),attributes,{'tableName':_0xf11d('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0xf11d('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa33e=['lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum'];(function(_0x14c461,_0x2ef497){var _0x1af1b7=function(_0x377489){while(--_0x377489){_0x14c461['push'](_0x14c461['shift']());}};_0x1af1b7(++_0x2ef497);}(_0xa33e,0x1b2));var _0xea33=function(_0x1ef2a7,_0x2fe558){_0x1ef2a7=_0x1ef2a7-0x0;var _0x32e0ce=_0xa33e[_0x1ef2a7];return _0x32e0ce;};'use strict';var _=require(_0xea33('0x0'));var util=require('util');var logger=require(_0xea33('0x1'))(_0xea33('0x2'));var moment=require(_0xea33('0x3'));var BPromise=require(_0xea33('0x4'));var rp=require(_0xea33('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xea33('0x6'));var attributes=require(_0xea33('0x7'));module[_0xea33('0x8')]=function(_0xae1294,_0x2d8c7c){return _0xae1294[_0xea33('0x9')](_0xea33('0xa'),attributes,{'tableName':_0xea33('0xb'),'paranoid':![],'indexes':[{'fields':[_0xea33('0xc')]},{'fields':[_0xea33('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 604df66..dbecbcf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f43=['code','message','result','VoiceQueueReport','findAll','options','raw','where','attributes','include','model','map','GetVoiceQueueReport','catch','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x24eed2,_0x395d24){var _0x313507=function(_0x13278a){while(--_0x13278a){_0x24eed2['push'](_0x24eed2['shift']());}};_0x313507(++_0x395d24);}(_0x2f43,0xc7));var _0x32f4=function(_0x343816,_0x1eb1b8){_0x343816=_0x343816-0x0;var _0x47af8f=_0x2f43[_0x343816];return _0x47af8f;};'use strict';var _=require(_0x32f4('0x0'));var util=require(_0x32f4('0x1'));var moment=require('moment');var BPromise=require(_0x32f4('0x2'));var rs=require(_0x32f4('0x3'));var fs=require('fs');var Redis=require(_0x32f4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x32f4('0x5'));var logger=require(_0x32f4('0x6'))(_0x32f4('0x7'));var config=require(_0x32f4('0x8'));var jayson=require(_0x32f4('0x9'));var client=jayson[_0x32f4('0xa')]['http']({'port':0x232a});config[_0x32f4('0xb')]=_[_0x32f4('0xc')](config[_0x32f4('0xb')],{'host':_0x32f4('0xd'),'port':0x18eb});var socket=require(_0x32f4('0xe'))(new Redis(config[_0x32f4('0xb')]));require(_0x32f4('0xf'))[_0x32f4('0x10')](socket);function respondWithRpcPromise(_0x177b0b,_0x1786e6,_0xd1672f){return new BPromise(function(_0x22c57f,_0x259aa7){return client[_0x32f4('0x11')](_0x177b0b,_0xd1672f)[_0x32f4('0x12')](function(_0x511075){logger[_0x32f4('0x13')](_0x32f4('0x14'),_0x1786e6,_0x32f4('0x15'));logger[_0x32f4('0x16')](_0x32f4('0x17'),_0x1786e6,_0x32f4('0x15'),JSON[_0x32f4('0x18')](_0x511075));if(_0x511075['error']){if(_0x511075[_0x32f4('0x19')][_0x32f4('0x1a')]===0x1f4){logger[_0x32f4('0x19')](_0x32f4('0x14'),_0x1786e6,_0x511075[_0x32f4('0x19')][_0x32f4('0x1b')]);return _0x259aa7(_0x511075[_0x32f4('0x19')][_0x32f4('0x1b')]);}logger[_0x32f4('0x19')](_0x32f4('0x14'),_0x1786e6,_0x511075['error']['message']);return _0x22c57f(_0x511075[_0x32f4('0x19')][_0x32f4('0x1b')]);}else{logger[_0x32f4('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x1786e6,_0x32f4('0x15'));_0x22c57f(_0x511075[_0x32f4('0x1c')]['message']);}})['catch'](function(_0x1190ef){logger[_0x32f4('0x19')](_0x32f4('0x14'),_0x1786e6,_0x1190ef);_0x259aa7(_0x1190ef);});});}exports['GetVoiceQueueReport']=function(_0xd745a3){var _0x4d35a3=this;return new Promise(function(_0x324e46,_0x31f222){return db[_0x32f4('0x1d')][_0x32f4('0x1e')]({'raw':_0xd745a3[_0x32f4('0x1f')]?_0xd745a3[_0x32f4('0x1f')][_0x32f4('0x20')]===undefined?!![]:![]:!![],'where':_0xd745a3[_0x32f4('0x1f')]?_0xd745a3['options'][_0x32f4('0x21')]||null:null,'attributes':_0xd745a3[_0x32f4('0x1f')]?_0xd745a3[_0x32f4('0x1f')][_0x32f4('0x22')]||null:null,'limit':_0xd745a3[_0x32f4('0x1f')]?_0xd745a3['options']['limit']||null:null,'include':_0xd745a3[_0x32f4('0x1f')]?_0xd745a3[_0x32f4('0x1f')]['include']?_['map'](_0xd745a3['options'][_0x32f4('0x23')],function(_0x201a67){return{'model':db[_0x201a67[_0x32f4('0x24')]],'as':_0x201a67['as'],'attributes':_0x201a67[_0x32f4('0x22')],'include':_0x201a67[_0x32f4('0x23')]?_[_0x32f4('0x25')](_0x201a67[_0x32f4('0x23')],function(_0x4a9098){return{'model':db[_0x4a9098[_0x32f4('0x24')]],'as':_0x4a9098['as'],'attributes':_0x4a9098['attributes'],'include':_0x4a9098[_0x32f4('0x23')]?_['map'](_0x4a9098[_0x32f4('0x23')],function(_0x2b51fa){return{'model':db[_0x2b51fa['model']],'as':_0x2b51fa['as'],'attributes':_0x2b51fa['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x20ac48){logger[_0x32f4('0x13')]('GetVoiceQueueReport',_0xd745a3);logger[_0x32f4('0x16')](_0x32f4('0x26'),_0xd745a3,JSON['stringify'](_0x20ac48));_0x324e46(_0x20ac48);})[_0x32f4('0x27')](function(_0x2e901d){logger[_0x32f4('0x19')]('GetVoiceQueueReport',_0x2e901d[_0x32f4('0x1b')],_0xd745a3);_0x31f222(_0x4d35a3[_0x32f4('0x19')](0x1f4,_0x2e901d[_0x32f4('0x1b')]));});});};exports[_0x32f4('0x28')]=function(_0x408ec0){var _0x391af0=this;return new Promise(function(_0x594dfe,_0xf2a000){return db[_0x32f4('0x1d')][_0x32f4('0x29')](_0x408ec0[_0x32f4('0x2a')],{'raw':_0x408ec0[_0x32f4('0x1f')]?_0x408ec0['options'][_0x32f4('0x20')]===undefined?!![]:![]:!![]})[_0x32f4('0x12')](function(_0x2a1da7){logger[_0x32f4('0x13')](_0x32f4('0x28'),_0x408ec0);logger['debug'](_0x32f4('0x28'),_0x408ec0,JSON[_0x32f4('0x18')](_0x2a1da7));_0x594dfe(_0x2a1da7);})['catch'](function(_0x54effa){logger['error'](_0x32f4('0x28'),_0x54effa[_0x32f4('0x1b')],_0x408ec0);_0xf2a000(_0x391af0['error'](0x1f4,_0x54effa[_0x32f4('0x1b')]));});});};exports[_0x32f4('0x2b')]=function(_0x1b5902){var _0x2a7a3e=this;return new Promise(function(_0x49501a,_0x4f6ec7){return db[_0x32f4('0x1d')][_0x32f4('0x2c')](_0x1b5902[_0x32f4('0x2a')],{'raw':_0x1b5902[_0x32f4('0x1f')]?_0x1b5902[_0x32f4('0x1f')][_0x32f4('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b5902['options']?_0x1b5902[_0x32f4('0x1f')][_0x32f4('0x21')]||null:null,'attributes':_0x1b5902[_0x32f4('0x1f')]?_0x1b5902['options'][_0x32f4('0x22')]||null:null,'limit':_0x1b5902[_0x32f4('0x1f')]?_0x1b5902['options']['limit']||null:null})[_0x32f4('0x12')](function(_0x5dabcf){logger[_0x32f4('0x13')](_0x32f4('0x2b'),_0x1b5902);logger[_0x32f4('0x16')]('UpdateVoiceQueueReport',_0x1b5902,JSON[_0x32f4('0x18')](_0x5dabcf));_0x49501a(_0x5dabcf);})['catch'](function(_0x2cb1c2){logger[_0x32f4('0x19')](_0x32f4('0x2b'),_0x2cb1c2[_0x32f4('0x1b')],_0x1b5902);_0x4f6ec7(_0x2a7a3e[_0x32f4('0x19')](0x1f4,_0x2cb1c2[_0x32f4('0x1b')]));});});};
\ No newline at end of file
+var _0xf99e=['code','VoiceQueueReport,\x20%s,\x20%s','message','result','catch','GetVoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateVoiceQueueReport','VoiceQueueReport','create','body','UpdateVoiceQueueReport','update','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','request','then','info','request\x20sent','debug','stringify','error'];(function(_0x1135e4,_0x92b3){var _0x6d4b08=function(_0x495510){while(--_0x495510){_0x1135e4['push'](_0x1135e4['shift']());}};_0x6d4b08(++_0x92b3);}(_0xf99e,0x15d));var _0xef99=function(_0x4af2c3,_0xf4d1f4){_0x4af2c3=_0x4af2c3-0x0;var _0x74088=_0xf99e[_0x4af2c3];return _0x74088;};'use strict';var _=require(_0xef99('0x0'));var util=require(_0xef99('0x1'));var moment=require(_0xef99('0x2'));var BPromise=require(_0xef99('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xef99('0x4'))['db'];var utils=require(_0xef99('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xef99('0x6'));var jayson=require(_0xef99('0x7'));var client=jayson['client'][_0xef99('0x8')]({'port':0x232a});config[_0xef99('0x9')]=_[_0xef99('0xa')](config[_0xef99('0x9')],{'host':_0xef99('0xb'),'port':0x18eb});var socket=require(_0xef99('0xc'))(new Redis(config[_0xef99('0x9')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithRpcPromise(_0x5bf34d,_0x3094eb,_0x589c0c){return new BPromise(function(_0x374e53,_0x3f9170){return client[_0xef99('0xd')](_0x5bf34d,_0x589c0c)[_0xef99('0xe')](function(_0x34663c){logger[_0xef99('0xf')]('VoiceQueueReport,\x20%s,\x20%s',_0x3094eb,_0xef99('0x10'));logger[_0xef99('0x11')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x3094eb,_0xef99('0x10'),JSON[_0xef99('0x12')](_0x34663c));if(_0x34663c['error']){if(_0x34663c[_0xef99('0x13')][_0xef99('0x14')]===0x1f4){logger[_0xef99('0x13')](_0xef99('0x15'),_0x3094eb,_0x34663c[_0xef99('0x13')][_0xef99('0x16')]);return _0x3f9170(_0x34663c[_0xef99('0x13')][_0xef99('0x16')]);}logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x3094eb,_0x34663c[_0xef99('0x13')][_0xef99('0x16')]);return _0x374e53(_0x34663c['error'][_0xef99('0x16')]);}else{logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x3094eb,_0xef99('0x10'));_0x374e53(_0x34663c[_0xef99('0x17')]['message']);}})[_0xef99('0x18')](function(_0x208288){logger[_0xef99('0x13')](_0xef99('0x15'),_0x3094eb,_0x208288);_0x3f9170(_0x208288);});});}exports[_0xef99('0x19')]=function(_0x2bd418){var _0x38c0ec=this;return new Promise(function(_0x292f25,_0x41eff2){return db['VoiceQueueReport'][_0xef99('0x1a')]({'raw':_0x2bd418['options']?_0x2bd418[_0xef99('0x1b')][_0xef99('0x1c')]===undefined?!![]:![]:!![],'where':_0x2bd418[_0xef99('0x1b')]?_0x2bd418[_0xef99('0x1b')][_0xef99('0x1d')]||null:null,'attributes':_0x2bd418['options']?_0x2bd418[_0xef99('0x1b')][_0xef99('0x1e')]||null:null,'limit':_0x2bd418[_0xef99('0x1b')]?_0x2bd418['options'][_0xef99('0x1f')]||null:null,'include':_0x2bd418[_0xef99('0x1b')]?_0x2bd418['options'][_0xef99('0x20')]?_[_0xef99('0x21')](_0x2bd418[_0xef99('0x1b')][_0xef99('0x20')],function(_0x5c5ad3){return{'model':db[_0x5c5ad3[_0xef99('0x22')]],'as':_0x5c5ad3['as'],'attributes':_0x5c5ad3[_0xef99('0x1e')],'include':_0x5c5ad3[_0xef99('0x20')]?_[_0xef99('0x21')](_0x5c5ad3[_0xef99('0x20')],function(_0x36415c){return{'model':db[_0x36415c[_0xef99('0x22')]],'as':_0x36415c['as'],'attributes':_0x36415c[_0xef99('0x1e')],'include':_0x36415c[_0xef99('0x20')]?_[_0xef99('0x21')](_0x36415c[_0xef99('0x20')],function(_0xe8fbcc){return{'model':db[_0xe8fbcc[_0xef99('0x22')]],'as':_0xe8fbcc['as'],'attributes':_0xe8fbcc[_0xef99('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xef99('0xe')](function(_0x25b0da){logger['info'](_0xef99('0x19'),_0x2bd418);logger[_0xef99('0x11')](_0xef99('0x19'),_0x2bd418,JSON[_0xef99('0x12')](_0x25b0da));_0x292f25(_0x25b0da);})['catch'](function(_0x73c400){logger['error'](_0xef99('0x19'),_0x73c400[_0xef99('0x16')],_0x2bd418);_0x41eff2(_0x38c0ec[_0xef99('0x13')](0x1f4,_0x73c400[_0xef99('0x16')]));});});};exports[_0xef99('0x23')]=function(_0x204bf9){var _0x36c13b=this;return new Promise(function(_0x63ab5c,_0x34aebc){return db[_0xef99('0x24')][_0xef99('0x25')](_0x204bf9[_0xef99('0x26')],{'raw':_0x204bf9[_0xef99('0x1b')]?_0x204bf9['options']['raw']===undefined?!![]:![]:!![]})[_0xef99('0xe')](function(_0x21cb2f){logger[_0xef99('0xf')]('CreateVoiceQueueReport',_0x204bf9);logger[_0xef99('0x11')]('CreateVoiceQueueReport',_0x204bf9,JSON[_0xef99('0x12')](_0x21cb2f));_0x63ab5c(_0x21cb2f);})[_0xef99('0x18')](function(_0x574c8e){logger[_0xef99('0x13')]('CreateVoiceQueueReport',_0x574c8e[_0xef99('0x16')],_0x204bf9);_0x34aebc(_0x36c13b[_0xef99('0x13')](0x1f4,_0x574c8e[_0xef99('0x16')]));});});};exports[_0xef99('0x27')]=function(_0x5e03f1){var _0x56b5f6=this;return new Promise(function(_0x37e5c1,_0x176c49){return db[_0xef99('0x24')][_0xef99('0x28')](_0x5e03f1[_0xef99('0x26')],{'raw':_0x5e03f1[_0xef99('0x1b')]?_0x5e03f1[_0xef99('0x1b')][_0xef99('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e03f1[_0xef99('0x1b')]?_0x5e03f1[_0xef99('0x1b')][_0xef99('0x1d')]||null:null,'attributes':_0x5e03f1[_0xef99('0x1b')]?_0x5e03f1['options'][_0xef99('0x1e')]||null:null,'limit':_0x5e03f1[_0xef99('0x1b')]?_0x5e03f1['options'][_0xef99('0x1f')]||null:null})[_0xef99('0xe')](function(_0x3e81c4){logger[_0xef99('0xf')](_0xef99('0x27'),_0x5e03f1);logger['debug'](_0xef99('0x27'),_0x5e03f1,JSON[_0xef99('0x12')](_0x3e81c4));_0x37e5c1(_0x3e81c4);})[_0xef99('0x18')](function(_0x37f291){logger['error'](_0xef99('0x27'),_0x37f291[_0xef99('0x16')],_0x5e03f1);_0x176c49(_0x56b5f6[_0xef99('0x13')](0x1f4,_0x37f291[_0xef99('0x16')]));});});};
\ No newline at end of file
index 2674c81..46ad4e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe35c=['update','removeListener','register','length','./voiceQueueReport.events','save','remove'];(function(_0x287db9,_0x149fad){var _0x1c5a7c=function(_0x5528c5){while(--_0x5528c5){_0x287db9['push'](_0x287db9['shift']());}};_0x1c5a7c(++_0x149fad);}(_0xe35c,0x146));var _0xce35=function(_0x4372ff,_0x2287f7){_0x4372ff=_0x4372ff-0x0;var _0x58db97=_0xe35c[_0x4372ff];return _0x58db97;};'use strict';var VoiceQueueReportEvents=require(_0xce35('0x0'));var events=[_0xce35('0x1'),_0xce35('0x2'),_0xce35('0x3')];function createListener(_0x1ace65,_0x21eade){return function(_0x4f48a7){_0x21eade['emit'](_0x1ace65,_0x4f48a7);};}function removeListener(_0x17648a,_0x4a005b){return function(){VoiceQueueReportEvents[_0xce35('0x4')](_0x17648a,_0x4a005b);};}exports[_0xce35('0x5')]=function(_0x3a4bb){for(var _0x47e53c=0x0,_0x270b81=events[_0xce35('0x6')];_0x47e53c<_0x270b81;_0x47e53c++){var _0x2b4a82=events[_0x47e53c];var _0x74ae5e=createListener('voiceQueueReport:'+_0x2b4a82,_0x3a4bb);VoiceQueueReportEvents['on'](_0x2b4a82,_0x74ae5e);}};
\ No newline at end of file
+var _0xaab2=['remove','update','emit','register','length','voiceQueueReport:','save'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xaab2,0xca));var _0x2aab=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xaab2[_0x3bf83f];return _0x22c4a9;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x2aab('0x0'),_0x2aab('0x1'),_0x2aab('0x2')];function createListener(_0x564a5a,_0x149bb7){return function(_0xc770d0){_0x149bb7[_0x2aab('0x3')](_0x564a5a,_0xc770d0);};}function removeListener(_0x342fe5,_0x3d6ee0){return function(){VoiceQueueReportEvents['removeListener'](_0x342fe5,_0x3d6ee0);};}exports[_0x2aab('0x4')]=function(_0x5b35ec){for(var _0x3af395=0x0,_0x276906=events[_0x2aab('0x5')];_0x3af395<_0x276906;_0x3af395++){var _0x2970cb=events[_0x3af395];var _0x494216=createListener(_0x2aab('0x6')+_0x2970cb,_0x5b35ec);VoiceQueueReportEvents['on'](_0x2970cb,_0x494216);}};
\ No newline at end of file
index 734aefc..d50305f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42c9=['get','isAuthenticated','index','/:id','show','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller'];(function(_0x474fe0,_0x22cf6f){var _0x120a13=function(_0x4531bb){while(--_0x4531bb){_0x474fe0['push'](_0x474fe0['shift']());}};_0x120a13(++_0x22cf6f);}(_0x42c9,0x1ae));var _0x942c=function(_0x31172e,_0xa59e5){_0x31172e=_0x31172e-0x0;var _0x414ada=_0x42c9[_0x31172e];return _0x414ada;};'use strict';var multer=require(_0x942c('0x0'));var util=require('util');var path=require(_0x942c('0x1'));var timeout=require(_0x942c('0x2'));var express=require(_0x942c('0x3'));var router=express[_0x942c('0x4')]();var fs_extra=require(_0x942c('0x5'));var auth=require(_0x942c('0x6'));var interaction=require(_0x942c('0x7'));var config=require(_0x942c('0x8'));var controller=require(_0x942c('0x9'));router[_0x942c('0xa')]('/',auth[_0x942c('0xb')](),controller[_0x942c('0xc')]);router[_0x942c('0xa')](_0x942c('0xd'),auth[_0x942c('0xb')](),controller[_0x942c('0xe')]);router['post']('/',auth[_0x942c('0xb')](),controller[_0x942c('0xf')]);router[_0x942c('0x10')]('/:id',auth[_0x942c('0xb')](),controller[_0x942c('0x11')]);router[_0x942c('0x12')](_0x942c('0xd'),auth[_0x942c('0xb')](),controller['destroy']);module[_0x942c('0x13')]=router;
\ No newline at end of file
+var _0xd6b2=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x2e6dee,_0x1a61b0){var _0x47706=function(_0x365546){while(--_0x365546){_0x2e6dee['push'](_0x2e6dee['shift']());}};_0x47706(++_0x1a61b0);}(_0xd6b2,0x18f));var _0x2d6b=function(_0x2b7b83,_0x31b9ac){_0x2b7b83=_0x2b7b83-0x0;var _0x4320eb=_0xd6b2[_0x2b7b83];return _0x4320eb;};'use strict';var multer=require(_0x2d6b('0x0'));var util=require(_0x2d6b('0x1'));var path=require('path');var timeout=require(_0x2d6b('0x2'));var express=require('express');var router=express[_0x2d6b('0x3')]();var fs_extra=require(_0x2d6b('0x4'));var auth=require(_0x2d6b('0x5'));var interaction=require(_0x2d6b('0x6'));var config=require(_0x2d6b('0x7'));var controller=require(_0x2d6b('0x8'));router[_0x2d6b('0x9')]('/',auth[_0x2d6b('0xa')](),controller[_0x2d6b('0xb')]);router['get'](_0x2d6b('0xc'),auth[_0x2d6b('0xa')](),controller[_0x2d6b('0xd')]);router[_0x2d6b('0xe')]('/',auth[_0x2d6b('0xa')](),controller[_0x2d6b('0xf')]);router[_0x2d6b('0x10')](_0x2d6b('0xc'),auth[_0x2d6b('0xa')](),controller[_0x2d6b('0x11')]);router[_0x2d6b('0x12')]('/:id',auth[_0x2d6b('0xa')](),controller[_0x2d6b('0x13')]);module[_0x2d6b('0x14')]=router;
\ No newline at end of file
index cdb3f4b..dba0b60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa93e=['STRING','DATE','format','exports'];(function(_0x1810f4,_0x35765f){var _0x4c7266=function(_0x5e3034){while(--_0x5e3034){_0x1810f4['push'](_0x1810f4['shift']());}};_0x4c7266(++_0x35765f);}(_0xa93e,0x1df));var _0xea93=function(_0x4a4058,_0xea7bc1){_0x4a4058=_0x4a4058-0x0;var _0x23a4fa=_0xa93e[_0x4a4058];return _0x23a4fa;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xea93('0x0')]={'time':{'type':Sequelize[_0xea93('0x1')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xea93('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xea93('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xea93('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xea93('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xea93('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xea93('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xea93('0x2')],'allowNull':![],'defaultValue':moment()[_0xea93('0x3')]('YYYY-MM-DD\x20HH:mm:ss')}};
\ No newline at end of file
+var _0xa7be=['YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING','DATE','format'];(function(_0x5ed54b,_0x3a2827){var _0x4b58c7=function(_0x19d3b6){while(--_0x19d3b6){_0x5ed54b['push'](_0x5ed54b['shift']());}};_0x4b58c7(++_0x3a2827);}(_0xa7be,0xfd));var _0xea7b=function(_0xce17c2,_0x533a30){_0xce17c2=_0xce17c2-0x0;var _0x38fb31=_0xa7be[_0xce17c2];return _0x38fb31;};'use strict';var Sequelize=require(_0xea7b('0x0'));var moment=require(_0xea7b('0x1'));module[_0xea7b('0x2')]={'time':{'type':Sequelize[_0xea7b('0x3')]},'callid':{'type':Sequelize[_0xea7b('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xea7b('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xea7b('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xea7b('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xea7b('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xea7b('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xea7b('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xea7b('0x4')],'allowNull':![],'defaultValue':moment()[_0xea7b('0x5')](_0xea7b('0x6'))}};
\ No newline at end of file
index 4b56185..6c590a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8eae=['catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','stack','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','name','filter','options','VoiceQueuesLog','include','rows','show','params','includeAll','find'];(function(_0x13164d,_0x4ca3de){var _0xd8678d=function(_0x517601){while(--_0x517601){_0x13164d['push'](_0x13164d['shift']());}};_0xd8678d(++_0x4ca3de);}(_0x8eae,0x1ed));var _0xe8ea=function(_0x250bbc,_0x3297f3){_0x250bbc=_0x250bbc-0x0;var _0x489e34=_0x8eae[_0x250bbc];return _0x489e34;};'use strict';var emlformat=require(_0xe8ea('0x0'));var rimraf=require(_0xe8ea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe8ea('0x2'));var rp=require(_0xe8ea('0x3'));var moment=require(_0xe8ea('0x4'));var BPromise=require(_0xe8ea('0x5'));var Mustache=require(_0xe8ea('0x6'));var util=require('util');var path=require('path');var sox=require(_0xe8ea('0x7'));var csv=require(_0xe8ea('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8ea('0x9'));var _=require(_0xe8ea('0xa'));var squel=require('squel');var crypto=require(_0xe8ea('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe8ea('0x8'));var querystring=require('querystring');var Papa=require(_0xe8ea('0xc'));var Redis=require(_0xe8ea('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xe8ea('0xe'));var as=require(_0xe8ea('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8ea('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xe8ea('0x11'));var licenseUtil=require(_0xe8ea('0x12'));var db=require(_0xe8ea('0x13'))['db'];function respondWithStatusCode(_0xccbe65,_0x22b36e){_0x22b36e=_0x22b36e||0xcc;return function(_0xd1aa62){if(_0xd1aa62){return _0xccbe65[_0xe8ea('0x14')](_0x22b36e);}return _0xccbe65[_0xe8ea('0x15')](_0x22b36e)[_0xe8ea('0x16')]();};}function respondWithResult(_0xe72554,_0x58ac02){_0x58ac02=_0x58ac02||0xc8;return function(_0xb36747){if(_0xb36747){return _0xe72554['status'](_0x58ac02)[_0xe8ea('0x17')](_0xb36747);}};}function respondWithFilteredResult(_0x474d68,_0x109186){return function(_0x49e173){if(_0x49e173){var _0x53b728=typeof _0x109186[_0xe8ea('0x18')]===_0xe8ea('0x19')&&typeof _0x109186[_0xe8ea('0x1a')]===_0xe8ea('0x19');var _0x36d2cc=_0x49e173[_0xe8ea('0x1b')];var _0x4a93fd=_0x53b728?0x0:_0x109186['offset'];var _0x3cb2d9=_0x53b728?_0x49e173[_0xe8ea('0x1b')]:_0x109186[_0xe8ea('0x18')]+_0x109186[_0xe8ea('0x1a')];var _0x536fe6;if(_0x3cb2d9>=_0x36d2cc){_0x3cb2d9=_0x36d2cc;_0x536fe6=0xc8;}else{_0x536fe6=0xce;}_0x474d68[_0xe8ea('0x15')](_0x536fe6);return _0x474d68[_0xe8ea('0x1c')]('Content-Range',_0x4a93fd+'-'+_0x3cb2d9+'/'+_0x36d2cc)[_0xe8ea('0x17')](_0x49e173);}return null;};}function patchUpdates(_0x500743){return function(_0x4a0ffd){try{jsonpatch[_0xe8ea('0x1d')](_0x4a0ffd,_0x500743,!![]);}catch(_0x4315fc){return BPromise[_0xe8ea('0x1e')](_0x4315fc);}return _0x4a0ffd[_0xe8ea('0x1f')]();};}function saveUpdates(_0x372229,_0x203f0c){return function(_0x234634){if(_0x234634){return _0x234634[_0xe8ea('0x20')](_0x372229)['then'](function(_0x3d7875){return _0x3d7875;});}return null;};}function removeEntity(_0x3e62df,_0x3099cc){return function(_0x2b220c){if(_0x2b220c){return _0x2b220c[_0xe8ea('0x21')]()[_0xe8ea('0x22')](function(){_0x3e62df[_0xe8ea('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cde65,_0x348dbe){return function(_0x922f96){if(!_0x922f96){_0x4cde65[_0xe8ea('0x14')](0x194);}return _0x922f96;};}function handleError(_0x19dbff,_0x13228a){_0x13228a=_0x13228a||0x1f4;return function(_0xd6057d){logger['error'](_0xd6057d[_0xe8ea('0x23')]);if(_0xd6057d['name']){delete _0xd6057d['name'];}_0x19dbff[_0xe8ea('0x15')](_0x13228a)[_0xe8ea('0x24')](_0xd6057d);};}exports[_0xe8ea('0x25')]=function(_0x243c56,_0x40f05f){var _0x50144b={},_0x1f763d={},_0x191f75={'count':0x0,'rows':[]};var _0x3830a8=_[_0xe8ea('0x26')](db['VoiceQueuesLog'][_0xe8ea('0x27')],function(_0x3dbc56){return{'name':_0x3dbc56[_0xe8ea('0x28')],'type':_0x3dbc56['type'][_0xe8ea('0x29')]};});_0x1f763d[_0xe8ea('0x2a')]=_[_0xe8ea('0x26')](_0x3830a8,'name');_0x1f763d[_0xe8ea('0x2b')]=_[_0xe8ea('0x2c')](_0x243c56['query']);_0x1f763d[_0xe8ea('0x2d')]=_[_0xe8ea('0x2e')](_0x1f763d[_0xe8ea('0x2a')],_0x1f763d['query']);_0x50144b[_0xe8ea('0x2f')]=_['intersection'](_0x1f763d[_0xe8ea('0x2a')],qs[_0xe8ea('0x30')](_0x243c56[_0xe8ea('0x2b')][_0xe8ea('0x30')]));_0x50144b['attributes']=_0x50144b[_0xe8ea('0x2f')][_0xe8ea('0x31')]?_0x50144b['attributes']:_0x1f763d['model'];if(!_0x243c56['query'][_0xe8ea('0x32')](_0xe8ea('0x33'))){_0x50144b[_0xe8ea('0x1a')]=qs[_0xe8ea('0x1a')](_0x243c56[_0xe8ea('0x2b')][_0xe8ea('0x1a')]);_0x50144b[_0xe8ea('0x18')]=qs[_0xe8ea('0x18')](_0x243c56[_0xe8ea('0x2b')][_0xe8ea('0x18')]);}_0x50144b[_0xe8ea('0x34')]=qs['sort'](_0x243c56['query'][_0xe8ea('0x35')]);_0x50144b[_0xe8ea('0x36')]=qs[_0xe8ea('0x2d')](_[_0xe8ea('0x37')](_0x243c56[_0xe8ea('0x2b')],_0x1f763d['filters']),_0x3830a8);if(_0x243c56[_0xe8ea('0x2b')]['filter']){_0x50144b[_0xe8ea('0x36')]=_[_0xe8ea('0x38')](_0x50144b[_0xe8ea('0x36')],{'$or':_[_0xe8ea('0x26')](_0x3830a8,function(_0x234e71){if(_0x234e71['type']!=='VIRTUAL'){var _0x3ad516={};_0x3ad516[_0x234e71[_0xe8ea('0x39')]]={'$like':'%'+_0x243c56[_0xe8ea('0x2b')][_0xe8ea('0x3a')]+'%'};return _0x3ad516;}})});}_0x50144b=_[_0xe8ea('0x38')]({},_0x50144b,_0x243c56[_0xe8ea('0x3b')]);var _0x2a9618={'where':_0x50144b['where']};return db[_0xe8ea('0x3c')]['count'](_0x2a9618)[_0xe8ea('0x22')](function(_0x4fb79b){_0x191f75['count']=_0x4fb79b;if(_0x243c56['query']['includeAll']){_0x50144b[_0xe8ea('0x3d')]=[{'all':!![]}];}return db[_0xe8ea('0x3c')]['findAll'](_0x50144b);})[_0xe8ea('0x22')](function(_0x56467b){_0x191f75[_0xe8ea('0x3e')]=_0x56467b;return _0x191f75;})[_0xe8ea('0x22')](respondWithFilteredResult(_0x40f05f,_0x50144b))['catch'](handleError(_0x40f05f,null));};exports[_0xe8ea('0x3f')]=function(_0x5c8d6e,_0x598735){var _0x48f71d={'raw':!![],'where':{'id':_0x5c8d6e[_0xe8ea('0x40')]['id']}},_0x99b9b0={};_0x99b9b0[_0xe8ea('0x2a')]=_['keys'](db[_0xe8ea('0x3c')][_0xe8ea('0x27')]);_0x99b9b0[_0xe8ea('0x2b')]=_[_0xe8ea('0x2c')](_0x5c8d6e[_0xe8ea('0x2b')]);_0x99b9b0[_0xe8ea('0x2d')]=_[_0xe8ea('0x2e')](_0x99b9b0['model'],_0x99b9b0[_0xe8ea('0x2b')]);_0x48f71d['attributes']=_['intersection'](_0x99b9b0[_0xe8ea('0x2a')],qs[_0xe8ea('0x30')](_0x5c8d6e[_0xe8ea('0x2b')]['fields']));_0x48f71d[_0xe8ea('0x2f')]=_0x48f71d[_0xe8ea('0x2f')]['length']?_0x48f71d['attributes']:_0x99b9b0[_0xe8ea('0x2a')];if(_0x5c8d6e[_0xe8ea('0x2b')][_0xe8ea('0x41')]){_0x48f71d[_0xe8ea('0x3d')]=[{'all':!![]}];}_0x48f71d=_[_0xe8ea('0x38')]({},_0x48f71d,_0x5c8d6e['options']);return db[_0xe8ea('0x3c')][_0xe8ea('0x42')](_0x48f71d)[_0xe8ea('0x22')](handleEntityNotFound(_0x598735,null))[_0xe8ea('0x22')](respondWithResult(_0x598735,null))[_0xe8ea('0x43')](handleError(_0x598735,null));};exports[_0xe8ea('0x44')]=function(_0x3a7b86,_0x1072b4){return db[_0xe8ea('0x3c')][_0xe8ea('0x44')](_0x3a7b86[_0xe8ea('0x45')],{})[_0xe8ea('0x22')](respondWithResult(_0x1072b4,0xc9))['catch'](handleError(_0x1072b4,null));};exports[_0xe8ea('0x20')]=function(_0x39cb66,_0x4ad13b){if(_0x39cb66[_0xe8ea('0x45')]['id']){delete _0x39cb66[_0xe8ea('0x45')]['id'];}return db['VoiceQueuesLog'][_0xe8ea('0x42')]({'where':{'id':_0x39cb66[_0xe8ea('0x40')]['id']}})[_0xe8ea('0x22')](handleEntityNotFound(_0x4ad13b,null))[_0xe8ea('0x22')](saveUpdates(_0x39cb66[_0xe8ea('0x45')],null))['then'](respondWithResult(_0x4ad13b,null))['catch'](handleError(_0x4ad13b,null));};exports['destroy']=function(_0x4b8f20,_0x6a3ece){return db['VoiceQueuesLog'][_0xe8ea('0x42')]({'where':{'id':_0x4b8f20['params']['id']}})[_0xe8ea('0x22')](handleEntityNotFound(_0x6a3ece,null))[_0xe8ea('0x22')](removeEntity(_0x6a3ece,null))[_0xe8ea('0x43')](handleError(_0x6a3ece,null));};
\ No newline at end of file
+var _0xc4f2=['create','body','eml-format','rimraf','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','json','undefined','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','name','send','map','VoiceQueuesLog','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','count','includeAll','findAll','rows','catch','show','params','rawAttributes','find'];(function(_0x5e9f15,_0x268414){var _0x375a34=function(_0x141b0a){while(--_0x141b0a){_0x5e9f15['push'](_0x5e9f15['shift']());}};_0x375a34(++_0x268414);}(_0xc4f2,0x1ca));var _0x2c4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4f2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2c4f('0x0'));var rimraf=require(_0x2c4f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2c4f('0x2'));var BPromise=require(_0x2c4f('0x3'));var Mustache=require(_0x2c4f('0x4'));var util=require(_0x2c4f('0x5'));var path=require(_0x2c4f('0x6'));var sox=require(_0x2c4f('0x7'));var csv=require(_0x2c4f('0x8'));var ejs=require(_0x2c4f('0x9'));var fs=require('fs');var fs_extra=require(_0x2c4f('0xa'));var _=require(_0x2c4f('0xb'));var squel=require(_0x2c4f('0xc'));var crypto=require(_0x2c4f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2c4f('0xe'));var toCsv=require(_0x2c4f('0x8'));var querystring=require(_0x2c4f('0xf'));var Papa=require(_0x2c4f('0x10'));var Redis=require(_0x2c4f('0x11'));var authService=require(_0x2c4f('0x12'));var qs=require(_0x2c4f('0x13'));var as=require(_0x2c4f('0x14'));var hardwareService=require(_0x2c4f('0x15'));var logger=require(_0x2c4f('0x16'))(_0x2c4f('0x17'));var utils=require(_0x2c4f('0x18'));var config=require(_0x2c4f('0x19'));var licenseUtil=require(_0x2c4f('0x1a'));var db=require(_0x2c4f('0x1b'))['db'];function respondWithStatusCode(_0x1196a3,_0x124b70){_0x124b70=_0x124b70||0xcc;return function(_0x1f522e){if(_0x1f522e){return _0x1196a3['sendStatus'](_0x124b70);}return _0x1196a3[_0x2c4f('0x1c')](_0x124b70)[_0x2c4f('0x1d')]();};}function respondWithResult(_0x5c4eda,_0x55b66b){_0x55b66b=_0x55b66b||0xc8;return function(_0x1ed417){if(_0x1ed417){return _0x5c4eda[_0x2c4f('0x1c')](_0x55b66b)[_0x2c4f('0x1e')](_0x1ed417);}};}function respondWithFilteredResult(_0x551174,_0xb0216b){return function(_0x5a2012){if(_0x5a2012){var _0x5845c9=typeof _0xb0216b['offset']===_0x2c4f('0x1f')&&typeof _0xb0216b[_0x2c4f('0x20')]===_0x2c4f('0x1f');var _0x43dcb0=_0x5a2012['count'];var _0x5781d8=_0x5845c9?0x0:_0xb0216b['offset'];var _0x3f0dcc=_0x5845c9?_0x5a2012['count']:_0xb0216b['offset']+_0xb0216b[_0x2c4f('0x20')];var _0x58cc89;if(_0x3f0dcc>=_0x43dcb0){_0x3f0dcc=_0x43dcb0;_0x58cc89=0xc8;}else{_0x58cc89=0xce;}_0x551174[_0x2c4f('0x1c')](_0x58cc89);return _0x551174[_0x2c4f('0x21')](_0x2c4f('0x22'),_0x5781d8+'-'+_0x3f0dcc+'/'+_0x43dcb0)[_0x2c4f('0x1e')](_0x5a2012);}return null;};}function patchUpdates(_0x1136e2){return function(_0x35342f){try{jsonpatch[_0x2c4f('0x23')](_0x35342f,_0x1136e2,!![]);}catch(_0x3d75e7){return BPromise[_0x2c4f('0x24')](_0x3d75e7);}return _0x35342f['save']();};}function saveUpdates(_0xbfc6d7,_0x14a28c){return function(_0x392651){if(_0x392651){return _0x392651[_0x2c4f('0x25')](_0xbfc6d7)[_0x2c4f('0x26')](function(_0x48a87d){return _0x48a87d;});}return null;};}function removeEntity(_0x1ff48b,_0x913a33){return function(_0x1f4466){if(_0x1f4466){return _0x1f4466[_0x2c4f('0x27')]()[_0x2c4f('0x26')](function(){_0x1ff48b['status'](0xcc)[_0x2c4f('0x1d')]();});}};}function handleEntityNotFound(_0x5ec5bd,_0x2eb690){return function(_0x199245){if(!_0x199245){_0x5ec5bd[_0x2c4f('0x28')](0x194);}return _0x199245;};}function handleError(_0x151c49,_0x56fc37){_0x56fc37=_0x56fc37||0x1f4;return function(_0x20d084){logger[_0x2c4f('0x29')](_0x20d084['stack']);if(_0x20d084[_0x2c4f('0x2a')]){delete _0x20d084[_0x2c4f('0x2a')];}_0x151c49[_0x2c4f('0x1c')](_0x56fc37)[_0x2c4f('0x2b')](_0x20d084);};}exports['index']=function(_0x245f14,_0x47b426){var _0x4ae099={},_0x19bd72={},_0x50c54c={'count':0x0,'rows':[]};var _0x68a77e=_[_0x2c4f('0x2c')](db[_0x2c4f('0x2d')]['rawAttributes'],function(_0x455ebc){return{'name':_0x455ebc[_0x2c4f('0x2e')],'type':_0x455ebc[_0x2c4f('0x2f')][_0x2c4f('0x30')]};});_0x19bd72[_0x2c4f('0x31')]=_[_0x2c4f('0x2c')](_0x68a77e,_0x2c4f('0x2a'));_0x19bd72[_0x2c4f('0x32')]=_[_0x2c4f('0x33')](_0x245f14[_0x2c4f('0x32')]);_0x19bd72['filters']=_['intersection'](_0x19bd72[_0x2c4f('0x31')],_0x19bd72['query']);_0x4ae099[_0x2c4f('0x34')]=_[_0x2c4f('0x35')](_0x19bd72[_0x2c4f('0x31')],qs[_0x2c4f('0x36')](_0x245f14[_0x2c4f('0x32')][_0x2c4f('0x36')]));_0x4ae099[_0x2c4f('0x34')]=_0x4ae099[_0x2c4f('0x34')][_0x2c4f('0x37')]?_0x4ae099[_0x2c4f('0x34')]:_0x19bd72[_0x2c4f('0x31')];if(!_0x245f14[_0x2c4f('0x32')][_0x2c4f('0x38')]('nolimit')){_0x4ae099[_0x2c4f('0x20')]=qs[_0x2c4f('0x20')](_0x245f14[_0x2c4f('0x32')]['limit']);_0x4ae099['offset']=qs['offset'](_0x245f14['query']['offset']);}_0x4ae099[_0x2c4f('0x39')]=qs[_0x2c4f('0x3a')](_0x245f14[_0x2c4f('0x32')][_0x2c4f('0x3a')]);_0x4ae099['where']=qs['filters'](_[_0x2c4f('0x3b')](_0x245f14[_0x2c4f('0x32')],_0x19bd72['filters']),_0x68a77e);if(_0x245f14[_0x2c4f('0x32')][_0x2c4f('0x3c')]){_0x4ae099[_0x2c4f('0x3d')]=_['merge'](_0x4ae099[_0x2c4f('0x3d')],{'$or':_['map'](_0x68a77e,function(_0x2339d1){if(_0x2339d1[_0x2c4f('0x2f')]!==_0x2c4f('0x3e')){var _0x1810ed={};_0x1810ed[_0x2339d1['name']]={'$like':'%'+_0x245f14[_0x2c4f('0x32')][_0x2c4f('0x3c')]+'%'};return _0x1810ed;}})});}_0x4ae099=_[_0x2c4f('0x3f')]({},_0x4ae099,_0x245f14[_0x2c4f('0x40')]);var _0xaec449={'where':_0x4ae099['where']};return db['VoiceQueuesLog'][_0x2c4f('0x41')](_0xaec449)[_0x2c4f('0x26')](function(_0x431dba){_0x50c54c[_0x2c4f('0x41')]=_0x431dba;if(_0x245f14[_0x2c4f('0x32')][_0x2c4f('0x42')]){_0x4ae099['include']=[{'all':!![]}];}return db[_0x2c4f('0x2d')][_0x2c4f('0x43')](_0x4ae099);})[_0x2c4f('0x26')](function(_0x305f31){_0x50c54c[_0x2c4f('0x44')]=_0x305f31;return _0x50c54c;})[_0x2c4f('0x26')](respondWithFilteredResult(_0x47b426,_0x4ae099))[_0x2c4f('0x45')](handleError(_0x47b426,null));};exports[_0x2c4f('0x46')]=function(_0x3c66bb,_0x180c39){var _0x2ff6f0={'raw':!![],'where':{'id':_0x3c66bb[_0x2c4f('0x47')]['id']}},_0x23b9f2={};_0x23b9f2['model']=_[_0x2c4f('0x33')](db['VoiceQueuesLog'][_0x2c4f('0x48')]);_0x23b9f2[_0x2c4f('0x32')]=_['keys'](_0x3c66bb[_0x2c4f('0x32')]);_0x23b9f2['filters']=_['intersection'](_0x23b9f2['model'],_0x23b9f2[_0x2c4f('0x32')]);_0x2ff6f0[_0x2c4f('0x34')]=_[_0x2c4f('0x35')](_0x23b9f2[_0x2c4f('0x31')],qs[_0x2c4f('0x36')](_0x3c66bb[_0x2c4f('0x32')][_0x2c4f('0x36')]));_0x2ff6f0[_0x2c4f('0x34')]=_0x2ff6f0[_0x2c4f('0x34')]['length']?_0x2ff6f0['attributes']:_0x23b9f2[_0x2c4f('0x31')];if(_0x3c66bb[_0x2c4f('0x32')][_0x2c4f('0x42')]){_0x2ff6f0['include']=[{'all':!![]}];}_0x2ff6f0=_[_0x2c4f('0x3f')]({},_0x2ff6f0,_0x3c66bb[_0x2c4f('0x40')]);return db[_0x2c4f('0x2d')][_0x2c4f('0x49')](_0x2ff6f0)[_0x2c4f('0x26')](handleEntityNotFound(_0x180c39,null))['then'](respondWithResult(_0x180c39,null))[_0x2c4f('0x45')](handleError(_0x180c39,null));};exports[_0x2c4f('0x4a')]=function(_0x4938c5,_0x34e6ca){return db['VoiceQueuesLog'][_0x2c4f('0x4a')](_0x4938c5['body'],{})[_0x2c4f('0x26')](respondWithResult(_0x34e6ca,0xc9))[_0x2c4f('0x45')](handleError(_0x34e6ca,null));};exports[_0x2c4f('0x25')]=function(_0x8641d5,_0x3bea93){if(_0x8641d5[_0x2c4f('0x4b')]['id']){delete _0x8641d5['body']['id'];}return db[_0x2c4f('0x2d')]['find']({'where':{'id':_0x8641d5['params']['id']}})['then'](handleEntityNotFound(_0x3bea93,null))[_0x2c4f('0x26')](saveUpdates(_0x8641d5['body'],null))[_0x2c4f('0x26')](respondWithResult(_0x3bea93,null))[_0x2c4f('0x45')](handleError(_0x3bea93,null));};exports[_0x2c4f('0x27')]=function(_0x4d0f66,_0x42ef3f){return db['VoiceQueuesLog'][_0x2c4f('0x49')]({'where':{'id':_0x4d0f66[_0x2c4f('0x47')]['id']}})['then'](handleEntityNotFound(_0x42ef3f,null))['then'](removeEntity(_0x42ef3f,null))[_0x2c4f('0x45')](handleError(_0x42ef3f,null));};
\ No newline at end of file
index 8c929d7..4e2f102 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb205=['define','VoiceQueuesLog','voice_queues_log','event','dtm','lodash','../../config/logger','moment','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports'];(function(_0x3b7e60,_0x1c7668){var _0x329efa=function(_0x36f69b){while(--_0x36f69b){_0x3b7e60['push'](_0x3b7e60['shift']());}};_0x329efa(++_0x1c7668);}(_0xb205,0x1bf));var _0x5b20=function(_0x104dba,_0x545685){_0x104dba=_0x104dba-0x0;var _0xefbe3=_0xb205[_0x104dba];return _0xefbe3;};'use strict';var _=require(_0x5b20('0x0'));var util=require('util');var logger=require(_0x5b20('0x1'))('api');var moment=require(_0x5b20('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5b20('0x3'));var rimraf=require(_0x5b20('0x4'));var config=require(_0x5b20('0x5'));var attributes=require(_0x5b20('0x6'));module[_0x5b20('0x7')]=function(_0x240a92,_0x438b51){return _0x240a92[_0x5b20('0x8')](_0x5b20('0x9'),attributes,{'tableName':_0x5b20('0xa'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x5b20('0xb'),_0x5b20('0xc')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x8bfc=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','VoiceQueuesLog','event_dtm','dtm','util','../../config/logger'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x8bfc,0x9a));var _0xc8bf=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x8bfc[_0x2cf2e9];return _0xd3670d;};'use strict';var _=require('lodash');var util=require(_0xc8bf('0x0'));var logger=require(_0xc8bf('0x1'))('api');var moment=require(_0xc8bf('0x2'));var BPromise=require(_0xc8bf('0x3'));var rp=require(_0xc8bf('0x4'));var fs=require('fs');var path=require(_0xc8bf('0x5'));var rimraf=require(_0xc8bf('0x6'));var config=require(_0xc8bf('0x7'));var attributes=require(_0xc8bf('0x8'));module[_0xc8bf('0x9')]=function(_0x464070,_0x4066a6){return _0x464070['define'](_0xc8bf('0xa'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xc8bf('0xb'),'fields':['event',_0xc8bf('0xc')]}],'timestamps':![]});};
\ No newline at end of file
index 37b6a95..3633caa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b88=['http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x170291,_0x13cec3){var _0x26faee=function(_0x305d0c){while(--_0x305d0c){_0x170291['push'](_0x170291['shift']());}};_0x26faee(++_0x13cec3);}(_0x8b88,0x14f));var _0x88b8=function(_0x16d58c,_0x46aeb7){_0x16d58c=_0x16d58c-0x0;var _0x53742e=_0x8b88[_0x16d58c];return _0x53742e;};'use strict';var _=require('lodash');var util=require(_0x88b8('0x0'));var moment=require('moment');var BPromise=require(_0x88b8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x88b8('0x2'));var db=require(_0x88b8('0x3'))['db'];var utils=require(_0x88b8('0x4'));var logger=require(_0x88b8('0x5'))(_0x88b8('0x6'));var config=require(_0x88b8('0x7'));var jayson=require(_0x88b8('0x8'));var client=jayson[_0x88b8('0x9')][_0x88b8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ea30a,_0x2e4b69,_0x532c85){return new BPromise(function(_0x4d0928,_0xe142ee){return client[_0x88b8('0xb')](_0x3ea30a,_0x532c85)[_0x88b8('0xc')](function(_0x58a205){logger[_0x88b8('0xd')](_0x88b8('0xe'),_0x2e4b69,_0x88b8('0xf'));logger['debug'](_0x88b8('0x10'),_0x2e4b69,_0x88b8('0xf'),JSON[_0x88b8('0x11')](_0x58a205));if(_0x58a205['error']){if(_0x58a205['error'][_0x88b8('0x12')]===0x1f4){logger[_0x88b8('0x13')](_0x88b8('0xe'),_0x2e4b69,_0x58a205[_0x88b8('0x13')]['message']);return _0xe142ee(_0x58a205['error'][_0x88b8('0x14')]);}logger['error'](_0x88b8('0xe'),_0x2e4b69,_0x58a205[_0x88b8('0x13')]['message']);return _0x4d0928(_0x58a205[_0x88b8('0x13')][_0x88b8('0x14')]);}else{logger[_0x88b8('0xd')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2e4b69,'request\x20sent');_0x4d0928(_0x58a205[_0x88b8('0x15')]['message']);}})[_0x88b8('0x16')](function(_0x358a80){logger[_0x88b8('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2e4b69,_0x358a80);_0xe142ee(_0x358a80);});});}
\ No newline at end of file
+var _0xbc47=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x50413a,_0x4c941e){var _0x2aa877=function(_0x486c64){while(--_0x486c64){_0x50413a['push'](_0x50413a['shift']());}};_0x2aa877(++_0x4c941e);}(_0xbc47,0x7a));var _0x7bc4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc47[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7bc4('0x0'));var util=require(_0x7bc4('0x1'));var moment=require(_0x7bc4('0x2'));var BPromise=require(_0x7bc4('0x3'));var rs=require(_0x7bc4('0x4'));var fs=require('fs');var Redis=require(_0x7bc4('0x5'));var db=require(_0x7bc4('0x6'))['db'];var utils=require(_0x7bc4('0x7'));var logger=require(_0x7bc4('0x8'))(_0x7bc4('0x9'));var config=require(_0x7bc4('0xa'));var jayson=require(_0x7bc4('0xb'));var client=jayson[_0x7bc4('0xc')][_0x7bc4('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x44b112,_0xef6235,_0x2245e6){return new BPromise(function(_0x591cd8,_0x32e819){return client[_0x7bc4('0xe')](_0x44b112,_0x2245e6)[_0x7bc4('0xf')](function(_0x5bfcf6){logger[_0x7bc4('0x10')](_0x7bc4('0x11'),_0xef6235,_0x7bc4('0x12'));logger[_0x7bc4('0x13')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0xef6235,_0x7bc4('0x12'),JSON[_0x7bc4('0x14')](_0x5bfcf6));if(_0x5bfcf6[_0x7bc4('0x15')]){if(_0x5bfcf6[_0x7bc4('0x15')][_0x7bc4('0x16')]===0x1f4){logger[_0x7bc4('0x15')](_0x7bc4('0x11'),_0xef6235,_0x5bfcf6[_0x7bc4('0x15')][_0x7bc4('0x17')]);return _0x32e819(_0x5bfcf6[_0x7bc4('0x15')]['message']);}logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0xef6235,_0x5bfcf6[_0x7bc4('0x15')][_0x7bc4('0x17')]);return _0x591cd8(_0x5bfcf6['error'][_0x7bc4('0x17')]);}else{logger['info'](_0x7bc4('0x11'),_0xef6235,_0x7bc4('0x12'));_0x591cd8(_0x5bfcf6['result'][_0x7bc4('0x17')]);}})[_0x7bc4('0x18')](function(_0x8b66c6){logger[_0x7bc4('0x15')]('VoiceQueuesLog,\x20%s,\x20%s',_0xef6235,_0x8b66c6);_0x32e819(_0x8b66c6);});});}
\ No newline at end of file
index 08a915f..c75cd56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf70a=['path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','/:id/downloads','downloads','downloadTranscribe','post','create','/:id/transcribe','runTranscribe','update','delete','destroy','exports','multer','util'];(function(_0x1e0c1d,_0x574e01){var _0x27735e=function(_0x48e3d0){while(--_0x48e3d0){_0x1e0c1d['push'](_0x1e0c1d['shift']());}};_0x27735e(++_0x574e01);}(_0xf70a,0xdf));var _0xaf70=function(_0x2c4d22,_0x4ca120){_0x2c4d22=_0x2c4d22-0x0;var _0x1f0537=_0xf70a[_0x2c4d22];return _0x1f0537;};'use strict';var multer=require(_0xaf70('0x0'));var util=require(_0xaf70('0x1'));var path=require(_0xaf70('0x2'));var timeout=require(_0xaf70('0x3'));var express=require('express');var router=express[_0xaf70('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaf70('0x5'));var config=require(_0xaf70('0x6'));var controller=require('./voiceRecording.controller');router[_0xaf70('0x7')]('/',auth[_0xaf70('0x8')](),controller[_0xaf70('0x9')]);router[_0xaf70('0x7')]('/describe',auth[_0xaf70('0x8')](),controller['describe']);router['get'](_0xaf70('0xa'),auth[_0xaf70('0x8')](),controller[_0xaf70('0xb')]);router[_0xaf70('0x7')](_0xaf70('0xc'),auth[_0xaf70('0x8')](),controller[_0xaf70('0xd')]);router[_0xaf70('0x7')](_0xaf70('0xe'),controller[_0xaf70('0xf')]);router['get']('/:id/transcribe',auth[_0xaf70('0x8')](),controller[_0xaf70('0x10')]);router[_0xaf70('0x11')]('/',auth[_0xaf70('0x8')](),controller[_0xaf70('0x12')]);router[_0xaf70('0x11')](_0xaf70('0x13'),auth['isAuthenticated'](),controller[_0xaf70('0x14')]);router['put'](_0xaf70('0xa'),auth[_0xaf70('0x8')](),controller[_0xaf70('0x15')]);router[_0xaf70('0x16')](_0xaf70('0xa'),auth[_0xaf70('0x8')](),controller[_0xaf70('0x17')]);module[_0xaf70('0x18')]=router;
\ No newline at end of file
+var _0x6c9a=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','index','get','/describe','describe','/:id','isAuthenticated','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','put','update','delete','exports','multer','path'];(function(_0x243217,_0x522951){var _0x478029=function(_0x18d053){while(--_0x18d053){_0x243217['push'](_0x243217['shift']());}};_0x478029(++_0x522951);}(_0x6c9a,0x8f));var _0xa6c9=function(_0x38471f,_0x31fa53){_0x38471f=_0x38471f-0x0;var _0x396ea4=_0x6c9a[_0x38471f];return _0x396ea4;};'use strict';var multer=require(_0xa6c9('0x0'));var util=require('util');var path=require(_0xa6c9('0x1'));var timeout=require(_0xa6c9('0x2'));var express=require(_0xa6c9('0x3'));var router=express[_0xa6c9('0x4')]();var fs_extra=require(_0xa6c9('0x5'));var auth=require(_0xa6c9('0x6'));var interaction=require(_0xa6c9('0x7'));var config=require(_0xa6c9('0x8'));var controller=require(_0xa6c9('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xa6c9('0xa')]);router[_0xa6c9('0xb')](_0xa6c9('0xc'),auth['isAuthenticated'](),controller[_0xa6c9('0xd')]);router[_0xa6c9('0xb')](_0xa6c9('0xe'),auth[_0xa6c9('0xf')](),controller[_0xa6c9('0x10')]);router[_0xa6c9('0xb')](_0xa6c9('0x11'),auth[_0xa6c9('0xf')](),controller[_0xa6c9('0x12')]);router[_0xa6c9('0xb')](_0xa6c9('0x13'),controller[_0xa6c9('0x14')]);router['get'](_0xa6c9('0x15'),auth[_0xa6c9('0xf')](),controller[_0xa6c9('0x16')]);router[_0xa6c9('0x17')]('/',auth[_0xa6c9('0xf')](),controller[_0xa6c9('0x18')]);router['post'](_0xa6c9('0x15'),auth['isAuthenticated'](),controller['runTranscribe']);router[_0xa6c9('0x19')](_0xa6c9('0xe'),auth['isAuthenticated'](),controller[_0xa6c9('0x1a')]);router[_0xa6c9('0x1b')]('/:id',auth[_0xa6c9('0xf')](),controller['destroy']);module[_0xa6c9('0x1c')]=router;
\ No newline at end of file
index d11fe30..51c9195 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(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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 1cce8e9..ae7946f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa790=['VoiceRecording','rawAttributes','fieldName','type','differenceBy','map','format','query','keys','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','find','catch','create','body','describe','download','../../components/encryptor','uniqueid','%s.cypher','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','value','existsSync','decryptFile','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','info','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeName','TranscriptionJob','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeAccountId','transcribeRegion','language','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','save','update','destroy','then','end','sendStatus','error','stack','name','send','index'];(function(_0x4a51c3,_0x115fb4){var _0x449971=function(_0x32ed9a){while(--_0x32ed9a){_0x4a51c3['push'](_0x4a51c3['shift']());}};_0x449971(++_0x115fb4);}(_0xa790,0x107));var _0x0a79=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa790[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x0a79('0x0'));var rimraf=require(_0x0a79('0x1'));var zipdir=require(_0x0a79('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0a79('0x3'));var moment=require('moment');var BPromise=require(_0x0a79('0x4'));var Mustache=require(_0x0a79('0x5'));var util=require(_0x0a79('0x6'));var path=require(_0x0a79('0x7'));var sox=require('sox');var csv=require(_0x0a79('0x8'));var ejs=require(_0x0a79('0x9'));var fs=require('fs');var fs_extra=require(_0x0a79('0xa'));var _=require('lodash');var squel=require(_0x0a79('0xb'));var crypto=require(_0x0a79('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0a79('0xd'));var toCsv=require(_0x0a79('0x8'));var querystring=require(_0x0a79('0xe'));var Papa=require('papaparse');var AWS=require(_0x0a79('0xf'));var uuidv4=require(_0x0a79('0x10'));var Redis=require('ioredis');var authService=require(_0x0a79('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0a79('0x12'));var hardwareService=require(_0x0a79('0x13'));var logger=require(_0x0a79('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x0a79('0x15'));var licenseUtil=require(_0x0a79('0x16'));var db=require(_0x0a79('0x17'))['db'];function respondWithStatusCode(_0x389bb4,_0x6248b4){_0x6248b4=_0x6248b4||0xcc;return function(_0x42e1c8){if(_0x42e1c8){return _0x389bb4['sendStatus'](_0x6248b4);}return _0x389bb4[_0x0a79('0x18')](_0x6248b4)['end']();};}function respondWithResult(_0x2b9f96,_0x3316dd){_0x3316dd=_0x3316dd||0xc8;return function(_0x2b9a5d){if(_0x2b9a5d){return _0x2b9f96[_0x0a79('0x18')](_0x3316dd)[_0x0a79('0x19')](_0x2b9a5d);}};}function respondWithFilteredResult(_0x26bd3c,_0x1f8cd0){return function(_0x29439e){if(_0x29439e){var _0x54a287=typeof _0x1f8cd0[_0x0a79('0x1a')]===_0x0a79('0x1b')&&typeof _0x1f8cd0[_0x0a79('0x1c')]===_0x0a79('0x1b');var _0x2150b8=_0x29439e[_0x0a79('0x1d')];var _0x545cf5=_0x54a287?0x0:_0x1f8cd0[_0x0a79('0x1a')];var _0xf9fa0c=_0x54a287?_0x29439e[_0x0a79('0x1d')]:_0x1f8cd0[_0x0a79('0x1a')]+_0x1f8cd0[_0x0a79('0x1c')];var _0xb4d44c;if(_0xf9fa0c>=_0x2150b8){_0xf9fa0c=_0x2150b8;_0xb4d44c=0xc8;}else{_0xb4d44c=0xce;}_0x26bd3c[_0x0a79('0x18')](_0xb4d44c);return _0x26bd3c[_0x0a79('0x1e')]('Content-Range',_0x545cf5+'-'+_0xf9fa0c+'/'+_0x2150b8)[_0x0a79('0x19')](_0x29439e);}return null;};}function patchUpdates(_0xd4823b){return function(_0x5395b1){try{jsonpatch[_0x0a79('0x1f')](_0x5395b1,_0xd4823b,!![]);}catch(_0x4a383d){return BPromise['reject'](_0x4a383d);}return _0x5395b1[_0x0a79('0x20')]();};}function saveUpdates(_0x15f4aa,_0x4705a7){return function(_0xac5bc1){if(_0xac5bc1){return _0xac5bc1[_0x0a79('0x21')](_0x15f4aa)['then'](function(_0x519ce7){return _0x519ce7;});}return null;};}function removeEntity(_0x1ccc08,_0x2900cb){return function(_0x2d1688){if(_0x2d1688){return _0x2d1688[_0x0a79('0x22')]()[_0x0a79('0x23')](function(){_0x1ccc08['status'](0xcc)[_0x0a79('0x24')]();});}};}function handleEntityNotFound(_0x45d199,_0x5e79dd){return function(_0xbad425){if(!_0xbad425){_0x45d199[_0x0a79('0x25')](0x194);}return _0xbad425;};}function handleError(_0x11610c,_0xdbb697){_0xdbb697=_0xdbb697||0x1f4;return function(_0x196d06){logger[_0x0a79('0x26')](_0x196d06[_0x0a79('0x27')]);if(_0x196d06['name']){delete _0x196d06[_0x0a79('0x28')];}_0x11610c['status'](_0xdbb697)[_0x0a79('0x29')](_0x196d06);};}exports[_0x0a79('0x2a')]=function(_0x1c058d,_0x4020bf){var _0x2f1b2a={},_0x4a9ba1={},_0x182c98={'count':0x0,'rows':[]};var _0x91f14c=_['map'](db[_0x0a79('0x2b')][_0x0a79('0x2c')],function(_0x1bab61){return{'name':_0x1bab61[_0x0a79('0x2d')],'type':_0x1bab61[_0x0a79('0x2e')]['key']};});_0x4a9ba1['model']=_[_0x0a79('0x2f')](_[_0x0a79('0x30')](_0x91f14c,_0x0a79('0x28')),[_0x0a79('0x31')]);_0x4a9ba1[_0x0a79('0x32')]=_[_0x0a79('0x33')](_0x1c058d[_0x0a79('0x32')]);_0x4a9ba1['filters']=_[_0x0a79('0x34')](_0x4a9ba1[_0x0a79('0x35')],_0x4a9ba1[_0x0a79('0x32')]);_0x2f1b2a['attributes']=_['intersection'](_0x4a9ba1[_0x0a79('0x35')],qs[_0x0a79('0x36')](_0x1c058d[_0x0a79('0x32')][_0x0a79('0x36')]));_0x2f1b2a[_0x0a79('0x37')]=_0x2f1b2a['attributes'][_0x0a79('0x38')]?_0x2f1b2a[_0x0a79('0x37')]:_0x4a9ba1[_0x0a79('0x35')];if(!_0x1c058d[_0x0a79('0x32')]['hasOwnProperty'](_0x0a79('0x39'))){_0x2f1b2a[_0x0a79('0x1c')]=qs['limit'](_0x1c058d[_0x0a79('0x32')][_0x0a79('0x1c')]);_0x2f1b2a[_0x0a79('0x1a')]=qs[_0x0a79('0x1a')](_0x1c058d[_0x0a79('0x32')]['offset']);}_0x2f1b2a[_0x0a79('0x3a')]=qs[_0x0a79('0x3b')](_0x1c058d['query'][_0x0a79('0x3b')]);_0x2f1b2a[_0x0a79('0x3c')]=qs['filters'](_[_0x0a79('0x3d')](_0x1c058d[_0x0a79('0x32')],_0x4a9ba1[_0x0a79('0x3e')]),_0x91f14c);if(_0x1c058d[_0x0a79('0x32')]['filter']){_0x2f1b2a['where']=_[_0x0a79('0x3f')](_0x2f1b2a[_0x0a79('0x3c')],{'$or':_['map'](_0x91f14c,function(_0x1f66cd){if(_0x1f66cd[_0x0a79('0x2e')]!==_0x0a79('0x40')){var _0xf3fe59={};_0xf3fe59[_0x1f66cd[_0x0a79('0x28')]]={'$like':'%'+_0x1c058d[_0x0a79('0x32')][_0x0a79('0x41')]+'%'};return _0xf3fe59;}})});}_0x2f1b2a=_[_0x0a79('0x3f')]({},_0x2f1b2a,_0x1c058d[_0x0a79('0x42')]);var _0x267a65={'where':_0x2f1b2a['where']};return db[_0x0a79('0x2b')][_0x0a79('0x1d')](_0x267a65)[_0x0a79('0x23')](function(_0x52a954){_0x182c98['count']=_0x52a954;if(_0x1c058d[_0x0a79('0x32')][_0x0a79('0x43')]){_0x2f1b2a['include']=[{'all':!![]}];}return db[_0x0a79('0x2b')][_0x0a79('0x44')](_0x2f1b2a);})[_0x0a79('0x23')](function(_0x317514){_0x182c98[_0x0a79('0x45')]=_0x317514;return _0x182c98;})[_0x0a79('0x23')](respondWithFilteredResult(_0x4020bf,_0x2f1b2a))['catch'](handleError(_0x4020bf,null));};exports[_0x0a79('0x46')]=function(_0x32a72f,_0x229344){var _0x592b43={'raw':![],'where':{'id':_0x32a72f[_0x0a79('0x47')]['id']}},_0x22a5d3={};_0x22a5d3[_0x0a79('0x35')]=_[_0x0a79('0x33')](db['VoiceRecording'][_0x0a79('0x2c')]);_0x22a5d3[_0x0a79('0x32')]=_[_0x0a79('0x33')](_0x32a72f[_0x0a79('0x32')]);_0x22a5d3[_0x0a79('0x3e')]=_[_0x0a79('0x34')](_0x22a5d3['model'],_0x22a5d3[_0x0a79('0x32')]);_0x592b43[_0x0a79('0x37')]=_[_0x0a79('0x34')](_0x22a5d3['model'],qs[_0x0a79('0x36')](_0x32a72f['query'][_0x0a79('0x36')]));_0x592b43[_0x0a79('0x37')]=_0x592b43[_0x0a79('0x37')][_0x0a79('0x38')]?_0x592b43['attributes']:_0x22a5d3[_0x0a79('0x35')];if(_0x32a72f[_0x0a79('0x32')][_0x0a79('0x43')]){_0x592b43['include']=[{'all':!![]}];}_0x592b43=_['merge']({},_0x592b43,_0x32a72f[_0x0a79('0x42')]);return db[_0x0a79('0x2b')][_0x0a79('0x48')](_0x592b43)[_0x0a79('0x23')](handleEntityNotFound(_0x229344,null))['then'](respondWithResult(_0x229344,null))[_0x0a79('0x49')](handleError(_0x229344,null));};exports[_0x0a79('0x4a')]=function(_0x392fc4,_0x341a45){return db[_0x0a79('0x2b')][_0x0a79('0x4a')](_0x392fc4[_0x0a79('0x4b')],{})[_0x0a79('0x23')](respondWithResult(_0x341a45,0xc9))[_0x0a79('0x49')](handleError(_0x341a45,null));};exports[_0x0a79('0x21')]=function(_0x112c74,_0x293cdc){if(_0x112c74[_0x0a79('0x4b')]['id']){delete _0x112c74[_0x0a79('0x4b')]['id'];}return db[_0x0a79('0x2b')][_0x0a79('0x48')]({'where':{'id':_0x112c74[_0x0a79('0x47')]['id']}})['then'](handleEntityNotFound(_0x293cdc,null))['then'](saveUpdates(_0x112c74[_0x0a79('0x4b')],null))[_0x0a79('0x23')](respondWithResult(_0x293cdc,null))[_0x0a79('0x49')](handleError(_0x293cdc,null));};exports[_0x0a79('0x4c')]=function(_0x4b68a8,_0x3c4df8){return db[_0x0a79('0x2b')]['describe']()[_0x0a79('0x23')](respondWithResult(_0x3c4df8,null))[_0x0a79('0x49')](handleError(_0x3c4df8,null));};exports[_0x0a79('0x4d')]=function(_0x1430fc,_0x102ad8,_0x188e6b){var _0x2082cc=require(_0x0a79('0x4e'));var _0x4778af=![];var _0x1c2c72={};if(_0x1430fc[_0x0a79('0x32')][_0x0a79('0x2e')]&&_0x1430fc[_0x0a79('0x32')][_0x0a79('0x2e')]===_0x0a79('0x4f')){_0x1c2c72[_0x0a79('0x4f')]=_0x1430fc[_0x0a79('0x47')]['id'];}else{_0x1c2c72['id']=_0x1430fc[_0x0a79('0x47')]['id'];}return db[_0x0a79('0x2b')][_0x0a79('0x48')]({'where':_0x1c2c72,'attributes':['id','value'],'raw':!![]})[_0x0a79('0x23')](handleEntityNotFound(_0x102ad8,null))['then'](function(_0x2f0633){if(_0x2f0633){var _0x4375bf=_0x2f0633['value'];var _0x12fbeb=util['format'](_0x0a79('0x50'),_0x4375bf);if(fs['existsSync'](_0x12fbeb)){_0x4778af=!![];return _0x2082cc['decryptFile'](_0x12fbeb,_0x4375bf,config[_0x0a79('0x51')][_0x0a79('0x52')])['then'](function(){return _0x2f0633;});}return _0x2f0633;}})[_0x0a79('0x23')](function(_0x29daef){if(_0x29daef){var _0x243e89=_0x29daef['value'];if(!fs['existsSync'](_0x243e89)){throw new db[(_0x0a79('0x53'))][(_0x0a79('0x54'))](_0x0a79('0x55'));}if(_0x29daef['filename']){return _0x102ad8['download'](_0x243e89,_0x29daef[_0x0a79('0x56')]+path[_0x0a79('0x57')](_0x243e89),function(){if(_0x4778af){fs[_0x0a79('0x58')](_0x243e89);}});}else{return _0x102ad8[_0x0a79('0x4d')](_0x243e89,function(_0x14185a){if(_0x4778af){fs[_0x0a79('0x58')](_0x243e89);}});}}})[_0x0a79('0x49')](function(_0x3180ea){if(_0x3180ea[_0x0a79('0x59')]===_0x0a79('0x55')){_0x102ad8[_0x0a79('0x18')](0x194)['send'](_0x0a79('0x5a'));}else{return handleError(_0x102ad8,null);}});};exports[_0x0a79('0x5b')]=function(_0x3ae9,_0x49e98f,_0x148abc){var _0x300a65=require('../../components/encryptor');var _0x53e012=![];var _0x11e9c4={'$and':[db[_0x0a79('0x5c')][_0x0a79('0x3c')](db[_0x0a79('0x5c')]['fn'](_0x0a79('0x5d'),db[_0x0a79('0x5c')][_0x0a79('0x5e')](_0x0a79('0x4f'))),_0x3ae9[_0x0a79('0x32')][_0x0a79('0x5f')])]};if(_0x3ae9[_0x0a79('0x32')][_0x0a79('0x2e')]&&_0x3ae9[_0x0a79('0x32')][_0x0a79('0x2e')]===_0x0a79('0x4f')){_0x11e9c4[_0x0a79('0x60')][_0x0a79('0x61')]({'uniqueid':_0x3ae9[_0x0a79('0x47')]['id']});}else{_0x11e9c4['$and'][_0x0a79('0x61')]({'id':_0x3ae9[_0x0a79('0x47')]['id']});}return db[_0x0a79('0x2b')][_0x0a79('0x48')]({'where':_0x11e9c4,'attributes':['id',_0x0a79('0x62')],'raw':!![]})[_0x0a79('0x23')](handleEntityNotFound(_0x49e98f,null))['then'](function(_0x229005){if(_0x229005){var _0x20afb5=util[_0x0a79('0x31')](_0x0a79('0x50'),_0x229005[_0x0a79('0x62')]);if(fs[_0x0a79('0x63')](_0x20afb5)){_0x53e012=!![];return _0x300a65[_0x0a79('0x64')](_0x20afb5,_0x229005[_0x0a79('0x62')],config['secrets'][_0x0a79('0x52')])['then'](function(){return _0x229005;});}return _0x229005;}})[_0x0a79('0x23')](function(_0x4297de){if(_0x4297de){if(!fs[_0x0a79('0x63')](_0x4297de[_0x0a79('0x62')])){throw new db['Sequelize'][(_0x0a79('0x54'))](_0x0a79('0x55'));}if(_0x4297de[_0x0a79('0x56')]){return _0x49e98f['download'](_0x4297de[_0x0a79('0x62')],_0x4297de['filename']+path[_0x0a79('0x57')](_0x4297de['value']),function(){if(_0x53e012){fs[_0x0a79('0x58')](_0x4297de[_0x0a79('0x62')]);}});}else{return _0x49e98f[_0x0a79('0x4d')](_0x4297de[_0x0a79('0x62')],function(_0x526350){if(_0x53e012){fs[_0x0a79('0x58')](_0x4297de[_0x0a79('0x62')]);}});}}})[_0x0a79('0x49')](handleError(_0x49e98f,null));};exports['destroy']=function(_0x461517,_0x438f9e){return db[_0x0a79('0x2b')][_0x0a79('0x48')]({'where':{'id':_0x461517[_0x0a79('0x47')]['id']}})[_0x0a79('0x23')](function(_0x187f5d){if(_[_0x0a79('0x65')](_0x187f5d)){throw new ReferenceError(_0x0a79('0x66'));}return _0x187f5d;})[_0x0a79('0x23')](function(_0x23cb4c){var _0x99620f=_0x23cb4c[_0x0a79('0x62')];logger['info'](_0x0a79('0x67'),_0x99620f);if(!_[_0x0a79('0x65')](_0x23cb4c[_0x0a79('0x62')])&&fs[_0x0a79('0x63')](_0x99620f)){logger['info'](_0x0a79('0x68')+_0x99620f+_0x0a79('0x69'));fs[_0x0a79('0x6a')](_0x99620f);}_0x99620f=_0x99620f+_0x0a79('0x6b');if(!_[_0x0a79('0x65')](_0x23cb4c[_0x0a79('0x62')])&&fs['existsSync'](_0x99620f)){logger[_0x0a79('0x6c')](_0x0a79('0x68')+_0x99620f+_0x0a79('0x69'));fs[_0x0a79('0x6a')](_0x99620f);}return _0x23cb4c;})[_0x0a79('0x23')](function(_0x55ab1f){if(!_0x55ab1f)throw new InternalError();return _0x55ab1f['destroy']();})[_0x0a79('0x23')](function(){_0x438f9e[_0x0a79('0x18')](0xcc)['end']();})[_0x0a79('0x49')](handleError(_0x438f9e,null));};function getBucketslist(_0x8e78a5,_0x2d6dac,_0x48a39e){return new Promise(function(_0x1ad830,_0x29ec3e){var _0x1b30c2=new AWS['S3']({'accessKeyId':_0x2d6dac,'secretAccessKey':_0x8e78a5,'region':_0x48a39e});_0x1b30c2[_0x0a79('0x6d')]({},function(_0x1ca5c4,_0x5a5faf){if(_0x1ca5c4){return _0x29ec3e(_0x1ca5c4);}else{return _0x1ad830(_0x5a5faf);}});});}function createBucket(_0xf8d265,_0x3ac191,_0x572825,_0x404af4){return new Promise(function(_0x23fbcc,_0x28a7fd){var _0x1f41b4=new AWS['S3']({'accessKeyId':_0x3ac191,'secretAccessKey':_0xf8d265,'region':_0x572825});_0x1f41b4[_0x0a79('0x6e')]({'Bucket':_0x404af4},function(_0x506016,_0x2b444a){if(_0x506016){return _0x28a7fd(_0x506016);}else{return _0x23fbcc(_0x2b444a);}});});}function uploadFile(_0x38c21e,_0x3d34df,_0x38d6a7,_0x28cc14,_0x2c1949,_0x1a75ee){return new Promise(function(_0x3c40c1,_0x5a5a37){var _0x127d16=new AWS['S3']({'accessKeyId':_0x3d34df,'secretAccessKey':_0x38c21e,'region':_0x38d6a7});_0x127d16[_0x0a79('0x6f')]({'Bucket':_0x28cc14,'Key':_0x2c1949,'Body':_0x1a75ee},function(_0x2ffeb6,_0x44691d){if(_0x2ffeb6){return _0x5a5a37(_0x2ffeb6);}else{return _0x3c40c1(_0x44691d);}});});}function startTranscribe(_0x538480,_0x2ebeda,_0x23e24a,_0x4b2300,_0x255a37,_0x36d3ef){return new Promise(function(_0x14a5b2,_0x3c198e){var _0x52f386=new AWS[(_0x0a79('0x70'))]({'accessKeyId':_0x2ebeda,'secretAccessKey':_0x538480,'region':_0x23e24a});_0x52f386[_0x0a79('0x71')]({'TranscriptionJobName':_0x4b2300,'LanguageCode':_0x255a37,'Media':{'MediaFileUri':_0x36d3ef}},function(_0x192bb1,_0x2eebea){if(_0x192bb1){return _0x3c198e(_0x192bb1);}else{return _0x14a5b2(_0x2eebea);}});});}function transcribe(_0x549d5c,_0x295bd3,_0x22a62d,_0x2fa3fe,_0x2ce259,_0x11ea6b,_0x246a11){return new Promise(function(_0x312704,_0x3d0c4e){var _0x26f2cf={};logger[_0x0a79('0x6c')](util['format'](_0x0a79('0x72'),_0x549d5c,_0x2ce259));return uploadFile(_0x295bd3,_0x22a62d,_0x2fa3fe,_0x2ce259,path['basename'](_0x11ea6b),fs['readFileSync'](_0x11ea6b))[_0x0a79('0x23')](function(_0x111a0){logger[_0x0a79('0x6c')](util[_0x0a79('0x31')](_0x0a79('0x73'),_0x549d5c,_0x2ce259,_0x111a0[_0x0a79('0x74')]));_0x26f2cf[_0x0a79('0x75')]=_0x111a0[_0x0a79('0x76')];_0x26f2cf[_0x0a79('0x77')]=_0x111a0['Location'];logger['info'](util[_0x0a79('0x31')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x549d5c));return startTranscribe(_0x295bd3,_0x22a62d,_0x2fa3fe,uuidv4(),_0x246a11,_0x111a0[_0x0a79('0x74')]);})[_0x0a79('0x23')](function(_0x45caa0){logger['info'](util['format'](_0x0a79('0x78'),_0x549d5c,_0x45caa0['TranscriptionJob'][_0x0a79('0x79')]));_0x26f2cf[_0x0a79('0x7a')]=_0x45caa0[_0x0a79('0x7b')]['TranscriptionJobName'];_0x26f2cf['transcribeStatus']=_0x45caa0[_0x0a79('0x7b')][_0x0a79('0x7c')];return _0x312704(_0x26f2cf);})['catch'](function(_0x2afc94){return _0x3d0c4e(_0x2afc94);});});}exports[_0x0a79('0x7d')]=function(_0x5256a8,_0x49a404,_0x5bdb32){var _0x265351;var _0x164095;var _0x14877d;var _0x529bf3=require(_0x0a79('0x4e'));return db[_0x0a79('0x2b')][_0x0a79('0x7e')]({'where':{'id':_0x5256a8['params']['id']}})[_0x0a79('0x23')](function(_0x45c3d2){if(_0x45c3d2){var _0x219e51=util[_0x0a79('0x31')](_0x0a79('0x50'),_0x45c3d2[_0x0a79('0x62')]);if(fs[_0x0a79('0x63')](_0x219e51)){cypher=!![];return _0x529bf3['decryptFile'](_0x219e51,_0x45c3d2['value'],config[_0x0a79('0x51')][_0x0a79('0x52')])[_0x0a79('0x23')](function(){return _0x45c3d2;});}return _0x45c3d2;}})[_0x0a79('0x23')](function(_0x3b2e57){if(!_0x3b2e57){throw new db[(_0x0a79('0x53'))][(_0x0a79('0x54'))](_0x0a79('0x7f'));}_0x164095=_0x3b2e57;return db[_0x0a79('0x80')][_0x0a79('0x7e')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x49a404,null))[_0x0a79('0x23')](function(_0x2dcedd){if(_0x2dcedd){_0x265351=_0x2dcedd;if(!_0x265351['transcribe']||!_0x265351[_0x0a79('0x81')]||!_0x265351[_0x0a79('0x82')]||!_0x265351[_0x0a79('0x83')]||!_0x265351[_0x0a79('0x75')]){throw new db[(_0x0a79('0x53'))][(_0x0a79('0x54'))]('Transcribe\x20not\x20configured');}if(_0x5256a8[_0x0a79('0x4b')][_0x0a79('0x84')]&&(!_0x265351[_0x0a79('0x85')]||!_0x265351[_0x0a79('0x86')]||!_0x265351[_0x0a79('0x87')]||!_0x265351[_0x0a79('0x83')]||!_0x265351['bucket'])){throw new db[(_0x0a79('0x53'))][(_0x0a79('0x54'))](_0x0a79('0x88'));}return db['CloudProvider'][_0x0a79('0x7e')]({'where':{'id':_0x265351[_0x0a79('0x81')]}});}})[_0x0a79('0x23')](function(_0x18a55f){if(!_0x18a55f){throw new db[(_0x0a79('0x53'))][(_0x0a79('0x54'))](_0x0a79('0x89'));}if(!_0x18a55f[_0x0a79('0x8a')]||!_0x18a55f[_0x0a79('0x8b')]){throw new db[(_0x0a79('0x53'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x14877d=_0x18a55f;return getBucketslist(_0x14877d['data1'],_0x14877d[_0x0a79('0x8b')],_0x265351[_0x0a79('0x82')]);})[_0x0a79('0x23')](function(_0x4255fb){if(_0x4255fb&&_0x4255fb[_0x0a79('0x8c')]){var _0x28c40a=_[_0x0a79('0x48')](_0x4255fb[_0x0a79('0x8c')],function(_0x44880a){return _0x44880a['Name']===_0x265351[_0x0a79('0x75')];});if(!_0x28c40a){logger[_0x0a79('0x6c')](util[_0x0a79('0x31')](_0x0a79('0x8d'),_0x5256a8[_0x0a79('0x47')]['id'],_0x265351[_0x0a79('0x75')]));return createBucket(_0x14877d[_0x0a79('0x8a')],_0x14877d[_0x0a79('0x8b')],_0x265351[_0x0a79('0x82')],_0x265351['bucket']);}logger['info'](util[_0x0a79('0x31')](_0x0a79('0x8e'),_0x5256a8[_0x0a79('0x47')]['id'],_0x265351[_0x0a79('0x75')]));return;}})[_0x0a79('0x23')](function(_0x54c372){if(_0x164095[_0x0a79('0x8f')]===_0x0a79('0x90')){return transcribe(_0x5256a8[_0x0a79('0x47')]['id'],_0x14877d[_0x0a79('0x8a')],_0x14877d[_0x0a79('0x8b')],_0x265351[_0x0a79('0x82')],_0x265351[_0x0a79('0x75')],_0x164095[_0x0a79('0x62')],_0x265351['language']);}else{logger[_0x0a79('0x6c')](util['format'](_0x0a79('0x91'),_0x5256a8[_0x0a79('0x47')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x0a79('0x23')](function(_0x1fd22d){if(_0x1fd22d){_0x1fd22d[_0x0a79('0x92')]=_0x5256a8[_0x0a79('0x4b')][_0x0a79('0x84')];return _0x164095['updateAttributes'](_0x1fd22d);}})['then'](respondWithResult(_0x49a404,null))[_0x0a79('0x49')](handleError(_0x49a404,null));};function writeFile(_0x51b1b1,_0x537a29){return new Promise(function(_0x10c401,_0x3dcb39){fs[_0x0a79('0x93')](_0x537a29,_0x51b1b1,function(_0x22b77d,_0x303fb7){if(_0x22b77d){return _0x3dcb39(_0x22b77d);}else{return _0x10c401(_0x303fb7);}});});}exports[_0x0a79('0x94')]=function(_0x2bfb5a,_0x41f4a1,_0x288faf){return db['VoiceRecording']['findOne']({'where':{'id':_0x2bfb5a['params']['id']}})[_0x0a79('0x23')](handleEntityNotFound(_0x41f4a1))['then'](function(_0x411952){if(_0x411952&&_0x411952[_0x0a79('0x95')]){var _0x1b9ebe=_0x411952[_0x0a79('0x95')];var _0x2ff343=config[_0x0a79('0x96')]+_0x0a79('0x97')+_0x411952['id']+'.txt';if(fs[_0x0a79('0x63')](_0x2ff343)){return _0x2ff343;}return writeFile(_0x1b9ebe,_0x2ff343)[_0x0a79('0x23')](function(){return _0x2ff343;});}else{throw new db[(_0x0a79('0x53'))][(_0x0a79('0x54'))](_0x0a79('0x98'));}})[_0x0a79('0x23')](function(_0x474bb8){return _0x41f4a1[_0x0a79('0x4d')](_0x474bb8);})[_0x0a79('0x49')](handleError(_0x41f4a1));};
\ No newline at end of file
+var _0x3227=['sentiment','sentimentAccountId','sentimentRegion','CloudProvider','data1','data2','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','eml-format','fast-json-patch','moment','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','error','stack','name','index','map','VoiceRecording','fieldName','type','key','model','differenceBy','format','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','create','body','update','find','describe','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','recording','Sequelize','VoiceRecording\x20not\x20found','download','filename','extname','unlink','send','MD5','sequelize','col','token','$and','push','decryptFile','ValidationError','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','unlinkSync','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','destroy','listBuckets','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','language'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3227,0xaa));var _0x7322=function(_0x8ede90,_0x76300c){_0x8ede90=_0x8ede90-0x0;var _0x367160=_0x3227[_0x8ede90];return _0x367160;};'use strict';var emlformat=require(_0x7322('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7322('0x1'));var rp=require('request-promise');var moment=require(_0x7322('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7322('0x3'));var path=require(_0x7322('0x4'));var sox=require('sox');var csv=require(_0x7322('0x5'));var ejs=require(_0x7322('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7322('0x7'));var squel=require(_0x7322('0x8'));var crypto=require(_0x7322('0x9'));var jsforce=require(_0x7322('0xa'));var deskjs=require(_0x7322('0xb'));var toCsv=require(_0x7322('0x5'));var querystring=require(_0x7322('0xc'));var Papa=require(_0x7322('0xd'));var AWS=require(_0x7322('0xe'));var uuidv4=require(_0x7322('0xf'));var Redis=require('ioredis');var authService=require(_0x7322('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7322('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7322('0x12'));var utils=require(_0x7322('0x13'));var config=require(_0x7322('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x7322('0x15'))['db'];function respondWithStatusCode(_0x8ee44e,_0x704621){_0x704621=_0x704621||0xcc;return function(_0x58f828){if(_0x58f828){return _0x8ee44e[_0x7322('0x16')](_0x704621);}return _0x8ee44e[_0x7322('0x17')](_0x704621)[_0x7322('0x18')]();};}function respondWithResult(_0x27669f,_0x1810f2){_0x1810f2=_0x1810f2||0xc8;return function(_0x14498f){if(_0x14498f){return _0x27669f[_0x7322('0x17')](_0x1810f2)[_0x7322('0x19')](_0x14498f);}};}function respondWithFilteredResult(_0x3bbf30,_0x49084e){return function(_0x9db9c9){if(_0x9db9c9){var _0xefae28=typeof _0x49084e[_0x7322('0x1a')]===_0x7322('0x1b')&&typeof _0x49084e['limit']===_0x7322('0x1b');var _0x2a190d=_0x9db9c9[_0x7322('0x1c')];var _0x2b5fb7=_0xefae28?0x0:_0x49084e[_0x7322('0x1a')];var _0x5af4c1=_0xefae28?_0x9db9c9[_0x7322('0x1c')]:_0x49084e[_0x7322('0x1a')]+_0x49084e[_0x7322('0x1d')];var _0xad204d;if(_0x5af4c1>=_0x2a190d){_0x5af4c1=_0x2a190d;_0xad204d=0xc8;}else{_0xad204d=0xce;}_0x3bbf30[_0x7322('0x17')](_0xad204d);return _0x3bbf30[_0x7322('0x1e')](_0x7322('0x1f'),_0x2b5fb7+'-'+_0x5af4c1+'/'+_0x2a190d)[_0x7322('0x19')](_0x9db9c9);}return null;};}function patchUpdates(_0x260d84){return function(_0x3f2d40){try{jsonpatch[_0x7322('0x20')](_0x3f2d40,_0x260d84,!![]);}catch(_0x5c0aa8){return BPromise[_0x7322('0x21')](_0x5c0aa8);}return _0x3f2d40[_0x7322('0x22')]();};}function saveUpdates(_0x32151f,_0x423157){return function(_0x15c058){if(_0x15c058){return _0x15c058['update'](_0x32151f)[_0x7322('0x23')](function(_0xc781c7){return _0xc781c7;});}return null;};}function removeEntity(_0x11b387,_0x513481){return function(_0x49542c){if(_0x49542c){return _0x49542c['destroy']()['then'](function(){_0x11b387[_0x7322('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6d309f,_0x1eb0e5){return function(_0x164eb5){if(!_0x164eb5){_0x6d309f[_0x7322('0x16')](0x194);}return _0x164eb5;};}function handleError(_0x28baed,_0x12298b){_0x12298b=_0x12298b||0x1f4;return function(_0x2ff3be){logger[_0x7322('0x24')](_0x2ff3be[_0x7322('0x25')]);if(_0x2ff3be[_0x7322('0x26')]){delete _0x2ff3be[_0x7322('0x26')];}_0x28baed['status'](_0x12298b)['send'](_0x2ff3be);};}exports[_0x7322('0x27')]=function(_0x4d47ba,_0x2ef271){var _0x545eb4={},_0xfa2421={},_0x2412d1={'count':0x0,'rows':[]};var _0xb4d3c2=_[_0x7322('0x28')](db[_0x7322('0x29')]['rawAttributes'],function(_0x580b58){return{'name':_0x580b58[_0x7322('0x2a')],'type':_0x580b58[_0x7322('0x2b')][_0x7322('0x2c')]};});_0xfa2421[_0x7322('0x2d')]=_[_0x7322('0x2e')](_[_0x7322('0x28')](_0xb4d3c2,_0x7322('0x26')),[_0x7322('0x2f')]);_0xfa2421[_0x7322('0x30')]=_['keys'](_0x4d47ba[_0x7322('0x30')]);_0xfa2421[_0x7322('0x31')]=_[_0x7322('0x32')](_0xfa2421[_0x7322('0x2d')],_0xfa2421[_0x7322('0x30')]);_0x545eb4[_0x7322('0x33')]=_[_0x7322('0x32')](_0xfa2421[_0x7322('0x2d')],qs['fields'](_0x4d47ba[_0x7322('0x30')][_0x7322('0x34')]));_0x545eb4['attributes']=_0x545eb4['attributes'][_0x7322('0x35')]?_0x545eb4['attributes']:_0xfa2421[_0x7322('0x2d')];if(!_0x4d47ba[_0x7322('0x30')]['hasOwnProperty'](_0x7322('0x36'))){_0x545eb4[_0x7322('0x1d')]=qs[_0x7322('0x1d')](_0x4d47ba[_0x7322('0x30')][_0x7322('0x1d')]);_0x545eb4['offset']=qs[_0x7322('0x1a')](_0x4d47ba['query'][_0x7322('0x1a')]);}_0x545eb4['order']=qs['sort'](_0x4d47ba[_0x7322('0x30')][_0x7322('0x37')]);_0x545eb4['where']=qs[_0x7322('0x31')](_[_0x7322('0x38')](_0x4d47ba[_0x7322('0x30')],_0xfa2421[_0x7322('0x31')]),_0xb4d3c2);if(_0x4d47ba[_0x7322('0x30')][_0x7322('0x39')]){_0x545eb4[_0x7322('0x3a')]=_[_0x7322('0x3b')](_0x545eb4[_0x7322('0x3a')],{'$or':_[_0x7322('0x28')](_0xb4d3c2,function(_0x1533db){if(_0x1533db['type']!==_0x7322('0x3c')){var _0x5cb3d8={};_0x5cb3d8[_0x1533db['name']]={'$like':'%'+_0x4d47ba[_0x7322('0x30')][_0x7322('0x39')]+'%'};return _0x5cb3d8;}})});}_0x545eb4=_[_0x7322('0x3b')]({},_0x545eb4,_0x4d47ba[_0x7322('0x3d')]);var _0x360435={'where':_0x545eb4[_0x7322('0x3a')]};return db['VoiceRecording'][_0x7322('0x1c')](_0x360435)[_0x7322('0x23')](function(_0xcba07){_0x2412d1['count']=_0xcba07;if(_0x4d47ba[_0x7322('0x30')][_0x7322('0x3e')]){_0x545eb4[_0x7322('0x3f')]=[{'all':!![]}];}return db[_0x7322('0x29')][_0x7322('0x40')](_0x545eb4);})[_0x7322('0x23')](function(_0x592465){_0x2412d1[_0x7322('0x41')]=_0x592465;return _0x2412d1;})[_0x7322('0x23')](respondWithFilteredResult(_0x2ef271,_0x545eb4))[_0x7322('0x42')](handleError(_0x2ef271,null));};exports['show']=function(_0x579c34,_0x11bc29){var _0x3948a3={'raw':![],'where':{'id':_0x579c34[_0x7322('0x43')]['id']}},_0x569248={};_0x569248[_0x7322('0x2d')]=_[_0x7322('0x44')](db[_0x7322('0x29')]['rawAttributes']);_0x569248[_0x7322('0x30')]=_[_0x7322('0x44')](_0x579c34[_0x7322('0x30')]);_0x569248[_0x7322('0x31')]=_[_0x7322('0x32')](_0x569248[_0x7322('0x2d')],_0x569248[_0x7322('0x30')]);_0x3948a3[_0x7322('0x33')]=_[_0x7322('0x32')](_0x569248[_0x7322('0x2d')],qs[_0x7322('0x34')](_0x579c34['query'][_0x7322('0x34')]));_0x3948a3['attributes']=_0x3948a3[_0x7322('0x33')][_0x7322('0x35')]?_0x3948a3[_0x7322('0x33')]:_0x569248[_0x7322('0x2d')];if(_0x579c34[_0x7322('0x30')][_0x7322('0x3e')]){_0x3948a3[_0x7322('0x3f')]=[{'all':!![]}];}_0x3948a3=_[_0x7322('0x3b')]({},_0x3948a3,_0x579c34[_0x7322('0x3d')]);return db['VoiceRecording']['find'](_0x3948a3)[_0x7322('0x23')](handleEntityNotFound(_0x11bc29,null))['then'](respondWithResult(_0x11bc29,null))[_0x7322('0x42')](handleError(_0x11bc29,null));};exports['create']=function(_0xc2aac,_0x41e2f2){return db['VoiceRecording'][_0x7322('0x45')](_0xc2aac[_0x7322('0x46')],{})['then'](respondWithResult(_0x41e2f2,0xc9))[_0x7322('0x42')](handleError(_0x41e2f2,null));};exports[_0x7322('0x47')]=function(_0x5751f3,_0x24e7dd){if(_0x5751f3['body']['id']){delete _0x5751f3[_0x7322('0x46')]['id'];}return db[_0x7322('0x29')][_0x7322('0x48')]({'where':{'id':_0x5751f3[_0x7322('0x43')]['id']}})['then'](handleEntityNotFound(_0x24e7dd,null))[_0x7322('0x23')](saveUpdates(_0x5751f3[_0x7322('0x46')],null))[_0x7322('0x23')](respondWithResult(_0x24e7dd,null))[_0x7322('0x42')](handleError(_0x24e7dd,null));};exports[_0x7322('0x49')]=function(_0x164444,_0x5a1a5a){return db[_0x7322('0x29')][_0x7322('0x49')]()[_0x7322('0x23')](respondWithResult(_0x5a1a5a,null))['catch'](handleError(_0x5a1a5a,null));};exports['download']=function(_0x16b75c,_0x1df730,_0x4de2f3){var _0x33c993=require(_0x7322('0x4a'));var _0x46903d=![];var _0x35639d={};if(_0x16b75c[_0x7322('0x30')]['type']&&_0x16b75c[_0x7322('0x30')][_0x7322('0x2b')]===_0x7322('0x4b')){_0x35639d[_0x7322('0x4b')]=_0x16b75c[_0x7322('0x43')]['id'];}else{_0x35639d['id']=_0x16b75c[_0x7322('0x43')]['id'];}return db[_0x7322('0x29')][_0x7322('0x48')]({'where':_0x35639d,'attributes':['id',_0x7322('0x4c')],'raw':!![]})[_0x7322('0x23')](handleEntityNotFound(_0x1df730,null))[_0x7322('0x23')](function(_0x4b7385){if(_0x4b7385){var _0x3ce5a9=_0x4b7385[_0x7322('0x4c')];var _0x4d9713=util[_0x7322('0x2f')](_0x7322('0x4d'),_0x3ce5a9);if(fs[_0x7322('0x4e')](_0x4d9713)){_0x46903d=!![];return _0x33c993['decryptFile'](_0x4d9713,_0x3ce5a9,config['secrets'][_0x7322('0x4f')])[_0x7322('0x23')](function(){return _0x4b7385;});}return _0x4b7385;}})[_0x7322('0x23')](function(_0x4e9a8d){if(_0x4e9a8d){var _0x355160=_0x4e9a8d[_0x7322('0x4c')];if(!fs[_0x7322('0x4e')](_0x355160)){throw new db[(_0x7322('0x50'))]['ValidationError'](_0x7322('0x51'));}if(_0x4e9a8d['filename']){return _0x1df730[_0x7322('0x52')](_0x355160,_0x4e9a8d[_0x7322('0x53')]+path[_0x7322('0x54')](_0x355160),function(){if(_0x46903d){fs[_0x7322('0x55')](_0x355160);}});}else{return _0x1df730['download'](_0x355160,function(_0x12336a){if(_0x46903d){fs[_0x7322('0x55')](_0x355160);}});}}})[_0x7322('0x42')](function(_0x5233d0){if(_0x5233d0['message']===_0x7322('0x51')){_0x1df730[_0x7322('0x17')](0x194)[_0x7322('0x56')]('Not\x20found');}else{return handleError(_0x1df730,null);}});};exports['downloads']=function(_0x3e0c62,_0x5289c5,_0x2131f8){var _0x23d129=require(_0x7322('0x4a'));var _0x385e64=![];var _0x250e0c={'$and':[db['sequelize']['where'](db['sequelize']['fn'](_0x7322('0x57'),db[_0x7322('0x58')][_0x7322('0x59')]('uniqueid')),_0x3e0c62[_0x7322('0x30')][_0x7322('0x5a')])]};if(_0x3e0c62[_0x7322('0x30')][_0x7322('0x2b')]&&_0x3e0c62[_0x7322('0x30')]['type']===_0x7322('0x4b')){_0x250e0c[_0x7322('0x5b')][_0x7322('0x5c')]({'uniqueid':_0x3e0c62[_0x7322('0x43')]['id']});}else{_0x250e0c[_0x7322('0x5b')][_0x7322('0x5c')]({'id':_0x3e0c62[_0x7322('0x43')]['id']});}return db[_0x7322('0x29')][_0x7322('0x48')]({'where':_0x250e0c,'attributes':['id',_0x7322('0x4c')],'raw':!![]})[_0x7322('0x23')](handleEntityNotFound(_0x5289c5,null))[_0x7322('0x23')](function(_0x378229){if(_0x378229){var _0x4ed786=util[_0x7322('0x2f')](_0x7322('0x4d'),_0x378229[_0x7322('0x4c')]);if(fs['existsSync'](_0x4ed786)){_0x385e64=!![];return _0x23d129[_0x7322('0x5d')](_0x4ed786,_0x378229['value'],config['secrets'][_0x7322('0x4f')])[_0x7322('0x23')](function(){return _0x378229;});}return _0x378229;}})[_0x7322('0x23')](function(_0x1a3394){if(_0x1a3394){if(!fs[_0x7322('0x4e')](_0x1a3394[_0x7322('0x4c')])){throw new db[(_0x7322('0x50'))][(_0x7322('0x5e'))](_0x7322('0x51'));}if(_0x1a3394[_0x7322('0x53')]){return _0x5289c5[_0x7322('0x52')](_0x1a3394[_0x7322('0x4c')],_0x1a3394['filename']+path[_0x7322('0x54')](_0x1a3394[_0x7322('0x4c')]),function(){if(_0x385e64){fs[_0x7322('0x55')](_0x1a3394[_0x7322('0x4c')]);}});}else{return _0x5289c5[_0x7322('0x52')](_0x1a3394[_0x7322('0x4c')],function(_0x26d51a){if(_0x385e64){fs[_0x7322('0x55')](_0x1a3394[_0x7322('0x4c')]);}});}}})[_0x7322('0x42')](handleError(_0x5289c5,null));};exports['destroy']=function(_0x5526aa,_0x59ecbe){return db[_0x7322('0x29')][_0x7322('0x48')]({'where':{'id':_0x5526aa[_0x7322('0x43')]['id']}})[_0x7322('0x23')](function(_0x5abdc8){if(_[_0x7322('0x5f')](_0x5abdc8)){throw new ReferenceError(_0x7322('0x60'));}return _0x5abdc8;})['then'](function(_0x6b0df){var _0x1862df=_0x6b0df[_0x7322('0x4c')];logger[_0x7322('0x61')](_0x7322('0x62'),_0x1862df);if(!_[_0x7322('0x5f')](_0x6b0df['value'])&&fs[_0x7322('0x4e')](_0x1862df)){logger[_0x7322('0x61')]('File:\x20\x22'+_0x1862df+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x7322('0x63')](_0x1862df);}_0x1862df=_0x1862df+_0x7322('0x64');if(!_['isNil'](_0x6b0df[_0x7322('0x4c')])&&fs['existsSync'](_0x1862df)){logger[_0x7322('0x61')](_0x7322('0x65')+_0x1862df+_0x7322('0x66'));fs['unlinkSync'](_0x1862df);}return _0x6b0df;})[_0x7322('0x23')](function(_0x14a1cc){if(!_0x14a1cc)throw new InternalError();return _0x14a1cc[_0x7322('0x67')]();})[_0x7322('0x23')](function(){_0x59ecbe[_0x7322('0x17')](0xcc)[_0x7322('0x18')]();})[_0x7322('0x42')](handleError(_0x59ecbe,null));};function getBucketslist(_0x2a1dde,_0x4842a5,_0x5757f6){return new Promise(function(_0x2b6448,_0x145a9f){var _0x414ac4=new AWS['S3']({'accessKeyId':_0x4842a5,'secretAccessKey':_0x2a1dde,'region':_0x5757f6});_0x414ac4[_0x7322('0x68')]({},function(_0x4644f2,_0x30fdd0){if(_0x4644f2){return _0x145a9f(_0x4644f2);}else{return _0x2b6448(_0x30fdd0);}});});}function createBucket(_0x404a3e,_0xd038ef,_0x8b017e,_0x5dc2ed){return new Promise(function(_0x457b94,_0xa7a6a){var _0x58115d=new AWS['S3']({'accessKeyId':_0xd038ef,'secretAccessKey':_0x404a3e,'region':_0x8b017e});_0x58115d['createBucket']({'Bucket':_0x5dc2ed},function(_0x29ce32,_0xf085b2){if(_0x29ce32){return _0xa7a6a(_0x29ce32);}else{return _0x457b94(_0xf085b2);}});});}function uploadFile(_0x5591c4,_0x2936cd,_0xc1dcde,_0x351ee8,_0x4e7ddd,_0x386625){return new Promise(function(_0x4582b3,_0x2e644a){var _0x3eee64=new AWS['S3']({'accessKeyId':_0x2936cd,'secretAccessKey':_0x5591c4,'region':_0xc1dcde});_0x3eee64[_0x7322('0x69')]({'Bucket':_0x351ee8,'Key':_0x4e7ddd,'Body':_0x386625},function(_0x5c5280,_0x27e1d2){if(_0x5c5280){return _0x2e644a(_0x5c5280);}else{return _0x4582b3(_0x27e1d2);}});});}function startTranscribe(_0x2917d7,_0x120d83,_0x3b55ef,_0x2fe103,_0x1253d6,_0x420486){return new Promise(function(_0x35fedd,_0x55d192){var _0x5c0fbe=new AWS[(_0x7322('0x6a'))]({'accessKeyId':_0x120d83,'secretAccessKey':_0x2917d7,'region':_0x3b55ef});_0x5c0fbe[_0x7322('0x6b')]({'TranscriptionJobName':_0x2fe103,'LanguageCode':_0x1253d6,'Media':{'MediaFileUri':_0x420486}},function(_0xb6eb97,_0x51d8c5){if(_0xb6eb97){return _0x55d192(_0xb6eb97);}else{return _0x35fedd(_0x51d8c5);}});});}function transcribe(_0x25646e,_0x438db9,_0x2ff5b1,_0x299573,_0x32a35a,_0x154d0a,_0x1d6931){return new Promise(function(_0x59bfe9,_0x4b4d7d){var _0x33c870={};logger[_0x7322('0x61')](util[_0x7322('0x2f')](_0x7322('0x6c'),_0x25646e,_0x32a35a));return uploadFile(_0x438db9,_0x2ff5b1,_0x299573,_0x32a35a,path[_0x7322('0x6d')](_0x154d0a),fs[_0x7322('0x6e')](_0x154d0a))['then'](function(_0x3a7afb){logger[_0x7322('0x61')](util[_0x7322('0x2f')](_0x7322('0x6f'),_0x25646e,_0x32a35a,_0x3a7afb[_0x7322('0x70')]));_0x33c870[_0x7322('0x71')]=_0x3a7afb['Bucket'];_0x33c870[_0x7322('0x72')]=_0x3a7afb[_0x7322('0x70')];logger[_0x7322('0x61')](util[_0x7322('0x2f')](_0x7322('0x73'),_0x25646e));return startTranscribe(_0x438db9,_0x2ff5b1,_0x299573,uuidv4(),_0x1d6931,_0x3a7afb[_0x7322('0x70')]);})[_0x7322('0x23')](function(_0x1a1f76){logger[_0x7322('0x61')](util[_0x7322('0x2f')](_0x7322('0x74'),_0x25646e,_0x1a1f76[_0x7322('0x75')][_0x7322('0x76')]));_0x33c870[_0x7322('0x77')]=_0x1a1f76[_0x7322('0x75')]['TranscriptionJobName'];_0x33c870[_0x7322('0x78')]=_0x1a1f76[_0x7322('0x75')]['TranscriptionJobStatus'];return _0x59bfe9(_0x33c870);})[_0x7322('0x42')](function(_0x404014){return _0x4b4d7d(_0x404014);});});}exports[_0x7322('0x79')]=function(_0x505f82,_0x14487d,_0x43bf93){var _0x2914e4;var _0xf8b2a8;var _0xe46b35;var _0x26a0d4=require('../../components/encryptor');return db[_0x7322('0x29')][_0x7322('0x7a')]({'where':{'id':_0x505f82['params']['id']}})['then'](function(_0xdfc615){if(_0xdfc615){var _0x121dd1=util['format']('%s.cypher',_0xdfc615['value']);if(fs[_0x7322('0x4e')](_0x121dd1)){cypher=!![];return _0x26a0d4['decryptFile'](_0x121dd1,_0xdfc615['value'],config['secrets'][_0x7322('0x4f')])[_0x7322('0x23')](function(){return _0xdfc615;});}return _0xdfc615;}})[_0x7322('0x23')](function(_0x2716fc){if(!_0x2716fc){throw new db['Sequelize'][(_0x7322('0x5e'))](_0x7322('0x7b'));}_0xf8b2a8=_0x2716fc;return db[_0x7322('0x7c')]['findOne']({'where':{'id':0x1}});})[_0x7322('0x23')](handleEntityNotFound(_0x14487d,null))['then'](function(_0x4b33ff){if(_0x4b33ff){_0x2914e4=_0x4b33ff;if(!_0x2914e4[_0x7322('0x7d')]||!_0x2914e4[_0x7322('0x7e')]||!_0x2914e4['transcribeRegion']||!_0x2914e4[_0x7322('0x7f')]||!_0x2914e4[_0x7322('0x71')]){throw new db[(_0x7322('0x50'))][(_0x7322('0x5e'))]('Transcribe\x20not\x20configured');}if(_0x505f82[_0x7322('0x46')]['runSentiment']&&(!_0x2914e4[_0x7322('0x80')]||!_0x2914e4[_0x7322('0x81')]||!_0x2914e4[_0x7322('0x82')]||!_0x2914e4[_0x7322('0x7f')]||!_0x2914e4[_0x7322('0x71')])){throw new db[(_0x7322('0x50'))][(_0x7322('0x5e'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0x7322('0x83')][_0x7322('0x7a')]({'where':{'id':_0x2914e4[_0x7322('0x7e')]}});}})['then'](function(_0x307237){if(!_0x307237){throw new db[(_0x7322('0x50'))][(_0x7322('0x5e'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x307237[_0x7322('0x84')]||!_0x307237[_0x7322('0x85')]){throw new db[(_0x7322('0x50'))][(_0x7322('0x5e'))](_0x7322('0x86'));}_0xe46b35=_0x307237;return getBucketslist(_0xe46b35[_0x7322('0x84')],_0xe46b35[_0x7322('0x85')],_0x2914e4[_0x7322('0x87')]);})[_0x7322('0x23')](function(_0x5d0273){if(_0x5d0273&&_0x5d0273[_0x7322('0x88')]){var _0x22c876=_[_0x7322('0x48')](_0x5d0273['Buckets'],function(_0x52f739){return _0x52f739['Name']===_0x2914e4[_0x7322('0x71')];});if(!_0x22c876){logger[_0x7322('0x61')](util['format'](_0x7322('0x89'),_0x505f82[_0x7322('0x43')]['id'],_0x2914e4['bucket']));return createBucket(_0xe46b35[_0x7322('0x84')],_0xe46b35['data2'],_0x2914e4[_0x7322('0x87')],_0x2914e4['bucket']);}logger[_0x7322('0x61')](util[_0x7322('0x2f')](_0x7322('0x8a'),_0x505f82[_0x7322('0x43')]['id'],_0x2914e4['bucket']));return;}})[_0x7322('0x23')](function(_0x43620f){if(_0xf8b2a8['transcribeStatus']==='NEW'){return transcribe(_0x505f82[_0x7322('0x43')]['id'],_0xe46b35[_0x7322('0x84')],_0xe46b35[_0x7322('0x85')],_0x2914e4[_0x7322('0x87')],_0x2914e4[_0x7322('0x71')],_0xf8b2a8[_0x7322('0x4c')],_0x2914e4[_0x7322('0x7f')]);}else{logger[_0x7322('0x61')](util[_0x7322('0x2f')](_0x7322('0x8b'),_0x505f82[_0x7322('0x43')]['id']));return{'transcribeStatus':_0x7322('0x8c')};}})['then'](function(_0x2d2b8d){if(_0x2d2b8d){_0x2d2b8d[_0x7322('0x8d')]=_0x505f82[_0x7322('0x46')][_0x7322('0x8e')];return _0xf8b2a8[_0x7322('0x8f')](_0x2d2b8d);}})[_0x7322('0x23')](respondWithResult(_0x14487d,null))[_0x7322('0x42')](handleError(_0x14487d,null));};function writeFile(_0x2b1e22,_0x101420){return new Promise(function(_0x57acc3,_0x180048){fs[_0x7322('0x90')](_0x101420,_0x2b1e22,function(_0xb83f72,_0x3ff6be){if(_0xb83f72){return _0x180048(_0xb83f72);}else{return _0x57acc3(_0x3ff6be);}});});}exports[_0x7322('0x91')]=function(_0x3d7cc1,_0x5aca22,_0x18e658){return db['VoiceRecording'][_0x7322('0x7a')]({'where':{'id':_0x3d7cc1[_0x7322('0x43')]['id']}})[_0x7322('0x23')](handleEntityNotFound(_0x5aca22))[_0x7322('0x23')](function(_0x48d3e6){if(_0x48d3e6&&_0x48d3e6[_0x7322('0x92')]){var _0x2c834e=_0x48d3e6[_0x7322('0x92')];var _0x37bcd6=config[_0x7322('0x93')]+_0x7322('0x94')+_0x48d3e6['id']+'.txt';if(fs[_0x7322('0x4e')](_0x37bcd6)){return _0x37bcd6;}return writeFile(_0x2c834e,_0x37bcd6)['then'](function(){return _0x37bcd6;});}else{throw new db['Sequelize'][(_0x7322('0x5e'))]('Transcript\x20not\x20available');}})[_0x7322('0x23')](function(_0x5c7de1){return _0x5aca22[_0x7322('0x52')](_0x5c7de1);})[_0x7322('0x42')](handleError(_0x5aca22));};
\ No newline at end of file
index 2d89401..c783270 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80d4=['rimraf','../../config/environment','./voiceRecording.attributes','define','VoiceRecording','voice_recordings','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x209eaa,_0x1747eb){var _0x31823b=function(_0x55f7d1){while(--_0x55f7d1){_0x209eaa['push'](_0x209eaa['shift']());}};_0x31823b(++_0x1747eb);}(_0x80d4,0x1da));var _0x480d=function(_0x235952,_0x4d469f){_0x235952=_0x235952-0x0;var _0x10583a=_0x80d4[_0x235952];return _0x10583a;};'use strict';var _=require(_0x480d('0x0'));var util=require(_0x480d('0x1'));var logger=require(_0x480d('0x2'))('api');var moment=require(_0x480d('0x3'));var BPromise=require('bluebird');var rp=require(_0x480d('0x4'));var fs=require('fs');var path=require(_0x480d('0x5'));var rimraf=require(_0x480d('0x6'));var config=require(_0x480d('0x7'));var attributes=require(_0x480d('0x8'));module['exports']=function(_0x495ba6,_0x13b4ce){return _0x495ba6[_0x480d('0x9')](_0x480d('0xa'),attributes,{'tableName':_0x480d('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1505=['request-promise','rimraf','../../config/environment','exports','define','VoiceRecording','voice_recordings','uniqueid','lodash','api','bluebird'];(function(_0x5dc641,_0x185e8d){var _0x15bbc7=function(_0x1752d1){while(--_0x1752d1){_0x5dc641['push'](_0x5dc641['shift']());}};_0x15bbc7(++_0x185e8d);}(_0x1505,0x1cb));var _0x5150=function(_0x4ba018,_0x111f07){_0x4ba018=_0x4ba018-0x0;var _0x1b8148=_0x1505[_0x4ba018];return _0x1b8148;};'use strict';var _=require(_0x5150('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5150('0x1'));var moment=require('moment');var BPromise=require(_0x5150('0x2'));var rp=require(_0x5150('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5150('0x4'));var config=require(_0x5150('0x5'));var attributes=require('./voiceRecording.attributes');module[_0x5150('0x6')]=function(_0x43b8e7,_0x505db0){return _0x43b8e7[_0x5150('0x7')](_0x5150('0x8'),attributes,{'tableName':_0x5150('0x9'),'paranoid':![],'indexes':[{'name':_0x5150('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index cf10cd9..cd1469d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb3b=['rpc','jayson/promise','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','raw','options','attributes','limit','stringify','../../components/encryptor','findOne','value','format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','debug','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x3eec42,_0x192ed2){var _0x110bf0=function(_0x4ef488){while(--_0x4ef488){_0x3eec42['push'](_0x3eec42['shift']());}};_0x110bf0(++_0x192ed2);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x1f1511,_0x4ea911){_0x1f1511=_0x1f1511-0x0;var _0x1d9ab8=_0xeb3b[_0x1f1511];return _0x1d9ab8;};'use strict';var _=require(_0xbeb3('0x0'));var util=require(_0xbeb3('0x1'));var moment=require(_0xbeb3('0x2'));var BPromise=require(_0xbeb3('0x3'));var rs=require(_0xbeb3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbeb3('0x5'));var logger=require('../../config/logger')(_0xbeb3('0x6'));var config=require('../../config/environment');var jayson=require(_0xbeb3('0x7'));var client=jayson[_0xbeb3('0x8')][_0xbeb3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x294cc9,_0x406927,_0x143255){return new BPromise(function(_0x5a6a06,_0x241dbb){return client[_0xbeb3('0xa')](_0x294cc9,_0x143255)[_0xbeb3('0xb')](function(_0x3b61ac){logger[_0xbeb3('0xc')](_0xbeb3('0xd'),_0x406927,_0xbeb3('0xe'));logger['debug'](_0xbeb3('0xf'),_0x406927,_0xbeb3('0xe'),JSON['stringify'](_0x3b61ac));if(_0x3b61ac[_0xbeb3('0x10')]){if(_0x3b61ac[_0xbeb3('0x10')][_0xbeb3('0x11')]===0x1f4){logger[_0xbeb3('0x10')](_0xbeb3('0xd'),_0x406927,_0x3b61ac[_0xbeb3('0x10')]['message']);return _0x241dbb(_0x3b61ac['error'][_0xbeb3('0x12')]);}logger[_0xbeb3('0x10')]('VoiceRecording,\x20%s,\x20%s',_0x406927,_0x3b61ac['error'][_0xbeb3('0x12')]);return _0x5a6a06(_0x3b61ac[_0xbeb3('0x10')][_0xbeb3('0x12')]);}else{logger[_0xbeb3('0xc')](_0xbeb3('0xd'),_0x406927,'request\x20sent');_0x5a6a06(_0x3b61ac[_0xbeb3('0x13')]['message']);}})[_0xbeb3('0x14')](function(_0x4e7d99){logger['error']('VoiceRecording,\x20%s,\x20%s',_0x406927,_0x4e7d99);_0x241dbb(_0x4e7d99);});});}exports[_0xbeb3('0x15')]=function(_0x44a4bb){var _0x32275b=this;return new Promise(function(_0x10b15d,_0x5d0689){return db[_0xbeb3('0x16')][_0xbeb3('0x17')](_0x44a4bb[_0xbeb3('0x18')],{'raw':_0x44a4bb['options']?_0x44a4bb['options'][_0xbeb3('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44a4bb['options']?_0x44a4bb[_0xbeb3('0x1a')]['where']||null:null,'attributes':_0x44a4bb['options']?_0x44a4bb[_0xbeb3('0x1a')][_0xbeb3('0x1b')]||null:null,'limit':_0x44a4bb[_0xbeb3('0x1a')]?_0x44a4bb['options'][_0xbeb3('0x1c')]||null:null})[_0xbeb3('0xb')](function(_0x5e047e){logger[_0xbeb3('0xc')](_0xbeb3('0x15'),_0x44a4bb);logger['debug'](_0xbeb3('0x15'),_0x44a4bb,JSON[_0xbeb3('0x1d')](_0x5e047e));_0x10b15d(_0x5e047e);})[_0xbeb3('0x14')](function(_0x42c6c3){logger[_0xbeb3('0x10')](_0xbeb3('0x15'),_0x42c6c3[_0xbeb3('0x12')],_0x44a4bb);_0x5d0689(_0x32275b[_0xbeb3('0x10')](0x1f4,_0x42c6c3[_0xbeb3('0x12')]));});});};exports['CreateVoiceRecording']=function(_0x4e695e){var _0x1f36b9=this;return new Promise(function(_0x520116,_0x3e7f7d){var _0xda808c=require(_0xbeb3('0x1e'));var _0x400f65;return db['Setting'][_0xbeb3('0x1f')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0xbeb3('0xb')](function(_0xab301c){_0x400f65=_0xab301c;return db['VoiceRecording']['create'](_0x4e695e[_0xbeb3('0x18')]);})['then'](function(_0x51f7ef){if(_0x400f65['callRecordingEncryption']&&fs['existsSync'](_0x51f7ef[_0xbeb3('0x20')])){var _0x4e9a04=util[_0xbeb3('0x21')](_0xbeb3('0x22'),_0x51f7ef[_0xbeb3('0x20')]);return _0xda808c[_0xbeb3('0x23')](_0x51f7ef[_0xbeb3('0x20')],_0x4e9a04,config[_0xbeb3('0x24')][_0xbeb3('0x25')])[_0xbeb3('0xb')](function(){fs[_0xbeb3('0x26')](_0x51f7ef[_0xbeb3('0x20')]);logger['info'](_0xbeb3('0x27'));return _0x51f7ef;});}return _0x51f7ef;})[_0xbeb3('0xb')](function(_0x5821dd){logger[_0xbeb3('0xc')](_0xbeb3('0x28'),_0x4e695e);logger[_0xbeb3('0x29')](_0xbeb3('0x28'),_0x4e695e,JSON['stringify'](_0x5821dd));_0x520116(_0x5821dd);})[_0xbeb3('0x14')](function(_0x18f2be){logger[_0xbeb3('0x10')](_0xbeb3('0x28'),_0x18f2be[_0xbeb3('0x12')],_0x4e695e);_0x3e7f7d(_0x1f36b9[_0xbeb3('0x10')](0x1f4,_0x18f2be[_0xbeb3('0x12')]));});});};
\ No newline at end of file
+var _0xcf2f=['request','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','UpdateVoiceRecording','VoiceRecording','update','options','where','attributes','limit','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','body','existsSync','value','format','%s.cypher','encryptFile','recording','then','unlink','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5b51fe,_0x119a93){var _0x3ee131=function(_0x14fb60){while(--_0x14fb60){_0x5b51fe['push'](_0x5b51fe['shift']());}};_0x3ee131(++_0x119a93);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x448b3d,_0x36d81e){_0x448b3d=_0x448b3d-0x0;var _0x3685e3=_0xcf2f[_0x448b3d];return _0x3685e3;};'use strict';var _=require(_0xfcf2('0x0'));var util=require(_0xfcf2('0x1'));var moment=require(_0xfcf2('0x2'));var BPromise=require(_0xfcf2('0x3'));var rs=require(_0xfcf2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfcf2('0x5'))['db'];var utils=require(_0xfcf2('0x6'));var logger=require(_0xfcf2('0x7'))(_0xfcf2('0x8'));var config=require(_0xfcf2('0x9'));var jayson=require(_0xfcf2('0xa'));var client=jayson[_0xfcf2('0xb')][_0xfcf2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x41d4bd,_0x157f48,_0x16b6b2){return new BPromise(function(_0x34f444,_0xb4c510){return client[_0xfcf2('0xd')](_0x41d4bd,_0x16b6b2)['then'](function(_0x575f33){logger['info'](_0xfcf2('0xe'),_0x157f48,_0xfcf2('0xf'));logger['debug'](_0xfcf2('0x10'),_0x157f48,_0xfcf2('0xf'),JSON[_0xfcf2('0x11')](_0x575f33));if(_0x575f33[_0xfcf2('0x12')]){if(_0x575f33['error']['code']===0x1f4){logger[_0xfcf2('0x12')](_0xfcf2('0xe'),_0x157f48,_0x575f33[_0xfcf2('0x12')][_0xfcf2('0x13')]);return _0xb4c510(_0x575f33['error'][_0xfcf2('0x13')]);}logger['error']('VoiceRecording,\x20%s,\x20%s',_0x157f48,_0x575f33['error'][_0xfcf2('0x13')]);return _0x34f444(_0x575f33['error'][_0xfcf2('0x13')]);}else{logger[_0xfcf2('0x14')](_0xfcf2('0xe'),_0x157f48,_0xfcf2('0xf'));_0x34f444(_0x575f33[_0xfcf2('0x15')][_0xfcf2('0x13')]);}})[_0xfcf2('0x16')](function(_0x4d64ce){logger[_0xfcf2('0x12')](_0xfcf2('0xe'),_0x157f48,_0x4d64ce);_0xb4c510(_0x4d64ce);});});}exports[_0xfcf2('0x17')]=function(_0x581d78){var _0xd87472=this;return new Promise(function(_0x1b3c89,_0x33eaa7){return db[_0xfcf2('0x18')][_0xfcf2('0x19')](_0x581d78['body'],{'raw':_0x581d78[_0xfcf2('0x1a')]?_0x581d78[_0xfcf2('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x581d78[_0xfcf2('0x1a')]?_0x581d78[_0xfcf2('0x1a')][_0xfcf2('0x1b')]||null:null,'attributes':_0x581d78[_0xfcf2('0x1a')]?_0x581d78[_0xfcf2('0x1a')][_0xfcf2('0x1c')]||null:null,'limit':_0x581d78[_0xfcf2('0x1a')]?_0x581d78[_0xfcf2('0x1a')][_0xfcf2('0x1d')]||null:null})['then'](function(_0x3790ed){logger[_0xfcf2('0x14')](_0xfcf2('0x17'),_0x581d78);logger['debug'](_0xfcf2('0x17'),_0x581d78,JSON[_0xfcf2('0x11')](_0x3790ed));_0x1b3c89(_0x3790ed);})['catch'](function(_0x3c3774){logger[_0xfcf2('0x12')]('UpdateVoiceRecording',_0x3c3774[_0xfcf2('0x13')],_0x581d78);_0x33eaa7(_0xd87472[_0xfcf2('0x12')](0x1f4,_0x3c3774[_0xfcf2('0x13')]));});});};exports[_0xfcf2('0x1e')]=function(_0x5bb384){var _0x1deca3=this;return new Promise(function(_0x448222,_0x2a9d64){var _0x3779ee=require(_0xfcf2('0x1f'));var _0x2b1d60;return db[_0xfcf2('0x20')][_0xfcf2('0x21')]({'attributes':['id',_0xfcf2('0x22')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x4c2935){_0x2b1d60=_0x4c2935;return db[_0xfcf2('0x18')][_0xfcf2('0x23')](_0x5bb384[_0xfcf2('0x24')]);})['then'](function(_0x560898){if(_0x2b1d60['callRecordingEncryption']&&fs[_0xfcf2('0x25')](_0x560898[_0xfcf2('0x26')])){var _0x40c1ae=util[_0xfcf2('0x27')](_0xfcf2('0x28'),_0x560898[_0xfcf2('0x26')]);return _0x3779ee[_0xfcf2('0x29')](_0x560898['value'],_0x40c1ae,config['secrets'][_0xfcf2('0x2a')])[_0xfcf2('0x2b')](function(){fs[_0xfcf2('0x2c')](_0x560898[_0xfcf2('0x26')]);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0x560898;});}return _0x560898;})[_0xfcf2('0x2b')](function(_0x5310e6){logger[_0xfcf2('0x14')](_0xfcf2('0x1e'),_0x5bb384);logger['debug'](_0xfcf2('0x1e'),_0x5bb384,JSON[_0xfcf2('0x11')](_0x5310e6));_0x448222(_0x5310e6);})[_0xfcf2('0x16')](function(_0x4046c6){logger[_0xfcf2('0x12')](_0xfcf2('0x1e'),_0x4046c6[_0xfcf2('0x13')],_0x5bb384);_0x2a9d64(_0x1deca3['error'](0x1f4,_0x4046c6[_0xfcf2('0x13')]));});});};
\ No newline at end of file
index ad18651..65945c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfea6=['put','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','./voiceTransferReport.controller','get','isAuthenticated','/describe','/:id','show','post','create'];(function(_0x1e3207,_0x3ce24a){var _0x5b986e=function(_0xa8a77e){while(--_0xa8a77e){_0x1e3207['push'](_0x1e3207['shift']());}};_0x5b986e(++_0x3ce24a);}(_0xfea6,0xb8));var _0x6fea=function(_0x53f763,_0x27e520){_0x53f763=_0x53f763-0x0;var _0x290cb3=_0xfea6[_0x53f763];return _0x290cb3;};'use strict';var multer=require(_0x6fea('0x0'));var util=require('util');var path=require(_0x6fea('0x1'));var timeout=require(_0x6fea('0x2'));var express=require(_0x6fea('0x3'));var router=express['Router']();var fs_extra=require(_0x6fea('0x4'));var auth=require(_0x6fea('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6fea('0x6'));router[_0x6fea('0x7')]('/',auth[_0x6fea('0x8')](),controller['index']);router['get'](_0x6fea('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x6fea('0x7')](_0x6fea('0xa'),auth[_0x6fea('0x8')](),controller[_0x6fea('0xb')]);router[_0x6fea('0xc')]('/',auth[_0x6fea('0x8')](),controller[_0x6fea('0xd')]);router[_0x6fea('0xe')](_0x6fea('0xa'),auth[_0x6fea('0x8')](),controller[_0x6fea('0xf')]);router[_0x6fea('0x10')]('/:id',auth[_0x6fea('0x8')](),controller['destroy']);module[_0x6fea('0x11')]=router;
\ No newline at end of file
+var _0x7a67=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','update','delete','destroy','multer'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x7a67,0x133));var _0x77a6=function(_0x33ede9,_0x24ea2c){_0x33ede9=_0x33ede9-0x0;var _0x4ae572=_0x7a67[_0x33ede9];return _0x4ae572;};'use strict';var multer=require(_0x77a6('0x0'));var util=require(_0x77a6('0x1'));var path=require(_0x77a6('0x2'));var timeout=require(_0x77a6('0x3'));var express=require(_0x77a6('0x4'));var router=express[_0x77a6('0x5')]();var fs_extra=require(_0x77a6('0x6'));var auth=require(_0x77a6('0x7'));var interaction=require(_0x77a6('0x8'));var config=require(_0x77a6('0x9'));var controller=require(_0x77a6('0xa'));router[_0x77a6('0xb')]('/',auth[_0x77a6('0xc')](),controller[_0x77a6('0xd')]);router['get'](_0x77a6('0xe'),auth[_0x77a6('0xc')](),controller['describe']);router[_0x77a6('0xb')](_0x77a6('0xf'),auth[_0x77a6('0xc')](),controller[_0x77a6('0x10')]);router['post']('/',auth[_0x77a6('0xc')](),controller[_0x77a6('0x11')]);router[_0x77a6('0x12')]('/:id',auth[_0x77a6('0xc')](),controller[_0x77a6('0x13')]);router[_0x77a6('0x14')]('/:id',auth[_0x77a6('0xc')](),controller[_0x77a6('0x15')]);module['exports']=router;
\ No newline at end of file
index d724a91..174d9c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97ab=['sequelize','moment','exports','blind','attended','STRING','ENUM','Yes'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x97ab,0xf0));var _0xb97a=function(_0x45a943,_0x29ac6f){_0x45a943=_0x45a943-0x0;var _0x51def7=_0x97ab[_0x45a943];return _0x51def7;};'use strict';var Sequelize=require(_0xb97a('0x0'));var moment=require(_0xb97a('0x1'));module[_0xb97a('0x2')]={'type':{'type':Sequelize['ENUM'](_0xb97a('0x3'),_0xb97a('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0xb97a('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xb97a('0x5')]},'transferercalleridname':{'type':Sequelize[_0xb97a('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xb97a('0x5')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0xb97a('0x5')]},'transferercontext':{'type':Sequelize[_0xb97a('0x5')]},'transfererexten':{'type':Sequelize[_0xb97a('0x5')]},'transfererlinkedid':{'type':Sequelize[_0xb97a('0x5')]},'transfereechannel':{'type':Sequelize[_0xb97a('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xb97a('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xb97a('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xb97a('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0xb97a('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0xb97a('0x5')]},'transfereecontext':{'type':Sequelize[_0xb97a('0x5')]},'transfereeexten':{'type':Sequelize[_0xb97a('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xb97a('0x5')]},'isexternal':{'type':Sequelize[_0xb97a('0x6')](_0xb97a('0x7'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xb97a('0x5')]}};
\ No newline at end of file
+var _0x4f7e=['moment','exports','ENUM','STRING','Yes'];(function(_0x5f250d,_0x43b12e){var _0x5ec51b=function(_0x52dc2e){while(--_0x52dc2e){_0x5f250d['push'](_0x5f250d['shift']());}};_0x5ec51b(++_0x43b12e);}(_0x4f7e,0x1a4));var _0xe4f7=function(_0x17519e,_0x4f3958){_0x17519e=_0x17519e-0x0;var _0x43bf69=_0x4f7e[_0x17519e];return _0x43bf69;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xe4f7('0x0'));module[_0xe4f7('0x1')]={'type':{'type':Sequelize[_0xe4f7('0x2')]('blind','attended')},'result':{'type':Sequelize[_0xe4f7('0x3')]},'transfererchannel':{'type':Sequelize[_0xe4f7('0x3')]},'transferercalleridnum':{'type':Sequelize[_0xe4f7('0x3')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xe4f7('0x3')]},'transfereraccountcode':{'type':Sequelize[_0xe4f7('0x3')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0xe4f7('0x3')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xe4f7('0x3')]},'transfereecalleridnum':{'type':Sequelize[_0xe4f7('0x3')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0xe4f7('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0xe4f7('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0xe4f7('0x3')]},'transfereecontext':{'type':Sequelize[_0xe4f7('0x3')]},'transfereeexten':{'type':Sequelize[_0xe4f7('0x3')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0xe4f7('0x2')](_0xe4f7('0x4'),'No')},'context':{'type':Sequelize[_0xe4f7('0x3')]},'extension':{'type':Sequelize[_0xe4f7('0x3')]}};
\ No newline at end of file
index 2871be9..4b3ae65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7be6=['where','pick','filter','merge','includeAll','include','findAll','rows','show','params','options','find','create','body','update','catch','describe','rimraf','zip-dir','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','save','then','destroy','error','stack','name','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x7be6,0xec));var _0x67be=function(_0x2fa159,_0x44f4d7){_0x2fa159=_0x2fa159-0x0;var _0xd6b5f4=_0x7be6[_0x2fa159];return _0xd6b5f4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x67be('0x0'));var zipdir=require(_0x67be('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x67be('0x2'));var moment=require(_0x67be('0x3'));var BPromise=require(_0x67be('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x67be('0x5'));var csv=require(_0x67be('0x6'));var ejs=require(_0x67be('0x7'));var fs=require('fs');var fs_extra=require(_0x67be('0x8'));var _=require(_0x67be('0x9'));var squel=require(_0x67be('0xa'));var crypto=require(_0x67be('0xb'));var jsforce=require(_0x67be('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x67be('0x6'));var querystring=require(_0x67be('0xd'));var Papa=require('papaparse');var Redis=require(_0x67be('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x67be('0xf'));var logger=require(_0x67be('0x10'))(_0x67be('0x11'));var utils=require(_0x67be('0x12'));var config=require(_0x67be('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x67be('0x14'))['db'];function respondWithStatusCode(_0x168753,_0x4e5fb1){_0x4e5fb1=_0x4e5fb1||0xcc;return function(_0xc83331){if(_0xc83331){return _0x168753[_0x67be('0x15')](_0x4e5fb1);}return _0x168753[_0x67be('0x16')](_0x4e5fb1)[_0x67be('0x17')]();};}function respondWithResult(_0x4a1f88,_0x240b24){_0x240b24=_0x240b24||0xc8;return function(_0xdeb5dd){if(_0xdeb5dd){return _0x4a1f88['status'](_0x240b24)['json'](_0xdeb5dd);}};}function respondWithFilteredResult(_0x42c381,_0x23263c){return function(_0x4ea652){if(_0x4ea652){var _0x17f6f1=typeof _0x23263c[_0x67be('0x18')]===_0x67be('0x19')&&typeof _0x23263c[_0x67be('0x1a')]===_0x67be('0x19');var _0x1e5294=_0x4ea652[_0x67be('0x1b')];var _0xab10b0=_0x17f6f1?0x0:_0x23263c[_0x67be('0x18')];var _0x39831a=_0x17f6f1?_0x4ea652['count']:_0x23263c['offset']+_0x23263c[_0x67be('0x1a')];var _0xc26ec5;if(_0x39831a>=_0x1e5294){_0x39831a=_0x1e5294;_0xc26ec5=0xc8;}else{_0xc26ec5=0xce;}_0x42c381[_0x67be('0x16')](_0xc26ec5);return _0x42c381['set']('Content-Range',_0xab10b0+'-'+_0x39831a+'/'+_0x1e5294)[_0x67be('0x1c')](_0x4ea652);}return null;};}function patchUpdates(_0x4dcd25){return function(_0x27b528){try{jsonpatch[_0x67be('0x1d')](_0x27b528,_0x4dcd25,!![]);}catch(_0x445020){return BPromise[_0x67be('0x1e')](_0x445020);}return _0x27b528[_0x67be('0x1f')]();};}function saveUpdates(_0x5107a7,_0x387ac8){return function(_0x3dcb3d){if(_0x3dcb3d){return _0x3dcb3d['update'](_0x5107a7)[_0x67be('0x20')](function(_0x4d3f08){return _0x4d3f08;});}return null;};}function removeEntity(_0x5acbb4,_0x24f0f1){return function(_0x2619ac){if(_0x2619ac){return _0x2619ac[_0x67be('0x21')]()[_0x67be('0x20')](function(){_0x5acbb4[_0x67be('0x16')](0xcc)[_0x67be('0x17')]();});}};}function handleEntityNotFound(_0x3e4634,_0x1c9a1c){return function(_0x791f98){if(!_0x791f98){_0x3e4634['sendStatus'](0x194);}return _0x791f98;};}function handleError(_0x324d6f,_0x3aff2a){_0x3aff2a=_0x3aff2a||0x1f4;return function(_0x4dff35){logger[_0x67be('0x22')](_0x4dff35[_0x67be('0x23')]);if(_0x4dff35[_0x67be('0x24')]){delete _0x4dff35[_0x67be('0x24')];}_0x324d6f[_0x67be('0x16')](_0x3aff2a)['send'](_0x4dff35);};}exports[_0x67be('0x25')]=function(_0x4321ab,_0xb1f30){var _0x280b74={},_0x2566bb={},_0x378cf4={'count':0x0,'rows':[]};var _0x2ec964=_[_0x67be('0x26')](db[_0x67be('0x27')][_0x67be('0x28')],function(_0x3c5c99){return{'name':_0x3c5c99[_0x67be('0x29')],'type':_0x3c5c99[_0x67be('0x2a')][_0x67be('0x2b')]};});_0x2566bb[_0x67be('0x2c')]=_[_0x67be('0x26')](_0x2ec964,_0x67be('0x24'));_0x2566bb[_0x67be('0x2d')]=_[_0x67be('0x2e')](_0x4321ab['query']);_0x2566bb[_0x67be('0x2f')]=_[_0x67be('0x30')](_0x2566bb[_0x67be('0x2c')],_0x2566bb[_0x67be('0x2d')]);_0x280b74['attributes']=_[_0x67be('0x30')](_0x2566bb[_0x67be('0x2c')],qs[_0x67be('0x31')](_0x4321ab[_0x67be('0x2d')]['fields']));_0x280b74[_0x67be('0x32')]=_0x280b74[_0x67be('0x32')][_0x67be('0x33')]?_0x280b74[_0x67be('0x32')]:_0x2566bb[_0x67be('0x2c')];if(!_0x4321ab[_0x67be('0x2d')][_0x67be('0x34')](_0x67be('0x35'))){_0x280b74[_0x67be('0x1a')]=qs[_0x67be('0x1a')](_0x4321ab[_0x67be('0x2d')][_0x67be('0x1a')]);_0x280b74[_0x67be('0x18')]=qs[_0x67be('0x18')](_0x4321ab[_0x67be('0x2d')][_0x67be('0x18')]);}_0x280b74[_0x67be('0x36')]=qs[_0x67be('0x37')](_0x4321ab[_0x67be('0x2d')][_0x67be('0x37')]);_0x280b74[_0x67be('0x38')]=qs[_0x67be('0x2f')](_[_0x67be('0x39')](_0x4321ab['query'],_0x2566bb[_0x67be('0x2f')]),_0x2ec964);if(_0x4321ab['query'][_0x67be('0x3a')]){_0x280b74[_0x67be('0x38')]=_['merge'](_0x280b74[_0x67be('0x38')],{'$or':_[_0x67be('0x26')](_0x2ec964,function(_0x330102){if(_0x330102['type']!=='VIRTUAL'){var _0x5e49db={};_0x5e49db[_0x330102[_0x67be('0x24')]]={'$like':'%'+_0x4321ab['query']['filter']+'%'};return _0x5e49db;}})});}_0x280b74=_[_0x67be('0x3b')]({},_0x280b74,_0x4321ab['options']);var _0x1f17c5={'where':_0x280b74[_0x67be('0x38')]};return db['VoiceTransferReport'][_0x67be('0x1b')](_0x1f17c5)[_0x67be('0x20')](function(_0x5180f4){_0x378cf4[_0x67be('0x1b')]=_0x5180f4;if(_0x4321ab[_0x67be('0x2d')][_0x67be('0x3c')]){_0x280b74[_0x67be('0x3d')]=[{'all':!![]}];}return db[_0x67be('0x27')][_0x67be('0x3e')](_0x280b74);})[_0x67be('0x20')](function(_0x2c0069){_0x378cf4[_0x67be('0x3f')]=_0x2c0069;return _0x378cf4;})[_0x67be('0x20')](respondWithFilteredResult(_0xb1f30,_0x280b74))['catch'](handleError(_0xb1f30,null));};exports[_0x67be('0x40')]=function(_0x4b6cea,_0x4d665f){var _0x16de48={'raw':!![],'where':{'id':_0x4b6cea[_0x67be('0x41')]['id']}},_0x16c6e1={};_0x16c6e1[_0x67be('0x2c')]=_[_0x67be('0x2e')](db[_0x67be('0x27')][_0x67be('0x28')]);_0x16c6e1[_0x67be('0x2d')]=_[_0x67be('0x2e')](_0x4b6cea[_0x67be('0x2d')]);_0x16c6e1[_0x67be('0x2f')]=_[_0x67be('0x30')](_0x16c6e1['model'],_0x16c6e1['query']);_0x16de48[_0x67be('0x32')]=_[_0x67be('0x30')](_0x16c6e1[_0x67be('0x2c')],qs['fields'](_0x4b6cea[_0x67be('0x2d')]['fields']));_0x16de48[_0x67be('0x32')]=_0x16de48[_0x67be('0x32')][_0x67be('0x33')]?_0x16de48[_0x67be('0x32')]:_0x16c6e1[_0x67be('0x2c')];if(_0x4b6cea[_0x67be('0x2d')][_0x67be('0x3c')]){_0x16de48['include']=[{'all':!![]}];}_0x16de48=_[_0x67be('0x3b')]({},_0x16de48,_0x4b6cea[_0x67be('0x42')]);return db[_0x67be('0x27')][_0x67be('0x43')](_0x16de48)[_0x67be('0x20')](handleEntityNotFound(_0x4d665f,null))[_0x67be('0x20')](respondWithResult(_0x4d665f,null))['catch'](handleError(_0x4d665f,null));};exports[_0x67be('0x44')]=function(_0x13e5f7,_0xed1317){return db['VoiceTransferReport']['create'](_0x13e5f7[_0x67be('0x45')],{})[_0x67be('0x20')](respondWithResult(_0xed1317,0xc9))['catch'](handleError(_0xed1317,null));};exports[_0x67be('0x46')]=function(_0x3fcc09,_0xb2a673){if(_0x3fcc09['body']['id']){delete _0x3fcc09['body']['id'];}return db[_0x67be('0x27')][_0x67be('0x43')]({'where':{'id':_0x3fcc09[_0x67be('0x41')]['id']}})[_0x67be('0x20')](handleEntityNotFound(_0xb2a673,null))['then'](saveUpdates(_0x3fcc09[_0x67be('0x45')],null))[_0x67be('0x20')](respondWithResult(_0xb2a673,null))[_0x67be('0x47')](handleError(_0xb2a673,null));};exports['destroy']=function(_0x2a2772,_0xb52dbc){return db[_0x67be('0x27')][_0x67be('0x43')]({'where':{'id':_0x2a2772[_0x67be('0x41')]['id']}})[_0x67be('0x20')](handleEntityNotFound(_0xb52dbc,null))[_0x67be('0x20')](removeEntity(_0xb52dbc,null))[_0x67be('0x47')](handleError(_0xb52dbc,null));};exports[_0x67be('0x48')]=function(_0x1c4398,_0x36b344){return db[_0x67be('0x27')][_0x67be('0x48')]()[_0x67be('0x20')](respondWithResult(_0x36b344,null))[_0x67be('0x47')](handleError(_0x36b344,null));};
\ No newline at end of file
+var _0xce28=['../../mysqldb','sendStatus','end','offset','limit','undefined','count','status','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','VoiceTransferReport','rawAttributes','fieldName','type','key','map','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','findAll','catch','show','params','filters','include','options','find','create','body','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xce28,0x1e9));var _0x8ce2=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xce28[_0x39096d];return _0x13da4f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8ce2('0x0'));var jsonpatch=require(_0x8ce2('0x1'));var rp=require('request-promise');var moment=require(_0x8ce2('0x2'));var BPromise=require(_0x8ce2('0x3'));var Mustache=require('mustache');var util=require(_0x8ce2('0x4'));var path=require(_0x8ce2('0x5'));var sox=require('sox');var csv=require(_0x8ce2('0x6'));var ejs=require(_0x8ce2('0x7'));var fs=require('fs');var fs_extra=require(_0x8ce2('0x8'));var _=require(_0x8ce2('0x9'));var squel=require(_0x8ce2('0xa'));var crypto=require(_0x8ce2('0xb'));var jsforce=require(_0x8ce2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8ce2('0x6'));var querystring=require(_0x8ce2('0xd'));var Papa=require(_0x8ce2('0xe'));var Redis=require(_0x8ce2('0xf'));var authService=require(_0x8ce2('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ce2('0x11'))(_0x8ce2('0x12'));var utils=require(_0x8ce2('0x13'));var config=require(_0x8ce2('0x14'));var licenseUtil=require(_0x8ce2('0x15'));var db=require(_0x8ce2('0x16'))['db'];function respondWithStatusCode(_0x50f22e,_0x26f040){_0x26f040=_0x26f040||0xcc;return function(_0x219a1b){if(_0x219a1b){return _0x50f22e[_0x8ce2('0x17')](_0x26f040);}return _0x50f22e['status'](_0x26f040)[_0x8ce2('0x18')]();};}function respondWithResult(_0x57a149,_0x406b6d){_0x406b6d=_0x406b6d||0xc8;return function(_0x5bb1d5){if(_0x5bb1d5){return _0x57a149['status'](_0x406b6d)['json'](_0x5bb1d5);}};}function respondWithFilteredResult(_0x33ab7,_0x2a98f3){return function(_0x27e9e4){if(_0x27e9e4){var _0x38515e=typeof _0x2a98f3[_0x8ce2('0x19')]==='undefined'&&typeof _0x2a98f3[_0x8ce2('0x1a')]===_0x8ce2('0x1b');var _0xe7b24f=_0x27e9e4['count'];var _0x1123e7=_0x38515e?0x0:_0x2a98f3[_0x8ce2('0x19')];var _0x56eca1=_0x38515e?_0x27e9e4[_0x8ce2('0x1c')]:_0x2a98f3['offset']+_0x2a98f3[_0x8ce2('0x1a')];var _0x5d7b3a;if(_0x56eca1>=_0xe7b24f){_0x56eca1=_0xe7b24f;_0x5d7b3a=0xc8;}else{_0x5d7b3a=0xce;}_0x33ab7[_0x8ce2('0x1d')](_0x5d7b3a);return _0x33ab7[_0x8ce2('0x1e')](_0x8ce2('0x1f'),_0x1123e7+'-'+_0x56eca1+'/'+_0xe7b24f)['json'](_0x27e9e4);}return null;};}function patchUpdates(_0x11aa7f){return function(_0x4b1338){try{jsonpatch[_0x8ce2('0x20')](_0x4b1338,_0x11aa7f,!![]);}catch(_0x58055d){return BPromise[_0x8ce2('0x21')](_0x58055d);}return _0x4b1338['save']();};}function saveUpdates(_0x31b3f2,_0x598bf1){return function(_0x984122){if(_0x984122){return _0x984122[_0x8ce2('0x22')](_0x31b3f2)[_0x8ce2('0x23')](function(_0x548086){return _0x548086;});}return null;};}function removeEntity(_0x10883a,_0x4860bf){return function(_0x342c58){if(_0x342c58){return _0x342c58[_0x8ce2('0x24')]()[_0x8ce2('0x23')](function(){_0x10883a[_0x8ce2('0x1d')](0xcc)[_0x8ce2('0x18')]();});}};}function handleEntityNotFound(_0x4eb4bb,_0x4b592f){return function(_0x1c3a41){if(!_0x1c3a41){_0x4eb4bb[_0x8ce2('0x17')](0x194);}return _0x1c3a41;};}function handleError(_0x39e1be,_0x463488){_0x463488=_0x463488||0x1f4;return function(_0x581445){logger[_0x8ce2('0x25')](_0x581445['stack']);if(_0x581445[_0x8ce2('0x26')]){delete _0x581445['name'];}_0x39e1be[_0x8ce2('0x1d')](_0x463488)[_0x8ce2('0x27')](_0x581445);};}exports[_0x8ce2('0x28')]=function(_0x57ed5c,_0x3331f3){var _0x5858c0={},_0x4b5bcc={},_0x3aa5a9={'count':0x0,'rows':[]};var _0x1b8d28=_['map'](db[_0x8ce2('0x29')][_0x8ce2('0x2a')],function(_0x31a82a){return{'name':_0x31a82a[_0x8ce2('0x2b')],'type':_0x31a82a[_0x8ce2('0x2c')][_0x8ce2('0x2d')]};});_0x4b5bcc['model']=_[_0x8ce2('0x2e')](_0x1b8d28,_0x8ce2('0x26'));_0x4b5bcc[_0x8ce2('0x2f')]=_[_0x8ce2('0x30')](_0x57ed5c[_0x8ce2('0x2f')]);_0x4b5bcc['filters']=_[_0x8ce2('0x31')](_0x4b5bcc['model'],_0x4b5bcc[_0x8ce2('0x2f')]);_0x5858c0[_0x8ce2('0x32')]=_[_0x8ce2('0x31')](_0x4b5bcc[_0x8ce2('0x33')],qs[_0x8ce2('0x34')](_0x57ed5c[_0x8ce2('0x2f')][_0x8ce2('0x34')]));_0x5858c0[_0x8ce2('0x32')]=_0x5858c0[_0x8ce2('0x32')][_0x8ce2('0x35')]?_0x5858c0[_0x8ce2('0x32')]:_0x4b5bcc['model'];if(!_0x57ed5c[_0x8ce2('0x2f')][_0x8ce2('0x36')](_0x8ce2('0x37'))){_0x5858c0[_0x8ce2('0x1a')]=qs[_0x8ce2('0x1a')](_0x57ed5c['query'][_0x8ce2('0x1a')]);_0x5858c0[_0x8ce2('0x19')]=qs['offset'](_0x57ed5c[_0x8ce2('0x2f')]['offset']);}_0x5858c0[_0x8ce2('0x38')]=qs[_0x8ce2('0x39')](_0x57ed5c[_0x8ce2('0x2f')][_0x8ce2('0x39')]);_0x5858c0[_0x8ce2('0x3a')]=qs['filters'](_['pick'](_0x57ed5c[_0x8ce2('0x2f')],_0x4b5bcc['filters']),_0x1b8d28);if(_0x57ed5c[_0x8ce2('0x2f')]['filter']){_0x5858c0[_0x8ce2('0x3a')]=_[_0x8ce2('0x3b')](_0x5858c0[_0x8ce2('0x3a')],{'$or':_[_0x8ce2('0x2e')](_0x1b8d28,function(_0x140b81){if(_0x140b81[_0x8ce2('0x2c')]!==_0x8ce2('0x3c')){var _0xb8ec3e={};_0xb8ec3e[_0x140b81[_0x8ce2('0x26')]]={'$like':'%'+_0x57ed5c[_0x8ce2('0x2f')][_0x8ce2('0x3d')]+'%'};return _0xb8ec3e;}})});}_0x5858c0=_['merge']({},_0x5858c0,_0x57ed5c['options']);var _0x439845={'where':_0x5858c0[_0x8ce2('0x3a')]};return db[_0x8ce2('0x29')][_0x8ce2('0x1c')](_0x439845)[_0x8ce2('0x23')](function(_0x166b1a){_0x3aa5a9['count']=_0x166b1a;if(_0x57ed5c[_0x8ce2('0x2f')][_0x8ce2('0x3e')]){_0x5858c0['include']=[{'all':!![]}];}return db[_0x8ce2('0x29')][_0x8ce2('0x3f')](_0x5858c0);})[_0x8ce2('0x23')](function(_0x55d58f){_0x3aa5a9['rows']=_0x55d58f;return _0x3aa5a9;})[_0x8ce2('0x23')](respondWithFilteredResult(_0x3331f3,_0x5858c0))[_0x8ce2('0x40')](handleError(_0x3331f3,null));};exports[_0x8ce2('0x41')]=function(_0x51a0aa,_0x39df57){var _0x241784={'raw':!![],'where':{'id':_0x51a0aa[_0x8ce2('0x42')]['id']}},_0x166de3={};_0x166de3[_0x8ce2('0x33')]=_[_0x8ce2('0x30')](db['VoiceTransferReport'][_0x8ce2('0x2a')]);_0x166de3[_0x8ce2('0x2f')]=_[_0x8ce2('0x30')](_0x51a0aa[_0x8ce2('0x2f')]);_0x166de3[_0x8ce2('0x43')]=_[_0x8ce2('0x31')](_0x166de3['model'],_0x166de3[_0x8ce2('0x2f')]);_0x241784['attributes']=_[_0x8ce2('0x31')](_0x166de3['model'],qs[_0x8ce2('0x34')](_0x51a0aa[_0x8ce2('0x2f')]['fields']));_0x241784[_0x8ce2('0x32')]=_0x241784[_0x8ce2('0x32')][_0x8ce2('0x35')]?_0x241784[_0x8ce2('0x32')]:_0x166de3[_0x8ce2('0x33')];if(_0x51a0aa[_0x8ce2('0x2f')][_0x8ce2('0x3e')]){_0x241784[_0x8ce2('0x44')]=[{'all':!![]}];}_0x241784=_['merge']({},_0x241784,_0x51a0aa[_0x8ce2('0x45')]);return db['VoiceTransferReport'][_0x8ce2('0x46')](_0x241784)['then'](handleEntityNotFound(_0x39df57,null))[_0x8ce2('0x23')](respondWithResult(_0x39df57,null))[_0x8ce2('0x40')](handleError(_0x39df57,null));};exports['create']=function(_0x242c39,_0x2831e9){return db[_0x8ce2('0x29')][_0x8ce2('0x47')](_0x242c39[_0x8ce2('0x48')],{})[_0x8ce2('0x23')](respondWithResult(_0x2831e9,0xc9))['catch'](handleError(_0x2831e9,null));};exports[_0x8ce2('0x22')]=function(_0x428714,_0xe155b3){if(_0x428714[_0x8ce2('0x48')]['id']){delete _0x428714[_0x8ce2('0x48')]['id'];}return db[_0x8ce2('0x29')][_0x8ce2('0x46')]({'where':{'id':_0x428714[_0x8ce2('0x42')]['id']}})[_0x8ce2('0x23')](handleEntityNotFound(_0xe155b3,null))['then'](saveUpdates(_0x428714[_0x8ce2('0x48')],null))[_0x8ce2('0x23')](respondWithResult(_0xe155b3,null))['catch'](handleError(_0xe155b3,null));};exports[_0x8ce2('0x24')]=function(_0x2d1f9d,_0x15c8a3){return db[_0x8ce2('0x29')][_0x8ce2('0x46')]({'where':{'id':_0x2d1f9d[_0x8ce2('0x42')]['id']}})[_0x8ce2('0x23')](handleEntityNotFound(_0x15c8a3,null))[_0x8ce2('0x23')](removeEntity(_0x15c8a3,null))[_0x8ce2('0x40')](handleError(_0x15c8a3,null));};exports['describe']=function(_0x5e9911,_0x21b324){return db[_0x8ce2('0x29')]['describe']()[_0x8ce2('0x23')](respondWithResult(_0x21b324,null))[_0x8ce2('0x40')](handleError(_0x21b324,null));};
\ No newline at end of file
index e0e0858..81fdb88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfdba=['define','VoiceTransferReport','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./voiceTransferReport.attributes','exports'];(function(_0x1ce2e3,_0x3644a2){var _0x144c18=function(_0x1d0eee){while(--_0x1d0eee){_0x1ce2e3['push'](_0x1ce2e3['shift']());}};_0x144c18(++_0x3644a2);}(_0xfdba,0x115));var _0xafdb=function(_0x2f32a5,_0x667956){_0x2f32a5=_0x2f32a5-0x0;var _0x224e4d=_0xfdba[_0x2f32a5];return _0x224e4d;};'use strict';var _=require(_0xafdb('0x0'));var util=require('util');var logger=require(_0xafdb('0x1'))(_0xafdb('0x2'));var moment=require('moment');var BPromise=require(_0xafdb('0x3'));var rp=require(_0xafdb('0x4'));var fs=require('fs');var path=require(_0xafdb('0x5'));var rimraf=require(_0xafdb('0x6'));var config=require('../../config/environment');var attributes=require(_0xafdb('0x7'));module[_0xafdb('0x8')]=function(_0x5abb73,_0x9eea69){return _0x5abb73[_0xafdb('0x9')](_0xafdb('0xa'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb340=['moment','bluebird','request-promise','path','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api'];(function(_0x40d548,_0x233d52){var _0x1791f8=function(_0x526c95){while(--_0x526c95){_0x40d548['push'](_0x40d548['shift']());}};_0x1791f8(++_0x233d52);}(_0xb340,0xc0));var _0x0b34=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xb340[_0x164eca];return _0x2ce562;};'use strict';var _=require(_0x0b34('0x0'));var util=require(_0x0b34('0x1'));var logger=require(_0x0b34('0x2'))(_0x0b34('0x3'));var moment=require(_0x0b34('0x4'));var BPromise=require(_0x0b34('0x5'));var rp=require(_0x0b34('0x6'));var fs=require('fs');var path=require(_0x0b34('0x7'));var rimraf=require('rimraf');var config=require(_0x0b34('0x8'));var attributes=require(_0x0b34('0x9'));module[_0x0b34('0xa')]=function(_0x186061,_0x3e744f){return _0x186061[_0x0b34('0xb')](_0x0b34('0xc'),attributes,{'tableName':_0x0b34('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c275140..73fb877 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07b2=['raw','then','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','VoiceTransferReport,\x20%s,\x20%s','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','options'];(function(_0x59b2da,_0x4aa82a){var _0x549a92=function(_0x4bb62a){while(--_0x4bb62a){_0x59b2da['push'](_0x59b2da['shift']());}};_0x549a92(++_0x4aa82a);}(_0x07b2,0xa4));var _0x207b=function(_0x300549,_0x44ea69){_0x300549=_0x300549-0x0;var _0xc2a10e=_0x07b2[_0x300549];return _0xc2a10e;};'use strict';var _=require(_0x207b('0x0'));var util=require('util');var moment=require(_0x207b('0x1'));var BPromise=require(_0x207b('0x2'));var rs=require(_0x207b('0x3'));var fs=require('fs');var Redis=require(_0x207b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x207b('0x5'));var logger=require('../../config/logger')(_0x207b('0x6'));var config=require('../../config/environment');var jayson=require(_0x207b('0x7'));var client=jayson[_0x207b('0x8')][_0x207b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14a714,_0xf1ed01,_0x313ad5){return new BPromise(function(_0x30e46f,_0x2ddd0a){return client[_0x207b('0xa')](_0x14a714,_0x313ad5)['then'](function(_0x23c9bb){logger[_0x207b('0xb')]('VoiceTransferReport,\x20%s,\x20%s',_0xf1ed01,_0x207b('0xc'));logger[_0x207b('0xd')](_0x207b('0xe'),_0xf1ed01,_0x207b('0xc'),JSON['stringify'](_0x23c9bb));if(_0x23c9bb[_0x207b('0xf')]){if(_0x23c9bb[_0x207b('0xf')][_0x207b('0x10')]===0x1f4){logger[_0x207b('0xf')](_0x207b('0x11'),_0xf1ed01,_0x23c9bb[_0x207b('0xf')][_0x207b('0x12')]);return _0x2ddd0a(_0x23c9bb[_0x207b('0xf')][_0x207b('0x12')]);}logger[_0x207b('0xf')](_0x207b('0x11'),_0xf1ed01,_0x23c9bb[_0x207b('0xf')][_0x207b('0x12')]);return _0x30e46f(_0x23c9bb[_0x207b('0xf')][_0x207b('0x12')]);}else{logger[_0x207b('0xb')](_0x207b('0x11'),_0xf1ed01,'request\x20sent');_0x30e46f(_0x23c9bb[_0x207b('0x13')][_0x207b('0x12')]);}})[_0x207b('0x14')](function(_0x47de8e){logger[_0x207b('0xf')](_0x207b('0x11'),_0xf1ed01,_0x47de8e);_0x2ddd0a(_0x47de8e);});});}exports[_0x207b('0x15')]=function(_0x1d92e0){var _0xb0fb1c=this;return new Promise(function(_0x25c665,_0x2a8166){return db[_0x207b('0x16')][_0x207b('0x17')](_0x1d92e0['body'],{'raw':_0x1d92e0[_0x207b('0x18')]?_0x1d92e0[_0x207b('0x18')][_0x207b('0x19')]===undefined?!![]:![]:!![]})[_0x207b('0x1a')](function(_0x2bd169){logger[_0x207b('0xb')](_0x207b('0x15'),_0x1d92e0);logger[_0x207b('0xd')]('CreateVoiceTransferReport',_0x1d92e0,JSON['stringify'](_0x2bd169));_0x25c665(_0x2bd169);})[_0x207b('0x14')](function(_0x3fe947){logger[_0x207b('0xf')](_0x207b('0x15'),_0x3fe947['message'],_0x1d92e0);_0x2a8166(_0xb0fb1c[_0x207b('0xf')](0x1f4,_0x3fe947[_0x207b('0x12')]));});});};
\ No newline at end of file
+var _0xaffb=['code','message','result','CreateVoiceTransferReport','create','body','options','then','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0xa0419b,_0x5945d7){var _0x206ec1=function(_0x35ca2d){while(--_0x35ca2d){_0xa0419b['push'](_0xa0419b['shift']());}};_0x206ec1(++_0x5945d7);}(_0xaffb,0x1c3));var _0xbaff=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0xaffb[_0x39c734];return _0xb2a2f9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbaff('0x0'));var BPromise=require(_0xbaff('0x1'));var rs=require(_0xbaff('0x2'));var fs=require('fs');var Redis=require(_0xbaff('0x3'));var db=require(_0xbaff('0x4'))['db'];var utils=require(_0xbaff('0x5'));var logger=require('../../config/logger')(_0xbaff('0x6'));var config=require(_0xbaff('0x7'));var jayson=require(_0xbaff('0x8'));var client=jayson[_0xbaff('0x9')][_0xbaff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26edd7,_0x1f84a7,_0x386c5c){return new BPromise(function(_0x57afce,_0x50f975){return client['request'](_0x26edd7,_0x386c5c)['then'](function(_0x4d7e1e){logger[_0xbaff('0xb')](_0xbaff('0xc'),_0x1f84a7,_0xbaff('0xd'));logger[_0xbaff('0xe')](_0xbaff('0xf'),_0x1f84a7,_0xbaff('0xd'),JSON['stringify'](_0x4d7e1e));if(_0x4d7e1e[_0xbaff('0x10')]){if(_0x4d7e1e[_0xbaff('0x10')][_0xbaff('0x11')]===0x1f4){logger[_0xbaff('0x10')](_0xbaff('0xc'),_0x1f84a7,_0x4d7e1e['error'][_0xbaff('0x12')]);return _0x50f975(_0x4d7e1e[_0xbaff('0x10')]['message']);}logger[_0xbaff('0x10')](_0xbaff('0xc'),_0x1f84a7,_0x4d7e1e[_0xbaff('0x10')][_0xbaff('0x12')]);return _0x57afce(_0x4d7e1e[_0xbaff('0x10')][_0xbaff('0x12')]);}else{logger[_0xbaff('0xb')](_0xbaff('0xc'),_0x1f84a7,_0xbaff('0xd'));_0x57afce(_0x4d7e1e[_0xbaff('0x13')][_0xbaff('0x12')]);}})['catch'](function(_0x104468){logger[_0xbaff('0x10')](_0xbaff('0xc'),_0x1f84a7,_0x104468);_0x50f975(_0x104468);});});}exports[_0xbaff('0x14')]=function(_0x335935){var _0x4de641=this;return new Promise(function(_0x9120f2,_0x31e8c7){return db['VoiceTransferReport'][_0xbaff('0x15')](_0x335935[_0xbaff('0x16')],{'raw':_0x335935[_0xbaff('0x17')]?_0x335935[_0xbaff('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xbaff('0x18')](function(_0x53dd60){logger['info'](_0xbaff('0x14'),_0x335935);logger[_0xbaff('0xe')](_0xbaff('0x14'),_0x335935,JSON['stringify'](_0x53dd60));_0x9120f2(_0x53dd60);})[_0xbaff('0x19')](function(_0x2ce774){logger[_0xbaff('0x10')](_0xbaff('0x14'),_0x2ce774[_0xbaff('0x12')],_0x335935);_0x31e8c7(_0x4de641[_0xbaff('0x10')](0x1f4,_0x2ce774['message']));});});};
\ No newline at end of file
index 4f12a5f..04247b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc15c=['/transfer','transfer','express','Router','../../components/auth/service','post','/originate','isAuthenticated','canUpdate','originate','/hangup','hangup','/answer','answer','/unhold','unhold','/calls','calls'];(function(_0x51cb98,_0xe9c7b6){var _0x4b4233=function(_0x27d978){while(--_0x27d978){_0x51cb98['push'](_0x51cb98['shift']());}};_0x4b4233(++_0xe9c7b6);}(_0xc15c,0x1a0));var _0xcc15=function(_0x4da8d4,_0x32b9cc){_0x4da8d4=_0x4da8d4-0x0;var _0x18c0ce=_0xc15c[_0x4da8d4];return _0x18c0ce;};'use strict';var express=require(_0xcc15('0x0'));var router=express[_0xcc15('0x1')]();var auth=require(_0xcc15('0x2'));var controller=require('./webbar.controller');router[_0xcc15('0x3')](_0xcc15('0x4'),auth[_0xcc15('0x5')](),auth[_0xcc15('0x6')](),controller[_0xcc15('0x7')]);router[_0xcc15('0x3')](_0xcc15('0x8'),auth[_0xcc15('0x5')](),auth['canUpdate'](),controller[_0xcc15('0x9')]);router[_0xcc15('0x3')](_0xcc15('0xa'),auth[_0xcc15('0x5')](),auth[_0xcc15('0x6')](),controller[_0xcc15('0xb')]);router[_0xcc15('0x3')]('/hold',auth[_0xcc15('0x5')](),auth[_0xcc15('0x6')](),controller['hold']);router['post'](_0xcc15('0xc'),auth[_0xcc15('0x5')](),auth[_0xcc15('0x6')](),controller[_0xcc15('0xd')]);router[_0xcc15('0x3')](_0xcc15('0xe'),auth[_0xcc15('0x5')](),auth[_0xcc15('0x6')](),controller[_0xcc15('0xf')]);router['post'](_0xcc15('0x10'),auth[_0xcc15('0x5')](),auth['canUpdate'](),controller[_0xcc15('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x5d29=['answer','/hold','hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','canUpdate','originate','/hangup','hangup'];(function(_0x4750a4,_0x2af3a2){var _0x2be305=function(_0x27815d){while(--_0x27815d){_0x4750a4['push'](_0x4750a4['shift']());}};_0x2be305(++_0x2af3a2);}(_0x5d29,0x15e));var _0x95d2=function(_0x595b48,_0x1195c3){_0x595b48=_0x595b48-0x0;var _0x5a982c=_0x5d29[_0x595b48];return _0x5a982c;};'use strict';var express=require('express');var router=express[_0x95d2('0x0')]();var auth=require(_0x95d2('0x1'));var controller=require(_0x95d2('0x2'));router[_0x95d2('0x3')](_0x95d2('0x4'),auth[_0x95d2('0x5')](),auth[_0x95d2('0x6')](),controller[_0x95d2('0x7')]);router[_0x95d2('0x3')](_0x95d2('0x8'),auth[_0x95d2('0x5')](),auth[_0x95d2('0x6')](),controller[_0x95d2('0x9')]);router[_0x95d2('0x3')]('/answer',auth[_0x95d2('0x5')](),auth['canUpdate'](),controller[_0x95d2('0xa')]);router[_0x95d2('0x3')](_0x95d2('0xb'),auth[_0x95d2('0x5')](),auth[_0x95d2('0x6')](),controller[_0x95d2('0xc')]);router[_0x95d2('0x3')](_0x95d2('0xd'),auth['isAuthenticated'](),auth[_0x95d2('0x6')](),controller[_0x95d2('0xe')]);router['post'](_0x95d2('0xf'),auth[_0x95d2('0x5')](),auth[_0x95d2('0x6')](),controller[_0x95d2('0x10')]);router[_0x95d2('0x3')](_0x95d2('0x11'),auth[_0x95d2('0x5')](),auth['canUpdate'](),controller[_0x95d2('0x12')]);module[_0x95d2('0x13')]=router;
\ No newline at end of file
index 635133a..36aafdf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7980=['webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','calls','calls\x20fired:','UserId','conference','conference\x20fired:','webbar:conference','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','jayson/promise','client','http','../../config/logger','webbarapi','redis','localhost','socket.io-emitter','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','emit','log','handleError:','error','name','send','status','NotFound','request','then','code','message','result','User','agent','VoiceChannels','all','filter','sessionId','length','sessionId\x20','\x20not\x20found!','originate','info','originate\x20fired:','body','validate','callNumber','callerId','user:%s','webbar:originate','json','originate\x20executed!','catch','hangup','hangup\x20fired:','userId','entityFound:','webbar:hangup','hangup\x20executed!','answer\x20fired:','format','answer\x20executed!','hold\x20fired:'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x7980,0xab));var _0x0798=function(_0xaeff9a,_0x1f31e6){_0xaeff9a=_0xaeff9a-0x0;var _0x16208d=_0x7980[_0xaeff9a];return _0x16208d;};'use strict';var path=require(_0x0798('0x0'));var fs=require('fs');var _=require(_0x0798('0x1'));var db=require(_0x0798('0x2'))['db'];var config=require(_0x0798('0x3'));var util=require(_0x0798('0x4'));var BPromise=require('bluebird');var jayson=require(_0x0798('0x5'));var amiClient=jayson[_0x0798('0x6')][_0x0798('0x7')]({'port':0x232a});var logger=require(_0x0798('0x8'))(_0x0798('0x9'));var Redis=require('ioredis');config[_0x0798('0xa')]=_['defaults'](config[_0x0798('0xa')],{'host':_0x0798('0xb'),'port':0x18eb});var io=require(_0x0798('0xc'))(new Redis(config['redis']));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x0798('0xd'),'required':[!![],_0x0798('0xe')]},'callNumber':{'type':_0x0798('0xf'),'required':[!![],_0x0798('0x10')]},'callerId':{'type':_0x0798('0xf')},'callbackUrl':{'type':_0x0798('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0x0798('0xd'),'required':[!![],_0x0798('0xe')]},'sessionId':{'type':_0x0798('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x0798('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x0798('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x0798('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':[!![],_0x0798('0x11')]},'transferNumber':{'type':_0x0798('0xf'),'required':[!![],_0x0798('0x12')]}});var holdValidation=new Schema({'userId':{'type':_0x0798('0xd'),'required':[!![],_0x0798('0xe')]},'sessionId':{'type':_0x0798('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x0798('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0x0798('0xd'),'required':[!![],_0x0798('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});function emit(_0x21c30b,_0x45cae6,_0x258081){logger['info'](_0x21c30b,_0x45cae6,JSON['stringify'](_0x258081));io['to'](_0x21c30b)[_0x0798('0x13')](_0x45cae6,_0x258081);}function handleError(_0x502635){return function(_0x41e217){console[_0x0798('0x14')](_0x0798('0x15'),_0x41e217,_0x41e217 instanceof RangeError);logger[_0x0798('0x16')](_0x41e217['stack']);if(_0x41e217 instanceof RangeError){if(_0x41e217[_0x0798('0x17')]){delete _0x41e217[_0x0798('0x17')];}_0x502635['status'](0x194)[_0x0798('0x18')](_0x41e217);}else{if(_0x41e217[_0x0798('0x17')]){delete _0x41e217[_0x0798('0x17')];}_0x502635[_0x0798('0x19')](0x1f4)[_0x0798('0x18')](_0x41e217);}};}function checkError(){return function(_0x273ba8){if(!_0x273ba8){throw new RangeError(_0x0798('0x1a'));}return _0x273ba8;};}function respondWithRpcPromise(_0x212ad5,_0x23b37d){return new BPromise(function(_0x4a86d5,_0x2aaabf){var _0x35c141=amiClient;return _0x35c141[_0x0798('0x1b')](_0x212ad5,_0x23b37d)[_0x0798('0x1c')](function(_0x20654b){if(_0x20654b[_0x0798('0x16')]){if(_0x20654b['error'][_0x0798('0x1d')]===0x1f4){return _0x2aaabf(_0x20654b[_0x0798('0x16')][_0x0798('0x1e')]);}return _0x4a86d5(_0x20654b[_0x0798('0x16')][_0x0798('0x1e')]);}else{_0x4a86d5(_0x20654b[_0x0798('0x1f')]);}})['catch'](function(_0x43d99f){_0x2aaabf(_0x43d99f);});});}function getAgent(_0x14f828){return db[_0x0798('0x20')]['findOne']({'where':{'id':_0x14f828,'role':_0x0798('0x21')}})['then'](checkError());}function getAgentCheckSession(_0x53a3d7,_0x406030){return new BPromise(function(_0x2dfbff,_0x134d24){var _0xaa949b=respondWithRpcPromise(_0x0798('0x22'));var _0x161244=getAgent(_0x53a3d7);Promise[_0x0798('0x23')]([_0xaa949b,_0x161244])[_0x0798('0x1c')](function(_0x5bbe3d){var _0x167960=_0x5bbe3d[0x0];var _0x4f5d1d=_0x5bbe3d[0x1];var _0x5f1780=_[_0x0798('0x24')](_0x167960['rows'],function(_0x1dabd5){return _0x1dabd5['UserId']==_0x4f5d1d['id']&&_0x1dabd5[_0x0798('0x25')]==_0x406030;});if(_0x5f1780[_0x0798('0x26')]==0x1){_0x2dfbff(_0x4f5d1d);}else{_0x134d24(new RangeError(_0x0798('0x27')+_0x406030+_0x0798('0x28')));}});});}exports[_0x0798('0x29')]=function(_0x1ebd07,_0xa1376e){logger[_0x0798('0x2a')](_0x0798('0x2b'),_0x1ebd07[_0x0798('0x2c')]);var _0x54a955=originateValidation[_0x0798('0x2d')](_0x1ebd07['body']);if(_0x54a955[_0x0798('0x26')]>0x0){return _0xa1376e['status'](0x190)['json'](_0x54a955);}var _0x104d23=_0x1ebd07[_0x0798('0x2c')]['userId'];var _0x49d5b8=_0x1ebd07[_0x0798('0x2c')][_0x0798('0x2e')];var _0x322adf=_0x1ebd07[_0x0798('0x2c')][_0x0798('0x2f')];var _0x2ad922=_0x1ebd07['body']['callbackUrl'];return getAgent(_0x104d23)[_0x0798('0x1c')](function(_0x23a70b){logger[_0x0798('0x2a')]('entityFound:',_0x23a70b['name']);emit(util['format'](_0x0798('0x30'),_0x23a70b[_0x0798('0x17')]),_0x0798('0x31'),{'callNumber':_0x49d5b8,'callerId':_0x322adf,'callbackUrl':_0x2ad922});return _0xa1376e[_0x0798('0x19')](0xc8)[_0x0798('0x32')]({'error':![],'message':_0x0798('0x33')});})[_0x0798('0x34')](handleError(_0xa1376e));};exports[_0x0798('0x35')]=function(_0x502556,_0x16dae6){logger['info'](_0x0798('0x36'),_0x502556[_0x0798('0x2c')]);var _0x2caa82=hangupValidation['validate'](_0x502556[_0x0798('0x2c')]);if(_0x2caa82['length']>0x0){return _0x16dae6[_0x0798('0x19')](0x190)[_0x0798('0x32')](_0x2caa82);}var _0x223751=_0x502556['body'][_0x0798('0x37')];var _0xb5937b=_0x502556['body'][_0x0798('0x25')];return getAgent(_0x223751)['then'](function(_0x4e9d94){logger[_0x0798('0x2a')](_0x0798('0x38'),_0x4e9d94['name']);emit(util['format'](_0x0798('0x30'),_0x4e9d94[_0x0798('0x17')]),_0x0798('0x39'),{'sessionId':_0xb5937b});return _0x16dae6[_0x0798('0x19')](0xc8)[_0x0798('0x32')]({'error':![],'message':_0x0798('0x3a')});})[_0x0798('0x34')](handleError(_0x16dae6));};exports['answer']=function(_0x3aa79c,_0x11c5bf){logger[_0x0798('0x2a')](_0x0798('0x3b'),_0x3aa79c[_0x0798('0x2c')]);var _0x26e9cb=answerValidation['validate'](_0x3aa79c[_0x0798('0x2c')]);if(_0x26e9cb[_0x0798('0x26')]>0x0){return _0x11c5bf[_0x0798('0x19')](0x190)[_0x0798('0x32')](_0x26e9cb);}var _0x387450=_0x3aa79c[_0x0798('0x2c')][_0x0798('0x37')];var _0x10a50a=_0x3aa79c[_0x0798('0x2c')][_0x0798('0x25')];return getAgent(_0x387450)[_0x0798('0x1c')](function(_0x31a3cb){logger['info'](_0x0798('0x38'),_0x31a3cb[_0x0798('0x17')]);emit(util[_0x0798('0x3c')](_0x0798('0x30'),_0x31a3cb['name']),'webbar:answer',{'sessionId':_0x10a50a});return _0x11c5bf[_0x0798('0x19')](0xc8)[_0x0798('0x32')]({'error':![],'message':_0x0798('0x3d')});})[_0x0798('0x34')](handleError(_0x11c5bf));};exports['hold']=function(_0x21c28c,_0x4858e6){logger['info'](_0x0798('0x3e'),_0x21c28c[_0x0798('0x2c')]);var _0x42c5b8=holdValidation[_0x0798('0x2d')](_0x21c28c[_0x0798('0x2c')]);if(_0x42c5b8[_0x0798('0x26')]>0x0){return _0x4858e6[_0x0798('0x19')](0x190)[_0x0798('0x32')](_0x42c5b8);}var _0x182e3b=_0x21c28c['body'][_0x0798('0x37')];var _0x56d438=_0x21c28c[_0x0798('0x2c')][_0x0798('0x25')];return getAgent(_0x182e3b)[_0x0798('0x1c')](function(_0x54634d){logger[_0x0798('0x2a')](_0x0798('0x38'),_0x54634d[_0x0798('0x17')]);emit(util[_0x0798('0x3c')]('user:%s',_0x54634d[_0x0798('0x17')]),_0x0798('0x3f'),{'sessionId':_0x56d438});return _0x4858e6[_0x0798('0x19')](0xc8)[_0x0798('0x32')]({'error':![],'message':_0x0798('0x40')});})['catch'](handleError(_0x4858e6));};exports[_0x0798('0x41')]=function(_0x3e1c15,_0x2679b1){logger[_0x0798('0x2a')](_0x0798('0x42'),_0x3e1c15[_0x0798('0x2c')]);var _0x181757=unholdValidation[_0x0798('0x2d')](_0x3e1c15[_0x0798('0x2c')]);if(_0x181757['length']>0x0){return _0x2679b1['status'](0x190)[_0x0798('0x32')](_0x181757);}var _0x499073=_0x3e1c15[_0x0798('0x2c')][_0x0798('0x37')];var _0x40b3d6=_0x3e1c15[_0x0798('0x2c')][_0x0798('0x25')];return getAgent(_0x499073)['then'](function(_0x3cb0b4){logger['info'](_0x0798('0x38'),_0x3cb0b4[_0x0798('0x17')]);emit(util[_0x0798('0x3c')]('user:%s',_0x3cb0b4['name']),'webbar:unhold',{'sessionId':_0x40b3d6});return _0x2679b1[_0x0798('0x19')](0xc8)['json']({'error':![],'message':'unhold\x20executed!'});})[_0x0798('0x34')](handleError(_0x2679b1));};exports[_0x0798('0x43')]=function(_0x455d19,_0x499580){logger[_0x0798('0x2a')](_0x0798('0x44'),_0x499580[_0x0798('0x2c')]);var _0x743d26=callsValidation['validate'](_0x455d19['body']);if(_0x743d26[_0x0798('0x26')]>0x0){return _0x499580[_0x0798('0x19')](0x190)[_0x0798('0x32')](_0x743d26);}var _0x59ad6c=_0x455d19['body'][_0x0798('0x37')];var _0x82599=respondWithRpcPromise(_0x0798('0x22'));var _0x190467=getAgent(_0x59ad6c);return Promise[_0x0798('0x23')]([_0x82599,_0x190467])[_0x0798('0x1c')](function(_0x18c0fa){var _0x1a55c0=_0x18c0fa[0x0];var _0x4f35c7=_0x18c0fa[0x1];var _0x349f86=_[_0x0798('0x24')](_0x1a55c0['rows'],function(_0x3ab2cc){return _0x3ab2cc[_0x0798('0x45')]==_0x4f35c7['id'];});return _0x499580['status'](0xc8)[_0x0798('0x32')]({'count':_0x349f86[_0x0798('0x26')],'rows':_0x349f86});})[_0x0798('0x34')](handleError(_0x499580));};exports[_0x0798('0x46')]=function(_0x458a4e,_0x541669){logger[_0x0798('0x2a')](_0x0798('0x47'),_0x458a4e[_0x0798('0x2c')]);var _0x47cfc0=conferenceValidation[_0x0798('0x2d')](_0x458a4e['body']);if(_0x47cfc0[_0x0798('0x26')]>0x0){return _0x541669[_0x0798('0x19')](0x190)[_0x0798('0x32')](_0x47cfc0);}var _0x26b393=_0x458a4e[_0x0798('0x2c')][_0x0798('0x37')];return getAgent(_0x26b393)['then'](function(_0x3cc8bd){logger[_0x0798('0x2a')](_0x0798('0x38'),_0x3cc8bd[_0x0798('0x17')]);emit(util['format'](_0x0798('0x30'),_0x3cc8bd[_0x0798('0x17')]),_0x0798('0x48'));return _0x541669[_0x0798('0x19')](0xc8)[_0x0798('0x32')]({'error':![],'message':'conference\x20executed!'});})[_0x0798('0x34')](handleError(_0x541669));};exports[_0x0798('0x49')]=function(_0x5668b7,_0x48d1d1){logger[_0x0798('0x2a')](_0x0798('0x4a'),_0x5668b7['body']);var _0x2f336a=transferValidation[_0x0798('0x2d')](_0x5668b7[_0x0798('0x2c')]);if(_0x2f336a[_0x0798('0x26')]>0x0){return _0x48d1d1[_0x0798('0x19')](0x190)[_0x0798('0x32')](_0x2f336a);}var _0x21c156=_0x5668b7[_0x0798('0x2c')]['userId'];var _0x316762=_0x5668b7[_0x0798('0x2c')][_0x0798('0x25')];var _0xf5100e=_0x5668b7['body'][_0x0798('0x4b')];return getAgent(_0x21c156)[_0x0798('0x1c')](function(_0x11946d){logger[_0x0798('0x2a')](_0x0798('0x38'),_0x11946d[_0x0798('0x17')]);emit(util[_0x0798('0x3c')](_0x0798('0x30'),_0x11946d['name']),_0x0798('0x4c'),{'sessionId':_0x316762,'transferNumber':_0xf5100e});return _0x48d1d1['status'](0xc8)[_0x0798('0x32')]({'error':![],'message':_0x0798('0x4d')});})[_0x0798('0x34')](handleError(_0x48d1d1));};
\ No newline at end of file
+var _0xd382=['stack','name','status','send','NotFound','request','then','error','code','message','result','catch','User','findOne','VoiceChannels','rows','UserId','sessionId','length','\x20not\x20found!','originate','originate\x20fired:','body','json','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','userId','hangup\x20executed!','webbar:answer','answer\x20executed!','hold','hold\x20fired:','unhold','unhold\x20fired:','unhold\x20executed!','calls','calls\x20fired:','all','filter','conference','webbar:conference','conference\x20executed!','transfer','transferNumber','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','defaults','redis','socket.io-emitter','validate','string','callNumber\x20is\x20required','number','userId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:'];(function(_0x40dc14,_0x391bdd){var _0x32ff3d=function(_0x375b2e){while(--_0x375b2e){_0x40dc14['push'](_0x40dc14['shift']());}};_0x32ff3d(++_0x391bdd);}(_0xd382,0x1b6));var _0x2d38=function(_0x2b8388,_0x525486){_0x2b8388=_0x2b8388-0x0;var _0x5a1c07=_0xd382[_0x2b8388];return _0x5a1c07;};'use strict';var path=require(_0x2d38('0x0'));var fs=require('fs');var _=require(_0x2d38('0x1'));var db=require(_0x2d38('0x2'))['db'];var config=require(_0x2d38('0x3'));var util=require(_0x2d38('0x4'));var BPromise=require(_0x2d38('0x5'));var jayson=require(_0x2d38('0x6'));var amiClient=jayson[_0x2d38('0x7')][_0x2d38('0x8')]({'port':0x232a});var logger=require(_0x2d38('0x9'))('webbarapi');var Redis=require('ioredis');config['redis']=_[_0x2d38('0xa')](config[_0x2d38('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0x2d38('0xc'))(new Redis(config[_0x2d38('0xb')]));var Schema=require(_0x2d38('0xd'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x2d38('0xe'),'required':[!![],_0x2d38('0xf')]},'callerId':{'type':_0x2d38('0xe')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0x2d38('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x2d38('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x2d38('0x10'),'required':[!![],_0x2d38('0x11')]},'sessionId':{'type':_0x2d38('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x2d38('0x10'),'required':[!![],_0x2d38('0x11')]},'sessionId':{'type':_0x2d38('0xe'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x2d38('0xe'),'required':[!![],_0x2d38('0x12')]}});var holdValidation=new Schema({'userId':{'type':_0x2d38('0x10'),'required':[!![],_0x2d38('0x11')]},'sessionId':{'type':_0x2d38('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x2d38('0x11')]},'sessionId':{'type':_0x2d38('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x2d38('0x10'),'required':[!![],_0x2d38('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':_0x2d38('0x10'),'required':[!![],_0x2d38('0x11')]}});function emit(_0xc6de5a,_0x2d3cb1,_0xc17f9e){logger[_0x2d38('0x13')](_0xc6de5a,_0x2d3cb1,JSON[_0x2d38('0x14')](_0xc17f9e));io['to'](_0xc6de5a)[_0x2d38('0x15')](_0x2d3cb1,_0xc17f9e);}function handleError(_0x31a29e){return function(_0x1e3028){console[_0x2d38('0x16')](_0x2d38('0x17'),_0x1e3028,_0x1e3028 instanceof RangeError);logger['error'](_0x1e3028[_0x2d38('0x18')]);if(_0x1e3028 instanceof RangeError){if(_0x1e3028[_0x2d38('0x19')]){delete _0x1e3028['name'];}_0x31a29e[_0x2d38('0x1a')](0x194)[_0x2d38('0x1b')](_0x1e3028);}else{if(_0x1e3028[_0x2d38('0x19')]){delete _0x1e3028['name'];}_0x31a29e[_0x2d38('0x1a')](0x1f4)['send'](_0x1e3028);}};}function checkError(){return function(_0x4bdac6){if(!_0x4bdac6){throw new RangeError(_0x2d38('0x1c'));}return _0x4bdac6;};}function respondWithRpcPromise(_0x2e0b73,_0x3713ea){return new BPromise(function(_0x3892a5,_0x19e658){var _0x3138bc=amiClient;return _0x3138bc[_0x2d38('0x1d')](_0x2e0b73,_0x3713ea)[_0x2d38('0x1e')](function(_0x24e2cb){if(_0x24e2cb[_0x2d38('0x1f')]){if(_0x24e2cb['error'][_0x2d38('0x20')]===0x1f4){return _0x19e658(_0x24e2cb['error'][_0x2d38('0x21')]);}return _0x3892a5(_0x24e2cb['error'][_0x2d38('0x21')]);}else{_0x3892a5(_0x24e2cb[_0x2d38('0x22')]);}})[_0x2d38('0x23')](function(_0x10e283){_0x19e658(_0x10e283);});});}function getAgent(_0xffa3ce){return db[_0x2d38('0x24')][_0x2d38('0x25')]({'where':{'id':_0xffa3ce,'role':'agent'}})[_0x2d38('0x1e')](checkError());}function getAgentCheckSession(_0x3f0f7a,_0x34599a){return new BPromise(function(_0x3d18cd,_0x346934){var _0xe73710=respondWithRpcPromise(_0x2d38('0x26'));var _0x3a6437=getAgent(_0x3f0f7a);Promise['all']([_0xe73710,_0x3a6437])['then'](function(_0x5570c2){var _0x31d427=_0x5570c2[0x0];var _0xbd364b=_0x5570c2[0x1];var _0xd333fe=_['filter'](_0x31d427[_0x2d38('0x27')],function(_0x4b5891){return _0x4b5891[_0x2d38('0x28')]==_0xbd364b['id']&&_0x4b5891[_0x2d38('0x29')]==_0x34599a;});if(_0xd333fe[_0x2d38('0x2a')]==0x1){_0x3d18cd(_0xbd364b);}else{_0x346934(new RangeError('sessionId\x20'+_0x34599a+_0x2d38('0x2b')));}});});}exports[_0x2d38('0x2c')]=function(_0x389e74,_0x52a3ce){logger[_0x2d38('0x13')](_0x2d38('0x2d'),_0x389e74[_0x2d38('0x2e')]);var _0x1b48a9=originateValidation[_0x2d38('0xd')](_0x389e74[_0x2d38('0x2e')]);if(_0x1b48a9['length']>0x0){return _0x52a3ce[_0x2d38('0x1a')](0x190)[_0x2d38('0x2f')](_0x1b48a9);}var _0xa9bf8c=_0x389e74[_0x2d38('0x2e')]['userId'];var _0x21c943=_0x389e74[_0x2d38('0x2e')][_0x2d38('0x30')];var _0x46c154=_0x389e74[_0x2d38('0x2e')][_0x2d38('0x31')];var _0x2f2549=_0x389e74[_0x2d38('0x2e')][_0x2d38('0x32')];return getAgent(_0xa9bf8c)[_0x2d38('0x1e')](function(_0x5b8ae7){logger['info'](_0x2d38('0x33'),_0x5b8ae7[_0x2d38('0x19')]);emit(util[_0x2d38('0x34')](_0x2d38('0x35'),_0x5b8ae7[_0x2d38('0x19')]),_0x2d38('0x36'),{'callNumber':_0x21c943,'callerId':_0x46c154,'callbackUrl':_0x2f2549});return _0x52a3ce[_0x2d38('0x1a')](0xc8)[_0x2d38('0x2f')]({'error':![],'message':_0x2d38('0x37')});})[_0x2d38('0x23')](handleError(_0x52a3ce));};exports[_0x2d38('0x38')]=function(_0x29dda7,_0x11f5b8){logger['info'](_0x2d38('0x39'),_0x29dda7[_0x2d38('0x2e')]);var _0x30b318=hangupValidation[_0x2d38('0xd')](_0x29dda7['body']);if(_0x30b318[_0x2d38('0x2a')]>0x0){return _0x11f5b8[_0x2d38('0x1a')](0x190)[_0x2d38('0x2f')](_0x30b318);}var _0x11e58c=_0x29dda7[_0x2d38('0x2e')][_0x2d38('0x3a')];var _0x971848=_0x29dda7[_0x2d38('0x2e')][_0x2d38('0x29')];return getAgent(_0x11e58c)[_0x2d38('0x1e')](function(_0x3cd072){logger[_0x2d38('0x13')](_0x2d38('0x33'),_0x3cd072[_0x2d38('0x19')]);emit(util['format'](_0x2d38('0x35'),_0x3cd072[_0x2d38('0x19')]),'webbar:hangup',{'sessionId':_0x971848});return _0x11f5b8['status'](0xc8)[_0x2d38('0x2f')]({'error':![],'message':_0x2d38('0x3b')});})[_0x2d38('0x23')](handleError(_0x11f5b8));};exports['answer']=function(_0x6108f1,_0x17cc8d){logger[_0x2d38('0x13')]('answer\x20fired:',_0x6108f1['body']);var _0x2eeca7=answerValidation['validate'](_0x6108f1[_0x2d38('0x2e')]);if(_0x2eeca7[_0x2d38('0x2a')]>0x0){return _0x17cc8d[_0x2d38('0x1a')](0x190)['json'](_0x2eeca7);}var _0x50cb25=_0x6108f1[_0x2d38('0x2e')][_0x2d38('0x3a')];var _0x306d6d=_0x6108f1['body'][_0x2d38('0x29')];return getAgent(_0x50cb25)[_0x2d38('0x1e')](function(_0x94f76b){logger['info'](_0x2d38('0x33'),_0x94f76b[_0x2d38('0x19')]);emit(util[_0x2d38('0x34')]('user:%s',_0x94f76b['name']),_0x2d38('0x3c'),{'sessionId':_0x306d6d});return _0x17cc8d[_0x2d38('0x1a')](0xc8)[_0x2d38('0x2f')]({'error':![],'message':_0x2d38('0x3d')});})['catch'](handleError(_0x17cc8d));};exports[_0x2d38('0x3e')]=function(_0x26d0b0,_0xd2df89){logger['info'](_0x2d38('0x3f'),_0x26d0b0['body']);var _0x580d04=holdValidation[_0x2d38('0xd')](_0x26d0b0[_0x2d38('0x2e')]);if(_0x580d04[_0x2d38('0x2a')]>0x0){return _0xd2df89[_0x2d38('0x1a')](0x190)['json'](_0x580d04);}var _0x4c4c95=_0x26d0b0[_0x2d38('0x2e')]['userId'];var _0x9c67cb=_0x26d0b0[_0x2d38('0x2e')][_0x2d38('0x29')];return getAgent(_0x4c4c95)[_0x2d38('0x1e')](function(_0x35a2ae){logger[_0x2d38('0x13')](_0x2d38('0x33'),_0x35a2ae[_0x2d38('0x19')]);emit(util[_0x2d38('0x34')]('user:%s',_0x35a2ae[_0x2d38('0x19')]),'webbar:hold',{'sessionId':_0x9c67cb});return _0xd2df89[_0x2d38('0x1a')](0xc8)[_0x2d38('0x2f')]({'error':![],'message':'hold\x20executed!'});})[_0x2d38('0x23')](handleError(_0xd2df89));};exports[_0x2d38('0x40')]=function(_0x187ba3,_0x3c2756){logger[_0x2d38('0x13')](_0x2d38('0x41'),_0x187ba3[_0x2d38('0x2e')]);var _0x360804=unholdValidation['validate'](_0x187ba3[_0x2d38('0x2e')]);if(_0x360804[_0x2d38('0x2a')]>0x0){return _0x3c2756[_0x2d38('0x1a')](0x190)[_0x2d38('0x2f')](_0x360804);}var _0x389982=_0x187ba3[_0x2d38('0x2e')][_0x2d38('0x3a')];var _0x358e2b=_0x187ba3[_0x2d38('0x2e')]['sessionId'];return getAgent(_0x389982)[_0x2d38('0x1e')](function(_0x1f92c2){logger['info']('entityFound:',_0x1f92c2[_0x2d38('0x19')]);emit(util[_0x2d38('0x34')](_0x2d38('0x35'),_0x1f92c2[_0x2d38('0x19')]),'webbar:unhold',{'sessionId':_0x358e2b});return _0x3c2756['status'](0xc8)[_0x2d38('0x2f')]({'error':![],'message':_0x2d38('0x42')});})[_0x2d38('0x23')](handleError(_0x3c2756));};exports[_0x2d38('0x43')]=function(_0x3f1f12,_0x457a82){logger[_0x2d38('0x13')](_0x2d38('0x44'),_0x457a82[_0x2d38('0x2e')]);var _0x24c107=callsValidation[_0x2d38('0xd')](_0x3f1f12['body']);if(_0x24c107[_0x2d38('0x2a')]>0x0){return _0x457a82['status'](0x190)['json'](_0x24c107);}var _0x175981=_0x3f1f12[_0x2d38('0x2e')][_0x2d38('0x3a')];var _0x4d310b=respondWithRpcPromise('VoiceChannels');var _0x3ca706=getAgent(_0x175981);return Promise[_0x2d38('0x45')]([_0x4d310b,_0x3ca706])['then'](function(_0x720bd9){var _0x245e6a=_0x720bd9[0x0];var _0x2e978c=_0x720bd9[0x1];var _0x456dc4=_[_0x2d38('0x46')](_0x245e6a['rows'],function(_0x519913){return _0x519913[_0x2d38('0x28')]==_0x2e978c['id'];});return _0x457a82['status'](0xc8)[_0x2d38('0x2f')]({'count':_0x456dc4[_0x2d38('0x2a')],'rows':_0x456dc4});})[_0x2d38('0x23')](handleError(_0x457a82));};exports[_0x2d38('0x47')]=function(_0x4fa858,_0x415817){logger[_0x2d38('0x13')]('conference\x20fired:',_0x4fa858[_0x2d38('0x2e')]);var _0x2fa092=conferenceValidation['validate'](_0x4fa858[_0x2d38('0x2e')]);if(_0x2fa092['length']>0x0){return _0x415817['status'](0x190)[_0x2d38('0x2f')](_0x2fa092);}var _0xfb9270=_0x4fa858['body']['userId'];return getAgent(_0xfb9270)[_0x2d38('0x1e')](function(_0x4deb3c){logger[_0x2d38('0x13')](_0x2d38('0x33'),_0x4deb3c[_0x2d38('0x19')]);emit(util['format']('user:%s',_0x4deb3c[_0x2d38('0x19')]),_0x2d38('0x48'));return _0x415817['status'](0xc8)[_0x2d38('0x2f')]({'error':![],'message':_0x2d38('0x49')});})[_0x2d38('0x23')](handleError(_0x415817));};exports[_0x2d38('0x4a')]=function(_0x16e148,_0x498fc2){logger[_0x2d38('0x13')]('transfer\x20fired:',_0x16e148[_0x2d38('0x2e')]);var _0x333792=transferValidation['validate'](_0x16e148['body']);if(_0x333792[_0x2d38('0x2a')]>0x0){return _0x498fc2[_0x2d38('0x1a')](0x190)[_0x2d38('0x2f')](_0x333792);}var _0x163ad5=_0x16e148['body'][_0x2d38('0x3a')];var _0x5de6ba=_0x16e148['body'][_0x2d38('0x29')];var _0x11f13e=_0x16e148[_0x2d38('0x2e')][_0x2d38('0x4b')];return getAgent(_0x163ad5)['then'](function(_0x453fff){logger[_0x2d38('0x13')](_0x2d38('0x33'),_0x453fff[_0x2d38('0x19')]);emit(util['format']('user:%s',_0x453fff['name']),'webbar:transfer',{'sessionId':_0x5de6ba,'transferNumber':_0x11f13e});return _0x498fc2['status'](0xc8)['json']({'error':![],'message':_0x2d38('0x4c')});})[_0x2d38('0x23')](handleError(_0x498fc2));};
\ No newline at end of file
index 7d14cc4..14f1a48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47c5=['/:id/notify','notify','send','update','delete','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addApplications'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x47c5,0x165));var _0x547c=function(_0x13179f,_0x21f5dd){_0x13179f=_0x13179f-0x0;var _0x51b9e3=_0x47c5[_0x13179f];return _0x51b9e3;};'use strict';var multer=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var path=require(_0x547c('0x2'));var timeout=require(_0x547c('0x3'));var express=require(_0x547c('0x4'));var router=express[_0x547c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x547c('0x6'));var interaction=require(_0x547c('0x7'));var config=require('../../config/environment');var controller=require(_0x547c('0x8'));router[_0x547c('0x9')]('/',auth['isAuthenticated'](),controller[_0x547c('0xa')]);router[_0x547c('0x9')](_0x547c('0xb'),auth[_0x547c('0xc')](),controller[_0x547c('0xd')]);router[_0x547c('0x9')](_0x547c('0xe'),auth[_0x547c('0xc')](),controller[_0x547c('0xf')]);router[_0x547c('0x9')](_0x547c('0x10'),auth[_0x547c('0xc')](),controller[_0x547c('0x11')]);router[_0x547c('0x9')](_0x547c('0x12'),auth[_0x547c('0xc')](),controller[_0x547c('0x13')]);router['get'](_0x547c('0x14'),auth[_0x547c('0xc')](),controller['getAgents']);router[_0x547c('0x9')](_0x547c('0x15'),auth[_0x547c('0xc')](),controller[_0x547c('0x16')]);router[_0x547c('0x17')]('/',auth[_0x547c('0xc')](),controller[_0x547c('0x18')]);router[_0x547c('0x17')](_0x547c('0x10'),auth[_0x547c('0xc')](),controller[_0x547c('0x19')]);router[_0x547c('0x17')](_0x547c('0x12'),auth[_0x547c('0xc')](),controller[_0x547c('0x1a')]);router[_0x547c('0x17')](_0x547c('0x14'),auth[_0x547c('0xc')](),controller['addAgents']);router['post'](_0x547c('0x15'),auth[_0x547c('0xc')](),controller[_0x547c('0x1b')]);router['post'](_0x547c('0x1c'),controller[_0x547c('0x1d')]);router[_0x547c('0x17')]('/:id/send',auth[_0x547c('0xc')](),controller[_0x547c('0x1e')]);router['put']('/:id',auth[_0x547c('0xc')](),controller[_0x547c('0x1f')]);router['delete'](_0x547c('0xe'),auth[_0x547c('0xc')](),controller['destroy']);router[_0x547c('0x20')](_0x547c('0x10'),auth[_0x547c('0xc')](),controller['removeDispositions']);router[_0x547c('0x20')](_0x547c('0x12'),auth[_0x547c('0xc')](),controller[_0x547c('0x21')]);router[_0x547c('0x20')](_0x547c('0x14'),auth[_0x547c('0xc')](),controller[_0x547c('0x22')]);module['exports']=router;
\ No newline at end of file
+var _0x66fa=['/:id','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','post','/:id/dispositions','addDisposition','addAgents','/:id/notify','notify','/:id/send','send','put'];(function(_0x27ab9f,_0x2457dd){var _0xb49d91=function(_0x56c229){while(--_0x56c229){_0x27ab9f['push'](_0x27ab9f['shift']());}};_0xb49d91(++_0x2457dd);}(_0x66fa,0x117));var _0xa66f=function(_0x33ced2,_0x4d6a34){_0x33ced2=_0x33ced2-0x0;var _0x2e3f53=_0x66fa[_0x33ced2];return _0x2e3f53;};'use strict';var multer=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var path=require('path');var timeout=require(_0xa66f('0x2'));var express=require(_0xa66f('0x3'));var router=express[_0xa66f('0x4')]();var fs_extra=require(_0xa66f('0x5'));var auth=require(_0xa66f('0x6'));var interaction=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var controller=require('./whatsappAccount.controller');router['get']('/',auth[_0xa66f('0x9')](),controller[_0xa66f('0xa')]);router[_0xa66f('0xb')](_0xa66f('0xc'),auth[_0xa66f('0x9')](),controller['describe']);router[_0xa66f('0xb')]('/:id',auth[_0xa66f('0x9')](),controller['show']);router[_0xa66f('0xb')]('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router[_0xa66f('0xb')](_0xa66f('0xd'),auth['isAuthenticated'](),controller[_0xa66f('0xe')]);router['get'](_0xa66f('0xf'),auth['isAuthenticated'](),controller[_0xa66f('0x10')]);router[_0xa66f('0xb')](_0xa66f('0x11'),auth['isAuthenticated'](),controller['getApplications']);router[_0xa66f('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xa66f('0x13'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x14')]);router[_0xa66f('0x12')](_0xa66f('0xd'),auth['isAuthenticated'](),controller['addAnswer']);router[_0xa66f('0x12')](_0xa66f('0xf'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x15')]);router['post'](_0xa66f('0x11'),auth['isAuthenticated'](),controller['addApplications']);router[_0xa66f('0x12')](_0xa66f('0x16'),controller[_0xa66f('0x17')]);router[_0xa66f('0x12')](_0xa66f('0x18'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x19')]);router[_0xa66f('0x1a')](_0xa66f('0x1b'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x1c')]);router[_0xa66f('0x1d')](_0xa66f('0x1b'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x1e')]);router['delete'](_0xa66f('0x13'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x1f')]);router[_0xa66f('0x1d')]('/:id/canned_answers',auth[_0xa66f('0x9')](),controller[_0xa66f('0x20')]);router[_0xa66f('0x1d')](_0xa66f('0xf'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xa66f('0x21')]=router;
\ No newline at end of file
index 533ad31..f3832fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb625=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x4e290f,_0x344070){var _0x116b7d=function(_0x42df8f){while(--_0x42df8f){_0x4e290f['push'](_0x4e290f['shift']());}};_0x116b7d(++_0x344070);}(_0xb625,0x9c));var _0x5b62=function(_0x21e6f1,_0x4d5eb5){_0x21e6f1=_0x21e6f1-0x0;var _0x44a394=_0xb625[_0x21e6f1];return _0x44a394;};'use strict';var Sequelize=require(_0x5b62('0x0'));var rs=require(_0x5b62('0x1'));module[_0x5b62('0x2')]={'name':{'type':Sequelize[_0x5b62('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x5b62('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x5b62('0x3')],'defaultValue':function(){return rs[_0x5b62('0x4')]();}},'phone':{'type':Sequelize[_0x5b62('0x3')]},'type':{'type':Sequelize[_0x5b62('0x5')](_0x5b62('0x6'),_0x5b62('0x7'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0x5b62('0x3')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x5b62('0x8')],'defaultValue':function(){return _0x5b62('0x9');}},'notificationSound':{'type':Sequelize[_0x5b62('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x5b62('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5b62('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5b62('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5b62('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5b62('0xb')],'comment':_0x5b62('0xc')},'mandatoryDisposition':{'type':Sequelize[_0x5b62('0xa')],'defaultValue':![],'comment':_0x5b62('0xd'),'set':function(_0x49c5a3){if(!_0x49c5a3){this[_0x5b62('0xe')](_0x5b62('0xf'),null);}this[_0x5b62('0xe')](_0x5b62('0x10'),_0x49c5a3);}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xaf07=['name','generate','twilio','sinch','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','sequelize','randomstring','STRING'];(function(_0x19aa84,_0x549537){var _0x536146=function(_0x5da480){while(--_0x5da480){_0x19aa84['push'](_0x19aa84['shift']());}};_0x536146(++_0x549537);}(_0xaf07,0xed));var _0x7af0=function(_0xb2b6b1,_0x39a277){_0xb2b6b1=_0xb2b6b1-0x0;var _0x37d7ad=_0xaf07[_0xb2b6b1];return _0x37d7ad;};'use strict';var Sequelize=require(_0x7af0('0x0'));var rs=require(_0x7af0('0x1'));module['exports']={'name':{'type':Sequelize[_0x7af0('0x2')],'unique':_0x7af0('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x7af0('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x7af0('0x2')],'defaultValue':function(){return rs[_0x7af0('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x7af0('0x5'),_0x7af0('0x6'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x7af0('0x2')]},'notificationTemplate':{'type':Sequelize[_0x7af0('0x7')],'defaultValue':function(){return _0x7af0('0x8');}},'notificationSound':{'type':Sequelize[_0x7af0('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7af0('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7af0('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7af0('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x7af0('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x7af0('0x9')],'defaultValue':![],'comment':_0x7af0('0xc'),'set':function(_0x763162){if(!_0x763162){this['setDataValue'](_0x7af0('0xd'),null);}this[_0x7af0('0xe')]('mandatoryDisposition',_0x763162);}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index d4410de..59266f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46d9=['WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','UserProfileResource','destroy','stack','name','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','params','keys','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappAccounts','UserProfileSection','userProfileId','describe','WhatsappAccountId','getDispositions','findOne','Disposition','order','removeDispositions','ids','addAnswer','CannedAnswer','hasOwnProperty','rows','addAgents','spread','userWhatsappAccount:save','removeAgents','isArray','emit','User','getAgents','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','AC\x20WhatsappAccount\x20notify','AC\x20WhatsappAccount\x20req.body:%s','stringify','whatsapp','Applications','applications','orderBy','account','Sequelize','ValidationError','no\x20available\x20attributes','AC\x20sinch\x20req.body:%s','difference','updatedAt','createdAt','CompanyId','ListId','mobile','AC\x20sinch\x20routing.account.type:%s','AC\x20sinch\x20routing.body:%s','AC\x20sinch\x20contactKeys:%s','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','sinch','notifications','message_id','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','Contacts','DESC','list','omit','defaults','CmContact','contact','WhatsappInteraction','interaction','autoclose','push','close','unmanaged','*,*,*,*','created','WhatsappMessage','ContactId','UserId','unshift','agent','Start','startRouting','receiveMessage','entity\x20found','debug','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','to\x20is\x20mandatory','CmList','List','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','info','request\x20sent'];(function(_0x31b9cf,_0x1a809b){var _0x357b8a=function(_0x50a273){while(--_0x50a273){_0x31b9cf['push'](_0x31b9cf['shift']());}};_0x357b8a(++_0x1a809b);}(_0x46d9,0x16a));var _0x946d=function(_0x6ee406,_0x5a2b8e){_0x6ee406=_0x6ee406-0x0;var _0x48155a=_0x46d9[_0x6ee406];return _0x48155a;};'use strict';var emlformat=require(_0x946d('0x0'));var rimraf=require(_0x946d('0x1'));var zipdir=require(_0x946d('0x2'));var jsonpatch=require(_0x946d('0x3'));var rp=require(_0x946d('0x4'));var moment=require(_0x946d('0x5'));var BPromise=require(_0x946d('0x6'));var Mustache=require('mustache');var util=require(_0x946d('0x7'));var path=require(_0x946d('0x8'));var sox=require(_0x946d('0x9'));var csv=require(_0x946d('0xa'));var ejs=require(_0x946d('0xb'));var fs=require('fs');var fs_extra=require(_0x946d('0xc'));var _=require(_0x946d('0xd'));var squel=require(_0x946d('0xe'));var crypto=require('crypto');var jsforce=require(_0x946d('0xf'));var deskjs=require(_0x946d('0x10'));var toCsv=require(_0x946d('0xa'));var querystring=require(_0x946d('0x11'));var Papa=require(_0x946d('0x12'));var Redis=require(_0x946d('0x13'));var authService=require(_0x946d('0x14'));var qs=require(_0x946d('0x15'));var as=require(_0x946d('0x16'));var hardwareService=require(_0x946d('0x17'));var logger=require(_0x946d('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x946d('0x19'));var licenseUtil=require(_0x946d('0x1a'));var db=require(_0x946d('0x1b'))['db'];config['redis']=_['defaults'](config[_0x946d('0x1c')],{'host':_0x946d('0x1d'),'port':0x18eb});var socket=require(_0x946d('0x1e'))(new Redis(config[_0x946d('0x1c')]));require(_0x946d('0x1f'))[_0x946d('0x20')](socket);var jayson=require(_0x946d('0x21'));var client=jayson[_0x946d('0x22')][_0x946d('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x597bbb,_0x548f30,_0x29f942,_0x307eeb){return new BPromise(function(_0x30412c,_0x3d6c11){var _0x2a802d=_0x307eeb||client;return _0x2a802d['request'](_0x597bbb,_0x29f942)['then'](function(_0x221a7a){logger[_0x946d('0x24')]('WhatsappAccount,\x20%s,\x20%s',_0x548f30,_0x946d('0x25'));logger['debug'](_0x946d('0x26'),_0x548f30,'request\x20sent',JSON['stringify'](_0x221a7a));if(_0x221a7a[_0x946d('0x27')]){if(_0x221a7a[_0x946d('0x27')][_0x946d('0x28')]===0x1f4){logger['error'](_0x946d('0x29'),_0x548f30,_0x221a7a[_0x946d('0x27')]['message']);return _0x3d6c11(_0x221a7a[_0x946d('0x27')][_0x946d('0x2a')]);}logger['error'](_0x946d('0x29'),_0x548f30,_0x221a7a[_0x946d('0x27')][_0x946d('0x2a')]);return _0x30412c(_0x221a7a[_0x946d('0x27')][_0x946d('0x2a')]);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x548f30,_0x946d('0x25'));_0x30412c(_0x221a7a[_0x946d('0x2b')][_0x946d('0x2a')]);}})['catch'](function(_0x2a0a9e){logger['error'](_0x946d('0x29'),_0x548f30,_0x2a0a9e);_0x3d6c11(_0x2a0a9e);});});}function respondWithStatusCode(_0x49a128,_0x452331){_0x452331=_0x452331||0xcc;return function(_0x22e5f2){if(_0x22e5f2){return _0x49a128[_0x946d('0x2c')](_0x452331);}return _0x49a128['status'](_0x452331)[_0x946d('0x2d')]();};}function respondWithResult(_0x3e564c,_0x380e5f){_0x380e5f=_0x380e5f||0xc8;return function(_0x57c175){if(_0x57c175){return _0x3e564c[_0x946d('0x2e')](_0x380e5f)[_0x946d('0x2f')](_0x57c175);}};}function respondWithFilteredResult(_0x17f268,_0x1ac495){return function(_0x206513){if(_0x206513){var _0x7b41e5=typeof _0x1ac495[_0x946d('0x30')]===_0x946d('0x31')&&typeof _0x1ac495[_0x946d('0x32')]===_0x946d('0x31');var _0x40894d=_0x206513[_0x946d('0x33')];var _0x104e10=_0x7b41e5?0x0:_0x1ac495['offset'];var _0x131244=_0x7b41e5?_0x206513[_0x946d('0x33')]:_0x1ac495[_0x946d('0x30')]+_0x1ac495[_0x946d('0x32')];var _0x40311d;if(_0x131244>=_0x40894d){_0x131244=_0x40894d;_0x40311d=0xc8;}else{_0x40311d=0xce;}_0x17f268[_0x946d('0x2e')](_0x40311d);return _0x17f268[_0x946d('0x34')]('Content-Range',_0x104e10+'-'+_0x131244+'/'+_0x40894d)[_0x946d('0x2f')](_0x206513);}return null;};}function patchUpdates(_0x15fde9){return function(_0x2b8016){try{jsonpatch[_0x946d('0x35')](_0x2b8016,_0x15fde9,!![]);}catch(_0x4dbffc){return BPromise['reject'](_0x4dbffc);}return _0x2b8016[_0x946d('0x36')]();};}function saveUpdates(_0x4a8d3c,_0x260f78){return function(_0x51b72c){if(_0x51b72c){return _0x51b72c[_0x946d('0x37')](_0x4a8d3c)[_0x946d('0x38')](function(_0x396f23){return _0x396f23;});}return null;};}function removeEntity(_0x346fd8,_0x397686){return function(_0x1a5c04){if(_0x1a5c04){return _0x1a5c04['destroy']()['then'](function(){var _0x21429a=_0x1a5c04['get']({'plain':!![]});var _0xe6e7b9='WhatsappAccounts';return db[_0x946d('0x39')][_0x946d('0x3a')]({'where':{'type':_0xe6e7b9,'resourceId':_0x21429a['id']}})[_0x946d('0x38')](function(){return _0x1a5c04;});})[_0x946d('0x38')](function(){_0x346fd8[_0x946d('0x2e')](0xcc)[_0x946d('0x2d')]();});}};}function handleEntityNotFound(_0x1d9cb3,_0x389e1e){return function(_0x19a028){if(!_0x19a028){_0x1d9cb3[_0x946d('0x2c')](0x194);}return _0x19a028;};}function handleError(_0x5070e7,_0x1add83){_0x1add83=_0x1add83||0x1f4;return function(_0xea1fa5){logger[_0x946d('0x27')](_0xea1fa5[_0x946d('0x3b')]);if(_0xea1fa5[_0x946d('0x3c')]){delete _0xea1fa5[_0x946d('0x3c')];}_0x5070e7['status'](_0x1add83)['send'](_0xea1fa5);};}exports[_0x946d('0x3d')]=function(_0x43e3c1,_0x46e671){var _0x5f150e={'include':[{'model':db[_0x946d('0x3e')],'as':_0x946d('0x3f')}]},_0x12bcad={},_0x5756c4={'count':0x0,'rows':[]};var _0xec7302=_[_0x946d('0x40')](db[_0x946d('0x41')][_0x946d('0x42')],function(_0xe46bf7){return{'name':_0xe46bf7[_0x946d('0x43')],'type':_0xe46bf7[_0x946d('0x44')][_0x946d('0x45')]};});_0x12bcad[_0x946d('0x46')]=_[_0x946d('0x40')](_0xec7302,_0x946d('0x3c'));_0x12bcad['query']=_['keys'](_0x43e3c1[_0x946d('0x47')]);_0x12bcad[_0x946d('0x48')]=_[_0x946d('0x49')](_0x12bcad['model'],_0x12bcad[_0x946d('0x47')]);_0x5f150e[_0x946d('0x4a')]=_['intersection'](_0x12bcad[_0x946d('0x46')],qs['fields'](_0x43e3c1[_0x946d('0x47')][_0x946d('0x4b')]));_0x5f150e[_0x946d('0x4a')]=_0x5f150e[_0x946d('0x4a')][_0x946d('0x4c')]?_0x5f150e['attributes']:_0x12bcad['model'];if(!_0x43e3c1[_0x946d('0x47')]['hasOwnProperty'](_0x946d('0x4d'))){_0x5f150e[_0x946d('0x32')]=qs[_0x946d('0x32')](_0x43e3c1[_0x946d('0x47')][_0x946d('0x32')]);_0x5f150e[_0x946d('0x30')]=qs[_0x946d('0x30')](_0x43e3c1[_0x946d('0x47')][_0x946d('0x30')]);}_0x5f150e['order']=qs[_0x946d('0x4e')](_0x43e3c1[_0x946d('0x47')][_0x946d('0x4e')]);_0x5f150e[_0x946d('0x4f')]=qs[_0x946d('0x48')](_[_0x946d('0x50')](_0x43e3c1['query'],_0x12bcad[_0x946d('0x48')]),_0xec7302);if(_0x43e3c1[_0x946d('0x47')][_0x946d('0x51')]){_0x5f150e['where']=_[_0x946d('0x52')](_0x5f150e[_0x946d('0x4f')],{'$or':_[_0x946d('0x40')](_0xec7302,function(_0x5cc265){if(_0x5cc265['type']!==_0x946d('0x53')){var _0x4379db={};_0x4379db[_0x5cc265['name']]={'$like':'%'+_0x43e3c1[_0x946d('0x47')][_0x946d('0x51')]+'%'};return _0x4379db;}})});}_0x5f150e=_['merge']({},_0x5f150e,_0x43e3c1[_0x946d('0x54')]);var _0xd1f3bb={'where':_0x5f150e[_0x946d('0x4f')]};return db[_0x946d('0x41')][_0x946d('0x33')](_0xd1f3bb)[_0x946d('0x38')](function(_0x419d1e){_0x5756c4[_0x946d('0x33')]=_0x419d1e;if(_0x43e3c1[_0x946d('0x47')]['includeAll']){_0x5f150e[_0x946d('0x55')]=[{'all':!![]}];}return db['WhatsappAccount'][_0x946d('0x56')](_0x5f150e);})['then'](function(_0x258796){_0x5756c4['rows']=_0x258796;return _0x5756c4;})[_0x946d('0x38')](respondWithFilteredResult(_0x46e671,_0x5f150e))[_0x946d('0x57')](handleError(_0x46e671,null));};exports['show']=function(_0x3de139,_0x2beeff){var _0xaf88e5={'raw':![],'where':{'id':_0x3de139[_0x946d('0x58')]['id']},'include':[{'model':db[_0x946d('0x3e')],'as':'mandatoryDispositionPause'}]},_0xc4e735={};_0xc4e735[_0x946d('0x46')]=_[_0x946d('0x59')](db[_0x946d('0x41')][_0x946d('0x42')]);_0xc4e735['query']=_[_0x946d('0x59')](_0x3de139['query']);_0xc4e735['filters']=_[_0x946d('0x49')](_0xc4e735[_0x946d('0x46')],_0xc4e735[_0x946d('0x47')]);_0xaf88e5['attributes']=_['intersection'](_0xc4e735[_0x946d('0x46')],qs['fields'](_0x3de139[_0x946d('0x47')][_0x946d('0x4b')]));_0xaf88e5[_0x946d('0x4a')]=_0xaf88e5['attributes']['length']?_0xaf88e5[_0x946d('0x4a')]:_0xc4e735[_0x946d('0x46')];if(_0x3de139[_0x946d('0x47')][_0x946d('0x5a')]){_0xaf88e5[_0x946d('0x55')]=[{'all':!![]}];}_0xaf88e5=_[_0x946d('0x52')]({},_0xaf88e5,_0x3de139['options']);return db[_0x946d('0x41')][_0x946d('0x5b')](_0xaf88e5)[_0x946d('0x38')](handleEntityNotFound(_0x2beeff,null))[_0x946d('0x38')](respondWithResult(_0x2beeff,null))[_0x946d('0x57')](handleError(_0x2beeff,null));};exports[_0x946d('0x5c')]=function(_0xff08d7,_0x389139){return db[_0x946d('0x41')][_0x946d('0x5c')](_0xff08d7[_0x946d('0x5d')],{})['then'](function(_0x4c24ca){var _0xcc61b2=_0xff08d7[_0x946d('0x5e')][_0x946d('0x5f')]({'plain':!![]});if(!_0xcc61b2)throw new Error(_0x946d('0x60'));if(_0xcc61b2[_0x946d('0x61')]===_0x946d('0x5e')){var _0x1e2629=_0x4c24ca[_0x946d('0x5f')]({'plain':!![]});var _0x10d2d8=_0x946d('0x62');return db[_0x946d('0x63')]['find']({'where':{'name':_0x10d2d8,'userProfileId':_0xcc61b2[_0x946d('0x64')]},'raw':!![]})[_0x946d('0x38')](function(_0x1a89b6){if(_0x1a89b6&&_0x1a89b6['autoAssociation']===0x0){return db[_0x946d('0x39')][_0x946d('0x5c')]({'name':_0x1e2629[_0x946d('0x3c')],'resourceId':_0x1e2629['id'],'type':_0x1a89b6[_0x946d('0x3c')],'sectionId':_0x1a89b6['id']},{})['then'](function(){return _0x4c24ca;});}else{return _0x4c24ca;}})['catch'](function(_0x165e7f){logger[_0x946d('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x165e7f);throw _0x165e7f;});}return _0x4c24ca;})[_0x946d('0x38')](respondWithResult(_0x389139,0xc9))[_0x946d('0x57')](handleError(_0x389139,null));};exports['update']=function(_0x7a59b8,_0x3a109f){if(_0x7a59b8[_0x946d('0x5d')]['id']){delete _0x7a59b8[_0x946d('0x5d')]['id'];}return db[_0x946d('0x41')][_0x946d('0x5b')]({'where':{'id':_0x7a59b8[_0x946d('0x58')]['id']},'include':[{'model':db[_0x946d('0x3e')],'as':_0x946d('0x3f')}]})[_0x946d('0x38')](handleEntityNotFound(_0x3a109f,null))['then'](saveUpdates(_0x7a59b8['body'],null))['then'](respondWithResult(_0x3a109f,null))[_0x946d('0x57')](handleError(_0x3a109f,null));};exports[_0x946d('0x3a')]=function(_0x5638d3,_0x2a01b6){return db[_0x946d('0x41')]['find']({'where':{'id':_0x5638d3[_0x946d('0x58')]['id']}})[_0x946d('0x38')](handleEntityNotFound(_0x2a01b6,null))[_0x946d('0x38')](removeEntity(_0x2a01b6,null))[_0x946d('0x57')](handleError(_0x2a01b6,null));};exports[_0x946d('0x65')]=function(_0x410cb7,_0x2247b4){return db[_0x946d('0x41')][_0x946d('0x65')]()[_0x946d('0x38')](respondWithResult(_0x2247b4,null))[_0x946d('0x57')](handleError(_0x2247b4,null));};exports['addDisposition']=function(_0x334d39,_0x5e9de9,_0x413ab9){if(_0x334d39[_0x946d('0x5d')]['id']){delete _0x334d39[_0x946d('0x5d')]['id'];}return db[_0x946d('0x41')]['find']({'where':{'id':_0x334d39['params']['id']}})[_0x946d('0x38')](handleEntityNotFound(_0x5e9de9,null))[_0x946d('0x38')](function(_0x253975){if(_0x253975){_0x334d39[_0x946d('0x5d')][_0x946d('0x66')]=_0x253975['id'];return db['Disposition'][_0x946d('0x5c')](_0x334d39[_0x946d('0x5d')]);}})[_0x946d('0x38')](respondWithResult(_0x5e9de9,null))[_0x946d('0x57')](handleError(_0x5e9de9,null));};exports[_0x946d('0x67')]=function(_0x276ebf,_0x4f41bb,_0x909e08){var _0x337c32={'raw':![],'where':{}};var _0x240a20={};var _0x374630={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x946d('0x68')]({'where':{'id':_0x276ebf[_0x946d('0x58')]['id']}})[_0x946d('0x38')](handleEntityNotFound(_0x4f41bb,null))['then'](function(_0x2a7696){if(_0x2a7696){_0x240a20[_0x946d('0x46')]=_[_0x946d('0x59')](db[_0x946d('0x69')][_0x946d('0x42')]);_0x240a20[_0x946d('0x47')]=_[_0x946d('0x59')](_0x276ebf[_0x946d('0x47')]);_0x240a20[_0x946d('0x48')]=_[_0x946d('0x49')](_0x240a20[_0x946d('0x46')],_0x240a20['query']);_0x337c32['attributes']=_[_0x946d('0x49')](_0x240a20[_0x946d('0x46')],qs[_0x946d('0x4b')](_0x276ebf[_0x946d('0x47')][_0x946d('0x4b')]));_0x337c32[_0x946d('0x4a')]=_0x337c32[_0x946d('0x4a')][_0x946d('0x4c')]?_0x337c32[_0x946d('0x4a')]:_0x240a20[_0x946d('0x46')];if(!_0x276ebf['query']['hasOwnProperty'](_0x946d('0x4d'))){_0x337c32[_0x946d('0x32')]=qs[_0x946d('0x32')](_0x276ebf[_0x946d('0x47')][_0x946d('0x32')]);_0x337c32['offset']=qs[_0x946d('0x30')](_0x276ebf[_0x946d('0x47')]['offset']);}_0x337c32[_0x946d('0x6a')]=qs['sort'](_0x276ebf[_0x946d('0x47')][_0x946d('0x4e')]);_0x337c32['where']=qs['filters'](_[_0x946d('0x50')](_0x276ebf[_0x946d('0x47')],_0x240a20[_0x946d('0x48')]));_0x337c32[_0x946d('0x4f')][_0x946d('0x66')]=_0x2a7696['id'];if(_0x276ebf[_0x946d('0x47')][_0x946d('0x51')]){_0x337c32[_0x946d('0x4f')]=_[_0x946d('0x52')](_0x337c32[_0x946d('0x4f')],{'$or':_[_0x946d('0x40')](_0x337c32[_0x946d('0x4a')],function(_0x423128){var _0x2ea64d={};_0x2ea64d[_0x423128]={'$like':'%'+_0x276ebf[_0x946d('0x47')][_0x946d('0x51')]+'%'};return _0x2ea64d;})});}_0x337c32=_[_0x946d('0x52')]({},_0x337c32,_0x276ebf['options']);return db[_0x946d('0x69')][_0x946d('0x33')]({'where':_0x337c32['where']})[_0x946d('0x38')](function(_0x27831b){_0x374630['count']=_0x27831b;if(_0x276ebf[_0x946d('0x47')][_0x946d('0x5a')]){_0x337c32['include']=[{'all':!![]}];}return db[_0x946d('0x69')][_0x946d('0x56')](_0x337c32);})[_0x946d('0x38')](function(_0x540165){_0x374630['rows']=_0x540165;return _0x374630;});}})['then'](respondWithFilteredResult(_0x4f41bb,_0x337c32))[_0x946d('0x57')](handleError(_0x4f41bb,null));};exports[_0x946d('0x6b')]=function(_0x348b11,_0x16f992,_0x299be6){return db['WhatsappAccount']['find']({'where':{'id':_0x348b11[_0x946d('0x58')]['id']}})[_0x946d('0x38')](handleEntityNotFound(_0x16f992,null))[_0x946d('0x38')](function(_0x568876){if(_0x568876){return _0x568876[_0x946d('0x6b')](_0x348b11[_0x946d('0x47')][_0x946d('0x6c')]);}})[_0x946d('0x38')](respondWithStatusCode(_0x16f992,null))[_0x946d('0x57')](handleError(_0x16f992,null));};exports[_0x946d('0x6d')]=function(_0x2a5e75,_0x222ea4,_0x580141){if(_0x2a5e75[_0x946d('0x5d')]['id']){delete _0x2a5e75['body']['id'];}return db[_0x946d('0x41')]['find']({'where':{'id':_0x2a5e75[_0x946d('0x58')]['id']}})[_0x946d('0x38')](handleEntityNotFound(_0x222ea4,null))[_0x946d('0x38')](function(_0xad3a58){if(_0xad3a58){_0x2a5e75[_0x946d('0x5d')][_0x946d('0x66')]=_0xad3a58['id'];return db[_0x946d('0x6e')]['create'](_0x2a5e75[_0x946d('0x5d')]);}})[_0x946d('0x38')](respondWithResult(_0x222ea4,null))[_0x946d('0x57')](handleError(_0x222ea4,null));};exports['getAnswers']=function(_0x5ebcd5,_0x2b1be7,_0x5ee3a4){var _0x4e602e={'raw':![],'where':{}};var _0x779445={};var _0x157d7a={'count':0x0,'rows':[]};return db[_0x946d('0x41')][_0x946d('0x68')]({'where':{'id':_0x5ebcd5[_0x946d('0x58')]['id']}})[_0x946d('0x38')](handleEntityNotFound(_0x2b1be7,null))[_0x946d('0x38')](function(_0x7c03e){if(_0x7c03e){_0x779445[_0x946d('0x46')]=_[_0x946d('0x59')](db[_0x946d('0x6e')][_0x946d('0x42')]);_0x779445['query']=_[_0x946d('0x59')](_0x5ebcd5['query']);_0x779445[_0x946d('0x48')]=_[_0x946d('0x49')](_0x779445[_0x946d('0x46')],_0x779445[_0x946d('0x47')]);_0x4e602e['attributes']=_['intersection'](_0x779445[_0x946d('0x46')],qs[_0x946d('0x4b')](_0x5ebcd5[_0x946d('0x47')][_0x946d('0x4b')]));_0x4e602e[_0x946d('0x4a')]=_0x4e602e['attributes'][_0x946d('0x4c')]?_0x4e602e[_0x946d('0x4a')]:_0x779445[_0x946d('0x46')];if(!_0x5ebcd5[_0x946d('0x47')][_0x946d('0x6f')](_0x946d('0x4d'))){_0x4e602e['limit']=qs['limit'](_0x5ebcd5['query'][_0x946d('0x32')]);_0x4e602e['offset']=qs[_0x946d('0x30')](_0x5ebcd5[_0x946d('0x47')][_0x946d('0x30')]);}_0x4e602e[_0x946d('0x6a')]=qs[_0x946d('0x4e')](_0x5ebcd5[_0x946d('0x47')][_0x946d('0x4e')]);_0x4e602e[_0x946d('0x4f')]=qs[_0x946d('0x48')](_[_0x946d('0x50')](_0x5ebcd5[_0x946d('0x47')],_0x779445['filters']));_0x4e602e[_0x946d('0x4f')][_0x946d('0x66')]=_0x7c03e['id'];if(_0x5ebcd5[_0x946d('0x47')]['filter']){_0x4e602e[_0x946d('0x4f')]=_['merge'](_0x4e602e[_0x946d('0x4f')],{'$or':_[_0x946d('0x40')](_0x4e602e[_0x946d('0x4a')],function(_0x3090e5){var _0x2f8ccc={};_0x2f8ccc[_0x3090e5]={'$like':'%'+_0x5ebcd5[_0x946d('0x47')][_0x946d('0x51')]+'%'};return _0x2f8ccc;})});}_0x4e602e=_['merge']({},_0x4e602e,_0x5ebcd5[_0x946d('0x54')]);return db[_0x946d('0x6e')]['count']({'where':_0x4e602e[_0x946d('0x4f')]})[_0x946d('0x38')](function(_0x25442b){_0x157d7a['count']=_0x25442b;if(_0x5ebcd5[_0x946d('0x47')][_0x946d('0x5a')]){_0x4e602e[_0x946d('0x55')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x4e602e);})[_0x946d('0x38')](function(_0x5d060f){_0x157d7a[_0x946d('0x70')]=_0x5d060f;return _0x157d7a;});}})['then'](respondWithFilteredResult(_0x2b1be7,_0x4e602e))['catch'](handleError(_0x2b1be7,null));};exports['removeAnswers']=function(_0x3d3be0,_0x453c80,_0x54d272){return db[_0x946d('0x41')][_0x946d('0x5b')]({'where':{'id':_0x3d3be0['params']['id']}})[_0x946d('0x38')](handleEntityNotFound(_0x453c80,null))['then'](function(_0x3a4658){if(_0x3a4658){return _0x3a4658['removeAnswers'](_0x3d3be0[_0x946d('0x47')][_0x946d('0x6c')]);}})[_0x946d('0x38')](respondWithStatusCode(_0x453c80,null))['catch'](handleError(_0x453c80,null));};exports[_0x946d('0x71')]=function(_0x3c572e,_0x2b6011,_0x216b3d){return db[_0x946d('0x41')][_0x946d('0x5b')]({'where':{'id':_0x3c572e[_0x946d('0x58')]['id']}})[_0x946d('0x38')](handleEntityNotFound(_0x2b6011,null))[_0x946d('0x38')](function(_0x52b856){if(_0x52b856){return _0x52b856['addAgents'](_0x3c572e[_0x946d('0x5d')][_0x946d('0x6c')],_['omit'](_0x3c572e[_0x946d('0x5d')],['ids','id'])||{})[_0x946d('0x72')](function(_0x179911){for(var _0x560f03=0x0;_0x560f03<_0x3c572e['body'][_0x946d('0x6c')][_0x946d('0x4c')];_0x560f03+=0x1){socket['emit'](_0x946d('0x73'),{'UserId':Number(_0x3c572e[_0x946d('0x5d')][_0x946d('0x6c')][_0x560f03]),'WhatsappAccountId':Number(_0x3c572e[_0x946d('0x58')]['id'])});}return _0x179911;});}})[_0x946d('0x38')](respondWithResult(_0x2b6011,null))[_0x946d('0x57')](handleError(_0x2b6011,null));};exports['removeAgents']=function(_0x9fafcc,_0x1736ba,_0x5a29e0){return db[_0x946d('0x41')][_0x946d('0x5b')]({'where':{'id':_0x9fafcc['params']['id']}})[_0x946d('0x38')](handleEntityNotFound(_0x1736ba,null))[_0x946d('0x38')](function(_0x28d396){if(_0x28d396){return _0x28d396[_0x946d('0x74')](_0x9fafcc[_0x946d('0x47')][_0x946d('0x6c')])[_0x946d('0x38')](function(){if(_[_0x946d('0x75')](_0x9fafcc[_0x946d('0x47')][_0x946d('0x6c')])){for(var _0x34b7ad=0x0;_0x34b7ad<_0x9fafcc[_0x946d('0x47')][_0x946d('0x6c')][_0x946d('0x4c')];_0x34b7ad+=0x1){socket['emit']('userWhatsappAccount:remove',{'UserId':Number(_0x9fafcc[_0x946d('0x47')][_0x946d('0x6c')][_0x34b7ad]),'WhatsappAccountId':Number(_0x9fafcc['params']['id'])});}}else{socket[_0x946d('0x76')]('userWhatsappAccount:remove',{'UserId':Number(_0x9fafcc[_0x946d('0x47')][_0x946d('0x6c')]),'WhatsappAccountId':Number(_0x9fafcc['params']['id'])});}});}})[_0x946d('0x38')](respondWithStatusCode(_0x1736ba,null))['catch'](handleError(_0x1736ba,null));};exports['getAgents']=function(_0x5b65fb,_0x3b75e8,_0xe32281){var _0x3842cf={};var _0x309d9d={};var _0x5c875b;var _0x80841c;return db[_0x946d('0x41')]['findOne']({'where':{'id':_0x5b65fb[_0x946d('0x58')]['id']}})[_0x946d('0x38')](handleEntityNotFound(_0x3b75e8,null))[_0x946d('0x38')](function(_0x398b55){if(_0x398b55){_0x5c875b=_0x398b55;_0x309d9d[_0x946d('0x46')]=_[_0x946d('0x59')](db[_0x946d('0x77')][_0x946d('0x42')]);_0x309d9d[_0x946d('0x47')]=_['keys'](_0x5b65fb[_0x946d('0x47')]);_0x309d9d[_0x946d('0x48')]=_[_0x946d('0x49')](_0x309d9d[_0x946d('0x46')],_0x309d9d[_0x946d('0x47')]);_0x3842cf[_0x946d('0x4a')]=_[_0x946d('0x49')](_0x309d9d[_0x946d('0x46')],qs[_0x946d('0x4b')](_0x5b65fb[_0x946d('0x47')][_0x946d('0x4b')]));_0x3842cf[_0x946d('0x4a')]=_0x3842cf[_0x946d('0x4a')]['length']?_0x3842cf[_0x946d('0x4a')]:_0x309d9d[_0x946d('0x46')];_0x3842cf['order']=qs[_0x946d('0x4e')](_0x5b65fb[_0x946d('0x47')]['sort']);_0x3842cf[_0x946d('0x4f')]=qs[_0x946d('0x48')](_[_0x946d('0x50')](_0x5b65fb[_0x946d('0x47')],_0x309d9d['filters']));if(_0x5b65fb[_0x946d('0x47')][_0x946d('0x51')]){_0x3842cf[_0x946d('0x4f')]=_[_0x946d('0x52')](_0x3842cf[_0x946d('0x4f')],{'$or':_['map'](_0x3842cf[_0x946d('0x4a')],function(_0x202998){var _0x2d4848={};_0x2d4848[_0x202998]={'$like':'%'+_0x5b65fb[_0x946d('0x47')][_0x946d('0x51')]+'%'};return _0x2d4848;})});}_0x3842cf=_[_0x946d('0x52')]({},_0x3842cf,_0x5b65fb[_0x946d('0x54')]);return _0x5c875b[_0x946d('0x78')](_0x3842cf);}})[_0x946d('0x38')](function(_0x4f565b){if(_0x4f565b){_0x80841c=_0x4f565b[_0x946d('0x4c')];if(!_0x5b65fb[_0x946d('0x47')][_0x946d('0x6f')](_0x946d('0x4d'))){_0x3842cf['limit']=qs['limit'](_0x5b65fb[_0x946d('0x47')][_0x946d('0x32')]);_0x3842cf['offset']=qs['offset'](_0x5b65fb['query'][_0x946d('0x30')]);}return _0x5c875b['getAgents'](_0x3842cf);}})[_0x946d('0x38')](function(_0x51d573){if(_0x51d573){return _0x51d573?{'count':_0x80841c,'rows':_0x51d573}:null;}})[_0x946d('0x38')](respondWithResult(_0x3b75e8,null))['catch'](handleError(_0x3b75e8,null));};exports['addApplications']=function(_0x1ce53c,_0x23c01e,_0x278a81){return db[_0x946d('0x41')]['findOne']({'where':{'id':_0x1ce53c[_0x946d('0x58')]['id']}})[_0x946d('0x38')](handleEntityNotFound(_0x23c01e,null))[_0x946d('0x38')](function(_0x33ef52){if(_0x33ef52){return db['sequelize'][_0x946d('0x79')](function(_0x21c915){return db[_0x946d('0x7a')]['destroy']({'where':{'WhatsappAccountId':_0x1ce53c[_0x946d('0x58')]['id']},'transaction':_0x21c915})[_0x946d('0x38')](function(_0xafdf22){var _0x10677a=_[_0x946d('0x40')](_0x1ce53c[_0x946d('0x5d')],function(_0x20579a){_0x20579a[_0x946d('0x66')]=_0x1ce53c['params']['id'];return _0x20579a;});return db[_0x946d('0x7a')][_0x946d('0x7b')](_0x10677a,{'transaction':_0x21c915});});})['then'](function(){return db['WhatsappApplication'][_0x946d('0x7c')]({'where':{'WhatsappAccountId':_0x1ce53c[_0x946d('0x58')]['id']},'order':_0x946d('0x7d')});});}})[_0x946d('0x38')](respondWithResult(_0x23c01e,null))[_0x946d('0x57')](handleError(_0x23c01e,null));};exports[_0x946d('0x7e')]=function(_0x2e9f61,_0x2ea00b,_0x152d8a){var _0x5cdd41={};var _0x258f3f={};var _0x3ecdd7;var _0x206a69;return db[_0x946d('0x41')][_0x946d('0x68')]({'where':{'id':_0x2e9f61[_0x946d('0x58')]['id']}})[_0x946d('0x38')](handleEntityNotFound(_0x2ea00b,null))[_0x946d('0x38')](function(_0x30a288){if(_0x30a288){_0x3ecdd7=_0x30a288;_0x258f3f['model']=_[_0x946d('0x59')](db[_0x946d('0x7a')][_0x946d('0x42')]);_0x258f3f[_0x946d('0x47')]=_[_0x946d('0x59')](_0x2e9f61[_0x946d('0x47')]);_0x258f3f['filters']=_[_0x946d('0x49')](_0x258f3f[_0x946d('0x46')],_0x258f3f[_0x946d('0x47')]);_0x5cdd41['attributes']=_[_0x946d('0x49')](_0x258f3f[_0x946d('0x46')],qs[_0x946d('0x4b')](_0x2e9f61[_0x946d('0x47')][_0x946d('0x4b')]));_0x5cdd41[_0x946d('0x4a')]=_0x5cdd41[_0x946d('0x4a')][_0x946d('0x4c')]?_0x5cdd41[_0x946d('0x4a')]:_0x258f3f[_0x946d('0x46')];_0x5cdd41[_0x946d('0x6a')]=qs[_0x946d('0x4e')](_0x2e9f61[_0x946d('0x47')][_0x946d('0x4e')]);_0x5cdd41[_0x946d('0x4f')]=qs['filters'](_[_0x946d('0x50')](_0x2e9f61['query'],_0x258f3f['filters']));if(_0x2e9f61[_0x946d('0x47')][_0x946d('0x51')]){_0x5cdd41[_0x946d('0x4f')]=_[_0x946d('0x52')](_0x5cdd41[_0x946d('0x4f')],{'$or':_[_0x946d('0x40')](_0x5cdd41[_0x946d('0x4a')],function(_0x1cd08b){var _0x201e4f={};_0x201e4f[_0x1cd08b]={'$like':'%'+_0x2e9f61[_0x946d('0x47')][_0x946d('0x51')]+'%'};return _0x201e4f;})});}_0x5cdd41=_['merge']({},_0x5cdd41,_0x2e9f61['options']);return _0x3ecdd7[_0x946d('0x7e')](_0x5cdd41);}})['then'](function(_0x5e3469){if(_0x5e3469){_0x206a69=_0x5e3469[_0x946d('0x4c')];if(!_0x2e9f61[_0x946d('0x47')]['hasOwnProperty'](_0x946d('0x4d'))){_0x5cdd41['limit']=qs[_0x946d('0x32')](_0x2e9f61[_0x946d('0x47')][_0x946d('0x32')]);_0x5cdd41[_0x946d('0x30')]=qs[_0x946d('0x30')](_0x2e9f61[_0x946d('0x47')][_0x946d('0x30')]);}return _0x3ecdd7[_0x946d('0x7e')](_0x5cdd41);}})[_0x946d('0x38')](function(_0xd49cf9){if(_0xd49cf9){return _0xd49cf9?{'count':_0x206a69,'rows':_0xd49cf9}:null;}})['then'](respondWithResult(_0x2ea00b,null))[_0x946d('0x57')](handleError(_0x2ea00b,null));};exports[_0x946d('0x7f')]=function(_0x18a9a9,_0x705e3f,_0x1db09f){logger['info'](_0x946d('0x80'));logger[_0x946d('0x24')](_0x946d('0x81'),JSON[_0x946d('0x82')](_0x18a9a9[_0x946d('0x5d')]));var _0x4af2d6={'channel':_0x946d('0x83')};var _0x4266c6=[];var _0x2e9ef9=[];var _0x55a531={};return db[_0x946d('0x41')][_0x946d('0x5b')]({'where':{'id':_0x18a9a9[_0x946d('0x58')]['id']},'include':[{'model':db[_0x946d('0x7a')],'as':_0x946d('0x84')}]})[_0x946d('0x38')](handleEntityNotFound(_0x705e3f,null))[_0x946d('0x38')](function(_0x1fc7d2){_0x4af2d6['account']=_0x1fc7d2;_0x4af2d6[_0x946d('0x85')]=_[_0x946d('0x86')](_0x1fc7d2[_0x946d('0x84')],['priority'],['asc']);if(_0x4af2d6[_0x946d('0x87')][_0x946d('0x84')]){delete _0x4af2d6[_0x946d('0x87')][_0x946d('0x84')];}return db['CmContact'][_0x946d('0x65')]();})[_0x946d('0x38')](function(_0x1d26e2){if(!_0x1d26e2){throw new db[(_0x946d('0x88'))][(_0x946d('0x89'))](_0x946d('0x8a'));}logger[_0x946d('0x24')]('AC\x20sinch\x20attributes:%s',JSON[_0x946d('0x82')](_0x1d26e2));logger[_0x946d('0x24')](_0x946d('0x8b'),JSON['stringify'](_0x18a9a9[_0x946d('0x5d')]));_0x4266c6=_[_0x946d('0x8c')](_[_0x946d('0x59')](_0x1d26e2),['createdAt',_0x946d('0x8d')]);_0x2e9ef9=_[_0x946d('0x8c')](_[_0x946d('0x59')](_0x1d26e2),[_0x946d('0x8e'),_0x946d('0x8d'),_0x946d('0x8f'),_0x946d('0x90')]);_0x4af2d6[_0x946d('0x5d')]={'mapKey':_0x946d('0x91')};logger['info'](_0x946d('0x92'),JSON[_0x946d('0x82')](_0x4af2d6[_0x946d('0x87')][_0x946d('0x44')]));logger[_0x946d('0x24')](_0x946d('0x93'),JSON['stringify'](_0x4af2d6['body']));logger[_0x946d('0x24')]('AC\x20sinch\x20contactFields:%s',_0x4266c6);logger[_0x946d('0x24')](_0x946d('0x94'),_0x2e9ef9);if(_0x4af2d6[_0x946d('0x87')][_0x946d('0x44')]&&_0x4af2d6['account'][_0x946d('0x44')]===_0x946d('0x95')){_0x4af2d6[_0x946d('0x5d')][_0x946d('0x96')]=_0x18a9a9['body'][_0x946d('0x97')][_0x946d('0x98')](_0x946d('0x99'),'');_0x4af2d6[_0x946d('0x5d')][_0x946d('0x5d')]=_0x18a9a9[_0x946d('0x5d')][_0x946d('0x9a')];_0x4af2d6[_0x946d('0x5d')][_0x946d('0x9b')]=_0x18a9a9['body'][_0x946d('0x9c')];}if(_0x4af2d6['account'][_0x946d('0x44')]&&_0x4af2d6[_0x946d('0x87')][_0x946d('0x44')]===_0x946d('0x9d')){logger[_0x946d('0x24')]('AC\x20sinch\x20req.body\x202:%s',JSON[_0x946d('0x82')](_0x18a9a9[_0x946d('0x5d')]));_0x4af2d6[_0x946d('0x5d')][_0x946d('0x96')]=_0x18a9a9[_0x946d('0x5d')]['notifications'][0x0]['from'];_0x4af2d6[_0x946d('0x5d')]['body']=_0x18a9a9[_0x946d('0x5d')][_0x946d('0x9e')][0x0]['message'][_0x946d('0x5d')];_0x4af2d6['body'][_0x946d('0x9b')]=_0x18a9a9[_0x946d('0x5d')][_0x946d('0x9e')][0x0][_0x946d('0x9f')];}if(_0x4af2d6[_0x946d('0x5d')]['id']){delete _0x4af2d6[_0x946d('0x5d')]['id'];}if(_['isNil'](_0x4af2d6['body'][_0x946d('0x96')])){throw new db[(_0x946d('0x88'))][(_0x946d('0x89'))](_0x946d('0xa0'));}if(_[_0x946d('0xa1')](_0x4af2d6[_0x946d('0x5d')][_0x946d('0x5d')])||_0x4af2d6[_0x946d('0x5d')][_0x946d('0x5d')]===''){throw new db[(_0x946d('0x88'))]['ValidationError'](_0x946d('0xa2'));}if(_[_0x946d('0xa1')](_0x4af2d6[_0x946d('0x5d')]['mapKey'])){throw new db['Sequelize'][(_0x946d('0x89'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2e9ef9);}if(!_[_0x946d('0xa3')](_0x2e9ef9,_0x4af2d6[_0x946d('0x5d')]['mapKey'])){throw new db['Sequelize']['ValidationError'](_0x946d('0xa4')+_0x2e9ef9);}_0x55a531[_0x4af2d6['body'][_0x946d('0xa5')]]=_0x4af2d6[_0x946d('0x5d')]['from'];return db['CmList']['find']({'where':{'id':_0x4af2d6[_0x946d('0x87')][_0x946d('0x90')]},'include':[{'model':db['CmContact'],'as':_0x946d('0xa6'),'where':_0x55a531,'limit':0x1,'order':[[_0x946d('0x8d'),_0x946d('0xa7')]]}]});})[_0x946d('0x38')](handleEntityNotFound(_0x705e3f,null))['then'](function(_0x5a48e5){if(_0x5a48e5){_0x4af2d6[_0x946d('0xa8')]=_[_0x946d('0xa9')](_0x5a48e5,['Contacts']);if(_0x5a48e5[_0x946d('0xa6')][_0x946d('0x4c')]){return _0x5a48e5[_0x946d('0xa6')][0x0];}var _0x377d78=_[_0x946d('0xaa')](_0x4af2d6[_0x946d('0x5d')],{'firstName':_0x4af2d6[_0x946d('0x5d')][_0x946d('0x96')],'ListId':_0x5a48e5['id']});_0x377d78[_0x4af2d6[_0x946d('0x5d')]['mapKey']]=_0x4af2d6[_0x946d('0x5d')]['from'];return db[_0x946d('0xab')][_0x946d('0x5c')](_0x377d78,{'fields':_0x4266c6,'raw':!![]});}})[_0x946d('0x38')](handleEntityNotFound(_0x705e3f,null))[_0x946d('0x38')](function(_0x31ca55){if(_0x31ca55){_0x4af2d6[_0x946d('0xac')]=_0x31ca55;var _0x561d38={'ContactId':_0x31ca55['id'],'phone':_0x4af2d6[_0x946d('0x5d')][_0x946d('0x96')],'WhatsappAccountId':_0x18a9a9[_0x946d('0x58')]['id']};var _0x5347e9={'ContactId':_0x31ca55['id'],'WhatsappAccountId':_0x18a9a9['params']['id'],'closed':![]};return db[_0x946d('0xad')][_0x946d('0x5b')]({'where':_0x5347e9})[_0x946d('0x38')](function(_0x570466){if(_0x570466){return[_0x570466,![]];}return db[_0x946d('0xad')][_0x946d('0x5c')](_0x561d38)[_0x946d('0x38')](function(_0x22ea33){return[_0x22ea33,!![]];});});}})[_0x946d('0x72')](function(_0x529fc1,_0x4e9aca){_0x4af2d6[_0x946d('0xae')]=_0x529fc1[_0x946d('0x5f')]({'plain':!![]});_0x4af2d6[_0x946d('0xae')]['created']=![];if(_0x4e9aca){if(_0x4af2d6[_0x946d('0x87')][_0x946d('0xaf')]){_0x4af2d6[_0x946d('0x85')][_0x946d('0xb0')]({'id':0x0,'priority':_0x4af2d6[_0x946d('0x85')][_0x946d('0x4c')]+0x1,'app':_0x946d('0xb1'),'appdata':_0x946d('0xb2'),'interval':_0x946d('0xb3')});}_0x4af2d6[_0x946d('0xae')][_0x946d('0xb4')]=!![];}return db[_0x946d('0xb5')]['create']({'phone':_0x4af2d6[_0x946d('0x5d')]['from'],'messageId':_0x4af2d6['body']['messageId'],'body':_0x4af2d6['body'][_0x946d('0x5d')],'WhatsappAccountId':_0x18a9a9[_0x946d('0x58')]['id'],'WhatsappInteractionId':_0x529fc1['id'],'direction':'in','ContactId':_0x529fc1[_0x946d('0xb6')],'AttachmentId':_0x4af2d6[_0x946d('0x5d')]['AttachmentId']});})['then'](function(_0x175017){_0x4af2d6[_0x946d('0x2a')]=_0x175017;if(_0x4af2d6['interaction'][_0x946d('0xb7')]){return db[_0x946d('0x77')][_0x946d('0x5b')]({'attributes':['id',_0x946d('0x3c')],'where':{'id':_0x4af2d6['interaction']['UserId']}})['then'](function(_0x2155a6){if(_0x2155a6){_0x4af2d6['applications'][_0x946d('0xb8')]({'id':0x0,'priority':0x0,'app':_0x946d('0xb9'),'appdata':_0x2155a6[_0x946d('0x3c')]+','+(_0x4af2d6[_0x946d('0x87')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x946d('0xba'),_0x946d('0xbb'),_0x4af2d6);});}return respondWithRpcPromise(_0x946d('0xba'),_0x946d('0xbb'),_0x4af2d6);})[_0x946d('0x38')](function(_0x5b23bd){if(_0x5b23bd){var _0x1cf26b=0xc8;var _0x1d7e27=_0x946d('0xbc');logger[_0x946d('0x24')](_0x946d('0x26'),_0x1d7e27,_0x1cf26b,_0x946d('0xbd'));logger[_0x946d('0xbe')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x1d7e27,_0x1cf26b,_0x946d('0xbd'),JSON[_0x946d('0x82')](_0x5b23bd));if(_0x4af2d6[_0x946d('0x87')][_0x946d('0x44')]===_0x946d('0x95')){return _0x705e3f[_0x946d('0x2e')](_0x1cf26b)[_0x946d('0x34')](_0x946d('0xbf'),_0x946d('0xc0'))['send'](_0x946d('0xc1'));}else{return _0x705e3f[_0x946d('0x2e')](_0x1cf26b)[_0x946d('0x2f')](_0x5b23bd);}}})[_0x946d('0x57')](handleError(_0x705e3f,null));};exports['send']=function(_0x164192,_0x4759eb,_0x3881c0){var _0x3ec1de,_0x549de8,_0x444822;if(_[_0x946d('0xa1')](_0x164192[_0x946d('0x5d')][_0x946d('0x5d')])||_0x164192[_0x946d('0x5d')][_0x946d('0x5d')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x946d('0xa1')](_0x164192['body']['to'])){throw new db[(_0x946d('0x88'))][(_0x946d('0x89'))](_0x946d('0xc2'));}_0x3ec1de=_0x164192[_0x946d('0x5d')]['to'];return db[_0x946d('0x41')]['find']({'where':{'id':_0x164192[_0x946d('0x58')]['id']},'include':[{'model':db[_0x946d('0xc3')],'as':_0x946d('0xc4'),'include':[{'model':db[_0x946d('0xab')],'as':_0x946d('0xa6'),'where':{'mobile':_0x3ec1de},'limit':0x1,'order':[['updatedAt',_0x946d('0xa7')]]}]}]})['then'](handleEntityNotFound(_0x4759eb,null))[_0x946d('0x38')](function(_0x8ae664){if(_0x8ae664&&_0x8ae664[_0x946d('0xc4')]){_0x549de8=_0x8ae664[_0x946d('0x5f')]({'plain':!![]});if(_0x549de8[_0x946d('0xc4')]&&_0x549de8[_0x946d('0xc4')][_0x946d('0xa6')]['length']){return _0x549de8[_0x946d('0xc4')][_0x946d('0xa6')][0x0];}return db[_0x946d('0xab')]['create'](_[_0x946d('0xaa')](_0x164192[_0x946d('0x5d')],{'firstName':_0x3ec1de,'mobile':_0x3ec1de,'phone':_0x3ec1de,'ListId':_0x549de8[_0x946d('0x90')]}));}})[_0x946d('0x38')](handleEntityNotFound(_0x4759eb,null))[_0x946d('0x38')](function(_0x526a4c){if(_0x526a4c){_0x444822=_0x526a4c;return db['WhatsappInteraction'][_0x946d('0x5b')]({'where':{'ContactId':_0x444822['id'],'closed':![],'WhatsappAccountId':_0x549de8['id']}})[_0x946d('0x38')](function(_0xa9e69c){if(_0xa9e69c){return[_0xa9e69c,![]];}return db['WhatsappInteraction'][_0x946d('0x5c')]({'UserId':_0x164192[_0x946d('0x5e')]['id'],'ContactId':_0x444822['id'],'WhatsappAccountId':_0x549de8['id'],'phone':_0x3ec1de,'firstMsgDirection':_0x946d('0xc5'),'Messages':[_['merge'](_0x164192[_0x946d('0x5d')],{'read':![],'body':_0x164192[_0x946d('0x5d')][_0x946d('0x5d')],'phone':_0x3ec1de,'WhatsappAccountId':_0x549de8['id'],'UserId':_0x164192[_0x946d('0x5e')]['id'],'ContactId':_0x444822['id']})]},{'include':[{'model':db[_0x946d('0xb5')],'as':_0x946d('0xc6')}]})['then'](function(_0xb97008){return[_0xb97008,!![]];});});}})[_0x946d('0x72')](function(_0x17c273,_0x1425bb){if(_0x1425bb){return _0x17c273;}return db[_0x946d('0xb5')]['create'](_[_0x946d('0x52')](_0x164192[_0x946d('0x5d')],{'read':![],'body':_0x164192[_0x946d('0x5d')][_0x946d('0x5d')],'phone':_0x3ec1de,'WhatsappAccountId':_0x549de8['id'],'WhatsappInteractionId':_0x17c273['id'],'UserId':_0x164192[_0x946d('0x5e')]['id'],'ContactId':_0x444822['id']}))['then'](function(_0x280461){_0x17c273[_0x946d('0xc7')]['Messages']=[];_0x17c273[_0x946d('0xc7')][_0x946d('0xc6')][_0x946d('0xb0')](_0x280461['dataValues']);return _0x17c273;});})[_0x946d('0x38')](respondWithResult(_0x4759eb,null))['catch'](handleError(_0x4759eb,null));};
\ No newline at end of file
+var _0x46d1=['request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./whatsappAccount.socket','jayson/promise','client','http','request','info','WhatsappAccount,\x20%s,\x20%s','debug','request\x20sent','error','code','message','catch','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','WhatsappAccounts','UserProfileResource','name','send','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','type','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','rows','show','params','includeAll','include','find','create','body','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Disposition','getDispositions','order','WhatsappAccountId','findAll','removeDispositions','ids','CannedAnswer','getAnswers','findOne','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','transaction','WhatsappApplication','bulkCreate','findAndCountAll','getApplications','notify','AC\x20WhatsappAccount\x20req.body:%s','Applications','account','orderBy','priority','describe','Sequelize','ValidationError','no\x20available\x20attributes','stringify','AC\x20sinch\x20req.body:%s','difference','updatedAt','createdAt','CompanyId','ListId','mobile','AC\x20sinch\x20routing.body:%s','AC\x20sinch\x20contactFields:%s','AC\x20sinch\x20contactKeys:%s','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','sinch','AC\x20sinch\x20req.body\x202:%s','notifications','message_id','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','CmContact','Contacts','list','defaults','contact','WhatsappInteraction','interaction','created','applications','push','close','unmanaged','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','UserId','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','to\x20is\x20mandatory','DESC','List','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x248400,_0x231fa4){var _0x2473ea=function(_0x545dad){while(--_0x545dad){_0x248400['push'](_0x248400['shift']());}};_0x2473ea(++_0x231fa4);}(_0x46d1,0xbe));var _0x146d=function(_0x20adce,_0x4f8575){_0x20adce=_0x20adce-0x0;var _0x252f1b=_0x46d1[_0x20adce];return _0x252f1b;};'use strict';var emlformat=require(_0x146d('0x0'));var rimraf=require(_0x146d('0x1'));var zipdir=require(_0x146d('0x2'));var jsonpatch=require(_0x146d('0x3'));var rp=require(_0x146d('0x4'));var moment=require(_0x146d('0x5'));var BPromise=require(_0x146d('0x6'));var Mustache=require('mustache');var util=require(_0x146d('0x7'));var path=require(_0x146d('0x8'));var sox=require(_0x146d('0x9'));var csv=require('to-csv');var ejs=require(_0x146d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x146d('0xb'));var squel=require(_0x146d('0xc'));var crypto=require(_0x146d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x146d('0xe'));var toCsv=require('to-csv');var querystring=require(_0x146d('0xf'));var Papa=require(_0x146d('0x10'));var Redis=require(_0x146d('0x11'));var authService=require(_0x146d('0x12'));var qs=require(_0x146d('0x13'));var as=require(_0x146d('0x14'));var hardwareService=require(_0x146d('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x146d('0x16'));var config=require(_0x146d('0x17'));var licenseUtil=require(_0x146d('0x18'));var db=require(_0x146d('0x19'))['db'];config[_0x146d('0x1a')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x146d('0x1a')]));require(_0x146d('0x1b'))['register'](socket);var jayson=require(_0x146d('0x1c'));var client=jayson[_0x146d('0x1d')][_0x146d('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x2046bd,_0x4594c8,_0x1f62c4,_0x388492){return new BPromise(function(_0x264136,_0x2befa6){var _0x18307d=_0x388492||client;return _0x18307d[_0x146d('0x1f')](_0x2046bd,_0x1f62c4)['then'](function(_0x453823){logger[_0x146d('0x20')](_0x146d('0x21'),_0x4594c8,'request\x20sent');logger[_0x146d('0x22')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x4594c8,_0x146d('0x23'),JSON['stringify'](_0x453823));if(_0x453823[_0x146d('0x24')]){if(_0x453823[_0x146d('0x24')][_0x146d('0x25')]===0x1f4){logger[_0x146d('0x24')]('WhatsappAccount,\x20%s,\x20%s',_0x4594c8,_0x453823[_0x146d('0x24')][_0x146d('0x26')]);return _0x2befa6(_0x453823[_0x146d('0x24')][_0x146d('0x26')]);}logger[_0x146d('0x24')](_0x146d('0x21'),_0x4594c8,_0x453823[_0x146d('0x24')][_0x146d('0x26')]);return _0x264136(_0x453823[_0x146d('0x24')][_0x146d('0x26')]);}else{logger[_0x146d('0x20')](_0x146d('0x21'),_0x4594c8,_0x146d('0x23'));_0x264136(_0x453823['result'][_0x146d('0x26')]);}})[_0x146d('0x27')](function(_0x7e8d9d){logger['error'](_0x146d('0x21'),_0x4594c8,_0x7e8d9d);_0x2befa6(_0x7e8d9d);});});}function respondWithStatusCode(_0x359865,_0x3c4fe2){_0x3c4fe2=_0x3c4fe2||0xcc;return function(_0x2aa118){if(_0x2aa118){return _0x359865[_0x146d('0x28')](_0x3c4fe2);}return _0x359865[_0x146d('0x29')](_0x3c4fe2)[_0x146d('0x2a')]();};}function respondWithResult(_0x481746,_0x27d1ac){_0x27d1ac=_0x27d1ac||0xc8;return function(_0x59c002){if(_0x59c002){return _0x481746['status'](_0x27d1ac)[_0x146d('0x2b')](_0x59c002);}};}function respondWithFilteredResult(_0x46a0c7,_0x2e0450){return function(_0x3e2fc8){if(_0x3e2fc8){var _0x2d8931=typeof _0x2e0450['offset']==='undefined'&&typeof _0x2e0450['limit']===_0x146d('0x2c');var _0x4be220=_0x3e2fc8[_0x146d('0x2d')];var _0x465660=_0x2d8931?0x0:_0x2e0450[_0x146d('0x2e')];var _0x4b0a4b=_0x2d8931?_0x3e2fc8[_0x146d('0x2d')]:_0x2e0450[_0x146d('0x2e')]+_0x2e0450[_0x146d('0x2f')];var _0x1c8c6f;if(_0x4b0a4b>=_0x4be220){_0x4b0a4b=_0x4be220;_0x1c8c6f=0xc8;}else{_0x1c8c6f=0xce;}_0x46a0c7[_0x146d('0x29')](_0x1c8c6f);return _0x46a0c7['set'](_0x146d('0x30'),_0x465660+'-'+_0x4b0a4b+'/'+_0x4be220)[_0x146d('0x2b')](_0x3e2fc8);}return null;};}function patchUpdates(_0x5496ff){return function(_0x5a513f){try{jsonpatch[_0x146d('0x31')](_0x5a513f,_0x5496ff,!![]);}catch(_0x63c09b){return BPromise[_0x146d('0x32')](_0x63c09b);}return _0x5a513f[_0x146d('0x33')]();};}function saveUpdates(_0x51608d,_0x3efd5d){return function(_0x1dfa16){if(_0x1dfa16){return _0x1dfa16[_0x146d('0x34')](_0x51608d)[_0x146d('0x35')](function(_0x10c973){return _0x10c973;});}return null;};}function removeEntity(_0x5a8e46,_0x373a58){return function(_0xc81c27){if(_0xc81c27){return _0xc81c27[_0x146d('0x36')]()[_0x146d('0x35')](function(){var _0x832ce5=_0xc81c27['get']({'plain':!![]});var _0x352b98=_0x146d('0x37');return db[_0x146d('0x38')][_0x146d('0x36')]({'where':{'type':_0x352b98,'resourceId':_0x832ce5['id']}})['then'](function(){return _0xc81c27;});})[_0x146d('0x35')](function(){_0x5a8e46[_0x146d('0x29')](0xcc)[_0x146d('0x2a')]();});}};}function handleEntityNotFound(_0x493a0c,_0x2cec52){return function(_0x3a3817){if(!_0x3a3817){_0x493a0c[_0x146d('0x28')](0x194);}return _0x3a3817;};}function handleError(_0xfc1380,_0x3a6c6e){_0x3a6c6e=_0x3a6c6e||0x1f4;return function(_0x10a872){logger['error'](_0x10a872['stack']);if(_0x10a872[_0x146d('0x39')]){delete _0x10a872[_0x146d('0x39')];}_0xfc1380[_0x146d('0x29')](_0x3a6c6e)[_0x146d('0x3a')](_0x10a872);};}exports['index']=function(_0x116e1a,_0x3aa9ad){var _0x4ce3c6={'include':[{'model':db[_0x146d('0x3b')],'as':_0x146d('0x3c')}]},_0x241587={},_0xb9408f={'count':0x0,'rows':[]};var _0x3d114a=_[_0x146d('0x3d')](db[_0x146d('0x3e')][_0x146d('0x3f')],function(_0x21400c){return{'name':_0x21400c['fieldName'],'type':_0x21400c[_0x146d('0x40')][_0x146d('0x41')]};});_0x241587['model']=_['map'](_0x3d114a,_0x146d('0x39'));_0x241587['query']=_[_0x146d('0x42')](_0x116e1a[_0x146d('0x43')]);_0x241587[_0x146d('0x44')]=_[_0x146d('0x45')](_0x241587['model'],_0x241587[_0x146d('0x43')]);_0x4ce3c6[_0x146d('0x46')]=_[_0x146d('0x45')](_0x241587[_0x146d('0x47')],qs[_0x146d('0x48')](_0x116e1a[_0x146d('0x43')][_0x146d('0x48')]));_0x4ce3c6[_0x146d('0x46')]=_0x4ce3c6['attributes'][_0x146d('0x49')]?_0x4ce3c6[_0x146d('0x46')]:_0x241587[_0x146d('0x47')];if(!_0x116e1a[_0x146d('0x43')][_0x146d('0x4a')](_0x146d('0x4b'))){_0x4ce3c6[_0x146d('0x2f')]=qs['limit'](_0x116e1a[_0x146d('0x43')]['limit']);_0x4ce3c6[_0x146d('0x2e')]=qs['offset'](_0x116e1a[_0x146d('0x43')][_0x146d('0x2e')]);}_0x4ce3c6['order']=qs[_0x146d('0x4c')](_0x116e1a[_0x146d('0x43')]['sort']);_0x4ce3c6[_0x146d('0x4d')]=qs[_0x146d('0x44')](_[_0x146d('0x4e')](_0x116e1a[_0x146d('0x43')],_0x241587[_0x146d('0x44')]),_0x3d114a);if(_0x116e1a[_0x146d('0x43')]['filter']){_0x4ce3c6[_0x146d('0x4d')]=_[_0x146d('0x4f')](_0x4ce3c6[_0x146d('0x4d')],{'$or':_[_0x146d('0x3d')](_0x3d114a,function(_0x4fc68e){if(_0x4fc68e[_0x146d('0x40')]!==_0x146d('0x50')){var _0x20aa55={};_0x20aa55[_0x4fc68e['name']]={'$like':'%'+_0x116e1a['query'][_0x146d('0x51')]+'%'};return _0x20aa55;}})});}_0x4ce3c6=_[_0x146d('0x4f')]({},_0x4ce3c6,_0x116e1a[_0x146d('0x52')]);var _0xeaf5a7={'where':_0x4ce3c6['where']};return db[_0x146d('0x3e')][_0x146d('0x2d')](_0xeaf5a7)[_0x146d('0x35')](function(_0x5cc944){_0xb9408f[_0x146d('0x2d')]=_0x5cc944;if(_0x116e1a[_0x146d('0x43')]['includeAll']){_0x4ce3c6['include']=[{'all':!![]}];}return db[_0x146d('0x3e')]['findAll'](_0x4ce3c6);})[_0x146d('0x35')](function(_0xb72d16){_0xb9408f[_0x146d('0x53')]=_0xb72d16;return _0xb9408f;})[_0x146d('0x35')](respondWithFilteredResult(_0x3aa9ad,_0x4ce3c6))['catch'](handleError(_0x3aa9ad,null));};exports[_0x146d('0x54')]=function(_0x41ced2,_0xdfc351){var _0x187a27={'raw':![],'where':{'id':_0x41ced2[_0x146d('0x55')]['id']},'include':[{'model':db[_0x146d('0x3b')],'as':_0x146d('0x3c')}]},_0x204a0e={};_0x204a0e[_0x146d('0x47')]=_[_0x146d('0x42')](db[_0x146d('0x3e')]['rawAttributes']);_0x204a0e['query']=_[_0x146d('0x42')](_0x41ced2[_0x146d('0x43')]);_0x204a0e[_0x146d('0x44')]=_['intersection'](_0x204a0e[_0x146d('0x47')],_0x204a0e[_0x146d('0x43')]);_0x187a27[_0x146d('0x46')]=_[_0x146d('0x45')](_0x204a0e[_0x146d('0x47')],qs[_0x146d('0x48')](_0x41ced2[_0x146d('0x43')][_0x146d('0x48')]));_0x187a27[_0x146d('0x46')]=_0x187a27[_0x146d('0x46')][_0x146d('0x49')]?_0x187a27['attributes']:_0x204a0e[_0x146d('0x47')];if(_0x41ced2[_0x146d('0x43')][_0x146d('0x56')]){_0x187a27[_0x146d('0x57')]=[{'all':!![]}];}_0x187a27=_[_0x146d('0x4f')]({},_0x187a27,_0x41ced2[_0x146d('0x52')]);return db[_0x146d('0x3e')][_0x146d('0x58')](_0x187a27)[_0x146d('0x35')](handleEntityNotFound(_0xdfc351,null))[_0x146d('0x35')](respondWithResult(_0xdfc351,null))[_0x146d('0x27')](handleError(_0xdfc351,null));};exports[_0x146d('0x59')]=function(_0x1fe487,_0x53fc0e){return db[_0x146d('0x3e')][_0x146d('0x59')](_0x1fe487[_0x146d('0x5a')],{})[_0x146d('0x35')](function(_0x869294){var _0x1943d7=_0x1fe487[_0x146d('0x5b')][_0x146d('0x5c')]({'plain':!![]});if(!_0x1943d7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1943d7['role']===_0x146d('0x5b')){var _0x22f7e0=_0x869294['get']({'plain':!![]});var _0x496732=_0x146d('0x37');return db[_0x146d('0x5d')]['find']({'where':{'name':_0x496732,'userProfileId':_0x1943d7['userProfileId']},'raw':!![]})[_0x146d('0x35')](function(_0x43829f){if(_0x43829f&&_0x43829f[_0x146d('0x5e')]===0x0){return db[_0x146d('0x38')]['create']({'name':_0x22f7e0[_0x146d('0x39')],'resourceId':_0x22f7e0['id'],'type':_0x43829f['name'],'sectionId':_0x43829f['id']},{})['then'](function(){return _0x869294;});}else{return _0x869294;}})[_0x146d('0x27')](function(_0x39bf7b){logger['error'](_0x146d('0x5f'),_0x39bf7b);throw _0x39bf7b;});}return _0x869294;})['then'](respondWithResult(_0x53fc0e,0xc9))[_0x146d('0x27')](handleError(_0x53fc0e,null));};exports['update']=function(_0xdf6d93,_0x5847df){if(_0xdf6d93[_0x146d('0x5a')]['id']){delete _0xdf6d93[_0x146d('0x5a')]['id'];}return db[_0x146d('0x3e')]['find']({'where':{'id':_0xdf6d93[_0x146d('0x55')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x146d('0x35')](handleEntityNotFound(_0x5847df,null))[_0x146d('0x35')](saveUpdates(_0xdf6d93[_0x146d('0x5a')],null))[_0x146d('0x35')](respondWithResult(_0x5847df,null))[_0x146d('0x27')](handleError(_0x5847df,null));};exports[_0x146d('0x36')]=function(_0x29315e,_0x1ec8b9){return db[_0x146d('0x3e')][_0x146d('0x58')]({'where':{'id':_0x29315e[_0x146d('0x55')]['id']}})[_0x146d('0x35')](handleEntityNotFound(_0x1ec8b9,null))[_0x146d('0x35')](removeEntity(_0x1ec8b9,null))[_0x146d('0x27')](handleError(_0x1ec8b9,null));};exports['describe']=function(_0xa00d73,_0x4d5ac6){return db['WhatsappAccount']['describe']()[_0x146d('0x35')](respondWithResult(_0x4d5ac6,null))[_0x146d('0x27')](handleError(_0x4d5ac6,null));};exports['addDisposition']=function(_0x376a0a,_0x216616,_0x313976){if(_0x376a0a[_0x146d('0x5a')]['id']){delete _0x376a0a['body']['id'];}return db[_0x146d('0x3e')][_0x146d('0x58')]({'where':{'id':_0x376a0a['params']['id']}})[_0x146d('0x35')](handleEntityNotFound(_0x216616,null))[_0x146d('0x35')](function(_0x5cfb55){if(_0x5cfb55){_0x376a0a[_0x146d('0x5a')]['WhatsappAccountId']=_0x5cfb55['id'];return db[_0x146d('0x60')][_0x146d('0x59')](_0x376a0a[_0x146d('0x5a')]);}})['then'](respondWithResult(_0x216616,null))['catch'](handleError(_0x216616,null));};exports[_0x146d('0x61')]=function(_0x49cd30,_0x5c522a,_0x5443f1){var _0x24be3d={'raw':![],'where':{}};var _0x89fece={};var _0x494cee={'count':0x0,'rows':[]};return db[_0x146d('0x3e')]['findOne']({'where':{'id':_0x49cd30[_0x146d('0x55')]['id']}})[_0x146d('0x35')](handleEntityNotFound(_0x5c522a,null))[_0x146d('0x35')](function(_0x37dda1){if(_0x37dda1){_0x89fece[_0x146d('0x47')]=_['keys'](db[_0x146d('0x60')]['rawAttributes']);_0x89fece[_0x146d('0x43')]=_[_0x146d('0x42')](_0x49cd30[_0x146d('0x43')]);_0x89fece[_0x146d('0x44')]=_[_0x146d('0x45')](_0x89fece[_0x146d('0x47')],_0x89fece[_0x146d('0x43')]);_0x24be3d[_0x146d('0x46')]=_[_0x146d('0x45')](_0x89fece[_0x146d('0x47')],qs['fields'](_0x49cd30['query'][_0x146d('0x48')]));_0x24be3d[_0x146d('0x46')]=_0x24be3d['attributes']['length']?_0x24be3d['attributes']:_0x89fece['model'];if(!_0x49cd30[_0x146d('0x43')][_0x146d('0x4a')](_0x146d('0x4b'))){_0x24be3d[_0x146d('0x2f')]=qs[_0x146d('0x2f')](_0x49cd30[_0x146d('0x43')][_0x146d('0x2f')]);_0x24be3d[_0x146d('0x2e')]=qs[_0x146d('0x2e')](_0x49cd30['query'][_0x146d('0x2e')]);}_0x24be3d[_0x146d('0x62')]=qs[_0x146d('0x4c')](_0x49cd30['query'][_0x146d('0x4c')]);_0x24be3d['where']=qs['filters'](_[_0x146d('0x4e')](_0x49cd30[_0x146d('0x43')],_0x89fece[_0x146d('0x44')]));_0x24be3d['where'][_0x146d('0x63')]=_0x37dda1['id'];if(_0x49cd30['query'][_0x146d('0x51')]){_0x24be3d[_0x146d('0x4d')]=_[_0x146d('0x4f')](_0x24be3d['where'],{'$or':_['map'](_0x24be3d[_0x146d('0x46')],function(_0x1e6bd3){var _0x495a04={};_0x495a04[_0x1e6bd3]={'$like':'%'+_0x49cd30[_0x146d('0x43')]['filter']+'%'};return _0x495a04;})});}_0x24be3d=_[_0x146d('0x4f')]({},_0x24be3d,_0x49cd30[_0x146d('0x52')]);return db[_0x146d('0x60')][_0x146d('0x2d')]({'where':_0x24be3d[_0x146d('0x4d')]})[_0x146d('0x35')](function(_0x2091e7){_0x494cee[_0x146d('0x2d')]=_0x2091e7;if(_0x49cd30['query'][_0x146d('0x56')]){_0x24be3d[_0x146d('0x57')]=[{'all':!![]}];}return db[_0x146d('0x60')][_0x146d('0x64')](_0x24be3d);})[_0x146d('0x35')](function(_0x1cb1db){_0x494cee[_0x146d('0x53')]=_0x1cb1db;return _0x494cee;});}})[_0x146d('0x35')](respondWithFilteredResult(_0x5c522a,_0x24be3d))[_0x146d('0x27')](handleError(_0x5c522a,null));};exports[_0x146d('0x65')]=function(_0x3c7d73,_0x29f33f,_0x427077){return db[_0x146d('0x3e')][_0x146d('0x58')]({'where':{'id':_0x3c7d73[_0x146d('0x55')]['id']}})[_0x146d('0x35')](handleEntityNotFound(_0x29f33f,null))['then'](function(_0xb53605){if(_0xb53605){return _0xb53605[_0x146d('0x65')](_0x3c7d73['query'][_0x146d('0x66')]);}})['then'](respondWithStatusCode(_0x29f33f,null))[_0x146d('0x27')](handleError(_0x29f33f,null));};exports['addAnswer']=function(_0x1c3013,_0x27f0cc,_0x534bde){if(_0x1c3013[_0x146d('0x5a')]['id']){delete _0x1c3013[_0x146d('0x5a')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x1c3013['params']['id']}})['then'](handleEntityNotFound(_0x27f0cc,null))['then'](function(_0x1a84a1){if(_0x1a84a1){_0x1c3013['body'][_0x146d('0x63')]=_0x1a84a1['id'];return db[_0x146d('0x67')][_0x146d('0x59')](_0x1c3013[_0x146d('0x5a')]);}})[_0x146d('0x35')](respondWithResult(_0x27f0cc,null))[_0x146d('0x27')](handleError(_0x27f0cc,null));};exports[_0x146d('0x68')]=function(_0x3a39cc,_0x8eba52,_0x382ebf){var _0x29ad30={'raw':![],'where':{}};var _0x4953d0={};var _0xba047={'count':0x0,'rows':[]};return db[_0x146d('0x3e')][_0x146d('0x69')]({'where':{'id':_0x3a39cc['params']['id']}})[_0x146d('0x35')](handleEntityNotFound(_0x8eba52,null))[_0x146d('0x35')](function(_0x1f326a){if(_0x1f326a){_0x4953d0[_0x146d('0x47')]=_['keys'](db[_0x146d('0x67')][_0x146d('0x3f')]);_0x4953d0[_0x146d('0x43')]=_[_0x146d('0x42')](_0x3a39cc['query']);_0x4953d0[_0x146d('0x44')]=_['intersection'](_0x4953d0[_0x146d('0x47')],_0x4953d0[_0x146d('0x43')]);_0x29ad30[_0x146d('0x46')]=_['intersection'](_0x4953d0[_0x146d('0x47')],qs[_0x146d('0x48')](_0x3a39cc[_0x146d('0x43')][_0x146d('0x48')]));_0x29ad30[_0x146d('0x46')]=_0x29ad30['attributes'][_0x146d('0x49')]?_0x29ad30['attributes']:_0x4953d0[_0x146d('0x47')];if(!_0x3a39cc[_0x146d('0x43')]['hasOwnProperty'](_0x146d('0x4b'))){_0x29ad30[_0x146d('0x2f')]=qs[_0x146d('0x2f')](_0x3a39cc[_0x146d('0x43')][_0x146d('0x2f')]);_0x29ad30[_0x146d('0x2e')]=qs[_0x146d('0x2e')](_0x3a39cc[_0x146d('0x43')][_0x146d('0x2e')]);}_0x29ad30['order']=qs['sort'](_0x3a39cc[_0x146d('0x43')][_0x146d('0x4c')]);_0x29ad30['where']=qs[_0x146d('0x44')](_[_0x146d('0x4e')](_0x3a39cc[_0x146d('0x43')],_0x4953d0[_0x146d('0x44')]));_0x29ad30['where'][_0x146d('0x63')]=_0x1f326a['id'];if(_0x3a39cc['query']['filter']){_0x29ad30[_0x146d('0x4d')]=_[_0x146d('0x4f')](_0x29ad30[_0x146d('0x4d')],{'$or':_['map'](_0x29ad30[_0x146d('0x46')],function(_0x683d41){var _0x2b72ba={};_0x2b72ba[_0x683d41]={'$like':'%'+_0x3a39cc['query'][_0x146d('0x51')]+'%'};return _0x2b72ba;})});}_0x29ad30=_[_0x146d('0x4f')]({},_0x29ad30,_0x3a39cc[_0x146d('0x52')]);return db['CannedAnswer'][_0x146d('0x2d')]({'where':_0x29ad30['where']})[_0x146d('0x35')](function(_0x12e294){_0xba047[_0x146d('0x2d')]=_0x12e294;if(_0x3a39cc[_0x146d('0x43')][_0x146d('0x56')]){_0x29ad30[_0x146d('0x57')]=[{'all':!![]}];}return db[_0x146d('0x67')][_0x146d('0x64')](_0x29ad30);})[_0x146d('0x35')](function(_0x14b156){_0xba047['rows']=_0x14b156;return _0xba047;});}})[_0x146d('0x35')](respondWithFilteredResult(_0x8eba52,_0x29ad30))['catch'](handleError(_0x8eba52,null));};exports[_0x146d('0x6a')]=function(_0x390cf5,_0x5a3970,_0xa84634){return db[_0x146d('0x3e')][_0x146d('0x58')]({'where':{'id':_0x390cf5['params']['id']}})['then'](handleEntityNotFound(_0x5a3970,null))['then'](function(_0x1d97f7){if(_0x1d97f7){return _0x1d97f7[_0x146d('0x6a')](_0x390cf5[_0x146d('0x43')][_0x146d('0x66')]);}})[_0x146d('0x35')](respondWithStatusCode(_0x5a3970,null))[_0x146d('0x27')](handleError(_0x5a3970,null));};exports[_0x146d('0x6b')]=function(_0x37c116,_0x3b309d,_0x9b625e){return db[_0x146d('0x3e')][_0x146d('0x58')]({'where':{'id':_0x37c116[_0x146d('0x55')]['id']}})['then'](handleEntityNotFound(_0x3b309d,null))[_0x146d('0x35')](function(_0x487bd6){if(_0x487bd6){return _0x487bd6[_0x146d('0x6b')](_0x37c116[_0x146d('0x5a')][_0x146d('0x66')],_[_0x146d('0x6c')](_0x37c116[_0x146d('0x5a')],['ids','id'])||{})[_0x146d('0x6d')](function(_0xa17087){for(var _0x48c8f9=0x0;_0x48c8f9<_0x37c116[_0x146d('0x5a')]['ids'][_0x146d('0x49')];_0x48c8f9+=0x1){socket[_0x146d('0x6e')](_0x146d('0x6f'),{'UserId':Number(_0x37c116[_0x146d('0x5a')]['ids'][_0x48c8f9]),'WhatsappAccountId':Number(_0x37c116['params']['id'])});}return _0xa17087;});}})[_0x146d('0x35')](respondWithResult(_0x3b309d,null))[_0x146d('0x27')](handleError(_0x3b309d,null));};exports[_0x146d('0x70')]=function(_0x54f4d2,_0x50fa2a,_0x1f11b0){return db[_0x146d('0x3e')][_0x146d('0x58')]({'where':{'id':_0x54f4d2[_0x146d('0x55')]['id']}})[_0x146d('0x35')](handleEntityNotFound(_0x50fa2a,null))['then'](function(_0x4579fe){if(_0x4579fe){return _0x4579fe[_0x146d('0x70')](_0x54f4d2[_0x146d('0x43')]['ids'])[_0x146d('0x35')](function(){if(_[_0x146d('0x71')](_0x54f4d2[_0x146d('0x43')][_0x146d('0x66')])){for(var _0x42b363=0x0;_0x42b363<_0x54f4d2[_0x146d('0x43')][_0x146d('0x66')][_0x146d('0x49')];_0x42b363+=0x1){socket['emit'](_0x146d('0x72'),{'UserId':Number(_0x54f4d2[_0x146d('0x43')][_0x146d('0x66')][_0x42b363]),'WhatsappAccountId':Number(_0x54f4d2[_0x146d('0x55')]['id'])});}}else{socket[_0x146d('0x6e')](_0x146d('0x72'),{'UserId':Number(_0x54f4d2[_0x146d('0x43')]['ids']),'WhatsappAccountId':Number(_0x54f4d2['params']['id'])});}});}})[_0x146d('0x35')](respondWithStatusCode(_0x50fa2a,null))[_0x146d('0x27')](handleError(_0x50fa2a,null));};exports[_0x146d('0x73')]=function(_0x475dcb,_0x3306ac,_0x59d07d){var _0x27fcf0={};var _0x2bb826={};var _0x8a0f45;var _0x1a6524;return db[_0x146d('0x3e')]['findOne']({'where':{'id':_0x475dcb['params']['id']}})[_0x146d('0x35')](handleEntityNotFound(_0x3306ac,null))[_0x146d('0x35')](function(_0x4d1ba8){if(_0x4d1ba8){_0x8a0f45=_0x4d1ba8;_0x2bb826[_0x146d('0x47')]=_[_0x146d('0x42')](db[_0x146d('0x74')][_0x146d('0x3f')]);_0x2bb826[_0x146d('0x43')]=_[_0x146d('0x42')](_0x475dcb[_0x146d('0x43')]);_0x2bb826[_0x146d('0x44')]=_[_0x146d('0x45')](_0x2bb826[_0x146d('0x47')],_0x2bb826[_0x146d('0x43')]);_0x27fcf0[_0x146d('0x46')]=_[_0x146d('0x45')](_0x2bb826[_0x146d('0x47')],qs[_0x146d('0x48')](_0x475dcb[_0x146d('0x43')][_0x146d('0x48')]));_0x27fcf0[_0x146d('0x46')]=_0x27fcf0['attributes'][_0x146d('0x49')]?_0x27fcf0[_0x146d('0x46')]:_0x2bb826[_0x146d('0x47')];_0x27fcf0[_0x146d('0x62')]=qs[_0x146d('0x4c')](_0x475dcb[_0x146d('0x43')]['sort']);_0x27fcf0['where']=qs[_0x146d('0x44')](_[_0x146d('0x4e')](_0x475dcb['query'],_0x2bb826['filters']));if(_0x475dcb[_0x146d('0x43')][_0x146d('0x51')]){_0x27fcf0[_0x146d('0x4d')]=_['merge'](_0x27fcf0[_0x146d('0x4d')],{'$or':_['map'](_0x27fcf0[_0x146d('0x46')],function(_0x132ec2){var _0x22558f={};_0x22558f[_0x132ec2]={'$like':'%'+_0x475dcb[_0x146d('0x43')][_0x146d('0x51')]+'%'};return _0x22558f;})});}_0x27fcf0=_['merge']({},_0x27fcf0,_0x475dcb[_0x146d('0x52')]);return _0x8a0f45['getAgents'](_0x27fcf0);}})[_0x146d('0x35')](function(_0x48353e){if(_0x48353e){_0x1a6524=_0x48353e['length'];if(!_0x475dcb[_0x146d('0x43')]['hasOwnProperty'](_0x146d('0x4b'))){_0x27fcf0[_0x146d('0x2f')]=qs[_0x146d('0x2f')](_0x475dcb[_0x146d('0x43')][_0x146d('0x2f')]);_0x27fcf0[_0x146d('0x2e')]=qs[_0x146d('0x2e')](_0x475dcb[_0x146d('0x43')][_0x146d('0x2e')]);}return _0x8a0f45[_0x146d('0x73')](_0x27fcf0);}})['then'](function(_0x586db6){if(_0x586db6){return _0x586db6?{'count':_0x1a6524,'rows':_0x586db6}:null;}})[_0x146d('0x35')](respondWithResult(_0x3306ac,null))['catch'](handleError(_0x3306ac,null));};exports[_0x146d('0x75')]=function(_0x113233,_0x3241b6,_0x4cadf5){return db['WhatsappAccount'][_0x146d('0x69')]({'where':{'id':_0x113233['params']['id']}})[_0x146d('0x35')](handleEntityNotFound(_0x3241b6,null))['then'](function(_0x2c51a3){if(_0x2c51a3){return db['sequelize'][_0x146d('0x76')](function(_0x18c611){return db[_0x146d('0x77')][_0x146d('0x36')]({'where':{'WhatsappAccountId':_0x113233[_0x146d('0x55')]['id']},'transaction':_0x18c611})[_0x146d('0x35')](function(_0x13a319){var _0x13e6de=_[_0x146d('0x3d')](_0x113233[_0x146d('0x5a')],function(_0x5965d9){_0x5965d9[_0x146d('0x63')]=_0x113233[_0x146d('0x55')]['id'];return _0x5965d9;});return db[_0x146d('0x77')][_0x146d('0x78')](_0x13e6de,{'transaction':_0x18c611});});})[_0x146d('0x35')](function(){return db[_0x146d('0x77')][_0x146d('0x79')]({'where':{'WhatsappAccountId':_0x113233[_0x146d('0x55')]['id']},'order':'priority'});});}})[_0x146d('0x35')](respondWithResult(_0x3241b6,null))[_0x146d('0x27')](handleError(_0x3241b6,null));};exports['getApplications']=function(_0x520a0e,_0x191dbc,_0x4712d5){var _0x3bb4ca={};var _0x5a0195={};var _0x31df50;var _0x13c662;return db[_0x146d('0x3e')][_0x146d('0x69')]({'where':{'id':_0x520a0e['params']['id']}})['then'](handleEntityNotFound(_0x191dbc,null))[_0x146d('0x35')](function(_0x4c9a9f){if(_0x4c9a9f){_0x31df50=_0x4c9a9f;_0x5a0195[_0x146d('0x47')]=_['keys'](db[_0x146d('0x77')][_0x146d('0x3f')]);_0x5a0195[_0x146d('0x43')]=_[_0x146d('0x42')](_0x520a0e[_0x146d('0x43')]);_0x5a0195[_0x146d('0x44')]=_[_0x146d('0x45')](_0x5a0195['model'],_0x5a0195[_0x146d('0x43')]);_0x3bb4ca[_0x146d('0x46')]=_[_0x146d('0x45')](_0x5a0195['model'],qs[_0x146d('0x48')](_0x520a0e[_0x146d('0x43')][_0x146d('0x48')]));_0x3bb4ca['attributes']=_0x3bb4ca[_0x146d('0x46')]['length']?_0x3bb4ca['attributes']:_0x5a0195[_0x146d('0x47')];_0x3bb4ca['order']=qs['sort'](_0x520a0e[_0x146d('0x43')][_0x146d('0x4c')]);_0x3bb4ca[_0x146d('0x4d')]=qs[_0x146d('0x44')](_[_0x146d('0x4e')](_0x520a0e[_0x146d('0x43')],_0x5a0195[_0x146d('0x44')]));if(_0x520a0e[_0x146d('0x43')][_0x146d('0x51')]){_0x3bb4ca['where']=_[_0x146d('0x4f')](_0x3bb4ca[_0x146d('0x4d')],{'$or':_[_0x146d('0x3d')](_0x3bb4ca['attributes'],function(_0x5a811c){var _0x4a6905={};_0x4a6905[_0x5a811c]={'$like':'%'+_0x520a0e[_0x146d('0x43')][_0x146d('0x51')]+'%'};return _0x4a6905;})});}_0x3bb4ca=_[_0x146d('0x4f')]({},_0x3bb4ca,_0x520a0e[_0x146d('0x52')]);return _0x31df50[_0x146d('0x7a')](_0x3bb4ca);}})[_0x146d('0x35')](function(_0x59803c){if(_0x59803c){_0x13c662=_0x59803c[_0x146d('0x49')];if(!_0x520a0e[_0x146d('0x43')][_0x146d('0x4a')](_0x146d('0x4b'))){_0x3bb4ca[_0x146d('0x2f')]=qs[_0x146d('0x2f')](_0x520a0e[_0x146d('0x43')][_0x146d('0x2f')]);_0x3bb4ca[_0x146d('0x2e')]=qs[_0x146d('0x2e')](_0x520a0e[_0x146d('0x43')]['offset']);}return _0x31df50[_0x146d('0x7a')](_0x3bb4ca);}})[_0x146d('0x35')](function(_0x566eff){if(_0x566eff){return _0x566eff?{'count':_0x13c662,'rows':_0x566eff}:null;}})[_0x146d('0x35')](respondWithResult(_0x191dbc,null))['catch'](handleError(_0x191dbc,null));};exports[_0x146d('0x7b')]=function(_0x347f46,_0x1df0d3,_0x26fddf){logger[_0x146d('0x20')]('AC\x20WhatsappAccount\x20notify');logger[_0x146d('0x20')](_0x146d('0x7c'),JSON['stringify'](_0x347f46['body']));var _0x586d18={'channel':'whatsapp'};var _0x34d9bc=[];var _0x48c94e=[];var _0x299e1={};return db[_0x146d('0x3e')]['find']({'where':{'id':_0x347f46[_0x146d('0x55')]['id']},'include':[{'model':db[_0x146d('0x77')],'as':_0x146d('0x7d')}]})['then'](handleEntityNotFound(_0x1df0d3,null))[_0x146d('0x35')](function(_0x4e1d87){_0x586d18[_0x146d('0x7e')]=_0x4e1d87;_0x586d18['applications']=_[_0x146d('0x7f')](_0x4e1d87[_0x146d('0x7d')],[_0x146d('0x80')],['asc']);if(_0x586d18[_0x146d('0x7e')][_0x146d('0x7d')]){delete _0x586d18[_0x146d('0x7e')][_0x146d('0x7d')];}return db['CmContact'][_0x146d('0x81')]();})['then'](function(_0x32b9ef){if(!_0x32b9ef){throw new db[(_0x146d('0x82'))][(_0x146d('0x83'))](_0x146d('0x84'));}logger[_0x146d('0x20')]('AC\x20sinch\x20attributes:%s',JSON[_0x146d('0x85')](_0x32b9ef));logger[_0x146d('0x20')](_0x146d('0x86'),JSON[_0x146d('0x85')](_0x347f46[_0x146d('0x5a')]));_0x34d9bc=_[_0x146d('0x87')](_['keys'](_0x32b9ef),['createdAt',_0x146d('0x88')]);_0x48c94e=_[_0x146d('0x87')](_['keys'](_0x32b9ef),[_0x146d('0x89'),_0x146d('0x88'),_0x146d('0x8a'),_0x146d('0x8b')]);_0x586d18[_0x146d('0x5a')]={'mapKey':_0x146d('0x8c')};logger['info']('AC\x20sinch\x20routing.account.type:%s',JSON[_0x146d('0x85')](_0x586d18['account']['type']));logger[_0x146d('0x20')](_0x146d('0x8d'),JSON['stringify'](_0x586d18[_0x146d('0x5a')]));logger['info'](_0x146d('0x8e'),_0x34d9bc);logger[_0x146d('0x20')](_0x146d('0x8f'),_0x48c94e);if(_0x586d18[_0x146d('0x7e')][_0x146d('0x40')]&&_0x586d18['account'][_0x146d('0x40')]===_0x146d('0x90')){_0x586d18[_0x146d('0x5a')][_0x146d('0x91')]=_0x347f46['body'][_0x146d('0x92')][_0x146d('0x93')](_0x146d('0x94'),'');_0x586d18[_0x146d('0x5a')][_0x146d('0x5a')]=_0x347f46[_0x146d('0x5a')][_0x146d('0x95')];_0x586d18['body'][_0x146d('0x96')]=_0x347f46['body'][_0x146d('0x97')];}if(_0x586d18[_0x146d('0x7e')]['type']&&_0x586d18[_0x146d('0x7e')][_0x146d('0x40')]===_0x146d('0x98')){logger[_0x146d('0x20')](_0x146d('0x99'),JSON[_0x146d('0x85')](_0x347f46[_0x146d('0x5a')]));_0x586d18[_0x146d('0x5a')][_0x146d('0x91')]=_0x347f46[_0x146d('0x5a')][_0x146d('0x9a')][0x0][_0x146d('0x91')];_0x586d18[_0x146d('0x5a')][_0x146d('0x5a')]=_0x347f46[_0x146d('0x5a')][_0x146d('0x9a')][0x0][_0x146d('0x26')]['body'];_0x586d18['body'][_0x146d('0x96')]=_0x347f46['body'][_0x146d('0x9a')][0x0][_0x146d('0x9b')];}if(_0x586d18['body']['id']){delete _0x586d18['body']['id'];}if(_[_0x146d('0x9c')](_0x586d18[_0x146d('0x5a')][_0x146d('0x91')])){throw new db[(_0x146d('0x82'))]['ValidationError'](_0x146d('0x9d'));}if(_[_0x146d('0x9c')](_0x586d18['body'][_0x146d('0x5a')])||_0x586d18[_0x146d('0x5a')][_0x146d('0x5a')]===''){throw new db[(_0x146d('0x82'))][(_0x146d('0x83'))](_0x146d('0x9e'));}if(_['isNil'](_0x586d18['body'][_0x146d('0x9f')])){throw new db[(_0x146d('0x82'))][(_0x146d('0x83'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x48c94e);}if(!_[_0x146d('0xa0')](_0x48c94e,_0x586d18[_0x146d('0x5a')][_0x146d('0x9f')])){throw new db[(_0x146d('0x82'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x48c94e);}_0x299e1[_0x586d18['body'][_0x146d('0x9f')]]=_0x586d18['body'][_0x146d('0x91')];return db[_0x146d('0xa1')]['find']({'where':{'id':_0x586d18[_0x146d('0x7e')][_0x146d('0x8b')]},'include':[{'model':db[_0x146d('0xa2')],'as':_0x146d('0xa3'),'where':_0x299e1,'limit':0x1,'order':[[_0x146d('0x88'),'DESC']]}]});})[_0x146d('0x35')](handleEntityNotFound(_0x1df0d3,null))[_0x146d('0x35')](function(_0x236553){if(_0x236553){_0x586d18[_0x146d('0xa4')]=_['omit'](_0x236553,[_0x146d('0xa3')]);if(_0x236553[_0x146d('0xa3')][_0x146d('0x49')]){return _0x236553[_0x146d('0xa3')][0x0];}var _0x3ac716=_[_0x146d('0xa5')](_0x586d18['body'],{'firstName':_0x586d18[_0x146d('0x5a')]['from'],'ListId':_0x236553['id']});_0x3ac716[_0x586d18['body'][_0x146d('0x9f')]]=_0x586d18[_0x146d('0x5a')]['from'];return db[_0x146d('0xa2')][_0x146d('0x59')](_0x3ac716,{'fields':_0x34d9bc,'raw':!![]});}})[_0x146d('0x35')](handleEntityNotFound(_0x1df0d3,null))[_0x146d('0x35')](function(_0xcdae21){if(_0xcdae21){_0x586d18[_0x146d('0xa6')]=_0xcdae21;var _0x57402b={'ContactId':_0xcdae21['id'],'phone':_0x586d18[_0x146d('0x5a')][_0x146d('0x91')],'WhatsappAccountId':_0x347f46[_0x146d('0x55')]['id']};var _0x4abf87={'ContactId':_0xcdae21['id'],'WhatsappAccountId':_0x347f46[_0x146d('0x55')]['id'],'closed':![]};return db[_0x146d('0xa7')][_0x146d('0x58')]({'where':_0x4abf87})['then'](function(_0x3da5f3){if(_0x3da5f3){return[_0x3da5f3,![]];}return db[_0x146d('0xa7')][_0x146d('0x59')](_0x57402b)[_0x146d('0x35')](function(_0x162b2e){return[_0x162b2e,!![]];});});}})[_0x146d('0x6d')](function(_0x515200,_0x2db40c){_0x586d18[_0x146d('0xa8')]=_0x515200[_0x146d('0x5c')]({'plain':!![]});_0x586d18[_0x146d('0xa8')][_0x146d('0xa9')]=![];if(_0x2db40c){if(_0x586d18['account']['autoclose']){_0x586d18[_0x146d('0xaa')][_0x146d('0xab')]({'id':0x0,'priority':_0x586d18[_0x146d('0xaa')][_0x146d('0x49')]+0x1,'app':_0x146d('0xac'),'appdata':_0x146d('0xad'),'interval':_0x146d('0xae')});}_0x586d18[_0x146d('0xa8')][_0x146d('0xa9')]=!![];}return db[_0x146d('0xaf')]['create']({'phone':_0x586d18[_0x146d('0x5a')][_0x146d('0x91')],'messageId':_0x586d18[_0x146d('0x5a')]['messageId'],'body':_0x586d18[_0x146d('0x5a')][_0x146d('0x5a')],'WhatsappAccountId':_0x347f46[_0x146d('0x55')]['id'],'WhatsappInteractionId':_0x515200['id'],'direction':'in','ContactId':_0x515200[_0x146d('0xb0')],'AttachmentId':_0x586d18[_0x146d('0x5a')][_0x146d('0xb1')]});})[_0x146d('0x35')](function(_0x1d7bc8){_0x586d18[_0x146d('0x26')]=_0x1d7bc8;if(_0x586d18[_0x146d('0xa8')]['UserId']){return db[_0x146d('0x74')]['find']({'attributes':['id',_0x146d('0x39')],'where':{'id':_0x586d18['interaction'][_0x146d('0xb2')]}})[_0x146d('0x35')](function(_0x46131b){if(_0x46131b){_0x586d18['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x46131b['name']+','+(_0x586d18[_0x146d('0x7e')][_0x146d('0xb3')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x146d('0xb4'),_0x146d('0xb5'),_0x586d18);});}return respondWithRpcPromise('Start',_0x146d('0xb5'),_0x586d18);})['then'](function(_0x5a8960){if(_0x5a8960){var _0xf9b078=0xc8;var _0x5983d7=_0x146d('0xb6');logger[_0x146d('0x20')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x5983d7,_0xf9b078,_0x146d('0xb7'));logger[_0x146d('0x22')](_0x146d('0xb8'),_0x5983d7,_0xf9b078,'entity\x20found',JSON[_0x146d('0x85')](_0x5a8960));if(_0x586d18[_0x146d('0x7e')][_0x146d('0x40')]===_0x146d('0x90')){return _0x1df0d3[_0x146d('0x29')](_0xf9b078)[_0x146d('0xb9')](_0x146d('0xba'),_0x146d('0xbb'))[_0x146d('0x3a')](_0x146d('0xbc'));}else{return _0x1df0d3['status'](_0xf9b078)[_0x146d('0x2b')](_0x5a8960);}}})[_0x146d('0x27')](handleError(_0x1df0d3,null));};exports[_0x146d('0x3a')]=function(_0xf65f56,_0x260535,_0x26f79f){var _0x3cf248,_0x3286c0,_0x31d8c7;if(_[_0x146d('0x9c')](_0xf65f56[_0x146d('0x5a')]['body'])||_0xf65f56[_0x146d('0x5a')][_0x146d('0x5a')]===''){throw new db[(_0x146d('0x82'))][(_0x146d('0x83'))](_0x146d('0x9e'));}if(_[_0x146d('0x9c')](_0xf65f56[_0x146d('0x5a')]['to'])){throw new db['Sequelize'][(_0x146d('0x83'))](_0x146d('0xbd'));}_0x3cf248=_0xf65f56[_0x146d('0x5a')]['to'];return db[_0x146d('0x3e')][_0x146d('0x58')]({'where':{'id':_0xf65f56[_0x146d('0x55')]['id']},'include':[{'model':db[_0x146d('0xa1')],'as':'List','include':[{'model':db[_0x146d('0xa2')],'as':_0x146d('0xa3'),'where':{'mobile':_0x3cf248},'limit':0x1,'order':[[_0x146d('0x88'),_0x146d('0xbe')]]}]}]})[_0x146d('0x35')](handleEntityNotFound(_0x260535,null))[_0x146d('0x35')](function(_0x37267e){if(_0x37267e&&_0x37267e[_0x146d('0xbf')]){_0x3286c0=_0x37267e[_0x146d('0x5c')]({'plain':!![]});if(_0x3286c0[_0x146d('0xbf')]&&_0x3286c0[_0x146d('0xbf')][_0x146d('0xa3')][_0x146d('0x49')]){return _0x3286c0[_0x146d('0xbf')]['Contacts'][0x0];}return db['CmContact'][_0x146d('0x59')](_[_0x146d('0xa5')](_0xf65f56['body'],{'firstName':_0x3cf248,'mobile':_0x3cf248,'phone':_0x3cf248,'ListId':_0x3286c0[_0x146d('0x8b')]}));}})['then'](handleEntityNotFound(_0x260535,null))['then'](function(_0x49a259){if(_0x49a259){_0x31d8c7=_0x49a259;return db['WhatsappInteraction'][_0x146d('0x58')]({'where':{'ContactId':_0x31d8c7['id'],'closed':![],'WhatsappAccountId':_0x3286c0['id']}})[_0x146d('0x35')](function(_0x246d55){if(_0x246d55){return[_0x246d55,![]];}return db[_0x146d('0xa7')][_0x146d('0x59')]({'UserId':_0xf65f56[_0x146d('0x5b')]['id'],'ContactId':_0x31d8c7['id'],'WhatsappAccountId':_0x3286c0['id'],'phone':_0x3cf248,'firstMsgDirection':'out','Messages':[_[_0x146d('0x4f')](_0xf65f56[_0x146d('0x5a')],{'read':![],'body':_0xf65f56[_0x146d('0x5a')][_0x146d('0x5a')],'phone':_0x3cf248,'WhatsappAccountId':_0x3286c0['id'],'UserId':_0xf65f56[_0x146d('0x5b')]['id'],'ContactId':_0x31d8c7['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x146d('0xc0')}]})[_0x146d('0x35')](function(_0x55ed78){return[_0x55ed78,!![]];});});}})[_0x146d('0x6d')](function(_0x2b1e2a,_0x419773){if(_0x419773){return _0x2b1e2a;}return db[_0x146d('0xaf')][_0x146d('0x59')](_['merge'](_0xf65f56['body'],{'read':![],'body':_0xf65f56[_0x146d('0x5a')][_0x146d('0x5a')],'phone':_0x3cf248,'WhatsappAccountId':_0x3286c0['id'],'WhatsappInteractionId':_0x2b1e2a['id'],'UserId':_0xf65f56[_0x146d('0x5b')]['id'],'ContactId':_0x31d8c7['id']}))[_0x146d('0x35')](function(_0x451e32){_0x2b1e2a[_0x146d('0xc1')]['Messages']=[];_0x2b1e2a['dataValues'][_0x146d('0xc0')]['push'](_0x451e32[_0x146d('0xc1')]);return _0x2b1e2a;});})[_0x146d('0x35')](respondWithResult(_0x260535,null))['catch'](handleError(_0x260535,null));};
\ No newline at end of file
index 74ffea2..bc393a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb1a4=['remove','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save'];(function(_0x163c28,_0xcb1fc5){var _0x389bd8=function(_0x4e9c4f){while(--_0x4e9c4f){_0x163c28['push'](_0x163c28['shift']());}};_0x389bd8(++_0xcb1fc5);}(_0xb1a4,0x100));var _0x4b1a=function(_0x48d216,_0x243ddc){_0x48d216=_0x48d216-0x0;var _0x7c0220=_0xb1a4[_0x48d216];return _0x7c0220;};'use strict';var EventEmitter=require(_0x4b1a('0x0'));var WhatsappAccount=require(_0x4b1a('0x1'))['db'][_0x4b1a('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x4b1a('0x3')](0x0);var events={'afterCreate':_0x4b1a('0x4'),'afterUpdate':'update','afterDestroy':_0x4b1a('0x5')};function emitEvent(_0x4e13cb){return function(_0x40e116,_0x59e685,_0x21af20){WhatsappAccountEvents['emit'](_0x4e13cb+':'+_0x40e116['id'],_0x40e116);WhatsappAccountEvents['emit'](_0x4e13cb,_0x40e116);_0x21af20(null);};}for(var e in events){if(events[_0x4b1a('0x6')](e)){var event=events[e];WhatsappAccount[_0x4b1a('0x7')](e,emitEvent(event));}}module[_0x4b1a('0x8')]=WhatsappAccountEvents;
\ No newline at end of file
+var _0xb988=['hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','remove','hasOwnProperty'];(function(_0x39599d,_0x22c633){var _0x4f9718=function(_0x5e5baa){while(--_0x5e5baa){_0x39599d['push'](_0x39599d['shift']());}};_0x4f9718(++_0x22c633);}(_0xb988,0x122));var _0x8b98=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xb988[_0x47a7d0];return _0xb9bd08;};'use strict';var EventEmitter=require(_0x8b98('0x0'));var WhatsappAccount=require(_0x8b98('0x1'))['db'][_0x8b98('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x8b98('0x3')](0x0);var events={'afterCreate':_0x8b98('0x4'),'afterUpdate':'update','afterDestroy':_0x8b98('0x5')};function emitEvent(_0x1230c4){return function(_0x2fcfd9,_0x58de06,_0x315c5a){WhatsappAccountEvents['emit'](_0x1230c4+':'+_0x2fcfd9['id'],_0x2fcfd9);WhatsappAccountEvents['emit'](_0x1230c4,_0x2fcfd9);_0x315c5a(null);};}for(var e in events){if(events[_0x8b98('0x6')](e)){var event=events[e];WhatsappAccount[_0x8b98('0x7')](e,emitEvent(event));}}module[_0x8b98('0x8')]=WhatsappAccountEvents;
\ No newline at end of file
index 908864a..29644bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b7c=['path','rimraf','../../config/environment','./whatsappAccount.attributes','define','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x13ca0e,_0x4d5e47){var _0x5c139a=function(_0x3d0250){while(--_0x3d0250){_0x13ca0e['push'](_0x13ca0e['shift']());}};_0x5c139a(++_0x4d5e47);}(_0x4b7c,0xec));var _0xc4b7=function(_0x3334c7,_0x4eb5ea){_0x3334c7=_0x3334c7-0x0;var _0xaec36e=_0x4b7c[_0x3334c7];return _0xaec36e;};'use strict';var _=require(_0xc4b7('0x0'));var util=require(_0xc4b7('0x1'));var logger=require(_0xc4b7('0x2'))(_0xc4b7('0x3'));var moment=require('moment');var BPromise=require(_0xc4b7('0x4'));var rp=require(_0xc4b7('0x5'));var fs=require('fs');var path=require(_0xc4b7('0x6'));var rimraf=require(_0xc4b7('0x7'));var config=require(_0xc4b7('0x8'));var attributes=require(_0xc4b7('0x9'));module['exports']=function(_0x1c58da,_0x83fecf){return _0x1c58da[_0xc4b7('0xa')]('WhatsappAccount',attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb1f1=['./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0xac1397,_0x18f04c){var _0x50a478=function(_0x436649){while(--_0x436649){_0xac1397['push'](_0xac1397['shift']());}};_0x50a478(++_0x18f04c);}(_0xb1f1,0x116));var _0x1b1f=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xb1f1[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x1b1f('0x0'));var util=require('util');var logger=require(_0x1b1f('0x1'))(_0x1b1f('0x2'));var moment=require(_0x1b1f('0x3'));var BPromise=require(_0x1b1f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b1f('0x5'));var rimraf=require(_0x1b1f('0x6'));var config=require(_0x1b1f('0x7'));var attributes=require(_0x1b1f('0x8'));module[_0x1b1f('0x9')]=function(_0x304c82,_0x52e5d2){return _0x304c82[_0x1b1f('0xa')](_0x1b1f('0xb'),attributes,{'tableName':_0x1b1f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 488bbb9..35e4a69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38e2=['WhatsappAccount,\x20%s,\x20%s','message','result','catch','ShowWhatsappAccount','find','options','raw','where','include','model','map','attributes','then','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','defaults','redis','localhost','./whatsappAccount.socket','register','request','info','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xe78202,_0x200dd0){var _0xd44ff5=function(_0x33936b){while(--_0x33936b){_0xe78202['push'](_0xe78202['shift']());}};_0xd44ff5(++_0x200dd0);}(_0x38e2,0x1c8));var _0x238e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x38e2[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x238e('0x0'));var util=require('util');var moment=require(_0x238e('0x1'));var BPromise=require(_0x238e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x238e('0x3'))['db'];var utils=require(_0x238e('0x4'));var logger=require('../../config/logger')(_0x238e('0x5'));var config=require(_0x238e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x238e('0x7')]['http']({'port':0x232a});config['redis']=_[_0x238e('0x8')](config[_0x238e('0x9')],{'host':_0x238e('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x238e('0x9')]));require(_0x238e('0xb'))[_0x238e('0xc')](socket);function respondWithRpcPromise(_0x5392f2,_0x4992bd,_0x2509ff){return new BPromise(function(_0x4c1d26,_0x481089){return client[_0x238e('0xd')](_0x5392f2,_0x2509ff)['then'](function(_0x2bf49d){logger[_0x238e('0xe')]('WhatsappAccount,\x20%s,\x20%s',_0x4992bd,_0x238e('0xf'));logger['debug'](_0x238e('0x10'),_0x4992bd,_0x238e('0xf'),JSON[_0x238e('0x11')](_0x2bf49d));if(_0x2bf49d['error']){if(_0x2bf49d[_0x238e('0x12')][_0x238e('0x13')]===0x1f4){logger['error'](_0x238e('0x14'),_0x4992bd,_0x2bf49d[_0x238e('0x12')][_0x238e('0x15')]);return _0x481089(_0x2bf49d[_0x238e('0x12')][_0x238e('0x15')]);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x4992bd,_0x2bf49d['error'][_0x238e('0x15')]);return _0x4c1d26(_0x2bf49d[_0x238e('0x12')][_0x238e('0x15')]);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x4992bd,_0x238e('0xf'));_0x4c1d26(_0x2bf49d[_0x238e('0x16')][_0x238e('0x15')]);}})[_0x238e('0x17')](function(_0x4f5cf3){logger['error'](_0x238e('0x14'),_0x4992bd,_0x4f5cf3);_0x481089(_0x4f5cf3);});});}exports[_0x238e('0x18')]=function(_0x40a682){var _0x4929ef=this;return new Promise(function(_0x23de0e,_0x1ebfac){return db['WhatsappAccount'][_0x238e('0x19')]({'raw':_0x40a682[_0x238e('0x1a')]?_0x40a682[_0x238e('0x1a')][_0x238e('0x1b')]===undefined?!![]:![]:!![],'where':_0x40a682[_0x238e('0x1a')]?_0x40a682['options'][_0x238e('0x1c')]||null:null,'attributes':_0x40a682['options']?_0x40a682[_0x238e('0x1a')]['attributes']||null:null,'include':_0x40a682[_0x238e('0x1a')]?_0x40a682['options']['include']?_['map'](_0x40a682[_0x238e('0x1a')][_0x238e('0x1d')],function(_0xa869ae){return{'model':db[_0xa869ae[_0x238e('0x1e')]],'as':_0xa869ae['as'],'attributes':_0xa869ae['attributes'],'include':_0xa869ae[_0x238e('0x1d')]?_[_0x238e('0x1f')](_0xa869ae[_0x238e('0x1d')],function(_0x1676ea){return{'model':db[_0x1676ea['model']],'as':_0x1676ea['as'],'attributes':_0x1676ea[_0x238e('0x20')],'include':_0x1676ea[_0x238e('0x1d')]?_[_0x238e('0x1f')](_0x1676ea['include'],function(_0x3bcc6e){return{'model':db[_0x3bcc6e[_0x238e('0x1e')]],'as':_0x3bcc6e['as'],'attributes':_0x3bcc6e[_0x238e('0x20')]};}):[]};}):[]};}):[]:[]})[_0x238e('0x21')](function(_0x49e162){logger['info'](_0x238e('0x18'),_0x40a682);logger['debug'](_0x238e('0x18'),_0x40a682,JSON[_0x238e('0x11')](_0x49e162));_0x23de0e(_0x49e162);})[_0x238e('0x17')](function(_0x16c0c0){logger['error']('ShowWhatsappAccount',_0x16c0c0[_0x238e('0x15')],_0x40a682);_0x1ebfac(_0x4929ef[_0x238e('0x12')](0x1f4,_0x16c0c0['message']));});});};
\ No newline at end of file
+var _0xfd46=['info','result','ShowWhatsappAccount','find','options','where','include','model','attributes','map','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','socket.io-emitter','./whatsappAccount.socket','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x567a1b,_0x980681){var _0x2d4e28=function(_0x2f7d4c){while(--_0x2f7d4c){_0x567a1b['push'](_0x567a1b['shift']());}};_0x2d4e28(++_0x980681);}(_0xfd46,0x176));var _0x6fd4=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xfd46[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x6fd4('0x0'));var util=require('util');var moment=require(_0x6fd4('0x1'));var BPromise=require(_0x6fd4('0x2'));var rs=require(_0x6fd4('0x3'));var fs=require('fs');var Redis=require(_0x6fd4('0x4'));var db=require(_0x6fd4('0x5'))['db'];var utils=require(_0x6fd4('0x6'));var logger=require(_0x6fd4('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6fd4('0x8')][_0x6fd4('0x9')]({'port':0x232a});config[_0x6fd4('0xa')]=_['defaults'](config[_0x6fd4('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x6fd4('0xb'))(new Redis(config[_0x6fd4('0xa')]));require(_0x6fd4('0xc'))['register'](socket);function respondWithRpcPromise(_0x74a488,_0x6e9869,_0xe19865){return new BPromise(function(_0x1986f6,_0x3fd131){return client['request'](_0x74a488,_0xe19865)[_0x6fd4('0xd')](function(_0x31d5bb){logger['info'](_0x6fd4('0xe'),_0x6e9869,_0x6fd4('0xf'));logger[_0x6fd4('0x10')](_0x6fd4('0x11'),_0x6e9869,_0x6fd4('0xf'),JSON[_0x6fd4('0x12')](_0x31d5bb));if(_0x31d5bb[_0x6fd4('0x13')]){if(_0x31d5bb[_0x6fd4('0x13')][_0x6fd4('0x14')]===0x1f4){logger[_0x6fd4('0x13')](_0x6fd4('0xe'),_0x6e9869,_0x31d5bb['error']['message']);return _0x3fd131(_0x31d5bb[_0x6fd4('0x13')][_0x6fd4('0x15')]);}logger[_0x6fd4('0x13')](_0x6fd4('0xe'),_0x6e9869,_0x31d5bb[_0x6fd4('0x13')][_0x6fd4('0x15')]);return _0x1986f6(_0x31d5bb[_0x6fd4('0x13')][_0x6fd4('0x15')]);}else{logger[_0x6fd4('0x16')](_0x6fd4('0xe'),_0x6e9869,'request\x20sent');_0x1986f6(_0x31d5bb[_0x6fd4('0x17')][_0x6fd4('0x15')]);}})['catch'](function(_0x5ada7c){logger['error'](_0x6fd4('0xe'),_0x6e9869,_0x5ada7c);_0x3fd131(_0x5ada7c);});});}exports[_0x6fd4('0x18')]=function(_0x3437cb){var _0x5d2945=this;return new Promise(function(_0x51982e,_0x3d2afc){return db['WhatsappAccount'][_0x6fd4('0x19')]({'raw':_0x3437cb['options']?_0x3437cb[_0x6fd4('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3437cb[_0x6fd4('0x1a')]?_0x3437cb[_0x6fd4('0x1a')][_0x6fd4('0x1b')]||null:null,'attributes':_0x3437cb[_0x6fd4('0x1a')]?_0x3437cb[_0x6fd4('0x1a')]['attributes']||null:null,'include':_0x3437cb['options']?_0x3437cb[_0x6fd4('0x1a')]['include']?_['map'](_0x3437cb['options'][_0x6fd4('0x1c')],function(_0x5d8875){return{'model':db[_0x5d8875[_0x6fd4('0x1d')]],'as':_0x5d8875['as'],'attributes':_0x5d8875[_0x6fd4('0x1e')],'include':_0x5d8875[_0x6fd4('0x1c')]?_[_0x6fd4('0x1f')](_0x5d8875[_0x6fd4('0x1c')],function(_0x2edfc1){return{'model':db[_0x2edfc1[_0x6fd4('0x1d')]],'as':_0x2edfc1['as'],'attributes':_0x2edfc1[_0x6fd4('0x1e')],'include':_0x2edfc1[_0x6fd4('0x1c')]?_[_0x6fd4('0x1f')](_0x2edfc1[_0x6fd4('0x1c')],function(_0x39762f){return{'model':db[_0x39762f['model']],'as':_0x39762f['as'],'attributes':_0x39762f[_0x6fd4('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x26fb48){logger[_0x6fd4('0x16')]('ShowWhatsappAccount',_0x3437cb);logger[_0x6fd4('0x10')](_0x6fd4('0x18'),_0x3437cb,JSON[_0x6fd4('0x12')](_0x26fb48));_0x51982e(_0x26fb48);})[_0x6fd4('0x20')](function(_0x3cf724){logger['error'](_0x6fd4('0x18'),_0x3cf724['message'],_0x3437cb);_0x3d2afc(_0x5d2945['error'](0x1f4,_0x3cf724[_0x6fd4('0x15')]));});});};
\ No newline at end of file
index 57a69d8..8ffd68b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7d3=['./whatsappAccount.events','remove','update','emit','removeListener','length','whatsappAccount:'];(function(_0xe44f8d,_0x34b84d){var _0x1e84b5=function(_0x5b6ae3){while(--_0x5b6ae3){_0xe44f8d['push'](_0xe44f8d['shift']());}};_0x1e84b5(++_0x34b84d);}(_0xc7d3,0xe0));var _0x3c7d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7d3[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappAccountEvents=require(_0x3c7d('0x0'));var events=['save',_0x3c7d('0x1'),_0x3c7d('0x2')];function createListener(_0x4c2977,_0x223d53){return function(_0x46cf51){_0x223d53[_0x3c7d('0x3')](_0x4c2977,_0x46cf51);};}function removeListener(_0x24c22d,_0x42d357){return function(){WhatsappAccountEvents[_0x3c7d('0x4')](_0x24c22d,_0x42d357);};}exports['register']=function(_0x36f072){for(var _0x5dfacf=0x0,_0x54fb60=events[_0x3c7d('0x5')];_0x5dfacf<_0x54fb60;_0x5dfacf++){var _0x291ba6=events[_0x5dfacf];var _0x49ae39=createListener(_0x3c7d('0x6')+_0x291ba6,_0x36f072);WhatsappAccountEvents['on'](_0x291ba6,_0x49ae39);}};
\ No newline at end of file
+var _0xaac7=['save','remove','update','emit','removeListener','register','length','whatsappAccount:','./whatsappAccount.events'];(function(_0x5c9f27,_0x5aad7f){var _0x25a77c=function(_0x37cd96){while(--_0x37cd96){_0x5c9f27['push'](_0x5c9f27['shift']());}};_0x25a77c(++_0x5aad7f);}(_0xaac7,0xb3));var _0x7aac=function(_0x16771d,_0x224c60){_0x16771d=_0x16771d-0x0;var _0x386f11=_0xaac7[_0x16771d];return _0x386f11;};'use strict';var WhatsappAccountEvents=require(_0x7aac('0x0'));var events=[_0x7aac('0x1'),_0x7aac('0x2'),_0x7aac('0x3')];function createListener(_0x5c0d0d,_0x90b4b1){return function(_0x285a45){_0x90b4b1[_0x7aac('0x4')](_0x5c0d0d,_0x285a45);};}function removeListener(_0xb1ae9f,_0xf6950f){return function(){WhatsappAccountEvents[_0x7aac('0x5')](_0xb1ae9f,_0xf6950f);};}exports[_0x7aac('0x6')]=function(_0x5ccd52){for(var _0x5ef84f=0x0,_0x21d016=events[_0x7aac('0x7')];_0x5ef84f<_0x21d016;_0x5ef84f++){var _0xf88585=events[_0x5ef84f];var _0x109823=createListener(_0x7aac('0x8')+_0xf88585,_0x5ccd52);WhatsappAccountEvents['on'](_0xf88585,_0x109823);}};
\ No newline at end of file
index 7d3d726..98663ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe777=['Router','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','show','create','put','/:id','update','destroy','multer','util','path','connect-timeout'];(function(_0x1f6c34,_0x1315d4){var _0x4eb227=function(_0x17433f){while(--_0x17433f){_0x1f6c34['push'](_0x1f6c34['shift']());}};_0x4eb227(++_0x1315d4);}(_0xe777,0x11c));var _0x7e77=function(_0x3a20c4,_0x2b79c3){_0x3a20c4=_0x3a20c4-0x0;var _0x3ea33c=_0xe777[_0x3a20c4];return _0x3ea33c;};'use strict';var multer=require(_0x7e77('0x0'));var util=require(_0x7e77('0x1'));var path=require(_0x7e77('0x2'));var timeout=require(_0x7e77('0x3'));var express=require('express');var router=express[_0x7e77('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7e77('0x5'));var config=require(_0x7e77('0x6'));var controller=require(_0x7e77('0x7'));router[_0x7e77('0x8')]('/',auth[_0x7e77('0x9')](),controller['index']);router[_0x7e77('0x8')]('/:id',auth[_0x7e77('0x9')](),controller[_0x7e77('0xa')]);router['post']('/',auth[_0x7e77('0x9')](),controller[_0x7e77('0xb')]);router[_0x7e77('0xc')](_0x7e77('0xd'),auth[_0x7e77('0x9')](),controller[_0x7e77('0xe')]);router['delete'](_0x7e77('0xd'),auth['isAuthenticated'](),controller[_0x7e77('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xb87d=['path','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','create','put','update','delete','destroy','exports','multer','util'];(function(_0x276d28,_0x299e2a){var _0x547829=function(_0x5f1569){while(--_0x5f1569){_0x276d28['push'](_0x276d28['shift']());}};_0x547829(++_0x299e2a);}(_0xb87d,0x1ae));var _0xdb87=function(_0xc2103,_0x2d4743){_0xc2103=_0xc2103-0x0;var _0x37357b=_0xb87d[_0xc2103];return _0x37357b;};'use strict';var multer=require(_0xdb87('0x0'));var util=require(_0xdb87('0x1'));var path=require(_0xdb87('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdb87('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdb87('0x4'));var config=require(_0xdb87('0x5'));var controller=require('./whatsappApplication.controller');router['get']('/',auth[_0xdb87('0x6')](),controller[_0xdb87('0x7')]);router[_0xdb87('0x8')](_0xdb87('0x9'),auth[_0xdb87('0x6')](),controller['show']);router['post']('/',auth[_0xdb87('0x6')](),controller[_0xdb87('0xa')]);router[_0xdb87('0xb')]('/:id',auth[_0xdb87('0x6')](),controller[_0xdb87('0xc')]);router[_0xdb87('0xd')](_0xdb87('0x9'),auth[_0xdb87('0x6')](),controller[_0xdb87('0xe')]);module[_0xdb87('0xf')]=router;
\ No newline at end of file
index 70f05dc..fe50a26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5909=['INTEGER','STRING','sequelize','exports'];(function(_0x36a046,_0x3e04af){var _0x4dacb4=function(_0x4b1f64){while(--_0x4b1f64){_0x36a046['push'](_0x36a046['shift']());}};_0x4dacb4(++_0x3e04af);}(_0x5909,0xfa));var _0x9590=function(_0x5774be,_0x2259d3){_0x5774be=_0x5774be-0x0;var _0x4914b4=_0x5909[_0x5774be];return _0x4914b4;};'use strict';var Sequelize=require(_0x9590('0x0'));module[_0x9590('0x1')]={'priority':{'type':Sequelize[_0x9590('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x9590('0x3')]},'interval':{'type':Sequelize[_0x9590('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xa248=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x9678e2,_0x391d32){var _0x43687c=function(_0x42c139){while(--_0x42c139){_0x9678e2['push'](_0x9678e2['shift']());}};_0x43687c(++_0x391d32);}(_0xa248,0x1c7));var _0x8a24=function(_0x203b5a,_0x6f6896){_0x203b5a=_0x203b5a-0x0;var _0x4f8caa=_0xa248[_0x203b5a];return _0x4f8caa;};'use strict';var Sequelize=require(_0x8a24('0x0'));module[_0x8a24('0x1')]={'priority':{'type':Sequelize[_0x8a24('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x8a24('0x3')],'allowNull':![],'defaultValue':_0x8a24('0x4')},'appdata':{'type':Sequelize[_0x8a24('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x8a24('0x3')],'defaultValue':_0x8a24('0x6')}};
\ No newline at end of file
index fe3a474..fa65c7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8cda=['set','Content-Range','json','reject','save','destroy','then','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','VIRTUAL','options','includeAll','rows','include','find','create','body','catch','update','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','status','undefined','limit','count'];(function(_0x6ed4a5,_0xeee9c0){var _0x44d54f=function(_0x477afe){while(--_0x477afe){_0x6ed4a5['push'](_0x6ed4a5['shift']());}};_0x44d54f(++_0xeee9c0);}(_0x8cda,0x1db));var _0xa8cd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8cda[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa8cd('0x0'));var zipdir=require(_0xa8cd('0x1'));var jsonpatch=require(_0xa8cd('0x2'));var rp=require(_0xa8cd('0x3'));var moment=require(_0xa8cd('0x4'));var BPromise=require(_0xa8cd('0x5'));var Mustache=require('mustache');var util=require(_0xa8cd('0x6'));var path=require(_0xa8cd('0x7'));var sox=require(_0xa8cd('0x8'));var csv=require('to-csv');var ejs=require(_0xa8cd('0x9'));var fs=require('fs');var fs_extra=require(_0xa8cd('0xa'));var _=require(_0xa8cd('0xb'));var squel=require(_0xa8cd('0xc'));var crypto=require(_0xa8cd('0xd'));var jsforce=require(_0xa8cd('0xe'));var deskjs=require(_0xa8cd('0xf'));var toCsv=require(_0xa8cd('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa8cd('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa8cd('0x12'));var hardwareService=require(_0xa8cd('0x13'));var logger=require('../../config/logger')(_0xa8cd('0x14'));var utils=require(_0xa8cd('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa8cd('0x16'))['db'];function respondWithStatusCode(_0xa2b804,_0x19ba69){_0x19ba69=_0x19ba69||0xcc;return function(_0xefdff9){if(_0xefdff9){return _0xa2b804[_0xa8cd('0x17')](_0x19ba69);}return _0xa2b804['status'](_0x19ba69)[_0xa8cd('0x18')]();};}function respondWithResult(_0x51d29e,_0x16f366){_0x16f366=_0x16f366||0xc8;return function(_0x5ccd85){if(_0x5ccd85){return _0x51d29e[_0xa8cd('0x19')](_0x16f366)['json'](_0x5ccd85);}};}function respondWithFilteredResult(_0x1970c1,_0x4f244b){return function(_0x9fe9b0){if(_0x9fe9b0){var _0x5bfc4c=typeof _0x4f244b['offset']===_0xa8cd('0x1a')&&typeof _0x4f244b[_0xa8cd('0x1b')]===_0xa8cd('0x1a');var _0x177ca2=_0x9fe9b0['count'];var _0x128a90=_0x5bfc4c?0x0:_0x4f244b['offset'];var _0x1cacd5=_0x5bfc4c?_0x9fe9b0[_0xa8cd('0x1c')]:_0x4f244b['offset']+_0x4f244b[_0xa8cd('0x1b')];var _0x1260e5;if(_0x1cacd5>=_0x177ca2){_0x1cacd5=_0x177ca2;_0x1260e5=0xc8;}else{_0x1260e5=0xce;}_0x1970c1['status'](_0x1260e5);return _0x1970c1[_0xa8cd('0x1d')](_0xa8cd('0x1e'),_0x128a90+'-'+_0x1cacd5+'/'+_0x177ca2)[_0xa8cd('0x1f')](_0x9fe9b0);}return null;};}function patchUpdates(_0x289cb6){return function(_0x420505){try{jsonpatch['apply'](_0x420505,_0x289cb6,!![]);}catch(_0xdd4de1){return BPromise[_0xa8cd('0x20')](_0xdd4de1);}return _0x420505[_0xa8cd('0x21')]();};}function saveUpdates(_0x447d7f,_0x4f4093){return function(_0x1f15c0){if(_0x1f15c0){return _0x1f15c0['update'](_0x447d7f)['then'](function(_0x28574f){return _0x28574f;});}return null;};}function removeEntity(_0x70b17a,_0x4ec3cc){return function(_0x1c7b31){if(_0x1c7b31){return _0x1c7b31[_0xa8cd('0x22')]()[_0xa8cd('0x23')](function(){_0x70b17a[_0xa8cd('0x19')](0xcc)[_0xa8cd('0x18')]();});}};}function handleEntityNotFound(_0x2d1ef5,_0x1f369d){return function(_0x4a5221){if(!_0x4a5221){_0x2d1ef5[_0xa8cd('0x17')](0x194);}return _0x4a5221;};}function handleError(_0x42ae30,_0x3c4c22){_0x3c4c22=_0x3c4c22||0x1f4;return function(_0x393e5a){logger[_0xa8cd('0x24')](_0x393e5a[_0xa8cd('0x25')]);if(_0x393e5a['name']){delete _0x393e5a[_0xa8cd('0x26')];}_0x42ae30[_0xa8cd('0x19')](_0x3c4c22)[_0xa8cd('0x27')](_0x393e5a);};}exports[_0xa8cd('0x28')]=function(_0xe973cb,_0x2241f8){var _0x3285d8={},_0x3e1770={},_0x2a99e6={'count':0x0,'rows':[]};var _0x22cf82=_[_0xa8cd('0x29')](db[_0xa8cd('0x2a')][_0xa8cd('0x2b')],function(_0x44ea2f){return{'name':_0x44ea2f[_0xa8cd('0x2c')],'type':_0x44ea2f[_0xa8cd('0x2d')]['key']};});_0x3e1770['model']=_['map'](_0x22cf82,_0xa8cd('0x26'));_0x3e1770[_0xa8cd('0x2e')]=_[_0xa8cd('0x2f')](_0xe973cb[_0xa8cd('0x2e')]);_0x3e1770[_0xa8cd('0x30')]=_[_0xa8cd('0x31')](_0x3e1770['model'],_0x3e1770['query']);_0x3285d8['attributes']=_[_0xa8cd('0x31')](_0x3e1770[_0xa8cd('0x32')],qs[_0xa8cd('0x33')](_0xe973cb[_0xa8cd('0x2e')][_0xa8cd('0x33')]));_0x3285d8[_0xa8cd('0x34')]=_0x3285d8[_0xa8cd('0x34')]['length']?_0x3285d8[_0xa8cd('0x34')]:_0x3e1770[_0xa8cd('0x32')];if(!_0xe973cb['query'][_0xa8cd('0x35')](_0xa8cd('0x36'))){_0x3285d8[_0xa8cd('0x1b')]=qs[_0xa8cd('0x1b')](_0xe973cb['query'][_0xa8cd('0x1b')]);_0x3285d8[_0xa8cd('0x37')]=qs['offset'](_0xe973cb[_0xa8cd('0x2e')][_0xa8cd('0x37')]);}_0x3285d8[_0xa8cd('0x38')]=qs[_0xa8cd('0x39')](_0xe973cb['query']['sort']);_0x3285d8[_0xa8cd('0x3a')]=qs['filters'](_[_0xa8cd('0x3b')](_0xe973cb['query'],_0x3e1770[_0xa8cd('0x30')]),_0x22cf82);if(_0xe973cb[_0xa8cd('0x2e')]['filter']){_0x3285d8[_0xa8cd('0x3a')]=_[_0xa8cd('0x3c')](_0x3285d8[_0xa8cd('0x3a')],{'$or':_[_0xa8cd('0x29')](_0x22cf82,function(_0x451ba8){if(_0x451ba8[_0xa8cd('0x2d')]!==_0xa8cd('0x3d')){var _0x5100d5={};_0x5100d5[_0x451ba8[_0xa8cd('0x26')]]={'$like':'%'+_0xe973cb[_0xa8cd('0x2e')]['filter']+'%'};return _0x5100d5;}})});}_0x3285d8=_['merge']({},_0x3285d8,_0xe973cb[_0xa8cd('0x3e')]);var _0x3da42e={'where':_0x3285d8[_0xa8cd('0x3a')]};return db[_0xa8cd('0x2a')][_0xa8cd('0x1c')](_0x3da42e)[_0xa8cd('0x23')](function(_0x40cd4e){_0x2a99e6[_0xa8cd('0x1c')]=_0x40cd4e;if(_0xe973cb['query'][_0xa8cd('0x3f')]){_0x3285d8['include']=[{'all':!![]}];}return db[_0xa8cd('0x2a')]['findAll'](_0x3285d8);})[_0xa8cd('0x23')](function(_0x27a64c){_0x2a99e6[_0xa8cd('0x40')]=_0x27a64c;return _0x2a99e6;})[_0xa8cd('0x23')](respondWithFilteredResult(_0x2241f8,_0x3285d8))['catch'](handleError(_0x2241f8,null));};exports['show']=function(_0x5067d3,_0x5e8a6c){var _0x1b9f17={'raw':!![],'where':{'id':_0x5067d3['params']['id']}},_0x40c80d={};_0x40c80d[_0xa8cd('0x32')]=_[_0xa8cd('0x2f')](db[_0xa8cd('0x2a')][_0xa8cd('0x2b')]);_0x40c80d[_0xa8cd('0x2e')]=_[_0xa8cd('0x2f')](_0x5067d3['query']);_0x40c80d['filters']=_[_0xa8cd('0x31')](_0x40c80d[_0xa8cd('0x32')],_0x40c80d[_0xa8cd('0x2e')]);_0x1b9f17[_0xa8cd('0x34')]=_['intersection'](_0x40c80d[_0xa8cd('0x32')],qs[_0xa8cd('0x33')](_0x5067d3[_0xa8cd('0x2e')][_0xa8cd('0x33')]));_0x1b9f17['attributes']=_0x1b9f17['attributes']['length']?_0x1b9f17[_0xa8cd('0x34')]:_0x40c80d[_0xa8cd('0x32')];if(_0x5067d3['query'][_0xa8cd('0x3f')]){_0x1b9f17[_0xa8cd('0x41')]=[{'all':!![]}];}_0x1b9f17=_[_0xa8cd('0x3c')]({},_0x1b9f17,_0x5067d3[_0xa8cd('0x3e')]);return db[_0xa8cd('0x2a')][_0xa8cd('0x42')](_0x1b9f17)['then'](handleEntityNotFound(_0x5e8a6c,null))['then'](respondWithResult(_0x5e8a6c,null))['catch'](handleError(_0x5e8a6c,null));};exports[_0xa8cd('0x43')]=function(_0x2f3d01,_0x97f52a){return db[_0xa8cd('0x2a')][_0xa8cd('0x43')](_0x2f3d01[_0xa8cd('0x44')],{})[_0xa8cd('0x23')](respondWithResult(_0x97f52a,0xc9))[_0xa8cd('0x45')](handleError(_0x97f52a,null));};exports[_0xa8cd('0x46')]=function(_0x534f5a,_0x5429e8){if(_0x534f5a[_0xa8cd('0x44')]['id']){delete _0x534f5a['body']['id'];}return db[_0xa8cd('0x2a')][_0xa8cd('0x42')]({'where':{'id':_0x534f5a[_0xa8cd('0x47')]['id']}})[_0xa8cd('0x23')](handleEntityNotFound(_0x5429e8,null))[_0xa8cd('0x23')](saveUpdates(_0x534f5a['body'],null))[_0xa8cd('0x23')](respondWithResult(_0x5429e8,null))['catch'](handleError(_0x5429e8,null));};exports[_0xa8cd('0x22')]=function(_0x9dd1a3,_0x2114f2){return db[_0xa8cd('0x2a')][_0xa8cd('0x42')]({'where':{'id':_0x9dd1a3[_0xa8cd('0x47')]['id']}})[_0xa8cd('0x23')](handleEntityNotFound(_0x2114f2,null))[_0xa8cd('0x23')](removeEntity(_0x2114f2,null))[_0xa8cd('0x45')](handleError(_0x2114f2,null));};
\ No newline at end of file
+var _0x3f2e=['rows','catch','show','params','keys','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','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','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','error','name','send','index','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','WhatsappApplication','findAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3f2e,0x9d));var _0xe3f2=function(_0x1cab41,_0x4bfa57){_0x1cab41=_0x1cab41-0x0;var _0x511deb=_0x3f2e[_0x1cab41];return _0x511deb;};'use strict';var emlformat=require(_0xe3f2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe3f2('0x1'));var jsonpatch=require(_0xe3f2('0x2'));var rp=require(_0xe3f2('0x3'));var moment=require(_0xe3f2('0x4'));var BPromise=require(_0xe3f2('0x5'));var Mustache=require(_0xe3f2('0x6'));var util=require(_0xe3f2('0x7'));var path=require('path');var sox=require(_0xe3f2('0x8'));var csv=require('to-csv');var ejs=require(_0xe3f2('0x9'));var fs=require('fs');var fs_extra=require(_0xe3f2('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe3f2('0xb'));var deskjs=require(_0xe3f2('0xc'));var toCsv=require(_0xe3f2('0xd'));var querystring=require(_0xe3f2('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe3f2('0xf'));var qs=require(_0xe3f2('0x10'));var as=require(_0xe3f2('0x11'));var hardwareService=require(_0xe3f2('0x12'));var logger=require(_0xe3f2('0x13'))(_0xe3f2('0x14'));var utils=require(_0xe3f2('0x15'));var config=require(_0xe3f2('0x16'));var licenseUtil=require(_0xe3f2('0x17'));var db=require(_0xe3f2('0x18'))['db'];function respondWithStatusCode(_0x18a7c0,_0x154ab4){_0x154ab4=_0x154ab4||0xcc;return function(_0x17e274){if(_0x17e274){return _0x18a7c0['sendStatus'](_0x154ab4);}return _0x18a7c0[_0xe3f2('0x19')](_0x154ab4)[_0xe3f2('0x1a')]();};}function respondWithResult(_0x1cf1d9,_0x4fc6a2){_0x4fc6a2=_0x4fc6a2||0xc8;return function(_0x5492e7){if(_0x5492e7){return _0x1cf1d9['status'](_0x4fc6a2)[_0xe3f2('0x1b')](_0x5492e7);}};}function respondWithFilteredResult(_0x4d52e8,_0x22b073){return function(_0x45c84f){if(_0x45c84f){var _0x2eaee4=typeof _0x22b073['offset']===_0xe3f2('0x1c')&&typeof _0x22b073[_0xe3f2('0x1d')]===_0xe3f2('0x1c');var _0x2d7c99=_0x45c84f[_0xe3f2('0x1e')];var _0x335e87=_0x2eaee4?0x0:_0x22b073['offset'];var _0x1ba0f2=_0x2eaee4?_0x45c84f[_0xe3f2('0x1e')]:_0x22b073[_0xe3f2('0x1f')]+_0x22b073[_0xe3f2('0x1d')];var _0x1a5c21;if(_0x1ba0f2>=_0x2d7c99){_0x1ba0f2=_0x2d7c99;_0x1a5c21=0xc8;}else{_0x1a5c21=0xce;}_0x4d52e8[_0xe3f2('0x19')](_0x1a5c21);return _0x4d52e8[_0xe3f2('0x20')](_0xe3f2('0x21'),_0x335e87+'-'+_0x1ba0f2+'/'+_0x2d7c99)[_0xe3f2('0x1b')](_0x45c84f);}return null;};}function patchUpdates(_0x5c0d1e){return function(_0x4d39a3){try{jsonpatch['apply'](_0x4d39a3,_0x5c0d1e,!![]);}catch(_0xeadeb3){return BPromise[_0xe3f2('0x22')](_0xeadeb3);}return _0x4d39a3[_0xe3f2('0x23')]();};}function saveUpdates(_0x458057,_0x7f832a){return function(_0x6bd0c9){if(_0x6bd0c9){return _0x6bd0c9[_0xe3f2('0x24')](_0x458057)[_0xe3f2('0x25')](function(_0x4ac647){return _0x4ac647;});}return null;};}function removeEntity(_0x1f711b,_0x4d50f4){return function(_0x55d0df){if(_0x55d0df){return _0x55d0df['destroy']()[_0xe3f2('0x25')](function(){_0x1f711b[_0xe3f2('0x19')](0xcc)[_0xe3f2('0x1a')]();});}};}function handleEntityNotFound(_0x707e52,_0x501563){return function(_0x2a185e){if(!_0x2a185e){_0x707e52['sendStatus'](0x194);}return _0x2a185e;};}function handleError(_0x1e2865,_0x3f8f92){_0x3f8f92=_0x3f8f92||0x1f4;return function(_0x3ae9d7){logger[_0xe3f2('0x26')](_0x3ae9d7['stack']);if(_0x3ae9d7[_0xe3f2('0x27')]){delete _0x3ae9d7[_0xe3f2('0x27')];}_0x1e2865[_0xe3f2('0x19')](_0x3f8f92)[_0xe3f2('0x28')](_0x3ae9d7);};}exports[_0xe3f2('0x29')]=function(_0x3735ca,_0x4d9ee7){var _0x1ebe8c={},_0x4f5483={},_0x26b671={'count':0x0,'rows':[]};var _0x17026c=_['map'](db['WhatsappApplication'][_0xe3f2('0x2a')],function(_0x533649){return{'name':_0x533649[_0xe3f2('0x2b')],'type':_0x533649['type']['key']};});_0x4f5483[_0xe3f2('0x2c')]=_['map'](_0x17026c,_0xe3f2('0x27'));_0x4f5483[_0xe3f2('0x2d')]=_['keys'](_0x3735ca['query']);_0x4f5483[_0xe3f2('0x2e')]=_[_0xe3f2('0x2f')](_0x4f5483[_0xe3f2('0x2c')],_0x4f5483[_0xe3f2('0x2d')]);_0x1ebe8c[_0xe3f2('0x30')]=_[_0xe3f2('0x2f')](_0x4f5483[_0xe3f2('0x2c')],qs[_0xe3f2('0x31')](_0x3735ca['query'][_0xe3f2('0x31')]));_0x1ebe8c['attributes']=_0x1ebe8c['attributes'][_0xe3f2('0x32')]?_0x1ebe8c[_0xe3f2('0x30')]:_0x4f5483[_0xe3f2('0x2c')];if(!_0x3735ca[_0xe3f2('0x2d')][_0xe3f2('0x33')](_0xe3f2('0x34'))){_0x1ebe8c[_0xe3f2('0x1d')]=qs[_0xe3f2('0x1d')](_0x3735ca[_0xe3f2('0x2d')][_0xe3f2('0x1d')]);_0x1ebe8c[_0xe3f2('0x1f')]=qs[_0xe3f2('0x1f')](_0x3735ca[_0xe3f2('0x2d')]['offset']);}_0x1ebe8c[_0xe3f2('0x35')]=qs[_0xe3f2('0x36')](_0x3735ca[_0xe3f2('0x2d')]['sort']);_0x1ebe8c[_0xe3f2('0x37')]=qs[_0xe3f2('0x2e')](_[_0xe3f2('0x38')](_0x3735ca[_0xe3f2('0x2d')],_0x4f5483[_0xe3f2('0x2e')]),_0x17026c);if(_0x3735ca[_0xe3f2('0x2d')][_0xe3f2('0x39')]){_0x1ebe8c[_0xe3f2('0x37')]=_[_0xe3f2('0x3a')](_0x1ebe8c[_0xe3f2('0x37')],{'$or':_[_0xe3f2('0x3b')](_0x17026c,function(_0x24f01f){if(_0x24f01f['type']!=='VIRTUAL'){var _0x22008a={};_0x22008a[_0x24f01f[_0xe3f2('0x27')]]={'$like':'%'+_0x3735ca['query'][_0xe3f2('0x39')]+'%'};return _0x22008a;}})});}_0x1ebe8c=_['merge']({},_0x1ebe8c,_0x3735ca[_0xe3f2('0x3c')]);var _0x1bcdb5={'where':_0x1ebe8c[_0xe3f2('0x37')]};return db['WhatsappApplication'][_0xe3f2('0x1e')](_0x1bcdb5)[_0xe3f2('0x25')](function(_0x46b2a5){_0x26b671[_0xe3f2('0x1e')]=_0x46b2a5;if(_0x3735ca[_0xe3f2('0x2d')][_0xe3f2('0x3d')]){_0x1ebe8c[_0xe3f2('0x3e')]=[{'all':!![]}];}return db[_0xe3f2('0x3f')][_0xe3f2('0x40')](_0x1ebe8c);})['then'](function(_0x467066){_0x26b671[_0xe3f2('0x41')]=_0x467066;return _0x26b671;})[_0xe3f2('0x25')](respondWithFilteredResult(_0x4d9ee7,_0x1ebe8c))[_0xe3f2('0x42')](handleError(_0x4d9ee7,null));};exports[_0xe3f2('0x43')]=function(_0x45762d,_0x14acc7){var _0x434604={'raw':!![],'where':{'id':_0x45762d[_0xe3f2('0x44')]['id']}},_0x2f7925={};_0x2f7925[_0xe3f2('0x2c')]=_[_0xe3f2('0x45')](db[_0xe3f2('0x3f')]['rawAttributes']);_0x2f7925[_0xe3f2('0x2d')]=_['keys'](_0x45762d[_0xe3f2('0x2d')]);_0x2f7925['filters']=_[_0xe3f2('0x2f')](_0x2f7925[_0xe3f2('0x2c')],_0x2f7925[_0xe3f2('0x2d')]);_0x434604[_0xe3f2('0x30')]=_['intersection'](_0x2f7925[_0xe3f2('0x2c')],qs['fields'](_0x45762d['query'][_0xe3f2('0x31')]));_0x434604[_0xe3f2('0x30')]=_0x434604['attributes'][_0xe3f2('0x32')]?_0x434604['attributes']:_0x2f7925[_0xe3f2('0x2c')];if(_0x45762d['query'][_0xe3f2('0x3d')]){_0x434604[_0xe3f2('0x3e')]=[{'all':!![]}];}_0x434604=_[_0xe3f2('0x3a')]({},_0x434604,_0x45762d[_0xe3f2('0x3c')]);return db[_0xe3f2('0x3f')][_0xe3f2('0x46')](_0x434604)[_0xe3f2('0x25')](handleEntityNotFound(_0x14acc7,null))[_0xe3f2('0x25')](respondWithResult(_0x14acc7,null))[_0xe3f2('0x42')](handleError(_0x14acc7,null));};exports[_0xe3f2('0x47')]=function(_0x25086f,_0x289467){return db[_0xe3f2('0x3f')]['create'](_0x25086f['body'],{})[_0xe3f2('0x25')](respondWithResult(_0x289467,0xc9))['catch'](handleError(_0x289467,null));};exports[_0xe3f2('0x24')]=function(_0x23923e,_0x5b1a67){if(_0x23923e[_0xe3f2('0x48')]['id']){delete _0x23923e[_0xe3f2('0x48')]['id'];}return db[_0xe3f2('0x3f')]['find']({'where':{'id':_0x23923e['params']['id']}})['then'](handleEntityNotFound(_0x5b1a67,null))[_0xe3f2('0x25')](saveUpdates(_0x23923e[_0xe3f2('0x48')],null))[_0xe3f2('0x25')](respondWithResult(_0x5b1a67,null))[_0xe3f2('0x42')](handleError(_0x5b1a67,null));};exports[_0xe3f2('0x49')]=function(_0x38adf1,_0x182dd3){return db[_0xe3f2('0x3f')][_0xe3f2('0x46')]({'where':{'id':_0x38adf1[_0xe3f2('0x44')]['id']}})[_0xe3f2('0x25')](handleEntityNotFound(_0x182dd3,null))[_0xe3f2('0x25')](removeEntity(_0x182dd3,null))[_0xe3f2('0x42')](handleError(_0x182dd3,null));};
\ No newline at end of file
index 4638393..789ce46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f42=['bluebird','path','../../config/environment','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x120123,_0x4eff59){var _0x3bec4c=function(_0x182818){while(--_0x182818){_0x120123['push'](_0x120123['shift']());}};_0x3bec4c(++_0x4eff59);}(_0x7f42,0x1dd));var _0x27f4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x7f42[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0x27f4('0x0'));var util=require('util');var logger=require(_0x27f4('0x1'))(_0x27f4('0x2'));var moment=require('moment');var BPromise=require(_0x27f4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x27f4('0x4'));var rimraf=require('rimraf');var config=require(_0x27f4('0x5'));var attributes=require('./whatsappApplication.attributes');module[_0x27f4('0x6')]=function(_0x5c9286,_0x256ac9){return _0x5c9286[_0x27f4('0x7')](_0x27f4('0x8'),attributes,{'tableName':_0x27f4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x27f4('0xa'),'collate':_0x27f4('0xb')});};
\ No newline at end of file
+var _0x1501=['path','rimraf','./whatsappApplication.attributes','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4fdcc0,_0x560a01){var _0xc0ce94=function(_0x36ea12){while(--_0x36ea12){_0x4fdcc0['push'](_0x4fdcc0['shift']());}};_0xc0ce94(++_0x560a01);}(_0x1501,0x126));var _0x1150=function(_0x30e8a1,_0x55fa82){_0x30e8a1=_0x30e8a1-0x0;var _0x37c6f1=_0x1501[_0x30e8a1];return _0x37c6f1;};'use strict';var _=require('lodash');var util=require(_0x1150('0x0'));var logger=require(_0x1150('0x1'))(_0x1150('0x2'));var moment=require('moment');var BPromise=require(_0x1150('0x3'));var rp=require(_0x1150('0x4'));var fs=require('fs');var path=require(_0x1150('0x5'));var rimraf=require(_0x1150('0x6'));var config=require('../../config/environment');var attributes=require(_0x1150('0x7'));module['exports']=function(_0x63c724,_0x316a7d){return _0x63c724[_0x1150('0x8')](_0x1150('0x9'),attributes,{'tableName':_0x1150('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1150('0xb'),'collate':_0x1150('0xc')});};
\ No newline at end of file
index f66df50..9dd02a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22fb=['WhatsappApplication,\x20%s,\x20%s,\x20%s','code','message','error','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1d14c5,_0x11e7d3){var _0x4ae7fc=function(_0x484ece){while(--_0x484ece){_0x1d14c5['push'](_0x1d14c5['shift']());}};_0x4ae7fc(++_0x11e7d3);}(_0x22fb,0x192));var _0xb22f=function(_0x2fa144,_0x1c06aa){_0x2fa144=_0x2fa144-0x0;var _0x264d3d=_0x22fb[_0x2fa144];return _0x264d3d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb22f('0x0'));var BPromise=require('bluebird');var rs=require(_0xb22f('0x1'));var fs=require('fs');var Redis=require(_0xb22f('0x2'));var db=require(_0xb22f('0x3'))['db'];var utils=require(_0xb22f('0x4'));var logger=require(_0xb22f('0x5'))('rpc');var config=require(_0xb22f('0x6'));var jayson=require(_0xb22f('0x7'));var client=jayson[_0xb22f('0x8')][_0xb22f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x412a95,_0x367d4b,_0x47f61a){return new BPromise(function(_0x34433b,_0x22c509){return client[_0xb22f('0xa')](_0x412a95,_0x47f61a)[_0xb22f('0xb')](function(_0x1a3aae){logger[_0xb22f('0xc')](_0xb22f('0xd'),_0x367d4b,_0xb22f('0xe'));logger[_0xb22f('0xf')](_0xb22f('0x10'),_0x367d4b,_0xb22f('0xe'),JSON['stringify'](_0x1a3aae));if(_0x1a3aae['error']){if(_0x1a3aae['error'][_0xb22f('0x11')]===0x1f4){logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x367d4b,_0x1a3aae['error'][_0xb22f('0x12')]);return _0x22c509(_0x1a3aae[_0xb22f('0x13')][_0xb22f('0x12')]);}logger[_0xb22f('0x13')](_0xb22f('0xd'),_0x367d4b,_0x1a3aae[_0xb22f('0x13')]['message']);return _0x34433b(_0x1a3aae[_0xb22f('0x13')]['message']);}else{logger[_0xb22f('0xc')]('WhatsappApplication,\x20%s,\x20%s',_0x367d4b,_0xb22f('0xe'));_0x34433b(_0x1a3aae[_0xb22f('0x14')][_0xb22f('0x12')]);}})[_0xb22f('0x15')](function(_0x447eaf){logger['error'](_0xb22f('0xd'),_0x367d4b,_0x447eaf);_0x22c509(_0x447eaf);});});}
\ No newline at end of file
+var _0x7bae=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x7bae,0x13b));var _0xe7ba=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x7bae[_0x2b10c6];return _0x3789d2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7ba('0x0'));var BPromise=require(_0xe7ba('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe7ba('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe7ba('0x3'));var logger=require(_0xe7ba('0x4'))(_0xe7ba('0x5'));var config=require(_0xe7ba('0x6'));var jayson=require(_0xe7ba('0x7'));var client=jayson[_0xe7ba('0x8')][_0xe7ba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c5e59,_0x10b307,_0x34fb18){return new BPromise(function(_0x160565,_0x27b1d5){return client[_0xe7ba('0xa')](_0x3c5e59,_0x34fb18)[_0xe7ba('0xb')](function(_0x588f08){logger[_0xe7ba('0xc')](_0xe7ba('0xd'),_0x10b307,_0xe7ba('0xe'));logger[_0xe7ba('0xf')](_0xe7ba('0x10'),_0x10b307,_0xe7ba('0xe'),JSON[_0xe7ba('0x11')](_0x588f08));if(_0x588f08[_0xe7ba('0x12')]){if(_0x588f08[_0xe7ba('0x12')]['code']===0x1f4){logger[_0xe7ba('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x10b307,_0x588f08[_0xe7ba('0x12')][_0xe7ba('0x13')]);return _0x27b1d5(_0x588f08[_0xe7ba('0x12')][_0xe7ba('0x13')]);}logger[_0xe7ba('0x12')](_0xe7ba('0xd'),_0x10b307,_0x588f08['error']['message']);return _0x160565(_0x588f08[_0xe7ba('0x12')][_0xe7ba('0x13')]);}else{logger[_0xe7ba('0xc')]('WhatsappApplication,\x20%s,\x20%s',_0x10b307,_0xe7ba('0xe'));_0x160565(_0x588f08['result']['message']);}})['catch'](function(_0x393f75){logger['error'](_0xe7ba('0xd'),_0x10b307,_0x393f75);_0x27b1d5(_0x393f75);});});}
\ No newline at end of file
index 0451d92..d22e86b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7217=['/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','whatsappinteraction:addtags','addTags','whatsapp','whatsappinteraction:update','update','whatsappinteraction:destroy','destroy','delete','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x5c81dd,_0x23ef75){var _0x1e8927=function(_0x5c99cd){while(--_0x5c99cd){_0x5c81dd['push'](_0x5c81dd['shift']());}};_0x1e8927(++_0x23ef75);}(_0x7217,0x19e));var _0x7721=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0x7217[_0x8de54f];return _0x14cba4;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x13')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0x14')]);router['post'](_0x7721('0xf'),auth[_0x7721('0x9')](),controller['addMessage']);router[_0x7721('0x13')](_0x7721('0x15'),auth[_0x7721('0x9')](),interaction[_0x7721('0x16')]('whatsapp',_0x7721('0x17')),controller[_0x7721('0x18')]);router['put']('/:id',auth['isAuthenticated'](),interaction[_0x7721('0x16')](_0x7721('0x19'),_0x7721('0x1a')),controller[_0x7721('0x1b')]);router['delete'](_0x7721('0xd'),auth['isAuthenticated'](),interaction[_0x7721('0x16')]('whatsapp',_0x7721('0x1c')),controller[_0x7721('0x1d')]);router[_0x7721('0x1e')](_0x7721('0x15'),auth[_0x7721('0x9')](),controller[_0x7721('0x1f')]);module[_0x7721('0x20')]=router;
\ No newline at end of file
+var _0x6455=['Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','/:id/download','download','post','addMessage','/:id/tags','tracked','whatsappinteraction:addtags','addTags','put','whatsapp','update','delete','whatsappinteraction:destroy','destroy','exports','multer','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6455,0x97));var _0x5645=function(_0x240459,_0x511d47){_0x240459=_0x240459-0x0;var _0x3d281a=_0x6455[_0x240459];return _0x3d281a;};'use strict';var multer=require(_0x5645('0x0'));var util=require('util');var path=require(_0x5645('0x1'));var timeout=require(_0x5645('0x2'));var express=require(_0x5645('0x3'));var router=express[_0x5645('0x4')]();var fs_extra=require(_0x5645('0x5'));var auth=require(_0x5645('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5645('0x7'));var controller=require(_0x5645('0x8'));router[_0x5645('0x9')]('/',auth[_0x5645('0xa')](),controller[_0x5645('0xb')]);router[_0x5645('0x9')](_0x5645('0xc'),auth[_0x5645('0xa')](),controller['describe']);router['get'](_0x5645('0xd'),auth[_0x5645('0xa')](),controller[_0x5645('0xe')]);router[_0x5645('0x9')](_0x5645('0xf'),auth[_0x5645('0xa')](),controller['getMessages']);router[_0x5645('0x9')](_0x5645('0x10'),auth[_0x5645('0xa')](),controller[_0x5645('0x11')]);router['post']('/',auth[_0x5645('0xa')](),controller['create']);router[_0x5645('0x12')](_0x5645('0xf'),auth[_0x5645('0xa')](),controller[_0x5645('0x13')]);router[_0x5645('0x12')](_0x5645('0x14'),auth[_0x5645('0xa')](),interaction[_0x5645('0x15')]('whatsapp',_0x5645('0x16')),controller[_0x5645('0x17')]);router[_0x5645('0x18')]('/:id',auth['isAuthenticated'](),interaction[_0x5645('0x15')](_0x5645('0x19'),'whatsappinteraction:update'),controller[_0x5645('0x1a')]);router[_0x5645('0x1b')](_0x5645('0xd'),auth['isAuthenticated'](),interaction[_0x5645('0x15')](_0x5645('0x19'),_0x5645('0x1c')),controller[_0x5645('0x1d')]);router['delete'](_0x5645('0x14'),auth['isAuthenticated'](),controller['removeTags']);module[_0x5645('0x1e')]=router;
\ No newline at end of file
index 10d2a39..dccfaa6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ff3=['out','ENUM','sequelize','moment','BOOLEAN','DATE','STRING'];(function(_0x1ab13e,_0x44507a){var _0xa28f8=function(_0x231213){while(--_0x231213){_0x1ab13e['push'](_0x1ab13e['shift']());}};_0xa28f8(++_0x44507a);}(_0x8ff3,0x72));var _0x38ff=function(_0x5b88f1,_0x9555f0){_0x5b88f1=_0x5b88f1-0x0;var _0x41f6c2=_0x8ff3[_0x5b88f1];return _0x41f6c2;};'use strict';var Sequelize=require(_0x38ff('0x0'));var moment=require(_0x38ff('0x1'));module['exports']={'closed':{'type':Sequelize[_0x38ff('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x38ff('0x3')]},'disposition':{'type':Sequelize[_0x38ff('0x4')]},'secondDisposition':{'type':Sequelize[_0x38ff('0x4')]},'thirdDisposition':{'type':Sequelize[_0x38ff('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x38ff('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x38ff('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x38ff('0x6')]('in',_0x38ff('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x38ff('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0xff22=['STRING','ENUM','out','sequelize','moment','BOOLEAN','DATE'];(function(_0x3aae3b,_0x3af36d){var _0xbfa4d0=function(_0x5bea40){while(--_0x5bea40){_0x3aae3b['push'](_0x3aae3b['shift']());}};_0xbfa4d0(++_0x3af36d);}(_0xff22,0x1a0));var _0x2ff2=function(_0x1530ec,_0x2e6a0f){_0x1530ec=_0x1530ec-0x0;var _0x504931=_0xff22[_0x1530ec];return _0x504931;};'use strict';var Sequelize=require(_0x2ff2('0x0'));var moment=require(_0x2ff2('0x1'));module['exports']={'closed':{'type':Sequelize[_0x2ff2('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2ff2('0x3')]},'disposition':{'type':Sequelize[_0x2ff2('0x4')]},'secondDisposition':{'type':Sequelize[_0x2ff2('0x4')]},'thirdDisposition':{'type':Sequelize[_0x2ff2('0x4')]},'note':{'type':Sequelize[_0x2ff2('0x4')]},'phone':{'type':Sequelize[_0x2ff2('0x4')]},'read1stAt':{'type':Sequelize[_0x2ff2('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x2ff2('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2ff2('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x2ff2('0x5')]('in',_0x2ff2('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x2ff2('0x2')],'defaultValue':![]}};
\ No newline at end of file
index 54714f3..dec301a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7868=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./whatsappInteraction.socket','sendStatus','status','json','offset','undefined','limit','count','set','save','update','then','end','name','send','Users','map','Tags','TagIds','push','index','WhatsappInteraction','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','ui.WhatsappInteractionId','left_join','u.id\x20=\x20ui.UserId','whatsapp_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','value','having','`\x20=\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','forEach','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','catch','show','includeAll','include','options','create','params','describe','WhatsappMessage','addMessage','ids','omit','findOne','findAll','addTags','setTags','spread','removeTags','unix','server','tmp','join','files','attachments','format','transcript-%d-%s.zip','fullname','CmContact','firstName','lastName','Attachment','Messages','direction','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','basename','createReadStream','pipe','createWriteStream','out','System','renderFile','root','transcript-','createPdfFromHTML','log','err','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis'];(function(_0x1a4a74,_0x184ddc){var _0x239aba=function(_0x3f2da2){while(--_0x3f2da2){_0x1a4a74['push'](_0x1a4a74['shift']());}};_0x239aba(++_0x184ddc);}(_0x7868,0x1c0));var _0x8786=function(_0x47feff,_0x413f25){_0x47feff=_0x47feff-0x0;var _0x406ee4=_0x7868[_0x47feff];return _0x406ee4;};'use strict';var emlformat=require(_0x8786('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8786('0x1'));var jsonpatch=require(_0x8786('0x2'));var rp=require(_0x8786('0x3'));var moment=require(_0x8786('0x4'));var BPromise=require(_0x8786('0x5'));var Mustache=require('mustache');var util=require(_0x8786('0x6'));var path=require(_0x8786('0x7'));var sox=require(_0x8786('0x8'));var csv=require(_0x8786('0x9'));var ejs=require(_0x8786('0xa'));var fs=require('fs');var fs_extra=require(_0x8786('0xb'));var _=require(_0x8786('0xc'));var squel=require(_0x8786('0xd'));var crypto=require(_0x8786('0xe'));var jsforce=require(_0x8786('0xf'));var deskjs=require(_0x8786('0x10'));var toCsv=require(_0x8786('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8786('0x11'));var authService=require(_0x8786('0x12'));var qs=require(_0x8786('0x13'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0x8786('0x14'));var logger=require('../../config/logger')(_0x8786('0x15'));var utils=require(_0x8786('0x16'));var config=require(_0x8786('0x17'));var licenseUtil=require(_0x8786('0x18'));var db=require(_0x8786('0x19'))['db'];config[_0x8786('0x1a')]=_['defaults'](config[_0x8786('0x1a')],{'host':_0x8786('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8786('0x1a')]));require(_0x8786('0x1c'))['register'](socket);function respondWithStatusCode(_0x130f3d,_0x1fa139){_0x1fa139=_0x1fa139||0xcc;return function(_0x44e19a){if(_0x44e19a){return _0x130f3d[_0x8786('0x1d')](_0x1fa139);}return _0x130f3d['status'](_0x1fa139)['end']();};}function respondWithResult(_0x4f599e,_0x3ea445){_0x3ea445=_0x3ea445||0xc8;return function(_0x450606){if(_0x450606){return _0x4f599e[_0x8786('0x1e')](_0x3ea445)[_0x8786('0x1f')](_0x450606);}};}function respondWithFilteredResult(_0x4fcf1c,_0x1b410a){return function(_0x3b9ff1){if(_0x3b9ff1){var _0x316bf7=typeof _0x1b410a[_0x8786('0x20')]===_0x8786('0x21')&&typeof _0x1b410a[_0x8786('0x22')]===_0x8786('0x21');var _0x643c33=_0x3b9ff1[_0x8786('0x23')];var _0x4f7f84=_0x316bf7?0x0:_0x1b410a[_0x8786('0x20')];var _0x790c9a=_0x316bf7?_0x3b9ff1[_0x8786('0x23')]:_0x1b410a[_0x8786('0x20')]+_0x1b410a[_0x8786('0x22')];var _0x5ca4e7;if(_0x790c9a>=_0x643c33){_0x790c9a=_0x643c33;_0x5ca4e7=0xc8;}else{_0x5ca4e7=0xce;}_0x4fcf1c[_0x8786('0x1e')](_0x5ca4e7);return _0x4fcf1c[_0x8786('0x24')]('Content-Range',_0x4f7f84+'-'+_0x790c9a+'/'+_0x643c33)[_0x8786('0x1f')](_0x3b9ff1);}return null;};}function patchUpdates(_0x1af37a){return function(_0x30d9be){try{jsonpatch['apply'](_0x30d9be,_0x1af37a,!![]);}catch(_0x5165f7){return BPromise['reject'](_0x5165f7);}return _0x30d9be[_0x8786('0x25')]();};}function saveUpdates(_0x33346d,_0x1bb259){return function(_0x53c884){if(_0x53c884){return _0x53c884[_0x8786('0x26')](_0x33346d)[_0x8786('0x27')](function(_0xcd7d9){return _0xcd7d9;});}return null;};}function removeEntity(_0x30fd5e,_0x9f348e){return function(_0x53c1a9){if(_0x53c1a9){return _0x53c1a9['destroy']()[_0x8786('0x27')](function(){_0x30fd5e[_0x8786('0x1e')](0xcc)[_0x8786('0x28')]();});}};}function handleEntityNotFound(_0x91ee61,_0x15bc46){return function(_0x11ea8b){if(!_0x11ea8b){_0x91ee61[_0x8786('0x1d')](0x194);}return _0x11ea8b;};}function handleError(_0x3b6c0b,_0x322a04){_0x322a04=_0x322a04||0x1f4;return function(_0xd796e7){logger['error'](_0xd796e7['stack']);if(_0xd796e7['name']){delete _0xd796e7[_0x8786('0x29')];}_0x3b6c0b['status'](_0x322a04)[_0x8786('0x2a')](_0xd796e7);};}function getInteractionUsers(_0xdf4c00,_0x56ca54){return new BPromise(function(_0x3dc758,_0x5b0273){try{if(_0x56ca54[_0xdf4c00['id']]){_0xdf4c00[_0x8786('0x2b')]=_[_0x8786('0x2c')](_0x56ca54[_0xdf4c00['id']],function(_0x3d2bb5){return{'id':_0x3d2bb5['id'],'fullname':_0x3d2bb5['fullname']};});}}catch(_0x4818f9){_0x5b0273(_0x4818f9);}_0x3dc758(_0xdf4c00);});}function getInteractionTags(_0x40ac99,_0x2794e5){return new BPromise(function(_0x208cae,_0x2c47b4){try{if(_0x40ac99['TagIds']){_0x40ac99[_0x8786('0x2d')]=[];_0x40ac99[_0x8786('0x2e')]['split'](',')['forEach'](function(_0x151f7b){_0x40ac99[_0x8786('0x2d')][_0x8786('0x2f')](_0x2794e5[_0x151f7b]);});}delete _0x40ac99[_0x8786('0x2e')];}catch(_0x47d68b){_0x2c47b4(_0x47d68b);}_0x208cae(_0x40ac99);});}function updateWhatsappInteraction(_0x3cc194,_0x199aad,_0x57b4b2){return new BPromise(function(_0x3d38bd,_0x4d960d){return getInteractionUsers(_0x3cc194,_0x57b4b2)['then'](function(_0x39b9c3){return getInteractionTags(_0x39b9c3,_0x199aad);})[_0x8786('0x27')](function(_0x31125c){_0x3d38bd(_0x31125c);})['catch'](function(_0xbbac18){_0x4d960d(_0xbbac18);});});}exports[_0x8786('0x30')]=function(_0x36ad81,_0x115504){var _0x58d84d={},_0x5bb4fa={},_0x1f6c3a={'count':0x0,'rows':[]};var _0x1788cd=_[_0x8786('0x2c')](db[_0x8786('0x31')][_0x8786('0x32')],function(_0x34b2ec){return{'name':_0x34b2ec['fieldName'],'type':_0x34b2ec[_0x8786('0x33')][_0x8786('0x34')]};});_0x5bb4fa[_0x8786('0x35')]=_[_0x8786('0x2c')](_0x1788cd,_0x8786('0x29'));_0x5bb4fa[_0x8786('0x36')]=_[_0x8786('0x37')](_0x36ad81[_0x8786('0x36')]);_0x5bb4fa[_0x8786('0x38')]=_[_0x8786('0x39')](_0x5bb4fa[_0x8786('0x35')],_0x5bb4fa[_0x8786('0x36')]);_0x58d84d['attributes']=_[_0x8786('0x39')](_0x5bb4fa[_0x8786('0x35')],qs[_0x8786('0x3a')](_0x36ad81[_0x8786('0x36')][_0x8786('0x3a')]));_0x58d84d[_0x8786('0x3b')]=_0x58d84d['attributes'][_0x8786('0x3c')]?_0x58d84d[_0x8786('0x3b')]:_0x5bb4fa['model'];if(!_0x36ad81[_0x8786('0x36')][_0x8786('0x3d')](_0x8786('0x3e'))){_0x58d84d[_0x8786('0x22')]=qs[_0x8786('0x22')](_0x36ad81[_0x8786('0x36')][_0x8786('0x22')]);_0x58d84d[_0x8786('0x20')]=qs['offset'](_0x36ad81['query'][_0x8786('0x20')]);}_0x58d84d[_0x8786('0x3f')]=qs[_0x8786('0x40')](_0x36ad81[_0x8786('0x36')][_0x8786('0x40')]);_0x58d84d[_0x8786('0x41')]=qs['filters'](_[_0x8786('0x42')](_0x36ad81['query'],_0x5bb4fa['filters']),_0x1788cd);var _0x1912fe=[];var _0x4efef7=squel[_0x8786('0x43')]()[_0x8786('0x44')]('id')[_0x8786('0x44')](_0x8786('0x29'))[_0x8786('0x44')](_0x8786('0x45'))[_0x8786('0x46')](_0x8786('0x47'));var _0x2d1673=squel['select']()[_0x8786('0x44')](_0x8786('0x48'))[_0x8786('0x44')]('u.fullname')['field'](_0x8786('0x49'))[_0x8786('0x46')]('user_has_whatsapp_interactions','ui')[_0x8786('0x4a')]('users','u',_0x8786('0x4b'));var _0x1ae288=squel['select']()[_0x8786('0x46')](_0x8786('0x4c'),'i')['left_join']('cm_contacts','c',_0x8786('0x4d'))[_0x8786('0x4a')]('users','o',_0x8786('0x4e'))['left_join'](_0x8786('0x4f'),'a',_0x8786('0x50'))[_0x8786('0x4a')]('whatsapp_messages','me',_0x8786('0x51'))[_0x8786('0x4a')](_0x8786('0x52'),'it',_0x8786('0x53'))[_0x8786('0x4a')](_0x8786('0x47'),'t','t.id\x20=\x20it.TagId');var _0x766c3b=squel[_0x8786('0x54')]();var _0x50b844=[];var _0x4bbf62=squel[_0x8786('0x54')]();var _0x48d71c;if(_0x36ad81[_0x8786('0x36')][_0x8786('0x55')]){_0x48d71c=as[_0x8786('0x56')](_0x36ad81[_0x8786('0x36')][_0x8786('0x55')]);var _0x72abff=_0x48d71c[_0x8786('0x57')];for(var _0x354c36=0x0;_0x354c36<_0x48d71c['conditions'][_0x8786('0x3c')];_0x354c36++){var _0x374ebb=_0x48d71c[_0x8786('0x58')][_0x354c36];var _0x27580f='i';var _0x50f89e=_[_0x8786('0x59')](_0x1788cd,[_0x8786('0x29'),_0x374ebb['field']]);if(!_0x50f89e){switch(_0x374ebb[_0x8786('0x44')]){case'unreadMessages':if(_0x374ebb[_0x8786('0x5a')]==0x1){_0x1ae288[_0x8786('0x5b')]('`'+_0x374ebb[_0x8786('0x44')]+_0x8786('0x5c'));}else{_0x1ae288['having']('`'+_0x374ebb[_0x8786('0x44')]+'`\x20>\x200');}break;case _0x8786('0x5d'):if(_0x374ebb[_0x8786('0x5e')]===_0x8786('0x5f')){if(_0x374ebb[_0x8786('0x5a')][_0x8786('0x60')]('\x20')[_0x8786('0x3c')]>0x1){_0x766c3b[_0x72abff](_0x8786('0x61'),qs[_0x8786('0x62')](_0x374ebb[_0x8786('0x5a')]),null);}else{var _0x2ee45a='%'+_0x374ebb[_0x8786('0x5a')]+'%';_0x766c3b[_0x72abff](_0x8786('0x63'),_0x2ee45a,_0x2ee45a,_0x2ee45a);}}else{_0x50f89e=_[_0x8786('0x59')](_0x1788cd,[_0x8786('0x29'),_0x8786('0x64')]);_0x374ebb[_0x8786('0x44')]=_0x8786('0x64');_0x5e3bc5=as[_0x8786('0x65')](_0x27580f,_0x50f89e[_0x8786('0x33')],_0x374ebb);_0x766c3b[_0x72abff](_0x5e3bc5[_0x8786('0x66')],_0x5e3bc5[_0x8786('0x5a')][_0x8786('0x67')],_0x5e3bc5[_0x8786('0x5a')][_0x8786('0x28')]);}break;case _0x8786('0x68'):var _0x64a71f=_0x374ebb[_0x8786('0x5a')][_0x8786('0x60')](',')['map'](function(_0x2cd63c){return Number(_0x2cd63c);});_0x64a71f['forEach'](function(_0x50d72a){_0x4bbf62['or'](_0x8786('0x69'),'%,'+_0x50d72a+',%');});_0x50b844=_['union'](_0x50b844,_0x64a71f);break;case _0x8786('0x6a'):if(_0x374ebb[_0x8786('0x5e')]===_0x8786('0x5f')){_0x766c3b[_0x72abff](_0x8786('0x6b'),'%'+_0x374ebb[_0x8786('0x5a')]+'%',null);}else{_0x50f89e=_[_0x8786('0x59')](_0x1788cd,[_0x8786('0x29'),_0x8786('0x6c')]);_0x374ebb[_0x8786('0x44')]='UserId';_0x5e3bc5=as['buildExpression'](_0x27580f,_0x50f89e['type'],_0x374ebb);_0x766c3b[_0x72abff](_0x5e3bc5['text'],_0x5e3bc5[_0x8786('0x5a')][_0x8786('0x67')],_0x5e3bc5[_0x8786('0x5a')][_0x8786('0x28')]);}break;case _0x8786('0x6d'):_0x5e3bc5=as[_0x8786('0x65')]('me',null,_0x374ebb);_0x766c3b[_0x72abff](_0x5e3bc5['text'],_0x5e3bc5[_0x8786('0x5a')][_0x8786('0x67')],_0x5e3bc5[_0x8786('0x5a')][_0x8786('0x28')]);break;}}else{var _0x5e3bc5=as[_0x8786('0x65')](_0x27580f,_0x50f89e[_0x8786('0x33')],_0x374ebb);_0x766c3b[_0x72abff](_0x5e3bc5[_0x8786('0x66')],_0x5e3bc5[_0x8786('0x5a')]['start'],_0x5e3bc5[_0x8786('0x5a')][_0x8786('0x28')]);}}}else{var _0x476f00=_(_0x36ad81[_0x8786('0x36')])[_0x8786('0x37')]()[_0x8786('0x2c')](function(_0x35e614){return _[_0x8786('0x6e')](_0x1788cd,[_0x8786('0x29'),_0x35e614])?_0x35e614:undefined;})[_0x8786('0x6f')]()[_0x8786('0x5a')]();if(!_[_0x8786('0x70')](_0x476f00)){_0x476f00[_0x8786('0x71')](function(_0x29ca80){if(_0x29ca80===_0x8786('0x72')){_0x1ae288[_0x8786('0x41')](_0x8786('0x73'),[][_0x8786('0x74')](_0x36ad81[_0x8786('0x36')][_0x29ca80]));}else if(_0x29ca80===_0x8786('0x75')){var _0x4a3fc1=JSON[_0x8786('0x76')](_0x36ad81[_0x8786('0x36')][_0x29ca80])[_0x8786('0x77')];var _0x1167c8=JSON[_0x8786('0x76')](_0x36ad81[_0x8786('0x36')][_0x29ca80])['$lte'];_0x1ae288[_0x8786('0x41')](_0x8786('0x78'),_0x4a3fc1,_0x1167c8);}else{if(_0x36ad81[_0x8786('0x36')][_0x29ca80]===_0x8786('0x79')){_0x1ae288[_0x8786('0x41')]('i.'+_0x29ca80+'\x20IS\x20NULL');}else{_0x1ae288[_0x8786('0x41')]('i.'+_0x29ca80+'\x20=\x20?',_0x36ad81[_0x8786('0x36')][_0x29ca80]);}}});}if(_0x36ad81[_0x8786('0x36')][_0x8786('0x7a')]){if(_0x36ad81[_0x8786('0x36')]['read']==0x1){_0x1ae288['having'](_0x8786('0x7b'));}else{_0x1ae288[_0x8786('0x5b')](_0x8786('0x7c'));}}if(_0x36ad81[_0x8786('0x36')][_0x8786('0x7d')]){_0x50b844=_[_0x8786('0x7e')](_0x36ad81[_0x8786('0x36')]['tag'])?_0x36ad81[_0x8786('0x36')][_0x8786('0x7d')]:new Array(_0x36ad81[_0x8786('0x36')][_0x8786('0x7d')]);_0x50b844[_0x8786('0x71')](function(_0x3f13b7){_0x4bbf62['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3f13b7+',%');});}if(_0x36ad81[_0x8786('0x36')][_0x8786('0x7f')]){var _0x423b91=_0x36ad81['query'][_0x8786('0x7f')][_0x8786('0x80')]('\x5c','\x5c\x5c')[_0x8786('0x80')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x423b91)){_0x766c3b['or']('i.id\x20LIKE\x20?',_0x423b91+'%')['or'](_0x8786('0x81'),_0x423b91+'%');}else{_0x766c3b['or'](_0x8786('0x82'),qs[_0x8786('0x62')](_0x423b91))['or'](_0x8786('0x83'),_0x423b91+'%');}}}_0x1ae288[_0x8786('0x41')](_0x766c3b);_0x1ae288[_0x8786('0x84')](_0x8786('0x85'));var _0x5a2d81={'type':db[_0x8786('0x86')][_0x8786('0x87')][_0x8786('0x88')],'raw':!![]};var _0x4752c9=_0x1ae288[_0x8786('0x89')]();_0x4752c9[_0x8786('0x44')](_0x8786('0x85'));_0x4752c9[_0x8786('0x44')](_0x8786('0x8a'),_0x8786('0x8b'));if(_0x58d84d[_0x8786('0x3f')]){_0x58d84d[_0x8786('0x3f')][_0x8786('0x71')](function(_0x50258c){var _0x1350be=_0x50258c[0x0]===_0x8786('0x8c')?_0x50258c[0x0]:'i.'+_0x50258c[0x0];_0x1ae288['order'](_0x1350be,_0x50258c[0x1]===_0x8786('0x8d')?![]:!![]);});}if(!_['isEmpty'](_0x50b844)){_0x1ae288[_0x8786('0x5b')](_0x4bbf62);_0x4752c9['where'](_0x8786('0x8e'),_0x50b844);}BPromise['resolve']()['then'](function(){if(!_0x48d71c){if(_0x36ad81['query'][_0x8786('0x72')])return;_0x4752c9[_0x8786('0x41')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x1ae288['where'](_0x8786('0x8f'));return;}if(_0x36ad81[_0x8786('0x90')][_0x8786('0x91')]!==_0x8786('0x92'))return;return _0x36ad81['user']['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})[_0x8786('0x27')](function(_0x39298e){if(_[_0x8786('0x70')](_0x39298e)){_0x4752c9[_0x8786('0x41')]('i.WhatsappAccountId\x20IS\x20NULL');_0x1ae288[_0x8786('0x41')](_0x8786('0x93'));}else{_0x4752c9['where'](_0x8786('0x73'),_['map'](_0x39298e,'id'));_0x1ae288[_0x8786('0x41')]('i.WhatsappAccountId\x20IN\x20?',_[_0x8786('0x2c')](_0x39298e,'id'));}});})['then'](function(){if(_0x36ad81['user'][_0x8786('0x91')]===_0x8786('0x92')&&!_0x48d71c&&!_0x36ad81[_0x8786('0x36')]['WhatsappAccountId'])return[];return db[_0x8786('0x94')][_0x8786('0x36')](_0x4752c9[_0x8786('0x95')](),_0x5a2d81);})['then'](function(_0x47ca3a){_0x1f6c3a[_0x8786('0x23')]=_0x47ca3a[_0x8786('0x3c')];if(_0x1f6c3a['count']===0x0)return[];return db[_0x8786('0x94')]['query'](_0x4efef7[_0x8786('0x95')](),_0x5a2d81)['then'](function(_0x2edaec){_0x1912fe=_[_0x8786('0x96')](_0x2edaec,'id');_0x5a2d81=_[_0x8786('0x97')](_0x5a2d81,{'model':db[_0x8786('0x31')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x36ad81[_0x8786('0x36')][_0x8786('0x3a')]){_0x58d84d[_0x8786('0x3b')][_0x8786('0x71')](function(_0x20d6a9){_0x1ae288[_0x8786('0x44')]('i.'+_0x20d6a9);});}else{_0x1ae288[_0x8786('0x44')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x8786('0x8b'));_0x1ae288[_0x8786('0x44')](_0x8786('0x98'),_0x8786('0x99'));_0x1ae288['field']('a.mandatoryDisposition',_0x8786('0x9a'));_0x1ae288[_0x8786('0x44')](_0x8786('0x9b'),_0x8786('0x8c'));_0x1ae288[_0x8786('0x44')](_0x8786('0x9c'));_0x1ae288[_0x8786('0x44')]('c.firstName',_0x8786('0x9d'));_0x1ae288[_0x8786('0x44')](_0x8786('0x9e'),_0x8786('0x9f'));_0x1ae288[_0x8786('0x44')](_0x8786('0xa0'),'Contact.email');_0x1ae288[_0x8786('0x44')](_0x8786('0xa1'),_0x8786('0xa2'));_0x1ae288['field'](_0x8786('0xa3'),_0x8786('0xa4'));_0x1ae288['field'](_0x8786('0xa5'),_0x8786('0xa6'));_0x1ae288[_0x8786('0x44')](_0x8786('0xa7'),_0x8786('0xa8'));_0x1ae288[_0x8786('0x44')](_0x8786('0xa9'),_0x8786('0xaa'));_0x1ae288['field'](_0x8786('0xab'),'TagIds');}if(_0x58d84d[_0x8786('0x22')])_0x1ae288['limit'](_0x58d84d[_0x8786('0x22')]);if(_0x58d84d[_0x8786('0x20')])_0x1ae288['offset'](_0x58d84d[_0x8786('0x20')]);return db[_0x8786('0x94')]['query'](_0x1ae288['toString'](),_0x5a2d81);})[_0x8786('0x27')](function(_0x36cd84){if(_0x36cd84[_0x8786('0x3c')]>0x0)_0x2d1673[_0x8786('0x41')](_0x8786('0xac'),_[_0x8786('0x2c')](_0x36cd84,'id'));return db[_0x8786('0x94')][_0x8786('0x36')](_0x2d1673['toString'](),_0x5a2d81)['then'](function(_0x21c2ec){var _0xc4043d=_[_0x8786('0xad')](_0x21c2ec,_0x8786('0xae'));var _0x3b5d64=[];_0x36cd84[_0x8786('0x71')](function(_0x179d4f){_0x3b5d64[_0x8786('0x2f')](updateWhatsappInteraction(_0x179d4f,_0x1912fe,_0xc4043d));});return BPromise[_0x8786('0xaf')](_0x3b5d64);});});})[_0x8786('0x27')](function(_0x397339){_0x1f6c3a[_0x8786('0xb0')]=_0x397339;return _0x1f6c3a;})[_0x8786('0x27')](respondWithFilteredResult(_0x115504,_0x58d84d))[_0x8786('0xb1')](handleError(_0x115504,null));};exports[_0x8786('0xb2')]=function(_0x447867,_0x486cdd){var _0x49e11f={'raw':![],'where':{'id':_0x447867['params']['id']}},_0x970bb={};_0x970bb['model']=_[_0x8786('0x37')](db[_0x8786('0x31')][_0x8786('0x32')]);_0x970bb[_0x8786('0x36')]=_[_0x8786('0x37')](_0x447867[_0x8786('0x36')]);_0x970bb['filters']=_[_0x8786('0x39')](_0x970bb['model'],_0x970bb[_0x8786('0x36')]);_0x49e11f[_0x8786('0x3b')]=_[_0x8786('0x39')](_0x970bb[_0x8786('0x35')],qs[_0x8786('0x3a')](_0x447867[_0x8786('0x36')][_0x8786('0x3a')]));_0x49e11f['attributes']=_0x49e11f[_0x8786('0x3b')][_0x8786('0x3c')]?_0x49e11f[_0x8786('0x3b')]:_0x970bb['model'];if(_0x447867[_0x8786('0x36')][_0x8786('0xb3')]){_0x49e11f[_0x8786('0xb4')]=[{'all':!![]}];}_0x49e11f=_['merge']({},_0x49e11f,_0x447867[_0x8786('0xb5')]);return db[_0x8786('0x31')][_0x8786('0x59')](_0x49e11f)[_0x8786('0x27')](handleEntityNotFound(_0x486cdd,null))['then'](respondWithResult(_0x486cdd,null))[_0x8786('0xb1')](handleError(_0x486cdd,null));};exports['create']=function(_0x4afffc,_0x5cb9e4){return db['WhatsappInteraction'][_0x8786('0xb6')](_0x4afffc[_0x8786('0x6d')],{})[_0x8786('0x27')](respondWithResult(_0x5cb9e4,0xc9))[_0x8786('0xb1')](handleError(_0x5cb9e4,null));};exports['update']=function(_0x3a83db,_0x3ee7e2){if(_0x3a83db[_0x8786('0x6d')]['id']){delete _0x3a83db[_0x8786('0x6d')]['id'];}return db[_0x8786('0x31')][_0x8786('0x59')]({'where':{'id':_0x3a83db[_0x8786('0xb7')]['id']}})[_0x8786('0x27')](handleEntityNotFound(_0x3ee7e2,null))[_0x8786('0x27')](saveUpdates(_0x3a83db[_0x8786('0x6d')],null))[_0x8786('0x27')](respondWithResult(_0x3ee7e2,null))['catch'](handleError(_0x3ee7e2,null));};exports['destroy']=function(_0x22c584,_0x17573c){return db[_0x8786('0x31')][_0x8786('0x59')]({'where':{'id':_0x22c584[_0x8786('0xb7')]['id']}})[_0x8786('0x27')](handleEntityNotFound(_0x17573c,null))[_0x8786('0x27')](removeEntity(_0x17573c,null))['catch'](handleError(_0x17573c,null));};exports[_0x8786('0xb8')]=function(_0x5ca61a,_0x2e43de){return db[_0x8786('0x31')][_0x8786('0xb8')]()['then'](respondWithResult(_0x2e43de,null))[_0x8786('0xb1')](handleError(_0x2e43de,null));};exports['addMessage']=function(_0xa841d7,_0x79dc31,_0x142565){return db[_0x8786('0xb9')][_0x8786('0x59')]({'where':{'id':_0xa841d7[_0x8786('0xb7')]['id']}})[_0x8786('0x27')](handleEntityNotFound(_0x79dc31,null))[_0x8786('0x27')](function(_0x27541d){if(_0x27541d){return _0x27541d[_0x8786('0xba')](_0xa841d7['body'][_0x8786('0xbb')],_[_0x8786('0xbc')](_0xa841d7[_0x8786('0x6d')],[_0x8786('0xbb'),'id'])||{});}})[_0x8786('0x27')](respondWithResult(_0x79dc31,null))[_0x8786('0xb1')](handleError(_0x79dc31,null));};exports['getMessages']=function(_0x31398f,_0x55e633,_0x1a5d30){var _0x3e45f8={'raw':![],'where':{}};var _0x346766={};var _0x48ed4a={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0x8786('0xbd')]({'where':{'id':_0x31398f[_0x8786('0xb7')]['id']}})[_0x8786('0x27')](handleEntityNotFound(_0x55e633,null))[_0x8786('0x27')](function(_0x5b62ad){if(_0x5b62ad){_0x346766['model']=_['keys'](db[_0x8786('0xb9')][_0x8786('0x32')]);_0x346766[_0x8786('0x36')]=_[_0x8786('0x37')](_0x31398f['query']);_0x346766[_0x8786('0x38')]=_[_0x8786('0x39')](_0x346766[_0x8786('0x35')],_0x346766['query']);_0x3e45f8[_0x8786('0x3b')]=_[_0x8786('0x39')](_0x346766[_0x8786('0x35')],qs[_0x8786('0x3a')](_0x31398f['query']['fields']));_0x3e45f8[_0x8786('0x3b')]=_0x3e45f8[_0x8786('0x3b')][_0x8786('0x3c')]?_0x3e45f8[_0x8786('0x3b')]:_0x346766[_0x8786('0x35')];if(!_0x31398f[_0x8786('0x36')][_0x8786('0x3d')](_0x8786('0x3e'))){_0x3e45f8[_0x8786('0x22')]=qs['limit'](_0x31398f[_0x8786('0x36')][_0x8786('0x22')]);_0x3e45f8[_0x8786('0x20')]=qs[_0x8786('0x20')](_0x31398f[_0x8786('0x36')][_0x8786('0x20')]);}_0x3e45f8['order']=qs[_0x8786('0x40')](_0x31398f[_0x8786('0x36')][_0x8786('0x40')]);_0x3e45f8[_0x8786('0x41')]=qs[_0x8786('0x38')](_[_0x8786('0x42')](_0x31398f[_0x8786('0x36')],_0x346766[_0x8786('0x38')]));_0x3e45f8[_0x8786('0x41')][_0x8786('0xae')]=_0x5b62ad['id'];if(_0x31398f[_0x8786('0x36')][_0x8786('0x7f')]){_0x3e45f8[_0x8786('0x41')]=_['merge'](_0x3e45f8[_0x8786('0x41')],{'$or':_[_0x8786('0x2c')](_0x3e45f8[_0x8786('0x3b')],function(_0x2c5739){var _0x2195ae={};_0x2195ae[_0x2c5739]={'$like':'%'+_0x31398f[_0x8786('0x36')][_0x8786('0x7f')]+'%'};return _0x2195ae;})});}if(_0x31398f[_0x8786('0x36')][_0x8786('0x77')]){var _0x507af0=_0x31398f[_0x8786('0x36')]['$gte']['split'](',');var _0x54be38={};_0x54be38[_0x507af0[0x0]]={'$gte':moment(_0x507af0[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3e45f8['where']=_[_0x8786('0x97')](_0x3e45f8[_0x8786('0x41')],_0x54be38);}_0x3e45f8=_[_0x8786('0x97')]({},_0x3e45f8,_0x31398f[_0x8786('0xb5')]);return db[_0x8786('0xb9')][_0x8786('0x23')]({'where':_0x3e45f8['where']})[_0x8786('0x27')](function(_0x26c5ee){_0x48ed4a[_0x8786('0x23')]=_0x26c5ee;if(_0x31398f[_0x8786('0x36')][_0x8786('0xb3')]){_0x3e45f8[_0x8786('0xb4')]=[{'all':!![]}];}return db[_0x8786('0xb9')][_0x8786('0xbe')](_0x3e45f8);})['then'](function(_0x50c230){_0x48ed4a['rows']=_0x50c230;return _0x48ed4a;});}})[_0x8786('0x27')](respondWithFilteredResult(_0x55e633,_0x3e45f8))[_0x8786('0xb1')](handleError(_0x55e633,null));};exports[_0x8786('0xbf')]=function(_0x1eeb73,_0x2b15c0,_0xbbb0b5){return db[_0x8786('0x31')][_0x8786('0x59')]({'where':{'id':_0x1eeb73['params']['id']}})[_0x8786('0x27')](handleEntityNotFound(_0x2b15c0,null))[_0x8786('0x27')](function(_0xef0eb){if(_0xef0eb){return _0xef0eb[_0x8786('0xc0')](_0x1eeb73[_0x8786('0x6d')][_0x8786('0xbb')],_[_0x8786('0xbc')](_0x1eeb73[_0x8786('0x6d')],['ids','id'])||{})[_0x8786('0xc1')](function(){return db[_0x8786('0x68')][_0x8786('0xbe')]({'attributes':['id','name','color'],'where':{'id':_0x1eeb73['body'][_0x8786('0xbb')]}});})[_0x8786('0x27')](function(_0x12a996){socket['emit']('whatsappInteractionTags:save',{'id':Number(_0x1eeb73[_0x8786('0xb7')]['id']),'tags':_0x12a996||[]});return{'id':Number(_0x1eeb73[_0x8786('0xb7')]['id']),'tags':_0x12a996||[]};});}})[_0x8786('0x27')](respondWithResult(_0x2b15c0,null))[_0x8786('0xb1')](handleError(_0x2b15c0,null));};exports[_0x8786('0xc2')]=function(_0xbd7f2,_0x39e2e5,_0x5d93b3){return db[_0x8786('0x31')][_0x8786('0x59')]({'where':{'id':_0xbd7f2[_0x8786('0xb7')]['id']}})['then'](handleEntityNotFound(_0x39e2e5,null))[_0x8786('0x27')](function(_0x40ed5e){if(_0x40ed5e){return _0x40ed5e[_0x8786('0xc2')](_0xbd7f2[_0x8786('0x36')][_0x8786('0xbb')]);}})['then'](respondWithStatusCode(_0x39e2e5,null))[_0x8786('0xb1')](handleError(_0x39e2e5,null));};exports['download']=function(_0x335d11,_0x41e694){var _0x88084b=moment()[_0x8786('0xc3')]()['toString']();var _0x40008e=path['join'](config['root'],_0x8786('0xc4'),'files',_0x8786('0xc5'));var _0x24b095=path[_0x8786('0xc6')](config['root'],_0x8786('0xc4'),_0x8786('0xc7'),_0x8786('0xc8'));var _0xb1cd7b=path[_0x8786('0xc6')](_0x40008e,_0x88084b);var _0x14af60=util[_0x8786('0xc9')](_0x8786('0xca'),_0x335d11[_0x8786('0xb7')]['id'],_0x88084b);var _0x3a7406=path[_0x8786('0xc6')](_0x40008e,_0x14af60);var _0x65ee24=[];_0x65ee24[_0x8786('0x2f')]({'model':db[_0x8786('0x6a')],'as':_0x8786('0x6a'),'attributes':['id',_0x8786('0xcb')],'raw':!![]});_0x65ee24[_0x8786('0x2f')]({'model':db[_0x8786('0xcc')],'as':_0x8786('0x5d'),'attributes':['id',_0x8786('0xcd'),_0x8786('0xce')],'raw':!![]});if(_0x335d11[_0x8786('0x36')][_0x8786('0xc8')]){_0x65ee24[_0x8786('0x2f')]({'model':db['Attachment'],'as':_0x8786('0xcf'),'raw':!![]});}var _0x48e93e=[{'model':db['WhatsappMessage'],'as':_0x8786('0xd0'),'attributes':['id',_0x8786('0x6d'),_0x8786('0x75'),_0x8786('0xd1'),'secret','read'],'include':_0x65ee24}];_0x48e93e[_0x8786('0x2f')]({'model':db[_0x8786('0xd2')],'as':_0x8786('0xd3'),'attributes':['id',_0x8786('0x29')]});_0x48e93e[_0x8786('0x2f')]({'model':db[_0x8786('0x6a')],'as':_0x8786('0xd4'),'attributes':['id',_0x8786('0xcb')]});return db['WhatsappInteraction'][_0x8786('0x59')]({'where':{'id':_0x335d11[_0x8786('0xb7')]['id']},'include':_0x48e93e})[_0x8786('0x27')](handleEntityNotFound(_0x41e694,null))[_0x8786('0x27')](function(_0x21f37e){if(_0x21f37e){var _0x3c3be8=_0x21f37e[_0x8786('0xd5')]({'plain':!![]});fs[_0x8786('0xd6')](_0xb1cd7b);var _0x188c14={'channel':_0x8786('0xd7'),'account':_0x3c3be8['Account'][_0x8786('0x29')],'agent':_0x3c3be8[_0x8786('0xd4')]?_0x3c3be8[_0x8786('0xd4')]['fullname']:_0x8786('0xd8'),'createdAt':moment(_0x3c3be8[_0x8786('0x75')])[_0x8786('0xc9')](_0x8786('0xd9'))[_0x8786('0x95')](),'closedAt':_0x3c3be8[_0x8786('0xda')]?moment(_0x3c3be8[_0x8786('0xdb')])[_0x8786('0xc9')](_0x8786('0xd9'))[_0x8786('0x95')]():'','disposition':_0x3c3be8[_0x8786('0xdc')],'messages':_(_0x3c3be8[_0x8786('0xd0')])[_0x8786('0x7f')]({'secret':![]})[_0x8786('0x2c')](function(_0x320f4d){if(_0x320f4d[_0x8786('0xcf')]){var _0x3d900a=path['join'](_0x24b095,_0x320f4d[_0x8786('0xcf')][_0x8786('0xdd')]);if(fs['existsSync'](_0x3d900a)){fs[_0x8786('0xde')](_0x3d900a)[_0x8786('0xdf')](fs[_0x8786('0xe0')](path[_0x8786('0xc6')](_0xb1cd7b,_0x320f4d[_0x8786('0xcf')]['basename'])));}}return{'date':moment(_0x320f4d['createdAt'])[_0x8786('0xc9')](_0x8786('0xd9'))[_0x8786('0x95')](),'sender':_0x320f4d['direction']===_0x8786('0xe1')?_0x320f4d['User']?_0x320f4d[_0x8786('0x6a')][_0x8786('0xcb')]:_0x8786('0xe2'):_0x320f4d[_0x8786('0x5d')]['firstName']+(_0x320f4d['Contact'][_0x8786('0xce')]?'\x20'+_0x320f4d['Contact']['lastName']:''),'body':_0x320f4d[_0x8786('0xcf')]?_0x320f4d['Attachment'][_0x8786('0xdd')]:_0x320f4d[_0x8786('0x6d')],'direction':_0x320f4d[_0x8786('0xd1')]===_0x8786('0xe1')?'A':'C','secret':_0x320f4d['secret'],'read':_0x320f4d[_0x8786('0x7a')],'attachment':_0x320f4d[_0x8786('0xcf')]};})[_0x8786('0x5a')]()};return ejs[_0x8786('0xe3')](path[_0x8786('0xc6')](config[_0x8786('0xe4')],_0x8786('0xc4'),'views','downloadInteraction.ejs'),{'interaction':_0x188c14})[_0x8786('0x27')](function(_0x4d97b2){var _0x3ad009=path['join'](_0xb1cd7b,_0x8786('0xe5')+_0x3c3be8['id']+'-'+_0x88084b+'.pdf');var _0x1adca6={'path':_0x3ad009,'channel':'Whatsapp','interactionId':_0x3c3be8['id']};return pdf[_0x8786('0xe6')](_0x4d97b2,_0x1adca6);})[_0x8786('0x27')](function(){return new BPromise(function(_0x3feeb4,_0x2e2bfd){zipdir(_0xb1cd7b,{'saveTo':_0x3a7406},function(_0x23846f,_0x39b8a2){if(_0x23846f)return _0x2e2bfd(_0x23846f);return _0x3feeb4(_0x39b8a2);});})[_0x8786('0x27')](function(){return new BPromise(function(_0x172d4a,_0x115be0){rimraf(_0xb1cd7b,function(_0x151739){if(_0x151739)_0x115be0(_0x151739);return _0x172d4a();});});})[_0x8786('0x27')](function(){return _0x41e694['download'](_0x3a7406,_0x14af60,function(_0x1ad3ea){if(_0x1ad3ea){console[_0x8786('0xe7')](_0x8786('0xe8'),_0x1ad3ea);}else{fs['unlinkSync'](_0x3a7406);}});});});}else{return _0x41e694['sendStatus'](0xc8);}})['catch'](handleError(_0x41e694,null));};
\ No newline at end of file
+var _0xf6c6=['i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','show','params','rawAttributes','includeAll','include','merge','options','create','body','describe','addMessage','WhatsappMessage','ids','omit','hasOwnProperty','nolimit','$gte','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','files','server','attachments','transcript-%d-%s.zip','User','CmContact','Contact','firstName','lastName','Attachment','Messages','direction','secret','WhatsappAccount','Owner','get','mkdirSync','Whatsapp','Account','N.A.','closed','closedAt','disposition','basename','createReadStream','pipe','createWriteStream','System','renderFile','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','name','send','map','fullname','TagIds','split','forEach','push','catch','index','WhatsappInteraction','fieldName','type','keys','filters','intersection','model','attributes','fields','query','length','order','sort','pick','select','field','color','tools_tags','u.id','u.fullname','from','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_messages','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','UserId','some','compact','isEmpty','WhatsappAccountId','where','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','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)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve'];(function(_0x156022,_0x1e0a87){var _0x4eb4c2=function(_0x1aca63){while(--_0x1aca63){_0x156022['push'](_0x156022['shift']());}};_0x4eb4c2(++_0x1e0a87);}(_0xf6c6,0x154));var _0x6f6c=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0xf6c6[_0x2adbeb];return _0x5e18a6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6f6c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6f6c('0x1'));var rp=require(_0x6f6c('0x2'));var moment=require(_0x6f6c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6f6c('0x4'));var util=require(_0x6f6c('0x5'));var path=require(_0x6f6c('0x6'));var sox=require('sox');var csv=require(_0x6f6c('0x7'));var ejs=require(_0x6f6c('0x8'));var fs=require('fs');var fs_extra=require(_0x6f6c('0x9'));var _=require(_0x6f6c('0xa'));var squel=require(_0x6f6c('0xb'));var crypto=require(_0x6f6c('0xc'));var jsforce=require(_0x6f6c('0xd'));var deskjs=require(_0x6f6c('0xe'));var toCsv=require(_0x6f6c('0x7'));var querystring=require(_0x6f6c('0xf'));var Papa=require(_0x6f6c('0x10'));var Redis=require(_0x6f6c('0x11'));var authService=require(_0x6f6c('0x12'));var qs=require(_0x6f6c('0x13'));var as=require(_0x6f6c('0x14'));var pdf=require(_0x6f6c('0x15'));var hardwareService=require(_0x6f6c('0x16'));var logger=require(_0x6f6c('0x17'))('api');var utils=require(_0x6f6c('0x18'));var config=require(_0x6f6c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x6f6c('0x1a'))['db'];config[_0x6f6c('0x1b')]=_['defaults'](config['redis'],{'host':_0x6f6c('0x1c'),'port':0x18eb});var socket=require(_0x6f6c('0x1d'))(new Redis(config[_0x6f6c('0x1b')]));require(_0x6f6c('0x1e'))['register'](socket);function respondWithStatusCode(_0x56e278,_0x16f49e){_0x16f49e=_0x16f49e||0xcc;return function(_0x357dbd){if(_0x357dbd){return _0x56e278[_0x6f6c('0x1f')](_0x16f49e);}return _0x56e278[_0x6f6c('0x20')](_0x16f49e)[_0x6f6c('0x21')]();};}function respondWithResult(_0x105525,_0x2fb74d){_0x2fb74d=_0x2fb74d||0xc8;return function(_0x282b7f){if(_0x282b7f){return _0x105525[_0x6f6c('0x20')](_0x2fb74d)[_0x6f6c('0x22')](_0x282b7f);}};}function respondWithFilteredResult(_0xca6404,_0x57da4e){return function(_0x2d7a4b){if(_0x2d7a4b){var _0x427db3=typeof _0x57da4e['offset']===_0x6f6c('0x23')&&typeof _0x57da4e[_0x6f6c('0x24')]===_0x6f6c('0x23');var _0x251b93=_0x2d7a4b[_0x6f6c('0x25')];var _0x3d98cc=_0x427db3?0x0:_0x57da4e['offset'];var _0x56f536=_0x427db3?_0x2d7a4b[_0x6f6c('0x25')]:_0x57da4e[_0x6f6c('0x26')]+_0x57da4e[_0x6f6c('0x24')];var _0x306f9c;if(_0x56f536>=_0x251b93){_0x56f536=_0x251b93;_0x306f9c=0xc8;}else{_0x306f9c=0xce;}_0xca6404[_0x6f6c('0x20')](_0x306f9c);return _0xca6404[_0x6f6c('0x27')](_0x6f6c('0x28'),_0x3d98cc+'-'+_0x56f536+'/'+_0x251b93)['json'](_0x2d7a4b);}return null;};}function patchUpdates(_0x277821){return function(_0x2f7f14){try{jsonpatch[_0x6f6c('0x29')](_0x2f7f14,_0x277821,!![]);}catch(_0x4e8ce5){return BPromise[_0x6f6c('0x2a')](_0x4e8ce5);}return _0x2f7f14['save']();};}function saveUpdates(_0x4e9258,_0x3828d3){return function(_0x2a1ebe){if(_0x2a1ebe){return _0x2a1ebe[_0x6f6c('0x2b')](_0x4e9258)[_0x6f6c('0x2c')](function(_0x25863f){return _0x25863f;});}return null;};}function removeEntity(_0x5c0adf,_0x4bbf82){return function(_0x3aefbf){if(_0x3aefbf){return _0x3aefbf[_0x6f6c('0x2d')]()[_0x6f6c('0x2c')](function(){_0x5c0adf[_0x6f6c('0x20')](0xcc)[_0x6f6c('0x21')]();});}};}function handleEntityNotFound(_0x348328,_0x2c344f){return function(_0x22ef30){if(!_0x22ef30){_0x348328['sendStatus'](0x194);}return _0x22ef30;};}function handleError(_0x117955,_0x26c6a1){_0x26c6a1=_0x26c6a1||0x1f4;return function(_0x81501d){logger[_0x6f6c('0x2e')](_0x81501d['stack']);if(_0x81501d[_0x6f6c('0x2f')]){delete _0x81501d[_0x6f6c('0x2f')];}_0x117955[_0x6f6c('0x20')](_0x26c6a1)[_0x6f6c('0x30')](_0x81501d);};}function getInteractionUsers(_0x1b34e8,_0xca0504){return new BPromise(function(_0x61795c,_0x490548){try{if(_0xca0504[_0x1b34e8['id']]){_0x1b34e8['Users']=_[_0x6f6c('0x31')](_0xca0504[_0x1b34e8['id']],function(_0x4abfa0){return{'id':_0x4abfa0['id'],'fullname':_0x4abfa0[_0x6f6c('0x32')]};});}}catch(_0x1cc3bd){_0x490548(_0x1cc3bd);}_0x61795c(_0x1b34e8);});}function getInteractionTags(_0x52733a,_0x3e0da6){return new BPromise(function(_0x3c2b41,_0x46e6b4){try{if(_0x52733a['TagIds']){_0x52733a['Tags']=[];_0x52733a[_0x6f6c('0x33')][_0x6f6c('0x34')](',')[_0x6f6c('0x35')](function(_0xf48611){_0x52733a['Tags'][_0x6f6c('0x36')](_0x3e0da6[_0xf48611]);});}delete _0x52733a[_0x6f6c('0x33')];}catch(_0x3e032b){_0x46e6b4(_0x3e032b);}_0x3c2b41(_0x52733a);});}function updateWhatsappInteraction(_0x1ba993,_0x45aebf,_0x239de9){return new BPromise(function(_0x26e51b,_0x30b262){return getInteractionUsers(_0x1ba993,_0x239de9)[_0x6f6c('0x2c')](function(_0x58bb6c){return getInteractionTags(_0x58bb6c,_0x45aebf);})[_0x6f6c('0x2c')](function(_0x5ecea1){_0x26e51b(_0x5ecea1);})[_0x6f6c('0x37')](function(_0x461b18){_0x30b262(_0x461b18);});});}exports[_0x6f6c('0x38')]=function(_0x575ed3,_0x293702){var _0x2453eb={},_0x2b71e7={},_0x3e1424={'count':0x0,'rows':[]};var _0x4a4265=_[_0x6f6c('0x31')](db[_0x6f6c('0x39')]['rawAttributes'],function(_0x25e1f8){return{'name':_0x25e1f8[_0x6f6c('0x3a')],'type':_0x25e1f8[_0x6f6c('0x3b')]['key']};});_0x2b71e7['model']=_[_0x6f6c('0x31')](_0x4a4265,_0x6f6c('0x2f'));_0x2b71e7['query']=_[_0x6f6c('0x3c')](_0x575ed3['query']);_0x2b71e7[_0x6f6c('0x3d')]=_[_0x6f6c('0x3e')](_0x2b71e7[_0x6f6c('0x3f')],_0x2b71e7['query']);_0x2453eb[_0x6f6c('0x40')]=_[_0x6f6c('0x3e')](_0x2b71e7[_0x6f6c('0x3f')],qs[_0x6f6c('0x41')](_0x575ed3[_0x6f6c('0x42')][_0x6f6c('0x41')]));_0x2453eb[_0x6f6c('0x40')]=_0x2453eb[_0x6f6c('0x40')][_0x6f6c('0x43')]?_0x2453eb[_0x6f6c('0x40')]:_0x2b71e7['model'];if(!_0x575ed3[_0x6f6c('0x42')]['hasOwnProperty']('nolimit')){_0x2453eb[_0x6f6c('0x24')]=qs[_0x6f6c('0x24')](_0x575ed3['query'][_0x6f6c('0x24')]);_0x2453eb[_0x6f6c('0x26')]=qs[_0x6f6c('0x26')](_0x575ed3[_0x6f6c('0x42')]['offset']);}_0x2453eb[_0x6f6c('0x44')]=qs['sort'](_0x575ed3[_0x6f6c('0x42')][_0x6f6c('0x45')]);_0x2453eb['where']=qs[_0x6f6c('0x3d')](_[_0x6f6c('0x46')](_0x575ed3[_0x6f6c('0x42')],_0x2b71e7['filters']),_0x4a4265);var _0x5e3c3a=[];var _0x55f56d=squel[_0x6f6c('0x47')]()[_0x6f6c('0x48')]('id')[_0x6f6c('0x48')](_0x6f6c('0x2f'))[_0x6f6c('0x48')](_0x6f6c('0x49'))['from'](_0x6f6c('0x4a'));var _0x483593=squel['select']()[_0x6f6c('0x48')](_0x6f6c('0x4b'))['field'](_0x6f6c('0x4c'))[_0x6f6c('0x48')]('ui.WhatsappInteractionId')[_0x6f6c('0x4d')](_0x6f6c('0x4e'),'ui')[_0x6f6c('0x4f')](_0x6f6c('0x50'),'u',_0x6f6c('0x51'));var _0x1414f7=squel[_0x6f6c('0x47')]()[_0x6f6c('0x4d')](_0x6f6c('0x52'),'i')[_0x6f6c('0x4f')](_0x6f6c('0x53'),'c',_0x6f6c('0x54'))[_0x6f6c('0x4f')](_0x6f6c('0x50'),'o',_0x6f6c('0x55'))[_0x6f6c('0x4f')]('whatsapp_accounts','a','a.id\x20=\x20i.WhatsappAccountId')[_0x6f6c('0x4f')](_0x6f6c('0x56'),'me','me.WhatsappInteractionId\x20=\x20i.id')[_0x6f6c('0x4f')](_0x6f6c('0x57'),'it',_0x6f6c('0x58'))['left_join'](_0x6f6c('0x4a'),'t',_0x6f6c('0x59'));var _0x131b2c=squel[_0x6f6c('0x5a')]();var _0x4b682a=[];var _0x4dee76=squel['expr']();var _0x1cea8d;if(_0x575ed3[_0x6f6c('0x42')][_0x6f6c('0x5b')]){_0x1cea8d=as[_0x6f6c('0x5c')](_0x575ed3[_0x6f6c('0x42')][_0x6f6c('0x5b')]);var _0x3223fe=_0x1cea8d[_0x6f6c('0x5d')];for(var _0x119fba=0x0;_0x119fba<_0x1cea8d[_0x6f6c('0x5e')][_0x6f6c('0x43')];_0x119fba++){var _0x36782a=_0x1cea8d[_0x6f6c('0x5e')][_0x119fba];var _0x1e5395='i';var _0xa73889=_['find'](_0x4a4265,[_0x6f6c('0x2f'),_0x36782a[_0x6f6c('0x48')]]);if(!_0xa73889){switch(_0x36782a[_0x6f6c('0x48')]){case _0x6f6c('0x5f'):if(_0x36782a[_0x6f6c('0x60')]==0x1){_0x1414f7[_0x6f6c('0x61')]('`'+_0x36782a['field']+_0x6f6c('0x62'));}else{_0x1414f7[_0x6f6c('0x61')]('`'+_0x36782a[_0x6f6c('0x48')]+'`\x20>\x200');}break;case'Contact':if(_0x36782a[_0x6f6c('0x63')]===_0x6f6c('0x64')){if(_0x36782a[_0x6f6c('0x60')]['split']('\x20')[_0x6f6c('0x43')]>0x1){_0x131b2c[_0x3223fe](_0x6f6c('0x65'),qs['getFullTextValue'](_0x36782a[_0x6f6c('0x60')]),null);}else{var _0x34c0b4='%'+_0x36782a[_0x6f6c('0x60')]+'%';_0x131b2c[_0x3223fe](_0x6f6c('0x66'),_0x34c0b4,_0x34c0b4,_0x34c0b4);}}else{_0xa73889=_[_0x6f6c('0x67')](_0x4a4265,[_0x6f6c('0x2f'),_0x6f6c('0x68')]);_0x36782a[_0x6f6c('0x48')]=_0x6f6c('0x68');_0x322239=as[_0x6f6c('0x69')](_0x1e5395,_0xa73889[_0x6f6c('0x3b')],_0x36782a);_0x131b2c[_0x3223fe](_0x322239[_0x6f6c('0x6a')],_0x322239['value'][_0x6f6c('0x6b')],_0x322239[_0x6f6c('0x60')][_0x6f6c('0x21')]);}break;case _0x6f6c('0x6c'):var _0x3f4c1f=_0x36782a[_0x6f6c('0x60')][_0x6f6c('0x34')](',')['map'](function(_0x359a57){return Number(_0x359a57);});_0x3f4c1f[_0x6f6c('0x35')](function(_0x3cfd4d){_0x4dee76['or'](_0x6f6c('0x6d'),'%,'+_0x3cfd4d+',%');});_0x4b682a=_['union'](_0x4b682a,_0x3f4c1f);break;case'User':if(_0x36782a[_0x6f6c('0x63')]===_0x6f6c('0x64')){_0x131b2c[_0x3223fe]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x36782a['value']+'%',null);}else{_0xa73889=_[_0x6f6c('0x67')](_0x4a4265,['name',_0x6f6c('0x6e')]);_0x36782a[_0x6f6c('0x48')]=_0x6f6c('0x6e');_0x322239=as[_0x6f6c('0x69')](_0x1e5395,_0xa73889['type'],_0x36782a);_0x131b2c[_0x3223fe](_0x322239[_0x6f6c('0x6a')],_0x322239[_0x6f6c('0x60')][_0x6f6c('0x6b')],_0x322239['value']['end']);}break;case'body':_0x322239=as[_0x6f6c('0x69')]('me',null,_0x36782a);_0x131b2c[_0x3223fe](_0x322239['text'],_0x322239['value']['start'],_0x322239[_0x6f6c('0x60')][_0x6f6c('0x21')]);break;}}else{var _0x322239=as[_0x6f6c('0x69')](_0x1e5395,_0xa73889[_0x6f6c('0x3b')],_0x36782a);_0x131b2c[_0x3223fe](_0x322239[_0x6f6c('0x6a')],_0x322239[_0x6f6c('0x60')]['start'],_0x322239[_0x6f6c('0x60')][_0x6f6c('0x21')]);}}}else{var _0x35847c=_(_0x575ed3['query'])[_0x6f6c('0x3c')]()[_0x6f6c('0x31')](function(_0x2a845a){return _[_0x6f6c('0x6f')](_0x4a4265,[_0x6f6c('0x2f'),_0x2a845a])?_0x2a845a:undefined;})[_0x6f6c('0x70')]()[_0x6f6c('0x60')]();if(!_[_0x6f6c('0x71')](_0x35847c)){_0x35847c[_0x6f6c('0x35')](function(_0x429b29){if(_0x429b29===_0x6f6c('0x72')){_0x1414f7[_0x6f6c('0x73')](_0x6f6c('0x74'),[][_0x6f6c('0x75')](_0x575ed3['query'][_0x429b29]));}else if(_0x429b29===_0x6f6c('0x76')){var _0x570dc8=JSON[_0x6f6c('0x77')](_0x575ed3['query'][_0x429b29])['$gte'];var _0x3c57f4=JSON[_0x6f6c('0x77')](_0x575ed3[_0x6f6c('0x42')][_0x429b29])['$lte'];_0x1414f7['where'](_0x6f6c('0x78'),_0x570dc8,_0x3c57f4);}else{if(_0x575ed3[_0x6f6c('0x42')][_0x429b29]===_0x6f6c('0x79')){_0x1414f7[_0x6f6c('0x73')]('i.'+_0x429b29+_0x6f6c('0x7a'));}else{_0x1414f7['where']('i.'+_0x429b29+_0x6f6c('0x7b'),_0x575ed3[_0x6f6c('0x42')][_0x429b29]);}}});}if(_0x575ed3[_0x6f6c('0x42')][_0x6f6c('0x7c')]){if(_0x575ed3['query']['read']==0x1){_0x1414f7[_0x6f6c('0x61')]('`unreadMessages`\x20=\x200');}else{_0x1414f7[_0x6f6c('0x61')](_0x6f6c('0x7d'));}}if(_0x575ed3[_0x6f6c('0x42')][_0x6f6c('0x7e')]){_0x4b682a=_[_0x6f6c('0x7f')](_0x575ed3[_0x6f6c('0x42')][_0x6f6c('0x7e')])?_0x575ed3[_0x6f6c('0x42')][_0x6f6c('0x7e')]:new Array(_0x575ed3[_0x6f6c('0x42')][_0x6f6c('0x7e')]);_0x4b682a['forEach'](function(_0xfc735d){_0x4dee76['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xfc735d+',%');});}if(_0x575ed3[_0x6f6c('0x42')][_0x6f6c('0x80')]){var _0x11b270=_0x575ed3[_0x6f6c('0x42')][_0x6f6c('0x80')][_0x6f6c('0x81')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x11b270)){_0x131b2c['or'](_0x6f6c('0x82'),_0x11b270+'%')['or'](_0x6f6c('0x83'),_0x11b270+'%');}else{_0x131b2c['or'](_0x6f6c('0x84'),qs[_0x6f6c('0x85')](_0x11b270))['or'](_0x6f6c('0x86'),_0x11b270+'%');}}}_0x1414f7[_0x6f6c('0x73')](_0x131b2c);_0x1414f7[_0x6f6c('0x87')](_0x6f6c('0x88'));var _0x54a321={'type':db[_0x6f6c('0x89')][_0x6f6c('0x8a')][_0x6f6c('0x8b')],'raw':!![]};var _0x36d245=_0x1414f7[_0x6f6c('0x8c')]();_0x36d245[_0x6f6c('0x48')]('i.id');_0x36d245[_0x6f6c('0x48')](_0x6f6c('0x8d'),_0x6f6c('0x5f'));if(_0x2453eb[_0x6f6c('0x44')]){_0x2453eb[_0x6f6c('0x44')][_0x6f6c('0x35')](function(_0x239068){var _0x3a85e9=_0x239068[0x0]===_0x6f6c('0x8e')?_0x239068[0x0]:'i.'+_0x239068[0x0];_0x1414f7['order'](_0x3a85e9,_0x239068[0x1]===_0x6f6c('0x8f')?![]:!![]);});}if(!_[_0x6f6c('0x71')](_0x4b682a)){_0x1414f7[_0x6f6c('0x61')](_0x4dee76);_0x36d245[_0x6f6c('0x73')](_0x6f6c('0x90'),_0x4b682a);}BPromise[_0x6f6c('0x91')]()[_0x6f6c('0x2c')](function(){if(!_0x1cea8d){if(_0x575ed3[_0x6f6c('0x42')]['WhatsappAccountId'])return;_0x36d245[_0x6f6c('0x73')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x1414f7[_0x6f6c('0x73')](_0x6f6c('0x92'));return;}if(_0x575ed3[_0x6f6c('0x93')][_0x6f6c('0x94')]!==_0x6f6c('0x95'))return;return _0x575ed3[_0x6f6c('0x93')][_0x6f6c('0x96')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5eb824){if(_[_0x6f6c('0x71')](_0x5eb824)){_0x36d245[_0x6f6c('0x73')](_0x6f6c('0x97'));_0x1414f7[_0x6f6c('0x73')](_0x6f6c('0x97'));}else{_0x36d245['where'](_0x6f6c('0x74'),_[_0x6f6c('0x31')](_0x5eb824,'id'));_0x1414f7['where'](_0x6f6c('0x74'),_[_0x6f6c('0x31')](_0x5eb824,'id'));}});})['then'](function(){if(_0x575ed3[_0x6f6c('0x93')][_0x6f6c('0x94')]==='agent'&&!_0x1cea8d&&!_0x575ed3['query']['WhatsappAccountId'])return[];return db[_0x6f6c('0x98')][_0x6f6c('0x42')](_0x36d245['toString'](),_0x54a321);})[_0x6f6c('0x2c')](function(_0x22bf19){_0x3e1424[_0x6f6c('0x25')]=_0x22bf19[_0x6f6c('0x43')];if(_0x3e1424[_0x6f6c('0x25')]===0x0)return[];return db['sequelize'][_0x6f6c('0x42')](_0x55f56d[_0x6f6c('0x99')](),_0x54a321)[_0x6f6c('0x2c')](function(_0x512e25){_0x5e3c3a=_[_0x6f6c('0x9a')](_0x512e25,'id');_0x54a321=_['merge'](_0x54a321,{'model':db[_0x6f6c('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x575ed3['query']['fields']){_0x2453eb['attributes']['forEach'](function(_0x3e23e5){_0x1414f7[_0x6f6c('0x48')]('i.'+_0x3e23e5);});}else{_0x1414f7[_0x6f6c('0x48')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x6f6c('0x5f'));_0x1414f7[_0x6f6c('0x48')](_0x6f6c('0x9b'),_0x6f6c('0x9c'));_0x1414f7[_0x6f6c('0x48')](_0x6f6c('0x9d'),_0x6f6c('0x9e'));_0x1414f7[_0x6f6c('0x48')](_0x6f6c('0x9f'),'contactName');_0x1414f7[_0x6f6c('0x48')](_0x6f6c('0xa0'));_0x1414f7['field'](_0x6f6c('0xa1'),'Contact.firstName');_0x1414f7[_0x6f6c('0x48')](_0x6f6c('0xa2'),'Contact.lastName');_0x1414f7['field'](_0x6f6c('0xa3'),_0x6f6c('0xa4'));_0x1414f7['field'](_0x6f6c('0xa5'),_0x6f6c('0xa6'));_0x1414f7[_0x6f6c('0x48')](_0x6f6c('0xa7'),_0x6f6c('0xa8'));_0x1414f7[_0x6f6c('0x48')](_0x6f6c('0xa9'),_0x6f6c('0xaa'));_0x1414f7[_0x6f6c('0x48')]('o.fullname',_0x6f6c('0xab'));_0x1414f7[_0x6f6c('0x48')](_0x6f6c('0xac'),_0x6f6c('0xad'));_0x1414f7[_0x6f6c('0x48')](_0x6f6c('0xae'),_0x6f6c('0x33'));}if(_0x2453eb[_0x6f6c('0x24')])_0x1414f7[_0x6f6c('0x24')](_0x2453eb[_0x6f6c('0x24')]);if(_0x2453eb[_0x6f6c('0x26')])_0x1414f7['offset'](_0x2453eb['offset']);return db['sequelize'][_0x6f6c('0x42')](_0x1414f7[_0x6f6c('0x99')](),_0x54a321);})[_0x6f6c('0x2c')](function(_0x1cfdc2){if(_0x1cfdc2[_0x6f6c('0x43')]>0x0)_0x483593[_0x6f6c('0x73')](_0x6f6c('0xaf'),_[_0x6f6c('0x31')](_0x1cfdc2,'id'));return db[_0x6f6c('0x98')][_0x6f6c('0x42')](_0x483593[_0x6f6c('0x99')](),_0x54a321)[_0x6f6c('0x2c')](function(_0x1c7644){var _0x1c7f06=_[_0x6f6c('0xb0')](_0x1c7644,_0x6f6c('0xb1'));var _0x3a4fe6=[];_0x1cfdc2[_0x6f6c('0x35')](function(_0x53007b){_0x3a4fe6[_0x6f6c('0x36')](updateWhatsappInteraction(_0x53007b,_0x5e3c3a,_0x1c7f06));});return BPromise[_0x6f6c('0xb2')](_0x3a4fe6);});});})['then'](function(_0x406af6){_0x3e1424[_0x6f6c('0xb3')]=_0x406af6;return _0x3e1424;})[_0x6f6c('0x2c')](respondWithFilteredResult(_0x293702,_0x2453eb))[_0x6f6c('0x37')](handleError(_0x293702,null));};exports[_0x6f6c('0xb4')]=function(_0x3b4706,_0xc691c4){var _0x1ae4ad={'raw':![],'where':{'id':_0x3b4706[_0x6f6c('0xb5')]['id']}},_0x2fd4e3={};_0x2fd4e3[_0x6f6c('0x3f')]=_[_0x6f6c('0x3c')](db[_0x6f6c('0x39')][_0x6f6c('0xb6')]);_0x2fd4e3['query']=_['keys'](_0x3b4706[_0x6f6c('0x42')]);_0x2fd4e3[_0x6f6c('0x3d')]=_[_0x6f6c('0x3e')](_0x2fd4e3[_0x6f6c('0x3f')],_0x2fd4e3[_0x6f6c('0x42')]);_0x1ae4ad[_0x6f6c('0x40')]=_[_0x6f6c('0x3e')](_0x2fd4e3[_0x6f6c('0x3f')],qs[_0x6f6c('0x41')](_0x3b4706[_0x6f6c('0x42')][_0x6f6c('0x41')]));_0x1ae4ad[_0x6f6c('0x40')]=_0x1ae4ad[_0x6f6c('0x40')][_0x6f6c('0x43')]?_0x1ae4ad[_0x6f6c('0x40')]:_0x2fd4e3['model'];if(_0x3b4706[_0x6f6c('0x42')][_0x6f6c('0xb7')]){_0x1ae4ad[_0x6f6c('0xb8')]=[{'all':!![]}];}_0x1ae4ad=_[_0x6f6c('0xb9')]({},_0x1ae4ad,_0x3b4706[_0x6f6c('0xba')]);return db[_0x6f6c('0x39')][_0x6f6c('0x67')](_0x1ae4ad)[_0x6f6c('0x2c')](handleEntityNotFound(_0xc691c4,null))['then'](respondWithResult(_0xc691c4,null))['catch'](handleError(_0xc691c4,null));};exports[_0x6f6c('0xbb')]=function(_0x5da23c,_0x8fc481){return db['WhatsappInteraction']['create'](_0x5da23c['body'],{})['then'](respondWithResult(_0x8fc481,0xc9))[_0x6f6c('0x37')](handleError(_0x8fc481,null));};exports[_0x6f6c('0x2b')]=function(_0x41e580,_0x5c7621){if(_0x41e580[_0x6f6c('0xbc')]['id']){delete _0x41e580['body']['id'];}return db['WhatsappInteraction'][_0x6f6c('0x67')]({'where':{'id':_0x41e580['params']['id']}})[_0x6f6c('0x2c')](handleEntityNotFound(_0x5c7621,null))[_0x6f6c('0x2c')](saveUpdates(_0x41e580['body'],null))[_0x6f6c('0x2c')](respondWithResult(_0x5c7621,null))['catch'](handleError(_0x5c7621,null));};exports[_0x6f6c('0x2d')]=function(_0x5c99f4,_0x2a462c){return db[_0x6f6c('0x39')]['find']({'where':{'id':_0x5c99f4['params']['id']}})[_0x6f6c('0x2c')](handleEntityNotFound(_0x2a462c,null))[_0x6f6c('0x2c')](removeEntity(_0x2a462c,null))[_0x6f6c('0x37')](handleError(_0x2a462c,null));};exports['describe']=function(_0x77bcc5,_0x351154){return db['WhatsappInteraction'][_0x6f6c('0xbd')]()[_0x6f6c('0x2c')](respondWithResult(_0x351154,null))[_0x6f6c('0x37')](handleError(_0x351154,null));};exports[_0x6f6c('0xbe')]=function(_0x22f3fe,_0x4a3e54,_0x29e58d){return db[_0x6f6c('0xbf')][_0x6f6c('0x67')]({'where':{'id':_0x22f3fe[_0x6f6c('0xb5')]['id']}})[_0x6f6c('0x2c')](handleEntityNotFound(_0x4a3e54,null))[_0x6f6c('0x2c')](function(_0x519695){if(_0x519695){return _0x519695[_0x6f6c('0xbe')](_0x22f3fe[_0x6f6c('0xbc')][_0x6f6c('0xc0')],_[_0x6f6c('0xc1')](_0x22f3fe['body'],[_0x6f6c('0xc0'),'id'])||{});}})['then'](respondWithResult(_0x4a3e54,null))['catch'](handleError(_0x4a3e54,null));};exports['getMessages']=function(_0x554d97,_0x131193,_0x3081f4){var _0x419c99={'raw':![],'where':{}};var _0x201cbc={};var _0x2f5295={'count':0x0,'rows':[]};return db[_0x6f6c('0x39')]['findOne']({'where':{'id':_0x554d97[_0x6f6c('0xb5')]['id']}})[_0x6f6c('0x2c')](handleEntityNotFound(_0x131193,null))[_0x6f6c('0x2c')](function(_0x3b9737){if(_0x3b9737){_0x201cbc[_0x6f6c('0x3f')]=_[_0x6f6c('0x3c')](db['WhatsappMessage'][_0x6f6c('0xb6')]);_0x201cbc[_0x6f6c('0x42')]=_[_0x6f6c('0x3c')](_0x554d97[_0x6f6c('0x42')]);_0x201cbc[_0x6f6c('0x3d')]=_['intersection'](_0x201cbc[_0x6f6c('0x3f')],_0x201cbc[_0x6f6c('0x42')]);_0x419c99[_0x6f6c('0x40')]=_[_0x6f6c('0x3e')](_0x201cbc[_0x6f6c('0x3f')],qs[_0x6f6c('0x41')](_0x554d97[_0x6f6c('0x42')][_0x6f6c('0x41')]));_0x419c99[_0x6f6c('0x40')]=_0x419c99[_0x6f6c('0x40')][_0x6f6c('0x43')]?_0x419c99[_0x6f6c('0x40')]:_0x201cbc['model'];if(!_0x554d97[_0x6f6c('0x42')][_0x6f6c('0xc2')](_0x6f6c('0xc3'))){_0x419c99['limit']=qs[_0x6f6c('0x24')](_0x554d97[_0x6f6c('0x42')][_0x6f6c('0x24')]);_0x419c99[_0x6f6c('0x26')]=qs[_0x6f6c('0x26')](_0x554d97[_0x6f6c('0x42')][_0x6f6c('0x26')]);}_0x419c99[_0x6f6c('0x44')]=qs['sort'](_0x554d97[_0x6f6c('0x42')][_0x6f6c('0x45')]);_0x419c99[_0x6f6c('0x73')]=qs[_0x6f6c('0x3d')](_[_0x6f6c('0x46')](_0x554d97[_0x6f6c('0x42')],_0x201cbc['filters']));_0x419c99[_0x6f6c('0x73')][_0x6f6c('0xb1')]=_0x3b9737['id'];if(_0x554d97[_0x6f6c('0x42')]['filter']){_0x419c99[_0x6f6c('0x73')]=_[_0x6f6c('0xb9')](_0x419c99[_0x6f6c('0x73')],{'$or':_[_0x6f6c('0x31')](_0x419c99[_0x6f6c('0x40')],function(_0x186df6){var _0x2234c3={};_0x2234c3[_0x186df6]={'$like':'%'+_0x554d97[_0x6f6c('0x42')]['filter']+'%'};return _0x2234c3;})});}if(_0x554d97['query'][_0x6f6c('0xc4')]){var _0x3fc079=_0x554d97[_0x6f6c('0x42')][_0x6f6c('0xc4')][_0x6f6c('0x34')](',');var _0x416e6b={};_0x416e6b[_0x3fc079[0x0]]={'$gte':moment(_0x3fc079[0x1])[_0x6f6c('0xc5')](_0x6f6c('0xc6'))};_0x419c99['where']=_[_0x6f6c('0xb9')](_0x419c99[_0x6f6c('0x73')],_0x416e6b);}_0x419c99=_[_0x6f6c('0xb9')]({},_0x419c99,_0x554d97[_0x6f6c('0xba')]);return db[_0x6f6c('0xbf')]['count']({'where':_0x419c99[_0x6f6c('0x73')]})['then'](function(_0x13dd6a){_0x2f5295['count']=_0x13dd6a;if(_0x554d97[_0x6f6c('0x42')][_0x6f6c('0xb7')]){_0x419c99['include']=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x419c99);})['then'](function(_0x50533d){_0x2f5295[_0x6f6c('0xb3')]=_0x50533d;return _0x2f5295;});}})[_0x6f6c('0x2c')](respondWithFilteredResult(_0x131193,_0x419c99))[_0x6f6c('0x37')](handleError(_0x131193,null));};exports[_0x6f6c('0xc7')]=function(_0x4fcbe4,_0xcd4755,_0x1da394){return db[_0x6f6c('0x39')][_0x6f6c('0x67')]({'where':{'id':_0x4fcbe4[_0x6f6c('0xb5')]['id']}})[_0x6f6c('0x2c')](handleEntityNotFound(_0xcd4755,null))[_0x6f6c('0x2c')](function(_0x320910){if(_0x320910){return _0x320910[_0x6f6c('0xc8')](_0x4fcbe4[_0x6f6c('0xbc')]['ids'],_[_0x6f6c('0xc1')](_0x4fcbe4[_0x6f6c('0xbc')],[_0x6f6c('0xc0'),'id'])||{})[_0x6f6c('0xc9')](function(){return db[_0x6f6c('0x6c')]['findAll']({'attributes':['id',_0x6f6c('0x2f'),_0x6f6c('0x49')],'where':{'id':_0x4fcbe4[_0x6f6c('0xbc')][_0x6f6c('0xc0')]}});})[_0x6f6c('0x2c')](function(_0xf295c6){socket[_0x6f6c('0xca')](_0x6f6c('0xcb'),{'id':Number(_0x4fcbe4[_0x6f6c('0xb5')]['id']),'tags':_0xf295c6||[]});return{'id':Number(_0x4fcbe4[_0x6f6c('0xb5')]['id']),'tags':_0xf295c6||[]};});}})[_0x6f6c('0x2c')](respondWithResult(_0xcd4755,null))[_0x6f6c('0x37')](handleError(_0xcd4755,null));};exports[_0x6f6c('0xcc')]=function(_0x542037,_0x58a342,_0x18a07a){return db[_0x6f6c('0x39')][_0x6f6c('0x67')]({'where':{'id':_0x542037[_0x6f6c('0xb5')]['id']}})[_0x6f6c('0x2c')](handleEntityNotFound(_0x58a342,null))[_0x6f6c('0x2c')](function(_0x45e483){if(_0x45e483){return _0x45e483['removeTags'](_0x542037[_0x6f6c('0x42')]['ids']);}})[_0x6f6c('0x2c')](respondWithStatusCode(_0x58a342,null))['catch'](handleError(_0x58a342,null));};exports[_0x6f6c('0xcd')]=function(_0x564032,_0x9c80b8){var _0x592093=moment()[_0x6f6c('0xce')]()[_0x6f6c('0x99')]();var _0x33b11d=path[_0x6f6c('0xcf')](config[_0x6f6c('0xd0')],'server',_0x6f6c('0xd1'),'tmp');var _0x1f0cdd=path[_0x6f6c('0xcf')](config['root'],_0x6f6c('0xd2'),_0x6f6c('0xd1'),_0x6f6c('0xd3'));var _0x4b70f9=path['join'](_0x33b11d,_0x592093);var _0x2fa7ba=util[_0x6f6c('0xc5')](_0x6f6c('0xd4'),_0x564032[_0x6f6c('0xb5')]['id'],_0x592093);var _0xf4b669=path[_0x6f6c('0xcf')](_0x33b11d,_0x2fa7ba);var _0x1dd405=[];_0x1dd405['push']({'model':db[_0x6f6c('0xd5')],'as':_0x6f6c('0xd5'),'attributes':['id',_0x6f6c('0x32')],'raw':!![]});_0x1dd405[_0x6f6c('0x36')]({'model':db[_0x6f6c('0xd6')],'as':_0x6f6c('0xd7'),'attributes':['id',_0x6f6c('0xd8'),_0x6f6c('0xd9')],'raw':!![]});if(_0x564032[_0x6f6c('0x42')][_0x6f6c('0xd3')]){_0x1dd405[_0x6f6c('0x36')]({'model':db[_0x6f6c('0xda')],'as':_0x6f6c('0xda'),'raw':!![]});}var _0x4263a8=[{'model':db[_0x6f6c('0xbf')],'as':_0x6f6c('0xdb'),'attributes':['id','body',_0x6f6c('0x76'),_0x6f6c('0xdc'),_0x6f6c('0xdd'),_0x6f6c('0x7c')],'include':_0x1dd405}];_0x4263a8[_0x6f6c('0x36')]({'model':db[_0x6f6c('0xde')],'as':'Account','attributes':['id',_0x6f6c('0x2f')]});_0x4263a8[_0x6f6c('0x36')]({'model':db['User'],'as':_0x6f6c('0xdf'),'attributes':['id',_0x6f6c('0x32')]});return db[_0x6f6c('0x39')][_0x6f6c('0x67')]({'where':{'id':_0x564032[_0x6f6c('0xb5')]['id']},'include':_0x4263a8})[_0x6f6c('0x2c')](handleEntityNotFound(_0x9c80b8,null))['then'](function(_0x56f154){if(_0x56f154){var _0x299cba=_0x56f154[_0x6f6c('0xe0')]({'plain':!![]});fs[_0x6f6c('0xe1')](_0x4b70f9);var _0xdfbb66={'channel':_0x6f6c('0xe2'),'account':_0x299cba[_0x6f6c('0xe3')]['name'],'agent':_0x299cba[_0x6f6c('0xdf')]?_0x299cba[_0x6f6c('0xdf')][_0x6f6c('0x32')]:_0x6f6c('0xe4'),'createdAt':moment(_0x299cba[_0x6f6c('0x76')])[_0x6f6c('0xc5')](_0x6f6c('0xc6'))[_0x6f6c('0x99')](),'closedAt':_0x299cba[_0x6f6c('0xe5')]?moment(_0x299cba[_0x6f6c('0xe6')])[_0x6f6c('0xc5')]('YYYY-MM-DD\x20HH:mm:ss')[_0x6f6c('0x99')]():'','disposition':_0x299cba[_0x6f6c('0xe7')],'messages':_(_0x299cba[_0x6f6c('0xdb')])[_0x6f6c('0x80')]({'secret':![]})['map'](function(_0x30c391){if(_0x30c391[_0x6f6c('0xda')]){var _0x504107=path[_0x6f6c('0xcf')](_0x1f0cdd,_0x30c391['Attachment'][_0x6f6c('0xe8')]);if(fs['existsSync'](_0x504107)){fs[_0x6f6c('0xe9')](_0x504107)[_0x6f6c('0xea')](fs[_0x6f6c('0xeb')](path[_0x6f6c('0xcf')](_0x4b70f9,_0x30c391[_0x6f6c('0xda')][_0x6f6c('0xe8')])));}}return{'date':moment(_0x30c391['createdAt'])[_0x6f6c('0xc5')]('YYYY-MM-DD\x20HH:mm:ss')[_0x6f6c('0x99')](),'sender':_0x30c391['direction']==='out'?_0x30c391[_0x6f6c('0xd5')]?_0x30c391[_0x6f6c('0xd5')][_0x6f6c('0x32')]:_0x6f6c('0xec'):_0x30c391[_0x6f6c('0xd7')][_0x6f6c('0xd8')]+(_0x30c391[_0x6f6c('0xd7')][_0x6f6c('0xd9')]?'\x20'+_0x30c391[_0x6f6c('0xd7')][_0x6f6c('0xd9')]:''),'body':_0x30c391[_0x6f6c('0xda')]?_0x30c391[_0x6f6c('0xda')][_0x6f6c('0xe8')]:_0x30c391[_0x6f6c('0xbc')],'direction':_0x30c391[_0x6f6c('0xdc')]==='out'?'A':'C','secret':_0x30c391['secret'],'read':_0x30c391['read'],'attachment':_0x30c391[_0x6f6c('0xda')]};})[_0x6f6c('0x60')]()};return ejs[_0x6f6c('0xed')](path['join'](config['root'],_0x6f6c('0xd2'),'views','downloadInteraction.ejs'),{'interaction':_0xdfbb66})[_0x6f6c('0x2c')](function(_0xbf23d9){var _0x5bdf5b=path[_0x6f6c('0xcf')](_0x4b70f9,_0x6f6c('0xee')+_0x299cba['id']+'-'+_0x592093+_0x6f6c('0xef'));var _0x2036f5={'path':_0x5bdf5b,'channel':_0x6f6c('0xe2'),'interactionId':_0x299cba['id']};return pdf[_0x6f6c('0xf0')](_0xbf23d9,_0x2036f5);})['then'](function(){return new BPromise(function(_0x31d00c,_0x4afa35){zipdir(_0x4b70f9,{'saveTo':_0xf4b669},function(_0x13c4fc,_0x9eac45){if(_0x13c4fc)return _0x4afa35(_0x13c4fc);return _0x31d00c(_0x9eac45);});})['then'](function(){return new BPromise(function(_0x3c77b0,_0xbc6856){rimraf(_0x4b70f9,function(_0x3873fd){if(_0x3873fd)_0xbc6856(_0x3873fd);return _0x3c77b0();});});})[_0x6f6c('0x2c')](function(){return _0x9c80b8[_0x6f6c('0xcd')](_0xf4b669,_0x2fa7ba,function(_0x19174a){if(_0x19174a){console['log'](_0x6f6c('0xf1'),_0x19174a);}else{fs[_0x6f6c('0xf2')](_0xf4b669);}});});});}else{return _0x9c80b8[_0x6f6c('0x1f')](0xc8);}})['catch'](handleError(_0x9c80b8,null));};
\ No newline at end of file
index cbc8640..81dbb42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01d3=['WhatsappMessage','save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','WhatsappInteraction','../../mysqldb'];(function(_0x43205f,_0x50d34e){var _0x3aa4bb=function(_0x2d10cd){while(--_0x2d10cd){_0x43205f['push'](_0x43205f['shift']());}};_0x3aa4bb(++_0x50d34e);}(_0x01d3,0xdb));var _0x301d=function(_0x3c76fc,_0x39e116){_0x3c76fc=_0x3c76fc-0x0;var _0x4755f5=_0x01d3[_0x3c76fc];return _0x4755f5;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require('../../mysqldb')['db'][_0x301d('0x0')];var WhatsappMessage=require(_0x301d('0x1'))['db'][_0x301d('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x301d('0x3'),'afterUpdate':_0x301d('0x4'),'afterDestroy':_0x301d('0x5')};function emitEvent(_0x11ba0e){return function(_0x13cd36,_0x4f3b25,_0x44f428){_0x13cd36[_0x301d('0x6')]({'attributes':['id'],'raw':!![]})[_0x301d('0x7')](function(_0x30e89e){_0x13cd36[_0x301d('0x8')]('Users',_0x30e89e[_0x301d('0x9')](function(_0x1d8e83){return{'id':_0x1d8e83['id']};}));return WhatsappMessage[_0x301d('0xa')]({'where':{'WhatsappInteractionId':_0x13cd36['id'],'direction':'in','read':![]},'raw':!![]});})[_0x301d('0x7')](function(_0xc54235){_0x13cd36[_0x301d('0x8')](_0x301d('0xb'),_0xc54235[_0x301d('0xc')]);WhatsappInteractionEvents[_0x301d('0xd')](_0x11ba0e+':'+_0x13cd36['id'],_0x13cd36);WhatsappInteractionEvents['emit'](_0x11ba0e,_0x13cd36);_0x44f428(null);})[_0x301d('0xe')](_0x44f428(null));};}for(var e in events){if(events[_0x301d('0xf')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x301d('0x10')]=WhatsappInteractionEvents;
\ No newline at end of file
+var _0x1ca7=['setDataValue','map','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update','getUsers','then'];(function(_0x29288f,_0x3b08a1){var _0x456fe0=function(_0x3bd6e9){while(--_0x3bd6e9){_0x29288f['push'](_0x29288f['shift']());}};_0x456fe0(++_0x3b08a1);}(_0x1ca7,0x157));var _0x71ca=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x1ca7[_0x618414];return _0x21c19a;};'use strict';var EventEmitter=require(_0x71ca('0x0'));var WhatsappInteraction=require(_0x71ca('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x71ca('0x2')](0x0);var events={'afterCreate':_0x71ca('0x3'),'afterUpdate':_0x71ca('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2501cd){return function(_0x3b6cbf,_0x58f288,_0x58c4a5){_0x3b6cbf[_0x71ca('0x5')]({'attributes':['id'],'raw':!![]})[_0x71ca('0x6')](function(_0x31444d){_0x3b6cbf[_0x71ca('0x7')]('Users',_0x31444d[_0x71ca('0x8')](function(_0x41ca0a){return{'id':_0x41ca0a['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x3b6cbf['id'],'direction':'in','read':![]},'raw':!![]});})[_0x71ca('0x6')](function(_0x2aff62){_0x3b6cbf[_0x71ca('0x7')]('unreadMessages',_0x2aff62[_0x71ca('0x9')]);WhatsappInteractionEvents[_0x71ca('0xa')](_0x2501cd+':'+_0x3b6cbf['id'],_0x3b6cbf);WhatsappInteractionEvents[_0x71ca('0xa')](_0x2501cd,_0x3b6cbf);_0x58c4a5(null);})[_0x71ca('0xb')](_0x58c4a5(null));};}for(var e in events){if(events[_0x71ca('0xc')](e)){var event=events[e];WhatsappInteraction[_0x71ca('0xd')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents;
\ No newline at end of file
index 46271a0..3ef6944 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf4a=['changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','define','WhatsappInteraction','whatsapp_interactions'];(function(_0x134604,_0x5ded4c){var _0x1f83ac=function(_0xa44773){while(--_0xa44773){_0x134604['push'](_0x134604['shift']());}};_0x1f83ac(++_0x5ded4c);}(_0xbf4a,0x104));var _0xabf4=function(_0x575264,_0x1ee24d){_0x575264=_0x575264-0x0;var _0x4ee1d5=_0xbf4a[_0x575264];return _0x4ee1d5;};'use strict';var _=require(_0xabf4('0x0'));var util=require(_0xabf4('0x1'));var logger=require(_0xabf4('0x2'))('api');var moment=require(_0xabf4('0x3'));var BPromise=require('bluebird');var rp=require(_0xabf4('0x4'));var fs=require('fs');var path=require(_0xabf4('0x5'));var rimraf=require(_0xabf4('0x6'));var config=require(_0xabf4('0x7'));var attributes=require(_0xabf4('0x8'));module['exports']=function(_0x2b00b5,_0x1825a8){return _0x2b00b5[_0xabf4('0x9')](_0xabf4('0xa'),attributes,{'tableName':_0xabf4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4a5f03,_0x2807f2,_0x159eb4){if(_0x4a5f03[_0xabf4('0xc')](_0xabf4('0xd'))){_0x4a5f03[_0xabf4('0xe')]=moment()['format'](_0xabf4('0xf'));}_0x159eb4(null,_0x4a5f03);}}});};
\ No newline at end of file
+var _0xba32=['WhatsappInteraction','whatsapp_interactions','changed','closed','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x47d9f1,_0x45b4f6){var _0x230a1e=function(_0x4d25fe){while(--_0x4d25fe){_0x47d9f1['push'](_0x47d9f1['shift']());}};_0x230a1e(++_0x45b4f6);}(_0xba32,0x12f));var _0x2ba3=function(_0x3832f9,_0x59c443){_0x3832f9=_0x3832f9-0x0;var _0x37418c=_0xba32[_0x3832f9];return _0x37418c;};'use strict';var _=require('lodash');var util=require(_0x2ba3('0x0'));var logger=require(_0x2ba3('0x1'))('api');var moment=require(_0x2ba3('0x2'));var BPromise=require(_0x2ba3('0x3'));var rp=require(_0x2ba3('0x4'));var fs=require('fs');var path=require(_0x2ba3('0x5'));var rimraf=require('rimraf');var config=require(_0x2ba3('0x6'));var attributes=require('./whatsappInteraction.attributes');module[_0x2ba3('0x7')]=function(_0x2d55ae,_0x431d3e){return _0x2d55ae[_0x2ba3('0x8')](_0x2ba3('0x9'),attributes,{'tableName':_0x2ba3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5abd0c,_0x48ba00,_0x5822f2){if(_0x5abd0c[_0x2ba3('0xb')](_0x2ba3('0xc'))){_0x5abd0c['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x5822f2(null,_0x5abd0c);}}});};
\ No newline at end of file
index a85e4b4..edfe870 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62dd=['stringify','error','message','info','result','catch','UpdateWhatsappInteraction','update','options','raw','where','attributes','limit','AddTagsToWhatsappInteraction','addTags','body','ids','omit','spread','AddTags','lodash','moment','bluebird','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3252f4,_0x553525){var _0x1ab04c=function(_0x218709){while(--_0x218709){_0x3252f4['push'](_0x3252f4['shift']());}};_0x1ab04c(++_0x553525);}(_0x62dd,0xd2));var _0xd62d=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x62dd[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xd62d('0x0'));var util=require('util');var moment=require(_0xd62d('0x1'));var BPromise=require(_0xd62d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd62d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd62d('0x4'));var jayson=require(_0xd62d('0x5'));var client=jayson[_0xd62d('0x6')][_0xd62d('0x7')]({'port':0x232a});config[_0xd62d('0x8')]=_['defaults'](config['redis'],{'host':_0xd62d('0x9'),'port':0x18eb});var socket=require(_0xd62d('0xa'))(new Redis(config[_0xd62d('0x8')]));require(_0xd62d('0xb'))[_0xd62d('0xc')](socket);function respondWithRpcPromise(_0xefed31,_0xf3a6af,_0x2fef7b){return new BPromise(function(_0x32f693,_0xcf56e3){return client[_0xd62d('0xd')](_0xefed31,_0x2fef7b)[_0xd62d('0xe')](function(_0x16e4e1){logger['info'](_0xd62d('0xf'),_0xf3a6af,_0xd62d('0x10'));logger[_0xd62d('0x11')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0xf3a6af,_0xd62d('0x10'),JSON[_0xd62d('0x12')](_0x16e4e1));if(_0x16e4e1['error']){if(_0x16e4e1[_0xd62d('0x13')]['code']===0x1f4){logger[_0xd62d('0x13')](_0xd62d('0xf'),_0xf3a6af,_0x16e4e1['error'][_0xd62d('0x14')]);return _0xcf56e3(_0x16e4e1[_0xd62d('0x13')][_0xd62d('0x14')]);}logger[_0xd62d('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0xf3a6af,_0x16e4e1[_0xd62d('0x13')][_0xd62d('0x14')]);return _0x32f693(_0x16e4e1[_0xd62d('0x13')][_0xd62d('0x14')]);}else{logger[_0xd62d('0x15')]('WhatsappInteraction,\x20%s,\x20%s',_0xf3a6af,_0xd62d('0x10'));_0x32f693(_0x16e4e1[_0xd62d('0x16')][_0xd62d('0x14')]);}})[_0xd62d('0x17')](function(_0x241c20){logger['error'](_0xd62d('0xf'),_0xf3a6af,_0x241c20);_0xcf56e3(_0x241c20);});});}exports[_0xd62d('0x18')]=function(_0x2e4e97){var _0x81ff3a=this;return new Promise(function(_0x4a6fae,_0x1e6996){return db['WhatsappInteraction'][_0xd62d('0x19')](_0x2e4e97['body'],{'raw':_0x2e4e97[_0xd62d('0x1a')]?_0x2e4e97[_0xd62d('0x1a')][_0xd62d('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e4e97[_0xd62d('0x1a')]?_0x2e4e97['options'][_0xd62d('0x1c')]||null:null,'attributes':_0x2e4e97['options']?_0x2e4e97[_0xd62d('0x1a')][_0xd62d('0x1d')]||null:null,'limit':_0x2e4e97[_0xd62d('0x1a')]?_0x2e4e97['options'][_0xd62d('0x1e')]||null:null})['then'](function(_0x45415e){logger['info']('UpdateWhatsappInteraction',_0x2e4e97);logger[_0xd62d('0x11')](_0xd62d('0x18'),_0x2e4e97,JSON[_0xd62d('0x12')](_0x45415e));_0x4a6fae(_0x45415e);})['catch'](function(_0x56da96){logger[_0xd62d('0x13')](_0xd62d('0x18'),_0x56da96['message'],_0x2e4e97);_0x1e6996(_0x81ff3a['error'](0x1f4,_0x56da96[_0xd62d('0x14')]));});});};exports[_0xd62d('0x1f')]=function(_0x2642be){return new Promise(function(_0x3c2e03,_0x4dc94b){return db['WhatsappInteraction']['find']({'where':_0x2642be[_0xd62d('0x1a')]?_0x2642be[_0xd62d('0x1a')][_0xd62d('0x1c')]||null:null})[_0xd62d('0xe')](function(_0x219034){if(_0x219034){return _0x219034[_0xd62d('0x20')](_0x2642be[_0xd62d('0x21')][_0xd62d('0x22')],_[_0xd62d('0x23')](_0x2642be[_0xd62d('0x21')],[_0xd62d('0x22'),'id'])||{});}})[_0xd62d('0x24')](function(_0x316c62){logger[_0xd62d('0x15')]('AddTags',_0x2642be);logger['debug'](_0xd62d('0x25'),_0x2642be,JSON[_0xd62d('0x12')](_0x316c62));_0x3c2e03(_0x316c62);})[_0xd62d('0x17')](function(_0x1e612d){logger[_0xd62d('0x13')](_0xd62d('0x25'),_0x1e612d[_0xd62d('0x14')],_0x2642be);_0x4dc94b(_this[_0xd62d('0x13')](0x1f4,_0x1e612d[_0xd62d('0x14')]));});});};
\ No newline at end of file
+var _0x112e=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','register','request','then','info','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','attributes','limit','where','addTags','omit','ids','spread','AddTags','util','randomstring','ioredis'];(function(_0x19c7d4,_0x328304){var _0x3acf9f=function(_0x5d85a8){while(--_0x5d85a8){_0x19c7d4['push'](_0x19c7d4['shift']());}};_0x3acf9f(++_0x328304);}(_0x112e,0x14a));var _0xe112=function(_0x258fb0,_0x5362dc){_0x258fb0=_0x258fb0-0x0;var _0x4d1afe=_0x112e[_0x258fb0];return _0x4d1afe;};'use strict';var _=require('lodash');var util=require(_0xe112('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe112('0x1'));var fs=require('fs');var Redis=require(_0xe112('0x2'));var db=require(_0xe112('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe112('0x4'))(_0xe112('0x5'));var config=require(_0xe112('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe112('0x7')][_0xe112('0x8')]({'port':0x232a});config[_0xe112('0x9')]=_['defaults'](config[_0xe112('0x9')],{'host':_0xe112('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappInteraction.socket')[_0xe112('0xb')](socket);function respondWithRpcPromise(_0x40835e,_0xe9887,_0x5cb8b1){return new BPromise(function(_0x5592a5,_0x1793e5){return client[_0xe112('0xc')](_0x40835e,_0x5cb8b1)[_0xe112('0xd')](function(_0x996188){logger[_0xe112('0xe')]('WhatsappInteraction,\x20%s,\x20%s',_0xe9887,'request\x20sent');logger[_0xe112('0xf')](_0xe112('0x10'),_0xe9887,_0xe112('0x11'),JSON[_0xe112('0x12')](_0x996188));if(_0x996188[_0xe112('0x13')]){if(_0x996188['error'][_0xe112('0x14')]===0x1f4){logger[_0xe112('0x13')](_0xe112('0x15'),_0xe9887,_0x996188[_0xe112('0x13')][_0xe112('0x16')]);return _0x1793e5(_0x996188[_0xe112('0x13')][_0xe112('0x16')]);}logger[_0xe112('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0xe9887,_0x996188[_0xe112('0x13')]['message']);return _0x5592a5(_0x996188[_0xe112('0x13')]['message']);}else{logger['info'](_0xe112('0x15'),_0xe9887,'request\x20sent');_0x5592a5(_0x996188['result'][_0xe112('0x16')]);}})[_0xe112('0x17')](function(_0x23576f){logger[_0xe112('0x13')](_0xe112('0x15'),_0xe9887,_0x23576f);_0x1793e5(_0x23576f);});});}exports[_0xe112('0x18')]=function(_0x399303){var _0x5bd344=this;return new Promise(function(_0x272e4d,_0x10369c){return db[_0xe112('0x19')][_0xe112('0x1a')](_0x399303[_0xe112('0x1b')],{'raw':_0x399303[_0xe112('0x1c')]?_0x399303['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x399303[_0xe112('0x1c')]?_0x399303['options']['where']||null:null,'attributes':_0x399303['options']?_0x399303[_0xe112('0x1c')][_0xe112('0x1d')]||null:null,'limit':_0x399303[_0xe112('0x1c')]?_0x399303[_0xe112('0x1c')][_0xe112('0x1e')]||null:null})[_0xe112('0xd')](function(_0x86b07){logger[_0xe112('0xe')](_0xe112('0x18'),_0x399303);logger[_0xe112('0xf')]('UpdateWhatsappInteraction',_0x399303,JSON[_0xe112('0x12')](_0x86b07));_0x272e4d(_0x86b07);})[_0xe112('0x17')](function(_0x54f5dc){logger['error'](_0xe112('0x18'),_0x54f5dc[_0xe112('0x16')],_0x399303);_0x10369c(_0x5bd344[_0xe112('0x13')](0x1f4,_0x54f5dc[_0xe112('0x16')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x415167){return new Promise(function(_0x34c788,_0x52275e){return db[_0xe112('0x19')]['find']({'where':_0x415167['options']?_0x415167[_0xe112('0x1c')][_0xe112('0x1f')]||null:null})[_0xe112('0xd')](function(_0x2a4262){if(_0x2a4262){return _0x2a4262[_0xe112('0x20')](_0x415167[_0xe112('0x1b')]['ids'],_[_0xe112('0x21')](_0x415167[_0xe112('0x1b')],[_0xe112('0x22'),'id'])||{});}})[_0xe112('0x23')](function(_0x4134f3){logger[_0xe112('0xe')](_0xe112('0x24'),_0x415167);logger[_0xe112('0xf')]('AddTags',_0x415167,JSON[_0xe112('0x12')](_0x4134f3));_0x34c788(_0x4134f3);})['catch'](function(_0x274920){logger['error'](_0xe112('0x24'),_0x274920[_0xe112('0x16')],_0x415167);_0x52275e(_this[_0xe112('0x13')](0x1f4,_0x274920['message']));});});};
\ No newline at end of file
index 153774f..70dac28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabfe=['save','update','emit','removeListener','register','length','whatsappInteraction:'];(function(_0x48219f,_0x54499b){var _0x511a71=function(_0x46dc5a){while(--_0x46dc5a){_0x48219f['push'](_0x48219f['shift']());}};_0x511a71(++_0x54499b);}(_0xabfe,0xcb));var _0xeabf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xabfe[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0xeabf('0x0'),'remove',_0xeabf('0x1')];function createListener(_0x24692e,_0x378e43){return function(_0x5601ee){_0x378e43[_0xeabf('0x2')](_0x24692e,_0x5601ee);};}function removeListener(_0x112503,_0x5129d5){return function(){WhatsappInteractionEvents[_0xeabf('0x3')](_0x112503,_0x5129d5);};}exports[_0xeabf('0x4')]=function(_0x2298d2){for(var _0x5c9547=0x0,_0x5dc9f1=events[_0xeabf('0x5')];_0x5c9547<_0x5dc9f1;_0x5c9547++){var _0x252568=events[_0x5c9547];var _0x51d0aa=createListener(_0xeabf('0x6')+_0x252568,_0x2298d2);WhatsappInteractionEvents['on'](_0x252568,_0x51d0aa);}};
\ No newline at end of file
+var _0x72e5=['removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events','remove','update','emit'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0x72e5,0xf4));var _0x572e=function(_0x19abac,_0x2e5ad0){_0x19abac=_0x19abac-0x0;var _0x332186=_0x72e5[_0x19abac];return _0x332186;};'use strict';var WhatsappInteractionEvents=require(_0x572e('0x0'));var events=['save',_0x572e('0x1'),_0x572e('0x2')];function createListener(_0x431704,_0x36e3cb){return function(_0x376587){_0x36e3cb[_0x572e('0x3')](_0x431704,_0x376587);};}function removeListener(_0x1ae8fa,_0xd772bc){return function(){WhatsappInteractionEvents[_0x572e('0x4')](_0x1ae8fa,_0xd772bc);};}exports[_0x572e('0x5')]=function(_0x29ab8b){for(var _0x3b8e80=0x0,_0x21ca28=events[_0x572e('0x6')];_0x3b8e80<_0x21ca28;_0x3b8e80++){var _0xefadf7=events[_0x3b8e80];var _0x5de44e=createListener(_0x572e('0x7')+_0xefadf7,_0x29ab8b);WhatsappInteractionEvents['on'](_0xefadf7,_0x5de44e);}};
\ No newline at end of file
index aaa7b0b..6a86115 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6976=['get','isAuthenticated','index','/describe','/:id','show','post','tracked','whatsappmessage:create','/:id/status','status','put','/:id/accept','accept','/:id/reject','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xed4881,_0x45771c){var _0x7fcbd5=function(_0x36b960){while(--_0x36b960){_0xed4881['push'](_0xed4881['shift']());}};_0x7fcbd5(++_0x45771c);}(_0x6976,0x170));var _0x6697=function(_0x27831e,_0x58d291){_0x27831e=_0x27831e-0x0;var _0x33f4b5=_0x6976[_0x27831e];return _0x33f4b5;};'use strict';var multer=require('multer');var util=require(_0x6697('0x0'));var path=require(_0x6697('0x1'));var timeout=require(_0x6697('0x2'));var express=require('express');var router=express[_0x6697('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6697('0x4'));var interaction=require(_0x6697('0x5'));var config=require(_0x6697('0x6'));var controller=require('./whatsappMessage.controller');router[_0x6697('0x7')]('/',auth[_0x6697('0x8')](),controller[_0x6697('0x9')]);router[_0x6697('0x7')](_0x6697('0xa'),auth[_0x6697('0x8')](),controller['describe']);router['get'](_0x6697('0xb'),auth['isAuthenticated'](),controller[_0x6697('0xc')]);router[_0x6697('0xd')]('/',auth[_0x6697('0x8')](),interaction[_0x6697('0xe')]('whatsapp',_0x6697('0xf')),controller['create']);router['post'](_0x6697('0x10'),controller[_0x6697('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6697('0x12')](_0x6697('0x13'),auth[_0x6697('0x8')](),controller[_0x6697('0x14')]);router['put'](_0x6697('0x15'),auth['isAuthenticated'](),controller['reject']);router[_0x6697('0x16')](_0x6697('0xb'),auth[_0x6697('0x8')](),controller[_0x6697('0x17')]);module[_0x6697('0x18')]=router;
\ No newline at end of file
+var _0x5bce=['util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./whatsappMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','put','update','/:id/accept','accept','reject','multer'];(function(_0x54ab05,_0x3beb49){var _0xabc961=function(_0x1242bf){while(--_0x1242bf){_0x54ab05['push'](_0x54ab05['shift']());}};_0xabc961(++_0x3beb49);}(_0x5bce,0x8f));var _0xe5bc=function(_0x2442b9,_0x3d87e9){_0x2442b9=_0x2442b9-0x0;var _0x31b571=_0x5bce[_0x2442b9];return _0x31b571;};'use strict';var multer=require(_0xe5bc('0x0'));var util=require(_0xe5bc('0x1'));var path=require(_0xe5bc('0x2'));var timeout=require(_0xe5bc('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe5bc('0x4'));var auth=require(_0xe5bc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe5bc('0x6'));var controller=require(_0xe5bc('0x7'));router[_0xe5bc('0x8')]('/',auth['isAuthenticated'](),controller[_0xe5bc('0x9')]);router['get'](_0xe5bc('0xa'),auth[_0xe5bc('0xb')](),controller[_0xe5bc('0xc')]);router['get'](_0xe5bc('0xd'),auth[_0xe5bc('0xb')](),controller[_0xe5bc('0xe')]);router[_0xe5bc('0xf')]('/',auth['isAuthenticated'](),interaction[_0xe5bc('0x10')](_0xe5bc('0x11'),_0xe5bc('0x12')),controller['create']);router[_0xe5bc('0xf')]('/:id/status',controller['status']);router[_0xe5bc('0x13')](_0xe5bc('0xd'),auth[_0xe5bc('0xb')](),controller[_0xe5bc('0x14')]);router[_0xe5bc('0x13')](_0xe5bc('0x15'),auth['isAuthenticated'](),controller[_0xe5bc('0x16')]);router[_0xe5bc('0x13')]('/:id/reject',auth['isAuthenticated'](),controller[_0xe5bc('0x17')]);router['delete'](_0xe5bc('0xd'),auth[_0xe5bc('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index ff569e3..65b7211 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb764=['medium','BOOLEAN','ENUM','out','STRING','sequelize','TEXT'];(function(_0x10490e,_0x4df0d9){var _0x35023c=function(_0x32b0c1){while(--_0x32b0c1){_0x10490e['push'](_0x10490e['shift']());}};_0x35023c(++_0x4df0d9);}(_0xb764,0x11d));var _0x4b76=function(_0x4c8ef8,_0x58a9cf){_0x4c8ef8=_0x4c8ef8-0x0;var _0x343b72=_0xb764[_0x4c8ef8];return _0x343b72;};'use strict';var Sequelize=require(_0x4b76('0x0'));module['exports']={'body':{'type':Sequelize[_0x4b76('0x1')](_0x4b76('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x4b76('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4b76('0x4')]('in','out'),'defaultValue':_0x4b76('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x4b76('0x6')](0xbe)},'phone':{'type':Sequelize[_0x4b76('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x4b76('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x4b76('0x6')]},'providerResponse':{'type':Sequelize[_0x4b76('0x1')]}};
\ No newline at end of file
+var _0x2707=['ENUM','out','STRING','BOOLEAN','TEXT','sequelize','exports','medium'];(function(_0x23d59c,_0x205384){var _0x2121b7=function(_0x37fea1){while(--_0x37fea1){_0x23d59c['push'](_0x23d59c['shift']());}};_0x2121b7(++_0x205384);}(_0x2707,0x65));var _0x7270=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0x2707[_0x44946b];return _0x249bc4;};'use strict';var Sequelize=require(_0x7270('0x0'));module[_0x7270('0x1')]={'body':{'type':Sequelize['TEXT'](_0x7270('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x7270('0x3')]('in',_0x7270('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x7270('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x7270('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x7270('0x7')]}};
\ No newline at end of file
index 3fd10d8..3263cf9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0cee=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./whatsappMessage.socket','register','jayson/promise','client','http','then','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','sendStatus','status','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','update','stack','name','send','WhatsappMessage','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','find','body','destroy','describe','whatsapp-interactions','whatsapp','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','WhatsappInteraction','isNil','read1stAt','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','email','internal','manual','interface','format','SIP/%s','motionChannel','channel','event','accept','EventManager','acceptmessage','get','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','QueryTypes','User','fullname','rejectmessage','WhatsappAccount','WhatsappAccountId','received\x20delivery\x20report\x20from','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','inspect','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel'];(function(_0x539dd2,_0x3fb9eb){var _0x2168ff=function(_0x5154a0){while(--_0x5154a0){_0x539dd2['push'](_0x539dd2['shift']());}};_0x2168ff(++_0x3fb9eb);}(_0x0cee,0x113));var _0xe0ce=function(_0x17a474,_0x157633){_0x17a474=_0x17a474-0x0;var _0x1557fc=_0x0cee[_0x17a474];return _0x1557fc;};'use strict';var emlformat=require(_0xe0ce('0x0'));var rimraf=require(_0xe0ce('0x1'));var zipdir=require(_0xe0ce('0x2'));var jsonpatch=require(_0xe0ce('0x3'));var rp=require(_0xe0ce('0x4'));var moment=require(_0xe0ce('0x5'));var BPromise=require(_0xe0ce('0x6'));var Mustache=require('mustache');var util=require(_0xe0ce('0x7'));var path=require(_0xe0ce('0x8'));var sox=require('sox');var csv=require(_0xe0ce('0x9'));var ejs=require(_0xe0ce('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe0ce('0xb'));var squel=require(_0xe0ce('0xc'));var crypto=require('crypto');var jsforce=require(_0xe0ce('0xd'));var deskjs=require(_0xe0ce('0xe'));var toCsv=require(_0xe0ce('0x9'));var querystring=require(_0xe0ce('0xf'));var Papa=require(_0xe0ce('0x10'));var Redis=require(_0xe0ce('0x11'));var authService=require(_0xe0ce('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe0ce('0x13'));var hardwareService=require(_0xe0ce('0x14'));var logger=require(_0xe0ce('0x15'))('api');var utils=require(_0xe0ce('0x16'));var config=require(_0xe0ce('0x17'));var licenseUtil=require(_0xe0ce('0x18'));var db=require(_0xe0ce('0x19'))['db'];config[_0xe0ce('0x1a')]=_[_0xe0ce('0x1b')](config[_0xe0ce('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe0ce('0x1a')]));require(_0xe0ce('0x1c'))[_0xe0ce('0x1d')](socket);var jayson=require(_0xe0ce('0x1e'));var client=jayson[_0xe0ce('0x1f')][_0xe0ce('0x20')]({'port':0x232c});var client9002=jayson[_0xe0ce('0x1f')][_0xe0ce('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x3e9c2b,_0xa1b6b,_0x2591fd,_0x163254){return new BPromise(function(_0x31decf,_0x164ee1){var _0x177c65=_0x163254||client;return _0x177c65['request'](_0x3e9c2b,_0x2591fd)[_0xe0ce('0x21')](function(_0x12ccdc){logger['info'](_0xe0ce('0x22'),_0xa1b6b,'request\x20sent');logger[_0xe0ce('0x23')](_0xe0ce('0x24'),_0xa1b6b,_0xe0ce('0x25'),JSON[_0xe0ce('0x26')](_0x12ccdc));if(_0x12ccdc[_0xe0ce('0x27')]){if(_0x12ccdc[_0xe0ce('0x27')][_0xe0ce('0x28')]===0x1f4){logger[_0xe0ce('0x27')](_0xe0ce('0x22'),_0xa1b6b,_0x12ccdc[_0xe0ce('0x27')][_0xe0ce('0x29')]);return _0x164ee1(_0x12ccdc[_0xe0ce('0x27')][_0xe0ce('0x29')]);}logger[_0xe0ce('0x27')](_0xe0ce('0x22'),_0xa1b6b,_0x12ccdc['error'][_0xe0ce('0x29')]);return _0x31decf(_0x12ccdc['error'][_0xe0ce('0x29')]);}else{logger[_0xe0ce('0x2a')]('WhatsappMessage,\x20%s,\x20%s',_0xa1b6b,_0xe0ce('0x25'));_0x31decf(_0x12ccdc[_0xe0ce('0x2b')][_0xe0ce('0x29')]);}})['catch'](function(_0x133184){logger['error'](_0xe0ce('0x22'),_0xa1b6b,_0x133184);_0x164ee1(_0x133184);});});}function respondWithStatusCode(_0x39a5c3,_0x5e321e){_0x5e321e=_0x5e321e||0xcc;return function(_0x2a606b){if(_0x2a606b){return _0x39a5c3[_0xe0ce('0x2c')](_0x5e321e);}return _0x39a5c3['status'](_0x5e321e)['end']();};}function respondWithResult(_0x44ee3a,_0x39acbc){_0x39acbc=_0x39acbc||0xc8;return function(_0x4bde12){if(_0x4bde12){return _0x44ee3a[_0xe0ce('0x2d')](_0x39acbc)[_0xe0ce('0x2e')](_0x4bde12);}};}function respondWithFilteredResult(_0x4b0f92,_0x386515){return function(_0xb48f57){if(_0xb48f57){var _0x38a97d=typeof _0x386515['offset']==='undefined'&&typeof _0x386515[_0xe0ce('0x2f')]===_0xe0ce('0x30');var _0x1105c2=_0xb48f57['count'];var _0x2e4345=_0x38a97d?0x0:_0x386515[_0xe0ce('0x31')];var _0xe1ab2=_0x38a97d?_0xb48f57[_0xe0ce('0x32')]:_0x386515[_0xe0ce('0x31')]+_0x386515['limit'];var _0x2c613d;if(_0xe1ab2>=_0x1105c2){_0xe1ab2=_0x1105c2;_0x2c613d=0xc8;}else{_0x2c613d=0xce;}_0x4b0f92['status'](_0x2c613d);return _0x4b0f92[_0xe0ce('0x33')](_0xe0ce('0x34'),_0x2e4345+'-'+_0xe1ab2+'/'+_0x1105c2)[_0xe0ce('0x2e')](_0xb48f57);}return null;};}function patchUpdates(_0x44d809){return function(_0x2632ed){try{jsonpatch[_0xe0ce('0x35')](_0x2632ed,_0x44d809,!![]);}catch(_0x58092f){return BPromise[_0xe0ce('0x36')](_0x58092f);}return _0x2632ed[_0xe0ce('0x37')]();};}function saveUpdates(_0x255001,_0x413770){return function(_0x5fc375){if(_0x5fc375){return _0x5fc375[_0xe0ce('0x38')](_0x255001)[_0xe0ce('0x21')](function(_0x3e23fc){return _0x3e23fc;});}return null;};}function removeEntity(_0x663130,_0x2bb436){return function(_0x1daa5f){if(_0x1daa5f){return _0x1daa5f['destroy']()[_0xe0ce('0x21')](function(){_0x663130[_0xe0ce('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x437546,_0x54d65d){return function(_0x2a198a){if(!_0x2a198a){_0x437546[_0xe0ce('0x2c')](0x194);}return _0x2a198a;};}function handleError(_0x4cd1a7,_0x466e36){_0x466e36=_0x466e36||0x1f4;return function(_0x3b0f50){logger[_0xe0ce('0x27')](_0x3b0f50[_0xe0ce('0x39')]);if(_0x3b0f50[_0xe0ce('0x3a')]){delete _0x3b0f50[_0xe0ce('0x3a')];}_0x4cd1a7['status'](_0x466e36)[_0xe0ce('0x3b')](_0x3b0f50);};}exports['index']=function(_0x28d49d,_0xb089ac){var _0x2259cf={},_0x24c942={},_0x49abd8={'count':0x0,'rows':[]};var _0x156963=_['map'](db[_0xe0ce('0x3c')]['rawAttributes'],function(_0x1162a3){return{'name':_0x1162a3[_0xe0ce('0x3d')],'type':_0x1162a3[_0xe0ce('0x3e')][_0xe0ce('0x3f')]};});_0x24c942[_0xe0ce('0x40')]=_[_0xe0ce('0x41')](_0x156963,_0xe0ce('0x3a'));_0x24c942[_0xe0ce('0x42')]=_[_0xe0ce('0x43')](_0x28d49d[_0xe0ce('0x42')]);_0x24c942[_0xe0ce('0x44')]=_[_0xe0ce('0x45')](_0x24c942['model'],_0x24c942[_0xe0ce('0x42')]);_0x2259cf[_0xe0ce('0x46')]=_['intersection'](_0x24c942[_0xe0ce('0x40')],qs[_0xe0ce('0x47')](_0x28d49d[_0xe0ce('0x42')][_0xe0ce('0x47')]));_0x2259cf[_0xe0ce('0x46')]=_0x2259cf[_0xe0ce('0x46')][_0xe0ce('0x48')]?_0x2259cf[_0xe0ce('0x46')]:_0x24c942[_0xe0ce('0x40')];if(!_0x28d49d[_0xe0ce('0x42')][_0xe0ce('0x49')](_0xe0ce('0x4a'))){_0x2259cf['limit']=qs[_0xe0ce('0x2f')](_0x28d49d['query'][_0xe0ce('0x2f')]);_0x2259cf[_0xe0ce('0x31')]=qs[_0xe0ce('0x31')](_0x28d49d['query'][_0xe0ce('0x31')]);}_0x2259cf[_0xe0ce('0x4b')]=qs[_0xe0ce('0x4c')](_0x28d49d['query'][_0xe0ce('0x4c')]);_0x2259cf[_0xe0ce('0x4d')]=qs[_0xe0ce('0x44')](_[_0xe0ce('0x4e')](_0x28d49d['query'],_0x24c942[_0xe0ce('0x44')]),_0x156963);if(_0x28d49d[_0xe0ce('0x42')][_0xe0ce('0x4f')]){_0x2259cf[_0xe0ce('0x4d')]=_[_0xe0ce('0x50')](_0x2259cf['where'],{'$or':_[_0xe0ce('0x41')](_0x156963,function(_0x479189){if(_0x479189[_0xe0ce('0x3e')]!==_0xe0ce('0x51')){var _0x4484f8={};_0x4484f8[_0x479189[_0xe0ce('0x3a')]]={'$like':'%'+_0x28d49d['query'][_0xe0ce('0x4f')]+'%'};return _0x4484f8;}})});}_0x2259cf=_[_0xe0ce('0x50')]({},_0x2259cf,_0x28d49d[_0xe0ce('0x52')]);var _0x31847b={'where':_0x2259cf[_0xe0ce('0x4d')]};return db['WhatsappMessage']['count'](_0x31847b)[_0xe0ce('0x21')](function(_0x52c618){_0x49abd8[_0xe0ce('0x32')]=_0x52c618;if(_0x28d49d['query'][_0xe0ce('0x53')]){_0x2259cf[_0xe0ce('0x54')]=[{'all':!![]}];}return db[_0xe0ce('0x3c')][_0xe0ce('0x55')](_0x2259cf);})['then'](function(_0x1ec9ad){_0x49abd8['rows']=_0x1ec9ad;return _0x49abd8;})[_0xe0ce('0x21')](respondWithFilteredResult(_0xb089ac,_0x2259cf))[_0xe0ce('0x56')](handleError(_0xb089ac,null));};exports[_0xe0ce('0x57')]=function(_0x22ea7c,_0x2c4ac1){var _0x181258={'raw':!![],'where':{'id':_0x22ea7c[_0xe0ce('0x58')]['id']}},_0x234af4={};_0x234af4[_0xe0ce('0x40')]=_[_0xe0ce('0x43')](db[_0xe0ce('0x3c')]['rawAttributes']);_0x234af4['query']=_[_0xe0ce('0x43')](_0x22ea7c['query']);_0x234af4[_0xe0ce('0x44')]=_[_0xe0ce('0x45')](_0x234af4['model'],_0x234af4['query']);_0x181258['attributes']=_[_0xe0ce('0x45')](_0x234af4['model'],qs[_0xe0ce('0x47')](_0x22ea7c['query'][_0xe0ce('0x47')]));_0x181258['attributes']=_0x181258['attributes'][_0xe0ce('0x48')]?_0x181258[_0xe0ce('0x46')]:_0x234af4[_0xe0ce('0x40')];if(_0x22ea7c[_0xe0ce('0x42')][_0xe0ce('0x53')]){_0x181258[_0xe0ce('0x54')]=[{'all':!![]}];}_0x181258=_[_0xe0ce('0x50')]({},_0x181258,_0x22ea7c[_0xe0ce('0x52')]);return db[_0xe0ce('0x3c')]['find'](_0x181258)['then'](handleEntityNotFound(_0x2c4ac1,null))[_0xe0ce('0x21')](respondWithResult(_0x2c4ac1,null))['catch'](handleError(_0x2c4ac1,null));};exports[_0xe0ce('0x59')]=function(_0x3a3c23,_0x50ea6a){return db[_0xe0ce('0x3c')][_0xe0ce('0x59')](_0x3a3c23['body'],{})[_0xe0ce('0x21')](respondWithResult(_0x50ea6a,0xc9))[_0xe0ce('0x56')](handleError(_0x50ea6a,null));};exports[_0xe0ce('0x38')]=function(_0x4f6af3,_0x41cd8e){if(_0x4f6af3['body']['id']){delete _0x4f6af3['body']['id'];}return db[_0xe0ce('0x3c')][_0xe0ce('0x5a')]({'where':{'id':_0x4f6af3[_0xe0ce('0x58')]['id']}})[_0xe0ce('0x21')](handleEntityNotFound(_0x41cd8e,null))[_0xe0ce('0x21')](saveUpdates(_0x4f6af3[_0xe0ce('0x5b')],null))[_0xe0ce('0x21')](respondWithResult(_0x41cd8e,null))[_0xe0ce('0x56')](handleError(_0x41cd8e,null));};exports[_0xe0ce('0x5c')]=function(_0x28e366,_0x1a1bfe){return db[_0xe0ce('0x3c')]['find']({'where':{'id':_0x28e366['params']['id']}})[_0xe0ce('0x21')](handleEntityNotFound(_0x1a1bfe,null))[_0xe0ce('0x21')](removeEntity(_0x1a1bfe,null))[_0xe0ce('0x56')](handleError(_0x1a1bfe,null));};exports[_0xe0ce('0x5d')]=function(_0x37ee1c,_0x15f19e){return db[_0xe0ce('0x3c')][_0xe0ce('0x5d')]()['then'](respondWithResult(_0x15f19e,null))[_0xe0ce('0x56')](handleError(_0x15f19e,null));};var interaction_log=require(_0xe0ce('0x15'))(_0xe0ce('0x5e'));exports['accept']=function(_0x38076e,_0x3f7f50,_0x1bee19){var _0x49121f={'agent':{},'channel':_0xe0ce('0x5f')};if(_0x38076e[_0xe0ce('0x5b')]['id']){delete _0x38076e['body']['id'];}_0x38076e[_0xe0ce('0x5b')][_0xe0ce('0x60')]=!![];_0x38076e[_0xe0ce('0x5b')][_0xe0ce('0x61')]=moment()['format'](_0xe0ce('0x62'));_0x38076e[_0xe0ce('0x5b')]['UserId']=_0x38076e['body'][_0xe0ce('0x63')]||_0x38076e[_0xe0ce('0x64')]['id'];_0x49121f[_0xe0ce('0x65')]['id']=_0x38076e['body'][_0xe0ce('0x63')];return db[_0xe0ce('0x3c')][_0xe0ce('0x5a')]({'where':{'id':_0x38076e[_0xe0ce('0x58')]['id'],'UserId':null}})[_0xe0ce('0x21')](handleEntityNotFound(_0x3f7f50,null))[_0xe0ce('0x21')](saveUpdates(_0x38076e['body'],null))['then'](function(_0x44ca48){if(_0x44ca48){_0x49121f[_0xe0ce('0x29')]=_0x44ca48['get']({'plain':!![]});return db[_0xe0ce('0x66')][_0xe0ce('0x5a')]({'where':{'id':_0x44ca48['WhatsappInteractionId']}});}return null;})[_0xe0ce('0x21')](handleEntityNotFound(_0x3f7f50,null))[_0xe0ce('0x21')](function(_0x5f0d43){if(_0x5f0d43){return _0x5f0d43[_0xe0ce('0x38')]({'UserId':_0x38076e[_0xe0ce('0x5b')][_0xe0ce('0x63')],'read1stAt':_[_0xe0ce('0x67')](_0x5f0d43[_0xe0ce('0x68')])?moment()['format'](_0xe0ce('0x62')):undefined});}return null;})['then'](function(_0x151e55){if(_0x151e55){_0x49121f['interaction']=_0x151e55['get']({'plain':!![]});interaction_log['info'](_0xe0ce('0x69'),_0x38076e[_0xe0ce('0x64')]['id'],_0x38076e[_0xe0ce('0x64')]['name'],_0x38076e[_0xe0ce('0x64')]['role'],_0x49121f[_0xe0ce('0x6a')]['id'],_0x38076e[_0xe0ce('0x5b')]?JSON[_0xe0ce('0x26')](_0x38076e[_0xe0ce('0x5b')]):'null');return respondWithRpcPromise(_0xe0ce('0x6b'),'acceptMessage',_0x49121f);}return null;})[_0xe0ce('0x21')](function(_0x598d92){var _0x553cf2=_0xe0ce('0x6c')+_0x598d92[_0xe0ce('0x29')][_0xe0ce('0x6d')];return db[_0xe0ce('0x6e')]['query'](_0x553cf2,{'type':db[_0xe0ce('0x6f')]['QueryTypes'][_0xe0ce('0x70')],'raw':!![]})[_0xe0ce('0x21')](function(_0x5ee5cb){return _0x5ee5cb;});})[_0xe0ce('0x21')](function(_0xca597f){if(_0xca597f){_0x49121f[_0xe0ce('0x29')][_0xe0ce('0x71')]=_0xca597f[0x0];if(!_0x38076e[_0xe0ce('0x5b')][_0xe0ce('0x63')])return;return db['User'][_0xe0ce('0x5a')]({'where':{'id':_0x38076e[_0xe0ce('0x5b')][_0xe0ce('0x63')],'role':_0xe0ce('0x65')},'attributes':['id','name','fullname',_0xe0ce('0x72'),_0xe0ce('0x73')],'raw':!![]});}return null;})[_0xe0ce('0x21')](function(_0x4086a6){if(!_0x4086a6)return null;_0x49121f['message'][_0xe0ce('0x65')]=_0x4086a6;return _0x49121f;})[_0xe0ce('0x21')](function(_0x3c43f4){if(_0x3c43f4){if(_0x38076e[_0xe0ce('0x5b')][_0xe0ce('0x74')]){_0x49121f[_0xe0ce('0x29')][_0xe0ce('0x75')]=util[_0xe0ce('0x76')](_0xe0ce('0x77'),_0x38076e['user'][_0xe0ce('0x3a')]);_0x49121f[_0xe0ce('0x29')]['channel']=_0x49121f['channel'];_0x49121f[_0xe0ce('0x29')][_0xe0ce('0x78')]=_0x49121f[_0xe0ce('0x79')];_0x49121f[_0xe0ce('0x29')][_0xe0ce('0x7a')]=_0xe0ce('0x7b');return respondWithRpcPromise('EventManager',_0xe0ce('0x7c'),{'event':_0xe0ce('0x7d'),'message':_0x49121f[_0xe0ce('0x29')]},client9002)['then'](function(){return _0x49121f;});}return _0x49121f;}return null;})[_0xe0ce('0x21')](respondWithResult(_0x3f7f50,null))['catch'](handleError(_0x3f7f50,null));};var interaction_log=require(_0xe0ce('0x15'))('whatsapp-interactions');exports[_0xe0ce('0x36')]=function(_0x3b63ab,_0x452414,_0x3150d1){var _0x404900={'agent':{},'channel':_0xe0ce('0x5f')};if(_0x3b63ab['body']['id']){delete _0x3b63ab[_0xe0ce('0x5b')]['id'];}_0x3b63ab[_0xe0ce('0x5b')][_0xe0ce('0x63')]=_0x3b63ab[_0xe0ce('0x5b')][_0xe0ce('0x63')]||_0x3b63ab['user']['id'];_0x404900['agent']['id']=_0x3b63ab['body'][_0xe0ce('0x63')];return db[_0xe0ce('0x3c')][_0xe0ce('0x5a')]({'where':{'id':_0x3b63ab[_0xe0ce('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x452414,null))[_0xe0ce('0x21')](function(_0xa7e8f){if(_0xa7e8f){_0x404900[_0xe0ce('0x29')]=_0xa7e8f[_0xe0ce('0x7e')]({'plain':!![]});return db[_0xe0ce('0x66')]['find']({'where':{'id':_0xa7e8f[_0xe0ce('0x7f')]}});}return null;})[_0xe0ce('0x21')](handleEntityNotFound(_0x452414,null))['then'](function(_0x411d81){if(_0x411d81){_0x404900['interaction']=_0x411d81['get']({'plain':!![]});interaction_log[_0xe0ce('0x2a')](_0xe0ce('0x80'),_0x3b63ab['user']['id'],_0x3b63ab[_0xe0ce('0x64')][_0xe0ce('0x3a')],_0x3b63ab[_0xe0ce('0x64')][_0xe0ce('0x81')],_0x404900[_0xe0ce('0x6a')]['id'],_0x3b63ab['body']?JSON[_0xe0ce('0x26')](_0x3b63ab[_0xe0ce('0x5b')]):_0xe0ce('0x82'));return respondWithRpcPromise(_0xe0ce('0x83'),'rejectMessage',_0x404900);}return null;})[_0xe0ce('0x21')](function(_0x233f95){var _0x5a6f17=_0xe0ce('0x6c')+_0x233f95[_0xe0ce('0x29')][_0xe0ce('0x6d')];return db[_0xe0ce('0x6e')][_0xe0ce('0x42')](_0x5a6f17,{'type':db[_0xe0ce('0x6f')][_0xe0ce('0x84')][_0xe0ce('0x70')],'raw':!![]})['then'](function(_0x330b3a){return _0x330b3a;});})[_0xe0ce('0x21')](function(_0x536173){if(_0x536173){_0x404900[_0xe0ce('0x29')][_0xe0ce('0x71')]=_0x536173[0x0];if(!_0x3b63ab['body'][_0xe0ce('0x63')])return;return db[_0xe0ce('0x85')][_0xe0ce('0x5a')]({'where':{'id':_0x3b63ab[_0xe0ce('0x5b')][_0xe0ce('0x63')],'role':_0xe0ce('0x65')},'attributes':['id',_0xe0ce('0x3a'),_0xe0ce('0x86'),'email',_0xe0ce('0x73')],'raw':!![]});}return null;})[_0xe0ce('0x21')](function(_0x12ba48){if(!_0x12ba48)return null;_0x404900[_0xe0ce('0x29')]['agent']=_0x12ba48;return _0x404900;})[_0xe0ce('0x21')](function(_0x431a8d){if(_0x431a8d){_0x431a8d[_0xe0ce('0x29')][_0xe0ce('0x75')]=util['format'](_0xe0ce('0x77'),_0x3b63ab['user'][_0xe0ce('0x3a')]);_0x431a8d[_0xe0ce('0x29')]['channel']=_0x404900[_0xe0ce('0x79')];_0x431a8d[_0xe0ce('0x29')][_0xe0ce('0x78')]=_0x404900['channel'];_0x431a8d[_0xe0ce('0x29')][_0xe0ce('0x7a')]='reject';respondWithRpcPromise(_0xe0ce('0x7c'),_0xe0ce('0x7c'),{'event':_0xe0ce('0x87'),'message':_0x431a8d[_0xe0ce('0x29')]},client9002);return _0x404900;}return null;})[_0xe0ce('0x21')](respondWithResult(_0x452414,null))[_0xe0ce('0x56')](handleError(_0x452414,null));};exports['status']=function(_0x5ebefe,_0x50c19b,_0x54e29e){if(_0x5ebefe[_0xe0ce('0x5b')]['id']){delete _0x5ebefe[_0xe0ce('0x5b')]['id'];}var _0x277ee6;return db[_0xe0ce('0x3c')][_0xe0ce('0x5a')]({'where':{'id':_0x5ebefe[_0xe0ce('0x58')]['id']}})[_0xe0ce('0x21')](handleEntityNotFound(_0x50c19b,null))[_0xe0ce('0x21')](function(_0x5e0ff2){if(_0x5e0ff2){_0x277ee6=_0x5e0ff2;return db[_0xe0ce('0x88')][_0xe0ce('0x5a')]({'where':{'id':_0x5e0ff2[_0xe0ce('0x89')]}});}})[_0xe0ce('0x21')](handleEntityNotFound(_0x50c19b,null))[_0xe0ce('0x21')](function(_0x3ad2ac){if(_0x3ad2ac){logger[_0xe0ce('0x23')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0xe0ce('0x2d'),_0xe0ce('0x8a'),_0x3ad2ac[_0xe0ce('0x3e')],util['inspect'](_0x5ebefe[_0xe0ce('0x5b')],{'showHidden':![],'depth':null}));switch(_0x3ad2ac['type']){case'twilio':if(_0x5ebefe['body']['MessageSid']&&_0x5ebefe['body'][_0xe0ce('0x8b')]===_0x277ee6['messageId']&&_0x5ebefe[_0xe0ce('0x5b')][_0xe0ce('0x8c')]&&_0x5ebefe[_0xe0ce('0x5b')]['MessageStatus']===_0xe0ce('0x60')){return _0x277ee6[_0xe0ce('0x38')]({'read':!![]});}else{logger[_0xe0ce('0x27')](_0xe0ce('0x8d'),_0xe0ce('0x2d'),_0xe0ce('0x8e'),util[_0xe0ce('0x8f')](_0x5ebefe[_0xe0ce('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x277ee6;}})[_0xe0ce('0x21')](respondWithResult(_0x50c19b,null))[_0xe0ce('0x56')](handleError(_0x50c19b,null));};
\ No newline at end of file
+var _0x908b=['User','fullname','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','whatsapp-interactions','get','RejectMessage','rejectMessage','SELECT','email','WhatsappAccount','WhatsappAccountId','received\x20delivery\x20report\x20from','MessageSid','messageId','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','inspect','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','end','stack','name','send','index','WhatsappMessage','rawAttributes','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','params','includeAll','find','create','body','destroy','describe','accept','whatsapp','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','WhatsappInteraction','WhatsappInteractionId','isNil','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact'];(function(_0xabfe59,_0x301527){var _0x50f3d9=function(_0x279cd8){while(--_0x279cd8){_0xabfe59['push'](_0xabfe59['shift']());}};_0x50f3d9(++_0x301527);}(_0x908b,0x137));var _0xb908=function(_0x495257,_0x524707){_0x495257=_0x495257-0x0;var _0x3b49b3=_0x908b[_0x495257];return _0x3b49b3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb908('0x0'));var zipdir=require(_0xb908('0x1'));var jsonpatch=require(_0xb908('0x2'));var rp=require(_0xb908('0x3'));var moment=require(_0xb908('0x4'));var BPromise=require(_0xb908('0x5'));var Mustache=require('mustache');var util=require(_0xb908('0x6'));var path=require(_0xb908('0x7'));var sox=require(_0xb908('0x8'));var csv=require('to-csv');var ejs=require(_0xb908('0x9'));var fs=require('fs');var fs_extra=require(_0xb908('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb908('0xb'));var jsforce=require(_0xb908('0xc'));var deskjs=require(_0xb908('0xd'));var toCsv=require(_0xb908('0xe'));var querystring=require('querystring');var Papa=require(_0xb908('0xf'));var Redis=require('ioredis');var authService=require(_0xb908('0x10'));var qs=require(_0xb908('0x11'));var as=require(_0xb908('0x12'));var hardwareService=require(_0xb908('0x13'));var logger=require(_0xb908('0x14'))(_0xb908('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb908('0x16'));var db=require(_0xb908('0x17'))['db'];config[_0xb908('0x18')]=_[_0xb908('0x19')](config[_0xb908('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xb908('0x1a'))(new Redis(config['redis']));require(_0xb908('0x1b'))[_0xb908('0x1c')](socket);var jayson=require(_0xb908('0x1d'));var client=jayson[_0xb908('0x1e')][_0xb908('0x1f')]({'port':0x232c});var client9002=jayson[_0xb908('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x303ffa,_0x4b7ba8,_0xc1ace3,_0x1827f5){return new BPromise(function(_0x43f0fb,_0x382771){var _0x169c55=_0x1827f5||client;return _0x169c55[_0xb908('0x20')](_0x303ffa,_0xc1ace3)[_0xb908('0x21')](function(_0x16040a){logger['info'](_0xb908('0x22'),_0x4b7ba8,_0xb908('0x23'));logger[_0xb908('0x24')](_0xb908('0x25'),_0x4b7ba8,_0xb908('0x23'),JSON[_0xb908('0x26')](_0x16040a));if(_0x16040a['error']){if(_0x16040a[_0xb908('0x27')][_0xb908('0x28')]===0x1f4){logger[_0xb908('0x27')](_0xb908('0x22'),_0x4b7ba8,_0x16040a[_0xb908('0x27')][_0xb908('0x29')]);return _0x382771(_0x16040a[_0xb908('0x27')][_0xb908('0x29')]);}logger[_0xb908('0x27')](_0xb908('0x22'),_0x4b7ba8,_0x16040a[_0xb908('0x27')]['message']);return _0x43f0fb(_0x16040a[_0xb908('0x27')][_0xb908('0x29')]);}else{logger[_0xb908('0x2a')]('WhatsappMessage,\x20%s,\x20%s',_0x4b7ba8,_0xb908('0x23'));_0x43f0fb(_0x16040a[_0xb908('0x2b')]['message']);}})[_0xb908('0x2c')](function(_0x273344){logger[_0xb908('0x27')]('WhatsappMessage,\x20%s,\x20%s',_0x4b7ba8,_0x273344);_0x382771(_0x273344);});});}function respondWithStatusCode(_0x18ea26,_0x55b8d6){_0x55b8d6=_0x55b8d6||0xcc;return function(_0x6c39fa){if(_0x6c39fa){return _0x18ea26['sendStatus'](_0x55b8d6);}return _0x18ea26[_0xb908('0x2d')](_0x55b8d6)['end']();};}function respondWithResult(_0x52eb57,_0x384fcb){_0x384fcb=_0x384fcb||0xc8;return function(_0x2eb1cd){if(_0x2eb1cd){return _0x52eb57['status'](_0x384fcb)[_0xb908('0x2e')](_0x2eb1cd);}};}function respondWithFilteredResult(_0x37cd26,_0xc21027){return function(_0x3d7d3){if(_0x3d7d3){var _0x4ca3bf=typeof _0xc21027[_0xb908('0x2f')]==='undefined'&&typeof _0xc21027[_0xb908('0x30')]===_0xb908('0x31');var _0x419c29=_0x3d7d3[_0xb908('0x32')];var _0x524e05=_0x4ca3bf?0x0:_0xc21027[_0xb908('0x2f')];var _0x5453b9=_0x4ca3bf?_0x3d7d3[_0xb908('0x32')]:_0xc21027['offset']+_0xc21027[_0xb908('0x30')];var _0x315b2a;if(_0x5453b9>=_0x419c29){_0x5453b9=_0x419c29;_0x315b2a=0xc8;}else{_0x315b2a=0xce;}_0x37cd26[_0xb908('0x2d')](_0x315b2a);return _0x37cd26[_0xb908('0x33')](_0xb908('0x34'),_0x524e05+'-'+_0x5453b9+'/'+_0x419c29)['json'](_0x3d7d3);}return null;};}function patchUpdates(_0x3e53a4){return function(_0x21c54e){try{jsonpatch[_0xb908('0x35')](_0x21c54e,_0x3e53a4,!![]);}catch(_0x11a53c){return BPromise[_0xb908('0x36')](_0x11a53c);}return _0x21c54e[_0xb908('0x37')]();};}function saveUpdates(_0xd3be60,_0x1e465d){return function(_0x15aa4b){if(_0x15aa4b){return _0x15aa4b[_0xb908('0x38')](_0xd3be60)['then'](function(_0x5e7eac){return _0x5e7eac;});}return null;};}function removeEntity(_0x2ca2a3,_0x305188){return function(_0x1dc29f){if(_0x1dc29f){return _0x1dc29f['destroy']()[_0xb908('0x21')](function(){_0x2ca2a3[_0xb908('0x2d')](0xcc)[_0xb908('0x39')]();});}};}function handleEntityNotFound(_0x49a811,_0x4907fa){return function(_0xe4dbd5){if(!_0xe4dbd5){_0x49a811['sendStatus'](0x194);}return _0xe4dbd5;};}function handleError(_0x535b22,_0x57894b){_0x57894b=_0x57894b||0x1f4;return function(_0x40872a){logger[_0xb908('0x27')](_0x40872a[_0xb908('0x3a')]);if(_0x40872a[_0xb908('0x3b')]){delete _0x40872a[_0xb908('0x3b')];}_0x535b22['status'](_0x57894b)[_0xb908('0x3c')](_0x40872a);};}exports[_0xb908('0x3d')]=function(_0xaee53e,_0x140a6e){var _0x157d3e={},_0x4521fc={},_0x460d25={'count':0x0,'rows':[]};var _0x5eb0ee=_['map'](db[_0xb908('0x3e')][_0xb908('0x3f')],function(_0x414a35){return{'name':_0x414a35['fieldName'],'type':_0x414a35[_0xb908('0x40')][_0xb908('0x41')]};});_0x4521fc[_0xb908('0x42')]=_[_0xb908('0x43')](_0x5eb0ee,'name');_0x4521fc['query']=_[_0xb908('0x44')](_0xaee53e[_0xb908('0x45')]);_0x4521fc[_0xb908('0x46')]=_[_0xb908('0x47')](_0x4521fc['model'],_0x4521fc[_0xb908('0x45')]);_0x157d3e['attributes']=_['intersection'](_0x4521fc['model'],qs['fields'](_0xaee53e['query'][_0xb908('0x48')]));_0x157d3e[_0xb908('0x49')]=_0x157d3e[_0xb908('0x49')][_0xb908('0x4a')]?_0x157d3e[_0xb908('0x49')]:_0x4521fc[_0xb908('0x42')];if(!_0xaee53e[_0xb908('0x45')][_0xb908('0x4b')](_0xb908('0x4c'))){_0x157d3e[_0xb908('0x30')]=qs[_0xb908('0x30')](_0xaee53e[_0xb908('0x45')][_0xb908('0x30')]);_0x157d3e[_0xb908('0x2f')]=qs[_0xb908('0x2f')](_0xaee53e[_0xb908('0x45')][_0xb908('0x2f')]);}_0x157d3e[_0xb908('0x4d')]=qs[_0xb908('0x4e')](_0xaee53e[_0xb908('0x45')]['sort']);_0x157d3e[_0xb908('0x4f')]=qs[_0xb908('0x46')](_[_0xb908('0x50')](_0xaee53e[_0xb908('0x45')],_0x4521fc['filters']),_0x5eb0ee);if(_0xaee53e[_0xb908('0x45')]['filter']){_0x157d3e[_0xb908('0x4f')]=_[_0xb908('0x51')](_0x157d3e[_0xb908('0x4f')],{'$or':_[_0xb908('0x43')](_0x5eb0ee,function(_0x1c6bcc){if(_0x1c6bcc[_0xb908('0x40')]!==_0xb908('0x52')){var _0x371d13={};_0x371d13[_0x1c6bcc['name']]={'$like':'%'+_0xaee53e['query'][_0xb908('0x53')]+'%'};return _0x371d13;}})});}_0x157d3e=_['merge']({},_0x157d3e,_0xaee53e[_0xb908('0x54')]);var _0x4c9d40={'where':_0x157d3e['where']};return db[_0xb908('0x3e')][_0xb908('0x32')](_0x4c9d40)[_0xb908('0x21')](function(_0xac5e39){_0x460d25['count']=_0xac5e39;if(_0xaee53e[_0xb908('0x45')]['includeAll']){_0x157d3e[_0xb908('0x55')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xb908('0x56')](_0x157d3e);})[_0xb908('0x21')](function(_0xbc3f09){_0x460d25[_0xb908('0x57')]=_0xbc3f09;return _0x460d25;})[_0xb908('0x21')](respondWithFilteredResult(_0x140a6e,_0x157d3e))[_0xb908('0x2c')](handleError(_0x140a6e,null));};exports['show']=function(_0xf7cc8a,_0x518c64){var _0x2177d9={'raw':!![],'where':{'id':_0xf7cc8a[_0xb908('0x58')]['id']}},_0x147495={};_0x147495[_0xb908('0x42')]=_[_0xb908('0x44')](db[_0xb908('0x3e')][_0xb908('0x3f')]);_0x147495[_0xb908('0x45')]=_[_0xb908('0x44')](_0xf7cc8a[_0xb908('0x45')]);_0x147495[_0xb908('0x46')]=_[_0xb908('0x47')](_0x147495['model'],_0x147495[_0xb908('0x45')]);_0x2177d9['attributes']=_[_0xb908('0x47')](_0x147495['model'],qs[_0xb908('0x48')](_0xf7cc8a[_0xb908('0x45')][_0xb908('0x48')]));_0x2177d9[_0xb908('0x49')]=_0x2177d9['attributes']['length']?_0x2177d9[_0xb908('0x49')]:_0x147495[_0xb908('0x42')];if(_0xf7cc8a[_0xb908('0x45')][_0xb908('0x59')]){_0x2177d9[_0xb908('0x55')]=[{'all':!![]}];}_0x2177d9=_[_0xb908('0x51')]({},_0x2177d9,_0xf7cc8a[_0xb908('0x54')]);return db[_0xb908('0x3e')][_0xb908('0x5a')](_0x2177d9)[_0xb908('0x21')](handleEntityNotFound(_0x518c64,null))[_0xb908('0x21')](respondWithResult(_0x518c64,null))[_0xb908('0x2c')](handleError(_0x518c64,null));};exports[_0xb908('0x5b')]=function(_0x19abe6,_0xfc9b18){return db[_0xb908('0x3e')][_0xb908('0x5b')](_0x19abe6[_0xb908('0x5c')],{})[_0xb908('0x21')](respondWithResult(_0xfc9b18,0xc9))[_0xb908('0x2c')](handleError(_0xfc9b18,null));};exports[_0xb908('0x38')]=function(_0x420133,_0x350d25){if(_0x420133[_0xb908('0x5c')]['id']){delete _0x420133['body']['id'];}return db['WhatsappMessage'][_0xb908('0x5a')]({'where':{'id':_0x420133[_0xb908('0x58')]['id']}})[_0xb908('0x21')](handleEntityNotFound(_0x350d25,null))[_0xb908('0x21')](saveUpdates(_0x420133['body'],null))[_0xb908('0x21')](respondWithResult(_0x350d25,null))[_0xb908('0x2c')](handleError(_0x350d25,null));};exports[_0xb908('0x5d')]=function(_0x312dc4,_0x38a1f9){return db['WhatsappMessage']['find']({'where':{'id':_0x312dc4[_0xb908('0x58')]['id']}})[_0xb908('0x21')](handleEntityNotFound(_0x38a1f9,null))[_0xb908('0x21')](removeEntity(_0x38a1f9,null))[_0xb908('0x2c')](handleError(_0x38a1f9,null));};exports[_0xb908('0x5e')]=function(_0x298954,_0xe67279){return db[_0xb908('0x3e')][_0xb908('0x5e')]()[_0xb908('0x21')](respondWithResult(_0xe67279,null))[_0xb908('0x2c')](handleError(_0xe67279,null));};var interaction_log=require(_0xb908('0x14'))('whatsapp-interactions');exports[_0xb908('0x5f')]=function(_0x25c861,_0x2ff9bd,_0x272983){var _0x449438={'agent':{},'channel':_0xb908('0x60')};if(_0x25c861['body']['id']){delete _0x25c861[_0xb908('0x5c')]['id'];}_0x25c861['body']['read']=!![];_0x25c861[_0xb908('0x5c')][_0xb908('0x61')]=moment()[_0xb908('0x62')](_0xb908('0x63'));_0x25c861[_0xb908('0x5c')][_0xb908('0x64')]=_0x25c861[_0xb908('0x5c')][_0xb908('0x64')]||_0x25c861['user']['id'];_0x449438[_0xb908('0x65')]['id']=_0x25c861[_0xb908('0x5c')][_0xb908('0x64')];return db[_0xb908('0x3e')][_0xb908('0x5a')]({'where':{'id':_0x25c861[_0xb908('0x58')]['id'],'UserId':null}})[_0xb908('0x21')](handleEntityNotFound(_0x2ff9bd,null))['then'](saveUpdates(_0x25c861['body'],null))['then'](function(_0x5b3ca2){if(_0x5b3ca2){_0x449438[_0xb908('0x29')]=_0x5b3ca2['get']({'plain':!![]});return db[_0xb908('0x66')][_0xb908('0x5a')]({'where':{'id':_0x5b3ca2[_0xb908('0x67')]}});}return null;})[_0xb908('0x21')](handleEntityNotFound(_0x2ff9bd,null))[_0xb908('0x21')](function(_0x1372a3){if(_0x1372a3){return _0x1372a3[_0xb908('0x38')]({'UserId':_0x25c861[_0xb908('0x5c')][_0xb908('0x64')],'read1stAt':_[_0xb908('0x68')](_0x1372a3['read1stAt'])?moment()['format'](_0xb908('0x63')):undefined});}return null;})['then'](function(_0x525c33){if(_0x525c33){_0x449438[_0xb908('0x69')]=_0x525c33['get']({'plain':!![]});interaction_log[_0xb908('0x2a')](_0xb908('0x6a'),_0x25c861[_0xb908('0x6b')]['id'],_0x25c861[_0xb908('0x6b')][_0xb908('0x3b')],_0x25c861[_0xb908('0x6b')][_0xb908('0x6c')],_0x449438[_0xb908('0x69')]['id'],_0x25c861[_0xb908('0x5c')]?JSON['stringify'](_0x25c861[_0xb908('0x5c')]):_0xb908('0x6d'));return respondWithRpcPromise(_0xb908('0x6e'),_0xb908('0x6f'),_0x449438);}return null;})[_0xb908('0x21')](function(_0x2e392c){var _0x31a285=_0xb908('0x70')+_0x2e392c['message'][_0xb908('0x71')];return db[_0xb908('0x72')]['query'](_0x31a285,{'type':db[_0xb908('0x73')][_0xb908('0x74')]['SELECT'],'raw':!![]})['then'](function(_0x20876c){return _0x20876c;});})[_0xb908('0x21')](function(_0x474c2b){if(_0x474c2b){_0x449438[_0xb908('0x29')][_0xb908('0x75')]=_0x474c2b[0x0];if(!_0x25c861['body'][_0xb908('0x64')])return;return db[_0xb908('0x76')]['find']({'where':{'id':_0x25c861['body'][_0xb908('0x64')],'role':_0xb908('0x65')},'attributes':['id',_0xb908('0x3b'),_0xb908('0x77'),'email',_0xb908('0x78')],'raw':!![]});}return null;})['then'](function(_0x337fb4){if(!_0x337fb4)return null;_0x449438[_0xb908('0x29')][_0xb908('0x65')]=_0x337fb4;return _0x449438;})[_0xb908('0x21')](function(_0x5ed229){if(_0x5ed229){if(_0x25c861['body'][_0xb908('0x79')]){_0x449438[_0xb908('0x29')]['interface']=util['format'](_0xb908('0x7a'),_0x25c861[_0xb908('0x6b')]['name']);_0x449438[_0xb908('0x29')][_0xb908('0x7b')]=_0x449438[_0xb908('0x7b')];_0x449438[_0xb908('0x29')][_0xb908('0x7c')]=_0x449438[_0xb908('0x7b')];_0x449438[_0xb908('0x29')][_0xb908('0x7d')]=_0xb908('0x5f');return respondWithRpcPromise(_0xb908('0x7e'),'EventManager',{'event':'acceptmessage','message':_0x449438[_0xb908('0x29')]},client9002)[_0xb908('0x21')](function(){return _0x449438;});}return _0x449438;}return null;})[_0xb908('0x21')](respondWithResult(_0x2ff9bd,null))[_0xb908('0x2c')](handleError(_0x2ff9bd,null));};var interaction_log=require(_0xb908('0x14'))(_0xb908('0x7f'));exports[_0xb908('0x36')]=function(_0x21e654,_0x40250d,_0x5357e3){var _0xfd3da0={'agent':{},'channel':_0xb908('0x60')};if(_0x21e654['body']['id']){delete _0x21e654[_0xb908('0x5c')]['id'];}_0x21e654['body'][_0xb908('0x64')]=_0x21e654[_0xb908('0x5c')]['UserId']||_0x21e654['user']['id'];_0xfd3da0[_0xb908('0x65')]['id']=_0x21e654[_0xb908('0x5c')]['UserId'];return db[_0xb908('0x3e')][_0xb908('0x5a')]({'where':{'id':_0x21e654[_0xb908('0x58')]['id'],'UserId':null}})[_0xb908('0x21')](handleEntityNotFound(_0x40250d,null))[_0xb908('0x21')](function(_0x41ba46){if(_0x41ba46){_0xfd3da0['message']=_0x41ba46[_0xb908('0x80')]({'plain':!![]});return db[_0xb908('0x66')]['find']({'where':{'id':_0x41ba46[_0xb908('0x67')]}});}return null;})[_0xb908('0x21')](handleEntityNotFound(_0x40250d,null))[_0xb908('0x21')](function(_0x159740){if(_0x159740){_0xfd3da0['interaction']=_0x159740[_0xb908('0x80')]({'plain':!![]});interaction_log[_0xb908('0x2a')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x21e654[_0xb908('0x6b')]['id'],_0x21e654[_0xb908('0x6b')][_0xb908('0x3b')],_0x21e654[_0xb908('0x6b')]['role'],_0xfd3da0['interaction']['id'],_0x21e654['body']?JSON[_0xb908('0x26')](_0x21e654[_0xb908('0x5c')]):'null');return respondWithRpcPromise(_0xb908('0x81'),_0xb908('0x82'),_0xfd3da0);}return null;})['then'](function(_0x581e7a){var _0x4beae2='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x581e7a['message'][_0xb908('0x71')];return db['sequelize']['query'](_0x4beae2,{'type':db['Sequelize'][_0xb908('0x74')][_0xb908('0x83')],'raw':!![]})['then'](function(_0xa7b819){return _0xa7b819;});})['then'](function(_0x401088){if(_0x401088){_0xfd3da0[_0xb908('0x29')][_0xb908('0x75')]=_0x401088[0x0];if(!_0x21e654[_0xb908('0x5c')][_0xb908('0x64')])return;return db[_0xb908('0x76')][_0xb908('0x5a')]({'where':{'id':_0x21e654[_0xb908('0x5c')]['UserId'],'role':_0xb908('0x65')},'attributes':['id','name',_0xb908('0x77'),_0xb908('0x84'),_0xb908('0x78')],'raw':!![]});}return null;})[_0xb908('0x21')](function(_0x26add7){if(!_0x26add7)return null;_0xfd3da0[_0xb908('0x29')]['agent']=_0x26add7;return _0xfd3da0;})[_0xb908('0x21')](function(_0x42ea5d){if(_0x42ea5d){_0x42ea5d[_0xb908('0x29')]['interface']=util[_0xb908('0x62')](_0xb908('0x7a'),_0x21e654['user'][_0xb908('0x3b')]);_0x42ea5d[_0xb908('0x29')]['channel']=_0xfd3da0[_0xb908('0x7b')];_0x42ea5d[_0xb908('0x29')]['motionChannel']=_0xfd3da0[_0xb908('0x7b')];_0x42ea5d[_0xb908('0x29')]['event']=_0xb908('0x36');respondWithRpcPromise(_0xb908('0x7e'),'EventManager',{'event':'rejectmessage','message':_0x42ea5d[_0xb908('0x29')]},client9002);return _0xfd3da0;}return null;})[_0xb908('0x21')](respondWithResult(_0x40250d,null))[_0xb908('0x2c')](handleError(_0x40250d,null));};exports['status']=function(_0x5813f6,_0x4bb91f,_0x2b48e2){if(_0x5813f6[_0xb908('0x5c')]['id']){delete _0x5813f6[_0xb908('0x5c')]['id'];}var _0x240393;return db['WhatsappMessage'][_0xb908('0x5a')]({'where':{'id':_0x5813f6[_0xb908('0x58')]['id']}})['then'](handleEntityNotFound(_0x4bb91f,null))[_0xb908('0x21')](function(_0x42aba7){if(_0x42aba7){_0x240393=_0x42aba7;return db[_0xb908('0x85')][_0xb908('0x5a')]({'where':{'id':_0x42aba7[_0xb908('0x86')]}});}})['then'](handleEntityNotFound(_0x4bb91f,null))[_0xb908('0x21')](function(_0x2c3d33){if(_0x2c3d33){logger[_0xb908('0x24')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0xb908('0x2d'),_0xb908('0x87'),_0x2c3d33[_0xb908('0x40')],util['inspect'](_0x5813f6[_0xb908('0x5c')],{'showHidden':![],'depth':null}));switch(_0x2c3d33[_0xb908('0x40')]){case'twilio':if(_0x5813f6[_0xb908('0x5c')]['MessageSid']&&_0x5813f6['body'][_0xb908('0x88')]===_0x240393[_0xb908('0x89')]&&_0x5813f6[_0xb908('0x5c')]['MessageStatus']&&_0x5813f6[_0xb908('0x5c')][_0xb908('0x8a')]===_0xb908('0x8b')){return _0x240393[_0xb908('0x38')]({'read':!![]});}else{logger[_0xb908('0x27')](_0xb908('0x8c'),_0xb908('0x2d'),_0xb908('0x8d'),util[_0xb908('0x8e')](_0x5813f6['body'],{'showHidden':![],'depth':null}));}break;}return _0x240393;}})[_0xb908('0x21')](respondWithResult(_0x4bb91f,null))[_0xb908('0x2c')](handleError(_0x4bb91f,null));};
\ No newline at end of file
index 66b9648..e58b3ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5b5=['hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x388dcc,_0x228e1b){var _0x14337f=function(_0x26dc4b){while(--_0x26dc4b){_0x388dcc['push'](_0x388dcc['shift']());}};_0x14337f(++_0x228e1b);}(_0xe5b5,0x12b));var _0x5e5b=function(_0xf51c06,_0x388e5b){_0xf51c06=_0xf51c06-0x0;var _0x1d5420=_0xe5b5[_0xf51c06];return _0x1d5420;};'use strict';var EventEmitter=require(_0x5e5b('0x0'));var WhatsappMessage=require(_0x5e5b('0x1'))['db'][_0x5e5b('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x5e5b('0x3')](0x0);var events={'afterCreate':_0x5e5b('0x4'),'afterUpdate':_0x5e5b('0x5'),'afterDestroy':_0x5e5b('0x6')};function emitEvent(_0x3dc763){return function(_0xf20c6a,_0x20a50c,_0xdc6616){WhatsappMessageEvents[_0x5e5b('0x7')](_0x3dc763+':'+_0xf20c6a['id'],_0xf20c6a);WhatsappMessageEvents[_0x5e5b('0x7')](_0x3dc763,_0xf20c6a);_0xdc6616(null);};}for(var e in events){if(events[_0x5e5b('0x8')](e)){var event=events[e];WhatsappMessage[_0x5e5b('0x9')](e,emitEvent(event));}}module[_0x5e5b('0xa')]=WhatsappMessageEvents;
\ No newline at end of file
+var _0xaaa2=['hook','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x53fb43,_0x223a27){var _0x35ca6e=function(_0x3a0828){while(--_0x3a0828){_0x53fb43['push'](_0x53fb43['shift']());}};_0x35ca6e(++_0x223a27);}(_0xaaa2,0xac));var _0x2aaa=function(_0x2a2096,_0x2f4bd2){_0x2a2096=_0x2a2096-0x0;var _0x5586ce=_0xaaa2[_0x2a2096];return _0x5586ce;};'use strict';var EventEmitter=require(_0x2aaa('0x0'));var WhatsappMessage=require(_0x2aaa('0x1'))['db'][_0x2aaa('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x2aaa('0x3')](0x0);var events={'afterCreate':_0x2aaa('0x4'),'afterUpdate':_0x2aaa('0x5'),'afterDestroy':'remove'};function emitEvent(_0xfc076){return function(_0x482489,_0x35b5c8,_0x340071){WhatsappMessageEvents[_0x2aaa('0x6')](_0xfc076+':'+_0x482489['id'],_0x482489);WhatsappMessageEvents[_0x2aaa('0x6')](_0xfc076,_0x482489);_0x340071(null);};}for(var e in events){if(events[_0x2aaa('0x7')](e)){var event=events[e];WhatsappMessage[_0x2aaa('0x8')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents;
\ No newline at end of file
index f1280f7..8e85977 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46e1=['path','rimraf','../../config/environment','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteractionId','then','update','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','phone','messages','create','/api/whatsapp/messages/','token','sid','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','authToken','info','AC\x20send\x20botId:%s','AC\x20send\x20phoneNbr:%s','/whatsapp/v1/','text','body','POST','Bearer\x20','application/json','statuses','log','finally','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x31536c,_0x46711d){var _0x20db19=function(_0x1618d9){while(--_0x1618d9){_0x31536c['push'](_0x31536c['shift']());}};_0x20db19(++_0x46711d);}(_0x46e1,0x155));var _0x146e=function(_0x3ca16f,_0x2d4091){_0x3ca16f=_0x3ca16f-0x0;var _0x14b70e=_0x46e1[_0x3ca16f];return _0x14b70e;};'use strict';var _=require(_0x146e('0x0'));var util=require(_0x146e('0x1'));var logger=require(_0x146e('0x2'))(_0x146e('0x3'));var moment=require(_0x146e('0x4'));var BPromise=require(_0x146e('0x5'));var rp=require(_0x146e('0x6'));var fs=require('fs');var path=require(_0x146e('0x7'));var rimraf=require(_0x146e('0x8'));var config=require(_0x146e('0x9'));var attributes=require('./whatsappMessage.attributes');module[_0x146e('0xa')]=function(_0x1f1f15,_0x3de564){return _0x1f1f15[_0x146e('0xb')](_0x146e('0xc'),attributes,{'tableName':_0x146e('0xd'),'paranoid':![],'indexes':[{'name':_0x146e('0xe'),'fields':['messageId']},{'name':_0x146e('0xf'),'fields':['body'],'type':_0x146e('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xf7d20d,_0xcf7c1e,_0x453b5a){var _0x15cea1=_0x1f1f15[_0x146e('0x11')];var _0x5d6766=_0xf7d20d['get']({'plain':!![]});if(_0x5d6766[_0x146e('0x12')][_0x146e('0x13')]()==='in'||_0x5d6766[_0x146e('0x12')][_0x146e('0x13')]()===_0x146e('0x14')&&!_0x5d6766[_0x146e('0x15')]&&!_[_0x146e('0x16')](_0x5d6766[_0x146e('0x17')])){_0x15cea1['WhatsappInteraction']['findOne']({'where':{'id':_0x5d6766[_0x146e('0x18')]}})[_0x146e('0x19')](function(_0x18e9bc){if(_0x18e9bc){_0x18e9bc[_0x146e('0x1a')]({'lastMsgAt':_0x5d6766[_0x146e('0x1b')],'lastMsgDirection':_0x5d6766[_0x146e('0x12')][_0x146e('0x13')]()});}})[_0x146e('0x1c')](function(_0x44c82f){console[_0x146e('0x1d')](_0x44c82f);});}if(_0x5d6766[_0x146e('0x12')]==='out'&&!_0x5d6766[_0x146e('0x15')]){var _0x1a8a20;_0x15cea1[_0x146e('0x1e')][_0x146e('0x1f')]({'where':{'id':_0x5d6766[_0x146e('0x20')]},'raw':!![]})[_0x146e('0x19')](function(_0x256db5){_0x1a8a20=_0x256db5;if(_0x1a8a20&&_0x1a8a20['type']){switch(_0x1a8a20[_0x146e('0x21')]){case'twilio':var _0x109cfe=require(_0x146e('0x22'));if(_0x1a8a20[_0x146e('0x23')]&&_0x1a8a20['authToken']&&_0x1a8a20[_0x146e('0x24')]){var _0x559f54=new _0x109cfe(_0x1a8a20[_0x146e('0x23')],_0x1a8a20['authToken']);_0x559f54[_0x146e('0x25')][_0x146e('0x26')]({'body':_0x5d6766['body'],'to':'whatsapp:'+_0x5d6766['phone'],'from':'whatsapp:'+_0x1a8a20['phone'],'statusCallback':_0x1a8a20['remote']+_0x146e('0x27')+_0x5d6766['id']+'/status?token='+_0x1a8a20[_0x146e('0x28')]})[_0x146e('0x19')](function(_0xc39f4d){if(_0xc39f4d[_0x146e('0x29')]){return _0xf7d20d[_0x146e('0x1a')]({'messageId':_0xc39f4d[_0x146e('0x29')]});}})[_0x146e('0x1c')](function(_0x4cc850){logger[_0x146e('0x1d')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x146e('0x2a'),'twilio',util['inspect'](_0x4cc850,{'showHidden':![],'depth':null}));});}else{logger[_0x146e('0x1d')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x146e('0x2a'),_0x146e('0x22'),_0x146e('0x2b'));}break;case _0x146e('0x2c'):var _0x3a0bf3=_0x1a8a20['accountSid'];var _0x1ce964=_0x1a8a20[_0x146e('0x24')];var _0x11b869=_0x1a8a20[_0x146e('0x2d')];logger[_0x146e('0x2e')](_0x146e('0x2f'),_0x3a0bf3);logger[_0x146e('0x2e')](_0x146e('0x30'),_0x1ce964);logger['info']('AC\x20send\x20bearerToken:%s',_0x11b869);var _0x37c5d8=_0x1a8a20['baseUrl']+_0x146e('0x31')+_0x3a0bf3+'/messages/';var _0x52b279={'to':[_0x1ce964],'message':{'type':_0x146e('0x32'),'text':_0x5d6766[_0x146e('0x33')]}};var _0x32b23c={'method':_0x146e('0x34'),'uri':_0x37c5d8,'headers':{'Authorization':_0x146e('0x35')+_0x11b869,'Content-Type':_0x146e('0x36')},'body':JSON['stringify'](_0x52b279),'json':!![]};logger[_0x146e('0x2e')]('AC\x20send\x20data:%s',_0x52b279);logger[_0x146e('0x2e')]('AC\x20send\x20postReq:%s',_0x32b23c);rp(_0x32b23c)[_0x146e('0x19')](function(_0x2b9dd2){if(_0x2b9dd2[_0x146e('0x37')][0x0]['message_id']){return _0xf7d20d[_0x146e('0x1a')]({'messageId':_0x2b9dd2[_0x146e('0x37')][0x0]['message_id']});}})[_0x146e('0x19')](function(_0x3271e1){console[_0x146e('0x38')](_0x3271e1);})[_0x146e('0x1c')](function(_0x449162){console[_0x146e('0x38')](_0x449162);});break;}}})[_0x146e('0x39')](function(){_0x453b5a();});}else{_0x453b5a();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xf781=['WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','accountSid','info','AC\x20send\x20botId:%s','AC\x20send\x20phoneNbr:%s','baseUrl','Bearer\x20','application/json','AC\x20send\x20data:%s','stringify','AC\x20send\x20postReq:%s','statuses','message_id','log','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','direction','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','toLowerCase','error','WhatsappAccount','WhatsappAccountId','type','twilio','authToken','phone','whatsapp:','remote','token','update','sid','catch'];(function(_0x19e21e,_0x1e00ca){var _0x145d05=function(_0x158606){while(--_0x158606){_0x19e21e['push'](_0x19e21e['shift']());}};_0x145d05(++_0x1e00ca);}(_0xf781,0xd2));var _0x1f78=function(_0x5be227,_0x42d411){_0x5be227=_0x5be227-0x0;var _0xd9e0e=_0xf781[_0x5be227];return _0xd9e0e;};'use strict';var _=require(_0x1f78('0x0'));var util=require('util');var logger=require(_0x1f78('0x1'))(_0x1f78('0x2'));var moment=require(_0x1f78('0x3'));var BPromise=require(_0x1f78('0x4'));var rp=require(_0x1f78('0x5'));var fs=require('fs');var path=require(_0x1f78('0x6'));var rimraf=require(_0x1f78('0x7'));var config=require(_0x1f78('0x8'));var attributes=require(_0x1f78('0x9'));module[_0x1f78('0xa')]=function(_0x36d7c1,_0x38cfca){return _0x36d7c1[_0x1f78('0xb')](_0x1f78('0xc'),attributes,{'tableName':_0x1f78('0xd'),'paranoid':![],'indexes':[{'name':_0x1f78('0xe'),'fields':[_0x1f78('0xe')]},{'name':_0x1f78('0xf'),'fields':[_0x1f78('0x10')],'type':_0x1f78('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x16213b,_0x297a6e,_0x509aa1){var _0x30346b=_0x36d7c1[_0x1f78('0x12')];var _0x476276=_0x16213b['get']({'plain':!![]});if(_0x476276[_0x1f78('0x13')]['toLowerCase']()==='in'||_0x476276[_0x1f78('0x13')]['toLowerCase']()===_0x1f78('0x14')&&!_0x476276[_0x1f78('0x15')]&&!_[_0x1f78('0x16')](_0x476276[_0x1f78('0x17')])){_0x30346b[_0x1f78('0x18')][_0x1f78('0x19')]({'where':{'id':_0x476276[_0x1f78('0x1a')]}})[_0x1f78('0x1b')](function(_0x1bc2da){if(_0x1bc2da){_0x1bc2da['update']({'lastMsgAt':_0x476276['createdAt'],'lastMsgDirection':_0x476276[_0x1f78('0x13')][_0x1f78('0x1c')]()});}})['catch'](function(_0x5beb70){console[_0x1f78('0x1d')](_0x5beb70);});}if(_0x476276['direction']===_0x1f78('0x14')&&!_0x476276[_0x1f78('0x15')]){var _0x51c3ea;_0x30346b[_0x1f78('0x1e')]['find']({'where':{'id':_0x476276[_0x1f78('0x1f')]},'raw':!![]})[_0x1f78('0x1b')](function(_0x4f3c14){_0x51c3ea=_0x4f3c14;if(_0x51c3ea&&_0x51c3ea[_0x1f78('0x20')]){switch(_0x51c3ea['type']){case _0x1f78('0x21'):var _0x4d4826=require(_0x1f78('0x21'));if(_0x51c3ea['accountSid']&&_0x51c3ea[_0x1f78('0x22')]&&_0x51c3ea[_0x1f78('0x23')]){var _0x50c595=new _0x4d4826(_0x51c3ea['accountSid'],_0x51c3ea[_0x1f78('0x22')]);_0x50c595['messages']['create']({'body':_0x476276['body'],'to':_0x1f78('0x24')+_0x476276['phone'],'from':_0x1f78('0x24')+_0x51c3ea[_0x1f78('0x23')],'statusCallback':_0x51c3ea[_0x1f78('0x25')]+'/api/whatsapp/messages/'+_0x476276['id']+'/status?token='+_0x51c3ea[_0x1f78('0x26')]})['then'](function(_0x116da8){if(_0x116da8['sid']){return _0x16213b[_0x1f78('0x27')]({'messageId':_0x116da8[_0x1f78('0x28')]});}})[_0x1f78('0x29')](function(_0x110788){logger[_0x1f78('0x1d')](_0x1f78('0x2a'),'afterCreate','twilio',util[_0x1f78('0x2b')](_0x110788,{'showHidden':![],'depth':null}));});}else{logger[_0x1f78('0x1d')](_0x1f78('0x2a'),_0x1f78('0x2c'),_0x1f78('0x21'),_0x1f78('0x2d'));}break;case _0x1f78('0x2e'):var _0x53225b=_0x51c3ea[_0x1f78('0x2f')];var _0x148d0f=_0x51c3ea[_0x1f78('0x23')];var _0x1be105=_0x51c3ea['authToken'];logger[_0x1f78('0x30')](_0x1f78('0x31'),_0x53225b);logger[_0x1f78('0x30')](_0x1f78('0x32'),_0x148d0f);logger[_0x1f78('0x30')]('AC\x20send\x20bearerToken:%s',_0x1be105);var _0x1aa8d3=_0x51c3ea[_0x1f78('0x33')]+'/whatsapp/v1/'+_0x53225b+'/messages/';var _0x57e212={'to':[_0x148d0f],'message':{'type':'text','text':_0x476276[_0x1f78('0x10')]}};var _0x3607a3={'method':'POST','uri':_0x1aa8d3,'headers':{'Authorization':_0x1f78('0x34')+_0x1be105,'Content-Type':_0x1f78('0x35')},'body':JSON['stringify'](_0x57e212),'json':!![]};logger[_0x1f78('0x30')](_0x1f78('0x36'),JSON[_0x1f78('0x37')](_0x57e212));logger[_0x1f78('0x30')](_0x1f78('0x38'),JSON[_0x1f78('0x37')](_0x3607a3));rp(_0x3607a3)['then'](function(_0x354588){if(_0x354588[_0x1f78('0x39')][0x0][_0x1f78('0x3a')]){return _0x16213b[_0x1f78('0x27')]({'messageId':_0x354588[_0x1f78('0x39')][0x0][_0x1f78('0x3a')]});}})['then'](function(_0xf8dab6){console[_0x1f78('0x3b')](_0xf8dab6);})[_0x1f78('0x29')](function(_0x2de82b){console[_0x1f78('0x3b')](_0x2de82b);});break;}}})[_0x1f78('0x3c')](function(){_0x509aa1();});}else{_0x509aa1();}}},'charset':_0x1f78('0x3d'),'collate':_0x1f78('0x3e')});};
\ No newline at end of file
index 8cd1e13..1eb40aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb9e=['rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./whatsappMessage.socket','register','request','then','info','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','WhatsappMessage,\x20%s,\x20%s','result','CreateWhatsappMessage','create','options','raw','debug','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xbb9e,0x159));var _0xebb9=function(_0x38d8e6,_0x3a203){_0x38d8e6=_0x38d8e6-0x0;var _0x195efb=_0xbb9e[_0x38d8e6];return _0x195efb;};'use strict';var _=require(_0xebb9('0x0'));var util=require('util');var moment=require(_0xebb9('0x1'));var BPromise=require(_0xebb9('0x2'));var rs=require(_0xebb9('0x3'));var fs=require('fs');var Redis=require(_0xebb9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xebb9('0x5'));var logger=require(_0xebb9('0x6'))(_0xebb9('0x7'));var config=require(_0xebb9('0x8'));var jayson=require(_0xebb9('0x9'));var client=jayson[_0xebb9('0xa')][_0xebb9('0xb')]({'port':0x232a});config['redis']=_[_0xebb9('0xc')](config[_0xebb9('0xd')],{'host':_0xebb9('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xebb9('0xd')]));require(_0xebb9('0xf'))[_0xebb9('0x10')](socket);function respondWithRpcPromise(_0x44974a,_0x5b2c0e,_0x25e832){return new BPromise(function(_0x219f0d,_0x594f7e){return client[_0xebb9('0x11')](_0x44974a,_0x25e832)[_0xebb9('0x12')](function(_0x43e9e0){logger[_0xebb9('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x5b2c0e,_0xebb9('0x14'));logger['debug'](_0xebb9('0x15'),_0x5b2c0e,_0xebb9('0x14'),JSON['stringify'](_0x43e9e0));if(_0x43e9e0[_0xebb9('0x16')]){if(_0x43e9e0[_0xebb9('0x16')][_0xebb9('0x17')]===0x1f4){logger[_0xebb9('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x5b2c0e,_0x43e9e0[_0xebb9('0x16')][_0xebb9('0x18')]);return _0x594f7e(_0x43e9e0['error'][_0xebb9('0x18')]);}logger[_0xebb9('0x16')](_0xebb9('0x19'),_0x5b2c0e,_0x43e9e0[_0xebb9('0x16')][_0xebb9('0x18')]);return _0x219f0d(_0x43e9e0[_0xebb9('0x16')][_0xebb9('0x18')]);}else{logger[_0xebb9('0x13')](_0xebb9('0x19'),_0x5b2c0e,_0xebb9('0x14'));_0x219f0d(_0x43e9e0[_0xebb9('0x1a')][_0xebb9('0x18')]);}})['catch'](function(_0x4a7e9f){logger[_0xebb9('0x16')](_0xebb9('0x19'),_0x5b2c0e,_0x4a7e9f);_0x594f7e(_0x4a7e9f);});});}exports[_0xebb9('0x1b')]=function(_0x56f826){var _0x1e3beb=this;return new Promise(function(_0x4c353b,_0x5d1a9a){return db['WhatsappMessage'][_0xebb9('0x1c')](_0x56f826['body'],{'raw':_0x56f826[_0xebb9('0x1d')]?_0x56f826['options'][_0xebb9('0x1e')]===undefined?!![]:![]:!![]})[_0xebb9('0x12')](function(_0x5f3310){logger[_0xebb9('0x13')](_0xebb9('0x1b'),_0x56f826);logger[_0xebb9('0x1f')](_0xebb9('0x1b'),_0x56f826,JSON['stringify'](_0x5f3310));_0x4c353b(_0x5f3310);})['catch'](function(_0x5b50e2){logger[_0xebb9('0x16')](_0xebb9('0x1b'),_0x5b50e2[_0xebb9('0x18')],_0x56f826);_0x5d1a9a(_0x1e3beb[_0xebb9('0x16')](0x1f4,_0x5b50e2[_0xebb9('0x18')]));});});};
\ No newline at end of file
+var _0x9bab=['debug','stringify','error','message','result','catch','body','options','raw','then','moment','randomstring','../../config/utils','../../config/environment','client','http','defaults','redis','socket.io-emitter','register','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x2e0584,_0x264d0f){var _0x4a1435=function(_0x92e7c4){while(--_0x92e7c4){_0x2e0584['push'](_0x2e0584['shift']());}};_0x4a1435(++_0x264d0f);}(_0x9bab,0x6a));var _0xb9ba=function(_0x58640f,_0x3b5b9c){_0x58640f=_0x58640f-0x0;var _0x2cc0f5=_0x9bab[_0x58640f];return _0x2cc0f5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb9ba('0x0'));var BPromise=require('bluebird');var rs=require(_0xb9ba('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb9ba('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0xb9ba('0x3'));var jayson=require('jayson/promise');var client=jayson[_0xb9ba('0x4')][_0xb9ba('0x5')]({'port':0x232a});config['redis']=_[_0xb9ba('0x6')](config[_0xb9ba('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xb9ba('0x8'))(new Redis(config[_0xb9ba('0x7')]));require('./whatsappMessage.socket')[_0xb9ba('0x9')](socket);function respondWithRpcPromise(_0xfe7c49,_0x1faf87,_0xa71d95){return new BPromise(function(_0xf1fec4,_0x24bc6d){return client[_0xb9ba('0xa')](_0xfe7c49,_0xa71d95)['then'](function(_0x113160){logger[_0xb9ba('0xb')](_0xb9ba('0xc'),_0x1faf87,_0xb9ba('0xd'));logger[_0xb9ba('0xe')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x1faf87,_0xb9ba('0xd'),JSON[_0xb9ba('0xf')](_0x113160));if(_0x113160[_0xb9ba('0x10')]){if(_0x113160[_0xb9ba('0x10')]['code']===0x1f4){logger[_0xb9ba('0x10')](_0xb9ba('0xc'),_0x1faf87,_0x113160[_0xb9ba('0x10')][_0xb9ba('0x11')]);return _0x24bc6d(_0x113160[_0xb9ba('0x10')][_0xb9ba('0x11')]);}logger[_0xb9ba('0x10')](_0xb9ba('0xc'),_0x1faf87,_0x113160[_0xb9ba('0x10')][_0xb9ba('0x11')]);return _0xf1fec4(_0x113160[_0xb9ba('0x10')][_0xb9ba('0x11')]);}else{logger[_0xb9ba('0xb')](_0xb9ba('0xc'),_0x1faf87,_0xb9ba('0xd'));_0xf1fec4(_0x113160[_0xb9ba('0x12')]['message']);}})[_0xb9ba('0x13')](function(_0x51db0c){logger[_0xb9ba('0x10')](_0xb9ba('0xc'),_0x1faf87,_0x51db0c);_0x24bc6d(_0x51db0c);});});}exports['CreateWhatsappMessage']=function(_0x5adc55){var _0x17e56e=this;return new Promise(function(_0x11098f,_0x39c8e8){return db['WhatsappMessage']['create'](_0x5adc55[_0xb9ba('0x14')],{'raw':_0x5adc55[_0xb9ba('0x15')]?_0x5adc55[_0xb9ba('0x15')][_0xb9ba('0x16')]===undefined?!![]:![]:!![]})[_0xb9ba('0x17')](function(_0x5b3f55){logger[_0xb9ba('0xb')]('CreateWhatsappMessage',_0x5adc55);logger[_0xb9ba('0xe')]('CreateWhatsappMessage',_0x5adc55,JSON[_0xb9ba('0xf')](_0x5b3f55));_0x11098f(_0x5b3f55);})[_0xb9ba('0x13')](function(_0x1b5616){logger[_0xb9ba('0x10')]('CreateWhatsappMessage',_0x1b5616[_0xb9ba('0x11')],_0x5adc55);_0x39c8e8(_0x17e56e[_0xb9ba('0x10')](0x1f4,_0x1b5616[_0xb9ba('0x11')]));});});};
\ No newline at end of file
index 35f57ee..d447eef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90f3=['length','whatsappMessage:','save','remove','update','emit','register'];(function(_0x4e811a,_0x2a51f4){var _0x587b24=function(_0x3e40cd){while(--_0x3e40cd){_0x4e811a['push'](_0x4e811a['shift']());}};_0x587b24(++_0x2a51f4);}(_0x90f3,0xb8));var _0x390f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x90f3[_0x20a584];return _0x4b41a8;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x390f('0x0'),_0x390f('0x1'),_0x390f('0x2')];function createListener(_0x424eb9,_0x406781){return function(_0x199556){_0x406781[_0x390f('0x3')](_0x424eb9,_0x199556);};}function removeListener(_0x1f5285,_0xb44763){return function(){WhatsappMessageEvents['removeListener'](_0x1f5285,_0xb44763);};}exports[_0x390f('0x4')]=function(_0x388a34){for(var _0x15818e=0x0,_0x10d9fd=events[_0x390f('0x5')];_0x15818e<_0x10d9fd;_0x15818e++){var _0x25276c=events[_0x15818e];var _0x1fbf43=createListener(_0x390f('0x6')+_0x25276c,_0x388a34);WhatsappMessageEvents['on'](_0x25276c,_0x1fbf43);}};
\ No newline at end of file
+var _0xf41c=['register','length','whatsappMessage:','remove','update','emit','removeListener'];(function(_0x4702ee,_0xaf6a45){var _0x62ca7d=function(_0x5b3af7){while(--_0x5b3af7){_0x4702ee['push'](_0x4702ee['shift']());}};_0x62ca7d(++_0xaf6a45);}(_0xf41c,0x1d8));var _0xcf41=function(_0xf9111a,_0x2f9391){_0xf9111a=_0xf9111a-0x0;var _0x175a0c=_0xf41c[_0xf9111a];return _0x175a0c;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=['save',_0xcf41('0x0'),_0xcf41('0x1')];function createListener(_0x15af0e,_0xaf7a77){return function(_0x2da7aa){_0xaf7a77[_0xcf41('0x2')](_0x15af0e,_0x2da7aa);};}function removeListener(_0x216d50,_0x333f1e){return function(){WhatsappMessageEvents[_0xcf41('0x3')](_0x216d50,_0x333f1e);};}exports[_0xcf41('0x4')]=function(_0x24730e){for(var _0x3d40c7=0x0,_0x50692b=events[_0xcf41('0x5')];_0x3d40c7<_0x50692b;_0x3d40c7++){var _0x5b58d5=events[_0x3d40c7];var _0x5c2211=createListener(_0xcf41('0x6')+_0x5b58d5,_0x24730e);WhatsappMessageEvents['on'](_0x5b58d5,_0x5c2211);}};
\ No newline at end of file
index fd5fbee..181ab99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6ba=['delete','destroy','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','./whatsappQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams'];(function(_0x62e9d3,_0x414f38){var _0x31bf2b=function(_0x2be406){while(--_0x2be406){_0x62e9d3['push'](_0x62e9d3['shift']());}};_0x31bf2b(++_0x414f38);}(_0xd6ba,0x1f2));var _0xad6b=function(_0x1c63db,_0x247756){_0x1c63db=_0x1c63db-0x0;var _0x1e4eed=_0xd6ba[_0x1c63db];return _0x1e4eed;};'use strict';var multer=require(_0xad6b('0x0'));var util=require('util');var path=require(_0xad6b('0x1'));var timeout=require(_0xad6b('0x2'));var express=require(_0xad6b('0x3'));var router=express[_0xad6b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xad6b('0x5'));var config=require('../../config/environment');var controller=require(_0xad6b('0x6'));router['get']('/',auth[_0xad6b('0x7')](),controller[_0xad6b('0x8')]);router[_0xad6b('0x9')](_0xad6b('0xa'),auth[_0xad6b('0x7')](),controller[_0xad6b('0xb')]);router[_0xad6b('0x9')](_0xad6b('0xc'),auth[_0xad6b('0x7')](),controller[_0xad6b('0xd')]);router[_0xad6b('0x9')]('/:id/members',auth[_0xad6b('0x7')](),controller[_0xad6b('0xe')]);router['get'](_0xad6b('0xf'),auth[_0xad6b('0x7')](),controller[_0xad6b('0x10')]);router[_0xad6b('0x9')](_0xad6b('0x11'),auth[_0xad6b('0x7')](),controller[_0xad6b('0x12')]);router[_0xad6b('0x13')]('/',auth['isAuthenticated'](),controller[_0xad6b('0x14')]);router[_0xad6b('0x13')](_0xad6b('0xf'),auth[_0xad6b('0x7')](),controller[_0xad6b('0x15')]);router[_0xad6b('0x13')](_0xad6b('0x11'),auth[_0xad6b('0x7')](),controller['addAgents']);router['put'](_0xad6b('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xad6b('0x16')]('/:id',auth[_0xad6b('0x7')](),controller[_0xad6b('0x17')]);router[_0xad6b('0x16')](_0xad6b('0xf'),auth['isAuthenticated'](),controller['removeTeams']);router[_0xad6b('0x16')](_0xad6b('0x11'),auth[_0xad6b('0x7')](),controller[_0xad6b('0x18')]);module[_0xad6b('0x19')]=router;
\ No newline at end of file
+var _0x3ac6=['index','describe','/:id','show','getMembers','getTeams','getAgents','post','/:id/teams','addTeams','put','update','destroy','removeTeams','delete','/:id/users','removeAgents','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x3979e1,_0x584112){var _0x25d794=function(_0x4cc875){while(--_0x4cc875){_0x3979e1['push'](_0x3979e1['shift']());}};_0x25d794(++_0x584112);}(_0x3ac6,0x11f));var _0x63ac=function(_0x440bd6,_0x26bfd0){_0x440bd6=_0x440bd6-0x0;var _0x2f004a=_0x3ac6[_0x440bd6];return _0x2f004a;};'use strict';var multer=require(_0x63ac('0x0'));var util=require('util');var path=require(_0x63ac('0x1'));var timeout=require(_0x63ac('0x2'));var express=require(_0x63ac('0x3'));var router=express[_0x63ac('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x63ac('0x5'));var interaction=require(_0x63ac('0x6'));var config=require(_0x63ac('0x7'));var controller=require('./whatsappQueue.controller');router[_0x63ac('0x8')]('/',auth[_0x63ac('0x9')](),controller[_0x63ac('0xa')]);router[_0x63ac('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x63ac('0xb')]);router[_0x63ac('0x8')](_0x63ac('0xc'),auth[_0x63ac('0x9')](),controller[_0x63ac('0xd')]);router[_0x63ac('0x8')]('/:id/members',auth[_0x63ac('0x9')](),controller[_0x63ac('0xe')]);router[_0x63ac('0x8')]('/:id/teams',auth[_0x63ac('0x9')](),controller[_0x63ac('0xf')]);router['get']('/:id/users',auth[_0x63ac('0x9')](),controller[_0x63ac('0x10')]);router[_0x63ac('0x11')]('/',auth[_0x63ac('0x9')](),controller['create']);router[_0x63ac('0x11')](_0x63ac('0x12'),auth[_0x63ac('0x9')](),controller[_0x63ac('0x13')]);router[_0x63ac('0x11')]('/:id/users',auth[_0x63ac('0x9')](),controller['addAgents']);router[_0x63ac('0x14')]('/:id',auth[_0x63ac('0x9')](),controller[_0x63ac('0x15')]);router['delete'](_0x63ac('0xc'),auth['isAuthenticated'](),controller[_0x63ac('0x16')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0x63ac('0x17')]);router[_0x63ac('0x18')](_0x63ac('0x19'),auth[_0x63ac('0x9')](),controller[_0x63ac('0x1a')]);module['exports']=router;
\ No newline at end of file
index 6d1d14e..21960da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x180f=['beepall','roundrobin','STRING','sequelize','exports','name','INTEGER','rrmemory'];(function(_0x250615,_0x5f54a2){var _0x2fecb2=function(_0x125329){while(--_0x125329){_0x250615['push'](_0x250615['shift']());}};_0x2fecb2(++_0x5f54a2);}(_0x180f,0xf3));var _0xf180=function(_0x43c8b8,_0x5e8934){_0x43c8b8=_0x43c8b8-0x0;var _0x413be3=_0x180f[_0x43c8b8];return _0x413be3;};'use strict';var Sequelize=require(_0xf180('0x0'));module[_0xf180('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xf180('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xf180('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xf180('0x4'),_0xf180('0x5'),_0xf180('0x6'))},'description':{'type':Sequelize[_0xf180('0x7')]}};
\ No newline at end of file
+var _0x3189=['sequelize','exports','name','INTEGER','ENUM','beepall'];(function(_0x41f4a0,_0x59e659){var _0x395b4c=function(_0x29cbcf){while(--_0x29cbcf){_0x41f4a0['push'](_0x41f4a0['shift']());}};_0x395b4c(++_0x59e659);}(_0x3189,0xae));var _0x9318=function(_0x5649a3,_0x15e286){_0x5649a3=_0x5649a3-0x0;var _0x2b3f10=_0x3189[_0x5649a3];return _0x2b3f10;};'use strict';var Sequelize=require(_0x9318('0x0'));module[_0x9318('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9318('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x9318('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9318('0x4')]('rrmemory',_0x9318('0x5'),'roundrobin')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 9d0191a..fb2922f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf06d=['each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','push','sequelize','toString','QueryTypes','includes','all','union','compact','value','isEmpty','addAgents','omit','removeAgents','isArray','userWhatsappQueue:remove','getAgents','rawAttributes','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','reject','update','then','destroy','UserProfileResource','stack','name','send','index','map','type','key','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','WhatsappQueue','count','includeAll','include','findAll','rows','catch','show','params','length','find','create','user','get','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserWhatsappQueue','WhatsappQueueId','User','findAndCountAll','UserId','whatsappPause','updatedAt','createdAt','%s/%s','SIP','Team','getTeams','addTeams','ids','Agents','online','flatMap','transaction'];(function(_0x5cafd6,_0x30ff88){var _0xf36246=function(_0x3a833c){while(--_0x3a833c){_0x5cafd6['push'](_0x5cafd6['shift']());}};_0xf36246(++_0x30ff88);}(_0xf06d,0xad));var _0xdf06=function(_0x366324,_0xb4dab7){_0x366324=_0x366324-0x0;var _0x4ca5b9=_0xf06d[_0x366324];return _0x4ca5b9;};'use strict';var emlformat=require(_0xdf06('0x0'));var rimraf=require(_0xdf06('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdf06('0x2'));var rp=require(_0xdf06('0x3'));var moment=require(_0xdf06('0x4'));var BPromise=require(_0xdf06('0x5'));var Mustache=require(_0xdf06('0x6'));var util=require(_0xdf06('0x7'));var path=require(_0xdf06('0x8'));var sox=require(_0xdf06('0x9'));var csv=require(_0xdf06('0xa'));var ejs=require(_0xdf06('0xb'));var fs=require('fs');var fs_extra=require(_0xdf06('0xc'));var _=require(_0xdf06('0xd'));var squel=require(_0xdf06('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdf06('0xf'));var toCsv=require(_0xdf06('0xa'));var querystring=require(_0xdf06('0x10'));var Papa=require(_0xdf06('0x11'));var Redis=require(_0xdf06('0x12'));var authService=require(_0xdf06('0x13'));var qs=require(_0xdf06('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdf06('0x15'));var logger=require(_0xdf06('0x16'))(_0xdf06('0x17'));var utils=require(_0xdf06('0x18'));var config=require(_0xdf06('0x19'));var licenseUtil=require(_0xdf06('0x1a'));var db=require(_0xdf06('0x1b'))['db'];config[_0xdf06('0x1c')]=_[_0xdf06('0x1d')](config[_0xdf06('0x1c')],{'host':_0xdf06('0x1e'),'port':0x18eb});var socket=require(_0xdf06('0x1f'))(new Redis(config['redis']));require(_0xdf06('0x20'))[_0xdf06('0x21')](socket);function respondWithStatusCode(_0x3c6991,_0x2cf8fa){_0x2cf8fa=_0x2cf8fa||0xcc;return function(_0x18f2aa){if(_0x18f2aa){return _0x3c6991[_0xdf06('0x22')](_0x2cf8fa);}return _0x3c6991[_0xdf06('0x23')](_0x2cf8fa)[_0xdf06('0x24')]();};}function respondWithResult(_0x44f2ab,_0xebca42){_0xebca42=_0xebca42||0xc8;return function(_0x5db9e0){if(_0x5db9e0){return _0x44f2ab[_0xdf06('0x23')](_0xebca42)[_0xdf06('0x25')](_0x5db9e0);}};}function respondWithFilteredResult(_0x39673b,_0x2c9a91){return function(_0x19ed02){if(_0x19ed02){var _0x1ac2b1=typeof _0x2c9a91[_0xdf06('0x26')]===_0xdf06('0x27')&&typeof _0x2c9a91[_0xdf06('0x28')]===_0xdf06('0x27');var _0x8b7e48=_0x19ed02['count'];var _0xe54801=_0x1ac2b1?0x0:_0x2c9a91[_0xdf06('0x26')];var _0x19f8e0=_0x1ac2b1?_0x19ed02['count']:_0x2c9a91[_0xdf06('0x26')]+_0x2c9a91[_0xdf06('0x28')];var _0x2d575f;if(_0x19f8e0>=_0x8b7e48){_0x19f8e0=_0x8b7e48;_0x2d575f=0xc8;}else{_0x2d575f=0xce;}_0x39673b[_0xdf06('0x23')](_0x2d575f);return _0x39673b[_0xdf06('0x29')]('Content-Range',_0xe54801+'-'+_0x19f8e0+'/'+_0x8b7e48)[_0xdf06('0x25')](_0x19ed02);}return null;};}function patchUpdates(_0x10e4ef){return function(_0x1d3732){try{jsonpatch['apply'](_0x1d3732,_0x10e4ef,!![]);}catch(_0x2f3550){return BPromise[_0xdf06('0x2a')](_0x2f3550);}return _0x1d3732['save']();};}function saveUpdates(_0x1b2571,_0x4ad829){return function(_0x1df700){if(_0x1df700){return _0x1df700[_0xdf06('0x2b')](_0x1b2571)[_0xdf06('0x2c')](function(_0x72261a){return _0x72261a;});}return null;};}function removeEntity(_0x9257d4,_0x3b6ecb){return function(_0x543db8){if(_0x543db8){return _0x543db8[_0xdf06('0x2d')]()[_0xdf06('0x2c')](function(){var _0x5083ab=_0x543db8['get']({'plain':!![]});var _0x438226='WhatsappQueues';return db[_0xdf06('0x2e')]['destroy']({'where':{'type':_0x438226,'resourceId':_0x5083ab['id']}})[_0xdf06('0x2c')](function(){return _0x543db8;});})[_0xdf06('0x2c')](function(){_0x9257d4[_0xdf06('0x23')](0xcc)[_0xdf06('0x24')]();});}};}function handleEntityNotFound(_0x235152,_0xbb8cd4){return function(_0x208e57){if(!_0x208e57){_0x235152[_0xdf06('0x22')](0x194);}return _0x208e57;};}function handleError(_0x5572de,_0x4cb352){_0x4cb352=_0x4cb352||0x1f4;return function(_0x53ebbb){logger['error'](_0x53ebbb[_0xdf06('0x2f')]);if(_0x53ebbb[_0xdf06('0x30')]){delete _0x53ebbb[_0xdf06('0x30')];}_0x5572de['status'](_0x4cb352)[_0xdf06('0x31')](_0x53ebbb);};}exports[_0xdf06('0x32')]=function(_0x5bc190,_0x45a0f6){var _0x31a828={},_0x469d4d={},_0x179d1a={'count':0x0,'rows':[]};var _0xd30716=_[_0xdf06('0x33')](db['WhatsappQueue']['rawAttributes'],function(_0x2f6776){return{'name':_0x2f6776['fieldName'],'type':_0x2f6776[_0xdf06('0x34')][_0xdf06('0x35')]};});_0x469d4d['model']=_[_0xdf06('0x33')](_0xd30716,_0xdf06('0x30'));_0x469d4d['query']=_[_0xdf06('0x36')](_0x5bc190[_0xdf06('0x37')]);_0x469d4d[_0xdf06('0x38')]=_[_0xdf06('0x39')](_0x469d4d[_0xdf06('0x3a')],_0x469d4d[_0xdf06('0x37')]);_0x31a828['attributes']=_['intersection'](_0x469d4d[_0xdf06('0x3a')],qs[_0xdf06('0x3b')](_0x5bc190[_0xdf06('0x37')][_0xdf06('0x3b')]));_0x31a828[_0xdf06('0x3c')]=_0x31a828[_0xdf06('0x3c')]['length']?_0x31a828[_0xdf06('0x3c')]:_0x469d4d['model'];if(!_0x5bc190[_0xdf06('0x37')][_0xdf06('0x3d')](_0xdf06('0x3e'))){_0x31a828[_0xdf06('0x28')]=qs[_0xdf06('0x28')](_0x5bc190[_0xdf06('0x37')]['limit']);_0x31a828[_0xdf06('0x26')]=qs[_0xdf06('0x26')](_0x5bc190['query']['offset']);}_0x31a828[_0xdf06('0x3f')]=qs[_0xdf06('0x40')](_0x5bc190[_0xdf06('0x37')][_0xdf06('0x40')]);_0x31a828['where']=qs[_0xdf06('0x38')](_[_0xdf06('0x41')](_0x5bc190[_0xdf06('0x37')],_0x469d4d[_0xdf06('0x38')]),_0xd30716);if(_0x5bc190[_0xdf06('0x37')][_0xdf06('0x42')]){_0x31a828[_0xdf06('0x43')]=_['merge'](_0x31a828[_0xdf06('0x43')],{'$or':_[_0xdf06('0x33')](_0xd30716,function(_0x4592a9){if(_0x4592a9[_0xdf06('0x34')]!==_0xdf06('0x44')){var _0x41f64d={};_0x41f64d[_0x4592a9['name']]={'$like':'%'+_0x5bc190['query'][_0xdf06('0x42')]+'%'};return _0x41f64d;}})});}_0x31a828=_[_0xdf06('0x45')]({},_0x31a828,_0x5bc190[_0xdf06('0x46')]);var _0x2b0b41={'where':_0x31a828[_0xdf06('0x43')]};return db[_0xdf06('0x47')][_0xdf06('0x48')](_0x2b0b41)['then'](function(_0x22d6cb){_0x179d1a[_0xdf06('0x48')]=_0x22d6cb;if(_0x5bc190[_0xdf06('0x37')][_0xdf06('0x49')]){_0x31a828[_0xdf06('0x4a')]=[{'all':!![]}];}return db[_0xdf06('0x47')][_0xdf06('0x4b')](_0x31a828);})[_0xdf06('0x2c')](function(_0x369894){_0x179d1a[_0xdf06('0x4c')]=_0x369894;return _0x179d1a;})[_0xdf06('0x2c')](respondWithFilteredResult(_0x45a0f6,_0x31a828))[_0xdf06('0x4d')](handleError(_0x45a0f6,null));};exports[_0xdf06('0x4e')]=function(_0x425bcf,_0xecec3c){var _0x49dfa3={'raw':!![],'where':{'id':_0x425bcf[_0xdf06('0x4f')]['id']}},_0x31abe6={};_0x31abe6[_0xdf06('0x3a')]=_[_0xdf06('0x36')](db[_0xdf06('0x47')]['rawAttributes']);_0x31abe6[_0xdf06('0x37')]=_[_0xdf06('0x36')](_0x425bcf[_0xdf06('0x37')]);_0x31abe6[_0xdf06('0x38')]=_[_0xdf06('0x39')](_0x31abe6[_0xdf06('0x3a')],_0x31abe6[_0xdf06('0x37')]);_0x49dfa3[_0xdf06('0x3c')]=_['intersection'](_0x31abe6['model'],qs['fields'](_0x425bcf[_0xdf06('0x37')][_0xdf06('0x3b')]));_0x49dfa3[_0xdf06('0x3c')]=_0x49dfa3[_0xdf06('0x3c')][_0xdf06('0x50')]?_0x49dfa3[_0xdf06('0x3c')]:_0x31abe6[_0xdf06('0x3a')];if(_0x425bcf['query'][_0xdf06('0x49')]){_0x49dfa3['include']=[{'all':!![]}];}_0x49dfa3=_[_0xdf06('0x45')]({},_0x49dfa3,_0x425bcf[_0xdf06('0x46')]);return db[_0xdf06('0x47')][_0xdf06('0x51')](_0x49dfa3)[_0xdf06('0x2c')](handleEntityNotFound(_0xecec3c,null))['then'](respondWithResult(_0xecec3c,null))['catch'](handleError(_0xecec3c,null));};exports[_0xdf06('0x52')]=function(_0x6745df,_0x4a31c2){return db['WhatsappQueue'][_0xdf06('0x52')](_0x6745df['body'],{})[_0xdf06('0x2c')](function(_0x1f5e5f){var _0x1443b8=_0x6745df[_0xdf06('0x53')][_0xdf06('0x54')]({'plain':!![]});if(!_0x1443b8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1443b8[_0xdf06('0x55')]===_0xdf06('0x53')){var _0xf73a52=_0x1f5e5f[_0xdf06('0x54')]({'plain':!![]});var _0x363535='WhatsappQueues';return db[_0xdf06('0x56')]['find']({'where':{'name':_0x363535,'userProfileId':_0x1443b8[_0xdf06('0x57')]},'raw':!![]})[_0xdf06('0x2c')](function(_0x53d7aa){if(_0x53d7aa&&_0x53d7aa[_0xdf06('0x58')]===0x0){return db[_0xdf06('0x2e')]['create']({'name':_0xf73a52['name'],'resourceId':_0xf73a52['id'],'type':_0x53d7aa[_0xdf06('0x30')],'sectionId':_0x53d7aa['id']},{})[_0xdf06('0x2c')](function(){return _0x1f5e5f;});}else{return _0x1f5e5f;}})[_0xdf06('0x4d')](function(_0x3e73bd){logger[_0xdf06('0x59')](_0xdf06('0x5a'),_0x3e73bd);throw _0x3e73bd;});}return _0x1f5e5f;})[_0xdf06('0x2c')](respondWithResult(_0x4a31c2,0xc9))[_0xdf06('0x4d')](handleError(_0x4a31c2,null));};exports[_0xdf06('0x2b')]=function(_0x59570c,_0x3f5cbd){if(_0x59570c[_0xdf06('0x5b')]['id']){delete _0x59570c[_0xdf06('0x5b')]['id'];}return db[_0xdf06('0x47')][_0xdf06('0x51')]({'where':{'id':_0x59570c[_0xdf06('0x4f')]['id']}})[_0xdf06('0x2c')](handleEntityNotFound(_0x3f5cbd,null))['then'](saveUpdates(_0x59570c['body'],null))[_0xdf06('0x2c')](respondWithResult(_0x3f5cbd,null))['catch'](handleError(_0x3f5cbd,null));};exports['destroy']=function(_0x2ca9f1,_0x2e8aa4){return db['WhatsappQueue'][_0xdf06('0x51')]({'where':{'id':_0x2ca9f1[_0xdf06('0x4f')]['id']}})[_0xdf06('0x2c')](handleEntityNotFound(_0x2e8aa4,null))[_0xdf06('0x2c')](removeEntity(_0x2e8aa4,null))[_0xdf06('0x4d')](handleError(_0x2e8aa4,null));};exports[_0xdf06('0x5c')]=function(_0x5016db,_0x45eb8d){return db[_0xdf06('0x47')][_0xdf06('0x5c')]()[_0xdf06('0x2c')](respondWithResult(_0x45eb8d,null))[_0xdf06('0x4d')](handleError(_0x45eb8d,null));};exports[_0xdf06('0x5d')]=function(_0x63599e,_0x1ff232,_0x34f85e){var _0x604c8d={'raw':!![],'where':{}},_0x2c8f71={},_0x279927;return db[_0xdf06('0x47')][_0xdf06('0x5e')]({'where':{'id':_0x63599e[_0xdf06('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1ff232,null))[_0xdf06('0x2c')](function(_0x22aa0d){if(_0x22aa0d){_0x279927=_0x22aa0d[_0xdf06('0x54')]({'plain':!![]});_0x2c8f71['model']=_['keys'](db[_0xdf06('0x5f')]['rawAttributes']);_0x2c8f71[_0xdf06('0x37')]=_[_0xdf06('0x36')](_0x63599e[_0xdf06('0x37')]);_0x2c8f71[_0xdf06('0x38')]=_[_0xdf06('0x39')](_0x2c8f71[_0xdf06('0x3a')],_0x2c8f71[_0xdf06('0x37')]);_0x604c8d[_0xdf06('0x3c')]=_[_0xdf06('0x39')](_0x2c8f71[_0xdf06('0x3a')],qs['fields'](_0x63599e[_0xdf06('0x37')][_0xdf06('0x3b')]));_0x604c8d[_0xdf06('0x3c')]=_0x604c8d[_0xdf06('0x3c')][_0xdf06('0x50')]?_0x604c8d[_0xdf06('0x3c')]:_0x2c8f71[_0xdf06('0x3a')];if(!_0x63599e['query'][_0xdf06('0x3d')](_0xdf06('0x3e'))){_0x604c8d[_0xdf06('0x28')]=qs[_0xdf06('0x28')](_0x63599e['query'][_0xdf06('0x28')]);_0x604c8d[_0xdf06('0x26')]=qs[_0xdf06('0x26')](_0x63599e[_0xdf06('0x37')]['offset']);}_0x604c8d[_0xdf06('0x3f')]=qs[_0xdf06('0x40')](_0x63599e[_0xdf06('0x37')][_0xdf06('0x40')]);_0x604c8d['where']=qs[_0xdf06('0x38')](_[_0xdf06('0x41')](_0x63599e[_0xdf06('0x37')],_0x2c8f71[_0xdf06('0x38')]));_0x604c8d[_0xdf06('0x43')][_0xdf06('0x60')]=_0x22aa0d['id'];if(_0x63599e['query']['filter']){_0x604c8d[_0xdf06('0x43')]=_['merge'](_0x604c8d[_0xdf06('0x43')],{'$or':_['map'](_0x604c8d[_0xdf06('0x3c')],function(_0x88c8f8){var _0xb37146={};_0xb37146[_0x88c8f8]={'$like':'%'+_0x63599e[_0xdf06('0x37')][_0xdf06('0x42')]+'%'};return _0xb37146;})});}_0x604c8d=_['merge']({},_0x604c8d,_0x63599e['options']);return db[_0xdf06('0x5f')][_0xdf06('0x4b')](_0x604c8d);}})['then'](function(_0x582e75){if(_0x582e75){return db[_0xdf06('0x61')][_0xdf06('0x62')]({'where':{'id':_[_0xdf06('0x33')](_0x582e75,_0xdf06('0x63')),'role':'agent'},'attributes':['id',_0xdf06('0x30'),_0xdf06('0x64'),_0xdf06('0x65'),_0xdf06('0x66')]});}})[_0xdf06('0x2c')](function(_0x9e1796){if(_0x9e1796){return{'count':_0x9e1796[_0xdf06('0x48')],'rows':_['map'](_0x9e1796[_0xdf06('0x4c')],function(_0x334dfd){return{'membername':_0x334dfd[_0xdf06('0x30')],'UserId':_0x334dfd['id'],'queue_name':_0x279927[_0xdf06('0x30')],'WhatsappQueueId':_0x279927['id'],'interface':util['format'](_0xdf06('0x67'),_0xdf06('0x68'),_0x334dfd[_0xdf06('0x30')]),'penalty':0x0,'paused':_0x334dfd[_0xdf06('0x64')],'createdAt':_0x334dfd[_0xdf06('0x66')],'updatedAt':_0x334dfd['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xdf06('0x2c')](respondWithFilteredResult(_0x1ff232,_0x604c8d))[_0xdf06('0x4d')](handleError(_0x1ff232,null));};exports['getTeams']=function(_0x78deb5,_0x1f3b02,_0x44cae1){var _0x37d79f={};var _0x5b42cc={};var _0x237b10;var _0x1d2dd1;return db[_0xdf06('0x47')]['findOne']({'where':{'id':_0x78deb5[_0xdf06('0x4f')]['id']}})[_0xdf06('0x2c')](handleEntityNotFound(_0x1f3b02,null))['then'](function(_0x56e9d6){if(_0x56e9d6){_0x237b10=_0x56e9d6;_0x5b42cc[_0xdf06('0x3a')]=_[_0xdf06('0x36')](db[_0xdf06('0x69')]['rawAttributes']);_0x5b42cc[_0xdf06('0x37')]=_[_0xdf06('0x36')](_0x78deb5[_0xdf06('0x37')]);_0x5b42cc[_0xdf06('0x38')]=_['intersection'](_0x5b42cc[_0xdf06('0x3a')],_0x5b42cc['query']);_0x37d79f['attributes']=_['intersection'](_0x5b42cc[_0xdf06('0x3a')],qs[_0xdf06('0x3b')](_0x78deb5['query'][_0xdf06('0x3b')]));_0x37d79f[_0xdf06('0x3c')]=_0x37d79f[_0xdf06('0x3c')]['length']?_0x37d79f['attributes']:_0x5b42cc['model'];_0x37d79f['order']=qs['sort'](_0x78deb5[_0xdf06('0x37')][_0xdf06('0x40')]);_0x37d79f['where']=qs[_0xdf06('0x38')](_[_0xdf06('0x41')](_0x78deb5[_0xdf06('0x37')],_0x5b42cc[_0xdf06('0x38')]));if(_0x78deb5[_0xdf06('0x37')]['filter']){_0x37d79f['where']=_[_0xdf06('0x45')](_0x37d79f[_0xdf06('0x43')],{'$or':_[_0xdf06('0x33')](_0x37d79f[_0xdf06('0x3c')],function(_0x2cd8b2){var _0xa3eaef={};_0xa3eaef[_0x2cd8b2]={'$like':'%'+_0x78deb5[_0xdf06('0x37')][_0xdf06('0x42')]+'%'};return _0xa3eaef;})});}_0x37d79f=_['merge']({},_0x37d79f,_0x78deb5[_0xdf06('0x46')]);return _0x237b10['getTeams'](_0x37d79f);}})[_0xdf06('0x2c')](function(_0x4df969){if(_0x4df969){_0x1d2dd1=_0x4df969['length'];if(!_0x78deb5[_0xdf06('0x37')][_0xdf06('0x3d')](_0xdf06('0x3e'))){_0x37d79f[_0xdf06('0x28')]=qs['limit'](_0x78deb5[_0xdf06('0x37')][_0xdf06('0x28')]);_0x37d79f['offset']=qs['offset'](_0x78deb5[_0xdf06('0x37')][_0xdf06('0x26')]);}return _0x237b10[_0xdf06('0x6a')](_0x37d79f);}})[_0xdf06('0x2c')](function(_0x53b1a5){if(_0x53b1a5){return _0x53b1a5?{'count':_0x1d2dd1,'rows':_0x53b1a5}:null;}})[_0xdf06('0x2c')](respondWithResult(_0x1f3b02,null))['catch'](handleError(_0x1f3b02,null));};exports[_0xdf06('0x6b')]=function(_0x31877e,_0xe91cf,_0x1ef392){var _0x17047b=_0x31877e[_0xdf06('0x5b')][_0xdf06('0x6c')];return db['Team']['findAll']({'where':{'id':_0x17047b},'attributes':['id'],'include':[{'model':db[_0xdf06('0x61')],'as':_0xdf06('0x6d'),'attributes':['id','name',_0xdf06('0x6e'),'voicePause','interface'],'raw':!![]}]})[_0xdf06('0x2c')](function(_0x1a1a70){if(_0x1a1a70){var _0x223aa6=_[_0xdf06('0x6f')](_0x1a1a70,function(_0x55e199){var _0x4c3696=_0x55e199[_0xdf06('0x54')]({'plain':!![]});return _0x4c3696['Agents'];});return db[_0xdf06('0x47')][_0xdf06('0x51')]({'where':{'id':_0x31877e[_0xdf06('0x4f')]['id']}})['then'](function(_0x49b480){return db['sequelize'][_0xdf06('0x70')](function(_0x4f60b2){return _0x49b480[_0xdf06('0x6b')](_0x17047b,{'transaction':_0x4f60b2})[_0xdf06('0x2c')](function(){return BPromise[_0xdf06('0x71')](_0x223aa6,function(_0xa9beb2){return db['UserWhatsappQueue'][_0xdf06('0x72')]({'where':{'UserId':_0xa9beb2['id'],'WhatsappQueueId':_0x31877e['params']['id']},'transaction':_0x4f60b2});});})[_0xdf06('0x2c')](function(){_0x223aa6[_0xdf06('0x73')](function(_0x3ebcd8){socket[_0xdf06('0x74')](_0xdf06('0x75'),{'UserId':_0x3ebcd8['id'],'WhatsappQueueId':_0x49b480['id']});});});});});}})['then'](respondWithStatusCode(_0xe91cf,null))[_0xdf06('0x4d')](handleError(_0xe91cf,null));};exports[_0xdf06('0x76')]=function(_0x5b0b9f,_0x5be493,_0x232c03){return db['Team'][_0xdf06('0x4b')]({'where':{'id':_0x5b0b9f['query'][_0xdf06('0x6c')]},'attributes':['id'],'include':[{'model':db[_0xdf06('0x61')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xdf06('0x2c')](handleEntityNotFound(_0x5be493,null))[_0xdf06('0x2c')](function(_0x30613c){var _0xf40faa=_['map'](_0x30613c,'id');var _0x50e3a0=[];var _0x59554c=[];var _0x1a0c7a=squel['select']();_0x1a0c7a[_0xdf06('0x77')](_0xdf06('0x78'))[_0xdf06('0x79')](_0xdf06('0x7a'),'tq')[_0xdf06('0x7b')](_0xdf06('0x7c'),'ut',_0xdf06('0x7d'))[_0xdf06('0x43')]('WhatsappQueueId\x20=\x20?',_0x5b0b9f[_0xdf06('0x4f')]['id']);for(var _0x2be99b=0x0;_0x2be99b<_0x30613c[_0xdf06('0x50')];_0x2be99b+=0x1){let _0x3f225d=_0x30613c[_0x2be99b];for(var _0xcf3871=0x0;_0xcf3871<_0x3f225d['Agents'][_0xdf06('0x50')];_0xcf3871+=0x1){let _0x2a32e5=_0x3f225d[_0xdf06('0x6d')][_0xcf3871];var _0x9b05fa=_0x1a0c7a['clone']();_0x9b05fa[_0xdf06('0x43')]('ut.UserId\x20=\x20?',_0x2a32e5['id']);_0x59554c[_0xdf06('0x7e')](db[_0xdf06('0x7f')]['query'](_0x9b05fa[_0xdf06('0x80')](),{'type':db[_0xdf06('0x7f')][_0xdf06('0x81')]['SELECT']})[_0xdf06('0x2c')](function(_0x40c9b8){if(_0x40c9b8[_0xdf06('0x50')]===0x1){return _0x2a32e5['id'];}else{var _0x547eb3=_['every'](_['map'](_0x40c9b8,'TeamId'),function(_0x21e449){return _[_0xdf06('0x82')](_0xf40faa,_0x21e449);});if(_0x547eb3){return _0x2a32e5['id'];}}}));}}return BPromise[_0xdf06('0x83')](_0x59554c)[_0xdf06('0x2c')](function(_0x2386ee){_0x50e3a0=_(_0x50e3a0)[_0xdf06('0x84')](_0x2386ee)[_0xdf06('0x85')]()[_0xdf06('0x86')]();return db[_0xdf06('0x47')][_0xdf06('0x51')]({'where':{'id':_0x5b0b9f['params']['id']}})['then'](function(_0x30de86){return db[_0xdf06('0x7f')][_0xdf06('0x70')](function(_0x659996){return _0x30de86[_0xdf06('0x76')](_0x5b0b9f['query'][_0xdf06('0x6c')],{'transaction':_0x659996})['then'](function(){if(!_[_0xdf06('0x87')](_0x50e3a0)){return _0x30de86['removeAgents'](_0x50e3a0,{'transaction':_0x659996});}})[_0xdf06('0x2c')](function(){_0x50e3a0[_0xdf06('0x73')](function(_0x492cb5){socket[_0xdf06('0x74')]('userWhatsappQueue:remove',{'UserId':_0x492cb5,'WhatsappQueueId':_0x30de86['id']});});});});});});})['then'](respondWithStatusCode(_0x5be493,null))['catch'](handleError(_0x5be493,null));};exports[_0xdf06('0x88')]=function(_0x25da7c,_0x19b6df,_0x4130d6){return db[_0xdf06('0x47')][_0xdf06('0x51')]({'where':{'id':_0x25da7c[_0xdf06('0x4f')]['id']}})['then'](handleEntityNotFound(_0x19b6df,null))['then'](function(_0x5c3557){if(_0x5c3557){return _0x5c3557[_0xdf06('0x88')](_0x25da7c[_0xdf06('0x5b')]['ids'],_[_0xdf06('0x89')](_0x25da7c[_0xdf06('0x5b')],['ids','id'])||{})['spread'](function(_0x205fd0){for(var _0x42f4f5=0x0;_0x42f4f5<_0x25da7c[_0xdf06('0x5b')]['ids'][_0xdf06('0x50')];_0x42f4f5+=0x1){socket['emit'](_0xdf06('0x75'),{'UserId':Number(_0x25da7c['body'][_0xdf06('0x6c')][_0x42f4f5]),'WhatsappQueueId':Number(_0x25da7c['params']['id'])});}return _0x205fd0;});}})[_0xdf06('0x2c')](respondWithResult(_0x19b6df,null))[_0xdf06('0x4d')](handleError(_0x19b6df,null));};exports[_0xdf06('0x8a')]=function(_0x149ad7,_0x2874ad,_0x5de2a6){return db[_0xdf06('0x47')][_0xdf06('0x51')]({'where':{'id':_0x149ad7['params']['id']}})['then'](handleEntityNotFound(_0x2874ad,null))['then'](function(_0x1d1cc0){if(_0x1d1cc0){return _0x1d1cc0['removeAgents'](_0x149ad7[_0xdf06('0x37')][_0xdf06('0x6c')])[_0xdf06('0x2c')](function(){if(_[_0xdf06('0x8b')](_0x149ad7['query'][_0xdf06('0x6c')])){for(var _0x11085f=0x0;_0x11085f<_0x149ad7[_0xdf06('0x37')][_0xdf06('0x6c')][_0xdf06('0x50')];_0x11085f+=0x1){socket['emit'](_0xdf06('0x8c'),{'UserId':Number(_0x149ad7[_0xdf06('0x37')][_0xdf06('0x6c')][_0x11085f]),'WhatsappQueueId':Number(_0x149ad7[_0xdf06('0x4f')]['id'])});}}else{socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x149ad7[_0xdf06('0x37')][_0xdf06('0x6c')]),'WhatsappQueueId':Number(_0x149ad7[_0xdf06('0x4f')]['id'])});}});}})['then'](respondWithStatusCode(_0x2874ad,null))['catch'](handleError(_0x2874ad,null));};exports[_0xdf06('0x8d')]=function(_0x3ce4bd,_0x31a33c,_0x44f27f){var _0x5343d7={};var _0x35b92c={};var _0xc9bdac;var _0x2aece7;return db[_0xdf06('0x47')][_0xdf06('0x5e')]({'where':{'id':_0x3ce4bd[_0xdf06('0x4f')]['id']}})['then'](handleEntityNotFound(_0x31a33c,null))[_0xdf06('0x2c')](function(_0x2654b9){if(_0x2654b9){_0xc9bdac=_0x2654b9;_0x35b92c[_0xdf06('0x3a')]=_['keys'](db[_0xdf06('0x61')][_0xdf06('0x8e')]);_0x35b92c[_0xdf06('0x37')]=_['keys'](_0x3ce4bd['query']);_0x35b92c[_0xdf06('0x38')]=_[_0xdf06('0x39')](_0x35b92c[_0xdf06('0x3a')],_0x35b92c[_0xdf06('0x37')]);_0x5343d7['attributes']=_['intersection'](_0x35b92c[_0xdf06('0x3a')],qs['fields'](_0x3ce4bd[_0xdf06('0x37')][_0xdf06('0x3b')]));_0x5343d7[_0xdf06('0x3c')]=_0x5343d7[_0xdf06('0x3c')][_0xdf06('0x50')]?_0x5343d7['attributes']:_0x35b92c[_0xdf06('0x3a')];_0x5343d7[_0xdf06('0x3f')]=qs[_0xdf06('0x40')](_0x3ce4bd[_0xdf06('0x37')][_0xdf06('0x40')]);_0x5343d7[_0xdf06('0x43')]=qs[_0xdf06('0x38')](_[_0xdf06('0x41')](_0x3ce4bd[_0xdf06('0x37')],_0x35b92c[_0xdf06('0x38')]));if(_0x3ce4bd[_0xdf06('0x37')][_0xdf06('0x42')]){_0x5343d7['where']=_[_0xdf06('0x45')](_0x5343d7[_0xdf06('0x43')],{'$or':_['map'](_0x5343d7[_0xdf06('0x3c')],function(_0x126d80){var _0x1f6f6b={};_0x1f6f6b[_0x126d80]={'$like':'%'+_0x3ce4bd['query'][_0xdf06('0x42')]+'%'};return _0x1f6f6b;})});}_0x5343d7=_[_0xdf06('0x45')]({},_0x5343d7,_0x3ce4bd[_0xdf06('0x46')]);return _0xc9bdac[_0xdf06('0x8d')](_0x5343d7);}})[_0xdf06('0x2c')](function(_0xc7dea6){if(_0xc7dea6){_0x2aece7=_0xc7dea6['length'];if(!_0x3ce4bd['query']['hasOwnProperty'](_0xdf06('0x3e'))){_0x5343d7['limit']=qs[_0xdf06('0x28')](_0x3ce4bd['query']['limit']);_0x5343d7['offset']=qs['offset'](_0x3ce4bd['query']['offset']);}return _0xc9bdac[_0xdf06('0x8d')](_0x5343d7);}})[_0xdf06('0x2c')](function(_0x51788d){if(_0x51788d){return _0x51788d?{'count':_0x2aece7,'rows':_0x51788d}:null;}})['then'](respondWithResult(_0x31a33c,null))['catch'](handleError(_0x31a33c,null));};
\ No newline at end of file
+var _0xea7e=['request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./whatsappQueue.socket','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','sendStatus','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','model','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserWhatsappQueue','WhatsappQueueId','UserId','updatedAt','createdAt','format','%s/%s','SIP','whatsappPause','findOne','getTeams','ids','Team','User','Agents','interface','sequelize','transaction','addTeams','each','findOrCreate','forEach','userWhatsappQueue:save','removeTeams','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','value','isEmpty','addAgents','omit','spread','emit','removeAgents','isArray','userWhatsappQueue:remove','getAgents','eml-format','rimraf','zip-dir'];(function(_0x3644ef,_0x40ea00){var _0x223ed4=function(_0x274cc3){while(--_0x274cc3){_0x3644ef['push'](_0x3644ef['shift']());}};_0x223ed4(++_0x40ea00);}(_0xea7e,0x119));var _0xeea7=function(_0x58b342,_0x4977f2){_0x58b342=_0x58b342-0x0;var _0x12573a=_0xea7e[_0x58b342];return _0x12573a;};'use strict';var emlformat=require(_0xeea7('0x0'));var rimraf=require(_0xeea7('0x1'));var zipdir=require(_0xeea7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeea7('0x3'));var moment=require(_0xeea7('0x4'));var BPromise=require(_0xeea7('0x5'));var Mustache=require(_0xeea7('0x6'));var util=require(_0xeea7('0x7'));var path=require(_0xeea7('0x8'));var sox=require(_0xeea7('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeea7('0xa'));var squel=require(_0xeea7('0xb'));var crypto=require('crypto');var jsforce=require(_0xeea7('0xc'));var deskjs=require(_0xeea7('0xd'));var toCsv=require('to-csv');var querystring=require(_0xeea7('0xe'));var Papa=require(_0xeea7('0xf'));var Redis=require(_0xeea7('0x10'));var authService=require(_0xeea7('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeea7('0x12'));var logger=require(_0xeea7('0x13'))(_0xeea7('0x14'));var utils=require(_0xeea7('0x15'));var config=require(_0xeea7('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xeea7('0x17'))['db'];config[_0xeea7('0x18')]=_['defaults'](config[_0xeea7('0x18')],{'host':_0xeea7('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeea7('0x18')]));require(_0xeea7('0x1a'))['register'](socket);function respondWithStatusCode(_0x370d13,_0x63db97){_0x63db97=_0x63db97||0xcc;return function(_0x44d167){if(_0x44d167){return _0x370d13['sendStatus'](_0x63db97);}return _0x370d13[_0xeea7('0x1b')](_0x63db97)[_0xeea7('0x1c')]();};}function respondWithResult(_0x433df8,_0x101feb){_0x101feb=_0x101feb||0xc8;return function(_0x73a994){if(_0x73a994){return _0x433df8[_0xeea7('0x1b')](_0x101feb)['json'](_0x73a994);}};}function respondWithFilteredResult(_0x386380,_0x2f9b1a){return function(_0x2fa1ca){if(_0x2fa1ca){var _0x1522cc=typeof _0x2f9b1a['offset']===_0xeea7('0x1d')&&typeof _0x2f9b1a[_0xeea7('0x1e')]===_0xeea7('0x1d');var _0x487fb2=_0x2fa1ca[_0xeea7('0x1f')];var _0x5c8671=_0x1522cc?0x0:_0x2f9b1a[_0xeea7('0x20')];var _0x316130=_0x1522cc?_0x2fa1ca[_0xeea7('0x1f')]:_0x2f9b1a[_0xeea7('0x20')]+_0x2f9b1a[_0xeea7('0x1e')];var _0x5574e2;if(_0x316130>=_0x487fb2){_0x316130=_0x487fb2;_0x5574e2=0xc8;}else{_0x5574e2=0xce;}_0x386380[_0xeea7('0x1b')](_0x5574e2);return _0x386380[_0xeea7('0x21')](_0xeea7('0x22'),_0x5c8671+'-'+_0x316130+'/'+_0x487fb2)[_0xeea7('0x23')](_0x2fa1ca);}return null;};}function patchUpdates(_0x1e825d){return function(_0xf104a5){try{jsonpatch[_0xeea7('0x24')](_0xf104a5,_0x1e825d,!![]);}catch(_0xf872e2){return BPromise[_0xeea7('0x25')](_0xf872e2);}return _0xf104a5[_0xeea7('0x26')]();};}function saveUpdates(_0x2c5f93,_0x31a248){return function(_0x12a0e5){if(_0x12a0e5){return _0x12a0e5[_0xeea7('0x27')](_0x2c5f93)[_0xeea7('0x28')](function(_0x2f55e2){return _0x2f55e2;});}return null;};}function removeEntity(_0x47a258,_0x40eb61){return function(_0x3e8f50){if(_0x3e8f50){return _0x3e8f50[_0xeea7('0x29')]()[_0xeea7('0x28')](function(){var _0x4a196b=_0x3e8f50[_0xeea7('0x2a')]({'plain':!![]});var _0x1bd101=_0xeea7('0x2b');return db[_0xeea7('0x2c')][_0xeea7('0x29')]({'where':{'type':_0x1bd101,'resourceId':_0x4a196b['id']}})[_0xeea7('0x28')](function(){return _0x3e8f50;});})[_0xeea7('0x28')](function(){_0x47a258['status'](0xcc)[_0xeea7('0x1c')]();});}};}function handleEntityNotFound(_0x371ee9,_0xaf2077){return function(_0x27f538){if(!_0x27f538){_0x371ee9[_0xeea7('0x2d')](0x194);}return _0x27f538;};}function handleError(_0x2a5064,_0x29048c){_0x29048c=_0x29048c||0x1f4;return function(_0x1df00c){logger[_0xeea7('0x2e')](_0x1df00c[_0xeea7('0x2f')]);if(_0x1df00c[_0xeea7('0x30')]){delete _0x1df00c['name'];}_0x2a5064[_0xeea7('0x1b')](_0x29048c)[_0xeea7('0x31')](_0x1df00c);};}exports[_0xeea7('0x32')]=function(_0x1cc8ce,_0x2af5eb){var _0x541f55={},_0x25a7f7={},_0x224c16={'count':0x0,'rows':[]};var _0x4d8757=_[_0xeea7('0x33')](db[_0xeea7('0x34')][_0xeea7('0x35')],function(_0x4f06ef){return{'name':_0x4f06ef[_0xeea7('0x36')],'type':_0x4f06ef[_0xeea7('0x37')]['key']};});_0x25a7f7[_0xeea7('0x38')]=_['map'](_0x4d8757,_0xeea7('0x30'));_0x25a7f7['query']=_['keys'](_0x1cc8ce['query']);_0x25a7f7[_0xeea7('0x39')]=_[_0xeea7('0x3a')](_0x25a7f7[_0xeea7('0x38')],_0x25a7f7[_0xeea7('0x3b')]);_0x541f55[_0xeea7('0x3c')]=_['intersection'](_0x25a7f7[_0xeea7('0x38')],qs[_0xeea7('0x3d')](_0x1cc8ce[_0xeea7('0x3b')]['fields']));_0x541f55[_0xeea7('0x3c')]=_0x541f55[_0xeea7('0x3c')]['length']?_0x541f55[_0xeea7('0x3c')]:_0x25a7f7[_0xeea7('0x38')];if(!_0x1cc8ce[_0xeea7('0x3b')][_0xeea7('0x3e')](_0xeea7('0x3f'))){_0x541f55[_0xeea7('0x1e')]=qs[_0xeea7('0x1e')](_0x1cc8ce[_0xeea7('0x3b')][_0xeea7('0x1e')]);_0x541f55['offset']=qs[_0xeea7('0x20')](_0x1cc8ce[_0xeea7('0x3b')][_0xeea7('0x20')]);}_0x541f55[_0xeea7('0x40')]=qs[_0xeea7('0x41')](_0x1cc8ce[_0xeea7('0x3b')][_0xeea7('0x41')]);_0x541f55[_0xeea7('0x42')]=qs[_0xeea7('0x39')](_[_0xeea7('0x43')](_0x1cc8ce[_0xeea7('0x3b')],_0x25a7f7[_0xeea7('0x39')]),_0x4d8757);if(_0x1cc8ce[_0xeea7('0x3b')][_0xeea7('0x44')]){_0x541f55[_0xeea7('0x42')]=_[_0xeea7('0x45')](_0x541f55[_0xeea7('0x42')],{'$or':_[_0xeea7('0x33')](_0x4d8757,function(_0x4ca18e){if(_0x4ca18e[_0xeea7('0x37')]!=='VIRTUAL'){var _0x32ccd2={};_0x32ccd2[_0x4ca18e[_0xeea7('0x30')]]={'$like':'%'+_0x1cc8ce[_0xeea7('0x3b')][_0xeea7('0x44')]+'%'};return _0x32ccd2;}})});}_0x541f55=_[_0xeea7('0x45')]({},_0x541f55,_0x1cc8ce[_0xeea7('0x46')]);var _0x2cb38b={'where':_0x541f55[_0xeea7('0x42')]};return db['WhatsappQueue'][_0xeea7('0x1f')](_0x2cb38b)['then'](function(_0x599037){_0x224c16[_0xeea7('0x1f')]=_0x599037;if(_0x1cc8ce[_0xeea7('0x3b')][_0xeea7('0x47')]){_0x541f55[_0xeea7('0x48')]=[{'all':!![]}];}return db[_0xeea7('0x34')][_0xeea7('0x49')](_0x541f55);})[_0xeea7('0x28')](function(_0x231d08){_0x224c16[_0xeea7('0x4a')]=_0x231d08;return _0x224c16;})['then'](respondWithFilteredResult(_0x2af5eb,_0x541f55))[_0xeea7('0x4b')](handleError(_0x2af5eb,null));};exports[_0xeea7('0x4c')]=function(_0x1feb2c,_0x2b1b27){var _0x45b864={'raw':!![],'where':{'id':_0x1feb2c[_0xeea7('0x4d')]['id']}},_0x290310={};_0x290310['model']=_[_0xeea7('0x4e')](db['WhatsappQueue'][_0xeea7('0x35')]);_0x290310['query']=_[_0xeea7('0x4e')](_0x1feb2c[_0xeea7('0x3b')]);_0x290310[_0xeea7('0x39')]=_[_0xeea7('0x3a')](_0x290310[_0xeea7('0x38')],_0x290310[_0xeea7('0x3b')]);_0x45b864[_0xeea7('0x3c')]=_[_0xeea7('0x3a')](_0x290310[_0xeea7('0x38')],qs['fields'](_0x1feb2c[_0xeea7('0x3b')][_0xeea7('0x3d')]));_0x45b864[_0xeea7('0x3c')]=_0x45b864[_0xeea7('0x3c')][_0xeea7('0x4f')]?_0x45b864[_0xeea7('0x3c')]:_0x290310[_0xeea7('0x38')];if(_0x1feb2c[_0xeea7('0x3b')][_0xeea7('0x47')]){_0x45b864[_0xeea7('0x48')]=[{'all':!![]}];}_0x45b864=_['merge']({},_0x45b864,_0x1feb2c[_0xeea7('0x46')]);return db[_0xeea7('0x34')][_0xeea7('0x50')](_0x45b864)['then'](handleEntityNotFound(_0x2b1b27,null))[_0xeea7('0x28')](respondWithResult(_0x2b1b27,null))[_0xeea7('0x4b')](handleError(_0x2b1b27,null));};exports[_0xeea7('0x51')]=function(_0x3ebbaf,_0x4f43c4){return db[_0xeea7('0x34')][_0xeea7('0x51')](_0x3ebbaf[_0xeea7('0x52')],{})[_0xeea7('0x28')](function(_0x4949b7){var _0x1aaa21=_0x3ebbaf[_0xeea7('0x53')][_0xeea7('0x2a')]({'plain':!![]});if(!_0x1aaa21)throw new Error(_0xeea7('0x54'));if(_0x1aaa21['role']===_0xeea7('0x53')){var _0x23d3bc=_0x4949b7[_0xeea7('0x2a')]({'plain':!![]});var _0x2f530d=_0xeea7('0x2b');return db[_0xeea7('0x55')][_0xeea7('0x50')]({'where':{'name':_0x2f530d,'userProfileId':_0x1aaa21[_0xeea7('0x56')]},'raw':!![]})['then'](function(_0x5239a1){if(_0x5239a1&&_0x5239a1['autoAssociation']===0x0){return db[_0xeea7('0x2c')][_0xeea7('0x51')]({'name':_0x23d3bc[_0xeea7('0x30')],'resourceId':_0x23d3bc['id'],'type':_0x5239a1[_0xeea7('0x30')],'sectionId':_0x5239a1['id']},{})[_0xeea7('0x28')](function(){return _0x4949b7;});}else{return _0x4949b7;}})[_0xeea7('0x4b')](function(_0x30807e){logger[_0xeea7('0x2e')](_0xeea7('0x57'),_0x30807e);throw _0x30807e;});}return _0x4949b7;})['then'](respondWithResult(_0x4f43c4,0xc9))[_0xeea7('0x4b')](handleError(_0x4f43c4,null));};exports[_0xeea7('0x27')]=function(_0x34c0d4,_0x62e400){if(_0x34c0d4[_0xeea7('0x52')]['id']){delete _0x34c0d4[_0xeea7('0x52')]['id'];}return db['WhatsappQueue'][_0xeea7('0x50')]({'where':{'id':_0x34c0d4[_0xeea7('0x4d')]['id']}})[_0xeea7('0x28')](handleEntityNotFound(_0x62e400,null))[_0xeea7('0x28')](saveUpdates(_0x34c0d4['body'],null))[_0xeea7('0x28')](respondWithResult(_0x62e400,null))[_0xeea7('0x4b')](handleError(_0x62e400,null));};exports[_0xeea7('0x29')]=function(_0x2c9bbe,_0x2d71d3){return db[_0xeea7('0x34')][_0xeea7('0x50')]({'where':{'id':_0x2c9bbe['params']['id']}})[_0xeea7('0x28')](handleEntityNotFound(_0x2d71d3,null))[_0xeea7('0x28')](removeEntity(_0x2d71d3,null))[_0xeea7('0x4b')](handleError(_0x2d71d3,null));};exports['describe']=function(_0x1fb4b6,_0x2e8c25){return db[_0xeea7('0x34')][_0xeea7('0x58')]()[_0xeea7('0x28')](respondWithResult(_0x2e8c25,null))[_0xeea7('0x4b')](handleError(_0x2e8c25,null));};exports[_0xeea7('0x59')]=function(_0x11db8c,_0x1eb422,_0x47029c){var _0x1aeaf8={'raw':!![],'where':{}},_0x3ea6f4={},_0x5046f6;return db[_0xeea7('0x34')]['findOne']({'where':{'id':_0x11db8c[_0xeea7('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1eb422,null))[_0xeea7('0x28')](function(_0x408061){if(_0x408061){_0x5046f6=_0x408061[_0xeea7('0x2a')]({'plain':!![]});_0x3ea6f4['model']=_[_0xeea7('0x4e')](db[_0xeea7('0x5a')][_0xeea7('0x35')]);_0x3ea6f4[_0xeea7('0x3b')]=_[_0xeea7('0x4e')](_0x11db8c[_0xeea7('0x3b')]);_0x3ea6f4[_0xeea7('0x39')]=_['intersection'](_0x3ea6f4[_0xeea7('0x38')],_0x3ea6f4[_0xeea7('0x3b')]);_0x1aeaf8[_0xeea7('0x3c')]=_[_0xeea7('0x3a')](_0x3ea6f4['model'],qs[_0xeea7('0x3d')](_0x11db8c[_0xeea7('0x3b')][_0xeea7('0x3d')]));_0x1aeaf8[_0xeea7('0x3c')]=_0x1aeaf8[_0xeea7('0x3c')][_0xeea7('0x4f')]?_0x1aeaf8[_0xeea7('0x3c')]:_0x3ea6f4[_0xeea7('0x38')];if(!_0x11db8c[_0xeea7('0x3b')][_0xeea7('0x3e')](_0xeea7('0x3f'))){_0x1aeaf8['limit']=qs['limit'](_0x11db8c[_0xeea7('0x3b')][_0xeea7('0x1e')]);_0x1aeaf8[_0xeea7('0x20')]=qs[_0xeea7('0x20')](_0x11db8c[_0xeea7('0x3b')][_0xeea7('0x20')]);}_0x1aeaf8[_0xeea7('0x40')]=qs[_0xeea7('0x41')](_0x11db8c['query'][_0xeea7('0x41')]);_0x1aeaf8[_0xeea7('0x42')]=qs['filters'](_[_0xeea7('0x43')](_0x11db8c['query'],_0x3ea6f4[_0xeea7('0x39')]));_0x1aeaf8[_0xeea7('0x42')][_0xeea7('0x5b')]=_0x408061['id'];if(_0x11db8c[_0xeea7('0x3b')]['filter']){_0x1aeaf8[_0xeea7('0x42')]=_[_0xeea7('0x45')](_0x1aeaf8[_0xeea7('0x42')],{'$or':_[_0xeea7('0x33')](_0x1aeaf8['attributes'],function(_0x12144b){var _0x45c91b={};_0x45c91b[_0x12144b]={'$like':'%'+_0x11db8c[_0xeea7('0x3b')][_0xeea7('0x44')]+'%'};return _0x45c91b;})});}_0x1aeaf8=_[_0xeea7('0x45')]({},_0x1aeaf8,_0x11db8c[_0xeea7('0x46')]);return db[_0xeea7('0x5a')][_0xeea7('0x49')](_0x1aeaf8);}})[_0xeea7('0x28')](function(_0x1e9cae){if(_0x1e9cae){return db['User']['findAndCountAll']({'where':{'id':_[_0xeea7('0x33')](_0x1e9cae,_0xeea7('0x5c')),'role':'agent'},'attributes':['id',_0xeea7('0x30'),'whatsappPause',_0xeea7('0x5d'),_0xeea7('0x5e')]});}})[_0xeea7('0x28')](function(_0x23db5f){if(_0x23db5f){return{'count':_0x23db5f[_0xeea7('0x1f')],'rows':_[_0xeea7('0x33')](_0x23db5f[_0xeea7('0x4a')],function(_0x46bda8){return{'membername':_0x46bda8[_0xeea7('0x30')],'UserId':_0x46bda8['id'],'queue_name':_0x5046f6[_0xeea7('0x30')],'WhatsappQueueId':_0x5046f6['id'],'interface':util[_0xeea7('0x5f')](_0xeea7('0x60'),_0xeea7('0x61'),_0x46bda8['name']),'penalty':0x0,'paused':_0x46bda8[_0xeea7('0x62')],'createdAt':_0x46bda8[_0xeea7('0x5e')],'updatedAt':_0x46bda8['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xeea7('0x28')](respondWithFilteredResult(_0x1eb422,_0x1aeaf8))[_0xeea7('0x4b')](handleError(_0x1eb422,null));};exports['getTeams']=function(_0x11c87e,_0x55e08d,_0x4f0652){var _0x1ee37e={};var _0x512b88={};var _0x5806e2;var _0x21d6c8;return db[_0xeea7('0x34')][_0xeea7('0x63')]({'where':{'id':_0x11c87e[_0xeea7('0x4d')]['id']}})[_0xeea7('0x28')](handleEntityNotFound(_0x55e08d,null))['then'](function(_0x204959){if(_0x204959){_0x5806e2=_0x204959;_0x512b88[_0xeea7('0x38')]=_['keys'](db['Team'][_0xeea7('0x35')]);_0x512b88[_0xeea7('0x3b')]=_[_0xeea7('0x4e')](_0x11c87e[_0xeea7('0x3b')]);_0x512b88['filters']=_[_0xeea7('0x3a')](_0x512b88[_0xeea7('0x38')],_0x512b88['query']);_0x1ee37e['attributes']=_[_0xeea7('0x3a')](_0x512b88[_0xeea7('0x38')],qs[_0xeea7('0x3d')](_0x11c87e['query'][_0xeea7('0x3d')]));_0x1ee37e[_0xeea7('0x3c')]=_0x1ee37e[_0xeea7('0x3c')][_0xeea7('0x4f')]?_0x1ee37e[_0xeea7('0x3c')]:_0x512b88['model'];_0x1ee37e[_0xeea7('0x40')]=qs['sort'](_0x11c87e[_0xeea7('0x3b')][_0xeea7('0x41')]);_0x1ee37e[_0xeea7('0x42')]=qs[_0xeea7('0x39')](_['pick'](_0x11c87e['query'],_0x512b88[_0xeea7('0x39')]));if(_0x11c87e[_0xeea7('0x3b')]['filter']){_0x1ee37e[_0xeea7('0x42')]=_[_0xeea7('0x45')](_0x1ee37e['where'],{'$or':_['map'](_0x1ee37e['attributes'],function(_0x1ae94d){var _0x5b5343={};_0x5b5343[_0x1ae94d]={'$like':'%'+_0x11c87e[_0xeea7('0x3b')][_0xeea7('0x44')]+'%'};return _0x5b5343;})});}_0x1ee37e=_[_0xeea7('0x45')]({},_0x1ee37e,_0x11c87e[_0xeea7('0x46')]);return _0x5806e2[_0xeea7('0x64')](_0x1ee37e);}})['then'](function(_0x1a499b){if(_0x1a499b){_0x21d6c8=_0x1a499b[_0xeea7('0x4f')];if(!_0x11c87e[_0xeea7('0x3b')][_0xeea7('0x3e')](_0xeea7('0x3f'))){_0x1ee37e['limit']=qs[_0xeea7('0x1e')](_0x11c87e[_0xeea7('0x3b')][_0xeea7('0x1e')]);_0x1ee37e['offset']=qs[_0xeea7('0x20')](_0x11c87e[_0xeea7('0x3b')][_0xeea7('0x20')]);}return _0x5806e2['getTeams'](_0x1ee37e);}})[_0xeea7('0x28')](function(_0x24094d){if(_0x24094d){return _0x24094d?{'count':_0x21d6c8,'rows':_0x24094d}:null;}})[_0xeea7('0x28')](respondWithResult(_0x55e08d,null))['catch'](handleError(_0x55e08d,null));};exports['addTeams']=function(_0x495af3,_0x5ec974,_0x363aa8){var _0x218389=_0x495af3[_0xeea7('0x52')][_0xeea7('0x65')];return db[_0xeea7('0x66')][_0xeea7('0x49')]({'where':{'id':_0x218389},'attributes':['id'],'include':[{'model':db[_0xeea7('0x67')],'as':_0xeea7('0x68'),'attributes':['id','name','online','voicePause',_0xeea7('0x69')],'raw':!![]}]})[_0xeea7('0x28')](function(_0x159248){if(_0x159248){var _0x23b81f=_['flatMap'](_0x159248,function(_0x36d1bb){var _0x455de9=_0x36d1bb[_0xeea7('0x2a')]({'plain':!![]});return _0x455de9[_0xeea7('0x68')];});return db[_0xeea7('0x34')][_0xeea7('0x50')]({'where':{'id':_0x495af3[_0xeea7('0x4d')]['id']}})[_0xeea7('0x28')](function(_0x251074){return db[_0xeea7('0x6a')][_0xeea7('0x6b')](function(_0x6f247){return _0x251074[_0xeea7('0x6c')](_0x218389,{'transaction':_0x6f247})[_0xeea7('0x28')](function(){return BPromise[_0xeea7('0x6d')](_0x23b81f,function(_0x2cbc6b){return db[_0xeea7('0x5a')][_0xeea7('0x6e')]({'where':{'UserId':_0x2cbc6b['id'],'WhatsappQueueId':_0x495af3['params']['id']},'transaction':_0x6f247});});})[_0xeea7('0x28')](function(){_0x23b81f[_0xeea7('0x6f')](function(_0x239025){socket['emit'](_0xeea7('0x70'),{'UserId':_0x239025['id'],'WhatsappQueueId':_0x251074['id']});});});});});}})[_0xeea7('0x28')](respondWithStatusCode(_0x5ec974,null))[_0xeea7('0x4b')](handleError(_0x5ec974,null));};exports[_0xeea7('0x71')]=function(_0x354dbe,_0x594ded,_0x1c4065){return db[_0xeea7('0x66')][_0xeea7('0x49')]({'where':{'id':_0x354dbe[_0xeea7('0x3b')][_0xeea7('0x65')]},'attributes':['id'],'include':[{'model':db[_0xeea7('0x67')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xeea7('0x28')](handleEntityNotFound(_0x594ded,null))['then'](function(_0x3849c2){var _0x118916=_[_0xeea7('0x33')](_0x3849c2,'id');var _0x4611b5=[];var _0x4561ed=[];var _0x1f832a=squel['select']();_0x1f832a[_0xeea7('0x72')](_0xeea7('0x73'))[_0xeea7('0x74')](_0xeea7('0x75'),'tq')[_0xeea7('0x76')](_0xeea7('0x77'),'ut',_0xeea7('0x78'))[_0xeea7('0x42')](_0xeea7('0x79'),_0x354dbe[_0xeea7('0x4d')]['id']);for(var _0x5e4859=0x0;_0x5e4859<_0x3849c2[_0xeea7('0x4f')];_0x5e4859+=0x1){let _0x44cbe8=_0x3849c2[_0x5e4859];for(var _0x4ff0e6=0x0;_0x4ff0e6<_0x44cbe8[_0xeea7('0x68')][_0xeea7('0x4f')];_0x4ff0e6+=0x1){let _0x78b606=_0x44cbe8['Agents'][_0x4ff0e6];var _0x58c785=_0x1f832a[_0xeea7('0x7a')]();_0x58c785[_0xeea7('0x42')](_0xeea7('0x7b'),_0x78b606['id']);_0x4561ed[_0xeea7('0x7c')](db[_0xeea7('0x6a')]['query'](_0x58c785[_0xeea7('0x7d')](),{'type':db[_0xeea7('0x6a')][_0xeea7('0x7e')][_0xeea7('0x7f')]})['then'](function(_0x4172b9){if(_0x4172b9['length']===0x1){return _0x78b606['id'];}else{var _0x322b8f=_[_0xeea7('0x80')](_[_0xeea7('0x33')](_0x4172b9,_0xeea7('0x81')),function(_0x4d5a11){return _['includes'](_0x118916,_0x4d5a11);});if(_0x322b8f){return _0x78b606['id'];}}}));}}return BPromise[_0xeea7('0x82')](_0x4561ed)[_0xeea7('0x28')](function(_0x94d344){_0x4611b5=_(_0x4611b5)[_0xeea7('0x83')](_0x94d344)['compact']()[_0xeea7('0x84')]();return db[_0xeea7('0x34')]['find']({'where':{'id':_0x354dbe[_0xeea7('0x4d')]['id']}})[_0xeea7('0x28')](function(_0x3077e3){return db[_0xeea7('0x6a')][_0xeea7('0x6b')](function(_0x1f4f96){return _0x3077e3[_0xeea7('0x71')](_0x354dbe[_0xeea7('0x3b')][_0xeea7('0x65')],{'transaction':_0x1f4f96})[_0xeea7('0x28')](function(){if(!_[_0xeea7('0x85')](_0x4611b5)){return _0x3077e3['removeAgents'](_0x4611b5,{'transaction':_0x1f4f96});}})[_0xeea7('0x28')](function(){_0x4611b5['forEach'](function(_0x2a871d){socket['emit']('userWhatsappQueue:remove',{'UserId':_0x2a871d,'WhatsappQueueId':_0x3077e3['id']});});});});});});})['then'](respondWithStatusCode(_0x594ded,null))[_0xeea7('0x4b')](handleError(_0x594ded,null));};exports['addAgents']=function(_0x568225,_0x5d76b6,_0x4bf266){return db[_0xeea7('0x34')][_0xeea7('0x50')]({'where':{'id':_0x568225[_0xeea7('0x4d')]['id']}})[_0xeea7('0x28')](handleEntityNotFound(_0x5d76b6,null))[_0xeea7('0x28')](function(_0x35a5da){if(_0x35a5da){return _0x35a5da[_0xeea7('0x86')](_0x568225[_0xeea7('0x52')][_0xeea7('0x65')],_[_0xeea7('0x87')](_0x568225['body'],[_0xeea7('0x65'),'id'])||{})[_0xeea7('0x88')](function(_0x55ab38){for(var _0x55be7f=0x0;_0x55be7f<_0x568225['body'][_0xeea7('0x65')][_0xeea7('0x4f')];_0x55be7f+=0x1){socket[_0xeea7('0x89')]('userWhatsappQueue:save',{'UserId':Number(_0x568225[_0xeea7('0x52')]['ids'][_0x55be7f]),'WhatsappQueueId':Number(_0x568225[_0xeea7('0x4d')]['id'])});}return _0x55ab38;});}})[_0xeea7('0x28')](respondWithResult(_0x5d76b6,null))[_0xeea7('0x4b')](handleError(_0x5d76b6,null));};exports[_0xeea7('0x8a')]=function(_0x38f601,_0x4ee2a8,_0x4a0a35){return db[_0xeea7('0x34')][_0xeea7('0x50')]({'where':{'id':_0x38f601[_0xeea7('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4ee2a8,null))['then'](function(_0x19314a){if(_0x19314a){return _0x19314a[_0xeea7('0x8a')](_0x38f601[_0xeea7('0x3b')]['ids'])[_0xeea7('0x28')](function(){if(_[_0xeea7('0x8b')](_0x38f601[_0xeea7('0x3b')][_0xeea7('0x65')])){for(var _0x43612d=0x0;_0x43612d<_0x38f601[_0xeea7('0x3b')]['ids'][_0xeea7('0x4f')];_0x43612d+=0x1){socket[_0xeea7('0x89')](_0xeea7('0x8c'),{'UserId':Number(_0x38f601['query']['ids'][_0x43612d]),'WhatsappQueueId':Number(_0x38f601[_0xeea7('0x4d')]['id'])});}}else{socket['emit'](_0xeea7('0x8c'),{'UserId':Number(_0x38f601[_0xeea7('0x3b')][_0xeea7('0x65')]),'WhatsappQueueId':Number(_0x38f601[_0xeea7('0x4d')]['id'])});}});}})[_0xeea7('0x28')](respondWithStatusCode(_0x4ee2a8,null))[_0xeea7('0x4b')](handleError(_0x4ee2a8,null));};exports['getAgents']=function(_0x1082cb,_0x11fd59,_0x4dba3e){var _0x58b2de={};var _0x5bc80e={};var _0x1e2665;var _0x33f8b8;return db['WhatsappQueue'][_0xeea7('0x63')]({'where':{'id':_0x1082cb[_0xeea7('0x4d')]['id']}})[_0xeea7('0x28')](handleEntityNotFound(_0x11fd59,null))['then'](function(_0x7af5d3){if(_0x7af5d3){_0x1e2665=_0x7af5d3;_0x5bc80e[_0xeea7('0x38')]=_[_0xeea7('0x4e')](db['User'][_0xeea7('0x35')]);_0x5bc80e[_0xeea7('0x3b')]=_[_0xeea7('0x4e')](_0x1082cb[_0xeea7('0x3b')]);_0x5bc80e[_0xeea7('0x39')]=_[_0xeea7('0x3a')](_0x5bc80e[_0xeea7('0x38')],_0x5bc80e[_0xeea7('0x3b')]);_0x58b2de[_0xeea7('0x3c')]=_[_0xeea7('0x3a')](_0x5bc80e['model'],qs[_0xeea7('0x3d')](_0x1082cb['query']['fields']));_0x58b2de[_0xeea7('0x3c')]=_0x58b2de['attributes']['length']?_0x58b2de[_0xeea7('0x3c')]:_0x5bc80e[_0xeea7('0x38')];_0x58b2de[_0xeea7('0x40')]=qs[_0xeea7('0x41')](_0x1082cb[_0xeea7('0x3b')][_0xeea7('0x41')]);_0x58b2de[_0xeea7('0x42')]=qs[_0xeea7('0x39')](_[_0xeea7('0x43')](_0x1082cb[_0xeea7('0x3b')],_0x5bc80e[_0xeea7('0x39')]));if(_0x1082cb['query']['filter']){_0x58b2de[_0xeea7('0x42')]=_[_0xeea7('0x45')](_0x58b2de['where'],{'$or':_['map'](_0x58b2de[_0xeea7('0x3c')],function(_0x5092fb){var _0x3af514={};_0x3af514[_0x5092fb]={'$like':'%'+_0x1082cb['query']['filter']+'%'};return _0x3af514;})});}_0x58b2de=_['merge']({},_0x58b2de,_0x1082cb[_0xeea7('0x46')]);return _0x1e2665[_0xeea7('0x8d')](_0x58b2de);}})[_0xeea7('0x28')](function(_0x7ee553){if(_0x7ee553){_0x33f8b8=_0x7ee553[_0xeea7('0x4f')];if(!_0x1082cb[_0xeea7('0x3b')]['hasOwnProperty'](_0xeea7('0x3f'))){_0x58b2de[_0xeea7('0x1e')]=qs['limit'](_0x1082cb[_0xeea7('0x3b')][_0xeea7('0x1e')]);_0x58b2de['offset']=qs['offset'](_0x1082cb[_0xeea7('0x3b')][_0xeea7('0x20')]);}return _0x1e2665['getAgents'](_0x58b2de);}})['then'](function(_0x270ef0){if(_0x270ef0){return _0x270ef0?{'count':_0x33f8b8,'rows':_0x270ef0}:null;}})[_0xeea7('0x28')](respondWithResult(_0x11fd59,null))[_0xeea7('0x4b')](handleError(_0x11fd59,null));};
\ No newline at end of file
index 5a01ea0..9bc2912 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x883b=['../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x5550b3,_0x2d0ee0){var _0x4b8fc4=function(_0x22393a){while(--_0x22393a){_0x5550b3['push'](_0x5550b3['shift']());}};_0x4b8fc4(++_0x2d0ee0);}(_0x883b,0x117));var _0xb883=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x883b[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0xb883('0x0'))['db'][_0xb883('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xb883('0x2')](0x0);var events={'afterCreate':_0xb883('0x3'),'afterUpdate':_0xb883('0x4'),'afterDestroy':_0xb883('0x5')};function emitEvent(_0x2a90aa){return function(_0xdf580f,_0x50f192,_0x3deebb){WhatsappQueueEvents[_0xb883('0x6')](_0x2a90aa+':'+_0xdf580f['id'],_0xdf580f);WhatsappQueueEvents[_0xb883('0x6')](_0x2a90aa,_0xdf580f);_0x3deebb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0xb883('0x7')](e,emitEvent(event));}}module[_0xb883('0x8')]=WhatsappQueueEvents;
\ No newline at end of file
+var _0x40a1=['events','WhatsappQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x40a1,0x19e));var _0x140a=function(_0x1bff8e,_0x2838d8){_0x1bff8e=_0x1bff8e-0x0;var _0x3e8f49=_0x40a1[_0x1bff8e];return _0x3e8f49;};'use strict';var EventEmitter=require(_0x140a('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x140a('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x140a('0x2')](0x0);var events={'afterCreate':_0x140a('0x3'),'afterUpdate':_0x140a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x541f74){return function(_0x3f6633,_0x1958b9,_0x110618){WhatsappQueueEvents[_0x140a('0x5')](_0x541f74+':'+_0x3f6633['id'],_0x3f6633);WhatsappQueueEvents[_0x140a('0x5')](_0x541f74,_0x3f6633);_0x110618(null);};}for(var e in events){if(events[_0x140a('0x6')](e)){var event=events[e];WhatsappQueue[_0x140a('0x7')](e,emitEvent(event));}}module[_0x140a('0x8')]=WhatsappQueueEvents;
\ No newline at end of file
index 07aa4ae..d9149a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70be=['rimraf','../../config/environment','exports','define','lodash','../../config/logger','api','request-promise','path'];(function(_0x2bef27,_0x4cc724){var _0x278472=function(_0x3af420){while(--_0x3af420){_0x2bef27['push'](_0x2bef27['shift']());}};_0x278472(++_0x4cc724);}(_0x70be,0x175));var _0xe70b=function(_0x1689d5,_0x2b06cf){_0x1689d5=_0x1689d5-0x0;var _0xe4fb84=_0x70be[_0x1689d5];return _0xe4fb84;};'use strict';var _=require(_0xe70b('0x0'));var util=require('util');var logger=require(_0xe70b('0x1'))(_0xe70b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe70b('0x3'));var fs=require('fs');var path=require(_0xe70b('0x4'));var rimraf=require(_0xe70b('0x5'));var config=require(_0xe70b('0x6'));var attributes=require('./whatsappQueue.attributes');module[_0xe70b('0x7')]=function(_0x4a2ec4,_0x323288){return _0x4a2ec4[_0xe70b('0x8')]('WhatsappQueue',attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4111=['moment','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','whatsapp_queues','lodash','util','../../config/logger'];(function(_0x4948e8,_0x1f4aea){var _0x1b52ab=function(_0x105a98){while(--_0x105a98){_0x4948e8['push'](_0x4948e8['shift']());}};_0x1b52ab(++_0x1f4aea);}(_0x4111,0x1e7));var _0x1411=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4111[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1411('0x0'));var util=require(_0x1411('0x1'));var logger=require(_0x1411('0x2'))('api');var moment=require(_0x1411('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1411('0x4'));var rimraf=require(_0x1411('0x5'));var config=require(_0x1411('0x6'));var attributes=require(_0x1411('0x7'));module[_0x1411('0x8')]=function(_0x3e2f46,_0x2e36ff){return _0x3e2f46['define']('WhatsappQueue',attributes,{'tableName':_0x1411('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 63ab111..94e8cf2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0888=['info','request\x20sent','debug','stringify','error','code','WhatsappQueue,\x20%s,\x20%s','message','WhatsappQueue','findAll','options','raw','where','attributes','limit','include','model','map','GetWhatsappQueue','catch','ShowWhatsappQueue','find','util','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','./whatsappQueue.socket','register','then'];(function(_0x48e921,_0x20cf98){var _0x4986fe=function(_0x466eb2){while(--_0x466eb2){_0x48e921['push'](_0x48e921['shift']());}};_0x4986fe(++_0x20cf98);}(_0x0888,0x12e));var _0x8088=function(_0x356dc5,_0x16a8c0){_0x356dc5=_0x356dc5-0x0;var _0x106b31=_0x0888[_0x356dc5];return _0x106b31;};'use strict';var _=require('lodash');var util=require(_0x8088('0x0'));var moment=require(_0x8088('0x1'));var BPromise=require('bluebird');var rs=require(_0x8088('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8088('0x3'))(_0x8088('0x4'));var config=require(_0x8088('0x5'));var jayson=require(_0x8088('0x6'));var client=jayson['client'][_0x8088('0x7')]({'port':0x232a});config[_0x8088('0x8')]=_['defaults'](config[_0x8088('0x8')],{'host':_0x8088('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8088('0x8')]));require(_0x8088('0xa'))[_0x8088('0xb')](socket);function respondWithRpcPromise(_0x193162,_0x55dcb7,_0x472f9c){return new BPromise(function(_0x584e1c,_0x3eab67){return client['request'](_0x193162,_0x472f9c)[_0x8088('0xc')](function(_0x662d64){logger[_0x8088('0xd')]('WhatsappQueue,\x20%s,\x20%s',_0x55dcb7,_0x8088('0xe'));logger[_0x8088('0xf')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x55dcb7,_0x8088('0xe'),JSON[_0x8088('0x10')](_0x662d64));if(_0x662d64[_0x8088('0x11')]){if(_0x662d64[_0x8088('0x11')][_0x8088('0x12')]===0x1f4){logger[_0x8088('0x11')](_0x8088('0x13'),_0x55dcb7,_0x662d64[_0x8088('0x11')][_0x8088('0x14')]);return _0x3eab67(_0x662d64['error'][_0x8088('0x14')]);}logger[_0x8088('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x55dcb7,_0x662d64[_0x8088('0x11')][_0x8088('0x14')]);return _0x584e1c(_0x662d64[_0x8088('0x11')][_0x8088('0x14')]);}else{logger[_0x8088('0xd')](_0x8088('0x13'),_0x55dcb7,'request\x20sent');_0x584e1c(_0x662d64['result'][_0x8088('0x14')]);}})['catch'](function(_0x5b6f4a){logger['error'](_0x8088('0x13'),_0x55dcb7,_0x5b6f4a);_0x3eab67(_0x5b6f4a);});});}exports['GetWhatsappQueue']=function(_0x4061b8){var _0x445cd1=this;return new Promise(function(_0x2a78f1,_0xb287d4){return db[_0x8088('0x15')][_0x8088('0x16')]({'raw':_0x4061b8[_0x8088('0x17')]?_0x4061b8[_0x8088('0x17')][_0x8088('0x18')]===undefined?!![]:![]:!![],'where':_0x4061b8[_0x8088('0x17')]?_0x4061b8[_0x8088('0x17')][_0x8088('0x19')]||null:null,'attributes':_0x4061b8[_0x8088('0x17')]?_0x4061b8[_0x8088('0x17')][_0x8088('0x1a')]||null:null,'limit':_0x4061b8[_0x8088('0x17')]?_0x4061b8[_0x8088('0x17')][_0x8088('0x1b')]||null:null,'include':_0x4061b8[_0x8088('0x17')]?_0x4061b8[_0x8088('0x17')][_0x8088('0x1c')]?_['map'](_0x4061b8['options']['include'],function(_0x36f012){return{'model':db[_0x36f012[_0x8088('0x1d')]],'as':_0x36f012['as'],'attributes':_0x36f012['attributes'],'include':_0x36f012[_0x8088('0x1c')]?_[_0x8088('0x1e')](_0x36f012[_0x8088('0x1c')],function(_0x3b7174){return{'model':db[_0x3b7174[_0x8088('0x1d')]],'as':_0x3b7174['as'],'attributes':_0x3b7174[_0x8088('0x1a')],'include':_0x3b7174['include']?_['map'](_0x3b7174['include'],function(_0x53f3a6){return{'model':db[_0x53f3a6[_0x8088('0x1d')]],'as':_0x53f3a6['as'],'attributes':_0x53f3a6[_0x8088('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46b36b){logger[_0x8088('0xd')](_0x8088('0x1f'),_0x4061b8);logger[_0x8088('0xf')](_0x8088('0x1f'),_0x4061b8,JSON[_0x8088('0x10')](_0x46b36b));_0x2a78f1(_0x46b36b);})[_0x8088('0x20')](function(_0x4fbb61){logger[_0x8088('0x11')](_0x8088('0x1f'),_0x4fbb61[_0x8088('0x14')],_0x4061b8);_0xb287d4(_0x445cd1[_0x8088('0x11')](0x1f4,_0x4fbb61[_0x8088('0x14')]));});});};exports[_0x8088('0x21')]=function(_0x1992a3){var _0x230a3f=this;return new Promise(function(_0x1dcfc1,_0x1c39b2){return db['WhatsappQueue'][_0x8088('0x22')]({'raw':_0x1992a3[_0x8088('0x17')]?_0x1992a3['options'][_0x8088('0x18')]===undefined?!![]:![]:!![],'where':_0x1992a3[_0x8088('0x17')]?_0x1992a3[_0x8088('0x17')][_0x8088('0x19')]||null:null,'attributes':_0x1992a3[_0x8088('0x17')]?_0x1992a3['options']['attributes']||null:null,'include':_0x1992a3[_0x8088('0x17')]?_0x1992a3['options']['include']?_['map'](_0x1992a3['options']['include'],function(_0x147185){return{'model':db[_0x147185[_0x8088('0x1d')]],'as':_0x147185['as'],'attributes':_0x147185[_0x8088('0x1a')],'include':_0x147185['include']?_[_0x8088('0x1e')](_0x147185[_0x8088('0x1c')],function(_0x4af3d4){return{'model':db[_0x4af3d4[_0x8088('0x1d')]],'as':_0x4af3d4['as'],'attributes':_0x4af3d4[_0x8088('0x1a')],'include':_0x4af3d4['include']?_[_0x8088('0x1e')](_0x4af3d4['include'],function(_0x50f457){return{'model':db[_0x50f457[_0x8088('0x1d')]],'as':_0x50f457['as'],'attributes':_0x50f457['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x12cc73){logger[_0x8088('0xd')](_0x8088('0x21'),_0x1992a3);logger['debug']('ShowWhatsappQueue',_0x1992a3,JSON[_0x8088('0x10')](_0x12cc73));_0x1dcfc1(_0x12cc73);})[_0x8088('0x20')](function(_0x358c3c){logger[_0x8088('0x11')](_0x8088('0x21'),_0x358c3c[_0x8088('0x14')],_0x1992a3);_0x1c39b2(_0x230a3f[_0x8088('0x11')](0x1f4,_0x358c3c[_0x8088('0x14')]));});});};
\ No newline at end of file
+var _0x2f82=['request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetWhatsappQueue','findAll','options','raw','where','limit','include','model','attributes','map','ShowWhatsappQueue','WhatsappQueue','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./whatsappQueue.socket','request','then','info','WhatsappQueue,\x20%s,\x20%s'];(function(_0x1443ad,_0x353e8e){var _0x4ab7e6=function(_0x139525){while(--_0x139525){_0x1443ad['push'](_0x1443ad['shift']());}};_0x4ab7e6(++_0x353e8e);}(_0x2f82,0xad));var _0x22f8=function(_0xa4f529,_0x36add4){_0xa4f529=_0xa4f529-0x0;var _0x3ce0df=_0x2f82[_0xa4f529];return _0x3ce0df;};'use strict';var _=require(_0x22f8('0x0'));var util=require('util');var moment=require(_0x22f8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x22f8('0x2'));var db=require(_0x22f8('0x3'))['db'];var utils=require(_0x22f8('0x4'));var logger=require(_0x22f8('0x5'))(_0x22f8('0x6'));var config=require(_0x22f8('0x7'));var jayson=require(_0x22f8('0x8'));var client=jayson[_0x22f8('0x9')][_0x22f8('0xa')]({'port':0x232a});config[_0x22f8('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x22f8('0xb')]));require(_0x22f8('0xc'))['register'](socket);function respondWithRpcPromise(_0x308f0e,_0x34cd1a,_0x1ac3a4){return new BPromise(function(_0x545240,_0x4482f3){return client[_0x22f8('0xd')](_0x308f0e,_0x1ac3a4)[_0x22f8('0xe')](function(_0x4bec97){logger[_0x22f8('0xf')](_0x22f8('0x10'),_0x34cd1a,_0x22f8('0x11'));logger[_0x22f8('0x12')](_0x22f8('0x13'),_0x34cd1a,_0x22f8('0x11'),JSON[_0x22f8('0x14')](_0x4bec97));if(_0x4bec97[_0x22f8('0x15')]){if(_0x4bec97['error'][_0x22f8('0x16')]===0x1f4){logger[_0x22f8('0x15')](_0x22f8('0x10'),_0x34cd1a,_0x4bec97[_0x22f8('0x15')][_0x22f8('0x17')]);return _0x4482f3(_0x4bec97[_0x22f8('0x15')][_0x22f8('0x17')]);}logger[_0x22f8('0x15')](_0x22f8('0x10'),_0x34cd1a,_0x4bec97['error'][_0x22f8('0x17')]);return _0x545240(_0x4bec97[_0x22f8('0x15')][_0x22f8('0x17')]);}else{logger[_0x22f8('0xf')]('WhatsappQueue,\x20%s,\x20%s',_0x34cd1a,_0x22f8('0x11'));_0x545240(_0x4bec97[_0x22f8('0x18')][_0x22f8('0x17')]);}})[_0x22f8('0x19')](function(_0x33301f){logger[_0x22f8('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x34cd1a,_0x33301f);_0x4482f3(_0x33301f);});});}exports[_0x22f8('0x1a')]=function(_0x39e3a4){var _0x9370a9=this;return new Promise(function(_0x48c506,_0x590664){return db['WhatsappQueue'][_0x22f8('0x1b')]({'raw':_0x39e3a4[_0x22f8('0x1c')]?_0x39e3a4[_0x22f8('0x1c')][_0x22f8('0x1d')]===undefined?!![]:![]:!![],'where':_0x39e3a4[_0x22f8('0x1c')]?_0x39e3a4['options'][_0x22f8('0x1e')]||null:null,'attributes':_0x39e3a4[_0x22f8('0x1c')]?_0x39e3a4[_0x22f8('0x1c')]['attributes']||null:null,'limit':_0x39e3a4[_0x22f8('0x1c')]?_0x39e3a4[_0x22f8('0x1c')][_0x22f8('0x1f')]||null:null,'include':_0x39e3a4['options']?_0x39e3a4[_0x22f8('0x1c')][_0x22f8('0x20')]?_['map'](_0x39e3a4[_0x22f8('0x1c')][_0x22f8('0x20')],function(_0x547a0b){return{'model':db[_0x547a0b[_0x22f8('0x21')]],'as':_0x547a0b['as'],'attributes':_0x547a0b[_0x22f8('0x22')],'include':_0x547a0b[_0x22f8('0x20')]?_['map'](_0x547a0b[_0x22f8('0x20')],function(_0x2029e4){return{'model':db[_0x2029e4[_0x22f8('0x21')]],'as':_0x2029e4['as'],'attributes':_0x2029e4['attributes'],'include':_0x2029e4[_0x22f8('0x20')]?_[_0x22f8('0x23')](_0x2029e4['include'],function(_0x5ee0ca){return{'model':db[_0x5ee0ca[_0x22f8('0x21')]],'as':_0x5ee0ca['as'],'attributes':_0x5ee0ca[_0x22f8('0x22')]};}):[]};}):[]};}):[]:[]})[_0x22f8('0xe')](function(_0x3dfd25){logger[_0x22f8('0xf')](_0x22f8('0x1a'),_0x39e3a4);logger[_0x22f8('0x12')]('GetWhatsappQueue',_0x39e3a4,JSON[_0x22f8('0x14')](_0x3dfd25));_0x48c506(_0x3dfd25);})[_0x22f8('0x19')](function(_0x3c9d49){logger[_0x22f8('0x15')](_0x22f8('0x1a'),_0x3c9d49[_0x22f8('0x17')],_0x39e3a4);_0x590664(_0x9370a9[_0x22f8('0x15')](0x1f4,_0x3c9d49[_0x22f8('0x17')]));});});};exports[_0x22f8('0x24')]=function(_0x2296b4){var _0x4530cd=this;return new Promise(function(_0x2aa606,_0x38cb22){return db[_0x22f8('0x25')]['find']({'raw':_0x2296b4[_0x22f8('0x1c')]?_0x2296b4[_0x22f8('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x2296b4[_0x22f8('0x1c')]?_0x2296b4['options'][_0x22f8('0x1e')]||null:null,'attributes':_0x2296b4[_0x22f8('0x1c')]?_0x2296b4[_0x22f8('0x1c')][_0x22f8('0x22')]||null:null,'include':_0x2296b4[_0x22f8('0x1c')]?_0x2296b4[_0x22f8('0x1c')][_0x22f8('0x20')]?_[_0x22f8('0x23')](_0x2296b4['options']['include'],function(_0x531953){return{'model':db[_0x531953[_0x22f8('0x21')]],'as':_0x531953['as'],'attributes':_0x531953[_0x22f8('0x22')],'include':_0x531953[_0x22f8('0x20')]?_[_0x22f8('0x23')](_0x531953[_0x22f8('0x20')],function(_0x13a5b0){return{'model':db[_0x13a5b0['model']],'as':_0x13a5b0['as'],'attributes':_0x13a5b0['attributes'],'include':_0x13a5b0[_0x22f8('0x20')]?_['map'](_0x13a5b0[_0x22f8('0x20')],function(_0x3399bd){return{'model':db[_0x3399bd[_0x22f8('0x21')]],'as':_0x3399bd['as'],'attributes':_0x3399bd[_0x22f8('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x418bb1){logger[_0x22f8('0xf')](_0x22f8('0x24'),_0x2296b4);logger[_0x22f8('0x12')](_0x22f8('0x24'),_0x2296b4,JSON[_0x22f8('0x14')](_0x418bb1));_0x2aa606(_0x418bb1);})['catch'](function(_0x2f5b98){logger[_0x22f8('0x15')](_0x22f8('0x24'),_0x2f5b98[_0x22f8('0x17')],_0x2296b4);_0x38cb22(_0x4530cd[_0x22f8('0x15')](0x1f4,_0x2f5b98[_0x22f8('0x17')]));});});};
\ No newline at end of file
index 236b91e..60a251d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9985=['emit','removeListener','register','length','./whatsappQueue.events','save','remove','update'];(function(_0xee5d2a,_0x534134){var _0x346948=function(_0x458fdf){while(--_0x458fdf){_0xee5d2a['push'](_0xee5d2a['shift']());}};_0x346948(++_0x534134);}(_0x9985,0x13c));var _0x5998=function(_0x19dac3,_0x179387){_0x19dac3=_0x19dac3-0x0;var _0x3be408=_0x9985[_0x19dac3];return _0x3be408;};'use strict';var WhatsappQueueEvents=require(_0x5998('0x0'));var events=[_0x5998('0x1'),_0x5998('0x2'),_0x5998('0x3')];function createListener(_0x489367,_0x360e4a){return function(_0x465be1){_0x360e4a[_0x5998('0x4')](_0x489367,_0x465be1);};}function removeListener(_0x456003,_0x13acff){return function(){WhatsappQueueEvents[_0x5998('0x5')](_0x456003,_0x13acff);};}exports[_0x5998('0x6')]=function(_0x463ba5){for(var _0x387ac2=0x0,_0x2994ed=events[_0x5998('0x7')];_0x387ac2<_0x2994ed;_0x387ac2++){var _0x5f0826=events[_0x387ac2];var _0x9d160f=createListener('whatsappQueue:'+_0x5f0826,_0x463ba5);WhatsappQueueEvents['on'](_0x5f0826,_0x9d160f);}};
\ No newline at end of file
+var _0xb98a=['whatsappQueue:','./whatsappQueue.events','save','remove','update','removeListener','length'];(function(_0xe813c6,_0x36fe00){var _0x46a109=function(_0x324c2c){while(--_0x324c2c){_0xe813c6['push'](_0xe813c6['shift']());}};_0x46a109(++_0x36fe00);}(_0xb98a,0xe8));var _0xab98=function(_0x5edd05,_0x8ac1d3){_0x5edd05=_0x5edd05-0x0;var _0x19b62e=_0xb98a[_0x5edd05];return _0x19b62e;};'use strict';var WhatsappQueueEvents=require(_0xab98('0x0'));var events=[_0xab98('0x1'),_0xab98('0x2'),_0xab98('0x3')];function createListener(_0xd9df3e,_0x2106a5){return function(_0x2f7eb6){_0x2106a5['emit'](_0xd9df3e,_0x2f7eb6);};}function removeListener(_0x3adacd,_0x33cc7b){return function(){WhatsappQueueEvents[_0xab98('0x4')](_0x3adacd,_0x33cc7b);};}exports['register']=function(_0x39e4a6){for(var _0x88493a=0x0,_0x577d02=events[_0xab98('0x5')];_0x88493a<_0x577d02;_0x88493a++){var _0x195909=events[_0x88493a];var _0x3165f4=createListener(_0xab98('0x6')+_0x195909,_0x39e4a6);WhatsappQueueEvents['on'](_0x195909,_0x3165f4);}};
\ No newline at end of file
index 5f9cd16..9f486e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb19=['/:id','show','post','create','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x2ae076,_0x3edab3){var _0xa4da77=function(_0x23caf1){while(--_0x23caf1){_0x2ae076['push'](_0x2ae076['shift']());}};_0xa4da77(++_0x3edab3);}(_0xcb19,0x120));var _0x9cb1=function(_0x44f6e9,_0x3346be){_0x44f6e9=_0x44f6e9-0x0;var _0x2e989c=_0xcb19[_0x44f6e9];return _0x2e989c;};'use strict';var multer=require('multer');var util=require(_0x9cb1('0x0'));var path=require(_0x9cb1('0x1'));var timeout=require(_0x9cb1('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9cb1('0x3'));var auth=require(_0x9cb1('0x4'));var interaction=require(_0x9cb1('0x5'));var config=require(_0x9cb1('0x6'));var controller=require('./whatsappQueueReport.controller');router[_0x9cb1('0x7')]('/',auth[_0x9cb1('0x8')](),controller[_0x9cb1('0x9')]);router['get'](_0x9cb1('0xa'),auth[_0x9cb1('0x8')](),controller[_0x9cb1('0xb')]);router[_0x9cb1('0x7')](_0x9cb1('0xc'),auth[_0x9cb1('0x8')](),controller[_0x9cb1('0xd')]);router[_0x9cb1('0xe')]('/',auth[_0x9cb1('0x8')](),controller[_0x9cb1('0xf')]);router['put'](_0x9cb1('0xc'),auth[_0x9cb1('0x8')](),controller[_0x9cb1('0x10')]);router[_0x9cb1('0x11')](_0x9cb1('0xc'),auth[_0x9cb1('0x8')](),controller[_0x9cb1('0x12')]);module[_0x9cb1('0x13')]=router;
\ No newline at end of file
+var _0x7b6c=['../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','put','update','delete','destroy','path','connect-timeout','Router','../../components/auth/service'];(function(_0x1f48e5,_0x451e6e){var _0x342f42=function(_0x520482){while(--_0x520482){_0x1f48e5['push'](_0x1f48e5['shift']());}};_0x342f42(++_0x451e6e);}(_0x7b6c,0x81));var _0xc7b6=function(_0x2decf0,_0x57c3b2){_0x2decf0=_0x2decf0-0x0;var _0x4874d3=_0x7b6c[_0x2decf0];return _0x4874d3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc7b6('0x0'));var timeout=require(_0xc7b6('0x1'));var express=require('express');var router=express[_0xc7b6('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xc7b6('0x3'));var interaction=require(_0xc7b6('0x4'));var config=require(_0xc7b6('0x5'));var controller=require(_0xc7b6('0x6'));router[_0xc7b6('0x7')]('/',auth['isAuthenticated'](),controller[_0xc7b6('0x8')]);router[_0xc7b6('0x7')](_0xc7b6('0x9'),auth[_0xc7b6('0xa')](),controller[_0xc7b6('0xb')]);router[_0xc7b6('0x7')](_0xc7b6('0xc'),auth[_0xc7b6('0xa')](),controller[_0xc7b6('0xd')]);router[_0xc7b6('0xe')]('/',auth[_0xc7b6('0xa')](),controller['create']);router[_0xc7b6('0xf')](_0xc7b6('0xc'),auth[_0xc7b6('0xa')](),controller[_0xc7b6('0x10')]);router[_0xc7b6('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xc7b6('0x12')]);module['exports']=router;
\ No newline at end of file
index 7ce65f8..547ee08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x196e28,_0x50e608){var _0x2d8845=function(_0x43f12b){while(--_0x43f12b){_0x196e28['push'](_0x196e28['shift']());}};_0x2d8845(++_0x50e608);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}};
\ No newline at end of file
+var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x394f41,_0x3f3717){var _0xc18e7b=function(_0x16142d){while(--_0x16142d){_0x394f41['push'](_0x394f41['shift']());}};_0xc18e7b(++_0x3f3717);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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 ac264c3..073ed8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ec6=['api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','WhatsappQueueReport','rawAttributes','key','keys','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0xee7f02,_0x1628f7){var _0x553b36=function(_0x282c65){while(--_0x282c65){_0xee7f02['push'](_0xee7f02['shift']());}};_0x553b36(++_0x1628f7);}(_0x5ec6,0x7f));var _0x65ec=function(_0x39cc19,_0x5f3c74){_0x39cc19=_0x39cc19-0x0;var _0x420d0d=_0x5ec6[_0x39cc19];return _0x420d0d;};'use strict';var emlformat=require(_0x65ec('0x0'));var rimraf=require(_0x65ec('0x1'));var zipdir=require(_0x65ec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x65ec('0x3'));var moment=require('moment');var BPromise=require(_0x65ec('0x4'));var Mustache=require('mustache');var util=require(_0x65ec('0x5'));var path=require('path');var sox=require(_0x65ec('0x6'));var csv=require('to-csv');var ejs=require(_0x65ec('0x7'));var fs=require('fs');var fs_extra=require(_0x65ec('0x8'));var _=require('lodash');var squel=require(_0x65ec('0x9'));var crypto=require(_0x65ec('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x65ec('0xb'));var toCsv=require(_0x65ec('0xc'));var querystring=require(_0x65ec('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65ec('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x65ec('0xf'));var hardwareService=require(_0x65ec('0x10'));var logger=require('../../config/logger')(_0x65ec('0x11'));var utils=require(_0x65ec('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x65ec('0x13'));var db=require(_0x65ec('0x14'))['db'];function respondWithStatusCode(_0x53d62b,_0x3e52c8){_0x3e52c8=_0x3e52c8||0xcc;return function(_0x2af7d6){if(_0x2af7d6){return _0x53d62b[_0x65ec('0x15')](_0x3e52c8);}return _0x53d62b[_0x65ec('0x16')](_0x3e52c8)[_0x65ec('0x17')]();};}function respondWithResult(_0x434e20,_0x344724){_0x344724=_0x344724||0xc8;return function(_0x3edbfd){if(_0x3edbfd){return _0x434e20['status'](_0x344724)[_0x65ec('0x18')](_0x3edbfd);}};}function respondWithFilteredResult(_0x3ed6f7,_0x35d06b){return function(_0x4bbe88){if(_0x4bbe88){var _0x5a0442=typeof _0x35d06b[_0x65ec('0x19')]===_0x65ec('0x1a')&&typeof _0x35d06b[_0x65ec('0x1b')]==='undefined';var _0x25dae7=_0x4bbe88[_0x65ec('0x1c')];var _0x1254f8=_0x5a0442?0x0:_0x35d06b[_0x65ec('0x19')];var _0x29ebc4=_0x5a0442?_0x4bbe88[_0x65ec('0x1c')]:_0x35d06b[_0x65ec('0x19')]+_0x35d06b[_0x65ec('0x1b')];var _0x2127e2;if(_0x29ebc4>=_0x25dae7){_0x29ebc4=_0x25dae7;_0x2127e2=0xc8;}else{_0x2127e2=0xce;}_0x3ed6f7[_0x65ec('0x16')](_0x2127e2);return _0x3ed6f7[_0x65ec('0x1d')](_0x65ec('0x1e'),_0x1254f8+'-'+_0x29ebc4+'/'+_0x25dae7)[_0x65ec('0x18')](_0x4bbe88);}return null;};}function patchUpdates(_0x1467ac){return function(_0x3804a4){try{jsonpatch[_0x65ec('0x1f')](_0x3804a4,_0x1467ac,!![]);}catch(_0x15d4eb){return BPromise[_0x65ec('0x20')](_0x15d4eb);}return _0x3804a4[_0x65ec('0x21')]();};}function saveUpdates(_0x4ff93c,_0x170703){return function(_0x297fba){if(_0x297fba){return _0x297fba[_0x65ec('0x22')](_0x4ff93c)[_0x65ec('0x23')](function(_0x1d60fb){return _0x1d60fb;});}return null;};}function removeEntity(_0x163e55,_0x47288d){return function(_0x58239f){if(_0x58239f){return _0x58239f[_0x65ec('0x24')]()[_0x65ec('0x23')](function(){_0x163e55[_0x65ec('0x16')](0xcc)[_0x65ec('0x17')]();});}};}function handleEntityNotFound(_0x288e66,_0x156793){return function(_0x21426b){if(!_0x21426b){_0x288e66[_0x65ec('0x15')](0x194);}return _0x21426b;};}function handleError(_0x297e09,_0x4c846b){_0x4c846b=_0x4c846b||0x1f4;return function(_0x10baef){logger[_0x65ec('0x25')](_0x10baef[_0x65ec('0x26')]);if(_0x10baef[_0x65ec('0x27')]){delete _0x10baef['name'];}_0x297e09[_0x65ec('0x16')](_0x4c846b)['send'](_0x10baef);};}exports[_0x65ec('0x28')]=function(_0x1ada47,_0x1d0b5c){var _0x30366c={},_0x14431d={},_0x46d4c1={'count':0x0,'rows':[]};var _0x46bf66=_[_0x65ec('0x29')](db[_0x65ec('0x2a')][_0x65ec('0x2b')],function(_0x3c97e2){return{'name':_0x3c97e2['fieldName'],'type':_0x3c97e2['type'][_0x65ec('0x2c')]};});_0x14431d['model']=_[_0x65ec('0x29')](_0x46bf66,_0x65ec('0x27'));_0x14431d['query']=_[_0x65ec('0x2d')](_0x1ada47[_0x65ec('0x2e')]);_0x14431d[_0x65ec('0x2f')]=_[_0x65ec('0x30')](_0x14431d['model'],_0x14431d[_0x65ec('0x2e')]);_0x30366c[_0x65ec('0x31')]=_[_0x65ec('0x30')](_0x14431d[_0x65ec('0x32')],qs[_0x65ec('0x33')](_0x1ada47[_0x65ec('0x2e')][_0x65ec('0x33')]));_0x30366c[_0x65ec('0x31')]=_0x30366c[_0x65ec('0x31')][_0x65ec('0x34')]?_0x30366c['attributes']:_0x14431d[_0x65ec('0x32')];if(!_0x1ada47[_0x65ec('0x2e')]['hasOwnProperty'](_0x65ec('0x35'))){_0x30366c[_0x65ec('0x1b')]=qs[_0x65ec('0x1b')](_0x1ada47[_0x65ec('0x2e')][_0x65ec('0x1b')]);_0x30366c[_0x65ec('0x19')]=qs[_0x65ec('0x19')](_0x1ada47['query'][_0x65ec('0x19')]);}_0x30366c[_0x65ec('0x36')]=qs[_0x65ec('0x37')](_0x1ada47[_0x65ec('0x2e')]['sort']);_0x30366c[_0x65ec('0x38')]=qs[_0x65ec('0x2f')](_[_0x65ec('0x39')](_0x1ada47[_0x65ec('0x2e')],_0x14431d['filters']),_0x46bf66);if(_0x1ada47['query'][_0x65ec('0x3a')]){_0x30366c['where']=_[_0x65ec('0x3b')](_0x30366c[_0x65ec('0x38')],{'$or':_['map'](_0x46bf66,function(_0x16ef59){if(_0x16ef59[_0x65ec('0x3c')]!==_0x65ec('0x3d')){var _0x5357bf={};_0x5357bf[_0x16ef59[_0x65ec('0x27')]]={'$like':'%'+_0x1ada47[_0x65ec('0x2e')][_0x65ec('0x3a')]+'%'};return _0x5357bf;}})});}_0x30366c=_[_0x65ec('0x3b')]({},_0x30366c,_0x1ada47[_0x65ec('0x3e')]);var _0x2ce56f={'where':_0x30366c[_0x65ec('0x38')]};return db['WhatsappQueueReport'][_0x65ec('0x1c')](_0x2ce56f)['then'](function(_0x2654b2){_0x46d4c1[_0x65ec('0x1c')]=_0x2654b2;if(_0x1ada47[_0x65ec('0x2e')][_0x65ec('0x3f')]){_0x30366c[_0x65ec('0x40')]=[{'all':!![]}];}return db[_0x65ec('0x2a')]['findAll'](_0x30366c);})[_0x65ec('0x23')](function(_0x4ba7df){_0x46d4c1['rows']=_0x4ba7df;return _0x46d4c1;})[_0x65ec('0x23')](respondWithFilteredResult(_0x1d0b5c,_0x30366c))[_0x65ec('0x41')](handleError(_0x1d0b5c,null));};exports[_0x65ec('0x42')]=function(_0x143a11,_0x1d475e){var _0x524235={'raw':!![],'where':{'id':_0x143a11[_0x65ec('0x43')]['id']}},_0x4843ca={};_0x4843ca[_0x65ec('0x32')]=_[_0x65ec('0x2d')](db[_0x65ec('0x2a')][_0x65ec('0x2b')]);_0x4843ca['query']=_['keys'](_0x143a11[_0x65ec('0x2e')]);_0x4843ca[_0x65ec('0x2f')]=_[_0x65ec('0x30')](_0x4843ca[_0x65ec('0x32')],_0x4843ca[_0x65ec('0x2e')]);_0x524235[_0x65ec('0x31')]=_[_0x65ec('0x30')](_0x4843ca['model'],qs[_0x65ec('0x33')](_0x143a11[_0x65ec('0x2e')][_0x65ec('0x33')]));_0x524235['attributes']=_0x524235[_0x65ec('0x31')][_0x65ec('0x34')]?_0x524235['attributes']:_0x4843ca[_0x65ec('0x32')];if(_0x143a11[_0x65ec('0x2e')][_0x65ec('0x3f')]){_0x524235[_0x65ec('0x40')]=[{'all':!![]}];}_0x524235=_[_0x65ec('0x3b')]({},_0x524235,_0x143a11['options']);return db[_0x65ec('0x2a')][_0x65ec('0x44')](_0x524235)[_0x65ec('0x23')](handleEntityNotFound(_0x1d475e,null))[_0x65ec('0x23')](respondWithResult(_0x1d475e,null))['catch'](handleError(_0x1d475e,null));};exports[_0x65ec('0x45')]=function(_0x509c28,_0x1ed0f9){return db[_0x65ec('0x2a')][_0x65ec('0x45')](_0x509c28['body'],{})['then'](respondWithResult(_0x1ed0f9,0xc9))[_0x65ec('0x41')](handleError(_0x1ed0f9,null));};exports[_0x65ec('0x22')]=function(_0xf5419,_0x2111af){if(_0xf5419[_0x65ec('0x46')]['id']){delete _0xf5419[_0x65ec('0x46')]['id'];}return db[_0x65ec('0x2a')][_0x65ec('0x44')]({'where':{'id':_0xf5419[_0x65ec('0x43')]['id']}})[_0x65ec('0x23')](handleEntityNotFound(_0x2111af,null))[_0x65ec('0x23')](saveUpdates(_0xf5419[_0x65ec('0x46')],null))[_0x65ec('0x23')](respondWithResult(_0x2111af,null))[_0x65ec('0x41')](handleError(_0x2111af,null));};exports[_0x65ec('0x24')]=function(_0x14eaef,_0x22c28c){return db['WhatsappQueueReport'][_0x65ec('0x44')]({'where':{'id':_0x14eaef[_0x65ec('0x43')]['id']}})['then'](handleEntityNotFound(_0x22c28c,null))[_0x65ec('0x23')](removeEntity(_0x22c28c,null))[_0x65ec('0x41')](handleError(_0x22c28c,null));};exports[_0x65ec('0x47')]=function(_0x528cfa,_0x3eee1e){return db[_0x65ec('0x2a')][_0x65ec('0x47')]()['then'](respondWithResult(_0x3eee1e,null))[_0x65ec('0x41')](handleError(_0x3eee1e,null));};
\ No newline at end of file
+var _0x02ce=['then','destroy','error','name','index','map','WhatsappQueueReport','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','findAll','rows','catch','show','keys','includeAll','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','count','limit','status','Content-Range','apply','reject','save','update'];(function(_0x17db5d,_0x513d0e){var _0x3581d9=function(_0x16ab68){while(--_0x16ab68){_0x17db5d['push'](_0x17db5d['shift']());}};_0x3581d9(++_0x513d0e);}(_0x02ce,0x1ac));var _0xe02c=function(_0x25aef2,_0x56c90a){_0x25aef2=_0x25aef2-0x0;var _0x366b32=_0x02ce[_0x25aef2];return _0x366b32;};'use strict';var emlformat=require(_0xe02c('0x0'));var rimraf=require(_0xe02c('0x1'));var zipdir=require(_0xe02c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe02c('0x3'));var moment=require('moment');var BPromise=require(_0xe02c('0x4'));var Mustache=require(_0xe02c('0x5'));var util=require(_0xe02c('0x6'));var path=require(_0xe02c('0x7'));var sox=require(_0xe02c('0x8'));var csv=require(_0xe02c('0x9'));var ejs=require(_0xe02c('0xa'));var fs=require('fs');var fs_extra=require(_0xe02c('0xb'));var _=require(_0xe02c('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe02c('0xd'));var deskjs=require(_0xe02c('0xe'));var toCsv=require(_0xe02c('0x9'));var querystring=require(_0xe02c('0xf'));var Papa=require(_0xe02c('0x10'));var Redis=require(_0xe02c('0x11'));var authService=require(_0xe02c('0x12'));var qs=require(_0xe02c('0x13'));var as=require(_0xe02c('0x14'));var hardwareService=require(_0xe02c('0x15'));var logger=require(_0xe02c('0x16'))(_0xe02c('0x17'));var utils=require(_0xe02c('0x18'));var config=require(_0xe02c('0x19'));var licenseUtil=require(_0xe02c('0x1a'));var db=require(_0xe02c('0x1b'))['db'];function respondWithStatusCode(_0x23d886,_0x32fc45){_0x32fc45=_0x32fc45||0xcc;return function(_0x5d6d13){if(_0x5d6d13){return _0x23d886[_0xe02c('0x1c')](_0x32fc45);}return _0x23d886['status'](_0x32fc45)['end']();};}function respondWithResult(_0x3f4e28,_0x56405a){_0x56405a=_0x56405a||0xc8;return function(_0x221910){if(_0x221910){return _0x3f4e28['status'](_0x56405a)[_0xe02c('0x1d')](_0x221910);}};}function respondWithFilteredResult(_0x4e9c6d,_0x256311){return function(_0x366893){if(_0x366893){var _0x59f2f6=typeof _0x256311[_0xe02c('0x1e')]===_0xe02c('0x1f')&&typeof _0x256311['limit']===_0xe02c('0x1f');var _0x20f492=_0x366893['count'];var _0x52917f=_0x59f2f6?0x0:_0x256311[_0xe02c('0x1e')];var _0x49604a=_0x59f2f6?_0x366893[_0xe02c('0x20')]:_0x256311[_0xe02c('0x1e')]+_0x256311[_0xe02c('0x21')];var _0x36fed0;if(_0x49604a>=_0x20f492){_0x49604a=_0x20f492;_0x36fed0=0xc8;}else{_0x36fed0=0xce;}_0x4e9c6d[_0xe02c('0x22')](_0x36fed0);return _0x4e9c6d['set'](_0xe02c('0x23'),_0x52917f+'-'+_0x49604a+'/'+_0x20f492)['json'](_0x366893);}return null;};}function patchUpdates(_0x4ea9b5){return function(_0x393621){try{jsonpatch[_0xe02c('0x24')](_0x393621,_0x4ea9b5,!![]);}catch(_0x480b9a){return BPromise[_0xe02c('0x25')](_0x480b9a);}return _0x393621[_0xe02c('0x26')]();};}function saveUpdates(_0x4ce5ee,_0x38dce2){return function(_0x45fd82){if(_0x45fd82){return _0x45fd82[_0xe02c('0x27')](_0x4ce5ee)[_0xe02c('0x28')](function(_0x2d44c8){return _0x2d44c8;});}return null;};}function removeEntity(_0x557142,_0x3e80e3){return function(_0xf41d4c){if(_0xf41d4c){return _0xf41d4c[_0xe02c('0x29')]()[_0xe02c('0x28')](function(){_0x557142[_0xe02c('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0xefd882,_0x4411d8){return function(_0x3592ca){if(!_0x3592ca){_0xefd882[_0xe02c('0x1c')](0x194);}return _0x3592ca;};}function handleError(_0x16dfa3,_0x303d24){_0x303d24=_0x303d24||0x1f4;return function(_0x43dc78){logger[_0xe02c('0x2a')](_0x43dc78['stack']);if(_0x43dc78[_0xe02c('0x2b')]){delete _0x43dc78[_0xe02c('0x2b')];}_0x16dfa3[_0xe02c('0x22')](_0x303d24)['send'](_0x43dc78);};}exports[_0xe02c('0x2c')]=function(_0x2d1d98,_0x445421){var _0x287f7e={},_0x1e7eab={},_0x35a309={'count':0x0,'rows':[]};var _0x22a285=_[_0xe02c('0x2d')](db[_0xe02c('0x2e')][_0xe02c('0x2f')],function(_0x17d5b3){return{'name':_0x17d5b3['fieldName'],'type':_0x17d5b3[_0xe02c('0x30')][_0xe02c('0x31')]};});_0x1e7eab[_0xe02c('0x32')]=_[_0xe02c('0x2d')](_0x22a285,_0xe02c('0x2b'));_0x1e7eab[_0xe02c('0x33')]=_['keys'](_0x2d1d98[_0xe02c('0x33')]);_0x1e7eab[_0xe02c('0x34')]=_['intersection'](_0x1e7eab[_0xe02c('0x32')],_0x1e7eab[_0xe02c('0x33')]);_0x287f7e[_0xe02c('0x35')]=_[_0xe02c('0x36')](_0x1e7eab[_0xe02c('0x32')],qs['fields'](_0x2d1d98['query'][_0xe02c('0x37')]));_0x287f7e[_0xe02c('0x35')]=_0x287f7e['attributes'][_0xe02c('0x38')]?_0x287f7e['attributes']:_0x1e7eab[_0xe02c('0x32')];if(!_0x2d1d98[_0xe02c('0x33')][_0xe02c('0x39')](_0xe02c('0x3a'))){_0x287f7e[_0xe02c('0x21')]=qs['limit'](_0x2d1d98[_0xe02c('0x33')]['limit']);_0x287f7e[_0xe02c('0x1e')]=qs[_0xe02c('0x1e')](_0x2d1d98[_0xe02c('0x33')][_0xe02c('0x1e')]);}_0x287f7e[_0xe02c('0x3b')]=qs[_0xe02c('0x3c')](_0x2d1d98['query'][_0xe02c('0x3c')]);_0x287f7e[_0xe02c('0x3d')]=qs['filters'](_[_0xe02c('0x3e')](_0x2d1d98[_0xe02c('0x33')],_0x1e7eab['filters']),_0x22a285);if(_0x2d1d98[_0xe02c('0x33')]['filter']){_0x287f7e[_0xe02c('0x3d')]=_[_0xe02c('0x3f')](_0x287f7e['where'],{'$or':_[_0xe02c('0x2d')](_0x22a285,function(_0x1eeddb){if(_0x1eeddb[_0xe02c('0x30')]!==_0xe02c('0x40')){var _0x3c4a65={};_0x3c4a65[_0x1eeddb[_0xe02c('0x2b')]]={'$like':'%'+_0x2d1d98['query'][_0xe02c('0x41')]+'%'};return _0x3c4a65;}})});}_0x287f7e=_['merge']({},_0x287f7e,_0x2d1d98['options']);var _0x3db057={'where':_0x287f7e[_0xe02c('0x3d')]};return db[_0xe02c('0x2e')][_0xe02c('0x20')](_0x3db057)['then'](function(_0x37e4fe){_0x35a309[_0xe02c('0x20')]=_0x37e4fe;if(_0x2d1d98[_0xe02c('0x33')]['includeAll']){_0x287f7e['include']=[{'all':!![]}];}return db[_0xe02c('0x2e')][_0xe02c('0x42')](_0x287f7e);})[_0xe02c('0x28')](function(_0x2313d2){_0x35a309[_0xe02c('0x43')]=_0x2313d2;return _0x35a309;})[_0xe02c('0x28')](respondWithFilteredResult(_0x445421,_0x287f7e))[_0xe02c('0x44')](handleError(_0x445421,null));};exports[_0xe02c('0x45')]=function(_0x21d66e,_0x53d123){var _0xc7e935={'raw':!![],'where':{'id':_0x21d66e['params']['id']}},_0x5ef4a1={};_0x5ef4a1[_0xe02c('0x32')]=_[_0xe02c('0x46')](db[_0xe02c('0x2e')][_0xe02c('0x2f')]);_0x5ef4a1[_0xe02c('0x33')]=_[_0xe02c('0x46')](_0x21d66e[_0xe02c('0x33')]);_0x5ef4a1[_0xe02c('0x34')]=_['intersection'](_0x5ef4a1['model'],_0x5ef4a1[_0xe02c('0x33')]);_0xc7e935[_0xe02c('0x35')]=_[_0xe02c('0x36')](_0x5ef4a1['model'],qs[_0xe02c('0x37')](_0x21d66e[_0xe02c('0x33')][_0xe02c('0x37')]));_0xc7e935[_0xe02c('0x35')]=_0xc7e935[_0xe02c('0x35')][_0xe02c('0x38')]?_0xc7e935[_0xe02c('0x35')]:_0x5ef4a1[_0xe02c('0x32')];if(_0x21d66e[_0xe02c('0x33')][_0xe02c('0x47')]){_0xc7e935['include']=[{'all':!![]}];}_0xc7e935=_[_0xe02c('0x3f')]({},_0xc7e935,_0x21d66e[_0xe02c('0x48')]);return db[_0xe02c('0x2e')][_0xe02c('0x49')](_0xc7e935)[_0xe02c('0x28')](handleEntityNotFound(_0x53d123,null))[_0xe02c('0x28')](respondWithResult(_0x53d123,null))[_0xe02c('0x44')](handleError(_0x53d123,null));};exports[_0xe02c('0x4a')]=function(_0x30dc90,_0x1176c9){return db[_0xe02c('0x2e')][_0xe02c('0x4a')](_0x30dc90[_0xe02c('0x4b')],{})['then'](respondWithResult(_0x1176c9,0xc9))[_0xe02c('0x44')](handleError(_0x1176c9,null));};exports['update']=function(_0x15b05c,_0x324911){if(_0x15b05c[_0xe02c('0x4b')]['id']){delete _0x15b05c[_0xe02c('0x4b')]['id'];}return db[_0xe02c('0x2e')][_0xe02c('0x49')]({'where':{'id':_0x15b05c[_0xe02c('0x4c')]['id']}})[_0xe02c('0x28')](handleEntityNotFound(_0x324911,null))[_0xe02c('0x28')](saveUpdates(_0x15b05c[_0xe02c('0x4b')],null))['then'](respondWithResult(_0x324911,null))[_0xe02c('0x44')](handleError(_0x324911,null));};exports[_0xe02c('0x29')]=function(_0xeb4214,_0x536cf7){return db[_0xe02c('0x2e')]['find']({'where':{'id':_0xeb4214[_0xe02c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x536cf7,null))['then'](removeEntity(_0x536cf7,null))['catch'](handleError(_0x536cf7,null));};exports['describe']=function(_0x51d540,_0x5740df){return db[_0xe02c('0x2e')][_0xe02c('0x4d')]()[_0xe02c('0x28')](respondWithResult(_0x5740df,null))[_0xe02c('0x44')](handleError(_0x5740df,null));};
\ No newline at end of file
index 3f11625..1e9d288 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c69=['bluebird','request-promise','path','rimraf','./whatsappQueueReport.attributes','define','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x340034,_0x26ddbd){var _0x4ec3a6=function(_0x595dac){while(--_0x595dac){_0x340034['push'](_0x340034['shift']());}};_0x4ec3a6(++_0x26ddbd);}(_0x6c69,0xc2));var _0x96c6=function(_0x110f07,_0x523a8d){_0x110f07=_0x110f07-0x0;var _0x390dec=_0x6c69[_0x110f07];return _0x390dec;};'use strict';var _=require(_0x96c6('0x0'));var util=require('util');var logger=require(_0x96c6('0x1'))(_0x96c6('0x2'));var moment=require(_0x96c6('0x3'));var BPromise=require(_0x96c6('0x4'));var rp=require(_0x96c6('0x5'));var fs=require('fs');var path=require(_0x96c6('0x6'));var rimraf=require(_0x96c6('0x7'));var config=require('../../config/environment');var attributes=require(_0x96c6('0x8'));module['exports']=function(_0x3569cf,_0x19c8a8){return _0x3569cf[_0x96c6('0x9')]('WhatsappQueueReport',attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x96c6('0xa'),'fields':[_0x96c6('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5f9a=['uniqueid','util','api','moment','bluebird','rimraf','define','WhatsappQueueReport'];(function(_0x2bfd54,_0x50ab56){var _0x711287=function(_0xed54a6){while(--_0xed54a6){_0x2bfd54['push'](_0x2bfd54['shift']());}};_0x711287(++_0x50ab56);}(_0x5f9a,0x171));var _0xa5f9=function(_0x482825,_0x2f0616){_0x482825=_0x482825-0x0;var _0x3b7a70=_0x5f9a[_0x482825];return _0x3b7a70;};'use strict';var _=require('lodash');var util=require(_0xa5f9('0x0'));var logger=require('../../config/logger')(_0xa5f9('0x1'));var moment=require(_0xa5f9('0x2'));var BPromise=require(_0xa5f9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa5f9('0x4'));var config=require('../../config/environment');var attributes=require('./whatsappQueueReport.attributes');module['exports']=function(_0x1ab0ba,_0x1946ef){return _0x1ab0ba[_0xa5f9('0x5')](_0xa5f9('0x6'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0xa5f9('0x7'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 21de23d..051949b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a35=['rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','CreateWhatsappQueueReport','WhatsappQueueReport','create','options','raw','stringify','catch','update','where','attributes','limit','then','UpdateWhatsappQueueReport','lodash','util','bluebird','randomstring'];(function(_0x543579,_0x5a7d62){var _0x545e2a=function(_0x39fa09){while(--_0x39fa09){_0x543579['push'](_0x543579['shift']());}};_0x545e2a(++_0x5a7d62);}(_0x4a35,0x1a0));var _0x54a3=function(_0x12a764,_0x1dca95){_0x12a764=_0x12a764-0x0;var _0x4c6beb=_0x4a35[_0x12a764];return _0x4c6beb;};'use strict';var _=require(_0x54a3('0x0'));var util=require(_0x54a3('0x1'));var moment=require('moment');var BPromise=require(_0x54a3('0x2'));var rs=require(_0x54a3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x54a3('0x4'));var config=require(_0x54a3('0x5'));var jayson=require(_0x54a3('0x6'));var client=jayson['client'][_0x54a3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xd909e,_0x42d522,_0x114e09){return new BPromise(function(_0x3cf9e1,_0x226d8b){return client[_0x54a3('0x8')](_0xd909e,_0x114e09)['then'](function(_0x1709d0){logger[_0x54a3('0x9')]('WhatsappQueueReport,\x20%s,\x20%s',_0x42d522,_0x54a3('0xa'));logger[_0x54a3('0xb')](_0x54a3('0xc'),_0x42d522,_0x54a3('0xa'),JSON['stringify'](_0x1709d0));if(_0x1709d0[_0x54a3('0xd')]){if(_0x1709d0['error'][_0x54a3('0xe')]===0x1f4){logger['error'](_0x54a3('0xf'),_0x42d522,_0x1709d0[_0x54a3('0xd')][_0x54a3('0x10')]);return _0x226d8b(_0x1709d0[_0x54a3('0xd')][_0x54a3('0x10')]);}logger[_0x54a3('0xd')](_0x54a3('0xf'),_0x42d522,_0x1709d0[_0x54a3('0xd')][_0x54a3('0x10')]);return _0x3cf9e1(_0x1709d0[_0x54a3('0xd')][_0x54a3('0x10')]);}else{logger[_0x54a3('0x9')](_0x54a3('0xf'),_0x42d522,_0x54a3('0xa'));_0x3cf9e1(_0x1709d0['result'][_0x54a3('0x10')]);}})['catch'](function(_0x3de005){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x42d522,_0x3de005);_0x226d8b(_0x3de005);});});}exports[_0x54a3('0x11')]=function(_0x33824f){var _0x3582a0=this;return new Promise(function(_0x48aa6a,_0x3c100c){return db[_0x54a3('0x12')][_0x54a3('0x13')](_0x33824f['body'],{'raw':_0x33824f[_0x54a3('0x14')]?_0x33824f[_0x54a3('0x14')][_0x54a3('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x45f1e6){logger[_0x54a3('0x9')](_0x54a3('0x11'),_0x33824f);logger[_0x54a3('0xb')](_0x54a3('0x11'),_0x33824f,JSON[_0x54a3('0x16')](_0x45f1e6));_0x48aa6a(_0x45f1e6);})[_0x54a3('0x17')](function(_0x3ae4b2){logger['error']('CreateWhatsappQueueReport',_0x3ae4b2[_0x54a3('0x10')],_0x33824f);_0x3c100c(_0x3582a0[_0x54a3('0xd')](0x1f4,_0x3ae4b2['message']));});});};exports['UpdateWhatsappQueueReport']=function(_0xd2ecef){var _0xbfbb33=this;return new Promise(function(_0x25daff,_0x488a3a){return db[_0x54a3('0x12')][_0x54a3('0x18')](_0xd2ecef['body'],{'raw':_0xd2ecef[_0x54a3('0x14')]?_0xd2ecef[_0x54a3('0x14')][_0x54a3('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd2ecef[_0x54a3('0x14')]?_0xd2ecef[_0x54a3('0x14')][_0x54a3('0x19')]||null:null,'attributes':_0xd2ecef[_0x54a3('0x14')]?_0xd2ecef[_0x54a3('0x14')][_0x54a3('0x1a')]||null:null,'limit':_0xd2ecef['options']?_0xd2ecef[_0x54a3('0x14')][_0x54a3('0x1b')]||null:null})[_0x54a3('0x1c')](function(_0x2c5d38){logger[_0x54a3('0x9')]('UpdateWhatsappQueueReport',_0xd2ecef);logger[_0x54a3('0xb')](_0x54a3('0x1d'),_0xd2ecef,JSON['stringify'](_0x2c5d38));_0x25daff(_0x2c5d38);})[_0x54a3('0x17')](function(_0x490d45){logger[_0x54a3('0xd')](_0x54a3('0x1d'),_0x490d45[_0x54a3('0x10')],_0xd2ecef);_0x488a3a(_0xbfbb33[_0x54a3('0xd')](0x1f4,_0x490d45[_0x54a3('0x10')]));});});};
\ No newline at end of file
+var _0x0476=['http','request','then','info','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','WhatsappQueueReport,\x20%s,\x20%s','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','UpdateWhatsappQueueReport','update','attributes','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x7642c,_0x2ec4b0){var _0x5412fd=function(_0xffc8e3){while(--_0xffc8e3){_0x7642c['push'](_0x7642c['shift']());}};_0x5412fd(++_0x2ec4b0);}(_0x0476,0x177));var _0x6047=function(_0x845505,_0x19e5f3){_0x845505=_0x845505-0x0;var _0x2513b9=_0x0476[_0x845505];return _0x2513b9;};'use strict';var _=require(_0x6047('0x0'));var util=require('util');var moment=require(_0x6047('0x1'));var BPromise=require(_0x6047('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6047('0x3'));var db=require(_0x6047('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6047('0x5'))('rpc');var config=require(_0x6047('0x6'));var jayson=require(_0x6047('0x7'));var client=jayson[_0x6047('0x8')][_0x6047('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f03fb,_0x22377e,_0x589036){return new BPromise(function(_0x95df4,_0x2b7271){return client[_0x6047('0xa')](_0x5f03fb,_0x589036)[_0x6047('0xb')](function(_0x453cf1){logger[_0x6047('0xc')]('WhatsappQueueReport,\x20%s,\x20%s',_0x22377e,_0x6047('0xd'));logger[_0x6047('0xe')](_0x6047('0xf'),_0x22377e,_0x6047('0xd'),JSON[_0x6047('0x10')](_0x453cf1));if(_0x453cf1['error']){if(_0x453cf1['error'][_0x6047('0x11')]===0x1f4){logger[_0x6047('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x22377e,_0x453cf1[_0x6047('0x12')][_0x6047('0x13')]);return _0x2b7271(_0x453cf1[_0x6047('0x12')]['message']);}logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x22377e,_0x453cf1[_0x6047('0x12')][_0x6047('0x13')]);return _0x95df4(_0x453cf1['error']['message']);}else{logger[_0x6047('0xc')]('WhatsappQueueReport,\x20%s,\x20%s',_0x22377e,'request\x20sent');_0x95df4(_0x453cf1[_0x6047('0x14')]['message']);}})[_0x6047('0x15')](function(_0x44bc54){logger[_0x6047('0x12')](_0x6047('0x16'),_0x22377e,_0x44bc54);_0x2b7271(_0x44bc54);});});}exports[_0x6047('0x17')]=function(_0x30d23b){var _0x59dec5=this;return new Promise(function(_0x5900f5,_0x164757){return db[_0x6047('0x18')][_0x6047('0x19')](_0x30d23b[_0x6047('0x1a')],{'raw':_0x30d23b[_0x6047('0x1b')]?_0x30d23b['options']['raw']===undefined?!![]:![]:!![]})[_0x6047('0xb')](function(_0x185926){logger['info'](_0x6047('0x17'),_0x30d23b);logger[_0x6047('0xe')](_0x6047('0x17'),_0x30d23b,JSON[_0x6047('0x10')](_0x185926));_0x5900f5(_0x185926);})['catch'](function(_0x7e62c9){logger['error'](_0x6047('0x17'),_0x7e62c9['message'],_0x30d23b);_0x164757(_0x59dec5[_0x6047('0x12')](0x1f4,_0x7e62c9[_0x6047('0x13')]));});});};exports[_0x6047('0x1c')]=function(_0x4f1dae){var _0x5d4860=this;return new Promise(function(_0x49145c,_0x1fd72a){return db[_0x6047('0x18')][_0x6047('0x1d')](_0x4f1dae[_0x6047('0x1a')],{'raw':_0x4f1dae['options']?_0x4f1dae[_0x6047('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f1dae['options']?_0x4f1dae[_0x6047('0x1b')]['where']||null:null,'attributes':_0x4f1dae[_0x6047('0x1b')]?_0x4f1dae['options'][_0x6047('0x1e')]||null:null,'limit':_0x4f1dae[_0x6047('0x1b')]?_0x4f1dae[_0x6047('0x1b')][_0x6047('0x1f')]||null:null})[_0x6047('0xb')](function(_0x4d8c95){logger[_0x6047('0xc')]('UpdateWhatsappQueueReport',_0x4f1dae);logger[_0x6047('0xe')]('UpdateWhatsappQueueReport',_0x4f1dae,JSON[_0x6047('0x10')](_0x4d8c95));_0x49145c(_0x4d8c95);})[_0x6047('0x15')](function(_0x4f76de){logger[_0x6047('0x12')](_0x6047('0x1c'),_0x4f76de[_0x6047('0x13')],_0x4f1dae);_0x1fd72a(_0x5d4860['error'](0x1f4,_0x4f76de[_0x6047('0x13')]));});});};
\ No newline at end of file
index abffda6..fbcbe50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9809=['create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post'];(function(_0x46c219,_0x2ea01f){var _0x108ae1=function(_0x54b813){while(--_0x54b813){_0x46c219['push'](_0x46c219['shift']());}};_0x108ae1(++_0x2ea01f);}(_0x9809,0xf8));var _0x9980=function(_0x3e83e7,_0x188b71){_0x3e83e7=_0x3e83e7-0x0;var _0x121bde=_0x9809[_0x3e83e7];return _0x121bde;};'use strict';var multer=require(_0x9980('0x0'));var util=require('util');var path=require(_0x9980('0x1'));var timeout=require(_0x9980('0x2'));var express=require(_0x9980('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9980('0x4'));var interaction=require(_0x9980('0x5'));var config=require(_0x9980('0x6'));var controller=require(_0x9980('0x7'));router[_0x9980('0x8')]('/',auth['isAuthenticated'](),controller[_0x9980('0x9')]);router[_0x9980('0x8')](_0x9980('0xa'),auth[_0x9980('0xb')](),controller[_0x9980('0xc')]);router[_0x9980('0x8')](_0x9980('0xd'),auth[_0x9980('0xb')](),controller[_0x9980('0xe')]);router[_0x9980('0xf')]('/',auth['isAuthenticated'](),controller[_0x9980('0x10')]);router[_0x9980('0x11')](_0x9980('0xd'),auth[_0x9980('0xb')](),controller[_0x9980('0x12')]);router[_0x9980('0x13')](_0x9980('0xd'),auth['isAuthenticated'](),controller[_0x9980('0x14')]);module[_0x9980('0x15')]=router;
\ No newline at end of file
+var _0x2a9e=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','destroy','exports','path'];(function(_0x42760b,_0x4a93f3){var _0x1ca039=function(_0x4418e7){while(--_0x4418e7){_0x42760b['push'](_0x42760b['shift']());}};_0x1ca039(++_0x4a93f3);}(_0x2a9e,0xa1));var _0xe2a9=function(_0x12ca82,_0x3b3684){_0x12ca82=_0x12ca82-0x0;var _0x348a89=_0x2a9e[_0x12ca82];return _0x348a89;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe2a9('0x0'));var timeout=require(_0xe2a9('0x1'));var express=require(_0xe2a9('0x2'));var router=express['Router']();var fs_extra=require(_0xe2a9('0x3'));var auth=require(_0xe2a9('0x4'));var interaction=require(_0xe2a9('0x5'));var config=require('../../config/environment');var controller=require('./whatsappTransferReport.controller');router[_0xe2a9('0x6')]('/',auth[_0xe2a9('0x7')](),controller[_0xe2a9('0x8')]);router[_0xe2a9('0x6')](_0xe2a9('0x9'),auth[_0xe2a9('0x7')](),controller[_0xe2a9('0xa')]);router[_0xe2a9('0x6')](_0xe2a9('0xb'),auth[_0xe2a9('0x7')](),controller[_0xe2a9('0xc')]);router[_0xe2a9('0xd')]('/',auth[_0xe2a9('0x7')](),controller[_0xe2a9('0xe')]);router['put'](_0xe2a9('0xb'),auth['isAuthenticated'](),controller[_0xe2a9('0xf')]);router['delete'](_0xe2a9('0xb'),auth[_0xe2a9('0x7')](),controller[_0xe2a9('0x10')]);module[_0xe2a9('0x11')]=router;
\ No newline at end of file
index 636d48a..2bcc8c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2868=['DATE','sequelize','STRING','ENUM','agent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2868,0x191));var _0x8286=function(_0x5cc565,_0x32290b){_0x5cc565=_0x5cc565-0x0;var _0x208b97=_0x2868[_0x5cc565];return _0x208b97;};'use strict';var Sequelize=require(_0x8286('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x8286('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x8286('0x2')]('account',_0x8286('0x3'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x8286('0x4')]}};
\ No newline at end of file
+var _0x68b7=['queue','DATE','sequelize','STRING','ENUM','account'];(function(_0x4c1c1b,_0x2414aa){var _0x5c4e2d=function(_0x483447){while(--_0x483447){_0x4c1c1b['push'](_0x4c1c1b['shift']());}};_0x5c4e2d(++_0x2414aa);}(_0x68b7,0x8c));var _0x768b=function(_0x4b54a7,_0x55f457){_0x4b54a7=_0x4b54a7-0x0;var _0xc8ba72=_0x68b7[_0x4b54a7];return _0xc8ba72;};'use strict';var Sequelize=require(_0x768b('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x768b('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x768b('0x2')](_0x768b('0x3'),'agent',_0x768b('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x768b('0x5')]}};
\ No newline at end of file
index 4dce198..0e7eadd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a66=['../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x269c42,_0xeed101){var _0x4dad76=function(_0x167b87){while(--_0x167b87){_0x269c42['push'](_0x269c42['shift']());}};_0x4dad76(++_0xeed101);}(_0x7a66,0x1ae));var _0x67a6=function(_0x77305c,_0x30e10a){_0x77305c=_0x77305c-0x0;var _0x167388=_0x7a66[_0x77305c];return _0x167388;};'use strict';var emlformat=require(_0x67a6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x67a6('0x1'));var jsonpatch=require(_0x67a6('0x2'));var rp=require('request-promise');var moment=require(_0x67a6('0x3'));var BPromise=require(_0x67a6('0x4'));var Mustache=require(_0x67a6('0x5'));var util=require('util');var path=require(_0x67a6('0x6'));var sox=require(_0x67a6('0x7'));var csv=require(_0x67a6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x67a6('0x9'));var _=require(_0x67a6('0xa'));var squel=require(_0x67a6('0xb'));var crypto=require(_0x67a6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x67a6('0xd'));var toCsv=require(_0x67a6('0x8'));var querystring=require(_0x67a6('0xe'));var Papa=require(_0x67a6('0xf'));var Redis=require('ioredis');var authService=require(_0x67a6('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x67a6('0x11'));var hardwareService=require(_0x67a6('0x12'));var logger=require(_0x67a6('0x13'))('api');var utils=require(_0x67a6('0x14'));var config=require(_0x67a6('0x15'));var licenseUtil=require(_0x67a6('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fd161,_0x45e85e){_0x45e85e=_0x45e85e||0xcc;return function(_0x2434cf){if(_0x2434cf){return _0x2fd161[_0x67a6('0x17')](_0x45e85e);}return _0x2fd161[_0x67a6('0x18')](_0x45e85e)['end']();};}function respondWithResult(_0x3cc1a3,_0x2a05ad){_0x2a05ad=_0x2a05ad||0xc8;return function(_0x4a2ad9){if(_0x4a2ad9){return _0x3cc1a3[_0x67a6('0x18')](_0x2a05ad)['json'](_0x4a2ad9);}};}function respondWithFilteredResult(_0xd15559,_0x29fc19){return function(_0x314a7f){if(_0x314a7f){var _0x3a568d=typeof _0x29fc19[_0x67a6('0x19')]===_0x67a6('0x1a')&&typeof _0x29fc19[_0x67a6('0x1b')]==='undefined';var _0x4531aa=_0x314a7f[_0x67a6('0x1c')];var _0x3b164f=_0x3a568d?0x0:_0x29fc19[_0x67a6('0x19')];var _0xc2d9e9=_0x3a568d?_0x314a7f[_0x67a6('0x1c')]:_0x29fc19[_0x67a6('0x19')]+_0x29fc19[_0x67a6('0x1b')];var _0x371e2f;if(_0xc2d9e9>=_0x4531aa){_0xc2d9e9=_0x4531aa;_0x371e2f=0xc8;}else{_0x371e2f=0xce;}_0xd15559['status'](_0x371e2f);return _0xd15559['set'](_0x67a6('0x1d'),_0x3b164f+'-'+_0xc2d9e9+'/'+_0x4531aa)[_0x67a6('0x1e')](_0x314a7f);}return null;};}function patchUpdates(_0x16f8ff){return function(_0x5154c6){try{jsonpatch[_0x67a6('0x1f')](_0x5154c6,_0x16f8ff,!![]);}catch(_0x4b794e){return BPromise[_0x67a6('0x20')](_0x4b794e);}return _0x5154c6[_0x67a6('0x21')]();};}function saveUpdates(_0x402e3,_0x4ab939){return function(_0x4d6ee3){if(_0x4d6ee3){return _0x4d6ee3[_0x67a6('0x22')](_0x402e3)[_0x67a6('0x23')](function(_0x5915a1){return _0x5915a1;});}return null;};}function removeEntity(_0x3fa6f8,_0x6b4884){return function(_0x3b3dbe){if(_0x3b3dbe){return _0x3b3dbe['destroy']()[_0x67a6('0x23')](function(){_0x3fa6f8[_0x67a6('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b87a3,_0x3a83ae){return function(_0x289a88){if(!_0x289a88){_0x5b87a3['sendStatus'](0x194);}return _0x289a88;};}function handleError(_0x1fa1ec,_0xca814e){_0xca814e=_0xca814e||0x1f4;return function(_0x2f9fc8){logger[_0x67a6('0x24')](_0x2f9fc8[_0x67a6('0x25')]);if(_0x2f9fc8[_0x67a6('0x26')]){delete _0x2f9fc8[_0x67a6('0x26')];}_0x1fa1ec['status'](_0xca814e)[_0x67a6('0x27')](_0x2f9fc8);};}exports[_0x67a6('0x28')]=function(_0x4a2ade,_0x23086f){var _0x4f3568={},_0x309b33={},_0x4ea696={'count':0x0,'rows':[]};var _0x5aedd6=_[_0x67a6('0x29')](db[_0x67a6('0x2a')][_0x67a6('0x2b')],function(_0x1f4912){return{'name':_0x1f4912[_0x67a6('0x2c')],'type':_0x1f4912[_0x67a6('0x2d')][_0x67a6('0x2e')]};});_0x309b33[_0x67a6('0x2f')]=_['map'](_0x5aedd6,_0x67a6('0x26'));_0x309b33[_0x67a6('0x30')]=_[_0x67a6('0x31')](_0x4a2ade[_0x67a6('0x30')]);_0x309b33['filters']=_['intersection'](_0x309b33['model'],_0x309b33[_0x67a6('0x30')]);_0x4f3568['attributes']=_[_0x67a6('0x32')](_0x309b33['model'],qs[_0x67a6('0x33')](_0x4a2ade[_0x67a6('0x30')]['fields']));_0x4f3568[_0x67a6('0x34')]=_0x4f3568[_0x67a6('0x34')][_0x67a6('0x35')]?_0x4f3568[_0x67a6('0x34')]:_0x309b33[_0x67a6('0x2f')];if(!_0x4a2ade[_0x67a6('0x30')][_0x67a6('0x36')](_0x67a6('0x37'))){_0x4f3568[_0x67a6('0x1b')]=qs[_0x67a6('0x1b')](_0x4a2ade[_0x67a6('0x30')]['limit']);_0x4f3568[_0x67a6('0x19')]=qs['offset'](_0x4a2ade['query'][_0x67a6('0x19')]);}_0x4f3568['order']=qs[_0x67a6('0x38')](_0x4a2ade[_0x67a6('0x30')]['sort']);_0x4f3568[_0x67a6('0x39')]=qs[_0x67a6('0x3a')](_[_0x67a6('0x3b')](_0x4a2ade[_0x67a6('0x30')],_0x309b33['filters']),_0x5aedd6);if(_0x4a2ade['query']['filter']){_0x4f3568[_0x67a6('0x39')]=_['merge'](_0x4f3568[_0x67a6('0x39')],{'$or':_[_0x67a6('0x29')](_0x5aedd6,function(_0x1ec9e9){if(_0x1ec9e9[_0x67a6('0x2d')]!==_0x67a6('0x3c')){var _0x2eaadd={};_0x2eaadd[_0x1ec9e9[_0x67a6('0x26')]]={'$like':'%'+_0x4a2ade[_0x67a6('0x30')][_0x67a6('0x3d')]+'%'};return _0x2eaadd;}})});}_0x4f3568=_[_0x67a6('0x3e')]({},_0x4f3568,_0x4a2ade[_0x67a6('0x3f')]);var _0x1e5da0={'where':_0x4f3568['where']};return db[_0x67a6('0x2a')]['count'](_0x1e5da0)['then'](function(_0x511d6f){_0x4ea696['count']=_0x511d6f;if(_0x4a2ade[_0x67a6('0x30')][_0x67a6('0x40')]){_0x4f3568[_0x67a6('0x41')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x67a6('0x42')](_0x4f3568);})['then'](function(_0x2b887e){_0x4ea696['rows']=_0x2b887e;return _0x4ea696;})['then'](respondWithFilteredResult(_0x23086f,_0x4f3568))[_0x67a6('0x43')](handleError(_0x23086f,null));};exports[_0x67a6('0x44')]=function(_0xc461b2,_0x2a0753){var _0x49073f={'raw':!![],'where':{'id':_0xc461b2[_0x67a6('0x45')]['id']}},_0x33e4f4={};_0x33e4f4[_0x67a6('0x2f')]=_[_0x67a6('0x31')](db[_0x67a6('0x2a')][_0x67a6('0x2b')]);_0x33e4f4['query']=_[_0x67a6('0x31')](_0xc461b2['query']);_0x33e4f4['filters']=_['intersection'](_0x33e4f4[_0x67a6('0x2f')],_0x33e4f4[_0x67a6('0x30')]);_0x49073f['attributes']=_['intersection'](_0x33e4f4[_0x67a6('0x2f')],qs[_0x67a6('0x33')](_0xc461b2[_0x67a6('0x30')][_0x67a6('0x33')]));_0x49073f['attributes']=_0x49073f[_0x67a6('0x34')]['length']?_0x49073f[_0x67a6('0x34')]:_0x33e4f4[_0x67a6('0x2f')];if(_0xc461b2[_0x67a6('0x30')][_0x67a6('0x40')]){_0x49073f['include']=[{'all':!![]}];}_0x49073f=_[_0x67a6('0x3e')]({},_0x49073f,_0xc461b2[_0x67a6('0x3f')]);return db[_0x67a6('0x2a')][_0x67a6('0x46')](_0x49073f)[_0x67a6('0x23')](handleEntityNotFound(_0x2a0753,null))[_0x67a6('0x23')](respondWithResult(_0x2a0753,null))[_0x67a6('0x43')](handleError(_0x2a0753,null));};exports[_0x67a6('0x47')]=function(_0x1eb08a,_0x2cc7c6){return db[_0x67a6('0x2a')]['create'](_0x1eb08a[_0x67a6('0x48')],{})[_0x67a6('0x23')](respondWithResult(_0x2cc7c6,0xc9))['catch'](handleError(_0x2cc7c6,null));};exports[_0x67a6('0x22')]=function(_0x374337,_0x56f71d){if(_0x374337[_0x67a6('0x48')]['id']){delete _0x374337[_0x67a6('0x48')]['id'];}return db['WhatsappTransferReport']['find']({'where':{'id':_0x374337[_0x67a6('0x45')]['id']}})['then'](handleEntityNotFound(_0x56f71d,null))[_0x67a6('0x23')](saveUpdates(_0x374337[_0x67a6('0x48')],null))['then'](respondWithResult(_0x56f71d,null))['catch'](handleError(_0x56f71d,null));};exports[_0x67a6('0x49')]=function(_0x17d538,_0x4fa113){return db[_0x67a6('0x2a')][_0x67a6('0x46')]({'where':{'id':_0x17d538['params']['id']}})[_0x67a6('0x23')](handleEntityNotFound(_0x4fa113,null))[_0x67a6('0x23')](removeEntity(_0x4fa113,null))['catch'](handleError(_0x4fa113,null));};exports[_0x67a6('0x4a')]=function(_0x1bced8,_0x5b21cc){return db[_0x67a6('0x2a')][_0x67a6('0x4a')]()[_0x67a6('0x23')](respondWithResult(_0x5b21cc,null))[_0x67a6('0x43')](handleError(_0x5b21cc,null));};
\ No newline at end of file
+var _0xd367=['nolimit','order','sort','pick','filter','merge','where','WhatsappTransferReport','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','length'];(function(_0x2376d1,_0x38eec4){var _0x443759=function(_0x73c733){while(--_0x73c733){_0x2376d1['push'](_0x2376d1['shift']());}};_0x443759(++_0x38eec4);}(_0xd367,0x1dc));var _0x7d36=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xd367[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7d36('0x0'));var zipdir=require(_0x7d36('0x1'));var jsonpatch=require(_0x7d36('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7d36('0x3'));var Mustache=require(_0x7d36('0x4'));var util=require(_0x7d36('0x5'));var path=require(_0x7d36('0x6'));var sox=require(_0x7d36('0x7'));var csv=require(_0x7d36('0x8'));var ejs=require(_0x7d36('0x9'));var fs=require('fs');var fs_extra=require(_0x7d36('0xa'));var _=require(_0x7d36('0xb'));var squel=require(_0x7d36('0xc'));var crypto=require('crypto');var jsforce=require(_0x7d36('0xd'));var deskjs=require(_0x7d36('0xe'));var toCsv=require(_0x7d36('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7d36('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7d36('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7d36('0x11'));var logger=require(_0x7d36('0x12'))(_0x7d36('0x13'));var utils=require(_0x7d36('0x14'));var config=require(_0x7d36('0x15'));var licenseUtil=require(_0x7d36('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f460b,_0x239ad5){_0x239ad5=_0x239ad5||0xcc;return function(_0x146b28){if(_0x146b28){return _0x4f460b[_0x7d36('0x17')](_0x239ad5);}return _0x4f460b[_0x7d36('0x18')](_0x239ad5)[_0x7d36('0x19')]();};}function respondWithResult(_0x463f47,_0x4087ac){_0x4087ac=_0x4087ac||0xc8;return function(_0x39e355){if(_0x39e355){return _0x463f47[_0x7d36('0x18')](_0x4087ac)[_0x7d36('0x1a')](_0x39e355);}};}function respondWithFilteredResult(_0x326b72,_0x5ea8b5){return function(_0x451155){if(_0x451155){var _0x81620a=typeof _0x5ea8b5['offset']===_0x7d36('0x1b')&&typeof _0x5ea8b5[_0x7d36('0x1c')]===_0x7d36('0x1b');var _0x2588d3=_0x451155[_0x7d36('0x1d')];var _0x981e0e=_0x81620a?0x0:_0x5ea8b5['offset'];var _0x4248a4=_0x81620a?_0x451155[_0x7d36('0x1d')]:_0x5ea8b5[_0x7d36('0x1e')]+_0x5ea8b5['limit'];var _0x1f27b6;if(_0x4248a4>=_0x2588d3){_0x4248a4=_0x2588d3;_0x1f27b6=0xc8;}else{_0x1f27b6=0xce;}_0x326b72['status'](_0x1f27b6);return _0x326b72[_0x7d36('0x1f')](_0x7d36('0x20'),_0x981e0e+'-'+_0x4248a4+'/'+_0x2588d3)[_0x7d36('0x1a')](_0x451155);}return null;};}function patchUpdates(_0x41da93){return function(_0x8b9465){try{jsonpatch[_0x7d36('0x21')](_0x8b9465,_0x41da93,!![]);}catch(_0x5a8983){return BPromise[_0x7d36('0x22')](_0x5a8983);}return _0x8b9465[_0x7d36('0x23')]();};}function saveUpdates(_0x2dee52,_0x1857fe){return function(_0x3b7225){if(_0x3b7225){return _0x3b7225[_0x7d36('0x24')](_0x2dee52)['then'](function(_0x432f73){return _0x432f73;});}return null;};}function removeEntity(_0x453a0f,_0x217bf6){return function(_0x3a12a2){if(_0x3a12a2){return _0x3a12a2[_0x7d36('0x25')]()[_0x7d36('0x26')](function(){_0x453a0f[_0x7d36('0x18')](0xcc)[_0x7d36('0x19')]();});}};}function handleEntityNotFound(_0xf0a4a8,_0x12afac){return function(_0x140760){if(!_0x140760){_0xf0a4a8[_0x7d36('0x17')](0x194);}return _0x140760;};}function handleError(_0x5c00bb,_0x2e3b3b){_0x2e3b3b=_0x2e3b3b||0x1f4;return function(_0x23e118){logger[_0x7d36('0x27')](_0x23e118['stack']);if(_0x23e118[_0x7d36('0x28')]){delete _0x23e118[_0x7d36('0x28')];}_0x5c00bb['status'](_0x2e3b3b)[_0x7d36('0x29')](_0x23e118);};}exports[_0x7d36('0x2a')]=function(_0x4f3db2,_0x14800f){var _0x19b148={},_0x51abcc={},_0x183367={'count':0x0,'rows':[]};var _0x50ba23=_[_0x7d36('0x2b')](db['WhatsappTransferReport'][_0x7d36('0x2c')],function(_0x3fc101){return{'name':_0x3fc101[_0x7d36('0x2d')],'type':_0x3fc101[_0x7d36('0x2e')][_0x7d36('0x2f')]};});_0x51abcc[_0x7d36('0x30')]=_[_0x7d36('0x2b')](_0x50ba23,_0x7d36('0x28'));_0x51abcc['query']=_[_0x7d36('0x31')](_0x4f3db2['query']);_0x51abcc[_0x7d36('0x32')]=_['intersection'](_0x51abcc[_0x7d36('0x30')],_0x51abcc[_0x7d36('0x33')]);_0x19b148[_0x7d36('0x34')]=_[_0x7d36('0x35')](_0x51abcc[_0x7d36('0x30')],qs['fields'](_0x4f3db2[_0x7d36('0x33')][_0x7d36('0x36')]));_0x19b148[_0x7d36('0x34')]=_0x19b148['attributes'][_0x7d36('0x37')]?_0x19b148['attributes']:_0x51abcc['model'];if(!_0x4f3db2['query']['hasOwnProperty'](_0x7d36('0x38'))){_0x19b148[_0x7d36('0x1c')]=qs[_0x7d36('0x1c')](_0x4f3db2[_0x7d36('0x33')][_0x7d36('0x1c')]);_0x19b148[_0x7d36('0x1e')]=qs['offset'](_0x4f3db2[_0x7d36('0x33')][_0x7d36('0x1e')]);}_0x19b148[_0x7d36('0x39')]=qs[_0x7d36('0x3a')](_0x4f3db2['query']['sort']);_0x19b148['where']=qs[_0x7d36('0x32')](_[_0x7d36('0x3b')](_0x4f3db2['query'],_0x51abcc[_0x7d36('0x32')]),_0x50ba23);if(_0x4f3db2['query'][_0x7d36('0x3c')]){_0x19b148['where']=_[_0x7d36('0x3d')](_0x19b148[_0x7d36('0x3e')],{'$or':_[_0x7d36('0x2b')](_0x50ba23,function(_0x1456ad){if(_0x1456ad['type']!=='VIRTUAL'){var _0x2b56e2={};_0x2b56e2[_0x1456ad['name']]={'$like':'%'+_0x4f3db2['query']['filter']+'%'};return _0x2b56e2;}})});}_0x19b148=_['merge']({},_0x19b148,_0x4f3db2['options']);var _0x1af717={'where':_0x19b148[_0x7d36('0x3e')]};return db[_0x7d36('0x3f')]['count'](_0x1af717)[_0x7d36('0x26')](function(_0x1c75b1){_0x183367[_0x7d36('0x1d')]=_0x1c75b1;if(_0x4f3db2[_0x7d36('0x33')][_0x7d36('0x40')]){_0x19b148[_0x7d36('0x41')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x7d36('0x42')](_0x19b148);})[_0x7d36('0x26')](function(_0x9af18f){_0x183367[_0x7d36('0x43')]=_0x9af18f;return _0x183367;})[_0x7d36('0x26')](respondWithFilteredResult(_0x14800f,_0x19b148))[_0x7d36('0x44')](handleError(_0x14800f,null));};exports[_0x7d36('0x45')]=function(_0x1b246e,_0x5a6a94){var _0x1266f9={'raw':!![],'where':{'id':_0x1b246e[_0x7d36('0x46')]['id']}},_0xe3ae7b={};_0xe3ae7b[_0x7d36('0x30')]=_[_0x7d36('0x31')](db['WhatsappTransferReport'][_0x7d36('0x2c')]);_0xe3ae7b[_0x7d36('0x33')]=_['keys'](_0x1b246e[_0x7d36('0x33')]);_0xe3ae7b[_0x7d36('0x32')]=_[_0x7d36('0x35')](_0xe3ae7b[_0x7d36('0x30')],_0xe3ae7b[_0x7d36('0x33')]);_0x1266f9[_0x7d36('0x34')]=_[_0x7d36('0x35')](_0xe3ae7b['model'],qs[_0x7d36('0x36')](_0x1b246e[_0x7d36('0x33')][_0x7d36('0x36')]));_0x1266f9[_0x7d36('0x34')]=_0x1266f9[_0x7d36('0x34')][_0x7d36('0x37')]?_0x1266f9[_0x7d36('0x34')]:_0xe3ae7b[_0x7d36('0x30')];if(_0x1b246e[_0x7d36('0x33')][_0x7d36('0x40')]){_0x1266f9[_0x7d36('0x41')]=[{'all':!![]}];}_0x1266f9=_['merge']({},_0x1266f9,_0x1b246e[_0x7d36('0x47')]);return db[_0x7d36('0x3f')][_0x7d36('0x48')](_0x1266f9)[_0x7d36('0x26')](handleEntityNotFound(_0x5a6a94,null))[_0x7d36('0x26')](respondWithResult(_0x5a6a94,null))[_0x7d36('0x44')](handleError(_0x5a6a94,null));};exports['create']=function(_0x4e8a85,_0x3491aa){return db[_0x7d36('0x3f')][_0x7d36('0x49')](_0x4e8a85['body'],{})['then'](respondWithResult(_0x3491aa,0xc9))[_0x7d36('0x44')](handleError(_0x3491aa,null));};exports[_0x7d36('0x24')]=function(_0x1beef3,_0x719cf9){if(_0x1beef3[_0x7d36('0x4a')]['id']){delete _0x1beef3[_0x7d36('0x4a')]['id'];}return db[_0x7d36('0x3f')][_0x7d36('0x48')]({'where':{'id':_0x1beef3[_0x7d36('0x46')]['id']}})[_0x7d36('0x26')](handleEntityNotFound(_0x719cf9,null))[_0x7d36('0x26')](saveUpdates(_0x1beef3[_0x7d36('0x4a')],null))[_0x7d36('0x26')](respondWithResult(_0x719cf9,null))[_0x7d36('0x44')](handleError(_0x719cf9,null));};exports[_0x7d36('0x25')]=function(_0x50a704,_0x175500){return db[_0x7d36('0x3f')][_0x7d36('0x48')]({'where':{'id':_0x50a704[_0x7d36('0x46')]['id']}})[_0x7d36('0x26')](handleEntityNotFound(_0x175500,null))[_0x7d36('0x26')](removeEntity(_0x175500,null))[_0x7d36('0x44')](handleError(_0x175500,null));};exports[_0x7d36('0x4b')]=function(_0x3026fc,_0x4c9f2d){return db[_0x7d36('0x3f')]['describe']()[_0x7d36('0x26')](respondWithResult(_0x4c9f2d,null))['catch'](handleError(_0x4c9f2d,null));};
\ No newline at end of file
index 951b985..2bb7280 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4f2=['../../config/environment','./whatsappTransferReport.attributes','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','util','moment','request-promise','path','rimraf'];(function(_0x10a203,_0x49720d){var _0x5915dd=function(_0x2f2f05){while(--_0x2f2f05){_0x10a203['push'](_0x10a203['shift']());}};_0x5915dd(++_0x49720d);}(_0xc4f2,0xf8));var _0x2c4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4f2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x2c4f('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x2c4f('0x1'));var BPromise=require('bluebird');var rp=require(_0x2c4f('0x2'));var fs=require('fs');var path=require(_0x2c4f('0x3'));var rimraf=require(_0x2c4f('0x4'));var config=require(_0x2c4f('0x5'));var attributes=require(_0x2c4f('0x6'));module['exports']=function(_0x58b5a8,_0x1b8a40){return _0x58b5a8[_0x2c4f('0x7')](_0x2c4f('0x8'),attributes,{'tableName':_0x2c4f('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x2c4f('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0fd3=['moment','request-promise','path','rimraf','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0fd3,0x130));var _0x30fd=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x0fd3[_0x62c958];return _0x57ec61;};'use strict';var _=require(_0x30fd('0x0'));var util=require(_0x30fd('0x1'));var logger=require(_0x30fd('0x2'))(_0x30fd('0x3'));var moment=require(_0x30fd('0x4'));var BPromise=require('bluebird');var rp=require(_0x30fd('0x5'));var fs=require('fs');var path=require(_0x30fd('0x6'));var rimraf=require(_0x30fd('0x7'));var config=require('../../config/environment');var attributes=require(_0x30fd('0x8'));module[_0x30fd('0x9')]=function(_0x3c823f,_0x5e1e75){return _0x3c823f[_0x30fd('0xa')](_0x30fd('0xb'),attributes,{'tableName':_0x30fd('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x30fd('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index db0a22b..3243aff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9963=['request','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x53035f,_0x44fe62){var _0x3d39ec=function(_0x535016){while(--_0x535016){_0x53035f['push'](_0x53035f['shift']());}};_0x3d39ec(++_0x44fe62);}(_0x9963,0x11b));var _0x3996=function(_0x58803c,_0x4a34df){_0x58803c=_0x58803c-0x0;var _0xf95b9b=_0x9963[_0x58803c];return _0xf95b9b;};'use strict';var _=require(_0x3996('0x0'));var util=require(_0x3996('0x1'));var moment=require('moment');var BPromise=require(_0x3996('0x2'));var rs=require(_0x3996('0x3'));var fs=require('fs');var Redis=require(_0x3996('0x4'));var db=require(_0x3996('0x5'))['db'];var utils=require(_0x3996('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x3996('0x7'));var jayson=require(_0x3996('0x8'));var client=jayson[_0x3996('0x9')][_0x3996('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x456709,_0x581842,_0x28a7b9){return new BPromise(function(_0x68c4f6,_0x382c45){return client[_0x3996('0xb')](_0x456709,_0x28a7b9)['then'](function(_0x459db4){logger[_0x3996('0xc')](_0x3996('0xd'),_0x581842,_0x3996('0xe'));logger['debug']('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x581842,_0x3996('0xe'),JSON[_0x3996('0xf')](_0x459db4));if(_0x459db4['error']){if(_0x459db4[_0x3996('0x10')][_0x3996('0x11')]===0x1f4){logger['error'](_0x3996('0xd'),_0x581842,_0x459db4[_0x3996('0x10')][_0x3996('0x12')]);return _0x382c45(_0x459db4[_0x3996('0x10')][_0x3996('0x12')]);}logger['error'](_0x3996('0xd'),_0x581842,_0x459db4['error'][_0x3996('0x12')]);return _0x68c4f6(_0x459db4[_0x3996('0x10')][_0x3996('0x12')]);}else{logger['info'](_0x3996('0xd'),_0x581842,_0x3996('0xe'));_0x68c4f6(_0x459db4[_0x3996('0x13')][_0x3996('0x12')]);}})[_0x3996('0x14')](function(_0x77b2bd){logger[_0x3996('0x10')](_0x3996('0xd'),_0x581842,_0x77b2bd);_0x382c45(_0x77b2bd);});});}
\ No newline at end of file
+var _0xff8d=['code','error','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x516050,_0x3558d8){var _0x3589fb=function(_0x38f36d){while(--_0x38f36d){_0x516050['push'](_0x516050['shift']());}};_0x3589fb(++_0x3558d8);}(_0xff8d,0xf5));var _0xdff8=function(_0x54ae30,_0x4f5782){_0x54ae30=_0x54ae30-0x0;var _0x56489c=_0xff8d[_0x54ae30];return _0x56489c;};'use strict';var _=require('lodash');var util=require(_0xdff8('0x0'));var moment=require('moment');var BPromise=require(_0xdff8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdff8('0x2'));var db=require(_0xdff8('0x3'))['db'];var utils=require(_0xdff8('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xdff8('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xdff8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1f4986,_0x56ca7b,_0x5c7c0a){return new BPromise(function(_0x13d080,_0x4e4892){return client[_0xdff8('0x7')](_0x1f4986,_0x5c7c0a)[_0xdff8('0x8')](function(_0xc61ba6){logger[_0xdff8('0x9')](_0xdff8('0xa'),_0x56ca7b,_0xdff8('0xb'));logger[_0xdff8('0xc')](_0xdff8('0xd'),_0x56ca7b,_0xdff8('0xb'),JSON[_0xdff8('0xe')](_0xc61ba6));if(_0xc61ba6['error']){if(_0xc61ba6['error'][_0xdff8('0xf')]===0x1f4){logger[_0xdff8('0x10')](_0xdff8('0xa'),_0x56ca7b,_0xc61ba6[_0xdff8('0x10')][_0xdff8('0x11')]);return _0x4e4892(_0xc61ba6[_0xdff8('0x10')][_0xdff8('0x11')]);}logger[_0xdff8('0x10')](_0xdff8('0xa'),_0x56ca7b,_0xc61ba6['error'][_0xdff8('0x11')]);return _0x13d080(_0xc61ba6[_0xdff8('0x10')]['message']);}else{logger[_0xdff8('0x9')](_0xdff8('0xa'),_0x56ca7b,_0xdff8('0xb'));_0x13d080(_0xc61ba6[_0xdff8('0x12')][_0xdff8('0x11')]);}})[_0xdff8('0x13')](function(_0x2c0e33){logger[_0xdff8('0x10')](_0xdff8('0xa'),_0x56ca7b,_0x2c0e33);_0x4e4892(_0x2c0e33);});});}
\ No newline at end of file
index 2394f02..84eced4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c9f=['map','filter','name','join','Offline\x20apps:','status','online','None','seedDB','./config/seedDB','default','./config/license','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./config/logger','./config/pm2/config','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','start','info'];(function(_0x18a529,_0x2bea53){var _0x216fb8=function(_0x537d25){while(--_0x537d25){_0x18a529['push'](_0x18a529['shift']());}};_0x216fb8(++_0x2bea53);}(_0x4c9f,0x122));var _0xf4c9=function(_0x18402b,_0x5cab9e){_0x18402b=_0x18402b-0x0;var _0x239913=_0x4c9f[_0x18402b];return _0x239913;};'use strict';var _=require(_0xf4c9('0x0'));var mysqldb=require('./mysqldb');var rpc=require('./rpc');var config=require('./config/environment');var logger=require(_0xf4c9('0x1'))('app');var pm2=require('./config/pm2');var pm2Config=require(_0xf4c9('0x2'));var schedule=require('./config/schedule');var chat=require('./config/schedule/chat');var whatsapp=require(_0xf4c9('0x3'));var transcribe=require(_0xf4c9('0x4'));function main(){return mysqldb['db'][_0xf4c9('0x5')][_0xf4c9('0x6')]()[_0xf4c9('0x7')](function(){return rpc['listen']();})['then'](function(_0x4a54fa){logger['info'](_0x4a54fa);return chat[_0xf4c9('0x8')]();})[_0xf4c9('0x7')](function(){return whatsapp[_0xf4c9('0x8')]();})[_0xf4c9('0x7')](function(){return schedule['start']();})[_0xf4c9('0x7')](function(){return transcribe[_0xf4c9('0x8')]();})[_0xf4c9('0x7')](function(_0x36fc06){logger[_0xf4c9('0x9')](_0x36fc06);return pm2[_0xf4c9('0x8')](pm2Config);})[_0xf4c9('0x7')](function(_0x2598d2){logger[_0xf4c9('0x9')]('Online\x20apps:',_[_0xf4c9('0xa')](_[_0xf4c9('0xb')](_0x2598d2,{'status':'online'}),_0xf4c9('0xc'))[_0xf4c9('0xd')]());logger[_0xf4c9('0x9')](_0xf4c9('0xe'),_['map'](_[_0xf4c9('0xb')](_0x2598d2,function(_0x2438dd){return _0x2438dd[_0xf4c9('0xf')]!==_0xf4c9('0x10');}),'name')[_0xf4c9('0xd')]()||_0xf4c9('0x11'));config[_0xf4c9('0x12')]&&require(_0xf4c9('0x13'))[_0xf4c9('0x14')]();require(_0xf4c9('0x15'))[_0xf4c9('0x14')]();})[_0xf4c9('0x16')](function(_0x4035a6){logger['error'](_0xf4c9('0x17'),_0x4035a6);process[_0xf4c9('0x18')](0x1);});}main();
\ No newline at end of file
+var _0x9637=['./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./rpc','./config/logger','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sync','then','info','start','Online\x20apps:','map','filter','online','join','Offline\x20apps:','status','name','None','seedDB','./config/seedDB','default'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x9637,0xc9));var _0x7963=function(_0x3a0885,_0x23d8c6){_0x3a0885=_0x3a0885-0x0;var _0x5d6aa4=_0x9637[_0x3a0885];return _0x5d6aa4;};'use strict';var _=require('lodash');var mysqldb=require('./mysqldb');var rpc=require(_0x7963('0x0'));var config=require('./config/environment');var logger=require(_0x7963('0x1'))('app');var pm2=require(_0x7963('0x2'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x7963('0x3'));var chat=require(_0x7963('0x4'));var whatsapp=require(_0x7963('0x5'));var transcribe=require(_0x7963('0x6'));function main(){return mysqldb['db']['sequelize'][_0x7963('0x7')]()[_0x7963('0x8')](function(){return rpc['listen']();})['then'](function(_0xa15078){logger[_0x7963('0x9')](_0xa15078);return chat['start']();})['then'](function(){return whatsapp[_0x7963('0xa')]();})[_0x7963('0x8')](function(){return schedule['start']();})[_0x7963('0x8')](function(){return transcribe[_0x7963('0xa')]();})[_0x7963('0x8')](function(_0x288340){logger[_0x7963('0x9')](_0x288340);return pm2['start'](pm2Config);})[_0x7963('0x8')](function(_0x533887){logger['info'](_0x7963('0xb'),_[_0x7963('0xc')](_[_0x7963('0xd')](_0x533887,{'status':_0x7963('0xe')}),'name')[_0x7963('0xf')]());logger[_0x7963('0x9')](_0x7963('0x10'),_[_0x7963('0xc')](_['filter'](_0x533887,function(_0x2978aa){return _0x2978aa[_0x7963('0x11')]!==_0x7963('0xe');}),_0x7963('0x12'))[_0x7963('0xf')]()||_0x7963('0x13'));config[_0x7963('0x14')]&&require(_0x7963('0x15'))[_0x7963('0x16')]();require(_0x7963('0x17'))[_0x7963('0x16')]();})[_0x7963('0x18')](function(_0x1f5540){logger[_0x7963('0x19')](_0x7963('0x1a'),_0x1f5540);process[_0x7963('0x1b')](0x1);});}main();
\ No newline at end of file
index 9a190ef..6a76eae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc289=['apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','ValidationError','split','length','splice','unshift','encryptString','promisify','secret','payload','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/license/hardware','../../config/license/util','../encryptor','lodash','express-jwt','basic-auth','crypto','bluebird','util','secrets','session','role','fullname','email','permissions','chatPause','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','closed','disposition','then','status','json','unmanaged','Unmanaged.','Forbidden.','headers','authorization','startsWith','Basic','User','name','authenticate','pass','Wrong\x20credentials.','user','catch','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','allowedLoginAttempts','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blockedAt','add','minutes','use','find','canUpdate','Forbidden','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','redirect','/dashboards/general','send','retrieveApiKey','isNil','generateApiKey'];(function(_0x39bc67,_0x1b4f50){var _0x355386=function(_0x4289d4){while(--_0x4289d4){_0x39bc67['push'](_0x39bc67['shift']());}};_0x355386(++_0x1b4f50);}(_0xc289,0x118));var _0x9c28=function(_0x38b24e,_0x2ce4ac){_0x38b24e=_0x38b24e-0x0;var _0x443f50=_0xc289[_0x38b24e];return _0x443f50;};'use strict';var db=require(_0x9c28('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x9c28('0x1'));var licenseUtil=require(_0x9c28('0x2'));var encryptor=require(_0x9c28('0x3'));var _=require(_0x9c28('0x4'));var jwt=require('jsonwebtoken');var expressJwt=require(_0x9c28('0x5'));var compose=require('composable-middleware');var basicAuth=require(_0x9c28('0x6'));var crypto=require(_0x9c28('0x7'));var BPromise=require(_0x9c28('0x8'));var util=require(_0x9c28('0x9'));var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0x9c28('0xa')][_0x9c28('0xb')]});var userAttributes=['id',_0x9c28('0xc'),_0x9c28('0xd'),'name','internal',_0x9c28('0xe'),'userpic',_0x9c28('0xf'),'md5secret','voicePause',_0x9c28('0x10'),'mailPause',_0x9c28('0x11'),'smsPause',_0x9c28('0x12'),_0x9c28('0x13'),_0x9c28('0x14'),_0x9c28('0x15'),_0x9c28('0x16'),_0x9c28('0x17'),_0x9c28('0x18'),_0x9c28('0x19'),_0x9c28('0x1a'),_0x9c28('0x1b'),_0x9c28('0x1c'),_0x9c28('0x1d'),_0x9c28('0x1e'),_0x9c28('0x1f'),_0x9c28('0x20'),_0x9c28('0x21'),'phoneBarPrefixRequired',_0x9c28('0x22'),'phoneBarRemoteControlPort',_0x9c28('0x23'),_0x9c28('0x24'),_0x9c28('0x25'),_0x9c28('0x26'),_0x9c28('0x27'),_0x9c28('0x28'),'downloadVoiceRecordings',_0x9c28('0x29'),_0x9c28('0x2a')];exports[_0x9c28('0x2b')]=function(){return this[_0x9c28('0x2c')](!![])['use'](function(_0x242260,_0x50f684,_0x58cc7a){if(_0x242260['user']){_0x58cc7a();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x242260['params']['id']},'attributes':['id',_0x9c28('0x2d'),_0x9c28('0x2e')],'raw':!![]})[_0x9c28('0x2f')](function(_0x664cbe){if(_0x664cbe&&_0x664cbe[_0x9c28('0x2d')]){return _0x50f684[_0x9c28('0x30')](_0x664cbe['disposition']==='unmanaged'?0x195:0x193)[_0x9c28('0x31')]({'message':_0x664cbe['disposition']===_0x9c28('0x32')?_0x9c28('0x33'):_0x9c28('0x34')});}else{_0x58cc7a();}})['catch'](function(_0x47c276){_0x58cc7a(_0x47c276);});}});};exports[_0x9c28('0x2c')]=function isAuthenticated(_0x3983d2){return compose()['use'](function(_0x10448b,_0x36b900,_0x51af57){var _0x8e3191;if(_0x10448b[_0x9c28('0x35')][_0x9c28('0x36')]){if(_[_0x9c28('0x37')](_0x10448b[_0x9c28('0x35')]['authorization'],_0x9c28('0x38'))){var _0x1dd62f=basicAuth(_0x10448b);db[_0x9c28('0x39')]['find']({'where':{'name':_0x1dd62f[_0x9c28('0x3a')]}})['then'](function(_0x31706f){if(!_0x31706f||!_0x31706f[_0x9c28('0x3b')](_0x1dd62f[_0x9c28('0x3c')])){return _0x36b900[_0x9c28('0x30')](0x191)[_0x9c28('0x31')]({'message':_0x9c28('0x3d')});}_0x10448b[_0x9c28('0x3e')]={'id':_0x31706f['id']};_0x51af57();})[_0x9c28('0x3f')](function(_0x3a6a23){_0x51af57(_0x3a6a23);});}else if(_[_0x9c28('0x37')](_0x10448b['headers'][_0x9c28('0x36')],_0x9c28('0x40'))){validateJwt(_0x10448b,_0x36b900,_0x51af57);}else{if(_0x3983d2){_0x51af57();}else{return _0x36b900['status'](0x193)[_0x9c28('0x31')]({'message':_0x9c28('0x41')});}}}else if(_0x10448b[_0x9c28('0x42')][_0x9c28('0x43')]){try{var _0x4eeb0b={'audience':hardwareConf[_0x9c28('0x44')](),'issuer':hardwareConf[_0x9c28('0x44')]()};verifyJwt(_0x10448b['query'][_0x9c28('0x43')],_0x4eeb0b)[_0x9c28('0x2f')](function(_0x4b23c2){return db[_0x9c28('0x39')]['find']({'where':{'id':_0x4b23c2[_0x9c28('0x45')]}})[_0x9c28('0x2f')](function(_0x3cba81){_0x8e3191=_0x3cba81;return db[_0x9c28('0x46')][_0x9c28('0x47')]({'where':{'id':0x1},'attributes':[_0x9c28('0x48'),_0x9c28('0x49')],'raw':!![]});})[_0x9c28('0x2f')](function(_0x4e3ffc){if(!_0x8e3191||!_['isEqual'](_0x8e3191[_0x9c28('0x4a')],_0x4b23c2[_0x9c28('0x4b')])){return _0x36b900[_0x9c28('0x30')](0x191)[_0x9c28('0x31')]({'message':_0x9c28('0x4c')});}if(_0x8e3191[_0x9c28('0x4d')]){return _0x36b900[_0x9c28('0x30')](0x191)[_0x9c28('0x31')]({'message':_0x9c28('0x4e')});}if(_0x8e3191['blocked']){if(_0x4e3ffc[_0x9c28('0x49')]>0x0){if(moment(_0x8e3191[_0x9c28('0x4f')])[_0x9c28('0x50')](_0x4e3ffc[_0x9c28('0x49')],_0x9c28('0x51'))>moment()){return _0x36b900['status'](0x191)[_0x9c28('0x31')]({'message':_0x9c28('0x4e')});}}else{return _0x36b900['status'](0x191)[_0x9c28('0x31')]({'message':_0x9c28('0x4e')});}}_0x10448b['user']={'id':_0x8e3191['id']};_0x51af57();});})['catch'](function(){return _0x36b900['status'](0x191)[_0x9c28('0x31')]({'message':_0x9c28('0x4e')});});}catch(_0x370b20){_0x51af57(_0x370b20);}}else if(_0x3983d2){_0x51af57();}else{return _0x36b900[_0x9c28('0x30')](0x193)['json']({'message':_0x9c28('0x41')});}})[_0x9c28('0x52')](function(_0xc1915d,_0x35ca9b,_0xb1afae){if(_0xc1915d[_0x9c28('0x3e')]){db[_0x9c28('0x39')][_0x9c28('0x53')]({'where':{'id':_0xc1915d['user']['id']},'attributes':userAttributes})[_0x9c28('0x2f')](function(_0x48caa7){if(!_0x48caa7){return _0x35ca9b[_0x9c28('0x30')](0x194)[_0x9c28('0x31')]({'message':'User\x20not\x20found.'});}_0xc1915d[_0x9c28('0x3e')]=_0x48caa7;_0xb1afae();})[_0x9c28('0x3f')](function(_0x4e9b65){_0xb1afae(_0x4e9b65);});}else if(_0x3983d2){_0xb1afae();}else{return _0x35ca9b[_0x9c28('0x30')](0x194)[_0x9c28('0x31')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x9c28('0x54')]=function canUpdate(){return compose()['use'](function(_0x2c2f66,_0x478fb9,_0x1f7688){return licenseUtil['getLicense']()[_0x9c28('0x2f')](function(_0x4d6030){if(_0x4d6030['update']){_0x1f7688();}else{return _0x478fb9[_0x9c28('0x30')](0x193)[_0x9c28('0x31')]({'message':_0x9c28('0x55')});}})[_0x9c28('0x3f')](function(_0x4e4c79){_0x1f7688(_0x4e4c79);});});};exports[_0x9c28('0x56')]=function(_0xe598d4,_0x5326d3,_0x338eed){_0xe598d4['isMiddleware']=!![];return _0x338eed();};exports[_0x9c28('0x57')]=function signToken(_0x2fcfa7){return signJwt(_0x2fcfa7);};exports['setTokenCookie']=function(_0x1d469f,_0x4b9e71){if(!_0x1d469f[_0x9c28('0x3e')]){return _0x4b9e71['status'](0x194)['json']({'message':_0x9c28('0x58')});}var _0x28b474={'payload':{'id':_0x1d469f[_0x9c28('0x3e')]['id'],'role':_0x1d469f[_0x9c28('0x3e')][_0x9c28('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x28b474)['then'](function(_0xe29c7c){_0x4b9e71['cookie']('motion.token',_0xe29c7c);_0x4b9e71[_0x9c28('0x59')](_0x9c28('0x5a'));})[_0x9c28('0x3f')](function(_0x2bead9){return _0x4b9e71[_0x9c28('0x30')](0x1f4)[_0x9c28('0x5b')](_0x2bead9);});};exports[_0x9c28('0x5c')]=function(_0x2d88c4){if(_[_0x9c28('0x5d')](_0x2d88c4[_0x9c28('0x4a')])||_[_0x9c28('0x5d')](_0x2d88c4['apiKeyIat'])){return null;}else{return createJwt(_0x2d88c4);}};exports[_0x9c28('0x5e')]=function(_0x886e3f){_0x886e3f[_0x9c28('0x4a')]=generateNonce();_0x886e3f[_0x9c28('0x5f')]=generateIssuedAt();return createJwt(_0x886e3f);};exports[_0x9c28('0x60')]=function(_0x5c7608,_0x15383c){var _0x147999=_0x5c7608['query']['apikey'];if(_0x147999){var _0x24963c={'nonce':_0x15383c[_0x9c28('0x4a')],'iat':_0x15383c[_0x9c28('0x5f')],'audience':hardwareConf[_0x9c28('0x44')](),'issuer':hardwareConf[_0x9c28('0x44')]()};return verifyJwt(_0x147999,_0x24963c)[_0x9c28('0x2f')](function(){return generateApiKey(_0x15383c);});}else{throw{'message':_0x9c28('0x61')};}};exports[_0x9c28('0x62')]=function(_0x11b3f7){var _0x311d2e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x311d2e[_0x9c28('0x63')](_0x11b3f7))throw new db[(_0x9c28('0x64'))]['ValidationError'](_0x9c28('0x65'));return;};exports[_0x9c28('0x66')]=function(_0x4b4bce,_0x303f1f,_0x2a91ec){var _0x420f26=encryptor[_0x9c28('0x67')](_0x303f1f)['split'](',');for(var _0x40b450=0x0;_0x40b450<_0x2a91ec;_0x40b450++){if(!_0x420f26[_0x40b450])break;if(_0x4b4bce[_0x9c28('0x68')]()===_0x420f26[_0x40b450][_0x9c28('0x68')]()){var _0xdac6d4=util[_0x9c28('0x69')](_0x9c28('0x6a'),_0x2a91ec);if(_0x2a91ec===0x1){_0xdac6d4=_0x9c28('0x6b');}throw new db['Sequelize'][(_0x9c28('0x6c'))](_0xdac6d4);}}return;};exports['updatePasswordsHistory']=function(_0xcd7368,_0x5907d2){var _0x2eabf4=_0x5907d2?encryptor['decryptString'](_0x5907d2)[_0x9c28('0x6d')](','):[];if(_0x2eabf4[_0x9c28('0x6e')]===0x5){_0x2eabf4[_0x9c28('0x6f')](-0x1,0x1);}_0x2eabf4[_0x9c28('0x70')](_0xcd7368);return encryptor[_0x9c28('0x71')](_0x2eabf4['join'](','));};function signJwt(_0x4e773e){var _0x2f701a=BPromise[_0x9c28('0x72')](jwt['sign'],{'context':jwt});var _0x23ae69=_0x4e773e[_0x9c28('0x73')]||config[_0x9c28('0xa')][_0x9c28('0xb')];return new BPromise(function(_0x4ffab8,_0x5d93c2){_0x2f701a(_0x4e773e[_0x9c28('0x74')],_0x23ae69,_0x4e773e[_0x9c28('0x75')])[_0x9c28('0x2f')](function(_0x1aae1c){_0x4ffab8(_0x1aae1c);})[_0x9c28('0x3f')](function(_0x4f767e){_0x5d93c2(_0x4f767e);});});}function verifyJwt(_0x3ce7b7,_0x153475,_0x467eb1){var _0x4fffca=BPromise[_0x9c28('0x72')](jwt[_0x9c28('0x76')],{'context':jwt});var _0x102f52=_0x467eb1||config[_0x9c28('0xa')]['session'];return new BPromise(function(_0x1cd9fa,_0x399d3d){_0x4fffca(_0x3ce7b7,_0x102f52,_0x153475)[_0x9c28('0x2f')](function(_0x3fa271){_0x1cd9fa(_0x3fa271);})[_0x9c28('0x3f')](function(_0x5ba81f){_0x399d3d(_0x5ba81f);});});}function generateNonce(){return crypto[_0x9c28('0x77')](0x10)[_0x9c28('0x78')](_0x9c28('0x79'));}function generateIssuedAt(){return Math[_0x9c28('0x7a')](Date[_0x9c28('0x7b')]()/0x3e8)[_0x9c28('0x78')]();}function createJwt(_0x44f672){var _0x4abfa9={'payload':{'iat':_0x44f672[_0x9c28('0x5f')],'nonce':_0x44f672[_0x9c28('0x4a')]},'options':{'algorithm':_0x9c28('0x7c'),'subject':_0x44f672['id'][_0x9c28('0x78')](),'issuer':hardwareConf[_0x9c28('0x44')](),'audience':hardwareConf[_0x9c28('0x44')]()}};return signJwt(_0x4abfa9)[_0x9c28('0x2f')](function(_0x158871){return{'iat':_0x44f672[_0x9c28('0x5f')],'nonce':_0x44f672['apiKeyNonce'],'token':_0x158871};});}
\ No newline at end of file
+var _0xd2de=['phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','use','ChatInteraction','params','closed','disposition','unmanaged','json','Forbidden.','catch','headers','authorization','Basic','User','find','then','pass','status','user','startsWith','Unknown\x20authorization\x20format','getUuid','apikey','sub','Setting','findOne','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','canUpdate','getLicense','update','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','query','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','ValidationError','updatePasswordsHistory','decryptString','length','splice','unshift','encryptString','join','promisify','sign','secret','session','payload','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../encryptor','jsonwebtoken','express-jwt','composable-middleware','crypto','bluebird','moment','secrets','role','fullname','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias'];(function(_0x21383b,_0x5158af){var _0x1e55ed=function(_0x3bbc5d){while(--_0x3bbc5d){_0x21383b['push'](_0x21383b['shift']());}};_0x1e55ed(++_0x5158af);}(_0xd2de,0x65));var _0xed2d=function(_0x3b92a4,_0x5be1f8){_0x3b92a4=_0x3b92a4-0x0;var _0x427b2c=_0xd2de[_0x3b92a4];return _0x427b2c;};'use strict';var db=require(_0xed2d('0x0'))['db'];var config=require(_0xed2d('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require(_0xed2d('0x2'));var _=require('lodash');var jwt=require(_0xed2d('0x3'));var expressJwt=require(_0xed2d('0x4'));var compose=require(_0xed2d('0x5'));var basicAuth=require('basic-auth');var crypto=require(_0xed2d('0x6'));var BPromise=require(_0xed2d('0x7'));var util=require('util');var moment=require(_0xed2d('0x8'));var validateJwt=expressJwt({'secret':config[_0xed2d('0x9')]['session']});var userAttributes=['id',_0xed2d('0xa'),_0xed2d('0xb'),'name','internal',_0xed2d('0xc'),_0xed2d('0xd'),_0xed2d('0xe'),_0xed2d('0xf'),_0xed2d('0x10'),_0xed2d('0x11'),_0xed2d('0x12'),_0xed2d('0x13'),'smsPause',_0xed2d('0x14'),_0xed2d('0x15'),_0xed2d('0x16'),_0xed2d('0x17'),_0xed2d('0x18'),_0xed2d('0x19'),_0xed2d('0x1a'),_0xed2d('0x1b'),_0xed2d('0x1c'),'phoneBarAutoAnswer',_0xed2d('0x1d'),_0xed2d('0x1e'),_0xed2d('0x1f'),_0xed2d('0x20'),_0xed2d('0x21'),_0xed2d('0x22'),_0xed2d('0x23'),_0xed2d('0x24'),_0xed2d('0x25'),_0xed2d('0x26'),_0xed2d('0x27'),_0xed2d('0x28'),_0xed2d('0x29'),_0xed2d('0x2a'),'wssPort',_0xed2d('0x2b'),_0xed2d('0x2c'),_0xed2d('0x2d')];exports[_0xed2d('0x2e')]=function(){return this[_0xed2d('0x2f')](!![])[_0xed2d('0x30')](function(_0x2d0d5b,_0x30deca,_0x2f321f){if(_0x2d0d5b['user']){_0x2f321f();}else{return db[_0xed2d('0x31')]['findOne']({'where':{'id':_0x2d0d5b[_0xed2d('0x32')]['id']},'attributes':['id',_0xed2d('0x33'),_0xed2d('0x34')],'raw':!![]})['then'](function(_0x4459b5){if(_0x4459b5&&_0x4459b5[_0xed2d('0x33')]){return _0x30deca['status'](_0x4459b5['disposition']===_0xed2d('0x35')?0x195:0x193)[_0xed2d('0x36')]({'message':_0x4459b5['disposition']===_0xed2d('0x35')?'Unmanaged.':_0xed2d('0x37')});}else{_0x2f321f();}})[_0xed2d('0x38')](function(_0x318410){_0x2f321f(_0x318410);});}});};exports[_0xed2d('0x2f')]=function isAuthenticated(_0x15b878){return compose()[_0xed2d('0x30')](function(_0x460f99,_0xdb84d0,_0x14dbc1){var _0x50d5f7;if(_0x460f99[_0xed2d('0x39')][_0xed2d('0x3a')]){if(_['startsWith'](_0x460f99[_0xed2d('0x39')][_0xed2d('0x3a')],_0xed2d('0x3b'))){var _0x5b19d2=basicAuth(_0x460f99);db[_0xed2d('0x3c')][_0xed2d('0x3d')]({'where':{'name':_0x5b19d2['name']}})[_0xed2d('0x3e')](function(_0x2c1034){if(!_0x2c1034||!_0x2c1034['authenticate'](_0x5b19d2[_0xed2d('0x3f')])){return _0xdb84d0[_0xed2d('0x40')](0x191)[_0xed2d('0x36')]({'message':'Wrong\x20credentials.'});}_0x460f99[_0xed2d('0x41')]={'id':_0x2c1034['id']};_0x14dbc1();})[_0xed2d('0x38')](function(_0x22afee){_0x14dbc1(_0x22afee);});}else if(_[_0xed2d('0x42')](_0x460f99[_0xed2d('0x39')]['authorization'],'Bearer')){validateJwt(_0x460f99,_0xdb84d0,_0x14dbc1);}else{if(_0x15b878){_0x14dbc1();}else{return _0xdb84d0['status'](0x193)['json']({'message':_0xed2d('0x43')});}}}else if(_0x460f99['query']['apikey']){try{var _0x5b0e0b={'audience':hardwareConf[_0xed2d('0x44')](),'issuer':hardwareConf[_0xed2d('0x44')]()};verifyJwt(_0x460f99['query'][_0xed2d('0x45')],_0x5b0e0b)[_0xed2d('0x3e')](function(_0x65406c){return db[_0xed2d('0x3c')][_0xed2d('0x3d')]({'where':{'id':_0x65406c[_0xed2d('0x46')]}})[_0xed2d('0x3e')](function(_0x26dcd9){_0x50d5f7=_0x26dcd9;return db[_0xed2d('0x47')][_0xed2d('0x48')]({'where':{'id':0x1},'attributes':[_0xed2d('0x49'),_0xed2d('0x4a')],'raw':!![]});})[_0xed2d('0x3e')](function(_0x4176c6){if(!_0x50d5f7||!_[_0xed2d('0x4b')](_0x50d5f7[_0xed2d('0x4c')],_0x65406c[_0xed2d('0x4d')])){return _0xdb84d0[_0xed2d('0x40')](0x191)[_0xed2d('0x36')]({'message':_0xed2d('0x4e')});}if(_0x50d5f7[_0xed2d('0x4f')]){return _0xdb84d0[_0xed2d('0x40')](0x191)[_0xed2d('0x36')]({'message':_0xed2d('0x50')});}if(_0x50d5f7[_0xed2d('0x51')]){if(_0x4176c6[_0xed2d('0x4a')]>0x0){if(moment(_0x50d5f7[_0xed2d('0x52')])[_0xed2d('0x53')](_0x4176c6[_0xed2d('0x4a')],'minutes')>moment()){return _0xdb84d0[_0xed2d('0x40')](0x191)[_0xed2d('0x36')]({'message':_0xed2d('0x50')});}}else{return _0xdb84d0[_0xed2d('0x40')](0x191)['json']({'message':_0xed2d('0x50')});}}_0x460f99[_0xed2d('0x41')]={'id':_0x50d5f7['id']};_0x14dbc1();});})['catch'](function(){return _0xdb84d0[_0xed2d('0x40')](0x191)[_0xed2d('0x36')]({'message':_0xed2d('0x50')});});}catch(_0x364e29){_0x14dbc1(_0x364e29);}}else if(_0x15b878){_0x14dbc1();}else{return _0xdb84d0[_0xed2d('0x40')](0x193)[_0xed2d('0x36')]({'message':_0xed2d('0x43')});}})[_0xed2d('0x30')](function(_0x350758,_0xe542bc,_0x5b66fa){if(_0x350758['user']){db['User'][_0xed2d('0x3d')]({'where':{'id':_0x350758[_0xed2d('0x41')]['id']},'attributes':userAttributes})[_0xed2d('0x3e')](function(_0x69b0a8){if(!_0x69b0a8){return _0xe542bc['status'](0x194)['json']({'message':'User\x20not\x20found.'});}_0x350758[_0xed2d('0x41')]=_0x69b0a8;_0x5b66fa();})[_0xed2d('0x38')](function(_0x356da5){_0x5b66fa(_0x356da5);});}else if(_0x15b878){_0x5b66fa();}else{return _0xe542bc[_0xed2d('0x40')](0x194)[_0xed2d('0x36')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xed2d('0x54')]=function canUpdate(){return compose()[_0xed2d('0x30')](function(_0x5ed954,_0xa40e1c,_0x217c12){return licenseUtil[_0xed2d('0x55')]()['then'](function(_0x4c42e9){if(_0x4c42e9[_0xed2d('0x56')]){_0x217c12();}else{return _0xa40e1c['status'](0x193)[_0xed2d('0x36')]({'message':'Forbidden'});}})[_0xed2d('0x38')](function(_0x9900d5){_0x217c12(_0x9900d5);});});};exports[_0xed2d('0x57')]=function(_0x77843e,_0x55e7e8,_0x37ff6b){_0x77843e[_0xed2d('0x57')]=!![];return _0x37ff6b();};exports[_0xed2d('0x58')]=function signToken(_0x679253){return signJwt(_0x679253);};exports['setTokenCookie']=function(_0x543451,_0x438a65){if(!_0x543451['user']){return _0x438a65[_0xed2d('0x40')](0x194)[_0xed2d('0x36')]({'message':_0xed2d('0x59')});}var _0x2497b6={'payload':{'id':_0x543451['user']['id'],'role':_0x543451[_0xed2d('0x41')][_0xed2d('0xa')]},'options':{'expiresIn':0x15180}};return signJwt(_0x2497b6)[_0xed2d('0x3e')](function(_0xb5aca2){_0x438a65[_0xed2d('0x5a')](_0xed2d('0x5b'),_0xb5aca2);_0x438a65['redirect'](_0xed2d('0x5c'));})[_0xed2d('0x38')](function(_0x146d52){return _0x438a65['status'](0x1f4)[_0xed2d('0x5d')](_0x146d52);});};exports[_0xed2d('0x5e')]=function(_0x232049){if(_[_0xed2d('0x5f')](_0x232049[_0xed2d('0x4c')])||_[_0xed2d('0x5f')](_0x232049[_0xed2d('0x60')])){return null;}else{return createJwt(_0x232049);}};exports[_0xed2d('0x61')]=function(_0x554f7c){_0x554f7c[_0xed2d('0x4c')]=generateNonce();_0x554f7c[_0xed2d('0x60')]=generateIssuedAt();return createJwt(_0x554f7c);};exports[_0xed2d('0x62')]=function(_0x40684a,_0x45a79b){var _0x12a7a1=_0x40684a[_0xed2d('0x63')][_0xed2d('0x45')];if(_0x12a7a1){var _0x22272f={'nonce':_0x45a79b['apiKeyNonce'],'iat':_0x45a79b[_0xed2d('0x60')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xed2d('0x44')]()};return verifyJwt(_0x12a7a1,_0x22272f)[_0xed2d('0x3e')](function(){return generateApiKey(_0x45a79b);});}else{throw{'message':_0xed2d('0x64')};}};exports[_0xed2d('0x65')]=function(_0x47e7d7){var _0x597541=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x597541['test'](_0x47e7d7))throw new db[(_0xed2d('0x66'))]['ValidationError'](_0xed2d('0x67'));return;};exports[_0xed2d('0x68')]=function(_0x989ac5,_0xb501e,_0x5e3530){var _0x243bf7=encryptor['decryptString'](_0xb501e)[_0xed2d('0x69')](',');for(var _0x3c2183=0x0;_0x3c2183<_0x5e3530;_0x3c2183++){if(!_0x243bf7[_0x3c2183])break;if(_0x989ac5[_0xed2d('0x6a')]()===_0x243bf7[_0x3c2183][_0xed2d('0x6a')]()){var _0x1c7edb=util['format'](_0xed2d('0x6b'),_0x5e3530);if(_0x5e3530===0x1){_0x1c7edb=_0xed2d('0x6c');}throw new db['Sequelize'][(_0xed2d('0x6d'))](_0x1c7edb);}}return;};exports[_0xed2d('0x6e')]=function(_0x1453b4,_0x3d4a7f){var _0x4ead9b=_0x3d4a7f?encryptor[_0xed2d('0x6f')](_0x3d4a7f)[_0xed2d('0x69')](','):[];if(_0x4ead9b[_0xed2d('0x70')]===0x5){_0x4ead9b[_0xed2d('0x71')](-0x1,0x1);}_0x4ead9b[_0xed2d('0x72')](_0x1453b4);return encryptor[_0xed2d('0x73')](_0x4ead9b[_0xed2d('0x74')](','));};function signJwt(_0x1d697a){var _0x5d0cd2=BPromise[_0xed2d('0x75')](jwt[_0xed2d('0x76')],{'context':jwt});var _0x31d6d0=_0x1d697a[_0xed2d('0x77')]||config['secrets'][_0xed2d('0x78')];return new BPromise(function(_0x9a472f,_0x2d9c47){_0x5d0cd2(_0x1d697a[_0xed2d('0x79')],_0x31d6d0,_0x1d697a[_0xed2d('0x7a')])['then'](function(_0x5b22ea){_0x9a472f(_0x5b22ea);})[_0xed2d('0x38')](function(_0x4f0641){_0x2d9c47(_0x4f0641);});});}function verifyJwt(_0x35f082,_0x122fe1,_0x5a3946){var _0x1abe0c=BPromise[_0xed2d('0x75')](jwt[_0xed2d('0x7b')],{'context':jwt});var _0x57cdda=_0x5a3946||config['secrets']['session'];return new BPromise(function(_0x419bf0,_0x4b1bbf){_0x1abe0c(_0x35f082,_0x57cdda,_0x122fe1)[_0xed2d('0x3e')](function(_0x450ae5){_0x419bf0(_0x450ae5);})[_0xed2d('0x38')](function(_0x4d27b3){_0x4b1bbf(_0x4d27b3);});});}function generateNonce(){return crypto[_0xed2d('0x7c')](0x10)[_0xed2d('0x7d')](_0xed2d('0x7e'));}function generateIssuedAt(){return Math[_0xed2d('0x7f')](Date[_0xed2d('0x80')]()/0x3e8)[_0xed2d('0x7d')]();}function createJwt(_0x128cf2){var _0x3d242a={'payload':{'iat':_0x128cf2[_0xed2d('0x60')],'nonce':_0x128cf2[_0xed2d('0x4c')]},'options':{'algorithm':_0xed2d('0x81'),'subject':_0x128cf2['id']['toString'](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xed2d('0x44')]()}};return signJwt(_0x3d242a)[_0xed2d('0x3e')](function(_0x2527fb){return{'iat':_0x128cf2[_0xed2d('0x60')],'nonce':_0x128cf2['apiKeyNonce'],'token':_0x2527fb};});}
\ No newline at end of file
index 096b9f7..2dbcb18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3f2=['final','close','createReadStream','update','unlink','encryptString','secret','base64','decryptString','createDecipher','utf8','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','hasOwnProperty','encryptFile','createCipher','data','binary','write','end'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0xe3f2,0x1a3));var _0x2e3f=function(_0xa5f2ec,_0x3a3b90){_0xa5f2ec=_0xa5f2ec-0x0;var _0x4089d6=_0xe3f2[_0xa5f2ec];return _0x4089d6;};'use strict';var crypto=require(_0x2e3f('0x0'));var fs=require('fs');var BPromise=require(_0x2e3f('0x1'));var _=require(_0x2e3f('0x2'));var config=require(_0x2e3f('0x3'));var logger=require(_0x2e3f('0x4'))(_0x2e3f('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x2e3f('0x6')],'algorithm':_0x2e3f('0x7')};const fileOptions={'algorithm':_0x2e3f('0x8')};if(config['encrypt']&&config[_0x2e3f('0x9')][_0x2e3f('0xa')]){var isSupported=isAlgorithmSupported(config[_0x2e3f('0x9')][_0x2e3f('0xa')]);if(isSupported){fileOptions[_0x2e3f('0xa')]=config['encrypt']['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0x2e3f('0xb')](',\x20');logger[_0x2e3f('0xc')](config[_0x2e3f('0x9')][_0x2e3f('0xa')],_0x2e3f('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0xe5c2c9){return AES_SUPPORTED_RX[_0x2e3f('0xe')](_0xe5c2c9);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x2e3f('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0xb677ce){return getSupportedCiphers()['indexOf'](_0xb677ce)>-0x1;}function combineOptions(_0x8d9999){var _0x28b07d={};for(var _0x523887 in fileOptions){if(fileOptions[_0x2e3f('0x10')](_0x523887)){_0x28b07d[_0x523887]=fileOptions[_0x523887];}}if(_0x8d9999){for(var _0x3b28b7 in _0x8d9999){if(_0x8d9999[_0x2e3f('0x10')](_0x3b28b7)){_0x28b07d[_0x3b28b7]=_0x8d9999[_0x3b28b7];}}}return _0x28b07d;}exports[_0x2e3f('0x11')]=function(_0x1b4233,_0x18b77d,_0x3b4904,_0x16c586){return new BPromise(function(_0x1cf84a,_0x5bcb22){_0x16c586=combineOptions(_0x16c586);var _0x682dc=new Buffer(_0x3b4904);var _0x2aace3=fs['createReadStream'](_0x1b4233);var _0x5996e9=fs['createWriteStream'](_0x18b77d);var _0x4655ac=crypto[_0x2e3f('0x12')](_0x16c586[_0x2e3f('0xa')],_0x682dc);_0x2aace3['on'](_0x2e3f('0x13'),function(_0x181018){var _0x364d24=new Buffer(_0x4655ac['update'](_0x181018),_0x2e3f('0x14'));_0x5996e9[_0x2e3f('0x15')](_0x364d24);});_0x2aace3['on'](_0x2e3f('0x16'),function(){try{var _0x319e66=new Buffer(_0x4655ac[_0x2e3f('0x17')](_0x2e3f('0x14')),'binary');_0x5996e9[_0x2e3f('0x15')](_0x319e66);_0x5996e9['end']();_0x5996e9['on'](_0x2e3f('0x18'),function(){return _0x1cf84a(_0x18b77d);});}catch(_0x1af0ad){fs['unlink'](_0x18b77d);return _0x5bcb22(_0x1af0ad);}});});};exports['decryptFile']=function(_0x415097,_0x39153a,_0x3a2265,_0x44befe){return new BPromise(function(_0x17b033,_0x4f1bee){_0x44befe=combineOptions(_0x44befe);var _0x301daa=new Buffer(_0x3a2265);var _0x311336=fs[_0x2e3f('0x19')](_0x415097);var _0x2265cb=fs['createWriteStream'](_0x39153a);var _0x4c6c44=crypto['createDecipher'](_0x44befe['algorithm'],_0x301daa);_0x311336['on']('data',function(_0x268daf){var _0x1e9745=new Buffer(_0x4c6c44[_0x2e3f('0x1a')](_0x268daf),'binary');_0x2265cb[_0x2e3f('0x15')](_0x1e9745);});_0x311336['on'](_0x2e3f('0x16'),function(){try{var _0x53eedd=new Buffer(_0x4c6c44['final'](_0x2e3f('0x14')),'binary');_0x2265cb[_0x2e3f('0x15')](_0x53eedd);_0x2265cb['end']();_0x2265cb['on'](_0x2e3f('0x18'),function(){return _0x17b033(_0x39153a);});}catch(_0x28c839){fs[_0x2e3f('0x1b')](_0x39153a);return _0x4f1bee(_0x28c839);}});});};exports[_0x2e3f('0x1c')]=function(_0x251f17,_0x5e6195,_0x497d6c){var _0x194627=_0x497d6c||stringOptions[_0x2e3f('0xa')];var _0x1e8dd9=_0x5e6195||stringOptions[_0x2e3f('0x1d')];var _0x270d48=crypto[_0x2e3f('0x12')](_0x194627,_0x1e8dd9);var _0x23c797=_0x270d48[_0x2e3f('0x1a')](_0x251f17,'utf8',_0x2e3f('0x1e'));_0x23c797+=_0x270d48[_0x2e3f('0x17')](_0x2e3f('0x1e'));return _0x23c797;};exports[_0x2e3f('0x1f')]=function(_0x551dbe,_0x1314ac,_0x1427e9){var _0x295e5e=_0x1427e9||stringOptions[_0x2e3f('0xa')];var _0x2814aa=_0x1314ac||stringOptions[_0x2e3f('0x1d')];var _0x49634d=crypto[_0x2e3f('0x20')](_0x295e5e,_0x2814aa);var _0x56a7d0=_0x49634d[_0x2e3f('0x1a')](_0x551dbe,_0x2e3f('0x1e'),_0x2e3f('0x21'));_0x56a7d0+=_0x49634d[_0x2e3f('0x17')](_0x2e3f('0x21'));return _0x56a7d0;};
\ No newline at end of file
+var _0x97cc=['secret','base64','decryptString','utf8','bluebird','../../config/environment','../../config/logger','app','session','aes192','encrypt','algorithm','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','write','end','final','unlink','decryptFile','createDecipher','close','encryptString'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x97cc,0x14e));var _0xc97c=function(_0x16520c,_0x138df9){_0x16520c=_0x16520c-0x0;var _0x2489cd=_0x97cc[_0x16520c];return _0x2489cd;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0xc97c('0x0'));var _=require('lodash');var config=require(_0xc97c('0x1'));var logger=require(_0xc97c('0x2'))(_0xc97c('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0xc97c('0x4')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0xc97c('0x5')};if(config[_0xc97c('0x6')]&&config[_0xc97c('0x6')][_0xc97c('0x7')]){var isSupported=isAlgorithmSupported(config[_0xc97c('0x6')][_0xc97c('0x7')]);if(isSupported){fileOptions[_0xc97c('0x7')]=config[_0xc97c('0x6')][_0xc97c('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger['error'](config[_0xc97c('0x6')]['algorithm'],_0xc97c('0x8'),supportedAlgorithms);}}function isASupportedCipher(_0x1a4bf6){return AES_SUPPORTED_RX[_0xc97c('0x9')](_0x1a4bf6);}function getSupportedCiphers(){return crypto[_0xc97c('0xa')]()[_0xc97c('0xb')](isASupportedCipher);}function isAlgorithmSupported(_0x19c137){return getSupportedCiphers()[_0xc97c('0xc')](_0x19c137)>-0x1;}function combineOptions(_0x4dee43){var _0x59ee09={};for(var _0x473c61 in fileOptions){if(fileOptions[_0xc97c('0xd')](_0x473c61)){_0x59ee09[_0x473c61]=fileOptions[_0x473c61];}}if(_0x4dee43){for(var _0x5dfe75 in _0x4dee43){if(_0x4dee43[_0xc97c('0xd')](_0x5dfe75)){_0x59ee09[_0x5dfe75]=_0x4dee43[_0x5dfe75];}}}return _0x59ee09;}exports[_0xc97c('0xe')]=function(_0x9841e1,_0x2a322b,_0x249930,_0x14da37){return new BPromise(function(_0x4f41b9,_0x373e40){_0x14da37=combineOptions(_0x14da37);var _0x55490e=new Buffer(_0x249930);var _0x3f44aa=fs[_0xc97c('0xf')](_0x9841e1);var _0x2b203b=fs[_0xc97c('0x10')](_0x2a322b);var _0xbe34f0=crypto[_0xc97c('0x11')](_0x14da37[_0xc97c('0x7')],_0x55490e);_0x3f44aa['on'](_0xc97c('0x12'),function(_0x19682){var _0x24be24=new Buffer(_0xbe34f0[_0xc97c('0x13')](_0x19682),_0xc97c('0x14'));_0x2b203b[_0xc97c('0x15')](_0x24be24);});_0x3f44aa['on'](_0xc97c('0x16'),function(){try{var _0x4a6d76=new Buffer(_0xbe34f0[_0xc97c('0x17')]('binary'),_0xc97c('0x14'));_0x2b203b[_0xc97c('0x15')](_0x4a6d76);_0x2b203b[_0xc97c('0x16')]();_0x2b203b['on']('close',function(){return _0x4f41b9(_0x2a322b);});}catch(_0x244f30){fs[_0xc97c('0x18')](_0x2a322b);return _0x373e40(_0x244f30);}});});};exports[_0xc97c('0x19')]=function(_0x3dcee5,_0x69fb95,_0x16fba7,_0x2dcce0){return new BPromise(function(_0x30e8a5,_0x536b72){_0x2dcce0=combineOptions(_0x2dcce0);var _0xc4da31=new Buffer(_0x16fba7);var _0x198c2d=fs['createReadStream'](_0x3dcee5);var _0x5ff95=fs[_0xc97c('0x10')](_0x69fb95);var _0x281f10=crypto[_0xc97c('0x1a')](_0x2dcce0[_0xc97c('0x7')],_0xc4da31);_0x198c2d['on'](_0xc97c('0x12'),function(_0x13b305){var _0x53792f=new Buffer(_0x281f10['update'](_0x13b305),_0xc97c('0x14'));_0x5ff95[_0xc97c('0x15')](_0x53792f);});_0x198c2d['on'](_0xc97c('0x16'),function(){try{var _0x13b923=new Buffer(_0x281f10['final'](_0xc97c('0x14')),_0xc97c('0x14'));_0x5ff95['write'](_0x13b923);_0x5ff95['end']();_0x5ff95['on'](_0xc97c('0x1b'),function(){return _0x30e8a5(_0x69fb95);});}catch(_0x25beb5){fs[_0xc97c('0x18')](_0x69fb95);return _0x536b72(_0x25beb5);}});});};exports[_0xc97c('0x1c')]=function(_0x45554f,_0xac5b30,_0x1d4aab){var _0x1e9098=_0x1d4aab||stringOptions[_0xc97c('0x7')];var _0x9ee3b5=_0xac5b30||stringOptions[_0xc97c('0x1d')];var _0xe6cd82=crypto[_0xc97c('0x11')](_0x1e9098,_0x9ee3b5);var _0x29bf7b=_0xe6cd82[_0xc97c('0x13')](_0x45554f,'utf8',_0xc97c('0x1e'));_0x29bf7b+=_0xe6cd82['final']('base64');return _0x29bf7b;};exports[_0xc97c('0x1f')]=function(_0x14d324,_0x2beeed,_0x27a382){var _0xbcf9a1=_0x27a382||stringOptions[_0xc97c('0x7')];var _0x620446=_0x2beeed||stringOptions[_0xc97c('0x1d')];var _0x4e7ac4=crypto[_0xc97c('0x1a')](_0xbcf9a1,_0x620446);var _0x205e98=_0x4e7ac4['update'](_0x14d324,_0xc97c('0x1e'),_0xc97c('0x20'));_0x205e98+=_0x4e7ac4[_0xc97c('0x17')]('utf8');return _0x205e98;};
\ No newline at end of file
index 4c6511b..0178cbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e7d=['savename','AnalyticExtractedReport','update','info','format','Setting','find','split','splitSizeCsv','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','length','range','isInteger','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','basename','.csv','existsSync','each','join','%s%d.%s','csv','writeFileSync','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','rimraf','../../mysqldb','dbH','analytics','argv'];(function(_0x21ce77,_0x1d9229){var _0x49f171=function(_0x49f224){while(--_0x49f224){_0x21ce77['push'](_0x21ce77['shift']());}};_0x49f171(++_0x1d9229);}(_0x6e7d,0xed));var _0xd6e7=function(_0x218036,_0x810206){_0x218036=_0x218036-0x0;var _0x410dc5=_0x6e7d[_0x218036];return _0x410dc5;};'use strict';var util=require(_0xd6e7('0x0'));var path=require(_0xd6e7('0x1'));var _=require(_0xd6e7('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0xd6e7('0x3'));var db=require(_0xd6e7('0x4'))['db'];var dbH=require(_0xd6e7('0x4'))[_0xd6e7('0x5')];var logger=require('../../config/logger')(_0xd6e7('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0xd6e7('0x7')][0x2]);var QUERY=process[_0xd6e7('0x7')][0x3];var PATH=process[_0xd6e7('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x39faae,_0x91ec4e){var _0x5d93b2={'status':_0x39faae};var _0x244f34={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x91ec4e){_0x5d93b2[_0xd6e7('0x8')]=_0x91ec4e;}return db[_0xd6e7('0x9')][_0xd6e7('0xa')](_0x5d93b2,_0x244f34);}function main(){var _0x4dbfc4=0x1388;var _0x566e29;logger[_0xd6e7('0xb')](util[_0xd6e7('0xc')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'));return db[_0xd6e7('0xd')][_0xd6e7('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xd6e7('0xf'),_0xd6e7('0x10')]})['then'](function(_0x5b7a3e){if(_0x5b7a3e){_0x566e29=_0x5b7a3e;_0x4dbfc4=_0x566e29[_0xd6e7('0x10')]||0x1388;}})[_0xd6e7('0x11')](function(){return dbH[_0xd6e7('0x12')]['query'](util['format'](_0xd6e7('0x13'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0xd6e7('0x14')]});})['then'](function(_0x2ca9e2){if(!_0x2ca9e2[0x0][_0xd6e7('0x15')]){return analyticExtractedReport(_0xd6e7('0x16'));}var _0x254776=[];var _0x416e2c=0x0;if(_0x566e29[_0xd6e7('0xf')]){if(_0x2ca9e2&&_0x2ca9e2[_0xd6e7('0x17')]){var _0x13e0bc=_[_0xd6e7('0x18')](_0x2ca9e2[0x0][_0xd6e7('0x15')]/_0x4dbfc4);var _0x369fbc=Number[_0xd6e7('0x19')](_0x2ca9e2[0x0][_0xd6e7('0x15')]/_0x4dbfc4)?_0x2ca9e2[0x0][_0xd6e7('0x15')]%_0x4dbfc4:0x0;_0x13e0bc[_0xd6e7('0x1a')](function(_0x113439){if(_0x113439>0x0){_0x416e2c+=_0x4dbfc4;}_0x254776[_0xd6e7('0x1b')](dbH[_0xd6e7('0x12')][_0xd6e7('0x1c')](util[_0xd6e7('0xc')](_0xd6e7('0x1d'),QUERY,_0x4dbfc4,_0x416e2c),{'type':dbH[_0xd6e7('0x12')][_0xd6e7('0x1e')]['SELECT']}));});if(_0x369fbc>0x0){_0x416e2c+=_0x4dbfc4;_0x254776[_0xd6e7('0x1b')](dbH[_0xd6e7('0x12')][_0xd6e7('0x1c')](util[_0xd6e7('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x369fbc,_0x416e2c),{'type':dbH['sequelize']['QueryTypes'][_0xd6e7('0x14')]}));}}}else{_0x254776[_0xd6e7('0x1b')](dbH[_0xd6e7('0x12')][_0xd6e7('0x1c')](QUERY,{'type':dbH['sequelize'][_0xd6e7('0x1e')][_0xd6e7('0x14')]}));}var _0x42ba82=path['dirname'](PATH);var _0x5b04ba=path[_0xd6e7('0x1f')](PATH,_0xd6e7('0x20'));var _0x19b983=_0x566e29[_0xd6e7('0xf')]&&_0x254776['length']>0x1;var _0x309f3b=[];if(!fs[_0xd6e7('0x21')](path['join'](_0x42ba82,_0x5b04ba))&&_0x19b983){fs['mkdirSync'](path['join'](_0x42ba82,_0x5b04ba));}return BPromise[_0xd6e7('0x22')](_0x254776,function(_0x150d88){_0x309f3b[_0xd6e7('0x1b')](_0x150d88);})['then'](function(){for(var _0x5062b0=0x0;_0x5062b0<_0x309f3b[_0xd6e7('0x17')];_0x5062b0+=0x1){var _0x2aa775;var _0x5c700c=_0x309f3b[_0x5062b0];if(_0x19b983){_0x2aa775=path[_0xd6e7('0x23')](_0x42ba82,_0x5b04ba,util['format'](_0xd6e7('0x24'),_0x5b04ba,_0x5062b0,'csv'));}else{_0x2aa775=path[_0xd6e7('0x23')](_0x42ba82,util['format']('%s.%s',_0x5b04ba,_0xd6e7('0x25')));}fs[_0xd6e7('0x26')](_0x2aa775,csv(_0x5c700c));}})[_0xd6e7('0x11')](function(){if(_0x19b983){return new Promise(function(_0x43ce5f){zipdir(path[_0xd6e7('0x23')](_0x42ba82,_0x5b04ba),{'saveTo':path[_0xd6e7('0x23')](_0x42ba82,util['format'](_0xd6e7('0x27'),_0x5b04ba,_0xd6e7('0x28')))},function(_0x529b12,_0x450466){rimraf(path[_0xd6e7('0x23')](_0x42ba82,_0x5b04ba),function(){});_0x43ce5f(_0xd6e7('0x29'));});});}})[_0xd6e7('0x11')](function(){logger[_0xd6e7('0xb')](util[_0xd6e7('0xc')](_0xd6e7('0x2a'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport('Completed',_0x19b983?util[_0xd6e7('0xc')](_0xd6e7('0x27'),_0x5b04ba,_0x19b983?_0xd6e7('0x28'):'csv'):null);});})[_0xd6e7('0x2b')](function(_0x4b94fd){logger[_0xd6e7('0xb')](util['format'](_0xd6e7('0x2c'),EXTRACTED_REPORT_ID,'CSV'),util[_0xd6e7('0x2d')](_0x4b94fd,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xd6e7('0x2e'));})[_0xd6e7('0x2f')](function(){process[_0xd6e7('0x30')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0x41da=['push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','dirname','basename','.csv','existsSync','join','mkdirSync','each','length','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','inspect','Failed','finally','exit','util','path','lodash','to-csv','bluebird','rimraf','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','then','splitSizeCsv','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','num','Empty','range','isInteger','forEach'];(function(_0x7148a3,_0x1c6652){var _0x52f31d=function(_0x31c8a7){while(--_0x31c8a7){_0x7148a3['push'](_0x7148a3['shift']());}};_0x52f31d(++_0x1c6652);}(_0x41da,0x175));var _0xa41d=function(_0x360484,_0x2d14e5){_0x360484=_0x360484-0x0;var _0x461a10=_0x41da[_0x360484];return _0x461a10;};'use strict';var util=require(_0xa41d('0x0'));var path=require(_0xa41d('0x1'));var _=require(_0xa41d('0x2'));var csv=require(_0xa41d('0x3'));var fs=require('fs');var BPromise=require(_0xa41d('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0xa41d('0x5'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xa41d('0x6')];var logger=require(_0xa41d('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xa41d('0x8')][0x3];var PATH=process[_0xa41d('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1b18d5,_0x52a0e6){var _0x36794b={'status':_0x1b18d5};var _0x4db495={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x52a0e6){_0x36794b[_0xa41d('0x9')]=_0x52a0e6;}return db[_0xa41d('0xa')]['update'](_0x36794b,_0x4db495);}function main(){var _0x30d0e7=0x1388;var _0x571fcd;logger[_0xa41d('0xb')](util[_0xa41d('0xc')](_0xa41d('0xd'),EXTRACTED_REPORT_ID,_0xa41d('0xe')));return db[_0xa41d('0xf')][_0xa41d('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa41d('0x11'),'splitSizeCsv']})[_0xa41d('0x12')](function(_0x19187b){if(_0x19187b){_0x571fcd=_0x19187b;_0x30d0e7=_0x571fcd[_0xa41d('0x13')]||0x1388;}})[_0xa41d('0x12')](function(){return dbH[_0xa41d('0x14')]['query'](util[_0xa41d('0xc')](_0xa41d('0x15'),QUERY),{'type':dbH[_0xa41d('0x14')]['QueryTypes']['SELECT']});})['then'](function(_0x16e5c3){if(!_0x16e5c3[0x0][_0xa41d('0x16')]){return analyticExtractedReport(_0xa41d('0x17'));}var _0x21f9b9=[];var _0x3c86fd=0x0;if(_0x571fcd[_0xa41d('0x11')]){if(_0x16e5c3&&_0x16e5c3['length']){var _0x73c9c0=_[_0xa41d('0x18')](_0x16e5c3[0x0][_0xa41d('0x16')]/_0x30d0e7);var _0x2cb1fb=Number[_0xa41d('0x19')](_0x16e5c3[0x0][_0xa41d('0x16')]/_0x30d0e7)?_0x16e5c3[0x0][_0xa41d('0x16')]%_0x30d0e7:0x0;_0x73c9c0[_0xa41d('0x1a')](function(_0x2c5d09){if(_0x2c5d09>0x0){_0x3c86fd+=_0x30d0e7;}_0x21f9b9[_0xa41d('0x1b')](dbH[_0xa41d('0x14')][_0xa41d('0x1c')](util[_0xa41d('0xc')](_0xa41d('0x1d'),QUERY,_0x30d0e7,_0x3c86fd),{'type':dbH['sequelize']['QueryTypes'][_0xa41d('0x1e')]}));});if(_0x2cb1fb>0x0){_0x3c86fd+=_0x30d0e7;_0x21f9b9['push'](dbH['sequelize']['query'](util[_0xa41d('0xc')](_0xa41d('0x1d'),QUERY,_0x2cb1fb,_0x3c86fd),{'type':dbH[_0xa41d('0x14')][_0xa41d('0x1f')][_0xa41d('0x1e')]}));}}}else{_0x21f9b9[_0xa41d('0x1b')](dbH[_0xa41d('0x14')][_0xa41d('0x1c')](QUERY,{'type':dbH['sequelize'][_0xa41d('0x1f')][_0xa41d('0x1e')]}));}var _0x3fbf19=path[_0xa41d('0x20')](PATH);var _0x4fedab=path[_0xa41d('0x21')](PATH,_0xa41d('0x22'));var _0x173359=_0x571fcd[_0xa41d('0x11')]&&_0x21f9b9['length']>0x1;var _0x4629af=[];if(!fs[_0xa41d('0x23')](path[_0xa41d('0x24')](_0x3fbf19,_0x4fedab))&&_0x173359){fs[_0xa41d('0x25')](path[_0xa41d('0x24')](_0x3fbf19,_0x4fedab));}return BPromise[_0xa41d('0x26')](_0x21f9b9,function(_0x1d28f1){_0x4629af['push'](_0x1d28f1);})[_0xa41d('0x12')](function(){for(var _0x5cc634=0x0;_0x5cc634<_0x4629af[_0xa41d('0x27')];_0x5cc634+=0x1){var _0x1d48db;var _0x3cfbde=_0x4629af[_0x5cc634];if(_0x173359){_0x1d48db=path[_0xa41d('0x24')](_0x3fbf19,_0x4fedab,util[_0xa41d('0xc')]('%s%d.%s',_0x4fedab,_0x5cc634,_0xa41d('0x28')));}else{_0x1d48db=path[_0xa41d('0x24')](_0x3fbf19,util[_0xa41d('0xc')](_0xa41d('0x29'),_0x4fedab,_0xa41d('0x28')));}fs[_0xa41d('0x2a')](_0x1d48db,csv(_0x3cfbde));}})['then'](function(){if(_0x173359){return new Promise(function(_0x25f625){zipdir(path[_0xa41d('0x24')](_0x3fbf19,_0x4fedab),{'saveTo':path['join'](_0x3fbf19,util[_0xa41d('0xc')]('%s.%s',_0x4fedab,_0xa41d('0x2b')))},function(_0x4bc8be,_0x168412){rimraf(path[_0xa41d('0x24')](_0x3fbf19,_0x4fedab),function(){});_0x25f625(_0xa41d('0x2c'));});});}})[_0xa41d('0x12')](function(){logger[_0xa41d('0xb')](util['format'](_0xa41d('0x2d'),EXTRACTED_REPORT_ID,_0xa41d('0xe')));return analyticExtractedReport('Completed',_0x173359?util[_0xa41d('0xc')]('%s.%s',_0x4fedab,_0x173359?'zip':_0xa41d('0x28')):null);});})['catch'](function(_0x14b8a9){logger[_0xa41d('0xb')](util[_0xa41d('0xc')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'),util[_0xa41d('0x2e')](_0x14b8a9,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xa41d('0x2f'));})[_0xa41d('0x30')](function(){process[_0xa41d('0x31')](EXIT_CODE);});}main();
\ No newline at end of file
index 640712f..7087e0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf532=['basename','.pdf','existsSync','mkdirSync','join','each','flatten','createPdfKitDocument','pdf','%s.%s','all','zip','zip\x20finished','info','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','Arial','center','pipe','createWriteStream','finish','error','end','createPdfFromHTML','lodash','path','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','fill','length','body','push','concat','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','header','before','margin','landscape','footer','black','num','Empty','Setting','split','splitSizePdf','then','sequelize','query','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes'];(function(_0x50702f,_0x4f509a){var _0x38cc6a=function(_0x36e905){while(--_0x36e905){_0x50702f['push'](_0x50702f['shift']());}};_0x38cc6a(++_0x4f509a);}(_0xf532,0x186));var _0x2f53=function(_0x202c61,_0x3673e0){_0x202c61=_0x202c61-0x0;var _0x540691=_0xf532[_0x202c61];return _0x540691;};'use strict';var _=require(_0x2f53('0x0'));var fs=require('fs');var util=require('util');var path=require(_0x2f53('0x1'));var moment=require('moment');var htmlToPdfmake=require(_0x2f53('0x2'));var PdfPrinter=require(_0x2f53('0x3'));var zipdir=require(_0x2f53('0x4'));var rimraf=require(_0x2f53('0x5'));var JSDOM=require(_0x2f53('0x6'))[_0x2f53('0x7')];var window=new JSDOM('')[_0x2f53('0x8')];var BPromise=require(_0x2f53('0x9'));var db=require('../../mysqldb')['db'];var dbH=require(_0x2f53('0xa'))[_0x2f53('0xb')];var logger=require('../../config/logger')(_0x2f53('0xc'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x2f53('0xd')][0x3];var PATH=process[_0x2f53('0xd')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x2f53('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x29b47a,_0x6533c5){var _0x49b241={'status':_0x29b47a};var _0x15923c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x6533c5){_0x49b241['savename']=_0x6533c5;}return db[_0x2f53('0xf')][_0x2f53('0x10')](_0x49b241,_0x15923c);}function getHeaders(_0x573806){return _[_0x2f53('0x11')](_0x573806,function(_0x147426){return{'text':_0x147426,'style':_0x2f53('0x12')};});}function getRows(_0x473673,_0x5cae38){return _['map'](_0x5cae38,function(_0x3e0034){return _(_0x3e0034)[_0x2f53('0x13')](_0x473673)[_0x2f53('0x11')](function(_0x159e58){return _0x159e58?_[_0x2f53('0x14')](_0x159e58):'';})[_0x2f53('0x15')]();});}function createTable(_0x5032f1,_0x407439){var _0x35bbc0={'widths':_[_0x2f53('0x16')](Array(_0x5032f1[_0x2f53('0x17')]),0x91),'heights':function(_0x5ea63b){return _0x5ea63b===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x412c1d=getHeaders(_0x5032f1);_0x35bbc0[_0x2f53('0x18')][_0x2f53('0x19')](_0x412c1d);var _0x3c4026=getRows(_0x5032f1,_0x407439);_0x35bbc0[_0x2f53('0x18')]=_0x35bbc0['body'][_0x2f53('0x1a')](_0x3c4026);return _0x35bbc0;}function createTables(_0x325926){var _0xa6666d=[];var _0x115934=_['chunk'](Object[_0x2f53('0x1b')](_0x325926[0x0]),0x5);_0x115934[_0x2f53('0x1c')](function(_0x37fe18){_0xa6666d[_0x2f53('0x19')](createTable(_0x37fe18,_0x325926));});return _0xa6666d;}function getPDFDocDefinition(_0x2b25e7){var _0x23e712=util[_0x2f53('0x1d')](_0x2f53('0x1e'),NAME,EXTRACTED_REPORT[_0x2f53('0x1f')],moment(EXTRACTED_REPORT['startDate'])[_0x2f53('0x1d')](FORMAT),moment(EXTRACTED_REPORT[_0x2f53('0x20')])[_0x2f53('0x1d')](FORMAT));var _0x561b1d=[];for(var _0x1ba1a6=0x0;_0x1ba1a6<_0x2b25e7['length'];_0x1ba1a6++){var _0x581c03=[];if(_0x1ba1a6===0x0){_0x581c03[_0x2f53('0x19')]({'text':_0x23e712,'style':_0x2f53('0x21')});}var _0x48c7e7={'table':_0x2b25e7[_0x1ba1a6]};if(_0x1ba1a6>0x0){_0x48c7e7['pageBreak']=_0x2f53('0x22');_0x48c7e7[_0x2f53('0x23')]=[0x0,0x46,0x0,0x0];}_0x581c03['push'](_0x48c7e7);_0x561b1d[_0x2f53('0x19')](_0x581c03);}return{'pageSize':'A4','pageOrientation':_0x2f53('0x24'),'content':_0x561b1d,'footer':function(_0x3d6214,_0x2b9724){return{'text':_0x3d6214[_0x2f53('0x14')]()+'\x20/\x20'+_0x2b9724,'style':_0x2f53('0x25')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x2f53('0x26')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x28abd4){var _0xe38170=0x1388;var _0x4176f0;if(!_0x28abd4[0x0][_0x2f53('0x27')]){return analyticExtractedReport(_0x2f53('0x28'));}return db[_0x2f53('0x29')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x2f53('0x2a'),_0x2f53('0x2b')]})[_0x2f53('0x2c')](function(_0x2a610c){if(_0x2a610c){_0x4176f0=_0x2a610c;_0xe38170=_0x4176f0[_0x2f53('0x2b')]||0x3e8;}})['then'](function(){var _0x5c8b19=[];var _0x47b960=0x0;if(_0x4176f0['split']){if(_0x28abd4&&_0x28abd4[_0x2f53('0x17')]){var _0x5096af=_['range'](_0x28abd4[0x0][_0x2f53('0x27')]/_0xe38170);var _0x28544a=Number['isInteger'](_0x28abd4[0x0][_0x2f53('0x27')]/_0xe38170)?_0x28abd4[0x0][_0x2f53('0x27')]%_0xe38170:0x0;_0x5096af[_0x2f53('0x1c')](function(_0x11f08d){if(_0x11f08d>0x0){_0x47b960+=_0xe38170;}_0x5c8b19[_0x2f53('0x19')](dbH[_0x2f53('0x2d')][_0x2f53('0x2e')](util[_0x2f53('0x1d')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xe38170,_0x47b960),{'type':dbH[_0x2f53('0x2d')]['QueryTypes'][_0x2f53('0x2f')]}));});if(_0x28544a>0x0){_0x47b960+=_0xe38170;_0x5c8b19[_0x2f53('0x19')](dbH[_0x2f53('0x2d')][_0x2f53('0x2e')](util[_0x2f53('0x1d')](_0x2f53('0x30'),QUERY,_0x28544a,_0x47b960),{'type':dbH['sequelize'][_0x2f53('0x31')][_0x2f53('0x2f')]}));}}}else{_0x5c8b19[_0x2f53('0x19')](dbH['sequelize'][_0x2f53('0x2e')](QUERY,{'type':dbH[_0x2f53('0x2d')][_0x2f53('0x31')][_0x2f53('0x2f')]}));}var _0x4dc2f6=path['dirname'](PATH);var _0x3c9f66=path[_0x2f53('0x32')](PATH,_0x2f53('0x33'));var _0x2995c8=_0x4176f0['split']&&_0x5c8b19['length']>0x1;var _0x4a93b5=[];if(!fs[_0x2f53('0x34')](path['join'](_0x4dc2f6,_0x3c9f66))&&_0x2995c8){fs[_0x2f53('0x35')](path[_0x2f53('0x36')](_0x4dc2f6,_0x3c9f66));}return BPromise[_0x2f53('0x37')](_0x5c8b19,function(_0x507257){_0x4a93b5[_0x2f53('0x19')](_0x507257);})['then'](function(){var _0x534a29=[];for(var _0x2d3f10=0x0;_0x2d3f10<_0x4a93b5['length'];_0x2d3f10+=0x1){var _0x195236=_0x4a93b5[_0x2d3f10];var _0x224750=createTables(_[_0x2f53('0x38')](_0x195236));var _0x453c3c;var _0x4c82c2=getPDFDocDefinition(_0x224750);var _0x1749ee=getPDFPrinter();var _0x3563cb=_0x1749ee[_0x2f53('0x39')](_0x4c82c2);if(_0x2995c8){_0x453c3c=path[_0x2f53('0x36')](_0x4dc2f6,_0x3c9f66,util[_0x2f53('0x1d')]('%s%d.%s',_0x3c9f66,_0x2d3f10,_0x2f53('0x3a')));}else{_0x453c3c=path[_0x2f53('0x36')](_0x4dc2f6,util[_0x2f53('0x1d')](_0x2f53('0x3b'),_0x3c9f66,_0x2f53('0x3a')));}_0x534a29['push'](writePDFDocument(_0x3563cb,_0x453c3c));}return Promise[_0x2f53('0x3c')](_0x534a29);})['then'](function(){if(_0x2995c8){return new Promise(function(_0x2bffed){zipdir(path['join'](_0x4dc2f6,_0x3c9f66),{'saveTo':path[_0x2f53('0x36')](_0x4dc2f6,util[_0x2f53('0x1d')]('%s.%s',_0x3c9f66,_0x2f53('0x3d')))},function(){rimraf(path['join'](_0x4dc2f6,_0x3c9f66),function(){});_0x2bffed(_0x2f53('0x3e'));});});}})['then'](function(){if(!_0x2995c8)return;rimraf(path[_0x2f53('0x36')](_0x4dc2f6,_0x3c9f66),function(){});})['then'](function(){logger[_0x2f53('0x3f')](util[_0x2f53('0x1d')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x2f53('0x40')));return analyticExtractedReport(_0x2f53('0x41'),_0x2995c8?util[_0x2f53('0x1d')](_0x2f53('0x3b'),_0x3c9f66,_0x2995c8?_0x2f53('0x3d'):_0x2f53('0x3a')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x2f53('0x3f')](util['format'](_0x2f53('0x42'),EXTRACTED_REPORT_ID,_0x2f53('0x40')));return db[_0x2f53('0xf')][_0x2f53('0x43')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x2f53('0x2c')](function(_0x181ba9){EXTRACTED_REPORT=_0x181ba9;return dbH['sequelize'][_0x2f53('0x2e')](util[_0x2f53('0x1d')](_0x2f53('0x44'),QUERY),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})[_0x2f53('0x2c')](extractReport)[_0x2f53('0x45')](function(_0x5d3980){logger[_0x2f53('0x3f')](util['format'](_0x2f53('0x46'),EXTRACTED_REPORT_ID,_0x2f53('0x40')),util[_0x2f53('0x47')](_0x5d3980,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x2f53('0x48'));})[_0x2f53('0x49')](function(){process[_0x2f53('0x4a')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x413efc=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x2f53('0x4b'),'bolditalics':__dirname+_0x2f53('0x4c')}});return _0x413efc;}function getPDFDocDefinitionFromHTML(_0x5b0a85,_0x5806c4){var _0x27a120=util[_0x2f53('0x1d')](_0x2f53('0x4d'),_0x5806c4[_0x2f53('0x4e')],_0x5806c4[_0x2f53('0x4f')]);var _0x1c2835=moment()[_0x2f53('0x1d')]('YYYY-MM-DD')['toString']();var _0x3e6e52=htmlToPdfmake(_0x5b0a85,{'window':window,'tableAutoSize':!![]});return{'content':[_0x3e6e52],'defaultStyle':{'font':_0x2f53('0x50')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x2f53('0x51'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':'Interaction\x20Transcript','style':'header'}];},'footer':function(_0x24c225,_0x543c88){return[{'text':util['format']('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x27a120,_0x24c225,_0x543c88,_0x1c2835),'style':'footer'}];}};}function writePDFDocument(_0x3a02ae,_0x47b985){return new Promise(function(_0x4a9a70,_0x42ca6d){var _0x3fd6a0=_0x3a02ae[_0x2f53('0x52')](fs[_0x2f53('0x53')](_0x47b985));_0x3fd6a0['on'](_0x2f53('0x54'),function(){_0x4a9a70('finish');});_0x3fd6a0['on'](_0x2f53('0x55'),function(_0x2053cb){_0x42ca6d(_0x2053cb);});_0x3a02ae[_0x2f53('0x56')]();});}exports[_0x2f53('0x57')]=function(_0x5a225f,_0x3acda9){var _0x11bd4a=getPDFPrinter();var _0x4132ce=getPDFDocDefinitionFromHTML(_0x5a225f,_0x3acda9);var _0x48bac5=_0x11bd4a[_0x2f53('0x39')](_0x4132ce);return writePDFDocument(_0x48bac5,_0x3acda9['path'])['catch'](function(_0x307545){throw _0x307545;});};
\ No newline at end of file
+var _0x3a78=['%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','query','basename','.pdf','split','join','each','flatten','createPdfKitDocument','pdf','all','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','YYYY-MM-DD','toString','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','lodash','util','path','html-to-pdfmake','rimraf','jsdom','JSDOM','window','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','tableHeader','pick','auto','body','keys','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','length','header','pageBreak','margin','landscape','\x20/\x20','footer','Arial','black','right','Setting','find','splitSizePdf','then','range','num','sequelize'];(function(_0x29ba2c,_0x3d64b3){var _0x27f8a8=function(_0x1d735c){while(--_0x1d735c){_0x29ba2c['push'](_0x29ba2c['shift']());}};_0x27f8a8(++_0x3d64b3);}(_0x3a78,0x18f));var _0x83a7=function(_0x2a5099,_0x329e92){_0x2a5099=_0x2a5099-0x0;var _0x2802f1=_0x3a78[_0x2a5099];return _0x2802f1;};'use strict';var _=require(_0x83a7('0x0'));var fs=require('fs');var util=require(_0x83a7('0x1'));var path=require(_0x83a7('0x2'));var moment=require('moment');var htmlToPdfmake=require(_0x83a7('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require('zip-dir');var rimraf=require(_0x83a7('0x4'));var JSDOM=require(_0x83a7('0x5'))[_0x83a7('0x6')];var window=new JSDOM('')[_0x83a7('0x7')];var BPromise=require('bluebird');var db=require(_0x83a7('0x8'))['db'];var dbH=require(_0x83a7('0x8'))[_0x83a7('0x9')];var logger=require(_0x83a7('0xa'))(_0x83a7('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0x83a7('0xc')][0x2]);var QUERY=process[_0x83a7('0xc')][0x3];var PATH=process[_0x83a7('0xc')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x83a7('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x1ffeac,_0x34c1c7){var _0x5e1e87={'status':_0x1ffeac};var _0x472e59={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x34c1c7){_0x5e1e87[_0x83a7('0xe')]=_0x34c1c7;}return db[_0x83a7('0xf')]['update'](_0x5e1e87,_0x472e59);}function getHeaders(_0x2b288c){return _[_0x83a7('0x10')](_0x2b288c,function(_0x16efcd){return{'text':_0x16efcd,'style':_0x83a7('0x11')};});}function getRows(_0xfb08b0,_0x2e386c){return _['map'](_0x2e386c,function(_0x229b2c){return _(_0x229b2c)[_0x83a7('0x12')](_0xfb08b0)[_0x83a7('0x10')](function(_0x18a05f){return _0x18a05f?_['toString'](_0x18a05f):'';})['value']();});}function createTable(_0x5b2c32,_0x3c503d){var _0x5c473e={'widths':_['fill'](Array(_0x5b2c32['length']),0x91),'heights':function(_0x4690d0){return _0x4690d0===0x0?_0x83a7('0x13'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x208b77=getHeaders(_0x5b2c32);_0x5c473e[_0x83a7('0x14')]['push'](_0x208b77);var _0x4d20f3=getRows(_0x5b2c32,_0x3c503d);_0x5c473e[_0x83a7('0x14')]=_0x5c473e[_0x83a7('0x14')]['concat'](_0x4d20f3);return _0x5c473e;}function createTables(_0xec52b7){var _0x1c0318=[];var _0x3725ff=_['chunk'](Object[_0x83a7('0x15')](_0xec52b7[0x0]),0x5);_0x3725ff[_0x83a7('0x16')](function(_0xe9018d){_0x1c0318[_0x83a7('0x17')](createTable(_0xe9018d,_0xec52b7));});return _0x1c0318;}function getPDFDocDefinition(_0x3b1f99){var _0x2687bd=util[_0x83a7('0x18')](_0x83a7('0x19'),NAME,EXTRACTED_REPORT[_0x83a7('0x1a')],moment(EXTRACTED_REPORT[_0x83a7('0x1b')])[_0x83a7('0x18')](FORMAT),moment(EXTRACTED_REPORT[_0x83a7('0x1c')])['format'](FORMAT));var _0x5244f6=[];for(var _0x448b77=0x0;_0x448b77<_0x3b1f99[_0x83a7('0x1d')];_0x448b77++){var _0x22f490=[];if(_0x448b77===0x0){_0x22f490[_0x83a7('0x17')]({'text':_0x2687bd,'style':_0x83a7('0x1e')});}var _0x4f382f={'table':_0x3b1f99[_0x448b77]};if(_0x448b77>0x0){_0x4f382f[_0x83a7('0x1f')]='before';_0x4f382f[_0x83a7('0x20')]=[0x0,0x46,0x0,0x0];}_0x22f490['push'](_0x4f382f);_0x5244f6[_0x83a7('0x17')](_0x22f490);}return{'pageSize':'A4','pageOrientation':_0x83a7('0x21'),'content':_0x5244f6,'footer':function(_0x24d75f,_0x2c20af){return{'text':_0x24d75f['toString']()+_0x83a7('0x22')+_0x2c20af,'style':_0x83a7('0x23')};},'defaultStyle':{'font':_0x83a7('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x83a7('0x25')},'footer':{'alignment':_0x83a7('0x26'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x20d52f){var _0x2bb510=0x1388;var _0x375346;if(!_0x20d52f[0x0]['num']){return analyticExtractedReport('Empty');}return db[_0x83a7('0x27')][_0x83a7('0x28')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x83a7('0x29')]})['then'](function(_0x46d613){if(_0x46d613){_0x375346=_0x46d613;_0x2bb510=_0x375346[_0x83a7('0x29')]||0x3e8;}})[_0x83a7('0x2a')](function(){var _0x56ede3=[];var _0xf9c3cd=0x0;if(_0x375346['split']){if(_0x20d52f&&_0x20d52f[_0x83a7('0x1d')]){var _0x332476=_[_0x83a7('0x2b')](_0x20d52f[0x0][_0x83a7('0x2c')]/_0x2bb510);var _0x5db89a=Number['isInteger'](_0x20d52f[0x0][_0x83a7('0x2c')]/_0x2bb510)?_0x20d52f[0x0][_0x83a7('0x2c')]%_0x2bb510:0x0;_0x332476[_0x83a7('0x16')](function(_0x14bf17){if(_0x14bf17>0x0){_0xf9c3cd+=_0x2bb510;}_0x56ede3[_0x83a7('0x17')](dbH[_0x83a7('0x2d')]['query'](util[_0x83a7('0x18')](_0x83a7('0x2e'),QUERY,_0x2bb510,_0xf9c3cd),{'type':dbH[_0x83a7('0x2d')][_0x83a7('0x2f')][_0x83a7('0x30')]}));});if(_0x5db89a>0x0){_0xf9c3cd+=_0x2bb510;_0x56ede3['push'](dbH[_0x83a7('0x2d')]['query'](util['format'](_0x83a7('0x2e'),QUERY,_0x5db89a,_0xf9c3cd),{'type':dbH['sequelize'][_0x83a7('0x2f')][_0x83a7('0x30')]}));}}}else{_0x56ede3[_0x83a7('0x17')](dbH[_0x83a7('0x2d')][_0x83a7('0x31')](QUERY,{'type':dbH[_0x83a7('0x2d')][_0x83a7('0x2f')][_0x83a7('0x30')]}));}var _0x4a2b73=path['dirname'](PATH);var _0x484792=path[_0x83a7('0x32')](PATH,_0x83a7('0x33'));var _0x2dde80=_0x375346[_0x83a7('0x34')]&&_0x56ede3[_0x83a7('0x1d')]>0x1;var _0xa7ed6a=[];if(!fs['existsSync'](path[_0x83a7('0x35')](_0x4a2b73,_0x484792))&&_0x2dde80){fs['mkdirSync'](path['join'](_0x4a2b73,_0x484792));}return BPromise[_0x83a7('0x36')](_0x56ede3,function(_0xc98b72){_0xa7ed6a[_0x83a7('0x17')](_0xc98b72);})['then'](function(){var _0x1e7c86=[];for(var _0x2701a1=0x0;_0x2701a1<_0xa7ed6a[_0x83a7('0x1d')];_0x2701a1+=0x1){var _0x449ec4=_0xa7ed6a[_0x2701a1];var _0x179062=createTables(_[_0x83a7('0x37')](_0x449ec4));var _0x287baf;var _0x45c819=getPDFDocDefinition(_0x179062);var _0x502977=getPDFPrinter();var _0xe324ad=_0x502977[_0x83a7('0x38')](_0x45c819);if(_0x2dde80){_0x287baf=path['join'](_0x4a2b73,_0x484792,util[_0x83a7('0x18')]('%s%d.%s',_0x484792,_0x2701a1,_0x83a7('0x39')));}else{_0x287baf=path[_0x83a7('0x35')](_0x4a2b73,util[_0x83a7('0x18')]('%s.%s',_0x484792,_0x83a7('0x39')));}_0x1e7c86['push'](writePDFDocument(_0xe324ad,_0x287baf));}return Promise[_0x83a7('0x3a')](_0x1e7c86);})[_0x83a7('0x2a')](function(){if(_0x2dde80){return new Promise(function(_0x46964f){zipdir(path[_0x83a7('0x35')](_0x4a2b73,_0x484792),{'saveTo':path[_0x83a7('0x35')](_0x4a2b73,util[_0x83a7('0x18')](_0x83a7('0x3b'),_0x484792,_0x83a7('0x3c')))},function(){rimraf(path[_0x83a7('0x35')](_0x4a2b73,_0x484792),function(){});_0x46964f(_0x83a7('0x3d'));});});}})[_0x83a7('0x2a')](function(){if(!_0x2dde80)return;rimraf(path[_0x83a7('0x35')](_0x4a2b73,_0x484792),function(){});})[_0x83a7('0x2a')](function(){logger[_0x83a7('0x3e')](util[_0x83a7('0x18')](_0x83a7('0x3f'),EXTRACTED_REPORT_ID,_0x83a7('0x40')));return analyticExtractedReport(_0x83a7('0x41'),_0x2dde80?util[_0x83a7('0x18')](_0x83a7('0x3b'),_0x484792,_0x2dde80?_0x83a7('0x3c'):_0x83a7('0x39')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x83a7('0x3e')](util[_0x83a7('0x18')](_0x83a7('0x42'),EXTRACTED_REPORT_ID,_0x83a7('0x40')));return db[_0x83a7('0xf')][_0x83a7('0x43')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x5ed7d){EXTRACTED_REPORT=_0x5ed7d;return dbH[_0x83a7('0x2d')][_0x83a7('0x31')](util[_0x83a7('0x18')](_0x83a7('0x44'),QUERY),{'type':dbH[_0x83a7('0x2d')]['QueryTypes'][_0x83a7('0x30')]});})[_0x83a7('0x2a')](extractReport)[_0x83a7('0x45')](function(_0x399d42){logger[_0x83a7('0x3e')](util[_0x83a7('0x18')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x83a7('0x40')),util['inspect'](_0x399d42,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x83a7('0x46')](function(){process[_0x83a7('0x47')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x5caa6f=new PdfPrinter({'Arial':{'normal':__dirname+_0x83a7('0x48'),'bold':__dirname+_0x83a7('0x49'),'italics':__dirname+_0x83a7('0x4a'),'bolditalics':__dirname+_0x83a7('0x4b')}});return _0x5caa6f;}function getPDFDocDefinitionFromHTML(_0x316a0c,_0x27db91){var _0x2d7d3d=util[_0x83a7('0x18')](_0x83a7('0x4c'),_0x27db91[_0x83a7('0x4d')],_0x27db91['interactionId']);var _0x25dff7=moment()[_0x83a7('0x18')](_0x83a7('0x4e'))[_0x83a7('0x4f')]();var _0x596837=htmlToPdfmake(_0x316a0c,{'window':window,'tableAutoSize':!![]});return{'content':[_0x596837],'defaultStyle':{'font':_0x83a7('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x83a7('0x50'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x83a7('0x50')}},'header':function(){return[{'text':_0x83a7('0x51'),'style':'header'}];},'footer':function(_0x145dd1,_0x2e462f){return[{'text':util[_0x83a7('0x18')](_0x83a7('0x52'),_0x2d7d3d,_0x145dd1,_0x2e462f,_0x25dff7),'style':_0x83a7('0x23')}];}};}function writePDFDocument(_0x36292e,_0x130ddb){return new Promise(function(_0x32f06c,_0x815e31){var _0x4a8ab6=_0x36292e[_0x83a7('0x53')](fs[_0x83a7('0x54')](_0x130ddb));_0x4a8ab6['on']('finish',function(){_0x32f06c(_0x83a7('0x55'));});_0x4a8ab6['on'](_0x83a7('0x56'),function(_0x2de25d){_0x815e31(_0x2de25d);});_0x36292e[_0x83a7('0x57')]();});}exports[_0x83a7('0x58')]=function(_0x548c72,_0x12e934){var _0x5b6bc7=getPDFPrinter();var _0x45a028=getPDFDocDefinitionFromHTML(_0x548c72,_0x12e934);var _0x2d7ac1=_0x5b6bc7[_0x83a7('0x38')](_0x45a028);return writePDFDocument(_0x2d7ac1,_0x12e934[_0x83a7('0x2')])[_0x83a7('0x45')](function(_0x490fbc){throw _0x490fbc;});};
\ No newline at end of file
index 8c0ce76..38084d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd9b6=['json2xls','bluebird','rimraf','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Setting','find','split','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','SELECT','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','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','XLSX','inspect','Failed','finally','exit','util','path','lodash'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xd9b6,0x135));var _0x6d9b=function(_0x37dc1d,_0xbf91ef){_0x37dc1d=_0x37dc1d-0x0;var _0x4ac931=_0xd9b6[_0x37dc1d];return _0x4ac931;};'use strict';var util=require(_0x6d9b('0x0'));var path=require(_0x6d9b('0x1'));var _=require(_0x6d9b('0x2'));var fs=require('fs');var json2xls=require(_0x6d9b('0x3'));var BPromise=require(_0x6d9b('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x6d9b('0x5'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0x6d9b('0x6'))(_0x6d9b('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x6d9b('0x8')][0x2]);var QUERY=process[_0x6d9b('0x8')][0x3];var PATH=process[_0x6d9b('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x313b85,_0x21ab10){var _0x52b2c0={'status':_0x313b85};var _0x53b0b7={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x21ab10){_0x52b2c0['savename']=_0x21ab10;}return db[_0x6d9b('0x9')][_0x6d9b('0xa')](_0x52b2c0,_0x53b0b7);}function main(){var _0x2bd11f=0x1388;var _0x597cb0;logger[_0x6d9b('0xb')](util[_0x6d9b('0xc')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'));return db[_0x6d9b('0xd')][_0x6d9b('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6d9b('0xf'),'splitSizeXlsx']})[_0x6d9b('0x10')](function(_0x486fe9){if(_0x486fe9){_0x597cb0=_0x486fe9;_0x2bd11f=_0x597cb0['splitSizeXlsx']||0x1388;}})[_0x6d9b('0x10')](function(){return dbH['sequelize'][_0x6d9b('0x11')](util[_0x6d9b('0xc')](_0x6d9b('0x12'),QUERY),{'type':dbH[_0x6d9b('0x13')]['QueryTypes'][_0x6d9b('0x14')]});})[_0x6d9b('0x10')](function(_0x2e5b38){if(!_0x2e5b38[0x0][_0x6d9b('0x15')]){return analyticExtractedReport(_0x6d9b('0x16'));}var _0x28106c=[];var _0x56556c=0x0;if(_0x597cb0[_0x6d9b('0xf')]){if(_0x2e5b38&&_0x2e5b38[_0x6d9b('0x17')]){var _0x55c482=_[_0x6d9b('0x18')](_0x2e5b38[0x0][_0x6d9b('0x15')]/_0x2bd11f);var _0x335e11=Number[_0x6d9b('0x19')](_0x2e5b38[0x0]['num']/_0x2bd11f)?_0x2e5b38[0x0][_0x6d9b('0x15')]%_0x2bd11f:0x0;_0x55c482[_0x6d9b('0x1a')](function(_0x5a56c6){if(_0x5a56c6>0x0){_0x56556c+=_0x2bd11f;}_0x28106c[_0x6d9b('0x1b')](dbH[_0x6d9b('0x13')][_0x6d9b('0x11')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2bd11f,_0x56556c),{'type':dbH[_0x6d9b('0x13')]['QueryTypes'][_0x6d9b('0x14')]}));});if(_0x335e11>0x0){_0x56556c+=_0x2bd11f;_0x28106c[_0x6d9b('0x1b')](dbH['sequelize'][_0x6d9b('0x11')](util[_0x6d9b('0xc')](_0x6d9b('0x1c'),QUERY,_0x335e11,_0x56556c),{'type':dbH[_0x6d9b('0x13')]['QueryTypes'][_0x6d9b('0x14')]}));}}}else{_0x28106c[_0x6d9b('0x1b')](dbH[_0x6d9b('0x13')][_0x6d9b('0x11')](QUERY,{'type':dbH['sequelize'][_0x6d9b('0x1d')][_0x6d9b('0x14')]}));}var _0x4e5aa0=path[_0x6d9b('0x1e')](PATH);var _0x62dd88=path[_0x6d9b('0x1f')](PATH,_0x6d9b('0x20'));var _0x739b14=_0x597cb0[_0x6d9b('0xf')]&&_0x28106c[_0x6d9b('0x17')]>0x1;var _0x32f031=[];if(!fs[_0x6d9b('0x21')](path[_0x6d9b('0x22')](_0x4e5aa0,_0x62dd88))&&_0x739b14){fs[_0x6d9b('0x23')](path['join'](_0x4e5aa0,_0x62dd88));}return BPromise[_0x6d9b('0x24')](_0x28106c,function(_0x8e1e84){_0x32f031[_0x6d9b('0x1b')](_0x8e1e84);})[_0x6d9b('0x10')](function(){for(var _0x4fc46d=0x0;_0x4fc46d<_0x32f031[_0x6d9b('0x17')];_0x4fc46d+=0x1){var _0x1f22d3;var _0x3c497c=_0x32f031[_0x4fc46d];if(_0x739b14){_0x1f22d3=path[_0x6d9b('0x22')](_0x4e5aa0,_0x62dd88,util[_0x6d9b('0xc')](_0x6d9b('0x25'),_0x62dd88,_0x4fc46d,_0x6d9b('0x26')));}else{_0x1f22d3=path['join'](_0x4e5aa0,util[_0x6d9b('0xc')](_0x6d9b('0x27'),_0x62dd88,_0x6d9b('0x26')));}fs[_0x6d9b('0x28')](_0x1f22d3,json2xls(_0x3c497c),'binary');}})[_0x6d9b('0x10')](function(){if(_0x739b14){return new Promise(function(_0xaa9bf){zipdir(path['join'](_0x4e5aa0,_0x62dd88),{'saveTo':path[_0x6d9b('0x22')](_0x4e5aa0,util[_0x6d9b('0xc')](_0x6d9b('0x27'),_0x62dd88,'zip'))},function(_0x5ff404,_0x2f4c07){rimraf(path[_0x6d9b('0x22')](_0x4e5aa0,_0x62dd88),function(){});_0xaa9bf(_0x6d9b('0x29'));});});}})['then'](function(){logger[_0x6d9b('0xb')](util[_0x6d9b('0xc')](_0x6d9b('0x2a'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x6d9b('0x2b'),_0x739b14?util[_0x6d9b('0xc')](_0x6d9b('0x27'),_0x62dd88,_0x739b14?_0x6d9b('0x2c'):'xlsx'):null);});})[_0x6d9b('0x2d')](function(_0x564b7f){logger[_0x6d9b('0xb')](util['format'](_0x6d9b('0x2e'),EXTRACTED_REPORT_ID,_0x6d9b('0x2f')),util[_0x6d9b('0x30')](_0x564b7f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x6d9b('0x31'));})[_0x6d9b('0x32')](function(){process[_0x6d9b('0x33')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0x9da2=['savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','split','splitSizeXlsx','then','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','range','isInteger','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','join','mkdirSync','each','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','path','lodash','json2xls','bluebird','zip-dir','../../mysqldb','dbH','analytics','argv'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x9da2,0x15b));var _0x29da=function(_0x42b5ed,_0x6aafa7){_0x42b5ed=_0x42b5ed-0x0;var _0x4f24b0=_0x9da2[_0x42b5ed];return _0x4f24b0;};'use strict';var util=require(_0x29da('0x0'));var path=require(_0x29da('0x1'));var _=require(_0x29da('0x2'));var fs=require('fs');var json2xls=require(_0x29da('0x3'));var BPromise=require(_0x29da('0x4'));var zipdir=require(_0x29da('0x5'));var rimraf=require('rimraf');var db=require(_0x29da('0x6'))['db'];var dbH=require('../../mysqldb')[_0x29da('0x7')];var logger=require('../../config/logger')(_0x29da('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x29da('0x9')][0x2]);var QUERY=process[_0x29da('0x9')][0x3];var PATH=process[_0x29da('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4d05bd,_0x38096c){var _0xcc113b={'status':_0x4d05bd};var _0x150cba={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x38096c){_0xcc113b[_0x29da('0xa')]=_0x38096c;}return db[_0x29da('0xb')][_0x29da('0xc')](_0xcc113b,_0x150cba);}function main(){var _0x4693a2=0x1388;var _0x44ee21;logger[_0x29da('0xd')](util[_0x29da('0xe')](_0x29da('0xf'),EXTRACTED_REPORT_ID,_0x29da('0x10')));return db[_0x29da('0x11')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x29da('0x12'),_0x29da('0x13')]})[_0x29da('0x14')](function(_0xcb13cd){if(_0xcb13cd){_0x44ee21=_0xcb13cd;_0x4693a2=_0x44ee21[_0x29da('0x13')]||0x1388;}})[_0x29da('0x14')](function(){return dbH['sequelize']['query'](util[_0x29da('0xe')](_0x29da('0x15'),QUERY),{'type':dbH[_0x29da('0x16')][_0x29da('0x17')][_0x29da('0x18')]});})[_0x29da('0x14')](function(_0x35d3a7){if(!_0x35d3a7[0x0][_0x29da('0x19')]){return analyticExtractedReport(_0x29da('0x1a'));}var _0x117d62=[];var _0x5d8f26=0x0;if(_0x44ee21[_0x29da('0x12')]){if(_0x35d3a7&&_0x35d3a7['length']){var _0x2bd432=_[_0x29da('0x1b')](_0x35d3a7[0x0][_0x29da('0x19')]/_0x4693a2);var _0x1621df=Number[_0x29da('0x1c')](_0x35d3a7[0x0]['num']/_0x4693a2)?_0x35d3a7[0x0][_0x29da('0x19')]%_0x4693a2:0x0;_0x2bd432[_0x29da('0x1d')](function(_0x5cc50f){if(_0x5cc50f>0x0){_0x5d8f26+=_0x4693a2;}_0x117d62[_0x29da('0x1e')](dbH[_0x29da('0x16')][_0x29da('0x1f')](util[_0x29da('0xe')](_0x29da('0x20'),QUERY,_0x4693a2,_0x5d8f26),{'type':dbH[_0x29da('0x16')]['QueryTypes'][_0x29da('0x18')]}));});if(_0x1621df>0x0){_0x5d8f26+=_0x4693a2;_0x117d62[_0x29da('0x1e')](dbH[_0x29da('0x16')][_0x29da('0x1f')](util[_0x29da('0xe')](_0x29da('0x20'),QUERY,_0x1621df,_0x5d8f26),{'type':dbH[_0x29da('0x16')]['QueryTypes']['SELECT']}));}}}else{_0x117d62[_0x29da('0x1e')](dbH[_0x29da('0x16')]['query'](QUERY,{'type':dbH[_0x29da('0x16')][_0x29da('0x17')][_0x29da('0x18')]}));}var _0x17e559=path[_0x29da('0x21')](PATH);var _0x135c53=path[_0x29da('0x22')](PATH,_0x29da('0x23'));var _0xd37b83=_0x44ee21['split']&&_0x117d62['length']>0x1;var _0x401322=[];if(!fs['existsSync'](path[_0x29da('0x24')](_0x17e559,_0x135c53))&&_0xd37b83){fs[_0x29da('0x25')](path[_0x29da('0x24')](_0x17e559,_0x135c53));}return BPromise[_0x29da('0x26')](_0x117d62,function(_0x1a5966){_0x401322[_0x29da('0x1e')](_0x1a5966);})[_0x29da('0x14')](function(){for(var _0x255800=0x0;_0x255800<_0x401322['length'];_0x255800+=0x1){var _0x239a1d;var _0x58d273=_0x401322[_0x255800];if(_0xd37b83){_0x239a1d=path[_0x29da('0x24')](_0x17e559,_0x135c53,util['format']('%s%d.%s',_0x135c53,_0x255800,_0x29da('0x27')));}else{_0x239a1d=path[_0x29da('0x24')](_0x17e559,util[_0x29da('0xe')](_0x29da('0x28'),_0x135c53,_0x29da('0x27')));}fs[_0x29da('0x29')](_0x239a1d,json2xls(_0x58d273),_0x29da('0x2a'));}})[_0x29da('0x14')](function(){if(_0xd37b83){return new Promise(function(_0x513835){zipdir(path['join'](_0x17e559,_0x135c53),{'saveTo':path[_0x29da('0x24')](_0x17e559,util['format']('%s.%s',_0x135c53,_0x29da('0x2b')))},function(_0x34b488,_0x127980){rimraf(path[_0x29da('0x24')](_0x17e559,_0x135c53),function(){});_0x513835(_0x29da('0x2c'));});});}})[_0x29da('0x14')](function(){logger[_0x29da('0xd')](util[_0x29da('0xe')](_0x29da('0x2d'),EXTRACTED_REPORT_ID,_0x29da('0x10')));return analyticExtractedReport('Completed',_0xd37b83?util[_0x29da('0xe')](_0x29da('0x28'),_0x135c53,_0xd37b83?_0x29da('0x2b'):_0x29da('0x27')):null);});})[_0x29da('0x2e')](function(_0x5f3d00){logger[_0x29da('0xd')](util[_0x29da('0xe')](_0x29da('0x2f'),EXTRACTED_REPORT_ID,_0x29da('0x10')),util[_0x29da('0x30')](_0x5f3d00,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x29da('0x31'));})[_0x29da('0x32')](function(){process['exit'](EXIT_CODE);});}main();
\ No newline at end of file
index 1262b7a..effcf60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff74=['map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','push','Set','format','CDR(type)=%s','type','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','extension','${EXTEN:','${EXTEN}','ExecIf','cutdigits','CDR(prefix)=${EXTEN:0:','outboundrouteid=','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','recordingFormat','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','GotoIfTime','last','concat','Hangup','transaction','bulkCreate','sortBy','catch','error','lodash','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xff74,0xc1));var _0x4ff7=function(_0x6b4f52,_0x4a17d1){_0x6b4f52=_0x6b4f52-0x0;var _0xa387e5=_0xff74[_0x6b4f52];return _0xa387e5;};'use strict';var _=require(_0x4ff7('0x0'));var util=require('util');function rewrite(_0x198819,_0x719eca){var _0xb8a4a7=this;return _0x198819[_0x4ff7('0x1')][_0x4ff7('0x2')][_0x4ff7('0x3')]({'raw':!![]})[_0x4ff7('0x4')](function(_0x29c684){_0xb8a4a7[_0x4ff7('0x5')]=_0x29c684;return _0x198819[_0x4ff7('0x1')][_0x4ff7('0x6')][_0x4ff7('0x3')]({'where':{'IntervalId':_0x719eca[_0x4ff7('0x7')]},'raw':!![]});})[_0x4ff7('0x4')](function(_0x369fcf){return _0x198819['models'][_0x4ff7('0x6')][_0x4ff7('0x3')]({'where':{'exten':{'$in':_['uniq'](_[_0x4ff7('0x8')](_0x369fcf,_0x4ff7('0x9')))}},'order':[{'raw':_0x4ff7('0xa')}],'raw':!![]});})[_0x4ff7('0x4')](function(_0x348655){var _0x2994a1=_[_0x4ff7('0xb')](_0x348655,{'priority':'1'});var _0x1eb1ab=_['filter'](_0x348655,{'isApp':0x1});var _0xa29282=_[_0x4ff7('0xc')](_0x1eb1ab,_0x4ff7('0x9'));var _0x4d7824=[_0x4ff7('0xd'),_0x4ff7('0xe')];var _0x2d2bd5=[];var _0x4f6c91=[];for(var _0x589a1a in _0xa29282){if(_0xa29282[_0x4ff7('0xf')](_0x589a1a)){_0xb8a4a7[_0x4ff7('0x10')]=0x2;_0xb8a4a7[_0x4ff7('0x11')]=[];_0xb8a4a7['extension']=_['find'](_0x2994a1,{'exten':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x9')]});_0xb8a4a7[_0x4ff7('0x11')][_0x4ff7('0x12')]({'type':_0xa29282[_0x589a1a][0x0]['type'],'app':_0x4ff7('0x13'),'appdata':util[_0x4ff7('0x14')](_0x4ff7('0x15'),_0xa29282[_0x589a1a][0x0][_0x4ff7('0x16')]),'context':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x17')],'exten':_0xa29282[_0x589a1a][0x0]['exten'],'priority':_0xb8a4a7['priority']++,'VoiceExtensionId':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x18')]});if(_0xa29282[_0x589a1a][0x0][_0x4ff7('0x16')]===_0x4ff7('0x19')){_0xb8a4a7[_0x4ff7('0x11')][_0x4ff7('0x12')]({'type':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x16')],'app':_0x4ff7('0x13'),'appdata':_0x4ff7('0x1a')+_0xa29282[_0x589a1a][0x0]['VoiceExtensionId'],'context':_0xa29282[_0x589a1a][0x0]['context'],'exten':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x9')],'priority':_0xb8a4a7[_0x4ff7('0x10')]++,'VoiceExtensionId':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x18')]});}else if(_0xa29282[_0x589a1a][0x0][_0x4ff7('0x16')]===_0x4ff7('0x1b')){if(_0xb8a4a7[_0x4ff7('0x1c')]){_0xb8a4a7['extensions'][_0x4ff7('0x12')]({'type':_0xa29282[_0x589a1a][0x0]['type'],'app':'Set','appdata':'CDR(destination)='+(_0xb8a4a7[_0x4ff7('0x1c')]['cutdigits']?_0x4ff7('0x1d')+_0xb8a4a7[_0x4ff7('0x1c')]['cutdigits']+'}':_0x4ff7('0x1e')),'context':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x17')],'exten':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x9')],'priority':_0xb8a4a7[_0x4ff7('0x10')]++,'VoiceExtensionId':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x18')]});}_0xb8a4a7[_0x4ff7('0x11')][_0x4ff7('0x12')]({'type':_0xa29282[_0x589a1a][0x0]['type'],'app':_0x4ff7('0x13'),'appdata':'CDR(routeid)='+_0xa29282[_0x589a1a][0x0]['VoiceExtensionId'],'context':_0xa29282[_0x589a1a][0x0]['context'],'exten':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x9')],'priority':_0xb8a4a7[_0x4ff7('0x10')]++,'VoiceExtensionId':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x18')]});var _0x4c5147=_0xb8a4a7[_0x4ff7('0x10')]++;_0xb8a4a7[_0x4ff7('0x11')]['push']({'type':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x16')],'app':_0x4ff7('0x1f'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x4c5147+0x2)+'):Goto('+(_0x4c5147+0x1)+')','context':_0xa29282[_0x589a1a][0x0]['context'],'exten':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x9')],'priority':_0x4c5147,'VoiceExtensionId':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x18')]});if(_0xb8a4a7['extension']){_0xb8a4a7[_0x4ff7('0x11')]['push']({'type':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x16')],'app':_0x4ff7('0x13'),'appdata':_0xb8a4a7[_0x4ff7('0x1c')][_0x4ff7('0x20')]?_0x4ff7('0x21')+_0xb8a4a7[_0x4ff7('0x1c')][_0x4ff7('0x20')]+'}':'CDR(prefix)=noprefix','context':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x17')],'exten':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x9')],'priority':_0xb8a4a7[_0x4ff7('0x10')]++,'VoiceExtensionId':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x18')]});}_0xb8a4a7[_0x4ff7('0x11')][_0x4ff7('0x12')]({'type':_0xa29282[_0x589a1a][0x0]['type'],'app':_0x4ff7('0x13'),'appdata':_0x4ff7('0x22')+_0xa29282[_0x589a1a][0x0]['VoiceExtensionId'],'context':_0xa29282[_0x589a1a][0x0]['context'],'exten':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x9')],'priority':_0xb8a4a7[_0x4ff7('0x10')]++,'VoiceExtensionId':_0xa29282[_0x589a1a][0x0]['VoiceExtensionId']});if(_0xb8a4a7['extension']&&_0xb8a4a7[_0x4ff7('0x1c')][_0x4ff7('0xf')]('recordingFormat')&&_0xb8a4a7[_0x4ff7('0x1c')]['recordingFormat']!==_0x4ff7('0x23')){_0xb8a4a7['extensions'][_0x4ff7('0x12')]({'type':_0xa29282[_0x589a1a][0x0]['type'],'app':'Set','appdata':_0x4ff7('0x24'),'context':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x17')],'exten':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x9')],'priority':_0xb8a4a7[_0x4ff7('0x10')]++,'VoiceExtensionId':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x18')]});_0xb8a4a7[_0x4ff7('0x11')][_0x4ff7('0x12')]({'type':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x16')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0xb8a4a7[_0x4ff7('0x1c')][_0x4ff7('0x25')]||'wav','context':_0xa29282[_0x589a1a][0x0]['context'],'exten':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x9')],'priority':_0xb8a4a7[_0x4ff7('0x10')]++,'VoiceExtensionId':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x18')]});}}_0xb8a4a7[_0x4ff7('0x11')][_0x4ff7('0x12')]({'type':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x16')],'app':_0x4ff7('0x13'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x17')],'exten':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x9')],'priority':_0xb8a4a7[_0x4ff7('0x10')]++,'VoiceExtensionId':_0xa29282[_0x589a1a][0x0]['VoiceExtensionId']});_0xb8a4a7[_0x4ff7('0x11')][_0x4ff7('0x12')]({'type':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x16')],'app':'Set','appdata':_0x4ff7('0x26'),'context':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x17')],'exten':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x9')],'priority':_0xb8a4a7[_0x4ff7('0x10')]++,'VoiceExtensionId':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x18')]});_0xb8a4a7[_0x4ff7('0x11')][_0x4ff7('0x12')]({'type':_0xa29282[_0x589a1a][0x0]['type'],'app':_0x4ff7('0x13'),'appdata':_0x4ff7('0x27'),'context':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x17')],'exten':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x9')],'priority':_0xb8a4a7['priority']++,'VoiceExtensionId':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x18')]});for(var _0x47c7d2=0x0,_0x4f064b=0x0;_0x47c7d2<_0xa29282[_0x589a1a][_0x4ff7('0x28')];_0x47c7d2+=0x1,_0x4f064b=0x0){var _0xfbad60=_0xa29282[_0x589a1a][_0x47c7d2];if(_0xfbad60[_0x4ff7('0x16')]){_0xfbad60[_0x4ff7('0x16')]=_0xfbad60['type'][_0x4ff7('0x29')]();}var _0x971777=[];var _0x49bd5e=[];delete _0xfbad60['id'];delete _0xfbad60[_0x4ff7('0x2a')];delete _0xfbad60[_0x4ff7('0x2b')];var _0x23ab76=_0xfbad60[_0x4ff7('0x2c')]!==_0x4ff7('0x2d')?[_0xfbad60['interval']]:_0xfbad60['IntervalId']?_[_0x4ff7('0x8')](_[_0x4ff7('0xb')](_0xb8a4a7['intervals'],{'IntervalId':_0xfbad60[_0x4ff7('0x7')]}),_0x4ff7('0x2c')):[];if(_0xfbad60['hasOwnProperty'](_0x4ff7('0x2e'))){if(_0xfbad60['tag']&&_0xfbad60[_0x4ff7('0x2e')]!=='--'){_0x971777[_0x4ff7('0x12')]({'type':_0xfbad60[_0x4ff7('0x16')],'app':_0x4ff7('0x13'),'appdata':_0x4ff7('0x2f')+_0xfbad60[_0x4ff7('0x2e')],'context':_0xfbad60[_0x4ff7('0x17')],'exten':_0xfbad60[_0x4ff7('0x9')],'priority':_0x23ab76[_0x4ff7('0x28')]+_0xb8a4a7['priority']+_0x4f064b++,'VoiceExtensionId':_0xfbad60[_0x4ff7('0x18')]});}}if(_0xfbad60[_0x4ff7('0x16')]===_0x4ff7('0x1b')&&_0xfbad60['hasOwnProperty']('callerID')){if(_0xfbad60[_0x4ff7('0x30')]){_0x971777[_0x4ff7('0x12')]({'type':_0xfbad60[_0x4ff7('0x16')],'app':'ExecIf','appdata':_0x4ff7('0x31')+_0xfbad60[_0x4ff7('0x30')]+')','context':_0xfbad60[_0x4ff7('0x17')],'exten':_0xfbad60[_0x4ff7('0x9')],'priority':_0x23ab76['length']+_0xb8a4a7[_0x4ff7('0x10')]+_0x4f064b++,'VoiceExtensionId':_0xfbad60[_0x4ff7('0x18')]});}else{_0x971777[_0x4ff7('0x12')]({'type':_0xfbad60[_0x4ff7('0x16')],'app':'ExecIf','appdata':_0x4ff7('0x32'),'context':_0xfbad60[_0x4ff7('0x17')],'exten':_0xfbad60[_0x4ff7('0x9')],'priority':_0x23ab76[_0x4ff7('0x28')]+_0xb8a4a7[_0x4ff7('0x10')]+_0x4f064b++,'VoiceExtensionId':_0xfbad60[_0x4ff7('0x18')]});}}if(_0xfbad60[_0x4ff7('0xf')](_0x4ff7('0x33'))){if(_0x4d7824[_0x4ff7('0x34')](_0xfbad60[_0x4ff7('0x35')]['toLowerCase']())>=0x0&&_0xfbad60[_0x4ff7('0x36')]!=='custom'){if(_0xfbad60[_0x4ff7('0x33')]){_0x971777[_0x4ff7('0x12')]({'type':_0xfbad60[_0x4ff7('0x16')],'app':'ExecIf','appdata':_0x4ff7('0x37'),'context':_0xfbad60[_0x4ff7('0x17')],'exten':_0xfbad60['exten'],'priority':_0x23ab76[_0x4ff7('0x28')]+_0xb8a4a7['priority']+_0x4f064b++,'VoiceExtensionId':_0xfbad60[_0x4ff7('0x18')]});_0x971777['push']({'type':_0xfbad60[_0x4ff7('0x16')],'app':_0x4ff7('0x13'),'appdata':_0x4ff7('0x38'),'context':_0xfbad60['context'],'exten':_0xfbad60[_0x4ff7('0x9')],'priority':_0x23ab76[_0x4ff7('0x28')]+_0xb8a4a7[_0x4ff7('0x10')]+_0x4f064b++,'VoiceExtensionId':_0xfbad60['VoiceExtensionId']});}else{_0x971777[_0x4ff7('0x12')]({'type':_0xfbad60['type'],'app':_0x4ff7('0x1f'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0xfbad60[_0x4ff7('0x17')],'exten':_0xfbad60['exten'],'priority':_0x23ab76[_0x4ff7('0x28')]+_0xb8a4a7[_0x4ff7('0x10')]+_0x4f064b++,'VoiceExtensionId':_0xfbad60[_0x4ff7('0x18')]});_0x971777[_0x4ff7('0x12')]({'type':_0xfbad60[_0x4ff7('0x16')],'app':_0x4ff7('0x13'),'appdata':_0x4ff7('0x39'),'context':_0xfbad60[_0x4ff7('0x17')],'exten':_0xfbad60[_0x4ff7('0x9')],'priority':_0x23ab76['length']+_0xb8a4a7['priority']+_0x4f064b++,'VoiceExtensionId':_0xfbad60[_0x4ff7('0x18')]});}}}for(var _0x41001f=0x0;_0x41001f<_0x23ab76[_0x4ff7('0x28')];_0x41001f+=0x1){var _0x3ca158=_0xb8a4a7[_0x4ff7('0x10')]+_0x23ab76['length'];var _0x1b5ca5=_0x41001f===_0x23ab76[_0x4ff7('0x28')]-0x1?_0xb8a4a7[_0x4ff7('0x10')]+_0x971777['length']+_0x49bd5e[_0x4ff7('0x28')]+0x2:_0xb8a4a7[_0x4ff7('0x10')]+_0x41001f+0x1;_0x971777['splice'](_0x41001f,0x0,{'type':_0xfbad60[_0x4ff7('0x16')],'app':_0x4ff7('0x3a'),'appdata':_0x23ab76[_0x41001f]+'?'+_0xfbad60[_0x4ff7('0x17')]+',${EXTEN},'+_0x3ca158+':'+_0xfbad60[_0x4ff7('0x17')]+',${EXTEN},'+_0x1b5ca5,'exten':_0xfbad60[_0x4ff7('0x9')],'context':_0xfbad60['context'],'priority':_0xb8a4a7[_0x4ff7('0x10')]+_0x41001f,'VoiceExtensionId':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x18')]});}_0xfbad60[_0x4ff7('0x10')]=_0x971777[_0x4ff7('0x28')]?_[_0x4ff7('0x3b')](_0x971777)['priority']+0x1:_0xb8a4a7[_0x4ff7('0x10')];_0xb8a4a7[_0x4ff7('0x10')]=(_0x49bd5e[_0x4ff7('0x28')]?_[_0x4ff7('0x3b')](_0x49bd5e)[_0x4ff7('0x10')]:_0xfbad60[_0x4ff7('0x10')])+0x1;_0xb8a4a7[_0x4ff7('0x11')]=_[_0x4ff7('0x3c')](_0xb8a4a7['extensions'],_0x971777,[_0xfbad60],_0x49bd5e);}_0xb8a4a7['extensions'][_0x4ff7('0x12')]({'type':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x16')],'app':_0x4ff7('0x3d'),'exten':_0xa29282[_0x589a1a][0x0]['exten'],'context':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x17')],'priority':_0xb8a4a7[_0x4ff7('0x10')],'VoiceExtensionId':_0xa29282[_0x589a1a][0x0]['VoiceExtensionId']});_0x2d2bd5[_0x4ff7('0x12')](_0xa29282[_0x589a1a][0x0][_0x4ff7('0x18')]);_0x4f6c91=_['concat'](_0x4f6c91,_0xb8a4a7[_0x4ff7('0x11')]);}}return _0x198819[_0x4ff7('0x3e')](function(_0x3e7222){return _0x198819[_0x4ff7('0x1')]['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':{'$in':_0x2d2bd5}},'transaction':_0x3e7222})[_0x4ff7('0x4')](function(_0x274b33){return _0x198819[_0x4ff7('0x1')][_0x4ff7('0x6')][_0x4ff7('0x3f')](_[_0x4ff7('0x40')](_0x4f6c91,_0x4ff7('0x10')),{'transaction':_0x3e7222});});});})[_0x4ff7('0x41')](function(_0x357056){console[_0x4ff7('0x42')](_0x357056);});}exports['rewrite']=rewrite;
\ No newline at end of file
+var _0x83b3=['XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','Hangup','transaction','sortBy','rewrite','lodash','util','models','Interval','findAll','intervals','VoiceExtension','IntervalId','then','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','playback','hasOwnProperty','priority','extensions','extension','find','push','type','Set','format','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','*,*,*,*','interval','tag','callerID','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x83b3,0x153));var _0x383b=function(_0x30681f,_0x50eee2){_0x30681f=_0x30681f-0x0;var _0x17917c=_0x83b3[_0x30681f];return _0x17917c;};'use strict';var _=require(_0x383b('0x0'));var util=require(_0x383b('0x1'));function rewrite(_0x16da0d,_0x42b113){var _0x301e93=this;return _0x16da0d[_0x383b('0x2')][_0x383b('0x3')][_0x383b('0x4')]({'raw':!![]})['then'](function(_0x223664){_0x301e93[_0x383b('0x5')]=_0x223664;return _0x16da0d[_0x383b('0x2')][_0x383b('0x6')][_0x383b('0x4')]({'where':{'IntervalId':_0x42b113[_0x383b('0x7')]},'raw':!![]});})[_0x383b('0x8')](function(_0x27fdfb){return _0x16da0d[_0x383b('0x2')][_0x383b('0x6')][_0x383b('0x4')]({'where':{'exten':{'$in':_[_0x383b('0x9')](_[_0x383b('0xa')](_0x27fdfb,_0x383b('0xb')))}},'order':[{'raw':_0x383b('0xc')}],'raw':!![]});})[_0x383b('0x8')](function(_0x320244){var _0x2483aa=_[_0x383b('0xd')](_0x320244,{'priority':'1'});var _0x17a7a8=_[_0x383b('0xd')](_0x320244,{'isApp':0x1});var _0x2b2919=_['groupBy'](_0x17a7a8,_0x383b('0xb'));var _0x20f801=['queue',_0x383b('0xe')];var _0x43f169=[];var _0x4730af=[];for(var _0x140983 in _0x2b2919){if(_0x2b2919[_0x383b('0xf')](_0x140983)){_0x301e93[_0x383b('0x10')]=0x2;_0x301e93[_0x383b('0x11')]=[];_0x301e93[_0x383b('0x12')]=_[_0x383b('0x13')](_0x2483aa,{'exten':_0x2b2919[_0x140983][0x0][_0x383b('0xb')]});_0x301e93[_0x383b('0x11')][_0x383b('0x14')]({'type':_0x2b2919[_0x140983][0x0][_0x383b('0x15')],'app':_0x383b('0x16'),'appdata':util[_0x383b('0x17')]('CDR(type)=%s',_0x2b2919[_0x140983][0x0][_0x383b('0x15')]),'context':_0x2b2919[_0x140983][0x0][_0x383b('0x18')],'exten':_0x2b2919[_0x140983][0x0][_0x383b('0xb')],'priority':_0x301e93[_0x383b('0x10')]++,'VoiceExtensionId':_0x2b2919[_0x140983][0x0][_0x383b('0x19')]});if(_0x2b2919[_0x140983][0x0]['type']===_0x383b('0x1a')){_0x301e93['extensions'][_0x383b('0x14')]({'type':_0x2b2919[_0x140983][0x0]['type'],'app':'Set','appdata':_0x383b('0x1b')+_0x2b2919[_0x140983][0x0][_0x383b('0x19')],'context':_0x2b2919[_0x140983][0x0][_0x383b('0x18')],'exten':_0x2b2919[_0x140983][0x0]['exten'],'priority':_0x301e93[_0x383b('0x10')]++,'VoiceExtensionId':_0x2b2919[_0x140983][0x0][_0x383b('0x19')]});}else if(_0x2b2919[_0x140983][0x0]['type']===_0x383b('0x1c')){if(_0x301e93[_0x383b('0x12')]){_0x301e93[_0x383b('0x11')][_0x383b('0x14')]({'type':_0x2b2919[_0x140983][0x0][_0x383b('0x15')],'app':_0x383b('0x16'),'appdata':_0x383b('0x1d')+(_0x301e93['extension'][_0x383b('0x1e')]?_0x383b('0x1f')+_0x301e93['extension'][_0x383b('0x1e')]+'}':_0x383b('0x20')),'context':_0x2b2919[_0x140983][0x0][_0x383b('0x18')],'exten':_0x2b2919[_0x140983][0x0][_0x383b('0xb')],'priority':_0x301e93[_0x383b('0x10')]++,'VoiceExtensionId':_0x2b2919[_0x140983][0x0][_0x383b('0x19')]});}_0x301e93[_0x383b('0x11')][_0x383b('0x14')]({'type':_0x2b2919[_0x140983][0x0][_0x383b('0x15')],'app':_0x383b('0x16'),'appdata':_0x383b('0x1b')+_0x2b2919[_0x140983][0x0][_0x383b('0x19')],'context':_0x2b2919[_0x140983][0x0][_0x383b('0x18')],'exten':_0x2b2919[_0x140983][0x0][_0x383b('0xb')],'priority':_0x301e93[_0x383b('0x10')]++,'VoiceExtensionId':_0x2b2919[_0x140983][0x0][_0x383b('0x19')]});var _0x4bbffd=_0x301e93[_0x383b('0x10')]++;_0x301e93[_0x383b('0x11')][_0x383b('0x14')]({'type':_0x2b2919[_0x140983][0x0][_0x383b('0x15')],'app':_0x383b('0x21'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x4bbffd+0x2)+_0x383b('0x22')+(_0x4bbffd+0x1)+')','context':_0x2b2919[_0x140983][0x0][_0x383b('0x18')],'exten':_0x2b2919[_0x140983][0x0][_0x383b('0xb')],'priority':_0x4bbffd,'VoiceExtensionId':_0x2b2919[_0x140983][0x0][_0x383b('0x19')]});if(_0x301e93[_0x383b('0x12')]){_0x301e93['extensions'][_0x383b('0x14')]({'type':_0x2b2919[_0x140983][0x0][_0x383b('0x15')],'app':'Set','appdata':_0x301e93[_0x383b('0x12')][_0x383b('0x1e')]?'CDR(prefix)=${EXTEN:0:'+_0x301e93['extension'][_0x383b('0x1e')]+'}':_0x383b('0x23'),'context':_0x2b2919[_0x140983][0x0][_0x383b('0x18')],'exten':_0x2b2919[_0x140983][0x0][_0x383b('0xb')],'priority':_0x301e93[_0x383b('0x10')]++,'VoiceExtensionId':_0x2b2919[_0x140983][0x0][_0x383b('0x19')]});}_0x301e93['extensions'][_0x383b('0x14')]({'type':_0x2b2919[_0x140983][0x0][_0x383b('0x15')],'app':_0x383b('0x16'),'appdata':_0x383b('0x24')+_0x2b2919[_0x140983][0x0]['VoiceExtensionId'],'context':_0x2b2919[_0x140983][0x0][_0x383b('0x18')],'exten':_0x2b2919[_0x140983][0x0][_0x383b('0xb')],'priority':_0x301e93[_0x383b('0x10')]++,'VoiceExtensionId':_0x2b2919[_0x140983][0x0][_0x383b('0x19')]});if(_0x301e93['extension']&&_0x301e93[_0x383b('0x12')][_0x383b('0xf')](_0x383b('0x25'))&&_0x301e93[_0x383b('0x12')]['recordingFormat']!=='none'){_0x301e93[_0x383b('0x11')][_0x383b('0x14')]({'type':_0x2b2919[_0x140983][0x0][_0x383b('0x15')],'app':_0x383b('0x16'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x2b2919[_0x140983][0x0][_0x383b('0x18')],'exten':_0x2b2919[_0x140983][0x0][_0x383b('0xb')],'priority':_0x301e93[_0x383b('0x10')]++,'VoiceExtensionId':_0x2b2919[_0x140983][0x0][_0x383b('0x19')]});_0x301e93[_0x383b('0x11')][_0x383b('0x14')]({'type':_0x2b2919[_0x140983][0x0][_0x383b('0x15')],'app':_0x383b('0x16'),'appdata':_0x383b('0x26')+_0x301e93[_0x383b('0x12')][_0x383b('0x25')]||'wav','context':_0x2b2919[_0x140983][0x0]['context'],'exten':_0x2b2919[_0x140983][0x0][_0x383b('0xb')],'priority':_0x301e93[_0x383b('0x10')]++,'VoiceExtensionId':_0x2b2919[_0x140983][0x0]['VoiceExtensionId']});}}_0x301e93[_0x383b('0x11')][_0x383b('0x14')]({'type':_0x2b2919[_0x140983][0x0][_0x383b('0x15')],'app':'Set','appdata':_0x383b('0x27'),'context':_0x2b2919[_0x140983][0x0][_0x383b('0x18')],'exten':_0x2b2919[_0x140983][0x0]['exten'],'priority':_0x301e93[_0x383b('0x10')]++,'VoiceExtensionId':_0x2b2919[_0x140983][0x0]['VoiceExtensionId']});_0x301e93[_0x383b('0x11')]['push']({'type':_0x2b2919[_0x140983][0x0][_0x383b('0x15')],'app':_0x383b('0x16'),'appdata':_0x383b('0x28'),'context':_0x2b2919[_0x140983][0x0]['context'],'exten':_0x2b2919[_0x140983][0x0]['exten'],'priority':_0x301e93[_0x383b('0x10')]++,'VoiceExtensionId':_0x2b2919[_0x140983][0x0][_0x383b('0x19')]});_0x301e93[_0x383b('0x11')][_0x383b('0x14')]({'type':_0x2b2919[_0x140983][0x0][_0x383b('0x15')],'app':_0x383b('0x16'),'appdata':_0x383b('0x29'),'context':_0x2b2919[_0x140983][0x0][_0x383b('0x18')],'exten':_0x2b2919[_0x140983][0x0][_0x383b('0xb')],'priority':_0x301e93[_0x383b('0x10')]++,'VoiceExtensionId':_0x2b2919[_0x140983][0x0][_0x383b('0x19')]});for(var _0xc252f=0x0,_0x1fffeb=0x0;_0xc252f<_0x2b2919[_0x140983][_0x383b('0x2a')];_0xc252f+=0x1,_0x1fffeb=0x0){var _0x52ef2b=_0x2b2919[_0x140983][_0xc252f];if(_0x52ef2b[_0x383b('0x15')]){_0x52ef2b[_0x383b('0x15')]=_0x52ef2b[_0x383b('0x15')][_0x383b('0x2b')]();}var _0x513c68=[];var _0x40ac2d=[];delete _0x52ef2b['id'];delete _0x52ef2b[_0x383b('0x2c')];delete _0x52ef2b[_0x383b('0x2d')];var _0x25f526=_0x52ef2b['interval']!==_0x383b('0x2e')?[_0x52ef2b[_0x383b('0x2f')]]:_0x52ef2b[_0x383b('0x7')]?_[_0x383b('0xa')](_[_0x383b('0xd')](_0x301e93[_0x383b('0x5')],{'IntervalId':_0x52ef2b[_0x383b('0x7')]}),_0x383b('0x2f')):[];if(_0x52ef2b[_0x383b('0xf')](_0x383b('0x30'))){if(_0x52ef2b['tag']&&_0x52ef2b['tag']!=='--'){_0x513c68[_0x383b('0x14')]({'type':_0x52ef2b[_0x383b('0x15')],'app':_0x383b('0x16'),'appdata':'CDR(tag)='+_0x52ef2b[_0x383b('0x30')],'context':_0x52ef2b[_0x383b('0x18')],'exten':_0x52ef2b[_0x383b('0xb')],'priority':_0x25f526[_0x383b('0x2a')]+_0x301e93['priority']+_0x1fffeb++,'VoiceExtensionId':_0x52ef2b[_0x383b('0x19')]});}}if(_0x52ef2b[_0x383b('0x15')]==='outbound'&&_0x52ef2b[_0x383b('0xf')](_0x383b('0x31'))){if(_0x52ef2b[_0x383b('0x31')]){_0x513c68['push']({'type':_0x52ef2b['type'],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x52ef2b['callerID']+')','context':_0x52ef2b['context'],'exten':_0x52ef2b[_0x383b('0xb')],'priority':_0x25f526['length']+_0x301e93['priority']+_0x1fffeb++,'VoiceExtensionId':_0x52ef2b[_0x383b('0x19')]});}else{_0x513c68['push']({'type':_0x52ef2b[_0x383b('0x15')],'app':_0x383b('0x21'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x52ef2b[_0x383b('0x18')],'exten':_0x52ef2b[_0x383b('0xb')],'priority':_0x25f526[_0x383b('0x2a')]+_0x301e93[_0x383b('0x10')]+_0x1fffeb++,'VoiceExtensionId':_0x52ef2b[_0x383b('0x19')]});}}if(_0x52ef2b[_0x383b('0xf')]('answer')){if(_0x20f801[_0x383b('0x32')](_0x52ef2b[_0x383b('0x33')][_0x383b('0x2b')]())>=0x0&&_0x52ef2b[_0x383b('0x34')]!==_0x383b('0x35')){if(_0x52ef2b['answer']){_0x513c68[_0x383b('0x14')]({'type':_0x52ef2b[_0x383b('0x15')],'app':_0x383b('0x21'),'appdata':_0x383b('0x36'),'context':_0x52ef2b[_0x383b('0x18')],'exten':_0x52ef2b[_0x383b('0xb')],'priority':_0x25f526['length']+_0x301e93[_0x383b('0x10')]+_0x1fffeb++,'VoiceExtensionId':_0x52ef2b[_0x383b('0x19')]});_0x513c68[_0x383b('0x14')]({'type':_0x52ef2b['type'],'app':_0x383b('0x16'),'appdata':_0x383b('0x37'),'context':_0x52ef2b[_0x383b('0x18')],'exten':_0x52ef2b['exten'],'priority':_0x25f526['length']+_0x301e93[_0x383b('0x10')]+_0x1fffeb++,'VoiceExtensionId':_0x52ef2b[_0x383b('0x19')]});}else{_0x513c68[_0x383b('0x14')]({'type':_0x52ef2b['type'],'app':'ExecIf','appdata':_0x383b('0x38'),'context':_0x52ef2b[_0x383b('0x18')],'exten':_0x52ef2b[_0x383b('0xb')],'priority':_0x25f526[_0x383b('0x2a')]+_0x301e93[_0x383b('0x10')]+_0x1fffeb++,'VoiceExtensionId':_0x52ef2b[_0x383b('0x19')]});_0x513c68[_0x383b('0x14')]({'type':_0x52ef2b[_0x383b('0x15')],'app':_0x383b('0x16'),'appdata':_0x383b('0x39'),'context':_0x52ef2b[_0x383b('0x18')],'exten':_0x52ef2b['exten'],'priority':_0x25f526[_0x383b('0x2a')]+_0x301e93[_0x383b('0x10')]+_0x1fffeb++,'VoiceExtensionId':_0x52ef2b['VoiceExtensionId']});}}}for(var _0x38799b=0x0;_0x38799b<_0x25f526[_0x383b('0x2a')];_0x38799b+=0x1){var _0x5cab96=_0x301e93['priority']+_0x25f526[_0x383b('0x2a')];var _0x313c83=_0x38799b===_0x25f526[_0x383b('0x2a')]-0x1?_0x301e93['priority']+_0x513c68[_0x383b('0x2a')]+_0x40ac2d[_0x383b('0x2a')]+0x2:_0x301e93[_0x383b('0x10')]+_0x38799b+0x1;_0x513c68[_0x383b('0x3a')](_0x38799b,0x0,{'type':_0x52ef2b[_0x383b('0x15')],'app':'GotoIfTime','appdata':_0x25f526[_0x38799b]+'?'+_0x52ef2b[_0x383b('0x18')]+_0x383b('0x3b')+_0x5cab96+':'+_0x52ef2b['context']+_0x383b('0x3b')+_0x313c83,'exten':_0x52ef2b['exten'],'context':_0x52ef2b[_0x383b('0x18')],'priority':_0x301e93[_0x383b('0x10')]+_0x38799b,'VoiceExtensionId':_0x2b2919[_0x140983][0x0]['VoiceExtensionId']});}_0x52ef2b[_0x383b('0x10')]=_0x513c68[_0x383b('0x2a')]?_[_0x383b('0x3c')](_0x513c68)['priority']+0x1:_0x301e93[_0x383b('0x10')];_0x301e93[_0x383b('0x10')]=(_0x40ac2d[_0x383b('0x2a')]?_[_0x383b('0x3c')](_0x40ac2d)[_0x383b('0x10')]:_0x52ef2b[_0x383b('0x10')])+0x1;_0x301e93[_0x383b('0x11')]=_[_0x383b('0x3d')](_0x301e93[_0x383b('0x11')],_0x513c68,[_0x52ef2b],_0x40ac2d);}_0x301e93[_0x383b('0x11')][_0x383b('0x14')]({'type':_0x2b2919[_0x140983][0x0][_0x383b('0x15')],'app':_0x383b('0x3e'),'exten':_0x2b2919[_0x140983][0x0][_0x383b('0xb')],'context':_0x2b2919[_0x140983][0x0][_0x383b('0x18')],'priority':_0x301e93[_0x383b('0x10')],'VoiceExtensionId':_0x2b2919[_0x140983][0x0]['VoiceExtensionId']});_0x43f169[_0x383b('0x14')](_0x2b2919[_0x140983][0x0][_0x383b('0x19')]);_0x4730af=_['concat'](_0x4730af,_0x301e93['extensions']);}}return _0x16da0d[_0x383b('0x3f')](function(_0x2a6cbf){return _0x16da0d[_0x383b('0x2')][_0x383b('0x6')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x43f169}},'transaction':_0x2a6cbf})[_0x383b('0x8')](function(_0x247e06){return _0x16da0d['models'][_0x383b('0x6')]['bulkCreate'](_[_0x383b('0x40')](_0x4730af,_0x383b('0x10')),{'transaction':_0x2a6cbf});});});})['catch'](function(_0x39e3a3){console['error'](_0x39e3a3);});}exports[_0x383b('0x41')]=rewrite;
\ No newline at end of file
index 74fb446..796624e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfbea=['onlyIfOpen','sequelize','VoiceQueueId','all','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','resolve','CmContact','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','info','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/logger','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','index','test','isNil','error','errors','length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','duplicate','Duplicate\x20Contact','create','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','insert','into','cm_hopper','fromQuery','ContactId','createdAt','updatedAt','select','field','NOW()','toString','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','from','\x20=\x20?','scheduledAt','cm_contacts','id\x20IN\x20?','str','calleridnum','phone\x20NOT\x20IN\x20(?)','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','Lists','get','dialCheckDuplicateType','always','query'];(function(_0x5b78fe,_0x44542c){var _0x24ac3c=function(_0x552b51){while(--_0x552b51){_0x5b78fe['push'](_0x5b78fe['shift']());}};_0x24ac3c(++_0x44542c);}(_0xfbea,0xf2));var _0xafbe=function(_0x3b8b03,_0x49ff54){_0x3b8b03=_0x3b8b03-0x0;var _0xefe7ae=_0xfbea[_0x3b8b03];return _0xefe7ae;};'use strict';var BPromise=require(_0xafbe('0x0'));var util=require('util');var _=require(_0xafbe('0x1'));var fs=require('fs');var squel=require(_0xafbe('0x2'));var Papa=require(_0xafbe('0x3'));var Redis=require(_0xafbe('0x4'));var db=require(_0xafbe('0x5'))['db'];var config=require('../../../config/environment');var logger=require(_0xafbe('0x6'))('api');config[_0xafbe('0x7')]=_[_0xafbe('0x8')](config[_0xafbe('0x7')],{'host':_0xafbe('0x9'),'port':0x18eb});var socket=require(_0xafbe('0xa'))(new Redis(config[_0xafbe('0x7')]));require(_0xafbe('0xb'))[_0xafbe('0xc')](socket);try{if(!process[_0xafbe('0xd')][0x2]||process[_0xafbe('0xd')][0x2]===_0xafbe('0xe')||process[_0xafbe('0xd')][0x2]===_0xafbe('0xf')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0xafbe('0xd')][0x2];if(!process[_0xafbe('0xd')][0x3]||process[_0xafbe('0xd')][0x3]===_0xafbe('0xe')||process[_0xafbe('0xd')][0x3]===_0xafbe('0xf')||!process[_0xafbe('0xd')][0x4]||process[_0xafbe('0xd')][0x4]==='undefined'||process[_0xafbe('0xd')][0x4]===_0xafbe('0xf')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0xafbe('0x10')](process[_0xafbe('0xd')][0x3]['split'](','),process[_0xafbe('0xd')][0x4][_0xafbe('0x11')](','));if(!process[_0xafbe('0xd')][0x5]||process['argv'][0x5]===_0xafbe('0xe')||process[_0xafbe('0xd')][0x5]==='null'){throw new Error(_0xafbe('0x12'));}var LISTID=process[_0xafbe('0xd')][0x5];var COMPANYID=process[_0xafbe('0xd')][0x6]&&process[_0xafbe('0xd')][0x6]!=='undefined'&&process[_0xafbe('0xd')][0x6]!==_0xafbe('0xf')?process[_0xafbe('0xd')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0xafbe('0xd')][0x7]!==_0xafbe('0xe')&&process[_0xafbe('0xd')][0x7]!==_0xafbe('0xf')?process[_0xafbe('0xd')][0x7]:null;if(!process[_0xafbe('0xd')][0x8]||process[_0xafbe('0xd')][0x8]===_0xafbe('0xe')||process[_0xafbe('0xd')][0x8]==='null'){throw new Error(_0xafbe('0x13'));}var SOCKET_TIMESTAMP=process[_0xafbe('0xd')][0x8];}catch(_0x3a1d0b){logger['error'](_0x3a1d0b);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(_0x230639,_0x30f472,_0x12177c,_0x37b968){var _0x5c2ed0={'message':_0x30f472};_0x5c2ed0[_0x230639]=!![];if(_0x12177c){_0x5c2ed0[_0xafbe('0x14')]=_0x12177c;}if(_0x37b968){_0x5c2ed0[_0xafbe('0x15')]=_0x37b968;}return _0x5c2ed0;}function isEmail(_0x47ca6d){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))*$/[_0xafbe('0x16')](_0x47ca6d);}function checkRow(_0xf6fc8b,_0x49f41c,_0x20d02a){return new BPromise(function(_0x255366,_0x4d29cb){if(_[_0xafbe('0x17')](_0xf6fc8b)){return _0x4d29cb(handleCheckRowError(_0xafbe('0x18'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x20d02a));}if(_0xf6fc8b[_0xafbe('0x19')]&&_0xf6fc8b[_0xafbe('0x19')][_0xafbe('0x1a')]){var _0x27ec20=_[_0xafbe('0x1b')](_0xf6fc8b[_0xafbe('0x19')],_0xafbe('0x1c'))[_0xafbe('0x1d')](';');return _0x4d29cb(handleCheckRowError('error',_0x27ec20,null,_0x20d02a));}var _0x3a8a5d={};for(var _0x301c30 in FIELDS){if(FIELDS[_0xafbe('0x1e')](_0x301c30)&&FIELDS[_0x301c30]){_0x3a8a5d[_0x301c30]=_0xf6fc8b[_0xafbe('0x1f')][0x0][FIELDS[_0x301c30]]||_0xf6fc8b[_0xafbe('0x1f')][0x0]['\ufeff'+FIELDS[_0x301c30]];}}if(!_0x3a8a5d[_0xafbe('0x20')]){return _0x4d29cb(handleCheckRowError(_0xafbe('0x18'),_0xafbe('0x21'),null,_0x20d02a));}if(!_0x3a8a5d[_0xafbe('0x22')]){return _0x4d29cb(handleCheckRowError('error',_0xafbe('0x23'),null,_0x20d02a));}if(_0x3a8a5d[_0xafbe('0x24')]){var _0x21e25f=moment(_0x3a8a5d['birthDate'],'YYYY-MM-DD');if(!_0x21e25f[_0xafbe('0x25')]()){return _0x4d29cb(handleCheckRowError(_0xafbe('0x18'),_0xafbe('0x26'),null,_0x20d02a));}}if(_0x3a8a5d[_0xafbe('0x27')]){if(!isEmail(_0x3a8a5d[_0xafbe('0x27')])){return _0x4d29cb(handleCheckRowError(_0xafbe('0x18'),'email\x20format\x20is\x20not\x20valid!',null,_0x20d02a));}}_0x3a8a5d[_0xafbe('0x28')]=LISTID;_0x3a8a5d[_0xafbe('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xafbe('0x1a')]&&_0x49f41c){var _0x17c23a={};for(var _0x18c2ec=0x0,_0x272891=DUPLICATES['length'];_0x18c2ec<_0x272891;_0x18c2ec+=0x1){_0x17c23a[DUPLICATES[_0x18c2ec]]=_0x3a8a5d[DUPLICATES[_0x18c2ec]];}var _0xf48e2f=_['find'](_0x49f41c,_0x17c23a);if(_0xf48e2f){return _0x4d29cb(handleCheckRowError(_0xafbe('0x2a'),_0xafbe('0x2b'),_0xf48e2f,_0x20d02a));}}return db['CmContact'][_0xafbe('0x2c')](_0x3a8a5d,{'raw':!![],'hooks':![],'fields':_['keys'](_0x3a8a5d)})[_0xafbe('0x2d')](function(_0x35a1dd){if(DUPLICATES&&DUPLICATES['length']&&_0x49f41c){_0x49f41c[_0xafbe('0x2e')](_[_0xafbe('0x2f')](_0x3a8a5d,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x35a1dd['id'];return _0x255366();})[_0xafbe('0x30')](function(_0x566799){return _0x4d29cb(handleCheckRowError(_0xafbe('0x18'),_0xafbe('0x31')+(_0x566799[_0xafbe('0x1c')]||JSON[_0xafbe('0x32')](_0x566799)),null,_0x20d02a));});});}function checkHopper(){function _0x48ce95(){return function(_0x317fa1){logger[_0xafbe('0x18')]('cmContact',_0xafbe('0x33'),util['inspect'](_0x317fa1,{'showHidden':![],'depth':null}));};}var _0xaace82=function(_0x3fe9ad,_0x564c82){var _0x497d1a=squel[_0xafbe('0x34')]()[_0xafbe('0x35')](_0xafbe('0x36'))[_0xafbe('0x37')]([_0xafbe('0x22'),'scheduledAt',_0xafbe('0x38'),'ListId',_0x564c82,_0xafbe('0x39'),_0xafbe('0x3a')],squel[_0xafbe('0x3b')]()[_0xafbe('0x3c')](_0xafbe('0x22'),_0xafbe('0x22'))['field'](_0xafbe('0x3d'),'scheduledAt')['field']('id',_0xafbe('0x38'))['field'](LISTID[_0xafbe('0x3e')](),_0xafbe('0x28'))[_0xafbe('0x3c')](_0x3fe9ad['id'][_0xafbe('0x3e')](),_0x564c82)['field']('NOW()','createdAt')['field'](_0xafbe('0x3d'),_0xafbe('0x3a'))['from']('cm_contacts')[_0xafbe('0x3f')](_0xafbe('0x40'))[_0xafbe('0x3f')](_0xafbe('0x41'),LISTID['toString']())[_0xafbe('0x3f')](_0xafbe('0x42'))[_0xafbe('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xafbe('0x3c')](_0xafbe('0x22'))[_0xafbe('0x43')](_0xafbe('0x36'))[_0xafbe('0x3f')](_0x564c82+_0xafbe('0x44'),_0x3fe9ad['id'][_0xafbe('0x3e')]())))[_0xafbe('0x3e')]();return _0x497d1a;};var _0x398314=function(_0x5a9e3e,_0x456ab6){var _0x52213c=squel[_0xafbe('0x34')]()[_0xafbe('0x35')](_0xafbe('0x36'))['fromQuery'](['phone','scheduledAt',_0xafbe('0x38'),'ListId',_0x456ab6,'createdAt',_0xafbe('0x3a')],squel[_0xafbe('0x3b')]()[_0xafbe('0x3c')](_0xafbe('0x22'),_0xafbe('0x22'))[_0xafbe('0x3c')]('NOW()',_0xafbe('0x45'))[_0xafbe('0x3c')]('id',_0xafbe('0x38'))[_0xafbe('0x3c')](LISTID[_0xafbe('0x3e')](),'ListId')[_0xafbe('0x3c')](_0x5a9e3e['id'][_0xafbe('0x3e')](),_0x456ab6)['field']('NOW()',_0xafbe('0x39'))[_0xafbe('0x3c')](_0xafbe('0x3d'),_0xafbe('0x3a'))[_0xafbe('0x43')](_0xafbe('0x46'))['where'](_0xafbe('0x40'))[_0xafbe('0x3f')](_0xafbe('0x41'),LISTID[_0xafbe('0x3e')]())[_0xafbe('0x3f')](_0xafbe('0x47'),squel[_0xafbe('0x48')](hopperContacts))['where'](_0xafbe('0x42'))[_0xafbe('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0xafbe('0x3b')]()['field'](_0xafbe('0x49'))['from']('cm_hopper_final')[_0xafbe('0x3f')](_0x456ab6+_0xafbe('0x44'),_0x5a9e3e['id']['toString']()))['where'](_0xafbe('0x4a'),squel[_0xafbe('0x3b')]()[_0xafbe('0x3c')](_0xafbe('0x22'))[_0xafbe('0x43')](_0xafbe('0x36'))[_0xafbe('0x3f')](_0x456ab6+_0xafbe('0x44'),_0x5a9e3e['id']['toString']())))['toString']();return _0x52213c;};function _0x2cc54d(_0x48c8f3,_0x102412){var _0x2c3df0=squel['insert']()[_0xafbe('0x35')](_0xafbe('0x36'))[_0xafbe('0x37')](['phone','scheduledAt',_0xafbe('0x38'),_0xafbe('0x28'),_0x102412,_0xafbe('0x39'),_0xafbe('0x3a')],squel[_0xafbe('0x3b')]()[_0xafbe('0x3c')](_0xafbe('0x22'),_0xafbe('0x22'))[_0xafbe('0x3c')](_0xafbe('0x3d'),_0xafbe('0x45'))['field']('id',_0xafbe('0x38'))[_0xafbe('0x3c')](LISTID[_0xafbe('0x3e')](),_0xafbe('0x28'))['field'](_0x48c8f3['id'][_0xafbe('0x3e')](),_0x102412)['field'](_0xafbe('0x3d'),_0xafbe('0x39'))['field']('NOW()','updatedAt')['from'](_0xafbe('0x46'))[_0xafbe('0x3f')](_0xafbe('0x40'))[_0xafbe('0x3f')]('ListId\x20=\x20?',LISTID[_0xafbe('0x3e')]())['where']('id\x20IN\x20?',squel[_0xafbe('0x48')](hopperContacts))['where'](_0xafbe('0x42')))[_0xafbe('0x3e')]();return _0x2c3df0;}function _0x949833(_0x3d33b5,_0x46d326){var _0x28d613=squel[_0xafbe('0x34')]()[_0xafbe('0x35')](_0xafbe('0x4b'))[_0xafbe('0x37')]([_0xafbe('0x22'),_0xafbe('0x38'),_0xafbe('0x28'),_0x46d326,_0xafbe('0x39'),'updatedAt'],squel[_0xafbe('0x3b')]()[_0xafbe('0x3c')]('phone','phone')[_0xafbe('0x3c')]('id',_0xafbe('0x38'))[_0xafbe('0x3c')](LISTID[_0xafbe('0x3e')](),_0xafbe('0x28'))[_0xafbe('0x3c')](_0x3d33b5['id'][_0xafbe('0x3e')](),_0x46d326)[_0xafbe('0x3c')](_0xafbe('0x3d'),'createdAt')[_0xafbe('0x3c')](_0xafbe('0x3d'),_0xafbe('0x3a'))[_0xafbe('0x43')](_0xafbe('0x46'))['where'](_0xafbe('0x40'))[_0xafbe('0x3f')](_0xafbe('0x41'),LISTID['toString']())[_0xafbe('0x3f')](_0xafbe('0x47'),squel[_0xafbe('0x48')](hopperContacts))[_0xafbe('0x3f')](_0xafbe('0x42')))['toString']();return _0x28d613;}return db[_0xafbe('0x4c')][_0xafbe('0x4d')]({'where':{'type':_0xafbe('0x4e')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xafbe('0x4f')],'as':_0xafbe('0x50'),'where':{'id':LISTID}}]})[_0xafbe('0x2d')](function(_0x1d08fb){var _0x1e7c23=[];if(_0x1d08fb){var _0xaa234d;for(var _0xf2d775=0x0,_0x188ab5;_0xf2d775<_0x1d08fb[_0xafbe('0x1a')];_0xf2d775+=0x1){_0x188ab5=_0x1d08fb[_0xf2d775][_0xafbe('0x51')]({'plain':!![]});switch(_0x188ab5[_0xafbe('0x52')]){case _0xafbe('0x53'):_0x1e7c23['push'](db['sequelize'][_0xafbe('0x54')](_0x398314(_0x188ab5,'VoiceQueueId'))[_0xafbe('0x2d')](function(){})[_0xafbe('0x30')](_0x48ce95()));break;case _0xafbe('0x55'):_0x1e7c23[_0xafbe('0x2e')](db[_0xafbe('0x56')]['query'](_0xaace82(_0x188ab5,_0xafbe('0x57')))[_0xafbe('0x2d')](function(){})[_0xafbe('0x30')](_0x48ce95()));break;default:_0x1e7c23['push'](db['sequelize'][_0xafbe('0x54')](_0x2cc54d(_0x188ab5,_0xafbe('0x57')))[_0xafbe('0x2d')](function(){})[_0xafbe('0x30')](_0x48ce95()));}}}return _0x1e7c23;})[_0xafbe('0x58')]()[_0xafbe('0x2d')](function(){return db[_0xafbe('0x4c')][_0xafbe('0x4d')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0xafbe('0x4f')],'as':_0xafbe('0x59'),'where':{'id':LISTID}}]})[_0xafbe('0x2d')](function(_0x16890b){var _0x105960=[];if(_0x16890b){var _0x14e696;for(var _0x16dc7d=0x0,_0x4ea165;_0x16dc7d<_0x16890b[_0xafbe('0x1a')];_0x16dc7d+=0x1){_0x4ea165=_0x16890b[_0x16dc7d][_0xafbe('0x51')]({'plain':!![]});_0x105960[_0xafbe('0x2e')](db['sequelize'][_0xafbe('0x54')](_0x949833(_0x4ea165,_0xafbe('0x57')))[_0xafbe('0x2d')](function(){})['catch'](_0x48ce95()));}}return _0x105960;})[_0xafbe('0x58')]();})[_0xafbe('0x2d')](function(){return db[_0xafbe('0x5a')][_0xafbe('0x4d')]({'attributes':['id',_0xafbe('0x52')],'include':[{'model':db['CmList'],'as':_0xafbe('0x50'),'where':{'id':LISTID}}]})[_0xafbe('0x2d')](function(_0xeee29){var _0x285d41=[];if(_0xeee29){for(var _0x4abe68=0x0,_0x4069de;_0x4abe68<_0xeee29['length'];_0x4abe68+=0x1){_0x4069de=_0xeee29[_0x4abe68]['get']({'plain':!![]});switch(_0x4069de[_0xafbe('0x52')]){case _0xafbe('0x53'):_0x285d41[_0xafbe('0x2e')](db[_0xafbe('0x56')][_0xafbe('0x54')](_0x398314(_0x4069de,_0xafbe('0x5b')))[_0xafbe('0x2d')](function(){})[_0xafbe('0x30')](_0x48ce95()));break;case _0xafbe('0x55'):_0x285d41[_0xafbe('0x2e')](db[_0xafbe('0x56')][_0xafbe('0x54')](_0xaace82(_0x4069de,_0xafbe('0x5b')))[_0xafbe('0x2d')](function(){})[_0xafbe('0x30')](_0x48ce95()));break;default:_0x285d41[_0xafbe('0x2e')](db[_0xafbe('0x56')]['query'](_0x2cc54d(_0x4069de,_0xafbe('0x5b')))[_0xafbe('0x2d')](function(){})[_0xafbe('0x30')](_0x48ce95()));}}}return _0x285d41;})[_0xafbe('0x58')]();})[_0xafbe('0x2d')](function(){return db[_0xafbe('0x5a')][_0xafbe('0x4d')]({'attributes':['id'],'include':[{'model':db[_0xafbe('0x4f')],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x8fb6d0){var _0x2c5192=[];if(_0x8fb6d0){for(var _0x3b8ba2=0x0,_0x56f694;_0x3b8ba2<_0x8fb6d0[_0xafbe('0x1a')];_0x3b8ba2+=0x1){_0x56f694=_0x8fb6d0[_0x3b8ba2][_0xafbe('0x51')]({'plain':!![]});_0x2c5192[_0xafbe('0x2e')](db[_0xafbe('0x56')][_0xafbe('0x54')](_0x949833(_0x56f694,_0xafbe('0x5b')))['then'](function(){})[_0xafbe('0x30')](_0x48ce95()));}}return _0x2c5192;})[_0xafbe('0x58')]();})[_0xafbe('0x30')](function(_0x9eea1d){logger[_0xafbe('0x18')](_0xafbe('0x5c'),_0xafbe('0x5d'),_0x9eea1d[_0xafbe('0x1c')]);});}var processPromises=function(_0x10cb9d){return BPromise['all'](promises)[_0xafbe('0x2d')](function(_0x592a84){})[_0xafbe('0x30')](function(_0x278ae9){logger['error'](_0xafbe('0x5e'),JSON[_0xafbe('0x32')](_0x278ae9));})['finally'](function(){socket[_0xafbe('0x5f')](_0xafbe('0x60')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x10cb9d){return _0x10cb9d[_0xafbe('0x61')]();}});};var endCsv=function(){return BPromise['resolve']()[_0xafbe('0x2d')](function(){if(hopperContacts){return checkHopper();}})[_0xafbe('0x2d')](function(){socket[_0xafbe('0x5f')](_0xafbe('0x60')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xafbe('0x62')](FILEPATH);}catch(_0x109286){logger[_0xafbe('0x18')](_0xafbe('0x63'),JSON[_0xafbe('0x32')](_0x109286));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0xafbe('0x64')]()[_0xafbe('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xafbe('0x11')](',');return db[_0xafbe('0x65')][_0xafbe('0x4d')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xafbe('0x2d')](function(_0x4cd321){var _0x51d207=fs[_0xafbe('0x66')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xafbe('0x67')](_0x51d207,{'header':!![],'skipEmptyLines':!![],'step':function(_0x121b7d,_0x45726d){total+=0x1;var _0x23d11a=total;promises['push'](checkRow(_0x121b7d,_0x4cd321,_0x23d11a)['then'](function(){success+=0x1;})[_0xafbe('0x30')](function(_0x2b9e1f){if(_0x2b9e1f[_0xafbe('0x18')]){errors+=0x1;delete _0x2b9e1f[_0xafbe('0x18')];}else if(_0x2b9e1f[_0xafbe('0x2a')]){duplicates+=0x1;delete _0x2b9e1f[_0xafbe('0x2a')];}rows[_0xafbe('0x2e')](_0x2b9e1f);}));if(total%0xc8===0x0){_0x45726d[_0xafbe('0x68')]();return processPromises(_0x45726d);}},'complete':function(){return processPromises()[_0xafbe('0x2d')](function(){logger['info'](_0xafbe('0x69'));endCsv();});},'error':function(_0x57d651,_0x444004){logger[_0xafbe('0x6a')](_0xafbe('0x6b'),JSON[_0xafbe('0x32')](_0x57d651));endCsv();}});})[_0xafbe('0x30')](function(_0x2ca5e4){logger[_0xafbe('0x18')](_0xafbe('0x6c'),JSON[_0xafbe('0x32')](_0x2ca5e4));});}main();
\ No newline at end of file
+var _0x5d69=['lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/logger','api','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','data','phone','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','NOW()','toString','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','\x20=\x20?','id\x20IN\x20?','str','cm_hopper_final','VoiceQueue','dialCheckDuplicateType','Lists','always','sequelize','query','VoiceQueueId','onlyIfOpen','all','findAll','outbound','CmList','get','CampaignId','Campaign','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','emit','contact:csv_','resolve','unlinkSync','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','pause','info','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util'];(function(_0x1599ae,_0x50ac2b){var _0x5c97cc=function(_0x4e0c3b){while(--_0x4e0c3b){_0x1599ae['push'](_0x1599ae['shift']());}};_0x5c97cc(++_0x50ac2b);}(_0x5d69,0x1a6));var _0x95d6=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5d69[_0x122ef9];return _0x42fba0;};'use strict';var BPromise=require(_0x95d6('0x0'));var util=require(_0x95d6('0x1'));var _=require(_0x95d6('0x2'));var fs=require('fs');var squel=require(_0x95d6('0x3'));var Papa=require(_0x95d6('0x4'));var Redis=require(_0x95d6('0x5'));var db=require(_0x95d6('0x6'))['db'];var config=require('../../../config/environment');var logger=require(_0x95d6('0x7'))(_0x95d6('0x8'));config['redis']=_[_0x95d6('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x95d6('0xa'))(new Redis(config['redis']));require(_0x95d6('0xb'))['register'](socket);try{if(!process[_0x95d6('0xc')][0x2]||process[_0x95d6('0xc')][0x2]===_0x95d6('0xd')||process[_0x95d6('0xc')][0x2]===_0x95d6('0xe')){throw new Error(_0x95d6('0xf'));}var FILEPATH=process[_0x95d6('0xc')][0x2];if(!process[_0x95d6('0xc')][0x3]||process[_0x95d6('0xc')][0x3]==='undefined'||process[_0x95d6('0xc')][0x3]==='null'||!process[_0x95d6('0xc')][0x4]||process[_0x95d6('0xc')][0x4]==='undefined'||process[_0x95d6('0xc')][0x4]===_0x95d6('0xe')){throw new Error(_0x95d6('0x10'));}var FIELDS=_[_0x95d6('0x11')](process[_0x95d6('0xc')][0x3][_0x95d6('0x12')](','),process['argv'][0x4]['split'](','));if(!process[_0x95d6('0xc')][0x5]||process['argv'][0x5]===_0x95d6('0xd')||process['argv'][0x5]==='null'){throw new Error(_0x95d6('0x13'));}var LISTID=process[_0x95d6('0xc')][0x5];var COMPANYID=process[_0x95d6('0xc')][0x6]&&process[_0x95d6('0xc')][0x6]!==_0x95d6('0xd')&&process[_0x95d6('0xc')][0x6]!==_0x95d6('0xe')?process['argv'][0x6]:null;var DUPLICATES=process[_0x95d6('0xc')][0x7]&&process[_0x95d6('0xc')][0x7]!==_0x95d6('0xd')&&process['argv'][0x7]!=='null'?process[_0x95d6('0xc')][0x7]:null;if(!process[_0x95d6('0xc')][0x8]||process[_0x95d6('0xc')][0x8]==='undefined'||process['argv'][0x8]===_0x95d6('0xe')){throw new Error(_0x95d6('0x14'));}var SOCKET_TIMESTAMP=process[_0x95d6('0xc')][0x8];}catch(_0x36cb54){logger[_0x95d6('0x15')](_0x36cb54);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(_0x2cadb9,_0x210a35,_0x32d299,_0x2ceef7){var _0x4605ff={'message':_0x210a35};_0x4605ff[_0x2cadb9]=!![];if(_0x32d299){_0x4605ff[_0x95d6('0x16')]=_0x32d299;}if(_0x2ceef7){_0x4605ff[_0x95d6('0x17')]=_0x2ceef7;}return _0x4605ff;}function isEmail(_0x4f7416){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'](_0x4f7416);}function checkRow(_0x10b89d,_0x2c2297,_0x3bc650){return new BPromise(function(_0x3abe80,_0x225ce){if(_[_0x95d6('0x18')](_0x10b89d)){return _0x225ce(handleCheckRowError('error',_0x95d6('0x19'),null,_0x3bc650));}if(_0x10b89d[_0x95d6('0x1a')]&&_0x10b89d[_0x95d6('0x1a')][_0x95d6('0x1b')]){var _0x41ef68=_[_0x95d6('0x1c')](_0x10b89d['errors'],_0x95d6('0x1d'))['join'](';');return _0x225ce(handleCheckRowError('error',_0x41ef68,null,_0x3bc650));}var _0x42b18a={};for(var _0x49d980 in FIELDS){if(FIELDS['hasOwnProperty'](_0x49d980)&&FIELDS[_0x49d980]){_0x42b18a[_0x49d980]=_0x10b89d[_0x95d6('0x1e')][0x0][FIELDS[_0x49d980]]||_0x10b89d[_0x95d6('0x1e')][0x0]['\ufeff'+FIELDS[_0x49d980]];}}if(!_0x42b18a['firstName']){return _0x225ce(handleCheckRowError(_0x95d6('0x15'),'firstName\x20not\x20specified!',null,_0x3bc650));}if(!_0x42b18a[_0x95d6('0x1f')]){return _0x225ce(handleCheckRowError(_0x95d6('0x15'),'phone\x20not\x20specified!',null,_0x3bc650));}if(_0x42b18a[_0x95d6('0x20')]){var _0xe699e=moment(_0x42b18a[_0x95d6('0x20')],'YYYY-MM-DD');if(!_0xe699e[_0x95d6('0x21')]()){return _0x225ce(handleCheckRowError(_0x95d6('0x15'),_0x95d6('0x22'),null,_0x3bc650));}}if(_0x42b18a[_0x95d6('0x23')]){if(!isEmail(_0x42b18a[_0x95d6('0x23')])){return _0x225ce(handleCheckRowError(_0x95d6('0x15'),_0x95d6('0x24'),null,_0x3bc650));}}_0x42b18a['ListId']=LISTID;_0x42b18a[_0x95d6('0x25')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x95d6('0x1b')]&&_0x2c2297){var _0x2717bc={};for(var _0x4108f6=0x0,_0x5e9eb7=DUPLICATES['length'];_0x4108f6<_0x5e9eb7;_0x4108f6+=0x1){_0x2717bc[DUPLICATES[_0x4108f6]]=_0x42b18a[DUPLICATES[_0x4108f6]];}var _0x3f9ea2=_[_0x95d6('0x26')](_0x2c2297,_0x2717bc);if(_0x3f9ea2){return _0x225ce(handleCheckRowError(_0x95d6('0x27'),_0x95d6('0x28'),_0x3f9ea2,_0x3bc650));}}return db[_0x95d6('0x29')][_0x95d6('0x2a')](_0x42b18a,{'raw':!![],'hooks':![],'fields':_[_0x95d6('0x2b')](_0x42b18a)})[_0x95d6('0x2c')](function(_0x92ef0b){if(DUPLICATES&&DUPLICATES[_0x95d6('0x1b')]&&_0x2c2297){_0x2c2297[_0x95d6('0x2d')](_[_0x95d6('0x2e')](_0x42b18a,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x92ef0b['id'];return _0x3abe80();})[_0x95d6('0x2f')](function(_0x22c0b6){return _0x225ce(handleCheckRowError(_0x95d6('0x15'),_0x95d6('0x30')+(_0x22c0b6[_0x95d6('0x1d')]||JSON[_0x95d6('0x31')](_0x22c0b6)),null,_0x3bc650));});});}function checkHopper(){function _0x5421f3(){return function(_0x51ca8b){logger[_0x95d6('0x15')](_0x95d6('0x32'),_0x95d6('0x33'),util[_0x95d6('0x34')](_0x51ca8b,{'showHidden':![],'depth':null}));};}var _0x1dc0d3=function(_0x3bbd95,_0x293fdb){var _0x27e5c8=squel[_0x95d6('0x35')]()[_0x95d6('0x36')](_0x95d6('0x37'))[_0x95d6('0x38')]([_0x95d6('0x1f'),_0x95d6('0x39'),_0x95d6('0x3a'),_0x95d6('0x3b'),_0x293fdb,_0x95d6('0x3c'),_0x95d6('0x3d')],squel[_0x95d6('0x3e')]()[_0x95d6('0x3f')](_0x95d6('0x1f'),_0x95d6('0x1f'))[_0x95d6('0x3f')](_0x95d6('0x40'),'scheduledAt')[_0x95d6('0x3f')]('id',_0x95d6('0x3a'))[_0x95d6('0x3f')](LISTID[_0x95d6('0x41')](),_0x95d6('0x3b'))[_0x95d6('0x3f')](_0x3bbd95['id'][_0x95d6('0x41')](),_0x293fdb)[_0x95d6('0x3f')]('NOW()',_0x95d6('0x3c'))[_0x95d6('0x3f')]('NOW()',_0x95d6('0x3d'))['from'](_0x95d6('0x42'))[_0x95d6('0x43')](_0x95d6('0x44'))['where'](_0x95d6('0x45'),LISTID[_0x95d6('0x41')]())['where'](_0x95d6('0x46'))[_0x95d6('0x43')](_0x95d6('0x47'),squel[_0x95d6('0x3e')]()[_0x95d6('0x3f')](_0x95d6('0x1f'))[_0x95d6('0x48')](_0x95d6('0x37'))['where'](_0x293fdb+_0x95d6('0x49'),_0x3bbd95['id'][_0x95d6('0x41')]())))['toString']();return _0x27e5c8;};var _0x1626ea=function(_0x33ba3a,_0x5aba82){var _0x3b0b56=squel[_0x95d6('0x35')]()[_0x95d6('0x36')](_0x95d6('0x37'))[_0x95d6('0x38')]([_0x95d6('0x1f'),_0x95d6('0x39'),'ContactId','ListId',_0x5aba82,_0x95d6('0x3c'),_0x95d6('0x3d')],squel[_0x95d6('0x3e')]()[_0x95d6('0x3f')](_0x95d6('0x1f'),'phone')[_0x95d6('0x3f')](_0x95d6('0x40'),_0x95d6('0x39'))[_0x95d6('0x3f')]('id',_0x95d6('0x3a'))['field'](LISTID[_0x95d6('0x41')](),_0x95d6('0x3b'))[_0x95d6('0x3f')](_0x33ba3a['id'][_0x95d6('0x41')](),_0x5aba82)[_0x95d6('0x3f')]('NOW()',_0x95d6('0x3c'))['field']('NOW()',_0x95d6('0x3d'))[_0x95d6('0x48')]('cm_contacts')['where'](_0x95d6('0x44'))[_0x95d6('0x43')](_0x95d6('0x45'),LISTID[_0x95d6('0x41')]())[_0x95d6('0x43')](_0x95d6('0x4a'),squel[_0x95d6('0x4b')](hopperContacts))[_0x95d6('0x43')](_0x95d6('0x46'))[_0x95d6('0x43')]('phone\x20NOT\x20IN\x20(?)',squel[_0x95d6('0x3e')]()[_0x95d6('0x3f')]('calleridnum')[_0x95d6('0x48')](_0x95d6('0x4c'))[_0x95d6('0x43')](_0x5aba82+_0x95d6('0x49'),_0x33ba3a['id'][_0x95d6('0x41')]()))[_0x95d6('0x43')]('phone\x20NOT\x20IN\x20(?)',squel[_0x95d6('0x3e')]()['field'](_0x95d6('0x1f'))['from'](_0x95d6('0x37'))[_0x95d6('0x43')](_0x5aba82+_0x95d6('0x49'),_0x33ba3a['id'][_0x95d6('0x41')]())))[_0x95d6('0x41')]();return _0x3b0b56;};function _0xb91a5(_0x934eb2,_0x55e2c5){var _0x39028f=squel[_0x95d6('0x35')]()[_0x95d6('0x36')]('cm_hopper')['fromQuery']([_0x95d6('0x1f'),_0x95d6('0x39'),_0x95d6('0x3a'),'ListId',_0x55e2c5,_0x95d6('0x3c'),'updatedAt'],squel[_0x95d6('0x3e')]()[_0x95d6('0x3f')]('phone','phone')[_0x95d6('0x3f')](_0x95d6('0x40'),_0x95d6('0x39'))[_0x95d6('0x3f')]('id','ContactId')[_0x95d6('0x3f')](LISTID[_0x95d6('0x41')](),'ListId')[_0x95d6('0x3f')](_0x934eb2['id'][_0x95d6('0x41')](),_0x55e2c5)[_0x95d6('0x3f')]('NOW()',_0x95d6('0x3c'))[_0x95d6('0x3f')](_0x95d6('0x40'),_0x95d6('0x3d'))[_0x95d6('0x48')](_0x95d6('0x42'))[_0x95d6('0x43')](_0x95d6('0x44'))[_0x95d6('0x43')]('ListId\x20=\x20?',LISTID['toString']())[_0x95d6('0x43')]('id\x20IN\x20?',squel[_0x95d6('0x4b')](hopperContacts))[_0x95d6('0x43')]('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x39028f;}function _0x224f9e(_0x490690,_0xc8f357){var _0x5e77af=squel[_0x95d6('0x35')]()[_0x95d6('0x36')]('cm_hopper_black')[_0x95d6('0x38')](['phone','ContactId',_0x95d6('0x3b'),_0xc8f357,_0x95d6('0x3c'),'updatedAt'],squel[_0x95d6('0x3e')]()[_0x95d6('0x3f')]('phone','phone')[_0x95d6('0x3f')]('id',_0x95d6('0x3a'))[_0x95d6('0x3f')](LISTID[_0x95d6('0x41')](),'ListId')[_0x95d6('0x3f')](_0x490690['id'][_0x95d6('0x41')](),_0xc8f357)[_0x95d6('0x3f')](_0x95d6('0x40'),_0x95d6('0x3c'))[_0x95d6('0x3f')](_0x95d6('0x40'),_0x95d6('0x3d'))[_0x95d6('0x48')](_0x95d6('0x42'))[_0x95d6('0x43')]('deletedAt\x20IS\x20NULL')[_0x95d6('0x43')]('ListId\x20=\x20?',LISTID[_0x95d6('0x41')]())[_0x95d6('0x43')](_0x95d6('0x4a'),squel[_0x95d6('0x4b')](hopperContacts))[_0x95d6('0x43')](_0x95d6('0x46')))[_0x95d6('0x41')]();return _0x5e77af;}return db[_0x95d6('0x4d')]['findAll']({'where':{'type':'outbound'},'attributes':['id',_0x95d6('0x4e')],'include':[{'model':db['CmList'],'as':_0x95d6('0x4f'),'where':{'id':LISTID}}]})['then'](function(_0x1c0d02){var _0x1fb52f=[];if(_0x1c0d02){var _0x228a56;for(var _0x10a4c5=0x0,_0x4ac468;_0x10a4c5<_0x1c0d02[_0x95d6('0x1b')];_0x10a4c5+=0x1){_0x4ac468=_0x1c0d02[_0x10a4c5]['get']({'plain':!![]});switch(_0x4ac468[_0x95d6('0x4e')]){case _0x95d6('0x50'):_0x1fb52f[_0x95d6('0x2d')](db[_0x95d6('0x51')][_0x95d6('0x52')](_0x1626ea(_0x4ac468,_0x95d6('0x53')))['then'](function(){})[_0x95d6('0x2f')](_0x5421f3()));break;case _0x95d6('0x54'):_0x1fb52f[_0x95d6('0x2d')](db[_0x95d6('0x51')][_0x95d6('0x52')](_0x1dc0d3(_0x4ac468,'VoiceQueueId'))[_0x95d6('0x2c')](function(){})['catch'](_0x5421f3()));break;default:_0x1fb52f['push'](db[_0x95d6('0x51')][_0x95d6('0x52')](_0xb91a5(_0x4ac468,_0x95d6('0x53')))[_0x95d6('0x2c')](function(){})[_0x95d6('0x2f')](_0x5421f3()));}}}return _0x1fb52f;})[_0x95d6('0x55')]()[_0x95d6('0x2c')](function(){return db[_0x95d6('0x4d')][_0x95d6('0x56')]({'where':{'type':_0x95d6('0x57')},'attributes':['id'],'include':[{'model':db[_0x95d6('0x58')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x95d6('0x2c')](function(_0xc1c65e){var _0x33ba48=[];if(_0xc1c65e){var _0x6636d1;for(var _0x55c43a=0x0,_0x2d5e4f;_0x55c43a<_0xc1c65e[_0x95d6('0x1b')];_0x55c43a+=0x1){_0x2d5e4f=_0xc1c65e[_0x55c43a][_0x95d6('0x59')]({'plain':!![]});_0x33ba48[_0x95d6('0x2d')](db['sequelize']['query'](_0x224f9e(_0x2d5e4f,_0x95d6('0x53')))[_0x95d6('0x2c')](function(){})[_0x95d6('0x2f')](_0x5421f3()));}}return _0x33ba48;})[_0x95d6('0x55')]();})['then'](function(){return db['Campaign'][_0x95d6('0x56')]({'attributes':['id',_0x95d6('0x4e')],'include':[{'model':db[_0x95d6('0x58')],'as':_0x95d6('0x4f'),'where':{'id':LISTID}}]})[_0x95d6('0x2c')](function(_0x2c8e0f){var _0x21b220=[];if(_0x2c8e0f){for(var _0x5a9912=0x0,_0x26e7c9;_0x5a9912<_0x2c8e0f[_0x95d6('0x1b')];_0x5a9912+=0x1){_0x26e7c9=_0x2c8e0f[_0x5a9912][_0x95d6('0x59')]({'plain':!![]});switch(_0x26e7c9[_0x95d6('0x4e')]){case _0x95d6('0x50'):_0x21b220[_0x95d6('0x2d')](db[_0x95d6('0x51')][_0x95d6('0x52')](_0x1626ea(_0x26e7c9,_0x95d6('0x5a')))['then'](function(){})[_0x95d6('0x2f')](_0x5421f3()));break;case _0x95d6('0x54'):_0x21b220[_0x95d6('0x2d')](db[_0x95d6('0x51')][_0x95d6('0x52')](_0x1dc0d3(_0x26e7c9,_0x95d6('0x5a')))[_0x95d6('0x2c')](function(){})['catch'](_0x5421f3()));break;default:_0x21b220[_0x95d6('0x2d')](db[_0x95d6('0x51')]['query'](_0xb91a5(_0x26e7c9,'CampaignId'))[_0x95d6('0x2c')](function(){})[_0x95d6('0x2f')](_0x5421f3()));}}}return _0x21b220;})['all']();})['then'](function(){return db[_0x95d6('0x5b')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x95d6('0x58')],'as':_0x95d6('0x5c'),'where':{'id':LISTID}}]})[_0x95d6('0x2c')](function(_0x2b21c7){var _0x59e2ed=[];if(_0x2b21c7){for(var _0x449d52=0x0,_0x28187d;_0x449d52<_0x2b21c7[_0x95d6('0x1b')];_0x449d52+=0x1){_0x28187d=_0x2b21c7[_0x449d52]['get']({'plain':!![]});_0x59e2ed[_0x95d6('0x2d')](db[_0x95d6('0x51')]['query'](_0x224f9e(_0x28187d,_0x95d6('0x5a')))['then'](function(){})[_0x95d6('0x2f')](_0x5421f3()));}}return _0x59e2ed;})['all']();})[_0x95d6('0x2f')](function(_0x384e0b){logger[_0x95d6('0x15')](_0x95d6('0x5d'),_0x95d6('0x5e'),_0x384e0b[_0x95d6('0x1d')]);});}var processPromises=function(_0xfff370){return BPromise[_0x95d6('0x55')](promises)[_0x95d6('0x2c')](function(_0x10d3ab){})[_0x95d6('0x2f')](function(_0x49e6b0){logger[_0x95d6('0x15')]('Error\x20processing\x20rows\x20block:',JSON[_0x95d6('0x31')](_0x49e6b0));})['finally'](function(){socket[_0x95d6('0x5f')](_0x95d6('0x60')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0xfff370){return _0xfff370['resume']();}});};var endCsv=function(){return BPromise[_0x95d6('0x61')]()[_0x95d6('0x2c')](function(){if(hopperContacts){return checkHopper();}})[_0x95d6('0x2c')](function(){socket[_0x95d6('0x5f')](_0x95d6('0x60')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x95d6('0x62')](FILEPATH);}catch(_0x2de296){logger[_0x95d6('0x15')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x95d6('0x31')](_0x2de296));}finally{process['exit'](0x0);}});};process['on'](_0x95d6('0x63'),function(){logger['info'](_0x95d6('0x64'));endCsv();});function main(){return BPromise[_0x95d6('0x61')]()[_0x95d6('0x2c')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x95d6('0x12')](',');return db[_0x95d6('0x29')][_0x95d6('0x56')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x95d6('0x2c')](function(_0x519056){var _0xe8ea36=fs[_0x95d6('0x65')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0xe8ea36,{'header':!![],'skipEmptyLines':!![],'step':function(_0x52405f,_0x4f0386){total+=0x1;var _0x57ad50=total;promises['push'](checkRow(_0x52405f,_0x519056,_0x57ad50)[_0x95d6('0x2c')](function(){success+=0x1;})[_0x95d6('0x2f')](function(_0xc60379){if(_0xc60379[_0x95d6('0x15')]){errors+=0x1;delete _0xc60379['error'];}else if(_0xc60379[_0x95d6('0x27')]){duplicates+=0x1;delete _0xc60379[_0x95d6('0x27')];}rows[_0x95d6('0x2d')](_0xc60379);}));if(total%0xc8===0x0){_0x4f0386[_0x95d6('0x66')]();return processPromises(_0x4f0386);}},'complete':function(){return processPromises()[_0x95d6('0x2c')](function(){logger[_0x95d6('0x67')](_0x95d6('0x68'));endCsv();});},'error':function(_0x4780cd,_0x2aafaa){logger[_0x95d6('0x67')]('CSV\x20parse\x20error',JSON[_0x95d6('0x31')](_0x4780cd));endCsv();}});})[_0x95d6('0x2f')](function(_0x56c973){logger[_0x95d6('0x15')](_0x95d6('0x69'),JSON[_0x95d6('0x31')](_0x56c973));});}main();
\ No newline at end of file
index 8edb862..fea1740 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x519c=['LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','finish','affectedRows','contact:import:','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','root','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','bluebird','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','import','defaults','redis','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','test','field','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','updatedAt','priority','UserId','recallme','select','fields','join','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper_black','createdAt','cm_contacts','cm_contacts.ListId\x20=\x20','ListId\x20=\x20?','\x20=\x20?','toString','keys','id\x20IN\x20?','MIN(id)','group','info','Received\x20SIGINT','error','exit','errors','code','query','spread','push','catch','message','stringify','send','binding','socket_timestamp','.csv','writeFileSync','parse','data','length','rows','hasOwnProperty','trim','scheduledat','isNaN','isNumber','includes','agent\x20not\x20exists','email','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','Abort\x20parser','abort','duplicates','cm_contacts_','CREATE\x20TABLE\x20'];(function(_0xe0b86c,_0x1b16dc){var _0xf607e3=function(_0x2c7cf1){while(--_0x2c7cf1){_0xe0b86c['push'](_0xe0b86c['shift']());}};_0xf607e3(++_0x1b16dc);}(_0x519c,0x19f));var _0xc519=function(_0x427faa,_0x4760d6){_0x427faa=_0x427faa-0x0;var _0x5420f3=_0x519c[_0x427faa];return _0x5420f3;};'use strict';var fs=require('fs');var path=require(_0xc519('0x0'));var _=require(_0xc519('0x1'));var Papa=require(_0xc519('0x2'));var util=require(_0xc519('0x3'));var BPromise=require(_0xc519('0x4'));var moment=require(_0xc519('0x5'));var squel=require(_0xc519('0x6'));var Redis=require('ioredis');var db=require(_0xc519('0x7'))['db'];var config=require(_0xc519('0x8'));var logger=require(_0xc519('0x9'))(_0xc519('0xa'));config['redis']=_[_0xc519('0xb')](config[_0xc519('0xc')],{'host':_0xc519('0xd'),'port':0x18eb});var socket=require(_0xc519('0xe'))(new Redis(config[_0xc519('0xc')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format'](_0xc519('0xf'));function isEmail(_0x512495){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))*$/[_0xc519('0x10')](_0x512495);}function selectNotIn(_0x153ef6,_0x3f5f65,_0x12bc59,_0x5f28e2,_0xde3ac2){return squel['select']()[_0xc519('0x11')]('phone')[_0xc519('0x12')](_0x5f28e2)['join'](_0x3f5f65,null,_0x3f5f65+_0xc519('0x13')+_0x5f28e2+'.'+_0x12bc59)[_0xc519('0x14')](_0x5f28e2+'.'+_0x12bc59+_0xc519('0x15')+_0x153ef6+'.'+_0x12bc59)['where'](_0x3f5f65+_0xc519('0x16')+_0xde3ac2['join']()+')');}function insertCmHopper(_0x489387,_0x3ddde4,_0x41dce5,_0x551be4,_0x3871e8){var _0x124087=[_0xc519('0x17'),_0xc519('0x18'),_0xc519('0x19'),_0xc519('0x1a'),_0x3ddde4+'.'+_0x551be4,_0xc519('0x1b'),_0xc519('0x1c'),_0xc519('0x1d'),'cm_contacts.UserId','\x22'+_0x3871e8+'\x22'];return squel[_0xc519('0x1e')]()[_0xc519('0x1f')](_0xc519('0x20'))[_0xc519('0x21')]([_0xc519('0x22'),'scheduledat',_0xc519('0x23'),_0xc519('0x24'),_0x551be4,'createdAt',_0xc519('0x25'),_0xc519('0x26'),_0xc519('0x27'),_0xc519('0x28')],squel[_0xc519('0x29')]()[_0xc519('0x2a')](_0x124087)[_0xc519('0x12')](_0x3ddde4)[_0xc519('0x2b')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x3ddde4+_0xc519('0x2c'))[_0xc519('0x2b')](_0x41dce5,null,_0x41dce5+'.id\x20=\x20'+_0x3ddde4+'.'+_0x551be4)[_0xc519('0x14')](_0x3ddde4+_0xc519('0x2d'),_0x489387)[_0xc519('0x14')](_0xc519('0x2e'),NOW)[_0xc519('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x3ddde4,_0x41dce5,_0x551be4,'cm_hopper',['\x22always\x22','\x22onlyIfOpen\x22']))[_0xc519('0x14')](_0xc519('0x2f'),selectNotIn(_0x3ddde4,_0x41dce5,_0x551be4,_0xc519('0x20'),['\x22always\x22'])))['toString']();}function insertCmHopperBlack(_0x2bdd35,_0x20aaa5,_0x49d6bc,_0xbd4957){var _0x459e5e=['cm_contacts.phone',_0xc519('0x19'),_0xc519('0x1a'),_0x20aaa5+'.'+_0xbd4957,_0xc519('0x1b'),'cm_contacts.updatedAt'];return squel[_0xc519('0x1e')]()[_0xc519('0x1f')](_0xc519('0x30'))[_0xc519('0x21')]([_0xc519('0x22'),_0xc519('0x23'),_0xc519('0x24'),_0xbd4957,_0xc519('0x31'),'updatedAt'],squel['select']()[_0xc519('0x2a')](_0x459e5e)[_0xc519('0x12')](_0x20aaa5)['join'](_0xc519('0x32'),null,_0xc519('0x33')+_0x20aaa5+_0xc519('0x2c'))[_0xc519('0x2b')](_0x49d6bc,null,_0x49d6bc+_0xc519('0x13')+_0x20aaa5+'.'+_0xbd4957)['where'](_0x20aaa5+_0xc519('0x2d'),_0x2bdd35)[_0xc519('0x14')](_0xc519('0x2e'),NOW)[_0xc519('0x14')](_0xc519('0x2f'),squel[_0xc519('0x29')]()['field'](_0xc519('0x22'))['from'](_0xc519('0x30'))[_0xc519('0x14')](_0xc519('0x34'),_0x2bdd35)['where'](_0xbd4957+_0xc519('0x35'),_0x20aaa5+'.'+_0xbd4957)))[_0xc519('0x36')]();}function insertCmContact(_0x4d5b49,_0x26079f,_0x596c51,_0x10705b){var _0x871e97=_['concat'](_[_0xc519('0x37')](_0x10705b),['ListId','CompanyId',_0xc519('0x31'),_0xc519('0x25')]);return squel[_0xc519('0x1e')]()[_0xc519('0x1f')]('cm_contacts')[_0xc519('0x21')](_0x871e97,squel['select']()[_0xc519('0x2a')](_0x871e97)['from'](_0x26079f)[_0xc519('0x14')]('('+_0x596c51['join'](',')+')\x20NOT\x20IN\x20?',squel[_0xc519('0x29')]()['fields'](_0x596c51)[_0xc519('0x12')](_0xc519('0x32'))[_0xc519('0x14')](_0xc519('0x34'),_0x4d5b49)[_0xc519('0x14')]('deletedAt\x20IS\x20NULL'))[_0xc519('0x14')](_0xc519('0x38'),squel[_0xc519('0x29')]()[_0xc519('0x11')](_0xc519('0x39'),'min_id')[_0xc519('0x12')](_0x26079f)[_0xc519('0x3a')](_0x596c51[_0xc519('0x2b')](','))))[_0xc519('0x36')]();}function handleStop(){logger[_0xc519('0x3b')](_0xc519('0x3c'));stopped=!![];}function handleUncaughtException(_0xd6520d){logger[_0xc519('0x3d')](_0xd6520d['message']);process[_0xc519('0x3e')](0x1);}function handleError(_0x30ec0a,_0x45f4c1){stats[_0xc519('0x3f')]['push']({'name':_0x45f4c1[_0xc519('0x40')],'message':_0x45f4c1['message'],'row':_0x30ec0a});}function handleQuery(_0x20a4f1){logger['info'](_0x20a4f1);return db['sequelize'][_0xc519('0x41')](_0x20a4f1)[_0xc519('0x42')](function(_0x4f849e){results[_0xc519('0x43')](_0x4f849e);})[_0xc519('0x44')](function(_0x453748){logger[_0xc519('0x3d')](_0x453748[_0xc519('0x45')]);});}function main(_0x34770e,_0x13c7a8,_0xf8fefe,_0x1175f4){logger[_0xc519('0x3b')]('main',_0x34770e,JSON[_0xc519('0x46')](_0x13c7a8));process[_0xc519('0x47')]('start');var _0x3b6016=_0x13c7a8[_0xc519('0x48')];var _0x40e18b=_0x13c7a8[_0xc519('0x49')];var _0x42b40b=path[_0xc519('0x2b')](config['root'],'server/files/tmp',_0x40e18b+_0xc519('0x4a'));var _0x56826f=_[_0xc519('0x37')](_0x3b6016)['join']();logger[_0xc519('0x3b')]('header',_0x56826f);fs[_0xc519('0x4b')](_0x42b40b,_0x56826f+'\x0a');Papa[_0xc519('0x4c')](fs['createReadStream'](_0x34770e),{'header':!![],'skipEmptyLines':!![],'step':function(_0x883abd,_0x224f7d){try{for(var _0x2a24c1=0x0,_0x1985a5=[];_0x2a24c1<_0x883abd[_0xc519('0x4d')][_0xc519('0x4e')];_0x2a24c1++){stats[_0xc519('0x4f')]+=0x1;if(_0x883abd[_0xc519('0x3f')][_0x2a24c1]){handleError(_0x883abd[_0xc519('0x4d')][_0x2a24c1],_0x883abd[_0xc519('0x3f')][_0x2a24c1]);}else{var _0x20e03d=[];for(var _0x1b7cbf in _0x3b6016){if(_0x3b6016[_0xc519('0x50')](_0x1b7cbf)){if(_0x883abd[_0xc519('0x4d')][_0x2a24c1][_0x3b6016[_0x1b7cbf]]){var _0x353170=_[_0xc519('0x51')](_0x883abd[_0xc519('0x4d')][_0x2a24c1][_0x3b6016[_0x1b7cbf]]['replace'](/"/g,'\x27'));switch(_0x1b7cbf){case _0xc519('0x52'):var _0x31699b=moment(_0x353170,_0xc519('0xf'),!![]);if(_0x31699b['isValid']()){_0x1985a5[_0xc519('0x43')]('\x22'+_0x353170+'\x22');}else{_0x20e03d[_0xc519('0x43')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xc519('0x26'):var _0x1afcdf=parseInt(_0x353170);_0x353170=_[_0xc519('0x53')](_0x1afcdf)||_0x1afcdf<0x0||_0x1afcdf>0x4?_0x1175f4?0x3:0x2:_0x1afcdf;_0x1985a5[_0xc519('0x43')]('\x22'+_0x353170+'\x22');break;case'UserId':var _0x4ea7cc=parseInt(_0x353170);if(_[_0xc519('0x54')](_0x4ea7cc)&&_[_0xc519('0x55')](_0xf8fefe,_0x4ea7cc)){_0x1985a5[_0xc519('0x43')]('\x22'+_0x4ea7cc+'\x22');}else{_0x20e03d['push'](_0xc519('0x56'));}break;case _0xc519('0x57'):if(isEmail(_0x353170)){_0x1985a5[_0xc519('0x43')]('\x22'+_0x353170+'\x22');}else{_0x20e03d[_0xc519('0x43')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x27d2ed=moment(_0x353170,_0xc519('0x58'),!![]);if(_0x27d2ed[_0xc519('0x59')]()){_0x1985a5[_0xc519('0x43')]('\x22'+_0x353170+'\x22');}else{_0x20e03d[_0xc519('0x43')](_0xc519('0x5a'));}break;default:_0x1985a5[_0xc519('0x43')]('\x22'+_0x353170+'\x22');}}else{switch(_0x1b7cbf){case _0xc519('0x5b'):case _0xc519('0x22'):_0x20e03d[_0xc519('0x43')](_0x1b7cbf+_0xc519('0x5c'));break;default:_0x1985a5['push']('\x22\x22');}}}}if(_0x20e03d[_0xc519('0x4e')]){handleError(_0x883abd[_0xc519('0x4d')][_0x2a24c1],{'code':_0xc519('0x5d'),'message':_0x20e03d[_0xc519('0x2b')]()});}else{fs[_0xc519('0x5e')](_0x42b40b,_0x1985a5[_0xc519('0x2b')]()+'\x0a');}_0x1985a5=[];}if(!(stats[_0xc519('0x4f')]%0xc8)){socket[_0xc519('0x5f')]('contact:import:'+_0x40e18b,stats);stats[_0xc519('0x3f')]=[];}}if(stopped){logger['info'](_0xc519('0x60'));_0x224f7d[_0xc519('0x61')]();}}catch(_0x58dea0){handleError(_0x883abd[_0xc519('0x4d')][_0x2a24c1],{'code':'SystemError','message':_0x58dea0[_0xc519('0x45')]});logger['error']('step',_0x58dea0[_0xc519('0x45')]);}},'complete':function(){try{var _0x122407=[];var _0x117a9a=_0xc519('0x32');if(_0x13c7a8[_0xc519('0x62')]&&_0x13c7a8['duplicates']['length']){_0x117a9a=_0xc519('0x63')+_0x40e18b;_0x122407['push'](_0xc519('0x64')+_0x117a9a+'\x20LIKE\x20cm_contacts;');}var _0x24a934=util['format'](_0xc519('0x65'),_0x42b40b,_0x117a9a,_0x56826f,_0x13c7a8[_0xc519('0x24')],_0x13c7a8[_0xc519('0x66')]||null,NOW,NOW);if(_[_0xc519('0x67')](_0x3b6016[_0xc519('0x52')])){_0x24a934+=_0xc519('0x68');}_0x122407[_0xc519('0x43')](_0x24a934);if(_0x13c7a8[_0xc519('0x62')]&&_0x13c7a8[_0xc519('0x62')][_0xc519('0x4e')]){_0x122407[_0xc519('0x43')](insertCmContact(_0x13c7a8[_0xc519('0x24')],_0x117a9a,_0x13c7a8['duplicates'],_0x3b6016));_0x122407[_0xc519('0x43')](_0xc519('0x69')+_0x117a9a+';');}_0x122407[_0xc519('0x43')](insertCmHopper(_0x13c7a8[_0xc519('0x24')],_0xc519('0x6a'),'voice_queues',_0xc519('0x6b'),_0x1175f4));_0x122407[_0xc519('0x43')](insertCmHopperBlack(_0x13c7a8[_0xc519('0x24')],_0xc519('0x6c'),'voice_queues',_0xc519('0x6b')));_0x122407['push'](insertCmHopper(_0x13c7a8[_0xc519('0x24')],_0xc519('0x6d'),_0xc519('0x6e'),_0xc519('0x6f'),_0x1175f4));_0x122407[_0xc519('0x43')](insertCmHopperBlack(_0x13c7a8[_0xc519('0x24')],'campaigns_has_cm_blacklists','campaigns','CampaignId'));BPromise['each'](_0x122407,handleQuery)['then'](function(_0x56e9b2){stats[_0xc519('0x70')]=!![];stats['affectedRows']=_0x13c7a8[_0xc519('0x62')]&&_0x13c7a8['duplicates']['length']?results[0x2][_0xc519('0x71')]:results[0x0]['affectedRows'];socket[_0xc519('0x5f')](_0xc519('0x72')+_0x40e18b,stats);fs[_0xc519('0x73')](_0x34770e);fs[_0xc519('0x73')](_0x42b40b);process[_0xc519('0x3e')](0x0);})['catch'](function(_0x33aa72){logger[_0xc519('0x3d')](_0x33aa72['message']);process[_0xc519('0x3e')](0x1);});}catch(_0x11daa2){logger[_0xc519('0x3d')](_0xc519('0x74'),_0x11daa2[_0xc519('0x45')]);process[_0xc519('0x3e')](0x1);}},'error':function(_0x1d71b3,_0x508a72,_0x49c159,_0x20821a){throw new Error(_0x20821a);}});}function validate(){if(process[_0xc519('0x75')]&&process[_0xc519('0x75')]['length']<0x4){throw new Error(_0xc519('0x76'));}var _0x3736b7=path[_0xc519('0x2b')](config[_0xc519('0x77')],'server/files/tmp',process[_0xc519('0x75')][0x2]);if(!fs[_0xc519('0x78')](_0x3736b7)){throw new Error(_0xc519('0x79'));}var _0x47f51b={};try{_0x47f51b=JSON['parse'](process['argv'][0x3]);if(!_0x47f51b[_0xc519('0x48')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x47f51b[_0xc519('0x48')][_0xc519('0x22')]){throw new Error(_0xc519('0x7a'));}if(!_0x47f51b[_0xc519('0x48')]['firstName']){throw new Error(_0xc519('0x7b'));}var _0x29bd73=0x0;if(_0x47f51b[_0xc519('0x48')][_0xc519('0x27')]){_0x29bd73=0x1;}if(!_0x47f51b[_0xc519('0x24')]){throw new Error(_0xc519('0x7c'));}}catch(_0x45dbf5){throw new Error(_0xc519('0x7d'));}var _0x36a913=[];try{_0x36a913=_[_0xc519('0x7e')](JSON[_0xc519('0x4c')](process['argv'][0x4]),'id');}catch(_0x315b30){logger['info'](_0xc519('0x7f'));}main(_0x3736b7,_0x47f51b,_0x36a913,_0x29bd73);}validate();process['on'](_0xc519('0x80'),handleStop);process['on']('uncaughtException',handleUncaughtException);
\ No newline at end of file
+var _0xc319=['emit','Abort\x20parser','abort','step','duplicates','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','campaigns_has_cm_blacklists','CampaignId','each','finish','affectedRows','unlink','argv','existsSync','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','parse','No\x20agent\x20available','SIGINT','path','lodash','papaparse','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','select','field','from','join','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','fromQuery','scheduledat','ListId','createdAt','updatedAt','UserId','recallme','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','toString','cm_contacts.id','insert','cm_hopper_black','phone','ContactId','fields','cm_contacts','ListId\x20=\x20?','\x20=\x20?','concat','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','push','code','sequelize','query','catch','main','stringify','send','binding','socket_timestamp','root','server/files/tmp','.csv','keys','header','writeFileSync','data','length','rows','hasOwnProperty','trim','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNumber','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync'];(function(_0x13175e,_0x39df09){var _0x971c1e=function(_0x58fe54){while(--_0x58fe54){_0x13175e['push'](_0x13175e['shift']());}};_0x971c1e(++_0x39df09);}(_0xc319,0x12e));var _0x9c31=function(_0x361b52,_0x1ff7b6){_0x361b52=_0x361b52-0x0;var _0x2e9bf9=_0xc319[_0x361b52];return _0x2e9bf9;};'use strict';var fs=require('fs');var path=require(_0x9c31('0x0'));var _=require(_0x9c31('0x1'));var Papa=require(_0x9c31('0x2'));var util=require('util');var BPromise=require(_0x9c31('0x3'));var moment=require(_0x9c31('0x4'));var squel=require('squel');var Redis=require(_0x9c31('0x5'));var db=require(_0x9c31('0x6'))['db'];var config=require(_0x9c31('0x7'));var logger=require(_0x9c31('0x8'))('import');config[_0x9c31('0x9')]=_[_0x9c31('0xa')](config[_0x9c31('0x9')],{'host':_0x9c31('0xb'),'port':0x18eb});var socket=require(_0x9c31('0xc'))(new Redis(config[_0x9c31('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x9c31('0xd')](_0x9c31('0xe'));function isEmail(_0x361c32){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'](_0x361c32);}function selectNotIn(_0x57a0b3,_0x5de62b,_0x1d8b8b,_0x2c026b,_0x14a649){return squel[_0x9c31('0xf')]()[_0x9c31('0x10')]('phone')[_0x9c31('0x11')](_0x2c026b)[_0x9c31('0x12')](_0x5de62b,null,_0x5de62b+_0x9c31('0x13')+_0x2c026b+'.'+_0x1d8b8b)['where'](_0x2c026b+'.'+_0x1d8b8b+_0x9c31('0x14')+_0x57a0b3+'.'+_0x1d8b8b)[_0x9c31('0x15')](_0x5de62b+_0x9c31('0x16')+_0x14a649[_0x9c31('0x12')]()+')');}function insertCmHopper(_0x102d0b,_0x4d9601,_0x52037f,_0x513815,_0x4ef0ea){var _0x4c6645=[_0x9c31('0x17'),_0x9c31('0x18'),'cm_contacts.id',_0x9c31('0x19'),_0x4d9601+'.'+_0x513815,_0x9c31('0x1a'),_0x9c31('0x1b'),_0x9c31('0x1c'),_0x9c31('0x1d'),'\x22'+_0x4ef0ea+'\x22'];return squel['insert']()[_0x9c31('0x1e')]('cm_hopper')[_0x9c31('0x1f')](['phone',_0x9c31('0x20'),'ContactId',_0x9c31('0x21'),_0x513815,_0x9c31('0x22'),_0x9c31('0x23'),'priority',_0x9c31('0x24'),_0x9c31('0x25')],squel[_0x9c31('0xf')]()['fields'](_0x4c6645)[_0x9c31('0x11')](_0x4d9601)[_0x9c31('0x12')]('cm_contacts',null,_0x9c31('0x26')+_0x4d9601+_0x9c31('0x27'))[_0x9c31('0x12')](_0x52037f,null,_0x52037f+_0x9c31('0x13')+_0x4d9601+'.'+_0x513815)['where'](_0x4d9601+_0x9c31('0x28'),_0x102d0b)[_0x9c31('0x15')](_0x9c31('0x29'),NOW)[_0x9c31('0x15')](_0x9c31('0x2a'),selectNotIn(_0x4d9601,_0x52037f,_0x513815,_0x9c31('0x2b'),[_0x9c31('0x2c'),'\x22onlyIfOpen\x22']))[_0x9c31('0x15')](_0x9c31('0x2a'),selectNotIn(_0x4d9601,_0x52037f,_0x513815,_0x9c31('0x2b'),[_0x9c31('0x2c')])))[_0x9c31('0x2d')]();}function insertCmHopperBlack(_0x3a9b00,_0x5206c2,_0x183916,_0x4ced52){var _0x48d270=[_0x9c31('0x17'),_0x9c31('0x2e'),_0x9c31('0x19'),_0x5206c2+'.'+_0x4ced52,_0x9c31('0x1a'),'cm_contacts.updatedAt'];return squel[_0x9c31('0x2f')]()[_0x9c31('0x1e')](_0x9c31('0x30'))[_0x9c31('0x1f')]([_0x9c31('0x31'),_0x9c31('0x32'),_0x9c31('0x21'),_0x4ced52,'createdAt',_0x9c31('0x23')],squel[_0x9c31('0xf')]()[_0x9c31('0x33')](_0x48d270)[_0x9c31('0x11')](_0x5206c2)[_0x9c31('0x12')](_0x9c31('0x34'),null,_0x9c31('0x26')+_0x5206c2+_0x9c31('0x27'))[_0x9c31('0x12')](_0x183916,null,_0x183916+_0x9c31('0x13')+_0x5206c2+'.'+_0x4ced52)[_0x9c31('0x15')](_0x5206c2+_0x9c31('0x28'),_0x3a9b00)[_0x9c31('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x9c31('0x2a'),squel[_0x9c31('0xf')]()[_0x9c31('0x10')](_0x9c31('0x31'))['from'](_0x9c31('0x30'))[_0x9c31('0x15')](_0x9c31('0x35'),_0x3a9b00)[_0x9c31('0x15')](_0x4ced52+_0x9c31('0x36'),_0x5206c2+'.'+_0x4ced52)))[_0x9c31('0x2d')]();}function insertCmContact(_0x3e5263,_0x474829,_0x51992d,_0xf4aa5d){var _0x1181a0=_[_0x9c31('0x37')](_['keys'](_0xf4aa5d),[_0x9c31('0x21'),_0x9c31('0x38'),_0x9c31('0x22'),'updatedAt']);return squel[_0x9c31('0x2f')]()[_0x9c31('0x1e')]('cm_contacts')['fromQuery'](_0x1181a0,squel[_0x9c31('0xf')]()[_0x9c31('0x33')](_0x1181a0)[_0x9c31('0x11')](_0x474829)[_0x9c31('0x15')]('('+_0x51992d[_0x9c31('0x12')](',')+_0x9c31('0x39'),squel['select']()[_0x9c31('0x33')](_0x51992d)['from'](_0x9c31('0x34'))[_0x9c31('0x15')](_0x9c31('0x35'),_0x3e5263)[_0x9c31('0x15')](_0x9c31('0x3a')))[_0x9c31('0x15')]('id\x20IN\x20?',squel['select']()[_0x9c31('0x10')](_0x9c31('0x3b'),_0x9c31('0x3c'))[_0x9c31('0x11')](_0x474829)[_0x9c31('0x3d')](_0x51992d[_0x9c31('0x12')](','))))[_0x9c31('0x2d')]();}function handleStop(){logger[_0x9c31('0x3e')](_0x9c31('0x3f'));stopped=!![];}function handleUncaughtException(_0x507a34){logger[_0x9c31('0x40')](_0x507a34[_0x9c31('0x41')]);process[_0x9c31('0x42')](0x1);}function handleError(_0x5a3599,_0x1e085c){stats[_0x9c31('0x43')][_0x9c31('0x44')]({'name':_0x1e085c[_0x9c31('0x45')],'message':_0x1e085c[_0x9c31('0x41')],'row':_0x5a3599});}function handleQuery(_0x57e5d0){logger[_0x9c31('0x3e')](_0x57e5d0);return db[_0x9c31('0x46')][_0x9c31('0x47')](_0x57e5d0)['spread'](function(_0x424c2a){results[_0x9c31('0x44')](_0x424c2a);})[_0x9c31('0x48')](function(_0x1f1238){logger[_0x9c31('0x40')](_0x1f1238[_0x9c31('0x41')]);});}function main(_0x307e96,_0x47d87e,_0x5dfe58,_0x3c7f7d){logger[_0x9c31('0x3e')](_0x9c31('0x49'),_0x307e96,JSON[_0x9c31('0x4a')](_0x47d87e));process[_0x9c31('0x4b')]('start');var _0x5de419=_0x47d87e[_0x9c31('0x4c')];var _0xe8b81a=_0x47d87e[_0x9c31('0x4d')];var _0x2371f7=path[_0x9c31('0x12')](config[_0x9c31('0x4e')],_0x9c31('0x4f'),_0xe8b81a+_0x9c31('0x50'));var _0x587a8e=_[_0x9c31('0x51')](_0x5de419)['join']();logger['info'](_0x9c31('0x52'),_0x587a8e);fs[_0x9c31('0x53')](_0x2371f7,_0x587a8e+'\x0a');Papa['parse'](fs['createReadStream'](_0x307e96),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3dd0d8,_0x1e0e47){try{for(var _0x403ad4=0x0,_0x527057=[];_0x403ad4<_0x3dd0d8[_0x9c31('0x54')][_0x9c31('0x55')];_0x403ad4++){stats[_0x9c31('0x56')]+=0x1;if(_0x3dd0d8['errors'][_0x403ad4]){handleError(_0x3dd0d8[_0x9c31('0x54')][_0x403ad4],_0x3dd0d8[_0x9c31('0x43')][_0x403ad4]);}else{var _0x1a3b20=[];for(var _0x25cb3d in _0x5de419){if(_0x5de419[_0x9c31('0x57')](_0x25cb3d)){if(_0x3dd0d8['data'][_0x403ad4][_0x5de419[_0x25cb3d]]){var _0x539b68=_[_0x9c31('0x58')](_0x3dd0d8[_0x9c31('0x54')][_0x403ad4][_0x5de419[_0x25cb3d]][_0x9c31('0x59')](/"/g,'\x27'));switch(_0x25cb3d){case'scheduledat':var _0xea5b99=moment(_0x539b68,_0x9c31('0xe'),!![]);if(_0xea5b99['isValid']()){_0x527057[_0x9c31('0x44')]('\x22'+_0x539b68+'\x22');}else{_0x1a3b20[_0x9c31('0x44')](_0x9c31('0x5a'));}break;case _0x9c31('0x5b'):var _0x526ac0=parseInt(_0x539b68);_0x539b68=_['isNaN'](_0x526ac0)||_0x526ac0<0x0||_0x526ac0>0x4?_0x3c7f7d?0x3:0x2:_0x526ac0;_0x527057[_0x9c31('0x44')]('\x22'+_0x539b68+'\x22');break;case'UserId':var _0x38749c=parseInt(_0x539b68);if(_[_0x9c31('0x5c')](_0x38749c)&&_['includes'](_0x5dfe58,_0x38749c)){_0x527057[_0x9c31('0x44')]('\x22'+_0x38749c+'\x22');}else{_0x1a3b20['push']('agent\x20not\x20exists');}break;case _0x9c31('0x5d'):if(isEmail(_0x539b68)){_0x527057[_0x9c31('0x44')]('\x22'+_0x539b68+'\x22');}else{_0x1a3b20[_0x9c31('0x44')](_0x9c31('0x5e'));}break;case _0x9c31('0x5f'):var _0x40a7df=moment(_0x539b68,_0x9c31('0x60'),!![]);if(_0x40a7df[_0x9c31('0x61')]()){_0x527057[_0x9c31('0x44')]('\x22'+_0x539b68+'\x22');}else{_0x1a3b20[_0x9c31('0x44')](_0x9c31('0x62'));}break;default:_0x527057[_0x9c31('0x44')]('\x22'+_0x539b68+'\x22');}}else{switch(_0x25cb3d){case _0x9c31('0x63'):case'phone':_0x1a3b20[_0x9c31('0x44')](_0x25cb3d+_0x9c31('0x64'));break;default:_0x527057[_0x9c31('0x44')]('\x22\x22');}}}}if(_0x1a3b20['length']){handleError(_0x3dd0d8[_0x9c31('0x54')][_0x403ad4],{'code':_0x9c31('0x65'),'message':_0x1a3b20['join']()});}else{fs[_0x9c31('0x66')](_0x2371f7,_0x527057['join']()+'\x0a');}_0x527057=[];}if(!(stats['rows']%0xc8)){socket[_0x9c31('0x67')]('contact:import:'+_0xe8b81a,stats);stats['errors']=[];}}if(stopped){logger[_0x9c31('0x3e')](_0x9c31('0x68'));_0x1e0e47[_0x9c31('0x69')]();}}catch(_0x283dda){handleError(_0x3dd0d8[_0x9c31('0x54')][_0x403ad4],{'code':'SystemError','message':_0x283dda[_0x9c31('0x41')]});logger[_0x9c31('0x40')](_0x9c31('0x6a'),_0x283dda[_0x9c31('0x41')]);}},'complete':function(){try{var _0x5db688=[];var _0x183ae5=_0x9c31('0x34');if(_0x47d87e[_0x9c31('0x6b')]&&_0x47d87e['duplicates'][_0x9c31('0x55')]){_0x183ae5='cm_contacts_'+_0xe8b81a;_0x5db688[_0x9c31('0x44')](_0x9c31('0x6c')+_0x183ae5+_0x9c31('0x6d'));}var _0x5998bf=util[_0x9c31('0xd')]('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x2371f7,_0x183ae5,_0x587a8e,_0x47d87e[_0x9c31('0x21')],_0x47d87e[_0x9c31('0x38')]||null,NOW,NOW);if(_[_0x9c31('0x6e')](_0x5de419['scheduledat'])){_0x5998bf+=_0x9c31('0x6f');}_0x5db688['push'](_0x5998bf);if(_0x47d87e['duplicates']&&_0x47d87e[_0x9c31('0x6b')][_0x9c31('0x55')]){_0x5db688['push'](insertCmContact(_0x47d87e['ListId'],_0x183ae5,_0x47d87e[_0x9c31('0x6b')],_0x5de419));_0x5db688[_0x9c31('0x44')](_0x9c31('0x70')+_0x183ae5+';');}_0x5db688[_0x9c31('0x44')](insertCmHopper(_0x47d87e[_0x9c31('0x21')],_0x9c31('0x71'),_0x9c31('0x72'),_0x9c31('0x73'),_0x3c7f7d));_0x5db688['push'](insertCmHopperBlack(_0x47d87e[_0x9c31('0x21')],_0x9c31('0x74'),_0x9c31('0x72'),_0x9c31('0x73')));_0x5db688[_0x9c31('0x44')](insertCmHopper(_0x47d87e['ListId'],_0x9c31('0x75'),_0x9c31('0x76'),'CampaignId',_0x3c7f7d));_0x5db688[_0x9c31('0x44')](insertCmHopperBlack(_0x47d87e['ListId'],_0x9c31('0x77'),'campaigns',_0x9c31('0x78')));BPromise[_0x9c31('0x79')](_0x5db688,handleQuery)['then'](function(_0x1d2f81){stats[_0x9c31('0x7a')]=!![];stats[_0x9c31('0x7b')]=_0x47d87e[_0x9c31('0x6b')]&&_0x47d87e[_0x9c31('0x6b')][_0x9c31('0x55')]?results[0x2][_0x9c31('0x7b')]:results[0x0][_0x9c31('0x7b')];socket[_0x9c31('0x67')]('contact:import:'+_0xe8b81a,stats);fs['unlink'](_0x307e96);fs[_0x9c31('0x7c')](_0x2371f7);process[_0x9c31('0x42')](0x0);})[_0x9c31('0x48')](function(_0x17ce79){logger[_0x9c31('0x40')](_0x17ce79['message']);process[_0x9c31('0x42')](0x1);});}catch(_0x451847){logger[_0x9c31('0x40')]('complete',_0x451847[_0x9c31('0x41')]);process['exit'](0x1);}},'error':function(_0x333650,_0x2c4bb2,_0x315c64,_0x4a6065){throw new Error(_0x4a6065);}});}function validate(){if(process[_0x9c31('0x7d')]&&process['argv'][_0x9c31('0x55')]<0x4){throw new Error('arguments\x20<filename>\x20<parameters>\x20<agents>');}var _0x4c7930=path[_0x9c31('0x12')](config[_0x9c31('0x4e')],_0x9c31('0x4f'),process[_0x9c31('0x7d')][0x2]);if(!fs[_0x9c31('0x7e')](_0x4c7930)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x503cab={};try{_0x503cab=JSON['parse'](process[_0x9c31('0x7d')][0x3]);if(!_0x503cab[_0x9c31('0x4c')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x503cab[_0x9c31('0x4c')][_0x9c31('0x31')]){throw new Error(_0x9c31('0x7f'));}if(!_0x503cab[_0x9c31('0x4c')][_0x9c31('0x63')]){throw new Error(_0x9c31('0x80'));}var _0x1b8c58=0x0;if(_0x503cab[_0x9c31('0x4c')][_0x9c31('0x24')]){_0x1b8c58=0x1;}if(!_0x503cab[_0x9c31('0x21')]){throw new Error(_0x9c31('0x81'));}}catch(_0x5f2823){throw new Error(_0x9c31('0x82'));}var _0x132197=[];try{_0x132197=_[_0x9c31('0x83')](JSON[_0x9c31('0x84')](process[_0x9c31('0x7d')][0x4]),'id');}catch(_0x175d3e){logger[_0x9c31('0x3e')](_0x9c31('0x85'));}main(_0x4c7930,_0x503cab,_0x132197,_0x1b8c58);}validate();process['on'](_0x9c31('0x86'),handleStop);process['on']('uncaughtException',handleUncaughtException);
\ No newline at end of file
index a08d018..c640eca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59c4=['destcalleridname','Agent\x20Number','destcalleridnum','***\x20Time\x20Info\x20***','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','uniqueid','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','queue','calleridnum','outbound','Outbound\x20Call','variable','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','Date','agentcalledAt','Agent\x20Name'];(function(_0x1b7759,_0x4bfc2b){var _0x4f0d0c=function(_0x5c0c01){while(--_0x5c0c01){_0x1b7759['push'](_0x1b7759['shift']());}};_0x4f0d0c(++_0x4bfc2b);}(_0x59c4,0x1a0));var _0x459c=function(_0x1705a1,_0x327cdf){_0x1705a1=_0x1705a1-0x0;var _0x2d37fa=_0x59c4[_0x1705a1];return _0x2d37fa;};'use strict';exports[_0x459c('0x0')]=function(_0x5c5808,_0x4ed9ec){var _0xf60d0a=[{'type':_0x459c('0x1'),'content':_0x459c('0x2'),'variableName':null}];switch(_0x5c5808[_0x459c('0x3')]()){case _0x459c('0x4'):switch(_0x4ed9ec[_0x459c('0x3')]()){case _0x459c('0x5'):_0xf60d0a[_0x459c('0x6')]({'type':'variable','content':'','variableName':_0x459c('0x7')});_0xf60d0a[_0x459c('0x6')]({'type':'variable','content':'','variableName':_0x459c('0x8')});break;case _0x459c('0x9'):_0xf60d0a[_0x459c('0x6')]({'type':_0x459c('0x1'),'content':_0x459c('0xa'),'variableName':null});_0xf60d0a[_0x459c('0x6')]({'type':_0x459c('0xb'),'content':'','variableName':'destcalleridnum'});break;}}return _0xf60d0a;};exports[_0x459c('0xc')]=function(_0x16ac24,_0x1642ed){var _0x1fa70d=[];switch(_0x16ac24[_0x459c('0x3')]()){case _0x459c('0x4'):switch(_0x1642ed[_0x459c('0x3')]()){case _0x459c('0x5'):_0x1fa70d=[{'type':_0x459c('0x1'),'content':_0x459c('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0xf'),'keyType':_0x459c('0xb'),'variableName':'calleridnum'},{'type':'keyValue','content':'','key':_0x459c('0x10'),'keyType':_0x459c('0xb'),'variableName':_0x459c('0x11')},{'type':'keyValue','content':'','key':_0x459c('0x12'),'keyType':_0x459c('0xb'),'variableName':_0x459c('0x13')},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0x14'),'keyType':'variable','variableName':_0x459c('0x7')},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0x15'),'keyType':_0x459c('0xb'),'variableName':'uniqueid'},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0x16'),'keyType':_0x459c('0xb'),'variableName':_0x459c('0x17')},{'type':'string','content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0x18'),'keyType':'variable','variableName':_0x459c('0x19')},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0x1a'),'keyType':_0x459c('0xb'),'variableName':_0x459c('0x1b')},{'type':_0x459c('0x1'),'content':_0x459c('0x1c'),'key':null,'keyType':null,'variableName':null},{'type':_0x459c('0xe'),'content':'','key':'Agent\x20Ring','keyType':_0x459c('0xb'),'variableName':_0x459c('0x17')},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0x1d'),'keyType':_0x459c('0xb'),'variableName':_0x459c('0x1e')},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0x1f'),'keyType':_0x459c('0xb'),'variableName':_0x459c('0x20')},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0x21'),'keyType':'variable','variableName':_0x459c('0x22')},{'type':'keyValue','content':'','key':_0x459c('0x23'),'keyType':'variable','variableName':_0x459c('0x24')}];break;case _0x459c('0x9'):_0x1fa70d=[{'type':_0x459c('0x1'),'content':_0x459c('0xd'),'variableName':null},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0x25'),'keyType':_0x459c('0xb'),'keyContent':'','variableName':_0x459c('0x1b')},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0x26'),'keyType':_0x459c('0xb'),'keyContent':'','variableName':'membername'},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0x15'),'keyType':_0x459c('0xb'),'keyContent':'','variableName':_0x459c('0x27')},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0x16'),'keyType':_0x459c('0xb'),'keyContent':'','variableName':_0x459c('0x28')},{'type':_0x459c('0x1'),'content':_0x459c('0x1c')},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0x29'),'keyType':_0x459c('0xb'),'keyContent':'','variableName':_0x459c('0x2a')},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0x2b'),'keyType':'variable','keyContent':'','variableName':_0x459c('0x2c')},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0x2d'),'keyType':_0x459c('0xb'),'keyContent':'','variableName':_0x459c('0x2e')},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0x2f'),'keyType':_0x459c('0xb'),'keyContent':'','variableName':_0x459c('0x30')}];break;}}return _0x1fa70d;};
\ No newline at end of file
+var _0x4da3=['voice','inbound','push','variable','queue','outbound','getDescriptions','keyValue','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','agentcompleteAt','Hold\x20Time','holdtime','talktime','***\x20Call\x20Info\x20***','Called\x20Number','destcalleridnum','Member\x20Name','membername','UniqueId','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','billableseconds','string','[xCALLY\x20Ticket]','toLowerCase'];(function(_0x465971,_0x5a1e01){var _0x357b35=function(_0x2626a4){while(--_0x2626a4){_0x465971['push'](_0x465971['shift']());}};_0x357b35(++_0x5a1e01);}(_0x4da3,0x138));var _0x34da=function(_0x4c4ecc,_0x19b401){_0x4c4ecc=_0x4c4ecc-0x0;var _0x57aa22=_0x4da3[_0x4c4ecc];return _0x57aa22;};'use strict';exports['getSubjects']=function(_0x560767,_0x199f9f){var _0x89f465=[{'type':_0x34da('0x0'),'content':_0x34da('0x1'),'variableName':null}];switch(_0x560767[_0x34da('0x2')]()){case _0x34da('0x3'):switch(_0x199f9f['toLowerCase']()){case _0x34da('0x4'):_0x89f465[_0x34da('0x5')]({'type':_0x34da('0x6'),'content':'','variableName':_0x34da('0x7')});_0x89f465[_0x34da('0x5')]({'type':_0x34da('0x6'),'content':'','variableName':'calleridnum'});break;case _0x34da('0x8'):_0x89f465['push']({'type':_0x34da('0x0'),'content':'Outbound\x20Call','variableName':null});_0x89f465[_0x34da('0x5')]({'type':_0x34da('0x6'),'content':'','variableName':'destcalleridnum'});break;}}return _0x89f465;};exports[_0x34da('0x9')]=function(_0x4df01d,_0x19818f){var _0x209684=[];switch(_0x4df01d['toLowerCase']()){case _0x34da('0x3'):switch(_0x19818f[_0x34da('0x2')]()){case'inbound':_0x209684=[{'type':_0x34da('0x0'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x34da('0xa'),'content':'','key':'Caller\x20Number','keyType':_0x34da('0x6'),'variableName':'calleridnum'},{'type':_0x34da('0xa'),'content':'','key':_0x34da('0xb'),'keyType':_0x34da('0x6'),'variableName':_0x34da('0xc')},{'type':_0x34da('0xa'),'content':'','key':_0x34da('0xd'),'keyType':_0x34da('0x6'),'variableName':_0x34da('0xe')},{'type':'keyValue','content':'','key':_0x34da('0xf'),'keyType':_0x34da('0x6'),'variableName':'queue'},{'type':'keyValue','content':'','key':'UniqueId','keyType':'variable','variableName':_0x34da('0x10')},{'type':_0x34da('0xa'),'content':'','key':_0x34da('0x11'),'keyType':'variable','variableName':_0x34da('0x12')},{'type':'string','content':_0x34da('0x13'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x34da('0x14'),'keyType':_0x34da('0x6'),'variableName':_0x34da('0x15')},{'type':_0x34da('0xa'),'content':'','key':_0x34da('0x16'),'keyType':'variable','variableName':'destcalleridnum'},{'type':_0x34da('0x0'),'content':_0x34da('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0x34da('0xa'),'content':'','key':_0x34da('0x18'),'keyType':_0x34da('0x6'),'variableName':_0x34da('0x12')},{'type':_0x34da('0xa'),'content':'','key':_0x34da('0x19'),'keyType':_0x34da('0x6'),'variableName':_0x34da('0x1a')},{'type':_0x34da('0xa'),'content':'','key':'Agent\x20Complete','keyType':_0x34da('0x6'),'variableName':_0x34da('0x1b')},{'type':_0x34da('0xa'),'content':'','key':_0x34da('0x1c'),'keyType':_0x34da('0x6'),'variableName':_0x34da('0x1d')},{'type':'keyValue','content':'','key':'Talk\x20Time','keyType':_0x34da('0x6'),'variableName':_0x34da('0x1e')}];break;case _0x34da('0x8'):_0x209684=[{'type':_0x34da('0x0'),'content':_0x34da('0x1f'),'variableName':null},{'type':_0x34da('0xa'),'content':'','key':_0x34da('0x20'),'keyType':_0x34da('0x6'),'keyContent':'','variableName':_0x34da('0x21')},{'type':_0x34da('0xa'),'content':'','key':_0x34da('0x22'),'keyType':'variable','keyContent':'','variableName':_0x34da('0x23')},{'type':'keyValue','content':'','key':_0x34da('0x24'),'keyType':_0x34da('0x6'),'keyContent':'','variableName':_0x34da('0x10')},{'type':_0x34da('0xa'),'content':'','key':_0x34da('0x11'),'keyType':'variable','keyContent':'','variableName':_0x34da('0x25')},{'type':_0x34da('0x0'),'content':_0x34da('0x17')},{'type':_0x34da('0xa'),'content':'','key':_0x34da('0x26'),'keyType':_0x34da('0x6'),'keyContent':'','variableName':_0x34da('0x27')},{'type':_0x34da('0xa'),'content':'','key':_0x34da('0x28'),'keyType':_0x34da('0x6'),'keyContent':'','variableName':_0x34da('0x29')},{'type':'keyValue','content':'','key':_0x34da('0x2a'),'keyType':'variable','keyContent':'','variableName':_0x34da('0x2b')},{'type':_0x34da('0xa'),'content':'','key':'Billable\x20Time','keyType':_0x34da('0x6'),'keyContent':'','variableName':_0x34da('0x2c')}];break;}}return _0x209684;};
\ No newline at end of file
index 17b8940..b229220 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x203f=['fax-interactions','sms-interactions','whatsapp-interactions','upperFirst','InteractionId','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null','Interaction','then','info','error','user','query','clone','body','omit','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x203f,0xf0));var _0xf203=function(_0x2d9c6a,_0x59393d){_0x2d9c6a=_0x2d9c6a-0x0;var _0xf3c918=_0x203f[_0x2d9c6a];return _0xf3c918;};'use strict';var _=require(_0xf203('0x0'));var db=require(_0xf203('0x1'))['db'];var loggers={'openchannel':require(_0xf203('0x2'))('openchannel-interactions'),'mail':require(_0xf203('0x2'))('mail-interactions'),'fax':require(_0xf203('0x2'))(_0xf203('0x3')),'sms':require(_0xf203('0x2'))(_0xf203('0x4')),'chat':require('../../config/logger')('chat-interactions'),'whatsapp':require('../../config/logger')(_0xf203('0x5'))};function getInteractionId(_0x194f44,_0x4638fd,_0x15ec6b){if(_0x194f44&&_0x194f44[_[_0xf203('0x6')](_0x15ec6b)+'InteractionId']){return _0x194f44[_[_0xf203('0x6')](_0x15ec6b)+_0xf203('0x7')];}else if(_0x194f44&&_0x194f44['id']){return _0x194f44['id'];}else if(_0x4638fd&&_0x4638fd['id']){return _0x4638fd['id'];}else{return'unknown';}}function log(_0x27e181,_0x262fba,_0x1d64dd,_0x35892f,_0x3022bd,_0x579397){loggers[_0x3022bd[_0xf203('0x8')]()][_0x27e181](_0xf203('0x9'),_0x579397['toUpperCase'](),_0x262fba?_0x262fba['id']:null,_0x262fba?_0x262fba[_0xf203('0xa')]:null,_0x262fba?_0x262fba[_0xf203('0xb')]:null,getInteractionId(_0x1d64dd,_0x35892f,_0x3022bd),_0x1d64dd?JSON[_0xf203('0xc')](_0x1d64dd):_0xf203('0xd'));}function updateUser(_0x25a8f6,_0x2248ef,_0x4e82f4,_0x15c520,_0x44515c){db[_['upperFirst'](_0x15c520)+_0xf203('0xe')]['findOne']({'where':{'id':getInteractionId(_0x2248ef,_0x4e82f4,_0x15c520)}})['then'](function(_0x5a4fcf){if(_0x5a4fcf){return _0x5a4fcf['update']({'UserId':_0x25a8f6?_0x25a8f6['id']:null});}})[_0xf203('0xf')](function(_0x50c15f){if(_0x50c15f){log(_0xf203('0x10'),_0x25a8f6,_0x2248ef,_0x4e82f4,_0x15c520,_0x44515c);}})['catch'](function(){log(_0xf203('0x11'),_0x25a8f6,_0x2248ef,_0x4e82f4,_0x15c520,_0x44515c);});}exports['tracked']=function(_0x3bbd14,_0x285195){return function(_0x401619,_0x4657ef,_0x15f713){var _0x3790f6=_0x401619[_0xf203('0x12')];var _0x35fda6={};var _0x3838cf=_0x401619[_0xf203('0x13')];if(_0x35fda6){_0x35fda6=_[_0xf203('0x14')](_0x401619[_0xf203('0x15')]);_0x35fda6=_[_0xf203('0x16')](_0x35fda6,[_0xf203('0x15'),_0xf203('0x17'),_0xf203('0x18'),_0xf203('0x19'),_0xf203('0x1a')]);}updateUser(_0x3790f6,_0x35fda6,_0x3838cf,_0x3bbd14,_0x285195);_0x15f713(null);};};
\ No newline at end of file
+var _0x9b40=['findOne','then','info','catch','user','query','omit','body','html','phone','fax','mobile','../../mysqldb','openchannel-interactions','../../config/logger','mail-interactions','sms-interactions','upperFirst','InteractionId','unknown','toUpperCase','name','role','stringify','null','Interaction'];(function(_0x50513c,_0x398cfb){var _0x25054c=function(_0x5e5f2f){while(--_0x5e5f2f){_0x50513c['push'](_0x50513c['shift']());}};_0x25054c(++_0x398cfb);}(_0x9b40,0xf6));var _0x09b4=function(_0x43b334,_0x522b01){_0x43b334=_0x43b334-0x0;var _0x2cf693=_0x9b40[_0x43b334];return _0x2cf693;};'use strict';var _=require('lodash');var db=require(_0x09b4('0x0'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x09b4('0x1')),'mail':require(_0x09b4('0x2'))(_0x09b4('0x3')),'fax':require(_0x09b4('0x2'))('fax-interactions'),'sms':require('../../config/logger')(_0x09b4('0x4')),'chat':require('../../config/logger')('chat-interactions'),'whatsapp':require(_0x09b4('0x2'))('whatsapp-interactions')};function getInteractionId(_0x15422d,_0x4b3ae0,_0x518411){if(_0x15422d&&_0x15422d[_[_0x09b4('0x5')](_0x518411)+_0x09b4('0x6')]){return _0x15422d[_[_0x09b4('0x5')](_0x518411)+_0x09b4('0x6')];}else if(_0x15422d&&_0x15422d['id']){return _0x15422d['id'];}else if(_0x4b3ae0&&_0x4b3ae0['id']){return _0x4b3ae0['id'];}else{return _0x09b4('0x7');}}function log(_0x28ec78,_0x2763c5,_0x2924cc,_0x280bff,_0x3b4c64,_0x1ea5a4){loggers[_0x3b4c64['toLowerCase']()][_0x28ec78]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1ea5a4[_0x09b4('0x8')](),_0x2763c5?_0x2763c5['id']:null,_0x2763c5?_0x2763c5[_0x09b4('0x9')]:null,_0x2763c5?_0x2763c5[_0x09b4('0xa')]:null,getInteractionId(_0x2924cc,_0x280bff,_0x3b4c64),_0x2924cc?JSON[_0x09b4('0xb')](_0x2924cc):_0x09b4('0xc'));}function updateUser(_0x29961b,_0x2e024d,_0x17ae97,_0x39d41c,_0x1d73d9){db[_[_0x09b4('0x5')](_0x39d41c)+_0x09b4('0xd')][_0x09b4('0xe')]({'where':{'id':getInteractionId(_0x2e024d,_0x17ae97,_0x39d41c)}})[_0x09b4('0xf')](function(_0xcf2aad){if(_0xcf2aad){return _0xcf2aad['update']({'UserId':_0x29961b?_0x29961b['id']:null});}})[_0x09b4('0xf')](function(_0x382f94){if(_0x382f94){log(_0x09b4('0x10'),_0x29961b,_0x2e024d,_0x17ae97,_0x39d41c,_0x1d73d9);}})[_0x09b4('0x11')](function(){log('error',_0x29961b,_0x2e024d,_0x17ae97,_0x39d41c,_0x1d73d9);});}exports['tracked']=function(_0x4ee64e,_0x22d7b1){return function(_0x5a57a9,_0x378a9f,_0x3bb0e6){var _0x433b77=_0x5a57a9[_0x09b4('0x12')];var _0x112c73={};var _0x342e16=_0x5a57a9[_0x09b4('0x13')];if(_0x112c73){_0x112c73=_['clone'](_0x5a57a9['body']);_0x112c73=_[_0x09b4('0x14')](_0x112c73,[_0x09b4('0x15'),_0x09b4('0x16'),_0x09b4('0x17'),_0x09b4('0x18'),_0x09b4('0x19')]);}updateUser(_0x433b77,_0x112c73,_0x342e16,_0x4ee64e,_0x22d7b1);_0x3bb0e6(null);};};
\ No newline at end of file
index 4289dc1..976b694 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7268=['parse','use','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','admin','user','crypto','util','../../mysqldb','../../config/environment','data1','license','split','format','%s:%s:%s','base64','utf8'];(function(_0x561f25,_0x2d95c1){var _0x150e4c=function(_0x266e99){while(--_0x266e99){_0x561f25['push'](_0x561f25['shift']());}};_0x150e4c(++_0x2d95c1);}(_0x7268,0x16b));var _0x8726=function(_0x21e63a,_0x138fe3){_0x21e63a=_0x21e63a-0x0;var _0x28eef4=_0x7268[_0x21e63a];return _0x28eef4;};'use strict';var crypto=require(_0x8726('0x0'));var util=require(_0x8726('0x1'));var compose=require('composable-middleware');var db=require(_0x8726('0x2'))['db'];var config=require(_0x8726('0x3'));function getValueFromLicense(_0x25e9ef,_0x27ef96){if(_0x25e9ef&&_0x27ef96){if(_0x27ef96[_0x8726('0x4')]&&_0x27ef96[_0x8726('0x5')]){var _0x38cf46=_0x27ef96['data1'];var _0x39b02f=_0x27ef96[_0x8726('0x5')];var _0x566f00=_0x38cf46[_0x8726('0x6')]('-')[0x4];var _0xc74d0b=_0x38cf46[_0x8726('0x6')]('-')[0x0];var _0x2a2222=crypto['createDecipher']('aes-256-ctr',util[_0x8726('0x7')](_0x8726('0x8'),_0x566f00,_0x38cf46,_0xc74d0b));var _0x5b8891=_0x2a2222['update'](_0x39b02f,_0x8726('0x9'),_0x8726('0xa'));_0x5b8891+=_0x2a2222['final'](_0x8726('0xa'));var _0x4829f3=JSON[_0x8726('0xb')](_0x5b8891);return _0x4829f3['hasOwnProperty'](_0x25e9ef)?_0x4829f3[_0x25e9ef]:null;}}return null;}function isLimit(_0x1a2a11,_0x170978,_0x248f9c,_0x4e6d18){var _0x3257f5=_0x170978;return compose()[_0x8726('0xc')](function(_0x3a16a0,_0x4c6f4e,_0x3e5442){return db['License'][_0x8726('0xd')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x7356c4){var _0x5eb003=getValueFromLicense(_0x1a2a11,_0x7356c4);return _0x5eb003?_0x5eb003:_0x3257f5;})[_0x8726('0xe')](function(_0x5eb40c){_0x3257f5=_0x5eb40c;return _0x248f9c[_0x8726('0xf')](_0x4e6d18);})[_0x8726('0xe')](function(_0xd9e71c){if(_0xd9e71c>=_0x3257f5){return _0x4c6f4e[_0x8726('0x10')](0x193)[_0x8726('0x11')]({'message':util['format'](_0x8726('0x12'),_0x1a2a11)});}_0x3e5442();})[_0x8726('0x13')](function(_0x206ae1){_0x3e5442(_0x206ae1);});});}function isUserLimit(){return isLimit('users',0x1,db['User'],{'where':{'$or':[{'role':_0x8726('0x14')},{'role':_0x8726('0x15')}]}});}exports['isUserLimit']=isUserLimit;
\ No newline at end of file
+var _0x4d50=['users','isUserLimit','crypto','util','composable-middleware','../../config/environment','data1','license','split','createDecipher','format','%s:%s:%s','update','base64','final','utf8','parse','hasOwnProperty','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached'];(function(_0x2519f5,_0x467564){var _0x2db425=function(_0x2350cd){while(--_0x2350cd){_0x2519f5['push'](_0x2519f5['shift']());}};_0x2db425(++_0x467564);}(_0x4d50,0x120));var _0x04d5=function(_0x1ca546,_0x5985d7){_0x1ca546=_0x1ca546-0x0;var _0x332080=_0x4d50[_0x1ca546];return _0x332080;};'use strict';var crypto=require(_0x04d5('0x0'));var util=require(_0x04d5('0x1'));var compose=require(_0x04d5('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0x04d5('0x3'));function getValueFromLicense(_0x41fb50,_0x49b3f5){if(_0x41fb50&&_0x49b3f5){if(_0x49b3f5[_0x04d5('0x4')]&&_0x49b3f5[_0x04d5('0x5')]){var _0xde2303=_0x49b3f5[_0x04d5('0x4')];var _0x5e2950=_0x49b3f5['license'];var _0x37a87c=_0xde2303[_0x04d5('0x6')]('-')[0x4];var _0xcd7115=_0xde2303[_0x04d5('0x6')]('-')[0x0];var _0x33d95d=crypto[_0x04d5('0x7')]('aes-256-ctr',util[_0x04d5('0x8')](_0x04d5('0x9'),_0x37a87c,_0xde2303,_0xcd7115));var _0x98a22d=_0x33d95d[_0x04d5('0xa')](_0x5e2950,_0x04d5('0xb'),'utf8');_0x98a22d+=_0x33d95d[_0x04d5('0xc')](_0x04d5('0xd'));var _0x46f829=JSON[_0x04d5('0xe')](_0x98a22d);return _0x46f829[_0x04d5('0xf')](_0x41fb50)?_0x46f829[_0x41fb50]:null;}}return null;}function isLimit(_0x2931b3,_0x286d9d,_0x697b0a,_0x3e91a4){var _0x524f88=_0x286d9d;return compose()[_0x04d5('0x10')](function(_0x2b73a3,_0x266d0f,_0xfd86cf){return db[_0x04d5('0x11')][_0x04d5('0x12')]({'where':{'id':0x1},'raw':!![]})[_0x04d5('0x13')](function(_0x528d14){var _0xf8f66e=getValueFromLicense(_0x2931b3,_0x528d14);return _0xf8f66e?_0xf8f66e:_0x524f88;})['then'](function(_0x23ad53){_0x524f88=_0x23ad53;return _0x697b0a[_0x04d5('0x14')](_0x3e91a4);})['then'](function(_0x234988){if(_0x234988>=_0x524f88){return _0x266d0f[_0x04d5('0x15')](0x193)[_0x04d5('0x16')]({'message':util[_0x04d5('0x8')](_0x04d5('0x17'),_0x2931b3)});}_0xfd86cf();})['catch'](function(_0x2d7690){_0xfd86cf(_0x2d7690);});});}function isUserLimit(){return isLimit(_0x04d5('0x18'),0x1,db['User'],{'where':{'$or':[{'role':'admin'},{'role':'user'}]}});}exports[_0x04d5('0x19')]=isUserLimit;
\ No newline at end of file
index a22f3cd..87b8976 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x223b=['start','pop','utcOffset','minutes','format','lodash','moment','parseSearch','sqlOperator','[$or]','and','[$and]','replace','length','split','slice','forEach','shift','match','filter','indexOf','map','push','buildExpression','DATE','operator','$eq','$between','value','$gt','add','days','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','includes','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<=\x20?','$gte','>=\x20?'];(function(_0x2da71d,_0x34f66b){var _0x16c334=function(_0x4fd1cf){while(--_0x4fd1cf){_0x2da71d['push'](_0x2da71d['shift']());}};_0x16c334(++_0x34f66b);}(_0x223b,0xa7));var _0xb223=function(_0x42dfc1,_0x2b6e18){_0x42dfc1=_0x42dfc1-0x0;var _0x3274bb=_0x223b[_0x42dfc1];return _0x3274bb;};'use strict';var _=require(_0xb223('0x0'));var moment=require(_0xb223('0x1'));exports[_0xb223('0x2')]=function(_0x8ea81e){var _0x4297c1={'conditions':[]};_0x4297c1[_0xb223('0x3')]=_['startsWith'](_0x8ea81e,_0xb223('0x4'))?'or':_0xb223('0x5');var _0x3a260d=_0x8ea81e['replace'](_0xb223('0x6'),'')[_0xb223('0x7')]('[$or]','')['split']('||');for(var _0xeabfc5=0x0;_0xeabfc5<_0x3a260d[_0xb223('0x8')];_0xeabfc5++){var _0x461f5d=_0x3a260d[_0xeabfc5][_0xb223('0x9')](':=');var _0xa5a8e3=_0x461f5d[0x0];var _0x1c4fe1=_0x461f5d[_0xb223('0xa')](0x1);_0x1c4fe1[_0xb223('0xb')](function(_0x1c80e3){var _0x594a51=_0x1c80e3['split']('[')[_0xb223('0xc')]();var _0x27f86a=_0x1c80e3[_0xb223('0xd')](/\[(.*?)\]/g);_0x27f86a[_0xb223('0xb')](function(_0x1f4d30){var _0x32308a=_0x1f4d30[_0xb223('0x9')]('[')[_0xb223('0xe')](function(_0x7b529a){return _0x7b529a[_0xb223('0xf')](']')>-0x1;})[_0xb223('0x10')](function(_0x567cd7){return _0x567cd7[_0xb223('0x9')](']')[0x0];})[0x0];_0x4297c1['conditions'][_0xb223('0x11')]({'field':_0xa5a8e3,'operator':_0x594a51,'value':_0x32308a});});});}return _0x4297c1;};exports[_0xb223('0x12')]=function(_0x1e3305,_0x44c54f,_0x37fab9){var _0x1f0656={};if(_0x44c54f===_0xb223('0x13')){if(_0x37fab9[_0xb223('0x14')]===_0xb223('0x15')){_0x37fab9[_0xb223('0x14')]=_0xb223('0x16');_0x37fab9[_0xb223('0x17')]+=','+_0x37fab9['value'];}else if(_['includes']([_0xb223('0x18'),'$lte'],_0x37fab9[_0xb223('0x14')])){_0x37fab9[_0xb223('0x17')]=moment(_0x37fab9[_0xb223('0x17')])[_0xb223('0x19')](0x1,_0xb223('0x1a'))['format'](_0xb223('0x1b'));}}if(_0x37fab9[_0xb223('0x1c')]){_0x44c54f=_0x37fab9['castTo'];_0x1f0656[_0xb223('0x1d')]=_0xb223('0x1e')+_0x1e3305+'.'+_0x37fab9[_0xb223('0x1f')]+_0xb223('0x20')+_0x37fab9[_0xb223('0x1c')]+')\x20'+parseOperator(_0x37fab9['operator']);}else{_0x1f0656['text']=_0x1e3305+'.'+_0x37fab9[_0xb223('0x1f')]+'\x20'+parseOperator(_0x37fab9[_0xb223('0x14')]);}if(_[_0xb223('0x21')]([_0xb223('0x22'),_0xb223('0x23')],_0x37fab9[_0xb223('0x14')]))_0x1f0656['text']='('+_0x1f0656[_0xb223('0x1d')]+_0xb223('0x24')+_0x1e3305+'.'+_0x37fab9[_0xb223('0x1f')]+_0xb223('0x25');_0x1f0656[_0xb223('0x17')]=parseValue(_0x44c54f,_0x37fab9['operator'],_0x37fab9[_0xb223('0x17')]);return _0x1f0656;};function parseOperator(_0x32127c){var _0x319303;switch(_0x32127c){case _0xb223('0x26'):_0x319303=_0xb223('0x27');break;case'$notIn':_0x319303='NOT\x20IN\x20?';break;case _0xb223('0x15'):_0x319303='=\x20?';break;case _0xb223('0x22'):_0x319303=_0xb223('0x28');break;case _0xb223('0x29'):case _0xb223('0x2a'):case _0xb223('0x2b'):_0x319303=_0xb223('0x2c');break;case _0xb223('0x2d'):_0x319303='<\x20?';break;case _0xb223('0x18'):_0x319303='>\x20?';break;case'$lte':_0x319303=_0xb223('0x2e');break;case _0xb223('0x2f'):_0x319303=_0xb223('0x30');break;case _0xb223('0x16'):_0x319303='BETWEEN\x20?\x20AND\x20?';break;}return _0x319303;}function parseValue(_0x3f2b20,_0x2d9356,_0x1a166a){var _0x3a2932={'start':undefined,'end':undefined};switch(_0x2d9356){case'$in':case'$notIn':_0x3a2932['start']=_0x1a166a[_0xb223('0x9')](',');break;case _0xb223('0x29'):_0x3a2932[_0xb223('0x31')]='%'+_0x1a166a+'%';break;case'$startsWith':_0x3a2932[_0xb223('0x31')]=_0x1a166a+'%';break;case _0xb223('0x2b'):_0x3a2932['start']='%'+_0x1a166a;break;case _0xb223('0x16'):var _0x3af862=_0x1a166a[_0xb223('0x9')](',');var _0x1a166a=_0x3af862['shift']();var _0x156c7d=_0x3af862[_0xb223('0x32')]();if(_0x3f2b20===_0xb223('0x13')){_0x1a166a=moment(_0x1a166a)['utcOffset'](0x0,!![])['format']();_0x156c7d=moment(_0x156c7d)[_0xb223('0x33')](0x0,!![])[_0xb223('0x19')](0x17,'hours')[_0xb223('0x19')](0x3b,_0xb223('0x34'))['add'](0x3b,'seconds')[_0xb223('0x35')]();}_0x3a2932={'start':_0x1a166a,'end':_0x156c7d};break;default:_0x3a2932[_0xb223('0x31')]=_0x1a166a;break;}return _0x3a2932;}
\ No newline at end of file
+var _0xad22=['>=\x20?','start','pop','utcOffset','hours','minutes','seconds','lodash','parseSearch','sqlOperator','startsWith','[$or]','replace','[$and]','split','length','slice','match','forEach','indexOf','map','conditions','push','buildExpression','DATE','operator','$between','value','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','$notIn','NOT\x20IN\x20?','=\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','<\x20?','>\x20?','<=\x20?','$gte'];(function(_0x222314,_0x584095){var _0x4875cc=function(_0x2d43b1){while(--_0x2d43b1){_0x222314['push'](_0x222314['shift']());}};_0x4875cc(++_0x584095);}(_0xad22,0x151));var _0x2ad2=function(_0x5ca5bc,_0x5b8a9d){_0x5ca5bc=_0x5ca5bc-0x0;var _0x26ca86=_0xad22[_0x5ca5bc];return _0x26ca86;};'use strict';var _=require(_0x2ad2('0x0'));var moment=require('moment');exports[_0x2ad2('0x1')]=function(_0x27c125){var _0xa8eeeb={'conditions':[]};_0xa8eeeb[_0x2ad2('0x2')]=_[_0x2ad2('0x3')](_0x27c125,_0x2ad2('0x4'))?'or':'and';var _0x440a34=_0x27c125[_0x2ad2('0x5')](_0x2ad2('0x6'),'')['replace']('[$or]','')[_0x2ad2('0x7')]('||');for(var _0x3740b7=0x0;_0x3740b7<_0x440a34[_0x2ad2('0x8')];_0x3740b7++){var _0xc82385=_0x440a34[_0x3740b7][_0x2ad2('0x7')](':=');var _0x3c39b0=_0xc82385[0x0];var _0x4a47ec=_0xc82385[_0x2ad2('0x9')](0x1);_0x4a47ec['forEach'](function(_0xd8d8f6){var _0x17e6b4=_0xd8d8f6[_0x2ad2('0x7')]('[')['shift']();var _0x52113d=_0xd8d8f6[_0x2ad2('0xa')](/\[(.*?)\]/g);_0x52113d[_0x2ad2('0xb')](function(_0x433a00){var _0x355df4=_0x433a00['split']('[')['filter'](function(_0xddda4e){return _0xddda4e[_0x2ad2('0xc')](']')>-0x1;})[_0x2ad2('0xd')](function(_0x12ea3c){return _0x12ea3c[_0x2ad2('0x7')](']')[0x0];})[0x0];_0xa8eeeb[_0x2ad2('0xe')][_0x2ad2('0xf')]({'field':_0x3c39b0,'operator':_0x17e6b4,'value':_0x355df4});});});}return _0xa8eeeb;};exports[_0x2ad2('0x10')]=function(_0x5702f2,_0x263b6f,_0x257332){var _0x142849={};if(_0x263b6f===_0x2ad2('0x11')){if(_0x257332[_0x2ad2('0x12')]==='$eq'){_0x257332[_0x2ad2('0x12')]=_0x2ad2('0x13');_0x257332[_0x2ad2('0x14')]+=','+_0x257332['value'];}else if(_['includes']([_0x2ad2('0x15'),_0x2ad2('0x16')],_0x257332[_0x2ad2('0x12')])){_0x257332['value']=moment(_0x257332[_0x2ad2('0x14')])[_0x2ad2('0x17')](0x1,_0x2ad2('0x18'))[_0x2ad2('0x19')](_0x2ad2('0x1a'));}}if(_0x257332[_0x2ad2('0x1b')]){_0x263b6f=_0x257332[_0x2ad2('0x1b')];_0x142849[_0x2ad2('0x1c')]=_0x2ad2('0x1d')+_0x5702f2+'.'+_0x257332[_0x2ad2('0x1e')]+_0x2ad2('0x1f')+_0x257332[_0x2ad2('0x1b')]+')\x20'+parseOperator(_0x257332['operator']);}else{_0x142849['text']=_0x5702f2+'.'+_0x257332[_0x2ad2('0x1e')]+'\x20'+parseOperator(_0x257332[_0x2ad2('0x12')]);}if(_['includes']([_0x2ad2('0x20'),'$notIn'],_0x257332['operator']))_0x142849[_0x2ad2('0x1c')]='('+_0x142849['text']+_0x2ad2('0x21')+_0x5702f2+'.'+_0x257332[_0x2ad2('0x1e')]+_0x2ad2('0x22');_0x142849[_0x2ad2('0x14')]=parseValue(_0x263b6f,_0x257332[_0x2ad2('0x12')],_0x257332[_0x2ad2('0x14')]);return _0x142849;};function parseOperator(_0x12cafa){var _0x365826;switch(_0x12cafa){case _0x2ad2('0x23'):_0x365826=_0x2ad2('0x24');break;case _0x2ad2('0x25'):_0x365826=_0x2ad2('0x26');break;case'$eq':_0x365826=_0x2ad2('0x27');break;case _0x2ad2('0x20'):_0x365826='<>\x20?';break;case _0x2ad2('0x28'):case _0x2ad2('0x29'):case _0x2ad2('0x2a'):_0x365826=_0x2ad2('0x2b');break;case'$lt':_0x365826=_0x2ad2('0x2c');break;case _0x2ad2('0x15'):_0x365826=_0x2ad2('0x2d');break;case _0x2ad2('0x16'):_0x365826=_0x2ad2('0x2e');break;case _0x2ad2('0x2f'):_0x365826=_0x2ad2('0x30');break;case _0x2ad2('0x13'):_0x365826='BETWEEN\x20?\x20AND\x20?';break;}return _0x365826;}function parseValue(_0x2c30cd,_0x313033,_0x48f2ed){var _0x3e2d40={'start':undefined,'end':undefined};switch(_0x313033){case _0x2ad2('0x23'):case'$notIn':_0x3e2d40[_0x2ad2('0x31')]=_0x48f2ed[_0x2ad2('0x7')](',');break;case _0x2ad2('0x28'):_0x3e2d40['start']='%'+_0x48f2ed+'%';break;case'$startsWith':_0x3e2d40['start']=_0x48f2ed+'%';break;case _0x2ad2('0x2a'):_0x3e2d40[_0x2ad2('0x31')]='%'+_0x48f2ed;break;case'$between':var _0x4549d6=_0x48f2ed[_0x2ad2('0x7')](',');var _0x48f2ed=_0x4549d6['shift']();var _0xe8708=_0x4549d6[_0x2ad2('0x32')]();if(_0x2c30cd===_0x2ad2('0x11')){_0x48f2ed=moment(_0x48f2ed)[_0x2ad2('0x33')](0x0,!![])[_0x2ad2('0x19')]();_0xe8708=moment(_0xe8708)[_0x2ad2('0x33')](0x0,!![])[_0x2ad2('0x17')](0x17,_0x2ad2('0x34'))[_0x2ad2('0x17')](0x3b,_0x2ad2('0x35'))[_0x2ad2('0x17')](0x3b,_0x2ad2('0x36'))[_0x2ad2('0x19')]();}_0x3e2d40={'start':_0x48f2ed,'end':_0xe8708};break;default:_0x3e2d40[_0x2ad2('0x31')]=_0x48f2ed;break;}return _0x3e2d40;}
\ No newline at end of file
index ddcc878..53f8ce0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17de=['offset','order','where','pick','filter','merge','VIRTUAL','lower','moment','parse','keys','includes','fields','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','format','YYYY-MM-DD','$lte','utc','name','isArray','limit','sort','map','indexOf','priority','cast','col','unsigned','omit','length','isObject','isString','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','getFullTextValue','forEach','push','join','$id','query','intersection','attributes','model','nolimit'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x17de,0xdc));var _0xe17d=function(_0x277fda,_0x57df6e){_0x277fda=_0x277fda-0x0;var _0x34475a=_0x17de[_0x277fda];return _0x34475a;};'use strict';var _=require('lodash');var sequelize=require('sequelize');var moment=require(_0xe17d('0x0'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x223c45){var _0x2c461c=['ne'];try{var _0x481730=JSON[_0xe17d('0x1')](_0x223c45);var _0x31250d=Object[_0xe17d('0x2')](_0x481730)[0x0];return _0x2c461c[_0xe17d('0x3')](_0x31250d);}catch(_0x37603f){return![];}}function getOperatorValue(_0xb531b4){var _0x1efb34=JSON[_0xe17d('0x1')](_0xb531b4);var _0x6e97bf=Object[_0xe17d('0x2')](_0x1efb34)[0x0];var _0x1d904b=_0x1efb34[_0x6e97bf];return{['$'+_0x6e97bf]:_0x1d904b};}exports[_0xe17d('0x4')]=function(_0x156f0f){var _0x508d1b=null;if(_0x156f0f){_0x508d1b=_0x156f0f[_0xe17d('0x5')](',');}return _0x508d1b;};exports[_0xe17d('0x6')]=function(_0x23fecb,_0x1bb1f6){var _0x4508ce={};if(!_[_0xe17d('0x7')](_0x23fecb)){_[_0xe17d('0x8')](_0x23fecb,function(_0x4ea485,_0x1a5b6e){try{if(_0x1bb1f6){var _0x14b51b=_[_0xe17d('0x9')](_0x1bb1f6,{'name':_0x1a5b6e})||{};if(hasSequelizeOperator(_0x4ea485)){_0x4508ce[_0x1a5b6e]=getOperatorValue(_0x4ea485);}else if(_0x14b51b[_0xe17d('0xa')]===_0xe17d('0xb')&&_[_0xe17d('0xc')](_0x4ea485)){var _0x13886a=JSON[_0xe17d('0x1')](_0x4ea485);var _0x44d3fc={'$gte':moment(moment(_0x13886a['$gte'])[_0xe17d('0xd')](_0xe17d('0xe')))['utc']()['format'](),'$lte':moment(moment(_0x13886a[_0xe17d('0xf')])[_0xe17d('0xd')](_0xe17d('0xe')))[_0xe17d('0x10')]()['subtract'](0x1,'s')[_0xe17d('0xd')]()};_0x4508ce[_0x1a5b6e]=_0x44d3fc;}else if(_0x14b51b[_0xe17d('0x11')]==='uniqueid'){_0x4508ce[_0x1a5b6e]=_0x4ea485;}else{_0x4508ce[_0x1a5b6e]=_['isArray'](_0x4ea485)?_0x4ea485:JSON[_0xe17d('0x1')](_0x4ea485);}}else{_0x4508ce[_0x1a5b6e]=_[_0xe17d('0x12')](_0x4ea485)?_0x4ea485:JSON['parse'](_0x4ea485);}}catch(_0x241082){_0x4508ce[_0x1a5b6e]=_0x4ea485['split'](',');}});}return _0x4508ce;};exports[_0xe17d('0x13')]=function(_0x474bb3){_0x474bb3=parseInt(_0x474bb3,0xa);if(!_0x474bb3||_0x474bb3<0x0){_0x474bb3=LIMIT_VALUE;}return _0x474bb3;};exports['offset']=function(_0x269c70){_0x269c70=parseInt(_0x269c70,0xa);if(!_0x269c70||_0x269c70<0x0){_0x269c70=0x0;}return _0x269c70;};exports[_0xe17d('0x14')]=function(_0x1207ba){var _0x3c9421,_0x12d294=null;if(_0x1207ba){_0x3c9421=_0x1207ba[_0xe17d('0x5')](',');_0x12d294=_[_0xe17d('0x15')](_0x3c9421,function(_0x5e3baf){if(_0x5e3baf[_0xe17d('0x16')]('-')===0x0){return[_0x5e3baf===_0xe17d('0x17')?sequelize[_0xe17d('0x18')](sequelize[_0xe17d('0x19')](_0xe17d('0x17')),_0xe17d('0x1a')):_0x5e3baf['substr'](0x1),'DESC'];}else{return[_0x5e3baf===_0xe17d('0x17')?sequelize[_0xe17d('0x18')](sequelize[_0xe17d('0x19')](_0xe17d('0x17')),'unsigned'):_0x5e3baf,'ASC'];}});}return _0x12d294;};exports[_0xe17d('0x1b')]=function(_0x1ac77c,_0x1a13b6){if(_['isEmpty'](_0x1ac77c)){return _0x1ac77c;}if(_[_0xe17d('0x12')](_0x1ac77c)){for(var _0x47f9c6=0x0;_0x47f9c6<_0x1ac77c[_0xe17d('0x1c')];_0x47f9c6+=0x1){_0x1ac77c[_0x47f9c6]=this[_0xe17d('0x1b')](_0x1ac77c[_0x47f9c6],_0x1a13b6);}return _0x1ac77c;}if(!_[_0xe17d('0x1d')](_0x1ac77c)){return _0x1ac77c;}if(_[_0xe17d('0x1e')](_0x1a13b6)){_0x1a13b6=[_0x1a13b6];}if(!_[_0xe17d('0x12')](_0x1a13b6)){return _0x1ac77c;}for(var _0x2abc4b=0x0;_0x2abc4b<_0x1a13b6[_0xe17d('0x1c')];_0x2abc4b+=0x1){_['unset'](_0x1ac77c,_0x1a13b6[_0x2abc4b]);}for(var _0x539b99 in _0x1ac77c){if(_0x1ac77c[_0xe17d('0x1f')](_0x539b99)){_0x1ac77c[_0x539b99]=this[_0xe17d('0x1b')](_0x1ac77c[_0x539b99],_0x1a13b6);}}return _0x1ac77c;};exports[_0xe17d('0x20')]=function(_0x2b8895){return _0x2b8895[_0xe17d('0x21')](RegExp(_0xe17d('0x22')))?!![]:![];};exports['isEmail']=function(_0x3ff8ce){return _0x3ff8ce[_0xe17d('0x21')](/^\S+@\S+$/)?!![]:![];};exports[_0xe17d('0x23')]=function(_0xa469ff){var _0x2063db=[];_0xa469ff[_0xe17d('0x5')](/[ ,]+/)[_0xe17d('0x24')](function(_0xf3eb2e){_0xf3eb2e=_0xf3eb2e['replace'](/([^:]")"+/g,'$1');_0xf3eb2e='+'+_0xf3eb2e+'*';if(_0xf3eb2e[_0xe17d('0x3')]('@'))_0xf3eb2e='\x22'+_0xf3eb2e+'\x22';_0x2063db[_0xe17d('0x25')](_0xf3eb2e);});return _0x2063db[_0xe17d('0x26')]('\x20');};exports['getOptions']=function(_0x35e6d2,_0x3d74e5,_0xdfc0a){var _0x655dd8={},_0x280d2a={};if(_0x3d74e5['query'][_0xe17d('0x27')]){_0x3d74e5['query']['id']=_0x3d74e5[_0xe17d('0x28')]['$id'];delete _0x3d74e5['query'][_0xe17d('0x27')];}_0x655dd8['model']=_[_0xe17d('0x15')](_0x35e6d2,_0xe17d('0x11'));_0x655dd8['query']=_[_0xe17d('0x2')](_0x3d74e5['query']);_0x655dd8[_0xe17d('0x6')]=_[_0xe17d('0x29')](_0x655dd8['model'],_0x655dd8[_0xe17d('0x28')]);_0x280d2a[_0xe17d('0x2a')]=_[_0xe17d('0x29')](_0x655dd8[_0xe17d('0x2b')],this[_0xe17d('0x4')](_0x3d74e5[_0xe17d('0x28')][_0xe17d('0x4')]));_0x280d2a[_0xe17d('0x2a')]=_0x280d2a[_0xe17d('0x2a')][_0xe17d('0x1c')]?_0x280d2a[_0xe17d('0x2a')]:_0x655dd8['model'];if(!_0x3d74e5['query'][_0xe17d('0x1f')](_0xe17d('0x2c'))){_0x280d2a[_0xe17d('0x13')]=this[_0xe17d('0x13')](_0x3d74e5[_0xe17d('0x28')][_0xe17d('0x13')]);_0x280d2a['offset']=this[_0xe17d('0x2d')](_0x3d74e5[_0xe17d('0x28')]['offset']);}_0x280d2a[_0xe17d('0x2e')]=this[_0xe17d('0x14')](_0x3d74e5[_0xe17d('0x28')][_0xe17d('0x14')]);_0x280d2a[_0xe17d('0x2f')]=this[_0xe17d('0x6')](_[_0xe17d('0x30')](_0x3d74e5['query'],_0x655dd8[_0xe17d('0x6')]),_0x35e6d2);if(_0x3d74e5['query'][_0xe17d('0x31')]){_0x280d2a[_0xe17d('0x2f')]=_[_0xe17d('0x32')](_0x280d2a[_0xe17d('0x2f')],{'$or':_[_0xe17d('0x15')](_0x35e6d2,function(_0x5c705f){if(_0x5c705f['type']!==_0xe17d('0x33')){if(_0xdfc0a){return sequelize['where'](sequelize['fn'](_0xe17d('0x34'),sequelize[_0xe17d('0x19')](_0x5c705f[_0xe17d('0x11')])),{'$like':sequelize['fn'](_0xe17d('0x34'),'%'+_0x3d74e5[_0xe17d('0x28')]['filter']+'%')});}else{var _0x2cedd4={};_0x2cedd4[_0x5c705f[_0xe17d('0x11')]]={'$like':'%'+_0x3d74e5[_0xe17d('0x28')][_0xe17d('0x31')]+'%'};return _0x2cedd4;}}})});}_0x280d2a=_['merge']({},_0x280d2a,_0x3d74e5['options']);return _0x280d2a;};
\ No newline at end of file
+var _0x274c=['YYYY-MM-DD','utc','$lte','subtract','name','isArray','limit','offset','map','cast','col','priority','unsigned','DESC','ASC','omit','length','isObject','isString','unset','^[+]?[0-9]*$','isEmail','match','getFullTextValue','replace','push','join','getOptions','query','$id','model','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','lower','lodash','sequelize','moment','parse','keys','includes','fields','split','isEmpty','type','DATE','format'];(function(_0x232715,_0x4bd63e){var _0x1e6090=function(_0x1baae7){while(--_0x1baae7){_0x232715['push'](_0x232715['shift']());}};_0x1e6090(++_0x4bd63e);}(_0x274c,0x1a4));var _0xc274=function(_0x3a2269,_0x3ef598){_0x3a2269=_0x3a2269-0x0;var _0x34b10b=_0x274c[_0x3a2269];return _0x34b10b;};'use strict';var _=require(_0xc274('0x0'));var sequelize=require(_0xc274('0x1'));var moment=require(_0xc274('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x2e5833){var _0x25e01=['ne'];try{var _0x163f56=JSON[_0xc274('0x3')](_0x2e5833);var _0x8e4bd5=Object[_0xc274('0x4')](_0x163f56)[0x0];return _0x25e01[_0xc274('0x5')](_0x8e4bd5);}catch(_0x29e1bf){return![];}}function getOperatorValue(_0x30bc8e){var _0x595b86=JSON[_0xc274('0x3')](_0x30bc8e);var _0x32782b=Object[_0xc274('0x4')](_0x595b86)[0x0];var _0x23682c=_0x595b86[_0x32782b];return{['$'+_0x32782b]:_0x23682c};}exports[_0xc274('0x6')]=function(_0x3a0454){var _0x41b453=null;if(_0x3a0454){_0x41b453=_0x3a0454[_0xc274('0x7')](',');}return _0x41b453;};exports['filters']=function(_0x4f9764,_0x2c4953){var _0x24cd32={};if(!_[_0xc274('0x8')](_0x4f9764)){_['forOwn'](_0x4f9764,function(_0x19a8d1,_0x52075a){try{if(_0x2c4953){var _0x42b921=_['find'](_0x2c4953,{'name':_0x52075a})||{};if(hasSequelizeOperator(_0x19a8d1)){_0x24cd32[_0x52075a]=getOperatorValue(_0x19a8d1);}else if(_0x42b921[_0xc274('0x9')]===_0xc274('0xa')&&_['isPlainObject'](_0x19a8d1)){var _0x491fcf=JSON[_0xc274('0x3')](_0x19a8d1);var _0x88e77b={'$gte':moment(moment(_0x491fcf['$gte'])[_0xc274('0xb')](_0xc274('0xc')))[_0xc274('0xd')]()[_0xc274('0xb')](),'$lte':moment(moment(_0x491fcf[_0xc274('0xe')])[_0xc274('0xb')](_0xc274('0xc')))[_0xc274('0xd')]()[_0xc274('0xf')](0x1,'s')[_0xc274('0xb')]()};_0x24cd32[_0x52075a]=_0x88e77b;}else if(_0x42b921[_0xc274('0x10')]==='uniqueid'){_0x24cd32[_0x52075a]=_0x19a8d1;}else{_0x24cd32[_0x52075a]=_[_0xc274('0x11')](_0x19a8d1)?_0x19a8d1:JSON[_0xc274('0x3')](_0x19a8d1);}}else{_0x24cd32[_0x52075a]=_[_0xc274('0x11')](_0x19a8d1)?_0x19a8d1:JSON[_0xc274('0x3')](_0x19a8d1);}}catch(_0x2a44cf){_0x24cd32[_0x52075a]=_0x19a8d1[_0xc274('0x7')](',');}});}return _0x24cd32;};exports[_0xc274('0x12')]=function(_0x4326a6){_0x4326a6=parseInt(_0x4326a6,0xa);if(!_0x4326a6||_0x4326a6<0x0){_0x4326a6=LIMIT_VALUE;}return _0x4326a6;};exports[_0xc274('0x13')]=function(_0x3dde88){_0x3dde88=parseInt(_0x3dde88,0xa);if(!_0x3dde88||_0x3dde88<0x0){_0x3dde88=0x0;}return _0x3dde88;};exports['sort']=function(_0x2c32c7){var _0x125255,_0x1c9f4c=null;if(_0x2c32c7){_0x125255=_0x2c32c7[_0xc274('0x7')](',');_0x1c9f4c=_[_0xc274('0x14')](_0x125255,function(_0x267289){if(_0x267289['indexOf']('-')===0x0){return[_0x267289==='priority'?sequelize[_0xc274('0x15')](sequelize[_0xc274('0x16')](_0xc274('0x17')),_0xc274('0x18')):_0x267289['substr'](0x1),_0xc274('0x19')];}else{return[_0x267289===_0xc274('0x17')?sequelize[_0xc274('0x15')](sequelize[_0xc274('0x16')]('priority'),_0xc274('0x18')):_0x267289,_0xc274('0x1a')];}});}return _0x1c9f4c;};exports[_0xc274('0x1b')]=function(_0x4e035a,_0x432247){if(_[_0xc274('0x8')](_0x4e035a)){return _0x4e035a;}if(_[_0xc274('0x11')](_0x4e035a)){for(var _0x734b88=0x0;_0x734b88<_0x4e035a[_0xc274('0x1c')];_0x734b88+=0x1){_0x4e035a[_0x734b88]=this[_0xc274('0x1b')](_0x4e035a[_0x734b88],_0x432247);}return _0x4e035a;}if(!_[_0xc274('0x1d')](_0x4e035a)){return _0x4e035a;}if(_[_0xc274('0x1e')](_0x432247)){_0x432247=[_0x432247];}if(!_[_0xc274('0x11')](_0x432247)){return _0x4e035a;}for(var _0x30c416=0x0;_0x30c416<_0x432247[_0xc274('0x1c')];_0x30c416+=0x1){_[_0xc274('0x1f')](_0x4e035a,_0x432247[_0x30c416]);}for(var _0x5c68e2 in _0x4e035a){if(_0x4e035a['hasOwnProperty'](_0x5c68e2)){_0x4e035a[_0x5c68e2]=this['omit'](_0x4e035a[_0x5c68e2],_0x432247);}}return _0x4e035a;};exports['isNumeric']=function(_0x32aeb3){return _0x32aeb3['match'](RegExp(_0xc274('0x20')))?!![]:![];};exports[_0xc274('0x21')]=function(_0x43db7e){return _0x43db7e[_0xc274('0x22')](/^\S+@\S+$/)?!![]:![];};exports[_0xc274('0x23')]=function(_0x2106d9){var _0x3d3351=[];_0x2106d9[_0xc274('0x7')](/[ ,]+/)['forEach'](function(_0x563ec9){_0x563ec9=_0x563ec9[_0xc274('0x24')](/([^:]")"+/g,'$1');_0x563ec9='+'+_0x563ec9+'*';if(_0x563ec9[_0xc274('0x5')]('@'))_0x563ec9='\x22'+_0x563ec9+'\x22';_0x3d3351[_0xc274('0x25')](_0x563ec9);});return _0x3d3351[_0xc274('0x26')]('\x20');};exports[_0xc274('0x27')]=function(_0x29a32a,_0x15fc33,_0x4e69a5){var _0xf06b58={},_0x20d759={};if(_0x15fc33[_0xc274('0x28')]['$id']){_0x15fc33[_0xc274('0x28')]['id']=_0x15fc33['query'][_0xc274('0x29')];delete _0x15fc33[_0xc274('0x28')][_0xc274('0x29')];}_0xf06b58[_0xc274('0x2a')]=_['map'](_0x29a32a,'name');_0xf06b58[_0xc274('0x28')]=_[_0xc274('0x4')](_0x15fc33['query']);_0xf06b58[_0xc274('0x2b')]=_[_0xc274('0x2c')](_0xf06b58[_0xc274('0x2a')],_0xf06b58[_0xc274('0x28')]);_0x20d759[_0xc274('0x2d')]=_['intersection'](_0xf06b58[_0xc274('0x2a')],this['fields'](_0x15fc33[_0xc274('0x28')][_0xc274('0x6')]));_0x20d759[_0xc274('0x2d')]=_0x20d759[_0xc274('0x2d')][_0xc274('0x1c')]?_0x20d759[_0xc274('0x2d')]:_0xf06b58[_0xc274('0x2a')];if(!_0x15fc33[_0xc274('0x28')][_0xc274('0x2e')](_0xc274('0x2f'))){_0x20d759[_0xc274('0x12')]=this[_0xc274('0x12')](_0x15fc33[_0xc274('0x28')][_0xc274('0x12')]);_0x20d759['offset']=this['offset'](_0x15fc33[_0xc274('0x28')][_0xc274('0x13')]);}_0x20d759[_0xc274('0x30')]=this[_0xc274('0x31')](_0x15fc33[_0xc274('0x28')][_0xc274('0x31')]);_0x20d759[_0xc274('0x32')]=this[_0xc274('0x2b')](_['pick'](_0x15fc33[_0xc274('0x28')],_0xf06b58[_0xc274('0x2b')]),_0x29a32a);if(_0x15fc33['query'][_0xc274('0x33')]){_0x20d759[_0xc274('0x32')]=_['merge'](_0x20d759['where'],{'$or':_[_0xc274('0x14')](_0x29a32a,function(_0x53ebf8){if(_0x53ebf8[_0xc274('0x9')]!==_0xc274('0x34')){if(_0x4e69a5){return sequelize[_0xc274('0x32')](sequelize['fn'](_0xc274('0x35'),sequelize[_0xc274('0x16')](_0x53ebf8[_0xc274('0x10')])),{'$like':sequelize['fn'](_0xc274('0x35'),'%'+_0x15fc33[_0xc274('0x28')]['filter']+'%')});}else{var _0x116eec={};_0x116eec[_0x53ebf8[_0xc274('0x10')]]={'$like':'%'+_0x15fc33[_0xc274('0x28')][_0xc274('0x33')]+'%'};return _0x116eec;}}})});}_0x20d759=_['merge']({},_0x20d759,_0x15fc33['options']);return _0x20d759;};
\ No newline at end of file
index 1b6a102..ae09be9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc59=['split','views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','initialize','express','serve-favicon','body-parser','method-override','errorhandler','cors','moment','./environment','../mysqldb','default','get','env','production','set','appPath','join','root','public','development','use','toISOString'];(function(_0x2a1845,_0x319e33){var _0x733165=function(_0x3073ce){while(--_0x3073ce){_0x2a1845['push'](_0x2a1845['shift']());}};_0x733165(++_0x319e33);}(_0xcc59,0x1ab));var _0x9cc5=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xcc59[_0x24f31b];return _0x488401;};'use strict';var express=require(_0x9cc5('0x0'));var favicon=require(_0x9cc5('0x1'));var bodyParser=require(_0x9cc5('0x2'));var methodOverride=require(_0x9cc5('0x3'));var cookieParser=require('cookie-parser');var errorHandler=require(_0x9cc5('0x4'));var path=require('path');var passport=require('passport');var cors=require(_0x9cc5('0x5'));var moment=require(_0x9cc5('0x6'));var config=require(_0x9cc5('0x7'));var db=require(_0x9cc5('0x8'))['db'];exports[_0x9cc5('0x9')]=function(_0x2e4c4a){var _0x1c243a=_0x2e4c4a[_0x9cc5('0xa')](_0x9cc5('0xb'));if(_0x1c243a===_0x9cc5('0xc')){_0x2e4c4a[_0x9cc5('0xd')](_0x9cc5('0xe'),path[_0x9cc5('0xf')](config[_0x9cc5('0x10')],_0x9cc5('0x11')));}if(_0x1c243a===_0x9cc5('0x12')||_0x1c243a==='test'){_0x2e4c4a[_0x9cc5('0xd')](_0x9cc5('0xe'),path[_0x9cc5('0xf')](config['root'],'client'));_0x2e4c4a[_0x9cc5('0x13')](errorHandler());}_0x2e4c4a[_0x9cc5('0xd')]('json\x20replacer',function(_0x4a0230,_0x171ce4){if(this[_0x4a0230]instanceof Date){_0x171ce4=this[_0x4a0230][_0x9cc5('0x14')]()[_0x9cc5('0x15')]('.')[0x0]+'Z';}return _0x171ce4;});_0x2e4c4a['use'](express['static'](_0x2e4c4a[_0x9cc5('0xa')](_0x9cc5('0xe'))));_0x2e4c4a[_0x9cc5('0xd')](_0x9cc5('0x16'),config[_0x9cc5('0x10')]+'/server/views');_0x2e4c4a[_0x9cc5('0x17')](_0x9cc5('0x18'),require(_0x9cc5('0x19'))[_0x9cc5('0x1a')]);_0x2e4c4a[_0x9cc5('0xd')](_0x9cc5('0x1b'),'html');_0x2e4c4a[_0x9cc5('0x13')](bodyParser[_0x9cc5('0x1c')]({'limit':'50mb','extended':!![]}));_0x2e4c4a[_0x9cc5('0x13')](bodyParser[_0x9cc5('0x1d')]({'limit':_0x9cc5('0x1e')}));_0x2e4c4a['use'](cors());_0x2e4c4a[_0x9cc5('0x13')](methodOverride());_0x2e4c4a['use'](cookieParser());_0x2e4c4a['use'](passport[_0x9cc5('0x1f')]());};
\ No newline at end of file
+var _0x1b6d=['html','use','50mb','initialize','express','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','path','cors','./environment','../mysqldb','default','get','env','production','join','root','public','test','set','appPath','client','json\x20replacer','toISOString','split','views','engine','ejs','renderFile','view\x20engine'];(function(_0x36a36c,_0xba8f9e){var _0x351ef6=function(_0x256fb8){while(--_0x256fb8){_0x36a36c['push'](_0x36a36c['shift']());}};_0x351ef6(++_0xba8f9e);}(_0x1b6d,0x1d2));var _0xd1b6=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x1b6d[_0x2c91e9];return _0x13f0ff;};'use strict';var express=require(_0xd1b6('0x0'));var favicon=require(_0xd1b6('0x1'));var bodyParser=require(_0xd1b6('0x2'));var methodOverride=require(_0xd1b6('0x3'));var cookieParser=require(_0xd1b6('0x4'));var errorHandler=require(_0xd1b6('0x5'));var path=require(_0xd1b6('0x6'));var passport=require('passport');var cors=require(_0xd1b6('0x7'));var moment=require('moment');var config=require(_0xd1b6('0x8'));var db=require(_0xd1b6('0x9'))['db'];exports[_0xd1b6('0xa')]=function(_0x60ea17){var _0x355dbe=_0x60ea17[_0xd1b6('0xb')](_0xd1b6('0xc'));if(_0x355dbe===_0xd1b6('0xd')){_0x60ea17['set']('appPath',path[_0xd1b6('0xe')](config[_0xd1b6('0xf')],_0xd1b6('0x10')));}if(_0x355dbe==='development'||_0x355dbe===_0xd1b6('0x11')){_0x60ea17[_0xd1b6('0x12')](_0xd1b6('0x13'),path[_0xd1b6('0xe')](config[_0xd1b6('0xf')],_0xd1b6('0x14')));_0x60ea17['use'](errorHandler());}_0x60ea17['set'](_0xd1b6('0x15'),function(_0x2e1ad3,_0x6c855a){if(this[_0x2e1ad3]instanceof Date){_0x6c855a=this[_0x2e1ad3][_0xd1b6('0x16')]()[_0xd1b6('0x17')]('.')[0x0]+'Z';}return _0x6c855a;});_0x60ea17['use'](express['static'](_0x60ea17['get'](_0xd1b6('0x13'))));_0x60ea17['set'](_0xd1b6('0x18'),config[_0xd1b6('0xf')]+'/server/views');_0x60ea17[_0xd1b6('0x19')]('html',require(_0xd1b6('0x1a'))[_0xd1b6('0x1b')]);_0x60ea17[_0xd1b6('0x12')](_0xd1b6('0x1c'),_0xd1b6('0x1d'));_0x60ea17[_0xd1b6('0x1e')](bodyParser['urlencoded']({'limit':_0xd1b6('0x1f'),'extended':!![]}));_0x60ea17[_0xd1b6('0x1e')](bodyParser['json']({'limit':'50mb'}));_0x60ea17[_0xd1b6('0x1e')](cors());_0x60ea17[_0xd1b6('0x1e')](methodOverride());_0x60ea17[_0xd1b6('0x1e')](cookieParser());_0x60ea17[_0xd1b6('0x1e')](passport[_0xd1b6('0x20')]());};
\ No newline at end of file
index 40b9391..2c11acc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7b4=['win32','utf8','replace','macAddress','ipAddress','digest','substring','crypto','bimedia-machine-uuid','execSync','keys','filter','IPv4','internal','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','orderBy','map','join','createHash','md5','update','hex','platform','test'];(function(_0x32da70,_0x5dfdc3){var _0x3a40cc=function(_0xf0217b){while(--_0xf0217b){_0x32da70['push'](_0x32da70['shift']());}};_0x3a40cc(++_0x5dfdc3);}(_0xd7b4,0x98));var _0x4d7b=function(_0x23e5d2,_0x415e7a){_0x23e5d2=_0x23e5d2-0x0;var _0x51ee49=_0xd7b4[_0x23e5d2];return _0x51ee49;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x4d7b('0x0'));var machine=require(_0x4d7b('0x1'));var exec=require('child_process')[_0x4d7b('0x2')];var config=require('../environment');function getInterfaces(){var _0x537c4b=[];var _0x36e244=os['networkInterfaces']();var _0x3d438a=_['orderBy'](_[_0x4d7b('0x3')](_0x36e244));for(var _0xbd671a=0x0;_0xbd671a<_0x3d438a['length'];_0xbd671a++){var _0x4d2f29=_0x36e244[_0x3d438a[_0xbd671a]][_0x4d7b('0x4')](function(_0x4bc318){return _0x4bc318['family']===_0x4d7b('0x5')&&_0x4bc318[_0x4d7b('0x6')]===![];});_0x537c4b=_0x537c4b['concat'](_0x4d2f29);}return _0x537c4b;}function getFirstInterface(){var _0x221933=_[_0x4d7b('0x7')](getInterfaces());return{'macAddress':_0x221933&&_0x221933[_0x4d7b('0x8')]?_0x221933[_0x4d7b('0x8')]:_0x4d7b('0x9'),'ipAddress':_0x221933&&_0x221933[_0x4d7b('0xa')]?_0x221933['address']:_0x4d7b('0xb')};}exports[_0x4d7b('0xc')]=getFirstInterface;function getCPUhash(){var _0x294975=_[_0x4d7b('0xd')](os['cpus']()[_0x4d7b('0xe')](function(_0x12e126){return _0x12e126['model'];}))[_0x4d7b('0xf')](':');return crypto[_0x4d7b('0x10')](_0x4d7b('0x11'))[_0x4d7b('0x12')](_0x294975)['digest'](_0x4d7b('0x13'));}exports['getUuid']=function(){var _0x6e22d0=os[_0x4d7b('0x14')]();var _0x86f504=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x86f504[_0x4d7b('0x15')](config['licenseToken'])){return config['licenseToken'];}else if(_0x6e22d0===_0x4d7b('0x16')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x4d7b('0x17')})[_0x4d7b('0x18')]('\x0d\x0a','');}else{var _0x3f4f64=getFirstInterface();var _0x1aaa43=getCPUhash();var _0x49d0de=_0x1aaa43+'|'+os['hostname']()+'|'+_0x3f4f64[_0x4d7b('0x19')]+'|'+_0x3f4f64[_0x4d7b('0x1a')];var _0x3ef37e=crypto[_0x4d7b('0x10')](_0x4d7b('0x11'))[_0x4d7b('0x12')](_0x49d0de)[_0x4d7b('0x1b')](_0x4d7b('0x13'));return _0x3ef37e[_0x4d7b('0x1c')](0x0,0x8)+'-'+_0x3ef37e['substring'](0x8,0xc)+'-'+_0x3ef37e[_0x4d7b('0x1c')](0xc,0x10)+'-'+_0x3ef37e[_0x4d7b('0x1c')](0x10,0x14)+'-'+_0x3ef37e[_0x4d7b('0x1c')](0x14);}};
\ No newline at end of file
+var _0xf513=['getUuid','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process','networkInterfaces','keys','length','family','IPv4','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','orderBy','cpus','map','model','join','createHash','md5','update','digest','hex'];(function(_0x2c27f7,_0x1bf813){var _0x29a758=function(_0x553527){while(--_0x553527){_0x2c27f7['push'](_0x2c27f7['shift']());}};_0x29a758(++_0x1bf813);}(_0xf513,0x144));var _0x3f51=function(_0x13c027,_0x22f584){_0x13c027=_0x13c027-0x0;var _0x5336ae=_0xf513[_0x13c027];return _0x5336ae;};'use strict';var _=require(_0x3f51('0x0'));var os=require('os');var crypto=require(_0x3f51('0x1'));var machine=require(_0x3f51('0x2'));var exec=require(_0x3f51('0x3'))['execSync'];var config=require('../environment');function getInterfaces(){var _0x518871=[];var _0x414807=os[_0x3f51('0x4')]();var _0x149516=_['orderBy'](_[_0x3f51('0x5')](_0x414807));for(var _0x7ce313=0x0;_0x7ce313<_0x149516[_0x3f51('0x6')];_0x7ce313++){var _0x3b0e87=_0x414807[_0x149516[_0x7ce313]]['filter'](function(_0x88867d){return _0x88867d[_0x3f51('0x7')]===_0x3f51('0x8')&&_0x88867d['internal']===![];});_0x518871=_0x518871[_0x3f51('0x9')](_0x3b0e87);}return _0x518871;}function getFirstInterface(){var _0x2a9183=_[_0x3f51('0xa')](getInterfaces());return{'macAddress':_0x2a9183&&_0x2a9183[_0x3f51('0xb')]?_0x2a9183[_0x3f51('0xb')]:_0x3f51('0xc'),'ipAddress':_0x2a9183&&_0x2a9183[_0x3f51('0xd')]?_0x2a9183[_0x3f51('0xd')]:_0x3f51('0xe')};}exports[_0x3f51('0xf')]=getFirstInterface;function getCPUhash(){var _0x3b5d90=_[_0x3f51('0x10')](os[_0x3f51('0x11')]()[_0x3f51('0x12')](function(_0x26f980){return _0x26f980[_0x3f51('0x13')];}))[_0x3f51('0x14')](':');return crypto[_0x3f51('0x15')](_0x3f51('0x16'))[_0x3f51('0x17')](_0x3b5d90)[_0x3f51('0x18')](_0x3f51('0x19'));}exports[_0x3f51('0x1a')]=function(){var _0x42f407=os['platform']();var _0x55ed2c=/[0-9a-f-]{36}/;if(config[_0x3f51('0x1b')]&&_0x55ed2c['test'](config[_0x3f51('0x1b')])){return config[_0x3f51('0x1b')];}else if(_0x42f407===_0x3f51('0x1c')){return exec(_0x3f51('0x1d'),{'encoding':_0x3f51('0x1e')})[_0x3f51('0x1f')]('\x0d\x0a','');}else{var _0x2fb1b7=getFirstInterface();var _0x41dc88=getCPUhash();var _0xb7ce52=_0x41dc88+'|'+os[_0x3f51('0x20')]()+'|'+_0x2fb1b7['macAddress']+'|'+_0x2fb1b7[_0x3f51('0x21')];var _0x421d0b=crypto[_0x3f51('0x15')](_0x3f51('0x16'))[_0x3f51('0x17')](_0xb7ce52)['digest']('hex');return _0x421d0b[_0x3f51('0x22')](0x0,0x8)+'-'+_0x421d0b['substring'](0x8,0xc)+'-'+_0x421d0b[_0x3f51('0x22')](0xc,0x10)+'-'+_0x421d0b[_0x3f51('0x22')](0x10,0x14)+'-'+_0x421d0b[_0x3f51('0x22')](0x14);}};
\ No newline at end of file
index 7d7af24..88ca47c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8df=['days','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','util','moment','request-promise','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','license','https://www.xcallymotion.com','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','data1','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','encryptString','format','diff','decryptString'];(function(_0x32ff1d,_0x3e29bb){var _0x50489e=function(_0x588ff3){while(--_0x588ff3){_0x32ff1d['push'](_0x32ff1d['shift']());}};_0x50489e(++_0x3e29bb);}(_0xe8df,0x171));var _0xfe8d=function(_0x2f1ec4,_0x4099aa){_0x2f1ec4=_0x2f1ec4-0x0;var _0x148894=_0xe8df[_0x2f1ec4];return _0x148894;};'use strict';var util=require(_0xfe8d('0x0'));var moment=require(_0xfe8d('0x1'));var rp=require(_0xfe8d('0x2'));var BPromise=require('bluebird');var pkginfo=require(_0xfe8d('0x3'))(module,_0xfe8d('0x4'));var db=require(_0xfe8d('0x5'))['db'];var encryptor=require(_0xfe8d('0x6'));var hardware=require(_0xfe8d('0x7'));var logger=require('../logger')(_0xfe8d('0x8'));var HOST=_0xfe8d('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0xd6601d){return new BPromise(function(_0x3c5425,_0x1bace1){var _0x3167b1=util['format']('%s/api/servers/%s/check?version=%s',HOST,_0xd6601d,module[_0xfe8d('0xa')][_0xfe8d('0x4')]);if(oldToken){_0x3167b1=util['format'](_0xfe8d('0xb'),HOST,_0xd6601d,module[_0xfe8d('0xa')][_0xfe8d('0x4')],oldToken);}var _0x171909={'uri':_0x3167b1,'method':_0xfe8d('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x171909)[_0xfe8d('0xd')](function(_0x52ff11){_0x3c5425(_0x52ff11);})[_0xfe8d('0xe')](function(_0x44eb8c){_0x1bace1(_0x44eb8c);});});}function manageLicense(_0x24f522,_0xd54644){var _0x30e480=_0xd54644['get']({'plain':!![]});if(!isOldTokenSent&&_0x30e480[_0xfe8d('0xf')]!==_0x24f522&&!_0x30e480[_0xfe8d('0x10')]){oldToken=_0x30e480['data1'];}httpRequest(_0x24f522)[_0xfe8d('0xd')](function(_0x1e4e2e){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x1e4e2e['active']){isOldTokenSent=![];if(!_0x30e480[_0xfe8d('0x8')]&&_0x30e480[_0xfe8d('0x8')]!=_0x1e4e2e[_0xfe8d('0x8')]||_0x30e480[_0xfe8d('0x8')]&&_0x30e480[_0xfe8d('0x10')]){logger[_0xfe8d('0x11')](_0xfe8d('0x12'));}if(_0x30e480[_0xfe8d('0x8')]&&!_0x30e480[_0xfe8d('0x10')]&&_0x30e480[_0xfe8d('0x8')]!=_0x1e4e2e[_0xfe8d('0x8')]){logger['info'](_0xfe8d('0x13'));}if(_0x30e480['license']&&!_0x30e480[_0xfe8d('0x10')]&&_0x30e480[_0xfe8d('0x8')]==_0x1e4e2e[_0xfe8d('0x8')]){return _0xd54644;}return _0xd54644[_0xfe8d('0x14')]({'data1':_0x24f522,'data2':null,'license':_0x1e4e2e[_0xfe8d('0x8')]});}else{if(_0x1e4e2e[_0xfe8d('0x8')]||_0x30e480[_0xfe8d('0x8')]){if(!_0x30e480[_0xfe8d('0x10')]){if(_0x30e480[_0xfe8d('0xf')]==_0x24f522){GRAY_PERIOD_REASON=_0xfe8d('0x15');logger[_0xfe8d('0x11')](_0xfe8d('0x16'));}else{GRAY_PERIOD_REASON=_0xfe8d('0x17');logger[_0xfe8d('0x11')](_0xfe8d('0x18'),_0x30e480[_0xfe8d('0xf')],_0x24f522);}logger[_0xfe8d('0x11')](_0xfe8d('0x19'),GRAY_PERIOD_REASON['toUpperCase'](),moment()['format'](_0xfe8d('0x1a')));return _0xd54644[_0xfe8d('0x14')]({'data2':encryptor[_0xfe8d('0x1b')](moment()[_0xfe8d('0x1c')](_0xfe8d('0x1a')))});}else{if(moment()[_0xfe8d('0x1d')](encryptor[_0xfe8d('0x1e')](_0x30e480[_0xfe8d('0x10')]),_0xfe8d('0x1f'))>DAYS){logger['info']('DEMO\x20START\x20AT\x20%s',moment()[_0xfe8d('0x1c')](_0xfe8d('0x1a')));isOldTokenSent=![];return _0xd54644[_0xfe8d('0x14')]({'data1':_0x24f522,'data2':null,'license':null});}}}else{if(_0x30e480[_0xfe8d('0xf')]!=_0x24f522){logger[_0xfe8d('0x11')](_0xfe8d('0x18'),_0x30e480[_0xfe8d('0xf')],_0x24f522);return _0xd54644[_0xfe8d('0x14')]({'data1':_0x24f522,'data2':null,'license':null});}}}return _0xd54644;})['then'](function(_0x77a141){_0xd54644=_0x77a141;})[_0xfe8d('0xe')](function(_0x328c6b){logger['error'](_0x328c6b[_0xfe8d('0x20')]);})[_0xfe8d('0x21')](function(){setTimeout(function(){manageLicense(hardware[_0xfe8d('0x22')](),_0xd54644);},TIME);});}function defaultLicense(){var _0x9c8b9a=hardware['getUuid']();if(_0x9c8b9a){return db[_0xfe8d('0x23')][_0xfe8d('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x9c8b9a}})[_0xfe8d('0x25')](function(_0x36be94,_0x1b41aa){logger[_0xfe8d('0x11')](_0xfe8d('0x26'),_0x9c8b9a);manageLicense(_0x9c8b9a,_0x36be94);})[_0xfe8d('0xe')](function(_0x353026){logger[_0xfe8d('0x27')](_0x353026[_0xfe8d('0x20')]);});}}exports['default']=defaultLicense;
\ No newline at end of file
+var _0xfb60=['request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','catch','data1','then','license','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','encryptString','YYYY-MM-DD\x20HH:mm','diff','decryptString','update','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','message','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment'];(function(_0x5f1f63,_0x740dbf){var _0x4ff682=function(_0x1b1395){while(--_0x1b1395){_0x5f1f63['push'](_0x5f1f63['shift']());}};_0x4ff682(++_0x740dbf);}(_0xfb60,0x198));var _0x0fb6=function(_0x53d1f9,_0x507162){_0x53d1f9=_0x53d1f9-0x0;var _0x45ec63=_0xfb60[_0x53d1f9];return _0x45ec63;};'use strict';var util=require(_0x0fb6('0x0'));var moment=require(_0x0fb6('0x1'));var rp=require(_0x0fb6('0x2'));var BPromise=require(_0x0fb6('0x3'));var pkginfo=require(_0x0fb6('0x4'))(module,_0x0fb6('0x5'));var db=require(_0x0fb6('0x6'))['db'];var encryptor=require(_0x0fb6('0x7'));var hardware=require(_0x0fb6('0x8'));var logger=require('../logger')('license');var HOST=_0x0fb6('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x45f3d3){return new BPromise(function(_0x5e21e3,_0xcc62d7){var _0x321f48=util[_0x0fb6('0xa')](_0x0fb6('0xb'),HOST,_0x45f3d3,module[_0x0fb6('0xc')][_0x0fb6('0x5')]);if(oldToken){_0x321f48=util[_0x0fb6('0xa')](_0x0fb6('0xd'),HOST,_0x45f3d3,module[_0x0fb6('0xc')][_0x0fb6('0x5')],oldToken);}var _0x5e93d4={'uri':_0x321f48,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x5e93d4)['then'](function(_0x52cb22){_0x5e21e3(_0x52cb22);})[_0x0fb6('0xe')](function(_0x18f43d){_0xcc62d7(_0x18f43d);});});}function manageLicense(_0x5c6490,_0x16be6b){var _0xe10a33=_0x16be6b['get']({'plain':!![]});if(!isOldTokenSent&&_0xe10a33[_0x0fb6('0xf')]!==_0x5c6490&&!_0xe10a33['data2']){oldToken=_0xe10a33[_0x0fb6('0xf')];}httpRequest(_0x5c6490)[_0x0fb6('0x10')](function(_0x4b45b9){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x4b45b9['active']){isOldTokenSent=![];if(!_0xe10a33[_0x0fb6('0x11')]&&_0xe10a33[_0x0fb6('0x11')]!=_0x4b45b9[_0x0fb6('0x11')]||_0xe10a33[_0x0fb6('0x11')]&&_0xe10a33[_0x0fb6('0x12')]){logger['info'](_0x0fb6('0x13'));}if(_0xe10a33['license']&&!_0xe10a33[_0x0fb6('0x12')]&&_0xe10a33[_0x0fb6('0x11')]!=_0x4b45b9[_0x0fb6('0x11')]){logger[_0x0fb6('0x14')](_0x0fb6('0x15'));}if(_0xe10a33[_0x0fb6('0x11')]&&!_0xe10a33['data2']&&_0xe10a33[_0x0fb6('0x11')]==_0x4b45b9['license']){return _0x16be6b;}return _0x16be6b['update']({'data1':_0x5c6490,'data2':null,'license':_0x4b45b9[_0x0fb6('0x11')]});}else{if(_0x4b45b9[_0x0fb6('0x11')]||_0xe10a33['license']){if(!_0xe10a33[_0x0fb6('0x12')]){if(_0xe10a33[_0x0fb6('0xf')]==_0x5c6490){GRAY_PERIOD_REASON=_0x0fb6('0x16');logger[_0x0fb6('0x14')](_0x0fb6('0x17'));}else{GRAY_PERIOD_REASON=_0x0fb6('0x18');logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0xe10a33[_0x0fb6('0xf')],_0x5c6490);}logger[_0x0fb6('0x14')](_0x0fb6('0x19'),GRAY_PERIOD_REASON[_0x0fb6('0x1a')](),moment()[_0x0fb6('0xa')]('YYYY-MM-DD\x20HH:mm'));return _0x16be6b['update']({'data2':encryptor[_0x0fb6('0x1b')](moment()[_0x0fb6('0xa')](_0x0fb6('0x1c')))});}else{if(moment()[_0x0fb6('0x1d')](encryptor[_0x0fb6('0x1e')](_0xe10a33['data2']),'days')>DAYS){logger[_0x0fb6('0x14')]('DEMO\x20START\x20AT\x20%s',moment()[_0x0fb6('0xa')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x16be6b[_0x0fb6('0x1f')]({'data1':_0x5c6490,'data2':null,'license':null});}}}else{if(_0xe10a33[_0x0fb6('0xf')]!=_0x5c6490){logger[_0x0fb6('0x14')](_0x0fb6('0x20'),_0xe10a33[_0x0fb6('0xf')],_0x5c6490);return _0x16be6b[_0x0fb6('0x1f')]({'data1':_0x5c6490,'data2':null,'license':null});}}}return _0x16be6b;})[_0x0fb6('0x10')](function(_0x517855){_0x16be6b=_0x517855;})['catch'](function(_0x477f38){logger[_0x0fb6('0x21')](_0x477f38[_0x0fb6('0x22')]);})[_0x0fb6('0x23')](function(){setTimeout(function(){manageLicense(hardware[_0x0fb6('0x24')](),_0x16be6b);},TIME);});}function defaultLicense(){var _0x32caab=hardware[_0x0fb6('0x24')]();if(_0x32caab){return db[_0x0fb6('0x25')][_0x0fb6('0x26')]({'where':{'id':0x1},'defaults':{'data1':_0x32caab}})['spread'](function(_0x1b91c7,_0x5e6001){logger[_0x0fb6('0x14')](_0x0fb6('0x27'),_0x32caab);manageLicense(_0x32caab,_0x1b91c7);})['catch'](function(_0x20f34d){logger[_0x0fb6('0x21')](_0x20f34d[_0x0fb6('0x22')]);});}}exports[_0x0fb6('0x28')]=defaultLicense;
\ No newline at end of file
index cbb883d..5e420cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c08=['defaults','then','catch','uuid','license','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','demo','machineUuid','gray','deadline','add','disabled','data1','message','User','findAll','role','sequelize','COUNT','col','user','users','telephones','forEach','pick','countBy','admin','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find'];(function(_0x379d6e,_0x3e0404){var _0x261bcf=function(_0x39033a){while(--_0x39033a){_0x379d6e['push'](_0x379d6e['shift']());}};_0x261bcf(++_0x3e0404);}(_0x4c08,0xb1));var _0x84c0=function(_0xb99421,_0xaab133){_0xb99421=_0xb99421-0x0;var _0x4b3ec7=_0x4c08[_0xb99421];return _0x4b3ec7;};'use strict';var util=require(_0x84c0('0x0'));var _=require(_0x84c0('0x1'));var moment=require(_0x84c0('0x2'));var BPromise=require('bluebird');var hardware=require(_0x84c0('0x3'));var encryptor=require('../../components/encryptor');var db=require(_0x84c0('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x84c0('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x84c0('0x6'),'machineUuid':hardware[_0x84c0('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x84c0('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x84c0('0x8'),'machineUuid':hardware[_0x84c0('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x3c632d){return new BPromise(function(_0x1f3eff,_0x5bd81b){return db[_0x84c0('0x9')][_0x84c0('0xa')](_[_0x84c0('0xb')](_0x3c632d,{'raw':!![],'where':{'id':0x1}}))[_0x84c0('0xc')](function(_0x3fab24){return checkLicense(_0x3fab24,null);})['then'](function(_0x513584){_0x1f3eff(_0x513584);return;})[_0x84c0('0xd')](function(_0x336efc){_0x5bd81b(_0x336efc);});});}function checkLicense(_0x41f70a,_0x18689){if(!_0x41f70a){demoLicense[_0x84c0('0xe')]=_0x41f70a['data1'];return demoLicense;}try{var _0x3e3d6e=_0x18689||_0x41f70a[_0x84c0('0xf')];if(_['isEmpty'](_0x3e3d6e)){throw new Error(_0x84c0('0x10'));}var _0x2e5bc6=_0x41f70a['data1'];var _0x42ba7e=_0x41f70a[_0x84c0('0x11')];var _0x115290=_0x2e5bc6[_0x84c0('0x12')]('-')[0x4];var _0x1f3c76=_0x2e5bc6[_0x84c0('0x12')]('-')[0x0];var _0x389197=encryptor[_0x84c0('0x13')](_0x3e3d6e,util[_0x84c0('0x14')](_0x84c0('0x15'),_0x115290,_0x2e5bc6,_0x1f3c76));var _0x4c1b7c=JSON['parse'](_0x389197);_0x4c1b7c[_0x84c0('0x16')]=![];_0x4c1b7c[_0x84c0('0xe')]=_0x2e5bc6;_0x4c1b7c[_0x84c0('0x17')]=hardware[_0x84c0('0x7')]();if(_0x42ba7e){var _0x411b36=encryptor[_0x84c0('0x13')](_0x42ba7e);_0x4c1b7c[_0x84c0('0x18')]=_0x411b36;_0x4c1b7c[_0x84c0('0x19')]=moment(_0x411b36)[_0x84c0('0x1a')](0x7,'days')['format']();_0x4c1b7c['grayReason']=_0x4c1b7c[_0x84c0('0xe')]!=_0x4c1b7c[_0x84c0('0x17')]?'changed':_0x84c0('0x1b');}return _0x4c1b7c;}catch(_0x314b6b){breakingLicense[_0x84c0('0xe')]=_0x41f70a[_0x84c0('0x1c')];breakingLicense['message']=_0x314b6b[_0x84c0('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x15f23f,_0x24dcca){getLicense()[_0x84c0('0xc')](function(_0x25fca7){return db[_0x84c0('0x1e')][_0x84c0('0x1f')]({'attributes':[_0x84c0('0x20'),[db[_0x84c0('0x21')]['fn'](_0x84c0('0x22'),db['sequelize'][_0x84c0('0x23')](_0x84c0('0x20'))),'count']],'group':'role','where':{'role':{'$or':['admin',_0x84c0('0x24'),'telephone']}},'raw':!![]})[_0x84c0('0xc')](function(_0x4f2e53){var _0x466a30={'user':_0x25fca7[_0x84c0('0x25')]||0x0,'telephone':_0x25fca7[_0x84c0('0x26')]||0x0};_0x4f2e53[_0x84c0('0x27')](function(_0x2aeb5d){var _0x4bea68=_0x2aeb5d[_0x84c0('0x20')]==='admin'?_0x84c0('0x24'):_0x2aeb5d[_0x84c0('0x20')];_0x466a30[_0x4bea68]-=_0x2aeb5d['count'];if(_0x466a30[_0x4bea68]<0x0)_0x466a30[_0x4bea68]=0x0;});_0x15f23f(_0x466a30);return;});})[_0x84c0('0xd')](function(_0x2c16f9){_0x24dcca(_0x2c16f9);});});}function checkUserLimits(_0x2e47b1){return new BPromise(function(_0x4f9a0f,_0x5b5679){getLimits()[_0x84c0('0xc')](function(_0x4d6d27){var _0x25381d=_[_0x84c0('0x28')](_[_0x84c0('0x29')](_0x2e47b1,_0x84c0('0x20')),[_0x84c0('0x2a'),_0x84c0('0x24'),_0x84c0('0x2b')]);var _0x2068a5=(_0x25381d[_0x84c0('0x2a')]||0x0)+(_0x25381d[_0x84c0('0x24')]||0x0);var _0x3a37f5=_0x25381d[_0x84c0('0x2b')]||0x0;if(_0x2068a5>_0x4d6d27[_0x84c0('0x24')])return _0x5b5679(_0x84c0('0x2c'));if(_0x3a37f5>_0x4d6d27['telephone'])return _0x5b5679(_0x84c0('0x2d'));return _0x4f9a0f();})[_0x84c0('0xd')](function(_0x4ed38f){_0x5b5679(_0x4ed38f);});});}module[_0x84c0('0x2e')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
+var _0x8438=['getUuid','Breaking\x20license','License','find','defaults','then','license','License\x20key\x20value\x20not\x20found','data1','split','decryptString','%s:%s:%s','parse','demo','uuid','deadline','format','grayReason','machineUuid','changed','disabled','message','User','sequelize','count','role','admin','user','telephone','users','telephones','catch','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','moment','bluebird','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z'];(function(_0x64c622,_0x19f642){var _0xffc8fa=function(_0x5ba3e3){while(--_0x5ba3e3){_0x64c622['push'](_0x64c622['shift']());}};_0xffc8fa(++_0x19f642);}(_0x8438,0x19f));var _0x8843=function(_0x29896d,_0x4db4c7){_0x29896d=_0x29896d-0x0;var _0x239f25=_0x8438[_0x29896d];return _0x239f25;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x8843('0x0'));var BPromise=require(_0x8843('0x1'));var hardware=require('./hardware');var encryptor=require(_0x8843('0x2'));var db=require(_0x8843('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x8843('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x8843('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x8843('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x8843('0x6'),'machineUuid':hardware[_0x8843('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0xab7479){return new BPromise(function(_0x4ced06,_0x6029d3){return db[_0x8843('0x7')][_0x8843('0x8')](_[_0x8843('0x9')](_0xab7479,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x8eb64a){return checkLicense(_0x8eb64a,null);})[_0x8843('0xa')](function(_0x131ddc){_0x4ced06(_0x131ddc);return;})['catch'](function(_0x43d1be){_0x6029d3(_0x43d1be);});});}function checkLicense(_0x2f6f5c,_0x5a645d){if(!_0x2f6f5c){demoLicense['uuid']=_0x2f6f5c['data1'];return demoLicense;}try{var _0x3841d4=_0x5a645d||_0x2f6f5c[_0x8843('0xb')];if(_['isEmpty'](_0x3841d4)){throw new Error(_0x8843('0xc'));}var _0x56c806=_0x2f6f5c[_0x8843('0xd')];var _0x5b6c31=_0x2f6f5c['data2'];var _0x565cac=_0x56c806[_0x8843('0xe')]('-')[0x4];var _0x256c26=_0x56c806[_0x8843('0xe')]('-')[0x0];var _0x521c18=encryptor[_0x8843('0xf')](_0x3841d4,util['format'](_0x8843('0x10'),_0x565cac,_0x56c806,_0x256c26));var _0x253f84=JSON[_0x8843('0x11')](_0x521c18);_0x253f84[_0x8843('0x12')]=![];_0x253f84[_0x8843('0x13')]=_0x56c806;_0x253f84['machineUuid']=hardware['getUuid']();if(_0x5b6c31){var _0x4dfc87=encryptor[_0x8843('0xf')](_0x5b6c31);_0x253f84['gray']=_0x4dfc87;_0x253f84[_0x8843('0x14')]=moment(_0x4dfc87)['add'](0x7,'days')[_0x8843('0x15')]();_0x253f84[_0x8843('0x16')]=_0x253f84['uuid']!=_0x253f84[_0x8843('0x17')]?_0x8843('0x18'):_0x8843('0x19');}return _0x253f84;}catch(_0x419667){breakingLicense[_0x8843('0x13')]=_0x2f6f5c[_0x8843('0xd')];breakingLicense[_0x8843('0x1a')]=_0x419667['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x17e7c1,_0x559a38){getLicense()['then'](function(_0x54d717){return db[_0x8843('0x1b')]['findAll']({'attributes':['role',[db['sequelize']['fn']('COUNT',db[_0x8843('0x1c')]['col']('role')),_0x8843('0x1d')]],'group':_0x8843('0x1e'),'where':{'role':{'$or':[_0x8843('0x1f'),_0x8843('0x20'),_0x8843('0x21')]}},'raw':!![]})[_0x8843('0xa')](function(_0x19e7cf){var _0x1450fd={'user':_0x54d717[_0x8843('0x22')]||0x0,'telephone':_0x54d717[_0x8843('0x23')]||0x0};_0x19e7cf['forEach'](function(_0x28294c){var _0x19509e=_0x28294c['role']===_0x8843('0x1f')?_0x8843('0x20'):_0x28294c[_0x8843('0x1e')];_0x1450fd[_0x19509e]-=_0x28294c[_0x8843('0x1d')];if(_0x1450fd[_0x19509e]<0x0)_0x1450fd[_0x19509e]=0x0;});_0x17e7c1(_0x1450fd);return;});})[_0x8843('0x24')](function(_0x524d7c){_0x559a38(_0x524d7c);});});}function checkUserLimits(_0x50e905){return new BPromise(function(_0x15c255,_0x591898){getLimits()[_0x8843('0xa')](function(_0x723bb){var _0x5539f7=_[_0x8843('0x25')](_[_0x8843('0x26')](_0x50e905,_0x8843('0x1e')),[_0x8843('0x1f'),_0x8843('0x20'),_0x8843('0x21')]);var _0x37316f=(_0x5539f7[_0x8843('0x1f')]||0x0)+(_0x5539f7[_0x8843('0x20')]||0x0);var _0x5eae1d=_0x5539f7[_0x8843('0x21')]||0x0;if(_0x37316f>_0x723bb['user'])return _0x591898(_0x8843('0x27'));if(_0x5eae1d>_0x723bb[_0x8843('0x21')])return _0x591898(_0x8843('0x28'));return _0x15c255();})[_0x8843('0x24')](function(_0x3ccac7){_0x591898(_0x3ccac7);});});}module[_0x8843('0x29')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
index af5f726..70808e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0598=['http://localhost:9000','app-id','exports'];(function(_0xc69f39,_0x2ce0cf){var _0x93be41=function(_0xd66056){while(--_0xd66056){_0xc69f39['push'](_0xc69f39['shift']());}};_0x93be41(++_0x2ce0cf);}(_0x0598,0x92));var _0x8059=function(_0x39af19,_0x39e8c0){_0x39af19=_0x39af19-0x0;var _0x22673a=_0x0598[_0x39af19];return _0x22673a;};'use strict';module[_0x8059('0x0')]={'DOMAIN':_0x8059('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x8059('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''};
\ No newline at end of file
+var _0x84a0=['myappanuglar-secret','app-id','exports','http://localhost:9000'];(function(_0x4a427c,_0x150f76){var _0x2b3da7=function(_0x5296ea){while(--_0x5296ea){_0x4a427c['push'](_0x4a427c['shift']());}};_0x2b3da7(++_0x150f76);}(_0x84a0,0x66));var _0x084a=function(_0x3ce433,_0x328120){_0x3ce433=_0x3ce433-0x0;var _0x474612=_0x84a0[_0x3ce433];return _0x474612;};'use strict';module[_0x084a('0x0')]={'DOMAIN':_0x084a('0x1'),'SESSION_SECRET':_0x084a('0x2'),'GOOGLE_ID':_0x084a('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''};
\ No newline at end of file
index 07e19d3..7697a94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16bf=['/var','log','xcally','%s-%s.log','message','replace','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','exports','Logger','File','error','transports','%s-%s','info','env','debugLevel','winston','util','path','INFO','join'];(function(_0x42698b,_0x8a72c8){var _0x2f6de0=function(_0x2bb94d){while(--_0x2bb94d){_0x42698b['push'](_0x42698b['shift']());}};_0x2f6de0(++_0x8a72c8);}(_0x16bf,0x1ab));var _0xf16b=function(_0xb32c85,_0x45545a){_0xb32c85=_0xb32c85-0x0;var _0x4865d9=_0x16bf[_0xb32c85];return _0x4865d9;};'use strict';var moment=require('moment');var winston=require(_0xf16b('0x0'));var util=require(_0xf16b('0x1'));var path=require(_0xf16b('0x2'));var debugLevel=_0xf16b('0x3');function filename(_0x171c3c,_0x3c049d){return path[_0xf16b('0x4')](_0xf16b('0x5'),_0xf16b('0x6'),_0xf16b('0x7'),util['format'](_0xf16b('0x8'),_0x171c3c,_0x3c049d));}function formatter(_0x59254c,_0x12f67c){_0x12f67c[_0xf16b('0x9')]=_0x12f67c['message'][_0xf16b('0xa')](/@@{/g,'{{{')['replace'](/}@@/g,'}}}')[_0xf16b('0xa')](/@{/g,'{{')[_0xf16b('0xa')](/}@/g,'}}');return util[_0xf16b('0xb')](_0xf16b('0xc'),moment()[_0xf16b('0xb')](_0xf16b('0xd')),_0x12f67c[_0xf16b('0xe')]['toUpperCase'](),_0x59254c,_0x12f67c[_0xf16b('0x9')]);}module[_0xf16b('0xf')]=function(_0x2b111d){return new winston[(_0xf16b('0x10'))]({'transports':[new winston['transports'][(_0xf16b('0x11'))]({'name':util[_0xf16b('0xb')]('%s-%s',_0x2b111d,'error'),'filename':filename(_0x2b111d,_0xf16b('0x12')),'level':_0xf16b('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xbaa561){return formatter(_0x2b111d,_0xbaa561);}}),new winston[(_0xf16b('0x13'))][(_0xf16b('0x11'))]({'name':util[_0xf16b('0xb')](_0xf16b('0x14'),_0x2b111d,'info'),'filename':filename(_0x2b111d,_0xf16b('0x15')),'level':_0xf16b('0x15'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x183dd1){return formatter(_0x2b111d,_0x183dd1);}}),new winston[(_0xf16b('0x13'))]['Console']({'level':process[_0xf16b('0x16')][_0xf16b('0x17')]||debugLevel,'json':![],'formatter':function(_0x59e21d){return formatter(_0x2b111d,_0x59e21d);}})]});};
\ No newline at end of file
+var _0x8be5=['transports','File','error','%s-%s','info','Console','debugLevel','moment','winston','INFO','join','/var','log','xcally','format','%s-%s.log','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','message','exports','Logger'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x8be5,0xcf));var _0x58be=function(_0x524792,_0x7af1ef){_0x524792=_0x524792-0x0;var _0x2c6aae=_0x8be5[_0x524792];return _0x2c6aae;};'use strict';var moment=require(_0x58be('0x0'));var winston=require(_0x58be('0x1'));var util=require('util');var path=require('path');var debugLevel=_0x58be('0x2');function filename(_0x10463b,_0x4cfa2c){return path[_0x58be('0x3')](_0x58be('0x4'),_0x58be('0x5'),_0x58be('0x6'),util[_0x58be('0x7')](_0x58be('0x8'),_0x10463b,_0x4cfa2c));}function formatter(_0x52d701,_0x1cb804){_0x1cb804['message']=_0x1cb804['message'][_0x58be('0x9')](/@@{/g,_0x58be('0xa'))['replace'](/}@@/g,_0x58be('0xb'))['replace'](/@{/g,'{{')[_0x58be('0x9')](/}@/g,'}}');return util[_0x58be('0x7')](_0x58be('0xc'),moment()[_0x58be('0x7')](_0x58be('0xd')),_0x1cb804['level'][_0x58be('0xe')](),_0x52d701,_0x1cb804[_0x58be('0xf')]);}module[_0x58be('0x10')]=function(_0x1af422){return new winston[(_0x58be('0x11'))]({'transports':[new winston[(_0x58be('0x12'))][(_0x58be('0x13'))]({'name':util[_0x58be('0x7')]('%s-%s',_0x1af422,_0x58be('0x14')),'filename':filename(_0x1af422,_0x58be('0x14')),'level':_0x58be('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1173a9){return formatter(_0x1af422,_0x1173a9);}}),new winston['transports'][(_0x58be('0x13'))]({'name':util[_0x58be('0x7')](_0x58be('0x15'),_0x1af422,_0x58be('0x16')),'filename':filename(_0x1af422,_0x58be('0x16')),'level':_0x58be('0x16'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1c4592){return formatter(_0x1af422,_0x1c4592);}}),new winston[(_0x58be('0x12'))][(_0x58be('0x17'))]({'level':process['env'][_0x58be('0x18')]||debugLevel,'json':![],'formatter':function(_0x45af6d){return formatter(_0x1af422,_0x45af6d);}})]});};
\ No newline at end of file
index c75cdd7..7e837e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8feb=['../../services/express/index.js','ami','join','../../services/ami/index.js','agi','../../services/agi/index.js','email','routing','../../services/xdr/index.js','exports','path','express'];(function(_0x3cbf12,_0x4b9dd0){var _0x507ae7=function(_0x41e907){while(--_0x41e907){_0x3cbf12['push'](_0x3cbf12['shift']());}};_0x507ae7(++_0x4b9dd0);}(_0x8feb,0xca));var _0xb8fe=function(_0x4b7549,_0x11cd49){_0x4b7549=_0x4b7549-0x0;var _0x18562a=_0x8feb[_0x4b7549];return _0x18562a;};'use strict';var path=require(_0xb8fe('0x0'));var os=require('os');var config={'apps':[{'name':_0xb8fe('0x1'),'script':path['join'](__dirname,_0xb8fe('0x2'))},{'name':_0xb8fe('0x3'),'script':path[_0xb8fe('0x4')](__dirname,_0xb8fe('0x5'))},{'name':_0xb8fe('0x6'),'script':path['join'](__dirname,_0xb8fe('0x7'))},{'name':_0xb8fe('0x8'),'script':path['join'](__dirname,'../../services/email/index.js')},{'name':_0xb8fe('0x9'),'script':path[_0xb8fe('0x4')](__dirname,'../../services/routing/index.js')},{'name':'xdr','script':path['join'](__dirname,_0xb8fe('0xa'))}]};module[_0xb8fe('0xb')]=config;
\ No newline at end of file
+var _0x7af7=['express','join','../../services/express/index.js','ami','agi','../../services/agi/index.js','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports'];(function(_0x18a0d3,_0x145ad8){var _0x5b7e6c=function(_0x21e1f8){while(--_0x21e1f8){_0x18a0d3['push'](_0x18a0d3['shift']());}};_0x5b7e6c(++_0x145ad8);}(_0x7af7,0x114));var _0x77af=function(_0x39bfb6,_0x4272c8){_0x39bfb6=_0x39bfb6-0x0;var _0x23fef9=_0x7af7[_0x39bfb6];return _0x23fef9;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x77af('0x0'),'script':path[_0x77af('0x1')](__dirname,_0x77af('0x2'))},{'name':_0x77af('0x3'),'script':path['join'](__dirname,'../../services/ami/index.js')},{'name':_0x77af('0x4'),'script':path[_0x77af('0x1')](__dirname,_0x77af('0x5'))},{'name':'email','script':path[_0x77af('0x1')](__dirname,_0x77af('0x6'))},{'name':_0x77af('0x7'),'script':path[_0x77af('0x1')](__dirname,_0x77af('0x8'))},{'name':_0x77af('0x9'),'script':path[_0x77af('0x1')](__dirname,_0x77af('0xa'))}]};module[_0x77af('0xb')]=config;
\ No newline at end of file
index d8b38d7..1bfc3f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x419a=['then','start','stop','restart','disconnect','list','describe','delete','dump','saved','pm2','bluebird','connect'];(function(_0x2b8c02,_0x1d48ec){var _0x382148=function(_0x119453){while(--_0x119453){_0x2b8c02['push'](_0x2b8c02['shift']());}};_0x382148(++_0x1d48ec);}(_0x419a,0x19d));var _0xa419=function(_0xd366a0,_0x4e3a42){_0xd366a0=_0xd366a0-0x0;var _0xaf413=_0x419a[_0xd366a0];return _0xaf413;};'use strict';var pm2=require(_0xa419('0x0'));var BPromise=require(_0xa419('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x82b1b9,_0x2dd85e){return pm2[_0xa419('0x2')](function(_0x18d40e){if(_0x18d40e){return _0x2dd85e(_0x18d40e);}return _0x82b1b9('connected');});});};exports['start']=function(_0x194d87){return connect()[_0xa419('0x3')](function(){return new BPromise(function(_0x11543a,_0x5b986f){return pm2[_0xa419('0x4')](_0x194d87,function(_0x28e495,_0x25fb25){if(_0x28e495){return _0x5b986f(_0x28e495);}pm2['disconnect']();return _0x11543a(_0x25fb25);});});});};exports[_0xa419('0x5')]=function(_0x4140a2){return connect()[_0xa419('0x3')](function(){return new BPromise(function(_0x5eca9b,_0x322f84){return pm2[_0xa419('0x5')](_0x4140a2,function(_0x476a90,_0x3e8725){if(_0x476a90){return _0x322f84(_0x476a90);}pm2['disconnect']();return _0x5eca9b(_0x3e8725);});});});};exports[_0xa419('0x6')]=function(_0xd876c3){return connect()[_0xa419('0x3')](function(){return new BPromise(function(_0x36d6d8,_0x590129){return pm2[_0xa419('0x6')](_0xd876c3,function(_0x497910,_0x230586){if(_0x497910){return _0x590129(_0x497910);}pm2[_0xa419('0x7')]();return _0x36d6d8(_0x230586);});});});};exports[_0xa419('0x8')]=function(){return connect()[_0xa419('0x3')](function(){return new BPromise(function(_0xb7c4b3,_0x56c7e2){return pm2['list'](function(_0x2f4e49,_0x542641){if(_0x2f4e49){return _0x56c7e2(_0x2f4e49);}pm2[_0xa419('0x7')]();return _0xb7c4b3(_0x542641);});});});};exports['describe']=function(_0x264c8f){return connect()[_0xa419('0x3')](function(){return new BPromise(function(_0x5575bd,_0x245bc9){return pm2[_0xa419('0x9')](_0x264c8f,function(_0x59bd3f,_0x5b29af){if(_0x59bd3f){return _0x245bc9(_0x59bd3f);}pm2[_0xa419('0x7')]();return _0x5575bd(_0x5b29af);});});});};exports[_0xa419('0xa')]=function(_0xf6249e){return connect()[_0xa419('0x3')](function(){return new BPromise(function(_0x2e4941,_0x5a5823){return pm2[_0xa419('0xa')](_0xf6249e,function(_0x584e02,_0x33ee05){if(_0x584e02){return _0x5a5823(_0x584e02);}pm2[_0xa419('0x7')]();return _0x2e4941(_0x33ee05);});});});};exports[_0xa419('0xb')]=function(){return connect()['then'](function(){return new BPromise(function(_0x59da29,_0x2b0fef){return pm2[_0xa419('0xb')](function(_0x426388){if(_0x426388){return _0x2b0fef(_0x426388);}return _0x59da29(_0xa419('0xc'));});});});};
\ No newline at end of file
+var _0x539b=['list','describe','delete','dump','saved','pm2','bluebird','./config','connect','connected','start','then','disconnect','restart'];(function(_0x3f2275,_0x3772e4){var _0x211464=function(_0x1e583b){while(--_0x1e583b){_0x3f2275['push'](_0x3f2275['shift']());}};_0x211464(++_0x3772e4);}(_0x539b,0x17f));var _0xb539=function(_0x391445,_0x32202c){_0x391445=_0x391445-0x0;var _0x226ddf=_0x539b[_0x391445];return _0x226ddf;};'use strict';var pm2=require(_0xb539('0x0'));var BPromise=require(_0xb539('0x1'));var config=require(_0xb539('0x2'));function connect(){return new BPromise(function(_0xfe8bf7,_0x55652c){return pm2[_0xb539('0x3')](function(_0x16082d){if(_0x16082d){return _0x55652c(_0x16082d);}return _0xfe8bf7(_0xb539('0x4'));});});};exports[_0xb539('0x5')]=function(_0x421363){return connect()[_0xb539('0x6')](function(){return new BPromise(function(_0x167b27,_0x303666){return pm2[_0xb539('0x5')](_0x421363,function(_0x30856a,_0xf0c62){if(_0x30856a){return _0x303666(_0x30856a);}pm2['disconnect']();return _0x167b27(_0xf0c62);});});});};exports['stop']=function(_0x116edb){return connect()[_0xb539('0x6')](function(){return new BPromise(function(_0x17ac51,_0x377e63){return pm2['stop'](_0x116edb,function(_0x4f4ee9,_0x15c6a7){if(_0x4f4ee9){return _0x377e63(_0x4f4ee9);}pm2[_0xb539('0x7')]();return _0x17ac51(_0x15c6a7);});});});};exports[_0xb539('0x8')]=function(_0x16ad96){return connect()[_0xb539('0x6')](function(){return new BPromise(function(_0x2ba37c,_0x45b82c){return pm2[_0xb539('0x8')](_0x16ad96,function(_0x141a1e,_0x1c745e){if(_0x141a1e){return _0x45b82c(_0x141a1e);}pm2[_0xb539('0x7')]();return _0x2ba37c(_0x1c745e);});});});};exports[_0xb539('0x9')]=function(){return connect()[_0xb539('0x6')](function(){return new BPromise(function(_0x2eebc2,_0x47c53d){return pm2['list'](function(_0x5754cd,_0x17957a){if(_0x5754cd){return _0x47c53d(_0x5754cd);}pm2['disconnect']();return _0x2eebc2(_0x17957a);});});});};exports[_0xb539('0xa')]=function(_0x2d0c52){return connect()[_0xb539('0x6')](function(){return new BPromise(function(_0x389903,_0x3bf63e){return pm2[_0xb539('0xa')](_0x2d0c52,function(_0x367ac7,_0x1fd742){if(_0x367ac7){return _0x3bf63e(_0x367ac7);}pm2['disconnect']();return _0x389903(_0x1fd742);});});});};exports[_0xb539('0xb')]=function(_0x4e3542){return connect()['then'](function(){return new BPromise(function(_0xf1046a,_0x3c1426){return pm2[_0xb539('0xb')](_0x4e3542,function(_0x52a185,_0xacadad){if(_0x52a185){return _0x3c1426(_0x52a185);}pm2[_0xb539('0x7')]();return _0xf1046a(_0xacadad);});});});};exports[_0xb539('0xc')]=function(){return connect()['then'](function(){return new BPromise(function(_0x3c84c1,_0x3d1fcf){return pm2[_0xb539('0xc')](function(_0x242492){if(_0x242492){return _0x3d1fcf(_0x242492);}return _0x3c84c1(_0xb539('0xd'));});});});};
\ No newline at end of file
index 48e5004..81be051 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e09=['start','lodash','moment','util','../../config/environment','../../mysqldb','schedule','redis','localhost','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','format','YYYY-MM-DD\x20HH:mm:ss','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect'];(function(_0x46111d,_0x5d286b){var _0xe82586=function(_0x39551b){while(--_0x39551b){_0x46111d['push'](_0x46111d['shift']());}};_0xe82586(++_0x5d286b);}(_0x2e09,0x1d1));var _0x92e0=function(_0x460328,_0x10407a){_0x460328=_0x460328-0x0;var _0x3db9bf=_0x2e09[_0x460328];return _0x3db9bf;};'use strict';var _=require(_0x92e0('0x0'));var moment=require(_0x92e0('0x1'));var Redis=require('ioredis');var util=require(_0x92e0('0x2'));var config=require(_0x92e0('0x3'));var db=require(_0x92e0('0x4'))['db'];var logger=require('../logger')(_0x92e0('0x5'));config[_0x92e0('0x6')]=_['defaults'](config[_0x92e0('0x6')],{'host':_0x92e0('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x92e0('0x6')]));function closeInteractions(){var _0x51fae0=0x0;var _0x374fc4=[];return db['Setting'][_0x92e0('0x8')]({'raw':!![],'attributes':['id',_0x92e0('0x9')],'where':{'id':0x1}})[_0x92e0('0xa')](function(_0x200cb3){_0x51fae0=_0x200cb3[_0x92e0('0x9')];if(_0x51fae0){return db[_0x92e0('0xb')][_0x92e0('0xc')]({'raw':!![],'attributes':['id',_0x92e0('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x92e0('0xe')](_0x200cb3[_0x92e0('0x9')],'minutes')}}});}else{return[];}})[_0x92e0('0xa')](function(_0x15c7fc){if(_0x15c7fc&&_0x15c7fc['length']){_0x374fc4=_[_0x92e0('0xf')](_0x15c7fc||[],'id');logger[_0x92e0('0x10')](_0x92e0('0x11'),_0x374fc4[_0x92e0('0x12')]());return db[_0x92e0('0xb')][_0x92e0('0x13')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0x92e0('0x14')](_0x92e0('0x15'))},{'where':{'id':_0x374fc4}});}})[_0x92e0('0xa')](function(){if(_0x374fc4&&_0x374fc4[_0x92e0('0x16')]){logger[_0x92e0('0x10')](_0x92e0('0x17'),_0x374fc4[_0x92e0('0x12')]());for(var _0x115cb8=0x0;_0x115cb8<_0x374fc4['length'];_0x115cb8++){io['emit']('chatInteraction:update',{'id':_0x374fc4[_0x115cb8],'closed':!![]});}}})[_0x92e0('0x18')](function(_0xbbd6f6){logger[_0x92e0('0x19')](_0x92e0('0x1a'),_0xbbd6f6?util[_0x92e0('0x1b')](_0xbbd6f6,{'showHidden':![],'depth':null}):'');});}exports[_0x92e0('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0xbdc1=['../../mysqldb','../logger','schedule','redis','defaults','socket.io-emitter','Setting','find','chatTimeout','then','findAll','lastMsgAt','subtract','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','start','moment','util','../../config/environment'];(function(_0x2f26c0,_0x7b7536){var _0xb7b2b9=function(_0x574f0e){while(--_0x574f0e){_0x2f26c0['push'](_0x2f26c0['shift']());}};_0xb7b2b9(++_0x7b7536);}(_0xbdc1,0x147));var _0x1bdc=function(_0x553f85,_0x4878f4){_0x553f85=_0x553f85-0x0;var _0x51c0a0=_0xbdc1[_0x553f85];return _0x51c0a0;};'use strict';var _=require('lodash');var moment=require(_0x1bdc('0x0'));var Redis=require('ioredis');var util=require(_0x1bdc('0x1'));var config=require(_0x1bdc('0x2'));var db=require(_0x1bdc('0x3'))['db'];var logger=require(_0x1bdc('0x4'))(_0x1bdc('0x5'));config[_0x1bdc('0x6')]=_[_0x1bdc('0x7')](config[_0x1bdc('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x1bdc('0x8'))(new Redis(config[_0x1bdc('0x6')]));function closeInteractions(){var _0x522cbb=0x0;var _0x4059eb=[];return db[_0x1bdc('0x9')][_0x1bdc('0xa')]({'raw':!![],'attributes':['id',_0x1bdc('0xb')],'where':{'id':0x1}})[_0x1bdc('0xc')](function(_0xdbcdc3){_0x522cbb=_0xdbcdc3['chatTimeout'];if(_0x522cbb){return db['ChatInteraction'][_0x1bdc('0xd')]({'raw':!![],'attributes':['id',_0x1bdc('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x1bdc('0xf')](_0xdbcdc3['chatTimeout'],_0x1bdc('0x10'))}}});}else{return[];}})[_0x1bdc('0xc')](function(_0x22d659){if(_0x22d659&&_0x22d659[_0x1bdc('0x11')]){_0x4059eb=_[_0x1bdc('0x12')](_0x22d659||[],'id');logger[_0x1bdc('0x13')](_0x1bdc('0x14'),_0x4059eb[_0x1bdc('0x15')]());return db[_0x1bdc('0x16')][_0x1bdc('0x17')]({'closeReason':'system','disposition':_0x1bdc('0x18'),'closed':!![],'closedAt':moment()[_0x1bdc('0x19')](_0x1bdc('0x1a'))},{'where':{'id':_0x4059eb}});}})['then'](function(){if(_0x4059eb&&_0x4059eb[_0x1bdc('0x11')]){logger[_0x1bdc('0x13')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x4059eb[_0x1bdc('0x15')]());for(var _0x586fd6=0x0;_0x586fd6<_0x4059eb[_0x1bdc('0x11')];_0x586fd6++){io[_0x1bdc('0x1b')](_0x1bdc('0x1c'),{'id':_0x4059eb[_0x586fd6],'closed':!![]});}}})[_0x1bdc('0x1d')](function(_0x184356){logger[_0x1bdc('0x1e')](_0x1bdc('0x1f'),_0x184356?util['inspect'](_0x184356,{'showHidden':![],'depth':null}):'');});}exports[_0x1bdc('0x20')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index c5a2ad3..12c5dc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e14=['secure','pass','\x22%s\x22\x20<%s>','user','Report\x20%s\x20last\x20%s\x20%s','name','join','../../files/reports','savename','%s.%s','basename','extname','Sent','attachments','message','text','format','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','existsSync','status','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','stringify','email\x20sent','catch','data','isNil','subtractNumber','subtractUnit\x20null\x20or\x20undefined','subtract','subtractUnit','YYYY-MM-DD\x20HH:mm:ss','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','CustomReportId','no\x20report\x20id','Schedule','MailServerOut','keys','map','keyBy','difference','intersection','length','toString','exists','stop','deleteJob','toRun','index','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','stop\x20cron','update\x20cron','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x0e14,0x9c));var _0x40e1=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0x0e14[_0x18a79d];return _0x4f8848;};'use strict';var fs=require('fs');var util=require(_0x40e1('0x0'));var path=require(_0x40e1('0x1'));var _=require(_0x40e1('0x2'));var moment=require(_0x40e1('0x3'));var CronJobManager=require(_0x40e1('0x4'));var jayson=require(_0x40e1('0x5'));var BPromise=require(_0x40e1('0x6'));var logger=require(_0x40e1('0x7'))(_0x40e1('0x8'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x40e1('0x9'));var analyticDefaultReportController=require(_0x40e1('0xa'));var client=jayson['client'][_0x40e1('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x565c7d,_0x316bc3){return function(){logger[_0x40e1('0xc')](_0x40e1('0xd'),_0x565c7d[_0x40e1('0xe')]);var _0x20f135=!![];var _0x474ad8={'tls':{'rejectUnauthorized':![]}};if(_0x565c7d[_0x40e1('0xf')][_0x40e1('0x10')]['service']){_0x474ad8[_0x40e1('0x11')]=_0x565c7d[_0x40e1('0xf')]['Smtp'][_0x40e1('0x11')];}else{_0x474ad8['host']=_0x565c7d[_0x40e1('0xf')]['Smtp'][_0x40e1('0x12')];_0x474ad8[_0x40e1('0x13')]=_0x565c7d[_0x40e1('0xf')]['Smtp'][_0x40e1('0x13')];_0x474ad8['secure']=_0x565c7d[_0x40e1('0xf')][_0x40e1('0x10')][_0x40e1('0x14')];}if(_0x565c7d[_0x40e1('0xf')][_0x40e1('0x10')]['authentication']){_0x474ad8['auth']={'user':_0x565c7d[_0x40e1('0xf')][_0x40e1('0x10')]['user'],'pass':_0x565c7d[_0x40e1('0xf')][_0x40e1('0x10')][_0x40e1('0x15')]};}var _0x2ccf2a={'account':_0x474ad8,'message':{'from':util['format'](_0x40e1('0x16'),_0x565c7d[_0x40e1('0xf')]['name'],_0x565c7d['MailAccount'][_0x40e1('0xe')]||_0x565c7d[_0x40e1('0xf')]['Smtp'][_0x40e1('0x17')]),'to':_0x565c7d['email'],'cc':_0x565c7d['cc'],'bcc':_0x565c7d['bcc'],'subject':util['format'](_0x40e1('0x18'),_0x316bc3[_0x40e1('0x19')],_0x565c7d['subtractNumber'],_0x565c7d['subtractUnit'])}};var _0x4750ea=path[_0x40e1('0x1a')](__dirname,_0x40e1('0x1b'));var _0xab4f52=_0x316bc3[_0x40e1('0x1c')];var _0x4fb255=util['format'](_0x40e1('0x1d'),path[_0x40e1('0x1e')](_0x316bc3[_0x40e1('0x1c')],path[_0x40e1('0x1f')](_0x316bc3['savename'])),'zip');var _0x2fd2d2=path['join'](_0x4750ea,_0xab4f52);var _0x230795=path['join'](_0x4750ea,_0x4fb255);if(fs['existsSync'](_0x2fd2d2)){_0x316bc3['status']=_0x40e1('0x20');_0x2ccf2a['message'][_0x40e1('0x21')]=[{'filename':_0xab4f52,'path':_0x2fd2d2}];_0x2ccf2a[_0x40e1('0x22')][_0x40e1('0x23')]=util[_0x40e1('0x24')](_0x40e1('0x25'),JSON['stringify'](_0x316bc3,null,0x2));}else if(fs[_0x40e1('0x26')](_0x230795)){_0x316bc3[_0x40e1('0x27')]=_0x40e1('0x20');_0x2ccf2a[_0x40e1('0x22')]['attachments']=[{'filename':_0x4fb255,'path':_0x230795}];}else{_0x2ccf2a[_0x40e1('0x22')][_0x40e1('0x23')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x565c7d['sendIfEmpty']){_0x20f135=![];logger['info'](_0x40e1('0x28'));}}if(_0x20f135){return client[_0x40e1('0x29')](_0x40e1('0x2a'),_0x2ccf2a)[_0x40e1('0x2b')](function(_0x18dba2){if(_0x18dba2[_0x40e1('0x2c')]){return logger['error'](_0x40e1('0x2d'),JSON[_0x40e1('0x2e')](_0x18dba2));}return logger['info'](_0x40e1('0x2f'));})[_0x40e1('0x30')](function(_0x4f1933){return logger['error'](_0x40e1('0x2d'),JSON[_0x40e1('0x2e')](_0x4f1933));});}};}function handleError(){return function(_0xdc1a8){return logger[_0x40e1('0x2c')](JSON[_0x40e1('0x2e')](_0xdc1a8));};}function handleResult(_0x4a5c87){return function(_0x1db99d){logger[_0x40e1('0xc')](_0x40e1('0x31'),JSON[_0x40e1('0x2e')](_0x1db99d));if(_0x4a5c87[_0x40e1('0xf')]&&_0x4a5c87[_0x40e1('0xf')]['Smtp']&&!_[_0x40e1('0x32')](_0x4a5c87['email'])){setTimeout(handleSendEmail(_0x4a5c87,_0x1db99d),0x3c*0x3e8);}};}function handleJob(_0x245eba){return function(){try{if(_[_0x40e1('0x32')](_0x245eba[_0x40e1('0x33')])){return logger[_0x40e1('0xc')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x40e1('0x32')](_0x245eba['subtractUnit'])){return logger[_0x40e1('0xc')](_0x40e1('0x34'));}var _0x320296={'startDate':moment()[_0x40e1('0x35')](_0x245eba[_0x40e1('0x33')],_0x245eba[_0x40e1('0x36')])['format'](_0x40e1('0x37')),'endDate':moment()['format'](_0x40e1('0x37')),'type':'scheduled','output':_0x245eba[_0x40e1('0x38')],'name':_0x245eba[_0x40e1('0x19')]};if(!_[_0x40e1('0x32')](_0x245eba['DefaultReportId'])){logger[_0x40e1('0xc')](_0x40e1('0x39'),_0x245eba[_0x40e1('0x3a')]);return analyticDefaultReportController[_0x40e1('0x3b')]({'id':_0x245eba[_0x40e1('0x3a')]},_0x320296)[_0x40e1('0x2b')](handleResult(_0x245eba))[_0x40e1('0x30')](handleError());}if(!_[_0x40e1('0x32')](_0x245eba[_0x40e1('0x3c')])){logger[_0x40e1('0xc')]('exec\x20custom\x20report\x20id:%s',_0x245eba[_0x40e1('0x3c')]);return analyticCustomReportController[_0x40e1('0x3b')]({'id':_0x245eba[_0x40e1('0x3c')]},_0x320296)['then'](handleResult(_0x245eba))['catch'](handleError());}}catch(_0x259454){logger[_0x40e1('0x2c')](JSON[_0x40e1('0x2e')](_0x259454));}return logger[_0x40e1('0xc')](_0x40e1('0x3d'));};}function getJobs(_0x2936a4){var _0x22a228={};if(_0x2936a4){_0x22a228['id']=_0x2936a4;}return db[_0x40e1('0x3e')]['findAll']({'where':_0x22a228,'include':[{'model':db['MailAccount'],'attributes':['id',_0x40e1('0x19'),_0x40e1('0xe')],'include':[{'model':db[_0x40e1('0x3f')],'as':_0x40e1('0x10')}]}]})[_0x40e1('0x2b')](function(_0x1b495e){var _0x35ed8e=_[_0x40e1('0x40')](manager['jobs']);var _0x4ed0c0=_[_0x40e1('0x41')](_0x1b495e,function(_0x5b86b0){return _0x5b86b0['id']['toString']();});var _0x245fb3=_[_0x40e1('0x42')](_0x1b495e,function(_0x144cf4){return _0x144cf4['id']['toString']();});var _0x354696=_0x2936a4?_0x4ed0c0:_[_0x40e1('0x43')](_0x4ed0c0,_0x35ed8e);var _0x29d8ab=_[_0x40e1('0x44')](_0x4ed0c0,_0x35ed8e);var _0x22a97e=_[_0x40e1('0x43')](_0x35ed8e,_0x4ed0c0);var _0xbcdbcd;var _0x220d2f;for(_0xbcdbcd=0x0;_0xbcdbcd<_0x22a97e[_0x40e1('0x45')]&&!_0x2936a4;_0xbcdbcd+=0x1){_0x220d2f=_0x22a97e[_0xbcdbcd][_0x40e1('0x46')]();if(manager[_0x40e1('0x47')](_0x220d2f)){manager[_0x40e1('0x48')](_0x220d2f);manager[_0x40e1('0x49')](_0x220d2f);logger[_0x40e1('0xc')]('delete\x20cron',_0x220d2f);}}logger[_0x40e1('0xc')](_0x40e1('0x4a'),JSON['stringify'](_0x354696));for(_0xbcdbcd=0x0;_0xbcdbcd<_0x354696[_0x40e1('0x45')];_0xbcdbcd+=0x1){_0x220d2f=_0x354696[_0xbcdbcd][_0x40e1('0x46')]();logger['info'](_0x40e1('0x4b'),_0x220d2f);if(_0x2936a4){logger[_0x40e1('0xc')]('my\x20id',_0x2936a4);logger[_0x40e1('0xc')](JSON[_0x40e1('0x2e')](_0x245fb3[_0x220d2f]));BPromise[_0x40e1('0x4c')]()[_0x40e1('0x2b')](handleJob(_0x245fb3[_0x220d2f]));logger[_0x40e1('0xc')](_0x40e1('0x4d'),_0x245fb3[_0x220d2f]['name'],_0x245fb3[_0x220d2f][_0x40e1('0x4e')]);}else if(_0x245fb3[_0x220d2f][_0x40e1('0x4e')]&&_0x245fb3[_0x220d2f][_0x40e1('0x4f')]&&moment()[_0x40e1('0x50')](_0x245fb3[_0x220d2f][_0x40e1('0x51')],_0x245fb3[_0x220d2f][_0x40e1('0x52')])){manager[_0x40e1('0x53')](_0x220d2f,_0x245fb3[_0x220d2f]['cron'],handleJob(_0x245fb3[_0x220d2f]));manager[_0x40e1('0x54')](_0x220d2f);logger[_0x40e1('0xc')](_0x40e1('0x55'),_0x245fb3[_0x220d2f][_0x40e1('0x19')],_0x245fb3[_0x220d2f][_0x40e1('0x4e')]);}else if(manager['exists'](_0x220d2f)){manager['stop'](_0x220d2f);manager[_0x40e1('0x49')](_0x220d2f);logger[_0x40e1('0xc')](_0x40e1('0x56'),_0x245fb3[_0x220d2f]['name'],_0x245fb3[_0x220d2f][_0x40e1('0x4e')]);}}for(_0xbcdbcd=0x0,_0x220d2f;_0xbcdbcd<_0x29d8ab[_0x40e1('0x45')]&&!_0x2936a4;_0xbcdbcd+=0x1){_0x220d2f=_0x29d8ab[_0xbcdbcd][_0x40e1('0x46')]();if(manager[_0x40e1('0x47')](_0x220d2f)){if(_0x245fb3[_0x220d2f]['cron']&&_0x245fb3[_0x220d2f][_0x40e1('0x4f')]&&moment()['isBetween'](_0x245fb3[_0x220d2f][_0x40e1('0x51')],_0x245fb3[_0x220d2f][_0x40e1('0x52')])){manager['update'](_0x220d2f,_0x245fb3[_0x220d2f][_0x40e1('0x4e')],handleJob(_0x245fb3[_0x220d2f]));logger[_0x40e1('0xc')](_0x40e1('0x57'),_0x245fb3[_0x220d2f][_0x40e1('0x19')],_0x245fb3[_0x220d2f][_0x40e1('0x4e')]);}else{manager[_0x40e1('0x48')](_0x220d2f);manager['deleteJob'](_0x220d2f);logger[_0x40e1('0xc')](_0x40e1('0x56'),_0x245fb3[_0x220d2f]['name'],_0x245fb3[_0x220d2f][_0x40e1('0x4e')]);}}}})[_0x40e1('0x30')](function(_0x2b570e){logger['error'](JSON[_0x40e1('0x2e')](_0x2b570e));});}exports['run']=function(_0x151daf){return getJobs(_0x151daf);};exports[_0x40e1('0x54')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0x97f4=['MailServerOut','jobs','difference','intersection','toString','exists','deleteJob','delete\x20cron','toRun','index','run\x20job','cron','active','isBetween','endAt','start','add\x20cron','stop','stop\x20cron','startAt','run','util','lodash','cron-job-manager','jayson/promise','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','format','\x22%s\x22\x20<%s>','user','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','extname','zip','existsSync','status','message','attachments','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','stringify','email\x20sent','catch','error\x20mail','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','runReport','CustomReportId','no\x20report\x20id','Schedule','findAll'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x97f4,0x69));var _0x497f=function(_0x371d95,_0x125510){_0x371d95=_0x371d95-0x0;var _0x5d56b8=_0x97f4[_0x371d95];return _0x5d56b8;};'use strict';var fs=require('fs');var util=require(_0x497f('0x0'));var path=require('path');var _=require(_0x497f('0x1'));var moment=require('moment');var CronJobManager=require(_0x497f('0x2'));var jayson=require(_0x497f('0x3'));var BPromise=require('bluebird');var logger=require(_0x497f('0x4'))(_0x497f('0x5'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x497f('0x6'));var analyticDefaultReportController=require(_0x497f('0x7'));var client=jayson[_0x497f('0x8')][_0x497f('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x31cbd7,_0x16e2be){return function(){logger[_0x497f('0xa')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x31cbd7[_0x497f('0xb')]);var _0x27dd38=!![];var _0x2bd38c={'tls':{'rejectUnauthorized':![]}};if(_0x31cbd7[_0x497f('0xc')][_0x497f('0xd')][_0x497f('0xe')]){_0x2bd38c[_0x497f('0xe')]=_0x31cbd7[_0x497f('0xc')]['Smtp'][_0x497f('0xe')];}else{_0x2bd38c['host']=_0x31cbd7[_0x497f('0xc')]['Smtp'][_0x497f('0xf')];_0x2bd38c[_0x497f('0x10')]=_0x31cbd7[_0x497f('0xc')][_0x497f('0xd')][_0x497f('0x10')];_0x2bd38c[_0x497f('0x11')]=_0x31cbd7[_0x497f('0xc')][_0x497f('0xd')][_0x497f('0x11')];}if(_0x31cbd7[_0x497f('0xc')][_0x497f('0xd')][_0x497f('0x12')]){_0x2bd38c[_0x497f('0x13')]={'user':_0x31cbd7[_0x497f('0xc')][_0x497f('0xd')]['user'],'pass':_0x31cbd7[_0x497f('0xc')][_0x497f('0xd')][_0x497f('0x14')]};}var _0x1dc2f6={'account':_0x2bd38c,'message':{'from':util[_0x497f('0x15')](_0x497f('0x16'),_0x31cbd7['MailAccount']['name'],_0x31cbd7[_0x497f('0xc')][_0x497f('0xb')]||_0x31cbd7['MailAccount'][_0x497f('0xd')][_0x497f('0x17')]),'to':_0x31cbd7[_0x497f('0xb')],'cc':_0x31cbd7['cc'],'bcc':_0x31cbd7[_0x497f('0x18')],'subject':util[_0x497f('0x15')](_0x497f('0x19'),_0x16e2be[_0x497f('0x1a')],_0x31cbd7[_0x497f('0x1b')],_0x31cbd7[_0x497f('0x1c')])}};var _0x5ba194=path[_0x497f('0x1d')](__dirname,_0x497f('0x1e'));var _0x3f532b=_0x16e2be[_0x497f('0x1f')];var _0x114dd1=util[_0x497f('0x15')](_0x497f('0x20'),path['basename'](_0x16e2be[_0x497f('0x1f')],path[_0x497f('0x21')](_0x16e2be[_0x497f('0x1f')])),_0x497f('0x22'));var _0x57dc68=path[_0x497f('0x1d')](_0x5ba194,_0x3f532b);var _0xf9cb7e=path[_0x497f('0x1d')](_0x5ba194,_0x114dd1);if(fs[_0x497f('0x23')](_0x57dc68)){_0x16e2be[_0x497f('0x24')]='Sent';_0x1dc2f6[_0x497f('0x25')][_0x497f('0x26')]=[{'filename':_0x3f532b,'path':_0x57dc68}];_0x1dc2f6['message']['text']=util['format'](_0x497f('0x27'),JSON['stringify'](_0x16e2be,null,0x2));}else if(fs[_0x497f('0x23')](_0xf9cb7e)){_0x16e2be[_0x497f('0x24')]='Sent';_0x1dc2f6[_0x497f('0x25')][_0x497f('0x26')]=[{'filename':_0x114dd1,'path':_0xf9cb7e}];}else{_0x1dc2f6[_0x497f('0x25')]['text']=_0x497f('0x28');if(!_0x31cbd7[_0x497f('0x29')]){_0x27dd38=![];logger['info'](_0x497f('0x2a'));}}if(_0x27dd38){return client['request'](_0x497f('0x2b'),_0x1dc2f6)[_0x497f('0x2c')](function(_0x4b240a){if(_0x4b240a[_0x497f('0x2d')]){return logger[_0x497f('0x2d')]('error\x20mail',JSON[_0x497f('0x2e')](_0x4b240a));}return logger['info'](_0x497f('0x2f'));})[_0x497f('0x30')](function(_0x68b658){return logger[_0x497f('0x2d')](_0x497f('0x31'),JSON[_0x497f('0x2e')](_0x68b658));});}};}function handleError(){return function(_0x4b23a6){return logger[_0x497f('0x2d')](JSON['stringify'](_0x4b23a6));};}function handleResult(_0x5596d4){return function(_0x12502f){logger[_0x497f('0xa')](_0x497f('0x32'),JSON[_0x497f('0x2e')](_0x12502f));if(_0x5596d4[_0x497f('0xc')]&&_0x5596d4[_0x497f('0xc')][_0x497f('0xd')]&&!_[_0x497f('0x33')](_0x5596d4[_0x497f('0xb')])){setTimeout(handleSendEmail(_0x5596d4,_0x12502f),0x3c*0x3e8);}};}function handleJob(_0xaf142){return function(){try{if(_[_0x497f('0x33')](_0xaf142[_0x497f('0x1b')])){return logger[_0x497f('0xa')]('subtractNumber\x20null\x20or\x20undefined');}if(_['isNil'](_0xaf142['subtractUnit'])){return logger['info'](_0x497f('0x34'));}var _0x3c5e13={'startDate':moment()[_0x497f('0x35')](_0xaf142[_0x497f('0x1b')],_0xaf142['subtractUnit'])['format']('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()['format'](_0x497f('0x36')),'type':_0x497f('0x37'),'output':_0xaf142[_0x497f('0x38')],'name':_0xaf142['name']};if(!_[_0x497f('0x33')](_0xaf142[_0x497f('0x39')])){logger[_0x497f('0xa')]('exec\x20defaul\x20report\x20id:%s',_0xaf142[_0x497f('0x39')]);return analyticDefaultReportController[_0x497f('0x3a')]({'id':_0xaf142['DefaultReportId']},_0x3c5e13)['then'](handleResult(_0xaf142))[_0x497f('0x30')](handleError());}if(!_[_0x497f('0x33')](_0xaf142[_0x497f('0x3b')])){logger[_0x497f('0xa')]('exec\x20custom\x20report\x20id:%s',_0xaf142['CustomReportId']);return analyticCustomReportController[_0x497f('0x3a')]({'id':_0xaf142['CustomReportId']},_0x3c5e13)[_0x497f('0x2c')](handleResult(_0xaf142))['catch'](handleError());}}catch(_0x4b18e9){logger[_0x497f('0x2d')](JSON[_0x497f('0x2e')](_0x4b18e9));}return logger[_0x497f('0xa')](_0x497f('0x3c'));};}function getJobs(_0x26bb04){var _0x4931b9={};if(_0x26bb04){_0x4931b9['id']=_0x26bb04;}return db[_0x497f('0x3d')][_0x497f('0x3e')]({'where':_0x4931b9,'include':[{'model':db[_0x497f('0xc')],'attributes':['id','name',_0x497f('0xb')],'include':[{'model':db[_0x497f('0x3f')],'as':_0x497f('0xd')}]}]})[_0x497f('0x2c')](function(_0xae8e3c){var _0x59a034=_['keys'](manager[_0x497f('0x40')]);var _0x4fe108=_['map'](_0xae8e3c,function(_0x16ae50){return _0x16ae50['id']['toString']();});var _0x1d1845=_['keyBy'](_0xae8e3c,function(_0x447610){return _0x447610['id']['toString']();});var _0x24caaa=_0x26bb04?_0x4fe108:_[_0x497f('0x41')](_0x4fe108,_0x59a034);var _0x10d28e=_[_0x497f('0x42')](_0x4fe108,_0x59a034);var _0x27172f=_[_0x497f('0x41')](_0x59a034,_0x4fe108);var _0x244b94;var _0x4d69c3;for(_0x244b94=0x0;_0x244b94<_0x27172f['length']&&!_0x26bb04;_0x244b94+=0x1){_0x4d69c3=_0x27172f[_0x244b94][_0x497f('0x43')]();if(manager[_0x497f('0x44')](_0x4d69c3)){manager['stop'](_0x4d69c3);manager[_0x497f('0x45')](_0x4d69c3);logger['info'](_0x497f('0x46'),_0x4d69c3);}}logger[_0x497f('0xa')](_0x497f('0x47'),JSON[_0x497f('0x2e')](_0x24caaa));for(_0x244b94=0x0;_0x244b94<_0x24caaa['length'];_0x244b94+=0x1){_0x4d69c3=_0x24caaa[_0x244b94]['toString']();logger[_0x497f('0xa')](_0x497f('0x48'),_0x4d69c3);if(_0x26bb04){logger[_0x497f('0xa')]('my\x20id',_0x26bb04);logger[_0x497f('0xa')](JSON[_0x497f('0x2e')](_0x1d1845[_0x4d69c3]));BPromise['resolve']()[_0x497f('0x2c')](handleJob(_0x1d1845[_0x4d69c3]));logger[_0x497f('0xa')](_0x497f('0x49'),_0x1d1845[_0x4d69c3][_0x497f('0x1a')],_0x1d1845[_0x4d69c3][_0x497f('0x4a')]);}else if(_0x1d1845[_0x4d69c3][_0x497f('0x4a')]&&_0x1d1845[_0x4d69c3][_0x497f('0x4b')]&&moment()[_0x497f('0x4c')](_0x1d1845[_0x4d69c3]['startAt'],_0x1d1845[_0x4d69c3][_0x497f('0x4d')])){manager['add'](_0x4d69c3,_0x1d1845[_0x4d69c3][_0x497f('0x4a')],handleJob(_0x1d1845[_0x4d69c3]));manager[_0x497f('0x4e')](_0x4d69c3);logger[_0x497f('0xa')](_0x497f('0x4f'),_0x1d1845[_0x4d69c3]['name'],_0x1d1845[_0x4d69c3][_0x497f('0x4a')]);}else if(manager[_0x497f('0x44')](_0x4d69c3)){manager[_0x497f('0x50')](_0x4d69c3);manager[_0x497f('0x45')](_0x4d69c3);logger[_0x497f('0xa')](_0x497f('0x51'),_0x1d1845[_0x4d69c3][_0x497f('0x1a')],_0x1d1845[_0x4d69c3][_0x497f('0x4a')]);}}for(_0x244b94=0x0,_0x4d69c3;_0x244b94<_0x10d28e['length']&&!_0x26bb04;_0x244b94+=0x1){_0x4d69c3=_0x10d28e[_0x244b94][_0x497f('0x43')]();if(manager[_0x497f('0x44')](_0x4d69c3)){if(_0x1d1845[_0x4d69c3]['cron']&&_0x1d1845[_0x4d69c3][_0x497f('0x4b')]&&moment()['isBetween'](_0x1d1845[_0x4d69c3][_0x497f('0x52')],_0x1d1845[_0x4d69c3][_0x497f('0x4d')])){manager['update'](_0x4d69c3,_0x1d1845[_0x4d69c3][_0x497f('0x4a')],handleJob(_0x1d1845[_0x4d69c3]));logger[_0x497f('0xa')]('update\x20cron',_0x1d1845[_0x4d69c3][_0x497f('0x1a')],_0x1d1845[_0x4d69c3]['cron']);}else{manager[_0x497f('0x50')](_0x4d69c3);manager[_0x497f('0x45')](_0x4d69c3);logger[_0x497f('0xa')]('stop\x20cron',_0x1d1845[_0x4d69c3][_0x497f('0x1a')],_0x1d1845[_0x4d69c3][_0x497f('0x4a')]);}}}})[_0x497f('0x30')](function(_0x238407){logger[_0x497f('0x2d')](JSON[_0x497f('0x2e')](_0x238407));});}exports[_0x497f('0x53')]=function(_0xe42d1a){return getJobs(_0xe42d1a);};exports[_0x497f('0x4e')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
index 18b8026..095485b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ea=['then','fileText','TranscriptionJob','TranscriptionJobStatus','COMPLETED','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','ValidationError','sentiment','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data2','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','Sentiment','SentimentScore','Positive','Negative','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sequelize','Sentiment\x20Analysis\x20not\x20requested','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','name','SequelizeValidationError','error','inspect','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','forEach','push','catch','start','lodash','aws-sdk','request-promise','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','transcribeRegion'];(function(_0x1d251c,_0x2c5b35){var _0x4ac810=function(_0x3ad1ab){while(--_0x3ad1ab){_0x1d251c['push'](_0x1d251c['shift']());}};_0x4ac810(++_0x2c5b35);}(_0x55ea,0xc9));var _0xa55e=function(_0x51e54b,_0x580321){_0x51e54b=_0x51e54b-0x0;var _0x41f672=_0x55ea[_0x51e54b];return _0x41f672;};var _=require(_0xa55e('0x0'));var AWS=require(_0xa55e('0x1'));var rp=require(_0xa55e('0x2'));var util=require('util');var BPromise=require(_0xa55e('0x3'));var db=require(_0xa55e('0x4'))['db'];var logger=require(_0xa55e('0x5'))(_0xa55e('0x6'));function getTranscriptionJob(_0x95af3d,_0x54f178,_0x2d1040,_0x56ca45){return new Promise(function(_0x515646,_0x588751){var _0x5a009c=new AWS[(_0xa55e('0x7'))]({'accessKeyId':_0x54f178,'secretAccessKey':_0x95af3d,'region':_0x2d1040});_0x5a009c[_0xa55e('0x8')]({'TranscriptionJobName':_0x56ca45},function(_0x30b885,_0xca9526){if(_0x30b885){return _0x588751(_0x30b885);}else{return _0x515646(_0xca9526);}});});}function sentiment(_0x37b797,_0xeedd77,_0x32f6f7,_0x3020cc,_0xe58ede){return new Promise(function(_0x5da3d0,_0x5e38fa){var _0x13f6d7=new AWS[(_0xa55e('0x9'))]({'accessKeyId':_0xeedd77,'secretAccessKey':_0x37b797,'region':_0x32f6f7});_0x13f6d7[_0xa55e('0xa')]({'Text':_0x3020cc,'LanguageCode':_0xe58ede[_0xa55e('0xb')](0x0,0x2)},function(_0x2593b7,_0x5e38dd){if(_0x2593b7){return _0x5e38fa(_0x2593b7);}else{return _0x5da3d0(_0x5e38dd);}});});}function checkTranscribeJob(_0x1c1ca3,_0x5b69cc,_0x3f5178){var _0x1d45c1;return new BPromise(function(_0x153f71,_0x2d2280){logger[_0xa55e('0xc')](util[_0xa55e('0xd')](_0xa55e('0xe'),_0x1c1ca3['id'],_0x1c1ca3[_0xa55e('0xf')]));return getTranscriptionJob(_0x3f5178[_0xa55e('0x10')],_0x3f5178['data2'],_0x5b69cc[_0xa55e('0x11')],_0x1c1ca3[_0xa55e('0xf')])[_0xa55e('0x12')](function(_0x12895e){logger[_0xa55e('0xc')](util[_0xa55e('0xd')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x1c1ca3['id'],_0x1c1ca3[_0xa55e('0xf')],_0x12895e['TranscriptionJob']['TranscriptionJobStatus']));if(!_0x1c1ca3[_0xa55e('0x13')]){switch(_0x12895e[_0xa55e('0x14')][_0xa55e('0x15')]){case _0xa55e('0x16'):var _0x3980b4={'transcribeStatus':_0x12895e['TranscriptionJob'][_0xa55e('0x15')],'fileUri':_0x12895e['TranscriptionJob']['Transcript'][_0xa55e('0x17')]};logger[_0xa55e('0xc')](util[_0xa55e('0xd')](_0xa55e('0x18'),_0x1c1ca3['id']));return rp({'uri':_0x12895e[_0xa55e('0x14')][_0xa55e('0x19')][_0xa55e('0x17')],'json':!![]})[_0xa55e('0x12')](function(_0x9594a3){logger['info'](util['format'](_0xa55e('0x1a'),_0x1c1ca3['id']));if(_0x9594a3&&_0x9594a3['results']&&_0x9594a3[_0xa55e('0x1b')][_0xa55e('0x1c')]&&_0x9594a3[_0xa55e('0x1b')][_0xa55e('0x1c')][_0xa55e('0x1d')]){_0x3980b4[_0xa55e('0x13')]='';for(var _0x129762=0x0;_0x129762<_0x9594a3[_0xa55e('0x1b')][_0xa55e('0x1c')][_0xa55e('0x1d')];_0x129762++){_0x3980b4[_0xa55e('0x13')]+=_0x9594a3[_0xa55e('0x1b')][_0xa55e('0x1c')][_0x129762][_0xa55e('0x1e')]+'';}}return _0x1c1ca3[_0xa55e('0x1f')](_0x3980b4);})[_0xa55e('0x12')](function(){logger[_0xa55e('0xc')](util[_0xa55e('0xd')](_0xa55e('0x20'),_0x1c1ca3['id']));if(!_0x1c1ca3['tempSentiment']){throw new db['Sequelize'][(_0xa55e('0x21'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x5b69cc[_0xa55e('0x22')]||!_0x5b69cc['sentimentAccountId']||!_0x5b69cc[_0xa55e('0x23')]||!_0x5b69cc['language']||!_0x5b69cc[_0xa55e('0x24')]){throw new db['Sequelize'][(_0xa55e('0x21'))](_0xa55e('0x25'));}if(!_0x3980b4['fileText']){throw new Error(_0xa55e('0x26'));}if(_0x5b69cc[_0xa55e('0x27')]===_0x3f5178['id']){return _0x3f5178;}else{return db[_0xa55e('0x28')][_0xa55e('0x29')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xa55e('0x12')](function(_0x25ecb3){if(!_0x25ecb3){throw new db['Sequelize'][(_0xa55e('0x21'))](_0xa55e('0x2a'));}if(!_0x25ecb3[_0xa55e('0x10')]||!_0x25ecb3[_0xa55e('0x2b')]){throw new db['Sequelize'][(_0xa55e('0x21'))]('Cloud\x20Provider\x20not\x20configured');}_0x1d45c1=_0x25ecb3;logger[_0xa55e('0xc')](util['format'](_0xa55e('0x2c'),_0x1c1ca3['id']));return sentiment(_0x1d45c1[_0xa55e('0x10')],_0x1d45c1[_0xa55e('0x2b')],_0x5b69cc[_0xa55e('0x23')],_0x3980b4['fileText'],_0x5b69cc[_0xa55e('0x2d')]);})['then'](function(_0x15e6e2){logger[_0xa55e('0xc')](util[_0xa55e('0xd')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x1c1ca3['id']));return _0x1c1ca3[_0xa55e('0x1f')]({'sentiment':_0x15e6e2[_0xa55e('0x2e')],'sPositive':_0x15e6e2[_0xa55e('0x2f')][_0xa55e('0x30')],'sNegative':_0x15e6e2[_0xa55e('0x2f')][_0xa55e('0x31')],'sMixed':_0x15e6e2['SentimentScore']['Mixed'],'sNeutral':_0x15e6e2[_0xa55e('0x2f')][_0xa55e('0x32')]});})[_0xa55e('0x12')](function(){logger[_0xa55e('0xc')](util[_0xa55e('0xd')](_0xa55e('0x20'),_0x1c1ca3['id']));_0x153f71();});case _0xa55e('0x33'):return _0x1c1ca3['update']({'transcribeStatus':'FAILED','failureReason':_0x12895e[_0xa55e('0x14')][_0xa55e('0x34')]})[_0xa55e('0x12')](function(){logger[_0xa55e('0xc')](util[_0xa55e('0xd')](_0xa55e('0x20'),_0x1c1ca3['id']));_0x153f71();});default:logger[_0xa55e('0xc')](util[_0xa55e('0xd')](_0xa55e('0x35'),_0x1c1ca3['id']));break;}}else{return BPromise[_0xa55e('0x36')]()[_0xa55e('0x12')](function(){if(!_0x1c1ca3['tempSentiment']){throw new db[(_0xa55e('0x37'))][(_0xa55e('0x21'))](_0xa55e('0x38'));}if(!_0x5b69cc['sentiment']||!_0x5b69cc[_0xa55e('0x27')]||!_0x5b69cc['sentimentRegion']||!_0x5b69cc[_0xa55e('0x2d')]||!_0x5b69cc[_0xa55e('0x24')]){throw new db[(_0xa55e('0x37'))][(_0xa55e('0x21'))](_0xa55e('0x25'));}if(!_0x1c1ca3[_0xa55e('0x13')]){throw new Error(_0xa55e('0x26'));}if(_0x5b69cc['sentimentAccountId']===_0x3f5178['id']){return _0x3f5178;}else{return db['CloudProvider'][_0xa55e('0x29')]({'where':{'id':_settings[_0xa55e('0x27')]}});}})[_0xa55e('0x12')](function(_0x518e06){if(!_0x518e06){throw new db[(_0xa55e('0x37'))][(_0xa55e('0x21'))](_0xa55e('0x2a'));}if(!_0x518e06[_0xa55e('0x10')]||!_0x518e06[_0xa55e('0x2b')]){throw new db[(_0xa55e('0x37'))][(_0xa55e('0x21'))](_0xa55e('0x39'));}_0x1d45c1=_0x518e06;logger['info'](util['format'](_0xa55e('0x2c'),_0x1c1ca3['id']));return sentiment(_0x1d45c1[_0xa55e('0x10')],_0x1d45c1[_0xa55e('0x2b')],_0x5b69cc[_0xa55e('0x23')],_0x1c1ca3[_0xa55e('0x13')],_0x5b69cc[_0xa55e('0x2d')]);})[_0xa55e('0x12')](function(_0xd6b91f){logger['info'](util['format'](_0xa55e('0x3a'),_0x1c1ca3['id']));return _0x1c1ca3['update']({'sentiment':_0xd6b91f[_0xa55e('0x2e')],'sPositive':_0xd6b91f['SentimentScore']['Positive'],'sNegative':_0xd6b91f[_0xa55e('0x2f')][_0xa55e('0x31')],'sMixed':_0xd6b91f['SentimentScore']['Mixed'],'sNeutral':_0xd6b91f[_0xa55e('0x2f')][_0xa55e('0x32')],'transcribeStatus':_0xa55e('0x16')});})[_0xa55e('0x12')](function(){logger[_0xa55e('0xc')](util[_0xa55e('0xd')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1c1ca3['id']));_0x153f71();});}})['catch'](function(_0x2282f9){if(_0x2282f9){if(!_0x2282f9[_0xa55e('0x3b')]||_0x2282f9[_0xa55e('0x3b')]!==_0xa55e('0x3c')){logger[_0xa55e('0x3d')](util[_0xa55e('0xd')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x1c1ca3['id']),util[_0xa55e('0x3e')](_0x2282f9,{'showHidden':![],'depth':null}));}}_0x153f71();});});}function checkTranscribe(){var _0x1f81af;var _0x1405cb;var _0x1de3a8;return db[_0xa55e('0x3f')][_0xa55e('0x40')]({'where':{'transcribeStatus':'IN_PROGRESS'}})['then'](function(_0x395e73){if(!_0x395e73||!_0x395e73['length']){throw new db[(_0xa55e('0x37'))]['ValidationError'](_0xa55e('0x41'));}_0x1f81af=_0x395e73;return db[_0xa55e('0x42')][_0xa55e('0x29')]({'where':{'id':0x1}});})[_0xa55e('0x12')](function(_0x2c35a8){if(!_0x2c35a8){throw new db[(_0xa55e('0x37'))][(_0xa55e('0x21'))](_0xa55e('0x43'));}_0x1405cb=_0x2c35a8;if(!_0x1405cb['transcribe']||!_0x1405cb[_0xa55e('0x44')]||!_0x1405cb[_0xa55e('0x11')]||!_0x1405cb[_0xa55e('0x2d')]||!_0x1405cb[_0xa55e('0x24')]){throw new db[(_0xa55e('0x37'))][(_0xa55e('0x21'))]('Transcribe\x20not\x20configured');}return db[_0xa55e('0x28')][_0xa55e('0x29')]({'where':{'id':_0x1405cb[_0xa55e('0x44')]}});})[_0xa55e('0x12')](function(_0x4559c8){if(!_0x4559c8){throw new db[(_0xa55e('0x37'))]['ValidationError'](_0xa55e('0x2a'));}if(!_0x4559c8['data1']||!_0x4559c8[_0xa55e('0x2b')]){throw new db[(_0xa55e('0x37'))][(_0xa55e('0x21'))](_0xa55e('0x39'));}_0x1de3a8=_0x4559c8;var _0xa01634=[];_0x1f81af[_0xa55e('0x45')](function(_0x570474){_0xa01634[_0xa55e('0x46')](checkTranscribeJob(_0x570474,_0x1405cb,_0x1de3a8));});return BPromise['all'](_0xa01634);})[_0xa55e('0x47')](function(_0x5be88c){if(_0x5be88c){if(!_0x5be88c['name']||_0x5be88c[_0xa55e('0x3b')]!==_0xa55e('0x3c')){logger[_0xa55e('0x3d')](util[_0xa55e('0x3e')](_0x5be88c,{'showHidden':![],'depth':null}));}}});}exports[_0xa55e('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
+var _0x5d86=['COMPLETED','TranscriptFileUri','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','SentimentScore','Positive','Negative','Neutral','FAILED','resolve','language','Cloud\x20Provider\x20not\x20available','Mixed','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','start','lodash','aws-sdk','bluebird','../../config/logger','transcribe','getTranscriptionJob','Comprehend','detectSentiment','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus'];(function(_0x4bce0d,_0x44999b){var _0x40d0aa=function(_0x1be96e){while(--_0x1be96e){_0x4bce0d['push'](_0x4bce0d['shift']());}};_0x40d0aa(++_0x44999b);}(_0x5d86,0x76));var _0x65d8=function(_0x24b283,_0x510549){_0x24b283=_0x24b283-0x0;var _0x23d8a1=_0x5d86[_0x24b283];return _0x23d8a1;};var _=require(_0x65d8('0x0'));var AWS=require(_0x65d8('0x1'));var rp=require('request-promise');var util=require('util');var BPromise=require(_0x65d8('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0x65d8('0x3'))(_0x65d8('0x4'));function getTranscriptionJob(_0x480244,_0x275f44,_0x5c4bb3,_0x8aeb53){return new Promise(function(_0x50c922,_0x1581a6){var _0x19ab88=new AWS['TranscribeService']({'accessKeyId':_0x275f44,'secretAccessKey':_0x480244,'region':_0x5c4bb3});_0x19ab88[_0x65d8('0x5')]({'TranscriptionJobName':_0x8aeb53},function(_0x2f6a2c,_0x2aa9eb){if(_0x2f6a2c){return _0x1581a6(_0x2f6a2c);}else{return _0x50c922(_0x2aa9eb);}});});}function sentiment(_0x254224,_0x44554f,_0x1a7e2e,_0x31894f,_0x57a45a){return new Promise(function(_0x4acdf2,_0x59cbcc){var _0x36d519=new AWS[(_0x65d8('0x6'))]({'accessKeyId':_0x44554f,'secretAccessKey':_0x254224,'region':_0x1a7e2e});_0x36d519[_0x65d8('0x7')]({'Text':_0x31894f,'LanguageCode':_0x57a45a[_0x65d8('0x8')](0x0,0x2)},function(_0x2545c3,_0x414dcc){if(_0x2545c3){return _0x59cbcc(_0x2545c3);}else{return _0x4acdf2(_0x414dcc);}});});}function checkTranscribeJob(_0xa80464,_0x32c2ee,_0x5430c9){var _0x2a7c1c;return new BPromise(function(_0x1b46ff,_0x19b7d8){logger[_0x65d8('0x9')](util['format'](_0x65d8('0xa'),_0xa80464['id'],_0xa80464[_0x65d8('0xb')]));return getTranscriptionJob(_0x5430c9[_0x65d8('0xc')],_0x5430c9[_0x65d8('0xd')],_0x32c2ee[_0x65d8('0xe')],_0xa80464[_0x65d8('0xb')])[_0x65d8('0xf')](function(_0x374e10){logger['info'](util[_0x65d8('0x10')](_0x65d8('0x11'),_0xa80464['id'],_0xa80464[_0x65d8('0xb')],_0x374e10[_0x65d8('0x12')][_0x65d8('0x13')]));if(!_0xa80464['fileText']){switch(_0x374e10[_0x65d8('0x12')][_0x65d8('0x13')]){case _0x65d8('0x14'):var _0x3177ed={'transcribeStatus':_0x374e10[_0x65d8('0x12')][_0x65d8('0x13')],'fileUri':_0x374e10[_0x65d8('0x12')]['Transcript'][_0x65d8('0x15')]};logger['info'](util[_0x65d8('0x10')]('[RECORDING:%d]\x20Get\x20transcript',_0xa80464['id']));return rp({'uri':_0x374e10[_0x65d8('0x12')][_0x65d8('0x16')][_0x65d8('0x15')],'json':!![]})[_0x65d8('0xf')](function(_0x4dbe5e){logger['info'](util[_0x65d8('0x10')](_0x65d8('0x17'),_0xa80464['id']));if(_0x4dbe5e&&_0x4dbe5e[_0x65d8('0x18')]&&_0x4dbe5e[_0x65d8('0x18')]['transcripts']&&_0x4dbe5e['results'][_0x65d8('0x19')][_0x65d8('0x1a')]){_0x3177ed['fileText']='';for(var _0x1befe4=0x0;_0x1befe4<_0x4dbe5e[_0x65d8('0x18')]['transcripts'][_0x65d8('0x1a')];_0x1befe4++){_0x3177ed[_0x65d8('0x1b')]+=_0x4dbe5e[_0x65d8('0x18')][_0x65d8('0x19')][_0x1befe4][_0x65d8('0x1c')]+'';}}return _0xa80464['update'](_0x3177ed);})[_0x65d8('0xf')](function(){logger[_0x65d8('0x9')](util[_0x65d8('0x10')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xa80464['id']));if(!_0xa80464['tempSentiment']){throw new db['Sequelize'][(_0x65d8('0x1d'))](_0x65d8('0x1e'));}if(!_0x32c2ee[_0x65d8('0x1f')]||!_0x32c2ee[_0x65d8('0x20')]||!_0x32c2ee[_0x65d8('0x21')]||!_0x32c2ee['language']||!_0x32c2ee[_0x65d8('0x22')]){throw new db[(_0x65d8('0x23'))][(_0x65d8('0x1d'))](_0x65d8('0x24'));}if(!_0x3177ed[_0x65d8('0x1b')]){throw new Error(_0x65d8('0x25'));}if(_0x32c2ee[_0x65d8('0x20')]===_0x5430c9['id']){return _0x5430c9;}else{return db[_0x65d8('0x26')][_0x65d8('0x27')]({'where':{'id':_settings[_0x65d8('0x20')]}});}})['then'](function(_0x2da083){if(!_0x2da083){throw new db[(_0x65d8('0x23'))][(_0x65d8('0x1d'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x2da083[_0x65d8('0xc')]||!_0x2da083[_0x65d8('0xd')]){throw new db['Sequelize'][(_0x65d8('0x1d'))](_0x65d8('0x28'));}_0x2a7c1c=_0x2da083;logger[_0x65d8('0x9')](util[_0x65d8('0x10')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0xa80464['id']));return sentiment(_0x2a7c1c['data1'],_0x2a7c1c['data2'],_0x32c2ee[_0x65d8('0x21')],_0x3177ed[_0x65d8('0x1b')],_0x32c2ee['language']);})[_0x65d8('0xf')](function(_0x2ba8da){logger[_0x65d8('0x9')](util['format'](_0x65d8('0x29'),_0xa80464['id']));return _0xa80464[_0x65d8('0x2a')]({'sentiment':_0x2ba8da[_0x65d8('0x2b')],'sPositive':_0x2ba8da[_0x65d8('0x2c')][_0x65d8('0x2d')],'sNegative':_0x2ba8da['SentimentScore'][_0x65d8('0x2e')],'sMixed':_0x2ba8da[_0x65d8('0x2c')]['Mixed'],'sNeutral':_0x2ba8da[_0x65d8('0x2c')][_0x65d8('0x2f')]});})[_0x65d8('0xf')](function(){logger['info'](util[_0x65d8('0x10')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xa80464['id']));_0x1b46ff();});case'FAILED':return _0xa80464[_0x65d8('0x2a')]({'transcribeStatus':_0x65d8('0x30'),'failureReason':_0x374e10[_0x65d8('0x12')]['FailureReason']})[_0x65d8('0xf')](function(){logger[_0x65d8('0x9')](util[_0x65d8('0x10')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xa80464['id']));_0x1b46ff();});default:logger['info'](util['format']('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0xa80464['id']));break;}}else{return BPromise[_0x65d8('0x31')]()['then'](function(){if(!_0xa80464['tempSentiment']){throw new db[(_0x65d8('0x23'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x32c2ee[_0x65d8('0x1f')]||!_0x32c2ee[_0x65d8('0x20')]||!_0x32c2ee[_0x65d8('0x21')]||!_0x32c2ee[_0x65d8('0x32')]||!_0x32c2ee[_0x65d8('0x22')]){throw new db[(_0x65d8('0x23'))][(_0x65d8('0x1d'))](_0x65d8('0x24'));}if(!_0xa80464[_0x65d8('0x1b')]){throw new Error('Transcript\x20not\x20available');}if(_0x32c2ee['sentimentAccountId']===_0x5430c9['id']){return _0x5430c9;}else{return db['CloudProvider'][_0x65d8('0x27')]({'where':{'id':_settings[_0x65d8('0x20')]}});}})[_0x65d8('0xf')](function(_0x247914){if(!_0x247914){throw new db[(_0x65d8('0x23'))][(_0x65d8('0x1d'))](_0x65d8('0x33'));}if(!_0x247914[_0x65d8('0xc')]||!_0x247914[_0x65d8('0xd')]){throw new db['Sequelize'][(_0x65d8('0x1d'))]('Cloud\x20Provider\x20not\x20configured');}_0x2a7c1c=_0x247914;logger['info'](util[_0x65d8('0x10')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0xa80464['id']));return sentiment(_0x2a7c1c[_0x65d8('0xc')],_0x2a7c1c[_0x65d8('0xd')],_0x32c2ee[_0x65d8('0x21')],_0xa80464[_0x65d8('0x1b')],_0x32c2ee[_0x65d8('0x32')]);})[_0x65d8('0xf')](function(_0x476284){logger['info'](util[_0x65d8('0x10')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0xa80464['id']));return _0xa80464[_0x65d8('0x2a')]({'sentiment':_0x476284[_0x65d8('0x2b')],'sPositive':_0x476284['SentimentScore'][_0x65d8('0x2d')],'sNegative':_0x476284[_0x65d8('0x2c')]['Negative'],'sMixed':_0x476284[_0x65d8('0x2c')][_0x65d8('0x34')],'sNeutral':_0x476284[_0x65d8('0x2c')][_0x65d8('0x2f')],'transcribeStatus':_0x65d8('0x14')});})[_0x65d8('0xf')](function(){logger[_0x65d8('0x9')](util['format'](_0x65d8('0x35'),_0xa80464['id']));_0x1b46ff();});}})[_0x65d8('0x36')](function(_0xffeff7){if(_0xffeff7){if(!_0xffeff7[_0x65d8('0x37')]||_0xffeff7['name']!==_0x65d8('0x38')){logger[_0x65d8('0x39')](util[_0x65d8('0x10')](_0x65d8('0x3a'),_0xa80464['id']),util['inspect'](_0xffeff7,{'showHidden':![],'depth':null}));}}_0x1b46ff();});});}function checkTranscribe(){var _0xc39253;var _0x2370bb;var _0x451cd3;return db[_0x65d8('0x3b')][_0x65d8('0x3c')]({'where':{'transcribeStatus':_0x65d8('0x3d')}})[_0x65d8('0xf')](function(_0x26ea31){if(!_0x26ea31||!_0x26ea31[_0x65d8('0x1a')]){throw new db['Sequelize'][(_0x65d8('0x1d'))](_0x65d8('0x3e'));}_0xc39253=_0x26ea31;return db['Setting'][_0x65d8('0x27')]({'where':{'id':0x1}});})['then'](function(_0x162d86){if(!_0x162d86){throw new db[(_0x65d8('0x23'))]['ValidationError'](_0x65d8('0x3f'));}_0x2370bb=_0x162d86;if(!_0x2370bb['transcribe']||!_0x2370bb[_0x65d8('0x40')]||!_0x2370bb[_0x65d8('0xe')]||!_0x2370bb[_0x65d8('0x32')]||!_0x2370bb[_0x65d8('0x22')]){throw new db[(_0x65d8('0x23'))][(_0x65d8('0x1d'))](_0x65d8('0x41'));}return db[_0x65d8('0x26')][_0x65d8('0x27')]({'where':{'id':_0x2370bb[_0x65d8('0x40')]}});})[_0x65d8('0xf')](function(_0x3f5f27){if(!_0x3f5f27){throw new db[(_0x65d8('0x23'))][(_0x65d8('0x1d'))](_0x65d8('0x33'));}if(!_0x3f5f27[_0x65d8('0xc')]||!_0x3f5f27[_0x65d8('0xd')]){throw new db['Sequelize']['ValidationError'](_0x65d8('0x28'));}_0x451cd3=_0x3f5f27;var _0x5c2472=[];_0xc39253[_0x65d8('0x42')](function(_0x3d9c30){_0x5c2472[_0x65d8('0x43')](checkTranscribeJob(_0x3d9c30,_0x2370bb,_0x451cd3));});return BPromise['all'](_0x5c2472);})['catch'](function(_0x7c21cf){if(_0x7c21cf){if(!_0x7c21cf[_0x65d8('0x37')]||_0x7c21cf[_0x65d8('0x37')]!==_0x65d8('0x38')){logger[_0x65d8('0x39')](util['inspect'](_0x7c21cf,{'showHidden':![],'depth':null}));}}});}exports[_0x65d8('0x44')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
index 568e408..c9a1f0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb6e=['[WHATSAPP]\x20Interactions\x20to\x20close:','join','WhatsappInteraction','update','system','timeout','format','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','localhost','socket.io-emitter','findAll','subtract','length','map','info'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xfb6e,0x177));var _0xefb6=function(_0x3d3817,_0x5d0b91){_0x3d3817=_0x3d3817-0x0;var _0x4f23ce=_0xfb6e[_0x3d3817];return _0x4f23ce;};'use strict';var _=require('lodash');var moment=require(_0xefb6('0x0'));var Redis=require(_0xefb6('0x1'));var util=require(_0xefb6('0x2'));var config=require(_0xefb6('0x3'));var db=require(_0xefb6('0x4'))['db'];var logger=require(_0xefb6('0x5'))(_0xefb6('0x6'));config[_0xefb6('0x7')]=_['defaults'](config[_0xefb6('0x7')],{'host':_0xefb6('0x8'),'port':0x18eb});var io=require(_0xefb6('0x9'))(new Redis(config[_0xefb6('0x7')]));function closeInteractions(){var _0x4c5ea6=[];return db['WhatsappInteraction'][_0xefb6('0xa')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xefb6('0xb')](0x18,'hours')}}})['then'](function(_0x21138b){if(_0x21138b&&_0x21138b[_0xefb6('0xc')]){_0x4c5ea6=_[_0xefb6('0xd')](_0x21138b||[],'id');logger[_0xefb6('0xe')](_0xefb6('0xf'),_0x4c5ea6[_0xefb6('0x10')]());return db[_0xefb6('0x11')][_0xefb6('0x12')]({'closeReason':_0xefb6('0x13'),'disposition':_0xefb6('0x14'),'closed':!![],'closedAt':moment()[_0xefb6('0x15')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x4c5ea6}});}})[_0xefb6('0x16')](function(){if(_0x4c5ea6&&_0x4c5ea6[_0xefb6('0xc')]){logger['info'](_0xefb6('0x17'),_0x4c5ea6['join']());for(var _0x551e6b=0x0;_0x551e6b<_0x4c5ea6[_0xefb6('0xc')];_0x551e6b++){io['emit'](_0xefb6('0x18'),{'id':_0x4c5ea6[_0x551e6b],'closed':!![]});}}})[_0xefb6('0x19')](function(_0x33e482){logger[_0xefb6('0x1a')](_0xefb6('0x1b'),_0x33e482?util[_0xefb6('0x1c')](_0x33e482,{'showHidden':![],'depth':null}):'');});}exports[_0xefb6('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x5001=['moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','localhost','socket.io-emitter','findAll','lastMsgAt','hours','length','[WHATSAPP]\x20Interactions\x20to\x20close:','WhatsappInteraction','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','then','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','emit','whatsappInteraction:update'];(function(_0x4130e8,_0x300f22){var _0x2c3426=function(_0x15e730){while(--_0x15e730){_0x4130e8['push'](_0x4130e8['shift']());}};_0x2c3426(++_0x300f22);}(_0x5001,0xd0));var _0x1500=function(_0x159b19,_0x34a5a2){_0x159b19=_0x159b19-0x0;var _0x1184d8=_0x5001[_0x159b19];return _0x1184d8;};'use strict';var _=require('lodash');var moment=require(_0x1500('0x0'));var Redis=require(_0x1500('0x1'));var util=require(_0x1500('0x2'));var config=require(_0x1500('0x3'));var db=require(_0x1500('0x4'))['db'];var logger=require(_0x1500('0x5'))(_0x1500('0x6'));config[_0x1500('0x7')]=_['defaults'](config[_0x1500('0x7')],{'host':_0x1500('0x8'),'port':0x18eb});var io=require(_0x1500('0x9'))(new Redis(config['redis']));function closeInteractions(){var _0x717a83=[];return db['WhatsappInteraction'][_0x1500('0xa')]({'raw':!![],'attributes':['id',_0x1500('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x1500('0xc'))}}})['then'](function(_0x5e258b){if(_0x5e258b&&_0x5e258b[_0x1500('0xd')]){_0x717a83=_['map'](_0x5e258b||[],'id');logger['info'](_0x1500('0xe'),_0x717a83['join']());return db[_0x1500('0xf')][_0x1500('0x10')]({'closeReason':_0x1500('0x11'),'disposition':_0x1500('0x12'),'closed':!![],'closedAt':moment()['format'](_0x1500('0x13'))},{'where':{'id':_0x717a83}});}})[_0x1500('0x14')](function(){if(_0x717a83&&_0x717a83[_0x1500('0xd')]){logger[_0x1500('0x15')](_0x1500('0x16'),_0x717a83[_0x1500('0x17')]());for(var _0xb65e3a=0x0;_0xb65e3a<_0x717a83[_0x1500('0xd')];_0xb65e3a++){io[_0x1500('0x18')](_0x1500('0x19'),{'id':_0x717a83[_0xb65e3a],'closed':!![]});}}})['catch'](function(_0x5ea827){logger['error']('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x5ea827?util['inspect'](_0x5ea827,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index 070624e..ef47533 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4810=['@xcally.com','now','Innocenzo','CmContact','destroy','then','contacts1','CmHopper','bulkCreate','log','finished\x20populating','contacts2','hopper2','catch','util','../mysqldb','push','Biondo','innocenzo.biondo'];(function(_0x5a16c8,_0x491fcc){var _0x39873d=function(_0xc90b4a){while(--_0xc90b4a){_0x5a16c8['push'](_0x5a16c8['shift']());}};_0x39873d(++_0x491fcc);}(_0x4810,0x1b0));var _0x0481=function(_0x3355a6,_0x30078a){_0x3355a6=_0x3355a6-0x0;var _0x599f40=_0x4810[_0x3355a6];return _0x599f40;};'use strict';var util=require(_0x0481('0x0'));var db=require(_0x0481('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x0481('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x0481('0x3')+i,'phone':0xf879fb460+i,'email':_0x0481('0x4')+i+_0x0481('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x0481('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x0481('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x0481('0x6')](),'updatedAt':Date[_0x0481('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x0481('0x2')]({'id':i,'firstName':_0x0481('0x7')+i,'lastName':_0x0481('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x0481('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x0481('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x0481('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}db[_0x0481('0x8')][_0x0481('0x9')]({'where':{}})[_0x0481('0xa')](function(){return db[_0x0481('0x8')]['bulkCreate'](contacts);})['then'](function(){console['log']('finished\x20populating',_0x0481('0xb'));return db[_0x0481('0xc')][_0x0481('0x9')]({'where':{}});})[_0x0481('0xa')](function(){return db['CmHopper'][_0x0481('0xd')](hopper);})[_0x0481('0xa')](function(){console[_0x0481('0xe')](_0x0481('0xf'),'hopper1');return db[_0x0481('0x8')][_0x0481('0xd')](contacts2);})[_0x0481('0xa')](function(){console[_0x0481('0xe')](_0x0481('0xf'),_0x0481('0x10'));return db[_0x0481('0xc')][_0x0481('0xd')](hopper2);})['then'](function(){console[_0x0481('0xe')](_0x0481('0xf'),_0x0481('0x11'));})[_0x0481('0x12')](function(_0x519781){console[_0x0481('0xe')](_0x519781);});
\ No newline at end of file
+var _0x78f0=['CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now'];(function(_0x1c3057,_0x3b6e30){var _0x414e07=function(_0x24ab9d){while(--_0x24ab9d){_0x1c3057['push'](_0x1c3057['shift']());}};_0x414e07(++_0x3b6e30);}(_0x78f0,0x1d8));var _0x078f=function(_0x1e024a,_0x5cccaf){_0x1e024a=_0x1e024a-0x0;var _0x18e59a=_0x78f0[_0x1e024a];return _0x18e59a;};'use strict';var util=require(_0x078f('0x0'));var db=require(_0x078f('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x078f('0x2')]({'id':i,'firstName':_0x078f('0x3')+i,'lastName':_0x078f('0x4')+i,'phone':0xf879fb460+i,'email':_0x078f('0x5')+i+_0x078f('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x078f('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x078f('0x2')]({'id':i,'firstName':_0x078f('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x078f('0x5')+i+_0x078f('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x078f('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x078f('0x7')](),'updatedAt':Date['now']()});}db[_0x078f('0x8')][_0x078f('0x9')]({'where':{}})[_0x078f('0xa')](function(){return db[_0x078f('0x8')][_0x078f('0xb')](contacts);})['then'](function(){console[_0x078f('0xc')](_0x078f('0xd'),_0x078f('0xe'));return db[_0x078f('0xf')][_0x078f('0x9')]({'where':{}});})['then'](function(){return db['CmHopper']['bulkCreate'](hopper);})[_0x078f('0xa')](function(){console['log'](_0x078f('0xd'),_0x078f('0x10'));return db[_0x078f('0x8')][_0x078f('0xb')](contacts2);})[_0x078f('0xa')](function(){console['log'](_0x078f('0xd'),_0x078f('0x11'));return db['CmHopper'][_0x078f('0xb')](hopper2);})[_0x078f('0xa')](function(){console[_0x078f('0xc')]('finished\x20populating',_0x078f('0x12'));})[_0x078f('0x13')](function(_0x3c7f0b){console[_0x078f('0xc')](_0x3c7f0b);});
\ No newline at end of file
index 73a4033..117382c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bdf=['\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push','%s%s','agent','format','%s%s@xcally.com','password','friend','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key'];(function(_0x1e79b9,_0x223ef3){var _0x2c2d29=function(_0x4573aa){while(--_0x4573aa){_0x1e79b9['push'](_0x1e79b9['shift']());}};_0x2c2d29(++_0x223ef3);}(_0x1bdf,0x9a));var _0xf1bd=function(_0x20087d,_0xcb0a44){_0x20087d=_0x20087d-0x0;var _0x2eb59b=_0x1bdf[_0x20087d];return _0x2eb59b;};'use strict';var util=require(_0xf1bd('0x0'));var db=require(_0xf1bd('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xf1bd('0x2')]({'name':util['format'](_0xf1bd('0x3'),_0xf1bd('0x4'),i),'fullname':util[_0xf1bd('0x5')]('%s%s',_0xf1bd('0x4'),i),'email':util['format'](_0xf1bd('0x6'),_0xf1bd('0x4'),i),'role':_0xf1bd('0x4'),'password':_0xf1bd('0x7'),'internal':0xfa0+i,'type':_0xf1bd('0x8'),'transport':['udp','ws',_0xf1bd('0x9')],'disallow':['all'],'allow':[_0xf1bd('0xa')],'defaultuser':util['format']('%s%s',_0xf1bd('0x4'),i),'encryption':_0xf1bd('0xb'),'avpf':'yes','force_avp':_0xf1bd('0xb'),'icesupport':_0xf1bd('0xb'),'dtlsenable':_0xf1bd('0xb'),'dtlsverify':'no','dtlscertfile':_0xf1bd('0xc'),'dtlsprivatekey':_0xf1bd('0xd'),'dtlssetup':'actpass','callerid':util['format'](_0xf1bd('0xe'),util['format']('%s%s',_0xf1bd('0x4'),i),0xfa0+i)});}db[_0xf1bd('0xf')][_0xf1bd('0x10')](users)[_0xf1bd('0x11')](function(){console[_0xf1bd('0x12')](_0xf1bd('0x13'));})[_0xf1bd('0x14')](function(_0x4cccfa){console[_0xf1bd('0x12')](_0x4cccfa);});
\ No newline at end of file
+var _0x1146=['util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','udp','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','actpass','User','bulkCreate','then','log','add\x20user','catch'];(function(_0x8691cd,_0x366928){var _0x4d9826=function(_0x4d6857){while(--_0x4d6857){_0x8691cd['push'](_0x8691cd['shift']());}};_0x4d9826(++_0x366928);}(_0x1146,0xab));var _0x6114=function(_0x3b9393,_0x10de21){_0x3b9393=_0x3b9393-0x0;var _0xfa84e1=_0x1146[_0x3b9393];return _0xfa84e1;};'use strict';var util=require(_0x6114('0x0'));var db=require(_0x6114('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x6114('0x2')]({'name':util[_0x6114('0x3')](_0x6114('0x4'),_0x6114('0x5'),i),'fullname':util[_0x6114('0x3')](_0x6114('0x4'),_0x6114('0x5'),i),'email':util[_0x6114('0x3')](_0x6114('0x6'),_0x6114('0x5'),i),'role':'agent','password':'password','internal':0xfa0+i,'type':'friend','transport':[_0x6114('0x7'),'ws',_0x6114('0x8')],'disallow':['all'],'allow':[_0x6114('0x9')],'defaultuser':util[_0x6114('0x3')](_0x6114('0x4'),_0x6114('0x5'),i),'encryption':_0x6114('0xa'),'avpf':_0x6114('0xa'),'force_avp':_0x6114('0xa'),'icesupport':_0x6114('0xa'),'dtlsenable':_0x6114('0xa'),'dtlsverify':'no','dtlscertfile':_0x6114('0xb'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x6114('0xc'),'callerid':util[_0x6114('0x3')]('\x22%s\x22\x20<%s>',util[_0x6114('0x3')](_0x6114('0x4'),_0x6114('0x5'),i),0xfa0+i)});}db[_0x6114('0xd')][_0x6114('0xe')](users)[_0x6114('0xf')](function(){console[_0x6114('0x10')](_0x6114('0x11'));})[_0x6114('0x12')](function(_0x1a1c9e){console['log'](_0x1a1c9e);});
\ No newline at end of file
index 5ba73e2..dafbb22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ef7=['length','user:%s','handshake','query','find','MailInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','WhatsappInteraction','admin','voice:inbound','hasOwnProperty','include','push','FaxQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','voice:outbound','VoiceQueues','userProfileId','VoiceQueue','MailQueue','getVoiceQueues','getChatQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','voice','mail','telephone:%s','campaign:%s:%s','leave','ChatInteractions','removeChatInteractions','emit','map','MailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','WhatsappInteractions','removeWhatsappInteractions','catch','log','join','default','connection','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','bluebird','../mysqldb','./environment','name','Agents','role','agent','type','UserProfileSection','findOne','then','autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','resourceId','User','telephone','Campaign','where','format','%s:queue:%s'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x3ef7,0xa2));var _0x73ef=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3ef7[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x73ef('0x0'));var util=require('util');var BPromise=require(_0x73ef('0x1'));var db=require(_0x73ef('0x2'))['db'];var config=require(_0x73ef('0x3'));var queryQueues={'attributes':['id',_0x73ef('0x4')],'include':[{'as':_0x73ef('0x5'),'model':db['User'],'attributes':['id',_0x73ef('0x4'),_0x73ef('0x6')],'raw':!![],'where':{'role':_0x73ef('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x73ef('0x4')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x73ef('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x73ef('0x4')],'where':{'role':_0x73ef('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x73ef('0x4'),_0x73ef('0x8')],'where':{'type':'ivr'}};function getAssociatedResources(_0x2b60fd,_0x8ee23,_0x50098a){return db[_0x73ef('0x9')][_0x73ef('0xa')]({'where':{'name':_0x2b60fd,'userProfileId':_0x8ee23},'raw':!![]})[_0x73ef('0xb')](function(_0x3bd4c9){if(_0x3bd4c9){if(_0x3bd4c9[_0x73ef('0xc')]){switch(_0x2b60fd){case'VoiceQueues':case _0x73ef('0xd'):case _0x73ef('0xe'):case _0x73ef('0xf'):case _0x73ef('0x10'):case _0x73ef('0x11'):case _0x73ef('0x12'):return db[_0x50098a][_0x73ef('0x13')](queryQueues);case _0x73ef('0x14'):return db[_0x50098a][_0x73ef('0x13')](queryTelephones);case _0x73ef('0x15'):return db[_0x50098a][_0x73ef('0x13')](queryTrunks);case _0x73ef('0x16'):return db[_0x50098a][_0x73ef('0x13')](queryCampaigns);}}else{return db['UserProfileResource'][_0x73ef('0x13')]({'attributes':['resourceId'],'where':{'sectionId':_0x3bd4c9['id']},'raw':!![]})[_0x73ef('0xb')](function(_0x2faa63){if(_0x2faa63){var _0x3c0c3b={'where':{'id':_['map'](_0x2faa63,_0x73ef('0x17'))},'raw':!![]};switch(_0x50098a){case _0x73ef('0x18'):_0x3c0c3b['where'][_0x73ef('0x6')]=_0x73ef('0x19');break;case _0x73ef('0x1a'):_0x3c0c3b[_0x73ef('0x1b')][_0x73ef('0x8')]='ivr';break;}return db[_0x50098a][_0x73ef('0x13')](_0x3c0c3b);}else{return[];}});}}else{return[];}})['then'](function(_0x8d6fe5){return _0x8d6fe5;});}function joinOrLeaveQueues(_0x4d1a9a,_0x1ba9cb,_0x2168ec,_0x36d02f){_0x4d1a9a[_0x1ba9cb](util[_0x73ef('0x1c')](_0x73ef('0x1d'),_0x2168ec,_0x36d02f[_0x73ef('0x4')]));if(_0x36d02f[_0x73ef('0x5')]){for(var _0x1d5e1f=0x0;_0x1d5e1f<_0x36d02f['Agents'][_0x73ef('0x1e')];_0x1d5e1f+=0x1){_0x4d1a9a[_0x1ba9cb](util[_0x73ef('0x1c')](_0x73ef('0x1f'),_0x36d02f[_0x73ef('0x5')][_0x1d5e1f]['name']));}}}function joinOrLeave(_0xc3ba9d,_0x28406c,_0x40907a){var _0x1519f9;if(_0xc3ba9d[_0x73ef('0x20')][_0x73ef('0x21')]['id']){db[_0x73ef('0x18')][_0x73ef('0x22')]({'attributes':['id',_0x73ef('0x4'),_0x73ef('0x6'),'userProfileId'],'where':{'id':_0xc3ba9d[_0x73ef('0x20')][_0x73ef('0x21')]['id']},'include':[{'model':db['ChatInteraction'],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x73ef('0x23')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x73ef('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x73ef('0x25')],'as':_0x73ef('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x73ef('0x27')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x73ef('0x28')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x73ef('0xb')](function(_0x517e70){if(_0x517e70){_0x1519f9=_0x517e70;_0xc3ba9d[_0x28406c](util[_0x73ef('0x1c')](_0x73ef('0x1f'),_0x517e70[_0x73ef('0x4')]));var _0xa3f75b=[];switch(_0x517e70[_0x73ef('0x6')]){case _0x73ef('0x29'):_0xc3ba9d[_0x28406c](_0x73ef('0x2a'));_0xc3ba9d[_0x28406c]('voice:outbound');if(queryQueues[_0x73ef('0x2b')](_0x73ef('0x2c'))){delete queryQueues[_0x73ef('0x2c')];}_0xa3f75b['push'](db['VoiceQueue'][_0x73ef('0x13')](queryQueues));_0xa3f75b[_0x73ef('0x2d')](db['ChatQueue'][_0x73ef('0x13')](queryQueues));_0xa3f75b['push'](db[_0x73ef('0x2e')][_0x73ef('0x13')](queryQueues));_0xa3f75b[_0x73ef('0x2d')](db['SmsQueue'][_0x73ef('0x13')](queryQueues));_0xa3f75b[_0x73ef('0x2d')](db['MailQueue'][_0x73ef('0x13')](queryQueues));_0xa3f75b[_0x73ef('0x2d')](db[_0x73ef('0x2f')]['findAll'](queryQueues));_0xa3f75b[_0x73ef('0x2d')](db[_0x73ef('0x30')][_0x73ef('0x13')](queryQueues));_0xa3f75b['push'](db[_0x73ef('0x18')][_0x73ef('0x13')](queryTelephones));_0xa3f75b[_0x73ef('0x2d')](db[_0x73ef('0x31')][_0x73ef('0x13')](queryTrunks));_0xa3f75b[_0x73ef('0x2d')](db[_0x73ef('0x1a')][_0x73ef('0x13')](queryCampaigns));_0xa3f75b[_0x73ef('0x2d')](db[_0x73ef('0x18')]['findAll'](queryAgents));break;case _0x73ef('0x32'):_0xc3ba9d[_0x28406c](_0x73ef('0x2a'));_0xc3ba9d[_0x28406c](_0x73ef('0x33'));_0xa3f75b['push'](getAssociatedResources(_0x73ef('0x34'),_0x517e70[_0x73ef('0x35')],_0x73ef('0x36')));_0xa3f75b[_0x73ef('0x2d')](getAssociatedResources(_0x73ef('0xd'),_0x517e70['userProfileId'],'ChatQueue'));_0xa3f75b['push'](getAssociatedResources(_0x73ef('0xe'),_0x517e70[_0x73ef('0x35')],'FaxQueue'));_0xa3f75b[_0x73ef('0x2d')](getAssociatedResources(_0x73ef('0xf'),_0x517e70[_0x73ef('0x35')],'SmsQueue'));_0xa3f75b[_0x73ef('0x2d')](getAssociatedResources(_0x73ef('0x10'),_0x517e70[_0x73ef('0x35')],_0x73ef('0x37')));_0xa3f75b['push'](getAssociatedResources(_0x73ef('0x11'),_0x517e70[_0x73ef('0x35')],_0x73ef('0x2f')));_0xa3f75b[_0x73ef('0x2d')](getAssociatedResources(_0x73ef('0x12'),_0x517e70[_0x73ef('0x35')],_0x73ef('0x30')));_0xa3f75b[_0x73ef('0x2d')](getAssociatedResources(_0x73ef('0x14'),_0x517e70['userProfileId'],'User'));_0xa3f75b[_0x73ef('0x2d')](getAssociatedResources(_0x73ef('0x15'),_0x517e70['userProfileId'],'Trunk'));_0xa3f75b[_0x73ef('0x2d')](getAssociatedResources(_0x73ef('0x16'),_0x517e70['userProfileId'],'Campaign'));_0xa3f75b['push'](db['User'][_0x73ef('0x13')](queryAgents));break;case _0x73ef('0x7'):_0xc3ba9d[_0x28406c](_0x73ef('0x2a'));_0xc3ba9d[_0x28406c](_0x73ef('0x33'));_0xa3f75b[_0x73ef('0x2d')](_0x517e70[_0x73ef('0x38')]({'attributes':['id',_0x73ef('0x4')]}));_0xa3f75b['push'](_0x517e70[_0x73ef('0x39')]({'attributes':['id',_0x73ef('0x4')]}));_0xa3f75b['push'](_0x517e70[_0x73ef('0x3a')]({'attributes':['id','name']}));_0xa3f75b[_0x73ef('0x2d')](_0x517e70['getSmsQueues']({'attributes':['id','name']}));_0xa3f75b[_0x73ef('0x2d')](_0x517e70[_0x73ef('0x3b')]({'attributes':['id','name']}));_0xa3f75b[_0x73ef('0x2d')](_0x517e70[_0x73ef('0x3c')]({'attributes':['id',_0x73ef('0x4')]}));_0xa3f75b['push'](_0x517e70[_0x73ef('0x3d')]({'attributes':['id',_0x73ef('0x4')]}));break;}return BPromise['all'](_0xa3f75b);}})[_0x73ef('0xb')](function(_0x55219d){if(_0x55219d&&_0x55219d[_0x73ef('0x1e')]){for(var _0x3c1334=0x0;_0x3c1334<_0x55219d[_0x73ef('0x1e')];_0x3c1334+=0x1){for(var _0x3006b7=0x0;_0x3006b7<_0x55219d[_0x3c1334][_0x73ef('0x1e')];_0x3006b7+=0x1){switch(_0x3c1334){case 0x0:joinOrLeaveQueues(_0xc3ba9d,_0x28406c,_0x73ef('0x3e'),_0x55219d[_0x3c1334][_0x3006b7]);break;case 0x1:joinOrLeaveQueues(_0xc3ba9d,_0x28406c,'chat',_0x55219d[_0x3c1334][_0x3006b7]);break;case 0x2:joinOrLeaveQueues(_0xc3ba9d,_0x28406c,'fax',_0x55219d[_0x3c1334][_0x3006b7]);break;case 0x3:joinOrLeaveQueues(_0xc3ba9d,_0x28406c,'sms',_0x55219d[_0x3c1334][_0x3006b7]);break;case 0x4:joinOrLeaveQueues(_0xc3ba9d,_0x28406c,_0x73ef('0x3f'),_0x55219d[_0x3c1334][_0x3006b7]);break;case 0x5:joinOrLeaveQueues(_0xc3ba9d,_0x28406c,'openchannel',_0x55219d[_0x3c1334][_0x3006b7]);break;case 0x6:joinOrLeaveQueues(_0xc3ba9d,_0x28406c,'whatsapp',_0x55219d[_0x3c1334][_0x3006b7]);break;case 0x7:if(_0x1519f9[_0x73ef('0x6')]!==_0x73ef('0x7'))_0xc3ba9d[_0x28406c](util[_0x73ef('0x1c')](_0x73ef('0x40'),_0x55219d[_0x3c1334][_0x3006b7]['name']));break;case 0x8:if(_0x1519f9[_0x73ef('0x6')]!==_0x73ef('0x7'))_0xc3ba9d[_0x28406c](util[_0x73ef('0x1c')]('trunk:%s',_0x55219d[_0x3c1334][_0x3006b7][_0x73ef('0x4')]));break;case 0x9:if(_0x1519f9[_0x73ef('0x6')]!==_0x73ef('0x7'))_0xc3ba9d[_0x28406c](util['format'](_0x73ef('0x41'),_0x55219d[_0x3c1334][_0x3006b7][_0x73ef('0x8')],_0x55219d[_0x3c1334][_0x3006b7][_0x73ef('0x4')]));break;case 0xa:_0xc3ba9d[_0x28406c](util['format'](_0x73ef('0x1f'),_0x55219d[_0x3c1334][_0x3006b7][_0x73ef('0x4')]));break;}}}}})['then'](function(){if(_0x28406c===_0x73ef('0x42')){var _0x2ff899=_['map'](_0x1519f9[_0x73ef('0x43')],'id');return _0x1519f9[_0x73ef('0x44')](_0x2ff899)['then'](function(){for(var _0x31a65e=0x0;_0x31a65e<_0x2ff899['length'];_0x31a65e+=0x1){_0x40907a[_0x73ef('0x45')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x2ff899[_0x31a65e]),'UserId':Number(_0x1519f9['id'])});}});}})[_0x73ef('0xb')](function(){if(_0x28406c==='leave'){var _0x261fcc=_[_0x73ef('0x46')](_0x1519f9[_0x73ef('0x47')],'id');return _0x1519f9['removeMailInteractions'](_0x261fcc)[_0x73ef('0xb')](function(){for(var _0x37365e=0x0;_0x37365e<_0x261fcc[_0x73ef('0x1e')];_0x37365e+=0x1){_0x40907a[_0x73ef('0x45')](_0x73ef('0x48'),{'MailInteractionId':Number(_0x261fcc[_0x37365e]),'UserId':Number(_0x1519f9['id'])});}});}})[_0x73ef('0xb')](function(){if(_0x28406c==='leave'){var _0x155abe=_['map'](_0x1519f9[_0x73ef('0x24')],'id');return _0x1519f9[_0x73ef('0x49')](_0x155abe)['then'](function(){for(var _0x533702=0x0;_0x533702<_0x155abe['length'];_0x533702+=0x1){_0x40907a[_0x73ef('0x45')](_0x73ef('0x4a'),{'FaxInteractionId':Number(_0x155abe[_0x533702]),'UserId':Number(_0x1519f9['id'])});}});}})[_0x73ef('0xb')](function(){if(_0x28406c===_0x73ef('0x42')){var _0x38aaa7=_[_0x73ef('0x46')](_0x1519f9[_0x73ef('0x26')],'id');return _0x1519f9[_0x73ef('0x4b')](_0x38aaa7)[_0x73ef('0xb')](function(){for(var _0x3d5968=0x0;_0x3d5968<_0x38aaa7[_0x73ef('0x1e')];_0x3d5968+=0x1){_0x40907a[_0x73ef('0x45')](_0x73ef('0x4c'),{'SmsInteractionId':Number(_0x38aaa7[_0x3d5968]),'UserId':Number(_0x1519f9['id'])});}});}})[_0x73ef('0xb')](function(){if(_0x28406c===_0x73ef('0x42')){var _0x190044=_['map'](_0x1519f9['OpenchannelInteractions'],'id');return _0x1519f9[_0x73ef('0x4d')](_0x190044)[_0x73ef('0xb')](function(){for(var _0x41298e=0x0;_0x41298e<_0x190044['length'];_0x41298e+=0x1){_0x40907a[_0x73ef('0x45')](_0x73ef('0x4e'),{'OpenchannelInteractionId':Number(_0x190044[_0x41298e]),'UserId':Number(_0x1519f9['id'])});}});}})['then'](function(){if(_0x28406c===_0x73ef('0x42')){var _0x5dddd5=_[_0x73ef('0x46')](_0x1519f9[_0x73ef('0x4f')],'id');return _0x1519f9[_0x73ef('0x50')](_0x5dddd5)[_0x73ef('0xb')](function(){for(var _0x92497e=0x0;_0x92497e<_0x5dddd5[_0x73ef('0x1e')];_0x92497e+=0x1){_0x40907a[_0x73ef('0x45')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x5dddd5[_0x92497e]),'UserId':Number(_0x1519f9['id'])});}});}})[_0x73ef('0x51')](function(_0x3c61d3){_0xc3ba9d[_0x73ef('0x52')](_0x3c61d3);});}}function onDisconnect(_0x33dca3,_0x239a56){joinOrLeave(_0x33dca3,_0x73ef('0x42'),_0x239a56);}function onConnect(_0xf5f512){joinOrLeave(_0xf5f512,_0x73ef('0x53'));}exports[_0x73ef('0x54')]=function(_0x237073){_0x237073['on'](_0x73ef('0x55'),function(_0x316743){_0x316743['setMaxListeners'](0x0);_0x316743[_0x73ef('0x56')]=_0x316743[_0x73ef('0x57')][_0x73ef('0x55')][_0x73ef('0x58')]+':'+_0x316743['request']['connection'][_0x73ef('0x59')];_0x316743[_0x73ef('0x5a')]=new Date();_0x316743['log']=function(_0x20c182){console['log'](_0x73ef('0x5b')+_0x316743[_0x73ef('0x5c')][_0x73ef('0x4')]+'['+_0x316743[_0x73ef('0x56')]+']',_0x20c182);};_0x316743['on'](_0x73ef('0x5d'),function(){onDisconnect(_0x316743,_0x237073);_0x316743[_0x73ef('0x52')](_0x73ef('0x5e'));});onConnect(_0x316743);_0x316743['log'](_0x73ef('0x5f'));});};
\ No newline at end of file
+var _0x6455=['ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','userProfileId','SmsQueues','OpenchannelQueues','WhatsappQueue','Campaign','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getWhatsappQueues','all','length','voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','campaign:%s:%s','leave','ChatInteractions','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','catch','log','join','default','connection','setMaxListeners','request','remoteAddress','remotePort','SocketIO\x20','address','disconnect','CONNECTED','lodash','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','telephone','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','MailQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','resourceId','map','where','type','ivr','format','query','find','ChatInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','voice:inbound','voice:outbound','hasOwnProperty','include','push'];(function(_0x608382,_0x102452){var _0x4f7518=function(_0x4eab9d){while(--_0x4eab9d){_0x608382['push'](_0x608382['shift']());}};_0x4f7518(++_0x102452);}(_0x6455,0x97));var _0x5645=function(_0x5973a4,_0x2a5f2e){_0x5973a4=_0x5973a4-0x0;var _0x17631d=_0x6455[_0x5973a4];return _0x17631d;};'use strict';var _=require(_0x5645('0x0'));var util=require('util');var BPromise=require(_0x5645('0x1'));var db=require(_0x5645('0x2'))['db'];var config=require(_0x5645('0x3'));var queryQueues={'attributes':['id',_0x5645('0x4')],'include':[{'as':_0x5645('0x5'),'model':db[_0x5645('0x6')],'attributes':['id','name',_0x5645('0x7')],'raw':!![],'where':{'role':_0x5645('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x5645('0x4')],'where':{'role':_0x5645('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x5645('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x5645('0x4')],'where':{'role':_0x5645('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x5645('0x4'),'type'],'where':{'type':'ivr'}};function getAssociatedResources(_0x20efde,_0x37c03a,_0x38c07a){return db[_0x5645('0xa')][_0x5645('0xb')]({'where':{'name':_0x20efde,'userProfileId':_0x37c03a},'raw':!![]})[_0x5645('0xc')](function(_0x587c61){if(_0x587c61){if(_0x587c61[_0x5645('0xd')]){switch(_0x20efde){case _0x5645('0xe'):case _0x5645('0xf'):case _0x5645('0x10'):case'SmsQueues':case _0x5645('0x11'):case'OpenchannelQueues':case _0x5645('0x12'):return db[_0x38c07a][_0x5645('0x13')](queryQueues);case _0x5645('0x14'):return db[_0x38c07a][_0x5645('0x13')](queryTelephones);case _0x5645('0x15'):return db[_0x38c07a][_0x5645('0x13')](queryTrunks);case _0x5645('0x16'):return db[_0x38c07a][_0x5645('0x13')](queryCampaigns);}}else{return db['UserProfileResource'][_0x5645('0x13')]({'attributes':[_0x5645('0x17')],'where':{'sectionId':_0x587c61['id']},'raw':!![]})[_0x5645('0xc')](function(_0x4cbd46){if(_0x4cbd46){var _0x4b3be6={'where':{'id':_[_0x5645('0x18')](_0x4cbd46,_0x5645('0x17'))},'raw':!![]};switch(_0x38c07a){case'User':_0x4b3be6[_0x5645('0x19')][_0x5645('0x7')]=_0x5645('0x9');break;case'Campaign':_0x4b3be6[_0x5645('0x19')][_0x5645('0x1a')]=_0x5645('0x1b');break;}return db[_0x38c07a][_0x5645('0x13')](_0x4b3be6);}else{return[];}});}}else{return[];}})['then'](function(_0x1853a7){return _0x1853a7;});}function joinOrLeaveQueues(_0x52ac46,_0x557ad2,_0x7c39d7,_0x1e2cba){_0x52ac46[_0x557ad2](util[_0x5645('0x1c')]('%s:queue:%s',_0x7c39d7,_0x1e2cba[_0x5645('0x4')]));if(_0x1e2cba['Agents']){for(var _0x2b8cc8=0x0;_0x2b8cc8<_0x1e2cba['Agents']['length'];_0x2b8cc8+=0x1){_0x52ac46[_0x557ad2](util[_0x5645('0x1c')]('user:%s',_0x1e2cba[_0x5645('0x5')][_0x2b8cc8][_0x5645('0x4')]));}}}function joinOrLeave(_0x502c2e,_0x18680f,_0x116bfc){var _0xe83ed7;if(_0x502c2e['handshake'][_0x5645('0x1d')]['id']){db[_0x5645('0x6')][_0x5645('0x1e')]({'attributes':['id',_0x5645('0x4'),'role','userProfileId'],'where':{'id':_0x502c2e['handshake']['query']['id']},'include':[{'model':db[_0x5645('0x1f')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x5645('0x20'),'attributes':['id'],'raw':!![]},{'model':db[_0x5645('0x21')],'as':_0x5645('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x5645('0x23')],'as':_0x5645('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x5645('0x25')],'as':_0x5645('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x5645('0x27')],'as':_0x5645('0x28'),'attributes':['id'],'raw':!![]}]})[_0x5645('0xc')](function(_0x1c0aa2){if(_0x1c0aa2){_0xe83ed7=_0x1c0aa2;_0x502c2e[_0x18680f](util[_0x5645('0x1c')](_0x5645('0x29'),_0x1c0aa2[_0x5645('0x4')]));var _0x52ba45=[];switch(_0x1c0aa2[_0x5645('0x7')]){case'admin':_0x502c2e[_0x18680f](_0x5645('0x2a'));_0x502c2e[_0x18680f](_0x5645('0x2b'));if(queryQueues[_0x5645('0x2c')](_0x5645('0x2d'))){delete queryQueues[_0x5645('0x2d')];}_0x52ba45[_0x5645('0x2e')](db['VoiceQueue']['findAll'](queryQueues));_0x52ba45[_0x5645('0x2e')](db[_0x5645('0x2f')][_0x5645('0x13')](queryQueues));_0x52ba45[_0x5645('0x2e')](db[_0x5645('0x30')][_0x5645('0x13')](queryQueues));_0x52ba45[_0x5645('0x2e')](db[_0x5645('0x31')][_0x5645('0x13')](queryQueues));_0x52ba45[_0x5645('0x2e')](db[_0x5645('0x32')]['findAll'](queryQueues));_0x52ba45['push'](db[_0x5645('0x33')]['findAll'](queryQueues));_0x52ba45[_0x5645('0x2e')](db['WhatsappQueue'][_0x5645('0x13')](queryQueues));_0x52ba45['push'](db[_0x5645('0x6')][_0x5645('0x13')](queryTelephones));_0x52ba45[_0x5645('0x2e')](db[_0x5645('0x34')][_0x5645('0x13')](queryTrunks));_0x52ba45[_0x5645('0x2e')](db['Campaign'][_0x5645('0x13')](queryCampaigns));_0x52ba45[_0x5645('0x2e')](db[_0x5645('0x6')][_0x5645('0x13')](queryAgents));break;case _0x5645('0x35'):_0x502c2e[_0x18680f](_0x5645('0x2a'));_0x502c2e[_0x18680f](_0x5645('0x2b'));_0x52ba45[_0x5645('0x2e')](getAssociatedResources('VoiceQueues',_0x1c0aa2[_0x5645('0x36')],'VoiceQueue'));_0x52ba45[_0x5645('0x2e')](getAssociatedResources(_0x5645('0xf'),_0x1c0aa2[_0x5645('0x36')],_0x5645('0x2f')));_0x52ba45[_0x5645('0x2e')](getAssociatedResources('FaxQueues',_0x1c0aa2[_0x5645('0x36')],_0x5645('0x30')));_0x52ba45[_0x5645('0x2e')](getAssociatedResources(_0x5645('0x37'),_0x1c0aa2[_0x5645('0x36')],_0x5645('0x31')));_0x52ba45[_0x5645('0x2e')](getAssociatedResources(_0x5645('0x11'),_0x1c0aa2[_0x5645('0x36')],_0x5645('0x32')));_0x52ba45[_0x5645('0x2e')](getAssociatedResources(_0x5645('0x38'),_0x1c0aa2[_0x5645('0x36')],_0x5645('0x33')));_0x52ba45[_0x5645('0x2e')](getAssociatedResources(_0x5645('0x12'),_0x1c0aa2['userProfileId'],_0x5645('0x39')));_0x52ba45[_0x5645('0x2e')](getAssociatedResources('Telephones',_0x1c0aa2[_0x5645('0x36')],_0x5645('0x6')));_0x52ba45['push'](getAssociatedResources(_0x5645('0x15'),_0x1c0aa2[_0x5645('0x36')],_0x5645('0x34')));_0x52ba45[_0x5645('0x2e')](getAssociatedResources(_0x5645('0x16'),_0x1c0aa2[_0x5645('0x36')],_0x5645('0x3a')));_0x52ba45['push'](db['User'][_0x5645('0x13')](queryAgents));break;case _0x5645('0x8'):_0x502c2e[_0x18680f](_0x5645('0x2a'));_0x502c2e[_0x18680f](_0x5645('0x2b'));_0x52ba45[_0x5645('0x2e')](_0x1c0aa2[_0x5645('0x3b')]({'attributes':['id',_0x5645('0x4')]}));_0x52ba45[_0x5645('0x2e')](_0x1c0aa2[_0x5645('0x3c')]({'attributes':['id',_0x5645('0x4')]}));_0x52ba45[_0x5645('0x2e')](_0x1c0aa2[_0x5645('0x3d')]({'attributes':['id',_0x5645('0x4')]}));_0x52ba45[_0x5645('0x2e')](_0x1c0aa2[_0x5645('0x3e')]({'attributes':['id',_0x5645('0x4')]}));_0x52ba45[_0x5645('0x2e')](_0x1c0aa2['getMailQueues']({'attributes':['id','name']}));_0x52ba45['push'](_0x1c0aa2['getOpenchannelQueues']({'attributes':['id',_0x5645('0x4')]}));_0x52ba45[_0x5645('0x2e')](_0x1c0aa2[_0x5645('0x3f')]({'attributes':['id',_0x5645('0x4')]}));break;}return BPromise[_0x5645('0x40')](_0x52ba45);}})['then'](function(_0x43eaa9){if(_0x43eaa9&&_0x43eaa9[_0x5645('0x41')]){for(var _0x41b607=0x0;_0x41b607<_0x43eaa9[_0x5645('0x41')];_0x41b607+=0x1){for(var _0x30a685=0x0;_0x30a685<_0x43eaa9[_0x41b607]['length'];_0x30a685+=0x1){switch(_0x41b607){case 0x0:joinOrLeaveQueues(_0x502c2e,_0x18680f,_0x5645('0x42'),_0x43eaa9[_0x41b607][_0x30a685]);break;case 0x1:joinOrLeaveQueues(_0x502c2e,_0x18680f,_0x5645('0x43'),_0x43eaa9[_0x41b607][_0x30a685]);break;case 0x2:joinOrLeaveQueues(_0x502c2e,_0x18680f,_0x5645('0x44'),_0x43eaa9[_0x41b607][_0x30a685]);break;case 0x3:joinOrLeaveQueues(_0x502c2e,_0x18680f,_0x5645('0x45'),_0x43eaa9[_0x41b607][_0x30a685]);break;case 0x4:joinOrLeaveQueues(_0x502c2e,_0x18680f,_0x5645('0x46'),_0x43eaa9[_0x41b607][_0x30a685]);break;case 0x5:joinOrLeaveQueues(_0x502c2e,_0x18680f,_0x5645('0x47'),_0x43eaa9[_0x41b607][_0x30a685]);break;case 0x6:joinOrLeaveQueues(_0x502c2e,_0x18680f,_0x5645('0x48'),_0x43eaa9[_0x41b607][_0x30a685]);break;case 0x7:if(_0xe83ed7[_0x5645('0x7')]!=='agent')_0x502c2e[_0x18680f](util['format'](_0x5645('0x49'),_0x43eaa9[_0x41b607][_0x30a685][_0x5645('0x4')]));break;case 0x8:if(_0xe83ed7['role']!=='agent')_0x502c2e[_0x18680f](util[_0x5645('0x1c')]('trunk:%s',_0x43eaa9[_0x41b607][_0x30a685][_0x5645('0x4')]));break;case 0x9:if(_0xe83ed7[_0x5645('0x7')]!==_0x5645('0x8'))_0x502c2e[_0x18680f](util[_0x5645('0x1c')](_0x5645('0x4a'),_0x43eaa9[_0x41b607][_0x30a685]['type'],_0x43eaa9[_0x41b607][_0x30a685][_0x5645('0x4')]));break;case 0xa:_0x502c2e[_0x18680f](util['format']('user:%s',_0x43eaa9[_0x41b607][_0x30a685][_0x5645('0x4')]));break;}}}}})[_0x5645('0xc')](function(){if(_0x18680f===_0x5645('0x4b')){var _0x46637f=_[_0x5645('0x18')](_0xe83ed7[_0x5645('0x4c')],'id');return _0xe83ed7[_0x5645('0x4d')](_0x46637f)[_0x5645('0xc')](function(){for(var _0x13bee1=0x0;_0x13bee1<_0x46637f[_0x5645('0x41')];_0x13bee1+=0x1){_0x116bfc[_0x5645('0x4e')](_0x5645('0x4f'),{'ChatInteractionId':Number(_0x46637f[_0x13bee1]),'UserId':Number(_0xe83ed7['id'])});}});}})['then'](function(){if(_0x18680f==='leave'){var _0x30932d=_[_0x5645('0x18')](_0xe83ed7[_0x5645('0x20')],'id');return _0xe83ed7[_0x5645('0x50')](_0x30932d)[_0x5645('0xc')](function(){for(var _0x4cfe24=0x0;_0x4cfe24<_0x30932d[_0x5645('0x41')];_0x4cfe24+=0x1){_0x116bfc[_0x5645('0x4e')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x30932d[_0x4cfe24]),'UserId':Number(_0xe83ed7['id'])});}});}})[_0x5645('0xc')](function(){if(_0x18680f===_0x5645('0x4b')){var _0x2eea4c=_[_0x5645('0x18')](_0xe83ed7[_0x5645('0x22')],'id');return _0xe83ed7['removeFaxInteractions'](_0x2eea4c)[_0x5645('0xc')](function(){for(var _0xd1f0b=0x0;_0xd1f0b<_0x2eea4c[_0x5645('0x41')];_0xd1f0b+=0x1){_0x116bfc[_0x5645('0x4e')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x2eea4c[_0xd1f0b]),'UserId':Number(_0xe83ed7['id'])});}});}})[_0x5645('0xc')](function(){if(_0x18680f===_0x5645('0x4b')){var _0xd971f5=_[_0x5645('0x18')](_0xe83ed7[_0x5645('0x24')],'id');return _0xe83ed7[_0x5645('0x51')](_0xd971f5)[_0x5645('0xc')](function(){for(var _0x3b4f94=0x0;_0x3b4f94<_0xd971f5[_0x5645('0x41')];_0x3b4f94+=0x1){_0x116bfc['emit'](_0x5645('0x52'),{'SmsInteractionId':Number(_0xd971f5[_0x3b4f94]),'UserId':Number(_0xe83ed7['id'])});}});}})[_0x5645('0xc')](function(){if(_0x18680f==='leave'){var _0x5d90a6=_[_0x5645('0x18')](_0xe83ed7['OpenchannelInteractions'],'id');return _0xe83ed7[_0x5645('0x53')](_0x5d90a6)[_0x5645('0xc')](function(){for(var _0x26431d=0x0;_0x26431d<_0x5d90a6[_0x5645('0x41')];_0x26431d+=0x1){_0x116bfc[_0x5645('0x4e')](_0x5645('0x54'),{'OpenchannelInteractionId':Number(_0x5d90a6[_0x26431d]),'UserId':Number(_0xe83ed7['id'])});}});}})[_0x5645('0xc')](function(){if(_0x18680f==='leave'){var _0x2a7a9a=_[_0x5645('0x18')](_0xe83ed7[_0x5645('0x28')],'id');return _0xe83ed7[_0x5645('0x55')](_0x2a7a9a)[_0x5645('0xc')](function(){for(var _0x302248=0x0;_0x302248<_0x2a7a9a[_0x5645('0x41')];_0x302248+=0x1){_0x116bfc[_0x5645('0x4e')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x2a7a9a[_0x302248]),'UserId':Number(_0xe83ed7['id'])});}});}})[_0x5645('0x56')](function(_0x7e719a){_0x502c2e[_0x5645('0x57')](_0x7e719a);});}}function onDisconnect(_0x2e3899,_0x5e7f9e){joinOrLeave(_0x2e3899,_0x5645('0x4b'),_0x5e7f9e);}function onConnect(_0x31661a){joinOrLeave(_0x31661a,_0x5645('0x58'));}exports[_0x5645('0x59')]=function(_0x4545f8){_0x4545f8['on'](_0x5645('0x5a'),function(_0x83ec55){_0x83ec55[_0x5645('0x5b')](0x0);_0x83ec55['address']=_0x83ec55[_0x5645('0x5c')][_0x5645('0x5a')][_0x5645('0x5d')]+':'+_0x83ec55[_0x5645('0x5c')][_0x5645('0x5a')][_0x5645('0x5e')];_0x83ec55['connectedAt']=new Date();_0x83ec55[_0x5645('0x57')]=function(_0xd12828){console[_0x5645('0x57')](_0x5645('0x5f')+_0x83ec55['nsp']['name']+'['+_0x83ec55[_0x5645('0x60')]+']',_0xd12828);};_0x83ec55['on'](_0x5645('0x61'),function(){onDisconnect(_0x83ec55,_0x4545f8);_0x83ec55[_0x5645('0x57')]('DISCONNECTED');});onConnect(_0x83ec55);_0x83ec55[_0x5645('0x57')](_0x5645('0x62'));});};
\ No newline at end of file
index abe9da3..0b0dc9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb3e=['format','SIP/%s','agent','incomingmessage','closed','changed','substatus','ContactId','User','default','length','model','hook','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','triggers','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','OpenchannelInteraction','Openchannel','OpenchannelMessage','request','EventManager','info','Trigger,\x20%s','error','code','catch','get','channel','motionChannel','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','QueryTypes','SELECT','then','contact','UserId','find','name','fullname','email','interface'];(function(_0x31894f,_0x5cb20c){var _0x1e7d70=function(_0x3bb060){while(--_0x3bb060){_0x31894f['push'](_0x31894f['shift']());}};_0x1e7d70(++_0x5cb20c);}(_0xdb3e,0x94));var _0xedb3=function(_0x3bf731,_0x4b866d){_0x3bf731=_0x3bf731-0x0;var _0x687e93=_0xdb3e[_0x3bf731];return _0x687e93;};'use strict';var util=require(_0xedb3('0x0'));var db=require(_0xedb3('0x1'))['db'];var jayson=require(_0xedb3('0x2'));var logger=require(_0xedb3('0x3'))(_0xedb3('0x4'));var _=require('lodash');var client=jayson['client']['http']({'port':0x232a});var triggers=[{'channel':_0xedb3('0x5'),'model':_0xedb3('0x6'),'event':_0xedb3('0x7'),'condition':_0xedb3('0x8'),'callback':afterCreate},{'channel':'Chat','model':'ChatInteraction','event':_0xedb3('0x9'),'condition':_0xedb3('0xa'),'callback':afterUpdate},{'channel':_0xedb3('0x5'),'model':_0xedb3('0xb'),'event':'afterCreate','condition':_0xedb3('0xc'),'callback':afterCreateMessage},{'channel':'Sms','model':'SmsInteraction','event':_0xedb3('0x7'),'condition':_0xedb3('0x8'),'callback':afterCreate},{'channel':_0xedb3('0xd'),'model':_0xedb3('0xe'),'event':'afterUpdate','condition':_0xedb3('0xa'),'callback':afterUpdate},{'channel':_0xedb3('0xd'),'model':'SmsMessage','event':_0xedb3('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xedb3('0xf'),'model':_0xedb3('0x10'),'event':_0xedb3('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':'Whatsapp','model':_0xedb3('0x10'),'event':_0xedb3('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Whatsapp','model':_0xedb3('0x11'),'event':_0xedb3('0x7'),'condition':_0xedb3('0xc'),'callback':afterCreateMessage},{'channel':_0xedb3('0x12'),'model':_0xedb3('0x13'),'event':_0xedb3('0x7'),'condition':_0xedb3('0x8'),'callback':afterCreate},{'channel':'Fax','model':_0xedb3('0x13'),'event':_0xedb3('0x9'),'condition':_0xedb3('0xa'),'callback':afterUpdate},{'channel':'Fax','model':_0xedb3('0x14'),'event':'afterCreate','condition':_0xedb3('0xc'),'callback':afterCreateMessage},{'channel':_0xedb3('0x15'),'model':_0xedb3('0x16'),'event':_0xedb3('0x7'),'condition':_0xedb3('0x8'),'callback':afterCreate},{'channel':_0xedb3('0x15'),'model':_0xedb3('0x16'),'event':_0xedb3('0x9'),'condition':_0xedb3('0xa'),'callback':afterUpdate},{'channel':_0xedb3('0x15'),'model':'MailMessage','event':_0xedb3('0x7'),'condition':_0xedb3('0xc'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0xedb3('0x17'),'event':_0xedb3('0x7'),'condition':_0xedb3('0x8'),'callback':afterCreate},{'channel':_0xedb3('0x18'),'model':_0xedb3('0x17'),'event':'afterUpdate','condition':_0xedb3('0xa'),'callback':afterUpdate},{'channel':'Openchannel','model':_0xedb3('0x19'),'event':'afterCreate','condition':_0xedb3('0xc'),'callback':afterCreateMessage}];function request(_0x4cca4f){return client[_0xedb3('0x1a')](_0xedb3('0x1b'),_0x4cca4f)['then'](function(_0x145d6a){logger[_0xedb3('0x1c')](_0xedb3('0x1d'),_0xedb3('0x1b'),_0x145d6a);if(_0x145d6a[_0xedb3('0x1e')]){if(_0x145d6a[_0xedb3('0x1e')][_0xedb3('0x1f')]===0x1f4){logger[_0xedb3('0x1e')](_0xedb3('0x1d'),_0xedb3('0x1b'),_0x145d6a[_0xedb3('0x1e')]);}}})[_0xedb3('0x20')](function(_0xc34dad){logger[_0xedb3('0x1e')]('Trigger,\x20%s',_0xedb3('0x1b'),_0xc34dad);});}function afterCreateMessage(_0x36c508,_0x2651fd){return function(_0x154876,_0x796bee){_0x154876=_0x154876[_0xedb3('0x21')]({'plain':!![]});_0x154876[_0xedb3('0x22')]=_0x36c508;_0x154876[_0xedb3('0x23')]=_0x36c508;_0x154876['event']=_0x154876['direction'];var _0x26f9c1=_0xedb3('0x24')+_0x154876['ContactId'];return db[_0xedb3('0x25')][_0xedb3('0x26')](_0x26f9c1,{'type':db[_0xedb3('0x27')][_0xedb3('0x28')][_0xedb3('0x29')],'raw':!![]})[_0xedb3('0x2a')](function(_0x338ef2){return _0x338ef2;})[_0xedb3('0x2a')](function(_0x8fa0fd){if(_0x8fa0fd){_0x154876[_0xedb3('0x2b')]=_0x8fa0fd[0x0];}if(_0x154876[_0xedb3('0x2c')]){return db['User'][_0xedb3('0x2d')]({'where':{'id':_0x154876[_0xedb3('0x2c')]},'attributes':['id',_0xedb3('0x2e'),_0xedb3('0x2f'),_0xedb3('0x30'),'internal'],'raw':!![]})[_0xedb3('0x2a')](function(_0x5da122){_0x154876[_0xedb3('0x31')]=util[_0xedb3('0x32')](_0xedb3('0x33'),_0x5da122[_0xedb3('0x2e')]);_0x154876[_0xedb3('0x22')]=_0x36c508;_0x154876[_0xedb3('0x34')]=_0x5da122;return request({'event':_0xedb3('0x35'),'message':_0x154876});})[_0xedb3('0x20')](function(_0x1d44c4){console['error'](_0x1d44c4);});}else{return request({'event':'outgoingmessage','message':_0x154876});}});};}function afterCreate(_0x4146b9,_0x2a9709){return function(_0x1fcd63,_0x26c1d5){_0x1fcd63=_0x1fcd63[_0xedb3('0x21')]({'plain':!![]});_0x1fcd63['channel']=_0x4146b9;_0x1fcd63[_0xedb3('0x23')]=_0x4146b9;_0x1fcd63['event']='opened';var _0x38c256='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1fcd63['ContactId'];return db[_0xedb3('0x25')]['query'](_0x38c256,{'type':db[_0xedb3('0x27')][_0xedb3('0x28')][_0xedb3('0x29')],'raw':!![]})[_0xedb3('0x2a')](function(_0x2af7b7){return _0x2af7b7;})[_0xedb3('0x2a')](function(_0x51ba5b){if(_0x51ba5b){_0x1fcd63['contact']=_0x51ba5b[0x0];}return request({'event':_0x2a9709,'message':_0x1fcd63});});};}function afterUpdate(_0x341436){return function(_0x22fba4){var _0x54de94=_0x22fba4['changed'](_0xedb3('0x36'))&&_0x22fba4[_0xedb3('0x36')];var _0x15d480=_0x22fba4[_0xedb3('0x37')](_0xedb3('0x38'));if(_0x54de94||_0x15d480){var _0x1753da=_0x54de94?_0xedb3('0xa'):_0xedb3('0x38');var _0xddde4f=_0x22fba4[_0xedb3('0x21')]({'plain':!![]});_0xddde4f[_0xedb3('0x22')]=_0x341436;_0xddde4f[_0xedb3('0x23')]=_0x341436;_0xddde4f['event']=_0x54de94?_0xedb3('0x36'):_0xedb3('0x38');var _0x28359e=_0xedb3('0x24')+_0xddde4f[_0xedb3('0x39')];return db[_0xedb3('0x25')][_0xedb3('0x26')](_0x28359e,{'type':db[_0xedb3('0x27')][_0xedb3('0x28')][_0xedb3('0x29')],'raw':!![]})['then'](function(_0x5a14fd){if(_0x5a14fd){_0xddde4f['contact']=_0x5a14fd[0x0];}if(_0xddde4f[_0xedb3('0x2c')]){return db[_0xedb3('0x3a')][_0xedb3('0x2d')]({'where':{'id':_0xddde4f['UserId']},'attributes':['id',_0xedb3('0x2e'),_0xedb3('0x2f'),'email','internal'],'raw':!![]})[_0xedb3('0x2a')](function(_0x95625a){_0xddde4f[_0xedb3('0x31')]=util[_0xedb3('0x32')](_0xedb3('0x33'),_0x95625a[_0xedb3('0x2e')]);_0xddde4f['agent']=_0x95625a;return request({'event':_0x1753da,'message':_0xddde4f});})['catch'](function(_0x2f60bc){console[_0xedb3('0x1e')](_0x2f60bc);});}else{return request({'event':_0x1753da,'message':_0xddde4f});}});}};}exports[_0xedb3('0x3b')]=function(){for(var _0x3fdec5=0x0;_0x3fdec5<triggers[_0xedb3('0x3c')];_0x3fdec5+=0x1){if(db['hasOwnProperty'](triggers[_0x3fdec5][_0xedb3('0x3d')])){db[triggers[_0x3fdec5][_0xedb3('0x3d')]][_0xedb3('0x3e')](triggers[_0x3fdec5]['event'],triggers[_0x3fdec5][_0xedb3('0x3f')](triggers[_0x3fdec5]['channel'][_0xedb3('0x40')](),triggers[_0x3fdec5][_0xedb3('0x41')]));}}};
\ No newline at end of file
+var _0x5454=['triggers','lodash','client','http','ChatInteraction','afterCreate','newinteraction','Chat','ChatMessage','Sms','SmsInteraction','closedinteraction','SmsMessage','WhatsappInteraction','Whatsapp','afterUpdate','WhatsappMessage','newmessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelMessage','request','EventManager','then','Trigger,\x20%s','error','code','catch','get','channel','event','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','query','Sequelize','SELECT','UserId','User','find','name','fullname','internal','interface','SIP/%s','incomingmessage','outgoingmessage','motionChannel','ContactId','QueryTypes','changed','closed','substatus','sequelize','contact','email','format','agent','default','length','hasOwnProperty','model','callback','toLowerCase','condition','../../mysqldb','../logger'];(function(_0x3aa753,_0x3eac5f){var _0x5068bc=function(_0x294a35){while(--_0x294a35){_0x3aa753['push'](_0x3aa753['shift']());}};_0x5068bc(++_0x3eac5f);}(_0x5454,0x15c));var _0x4545=function(_0x579e90,_0x440eb1){_0x579e90=_0x579e90-0x0;var _0x1e7820=_0x5454[_0x579e90];return _0x1e7820;};'use strict';var util=require('util');var db=require(_0x4545('0x0'))['db'];var jayson=require('jayson/promise');var logger=require(_0x4545('0x1'))(_0x4545('0x2'));var _=require(_0x4545('0x3'));var client=jayson[_0x4545('0x4')][_0x4545('0x5')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0x4545('0x6'),'event':_0x4545('0x7'),'condition':_0x4545('0x8'),'callback':afterCreate},{'channel':_0x4545('0x9'),'model':'ChatInteraction','event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x4545('0x9'),'model':_0x4545('0xa'),'event':_0x4545('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x4545('0xb'),'model':_0x4545('0xc'),'event':_0x4545('0x7'),'condition':_0x4545('0x8'),'callback':afterCreate},{'channel':_0x4545('0xb'),'model':_0x4545('0xc'),'event':'afterUpdate','condition':_0x4545('0xd'),'callback':afterUpdate},{'channel':_0x4545('0xb'),'model':_0x4545('0xe'),'event':_0x4545('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Whatsapp','model':_0x4545('0xf'),'event':_0x4545('0x7'),'condition':_0x4545('0x8'),'callback':afterCreate},{'channel':_0x4545('0x10'),'model':'WhatsappInteraction','event':_0x4545('0x11'),'condition':_0x4545('0xd'),'callback':afterUpdate},{'channel':'Whatsapp','model':_0x4545('0x12'),'event':_0x4545('0x7'),'condition':_0x4545('0x13'),'callback':afterCreateMessage},{'channel':_0x4545('0x14'),'model':_0x4545('0x15'),'event':'afterCreate','condition':_0x4545('0x8'),'callback':afterCreate},{'channel':'Fax','model':_0x4545('0x15'),'event':'afterUpdate','condition':_0x4545('0xd'),'callback':afterUpdate},{'channel':_0x4545('0x14'),'model':_0x4545('0x16'),'event':_0x4545('0x7'),'condition':_0x4545('0x13'),'callback':afterCreateMessage},{'channel':_0x4545('0x17'),'model':_0x4545('0x18'),'event':_0x4545('0x7'),'condition':_0x4545('0x8'),'callback':afterCreate},{'channel':_0x4545('0x17'),'model':_0x4545('0x18'),'event':_0x4545('0x11'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x4545('0x17'),'model':_0x4545('0x19'),'event':_0x4545('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x4545('0x1a'),'model':'OpenchannelInteraction','event':_0x4545('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x4545('0x1a'),'model':'OpenchannelInteraction','event':_0x4545('0x11'),'condition':_0x4545('0xd'),'callback':afterUpdate},{'channel':_0x4545('0x1a'),'model':_0x4545('0x1b'),'event':_0x4545('0x7'),'condition':_0x4545('0x13'),'callback':afterCreateMessage}];function request(_0x33ed1f){return client[_0x4545('0x1c')](_0x4545('0x1d'),_0x33ed1f)[_0x4545('0x1e')](function(_0x289ef7){logger['info'](_0x4545('0x1f'),_0x4545('0x1d'),_0x289ef7);if(_0x289ef7[_0x4545('0x20')]){if(_0x289ef7[_0x4545('0x20')][_0x4545('0x21')]===0x1f4){logger[_0x4545('0x20')]('Trigger,\x20%s',_0x4545('0x1d'),_0x289ef7[_0x4545('0x20')]);}}})[_0x4545('0x22')](function(_0x42c773){logger[_0x4545('0x20')](_0x4545('0x1f'),_0x4545('0x1d'),_0x42c773);});}function afterCreateMessage(_0x9e08bc,_0x1f1a41){return function(_0x175f5c,_0x4b9a59){_0x175f5c=_0x175f5c[_0x4545('0x23')]({'plain':!![]});_0x175f5c[_0x4545('0x24')]=_0x9e08bc;_0x175f5c['motionChannel']=_0x9e08bc;_0x175f5c[_0x4545('0x25')]=_0x175f5c['direction'];var _0x52fb66=_0x4545('0x26')+_0x175f5c['ContactId'];return db['sequelize'][_0x4545('0x27')](_0x52fb66,{'type':db[_0x4545('0x28')]['QueryTypes'][_0x4545('0x29')],'raw':!![]})[_0x4545('0x1e')](function(_0x4f513d){return _0x4f513d;})[_0x4545('0x1e')](function(_0x453d1a){if(_0x453d1a){_0x175f5c['contact']=_0x453d1a[0x0];}if(_0x175f5c[_0x4545('0x2a')]){return db[_0x4545('0x2b')][_0x4545('0x2c')]({'where':{'id':_0x175f5c[_0x4545('0x2a')]},'attributes':['id',_0x4545('0x2d'),_0x4545('0x2e'),'email',_0x4545('0x2f')],'raw':!![]})[_0x4545('0x1e')](function(_0x4bedf9){_0x175f5c[_0x4545('0x30')]=util['format'](_0x4545('0x31'),_0x4bedf9[_0x4545('0x2d')]);_0x175f5c[_0x4545('0x24')]=_0x9e08bc;_0x175f5c['agent']=_0x4bedf9;return request({'event':_0x4545('0x32'),'message':_0x175f5c});})[_0x4545('0x22')](function(_0x40cbea){console[_0x4545('0x20')](_0x40cbea);});}else{return request({'event':_0x4545('0x33'),'message':_0x175f5c});}});};}function afterCreate(_0x240484,_0x4e2b16){return function(_0x22972d,_0x447943){_0x22972d=_0x22972d[_0x4545('0x23')]({'plain':!![]});_0x22972d[_0x4545('0x24')]=_0x240484;_0x22972d[_0x4545('0x34')]=_0x240484;_0x22972d[_0x4545('0x25')]='opened';var _0x187ccd=_0x4545('0x26')+_0x22972d[_0x4545('0x35')];return db['sequelize'][_0x4545('0x27')](_0x187ccd,{'type':db[_0x4545('0x28')][_0x4545('0x36')][_0x4545('0x29')],'raw':!![]})['then'](function(_0x388571){return _0x388571;})[_0x4545('0x1e')](function(_0x42cfd3){if(_0x42cfd3){_0x22972d['contact']=_0x42cfd3[0x0];}return request({'event':_0x4e2b16,'message':_0x22972d});});};}function afterUpdate(_0xfd8793){return function(_0x546e75){var _0x3887c6=_0x546e75[_0x4545('0x37')](_0x4545('0x38'))&&_0x546e75['closed'];var _0x2a0423=_0x546e75['changed'](_0x4545('0x39'));if(_0x3887c6||_0x2a0423){var _0x471e5e=_0x3887c6?_0x4545('0xd'):_0x4545('0x39');var _0x45f862=_0x546e75[_0x4545('0x23')]({'plain':!![]});_0x45f862[_0x4545('0x24')]=_0xfd8793;_0x45f862[_0x4545('0x34')]=_0xfd8793;_0x45f862[_0x4545('0x25')]=_0x3887c6?'closed':'substatus';var _0x131b8f=_0x4545('0x26')+_0x45f862[_0x4545('0x35')];return db[_0x4545('0x3a')][_0x4545('0x27')](_0x131b8f,{'type':db[_0x4545('0x28')]['QueryTypes'][_0x4545('0x29')],'raw':!![]})[_0x4545('0x1e')](function(_0x1db627){if(_0x1db627){_0x45f862[_0x4545('0x3b')]=_0x1db627[0x0];}if(_0x45f862[_0x4545('0x2a')]){return db[_0x4545('0x2b')][_0x4545('0x2c')]({'where':{'id':_0x45f862[_0x4545('0x2a')]},'attributes':['id',_0x4545('0x2d'),'fullname',_0x4545('0x3c'),_0x4545('0x2f')],'raw':!![]})[_0x4545('0x1e')](function(_0x52039e){_0x45f862[_0x4545('0x30')]=util[_0x4545('0x3d')](_0x4545('0x31'),_0x52039e[_0x4545('0x2d')]);_0x45f862[_0x4545('0x3e')]=_0x52039e;return request({'event':_0x471e5e,'message':_0x45f862});})[_0x4545('0x22')](function(_0x1aa9dc){console[_0x4545('0x20')](_0x1aa9dc);});}else{return request({'event':_0x471e5e,'message':_0x45f862});}});}};}exports[_0x4545('0x3f')]=function(){for(var _0x33ece0=0x0;_0x33ece0<triggers[_0x4545('0x40')];_0x33ece0+=0x1){if(db[_0x4545('0x41')](triggers[_0x33ece0][_0x4545('0x42')])){db[triggers[_0x33ece0][_0x4545('0x42')]]['hook'](triggers[_0x33ece0]['event'],triggers[_0x33ece0][_0x4545('0x43')](triggers[_0x33ece0][_0x4545('0x24')][_0x4545('0x44')](),triggers[_0x33ece0][_0x4545('0x45')]));}}};
\ No newline at end of file
index 5f893e1..b5cb523 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa85=['clearBlockUser','isUndefined','updateAttributes','getLicense','role','agent','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','../mysqldb','./license/util','voice','mail','chat','fax','sms','openchannel','isValidChannel','toLowerCase','includes'];(function(_0x16573b,_0x219475){var _0x2a6964=function(_0x3c2cbc){while(--_0x3c2cbc){_0x16573b['push'](_0x16573b['shift']());}};_0x2a6964(++_0x219475);}(_0xaa85,0x1ee));var _0x5aa8=function(_0x1c628f,_0x2f40c0){_0x1c628f=_0x1c628f-0x0;var _0x897f1a=_0xaa85[_0x1c628f];return _0x897f1a;};'use strict';var _=require(_0x5aa8('0x0'));var BPromise=require('bluebird');var db=require(_0x5aa8('0x1'))['db'];var util=require(_0x5aa8('0x2'));var channels=[_0x5aa8('0x3'),_0x5aa8('0x4'),_0x5aa8('0x5'),_0x5aa8('0x6'),_0x5aa8('0x7'),'whatsapp',_0x5aa8('0x8')];exports['getChannels']=function(){return channels;};exports[_0x5aa8('0x9')]=function(_0x500b56){_0x500b56=_0x500b56[_0x5aa8('0xa')]();return _[_0x5aa8('0xb')](channels,_0x500b56);};exports[_0x5aa8('0xc')]=function(_0x321a1b,_0x45222f,_0x34d213,_0x25aba8){var _0x5b43f3={'loginAttempts':_0x45222f,'blocked':_0x34d213};if(!_[_0x5aa8('0xd')](_0x25aba8)){_0x5b43f3['blockedAt']=_0x25aba8;}return _0x321a1b[_0x5aa8('0xe')](_0x5b43f3);};exports[_0x5aa8('0xf')]=function(_0x1715d2){return new BPromise(function(_0x31020,_0x45cebd){var _0x38f12d=0x0;if(_0x1715d2[_0x5aa8('0x10')]!==_0x5aa8('0x11')){_0x31020(_0x1715d2);}db['User'][_0x5aa8('0x12')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x1715d2['id']}}})[_0x5aa8('0x13')](function(_0x13079d){_0x38f12d=_0x13079d;return util[_0x5aa8('0xf')]();})[_0x5aa8('0x13')](function(_0x2147ca){if(_0x2147ca&&_0x2147ca['agents']&&_0x38f12d>=_0x2147ca[_0x5aa8('0x14')]){throw Error(_0x5aa8('0x15'));}_0x31020(_0x1715d2);})[_0x5aa8('0x16')](function(_0x223cec){_0x45cebd(_0x223cec);});});};
\ No newline at end of file
+var _0x56ed=['getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','agent','User','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','../mysqldb','./license/util','voice','mail','chat','fax','sms','whatsapp','openchannel'];(function(_0x169bc1,_0x4dd004){var _0x4ac893=function(_0x5a109b){while(--_0x5a109b){_0x169bc1['push'](_0x169bc1['shift']());}};_0x4ac893(++_0x4dd004);}(_0x56ed,0xd7));var _0xd56e=function(_0x438fe1,_0x3308d5){_0x438fe1=_0x438fe1-0x0;var _0x3c8e1b=_0x56ed[_0x438fe1];return _0x3c8e1b;};'use strict';var _=require(_0xd56e('0x0'));var BPromise=require('bluebird');var db=require(_0xd56e('0x1'))['db'];var util=require(_0xd56e('0x2'));var channels=[_0xd56e('0x3'),_0xd56e('0x4'),_0xd56e('0x5'),_0xd56e('0x6'),_0xd56e('0x7'),_0xd56e('0x8'),_0xd56e('0x9')];exports[_0xd56e('0xa')]=function(){return channels;};exports[_0xd56e('0xb')]=function(_0x2d2d0e){_0x2d2d0e=_0x2d2d0e[_0xd56e('0xc')]();return _[_0xd56e('0xd')](channels,_0x2d2d0e);};exports[_0xd56e('0xe')]=function(_0x670562,_0x5be4b5,_0x1b642a,_0x28ac8d){var _0x5d6a10={'loginAttempts':_0x5be4b5,'blocked':_0x1b642a};if(!_[_0xd56e('0xf')](_0x28ac8d)){_0x5d6a10[_0xd56e('0x10')]=_0x28ac8d;}return _0x670562[_0xd56e('0x11')](_0x5d6a10);};exports[_0xd56e('0x12')]=function(_0x5edb98){return new BPromise(function(_0x546ec4,_0x5a575c){var _0x2fd50f=0x0;if(_0x5edb98['role']!==_0xd56e('0x13')){_0x546ec4(_0x5edb98);}db[_0xd56e('0x14')]['count']({'where':{'role':'agent','online':!![],'id':{'$ne':_0x5edb98['id']}}})[_0xd56e('0x15')](function(_0x496d1d){_0x2fd50f=_0x496d1d;return util[_0xd56e('0x12')]();})['then'](function(_0x3771f1){if(_0x3771f1&&_0x3771f1[_0xd56e('0x16')]&&_0x2fd50f>=_0x3771f1[_0xd56e('0x16')]){throw Error(_0xd56e('0x17'));}_0x546ec4(_0x5edb98);})[_0xd56e('0x18')](function(_0x1eb7d1){_0x5a575c(_0x1eb7d1);});});};
\ No newline at end of file
index 39b293b..6ea44de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd2e=['404','status','render','json','send','exports'];(function(_0x36a469,_0x59d84c){var _0x3347fc=function(_0x3860e7){while(--_0x3860e7){_0x36a469['push'](_0x36a469['shift']());}};_0x3347fc(++_0x59d84c);}(_0xdd2e,0x13d));var _0xedd2=function(_0x228019,_0x279e36){_0x228019=_0x228019-0x0;var _0x25c52b=_0xdd2e[_0x228019];return _0x25c52b;};'use strict';module[_0xedd2('0x0')][0x194]=function pageNotFound(_0x5908d6,_0x556c16){var _0x34111e=_0xedd2('0x1');var _0x4dc316=0x194;var _0xd66e72={'status':_0x4dc316};_0x556c16[_0xedd2('0x2')](_0xd66e72[_0xedd2('0x2')]);_0x556c16[_0xedd2('0x3')](_0x34111e,{},function(_0x599169,_0x4b924c){if(_0x599169){return _0x556c16[_0xedd2('0x2')](_0xd66e72[_0xedd2('0x2')])[_0xedd2('0x4')](_0xd66e72);}_0x556c16[_0xedd2('0x5')](_0x4b924c);});};
\ No newline at end of file
+var _0x6059=['render','json','exports','status'];(function(_0x39aaf7,_0x4433c1){var _0x208eea=function(_0x426a62){while(--_0x426a62){_0x39aaf7['push'](_0x39aaf7['shift']());}};_0x208eea(++_0x4433c1);}(_0x6059,0x1aa));var _0x9605=function(_0x319a03,_0x4456d4){_0x319a03=_0x319a03-0x0;var _0x3b6704=_0x6059[_0x319a03];return _0x3b6704;};'use strict';module[_0x9605('0x0')][0x194]=function pageNotFound(_0xb0e55b,_0x199be0){var _0x2c9c2c='404';var _0x3f1f26=0x194;var _0x383771={'status':_0x3f1f26};_0x199be0[_0x9605('0x1')](_0x383771[_0x9605('0x1')]);_0x199be0[_0x9605('0x2')](_0x2c9c2c,{},function(_0x19b615,_0x230a9a){if(_0x19b615){return _0x199be0[_0x9605('0x1')](_0x383771['status'])[_0x9605('0x3')](_0x383771);}_0x199be0['send'](_0x230a9a);});};
\ No newline at end of file
index 14e7752..8844673 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x878f=['CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','Schedule','../api/schedule/schedule.model','../api/sound/sound.model','Tag','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','SquareProject','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','Team','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/userProfile/userProfile.model','UserProfileSection','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','hasOne','cascade','UserId','hasMany','HopperFinals','OpenchannelInteraction','OpenchannelInteractions','SmsInteractions','MailInteractions','WhatsappInteractions','SenderId','belongsTo','UserProfile','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','SmsInteraction','user_has_openchannel_interactions','VoiceQueues','VoicePrefixes','MailQueues','ChatQueues','FaxQueues','SmsQueues','UserSmsQueue','OpenchannelQueues','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','Trunk','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','mailboxuser','mailbox','QueueCalls','VoiceAgentReport','AgentReports','uniqueid','Contact','ContactId','MailAccountId','MailServerOut','Smtp','Dispositions','MailMessage','List','ListId','team_has_mail_queues','Account','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','FaxAccountId','Answers','Interactions','FaxMessage','Owner','fax_interaction_has_tags','FaxInteractionId','Interaction','AttachmentId','team_has_fax_queues','SmsAccountId','SmsApplication','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ProactiveActions','ChatApplication','OpenchannelQueueReport','Agent','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','CmCompany','CompanyId','cm_contact_has_tags','CampaignId','OwnerId','Queue','Automation','All','OneAll','AutomationAllId','Any','OneAny','Action','Actions','AutomationId','Intervals','Extensions','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Sound','Mohs','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','AnalyticFieldReport','Fields','MetricId','Configurations','SalesforceConfiguration','Subjects','SubjectId','Descriptions','FieldId','AccountId','Subject','Description','DescriptionId','SugarcrmAccount','Field','VariableId','DeskConfiguration','int_desk_configuration_has_tags','ZohoAccount','int_zendesk_configuration_has_tags','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','FreshdeskField','Dynamics365Field','FreshsalesConfiguration','ChatQueueReport','ToId','SessionId','ProjectId','team_has_whatsapp_queues','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToQueue','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CmCustomField','CustomFields','HopperHistory','Queues','voice_queues_has_cm_lists','UserVoicePrefix','UserProfileSections','Resources','WhatsappAccountId','WhatsappInteractionId','whatsapp_interaction_has_tags','ToWhatsappAccountId','ToQueueId','exports','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','name','utf8','sequelizeHistory','mysql','username','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','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','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsAccount','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmContact','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','../api/automation/automation.model'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x878f,0x173));var _0xf878=function(_0x91d213,_0xd4588c){_0x91d213=_0x91d213-0x0;var _0x2bbf2b=_0x878f[_0x91d213];return _0x2bbf2b;};'use strict';var config=require('../config/environment');var Sequelize=require(_0xf878('0x0'));var _=require(_0xf878('0x1'));var jstz=require(_0xf878('0x2'));var timezone=jstz[_0xf878('0x3')]();config[_0xf878('0x0')]=_[_0xf878('0x4')](config[_0xf878('0x0')],{'database':_0xf878('0x5'),'username':_0xf878('0x6'),'password':_0xf878('0x7'),'options':{'host':_0xf878('0x8'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xf878('0x9')](),'define':{'charset':_0xf878('0xa'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_['defaultsDeep'](config[_0xf878('0xb')],{'database':'motion2','username':'xcall','password':_0xf878('0x7'),'options':{'host':_0xf878('0x8'),'port':0xcea,'dialect':_0xf878('0xc'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xf878('0x9')](),'define':{'charset':_0xf878('0xa'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xf878('0x0')]['database'],config[_0xf878('0x0')][_0xf878('0xd')],config[_0xf878('0x0')]['password'],config[_0xf878('0x0')][_0xf878('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xf878('0xb')]['database'],config[_0xf878('0xb')][_0xf878('0xd')],config[_0xf878('0xb')]['password'],config['sequelizeHistory'][_0xf878('0xe')])};db[_0xf878('0xf')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x11'));db[_0xf878('0x12')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x13'));db[_0xf878('0x14')]=db[_0xf878('0x0')]['import'](_0xf878('0x15'));db[_0xf878('0x16')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x17'));db[_0xf878('0x18')]=db[_0xf878('0x0')]['import'](_0xf878('0x19'));db[_0xf878('0x1a')]=db[_0xf878('0x0')]['import'](_0xf878('0x1b'));db[_0xf878('0x1c')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x1d'));db[_0xf878('0x1e')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x1f'));db[_0xf878('0x20')]=db[_0xf878('0x0')]['import'](_0xf878('0x21'));db['VoiceMailMessage']=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x22'));db[_0xf878('0x23')]=db[_0xf878('0x0')]['import']('../api/voiceCallReport/voiceCallReport.model');db['VoiceDialReport']=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x24'));db['VoiceAgentReport']=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x25'));db[_0xf878('0x26')]=db[_0xf878('0x0')]['import']('../api/voiceQueueReport/voiceQueueReport.model');db[_0xf878('0x27')]=db[_0xf878('0x0')]['import'](_0xf878('0x28'));db['Trunk']=db[_0xf878('0x0')]['import'](_0xf878('0x29'));db['VoiceTransferReport']=db[_0xf878('0x0')]['import'](_0xf878('0x2a'));db[_0xf878('0x2b')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x2c'));db[_0xf878('0x2d')]=db['sequelize'][_0xf878('0x10')](_0xf878('0x2e'));db[_0xf878('0x2f')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/userChatQueue/userChatQueue.model');db[_0xf878('0x30')]=db[_0xf878('0x0')]['import'](_0xf878('0x31'));db[_0xf878('0x32')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x33'));db['UserSmsQueue']=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x34'));db[_0xf878('0x35')]=db['sequelize'][_0xf878('0x10')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db['UserWhatsappQueue']=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x36'));db[_0xf878('0x37')]=db[_0xf878('0x0')]['import'](_0xf878('0x38'));db['MailServerOut']=db[_0xf878('0x0')][_0xf878('0x10')]('../api/mailServerOut/mailServerOut.model');db[_0xf878('0x39')]=db[_0xf878('0x0')]['import'](_0xf878('0x3a'));db[_0xf878('0x3b')]=db['sequelize'][_0xf878('0x10')](_0xf878('0x3c'));db[_0xf878('0x3d')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x3e'));db[_0xf878('0x3f')]=db['sequelize'][_0xf878('0x10')](_0xf878('0x40'));db['MailMessage']=db[_0xf878('0x0')]['import']('../api/mailMessage/mailMessage.model');db[_0xf878('0x41')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x42'));db[_0xf878('0x43')]=db['sequelize'][_0xf878('0x10')]('../api/mailQueueReport/mailQueueReport.model');db[_0xf878('0x44')]=db[_0xf878('0x0')]['import']('../api/dashboard/dashboard.model');db[_0xf878('0x45')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x46'));db[_0xf878('0x47')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x48'));db[_0xf878('0x49')]=db['sequelize'][_0xf878('0x10')](_0xf878('0x4a'));db[_0xf878('0x4b')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x4c'));db['FaxMessage']=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x4d'));db[_0xf878('0x4e')]=db[_0xf878('0x0')]['import'](_0xf878('0x4f'));db[_0xf878('0x50')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/faxQueueReport/faxQueueReport.model');db[_0xf878('0x51')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/smsAccount/smsAccount.model');db['SmsApplication']=db[_0xf878('0x0')]['import']('../api/smsApplication/smsApplication.model');db['SmsInteraction']=db[_0xf878('0x0')]['import'](_0xf878('0x52'));db[_0xf878('0x53')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x54'));db[_0xf878('0x55')]=db[_0xf878('0x0')]['import'](_0xf878('0x56'));db[_0xf878('0x57')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x58'));db['OpenchannelApplication']=db['sequelize'][_0xf878('0x10')](_0xf878('0x59'));db['OpenchannelInteraction']=db[_0xf878('0x0')]['import'](_0xf878('0x5a'));db[_0xf878('0x5b')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/openchannelMessage/openchannelMessage.model');db[_0xf878('0x5c')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/openchannelQueue/openchannelQueue.model');db[_0xf878('0x5d')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x5e'));db['OpenchannelQueueReport']=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x5f'));db['ChatApplication']=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x60'));db[_0xf878('0x61')]=db['sequelize']['import']('../api/chatInteraction/chatInteraction.model');db[_0xf878('0x62')]=db['sequelize']['import']('../api/chatMessage/chatMessage.model');db[_0xf878('0x63')]=db[_0xf878('0x0')]['import'](_0xf878('0x64'));db[_0xf878('0x65')]=db[_0xf878('0x0')]['import']('../api/chatQueue/chatQueue.model');db[_0xf878('0x66')]=db['sequelize'][_0xf878('0x10')](_0xf878('0x67'));db[_0xf878('0x68')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x69'));db['CmCompany']=db[_0xf878('0x0')][_0xf878('0x10')]('../api/cmCompany/cmCompany.model');db[_0xf878('0x6a')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x6b'));db[_0xf878('0x6c')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/cmHopper/cmHopper.model');db[_0xf878('0x6d')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0xf878('0x6e')]=db['sequelize'][_0xf878('0x10')](_0xf878('0x6f'));db[_0xf878('0x70')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x71'));db[_0xf878('0x72')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x73'));db['CmCustomField']=db['sequelize']['import'](_0xf878('0x74'));db['Action']=db[_0xf878('0x0')][_0xf878('0x10')]('../api/action/action.model');db['Automation']=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x75'));db[_0xf878('0x76')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x77'));db[_0xf878('0x78')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x79'));db[_0xf878('0x7a')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x7b'));db[_0xf878('0x7c')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/interval/interval.model');db[_0xf878('0x7d')]=db['sequelize'][_0xf878('0x10')](_0xf878('0x7e'));db[_0xf878('0x7f')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x80'));db[_0xf878('0x81')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0xf878('0x82')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x83'));db['Sound']=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x84'));db[_0xf878('0x85')]=db[_0xf878('0x0')]['import']('../api/tag/tag.model');db[_0xf878('0x86')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x87'));db[_0xf878('0x88')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x89'));db[_0xf878('0x8a')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x8b'));db[_0xf878('0x8c')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x8d'));db[_0xf878('0x8e')]=db['sequelize'][_0xf878('0x10')](_0xf878('0x8f'));db[_0xf878('0x90')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x91'));db[_0xf878('0x92')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0xf878('0x93')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x94'));db[_0xf878('0x95')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/analyticMetric/analyticMetric.model');db['AnalyticFieldReport']=db[_0xf878('0x0')]['import'](_0xf878('0x96'));db[_0xf878('0x97')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0xf878('0x98')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x99'));db['SalesforceConfiguration']=db[_0xf878('0x0')]['import'](_0xf878('0x9a'));db[_0xf878('0x9b')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x9c'));db['SugarcrmAccount']=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x9d'));db[_0xf878('0x9e')]=db['sequelize'][_0xf878('0x10')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0xf878('0x9f')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xa0'));db[_0xf878('0xa1')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xa2'));db['DeskConfiguration']=db['sequelize']['import'](_0xf878('0xa3'));db[_0xf878('0xa4')]=db['sequelize']['import'](_0xf878('0xa5'));db['ZohoAccount']=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xa6'));db[_0xf878('0xa7')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xa8'));db[_0xf878('0xa9')]=db[_0xf878('0x0')]['import'](_0xf878('0xaa'));db[_0xf878('0xab')]=db[_0xf878('0x0')]['import'](_0xf878('0xac'));db[_0xf878('0xad')]=db['sequelize'][_0xf878('0x10')](_0xf878('0xae'));db[_0xf878('0xaf')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xb0'));db[_0xf878('0xb1')]=db[_0xf878('0x0')]['import'](_0xf878('0xb2'));db['FreshdeskConfiguration']=db['sequelize'][_0xf878('0x10')](_0xf878('0xb3'));db['FreshdeskField']=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xb4'));db[_0xf878('0xb5')]=db[_0xf878('0x0')]['import'](_0xf878('0xb6'));db[_0xf878('0xb7')]=db['sequelize'][_0xf878('0x10')](_0xf878('0xb8'));db[_0xf878('0xb9')]=db[_0xf878('0x0')]['import']('../api/intVtigerField/intVtigerField.model');db[_0xf878('0xba')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xbb'));db[_0xf878('0xbc')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xbd'));db[_0xf878('0xbe')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xbf'));db[_0xf878('0xc0')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0xf878('0xc1')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xc2'));db['Dynamics365Field']=db[_0xf878('0x0')]['import'](_0xf878('0xc3'));db[_0xf878('0xc4')]=db['sequelize'][_0xf878('0x10')](_0xf878('0xc5'));db['FreshsalesConfiguration']=db['sequelize'][_0xf878('0x10')](_0xf878('0xc6'));db[_0xf878('0xc7')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xc8'));db[_0xf878('0x8c')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x8d'));db['Network']=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xc9'));db['ChatQueueReport']=db[_0xf878('0x0')]['import'](_0xf878('0xca'));db[_0xf878('0xcb')]=db['sequelize'][_0xf878('0x10')](_0xf878('0xcc'));db[_0xf878('0xcd')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xce'));db[_0xf878('0xcf')]=db['sequelize'][_0xf878('0x10')](_0xf878('0xd0'));db[_0xf878('0xd1')]=db['sequelize']['import'](_0xf878('0xd2'));db[_0xf878('0xd3')]=db['sequelize'][_0xf878('0x10')](_0xf878('0xd4'));db['SquareReport']=db['sequelize']['import'](_0xf878('0xd5'));db['SquareDetailsReport']=db[_0xf878('0x0')][_0xf878('0x10')]('../api/squareReportDetail/squareReportDetail.model');db[_0xf878('0xd6')]=db['sequelize'][_0xf878('0x10')](_0xf878('0xd7'));db[_0xf878('0xd8')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xd9'));db[_0xf878('0xda')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/squareOdbc/squareOdbc.model');db[_0xf878('0xdb')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/squareProject/squareProject.model');db[_0xf878('0xdc')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xdd'));db[_0xf878('0xde')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/squareMessage/squareMessage.model');db[_0xf878('0xdf')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/team/team.model');db['License']=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xe0'));db[_0xf878('0xe1')]=db['sequelize']['import'](_0xf878('0xe2'));db[_0xf878('0xe3')]=db[_0xf878('0x0')]['import']('../api/migration/migration.model');db[_0xf878('0xe4')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/attachment/attachment.model');db[_0xf878('0xe5')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xe6'));db[_0xf878('0xe7')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xe8'));db[_0xf878('0xe9')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xea'));db[_0xf878('0xeb')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xec'));db[_0xf878('0xed')]=db[_0xf878('0x0')]['import'](_0xf878('0xee'));db[_0xf878('0xef')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xf0'));db[_0xf878('0xf1')]=db['sequelize']['import'](_0xf878('0xf2'));db[_0xf878('0xf3')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/voicePrefix/voicePrefix.model');db['UserProfile']=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xf4'));db[_0xf878('0xf5')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/userProfileSection/userProfileSection.model');db[_0xf878('0xf6')]=db[_0xf878('0x0')]['import'](_0xf878('0xf7'));db[_0xf878('0xf8')]=db[_0xf878('0x0')]['import'](_0xf878('0xf9'));db[_0xf878('0xfa')]=db['sequelize'][_0xf878('0x10')](_0xf878('0xfb'));db[_0xf878('0xfc')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/whatsappApplication/whatsappApplication.model');db[_0xf878('0xfd')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xfe'));db[_0xf878('0xff')]=db['sequelize'][_0xf878('0x10')](_0xf878('0x100'));db[_0xf878('0x101')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x102'));db[_0xf878('0x103')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x104'));db[_0xf878('0x105')]=db[_0xf878('0x0')]['import']('../api/whatsappQueue/whatsappQueue.model');db['CloudProvider']=db['sequelize'][_0xf878('0x10')]('../api/cloudProvider/cloudProvider.model');db[_0xf878('0x106')]=db[_0xf878('0x0')]['import'](_0xf878('0x107'));db[_0xf878('0x108')]=db['sequelize'][_0xf878('0x10')](_0xf878('0x109'));db['UserVoicePrefix']=db['sequelize'][_0xf878('0x10')](_0xf878('0x10a'));db[_0xf878('0xf')][_0xf878('0x10b')](db['VoiceMail'],{'as':_0xf878('0x20'),'onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x10d')});db[_0xf878('0xf')]['hasMany'](db[_0xf878('0x1c')],{'as':'Recordings','foreignKey':_0xf878('0x10d')});db[_0xf878('0xf')]['hasMany'](db[_0xf878('0x2b')],{'as':'VoiceQueuesRt','foreignKey':_0xf878('0x10d')});db['User']['hasMany'](db[_0xf878('0x16')],{'as':'Extensions','onDelete':_0xf878('0x10c'),'hooks':!![]});db[_0xf878('0xf')][_0xf878('0x10e')](db[_0xf878('0x6e')],{'as':_0xf878('0x10f'),'foreignKey':_0xf878('0x10d')});db[_0xf878('0xf')]['hasMany'](db[_0xf878('0x70')],{'as':'HopperHistory','foreignKey':_0xf878('0x10d')});db[_0xf878('0xf')][_0xf878('0x10e')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xf878('0x10d')});db[_0xf878('0xf')][_0xf878('0x10e')](db[_0xf878('0x110')],{'as':_0xf878('0x111'),'foreignKey':_0xf878('0x10d')});db[_0xf878('0xf')][_0xf878('0x10e')](db[_0xf878('0x61')],{'as':'ChatInteractions','foreignKey':_0xf878('0x10d')});db[_0xf878('0xf')][_0xf878('0x10e')](db['SmsInteraction'],{'as':_0xf878('0x112'),'foreignKey':_0xf878('0x10d')});db['User'][_0xf878('0x10e')](db[_0xf878('0x4b')],{'as':'FaxInteractions','foreignKey':'UserId'});db['User'][_0xf878('0x10e')](db[_0xf878('0x3f')],{'as':_0xf878('0x113'),'foreignKey':_0xf878('0x10d')});db['User'][_0xf878('0x10e')](db[_0xf878('0xfd')],{'as':_0xf878('0x114'),'foreignKey':_0xf878('0x10d')});db[_0xf878('0xf')][_0xf878('0x10e')](db['UserNotification'],{'as':'UserNotifications','foreignKey':_0xf878('0x115')});db[_0xf878('0xf')][_0xf878('0x116')](db[_0xf878('0x117')],{'as':_0xf878('0x117'),'foreignKey':_0xf878('0x118')});db[_0xf878('0xf')][_0xf878('0x119')](db['ChatGroup'],{'as':_0xf878('0x11a'),'through':_0xf878('0x11b')});db[_0xf878('0xf')][_0xf878('0x119')](db[_0xf878('0x6a')],{'as':_0xf878('0x11c'),'through':'cm_user_has_contacts'});db[_0xf878('0xf')][_0xf878('0x119')](db[_0xf878('0xf1')],{'as':_0xf878('0x11d'),'through':_0xf878('0x11e')});db['User'][_0xf878('0x119')](db[_0xf878('0xdf')],{'through':_0xf878('0x11f')});db[_0xf878('0xf')][_0xf878('0x119')](db[_0xf878('0x3f')],{'as':'MailInteractions','through':_0xf878('0x120')});db[_0xf878('0xf')]['belongsToMany'](db[_0xf878('0x61')],{'as':_0xf878('0x121'),'through':_0xf878('0x122')});db[_0xf878('0xf')][_0xf878('0x119')](db[_0xf878('0x4b')],{'as':_0xf878('0x123'),'through':_0xf878('0x124')});db[_0xf878('0xf')][_0xf878('0x119')](db[_0xf878('0x125')],{'as':_0xf878('0x112'),'through':'user_has_sms_interactions'});db['User']['belongsToMany'](db[_0xf878('0x110')],{'as':_0xf878('0x111'),'through':_0xf878('0x126')});db[_0xf878('0xf')][_0xf878('0x119')](db[_0xf878('0xfd')],{'as':'WhatsappInteractions','through':'user_has_whatsapp_interactions'});db['User']['belongsToMany'](db[_0xf878('0x1a')],{'as':_0xf878('0x127'),'through':_0xf878('0x2d'),'required':![]});db[_0xf878('0xf')][_0xf878('0x119')](db['VoicePrefix'],{'as':_0xf878('0x128'),'through':'UserVoicePrefix','required':![]});db['User'][_0xf878('0x119')](db[_0xf878('0x3b')],{'as':_0xf878('0x129'),'through':_0xf878('0x30'),'required':![]});db['User'][_0xf878('0x119')](db['ChatQueue'],{'as':_0xf878('0x12a'),'through':_0xf878('0x2f'),'required':![],'hooks':!![]});db[_0xf878('0xf')]['belongsToMany'](db['FaxQueue'],{'as':_0xf878('0x12b'),'through':_0xf878('0x32'),'required':![]});db['User'][_0xf878('0x119')](db[_0xf878('0x55')],{'as':_0xf878('0x12c'),'through':_0xf878('0x12d'),'required':![]});db[_0xf878('0xf')]['belongsToMany'](db[_0xf878('0x5c')],{'as':_0xf878('0x12e'),'through':'UserOpenchannelQueue','required':![]});db[_0xf878('0xf')][_0xf878('0x119')](db[_0xf878('0x105')],{'as':'WhatsappQueues','through':'UserWhatsappQueue','required':![]});db[_0xf878('0xf')]['belongsToMany'](db[_0xf878('0xf1')],{'through':_0xf878('0x11e')});db[_0xf878('0xf')][_0xf878('0x119')](db[_0xf878('0x5d')],{'as':'ChatWebsites','through':_0xf878('0x12f')});db[_0xf878('0xf')][_0xf878('0x119')](db[_0xf878('0x47')],{'as':_0xf878('0x130'),'through':_0xf878('0x131')});db['User'][_0xf878('0x119')](db['MailAccount'],{'as':_0xf878('0x132'),'through':_0xf878('0x133')});db[_0xf878('0xf')][_0xf878('0x119')](db['OpenchannelAccount'],{'as':'OpenchannelAccounts','through':'user_has_openchannel_accounts'});db[_0xf878('0xf')][_0xf878('0x119')](db['SmsAccount'],{'as':_0xf878('0x134'),'through':_0xf878('0x135')});db[_0xf878('0xf')]['belongsToMany'](db[_0xf878('0xfa')],{'as':_0xf878('0x136'),'through':_0xf878('0x137')});db[_0xf878('0xf')]['belongsToMany'](db[_0xf878('0xdb')],{'as':_0xf878('0x138'),'through':_0xf878('0x139')});db[_0xf878('0x12')][_0xf878('0x10e')](db[_0xf878('0x16')],{'as':'SpiedAgents','onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x13a')});db[_0xf878('0x14')][_0xf878('0x10e')](db[_0xf878('0x16')],{'onDelete':_0xf878('0x10c')});db[_0xf878('0x16')][_0xf878('0x10e')](db[_0xf878('0x16')],{'as':_0xf878('0x13b'),'onDelete':_0xf878('0x10c')});db[_0xf878('0x18')][_0xf878('0x119')](db['Sound'],{'as':_0xf878('0x13c'),'through':_0xf878('0x13d')});db[_0xf878('0x1a')][_0xf878('0x10e')](db[_0xf878('0x2b')],{'as':_0xf878('0x13e'),'foreignKey':_0xf878('0x13f')});db[_0xf878('0x1a')][_0xf878('0x10e')](db['CmHopper'],{'as':_0xf878('0x140'),'foreignKey':_0xf878('0x13f')});db['VoiceQueue'][_0xf878('0x10e')](db['CmHopperFinal'],{'as':_0xf878('0x10f'),'foreignKey':_0xf878('0x13f')});db[_0xf878('0x1a')][_0xf878('0x10e')](db[_0xf878('0x70')],{'as':_0xf878('0x141'),'foreignKey':_0xf878('0x13f')});db[_0xf878('0x1a')][_0xf878('0x10e')](db['ReportAgentPreview'],{'as':_0xf878('0x72'),'foreignKey':_0xf878('0x13f')});db[_0xf878('0x1a')][_0xf878('0x10e')](db['CmHopperBlack'],{'as':_0xf878('0x142'),'foreignKey':_0xf878('0x13f')});db['VoiceQueue']['hasMany'](db[_0xf878('0xd1')],{'as':_0xf878('0x143'),'foreignKey':_0xf878('0x13f')});db['VoiceQueue'][_0xf878('0x116')](db[_0xf878('0x144')],{'as':_0xf878('0x144'),'foreignKey':_0xf878('0x145')});db['VoiceQueue']['belongsTo'](db[_0xf878('0x144')],{'as':_0xf878('0x146'),'foreignKey':_0xf878('0x147')});db['VoiceQueue'][_0xf878('0x116')](db['Interval'],{'as':_0xf878('0x7c'),'foreignKey':_0xf878('0x148')});db[_0xf878('0x1a')][_0xf878('0x116')](db[_0xf878('0x7d')],{'as':_0xf878('0x149'),'foreignKey':_0xf878('0x14a')});db[_0xf878('0x1a')]['belongsToMany'](db[_0xf878('0xf1')],{'as':_0xf878('0x11d'),'through':'voice_queues_has_cm_lists'});db[_0xf878('0x1a')][_0xf878('0x119')](db[_0xf878('0xf')],{'as':_0xf878('0x14b'),'through':_0xf878('0x2d')});db[_0xf878('0x1a')][_0xf878('0x119')](db[_0xf878('0xdf')],{'as':_0xf878('0x14c'),'through':_0xf878('0x106')});db[_0xf878('0x1a')][_0xf878('0x119')](db[_0xf878('0xf1')],{'as':_0xf878('0x14d'),'through':_0xf878('0x14e')});db[_0xf878('0x1c')]['belongsTo'](db[_0xf878('0xf')],{'as':_0xf878('0xf'),'foreignKey':_0xf878('0x10d')});db[_0xf878('0x1e')][_0xf878('0x116')](db[_0xf878('0xf')],{'as':'User','foreignKey':_0xf878('0x10d')});db[_0xf878('0x20')][_0xf878('0x10e')](db[_0xf878('0x14f')],{'as':_0xf878('0x150'),'onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x151'),'sourceKey':_0xf878('0x152')});db['VoiceMailMessage'][_0xf878('0x116')](db[_0xf878('0x20')],{'foreignKey':'mailboxuser','targetKey':'mailbox'});db[_0xf878('0x23')][_0xf878('0x10e')](db['VoiceQueueReport'],{'as':_0xf878('0x153'),'foreignKey':'uniqueid','constraints':![]});db[_0xf878('0x23')][_0xf878('0x10e')](db[_0xf878('0x154')],{'as':_0xf878('0x155'),'foreignKey':_0xf878('0x156'),'constraints':![]});db[_0xf878('0x23')][_0xf878('0x116')](db[_0xf878('0xf')],{'as':_0xf878('0xf'),'foreignKey':_0xf878('0x10d')});db[_0xf878('0x23')][_0xf878('0x116')](db[_0xf878('0x6a')],{'as':_0xf878('0x157'),'foreignKey':_0xf878('0x158')});db[_0xf878('0x37')][_0xf878('0x116')](db[_0xf878('0x39')],{'as':_0xf878('0x39'),'foreignKey':_0xf878('0x159')});db[_0xf878('0x15a')][_0xf878('0x116')](db[_0xf878('0x39')],{'as':_0xf878('0x39'),'foreignKey':_0xf878('0x159')});db[_0xf878('0x39')][_0xf878('0x10b')](db[_0xf878('0x37')],{'as':'Imap','onDelete':_0xf878('0x10c')});db[_0xf878('0x39')]['hasOne'](db[_0xf878('0x15a')],{'as':_0xf878('0x15b'),'onDelete':_0xf878('0x10c')});db[_0xf878('0x39')][_0xf878('0x10e')](db[_0xf878('0x78')],{'as':_0xf878('0x15c'),'foreignKey':'MailAccountId','onDelete':'cascade'});db[_0xf878('0x39')][_0xf878('0x10e')](db[_0xf878('0x76')],{'as':'Answers','foreignKey':_0xf878('0x159')});db[_0xf878('0x39')][_0xf878('0x10e')](db[_0xf878('0x15d')],{'as':_0xf878('0x150'),'foreignKey':'MailAccountId'});db[_0xf878('0x39')][_0xf878('0x10e')](db['MailInteraction'],{'as':'Interactions'});db[_0xf878('0x39')][_0xf878('0x10e')](db[_0xf878('0x41')],{'as':_0xf878('0x13b')});db[_0xf878('0x39')]['belongsTo'](db[_0xf878('0xf1')],{'as':_0xf878('0x15e'),'foreignKey':_0xf878('0x15f')});db['MailAccount'][_0xf878('0x116')](db[_0xf878('0x86')],{'as':_0xf878('0x86'),'foreignKey':'TemplateId'});db['MailAccount'][_0xf878('0x116')](db['Pause'],{'as':_0xf878('0x149'),'foreignKey':_0xf878('0x14a')});db[_0xf878('0x39')][_0xf878('0x119')](db[_0xf878('0xf')],{'as':_0xf878('0x14b'),'through':_0xf878('0x133')});db['MailQueue'][_0xf878('0x119')](db[_0xf878('0xf')],{'as':'Agents','through':_0xf878('0x30')});db[_0xf878('0x3b')][_0xf878('0x119')](db['Team'],{'through':_0xf878('0x160'),'as':_0xf878('0x14c')});db[_0xf878('0x3f')][_0xf878('0x10e')](db[_0xf878('0x15d')],{'as':'Messages','onDelete':_0xf878('0x10c'),'foreignKey':'MailInteractionId'});db['MailInteraction']['belongsTo'](db['MailAccount'],{'as':_0xf878('0x161'),'foreignKey':'MailAccountId'});db['MailInteraction'][_0xf878('0x116')](db['CmContact'],{'as':_0xf878('0x157'),'foreignKey':_0xf878('0x158')});db[_0xf878('0x3f')][_0xf878('0x116')](db[_0xf878('0xf')],{'as':'Owner','foreignKey':_0xf878('0x10d')});db[_0xf878('0x3f')]['belongsToMany'](db[_0xf878('0x85')],{'through':_0xf878('0x162'),'as':_0xf878('0x163')});db[_0xf878('0x3f')][_0xf878('0x119')](db[_0xf878('0x85')],{'through':'mail_interaction_has_tags','as':_0xf878('0x164')});db[_0xf878('0x3f')]['belongsToMany'](db[_0xf878('0xf')],{'as':_0xf878('0x165'),'through':'user_has_mail_interactions','foreignKey':_0xf878('0x166')});db['MailMessage'][_0xf878('0x10e')](db[_0xf878('0xe4')],{'as':_0xf878('0x167'),'onDelete':_0xf878('0x10c')});db['MailMessage'][_0xf878('0x116')](db['User'],{'as':_0xf878('0xf')});db[_0xf878('0x15d')]['belongsTo'](db['CmContact'],{'onDelete':_0xf878('0x10c'),'as':'Contact'});db[_0xf878('0x15d')]['belongsTo'](db['MailInteraction'],{'as':'Interaction','foreignKey':_0xf878('0x166')});db[_0xf878('0x15d')]['belongsTo'](db['MailAccount'],{'as':'Account','foreignKey':_0xf878('0x159')});db['MailMessage'][_0xf878('0x116')](db[_0xf878('0x5d')],{'as':_0xf878('0x5d'),'foreignKey':_0xf878('0x168')});db[_0xf878('0x15d')][_0xf878('0x116')](db['ChatOfflineMessage'],{'as':_0xf878('0x63'),'foreignKey':_0xf878('0x169')});db[_0xf878('0x41')]['belongsTo'](db[_0xf878('0xf')],{'onDelete':_0xf878('0x16a')});db[_0xf878('0x41')][_0xf878('0x116')](db['MailQueue'],{'onDelete':_0xf878('0x16a')});db[_0xf878('0x41')][_0xf878('0x116')](db[_0xf878('0x39')],{'onDelete':'restrict'});db[_0xf878('0x41')][_0xf878('0x116')](db[_0xf878('0x7c')],{'onDelete':'restrict','foreignKey':_0xf878('0x148')});db['MailApplication'][_0xf878('0x116')](db[_0xf878('0x85')],{'onDelete':_0xf878('0x16a'),'foreignKey':_0xf878('0x16b')});db[_0xf878('0x43')][_0xf878('0x116')](db[_0xf878('0x39')],{});db[_0xf878('0x43')]['belongsTo'](db[_0xf878('0xf1')],{'as':_0xf878('0x15e'),'foreignKey':_0xf878('0x15f')});db[_0xf878('0x43')][_0xf878('0x116')](db[_0xf878('0x6a')],{'as':_0xf878('0x157'),'foreignKey':'ContactId'});db[_0xf878('0x43')][_0xf878('0x116')](db[_0xf878('0x3f')],{});db['MailQueueReport'][_0xf878('0x116')](db[_0xf878('0x15d')],{});db[_0xf878('0x43')][_0xf878('0x116')](db[_0xf878('0xf')],{});db[_0xf878('0x43')][_0xf878('0x116')](db[_0xf878('0x3b')],{});db[_0xf878('0x44')][_0xf878('0x10e')](db[_0xf878('0x45')],{'as':'Items','onDelete':'cascade'});db[_0xf878('0x47')][_0xf878('0x10e')](db[_0xf878('0x78')],{'as':_0xf878('0x15c'),'foreignKey':_0xf878('0x16c'),'onDelete':_0xf878('0x10c')});db[_0xf878('0x47')][_0xf878('0x10e')](db[_0xf878('0x76')],{'as':_0xf878('0x16d'),'foreignKey':'FaxAccountId'});db['FaxAccount'][_0xf878('0x10e')](db['FaxInteraction'],{'as':_0xf878('0x16e')});db[_0xf878('0x47')][_0xf878('0x10e')](db['FaxApplication'],{'as':_0xf878('0x13b')});db[_0xf878('0x47')][_0xf878('0x10e')](db[_0xf878('0x16')],{'as':'Exntensions','onDelete':_0xf878('0x10c')});db['FaxAccount'][_0xf878('0x10e')](db[_0xf878('0x16f')],{'as':_0xf878('0x150')});db[_0xf878('0x47')][_0xf878('0x116')](db['Trunk'],{'as':_0xf878('0x144')});db['FaxAccount'][_0xf878('0x116')](db[_0xf878('0xf1')],{'as':'List','foreignKey':'ListId'});db['FaxAccount'][_0xf878('0x116')](db[_0xf878('0x7d')],{'as':_0xf878('0x149'),'foreignKey':_0xf878('0x14a')});db[_0xf878('0x47')][_0xf878('0x119')](db[_0xf878('0xf')],{'as':'Agents','through':_0xf878('0x131')});db[_0xf878('0x49')][_0xf878('0x116')](db[_0xf878('0xf')],{'onDelete':_0xf878('0x16a')});db['FaxApplication'][_0xf878('0x116')](db['FaxQueue'],{'onDelete':_0xf878('0x16a')});db['FaxApplication'][_0xf878('0x116')](db[_0xf878('0x47')],{'onDelete':_0xf878('0x16a')});db[_0xf878('0x49')][_0xf878('0x116')](db[_0xf878('0x85')],{'onDelete':_0xf878('0x16a'),'foreignKey':_0xf878('0x16b')});db['FaxInteraction']['hasMany'](db[_0xf878('0x16f')],{'as':_0xf878('0x150'),'onDelete':_0xf878('0x10c'),'foreignKey':'FaxInteractionId'});db[_0xf878('0x4b')][_0xf878('0x116')](db[_0xf878('0x47')],{'as':_0xf878('0x161'),'foreignKey':_0xf878('0x16c')});db[_0xf878('0x4b')][_0xf878('0x116')](db[_0xf878('0x6a')],{'as':_0xf878('0x157'),'foreignKey':_0xf878('0x158')});db[_0xf878('0x4b')][_0xf878('0x116')](db['User'],{'as':_0xf878('0x170'),'foreignKey':_0xf878('0x10d')});db[_0xf878('0x4b')][_0xf878('0x119')](db[_0xf878('0x85')],{'through':_0xf878('0x171'),'as':_0xf878('0x163')});db[_0xf878('0x4b')]['belongsToMany'](db[_0xf878('0x85')],{'through':_0xf878('0x171'),'as':'ThroughTags'});db[_0xf878('0x4b')][_0xf878('0x119')](db[_0xf878('0xf')],{'as':'Users','through':_0xf878('0x124'),'foreignKey':_0xf878('0x172')});db[_0xf878('0x16f')][_0xf878('0x116')](db[_0xf878('0xf')],{'onDelete':_0xf878('0x10c'),'as':_0xf878('0xf')});db[_0xf878('0x16f')][_0xf878('0x116')](db[_0xf878('0x4b')],{'as':_0xf878('0x173'),'foreignKey':_0xf878('0x172')});db[_0xf878('0x16f')][_0xf878('0x116')](db[_0xf878('0x6a')],{'onDelete':_0xf878('0x10c'),'as':_0xf878('0x157')});db[_0xf878('0x16f')]['belongsTo'](db['Attachment'],{'as':'Attachment','foreignKey':_0xf878('0x174')});db[_0xf878('0x16f')][_0xf878('0x116')](db[_0xf878('0x47')],{'as':'Account','foreignKey':_0xf878('0x16c')});db['FaxQueue'][_0xf878('0x119')](db['User'],{'as':_0xf878('0x14b'),'through':'UserFaxQueue'});db['FaxQueue']['belongsToMany'](db['Team'],{'through':_0xf878('0x175'),'as':_0xf878('0x14c')});db[_0xf878('0x50')]['belongsTo'](db['FaxAccount'],{});db[_0xf878('0x50')]['belongsTo'](db[_0xf878('0xf1')],{'as':_0xf878('0x15e'),'foreignKey':_0xf878('0x15f')});db[_0xf878('0x50')][_0xf878('0x116')](db['CmContact'],{'as':'Contact','foreignKey':_0xf878('0x158')});db[_0xf878('0x50')][_0xf878('0x116')](db[_0xf878('0x4b')],{});db[_0xf878('0x50')][_0xf878('0x116')](db['FaxMessage'],{});db[_0xf878('0x50')][_0xf878('0x116')](db[_0xf878('0xf')],{});db[_0xf878('0x50')][_0xf878('0x116')](db['FaxQueue'],{});db['SmsAccount']['hasMany'](db[_0xf878('0x78')],{'as':_0xf878('0x15c'),'foreignKey':_0xf878('0x176'),'onDelete':_0xf878('0x10c')});db['SmsAccount'][_0xf878('0x10e')](db[_0xf878('0x76')],{'as':'Answers','foreignKey':_0xf878('0x176')});db[_0xf878('0x51')][_0xf878('0x10e')](db['SmsMessage'],{'as':'Messages','foreignKey':_0xf878('0x176')});db[_0xf878('0x51')][_0xf878('0x10e')](db[_0xf878('0x125')],{'as':'Interactions'});db[_0xf878('0x51')]['hasMany'](db[_0xf878('0x177')],{'as':_0xf878('0x13b')});db['SmsAccount'][_0xf878('0x116')](db[_0xf878('0xf1')],{'as':_0xf878('0x15e'),'foreignKey':_0xf878('0x15f')});db[_0xf878('0x51')]['belongsTo'](db[_0xf878('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0xf878('0x14a')});db[_0xf878('0x51')][_0xf878('0x119')](db['User'],{'as':_0xf878('0x14b'),'through':_0xf878('0x135')});db[_0xf878('0x177')][_0xf878('0x116')](db[_0xf878('0xf')],{'onDelete':_0xf878('0x16a')});db[_0xf878('0x177')]['belongsTo'](db[_0xf878('0x55')],{'onDelete':_0xf878('0x16a')});db['SmsApplication'][_0xf878('0x116')](db['SmsAccount'],{'onDelete':_0xf878('0x16a')});db['SmsApplication'][_0xf878('0x116')](db[_0xf878('0x7c')],{'onDelete':_0xf878('0x16a'),'foreignKey':_0xf878('0x148')});db[_0xf878('0x177')]['belongsTo'](db[_0xf878('0x85')],{'onDelete':_0xf878('0x16a'),'foreignKey':'TagId'});db[_0xf878('0x125')]['hasMany'](db['SmsMessage'],{'as':_0xf878('0x150'),'onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x178')});db[_0xf878('0x125')][_0xf878('0x116')](db[_0xf878('0x51')],{'as':'Account','foreignKey':_0xf878('0x176')});db['SmsInteraction'][_0xf878('0x116')](db[_0xf878('0x6a')],{'as':'Contact','foreignKey':_0xf878('0x158')});db[_0xf878('0x125')][_0xf878('0x116')](db[_0xf878('0xf')],{'as':_0xf878('0x170'),'foreignKey':_0xf878('0x10d')});db[_0xf878('0x125')][_0xf878('0x119')](db[_0xf878('0x85')],{'through':_0xf878('0x179'),'as':_0xf878('0x163')});db[_0xf878('0x125')][_0xf878('0x119')](db[_0xf878('0x85')],{'through':'sms_interaction_has_tags','as':_0xf878('0x164')});db[_0xf878('0x125')][_0xf878('0x119')](db['User'],{'as':_0xf878('0x165'),'through':'user_has_sms_interactions','foreignKey':_0xf878('0x178')});db[_0xf878('0x53')][_0xf878('0x116')](db[_0xf878('0xf')],{'as':_0xf878('0xf')});db['SmsMessage'][_0xf878('0x116')](db[_0xf878('0x6a')],{'onDelete':'cascade','as':'Contact'});db[_0xf878('0x53')]['belongsTo'](db[_0xf878('0x125')],{'onDelete':_0xf878('0x10c'),'as':_0xf878('0x173'),'foreignKey':_0xf878('0x178')});db[_0xf878('0x53')][_0xf878('0x116')](db[_0xf878('0x51')],{'as':_0xf878('0x161'),'foreignKey':'SmsAccountId'});db['SmsQueue']['belongsToMany'](db[_0xf878('0xf')],{'as':_0xf878('0x14b'),'through':_0xf878('0x12d'),'foreignKey':_0xf878('0x17a')});db[_0xf878('0x55')][_0xf878('0x119')](db[_0xf878('0xdf')],{'through':_0xf878('0x17b'),'as':_0xf878('0x14c')});db[_0xf878('0x57')]['hasMany'](db[_0xf878('0x78')],{'as':_0xf878('0x15c'),'foreignKey':_0xf878('0x17c'),'onDelete':_0xf878('0x10c')});db[_0xf878('0x57')][_0xf878('0x10e')](db[_0xf878('0x76')],{'as':_0xf878('0x16d'),'foreignKey':'OpenchannelAccountId'});db[_0xf878('0x57')]['hasMany'](db[_0xf878('0x110')],{'as':_0xf878('0x16e'),'foreignKey':_0xf878('0x17c')});db['OpenchannelAccount']['hasMany'](db['OpenchannelMessage'],{'as':_0xf878('0x150'),'foreignKey':_0xf878('0x17c')});db[_0xf878('0x57')][_0xf878('0x10e')](db[_0xf878('0x17d')],{'as':'Applications','foreignKey':_0xf878('0x17c')});db[_0xf878('0x57')][_0xf878('0x116')](db['CmList'],{'as':'List','foreignKey':_0xf878('0x15f')});db[_0xf878('0x57')][_0xf878('0x116')](db[_0xf878('0x7d')],{'as':_0xf878('0x149'),'foreignKey':_0xf878('0x14a')});db[_0xf878('0x57')][_0xf878('0x119')](db[_0xf878('0xf')],{'as':_0xf878('0x14b'),'through':'user_has_openchannel_accounts'});db[_0xf878('0x17d')][_0xf878('0x116')](db[_0xf878('0xf')],{'onDelete':_0xf878('0x16a')});db['OpenchannelApplication'][_0xf878('0x116')](db[_0xf878('0x5c')],{'onDelete':_0xf878('0x16a'),'foreignKey':_0xf878('0x17e')});db[_0xf878('0x17d')][_0xf878('0x116')](db[_0xf878('0x57')],{'onDelete':_0xf878('0x16a'),'foreignKey':_0xf878('0x17c')});db['OpenchannelApplication'][_0xf878('0x116')](db[_0xf878('0x7c')],{'onDelete':_0xf878('0x16a'),'foreignKey':_0xf878('0x148')});db['OpenchannelApplication'][_0xf878('0x116')](db[_0xf878('0x85')],{'onDelete':_0xf878('0x16a'),'foreignKey':_0xf878('0x16b')});db[_0xf878('0x110')][_0xf878('0x10e')](db[_0xf878('0x5b')],{'as':_0xf878('0x150'),'onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x17f')});db[_0xf878('0x110')][_0xf878('0x116')](db[_0xf878('0x57')],{'as':_0xf878('0x161'),'foreignKey':'OpenchannelAccountId'});db[_0xf878('0x110')][_0xf878('0x116')](db[_0xf878('0x6a')],{'as':_0xf878('0x157'),'foreignKey':_0xf878('0x158')});db[_0xf878('0x110')][_0xf878('0x116')](db['User'],{'as':_0xf878('0x170'),'foreignKey':'UserId'});db[_0xf878('0x110')][_0xf878('0x119')](db[_0xf878('0x85')],{'through':_0xf878('0x180'),'as':_0xf878('0x163')});db[_0xf878('0x110')][_0xf878('0x119')](db['Tag'],{'through':_0xf878('0x180'),'as':_0xf878('0x164')});db[_0xf878('0x110')][_0xf878('0x119')](db[_0xf878('0xf')],{'as':_0xf878('0x165'),'through':_0xf878('0x126'),'foreignKey':_0xf878('0x17f')});db[_0xf878('0x5b')][_0xf878('0x116')](db[_0xf878('0xf')],{'onDelete':_0xf878('0x10c'),'as':_0xf878('0xf')});db[_0xf878('0x5b')][_0xf878('0x116')](db[_0xf878('0x6a')],{'onDelete':_0xf878('0x10c'),'as':'Contact'});db[_0xf878('0x5b')]['belongsTo'](db[_0xf878('0x110')],{'onDelete':'cascade','as':_0xf878('0x173'),'foreignKey':_0xf878('0x17f')});db[_0xf878('0x5b')][_0xf878('0x116')](db['Attachment'],{'as':'Attachment','foreignKey':_0xf878('0x174')});db['OpenchannelMessage'][_0xf878('0x116')](db[_0xf878('0x57')],{'as':_0xf878('0x161'),'foreignKey':_0xf878('0x17c')});db[_0xf878('0x5c')]['belongsToMany'](db['User'],{'as':'Agents','through':_0xf878('0x35'),'foreignKey':'OpenchannelQueueId'});db[_0xf878('0x5c')][_0xf878('0x119')](db[_0xf878('0xdf')],{'through':_0xf878('0x181'),'as':'Teams'});db['ChatWebsite'][_0xf878('0x10e')](db[_0xf878('0x78')],{'as':_0xf878('0x15c'),'foreignKey':_0xf878('0x168'),'onDelete':_0xf878('0x10c')});db['ChatWebsite'][_0xf878('0x10e')](db[_0xf878('0x76')],{'as':_0xf878('0x16d'),'foreignKey':_0xf878('0x168')});db[_0xf878('0x5d')]['hasMany'](db[_0xf878('0x68')],{'as':_0xf878('0x182')});db[_0xf878('0x5d')][_0xf878('0x10e')](db[_0xf878('0x61')],{'as':_0xf878('0x16e')});db[_0xf878('0x5d')][_0xf878('0x10e')](db[_0xf878('0x183')],{'as':_0xf878('0x13b')});db['ChatWebsite'][_0xf878('0x10e')](db[_0xf878('0x62')],{'as':_0xf878('0x150')});db['ChatWebsite'][_0xf878('0x116')](db[_0xf878('0xf1')],{'as':_0xf878('0x15e'),'foreignKey':'ListId'});db[_0xf878('0x5d')][_0xf878('0x116')](db['Interval'],{'as':'Interval','foreignKey':_0xf878('0x148')});db[_0xf878('0x5d')]['belongsTo'](db[_0xf878('0x39')],{'as':_0xf878('0x39'),'foreignKey':_0xf878('0x159')});db['ChatWebsite'][_0xf878('0x116')](db['Pause'],{'as':_0xf878('0x149'),'foreignKey':_0xf878('0x14a')});db[_0xf878('0x5d')]['belongsToMany'](db['User'],{'as':_0xf878('0x14b'),'through':'user_has_chat_websites'});db[_0xf878('0x184')][_0xf878('0x116')](db[_0xf878('0x57')],{});db[_0xf878('0x184')][_0xf878('0x116')](db[_0xf878('0xf1')],{'as':'List','foreignKey':'ListId'});db[_0xf878('0x184')][_0xf878('0x116')](db[_0xf878('0x6a')],{'as':_0xf878('0x157'),'foreignKey':_0xf878('0x158')});db[_0xf878('0x184')]['belongsTo'](db[_0xf878('0x110')],{});db[_0xf878('0x184')][_0xf878('0x116')](db['OpenchannelMessage'],{});db['OpenchannelQueueReport'][_0xf878('0x116')](db[_0xf878('0xf')],{});db[_0xf878('0x184')][_0xf878('0x116')](db[_0xf878('0x5c')],{});db[_0xf878('0x183')][_0xf878('0x116')](db['User'],{'as':_0xf878('0x185'),'foreignKey':'UserId','onDelete':'restrict'});db[_0xf878('0x183')][_0xf878('0x116')](db[_0xf878('0x65')],{'as':'Queue','foreignKey':_0xf878('0x186'),'onDelete':'restrict'});db[_0xf878('0x183')][_0xf878('0x116')](db[_0xf878('0x5d')],{'as':'Website','foreignKey':'ChatWebsiteId','onDelete':'restrict'});db[_0xf878('0x183')]['belongsTo'](db[_0xf878('0x85')],{'onDelete':_0xf878('0x16a'),'foreignKey':_0xf878('0x16b')});db[_0xf878('0x61')][_0xf878('0x10e')](db['ChatMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0xf878('0x187')});db[_0xf878('0x61')][_0xf878('0x116')](db[_0xf878('0x5d')],{'as':'Account','foreignKey':_0xf878('0x168')});db[_0xf878('0x61')]['belongsTo'](db['CmContact'],{'as':_0xf878('0x157'),'foreignKey':'ContactId'});db['ChatInteraction']['belongsTo'](db[_0xf878('0xf')],{'as':_0xf878('0x170'),'foreignKey':'UserId'});db[_0xf878('0x61')]['belongsToMany'](db['Tag'],{'through':_0xf878('0x188'),'as':_0xf878('0x163')});db[_0xf878('0x61')][_0xf878('0x119')](db[_0xf878('0x85')],{'through':_0xf878('0x188'),'as':_0xf878('0x164')});db[_0xf878('0x61')]['belongsToMany'](db[_0xf878('0xf')],{'as':_0xf878('0x165'),'through':_0xf878('0x122'),'foreignKey':'ChatInteractionId'});db[_0xf878('0x62')][_0xf878('0x116')](db['User'],{'onDelete':_0xf878('0x10c'),'as':_0xf878('0xf')});db[_0xf878('0x62')]['belongsTo'](db['CmContact'],{'onDelete':_0xf878('0x10c'),'as':_0xf878('0x157'),'foreignKey':_0xf878('0x158')});db[_0xf878('0x62')][_0xf878('0x116')](db[_0xf878('0x61')],{'onDelete':_0xf878('0x10c'),'as':_0xf878('0x173'),'foreignKey':_0xf878('0x187')});db['ChatMessage'][_0xf878('0x116')](db[_0xf878('0xe4')],{'as':_0xf878('0xe4'),'foreignKey':_0xf878('0x174')});db[_0xf878('0x62')][_0xf878('0x116')](db[_0xf878('0x5d')],{'as':_0xf878('0x161'),'foreignKey':_0xf878('0x168')});db[_0xf878('0x63')][_0xf878('0x10e')](db['Attachment'],{'as':_0xf878('0x167'),'foreignKey':'ChatOfflineMessageId','onDelete':_0xf878('0x10c'),'hooks':!![]});db[_0xf878('0x63')][_0xf878('0x116')](db['CmContact'],{'onDelete':_0xf878('0x10c'),'as':'Contact','foreignKey':_0xf878('0x158')});db[_0xf878('0x63')][_0xf878('0x116')](db['ChatWebsite'],{'as':_0xf878('0x161'),'foreignKey':_0xf878('0x168')});db[_0xf878('0x65')]['belongsToMany'](db['User'],{'as':'Agents','through':_0xf878('0x2f'),'hooks':!![]});db[_0xf878('0x65')][_0xf878('0x119')](db['Team'],{'through':_0xf878('0x189'),'as':_0xf878('0x14c')});db[_0xf878('0x66')][_0xf878('0x10e')](db[_0xf878('0xcb')],{'as':_0xf878('0x150'),'foreignKey':_0xf878('0x18a'),'onDelete':'cascade'});db['ChatGroup'][_0xf878('0x119')](db[_0xf878('0xf')],{'as':_0xf878('0x13e'),'through':_0xf878('0x11b')});db['ChatProactiveAction']['belongsTo'](db[_0xf878('0x5d')],{'as':'Website','foreignKey':'ChatWebsiteId'});db[_0xf878('0x18b')][_0xf878('0x10e')](db[_0xf878('0x6a')],{'as':_0xf878('0x11c'),'foreignKey':_0xf878('0x18c')});db[_0xf878('0x6a')]['hasMany'](db[_0xf878('0x6c')],{'as':_0xf878('0x140'),'foreignKey':_0xf878('0x158')});db[_0xf878('0x6a')][_0xf878('0x10e')](db[_0xf878('0x6e')],{'as':'HopperFinals','foreignKey':_0xf878('0x158')});db[_0xf878('0x6a')]['hasMany'](db['CmHopperHistory'],{'as':_0xf878('0x141'),'foreignKey':_0xf878('0x158')});db[_0xf878('0x6a')][_0xf878('0x10e')](db[_0xf878('0x72')],{'as':_0xf878('0x72'),'foreignKey':_0xf878('0x158')});db[_0xf878('0x6a')]['hasMany'](db[_0xf878('0xd1')],{'as':'JscriptySessions','foreignKey':_0xf878('0x158')});db[_0xf878('0x6a')]['hasMany'](db[_0xf878('0x110')],{'as':_0xf878('0x111'),'foreignKey':_0xf878('0x158'),'onDelete':'restrict'});db[_0xf878('0x6a')][_0xf878('0x10e')](db[_0xf878('0x61')],{'as':_0xf878('0x121'),'foreignKey':_0xf878('0x158'),'onDelete':'restrict'});db[_0xf878('0x6a')][_0xf878('0x10e')](db[_0xf878('0x125')],{'as':_0xf878('0x112'),'foreignKey':_0xf878('0x158'),'onDelete':_0xf878('0x16a')});db[_0xf878('0x6a')][_0xf878('0x10e')](db[_0xf878('0x4b')],{'as':_0xf878('0x123'),'foreignKey':_0xf878('0x158'),'onDelete':'restrict'});db[_0xf878('0x6a')][_0xf878('0x10e')](db[_0xf878('0x3f')],{'as':'MailInteractions','foreignKey':_0xf878('0x158'),'onDelete':'restrict'});db[_0xf878('0x6a')][_0xf878('0x116')](db[_0xf878('0x18b')],{'as':'Company','foreignKey':'CompanyId'});db['CmContact'][_0xf878('0x116')](db[_0xf878('0xf1')],{'as':_0xf878('0x15e'),'foreignKey':_0xf878('0x15f'),'onDelete':_0xf878('0x10c')});db[_0xf878('0x6a')]['belongsToMany'](db[_0xf878('0xf')],{'as':_0xf878('0x165'),'through':'cm_user_has_contacts'});db['CmContact'][_0xf878('0x119')](db['Tag'],{'as':'Tags','through':_0xf878('0x18d')});db['CmContact'][_0xf878('0x119')](db['Tag'],{'through':_0xf878('0x18d'),'as':_0xf878('0x164')});db[_0xf878('0x6c')][_0xf878('0x116')](db[_0xf878('0x6a')],{'as':_0xf878('0x157'),'foreignKey':_0xf878('0x158'),'onDelete':_0xf878('0x10c')});db[_0xf878('0x6c')]['belongsTo'](db[_0xf878('0xf1')],{'as':_0xf878('0x15e'),'foreignKey':_0xf878('0x15f'),'onDelete':_0xf878('0x10c')});db['CmHopper'][_0xf878('0x116')](db[_0xf878('0xf')],{'as':'Agent','foreignKey':'UserId'});db[_0xf878('0x6c')][_0xf878('0x116')](db[_0xf878('0x1a')],{'as':'Queue','foreignKey':_0xf878('0x13f'),'onDelete':_0xf878('0x10c')});db[_0xf878('0x6c')]['belongsTo'](db[_0xf878('0xe1')],{'as':_0xf878('0xe1'),'foreignKey':_0xf878('0x18e'),'onDelete':_0xf878('0x10c')});db['CmHopper'][_0xf878('0x116')](db['User'],{'as':_0xf878('0x170'),'foreignKey':_0xf878('0x18f')});db['CmHopperBlack'][_0xf878('0x116')](db[_0xf878('0x6a')],{'as':_0xf878('0x157'),'foreignKey':_0xf878('0x158'),'onDelete':_0xf878('0x10c')});db[_0xf878('0x6d')][_0xf878('0x116')](db[_0xf878('0xf1')],{'as':_0xf878('0x15e'),'foreignKey':'ListId','onDelete':'cascade'});db[_0xf878('0x6d')][_0xf878('0x116')](db[_0xf878('0x1a')],{'as':_0xf878('0x190'),'foreignKey':_0xf878('0x13f'),'onDelete':_0xf878('0x10c')});db[_0xf878('0x6d')]['belongsTo'](db[_0xf878('0xe1')],{'as':_0xf878('0xe1'),'foreignKey':_0xf878('0x18e'),'onDelete':_0xf878('0x10c')});db[_0xf878('0x191')][_0xf878('0x10e')](db['Condition'],{'as':{'plural':_0xf878('0x192'),'singular':_0xf878('0x193')},'foreignKey':_0xf878('0x194'),'onDelete':_0xf878('0x10c'),'hooks':!![]});db[_0xf878('0x191')][_0xf878('0x10e')](db['Condition'],{'as':{'plural':_0xf878('0x195'),'singular':_0xf878('0x196')},'foreignKey':'AutomationAnyId','onDelete':_0xf878('0x10c'),'hooks':!![]});db[_0xf878('0x191')][_0xf878('0x10e')](db[_0xf878('0x197')],{'as':_0xf878('0x198'),'foreignKey':_0xf878('0x199'),'onDelete':_0xf878('0x10c'),'hooks':!![]});db[_0xf878('0x78')][_0xf878('0x10e')](db[_0xf878('0x78')],{'as':_0xf878('0x15c'),'foreignKey':'ParentId','onDelete':_0xf878('0x10c')});db[_0xf878('0x7c')]['hasMany'](db[_0xf878('0x7c')],{'as':_0xf878('0x19a'),'foreignKey':'IntervalId','onDelete':'cascade','hooks':!![],'required':![]});db[_0xf878('0x7c')]['hasMany'](db['VoiceExtension'],{'as':_0xf878('0x19b'),'foreignKey':_0xf878('0x148'),'onDelete':_0xf878('0x16a')});db[_0xf878('0x7c')][_0xf878('0x10e')](db[_0xf878('0x41')],{'as':'MailApplications','foreignKey':_0xf878('0x148')});db[_0xf878('0x7c')]['hasMany'](db[_0xf878('0x183')],{'as':_0xf878('0x19c'),'foreignKey':'IntervalId'});db[_0xf878('0x7c')][_0xf878('0x10e')](db[_0xf878('0x49')],{'as':_0xf878('0x19d'),'foreignKey':_0xf878('0x148')});db[_0xf878('0x7c')][_0xf878('0x10e')](db['SmsApplication'],{'as':_0xf878('0x19e'),'foreignKey':'IntervalId'});db[_0xf878('0x82')][_0xf878('0x116')](db[_0xf878('0x39')],{});db[_0xf878('0x82')][_0xf878('0x116')](db[_0xf878('0x92')],{'foreignKey':_0xf878('0x19f')});db[_0xf878('0x82')][_0xf878('0x116')](db[_0xf878('0x90')],{'foreignKey':_0xf878('0x1a0')});db[_0xf878('0x1a1')]['belongsToMany'](db[_0xf878('0x18')],{'as':_0xf878('0x1a2'),'through':_0xf878('0x13d'),'onDelete':_0xf878('0x16a')});db[_0xf878('0x85')][_0xf878('0x119')](db[_0xf878('0x6a')],{'through':'cm_contact_has_tags'});db[_0xf878('0x85')][_0xf878('0x119')](db[_0xf878('0x61')],{'through':_0xf878('0x188')});db[_0xf878('0x85')][_0xf878('0x119')](db[_0xf878('0x3f')],{'through':_0xf878('0x162')});db[_0xf878('0x85')][_0xf878('0x119')](db[_0xf878('0x125')],{'through':_0xf878('0x179')});db[_0xf878('0x85')][_0xf878('0x119')](db['FaxInteraction'],{'through':'fax_interaction_has_tags'});db[_0xf878('0x85')][_0xf878('0x119')](db['OpenchannelInteraction'],{'through':'openchannel_interaction_has_tags'});db['Tag']['belongsToMany'](db[_0xf878('0xfd')],{'through':'whatsapp_interaction_has_tags'});db[_0xf878('0x88')]['hasMany'](db[_0xf878('0x7a')],{'as':{'plural':'AllConditions','singular':_0xf878('0x1a3')},'foreignKey':_0xf878('0x1a4'),'onDelete':_0xf878('0x10c'),'hooks':!![]});db[_0xf878('0x88')][_0xf878('0x10e')](db['Condition'],{'as':{'plural':_0xf878('0x1a5'),'singular':_0xf878('0x1a6')},'foreignKey':_0xf878('0x1a7'),'onDelete':_0xf878('0x10c'),'hooks':!![]});db[_0xf878('0x88')][_0xf878('0x10e')](db[_0xf878('0x197')],{'as':_0xf878('0x198'),'foreignKey':_0xf878('0x1a8'),'onDelete':_0xf878('0x10c'),'hooks':!![]});db[_0xf878('0x90')][_0xf878('0x10e')](db[_0xf878('0x1a9')],{'as':'Fields','onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x1a0'),'hooks':!![]});db[_0xf878('0x92')][_0xf878('0x10e')](db[_0xf878('0x1a9')],{'as':_0xf878('0x1aa'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0xf878('0x95')][_0xf878('0x10e')](db[_0xf878('0x1a9')],{'as':'Fields','onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x1ab')});db[_0xf878('0x1a9')]['belongsTo'](db[_0xf878('0x95')],{'foreignKey':'MetricId'});db[_0xf878('0x98')][_0xf878('0x10e')](db['SalesforceConfiguration'],{'as':_0xf878('0x1ac'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xf878('0x1ad')][_0xf878('0x10e')](db[_0xf878('0x9b')],{'as':_0xf878('0x1ae'),'onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x1af')});db[_0xf878('0x1ad')][_0xf878('0x10e')](db['SalesforceField'],{'as':_0xf878('0x1b0'),'onDelete':_0xf878('0x10c'),'foreignKey':'DescriptionId'});db[_0xf878('0x1ad')][_0xf878('0x10e')](db[_0xf878('0x9b')],{'as':_0xf878('0x1aa'),'onDelete':'cascade','foreignKey':_0xf878('0x1b1')});db['SalesforceConfiguration'][_0xf878('0x116')](db[_0xf878('0x98')],{'as':_0xf878('0x161'),'foreignKey':_0xf878('0x1b2')});db[_0xf878('0x9b')][_0xf878('0x10e')](db['SalesforceField'],{'as':_0xf878('0x1b3'),'foreignKey':_0xf878('0x1af')});db[_0xf878('0x9b')][_0xf878('0x10e')](db[_0xf878('0x9b')],{'as':_0xf878('0x1b4'),'foreignKey':_0xf878('0x1b5')});db['SalesforceField']['hasMany'](db['SalesforceField'],{'as':'Field','foreignKey':_0xf878('0x1b1')});db[_0xf878('0x9b')][_0xf878('0x116')](db['Variable'],{'as':_0xf878('0x8a'),'foreignKey':'VariableId'});db[_0xf878('0x1b6')][_0xf878('0x10e')](db[_0xf878('0x9e')],{'as':'Configurations','onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x1b2')});db['SugarcrmConfiguration'][_0xf878('0x10e')](db['SugarcrmField'],{'as':_0xf878('0x1ae'),'onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x1af')});db['SugarcrmConfiguration']['hasMany'](db[_0xf878('0x9f')],{'as':_0xf878('0x1b0'),'onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x1b5')});db[_0xf878('0x9e')][_0xf878('0x10e')](db[_0xf878('0x9f')],{'as':'Fields','onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x1b1')});db[_0xf878('0x9e')][_0xf878('0x116')](db[_0xf878('0x1b6')],{'as':_0xf878('0x161'),'foreignKey':'AccountId'});db[_0xf878('0x9f')][_0xf878('0x10e')](db[_0xf878('0x9f')],{'as':_0xf878('0x1b3'),'foreignKey':_0xf878('0x1af')});db[_0xf878('0x9f')]['hasMany'](db[_0xf878('0x9f')],{'as':_0xf878('0x1b4'),'foreignKey':_0xf878('0x1b5')});db[_0xf878('0x9f')][_0xf878('0x10e')](db[_0xf878('0x9f')],{'as':_0xf878('0x1b7'),'foreignKey':_0xf878('0x1b1')});db[_0xf878('0x9f')][_0xf878('0x116')](db[_0xf878('0x8a')],{'as':'Variable','foreignKey':_0xf878('0x1b8')});db[_0xf878('0xa1')][_0xf878('0x10e')](db[_0xf878('0x1b9')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xf878('0x1b2')});db[_0xf878('0x1b9')][_0xf878('0x10e')](db[_0xf878('0xa4')],{'as':_0xf878('0x1ae'),'onDelete':_0xf878('0x10c'),'foreignKey':'SubjectId'});db[_0xf878('0x1b9')]['hasMany'](db[_0xf878('0xa4')],{'as':_0xf878('0x1b0'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xf878('0x1b9')]['hasMany'](db[_0xf878('0xa4')],{'as':'Fields','onDelete':_0xf878('0x10c'),'foreignKey':'FieldId'});db[_0xf878('0x1b9')][_0xf878('0x116')](db[_0xf878('0xa1')],{'as':_0xf878('0x161'),'foreignKey':_0xf878('0x1b2')});db[_0xf878('0x1b9')][_0xf878('0x119')](db[_0xf878('0x85')],{'through':_0xf878('0x1ba')});db[_0xf878('0xa4')][_0xf878('0x10e')](db['DeskField'],{'as':_0xf878('0x1b3'),'foreignKey':_0xf878('0x1af')});db[_0xf878('0xa4')][_0xf878('0x10e')](db[_0xf878('0xa4')],{'as':_0xf878('0x1b4'),'foreignKey':_0xf878('0x1b5')});db[_0xf878('0xa4')][_0xf878('0x10e')](db[_0xf878('0xa4')],{'as':_0xf878('0x1b7'),'foreignKey':_0xf878('0x1b1')});db[_0xf878('0xa4')][_0xf878('0x116')](db['Variable'],{'as':_0xf878('0x8a'),'foreignKey':'VariableId'});db[_0xf878('0x1bb')][_0xf878('0x10e')](db[_0xf878('0xa7')],{'as':'Configurations','onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x1b2')});db[_0xf878('0xa7')]['hasMany'](db[_0xf878('0xa9')],{'as':_0xf878('0x1ae'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0xf878('0xa7')][_0xf878('0x10e')](db[_0xf878('0xa9')],{'as':_0xf878('0x1b0'),'onDelete':'cascade','foreignKey':_0xf878('0x1b5')});db[_0xf878('0xa7')][_0xf878('0x10e')](db['ZohoField'],{'as':_0xf878('0x1aa'),'onDelete':'cascade','foreignKey':_0xf878('0x1b1')});db[_0xf878('0xa7')]['belongsTo'](db[_0xf878('0x1bb')],{'as':_0xf878('0x161'),'foreignKey':_0xf878('0x1b2')});db[_0xf878('0xa9')]['hasMany'](db[_0xf878('0xa9')],{'as':_0xf878('0x1b3'),'foreignKey':_0xf878('0x1af')});db[_0xf878('0xa9')][_0xf878('0x10e')](db['ZohoField'],{'as':_0xf878('0x1b4'),'foreignKey':'DescriptionId'});db[_0xf878('0xa9')]['hasMany'](db['ZohoField'],{'as':'Field','foreignKey':_0xf878('0x1b1')});db['ZohoField'][_0xf878('0x116')](db['Variable'],{'as':_0xf878('0x8a'),'foreignKey':'VariableId'});db[_0xf878('0xab')][_0xf878('0x10e')](db[_0xf878('0xad')],{'as':_0xf878('0x1ac'),'onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x1b2')});db['ZendeskConfiguration'][_0xf878('0x10e')](db[_0xf878('0xaf')],{'as':_0xf878('0x1ae'),'foreignKey':'SubjectId'});db[_0xf878('0xad')]['hasMany'](db['ZendeskField'],{'as':_0xf878('0x1b0'),'foreignKey':'DescriptionId'});db[_0xf878('0xad')]['hasMany'](db[_0xf878('0xaf')],{'as':_0xf878('0x1aa'),'foreignKey':'FieldId'});db[_0xf878('0xad')][_0xf878('0x116')](db['ZendeskAccount'],{'as':_0xf878('0x161'),'foreignKey':_0xf878('0x1b2')});db[_0xf878('0xad')]['belongsToMany'](db['Tag'],{'through':_0xf878('0x1bc')});db['ZendeskField'][_0xf878('0x10e')](db[_0xf878('0xaf')],{'as':_0xf878('0x1b3'),'foreignKey':_0xf878('0x1af')});db[_0xf878('0xaf')][_0xf878('0x10e')](db[_0xf878('0xaf')],{'as':_0xf878('0x1b4'),'foreignKey':_0xf878('0x1b5')});db[_0xf878('0xaf')][_0xf878('0x10e')](db[_0xf878('0xaf')],{'as':_0xf878('0x1b7'),'foreignKey':_0xf878('0x1b1')});db['ZendeskField'][_0xf878('0x116')](db[_0xf878('0x8a')],{'as':_0xf878('0x8a'),'foreignKey':_0xf878('0x1b8')});db['FreshdeskAccount'][_0xf878('0x10e')](db[_0xf878('0x1bd')],{'as':_0xf878('0x1ac'),'onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x1b2')});db[_0xf878('0x1bd')]['hasMany'](db['FreshdeskField'],{'as':_0xf878('0x1ae'),'onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x1af')});db[_0xf878('0x1bd')][_0xf878('0x10e')](db['FreshdeskField'],{'as':_0xf878('0x1b0'),'onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x1b5')});db[_0xf878('0x1bd')][_0xf878('0x10e')](db['FreshdeskField'],{'as':_0xf878('0x1aa'),'onDelete':_0xf878('0x10c'),'foreignKey':'FieldId'});db[_0xf878('0x1bd')][_0xf878('0x116')](db[_0xf878('0xb1')],{'as':_0xf878('0x161'),'foreignKey':_0xf878('0x1b2')});db[_0xf878('0x1bd')][_0xf878('0x119')](db[_0xf878('0x85')],{'through':_0xf878('0x1be')});db[_0xf878('0x1bf')][_0xf878('0x10e')](db[_0xf878('0x1bf')],{'as':_0xf878('0x1b3'),'foreignKey':_0xf878('0x1af')});db[_0xf878('0x1bf')][_0xf878('0x10e')](db[_0xf878('0x1bf')],{'as':_0xf878('0x1b4'),'foreignKey':'DescriptionId'});db[_0xf878('0x1bf')][_0xf878('0x10e')](db[_0xf878('0x1bf')],{'as':_0xf878('0x1b7'),'foreignKey':_0xf878('0x1b1')});db[_0xf878('0x1bf')][_0xf878('0x116')](db[_0xf878('0x8a')],{'as':_0xf878('0x8a'),'foreignKey':_0xf878('0x1b8')});db[_0xf878('0xb5')][_0xf878('0x10e')](db['VtigerConfiguration'],{'as':'Configurations','onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x1b2')});db[_0xf878('0xb7')][_0xf878('0x10e')](db[_0xf878('0xb9')],{'as':_0xf878('0x1ae'),'foreignKey':_0xf878('0x1af')});db['VtigerConfiguration'][_0xf878('0x10e')](db[_0xf878('0xb9')],{'as':_0xf878('0x1b0'),'foreignKey':_0xf878('0x1b5')});db[_0xf878('0xb7')][_0xf878('0x10e')](db[_0xf878('0xb9')],{'as':'Fields','foreignKey':'FieldId'});db[_0xf878('0xb7')]['belongsTo'](db['VtigerAccount'],{'as':_0xf878('0x161'),'foreignKey':_0xf878('0x1b2')});db['VtigerField'][_0xf878('0x10e')](db[_0xf878('0xb9')],{'as':'Subject','foreignKey':_0xf878('0x1af')});db[_0xf878('0xb9')][_0xf878('0x10e')](db[_0xf878('0xb9')],{'as':_0xf878('0x1b4'),'foreignKey':'DescriptionId'});db[_0xf878('0xb9')][_0xf878('0x10e')](db[_0xf878('0xb9')],{'as':_0xf878('0x1b7'),'foreignKey':'FieldId'});db['VtigerField']['belongsTo'](db[_0xf878('0x8a')],{'as':_0xf878('0x8a'),'foreignKey':'VariableId'});db[_0xf878('0xba')]['hasMany'](db['ServicenowConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0xf878('0xbc')][_0xf878('0x10e')](db[_0xf878('0xbe')],{'as':_0xf878('0x1ae'),'foreignKey':'SubjectId'});db[_0xf878('0xbc')][_0xf878('0x10e')](db['ServicenowField'],{'as':_0xf878('0x1b0'),'foreignKey':'DescriptionId'});db['ServicenowConfiguration']['hasMany'](db[_0xf878('0xbe')],{'as':_0xf878('0x1aa'),'foreignKey':_0xf878('0x1b1')});db['ServicenowConfiguration']['belongsTo'](db['ServicenowAccount'],{'as':_0xf878('0x161'),'foreignKey':'AccountId'});db[_0xf878('0xbe')]['hasMany'](db[_0xf878('0xbe')],{'as':_0xf878('0x1b3'),'foreignKey':_0xf878('0x1af')});db[_0xf878('0xbe')][_0xf878('0x10e')](db[_0xf878('0xbe')],{'as':_0xf878('0x1b4'),'foreignKey':_0xf878('0x1b5')});db['ServicenowField']['hasMany'](db['ServicenowField'],{'as':'Field','foreignKey':_0xf878('0x1b1')});db[_0xf878('0xbe')][_0xf878('0x116')](db['Variable'],{'as':_0xf878('0x8a'),'foreignKey':_0xf878('0x1b8')});db[_0xf878('0xc0')][_0xf878('0x10e')](db[_0xf878('0xc1')],{'as':_0xf878('0x1ac'),'onDelete':'cascade','foreignKey':_0xf878('0x1b2')});db[_0xf878('0xc1')][_0xf878('0x10e')](db[_0xf878('0x1c0')],{'as':_0xf878('0x1ae'),'onDelete':_0xf878('0x10c'),'foreignKey':'SubjectId'});db[_0xf878('0xc1')][_0xf878('0x10e')](db['Dynamics365Field'],{'as':_0xf878('0x1b0'),'onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x1b5')});db[_0xf878('0xc1')][_0xf878('0x10e')](db['Dynamics365Field'],{'as':_0xf878('0x1aa'),'onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x1b1')});db[_0xf878('0xc1')][_0xf878('0x116')](db[_0xf878('0xc0')],{'as':'Account','foreignKey':_0xf878('0x1b2')});db[_0xf878('0x1c0')][_0xf878('0x10e')](db['Dynamics365Field'],{'as':_0xf878('0x1b3'),'foreignKey':'SubjectId'});db['Dynamics365Field'][_0xf878('0x10e')](db[_0xf878('0x1c0')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xf878('0x1c0')][_0xf878('0x10e')](db[_0xf878('0x1c0')],{'as':_0xf878('0x1b7'),'foreignKey':_0xf878('0x1b1')});db[_0xf878('0x1c0')][_0xf878('0x116')](db[_0xf878('0x8a')],{'as':_0xf878('0x8a'),'foreignKey':_0xf878('0x1b8')});db['FreshsalesAccount'][_0xf878('0x10e')](db[_0xf878('0x1c1')],{'as':_0xf878('0x1ac'),'onDelete':_0xf878('0x10c'),'foreignKey':'AccountId'});db[_0xf878('0x1c1')]['hasMany'](db['FreshsalesField'],{'as':_0xf878('0x1ae'),'foreignKey':_0xf878('0x1af')});db[_0xf878('0x1c1')]['hasMany'](db[_0xf878('0xc7')],{'as':'Descriptions','foreignKey':_0xf878('0x1b5')});db[_0xf878('0x1c1')][_0xf878('0x10e')](db[_0xf878('0xc7')],{'as':_0xf878('0x1aa'),'foreignKey':_0xf878('0x1b1')});db[_0xf878('0x1c1')]['belongsTo'](db[_0xf878('0xc4')],{'as':_0xf878('0x161'),'foreignKey':_0xf878('0x1b2')});db[_0xf878('0xc7')]['hasMany'](db[_0xf878('0xc7')],{'as':_0xf878('0x1b3'),'foreignKey':_0xf878('0x1af')});db[_0xf878('0xc7')][_0xf878('0x10e')](db['FreshsalesField'],{'as':_0xf878('0x1b4'),'foreignKey':_0xf878('0x1b5')});db['FreshsalesField'][_0xf878('0x10e')](db[_0xf878('0xc7')],{'as':_0xf878('0x1b7'),'foreignKey':'FieldId'});db['FreshsalesField'][_0xf878('0x116')](db['Variable'],{'as':_0xf878('0x8a'),'foreignKey':_0xf878('0x1b8')});db[_0xf878('0x1c2')][_0xf878('0x116')](db[_0xf878('0x5d')],{});db['ChatQueueReport'][_0xf878('0x116')](db[_0xf878('0xf1')],{'as':_0xf878('0x15e'),'foreignKey':_0xf878('0x15f')});db[_0xf878('0x1c2')]['belongsTo'](db[_0xf878('0x6a')],{'as':'Contact','foreignKey':_0xf878('0x158')});db[_0xf878('0x1c2')][_0xf878('0x116')](db[_0xf878('0x61')],{});db[_0xf878('0x1c2')][_0xf878('0x116')](db['ChatMessage'],{});db[_0xf878('0x1c2')][_0xf878('0x116')](db[_0xf878('0xf')],{});db[_0xf878('0x1c2')]['belongsTo'](db[_0xf878('0x65')],{});db['ChatInternalMessage'][_0xf878('0x116')](db['User'],{'onDelete':_0xf878('0x10c'),'foreignKey':'FromId'});db[_0xf878('0xcb')][_0xf878('0x116')](db['User'],{'onDelete':'cascade','foreignKey':_0xf878('0x1c3')});db[_0xf878('0xd1')][_0xf878('0x10e')](db[_0xf878('0xcf')],{'foreignKey':_0xf878('0x1c4'),'onDelete':'cascade'});db[_0xf878('0xd1')][_0xf878('0x10e')](db[_0xf878('0xcd')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xf878('0xd3')][_0xf878('0x116')](db[_0xf878('0x51')],{});db[_0xf878('0xd3')][_0xf878('0x116')](db[_0xf878('0xf1')],{'as':_0xf878('0x15e'),'foreignKey':_0xf878('0x15f')});db['SmsQueueReport'][_0xf878('0x116')](db['CmContact'],{'as':_0xf878('0x157'),'foreignKey':'ContactId'});db[_0xf878('0xd3')]['belongsTo'](db[_0xf878('0x125')],{});db['SmsQueueReport']['belongsTo'](db[_0xf878('0x53')],{});db[_0xf878('0xd3')][_0xf878('0x116')](db['User'],{});db[_0xf878('0xd3')][_0xf878('0x116')](db[_0xf878('0x55')],{});db[_0xf878('0xd6')][_0xf878('0x10e')](db[_0xf878('0xd1')],{'foreignKey':_0xf878('0x1c5')});db[_0xf878('0xd6')]['hasMany'](db[_0xf878('0xcf')],{'foreignKey':'ProjectId'});db[_0xf878('0xd6')][_0xf878('0x10e')](db[_0xf878('0xcd')],{'foreignKey':_0xf878('0x1c5')});db['SquareProject'][_0xf878('0x119')](db[_0xf878('0xf')],{'as':_0xf878('0x165'),'through':_0xf878('0x139')});db['Team']['belongsToMany'](db['User'],{'as':_0xf878('0x14b'),'through':'user_has_teams'});db[_0xf878('0xdf')][_0xf878('0x119')](db[_0xf878('0x1a')],{'through':_0xf878('0x106'),'as':_0xf878('0x127')});db[_0xf878('0xdf')][_0xf878('0x119')](db[_0xf878('0x3b')],{'through':'team_has_mail_queues','as':_0xf878('0x129')});db[_0xf878('0xdf')][_0xf878('0x119')](db['ChatQueue'],{'through':_0xf878('0x189'),'as':_0xf878('0x12a')});db['Team'][_0xf878('0x119')](db[_0xf878('0x4e')],{'through':'team_has_fax_queues','as':'FaxQueues'});db[_0xf878('0xdf')]['belongsToMany'](db[_0xf878('0x55')],{'through':'team_has_sms_queues','as':'SmsQueues'});db[_0xf878('0xdf')]['belongsToMany'](db[_0xf878('0x5c')],{'through':_0xf878('0x181'),'as':_0xf878('0x12e')});db[_0xf878('0xdf')][_0xf878('0x119')](db[_0xf878('0x105')],{'through':_0xf878('0x1c6'),'as':'WhatsappQueues'});db[_0xf878('0xdf')][_0xf878('0x119')](db[_0xf878('0xf3')],{'through':_0xf878('0x108'),'as':_0xf878('0x128')});db[_0xf878('0xe1')]['hasMany'](db['CmHopper'],{'as':'Hoppers','foreignKey':_0xf878('0x18e')});db['Campaign'][_0xf878('0x10e')](db[_0xf878('0x6e')],{'as':_0xf878('0x10f'),'foreignKey':'CampaignId'});db[_0xf878('0xe1')][_0xf878('0x10e')](db[_0xf878('0x70')],{'as':_0xf878('0x141'),'foreignKey':_0xf878('0x18e')});db[_0xf878('0xe1')]['hasMany'](db['CmHopperBlack'],{'as':_0xf878('0x142'),'foreignKey':_0xf878('0x18e')});db[_0xf878('0xe1')][_0xf878('0x116')](db[_0xf878('0x144')],{'as':_0xf878('0x144'),'foreignKey':_0xf878('0x145')});db[_0xf878('0xe1')][_0xf878('0x116')](db[_0xf878('0x144')],{'as':_0xf878('0x146'),'foreignKey':_0xf878('0x147')});db[_0xf878('0xe1')][_0xf878('0x116')](db[_0xf878('0x7c')],{'as':_0xf878('0x7c'),'foreignKey':_0xf878('0x148')});db['Campaign'][_0xf878('0x116')](db[_0xf878('0xdb')],{'as':'SquareProject','foreignKey':'SquareProjectId'});db[_0xf878('0xe1')][_0xf878('0x119')](db[_0xf878('0xf1')],{'as':_0xf878('0x11d'),'through':'campaigns_has_cm_lists'});db['Campaign'][_0xf878('0x119')](db['CmList'],{'as':_0xf878('0x14d'),'through':_0xf878('0x1c7')});db[_0xf878('0xe4')][_0xf878('0x116')](db[_0xf878('0x63')],{'as':_0xf878('0x63'),'foreignKey':_0xf878('0x169')});db[_0xf878('0xe7')]['belongsTo'](db[_0xf878('0x15d')],{});db[_0xf878('0xe7')][_0xf878('0x116')](db[_0xf878('0x3f')],{});db['MailTransferReport'][_0xf878('0x116')](db[_0xf878('0x39')],{'foreignKey':_0xf878('0x1c8'),'as':_0xf878('0x1c9')});db[_0xf878('0xe7')][_0xf878('0x116')](db['User'],{'foreignKey':'FromUserId','as':_0xf878('0x1ca')});db[_0xf878('0xe7')]['belongsTo'](db[_0xf878('0xf')],{'foreignKey':_0xf878('0x1cb'),'as':_0xf878('0x1cc')});db['MailTransferReport'][_0xf878('0x116')](db['MailQueue'],{'foreignKey':'ToMailQueueId','as':_0xf878('0x1cd')});db['MailTransferReport'][_0xf878('0x116')](db[_0xf878('0x39')],{'foreignKey':'ToMailAccountId','as':_0xf878('0x1ce')});db['ChatTransferReport'][_0xf878('0x116')](db[_0xf878('0x62')],{});db[_0xf878('0xe9')]['belongsTo'](db[_0xf878('0x61')],{});db['ChatTransferReport'][_0xf878('0x116')](db[_0xf878('0x5d')],{'foreignKey':_0xf878('0x1cf'),'as':_0xf878('0x1c9')});db[_0xf878('0xe9')][_0xf878('0x116')](db[_0xf878('0xf')],{'foreignKey':_0xf878('0x1d0'),'as':_0xf878('0x1ca')});db[_0xf878('0xe9')][_0xf878('0x116')](db[_0xf878('0xf')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xf878('0xe9')][_0xf878('0x116')](db[_0xf878('0x65')],{'foreignKey':_0xf878('0x1d1'),'as':_0xf878('0x1cd')});db['ChatTransferReport'][_0xf878('0x116')](db[_0xf878('0x5d')],{'foreignKey':_0xf878('0x1d2'),'as':_0xf878('0x1ce')});db[_0xf878('0xeb')]['belongsTo'](db[_0xf878('0x16f')],{});db[_0xf878('0xeb')]['belongsTo'](db['FaxInteraction'],{});db['FaxTransferReport'][_0xf878('0x116')](db['FaxAccount'],{'foreignKey':_0xf878('0x1d3'),'as':'FromAccount'});db[_0xf878('0xeb')][_0xf878('0x116')](db[_0xf878('0xf')],{'foreignKey':_0xf878('0x1d0'),'as':_0xf878('0x1ca')});db[_0xf878('0xeb')]['belongsTo'](db[_0xf878('0xf')],{'foreignKey':_0xf878('0x1cb'),'as':_0xf878('0x1cc')});db[_0xf878('0xeb')][_0xf878('0x116')](db[_0xf878('0x4e')],{'foreignKey':_0xf878('0x1d4'),'as':'ToQueue'});db['FaxTransferReport'][_0xf878('0x116')](db[_0xf878('0x47')],{'foreignKey':_0xf878('0x1d5'),'as':_0xf878('0x1ce')});db['OpenchannelTransferReport']['belongsTo'](db[_0xf878('0x5b')],{});db[_0xf878('0xed')]['belongsTo'](db[_0xf878('0x110')],{});db[_0xf878('0xed')][_0xf878('0x116')](db[_0xf878('0x57')],{'foreignKey':_0xf878('0x1d6'),'as':_0xf878('0x1c9')});db['OpenchannelTransferReport'][_0xf878('0x116')](db[_0xf878('0xf')],{'foreignKey':_0xf878('0x1d0'),'as':'FromAgent'});db[_0xf878('0xed')][_0xf878('0x116')](db[_0xf878('0xf')],{'foreignKey':_0xf878('0x1cb'),'as':_0xf878('0x1cc')});db[_0xf878('0xed')][_0xf878('0x116')](db[_0xf878('0x5c')],{'foreignKey':'ToOpenchannelQueueId','as':_0xf878('0x1cd')});db[_0xf878('0xed')]['belongsTo'](db[_0xf878('0x57')],{'foreignKey':_0xf878('0x1d7'),'as':_0xf878('0x1ce')});db[_0xf878('0xef')][_0xf878('0x116')](db[_0xf878('0x53')],{});db[_0xf878('0xef')][_0xf878('0x116')](db[_0xf878('0x125')],{});db['SmsTransferReport'][_0xf878('0x116')](db['SmsAccount'],{'foreignKey':_0xf878('0x1d8'),'as':_0xf878('0x1c9')});db[_0xf878('0xef')][_0xf878('0x116')](db[_0xf878('0xf')],{'foreignKey':_0xf878('0x1d0'),'as':_0xf878('0x1ca')});db[_0xf878('0xef')]['belongsTo'](db['User'],{'foreignKey':_0xf878('0x1cb'),'as':_0xf878('0x1cc')});db[_0xf878('0xef')][_0xf878('0x116')](db['SmsQueue'],{'foreignKey':_0xf878('0x1d9'),'as':_0xf878('0x1cd')});db[_0xf878('0xef')][_0xf878('0x116')](db['SmsAccount'],{'foreignKey':_0xf878('0x1da'),'as':_0xf878('0x1ce')});db[_0xf878('0xf1')][_0xf878('0x10e')](db[_0xf878('0x78')],{'as':_0xf878('0x15c'),'foreignKey':_0xf878('0x15f'),'onDelete':'cascade'});db[_0xf878('0xf1')]['hasMany'](db[_0xf878('0x1db')],{'as':_0xf878('0x1dc'),'foreignKey':'ListId'});db[_0xf878('0xf1')]['hasMany'](db[_0xf878('0x6a')],{'as':_0xf878('0x11c'),'onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x15f')});db[_0xf878('0xf1')][_0xf878('0x10e')](db[_0xf878('0x6e')],{'as':_0xf878('0x10f'),'foreignKey':_0xf878('0x15f')});db[_0xf878('0xf1')][_0xf878('0x10e')](db[_0xf878('0x70')],{'as':_0xf878('0x1dd'),'foreignKey':_0xf878('0x15f')});db['CmList']['hasMany'](db[_0xf878('0x72')],{'as':_0xf878('0x72'),'foreignKey':_0xf878('0x15f')});db['CmList'][_0xf878('0x119')](db['VoiceQueue'],{'as':_0xf878('0x1de'),'through':_0xf878('0x1df')});db['CmList'][_0xf878('0x119')](db[_0xf878('0xf')],{'as':_0xf878('0x14b'),'through':_0xf878('0x11e')});db[_0xf878('0xf3')][_0xf878('0x10e')](db[_0xf878('0x16')],{'as':_0xf878('0x19b'),'onDelete':_0xf878('0x10c')});db[_0xf878('0xf3')]['belongsToMany'](db[_0xf878('0xf')],{'as':_0xf878('0x14b'),'through':_0xf878('0x1e0')});db['VoicePrefix']['belongsToMany'](db['Team'],{'through':_0xf878('0x108'),'as':_0xf878('0x14c')});db[_0xf878('0x117')][_0xf878('0x10e')](db[_0xf878('0xf')],{'as':'Users','foreignKey':'userProfileId'});db[_0xf878('0x117')][_0xf878('0x10e')](db[_0xf878('0xf5')],{'as':_0xf878('0x1e1'),'foreignKey':_0xf878('0x118'),'onDelete':_0xf878('0x10c')});db[_0xf878('0xf5')]['hasMany'](db[_0xf878('0xf6')],{'as':_0xf878('0x1e2'),'foreignKey':'sectionId','onDelete':_0xf878('0x10c')});db['WhatsappAccount'][_0xf878('0x10e')](db[_0xf878('0x78')],{'as':_0xf878('0x15c'),'foreignKey':_0xf878('0x1e3'),'onDelete':_0xf878('0x10c')});db[_0xf878('0xfa')]['hasMany'](db[_0xf878('0x76')],{'as':'Answers','foreignKey':_0xf878('0x1e3')});db['WhatsappAccount'][_0xf878('0x10e')](db[_0xf878('0xff')],{'as':'Messages','foreignKey':_0xf878('0x1e3')});db[_0xf878('0xfa')][_0xf878('0x10e')](db['WhatsappInteraction'],{'as':_0xf878('0x16e')});db[_0xf878('0xfa')]['hasMany'](db[_0xf878('0xfc')],{'as':_0xf878('0x13b')});db[_0xf878('0xfa')][_0xf878('0x116')](db[_0xf878('0xf1')],{'as':'List','foreignKey':_0xf878('0x15f')});db[_0xf878('0xfa')]['belongsTo'](db[_0xf878('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0xf878('0x14a')});db[_0xf878('0xfa')][_0xf878('0x119')](db[_0xf878('0xf')],{'as':_0xf878('0x14b'),'through':_0xf878('0x137')});db[_0xf878('0xfc')][_0xf878('0x116')](db[_0xf878('0xf')],{'onDelete':_0xf878('0x16a')});db[_0xf878('0xfc')][_0xf878('0x116')](db[_0xf878('0x105')],{'onDelete':'restrict'});db['WhatsappApplication']['belongsTo'](db[_0xf878('0xfa')],{'onDelete':_0xf878('0x16a')});db[_0xf878('0xfc')]['belongsTo'](db['Interval'],{'onDelete':_0xf878('0x16a'),'foreignKey':_0xf878('0x148')});db[_0xf878('0xfc')][_0xf878('0x116')](db['Tag'],{'onDelete':_0xf878('0x16a'),'foreignKey':'TagId'});db[_0xf878('0xfd')][_0xf878('0x10e')](db['WhatsappMessage'],{'as':_0xf878('0x150'),'onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x1e4')});db[_0xf878('0xfd')][_0xf878('0x116')](db['WhatsappAccount'],{'as':_0xf878('0x161'),'foreignKey':_0xf878('0x1e3')});db[_0xf878('0xfd')][_0xf878('0x116')](db['CmContact'],{'as':_0xf878('0x157'),'foreignKey':_0xf878('0x158')});db[_0xf878('0xfd')][_0xf878('0x116')](db[_0xf878('0xf')],{'as':_0xf878('0x170'),'foreignKey':_0xf878('0x10d')});db[_0xf878('0xfd')]['belongsToMany'](db['Tag'],{'through':_0xf878('0x1e5'),'as':_0xf878('0x163')});db[_0xf878('0xfd')][_0xf878('0x119')](db[_0xf878('0x85')],{'through':_0xf878('0x1e5'),'as':_0xf878('0x164')});db[_0xf878('0xfd')][_0xf878('0x119')](db['User'],{'as':_0xf878('0x165'),'through':'user_has_whatsapp_interactions','foreignKey':_0xf878('0x1e4')});db['WhatsappMessage']['belongsTo'](db[_0xf878('0xf')],{'as':'User'});db['WhatsappMessage']['belongsTo'](db['CmContact'],{'onDelete':_0xf878('0x10c'),'as':_0xf878('0x157')});db[_0xf878('0xff')][_0xf878('0x116')](db['WhatsappInteraction'],{'onDelete':_0xf878('0x10c'),'as':_0xf878('0x173'),'foreignKey':_0xf878('0x1e4')});db[_0xf878('0xff')][_0xf878('0x116')](db['WhatsappAccount'],{'as':'Account','foreignKey':'WhatsappAccountId'});db['WhatsappQueueReport'][_0xf878('0x116')](db[_0xf878('0xfa')],{});db[_0xf878('0x101')][_0xf878('0x116')](db[_0xf878('0xf1')],{'as':_0xf878('0x15e'),'foreignKey':_0xf878('0x15f')});db[_0xf878('0x101')][_0xf878('0x116')](db[_0xf878('0x6a')],{'as':_0xf878('0x157'),'foreignKey':_0xf878('0x158')});db['WhatsappQueueReport'][_0xf878('0x116')](db[_0xf878('0xfd')],{});db['WhatsappQueueReport'][_0xf878('0x116')](db[_0xf878('0x105')],{});db[_0xf878('0x101')][_0xf878('0x116')](db[_0xf878('0xff')],{});db[_0xf878('0x101')][_0xf878('0x116')](db[_0xf878('0xf')],{});db['WhatsappTransferReport'][_0xf878('0x116')](db[_0xf878('0xff')],{});db[_0xf878('0x103')][_0xf878('0x116')](db['WhatsappInteraction'],{});db[_0xf878('0x103')][_0xf878('0x116')](db[_0xf878('0xfa')],{'foreignKey':'FromWhatsappAccountId','as':_0xf878('0x1c9')});db['WhatsappTransferReport']['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0xf878('0x1e6'),'as':_0xf878('0x1ce')});db[_0xf878('0x103')][_0xf878('0x116')](db[_0xf878('0x105')],{'foreignKey':_0xf878('0x1e7'),'as':_0xf878('0x1cd')});db[_0xf878('0x103')][_0xf878('0x116')](db[_0xf878('0xf')],{'foreignKey':'FromUserId','as':_0xf878('0x1ca')});db[_0xf878('0x103')][_0xf878('0x116')](db[_0xf878('0xf')],{'foreignKey':'ToUserId','as':_0xf878('0x1cc')});db[_0xf878('0x105')][_0xf878('0x119')](db['User'],{'as':_0xf878('0x14b'),'through':'UserWhatsappQueue','foreignKey':'WhatsappQueueId'});db[_0xf878('0x105')][_0xf878('0x119')](db[_0xf878('0xdf')],{'through':_0xf878('0x1c6'),'as':'Teams'});module[_0xf878('0x1e8')]={'db':db,'dbH':dbH};
\ No newline at end of file
+var _0xaa88=['ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../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','../api/integration/integration.model','Network','../api/network/network.model','ChatQueueReport','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','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','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','FaxTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','UserId','hasMany','UserVoiceQueueRt','VoiceQueuesRt','Extensions','cascade','CmHopperFinal','HopperFinals','OpenchannelInteractions','ChatInteractions','SmsInteraction','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','userProfileId','chat_group_has_users','CmContact','cm_user_has_contacts','belongsToMany','cm_user_has_lists','user_has_teams','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoicePrefixes','MailQueues','UserMailQueue','ChatQueues','UserSmsQueue','OpenchannelQueues','user_has_chat_websites','MailAccount','MailAccounts','user_has_openchannel_accounts','SmsAccount','user_has_sms_accounts','user_has_whatsapp_accounts','SquareProjects','SpiedAgents','ChanSpyId','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','CmHopperHistory','HopperBlacks','JscriptySessions','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','Agents','Teams','BlackLists','Messages','mailboxuser','VoiceCallReport','VoiceQueueReport','QueueCalls','VoiceAgentReport','uniqueid','Contact','MailServerIn','MailAccountId','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','Applications','List','TemplateId','mandatoryDispositionPauseId','user_has_mail_accounts','team_has_mail_queues','Account','ContactId','Owner','mail_interaction_has_tags','ThroughTags','Users','MailInteractionId','ChatOfflineMessage','ChatOfflineMessageId','restrict','TagId','FaxAccountId','FaxApplication','Exntensions','ListId','user_has_fax_accounts','FaxInteractionId','Tags','fax_interaction_has_tags','Interaction','AttachmentId','SmsAccountId','SmsApplication','sms_interaction_has_tags','SmsInteractionId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','Attachments','ChatGroup','CmCompany','HopperHistories','Company','cm_contact_has_tags','CampaignId','All','OneAll','AutomationAllId','Any','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','AnalyticFieldReport','MetricId','Configurations','SalesforceConfiguration','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','AccountId','Description','VariableId','DeskField','int_desk_configuration_has_tags','Field','ZohoConfiguration','ZendeskField','FreshdeskAccount','VtigerAccount','ServicenowConfiguration','FromId','ToId','SessionId','JscriptyAnswerReport','JscriptyProject','ProjectId','user_has_square_projects','VoiceQueues','team_has_chat_queues','team_has_fax_queues','FaxQueues','SmsQueues','team_has_whatsapp_queues','WhatsappQueues','VoicePrefix','SquareProjectId','Lists','campaigns_has_cm_lists','FromMailAccountId','FromAccount','FromUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatWebsiteId','FromFaxAccountId','ToUserId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','FromAgent','ToOpenchannelQueueId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Contacts','HopperHistory','UserProfileSection','UserProfileSections','Resources','WhatsappAccountId','WhatsappMessage','WhatsappApplication','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','../config/environment','sequelize','lodash','jstz','defaultsDeep','motion2','xcall','xC@LL1234','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','mysql','name','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','VoiceMail','VoiceMailMessage','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserOpenchannelQueue','UserWhatsappQueue','MailServerOut','../api/mailServerOut/mailServerOut.model','MailQueue','../api/mailQueue/mailQueue.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticFieldReport/analyticFieldReport.model','../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','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model'];(function(_0x25cbcf,_0x346a58){var _0x95307a=function(_0x5403a3){while(--_0x5403a3){_0x25cbcf['push'](_0x25cbcf['shift']());}};_0x95307a(++_0x346a58);}(_0xaa88,0x137));var _0x8aa8=function(_0x26bf51,_0x5e261a){_0x26bf51=_0x26bf51-0x0;var _0x503415=_0xaa88[_0x26bf51];return _0x503415;};'use strict';var config=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));var _=require(_0x8aa8('0x2'));var jstz=require(_0x8aa8('0x3'));var timezone=jstz['determine']();config[_0x8aa8('0x1')]=_[_0x8aa8('0x4')](config[_0x8aa8('0x1')],{'database':_0x8aa8('0x5'),'username':_0x8aa8('0x6'),'password':_0x8aa8('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x8aa8('0x8')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x8aa8('0x9'),'collate':_0x8aa8('0xa')}}});config[_0x8aa8('0xb')]=_[_0x8aa8('0x4')](config['sequelizeHistory'],{'database':_0x8aa8('0x5'),'username':_0x8aa8('0x6'),'password':_0x8aa8('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x8aa8('0xc'),'dialectOptions':{'charset':_0x8aa8('0x8')},'logging':![],'timezone':timezone[_0x8aa8('0xd')](),'define':{'charset':_0x8aa8('0x9'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8aa8('0x1')][_0x8aa8('0xe')],config['sequelize'][_0x8aa8('0xf')],config[_0x8aa8('0x1')][_0x8aa8('0x10')],config['sequelize'][_0x8aa8('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8aa8('0xb')][_0x8aa8('0xe')],config['sequelizeHistory'][_0x8aa8('0xf')],config['sequelizeHistory']['password'],config[_0x8aa8('0xb')][_0x8aa8('0x11')])};db[_0x8aa8('0x12')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x14'));db[_0x8aa8('0x15')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/voiceChanSpy/voiceChanSpy.model');db['VoiceContext']=db[_0x8aa8('0x1')]['import']('../api/voiceContext/voiceContext.model');db[_0x8aa8('0x16')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x17'));db[_0x8aa8('0x18')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x19'));db[_0x8aa8('0x1a')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x1b'));db[_0x8aa8('0x1c')]=db['sequelize'][_0x8aa8('0x13')]('../api/voiceRecording/voiceRecording.model');db[_0x8aa8('0x1d')]=db['sequelize'][_0x8aa8('0x13')]('../api/screenRecording/screenRecording.model');db[_0x8aa8('0x1e')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/voiceMail/voiceMail.model');db[_0x8aa8('0x1f')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/voiceMailMessage/voiceMailMessage.model');db['VoiceCallReport']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x20'));db[_0x8aa8('0x21')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x22'));db['VoiceAgentReport']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x23'));db['VoiceQueueReport']=db['sequelize'][_0x8aa8('0x13')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0x8aa8('0x24')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x25'));db[_0x8aa8('0x26')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x27'));db['VoiceTransferReport']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x28'));db['UserVoiceQueueRt']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x29'));db[_0x8aa8('0x2a')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x2b'));db[_0x8aa8('0x2c')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x2d'));db['UserMailQueue']=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x2e'));db[_0x8aa8('0x2f')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x30'));db['UserSmsQueue']=db['sequelize'][_0x8aa8('0x13')]('../api/userSmsQueue/userSmsQueue.model');db[_0x8aa8('0x31')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x8aa8('0x32')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/userWhatsappQueue/userWhatsappQueue.model');db['MailServerIn']=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/mailServerIn/mailServerIn.model');db[_0x8aa8('0x33')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x34'));db['MailAccount']=db['sequelize'][_0x8aa8('0x13')]('../api/mailAccount/mailAccount.model');db[_0x8aa8('0x35')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x36'));db['MailSubstatus']=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/mailSubstatus/mailSubstatus.model');db[_0x8aa8('0x37')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x38'));db[_0x8aa8('0x39')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x3a'));db[_0x8aa8('0x3b')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x3c'));db[_0x8aa8('0x3d')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x3e'));db[_0x8aa8('0x3f')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/dashboard/dashboard.model');db[_0x8aa8('0x40')]=db['sequelize']['import']('../api/dashboardItem/dashboardItem.model');db[_0x8aa8('0x41')]=db['sequelize']['import'](_0x8aa8('0x42'));db['FaxApplication']=db[_0x8aa8('0x1')]['import']('../api/faxApplication/faxApplication.model');db[_0x8aa8('0x43')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x44'));db[_0x8aa8('0x45')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/faxMessage/faxMessage.model');db[_0x8aa8('0x46')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x47'));db[_0x8aa8('0x48')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x49'));db['SmsAccount']=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x4a'));db['SmsApplication']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x4b'));db['SmsInteraction']=db['sequelize']['import']('../api/smsInteraction/smsInteraction.model');db[_0x8aa8('0x4c')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x4d'));db[_0x8aa8('0x4e')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x4f'));db[_0x8aa8('0x50')]=db['sequelize']['import'](_0x8aa8('0x51'));db['OpenchannelApplication']=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x52'));db[_0x8aa8('0x53')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x54'));db[_0x8aa8('0x55')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x56'));db[_0x8aa8('0x57')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/openchannelQueue/openchannelQueue.model');db[_0x8aa8('0x58')]=db['sequelize']['import']('../api/chatWebsite/chatWebsite.model');db[_0x8aa8('0x59')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x5a'));db[_0x8aa8('0x5b')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x5c'));db[_0x8aa8('0x5d')]=db[_0x8aa8('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x8aa8('0x5e')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x5f'));db['ChatOfflineMessage']=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x60'));db[_0x8aa8('0x61')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x62'));db['ChatGroup']=db['sequelize']['import']('../api/chatGroup/chatGroup.model');db[_0x8aa8('0x63')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x64'));db['CmCompany']=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x65'));db['CmContact']=db['sequelize']['import'](_0x8aa8('0x66'));db[_0x8aa8('0x67')]=db['sequelize']['import'](_0x8aa8('0x68'));db[_0x8aa8('0x69')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x6a'));db['CmHopperFinal']=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x6b'));db['CmHopperHistory']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x6c'));db[_0x8aa8('0x6d')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x6e'));db[_0x8aa8('0x6f')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/cmCustomField/cmCustomField.model');db[_0x8aa8('0x70')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x71'));db[_0x8aa8('0x72')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x73'));db[_0x8aa8('0x74')]=db[_0x8aa8('0x1')]['import']('../api/cannedAnswer/cannedAnswer.model');db['Disposition']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x75'));db[_0x8aa8('0x76')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x77'));db[_0x8aa8('0x78')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x79'));db[_0x8aa8('0x7a')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x7b'));db[_0x8aa8('0x7c')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x7d'));db['VoiceQueuesLog']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x7e'));db[_0x8aa8('0x7f')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x80'));db[_0x8aa8('0x81')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x82'));db[_0x8aa8('0x83')]=db['sequelize'][_0x8aa8('0x13')]('../api/tag/tag.model');db[_0x8aa8('0x84')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x85'));db[_0x8aa8('0x86')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x87'));db[_0x8aa8('0x88')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x89'));db[_0x8aa8('0x8a')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/integration/integration.model');db['IntegrationReport']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x8b'));db[_0x8aa8('0x8c')]=db['sequelize']['import']('../api/analyticCustomReport/analyticCustomReport.model');db[_0x8aa8('0x8d')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x8e'));db[_0x8aa8('0x8f')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x90'));db[_0x8aa8('0x91')]=db['sequelize'][_0x8aa8('0x13')]('../api/analyticMetric/analyticMetric.model');db['AnalyticFieldReport']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x92'));db['AnalyticTreeReport']=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x93'));db[_0x8aa8('0x94')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x95'));db['SalesforceConfiguration']=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x96'));db[_0x8aa8('0x97')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x98'));db[_0x8aa8('0x99')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x9a'));db[_0x8aa8('0x9b')]=db['sequelize']['import'](_0x8aa8('0x9c'));db[_0x8aa8('0x9d')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x9e'));db[_0x8aa8('0x9f')]=db['sequelize']['import']('../api/intDeskAccount/intDeskAccount.model');db[_0x8aa8('0xa0')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xa1'));db['DeskField']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xa2'));db[_0x8aa8('0xa3')]=db['sequelize'][_0x8aa8('0x13')]('../api/intZohoAccount/intZohoAccount.model');db['ZohoConfiguration']=db[_0x8aa8('0x1')]['import'](_0x8aa8('0xa4'));db[_0x8aa8('0xa5')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0xa6'));db[_0x8aa8('0xa7')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xa8'));db[_0x8aa8('0xa9')]=db['sequelize']['import'](_0x8aa8('0xaa'));db['ZendeskField']=db['sequelize']['import']('../api/intZendeskField/intZendeskField.model');db['FreshdeskAccount']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xab'));db[_0x8aa8('0xac')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xad'));db[_0x8aa8('0xae')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/intFreshdeskField/intFreshdeskField.model');db['VtigerAccount']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xaf'));db[_0x8aa8('0xb0')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xb1'));db[_0x8aa8('0xb2')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0xb3'));db[_0x8aa8('0xb4')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0xb5'));db['ServicenowConfiguration']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xb6'));db[_0x8aa8('0xb7')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0xb8'));db[_0x8aa8('0xb9')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0xba'));db[_0x8aa8('0xbb')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xbc'));db[_0x8aa8('0xbd')]=db['sequelize'][_0x8aa8('0x13')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x8aa8('0xbe')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xbf'));db[_0x8aa8('0xc0')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0xc1'));db[_0x8aa8('0xc2')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xc3'));db[_0x8aa8('0x8a')]=db['sequelize']['import'](_0x8aa8('0xc4'));db[_0x8aa8('0xc5')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xc6'));db[_0x8aa8('0xc7')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/chatQueueReport/chatQueueReport.model');db[_0x8aa8('0xc8')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0xc9'));db['JscriptyAnswerReport']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xca'));db[_0x8aa8('0xcb')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x8aa8('0xcc')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xcd'));db[_0x8aa8('0xce')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0xcf'));db[_0x8aa8('0xd0')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xd1'));db[_0x8aa8('0xd2')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xd3'));db['JscriptyProject']=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0xd4'));db[_0x8aa8('0xd5')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xd6'));db['SquareOdbc']=db[_0x8aa8('0x1')]['import'](_0x8aa8('0xd7'));db[_0x8aa8('0xd8')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/squareProject/squareProject.model');db[_0x8aa8('0xd9')]=db[_0x8aa8('0x1')]['import']('../api/squareRecording/squareRecording.model');db[_0x8aa8('0xda')]=db['sequelize']['import'](_0x8aa8('0xdb'));db[_0x8aa8('0xdc')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0xdd'));db[_0x8aa8('0xde')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0xdf'));db[_0x8aa8('0xe0')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xe1'));db[_0x8aa8('0xe2')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xe3'));db[_0x8aa8('0xe4')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0xe5'));db[_0x8aa8('0xe6')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0xe7'));db[_0x8aa8('0xe8')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/mailTransferReport/mailTransferReport.model');db[_0x8aa8('0xe9')]=db[_0x8aa8('0x1')]['import']('../api/chatTransferReport/chatTransferReport.model');db[_0x8aa8('0xea')]=db['sequelize'][_0x8aa8('0x13')]('../api/faxTransferReport/faxTransferReport.model');db['OpenchannelTransferReport']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xeb'));db[_0x8aa8('0xec')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0xed'));db[_0x8aa8('0xee')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xef'));db['VoicePrefix']=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0xf0'));db[_0x8aa8('0xf1')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/userProfile/userProfile.model');db['UserProfileSection']=db['sequelize']['import'](_0x8aa8('0xf2'));db[_0x8aa8('0xf3')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0xf4'));db[_0x8aa8('0xf5')]=db['sequelize']['import'](_0x8aa8('0xf6'));db[_0x8aa8('0xf7')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0xf8'));db['WhatsappApplication']=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/whatsappApplication/whatsappApplication.model');db[_0x8aa8('0xf9')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xfa'));db['WhatsappMessage']=db[_0x8aa8('0x1')]['import'](_0x8aa8('0xfb'));db[_0x8aa8('0xfc')]=db[_0x8aa8('0x1')]['import']('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0x8aa8('0xfd')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xfe'));db[_0x8aa8('0xff')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x100'));db[_0x8aa8('0x101')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x102'));db[_0x8aa8('0x103')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x104'));db[_0x8aa8('0x105')]=db['sequelize'][_0x8aa8('0x13')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x8aa8('0x106')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x107'));db[_0x8aa8('0x12')][_0x8aa8('0x108')](db['VoiceMail'],{'as':'VoiceMail','onDelete':'cascade','foreignKey':_0x8aa8('0x109')});db[_0x8aa8('0x12')][_0x8aa8('0x10a')](db[_0x8aa8('0x1c')],{'as':'Recordings','foreignKey':_0x8aa8('0x109')});db[_0x8aa8('0x12')][_0x8aa8('0x10a')](db[_0x8aa8('0x10b')],{'as':_0x8aa8('0x10c'),'foreignKey':'UserId'});db[_0x8aa8('0x12')][_0x8aa8('0x10a')](db[_0x8aa8('0x16')],{'as':_0x8aa8('0x10d'),'onDelete':_0x8aa8('0x10e'),'hooks':!![]});db[_0x8aa8('0x12')]['hasMany'](db[_0x8aa8('0x10f')],{'as':_0x8aa8('0x110'),'foreignKey':'UserId'});db['User'][_0x8aa8('0x10a')](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':'UserId'});db[_0x8aa8('0x12')]['hasMany'](db['ReportAgentPreview'],{'as':_0x8aa8('0x6d'),'foreignKey':_0x8aa8('0x109')});db[_0x8aa8('0x12')][_0x8aa8('0x10a')](db[_0x8aa8('0x53')],{'as':_0x8aa8('0x111'),'foreignKey':_0x8aa8('0x109')});db[_0x8aa8('0x12')]['hasMany'](db[_0x8aa8('0x5d')],{'as':_0x8aa8('0x112'),'foreignKey':_0x8aa8('0x109')});db['User'][_0x8aa8('0x10a')](db[_0x8aa8('0x113')],{'as':_0x8aa8('0x114'),'foreignKey':'UserId'});db[_0x8aa8('0x12')][_0x8aa8('0x10a')](db[_0x8aa8('0x43')],{'as':_0x8aa8('0x115'),'foreignKey':_0x8aa8('0x109')});db['User']['hasMany'](db[_0x8aa8('0x37')],{'as':_0x8aa8('0x116'),'foreignKey':'UserId'});db[_0x8aa8('0x12')][_0x8aa8('0x10a')](db[_0x8aa8('0xf9')],{'as':_0x8aa8('0x117'),'foreignKey':_0x8aa8('0x109')});db[_0x8aa8('0x12')]['hasMany'](db[_0x8aa8('0xf5')],{'as':_0x8aa8('0x118'),'foreignKey':'SenderId'});db[_0x8aa8('0x12')]['belongsTo'](db[_0x8aa8('0xf1')],{'as':_0x8aa8('0xf1'),'foreignKey':_0x8aa8('0x119')});db['User']['belongsToMany'](db['ChatGroup'],{'as':'Groups','through':_0x8aa8('0x11a')});db[_0x8aa8('0x12')]['belongsToMany'](db[_0x8aa8('0x11b')],{'as':'Contacts','through':_0x8aa8('0x11c')});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db[_0x8aa8('0xee')],{'as':'Lists','through':_0x8aa8('0x11e')});db['User'][_0x8aa8('0x11d')](db['Team'],{'through':_0x8aa8('0x11f')});db['User'][_0x8aa8('0x11d')](db[_0x8aa8('0x37')],{'as':'MailInteractions','through':'user_has_mail_interactions'});db['User'][_0x8aa8('0x11d')](db[_0x8aa8('0x5d')],{'as':_0x8aa8('0x112'),'through':_0x8aa8('0x120')});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db[_0x8aa8('0x43')],{'as':'FaxInteractions','through':_0x8aa8('0x121')});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db[_0x8aa8('0x113')],{'as':_0x8aa8('0x114'),'through':_0x8aa8('0x122')});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db[_0x8aa8('0x53')],{'as':_0x8aa8('0x111'),'through':_0x8aa8('0x123')});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db[_0x8aa8('0xf9')],{'as':'WhatsappInteractions','through':_0x8aa8('0x124')});db[_0x8aa8('0x12')]['belongsToMany'](db['VoiceQueue'],{'as':'VoiceQueues','through':_0x8aa8('0x2a'),'required':![]});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db['VoicePrefix'],{'as':_0x8aa8('0x125'),'through':_0x8aa8('0x106'),'required':![]});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db[_0x8aa8('0x35')],{'as':_0x8aa8('0x126'),'through':_0x8aa8('0x127'),'required':![]});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db[_0x8aa8('0x61')],{'as':_0x8aa8('0x128'),'through':_0x8aa8('0x2c'),'required':![],'hooks':!![]});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db[_0x8aa8('0x46')],{'as':'FaxQueues','through':_0x8aa8('0x2f'),'required':![]});db['User'][_0x8aa8('0x11d')](db[_0x8aa8('0x4e')],{'as':'SmsQueues','through':_0x8aa8('0x129'),'required':![]});db['User'][_0x8aa8('0x11d')](db[_0x8aa8('0x57')],{'as':_0x8aa8('0x12a'),'through':'UserOpenchannelQueue','required':![]});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db['WhatsappQueue'],{'as':'WhatsappQueues','through':'UserWhatsappQueue','required':![]});db['User'][_0x8aa8('0x11d')](db[_0x8aa8('0xee')],{'through':_0x8aa8('0x11e')});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db[_0x8aa8('0x58')],{'as':'ChatWebsites','through':_0x8aa8('0x12b')});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db[_0x8aa8('0x41')],{'as':'FaxAccounts','through':'user_has_fax_accounts'});db['User'][_0x8aa8('0x11d')](db[_0x8aa8('0x12c')],{'as':_0x8aa8('0x12d'),'through':'user_has_mail_accounts'});db['User'][_0x8aa8('0x11d')](db[_0x8aa8('0x50')],{'as':'OpenchannelAccounts','through':_0x8aa8('0x12e')});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db[_0x8aa8('0x12f')],{'as':'SmsAccounts','through':_0x8aa8('0x130')});db['User'][_0x8aa8('0x11d')](db[_0x8aa8('0xf7')],{'as':'WhatsappAccounts','through':_0x8aa8('0x131')});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db['SquareProject'],{'as':_0x8aa8('0x132'),'through':'user_has_square_projects'});db[_0x8aa8('0x15')][_0x8aa8('0x10a')](db[_0x8aa8('0x16')],{'as':_0x8aa8('0x133'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x134')});db['VoiceContext'][_0x8aa8('0x10a')](db[_0x8aa8('0x16')],{'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x16')]['hasMany'](db[_0x8aa8('0x16')],{'as':'Applications','onDelete':_0x8aa8('0x10e')});db['VoiceMusicOnHold']['belongsToMany'](db[_0x8aa8('0x81')],{'as':_0x8aa8('0x135'),'through':_0x8aa8('0x136')});db[_0x8aa8('0x1a')][_0x8aa8('0x10a')](db['UserVoiceQueueRt'],{'as':_0x8aa8('0x137'),'foreignKey':_0x8aa8('0x138')});db[_0x8aa8('0x1a')][_0x8aa8('0x10a')](db[_0x8aa8('0x67')],{'as':_0x8aa8('0x139'),'foreignKey':_0x8aa8('0x138')});db[_0x8aa8('0x1a')][_0x8aa8('0x10a')](db[_0x8aa8('0x10f')],{'as':_0x8aa8('0x110'),'foreignKey':'VoiceQueueId'});db[_0x8aa8('0x1a')]['hasMany'](db[_0x8aa8('0x13a')],{'as':'HopperHistories','foreignKey':_0x8aa8('0x138')});db['VoiceQueue'][_0x8aa8('0x10a')](db[_0x8aa8('0x6d')],{'as':_0x8aa8('0x6d'),'foreignKey':_0x8aa8('0x138')});db[_0x8aa8('0x1a')][_0x8aa8('0x10a')](db[_0x8aa8('0x69')],{'as':_0x8aa8('0x13b'),'foreignKey':'VoiceQueueId'});db[_0x8aa8('0x1a')]['hasMany'](db[_0x8aa8('0xcc')],{'as':_0x8aa8('0x13c'),'foreignKey':_0x8aa8('0x138')});db[_0x8aa8('0x1a')][_0x8aa8('0x13d')](db['Trunk'],{'as':_0x8aa8('0x26'),'foreignKey':_0x8aa8('0x13e')});db[_0x8aa8('0x1a')]['belongsTo'](db[_0x8aa8('0x26')],{'as':_0x8aa8('0x13f'),'foreignKey':_0x8aa8('0x140')});db[_0x8aa8('0x1a')][_0x8aa8('0x13d')](db[_0x8aa8('0x78')],{'as':_0x8aa8('0x78'),'foreignKey':_0x8aa8('0x141')});db[_0x8aa8('0x1a')][_0x8aa8('0x13d')](db[_0x8aa8('0x7a')],{'as':_0x8aa8('0x142'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x8aa8('0x1a')]['belongsToMany'](db[_0x8aa8('0xee')],{'as':'Lists','through':_0x8aa8('0x143')});db[_0x8aa8('0x1a')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x144'),'through':_0x8aa8('0x2a')});db['VoiceQueue']['belongsToMany'](db[_0x8aa8('0xdc')],{'as':_0x8aa8('0x145'),'through':_0x8aa8('0x103')});db['VoiceQueue']['belongsToMany'](db[_0x8aa8('0xee')],{'as':_0x8aa8('0x146'),'through':'voice_queues_has_cm_blacklists'});db[_0x8aa8('0x1c')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x12'),'foreignKey':_0x8aa8('0x109')});db[_0x8aa8('0x1d')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x12'),'foreignKey':_0x8aa8('0x109')});db[_0x8aa8('0x1e')][_0x8aa8('0x10a')](db[_0x8aa8('0x1f')],{'as':_0x8aa8('0x147'),'onDelete':'cascade','foreignKey':_0x8aa8('0x148'),'sourceKey':'mailbox'});db[_0x8aa8('0x1f')]['belongsTo'](db['VoiceMail'],{'foreignKey':_0x8aa8('0x148'),'targetKey':'mailbox'});db[_0x8aa8('0x149')][_0x8aa8('0x10a')](db[_0x8aa8('0x14a')],{'as':_0x8aa8('0x14b'),'foreignKey':'uniqueid','constraints':![]});db[_0x8aa8('0x149')]['hasMany'](db[_0x8aa8('0x14c')],{'as':'AgentReports','foreignKey':_0x8aa8('0x14d'),'constraints':![]});db[_0x8aa8('0x149')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x12'),'foreignKey':'UserId'});db[_0x8aa8('0x149')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':_0x8aa8('0x14e'),'foreignKey':'ContactId'});db[_0x8aa8('0x14f')]['belongsTo'](db['MailAccount'],{'as':_0x8aa8('0x12c'),'foreignKey':'MailAccountId'});db[_0x8aa8('0x33')][_0x8aa8('0x13d')](db[_0x8aa8('0x12c')],{'as':_0x8aa8('0x12c'),'foreignKey':_0x8aa8('0x150')});db[_0x8aa8('0x12c')]['hasOne'](db[_0x8aa8('0x14f')],{'as':_0x8aa8('0x151'),'onDelete':'cascade'});db[_0x8aa8('0x12c')][_0x8aa8('0x108')](db[_0x8aa8('0x33')],{'as':_0x8aa8('0x152'),'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x12c')][_0x8aa8('0x10a')](db[_0x8aa8('0x153')],{'as':_0x8aa8('0x154'),'foreignKey':_0x8aa8('0x150'),'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x12c')]['hasMany'](db['CannedAnswer'],{'as':_0x8aa8('0x155'),'foreignKey':_0x8aa8('0x150')});db[_0x8aa8('0x12c')]['hasMany'](db[_0x8aa8('0x39')],{'as':_0x8aa8('0x147'),'foreignKey':_0x8aa8('0x150')});db[_0x8aa8('0x12c')][_0x8aa8('0x10a')](db[_0x8aa8('0x37')],{'as':_0x8aa8('0x156')});db[_0x8aa8('0x12c')]['hasMany'](db[_0x8aa8('0x3b')],{'as':_0x8aa8('0x157')});db['MailAccount'][_0x8aa8('0x13d')](db['CmList'],{'as':_0x8aa8('0x158'),'foreignKey':'ListId'});db['MailAccount'][_0x8aa8('0x13d')](db[_0x8aa8('0x84')],{'as':_0x8aa8('0x84'),'foreignKey':_0x8aa8('0x159')});db['MailAccount'][_0x8aa8('0x13d')](db[_0x8aa8('0x7a')],{'as':_0x8aa8('0x142'),'foreignKey':_0x8aa8('0x15a')});db['MailAccount'][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x144'),'through':_0x8aa8('0x15b')});db[_0x8aa8('0x35')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x144'),'through':_0x8aa8('0x127')});db[_0x8aa8('0x35')]['belongsToMany'](db[_0x8aa8('0xdc')],{'through':_0x8aa8('0x15c'),'as':_0x8aa8('0x145')});db[_0x8aa8('0x37')][_0x8aa8('0x10a')](db[_0x8aa8('0x39')],{'as':'Messages','onDelete':_0x8aa8('0x10e'),'foreignKey':'MailInteractionId'});db[_0x8aa8('0x37')][_0x8aa8('0x13d')](db['MailAccount'],{'as':_0x8aa8('0x15d'),'foreignKey':'MailAccountId'});db[_0x8aa8('0x37')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':'Contact','foreignKey':_0x8aa8('0x15e')});db['MailInteraction']['belongsTo'](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x15f'),'foreignKey':_0x8aa8('0x109')});db[_0x8aa8('0x37')][_0x8aa8('0x11d')](db[_0x8aa8('0x83')],{'through':_0x8aa8('0x160'),'as':'Tags'});db[_0x8aa8('0x37')]['belongsToMany'](db[_0x8aa8('0x83')],{'through':_0x8aa8('0x160'),'as':_0x8aa8('0x161')});db['MailInteraction'][_0x8aa8('0x11d')](db['User'],{'as':_0x8aa8('0x162'),'through':'user_has_mail_interactions','foreignKey':'MailInteractionId'});db[_0x8aa8('0x39')][_0x8aa8('0x10a')](db[_0x8aa8('0xe4')],{'as':'Attachments','onDelete':'cascade'});db['MailMessage']['belongsTo'](db[_0x8aa8('0x12')],{'as':'User'});db[_0x8aa8('0x39')][_0x8aa8('0x13d')](db['CmContact'],{'onDelete':_0x8aa8('0x10e'),'as':_0x8aa8('0x14e')});db['MailMessage'][_0x8aa8('0x13d')](db[_0x8aa8('0x37')],{'as':'Interaction','foreignKey':_0x8aa8('0x163')});db[_0x8aa8('0x39')]['belongsTo'](db[_0x8aa8('0x12c')],{'as':'Account','foreignKey':'MailAccountId'});db['MailMessage'][_0x8aa8('0x13d')](db['ChatWebsite'],{'as':_0x8aa8('0x58'),'foreignKey':'ChatWebsiteId'});db[_0x8aa8('0x39')][_0x8aa8('0x13d')](db[_0x8aa8('0x164')],{'as':_0x8aa8('0x164'),'foreignKey':_0x8aa8('0x165')});db[_0x8aa8('0x3b')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x3b')][_0x8aa8('0x13d')](db[_0x8aa8('0x35')],{'onDelete':'restrict'});db['MailApplication']['belongsTo'](db[_0x8aa8('0x12c')],{'onDelete':_0x8aa8('0x166')});db['MailApplication'][_0x8aa8('0x13d')](db[_0x8aa8('0x78')],{'onDelete':'restrict','foreignKey':_0x8aa8('0x141')});db[_0x8aa8('0x3b')][_0x8aa8('0x13d')](db[_0x8aa8('0x83')],{'onDelete':_0x8aa8('0x166'),'foreignKey':_0x8aa8('0x167')});db[_0x8aa8('0x3d')][_0x8aa8('0x13d')](db[_0x8aa8('0x12c')],{});db[_0x8aa8('0x3d')]['belongsTo'](db[_0x8aa8('0xee')],{'as':_0x8aa8('0x158'),'foreignKey':'ListId'});db[_0x8aa8('0x3d')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':'Contact','foreignKey':_0x8aa8('0x15e')});db['MailQueueReport'][_0x8aa8('0x13d')](db['MailInteraction'],{});db['MailQueueReport'][_0x8aa8('0x13d')](db['MailMessage'],{});db[_0x8aa8('0x3d')]['belongsTo'](db[_0x8aa8('0x12')],{});db[_0x8aa8('0x3d')][_0x8aa8('0x13d')](db[_0x8aa8('0x35')],{});db[_0x8aa8('0x3f')][_0x8aa8('0x10a')](db[_0x8aa8('0x40')],{'as':'Items','onDelete':'cascade'});db[_0x8aa8('0x41')][_0x8aa8('0x10a')](db[_0x8aa8('0x153')],{'as':_0x8aa8('0x154'),'foreignKey':_0x8aa8('0x168'),'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x41')][_0x8aa8('0x10a')](db[_0x8aa8('0x74')],{'as':'Answers','foreignKey':_0x8aa8('0x168')});db[_0x8aa8('0x41')][_0x8aa8('0x10a')](db['FaxInteraction'],{'as':_0x8aa8('0x156')});db[_0x8aa8('0x41')][_0x8aa8('0x10a')](db[_0x8aa8('0x169')],{'as':'Applications'});db[_0x8aa8('0x41')][_0x8aa8('0x10a')](db[_0x8aa8('0x16')],{'as':_0x8aa8('0x16a'),'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x41')][_0x8aa8('0x10a')](db['FaxMessage'],{'as':_0x8aa8('0x147')});db[_0x8aa8('0x41')][_0x8aa8('0x13d')](db[_0x8aa8('0x26')],{'as':_0x8aa8('0x26')});db[_0x8aa8('0x41')][_0x8aa8('0x13d')](db[_0x8aa8('0xee')],{'as':_0x8aa8('0x158'),'foreignKey':_0x8aa8('0x16b')});db[_0x8aa8('0x41')][_0x8aa8('0x13d')](db[_0x8aa8('0x7a')],{'as':_0x8aa8('0x142'),'foreignKey':_0x8aa8('0x15a')});db[_0x8aa8('0x41')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x144'),'through':_0x8aa8('0x16c')});db[_0x8aa8('0x169')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'onDelete':'restrict'});db[_0x8aa8('0x169')]['belongsTo'](db[_0x8aa8('0x46')],{'onDelete':_0x8aa8('0x166')});db['FaxApplication'][_0x8aa8('0x13d')](db[_0x8aa8('0x41')],{'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x169')][_0x8aa8('0x13d')](db[_0x8aa8('0x83')],{'onDelete':_0x8aa8('0x166'),'foreignKey':_0x8aa8('0x167')});db[_0x8aa8('0x43')]['hasMany'](db[_0x8aa8('0x45')],{'as':'Messages','onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x16d')});db['FaxInteraction'][_0x8aa8('0x13d')](db[_0x8aa8('0x41')],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x168')});db['FaxInteraction'][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':_0x8aa8('0x14e'),'foreignKey':_0x8aa8('0x15e')});db[_0x8aa8('0x43')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x15f'),'foreignKey':_0x8aa8('0x109')});db['FaxInteraction']['belongsToMany'](db[_0x8aa8('0x83')],{'through':'fax_interaction_has_tags','as':_0x8aa8('0x16e')});db[_0x8aa8('0x43')][_0x8aa8('0x11d')](db[_0x8aa8('0x83')],{'through':_0x8aa8('0x16f'),'as':_0x8aa8('0x161')});db['FaxInteraction'][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x162'),'through':_0x8aa8('0x121'),'foreignKey':_0x8aa8('0x16d')});db['FaxMessage'][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'onDelete':'cascade','as':_0x8aa8('0x12')});db[_0x8aa8('0x45')]['belongsTo'](db[_0x8aa8('0x43')],{'as':_0x8aa8('0x170'),'foreignKey':_0x8aa8('0x16d')});db[_0x8aa8('0x45')]['belongsTo'](db[_0x8aa8('0x11b')],{'onDelete':_0x8aa8('0x10e'),'as':_0x8aa8('0x14e')});db[_0x8aa8('0x45')][_0x8aa8('0x13d')](db[_0x8aa8('0xe4')],{'as':_0x8aa8('0xe4'),'foreignKey':_0x8aa8('0x171')});db[_0x8aa8('0x45')][_0x8aa8('0x13d')](db[_0x8aa8('0x41')],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x168')});db[_0x8aa8('0x46')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x144'),'through':_0x8aa8('0x2f')});db[_0x8aa8('0x46')][_0x8aa8('0x11d')](db[_0x8aa8('0xdc')],{'through':'team_has_fax_queues','as':_0x8aa8('0x145')});db[_0x8aa8('0x48')][_0x8aa8('0x13d')](db[_0x8aa8('0x41')],{});db[_0x8aa8('0x48')][_0x8aa8('0x13d')](db['CmList'],{'as':_0x8aa8('0x158'),'foreignKey':_0x8aa8('0x16b')});db[_0x8aa8('0x48')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':_0x8aa8('0x14e'),'foreignKey':_0x8aa8('0x15e')});db['FaxQueueReport'][_0x8aa8('0x13d')](db['FaxInteraction'],{});db[_0x8aa8('0x48')][_0x8aa8('0x13d')](db[_0x8aa8('0x45')],{});db[_0x8aa8('0x48')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{});db['FaxQueueReport'][_0x8aa8('0x13d')](db[_0x8aa8('0x46')],{});db['SmsAccount'][_0x8aa8('0x10a')](db[_0x8aa8('0x153')],{'as':_0x8aa8('0x154'),'foreignKey':'SmsAccountId','onDelete':'cascade'});db['SmsAccount'][_0x8aa8('0x10a')](db[_0x8aa8('0x74')],{'as':_0x8aa8('0x155'),'foreignKey':'SmsAccountId'});db['SmsAccount']['hasMany'](db[_0x8aa8('0x4c')],{'as':_0x8aa8('0x147'),'foreignKey':_0x8aa8('0x172')});db['SmsAccount'][_0x8aa8('0x10a')](db[_0x8aa8('0x113')],{'as':_0x8aa8('0x156')});db['SmsAccount'][_0x8aa8('0x10a')](db[_0x8aa8('0x173')],{'as':_0x8aa8('0x157')});db[_0x8aa8('0x12f')][_0x8aa8('0x13d')](db['CmList'],{'as':_0x8aa8('0x158'),'foreignKey':_0x8aa8('0x16b')});db['SmsAccount'][_0x8aa8('0x13d')](db[_0x8aa8('0x7a')],{'as':_0x8aa8('0x142'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x8aa8('0x12f')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x144'),'through':'user_has_sms_accounts'});db['SmsApplication'][_0x8aa8('0x13d')](db['User'],{'onDelete':_0x8aa8('0x166')});db['SmsApplication'][_0x8aa8('0x13d')](db[_0x8aa8('0x4e')],{'onDelete':_0x8aa8('0x166')});db['SmsApplication'][_0x8aa8('0x13d')](db[_0x8aa8('0x12f')],{'onDelete':_0x8aa8('0x166')});db['SmsApplication'][_0x8aa8('0x13d')](db[_0x8aa8('0x78')],{'onDelete':_0x8aa8('0x166'),'foreignKey':_0x8aa8('0x141')});db[_0x8aa8('0x173')][_0x8aa8('0x13d')](db[_0x8aa8('0x83')],{'onDelete':_0x8aa8('0x166'),'foreignKey':_0x8aa8('0x167')});db[_0x8aa8('0x113')]['hasMany'](db[_0x8aa8('0x4c')],{'as':_0x8aa8('0x147'),'onDelete':_0x8aa8('0x10e'),'foreignKey':'SmsInteractionId'});db[_0x8aa8('0x113')][_0x8aa8('0x13d')](db[_0x8aa8('0x12f')],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x172')});db[_0x8aa8('0x113')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':_0x8aa8('0x14e'),'foreignKey':_0x8aa8('0x15e')});db[_0x8aa8('0x113')][_0x8aa8('0x13d')](db['User'],{'as':'Owner','foreignKey':_0x8aa8('0x109')});db[_0x8aa8('0x113')]['belongsToMany'](db[_0x8aa8('0x83')],{'through':'sms_interaction_has_tags','as':'Tags'});db[_0x8aa8('0x113')][_0x8aa8('0x11d')](db[_0x8aa8('0x83')],{'through':_0x8aa8('0x174'),'as':_0x8aa8('0x161')});db[_0x8aa8('0x113')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x162'),'through':'user_has_sms_interactions','foreignKey':_0x8aa8('0x175')});db[_0x8aa8('0x4c')][_0x8aa8('0x13d')](db['User'],{'as':'User'});db[_0x8aa8('0x4c')][_0x8aa8('0x13d')](db['CmContact'],{'onDelete':'cascade','as':_0x8aa8('0x14e')});db[_0x8aa8('0x4c')]['belongsTo'](db[_0x8aa8('0x113')],{'onDelete':'cascade','as':_0x8aa8('0x170'),'foreignKey':_0x8aa8('0x175')});db[_0x8aa8('0x4c')][_0x8aa8('0x13d')](db[_0x8aa8('0x12f')],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x172')});db[_0x8aa8('0x4e')][_0x8aa8('0x11d')](db['User'],{'as':_0x8aa8('0x144'),'through':'UserSmsQueue','foreignKey':'SmsQueueId'});db['SmsQueue'][_0x8aa8('0x11d')](db[_0x8aa8('0xdc')],{'through':_0x8aa8('0x176'),'as':_0x8aa8('0x145')});db['OpenchannelAccount'][_0x8aa8('0x10a')](db[_0x8aa8('0x153')],{'as':_0x8aa8('0x154'),'foreignKey':_0x8aa8('0x177'),'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x50')]['hasMany'](db['CannedAnswer'],{'as':_0x8aa8('0x155'),'foreignKey':'OpenchannelAccountId'});db[_0x8aa8('0x50')]['hasMany'](db[_0x8aa8('0x53')],{'as':_0x8aa8('0x156'),'foreignKey':_0x8aa8('0x177')});db['OpenchannelAccount'][_0x8aa8('0x10a')](db[_0x8aa8('0x55')],{'as':_0x8aa8('0x147'),'foreignKey':_0x8aa8('0x177')});db[_0x8aa8('0x50')]['hasMany'](db[_0x8aa8('0x178')],{'as':_0x8aa8('0x157'),'foreignKey':_0x8aa8('0x177')});db[_0x8aa8('0x50')]['belongsTo'](db[_0x8aa8('0xee')],{'as':_0x8aa8('0x158'),'foreignKey':_0x8aa8('0x16b')});db[_0x8aa8('0x50')][_0x8aa8('0x13d')](db[_0x8aa8('0x7a')],{'as':_0x8aa8('0x142'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x8aa8('0x50')]['belongsToMany'](db['User'],{'as':'Agents','through':'user_has_openchannel_accounts'});db[_0x8aa8('0x178')]['belongsTo'](db[_0x8aa8('0x12')],{'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x178')][_0x8aa8('0x13d')](db[_0x8aa8('0x57')],{'onDelete':_0x8aa8('0x166'),'foreignKey':_0x8aa8('0x179')});db[_0x8aa8('0x178')]['belongsTo'](db[_0x8aa8('0x50')],{'onDelete':_0x8aa8('0x166'),'foreignKey':'OpenchannelAccountId'});db[_0x8aa8('0x178')][_0x8aa8('0x13d')](db['Interval'],{'onDelete':_0x8aa8('0x166'),'foreignKey':'IntervalId'});db[_0x8aa8('0x178')][_0x8aa8('0x13d')](db[_0x8aa8('0x83')],{'onDelete':_0x8aa8('0x166'),'foreignKey':_0x8aa8('0x167')});db[_0x8aa8('0x53')]['hasMany'](db[_0x8aa8('0x55')],{'as':_0x8aa8('0x147'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x17a')});db['OpenchannelInteraction']['belongsTo'](db[_0x8aa8('0x50')],{'as':'Account','foreignKey':_0x8aa8('0x177')});db[_0x8aa8('0x53')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':_0x8aa8('0x14e'),'foreignKey':'ContactId'});db[_0x8aa8('0x53')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x15f'),'foreignKey':'UserId'});db[_0x8aa8('0x53')][_0x8aa8('0x11d')](db[_0x8aa8('0x83')],{'through':_0x8aa8('0x17b'),'as':_0x8aa8('0x16e')});db['OpenchannelInteraction'][_0x8aa8('0x11d')](db[_0x8aa8('0x83')],{'through':_0x8aa8('0x17b'),'as':_0x8aa8('0x161')});db[_0x8aa8('0x53')][_0x8aa8('0x11d')](db['User'],{'as':_0x8aa8('0x162'),'through':'user_has_openchannel_interactions','foreignKey':_0x8aa8('0x17a')});db[_0x8aa8('0x55')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'onDelete':_0x8aa8('0x10e'),'as':'User'});db['OpenchannelMessage'][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'onDelete':'cascade','as':'Contact'});db[_0x8aa8('0x55')][_0x8aa8('0x13d')](db[_0x8aa8('0x53')],{'onDelete':_0x8aa8('0x10e'),'as':_0x8aa8('0x170'),'foreignKey':_0x8aa8('0x17a')});db[_0x8aa8('0x55')][_0x8aa8('0x13d')](db[_0x8aa8('0xe4')],{'as':_0x8aa8('0xe4'),'foreignKey':_0x8aa8('0x171')});db[_0x8aa8('0x55')][_0x8aa8('0x13d')](db['OpenchannelAccount'],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x177')});db[_0x8aa8('0x57')][_0x8aa8('0x11d')](db['User'],{'as':_0x8aa8('0x144'),'through':_0x8aa8('0x31'),'foreignKey':_0x8aa8('0x179')});db[_0x8aa8('0x57')]['belongsToMany'](db['Team'],{'through':_0x8aa8('0x17c'),'as':_0x8aa8('0x145')});db['ChatWebsite']['hasMany'](db[_0x8aa8('0x153')],{'as':_0x8aa8('0x154'),'foreignKey':_0x8aa8('0x17d'),'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x58')][_0x8aa8('0x10a')](db['CannedAnswer'],{'as':_0x8aa8('0x155'),'foreignKey':_0x8aa8('0x17d')});db['ChatWebsite'][_0x8aa8('0x10a')](db[_0x8aa8('0x63')],{'as':'ProactiveActions'});db[_0x8aa8('0x58')][_0x8aa8('0x10a')](db[_0x8aa8('0x5d')],{'as':_0x8aa8('0x156')});db[_0x8aa8('0x58')][_0x8aa8('0x10a')](db[_0x8aa8('0x5b')],{'as':_0x8aa8('0x157')});db[_0x8aa8('0x58')]['hasMany'](db[_0x8aa8('0x5e')],{'as':_0x8aa8('0x147')});db[_0x8aa8('0x58')][_0x8aa8('0x13d')](db[_0x8aa8('0xee')],{'as':'List','foreignKey':_0x8aa8('0x16b')});db[_0x8aa8('0x58')]['belongsTo'](db[_0x8aa8('0x78')],{'as':'Interval','foreignKey':_0x8aa8('0x141')});db['ChatWebsite'][_0x8aa8('0x13d')](db[_0x8aa8('0x12c')],{'as':_0x8aa8('0x12c'),'foreignKey':_0x8aa8('0x150')});db[_0x8aa8('0x58')][_0x8aa8('0x13d')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x8aa8('0x58')]['belongsToMany'](db[_0x8aa8('0x12')],{'as':'Agents','through':_0x8aa8('0x12b')});db[_0x8aa8('0x59')][_0x8aa8('0x13d')](db[_0x8aa8('0x50')],{});db[_0x8aa8('0x59')]['belongsTo'](db['CmList'],{'as':_0x8aa8('0x158'),'foreignKey':_0x8aa8('0x16b')});db[_0x8aa8('0x59')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':_0x8aa8('0x14e'),'foreignKey':_0x8aa8('0x15e')});db[_0x8aa8('0x59')][_0x8aa8('0x13d')](db[_0x8aa8('0x53')],{});db[_0x8aa8('0x59')]['belongsTo'](db['OpenchannelMessage'],{});db[_0x8aa8('0x59')][_0x8aa8('0x13d')](db['User'],{});db[_0x8aa8('0x59')]['belongsTo'](db[_0x8aa8('0x57')],{});db[_0x8aa8('0x5b')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x17e'),'foreignKey':_0x8aa8('0x109'),'onDelete':_0x8aa8('0x166')});db['ChatApplication'][_0x8aa8('0x13d')](db['ChatQueue'],{'as':_0x8aa8('0x17f'),'foreignKey':_0x8aa8('0x180'),'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x5b')][_0x8aa8('0x13d')](db[_0x8aa8('0x58')],{'as':_0x8aa8('0x181'),'foreignKey':_0x8aa8('0x17d'),'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x5b')][_0x8aa8('0x13d')](db['Tag'],{'onDelete':_0x8aa8('0x166'),'foreignKey':_0x8aa8('0x167')});db['ChatInteraction'][_0x8aa8('0x10a')](db['ChatMessage'],{'as':_0x8aa8('0x147'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x182')});db['ChatInteraction']['belongsTo'](db[_0x8aa8('0x58')],{'as':_0x8aa8('0x15d'),'foreignKey':'ChatWebsiteId'});db[_0x8aa8('0x5d')]['belongsTo'](db[_0x8aa8('0x11b')],{'as':'Contact','foreignKey':_0x8aa8('0x15e')});db[_0x8aa8('0x5d')][_0x8aa8('0x13d')](db['User'],{'as':'Owner','foreignKey':_0x8aa8('0x109')});db[_0x8aa8('0x5d')][_0x8aa8('0x11d')](db[_0x8aa8('0x83')],{'through':_0x8aa8('0x183'),'as':'Tags'});db[_0x8aa8('0x5d')][_0x8aa8('0x11d')](db[_0x8aa8('0x83')],{'through':_0x8aa8('0x183'),'as':_0x8aa8('0x161')});db['ChatInteraction'][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x162'),'through':_0x8aa8('0x120'),'foreignKey':_0x8aa8('0x182')});db[_0x8aa8('0x5e')][_0x8aa8('0x13d')](db['User'],{'onDelete':_0x8aa8('0x10e'),'as':_0x8aa8('0x12')});db['ChatMessage']['belongsTo'](db[_0x8aa8('0x11b')],{'onDelete':_0x8aa8('0x10e'),'as':_0x8aa8('0x14e'),'foreignKey':'ContactId'});db['ChatMessage'][_0x8aa8('0x13d')](db['ChatInteraction'],{'onDelete':_0x8aa8('0x10e'),'as':_0x8aa8('0x170'),'foreignKey':_0x8aa8('0x182')});db[_0x8aa8('0x5e')][_0x8aa8('0x13d')](db[_0x8aa8('0xe4')],{'as':_0x8aa8('0xe4'),'foreignKey':_0x8aa8('0x171')});db[_0x8aa8('0x5e')][_0x8aa8('0x13d')](db['ChatWebsite'],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x17d')});db[_0x8aa8('0x164')][_0x8aa8('0x10a')](db['Attachment'],{'as':_0x8aa8('0x184'),'foreignKey':'ChatOfflineMessageId','onDelete':'cascade','hooks':!![]});db[_0x8aa8('0x164')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'onDelete':_0x8aa8('0x10e'),'as':_0x8aa8('0x14e'),'foreignKey':_0x8aa8('0x15e')});db[_0x8aa8('0x164')][_0x8aa8('0x13d')](db[_0x8aa8('0x58')],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x17d')});db[_0x8aa8('0x61')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':'Agents','through':_0x8aa8('0x2c'),'hooks':!![]});db[_0x8aa8('0x61')][_0x8aa8('0x11d')](db[_0x8aa8('0xdc')],{'through':'team_has_chat_queues','as':_0x8aa8('0x145')});db[_0x8aa8('0x185')][_0x8aa8('0x10a')](db[_0x8aa8('0xc8')],{'as':_0x8aa8('0x147'),'foreignKey':'ChatGroupId','onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x185')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':'Members','through':'chat_group_has_users'});db[_0x8aa8('0x63')][_0x8aa8('0x13d')](db[_0x8aa8('0x58')],{'as':'Website','foreignKey':_0x8aa8('0x17d')});db[_0x8aa8('0x186')][_0x8aa8('0x10a')](db[_0x8aa8('0x11b')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact'][_0x8aa8('0x10a')](db[_0x8aa8('0x67')],{'as':_0x8aa8('0x139'),'foreignKey':'ContactId'});db['CmContact'][_0x8aa8('0x10a')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x8aa8('0x15e')});db['CmContact'][_0x8aa8('0x10a')](db[_0x8aa8('0x13a')],{'as':_0x8aa8('0x187'),'foreignKey':_0x8aa8('0x15e')});db[_0x8aa8('0x11b')][_0x8aa8('0x10a')](db['ReportAgentPreview'],{'as':_0x8aa8('0x6d'),'foreignKey':_0x8aa8('0x15e')});db['CmContact'][_0x8aa8('0x10a')](db[_0x8aa8('0xcc')],{'as':_0x8aa8('0x13c'),'foreignKey':_0x8aa8('0x15e')});db[_0x8aa8('0x11b')][_0x8aa8('0x10a')](db[_0x8aa8('0x53')],{'as':_0x8aa8('0x111'),'foreignKey':_0x8aa8('0x15e'),'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x11b')][_0x8aa8('0x10a')](db['ChatInteraction'],{'as':_0x8aa8('0x112'),'foreignKey':'ContactId','onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x11b')][_0x8aa8('0x10a')](db[_0x8aa8('0x113')],{'as':_0x8aa8('0x114'),'foreignKey':_0x8aa8('0x15e'),'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x11b')]['hasMany'](db['FaxInteraction'],{'as':_0x8aa8('0x115'),'foreignKey':_0x8aa8('0x15e'),'onDelete':_0x8aa8('0x166')});db['CmContact'][_0x8aa8('0x10a')](db['MailInteraction'],{'as':_0x8aa8('0x116'),'foreignKey':'ContactId','onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x11b')][_0x8aa8('0x13d')](db[_0x8aa8('0x186')],{'as':_0x8aa8('0x188'),'foreignKey':'CompanyId'});db[_0x8aa8('0x11b')]['belongsTo'](db['CmList'],{'as':_0x8aa8('0x158'),'foreignKey':'ListId','onDelete':_0x8aa8('0x10e')});db['CmContact']['belongsToMany'](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x162'),'through':_0x8aa8('0x11c')});db['CmContact'][_0x8aa8('0x11d')](db[_0x8aa8('0x83')],{'as':'Tags','through':_0x8aa8('0x189')});db[_0x8aa8('0x11b')][_0x8aa8('0x11d')](db['Tag'],{'through':_0x8aa8('0x189'),'as':_0x8aa8('0x161')});db['CmHopper'][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':_0x8aa8('0x14e'),'foreignKey':_0x8aa8('0x15e'),'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x67')][_0x8aa8('0x13d')](db['CmList'],{'as':_0x8aa8('0x158'),'foreignKey':_0x8aa8('0x16b'),'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x67')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x17e'),'foreignKey':'UserId'});db[_0x8aa8('0x67')]['belongsTo'](db[_0x8aa8('0x1a')],{'as':_0x8aa8('0x17f'),'foreignKey':_0x8aa8('0x138'),'onDelete':'cascade'});db[_0x8aa8('0x67')]['belongsTo'](db[_0x8aa8('0xe0')],{'as':_0x8aa8('0xe0'),'foreignKey':_0x8aa8('0x18a'),'onDelete':_0x8aa8('0x10e')});db['CmHopper'][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x15f'),'foreignKey':'OwnerId'});db[_0x8aa8('0x69')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':_0x8aa8('0x14e'),'foreignKey':_0x8aa8('0x15e'),'onDelete':'cascade'});db['CmHopperBlack']['belongsTo'](db[_0x8aa8('0xee')],{'as':_0x8aa8('0x158'),'foreignKey':_0x8aa8('0x16b'),'onDelete':'cascade'});db['CmHopperBlack']['belongsTo'](db[_0x8aa8('0x1a')],{'as':'Queue','foreignKey':_0x8aa8('0x138'),'onDelete':_0x8aa8('0x10e')});db['CmHopperBlack'][_0x8aa8('0x13d')](db['Campaign'],{'as':_0x8aa8('0xe0'),'foreignKey':_0x8aa8('0x18a'),'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x72')][_0x8aa8('0x10a')](db[_0x8aa8('0x76')],{'as':{'plural':_0x8aa8('0x18b'),'singular':_0x8aa8('0x18c')},'foreignKey':_0x8aa8('0x18d'),'onDelete':_0x8aa8('0x10e'),'hooks':!![]});db[_0x8aa8('0x72')][_0x8aa8('0x10a')](db[_0x8aa8('0x76')],{'as':{'plural':_0x8aa8('0x18e'),'singular':_0x8aa8('0x18f')},'foreignKey':'AutomationAnyId','onDelete':_0x8aa8('0x10e'),'hooks':!![]});db[_0x8aa8('0x72')][_0x8aa8('0x10a')](db[_0x8aa8('0x70')],{'as':_0x8aa8('0x190'),'foreignKey':'AutomationId','onDelete':_0x8aa8('0x10e'),'hooks':!![]});db[_0x8aa8('0x153')][_0x8aa8('0x10a')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x8aa8('0x191'),'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x78')]['hasMany'](db[_0x8aa8('0x78')],{'as':_0x8aa8('0x192'),'foreignKey':_0x8aa8('0x141'),'onDelete':_0x8aa8('0x10e'),'hooks':!![],'required':![]});db[_0x8aa8('0x78')][_0x8aa8('0x10a')](db[_0x8aa8('0x16')],{'as':_0x8aa8('0x10d'),'foreignKey':_0x8aa8('0x141'),'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x78')][_0x8aa8('0x10a')](db[_0x8aa8('0x3b')],{'as':_0x8aa8('0x193'),'foreignKey':'IntervalId'});db['Interval'][_0x8aa8('0x10a')](db['ChatApplication'],{'as':_0x8aa8('0x194'),'foreignKey':_0x8aa8('0x141')});db[_0x8aa8('0x78')][_0x8aa8('0x10a')](db[_0x8aa8('0x169')],{'as':'FaxApplications','foreignKey':_0x8aa8('0x141')});db[_0x8aa8('0x78')][_0x8aa8('0x10a')](db[_0x8aa8('0x173')],{'as':_0x8aa8('0x195'),'foreignKey':'IntervalId'});db['Schedule'][_0x8aa8('0x13d')](db[_0x8aa8('0x12c')],{});db[_0x8aa8('0x7f')][_0x8aa8('0x13d')](db['AnalyticDefaultReport'],{'foreignKey':_0x8aa8('0x196')});db[_0x8aa8('0x7f')][_0x8aa8('0x13d')](db[_0x8aa8('0x8c')],{'foreignKey':_0x8aa8('0x197')});db['Sound'][_0x8aa8('0x11d')](db[_0x8aa8('0x18')],{'as':_0x8aa8('0x198'),'through':_0x8aa8('0x136'),'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x83')][_0x8aa8('0x11d')](db[_0x8aa8('0x11b')],{'through':_0x8aa8('0x189')});db[_0x8aa8('0x83')]['belongsToMany'](db[_0x8aa8('0x5d')],{'through':_0x8aa8('0x183')});db['Tag']['belongsToMany'](db[_0x8aa8('0x37')],{'through':_0x8aa8('0x160')});db['Tag'][_0x8aa8('0x11d')](db[_0x8aa8('0x113')],{'through':_0x8aa8('0x174')});db[_0x8aa8('0x83')][_0x8aa8('0x11d')](db[_0x8aa8('0x43')],{'through':_0x8aa8('0x16f')});db[_0x8aa8('0x83')][_0x8aa8('0x11d')](db[_0x8aa8('0x53')],{'through':_0x8aa8('0x17b')});db[_0x8aa8('0x83')][_0x8aa8('0x11d')](db[_0x8aa8('0xf9')],{'through':_0x8aa8('0x199')});db['Trigger'][_0x8aa8('0x10a')](db['Condition'],{'as':{'plural':_0x8aa8('0x19a'),'singular':_0x8aa8('0x19b')},'foreignKey':_0x8aa8('0x19c'),'onDelete':'cascade','hooks':!![]});db[_0x8aa8('0x86')][_0x8aa8('0x10a')](db[_0x8aa8('0x76')],{'as':{'plural':_0x8aa8('0x19d'),'singular':_0x8aa8('0x19e')},'foreignKey':_0x8aa8('0x19f'),'onDelete':_0x8aa8('0x10e'),'hooks':!![]});db[_0x8aa8('0x86')][_0x8aa8('0x10a')](db[_0x8aa8('0x70')],{'as':'Actions','foreignKey':_0x8aa8('0x1a0'),'onDelete':_0x8aa8('0x10e'),'hooks':!![]});db[_0x8aa8('0x8c')][_0x8aa8('0x10a')](db['AnalyticFieldReport'],{'as':_0x8aa8('0x1a1'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x197'),'hooks':!![]});db[_0x8aa8('0x8d')][_0x8aa8('0x10a')](db[_0x8aa8('0x1a2')],{'as':_0x8aa8('0x1a1'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x196')});db[_0x8aa8('0x91')][_0x8aa8('0x10a')](db[_0x8aa8('0x1a2')],{'as':_0x8aa8('0x1a1'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1a3')});db[_0x8aa8('0x1a2')][_0x8aa8('0x13d')](db['AnalyticMetric'],{'foreignKey':'MetricId'});db[_0x8aa8('0x94')][_0x8aa8('0x10a')](db['SalesforceConfiguration'],{'as':_0x8aa8('0x1a4'),'onDelete':_0x8aa8('0x10e'),'foreignKey':'AccountId'});db[_0x8aa8('0x1a5')][_0x8aa8('0x10a')](db[_0x8aa8('0x97')],{'as':_0x8aa8('0x1a6'),'onDelete':'cascade','foreignKey':_0x8aa8('0x1a7')});db[_0x8aa8('0x1a5')][_0x8aa8('0x10a')](db[_0x8aa8('0x97')],{'as':_0x8aa8('0x1a8'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1a9')});db['SalesforceConfiguration'][_0x8aa8('0x10a')](db[_0x8aa8('0x97')],{'as':_0x8aa8('0x1a1'),'onDelete':'cascade','foreignKey':_0x8aa8('0x1aa')});db[_0x8aa8('0x1a5')][_0x8aa8('0x13d')](db[_0x8aa8('0x94')],{'as':_0x8aa8('0x15d'),'foreignKey':'AccountId'});db['SalesforceField'][_0x8aa8('0x10a')](db[_0x8aa8('0x97')],{'as':_0x8aa8('0x1ab'),'foreignKey':_0x8aa8('0x1a7')});db[_0x8aa8('0x97')][_0x8aa8('0x10a')](db[_0x8aa8('0x97')],{'as':'Description','foreignKey':_0x8aa8('0x1a9')});db['SalesforceField']['hasMany'](db[_0x8aa8('0x97')],{'as':'Field','foreignKey':_0x8aa8('0x1aa')});db[_0x8aa8('0x97')][_0x8aa8('0x13d')](db[_0x8aa8('0x88')],{'as':_0x8aa8('0x88'),'foreignKey':'VariableId'});db[_0x8aa8('0x99')][_0x8aa8('0x10a')](db[_0x8aa8('0x9b')],{'as':_0x8aa8('0x1a4'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1ac')});db[_0x8aa8('0x9b')][_0x8aa8('0x10a')](db[_0x8aa8('0x9d')],{'as':_0x8aa8('0x1a6'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1a7')});db[_0x8aa8('0x9b')][_0x8aa8('0x10a')](db['SugarcrmField'],{'as':_0x8aa8('0x1a8'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1a9')});db[_0x8aa8('0x9b')][_0x8aa8('0x10a')](db[_0x8aa8('0x9d')],{'as':_0x8aa8('0x1a1'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1aa')});db[_0x8aa8('0x9b')]['belongsTo'](db['SugarcrmAccount'],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x1ac')});db['SugarcrmField'][_0x8aa8('0x10a')](db[_0x8aa8('0x9d')],{'as':_0x8aa8('0x1ab'),'foreignKey':'SubjectId'});db[_0x8aa8('0x9d')][_0x8aa8('0x10a')](db['SugarcrmField'],{'as':_0x8aa8('0x1ad'),'foreignKey':'DescriptionId'});db[_0x8aa8('0x9d')][_0x8aa8('0x10a')](db[_0x8aa8('0x9d')],{'as':'Field','foreignKey':_0x8aa8('0x1aa')});db[_0x8aa8('0x9d')][_0x8aa8('0x13d')](db[_0x8aa8('0x88')],{'as':_0x8aa8('0x88'),'foreignKey':_0x8aa8('0x1ae')});db[_0x8aa8('0x9f')][_0x8aa8('0x10a')](db[_0x8aa8('0xa0')],{'as':'Configurations','onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1ac')});db[_0x8aa8('0xa0')][_0x8aa8('0x10a')](db[_0x8aa8('0x1af')],{'as':_0x8aa8('0x1a6'),'onDelete':_0x8aa8('0x10e'),'foreignKey':'SubjectId'});db[_0x8aa8('0xa0')]['hasMany'](db[_0x8aa8('0x1af')],{'as':_0x8aa8('0x1a8'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1a9')});db[_0x8aa8('0xa0')][_0x8aa8('0x10a')](db['DeskField'],{'as':_0x8aa8('0x1a1'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x8aa8('0xa0')][_0x8aa8('0x13d')](db[_0x8aa8('0x9f')],{'as':'Account','foreignKey':_0x8aa8('0x1ac')});db[_0x8aa8('0xa0')][_0x8aa8('0x11d')](db[_0x8aa8('0x83')],{'through':_0x8aa8('0x1b0')});db[_0x8aa8('0x1af')][_0x8aa8('0x10a')](db[_0x8aa8('0x1af')],{'as':'Subject','foreignKey':'SubjectId'});db['DeskField']['hasMany'](db[_0x8aa8('0x1af')],{'as':_0x8aa8('0x1ad'),'foreignKey':'DescriptionId'});db[_0x8aa8('0x1af')][_0x8aa8('0x10a')](db[_0x8aa8('0x1af')],{'as':_0x8aa8('0x1b1'),'foreignKey':_0x8aa8('0x1aa')});db[_0x8aa8('0x1af')][_0x8aa8('0x13d')](db[_0x8aa8('0x88')],{'as':'Variable','foreignKey':'VariableId'});db[_0x8aa8('0xa3')][_0x8aa8('0x10a')](db['ZohoConfiguration'],{'as':_0x8aa8('0x1a4'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1ac')});db[_0x8aa8('0x1b2')]['hasMany'](db[_0x8aa8('0xa5')],{'as':_0x8aa8('0x1a6'),'onDelete':'cascade','foreignKey':_0x8aa8('0x1a7')});db['ZohoConfiguration']['hasMany'](db[_0x8aa8('0xa5')],{'as':_0x8aa8('0x1a8'),'onDelete':'cascade','foreignKey':_0x8aa8('0x1a9')});db[_0x8aa8('0x1b2')][_0x8aa8('0x10a')](db['ZohoField'],{'as':_0x8aa8('0x1a1'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1aa')});db[_0x8aa8('0x1b2')][_0x8aa8('0x13d')](db[_0x8aa8('0xa3')],{'as':'Account','foreignKey':'AccountId'});db['ZohoField'][_0x8aa8('0x10a')](db[_0x8aa8('0xa5')],{'as':_0x8aa8('0x1ab'),'foreignKey':_0x8aa8('0x1a7')});db[_0x8aa8('0xa5')][_0x8aa8('0x10a')](db[_0x8aa8('0xa5')],{'as':_0x8aa8('0x1ad'),'foreignKey':'DescriptionId'});db[_0x8aa8('0xa5')]['hasMany'](db['ZohoField'],{'as':'Field','foreignKey':'FieldId'});db[_0x8aa8('0xa5')]['belongsTo'](db[_0x8aa8('0x88')],{'as':_0x8aa8('0x88'),'foreignKey':_0x8aa8('0x1ae')});db[_0x8aa8('0xa7')][_0x8aa8('0x10a')](db['ZendeskConfiguration'],{'as':_0x8aa8('0x1a4'),'onDelete':'cascade','foreignKey':_0x8aa8('0x1ac')});db['ZendeskConfiguration'][_0x8aa8('0x10a')](db[_0x8aa8('0x1b3')],{'as':_0x8aa8('0x1a6'),'foreignKey':'SubjectId'});db[_0x8aa8('0xa9')][_0x8aa8('0x10a')](db[_0x8aa8('0x1b3')],{'as':'Descriptions','foreignKey':_0x8aa8('0x1a9')});db[_0x8aa8('0xa9')][_0x8aa8('0x10a')](db[_0x8aa8('0x1b3')],{'as':'Fields','foreignKey':_0x8aa8('0x1aa')});db['ZendeskConfiguration']['belongsTo'](db[_0x8aa8('0xa7')],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x1ac')});db[_0x8aa8('0xa9')]['belongsToMany'](db[_0x8aa8('0x83')],{'through':'int_zendesk_configuration_has_tags'});db['ZendeskField'][_0x8aa8('0x10a')](db['ZendeskField'],{'as':_0x8aa8('0x1ab'),'foreignKey':_0x8aa8('0x1a7')});db[_0x8aa8('0x1b3')][_0x8aa8('0x10a')](db['ZendeskField'],{'as':'Description','foreignKey':_0x8aa8('0x1a9')});db[_0x8aa8('0x1b3')]['hasMany'](db[_0x8aa8('0x1b3')],{'as':_0x8aa8('0x1b1'),'foreignKey':_0x8aa8('0x1aa')});db[_0x8aa8('0x1b3')][_0x8aa8('0x13d')](db[_0x8aa8('0x88')],{'as':_0x8aa8('0x88'),'foreignKey':_0x8aa8('0x1ae')});db[_0x8aa8('0x1b4')][_0x8aa8('0x10a')](db[_0x8aa8('0xac')],{'as':_0x8aa8('0x1a4'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1ac')});db[_0x8aa8('0xac')]['hasMany'](db['FreshdeskField'],{'as':'Subjects','onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1a7')});db[_0x8aa8('0xac')][_0x8aa8('0x10a')](db[_0x8aa8('0xae')],{'as':_0x8aa8('0x1a8'),'onDelete':_0x8aa8('0x10e'),'foreignKey':'DescriptionId'});db[_0x8aa8('0xac')][_0x8aa8('0x10a')](db['FreshdeskField'],{'as':_0x8aa8('0x1a1'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x8aa8('0xac')][_0x8aa8('0x13d')](db[_0x8aa8('0x1b4')],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x1ac')});db['FreshdeskConfiguration']['belongsToMany'](db[_0x8aa8('0x83')],{'through':'int_freshdesk_configuration_has_tags'});db['FreshdeskField'][_0x8aa8('0x10a')](db[_0x8aa8('0xae')],{'as':_0x8aa8('0x1ab'),'foreignKey':_0x8aa8('0x1a7')});db[_0x8aa8('0xae')][_0x8aa8('0x10a')](db[_0x8aa8('0xae')],{'as':_0x8aa8('0x1ad'),'foreignKey':_0x8aa8('0x1a9')});db['FreshdeskField'][_0x8aa8('0x10a')](db[_0x8aa8('0xae')],{'as':_0x8aa8('0x1b1'),'foreignKey':'FieldId'});db[_0x8aa8('0xae')][_0x8aa8('0x13d')](db['Variable'],{'as':_0x8aa8('0x88'),'foreignKey':_0x8aa8('0x1ae')});db[_0x8aa8('0x1b5')]['hasMany'](db[_0x8aa8('0xb0')],{'as':_0x8aa8('0x1a4'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1ac')});db[_0x8aa8('0xb0')][_0x8aa8('0x10a')](db[_0x8aa8('0xb2')],{'as':_0x8aa8('0x1a6'),'foreignKey':'SubjectId'});db[_0x8aa8('0xb0')][_0x8aa8('0x10a')](db[_0x8aa8('0xb2')],{'as':_0x8aa8('0x1a8'),'foreignKey':_0x8aa8('0x1a9')});db['VtigerConfiguration'][_0x8aa8('0x10a')](db[_0x8aa8('0xb2')],{'as':'Fields','foreignKey':_0x8aa8('0x1aa')});db[_0x8aa8('0xb0')][_0x8aa8('0x13d')](db[_0x8aa8('0x1b5')],{'as':_0x8aa8('0x15d'),'foreignKey':'AccountId'});db[_0x8aa8('0xb2')]['hasMany'](db[_0x8aa8('0xb2')],{'as':'Subject','foreignKey':_0x8aa8('0x1a7')});db[_0x8aa8('0xb2')][_0x8aa8('0x10a')](db['VtigerField'],{'as':_0x8aa8('0x1ad'),'foreignKey':_0x8aa8('0x1a9')});db[_0x8aa8('0xb2')]['hasMany'](db['VtigerField'],{'as':'Field','foreignKey':'FieldId'});db[_0x8aa8('0xb2')]['belongsTo'](db['Variable'],{'as':_0x8aa8('0x88'),'foreignKey':_0x8aa8('0x1ae')});db[_0x8aa8('0xb4')]['hasMany'](db[_0x8aa8('0x1b6')],{'as':_0x8aa8('0x1a4'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1ac')});db['ServicenowConfiguration'][_0x8aa8('0x10a')](db[_0x8aa8('0xb7')],{'as':_0x8aa8('0x1a6'),'foreignKey':_0x8aa8('0x1a7')});db[_0x8aa8('0x1b6')][_0x8aa8('0x10a')](db['ServicenowField'],{'as':_0x8aa8('0x1a8'),'foreignKey':_0x8aa8('0x1a9')});db['ServicenowConfiguration'][_0x8aa8('0x10a')](db[_0x8aa8('0xb7')],{'as':_0x8aa8('0x1a1'),'foreignKey':_0x8aa8('0x1aa')});db['ServicenowConfiguration'][_0x8aa8('0x13d')](db['ServicenowAccount'],{'as':'Account','foreignKey':_0x8aa8('0x1ac')});db[_0x8aa8('0xb7')][_0x8aa8('0x10a')](db[_0x8aa8('0xb7')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x8aa8('0xb7')][_0x8aa8('0x10a')](db['ServicenowField'],{'as':'Description','foreignKey':_0x8aa8('0x1a9')});db[_0x8aa8('0xb7')][_0x8aa8('0x10a')](db[_0x8aa8('0xb7')],{'as':_0x8aa8('0x1b1'),'foreignKey':_0x8aa8('0x1aa')});db['ServicenowField']['belongsTo'](db['Variable'],{'as':_0x8aa8('0x88'),'foreignKey':_0x8aa8('0x1ae')});db[_0x8aa8('0xb9')][_0x8aa8('0x10a')](db['Dynamics365Configuration'],{'as':_0x8aa8('0x1a4'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1ac')});db['Dynamics365Configuration'][_0x8aa8('0x10a')](db[_0x8aa8('0xbd')],{'as':_0x8aa8('0x1a6'),'onDelete':_0x8aa8('0x10e'),'foreignKey':'SubjectId'});db[_0x8aa8('0xbb')]['hasMany'](db[_0x8aa8('0xbd')],{'as':_0x8aa8('0x1a8'),'onDelete':'cascade','foreignKey':_0x8aa8('0x1a9')});db['Dynamics365Configuration'][_0x8aa8('0x10a')](db['Dynamics365Field'],{'as':_0x8aa8('0x1a1'),'onDelete':_0x8aa8('0x10e'),'foreignKey':'FieldId'});db[_0x8aa8('0xbb')]['belongsTo'](db['Dynamics365Account'],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x1ac')});db[_0x8aa8('0xbd')]['hasMany'](db['Dynamics365Field'],{'as':_0x8aa8('0x1ab'),'foreignKey':_0x8aa8('0x1a7')});db[_0x8aa8('0xbd')][_0x8aa8('0x10a')](db['Dynamics365Field'],{'as':_0x8aa8('0x1ad'),'foreignKey':'DescriptionId'});db[_0x8aa8('0xbd')][_0x8aa8('0x10a')](db[_0x8aa8('0xbd')],{'as':_0x8aa8('0x1b1'),'foreignKey':_0x8aa8('0x1aa')});db['Dynamics365Field'][_0x8aa8('0x13d')](db[_0x8aa8('0x88')],{'as':_0x8aa8('0x88'),'foreignKey':_0x8aa8('0x1ae')});db[_0x8aa8('0xbe')][_0x8aa8('0x10a')](db['FreshsalesConfiguration'],{'as':_0x8aa8('0x1a4'),'onDelete':_0x8aa8('0x10e'),'foreignKey':'AccountId'});db[_0x8aa8('0xc0')][_0x8aa8('0x10a')](db[_0x8aa8('0xc2')],{'as':'Subjects','foreignKey':_0x8aa8('0x1a7')});db['FreshsalesConfiguration'][_0x8aa8('0x10a')](db[_0x8aa8('0xc2')],{'as':_0x8aa8('0x1a8'),'foreignKey':'DescriptionId'});db['FreshsalesConfiguration'][_0x8aa8('0x10a')](db[_0x8aa8('0xc2')],{'as':_0x8aa8('0x1a1'),'foreignKey':_0x8aa8('0x1aa')});db[_0x8aa8('0xc0')][_0x8aa8('0x13d')](db[_0x8aa8('0xbe')],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x1ac')});db['FreshsalesField'][_0x8aa8('0x10a')](db[_0x8aa8('0xc2')],{'as':_0x8aa8('0x1ab'),'foreignKey':_0x8aa8('0x1a7')});db[_0x8aa8('0xc2')][_0x8aa8('0x10a')](db[_0x8aa8('0xc2')],{'as':_0x8aa8('0x1ad'),'foreignKey':_0x8aa8('0x1a9')});db[_0x8aa8('0xc2')]['hasMany'](db[_0x8aa8('0xc2')],{'as':'Field','foreignKey':_0x8aa8('0x1aa')});db[_0x8aa8('0xc2')]['belongsTo'](db['Variable'],{'as':_0x8aa8('0x88'),'foreignKey':_0x8aa8('0x1ae')});db[_0x8aa8('0xc7')][_0x8aa8('0x13d')](db['ChatWebsite'],{});db['ChatQueueReport'][_0x8aa8('0x13d')](db[_0x8aa8('0xee')],{'as':_0x8aa8('0x158'),'foreignKey':_0x8aa8('0x16b')});db[_0x8aa8('0xc7')][_0x8aa8('0x13d')](db['CmContact'],{'as':_0x8aa8('0x14e'),'foreignKey':_0x8aa8('0x15e')});db[_0x8aa8('0xc7')][_0x8aa8('0x13d')](db[_0x8aa8('0x5d')],{});db[_0x8aa8('0xc7')]['belongsTo'](db[_0x8aa8('0x5e')],{});db[_0x8aa8('0xc7')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{});db[_0x8aa8('0xc7')][_0x8aa8('0x13d')](db[_0x8aa8('0x61')],{});db[_0x8aa8('0xc8')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1b7')});db[_0x8aa8('0xc8')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1b8')});db[_0x8aa8('0xcc')][_0x8aa8('0x10a')](db[_0x8aa8('0xcb')],{'foreignKey':_0x8aa8('0x1b9'),'onDelete':_0x8aa8('0x10e')});db['JscriptySessionReport'][_0x8aa8('0x10a')](db[_0x8aa8('0x1ba')],{'foreignKey':'SessionId','onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0xce')][_0x8aa8('0x13d')](db[_0x8aa8('0x12f')],{});db[_0x8aa8('0xce')]['belongsTo'](db[_0x8aa8('0xee')],{'as':'List','foreignKey':_0x8aa8('0x16b')});db[_0x8aa8('0xce')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':_0x8aa8('0x14e'),'foreignKey':_0x8aa8('0x15e')});db['SmsQueueReport'][_0x8aa8('0x13d')](db['SmsInteraction'],{});db[_0x8aa8('0xce')][_0x8aa8('0x13d')](db[_0x8aa8('0x4c')],{});db['SmsQueueReport'][_0x8aa8('0x13d')](db['User'],{});db[_0x8aa8('0xce')][_0x8aa8('0x13d')](db['SmsQueue'],{});db[_0x8aa8('0x1bb')]['hasMany'](db[_0x8aa8('0xcc')],{'foreignKey':'ProjectId'});db[_0x8aa8('0x1bb')][_0x8aa8('0x10a')](db[_0x8aa8('0xcb')],{'foreignKey':_0x8aa8('0x1bc')});db[_0x8aa8('0x1bb')][_0x8aa8('0x10a')](db[_0x8aa8('0x1ba')],{'foreignKey':_0x8aa8('0x1bc')});db[_0x8aa8('0xd8')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':'Users','through':_0x8aa8('0x1bd')});db[_0x8aa8('0xdc')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x144'),'through':_0x8aa8('0x11f')});db[_0x8aa8('0xdc')][_0x8aa8('0x11d')](db[_0x8aa8('0x1a')],{'through':_0x8aa8('0x103'),'as':_0x8aa8('0x1be')});db['Team'][_0x8aa8('0x11d')](db[_0x8aa8('0x35')],{'through':_0x8aa8('0x15c'),'as':_0x8aa8('0x126')});db[_0x8aa8('0xdc')]['belongsToMany'](db[_0x8aa8('0x61')],{'through':_0x8aa8('0x1bf'),'as':_0x8aa8('0x128')});db[_0x8aa8('0xdc')]['belongsToMany'](db[_0x8aa8('0x46')],{'through':_0x8aa8('0x1c0'),'as':_0x8aa8('0x1c1')});db['Team']['belongsToMany'](db[_0x8aa8('0x4e')],{'through':'team_has_sms_queues','as':_0x8aa8('0x1c2')});db[_0x8aa8('0xdc')][_0x8aa8('0x11d')](db['OpenchannelQueue'],{'through':_0x8aa8('0x17c'),'as':'OpenchannelQueues'});db[_0x8aa8('0xdc')]['belongsToMany'](db[_0x8aa8('0xff')],{'through':_0x8aa8('0x1c3'),'as':_0x8aa8('0x1c4')});db[_0x8aa8('0xdc')][_0x8aa8('0x11d')](db[_0x8aa8('0x1c5')],{'through':'TeamVoicePrefix','as':'VoicePrefixes'});db[_0x8aa8('0xe0')][_0x8aa8('0x10a')](db[_0x8aa8('0x67')],{'as':_0x8aa8('0x139'),'foreignKey':'CampaignId'});db[_0x8aa8('0xe0')][_0x8aa8('0x10a')](db['CmHopperFinal'],{'as':_0x8aa8('0x110'),'foreignKey':'CampaignId'});db[_0x8aa8('0xe0')][_0x8aa8('0x10a')](db[_0x8aa8('0x13a')],{'as':_0x8aa8('0x187'),'foreignKey':'CampaignId'});db['Campaign'][_0x8aa8('0x10a')](db[_0x8aa8('0x69')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x8aa8('0xe0')][_0x8aa8('0x13d')](db[_0x8aa8('0x26')],{'as':'Trunk','foreignKey':_0x8aa8('0x13e')});db[_0x8aa8('0xe0')]['belongsTo'](db[_0x8aa8('0x26')],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0x8aa8('0xe0')]['belongsTo'](db['Interval'],{'as':'Interval','foreignKey':_0x8aa8('0x141')});db[_0x8aa8('0xe0')][_0x8aa8('0x13d')](db[_0x8aa8('0xd8')],{'as':_0x8aa8('0xd8'),'foreignKey':_0x8aa8('0x1c6')});db[_0x8aa8('0xe0')][_0x8aa8('0x11d')](db[_0x8aa8('0xee')],{'as':_0x8aa8('0x1c7'),'through':_0x8aa8('0x1c8')});db['Campaign'][_0x8aa8('0x11d')](db[_0x8aa8('0xee')],{'as':_0x8aa8('0x146'),'through':'campaigns_has_cm_blacklists'});db[_0x8aa8('0xe4')][_0x8aa8('0x13d')](db[_0x8aa8('0x164')],{'as':_0x8aa8('0x164'),'foreignKey':'ChatOfflineMessageId'});db[_0x8aa8('0xe8')]['belongsTo'](db['MailMessage'],{});db[_0x8aa8('0xe8')]['belongsTo'](db['MailInteraction'],{});db['MailTransferReport'][_0x8aa8('0x13d')](db[_0x8aa8('0x12c')],{'foreignKey':_0x8aa8('0x1c9'),'as':_0x8aa8('0x1ca')});db[_0x8aa8('0xe8')]['belongsTo'](db[_0x8aa8('0x12')],{'foreignKey':_0x8aa8('0x1cb'),'as':'FromAgent'});db[_0x8aa8('0xe8')][_0x8aa8('0x13d')](db['User'],{'foreignKey':'ToUserId','as':_0x8aa8('0x1cc')});db[_0x8aa8('0xe8')][_0x8aa8('0x13d')](db['MailQueue'],{'foreignKey':_0x8aa8('0x1cd'),'as':_0x8aa8('0x1ce')});db['MailTransferReport'][_0x8aa8('0x13d')](db[_0x8aa8('0x12c')],{'foreignKey':_0x8aa8('0x1cf'),'as':_0x8aa8('0x1d0')});db['ChatTransferReport'][_0x8aa8('0x13d')](db[_0x8aa8('0x5e')],{});db[_0x8aa8('0xe9')]['belongsTo'](db[_0x8aa8('0x5d')],{});db[_0x8aa8('0xe9')][_0x8aa8('0x13d')](db[_0x8aa8('0x58')],{'foreignKey':_0x8aa8('0x1d1'),'as':'FromAccount'});db[_0x8aa8('0xe9')][_0x8aa8('0x13d')](db['User'],{'foreignKey':_0x8aa8('0x1cb'),'as':'FromAgent'});db[_0x8aa8('0xe9')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x8aa8('0xe9')][_0x8aa8('0x13d')](db['ChatQueue'],{'foreignKey':'ToChatQueueId','as':_0x8aa8('0x1ce')});db[_0x8aa8('0xe9')][_0x8aa8('0x13d')](db[_0x8aa8('0x58')],{'foreignKey':_0x8aa8('0x1d2'),'as':_0x8aa8('0x1d0')});db['FaxTransferReport']['belongsTo'](db[_0x8aa8('0x45')],{});db[_0x8aa8('0xea')][_0x8aa8('0x13d')](db[_0x8aa8('0x43')],{});db[_0x8aa8('0xea')][_0x8aa8('0x13d')](db[_0x8aa8('0x41')],{'foreignKey':_0x8aa8('0x1d3'),'as':'FromAccount'});db[_0x8aa8('0xea')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x8aa8('0xea')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'foreignKey':_0x8aa8('0x1d4'),'as':_0x8aa8('0x1cc')});db[_0x8aa8('0xea')][_0x8aa8('0x13d')](db[_0x8aa8('0x46')],{'foreignKey':'ToFaxQueueId','as':_0x8aa8('0x1ce')});db['FaxTransferReport'][_0x8aa8('0x13d')](db['FaxAccount'],{'foreignKey':_0x8aa8('0x1d5'),'as':'ToAccount'});db['OpenchannelTransferReport'][_0x8aa8('0x13d')](db[_0x8aa8('0x55')],{});db[_0x8aa8('0x1d6')][_0x8aa8('0x13d')](db['OpenchannelInteraction'],{});db[_0x8aa8('0x1d6')][_0x8aa8('0x13d')](db[_0x8aa8('0x50')],{'foreignKey':_0x8aa8('0x1d7'),'as':_0x8aa8('0x1ca')});db[_0x8aa8('0x1d6')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'foreignKey':_0x8aa8('0x1cb'),'as':_0x8aa8('0x1d8')});db[_0x8aa8('0x1d6')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'foreignKey':'ToUserId','as':_0x8aa8('0x1cc')});db['OpenchannelTransferReport']['belongsTo'](db[_0x8aa8('0x57')],{'foreignKey':_0x8aa8('0x1d9'),'as':_0x8aa8('0x1ce')});db[_0x8aa8('0x1d6')]['belongsTo'](db[_0x8aa8('0x50')],{'foreignKey':'ToOpenchannelAccountId','as':_0x8aa8('0x1d0')});db[_0x8aa8('0xec')][_0x8aa8('0x13d')](db['SmsMessage'],{});db[_0x8aa8('0xec')][_0x8aa8('0x13d')](db[_0x8aa8('0x113')],{});db[_0x8aa8('0xec')]['belongsTo'](db[_0x8aa8('0x12f')],{'foreignKey':_0x8aa8('0x1da'),'as':_0x8aa8('0x1ca')});db[_0x8aa8('0xec')]['belongsTo'](db[_0x8aa8('0x12')],{'foreignKey':'FromUserId','as':_0x8aa8('0x1d8')});db['SmsTransferReport'][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'foreignKey':_0x8aa8('0x1d4'),'as':_0x8aa8('0x1cc')});db[_0x8aa8('0xec')][_0x8aa8('0x13d')](db[_0x8aa8('0x4e')],{'foreignKey':_0x8aa8('0x1db'),'as':_0x8aa8('0x1ce')});db[_0x8aa8('0xec')][_0x8aa8('0x13d')](db[_0x8aa8('0x12f')],{'foreignKey':_0x8aa8('0x1dc'),'as':_0x8aa8('0x1d0')});db[_0x8aa8('0xee')][_0x8aa8('0x10a')](db[_0x8aa8('0x153')],{'as':'Dispositions','foreignKey':'ListId','onDelete':'cascade'});db[_0x8aa8('0xee')][_0x8aa8('0x10a')](db[_0x8aa8('0x6f')],{'as':_0x8aa8('0x1dd'),'foreignKey':_0x8aa8('0x16b')});db[_0x8aa8('0xee')][_0x8aa8('0x10a')](db['CmContact'],{'as':_0x8aa8('0x1de'),'onDelete':_0x8aa8('0x10e'),'foreignKey':'ListId'});db[_0x8aa8('0xee')][_0x8aa8('0x10a')](db[_0x8aa8('0x10f')],{'as':_0x8aa8('0x110'),'foreignKey':_0x8aa8('0x16b')});db['CmList'][_0x8aa8('0x10a')](db[_0x8aa8('0x13a')],{'as':_0x8aa8('0x1df'),'foreignKey':_0x8aa8('0x16b')});db[_0x8aa8('0xee')]['hasMany'](db['ReportAgentPreview'],{'as':_0x8aa8('0x6d'),'foreignKey':'ListId'});db[_0x8aa8('0xee')][_0x8aa8('0x11d')](db['VoiceQueue'],{'as':'Queues','through':_0x8aa8('0x143')});db[_0x8aa8('0xee')]['belongsToMany'](db['User'],{'as':_0x8aa8('0x144'),'through':_0x8aa8('0x11e')});db[_0x8aa8('0x1c5')][_0x8aa8('0x10a')](db['VoiceExtension'],{'as':_0x8aa8('0x10d'),'onDelete':'cascade'});db[_0x8aa8('0x1c5')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':'Agents','through':_0x8aa8('0x106')});db[_0x8aa8('0x1c5')][_0x8aa8('0x11d')](db['Team'],{'through':_0x8aa8('0x105'),'as':'Teams'});db[_0x8aa8('0xf1')][_0x8aa8('0x10a')](db[_0x8aa8('0x12')],{'as':'Users','foreignKey':'userProfileId'});db['UserProfile']['hasMany'](db[_0x8aa8('0x1e0')],{'as':_0x8aa8('0x1e1'),'foreignKey':'userProfileId','onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x1e0')][_0x8aa8('0x10a')](db[_0x8aa8('0xf3')],{'as':_0x8aa8('0x1e2'),'foreignKey':'sectionId','onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0xf7')][_0x8aa8('0x10a')](db['Disposition'],{'as':_0x8aa8('0x154'),'foreignKey':_0x8aa8('0x1e3'),'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0xf7')][_0x8aa8('0x10a')](db['CannedAnswer'],{'as':_0x8aa8('0x155'),'foreignKey':_0x8aa8('0x1e3')});db[_0x8aa8('0xf7')][_0x8aa8('0x10a')](db[_0x8aa8('0x1e4')],{'as':_0x8aa8('0x147'),'foreignKey':_0x8aa8('0x1e3')});db['WhatsappAccount']['hasMany'](db[_0x8aa8('0xf9')],{'as':_0x8aa8('0x156')});db[_0x8aa8('0xf7')][_0x8aa8('0x10a')](db[_0x8aa8('0x1e5')],{'as':_0x8aa8('0x157')});db['WhatsappAccount'][_0x8aa8('0x13d')](db['CmList'],{'as':_0x8aa8('0x158'),'foreignKey':_0x8aa8('0x16b')});db[_0x8aa8('0xf7')][_0x8aa8('0x13d')](db['Pause'],{'as':_0x8aa8('0x142'),'foreignKey':_0x8aa8('0x15a')});db[_0x8aa8('0xf7')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x144'),'through':_0x8aa8('0x131')});db[_0x8aa8('0x1e5')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x1e5')][_0x8aa8('0x13d')](db[_0x8aa8('0xff')],{'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x1e5')][_0x8aa8('0x13d')](db[_0x8aa8('0xf7')],{'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x1e5')]['belongsTo'](db['Interval'],{'onDelete':_0x8aa8('0x166'),'foreignKey':_0x8aa8('0x141')});db[_0x8aa8('0x1e5')][_0x8aa8('0x13d')](db['Tag'],{'onDelete':_0x8aa8('0x166'),'foreignKey':_0x8aa8('0x167')});db[_0x8aa8('0xf9')]['hasMany'](db[_0x8aa8('0x1e4')],{'as':_0x8aa8('0x147'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1e6')});db[_0x8aa8('0xf9')][_0x8aa8('0x13d')](db[_0x8aa8('0xf7')],{'as':'Account','foreignKey':_0x8aa8('0x1e3')});db[_0x8aa8('0xf9')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':_0x8aa8('0x14e'),'foreignKey':_0x8aa8('0x15e')});db['WhatsappInteraction'][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'as':'Owner','foreignKey':_0x8aa8('0x109')});db['WhatsappInteraction'][_0x8aa8('0x11d')](db['Tag'],{'through':_0x8aa8('0x199'),'as':_0x8aa8('0x16e')});db['WhatsappInteraction'][_0x8aa8('0x11d')](db[_0x8aa8('0x83')],{'through':_0x8aa8('0x199'),'as':_0x8aa8('0x161')});db['WhatsappInteraction']['belongsToMany'](db[_0x8aa8('0x12')],{'as':'Users','through':'user_has_whatsapp_interactions','foreignKey':_0x8aa8('0x1e6')});db['WhatsappMessage'][_0x8aa8('0x13d')](db['User'],{'as':_0x8aa8('0x12')});db[_0x8aa8('0x1e4')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'onDelete':'cascade','as':_0x8aa8('0x14e')});db[_0x8aa8('0x1e4')][_0x8aa8('0x13d')](db['WhatsappInteraction'],{'onDelete':_0x8aa8('0x10e'),'as':'Interaction','foreignKey':_0x8aa8('0x1e6')});db[_0x8aa8('0x1e4')][_0x8aa8('0x13d')](db[_0x8aa8('0xf7')],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x1e3')});db[_0x8aa8('0xfc')][_0x8aa8('0x13d')](db[_0x8aa8('0xf7')],{});db[_0x8aa8('0xfc')][_0x8aa8('0x13d')](db['CmList'],{'as':_0x8aa8('0x158'),'foreignKey':_0x8aa8('0x16b')});db[_0x8aa8('0xfc')][_0x8aa8('0x13d')](db['CmContact'],{'as':_0x8aa8('0x14e'),'foreignKey':'ContactId'});db[_0x8aa8('0xfc')]['belongsTo'](db[_0x8aa8('0xf9')],{});db[_0x8aa8('0xfc')]['belongsTo'](db[_0x8aa8('0xff')],{});db['WhatsappQueueReport'][_0x8aa8('0x13d')](db[_0x8aa8('0x1e4')],{});db[_0x8aa8('0xfc')][_0x8aa8('0x13d')](db['User'],{});db[_0x8aa8('0xfd')]['belongsTo'](db[_0x8aa8('0x1e4')],{});db[_0x8aa8('0xfd')][_0x8aa8('0x13d')](db[_0x8aa8('0xf9')],{});db[_0x8aa8('0xfd')][_0x8aa8('0x13d')](db[_0x8aa8('0xf7')],{'foreignKey':_0x8aa8('0x1e7'),'as':_0x8aa8('0x1ca')});db[_0x8aa8('0xfd')][_0x8aa8('0x13d')](db[_0x8aa8('0xf7')],{'foreignKey':_0x8aa8('0x1e8'),'as':_0x8aa8('0x1d0')});db[_0x8aa8('0xfd')][_0x8aa8('0x13d')](db[_0x8aa8('0xff')],{'foreignKey':_0x8aa8('0x1e9'),'as':_0x8aa8('0x1ce')});db[_0x8aa8('0xfd')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'foreignKey':'FromUserId','as':_0x8aa8('0x1d8')});db[_0x8aa8('0xfd')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'foreignKey':_0x8aa8('0x1d4'),'as':_0x8aa8('0x1cc')});db[_0x8aa8('0xff')][_0x8aa8('0x11d')](db['User'],{'as':_0x8aa8('0x144'),'through':_0x8aa8('0x32'),'foreignKey':_0x8aa8('0x1ea')});db['WhatsappQueue'][_0x8aa8('0x11d')](db[_0x8aa8('0xdc')],{'through':_0x8aa8('0x1c3'),'as':_0x8aa8('0x145')});module['exports']={'db':db,'dbH':dbH};
\ No newline at end of file
index 8d17153..2e3095d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1675=['./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','/api/integrations','/api/integrations/reports','./api/integrationReport','/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/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','./api/network','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/smsQueueReport','/api/square/reports','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','/api/license','./api/license','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/cm/lists','./api/cmList','./api/voicePrefix','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','/api/version','./api/version','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','snippet','3.0.0','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','username','password','newPassword','lastName','phone','mobile','fax','email','clientId','clientSecret','accessKey','tenantId','token','channelSecret','accessToken','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','key','pass','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','replace','@@{','includes','lodash','path','express','express-winston','util','./errors','./config/logger','api','auth','default','isEmpty','\x20body=%s','body','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','name','role','inspect','use','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)','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/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','/api/mail/interactions','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','./api/smsQueue','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites'];(function(_0x1c5e2f,_0x372a8d){var _0x5defd1=function(_0x189fa3){while(--_0x189fa3){_0x1c5e2f['push'](_0x1c5e2f['shift']());}};_0x5defd1(++_0x372a8d);}(_0x1675,0xed));var _0x5167=function(_0x5e6440,_0x409bb5){_0x5e6440=_0x5e6440-0x0;var _0x47e4ec=_0x1675[_0x5e6440];return _0x47e4ec;};'use strict';var _=require(_0x5167('0x0'));var path=require(_0x5167('0x1'));var express=require(_0x5167('0x2'));var ewinston=require(_0x5167('0x3'));var util=require(_0x5167('0x4'));var errors=require(_0x5167('0x5'));var config=require('./config/environment');var logger=require(_0x5167('0x6'))(_0x5167('0x7'));var authLogger=require('./config/logger')(_0x5167('0x8'));exports[_0x5167('0x9')]=function(_0x18b01b){_0x18b01b['use'](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x3ebdd5,_0x470dd4){var _0x3cc3cf='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x5167('0xa')](_0x3ebdd5['body'])){_0x3cc3cf+=_0x5167('0xb');var _0xde9276=_0x3ebdd5[_0x5167('0xc')];maskSensitiveData(_0xde9276);}return util[_0x5167('0xd')](_0x3cc3cf,_0x3ebdd5[_0x5167('0xe')],_0x3ebdd5[_0x5167('0xf')][_0x5167('0x10')]?_0x3ebdd5['headers'][_0x5167('0x10')]:_0x3ebdd5[_0x5167('0x11')][_0x5167('0x12')]||_0x3ebdd5['ip'],_0x3ebdd5[_0x5167('0x13')],_0x470dd4[_0x5167('0x14')],_0x470dd4[_0x5167('0x15')],_0x3ebdd5[_0x5167('0x16')]?_0x3ebdd5['user']['id']:null,_0x3ebdd5[_0x5167('0x16')]?_0x3ebdd5[_0x5167('0x16')][_0x5167('0x17')]:null,_0x3ebdd5[_0x5167('0x16')]?_0x3ebdd5[_0x5167('0x16')][_0x5167('0x18')]:null,_0xde9276?util[_0x5167('0x19')](_0xde9276,![],null):'');}}));_0x18b01b[_0x5167('0x1a')](ewinston[_0x5167('0x1b')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x51789e,_0xc5157d){var _0x5e30d0=_0x5167('0x1c');if(_0x51789e[_0x5167('0xc')]&&_0x51789e['body'][_0x5167('0x1d')]&&_0x51789e[_0x5167('0xc')][_0x5167('0x1e')]){_0x5e30d0=_0x5167('0x1f');}return util[_0x5167('0xd')](_0x5e30d0,_0x51789e[_0x5167('0xe')],_0x51789e[_0x5167('0xf')][_0x5167('0x10')]?_0x51789e[_0x5167('0xf')]['x-forwarded-for']:_0x51789e[_0x5167('0x11')][_0x5167('0x12')]||_0x51789e['ip'],_0x51789e[_0x5167('0x13')],_0xc5157d[_0x5167('0x14')],_0xc5157d[_0x5167('0x15')],_0x51789e[_0x5167('0x16')]?_0x51789e[_0x5167('0x16')]['id']:null,_0x51789e[_0x5167('0x16')]?_0x51789e[_0x5167('0x16')][_0x5167('0x17')]:null,_0x51789e['user']?_0x51789e['user'][_0x5167('0x18')]:null,_0x51789e[_0x5167('0xc')]&&_0x51789e[_0x5167('0xc')][_0x5167('0x1d')]?_0x51789e[_0x5167('0xc')]['device']:_0x5167('0x20'),_0x51789e[_0x5167('0xc')]&&_0x51789e[_0x5167('0xc')][_0x5167('0x1e')]?_0x51789e[_0x5167('0xc')][_0x5167('0x1e')]:'',_0x51789e[_0x5167('0xc')]&&_0x51789e[_0x5167('0xc')][_0x5167('0x21')]?_0x51789e[_0x5167('0xc')][_0x5167('0x21')]:'');},'ignoreRoute':function(_0x5cbcf3){var _0x3fdd34=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x3fdd34[_0x5167('0x22')](_0x5cbcf3['url']);}}));_0x18b01b['use'](_0x5167('0x23'),require('./api/user'));_0x18b01b['use'](_0x5167('0x24'),require(_0x5167('0x25')));_0x18b01b['use'](_0x5167('0x26'),require(_0x5167('0x27')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x28'),require(_0x5167('0x29')));_0x18b01b['use'](_0x5167('0x2a'),require(_0x5167('0x2b')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x2c'),require(_0x5167('0x2d')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x2e'),require('./api/voiceRecording'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x2f'),require(_0x5167('0x30')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x31'),require(_0x5167('0x32')));_0x18b01b[_0x5167('0x1a')]('/api/voice/mails/messages',require('./api/voiceMailMessage'));_0x18b01b[_0x5167('0x1a')]('/api/voice/calls/reports',require(_0x5167('0x33')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x34'),require(_0x5167('0x35')));_0x18b01b['use'](_0x5167('0x36'),require('./api/voiceAgentReport'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x37'),require('./api/voiceQueueReport'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x38'),require(_0x5167('0x39')));_0x18b01b['use'](_0x5167('0x3a'),require(_0x5167('0x3b')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x3c'),require('./api/voiceTransferReport'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x3d'),require(_0x5167('0x3e')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x3f'),require(_0x5167('0x40')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x41'),require('./api/mailQueue'));_0x18b01b['use'](_0x5167('0x42'),require('./api/mailSubstatus'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x43'),require('./api/mailInteraction'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x44'),require('./api/mailMessage'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x45'),require(_0x5167('0x46')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x47'),require(_0x5167('0x48')));_0x18b01b['use'](_0x5167('0x49'),require(_0x5167('0x4a')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x4b'),require(_0x5167('0x4c')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x4d'),require(_0x5167('0x4e')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x4f'),require(_0x5167('0x50')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x51'),require(_0x5167('0x52')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x53'),require(_0x5167('0x54')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x55'),require(_0x5167('0x56')));_0x18b01b['use']('/api/fax/reports/queue',require(_0x5167('0x57')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x58'),require(_0x5167('0x59')));_0x18b01b['use'](_0x5167('0x5a'),require(_0x5167('0x5b')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x5c'),require(_0x5167('0x5d')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x5e'),require(_0x5167('0x5f')));_0x18b01b[_0x5167('0x1a')]('/api/sms/queues',require(_0x5167('0x60')));_0x18b01b[_0x5167('0x1a')]('/api/openchannel/accounts',require('./api/openchannelAccount'));_0x18b01b[_0x5167('0x1a')]('/api/openchannel/applications',require(_0x5167('0x61')));_0x18b01b['use'](_0x5167('0x62'),require('./api/openchannelInteraction'));_0x18b01b[_0x5167('0x1a')]('/api/openchannel/messages',require(_0x5167('0x63')));_0x18b01b[_0x5167('0x1a')]('/api/openchannel/queues',require(_0x5167('0x64')));_0x18b01b['use'](_0x5167('0x65'),require(_0x5167('0x66')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x67'),require(_0x5167('0x68')));_0x18b01b['use'](_0x5167('0x69'),require(_0x5167('0x6a')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x6b'),require(_0x5167('0x6c')));_0x18b01b[_0x5167('0x1a')]('/api/chat/messages',require(_0x5167('0x6d')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x6e'),require('./api/chatOfflineMessage'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x6f'),require('./api/chatQueue'));_0x18b01b['use'](_0x5167('0x70'),require('./api/chatGroup'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x71'),require(_0x5167('0x72')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x73'),require(_0x5167('0x74')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x75'),require(_0x5167('0x76')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x77'),require('./api/cmHopper'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x78'),require(_0x5167('0x79')));_0x18b01b['use'](_0x5167('0x7a'),require(_0x5167('0x7b')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x7c'),require(_0x5167('0x7d')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x7e'),require('./api/cmCustomField'));_0x18b01b['use'](_0x5167('0x7f'),require('./api/action'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x80'),require(_0x5167('0x81')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x82'),require(_0x5167('0x83')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x84'),require(_0x5167('0x85')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x86'),require(_0x5167('0x87')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x88'),require(_0x5167('0x89')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x8a'),require(_0x5167('0x8b')));_0x18b01b['use'](_0x5167('0x8c'),require(_0x5167('0x8d')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x8e'),require(_0x5167('0x8f')));_0x18b01b['use'](_0x5167('0x90'),require(_0x5167('0x91')));_0x18b01b[_0x5167('0x1a')]('/api/sounds',require(_0x5167('0x92')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x93'),require(_0x5167('0x94')));_0x18b01b['use'](_0x5167('0x95'),require(_0x5167('0x96')));_0x18b01b['use'](_0x5167('0x97'),require(_0x5167('0x98')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x99'),require('./api/variable'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x9a'),require('./api/integration'));_0x18b01b['use'](_0x5167('0x9b'),require(_0x5167('0x9c')));_0x18b01b[_0x5167('0x1a')]('/api/analytics/custom_reports',require('./api/analyticCustomReport'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x9d'),require(_0x5167('0x9e')));_0x18b01b[_0x5167('0x1a')]('/api/analytics/extracted_reports',require(_0x5167('0x9f')));_0x18b01b['use'](_0x5167('0xa0'),require(_0x5167('0xa1')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xa2'),require(_0x5167('0xa3')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xa4'),require(_0x5167('0xa5')));_0x18b01b[_0x5167('0x1a')]('/api/integrations/salesforce/accounts',require(_0x5167('0xa6')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xa7'),require(_0x5167('0xa8')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xa9'),require(_0x5167('0xaa')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xab'),require('./api/intSugarcrmAccount'));_0x18b01b[_0x5167('0x1a')](_0x5167('0xac'),require(_0x5167('0xad')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xae'),require(_0x5167('0xaf')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xb0'),require('./api/intDeskAccount'));_0x18b01b['use'](_0x5167('0xb1'),require(_0x5167('0xb2')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xb3'),require(_0x5167('0xb4')));_0x18b01b[_0x5167('0x1a')]('/api/integrations/zoho/accounts',require(_0x5167('0xb5')));_0x18b01b[_0x5167('0x1a')]('/api/integrations/zoho/configurations',require(_0x5167('0xb6')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xb7'),require(_0x5167('0xb8')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xb9'),require('./api/intZendeskAccount'));_0x18b01b[_0x5167('0x1a')](_0x5167('0xba'),require('./api/intZendeskConfiguration'));_0x18b01b[_0x5167('0x1a')]('/api/integrations/zendesk/fields',require(_0x5167('0xbb')));_0x18b01b[_0x5167('0x1a')]('/api/integrations/freshdesk/accounts',require(_0x5167('0xbc')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xbd'),require(_0x5167('0xbe')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xbf'),require(_0x5167('0xc0')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xc1'),require(_0x5167('0xc2')));_0x18b01b[_0x5167('0x1a')]('/api/integrations/vtiger/configurations',require(_0x5167('0xc3')));_0x18b01b[_0x5167('0x1a')]('/api/integrations/vtiger/fields',require('./api/intVtigerField'));_0x18b01b[_0x5167('0x1a')]('/api/integrations/servicenow/accounts',require(_0x5167('0xc4')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xc5'),require(_0x5167('0xc6')));_0x18b01b['use'](_0x5167('0xc7'),require('./api/intServicenowField'));_0x18b01b[_0x5167('0x1a')](_0x5167('0xc8'),require(_0x5167('0xc9')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xca'),require('./api/intDynamics365Configuration'));_0x18b01b[_0x5167('0x1a')](_0x5167('0xcb'),require(_0x5167('0xcc')));_0x18b01b[_0x5167('0x1a')]('/api/integrations/freshsales/accounts',require(_0x5167('0xcd')));_0x18b01b['use'](_0x5167('0xce'),require(_0x5167('0xcf')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xd0'),require('./api/intFreshsalesField'));_0x18b01b[_0x5167('0x1a')](_0x5167('0xd1'),require(_0x5167('0xd2')));_0x18b01b[_0x5167('0x1a')]('/api/chat/reports/queue',require('./api/chatQueueReport'));_0x18b01b[_0x5167('0x1a')](_0x5167('0xd3'),require(_0x5167('0xd4')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xd5'),require(_0x5167('0xd6')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xd7'),require(_0x5167('0xd8')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xd9'),require('./api/jscriptySessionReport'));_0x18b01b[_0x5167('0x1a')]('/api/sms/reports/queue',require(_0x5167('0xda')));_0x18b01b['use'](_0x5167('0xdb'),require(_0x5167('0xdc')));_0x18b01b['use']('/api/square/details/reports',require(_0x5167('0xdd')));_0x18b01b['use'](_0x5167('0xde'),require(_0x5167('0xdf')));_0x18b01b['use'](_0x5167('0xe0'),require(_0x5167('0xe1')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xe2'),require(_0x5167('0xe3')));_0x18b01b['use'](_0x5167('0xe4'),require(_0x5167('0xe5')));_0x18b01b['use'](_0x5167('0xe6'),require(_0x5167('0xe7')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xe8'),require(_0x5167('0xe9')));_0x18b01b['use'](_0x5167('0xea'),require('./api/team'));_0x18b01b['use'](_0x5167('0xeb'),require(_0x5167('0xec')));_0x18b01b['use']('/api/campaigns',require('./api/campaign'));_0x18b01b[_0x5167('0x1a')]('/api/migrations',require('./api/migration'));_0x18b01b['use'](_0x5167('0xed'),require(_0x5167('0xee')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xef'),require(_0x5167('0xf0')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xf1'),require(_0x5167('0xf2')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xf3'),require(_0x5167('0xf4')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xf5'),require(_0x5167('0xf6')));_0x18b01b['use'](_0x5167('0xf7'),require(_0x5167('0xf8')));_0x18b01b[_0x5167('0x1a')]('/api/sms/reports/transfer',require('./api/smsTransferReport'));_0x18b01b[_0x5167('0x1a')](_0x5167('0xf9'),require(_0x5167('0xfa')));_0x18b01b[_0x5167('0x1a')]('/api/voice/prefixes',require(_0x5167('0xfb')));_0x18b01b[_0x5167('0x1a')]('/api/userProfiles',require(_0x5167('0xfc')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xfd'),require(_0x5167('0xfe')));_0x18b01b['use']('/api/userProfile/resources',require('./api/userProfileResource'));_0x18b01b[_0x5167('0x1a')]('/api/userNotifications',require(_0x5167('0xff')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x100'),require(_0x5167('0x101')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x102'),require(_0x5167('0x103')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x104'),require('./api/whatsappInteraction'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x105'),require(_0x5167('0x106')));_0x18b01b[_0x5167('0x1a')]('/api/whatsapp/reports/queue',require(_0x5167('0x107')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x108'),require(_0x5167('0x109')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x10a'),require(_0x5167('0x10b')));_0x18b01b['use'](_0x5167('0x10c'),require(_0x5167('0x10d')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x10e'),require('./api/realtime'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x10f'),require(_0x5167('0x110')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x111'),require(_0x5167('0x112')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x113'),require(_0x5167('0x114')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x115'),require('./api/rpc'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x116'),require(_0x5167('0x117')));_0x18b01b[_0x5167('0x1a')]('/api/system',require('./api/system'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x118'),require(_0x5167('0x119')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x11a'),require(_0x5167('0x11b')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x11c'),express[_0x5167('0x11d')](path[_0x5167('0x11e')](config[_0x5167('0x11f')],'/apidoc')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x120'),express[_0x5167('0x11d')](path[_0x5167('0x11e')](config[_0x5167('0x11f')],'/www')));_0x18b01b[_0x5167('0x1a')]('/demo',express['static'](path[_0x5167('0x11e')](config[_0x5167('0x11f')],_0x5167('0x121'))));_0x18b01b[_0x5167('0x1a')](_0x5167('0x122'),express[_0x5167('0x11d')](path[_0x5167('0x11e')](config[_0x5167('0x11f')],_0x5167('0x123'),_0x5167('0x124'))));_0x18b01b['use'](_0x5167('0x125'),express[_0x5167('0x11d')](path[_0x5167('0x11e')](config['root'],'/server/files/plugins')));_0x18b01b[_0x5167('0x126')](_0x5167('0x127'))[_0x5167('0x128')](errors[0x194]);_0x18b01b[_0x5167('0x126')]('/*')['get'](function(_0x474079,_0x3ba208){_0x3ba208[_0x5167('0x129')](path[_0x5167('0x12a')](_0x18b01b[_0x5167('0x128')](_0x5167('0x12b'))+_0x5167('0x12c')));});};var sensitiveFields=[_0x5167('0x12d'),_0x5167('0x12e'),_0x5167('0x12f'),'apiKey','firstName',_0x5167('0x130'),'street',_0x5167('0x131'),_0x5167('0x132'),_0x5167('0x133'),_0x5167('0x134'),_0x5167('0x135'),_0x5167('0x136'),'securityToken','code',_0x5167('0x137'),_0x5167('0x138'),_0x5167('0x139'),_0x5167('0x13a'),_0x5167('0x13b'),'accessTokenSecret',_0x5167('0x13c'),_0x5167('0x13d'),_0x5167('0x13e'),_0x5167('0x13f'),_0x5167('0x140'),_0x5167('0x141'),_0x5167('0x142'),_0x5167('0x143'),_0x5167('0x144'),_0x5167('0x145'),_0x5167('0x146'),'secretaccesskey',_0x5167('0x147'),_0x5167('0x16'),_0x5167('0x148'),'accountSid','localstationid',_0x5167('0x149'),_0x5167('0x14a'),_0x5167('0x14b'),_0x5167('0x14c')];function maskSensitiveData(_0xb8500a){var _0x2af895=/(?!^)[\s\S](?!$)/g;if(!_[_0x5167('0x14d')](_0xb8500a))return;for(var _0x43e1c2 in _0xb8500a){if(_[_0x5167('0x14e')](_0xb8500a[_0x43e1c2])){for(var _0xf2ad6b=0x0;_0xf2ad6b<_0xb8500a[_0x43e1c2][_0x5167('0x14f')];_0xf2ad6b++){maskSensitiveData(_0xb8500a[_0x43e1c2][_0xf2ad6b]);}}else if(_[_0x5167('0x14d')](_0xb8500a[_0x43e1c2])){maskSensitiveData(_0xb8500a[_0x43e1c2]);}else if(_['isString'](_0xb8500a[_0x43e1c2])){_0xb8500a[_0x43e1c2]=_0xb8500a[_0x43e1c2][_0x5167('0x150')](/{{{/g,_0x5167('0x151'))[_0x5167('0x150')](/}}}/g,'}@@')['replace'](/{{/g,'@{')[_0x5167('0x150')](/}}/g,'}@');if(_[_0x5167('0x152')](sensitiveFields,_0x43e1c2)){_0xb8500a[_0x43e1c2]=_0xb8500a[_0x43e1c2]['replace'](_0x2af895,'*');}}}}
\ No newline at end of file
+var _0x384a=['./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/jira','/api/rpc','/api/version','/api/system','./api/system','/api/pm2','./api/webbar','static','join','root','/apidoc','/www','/demo','snippet','3.0.0','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','/index.html','username','newPassword','firstName','lastName','phone','mobile','email','clientSecret','securityToken','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','membername','calleridname','calleridnum','exten','vidaooApiKey','privateKey','key','pass','accountSid','dsn','isArray','length','isString','replace','@@{','includes','lodash','path','express','express-winston','./errors','./config/environment','./config/logger','api','auth','use','logger','isEmpty','body','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','user','name','role','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','device','other','agent_name','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','./api/pause','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','./api/tag','./api/template','/api/triggers','./api/trigger','./api/variable','/api/integrations','./api/integration','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','/api/attachments','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','./api/chatTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','./api/voicePrefix','./api/userProfile','./api/userProfileSection','./api/userProfileResource','/api/userNotifications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappQueueReport','/api/whatsapp/reports/transfer'];(function(_0x366e88,_0x15f8b4){var _0x49abce=function(_0x25fee0){while(--_0x25fee0){_0x366e88['push'](_0x366e88['shift']());}};_0x49abce(++_0x15f8b4);}(_0x384a,0x17f));var _0xa384=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x384a[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require(_0xa384('0x0'));var path=require(_0xa384('0x1'));var express=require(_0xa384('0x2'));var ewinston=require(_0xa384('0x3'));var util=require('util');var errors=require(_0xa384('0x4'));var config=require(_0xa384('0x5'));var logger=require(_0xa384('0x6'))(_0xa384('0x7'));var authLogger=require(_0xa384('0x6'))(_0xa384('0x8'));exports['default']=function(_0x393f43){_0x393f43[_0xa384('0x9')](ewinston[_0xa384('0xa')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x4bda3a,_0x428525){var _0x2d8e17='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0xa384('0xb')](_0x4bda3a[_0xa384('0xc')])){_0x2d8e17+='\x20body=%s';var _0x2d90b1=_0x4bda3a['body'];maskSensitiveData(_0x2d90b1);}return util[_0xa384('0xd')](_0x2d8e17,_0x4bda3a[_0xa384('0xe')],_0x4bda3a[_0xa384('0xf')][_0xa384('0x10')]?_0x4bda3a['headers']['x-forwarded-for']:_0x4bda3a[_0xa384('0x11')][_0xa384('0x12')]||_0x4bda3a['ip'],_0x4bda3a[_0xa384('0x13')],_0x428525[_0xa384('0x14')],_0x428525['responseTime'],_0x4bda3a[_0xa384('0x15')]?_0x4bda3a['user']['id']:null,_0x4bda3a['user']?_0x4bda3a[_0xa384('0x15')][_0xa384('0x16')]:null,_0x4bda3a[_0xa384('0x15')]?_0x4bda3a[_0xa384('0x15')][_0xa384('0x17')]:null,_0x2d90b1?util['inspect'](_0x2d90b1,![],null):'');}}));_0x393f43[_0xa384('0x9')](ewinston[_0xa384('0xa')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x33eca6,_0x1b3d88){var _0x308ffd='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x33eca6[_0xa384('0xc')]&&_0x33eca6[_0xa384('0xc')]['device']&&_0x33eca6[_0xa384('0xc')][_0xa384('0x18')]){_0x308ffd=_0xa384('0x19');}return util[_0xa384('0xd')](_0x308ffd,_0x33eca6[_0xa384('0xe')],_0x33eca6[_0xa384('0xf')]['x-forwarded-for']?_0x33eca6['headers'][_0xa384('0x10')]:_0x33eca6['connection'][_0xa384('0x12')]||_0x33eca6['ip'],_0x33eca6[_0xa384('0x13')],_0x1b3d88[_0xa384('0x14')],_0x1b3d88['responseTime'],_0x33eca6[_0xa384('0x15')]?_0x33eca6['user']['id']:null,_0x33eca6[_0xa384('0x15')]?_0x33eca6[_0xa384('0x15')][_0xa384('0x16')]:null,_0x33eca6[_0xa384('0x15')]?_0x33eca6[_0xa384('0x15')][_0xa384('0x17')]:null,_0x33eca6['body']&&_0x33eca6['body'][_0xa384('0x1a')]?_0x33eca6['body'][_0xa384('0x1a')]:_0xa384('0x1b'),_0x33eca6['body']&&_0x33eca6['body'][_0xa384('0x18')]?_0x33eca6['body']['agent_id']:'',_0x33eca6[_0xa384('0xc')]&&_0x33eca6['body'][_0xa384('0x1c')]?_0x33eca6['body']['agent_name']:'');},'ignoreRoute':function(_0x558f35){var _0x1507d2=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1507d2[_0xa384('0x1d')](_0x558f35['url']);}}));_0x393f43[_0xa384('0x9')](_0xa384('0x1e'),require(_0xa384('0x1f')));_0x393f43[_0xa384('0x9')](_0xa384('0x20'),require(_0xa384('0x21')));_0x393f43[_0xa384('0x9')](_0xa384('0x22'),require(_0xa384('0x23')));_0x393f43[_0xa384('0x9')](_0xa384('0x24'),require('./api/voiceExtension'));_0x393f43['use'](_0xa384('0x25'),require(_0xa384('0x26')));_0x393f43[_0xa384('0x9')](_0xa384('0x27'),require(_0xa384('0x28')));_0x393f43[_0xa384('0x9')](_0xa384('0x29'),require(_0xa384('0x2a')));_0x393f43[_0xa384('0x9')](_0xa384('0x2b'),require(_0xa384('0x2c')));_0x393f43['use'](_0xa384('0x2d'),require(_0xa384('0x2e')));_0x393f43[_0xa384('0x9')]('/api/voice/mails/messages',require(_0xa384('0x2f')));_0x393f43[_0xa384('0x9')](_0xa384('0x30'),require(_0xa384('0x31')));_0x393f43[_0xa384('0x9')](_0xa384('0x32'),require(_0xa384('0x33')));_0x393f43['use'](_0xa384('0x34'),require(_0xa384('0x35')));_0x393f43['use'](_0xa384('0x36'),require(_0xa384('0x37')));_0x393f43[_0xa384('0x9')](_0xa384('0x38'),require('./api/memberReport'));_0x393f43[_0xa384('0x9')](_0xa384('0x39'),require(_0xa384('0x3a')));_0x393f43[_0xa384('0x9')](_0xa384('0x3b'),require('./api/voiceTransferReport'));_0x393f43[_0xa384('0x9')]('/api/mail/out_servers',require(_0xa384('0x3c')));_0x393f43[_0xa384('0x9')](_0xa384('0x3d'),require(_0xa384('0x3e')));_0x393f43['use'](_0xa384('0x3f'),require(_0xa384('0x40')));_0x393f43[_0xa384('0x9')](_0xa384('0x41'),require(_0xa384('0x42')));_0x393f43[_0xa384('0x9')]('/api/mail/interactions',require(_0xa384('0x43')));_0x393f43[_0xa384('0x9')](_0xa384('0x44'),require('./api/mailMessage'));_0x393f43[_0xa384('0x9')](_0xa384('0x45'),require(_0xa384('0x46')));_0x393f43['use']('/api/mail/reports/queue',require(_0xa384('0x47')));_0x393f43[_0xa384('0x9')](_0xa384('0x48'),require(_0xa384('0x49')));_0x393f43[_0xa384('0x9')](_0xa384('0x4a'),require('./api/dashboardItem'));_0x393f43[_0xa384('0x9')]('/api/fax/accounts',require(_0xa384('0x4b')));_0x393f43['use'](_0xa384('0x4c'),require(_0xa384('0x4d')));_0x393f43[_0xa384('0x9')](_0xa384('0x4e'),require(_0xa384('0x4f')));_0x393f43[_0xa384('0x9')](_0xa384('0x50'),require('./api/faxMessage'));_0x393f43[_0xa384('0x9')]('/api/fax/queues',require(_0xa384('0x51')));_0x393f43[_0xa384('0x9')]('/api/fax/reports/queue',require(_0xa384('0x52')));_0x393f43[_0xa384('0x9')](_0xa384('0x53'),require('./api/smsAccount'));_0x393f43[_0xa384('0x9')]('/api/sms/applications',require(_0xa384('0x54')));_0x393f43['use'](_0xa384('0x55'),require(_0xa384('0x56')));_0x393f43[_0xa384('0x9')](_0xa384('0x57'),require(_0xa384('0x58')));_0x393f43[_0xa384('0x9')](_0xa384('0x59'),require(_0xa384('0x5a')));_0x393f43[_0xa384('0x9')](_0xa384('0x5b'),require(_0xa384('0x5c')));_0x393f43[_0xa384('0x9')]('/api/openchannel/applications',require('./api/openchannelApplication'));_0x393f43[_0xa384('0x9')](_0xa384('0x5d'),require(_0xa384('0x5e')));_0x393f43[_0xa384('0x9')](_0xa384('0x5f'),require(_0xa384('0x60')));_0x393f43[_0xa384('0x9')](_0xa384('0x61'),require('./api/openchannelQueue'));_0x393f43[_0xa384('0x9')]('/api/chat/websites',require(_0xa384('0x62')));_0x393f43[_0xa384('0x9')](_0xa384('0x63'),require(_0xa384('0x64')));_0x393f43['use'](_0xa384('0x65'),require(_0xa384('0x66')));_0x393f43[_0xa384('0x9')](_0xa384('0x67'),require(_0xa384('0x68')));_0x393f43[_0xa384('0x9')]('/api/chat/messages',require('./api/chatMessage'));_0x393f43['use']('/api/chat/offline_messages',require('./api/chatOfflineMessage'));_0x393f43[_0xa384('0x9')]('/api/chat/queues',require(_0xa384('0x69')));_0x393f43[_0xa384('0x9')](_0xa384('0x6a'),require(_0xa384('0x6b')));_0x393f43['use'](_0xa384('0x6c'),require(_0xa384('0x6d')));_0x393f43[_0xa384('0x9')](_0xa384('0x6e'),require('./api/cmCompany'));_0x393f43['use'](_0xa384('0x6f'),require('./api/cmContact'));_0x393f43[_0xa384('0x9')](_0xa384('0x70'),require(_0xa384('0x71')));_0x393f43[_0xa384('0x9')](_0xa384('0x72'),require(_0xa384('0x73')));_0x393f43['use'](_0xa384('0x74'),require('./api/cmHopperFinal'));_0x393f43[_0xa384('0x9')](_0xa384('0x75'),require(_0xa384('0x76')));_0x393f43[_0xa384('0x9')](_0xa384('0x77'),require(_0xa384('0x78')));_0x393f43[_0xa384('0x9')](_0xa384('0x79'),require(_0xa384('0x7a')));_0x393f43['use'](_0xa384('0x7b'),require(_0xa384('0x7c')));_0x393f43[_0xa384('0x9')](_0xa384('0x7d'),require(_0xa384('0x7e')));_0x393f43[_0xa384('0x9')]('/api/dispositions',require(_0xa384('0x7f')));_0x393f43[_0xa384('0x9')](_0xa384('0x80'),require(_0xa384('0x81')));_0x393f43['use'](_0xa384('0x82'),require(_0xa384('0x83')));_0x393f43[_0xa384('0x9')]('/api/pauses',require(_0xa384('0x84')));_0x393f43[_0xa384('0x9')](_0xa384('0x85'),require(_0xa384('0x86')));_0x393f43[_0xa384('0x9')]('/api/voiceQueuesLog',require(_0xa384('0x87')));_0x393f43[_0xa384('0x9')](_0xa384('0x88'),require(_0xa384('0x89')));_0x393f43[_0xa384('0x9')]('/api/sounds',require(_0xa384('0x8a')));_0x393f43[_0xa384('0x9')]('/api/tags',require(_0xa384('0x8b')));_0x393f43[_0xa384('0x9')]('/api/templates',require(_0xa384('0x8c')));_0x393f43['use'](_0xa384('0x8d'),require(_0xa384('0x8e')));_0x393f43[_0xa384('0x9')]('/api/variables',require(_0xa384('0x8f')));_0x393f43['use'](_0xa384('0x90'),require(_0xa384('0x91')));_0x393f43[_0xa384('0x9')]('/api/integrations/reports',require(_0xa384('0x92')));_0x393f43['use'](_0xa384('0x93'),require(_0xa384('0x94')));_0x393f43[_0xa384('0x9')](_0xa384('0x95'),require(_0xa384('0x96')));_0x393f43[_0xa384('0x9')](_0xa384('0x97'),require(_0xa384('0x98')));_0x393f43[_0xa384('0x9')]('/api/analytics/metrics',require(_0xa384('0x99')));_0x393f43['use']('/api/analytics/field_reports',require(_0xa384('0x9a')));_0x393f43[_0xa384('0x9')](_0xa384('0x9b'),require('./api/analyticTreeReport'));_0x393f43[_0xa384('0x9')]('/api/integrations/salesforce/accounts',require('./api/intSalesforceAccount'));_0x393f43[_0xa384('0x9')](_0xa384('0x9c'),require(_0xa384('0x9d')));_0x393f43['use'](_0xa384('0x9e'),require('./api/intSalesforceField'));_0x393f43[_0xa384('0x9')](_0xa384('0x9f'),require(_0xa384('0xa0')));_0x393f43[_0xa384('0x9')]('/api/integrations/sugarcrm/configurations',require('./api/intSugarcrmConfiguration'));_0x393f43[_0xa384('0x9')](_0xa384('0xa1'),require(_0xa384('0xa2')));_0x393f43[_0xa384('0x9')]('/api/integrations/desk/accounts',require(_0xa384('0xa3')));_0x393f43[_0xa384('0x9')](_0xa384('0xa4'),require(_0xa384('0xa5')));_0x393f43['use'](_0xa384('0xa6'),require(_0xa384('0xa7')));_0x393f43[_0xa384('0x9')](_0xa384('0xa8'),require(_0xa384('0xa9')));_0x393f43['use']('/api/integrations/zoho/configurations',require(_0xa384('0xaa')));_0x393f43[_0xa384('0x9')]('/api/integrations/zoho/fields',require(_0xa384('0xab')));_0x393f43['use'](_0xa384('0xac'),require(_0xa384('0xad')));_0x393f43[_0xa384('0x9')]('/api/integrations/zendesk/configurations',require('./api/intZendeskConfiguration'));_0x393f43[_0xa384('0x9')](_0xa384('0xae'),require(_0xa384('0xaf')));_0x393f43[_0xa384('0x9')](_0xa384('0xb0'),require(_0xa384('0xb1')));_0x393f43[_0xa384('0x9')](_0xa384('0xb2'),require(_0xa384('0xb3')));_0x393f43[_0xa384('0x9')](_0xa384('0xb4'),require('./api/intFreshdeskField'));_0x393f43[_0xa384('0x9')]('/api/integrations/vtiger/accounts',require(_0xa384('0xb5')));_0x393f43['use'](_0xa384('0xb6'),require(_0xa384('0xb7')));_0x393f43[_0xa384('0x9')]('/api/integrations/vtiger/fields',require(_0xa384('0xb8')));_0x393f43['use']('/api/integrations/servicenow/accounts',require(_0xa384('0xb9')));_0x393f43[_0xa384('0x9')](_0xa384('0xba'),require(_0xa384('0xbb')));_0x393f43[_0xa384('0x9')]('/api/integrations/servicenow/fields',require('./api/intServicenowField'));_0x393f43[_0xa384('0x9')](_0xa384('0xbc'),require('./api/intDynamics365Account'));_0x393f43[_0xa384('0x9')](_0xa384('0xbd'),require(_0xa384('0xbe')));_0x393f43['use'](_0xa384('0xbf'),require(_0xa384('0xc0')));_0x393f43['use'](_0xa384('0xc1'),require('./api/intFreshsalesAccount'));_0x393f43['use'](_0xa384('0xc2'),require('./api/intFreshsalesConfiguration'));_0x393f43[_0xa384('0x9')](_0xa384('0xc3'),require(_0xa384('0xc4')));_0x393f43['use'](_0xa384('0xc5'),require(_0xa384('0xc6')));_0x393f43[_0xa384('0x9')](_0xa384('0xc7'),require(_0xa384('0xc8')));_0x393f43[_0xa384('0x9')](_0xa384('0xc9'),require('./api/chatInternalMessage'));_0x393f43[_0xa384('0x9')](_0xa384('0xca'),require('./api/jscriptyAnswerReport'));_0x393f43[_0xa384('0x9')](_0xa384('0xcb'),require(_0xa384('0xcc')));_0x393f43['use'](_0xa384('0xcd'),require(_0xa384('0xce')));_0x393f43[_0xa384('0x9')](_0xa384('0xcf'),require(_0xa384('0xd0')));_0x393f43['use']('/api/square/reports',require('./api/squareReport'));_0x393f43[_0xa384('0x9')]('/api/square/details/reports',require(_0xa384('0xd1')));_0x393f43[_0xa384('0x9')](_0xa384('0xd2'),require(_0xa384('0xd3')));_0x393f43[_0xa384('0x9')](_0xa384('0xd4'),require(_0xa384('0xd5')));_0x393f43[_0xa384('0x9')](_0xa384('0xd6'),require(_0xa384('0xd7')));_0x393f43[_0xa384('0x9')](_0xa384('0xd8'),require(_0xa384('0xd9')));_0x393f43[_0xa384('0x9')](_0xa384('0xda'),require(_0xa384('0xdb')));_0x393f43[_0xa384('0x9')](_0xa384('0xdc'),require(_0xa384('0xdd')));_0x393f43['use'](_0xa384('0xde'),require(_0xa384('0xdf')));_0x393f43[_0xa384('0x9')](_0xa384('0xe0'),require(_0xa384('0xe1')));_0x393f43[_0xa384('0x9')](_0xa384('0xe2'),require('./api/campaign'));_0x393f43['use']('/api/migrations',require('./api/migration'));_0x393f43[_0xa384('0x9')](_0xa384('0xe3'),require(_0xa384('0xe4')));_0x393f43[_0xa384('0x9')](_0xa384('0xe5'),require(_0xa384('0xe6')));_0x393f43['use']('/api/mail/reports/transfer',require(_0xa384('0xe7')));_0x393f43['use']('/api/chat/reports/transfer',require(_0xa384('0xe8')));_0x393f43['use']('/api/fax/reports/transfer',require('./api/faxTransferReport'));_0x393f43[_0xa384('0x9')]('/api/openchannel/reports/transfer',require(_0xa384('0xe9')));_0x393f43['use'](_0xa384('0xea'),require(_0xa384('0xeb')));_0x393f43[_0xa384('0x9')]('/api/cm/lists',require(_0xa384('0xec')));_0x393f43[_0xa384('0x9')](_0xa384('0xed'),require(_0xa384('0xee')));_0x393f43['use']('/api/userProfiles',require(_0xa384('0xef')));_0x393f43[_0xa384('0x9')]('/api/userProfile/sections',require(_0xa384('0xf0')));_0x393f43[_0xa384('0x9')]('/api/userProfile/resources',require(_0xa384('0xf1')));_0x393f43[_0xa384('0x9')](_0xa384('0xf2'),require('./api/userNotification'));_0x393f43[_0xa384('0x9')]('/api/whatsapp/accounts',require('./api/whatsappAccount'));_0x393f43[_0xa384('0x9')]('/api/whatsapp/applications',require(_0xa384('0xf3')));_0x393f43[_0xa384('0x9')](_0xa384('0xf4'),require(_0xa384('0xf5')));_0x393f43['use'](_0xa384('0xf6'),require('./api/whatsappMessage'));_0x393f43[_0xa384('0x9')]('/api/whatsapp/reports/queue',require(_0xa384('0xf7')));_0x393f43[_0xa384('0x9')](_0xa384('0xf8'),require(_0xa384('0xf9')));_0x393f43[_0xa384('0x9')](_0xa384('0xfa'),require(_0xa384('0xfb')));_0x393f43[_0xa384('0x9')](_0xa384('0xfc'),require(_0xa384('0xfd')));_0x393f43[_0xa384('0x9')](_0xa384('0xfe'),require(_0xa384('0xff')));_0x393f43[_0xa384('0x9')](_0xa384('0x100'),require(_0xa384('0x101')));_0x393f43['use'](_0xa384('0x102'),require(_0xa384('0x103')));_0x393f43['use'](_0xa384('0x104'),require(_0xa384('0x105')));_0x393f43[_0xa384('0x9')](_0xa384('0x106'),require('./api/rpc'));_0x393f43[_0xa384('0x9')](_0xa384('0x107'),require('./api/version'));_0x393f43[_0xa384('0x9')](_0xa384('0x108'),require(_0xa384('0x109')));_0x393f43[_0xa384('0x9')](_0xa384('0x10a'),require('./api/pm2'));_0x393f43[_0xa384('0x9')]('/api/webbar',require(_0xa384('0x10b')));_0x393f43['use']('/apidoc',express[_0xa384('0x10c')](path[_0xa384('0x10d')](config[_0xa384('0x10e')],_0xa384('0x10f'))));_0x393f43['use'](_0xa384('0x110'),express[_0xa384('0x10c')](path[_0xa384('0x10d')](config['root'],'/www')));_0x393f43[_0xa384('0x9')](_0xa384('0x111'),express[_0xa384('0x10c')](path[_0xa384('0x10d')](config['root'],_0xa384('0x111'))));_0x393f43[_0xa384('0x9')]('/snippet',express['static'](path[_0xa384('0x10d')](config['root'],_0xa384('0x112'),_0xa384('0x113'))));_0x393f43[_0xa384('0x9')]('/plugins',express[_0xa384('0x10c')](path[_0xa384('0x10d')](config[_0xa384('0x10e')],_0xa384('0x114'))));_0x393f43[_0xa384('0x115')](_0xa384('0x116'))[_0xa384('0x117')](errors[0x194]);_0x393f43[_0xa384('0x115')]('/*')[_0xa384('0x117')](function(_0x4c0a80,_0x13fa3b){_0x13fa3b['sendFile'](path[_0xa384('0x118')](_0x393f43[_0xa384('0x117')](_0xa384('0x119'))+_0xa384('0x11a')));});};var sensitiveFields=[_0xa384('0x11b'),'password',_0xa384('0x11c'),'apiKey',_0xa384('0x11d'),_0xa384('0x11e'),'street',_0xa384('0x11f'),_0xa384('0x120'),'fax',_0xa384('0x121'),'clientId',_0xa384('0x122'),_0xa384('0x123'),'code',_0xa384('0x124'),_0xa384('0x125'),_0xa384('0x126'),_0xa384('0x127'),_0xa384('0x128'),_0xa384('0x129'),_0xa384('0x12a'),_0xa384('0x12b'),'consumerSecret',_0xa384('0x12c'),_0xa384('0x12d'),_0xa384('0x12e'),_0xa384('0x12f'),_0xa384('0x130'),'clientEmail',_0xa384('0x131'),'accesskeyid','secretaccesskey',_0xa384('0x132'),_0xa384('0x15'),_0xa384('0x133'),_0xa384('0x134'),'localstationid',_0xa384('0x135'),'secret','registry','oldPassword'];function maskSensitiveData(_0x3911bf){var _0x30e5b7=/(?!^)[\s\S](?!$)/g;if(!_['isPlainObject'](_0x3911bf))return;for(var _0x29c366 in _0x3911bf){if(_[_0xa384('0x136')](_0x3911bf[_0x29c366])){for(var _0xeb65ce=0x0;_0xeb65ce<_0x3911bf[_0x29c366][_0xa384('0x137')];_0xeb65ce++){maskSensitiveData(_0x3911bf[_0x29c366][_0xeb65ce]);}}else if(_['isPlainObject'](_0x3911bf[_0x29c366])){maskSensitiveData(_0x3911bf[_0x29c366]);}else if(_[_0xa384('0x138')](_0x3911bf[_0x29c366])){_0x3911bf[_0x29c366]=_0x3911bf[_0x29c366][_0xa384('0x139')](/{{{/g,_0xa384('0x13a'))[_0xa384('0x139')](/}}}/g,'}@@')['replace'](/{{/g,'@{')[_0xa384('0x139')](/}}/g,'}@');if(_[_0xa384('0x13b')](sensitiveFields,_0x29c366)){_0x3911bf[_0x29c366]=_0x3911bf[_0x29c366]['replace'](_0x30e5b7,'*');}}}}
\ No newline at end of file
index f375580..19c3f79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc648=['listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.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','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','jayson/promise','bluebird','lodash'];(function(_0x997ede,_0x5a0814){var _0x1f3288=function(_0x5ddd2a){while(--_0x5ddd2a){_0x997ede['push'](_0x997ede['shift']());}};_0x1f3288(++_0x5a0814);}(_0xc648,0xf9));var _0x8c64=function(_0x50f356,_0x39d0d9){_0x50f356=_0x50f356-0x0;var _0x36bca1=_0xc648[_0x50f356];return _0x36bca1;};'use strict';var jayson=require(_0x8c64('0x0'));var BPromise=require(_0x8c64('0x1'));var _=require(_0x8c64('0x2'));var config=require('../config/environment');exports[_0x8c64('0x3')]=function(){return new BPromise(function(_0x319948,_0x10292a){var _0xbd5ca4={};_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/user/user.rpc'));_0xbd5ca4=_['merge'](_0xbd5ca4,require(_0x8c64('0x5')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x6')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x7')));_0xbd5ca4=_['merge'](_0xbd5ca4,require(_0x8c64('0x8')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x9')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0xa')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/memberReport/memberReport.rpc'));_0xbd5ca4=_['merge'](_0xbd5ca4,require(_0x8c64('0xb')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0xc')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0xd')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0xe')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/mailQueue/mailQueue.rpc'));_0xbd5ca4=_['merge'](_0xbd5ca4,require(_0x8c64('0xf')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x10')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/mailApplication/mailApplication.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x11')));_0xbd5ca4=_['merge'](_0xbd5ca4,require('../api/faxAccount/faxAccount.rpc'));_0xbd5ca4=_['merge'](_0xbd5ca4,require(_0x8c64('0x12')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x13')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x14')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x15')));_0xbd5ca4=_['merge'](_0xbd5ca4,require('../api/faxQueueReport/faxQueueReport.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x16')));_0xbd5ca4=_['merge'](_0xbd5ca4,require(_0x8c64('0x17')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/smsMessage/smsMessage.rpc'));_0xbd5ca4=_['merge'](_0xbd5ca4,require(_0x8c64('0x18')));_0xbd5ca4=_['merge'](_0xbd5ca4,require('../api/openchannelApplication/openchannelApplication.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x19')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x1a')));_0xbd5ca4=_['merge'](_0xbd5ca4,require('../api/openchannelQueue/openchannelQueue.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x1b')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/chatInteraction/chatInteraction.rpc'));_0xbd5ca4=_['merge'](_0xbd5ca4,require('../api/chatMessage/chatMessage.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x1c')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x1d')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/cmHopper/cmHopper.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x1e')));_0xbd5ca4=_['merge'](_0xbd5ca4,require(_0x8c64('0x1f')));_0xbd5ca4=_['merge'](_0xbd5ca4,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x20')));_0xbd5ca4=_['merge'](_0xbd5ca4,require(_0x8c64('0x21')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/pause/pause.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/sound/sound.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/template/template.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x22')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x23')));_0xbd5ca4=_['merge'](_0xbd5ca4,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x24')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/intZohoAccount/intZohoAccount.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x25')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x26')));_0xbd5ca4=_['merge'](_0xbd5ca4,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x27')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x28')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x29')));_0xbd5ca4=_['merge'](_0xbd5ca4,require(_0x8c64('0x2a')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x2b')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x2c')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x2d')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/squareProject/squareProject.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x2e')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/squareMessage/squareMessage.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x2f')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x30')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/plugin/plugin.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x31')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x32')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x33')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x34')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x35')));var _0x4509bb=jayson[_0x8c64('0x36')](_0xbd5ca4)[_0x8c64('0x37')]();var _0x2486e5=config[_0x8c64('0x38')][_0x8c64('0x39')]||config[_0x8c64('0x39')]+0x1;var _0x3ebe92=config[_0x8c64('0x38')]['ip']||_0x8c64('0x3a');_0x4509bb['on'](_0x8c64('0x3b'),function(_0x288e0b){return _0x10292a(_0x288e0b);});_0x4509bb[_0x8c64('0x3')](_0x2486e5,_0x3ebe92,function(){console[_0x8c64('0x3c')](_0x8c64('0x3d'),_0x3ebe92,_0x2486e5);require('../config/triggers')[_0x8c64('0x3e')]();return _0x319948('RPC\x20listening\x20on\x20'+_0x3ebe92+':'+_0x2486e5);});});};
\ No newline at end of file
+var _0x8858=['../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','port','rpc','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','RPC\x20listening\x20on\x20','lodash','listen','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc'];(function(_0x4a82ac,_0x1fb931){var _0x58ee97=function(_0xc7050a){while(--_0xc7050a){_0x4a82ac['push'](_0x4a82ac['shift']());}};_0x58ee97(++_0x1fb931);}(_0x8858,0x182));var _0x8885=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x8858[_0x5d4607];return _0x5e4a86;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var _=require(_0x8885('0x0'));var config=require('../config/environment');exports[_0x8885('0x1')]=function(){return new BPromise(function(_0x1cd881,_0x594ba7){var _0x2c7222={};_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x3')));_0x2c7222=_['merge'](_0x2c7222,require('../api/voiceExtension/voiceExtension.rpc'));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x4')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x5')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x6')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x7')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x8')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x9')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0xa')));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0xb')));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0xc')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require('../api/mailServerIn/mailServerIn.rpc'));_0x2c7222=_['merge'](_0x2c7222,require('../api/mailAccount/mailAccount.rpc'));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0xd')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0xe')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0xf')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x10')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x11')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require('../api/faxAccount/faxAccount.rpc'));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x12')));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x13')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require('../api/faxMessage/faxMessage.rpc'));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x14')));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x15')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x16')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x17')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x18')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x19')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x1a')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x1b')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x1c')));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x1d')));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x1e')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x1f')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x20')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require('../api/chatQueue/chatQueue.rpc'));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x21')));_0x2c7222=_['merge'](_0x2c7222,require('../api/cmHopper/cmHopper.rpc'));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x22')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x23')));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x24')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x25')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x26')));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x27')));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x28')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x29')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x2a')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x2b')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x2c')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x2d')));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x2e')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x2f')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x30')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x31')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x32')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x33')));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x34')));_0x2c7222=_['merge'](_0x2c7222,require('../api/squareOdbc/squareOdbc.rpc'));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x35')));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x36')));_0x2c7222=_['merge'](_0x2c7222,require('../api/squareMessage/squareMessage.rpc'));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x37')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x38')));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x39')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x3a')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x3b')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x3c')));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x3d')));var _0x50bd64=jayson['server'](_0x2c7222)['http']();var _0xd18e65=config['rpc'][_0x8885('0x3e')]||config[_0x8885('0x3e')]+0x1;var _0x39bf9c=config[_0x8885('0x3f')]['ip']||_0x8885('0x40');_0x50bd64['on'](_0x8885('0x41'),function(_0x29ef78){return _0x594ba7(_0x29ef78);});_0x50bd64[_0x8885('0x1')](_0xd18e65,_0x39bf9c,function(){console[_0x8885('0x42')](_0x8885('0x43'),_0x39bf9c,_0xd18e65);require('../config/triggers')[_0x8885('0x44')]();return _0x1cd881(_0x8885('0x45')+_0x39bf9c+':'+_0xd18e65);});});};
\ No newline at end of file
index a3820c2..9c57d8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa423=['lodash','events','EventEmitter','./reply','call','setEncoding','utf8','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','no\x20code','replace','result=','substr','startsWith','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','function','write','inherits','prototype','sendRequest','sync','answer','ANSWER','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','extension','setContext','setPriority','getVariable','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','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util'];(function(_0x152720,_0x413122){var _0x47956c=function(_0x559252){while(--_0x559252){_0x152720['push'](_0x152720['shift']());}};_0x47956c(++_0x413122);}(_0xa423,0x16c));var _0x3a42=function(_0x26ce6f,_0x1ce3ca){_0x26ce6f=_0x26ce6f-0x0;var _0x18368d=_0xa423[_0x26ce6f];return _0x18368d;};'use strict';var util=require(_0x3a42('0x0'));var _=require(_0x3a42('0x1'));var EventEmitter=require(_0x3a42('0x2'))[_0x3a42('0x3')];var AGIReply=require(_0x3a42('0x4'));var AGIError=require('./error');function AGIChannel(_0x28bbcd){var _0x857de4=this,_0x5c4f6a=new AGIReply(),_0xc6780b=![],_0x33f87e={};EventEmitter[_0x3a42('0x5')](_0x857de4);_0x28bbcd[_0x3a42('0x6')](_0x3a42('0x7'));_0x28bbcd['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x5c4f6a[_0x3a42('0x6')](_0x3a42('0x7'));_0x5c4f6a['on'](_0x3a42('0x8'),function(_0x3a08a1){for(var _0x1be0b7 in _0x3a08a1){_0x857de4[_0x1be0b7]=_0x3a08a1[_0x1be0b7];}_0x857de4[_0x3a42('0x9')](_0x3a42('0xa'));});_0x5c4f6a['on'](_0x3a42('0xb'),function(_0x1aba7e){if(_0x1aba7e[_0x3a42('0xc')]()==_0x3a42('0xd')){_0x857de4['emit'](_0x3a42('0xd'));return;}if(_0x1aba7e[_0x3a42('0xe')](0x0,0xb)==_0x3a42('0xf')){_0xc6780b=!![];}if(_0xc6780b){_0x33f87e['rx']+=_0x1aba7e+'\x0a';if(_0x1aba7e[_0x3a42('0x10')]('520\x20End\x20of\x20proper')!=-0x1){_0xc6780b=![];}}else{_0x33f87e['rx']=_0x1aba7e;}if(_0xc6780b){return;}if(typeof _0x33f87e['cb']=='function'){var _0x11ccc8=_0x33f87e['rx'][_0x3a42('0xe')](0x0,0x3),_0x4df153=null,_0x4008ea=null;_0x11ccc8=parseInt(_0x11ccc8);if(isNaN(_0x11ccc8)){_0x33f87e['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x3a42('0x11')});return;}if(_0x11ccc8!=0xc8){_0x33f87e['cb'](null,{'code':_0x11ccc8,'result':-0x1,'extra':'KO'});return;}_0x4df153=_0x33f87e['rx'][_0x3a42('0xe')](0x4)[_0x3a42('0x12')](_0x3a42('0x13'),'');if(_0x4df153['indexOf']('\x20')!=-0x1){_0x4df153=_0x4df153[_0x3a42('0x14')](0x0,_0x4df153['indexOf']('\x20'));}if(_[_0x3a42('0x15')](_0x4df153,'-1')){_0x4df153=parseInt(_0x4df153);}_0x4008ea=_0x33f87e['rx']['split']('\x20');if(_0x4008ea[_0x3a42('0x16')]==0x3){_0x4008ea=_0x4008ea[0x2][_0x3a42('0xe')](0x1,_0x4008ea[0x2][_0x3a42('0x16')]-0x1);}else if(_0x4008ea['length']>0x3){var _0x486c74=/\((.+)\)/;var _0x4eae89=_0x33f87e['rx'][_0x3a42('0x17')](_0x486c74);if(_0x4eae89){_0x4008ea=_0x4eae89[0x1];}else{_0x4008ea=null;}}else{_0x4008ea=null;}_0x33f87e['cb'](null,{'code':_0x11ccc8,'result':_0x4df153,'extra':_0x4008ea});}});_0x28bbcd['on'](_0x3a42('0x18'),function(_0x438cf1){_0x857de4[_0x3a42('0x9')](_0x3a42('0x18'),new AGIError('E_AGI_SOCKET_ERROR',_0x438cf1[_0x3a42('0x19')]));});_0x28bbcd['on'](_0x3a42('0x1a'),function(){_0x857de4[_0x3a42('0x9')](_0x3a42('0x1a'),new AGIError(_0x3a42('0x1b')));});_0x28bbcd['on'](_0x3a42('0x1c'),function(){_0x857de4['emit'](_0x3a42('0x1c'),new AGIError(_0x3a42('0x1d')));_0x28bbcd[_0x3a42('0x1e')]();});_0x28bbcd[_0x3a42('0x1f')](_0x5c4f6a);this[_0x3a42('0x20')]=function(_0x526d7c,_0x34927a){var _0x526d7c=_0x526d7c||'',_0x34927a=typeof _0x34927a==_0x3a42('0x21')?_0x34927a:new Function();_0x33f87e={'tx':_0x526d7c,'rx':'','cb':_0x34927a};_0x28bbcd[_0x3a42('0x22')](_0x526d7c+'\x0a');},this['close']=function(){_0x28bbcd[_0x3a42('0x1e')]();};}util[_0x3a42('0x23')](AGIChannel,EventEmitter);AGIChannel[_0x3a42('0x24')][_0x3a42('0x25')]=function(_0x1540e5){return this[_0x3a42('0x20')][_0x3a42('0x26')](this,_0x1540e5);};AGIChannel[_0x3a42('0x24')][_0x3a42('0x27')]=function(){return this[_0x3a42('0x25')](_0x3a42('0x28'));};AGIChannel['prototype'][_0x3a42('0x29')]=function(_0x468ea8,_0x4b3062,_0x3027dd){_0x468ea8=_0x468ea8===undefined?'beep':_0x468ea8;_0x4b3062=_0x4b3062===undefined?'5':_0x4b3062;_0x3027dd=_0x3027dd===undefined?'1':_0x3027dd;return this[_0x3a42('0x25')](util[_0x3a42('0x2a')](_0x3a42('0x2b'),_0x468ea8,_0x4b3062*0x3e8,_0x3027dd));};AGIChannel[_0x3a42('0x24')][_0x3a42('0x2c')]=function(_0xaf28ad){_0xaf28ad=_0xaf28ad||'NO\x20MESSAGE';return this[_0x3a42('0x25')](util[_0x3a42('0x2a')](_0x3a42('0x2d'),_0xaf28ad));};AGIChannel[_0x3a42('0x24')][_0x3a42('0x2e')]=function(_0x44ef39,_0x41776f){if(_['isArray'](_0x41776f)){return this[_0x3a42('0x25')](util[_0x3a42('0x2a')](_0x3a42('0x2f'),_0x44ef39,_0x41776f[_0x3a42('0x30')](',')));}return this[_0x3a42('0x25')](util['format']('EXEC\x20%s\x20%s',_0x44ef39,_0x41776f));};AGIChannel[_0x3a42('0x24')]['setContext']=function(_0x3fb07d){return this[_0x3a42('0x25')](util[_0x3a42('0x2a')](_0x3a42('0x31'),_0x3fb07d));};AGIChannel[_0x3a42('0x24')][_0x3a42('0x32')]=function(_0x57123d){return this[_0x3a42('0x25')](util[_0x3a42('0x2a')](_0x3a42('0x33'),_0x57123d));};AGIChannel['prototype']['setPriority']=function(_0x41df56){return this[_0x3a42('0x25')](util[_0x3a42('0x2a')](_0x3a42('0x34'),_0x41df56));};AGIChannel[_0x3a42('0x24')]['hangup']=function(){return this['sendRequest'](_0x3a42('0x35'));};AGIChannel[_0x3a42('0x24')][_0x3a42('0x36')]=function(_0x28794e,_0x49e720){var _0x32992e=_[_0x3a42('0x37')](_0x49e720)||_['isNumber'](_0x49e720)?_0x49e720['toString']():_0x49e720;return this['sendRequest'](util[_0x3a42('0x2a')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x28794e,_0x32992e?_0x32992e[_0x3a42('0x38')]()[_0x3a42('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x3a42('0x24')][_0x3a42('0x39')]=function(_0x20bfb6,_0x3cda8c){return this[_0x3a42('0x25')](util[_0x3a42('0x2a')](_0x3a42('0x3a'),_0x20bfb6,_0x3cda8c));};AGIChannel['prototype'][_0x3a42('0x3b')]=function(_0x3a33f3,_0x2541db){return this[_0x3a42('0x25')](util[_0x3a42('0x2a')]('SAY\x20DIGITS\x20%s\x20%s',_0x3a33f3,_0x2541db));};AGIChannel[_0x3a42('0x24')]['sayPhonetic']=function(_0x4e9224,_0x4d356d){return this['sendRequest'](util[_0x3a42('0x2a')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x4e9224,_0x4d356d));};AGIChannel['prototype']['continueAt']=function(_0x32b3a0,_0x5bb3df,_0x4d8d60){_0x5bb3df=_0x5bb3df||this[_0x3a42('0x3c')];_0x4d8d60=_0x4d8d60||0x1;this[_0x3a42('0x3d')](_0x32b3a0);this[_0x3a42('0x32')](_0x5bb3df);this[_0x3a42('0x3e')](_0x4d8d60);return this[_0x3a42('0x2c')](util[_0x3a42('0x2a')]('GOTO\x20%s\x20%s\x20%s',_0x32b3a0,_0x5bb3df,_0x4d8d60));};AGIChannel[_0x3a42('0x24')][_0x3a42('0x3f')]=function(_0x3e5f89){return this['sendRequest'](util[_0x3a42('0x2a')](_0x3a42('0x40'),_0x3e5f89));};AGIChannel['prototype'][_0x3a42('0x41')]=function(_0x463617,_0x3b7e7d,_0x96f531,_0x452b9c,_0x395fc6,_0x473dac){_0x3b7e7d=_0x3b7e7d||'wav';_0x96f531=_0x96f531||'';_0x452b9c=_0x452b9c===undefined?-0x1:_0x452b9c==='-1'?-0x1:_0x452b9c*0x3e8;_0x395fc6=_0x395fc6===undefined?'':'s='+_0x395fc6;_0x473dac=_0x473dac?_0x3a42('0x42'):'';return this[_0x3a42('0x25')](util[_0x3a42('0x2a')](_0x3a42('0x43'),_0x463617,_0x3b7e7d,_0x96f531,_0x452b9c,_0x473dac,_0x395fc6));};AGIChannel[_0x3a42('0x24')]['streamFile']=function(_0x4ad40c,_0x258026){_0x258026=_0x258026||'';return this[_0x3a42('0x25')](util['format'](_0x3a42('0x44'),_0x4ad40c,_0x258026));};AGIChannel[_0x3a42('0x24')][_0x3a42('0x45')]=function(_0x1645b8){return this[_0x3a42('0x2e')]('AGI',_0x1645b8);};AGIChannel[_0x3a42('0x24')][_0x3a42('0x46')]=function(_0x3a3293){return this[_0x3a42('0x2e')]('WAIT',_0x3a3293);};AGIChannel[_0x3a42('0x24')][_0x3a42('0x18')]=function(_0x3d4897,_0x2d3e3c){this[_0x3a42('0x2c')](util[_0x3a42('0x2a')](_0x3a42('0x47'),_0x3d4897['id'],_0x3d4897['label'],_0x2d3e3c));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x3a42('0x48')]=AGIChannel;
\ No newline at end of file
+var _0x8a25=['sendRequest','sync','prototype','answer','ANSWER','getData','format','noop','NO\x20MESSAGE','exec','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','setPriority','setVariable','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','emit','ready','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','command','write','inherits'];(function(_0x44748f,_0x41e09f){var _0x5139cf=function(_0x462b07){while(--_0x462b07){_0x44748f['push'](_0x44748f['shift']());}};_0x5139cf(++_0x41e09f);}(_0x8a25,0xb7));var _0x58a2=function(_0x25a5ba,_0xfa6304){_0x25a5ba=_0x25a5ba-0x0;var _0x4fbd32=_0x8a25[_0x25a5ba];return _0x4fbd32;};'use strict';var util=require(_0x58a2('0x0'));var _=require(_0x58a2('0x1'));var EventEmitter=require(_0x58a2('0x2'))[_0x58a2('0x3')];var AGIReply=require(_0x58a2('0x4'));var AGIError=require(_0x58a2('0x5'));function AGIChannel(_0x50fb66){var _0x130516=this,_0x5abbe9=new AGIReply(),_0x49d684=![],_0x403b8e={};EventEmitter[_0x58a2('0x6')](_0x130516);_0x50fb66[_0x58a2('0x7')](_0x58a2('0x8'));_0x50fb66[_0x58a2('0x9')](0x8*0x3c*0x3c*0x3e8);_0x5abbe9[_0x58a2('0x7')](_0x58a2('0x8'));_0x5abbe9['on']('headers',function(_0x31c4c0){for(var _0x12d2b8 in _0x31c4c0){_0x130516[_0x12d2b8]=_0x31c4c0[_0x12d2b8];}_0x130516[_0x58a2('0xa')](_0x58a2('0xb'));});_0x5abbe9['on']('line',function(_0x48c230){if(_0x48c230[_0x58a2('0xc')]()=='hangup'){_0x130516['emit'](_0x58a2('0xd'));return;}if(_0x48c230[_0x58a2('0xe')](0x0,0xb)==_0x58a2('0xf')){_0x49d684=!![];}if(_0x49d684){_0x403b8e['rx']+=_0x48c230+'\x0a';if(_0x48c230[_0x58a2('0x10')](_0x58a2('0x11'))!=-0x1){_0x49d684=![];}}else{_0x403b8e['rx']=_0x48c230;}if(_0x49d684){return;}if(typeof _0x403b8e['cb']==_0x58a2('0x12')){var _0x52c57d=_0x403b8e['rx'][_0x58a2('0xe')](0x0,0x3),_0x4f2259=null,_0xedaa71=null;_0x52c57d=parseInt(_0x52c57d);if(isNaN(_0x52c57d)){_0x403b8e['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x58a2('0x13')});return;}if(_0x52c57d!=0xc8){_0x403b8e['cb'](null,{'code':_0x52c57d,'result':-0x1,'extra':'KO'});return;}_0x4f2259=_0x403b8e['rx'][_0x58a2('0xe')](0x4)[_0x58a2('0x14')](_0x58a2('0x15'),'');if(_0x4f2259[_0x58a2('0x16')]('\x20')!=-0x1){_0x4f2259=_0x4f2259[_0x58a2('0x17')](0x0,_0x4f2259[_0x58a2('0x16')]('\x20'));}if(_[_0x58a2('0x18')](_0x4f2259,'-1')){_0x4f2259=parseInt(_0x4f2259);}_0xedaa71=_0x403b8e['rx'][_0x58a2('0x19')]('\x20');if(_0xedaa71[_0x58a2('0x1a')]==0x3){_0xedaa71=_0xedaa71[0x2]['substring'](0x1,_0xedaa71[0x2]['length']-0x1);}else if(_0xedaa71[_0x58a2('0x1a')]>0x3){var _0x5a138e=/\((.+)\)/;var _0x1855cc=_0x403b8e['rx'][_0x58a2('0x1b')](_0x5a138e);if(_0x1855cc){_0xedaa71=_0x1855cc[0x1];}else{_0xedaa71=null;}}else{_0xedaa71=null;}_0x403b8e['cb'](null,{'code':_0x52c57d,'result':_0x4f2259,'extra':_0xedaa71});}});_0x50fb66['on'](_0x58a2('0x1c'),function(_0x556789){_0x130516[_0x58a2('0xa')]('error',new AGIError(_0x58a2('0x1d'),_0x556789[_0x58a2('0x1e')]));});_0x50fb66['on']('close',function(){_0x130516[_0x58a2('0xa')](_0x58a2('0x1f'),new AGIError(_0x58a2('0x20')));});_0x50fb66['on'](_0x58a2('0x21'),function(){_0x130516[_0x58a2('0xa')]('timeout',new AGIError(_0x58a2('0x22')));_0x50fb66[_0x58a2('0x23')]();});_0x50fb66['pipe'](_0x5abbe9);this[_0x58a2('0x24')]=function(_0x1b5c94,_0x589c99){var _0x1b5c94=_0x1b5c94||'',_0x589c99=typeof _0x589c99==_0x58a2('0x12')?_0x589c99:new Function();_0x403b8e={'tx':_0x1b5c94,'rx':'','cb':_0x589c99};_0x50fb66[_0x58a2('0x25')](_0x1b5c94+'\x0a');},this[_0x58a2('0x1f')]=function(){_0x50fb66[_0x58a2('0x23')]();};}util[_0x58a2('0x26')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x58a2('0x27')]=function(_0x2c867b){return this[_0x58a2('0x24')][_0x58a2('0x28')](this,_0x2c867b);};AGIChannel[_0x58a2('0x29')][_0x58a2('0x2a')]=function(){return this[_0x58a2('0x27')](_0x58a2('0x2b'));};AGIChannel[_0x58a2('0x29')][_0x58a2('0x2c')]=function(_0xda514d,_0x39fe90,_0x1e3db5){_0xda514d=_0xda514d===undefined?'beep':_0xda514d;_0x39fe90=_0x39fe90===undefined?'5':_0x39fe90;_0x1e3db5=_0x1e3db5===undefined?'1':_0x1e3db5;return this[_0x58a2('0x27')](util[_0x58a2('0x2d')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0xda514d,_0x39fe90*0x3e8,_0x1e3db5));};AGIChannel[_0x58a2('0x29')][_0x58a2('0x2e')]=function(_0x20f1ac){_0x20f1ac=_0x20f1ac||_0x58a2('0x2f');return this['sendRequest'](util[_0x58a2('0x2d')]('VERBOSE\x20\x22%s\x22',_0x20f1ac));};AGIChannel[_0x58a2('0x29')][_0x58a2('0x30')]=function(_0x74a746,_0x5ad156){if(_['isArray'](_0x5ad156)){return this['sendRequest'](util[_0x58a2('0x2d')](_0x58a2('0x31'),_0x74a746,_0x5ad156['join'](',')));}return this[_0x58a2('0x27')](util[_0x58a2('0x2d')](_0x58a2('0x31'),_0x74a746,_0x5ad156));};AGIChannel[_0x58a2('0x29')][_0x58a2('0x32')]=function(_0x1a2c87){return this['sendRequest'](util[_0x58a2('0x2d')](_0x58a2('0x33'),_0x1a2c87));};AGIChannel['prototype'][_0x58a2('0x34')]=function(_0x4f0828){return this[_0x58a2('0x27')](util[_0x58a2('0x2d')]('SET\x20EXTENSION\x20%s',_0x4f0828));};AGIChannel['prototype'][_0x58a2('0x35')]=function(_0x496df9){return this['sendRequest'](util[_0x58a2('0x2d')]('SET\x20PRIORITY\x20%s',_0x496df9));};AGIChannel[_0x58a2('0x29')][_0x58a2('0xd')]=function(){return this[_0x58a2('0x27')]('HANGUP');};AGIChannel['prototype'][_0x58a2('0x36')]=function(_0x58bbac,_0x48d51b){var _0x3e0ac2=_['isBoolean'](_0x48d51b)||_[_0x58a2('0x37')](_0x48d51b)?_0x48d51b[_0x58a2('0x38')]():_0x48d51b;return this[_0x58a2('0x27')](util['format'](_0x58a2('0x39'),_0x58bbac,_0x3e0ac2?_0x3e0ac2[_0x58a2('0x38')]()[_0x58a2('0x14')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x58a2('0x29')][_0x58a2('0x3a')]=function(_0x11c879,_0x51a724){return this[_0x58a2('0x27')](util[_0x58a2('0x2d')]('SAY\x20NUMBER\x20%s\x20%s',_0x11c879,_0x51a724));};AGIChannel[_0x58a2('0x29')]['sayDigits']=function(_0x3f14da,_0x5dd471){return this[_0x58a2('0x27')](util[_0x58a2('0x2d')](_0x58a2('0x3b'),_0x3f14da,_0x5dd471));};AGIChannel['prototype'][_0x58a2('0x3c')]=function(_0x4be809,_0x55d7fc){return this[_0x58a2('0x27')](util['format'](_0x58a2('0x3d'),_0x4be809,_0x55d7fc));};AGIChannel[_0x58a2('0x29')]['continueAt']=function(_0x23aa6d,_0x1d8f88,_0x55b6ce){_0x1d8f88=_0x1d8f88||this[_0x58a2('0x3e')];_0x55b6ce=_0x55b6ce||0x1;this[_0x58a2('0x32')](_0x23aa6d);this[_0x58a2('0x34')](_0x1d8f88);this['setPriority'](_0x55b6ce);return this[_0x58a2('0x2e')](util[_0x58a2('0x2d')](_0x58a2('0x3f'),_0x23aa6d,_0x1d8f88,_0x55b6ce));};AGIChannel[_0x58a2('0x29')][_0x58a2('0x40')]=function(_0x2496b8){return this['sendRequest'](util['format']('GET\x20VARIABLE\x20\x22%s\x22',_0x2496b8));};AGIChannel['prototype'][_0x58a2('0x41')]=function(_0x44ca3e,_0xc621b4,_0x50f5b6,_0x118351,_0x162d41,_0x2198ff){_0xc621b4=_0xc621b4||'wav';_0x50f5b6=_0x50f5b6||'';_0x118351=_0x118351===undefined?-0x1:_0x118351==='-1'?-0x1:_0x118351*0x3e8;_0x162d41=_0x162d41===undefined?'':'s='+_0x162d41;_0x2198ff=_0x2198ff?_0x58a2('0x42'):'';return this['sendRequest'](util[_0x58a2('0x2d')](_0x58a2('0x43'),_0x44ca3e,_0xc621b4,_0x50f5b6,_0x118351,_0x2198ff,_0x162d41));};AGIChannel[_0x58a2('0x29')][_0x58a2('0x44')]=function(_0x36bb02,_0x30df11){_0x30df11=_0x30df11||'';return this['sendRequest'](util[_0x58a2('0x2d')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x36bb02,_0x30df11));};AGIChannel[_0x58a2('0x29')]['agi']=function(_0x17b4ac){return this[_0x58a2('0x30')](_0x58a2('0x45'),_0x17b4ac);};AGIChannel[_0x58a2('0x29')][_0x58a2('0x46')]=function(_0x35045b){return this[_0x58a2('0x30')](_0x58a2('0x47'),_0x35045b);};AGIChannel[_0x58a2('0x29')][_0x58a2('0x1c')]=function(_0x216736,_0x1a91a1){this[_0x58a2('0x2e')](util[_0x58a2('0x2d')](_0x58a2('0x48'),_0x216736['id'],_0x216736[_0x58a2('0x49')],_0x1a91a1));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel;
\ No newline at end of file
index a460479..70572b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0aea=['apply','message','exports','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format'];(function(_0x3c5561,_0x5bbeed){var _0x44e097=function(_0x523dea){while(--_0x523dea){_0x3c5561['push'](_0x3c5561['shift']());}};_0x44e097(++_0x5bbeed);}(_0x0aea,0xcf));var _0xa0ae=function(_0x295314,_0x17b250){_0x295314=_0x295314-0x0;var _0x584b0c=_0x0aea[_0x295314];return _0x584b0c;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xa0ae('0x0'),'E_AGI_SERVER_MAXCONNECTION':_0xa0ae('0x1'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0xa0ae('0x2'),'E_AGI_SOCKET_TIMEOUT':_0xa0ae('0x3'),'E_AGI_COMMAND_EMPTY':_0xa0ae('0x4'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0xa0ae('0x5')};function AGIError(_0x1aaa42){var _0x1aaa42=_0x1aaa42||null,_0xac1047=_0xac1047||[],_0x53286f=0x1,_0x21e3ad='';if(!error[_0x1aaa42]){_0x1aaa42=_0xa0ae('0x6');}_0xac1047[_0xa0ae('0x7')](error[_0x1aaa42]);while(arguments[_0x53286f]){_0xac1047[_0xa0ae('0x7')](arguments[_0x53286f]);_0x53286f++;}_0x21e3ad=util[_0xa0ae('0x8')][_0xa0ae('0x9')](util,_0xac1047);this[_0xa0ae('0xa')]=_0x21e3ad;this['name']=_0x1aaa42;}module[_0xa0ae('0xb')]=AGIError;
\ No newline at end of file
+var _0x9198=['message','name','exports','util','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','E_AGI_UNDEFINED','push','format','apply'];(function(_0x4a23cf,_0x41cf76){var _0x53cee7=function(_0x3017a6){while(--_0x3017a6){_0x4a23cf['push'](_0x4a23cf['shift']());}};_0x53cee7(++_0x41cf76);}(_0x9198,0x13e));var _0x8919=function(_0x58cf4e,_0x58b5f4){_0x58cf4e=_0x58cf4e-0x0;var _0x2a614c=_0x9198[_0x58cf4e];return _0x2a614c;};'use strict';var util=require(_0x8919('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x8919('0x1'),'E_AGI_SERVER_CLOSE':_0x8919('0x2'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x8919('0x3'),'E_AGI_SOCKET_ERROR':_0x8919('0x4'),'E_AGI_SOCKET_CLOSE':_0x8919('0x5'),'E_AGI_SOCKET_TIMEOUT':_0x8919('0x6'),'E_AGI_COMMAND_EMPTY':_0x8919('0x7'),'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(_0x25f0da){var _0x25f0da=_0x25f0da||null,_0x5da611=_0x5da611||[],_0x12478d=0x1,_0x17cd40='';if(!error[_0x25f0da]){_0x25f0da=_0x8919('0x8');}_0x5da611[_0x8919('0x9')](error[_0x25f0da]);while(arguments[_0x12478d]){_0x5da611['push'](arguments[_0x12478d]);_0x12478d++;}_0x17cd40=util[_0x8919('0xa')][_0x8919('0xb')](util,_0x5da611);this[_0x8919('0xc')]=_0x17cd40;this[_0x8919('0xd')]=_0x25f0da;}module[_0x8919('0xe')]=AGIError;
\ No newline at end of file
index e174a95..b1cec83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5712=['prototype','addVertex','vertices','addEdge','size','relations','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','condition','agicommand','vswitch','default','target','invalid','default\x20on\x20switch\x20not\x20found','includes','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu','getdigits','getsecretdigits','edges','numberOfEdges'];(function(_0x34176d,_0x4dd7ec){var _0x3295cd=function(_0xfb7bbd){while(--_0xfb7bbd){_0x34176d['push'](_0x34176d['shift']());}};_0x3295cd(++_0x4dd7ec);}(_0x5712,0x106));var _0x2571=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x5712[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x2571('0x0'));var logger=require(_0x2571('0x1'))(_0x2571('0x2'));var verticesWithRetry=[_0x2571('0x3'),_0x2571('0x4'),_0x2571('0x5')];var Graph=function(){this['vertices']={};this[_0x2571('0x6')]={};this[_0x2571('0x7')]=0x0;};Graph[_0x2571('0x8')][_0x2571('0x9')]=function(_0xb3d4b6){this[_0x2571('0xa')][_0xb3d4b6['id']]=_0xb3d4b6;this[_0x2571('0x6')][_0xb3d4b6['id']]=[];};Graph[_0x2571('0x8')][_0x2571('0xb')]=function(_0x433286,_0x42e00d,_0x22fc16){this['edges'][_0x433286]['push']({'target':_0x42e00d,'condition':_0x22fc16});this['numberOfEdges']+=0x1;};Graph['prototype'][_0x2571('0xc')]=function(){return _[_0x2571('0xc')](this[_0x2571('0xa')]);};Graph[_0x2571('0x8')][_0x2571('0xd')]=function(){return this[_0x2571('0x7')];};Graph[_0x2571('0x8')][_0x2571('0xe')]=function(_0x3c2413){return this[_0x2571('0xa')][_0x3c2413];};Graph[_0x2571('0x8')][_0x2571('0xf')]=function(_0x1f3b7c,_0x789b49){if(!this[_0x2571('0xa')][_0x1f3b7c]){return logger[_0x2571('0x10')](_0x2571('0x11'));}var _0x58012e=_0x789b49(this[_0x2571('0xa')][_0x1f3b7c]);if(!_0x58012e){return logger[_0x2571('0x10')](_0x2571('0x12'));}if(this[_0x2571('0x6')][_0x1f3b7c]['length']===0x0){return logger['info']('no\x20edge/s\x20available');}for(var _0x2990e3=0x0,_0x1d7d1f=[],_0xf4121=![];_0x2990e3<this['edges'][_0x1f3b7c][_0x2571('0x13')];_0x2990e3+=0x1){if(this[_0x2571('0x6')][_0x1f3b7c][_0x2990e3][_0x2571('0x14')]){_0x1d7d1f=this[_0x2571('0x6')][_0x1f3b7c][_0x2990e3][_0x2571('0x14')]['split'](',');for(var _0x217d70=0x0;_0x217d70<_0x1d7d1f[_0x2571('0x13')];_0x217d70+=0x1){if(this['vertices'][_0x1f3b7c][_0x2571('0x15')]===_0x2571('0x16')&&_0x1d7d1f[_0x217d70]==='-'){_0xf4121=this[_0x2571('0x6')][_0x1f3b7c][_0x2990e3]['target'];logger[_0x2571('0x10')](_0x2571('0x17'),_0x1d7d1f[_0x217d70],this['edges'][_0x1f3b7c][_0x2990e3][_0x2571('0x18')]);}else if(this['vertices'][_0x1f3b7c][_0x2571('0x15')]===_0x2571('0x3')&&_0x1d7d1f[_0x217d70]==='i'){_0xf4121=this['edges'][_0x1f3b7c][_0x2990e3]['target'];logger[_0x2571('0x10')](_0x2571('0x19'),_0x1d7d1f[_0x217d70],this[_0x2571('0x6')][_0x1f3b7c][_0x2990e3][_0x2571('0x18')]);}if(_0x1d7d1f[_0x217d70]===_0x58012e){return this[_0x2571('0xf')](this[_0x2571('0x6')][_0x1f3b7c][_0x2990e3][_0x2571('0x18')],_0x789b49);}}}else{return this[_0x2571('0xf')](this[_0x2571('0x6')][_0x1f3b7c][_0x2990e3][_0x2571('0x18')],_0x789b49);}}if(_0x1d7d1f[_0x2571('0x13')]){if(this['vertices'][_0x1f3b7c][_0x2571('0x15')]===_0x2571('0x16')){if(_0xf4121){return this[_0x2571('0xf')](_0xf4121,_0x789b49);}return logger[_0x2571('0x10')](_0x2571('0x1a'));}else if(_[_0x2571('0x1b')](verticesWithRetry,this['vertices'][_0x1f3b7c][_0x2571('0x15')])){if(_0x58012e==='-'){return logger[_0x2571('0x10')]('max\x20retry\x20reach');}if(_0xf4121&&_0x58012e!=='t'){return this[_0x2571('0xf')](_0xf4121,_0x789b49);}return this[_0x2571('0xf')](_0x1f3b7c,_0x789b49);}return logger[_0x2571('0x10')](_0x2571('0x1c'));}};module[_0x2571('0x1d')]=Graph;
\ No newline at end of file
+var _0x6653=['menu','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','size','relations','getVertex','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','default','traverseBFS','default\x20on\x20switch\x20not\x20found','includes','condition\x20not\x20found','exports','lodash','../../../config/logger','agi'];(function(_0x1ce66a,_0x1f0111){var _0x1babbf=function(_0x2ff888){while(--_0x2ff888){_0x1ce66a['push'](_0x1ce66a['shift']());}};_0x1babbf(++_0x1f0111);}(_0x6653,0x1bd));var _0x3665=function(_0x21ac7e,_0x40bb47){_0x21ac7e=_0x21ac7e-0x0;var _0x221f22=_0x6653[_0x21ac7e];return _0x221f22;};'use strict';var _=require(_0x3665('0x0'));var logger=require(_0x3665('0x1'))(_0x3665('0x2'));var verticesWithRetry=[_0x3665('0x3'),_0x3665('0x4'),_0x3665('0x5')];var Graph=function(){this[_0x3665('0x6')]={};this[_0x3665('0x7')]={};this[_0x3665('0x8')]=0x0;};Graph[_0x3665('0x9')]['addVertex']=function(_0x31d247){this['vertices'][_0x31d247['id']]=_0x31d247;this[_0x3665('0x7')][_0x31d247['id']]=[];};Graph['prototype']['addEdge']=function(_0x2c32b8,_0x3f5a38,_0x28d061){this[_0x3665('0x7')][_0x2c32b8]['push']({'target':_0x3f5a38,'condition':_0x28d061});this[_0x3665('0x8')]+=0x1;};Graph[_0x3665('0x9')][_0x3665('0xa')]=function(){return _[_0x3665('0xa')](this['vertices']);};Graph[_0x3665('0x9')][_0x3665('0xb')]=function(){return this[_0x3665('0x8')];};Graph['prototype'][_0x3665('0xc')]=function(_0x47c6b1){return this['vertices'][_0x47c6b1];};Graph[_0x3665('0x9')]['traverseBFS']=function(_0x20f400,_0xce4dd9){if(!this[_0x3665('0x6')][_0x20f400]){return logger['info']('no\x20vertex\x20found');}var _0x1e22ea=_0xce4dd9(this[_0x3665('0x6')][_0x20f400]);if(!_0x1e22ea){return logger[_0x3665('0xd')](_0x3665('0xe'));}if(this['edges'][_0x20f400][_0x3665('0xf')]===0x0){return logger[_0x3665('0xd')](_0x3665('0x10'));}for(var _0x338185=0x0,_0x319a43=[],_0x598226=![];_0x338185<this[_0x3665('0x7')][_0x20f400][_0x3665('0xf')];_0x338185+=0x1){if(this[_0x3665('0x7')][_0x20f400][_0x338185][_0x3665('0x11')]){_0x319a43=this[_0x3665('0x7')][_0x20f400][_0x338185][_0x3665('0x11')][_0x3665('0x12')](',');for(var _0x7a1fd0=0x0;_0x7a1fd0<_0x319a43[_0x3665('0xf')];_0x7a1fd0+=0x1){if(this['vertices'][_0x20f400][_0x3665('0x13')]===_0x3665('0x14')&&_0x319a43[_0x7a1fd0]==='-'){_0x598226=this['edges'][_0x20f400][_0x338185][_0x3665('0x15')];logger['info'](_0x3665('0x16'),_0x319a43[_0x7a1fd0],this['edges'][_0x20f400][_0x338185]['target']);}else if(this[_0x3665('0x6')][_0x20f400][_0x3665('0x13')]===_0x3665('0x3')&&_0x319a43[_0x7a1fd0]==='i'){_0x598226=this[_0x3665('0x7')][_0x20f400][_0x338185][_0x3665('0x15')];logger[_0x3665('0xd')]('invalid',_0x319a43[_0x7a1fd0],this[_0x3665('0x7')][_0x20f400][_0x338185]['target']);}if(_0x319a43[_0x7a1fd0]===_0x1e22ea){return this[_0x3665('0x17')](this['edges'][_0x20f400][_0x338185][_0x3665('0x15')],_0xce4dd9);}}}else{return this[_0x3665('0x17')](this[_0x3665('0x7')][_0x20f400][_0x338185]['target'],_0xce4dd9);}}if(_0x319a43[_0x3665('0xf')]){if(this['vertices'][_0x20f400][_0x3665('0x13')]===_0x3665('0x14')){if(_0x598226){return this[_0x3665('0x17')](_0x598226,_0xce4dd9);}return logger[_0x3665('0xd')](_0x3665('0x18'));}else if(_[_0x3665('0x19')](verticesWithRetry,this[_0x3665('0x6')][_0x20f400][_0x3665('0x13')])){if(_0x1e22ea==='-'){return logger['info']('max\x20retry\x20reach');}if(_0x598226&&_0x1e22ea!=='t'){return this[_0x3665('0x17')](_0x598226,_0xce4dd9);}return this[_0x3665('0x17')](_0x20f400,_0xce4dd9);}return logger[_0x3665('0xd')](_0x3665('0x1a'));}};module[_0x3665('0x1b')]=Graph;
\ No newline at end of file
index 322ec06..0857028 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x232f=['Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','message','[%s]\x20%s','name','[ERROR]\x20%s','stack','arg_1','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','mxGraphModel','agicommand','hasOwnProperty','retry','omit','isArray','length','target','addEdge','source','value','getSquareProject','then','catch','createSquareReport','indexOf','inspect','stringify','close','timeout','hangup','sync','start','root','joinAt','YYYY-MM-DD\x20HH:mm:ss','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','debug','vertex','gotoc','context','extension','priority','response','code','isUndefined','result','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','[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\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','util','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','127.0.0.1','nextTick','error'];(function(_0xe337a4,_0x552ea5){var _0x416b9d=function(_0x556140){while(--_0x556140){_0xe337a4['push'](_0xe337a4['shift']());}};_0x416b9d(++_0x552ea5);}(_0x232f,0xa0));var _0xf232=function(_0x58b250,_0x210a75){_0x58b250=_0x58b250-0x0;var _0x2ad6d6=_0x232f[_0x58b250];return _0x2ad6d6;};'use strict';var parser=require(_0xf232('0x0'));var _=require('lodash');var syncho=require('syncho');var util=require(_0xf232('0x1'));var moment=require('moment');var config=require('../../config/environment');var logger=require(_0xf232('0x2'))(_0xf232('0x3'));var utilLicense=require(_0xf232('0x4'));var rpc=require(_0xf232('0x5'));var mailRpc=require(_0xf232('0x6'));var Graph=require(_0xf232('0x7'));var Vertices=require(_0xf232('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_['defaults'](config[_0xf232('0x3')],{'ip':_0xf232('0x9'),'port':0x11dd});function connectionHandler(_0xe96796){process[_0xf232('0xa')](function(){syncho(function(){try{setChannelVariables(_0xe96796);agiHandler(_0xe96796);}catch(_0x3d0e46){logger[_0xf232('0xb')](_0x3d0e46['stack']);}});});}function listeningHandler(){console['log'](_0xf232('0xc'),config[_0xf232('0x3')][_0xf232('0xd')]);logger[_0xf232('0xe')](util[_0xf232('0xf')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0xf232('0x3')]['ip'],config[_0xf232('0x3')][_0xf232('0xd')]));}function errorHandler(_0x1fb76b){if(_0x1fb76b&&_0x1fb76b['name']&&_0x1fb76b[_0xf232('0x10')]){logger['error'](util[_0xf232('0xf')](_0xf232('0x11'),_0x1fb76b[_0xf232('0x12')],_0x1fb76b[_0xf232('0x10')]));}else{logger[_0xf232('0xb')](util[_0xf232('0xf')](_0xf232('0x13'),_0x1fb76b[_0xf232('0x14')]));}}function closeHandler(){logger['info'](util[_0xf232('0xf')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xf232('0x15')],this[_0xf232('0x16')],this[_0xf232('0x17')],this[_0xf232('0x18')],this[_0xf232('0x19')]));try{createSquareReport(this);}catch(_0x5e8a10){logger[_0xf232('0xb')](_0x5e8a10[_0xf232('0x14')]);}}function timeoutHandler(){logger[_0xf232('0xe')](util[_0xf232('0xf')](_0xf232('0x1a'),this[_0xf232('0x15')],this[_0xf232('0x16')],this[_0xf232('0x17')],this[_0xf232('0x18')],this[_0xf232('0x19')]));}function hangupHandler(){logger[_0xf232('0xe')](util['format'](_0xf232('0x1b'),this[_0xf232('0x15')],this[_0xf232('0x16')],this[_0xf232('0x17')],this[_0xf232('0x18')],this[_0xf232('0x19')]));this[_0xf232('0x1c')]=!![];}function getRoot(_0x299e38){return parser['toJson'](_0x299e38,{'object':!![]})[_0xf232('0x1d')]['root'];}function addVertex(_0x302b5c,_0x41b23f,_0x4c635d){_0x41b23f[_0xf232('0x1e')]=_0x4c635d;if(_0x41b23f[_0xf232('0x1f')](_0xf232('0x20'))){_0x41b23f['maxRetry']=parseInt(_0x41b23f['retry'],0xa);}_0x302b5c['addVertex'](_[_0xf232('0x21')](_0x41b23f,'mxCell'));}function initGraph(_0x3818a7,_0x2697cd){var _0x2113d2=new Graph();for(var _0x14729b in _0x3818a7){if(_0x3818a7[_0xf232('0x1f')](_0x14729b)){if(_[_0xf232('0x22')](_0x3818a7[_0x14729b])){for(var _0x1a35d5=0x0;_0x1a35d5<_0x3818a7[_0x14729b][_0xf232('0x23')];_0x1a35d5+=0x1){addVertex(_0x2113d2,_0x3818a7[_0x14729b][_0x1a35d5],_0x14729b);}}else{addVertex(_0x2113d2,_0x3818a7[_0x14729b],_0x14729b);}}}for(var _0x491d67=0x0;_0x491d67<_0x2697cd[_0xf232('0x23')];_0x491d67+=0x1){if(_0x2697cd[_0x491d67]['source']&&_0x2697cd[_0x491d67][_0xf232('0x24')]){_0x2113d2[_0xf232('0x25')](_0x2697cd[_0x491d67][_0xf232('0x26')],_0x2697cd[_0x491d67][_0xf232('0x24')],_0x2697cd[_0x491d67][_0xf232('0x27')]);}}return _0x2113d2;}function getSquareProject(_0x31c59e,_0x16805e){rpc[_0xf232('0x28')](_0x31c59e)[_0xf232('0x29')](function(_0x190ced){_0x16805e(null,_0x190ced);})[_0xf232('0x2a')](function(_0x43c2e9){_0x16805e(null,_0x43c2e9);});}function createSquareReport(_0x4cec7a,_0x1c1735){rpc[_0xf232('0x2b')](_0x4cec7a)[_0xf232('0x29')](function(_0x577a94){if(_0x1c1735){_0x1c1735(null,_0x577a94);}})[_0xf232('0x2a')](function(_0x5e449d){if(_0x1c1735){_0x1c1735(null,_0x5e449d);}});}function setChannelVariables(_0x36ae65){for(var _0x56dfaf in _0x36ae65){if(_0x36ae65[_0xf232('0x1f')](_0x56dfaf)){if(_0x56dfaf[_0xf232('0x2c')]('agi_')===0x0){_0x36ae65[_0x56dfaf['substring'](0x4)]=_0x36ae65[_0x56dfaf];delete _0x36ae65[_0x56dfaf];}}}}function getLogFromObject(_0xceb352){return util[_0xf232('0x2d')](_0xceb352,{'showHidden':![],'depth':null});}function agiHandler(_0x1bdb80){var _0x399bcd,_0x33e62f,_0x35fac5,_0x14b93b,_0x146158;logger['debug']('variables',JSON[_0xf232('0x2e')](_0x1bdb80,null,0x2));logger[_0xf232('0xe')](util['format']('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1bdb80['arg_1'],_0x1bdb80[_0xf232('0x16')],_0x1bdb80['callerid'],_0x1bdb80[_0xf232('0x18')],_0x1bdb80[_0xf232('0x19')]));_0x1bdb80['on'](_0xf232('0xb'),errorHandler);_0x1bdb80['on'](_0xf232('0x2f'),closeHandler);_0x1bdb80['on'](_0xf232('0x30'),timeoutHandler);_0x1bdb80['evtHangup']=![];_0x1bdb80['on'](_0xf232('0x31'),hangupHandler);var _0x270853=getSquareProject[_0xf232('0x32')](null,_0x1bdb80[_0xf232('0x15')]);if(_0x270853){if(_0x270853['production']){_0x399bcd=getRoot(_0x270853['production']);if(_0x399bcd&&_0x399bcd[_0xf232('0x33')]){logger['debug'](_0xf232('0x34'),JSON['stringify'](_0x399bcd,null,0x2));_0x1bdb80[_0xf232('0x35')]=moment()[_0xf232('0xf')](_0xf232('0x36'));_0x33e62f=initGraph(_[_0xf232('0x21')](_0x399bcd,_0xf232('0x37')),_0x399bcd['mxCell']);_0x35fac5=new Vertices(_0x1bdb80,rpc,mailRpc);logger[_0xf232('0xe')](util[_0xf232('0xf')](_0xf232('0x38'),_0x1bdb80[_0xf232('0x15')],_0x1bdb80[_0xf232('0x16')],_0x1bdb80[_0xf232('0x17')],_0x1bdb80[_0xf232('0x18')],_0x1bdb80[_0xf232('0x19')]));_0x33e62f[_0xf232('0x39')](_0x399bcd[_0xf232('0x33')]['id'],function(_0x32e580){try{_0x32e580=_0x35fac5['clear'](_0x32e580);logger[_0xf232('0x3a')](_0xf232('0x3b'),JSON[_0xf232('0x2e')](_0x32e580,null,0x2));if(_0x32e580[_0xf232('0x1e')]===_0xf232('0x3c')){logger[_0xf232('0xe')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x1bdb80['context']=_0x32e580[_0xf232('0x3d')]||_0x1bdb80[_0xf232('0x3d')];_0x1bdb80[_0xf232('0x3e')]=_0x32e580[_0xf232('0x3e')];_0x1bdb80[_0xf232('0x3f')]=_0x32e580[_0xf232('0x3f')]?_0x32e580[_0xf232('0x3f')]-0x1:0x1;return null;}else if(_0x32e580&&_0x35fac5[_0x32e580['agicommand']]){_0x146158=_0x35fac5[_0x32e580[_0xf232('0x1e')]](_0x32e580);logger['info'](_0xf232('0x40'),JSON['stringify'](_0x146158,null,0x2));if(_0x146158&&_0x146158[_0xf232('0x41')]===AGI_CODE_SUCCESS&&_0x146158['result']!==AGI_RESULT_ERROR&&!_0x1bdb80[_0xf232('0x1c')]){logger[_0xf232('0x3a')](_0xf232('0x40'),getLogFromObject(_0x146158));return _[_0xf232('0x42')](_0x146158[_0xf232('0x43')])?null:_0x146158[_0xf232('0x43')][_0xf232('0x44')]();}else{logger[_0xf232('0xb')]('response',getLogFromObject(_0x146158));return null;}}else{logger[_0xf232('0xb')](_0xf232('0x45'));return null;}}catch(_0x32344d){logger[_0xf232('0xb')](_0x32344d[_0xf232('0x14')]);return null;}});if(_0x399bcd[_0xf232('0x46')]){logger[_0xf232('0xe')](util[_0xf232('0xf')](_0xf232('0x47'),_0x1bdb80[_0xf232('0x15')],_0x1bdb80[_0xf232('0x16')],_0x1bdb80[_0xf232('0x17')],_0x1bdb80['dnid'],_0x1bdb80[_0xf232('0x19')]));_0x33e62f[_0xf232('0x39')](_0x399bcd[_0xf232('0x46')]['id'],function(_0x3932cd){try{_0x3932cd=_0x35fac5[_0xf232('0x48')](_0x3932cd);logger[_0xf232('0x3a')](_0xf232('0x3b'),JSON['stringify'](_0x3932cd,null,0x2));if(_0x3932cd&&_0x35fac5[_0x3932cd[_0xf232('0x1e')]]){_0x146158=_0x35fac5[_0x3932cd['agicommand']](_0x3932cd);if(_0x146158){logger[_0xf232('0x3a')](_0xf232('0x40'),getLogFromObject(_0x146158));return _[_0xf232('0x42')](_0x146158[_0xf232('0x43')])?null:_0x146158[_0xf232('0x43')]['toString']();}else{logger[_0xf232('0xb')]('response',getLogFromObject(_0x146158));return null;}}else{logger[_0xf232('0xb')](_0xf232('0x45'));return null;}}catch(_0x5810ec){logger['error'](_0x5810ec[_0xf232('0x14')]);return null;}});}logger[_0xf232('0xe')](util['format'](_0xf232('0x49'),_0x1bdb80[_0xf232('0x15')],_0x1bdb80['calleridname'],_0x1bdb80[_0xf232('0x17')],_0x1bdb80['dnid'],_0x1bdb80[_0xf232('0x19')]));logger['info'](util[_0xf232('0xf')](_0xf232('0x4a'),_0x1bdb80['context'],_0x1bdb80['extension'],parseInt(_0x1bdb80[_0xf232('0x3f')],0xa)+0x1));_0x1bdb80[_0xf232('0x4b')](_0x1bdb80[_0xf232('0x3d')],_0x1bdb80[_0xf232('0x3e')],parseInt(_0x1bdb80[_0xf232('0x3f')],0xa)+0x1);_0x1bdb80[_0xf232('0x2f')]();}}else{logger[_0xf232('0xb')](util[_0xf232('0xf')]('Project\x20%s\x20not\x20published',_0x1bdb80['arg_1']));_0x1bdb80[_0xf232('0x4b')](_0x1bdb80['context'],_0x1bdb80[_0xf232('0x3e')],parseInt(_0x1bdb80[_0xf232('0x3f')],0xa)+0x1);_0x1bdb80[_0xf232('0x2f')]();}}else{logger[_0xf232('0xb')](util[_0xf232('0xf')](_0xf232('0x4c'),_0x1bdb80[_0xf232('0x15')]));_0x1bdb80[_0xf232('0x4b')](_0x1bdb80[_0xf232('0x3d')],_0x1bdb80[_0xf232('0x3e')],parseInt(_0x1bdb80[_0xf232('0x3f')],0xa)+0x1);_0x1bdb80[_0xf232('0x2f')]();}}function main(){var _0x23759a;return utilLicense[_0xf232('0x4d')]()[_0xf232('0x29')](function(_0xda3307){if(_0xda3307){if(_0xda3307[_0xf232('0x4e')]){if(_0xda3307[_0xf232('0x4f')]&&_0xda3307[_0xf232('0x4f')]>0x0){logger[_0xf232('0xe')](util[_0xf232('0xf')](_0xf232('0x50'),_0xda3307[_0xf232('0x4f')]));_0x23759a=_0xda3307[_0xf232('0x4f')];}else{logger[_0xf232('0xe')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0xf232('0xe')](_0xf232('0x51'));_0x23759a=-0x1;}}})['catch'](function(_0x31f922){logger[_0xf232('0xb')](_0xf232('0x52'),_0x31f922[_0xf232('0x14')]);})[_0xf232('0x46')](function(){var _0x791cbd=require(_0xf232('0x53'))(config[_0xf232('0x3')][_0xf232('0xd')],config[_0xf232('0x3')]['ip'],_0x23759a);_0x791cbd['on'](_0xf232('0xb'),errorHandler);_0x791cbd['on'](_0xf232('0x54'),listeningHandler);_0x791cbd['on'](_0xf232('0x55'),connectionHandler);_0x791cbd['on'](_0xf232('0x2f'),closeHandler);});}main();
\ No newline at end of file
+var _0xb09a=['continueAt','Project\x20%s\x20not\x20found','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','lodash','util','moment','../../config/environment','agi','../../config/license/util','./graph','./vertices','defaults','127.0.0.1','error','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','target','value','getSquareProject','then','catch','createSquareReport','agi_','inspect','debug','variables','stringify','arg_1','close','sync','production','start','joinAt','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','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','clear','[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'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xb09a,0x10d));var _0xab09=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0xb09a[_0x17928f];return _0x500b63;};'use strict';var parser=require(_0xab09('0x0'));var _=require(_0xab09('0x1'));var syncho=require('syncho');var util=require(_0xab09('0x2'));var moment=require(_0xab09('0x3'));var config=require(_0xab09('0x4'));var logger=require('../../config/logger')(_0xab09('0x5'));var utilLicense=require(_0xab09('0x6'));var rpc=require('./rpc');var mailRpc=require('./mailRpc');var Graph=require(_0xab09('0x7'));var Vertices=require(_0xab09('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xab09('0x5')]=_[_0xab09('0x9')](config['agi'],{'ip':_0xab09('0xa'),'port':0x11dd});function connectionHandler(_0x3140a2){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x3140a2);agiHandler(_0x3140a2);}catch(_0x556191){logger[_0xab09('0xb')](_0x556191[_0xab09('0xc')]);}});});}function listeningHandler(){console['log'](_0xab09('0xd'),config['agi'][_0xab09('0xe')]);logger[_0xab09('0xf')](util[_0xab09('0x10')](_0xab09('0x11'),config[_0xab09('0x5')]['ip'],config['agi']['port']));}function errorHandler(_0x53c113){if(_0x53c113&&_0x53c113['name']&&_0x53c113[_0xab09('0x12')]){logger[_0xab09('0xb')](util[_0xab09('0x10')](_0xab09('0x13'),_0x53c113['name'],_0x53c113[_0xab09('0x12')]));}else{logger['error'](util[_0xab09('0x10')](_0xab09('0x14'),_0x53c113[_0xab09('0xc')]));}}function closeHandler(){logger[_0xab09('0xf')](util[_0xab09('0x10')](_0xab09('0x15'),this['arg_1'],this[_0xab09('0x16')],this[_0xab09('0x17')],this['dnid'],this['uniqueid']));try{createSquareReport(this);}catch(_0x5f6537){logger['error'](_0x5f6537[_0xab09('0xc')]);}}function timeoutHandler(){logger['info'](util[_0xab09('0x10')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this['calleridname'],this['callerid'],this[_0xab09('0x18')],this[_0xab09('0x19')]));}function hangupHandler(){logger['info'](util[_0xab09('0x10')](_0xab09('0x1a'),this['arg_1'],this['calleridname'],this[_0xab09('0x17')],this['dnid'],this[_0xab09('0x19')]));this[_0xab09('0x1b')]=!![];}function getRoot(_0x2b42cc){return parser['toJson'](_0x2b42cc,{'object':!![]})[_0xab09('0x1c')][_0xab09('0x1d')];}function addVertex(_0x5c5525,_0x8f553f,_0x54306b){_0x8f553f[_0xab09('0x1e')]=_0x54306b;if(_0x8f553f[_0xab09('0x1f')](_0xab09('0x20'))){_0x8f553f[_0xab09('0x21')]=parseInt(_0x8f553f[_0xab09('0x20')],0xa);}_0x5c5525[_0xab09('0x22')](_[_0xab09('0x23')](_0x8f553f,_0xab09('0x24')));}function initGraph(_0x154ef9,_0x48f8d6){var _0x9049e6=new Graph();for(var _0x2f49f2 in _0x154ef9){if(_0x154ef9[_0xab09('0x1f')](_0x2f49f2)){if(_[_0xab09('0x25')](_0x154ef9[_0x2f49f2])){for(var _0x396e49=0x0;_0x396e49<_0x154ef9[_0x2f49f2][_0xab09('0x26')];_0x396e49+=0x1){addVertex(_0x9049e6,_0x154ef9[_0x2f49f2][_0x396e49],_0x2f49f2);}}else{addVertex(_0x9049e6,_0x154ef9[_0x2f49f2],_0x2f49f2);}}}for(var _0x489e07=0x0;_0x489e07<_0x48f8d6[_0xab09('0x26')];_0x489e07+=0x1){if(_0x48f8d6[_0x489e07]['source']&&_0x48f8d6[_0x489e07]['target']){_0x9049e6['addEdge'](_0x48f8d6[_0x489e07]['source'],_0x48f8d6[_0x489e07][_0xab09('0x27')],_0x48f8d6[_0x489e07][_0xab09('0x28')]);}}return _0x9049e6;}function getSquareProject(_0x3d3f63,_0xa660ff){rpc[_0xab09('0x29')](_0x3d3f63)[_0xab09('0x2a')](function(_0x3b9619){_0xa660ff(null,_0x3b9619);})[_0xab09('0x2b')](function(_0x46944f){_0xa660ff(null,_0x46944f);});}function createSquareReport(_0x2c5bfd,_0x1b68e8){rpc[_0xab09('0x2c')](_0x2c5bfd)[_0xab09('0x2a')](function(_0x270e89){if(_0x1b68e8){_0x1b68e8(null,_0x270e89);}})[_0xab09('0x2b')](function(_0x29f91c){if(_0x1b68e8){_0x1b68e8(null,_0x29f91c);}});}function setChannelVariables(_0xda4f2c){for(var _0x2be92f in _0xda4f2c){if(_0xda4f2c[_0xab09('0x1f')](_0x2be92f)){if(_0x2be92f['indexOf'](_0xab09('0x2d'))===0x0){_0xda4f2c[_0x2be92f['substring'](0x4)]=_0xda4f2c[_0x2be92f];delete _0xda4f2c[_0x2be92f];}}}}function getLogFromObject(_0x453537){return util[_0xab09('0x2e')](_0x453537,{'showHidden':![],'depth':null});}function agiHandler(_0x2b03ef){var _0x887731,_0x2912b6,_0x24b187,_0x574637,_0x4cd4f5;logger[_0xab09('0x2f')](_0xab09('0x30'),JSON[_0xab09('0x31')](_0x2b03ef,null,0x2));logger[_0xab09('0xf')](util[_0xab09('0x10')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x2b03ef[_0xab09('0x32')],_0x2b03ef[_0xab09('0x16')],_0x2b03ef['callerid'],_0x2b03ef[_0xab09('0x18')],_0x2b03ef[_0xab09('0x19')]));_0x2b03ef['on'](_0xab09('0xb'),errorHandler);_0x2b03ef['on'](_0xab09('0x33'),closeHandler);_0x2b03ef['on']('timeout',timeoutHandler);_0x2b03ef[_0xab09('0x1b')]=![];_0x2b03ef['on']('hangup',hangupHandler);var _0x2aba42=getSquareProject[_0xab09('0x34')](null,_0x2b03ef[_0xab09('0x32')]);if(_0x2aba42){if(_0x2aba42[_0xab09('0x35')]){_0x887731=getRoot(_0x2aba42[_0xab09('0x35')]);if(_0x887731&&_0x887731[_0xab09('0x36')]){logger['debug'](_0xab09('0x1d'),JSON[_0xab09('0x31')](_0x887731,null,0x2));_0x2b03ef[_0xab09('0x37')]=moment()[_0xab09('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x2912b6=initGraph(_[_0xab09('0x23')](_0x887731,_0xab09('0x24')),_0x887731[_0xab09('0x24')]);_0x24b187=new Vertices(_0x2b03ef,rpc,mailRpc);logger[_0xab09('0xf')](util['format'](_0xab09('0x38'),_0x2b03ef['arg_1'],_0x2b03ef[_0xab09('0x16')],_0x2b03ef[_0xab09('0x17')],_0x2b03ef[_0xab09('0x18')],_0x2b03ef['uniqueid']));_0x2912b6[_0xab09('0x39')](_0x887731[_0xab09('0x36')]['id'],function(_0x3da9b9){try{_0x3da9b9=_0x24b187['clear'](_0x3da9b9);logger['debug'](_0xab09('0x3a'),JSON[_0xab09('0x31')](_0x3da9b9,null,0x2));if(_0x3da9b9[_0xab09('0x1e')]===_0xab09('0x3b')){logger[_0xab09('0xf')](_0xab09('0x3c'));_0x2b03ef[_0xab09('0x3d')]=_0x3da9b9[_0xab09('0x3d')]||_0x2b03ef[_0xab09('0x3d')];_0x2b03ef[_0xab09('0x3e')]=_0x3da9b9['extension'];_0x2b03ef[_0xab09('0x3f')]=_0x3da9b9[_0xab09('0x3f')]?_0x3da9b9[_0xab09('0x3f')]-0x1:0x1;return null;}else if(_0x3da9b9&&_0x24b187[_0x3da9b9[_0xab09('0x1e')]]){_0x4cd4f5=_0x24b187[_0x3da9b9[_0xab09('0x1e')]](_0x3da9b9);logger[_0xab09('0xf')](_0xab09('0x40'),JSON[_0xab09('0x31')](_0x4cd4f5,null,0x2));if(_0x4cd4f5&&_0x4cd4f5[_0xab09('0x41')]===AGI_CODE_SUCCESS&&_0x4cd4f5[_0xab09('0x42')]!==AGI_RESULT_ERROR&&!_0x2b03ef[_0xab09('0x1b')]){logger['debug'](_0xab09('0x40'),getLogFromObject(_0x4cd4f5));return _[_0xab09('0x43')](_0x4cd4f5[_0xab09('0x42')])?null:_0x4cd4f5[_0xab09('0x42')][_0xab09('0x44')]();}else{logger['error'](_0xab09('0x40'),getLogFromObject(_0x4cd4f5));return null;}}else{logger[_0xab09('0xb')](_0xab09('0x45'));return null;}}catch(_0x1cbf09){logger['error'](_0x1cbf09[_0xab09('0xc')]);return null;}});if(_0x887731[_0xab09('0x46')]){logger[_0xab09('0xf')](util[_0xab09('0x10')](_0xab09('0x47'),_0x2b03ef[_0xab09('0x32')],_0x2b03ef[_0xab09('0x16')],_0x2b03ef['callerid'],_0x2b03ef[_0xab09('0x18')],_0x2b03ef['uniqueid']));_0x2912b6[_0xab09('0x39')](_0x887731[_0xab09('0x46')]['id'],function(_0xaf6bac){try{_0xaf6bac=_0x24b187[_0xab09('0x48')](_0xaf6bac);logger[_0xab09('0x2f')]('vertex',JSON['stringify'](_0xaf6bac,null,0x2));if(_0xaf6bac&&_0x24b187[_0xaf6bac[_0xab09('0x1e')]]){_0x4cd4f5=_0x24b187[_0xaf6bac[_0xab09('0x1e')]](_0xaf6bac);if(_0x4cd4f5){logger[_0xab09('0x2f')](_0xab09('0x40'),getLogFromObject(_0x4cd4f5));return _[_0xab09('0x43')](_0x4cd4f5[_0xab09('0x42')])?null:_0x4cd4f5[_0xab09('0x42')]['toString']();}else{logger[_0xab09('0xb')](_0xab09('0x40'),getLogFromObject(_0x4cd4f5));return null;}}else{logger[_0xab09('0xb')]('agicommand\x20not\x20found');return null;}}catch(_0x40839a){logger[_0xab09('0xb')](_0x40839a['stack']);return null;}});}logger['info'](util[_0xab09('0x10')](_0xab09('0x49'),_0x2b03ef[_0xab09('0x32')],_0x2b03ef[_0xab09('0x16')],_0x2b03ef[_0xab09('0x17')],_0x2b03ef[_0xab09('0x18')],_0x2b03ef[_0xab09('0x19')]));logger['info'](util['format'](_0xab09('0x4a'),_0x2b03ef[_0xab09('0x3d')],_0x2b03ef[_0xab09('0x3e')],parseInt(_0x2b03ef[_0xab09('0x3f')],0xa)+0x1));_0x2b03ef[_0xab09('0x4b')](_0x2b03ef[_0xab09('0x3d')],_0x2b03ef[_0xab09('0x3e')],parseInt(_0x2b03ef[_0xab09('0x3f')],0xa)+0x1);_0x2b03ef[_0xab09('0x33')]();}}else{logger['error'](util[_0xab09('0x10')]('Project\x20%s\x20not\x20published',_0x2b03ef['arg_1']));_0x2b03ef[_0xab09('0x4b')](_0x2b03ef['context'],_0x2b03ef[_0xab09('0x3e')],parseInt(_0x2b03ef[_0xab09('0x3f')],0xa)+0x1);_0x2b03ef[_0xab09('0x33')]();}}else{logger['error'](util[_0xab09('0x10')](_0xab09('0x4c'),_0x2b03ef[_0xab09('0x32')]));_0x2b03ef['continueAt'](_0x2b03ef[_0xab09('0x3d')],_0x2b03ef['extension'],parseInt(_0x2b03ef['priority'],0xa)+0x1);_0x2b03ef[_0xab09('0x33')]();}}function main(){var _0x2cee00;return utilLicense['getLicense']()['then'](function(_0xe0d61c){if(_0xe0d61c){if(_0xe0d61c[_0xab09('0x4d')]){if(_0xe0d61c[_0xab09('0x4e')]&&_0xe0d61c[_0xab09('0x4e')]>0x0){logger[_0xab09('0xf')](util[_0xab09('0x10')](_0xab09('0x4f'),_0xe0d61c[_0xab09('0x4e')]));_0x2cee00=_0xe0d61c[_0xab09('0x4e')];}else{logger['info'](_0xab09('0x50'));}}else{logger[_0xab09('0xf')](_0xab09('0x51'));_0x2cee00=-0x1;}}})[_0xab09('0x2b')](function(_0x266a47){logger[_0xab09('0xb')](_0xab09('0x52'),_0x266a47['stack']);})[_0xab09('0x46')](function(){var _0x46638f=require(_0xab09('0x53'))(config[_0xab09('0x5')][_0xab09('0xe')],config[_0xab09('0x5')]['ip'],_0x2cee00);_0x46638f['on'](_0xab09('0xb'),errorHandler);_0x46638f['on'](_0xab09('0x54'),listeningHandler);_0x46638f['on'](_0xab09('0x55'),connectionHandler);_0x46638f['on']('close',closeHandler);});}main();
\ No newline at end of file
index ac0b55e..1c3f2d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde8b=['bluebird','jayson/promise','client','request','message','result','catch','sendMailMessage'];(function(_0xd6db21,_0x1d08f3){var _0x3b96a0=function(_0x157017){while(--_0x157017){_0xd6db21['push'](_0xd6db21['shift']());}};_0x3b96a0(++_0x1d08f3);}(_0xde8b,0x1e0));var _0xbde8=function(_0x2248c1,_0x564bd8){_0x2248c1=_0x2248c1-0x0;var _0x31ba20=_0xde8b[_0x2248c1];return _0x31ba20;};'use strict';var BPromise=require(_0xbde8('0x0'));var jayson=require(_0xbde8('0x1'));var client=jayson[_0xbde8('0x2')]['http']({'port':0x232b});function request(_0x353128,_0x2db6bf){return new BPromise(function(_0x16f6f3,_0x19a403){return client[_0xbde8('0x3')](_0x353128,_0x2db6bf)['then'](function(_0x360f99){if(_0x360f99['error']){return _0x19a403(_0x360f99['error'][_0xbde8('0x4')]);}else{return _0x16f6f3(_0x360f99[_0xbde8('0x5')]);}})[_0xbde8('0x6')](function(_0x278bd8){return _0x19a403(_0x278bd8);});});}exports[_0xbde8('0x7')]=function(_0x3b19c3,_0xdc9e3f){return request('SendMail',{'account':_0x3b19c3,'message':_0xdc9e3f});};
\ No newline at end of file
+var _0xe57e=['client','http','request','then','error','catch','sendMailMessage','SendMail','bluebird','jayson/promise'];(function(_0x304976,_0x14432b){var _0xb73047=function(_0x5d4e01){while(--_0x5d4e01){_0x304976['push'](_0x304976['shift']());}};_0xb73047(++_0x14432b);}(_0xe57e,0x8a));var _0xee57=function(_0x46a8e5,_0x4474f8){_0x46a8e5=_0x46a8e5-0x0;var _0x53a4b7=_0xe57e[_0x46a8e5];return _0x53a4b7;};'use strict';var BPromise=require(_0xee57('0x0'));var jayson=require(_0xee57('0x1'));var client=jayson[_0xee57('0x2')][_0xee57('0x3')]({'port':0x232b});function request(_0x46eabc,_0x2d33d4){return new BPromise(function(_0x1e6490,_0x1413a1){return client[_0xee57('0x4')](_0x46eabc,_0x2d33d4)[_0xee57('0x5')](function(_0x3eb1a6){if(_0x3eb1a6[_0xee57('0x6')]){return _0x1413a1(_0x3eb1a6[_0xee57('0x6')]['message']);}else{return _0x1e6490(_0x3eb1a6['result']);}})[_0xee57('0x7')](function(_0x2a130c){return _0x1413a1(_0x2a130c);});});}exports[_0xee57('0x8')]=function(_0x5a6327,_0x512a2e){return request(_0xee57('0x9'),{'account':_0x5a6327,'message':_0x512a2e});};
\ No newline at end of file
index dfe4d38..02a7aa0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0e2=['substring','length','split','slice','trim','emit','line','exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','indexOf'];(function(_0x53a7af,_0x1408a5){var _0x3cc7f6=function(_0x4bf101){while(--_0x4bf101){_0x53a7af['push'](_0x53a7af['shift']());}};_0x3cc7f6(++_0x1408a5);}(_0xa0e2,0xaa));var _0x2a0e=function(_0xa970d1,_0x8e9f98){_0xa970d1=_0xa970d1-0x0;var _0x4c5a31=_0xa0e2[_0xa970d1];return _0x4c5a31;};'use strict';var util=require(_0x2a0e('0x0'));var Transform=require(_0x2a0e('0x1'))[_0x2a0e('0x2')];function AGIReply(_0x4785ca){Transform[_0x2a0e('0x3')](this,_0x4785ca);this[_0x2a0e('0x4')]='';this[_0x2a0e('0x5')]=![];}util[_0x2a0e('0x6')](AGIReply,Transform);AGIReply[_0x2a0e('0x7')][_0x2a0e('0x8')]=function(_0xcc5c8f,_0x5d7d4c,_0x14df50){var _0x5c0099='\x0a',_0x4dbf67=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x5a492e=-0x1,_0x125961=-0x1,_0x339857='',_0x33ad16=0x0,_0x25e0bb='',_0x763315='';this['_localBuffer']+=_0xcc5c8f['toString']();_0x25e0bb=this[_0x2a0e('0x4')];if(!this[_0x2a0e('0x5')]){_0x33ad16=0x0;while(_0x4dbf67[_0x33ad16]){while((_0x125961=_0x25e0bb[_0x2a0e('0x9')](_0x4dbf67[_0x33ad16]))!=-0x1){_0x339857=_0x4dbf67[_0x33ad16];_0x763315=_0x25e0bb[_0x2a0e('0xa')](0x0,_0x125961);_0x25e0bb=_0x25e0bb[_0x2a0e('0xa')](_0x125961+_0x339857[_0x2a0e('0xb')]);var _0x523ee6=_0x763315[_0x2a0e('0xc')](_0x5c0099),_0x262f88=0x0,_0xc78297={},_0x59322f='',_0x1001f4='',_0x1c8254=-0x1;while(_0x523ee6[_0x262f88]){_0x1c8254=_0x523ee6[_0x262f88][_0x2a0e('0x9')](':');if(_0x1c8254!=-0x1){_0x59322f=_0x523ee6[_0x262f88][_0x2a0e('0xd')](0x0,_0x1c8254)[_0x2a0e('0xe')]();_0x1001f4=_0x523ee6[_0x262f88][_0x2a0e('0xd')](_0x1c8254+0x1)[_0x2a0e('0xe')]();if(_0x59322f[_0x2a0e('0xb')]>0x0){_0xc78297[_0x59322f]=_0x1001f4;}}else{}_0x262f88++;}this[_0x2a0e('0xf')]('headers',_0xc78297);this[_0x2a0e('0x5')]=!![];}_0x33ad16++;}this[_0x2a0e('0x4')]=_0x25e0bb;}else{while((_0x5a492e=_0x25e0bb[_0x2a0e('0x9')](_0x5c0099))!=-0x1){_0x763315=_0x25e0bb[_0x2a0e('0xa')](0x0,_0x5a492e);this[_0x2a0e('0xf')](_0x2a0e('0x10'),_0x763315);_0x25e0bb=_0x25e0bb[_0x2a0e('0xa')](_0x5a492e+_0x5c0099['length']);}this[_0x2a0e('0x4')]=_0x25e0bb;}_0x14df50();};module[_0x2a0e('0x11')]=AGIReply;
\ No newline at end of file
+var _0xa1f1=['inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring','length','split','slice','trim','emit','line','exports','stream','Transform','_inBody'];(function(_0x4f9003,_0x3a0c65){var _0x491530=function(_0x324303){while(--_0x324303){_0x4f9003['push'](_0x4f9003['shift']());}};_0x491530(++_0x3a0c65);}(_0xa1f1,0x7b));var _0x1a1f=function(_0x4f3c9b,_0x28e078){_0x4f3c9b=_0x4f3c9b-0x0;var _0x84e58a=_0xa1f1[_0x4f3c9b];return _0x84e58a;};'use strict';var util=require('util');var Transform=require(_0x1a1f('0x0'))[_0x1a1f('0x1')];function AGIReply(_0x281bc2){Transform['call'](this,_0x281bc2);this['_localBuffer']='';this[_0x1a1f('0x2')]=![];}util[_0x1a1f('0x3')](AGIReply,Transform);AGIReply[_0x1a1f('0x4')][_0x1a1f('0x5')]=function(_0x378ddf,_0x383c9e,_0x257bd3){var _0x22cbb3='\x0a',_0x187398=['\x0a\x0a',_0x1a1f('0x6')],_0x3ec84e=-0x1,_0x536442=-0x1,_0x1e608b='',_0x8ecdd3=0x0,_0xf6bdd0='',_0x5ec30a='';this[_0x1a1f('0x7')]+=_0x378ddf[_0x1a1f('0x8')]();_0xf6bdd0=this[_0x1a1f('0x7')];if(!this['_inBody']){_0x8ecdd3=0x0;while(_0x187398[_0x8ecdd3]){while((_0x536442=_0xf6bdd0[_0x1a1f('0x9')](_0x187398[_0x8ecdd3]))!=-0x1){_0x1e608b=_0x187398[_0x8ecdd3];_0x5ec30a=_0xf6bdd0[_0x1a1f('0xa')](0x0,_0x536442);_0xf6bdd0=_0xf6bdd0[_0x1a1f('0xa')](_0x536442+_0x1e608b[_0x1a1f('0xb')]);var _0x380c1c=_0x5ec30a[_0x1a1f('0xc')](_0x22cbb3),_0x191c3b=0x0,_0x14bdfc={},_0x51f73b='',_0x14d022='',_0x237e82=-0x1;while(_0x380c1c[_0x191c3b]){_0x237e82=_0x380c1c[_0x191c3b][_0x1a1f('0x9')](':');if(_0x237e82!=-0x1){_0x51f73b=_0x380c1c[_0x191c3b][_0x1a1f('0xd')](0x0,_0x237e82)[_0x1a1f('0xe')]();_0x14d022=_0x380c1c[_0x191c3b][_0x1a1f('0xd')](_0x237e82+0x1)[_0x1a1f('0xe')]();if(_0x51f73b[_0x1a1f('0xb')]>0x0){_0x14bdfc[_0x51f73b]=_0x14d022;}}else{}_0x191c3b++;}this[_0x1a1f('0xf')]('headers',_0x14bdfc);this[_0x1a1f('0x2')]=!![];}_0x8ecdd3++;}this[_0x1a1f('0x7')]=_0xf6bdd0;}else{while((_0x3ec84e=_0xf6bdd0[_0x1a1f('0x9')](_0x22cbb3))!=-0x1){_0x5ec30a=_0xf6bdd0[_0x1a1f('0xa')](0x0,_0x3ec84e);this[_0x1a1f('0xf')](_0x1a1f('0x10'),_0x5ec30a);_0xf6bdd0=_0xf6bdd0['substring'](_0x3ec84e+_0x22cbb3['length']);}this[_0x1a1f('0x7')]=_0xf6bdd0;}_0x257bd3();};module[_0x1a1f('0x11')]=AGIReply;
\ No newline at end of file
index a1319fc..f723760 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98b5=['catch','getSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','email','getSquareProjectById','ShowSquareProject','name','ShowVoiceQueue','ShowSquareOdbc','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','Interval','Intervals','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','createSquareReport','CreateSquareReport','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','CreateSquareMessage','ShowCmHopper','ListId','CreateCmContact','ShowPause','agentLogin','LoginUser','agentPause','UnpauseUser','bluebird','lodash','util','request','then','error','message','result'];(function(_0xd7e133,_0x3191e0){var _0x2f2714=function(_0x29362b){while(--_0x29362b){_0xd7e133['push'](_0xd7e133['shift']());}};_0x2f2714(++_0x3191e0);}(_0x98b5,0x148));var _0x598b=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x98b5[_0x42cae2];return _0x5f256f;};'use strict';var BPromise=require(_0x598b('0x0'));var moment=require('moment');var _=require(_0x598b('0x1'));var util=require(_0x598b('0x2'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x2329});function request(_0x37a87c,_0x544f6a){return new BPromise(function(_0x4b5a56,_0x410894){return client[_0x598b('0x3')](_0x37a87c,_0x544f6a)[_0x598b('0x4')](function(_0x3c74c1){if(_0x3c74c1[_0x598b('0x5')]){return _0x410894(_0x3c74c1[_0x598b('0x5')][_0x598b('0x6')]);}else{return _0x4b5a56(_0x3c74c1[_0x598b('0x7')]);}})[_0x598b('0x8')](function(_0x1e515f){return _0x410894(_0x1e515f);});});}exports[_0x598b('0x9')]=function(_0x94991c){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x94991c},'attributes':[_0x598b('0xa')]}});};exports[_0x598b('0xb')]=function(_0x55c7a6){return request(_0x598b('0xc'),{'options':{'raw':![],'where':{'id':_0x55c7a6},'include':[{'model':_0x598b('0xd'),'as':_0x598b('0xe')}],'attributes':['id','name',_0x598b('0xf')]}});};exports[_0x598b('0x10')]=function(_0x10238c){return request(_0x598b('0x11'),{'options':{'where':{'id':_0x10238c},'attributes':[_0x598b('0x12')]}});};exports['getVoiceQueueById']=function(_0x2e957c){return request(_0x598b('0x13'),{'options':{'where':{'id':_0x2e957c},'attributes':['name']}});};exports['getVariableById']=function(_0x195476){return request('ShowVariable',{'options':{'where':{'id':_0x195476},'attributes':[_0x598b('0x12')]}});};exports['getSquareOdbcById']=function(_0x39473d){return request(_0x598b('0x14'),{'options':{'where':{'id':_0x39473d},'attributes':['dsn']}});};exports[_0x598b('0x15')]=function(_0x17508f){return request(_0x598b('0x16'),{'options':{'where':{'id':_0x17508f},'attributes':['name']}});};exports[_0x598b('0x17')]=function(_0x484143){return request(_0x598b('0x18'),{'options':{'where':{'id':_0x484143},'attributes':[_0x598b('0x12')]}});};exports[_0x598b('0x19')]=function(_0x4e1411){return request(_0x598b('0x1a'),{'options':{'where':{'id':_0x4e1411},'attributes':[_0x598b('0x1b')]}});};exports['getIntervalById']=function(_0x2c402e){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x2c402e},'include':[{'model':_0x598b('0x1c'),'as':_0x598b('0x1d')}]}});};exports['getSmsAccountById']=function(_0x113282){return request(_0x598b('0x1e'),{'options':{'where':{'id':_0x113282},'attributes':['id',_0x598b('0x12')]}});};exports['createSmsMessage']=function(_0x5dc95c){return request(_0x598b('0x1f'),{'body':_0x5dc95c});};exports[_0x598b('0x20')]=function(_0x585e6d){return request('CreateSquareDetailsReport',{'body':_0x585e6d});};exports[_0x598b('0x21')]=function(_0xdb6ec3){return request(_0x598b('0x22'),{'body':_['merge'](_0xdb6ec3,{'project_name':_0xdb6ec3['arg_1'],'prev_project_name':_0xdb6ec3[_0x598b('0x23')]||'','is_subproject':_0xdb6ec3['arg_2']?!![]:![],'leaveAt':moment()[_0x598b('0x24')](_0x598b('0x25'))})});};exports['createSquareRecording']=function(_0x401a80){return request(_0x598b('0x26'),{'body':_0x401a80});};exports['createSquareMessage']=function(_0x1858b1){return request(_0x598b('0x27'),{'body':_0x1858b1});};exports['createCmContact']=function(_0x5255ba){return request(_0x598b('0x28'),{'options':{'raw':![],'where':{'phone':_0x5255ba['phone'],'ListId':_0x5255ba[_0x598b('0x29')]}}})[_0x598b('0x4')](function(_0x4a75f3){if(_0x4a75f3){return _0x4a75f3;}return request(_0x598b('0x2a'),{'body':_0x5255ba});});};exports['getPauseById']=function(_0x496ef9){return request(_0x598b('0x2b'),{'options':{'where':{'id':_0x496ef9},'attributes':[_0x598b('0x12')]}});};exports[_0x598b('0x2c')]=function(_0x134bb7,_0x33f45e){return request(_0x598b('0x2d'),{'body':{'interface':_0x33f45e},'options':{'where':_0x134bb7}});};exports[_0x598b('0x2e')]=function(_0x5943a7,_0x1c57c5,_0x124f5a){return request('PauseUser',{'body':{'type':_0x1c57c5,'uniqueid':_0x124f5a},'options':{'where':_0x5943a7}});};exports['agentUnpause']=function(_0x2cc927){return request(_0x598b('0x2f'),{'body':{},'options':{'where':_0x2cc927}});};exports['agentLogout']=function(_0xe47b76){return request('LogoutUser',{'body':{},'options':{'where':_0xe47b76}});};
\ No newline at end of file
+var _0xd314=['createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','phone','ListId','then','CreateCmContact','getPauseById','ShowPause','LoginUser','agentPause','PauseUser','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','util','jayson/promise','client','http','error','result','catch','ShowSquareProject','production','ShowMailAccount','name','email','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','save_name','Intervals','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format'];(function(_0xd511d,_0x3546b9){var _0x3f148e=function(_0x51f35f){while(--_0x51f35f){_0xd511d['push'](_0xd511d['shift']());}};_0x3f148e(++_0x3546b9);}(_0xd314,0x199));var _0x4d31=function(_0x193672,_0x4fd9c8){_0x193672=_0x193672-0x0;var _0x16394a=_0xd314[_0x193672];return _0x16394a;};'use strict';var BPromise=require(_0x4d31('0x0'));var moment=require(_0x4d31('0x1'));var _=require(_0x4d31('0x2'));var util=require(_0x4d31('0x3'));var jayson=require(_0x4d31('0x4'));var client=jayson[_0x4d31('0x5')][_0x4d31('0x6')]({'port':0x2329});function request(_0x3e0a9b,_0x212432){return new BPromise(function(_0x55159d,_0x7a5dd7){return client['request'](_0x3e0a9b,_0x212432)['then'](function(_0x3fd272){if(_0x3fd272[_0x4d31('0x7')]){return _0x7a5dd7(_0x3fd272[_0x4d31('0x7')]['message']);}else{return _0x55159d(_0x3fd272[_0x4d31('0x8')]);}})[_0x4d31('0x9')](function(_0x519e4d){return _0x7a5dd7(_0x519e4d);});});}exports['getSquareProject']=function(_0x4153a2){return request(_0x4d31('0xa'),{'options':{'raw':![],'where':{'name':_0x4153a2},'attributes':[_0x4d31('0xb')]}});};exports['getMailAccountById']=function(_0xf2fa0f){return request(_0x4d31('0xc'),{'options':{'raw':![],'where':{'id':_0xf2fa0f},'include':[{'model':'MailServerOut','as':'Smtp'}],'attributes':['id',_0x4d31('0xd'),_0x4d31('0xe')]}});};exports['getSquareProjectById']=function(_0x2c3d32){return request(_0x4d31('0xa'),{'options':{'where':{'id':_0x2c3d32},'attributes':[_0x4d31('0xd')]}});};exports[_0x4d31('0xf')]=function(_0x567e8f){return request(_0x4d31('0x10'),{'options':{'where':{'id':_0x567e8f},'attributes':[_0x4d31('0xd')]}});};exports[_0x4d31('0x11')]=function(_0x4d5e03){return request(_0x4d31('0x12'),{'options':{'where':{'id':_0x4d5e03},'attributes':[_0x4d31('0xd')]}});};exports[_0x4d31('0x13')]=function(_0x19c5b2){return request(_0x4d31('0x14'),{'options':{'where':{'id':_0x19c5b2},'attributes':[_0x4d31('0x15')]}});};exports[_0x4d31('0x16')]=function(_0x4d2d35){return request(_0x4d31('0x17'),{'options':{'where':{'id':_0x4d2d35},'attributes':[_0x4d31('0xd')]}});};exports[_0x4d31('0x18')]=function(_0x466fad){return request(_0x4d31('0x19'),{'options':{'where':{'id':_0x466fad},'attributes':[_0x4d31('0xd')]}});};exports[_0x4d31('0x1a')]=function(_0x3d0f50){return request('ShowSound',{'options':{'where':{'id':_0x3d0f50},'attributes':[_0x4d31('0x1b')]}});};exports['getIntervalById']=function(_0x5c2185){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x5c2185},'include':[{'model':'Interval','as':_0x4d31('0x1c')}]}});};exports[_0x4d31('0x1d')]=function(_0x4e600f){return request(_0x4d31('0x1e'),{'options':{'where':{'id':_0x4e600f},'attributes':['id','name']}});};exports['createSmsMessage']=function(_0x312d63){return request(_0x4d31('0x1f'),{'body':_0x312d63});};exports['createSquareDetailsReport']=function(_0x1dbbd2){return request(_0x4d31('0x20'),{'body':_0x1dbbd2});};exports[_0x4d31('0x21')]=function(_0x2a2c62){return request(_0x4d31('0x22'),{'body':_[_0x4d31('0x23')](_0x2a2c62,{'project_name':_0x2a2c62[_0x4d31('0x24')],'prev_project_name':_0x2a2c62[_0x4d31('0x25')]||'','is_subproject':_0x2a2c62[_0x4d31('0x25')]?!![]:![],'leaveAt':moment()[_0x4d31('0x26')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x4d31('0x27')]=function(_0x351339){return request(_0x4d31('0x28'),{'body':_0x351339});};exports[_0x4d31('0x29')]=function(_0x2b6eba){return request(_0x4d31('0x2a'),{'body':_0x2b6eba});};exports['createCmContact']=function(_0x194687){return request(_0x4d31('0x2b'),{'options':{'raw':![],'where':{'phone':_0x194687[_0x4d31('0x2c')],'ListId':_0x194687[_0x4d31('0x2d')]}}})[_0x4d31('0x2e')](function(_0x1c288b){if(_0x1c288b){return _0x1c288b;}return request(_0x4d31('0x2f'),{'body':_0x194687});});};exports[_0x4d31('0x30')]=function(_0x355310){return request(_0x4d31('0x31'),{'options':{'where':{'id':_0x355310},'attributes':['name']}});};exports['agentLogin']=function(_0x5de8da,_0xc737bd){return request(_0x4d31('0x32'),{'body':{'interface':_0xc737bd},'options':{'where':_0x5de8da}});};exports[_0x4d31('0x33')]=function(_0xab3d23,_0x3e7747,_0x4869b2){return request(_0x4d31('0x34'),{'body':{'type':_0x3e7747,'uniqueid':_0x4869b2},'options':{'where':_0xab3d23}});};exports['agentUnpause']=function(_0x512acd){return request(_0x4d31('0x35'),{'body':{},'options':{'where':_0x512acd}});};exports[_0x4d31('0x36')]=function(_0x234dd5){return request(_0x4d31('0x37'),{'body':{},'options':{'where':_0x234dd5}});};
\ No newline at end of file
index aacb8e6..2c88309 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcde7=['exports'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xcde7,0x65));var _0x7cde=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xcde7[_0x59ee6f];return _0x4c0979;};var polly=require('./polly');var lex=require('./lex');module[_0x7cde('0x0')]={'polly':polly,'lex':lex};
\ No newline at end of file
+var _0x5a9e=['exports','./lex'];(function(_0x283c87,_0x545688){var _0xde4143=function(_0x187b8d){while(--_0x187b8d){_0x283c87['push'](_0x283c87['shift']());}};_0xde4143(++_0x545688);}(_0x5a9e,0xbd));var _0xe5a9=function(_0x4653f7,_0x3d3ae3){_0x4653f7=_0x4653f7-0x0;var _0x5454da=_0x5a9e[_0x4653f7];return _0x5454da;};var polly=require('./polly');var lex=require(_0xe5a9('0x0'));module[_0xe5a9('0x1')]={'polly':polly,'lex':lex};
\ No newline at end of file
index 31d3f23..2fb521c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x153f=['exports','./lib/api'];(function(_0x28f32c,_0x4cc342){var _0x355402=function(_0xdb5032){while(--_0xdb5032){_0x28f32c['push'](_0x28f32c['shift']());}};_0x355402(++_0x4cc342);}(_0x153f,0x15b));var _0xf153=function(_0x3d5bc,_0x40c621){_0x3d5bc=_0x3d5bc-0x0;var _0x3ea844=_0x153f[_0x3d5bc];return _0x3ea844;};'use strict';var lex=require(_0xf153('0x0'));module[_0xf153('0x1')]=function(_0xde7eae,_0x44cea3,_0x2afb9a,_0x1ccc1c,_0x3b85fc,_0x59757c){return lex(_0xde7eae,_0x44cea3,_0x2afb9a,_0x1ccc1c,_0x3b85fc,_0x59757c);};
\ No newline at end of file
+var _0x5ff3=['exports'];(function(_0x34b5fc,_0x261ff0){var _0x536e66=function(_0x22e4a3){while(--_0x22e4a3){_0x34b5fc['push'](_0x34b5fc['shift']());}};_0x536e66(++_0x261ff0);}(_0x5ff3,0x17d));var _0x35ff=function(_0x29c231,_0x122be9){_0x29c231=_0x29c231-0x0;var _0x2d6a56=_0x5ff3[_0x29c231];return _0x2d6a56;};'use strict';var lex=require('./lib/api');module[_0x35ff('0x0')]=function(_0x48cbf7,_0x1763a,_0x47c98d,_0x380f54,_0x1bb200,_0x3bd66a){return lex(_0x48cbf7,_0x1763a,_0x47c98d,_0x380f54,_0x1bb200,_0x3bd66a);};
\ No newline at end of file
index 39c78a6..089beeb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x557851,_0x417a5f){var _0x15e530=function(_0xcf881d){while(--_0xcf881d){_0x557851['push'](_0x557851['shift']());}};_0x15e530(++_0x417a5f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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(_0x304462,_0x4ca3fb){var _0x1ea84a=function(_0x49ef1e){while(--_0x49ef1e){_0x304462['push'](_0x304462['shift']());}};_0x1ea84a(++_0x4ca3fb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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 d3aca66..be69cc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6929=['./lib/api','exports'];(function(_0x2669b3,_0x77cf0a){var _0x57a665=function(_0x293c40){while(--_0x293c40){_0x2669b3['push'](_0x2669b3['shift']());}};_0x57a665(++_0x77cf0a);}(_0x6929,0xe4));var _0x9692=function(_0x519a2b,_0x53ad27){_0x519a2b=_0x519a2b-0x0;var _0x5598dd=_0x6929[_0x519a2b];return _0x5598dd;};'use strict';var polly=require(_0x9692('0x0'));module[_0x9692('0x1')]=function(_0x1aa7e5,_0xd4e009,_0x1f7ed6,_0x2953eb,_0x120802,_0x155f2f,_0x25d397){return polly(_0x1aa7e5,_0xd4e009,_0x1f7ed6,_0x2953eb,_0x120802,_0x155f2f,_0x25d397);};
\ No newline at end of file
+var _0x0715=['./lib/api','exports'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x0715,0x9a));var _0x5071=function(_0x12c31a,_0x27d84c){_0x12c31a=_0x12c31a-0x0;var _0x43a5fd=_0x0715[_0x12c31a];return _0x43a5fd;};'use strict';var polly=require(_0x5071('0x0'));module[_0x5071('0x1')]=function(_0x1a8a1b,_0x59f0d8,_0x86ff8b,_0x3782e5,_0x328567,_0x295afe,_0x1e7dd2){return polly(_0x1a8a1b,_0x59f0d8,_0x86ff8b,_0x3782e5,_0x328567,_0x295afe,_0x1e7dd2);};
\ No newline at end of file
index 7b4fda0..33f58e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3efb=['AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','mp3','bluebird','randomstring','synthesizeSpeech','writeFile'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x3efb,0xec));var _0xb3ef=function(_0x680821,_0x23e67f){_0x680821=_0x680821-0x0;var _0x3f132c=_0x3efb[_0x680821];return _0x3f132c;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0xb3ef('0x0'));var rs=require(_0xb3ef('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x13ad79,_0x3b1544,_0x356ff2){return new BPromise(function(_0xa1f499,_0x4c576c){_0x13ad79[_0xb3ef('0x2')](_0x3b1544,function(_0x2b2400,_0x22847b){if(_0x2b2400){_0x4c576c(_0x2b2400);}else if(_0x22847b){if(_0x22847b['AudioStream']instanceof Buffer){fs[_0xb3ef('0x3')](_0x356ff2,_0x22847b[_0xb3ef('0x4')],function(_0x4d0819){if(_0x4d0819){_0x4c576c(_0x4d0819);}else{_0xa1f499();}});}else{_0x4c576c(new Error(_0xb3ef('0x5')));}}else{_0x4c576c(new Error(_0xb3ef('0x6')));}});});}module[_0xb3ef('0x7')]=function(_0x2f21bd,_0x207af4,_0x1c028,_0x20f773,_0x258b13,_0x353ca4,_0x33f71c){var _0x1cea7f=new AWS[(_0xb3ef('0x8'))]({'accessKeyId':_0x2f21bd,'secretAccessKey':_0x207af4,'region':_0x1c028});var _0xcabd54={'Text':_0x258b13,'TextType':_0x353ca4||'text','OutputFormat':_0xb3ef('0x9'),'VoiceId':_0x20f773};return pollyResult(_0x1cea7f,_0xcabd54,_0x33f71c);};
\ No newline at end of file
+var _0x1d0a=['text','mp3','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','exports','Polly'];(function(_0x5869aa,_0xb1ca7c){var _0x4c3dd3=function(_0x27026f){while(--_0x27026f){_0x5869aa['push'](_0x5869aa['shift']());}};_0x4c3dd3(++_0xb1ca7c);}(_0x1d0a,0x106));var _0xa1d0=function(_0x1bf841,_0x3f90f8){_0x1bf841=_0x1bf841-0x0;var _0x5123ae=_0x1d0a[_0x1bf841];return _0x5123ae;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0xa1d0('0x0'));var rs=require(_0xa1d0('0x1'));var AWS=require(_0xa1d0('0x2'));function pollyResult(_0x277d16,_0x38e153,_0x2fcb51){return new BPromise(function(_0x4bcdd0,_0x41e1fd){_0x277d16[_0xa1d0('0x3')](_0x38e153,function(_0x5ad999,_0x35d8be){if(_0x5ad999){_0x41e1fd(_0x5ad999);}else if(_0x35d8be){if(_0x35d8be[_0xa1d0('0x4')]instanceof Buffer){fs[_0xa1d0('0x5')](_0x2fcb51,_0x35d8be[_0xa1d0('0x4')],function(_0x385401){if(_0x385401){_0x41e1fd(_0x385401);}else{_0x4bcdd0();}});}else{_0x41e1fd(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x41e1fd(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0xa1d0('0x6')]=function(_0x5da8b2,_0x413edb,_0x54088a,_0x5d3fb2,_0x4bcf1b,_0x54ca45,_0x47b943){var _0xc7fc51=new AWS[(_0xa1d0('0x7'))]({'accessKeyId':_0x5da8b2,'secretAccessKey':_0x413edb,'region':_0x54088a});var _0x49c5a1={'Text':_0x4bcf1b,'TextType':_0x54ca45||_0xa1d0('0x8'),'OutputFormat':_0xa1d0('0x9'),'VoiceId':_0x5d3fb2};return pollyResult(_0xc7fc51,_0x49c5a1,_0x47b943);};
\ No newline at end of file
index 6b09340..0a3bd42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-'use strict';var asr=require('./lib/api');module['exports']=function(_0x196e86,_0x398d75,_0x21a538,_0x57f025){return asr(_0x196e86,_0x398d75,_0x21a538);};
\ No newline at end of file
+var _0xf4cf=['./lib/api','exports'];(function(_0x5bc5b6,_0x8d8bf4){var _0x57940f=function(_0x1a5691){while(--_0x1a5691){_0x5bc5b6['push'](_0x5bc5b6['shift']());}};_0x57940f(++_0x8d8bf4);}(_0xf4cf,0x17e));var _0xff4c=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xf4cf[_0x16b9ed];return _0x66b1f8;};'use strict';var asr=require(_0xff4c('0x0'));module[_0xff4c('0x1')]=function(_0x3ff905,_0xa78402,_0x326889,_0x24809d){return asr(_0x3ff905,_0xa78402,_0x326889);};
\ No newline at end of file
index 68568ad..f230ce0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad36=['POST','/v1/speech:recognize?key=','LINEAR16','8000','bluebird','https://speech.googleapis.com','exports','length','filepath\x20should\x20be\x20a\x20string','string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xad36,0x11c));var _0x6ad3=function(_0x4e5c2c,_0x4b841d){_0x4e5c2c=_0x4e5c2c-0x0;var _0x5bbfe7=_0xad36[_0x4e5c2c];return _0x5bbfe7;};'use strict';var url=require('url');var BPromise=require(_0x6ad3('0x0'));var fs=require('fs');var host=_0x6ad3('0x1');module[_0x6ad3('0x2')]=function(_0x1164e0,_0x32fb2f,_0x35a0ee){return new BPromise(function(_0xef54ab,_0x17a9b2){var _0x3d8fee;if(typeof _0x1164e0!=='string'||_0x1164e0[_0x6ad3('0x3')]===0x0){return _0x17a9b2(_0x6ad3('0x4'));}if(typeof _0x32fb2f!==_0x6ad3('0x5')||_0x32fb2f[_0x6ad3('0x3')]===0x0){return _0x17a9b2('key\x20should\x20be\x20a\x20string');}if(typeof _0x35a0ee!=='undefined'&&(typeof _0x35a0ee!=='string'||_0x35a0ee['length']===0x0)){return _0x17a9b2(_0x6ad3('0x6'));}try{_0x3d8fee=fs[_0x6ad3('0x7')](_0x1164e0)[_0x6ad3('0x8')](_0x6ad3('0x9'));}catch(_0x236745){return _0x17a9b2(_0x236745);}return _0xef54ab({'method':_0x6ad3('0xa'),'uri':host+_0x6ad3('0xb')+_0x32fb2f,'body':{'config':{'encoding':_0x6ad3('0xc'),'sampleRateHertz':_0x6ad3('0xd'),'languageCode':_0x35a0ee},'audio':{'content':_0x3d8fee}},'json':!![]});});};
\ No newline at end of file
+var _0x7b6b=['length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','https://speech.googleapis.com','exports','string'];(function(_0x1d90db,_0x3ea753){var _0x49e4b9=function(_0x4ec289){while(--_0x4ec289){_0x1d90db['push'](_0x1d90db['shift']());}};_0x49e4b9(++_0x3ea753);}(_0x7b6b,0xac));var _0xb7b6=function(_0x5374bf,_0x4a87f4){_0x5374bf=_0x5374bf-0x0;var _0x2a13f2=_0x7b6b[_0x5374bf];return _0x2a13f2;};'use strict';var url=require(_0xb7b6('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0xb7b6('0x1');module[_0xb7b6('0x2')]=function(_0x3d53dd,_0x547cab,_0x27f1bd){return new BPromise(function(_0x4abdb2,_0x2b546b){var _0x7193f5;if(typeof _0x3d53dd!==_0xb7b6('0x3')||_0x3d53dd[_0xb7b6('0x4')]===0x0){return _0x2b546b(_0xb7b6('0x5'));}if(typeof _0x547cab!==_0xb7b6('0x3')||_0x547cab[_0xb7b6('0x4')]===0x0){return _0x2b546b(_0xb7b6('0x6'));}if(typeof _0x27f1bd!==_0xb7b6('0x7')&&(typeof _0x27f1bd!==_0xb7b6('0x3')||_0x27f1bd[_0xb7b6('0x4')]===0x0)){return _0x2b546b(_0xb7b6('0x8'));}try{_0x7193f5=fs[_0xb7b6('0x9')](_0x3d53dd)[_0xb7b6('0xa')](_0xb7b6('0xb'));}catch(_0x4025fe){return _0x2b546b(_0x4025fe);}return _0x4abdb2({'method':_0xb7b6('0xc'),'uri':host+_0xb7b6('0xd')+_0x547cab,'body':{'config':{'encoding':_0xb7b6('0xe'),'sampleRateHertz':_0xb7b6('0xf'),'languageCode':_0x27f1bd},'audio':{'content':_0x7193f5}},'json':!![]});});};
\ No newline at end of file
index 24a186d..bb72c99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76f5=['./asr','exports'];(function(_0x20d91b,_0x168dbd){var _0x1940ff=function(_0x4dc8ab){while(--_0x4dc8ab){_0x20d91b['push'](_0x20d91b['shift']());}};_0x1940ff(++_0x168dbd);}(_0x76f5,0xf2));var _0x576f=function(_0x34f7d1,_0x3495b5){_0x34f7d1=_0x34f7d1-0x0;var _0x4cdd94=_0x76f5[_0x34f7d1];return _0x4cdd94;};var asr=require(_0x576f('0x0'));module[_0x576f('0x1')]={'asr':asr};
\ No newline at end of file
+var _0x412a=['exports','./asr'];(function(_0x2d126e,_0x1e8257){var _0xcb04d3=function(_0x19a2d9){while(--_0x19a2d9){_0x2d126e['push'](_0x2d126e['shift']());}};_0xcb04d3(++_0x1e8257);}(_0x412a,0x87));var _0xa412=function(_0xcbc908,_0x29aab9){_0xcbc908=_0xcbc908-0x0;var _0x15f8b7=_0x412a[_0xcbc908];return _0x15f8b7;};var asr=require(_0xa412('0x0'));module[_0xa412('0x1')]={'asr':asr};
\ No newline at end of file
index c9bbfb8..b705067 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb9c=['get','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','finish','info','finish\x20download\x20file','close','download\x20error','pipe','data','end','transcode','error\x20convert','start','tmp','.wav','writeFileSync','unlink','chmodSync','split','toString','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','then','resolve','generate','.mp3','from','writeFile','777','googleCloudTTS\x20path','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','application/x-www-form-urlencoded','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','goggleTTS\x20path','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20confidence','catch','[%s]\x20%s:%s','message','googleDialogflow','result','action','fulfillment','speech','status','metadata','googleDialogflowV2','replace','sessionPath','detectIntent','queryResult','allRequiredParamsPresent','fields','diagnosticInfo','end_conversation','name','intent','displayName','isFallback','languageCode','responseId','intentDetectionConfidence','fulfillmentText','polly','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','text','channelData','CustomAction','AudioFromTts','Data','dirName','bluebird','https','md5','path','querystring','randomstring','sox','url','parse','./aws','./google','./tilde','../../../config/logger','protocol','WHAT_EVER'];(function(_0x42639d,_0x2d1f80){var _0x390dff=function(_0x1c742f){while(--_0x1c742f){_0x42639d['push'](_0x42639d['shift']());}};_0x390dff(++_0x2d1f80);}(_0xeb9c,0x66));var _0xceb9=function(_0x46d8e4,_0x581be5){_0x46d8e4=_0x46d8e4-0x0;var _0x13e1bb=_0xeb9c[_0x46d8e4];return _0x13e1bb;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xceb9('0x0'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require('http');var https=require(_0xceb9('0x1'));var md5=require(_0xceb9('0x2'));var path=require(_0xceb9('0x3'));var querystring=require(_0xceb9('0x4'));var rp=require('request-promise');var rs=require(_0xceb9('0x5'));var sox=require(_0xceb9('0x6'));var tts=require('google-tts-api');var urlParse=require(_0xceb9('0x7'))[_0xceb9('0x8')];var util=require('util');var aws=require(_0xceb9('0x9'));var google=require(_0xceb9('0xa'));var sestek=require('./sestek');var tilde=require(_0xceb9('0xb'));var logger=require(_0xceb9('0xc'))('agi');var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x11b3d9,_0x41cb23){return new BPromise(function(_0x310909,_0x106e05){var _0x2b88cc=urlParse(_0x11b3d9);var _0x14d44a=_0x2b88cc[_0xceb9('0xd')]==='https:'?https:http;var _0x2643e4={'host':_0x2b88cc['host'],'path':_0x2b88cc[_0xceb9('0x3')],'headers':{'user-agent':_0xceb9('0xe')}};_0x14d44a[_0xceb9('0xf')](_0x2643e4,function(_0x34be69){if(_0x34be69['statusCode']!==0xc8){logger[_0xceb9('0x10')](_0xceb9('0x11')+_0x11b3d9+_0xceb9('0x12')+_0x34be69[_0xceb9('0x13')]+'\x20('+_0x34be69[_0xceb9('0x14')]+')');_0x106e05(new Error(_0xceb9('0x11')+_0x11b3d9+_0xceb9('0x12')+_0x34be69[_0xceb9('0x13')]+'\x20('+_0x34be69[_0xceb9('0x14')]+')'));return;}var _0x251bcb=fs['createWriteStream'](_0x41cb23);_0x251bcb['on'](_0xceb9('0x15'),function(){logger[_0xceb9('0x16')](_0xceb9('0x17'));_0x251bcb[_0xceb9('0x18')](_0x310909);});_0x251bcb['on'](_0xceb9('0x10'),function(_0xaf926b){fs['unlink'](_0x41cb23);logger[_0xceb9('0x10')](_0xceb9('0x19'),_0xaf926b);_0x106e05(_0xaf926b);});_0x34be69[_0xceb9('0x1a')](_0x251bcb);})['on']('error',function(_0x14ebbe){logger['error'](_0x14ebbe);_0x106e05(_0x14ebbe);})['end']();});}function uploadFile(_0x292b8c){return new BPromise(function(_0x362b81,_0x53ce95){var _0x10ed62=urlParse(_0x292b8c);var _0x2d95fb=_0x10ed62[_0xceb9('0xd')]==='https:'?https:http;var _0xfebf8e={'host':_0x10ed62['host'],'path':_0x10ed62[_0xceb9('0x3')],'headers':{'user-agent':_0xceb9('0xe')}};_0x2d95fb[_0xceb9('0xf')](_0xfebf8e,function(_0x4efa44){if(_0x4efa44[_0xceb9('0x13')]!==0xc8){_0x53ce95(new Error('request\x20to\x20'+_0x292b8c+'\x20failed,\x20status\x20code\x20=\x20'+_0x4efa44[_0xceb9('0x13')]+'\x20('+_0x4efa44[_0xceb9('0x14')]+')'));return;}var _0x25f8bd='';_0x4efa44['on'](_0xceb9('0x1b'),function(_0x283c39){_0x25f8bd+=_0x283c39;});_0x4efa44['on'](_0xceb9('0x1c'),function(){_0x362b81(_0x25f8bd);});})['on']('error',function(_0x9d1fda){_0x53ce95(_0x9d1fda);})[_0xceb9('0x1c')]();});}function convertFile(_0x5c6c70,_0x16bf83){return new BPromise(function(_0xd0345a,_0x10a5d1){var _0x3cc976=sox[_0xceb9('0x1d')](_0x5c6c70,_0x16bf83,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3cc976['on'](_0xceb9('0x10'),function(_0x6a2bc4){logger[_0xceb9('0x10')](_0xceb9('0x1e'),_0x6a2bc4);_0x10a5d1(_0x6a2bc4);});_0x3cc976['on'](_0xceb9('0x1c'),function(){logger[_0xceb9('0x16')]('finish\x20to\x20convert');_0xd0345a();});_0x3cc976[_0xceb9('0x1f')]();});}function base64Decode(_0x257b75,_0x4641d7){var _0x296843=path['resolve'](__dirname,_0xceb9('0x20'),rs['generate'](0x4)+_0xceb9('0x21'));fs[_0xceb9('0x22')](_0x296843,_0x257b75,'base64');return convertFile(_0x296843,_0x4641d7)['then'](function(){try{fs[_0xceb9('0x23')](_0x296843);fs[_0xceb9('0x24')](_0x4641d7,'777');}catch(_0x483aae){logger[_0xceb9('0x10')](_0x483aae);}return _0x4641d7[_0xceb9('0x25')]('.')[0x0];});}function base64Encode(_0x3a5aaa){var _0x526110=fs['readFileSync'](_0x3a5aaa);return new Buffer(_0x526110)[_0xceb9('0x26')](_0xceb9('0x27'));}exports[_0xceb9('0x28')]=function(_0x5c9ff9,_0x8c7a15,_0xaafec5,_0x189203,_0x326dc1,_0x53b522){var _0x3f0f74,_0x246a2a;var _0x5c1da3=_0xceb9('0x29');var _0x288742=_0xceb9('0x2a')+_0x5c9ff9;var _0x23a540={};if(_0x8c7a15===_0xceb9('0x2b')){_0x23a540['input']={'ssml':_0xaafec5};}else{_0x23a540[_0xceb9('0x2c')]={'text':_0xaafec5};};_0x23a540[_0xceb9('0x2d')]={'languageCode':_0x189203,'ssmlGender':_0x326dc1};_0x23a540[_0xceb9('0x2e')]={'audioEncoding':_0xceb9('0x2f'),'sampleRateHertz':0x1f40};var _0x4e359f={'url':_0x5c1da3+'text:synthesize'+_0x288742,'method':'POST','json':!![],'body':_0x23a540};return rp(_0x4e359f)[_0xceb9('0x30')](function(_0x5721d9){return new BPromise(function(_0x547b00,_0x1a90ee){_0x3f0f74=path[_0xceb9('0x31')](__dirname,_0xceb9('0x20'),rs[_0xceb9('0x32')](0x4)+_0xceb9('0x33'));var _0x56e4de=Buffer[_0xceb9('0x34')](_0x5721d9['audioContent'],_0xceb9('0x27'));return fs[_0xceb9('0x35')](_0x3f0f74,_0x56e4de,function(_0x5ac328){_0x1a90ee(_0x5ac328);},function(_0x26c253){fs['chmodSync'](_0x3f0f74,_0xceb9('0x36'));_0x547b00(_0x26c253);});});})[_0xceb9('0x30')](function(_0x31836b){_0x246a2a=path[_0xceb9('0x31')](__dirname,_0xceb9('0x20'),rs['generate'](0x4)+_0xceb9('0x21'));return convertFile(_0x3f0f74,_0x246a2a);})['then'](function(){try{fs[_0xceb9('0x23')](_0x3f0f74);fs[_0xceb9('0x24')](_0x246a2a,_0xceb9('0x36'));}catch(_0x3098f1){logger['error'](_0x3098f1);}logger[_0xceb9('0x16')](_0xceb9('0x37'),_0x246a2a[_0xceb9('0x25')]('.')[0x0]);return _0x246a2a[_0xceb9('0x25')]('.')[0x0];});};exports['googleTTS']=function(_0x5a5a2b,_0x55cfd0){var _0x393ccb=_0xceb9('0x38');var _0x6ab9f,_0x5b41be;var _0x14fce4;var _0x2acd00={'encoding':_0xceb9('0x39'),'method':_0xceb9('0x3a'),'timeout':0x2710,'url':_0x393ccb,'headers':{'Content-Type':_0xceb9('0x3b')},'body':'f.req='+encodeURIComponent(JSON[_0xceb9('0x3c')]([[['jQ1olc',JSON[_0xceb9('0x3c')]([_0x5a5a2b,_0x55cfd0||'en',![],_0xceb9('0x3d')]),null,_0xceb9('0x3e')]]]))};return rp(_0x2acd00)['then'](function(_0x4bee1c){try{_0x14fce4=eval(_0x4bee1c[_0xceb9('0x3f')](0x5))[0x0][0x2];}catch(_0x3536cb){throw new Error(_0xceb9('0x40')+_0x4bee1c['data']);}if(!_0x14fce4){if(_0x5a5a2b[_0xceb9('0x41')]>0xc8){throw new Error(_0xceb9('0x42'));}else{throw new Error('lang\x20\x22'+_0x55cfd0+'\x22\x20might\x20not\x20exist');}}try{_0x14fce4=eval(_0x14fce4)[0x0];}catch(_0x277cd5){throw new Error(_0xceb9('0x40')+res[_0xceb9('0x1b')]);}const _0x1b6473=_0x14fce4;_0x6ab9f=path['resolve'](__dirname,'tmp',rs[_0xceb9('0x32')](0x4)+'.mp3');fs[_0xceb9('0x22')](_0x6ab9f,_0x14fce4,{'encoding':_0xceb9('0x27')});_0x5b41be=path[_0xceb9('0x31')](__dirname,_0xceb9('0x20'),rs[_0xceb9('0x32')](0x4)+_0xceb9('0x21'));return convertFile(_0x6ab9f,_0x5b41be);})[_0xceb9('0x30')](function(){try{fs[_0xceb9('0x23')](_0x6ab9f);fs[_0xceb9('0x24')](_0x5b41be,_0xceb9('0x36'));}catch(_0x333e83){logger[_0xceb9('0x10')](_0x333e83);}logger[_0xceb9('0x16')](_0xceb9('0x43'),_0x5b41be[_0xceb9('0x25')]('.')[0x0]);return _0x5b41be[_0xceb9('0x25')]('.')[0x0];});};exports['googleASR']=function(_0x4a9d40,_0x705067,_0x46e0cf){return google[_0xceb9('0x44')](_0x4a9d40,_0x705067,_0x46e0cf)[_0xceb9('0x30')](function(_0x3e9492){logger[_0xceb9('0x16')](_0x3e9492[_0xceb9('0x45')]);return rp(_0x3e9492);})['then'](function(_0x57ae2d){var _0x39da15='';var _0xa3689a=0x0;try{fs[_0xceb9('0x23')](_0x4a9d40);}catch(_0x2bec20){logger[_0xceb9('0x10')](_0x2bec20);}if(_0x57ae2d&&_0x57ae2d[_0xceb9('0x46')]){_0x39da15=_0x57ae2d[_0xceb9('0x46')][_0xceb9('0x47')](function(_0x2627a4){return _0x2627a4&&_0x2627a4[_0xceb9('0x48')][0x0]&&_0x2627a4[_0xceb9('0x48')][0x0][_0xceb9('0x49')]?_0x2627a4['alternatives'][0x0][_0xceb9('0x49')]:'';})[_0xceb9('0x4a')]('\x0a');_0xa3689a=_0x57ae2d['results'][_0xceb9('0x47')](function(_0x8bf921){return _0x8bf921&&_0x8bf921['alternatives'][0x0]&&_0x8bf921['alternatives'][0x0][_0xceb9('0x4b')]?_0x8bf921[_0xceb9('0x48')][0x0][_0xceb9('0x4b')]:0x0;})[_0xceb9('0x4a')]('\x0a');}logger[_0xceb9('0x16')]('googleASR\x20transcription',_0x39da15);logger['info'](_0xceb9('0x4c'),_0xa3689a);return{'transcript':_0x39da15,'confidence':_0xa3689a};})[_0xceb9('0x4d')](function(_0x5c0cd8){logger['error'](_0xceb9('0x4e'),_0x5c0cd8[_0xceb9('0x13')],_0x5c0cd8['name'],_0x5c0cd8[_0xceb9('0x4f')]);});};exports[_0xceb9('0x50')]=function(_0x3001ec,_0x314c2e,_0x2bc1b7,_0x52edc4){var _0x145d62=apiai(_0x314c2e,{'language':_0x52edc4||'en'});return _0x145d62['textRequest'](_0x2bc1b7,{'sessionId':md5(_0x3001ec)})[_0xceb9('0x30')](function(_0x119cca){logger[_0xceb9('0x16')](JSON[_0xceb9('0x3c')](_0x119cca));return{'source':_0x119cca[_0xceb9('0x51')]['source'],'resolvedQuery':_0x119cca[_0xceb9('0x51')]['resolvedQuery'],'action':_0x119cca[_0xceb9('0x51')][_0xceb9('0x52')],'actionIncomplete':_0x119cca[_0xceb9('0x51')]['actionIncomplete'],'speech':_0x119cca[_0xceb9('0x51')][_0xceb9('0x53')][_0xceb9('0x54')],'score':_0x119cca['result']['score'],'statusCode':_0x119cca[_0xceb9('0x55')]['code'],'endConversation':_0x119cca[_0xceb9('0x51')][_0xceb9('0x56')]['endConversation']||![],'isFallbackIntent':_0x119cca['result'][_0xceb9('0x56')]['isFallbackIntent']};});};exports[_0xceb9('0x57')]=function(_0x38fd17,_0x1b8d0c,_0x22970b,_0x155b92,_0x1d1c69,_0x4eb9b0){var _0x479487=_0x155b92[_0xceb9('0x58')](/\\n/g,'\x0a');var _0x162041={'credentials':{'private_key':_0x479487,'client_email':_0x22970b}};var _0xfb88b6=new dialogflow['SessionsClient'](_0x162041);var _0x3ad7d4=_0xfb88b6[_0xceb9('0x59')](_0x1b8d0c,md5(_0x38fd17));var _0x54c190={'session':_0x3ad7d4,'queryInput':{'text':{'text':_0x1d1c69,'languageCode':_0x4eb9b0}}};return _0xfb88b6[_0xceb9('0x5a')](_0x54c190)[_0xceb9('0x30')](function(_0x1ad432){if(_0x1ad432&&_0x1ad432[_0xceb9('0x41')]){logger[_0xceb9('0x16')]('Dialogflow\x20V2\x20response:',JSON[_0xceb9('0x3c')](_0x1ad432));var _0x1e93c4=_0x1ad432[0x0];if(_0x1e93c4){var _0x34d654={'action':_0x1e93c4[_0xceb9('0x5b')][_0xceb9('0x52')],'allRequiredParamsPresent':_0x1e93c4['queryResult'][_0xceb9('0x5c')],'endConversation':_0x1e93c4[_0xceb9('0x5b')]['diagnosticInfo']&&_0x1e93c4[_0xceb9('0x5b')]['diagnosticInfo'][_0xceb9('0x5d')]?_0x1e93c4['queryResult'][_0xceb9('0x5e')][_0xceb9('0x5d')][_0xceb9('0x5f')]['boolValue']:![],'fulfillmentText':_0x1e93c4[_0xceb9('0x5b')]['fulfillmentText'],'intentName':_0x1e93c4[_0xceb9('0x5b')]['intent'][_0xceb9('0x60')],'intentDisplayName':_0x1e93c4[_0xceb9('0x5b')][_0xceb9('0x61')][_0xceb9('0x62')],'isFallbackIntent':_0x1e93c4[_0xceb9('0x5b')]['intent'][_0xceb9('0x63')],'languageCode':_0x1e93c4['queryResult'][_0xceb9('0x64')],'queryText':_0x1e93c4['queryResult']['queryText'],'responseId':_0x1e93c4[_0xceb9('0x65')],'score':_0x1e93c4[_0xceb9('0x5b')][_0xceb9('0x66')],'speech':_0x1e93c4[_0xceb9('0x5b')][_0xceb9('0x67')],'providerResponse':JSON[_0xceb9('0x3c')](_0x1ad432)};return _0x34d654;}}});};exports['tildeASR']=function(_0x271846,_0x46b303,_0x89c4dc,_0xb0a28d){return tilde[_0xceb9('0x44')](_0x271846,_0x46b303,_0x89c4dc,_0xb0a28d)[_0xceb9('0x30')](function(_0x16032a){try{fs['unlink'](_0x271846);}catch(_0x53966e){logger[_0xceb9('0x10')](_0x53966e);}logger['info']('Tilde\x20ASR\x20transcription',_0x16032a[_0xceb9('0x49')]);logger[_0xceb9('0x16')]('Tilde\x20ASR\x20confidence',_0x16032a[_0xceb9('0x4b')]);return _0x16032a;});};exports['awsPolly']=function(_0x11d417,_0x20aa48,_0x4c7050,_0x5ac905,_0x4d85e9,_0x54466e){var _0x4f88de=path[_0xceb9('0x31')](__dirname,_0xceb9('0x20'),rs[_0xceb9('0x32')](0x4)+_0xceb9('0x33'));var _0x343318;return aws[_0xceb9('0x68')](_0x11d417,_0x20aa48,_0x4c7050,_0x5ac905,_0x4d85e9,_0x54466e,_0x4f88de)[_0xceb9('0x30')](function(){_0x343318=path[_0xceb9('0x31')](__dirname,_0xceb9('0x20'),rs[_0xceb9('0x32')](0x4)+_0xceb9('0x21'));return convertFile(_0x4f88de,_0x343318);})[_0xceb9('0x30')](function(){try{fs[_0xceb9('0x23')](_0x4f88de);fs[_0xceb9('0x24')](_0x343318,_0xceb9('0x36'));}catch(_0x4788b5){logger['error'](_0x4788b5);}return _0x343318[_0xceb9('0x25')]('.')[0x0];});};exports['awsLex']=function(_0xb3cfe5,_0x474b25,_0x5b1593,_0x597201,_0x3b4690,_0x451435){return aws[_0xceb9('0x69')](_0xb3cfe5,_0x474b25,_0x5b1593,_0x597201,_0x3b4690,_0x451435)[_0xceb9('0x30')](function(_0x508f17){logger[_0xceb9('0x16')](JSON[_0xceb9('0x3c')](_0x508f17));return _0x508f17;});};exports[_0xceb9('0x6a')]=function(_0x55e270,_0x3567f2,_0x272936,_0x10ab56){var _0x3a1441=util[_0xceb9('0x6b')](_0xceb9('0x6c'),ISPEECH_API,_0x55e270,encodeURIComponent(_0x3567f2),_0x272936,_0x10ab56);var _0x2fc162=path[_0xceb9('0x31')](__dirname,_0xceb9('0x20'),rs[_0xceb9('0x32')](0x4)+_0xceb9('0x33'));var _0x259bb9;return downloadFile(_0x3a1441,_0x2fc162)['then'](function(){_0x259bb9=path[_0xceb9('0x31')](__dirname,_0xceb9('0x20'),rs[_0xceb9('0x32')](0x4)+_0xceb9('0x21'));return convertFile(_0x2fc162,_0x259bb9);})[_0xceb9('0x30')](function(){try{fs['unlink'](_0x2fc162);fs[_0xceb9('0x24')](_0x259bb9,_0xceb9('0x36'));}catch(_0x66d4fe){logger['error'](_0x66d4fe);}return _0x259bb9[_0xceb9('0x25')]('.')[0x0];});};exports['ispeechASR']=function(_0x1ef191,_0x17eb14,_0xb17e03,_0x12f9e7){var _0x426b40=util[_0xceb9('0x6b')](_0xceb9('0x6d'),ISPEECH_API,_0x17eb14,_0xb17e03,base64Encode(_0x1ef191),_0x12f9e7?util[_0xceb9('0x6b')]('model=%s',encodeURIComponent(_0x12f9e7)):_0xceb9('0x6e'));return uploadFile(_0x426b40)[_0xceb9('0x30')](function(_0x4f2d58){return querystring['parse'](_0x4f2d58);});};exports['sestekNDA']=function(_0x1c023e,_0x1f44b5){return sestek['nda'](_0x1c023e,_0x1f44b5)[_0xceb9('0x30')](function(_0x52960a){logger['info'](JSON[_0xceb9('0x3c')](_0x52960a));var _0x28f49e={'speech':_0x52960a[_0xceb9('0x6f')],'action':_0x52960a[_0xceb9('0x70')]?_0x52960a[_0xceb9('0x70')][_0xceb9('0x71')]:undefined,'actiondata':_0x52960a[_0xceb9('0x70')]?_0x52960a[_0xceb9('0x70')]['CustomActionData']:undefined};if(_0x52960a[_0xceb9('0x70')]&&_0x52960a['channelData'][_0xceb9('0x72')]){return base64Decode(_0x52960a[_0xceb9('0x70')][_0xceb9('0x72')][_0xceb9('0x73')],path['resolve'](__dirname,_0xceb9('0x20'),rs['generate'](0x4)+'.wav'))[_0xceb9('0x30')](function(_0x221c11){_0x28f49e['audiofile']=_0x221c11;return _0x28f49e;});}return _0x28f49e;});};exports[_0xceb9('0x74')]=function(){return __dirname;};
\ No newline at end of file
+var _0x424a=['ssml','input','voice','audioConfig','text:synthesize','POST','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','split','googleTTS','utf8','application/x-www-form-urlencoded','jQ1olc','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','name','message','googleDialogflow','textRequest','result','resolvedQuery','action','actionIncomplete','fulfillment','metadata','endConversation','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','intent','displayName','isFallback','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','nda','text','channelData','CustomAction','AudioFromTts','audiofile','bluebird','dialogflow','md5','path','randomstring','sox','google-tts-api','parse','util','./aws','./google','./sestek','./tilde','https://api.ispeech.org/api/rest','host','get','statusCode','error','request\x20to\x20','statusMessage','\x20failed,\x20status\x20code\x20=\x20','finish','info','close','unlink','download\x20error','protocol','WHAT_EVER','data','end','transcode','wav','error\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','777','readFileSync','googleCloudTTS','?key='];(function(_0x3e90ce,_0x8cccbb){var _0x2208be=function(_0x322641){while(--_0x322641){_0x3e90ce['push'](_0x3e90ce['shift']());}};_0x2208be(++_0x8cccbb);}(_0x424a,0x1d6));var _0xa424=function(_0x52ced7,_0x33f680){_0x52ced7=_0x52ced7-0x0;var _0xde7fb=_0x424a[_0x52ced7];return _0xde7fb;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xa424('0x0'));var dialogflow=require(_0xa424('0x1'));var fs=require('fs');var http=require('http');var https=require('https');var md5=require(_0xa424('0x2'));var path=require(_0xa424('0x3'));var querystring=require('querystring');var rp=require('request-promise');var rs=require(_0xa424('0x4'));var sox=require(_0xa424('0x5'));var tts=require(_0xa424('0x6'));var urlParse=require('url')[_0xa424('0x7')];var util=require(_0xa424('0x8'));var aws=require(_0xa424('0x9'));var google=require(_0xa424('0xa'));var sestek=require(_0xa424('0xb'));var tilde=require(_0xa424('0xc'));var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0xa424('0xd');function downloadFile(_0x511264,_0x1a70cf){return new BPromise(function(_0x4912cf,_0x5046de){var _0x59e90c=urlParse(_0x511264);var _0x2a156f=_0x59e90c['protocol']==='https:'?https:http;var _0x4405c5={'host':_0x59e90c[_0xa424('0xe')],'path':_0x59e90c[_0xa424('0x3')],'headers':{'user-agent':'WHAT_EVER'}};_0x2a156f[_0xa424('0xf')](_0x4405c5,function(_0x199a7b){if(_0x199a7b[_0xa424('0x10')]!==0xc8){logger[_0xa424('0x11')](_0xa424('0x12')+_0x511264+'\x20failed,\x20status\x20code\x20=\x20'+_0x199a7b['statusCode']+'\x20('+_0x199a7b[_0xa424('0x13')]+')');_0x5046de(new Error(_0xa424('0x12')+_0x511264+_0xa424('0x14')+_0x199a7b[_0xa424('0x10')]+'\x20('+_0x199a7b['statusMessage']+')'));return;}var _0x366dae=fs['createWriteStream'](_0x1a70cf);_0x366dae['on'](_0xa424('0x15'),function(){logger[_0xa424('0x16')]('finish\x20download\x20file');_0x366dae[_0xa424('0x17')](_0x4912cf);});_0x366dae['on'](_0xa424('0x11'),function(_0x521db4){fs[_0xa424('0x18')](_0x1a70cf);logger[_0xa424('0x11')](_0xa424('0x19'),_0x521db4);_0x5046de(_0x521db4);});_0x199a7b['pipe'](_0x366dae);})['on'](_0xa424('0x11'),function(_0x4bfb09){logger['error'](_0x4bfb09);_0x5046de(_0x4bfb09);})['end']();});}function uploadFile(_0x3588da){return new BPromise(function(_0x17092e,_0x4e5f76){var _0x4672f0=urlParse(_0x3588da);var _0x1c2025=_0x4672f0[_0xa424('0x1a')]==='https:'?https:http;var _0x35a06e={'host':_0x4672f0['host'],'path':_0x4672f0[_0xa424('0x3')],'headers':{'user-agent':_0xa424('0x1b')}};_0x1c2025[_0xa424('0xf')](_0x35a06e,function(_0x3b195d){if(_0x3b195d[_0xa424('0x10')]!==0xc8){_0x4e5f76(new Error(_0xa424('0x12')+_0x3588da+'\x20failed,\x20status\x20code\x20=\x20'+_0x3b195d[_0xa424('0x10')]+'\x20('+_0x3b195d[_0xa424('0x13')]+')'));return;}var _0x367fba='';_0x3b195d['on'](_0xa424('0x1c'),function(_0x51d9b3){_0x367fba+=_0x51d9b3;});_0x3b195d['on'](_0xa424('0x1d'),function(){_0x17092e(_0x367fba);});})['on'](_0xa424('0x11'),function(_0x508e99){_0x4e5f76(_0x508e99);})['end']();});}function convertFile(_0x416289,_0x43c1f6){return new BPromise(function(_0x46db95,_0x23945a){var _0x5db3c5=sox[_0xa424('0x1e')](_0x416289,_0x43c1f6,{'sampleRate':0x1f40,'format':_0xa424('0x1f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5db3c5['on'](_0xa424('0x11'),function(_0x18f391){logger[_0xa424('0x11')](_0xa424('0x20'),_0x18f391);_0x23945a(_0x18f391);});_0x5db3c5['on'](_0xa424('0x1d'),function(){logger[_0xa424('0x16')]('finish\x20to\x20convert');_0x46db95();});_0x5db3c5[_0xa424('0x21')]();});}function base64Decode(_0x45db1c,_0x6baf63){var _0x11d6f9=path[_0xa424('0x22')](__dirname,_0xa424('0x23'),rs[_0xa424('0x24')](0x4)+_0xa424('0x25'));fs[_0xa424('0x26')](_0x11d6f9,_0x45db1c,_0xa424('0x27'));return convertFile(_0x11d6f9,_0x6baf63)[_0xa424('0x28')](function(){try{fs['unlink'](_0x11d6f9);fs[_0xa424('0x29')](_0x6baf63,_0xa424('0x2a'));}catch(_0x3b13f4){logger[_0xa424('0x11')](_0x3b13f4);}return _0x6baf63['split']('.')[0x0];});}function base64Encode(_0x5893a4){var _0x410b25=fs[_0xa424('0x2b')](_0x5893a4);return new Buffer(_0x410b25)['toString'](_0xa424('0x27'));}exports[_0xa424('0x2c')]=function(_0x429222,_0x2d0814,_0x4e9624,_0x7d2894,_0x52e7b9,_0x5b480a){var _0xee4241,_0x42bcbc;var _0x54fbd4='https://texttospeech.googleapis.com/v1/';var _0x1c6d7c=_0xa424('0x2d')+_0x429222;var _0x2bbb12={};if(_0x2d0814===_0xa424('0x2e')){_0x2bbb12[_0xa424('0x2f')]={'ssml':_0x4e9624};}else{_0x2bbb12['input']={'text':_0x4e9624};};_0x2bbb12[_0xa424('0x30')]={'languageCode':_0x7d2894,'ssmlGender':_0x52e7b9};_0x2bbb12[_0xa424('0x31')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x89d4c6={'url':_0x54fbd4+_0xa424('0x32')+_0x1c6d7c,'method':_0xa424('0x33'),'json':!![],'body':_0x2bbb12};return rp(_0x89d4c6)[_0xa424('0x28')](function(_0x5bd8eb){return new BPromise(function(_0x1f8ae0,_0x1740eb){_0xee4241=path[_0xa424('0x22')](__dirname,'tmp',rs['generate'](0x4)+_0xa424('0x34'));var _0x22dfc3=Buffer[_0xa424('0x35')](_0x5bd8eb[_0xa424('0x36')],_0xa424('0x27'));return fs[_0xa424('0x37')](_0xee4241,_0x22dfc3,function(_0x55fe6){_0x1740eb(_0x55fe6);},function(_0x193d58){fs['chmodSync'](_0xee4241,_0xa424('0x2a'));_0x1f8ae0(_0x193d58);});});})[_0xa424('0x28')](function(_0x37b278){_0x42bcbc=path['resolve'](__dirname,_0xa424('0x23'),rs[_0xa424('0x24')](0x4)+_0xa424('0x25'));return convertFile(_0xee4241,_0x42bcbc);})['then'](function(){try{fs[_0xa424('0x18')](_0xee4241);fs['chmodSync'](_0x42bcbc,_0xa424('0x2a'));}catch(_0x2ab42d){logger['error'](_0x2ab42d);}logger[_0xa424('0x16')](_0xa424('0x38'),_0x42bcbc['split']('.')[0x0]);return _0x42bcbc[_0xa424('0x39')]('.')[0x0];});};exports[_0xa424('0x3a')]=function(_0x2966bc,_0x2114d1){var _0x200430='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x49411f,_0x44759a;var _0x4fe328;var _0x530a14={'encoding':_0xa424('0x3b'),'method':_0xa424('0x33'),'timeout':0x2710,'url':_0x200430,'headers':{'Content-Type':_0xa424('0x3c')},'body':'f.req='+encodeURIComponent(JSON['stringify']([[[_0xa424('0x3d'),JSON[_0xa424('0x3e')]([_0x2966bc,_0x2114d1||'en',![],_0xa424('0x3f')]),null,_0xa424('0x40')]]]))};return rp(_0x530a14)[_0xa424('0x28')](function(_0x5ddb1e){try{_0x4fe328=eval(_0x5ddb1e[_0xa424('0x41')](0x5))[0x0][0x2];}catch(_0x4a69ee){throw new Error(_0xa424('0x42')+_0x5ddb1e[_0xa424('0x1c')]);}if(!_0x4fe328){if(_0x2966bc[_0xa424('0x43')]>0xc8){throw new Error(_0xa424('0x44'));}else{throw new Error(_0xa424('0x45')+_0x2114d1+_0xa424('0x46'));}}try{_0x4fe328=eval(_0x4fe328)[0x0];}catch(_0x1a634e){throw new Error('parse\x20response\x20failed:\x0a'+res['data']);}const _0x2bc74e=_0x4fe328;_0x49411f=path[_0xa424('0x22')](__dirname,_0xa424('0x23'),rs[_0xa424('0x24')](0x4)+_0xa424('0x34'));fs['writeFileSync'](_0x49411f,_0x4fe328,{'encoding':'base64'});_0x44759a=path['resolve'](__dirname,_0xa424('0x23'),rs[_0xa424('0x24')](0x4)+_0xa424('0x25'));return convertFile(_0x49411f,_0x44759a);})['then'](function(){try{fs['unlink'](_0x49411f);fs[_0xa424('0x29')](_0x44759a,'777');}catch(_0x1c89c9){logger['error'](_0x1c89c9);}logger[_0xa424('0x16')](_0xa424('0x47'),_0x44759a[_0xa424('0x39')]('.')[0x0]);return _0x44759a[_0xa424('0x39')]('.')[0x0];});};exports['googleASR']=function(_0x590764,_0x10195e,_0x496aa2){return google['asr'](_0x590764,_0x10195e,_0x496aa2)[_0xa424('0x28')](function(_0x9fc751){logger['info'](_0x9fc751['uri']);return rp(_0x9fc751);})['then'](function(_0x18e5df){var _0x476b22='';var _0x3b1bbc=0x0;try{fs[_0xa424('0x18')](_0x590764);}catch(_0x26094c){logger[_0xa424('0x11')](_0x26094c);}if(_0x18e5df&&_0x18e5df[_0xa424('0x48')]){_0x476b22=_0x18e5df[_0xa424('0x48')][_0xa424('0x49')](function(_0x45919b){return _0x45919b&&_0x45919b[_0xa424('0x4a')][0x0]&&_0x45919b[_0xa424('0x4a')][0x0]['transcript']?_0x45919b[_0xa424('0x4a')][0x0][_0xa424('0x4b')]:'';})['join']('\x0a');_0x3b1bbc=_0x18e5df['results'][_0xa424('0x49')](function(_0x2e110e){return _0x2e110e&&_0x2e110e[_0xa424('0x4a')][0x0]&&_0x2e110e[_0xa424('0x4a')][0x0][_0xa424('0x4c')]?_0x2e110e[_0xa424('0x4a')][0x0][_0xa424('0x4c')]:0x0;})[_0xa424('0x4d')]('\x0a');}logger[_0xa424('0x16')](_0xa424('0x4e'),_0x476b22);logger['info'](_0xa424('0x4f'),_0x3b1bbc);return{'transcript':_0x476b22,'confidence':_0x3b1bbc};})[_0xa424('0x50')](function(_0x1d3fc2){logger[_0xa424('0x11')]('[%s]\x20%s:%s',_0x1d3fc2[_0xa424('0x10')],_0x1d3fc2[_0xa424('0x51')],_0x1d3fc2[_0xa424('0x52')]);});};exports[_0xa424('0x53')]=function(_0x20a25c,_0xf3199b,_0x668226,_0x2f22dd){var _0x8b169e=apiai(_0xf3199b,{'language':_0x2f22dd||'en'});return _0x8b169e[_0xa424('0x54')](_0x668226,{'sessionId':md5(_0x20a25c)})[_0xa424('0x28')](function(_0x109ea0){logger[_0xa424('0x16')](JSON['stringify'](_0x109ea0));return{'source':_0x109ea0[_0xa424('0x55')]['source'],'resolvedQuery':_0x109ea0[_0xa424('0x55')][_0xa424('0x56')],'action':_0x109ea0[_0xa424('0x55')][_0xa424('0x57')],'actionIncomplete':_0x109ea0[_0xa424('0x55')][_0xa424('0x58')],'speech':_0x109ea0[_0xa424('0x55')][_0xa424('0x59')]['speech'],'score':_0x109ea0[_0xa424('0x55')]['score'],'statusCode':_0x109ea0['status']['code'],'endConversation':_0x109ea0[_0xa424('0x55')][_0xa424('0x5a')][_0xa424('0x5b')]||![],'isFallbackIntent':_0x109ea0[_0xa424('0x55')][_0xa424('0x5a')]['isFallbackIntent']};});};exports[_0xa424('0x5c')]=function(_0x2dab5f,_0x3871d3,_0x41779f,_0x22b72f,_0x53e0f8,_0x34e16a){var _0x3dfbb5=_0x22b72f[_0xa424('0x5d')](/\\n/g,'\x0a');var _0x337108={'credentials':{'private_key':_0x3dfbb5,'client_email':_0x41779f}};var _0x53b145=new dialogflow[(_0xa424('0x5e'))](_0x337108);var _0x5a2aae=_0x53b145[_0xa424('0x5f')](_0x3871d3,md5(_0x2dab5f));var _0x241c3e={'session':_0x5a2aae,'queryInput':{'text':{'text':_0x53e0f8,'languageCode':_0x34e16a}}};return _0x53b145[_0xa424('0x60')](_0x241c3e)[_0xa424('0x28')](function(_0x18c322){if(_0x18c322&&_0x18c322[_0xa424('0x43')]){logger[_0xa424('0x16')](_0xa424('0x61'),JSON[_0xa424('0x3e')](_0x18c322));var _0x1d9397=_0x18c322[0x0];if(_0x1d9397){var _0x5f05fe={'action':_0x1d9397[_0xa424('0x62')][_0xa424('0x57')],'allRequiredParamsPresent':_0x1d9397[_0xa424('0x62')][_0xa424('0x63')],'endConversation':_0x1d9397[_0xa424('0x62')][_0xa424('0x64')]&&_0x1d9397[_0xa424('0x62')][_0xa424('0x64')][_0xa424('0x65')]?_0x1d9397[_0xa424('0x62')][_0xa424('0x64')][_0xa424('0x65')]['end_conversation'][_0xa424('0x66')]:![],'fulfillmentText':_0x1d9397['queryResult'][_0xa424('0x67')],'intentName':_0x1d9397[_0xa424('0x62')][_0xa424('0x68')][_0xa424('0x51')],'intentDisplayName':_0x1d9397[_0xa424('0x62')]['intent'][_0xa424('0x69')],'isFallbackIntent':_0x1d9397['queryResult'][_0xa424('0x68')][_0xa424('0x6a')],'languageCode':_0x1d9397[_0xa424('0x62')]['languageCode'],'queryText':_0x1d9397[_0xa424('0x62')][_0xa424('0x6b')],'responseId':_0x1d9397[_0xa424('0x6c')],'score':_0x1d9397[_0xa424('0x62')][_0xa424('0x6d')],'speech':_0x1d9397[_0xa424('0x62')]['fulfillmentText'],'providerResponse':JSON[_0xa424('0x3e')](_0x18c322)};return _0x5f05fe;}}});};exports[_0xa424('0x6e')]=function(_0x25eea2,_0x14ce2c,_0x4bd6e2,_0x48b310){return tilde['asr'](_0x25eea2,_0x14ce2c,_0x4bd6e2,_0x48b310)[_0xa424('0x28')](function(_0x516097){try{fs[_0xa424('0x18')](_0x25eea2);}catch(_0x2e964a){logger[_0xa424('0x11')](_0x2e964a);}logger[_0xa424('0x16')](_0xa424('0x6f'),_0x516097[_0xa424('0x4b')]);logger[_0xa424('0x16')](_0xa424('0x70'),_0x516097[_0xa424('0x4c')]);return _0x516097;});};exports[_0xa424('0x71')]=function(_0x2ef775,_0x38e142,_0x5d4a08,_0x1e18a1,_0x36bf68,_0x1b56ee){var _0x68e5aa=path[_0xa424('0x22')](__dirname,_0xa424('0x23'),rs['generate'](0x4)+_0xa424('0x34'));var _0x57ed1;return aws[_0xa424('0x72')](_0x2ef775,_0x38e142,_0x5d4a08,_0x1e18a1,_0x36bf68,_0x1b56ee,_0x68e5aa)[_0xa424('0x28')](function(){_0x57ed1=path[_0xa424('0x22')](__dirname,'tmp',rs[_0xa424('0x24')](0x4)+_0xa424('0x25'));return convertFile(_0x68e5aa,_0x57ed1);})[_0xa424('0x28')](function(){try{fs['unlink'](_0x68e5aa);fs['chmodSync'](_0x57ed1,_0xa424('0x2a'));}catch(_0x43ba41){logger[_0xa424('0x11')](_0x43ba41);}return _0x57ed1[_0xa424('0x39')]('.')[0x0];});};exports[_0xa424('0x73')]=function(_0xb8067b,_0x5a3f6f,_0x346a7f,_0x2929ba,_0x4e3b34,_0x11ba5a){return aws[_0xa424('0x74')](_0xb8067b,_0x5a3f6f,_0x346a7f,_0x2929ba,_0x4e3b34,_0x11ba5a)[_0xa424('0x28')](function(_0xded9dd){logger[_0xa424('0x16')](JSON[_0xa424('0x3e')](_0xded9dd));return _0xded9dd;});};exports[_0xa424('0x75')]=function(_0x38d57d,_0x1c7c90,_0x2bfbce,_0x526cf3){var _0x1c8fb4=util[_0xa424('0x76')](_0xa424('0x77'),ISPEECH_API,_0x38d57d,encodeURIComponent(_0x1c7c90),_0x2bfbce,_0x526cf3);var _0xe7e334=path[_0xa424('0x22')](__dirname,_0xa424('0x23'),rs[_0xa424('0x24')](0x4)+_0xa424('0x34'));var _0x213bdc;return downloadFile(_0x1c8fb4,_0xe7e334)[_0xa424('0x28')](function(){_0x213bdc=path[_0xa424('0x22')](__dirname,'tmp',rs[_0xa424('0x24')](0x4)+'.wav');return convertFile(_0xe7e334,_0x213bdc);})[_0xa424('0x28')](function(){try{fs[_0xa424('0x18')](_0xe7e334);fs['chmodSync'](_0x213bdc,_0xa424('0x2a'));}catch(_0x38d0c6){logger[_0xa424('0x11')](_0x38d0c6);}return _0x213bdc['split']('.')[0x0];});};exports[_0xa424('0x78')]=function(_0x42862d,_0x120b8f,_0xc6d316,_0x4f7c4c){var _0xb29b60=util[_0xa424('0x76')](_0xa424('0x79'),ISPEECH_API,_0x120b8f,_0xc6d316,base64Encode(_0x42862d),_0x4f7c4c?util[_0xa424('0x76')](_0xa424('0x7a'),encodeURIComponent(_0x4f7c4c)):'freeform=3');return uploadFile(_0xb29b60)['then'](function(_0x16f53e){return querystring['parse'](_0x16f53e);});};exports['sestekNDA']=function(_0x5d4460,_0x1407bd){return sestek[_0xa424('0x7b')](_0x5d4460,_0x1407bd)['then'](function(_0x355a90){logger['info'](JSON[_0xa424('0x3e')](_0x355a90));var _0x26b4f8={'speech':_0x355a90[_0xa424('0x7c')],'action':_0x355a90[_0xa424('0x7d')]?_0x355a90[_0xa424('0x7d')][_0xa424('0x7e')]:undefined,'actiondata':_0x355a90[_0xa424('0x7d')]?_0x355a90[_0xa424('0x7d')]['CustomActionData']:undefined};if(_0x355a90['channelData']&&_0x355a90[_0xa424('0x7d')][_0xa424('0x7f')]){return base64Decode(_0x355a90[_0xa424('0x7d')][_0xa424('0x7f')]['Data'],path[_0xa424('0x22')](__dirname,_0xa424('0x23'),rs['generate'](0x4)+'.wav'))[_0xa424('0x28')](function(_0x149742){_0x26b4f8[_0xa424('0x80')]=_0x149742;return _0x26b4f8;});}return _0x26b4f8;});};exports['dirName']=function(){return __dirname;};
\ No newline at end of file
index 7714c3c..bbca8e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ddb=['./nda'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x6ddb,0x1cd));var _0xb6dd=function(_0x57bc28,_0x162717){_0x57bc28=_0x57bc28-0x0;var _0x4d3b22=_0x6ddb[_0x57bc28];return _0x4d3b22;};var nda=require(_0xb6dd('0x0'));module['exports']={'nda':nda};
\ No newline at end of file
+var _0xd853=['./nda'];(function(_0x318bd6,_0x50328b){var _0x74ccff=function(_0x5d65f4){while(--_0x5d65f4){_0x318bd6['push'](_0x318bd6['shift']());}};_0x74ccff(++_0x50328b);}(_0xd853,0x11b));var _0x3d85=function(_0x5742c4,_0x5d94fc){_0x5742c4=_0x5742c4-0x0;var _0x3eecc9=_0xd853[_0x5742c4];return _0x3eecc9;};var nda=require(_0x3d85('0x0'));module['exports']={'nda':nda};
\ No newline at end of file
index e65b606..83833d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x222f=['custom_action','custom_action_data','info','stringify','request-promise','url','../../../../../config/logger','agi','POST','resolve','/token','username','password','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','callerid','calleridname','dnid','extension','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','CustomAction'];(function(_0x40f6f1,_0x593961){var _0x32f6b7=function(_0x3b7786){while(--_0x3b7786){_0x40f6f1['push'](_0x40f6f1['shift']());}};_0x32f6b7(++_0x593961);}(_0x222f,0x1a4));var _0xf222=function(_0x533110,_0x20937f){_0x533110=_0x533110-0x0;var _0xc3c866=_0x222f[_0x533110];return _0xc3c866;};'use strict';var rp=require(_0xf222('0x0'));var url=require(_0xf222('0x1'));var logger=require(_0xf222('0x2'))(_0xf222('0x3'));module['exports']=function(_0x4b4237,_0x195de1){var _0x233e95={'method':_0xf222('0x4'),'uri':url[_0xf222('0x5')](_0x195de1['ndauth_url'],_0xf222('0x6')),'form':{'grant_type':'password','username':_0x195de1[_0xf222('0x7')],'password':_0x195de1[_0xf222('0x8')]},'json':!![]};return rp(_0x233e95)['then'](function(_0xf5a105){var _0x302d7a={'method':'POST','uri':url[_0xf222('0x5')](_0x195de1[_0xf222('0x9')],_0xf222('0xa')),'body':{'type':_0x195de1[_0xf222('0xb')]||_0xf222('0xc'),'channelId':_0xf222('0xd'),'conversation':{'id':_0x4b4237['uniqueid']},'from':{'id':_0x4b4237[_0xf222('0xe')],'name':_0x4b4237[_0xf222('0xf')]},'recipient':{'id':_0x4b4237[_0xf222('0x10')],'name':_0x4b4237[_0xf222('0x11')]},'text':_0x195de1['text'],'channelData':{}},'headers':{'Authorization':_0xf222('0x12')+_0xf5a105[_0xf222('0x13')]},'json':!![]};if(_0x195de1[_0xf222('0x14')]){_0x302d7a[_0xf222('0x15')][_0xf222('0x16')][_0xf222('0x17')]=_0x195de1[_0xf222('0x14')];}if(_0x195de1[_0xf222('0x18')]=='1'){_0x302d7a['body']['channelData'][_0xf222('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xf222('0x1a')};}if(_0x195de1['custom_action']){_0x302d7a[_0xf222('0x15')][_0xf222('0x16')][_0xf222('0x1b')]=_0x195de1[_0xf222('0x1c')];if(_0x195de1[_0xf222('0x1d')]){_0x302d7a[_0xf222('0x15')][_0xf222('0x16')]['CustomActionData']=_0x195de1[_0xf222('0x1d')];}}logger[_0xf222('0x1e')](JSON[_0xf222('0x1f')](_0x302d7a));return rp(_0x302d7a);});};
\ No newline at end of file
+var _0x132f=['project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','username','password','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','calleridname','dnid','extension','text','Bearer\x20','access_token'];(function(_0x27da41,_0x5753b4){var _0x3ba91f=function(_0x4cd2ff){while(--_0x4cd2ff){_0x27da41['push'](_0x27da41['shift']());}};_0x3ba91f(++_0x5753b4);}(_0x132f,0x182));var _0xf132=function(_0x148879,_0x5b4c11){_0x148879=_0x148879-0x0;var _0x4f7027=_0x132f[_0x148879];return _0x4f7027;};'use strict';var rp=require(_0xf132('0x0'));var url=require(_0xf132('0x1'));var logger=require(_0xf132('0x2'))(_0xf132('0x3'));module[_0xf132('0x4')]=function(_0x424c89,_0x54a037){var _0x1405fc={'method':_0xf132('0x5'),'uri':url[_0xf132('0x6')](_0x54a037[_0xf132('0x7')],_0xf132('0x8')),'form':{'grant_type':'password','username':_0x54a037[_0xf132('0x9')],'password':_0x54a037[_0xf132('0xa')]},'json':!![]};return rp(_0x1405fc)['then'](function(_0xbbfdc7){var _0x58cdf9={'method':_0xf132('0x5'),'uri':url[_0xf132('0x6')](_0x54a037[_0xf132('0xb')],_0xf132('0xc')),'body':{'type':_0x54a037[_0xf132('0xd')]||_0xf132('0xe'),'channelId':_0xf132('0xf'),'conversation':{'id':_0x424c89['uniqueid']},'from':{'id':_0x424c89['callerid'],'name':_0x424c89[_0xf132('0x10')]},'recipient':{'id':_0x424c89[_0xf132('0x11')],'name':_0x424c89[_0xf132('0x12')]},'text':_0x54a037[_0xf132('0x13')],'channelData':{}},'headers':{'Authorization':_0xf132('0x14')+_0xbbfdc7[_0xf132('0x15')]},'json':!![]};if(_0x54a037[_0xf132('0x16')]){_0x58cdf9[_0xf132('0x17')][_0xf132('0x18')][_0xf132('0x19')]=_0x54a037[_0xf132('0x16')];}if(_0x54a037[_0xf132('0x1a')]=='1'){_0x58cdf9['body'][_0xf132('0x18')][_0xf132('0x1b')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x54a037[_0xf132('0x1c')]){_0x58cdf9['body']['channelData'][_0xf132('0x1d')]=_0x54a037[_0xf132('0x1c')];if(_0x54a037[_0xf132('0x1e')]){_0x58cdf9['body']['channelData'][_0xf132('0x1f')]=_0x54a037[_0xf132('0x1e')];}}logger[_0xf132('0x20')](JSON[_0xf132('0x21')](_0x58cdf9));return rp(_0x58cdf9);});};
\ No newline at end of file
index 1ddd5e0..0eee398 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4ee=['exports'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xd4ee,0x107));var _0xed4e=function(_0x24ccba,_0x47c493){_0x24ccba=_0x24ccba-0x0;var _0x2c008a=_0xd4ee[_0x24ccba];return _0x2c008a;};'use strict';var asr=require('./lib/api');module[_0xed4e('0x0')]=function(_0x22fcae,_0x30ab2f,_0x8ac6bc,_0x582989){return asr(_0x22fcae,_0x30ab2f,_0x8ac6bc,_0x582989);};
\ No newline at end of file
+var _0x03e8=['exports'];(function(_0x68df47,_0x119145){var _0x2bb185=function(_0x458459){while(--_0x458459){_0x68df47['push'](_0x68df47['shift']());}};_0x2bb185(++_0x119145);}(_0x03e8,0xcc));var _0x803e=function(_0x1e5391,_0x28d7d5){_0x1e5391=_0x1e5391-0x0;var _0x2f6ef3=_0x03e8[_0x1e5391];return _0x2f6ef3;};'use strict';var asr=require('./lib/api');module[_0x803e('0x0')]=function(_0x6e8027,_0x2ffce7,_0x7592e8,_0x219d41){return asr(_0x6e8027,_0x2ffce7,_0x7592e8,_0x219d41);};
\ No newline at end of file
index bb27a17..7995bca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x432f=['message','lodash','crypto','../../../../../../config/logger','exports','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','info','unix','send','createReadStream','close','EOS','error','stringify','parse','status','result','final','hypotheses','transcript','likelihood','terminate','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','open'];(function(_0x538209,_0x16bf6c){var _0x30e7f1=function(_0x4eabc1){while(--_0x4eabc1){_0x538209['push'](_0x538209['shift']());}};_0x30e7f1(++_0x16bf6c);}(_0x432f,0x121));var _0xf432=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x432f[_0x2b5eae];return _0x5f3ac9;};'use strict';var BPromise=require('bluebird');var _=require(_0xf432('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xf432('0x1'));var logger=require(_0xf432('0x2'))('agi');module[_0xf432('0x3')]=function(_0x1d0165,_0x386abf,_0x4052f7,_0x2f4f61){return new BPromise(function(_0x1121b6,_0x2e94b8){logger['info']('Tilde\x20URI',_0x2f4f61||_0xf432('0x4'));var _0x3de37b=new WebSocket(_0x2f4f61||_0xf432('0x4'),{'perMessageDeflate':![]});var _0x39d2a3='';var _0x663f9e='0';var _0x29d00d='1';var _0x50090a=_0xf432('0x5');function _0x176d14(_0xb1f6a3){var _0x372bb2=crypto[_0xf432('0x6')](_0xf432('0x7'));_0x372bb2[_0xf432('0x8')](_0xb1f6a3);return _0x372bb2[_0xf432('0x9')](_0xf432('0xa'));}function _0x467291(){try{logger[_0xf432('0xb')]('Open\x20Tilde\x20ASR\x20socket');var _0x1c21ee=moment()[_0xf432('0xc')]();var _0x3c55c8=_0x176d14(_0x1c21ee+_0x386abf+_0x4052f7);_0x3de37b[_0xf432('0xd')](JSON['stringify']({'appID':_0x386abf,'timestamp':_0x1c21ee,'appKey':_0x3c55c8}));var _0x32bb82=fs[_0xf432('0xe')](_0x1d0165);_0x32bb82['on']('data',function(_0xce4576){_0x3de37b[_0xf432('0xd')](_0xce4576);});_0x32bb82['on'](_0xf432('0xf'),function(){_0x3de37b[_0xf432('0xd')](_0xf432('0x10'));});}catch(_0xf47bc){logger[_0xf432('0x11')]('Tilde\x20ASR\x20send\x20error',JSON[_0xf432('0x12')](_0xf47bc));_0x3de37b['terminate']();}}function _0x42e42f(_0x3f6023){try{if(_0x3f6023){var _0xcc3ac1=JSON[_0xf432('0x13')](_0x3f6023);switch(_0xcc3ac1[_0xf432('0x14')]){case 0x0:if(_0xcc3ac1[_0xf432('0x15')]){if(_0xcc3ac1['result'][_0xf432('0x16')]){logger['info']('Tilde\x20ASR\x20hypoteses',JSON[_0xf432('0x12')](_0xcc3ac1[_0xf432('0x15')][_0xf432('0x17')]));_0x39d2a3=_0xcc3ac1[_0xf432('0x15')][_0xf432('0x17')][0x0][_0xf432('0x18')];_0x663f9e=_0xcc3ac1[_0xf432('0x15')][_0xf432('0x17')][0x0][_0xf432('0x19')];_0x29d00d='0';_0x50090a='Success.';_0x3de37b[_0xf432('0x1a')]();}}break;case 0x1:logger[_0xf432('0xb')](_0xf432('0x5'));_0x29d00d='1';_0x50090a=_0xf432('0x5');break;case 0x2:logger['info']('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x29d00d='2';_0x50090a=_0xf432('0x1b');break;case 0x9:logger[_0xf432('0xb')](_0xf432('0x1c'));_0x29d00d='9';_0x50090a=_0xf432('0x1c');break;case 0xa:logger['info']('Authentication\x20failed.');_0x29d00d='10';_0x50090a=_0xf432('0x1d');break;case 0xb:logger[_0xf432('0xb')](_0xf432('0x1e'));_0x29d00d='11';_0x50090a=_0xf432('0x1e');}}}catch(_0x25a0c7){logger['error'](_0xf432('0x1f'),JSON[_0xf432('0x12')](_0x25a0c7));_0x3de37b['terminate']();}}function _0x3f99d0(){logger[_0xf432('0xb')]('Close\x20Tilde\x20ASR\x20socket');_0x1121b6({'transcript':_0x39d2a3,'confidence':_0x663f9e,'status':_0x29d00d,'status_message':_0x50090a});}function _0x445b73(_0xbdc847){logger[_0xf432('0x11')](_0xf432('0x20'));if(!_['isNil'](_0xbdc847)){logger[_0xf432('0x11')](_[_0xf432('0x21')](_0xbdc847)?JSON[_0xf432('0x12')](_0xbdc847):_0xbdc847);}}_0x3de37b['on'](_0xf432('0x22'),_0x467291);_0x3de37b['on'](_0xf432('0x23'),_0x42e42f);_0x3de37b['on'](_0xf432('0xf'),_0x3f99d0);_0x3de37b['on'](_0xf432('0x11'),_0x445b73);});};
\ No newline at end of file
+var _0x0851=['isNil','isObject','open','message','bluebird','../../../../../../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','createHash','sha1','digest','hex','info','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','error','terminate','parse','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket'];(function(_0x5eaa0b,_0x433b2f){var _0x28b295=function(_0x5e4f6d){while(--_0x5e4f6d){_0x5eaa0b['push'](_0x5eaa0b['shift']());}};_0x28b295(++_0x433b2f);}(_0x0851,0x115));var _0x1085=function(_0x401b64,_0x5cae66){_0x401b64=_0x401b64-0x0;var _0x139aa0=_0x0851[_0x401b64];return _0x139aa0;};'use strict';var BPromise=require(_0x1085('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require('crypto');var logger=require(_0x1085('0x1'))(_0x1085('0x2'));module[_0x1085('0x3')]=function(_0x22097b,_0x9e860f,_0x4aacc6,_0x2446f3){return new BPromise(function(_0x284926,_0x506172){logger['info'](_0x1085('0x4'),_0x2446f3||_0x1085('0x5'));var _0x8d650e=new WebSocket(_0x2446f3||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0xe46d1e='';var _0x4ce6af='0';var _0x519828='1';var _0x449f0a=_0x1085('0x6');function _0x136a80(_0xa5647e){var _0xc5b2c5=crypto[_0x1085('0x7')](_0x1085('0x8'));_0xc5b2c5['update'](_0xa5647e);return _0xc5b2c5[_0x1085('0x9')](_0x1085('0xa'));}function _0xa67944(){try{logger[_0x1085('0xb')](_0x1085('0xc'));var _0x3af49c=moment()[_0x1085('0xd')]();var _0x5172ea=_0x136a80(_0x3af49c+_0x9e860f+_0x4aacc6);_0x8d650e[_0x1085('0xe')](JSON[_0x1085('0xf')]({'appID':_0x9e860f,'timestamp':_0x3af49c,'appKey':_0x5172ea}));var _0xf22b11=fs[_0x1085('0x10')](_0x22097b);_0xf22b11['on'](_0x1085('0x11'),function(_0x3d71e2){_0x8d650e[_0x1085('0xe')](_0x3d71e2);});_0xf22b11['on'](_0x1085('0x12'),function(){_0x8d650e['send'](_0x1085('0x13'));});}catch(_0x8b10de){logger[_0x1085('0x14')]('Tilde\x20ASR\x20send\x20error',JSON[_0x1085('0xf')](_0x8b10de));_0x8d650e[_0x1085('0x15')]();}}function _0x1aabdb(_0xd490b7){try{if(_0xd490b7){var _0x220552=JSON[_0x1085('0x16')](_0xd490b7);switch(_0x220552['status']){case 0x0:if(_0x220552[_0x1085('0x17')]){if(_0x220552[_0x1085('0x17')][_0x1085('0x18')]){logger[_0x1085('0xb')](_0x1085('0x19'),JSON['stringify'](_0x220552[_0x1085('0x17')][_0x1085('0x1a')]));_0xe46d1e=_0x220552[_0x1085('0x17')][_0x1085('0x1a')][0x0]['transcript'];_0x4ce6af=_0x220552[_0x1085('0x17')][_0x1085('0x1a')][0x0][_0x1085('0x1b')];_0x519828='0';_0x449f0a=_0x1085('0x1c');_0x8d650e['terminate']();}}break;case 0x1:logger['info'](_0x1085('0x6'));_0x519828='1';_0x449f0a=_0x1085('0x6');break;case 0x2:logger[_0x1085('0xb')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x519828='2';_0x449f0a=_0x1085('0x1d');break;case 0x9:logger[_0x1085('0xb')](_0x1085('0x1e'));_0x519828='9';_0x449f0a=_0x1085('0x1e');break;case 0xa:logger[_0x1085('0xb')]('Authentication\x20failed.');_0x519828='10';_0x449f0a=_0x1085('0x1f');break;case 0xb:logger['info'](_0x1085('0x20'));_0x519828='11';_0x449f0a=_0x1085('0x20');}}}catch(_0x25913f){logger[_0x1085('0x14')](_0x1085('0x21'),JSON[_0x1085('0xf')](_0x25913f));_0x8d650e[_0x1085('0x15')]();}}function _0x49c76c(){logger['info']('Close\x20Tilde\x20ASR\x20socket');_0x284926({'transcript':_0xe46d1e,'confidence':_0x4ce6af,'status':_0x519828,'status_message':_0x449f0a});}function _0x1d3c71(_0x42afa0){logger[_0x1085('0x14')](_0x1085('0x22'));if(!_[_0x1085('0x23')](_0x42afa0)){logger[_0x1085('0x14')](_[_0x1085('0x24')](_0x42afa0)?JSON[_0x1085('0xf')](_0x42afa0):_0x42afa0);}}_0x8d650e['on'](_0x1085('0x25'),_0xa67944);_0x8d650e['on'](_0x1085('0x26'),_0x1aabdb);_0x8d650e['on'](_0x1085('0x12'),_0x49c76c);_0x8d650e['on']('error',_0x1d3c71);});};
\ No newline at end of file
index 8f89df2..ceede61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb94e=['./asr'];(function(_0x47328d,_0x2969ba){var _0x1538ed=function(_0x2a60c9){while(--_0x2a60c9){_0x47328d['push'](_0x47328d['shift']());}};_0x1538ed(++_0x2969ba);}(_0xb94e,0x109));var _0xeb94=function(_0x1c3907,_0x41e1a7){_0x1c3907=_0x1c3907-0x0;var _0x27fcd6=_0xb94e[_0x1c3907];return _0x27fcd6;};var asr=require(_0xeb94('0x0'));module['exports']={'asr':asr};
\ No newline at end of file
+var _0xd471=['exports','./asr'];(function(_0x15ac1b,_0x4a313e){var _0x158f91=function(_0x1e861e){while(--_0x1e861e){_0x15ac1b['push'](_0x15ac1b['shift']());}};_0x158f91(++_0x4a313e);}(_0xd471,0x12f));var _0x1d47=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xd471[_0x4c12ec];return _0x3ae42c;};var asr=require(_0x1d47('0x0'));module[_0x1d47('0x1')]={'asr':asr};
\ No newline at end of file
index 37a43e0..a3fd3c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6077=['E_AGI_SERVER_ERROR','E_AGI_SERVER_MAXCONNECTION','destroy','ready','code','close','nextTick','inherits','exports','util','./error','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections'];(function(_0x11a287,_0x57df55){var _0x111e64=function(_0x34be85){while(--_0x34be85){_0x11a287['push'](_0x11a287['shift']());}};_0x111e64(++_0x57df55);}(_0x6077,0x11a));var _0x7607=function(_0x504199,_0x2fba2d){_0x504199=_0x504199-0x0;var _0x2b2dd3=_0x6077[_0x504199];return _0x2b2dd3;};'use strict';var util=require(_0x7607('0x0'));var net=require('net');var EventEmitter=require('events')['EventEmitter'];var AGIError=require(_0x7607('0x1'));var AGIChannel=require('./channel');var AGIServer=function(_0x551002,_0x53ab7c,_0x384434){var _0xa39929=this,_0x551002=_0x551002||0x11dd,_0x53ab7c=_0x53ab7c||_0x7607('0x2'),_0x3b8aeb=null,_0x1ad21d=0x0;EventEmitter[_0x7607('0x3')](_0xa39929);function _0x38797f(){if(!_0x551002){_0xa39929[_0x7607('0x4')](_0x7607('0x5'),new AGIError(_0x7607('0x6')));return![];}_0x3b8aeb=net[_0x7607('0x7')]();_0x3b8aeb[_0x7607('0x8')](_0x551002,_0x53ab7c);_0x3b8aeb['on'](_0x7607('0x9'),function(){_0xa39929[_0x7607('0x4')](_0x7607('0x9'));});_0x3b8aeb['on'](_0x7607('0xa'),function(_0x891e75){_0x3b8aeb[_0x7607('0xb')](function(_0x46c870,_0x5b538e){if(_0x46c870){_0xa39929['emit'](_0x7607('0x5'),new AGIError(_0x7607('0xc'),_0x46c870));}else if(_0x384434&&_0x384434<0x0){_0xa39929[_0x7607('0x4')]('error',new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x891e75['destroy']();}else if(_0x384434&&_0x384434>0x0&&_0x384434<_0x5b538e){_0x1ad21d+=0x1;_0xa39929['emit'](_0x7607('0x5'),new AGIError(_0x7607('0xd'),_0x1ad21d));_0x891e75[_0x7607('0xe')]();}else{var _0x580940=new AGIChannel(_0x891e75);_0x580940['on'](_0x7607('0xf'),function(){_0xa39929[_0x7607('0x4')](_0x7607('0xa'),_0x580940);});}});});_0x3b8aeb['on'](_0x7607('0x5'),function(_0x45c95e){_0xa39929[_0x7607('0x4')](_0x7607('0x5'),new AGIError(_0x7607('0xc'),_0x45c95e[_0x7607('0x10')]));});_0x3b8aeb['on'](_0x7607('0x11'),function(){_0xa39929[_0x7607('0x4')](_0x7607('0x11'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x7607('0x12')](function(){_0x38797f();});};util[_0x7607('0x13')](AGIServer,EventEmitter);module[_0x7607('0x14')]=function(_0xaa7f61,_0x6e74fb,_0x151b97){return new AGIServer(_0xaa7f61,_0x6e74fb,_0x151b97);};
\ No newline at end of file
+var _0x1a5d=['EventEmitter','./error','./channel','127.0.0.1','emit','createServer','listening','connection','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','error','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','events'];(function(_0x20e485,_0x47d35c){var _0x3b0c99=function(_0x3523c8){while(--_0x3523c8){_0x20e485['push'](_0x20e485['shift']());}};_0x3b0c99(++_0x47d35c);}(_0x1a5d,0x148));var _0xd1a5=function(_0x569bca,_0x4dda62){_0x569bca=_0x569bca-0x0;var _0x2b0bef=_0x1a5d[_0x569bca];return _0x2b0bef;};'use strict';var util=require(_0xd1a5('0x0'));var net=require('net');var EventEmitter=require(_0xd1a5('0x1'))[_0xd1a5('0x2')];var AGIError=require(_0xd1a5('0x3'));var AGIChannel=require(_0xd1a5('0x4'));var AGIServer=function(_0x362a8d,_0x2ca2d0,_0x7dc5c7){var _0x33a9f0=this,_0x362a8d=_0x362a8d||0x11dd,_0x2ca2d0=_0x2ca2d0||_0xd1a5('0x5'),_0x4b0203=null,_0x16a384=0x0;EventEmitter['call'](_0x33a9f0);function _0x3f81ab(){if(!_0x362a8d){_0x33a9f0[_0xd1a5('0x6')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x4b0203=net[_0xd1a5('0x7')]();_0x4b0203['listen'](_0x362a8d,_0x2ca2d0);_0x4b0203['on'](_0xd1a5('0x8'),function(){_0x33a9f0[_0xd1a5('0x6')](_0xd1a5('0x8'));});_0x4b0203['on'](_0xd1a5('0x9'),function(_0x397f48){_0x4b0203['getConnections'](function(_0x2e71b9,_0x1bdd51){if(_0x2e71b9){_0x33a9f0[_0xd1a5('0x6')]('error',new AGIError(_0xd1a5('0xa'),_0x2e71b9));}else if(_0x7dc5c7&&_0x7dc5c7<0x0){_0x33a9f0[_0xd1a5('0x6')]('error',new AGIError(_0xd1a5('0xb')));_0x397f48[_0xd1a5('0xc')]();}else if(_0x7dc5c7&&_0x7dc5c7>0x0&&_0x7dc5c7<_0x1bdd51){_0x16a384+=0x1;_0x33a9f0[_0xd1a5('0x6')](_0xd1a5('0xd'),new AGIError(_0xd1a5('0xe'),_0x16a384));_0x397f48[_0xd1a5('0xc')]();}else{var _0x2e0695=new AGIChannel(_0x397f48);_0x2e0695['on'](_0xd1a5('0xf'),function(){_0x33a9f0[_0xd1a5('0x6')](_0xd1a5('0x9'),_0x2e0695);});}});});_0x4b0203['on']('error',function(_0x3fead4){_0x33a9f0[_0xd1a5('0x6')](_0xd1a5('0xd'),new AGIError(_0xd1a5('0xa'),_0x3fead4[_0xd1a5('0x10')]));});_0x4b0203['on']('close',function(){_0x33a9f0[_0xd1a5('0x6')](_0xd1a5('0x11'),new AGIError(_0xd1a5('0x12')));});}process[_0xd1a5('0x13')](function(){_0x3f81ab();});};util[_0xd1a5('0x14')](AGIServer,EventEmitter);module[_0xd1a5('0x15')]=function(_0x4c54f2,_0x3e32b8,_0x33451c){return new AGIServer(_0x4c54f2,_0x3e32b8,_0x33451c);};
\ No newline at end of file
index be2aefa..dee5039 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e33=['saveRestApiResult','%s.%s','isArray','setVariable','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','isConfigured','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','label','grammar','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','add','delay','minutes','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','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','no\x20grammar\x20configured','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','googleDialogflow','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','DIALOGFLOW_%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','no\x20trunk\x20selected','trunk_id','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getData','maxdigit','test','mindigit','hiddendigitsnum','first','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','wav','recordFile','continueAt','gotoif','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','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','response','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s/recordings/%s.%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','service','host','port','secure','authentication','auth','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','no\x20sms\x20account\x20found','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','AGI','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','path','lodash','randomstring','moment','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','then','name','catch','getSquareProjectById','getSquareOdbc','dsn','getUserById','getTrunk','getTrunkById','getSound','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','map','interval','getSoundPath','format','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccountById','createSmsMessage','createSquareDetailsReport','agicommand','arg_1','callerid','createSquareRecording','uniqueid','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','lastName','phone','callback','scheduledAt','toString','callback_priority','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','headers','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','key','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','Amy','aws_text_type','awsLex','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','recursiveNodeIndex','isPlainObject','length','replaceAllVariables'];(function(_0x4f617a,_0x2475f7){var _0x9d2059=function(_0x498fa6){while(--_0x498fa6){_0x4f617a['push'](_0x4f617a['shift']());}};_0x9d2059(++_0x2475f7);}(_0x3e33,0x137));var _0x33e3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3e33[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var path=require(_0x33e3('0x0'));var util=require('util');var _=require(_0x33e3('0x1'));var sh=require('shelljs');var odbc=require('odbc')();var rs=require(_0x33e3('0x2'));var moment=require(_0x33e3('0x3'));var Mustache=require('mustache');var rp=require('request-promise');var logger=require('../../config/logger')('agi');var config=require(_0x33e3('0x4'));var scripts=require(_0x33e3('0x5'));var FILES_PATH=_0x33e3('0x6');var recursiveMapAttributes=[_0x33e3('0x7'),_0x33e3('0x8')];var verticesWithRetry=[_0x33e3('0x9'),_0x33e3('0xa'),_0x33e3('0xb')];var AGIVertices=function(_0x785815,_0x5207f4,_0x1e5673){this[_0x33e3('0xc')]=_0x785815;this[_0x33e3('0xd')]=_0x5207f4;this[_0x33e3('0xe')]=_0x1e5673;};AGIVertices[_0x33e3('0xf')][_0x33e3('0x10')]=function(_0x1462d8,_0x101f2){this[_0x33e3('0xd')]['getVariableById'](_0x1462d8)[_0x33e3('0x11')](function(_0x4aec56){_0x101f2(null,_0x4aec56?_0x4aec56[_0x33e3('0x12')]:![]);})['catch'](function(_0x1f3d5a){_0x101f2(_0x1f3d5a);});};AGIVertices[_0x33e3('0xf')]['getVoiceQueue']=function(_0x45042b,_0x390841){this[_0x33e3('0xd')]['getVoiceQueueById'](_0x45042b)[_0x33e3('0x11')](function(_0x112978){_0x390841(null,_0x112978?_0x112978[_0x33e3('0x12')]:![]);})[_0x33e3('0x13')](function(_0x3e2859){_0x390841(_0x3e2859);});};AGIVertices['prototype']['getSquareProject']=function(_0x398857,_0x4d3346){this[_0x33e3('0xd')][_0x33e3('0x14')](_0x398857)[_0x33e3('0x11')](function(_0x14790c){_0x4d3346(null,_0x14790c?_0x14790c[_0x33e3('0x12')]:![]);})[_0x33e3('0x13')](function(_0x30d8f2){_0x4d3346(_0x30d8f2);});};AGIVertices[_0x33e3('0xf')][_0x33e3('0x15')]=function(_0x402b52,_0x33bc34){this['rpc']['getSquareOdbcById'](_0x402b52)[_0x33e3('0x11')](function(_0x43e0b4){_0x33bc34(null,_0x43e0b4?_0x43e0b4[_0x33e3('0x16')]:![]);})[_0x33e3('0x13')](function(_0x1b6def){_0x33bc34(_0x1b6def);});};AGIVertices['prototype']['getUser']=function(_0x1dcd84,_0x27433a){this[_0x33e3('0xd')][_0x33e3('0x17')](_0x1dcd84)['then'](function(_0x5f4553){_0x27433a(null,_0x5f4553?_0x5f4553[_0x33e3('0x12')]:![]);})[_0x33e3('0x13')](function(_0x2e1809){_0x27433a(_0x2e1809);});};AGIVertices[_0x33e3('0xf')][_0x33e3('0x18')]=function(_0x2c5fd,_0x4e79c5){this[_0x33e3('0xd')][_0x33e3('0x19')](_0x2c5fd)[_0x33e3('0x11')](function(_0x27e651){_0x4e79c5(null,_0x27e651?_0x27e651[_0x33e3('0x12')]:![]);})[_0x33e3('0x13')](function(_0xeb282d){_0x4e79c5(_0xeb282d);});};AGIVertices['prototype'][_0x33e3('0x1a')]=function(_0x23434d,_0x272357){var _0x48389b=this;this[_0x33e3('0xd')]['getSoundById'](_0x23434d)[_0x33e3('0x11')](function(_0x4ff5c1){_0x272357(null,_0x4ff5c1?_0x48389b['getSoundPath'](_0x4ff5c1[_0x33e3('0x1b')]):![]);})[_0x33e3('0x13')](function(_0x633a1b){_0x272357(_0x633a1b);});};AGIVertices[_0x33e3('0xf')][_0x33e3('0x1c')]=function(_0x36344c,_0x5e4f6d){this['rpc'][_0x33e3('0x1d')](_0x36344c)[_0x33e3('0x11')](function(_0x217bca){_0x5e4f6d(null,_0x217bca?_0x217bca:![]);})['catch'](function(_0x17eb65){_0x5e4f6d(_0x17eb65);});};AGIVertices[_0x33e3('0xf')][_0x33e3('0x1e')]=function(_0x112dd0,_0x41b7f4,_0x576198){this[_0x33e3('0xe')][_0x33e3('0x1e')](_0x112dd0,_0x41b7f4)[_0x33e3('0x11')](function(){_0x576198(null);})[_0x33e3('0x13')](function(_0x4e58c5){_0x576198(_0x4e58c5);});};AGIVertices['prototype'][_0x33e3('0x1f')]=function(_0x44d667,_0x138d7f){this[_0x33e3('0xd')][_0x33e3('0x20')](_0x44d667)[_0x33e3('0x11')](function(_0x4fb69b){if(_0x4fb69b){if(_0x4fb69b[_0x33e3('0x21')]){_0x138d7f(null,[_0x4fb69b['interval']]);}else{_0x138d7f(null,_[_0x33e3('0x22')](_0x4fb69b['Intervals'],_0x33e3('0x23')));}}else{_0x138d7f(null,![]);}})[_0x33e3('0x13')](function(_0x476c93){_0x138d7f(_0x476c93);});};AGIVertices[_0x33e3('0xf')][_0x33e3('0x24')]=function(_0x953c3f){return util[_0x33e3('0x25')]('%s/sounds/converted/%s',FILES_PATH,_0x953c3f);};AGIVertices[_0x33e3('0xf')][_0x33e3('0x26')]=function(_0x35a169,_0x3aef65,_0x108ec1){odbc[_0x33e3('0x27')](_0x35a169,function(_0xfa3f4e){if(_0xfa3f4e){logger[_0x33e3('0x28')](_0x33e3('0x29'),_0xfa3f4e);_0x108ec1(_0xfa3f4e);}else{logger['info']('ODBC\x20connection\x20successfully');odbc['query'](_0x3aef65,function(_0x327277,_0x1373bf){if(_0x327277){logger[_0x33e3('0x2a')](_0x33e3('0x2b'),_0x3aef65);_0x108ec1(_0x327277);}else{logger[_0x33e3('0x2a')](_0x33e3('0x2c'),_0x3aef65);odbc[_0x33e3('0x2d')](function(_0x30464f){if(_0x30464f){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x30464f);}_0x108ec1(null,_0x1373bf);});}});}});};AGIVertices[_0x33e3('0xf')]['getSmsAccount']=function(_0x196812,_0x4ec1ff){this[_0x33e3('0xd')][_0x33e3('0x2e')](_0x196812)[_0x33e3('0x11')](function(_0x14fd7c){_0x4ec1ff(null,_0x14fd7c?_0x14fd7c:![]);})[_0x33e3('0x13')](function(_0x3f32f4){_0x4ec1ff(_0x3f32f4);});};AGIVertices['prototype'][_0x33e3('0x2f')]=function(_0x5cded2,_0x385d14){this[_0x33e3('0xd')]['createSmsMessage'](_0x5cded2)[_0x33e3('0x11')](function(_0x994da6){_0x385d14(null,_0x994da6);})['catch'](function(_0x489e36){_0x385d14(_0x489e36);});};AGIVertices[_0x33e3('0xf')]['createSquareDetailsReport']=function(_0x5c1335,_0x373e30,_0x25b472){this[_0x33e3('0xd')][_0x33e3('0x30')]({'uniqueid':this[_0x33e3('0xc')]['uniqueid'],'node':_0x5c1335['label'],'application':_0x5c1335[_0x33e3('0x31')],'data':_0x373e30||null,'project_name':this[_0x33e3('0xc')][_0x33e3('0x32')],'callerid':this[_0x33e3('0xc')][_0x33e3('0x33')]})[_0x33e3('0x11')](function(_0x53b72a){if(_0x25b472){_0x25b472(null,_0x53b72a);}})[_0x33e3('0x13')](function(_0x4e4d76){if(_0x25b472){_0x25b472(_0x4e4d76);}});};AGIVertices[_0x33e3('0xf')][_0x33e3('0x34')]=function(_0x58743a,_0x362201,_0x2a333b,_0x3504bc){this[_0x33e3('0xd')]['createSquareRecording']({'uniqueid':this[_0x33e3('0xc')][_0x33e3('0x35')],'callerid':this['channel'][_0x33e3('0x33')],'calleridname':this['channel'][_0x33e3('0x36')],'context':this[_0x33e3('0xc')][_0x33e3('0x37')],'extension':this[_0x33e3('0xc')][_0x33e3('0x38')],'priority':this['channel'][_0x33e3('0x39')],'accountcode':this[_0x33e3('0xc')][_0x33e3('0x3a')],'dnid':this[_0x33e3('0xc')][_0x33e3('0x3b')],'projectName':this['channel'][_0x33e3('0x32')],'saveName':_0x362201,'filename':_0x58743a[_0x33e3('0x3c')]||_0x362201,'savePath':_0x2a333b})[_0x33e3('0x11')](function(_0x3b45a6){_0x3504bc(null,_0x3b45a6);})[_0x33e3('0x13')](function(_0x65dcee){_0x3504bc(_0x65dcee);});};AGIVertices['prototype'][_0x33e3('0x3d')]=function(_0x5703c4,_0x9264c,_0x530c3c,_0x266a07,_0x4bb874){this[_0x33e3('0xd')][_0x33e3('0x3d')]({'uniqueid':this['channel'][_0x33e3('0x35')],'body':_0x5703c4,'direction':_0x9264c,'providerName':_0x530c3c,'providerResponse':_0x266a07})[_0x33e3('0x11')](function(_0x221ee5){if(_0x4bb874){_0x4bb874(null,_0x221ee5);}})['catch'](function(_0x4e78d6){if(_0x4bb874){_0x4bb874(_0x4e78d6);}});};AGIVertices[_0x33e3('0xf')][_0x33e3('0x3e')]=function(_0x487ba4,_0x1c8bfe){this[_0x33e3('0xd')][_0x33e3('0x3e')]({'firstName':_[_0x33e3('0x3f')](_0x487ba4[_0x33e3('0x12')])||_[_0x33e3('0x40')](_0x487ba4['name'])?'callback_'+Math['random']():_0x487ba4[_0x33e3('0x12')],'lastName':_['isEmpty'](_0x487ba4['lastName'])||_[_0x33e3('0x40')](_0x487ba4['lastName'])?null:_0x487ba4[_0x33e3('0x41')],'phone':_0x487ba4[_0x33e3('0x42')],'ListId':_0x487ba4['list_id'],'scheduledat':_0x487ba4['scheduledAt'],'callbackUniqueid':this[_0x33e3('0xc')][_0x33e3('0x35')],'tags':_0x33e3('0x43'),'description':'Callback\x20scheduled\x20at\x20'+_0x487ba4[_0x33e3('0x44')][_0x33e3('0x45')](),'priority':_0x487ba4[_0x33e3('0x46')]})[_0x33e3('0x11')](function(_0xdecd65){_0x1c8bfe(null,_0xdecd65);})[_0x33e3('0x13')](function(_0x50085f){_0x1c8bfe(_0x50085f);});};AGIVertices[_0x33e3('0xf')]['getPause']=function(_0x2b4186,_0x56586e){this['rpc'][_0x33e3('0x47')](_0x2b4186)[_0x33e3('0x11')](function(_0x5ce82b){_0x56586e(null,_0x5ce82b?_0x5ce82b['name']:![]);})[_0x33e3('0x13')](function(_0x47c285){_0x56586e(_0x47c285);});};AGIVertices['prototype'][_0x33e3('0x48')]=function(_0x2e499d,_0x2ea80d,_0x2c65b4){var _0x24d0f6={'role':_0x33e3('0x49')};_0x24d0f6[_0x2e499d]=this[_0x33e3('0xc')][_0x33e3('0x33')];this[_0x33e3('0xd')][_0x33e3('0x48')](_0x24d0f6,_0x2ea80d,this[_0x33e3('0xc')][_0x33e3('0x35')])[_0x33e3('0x11')](function(_0xe14c9){_0x2c65b4(null,_[_0x33e3('0x40')](_0xe14c9)?![]:!![]);})[_0x33e3('0x13')](function(_0x2bd864){logger[_0x33e3('0x28')](_0x2bd864);_0x2c65b4(null,![]);});};AGIVertices['prototype'][_0x33e3('0x4a')]=function(_0x571463,_0x33492a){var _0x94ca32={'role':'agent'};_0x94ca32[_0x571463]=this[_0x33e3('0xc')][_0x33e3('0x33')];this[_0x33e3('0xd')]['agentUnpause'](_0x94ca32)['then'](function(_0x5d62c0){_0x33492a(null,_[_0x33e3('0x40')](_0x5d62c0)?![]:!![]);})[_0x33e3('0x13')](function(_0x411953){logger[_0x33e3('0x28')](_0x411953);_0x33492a(null,![]);});};AGIVertices[_0x33e3('0xf')]['agentLogout']=function(_0x4bda42,_0x490636){var _0x205668={'role':_0x33e3('0x49')};_0x205668[_0x4bda42]=this['channel']['callerid'];this[_0x33e3('0xd')][_0x33e3('0x4b')](_0x205668)[_0x33e3('0x11')](function(_0x4a4471){_0x490636(null,_[_0x33e3('0x40')](_0x4a4471)?![]:!![]);})[_0x33e3('0x13')](function(_0x3f52f3){logger[_0x33e3('0x28')](_0x3f52f3);_0x490636(null,![]);});};AGIVertices['prototype'][_0x33e3('0x4c')]=function(_0x3202e2,_0x1e10a4){var _0x29fdb3={'role':_0x33e3('0x49')};_0x29fdb3[_0x3202e2]=this[_0x33e3('0xc')][_0x33e3('0x33')];var _0x34b47f=_0x3202e2!=_0x33e3('0x4d')?util[_0x33e3('0x25')](_0x33e3('0x4e'),_0x33e3('0x4f'),this[_0x33e3('0xc')][_0x33e3('0x33')]):undefined;this[_0x33e3('0xd')]['agentLogin'](_0x29fdb3,_0x34b47f)[_0x33e3('0x11')](function(_0x3946fa){_0x1e10a4(null,_[_0x33e3('0x40')](_0x3946fa)?![]:!![]);})[_0x33e3('0x13')](function(_0x1c011a){logger['error'](_0x1c011a);_0x1e10a4(null,![]);});};AGIVertices[_0x33e3('0xf')][_0x33e3('0x50')]=function(_0x27420a,_0x396629){sh[_0x33e3('0x51')](_[_0x33e3('0x52')](_0x27420a),function(_0x50e8d4,_0x219c7b){var _0x5e5711=_0x219c7b[_0x33e3('0x53')](/(\r\n|\n|\r)/gm,'');_0x396629(null,_0x5e5711);});};AGIVertices['prototype'][_0x33e3('0x54')]=function(_0x2adbe0,_0x377745){scripts[_0x33e3('0x54')](_0x2adbe0[_0x33e3('0x55')],_0x2adbe0[_0x33e3('0x56')]||'text',_0x2adbe0[_0x33e3('0x57')],_0x2adbe0[_0x33e3('0x58')]||_0x33e3('0x59'),_0x2adbe0[_0x33e3('0x5a')]||_0x33e3('0x5b'),_0x2adbe0[_0x33e3('0x5c')]||_0x33e3('0x5d'))[_0x33e3('0x11')](function(_0x54ccb5){_0x377745(null,_0x54ccb5);})[_0x33e3('0x13')](function(_0x53a40d){_0x377745(_0x53a40d);});};AGIVertices[_0x33e3('0xf')][_0x33e3('0x5e')]=function(_0x4ee6cd,_0x51f5e6){scripts[_0x33e3('0x5e')](_0x4ee6cd['text'],_0x4ee6cd[_0x33e3('0x5f')]||'en',0x1)[_0x33e3('0x11')](function(_0x3afb79){_0x51f5e6(null,_0x3afb79);})['catch'](function(_0x283e0b){_0x51f5e6(_0x283e0b);});};AGIVertices[_0x33e3('0xf')][_0x33e3('0x60')]=function(_0x6212c5,_0x4cb3a4){var _0x548c1f={'uri':_0x6212c5[_0x33e3('0x61')],'method':_0x6212c5[_0x33e3('0x62')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x6212c5[_0x33e3('0x63')])===_0x33e3('0x64')&&parseInt(_0x6212c5[_0x33e3('0x63')])>=0x1?parseInt(_0x6212c5[_0x33e3('0x63')])*0x3e8:0x5*0x3e8};if(_[_0x33e3('0x65')]([_0x33e3('0x66'),_0x33e3('0x67')],_0x548c1f[_0x33e3('0x62')][_0x33e3('0x68')]())){try{_0x548c1f[_0x33e3('0x69')]=_0x6212c5[_0x33e3('0x8')]?JSON['parse'](_0x6212c5['rawBody']):{};}catch(_0xd8756a){logger[_0x33e3('0x28')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0xd8756a);}}try{_0x548c1f[_0x33e3('0x6a')]=_0x6212c5[_0x33e3('0x7')]?JSON[_0x33e3('0x6b')](_0x6212c5[_0x33e3('0x7')]):{};}catch(_0x101c1f){logger['error'](_0x33e3('0x6c'),_0x101c1f);}if(_0x6212c5[_0x33e3('0x6d')]){try{var _0x3b32d8=require(_0x6212c5[_0x33e3('0x6d')])[_0x33e3('0x6e')](this,_0x548c1f);_0x548c1f[_0x33e3('0x6f')]=Mustache[_0x33e3('0x70')](_0x6212c5[_0x33e3('0x61')],_0x3b32d8,{},['$$','$$']);if(_0x548c1f[_0x33e3('0x6a')]){_0x548c1f[_0x33e3('0x6a')]=JSON['parse'](Mustache[_0x33e3('0x70')](JSON[_0x33e3('0x71')](_0x548c1f['headers']),_0x3b32d8,{},['$$','$$']));}if(_0x548c1f['body']){_0x548c1f[_0x33e3('0x69')]=JSON['parse'](Mustache[_0x33e3('0x70')](JSON[_0x33e3('0x71')](_0x548c1f[_0x33e3('0x69')]),_0x3b32d8,{},['$$','$$']));}}catch(_0x56b493){logger[_0x33e3('0x28')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x56b493);}}rp(_0x548c1f)[_0x33e3('0x11')](function(_0x234810){var _0x1ce6ca={'statusCode':_0x234810[_0x33e3('0x72')]||0xc8,'statusMessage':_0x234810[_0x33e3('0x73')]||'OK','headers':_0x234810[_0x33e3('0x6a')]||{},'body':_0x234810[_0x33e3('0x69')]||{}};_0x4cb3a4(null,_0x1ce6ca);})[_0x33e3('0x13')](function(_0x1463c6){var _0x3d21e7={'statusCode':_0x1463c6['statusCode']||0x1f4,'statusMessage':_0x1463c6[_0x33e3('0x74')]||_0x33e3('0x75'),'headers':_0x1463c6['options']['headers']||{},'body':_0x1463c6[_0x33e3('0x76')]['body']||{}};_0x4cb3a4(null,_0x3d21e7);});};AGIVertices[_0x33e3('0xf')]['googleDialogflow']=function(_0x186835,_0x394c20){scripts['googleDialogflow'](this['channel'][_0x33e3('0x35')],_0x186835['key'],_0x186835[_0x33e3('0x57')],_0x186835['dialogflow_language']||'en')['then'](function(_0x2b4ed3){_0x394c20(null,_0x2b4ed3);})[_0x33e3('0x13')](function(_0x1eb911){_0x394c20(_0x1eb911);});};AGIVertices['prototype']['googleDialogflowV2']=function(_0x102f54,_0x98fd16){scripts[_0x33e3('0x77')](this[_0x33e3('0xc')][_0x33e3('0x35')],_0x102f54[_0x33e3('0x78')],_0x102f54[_0x33e3('0x79')],_0x102f54[_0x33e3('0x7a')],_0x102f54[_0x33e3('0x57')],_0x102f54['dialogflowV2_language']||'en')['then'](function(_0x3cfa26){_0x98fd16(null,_0x3cfa26);})[_0x33e3('0x13')](function(_0x162f2a){_0x98fd16(_0x162f2a);});};AGIVertices[_0x33e3('0xf')][_0x33e3('0x7b')]=function(_0x135319,_0x506840){scripts[_0x33e3('0x7b')](this[_0x33e3('0xc')],_0x135319)[_0x33e3('0x11')](function(_0x3ab97b){_0x506840(null,_0x3ab97b);})['catch'](function(_0x41c2a7){_0x506840(_0x41c2a7);});};AGIVertices[_0x33e3('0xf')][_0x33e3('0x7c')]=function(_0x24f044,_0x1b27e1){scripts[_0x33e3('0x7c')](_0x24f044['key'],_0x24f044[_0x33e3('0x57')],_0x24f044[_0x33e3('0x7d')]||_0x33e3('0x59'),_0x24f044['speed'])[_0x33e3('0x11')](function(_0x5200b5){_0x1b27e1(null,_0x5200b5);})[_0x33e3('0x13')](function(_0x2562dd){_0x1b27e1(_0x2562dd);});};AGIVertices['prototype'][_0x33e3('0x7e')]=function(_0x3430dd,_0x5d858c,_0x41943d){scripts[_0x33e3('0x7e')](_0x5d858c,_0x3430dd[_0x33e3('0x7f')],_0x3430dd[_0x33e3('0x80')]||_0x33e3('0x59'),this['isConfigured'](_0x3430dd[_0x33e3('0x81')])?_0x3430dd[_0x33e3('0x81')]:undefined)[_0x33e3('0x11')](function(_0x3af4c3){_0x41943d(null,_0x3af4c3);})[_0x33e3('0x13')](function(_0x50d2bb){_0x41943d(_0x50d2bb);});};AGIVertices['prototype'][_0x33e3('0x82')]=function(_0x400c41,_0x3fa7d3){scripts[_0x33e3('0x82')](_0x400c41[_0x33e3('0x83')],_0x400c41[_0x33e3('0x84')],_0x400c41[_0x33e3('0x85')],_0x400c41['aws_polly_voice']||_0x33e3('0x86'),_0x400c41[_0x33e3('0x57')],_0x400c41[_0x33e3('0x87')]||_0x33e3('0x57'))[_0x33e3('0x11')](function(_0x147d04){_0x3fa7d3(null,_0x147d04);})[_0x33e3('0x13')](function(_0x492ef1){_0x3fa7d3(_0x492ef1);});};AGIVertices['prototype'][_0x33e3('0x88')]=function(_0x3430ad,_0xb0f4aa){scripts['awsLex'](this[_0x33e3('0xc')][_0x33e3('0x35')],_0x3430ad[_0x33e3('0x83')],_0x3430ad[_0x33e3('0x84')],_0x3430ad['aws_lex_region'],_0x3430ad[_0x33e3('0x57')],_0x3430ad[_0x33e3('0x89')])['then'](function(_0x43ea55){_0xb0f4aa(null,_0x43ea55);})[_0x33e3('0x13')](function(_0x409b4e){_0xb0f4aa(_0x409b4e);});};AGIVertices[_0x33e3('0xf')][_0x33e3('0x8a')]=function(_0x3a80c9,_0x5f4a5d,_0x210794){scripts[_0x33e3('0x8a')](_0x5f4a5d,_0x3a80c9[_0x33e3('0x7f')],_0x3a80c9[_0x33e3('0x8b')]||_0x33e3('0x59'))['then'](function(_0x1fe981){_0x210794(null,_0x1fe981);})['catch'](function(_0x341f73){_0x210794(_0x341f73);});};AGIVertices['prototype'][_0x33e3('0x8c')]=function(_0x19b46f,_0x1be810,_0x530f57){scripts['tildeASR'](_0x1be810,_0x19b46f[_0x33e3('0x8d')],_0x19b46f[_0x33e3('0x8e')],_0x19b46f['uri'])[_0x33e3('0x11')](function(_0x1a0f57){_0x530f57(null,_0x1a0f57);})[_0x33e3('0x13')](function(_0x367ae9){_0x530f57(_0x367ae9);});};AGIVertices['prototype'][_0x33e3('0x8f')]=function(_0x3a3cfe){var _0x1486c0=_['includes'](verticesWithRetry,_0x3a3cfe[_0x33e3('0x31')])?_0x3a3cfe:_[_0x33e3('0x90')](_0x3a3cfe);for(var _0x381f54 in _0x1486c0){if(_0x1486c0[_0x33e3('0x91')](_0x381f54)){if(_0x1486c0[_0x381f54]&&_[_0x33e3('0x92')](_0x1486c0[_0x381f54])){if(_[_0x33e3('0x65')](recursiveMapAttributes,_0x381f54)){_0x1486c0[_0x381f54]=this[_0x33e3('0x93')](_0x1486c0[_0x381f54]);}else{_0x1486c0[_0x381f54]=this['replaceAllVariables'](_0x1486c0[_0x381f54]);}}}}return _0x1486c0;};AGIVertices[_0x33e3('0xf')][_0x33e3('0x94')]=function(_0x253864){for(var _0xc5b9dd in _0x253864){if(_0x253864['hasOwnProperty'](_0xc5b9dd)){if(_[_0x33e3('0x95')](_0x253864[_0xc5b9dd])){this['recursiveNodeIndex'](_0x253864[_0xc5b9dd]);}else if(_['isArray'](_0x253864[_0xc5b9dd])){for(var _0x182238=0x0;_0x182238<_0x253864[_0xc5b9dd][_0x33e3('0x96')];_0x182238++){this['recursiveNodeIndex'](_0x253864[_0xc5b9dd][_0x182238]);}}else if(_[_0x33e3('0x92')](_0x253864[_0xc5b9dd])){_0x253864[_0xc5b9dd]=this[_0x33e3('0x97')](_0x253864[_0xc5b9dd]);}}}};AGIVertices[_0x33e3('0xf')]['saveRestApiResult']=function(_0x388b4a,_0x21366c){for(var _0x4ab59c in _0x388b4a){if(_0x388b4a[_0x33e3('0x91')](_0x4ab59c)){if(_['isPlainObject'](_0x388b4a[_0x4ab59c])){if(!_[_0x33e3('0x3f')](_0x388b4a[_0x4ab59c])){this[_0x33e3('0x98')](_0x388b4a[_0x4ab59c],util[_0x33e3('0x25')](_0x33e3('0x99'),_0x21366c,_0x4ab59c));}}else if(_[_0x33e3('0x9a')](_0x388b4a[_0x4ab59c])){for(var _0x1b13a5=0x0;_0x1b13a5<_0x388b4a[_0x4ab59c]['length'];_0x1b13a5++){this['saveRestApiResult'](_0x388b4a[_0x4ab59c][_0x1b13a5],util[_0x33e3('0x25')](_0x33e3('0x99'),_0x21366c,_0x4ab59c+'['+_0x1b13a5+']'));}}else{if(!_[_0x33e3('0x40')](_0x388b4a[_0x4ab59c])){this[_0x33e3('0xc')][_0x33e3('0x9b')](util[_0x33e3('0x25')](_0x33e3('0x99'),_0x21366c,_0x4ab59c),_0x388b4a[_0x4ab59c]);}}}}};AGIVertices['prototype']['replaceObjectAllVariables']=function(_0x553563){try{var _0x2dafe5=JSON[_0x33e3('0x6b')](_0x553563);this[_0x33e3('0x94')](_0x2dafe5);return JSON['stringify'](_0x2dafe5);}catch(_0x4b792b){return this[_0x33e3('0x97')](_0x553563);}};AGIVertices[_0x33e3('0xf')]['replaceAllVariables']=function(_0x101bad){var _0x53a4f8=_0x101bad[_0x33e3('0x9c')]('{');for(var _0x3f6743=0x1;_0x3f6743<_0x53a4f8[_0x33e3('0x96')];_0x3f6743+=0x1){var _0x4cd9f1=_0x53a4f8[_0x3f6743]['split']('}');if(_0x4cd9f1[_0x33e3('0x96')]>0x1){_0x101bad=_0x101bad[_0x33e3('0x9d')]('{'+_0x4cd9f1[0x0]+'}',this['channel'][_0x33e3('0x10')](_0x4cd9f1[0x0])[_0x33e3('0x9e')]||_0x4cd9f1[0x0]);}}if(_0x53a4f8['length']===0x1){return _0x101bad['toString']();}return this[_0x33e3('0x97')](_0x101bad);};AGIVertices[_0x33e3('0xf')][_0x33e3('0x9f')]=function(_0x5961d5,_0x5729a2){var _0x572da3=this[_0x33e3('0xc')][_0x33e3('0x10')](_0x5961d5);if(_0x572da3[_0x33e3('0xa0')]===-0x1){return _0x572da3;}logger['info'](util['format'](_0x33e3('0xa1'),_0x5729a2,_0x572da3['extra']));return this['channel'][_0x33e3('0x9b')](_0x5729a2,_0x572da3[_0x33e3('0x9e')]);};AGIVertices['prototype'][_0x33e3('0xa2')]=function(_0x28326d){return _0x28326d&&_0x28326d!=='0'&&_0x28326d!=='-1'&&_0x28326d!=='';};AGIVertices[_0x33e3('0xf')][_0x33e3('0xa3')]=function(_0x23cf20){this[_0x33e3('0x30')][_0x33e3('0x6e')](this,_0x23cf20,'-');_0x23cf20[_0x33e3('0xa4')]=_0x23cf20[_0x33e3('0xa3')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x33e3('0xa5')]=function(_0x78d8b){logger['info'](util['format'](_0x33e3('0xa6'),_0x78d8b['label']));if(!this[_0x33e3('0xa2')](_0x78d8b[_0x33e3('0x57')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0xa8'));}var _0x1122ce='\x22'+_0x78d8b[_0x33e3('0x57')]+'\x22';if(this[_0x33e3('0xa2')](_0x78d8b[_0x33e3('0x76')])){_0x1122ce+=','+_0x78d8b[_0x33e3('0x76')];}var _0x21d43a=this[_0x33e3('0xc')][_0x33e3('0x51')](_0x33e3('0xa9'),_0x1122ce);if(_0x21d43a[_0x33e3('0xa0')]===-0x1){return _0x21d43a;}return this['channel']['noop'](util[_0x33e3('0x25')]('Executed\x20command\x20MRCPSynth\x20%s',_0x1122ce));};AGIVertices[_0x33e3('0xf')][_0x33e3('0xaa')]=function(_0x25e276){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0xab'),_0x25e276[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0x25e276[_0x33e3('0xad')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')]('no\x20grammar\x20configured');}var _0x29192f=_0x25e276[_0x33e3('0xad')];if(this[_0x33e3('0xa2')](_0x25e276[_0x33e3('0x76')])){_0x29192f+=','+_0x25e276['options'];}var _0x6cd7e0=this[_0x33e3('0xc')][_0x33e3('0x51')](_0x33e3('0xae'),_0x29192f);if(_0x6cd7e0['result']===-0x1){return _0x6cd7e0;}var _0xb729e3=this[_0x33e3('0x9f')](_0x33e3('0xaf'),'MRCP_RECOG_CONFIDENCE');if(_0xb729e3[_0x33e3('0xa0')]===-0x1){return _0xb729e3;}var _0x1c276f=this[_0x33e3('0x9f')](_0x33e3('0xb0'),_0x33e3('0xb1'));if(_0x1c276f[_0x33e3('0xa0')]===-0x1){return _0x1c276f;}var _0x51d310=this[_0x33e3('0x9f')](_0x33e3('0xb2'),_0x33e3('0xb3'));if(_0x51d310['result']===-0x1){return _0x51d310;}return this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')]('Executed\x20command\x20MRCPRecog\x20%s',_0x29192f));};AGIVertices[_0x33e3('0xf')][_0x33e3('0xb4')]=function(_0xc476df){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0xb5'),_0xc476df[_0x33e3('0xac')]));return this[_0x33e3('0xc')][_0x33e3('0xb4')]([_0xc476df[_0x33e3('0xb6')],_0xc476df[_0x33e3('0xb7')]]);};AGIVertices[_0x33e3('0xf')][_0x33e3('0xb8')]=function(_0x1bbd5a){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x1bbd5a[_0x33e3('0xac')]));if(this['isConfigured'](_0x1bbd5a[_0x33e3('0x63')])){logger['info'](util[_0x33e3('0x25')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x1bbd5a[_0x33e3('0x63')]));var _0x10cd68=this[_0x33e3('0xc')][_0x33e3('0xb9')](_0x1bbd5a[_0x33e3('0x63')]);if(_0x10cd68['result']===-0x1){return _0x10cd68;}}return this['channel'][_0x33e3('0xb8')]();};AGIVertices[_0x33e3('0xf')][_0x33e3('0x43')]=function(_0x2a1ade){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0xba'),_0x2a1ade[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0x2a1ade[_0x33e3('0xbb')])){return this[_0x33e3('0xc')]['error'](_0x2a1ade,_0x33e3('0xbc'));}_0x2a1ade[_0x33e3('0x44')]=moment();if(this[_0x33e3('0xa2')](_0x2a1ade['delay'])){_0x2a1ade[_0x33e3('0x44')]=moment()[_0x33e3('0xbd')](_0x2a1ade[_0x33e3('0xbe')],_0x33e3('0xbf'));}if(!this[_0x33e3('0xa2')](_0x2a1ade['callback_priority'])){_0x2a1ade[_0x33e3('0x46')]=0x2;}this[_0x33e3('0x3e')]['sync'](this,_0x2a1ade);return this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0xc0'),_0x2a1ade['phone'],_0x2a1ade[_0x33e3('0xbb')],_0x2a1ade[_0x33e3('0x44')]));};AGIVertices[_0x33e3('0xf')][_0x33e3('0xc1')]=function(_0xce29f2){logger['info'](util[_0x33e3('0x25')](_0x33e3('0xc2'),_0xce29f2['label']));var _0x2b2759=this['channel'][_0x33e3('0x51')](_0xce29f2[_0x33e3('0xc3')],_0xce29f2[_0x33e3('0x76')]);if(_0x2b2759['result']===-0x1){return _0x2b2759;}return this['channel'][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0xc4'),_0xce29f2[_0x33e3('0xc3')],_0xce29f2[_0x33e3('0x76')]));};AGIVertices[_0x33e3('0xf')][_0x33e3('0xc5')]=function(_0x3f3c86){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x3f3c86[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0x3f3c86[_0x33e3('0x57')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0xa8'));}var _0x500220='\x22'+_0x3f3c86[_0x33e3('0x57')]+'\x22';if(this[_0x33e3('0xa2')](_0x3f3c86[_0x33e3('0x76')])){_0x500220+=','+_0x3f3c86['options'];}var _0x201c6a=this['channel'][_0x33e3('0x51')]('MRCPSynth',_0x500220);if(_0x201c6a[_0x33e3('0xa0')]===-0x1){return _0x201c6a;}return this[_0x33e3('0xc')][_0x33e3('0xa7')](util['format'](_0x33e3('0xc6'),_0x500220));};AGIVertices[_0x33e3('0xf')][_0x33e3('0xc7')]=function(_0x260f07){logger['info'](util[_0x33e3('0x25')](_0x33e3('0xc8'),_0x260f07[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0x260f07[_0x33e3('0x57')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0xa8'));}var _0x36d230='\x22'+_0x260f07[_0x33e3('0x57')]+'\x22';if(this[_0x33e3('0xa2')](_0x260f07[_0x33e3('0x76')])){_0x36d230+=','+_0x260f07[_0x33e3('0x76')];}var _0x498726=this[_0x33e3('0xc')][_0x33e3('0x51')](_0x33e3('0xa9'),_0x36d230);if(_0x498726[_0x33e3('0xa0')]===-0x1){return _0x498726;}return this[_0x33e3('0xc')]['noop'](util['format'](_0x33e3('0xc6'),_0x36d230));};AGIVertices[_0x33e3('0xf')]['lumenvoxasr']=function(_0x17dec3){logger[_0x33e3('0x2a')](util['format'](_0x33e3('0xc9'),_0x17dec3[_0x33e3('0xac')]));if(!this['isConfigured'](_0x17dec3['grammar'])){return this[_0x33e3('0xc')][_0x33e3('0xa7')]('no\x20grammar\x20configured');}var _0x1d4128=_0x17dec3['grammar'];if(this[_0x33e3('0xa2')](_0x17dec3[_0x33e3('0x76')])){_0x1d4128+=','+_0x17dec3[_0x33e3('0x76')];}var _0x3d06de=this['channel'][_0x33e3('0x51')](_0x33e3('0xae'),_0x1d4128);if(_0x3d06de['result']===-0x1){return _0x3d06de;}var _0x29bcc8=this['getAndSetVariable'](_0x33e3('0xaf'),_0x33e3('0xca'));if(_0x29bcc8[_0x33e3('0xa0')]===-0x1){return _0x29bcc8;}var _0x223a80=this['getAndSetVariable']('RECOG_INPUT()',_0x33e3('0xcb'));if(_0x223a80[_0x33e3('0xa0')]===-0x1){return _0x223a80;}var _0x29a8b4=this[_0x33e3('0x9f')](_0x33e3('0xb2'),_0x33e3('0xcc'));if(_0x29a8b4[_0x33e3('0xa0')]===-0x1){return _0x29a8b4;}return this['channel'][_0x33e3('0xa7')](util['format'](_0x33e3('0xcd'),_0x1d4128));};AGIVertices[_0x33e3('0xf')]['sestekasr']=function(_0x5376bf){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x5376bf[_0x33e3('0xac')]));if(!this['isConfigured'](_0x5376bf[_0x33e3('0xad')])){return this['channel'][_0x33e3('0xa7')](_0x33e3('0xce'));}var _0x2e2d09=_0x5376bf['grammar'];if(this[_0x33e3('0xa2')](_0x5376bf[_0x33e3('0x76')])){_0x2e2d09+=','+_0x5376bf['options'];}var _0x4d71f4=this[_0x33e3('0xc')][_0x33e3('0x51')](_0x33e3('0xae'),_0x2e2d09);if(_0x4d71f4[_0x33e3('0xa0')]===-0x1){return _0x4d71f4;}var _0xf79cfa=this[_0x33e3('0x9f')](_0x33e3('0xaf'),_0x33e3('0xcf'));if(_0xf79cfa[_0x33e3('0xa0')]===-0x1){return _0xf79cfa;}var _0x1667fb=this['getAndSetVariable'](_0x33e3('0xb0'),'SESTEK_ASR_TRANSCRIPT');if(_0x1667fb[_0x33e3('0xa0')]===-0x1){return _0x1667fb;}var _0x16813e=this[_0x33e3('0x9f')](_0x33e3('0xb2'),_0x33e3('0xd0'));if(_0x16813e[_0x33e3('0xa0')]===-0x1){return _0x16813e;}return this['channel'][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0xcd'),_0x2e2d09));};AGIVertices[_0x33e3('0xf')][_0x33e3('0xd1')]=function(_0x40a252){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0xd2'),_0x40a252[_0x33e3('0xac')]));if(!this['isConfigured'](_0x40a252[_0x33e3('0xd3')])){return this['channel'][_0x33e3('0x28')](_0x40a252,_0x33e3('0xd4'));}var _0x4c2610=this[_0x33e3('0x15')][_0x33e3('0x6e')](this,_0x40a252[_0x33e3('0xd3')]);if(!_0x4c2610){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x40a252,_0x33e3('0xd5'));}if(!this[_0x33e3('0xa2')](_0x40a252[_0x33e3('0xd6')])){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x40a252,'no\x20query\x20configured');}var _0x3619ff=_0x40a252[_0x33e3('0xd6')][_0x33e3('0x53')](/(\r\n|\n|\r)/gm,'\x20');this[_0x33e3('0xc')][_0x33e3('0xa7')](util['format'](_0x33e3('0xd7'),_0x3619ff));var _0x5c34f3=this[_0x33e3('0x26')]['sync'](this,_0x4c2610,_0x3619ff);this['createSquareDetailsReport'][_0x33e3('0x6e')](this,_0x40a252,_0x3619ff);if(!this[_0x33e3('0xa2')](_0x40a252[_0x33e3('0xd8')])){return this[_0x33e3('0xc')]['noop'](_0x33e3('0xd9'));}var _0x48c02f=this['getVariable'][_0x33e3('0x6e')](this,_0x40a252[_0x33e3('0xd8')]);if(!_0x48c02f){return this['channel'][_0x33e3('0x28')](_0x40a252,_0x33e3('0xda'));}var _0x4d380f=this;_0x5c34f3[_0x33e3('0xdb')](function(_0x2df9a1,_0x23f8fb){Object[_0x33e3('0xdc')](_0x2df9a1)[_0x33e3('0xdb')](function(_0x276b45){_0x4d380f[_0x33e3('0xc')][_0x33e3('0x9b')](util['format'](_0x33e3('0xdd'),_0x48c02f,_0x23f8fb,_0x276b45),_0x2df9a1[_0x276b45]);});});this[_0x33e3('0xc')][_0x33e3('0x9b')](util['format']('%s_ROWS_COUNT',_0x48c02f),_0x5c34f3['length']);return this[_0x33e3('0xc')][_0x33e3('0xa7')](util['format'](_0x33e3('0xde'),_0x48c02f));};AGIVertices[_0x33e3('0xf')]['dial']=function(_0xdd5f3d){logger[_0x33e3('0xdf')](util[_0x33e3('0x25')](_0x33e3('0xe0'),_0xdd5f3d[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0xdd5f3d['sip_id'])){return this['channel'][_0x33e3('0x28')](_0xdd5f3d,_0x33e3('0xe1'));}var _0x4bd74d=this['getUser']['sync'](this,_0xdd5f3d[_0x33e3('0xe2')]);if(!_0x4bd74d){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0xdd5f3d,_0x33e3('0xe3'));}var _0x31bab9=this['channel'][_0x33e3('0x51')]('DIAL',[util[_0x33e3('0x25')](_0x33e3('0xe4'),_0x4bd74d),_0xdd5f3d[_0x33e3('0x63')],_0xdd5f3d[_0x33e3('0xe5')],_0xdd5f3d[_0x33e3('0x61')]]);if(_0x31bab9[_0x33e3('0xa0')]===-0x1){return _0x31bab9;}return this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0xe6'),_0x33e3('0xe7')));};AGIVertices[_0x33e3('0xf')][_0x33e3('0xe8')]=function(_0x603761){logger['info'](util[_0x33e3('0x25')](_0x33e3('0xe9'),_0x603761['label']));if(!this[_0x33e3('0xa2')](_0x603761[_0x33e3('0x7f')])){return this[_0x33e3('0xc')]['noop'](_0x33e3('0xea'));}if(!this[_0x33e3('0xa2')](_0x603761[_0x33e3('0x57')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')]('no\x20text\x20configured');}this['channel'][_0x33e3('0xeb')]=!![];this[_0x33e3('0x30')](_0x603761);this[_0x33e3('0x3d')](_0x603761[_0x33e3('0x57')],'in','','');this['channel']['noop'](util[_0x33e3('0x25')](_0x33e3('0xec'),_0x603761[_0x33e3('0x57')]));var _0x1f0000=this[_0x33e3('0xed')][_0x33e3('0x6e')](this,_0x603761);if(_0x1f0000){for(var _0x30fd54 in _0x1f0000){if(_0x1f0000[_0x33e3('0x91')](_0x30fd54)){this[_0x33e3('0xc')]['setVariable'](util[_0x33e3('0x25')]('DIALOGFLOW_%s',_0x30fd54[_0x33e3('0x68')]()),_0x1f0000[_0x30fd54]);}}this['createSquareMessage'](_0x1f0000[_0x33e3('0xee')],_0x33e3('0xef'),_0x33e3('0xe8'),'');return this[_0x33e3('0xc')]['noop'](util[_0x33e3('0x25')](_0x33e3('0xf0'),_0x1f0000[_0x33e3('0xee')]));}return this['channel'][_0x33e3('0x28')](_0x603761,_0x33e3('0xf1'));};AGIVertices['prototype'][_0x33e3('0xf2')]=function(_0x250357){logger[_0x33e3('0x2a')](util['format'](_0x33e3('0xf3'),_0x250357[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0x250357[_0x33e3('0x78')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0xf4'));}if(!this[_0x33e3('0xa2')](_0x250357[_0x33e3('0x79')])){return this[_0x33e3('0xc')]['noop'](_0x33e3('0xf5'));}if(!this[_0x33e3('0xa2')](_0x250357[_0x33e3('0x7a')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0xf6'));}if(!this[_0x33e3('0xa2')](_0x250357[_0x33e3('0xf7')])){return this['channel'][_0x33e3('0xa7')](_0x33e3('0xf8'));}if(!this[_0x33e3('0xa2')](_0x250357[_0x33e3('0x57')])){return this[_0x33e3('0xc')]['noop'](_0x33e3('0xa8'));}this['channel'][_0x33e3('0xeb')]=!![];this[_0x33e3('0x30')](_0x250357);this['createSquareMessage'](_0x250357[_0x33e3('0x57')],'in','','');this['channel'][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0xf9'),_0x250357[_0x33e3('0x57')]));var _0x4be6c5=this['googleDialogflowV2'][_0x33e3('0x6e')](this,_0x250357);if(_0x4be6c5){for(var _0x2ff1f6 in _0x4be6c5){if(_0x4be6c5[_0x33e3('0x91')](_0x2ff1f6)){if(_0x2ff1f6!=='providerResponse'){this[_0x33e3('0xc')][_0x33e3('0x9b')](util[_0x33e3('0x25')](_0x33e3('0xfa'),_0x2ff1f6[_0x33e3('0x68')]()),_0x4be6c5[_0x2ff1f6]);}}}this[_0x33e3('0x3d')](_0x4be6c5[_0x33e3('0xee')],_0x33e3('0xef'),_0x33e3('0xf2'),_0x4be6c5[_0x33e3('0xfb')]);return this['channel'][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0xfc'),_0x4be6c5[_0x33e3('0xee')]));}return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x250357,_0x33e3('0xfd'));};AGIVertices[_0x33e3('0xf')][_0x33e3('0xfe')]=function(_0x1fed95){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x1fed95['label']));if(!this['isConfigured'](_0x1fed95[_0x33e3('0xff')])){return this['channel']['noop'](_0x33e3('0x100'));}if(!this[_0x33e3('0xa2')](_0x1fed95['username'])){return this[_0x33e3('0xc')]['noop'](_0x33e3('0x101'));}if(!this[_0x33e3('0xa2')](_0x1fed95[_0x33e3('0x102')])){return this[_0x33e3('0xc')]['noop'](_0x33e3('0x103'));}if(!this['isConfigured'](_0x1fed95[_0x33e3('0x104')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')]('no\x20text\x20configured');}this[_0x33e3('0xc')][_0x33e3('0xeb')]=!![];this[_0x33e3('0x30')](_0x1fed95);this[_0x33e3('0x3d')](_0x1fed95[_0x33e3('0x57')],'in','','');this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0x105'),_0x1fed95['text']));var _0x7b8b6d=this[_0x33e3('0x7b')][_0x33e3('0x6e')](this,_0x1fed95);if(_0x7b8b6d){for(var _0x1613c9 in _0x7b8b6d){if(_0x7b8b6d['hasOwnProperty'](_0x1613c9)){this[_0x33e3('0xc')][_0x33e3('0x9b')](util['format'](_0x33e3('0x106'),_0x1613c9[_0x33e3('0x68')]()),_0x7b8b6d[_0x1613c9]);}}this['createSquareMessage'](_0x7b8b6d[_0x33e3('0xee')],'out',_0x33e3('0xfe'),'');if(_0x7b8b6d[_0x33e3('0x107')]){this['channel'][_0x33e3('0xa7')](util[_0x33e3('0x25')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x7b8b6d[_0x33e3('0x107')]));var _0xa8b0b4=this['channel']['streamFile'](_0x7b8b6d['audiofile']);try{fs[_0x33e3('0x108')](_0x7b8b6d[_0x33e3('0x107')]+_0x33e3('0x109'));}catch(_0x54828f){logger[_0x33e3('0x28')](_0x54828f);}return _0xa8b0b4;}else{return this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0x10a'),_0x7b8b6d['speech']));}}return this[_0x33e3('0xc')]['error'](_0x1fed95,_0x33e3('0x10b'));};AGIVertices['prototype'][_0x33e3('0x10c')]=function(_0x3858a1){logger[_0x33e3('0x2a')](util['format'](_0x33e3('0x10d'),_0x3858a1[_0x33e3('0xac')]));return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0x10c'));};AGIVertices[_0x33e3('0xf')][_0x33e3('0x10e')]=function(_0x102ecb){logger['info'](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x102ecb[_0x33e3('0xac')]));var _0x1708ad='';if(_0x102ecb['trunk_id']){if(!this[_0x33e3('0xa2')](_0x102ecb['trunk_id'])){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x102ecb,_0x33e3('0x10f'));}else{var _0x48ced6=parseInt(_0x102ecb[_0x33e3('0x110')],0xa);if(isNaN(_0x48ced6)){_0x1708ad=_0x102ecb['trunk_id'];}else{_0x1708ad=this[_0x33e3('0x18')][_0x33e3('0x6e')](this,_0x102ecb[_0x33e3('0x110')]);if(!_0x1708ad){return this['channel'][_0x33e3('0x28')](_0x102ecb,_0x33e3('0x111'));}}}}else if(_0x102ecb[_0x33e3('0x112')]){_0x1708ad=_0x102ecb[_0x33e3('0x112')];}else{return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x102ecb,_0x33e3('0x10f'));}var _0x91552b=this[_0x33e3('0xc')]['exec']('DIAL',[util['format'](_0x33e3('0x113'),_0x1708ad,_0x102ecb[_0x33e3('0x42')]),_0x102ecb[_0x33e3('0x63')],_0x102ecb[_0x33e3('0xe5')],_0x102ecb[_0x33e3('0x61')]]);if(_0x91552b[_0x33e3('0xa0')]===-0x1){return _0x91552b;}return this[_0x33e3('0xc')]['noop'](util[_0x33e3('0x25')](_0x33e3('0xe6'),'DIAL'));};AGIVertices[_0x33e3('0xf')][_0x33e3('0x114')]=function(_0x2b1f78){logger[_0x33e3('0x2a')](util['format'](_0x33e3('0x115'),_0x2b1f78[_0x33e3('0xac')]));return this['channel'][_0x33e3('0xa7')](_0x33e3('0x114'));};AGIVertices[_0x33e3('0xf')][_0x33e3('0xa')]=function(_0x3cf689){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x116'),_0x3cf689[_0x33e3('0xac')]));if(_0x3cf689['retry']===0x0){return this[_0x33e3('0xa3')](_0x3cf689);}_0x3cf689['retry']-=0x1;if(!this['isConfigured'](_0x3cf689[_0x33e3('0x117')])){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x3cf689,_0x33e3('0x118'));}var _0x2c03dc=this[_0x33e3('0x1a')][_0x33e3('0x6e')](this,_0x3cf689[_0x33e3('0x117')]);if(!_0x2c03dc){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x3cf689,'no\x20file\x20audio\x20found');}if(!this[_0x33e3('0xa2')](_0x3cf689[_0x33e3('0xd8')])){return this['channel']['error'](_0x33e3('0xd9'));}var _0xbd625a=this['channel'][_0x33e3('0x119')](_0x2c03dc,_0x3cf689['response'],_0x3cf689[_0x33e3('0x11a')]);var _0x1aed1a=_0xbd625a[_0x33e3('0xa0')]?_0xbd625a[_0x33e3('0xa0')][_0x33e3('0x45')]():'';logger[_0x33e3('0x2a')](_0x33e3('0x11b'),JSON[_0x33e3('0x71')](_0xbd625a));if(_0xbd625a[_0x33e3('0xa0')]===-0x1){this[_0x33e3('0x30')][_0x33e3('0x6e')](this,_0x3cf689,_0x1aed1a);return _0xbd625a;}else if(_0xbd625a[_0x33e3('0x9e')]==='timeout'){_0xbd625a[_0x33e3('0xa0')]=_0x1aed1a[_0x33e3('0x96')]>=parseInt(_0x3cf689[_0x33e3('0x11c')])?'x':'i';}else{_0xbd625a[_0x33e3('0xa0')]=_0x1aed1a[_0x33e3('0x96')]>=parseInt(_0x3cf689[_0x33e3('0x11c')])&&_0x1aed1a['length']<=parseInt(_0x3cf689['maxdigit'])?'x':'i';}var _0x351710=this['getVariable']['sync'](this,_0x3cf689[_0x33e3('0xd8')]);if(!_0x351710){return this[_0x33e3('0xc')]['error'](_0x3cf689,_0x33e3('0xda'));}this['channel'][_0x33e3('0x9b')](_0x351710,_0x1aed1a);if(this['isConfigured'](_0x3cf689[_0x33e3('0x11d')])){var _0x3dd91e=parseInt(_0x3cf689[_0x33e3('0x11d')],0xa);var _0x3e3116=rs['generate']({'charset':'*','length':_0x3dd91e});var _0x51e262=_0x1aed1a[_0x33e3('0x96')];if(_0x51e262>0x0){if(_0x51e262>_0x3dd91e){this['createSquareDetailsReport'][_0x33e3('0x6e')](this,_0x3cf689,_0x3cf689['hiddendigitspos']===_0x33e3('0x11e')?_0x3e3116+_0x1aed1a[_0x33e3('0x11f')](_0x3dd91e):_0x1aed1a[_0x33e3('0x11f')](0x0,_0x51e262-_0x3dd91e)+_0x3e3116);}else{this[_0x33e3('0x30')][_0x33e3('0x6e')](this,_0x3cf689,rs[_0x33e3('0x120')]({'charset':'*','length':_0x51e262}));}}else{this['createSquareDetailsReport']['sync'](this,_0x3cf689,'');}}else{this[_0x33e3('0x30')][_0x33e3('0x6e')](this,_0x3cf689,_0x1aed1a);}return _0xbd625a;};AGIVertices['prototype'][_0x33e3('0xb')]=function(_0x2711eb){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x121'),_0x2711eb['label']));return this[_0x33e3('0xa')](_0x2711eb);};AGIVertices[_0x33e3('0xf')][_0x33e3('0x122')]=function(_0x53b1cd){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x123'),_0x53b1cd['label']));this[_0x33e3('0x30')][_0x33e3('0x6e')](this,_0x53b1cd,_0x53b1cd[_0x33e3('0x124')]);return this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')]('GOAL\x20%s',_0x53b1cd[_0x33e3('0x124')]));};AGIVertices['prototype'][_0x33e3('0x125')]=function(_0x1f003e){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x1f003e['label']));if(!this[_0x33e3('0xa2')](_0x1f003e[_0x33e3('0x83')])||!this[_0x33e3('0xa2')](_0x1f003e[_0x33e3('0x84')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x33e3('0xa2')](_0x1f003e[_0x33e3('0x57')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0xa8'));}this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0x126'),_0x1f003e[_0x33e3('0x57')]));var _0x290f0b=this[_0x33e3('0x82')][_0x33e3('0x6e')](this,_0x1f003e);if(_0x290f0b){this[_0x33e3('0xc')][_0x33e3('0xa7')](util['format'](_0x33e3('0x127'),_0x290f0b));var _0x2cd8d5=this[_0x33e3('0xc')][_0x33e3('0x128')](_0x290f0b);try{fs['unlink'](_0x290f0b+'.wav');}catch(_0x16272f){logger[_0x33e3('0x28')](_0x16272f);}return _0x2cd8d5;}return this[_0x33e3('0xc')]['error'](_0x1f003e,_0x33e3('0x129'));};AGIVertices[_0x33e3('0xf')][_0x33e3('0x12a')]=function(_0x8cbe34){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x12b'),_0x8cbe34[_0x33e3('0xac')]));if(!this['isConfigured'](_0x8cbe34[_0x33e3('0x83')])||!this[_0x33e3('0xa2')](_0x8cbe34[_0x33e3('0x84')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0x12c'));}if(!this[_0x33e3('0xa2')](_0x8cbe34[_0x33e3('0x89')])){return this['channel'][_0x33e3('0xa7')](_0x33e3('0x12d'));}if(!this[_0x33e3('0xa2')](_0x8cbe34[_0x33e3('0x57')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0xa8'));}this[_0x33e3('0xc')][_0x33e3('0xeb')]=!![];this[_0x33e3('0x30')](_0x8cbe34);this[_0x33e3('0x3d')](_0x8cbe34['text'],'in','','');this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')]('Trying\x20Amazon\x20Lex:\x20%s',_0x8cbe34['text']));var _0x6b3025=this[_0x33e3('0x88')][_0x33e3('0x6e')](this,_0x8cbe34);if(_0x6b3025){for(var _0x1ef744 in _0x6b3025){if(_0x6b3025[_0x33e3('0x91')](_0x1ef744)&&_[_0x33e3('0x92')](_0x6b3025[_0x1ef744])){this[_0x33e3('0xc')][_0x33e3('0x9b')](util[_0x33e3('0x25')]('AWS_LEX_%s',_0x1ef744[_0x33e3('0x68')]()),_0x6b3025[_0x1ef744]);}}if(_[_0x33e3('0x40')](_0x6b3025[_0x33e3('0x74')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0x12e'));}else{this[_0x33e3('0x3d')](_0x6b3025[_0x33e3('0x74')],_0x33e3('0xef'),_0x33e3('0x12f'),'');return this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0x130'),_0x6b3025[_0x33e3('0x74')]));}}return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x8cbe34,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x33e3('0xf')][_0x33e3('0x131')]=function(_0x56e3e6){logger['info'](util[_0x33e3('0x25')](_0x33e3('0x132'),_0x56e3e6['label'],_0x56e3e6[_0x33e3('0x63')]));if(!this[_0x33e3('0xa2')](_0x56e3e6['key'])){return this[_0x33e3('0xc')]['noop'](_0x33e3('0xea'));}var _0x534280='wav';var _0x426d82=util['format'](_0x33e3('0x133'),FILES_PATH,rs[_0x33e3('0x120')](0x4));var _0x384c55=util[_0x33e3('0x25')](_0x33e3('0x99'),_0x426d82,_0x534280);var _0x3539e8=!![];if(_0x56e3e6[_0x33e3('0x134')]===_0x33e3('0x135')){_0x3539e8=![];}var _0x304767=this['channel']['recordFile'](_0x426d82,_0x534280,_0x56e3e6[_0x33e3('0x136')],_0x56e3e6[_0x33e3('0x63')],undefined,_0x3539e8);if(_0x304767[_0x33e3('0xa0')]!==-0x1){this[_0x33e3('0xc')]['noop'](util['format'](_0x33e3('0x137'),_0x384c55));var _0x1fe96d=this[_0x33e3('0x8a')][_0x33e3('0x6e')](this,_0x56e3e6,_0x384c55);if(_0x1fe96d){for(var _0x53ca0a in _0x1fe96d){if(_0x1fe96d[_0x33e3('0x91')](_0x53ca0a)){this[_0x33e3('0xc')][_0x33e3('0x9b')](util[_0x33e3('0x25')](_0x33e3('0x138'),_0x53ca0a[_0x33e3('0x68')]()),_0x1fe96d[_0x53ca0a]);}}return this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0x139'),JSON[_0x33e3('0x71')](_0x1fe96d)));}}return _0x304767;};AGIVertices[_0x33e3('0xf')]['tildeasr']=function(_0x56699b){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x13a'),_0x56699b[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0x56699b[_0x33e3('0x8d')])){return this['channel'][_0x33e3('0xa7')](_0x33e3('0x13b'));}if(!this[_0x33e3('0xa2')](_0x56699b[_0x33e3('0x8e')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0x13c'));}var _0x291118=_0x33e3('0x13d');var _0x50ca99=util['format'](_0x33e3('0x133'),FILES_PATH,rs[_0x33e3('0x120')](0x4));var _0x5d19c9=util[_0x33e3('0x25')](_0x33e3('0x99'),_0x50ca99,_0x291118);var _0x55c34c=!![];if(_0x56699b[_0x33e3('0x134')]===_0x33e3('0x135')){_0x55c34c=![];}var _0x2df0b5=this['channel'][_0x33e3('0x13e')](_0x50ca99,_0x291118,_0x56699b[_0x33e3('0x136')],_0x56699b[_0x33e3('0x63')],undefined,_0x55c34c);if(_0x2df0b5[_0x33e3('0xa0')]!==-0x1){this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')]('tilde\x20%s\x20file\x20created',_0x5d19c9));var _0x26db75=this[_0x33e3('0x8c')][_0x33e3('0x6e')](this,_0x56699b,_0x5d19c9);if(_0x26db75){for(var _0x173ee4 in _0x26db75){if(_0x26db75[_0x33e3('0x91')](_0x173ee4)){this['channel']['setVariable'](util[_0x33e3('0x25')]('TILDE_ASR_%s',_0x173ee4['toUpperCase']()),_0x26db75[_0x173ee4]);}}return this['channel'][_0x33e3('0xa7')](util['format']('TildeASR\x20Result\x20%s',JSON[_0x33e3('0x71')](_0x26db75)));}}return _0x2df0b5;};AGIVertices[_0x33e3('0xf')]['gotoc']=function(_0x351dcb){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x351dcb[_0x33e3('0xac')]));return this['channel'][_0x33e3('0x13f')](_0x351dcb[_0x33e3('0x37')],_0x351dcb[_0x33e3('0x38')],_0x351dcb[_0x33e3('0x39')]);};AGIVertices[_0x33e3('0xf')][_0x33e3('0x140')]=function(_0x1fc13d){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x141'),_0x1fc13d['label']));if(!this['isConfigured'](_0x1fc13d[_0x33e3('0x142')])){return this['channel'][_0x33e3('0x28')](_0x1fc13d,_0x33e3('0x143'));}try{var _0x2eb421=eval(_0x1fc13d[_0x33e3('0x142')])?_0x33e3('0x144'):_0x33e3('0x145');this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')]('EVAL\x20CONDITION\x20%s\x20%s',_0x1fc13d[_0x33e3('0x142')],_0x2eb421));return{'code':0xc8,'result':_0x2eb421};}catch(_0xe350db){return{'code':0xc8,'result':_0x33e3('0x145')};}};AGIVertices[_0x33e3('0xf')][_0x33e3('0x146')]=function(_0x539e57){logger['info'](util[_0x33e3('0x25')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x539e57[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0x539e57[_0x33e3('0x147')])){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x539e57,_0x33e3('0x148'));}var _0x4d32d1=this[_0x33e3('0x1f')][_0x33e3('0x6e')](this,_0x539e57[_0x33e3('0x147')]);if(!_0x4d32d1){return this['channel'][_0x33e3('0x28')](_0x539e57,_0x33e3('0x149'));}for(var _0x8d65b7=0x0;_0x8d65b7<_0x4d32d1[_0x33e3('0x96')];_0x8d65b7+=0x1){var _0x5dc199=this[_0x33e3('0xc')][_0x33e3('0x10')](util['format'](_0x33e3('0x14a'),_0x4d32d1[_0x8d65b7]));if(_0x5dc199['result']===-0x1){return _0x5dc199;}logger[_0x33e3('0x2a')](util[_0x33e3('0x25')]('IFTIME\x20%s\x20%s',_0x4d32d1[_0x8d65b7],_0x5dc199[_0x33e3('0x9e')]));if(_0x5dc199['extra']===_0x33e3('0x144')){logger['info'](util[_0x33e3('0x25')]('IFTIME\x20%s\x20%s',_0x4d32d1[_0x8d65b7],_0x33e3('0x144')));this[_0x33e3('0xc')]['noop'](util[_0x33e3('0x25')](_0x33e3('0x14b'),_0x4d32d1[_0x8d65b7],_0x33e3('0x144')));return{'code':0xc8,'result':'true'};}else{logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x14b'),_0x4d32d1[_0x8d65b7],_0x33e3('0x145')));this['channel'][_0x33e3('0xa7')](util['format']('IFTIME\x20%s\x20%s',_0x4d32d1[_0x8d65b7],'false'));}}return{'code':0xc8,'result':_0x33e3('0x145')};};AGIVertices[_0x33e3('0xf')][_0x33e3('0x14c')]=function(_0x511624){logger['info'](util['format'](_0x33e3('0x14d'),_0x511624[_0x33e3('0xac')]));return this[_0x33e3('0xc')][_0x33e3('0x14c')]();};AGIVertices['prototype']['ispeechasr']=function(_0xe21740){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x14e'),_0xe21740[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0xe21740[_0x33e3('0x7f')])){return this[_0x33e3('0xc')]['noop']('no\x20key\x20configured');}var _0x69f5ac=_0x33e3('0x13d');var _0x44a89c=util[_0x33e3('0x25')](_0x33e3('0x133'),FILES_PATH,rs[_0x33e3('0x120')](0x4));var _0x2f758b=util[_0x33e3('0x25')](_0x33e3('0x99'),_0x44a89c,_0x69f5ac);var _0x22f36c=!![];if(_0xe21740['beep']===_0x33e3('0x135')){_0x22f36c=![];}var _0xac5680=this[_0x33e3('0xc')]['recordFile'](_0x44a89c,_0x69f5ac,_0xe21740[_0x33e3('0x136')],_0xe21740[_0x33e3('0x63')],undefined,_0x22f36c);if(_0xac5680[_0x33e3('0xa0')]!==-0x1){this['channel'][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0x14f'),_0x2f758b));var _0x166548=this['ispeechASR'][_0x33e3('0x6e')](this,_0xe21740,_0x2f758b);if(_0x166548){for(var _0x1fa1ae in _0x166548){if(_0x166548['hasOwnProperty'](_0x1fa1ae)){this[_0x33e3('0xc')][_0x33e3('0x9b')](util['format'](_0x33e3('0x150'),_0x1fa1ae['toUpperCase']()),_0x166548[_0x1fa1ae]);}}return this['channel'][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0x151'),JSON[_0x33e3('0x71')](_0x166548)));}}return _0xac5680;};AGIVertices['prototype']['ispeechtts']=function(_0x421692){logger[_0x33e3('0x2a')](util['format'](_0x33e3('0x152'),_0x421692[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0x421692['key'])){return this[_0x33e3('0xc')]['noop'](_0x33e3('0xea'));}if(!this[_0x33e3('0xa2')](_0x421692[_0x33e3('0x57')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0xa8'));}this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0x153'),_0x421692['text']));var _0x33b26c=this[_0x33e3('0x7c')][_0x33e3('0x6e')](this,_0x421692);if(_0x33b26c){this[_0x33e3('0xc')]['noop'](util[_0x33e3('0x25')]('ispeech\x20%s\x20file\x20created',_0x33b26c));var _0x9bea49=this[_0x33e3('0xc')]['streamFile'](_0x33b26c,_0x421692['intKey']);try{fs['unlink'](_0x33b26c+_0x33e3('0x109'));}catch(_0x500080){logger[_0x33e3('0x28')](_0x500080);}return _0x9bea49;}return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x421692,_0x33e3('0x154'));};AGIVertices[_0x33e3('0xf')]['login']=function(_0x281d41){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x155'),_0x281d41[_0x33e3('0xac')]));if(!this['isConfigured'](_0x281d41[_0x33e3('0x156')])){return this['channel'][_0x33e3('0x28')](_0x281d41,_0x33e3('0x157'));}logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x158'),this[_0x33e3('0xc')][_0x33e3('0x33')],_0x281d41[_0x33e3('0x156')]));var _0x149a10=this[_0x33e3('0x4c')]['sync'](this,_0x281d41[_0x33e3('0x156')]);if(_0x149a10){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x159'),this[_0x33e3('0xc')][_0x33e3('0x33')],_0x281d41['findBy']));this[_0x33e3('0xc')]['noop'](util[_0x33e3('0x25')](_0x33e3('0x159'),this[_0x33e3('0xc')][_0x33e3('0x33')],_0x281d41['findBy']));return{'code':0xc8,'result':_0x33e3('0x15a')};}else{logger[_0x33e3('0x2a')](util['format'](_0x33e3('0x15b'),this[_0x33e3('0xc')][_0x33e3('0x33')],_0x281d41[_0x33e3('0x156')]));this[_0x33e3('0xc')][_0x33e3('0xa7')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x33e3('0xc')][_0x33e3('0x33')],_0x281d41[_0x33e3('0x156')]));return{'code':0xc8,'result':_0x33e3('0x15c')};}};AGIVertices[_0x33e3('0xf')][_0x33e3('0x15d')]=function(_0x23c0fa){logger[_0x33e3('0x2a')](util['format'](_0x33e3('0x15e'),_0x23c0fa[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0x23c0fa['findBy'])){return this[_0x33e3('0xc')]['error'](_0x23c0fa,_0x33e3('0x157'));}logger['info'](util[_0x33e3('0x25')](_0x33e3('0x158'),this[_0x33e3('0xc')]['callerid'],_0x23c0fa['findBy']));var _0x215535=this['agentLogout']['sync'](this,_0x23c0fa[_0x33e3('0x156')]);if(_0x215535){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x159'),this['channel']['callerid'],_0x23c0fa['findBy']));this[_0x33e3('0xc')]['noop'](util[_0x33e3('0x25')](_0x33e3('0x159'),this['channel']['callerid'],_0x23c0fa['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x33e3('0x2a')](util[_0x33e3('0x25')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x23c0fa[_0x33e3('0x156')]));this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x33e3('0x33')],_0x23c0fa['findBy']));return{'code':0xc8,'result':_0x33e3('0x15c')};}};AGIVertices[_0x33e3('0xf')]['math']=function(_0x28d0ec){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x28d0ec['label']));if(!this[_0x33e3('0xa2')](_0x28d0ec[_0x33e3('0x15f')])){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x28d0ec,_0x33e3('0x160'));}this['channel'][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0x161'),_0x28d0ec[_0x33e3('0x15f')]));var _0x59bbbe=eval(_0x28d0ec[_0x33e3('0x15f')]);if(!this[_0x33e3('0xa2')](_0x28d0ec['variable_id'])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0xd9'));}var _0x70b730=this[_0x33e3('0x10')]['sync'](this,_0x28d0ec[_0x33e3('0xd8')]);if(!_0x70b730){return this[_0x33e3('0xc')]['error'](_0x28d0ec,_0x33e3('0xda'));}if(_[_0x33e3('0x9a')](_0x59bbbe)){var _0x5129ac=this;_0x59bbbe[_0x33e3('0xdb')](function(_0x319e81,_0x38ef68){_0x5129ac[_0x33e3('0xc')][_0x33e3('0x9b')](util[_0x33e3('0x25')](_0x33e3('0x162'),_0x70b730,_0x38ef68),_0x319e81);});return this['channel'][_0x33e3('0xa7')](util['format'](_0x33e3('0x163'),_0x70b730));}else{return this[_0x33e3('0xc')][_0x33e3('0x9b')](_0x70b730,_0x59bbbe);}};AGIVertices[_0x33e3('0xf')][_0x33e3('0x9')]=function(_0x48385e){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x164'),_0x48385e[_0x33e3('0xac')]));if(_0x48385e[_0x33e3('0xa4')]===0x0){return this[_0x33e3('0xa3')](_0x48385e);}_0x48385e[_0x33e3('0xa4')]-=0x1;if(!this[_0x33e3('0xa2')](_0x48385e[_0x33e3('0x117')])){return this['channel']['error'](_0x48385e,_0x33e3('0x118'));}var _0x4cede5=this[_0x33e3('0x1a')]['sync'](this,_0x48385e[_0x33e3('0x117')]);if(!_0x4cede5){return this['channel'][_0x33e3('0x28')](_0x48385e,_0x33e3('0x165'));}var _0x27cb97=this['channel'][_0x33e3('0x119')](_0x4cede5,_0x48385e[_0x33e3('0x166')],_0x48385e['digit']);var _0xe3aaa0=_0x27cb97[_0x33e3('0xa0')];if(_0x27cb97['result']===-0x1){this[_0x33e3('0x30')][_0x33e3('0x6e')](this,_0x48385e,'-1');return _0x27cb97;}else if(_0x27cb97['extra']===_0x33e3('0x63')){_0x27cb97[_0x33e3('0xa0')]=_0x27cb97[_0x33e3('0xa0')]['length']>0x0?_0x27cb97[_0x33e3('0xa0')]:'t';}else if(_[_0x33e3('0x3f')](_0x27cb97[_0x33e3('0xa0')])){_0x27cb97['result']='#';_0xe3aaa0='#';}if(!this[_0x33e3('0xa2')](_0x48385e[_0x33e3('0xd8')])){this['channel'][_0x33e3('0xa7')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x3b29a1=this[_0x33e3('0x10')][_0x33e3('0x6e')](this,_0x48385e[_0x33e3('0xd8')]);if(!_0x3b29a1){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x48385e,_0x33e3('0xda'));}this[_0x33e3('0xc')][_0x33e3('0x9b')](_0x3b29a1,_0xe3aaa0);}this[_0x33e3('0x30')][_0x33e3('0x6e')](this,_0x48385e,_0xe3aaa0);return _0x27cb97;};AGIVertices['prototype'][_0x33e3('0xa7')]=function(_0x2d7fa4){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x167'),_0x2d7fa4[_0x33e3('0xac')]));return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x2d7fa4['output']||_0x2d7fa4[_0x33e3('0xac')]);};AGIVertices[_0x33e3('0xf')][_0x33e3('0x168')]=function(_0x14a260){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x169'),_0x14a260[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0x14a260[_0x33e3('0x156')])){return this['channel']['error'](_0x14a260,_0x33e3('0x157'));}logger[_0x33e3('0x2a')](util['format'](_0x33e3('0x158'),this[_0x33e3('0xc')]['callerid'],_0x14a260['findBy']));var _0x3e48e7=this[_0x33e3('0x16a')][_0x33e3('0x6e')](this,_0x14a260[_0x33e3('0x16b')]);var _0x107b78=this[_0x33e3('0x48')][_0x33e3('0x6e')](this,_0x14a260[_0x33e3('0x156')],_0x3e48e7);if(_0x107b78){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x159'),this[_0x33e3('0xc')][_0x33e3('0x33')],_0x14a260[_0x33e3('0x156')]));this['channel'][_0x33e3('0xa7')](util[_0x33e3('0x25')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x33e3('0xc')][_0x33e3('0x33')],_0x14a260['findBy']));return{'code':0xc8,'result':_0x33e3('0x15a')};}else{logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x15b'),this[_0x33e3('0xc')][_0x33e3('0x33')],_0x14a260[_0x33e3('0x156')]));this['channel']['noop'](util['format'](_0x33e3('0x159'),this[_0x33e3('0xc')]['callerid'],_0x14a260[_0x33e3('0x156')]));return{'code':0xc8,'result':_0x33e3('0x15c')};}};AGIVertices[_0x33e3('0xf')][_0x33e3('0x16c')]=function(_0xee5cfe){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x16d'),_0xee5cfe[_0x33e3('0xac')]));if(!this['isConfigured'](_0xee5cfe['file_id'])){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0xee5cfe,'no\x20file\x20audio\x20selected');}var _0x2b2df2=this[_0x33e3('0x1a')]['sync'](this,_0xee5cfe[_0x33e3('0x117')]);if(!_0x2b2df2){return this[_0x33e3('0xc')]['error'](_0xee5cfe,'no\x20file\x20audio\x20found');}var _0x1e7773=this['channel']['exec'](_0x33e3('0x16e'),[_0x2b2df2,_0xee5cfe['opts']]);if(_0x1e7773[_0x33e3('0xa0')]===-0x1){return _0x1e7773;}return this['channel']['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0x33e3('0x16e'),_0x2b2df2));};AGIVertices[_0x33e3('0xf')][_0x33e3('0x16f')]=function(_0x5f1e7b){logger['info'](util['format'](_0x33e3('0x170'),_0x5f1e7b['label']));if(!this['isConfigured'](_0x5f1e7b['queue_id'])){return this['channel'][_0x33e3('0x28')](_0x5f1e7b,'no\x20queue\x20selected');}var _0x474110='';var _0x8d176e=parseInt(_0x5f1e7b[_0x33e3('0x171')],0xa);if(isNaN(_0x8d176e)){_0x474110=_0x5f1e7b[_0x33e3('0x171')];}else{_0x474110=this[_0x33e3('0x172')]['sync'](this,_0x5f1e7b[_0x33e3('0x171')]);if(!_0x474110){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x5f1e7b,_0x33e3('0x173'));}}var _0x201b1f='';if(this[_0x33e3('0xa2')](_0x5f1e7b[_0x33e3('0x117')])){var _0x44ae65=this[_0x33e3('0x1a')][_0x33e3('0x6e')](this,_0x5f1e7b['file_id']);if(_0x44ae65){_0x201b1f=_0x44ae65;}}this[_0x33e3('0x30')][_0x33e3('0x6e')](this,_0x5f1e7b,_0x474110);if(_0x5f1e7b['opts'][_0x33e3('0x174')]('x')<0x0){_0x5f1e7b[_0x33e3('0xe5')]+='x';}if(_0x5f1e7b[_0x33e3('0xe5')][_0x33e3('0x174')]('X')<0x0){_0x5f1e7b[_0x33e3('0xe5')]+='X';}this[_0x33e3('0xc')][_0x33e3('0x9b')](_0x33e3('0x175'),_0x474110?_0x474110[_0x33e3('0x176')]():'');var _0x324b64=this[_0x33e3('0xc')][_0x33e3('0x51')](_0x33e3('0x177'),[_0x474110,_0x5f1e7b[_0x33e3('0xe5')],_0x5f1e7b[_0x33e3('0x61')],_0x201b1f,_0x5f1e7b[_0x33e3('0x63')],_0x5f1e7b[_0x33e3('0xb4')],_0x5f1e7b[_0x33e3('0x178')],_0x5f1e7b[_0x33e3('0x179')],'',_0x5f1e7b[_0x33e3('0x17a')]]);if(_0x324b64[_0x33e3('0xa0')]===-0x1){return _0x324b64;}return this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0xc4'),_0x33e3('0x177'),_0x474110));};AGIVertices[_0x33e3('0xf')][_0x33e3('0x17b')]=function(_0xb1e20){logger['info'](util[_0x33e3('0x25')](_0x33e3('0x17c'),_0xb1e20[_0x33e3('0xac')]));var _0x2c8563=_0xb1e20[_0x33e3('0x17d')]||_0x33e3('0x13d');var _0x3bb694=util[_0x33e3('0x25')]('%s_%s',this[_0x33e3('0xc')][_0x33e3('0x35')],rs['generate'](0x5));var _0x581eba=util['format'](_0x33e3('0x17e'),FILES_PATH,_0x3bb694,_0x2c8563);var _0xffa843=util['format'](_0x33e3('0x133'),FILES_PATH,_0x3bb694);this[_0x33e3('0x34')][_0x33e3('0x6e')](this,_0xb1e20,_0x3bb694,_0x581eba);this[_0x33e3('0xc')][_0x33e3('0x9b')]('RECORDING_SAVENAME',_0x3bb694);logger['info']('Recording\x20%s\x20%s\x20%s\x20%s',_0xffa843,_0x2c8563,_0xb1e20[_0x33e3('0x17f')],_0xb1e20[_0x33e3('0x63')]);return this[_0x33e3('0xc')][_0x33e3('0x13e')](_0xffa843,_0x2c8563,_0xb1e20[_0x33e3('0x17f')],_0xb1e20[_0x33e3('0x63')],undefined,!![]);};AGIVertices[_0x33e3('0xf')]['restapi']=function(_0x48ed54){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x180'),_0x48ed54['label']));if(!this[_0x33e3('0xa2')](_0x48ed54[_0x33e3('0x61')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')]('no\x20url\x20configured');}var _0x57c429=this[_0x33e3('0x60')][_0x33e3('0x6e')](this,_0x48ed54);logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x181'),util[_0x33e3('0x182')](_0x57c429,{'showHidden':![],'depth':null})));if(!this[_0x33e3('0xa2')](_0x48ed54[_0x33e3('0xd8')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0x183'));}var _0x46efb2=this['getVariable'][_0x33e3('0x6e')](this,_0x48ed54['variable_id']);if(!_0x46efb2){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x48ed54,'no\x20variable\x20found');}this['channel']['setVariable'](util[_0x33e3('0x25')](_0x33e3('0x184'),_0x46efb2),_0x57c429[_0x33e3('0x72')]?_0x57c429[_0x33e3('0x72')]:_0x33e3('0x185'));this[_0x33e3('0xc')][_0x33e3('0x9b')](util[_0x33e3('0x25')](_0x33e3('0x186'),_0x46efb2),_0x57c429[_0x33e3('0x73')]?_0x57c429[_0x33e3('0x73')]:'OK');if(_0x57c429[_0x33e3('0x69')]){try{this[_0x33e3('0x98')](_0x57c429[_0x33e3('0x69')],_0x46efb2);}catch(_0x3a672a){logger[_0x33e3('0x28')](util['format']('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x46efb2));}}return this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0xde'),_0x46efb2));};AGIVertices[_0x33e3('0xf')][_0x33e3('0x187')]=function(_0x22d79d){logger['info'](util[_0x33e3('0x25')](_0x33e3('0x188'),_0x22d79d[_0x33e3('0xac')]));return this[_0x33e3('0xc')][_0x33e3('0x189')](_0x22d79d[_0x33e3('0x18a')][_0x33e3('0x53')](/\s+/g,''),_0x22d79d[_0x33e3('0x17f')]);};AGIVertices[_0x33e3('0xf')][_0x33e3('0x18b')]=function(_0x226a93){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x18c'),_0x226a93[_0x33e3('0xac')]));return this[_0x33e3('0xc')][_0x33e3('0x18d')](_0x226a93[_0x33e3('0x64')][_0x33e3('0x53')](/\s+/g,''),_0x226a93[_0x33e3('0x17f')]);};AGIVertices[_0x33e3('0xf')][_0x33e3('0x18e')]=function(_0x573060){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x18f'),_0x573060[_0x33e3('0xac')]));return this['channel'][_0x33e3('0x190')](_0x573060[_0x33e3('0x57')],_0x573060['escape_digits']);};AGIVertices[_0x33e3('0xf')][_0x33e3('0x191')]=function(_0x86ac68){logger[_0x33e3('0x2a')](util['format']('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x86ac68[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0x86ac68[_0x33e3('0x192')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0x193'));}var _0x46b9ed=this[_0x33e3('0x1c')][_0x33e3('0x6e')](this,_0x86ac68[_0x33e3('0x192')]);if(!_0x46b9ed||!_0x46b9ed[_0x33e3('0x194')]){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x86ac68,_0x33e3('0x195'));}var _0x61c54d={'from':util[_0x33e3('0x25')](_0x33e3('0x196'),_0x46b9ed[_0x33e3('0x12')],_0x46b9ed[_0x33e3('0x197')]||_0x46b9ed['Smtp'][_0x33e3('0x198')]),'to':_0x86ac68['to']||'','cc':_0x86ac68['cc']||'','bcc':_0x86ac68[_0x33e3('0x199')]||'','subject':_0x86ac68['subject'],'html':_0x86ac68[_0x33e3('0x57')],'text':_0x86ac68['text']};var _0x5de621={'tls':{'rejectUnauthorized':![]}};if(_0x46b9ed[_0x33e3('0x194')][_0x33e3('0x19a')]){_0x5de621[_0x33e3('0x19a')]=_0x46b9ed[_0x33e3('0x194')][_0x33e3('0x19a')];}else{_0x5de621[_0x33e3('0x19b')]=_0x46b9ed[_0x33e3('0x194')]['host'];_0x5de621[_0x33e3('0x19c')]=_0x46b9ed[_0x33e3('0x194')]['port'];_0x5de621[_0x33e3('0x19d')]=_0x46b9ed[_0x33e3('0x194')][_0x33e3('0x19d')];}if(_0x46b9ed[_0x33e3('0x194')][_0x33e3('0x19e')]){_0x5de621[_0x33e3('0x19f')]={'user':_0x46b9ed[_0x33e3('0x194')][_0x33e3('0x198')],'pass':_0x46b9ed['Smtp'][_0x33e3('0x1a0')]};}if(this[_0x33e3('0xa2')](_0x86ac68[_0x33e3('0x1a1')])){}logger['debug'](_0x33e3('0x1a2'),JSON[_0x33e3('0x71')](_0x61c54d));this['createSquareDetailsReport'][_0x33e3('0x6e')](this,_0x86ac68,_0x86ac68[_0x33e3('0x192')]);this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0x1a3'),_0x46b9ed[_0x33e3('0x12')]));this['sendMailMessage'][_0x33e3('0x6e')](this,_0x5de621,_0x61c54d);return this['channel'][_0x33e3('0xa7')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0x33e3('0x1a4')]=function(_0x330954){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x1a5'),_0x330954['label']));return this[_0x33e3('0xc')]['noop']('SENDFAX\x20block\x20not\x20implemented');};AGIVertices['prototype']['sendSMS']=function(_0x2b8b42){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x1a6'),_0x2b8b42[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0x2b8b42[_0x33e3('0x1a7')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0x1a8'));}var _0x4510a9=this[_0x33e3('0x1a9')][_0x33e3('0x6e')](this,_0x2b8b42[_0x33e3('0x1a7')]);if(!_0x4510a9){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x2b8b42,_0x33e3('0x1aa'));}var _0x4f879f={'body':_0x2b8b42['sms_text'],'phone':_0x2b8b42['to']||'','SmsAccountId':_0x4510a9['id']};logger[_0x33e3('0xdf')]('sendSMS\x20message',JSON[_0x33e3('0x71')](_0x4f879f));this[_0x33e3('0x30')][_0x33e3('0x6e')](this,_0x2b8b42,_0x2b8b42[_0x33e3('0x1a7')]);this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0x1ab'),_0x4510a9['name']));this[_0x33e3('0x2f')][_0x33e3('0x6e')](this,_0x4f879f);return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0x1ac'));};AGIVertices['prototype'][_0x33e3('0x1ad')]=function(_0x673481){logger['info'](util[_0x33e3('0x25')](_0x33e3('0x1ae'),_0x673481[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0x673481[_0x33e3('0xd8')])){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x673481,'no\x20variable\x20selected');}var _0x2a8da3=this[_0x33e3('0x10')]['sync'](this,_0x673481[_0x33e3('0xd8')]);if(!_0x2a8da3){return this['channel'][_0x33e3('0x28')](_0x673481,_0x33e3('0xda'));}return this[_0x33e3('0xc')][_0x33e3('0x9b')](_0x2a8da3,_0x673481['variable_value']);};AGIVertices[_0x33e3('0xf')][_0x33e3('0x1af')]=function(_0x552755){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x1b0'),_0x552755[_0x33e3('0xac')]));this[_0x33e3('0xc')]['noop'](_0x33e3('0x1b1'));if(_0x552755[_0x33e3('0xb8')]===_0x33e3('0x1b2')){this[_0x33e3('0xc')][_0x33e3('0xa7')]('Answer');return this[_0x33e3('0xc')][_0x33e3('0xb8')]();}return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0x1b3'));};AGIVertices[_0x33e3('0xf')][_0x33e3('0x1b4')]=function(_0x14fba9){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x1b5'),_0x14fba9[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0x14fba9['project_id'])){return this['channel'][_0x33e3('0x28')](_0x14fba9,'no\x20subproject\x20selected');}var _0x155490=this[_0x33e3('0x1b6')]['sync'](this,_0x14fba9['project_id']);if(!this[_0x33e3('0xa2')](_0x155490)){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x14fba9,util[_0x33e3('0x25')](_0x33e3('0x1b7'),_0x14fba9[_0x33e3('0x1b8')]));}if(_0x155490===this[_0x33e3('0xc')][_0x33e3('0x32')]){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x14fba9,_0x33e3('0x1b9'));}this[_0x33e3('0x30')][_0x33e3('0x6e')](this,_0x14fba9,_0x155490);var _0x1a50bb=this[_0x33e3('0xc')][_0x33e3('0x51')]('AGI',util[_0x33e3('0x25')](_0x33e3('0x1ba'),config[_0x33e3('0xb4')][_0x33e3('0x19b')]||_0x33e3('0x1bb'),_0x155490,this[_0x33e3('0xc')]['arg_1']));if(_0x1a50bb[_0x33e3('0xa0')]===-0x1){return _0x1a50bb;}return this[_0x33e3('0xc')]['noop'](util[_0x33e3('0x25')](_0x33e3('0xc4'),_0x33e3('0x1bc'),_0x155490));};AGIVertices[_0x33e3('0xf')]['system']=function(_0x535678){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x1bd'),_0x535678[_0x33e3('0xac')]));var _0x4b85c2=this[_0x33e3('0x50')]['sync'](this,_0x535678[_0x33e3('0xb6')]);this[_0x33e3('0x30')]['sync'](this,_0x535678,_0x535678['command']);if(this[_0x33e3('0xa2')](_0x535678[_0x33e3('0xd8')])){var _0x28fb91=this['getVariable'][_0x33e3('0x6e')](this,_0x535678[_0x33e3('0xd8')]);if(_0x28fb91){this[_0x33e3('0xc')][_0x33e3('0x9b')](_0x28fb91,_0x4b85c2);return this['channel'][_0x33e3('0xa7')](util['format'](_0x33e3('0x1be'),_0x535678[_0x33e3('0xb6')],_0x28fb91));}}return this['channel'][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0x1bf'),_0x535678[_0x33e3('0xb6')]));};AGIVertices['prototype']['google_cloud_tts']=function(_0x18d4a9){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x1c0'),_0x18d4a9[_0x33e3('0xac')]));_0x18d4a9[_0x33e3('0x57')]=_0x18d4a9['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x18d4a9['apiKey'])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0x1c1'));}if(!this[_0x33e3('0xa2')](_0x18d4a9[_0x33e3('0x57')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')]('no\x20text\x20configured');}this['channel'][_0x33e3('0xa7')](util['format'](_0x33e3('0x1c2'),_0x18d4a9[_0x33e3('0x57')]));var _0x138dc1=this[_0x33e3('0x54')]['sync'](this,_0x18d4a9);if(_0x138dc1){this['channel'][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0x1c3'),_0x138dc1));var _0x22ae25=this[_0x33e3('0xc')]['streamFile'](_0x138dc1);try{fs[_0x33e3('0x108')](_0x138dc1+_0x33e3('0x109'));}catch(_0x16336e){logger[_0x33e3('0x28')](_0x16336e);}return _0x22ae25;}return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x18d4a9,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x33e3('0xf')][_0x33e3('0x1c4')]=function(_0x12aca9){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x1c5'),_0x12aca9[_0x33e3('0xac')]));_0x12aca9[_0x33e3('0x57')]=_0x12aca9[_0x33e3('0x57')][_0x33e3('0x53')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x33e3('0xa2')](_0x12aca9['text'])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0xa8'));}this['channel'][_0x33e3('0xa7')](util['format'](_0x33e3('0x1c6'),_0x12aca9[_0x33e3('0x57')]));var _0x52c0bc=this['googleTTS']['sync'](this,_0x12aca9);if(_0x52c0bc){this['channel'][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0x1c7'),_0x52c0bc));var _0x476b1a=this['channel']['streamFile'](_0x52c0bc);try{fs[_0x33e3('0x108')](_0x52c0bc+_0x33e3('0x109'));}catch(_0x2786f6){logger[_0x33e3('0x28')](_0x2786f6);}return _0x476b1a;}return this['channel'][_0x33e3('0x28')](_0x12aca9,_0x33e3('0x1c8'));};AGIVertices[_0x33e3('0xf')][_0x33e3('0x1c9')]=function(_0x317d12){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x1ca'),_0x317d12[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0x317d12[_0x33e3('0x156')])){return this['channel'][_0x33e3('0x28')](_0x317d12,_0x33e3('0x157'));}logger[_0x33e3('0x2a')](util['format'](_0x33e3('0x158'),this[_0x33e3('0xc')][_0x33e3('0x33')],_0x317d12[_0x33e3('0x156')]));var _0x29e9ab=this[_0x33e3('0x4a')][_0x33e3('0x6e')](this,_0x317d12[_0x33e3('0x156')]);if(_0x29e9ab){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x33e3('0xc')][_0x33e3('0x33')],_0x317d12['findBy']));this[_0x33e3('0xc')]['noop'](util[_0x33e3('0x25')](_0x33e3('0x159'),this['channel'][_0x33e3('0x33')],_0x317d12[_0x33e3('0x156')]));return{'code':0xc8,'result':_0x33e3('0x15a')};}else{logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x15b'),this[_0x33e3('0xc')][_0x33e3('0x33')],_0x317d12['findBy']));this[_0x33e3('0xc')]['noop'](util[_0x33e3('0x25')](_0x33e3('0x15b'),this[_0x33e3('0xc')]['callerid'],_0x317d12[_0x33e3('0x156')]));return{'code':0xc8,'result':_0x33e3('0x15c')};}};AGIVertices[_0x33e3('0xf')]['voicemail']=function(_0x57b10e){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x57b10e['label']));var _0x41ef36=this[_0x33e3('0xc')][_0x33e3('0x51')](_0x33e3('0x1cb'),[_0x57b10e[_0x33e3('0x1cc')],_0x57b10e[_0x33e3('0x76')]]);if(_0x41ef36[_0x33e3('0xa0')]===-0x1){return _0x41ef36;}return this[_0x33e3('0xc')]['noop'](util[_0x33e3('0x25')](_0x33e3('0xc4'),_0x33e3('0x1cb'),_0x57b10e[_0x33e3('0x1cc')]));};AGIVertices[_0x33e3('0xf')]['vswitch']=function(_0x35a3fb){logger['info'](util[_0x33e3('0x25')](_0x33e3('0x1cd'),_0x35a3fb[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0x35a3fb['variable_id'])){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x35a3fb,_0x33e3('0x1ce'));}var _0x516783=this[_0x33e3('0x10')][_0x33e3('0x6e')](this,_0x35a3fb[_0x33e3('0xd8')]);if(!_0x516783){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x35a3fb,'no\x20variable\x20found');}var _0x16bc99=this[_0x33e3('0xc')][_0x33e3('0x10')](_0x516783);return{'code':0xc8,'result':_0x16bc99[_0x33e3('0x9e')]?_0x16bc99[_0x33e3('0x9e')]:'-'};};String[_0x33e3('0xf')]['replaceAll']=function(_0x253520,_0x46bc77){return this[_0x33e3('0x9c')](_0x253520)['join'](_0x46bc77);};module['exports']=AGIVertices;
\ No newline at end of file
+var _0x20c9=['google_tts_language','restAPI','url','method','number','timeout','includes','POST','PUT','toUpperCase','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','body','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','en-US','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','isString','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isArray','saveRestApiResult','isPlainObject','%s.%s','length','setVariable','replaceObjectAllVariables','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','noop','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','grammar','no\x20grammar\x20configured','isConfigured','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','callback','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','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_INSTANCE','odbc_id','no\x20query\x20configured','replace','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','Dialogflow\x20Result\x20%s','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','private_key','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','speech','out','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','unlink','.wav','SestekNDA\x20is\x20unreachable','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','getSound','no\x20file\x20audio\x20found','response','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','GoogleASR\x20Result\x20%s','tildeasr','no\x20appid\x20configured','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','gotoif','condition','no\x20condition\x20configured','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','false','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','streamFile','intKey','login','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','success','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','no\x20find\x20by\x20configured','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','opts','queue_id','no\x20queue\x20selected','XMCS-QUEUE','QUEUE','macro','gosub','position','record','recordingFormat','%s_%s','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','saynumber','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','getMailAccount','Smtp','no\x20mail\x20account\x20found','email','user','bcc','subject','service','host','port','secure','auth','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','sendSMS','sms_account_id','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','Enter\x20in\x20START\x20(%s)\x20block','yes','Answer','Skipped\x20Answer','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','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20is\x20unreachable','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','join','exports','path','lodash','shelljs','randomstring','moment','mustache','request-promise','../../config/logger','agi','./scripts','/var/opt/motion2/server/files','rawBody','menu','getsecretdigits','rpc','mailRpc','prototype','getVariable','then','getVoiceQueue','getVoiceQueueById','name','getSquareProject','catch','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getSoundById','getSoundPath','save_name','getMailAccountById','sendMailMessage','getIntervals','IntervalId','interval','format','%s/sounds/converted/%s','getQueryOdbc','open','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','close','error','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','uniqueid','createCmContact','isEmpty','isNil','callback_','lastName','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','agent','agentPause','agentUnpause','agentLogout','agentLogin','%s/%s@from-sip/n','LOCAL','shellCommand','exec','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','MALE','audioEncoding','googleTTS'];(function(_0x83a0fe,_0x3640a8){var _0x4ef020=function(_0x41fb1b){while(--_0x41fb1b){_0x83a0fe['push'](_0x83a0fe['shift']());}};_0x4ef020(++_0x3640a8);}(_0x20c9,0x163));var _0x920c=function(_0x381379,_0x3f3b86){_0x381379=_0x381379-0x0;var _0x3e1063=_0x20c9[_0x381379];return _0x3e1063;};'use strict';var fs=require('fs');var path=require(_0x920c('0x0'));var util=require('util');var _=require(_0x920c('0x1'));var sh=require(_0x920c('0x2'));var odbc=require('odbc')();var rs=require(_0x920c('0x3'));var moment=require(_0x920c('0x4'));var Mustache=require(_0x920c('0x5'));var rp=require(_0x920c('0x6'));var logger=require(_0x920c('0x7'))(_0x920c('0x8'));var config=require('../../config/environment');var scripts=require(_0x920c('0x9'));var FILES_PATH=_0x920c('0xa');var recursiveMapAttributes=['rawHeaders',_0x920c('0xb')];var verticesWithRetry=[_0x920c('0xc'),'getdigits',_0x920c('0xd')];var AGIVertices=function(_0xf5cc61,_0x3d8629,_0x4dc4d7){this['channel']=_0xf5cc61;this[_0x920c('0xe')]=_0x3d8629;this[_0x920c('0xf')]=_0x4dc4d7;};AGIVertices[_0x920c('0x10')][_0x920c('0x11')]=function(_0x452f43,_0x4d71fb){this['rpc']['getVariableById'](_0x452f43)[_0x920c('0x12')](function(_0x54185f){_0x4d71fb(null,_0x54185f?_0x54185f['name']:![]);})['catch'](function(_0xcd93f9){_0x4d71fb(_0xcd93f9);});};AGIVertices[_0x920c('0x10')][_0x920c('0x13')]=function(_0x57de9f,_0x2f45e8){this['rpc'][_0x920c('0x14')](_0x57de9f)['then'](function(_0x466691){_0x2f45e8(null,_0x466691?_0x466691[_0x920c('0x15')]:![]);})['catch'](function(_0x5588ad){_0x2f45e8(_0x5588ad);});};AGIVertices[_0x920c('0x10')][_0x920c('0x16')]=function(_0x164082,_0x12043a){this[_0x920c('0xe')]['getSquareProjectById'](_0x164082)[_0x920c('0x12')](function(_0x29e512){_0x12043a(null,_0x29e512?_0x29e512[_0x920c('0x15')]:![]);})[_0x920c('0x17')](function(_0x46b3e0){_0x12043a(_0x46b3e0);});};AGIVertices[_0x920c('0x10')][_0x920c('0x18')]=function(_0x31d76c,_0x4ef71c){this['rpc'][_0x920c('0x19')](_0x31d76c)[_0x920c('0x12')](function(_0x45c01a){_0x4ef71c(null,_0x45c01a?_0x45c01a[_0x920c('0x1a')]:![]);})[_0x920c('0x17')](function(_0x27e9ec){_0x4ef71c(_0x27e9ec);});};AGIVertices[_0x920c('0x10')][_0x920c('0x1b')]=function(_0x563d42,_0x99fa34){this['rpc'][_0x920c('0x1c')](_0x563d42)[_0x920c('0x12')](function(_0x55f088){_0x99fa34(null,_0x55f088?_0x55f088[_0x920c('0x15')]:![]);})['catch'](function(_0xf23862){_0x99fa34(_0xf23862);});};AGIVertices['prototype'][_0x920c('0x1d')]=function(_0x282a67,_0x2e9683){this[_0x920c('0xe')]['getTrunkById'](_0x282a67)[_0x920c('0x12')](function(_0x274aac){_0x2e9683(null,_0x274aac?_0x274aac[_0x920c('0x15')]:![]);})['catch'](function(_0x57af2a){_0x2e9683(_0x57af2a);});};AGIVertices[_0x920c('0x10')]['getSound']=function(_0x25dfb9,_0x17246c){var _0x2b1e87=this;this[_0x920c('0xe')][_0x920c('0x1e')](_0x25dfb9)[_0x920c('0x12')](function(_0x12277f){_0x17246c(null,_0x12277f?_0x2b1e87[_0x920c('0x1f')](_0x12277f[_0x920c('0x20')]):![]);})[_0x920c('0x17')](function(_0x46c05b){_0x17246c(_0x46c05b);});};AGIVertices[_0x920c('0x10')]['getMailAccount']=function(_0x251794,_0x40ed64){this['rpc'][_0x920c('0x21')](_0x251794)[_0x920c('0x12')](function(_0x9e6615){_0x40ed64(null,_0x9e6615?_0x9e6615:![]);})[_0x920c('0x17')](function(_0x20dfe2){_0x40ed64(_0x20dfe2);});};AGIVertices[_0x920c('0x10')][_0x920c('0x22')]=function(_0x10d723,_0x1daf45,_0x407d13){this[_0x920c('0xf')]['sendMailMessage'](_0x10d723,_0x1daf45)['then'](function(){_0x407d13(null);})['catch'](function(_0x1c56ac){_0x407d13(_0x1c56ac);});};AGIVertices[_0x920c('0x10')][_0x920c('0x23')]=function(_0x530eb0,_0x1d871e){this['rpc']['getIntervalById'](_0x530eb0)[_0x920c('0x12')](function(_0xecdc0a){if(_0xecdc0a){if(_0xecdc0a[_0x920c('0x24')]){_0x1d871e(null,[_0xecdc0a[_0x920c('0x25')]]);}else{_0x1d871e(null,_['map'](_0xecdc0a['Intervals'],_0x920c('0x25')));}}else{_0x1d871e(null,![]);}})[_0x920c('0x17')](function(_0x49ba86){_0x1d871e(_0x49ba86);});};AGIVertices['prototype'][_0x920c('0x1f')]=function(_0x4d8a4){return util[_0x920c('0x26')](_0x920c('0x27'),FILES_PATH,_0x4d8a4);};AGIVertices[_0x920c('0x10')][_0x920c('0x28')]=function(_0x33a4c6,_0x367f0e,_0x14cf7c){odbc[_0x920c('0x29')](_0x33a4c6,function(_0x111515){if(_0x111515){logger['error']('Error\x20getting\x20ODBC\x20connection\x20%s',_0x111515);_0x14cf7c(_0x111515);}else{logger[_0x920c('0x2a')](_0x920c('0x2b'));odbc[_0x920c('0x2c')](_0x367f0e,function(_0x20089c,_0x5516ec){if(_0x20089c){logger[_0x920c('0x2a')](_0x920c('0x2d'),_0x367f0e);_0x14cf7c(_0x20089c);}else{logger[_0x920c('0x2a')]('Query\x20executed\x20correctly\x20%s',_0x367f0e);odbc[_0x920c('0x2e')](function(_0x40cc1d){if(_0x40cc1d){logger[_0x920c('0x2f')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x40cc1d);}_0x14cf7c(null,_0x5516ec);});}});}});};AGIVertices['prototype'][_0x920c('0x30')]=function(_0x16a59f,_0x2cb880){this[_0x920c('0xe')][_0x920c('0x31')](_0x16a59f)['then'](function(_0x2014c8){_0x2cb880(null,_0x2014c8?_0x2014c8:![]);})['catch'](function(_0x108c51){_0x2cb880(_0x108c51);});};AGIVertices[_0x920c('0x10')][_0x920c('0x32')]=function(_0x276c82,_0x2d647c){this['rpc'][_0x920c('0x32')](_0x276c82)['then'](function(_0x308c2e){_0x2d647c(null,_0x308c2e);})[_0x920c('0x17')](function(_0x355960){_0x2d647c(_0x355960);});};AGIVertices[_0x920c('0x10')][_0x920c('0x33')]=function(_0x3d3898,_0x103431,_0x1f3f78){this[_0x920c('0xe')][_0x920c('0x33')]({'uniqueid':this[_0x920c('0x34')]['uniqueid'],'node':_0x3d3898[_0x920c('0x35')],'application':_0x3d3898[_0x920c('0x36')],'data':_0x103431||null,'project_name':this[_0x920c('0x34')][_0x920c('0x37')],'callerid':this[_0x920c('0x34')][_0x920c('0x38')]})[_0x920c('0x12')](function(_0x5a32a0){if(_0x1f3f78){_0x1f3f78(null,_0x5a32a0);}})[_0x920c('0x17')](function(_0xcaa759){if(_0x1f3f78){_0x1f3f78(_0xcaa759);}});};AGIVertices[_0x920c('0x10')][_0x920c('0x39')]=function(_0x454c48,_0x4e4809,_0x5b9fec,_0x2b9c95){this[_0x920c('0xe')]['createSquareRecording']({'uniqueid':this[_0x920c('0x34')]['uniqueid'],'callerid':this[_0x920c('0x34')][_0x920c('0x38')],'calleridname':this['channel'][_0x920c('0x3a')],'context':this['channel'][_0x920c('0x3b')],'extension':this[_0x920c('0x34')][_0x920c('0x3c')],'priority':this[_0x920c('0x34')][_0x920c('0x3d')],'accountcode':this['channel'][_0x920c('0x3e')],'dnid':this['channel'][_0x920c('0x3f')],'projectName':this[_0x920c('0x34')][_0x920c('0x37')],'saveName':_0x4e4809,'filename':_0x454c48[_0x920c('0x40')]||_0x4e4809,'savePath':_0x5b9fec})['then'](function(_0x422371){_0x2b9c95(null,_0x422371);})[_0x920c('0x17')](function(_0x4357e2){_0x2b9c95(_0x4357e2);});};AGIVertices[_0x920c('0x10')]['createSquareMessage']=function(_0x411384,_0x24fa75,_0x31809b,_0x252fb3,_0x3e7c51){this[_0x920c('0xe')][_0x920c('0x41')]({'uniqueid':this[_0x920c('0x34')][_0x920c('0x42')],'body':_0x411384,'direction':_0x24fa75,'providerName':_0x31809b,'providerResponse':_0x252fb3})[_0x920c('0x12')](function(_0x2a9dcd){if(_0x3e7c51){_0x3e7c51(null,_0x2a9dcd);}})[_0x920c('0x17')](function(_0x35f9e2){if(_0x3e7c51){_0x3e7c51(_0x35f9e2);}});};AGIVertices[_0x920c('0x10')]['createCmContact']=function(_0x45b665,_0x3257f3){this[_0x920c('0xe')][_0x920c('0x43')]({'firstName':_[_0x920c('0x44')](_0x45b665['name'])||_[_0x920c('0x45')](_0x45b665[_0x920c('0x15')])?_0x920c('0x46')+Math['random']():_0x45b665['name'],'lastName':_[_0x920c('0x44')](_0x45b665['lastName'])||_[_0x920c('0x45')](_0x45b665[_0x920c('0x47')])?null:_0x45b665[_0x920c('0x47')],'phone':_0x45b665[_0x920c('0x48')],'ListId':_0x45b665[_0x920c('0x49')],'scheduledat':_0x45b665[_0x920c('0x4a')],'callbackUniqueid':this['channel'][_0x920c('0x42')],'tags':'callback','description':_0x920c('0x4b')+_0x45b665[_0x920c('0x4a')][_0x920c('0x4c')](),'priority':_0x45b665[_0x920c('0x4d')]})[_0x920c('0x12')](function(_0x52e4de){_0x3257f3(null,_0x52e4de);})[_0x920c('0x17')](function(_0x229d29){_0x3257f3(_0x229d29);});};AGIVertices[_0x920c('0x10')][_0x920c('0x4e')]=function(_0x3df650,_0x5a0e0e){this[_0x920c('0xe')]['getPauseById'](_0x3df650)[_0x920c('0x12')](function(_0x445e4a){_0x5a0e0e(null,_0x445e4a?_0x445e4a[_0x920c('0x15')]:![]);})['catch'](function(_0x119e8c){_0x5a0e0e(_0x119e8c);});};AGIVertices[_0x920c('0x10')]['agentPause']=function(_0xcc061f,_0x5dc276,_0x584fc1){var _0x319d85={'role':_0x920c('0x4f')};_0x319d85[_0xcc061f]=this[_0x920c('0x34')][_0x920c('0x38')];this[_0x920c('0xe')][_0x920c('0x50')](_0x319d85,_0x5dc276,this[_0x920c('0x34')][_0x920c('0x42')])['then'](function(_0x13eba0){_0x584fc1(null,_[_0x920c('0x45')](_0x13eba0)?![]:!![]);})[_0x920c('0x17')](function(_0x377480){logger['error'](_0x377480);_0x584fc1(null,![]);});};AGIVertices[_0x920c('0x10')][_0x920c('0x51')]=function(_0x5b8bf0,_0x47e9be){var _0x120de8={'role':_0x920c('0x4f')};_0x120de8[_0x5b8bf0]=this[_0x920c('0x34')]['callerid'];this[_0x920c('0xe')][_0x920c('0x51')](_0x120de8)['then'](function(_0x70ee0d){_0x47e9be(null,_[_0x920c('0x45')](_0x70ee0d)?![]:!![]);})[_0x920c('0x17')](function(_0x14b3a6){logger[_0x920c('0x2f')](_0x14b3a6);_0x47e9be(null,![]);});};AGIVertices[_0x920c('0x10')]['agentLogout']=function(_0x3a1f65,_0x5bff36){var _0x48811a={'role':_0x920c('0x4f')};_0x48811a[_0x3a1f65]=this['channel'][_0x920c('0x38')];this['rpc'][_0x920c('0x52')](_0x48811a)[_0x920c('0x12')](function(_0x1c40fc){_0x5bff36(null,_[_0x920c('0x45')](_0x1c40fc)?![]:!![]);})['catch'](function(_0x599a66){logger[_0x920c('0x2f')](_0x599a66);_0x5bff36(null,![]);});};AGIVertices[_0x920c('0x10')][_0x920c('0x53')]=function(_0x599ba,_0x2e5bb0){var _0x43ee5e={'role':'agent'};_0x43ee5e[_0x599ba]=this[_0x920c('0x34')]['callerid'];var _0x5af4ca=_0x599ba!='internal'?util[_0x920c('0x26')](_0x920c('0x54'),_0x920c('0x55'),this[_0x920c('0x34')][_0x920c('0x38')]):undefined;this[_0x920c('0xe')]['agentLogin'](_0x43ee5e,_0x5af4ca)['then'](function(_0x4f96f2){_0x2e5bb0(null,_[_0x920c('0x45')](_0x4f96f2)?![]:!![]);})[_0x920c('0x17')](function(_0x464ac0){logger[_0x920c('0x2f')](_0x464ac0);_0x2e5bb0(null,![]);});};AGIVertices[_0x920c('0x10')][_0x920c('0x56')]=function(_0x122cb7,_0x252af4){sh[_0x920c('0x57')](_['trim'](_0x122cb7),function(_0x5061f0,_0x3a2227){var _0x444c7a=_0x3a2227['replace'](/(\r\n|\n|\r)/gm,'');_0x252af4(null,_0x444c7a);});};AGIVertices[_0x920c('0x10')]['googleCloudTTS']=function(_0x2b8984,_0x292938){scripts[_0x920c('0x58')](_0x2b8984[_0x920c('0x59')],_0x2b8984[_0x920c('0x5a')]||'text',_0x2b8984[_0x920c('0x5b')],_0x2b8984['languageCode']||'en-US',_0x2b8984['ssmlGender']||_0x920c('0x5c'),_0x2b8984[_0x920c('0x5d')]||'MP3')[_0x920c('0x12')](function(_0x35b1f1){_0x292938(null,_0x35b1f1);})[_0x920c('0x17')](function(_0x5e15e8){_0x292938(_0x5e15e8);});};AGIVertices[_0x920c('0x10')][_0x920c('0x5e')]=function(_0xd4a2c,_0x5af67d){scripts['googleTTS'](_0xd4a2c['text'],_0xd4a2c[_0x920c('0x5f')]||'en',0x1)[_0x920c('0x12')](function(_0x239fc4){_0x5af67d(null,_0x239fc4);})[_0x920c('0x17')](function(_0x4049d9){_0x5af67d(_0x4049d9);});};AGIVertices[_0x920c('0x10')][_0x920c('0x60')]=function(_0x33a94b,_0x1092e0){var _0x216985={'uri':_0x33a94b[_0x920c('0x61')],'method':_0x33a94b[_0x920c('0x62')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x33a94b['timeout'])===_0x920c('0x63')&&parseInt(_0x33a94b[_0x920c('0x64')])>=0x1?parseInt(_0x33a94b[_0x920c('0x64')])*0x3e8:0x5*0x3e8};if(_[_0x920c('0x65')]([_0x920c('0x66'),_0x920c('0x67')],_0x216985[_0x920c('0x62')][_0x920c('0x68')]())){try{_0x216985['body']=_0x33a94b[_0x920c('0xb')]?JSON[_0x920c('0x69')](_0x33a94b[_0x920c('0xb')]):{};}catch(_0x17f03e){logger[_0x920c('0x2f')](_0x920c('0x6a'),_0x17f03e);}}try{_0x216985[_0x920c('0x6b')]=_0x33a94b['rawHeaders']?JSON[_0x920c('0x69')](_0x33a94b['rawHeaders']):{};}catch(_0x2ba1ac){logger[_0x920c('0x2f')](_0x920c('0x6c'),_0x2ba1ac);}if(_0x33a94b[_0x920c('0x6d')]){try{var _0x716180=require(_0x33a94b[_0x920c('0x6d')])[_0x920c('0x6e')](this,_0x216985);_0x216985[_0x920c('0x6f')]=Mustache[_0x920c('0x70')](_0x33a94b['url'],_0x716180,{},['$$','$$']);if(_0x216985[_0x920c('0x6b')]){_0x216985['headers']=JSON['parse'](Mustache[_0x920c('0x70')](JSON['stringify'](_0x216985['headers']),_0x716180,{},['$$','$$']));}if(_0x216985['body']){_0x216985[_0x920c('0x71')]=JSON[_0x920c('0x69')](Mustache[_0x920c('0x70')](JSON[_0x920c('0x72')](_0x216985[_0x920c('0x71')]),_0x716180,{},['$$','$$']));}}catch(_0x533711){logger[_0x920c('0x2f')](_0x920c('0x73'),_0x533711);}}rp(_0x216985)[_0x920c('0x12')](function(_0x18fa9f){var _0x4b86d2={'statusCode':_0x18fa9f[_0x920c('0x74')]||0xc8,'statusMessage':_0x18fa9f[_0x920c('0x75')]||'OK','headers':_0x18fa9f[_0x920c('0x6b')]||{},'body':_0x18fa9f[_0x920c('0x71')]||{}};_0x1092e0(null,_0x4b86d2);})[_0x920c('0x17')](function(_0x827ba2){var _0x347179={'statusCode':_0x827ba2[_0x920c('0x74')]||0x1f4,'statusMessage':_0x827ba2[_0x920c('0x76')]||_0x920c('0x77'),'headers':_0x827ba2['options'][_0x920c('0x6b')]||{},'body':_0x827ba2[_0x920c('0x78')][_0x920c('0x71')]||{}};_0x1092e0(null,_0x347179);});};AGIVertices[_0x920c('0x10')]['googleDialogflow']=function(_0x20c13e,_0x54bf55){scripts[_0x920c('0x79')](this[_0x920c('0x34')][_0x920c('0x42')],_0x20c13e[_0x920c('0x7a')],_0x20c13e[_0x920c('0x5b')],_0x20c13e[_0x920c('0x7b')]||'en')[_0x920c('0x12')](function(_0x38ff7f){_0x54bf55(null,_0x38ff7f);})[_0x920c('0x17')](function(_0x1abc3e){_0x54bf55(_0x1abc3e);});};AGIVertices['prototype'][_0x920c('0x7c')]=function(_0x56f1ea,_0x12136c){scripts['googleDialogflowV2'](this['channel'][_0x920c('0x42')],_0x56f1ea[_0x920c('0x7d')],_0x56f1ea[_0x920c('0x7e')],_0x56f1ea['private_key'],_0x56f1ea[_0x920c('0x5b')],_0x56f1ea[_0x920c('0x7f')]||'en')['then'](function(_0x5a071b){_0x12136c(null,_0x5a071b);})[_0x920c('0x17')](function(_0x2c8721){_0x12136c(_0x2c8721);});};AGIVertices['prototype'][_0x920c('0x80')]=function(_0x14c1f5,_0x54c060){scripts[_0x920c('0x80')](this['channel'],_0x14c1f5)[_0x920c('0x12')](function(_0x174a57){_0x54c060(null,_0x174a57);})[_0x920c('0x17')](function(_0x5e59f4){_0x54c060(_0x5e59f4);});};AGIVertices[_0x920c('0x10')][_0x920c('0x81')]=function(_0x5c5716,_0x1176ca){scripts[_0x920c('0x81')](_0x5c5716[_0x920c('0x7a')],_0x5c5716[_0x920c('0x5b')],_0x5c5716['ispeech_tts_language']||_0x920c('0x82'),_0x5c5716[_0x920c('0x83')])[_0x920c('0x12')](function(_0x1d16f6){_0x1176ca(null,_0x1d16f6);})['catch'](function(_0x372bae){_0x1176ca(_0x372bae);});};AGIVertices[_0x920c('0x10')][_0x920c('0x84')]=function(_0x563791,_0x40f535,_0x754e40){scripts['ispeechASR'](_0x40f535,_0x563791['key'],_0x563791[_0x920c('0x85')]||'en-US',this['isConfigured'](_0x563791[_0x920c('0x86')])?_0x563791[_0x920c('0x86')]:undefined)[_0x920c('0x12')](function(_0x5dbf92){_0x754e40(null,_0x5dbf92);})[_0x920c('0x17')](function(_0x1449a0){_0x754e40(_0x1449a0);});};AGIVertices[_0x920c('0x10')][_0x920c('0x87')]=function(_0x4c5956,_0x256431){scripts['awsPolly'](_0x4c5956[_0x920c('0x88')],_0x4c5956[_0x920c('0x89')],_0x4c5956['aws_polly_region'],_0x4c5956['aws_polly_voice']||'Amy',_0x4c5956[_0x920c('0x5b')],_0x4c5956[_0x920c('0x8a')]||_0x920c('0x5b'))[_0x920c('0x12')](function(_0x354e69){_0x256431(null,_0x354e69);})[_0x920c('0x17')](function(_0x2982dd){_0x256431(_0x2982dd);});};AGIVertices[_0x920c('0x10')][_0x920c('0x8b')]=function(_0x3fc1c6,_0x337132){scripts[_0x920c('0x8b')](this[_0x920c('0x34')][_0x920c('0x42')],_0x3fc1c6[_0x920c('0x88')],_0x3fc1c6[_0x920c('0x89')],_0x3fc1c6[_0x920c('0x8c')],_0x3fc1c6[_0x920c('0x5b')],_0x3fc1c6[_0x920c('0x8d')])[_0x920c('0x12')](function(_0x3cd797){_0x337132(null,_0x3cd797);})[_0x920c('0x17')](function(_0x299150){_0x337132(_0x299150);});};AGIVertices[_0x920c('0x10')][_0x920c('0x8e')]=function(_0x1c22ab,_0x556ab8,_0xaeb6cd){scripts[_0x920c('0x8e')](_0x556ab8,_0x1c22ab['key'],_0x1c22ab[_0x920c('0x8f')]||_0x920c('0x82'))[_0x920c('0x12')](function(_0x1417c3){_0xaeb6cd(null,_0x1417c3);})[_0x920c('0x17')](function(_0x2ae8e9){_0xaeb6cd(_0x2ae8e9);});};AGIVertices[_0x920c('0x10')]['tildeASR']=function(_0x47f167,_0x57938a,_0x43ffa7){scripts[_0x920c('0x90')](_0x57938a,_0x47f167[_0x920c('0x91')],_0x47f167[_0x920c('0x92')],_0x47f167[_0x920c('0x6f')])[_0x920c('0x12')](function(_0x5c7779){_0x43ffa7(null,_0x5c7779);})[_0x920c('0x17')](function(_0x5a68d7){_0x43ffa7(_0x5a68d7);});};AGIVertices[_0x920c('0x10')][_0x920c('0x93')]=function(_0x444f3d){var _0x41e157=_[_0x920c('0x65')](verticesWithRetry,_0x444f3d[_0x920c('0x36')])?_0x444f3d:_[_0x920c('0x94')](_0x444f3d);for(var _0x238960 in _0x41e157){if(_0x41e157['hasOwnProperty'](_0x238960)){if(_0x41e157[_0x238960]&&_[_0x920c('0x95')](_0x41e157[_0x238960])){if(_['includes'](recursiveMapAttributes,_0x238960)){_0x41e157[_0x238960]=this['replaceObjectAllVariables'](_0x41e157[_0x238960]);}else{_0x41e157[_0x238960]=this[_0x920c('0x96')](_0x41e157[_0x238960]);}}}}return _0x41e157;};AGIVertices['prototype'][_0x920c('0x97')]=function(_0x59b0a7){for(var _0x103678 in _0x59b0a7){if(_0x59b0a7[_0x920c('0x98')](_0x103678)){if(_['isPlainObject'](_0x59b0a7[_0x103678])){this[_0x920c('0x97')](_0x59b0a7[_0x103678]);}else if(_[_0x920c('0x99')](_0x59b0a7[_0x103678])){for(var _0x33b3d6=0x0;_0x33b3d6<_0x59b0a7[_0x103678]['length'];_0x33b3d6++){this[_0x920c('0x97')](_0x59b0a7[_0x103678][_0x33b3d6]);}}else if(_['isString'](_0x59b0a7[_0x103678])){_0x59b0a7[_0x103678]=this[_0x920c('0x96')](_0x59b0a7[_0x103678]);}}}};AGIVertices['prototype'][_0x920c('0x9a')]=function(_0x1db95f,_0x34824e){for(var _0x4562fd in _0x1db95f){if(_0x1db95f[_0x920c('0x98')](_0x4562fd)){if(_[_0x920c('0x9b')](_0x1db95f[_0x4562fd])){if(!_[_0x920c('0x44')](_0x1db95f[_0x4562fd])){this[_0x920c('0x9a')](_0x1db95f[_0x4562fd],util[_0x920c('0x26')](_0x920c('0x9c'),_0x34824e,_0x4562fd));}}else if(_[_0x920c('0x99')](_0x1db95f[_0x4562fd])){for(var _0x4d0cd5=0x0;_0x4d0cd5<_0x1db95f[_0x4562fd][_0x920c('0x9d')];_0x4d0cd5++){this['saveRestApiResult'](_0x1db95f[_0x4562fd][_0x4d0cd5],util[_0x920c('0x26')](_0x920c('0x9c'),_0x34824e,_0x4562fd+'['+_0x4d0cd5+']'));}}else{if(!_[_0x920c('0x45')](_0x1db95f[_0x4562fd])){this[_0x920c('0x34')][_0x920c('0x9e')](util[_0x920c('0x26')](_0x920c('0x9c'),_0x34824e,_0x4562fd),_0x1db95f[_0x4562fd]);}}}}};AGIVertices[_0x920c('0x10')][_0x920c('0x9f')]=function(_0x5ccbaa){try{var _0x21bedf=JSON[_0x920c('0x69')](_0x5ccbaa);this['recursiveNodeIndex'](_0x21bedf);return JSON[_0x920c('0x72')](_0x21bedf);}catch(_0x28f4b4){return this[_0x920c('0x96')](_0x5ccbaa);}};AGIVertices[_0x920c('0x10')][_0x920c('0x96')]=function(_0x314598){var _0x284532=_0x314598[_0x920c('0xa0')]('{');for(var _0x54f689=0x1;_0x54f689<_0x284532[_0x920c('0x9d')];_0x54f689+=0x1){var _0xd69d24=_0x284532[_0x54f689][_0x920c('0xa0')]('}');if(_0xd69d24['length']>0x1){_0x314598=_0x314598[_0x920c('0xa1')]('{'+_0xd69d24[0x0]+'}',this[_0x920c('0x34')]['getVariable'](_0xd69d24[0x0])[_0x920c('0xa2')]||_0xd69d24[0x0]);}}if(_0x284532[_0x920c('0x9d')]===0x1){return _0x314598[_0x920c('0x4c')]();}return this[_0x920c('0x96')](_0x314598);};AGIVertices[_0x920c('0x10')][_0x920c('0xa3')]=function(_0x2bea98,_0x115d55){var _0x31bb38=this[_0x920c('0x34')]['getVariable'](_0x2bea98);if(_0x31bb38[_0x920c('0xa4')]===-0x1){return _0x31bb38;}logger['info'](util[_0x920c('0x26')](_0x920c('0xa5'),_0x115d55,_0x31bb38[_0x920c('0xa2')]));return this['channel'][_0x920c('0x9e')](_0x115d55,_0x31bb38['extra']);};AGIVertices['prototype']['isConfigured']=function(_0x197cc9){return _0x197cc9&&_0x197cc9!=='0'&&_0x197cc9!=='-1'&&_0x197cc9!=='';};AGIVertices['prototype'][_0x920c('0xa6')]=function(_0x2cc29e){this['createSquareDetailsReport'][_0x920c('0x6e')](this,_0x2cc29e,'-');_0x2cc29e[_0x920c('0xa7')]=_0x2cc29e['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x920c('0xa8')]=function(_0x2380c4){logger[_0x920c('0x2a')](util['format']('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x2380c4[_0x920c('0x35')]));if(!this['isConfigured'](_0x2380c4['text'])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0xaa'));}var _0x3607d1='\x22'+_0x2380c4[_0x920c('0x5b')]+'\x22';if(this['isConfigured'](_0x2380c4['options'])){_0x3607d1+=','+_0x2380c4[_0x920c('0x78')];}var _0x269132=this[_0x920c('0x34')][_0x920c('0x57')]('MRCPSynth',_0x3607d1);if(_0x269132[_0x920c('0xa4')]===-0x1){return _0x269132;}return this[_0x920c('0x34')]['noop'](util[_0x920c('0x26')](_0x920c('0xab'),_0x3607d1));};AGIVertices[_0x920c('0x10')]['mrcprecog']=function(_0x13d3bd){logger[_0x920c('0x2a')](util[_0x920c('0x26')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x13d3bd[_0x920c('0x35')]));if(!this['isConfigured'](_0x13d3bd[_0x920c('0xac')])){return this[_0x920c('0x34')]['noop'](_0x920c('0xad'));}var _0x1a7560=_0x13d3bd['grammar'];if(this[_0x920c('0xae')](_0x13d3bd['options'])){_0x1a7560+=','+_0x13d3bd[_0x920c('0x78')];}var _0x5156e3=this[_0x920c('0x34')][_0x920c('0x57')](_0x920c('0xaf'),_0x1a7560);if(_0x5156e3['result']===-0x1){return _0x5156e3;}var _0x10b468=this['getAndSetVariable'](_0x920c('0xb0'),'MRCP_RECOG_CONFIDENCE');if(_0x10b468[_0x920c('0xa4')]===-0x1){return _0x10b468;}var _0x547c16=this['getAndSetVariable'](_0x920c('0xb1'),'MRCP_RECOG_TRANSCRIPT');if(_0x547c16[_0x920c('0xa4')]===-0x1){return _0x547c16;}var _0x336b96=this[_0x920c('0xa3')]('RECOG_INSTANCE()',_0x920c('0xb2'));if(_0x336b96[_0x920c('0xa4')]===-0x1){return _0x336b96;}return this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0xb3'),_0x1a7560));};AGIVertices[_0x920c('0x10')][_0x920c('0x8')]=function(_0x29ffb4){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0xb4'),_0x29ffb4[_0x920c('0x35')]));return this[_0x920c('0x34')][_0x920c('0x8')]([_0x29ffb4[_0x920c('0xb5')],_0x29ffb4[_0x920c('0xb6')]]);};AGIVertices[_0x920c('0x10')][_0x920c('0xb7')]=function(_0x38f4a8){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0xb8'),_0x38f4a8[_0x920c('0x35')]));if(this['isConfigured'](_0x38f4a8[_0x920c('0x64')])){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0xb9'),_0x38f4a8['timeout']));var _0x160742=this[_0x920c('0x34')]['wait'](_0x38f4a8[_0x920c('0x64')]);if(_0x160742[_0x920c('0xa4')]===-0x1){return _0x160742;}}return this[_0x920c('0x34')][_0x920c('0xb7')]();};AGIVertices[_0x920c('0x10')][_0x920c('0xba')]=function(_0x3c79a){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0xbb'),_0x3c79a[_0x920c('0x35')]));if(!this[_0x920c('0xae')](_0x3c79a[_0x920c('0x49')])){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x3c79a,_0x920c('0xbc'));}_0x3c79a['scheduledAt']=moment();if(this['isConfigured'](_0x3c79a['delay'])){_0x3c79a[_0x920c('0x4a')]=moment()[_0x920c('0xbd')](_0x3c79a[_0x920c('0xbe')],'minutes');}if(!this[_0x920c('0xae')](_0x3c79a[_0x920c('0x4d')])){_0x3c79a['callback_priority']=0x2;}this[_0x920c('0x43')]['sync'](this,_0x3c79a);return this['channel'][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0xbf'),_0x3c79a['phone'],_0x3c79a[_0x920c('0x49')],_0x3c79a[_0x920c('0x4a')]));};AGIVertices[_0x920c('0x10')]['custom_app']=function(_0xe88a25){logger[_0x920c('0x2a')](util['format'](_0x920c('0xc0'),_0xe88a25[_0x920c('0x35')]));var _0x15c1e5=this[_0x920c('0x34')][_0x920c('0x57')](_0xe88a25[_0x920c('0xc1')],_0xe88a25[_0x920c('0x78')]);if(_0x15c1e5['result']===-0x1){return _0x15c1e5;}return this[_0x920c('0x34')]['noop'](util['format'](_0x920c('0xc2'),_0xe88a25[_0x920c('0xc1')],_0xe88a25[_0x920c('0x78')]));};AGIVertices[_0x920c('0x10')][_0x920c('0xc3')]=function(_0x52f950){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0xc4'),_0x52f950[_0x920c('0x35')]));if(!this['isConfigured'](_0x52f950['text'])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0xaa'));}var _0x3502a9='\x22'+_0x52f950[_0x920c('0x5b')]+'\x22';if(this[_0x920c('0xae')](_0x52f950['options'])){_0x3502a9+=','+_0x52f950[_0x920c('0x78')];}var _0x480c09=this[_0x920c('0x34')][_0x920c('0x57')](_0x920c('0xc5'),_0x3502a9);if(_0x480c09[_0x920c('0xa4')]===-0x1){return _0x480c09;}return this['channel'][_0x920c('0xa9')](util[_0x920c('0x26')]('Executed\x20command\x20MRCPSynth\x20%s',_0x3502a9));};AGIVertices[_0x920c('0x10')][_0x920c('0xc6')]=function(_0x4ef6be){logger['info'](util['format'](_0x920c('0xc7'),_0x4ef6be[_0x920c('0x35')]));if(!this[_0x920c('0xae')](_0x4ef6be[_0x920c('0x5b')])){return this['channel'][_0x920c('0xa9')](_0x920c('0xaa'));}var _0x32ceb0='\x22'+_0x4ef6be[_0x920c('0x5b')]+'\x22';if(this[_0x920c('0xae')](_0x4ef6be[_0x920c('0x78')])){_0x32ceb0+=','+_0x4ef6be[_0x920c('0x78')];}var _0x4add32=this['channel'][_0x920c('0x57')](_0x920c('0xc5'),_0x32ceb0);if(_0x4add32[_0x920c('0xa4')]===-0x1){return _0x4add32;}return this[_0x920c('0x34')]['noop'](util[_0x920c('0x26')](_0x920c('0xab'),_0x32ceb0));};AGIVertices[_0x920c('0x10')]['lumenvoxasr']=function(_0x20eebc){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0xc8'),_0x20eebc[_0x920c('0x35')]));if(!this['isConfigured'](_0x20eebc[_0x920c('0xac')])){return this[_0x920c('0x34')]['noop']('no\x20grammar\x20configured');}var _0x314193=_0x20eebc[_0x920c('0xac')];if(this[_0x920c('0xae')](_0x20eebc[_0x920c('0x78')])){_0x314193+=','+_0x20eebc[_0x920c('0x78')];}var _0x2ee209=this['channel'][_0x920c('0x57')](_0x920c('0xaf'),_0x314193);if(_0x2ee209[_0x920c('0xa4')]===-0x1){return _0x2ee209;}var _0xf8011a=this[_0x920c('0xa3')]('RECOG_CONFIDENCE()',_0x920c('0xc9'));if(_0xf8011a[_0x920c('0xa4')]===-0x1){return _0xf8011a;}var _0x2387de=this[_0x920c('0xa3')](_0x920c('0xb1'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x2387de['result']===-0x1){return _0x2387de;}var _0x5f4914=this['getAndSetVariable'](_0x920c('0xca'),_0x920c('0xcb'));if(_0x5f4914['result']===-0x1){return _0x5f4914;}return this['channel'][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0xb3'),_0x314193));};AGIVertices[_0x920c('0x10')]['sestekasr']=function(_0x57e3ee){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0xcc'),_0x57e3ee['label']));if(!this[_0x920c('0xae')](_0x57e3ee['grammar'])){return this['channel'][_0x920c('0xa9')](_0x920c('0xad'));}var _0x57e2a3=_0x57e3ee['grammar'];if(this['isConfigured'](_0x57e3ee['options'])){_0x57e2a3+=','+_0x57e3ee[_0x920c('0x78')];}var _0x1d2644=this[_0x920c('0x34')][_0x920c('0x57')](_0x920c('0xaf'),_0x57e2a3);if(_0x1d2644[_0x920c('0xa4')]===-0x1){return _0x1d2644;}var _0xba6511=this[_0x920c('0xa3')](_0x920c('0xb0'),'SESTEK_ASR_CONFIDENCE');if(_0xba6511[_0x920c('0xa4')]===-0x1){return _0xba6511;}var _0x3030c6=this[_0x920c('0xa3')]('RECOG_INPUT()','SESTEK_ASR_TRANSCRIPT');if(_0x3030c6['result']===-0x1){return _0x3030c6;}var _0x438d69=this[_0x920c('0xa3')]('RECOG_INSTANCE()',_0x920c('0xcd'));if(_0x438d69[_0x920c('0xa4')]===-0x1){return _0x438d69;}return this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0xb3'),_0x57e2a3));};AGIVertices[_0x920c('0x10')]['database']=function(_0x3ee6e2){logger[_0x920c('0x2a')](util[_0x920c('0x26')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x3ee6e2[_0x920c('0x35')]));if(!this[_0x920c('0xae')](_0x3ee6e2[_0x920c('0xce')])){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x3ee6e2,'no\x20database\x20selected');}var _0x526ce7=this[_0x920c('0x18')][_0x920c('0x6e')](this,_0x3ee6e2[_0x920c('0xce')]);if(!_0x526ce7){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x3ee6e2,'no\x20odbc\x20database\x20found');}if(!this[_0x920c('0xae')](_0x3ee6e2[_0x920c('0x2c')])){return this['channel'][_0x920c('0x2f')](_0x3ee6e2,_0x920c('0xcf'));}var _0xe101b4=_0x3ee6e2[_0x920c('0x2c')][_0x920c('0xd0')](/(\r\n|\n|\r)/gm,'\x20');this[_0x920c('0x34')]['noop'](util[_0x920c('0x26')](_0x920c('0xd1'),_0xe101b4));var _0x369fa9=this['getQueryOdbc'][_0x920c('0x6e')](this,_0x526ce7,_0xe101b4);this[_0x920c('0x33')][_0x920c('0x6e')](this,_0x3ee6e2,_0xe101b4);if(!this[_0x920c('0xae')](_0x3ee6e2[_0x920c('0xd2')])){return this[_0x920c('0x34')]['noop'](_0x920c('0xd3'));}var _0x37e2ca=this['getVariable'][_0x920c('0x6e')](this,_0x3ee6e2[_0x920c('0xd2')]);if(!_0x37e2ca){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x3ee6e2,_0x920c('0xd4'));}var _0x368a36=this;_0x369fa9[_0x920c('0xd5')](function(_0x5eacde,_0x4b9f1a){Object[_0x920c('0xd6')](_0x5eacde)[_0x920c('0xd5')](function(_0x278737){_0x368a36[_0x920c('0x34')][_0x920c('0x9e')](util[_0x920c('0x26')](_0x920c('0xd7'),_0x37e2ca,_0x4b9f1a,_0x278737),_0x5eacde[_0x278737]);});});this['channel']['setVariable'](util[_0x920c('0x26')]('%s_ROWS_COUNT',_0x37e2ca),_0x369fa9[_0x920c('0x9d')]);return this[_0x920c('0x34')]['noop'](util[_0x920c('0x26')](_0x920c('0xd8'),_0x37e2ca));};AGIVertices['prototype'][_0x920c('0xd9')]=function(_0x35c1d4){logger[_0x920c('0xda')](util[_0x920c('0x26')](_0x920c('0xdb'),_0x35c1d4['label']));if(!this[_0x920c('0xae')](_0x35c1d4['sip_id'])){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x35c1d4,_0x920c('0xdc'));}var _0x27efa2=this[_0x920c('0x1b')][_0x920c('0x6e')](this,_0x35c1d4['sip_id']);if(!_0x27efa2){return this[_0x920c('0x34')]['error'](_0x35c1d4,_0x920c('0xdd'));}var _0x4d4096=this[_0x920c('0x34')][_0x920c('0x57')](_0x920c('0xde'),[util[_0x920c('0x26')](_0x920c('0xdf'),_0x27efa2),_0x35c1d4[_0x920c('0x64')],_0x35c1d4['opts'],_0x35c1d4[_0x920c('0x61')]]);if(_0x4d4096[_0x920c('0xa4')]===-0x1){return _0x4d4096;}return this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0xe0'),_0x920c('0xde')));};AGIVertices['prototype'][_0x920c('0xe1')]=function(_0x35ab99){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0xe2'),_0x35ab99[_0x920c('0x35')]));if(!this[_0x920c('0xae')](_0x35ab99[_0x920c('0x7a')])){return this[_0x920c('0x34')]['noop'](_0x920c('0xe3'));}if(!this['isConfigured'](_0x35ab99['text'])){return this['channel'][_0x920c('0xa9')](_0x920c('0xaa'));}this['channel'][_0x920c('0xe4')]=!![];this[_0x920c('0x33')](_0x35ab99);this['createSquareMessage'](_0x35ab99[_0x920c('0x5b')],'in','','');this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0xe5'),_0x35ab99['text']));var _0xefd66=this['googleDialogflow'][_0x920c('0x6e')](this,_0x35ab99);if(_0xefd66){for(var _0x39bb70 in _0xefd66){if(_0xefd66[_0x920c('0x98')](_0x39bb70)){this[_0x920c('0x34')][_0x920c('0x9e')](util[_0x920c('0x26')](_0x920c('0xe6'),_0x39bb70['toUpperCase']()),_0xefd66[_0x39bb70]);}}this[_0x920c('0x41')](_0xefd66['speech'],'out',_0x920c('0xe1'),'');return this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0xe7'),_0xefd66['speech']));}return this[_0x920c('0x34')]['error'](_0x35ab99,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x920c('0x10')][_0x920c('0xe8')]=function(_0x14718a){logger['info'](util[_0x920c('0x26')](_0x920c('0xe9'),_0x14718a['label']));if(!this[_0x920c('0xae')](_0x14718a[_0x920c('0x7d')])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0xea'));}if(!this[_0x920c('0xae')](_0x14718a['client_email'])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0xeb'));}if(!this['isConfigured'](_0x14718a[_0x920c('0xec')])){return this['channel'][_0x920c('0xa9')]('no\x20private_key\x20configured');}if(!this[_0x920c('0xae')](_0x14718a[_0x920c('0x7f')])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0xed'));}if(!this[_0x920c('0xae')](_0x14718a['text'])){return this[_0x920c('0x34')][_0x920c('0xa9')]('no\x20text\x20configured');}this['channel'][_0x920c('0xe4')]=!![];this[_0x920c('0x33')](_0x14718a);this['createSquareMessage'](_0x14718a[_0x920c('0x5b')],'in','','');this[_0x920c('0x34')][_0x920c('0xa9')](util['format'](_0x920c('0xee'),_0x14718a['text']));var _0x6fbb84=this[_0x920c('0x7c')]['sync'](this,_0x14718a);if(_0x6fbb84){for(var _0x369c34 in _0x6fbb84){if(_0x6fbb84[_0x920c('0x98')](_0x369c34)){if(_0x369c34!==_0x920c('0xef')){this[_0x920c('0x34')]['setVariable'](util['format']('DIALOGFLOW_%s',_0x369c34[_0x920c('0x68')]()),_0x6fbb84[_0x369c34]);}}}this[_0x920c('0x41')](_0x6fbb84[_0x920c('0xf0')],_0x920c('0xf1'),_0x920c('0xe8'),_0x6fbb84[_0x920c('0xef')]);return this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0xf2'),_0x6fbb84[_0x920c('0xf0')]));}return this[_0x920c('0x34')][_0x920c('0x2f')](_0x14718a,_0x920c('0xf3'));};AGIVertices['prototype'][_0x920c('0xf4')]=function(_0x46038c){logger['info'](util['format'](_0x920c('0xf5'),_0x46038c[_0x920c('0x35')]));if(!this[_0x920c('0xae')](_0x46038c[_0x920c('0xf6')])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0xf7'));}if(!this[_0x920c('0xae')](_0x46038c[_0x920c('0xf8')])){return this[_0x920c('0x34')]['noop'](_0x920c('0xf9'));}if(!this['isConfigured'](_0x46038c[_0x920c('0xfa')])){return this['channel'][_0x920c('0xa9')](_0x920c('0xfb'));}if(!this[_0x920c('0xae')](_0x46038c['ndassistant_url'])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0xaa'));}this['channel'][_0x920c('0xe4')]=!![];this[_0x920c('0x33')](_0x46038c);this[_0x920c('0x41')](_0x46038c[_0x920c('0x5b')],'in','','');this['channel'][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0xfc'),_0x46038c[_0x920c('0x5b')]));var _0x30f07e=this[_0x920c('0x80')][_0x920c('0x6e')](this,_0x46038c);if(_0x30f07e){for(var _0x11d203 in _0x30f07e){if(_0x30f07e['hasOwnProperty'](_0x11d203)){this['channel']['setVariable'](util[_0x920c('0x26')](_0x920c('0xfd'),_0x11d203[_0x920c('0x68')]()),_0x30f07e[_0x11d203]);}}this[_0x920c('0x41')](_0x30f07e[_0x920c('0xf0')],_0x920c('0xf1'),_0x920c('0xf4'),'');if(_0x30f07e['audiofile']){this['channel'][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0xfe'),_0x30f07e[_0x920c('0xff')]));var _0x39139b=this['channel']['streamFile'](_0x30f07e[_0x920c('0xff')]);try{fs[_0x920c('0x100')](_0x30f07e['audiofile']+_0x920c('0x101'));}catch(_0x1d8575){logger['error'](_0x1d8575);}return _0x39139b;}else{return this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')]('SestekNDA\x20Result\x20%s',_0x30f07e[_0x920c('0xf0')]));}}return this[_0x920c('0x34')][_0x920c('0x2f')](_0x46038c,_0x920c('0x102'));};AGIVertices[_0x920c('0x10')]['end']=function(_0x4f1e8d){logger['info'](util['format']('Enter\x20in\x20END\x20(%s)\x20block',_0x4f1e8d[_0x920c('0x35')]));return this['channel']['noop'](_0x920c('0x103'));};AGIVertices[_0x920c('0x10')][_0x920c('0x104')]=function(_0x1a8b82){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x105'),_0x1a8b82['label']));var _0x1fbd1a='';if(_0x1a8b82[_0x920c('0x106')]){if(!this[_0x920c('0xae')](_0x1a8b82['trunk_id'])){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x1a8b82,_0x920c('0x107'));}else{var _0x39b639=parseInt(_0x1a8b82[_0x920c('0x106')],0xa);if(isNaN(_0x39b639)){_0x1fbd1a=_0x1a8b82[_0x920c('0x106')];}else{_0x1fbd1a=this[_0x920c('0x1d')][_0x920c('0x6e')](this,_0x1a8b82[_0x920c('0x106')]);if(!_0x1fbd1a){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x1a8b82,_0x920c('0x108'));}}}}else if(_0x1a8b82[_0x920c('0x109')]){_0x1fbd1a=_0x1a8b82[_0x920c('0x109')];}else{return this['channel'][_0x920c('0x2f')](_0x1a8b82,'no\x20trunk\x20selected');}var _0x368865=this[_0x920c('0x34')][_0x920c('0x57')](_0x920c('0xde'),[util[_0x920c('0x26')](_0x920c('0x10a'),_0x1fbd1a,_0x1a8b82[_0x920c('0x48')]),_0x1a8b82['timeout'],_0x1a8b82['opts'],_0x1a8b82[_0x920c('0x61')]]);if(_0x368865[_0x920c('0xa4')]===-0x1){return _0x368865;}return this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0xe0'),_0x920c('0xde')));};AGIVertices[_0x920c('0x10')][_0x920c('0x10b')]=function(_0x3bd7af){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x10c'),_0x3bd7af['label']));return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0x10b'));};AGIVertices['prototype'][_0x920c('0x10d')]=function(_0x2d4031){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x10e'),_0x2d4031[_0x920c('0x35')]));if(_0x2d4031[_0x920c('0xa7')]===0x0){return this[_0x920c('0xa6')](_0x2d4031);}_0x2d4031[_0x920c('0xa7')]-=0x1;if(!this[_0x920c('0xae')](_0x2d4031[_0x920c('0x10f')])){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x2d4031,'no\x20file\x20audio\x20selected');}var _0x45f256=this[_0x920c('0x110')][_0x920c('0x6e')](this,_0x2d4031['file_id']);if(!_0x45f256){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x2d4031,_0x920c('0x111'));}if(!this[_0x920c('0xae')](_0x2d4031[_0x920c('0xd2')])){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x920c('0xd3'));}var _0x5c0a98=this['channel']['getData'](_0x45f256,_0x2d4031[_0x920c('0x112')],_0x2d4031['maxdigit']);var _0x5ce41c=_0x5c0a98[_0x920c('0xa4')]?_0x5c0a98[_0x920c('0xa4')]['toString']():'';logger[_0x920c('0x2a')](_0x920c('0x113'),JSON['stringify'](_0x5c0a98));if(_0x5c0a98['result']===-0x1){this[_0x920c('0x33')][_0x920c('0x6e')](this,_0x2d4031,_0x5ce41c);return _0x5c0a98;}else if(_0x5c0a98[_0x920c('0xa2')]===_0x920c('0x64')){_0x5c0a98['result']=_0x5ce41c[_0x920c('0x9d')]>=parseInt(_0x2d4031[_0x920c('0x114')])?'x':'i';}else{_0x5c0a98[_0x920c('0xa4')]=_0x5ce41c[_0x920c('0x9d')]>=parseInt(_0x2d4031[_0x920c('0x114')])&&_0x5ce41c[_0x920c('0x9d')]<=parseInt(_0x2d4031['maxdigit'])?'x':'i';}var _0x17acb0=this[_0x920c('0x11')][_0x920c('0x6e')](this,_0x2d4031[_0x920c('0xd2')]);if(!_0x17acb0){return this['channel'][_0x920c('0x2f')](_0x2d4031,_0x920c('0xd4'));}this['channel'][_0x920c('0x9e')](_0x17acb0,_0x5ce41c);if(this[_0x920c('0xae')](_0x2d4031[_0x920c('0x115')])){var _0x2d33a2=parseInt(_0x2d4031['hiddendigitsnum'],0xa);var _0x59be52=rs[_0x920c('0x116')]({'charset':'*','length':_0x2d33a2});var _0x28373c=_0x5ce41c[_0x920c('0x9d')];if(_0x28373c>0x0){if(_0x28373c>_0x2d33a2){this[_0x920c('0x33')][_0x920c('0x6e')](this,_0x2d4031,_0x2d4031[_0x920c('0x117')]===_0x920c('0x118')?_0x59be52+_0x5ce41c[_0x920c('0x119')](_0x2d33a2):_0x5ce41c['substr'](0x0,_0x28373c-_0x2d33a2)+_0x59be52);}else{this[_0x920c('0x33')][_0x920c('0x6e')](this,_0x2d4031,rs['generate']({'charset':'*','length':_0x28373c}));}}else{this['createSquareDetailsReport'][_0x920c('0x6e')](this,_0x2d4031,'');}}else{this[_0x920c('0x33')]['sync'](this,_0x2d4031,_0x5ce41c);}return _0x5c0a98;};AGIVertices[_0x920c('0x10')]['getsecretdigits']=function(_0x19f935){logger['info'](util[_0x920c('0x26')](_0x920c('0x11a'),_0x19f935['label']));return this[_0x920c('0x10d')](_0x19f935);};AGIVertices[_0x920c('0x10')][_0x920c('0x11b')]=function(_0x2c6096){logger['info'](util['format'](_0x920c('0x11c'),_0x2c6096['label']));this[_0x920c('0x33')][_0x920c('0x6e')](this,_0x2c6096,_0x2c6096['goalname']);return this['channel'][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0x11d'),_0x2c6096[_0x920c('0x11e')]));};AGIVertices[_0x920c('0x10')][_0x920c('0x11f')]=function(_0x39a858){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x120'),_0x39a858[_0x920c('0x35')]));if(!this[_0x920c('0xae')](_0x39a858[_0x920c('0x88')])||!this[_0x920c('0xae')](_0x39a858[_0x920c('0x89')])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0x121'));}if(!this[_0x920c('0xae')](_0x39a858[_0x920c('0x5b')])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0xaa'));}this[_0x920c('0x34')][_0x920c('0xa9')](util['format'](_0x920c('0x122'),_0x39a858['text']));var _0x588a61=this['awsPolly'][_0x920c('0x6e')](this,_0x39a858);if(_0x588a61){this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0x123'),_0x588a61));var _0x17b0fc=this[_0x920c('0x34')]['streamFile'](_0x588a61);try{fs[_0x920c('0x100')](_0x588a61+_0x920c('0x101'));}catch(_0x9e0ba0){logger[_0x920c('0x2f')](_0x9e0ba0);}return _0x17b0fc;}return this[_0x920c('0x34')][_0x920c('0x2f')](_0x39a858,'aws\x20Polly\x20is\x20unreachable');};AGIVertices['prototype']['awslex']=function(_0x145a25){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x124'),_0x145a25[_0x920c('0x35')]));if(!this[_0x920c('0xae')](_0x145a25[_0x920c('0x88')])||!this[_0x920c('0xae')](_0x145a25[_0x920c('0x89')])){return this['channel'][_0x920c('0xa9')](_0x920c('0x121'));}if(!this[_0x920c('0xae')](_0x145a25[_0x920c('0x8d')])){return this['channel'][_0x920c('0xa9')]('no\x20bot\x20name\x20configured');}if(!this[_0x920c('0xae')](_0x145a25[_0x920c('0x5b')])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0xaa'));}this[_0x920c('0x34')][_0x920c('0xe4')]=!![];this['createSquareDetailsReport'](_0x145a25);this['createSquareMessage'](_0x145a25[_0x920c('0x5b')],'in','','');this['channel']['noop'](util[_0x920c('0x26')](_0x920c('0x125'),_0x145a25[_0x920c('0x5b')]));var _0x140428=this[_0x920c('0x8b')][_0x920c('0x6e')](this,_0x145a25);if(_0x140428){for(var _0x47c581 in _0x140428){if(_0x140428[_0x920c('0x98')](_0x47c581)&&_['isString'](_0x140428[_0x47c581])){this[_0x920c('0x34')][_0x920c('0x9e')](util[_0x920c('0x26')](_0x920c('0x126'),_0x47c581[_0x920c('0x68')]()),_0x140428[_0x47c581]);}}if(_[_0x920c('0x45')](_0x140428[_0x920c('0x76')])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0x127'));}else{this['createSquareMessage'](_0x140428[_0x920c('0x76')],'out',_0x920c('0x128'),'');return this[_0x920c('0x34')][_0x920c('0xa9')](util['format'](_0x920c('0x129'),_0x140428[_0x920c('0x76')]));}}return this[_0x920c('0x34')][_0x920c('0x2f')](_0x145a25,_0x920c('0x12a'));};AGIVertices[_0x920c('0x10')]['googleasr']=function(_0x34e8ec){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x12b'),_0x34e8ec[_0x920c('0x35')],_0x34e8ec['timeout']));if(!this['isConfigured'](_0x34e8ec[_0x920c('0x7a')])){return this['channel']['noop']('no\x20key\x20configured');}var _0x4827cb=_0x920c('0x12c');var _0x5eab08=util[_0x920c('0x26')](_0x920c('0x12d'),FILES_PATH,rs['generate'](0x4));var _0xce6dc7=util[_0x920c('0x26')]('%s.%s',_0x5eab08,_0x4827cb);var _0x78d19e=!![];if(_0x34e8ec[_0x920c('0x12e')]===_0x920c('0x12f')){_0x78d19e=![];}var _0x1b8b4b=this['channel'][_0x920c('0x130')](_0x5eab08,_0x4827cb,_0x34e8ec['intKey'],_0x34e8ec[_0x920c('0x64')],undefined,_0x78d19e);if(_0x1b8b4b['result']!==-0x1){this[_0x920c('0x34')][_0x920c('0xa9')](util['format']('google\x20%s\x20file\x20created',_0xce6dc7));var _0x4f67a0=this[_0x920c('0x8e')][_0x920c('0x6e')](this,_0x34e8ec,_0xce6dc7);if(_0x4f67a0){for(var _0x4a6a32 in _0x4f67a0){if(_0x4f67a0[_0x920c('0x98')](_0x4a6a32)){this[_0x920c('0x34')][_0x920c('0x9e')](util[_0x920c('0x26')]('GOOGLE_ASR_%s',_0x4a6a32['toUpperCase']()),_0x4f67a0[_0x4a6a32]);}}return this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0x131'),JSON[_0x920c('0x72')](_0x4f67a0)));}}return _0x1b8b4b;};AGIVertices['prototype'][_0x920c('0x132')]=function(_0x562916){logger[_0x920c('0x2a')](util[_0x920c('0x26')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x562916['label']));if(!this[_0x920c('0xae')](_0x562916[_0x920c('0x91')])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0x133'));}if(!this[_0x920c('0xae')](_0x562916['appsecret'])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0x134'));}var _0x3807f2=_0x920c('0x12c');var _0x424717=util[_0x920c('0x26')](_0x920c('0x12d'),FILES_PATH,rs[_0x920c('0x116')](0x4));var _0x58302d=util[_0x920c('0x26')](_0x920c('0x9c'),_0x424717,_0x3807f2);var _0x185009=!![];if(_0x562916[_0x920c('0x12e')]==='NOBEEP'){_0x185009=![];}var _0x526a20=this[_0x920c('0x34')][_0x920c('0x130')](_0x424717,_0x3807f2,_0x562916['intKey'],_0x562916['timeout'],undefined,_0x185009);if(_0x526a20[_0x920c('0xa4')]!==-0x1){this['channel'][_0x920c('0xa9')](util['format'](_0x920c('0x135'),_0x58302d));var _0xe324c9=this[_0x920c('0x90')]['sync'](this,_0x562916,_0x58302d);if(_0xe324c9){for(var _0x15ef36 in _0xe324c9){if(_0xe324c9[_0x920c('0x98')](_0x15ef36)){this['channel']['setVariable'](util['format'](_0x920c('0x136'),_0x15ef36[_0x920c('0x68')]()),_0xe324c9[_0x15ef36]);}}return this[_0x920c('0x34')]['noop'](util[_0x920c('0x26')](_0x920c('0x137'),JSON[_0x920c('0x72')](_0xe324c9)));}}return _0x526a20;};AGIVertices[_0x920c('0x10')][_0x920c('0x138')]=function(_0x30accb){logger[_0x920c('0x2a')](util[_0x920c('0x26')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x30accb[_0x920c('0x35')]));return this[_0x920c('0x34')][_0x920c('0x139')](_0x30accb['context'],_0x30accb[_0x920c('0x3c')],_0x30accb['priority']);};AGIVertices[_0x920c('0x10')][_0x920c('0x13a')]=function(_0x383c8e){logger[_0x920c('0x2a')](util[_0x920c('0x26')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x383c8e[_0x920c('0x35')]));if(!this[_0x920c('0xae')](_0x383c8e[_0x920c('0x13b')])){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x383c8e,_0x920c('0x13c'));}try{var _0x461dee=eval(_0x383c8e[_0x920c('0x13b')])?'true':'false';this['channel']['noop'](util[_0x920c('0x26')]('EVAL\x20CONDITION\x20%s\x20%s',_0x383c8e[_0x920c('0x13b')],_0x461dee));return{'code':0xc8,'result':_0x461dee};}catch(_0x44e5de){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x920c('0x10')][_0x920c('0x13d')]=function(_0xd4a4db){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x13e'),_0xd4a4db['label']));if(!this[_0x920c('0xae')](_0xd4a4db[_0x920c('0x13f')])){return this[_0x920c('0x34')][_0x920c('0x2f')](_0xd4a4db,'no\x20interval\x20configured');}var _0x557544=this[_0x920c('0x23')][_0x920c('0x6e')](this,_0xd4a4db['interval_id']);if(!_0x557544){return this['channel'][_0x920c('0x2f')](_0xd4a4db,_0x920c('0x140'));}for(var _0x482808=0x0;_0x482808<_0x557544['length'];_0x482808+=0x1){var _0x2f5123=this[_0x920c('0x34')][_0x920c('0x11')](util[_0x920c('0x26')](_0x920c('0x141'),_0x557544[_0x482808]));if(_0x2f5123[_0x920c('0xa4')]===-0x1){return _0x2f5123;}logger['info'](util[_0x920c('0x26')](_0x920c('0x142'),_0x557544[_0x482808],_0x2f5123[_0x920c('0xa2')]));if(_0x2f5123['extra']===_0x920c('0x143')){logger[_0x920c('0x2a')](util['format']('IFTIME\x20%s\x20%s',_0x557544[_0x482808],_0x920c('0x143')));this[_0x920c('0x34')]['noop'](util['format'](_0x920c('0x142'),_0x557544[_0x482808],_0x920c('0x143')));return{'code':0xc8,'result':_0x920c('0x143')};}else{logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x142'),_0x557544[_0x482808],_0x920c('0x144')));this[_0x920c('0x34')]['noop'](util[_0x920c('0x26')](_0x920c('0x142'),_0x557544[_0x482808],_0x920c('0x144')));}}return{'code':0xc8,'result':_0x920c('0x144')};};AGIVertices['prototype'][_0x920c('0x145')]=function(_0x393140){logger[_0x920c('0x2a')](util[_0x920c('0x26')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x393140['label']));return this[_0x920c('0x34')]['hangup']();};AGIVertices[_0x920c('0x10')][_0x920c('0x146')]=function(_0x161255){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x147'),_0x161255[_0x920c('0x35')]));if(!this[_0x920c('0xae')](_0x161255[_0x920c('0x7a')])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0xe3'));}var _0x47d950=_0x920c('0x12c');var _0x17c339=util[_0x920c('0x26')](_0x920c('0x12d'),FILES_PATH,rs[_0x920c('0x116')](0x4));var _0xbf3494=util[_0x920c('0x26')](_0x920c('0x9c'),_0x17c339,_0x47d950);var _0x1e8a71=!![];if(_0x161255[_0x920c('0x12e')]==='NOBEEP'){_0x1e8a71=![];}var _0x4982e7=this[_0x920c('0x34')]['recordFile'](_0x17c339,_0x47d950,_0x161255['intKey'],_0x161255[_0x920c('0x64')],undefined,_0x1e8a71);if(_0x4982e7['result']!==-0x1){this[_0x920c('0x34')]['noop'](util[_0x920c('0x26')](_0x920c('0x148'),_0xbf3494));var _0xf18f88=this['ispeechASR'][_0x920c('0x6e')](this,_0x161255,_0xbf3494);if(_0xf18f88){for(var _0x2ed093 in _0xf18f88){if(_0xf18f88[_0x920c('0x98')](_0x2ed093)){this['channel'][_0x920c('0x9e')](util[_0x920c('0x26')](_0x920c('0x149'),_0x2ed093[_0x920c('0x68')]()),_0xf18f88[_0x2ed093]);}}return this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0x14a'),JSON[_0x920c('0x72')](_0xf18f88)));}}return _0x4982e7;};AGIVertices[_0x920c('0x10')][_0x920c('0x14b')]=function(_0x26b932){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x14c'),_0x26b932['label']));if(!this[_0x920c('0xae')](_0x26b932[_0x920c('0x7a')])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0xe3'));}if(!this['isConfigured'](_0x26b932[_0x920c('0x5b')])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0xaa'));}this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0x14d'),_0x26b932[_0x920c('0x5b')]));var _0x4321ea=this[_0x920c('0x81')]['sync'](this,_0x26b932);if(_0x4321ea){this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0x148'),_0x4321ea));var _0x3af45b=this[_0x920c('0x34')][_0x920c('0x14e')](_0x4321ea,_0x26b932[_0x920c('0x14f')]);try{fs[_0x920c('0x100')](_0x4321ea+_0x920c('0x101'));}catch(_0x48a1ba){logger[_0x920c('0x2f')](_0x48a1ba);}return _0x3af45b;}return this[_0x920c('0x34')]['error'](_0x26b932,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x920c('0x10')][_0x920c('0x150')]=function(_0x511888){logger[_0x920c('0x2a')](util['format']('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x511888[_0x920c('0x35')]));if(!this['isConfigured'](_0x511888[_0x920c('0x151')])){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x511888,'no\x20find\x20by\x20configured');}logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x152'),this[_0x920c('0x34')]['callerid'],_0x511888[_0x920c('0x151')]));var _0x5a815d=this[_0x920c('0x53')][_0x920c('0x6e')](this,_0x511888[_0x920c('0x151')]);if(_0x5a815d){logger[_0x920c('0x2a')](util[_0x920c('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x920c('0x34')]['callerid'],_0x511888['findBy']));this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x920c('0x34')][_0x920c('0x38')],_0x511888[_0x920c('0x151')]));return{'code':0xc8,'result':_0x920c('0x153')};}else{logger[_0x920c('0x2a')](util[_0x920c('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x920c('0x34')][_0x920c('0x38')],_0x511888[_0x920c('0x151')]));this[_0x920c('0x34')]['noop'](util[_0x920c('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x920c('0x34')]['callerid'],_0x511888[_0x920c('0x151')]));return{'code':0xc8,'result':_0x920c('0x154')};}};AGIVertices[_0x920c('0x10')]['logout']=function(_0x7d3fbd){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x155'),_0x7d3fbd[_0x920c('0x35')]));if(!this[_0x920c('0xae')](_0x7d3fbd['findBy'])){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x7d3fbd,'no\x20find\x20by\x20configured');}logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x152'),this[_0x920c('0x34')][_0x920c('0x38')],_0x7d3fbd['findBy']));var _0x360826=this[_0x920c('0x52')][_0x920c('0x6e')](this,_0x7d3fbd[_0x920c('0x151')]);if(_0x360826){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x156'),this[_0x920c('0x34')][_0x920c('0x38')],_0x7d3fbd[_0x920c('0x151')]));this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0x156'),this[_0x920c('0x34')][_0x920c('0x38')],_0x7d3fbd['findBy']));return{'code':0xc8,'result':_0x920c('0x153')};}else{logger[_0x920c('0x2a')](util['format'](_0x920c('0x157'),this[_0x920c('0x34')][_0x920c('0x38')],_0x7d3fbd['findBy']));this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0x157'),this[_0x920c('0x34')][_0x920c('0x38')],_0x7d3fbd[_0x920c('0x151')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x920c('0x10')][_0x920c('0x158')]=function(_0x43c4fc){logger['info'](util[_0x920c('0x26')](_0x920c('0x159'),_0x43c4fc[_0x920c('0x35')]));if(!this[_0x920c('0xae')](_0x43c4fc[_0x920c('0x15a')])){return this['channel'][_0x920c('0x2f')](_0x43c4fc,_0x920c('0x15b'));}this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')]('math\x20%s',_0x43c4fc[_0x920c('0x15a')]));var _0x4b8e2c=eval(_0x43c4fc[_0x920c('0x15a')]);if(!this[_0x920c('0xae')](_0x43c4fc['variable_id'])){return this['channel']['noop'](_0x920c('0xd3'));}var _0x3aa9a4=this[_0x920c('0x11')][_0x920c('0x6e')](this,_0x43c4fc[_0x920c('0xd2')]);if(!_0x3aa9a4){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x43c4fc,_0x920c('0xd4'));}if(_[_0x920c('0x99')](_0x4b8e2c)){var _0x337a67=this;_0x4b8e2c[_0x920c('0xd5')](function(_0x783079,_0x4233f3){_0x337a67['channel'][_0x920c('0x9e')](util[_0x920c('0x26')]('%s[%s]',_0x3aa9a4,_0x4233f3),_0x783079);});return this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0x15c'),_0x3aa9a4));}else{return this[_0x920c('0x34')][_0x920c('0x9e')](_0x3aa9a4,_0x4b8e2c);}};AGIVertices[_0x920c('0x10')][_0x920c('0xc')]=function(_0x1ad817){logger['info'](util['format'](_0x920c('0x15d'),_0x1ad817['label']));if(_0x1ad817[_0x920c('0xa7')]===0x0){return this[_0x920c('0xa6')](_0x1ad817);}_0x1ad817[_0x920c('0xa7')]-=0x1;if(!this['isConfigured'](_0x1ad817[_0x920c('0x10f')])){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x1ad817,'no\x20file\x20audio\x20selected');}var _0x108ffd=this[_0x920c('0x110')]['sync'](this,_0x1ad817['file_id']);if(!_0x108ffd){return this[_0x920c('0x34')]['error'](_0x1ad817,_0x920c('0x111'));}var _0x1a0ba3=this['channel']['getData'](_0x108ffd,_0x1ad817[_0x920c('0x112')],_0x1ad817[_0x920c('0x15e')]);var _0x4aace8=_0x1a0ba3[_0x920c('0xa4')];if(_0x1a0ba3[_0x920c('0xa4')]===-0x1){this[_0x920c('0x33')][_0x920c('0x6e')](this,_0x1ad817,'-1');return _0x1a0ba3;}else if(_0x1a0ba3[_0x920c('0xa2')]===_0x920c('0x64')){_0x1a0ba3[_0x920c('0xa4')]=_0x1a0ba3[_0x920c('0xa4')]['length']>0x0?_0x1a0ba3['result']:'t';}else if(_[_0x920c('0x44')](_0x1a0ba3[_0x920c('0xa4')])){_0x1a0ba3[_0x920c('0xa4')]='#';_0x4aace8='#';}if(!this[_0x920c('0xae')](_0x1ad817[_0x920c('0xd2')])){this['channel'][_0x920c('0xa9')](_0x920c('0xd3'));}else{var _0x56c7e1=this[_0x920c('0x11')][_0x920c('0x6e')](this,_0x1ad817[_0x920c('0xd2')]);if(!_0x56c7e1){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x1ad817,_0x920c('0xd4'));}this[_0x920c('0x34')]['setVariable'](_0x56c7e1,_0x4aace8);}this['createSquareDetailsReport']['sync'](this,_0x1ad817,_0x4aace8);return _0x1a0ba3;};AGIVertices['prototype'][_0x920c('0xa9')]=function(_0x2b56a0){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x15f'),_0x2b56a0[_0x920c('0x35')]));return this[_0x920c('0x34')][_0x920c('0xa9')](_0x2b56a0[_0x920c('0x160')]||_0x2b56a0[_0x920c('0x35')]);};AGIVertices[_0x920c('0x10')][_0x920c('0x161')]=function(_0x47cde2){logger['info'](util[_0x920c('0x26')](_0x920c('0x162'),_0x47cde2[_0x920c('0x35')]));if(!this['isConfigured'](_0x47cde2[_0x920c('0x151')])){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x47cde2,_0x920c('0x163'));}logger[_0x920c('0x2a')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x920c('0x34')][_0x920c('0x38')],_0x47cde2[_0x920c('0x151')]));var _0x1a6396=this[_0x920c('0x4e')][_0x920c('0x6e')](this,_0x47cde2[_0x920c('0x164')]);var _0x16266f=this['agentPause'][_0x920c('0x6e')](this,_0x47cde2[_0x920c('0x151')],_0x1a6396);if(_0x16266f){logger[_0x920c('0x2a')](util[_0x920c('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x920c('0x34')][_0x920c('0x38')],_0x47cde2[_0x920c('0x151')]));this['channel']['noop'](util[_0x920c('0x26')](_0x920c('0x156'),this[_0x920c('0x34')][_0x920c('0x38')],_0x47cde2[_0x920c('0x151')]));return{'code':0xc8,'result':_0x920c('0x153')};}else{logger['info'](util[_0x920c('0x26')](_0x920c('0x157'),this['channel'][_0x920c('0x38')],_0x47cde2[_0x920c('0x151')]));this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0x156'),this['channel'][_0x920c('0x38')],_0x47cde2[_0x920c('0x151')]));return{'code':0xc8,'result':_0x920c('0x154')};}};AGIVertices[_0x920c('0x10')]['playback']=function(_0x2b10d8){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x165'),_0x2b10d8[_0x920c('0x35')]));if(!this[_0x920c('0xae')](_0x2b10d8['file_id'])){return this[_0x920c('0x34')]['error'](_0x2b10d8,'no\x20file\x20audio\x20selected');}var _0x3982aa=this[_0x920c('0x110')][_0x920c('0x6e')](this,_0x2b10d8['file_id']);if(!_0x3982aa){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x2b10d8,_0x920c('0x111'));}var _0x27e2ed=this[_0x920c('0x34')]['exec'](_0x920c('0x166'),[_0x3982aa,_0x2b10d8[_0x920c('0x167')]]);if(_0x27e2ed[_0x920c('0xa4')]===-0x1){return _0x27e2ed;}return this['channel']['noop'](util[_0x920c('0x26')](_0x920c('0xc2'),_0x920c('0x166'),_0x3982aa));};AGIVertices[_0x920c('0x10')]['queue']=function(_0x25bad9){logger['info'](util[_0x920c('0x26')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x25bad9[_0x920c('0x35')]));if(!this[_0x920c('0xae')](_0x25bad9[_0x920c('0x168')])){return this['channel']['error'](_0x25bad9,_0x920c('0x169'));}var _0x14a60b='';var _0x6979fa=parseInt(_0x25bad9[_0x920c('0x168')],0xa);if(isNaN(_0x6979fa)){_0x14a60b=_0x25bad9['queue_id'];}else{_0x14a60b=this['getVoiceQueue'][_0x920c('0x6e')](this,_0x25bad9['queue_id']);if(!_0x14a60b){return this[_0x920c('0x34')]['error'](_0x25bad9,'no\x20queue\x20found');}}var _0x526fc3='';if(this[_0x920c('0xae')](_0x25bad9[_0x920c('0x10f')])){var _0x187fbe=this['getSound']['sync'](this,_0x25bad9[_0x920c('0x10f')]);if(_0x187fbe){_0x526fc3=_0x187fbe;}}this[_0x920c('0x33')][_0x920c('0x6e')](this,_0x25bad9,_0x14a60b);if(_0x25bad9[_0x920c('0x167')]['indexOf']('x')<0x0){_0x25bad9[_0x920c('0x167')]+='x';}if(_0x25bad9[_0x920c('0x167')]['indexOf']('X')<0x0){_0x25bad9[_0x920c('0x167')]+='X';}this[_0x920c('0x34')][_0x920c('0x9e')](_0x920c('0x16a'),_0x14a60b?_0x14a60b['toLowerCase']():'');var _0x1bc0ac=this['channel'][_0x920c('0x57')](_0x920c('0x16b'),[_0x14a60b,_0x25bad9[_0x920c('0x167')],_0x25bad9['url'],_0x526fc3,_0x25bad9[_0x920c('0x64')],_0x25bad9[_0x920c('0x8')],_0x25bad9[_0x920c('0x16c')],_0x25bad9[_0x920c('0x16d')],'',_0x25bad9[_0x920c('0x16e')]]);if(_0x1bc0ac[_0x920c('0xa4')]===-0x1){return _0x1bc0ac;}return this['channel'][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0xc2'),'QUEUE',_0x14a60b));};AGIVertices['prototype'][_0x920c('0x16f')]=function(_0x17c960){logger['info'](util[_0x920c('0x26')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x17c960[_0x920c('0x35')]));var _0x5792bb=_0x17c960[_0x920c('0x170')]||'wav';var _0x4ffee6=util[_0x920c('0x26')](_0x920c('0x171'),this[_0x920c('0x34')]['uniqueid'],rs[_0x920c('0x116')](0x5));var _0x31ca27=util[_0x920c('0x26')]('%s/recordings/%s.%s',FILES_PATH,_0x4ffee6,_0x5792bb);var _0x15d751=util[_0x920c('0x26')](_0x920c('0x12d'),FILES_PATH,_0x4ffee6);this[_0x920c('0x39')]['sync'](this,_0x17c960,_0x4ffee6,_0x31ca27);this['channel'][_0x920c('0x9e')](_0x920c('0x172'),_0x4ffee6);logger[_0x920c('0x2a')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x15d751,_0x5792bb,_0x17c960[_0x920c('0x173')],_0x17c960[_0x920c('0x64')]);return this[_0x920c('0x34')][_0x920c('0x130')](_0x15d751,_0x5792bb,_0x17c960['escape_digits'],_0x17c960['timeout'],undefined,!![]);};AGIVertices[_0x920c('0x10')][_0x920c('0x174')]=function(_0x420fe7){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x175'),_0x420fe7[_0x920c('0x35')]));if(!this[_0x920c('0xae')](_0x420fe7[_0x920c('0x61')])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0x176'));}var _0x279da2=this[_0x920c('0x60')][_0x920c('0x6e')](this,_0x420fe7);logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x177'),util[_0x920c('0x178')](_0x279da2,{'showHidden':![],'depth':null})));if(!this[_0x920c('0xae')](_0x420fe7[_0x920c('0xd2')])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0x179'));}var _0x3aee75=this[_0x920c('0x11')][_0x920c('0x6e')](this,_0x420fe7['variable_id']);if(!_0x3aee75){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x420fe7,_0x920c('0xd4'));}this[_0x920c('0x34')][_0x920c('0x9e')](util['format']('%s_STATUS_CODE',_0x3aee75),_0x279da2[_0x920c('0x74')]?_0x279da2['statusCode']:_0x920c('0x17a'));this[_0x920c('0x34')][_0x920c('0x9e')](util[_0x920c('0x26')](_0x920c('0x17b'),_0x3aee75),_0x279da2[_0x920c('0x75')]?_0x279da2['statusMessage']:'OK');if(_0x279da2[_0x920c('0x71')]){try{this['saveRestApiResult'](_0x279da2['body'],_0x3aee75);}catch(_0x44bd1d){logger[_0x920c('0x2f')](util['format'](_0x920c('0x17c'),_0x3aee75));}}return this['channel']['noop'](util[_0x920c('0x26')](_0x920c('0xd8'),_0x3aee75));};AGIVertices[_0x920c('0x10')][_0x920c('0x17d')]=function(_0x4295b7){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x17e'),_0x4295b7[_0x920c('0x35')]));return this[_0x920c('0x34')][_0x920c('0x17f')](_0x4295b7['digits']['replace'](/\s+/g,''),_0x4295b7['escape_digits']);};AGIVertices[_0x920c('0x10')][_0x920c('0x180')]=function(_0x4658c2){logger['info'](util[_0x920c('0x26')](_0x920c('0x181'),_0x4658c2['label']));return this['channel'][_0x920c('0x182')](_0x4658c2[_0x920c('0x63')][_0x920c('0xd0')](/\s+/g,''),_0x4658c2[_0x920c('0x173')]);};AGIVertices[_0x920c('0x10')][_0x920c('0x183')]=function(_0x5d2f51){logger['info'](util[_0x920c('0x26')](_0x920c('0x184'),_0x5d2f51[_0x920c('0x35')]));return this[_0x920c('0x34')][_0x920c('0x185')](_0x5d2f51['text'],_0x5d2f51[_0x920c('0x173')]);};AGIVertices['prototype'][_0x920c('0x186')]=function(_0x575418){logger['info'](util[_0x920c('0x26')](_0x920c('0x187'),_0x575418[_0x920c('0x35')]));if(!this[_0x920c('0xae')](_0x575418[_0x920c('0x188')])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0x189'));}var _0x4ac47b=this[_0x920c('0x18a')][_0x920c('0x6e')](this,_0x575418[_0x920c('0x188')]);if(!_0x4ac47b||!_0x4ac47b[_0x920c('0x18b')]){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x575418,_0x920c('0x18c'));}var _0xca1e5={'from':util[_0x920c('0x26')]('\x22%s\x22\x20<%s>',_0x4ac47b[_0x920c('0x15')],_0x4ac47b[_0x920c('0x18d')]||_0x4ac47b[_0x920c('0x18b')][_0x920c('0x18e')]),'to':_0x575418['to']||'','cc':_0x575418['cc']||'','bcc':_0x575418[_0x920c('0x18f')]||'','subject':_0x575418[_0x920c('0x190')],'html':_0x575418['text'],'text':_0x575418[_0x920c('0x5b')]};var _0x5c0006={'tls':{'rejectUnauthorized':![]}};if(_0x4ac47b['Smtp'][_0x920c('0x191')]){_0x5c0006[_0x920c('0x191')]=_0x4ac47b[_0x920c('0x18b')]['service'];}else{_0x5c0006[_0x920c('0x192')]=_0x4ac47b[_0x920c('0x18b')][_0x920c('0x192')];_0x5c0006['port']=_0x4ac47b[_0x920c('0x18b')][_0x920c('0x193')];_0x5c0006['secure']=_0x4ac47b['Smtp'][_0x920c('0x194')];}if(_0x4ac47b[_0x920c('0x18b')]['authentication']){_0x5c0006[_0x920c('0x195')]={'user':_0x4ac47b[_0x920c('0x18b')]['user'],'pass':_0x4ac47b['Smtp'][_0x920c('0x196')]};}if(this[_0x920c('0xae')](_0x575418[_0x920c('0x197')])){}logger['debug'](_0x920c('0x198'),JSON[_0x920c('0x72')](_0xca1e5));this[_0x920c('0x33')][_0x920c('0x6e')](this,_0x575418,_0x575418[_0x920c('0x188')]);this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0x199'),_0x4ac47b[_0x920c('0x15')]));this['sendMailMessage']['sync'](this,_0x5c0006,_0xca1e5);return this['channel'][_0x920c('0xa9')](_0x920c('0x19a'));};AGIVertices['prototype'][_0x920c('0x19b')]=function(_0x349c9c){logger['info'](util[_0x920c('0x26')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x349c9c[_0x920c('0x35')]));return this['channel'][_0x920c('0xa9')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices['prototype'][_0x920c('0x19c')]=function(_0x32bb90){logger[_0x920c('0x2a')](util[_0x920c('0x26')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x32bb90[_0x920c('0x35')]));if(!this['isConfigured'](_0x32bb90[_0x920c('0x19d')])){return this[_0x920c('0x34')][_0x920c('0xa9')]('no\x20sms\x20account\x20configured');}var _0x3e3af7=this['getSmsAccount'][_0x920c('0x6e')](this,_0x32bb90['sms_account_id']);if(!_0x3e3af7){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x32bb90,'no\x20sms\x20account\x20found');}var _0x19f008={'body':_0x32bb90[_0x920c('0x19e')],'phone':_0x32bb90['to']||'','SmsAccountId':_0x3e3af7['id']};logger[_0x920c('0xda')](_0x920c('0x19f'),JSON[_0x920c('0x72')](_0x19f008));this['createSquareDetailsReport'][_0x920c('0x6e')](this,_0x32bb90,_0x32bb90[_0x920c('0x19d')]);this[_0x920c('0x34')]['noop'](util[_0x920c('0x26')](_0x920c('0x1a0'),_0x3e3af7[_0x920c('0x15')]));this[_0x920c('0x32')][_0x920c('0x6e')](this,_0x19f008);return this[_0x920c('0x34')]['noop'](_0x920c('0x1a1'));};AGIVertices[_0x920c('0x10')][_0x920c('0x1a2')]=function(_0xb177d3){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x1a3'),_0xb177d3['label']));if(!this[_0x920c('0xae')](_0xb177d3[_0x920c('0xd2')])){return this['channel'][_0x920c('0x2f')](_0xb177d3,_0x920c('0x1a4'));}var _0x35760f=this[_0x920c('0x11')][_0x920c('0x6e')](this,_0xb177d3['variable_id']);if(!_0x35760f){return this[_0x920c('0x34')][_0x920c('0x2f')](_0xb177d3,_0x920c('0xd4'));}return this[_0x920c('0x34')]['setVariable'](_0x35760f,_0xb177d3['variable_value']);};AGIVertices[_0x920c('0x10')]['start']=function(_0x4f30cd){logger[_0x920c('0x2a')](util['format'](_0x920c('0x1a5'),_0x4f30cd[_0x920c('0x35')]));this[_0x920c('0x34')][_0x920c('0xa9')]('START\x20CALLY\x20SQUARE');if(_0x4f30cd['answer']===_0x920c('0x1a6')){this['channel']['noop'](_0x920c('0x1a7'));return this[_0x920c('0x34')][_0x920c('0xb7')]();}return this['channel'][_0x920c('0xa9')](_0x920c('0x1a8'));};AGIVertices['prototype'][_0x920c('0x1a9')]=function(_0x5431f3){logger[_0x920c('0x2a')](util['format'](_0x920c('0x1aa'),_0x5431f3[_0x920c('0x35')]));if(!this[_0x920c('0xae')](_0x5431f3[_0x920c('0x1ab')])){return this['channel'][_0x920c('0x2f')](_0x5431f3,_0x920c('0x1ac'));}var _0x1a9a50=this['getSquareProject'][_0x920c('0x6e')](this,_0x5431f3['project_id']);if(!this[_0x920c('0xae')](_0x1a9a50)){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x5431f3,util[_0x920c('0x26')](_0x920c('0x1ad'),_0x5431f3[_0x920c('0x1ab')]));}if(_0x1a9a50===this['channel']['arg_1']){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x5431f3,_0x920c('0x1ae'));}this[_0x920c('0x33')][_0x920c('0x6e')](this,_0x5431f3,_0x1a9a50);var _0x53ae5c=this['channel'][_0x920c('0x57')](_0x920c('0x1af'),util['format'](_0x920c('0x1b0'),config[_0x920c('0x8')][_0x920c('0x192')]||_0x920c('0x1b1'),_0x1a9a50,this[_0x920c('0x34')][_0x920c('0x37')]));if(_0x53ae5c['result']===-0x1){return _0x53ae5c;}return this['channel']['noop'](util[_0x920c('0x26')](_0x920c('0xc2'),'AGI',_0x1a9a50));};AGIVertices[_0x920c('0x10')]['system']=function(_0x280413){logger['info'](util[_0x920c('0x26')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x280413['label']));var _0x494a63=this['shellCommand'][_0x920c('0x6e')](this,_0x280413['command']);this[_0x920c('0x33')][_0x920c('0x6e')](this,_0x280413,_0x280413['command']);if(this[_0x920c('0xae')](_0x280413[_0x920c('0xd2')])){var _0x1f6b11=this[_0x920c('0x11')][_0x920c('0x6e')](this,_0x280413['variable_id']);if(_0x1f6b11){this[_0x920c('0x34')][_0x920c('0x9e')](_0x1f6b11,_0x494a63);return this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0x1b2'),_0x280413['command'],_0x1f6b11));}}return this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0x1b3'),_0x280413[_0x920c('0xb5')]));};AGIVertices[_0x920c('0x10')][_0x920c('0x1b4')]=function(_0x3ac5c6){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x1b5'),_0x3ac5c6['label']));_0x3ac5c6[_0x920c('0x5b')]=_0x3ac5c6['text'][_0x920c('0xd0')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x3ac5c6[_0x920c('0x59')])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0x1b6'));}if(!this[_0x920c('0xae')](_0x3ac5c6['text'])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0xaa'));}this[_0x920c('0x34')][_0x920c('0xa9')](util['format'](_0x920c('0x1b7'),_0x3ac5c6['text']));var _0xba1ff9=this['googleCloudTTS'][_0x920c('0x6e')](this,_0x3ac5c6);if(_0xba1ff9){this['channel'][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0x1b8'),_0xba1ff9));var _0x16a30e=this[_0x920c('0x34')][_0x920c('0x14e')](_0xba1ff9);try{fs[_0x920c('0x100')](_0xba1ff9+_0x920c('0x101'));}catch(_0x1c453f){logger[_0x920c('0x2f')](_0x1c453f);}return _0x16a30e;}return this[_0x920c('0x34')]['error'](_0x3ac5c6,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x920c('0x1b9')]=function(_0x9f2056){logger[_0x920c('0x2a')](util['format'](_0x920c('0x1ba'),_0x9f2056[_0x920c('0x35')]));_0x9f2056[_0x920c('0x5b')]=_0x9f2056[_0x920c('0x5b')][_0x920c('0xd0')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x920c('0xae')](_0x9f2056[_0x920c('0x5b')])){return this['channel'][_0x920c('0xa9')]('no\x20text\x20configured');}this[_0x920c('0x34')]['noop'](util['format']('Trying\x20Google\x20TTS\x20%s',_0x9f2056[_0x920c('0x5b')]));var _0x406e46=this[_0x920c('0x5e')]['sync'](this,_0x9f2056);if(_0x406e46){this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')]('Google\x20TTS\x20%s\x20file\x20created',_0x406e46));var _0x1c0715=this[_0x920c('0x34')][_0x920c('0x14e')](_0x406e46);try{fs[_0x920c('0x100')](_0x406e46+'.wav');}catch(_0x4cedee){logger[_0x920c('0x2f')](_0x4cedee);}return _0x1c0715;}return this[_0x920c('0x34')][_0x920c('0x2f')](_0x9f2056,_0x920c('0x1bb'));};AGIVertices[_0x920c('0x10')]['unpause']=function(_0x2d6e71){logger['info'](util['format']('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x2d6e71['label']));if(!this[_0x920c('0xae')](_0x2d6e71[_0x920c('0x151')])){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x2d6e71,_0x920c('0x163'));}logger['info'](util[_0x920c('0x26')](_0x920c('0x152'),this['channel'][_0x920c('0x38')],_0x2d6e71[_0x920c('0x151')]));var _0x4b9bb7=this['agentUnpause'][_0x920c('0x6e')](this,_0x2d6e71[_0x920c('0x151')]);if(_0x4b9bb7){logger['info'](util[_0x920c('0x26')](_0x920c('0x156'),this[_0x920c('0x34')][_0x920c('0x38')],_0x2d6e71[_0x920c('0x151')]));this[_0x920c('0x34')][_0x920c('0xa9')](util['format'](_0x920c('0x156'),this[_0x920c('0x34')][_0x920c('0x38')],_0x2d6e71[_0x920c('0x151')]));return{'code':0xc8,'result':_0x920c('0x153')};}else{logger[_0x920c('0x2a')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x920c('0x34')][_0x920c('0x38')],_0x2d6e71[_0x920c('0x151')]));this['channel'][_0x920c('0xa9')](util['format'](_0x920c('0x157'),this[_0x920c('0x34')][_0x920c('0x38')],_0x2d6e71[_0x920c('0x151')]));return{'code':0xc8,'result':_0x920c('0x154')};}};AGIVertices[_0x920c('0x10')][_0x920c('0x1bc')]=function(_0x336c3c){logger['info'](util[_0x920c('0x26')](_0x920c('0x1bd'),_0x336c3c[_0x920c('0x35')]));var _0x1c2ddf=this['channel'][_0x920c('0x57')](_0x920c('0x1be'),[_0x336c3c[_0x920c('0x1bf')],_0x336c3c[_0x920c('0x78')]]);if(_0x1c2ddf[_0x920c('0xa4')]===-0x1){return _0x1c2ddf;}return this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0xc2'),_0x920c('0x1be'),_0x336c3c['mailbox']));};AGIVertices['prototype']['vswitch']=function(_0x2f3e40){logger[_0x920c('0x2a')](util[_0x920c('0x26')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x2f3e40[_0x920c('0x35')]));if(!this['isConfigured'](_0x2f3e40[_0x920c('0xd2')])){return this['channel'][_0x920c('0x2f')](_0x2f3e40,_0x920c('0x1a4'));}var _0x2d61e8=this['getVariable'][_0x920c('0x6e')](this,_0x2f3e40[_0x920c('0xd2')]);if(!_0x2d61e8){return this[_0x920c('0x34')]['error'](_0x2f3e40,_0x920c('0xd4'));}var _0x9e407d=this[_0x920c('0x34')]['getVariable'](_0x2d61e8);return{'code':0xc8,'result':_0x9e407d[_0x920c('0xa2')]?_0x9e407d['extra']:'-'};};String[_0x920c('0x10')]['replaceAll']=function(_0x41009f,_0x385b9d){return this[_0x920c('0xa0')](_0x41009f)[_0x920c('0x1c0')](_0x385b9d);};module[_0x920c('0x1c1')]=AGIVertices;
\ No newline at end of file
index e2729c6..ee1955c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a58=['syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','interface','queue','voiceQueues','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','[%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','updateAcw','timer','update','uniqueid','info','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','catch','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][STOP]\x20%s','syncAgentConnect','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','exports','moment','../ami','../../../config/logger','acw','../rpc/user','agents','timers','channels','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x9a58,0x137));var _0x89a5=function(_0x2eec1f,_0x1b9987){_0x2eec1f=_0x2eec1f-0x0;var _0x543075=_0x9a58[_0x2eec1f];return _0x543075;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x89a5('0x0'));var ami=require(_0x89a5('0x1'));var logger=require(_0x89a5('0x2'))(_0x89a5('0x3'));var RpcUser=require(_0x89a5('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x2721f9){this['voiceQueues']=_0x2721f9['voiceQueues'];this[_0x89a5('0x5')]=_0x2721f9[_0x89a5('0x5')];this['timers']=_0x2721f9[_0x89a5('0x6')];this[_0x89a5('0x7')]={};ami['on'](_0x89a5('0x8'),this['syncAgentConnect'][_0x89a5('0x9')](this));ami['on'](_0x89a5('0xa'),this[_0x89a5('0xb')]['bind'](this));ami['on'](_0x89a5('0xc'),this[_0x89a5('0xd')][_0x89a5('0x9')](this));ami['on'](_0x89a5('0xe'),this[_0x89a5('0xf')][_0x89a5('0x9')](this));ami['on'](_0x89a5('0x10'),this[_0x89a5('0x11')]['bind'](this));ami['on'](_0x89a5('0x12'),this[_0x89a5('0x13')][_0x89a5('0x9')](this));ami['on']('custom:agentConnectPreview',this[_0x89a5('0x14')][_0x89a5('0x9')](this));}function getDiff(_0xcad325){var _0x5b1208=moment()[_0x89a5('0x15')](0x0);var _0x2305d6=moment(_0xcad325)['milliseconds'](0x0);return _0x5b1208[_0x89a5('0x16')](_0x2305d6,_0x89a5('0x17'));}Acw[_0x89a5('0x18')]['startAcw']=function(_0x362f13){try{var _0x5be4ef=this;var _0x297ef8=this[_0x89a5('0x7')][_0x362f13][_0x89a5('0x19')];var _0x960a31=this['channels'][_0x362f13][_0x89a5('0x1a')];var _0x49bde4=this[_0x89a5('0x1b')][_0x960a31];var _0x394bd7=![];var _0x450397=_0x89a5('0x1c');if(_0x49bde4[_0x89a5('0x1d')]){if(_0x49bde4[_0x89a5('0x1e')][_0x89a5('0x1f')]){_0x394bd7=!![];_0x450397=_0x49bde4[_0x89a5('0x1e')][_0x89a5('0x1f')];}}ami['Action']({'action':_0x89a5('0x20'),'interface':_0x297ef8,'paused':!![],'reason':_0x450397})[_0x89a5('0x21')](function(_0x1e3ce6){if(_0x5be4ef[_0x89a5('0x5')][_0x297ef8]){return RpcUser[_0x89a5('0x22')](_0x5be4ef['agents'][_0x297ef8]['id'])['then'](function(_0x23eec5){if(_0x23eec5&&!_0x23eec5['voicePause']){logger['info'](_0x89a5('0x23'),_0x362f13,_0x297ef8,_0x960a31);var _0x3f70b2=_0x5be4ef[_0x89a5('0x7')][_0x362f13]['attended']&&_0x5be4ef['channels'][_0x362f13][_0x89a5('0x24')]?_0x5be4ef[_0x89a5('0x7')][_0x362f13]['destlinkedid']:_0x362f13;return RpcUser[_0x89a5('0x25')](_0x5be4ef[_0x89a5('0x5')][_0x297ef8],_0x450397,_0x3f70b2)[_0x89a5('0x21')](function(_0x4b9d1d){if(!_0x394bd7){_0x5be4ef[_0x89a5('0x6')][_0x297ef8]={};logger['info'](_0x89a5('0x26'),_0x362f13,_0x5be4ef[_0x89a5('0x1b')][_0x960a31][_0x89a5('0x27')],_0x297ef8,_0x960a31);_0x5be4ef[_0x89a5('0x6')][_0x297ef8]['timer']=setTimeout(_0x5be4ef[_0x89a5('0x28')][_0x89a5('0x9')](_0x5be4ef,_0x297ef8),_0x5be4ef['voiceQueues'][_0x960a31][_0x89a5('0x27')]*0x3e8);_0x5be4ef[_0x89a5('0x6')][_0x297ef8][_0x89a5('0x29')]=moment()[_0x89a5('0x2a')](_0x89a5('0x2b'));_0x5be4ef[_0x89a5('0x6')][_0x297ef8]['uniqueid']=_0x362f13;_0x5be4ef[_0x89a5('0x6')][_0x297ef8][_0x89a5('0x1a')]=_0x960a31;_0x5be4ef[_0x89a5('0x6')][_0x297ef8][_0x89a5('0x2c')]=function(){var _0x199f41=getDiff(_0x5be4ef['timers'][_0x297ef8]['lastPauseAt']);clearTimeout(_0x5be4ef[_0x89a5('0x6')][_0x297ef8][_0x89a5('0x2d')]);_0x5be4ef[_0x89a5('0x6')][_0x297ef8][_0x89a5('0x2d')]=![];RpcVoiceAgentReport[_0x89a5('0x2e')]({'acwtime':_0x199f41},_0x5be4ef['timers'][_0x297ef8][_0x89a5('0x2f')],_0x297ef8)[_0x89a5('0x21')](function(_0x13b41b){logger[_0x89a5('0x30')]('[%s][UPDATE][ACWTIME:%s]',_0x362f13,_0x199f41,_0x13b41b);})['catch'](function(_0x4fd01a){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x362f13,_0x4fd01a);});delete _0x5be4ef[_0x89a5('0x6')][_0x297ef8];};}});}else{logger['info'](_0x89a5('0x31'),_0x362f13,_0x297ef8,_0x960a31);}});}})['catch'](function(_0x542440){logger[_0x89a5('0x32')](_0x89a5('0x26'),_0x362f13,_0x5be4ef[_0x89a5('0x1b')][_0x960a31][_0x89a5('0x27')],_0x297ef8,_0x960a31);})['finally'](function(){delete _0x5be4ef['channels'][_0x362f13];});}catch(_0x1f4aad){logger['error']('[ACW][START]\x20%s',_0x1f4aad[_0x89a5('0x33')]);}};Acw[_0x89a5('0x18')][_0x89a5('0x28')]=function(_0x2f4f0f){try{var _0x13ff0e=this;if(_0x13ff0e[_0x89a5('0x6')][_0x2f4f0f]){_0x13ff0e['timers'][_0x2f4f0f][_0x89a5('0x2d')]=![];var _0x29f8d1=_0x13ff0e[_0x89a5('0x6')][_0x2f4f0f][_0x89a5('0x2f')];var _0x454390=_0x13ff0e['timers'][_0x2f4f0f]['queue'];var _0x1a2a25=_0x13ff0e[_0x89a5('0x1b')][_0x454390][_0x89a5('0x27')];logger[_0x89a5('0x30')](_0x89a5('0x34'),_0x29f8d1,_0x2f4f0f);RpcUser[_0x89a5('0x35')](this[_0x89a5('0x5')][_0x2f4f0f]);RpcVoiceAgentReport[_0x89a5('0x2e')]({'acwtime':_0x1a2a25,'agentacw':!![]},_0x29f8d1,_0x2f4f0f)['then'](function(_0x420e01){logger[_0x89a5('0x30')]('[%s][UPDATE][ACWTIME:%s]',_0x29f8d1,_0x1a2a25,_0x420e01);})[_0x89a5('0x36')](function(_0x482a8f){logger['error'](_0x89a5('0x37'),_0x29f8d1,_0x482a8f);});}else{logger['error'](_0x89a5('0x38'),_0x2f4f0f);if(_0x13ff0e[_0x89a5('0x6')]){logger[_0x89a5('0x30')]('[ACW][TIMERS]',JSON['stringify'](_0x13ff0e[_0x89a5('0x6')]));}}}catch(_0x5b0d1d){logger[_0x89a5('0x32')](_0x89a5('0x39'),_0x5b0d1d[_0x89a5('0x33')]);}};Acw[_0x89a5('0x18')][_0x89a5('0x3a')]=function(_0x697d26){try{if(this[_0x89a5('0x1b')][_0x697d26[_0x89a5('0x1a')]]&&(this[_0x89a5('0x1b')][_0x697d26[_0x89a5('0x1a')]][_0x89a5('0x3')]||this[_0x89a5('0x1b')][_0x697d26[_0x89a5('0x1a')]][_0x89a5('0x1d')])){if(this[_0x89a5('0x5')][_0x697d26[_0x89a5('0x19')]]){this[_0x89a5('0x7')][_0x697d26[_0x89a5('0x2f')]]={'queue':_0x697d26[_0x89a5('0x1a')],'interface':_0x697d26[_0x89a5('0x19')],'destlinkedid':_0x697d26[_0x89a5('0x24')]};}}}catch(_0x43bf58){logger[_0x89a5('0x32')](_0x89a5('0x3b'),_0x43bf58[_0x89a5('0x33')]);}};Acw[_0x89a5('0x18')][_0x89a5('0x14')]=function(_0x542240){try{if(this['voiceQueues'][_0x542240['queue']]&&(this['voiceQueues'][_0x542240[_0x89a5('0x1a')]][_0x89a5('0x3')]||this[_0x89a5('0x1b')][_0x542240['queue']][_0x89a5('0x1d')])){if(this[_0x89a5('0x5')][_0x542240[_0x89a5('0x19')]]){this[_0x89a5('0x7')][_0x542240[_0x89a5('0x2f')]]={'queue':_0x542240[_0x89a5('0x1a')],'interface':_0x542240[_0x89a5('0x19')]};}}}catch(_0x3eddee){logger[_0x89a5('0x32')](_0x89a5('0x3c'),_0x3eddee['message']);}};Acw[_0x89a5('0x18')][_0x89a5('0xb')]=function(_0x29f73f){try{if(this[_0x89a5('0x7')][_0x29f73f[_0x89a5('0x2f')]]&&_[_0x89a5('0x3d')](this[_0x89a5('0x7')][_0x29f73f[_0x89a5('0x2f')]][_0x89a5('0x3e')])){logger[_0x89a5('0x30')](_0x89a5('0x3f'),_0x29f73f['uniqueid']);this[_0x89a5('0x40')](_0x29f73f[_0x89a5('0x2f')]);}else if(this['channels'][_0x29f73f['linkedid']]&&_['isUndefined'](this[_0x89a5('0x7')][_0x29f73f[_0x89a5('0x41')]]['attended'])){logger[_0x89a5('0x30')](_0x89a5('0x42'),_0x29f73f[_0x89a5('0x41')]);this['startAcw'](_0x29f73f[_0x89a5('0x41')]);}}catch(_0x2733b0){logger[_0x89a5('0x32')]('[ACW][syncHangupRequest]\x20%s',_0x2733b0[_0x89a5('0x33')]);}};Acw[_0x89a5('0x18')][_0x89a5('0xd')]=function(_0x2a2e76){try{if(this[_0x89a5('0x7')][_0x2a2e76[_0x89a5('0x2f')]]&&this['channels'][_0x2a2e76[_0x89a5('0x2f')]][_0x89a5('0x3e')]){logger['info'](_0x89a5('0x43'),_0x2a2e76[_0x89a5('0x2f')]);this[_0x89a5('0x40')](_0x2a2e76[_0x89a5('0x2f')]);}else if(this['channels'][_0x2a2e76['linkedid']]&&this[_0x89a5('0x7')][_0x2a2e76[_0x89a5('0x41')]][_0x89a5('0x3e')]){logger[_0x89a5('0x30')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x2a2e76[_0x89a5('0x41')]);this[_0x89a5('0x40')](_0x2a2e76[_0x89a5('0x41')]);}}catch(_0x28cc07){logger['error']('[ACW][syncHangup]\x20%s',_0x28cc07['message']);}};Acw[_0x89a5('0x18')]['syncAttendedTransfer']=function(_0x568125){try{if(!_[_0x89a5('0x44')](this[_0x89a5('0x7')][_0x568125[_0x89a5('0x45')]])){this[_0x89a5('0x40')](_0x568125[_0x89a5('0x45')]);if(this[_0x89a5('0x7')][_0x568125[_0x89a5('0x46')]]){this[_0x89a5('0x7')][_0x568125['secondtransfereruniqueid']][_0x89a5('0x3e')]=!![];this[_0x89a5('0x7')][_0x568125['transfertargetuniqueid']]=this[_0x89a5('0x7')][_0x568125[_0x89a5('0x46')]];delete this[_0x89a5('0x7')][_0x568125['secondtransfereruniqueid']];}}else if(!_[_0x89a5('0x44')](this[_0x89a5('0x7')][_0x568125[_0x89a5('0x47')]])){this[_0x89a5('0x40')](_0x568125[_0x89a5('0x47')]);if(this[_0x89a5('0x7')][_0x568125['origtransfereruniqueid']]){this[_0x89a5('0x7')][_0x568125[_0x89a5('0x48')]][_0x89a5('0x3e')]=!![];this['channels'][_0x568125[_0x89a5('0x45')]]=this['channels'][_0x568125[_0x89a5('0x48')]];delete this[_0x89a5('0x7')][_0x568125[_0x89a5('0x48')]];}}}catch(_0x56c154){logger[_0x89a5('0x32')]('[ACW][syncAttendedTransfer]\x20%s',_0x56c154[_0x89a5('0x33')]);}};Acw[_0x89a5('0x18')][_0x89a5('0x13')]=function(_0x1ef2bc){try{if(this[_0x89a5('0x7')][_0x1ef2bc[_0x89a5('0x49')]]){logger[_0x89a5('0x30')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x89a5('0x4a')](_0x1ef2bc[_0x89a5('0x49')]));this[_0x89a5('0x40')](_0x1ef2bc['transfereruniqueid']);}else if(this['channels'][_0x1ef2bc[_0x89a5('0x4b')]]){logger['info'](_0x89a5('0x4c'),JSON[_0x89a5('0x4a')](_0x1ef2bc[_0x89a5('0x4b')]));this[_0x89a5('0x40')](_0x1ef2bc[_0x89a5('0x4b')]);}}catch(_0x3d759f){logger[_0x89a5('0x32')](_0x89a5('0x4d'),_0x3d759f[_0x89a5('0x33')]);}};Acw['prototype'][_0x89a5('0xf')]=function(_0xc5ded4){try{if(this[_0x89a5('0x1b')][_0xc5ded4[_0x89a5('0x1a')]]&&this[_0x89a5('0x1b')][_0xc5ded4['queue']][_0x89a5('0x4e')]==='all'){if(this[_0x89a5('0x5')][_0xc5ded4[_0x89a5('0x19')]]){logger['info'](_0x89a5('0x4f'),_0xc5ded4[_0x89a5('0x2f')],_0xc5ded4[_0x89a5('0x19')],_0xc5ded4[_0x89a5('0x1a')]);return RpcUser[_0x89a5('0x25')](this['agents'][_0xc5ded4[_0x89a5('0x19')]],'Auto-Pause',_0xc5ded4[_0x89a5('0x2f')]);}}}catch(_0x3200ac){logger[_0x89a5('0x32')](_0x89a5('0x50'),_0x3200ac[_0x89a5('0x33')]);}};module[_0x89a5('0x51')]=Acw;
\ No newline at end of file
+var _0xb05e=['saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','prototype','startAcw','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','info','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','updateAcw','update','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','message','queue','[%s][TIMER][STOP][AGENT:%s]'];(function(_0x1f62a2,_0x5d4af9){var _0x493672=function(_0x5a0441){while(--_0x5a0441){_0x1f62a2['push'](_0x1f62a2['shift']());}};_0x493672(++_0x5d4af9);}(_0xb05e,0x71));var _0xeb05=function(_0x49df50,_0x54c2e6){_0x49df50=_0x49df50-0x0;var _0x2419b0=_0xb05e[_0x49df50];return _0x2419b0;};'use strict';var util=require(_0xeb05('0x0'));var _=require(_0xeb05('0x1'));var moment=require(_0xeb05('0x2'));var ami=require('../ami');var logger=require('../../../config/logger')(_0xeb05('0x3'));var RpcUser=require(_0xeb05('0x4'));var RpcVoiceAgentReport=require(_0xeb05('0x5'));function Acw(_0x548823){this[_0xeb05('0x6')]=_0x548823[_0xeb05('0x6')];this[_0xeb05('0x7')]=_0x548823[_0xeb05('0x7')];this[_0xeb05('0x8')]=_0x548823['timers'];this[_0xeb05('0x9')]={};ami['on'](_0xeb05('0xa'),this[_0xeb05('0xb')][_0xeb05('0xc')](this));ami['on'](_0xeb05('0xd'),this[_0xeb05('0xe')][_0xeb05('0xc')](this));ami['on'](_0xeb05('0xf'),this['syncHangup'][_0xeb05('0xc')](this));ami['on'](_0xeb05('0x10'),this[_0xeb05('0x11')][_0xeb05('0xc')](this));ami['on'](_0xeb05('0x12'),this[_0xeb05('0x13')][_0xeb05('0xc')](this));ami['on']('blindtransfer',this[_0xeb05('0x14')][_0xeb05('0xc')](this));ami['on'](_0xeb05('0x15'),this[_0xeb05('0x16')][_0xeb05('0xc')](this));}function getDiff(_0x46047e){var _0x47cc6d=moment()[_0xeb05('0x17')](0x0);var _0x5d4afa=moment(_0x46047e)[_0xeb05('0x17')](0x0);return _0x47cc6d['diff'](_0x5d4afa,'seconds');}Acw[_0xeb05('0x18')][_0xeb05('0x19')]=function(_0x24b3a0){try{var _0x191b8b=this;var _0x435efb=this[_0xeb05('0x9')][_0x24b3a0][_0xeb05('0x1a')];var _0x30276d=this[_0xeb05('0x9')][_0x24b3a0]['queue'];var _0x516aa9=this[_0xeb05('0x6')][_0x30276d];var _0x5789fe=![];var _0x98f705=_0xeb05('0x1b');if(_0x516aa9[_0xeb05('0x1c')]){if(_0x516aa9[_0xeb05('0x1d')][_0xeb05('0x1e')]){_0x5789fe=!![];_0x98f705=_0x516aa9[_0xeb05('0x1d')]['name'];}}ami['Action']({'action':_0xeb05('0x1f'),'interface':_0x435efb,'paused':!![],'reason':_0x98f705})[_0xeb05('0x20')](function(_0x5d39aa){if(_0x191b8b[_0xeb05('0x7')][_0x435efb]){return RpcUser[_0xeb05('0x21')](_0x191b8b[_0xeb05('0x7')][_0x435efb]['id'])[_0xeb05('0x20')](function(_0xb5cc77){if(_0xb5cc77&&!_0xb5cc77['voicePause']){logger[_0xeb05('0x22')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x24b3a0,_0x435efb,_0x30276d);var _0x1e0590=_0x191b8b[_0xeb05('0x9')][_0x24b3a0][_0xeb05('0x23')]&&_0x191b8b[_0xeb05('0x9')][_0x24b3a0]['destlinkedid']?_0x191b8b[_0xeb05('0x9')][_0x24b3a0][_0xeb05('0x24')]:_0x24b3a0;return RpcUser[_0xeb05('0x25')](_0x191b8b['agents'][_0x435efb],_0x98f705,_0x1e0590)[_0xeb05('0x20')](function(_0x84f536){if(!_0x5789fe){_0x191b8b['timers'][_0x435efb]={};logger['info'](_0xeb05('0x26'),_0x24b3a0,_0x191b8b[_0xeb05('0x6')][_0x30276d][_0xeb05('0x27')],_0x435efb,_0x30276d);_0x191b8b[_0xeb05('0x8')][_0x435efb][_0xeb05('0x28')]=setTimeout(_0x191b8b[_0xeb05('0x29')][_0xeb05('0xc')](_0x191b8b,_0x435efb),_0x191b8b[_0xeb05('0x6')][_0x30276d][_0xeb05('0x27')]*0x3e8);_0x191b8b[_0xeb05('0x8')][_0x435efb][_0xeb05('0x2a')]=moment()['format'](_0xeb05('0x2b'));_0x191b8b[_0xeb05('0x8')][_0x435efb]['uniqueid']=_0x24b3a0;_0x191b8b['timers'][_0x435efb]['queue']=_0x30276d;_0x191b8b[_0xeb05('0x8')][_0x435efb][_0xeb05('0x2c')]=function(){var _0xce29d4=getDiff(_0x191b8b[_0xeb05('0x8')][_0x435efb][_0xeb05('0x2a')]);clearTimeout(_0x191b8b[_0xeb05('0x8')][_0x435efb][_0xeb05('0x28')]);_0x191b8b[_0xeb05('0x8')][_0x435efb][_0xeb05('0x28')]=![];RpcVoiceAgentReport[_0xeb05('0x2d')]({'acwtime':_0xce29d4},_0x191b8b['timers'][_0x435efb][_0xeb05('0x2e')],_0x435efb)[_0xeb05('0x20')](function(_0x5caf94){logger[_0xeb05('0x22')](_0xeb05('0x2f'),_0x24b3a0,_0xce29d4,_0x5caf94);})[_0xeb05('0x30')](function(_0x4cb47c){logger[_0xeb05('0x31')](_0xeb05('0x32'),_0x24b3a0,_0x4cb47c);});delete _0x191b8b[_0xeb05('0x8')][_0x435efb];};}});}else{logger[_0xeb05('0x22')](_0xeb05('0x33'),_0x24b3a0,_0x435efb,_0x30276d);}});}})[_0xeb05('0x30')](function(_0x138a1e){logger['error']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x24b3a0,_0x191b8b[_0xeb05('0x6')][_0x30276d][_0xeb05('0x27')],_0x435efb,_0x30276d);})['finally'](function(){delete _0x191b8b[_0xeb05('0x9')][_0x24b3a0];});}catch(_0x13a7b3){logger[_0xeb05('0x31')]('[ACW][START]\x20%s',_0x13a7b3[_0xeb05('0x34')]);}};Acw[_0xeb05('0x18')][_0xeb05('0x29')]=function(_0xba7feb){try{var _0x2eb604=this;if(_0x2eb604['timers'][_0xba7feb]){_0x2eb604[_0xeb05('0x8')][_0xba7feb][_0xeb05('0x28')]=![];var _0x4b59c2=_0x2eb604[_0xeb05('0x8')][_0xba7feb]['uniqueid'];var _0x3810d8=_0x2eb604['timers'][_0xba7feb][_0xeb05('0x35')];var _0x182394=_0x2eb604[_0xeb05('0x6')][_0x3810d8][_0xeb05('0x27')];logger[_0xeb05('0x22')](_0xeb05('0x36'),_0x4b59c2,_0xba7feb);RpcUser[_0xeb05('0x37')](this['agents'][_0xba7feb]);RpcVoiceAgentReport[_0xeb05('0x2d')]({'acwtime':_0x182394,'agentacw':!![]},_0x4b59c2,_0xba7feb)[_0xeb05('0x20')](function(_0x337c29){logger[_0xeb05('0x22')]('[%s][UPDATE][ACWTIME:%s]',_0x4b59c2,_0x182394,_0x337c29);})[_0xeb05('0x30')](function(_0x1f7d07){logger[_0xeb05('0x31')](_0xeb05('0x32'),_0x4b59c2,_0x1f7d07);});}else{logger[_0xeb05('0x31')](_0xeb05('0x38'),_0xba7feb);if(_0x2eb604[_0xeb05('0x8')]){logger['info'](_0xeb05('0x39'),JSON[_0xeb05('0x3a')](_0x2eb604[_0xeb05('0x8')]));}}}catch(_0x163468){logger[_0xeb05('0x31')](_0xeb05('0x3b'),_0x163468[_0xeb05('0x34')]);}};Acw['prototype']['syncAgentConnect']=function(_0x1af6ef){try{if(this['voiceQueues'][_0x1af6ef['queue']]&&(this[_0xeb05('0x6')][_0x1af6ef[_0xeb05('0x35')]][_0xeb05('0x3')]||this[_0xeb05('0x6')][_0x1af6ef[_0xeb05('0x35')]][_0xeb05('0x1c')])){if(this[_0xeb05('0x7')][_0x1af6ef[_0xeb05('0x1a')]]){this[_0xeb05('0x9')][_0x1af6ef['uniqueid']]={'queue':_0x1af6ef['queue'],'interface':_0x1af6ef[_0xeb05('0x1a')],'destlinkedid':_0x1af6ef[_0xeb05('0x24')]};}}}catch(_0x441523){logger[_0xeb05('0x31')](_0xeb05('0x3c'),_0x441523[_0xeb05('0x34')]);}};Acw['prototype'][_0xeb05('0x16')]=function(_0x4e496f){try{if(this[_0xeb05('0x6')][_0x4e496f[_0xeb05('0x35')]]&&(this['voiceQueues'][_0x4e496f[_0xeb05('0x35')]][_0xeb05('0x3')]||this[_0xeb05('0x6')][_0x4e496f[_0xeb05('0x35')]][_0xeb05('0x1c')])){if(this['agents'][_0x4e496f[_0xeb05('0x1a')]]){this['channels'][_0x4e496f[_0xeb05('0x2e')]]={'queue':_0x4e496f[_0xeb05('0x35')],'interface':_0x4e496f[_0xeb05('0x1a')]};}}}catch(_0x10e901){logger[_0xeb05('0x31')](_0xeb05('0x3d'),_0x10e901[_0xeb05('0x34')]);}};Acw[_0xeb05('0x18')][_0xeb05('0xe')]=function(_0x2eba96){try{if(this[_0xeb05('0x9')][_0x2eba96[_0xeb05('0x2e')]]&&_[_0xeb05('0x3e')](this[_0xeb05('0x9')][_0x2eba96[_0xeb05('0x2e')]]['attended'])){logger[_0xeb05('0x22')](_0xeb05('0x3f'),_0x2eba96['uniqueid']);this[_0xeb05('0x19')](_0x2eba96[_0xeb05('0x2e')]);}else if(this[_0xeb05('0x9')][_0x2eba96[_0xeb05('0x40')]]&&_[_0xeb05('0x3e')](this['channels'][_0x2eba96['linkedid']][_0xeb05('0x23')])){logger[_0xeb05('0x22')](_0xeb05('0x41'),_0x2eba96['linkedid']);this['startAcw'](_0x2eba96['linkedid']);}}catch(_0x37a666){logger[_0xeb05('0x31')]('[ACW][syncHangupRequest]\x20%s',_0x37a666[_0xeb05('0x34')]);}};Acw[_0xeb05('0x18')][_0xeb05('0x42')]=function(_0x49c31){try{if(this[_0xeb05('0x9')][_0x49c31[_0xeb05('0x2e')]]&&this[_0xeb05('0x9')][_0x49c31[_0xeb05('0x2e')]][_0xeb05('0x23')]){logger['info'](_0xeb05('0x43'),_0x49c31[_0xeb05('0x2e')]);this['startAcw'](_0x49c31['uniqueid']);}else if(this[_0xeb05('0x9')][_0x49c31[_0xeb05('0x40')]]&&this[_0xeb05('0x9')][_0x49c31['linkedid']][_0xeb05('0x23')]){logger[_0xeb05('0x22')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x49c31['linkedid']);this[_0xeb05('0x19')](_0x49c31[_0xeb05('0x40')]);}}catch(_0x1940cb){logger[_0xeb05('0x31')]('[ACW][syncHangup]\x20%s',_0x1940cb[_0xeb05('0x34')]);}};Acw['prototype'][_0xeb05('0x13')]=function(_0x4b7f24){try{if(!_[_0xeb05('0x44')](this[_0xeb05('0x9')][_0x4b7f24[_0xeb05('0x45')]])){this['startAcw'](_0x4b7f24['transfereeuniqueid']);if(this[_0xeb05('0x9')][_0x4b7f24[_0xeb05('0x46')]]){this[_0xeb05('0x9')][_0x4b7f24[_0xeb05('0x46')]]['attended']=!![];this[_0xeb05('0x9')][_0x4b7f24[_0xeb05('0x47')]]=this[_0xeb05('0x9')][_0x4b7f24[_0xeb05('0x46')]];delete this['channels'][_0x4b7f24['secondtransfereruniqueid']];}}else if(!_[_0xeb05('0x44')](this[_0xeb05('0x9')][_0x4b7f24[_0xeb05('0x47')]])){this[_0xeb05('0x19')](_0x4b7f24[_0xeb05('0x47')]);if(this[_0xeb05('0x9')][_0x4b7f24[_0xeb05('0x48')]]){this[_0xeb05('0x9')][_0x4b7f24[_0xeb05('0x48')]]['attended']=!![];this[_0xeb05('0x9')][_0x4b7f24[_0xeb05('0x45')]]=this[_0xeb05('0x9')][_0x4b7f24[_0xeb05('0x48')]];delete this[_0xeb05('0x9')][_0x4b7f24[_0xeb05('0x48')]];}}}catch(_0x16f0ad){logger['error'](_0xeb05('0x49'),_0x16f0ad[_0xeb05('0x34')]);}};Acw[_0xeb05('0x18')][_0xeb05('0x14')]=function(_0x1b381e){try{if(this['channels'][_0x1b381e['transfereruniqueid']]){logger[_0xeb05('0x22')](_0xeb05('0x4a'),JSON[_0xeb05('0x3a')](_0x1b381e['transfereruniqueid']));this['startAcw'](_0x1b381e[_0xeb05('0x4b')]);}else if(this['channels'][_0x1b381e[_0xeb05('0x4c')]]){logger[_0xeb05('0x22')](_0xeb05('0x4d'),JSON[_0xeb05('0x3a')](_0x1b381e[_0xeb05('0x4c')]));this[_0xeb05('0x19')](_0x1b381e[_0xeb05('0x4c')]);}}catch(_0x2260c8){logger['error']('[ACW][syncBlindTransfer]\x20%s',_0x2260c8[_0xeb05('0x34')]);}};Acw['prototype']['syncAgentRingNoAnswer']=function(_0x111480){try{if(this[_0xeb05('0x6')][_0x111480['queue']]&&this[_0xeb05('0x6')][_0x111480[_0xeb05('0x35')]][_0xeb05('0x4e')]===_0xeb05('0x4f')){if(this[_0xeb05('0x7')][_0x111480[_0xeb05('0x1a')]]){logger[_0xeb05('0x22')](_0xeb05('0x50'),_0x111480[_0xeb05('0x2e')],_0x111480['interface'],_0x111480[_0xeb05('0x35')]);return RpcUser[_0xeb05('0x25')](this[_0xeb05('0x7')][_0x111480[_0xeb05('0x1a')]],_0xeb05('0x51'),_0x111480['uniqueid']);}}}catch(_0x2f9e33){logger['error'](_0xeb05('0x52'),_0x2f9e33[_0xeb05('0x34')]);}};module[_0xeb05('0x53')]=Acw;
\ No newline at end of file
index 3ca3aed..a628f11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0960=['fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','actionDeviceStateList','actionQueueSummary','then','log','once','exports','asterisk-manager','moment','lodash','../../config/logger','asterisk','port','username','password','Action','promisify','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','error','actionSipShowRegistry','sipshowregistry','devicestatelist','actionSipPeerStatus','sippeerstatus','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s'];(function(_0x525af9,_0x4edd23){var _0x129fbf=function(_0x4f44fe){while(--_0x4f44fe){_0x525af9['push'](_0x525af9['shift']());}};_0x129fbf(++_0x4edd23);}(_0x0960,0x15c));var _0x0096=function(_0xa9df71,_0x1a06c9){_0xa9df71=_0xa9df71-0x0;var _0x3cfa15=_0x0960[_0xa9df71];return _0x3cfa15;};'use strict';var Manager=require(_0x0096('0x0'));var BPromise=require('bluebird');var moment=require(_0x0096('0x1'));var util=require('util');var _=require(_0x0096('0x2'));var logger=require(_0x0096('0x3'))('ami');var config=require('../../config/environment');var ami=new Manager(config[_0x0096('0x4')][_0x0096('0x5')],config[_0x0096('0x4')]['ip'],config[_0x0096('0x4')][_0x0096('0x6')],config['asterisk'][_0x0096('0x7')],!![]);ami['keepConnected']();ami[_0x0096('0x8')]=BPromise[_0x0096('0x9')](ami['action']);function error(_0x2b92ef){logger['error'](util[_0x0096('0xa')](_0x0096('0xb'),config[_0x0096('0x4')][_0x0096('0x6')],config[_0x0096('0x4')]['ip'],config['asterisk'][_0x0096('0x5')],util['inspect'](_0x2b92ef,![],null)));}function close(){logger[_0x0096('0xc')](util[_0x0096('0xa')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x0096('0x4')][_0x0096('0x6')],config['asterisk']['ip'],config[_0x0096('0x4')][_0x0096('0x5')]));}ami[_0x0096('0xd')]=function(){return function(){return ami[_0x0096('0x8')]({'action':_0x0096('0xe')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x0096('0x8')]({'action':_0x0096('0xf')});};};ami[_0x0096('0x10')]=function(){return function(){return ami['Action']({'action':_0x0096('0x11')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':'queuesummary'});};};ami[_0x0096('0x12')]=function(){return function(){return ami[_0x0096('0x8')]({'action':_0x0096('0x13')});};};function connect(_0x37e4a7){logger[_0x0096('0x14')](util[_0x0096('0xa')](_0x0096('0x15'),config[_0x0096('0x4')][_0x0096('0x6')],config['asterisk']['ip'],config[_0x0096('0x4')]['port']));ami['once'](_0x0096('0xc'),error);ami['once'](_0x0096('0x16'),close);}ami['on'](_0x0096('0x17'),connect);ami['on'](_0x0096('0x18'),function(_0x2f6854){logger[_0x0096('0x14')](util[_0x0096('0xa')](_0x0096('0x19'),config[_0x0096('0x4')][_0x0096('0x6')],config['asterisk']['ip'],config[_0x0096('0x4')][_0x0096('0x5')],util['inspect'](_0x2f6854,![],null)));});ami['on'](_0x0096('0x1a'),function(_0x14b7c0){logger[_0x0096('0x14')](util['format'](_0x0096('0x1b'),config[_0x0096('0x4')]['username'],config['asterisk']['ip'],config['asterisk'][_0x0096('0x5')]));return BPromise['resolve']()['then'](ami[_0x0096('0xd')]())['then'](ami[_0x0096('0x1c')]())['then'](ami[_0x0096('0x10')]())['then'](ami[_0x0096('0x1d')]())[_0x0096('0x1e')](ami[_0x0096('0x12')]())['catch'](function(_0x3f653e){console[_0x0096('0x1f')](_0x3f653e);});});ami[_0x0096('0x20')]('error',error);ami['once'](_0x0096('0x16'),close);module[_0x0096('0x21')]=ami;
\ No newline at end of file
+var _0x5fe0=['queuesummary','actionCoreShowChannels','coreshowchannels','info','format','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','shutdown','fullybooted','then','actionDeviceStateList','exports','asterisk-manager','bluebird','util','lodash','../../config/environment','port','asterisk','username','password','Action','promisify','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','actionSipShowRegistry','sipshowregistry','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary'];(function(_0x4d67b8,_0x565134){var _0x55af3b=function(_0x145904){while(--_0x145904){_0x4d67b8['push'](_0x4d67b8['shift']());}};_0x55af3b(++_0x565134);}(_0x5fe0,0x13f));var _0x05fe=function(_0x31a106,_0x1ff9c0){_0x31a106=_0x31a106-0x0;var _0x5ea003=_0x5fe0[_0x31a106];return _0x5ea003;};'use strict';var Manager=require(_0x05fe('0x0'));var BPromise=require(_0x05fe('0x1'));var moment=require('moment');var util=require(_0x05fe('0x2'));var _=require(_0x05fe('0x3'));var logger=require('../../config/logger')('ami');var config=require(_0x05fe('0x4'));var ami=new Manager(config['asterisk'][_0x05fe('0x5')],config[_0x05fe('0x6')]['ip'],config['asterisk'][_0x05fe('0x7')],config[_0x05fe('0x6')][_0x05fe('0x8')],!![]);ami['keepConnected']();ami[_0x05fe('0x9')]=BPromise[_0x05fe('0xa')](ami['action']);function error(_0x29ebc1){logger[_0x05fe('0xb')](util['format'](_0x05fe('0xc'),config[_0x05fe('0x6')]['username'],config['asterisk']['ip'],config[_0x05fe('0x6')]['port'],util[_0x05fe('0xd')](_0x29ebc1,![],null)));}function close(){logger[_0x05fe('0xb')](util['format'](_0x05fe('0xe'),config[_0x05fe('0x6')][_0x05fe('0x7')],config[_0x05fe('0x6')]['ip'],config[_0x05fe('0x6')]['port']));}ami[_0x05fe('0xf')]=function(){return function(){return ami['Action']({'action':_0x05fe('0x10')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x05fe('0x9')]({'action':_0x05fe('0x11')});};};ami[_0x05fe('0x12')]=function(){return function(){return ami['Action']({'action':_0x05fe('0x13')});};};ami[_0x05fe('0x14')]=function(){return function(){return ami['Action']({'action':_0x05fe('0x15')});};};ami[_0x05fe('0x16')]=function(){return function(){return ami[_0x05fe('0x9')]({'action':_0x05fe('0x17')});};};function connect(_0x391527){logger[_0x05fe('0x18')](util[_0x05fe('0x19')](_0x05fe('0x1a'),config[_0x05fe('0x6')][_0x05fe('0x7')],config[_0x05fe('0x6')]['ip'],config[_0x05fe('0x6')][_0x05fe('0x5')]));ami['once'](_0x05fe('0xb'),error);ami[_0x05fe('0x1b')](_0x05fe('0x1c'),close);}ami['on']('connect',connect);ami['on'](_0x05fe('0x1d'),function(_0x2a4bad){logger[_0x05fe('0x18')](util['format']('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0x05fe('0x6')]['username'],config[_0x05fe('0x6')]['ip'],config['asterisk'][_0x05fe('0x5')],util[_0x05fe('0xd')](_0x2a4bad,![],null)));});ami['on'](_0x05fe('0x1e'),function(_0x487b31){logger[_0x05fe('0x18')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x05fe('0x6')]['username'],config[_0x05fe('0x6')]['ip'],config[_0x05fe('0x6')]['port']));return BPromise['resolve']()[_0x05fe('0x1f')](ami[_0x05fe('0xf')]())[_0x05fe('0x1f')](ami[_0x05fe('0x20')]())[_0x05fe('0x1f')](ami[_0x05fe('0x12')]())[_0x05fe('0x1f')](ami[_0x05fe('0x14')]())[_0x05fe('0x1f')](ami[_0x05fe('0x16')]())['catch'](function(_0x30abf6){console['log'](_0x30abf6);});});ami[_0x05fe('0x1b')]('error',error);ami[_0x05fe('0x1b')](_0x05fe('0x1c'),close);module[_0x05fe('0x21')]=ami;
\ No newline at end of file
index 1298835..43f691a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdb7=['result','catch','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','debug','error','message'];(function(_0x5e0899,_0x5919e0){var _0x57c743=function(_0x4e65a4){while(--_0x4e65a4){_0x5e0899['push'](_0x5e0899['shift']());}};_0x57c743(++_0x5919e0);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x348ca1,_0x429707){_0x348ca1=_0x348ca1-0x0;var _0x466322=_0xbdb7[_0x348ca1];return _0x466322;};'use strict';var jayson=require(_0x7bdb('0x0'));var BPromise=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var client=jayson[_0x7bdb('0x4')][_0x7bdb('0x5')]({'port':0x2329});client[_0x7bdb('0x6')]=function(_0x2c7e07,_0x46c068){return new BPromise(function(_0x47aec5,_0x28542c){return client['request'](_0x2c7e07,_0x46c068)['then'](function(_0xffdc86){logger[_0x7bdb('0x7')]('rpc','memberReport',_0x2c7e07,_0x46c068,_0xffdc86);if(_0xffdc86[_0x7bdb('0x8')]){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')],_0x46c068);return _0x28542c(_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')]);}else{return _0x47aec5(_0xffdc86[_0x7bdb('0xa')]);}})[_0x7bdb('0xb')](function(_0x297724){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0x297724,_0x46c068);return _0x28542c(_0x297724);});});};module['exports']=client;
\ No newline at end of file
+var _0xac4a=['ami','client','http','then','debug','memberReport','error','message','result','catch','rpc','jayson/promise','bluebird','../../config/logger'];(function(_0x5baed9,_0x409757){var _0x43aad3=function(_0x4e6713){while(--_0x4e6713){_0x5baed9['push'](_0x5baed9['shift']());}};_0x43aad3(++_0x409757);}(_0xac4a,0x13f));var _0xaac4=function(_0x56aa8c,_0x4eee90){_0x56aa8c=_0x56aa8c-0x0;var _0x369238=_0xac4a[_0x56aa8c];return _0x369238;};'use strict';var jayson=require(_0xaac4('0x0'));var BPromise=require(_0xaac4('0x1'));var logger=require(_0xaac4('0x2'))(_0xaac4('0x3'));var client=jayson[_0xaac4('0x4')][_0xaac4('0x5')]({'port':0x2329});client['Request']=function(_0x58626e,_0x2af0f6){return new BPromise(function(_0x2a5762,_0x32d34c){return client['request'](_0x58626e,_0x2af0f6)[_0xaac4('0x6')](function(_0x53d03a){logger[_0xaac4('0x7')]('rpc',_0xaac4('0x8'),_0x58626e,_0x2af0f6,_0x53d03a);if(_0x53d03a[_0xaac4('0x9')]){logger['error']('rpc',_0xaac4('0x8'),_0x58626e,_0x53d03a['error'][_0xaac4('0xa')],_0x2af0f6);return _0x32d34c(_0x53d03a['error']['message']);}else{return _0x2a5762(_0x53d03a[_0xaac4('0xb')]);}})[_0xaac4('0xc')](function(_0x38d1d0){logger[_0xaac4('0x9')](_0xaac4('0xd'),'memberReport',_0x58626e,_0x38d1d0,_0x2af0f6);return _0x32d34c(_0x38d1d0);});});};module['exports']=client;
\ No newline at end of file
index db295d6..31063a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa4d=['dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','getQueue','queue','exports','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','active','type'];(function(_0x1d05ef,_0x1df6a8){var _0x1436eb=function(_0x49b1ec){while(--_0x49b1ec){_0x1d05ef['push'](_0x1d05ef['shift']());}};_0x1436eb(++_0x1df6a8);}(_0xfa4d,0x122));var _0xdfa4=function(_0x1cc6a0,_0x409da3){_0x1cc6a0=_0x1cc6a0-0x0;var _0x28e566=_0xfa4d[_0x1cc6a0];return _0x28e566;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x5e1b9c,_0x25e0e5,_0x17a707){var _0x439337='';if(!_[_0xdfa4('0x0')](_0x25e0e5)&&_0xdfa4('0x1')===typeof _0x25e0e5){_0x439337+=_0x25e0e5;}if(!_['isNil'](_0x17a707)&&_0xdfa4('0x1')===typeof _0x17a707){_0x439337+='\x20'+_0x17a707;}if(_0x439337!==''){return _0x439337;}return _0x5e1b9c;}function Action(_0xc7ca03,_0x283b40,_0x16f30b){this[_0xdfa4('0x2')]=_0xc7ca03;this[_0xdfa4('0x3')]=_0x16f30b||undefined;this[_0xdfa4('0x4')]=checkNameSurname(_0x283b40[_0xdfa4('0x5')][_0xdfa4('0x6')],_0x283b40[_0xdfa4('0x5')][_0xdfa4('0x7')],_0x283b40[_0xdfa4('0x5')][_0xdfa4('0x8')]);this['number']=_0x283b40[_0xdfa4('0x5')][_0xdfa4('0x6')];this['queue']=_0xc7ca03[_0xdfa4('0x4')];this[_0xdfa4('0x9')]=_0x283b40[_0xdfa4('0x9')]||![];this['type']=_0xc7ca03[_0xdfa4('0xa')];this[_0xdfa4('0xb')]=_0xc7ca03[_0xdfa4('0xb')]||0x3;this[_0xdfa4('0xc')]=_0x283b40[_0xdfa4('0xc')];this['countbusyretry']=_0x283b40[_0xdfa4('0xd')];this[_0xdfa4('0xe')]=_0x283b40['countcongestionretry'];this[_0xdfa4('0xf')]=_0x283b40[_0xdfa4('0xf')];this[_0xdfa4('0x10')]=_0x283b40[_0xdfa4('0x10')];this[_0xdfa4('0x11')]=_0x283b40[_0xdfa4('0x11')];this[_0xdfa4('0x12')]=_0x283b40[_0xdfa4('0x12')];this[_0xdfa4('0x13')]=_0x283b40[_0xdfa4('0x13')];this['countagentrejectretry']=_0x283b40[_0xdfa4('0x14')];this[_0xdfa4('0x15')]=_0x283b40[_0xdfa4('0x15')];this[_0xdfa4('0x16')]=_0x283b40[_0xdfa4('0x16')];this[_0xdfa4('0x17')]=_0x283b40['UserId'];this[_0xdfa4('0x18')]=_0x283b40[_0xdfa4('0x18')];this['CampaignId']=_0x283b40['CampaignId'];this['idHopper']=_0x283b40['id'];this[_0xdfa4('0x19')]=_0x283b40[_0xdfa4('0x5')]['firstName']||'';this[_0xdfa4('0x1a')]=moment()[_0xdfa4('0x1b')](_0xdfa4('0x1c'));this[_0xdfa4('0x1d')]=_0x283b40[_0xdfa4('0x1d')];this['callbackuniqueid']=_0x283b40['callbackuniqueid'];this[_0xdfa4('0x1e')]=_0x283b40['callbackat'];this[_0xdfa4('0x1f')]=_0x283b40[_0xdfa4('0x1f')];this[_0xdfa4('0x20')]='';this[_0xdfa4('0x21')]='';}Action[_0xdfa4('0x22')][_0xdfa4('0x23')]=function(){return util[_0xdfa4('0x1b')](_0xdfa4('0x24'),this[_0xdfa4('0x4')],this[_0xdfa4('0x2')][_0xdfa4('0x25')]>0x0?this[_0xdfa4('0x26')][_0xdfa4('0x27')](this[_0xdfa4('0x2')][_0xdfa4('0x25')]):this[_0xdfa4('0x26')]);};Action['prototype'][_0xdfa4('0x28')]=function(){return this[_0xdfa4('0x29')];};module[_0xdfa4('0x2a')]=Action;
\ No newline at end of file
+var _0xa44c=['recallme','originatecalleridnum','prototype','getCaller','format','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','getQueue','exports','util','lodash','moment','isNil','name','phone','Contact','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','callback','callbackuniqueid','callbackat'];(function(_0x1ffbf1,_0x5df1ad){var _0x1fd3e8=function(_0x546933){while(--_0x546933){_0x1ffbf1['push'](_0x1ffbf1['shift']());}};_0x1fd3e8(++_0x5df1ad);}(_0xa44c,0xe1));var _0xca44=function(_0x4b81c9,_0x4f478f){_0x4b81c9=_0x4b81c9-0x0;var _0x349019=_0xa44c[_0x4b81c9];return _0x349019;};'use strict';var util=require(_0xca44('0x0'));var _=require(_0xca44('0x1'));var moment=require(_0xca44('0x2'));function checkNameSurname(_0x1b47ba,_0x1a02a0,_0x1c9aca){var _0x4c6eda='';if(!_[_0xca44('0x3')](_0x1a02a0)&&'string'===typeof _0x1a02a0){_0x4c6eda+=_0x1a02a0;}if(!_[_0xca44('0x3')](_0x1c9aca)&&'string'===typeof _0x1c9aca){_0x4c6eda+='\x20'+_0x1c9aca;}if(_0x4c6eda!==''){return _0x4c6eda;}return _0x1b47ba;}function Action(_0x511bbd,_0x479c4e,_0x239c41){this['voiceQueue']=_0x511bbd;this['uniqueid']=_0x239c41||undefined;this[_0xca44('0x4')]=checkNameSurname(_0x479c4e['Contact'][_0xca44('0x5')],_0x479c4e[_0xca44('0x6')][_0xca44('0x7')],_0x479c4e[_0xca44('0x6')][_0xca44('0x8')]);this[_0xca44('0x9')]=_0x479c4e[_0xca44('0x6')]['phone'];this[_0xca44('0xa')]=_0x511bbd[_0xca44('0x4')];this[_0xca44('0xb')]=_0x479c4e[_0xca44('0xb')]||![];this[_0xca44('0xc')]=_0x511bbd[_0xca44('0xc')];this[_0xca44('0xd')]=_0x511bbd[_0xca44('0xd')]||0x3;this[_0xca44('0xe')]=_0x479c4e[_0xca44('0xe')];this[_0xca44('0xf')]=_0x479c4e[_0xca44('0xf')];this['countcongestionretry']=_0x479c4e[_0xca44('0x10')];this['countnoanswerretry']=_0x479c4e[_0xca44('0x11')];this['countnosuchnumberretry']=_0x479c4e[_0xca44('0x12')];this[_0xca44('0x13')]=_0x479c4e[_0xca44('0x13')];this[_0xca44('0x14')]=_0x479c4e[_0xca44('0x14')];this[_0xca44('0x15')]=_0x479c4e[_0xca44('0x15')];this[_0xca44('0x16')]=_0x479c4e[_0xca44('0x16')];this[_0xca44('0x17')]=_0x479c4e[_0xca44('0x17')];this['ListId']=_0x479c4e[_0xca44('0x18')];this[_0xca44('0x19')]=_0x479c4e['UserId'];this[_0xca44('0x1a')]=_0x479c4e['VoiceQueueId'];this[_0xca44('0x1b')]=_0x479c4e[_0xca44('0x1b')];this['idHopper']=_0x479c4e['id'];this[_0xca44('0x1c')]=_0x479c4e[_0xca44('0x6')][_0xca44('0x7')]||'';this[_0xca44('0x1d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xca44('0x1e')]=_0x479c4e[_0xca44('0x1e')];this[_0xca44('0x1f')]=_0x479c4e[_0xca44('0x1f')];this[_0xca44('0x20')]=_0x479c4e[_0xca44('0x20')];this[_0xca44('0x21')]=_0x479c4e[_0xca44('0x21')];this[_0xca44('0x22')]='';this['originatecalleridname']='';}Action[_0xca44('0x23')][_0xca44('0x24')]=function(){return util[_0xca44('0x25')](_0xca44('0x26'),this[_0xca44('0x4')],this[_0xca44('0x27')][_0xca44('0x28')]>0x0?this[_0xca44('0x9')]['substring'](this['voiceQueue'][_0xca44('0x28')]):this['number']);};Action['prototype'][_0xca44('0x29')]=function(){return this[_0xca44('0xa')];};module[_0xca44('0x2a')]=Action;
\ No newline at end of file
index fe5421a..7ff73b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x242d=['talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','lodash','moment','milliseconds','diff','state','statedesc','scheduledat','type','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','answertime','endtime','format'];(function(_0x18d5d7,_0x19074b){var _0x30a9ea=function(_0x514f3f){while(--_0x514f3f){_0x18d5d7['push'](_0x18d5d7['shift']());}};_0x30a9ea(++_0x19074b);}(_0x242d,0x19d));var _0xd242=function(_0x271d02,_0x5cd222){_0x271d02=_0x271d02-0x0;var _0x14112d=_0x242d[_0x271d02];return _0x14112d;};'use strict';var util=require('util');var _=require(_0xd242('0x0'));var moment=require(_0xd242('0x1'));function getSeconds(_0x356c02,_0x64c7f8){var _0x13c75f=moment(_0x356c02)[_0xd242('0x2')](0x0);var _0x41f56a=moment(_0x64c7f8)[_0xd242('0x2')](0x0);return _0x13c75f[_0xd242('0x3')](_0x41f56a,'seconds');}function AgentComplete(_0x35dd66,_0x16238d){this[_0xd242('0x4')]=0x4;this[_0xd242('0x5')]='Answer';this['scheduledat']=_0x35dd66[_0xd242('0x6')];this[_0xd242('0x7')]=_0x35dd66['type'];this['campaigntype']=_0x35dd66[_0xd242('0x7')]==='outbound'?_0xd242('0x8'):_0x35dd66[_0xd242('0x7')];this['countbusyretry']=_0x35dd66['countbusyretry'];this[_0xd242('0x9')]=_0x35dd66['countcongestionretry'];this[_0xd242('0xa')]=_0x35dd66[_0xd242('0xa')];this[_0xd242('0xb')]=_0x35dd66[_0xd242('0xc')]+_0x35dd66[_0xd242('0x9')]+_0x35dd66[_0xd242('0xa')]+_0x35dd66['countnosuchnumberretry']+_0x35dd66[_0xd242('0xd')]+_0x35dd66[_0xd242('0xe')]+_0x35dd66[_0xd242('0xf')]+_0x35dd66['countagentrejectretry'];this[_0xd242('0x10')]=_0x35dd66[_0xd242('0x10')];this[_0xd242('0xd')]=_0x35dd66['countdropretry'];this[_0xd242('0xe')]=_0x35dd66['countabandonedretry'];this[_0xd242('0xf')]=_0x35dd66['countmachineretry'];this[_0xd242('0x11')]=_0x35dd66['countagentrejectretry'];this[_0xd242('0x12')]=_0x16238d[_0xd242('0x12')];this['calleridname']=_0x35dd66[_0xd242('0x13')];this[_0xd242('0x14')]=_0x35dd66[_0xd242('0x15')];this[_0xd242('0x16')]=_0x35dd66[_0xd242('0x16')];this[_0xd242('0x17')]=_0x35dd66[_0xd242('0x17')];this[_0xd242('0x18')]=_0x35dd66['answertime'];this[_0xd242('0x19')]=moment()[_0xd242('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x35dd66[_0xd242('0x17')],_0x35dd66[_0xd242('0x16')]);this['holdtime']=getSeconds(_0x35dd66['answertime'],_0x35dd66[_0xd242('0x17')]);this[_0xd242('0x1b')]=getSeconds(this['endtime'],_0x35dd66[_0xd242('0x18')]);this[_0xd242('0x8')]=_0x16238d['queue'];this[_0xd242('0x1c')]=_0x16238d[_0xd242('0x1c')];this[_0xd242('0x1d')]=_0x16238d['reason'];this[_0xd242('0x1e')]=_0x35dd66[_0xd242('0x1e')];this[_0xd242('0x1f')]=_0x35dd66[_0xd242('0x1f')];this[_0xd242('0x20')]=_0x35dd66[_0xd242('0x20')];this[_0xd242('0x21')]=_0x35dd66[_0xd242('0x21')];this[_0xd242('0x22')]=_0x35dd66[_0xd242('0x22')];this[_0xd242('0x23')]=_0x35dd66[_0xd242('0x23')];this[_0xd242('0x24')]=_0x35dd66[_0xd242('0x24')];this[_0xd242('0x25')]=_0x35dd66[_0xd242('0x25')];this[_0xd242('0x26')]=_0x35dd66['CampaignId'];this['originatecalleridnum']=_0x35dd66['originatecalleridnum']||'';this['originatecalleridname']=_0x35dd66['originatecalleridname']||'';}module[_0xd242('0x27')]=AgentComplete;
\ No newline at end of file
+var _0xdc19=['type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','seconds','state','statedesc','Answer','scheduledat'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xdc19,0xb4));var _0x9dc1=function(_0x4a8704,_0x1cf4f2){_0x4a8704=_0x4a8704-0x0;var _0x4d73fb=_0xdc19[_0x4a8704];return _0x4d73fb;};'use strict';var util=require(_0x9dc1('0x0'));var _=require(_0x9dc1('0x1'));var moment=require('moment');function getSeconds(_0x4a76db,_0x36b2e0){var _0x1425b0=moment(_0x4a76db)[_0x9dc1('0x2')](0x0);var _0x12be83=moment(_0x36b2e0)['milliseconds'](0x0);return _0x1425b0['diff'](_0x12be83,_0x9dc1('0x3'));}function AgentComplete(_0x326252,_0x432cb1){this[_0x9dc1('0x4')]=0x4;this[_0x9dc1('0x5')]=_0x9dc1('0x6');this[_0x9dc1('0x7')]=_0x326252[_0x9dc1('0x7')];this[_0x9dc1('0x8')]=_0x326252[_0x9dc1('0x8')];this[_0x9dc1('0x9')]=_0x326252[_0x9dc1('0x8')]===_0x9dc1('0xa')?_0x9dc1('0xb'):_0x326252[_0x9dc1('0x8')];this[_0x9dc1('0xc')]=_0x326252[_0x9dc1('0xc')];this[_0x9dc1('0xd')]=_0x326252['countcongestionretry'];this[_0x9dc1('0xe')]=_0x326252['countnoanswerretry'];this[_0x9dc1('0xf')]=_0x326252['countbusyretry']+_0x326252['countcongestionretry']+_0x326252[_0x9dc1('0xe')]+_0x326252['countnosuchnumberretry']+_0x326252[_0x9dc1('0x10')]+_0x326252[_0x9dc1('0x11')]+_0x326252[_0x9dc1('0x12')]+_0x326252[_0x9dc1('0x13')];this[_0x9dc1('0x14')]=_0x326252['countnosuchnumberretry'];this['countdropretry']=_0x326252[_0x9dc1('0x10')];this[_0x9dc1('0x11')]=_0x326252[_0x9dc1('0x11')];this[_0x9dc1('0x12')]=_0x326252[_0x9dc1('0x12')];this[_0x9dc1('0x13')]=_0x326252[_0x9dc1('0x13')];this[_0x9dc1('0x15')]=_0x432cb1[_0x9dc1('0x15')];this[_0x9dc1('0x16')]=_0x326252[_0x9dc1('0x17')];this[_0x9dc1('0x18')]=_0x326252[_0x9dc1('0x19')];this[_0x9dc1('0x1a')]=_0x326252[_0x9dc1('0x1a')];this[_0x9dc1('0x1b')]=_0x326252[_0x9dc1('0x1b')];this['answertime']=_0x326252[_0x9dc1('0x1c')];this['endtime']=moment()[_0x9dc1('0x1d')](_0x9dc1('0x1e'));this[_0x9dc1('0x1f')]=getSeconds(_0x326252['responsetime'],_0x326252[_0x9dc1('0x1a')]);this['holdtime']=getSeconds(_0x326252[_0x9dc1('0x1c')],_0x326252[_0x9dc1('0x1b')]);this[_0x9dc1('0x20')]=getSeconds(this[_0x9dc1('0x21')],_0x326252['answertime']);this[_0x9dc1('0xb')]=_0x432cb1[_0x9dc1('0xb')];this['membername']=_0x432cb1[_0x9dc1('0x22')];this[_0x9dc1('0x23')]=_0x432cb1[_0x9dc1('0x23')];this[_0x9dc1('0x24')]=_0x326252[_0x9dc1('0x24')];this[_0x9dc1('0x25')]=_0x326252[_0x9dc1('0x25')];this[_0x9dc1('0x26')]=_0x326252['callbackat'];this['recallme']=_0x326252[_0x9dc1('0x27')];this[_0x9dc1('0x28')]=_0x326252['ContactId'];this['ListId']=_0x326252[_0x9dc1('0x29')];this['UserId']=_0x326252[_0x9dc1('0x2a')];this[_0x9dc1('0x2b')]=_0x326252[_0x9dc1('0x2b')];this[_0x9dc1('0x2c')]=_0x326252[_0x9dc1('0x2c')];this[_0x9dc1('0x2d')]=_0x326252['originatecalleridnum']||'';this[_0x9dc1('0x2e')]=_0x326252[_0x9dc1('0x2e')]||'';}module['exports']=AgentComplete;
\ No newline at end of file
index 695b1c4..e076833 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c32=['originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x53fb9a,_0x5d9d96){var _0x4cbf98=function(_0x5a2a59){while(--_0x5a2a59){_0x53fb9a['push'](_0x53fb9a['shift']());}};_0x4cbf98(++_0x5d9d96);}(_0x6c32,0x6e));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x26c3('0x0'));var _=require(_0x26c3('0x1'));var moment=require(_0x26c3('0x2'));function getSeconds(_0x416a62,_0x2bbfc4){var _0x44fc8c=moment(_0x416a62)[_0x26c3('0x3')](0x0);var _0x321cc5=moment(_0x2bbfc4)[_0x26c3('0x3')](0x0);return _0x44fc8c['diff'](_0x321cc5,_0x26c3('0x4'));}function Final(_0x3f7065){this[_0x26c3('0x5')]=_0x3f7065['uniqueid'];this[_0x26c3('0x6')]=_0x3f7065['scheduledat'];this[_0x26c3('0x7')]=_0x3f7065[_0x26c3('0x7')];this[_0x26c3('0x8')]=_0x3f7065[_0x26c3('0x7')]===_0x26c3('0x9')?_0x26c3('0xa'):_0x3f7065[_0x26c3('0x7')];this[_0x26c3('0xb')]=_0x3f7065[_0x26c3('0xb')];this[_0x26c3('0xc')]=_0x3f7065['countcongestionretry'];this['countnoanswerretry']=_0x3f7065['countnoanswerretry'];this['countglobal']=_0x3f7065[_0x26c3('0xb')]+_0x3f7065[_0x26c3('0xc')]+_0x3f7065[_0x26c3('0xd')]+_0x3f7065[_0x26c3('0xe')]+_0x3f7065['countdropretry']+_0x3f7065['countabandonedretry']+_0x3f7065[_0x26c3('0xf')]+_0x3f7065[_0x26c3('0x10')];this[_0x26c3('0xe')]=_0x3f7065[_0x26c3('0xe')];this[_0x26c3('0x11')]=_0x3f7065['countdropretry'];this['countabandonedretry']=_0x3f7065[_0x26c3('0x12')];this[_0x26c3('0xf')]=_0x3f7065['countmachineretry'];this['countagentrejectretry']=_0x3f7065[_0x26c3('0x10')];this['queue']=_0x3f7065[_0x26c3('0xa')];this['calleridname']=_0x3f7065['calleridname'];this[_0x26c3('0x13')]=_0x3f7065['calleridnum'];this[_0x26c3('0x14')]=_0x3f7065['starttime'];this[_0x26c3('0x15')]=_0x3f7065[_0x26c3('0x15')];this[_0x26c3('0x16')]=_0x3f7065[_0x26c3('0x15')];this[_0x26c3('0x17')]=_0x3f7065['ringtime']||0x0;this['holdtime']=_0x3f7065[_0x26c3('0x18')]||0x0;this[_0x26c3('0x19')]=_0x3f7065['talktime']||0x0;this['callback']=_0x3f7065[_0x26c3('0x1a')];this['callbackuniqueid']=_0x3f7065['callbackuniqueid'];this[_0x26c3('0x1b')]=_0x3f7065['callbackat'];this[_0x26c3('0x1c')]=_0x3f7065['recallme'];this[_0x26c3('0x1d')]=_0x3f7065['ContactId'];this[_0x26c3('0x1e')]=_0x3f7065[_0x26c3('0x1e')];this[_0x26c3('0x1f')]=_0x3f7065[_0x26c3('0x1f')];this[_0x26c3('0x20')]=_0x3f7065[_0x26c3('0x20')];this[_0x26c3('0x21')]=_0x3f7065[_0x26c3('0x21')];this[_0x26c3('0x22')]=_0x3f7065[_0x26c3('0x22')]||'';this['originatecalleridname']=_0x3f7065[_0x26c3('0x23')]||'';}module['exports']=Final;
\ No newline at end of file
+var _0xf120=['diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','lodash','moment','milliseconds'];(function(_0x56a4d,_0x289dc6){var _0x4aac8c=function(_0x464dc2){while(--_0x464dc2){_0x56a4d['push'](_0x56a4d['shift']());}};_0x4aac8c(++_0x289dc6);}(_0xf120,0x179));var _0x0f12=function(_0xf99f57,_0x3ca1e9){_0xf99f57=_0xf99f57-0x0;var _0x3963c2=_0xf120[_0xf99f57];return _0x3963c2;};'use strict';var util=require('util');var _=require(_0x0f12('0x0'));var moment=require(_0x0f12('0x1'));function getSeconds(_0x1d8274,_0x51c839){var _0x380c77=moment(_0x1d8274)[_0x0f12('0x2')](0x0);var _0x163c58=moment(_0x51c839)['milliseconds'](0x0);return _0x380c77[_0x0f12('0x3')](_0x163c58,_0x0f12('0x4'));}function Final(_0x2dbf82){this[_0x0f12('0x5')]=_0x2dbf82[_0x0f12('0x5')];this[_0x0f12('0x6')]=_0x2dbf82[_0x0f12('0x6')];this[_0x0f12('0x7')]=_0x2dbf82['type'];this[_0x0f12('0x8')]=_0x2dbf82['type']===_0x0f12('0x9')?_0x0f12('0xa'):_0x2dbf82[_0x0f12('0x7')];this['countbusyretry']=_0x2dbf82['countbusyretry'];this[_0x0f12('0xb')]=_0x2dbf82[_0x0f12('0xb')];this[_0x0f12('0xc')]=_0x2dbf82[_0x0f12('0xc')];this[_0x0f12('0xd')]=_0x2dbf82[_0x0f12('0xe')]+_0x2dbf82[_0x0f12('0xb')]+_0x2dbf82['countnoanswerretry']+_0x2dbf82[_0x0f12('0xf')]+_0x2dbf82[_0x0f12('0x10')]+_0x2dbf82[_0x0f12('0x11')]+_0x2dbf82[_0x0f12('0x12')]+_0x2dbf82[_0x0f12('0x13')];this[_0x0f12('0xf')]=_0x2dbf82[_0x0f12('0xf')];this[_0x0f12('0x10')]=_0x2dbf82[_0x0f12('0x10')];this[_0x0f12('0x11')]=_0x2dbf82[_0x0f12('0x11')];this[_0x0f12('0x12')]=_0x2dbf82[_0x0f12('0x12')];this[_0x0f12('0x13')]=_0x2dbf82[_0x0f12('0x13')];this['queue']=_0x2dbf82[_0x0f12('0xa')];this['calleridname']=_0x2dbf82[_0x0f12('0x14')];this[_0x0f12('0x15')]=_0x2dbf82[_0x0f12('0x15')];this[_0x0f12('0x16')]=_0x2dbf82[_0x0f12('0x16')];this[_0x0f12('0x17')]=_0x2dbf82['responsetime'];this[_0x0f12('0x18')]=_0x2dbf82['responsetime'];this[_0x0f12('0x19')]=_0x2dbf82['ringtime']||0x0;this['holdtime']=_0x2dbf82[_0x0f12('0x1a')]||0x0;this[_0x0f12('0x1b')]=_0x2dbf82[_0x0f12('0x1b')]||0x0;this['callback']=_0x2dbf82[_0x0f12('0x1c')];this['callbackuniqueid']=_0x2dbf82[_0x0f12('0x1d')];this['callbackat']=_0x2dbf82[_0x0f12('0x1e')];this[_0x0f12('0x1f')]=_0x2dbf82['recallme'];this[_0x0f12('0x20')]=_0x2dbf82[_0x0f12('0x20')];this[_0x0f12('0x21')]=_0x2dbf82[_0x0f12('0x21')];this[_0x0f12('0x22')]=_0x2dbf82['UserId'];this[_0x0f12('0x23')]=_0x2dbf82['VoiceQueueId'];this['CampaignId']=_0x2dbf82['CampaignId'];this[_0x0f12('0x24')]=_0x2dbf82[_0x0f12('0x24')]||'';this[_0x0f12('0x25')]=_0x2dbf82[_0x0f12('0x25')]||'';}module['exports']=Final;
\ No newline at end of file
index 636f03c..85805cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2374=['countagentrejectretry','countdropretry','countabandonedretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','ringtime','talktime','membername','IVR','reason','cause-txt','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','moment','milliseconds','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry'];(function(_0x784673,_0x3b2f2e){var _0x1ab8a5=function(_0x49754d){while(--_0x49754d){_0x784673['push'](_0x784673['shift']());}};_0x1ab8a5(++_0x3b2f2e);}(_0x2374,0x6a));var _0x4237=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x2374[_0x4b369d];return _0x571a98;};'use strict';var util=require(_0x4237('0x0'));var _=require('lodash');var moment=require(_0x4237('0x1'));function getSeconds(_0x5af9d2,_0x20f6c5){var _0xff676c=moment(_0x5af9d2)[_0x4237('0x2')](0x0);var _0x5234f0=moment(_0x20f6c5)['milliseconds'](0x0);return _0xff676c['diff'](_0x5234f0,'seconds');}function Hangup(_0x5a0d7d,_0x4280e4){this['state']=0x4;this['statedesc']='Answer';this[_0x4237('0x3')]=_0x5a0d7d[_0x4237('0x3')];this['type']=_0x5a0d7d[_0x4237('0x4')];this[_0x4237('0x5')]=_0x5a0d7d[_0x4237('0x4')]==='outbound'?_0x4237('0x6'):_0x5a0d7d['type'];this[_0x4237('0x7')]=_0x5a0d7d['countbusyretry'];this[_0x4237('0x8')]=_0x5a0d7d['countcongestionretry'];this[_0x4237('0x9')]=_0x5a0d7d[_0x4237('0x9')];this['countglobal']=_0x5a0d7d[_0x4237('0x7')]+_0x5a0d7d[_0x4237('0x8')]+_0x5a0d7d[_0x4237('0x9')]+_0x5a0d7d[_0x4237('0xa')]+_0x5a0d7d['countdropretry']+_0x5a0d7d['countabandonedretry']+_0x5a0d7d['countmachineretry']+_0x5a0d7d[_0x4237('0xb')];this[_0x4237('0xa')]=_0x5a0d7d[_0x4237('0xa')];this['countdropretry']=_0x5a0d7d[_0x4237('0xc')];this[_0x4237('0xd')]=_0x5a0d7d[_0x4237('0xd')];this[_0x4237('0xe')]=_0x5a0d7d[_0x4237('0xe')];this['countagentrejectretry']=_0x5a0d7d['countagentrejectretry'];this[_0x4237('0xf')]=_0x4280e4[_0x4237('0xf')];this[_0x4237('0x10')]=_0x5a0d7d[_0x4237('0x11')];this[_0x4237('0x12')]=_0x5a0d7d[_0x4237('0x13')];this[_0x4237('0x14')]=_0x5a0d7d[_0x4237('0x14')];this[_0x4237('0x15')]=_0x5a0d7d[_0x4237('0x15')];this[_0x4237('0x16')]=moment()[_0x4237('0x17')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x4237('0x18')]=getSeconds(_0x5a0d7d['responsetime'],_0x5a0d7d[_0x4237('0x14')]);this['holdtime']=0x0;this[_0x4237('0x19')]=getSeconds(this[_0x4237('0x16')],_0x5a0d7d[_0x4237('0x15')]);this[_0x4237('0x6')]=_0x5a0d7d[_0x4237('0x6')];this[_0x4237('0x1a')]=_0x4237('0x1b');this[_0x4237('0x1c')]=_0x4280e4[_0x4237('0x1d')];this[_0x4237('0x1e')]=_0x5a0d7d['callback'];this['callbackuniqueid']=_0x5a0d7d['callbackuniqueid'];this[_0x4237('0x1f')]=_0x5a0d7d[_0x4237('0x1f')];this[_0x4237('0x20')]=_0x5a0d7d['recallme'];this[_0x4237('0x21')]=_0x5a0d7d[_0x4237('0x21')];this[_0x4237('0x22')]=_0x5a0d7d[_0x4237('0x22')];this['UserId']=_0x5a0d7d[_0x4237('0x23')];this[_0x4237('0x24')]=_0x5a0d7d['VoiceQueueId'];this['CampaignId']=_0x5a0d7d[_0x4237('0x25')];}module[_0x4237('0x26')]=Hangup;
\ No newline at end of file
+var _0xfb3f=['cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','statedesc','Answer','type','campaigntype','countbusyretry','countglobal','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','uniqueid','calleridname','name','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','queue','IVR','reason'];(function(_0x41a5a0,_0x3bee12){var _0x2190f8=function(_0x3019e1){while(--_0x3019e1){_0x41a5a0['push'](_0x41a5a0['shift']());}};_0x2190f8(++_0x3bee12);}(_0xfb3f,0xb7));var _0xffb3=function(_0x40139a,_0x534505){_0x40139a=_0x40139a-0x0;var _0x26ee8b=_0xfb3f[_0x40139a];return _0x26ee8b;};'use strict';var util=require(_0xffb3('0x0'));var _=require(_0xffb3('0x1'));var moment=require(_0xffb3('0x2'));function getSeconds(_0x3a165a,_0x50b69d){var _0x1608a2=moment(_0x3a165a)[_0xffb3('0x3')](0x0);var _0x35ba96=moment(_0x50b69d)['milliseconds'](0x0);return _0x1608a2[_0xffb3('0x4')](_0x35ba96,_0xffb3('0x5'));}function Hangup(_0x2ff82a,_0x3ecbc){this['state']=0x4;this[_0xffb3('0x6')]=_0xffb3('0x7');this['scheduledat']=_0x2ff82a['scheduledat'];this[_0xffb3('0x8')]=_0x2ff82a[_0xffb3('0x8')];this[_0xffb3('0x9')]=_0x2ff82a['type']==='outbound'?'queue':_0x2ff82a[_0xffb3('0x8')];this[_0xffb3('0xa')]=_0x2ff82a[_0xffb3('0xa')];this['countcongestionretry']=_0x2ff82a['countcongestionretry'];this['countnoanswerretry']=_0x2ff82a['countnoanswerretry'];this[_0xffb3('0xb')]=_0x2ff82a[_0xffb3('0xa')]+_0x2ff82a[_0xffb3('0xc')]+_0x2ff82a[_0xffb3('0xd')]+_0x2ff82a[_0xffb3('0xe')]+_0x2ff82a['countdropretry']+_0x2ff82a[_0xffb3('0xf')]+_0x2ff82a['countmachineretry']+_0x2ff82a[_0xffb3('0x10')];this[_0xffb3('0xe')]=_0x2ff82a['countnosuchnumberretry'];this[_0xffb3('0x11')]=_0x2ff82a[_0xffb3('0x11')];this[_0xffb3('0xf')]=_0x2ff82a['countabandonedretry'];this[_0xffb3('0x12')]=_0x2ff82a[_0xffb3('0x12')];this[_0xffb3('0x10')]=_0x2ff82a[_0xffb3('0x10')];this['uniqueid']=_0x3ecbc[_0xffb3('0x13')];this[_0xffb3('0x14')]=_0x2ff82a[_0xffb3('0x15')];this['calleridnum']=_0x2ff82a[_0xffb3('0x16')];this['starttime']=_0x2ff82a[_0xffb3('0x17')];this[_0xffb3('0x18')]=_0x2ff82a[_0xffb3('0x18')];this[_0xffb3('0x19')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xffb3('0x1a')]=getSeconds(_0x2ff82a[_0xffb3('0x18')],_0x2ff82a[_0xffb3('0x17')]);this[_0xffb3('0x1b')]=0x0;this[_0xffb3('0x1c')]=getSeconds(this['endtime'],_0x2ff82a[_0xffb3('0x18')]);this[_0xffb3('0x1d')]=_0x2ff82a[_0xffb3('0x1d')];this['membername']=_0xffb3('0x1e');this[_0xffb3('0x1f')]=_0x3ecbc[_0xffb3('0x20')];this[_0xffb3('0x21')]=_0x2ff82a[_0xffb3('0x21')];this[_0xffb3('0x22')]=_0x2ff82a[_0xffb3('0x22')];this[_0xffb3('0x23')]=_0x2ff82a[_0xffb3('0x23')];this[_0xffb3('0x24')]=_0x2ff82a[_0xffb3('0x24')];this[_0xffb3('0x25')]=_0x2ff82a[_0xffb3('0x25')];this[_0xffb3('0x26')]=_0x2ff82a[_0xffb3('0x26')];this[_0xffb3('0x27')]=_0x2ff82a[_0xffb3('0x27')];this['VoiceQueueId']=_0x2ff82a[_0xffb3('0x28')];this[_0xffb3('0x29')]=_0x2ff82a[_0xffb3('0x29')];}module[_0xffb3('0x2a')]=Hangup;
\ No newline at end of file
index fb83287..1344fc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e05=['countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','number','starttime','responsetime','endtime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x63b5e6,_0x4547de){var _0x29efdb=function(_0x53fb77){while(--_0x53fb77){_0x63b5e6['push'](_0x63b5e6['shift']());}};_0x29efdb(++_0x4547de);}(_0x3e05,0x64));var _0x53e0=function(_0x2278b5,_0x46a568){_0x2278b5=_0x2278b5-0x0;var _0x5575b9=_0x3e05[_0x2278b5];return _0x5575b9;};'use strict';var util=require('util');var _=require(_0x53e0('0x0'));var moment=require(_0x53e0('0x1'));function getSeconds(_0x54c629,_0x4c2742){var _0x5b7b18=moment(_0x54c629)[_0x53e0('0x2')](0x0);var _0x3d0af2=moment(_0x4c2742)[_0x53e0('0x2')](0x0);return _0x5b7b18[_0x53e0('0x3')](_0x3d0af2,_0x53e0('0x4'));}function History(_0x3d506d){this[_0x53e0('0x5')]=_0x3d506d[_0x53e0('0x5')];this[_0x53e0('0x6')]=_0x3d506d[_0x53e0('0x6')]||undefined;this['type']=_0x3d506d[_0x53e0('0x7')];this['campaigntype']=_0x3d506d['type']===_0x53e0('0x8')?_0x53e0('0x9'):_0x3d506d[_0x53e0('0x7')];this[_0x53e0('0xa')]=_0x3d506d[_0x53e0('0xa')];this[_0x53e0('0xb')]=_0x3d506d[_0x53e0('0xb')];this[_0x53e0('0xc')]=_0x3d506d['countnoanswerretry'];this[_0x53e0('0xd')]=_0x3d506d[_0x53e0('0xa')]+_0x3d506d[_0x53e0('0xb')]+_0x3d506d[_0x53e0('0xc')]+_0x3d506d[_0x53e0('0xe')]+_0x3d506d[_0x53e0('0xf')]+_0x3d506d[_0x53e0('0x10')]+_0x3d506d['countmachineretry']+_0x3d506d['countagentrejectretry'];this[_0x53e0('0xe')]=_0x3d506d[_0x53e0('0xe')];this[_0x53e0('0xf')]=_0x3d506d[_0x53e0('0xf')];this[_0x53e0('0x10')]=_0x3d506d['countabandonedretry'];this[_0x53e0('0x11')]=_0x3d506d[_0x53e0('0x11')];this[_0x53e0('0x12')]=_0x3d506d[_0x53e0('0x12')];this['queue']=_0x3d506d[_0x53e0('0x9')];this[_0x53e0('0x13')]=_0x3d506d['name'];this[_0x53e0('0x14')]=_0x3d506d[_0x53e0('0x15')];this[_0x53e0('0x16')]=_0x3d506d[_0x53e0('0x16')];this[_0x53e0('0x17')]=_0x3d506d[_0x53e0('0x17')];this[_0x53e0('0x18')]=_0x3d506d[_0x53e0('0x17')];this[_0x53e0('0x19')]=getSeconds(_0x3d506d[_0x53e0('0x17')],_0x3d506d[_0x53e0('0x16')]);this['holdtime']=0x0;this[_0x53e0('0x1a')]=0x0;this[_0x53e0('0x1b')]=_0x3d506d[_0x53e0('0x1b')];this['callbackuniqueid']=_0x3d506d[_0x53e0('0x1c')];this[_0x53e0('0x1d')]=_0x3d506d[_0x53e0('0x1d')];this['recallme']=_0x3d506d[_0x53e0('0x1e')];this['ContactId']=_0x3d506d['ContactId'];this[_0x53e0('0x1f')]=_0x3d506d['ListId'];this['UserId']=_0x3d506d[_0x53e0('0x20')];this[_0x53e0('0x21')]=_0x3d506d['VoiceQueueId'];this[_0x53e0('0x22')]=_0x3d506d[_0x53e0('0x22')];this['originatecalleridnum']=_0x3d506d[_0x53e0('0x23')]||'';this['originatecalleridname']=_0x3d506d[_0x53e0('0x24')]||'';}module[_0x53e0('0x25')]=History;
\ No newline at end of file
+var _0x97f6=['originatecalleridname','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','name','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum'];(function(_0x1e1b71,_0x1458a3){var _0x142f06=function(_0xc5039d){while(--_0xc5039d){_0x1e1b71['push'](_0x1e1b71['shift']());}};_0x142f06(++_0x1458a3);}(_0x97f6,0x173));var _0x697f=function(_0x4d62c0,_0x481b21){_0x4d62c0=_0x4d62c0-0x0;var _0x4014d9=_0x97f6[_0x4d62c0];return _0x4014d9;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x697f('0x0'));function getSeconds(_0x1a7119,_0x14eb2a){var _0x34a748=moment(_0x1a7119)['milliseconds'](0x0);var _0x44f6df=moment(_0x14eb2a)[_0x697f('0x1')](0x0);return _0x34a748[_0x697f('0x2')](_0x44f6df,_0x697f('0x3'));}function History(_0x457558){this['uniqueid']=_0x457558[_0x697f('0x4')];this[_0x697f('0x5')]=_0x457558['scheduledat']||undefined;this[_0x697f('0x6')]=_0x457558[_0x697f('0x6')];this['campaigntype']=_0x457558[_0x697f('0x6')]===_0x697f('0x7')?'queue':_0x457558['type'];this['countbusyretry']=_0x457558[_0x697f('0x8')];this[_0x697f('0x9')]=_0x457558[_0x697f('0x9')];this['countnoanswerretry']=_0x457558[_0x697f('0xa')];this[_0x697f('0xb')]=_0x457558[_0x697f('0x8')]+_0x457558[_0x697f('0x9')]+_0x457558[_0x697f('0xa')]+_0x457558[_0x697f('0xc')]+_0x457558[_0x697f('0xd')]+_0x457558[_0x697f('0xe')]+_0x457558[_0x697f('0xf')]+_0x457558[_0x697f('0x10')];this['countnosuchnumberretry']=_0x457558[_0x697f('0xc')];this[_0x697f('0xd')]=_0x457558[_0x697f('0xd')];this['countabandonedretry']=_0x457558['countabandonedretry'];this[_0x697f('0xf')]=_0x457558[_0x697f('0xf')];this['countagentrejectretry']=_0x457558['countagentrejectretry'];this[_0x697f('0x11')]=_0x457558[_0x697f('0x11')];this[_0x697f('0x12')]=_0x457558[_0x697f('0x13')];this['calleridnum']=_0x457558[_0x697f('0x14')];this[_0x697f('0x15')]=_0x457558[_0x697f('0x15')];this[_0x697f('0x16')]=_0x457558[_0x697f('0x16')];this[_0x697f('0x17')]=_0x457558[_0x697f('0x16')];this[_0x697f('0x18')]=getSeconds(_0x457558[_0x697f('0x16')],_0x457558[_0x697f('0x15')]);this[_0x697f('0x19')]=0x0;this[_0x697f('0x1a')]=0x0;this[_0x697f('0x1b')]=_0x457558[_0x697f('0x1b')];this[_0x697f('0x1c')]=_0x457558['callbackuniqueid'];this[_0x697f('0x1d')]=_0x457558['callbackat'];this[_0x697f('0x1e')]=_0x457558[_0x697f('0x1e')];this['ContactId']=_0x457558['ContactId'];this[_0x697f('0x1f')]=_0x457558[_0x697f('0x1f')];this[_0x697f('0x20')]=_0x457558[_0x697f('0x20')];this[_0x697f('0x21')]=_0x457558[_0x697f('0x21')];this[_0x697f('0x22')]=_0x457558[_0x697f('0x22')];this[_0x697f('0x23')]=_0x457558[_0x697f('0x23')]||'';this[_0x697f('0x24')]=_0x457558[_0x697f('0x24')]||'';}module['exports']=History;
\ No newline at end of file
index fb211c0..59bc19c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e35=['handleIvr','syncQueueSummary','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','checkDialMethod','[syncCampaigns]','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','OriginateError','[originate][error]','Error','originate\x20action\x20Error','getQueue','response','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','nosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','NoAnswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','congestion','dialCongestionMaxRetry','reason\x208\x20congestion','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','talking','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','averageHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','agentBusyFactor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','Queue:\x20','scheduledat','voicePause','dialRecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','Contact.phone','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','emptyContact','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','interval\x20=\x20','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictiveCalls','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./agentComplete','./queueCallerAbandon','./hangup','env','127.0.0.1','rrmemory','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','varset','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','Interval','\x20INTERVAL_IS_NULL','Intervals','INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','milliseconds','diff','seconds','emit','outbound','strategy','answered','available','loggedIn','sumDuration','total','type','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','stringify','voice:queue:%s','ivr','format','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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\x20Hold\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','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','inspect','stack','length','error','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','pTalking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','actions','undefined','isNil','Action','status','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','countReScheduled','then','[countReScheduled]\x20','checkIsBlackList','resolve','[checkIsBlackList]\x20','checkIsBlackListIvr','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','saveInDb','pick','ContactId','ListId','CampaignId','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','uniqueid','variable','amdstatus','exten','dialAMDActive','HangupInAMD','AMD','custom:amd','buildObj','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','MACHINE','Machine','membername','countmachineretry','countglobal','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','add','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','VoiceQueueId','[rescheduleContact][Machine]','HANGUP','[syncHangupInAMDIvr][createHistory]','countabandonedretry','countagentrejectretry','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','minutes','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','reason','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialQueueProject2','dialDropMaxRetry','queueCallerAbandonCreateState','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','[syncAgentComplete][createHistory][10]','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','Abandoned','[syncAgentComplete][createHistory][11]','syncNewExten','channel','syncQueueMember','actionid','roundrobin','locked','stateinterface','push','idHopper','paused','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','timezones','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','indexOf','content','all','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','progressive','handlePower','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','launchHandleIvr'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0e35,0xc2));var _0x50e3=function(_0x24d650,_0x3bb1e0){_0x24d650=_0x24d650-0x0;var _0x52078c=_0x0e35[_0x24d650];return _0x52078c;};'use strict';var util=require(_0x50e3('0x0'));var _=require(_0x50e3('0x1'));var BPromise=require(_0x50e3('0x2'));var uuid=require(_0x50e3('0x3'));var moment=require(_0x50e3('0x4'));var rr=require('rr');var md5=require(_0x50e3('0x5'));var Redis=require(_0x50e3('0x6'));var ut=require(_0x50e3('0x7'));var config=require(_0x50e3('0x8'));var logger=require(_0x50e3('0x9'))('dialer');var loggerBooked=require(_0x50e3('0x9'))(_0x50e3('0xa'));var loggerPredictive=require('../../../config/logger')('predictive');var loggerPredictiveCalls=require(_0x50e3('0x9'))(_0x50e3('0xb'));var loggerSyncQueueSummary=require('../../../config/logger')('syncQueueSummary');var ami=require(_0x50e3('0xc'));config[_0x50e3('0xd')]=_[_0x50e3('0xe')](config[_0x50e3('0xd')],{'host':_0x50e3('0xf'),'port':0x18eb});var io=require(_0x50e3('0x10'))(new Redis(config[_0x50e3('0xd')]));var cmHopper=require(_0x50e3('0x11'));var cmHopperHistory=require(_0x50e3('0x12'));var cmHopperBlack=require(_0x50e3('0x13'));var voiceQueueRt=require(_0x50e3('0x14'));var Action=require(_0x50e3('0x15'));var History=require(_0x50e3('0x16'));var Final=require('./final');var AgentComplete=require(_0x50e3('0x17'));var QueueCallerAbandon=require(_0x50e3('0x18'));var Hangup=require(_0x50e3('0x19'));var ipAgi=process[_0x50e3('0x1a')]['XCALLY_IP_AGI']||_0x50e3('0x1b');var strategy={'rrmemory':_0x50e3('0x1c'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0x50e3('0x1d')][_0x50e3('0x1e')]=function(_0x4b5ed5){this[_0x50e3('0x1f')]=this[_0x50e3('0x1f')]?this['tail'][_0x50e3('0x20')](_0x4b5ed5):_0x4b5ed5();};function Dialer(_0x5f44e1,_0x411267){this[_0x50e3('0x21')]=new Sequence();this[_0x50e3('0x22')]=_0x411267;this['voiceQueues']=_0x5f44e1[_0x50e3('0x23')];this[_0x50e3('0x24')]=_0x5f44e1[_0x50e3('0x24')];this[_0x50e3('0x25')]=_0x5f44e1['agents'];this['trunks']=_0x5f44e1[_0x50e3('0x26')];this['maxNumberOriginate']=config[_0x50e3('0x27')]||0x2;this[_0x50e3('0x28')]={};this['actions']={};this['contactsId']={};this[_0x50e3('0x29')]={};this[_0x50e3('0x2a')]={};this['startPredictive']={};this[_0x50e3('0x2b')]={};this[_0x50e3('0x2c')]={};this[_0x50e3('0x2d')]={};this[_0x50e3('0x2e')]={};ami['on'](_0x50e3('0x2f'),this[_0x50e3('0x30')]['bind'](this));ami['on'](_0x50e3('0x31'),this[_0x50e3('0x32')][_0x50e3('0x33')](this));ami['on'](_0x50e3('0x34'),this[_0x50e3('0x35')][_0x50e3('0x33')](this));ami['on'](_0x50e3('0x36'),this[_0x50e3('0x37')]['bind'](this));ami['on'](_0x50e3('0x38'),this['syncQueueSummary'][_0x50e3('0x33')](this));ami['on'](_0x50e3('0x39'),this[_0x50e3('0x3a')][_0x50e3('0x33')](this));ami['on'](_0x50e3('0x3b'),this['syncNewExten']['bind'](this));ami['on'](_0x50e3('0x3c'),this['syncVarSet'][_0x50e3('0x33')](this));ami['on']('queuemember',this['syncQueueMember']['bind'](this));ami['on'](_0x50e3('0x3d'),this[_0x50e3('0x3e')][_0x50e3('0x33')](this));this[_0x50e3('0x3f')]();this[_0x50e3('0x40')]();}function isNotNull(_0x23a5f4){return _0x23a5f4!==null&&!_[_0x50e3('0x41')](_0x23a5f4);}function checkIsLoggedIn(_0x2a028b,_0x518a11){return function(){if(_0x518a11<=0x0){_0x2a028b[_0x50e3('0x42')]=_0x50e3('0x43');throw _0x2a028b[_0x50e3('0x44')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x2228e6){return _0x2228e6;}function checkIsActive(_0x3dd69f,_0x412d48){return function(){if(!isActive(_0x412d48)){_0x3dd69f['message']=_0x50e3('0x45');throw _0x3dd69f[_0x50e3('0x44')]+'\x20NOT\x20Active';}};}function checkInterval(_0x3ac5d0){return function(){if(!isNotNull(_0x3ac5d0[_0x50e3('0x46')])){_0x3ac5d0[_0x50e3('0x42')]='INTERVAL_IS_NULL';throw _0x3ac5d0[_0x50e3('0x44')]+_0x50e3('0x47');}if(!isNotNull(_0x3ac5d0[_0x50e3('0x46')][_0x50e3('0x48')])){_0x3ac5d0[_0x50e3('0x42')]=_0x50e3('0x49');throw _0x3ac5d0['name']+_0x50e3('0x47');}if(!isNotNull(_[_0x50e3('0x4a')](_0x3ac5d0[_0x50e3('0x46')]['Intervals']))){_0x3ac5d0[_0x50e3('0x42')]=_0x50e3('0x49');throw _0x3ac5d0['name']+_0x50e3('0x47');}};}function msgResponse(_0x5ab382,_0x24ff31,_0x549220){return{'action':_0x5ab382,'response':_0x24ff31,'message':_0x549220,'stack':_0x549220};}function myreject(_0x2b6e59){return function(_0x5a1f77){return _0x2b6e59(msgResponse(_0x50e3('0x4b'),'Error',JSON['stringify'](_0x5a1f77)));};}function getSeconds(_0x193635,_0x5a849e){var _0x5a7552=moment(_0x193635)[_0x50e3('0x4c')](0x0);var _0x211ad0=moment(_0x5a849e)[_0x50e3('0x4c')](0x0);return _0x5a7552[_0x50e3('0x4d')](_0x211ad0,_0x50e3('0x4e'));}function emit(_0x3748fa,_0xee2040,_0x4adf79){io['to'](_0x3748fa)[_0x50e3('0x4f')](_0xee2040,_0x4adf79);}function emitVoiceQueueSummary(_0x142ced){if(_0x142ced['type']===_0x50e3('0x50')){var _0x3b1385={'id':_0x142ced['id'],'name':_0x142ced['name'],'strategy':_0x142ced[_0x50e3('0x51')],'answered':_0x142ced[_0x50e3('0x52')],'available':_0x142ced[_0x50e3('0x53')],'loggedIn':_0x142ced[_0x50e3('0x54')],'pTalking':_0x142ced['pTalking'],'sumBillable':_0x142ced['sumBillable'],'sumDuration':_0x142ced[_0x50e3('0x55')],'sumHoldTime':_0x142ced['sumHoldTime']||0x0,'talking':_0x142ced['talking'],'total':_0x142ced[_0x50e3('0x56')],'type':_0x142ced[_0x50e3('0x57')],'unmanaged':_0x142ced[_0x50e3('0x58')],'abandoned':_0x142ced['abandoned'],'waiting':_0x142ced[_0x50e3('0x59')],'loggedInDb':_0x142ced[_0x50e3('0x5a')],'dialActive':_0x142ced[_0x50e3('0x5b')],'dialMethod':_0x142ced[_0x50e3('0x5c')],'dialOriginateCallerIdName':_0x142ced['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x142ced['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x142ced[_0x50e3('0x5d')],'dialPrefix':_0x142ced[_0x50e3('0x5e')],'outboundAnswerAgiCallsDay':_0x142ced[_0x50e3('0x5f')],'outboundAnswerCallsDay':_0x142ced[_0x50e3('0x60')],'outboundBlacklistCallsDay':_0x142ced['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x142ced['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x142ced[_0x50e3('0x61')],'outboundDropCallsDayACS':_0x142ced[_0x50e3('0x62')],'outboundDropCallsDayCallersExit':_0x142ced[_0x50e3('0x63')],'outboundDropCallsDayTimeout':_0x142ced[_0x50e3('0x64')],'outboundNoAnswerCallsDay':_0x142ced[_0x50e3('0x65')],'outboundNoSuchCallsDay':_0x142ced[_0x50e3('0x66')],'outboundOriginateFailureCallsDay':_0x142ced[_0x50e3('0x67')],'outboundReCallsDay':_0x142ced[_0x50e3('0x68')],'outboundRejectCallsDay':_0x142ced[_0x50e3('0x69')],'outboundUnknownCallsDay':_0x142ced[_0x50e3('0x6a')],'predictiveIntervalAnsweredCalls':_0x142ced[_0x50e3('0x6b')],'predictiveIntervalAvgHoldtime':_0x142ced[_0x50e3('0x6c')],'predictiveIntervalAvgTalktime':_0x142ced[_0x50e3('0x6d')],'predictiveIntervalDroppedCallsCallersExit':_0x142ced['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x142ced[_0x50e3('0x6e')],'predictiveIntervalErlangCalls':_0x142ced[_0x50e3('0x6f')],'predictiveIntervalErlangCallsDroppedCalls':_0x142ced[_0x50e3('0x70')],'predictiveIntervalHitRate':_0x142ced[_0x50e3('0x71')],'predictiveIntervalMultiplicativeFactor':_0x142ced['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x142ced[_0x50e3('0x72')],'predictiveIntervalAvailable':_0x142ced[_0x50e3('0x73')],'predictiveIntervalTotalCalls':_0x142ced[_0x50e3('0x74')],'message':_0x142ced['message'],'originated':_0x142ced[_0x50e3('0x75')],'erlangCalls':_0x142ced[_0x50e3('0x76')],'erlangCallToSecond':_0x142ced['erlangCallToSecond'],'erlangAbandonmentRate':_0x142ced[_0x50e3('0x77')],'erlangBusyFactor':_0x142ced[_0x50e3('0x78')],'startPredictive':_0x142ced[_0x50e3('0x79')],'startProgressive':_0x142ced[_0x50e3('0x2b')]};if(_0x142ced[_0x50e3('0x7a')]){_0x3b1385[_0x50e3('0x7a')]={'id':_0x142ced[_0x50e3('0x7a')]['id'],'name':_0x142ced[_0x50e3('0x7a')][_0x50e3('0x44')],'active':_0x142ced[_0x50e3('0x7a')][_0x50e3('0x7b')],'callerid':_0x142ced['Trunk'][_0x50e3('0x7c')]};}if(_0x142ced[_0x50e3('0x46')]){_0x3b1385[_0x50e3('0x46')]={'id':_0x142ced[_0x50e3('0x46')]['id'],'name':_0x142ced[_0x50e3('0x46')][_0x50e3('0x44')]};}var _0x36e9e3=md5(JSON[_0x50e3('0x7d')](_0x3b1385));if(_0x142ced[_0x50e3('0x5')]!==_0x36e9e3){_0x142ced[_0x50e3('0x5')]=_0x36e9e3;emit(util['format'](_0x50e3('0x7e'),_0x3b1385[_0x50e3('0x44')]),'voice_queue:save',_0x3b1385);}}}function emitCampaignSummary(_0x2d9f33){if(_0x2d9f33['type']===_0x50e3('0x7f')){emit(util[_0x50e3('0x80')](_0x50e3('0x81'),_0x2d9f33[_0x50e3('0x44')]),_0x50e3('0x82'),_0x2d9f33);}}function checkGetDataPredictive(_0x58e9aa){if(isNotNull(_0x58e9aa)&&!_['isEmpty'](_0x58e9aa)){loggerPredictive[_0x50e3('0x83')](_0x50e3('0x84'));loggerPredictive['info'](_0x50e3('0x85'),_0x58e9aa[_0x50e3('0x74')]);loggerPredictive[_0x50e3('0x83')](_0x50e3('0x86'),_0x58e9aa['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x50e3('0x83')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x58e9aa[_0x50e3('0x6e')]);loggerPredictive['info'](_0x50e3('0x87'),_0x58e9aa[_0x50e3('0x88')]);loggerPredictive[_0x50e3('0x83')](_0x50e3('0x89'),_0x58e9aa[_0x50e3('0x6c')]);loggerPredictive[_0x50e3('0x83')](_0x50e3('0x8a'),_0x58e9aa[_0x50e3('0x6d')]);loggerPredictive['info']('---------------------------');if(_0x58e9aa[_0x50e3('0x74')]>0x0){if(!_['isUndefined'](_0x58e9aa[_0x50e3('0x6d')])&&_0x58e9aa[_0x50e3('0x6d')]>0x0){return!![];}loggerPredictive[_0x50e3('0x83')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x50e3('0x41')](_0x58e9aa['predictiveIntervalAvgHoldtime'])&&_0x58e9aa['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive['info'](_0x50e3('0x8b'));}else{loggerPredictive[_0x50e3('0x83')](_0x50e3('0x8c'));}}else{loggerPredictive['info'](_0x50e3('0x8d'));}return![];}function mergeDataErlangB(_0x4f956f){return function(_0x5c9a19){loggerPredictive[_0x50e3('0x83')](_0x50e3('0x8e'));loggerPredictive['info'](_0x50e3('0x8f'),_0x5c9a19[_0x50e3('0x76')]);loggerPredictive[_0x50e3('0x83')](_0x50e3('0x90'),_0x5c9a19[_0x50e3('0x91')]);loggerPredictive[_0x50e3('0x83')](_0x50e3('0x92'),_0x5c9a19[_0x50e3('0x77')]);loggerPredictive[_0x50e3('0x83')](_0x50e3('0x93'),_0x5c9a19[_0x50e3('0x78')]);loggerPredictive[_0x50e3('0x83')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5c9a19[_0x50e3('0x77')]);loggerPredictive['info'](_0x50e3('0x94'));_[_0x50e3('0x95')](_0x4f956f,_0x5c9a19);};}function getDiff(_0x4a90b8){var _0x13bc4c=moment()[_0x50e3('0x4c')](0x0);var _0x14200f=moment(_0x4a90b8)[_0x50e3('0x4c')](0x0);return _0x13bc4c[_0x50e3('0x4d')](_0x14200f,_0x50e3('0x4e'));}function ifInterval(_0x37997a,_0xd0bb04){if(_[_0x50e3('0x41')](_0xd0bb04)){return![];}return getDiff(_0xd0bb04)<_0x37997a*0x3c;}function freeVariablesPredictive(_0x449c42){if(isNotNull(_0x449c42)){if(!_['isUndefined'](_0x449c42['startProgressive'])){_0x449c42[_0x50e3('0x2b')]=undefined;loggerPredictive[_0x50e3('0x83')](_0x449c42[_0x50e3('0x44')],_0x50e3('0x96'));}if(!_[_0x50e3('0x41')](_0x449c42['startPredictive'])){_0x449c42[_0x50e3('0x79')]=undefined;loggerPredictive[_0x50e3('0x83')](_0x449c42[_0x50e3('0x44')],_0x50e3('0x97'));}if(!_[_0x50e3('0x41')](_0x449c42[_0x50e3('0x98')])){clearInterval(_0x449c42[_0x50e3('0x98')]);_0x449c42[_0x50e3('0x98')]=undefined;loggerPredictive[_0x50e3('0x83')](_0x449c42['name'],_0x50e3('0x99'));}}}function erlangb(_0x4c3937,_0x5a21a1){if(_0x5a21a1===0x0){return 0x0;}var _0x1ae555=0x1;for(var _0xe75227=0x1;_0xe75227<=_0x5a21a1;_0xe75227+=0x1){_0x1ae555=0x1+_0x1ae555*_0xe75227/_0x4c3937;}return 0x1/_0x1ae555;}function isVoiceQueueOutbound(_0x3a3a83){return _0x3a3a83===_0x50e3('0x50');}function isNotPreview(_0x2c283f){return _0x2c283f!==_0x50e3('0x22');}function isCampaignIvr(_0x47fbc5){return _0x47fbc5==='ivr';}function getCallerId(_0x284bfd,_0x2d3344,_0x418133){if(!_[_0x50e3('0x41')](_0x418133)&&typeof _0x418133===_0x50e3('0x9a')&&!_[_0x50e3('0x4a')](_0x418133)){if(!_['isUndefined'](_0x2d3344)&&typeof _0x2d3344==='string'&&!_[_0x50e3('0x4a')](_0x2d3344)){return util['format'](_0x50e3('0x9b'),_0x2d3344,_0x418133);}return util[_0x50e3('0x80')]('\x22%s\x22\x20<%s>',_0x418133,_0x418133);}if(!_[_0x50e3('0x41')](_0x284bfd)&&typeof _0x284bfd===_0x50e3('0x9a')&&!_['isEmpty'](_0x284bfd)){return _0x284bfd;}return _0x50e3('0x9c');}function loggerCatchQueueSummary(_0x54715a,_0x4b8322){return function(_0x2e68f6){freeVariablesPredictive(_0x4b8322);emitVoiceQueueSummary(_0x4b8322);emitCampaignSummary(_0x4b8322);loggerSyncQueueSummary['error'](_0x54715a,util[_0x50e3('0x9d')](_0x2e68f6,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x176e65,_0x401623){return function(_0x7188c1){loggerPredictive['error'](_0x401623['name'],_0x176e65);loggerPredictive['error'](_0x7188c1[_0x50e3('0x9e')]);freeVariablesPredictive(_0x401623);};}function loggerCatch(_0x1d2555){return function(_0xb88c41){logger['error'](_0x1d2555,util[_0x50e3('0x9d')](_0xb88c41,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5186be){return _0x5186be&&!_['isUndefined'](_0x5186be)&&_0x5186be[_0x50e3('0x9f')]>0x0;}function decremetOriginate(_0x26aa09){if(!_[_0x50e3('0x41')](_0x26aa09)&&_0x26aa09!==null){if(typeof _0x26aa09[_0x50e3('0x75')]!=='undefined'){if(_0x26aa09[_0x50e3('0x75')]>0x0){_0x26aa09[_0x50e3('0x75')]-=0x1;}else{logger[_0x50e3('0xa0')](_0x50e3('0xa1'));}}}else{logger[_0x50e3('0xa0')](_0x50e3('0xa2'));}}function checkContactLowerLimitOriginate(_0x454853,_0x494d9d,_0x3db59f){if(_0x494d9d>_0x3db59f){for(var _0x4620bf=0x0;_0x4620bf<_0x494d9d-_0x3db59f;_0x4620bf+=0x1){decremetOriginate(_0x454853);}}}function loggerGetContactDialer(_0x4da043,_0x2d6ace,_0x253f1e){return function(_0xb94351){checkContactLowerLimitOriginate(_0x2d6ace,_0x253f1e,0x0);logger['error'](_0x4da043,util[_0x50e3('0x9d')](_0xb94351,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5aa1e8){return function(_0x5d4db3){if(isNotNull(_0x5d4db3)&&isNotNull(_0x5d4db3[0x0])){if(_0x5d4db3[0x0]['contactsRescheduled']>0x0){_0x5aa1e8[_0x50e3('0x42')]=_0x50e3('0xa3');logger['info'](_0x50e3('0xa4')+_0x5aa1e8[_0x50e3('0x44')],_0x5d4db3[0x0]['contactsRescheduled'],'contacts');}else{_0x5aa1e8['message']=_0x50e3('0xa5');logger[_0x50e3('0x83')]('[getContactDialer2][Empty]'+_0x5aa1e8[_0x50e3('0x44')]);}}};}function notSendMessagesQueue(_0x4bea64){if(_0x4bea64[_0x50e3('0xa6')]){freeVariablesPredictive(_0x4bea64);if(_0x4bea64[_0x50e3('0x75')]===0x0&&_0x4bea64['talking']===0x0&&_0x4bea64['waiting']===0x0&&(_0x4bea64[_0x50e3('0xa7')]||0x0)===0x0){_0x4bea64['sendMessageOneNotActive']=![];_0x4bea64[_0x50e3('0x53')]=0x0;_0x4bea64[_0x50e3('0x42')]=_0x50e3('0x45');loggerSyncQueueSummary[_0x50e3('0xa0')](_0x50e3('0xa8'),_0x4bea64[_0x50e3('0x44')],_0x50e3('0xa9'));}else{_0x4bea64['message']='IS_DISACTIVED';loggerSyncQueueSummary[_0x50e3('0xa0')](_0x50e3('0xa8'),_0x4bea64[_0x50e3('0x44')],_0x50e3('0xaa'));}emitVoiceQueueSummary(_0x4bea64);}}function notSendMessagesCampaign(_0x45ca01){if(_0x45ca01['sendMessageOneNotActive']){if(_0x45ca01[_0x50e3('0x75')]===0x0){_0x45ca01[_0x50e3('0xa6')]=![];_0x45ca01[_0x50e3('0x42')]='NOT_ACTIVE';loggerSyncQueueSummary['error'](_0x50e3('0xab'),_0x45ca01[_0x50e3('0x44')],'is\x20not\x20active');}else{_0x45ca01[_0x50e3('0x42')]=_0x50e3('0xac');loggerSyncQueueSummary[_0x50e3('0xa0')](_0x50e3('0xab'),_0x45ca01[_0x50e3('0x44')],_0x50e3('0xaa'));}emitCampaignSummary(_0x45ca01);}}function createObjHistory(_0x4caf37,_0x30808e,_0xc49309,_0x14f1d7,_0x5560aa){_0x4caf37['message']=_0xc49309;var _0x38dbad=new Action(_0x4caf37,_0x30808e);var _0x23c4e0=new History(_0x38dbad);_0x23c4e0[_0x50e3('0xad')]=_0x14f1d7;_0x23c4e0[_0x50e3('0xae')]=_0x5560aa;_0x23c4e0[_0x50e3('0xaf')]=_0x38dbad[_0x50e3('0xb0')];return _0x23c4e0;}Dialer[_0x50e3('0x1d')]['loopClearZombieChannels']=function(){var _0x5c7181=this;setInterval(function(){_0x5c7181[_0x50e3('0xb1')](_0x5c7181['uniqueId'],_0x50e3('0xb2'));_0x5c7181['clearZombieChannels'](_0x5c7181[_0x50e3('0xb3')],'[actions]');},0x32c8);};Dialer['prototype'][_0x50e3('0xb1')]=function(_0x4cdbcc,_0x58ff76){var _0x41378b=this;for(var _0x326eef in _0x4cdbcc){if(typeof _0x4cdbcc[_0x326eef]!==_0x50e3('0xb4')){this['sequence']['enqueue'](function(){if(!_[_0x50e3('0xb5')](_0x4cdbcc[_0x326eef])){return ami[_0x50e3('0xb6')]({'action':_0x50e3('0xb7'),'channel':_0x4cdbcc[_0x326eef]['channel']})[_0x50e3('0xb8')](function(_0x1de03c){if(_0x1de03c['message']===_0x50e3('0xb9')){setTimeout(function(){if(_0x4cdbcc[_0x326eef]&&_0x4cdbcc[_0x326eef][_0x50e3('0x57')]!==_0x50e3('0x7f')){_0x41378b[_0x50e3('0xba')](_0x41378b['voiceQueues'][_0x4cdbcc[_0x326eef][_0x50e3('0xbb')]]);logger[_0x50e3('0xa0')](_0x50e3('0xbc'),_0x58ff76,_0x326eef,_0x4cdbcc[_0x326eef][_0x50e3('0xbb')]);delete _0x4cdbcc[_0x326eef];}if(_0x4cdbcc[_0x326eef]&&_0x4cdbcc[_0x326eef][_0x50e3('0x57')]===_0x50e3('0x7f')){_0x41378b['updateOriginated'](_0x41378b[_0x50e3('0x24')][_0x4cdbcc[_0x326eef][_0x50e3('0xbb')]]);logger[_0x50e3('0xa0')]('[Dialer][checkChannel][ivr]',_0x58ff76,_0x326eef,_0x4cdbcc[_0x326eef][_0x50e3('0xbb')]);delete _0x4cdbcc[_0x326eef];}},0x2328);}});}});}}};Dialer[_0x50e3('0x1d')][_0x50e3('0xbd')]=function(_0x461af0){return BPromise['resolve']()[_0x50e3('0xbe')](cmHopper[_0x50e3('0xbd')](_0x461af0))['catch'](loggerCatch(_0x50e3('0xbf')));};Dialer['prototype'][_0x50e3('0xc0')]=function(_0x125e14){return BPromise[_0x50e3('0xc1')]()[_0x50e3('0xbe')](cmHopperBlack[_0x50e3('0xc0')](_0x125e14))['catch'](loggerCatch(_0x50e3('0xc2')));};Dialer[_0x50e3('0x1d')][_0x50e3('0xc3')]=function(_0x3b30e9){return BPromise[_0x50e3('0xc1')]()[_0x50e3('0xbe')](cmHopperBlack[_0x50e3('0xc3')](_0x3b30e9))[_0x50e3('0xb8')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer['prototype']['averageHandleTime']=function(_0x1a231d){return BPromise[_0x50e3('0xc1')]()[_0x50e3('0xbe')](cmHopperHistory[_0x50e3('0xc4')](_0x1a231d))[_0x50e3('0xb8')](loggerCatch(_0x50e3('0xc5')));};Dialer[_0x50e3('0x1d')]['rescheduleContact']=function(_0x229885){return BPromise[_0x50e3('0xc1')]()[_0x50e3('0xbe')](cmHopper[_0x50e3('0xc6')](_0x229885))[_0x50e3('0xb8')](loggerCatch(_0x50e3('0xc7')));};Dialer['prototype'][_0x50e3('0xc8')]=function(_0x3e52ce,_0x35a0da,_0x55aacc){return BPromise[_0x50e3('0xc1')]()[_0x50e3('0xbe')](cmHopper[_0x50e3('0xc8')](_0x3e52ce,_0x35a0da,_0x55aacc))[_0x50e3('0xb8')](loggerCatch(_0x50e3('0xc9')));};Dialer[_0x50e3('0x1d')]['getContactDialer']=function(_0xeb35b9,_0x19a7da,_0x487e87,_0x4a75f1,_0x1607d1){return BPromise['resolve']()[_0x50e3('0xbe')](cmHopper[_0x50e3('0xca')](_0xeb35b9,_0x19a7da,_0x487e87,_0x4a75f1))['catch'](function(_0x13b9fc){_0x1607d1[_0x50e3('0xcb')]-=_0x487e87;_0x1607d1['temp']=_0x1607d1[_0x50e3('0xcb')]>0x0?_0x1607d1[_0x50e3('0xcb')]:0x0;loggerCatch(_0x50e3('0xcc'))(_0x13b9fc);});};Dialer[_0x50e3('0x1d')][_0x50e3('0xcd')]=function(_0x58207b,_0x5b4b33,_0x5368cb,_0x1b9404){return BPromise['resolve']()[_0x50e3('0xbe')](cmHopper[_0x50e3('0xcd')](_0x58207b,_0x5b4b33,_0x5368cb))[_0x50e3('0xb8')](function(_0x5d4a4a){_0x1b9404[_0x50e3('0xcb')]-=_0x5b4b33;_0x1b9404[_0x50e3('0xcb')]=_0x1b9404[_0x50e3('0xcb')]>0x0?_0x1b9404[_0x50e3('0xcb')]:0x0;loggerCatch(_0x50e3('0xce'))(_0x5d4a4a);});};Dialer[_0x50e3('0x1d')][_0x50e3('0xcf')]=function(_0x434504){return BPromise[_0x50e3('0xc1')]()[_0x50e3('0xbe')](voiceQueueRt[_0x50e3('0xcf')](_0x434504))['catch'](loggerCatch(_0x50e3('0xd0')));};Dialer[_0x50e3('0x1d')][_0x50e3('0xd1')]=function(_0x3f4cf4){return BPromise[_0x50e3('0xc1')]()[_0x50e3('0xbe')](cmHopper['moveContactManagedDialer'](_0x3f4cf4))[_0x50e3('0xb8')](loggerCatch(_0x50e3('0xd2')));};Dialer['prototype'][_0x50e3('0xd3')]=function(_0x5ac306){return BPromise[_0x50e3('0xc1')]()[_0x50e3('0xbe')](cmHopperHistory[_0x50e3('0xd3')](_0x5ac306))[_0x50e3('0xb8')](loggerCatch(_0x50e3('0xd4')));};Dialer['prototype'][_0x50e3('0xba')]=function(_0x19b947){if(!_[_0x50e3('0x41')](_0x19b947)&&_0x19b947!==null){if(typeof _0x19b947[_0x50e3('0x75')]!==_0x50e3('0xb4')){if(_0x19b947['originated']>0x0){_0x19b947['originated']-=0x1;}else{logger[_0x50e3('0xa0')](_0x50e3('0xd5'));}}}else{logger[_0x50e3('0xa0')](_0x50e3('0xd6'));}};Dialer[_0x50e3('0x1d')]['loggerHandler']=function(_0x45ab81,_0x392138){var _0x155e55=this;return function(_0x369b2c){_0x155e55['updateOriginated'](_0x392138);logger[_0x50e3('0xa0')](_0x45ab81,util[_0x50e3('0x9d')](_0x369b2c,{'showHidden':![],'depth':null}));};};Dialer[_0x50e3('0x1d')]['emptyContact']=function(_0xeae3a6,_0xc39894,_0x43414e){var _0x33c1a4={'state':0x19,'statedesc':'notFound'};this[_0x50e3('0xba')](_0xc39894);this[_0x50e3('0xd7')](_['merge'](_0x33c1a4,_[_0x50e3('0xd8')](_0x43414e,[_0x50e3('0xd9'),_0x50e3('0xda'),'UserId','VoiceQueueId',_0x50e3('0xdb')])),'[emptyContact][createHistory]',_0x50e3('0xdc'));logger[_0x50e3('0xa0')](_0xeae3a6);};Dialer[_0x50e3('0x1d')][_0x50e3('0xdd')]=function(_0x3ce4c1){return _0x3ce4c1===_0x50e3('0xde');};Dialer[_0x50e3('0x1d')][_0x50e3('0xdf')]=function(_0x27ce9a){return!_[_0x50e3('0x41')](_0x27ce9a)&&_0x27ce9a&&!_[_0x50e3('0x41')](_0x27ce9a['name'])&&!_['isUndefined'](_0x27ce9a['active'])&&_0x27ce9a['active']&&(this[_0x50e3('0x26')][util[_0x50e3('0x80')](_0x50e3('0xe0'),_0x27ce9a['name'])]['status']===_0x50e3('0xe1')||this[_0x50e3('0x26')][util[_0x50e3('0x80')](_0x50e3('0xe0'),_0x27ce9a['name'])][_0x50e3('0xb7')]===_0x50e3('0xe2'));};Dialer['prototype'][_0x50e3('0xd7')]=function(_0x49e198,_0x35e7ab,_0x51d6eb){this['createHistory'](_0x49e198)[_0x50e3('0xb8')](loggerCatch(_0x35e7ab));this[_0x50e3('0xd1')](_0x49e198)['catch'](loggerCatch(_0x51d6eb));};Dialer['prototype']['syncVarSet']=function(_0x2a69f1){var _0x4b7490=this[_0x50e3('0x29')][_0x2a69f1[_0x50e3('0xe3')]];var _0x177fff;if(!_['isNil'](_0x2a69f1)&&!_['isNil'](_0x2a69f1[_0x50e3('0xe4')])&&!_[_0x50e3('0xb5')](_0x2a69f1['variable'][_0x50e3('0xe5')])&&_0x2a69f1[_0x50e3('0xe6')]==='xcally-motion-dialer'&&_0x4b7490){if(_0x4b7490[_0x50e3('0x57')]!==_0x50e3('0x7f')&&this[_0x50e3('0x23')][_0x4b7490[_0x50e3('0xbb')]][_0x50e3('0xe7')]&&_0x2a69f1['value']==='HANGUP'){delete this['uniqueId'][_0x2a69f1['uniqueid']];this[_0x50e3('0xba')](this[_0x50e3('0x23')][_0x4b7490[_0x50e3('0xbb')]]);this[_0x50e3('0x23')][_0x4b7490[_0x50e3('0xbb')]][_0x50e3('0x60')]+=0x1;this[_0x50e3('0x23')][_0x4b7490[_0x50e3('0xbb')]][_0x50e3('0x5f')]+=0x1;_0x177fff=new Hangup(_0x4b7490,_0x2a69f1);_0x177fff[_0x50e3('0xad')]=0x12;_0x177fff[_0x50e3('0xae')]=_0x50e3('0xe8');_0x177fff['membername']=_0x50e3('0xe9');ami[_0x50e3('0x4f')](_0x50e3('0xea'),ut[_0x50e3('0xeb')](_0x177fff,'amd'));this[_0x50e3('0xd7')](_0x177fff,_0x50e3('0xec'),_0x50e3('0xed'));}if(_0x4b7490[_0x50e3('0x57')]!==_0x50e3('0x7f')&&this[_0x50e3('0x23')][_0x4b7490[_0x50e3('0xbb')]][_0x50e3('0xe7')]&&_0x2a69f1[_0x50e3('0xee')]===_0x50e3('0xef')){var _0x2c122f=this;return new BPromise(function(_0x5c34cc,_0x32b66d){delete _0x2c122f[_0x50e3('0x29')][_0x2a69f1[_0x50e3('0xe3')]];_0x2c122f[_0x50e3('0xba')](_0x2c122f[_0x50e3('0x23')][_0x4b7490[_0x50e3('0xbb')]]);_0x2c122f[_0x50e3('0x23')][_0x4b7490[_0x50e3('0xbb')]]['outboundAnswerCallsDay']+=0x1;_0x2c122f['voiceQueues'][_0x4b7490['queue']][_0x50e3('0x5f')]+=0x1;var _0x505581=_0x2c122f['voiceQueues'][_0x4b7490[_0x50e3('0xbb')]];var _0x4ff172=new Hangup(_0x4b7490,_0x2a69f1);_0x4ff172['state']=0x13;_0x4ff172[_0x50e3('0xae')]=_0x50e3('0xf0');_0x4ff172[_0x50e3('0xf1')]=_0x50e3('0xe9');_0x4ff172[_0x50e3('0xf2')]+=0x1;_0x4ff172[_0x50e3('0xf3')]+=0x1;_0x4ff172[_0x50e3('0xf4')]=!![];ami[_0x50e3('0x4f')](_0x50e3('0xea'),ut[_0x50e3('0xeb')](_0x4ff172,_0x50e3('0xf4')));_0x2c122f[_0x50e3('0xd3')](_0x4ff172)[_0x50e3('0xb8')](loggerCatch(_0x50e3('0xf5')));if(_0x4ff172[_0x50e3('0xf6')]+_0x4ff172[_0x50e3('0xf7')]+_0x4ff172[_0x50e3('0xf8')]+_0x4ff172[_0x50e3('0xf9')]+_0x4ff172[_0x50e3('0xfa')]+_0x4ff172['countabandonedretry']+_0x4ff172[_0x50e3('0xf2')]+_0x4ff172['countagentrejectretry']>=_0x505581[_0x50e3('0xfb')]){_0x2c122f[_0x50e3('0xfc')](_0x4ff172,_0x5c34cc,_0x32b66d,_0x50e3('0xfd'));}else{if(_0x4ff172[_0x50e3('0xf2')]>=_0x505581['dialMachineMaxRetry']){_0x2c122f['createStateFinal'](_0x4ff172,_0x5c34cc,_0x32b66d,'reason\x2019\x20machine....');}else{_0x2c122f[_0x50e3('0xc6')]({'active':![],'countmachineretry':_0x4ff172[_0x50e3('0xf2')],'scheduledat':moment()[_0x50e3('0xfe')](_0x505581[_0x50e3('0xff')],'minutes')['format'](_0x50e3('0x100')),'ContactId':_0x4ff172[_0x50e3('0xd9')],'ListId':_0x4ff172['ListId'],'VoiceQueueId':_0x4ff172[_0x50e3('0x101')]||undefined,'CampaignId':_0x4ff172[_0x50e3('0xdb')]||undefined})[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x102')));_0x5c34cc({'reschedule':0x1});}}});}if(_0x4b7490[_0x50e3('0x57')]===_0x50e3('0x7f')&&this[_0x50e3('0x24')][_0x4b7490[_0x50e3('0xbb')]][_0x50e3('0xe7')]&&_0x2a69f1[_0x50e3('0xee')]===_0x50e3('0x103')){delete this[_0x50e3('0x29')][_0x2a69f1['uniqueid']];this[_0x50e3('0xba')](this[_0x50e3('0x24')][_0x4b7490[_0x50e3('0xbb')]]);_0x177fff=new Hangup(_0x4b7490,_0x2a69f1);_0x177fff[_0x50e3('0xad')]=0x12;_0x177fff[_0x50e3('0xae')]=_0x50e3('0xe8');_0x177fff[_0x50e3('0xf1')]='AMD';ami[_0x50e3('0x4f')]('custom:amd',ut[_0x50e3('0xeb')](_0x177fff,_0x50e3('0xf4')));this[_0x50e3('0xd7')](_0x177fff,_0x50e3('0x104'),'[syncHangupInAMDIvr]');}if(_0x4b7490[_0x50e3('0x57')]===_0x50e3('0x7f')&&this['campaigns'][_0x4b7490[_0x50e3('0xbb')]][_0x50e3('0xe7')]&&_0x2a69f1['value']===_0x50e3('0xef')){var _0x2c122f=this;return new BPromise(function(_0x5d2932,_0x2f0c6d){delete _0x2c122f[_0x50e3('0x29')][_0x2a69f1[_0x50e3('0xe3')]];_0x2c122f[_0x50e3('0xba')](_0x2c122f[_0x50e3('0x24')][_0x4b7490['queue']]);_0x2c122f['campaigns'][_0x4b7490[_0x50e3('0xbb')]][_0x50e3('0x60')]+=0x1;_0x2c122f[_0x50e3('0x24')][_0x4b7490['queue']][_0x50e3('0x5f')]+=0x1;var _0x8d87ce=_0x2c122f[_0x50e3('0x24')][_0x4b7490['queue']];var _0x54267b=new Hangup(_0x4b7490,_0x2a69f1);_0x54267b[_0x50e3('0xad')]=0x13;_0x54267b[_0x50e3('0xae')]=_0x50e3('0xf0');_0x54267b[_0x50e3('0xf1')]=_0x50e3('0xe9');_0x54267b[_0x50e3('0xf2')]+=0x1;_0x54267b[_0x50e3('0xf3')]+=0x1;_0x54267b[_0x50e3('0xf4')]=!![];ami[_0x50e3('0x4f')](_0x50e3('0xea'),ut[_0x50e3('0xeb')](_0x54267b,'amd'));_0x2c122f[_0x50e3('0xd3')](_0x54267b)[_0x50e3('0xb8')](loggerCatch(_0x50e3('0xf5')));if(_0x54267b[_0x50e3('0xf6')]+_0x54267b[_0x50e3('0xf7')]+_0x54267b['countnoanswerretry']+_0x54267b[_0x50e3('0xf9')]+_0x54267b[_0x50e3('0xfa')]+_0x54267b[_0x50e3('0x105')]+_0x54267b[_0x50e3('0xf2')]+_0x54267b[_0x50e3('0x106')]>=_0x8d87ce[_0x50e3('0xfb')]){_0x2c122f[_0x50e3('0xfc')](_0x54267b,_0x5d2932,_0x2f0c6d,_0x50e3('0xfd'));}else{if(_0x54267b['countmachineretry']>=_0x8d87ce[_0x50e3('0x107')]){_0x2c122f[_0x50e3('0x108')](_0x54267b,_0x5d2932,_0x2f0c6d,_0x50e3('0x109'));}else{_0x2c122f[_0x50e3('0xc6')]({'active':![],'countmachineretry':_0x54267b[_0x50e3('0xf2')],'scheduledat':moment()[_0x50e3('0xfe')](_0x8d87ce[_0x50e3('0xff')],_0x50e3('0x10a'))[_0x50e3('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x54267b[_0x50e3('0xd9')],'ListId':_0x54267b[_0x50e3('0xda')],'VoiceQueueId':_0x54267b[_0x50e3('0x101')]||undefined,'CampaignId':_0x54267b['CampaignId']||undefined})[_0x50e3('0xb8')](loggerCatch('[rescheduleContact][Machine]'));_0x5d2932({'reschedule':0x1});}}});}}};Dialer[_0x50e3('0x1d')][_0x50e3('0x3a')]=function(_0x733574){var _0xb14798=this[_0x50e3('0x29')][_0x733574[_0x50e3('0xe3')]];var _0x106ea8=this;var _0x3d6354;if(_0xb14798&&_0xb14798[_0x50e3('0x57')]===_0x50e3('0x7f')){delete this[_0x50e3('0x29')][_0x733574['uniqueid']];this[_0x50e3('0xba')](this['campaigns'][_0xb14798[_0x50e3('0xbb')]]);this[_0x50e3('0x24')][_0xb14798[_0x50e3('0xbb')]][_0x50e3('0x10b')]+=0x1;_0x3d6354=new Hangup(_0xb14798,_0x733574);this[_0x50e3('0xd3')](_0x3d6354)[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x10c')));this[_0x50e3('0xd1')](_0x3d6354)[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x10d')));}if(_0xb14798&&_0xb14798[_0x50e3('0x57')]!==_0x50e3('0x7f')&&isNotNull(this[_0x50e3('0x23')][_0xb14798[_0x50e3('0xbb')]][_0x50e3('0x10e')])){delete this[_0x50e3('0x29')][_0x733574[_0x50e3('0xe3')]];this[_0x50e3('0xba')](this[_0x50e3('0x23')][_0xb14798['queue']]);this[_0x50e3('0x23')][_0xb14798['queue']][_0x50e3('0x60')]+=0x1;this['voiceQueues'][_0xb14798[_0x50e3('0xbb')]][_0x50e3('0x5f')]+=0x1;_0x3d6354=new Hangup(_0xb14798,_0x733574);_0x3d6354[_0x50e3('0xad')]=0x10;_0x3d6354[_0x50e3('0xae')]=_0x50e3('0x10f');_0x3d6354[_0x50e3('0xf1')]=_0x50e3('0x110');this[_0x50e3('0xd3')](_0x3d6354)['catch'](loggerCatch(_0x50e3('0x10c')));this[_0x50e3('0xd1')](_0x3d6354)['catch'](loggerCatch(_0x50e3('0x10d')));}if(_0xb14798&&_0xb14798[_0x50e3('0x57')]!=='ivr'&&!isNotNull(this[_0x50e3('0x23')][_0xb14798[_0x50e3('0xbb')]][_0x50e3('0x10e')])){delete this['uniqueId'][_0x733574[_0x50e3('0xe3')]];this[_0x50e3('0xba')](this[_0x50e3('0x23')][_0xb14798[_0x50e3('0xbb')]]);this[_0x50e3('0x23')][_0xb14798[_0x50e3('0xbb')]][_0x50e3('0x6a')]+=0x1;_0x3d6354=new Hangup(_0xb14798,_0x733574);_0x3d6354[_0x50e3('0xad')]=0xc;_0x3d6354[_0x50e3('0xae')]=_0x733574[_0x50e3('0x111')];_0x3d6354['membername']=_0x50e3('0x112');this['createHistory'](_0x3d6354)[_0x50e3('0xb8')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x50e3('0xd1')](_0x3d6354)[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x10d')));}};Dialer['prototype'][_0x50e3('0x37')]=function(_0x23a197){var _0x19a082=this['uniqueId'][_0x23a197[_0x50e3('0xe3')]];var _0x20ff97=this;if(this[_0x50e3('0x23')][_0x23a197[_0x50e3('0xbb')]]){if(_0x19a082&&_0x19a082['type']!==_0x50e3('0x7f')){delete this['uniqueId'][_0x23a197[_0x50e3('0xe3')]];this['voiceQueues'][_0x23a197[_0x50e3('0xbb')]][_0x50e3('0x60')]+=0x1;var _0x5b5b50=new AgentComplete(_0x19a082,_0x23a197);if(_0x23a197[_0x50e3('0x113')]===_0x50e3('0x114')){_0x5b5b50[_0x50e3('0x115')]=this[_0x50e3('0x23')][_0x23a197[_0x50e3('0xbb')]]['dialQueueProject2']&&this[_0x50e3('0x23')][_0x23a197[_0x50e3('0xbb')]][_0x50e3('0x116')]?moment()[_0x50e3('0x80')](_0x50e3('0x100')):undefined;}this[_0x50e3('0xd3')](_0x5b5b50)['catch'](loggerCatch(_0x50e3('0x117')));this[_0x50e3('0xd1')](_0x5b5b50)[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x118')));}}};Dialer[_0x50e3('0x1d')]['syncAgentConnect']=function(_0xf88efb){if(this[_0x50e3('0x23')][_0xf88efb[_0x50e3('0xbb')]]){if(this[_0x50e3('0x29')][_0xf88efb['uniqueid']]&&this['uniqueId'][_0xf88efb[_0x50e3('0xe3')]][_0x50e3('0x57')]!==_0x50e3('0x7f')){this[_0x50e3('0xba')](this[_0x50e3('0x23')][_0xf88efb['queue']]);this[_0x50e3('0x29')][_0xf88efb['uniqueid']]['answertime']=moment()['format'](_0x50e3('0x100'));}}};Dialer[_0x50e3('0x1d')]['queueCallerAbandonCreateState']=function(_0x20f045){this[_0x50e3('0xd3')](_0x20f045)[_0x50e3('0xb8')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x50e3('0xd1')](_0x20f045)[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x119')));};Dialer[_0x50e3('0x1d')][_0x50e3('0x32')]=function(_0x20d89a){var _0x20bb45=this[_0x50e3('0x29')][_0x20d89a[_0x50e3('0xe3')]];var _0x58ca0f=this;if(this['voiceQueues'][_0x20d89a[_0x50e3('0xbb')]]){if(_0x20bb45&&_0x20bb45['type']!==_0x50e3('0x7f')){delete this['uniqueId'][_0x20d89a[_0x50e3('0xe3')]];this[_0x50e3('0xba')](this[_0x50e3('0x23')][_0x20d89a['queue']]);_0x20bb45['droptime']=moment()[_0x50e3('0x80')]('YYYY-MM-DD\x20HH:mm:ss');var _0x2d5e31=new QueueCallerAbandon(_0x20bb45,_0x20d89a);if(getSeconds(_0x20bb45[_0x50e3('0x11a')],_0x20bb45[_0x50e3('0x11b')])>=_0x20bb45[_0x50e3('0x11c')]){this[_0x50e3('0x23')][_0x20d89a[_0x50e3('0xbb')]][_0x50e3('0x6e')]+=0x1;this[_0x50e3('0x23')][_0x20d89a[_0x50e3('0xbb')]][_0x50e3('0x64')]+=0x1;this[_0x50e3('0x23')][_0x20d89a[_0x50e3('0xbb')]][_0x50e3('0x70')]+=0x1;_0x2d5e31[_0x50e3('0xad')]=0xa;_0x2d5e31[_0x50e3('0xae')]=_0x50e3('0x11d');_0x2d5e31[_0x50e3('0x11e')]=_0x50e3('0x11f');_0x2d5e31[_0x50e3('0x115')]=this[_0x50e3('0x23')][_0x20d89a['queue']][_0x50e3('0x120')]?moment()[_0x50e3('0x80')](_0x50e3('0x100')):undefined;_0x2d5e31[_0x50e3('0xfa')]+=0x1;_0x2d5e31[_0x50e3('0xf3')]+=0x1;if(_0x2d5e31[_0x50e3('0xfa')]>=this[_0x50e3('0x23')][_0x20d89a['queue']][_0x50e3('0x121')]){this[_0x50e3('0x122')](_0x2d5e31);}else{this[_0x50e3('0xc6')]({'active':![],'countdropretry':_0x2d5e31[_0x50e3('0xfa')],'scheduledat':moment()[_0x50e3('0xfe')](this[_0x50e3('0x23')][_0x20d89a[_0x50e3('0xbb')]][_0x50e3('0x123')],_0x50e3('0x10a'))[_0x50e3('0x80')](_0x50e3('0x100')),'ContactId':_0x20bb45[_0x50e3('0xd9')],'ListId':_0x20bb45[_0x50e3('0xda')],'VoiceQueueId':_0x20bb45[_0x50e3('0x101')]||undefined,'CampaignId':_0x20bb45[_0x50e3('0xdb')]||undefined})['catch'](loggerCatch(_0x50e3('0x124')));var _0x73328a=new History(_0x2d5e31);_0x73328a[_0x50e3('0xad')]=0xa;_0x73328a['statedesc']=_0x50e3('0x11d');_0x73328a['starttime']=moment()[_0x50e3('0x80')]('YYYY-MM-DD\x20HH:mm:ss');_0x73328a['endtime']=_0x73328a[_0x50e3('0xb0')];_0x73328a[_0x50e3('0x125')]=_0x2d5e31[_0x50e3('0x125')];_0x73328a['calleridnum']=_0x2d5e31['calleridnum'];this[_0x50e3('0xd3')](_0x73328a)[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x126')));}}else{this['voiceQueues'][_0x20d89a['queue']]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x50e3('0x23')][_0x20d89a[_0x50e3('0xbb')]]['outboundDropCallsDayCallersExit']+=0x1;_0x2d5e31[_0x50e3('0xad')]=0xb;_0x2d5e31[_0x50e3('0xae')]='Abandoned';_0x2d5e31[_0x50e3('0x11e')]=_0x50e3('0x127');_0x2d5e31[_0x50e3('0x105')]+=0x1;_0x2d5e31[_0x50e3('0xf3')]+=0x1;if(_0x2d5e31[_0x50e3('0x105')]>=this[_0x50e3('0x23')][_0x20d89a[_0x50e3('0xbb')]][_0x50e3('0x128')]){this['queueCallerAbandonCreateState'](_0x2d5e31);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x2d5e31['countabandonedretry'],'scheduledat':moment()['add'](this[_0x50e3('0x23')][_0x20d89a[_0x50e3('0xbb')]][_0x50e3('0x129')],_0x50e3('0x10a'))[_0x50e3('0x80')](_0x50e3('0x100')),'ContactId':_0x20bb45['ContactId'],'ListId':_0x20bb45[_0x50e3('0xda')],'VoiceQueueId':_0x20bb45[_0x50e3('0x101')]||undefined,'CampaignId':_0x20bb45['CampaignId']||undefined})[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x12a')));var _0x73328a=new History(_0x2d5e31);_0x73328a[_0x50e3('0xad')]=0xb;_0x73328a[_0x50e3('0xae')]=_0x50e3('0x12b');_0x73328a[_0x50e3('0xb0')]=moment()[_0x50e3('0x80')](_0x50e3('0x100'));_0x73328a[_0x50e3('0xaf')]=_0x73328a[_0x50e3('0xb0')];_0x73328a['calleridname']=_0x2d5e31[_0x50e3('0x125')];_0x73328a['calleridnum']=_0x2d5e31['calleridnum'];this[_0x50e3('0xd3')](_0x73328a)[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x12c')));}}}}};Dialer[_0x50e3('0x1d')][_0x50e3('0x12d')]=function(_0x3513f7){if(this[_0x50e3('0xb3')][_0x3513f7[_0x50e3('0xe3')]]){this[_0x50e3('0xb3')][_0x3513f7['uniqueid']]['channel']=_0x3513f7[_0x50e3('0x12e')];}if(this['uniqueId'][_0x3513f7[_0x50e3('0xe3')]]){this[_0x50e3('0x29')][_0x3513f7[_0x50e3('0xe3')]][_0x50e3('0x12e')]=_0x3513f7[_0x50e3('0x12e')];}};Dialer[_0x50e3('0x1d')][_0x50e3('0x12f')]=function(_0x414bf4){if(strategy[this[_0x50e3('0x23')][this['actions'][_0x414bf4[_0x50e3('0x130')]][_0x50e3('0xbb')]]['strategy']]===_0x50e3('0x131')){if(this[_0x50e3('0xb3')][_0x414bf4[_0x50e3('0x130')]]&&_[_0x50e3('0xb5')](this[_0x50e3('0xb3')][_0x414bf4[_0x50e3('0x130')]][_0x50e3('0x132')])&&_0x414bf4[_0x50e3('0xb7')]==='1'&&_0x414bf4['paused']==='0'){if(this[_0x50e3('0x25')][_0x414bf4[_0x50e3('0x133')]]){if(!this[_0x50e3('0x25')][_0x414bf4['stateinterface']]['locked']){this[_0x50e3('0x25')][_0x414bf4[_0x50e3('0x133')]][_0x50e3('0x132')]=!![];this[_0x50e3('0xb3')][_0x414bf4['actionid']][_0x50e3('0x132')]=!![];this[_0x50e3('0xb3')][_0x414bf4[_0x50e3('0x130')]][_0x50e3('0x133')]=_0x414bf4['stateinterface'];}}}}else if((strategy[this[_0x50e3('0x23')][this[_0x50e3('0xb3')][_0x414bf4['actionid']][_0x50e3('0xbb')]][_0x50e3('0x51')]]||_0x50e3('0x1c'))==='rrmemory'){if(this['actions'][_0x414bf4[_0x50e3('0x130')]]){if(this[_0x50e3('0x25')][_0x414bf4[_0x50e3('0x133')]]){this[_0x50e3('0xb3')][_0x414bf4[_0x50e3('0x130')]]['stateinterface']=_0x414bf4['stateinterface'];if(_['isNil'](this[_0x50e3('0x2d')][this['actions'][_0x414bf4['actionid']]['queue']])){this[_0x50e3('0x2d')][this[_0x50e3('0xb3')][_0x414bf4[_0x50e3('0x130')]][_0x50e3('0xbb')]]=[];}this[_0x50e3('0x2d')][this[_0x50e3('0xb3')][_0x414bf4[_0x50e3('0x130')]][_0x50e3('0xbb')]][_0x50e3('0x134')](_['merge'](_['pick'](this[_0x50e3('0xb3')][_0x414bf4[_0x50e3('0x130')]],[_0x50e3('0x135'),_0x50e3('0x133')]),{'status':_0x414bf4['status'],'paused':_0x414bf4[_0x50e3('0x136')]}));}}}};function unlockQueueStatus(_0x38d4fe,_0x2f2da5){setTimeout(function(){if(_['isUndefined'](_0x38d4fe[_0x50e3('0x137')])){loggerBooked[_0x50e3('0xa0')](_0x50e3('0x138'),_0x2f2da5);}_0x38d4fe['queueStatusComplete']=!![];loggerBooked[_0x50e3('0x83')](_0x50e3('0x139'),_0x2f2da5,JSON['stringify'](_[_0x50e3('0xd8')](_0x38d4fe,[_0x50e3('0x44'),'queueStatusComplete'])));},0x1f3);}Dialer[_0x50e3('0x1d')][_0x50e3('0x3e')]=function(_0x46fc51){var _0x5527e1=this;var _0x29be24=_0x5527e1[_0x50e3('0x23')][_0x5527e1['actions'][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0xbb')]];if(strategy[this[_0x50e3('0x23')][this['actions'][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0xbb')]][_0x50e3('0x51')]]==='roundrobin'){if(this[_0x50e3('0xb3')][_0x46fc51['actionid']]&&this[_0x50e3('0xb3')][_0x46fc51['actionid']][_0x50e3('0x133')]){this[_0x50e3('0x22')][_0x50e3('0x13a')](this['actions'][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0x135')],this[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0x133')])[_0x50e3('0xb8')](function(_0xbf506d){logger[_0x50e3('0xa0')](_0x50e3('0x13b'),util[_0x50e3('0x9d')](_0xbf506d,{'showHidden':![],'depth':null}));})[_0x50e3('0x20')](function(){_0x5527e1['updateOriginated'](_0x5527e1[_0x50e3('0x23')][_0x5527e1[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0xbb')]]);_0x5527e1[_0x50e3('0x25')][_0x5527e1[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]]['stateinterface']]['locked']=![];delete _0x5527e1['actions'][_0x46fc51['actionid']];unlockQueueStatus(_0x29be24);});}else{this[_0x50e3('0xba')](this['voiceQueues'][this[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]]['queue']]);this[_0x50e3('0xc6')]({'active':![],'ContactId':this[_0x50e3('0xb3')][_0x46fc51['actionid']]['ContactId'],'ListId':this[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0xda')],'VoiceQueueId':this[_0x50e3('0xb3')][_0x46fc51['actionid']][_0x50e3('0x101')]||undefined,'CampaignId':this['actions'][_0x46fc51[_0x50e3('0x130')]]['CampaignId']||undefined})[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x13c')));delete this[_0x50e3('0xb3')][_0x46fc51['actionid']];unlockQueueStatus(_0x29be24);}}else if((strategy[this['voiceQueues'][this[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0xbb')]][_0x50e3('0x51')]]||_0x50e3('0x1c'))===_0x50e3('0x1c')){var _0x3d97a2;if(this[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]]&&!_[_0x50e3('0x4a')](this[_0x50e3('0x2d')][this[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0xbb')]])){if(this[_0x50e3('0x2e')][_0x5527e1['actions'][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0xbb')]]){this['queueBookedRR'][_0x5527e1[_0x50e3('0xb3')][_0x46fc51['actionid']][_0x50e3('0xbb')]]=this[_0x50e3('0x2e')][this[_0x50e3('0xb3')][_0x46fc51['actionid']][_0x50e3('0xbb')]]?this[_0x50e3('0x2e')][this[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0xbb')]]:this[_0x50e3('0x2d')][this[_0x50e3('0xb3')][_0x46fc51['actionid']][_0x50e3('0xbb')]]?this[_0x50e3('0x2d')][this[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0xbb')]][_0x50e3('0x13d')]||0x0:0x0;}this['queueBooked'][this[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0xbb')]][_0x50e3('0x13d')]=this[_0x50e3('0x2e')][this[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0xbb')]];for(var _0x1b34c6=0x0;_0x1b34c6<this[_0x50e3('0x2d')][this[_0x50e3('0xb3')][_0x46fc51['actionid']][_0x50e3('0xbb')]][_0x50e3('0x9f')];_0x1b34c6+=0x1){_0x3d97a2=rr(this[_0x50e3('0x2d')][this[_0x50e3('0xb3')][_0x46fc51['actionid']][_0x50e3('0xbb')]]);this[_0x50e3('0x2e')][_0x5527e1[_0x50e3('0xb3')][_0x46fc51['actionid']][_0x50e3('0xbb')]]=this[_0x50e3('0x2d')][this[_0x50e3('0xb3')][_0x46fc51['actionid']][_0x50e3('0xbb')]]['_rr'];if(_0x3d97a2[_0x50e3('0xb7')]==='1'&&_0x3d97a2[_0x50e3('0x136')]==='0'){break;}}if(!_[_0x50e3('0xb5')](_0x3d97a2)){this[_0x50e3('0x25')][_0x3d97a2[_0x50e3('0x133')]]['unlockRR']=_[_0x50e3('0x41')](this['agents'][_0x3d97a2[_0x50e3('0x133')]][_0x50e3('0x13e')])?!![]:this[_0x50e3('0x25')][_0x3d97a2[_0x50e3('0x133')]][_0x50e3('0x13e')];}loggerBooked[_0x50e3('0x83')](_0x50e3('0x13f'),_0x46fc51['actionid'],_0x50e3('0x140'),JSON[_0x50e3('0x7d')](_[_0x50e3('0xd8')](this[_0x50e3('0x25')][_0x3d97a2[_0x50e3('0x133')]],[_0x50e3('0x44'),_0x50e3('0x13e')])),_0x50e3('0x141'),JSON['stringify'](_0x3d97a2['idHopper']));if(!_['isNil'](_0x3d97a2)&&_0x3d97a2[_0x50e3('0xb7')]==='1'&&_0x3d97a2[_0x50e3('0x136')]==='0'&&this[_0x50e3('0x25')][_0x3d97a2[_0x50e3('0x133')]]['unlockRR']){this[_0x50e3('0x25')][_0x3d97a2[_0x50e3('0x133')]]['unlockRR']=![];this[_0x50e3('0x2d')][_0x5527e1['actions'][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0xbb')]]=[];this['preview'][_0x50e3('0x13a')](_0x3d97a2[_0x50e3('0x135')],_0x3d97a2[_0x50e3('0x133')])[_0x50e3('0xb8')](function(_0xe5e9e){logger[_0x50e3('0xa0')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x50e3('0x9d')](_0xe5e9e,{'showHidden':![],'depth':null}));})[_0x50e3('0x20')](function(){_0x5527e1['updateOriginated'](_0x5527e1[_0x50e3('0x23')][_0x5527e1[_0x50e3('0xb3')][_0x46fc51['actionid']][_0x50e3('0xbb')]]);setTimeout(function(){_0x5527e1[_0x50e3('0x25')][_0x3d97a2['stateinterface']][_0x50e3('0x13e')]=!![];loggerBooked[_0x50e3('0x83')](_0x50e3('0x142'),_0x46fc51['actionid'],_0x50e3('0x140'),JSON['stringify'](_[_0x50e3('0xd8')](_0x5527e1[_0x50e3('0x25')][_0x3d97a2['stateinterface']],[_0x50e3('0x44'),_0x50e3('0x13e')])),_0x50e3('0x141'),JSON[_0x50e3('0x7d')](_0x3d97a2[_0x50e3('0x135')]));},0xc7);delete _0x5527e1[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]];unlockQueueStatus(_0x29be24,_0x46fc51['actionid']);});}else{loggerBooked[_0x50e3('0x83')](_0x50e3('0x143'));this[_0x50e3('0xba')](this[_0x50e3('0x23')][this[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0xbb')]]);this[_0x50e3('0xc6')]({'active':![],'ContactId':this[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0xd9')],'ListId':this['actions'][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0xda')],'VoiceQueueId':this['actions'][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0x101')]||undefined,'CampaignId':this[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0xdb')]||undefined})[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x13c')));delete this[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]];unlockQueueStatus(_0x29be24);}}else{loggerBooked[_0x50e3('0x83')](_0x50e3('0x144'));this[_0x50e3('0xba')](this[_0x50e3('0x23')][this[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0xbb')]]);this[_0x50e3('0xc6')]({'active':![],'ContactId':this[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0xd9')],'ListId':this[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]]['ListId'],'VoiceQueueId':this[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0x101')]||undefined,'CampaignId':this[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0xdb')]||undefined})[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x145')));delete this[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]];unlockQueueStatus(_0x29be24);}}else{loggerBooked[_0x50e3('0x83')](_0x50e3('0x146'));this['updateOriginated'](this[_0x50e3('0x23')][this[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0xbb')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]]['ContactId'],'ListId':this[_0x50e3('0xb3')][_0x46fc51['actionid']][_0x50e3('0xda')],'VoiceQueueId':this['actions'][_0x46fc51[_0x50e3('0x130')]]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0x46fc51['actionid']][_0x50e3('0xdb')]||undefined})[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x147')));delete this[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]];unlockQueueStatus(_0x29be24);}};Dialer[_0x50e3('0x1d')]['loopCampaigns']=function(){var _0x3b49ff=this;setInterval(function(){_0x3b49ff[_0x50e3('0x148')]();},0x3e8);};Dialer[_0x50e3('0x1d')]['checkIsTrunkReachable']=function(_0x155b4b){var _0x57fcbf=this;return function(){if(!_0x57fcbf[_0x50e3('0xdf')](_0x155b4b[_0x50e3('0x7a')])){if(!_0x57fcbf[_0x50e3('0xdf')](_0x155b4b['TrunkBackup'])){_0x155b4b[_0x50e3('0x42')]=_0x50e3('0x149');throw _0x155b4b[_0x50e3('0x44')]+_0x50e3('0x14a');}}};};Dialer['prototype'][_0x50e3('0x14b')]=function(_0x57557f,_0x894c61,_0x2be12a,_0x292c89){var _0x222531=this;return function(){var _0xd55cb1=!![];return _0x222531[_0x50e3('0x14c')](_0x57557f,_0x894c61,_0x2be12a,_0x292c89,_0xd55cb1);};};Dialer[_0x50e3('0x1d')]['checkIfTimeIntervals']=function(_0x58a836,_0x1b3d74,_0x4e35eb,_0x25b091){var _0x3a21e7=this;return function(){var _0xadd93=![];return _0x3a21e7[_0x50e3('0x14c')](_0x58a836[_0x50e3('0x48')],_0x1b3d74,_0x4e35eb,_0x25b091,_0xadd93);};};Dialer[_0x50e3('0x1d')][_0x50e3('0x14c')]=function(_0x3871fc,_0x3f7aee,_0x251d75,_0x40677b,_0x164011){var _0x1cc9dc=[];return new BPromise(function(_0x212ae2,_0xfde8bd){if(!isNotNull(_0x3871fc)){_0x40677b[_0x50e3('0x42')]='INTERVAL_IS_NULL';return _0xfde8bd(msgResponse('ifTime',_0x50e3('0x14d'),_0x251d75+_0x50e3('0x14e')));}if(_[_0x50e3('0x4a')](_0x3871fc)){_0x40677b[_0x50e3('0x42')]=_0x50e3('0x14f');return _0xfde8bd(msgResponse(_0x50e3('0x14c'),'Failure',_0x251d75+'\x20Intervals\x20is\x20empty\x20'));}if(_0x3f7aee&&_[_0x50e3('0x41')](config[_0x50e3('0x150')][_0x3f7aee])){_0x40677b[_0x50e3('0x42')]='TIMEZONE_UNKNOW';return _0xfde8bd(msgResponse(_0x50e3('0x14c'),_0x50e3('0x14d'),_0x251d75+_0x50e3('0x151')+_0x3f7aee));}if(_[_0x50e3('0x152')](_0x3871fc)){for(var _0x578b8f=0x0;_0x578b8f<_0x3871fc[_0x50e3('0x9f')];_0x578b8f+=0x1){_0x1cc9dc[_0x50e3('0x134')](ami[_0x50e3('0xb6')]({'action':_0x50e3('0x153'),'command':util[_0x50e3('0x80')](_0x50e3('0x154'),_0x3871fc[_0x578b8f]['interval'],!_[_0x50e3('0x41')](config[_0x50e3('0x150')][_0x3f7aee])?_0x3f7aee:'')})['then'](function(_0x43efe5){return _0x43efe5['content'][_0x50e3('0x155')]('true')>=0x0;})['catch'](myreject(_0xfde8bd)));}}else{_0x1cc9dc[_0x50e3('0x134')](ami[_0x50e3('0xb6')]({'action':_0x50e3('0x153'),'command':util['format'](_0x50e3('0x154'),_0x3871fc,!_[_0x50e3('0x41')](config[_0x50e3('0x150')][_0x3f7aee])?_0x3f7aee:'')})[_0x50e3('0xbe')](function(_0x4ebcbf){return _0x4ebcbf[_0x50e3('0x156')]['indexOf']('true')>=0x0;})[_0x50e3('0xb8')](myreject(_0xfde8bd)));}BPromise[_0x50e3('0x157')](_0x1cc9dc)[_0x50e3('0xbe')](function(_0x46665c){var _0x4e91cb=_['some'](_0x46665c);if(_0x4e91cb){return _0x212ae2(_0x4e91cb);}else{_0x40677b[_0x50e3('0x42')]=_0x164011?'GLOBAL_INTERVAL_IS_OVERTIME':_0x50e3('0x158');return _0xfde8bd(msgResponse(_0x50e3('0x159'),'Failure',_0x50e3('0x15a')+_0x164011+'\x20'+_0x251d75+_0x50e3('0x15b')+util['inspect'](_0x3871fc,{'showHidden':![],'depth':null})+_0x50e3('0x15c')+_0x3f7aee));}})[_0x50e3('0xb8')](function(_0xd98a0f){return _0xfde8bd(msgResponse(_0x50e3('0x14c'),_0x50e3('0x14d'),JSON['stringify'](_0xd98a0f)));});});};Dialer[_0x50e3('0x1d')]['checkDialMethod']=function(_0x26d43a){var _0x378955=this;return function(){switch(_0x26d43a[_0x50e3('0x5c')]){case _0x50e3('0x15d'):freeVariablesPredictive(_0x26d43a);_0x378955[_0x50e3('0x15e')](_0x26d43a,0x1);break;case'power':freeVariablesPredictive(_0x26d43a);_0x378955[_0x50e3('0x15e')](_0x26d43a,_0x26d43a[_0x50e3('0x15f')]);break;case _0x50e3('0x160'):_0x378955[_0x50e3('0x160')](_0x26d43a);break;case _0x50e3('0xa'):freeVariablesPredictive(_0x26d43a);_0x378955[_0x50e3('0x15e')](_0x26d43a,0x1);break;default:freeVariablesPredictive(_0x26d43a);logger[_0x50e3('0xa0')](_0x50e3('0x161'),_0x26d43a[_0x50e3('0x44')],_0x50e3('0x162'));}};};Dialer[_0x50e3('0x1d')][_0x50e3('0x163')]=function(_0x5e5428){var _0x13fc4b=this;return function(){_0x13fc4b[_0x50e3('0x164')](_0x5e5428);};};Dialer[_0x50e3('0x1d')][_0x50e3('0x165')]=function(_0xe4e551){var _0xf171f3=this;if(isNotPreview(_0xe4e551['dialMethod'])){if(isVoiceQueueOutbound(_0xe4e551[_0x50e3('0x57')])&&isActive(_0xe4e551[_0x50e3('0x5b')])){_0xe4e551[_0x50e3('0xa6')]=!![];BPromise['resolve']()[_0x50e3('0xbe')](checkIsLoggedIn(_0xe4e551,_0xe4e551['loggedIn']))[_0x50e3('0xbe')](checkIsActive(_0xe4e551,_0xe4e551[_0x50e3('0x5b')]))['then'](checkInterval(_0xe4e551))[_0x50e3('0xbe')](_0xf171f3[_0x50e3('0x166')](_0xe4e551))[_0x50e3('0xbe')](_0xf171f3[_0x50e3('0x14b')](_0xe4e551[_0x50e3('0x167')],_0xe4e551[_0x50e3('0x168')],_0xe4e551['name'],_0xe4e551))[_0x50e3('0xbe')](_0xf171f3[_0x50e3('0x169')](_0xe4e551[_0x50e3('0x46')],_0xe4e551[_0x50e3('0x168')],_0xe4e551[_0x50e3('0x44')],_0xe4e551))[_0x50e3('0xbe')](_0xf171f3[_0x50e3('0x16a')](_0xe4e551))['catch'](loggerCatchQueueSummary('[syncQueueSummary]',_0xe4e551));}else{notSendMessagesQueue(_0xe4e551);}}else{freeVariablesPredictive(_0xe4e551);}};Dialer[_0x50e3('0x1d')]['syncCampaigns']=function(){var _0x4d40f9=this;var _0x4d38f4;for(var _0x7daae in this['campaigns']){if(typeof this[_0x50e3('0x24')][_0x7daae]!=='undefined'){_0x4d38f4=this[_0x50e3('0x24')][_0x7daae];if(isCampaignIvr(_0x4d38f4[_0x50e3('0x57')])&&isActive(_0x4d38f4[_0x50e3('0x7b')])){_0x4d38f4['sendMessageOneNotActive']=!![];BPromise['resolve']()[_0x50e3('0xbe')](checkIsActive(_0x4d38f4,_0x4d38f4[_0x50e3('0x7b')]))['then'](checkInterval(_0x4d38f4))[_0x50e3('0xbe')](_0x4d40f9[_0x50e3('0x166')](_0x4d38f4))[_0x50e3('0xbe')](_0x4d40f9[_0x50e3('0x14b')](_0x4d38f4[_0x50e3('0x167')],_0x4d38f4['dialTimezone'],_0x4d38f4[_0x50e3('0x44')],_0x4d38f4))[_0x50e3('0xbe')](_0x4d40f9['checkIfTimeIntervals'](_0x4d38f4['Interval'],_0x4d38f4['dialTimezone'],_0x4d38f4[_0x50e3('0x44')],_0x4d38f4))[_0x50e3('0xbe')](_0x4d40f9[_0x50e3('0x163')](_0x4d38f4))[_0x50e3('0xb8')](loggerCatchQueueSummary(_0x50e3('0x16b'),_0x4d38f4));}else{notSendMessagesCampaign(_0x4d38f4);}}}};function getCallerIdRandom(_0x3c4d92,_0x102d35){var _0x491fa1;var _0x1e0f23;var _0x55f11c;if(_0x102d35<=0x0){_0x102d35=0x1;}_0x491fa1=new RegExp('\x5cw{0,'+_0x102d35+'}$');_0x1e0f23=Math['pow'](0xa,_0x102d35-0x1);_0x55f11c=Math[_0x50e3('0x16c')](0xa,_0x102d35)-0x1;return util[_0x50e3('0x80')]('%s',_[_0x50e3('0x16d')](_0x3c4d92,_0x491fa1,_[_0x50e3('0x16e')](_0x1e0f23,_0x55f11c)));}function extractCalleridName(_0x41a2c5){var _0x1b1632=_0x41a2c5[_0x50e3('0x16f')](/"(.*?)"/);return _0x1b1632?_0x1b1632[0x1]:_0x41a2c5;}function extractCalleridNumber(_0x233798){var _0x5a2c66=_0x233798[_0x50e3('0x16f')](/<(.*?)>/);return _0x5a2c66?_0x5a2c66[0x1]:_0x233798;}Dialer[_0x50e3('0x1d')][_0x50e3('0x170')]=function(_0x466574,_0xb901fb){var _0x1ae683=this;var _0x22aee8=uuid['v4']();this[_0x50e3('0xb3')][_0x22aee8]=new Action(_0x466574,_0xb901fb,_0x22aee8);return new BPromise(function(_0x575536,_0x91e9){if(_[_0x50e3('0x41')](_0x466574)&&typeof _0x466574!==_0x50e3('0x171')){return _0x91e9(msgResponse(_0x50e3('0x172'),_0x50e3('0x14d'),_0x50e3('0x173')));}if(_[_0x50e3('0x41')](_0xb901fb[_0x50e3('0x174')][_0x50e3('0x175')])||_0xb901fb[_0x50e3('0x174')][_0x50e3('0x175')]===null){return _0x91e9(msgResponse(_0x50e3('0x172'),'Failure','contact\x20is\x20undefine'));}var _0x5545b5={'XMD-CALLERID':_0x1ae683[_0x50e3('0xb3')][_0x22aee8][_0x50e3('0x176')](),'XMD-AGI':_0x466574[_0x50e3('0x10e')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x466574['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x466574['dialQueueProject2']?util[_0x50e3('0x80')](_0x50e3('0x177'),ipAgi,_0x466574['dialQueueProject2']):_0x50e3('0x178'),'XMD-QUEUE':_0x466574[_0x50e3('0x57')]==='outbound'?util['format'](_0x50e3('0x179'),_0x466574[_0x50e3('0x44')],_0x466574[_0x50e3('0x17a')]||'',_0x466574[_0x50e3('0x116')]?'c':'',_0x466574[_0x50e3('0x11c')]||0x3):_0x50e3('0x178'),'XMD-CONTACTID':_0xb901fb['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x1ae683[_0x50e3('0xb3')][_0x22aee8][_0x50e3('0x176')](),'XMD-AMD':_0x466574['dialAMDActive']?_0x50e3('0x17b'):_0x50e3('0x178'),'XMD-DESTINATION':_0x50e3('0x17c')};if(_0x466574[_0x50e3('0xe7')]){_0x5545b5[_0x50e3('0x17d')]=_0x466574[_0x50e3('0x17e')]||0x9c4;_0x5545b5[_0x50e3('0x17f')]=_0x466574[_0x50e3('0x180')]||0x5dc;_0x5545b5['XMD-AMDAFTERGREETINGSILENCE']=_0x466574[_0x50e3('0x181')]||0x320;_0x5545b5['XMD-AMDTOTALANALYSISTIME']=_0x466574[_0x50e3('0x182')]||0x1388;_0x5545b5[_0x50e3('0x183')]=_0x466574[_0x50e3('0x184')]||0x64;_0x5545b5[_0x50e3('0x185')]=_0x466574[_0x50e3('0x186')]||0x32;_0x5545b5[_0x50e3('0x187')]=_0x466574[_0x50e3('0x188')]||0x3;_0x5545b5['XMD-AMDSILENCETHRESHOLD']=_0x466574[_0x50e3('0x189')]||0x100;_0x5545b5[_0x50e3('0x18a')]=_0x466574[_0x50e3('0x18b')]||0x1388;}if(_0x466574[_0x50e3('0x57')]==='outbound'){_0x5545b5[_0x50e3('0x18c')]=_0xb901fb['VoiceQueueId'];}else{_0x5545b5[_0x50e3('0x18d')]=_0xb901fb['CampaignId'];}for(var _0x265df1 in _0xb901fb[_0x50e3('0x174')]){if(typeof _0xb901fb[_0x50e3('0x174')][_0x265df1]!=='undefined'){if(isNotNull(_0xb901fb['Contact'][_0x265df1])&&_0x265df1!=='id'&&_0x265df1!==_0x50e3('0x18e')&&_0x265df1!==_0x50e3('0x18f')&&_0x265df1!==_0x50e3('0x190')){_0x5545b5[util[_0x50e3('0x80')](_0x50e3('0x191'),_0x50e3('0x192'),_[_0x50e3('0x193')](_0x265df1))]=_0xb901fb[_0x50e3('0x174')][_0x265df1];}}}var _0x2a1675=_0x1ae683[_0x50e3('0xdf')](_0x466574['Trunk'])?getCallerId(_0x466574['Trunk'][_0x50e3('0x7c')],_0x466574[_0x50e3('0x194')],_0x466574[_0x50e3('0x195')]>0x0?getCallerIdRandom(_0x466574[_0x50e3('0x196')],_0x466574[_0x50e3('0x195')]):_0x466574[_0x50e3('0x196')]):getCallerId(_['isNil'](_0x466574['TrunkBackup'])?_0x466574['Trunk']['callerid']:_0x466574[_0x50e3('0x197')][_0x50e3('0x7c')],_0x466574['dialOriginateCallerIdName'],_0x466574['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x466574[_0x50e3('0x196')],_0x466574['dialRandomLastDigitCallerIdNumber']):_0x466574[_0x50e3('0x196')]);if(_0x2a1675){_0x5545b5[_0x50e3('0x198')]=_0x1ae683['actions'][_0x22aee8][_0x50e3('0x199')]=extractCalleridName(_0x2a1675);_0x5545b5['XMD-ORIGINATECALLERIDNUM']=_0x1ae683[_0x50e3('0xb3')][_0x22aee8][_0x50e3('0x19a')]=extractCalleridNumber(_0x2a1675);}return ami[_0x50e3('0xb6')]({'actionid':_0x22aee8,'action':_0x50e3('0x172'),'channel':_0x1ae683[_0x50e3('0xdf')](_0x466574['Trunk'])?util[_0x50e3('0x80')](_0x50e3('0x19b'),_0x466574['Trunk'][_0x50e3('0x44')],isNotNull(_0x466574[_0x50e3('0x5e')])?_0x466574['dialPrefix'][_0x50e3('0x19c')]()||'':'',_0x466574[_0x50e3('0x19d')]>0x0?_0xb901fb[_0x50e3('0x174')][_0x50e3('0x175')][_0x50e3('0x19e')](_0x466574[_0x50e3('0x19d')]):_0xb901fb['Contact']['phone']):util[_0x50e3('0x80')](_0x50e3('0x19b'),_[_0x50e3('0xb5')](_0x466574[_0x50e3('0x197')])?_0x466574['Trunk'][_0x50e3('0x44')]:_0x466574[_0x50e3('0x197')]['name'],isNotNull(_0x466574[_0x50e3('0x5e')])?_0x466574[_0x50e3('0x5e')]['trim']()||'':'',_0x466574['dialCutDigit']>0x0?_0xb901fb[_0x50e3('0x174')]['phone'][_0x50e3('0x19e')](_0x466574[_0x50e3('0x19d')]):_0xb901fb[_0x50e3('0x174')][_0x50e3('0x175')]),'callerid':_0x2a1675,'Exten':'xcally-motion-dialer','Context':'from-sip','Priority':'1','variable':_0x5545b5,'timeout':(_0x466574[_0x50e3('0x5d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x22aee8})[_0x50e3('0xbe')](function(_0x3706fa){return _0x575536(_0x3706fa);})['catch'](function(_0x34b2c1){_0x466574[_0x50e3('0x67')]+=0x1;var _0x3bf266=new History(_0x1ae683[_0x50e3('0xb3')][_0x22aee8]);logger['error'](util[_0x50e3('0x80')]('[originateError]:\x20%s',JSON[_0x50e3('0x7d')](_0x34b2c1)));_0x3bf266[_0x50e3('0xad')]=0xe;_0x3bf266[_0x50e3('0xae')]=_0x50e3('0x19f');_0x3bf266[_0x50e3('0xb0')]=moment()['format'](_0x50e3('0x100'));_0x3bf266[_0x50e3('0xaf')]=_0x3bf266[_0x50e3('0xb0')];_0x1ae683[_0x50e3('0xd3')](_0x3bf266)[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x1a0')));_0x1ae683[_0x50e3('0xd1')](_0x3bf266)[_0x50e3('0xb8')](loggerCatch('[originate][error]'))[_0x50e3('0x20')](function(){delete _0x1ae683[_0x50e3('0xb3')][_0x22aee8];return _0x91e9(msgResponse('originate',_0x50e3('0x1a1'),_0x50e3('0x1a2')));});});});};Dialer[_0x50e3('0x1d')]['syncOriginateResponse']=function(_0x26c10d){var _0x47742f=this[_0x50e3('0xb3')][_0x26c10d['actionid']];if(_0x47742f){delete this[_0x50e3('0xb3')][_0x26c10d[_0x50e3('0x130')]];_0x47742f[_0x50e3('0x11b')]=moment()['format'](_0x50e3('0x100'));var _0x5901dc=_0x47742f[_0x50e3('0x57')]===_0x50e3('0x7f')?this[_0x50e3('0x24')][_0x47742f['queue']]:this['voiceQueues'][_0x47742f[_0x50e3('0x1a3')]()];if(!this[_0x50e3('0xdd')](_0x26c10d[_0x50e3('0x1a4')])){this[_0x50e3('0xba')](_0x5901dc);return this['callProgressDetecting'](_0x47742f,_0x5901dc,_0x26c10d)[_0x50e3('0xb8')](loggerCatch('[callProgressDetecting]\x20'));}this['uniqueId'][_0x26c10d[_0x50e3('0xe3')]]=_0x47742f;}};Dialer[_0x50e3('0x1d')]['checkRetriveMax']=function(_0x376dab,_0x84c02d,_0x4ec1c6){var _0x44afe4=new History(_0x84c02d);if(_0x44afe4[_0x50e3('0xf6')]+_0x44afe4['countcongestionretry']+_0x44afe4[_0x50e3('0xf8')]+_0x44afe4[_0x50e3('0xf9')]+_0x44afe4[_0x50e3('0xfa')]+_0x44afe4[_0x50e3('0x105')]+_0x44afe4[_0x50e3('0xf2')]+_0x44afe4[_0x50e3('0x106')]>=_0x4ec1c6[_0x50e3('0xfb')]-0x1){return!![];}switch(_0x376dab){case 0x3:if(_0x44afe4[_0x50e3('0xf8')]>=_0x4ec1c6[_0x50e3('0x1a5')]-0x1){return!![];}this[_0x50e3('0xc6')]({'active':![],'countnoanswerretry':_0x44afe4[_0x50e3('0xf8')]+=0x1,'scheduledat':moment()['add'](_0x4ec1c6[_0x50e3('0x1a6')],_0x50e3('0x10a'))[_0x50e3('0x80')](_0x50e3('0x100')),'ContactId':_0x44afe4[_0x50e3('0xd9')],'ListId':_0x44afe4[_0x50e3('0xda')],'VoiceQueueId':_0x44afe4[_0x50e3('0x101')]||undefined,'CampaignId':_0x44afe4[_0x50e3('0xdb')]||undefined})['catch'](loggerCatch(_0x50e3('0x1a7')));break;case 0x5:if(_0x44afe4[_0x50e3('0xf6')]>=_0x4ec1c6[_0x50e3('0x1a8')]-0x1){return!![];}this[_0x50e3('0xc6')]({'active':![],'countbusyretry':_0x44afe4['countbusyretry']+=0x1,'scheduledat':moment()['add'](_0x4ec1c6['dialBusyRetryFrequency'],_0x50e3('0x10a'))[_0x50e3('0x80')](_0x50e3('0x100')),'ContactId':_0x44afe4[_0x50e3('0xd9')],'ListId':_0x44afe4[_0x50e3('0xda')],'VoiceQueueId':_0x44afe4['VoiceQueueId']||undefined,'CampaignId':_0x44afe4['CampaignId']||undefined})[_0x50e3('0xb8')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x44afe4[_0x50e3('0xf7')]>=_0x4ec1c6['dialCongestionMaxRetry']-0x1){return!![];}this[_0x50e3('0xc6')]({'active':![],'countcongestionretry':_0x44afe4['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0x4ec1c6['dialCongestionRetryFrequency'],_0x50e3('0x10a'))['format'](_0x50e3('0x100')),'ContactId':_0x44afe4['ContactId'],'ListId':_0x44afe4[_0x50e3('0xda')],'VoiceQueueId':_0x44afe4[_0x50e3('0x101')]||undefined,'CampaignId':_0x44afe4[_0x50e3('0xdb')]||undefined})[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x1a9')));break;case 0x0:if(_0x44afe4['countnosuchnumberretry']>=_0x4ec1c6[_0x50e3('0x1aa')]-0x1){return!![];}else{this[_0x50e3('0xc6')]({'active':![],'countnosuchnumberretry':_0x44afe4[_0x50e3('0xf9')]+=0x1,'scheduledat':moment()[_0x50e3('0xfe')](_0x4ec1c6[_0x50e3('0x1ab')],_0x50e3('0x10a'))[_0x50e3('0x80')](_0x50e3('0x100')),'ContactId':_0x44afe4[_0x50e3('0xd9')],'ListId':_0x44afe4[_0x50e3('0xda')],'VoiceQueueId':_0x44afe4[_0x50e3('0x101')]||undefined,'CampaignId':_0x44afe4[_0x50e3('0xdb')]||undefined})[_0x50e3('0xb8')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x44afe4[_0x50e3('0xfa')]>=_0x4ec1c6[_0x50e3('0x121')]-0x1){return!![];}this[_0x50e3('0xc6')]({'active':![],'countdropretry':_0x44afe4[_0x50e3('0xfa')]+=0x1,'scheduledat':moment()[_0x50e3('0xfe')](_0x4ec1c6['dialDropRetryFrequency'],_0x50e3('0x10a'))[_0x50e3('0x80')](_0x50e3('0x100')),'ContactId':_0x44afe4[_0x50e3('0xd9')],'ListId':_0x44afe4[_0x50e3('0xda')],'VoiceQueueId':_0x44afe4[_0x50e3('0x101')]||undefined,'CampaignId':_0x44afe4[_0x50e3('0xdb')]||undefined})[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x124')));break;case 0xb:if(_0x44afe4[_0x50e3('0x105')]>=_0x4ec1c6['dialAbandonedMaxRetry']-0x1){return!![];}this[_0x50e3('0xc6')]({'active':![],'countabandonedretry':_0x44afe4[_0x50e3('0x105')]+=0x1,'scheduledat':moment()[_0x50e3('0xfe')](_0x4ec1c6[_0x50e3('0x129')],_0x50e3('0x10a'))[_0x50e3('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x44afe4['ContactId'],'ListId':_0x44afe4[_0x50e3('0xda')],'VoiceQueueId':_0x44afe4[_0x50e3('0x101')]||undefined,'CampaignId':_0x44afe4[_0x50e3('0xdb')]||undefined})['catch'](loggerCatch(_0x50e3('0x12a')));break;case 0x13:if(_0x44afe4['countmachineretry']>=_0x4ec1c6[_0x50e3('0x107')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x44afe4[_0x50e3('0xf2')]+=0x1,'scheduledat':moment()[_0x50e3('0xfe')](_0x4ec1c6['dialMachineRetryFrequency'],'minutes')[_0x50e3('0x80')](_0x50e3('0x100')),'ContactId':_0x44afe4[_0x50e3('0xd9')],'ListId':_0x44afe4[_0x50e3('0xda')],'VoiceQueueId':_0x44afe4[_0x50e3('0x101')]||undefined,'CampaignId':_0x44afe4['CampaignId']||undefined})['catch'](loggerCatch(_0x50e3('0x102')));break;case 0x14:if(_0x44afe4['countagentrejectretry']>=_0x4ec1c6['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0x50e3('0xc6')]({'active':![],'countagentrejectretry':_0x44afe4[_0x50e3('0x106')]+=0x1,'scheduledat':moment()['add'](_0x4ec1c6[_0x50e3('0x1ac')],_0x50e3('0x10a'))[_0x50e3('0x80')](_0x50e3('0x100')),'ContactId':_0x44afe4[_0x50e3('0xd9')],'ListId':_0x44afe4[_0x50e3('0xda')],'VoiceQueueId':_0x44afe4[_0x50e3('0x101')]||undefined,'CampaignId':_0x44afe4[_0x50e3('0xdb')]||undefined})[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x1ad')));break;default:return!![];}};Dialer[_0x50e3('0x1d')][_0x50e3('0x1ae')]=function(_0x30d4bc,_0x16a7f4,_0x284874){var _0x12eac6=this;var _0xcbc925=new History(_0x30d4bc);return new BPromise(function(_0x231121,_0x476824){if(_[_0x50e3('0x41')](_0x16a7f4)&&typeof _0x16a7f4!=='object'){return _0x476824(msgResponse(_0x50e3('0x1af'),'Failure',_0x50e3('0x1b0')));}if(_['isUndefined'](_0x284874)&&typeof _0x284874!==_0x50e3('0x171')){return _0x476824(msgResponse('[callProgressDetecting]',_0x50e3('0x14d'),_0x50e3('0x1b1')));}switch(_0x284874[_0x50e3('0x113')]){case'0':_0x16a7f4[_0x50e3('0x66')]+=0x1;_0xcbc925[_0x50e3('0xad')]=0x0;_0xcbc925[_0x50e3('0xae')]=_0x50e3('0x1b2');_0xcbc925['countnosuchnumberretry']+=0x1;_0xcbc925[_0x50e3('0xf3')]+=0x1;ami[_0x50e3('0x4f')]('custom:agentnosuchnumber',ut['buildObj'](_0x30d4bc,_0x50e3('0x1b3')));_0x12eac6[_0x50e3('0xd3')](_0xcbc925)[_0x50e3('0xb8')](loggerCatch(_0x50e3('0xf5')));if(_0x12eac6[_0x50e3('0x1b4')](0x0,_0x30d4bc,_0x16a7f4)){if(_0xcbc925['countnosuchnumberretry']>=_0x16a7f4[_0x50e3('0x1aa')]){_0x12eac6[_0x50e3('0x108')](_0xcbc925,_0x231121,_0x476824,_0x50e3('0x1b5'));}else{_0x12eac6[_0x50e3('0xfc')](_0xcbc925,_0x231121,_0x476824,_0x50e3('0x1b5'));}}break;case'3':_0x16a7f4[_0x50e3('0x65')]+=0x1;_0xcbc925[_0x50e3('0xad')]=0x3;_0xcbc925[_0x50e3('0xae')]=_0x50e3('0x1b6');_0xcbc925['countnoanswerretry']+=0x1;_0xcbc925[_0x50e3('0xf3')]+=0x1;ami[_0x50e3('0x4f')]('custom:agentnoanswer',ut['buildObj'](_0x30d4bc,_0x50e3('0x1b7')));_0x12eac6[_0x50e3('0xd3')](_0xcbc925)['catch'](loggerCatch(_0x50e3('0x1b8')));if(_0x12eac6[_0x50e3('0x1b4')](0x3,_0x30d4bc,_0x16a7f4)){if(_0xcbc925['countnoanswerretry']>=_0x16a7f4[_0x50e3('0x1a5')]){_0x12eac6[_0x50e3('0x108')](_0xcbc925,_0x231121,_0x476824,_0x50e3('0x1b9'));}else{_0x12eac6[_0x50e3('0xfc')](_0xcbc925,_0x231121,_0x476824,_0x50e3('0x1b9'));}}break;case'5':_0x16a7f4[_0x50e3('0x1ba')]+=0x1;_0xcbc925[_0x50e3('0xad')]=0x5;_0xcbc925[_0x50e3('0xae')]=_0x50e3('0x1bb');_0xcbc925[_0x50e3('0xf6')]+=0x1;_0xcbc925[_0x50e3('0xf3')]+=0x1;ami[_0x50e3('0x4f')](_0x50e3('0x1bc'),ut['buildObj'](_0x30d4bc,_0x50e3('0x1bd')));_0x12eac6[_0x50e3('0xd3')](_0xcbc925)[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x1be')));if(_0x12eac6[_0x50e3('0x1b4')](0x5,_0x30d4bc,_0x16a7f4)){if(_0xcbc925[_0x50e3('0xf6')]>=_0x16a7f4[_0x50e3('0x1a8')]){_0x12eac6[_0x50e3('0x108')](_0xcbc925,_0x231121,_0x476824,_0x50e3('0x1bf'));}else{_0x12eac6[_0x50e3('0xfc')](_0xcbc925,_0x231121,_0x476824,_0x50e3('0x1bf'));}}break;case'8':_0x16a7f4[_0x50e3('0x61')]+=0x1;_0xcbc925[_0x50e3('0xad')]=0x8;_0xcbc925['statedesc']=_0x50e3('0x1c0');_0xcbc925[_0x50e3('0xf7')]+=0x1;_0xcbc925[_0x50e3('0xf3')]+=0x1;ami[_0x50e3('0x4f')]('custom:agentcongestion',ut['buildObj'](_0x30d4bc,_0x50e3('0x1c1')));_0x12eac6[_0x50e3('0xd3')](_0xcbc925)[_0x50e3('0xb8')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x12eac6['checkRetriveMax'](0x8,_0x30d4bc,_0x16a7f4)){if(_0xcbc925[_0x50e3('0xf7')]>=_0x16a7f4[_0x50e3('0x1c2')]){_0x12eac6[_0x50e3('0x108')](_0xcbc925,_0x231121,_0x476824,_0x50e3('0x1c3'));}else{_0x12eac6[_0x50e3('0xfc')](_0xcbc925,_0x231121,_0x476824,'reason\x208\x20congestion');}}break;case'11':_0x16a7f4['outboundAbandonedCallsDay']+=0x1;_0xcbc925[_0x50e3('0xad')]=0xb;_0xcbc925[_0x50e3('0xae')]=_0x50e3('0x12b');_0xcbc925['countabandonedretry']+=0x1;_0xcbc925[_0x50e3('0xf3')]+=0x1;_0x12eac6['createHistory'](_0xcbc925)[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x12c')));if(_0x12eac6['checkRetriveMax'](0xb,_0x30d4bc,_0x16a7f4)){if(_0xcbc925['countabandonedretry']>=_0x16a7f4[_0x50e3('0x128')]){_0x12eac6[_0x50e3('0x108')](_0xcbc925,_0x231121,_0x476824,'reason\x2011\x20abandoned');}else{_0x12eac6[_0x50e3('0xfc')](_0xcbc925,_0x231121,_0x476824,'reason\x2011\x20abandoned');}}break;case'20':_0x16a7f4['outboundRejectCallsDay']+=0x1;_0xcbc925[_0x50e3('0xad')]=0x14;_0xcbc925['statedesc']='AgentReject';_0xcbc925['countagentrejectretry']+=0x1;_0xcbc925[_0x50e3('0xf3')]+=0x1;ami[_0x50e3('0x4f')](_0x50e3('0x1c4'),ut['buildObj'](_0x30d4bc,_0x50e3('0x1c5')));_0x12eac6[_0x50e3('0xd3')](_0xcbc925)[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x1c6')));if(_0x12eac6[_0x50e3('0x1b4')](0x14,_0x30d4bc,_0x16a7f4)){if(_0xcbc925[_0x50e3('0x106')]>=_0x16a7f4['dialAgentRejectMaxRetry']){_0x12eac6[_0x50e3('0x108')](_0xcbc925,_0x231121,_0x476824,_0x50e3('0x1c7'));}else{_0x12eac6['stateGlobal'](_0xcbc925,_0x231121,_0x476824,_0x50e3('0x1c7'));}}break;default:_0x16a7f4['outboundUnknownCallsDay']+=0x1;_0xcbc925[_0x50e3('0xad')]=0xc;_0xcbc925['statedesc']=_0x284874['reason'];_0x12eac6['createHistory'](_0xcbc925)[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x1c8')));if(_0x12eac6['checkRetriveMax'](_0x284874[_0x50e3('0x113')],_0x30d4bc,_0x16a7f4)){if(_0xcbc925[_0x50e3('0xf6')]+_0xcbc925[_0x50e3('0xf7')]+_0xcbc925['countnoanswerretry']+_0xcbc925['countnosuchnumberretry']+_0xcbc925[_0x50e3('0xfa')]+_0xcbc925[_0x50e3('0x105')]+_0xcbc925[_0x50e3('0xf2')]+_0xcbc925['countagentrejectretry']>=_0x16a7f4['dialGlobalMaxRetry']){_0x12eac6[_0x50e3('0xfc')](_0xcbc925,_0x231121,_0x476824,_0x284874[_0x50e3('0x113')]);}else{_0x12eac6[_0x50e3('0x108')](_0xcbc925,_0x231121,_0x476824,_0x284874['reason']);}}}});};Dialer['prototype'][_0x50e3('0xfc')]=function(_0x3d8462,_0x51a774,_0x579c52,_0x248acd){var _0x594b57=new Final(_0x3d8462);_0x594b57['state']=0xf;_0x594b57[_0x50e3('0xae')]=_0x50e3('0x1c9');this[_0x50e3('0x108')](_0x594b57,_0x51a774,_0x579c52,_0x248acd);};Dialer['prototype']['createStateFinal']=function(_0x1ae804,_0x37d27d,_0x3e29a6,_0x4544f0){this[_0x50e3('0xd1')](_0x1ae804)[_0x50e3('0xbe')](function(){return _0x37d27d(msgResponse(_0x50e3('0x1af'),_0x50e3('0xde'),_0x4544f0));})[_0x50e3('0xb8')](function(){return _0x3e29a6(msgResponse(_0x50e3('0x1ca'),_0x50e3('0x14d'),_0x50e3('0x1cb')));});};Dialer['prototype'][_0x50e3('0x160')]=function(_0x571ed9){var _0x5622ba=_0x571ed9[_0x50e3('0x1cc')]/0x64;var _0x44e5d8=_0x571ed9[_0x50e3('0x64')]/(_0x571ed9['outboundDropCallsDayTimeout']+_0x571ed9[_0x50e3('0x60')]);var _0x15684d=Math[_0x50e3('0x1cd')](_0x571ed9['predictiveIntervalAvailable']*(_0x571ed9[_0x50e3('0x1ce')]/0x64));var _0x4765aa=Math[_0x50e3('0x1cd')](_0x571ed9['predictiveIntervalAvailable']*(_0x571ed9[_0x50e3('0x1cf')]/0x64));var _0x5e9735=_0x571ed9[_0x50e3('0x53')]+_0x571ed9[_0x50e3('0x1d0')];var _0x15b643=Math[_0x50e3('0x1d1')](_0x571ed9[_0x50e3('0x76')]*_0x571ed9[_0x50e3('0x77')]*_0x571ed9[_0x50e3('0x71')]*_0x571ed9[_0x50e3('0x1d2')]);if(_['isUndefined'](_0x571ed9[_0x50e3('0x2b')])){if(!_['isUndefined'](_0x571ed9[_0x50e3('0x79')])){_0x571ed9[_0x50e3('0x79')]=undefined;loggerPredictive[_0x50e3('0xa0')]('[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x50e3('0x41')](_0x571ed9['handlePredictive'])){loggerPredictive[_0x50e3('0xa0')](_0x50e3('0x1d3'),_0x50e3('0x1d4'));clearInterval(_0x571ed9['handlePredictive']);_0x571ed9[_0x50e3('0x98')]=undefined;}_0x571ed9['startProgressive']=moment()[_0x50e3('0x80')](_0x50e3('0x100'));loggerPredictive['info'](_0x571ed9[_0x50e3('0x44')],'collection\x20data\x20in\x20progressive\x20at',_0x571ed9[_0x50e3('0x2b')]);this['handlePower'](_0x571ed9,0x1);}else if(ifInterval(_0x571ed9[_0x50e3('0x1d5')],_0x571ed9[_0x50e3('0x2b')])){this[_0x50e3('0x15e')](_0x571ed9,0x1);loggerPredictiveCalls[_0x50e3('0x83')](_0x50e3('0x1d6'),_0x571ed9[_0x50e3('0x2b')],_0x571ed9['name']);_0x571ed9['erlangCalls']=0x0;_0x571ed9[_0x50e3('0x70')]=0x0;}else if(_0x5622ba<_0x44e5d8&&_0x571ed9[_0x50e3('0x1d7')]==='dropRate'){freeVariablesPredictive(_0x571ed9);loggerPredictive[_0x50e3('0x83')](_0x50e3('0x1d8'),_0x50e3('0x1d9'),_0x44e5d8,_0x50e3('0x2b'),_0x571ed9[_0x50e3('0x44')]);}else if(_0x15b643<_0x571ed9[_0x50e3('0x70')]&&_0x571ed9['dialPredictiveOptimization']===_0x50e3('0x1da')){freeVariablesPredictive(_0x571ed9);loggerPredictive['info'](_0x50e3('0x1db'),_0x50e3('0x1dc'),_0x15b643,_0x50e3('0x1dd'),_0x571ed9[_0x50e3('0x70')],_0x50e3('0x2b'),_0x571ed9[_0x50e3('0x44')]);}else if(!ifInterval(_0x571ed9['dialPredictiveInterval'],_0x571ed9['startProgressive'])&&_[_0x50e3('0x41')](_0x571ed9[_0x50e3('0x79')])&&!_[_0x50e3('0x41')](_0x571ed9[_0x50e3('0x2b')])){_0x571ed9['startPredictive']=moment()[_0x50e3('0x80')](_0x50e3('0x100'));loggerPredictive[_0x50e3('0x83')](_0x571ed9[_0x50e3('0x44')],_0x50e3('0x1de'),_0x571ed9[_0x50e3('0x79')]);this[_0x50e3('0x1df')](_0x571ed9[_0x50e3('0x1d5')])['then'](this[_0x50e3('0x1e0')](_0x571ed9))[_0x50e3('0xbe')](mergeDataErlangB(_0x571ed9))[_0x50e3('0xbe')](this[_0x50e3('0x1e1')](_0x571ed9))[_0x50e3('0xb8')](loggerCatchPredictive(_0x50e3('0x1e2'),_0x571ed9));}else if(!ifInterval(_0x571ed9[_0x50e3('0x1d5')],_0x571ed9[_0x50e3('0x79')])){_0x571ed9['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x571ed9[_0x50e3('0x79')]=moment()['format'](_0x50e3('0x100'));loggerPredictive[_0x50e3('0x83')](_0x571ed9[_0x50e3('0x44')],_0x50e3('0x1e3'),_0x571ed9[_0x50e3('0x79')]);clearInterval(_0x571ed9[_0x50e3('0x98')]);_0x571ed9['handlePredictive']=undefined;this['averageHandleTime'](_0x571ed9[_0x50e3('0x1d5')])[_0x50e3('0xbe')](this[_0x50e3('0x1e0')](_0x571ed9))[_0x50e3('0xbe')](mergeDataErlangB(_0x571ed9))[_0x50e3('0xbe')](this[_0x50e3('0x1e1')](_0x571ed9))[_0x50e3('0xb8')](loggerCatchPredictive(_0x50e3('0x1e4'),_0x571ed9));}else if(_0x571ed9['predictiveIntervalAvailable']&&_0x5e9735<_0x571ed9['predictiveIntervalAvailable']-_0x4765aa){freeVariablesPredictive(_0x571ed9);loggerPredictive[_0x50e3('0x83')](_0x571ed9['name'],_0x50e3('0x1e5'),_0x5e9735,_0x50e3('0x1e6'),_0x571ed9[_0x50e3('0x73')],'-',_0x4765aa,'=',_0x571ed9[_0x50e3('0x73')]-_0x4765aa,')');}else if(_0x571ed9[_0x50e3('0x73')]&&_0x5e9735>_0x571ed9[_0x50e3('0x73')]+_0x15684d){freeVariablesPredictive(_0x571ed9);loggerPredictive[_0x50e3('0x83')](_0x571ed9[_0x50e3('0x44')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x5e9735,_0x50e3('0x1e7'),_0x571ed9[_0x50e3('0x73')],'+',_0x15684d,'=',_0x571ed9[_0x50e3('0x73')]+_0x15684d,')');}};Dialer[_0x50e3('0x1d')][_0x50e3('0x1e0')]=function(_0x43da4e){var _0x26921c=this;return function(_0xe56fb0){return new BPromise(function(_0x4605e1,_0x34aed8){_[_0x50e3('0x95')](_0x43da4e,_0xe56fb0[0x0]);if(checkGetDataPredictive(_0xe56fb0[0x0])){var _0x34ca49=_0x43da4e['predictiveIntervalAvailable']=_0x43da4e['talking']+_0x43da4e[_0x50e3('0x53')];var _0x3e01c7=_0x43da4e[_0x50e3('0x1d5')]*0x3c;var _0x69cf9a=_0xe56fb0[0x0]['predictiveIntervalAvgTalktime']+_0xe56fb0[0x0][_0x50e3('0x6c')];var _0x388756=(_0xe56fb0[0x0][_0x50e3('0x6b')]+_0xe56fb0[0x0][_0x50e3('0x6e')]+_0xe56fb0[0x0][_0x50e3('0x88')])/_0xe56fb0[0x0][_0x50e3('0x74')];_0x43da4e[_0x50e3('0x71')]=_0x388756>0x0?_0x388756:0x1;switch(_0x43da4e[_0x50e3('0x1d7')]){case _0x50e3('0x1da'):var _0xb018f3=_0x43da4e[_0x50e3('0x1cc')]/0x64;return _0x26921c[_0x50e3('0x1e8')](_0x34ca49,_0x3e01c7,_0x69cf9a,_0x388756,_0xb018f3)[_0x50e3('0xbe')](function(_0x532801){return _0x4605e1(_0x532801);});case'agentBusyFactor':var _0x2da902=_0x43da4e['dialPredictiveOptimizationPercentage']/0x64;return _0x26921c[_0x50e3('0x1e9')](_0x34ca49,_0x3e01c7,_0x69cf9a,_0x388756,_0x2da902)[_0x50e3('0xbe')](function(_0x1f1517){return _0x4605e1(_0x1f1517);});default:return _0x34aed8(msgResponse('[getDataPredictive]','Failure',_0x50e3('0x1ea')));}}else{return _0x34aed8(msgResponse(_0x50e3('0x1eb'),'Failure',_0x50e3('0x1ec')));}});};};Dialer[_0x50e3('0x1d')][_0x50e3('0x1ed')]=function(_0x96f112){var _0x3af048=this;return function(_0x4b81d1){return new BPromise(function(_0x1d4899,_0x50c182){_[_0x50e3('0x95')](_0x96f112,_0x4b81d1[0x0]);if(checkGetDataPredictive(_0x4b81d1[0x0])){loggerPredictive['info'](JSON['stringify'](_0x4b81d1[0x0]));if(_0x96f112['dialPredictiveOptimization']==='dropRate'){return _0x3af048['getVoiceQueueRtPauses'](_0x96f112['id'])['then'](function(_0xda6781){var _0x1d357e=_0x96f112['loggedIn']-_0xda6781[0x0][_0x50e3('0x1ee')];var _0x3ec7a8=_0x96f112[_0x50e3('0x1d5')]*0x3c;var _0x242fe8=_0x4b81d1[0x0][_0x50e3('0x6d')]+_0x4b81d1[0x0][_0x50e3('0x6c')];var _0x5513dd=(_0x4b81d1[0x0][_0x50e3('0x6b')]+_0x4b81d1[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x4b81d1[0x0][_0x50e3('0x88')])/_0x4b81d1[0x0]['predictiveIntervalTotalCalls'];var _0x259ce8=_0x96f112[_0x50e3('0x1cc')]/0x64;_0x96f112[_0x50e3('0x72')]=_0xda6781[0x0][_0x50e3('0x1ee')]||0x0;_0x96f112['predictiveIntervalHitRate']=_0x5513dd>0x0?_0x5513dd:0x1;return _0x3af048[_0x50e3('0x1e8')](_0x1d357e,_0x3ec7a8,_0x242fe8,_0x5513dd,_0x259ce8);})[_0x50e3('0xbe')](function(_0x2a1c99){return _0x1d4899(_0x2a1c99);})[_0x50e3('0xb8')](function(_0x17d610){return _0x50c182(msgResponse(_0x50e3('0x1ef'),_0x50e3('0x14d'),JSON[_0x50e3('0x7d')](_0x17d610)));});}if(_0x96f112[_0x50e3('0x1d7')]===_0x50e3('0x1f0')){return _0x3af048[_0x50e3('0xcf')](_0x96f112['id'])[_0x50e3('0xbe')](function(_0xb4eeab){var _0x20f0c8=_0x96f112[_0x50e3('0x54')]-_0xb4eeab[0x0][_0x50e3('0x1ee')];var _0x254283=_0x96f112[_0x50e3('0x1d5')]*0x3c;var _0x5cb8de=_0x4b81d1[0x0][_0x50e3('0x6d')]+_0x4b81d1[0x0][_0x50e3('0x6c')];var _0x3a46e1=(_0x4b81d1[0x0]['predictiveIntervalAnsweredCalls']+_0x4b81d1[0x0][_0x50e3('0x6e')]+_0x4b81d1[0x0][_0x50e3('0x88')])/_0x4b81d1[0x0][_0x50e3('0x74')];var _0x1f0832=_0x96f112[_0x50e3('0x1cc')]/0x64;_0x96f112[_0x50e3('0x72')]=_0xb4eeab[0x0][_0x50e3('0x1ee')]||0x0;_0x96f112[_0x50e3('0x71')]=_0x3a46e1>0x0?_0x3a46e1:0x1;return _0x3af048[_0x50e3('0x1e9')](_0x20f0c8,_0x254283,_0x5cb8de,_0x3a46e1,_0x1f0832);})[_0x50e3('0xbe')](function(_0x36a64e){return _0x1d4899(_0x36a64e);})['catch'](function(_0x1fd007){return _0x50c182(msgResponse(_0x50e3('0x1ef'),'Failure',JSON[_0x50e3('0x7d')](_0x1fd007)));});}}else{return _0x50c182(msgResponse('[getDataPredictive]','Failure','check\x20failure'));}});};};Dialer[_0x50e3('0x1d')]['startMethodPredictive']=function(_0x117f4e){var _0x4d5500=this;return function(){var _0x3ed423=0x0;var _0x39dca4=Math[_0x50e3('0x1d1')](_0x117f4e[_0x50e3('0x91')]*0x3e8);if(_0x39dca4>0x0){_0x39dca4=_0x39dca4<0x64?0x64:_0x39dca4;loggerPredictive[_0x50e3('0x83')](_0x117f4e[_0x50e3('0x44')],_0x50e3('0x1f1'),_0x39dca4,'milliseconds');_0x117f4e[_0x50e3('0x98')]=setInterval(function(){_0x4d5500[_0x50e3('0x98')](_0x117f4e);loggerPredictiveCalls['info'](_0x50e3('0x1f2'),_0x3ed423+=0x1);},_0x39dca4);}else{loggerPredictive['info'](_0x117f4e[_0x50e3('0x44')],_0x50e3('0x1f3'));}};};Dialer['prototype'][_0x50e3('0x1f4')]=function(_0x5e6cf6,_0x3c7a83){var _0x1269f1=this;return function(_0x57ff3c){if(_[_0x50e3('0x4a')](_0x57ff3c)){if(_['isNil'](_0x3c7a83[_0x50e3('0x1f5')])||!_0x3c7a83[_0x50e3('0x1f6')]){if(_0x5e6cf6['dialMethod']===_0x50e3('0xa')){_0x5e6cf6[_0x50e3('0x137')]=_['isUndefined'](_0x5e6cf6[_0x50e3('0x137')])?!![]:_0x5e6cf6[_0x50e3('0x137')];var _0x447d4d=uuid['v4']();_0x1269f1[_0x50e3('0xb3')][_0x447d4d]=new Action(_0x5e6cf6,_0x3c7a83,_0x447d4d);loggerBooked[_0x50e3('0x83')](_0x50e3('0x1f7'),_0x447d4d,_0x50e3('0x1f8'),JSON['stringify'](_0x5e6cf6[_0x50e3('0x137')]),'Queue:\x20',_0x5e6cf6[_0x50e3('0x44')]);if(_0x5e6cf6[_0x50e3('0x137')]){_0x5e6cf6[_0x50e3('0x137')]=![];_0x1269f1[_0x50e3('0x2d')][_0x1269f1[_0x50e3('0xb3')][_0x447d4d][_0x50e3('0xbb')]]=[];ami[_0x50e3('0xb6')]({'actionid':_0x447d4d,'action':_0x50e3('0x1f9'),'queue':_0x5e6cf6['name']})[_0x50e3('0xb8')](function(){_0x1269f1[_0x50e3('0xba')](_0x5e6cf6);_0x1269f1['rescheduleContact']({'active':![],'ContactId':_0x1269f1['actions'][_0x447d4d][_0x50e3('0xd9')],'ListId':_0x1269f1[_0x50e3('0xb3')][_0x447d4d]['ListId'],'VoiceQueueId':_0x1269f1['actions'][_0x447d4d]['VoiceQueueId']||undefined,'CampaignId':_0x1269f1[_0x50e3('0xb3')][_0x447d4d]['CampaignId']||undefined})[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x1fa')));delete _0x1269f1[_0x50e3('0xb3')][_0x447d4d];});}else{loggerBooked[_0x50e3('0x83')]('[booked][checkContactBlack][else]',JSON[_0x50e3('0x7d')](_0x5e6cf6[_0x50e3('0x137')]),_0x50e3('0x1fb'),_0x5e6cf6[_0x50e3('0x44')]);_0x1269f1[_0x50e3('0xba')](_0x5e6cf6);_0x1269f1[_0x50e3('0xc6')]({'active':![],'ContactId':_0x1269f1[_0x50e3('0xb3')][_0x447d4d]['ContactId'],'ListId':_0x1269f1[_0x50e3('0xb3')][_0x447d4d]['ListId'],'VoiceQueueId':_0x1269f1[_0x50e3('0xb3')][_0x447d4d]['VoiceQueueId']||undefined,'CampaignId':_0x1269f1[_0x50e3('0xb3')][_0x447d4d][_0x50e3('0xdb')]||undefined})[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x1fa')));delete _0x1269f1[_0x50e3('0xb3')][_0x447d4d];}}else{return _0x1269f1[_0x50e3('0x170')](_0x5e6cf6,_0x3c7a83);}}else{if(getDiff(_0x3c7a83[_0x50e3('0x1fc')])<_0x5e6cf6['dialRecallMeTimeout']*0x3c){if(_0x3c7a83['Agent']&&!_0x3c7a83['Agent'][_0x50e3('0x1fd')]){_0x1269f1['preview'][_0x50e3('0x13a')](_0x3c7a83['id'])['finally'](function(){_0x1269f1[_0x50e3('0xba')](_0x5e6cf6);});}else{_0x1269f1['unlockContact']({'active':![]},_0x3c7a83['id'],0x1)[_0x50e3('0x20')](function(){_0x1269f1[_0x50e3('0xba')](_0x5e6cf6);});}}else{_0x5e6cf6[_0x50e3('0x68')]+=0x1;_0x1269f1[_0x50e3('0xba')](_0x5e6cf6);if(_0x5e6cf6[_0x50e3('0x1fe')]){_0x1269f1[_0x50e3('0xc6')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x3c7a83[_0x50e3('0xd9')],'ListId':_0x3c7a83[_0x50e3('0xda')],'VoiceQueueId':_0x3c7a83[_0x50e3('0x101')]||undefined,'CampaignId':_0x3c7a83[_0x50e3('0xdb')]||undefined})[_0x50e3('0xb8')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x1269f1[_0x50e3('0xd3')](createObjHistory(_0x5e6cf6,_0x3c7a83,'RECALLINQUEUE',0x17,'RecallInQueue'))[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x1ff')));}else{_0x1269f1[_0x50e3('0xd7')](createObjHistory(_0x5e6cf6,_0x3c7a83,'RECALLFAILEDTIMEOUT',0x16,'RecallFailedTimeout'),_0x50e3('0x200'),_0x50e3('0x201'));}}}}else{_0x5e6cf6[_0x50e3('0x202')]+=0x1;_0x1269f1[_0x50e3('0xd7')](createObjHistory(_0x5e6cf6,_0x3c7a83,_0x50e3('0x203'),0xd,_0x50e3('0x204')),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw _0x50e3('0x205');}};};Dialer['prototype'][_0x50e3('0x164')]=function(_0x20287d){var _0x90986a=this;var _0x29ccd9=_0x20287d[_0x50e3('0x206')]-_0x20287d[_0x50e3('0x75')]-_0x20287d[_0x50e3('0xcb')];emitCampaignSummary(_0x20287d);if(_0x29ccd9>0x0){if(_0x29ccd9>this['maxNumberOriginate']){_0x29ccd9=this[_0x50e3('0x27')];}_0x20287d['temp']+=_0x29ccd9;this[_0x50e3('0xcd')](_0x20287d['id'],_0x29ccd9,_0x20287d[_0x50e3('0x207')],_0x20287d)[_0x50e3('0xbe')](function(_0x4f0805){_0x20287d[_0x50e3('0xcb')]-=_0x29ccd9;_0x20287d[_0x50e3('0xcb')]=_0x20287d[_0x50e3('0xcb')]>0x0?_0x20287d[_0x50e3('0xcb')]:0x0;if(!checkContactEmpty(_0x4f0805)){_0x20287d['message']=_0x50e3('0xa5');logger[_0x50e3('0x83')](_0x50e3('0x208')+_0x20287d[_0x50e3('0x44')]);}else{_0x20287d[_0x50e3('0x75')]+=_0x4f0805['length'];_0x20287d['message']=_0x50e3('0x209');for(var _0xb94b41=0x0;_0xb94b41<_0x4f0805[_0x50e3('0x9f')];_0xb94b41+=0x1){_0x20287d['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x4f0805[_0xb94b41])||_[_0x50e3('0xb5')](_0x4f0805[_0xb94b41]['Contact'])||_[_0x50e3('0xb5')](_0x4f0805[_0xb94b41][_0x50e3('0x174')][_0x50e3('0x175')])){_0x90986a['emptyContact'](_0x50e3('0x20a'),_0x20287d,_0x4f0805[_0xb94b41]);}else{_0x90986a[_0x50e3('0xc3')](_[_0x50e3('0xd8')](_0x4f0805[_0xb94b41],[_0x50e3('0xdb'),_0x50e3('0x20b')]))[_0x50e3('0xbe')](_0x90986a[_0x50e3('0x1f4')](_0x20287d,_0x4f0805[_0xb94b41]))['catch'](_0x90986a[_0x50e3('0x20c')](_0x50e3('0x20d'),_0x20287d));}}}})[_0x50e3('0xb8')](loggerGetContactDialer(_0x50e3('0x20e'),_0x20287d,_0x29ccd9));}};Dialer[_0x50e3('0x1d')][_0x50e3('0x15e')]=function(_0x9b5fb7,_0x558752){var _0x22f343=this;var _0x75f89e=[];var _0x1afd45=_0x558752>=0x1?_0x558752:0x1;if(_0x9b5fb7[_0x50e3('0x5c')]===_0x50e3('0xa')){_0x1afd45=0x1;}var _0x3b0cb2=Math['floor'](_0x9b5fb7[_0x50e3('0x53')]*_0x1afd45)-_0x9b5fb7[_0x50e3('0x75')]-_0x9b5fb7['temp'];emitVoiceQueueSummary(_0x9b5fb7);if(_0x9b5fb7['dialLimitQueue']>0x0){var _0x57583c=_0x9b5fb7[_0x50e3('0x20f')]-_0x9b5fb7[_0x50e3('0x75')]-_0x9b5fb7[_0x50e3('0x1d0')]-_0x9b5fb7[_0x50e3('0xcb')]-_0x9b5fb7[_0x50e3('0xa7')];if(_0x3b0cb2>_0x57583c){_0x3b0cb2=_0x57583c;}}if(_0x3b0cb2>0x0){if(_0x9b5fb7[_0x50e3('0x5c')]==='booked'){_0x3b0cb2=0x1;}if(_0x3b0cb2>this[_0x50e3('0x27')]){_0x3b0cb2=this[_0x50e3('0x27')];}_0x9b5fb7['temp']+=_0x3b0cb2;for(var _0x50e49d in this['agents']){if(typeof this['agents'][_0x50e49d]!==_0x50e3('0xb4')){if(this['agents'][_0x50e49d][_0x50e3('0xad')]===_0x50e3('0x210')&&this[_0x50e3('0x25')][_0x50e49d]['status']===_0x50e3('0xe1')){_0x75f89e[_0x50e3('0x134')](this['agents'][_0x50e49d]['id']);}}}this['getContactDialer'](_0x9b5fb7['id'],_0x75f89e,_0x3b0cb2,_0x9b5fb7[_0x50e3('0x207')],_0x9b5fb7)[_0x50e3('0xbe')](function(_0x5d9c6b){_0x9b5fb7[_0x50e3('0xcb')]-=_0x3b0cb2;_0x9b5fb7['temp']=_0x9b5fb7[_0x50e3('0xcb')]>0x0?_0x9b5fb7[_0x50e3('0xcb')]:0x0;if(!checkContactEmpty(_0x5d9c6b)){_0x22f343[_0x50e3('0xbd')](_0x9b5fb7)[_0x50e3('0xbe')](sendMessageReschedule(_0x9b5fb7))['catch'](loggerCatch(_0x50e3('0xbf')));}else{_0x9b5fb7[_0x50e3('0x75')]+=_0x5d9c6b[_0x50e3('0x9f')];_0x9b5fb7[_0x50e3('0x42')]=_0x9b5fb7[_0x50e3('0x5c')]===_0x50e3('0xa')?_0x50e3('0x17b'):_0x50e3('0x209');for(var _0x1ff7b1=0x0;_0x1ff7b1<_0x5d9c6b[_0x50e3('0x9f')];_0x1ff7b1+=0x1){if(_[_0x50e3('0xb5')](_0x5d9c6b[_0x1ff7b1])||_[_0x50e3('0xb5')](_0x5d9c6b[_0x1ff7b1][_0x50e3('0x174')])||_[_0x50e3('0xb5')](_0x5d9c6b[_0x1ff7b1][_0x50e3('0x174')]['phone'])){_0x22f343[_0x50e3('0x211')]('[actionOriginate]\x20',_0x9b5fb7,_0x5d9c6b[_0x1ff7b1]);}else{_0x22f343[_0x50e3('0xc0')](_[_0x50e3('0xd8')](_0x5d9c6b[_0x1ff7b1],[_0x50e3('0x101'),_0x50e3('0x20b')]))[_0x50e3('0xbe')](_0x22f343[_0x50e3('0x1f4')](_0x9b5fb7,_0x5d9c6b[_0x1ff7b1]))[_0x50e3('0xb8')](_0x22f343[_0x50e3('0x20c')](_0x50e3('0x20a'),_0x9b5fb7));}}}})[_0x50e3('0xb8')](loggerGetContactDialer('[getContactDialer2]',_0x9b5fb7,_0x3b0cb2));}};Dialer[_0x50e3('0x1d')][_0x50e3('0x98')]=function(_0x5caae7){if(_0x5caae7[_0x50e3('0x20f')]>0x0){var _0x3eaad9=_0x5caae7[_0x50e3('0x20f')]-_0x5caae7[_0x50e3('0x75')]-_0x5caae7['talking'];if(_0x3eaad9>0x0){this[_0x50e3('0x212')](_0x5caae7);}else{loggerPredictiveCalls['info'](_0x50e3('0x213'));}}else{this['tryOriginatePredictive'](_0x5caae7);}};Dialer['prototype'][_0x50e3('0x212')]=function(_0x43996c){var _0x35886a=this;var _0x2062d3=[];_0x43996c['originated']+=0x1;for(var _0xff01ee in this[_0x50e3('0x25')]){if(typeof this['agents'][_0xff01ee]!=='undefined'){if(this[_0x50e3('0x25')][_0xff01ee][_0x50e3('0xad')]===_0x50e3('0x210')&&this[_0x50e3('0x25')][_0xff01ee][_0x50e3('0xb7')]===_0x50e3('0xe1')){_0x2062d3[_0x50e3('0x134')](this[_0x50e3('0x25')][_0xff01ee]['id']);}}}this[_0x50e3('0xca')](_0x43996c['id'],_0x2062d3,0x1,_0x43996c[_0x50e3('0x207')],_0x43996c)['then'](function(_0x4b0ca0){if(!checkContactEmpty(_0x4b0ca0)){checkContactLowerLimitOriginate(_0x43996c,0x1,0x0);_0x35886a[_0x50e3('0xbd')](_0x43996c)[_0x50e3('0xbe')](sendMessageReschedule(_0x43996c))['catch'](loggerCatch(_0x50e3('0xbf')));}else{_0x43996c[_0x50e3('0x42')]=_0x50e3('0x209');if(_['isNil'](_0x4b0ca0[0x0])||_[_0x50e3('0xb5')](_0x4b0ca0[0x0][_0x50e3('0x174')])||_[_0x50e3('0xb5')](_0x4b0ca0[0x0][_0x50e3('0x174')][_0x50e3('0x175')])){_0x35886a[_0x50e3('0x211')](_0x50e3('0x20a'),_0x43996c,_0x4b0ca0[0x0]);}else{_0x35886a[_0x50e3('0xc0')](_[_0x50e3('0xd8')](_0x4b0ca0[0x0],[_0x50e3('0x101'),_0x50e3('0x20b')]))[_0x50e3('0xbe')](_0x35886a[_0x50e3('0x1f4')](_0x43996c,_0x4b0ca0[0x0]))[_0x50e3('0xb8')](_0x35886a[_0x50e3('0x20c')](_0x50e3('0x214'),_0x43996c));}}})[_0x50e3('0xb8')](loggerGetContactDialer(_0x50e3('0x215'),_0x43996c,0x1));emitVoiceQueueSummary(_0x43996c);};Dialer[_0x50e3('0x1d')][_0x50e3('0x1e8')]=function(_0x369dd5,_0x39a031,_0x2f903b,_0x2f947b,_0x3e65a7,_0x5bd30c){loggerPredictive[_0x50e3('0x83')](_0x50e3('0x216'));loggerPredictive[_0x50e3('0x83')](_0x50e3('0x217'),_0x369dd5);loggerPredictive[_0x50e3('0x83')](_0x50e3('0x218'),_0x39a031);loggerPredictive['info'](_0x50e3('0x219'),_0x2f903b);loggerPredictive[_0x50e3('0x83')](_0x50e3('0x21a'),_0x2f947b);loggerPredictive[_0x50e3('0x83')](_0x50e3('0x21b'),_0x3e65a7);loggerPredictive[_0x50e3('0x83')]('---------------------------');return new BPromise(function(_0x30ee63,_0x20f0a5){if(_0x369dd5<=0x0||isNaN(_0x369dd5)){return _0x20f0a5(msgResponse(_0x50e3('0x21c'),_0x50e3('0x1a1'),_0x50e3('0x21d')+_0x369dd5));}if(_0x2f903b<=0x0||isNaN(_0x2f903b)){return _0x20f0a5(msgResponse(_0x50e3('0x21c'),_0x50e3('0x1a1'),_0x50e3('0x21e')+_0x2f903b));}if(_0x2f947b<=0x0||isNaN(_0x2f947b)){return _0x20f0a5(msgResponse(_0x50e3('0x21c'),_0x50e3('0x1a1'),'p\x20=\x20'+_0x2f947b));}if(_0x39a031<=0x0||isNaN(_0x39a031)){return _0x20f0a5(msgResponse(_0x50e3('0x21c'),_0x50e3('0x1a1'),'interval\x20=\x20'+_0x39a031));}if(_0x3e65a7<=0x0||isNaN(_0x3e65a7)){return _0x20f0a5(msgResponse(_0x50e3('0x21c'),'Error',_0x50e3('0x21f')+_0x3e65a7));}_0x5bd30c=_0x5bd30c||0x0;var _0x32eeea=0x1/_0x2f903b;var _0x4afe57=0x0;var _0x273d8a=0x0;var _0x9fecd1=0x0;var _0x5d2123=0x0;for(var _0x149f5b=0x0;_0x9fecd1<_0x3e65a7;_0x149f5b+=0x1){_0x273d8a=_0x149f5b/_0x39a031;_0x4afe57=(_0x2f947b*_0x273d8a+_0x5bd30c)/_0x32eeea;_0x9fecd1=erlangb(_0x4afe57,_0x369dd5);_0x5d2123=_0x4afe57/_0x369dd5*(0x1-erlangb(_0x4afe57,_0x369dd5));}return _0x30ee63({'erlangCalls':_0x149f5b,'erlangCallToSecond':_0x39a031/_0x149f5b,'erlangAbandonmentRate':_0x9fecd1,'erlangBusyFactor':_0x5d2123});});};Dialer[_0x50e3('0x1d')]['busyFactor']=function(_0x3d45f7,_0x57e71f,_0x824cb4,_0x164ead,_0x486703,_0x2ed073){loggerPredictive['info'](_0x50e3('0x220'));loggerPredictive[_0x50e3('0x83')]('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3d45f7);loggerPredictive[_0x50e3('0x83')](_0x50e3('0x218'),_0x57e71f);loggerPredictive[_0x50e3('0x83')](_0x50e3('0x219'),_0x824cb4);loggerPredictive['info'](_0x50e3('0x21a'),_0x164ead);loggerPredictive[_0x50e3('0x83')](_0x50e3('0x221'),_0x486703);loggerPredictive[_0x50e3('0x83')](_0x50e3('0x94'));return new BPromise(function(_0x4ad6ed,_0x3c83dd){if(_0x3d45f7<=0x0||isNaN(_0x3d45f7)){return _0x3c83dd(msgResponse(_0x50e3('0x222'),_0x50e3('0x1a1'),_0x50e3('0x21d')+_0x3d45f7));}if(_0x824cb4<=0x0||isNaN(_0x824cb4)){return _0x3c83dd(msgResponse(_0x50e3('0x222'),_0x50e3('0x1a1'),_0x50e3('0x21e')+_0x824cb4));}if(_0x164ead<=0x0||isNaN(_0x164ead)){return _0x3c83dd(msgResponse('[busyFactor]','Error',_0x50e3('0x223')+_0x164ead));}if(_0x57e71f<=0x0||isNaN(_0x57e71f)){return _0x3c83dd(msgResponse(_0x50e3('0x222'),_0x50e3('0x1a1'),_0x50e3('0x224')+_0x57e71f));}if(_0x486703<=0x0||isNaN(_0x486703)){return _0x3c83dd(msgResponse('[busyFactor]',_0x50e3('0x1a1'),'Umin\x20=\x20'+_0x486703));}_0x2ed073=_0x2ed073||0x0;var _0x4a6435=0x1/_0x824cb4;var _0x281c0e=0x0;var _0x36c42f=0x0;var _0x21e89e=0x0;var _0xa9673a=0x0;for(var _0x311d72=0x0;_0xa9673a<_0x486703;_0x311d72+=0x1){_0x36c42f=_0x311d72/_0x57e71f;_0x281c0e=(_0x164ead*_0x36c42f+_0x2ed073)/_0x4a6435;_0x21e89e=erlangb(_0x281c0e,_0x3d45f7);_0xa9673a=_0x281c0e/_0x3d45f7*(0x1-erlangb(_0x281c0e,_0x3d45f7));}return _0x4ad6ed({'erlangCalls':_0x311d72,'erlangCallToSecond':_0x57e71f/_0x311d72,'erlangAbandonmentRate':_0x21e89e,'erlangBusyFactor':_0xa9673a});});};module[_0x50e3('0x225')]=Dialer;
\ No newline at end of file
+var _0x5cd8=['isEmpty','[ifTime][Action]','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','voice_queue:save','format','campaign:ivr:%s','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','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','predictiveIntervalAvgHoldtime','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','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','isUndefined','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','stack','inspect','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][Empty]','sendMessageOneNotActive','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Queue:\x20','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','is\x20disactive','state','statedesc','endtime','actions','[actions]','clearZombieChannels','enqueue','Action','channel','catch','updateOriginated','queue','countReScheduled','[countReScheduled]\x20','resolve','then','[checkIsBlackList]\x20','checkIsBlackListIvr','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','notFound','saveInDb','merge','pick','ContactId','ListId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','isTrunkReachable','SIP/%s','status','reachable','unmonitored','uniqueid','isNil','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','HangupInAMD','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','membername','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','reason','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','starttime','[syncAgentComplete][createHistory][10]','predictiveIntervalDroppedCallsCallersExit','outboundDropCallsDayCallersExit','CALLEREXIT','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','Abandoned','calleridname','calleridnum','[syncAgentComplete][createHistory][11]','actionid','stateinterface','locked','push','paused','queueStatusComplete','[unlockQueueStatus][undefined]','stringify','syncQueueStatusComplete','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','interval','timezones','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','predictive','method\x20not\x20recognized','launchHandleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','syncCampaigns','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','object','originate','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','%s%s','toUpper','dialRandomLastDigitCallerIdNumber','callerid','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','dialPrefix','trim','dialCutDigit','substring','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','countbusyretry','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','reason\x208\x20congestion','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','outboundDropCallsDayTimeout','round','floor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','averageHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','dialPredictiveInterval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','predictiveIntervalDroppedCallsTimeout','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','check\x20failure','[handlePredictive]','checkContactBlack','UserId','recallme','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','Agent','voicePause','outboundReCallsDay','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','[Originate][MoveBlacklist]','inBlackList','handleIvr','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','checkIsBlackList','Contact.phone','[getContactDialer2]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','abandonmentRate','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','Error','p\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','interval\x20=\x20','Umin\x20=\x20','exports','util','bluebird','uuid','moment','md5','../preview/util/util','../../../config/logger','dialer','booked','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','./action','./history','./final','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','queueBooked','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','newexten','syncNewExten','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','message','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','name','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','Intervals'];(function(_0x38dba5,_0x5d26bd){var _0x2e575d=function(_0x404331){while(--_0x404331){_0x38dba5['push'](_0x38dba5['shift']());}};_0x2e575d(++_0x5d26bd);}(_0x5cd8,0x1d2));var _0x85cd=function(_0x2129d5,_0x1aedc5){_0x2129d5=_0x2129d5-0x0;var _0x1cebda=_0x5cd8[_0x2129d5];return _0x1cebda;};'use strict';var util=require(_0x85cd('0x0'));var _=require('lodash');var BPromise=require(_0x85cd('0x1'));var uuid=require(_0x85cd('0x2'));var moment=require(_0x85cd('0x3'));var rr=require('rr');var md5=require(_0x85cd('0x4'));var Redis=require('ioredis');var ut=require(_0x85cd('0x5'));var config=require('../../../config/environment/');var logger=require(_0x85cd('0x6'))(_0x85cd('0x7'));var loggerBooked=require(_0x85cd('0x6'))(_0x85cd('0x8'));var loggerPredictive=require(_0x85cd('0x6'))('predictive');var loggerPredictiveCalls=require(_0x85cd('0x6'))(_0x85cd('0x9'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x85cd('0xa'));var ami=require(_0x85cd('0xb'));config[_0x85cd('0xc')]=_[_0x85cd('0xd')](config[_0x85cd('0xc')],{'host':_0x85cd('0xe'),'port':0x18eb});var io=require(_0x85cd('0xf'))(new Redis(config[_0x85cd('0xc')]));var cmHopper=require(_0x85cd('0x10'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x85cd('0x11'));var Action=require(_0x85cd('0x12'));var History=require(_0x85cd('0x13'));var Final=require(_0x85cd('0x14'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x85cd('0x15'));var Hangup=require(_0x85cd('0x16'));var ipAgi=process[_0x85cd('0x17')][_0x85cd('0x18')]||_0x85cd('0x19');var strategy={'rrmemory':_0x85cd('0x1a'),'roundrobin':_0x85cd('0x1b')};var Sequence=function(){};Sequence[_0x85cd('0x1c')]['enqueue']=function(_0x20cccf){this[_0x85cd('0x1d')]=this[_0x85cd('0x1d')]?this[_0x85cd('0x1d')][_0x85cd('0x1e')](_0x20cccf):_0x20cccf();};function Dialer(_0x5219ac,_0x441505){this['sequence']=new Sequence();this[_0x85cd('0x1f')]=_0x441505;this['voiceQueues']=_0x5219ac[_0x85cd('0x20')];this['campaigns']=_0x5219ac[_0x85cd('0x21')];this[_0x85cd('0x22')]=_0x5219ac[_0x85cd('0x22')];this[_0x85cd('0x23')]=_0x5219ac[_0x85cd('0x23')];this[_0x85cd('0x24')]=config[_0x85cd('0x24')]||0x2;this[_0x85cd('0x25')]={};this['actions']={};this[_0x85cd('0x26')]={};this[_0x85cd('0x27')]={};this['optionPredictive']={};this['startPredictive']={};this['startProgressive']={};this['ivrOriginated']={};this[_0x85cd('0x28')]={};this['queueBookedRR']={};ami['on'](_0x85cd('0x29'),this[_0x85cd('0x2a')][_0x85cd('0x2b')](this));ami['on'](_0x85cd('0x2c'),this['syncQueueCallerAbandon'][_0x85cd('0x2b')](this));ami['on'](_0x85cd('0x2d'),this[_0x85cd('0x2e')][_0x85cd('0x2b')](this));ami['on'](_0x85cd('0x2f'),this[_0x85cd('0x30')]['bind'](this));ami['on'](_0x85cd('0x31'),this[_0x85cd('0xa')][_0x85cd('0x2b')](this));ami['on'](_0x85cd('0x32'),this['syncHangup'][_0x85cd('0x2b')](this));ami['on'](_0x85cd('0x33'),this[_0x85cd('0x34')]['bind'](this));ami['on']('varset',this[_0x85cd('0x35')]['bind'](this));ami['on'](_0x85cd('0x36'),this[_0x85cd('0x37')][_0x85cd('0x2b')](this));ami['on'](_0x85cd('0x38'),this['syncQueueStatusComplete'][_0x85cd('0x2b')](this));this[_0x85cd('0x39')]();this[_0x85cd('0x3a')]();}function isNotNull(_0x34cb51){return _0x34cb51!==null&&!_['isUndefined'](_0x34cb51);}function checkIsLoggedIn(_0x331415,_0x1334c1){return function(){if(_0x1334c1<=0x0){_0x331415[_0x85cd('0x3b')]='AGENTS_NOT_LOGGED';throw _0x331415['name']+_0x85cd('0x3c');}};}function isActive(_0x313346){return _0x313346;}function checkIsActive(_0x45b981,_0x152a54){return function(){if(!isActive(_0x152a54)){_0x45b981[_0x85cd('0x3b')]=_0x85cd('0x3d');throw _0x45b981[_0x85cd('0x3e')]+_0x85cd('0x3f');}};}function checkInterval(_0x564ca0){return function(){if(!isNotNull(_0x564ca0[_0x85cd('0x40')])){_0x564ca0[_0x85cd('0x3b')]=_0x85cd('0x41');throw _0x564ca0[_0x85cd('0x3e')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x564ca0[_0x85cd('0x40')][_0x85cd('0x42')])){_0x564ca0[_0x85cd('0x3b')]=_0x85cd('0x41');throw _0x564ca0[_0x85cd('0x3e')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x85cd('0x43')](_0x564ca0[_0x85cd('0x40')]['Intervals']))){_0x564ca0[_0x85cd('0x3b')]=_0x85cd('0x41');throw _0x564ca0[_0x85cd('0x3e')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x48a04e,_0x2c7b30,_0x25e998){return{'action':_0x48a04e,'response':_0x2c7b30,'message':_0x25e998,'stack':_0x25e998};}function myreject(_0x4fc244){return function(_0x562b05){return _0x4fc244(msgResponse(_0x85cd('0x44'),'Error',JSON['stringify'](_0x562b05)));};}function getSeconds(_0x10f3a3,_0x1d0585){var _0x8e683f=moment(_0x10f3a3)[_0x85cd('0x45')](0x0);var _0x662a87=moment(_0x1d0585)[_0x85cd('0x45')](0x0);return _0x8e683f[_0x85cd('0x46')](_0x662a87,_0x85cd('0x47'));}function emit(_0x3c2a47,_0x1589bb,_0x26a672){io['to'](_0x3c2a47)[_0x85cd('0x48')](_0x1589bb,_0x26a672);}function emitVoiceQueueSummary(_0x460737){if(_0x460737[_0x85cd('0x49')]===_0x85cd('0x4a')){var _0x4d16bf={'id':_0x460737['id'],'name':_0x460737[_0x85cd('0x3e')],'strategy':_0x460737[_0x85cd('0x4b')],'answered':_0x460737[_0x85cd('0x4c')],'available':_0x460737[_0x85cd('0x4d')],'loggedIn':_0x460737[_0x85cd('0x4e')],'pTalking':_0x460737[_0x85cd('0x4f')],'sumBillable':_0x460737[_0x85cd('0x50')],'sumDuration':_0x460737[_0x85cd('0x51')],'sumHoldTime':_0x460737[_0x85cd('0x52')]||0x0,'talking':_0x460737[_0x85cd('0x53')],'total':_0x460737[_0x85cd('0x54')],'type':_0x460737['type'],'unmanaged':_0x460737['unmanaged'],'abandoned':_0x460737[_0x85cd('0x55')],'waiting':_0x460737[_0x85cd('0x56')],'loggedInDb':_0x460737[_0x85cd('0x57')],'dialActive':_0x460737[_0x85cd('0x58')],'dialMethod':_0x460737['dialMethod'],'dialOriginateCallerIdName':_0x460737[_0x85cd('0x59')],'dialOriginateCallerIdNumber':_0x460737[_0x85cd('0x5a')],'dialOriginateTimeout':_0x460737[_0x85cd('0x5b')],'dialPrefix':_0x460737['dialPrefix'],'outboundAnswerAgiCallsDay':_0x460737[_0x85cd('0x5c')],'outboundAnswerCallsDay':_0x460737[_0x85cd('0x5d')],'outboundBlacklistCallsDay':_0x460737[_0x85cd('0x5e')],'outboundBusyCallsDay':_0x460737[_0x85cd('0x5f')],'outboundCongestionCallsDay':_0x460737[_0x85cd('0x60')],'outboundDropCallsDayACS':_0x460737[_0x85cd('0x61')],'outboundDropCallsDayCallersExit':_0x460737['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x460737['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x460737[_0x85cd('0x62')],'outboundNoSuchCallsDay':_0x460737[_0x85cd('0x63')],'outboundOriginateFailureCallsDay':_0x460737[_0x85cd('0x64')],'outboundReCallsDay':_0x460737['outboundReCallsDay'],'outboundRejectCallsDay':_0x460737[_0x85cd('0x65')],'outboundUnknownCallsDay':_0x460737[_0x85cd('0x66')],'predictiveIntervalAnsweredCalls':_0x460737[_0x85cd('0x67')],'predictiveIntervalAvgHoldtime':_0x460737['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x460737[_0x85cd('0x68')],'predictiveIntervalDroppedCallsCallersExit':_0x460737['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x460737['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x460737[_0x85cd('0x69')],'predictiveIntervalErlangCallsDroppedCalls':_0x460737[_0x85cd('0x6a')],'predictiveIntervalHitRate':_0x460737[_0x85cd('0x6b')],'predictiveIntervalMultiplicativeFactor':_0x460737[_0x85cd('0x6c')],'predictiveIntervalPauses':_0x460737[_0x85cd('0x6d')],'predictiveIntervalAvailable':_0x460737[_0x85cd('0x6e')],'predictiveIntervalTotalCalls':_0x460737['predictiveIntervalTotalCalls'],'message':_0x460737[_0x85cd('0x3b')],'originated':_0x460737[_0x85cd('0x6f')],'erlangCalls':_0x460737[_0x85cd('0x70')],'erlangCallToSecond':_0x460737[_0x85cd('0x71')],'erlangAbandonmentRate':_0x460737[_0x85cd('0x72')],'erlangBusyFactor':_0x460737[_0x85cd('0x73')],'startPredictive':_0x460737[_0x85cd('0x74')],'startProgressive':_0x460737[_0x85cd('0x75')]};if(_0x460737['Trunk']){_0x4d16bf['Trunk']={'id':_0x460737[_0x85cd('0x76')]['id'],'name':_0x460737[_0x85cd('0x76')][_0x85cd('0x3e')],'active':_0x460737[_0x85cd('0x76')][_0x85cd('0x77')],'callerid':_0x460737[_0x85cd('0x76')]['callerid']};}if(_0x460737[_0x85cd('0x40')]){_0x4d16bf[_0x85cd('0x40')]={'id':_0x460737[_0x85cd('0x40')]['id'],'name':_0x460737['Interval']['name']};}var _0x5a746c=md5(JSON['stringify'](_0x4d16bf));if(_0x460737['md5']!==_0x5a746c){_0x460737[_0x85cd('0x4')]=_0x5a746c;emit(util['format']('voice:queue:%s',_0x4d16bf[_0x85cd('0x3e')]),_0x85cd('0x78'),_0x4d16bf);}}}function emitCampaignSummary(_0x2573cf){if(_0x2573cf[_0x85cd('0x49')]==='ivr'){emit(util[_0x85cd('0x79')](_0x85cd('0x7a'),_0x2573cf['name']),'campaign:save',_0x2573cf);}}function checkGetDataPredictive(_0x250f50){if(isNotNull(_0x250f50)&&!_['isEmpty'](_0x250f50)){loggerPredictive[_0x85cd('0x7b')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x7c'),_0x250f50[_0x85cd('0x7d')]);loggerPredictive['info'](_0x85cd('0x7e'),_0x250f50[_0x85cd('0x67')]);loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x7f'),_0x250f50['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x80'),_0x250f50['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x85cd('0x7b')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x250f50[_0x85cd('0x81')]);loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x82'),_0x250f50[_0x85cd('0x68')]);loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x83'));if(_0x250f50['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0x250f50[_0x85cd('0x68')])&&_0x250f50[_0x85cd('0x68')]>0x0){return!![];}loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x84'));if(!_['isUndefined'](_0x250f50[_0x85cd('0x81')])&&_0x250f50[_0x85cd('0x81')]>0x0){return!![];}loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x85'));}else{loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x86'));}}else{loggerPredictive[_0x85cd('0x7b')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x49ca42){return function(_0x1d3505){loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x87'));loggerPredictive[_0x85cd('0x7b')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1d3505[_0x85cd('0x70')]);loggerPredictive[_0x85cd('0x7b')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1d3505[_0x85cd('0x71')]);loggerPredictive[_0x85cd('0x7b')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1d3505[_0x85cd('0x72')]);loggerPredictive['info'](_0x85cd('0x88'),_0x1d3505[_0x85cd('0x73')]);loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x89'),_0x1d3505[_0x85cd('0x72')]);loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x83'));_['merge'](_0x49ca42,_0x1d3505);};}function getDiff(_0x52b30a){var _0x2343cf=moment()[_0x85cd('0x45')](0x0);var _0x5b1c19=moment(_0x52b30a)[_0x85cd('0x45')](0x0);return _0x2343cf[_0x85cd('0x46')](_0x5b1c19,_0x85cd('0x47'));}function ifInterval(_0x2f2bfd,_0x1f6f18){if(_['isUndefined'](_0x1f6f18)){return![];}return getDiff(_0x1f6f18)<_0x2f2bfd*0x3c;}function freeVariablesPredictive(_0x1d40ad){if(isNotNull(_0x1d40ad)){if(!_[_0x85cd('0x8a')](_0x1d40ad[_0x85cd('0x75')])){_0x1d40ad[_0x85cd('0x75')]=undefined;loggerPredictive[_0x85cd('0x7b')](_0x1d40ad[_0x85cd('0x3e')],_0x85cd('0x8b'));}if(!_[_0x85cd('0x8a')](_0x1d40ad[_0x85cd('0x74')])){_0x1d40ad['startPredictive']=undefined;loggerPredictive['info'](_0x1d40ad[_0x85cd('0x3e')],_0x85cd('0x8c'));}if(!_[_0x85cd('0x8a')](_0x1d40ad[_0x85cd('0x8d')])){clearInterval(_0x1d40ad[_0x85cd('0x8d')]);_0x1d40ad[_0x85cd('0x8d')]=undefined;loggerPredictive['info'](_0x1d40ad[_0x85cd('0x3e')],_0x85cd('0x8e'));}}}function erlangb(_0x87668e,_0x5eb538){if(_0x5eb538===0x0){return 0x0;}var _0x445011=0x1;for(var _0x5634bb=0x1;_0x5634bb<=_0x5eb538;_0x5634bb+=0x1){_0x445011=0x1+_0x445011*_0x5634bb/_0x87668e;}return 0x1/_0x445011;}function isVoiceQueueOutbound(_0x7f7725){return _0x7f7725===_0x85cd('0x4a');}function isNotPreview(_0x225b28){return _0x225b28!==_0x85cd('0x1f');}function isCampaignIvr(_0x151eb9){return _0x151eb9===_0x85cd('0x8f');}function getCallerId(_0x3c9d56,_0x2cb914,_0x1764ac){if(!_[_0x85cd('0x8a')](_0x1764ac)&&typeof _0x1764ac==='string'&&!_[_0x85cd('0x43')](_0x1764ac)){if(!_[_0x85cd('0x8a')](_0x2cb914)&&typeof _0x2cb914===_0x85cd('0x90')&&!_[_0x85cd('0x43')](_0x2cb914)){return util[_0x85cd('0x79')](_0x85cd('0x91'),_0x2cb914,_0x1764ac);}return util[_0x85cd('0x79')](_0x85cd('0x91'),_0x1764ac,_0x1764ac);}if(!_[_0x85cd('0x8a')](_0x3c9d56)&&typeof _0x3c9d56===_0x85cd('0x90')&&!_[_0x85cd('0x43')](_0x3c9d56)){return _0x3c9d56;}return _0x85cd('0x92');}function loggerCatchQueueSummary(_0x43ea99,_0x790f50){return function(_0x171437){freeVariablesPredictive(_0x790f50);emitVoiceQueueSummary(_0x790f50);emitCampaignSummary(_0x790f50);loggerSyncQueueSummary[_0x85cd('0x93')](_0x43ea99,util['inspect'](_0x171437,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4963c7,_0xe7a662){return function(_0x73bc88){loggerPredictive[_0x85cd('0x93')](_0xe7a662['name'],_0x4963c7);loggerPredictive['error'](_0x73bc88[_0x85cd('0x94')]);freeVariablesPredictive(_0xe7a662);};}function loggerCatch(_0x358500){return function(_0x39d712){logger[_0x85cd('0x93')](_0x358500,util[_0x85cd('0x95')](_0x39d712,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5cf24a){return _0x5cf24a&&!_[_0x85cd('0x8a')](_0x5cf24a)&&_0x5cf24a[_0x85cd('0x96')]>0x0;}function decremetOriginate(_0x45d1e9){if(!_['isUndefined'](_0x45d1e9)&&_0x45d1e9!==null){if(typeof _0x45d1e9['originated']!==_0x85cd('0x97')){if(_0x45d1e9[_0x85cd('0x6f')]>0x0){_0x45d1e9[_0x85cd('0x6f')]-=0x1;}else{logger[_0x85cd('0x93')](_0x85cd('0x98'));}}}else{logger[_0x85cd('0x93')](_0x85cd('0x99'));}}function checkContactLowerLimitOriginate(_0x34373a,_0xcb1c10,_0x156626){if(_0xcb1c10>_0x156626){for(var _0x45cda4=0x0;_0x45cda4<_0xcb1c10-_0x156626;_0x45cda4+=0x1){decremetOriginate(_0x34373a);}}}function loggerGetContactDialer(_0x23cec7,_0x3523a8,_0x49e34e){return function(_0x40f0e4){checkContactLowerLimitOriginate(_0x3523a8,_0x49e34e,0x0);logger[_0x85cd('0x93')](_0x23cec7,util['inspect'](_0x40f0e4,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3c9385){return function(_0xf5d519){if(isNotNull(_0xf5d519)&&isNotNull(_0xf5d519[0x0])){if(_0xf5d519[0x0][_0x85cd('0x9a')]>0x0){_0x3c9385[_0x85cd('0x3b')]=_0x85cd('0x9b');logger['info']('[getContactDialer2][ReScheduled]'+_0x3c9385[_0x85cd('0x3e')],_0xf5d519[0x0][_0x85cd('0x9a')],'contacts');}else{_0x3c9385[_0x85cd('0x3b')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x85cd('0x7b')](_0x85cd('0x9c')+_0x3c9385[_0x85cd('0x3e')]);}}};}function notSendMessagesQueue(_0x2237d7){if(_0x2237d7[_0x85cd('0x9d')]){freeVariablesPredictive(_0x2237d7);if(_0x2237d7[_0x85cd('0x6f')]===0x0&&_0x2237d7[_0x85cd('0x53')]===0x0&&_0x2237d7[_0x85cd('0x56')]===0x0&&(_0x2237d7['pTalking']||0x0)===0x0){_0x2237d7[_0x85cd('0x9d')]=![];_0x2237d7[_0x85cd('0x4d')]=0x0;_0x2237d7[_0x85cd('0x3b')]=_0x85cd('0x3d');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x2237d7[_0x85cd('0x3e')],_0x85cd('0x9e'));}else{_0x2237d7[_0x85cd('0x3b')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x85cd('0x93')](_0x85cd('0x9f'),_0x2237d7['name'],'is\x20disactive');}emitVoiceQueueSummary(_0x2237d7);}}function notSendMessagesCampaign(_0x4ee4ce){if(_0x4ee4ce[_0x85cd('0x9d')]){if(_0x4ee4ce[_0x85cd('0x6f')]===0x0){_0x4ee4ce[_0x85cd('0x9d')]=![];_0x4ee4ce[_0x85cd('0x3b')]=_0x85cd('0x3d');loggerSyncQueueSummary[_0x85cd('0x93')](_0x85cd('0xa0'),_0x4ee4ce[_0x85cd('0x3e')],_0x85cd('0x9e'));}else{_0x4ee4ce[_0x85cd('0x3b')]=_0x85cd('0xa1');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x4ee4ce[_0x85cd('0x3e')],_0x85cd('0xa2'));}emitCampaignSummary(_0x4ee4ce);}}function createObjHistory(_0xc45d67,_0x56320b,_0x3d0498,_0x538fb9,_0x1a8f8b){_0xc45d67[_0x85cd('0x3b')]=_0x3d0498;var _0x118aab=new Action(_0xc45d67,_0x56320b);var _0x1cff92=new History(_0x118aab);_0x1cff92[_0x85cd('0xa3')]=_0x538fb9;_0x1cff92[_0x85cd('0xa4')]=_0x1a8f8b;_0x1cff92[_0x85cd('0xa5')]=_0x118aab['starttime'];return _0x1cff92;}Dialer['prototype']['loopClearZombieChannels']=function(){var _0x183a43=this;setInterval(function(){_0x183a43['clearZombieChannels'](_0x183a43[_0x85cd('0x27')],'[uniqueid]');_0x183a43['clearZombieChannels'](_0x183a43[_0x85cd('0xa6')],_0x85cd('0xa7'));},0x32c8);};Dialer[_0x85cd('0x1c')][_0x85cd('0xa8')]=function(_0x471740,_0x4dc691){var _0x5b6736=this;for(var _0x50d6da in _0x471740){if(typeof _0x471740[_0x50d6da]!==_0x85cd('0x97')){this['sequence'][_0x85cd('0xa9')](function(){if(!_['isNil'](_0x471740[_0x50d6da])){return ami[_0x85cd('0xaa')]({'action':'status','channel':_0x471740[_0x50d6da][_0x85cd('0xab')]})[_0x85cd('0xac')](function(_0xc332ff){if(_0xc332ff[_0x85cd('0x3b')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x471740[_0x50d6da]&&_0x471740[_0x50d6da][_0x85cd('0x49')]!=='ivr'){_0x5b6736[_0x85cd('0xad')](_0x5b6736[_0x85cd('0x20')][_0x471740[_0x50d6da][_0x85cd('0xae')]]);logger[_0x85cd('0x93')]('[Dialer][checkChannel]',_0x4dc691,_0x50d6da,_0x471740[_0x50d6da]['queue']);delete _0x471740[_0x50d6da];}if(_0x471740[_0x50d6da]&&_0x471740[_0x50d6da][_0x85cd('0x49')]===_0x85cd('0x8f')){_0x5b6736['updateOriginated'](_0x5b6736[_0x85cd('0x21')][_0x471740[_0x50d6da][_0x85cd('0xae')]]);logger[_0x85cd('0x93')]('[Dialer][checkChannel][ivr]',_0x4dc691,_0x50d6da,_0x471740[_0x50d6da]['queue']);delete _0x471740[_0x50d6da];}},0x2328);}});}});}}};Dialer[_0x85cd('0x1c')][_0x85cd('0xaf')]=function(_0x91d6f5){return BPromise['resolve']()['then'](cmHopper['countReScheduled'](_0x91d6f5))[_0x85cd('0xac')](loggerCatch(_0x85cd('0xb0')));};Dialer[_0x85cd('0x1c')]['checkIsBlackList']=function(_0x382004){return BPromise[_0x85cd('0xb1')]()[_0x85cd('0xb2')](cmHopperBlack['checkIsBlackList'](_0x382004))['catch'](loggerCatch(_0x85cd('0xb3')));};Dialer[_0x85cd('0x1c')][_0x85cd('0xb4')]=function(_0x3bcf77){return BPromise[_0x85cd('0xb1')]()[_0x85cd('0xb2')](cmHopperBlack[_0x85cd('0xb4')](_0x3bcf77))[_0x85cd('0xac')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x85cd('0x1c')]['averageHandleTime']=function(_0x374171){return BPromise[_0x85cd('0xb1')]()[_0x85cd('0xb2')](cmHopperHistory['avgHandleTime'](_0x374171))[_0x85cd('0xac')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x85cd('0x1c')][_0x85cd('0xb5')]=function(_0x570aa3){return BPromise[_0x85cd('0xb1')]()[_0x85cd('0xb2')](cmHopper[_0x85cd('0xb5')](_0x570aa3))[_0x85cd('0xac')](loggerCatch(_0x85cd('0xb6')));};Dialer['prototype'][_0x85cd('0xb7')]=function(_0x4a1b55,_0x218c1e,_0x45cf9e){return BPromise['resolve']()['then'](cmHopper[_0x85cd('0xb7')](_0x4a1b55,_0x218c1e,_0x45cf9e))[_0x85cd('0xac')](loggerCatch(_0x85cd('0xb8')));};Dialer[_0x85cd('0x1c')][_0x85cd('0xb9')]=function(_0x386223,_0x2a5213,_0x4a26a5,_0x63b4ab,_0xf49804){return BPromise[_0x85cd('0xb1')]()[_0x85cd('0xb2')](cmHopper[_0x85cd('0xb9')](_0x386223,_0x2a5213,_0x4a26a5,_0x63b4ab))[_0x85cd('0xac')](function(_0x280de3){_0xf49804[_0x85cd('0xba')]-=_0x4a26a5;_0xf49804['temp']=_0xf49804[_0x85cd('0xba')]>0x0?_0xf49804['temp']:0x0;loggerCatch('[getContactDialer]\x20')(_0x280de3);});};Dialer[_0x85cd('0x1c')][_0x85cd('0xbb')]=function(_0x4fcdac,_0x10e650,_0x42c6d8,_0x41be62){return BPromise['resolve']()[_0x85cd('0xb2')](cmHopper[_0x85cd('0xbb')](_0x4fcdac,_0x10e650,_0x42c6d8))[_0x85cd('0xac')](function(_0x34f0ea){_0x41be62[_0x85cd('0xba')]-=_0x10e650;_0x41be62[_0x85cd('0xba')]=_0x41be62[_0x85cd('0xba')]>0x0?_0x41be62[_0x85cd('0xba')]:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x34f0ea);});};Dialer[_0x85cd('0x1c')][_0x85cd('0xbc')]=function(_0x579116){return BPromise[_0x85cd('0xb1')]()[_0x85cd('0xb2')](voiceQueueRt['getVoiceQueueRtPauses'](_0x579116))[_0x85cd('0xac')](loggerCatch(_0x85cd('0xbd')));};Dialer[_0x85cd('0x1c')][_0x85cd('0xbe')]=function(_0x3da1c4){return BPromise[_0x85cd('0xb1')]()[_0x85cd('0xb2')](cmHopper[_0x85cd('0xbe')](_0x3da1c4))[_0x85cd('0xac')](loggerCatch(_0x85cd('0xbf')));};Dialer[_0x85cd('0x1c')][_0x85cd('0xc0')]=function(_0x3ce991){return BPromise[_0x85cd('0xb1')]()[_0x85cd('0xb2')](cmHopperHistory[_0x85cd('0xc0')](_0x3ce991))['catch'](loggerCatch(_0x85cd('0xc1')));};Dialer['prototype'][_0x85cd('0xad')]=function(_0x582b9c){if(!_[_0x85cd('0x8a')](_0x582b9c)&&_0x582b9c!==null){if(typeof _0x582b9c['originated']!==_0x85cd('0x97')){if(_0x582b9c[_0x85cd('0x6f')]>0x0){_0x582b9c['originated']-=0x1;}else{logger[_0x85cd('0x93')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x85cd('0x93')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x85cd('0x1c')]['loggerHandler']=function(_0x2a374b,_0x28917c){var _0x2b6065=this;return function(_0x21072c){_0x2b6065[_0x85cd('0xad')](_0x28917c);logger[_0x85cd('0x93')](_0x2a374b,util[_0x85cd('0x95')](_0x21072c,{'showHidden':![],'depth':null}));};};Dialer['prototype']['emptyContact']=function(_0x166397,_0x58db59,_0x356672){var _0x385bab={'state':0x19,'statedesc':_0x85cd('0xc2')};this[_0x85cd('0xad')](_0x58db59);this[_0x85cd('0xc3')](_[_0x85cd('0xc4')](_0x385bab,_[_0x85cd('0xc5')](_0x356672,[_0x85cd('0xc6'),_0x85cd('0xc7'),'UserId',_0x85cd('0xc8'),_0x85cd('0xc9')])),_0x85cd('0xca'),_0x85cd('0xcb'));logger[_0x85cd('0x93')](_0x166397);};Dialer[_0x85cd('0x1c')][_0x85cd('0xcc')]=function(_0x235175){return _0x235175==='Success';};Dialer[_0x85cd('0x1c')][_0x85cd('0xcd')]=function(_0x310887){return!_['isUndefined'](_0x310887)&&_0x310887&&!_[_0x85cd('0x8a')](_0x310887['name'])&&!_['isUndefined'](_0x310887['active'])&&_0x310887[_0x85cd('0x77')]&&(this[_0x85cd('0x23')][util[_0x85cd('0x79')](_0x85cd('0xce'),_0x310887['name'])][_0x85cd('0xcf')]===_0x85cd('0xd0')||this[_0x85cd('0x23')][util['format'](_0x85cd('0xce'),_0x310887[_0x85cd('0x3e')])][_0x85cd('0xcf')]===_0x85cd('0xd1'));};Dialer[_0x85cd('0x1c')][_0x85cd('0xc3')]=function(_0x3a63bb,_0x5f3818,_0x42c522){this[_0x85cd('0xc0')](_0x3a63bb)[_0x85cd('0xac')](loggerCatch(_0x5f3818));this[_0x85cd('0xbe')](_0x3a63bb)[_0x85cd('0xac')](loggerCatch(_0x42c522));};Dialer[_0x85cd('0x1c')][_0x85cd('0x35')]=function(_0x1e5344){var _0x68c0e0=this[_0x85cd('0x27')][_0x1e5344[_0x85cd('0xd2')]];var _0x3de344;if(!_[_0x85cd('0xd3')](_0x1e5344)&&!_[_0x85cd('0xd3')](_0x1e5344[_0x85cd('0xd4')])&&!_['isNil'](_0x1e5344[_0x85cd('0xd4')][_0x85cd('0xd5')])&&_0x1e5344[_0x85cd('0xd6')]===_0x85cd('0xd7')&&_0x68c0e0){if(_0x68c0e0[_0x85cd('0x49')]!=='ivr'&&this[_0x85cd('0x20')][_0x68c0e0[_0x85cd('0xae')]][_0x85cd('0xd8')]&&_0x1e5344[_0x85cd('0xd9')]===_0x85cd('0xda')){delete this[_0x85cd('0x27')][_0x1e5344[_0x85cd('0xd2')]];this[_0x85cd('0xad')](this[_0x85cd('0x20')][_0x68c0e0[_0x85cd('0xae')]]);this[_0x85cd('0x20')][_0x68c0e0[_0x85cd('0xae')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x68c0e0['queue']][_0x85cd('0x5c')]+=0x1;_0x3de344=new Hangup(_0x68c0e0,_0x1e5344);_0x3de344[_0x85cd('0xa3')]=0x12;_0x3de344[_0x85cd('0xa4')]=_0x85cd('0xdb');_0x3de344['membername']=_0x85cd('0xdc');ami[_0x85cd('0x48')](_0x85cd('0xdd'),ut[_0x85cd('0xde')](_0x3de344,_0x85cd('0xdf')));this[_0x85cd('0xc3')](_0x3de344,_0x85cd('0xe0'),_0x85cd('0xe1'));}if(_0x68c0e0['type']!==_0x85cd('0x8f')&&this[_0x85cd('0x20')][_0x68c0e0[_0x85cd('0xae')]][_0x85cd('0xd8')]&&_0x1e5344['value']===_0x85cd('0xe2')){var _0x2492fe=this;return new BPromise(function(_0xcc7c31,_0x2ee2dc){delete _0x2492fe[_0x85cd('0x27')][_0x1e5344[_0x85cd('0xd2')]];_0x2492fe[_0x85cd('0xad')](_0x2492fe[_0x85cd('0x20')][_0x68c0e0[_0x85cd('0xae')]]);_0x2492fe['voiceQueues'][_0x68c0e0['queue']]['outboundAnswerCallsDay']+=0x1;_0x2492fe[_0x85cd('0x20')][_0x68c0e0['queue']][_0x85cd('0x5c')]+=0x1;var _0x10bb14=_0x2492fe[_0x85cd('0x20')][_0x68c0e0[_0x85cd('0xae')]];var _0x4cb4f0=new Hangup(_0x68c0e0,_0x1e5344);_0x4cb4f0[_0x85cd('0xa3')]=0x13;_0x4cb4f0['statedesc']='Machine';_0x4cb4f0[_0x85cd('0xe3')]=_0x85cd('0xdc');_0x4cb4f0[_0x85cd('0xe4')]+=0x1;_0x4cb4f0[_0x85cd('0xe5')]+=0x1;_0x4cb4f0['amd']=!![];ami[_0x85cd('0x48')](_0x85cd('0xdd'),ut[_0x85cd('0xde')](_0x4cb4f0,_0x85cd('0xdf')));_0x2492fe[_0x85cd('0xc0')](_0x4cb4f0)['catch'](loggerCatch(_0x85cd('0xe6')));if(_0x4cb4f0['countbusyretry']+_0x4cb4f0[_0x85cd('0xe7')]+_0x4cb4f0[_0x85cd('0xe8')]+_0x4cb4f0[_0x85cd('0xe9')]+_0x4cb4f0[_0x85cd('0xea')]+_0x4cb4f0[_0x85cd('0xeb')]+_0x4cb4f0[_0x85cd('0xe4')]+_0x4cb4f0[_0x85cd('0xec')]>=_0x10bb14[_0x85cd('0xed')]){_0x2492fe[_0x85cd('0xee')](_0x4cb4f0,_0xcc7c31,_0x2ee2dc,_0x85cd('0xef'));}else{if(_0x4cb4f0['countmachineretry']>=_0x10bb14[_0x85cd('0xf0')]){_0x2492fe[_0x85cd('0xf1')](_0x4cb4f0,_0xcc7c31,_0x2ee2dc,_0x85cd('0xf2'));}else{_0x2492fe[_0x85cd('0xb5')]({'active':![],'countmachineretry':_0x4cb4f0[_0x85cd('0xe4')],'scheduledat':moment()[_0x85cd('0xf3')](_0x10bb14[_0x85cd('0xf4')],_0x85cd('0xf5'))[_0x85cd('0x79')](_0x85cd('0xf6')),'ContactId':_0x4cb4f0[_0x85cd('0xc6')],'ListId':_0x4cb4f0[_0x85cd('0xc7')],'VoiceQueueId':_0x4cb4f0[_0x85cd('0xc8')]||undefined,'CampaignId':_0x4cb4f0[_0x85cd('0xc9')]||undefined})[_0x85cd('0xac')](loggerCatch(_0x85cd('0xf7')));_0xcc7c31({'reschedule':0x1});}}});}if(_0x68c0e0[_0x85cd('0x49')]==='ivr'&&this[_0x85cd('0x21')][_0x68c0e0[_0x85cd('0xae')]][_0x85cd('0xd8')]&&_0x1e5344[_0x85cd('0xd9')]===_0x85cd('0xda')){delete this[_0x85cd('0x27')][_0x1e5344['uniqueid']];this[_0x85cd('0xad')](this[_0x85cd('0x21')][_0x68c0e0['queue']]);_0x3de344=new Hangup(_0x68c0e0,_0x1e5344);_0x3de344['state']=0x12;_0x3de344[_0x85cd('0xa4')]=_0x85cd('0xdb');_0x3de344[_0x85cd('0xe3')]=_0x85cd('0xdc');ami[_0x85cd('0x48')](_0x85cd('0xdd'),ut[_0x85cd('0xde')](_0x3de344,_0x85cd('0xdf')));this[_0x85cd('0xc3')](_0x3de344,_0x85cd('0xf8'),_0x85cd('0xf9'));}if(_0x68c0e0[_0x85cd('0x49')]===_0x85cd('0x8f')&&this['campaigns'][_0x68c0e0[_0x85cd('0xae')]][_0x85cd('0xd8')]&&_0x1e5344[_0x85cd('0xd9')]==='MACHINE'){var _0x2492fe=this;return new BPromise(function(_0x5a8063,_0x4cbae4){delete _0x2492fe[_0x85cd('0x27')][_0x1e5344[_0x85cd('0xd2')]];_0x2492fe[_0x85cd('0xad')](_0x2492fe[_0x85cd('0x21')][_0x68c0e0['queue']]);_0x2492fe[_0x85cd('0x21')][_0x68c0e0['queue']]['outboundAnswerCallsDay']+=0x1;_0x2492fe[_0x85cd('0x21')][_0x68c0e0[_0x85cd('0xae')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x3e1a22=_0x2492fe['campaigns'][_0x68c0e0[_0x85cd('0xae')]];var _0x41f92e=new Hangup(_0x68c0e0,_0x1e5344);_0x41f92e['state']=0x13;_0x41f92e[_0x85cd('0xa4')]='Machine';_0x41f92e[_0x85cd('0xe3')]=_0x85cd('0xdc');_0x41f92e[_0x85cd('0xe4')]+=0x1;_0x41f92e[_0x85cd('0xe5')]+=0x1;_0x41f92e['amd']=!![];ami[_0x85cd('0x48')](_0x85cd('0xdd'),ut[_0x85cd('0xde')](_0x41f92e,'amd'));_0x2492fe[_0x85cd('0xc0')](_0x41f92e)[_0x85cd('0xac')](loggerCatch(_0x85cd('0xe6')));if(_0x41f92e['countbusyretry']+_0x41f92e['countcongestionretry']+_0x41f92e[_0x85cd('0xe8')]+_0x41f92e[_0x85cd('0xe9')]+_0x41f92e[_0x85cd('0xea')]+_0x41f92e[_0x85cd('0xeb')]+_0x41f92e[_0x85cd('0xe4')]+_0x41f92e['countagentrejectretry']>=_0x3e1a22['dialGlobalMaxRetry']){_0x2492fe[_0x85cd('0xee')](_0x41f92e,_0x5a8063,_0x4cbae4,_0x85cd('0xef'));}else{if(_0x41f92e[_0x85cd('0xe4')]>=_0x3e1a22[_0x85cd('0xf0')]){_0x2492fe['createStateFinal'](_0x41f92e,_0x5a8063,_0x4cbae4,_0x85cd('0xf2'));}else{_0x2492fe[_0x85cd('0xb5')]({'active':![],'countmachineretry':_0x41f92e[_0x85cd('0xe4')],'scheduledat':moment()['add'](_0x3e1a22[_0x85cd('0xf4')],'minutes')['format'](_0x85cd('0xf6')),'ContactId':_0x41f92e[_0x85cd('0xc6')],'ListId':_0x41f92e[_0x85cd('0xc7')],'VoiceQueueId':_0x41f92e[_0x85cd('0xc8')]||undefined,'CampaignId':_0x41f92e[_0x85cd('0xc9')]||undefined})[_0x85cd('0xac')](loggerCatch(_0x85cd('0xf7')));_0x5a8063({'reschedule':0x1});}}});}}};Dialer[_0x85cd('0x1c')]['syncHangup']=function(_0x2e166a){var _0x5a6733=this['uniqueId'][_0x2e166a[_0x85cd('0xd2')]];var _0x5136de=this;var _0x2f0568;if(_0x5a6733&&_0x5a6733[_0x85cd('0x49')]===_0x85cd('0x8f')){delete this[_0x85cd('0x27')][_0x2e166a[_0x85cd('0xd2')]];this['updateOriginated'](this[_0x85cd('0x21')][_0x5a6733['queue']]);this[_0x85cd('0x21')][_0x5a6733[_0x85cd('0xae')]][_0x85cd('0xfa')]+=0x1;_0x2f0568=new Hangup(_0x5a6733,_0x2e166a);this[_0x85cd('0xc0')](_0x2f0568)[_0x85cd('0xac')](loggerCatch(_0x85cd('0xfb')));this[_0x85cd('0xbe')](_0x2f0568)[_0x85cd('0xac')](loggerCatch(_0x85cd('0xfc')));}if(_0x5a6733&&_0x5a6733[_0x85cd('0x49')]!=='ivr'&&isNotNull(this['voiceQueues'][_0x5a6733[_0x85cd('0xae')]][_0x85cd('0xfd')])){delete this[_0x85cd('0x27')][_0x2e166a['uniqueid']];this[_0x85cd('0xad')](this[_0x85cd('0x20')][_0x5a6733[_0x85cd('0xae')]]);this['voiceQueues'][_0x5a6733[_0x85cd('0xae')]][_0x85cd('0x5d')]+=0x1;this[_0x85cd('0x20')][_0x5a6733[_0x85cd('0xae')]][_0x85cd('0x5c')]+=0x1;_0x2f0568=new Hangup(_0x5a6733,_0x2e166a);_0x2f0568[_0x85cd('0xa3')]=0x10;_0x2f0568['statedesc']=_0x85cd('0xfe');_0x2f0568[_0x85cd('0xe3')]=_0x85cd('0xff');this[_0x85cd('0xc0')](_0x2f0568)['catch'](loggerCatch(_0x85cd('0xfb')));this[_0x85cd('0xbe')](_0x2f0568)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x5a6733&&_0x5a6733['type']!==_0x85cd('0x8f')&&!isNotNull(this[_0x85cd('0x20')][_0x5a6733[_0x85cd('0xae')]][_0x85cd('0xfd')])){delete this['uniqueId'][_0x2e166a[_0x85cd('0xd2')]];this[_0x85cd('0xad')](this[_0x85cd('0x20')][_0x5a6733[_0x85cd('0xae')]]);this['voiceQueues'][_0x5a6733[_0x85cd('0xae')]][_0x85cd('0x66')]+=0x1;_0x2f0568=new Hangup(_0x5a6733,_0x2e166a);_0x2f0568[_0x85cd('0xa3')]=0xc;_0x2f0568[_0x85cd('0xa4')]=_0x2e166a[_0x85cd('0x100')];_0x2f0568[_0x85cd('0xe3')]=_0x85cd('0x101');this[_0x85cd('0xc0')](_0x2f0568)[_0x85cd('0xac')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x85cd('0xbe')](_0x2f0568)['catch'](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x85cd('0x1c')][_0x85cd('0x30')]=function(_0x26bfe){var _0xffe419=this[_0x85cd('0x27')][_0x26bfe['uniqueid']];var _0x34968a=this;if(this['voiceQueues'][_0x26bfe[_0x85cd('0xae')]]){if(_0xffe419&&_0xffe419[_0x85cd('0x49')]!==_0x85cd('0x8f')){delete this[_0x85cd('0x27')][_0x26bfe[_0x85cd('0xd2')]];this['voiceQueues'][_0x26bfe[_0x85cd('0xae')]][_0x85cd('0x5d')]+=0x1;var _0x105d51=new AgentComplete(_0xffe419,_0x26bfe);if(_0x26bfe[_0x85cd('0x102')]==='agent'){_0x105d51[_0x85cd('0x103')]=this[_0x85cd('0x20')][_0x26bfe[_0x85cd('0xae')]][_0x85cd('0x104')]&&this[_0x85cd('0x20')][_0x26bfe[_0x85cd('0xae')]][_0x85cd('0x105')]?moment()[_0x85cd('0x79')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0x85cd('0xc0')](_0x105d51)['catch'](loggerCatch(_0x85cd('0x106')));this[_0x85cd('0xbe')](_0x105d51)[_0x85cd('0xac')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x85cd('0x1c')]['syncAgentConnect']=function(_0x4dd97e){if(this[_0x85cd('0x20')][_0x4dd97e[_0x85cd('0xae')]]){if(this[_0x85cd('0x27')][_0x4dd97e[_0x85cd('0xd2')]]&&this['uniqueId'][_0x4dd97e[_0x85cd('0xd2')]][_0x85cd('0x49')]!==_0x85cd('0x8f')){this[_0x85cd('0xad')](this[_0x85cd('0x20')][_0x4dd97e[_0x85cd('0xae')]]);this['uniqueId'][_0x4dd97e['uniqueid']][_0x85cd('0x107')]=moment()[_0x85cd('0x79')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer['prototype'][_0x85cd('0x108')]=function(_0x301a52){this[_0x85cd('0xc0')](_0x301a52)[_0x85cd('0xac')](loggerCatch(_0x85cd('0x106')));this[_0x85cd('0xbe')](_0x301a52)[_0x85cd('0xac')](loggerCatch(_0x85cd('0x109')));};Dialer[_0x85cd('0x1c')]['syncQueueCallerAbandon']=function(_0x444328){var _0x2cc5d3=this[_0x85cd('0x27')][_0x444328[_0x85cd('0xd2')]];var _0x113bd4=this;if(this[_0x85cd('0x20')][_0x444328['queue']]){if(_0x2cc5d3&&_0x2cc5d3[_0x85cd('0x49')]!==_0x85cd('0x8f')){delete this[_0x85cd('0x27')][_0x444328[_0x85cd('0xd2')]];this[_0x85cd('0xad')](this[_0x85cd('0x20')][_0x444328['queue']]);_0x2cc5d3['droptime']=moment()[_0x85cd('0x79')](_0x85cd('0xf6'));var _0x5363b3=new QueueCallerAbandon(_0x2cc5d3,_0x444328);if(getSeconds(_0x2cc5d3[_0x85cd('0x10a')],_0x2cc5d3[_0x85cd('0x10b')])>=_0x2cc5d3[_0x85cd('0x10c')]){this[_0x85cd('0x20')][_0x444328[_0x85cd('0xae')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this['voiceQueues'][_0x444328['queue']]['outboundDropCallsDayTimeout']+=0x1;this[_0x85cd('0x20')][_0x444328[_0x85cd('0xae')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x5363b3[_0x85cd('0xa3')]=0xa;_0x5363b3[_0x85cd('0xa4')]=_0x85cd('0x10d');_0x5363b3[_0x85cd('0x10e')]=_0x85cd('0x10f');_0x5363b3['agiafterat']=this[_0x85cd('0x20')][_0x444328['queue']]['dialQueueProject2']?moment()[_0x85cd('0x79')](_0x85cd('0xf6')):undefined;_0x5363b3[_0x85cd('0xea')]+=0x1;_0x5363b3[_0x85cd('0xe5')]+=0x1;if(_0x5363b3['countdropretry']>=this['voiceQueues'][_0x444328[_0x85cd('0xae')]][_0x85cd('0x110')]){this[_0x85cd('0x108')](_0x5363b3);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x5363b3[_0x85cd('0xea')],'scheduledat':moment()[_0x85cd('0xf3')](this[_0x85cd('0x20')][_0x444328[_0x85cd('0xae')]][_0x85cd('0x111')],_0x85cd('0xf5'))[_0x85cd('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2cc5d3[_0x85cd('0xc6')],'ListId':_0x2cc5d3[_0x85cd('0xc7')],'VoiceQueueId':_0x2cc5d3[_0x85cd('0xc8')]||undefined,'CampaignId':_0x2cc5d3['CampaignId']||undefined})[_0x85cd('0xac')](loggerCatch(_0x85cd('0x112')));var _0x4fc96b=new History(_0x5363b3);_0x4fc96b[_0x85cd('0xa3')]=0xa;_0x4fc96b[_0x85cd('0xa4')]=_0x85cd('0x10d');_0x4fc96b[_0x85cd('0x113')]=moment()['format'](_0x85cd('0xf6'));_0x4fc96b[_0x85cd('0xa5')]=_0x4fc96b[_0x85cd('0x113')];_0x4fc96b['calleridname']=_0x5363b3['calleridname'];_0x4fc96b['calleridnum']=_0x5363b3['calleridnum'];this[_0x85cd('0xc0')](_0x4fc96b)['catch'](loggerCatch(_0x85cd('0x114')));}}else{this[_0x85cd('0x20')][_0x444328['queue']][_0x85cd('0x115')]+=0x1;this[_0x85cd('0x20')][_0x444328['queue']][_0x85cd('0x116')]+=0x1;_0x5363b3[_0x85cd('0xa3')]=0xb;_0x5363b3[_0x85cd('0xa4')]='Abandoned';_0x5363b3[_0x85cd('0x10e')]=_0x85cd('0x117');_0x5363b3[_0x85cd('0xeb')]+=0x1;_0x5363b3[_0x85cd('0xe5')]+=0x1;if(_0x5363b3[_0x85cd('0xeb')]>=this[_0x85cd('0x20')][_0x444328[_0x85cd('0xae')]]['dialAbandonedMaxRetry']){this[_0x85cd('0x108')](_0x5363b3);}else{this[_0x85cd('0xb5')]({'active':![],'countabandonedretry':_0x5363b3['countabandonedretry'],'scheduledat':moment()[_0x85cd('0xf3')](this[_0x85cd('0x20')][_0x444328[_0x85cd('0xae')]][_0x85cd('0x118')],'minutes')[_0x85cd('0x79')](_0x85cd('0xf6')),'ContactId':_0x2cc5d3['ContactId'],'ListId':_0x2cc5d3[_0x85cd('0xc7')],'VoiceQueueId':_0x2cc5d3[_0x85cd('0xc8')]||undefined,'CampaignId':_0x2cc5d3[_0x85cd('0xc9')]||undefined})['catch'](loggerCatch(_0x85cd('0x119')));var _0x4fc96b=new History(_0x5363b3);_0x4fc96b[_0x85cd('0xa3')]=0xb;_0x4fc96b['statedesc']=_0x85cd('0x11a');_0x4fc96b[_0x85cd('0x113')]=moment()[_0x85cd('0x79')](_0x85cd('0xf6'));_0x4fc96b[_0x85cd('0xa5')]=_0x4fc96b[_0x85cd('0x113')];_0x4fc96b['calleridname']=_0x5363b3[_0x85cd('0x11b')];_0x4fc96b[_0x85cd('0x11c')]=_0x5363b3[_0x85cd('0x11c')];this[_0x85cd('0xc0')](_0x4fc96b)[_0x85cd('0xac')](loggerCatch(_0x85cd('0x11d')));}}}}};Dialer[_0x85cd('0x1c')][_0x85cd('0x34')]=function(_0x44e4d4){if(this[_0x85cd('0xa6')][_0x44e4d4['uniqueid']]){this[_0x85cd('0xa6')][_0x44e4d4[_0x85cd('0xd2')]][_0x85cd('0xab')]=_0x44e4d4[_0x85cd('0xab')];}if(this['uniqueId'][_0x44e4d4[_0x85cd('0xd2')]]){this[_0x85cd('0x27')][_0x44e4d4[_0x85cd('0xd2')]][_0x85cd('0xab')]=_0x44e4d4['channel'];}};Dialer[_0x85cd('0x1c')]['syncQueueMember']=function(_0x1f2c49){if(strategy[this['voiceQueues'][this[_0x85cd('0xa6')][_0x1f2c49[_0x85cd('0x11e')]]['queue']][_0x85cd('0x4b')]]===_0x85cd('0x1b')){if(this[_0x85cd('0xa6')][_0x1f2c49['actionid']]&&_[_0x85cd('0xd3')](this[_0x85cd('0xa6')][_0x1f2c49[_0x85cd('0x11e')]]['locked'])&&_0x1f2c49[_0x85cd('0xcf')]==='1'&&_0x1f2c49['paused']==='0'){if(this['agents'][_0x1f2c49[_0x85cd('0x11f')]]){if(!this[_0x85cd('0x22')][_0x1f2c49[_0x85cd('0x11f')]]['locked']){this[_0x85cd('0x22')][_0x1f2c49[_0x85cd('0x11f')]][_0x85cd('0x120')]=!![];this[_0x85cd('0xa6')][_0x1f2c49[_0x85cd('0x11e')]][_0x85cd('0x120')]=!![];this['actions'][_0x1f2c49['actionid']][_0x85cd('0x11f')]=_0x1f2c49['stateinterface'];}}}}else if((strategy[this[_0x85cd('0x20')][this[_0x85cd('0xa6')][_0x1f2c49['actionid']][_0x85cd('0xae')]]['strategy']]||_0x85cd('0x1a'))==='rrmemory'){if(this['actions'][_0x1f2c49[_0x85cd('0x11e')]]){if(this['agents'][_0x1f2c49[_0x85cd('0x11f')]]){this[_0x85cd('0xa6')][_0x1f2c49[_0x85cd('0x11e')]]['stateinterface']=_0x1f2c49[_0x85cd('0x11f')];if(_[_0x85cd('0xd3')](this['queueBooked'][this[_0x85cd('0xa6')][_0x1f2c49[_0x85cd('0x11e')]][_0x85cd('0xae')]])){this[_0x85cd('0x28')][this[_0x85cd('0xa6')][_0x1f2c49[_0x85cd('0x11e')]][_0x85cd('0xae')]]=[];}this[_0x85cd('0x28')][this[_0x85cd('0xa6')][_0x1f2c49[_0x85cd('0x11e')]][_0x85cd('0xae')]][_0x85cd('0x121')](_[_0x85cd('0xc4')](_['pick'](this['actions'][_0x1f2c49[_0x85cd('0x11e')]],['idHopper',_0x85cd('0x11f')]),{'status':_0x1f2c49[_0x85cd('0xcf')],'paused':_0x1f2c49[_0x85cd('0x122')]}));}}}};function unlockQueueStatus(_0x150531,_0x3dfa1d){setTimeout(function(){if(_[_0x85cd('0x8a')](_0x150531[_0x85cd('0x123')])){loggerBooked[_0x85cd('0x93')](_0x85cd('0x124'),_0x3dfa1d);}_0x150531[_0x85cd('0x123')]=!![];loggerBooked[_0x85cd('0x7b')]('[booked][unlockQueueStatus]',_0x3dfa1d,JSON[_0x85cd('0x125')](_[_0x85cd('0xc5')](_0x150531,[_0x85cd('0x3e'),_0x85cd('0x123')])));},0x1f3);}Dialer[_0x85cd('0x1c')][_0x85cd('0x126')]=function(_0x592658){var _0x53eb05=this;var _0x502ed0=_0x53eb05['voiceQueues'][_0x53eb05[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xae')]];if(strategy[this[_0x85cd('0x20')][this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xae')]][_0x85cd('0x4b')]]===_0x85cd('0x1b')){if(this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]]&&this['actions'][_0x592658['actionid']][_0x85cd('0x11f')]){this[_0x85cd('0x1f')][_0x85cd('0x127')](this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]][_0x85cd('0x128')],this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]]['stateinterface'])['catch'](function(_0x20bac6){logger[_0x85cd('0x93')](_0x85cd('0x129'),util['inspect'](_0x20bac6,{'showHidden':![],'depth':null}));})['finally'](function(){_0x53eb05[_0x85cd('0xad')](_0x53eb05[_0x85cd('0x20')][_0x53eb05[_0x85cd('0xa6')][_0x592658['actionid']][_0x85cd('0xae')]]);_0x53eb05['agents'][_0x53eb05[_0x85cd('0xa6')][_0x592658['actionid']]['stateinterface']]['locked']=![];delete _0x53eb05[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]];unlockQueueStatus(_0x502ed0);});}else{this[_0x85cd('0xad')](this[_0x85cd('0x20')][this[_0x85cd('0xa6')][_0x592658['actionid']][_0x85cd('0xae')]]);this[_0x85cd('0xb5')]({'active':![],'ContactId':this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xc6')],'ListId':this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xc7')],'VoiceQueueId':this['actions'][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xc8')]||undefined,'CampaignId':this[_0x85cd('0xa6')][_0x592658['actionid']][_0x85cd('0xc9')]||undefined})['catch'](loggerCatch(_0x85cd('0x12a')));delete this[_0x85cd('0xa6')][_0x592658['actionid']];unlockQueueStatus(_0x502ed0);}}else if((strategy[this[_0x85cd('0x20')][this['actions'][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xae')]][_0x85cd('0x4b')]]||_0x85cd('0x1a'))===_0x85cd('0x1a')){var _0x59904d;if(this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]]&&!_[_0x85cd('0x43')](this[_0x85cd('0x28')][this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xae')]])){if(this[_0x85cd('0x12b')][_0x53eb05[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xae')]]){this[_0x85cd('0x12b')][_0x53eb05[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xae')]]=this[_0x85cd('0x12b')][this['actions'][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xae')]]?this[_0x85cd('0x12b')][this['actions'][_0x592658['actionid']][_0x85cd('0xae')]]:this[_0x85cd('0x28')][this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]]['queue']]?this[_0x85cd('0x28')][this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xae')]][_0x85cd('0x12c')]||0x0:0x0;}this[_0x85cd('0x28')][this[_0x85cd('0xa6')][_0x592658['actionid']][_0x85cd('0xae')]][_0x85cd('0x12c')]=this[_0x85cd('0x12b')][this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xae')]];for(var _0x3dd4a2=0x0;_0x3dd4a2<this[_0x85cd('0x28')][this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xae')]][_0x85cd('0x96')];_0x3dd4a2+=0x1){_0x59904d=rr(this[_0x85cd('0x28')][this[_0x85cd('0xa6')][_0x592658['actionid']]['queue']]);this[_0x85cd('0x12b')][_0x53eb05[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xae')]]=this['queueBooked'][this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xae')]]['_rr'];if(_0x59904d[_0x85cd('0xcf')]==='1'&&_0x59904d[_0x85cd('0x122')]==='0'){break;}}if(!_[_0x85cd('0xd3')](_0x59904d)){this[_0x85cd('0x22')][_0x59904d[_0x85cd('0x11f')]]['unlockRR']=_[_0x85cd('0x8a')](this[_0x85cd('0x22')][_0x59904d[_0x85cd('0x11f')]][_0x85cd('0x12d')])?!![]:this[_0x85cd('0x22')][_0x59904d[_0x85cd('0x11f')]][_0x85cd('0x12d')];}loggerBooked[_0x85cd('0x7b')](_0x85cd('0x12e'),_0x592658[_0x85cd('0x11e')],'Agent:\x20',JSON[_0x85cd('0x125')](_[_0x85cd('0xc5')](this[_0x85cd('0x22')][_0x59904d[_0x85cd('0x11f')]],['name','unlockRR'])),'contactAgent-idHopper:\x20',JSON[_0x85cd('0x125')](_0x59904d['idHopper']));if(!_[_0x85cd('0xd3')](_0x59904d)&&_0x59904d[_0x85cd('0xcf')]==='1'&&_0x59904d['paused']==='0'&&this[_0x85cd('0x22')][_0x59904d[_0x85cd('0x11f')]][_0x85cd('0x12d')]){this[_0x85cd('0x22')][_0x59904d[_0x85cd('0x11f')]][_0x85cd('0x12d')]=![];this[_0x85cd('0x28')][_0x53eb05[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xae')]]=[];this['preview'][_0x85cd('0x127')](_0x59904d[_0x85cd('0x128')],_0x59904d['stateinterface'])['catch'](function(_0x824627){logger['error'](_0x85cd('0x129'),util[_0x85cd('0x95')](_0x824627,{'showHidden':![],'depth':null}));})[_0x85cd('0x1e')](function(){_0x53eb05[_0x85cd('0xad')](_0x53eb05['voiceQueues'][_0x53eb05['actions'][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xae')]]);setTimeout(function(){_0x53eb05['agents'][_0x59904d[_0x85cd('0x11f')]][_0x85cd('0x12d')]=!![];loggerBooked[_0x85cd('0x7b')]('[booked][RR][finaly]',_0x592658[_0x85cd('0x11e')],_0x85cd('0x12f'),JSON[_0x85cd('0x125')](_[_0x85cd('0xc5')](_0x53eb05['agents'][_0x59904d[_0x85cd('0x11f')]],[_0x85cd('0x3e'),'unlockRR'])),'contactAgent-idHopper:\x20',JSON[_0x85cd('0x125')](_0x59904d[_0x85cd('0x128')]));},0xc7);delete _0x53eb05[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]];unlockQueueStatus(_0x502ed0,_0x592658[_0x85cd('0x11e')]);});}else{loggerBooked[_0x85cd('0x7b')]('[booked][unlock]');this[_0x85cd('0xad')](this['voiceQueues'][this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xae')]]);this[_0x85cd('0xb5')]({'active':![],'ContactId':this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]]['ContactId'],'ListId':this['actions'][_0x592658['actionid']][_0x85cd('0xc7')],'VoiceQueueId':this[_0x85cd('0xa6')][_0x592658['actionid']][_0x85cd('0xc8')]||undefined,'CampaignId':this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]]['CampaignId']||undefined})[_0x85cd('0xac')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]];unlockQueueStatus(_0x502ed0);}}else{loggerBooked['info'](_0x85cd('0x130'));this['updateOriginated'](this['voiceQueues'][this[_0x85cd('0xa6')][_0x592658['actionid']][_0x85cd('0xae')]]);this[_0x85cd('0xb5')]({'active':![],'ContactId':this[_0x85cd('0xa6')][_0x592658['actionid']]['ContactId'],'ListId':this[_0x85cd('0xa6')][_0x592658['actionid']][_0x85cd('0xc7')],'VoiceQueueId':this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xc9')]||undefined})[_0x85cd('0xac')](loggerCatch(_0x85cd('0x131')));delete this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]];unlockQueueStatus(_0x502ed0);}}else{loggerBooked[_0x85cd('0x7b')](_0x85cd('0x132'));this[_0x85cd('0xad')](this[_0x85cd('0x20')][this[_0x85cd('0xa6')][_0x592658['actionid']]['queue']]);this[_0x85cd('0xb5')]({'active':![],'ContactId':this['actions'][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xc6')],'ListId':this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xc7')],'VoiceQueueId':this['actions'][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xc8')]||undefined,'CampaignId':this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xc9')]||undefined})[_0x85cd('0xac')](loggerCatch(_0x85cd('0x133')));delete this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]];unlockQueueStatus(_0x502ed0);}};Dialer[_0x85cd('0x1c')][_0x85cd('0x39')]=function(){var _0x5e3eb3=this;setInterval(function(){_0x5e3eb3['syncCampaigns']();},0x3e8);};Dialer['prototype']['checkIsTrunkReachable']=function(_0xf4fdee){var _0x58e0ab=this;return function(){if(!_0x58e0ab[_0x85cd('0xcd')](_0xf4fdee[_0x85cd('0x76')])){if(!_0x58e0ab['isTrunkReachable'](_0xf4fdee[_0x85cd('0x134')])){_0xf4fdee['message']=_0x85cd('0x135');throw _0xf4fdee[_0x85cd('0x3e')]+_0x85cd('0x136');}}};};Dialer[_0x85cd('0x1c')][_0x85cd('0x137')]=function(_0x5b743d,_0xbddc53,_0x353113,_0x42652d){var _0xe3d5c2=this;return function(){var _0x24549c=!![];return _0xe3d5c2['ifTime'](_0x5b743d,_0xbddc53,_0x353113,_0x42652d,_0x24549c);};};Dialer[_0x85cd('0x1c')][_0x85cd('0x138')]=function(_0x458b71,_0x39e3fd,_0x58b9dd,_0x44ff7a){var _0x1a76d2=this;return function(){var _0xf19e80=![];return _0x1a76d2[_0x85cd('0x139')](_0x458b71['Intervals'],_0x39e3fd,_0x58b9dd,_0x44ff7a,_0xf19e80);};};Dialer[_0x85cd('0x1c')]['ifTime']=function(_0x2cb224,_0x2136da,_0x31ce48,_0x1e3506,_0x4a414f){var _0x5b6896=[];return new BPromise(function(_0x3bd86f,_0x344604){if(!isNotNull(_0x2cb224)){_0x1e3506[_0x85cd('0x3b')]=_0x85cd('0x41');return _0x344604(msgResponse(_0x85cd('0x139'),_0x85cd('0x13a'),_0x31ce48+_0x85cd('0x13b')));}if(_[_0x85cd('0x43')](_0x2cb224)){_0x1e3506[_0x85cd('0x3b')]=_0x85cd('0x13c');return _0x344604(msgResponse(_0x85cd('0x139'),_0x85cd('0x13a'),_0x31ce48+_0x85cd('0x13d')));}if(_0x2136da&&_['isUndefined'](config['timezones'][_0x2136da])){_0x1e3506[_0x85cd('0x3b')]=_0x85cd('0x13e');return _0x344604(msgResponse('ifTime',_0x85cd('0x13a'),_0x31ce48+_0x85cd('0x13f')+_0x2136da));}if(_[_0x85cd('0x140')](_0x2cb224)){for(var _0x1e63eb=0x0;_0x1e63eb<_0x2cb224[_0x85cd('0x96')];_0x1e63eb+=0x1){_0x5b6896[_0x85cd('0x121')](ami[_0x85cd('0xaa')]({'action':_0x85cd('0x141'),'command':util[_0x85cd('0x79')]('iftime\x20%s,%s',_0x2cb224[_0x1e63eb][_0x85cd('0x142')],!_[_0x85cd('0x8a')](config[_0x85cd('0x143')][_0x2136da])?_0x2136da:'')})[_0x85cd('0xb2')](function(_0x376f53){return _0x376f53[_0x85cd('0x144')][_0x85cd('0x145')](_0x85cd('0x146'))>=0x0;})[_0x85cd('0xac')](myreject(_0x344604)));}}else{_0x5b6896['push'](ami[_0x85cd('0xaa')]({'action':_0x85cd('0x141'),'command':util[_0x85cd('0x79')]('iftime\x20%s,%s',_0x2cb224,!_['isUndefined'](config['timezones'][_0x2136da])?_0x2136da:'')})[_0x85cd('0xb2')](function(_0x3bb62e){return _0x3bb62e[_0x85cd('0x144')][_0x85cd('0x145')](_0x85cd('0x146'))>=0x0;})[_0x85cd('0xac')](myreject(_0x344604)));}BPromise[_0x85cd('0x147')](_0x5b6896)[_0x85cd('0xb2')](function(_0x478fe1){var _0x1b2e90=_[_0x85cd('0x148')](_0x478fe1);if(_0x1b2e90){return _0x3bd86f(_0x1b2e90);}else{_0x1e3506[_0x85cd('0x3b')]=_0x4a414f?_0x85cd('0x149'):_0x85cd('0x14a');return _0x344604(msgResponse('[ifTime][promiseAll]',_0x85cd('0x13a'),_0x85cd('0x14b')+_0x4a414f+'\x20'+_0x31ce48+_0x85cd('0x14c')+util[_0x85cd('0x95')](_0x2cb224,{'showHidden':![],'depth':null})+_0x85cd('0x14d')+_0x2136da));}})[_0x85cd('0xac')](function(_0x2b946d){return _0x344604(msgResponse(_0x85cd('0x139'),_0x85cd('0x13a'),JSON[_0x85cd('0x125')](_0x2b946d)));});});};Dialer[_0x85cd('0x1c')][_0x85cd('0x14e')]=function(_0x2349c7){var _0x2d22ba=this;return function(){switch(_0x2349c7[_0x85cd('0x14f')]){case _0x85cd('0x150'):freeVariablesPredictive(_0x2349c7);_0x2d22ba[_0x85cd('0x151')](_0x2349c7,0x1);break;case _0x85cd('0x152'):freeVariablesPredictive(_0x2349c7);_0x2d22ba['handlePower'](_0x2349c7,_0x2349c7[_0x85cd('0x153')]);break;case _0x85cd('0x154'):_0x2d22ba[_0x85cd('0x154')](_0x2349c7);break;case _0x85cd('0x8'):freeVariablesPredictive(_0x2349c7);_0x2d22ba[_0x85cd('0x151')](_0x2349c7,0x1);break;default:freeVariablesPredictive(_0x2349c7);logger[_0x85cd('0x93')]('Queue',_0x2349c7['name'],_0x85cd('0x155'));}};};Dialer[_0x85cd('0x1c')][_0x85cd('0x156')]=function(_0x1c5eb0){var _0x56167f=this;return function(){_0x56167f['handleIvr'](_0x1c5eb0);};};Dialer[_0x85cd('0x1c')][_0x85cd('0xa')]=function(_0x22800f){var _0x58ce36=this;if(isNotPreview(_0x22800f[_0x85cd('0x14f')])){if(isVoiceQueueOutbound(_0x22800f[_0x85cd('0x49')])&&isActive(_0x22800f[_0x85cd('0x58')])){_0x22800f[_0x85cd('0x9d')]=!![];BPromise[_0x85cd('0xb1')]()['then'](checkIsLoggedIn(_0x22800f,_0x22800f[_0x85cd('0x4e')]))[_0x85cd('0xb2')](checkIsActive(_0x22800f,_0x22800f[_0x85cd('0x58')]))[_0x85cd('0xb2')](checkInterval(_0x22800f))[_0x85cd('0xb2')](_0x58ce36[_0x85cd('0x157')](_0x22800f))[_0x85cd('0xb2')](_0x58ce36['checkIfTime'](_0x22800f[_0x85cd('0x158')],_0x22800f[_0x85cd('0x159')],_0x22800f['name'],_0x22800f))['then'](_0x58ce36['checkIfTimeIntervals'](_0x22800f[_0x85cd('0x40')],_0x22800f[_0x85cd('0x159')],_0x22800f[_0x85cd('0x3e')],_0x22800f))[_0x85cd('0xb2')](_0x58ce36[_0x85cd('0x14e')](_0x22800f))['catch'](loggerCatchQueueSummary('[syncQueueSummary]',_0x22800f));}else{notSendMessagesQueue(_0x22800f);}}else{freeVariablesPredictive(_0x22800f);}};Dialer[_0x85cd('0x1c')][_0x85cd('0x15a')]=function(){var _0x4fbd37=this;var _0x57ffa9;for(var _0x5882bf in this[_0x85cd('0x21')]){if(typeof this[_0x85cd('0x21')][_0x5882bf]!==_0x85cd('0x97')){_0x57ffa9=this[_0x85cd('0x21')][_0x5882bf];if(isCampaignIvr(_0x57ffa9['type'])&&isActive(_0x57ffa9[_0x85cd('0x77')])){_0x57ffa9[_0x85cd('0x9d')]=!![];BPromise['resolve']()['then'](checkIsActive(_0x57ffa9,_0x57ffa9[_0x85cd('0x77')]))[_0x85cd('0xb2')](checkInterval(_0x57ffa9))['then'](_0x4fbd37[_0x85cd('0x157')](_0x57ffa9))[_0x85cd('0xb2')](_0x4fbd37[_0x85cd('0x137')](_0x57ffa9['dialGlobalInterval'],_0x57ffa9[_0x85cd('0x159')],_0x57ffa9['name'],_0x57ffa9))[_0x85cd('0xb2')](_0x4fbd37['checkIfTimeIntervals'](_0x57ffa9[_0x85cd('0x40')],_0x57ffa9[_0x85cd('0x159')],_0x57ffa9[_0x85cd('0x3e')],_0x57ffa9))[_0x85cd('0xb2')](_0x4fbd37[_0x85cd('0x156')](_0x57ffa9))[_0x85cd('0xac')](loggerCatchQueueSummary(_0x85cd('0x15b'),_0x57ffa9));}else{notSendMessagesCampaign(_0x57ffa9);}}}};function getCallerIdRandom(_0x22b15d,_0x25f388){var _0x13cc11;var _0xcfb307;var _0x20a3b5;if(_0x25f388<=0x0){_0x25f388=0x1;}_0x13cc11=new RegExp(_0x85cd('0x15c')+_0x25f388+'}$');_0xcfb307=Math[_0x85cd('0x15d')](0xa,_0x25f388-0x1);_0x20a3b5=Math['pow'](0xa,_0x25f388)-0x1;return util[_0x85cd('0x79')]('%s',_[_0x85cd('0x15e')](_0x22b15d,_0x13cc11,_[_0x85cd('0x15f')](_0xcfb307,_0x20a3b5)));}function extractCalleridName(_0x2a017f){var _0x5c5aaf=_0x2a017f[_0x85cd('0x160')](/"(.*?)"/);return _0x5c5aaf?_0x5c5aaf[0x1]:_0x2a017f;}function extractCalleridNumber(_0x4de076){var _0x5b5edc=_0x4de076['match'](/<(.*?)>/);return _0x5b5edc?_0x5b5edc[0x1]:_0x4de076;}Dialer[_0x85cd('0x1c')]['actionOriginate']=function(_0x5d9f7e,_0x3bbf19){var _0x3db4c1=this;var _0xd6a30d=uuid['v4']();this['actions'][_0xd6a30d]=new Action(_0x5d9f7e,_0x3bbf19,_0xd6a30d);return new BPromise(function(_0x4493e7,_0x46fd6b){if(_[_0x85cd('0x8a')](_0x5d9f7e)&&typeof _0x5d9f7e!==_0x85cd('0x161')){return _0x46fd6b(msgResponse(_0x85cd('0x162'),_0x85cd('0x13a'),'voiceQueue\x20is\x20undefine'));}if(_['isUndefined'](_0x3bbf19[_0x85cd('0x163')][_0x85cd('0x164')])||_0x3bbf19[_0x85cd('0x163')][_0x85cd('0x164')]===null){return _0x46fd6b(msgResponse('originate',_0x85cd('0x13a'),_0x85cd('0x165')));}var _0x7dfa97={'XMD-CALLERID':_0x3db4c1[_0x85cd('0xa6')][_0xd6a30d][_0x85cd('0x166')](),'XMD-AGI':_0x5d9f7e[_0x85cd('0xfd')]?util[_0x85cd('0x79')](_0x85cd('0x167'),ipAgi,_0x5d9f7e[_0x85cd('0xfd')]):_0x85cd('0x168'),'XMD-AGIAFTER':_0x5d9f7e[_0x85cd('0x104')]?util[_0x85cd('0x79')](_0x85cd('0x167'),ipAgi,_0x5d9f7e[_0x85cd('0x104')]):_0x85cd('0x168'),'XMD-QUEUE':_0x5d9f7e[_0x85cd('0x49')]==='outbound'?util['format']('\x22%s,%s%s,,,%s\x22',_0x5d9f7e[_0x85cd('0x3e')],_0x5d9f7e[_0x85cd('0x169')]||'',_0x5d9f7e[_0x85cd('0x105')]?'c':'',_0x5d9f7e[_0x85cd('0x10c')]||0x3):_0x85cd('0x168'),'XMD-CONTACTID':_0x3bbf19['ContactId'],'XMD-CDRTYPE':_0x85cd('0x7'),'CALLERID(all)':_0x3db4c1[_0x85cd('0xa6')][_0xd6a30d][_0x85cd('0x166')](),'XMD-AMD':_0x5d9f7e[_0x85cd('0xd8')]?_0x85cd('0x16a'):_0x85cd('0x168'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x5d9f7e[_0x85cd('0xd8')]){_0x7dfa97[_0x85cd('0x16b')]=_0x5d9f7e[_0x85cd('0x16c')]||0x9c4;_0x7dfa97[_0x85cd('0x16d')]=_0x5d9f7e[_0x85cd('0x16e')]||0x5dc;_0x7dfa97[_0x85cd('0x16f')]=_0x5d9f7e[_0x85cd('0x170')]||0x320;_0x7dfa97[_0x85cd('0x171')]=_0x5d9f7e[_0x85cd('0x172')]||0x1388;_0x7dfa97['XMD-AMDMINWORDLENGTH']=_0x5d9f7e[_0x85cd('0x173')]||0x64;_0x7dfa97[_0x85cd('0x174')]=_0x5d9f7e['dialAMDBetweenWordsSilence']||0x32;_0x7dfa97['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x5d9f7e['dialAMDMaximumNumberOfWords']||0x3;_0x7dfa97[_0x85cd('0x175')]=_0x5d9f7e[_0x85cd('0x176')]||0x100;_0x7dfa97[_0x85cd('0x177')]=_0x5d9f7e['dialAMDMaximumWordLength']||0x1388;}if(_0x5d9f7e[_0x85cd('0x49')]==='outbound'){_0x7dfa97[_0x85cd('0x178')]=_0x3bbf19['VoiceQueueId'];}else{_0x7dfa97[_0x85cd('0x179')]=_0x3bbf19['CampaignId'];}for(var _0x476914 in _0x3bbf19[_0x85cd('0x163')]){if(typeof _0x3bbf19['Contact'][_0x476914]!==_0x85cd('0x97')){if(isNotNull(_0x3bbf19[_0x85cd('0x163')][_0x476914])&&_0x476914!=='id'&&_0x476914!==_0x85cd('0x17a')&&_0x476914!=='createdAt'&&_0x476914!=='updatedAt'){_0x7dfa97[util[_0x85cd('0x79')](_0x85cd('0x17b'),'XMD-',_[_0x85cd('0x17c')](_0x476914))]=_0x3bbf19[_0x85cd('0x163')][_0x476914];}}}var _0x2515de=_0x3db4c1[_0x85cd('0xcd')](_0x5d9f7e[_0x85cd('0x76')])?getCallerId(_0x5d9f7e['Trunk']['callerid'],_0x5d9f7e[_0x85cd('0x59')],_0x5d9f7e['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x5d9f7e[_0x85cd('0x5a')],_0x5d9f7e[_0x85cd('0x17d')]):_0x5d9f7e[_0x85cd('0x5a')]):getCallerId(_[_0x85cd('0xd3')](_0x5d9f7e['TrunkBackup'])?_0x5d9f7e[_0x85cd('0x76')][_0x85cd('0x17e')]:_0x5d9f7e['TrunkBackup'][_0x85cd('0x17e')],_0x5d9f7e[_0x85cd('0x59')],_0x5d9f7e[_0x85cd('0x17d')]>0x0?getCallerIdRandom(_0x5d9f7e['dialOriginateCallerIdNumber'],_0x5d9f7e[_0x85cd('0x17d')]):_0x5d9f7e[_0x85cd('0x5a')]);if(_0x2515de){_0x7dfa97['XMD-ORIGINATECALLERIDNAME']=_0x3db4c1[_0x85cd('0xa6')][_0xd6a30d]['originatecalleridname']=extractCalleridName(_0x2515de);_0x7dfa97[_0x85cd('0x17f')]=_0x3db4c1[_0x85cd('0xa6')][_0xd6a30d][_0x85cd('0x180')]=extractCalleridNumber(_0x2515de);}return ami['Action']({'actionid':_0xd6a30d,'action':'originate','channel':_0x3db4c1[_0x85cd('0xcd')](_0x5d9f7e['Trunk'])?util[_0x85cd('0x79')]('SIP/%s/%s%s',_0x5d9f7e[_0x85cd('0x76')][_0x85cd('0x3e')],isNotNull(_0x5d9f7e[_0x85cd('0x181')])?_0x5d9f7e[_0x85cd('0x181')][_0x85cd('0x182')]()||'':'',_0x5d9f7e[_0x85cd('0x183')]>0x0?_0x3bbf19[_0x85cd('0x163')][_0x85cd('0x164')][_0x85cd('0x184')](_0x5d9f7e[_0x85cd('0x183')]):_0x3bbf19[_0x85cd('0x163')][_0x85cd('0x164')]):util[_0x85cd('0x79')]('SIP/%s/%s%s',_['isNil'](_0x5d9f7e['TrunkBackup'])?_0x5d9f7e[_0x85cd('0x76')][_0x85cd('0x3e')]:_0x5d9f7e[_0x85cd('0x134')]['name'],isNotNull(_0x5d9f7e[_0x85cd('0x181')])?_0x5d9f7e['dialPrefix'][_0x85cd('0x182')]()||'':'',_0x5d9f7e['dialCutDigit']>0x0?_0x3bbf19['Contact'][_0x85cd('0x164')]['substring'](_0x5d9f7e[_0x85cd('0x183')]):_0x3bbf19[_0x85cd('0x163')]['phone']),'callerid':_0x2515de,'Exten':'xcally-motion-dialer','Context':'from-sip','Priority':'1','variable':_0x7dfa97,'timeout':(_0x5d9f7e[_0x85cd('0x5b')]||0x1e)*0x3e8,'async':!![],'channelid':_0xd6a30d})[_0x85cd('0xb2')](function(_0x1f1fe2){return _0x4493e7(_0x1f1fe2);})[_0x85cd('0xac')](function(_0x92929c){_0x5d9f7e[_0x85cd('0x64')]+=0x1;var _0x1dbab4=new History(_0x3db4c1[_0x85cd('0xa6')][_0xd6a30d]);logger[_0x85cd('0x93')](util[_0x85cd('0x79')]('[originateError]:\x20%s',JSON[_0x85cd('0x125')](_0x92929c)));_0x1dbab4[_0x85cd('0xa3')]=0xe;_0x1dbab4['statedesc']=_0x85cd('0x185');_0x1dbab4['starttime']=moment()[_0x85cd('0x79')](_0x85cd('0xf6'));_0x1dbab4['endtime']=_0x1dbab4['starttime'];_0x3db4c1[_0x85cd('0xc0')](_0x1dbab4)[_0x85cd('0xac')](loggerCatch(_0x85cd('0x186')));_0x3db4c1[_0x85cd('0xbe')](_0x1dbab4)['catch'](loggerCatch('[originate][error]'))[_0x85cd('0x1e')](function(){delete _0x3db4c1[_0x85cd('0xa6')][_0xd6a30d];return _0x46fd6b(msgResponse('originate','Error',_0x85cd('0x187')));});});});};Dialer[_0x85cd('0x1c')]['syncOriginateResponse']=function(_0x3ef56a){var _0x387ca9=this['actions'][_0x3ef56a['actionid']];if(_0x387ca9){delete this[_0x85cd('0xa6')][_0x3ef56a[_0x85cd('0x11e')]];_0x387ca9[_0x85cd('0x10b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x2e7a3c=_0x387ca9[_0x85cd('0x49')]===_0x85cd('0x8f')?this['campaigns'][_0x387ca9[_0x85cd('0xae')]]:this[_0x85cd('0x20')][_0x387ca9[_0x85cd('0x188')]()];if(!this['isSuccess'](_0x3ef56a[_0x85cd('0x189')])){this[_0x85cd('0xad')](_0x2e7a3c);return this[_0x85cd('0x18a')](_0x387ca9,_0x2e7a3c,_0x3ef56a)[_0x85cd('0xac')](loggerCatch(_0x85cd('0x18b')));}this['uniqueId'][_0x3ef56a[_0x85cd('0xd2')]]=_0x387ca9;}};Dialer[_0x85cd('0x1c')][_0x85cd('0x18c')]=function(_0x4ba3ba,_0x5a8e5e,_0x26f17f){var _0x281409=new History(_0x5a8e5e);if(_0x281409['countbusyretry']+_0x281409[_0x85cd('0xe7')]+_0x281409[_0x85cd('0xe8')]+_0x281409['countnosuchnumberretry']+_0x281409['countdropretry']+_0x281409[_0x85cd('0xeb')]+_0x281409['countmachineretry']+_0x281409[_0x85cd('0xec')]>=_0x26f17f[_0x85cd('0xed')]-0x1){return!![];}switch(_0x4ba3ba){case 0x3:if(_0x281409[_0x85cd('0xe8')]>=_0x26f17f[_0x85cd('0x18d')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x281409[_0x85cd('0xe8')]+=0x1,'scheduledat':moment()[_0x85cd('0xf3')](_0x26f17f[_0x85cd('0x18e')],_0x85cd('0xf5'))[_0x85cd('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x281409[_0x85cd('0xc6')],'ListId':_0x281409[_0x85cd('0xc7')],'VoiceQueueId':_0x281409[_0x85cd('0xc8')]||undefined,'CampaignId':_0x281409['CampaignId']||undefined})[_0x85cd('0xac')](loggerCatch(_0x85cd('0x18f')));break;case 0x5:if(_0x281409[_0x85cd('0x190')]>=_0x26f17f[_0x85cd('0x191')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x281409[_0x85cd('0x190')]+=0x1,'scheduledat':moment()[_0x85cd('0xf3')](_0x26f17f[_0x85cd('0x192')],_0x85cd('0xf5'))[_0x85cd('0x79')](_0x85cd('0xf6')),'ContactId':_0x281409['ContactId'],'ListId':_0x281409[_0x85cd('0xc7')],'VoiceQueueId':_0x281409['VoiceQueueId']||undefined,'CampaignId':_0x281409[_0x85cd('0xc9')]||undefined})[_0x85cd('0xac')](loggerCatch(_0x85cd('0x193')));break;case 0x8:if(_0x281409['countcongestionretry']>=_0x26f17f[_0x85cd('0x194')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x281409[_0x85cd('0xe7')]+=0x1,'scheduledat':moment()[_0x85cd('0xf3')](_0x26f17f[_0x85cd('0x195')],'minutes')['format'](_0x85cd('0xf6')),'ContactId':_0x281409[_0x85cd('0xc6')],'ListId':_0x281409[_0x85cd('0xc7')],'VoiceQueueId':_0x281409[_0x85cd('0xc8')]||undefined,'CampaignId':_0x281409[_0x85cd('0xc9')]||undefined})['catch'](loggerCatch(_0x85cd('0x196')));break;case 0x0:if(_0x281409[_0x85cd('0xe9')]>=_0x26f17f[_0x85cd('0x197')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x281409[_0x85cd('0xe9')]+=0x1,'scheduledat':moment()[_0x85cd('0xf3')](_0x26f17f[_0x85cd('0x198')],_0x85cd('0xf5'))[_0x85cd('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x281409[_0x85cd('0xc6')],'ListId':_0x281409[_0x85cd('0xc7')],'VoiceQueueId':_0x281409[_0x85cd('0xc8')]||undefined,'CampaignId':_0x281409[_0x85cd('0xc9')]||undefined})[_0x85cd('0xac')](loggerCatch(_0x85cd('0x199')));}break;case 0xa:if(_0x281409[_0x85cd('0xea')]>=_0x26f17f[_0x85cd('0x110')]-0x1){return!![];}this[_0x85cd('0xb5')]({'active':![],'countdropretry':_0x281409['countdropretry']+=0x1,'scheduledat':moment()[_0x85cd('0xf3')](_0x26f17f['dialDropRetryFrequency'],_0x85cd('0xf5'))[_0x85cd('0x79')](_0x85cd('0xf6')),'ContactId':_0x281409['ContactId'],'ListId':_0x281409[_0x85cd('0xc7')],'VoiceQueueId':_0x281409[_0x85cd('0xc8')]||undefined,'CampaignId':_0x281409[_0x85cd('0xc9')]||undefined})[_0x85cd('0xac')](loggerCatch(_0x85cd('0x112')));break;case 0xb:if(_0x281409[_0x85cd('0xeb')]>=_0x26f17f[_0x85cd('0x19a')]-0x1){return!![];}this[_0x85cd('0xb5')]({'active':![],'countabandonedretry':_0x281409['countabandonedretry']+=0x1,'scheduledat':moment()[_0x85cd('0xf3')](_0x26f17f[_0x85cd('0x118')],_0x85cd('0xf5'))[_0x85cd('0x79')](_0x85cd('0xf6')),'ContactId':_0x281409[_0x85cd('0xc6')],'ListId':_0x281409[_0x85cd('0xc7')],'VoiceQueueId':_0x281409[_0x85cd('0xc8')]||undefined,'CampaignId':_0x281409[_0x85cd('0xc9')]||undefined})[_0x85cd('0xac')](loggerCatch(_0x85cd('0x119')));break;case 0x13:if(_0x281409['countmachineretry']>=_0x26f17f[_0x85cd('0xf0')]-0x1){return!![];}this[_0x85cd('0xb5')]({'active':![],'countmachineretry':_0x281409[_0x85cd('0xe4')]+=0x1,'scheduledat':moment()['add'](_0x26f17f[_0x85cd('0xf4')],_0x85cd('0xf5'))[_0x85cd('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x281409[_0x85cd('0xc6')],'ListId':_0x281409[_0x85cd('0xc7')],'VoiceQueueId':_0x281409['VoiceQueueId']||undefined,'CampaignId':_0x281409['CampaignId']||undefined})['catch'](loggerCatch(_0x85cd('0xf7')));break;case 0x14:if(_0x281409[_0x85cd('0xec')]>=_0x26f17f[_0x85cd('0x19b')]-0x1){return!![];}this[_0x85cd('0xb5')]({'active':![],'countagentrejectretry':_0x281409[_0x85cd('0xec')]+=0x1,'scheduledat':moment()[_0x85cd('0xf3')](_0x26f17f[_0x85cd('0x19c')],_0x85cd('0xf5'))[_0x85cd('0x79')](_0x85cd('0xf6')),'ContactId':_0x281409[_0x85cd('0xc6')],'ListId':_0x281409[_0x85cd('0xc7')],'VoiceQueueId':_0x281409['VoiceQueueId']||undefined,'CampaignId':_0x281409[_0x85cd('0xc9')]||undefined})[_0x85cd('0xac')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer['prototype'][_0x85cd('0x18a')]=function(_0xd021c3,_0x338156,_0x502da4){var _0x5bdf62=this;var _0x35bd27=new History(_0xd021c3);return new BPromise(function(_0x50e4f2,_0x3834b5){if(_[_0x85cd('0x8a')](_0x338156)&&typeof _0x338156!==_0x85cd('0x161')){return _0x3834b5(msgResponse(_0x85cd('0x19d'),_0x85cd('0x13a'),_0x85cd('0x19e')));}if(_[_0x85cd('0x8a')](_0x502da4)&&typeof _0x502da4!=='object'){return _0x3834b5(msgResponse(_0x85cd('0x19d'),_0x85cd('0x13a'),_0x85cd('0x19f')));}switch(_0x502da4[_0x85cd('0x102')]){case'0':_0x338156[_0x85cd('0x63')]+=0x1;_0x35bd27['state']=0x0;_0x35bd27[_0x85cd('0xa4')]=_0x85cd('0x1a0');_0x35bd27[_0x85cd('0xe9')]+=0x1;_0x35bd27[_0x85cd('0xe5')]+=0x1;ami['emit'](_0x85cd('0x1a1'),ut[_0x85cd('0xde')](_0xd021c3,_0x85cd('0x1a2')));_0x5bdf62[_0x85cd('0xc0')](_0x35bd27)[_0x85cd('0xac')](loggerCatch(_0x85cd('0xe6')));if(_0x5bdf62[_0x85cd('0x18c')](0x0,_0xd021c3,_0x338156)){if(_0x35bd27[_0x85cd('0xe9')]>=_0x338156[_0x85cd('0x197')]){_0x5bdf62[_0x85cd('0xf1')](_0x35bd27,_0x50e4f2,_0x3834b5,'reason\x200\x20no\x20such\x20number....');}else{_0x5bdf62[_0x85cd('0xee')](_0x35bd27,_0x50e4f2,_0x3834b5,_0x85cd('0x1a3'));}}break;case'3':_0x338156[_0x85cd('0x62')]+=0x1;_0x35bd27['state']=0x3;_0x35bd27[_0x85cd('0xa4')]='NoAnswer';_0x35bd27[_0x85cd('0xe8')]+=0x1;_0x35bd27[_0x85cd('0xe5')]+=0x1;ami[_0x85cd('0x48')](_0x85cd('0x1a4'),ut[_0x85cd('0xde')](_0xd021c3,_0x85cd('0x1a5')));_0x5bdf62[_0x85cd('0xc0')](_0x35bd27)['catch'](loggerCatch(_0x85cd('0x1a6')));if(_0x5bdf62['checkRetriveMax'](0x3,_0xd021c3,_0x338156)){if(_0x35bd27[_0x85cd('0xe8')]>=_0x338156['dialNoAnswerMaxRetry']){_0x5bdf62[_0x85cd('0xf1')](_0x35bd27,_0x50e4f2,_0x3834b5,_0x85cd('0x1a7'));}else{_0x5bdf62[_0x85cd('0xee')](_0x35bd27,_0x50e4f2,_0x3834b5,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x338156[_0x85cd('0x5f')]+=0x1;_0x35bd27['state']=0x5;_0x35bd27[_0x85cd('0xa4')]='Busy';_0x35bd27['countbusyretry']+=0x1;_0x35bd27[_0x85cd('0xe5')]+=0x1;ami['emit']('custom:agentbusy',ut[_0x85cd('0xde')](_0xd021c3,_0x85cd('0x1a8')));_0x5bdf62['createHistory'](_0x35bd27)[_0x85cd('0xac')](loggerCatch(_0x85cd('0x1a9')));if(_0x5bdf62[_0x85cd('0x18c')](0x5,_0xd021c3,_0x338156)){if(_0x35bd27[_0x85cd('0x190')]>=_0x338156[_0x85cd('0x191')]){_0x5bdf62[_0x85cd('0xf1')](_0x35bd27,_0x50e4f2,_0x3834b5,_0x85cd('0x1aa'));}else{_0x5bdf62[_0x85cd('0xee')](_0x35bd27,_0x50e4f2,_0x3834b5,_0x85cd('0x1aa'));}}break;case'8':_0x338156[_0x85cd('0x60')]+=0x1;_0x35bd27[_0x85cd('0xa3')]=0x8;_0x35bd27[_0x85cd('0xa4')]=_0x85cd('0x1ab');_0x35bd27[_0x85cd('0xe7')]+=0x1;_0x35bd27['countglobal']+=0x1;ami['emit'](_0x85cd('0x1ac'),ut[_0x85cd('0xde')](_0xd021c3,_0x85cd('0x1ad')));_0x5bdf62[_0x85cd('0xc0')](_0x35bd27)[_0x85cd('0xac')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x5bdf62[_0x85cd('0x18c')](0x8,_0xd021c3,_0x338156)){if(_0x35bd27[_0x85cd('0xe7')]>=_0x338156[_0x85cd('0x194')]){_0x5bdf62[_0x85cd('0xf1')](_0x35bd27,_0x50e4f2,_0x3834b5,'reason\x208\x20congestion');}else{_0x5bdf62[_0x85cd('0xee')](_0x35bd27,_0x50e4f2,_0x3834b5,_0x85cd('0x1ae'));}}break;case'11':_0x338156['outboundAbandonedCallsDay']+=0x1;_0x35bd27['state']=0xb;_0x35bd27[_0x85cd('0xa4')]=_0x85cd('0x11a');_0x35bd27[_0x85cd('0xeb')]+=0x1;_0x35bd27['countglobal']+=0x1;_0x5bdf62[_0x85cd('0xc0')](_0x35bd27)[_0x85cd('0xac')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x5bdf62['checkRetriveMax'](0xb,_0xd021c3,_0x338156)){if(_0x35bd27[_0x85cd('0xeb')]>=_0x338156[_0x85cd('0x19a')]){_0x5bdf62[_0x85cd('0xf1')](_0x35bd27,_0x50e4f2,_0x3834b5,_0x85cd('0x1af'));}else{_0x5bdf62[_0x85cd('0xee')](_0x35bd27,_0x50e4f2,_0x3834b5,'reason\x2011\x20abandoned');}}break;case'20':_0x338156[_0x85cd('0x65')]+=0x1;_0x35bd27[_0x85cd('0xa3')]=0x14;_0x35bd27[_0x85cd('0xa4')]=_0x85cd('0x1b0');_0x35bd27[_0x85cd('0xec')]+=0x1;_0x35bd27[_0x85cd('0xe5')]+=0x1;ami[_0x85cd('0x48')](_0x85cd('0x1b1'),ut[_0x85cd('0xde')](_0xd021c3,_0x85cd('0x1b2')));_0x5bdf62[_0x85cd('0xc0')](_0x35bd27)['catch'](loggerCatch(_0x85cd('0x1b3')));if(_0x5bdf62[_0x85cd('0x18c')](0x14,_0xd021c3,_0x338156)){if(_0x35bd27['countagentrejectretry']>=_0x338156[_0x85cd('0x19b')]){_0x5bdf62[_0x85cd('0xf1')](_0x35bd27,_0x50e4f2,_0x3834b5,_0x85cd('0x1b4'));}else{_0x5bdf62[_0x85cd('0xee')](_0x35bd27,_0x50e4f2,_0x3834b5,_0x85cd('0x1b4'));}}break;default:_0x338156[_0x85cd('0x66')]+=0x1;_0x35bd27[_0x85cd('0xa3')]=0xc;_0x35bd27[_0x85cd('0xa4')]=_0x502da4[_0x85cd('0x102')];_0x5bdf62[_0x85cd('0xc0')](_0x35bd27)['catch'](loggerCatch(_0x85cd('0x1b5')));if(_0x5bdf62['checkRetriveMax'](_0x502da4['reason'],_0xd021c3,_0x338156)){if(_0x35bd27[_0x85cd('0x190')]+_0x35bd27[_0x85cd('0xe7')]+_0x35bd27[_0x85cd('0xe8')]+_0x35bd27['countnosuchnumberretry']+_0x35bd27[_0x85cd('0xea')]+_0x35bd27[_0x85cd('0xeb')]+_0x35bd27[_0x85cd('0xe4')]+_0x35bd27[_0x85cd('0xec')]>=_0x338156[_0x85cd('0xed')]){_0x5bdf62[_0x85cd('0xee')](_0x35bd27,_0x50e4f2,_0x3834b5,_0x502da4['reason']);}else{_0x5bdf62[_0x85cd('0xf1')](_0x35bd27,_0x50e4f2,_0x3834b5,_0x502da4[_0x85cd('0x102')]);}}}});};Dialer[_0x85cd('0x1c')]['stateGlobal']=function(_0x2b7ee5,_0x425249,_0x13241c,_0x30329d){var _0x3f6280=new Final(_0x2b7ee5);_0x3f6280[_0x85cd('0xa3')]=0xf;_0x3f6280[_0x85cd('0xa4')]=_0x85cd('0x1b6');this[_0x85cd('0xf1')](_0x3f6280,_0x425249,_0x13241c,_0x30329d);};Dialer['prototype'][_0x85cd('0xf1')]=function(_0x5a94c5,_0x129d1b,_0x21589c,_0x434e29){this[_0x85cd('0xbe')](_0x5a94c5)['then'](function(){return _0x129d1b(msgResponse(_0x85cd('0x19d'),_0x85cd('0x1b7'),_0x434e29));})[_0x85cd('0xac')](function(){return _0x21589c(msgResponse(_0x85cd('0x1b8'),_0x85cd('0x13a'),_0x85cd('0x1b9')));});};Dialer[_0x85cd('0x1c')][_0x85cd('0x154')]=function(_0x15f97f){var _0x297334=_0x15f97f[_0x85cd('0x1ba')]/0x64;var _0x491c0c=_0x15f97f[_0x85cd('0x1bb')]/(_0x15f97f[_0x85cd('0x1bb')]+_0x15f97f[_0x85cd('0x5d')]);var _0x4ef1fb=Math[_0x85cd('0x1bc')](_0x15f97f[_0x85cd('0x6e')]*(_0x15f97f['predictiveIntervalMaxThreshold']/0x64));var _0x377c86=Math[_0x85cd('0x1bc')](_0x15f97f[_0x85cd('0x6e')]*(_0x15f97f['predictiveIntervalMinThreshold']/0x64));var _0xd0ff61=_0x15f97f['available']+_0x15f97f[_0x85cd('0x53')];var _0x238090=Math[_0x85cd('0x1bd')](_0x15f97f[_0x85cd('0x70')]*_0x15f97f[_0x85cd('0x72')]*_0x15f97f[_0x85cd('0x6b')]*_0x15f97f[_0x85cd('0x6c')]);if(_[_0x85cd('0x8a')](_0x15f97f['startProgressive'])){if(!_[_0x85cd('0x8a')](_0x15f97f[_0x85cd('0x74')])){_0x15f97f[_0x85cd('0x74')]=undefined;loggerPredictive[_0x85cd('0x93')]('[startMethodPredictive][StartProgressive]',_0x85cd('0x1be'));}if(!_['isUndefined'](_0x15f97f[_0x85cd('0x8d')])){loggerPredictive[_0x85cd('0x93')](_0x85cd('0x1bf'),_0x85cd('0x1c0'));clearInterval(_0x15f97f[_0x85cd('0x8d')]);_0x15f97f[_0x85cd('0x8d')]=undefined;}_0x15f97f[_0x85cd('0x75')]=moment()[_0x85cd('0x79')](_0x85cd('0xf6'));loggerPredictive[_0x85cd('0x7b')](_0x15f97f[_0x85cd('0x3e')],_0x85cd('0x1c1'),_0x15f97f[_0x85cd('0x75')]);this[_0x85cd('0x151')](_0x15f97f,0x1);}else if(ifInterval(_0x15f97f['dialPredictiveInterval'],_0x15f97f[_0x85cd('0x75')])){this[_0x85cd('0x151')](_0x15f97f,0x1);loggerPredictiveCalls[_0x85cd('0x7b')](_0x85cd('0x1c2'),_0x15f97f[_0x85cd('0x75')],_0x15f97f[_0x85cd('0x3e')]);_0x15f97f[_0x85cd('0x70')]=0x0;_0x15f97f[_0x85cd('0x6a')]=0x0;}else if(_0x297334<_0x491c0c&&_0x15f97f[_0x85cd('0x1c3')]===_0x85cd('0x1c4')){freeVariablesPredictive(_0x15f97f);loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x1c5'),_0x85cd('0x1c6'),_0x491c0c,_0x85cd('0x75'),_0x15f97f[_0x85cd('0x3e')]);}else if(_0x238090<_0x15f97f['predictiveIntervalErlangCallsDroppedCalls']&&_0x15f97f[_0x85cd('0x1c3')]==='dropRate'){freeVariablesPredictive(_0x15f97f);loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x1c7'),_0x85cd('0x1c8'),_0x238090,_0x85cd('0x1c9'),_0x15f97f[_0x85cd('0x6a')],'startProgressive',_0x15f97f[_0x85cd('0x3e')]);}else if(!ifInterval(_0x15f97f['dialPredictiveInterval'],_0x15f97f[_0x85cd('0x75')])&&_['isUndefined'](_0x15f97f[_0x85cd('0x74')])&&!_[_0x85cd('0x8a')](_0x15f97f[_0x85cd('0x75')])){_0x15f97f[_0x85cd('0x74')]=moment()[_0x85cd('0x79')](_0x85cd('0xf6'));loggerPredictive[_0x85cd('0x7b')](_0x15f97f[_0x85cd('0x3e')],_0x85cd('0x1ca'),_0x15f97f[_0x85cd('0x74')]);this[_0x85cd('0x1cb')](_0x15f97f['dialPredictiveInterval'])[_0x85cd('0xb2')](this[_0x85cd('0x1cc')](_0x15f97f))[_0x85cd('0xb2')](mergeDataErlangB(_0x15f97f))[_0x85cd('0xb2')](this[_0x85cd('0x1cd')](_0x15f97f))[_0x85cd('0xac')](loggerCatchPredictive(_0x85cd('0x1ce'),_0x15f97f));}else if(!ifInterval(_0x15f97f['dialPredictiveInterval'],_0x15f97f[_0x85cd('0x74')])){_0x15f97f[_0x85cd('0x6a')]=0x0;_0x15f97f[_0x85cd('0x74')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x85cd('0x7b')](_0x15f97f[_0x85cd('0x3e')],_0x85cd('0x1cf'),_0x15f97f[_0x85cd('0x74')]);clearInterval(_0x15f97f[_0x85cd('0x8d')]);_0x15f97f[_0x85cd('0x8d')]=undefined;this[_0x85cd('0x1cb')](_0x15f97f[_0x85cd('0x1d0')])[_0x85cd('0xb2')](this[_0x85cd('0x1cc')](_0x15f97f))['then'](mergeDataErlangB(_0x15f97f))[_0x85cd('0xb2')](this[_0x85cd('0x1cd')](_0x15f97f))[_0x85cd('0xac')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x15f97f));}else if(_0x15f97f[_0x85cd('0x6e')]&&_0xd0ff61<_0x15f97f[_0x85cd('0x6e')]-_0x377c86){freeVariablesPredictive(_0x15f97f);loggerPredictive[_0x85cd('0x7b')](_0x15f97f[_0x85cd('0x3e')],_0x85cd('0x1d1'),_0xd0ff61,_0x85cd('0x1d2'),_0x15f97f['predictiveIntervalAvailable'],'-',_0x377c86,'=',_0x15f97f[_0x85cd('0x6e')]-_0x377c86,')');}else if(_0x15f97f[_0x85cd('0x6e')]&&_0xd0ff61>_0x15f97f[_0x85cd('0x6e')]+_0x4ef1fb){freeVariablesPredictive(_0x15f97f);loggerPredictive[_0x85cd('0x7b')](_0x15f97f[_0x85cd('0x3e')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0xd0ff61,')\x20are\x20more\x20than\x20threshold\x20(',_0x15f97f[_0x85cd('0x6e')],'+',_0x4ef1fb,'=',_0x15f97f[_0x85cd('0x6e')]+_0x4ef1fb,')');}};Dialer['prototype']['getDataPredictive']=function(_0x23aa02){var _0x276660=this;return function(_0x235b4f){return new BPromise(function(_0xf7377c,_0x59b70b){_[_0x85cd('0xc4')](_0x23aa02,_0x235b4f[0x0]);if(checkGetDataPredictive(_0x235b4f[0x0])){var _0x23c897=_0x23aa02[_0x85cd('0x6e')]=_0x23aa02[_0x85cd('0x53')]+_0x23aa02['available'];var _0x47d40=_0x23aa02[_0x85cd('0x1d0')]*0x3c;var _0x559348=_0x235b4f[0x0][_0x85cd('0x68')]+_0x235b4f[0x0][_0x85cd('0x81')];var _0x5a99ff=(_0x235b4f[0x0][_0x85cd('0x67')]+_0x235b4f[0x0][_0x85cd('0x1d3')]+_0x235b4f[0x0][_0x85cd('0x115')])/_0x235b4f[0x0]['predictiveIntervalTotalCalls'];_0x23aa02[_0x85cd('0x6b')]=_0x5a99ff>0x0?_0x5a99ff:0x1;switch(_0x23aa02[_0x85cd('0x1c3')]){case _0x85cd('0x1c4'):var _0x2fcb76=_0x23aa02[_0x85cd('0x1ba')]/0x64;return _0x276660['abandonmentRate'](_0x23c897,_0x47d40,_0x559348,_0x5a99ff,_0x2fcb76)[_0x85cd('0xb2')](function(_0x14eb6d){return _0xf7377c(_0x14eb6d);});case _0x85cd('0x1d4'):var _0xdd20bb=_0x23aa02[_0x85cd('0x1ba')]/0x64;return _0x276660[_0x85cd('0x1d5')](_0x23c897,_0x47d40,_0x559348,_0x5a99ff,_0xdd20bb)['then'](function(_0x382164){return _0xf7377c(_0x382164);});default:return _0x59b70b(msgResponse(_0x85cd('0x1d6'),'Failure',_0x85cd('0x1d7')));}}else{return _0x59b70b(msgResponse(_0x85cd('0x1d6'),_0x85cd('0x13a'),'check\x20failure'));}});};};Dialer[_0x85cd('0x1c')][_0x85cd('0x1d8')]=function(_0x1d5b75){var _0x258424=this;return function(_0x57e1c8){return new BPromise(function(_0x28cb0a,_0x6264e4){_[_0x85cd('0xc4')](_0x1d5b75,_0x57e1c8[0x0]);if(checkGetDataPredictive(_0x57e1c8[0x0])){loggerPredictive['info'](JSON['stringify'](_0x57e1c8[0x0]));if(_0x1d5b75[_0x85cd('0x1c3')]===_0x85cd('0x1c4')){return _0x258424[_0x85cd('0xbc')](_0x1d5b75['id'])[_0x85cd('0xb2')](function(_0x1faa16){var _0x22ffa1=_0x1d5b75[_0x85cd('0x4e')]-_0x1faa16[0x0][_0x85cd('0x1d9')];var _0x2de045=_0x1d5b75['dialPredictiveInterval']*0x3c;var _0x2884a2=_0x57e1c8[0x0]['predictiveIntervalAvgTalktime']+_0x57e1c8[0x0]['predictiveIntervalAvgHoldtime'];var _0x3ccb33=(_0x57e1c8[0x0][_0x85cd('0x67')]+_0x57e1c8[0x0][_0x85cd('0x1d3')]+_0x57e1c8[0x0][_0x85cd('0x115')])/_0x57e1c8[0x0]['predictiveIntervalTotalCalls'];var _0x2628e2=_0x1d5b75[_0x85cd('0x1ba')]/0x64;_0x1d5b75[_0x85cd('0x6d')]=_0x1faa16[0x0][_0x85cd('0x1d9')]||0x0;_0x1d5b75[_0x85cd('0x6b')]=_0x3ccb33>0x0?_0x3ccb33:0x1;return _0x258424['abandonmentRate'](_0x22ffa1,_0x2de045,_0x2884a2,_0x3ccb33,_0x2628e2);})[_0x85cd('0xb2')](function(_0x4854a4){return _0x28cb0a(_0x4854a4);})[_0x85cd('0xac')](function(_0xf8f725){return _0x6264e4(msgResponse(_0x85cd('0x1da'),'Failure',JSON[_0x85cd('0x125')](_0xf8f725)));});}if(_0x1d5b75[_0x85cd('0x1c3')]===_0x85cd('0x1d4')){return _0x258424[_0x85cd('0xbc')](_0x1d5b75['id'])['then'](function(_0x176d2a){var _0x2310a1=_0x1d5b75[_0x85cd('0x4e')]-_0x176d2a[0x0][_0x85cd('0x1d9')];var _0x2620e6=_0x1d5b75[_0x85cd('0x1d0')]*0x3c;var _0x5a39a6=_0x57e1c8[0x0]['predictiveIntervalAvgTalktime']+_0x57e1c8[0x0][_0x85cd('0x81')];var _0x3507f3=(_0x57e1c8[0x0][_0x85cd('0x67')]+_0x57e1c8[0x0][_0x85cd('0x1d3')]+_0x57e1c8[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x57e1c8[0x0]['predictiveIntervalTotalCalls'];var _0x152d18=_0x1d5b75[_0x85cd('0x1ba')]/0x64;_0x1d5b75['predictiveIntervalPauses']=_0x176d2a[0x0][_0x85cd('0x1d9')]||0x0;_0x1d5b75[_0x85cd('0x6b')]=_0x3507f3>0x0?_0x3507f3:0x1;return _0x258424[_0x85cd('0x1d5')](_0x2310a1,_0x2620e6,_0x5a39a6,_0x3507f3,_0x152d18);})[_0x85cd('0xb2')](function(_0xacd01){return _0x28cb0a(_0xacd01);})[_0x85cd('0xac')](function(_0x933026){return _0x6264e4(msgResponse('[CatchErlangB]',_0x85cd('0x13a'),JSON[_0x85cd('0x125')](_0x933026)));});}}else{return _0x6264e4(msgResponse(_0x85cd('0x1d6'),_0x85cd('0x13a'),_0x85cd('0x1db')));}});};};Dialer[_0x85cd('0x1c')]['startMethodPredictive']=function(_0xb6fd6e){var _0x35bea8=this;return function(){var _0x26380d=0x0;var _0x5a0347=Math['floor'](_0xb6fd6e[_0x85cd('0x71')]*0x3e8);if(_0x5a0347>0x0){_0x5a0347=_0x5a0347<0x64?0x64:_0x5a0347;loggerPredictive[_0x85cd('0x7b')](_0xb6fd6e[_0x85cd('0x3e')],'one\x20call\x20every:',_0x5a0347,_0x85cd('0x45'));_0xb6fd6e[_0x85cd('0x8d')]=setInterval(function(){_0x35bea8['handlePredictive'](_0xb6fd6e);loggerPredictiveCalls['info'](_0x85cd('0x1dc'),_0x26380d+=0x1);},_0x5a0347);}else{loggerPredictive[_0x85cd('0x7b')](_0xb6fd6e[_0x85cd('0x3e')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x85cd('0x1c')][_0x85cd('0x1dd')]=function(_0x877e26,_0x110ccb){var _0x2c55d8=this;return function(_0x57327b){if(_[_0x85cd('0x43')](_0x57327b)){if(_[_0x85cd('0xd3')](_0x110ccb[_0x85cd('0x1de')])||!_0x110ccb[_0x85cd('0x1df')]){if(_0x877e26[_0x85cd('0x14f')]===_0x85cd('0x8')){_0x877e26[_0x85cd('0x123')]=_['isUndefined'](_0x877e26[_0x85cd('0x123')])?!![]:_0x877e26[_0x85cd('0x123')];var _0x2f8edf=uuid['v4']();_0x2c55d8[_0x85cd('0xa6')][_0x2f8edf]=new Action(_0x877e26,_0x110ccb,_0x2f8edf);loggerBooked['info'](_0x85cd('0x1e0'),_0x2f8edf,'queueStatusComplete:\x20',JSON['stringify'](_0x877e26[_0x85cd('0x123')]),_0x85cd('0x1e1'),_0x877e26[_0x85cd('0x3e')]);if(_0x877e26[_0x85cd('0x123')]){_0x877e26[_0x85cd('0x123')]=![];_0x2c55d8[_0x85cd('0x28')][_0x2c55d8[_0x85cd('0xa6')][_0x2f8edf][_0x85cd('0xae')]]=[];ami[_0x85cd('0xaa')]({'actionid':_0x2f8edf,'action':_0x85cd('0x1e2'),'queue':_0x877e26[_0x85cd('0x3e')]})[_0x85cd('0xac')](function(){_0x2c55d8[_0x85cd('0xad')](_0x877e26);_0x2c55d8[_0x85cd('0xb5')]({'active':![],'ContactId':_0x2c55d8[_0x85cd('0xa6')][_0x2f8edf][_0x85cd('0xc6')],'ListId':_0x2c55d8['actions'][_0x2f8edf][_0x85cd('0xc7')],'VoiceQueueId':_0x2c55d8['actions'][_0x2f8edf]['VoiceQueueId']||undefined,'CampaignId':_0x2c55d8[_0x85cd('0xa6')][_0x2f8edf]['CampaignId']||undefined})[_0x85cd('0xac')](loggerCatch(_0x85cd('0x1e3')));delete _0x2c55d8[_0x85cd('0xa6')][_0x2f8edf];});}else{loggerBooked[_0x85cd('0x7b')]('[booked][checkContactBlack][else]',JSON[_0x85cd('0x125')](_0x877e26[_0x85cd('0x123')]),_0x85cd('0x1e1'),_0x877e26['name']);_0x2c55d8[_0x85cd('0xad')](_0x877e26);_0x2c55d8[_0x85cd('0xb5')]({'active':![],'ContactId':_0x2c55d8[_0x85cd('0xa6')][_0x2f8edf][_0x85cd('0xc6')],'ListId':_0x2c55d8[_0x85cd('0xa6')][_0x2f8edf]['ListId'],'VoiceQueueId':_0x2c55d8[_0x85cd('0xa6')][_0x2f8edf]['VoiceQueueId']||undefined,'CampaignId':_0x2c55d8[_0x85cd('0xa6')][_0x2f8edf][_0x85cd('0xc9')]||undefined})['catch'](loggerCatch(_0x85cd('0x1e3')));delete _0x2c55d8[_0x85cd('0xa6')][_0x2f8edf];}}else{return _0x2c55d8['actionOriginate'](_0x877e26,_0x110ccb);}}else{if(getDiff(_0x110ccb[_0x85cd('0x1e4')])<_0x877e26[_0x85cd('0x1e5')]*0x3c){if(_0x110ccb[_0x85cd('0x1e6')]&&!_0x110ccb[_0x85cd('0x1e6')][_0x85cd('0x1e7')]){_0x2c55d8['preview'][_0x85cd('0x127')](_0x110ccb['id'])[_0x85cd('0x1e')](function(){_0x2c55d8[_0x85cd('0xad')](_0x877e26);});}else{_0x2c55d8[_0x85cd('0xb7')]({'active':![]},_0x110ccb['id'],0x1)[_0x85cd('0x1e')](function(){_0x2c55d8[_0x85cd('0xad')](_0x877e26);});}}else{_0x877e26[_0x85cd('0x1e8')]+=0x1;_0x2c55d8[_0x85cd('0xad')](_0x877e26);if(_0x877e26['dialRecallInQueue']){_0x2c55d8[_0x85cd('0xb5')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x110ccb[_0x85cd('0xc6')],'ListId':_0x110ccb['ListId'],'VoiceQueueId':_0x110ccb['VoiceQueueId']||undefined,'CampaignId':_0x110ccb['CampaignId']||undefined})[_0x85cd('0xac')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x2c55d8[_0x85cd('0xc0')](createObjHistory(_0x877e26,_0x110ccb,_0x85cd('0x1e9'),0x17,_0x85cd('0x1ea')))[_0x85cd('0xac')](loggerCatch(_0x85cd('0x1eb')));}else{_0x2c55d8['saveInDb'](createObjHistory(_0x877e26,_0x110ccb,_0x85cd('0x1ec'),0x16,'RecallFailedTimeout'),_0x85cd('0x1ed'),_0x85cd('0x1ee'));}}}}else{_0x877e26[_0x85cd('0x5e')]+=0x1;_0x2c55d8[_0x85cd('0xc3')](createObjHistory(_0x877e26,_0x110ccb,'BLACKLIST',0xd,_0x85cd('0x1ef')),'[Originate][historyBlacklist]',_0x85cd('0x1f0'));throw _0x85cd('0x1f1');}};};Dialer[_0x85cd('0x1c')][_0x85cd('0x1f2')]=function(_0x395604){var _0x5a740a=this;var _0x481825=_0x395604['limitCalls']-_0x395604['originated']-_0x395604['temp'];emitCampaignSummary(_0x395604);if(_0x481825>0x0){if(_0x481825>this[_0x85cd('0x24')]){_0x481825=this[_0x85cd('0x24')];}_0x395604[_0x85cd('0xba')]+=_0x481825;this[_0x85cd('0xbb')](_0x395604['id'],_0x481825,_0x395604[_0x85cd('0x1f3')],_0x395604)[_0x85cd('0xb2')](function(_0x41b89b){_0x395604[_0x85cd('0xba')]-=_0x481825;_0x395604['temp']=_0x395604[_0x85cd('0xba')]>0x0?_0x395604['temp']:0x0;if(!checkContactEmpty(_0x41b89b)){_0x395604[_0x85cd('0x3b')]=_0x85cd('0x1f4');logger['info'](_0x85cd('0x1f5')+_0x395604[_0x85cd('0x3e')]);}else{_0x395604[_0x85cd('0x6f')]+=_0x41b89b['length'];_0x395604[_0x85cd('0x3b')]=_0x85cd('0x1f6');for(var _0x1ca4a6=0x0;_0x1ca4a6<_0x41b89b['length'];_0x1ca4a6+=0x1){_0x395604[_0x85cd('0x1f7')]+=0x1;if(_[_0x85cd('0xd3')](_0x41b89b[_0x1ca4a6])||_[_0x85cd('0xd3')](_0x41b89b[_0x1ca4a6][_0x85cd('0x163')])||_['isNil'](_0x41b89b[_0x1ca4a6]['Contact']['phone'])){_0x5a740a[_0x85cd('0x1f8')](_0x85cd('0x1f9'),_0x395604,_0x41b89b[_0x1ca4a6]);}else{_0x5a740a[_0x85cd('0xb4')](_[_0x85cd('0xc5')](_0x41b89b[_0x1ca4a6],[_0x85cd('0xc9'),'Contact.phone']))[_0x85cd('0xb2')](_0x5a740a[_0x85cd('0x1dd')](_0x395604,_0x41b89b[_0x1ca4a6]))[_0x85cd('0xac')](_0x5a740a[_0x85cd('0x1fa')](_0x85cd('0x1fb'),_0x395604));}}}})[_0x85cd('0xac')](loggerGetContactDialer(_0x85cd('0x1fc'),_0x395604,_0x481825));}};Dialer[_0x85cd('0x1c')][_0x85cd('0x151')]=function(_0x17032a,_0x28b0a7){var _0x52881c=this;var _0x379eeb=[];var _0xb15120=_0x28b0a7>=0x1?_0x28b0a7:0x1;if(_0x17032a['dialMethod']===_0x85cd('0x8')){_0xb15120=0x1;}var _0x31bd61=Math[_0x85cd('0x1bd')](_0x17032a[_0x85cd('0x4d')]*_0xb15120)-_0x17032a[_0x85cd('0x6f')]-_0x17032a[_0x85cd('0xba')];emitVoiceQueueSummary(_0x17032a);if(_0x17032a['dialLimitQueue']>0x0){var _0xf8b322=_0x17032a[_0x85cd('0x1fd')]-_0x17032a[_0x85cd('0x6f')]-_0x17032a[_0x85cd('0x53')]-_0x17032a['temp']-_0x17032a[_0x85cd('0x4f')];if(_0x31bd61>_0xf8b322){_0x31bd61=_0xf8b322;}}if(_0x31bd61>0x0){if(_0x17032a[_0x85cd('0x14f')]===_0x85cd('0x8')){_0x31bd61=0x1;}if(_0x31bd61>this[_0x85cd('0x24')]){_0x31bd61=this['maxNumberOriginate'];}_0x17032a[_0x85cd('0xba')]+=_0x31bd61;for(var _0x28adee in this[_0x85cd('0x22')]){if(typeof this[_0x85cd('0x22')][_0x28adee]!==_0x85cd('0x97')){if(this[_0x85cd('0x22')][_0x28adee][_0x85cd('0xa3')]===_0x85cd('0x1fe')&&this[_0x85cd('0x22')][_0x28adee][_0x85cd('0xcf')]==='reachable'){_0x379eeb[_0x85cd('0x121')](this[_0x85cd('0x22')][_0x28adee]['id']);}}}this[_0x85cd('0xb9')](_0x17032a['id'],_0x379eeb,_0x31bd61,_0x17032a[_0x85cd('0x1f3')],_0x17032a)[_0x85cd('0xb2')](function(_0x607b26){_0x17032a['temp']-=_0x31bd61;_0x17032a[_0x85cd('0xba')]=_0x17032a[_0x85cd('0xba')]>0x0?_0x17032a['temp']:0x0;if(!checkContactEmpty(_0x607b26)){_0x52881c[_0x85cd('0xaf')](_0x17032a)[_0x85cd('0xb2')](sendMessageReschedule(_0x17032a))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x17032a[_0x85cd('0x6f')]+=_0x607b26[_0x85cd('0x96')];_0x17032a[_0x85cd('0x3b')]=_0x17032a[_0x85cd('0x14f')]===_0x85cd('0x8')?_0x85cd('0x16a'):_0x85cd('0x1f6');for(var _0x274158=0x0;_0x274158<_0x607b26[_0x85cd('0x96')];_0x274158+=0x1){if(_[_0x85cd('0xd3')](_0x607b26[_0x274158])||_[_0x85cd('0xd3')](_0x607b26[_0x274158]['Contact'])||_[_0x85cd('0xd3')](_0x607b26[_0x274158][_0x85cd('0x163')][_0x85cd('0x164')])){_0x52881c['emptyContact'](_0x85cd('0x1f9'),_0x17032a,_0x607b26[_0x274158]);}else{_0x52881c[_0x85cd('0x1ff')](_[_0x85cd('0xc5')](_0x607b26[_0x274158],['VoiceQueueId',_0x85cd('0x200')]))[_0x85cd('0xb2')](_0x52881c[_0x85cd('0x1dd')](_0x17032a,_0x607b26[_0x274158]))['catch'](_0x52881c[_0x85cd('0x1fa')]('[actionOriginate]\x20',_0x17032a));}}}})['catch'](loggerGetContactDialer(_0x85cd('0x201'),_0x17032a,_0x31bd61));}};Dialer[_0x85cd('0x1c')]['handlePredictive']=function(_0x198b0c){if(_0x198b0c[_0x85cd('0x1fd')]>0x0){var _0x4e6d8e=_0x198b0c['dialLimitQueue']-_0x198b0c[_0x85cd('0x6f')]-_0x198b0c[_0x85cd('0x53')];if(_0x4e6d8e>0x0){this[_0x85cd('0x202')](_0x198b0c);}else{loggerPredictiveCalls[_0x85cd('0x7b')]('[handlePredictive][limitChannel]');}}else{this[_0x85cd('0x202')](_0x198b0c);}};Dialer['prototype']['tryOriginatePredictive']=function(_0x3fab12){var _0x389e17=this;var _0x1bdccc=[];_0x3fab12[_0x85cd('0x6f')]+=0x1;for(var _0x592192 in this[_0x85cd('0x22')]){if(typeof this[_0x85cd('0x22')][_0x592192]!==_0x85cd('0x97')){if(this[_0x85cd('0x22')][_0x592192]['state']===_0x85cd('0x1fe')&&this[_0x85cd('0x22')][_0x592192]['status']===_0x85cd('0xd0')){_0x1bdccc[_0x85cd('0x121')](this['agents'][_0x592192]['id']);}}}this[_0x85cd('0xb9')](_0x3fab12['id'],_0x1bdccc,0x1,_0x3fab12[_0x85cd('0x1f3')],_0x3fab12)['then'](function(_0x13b76b){if(!checkContactEmpty(_0x13b76b)){checkContactLowerLimitOriginate(_0x3fab12,0x1,0x0);_0x389e17[_0x85cd('0xaf')](_0x3fab12)[_0x85cd('0xb2')](sendMessageReschedule(_0x3fab12))[_0x85cd('0xac')](loggerCatch(_0x85cd('0xb0')));}else{_0x3fab12[_0x85cd('0x3b')]=_0x85cd('0x1f6');if(_[_0x85cd('0xd3')](_0x13b76b[0x0])||_[_0x85cd('0xd3')](_0x13b76b[0x0][_0x85cd('0x163')])||_[_0x85cd('0xd3')](_0x13b76b[0x0]['Contact'][_0x85cd('0x164')])){_0x389e17[_0x85cd('0x1f8')](_0x85cd('0x1f9'),_0x3fab12,_0x13b76b[0x0]);}else{_0x389e17[_0x85cd('0x1ff')](_['pick'](_0x13b76b[0x0],['VoiceQueueId','Contact.phone']))[_0x85cd('0xb2')](_0x389e17[_0x85cd('0x1dd')](_0x3fab12,_0x13b76b[0x0]))[_0x85cd('0xac')](_0x389e17[_0x85cd('0x1fa')](_0x85cd('0x203'),_0x3fab12));}}})[_0x85cd('0xac')](loggerGetContactDialer(_0x85cd('0x204'),_0x3fab12,0x1));emitVoiceQueueSummary(_0x3fab12);};Dialer[_0x85cd('0x1c')][_0x85cd('0x205')]=function(_0x27c6e4,_0x44544b,_0x106501,_0x1ead0e,_0x34c84c,_0x12dd97){loggerPredictive[_0x85cd('0x7b')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x206'),_0x27c6e4);loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x207'),_0x44544b);loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x208'),_0x106501);loggerPredictive[_0x85cd('0x7b')]('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',_0x1ead0e);loggerPredictive['info']('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x34c84c);loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x83'));return new BPromise(function(_0x78fb1b,_0x48a4c8){if(_0x27c6e4<=0x0||isNaN(_0x27c6e4)){return _0x48a4c8(msgResponse(_0x85cd('0x209'),'Error',_0x85cd('0x20a')+_0x27c6e4));}if(_0x106501<=0x0||isNaN(_0x106501)){return _0x48a4c8(msgResponse(_0x85cd('0x209'),'Error',_0x85cd('0x20b')+_0x106501));}if(_0x1ead0e<=0x0||isNaN(_0x1ead0e)){return _0x48a4c8(msgResponse(_0x85cd('0x209'),_0x85cd('0x20c'),_0x85cd('0x20d')+_0x1ead0e));}if(_0x44544b<=0x0||isNaN(_0x44544b)){return _0x48a4c8(msgResponse(_0x85cd('0x209'),_0x85cd('0x20c'),'interval\x20=\x20'+_0x44544b));}if(_0x34c84c<=0x0||isNaN(_0x34c84c)){return _0x48a4c8(msgResponse(_0x85cd('0x209'),_0x85cd('0x20c'),_0x85cd('0x20e')+_0x34c84c));}_0x12dd97=_0x12dd97||0x0;var _0x17bb16=0x1/_0x106501;var _0x51973a=0x0;var _0x348f85=0x0;var _0x5aba4d=0x0;var _0x32c53f=0x0;for(var _0x36e038=0x0;_0x5aba4d<_0x34c84c;_0x36e038+=0x1){_0x348f85=_0x36e038/_0x44544b;_0x51973a=(_0x1ead0e*_0x348f85+_0x12dd97)/_0x17bb16;_0x5aba4d=erlangb(_0x51973a,_0x27c6e4);_0x32c53f=_0x51973a/_0x27c6e4*(0x1-erlangb(_0x51973a,_0x27c6e4));}return _0x78fb1b({'erlangCalls':_0x36e038,'erlangCallToSecond':_0x44544b/_0x36e038,'erlangAbandonmentRate':_0x5aba4d,'erlangBusyFactor':_0x32c53f});});};Dialer['prototype'][_0x85cd('0x1d5')]=function(_0x5be846,_0x2bf5a9,_0x8d2611,_0x2abcb8,_0x4b90d4,_0xe21f75){loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x20f'));loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x206'),_0x5be846);loggerPredictive[_0x85cd('0x7b')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2bf5a9);loggerPredictive['info'](_0x85cd('0x208'),_0x8d2611);loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x210'),_0x2abcb8);loggerPredictive[_0x85cd('0x7b')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4b90d4);loggerPredictive['info'](_0x85cd('0x83'));return new BPromise(function(_0x2ab6cd,_0x4a134d){if(_0x5be846<=0x0||isNaN(_0x5be846)){return _0x4a134d(msgResponse(_0x85cd('0x211'),_0x85cd('0x20c'),_0x85cd('0x20a')+_0x5be846));}if(_0x8d2611<=0x0||isNaN(_0x8d2611)){return _0x4a134d(msgResponse(_0x85cd('0x211'),_0x85cd('0x20c'),_0x85cd('0x20b')+_0x8d2611));}if(_0x2abcb8<=0x0||isNaN(_0x2abcb8)){return _0x4a134d(msgResponse(_0x85cd('0x211'),_0x85cd('0x20c'),_0x85cd('0x20d')+_0x2abcb8));}if(_0x2bf5a9<=0x0||isNaN(_0x2bf5a9)){return _0x4a134d(msgResponse(_0x85cd('0x211'),_0x85cd('0x20c'),_0x85cd('0x212')+_0x2bf5a9));}if(_0x4b90d4<=0x0||isNaN(_0x4b90d4)){return _0x4a134d(msgResponse(_0x85cd('0x211'),_0x85cd('0x20c'),_0x85cd('0x213')+_0x4b90d4));}_0xe21f75=_0xe21f75||0x0;var _0x472ba0=0x1/_0x8d2611;var _0x4fcb56=0x0;var _0xc115da=0x0;var _0x1909c5=0x0;var _0x2193c1=0x0;for(var _0x284134=0x0;_0x2193c1<_0x4b90d4;_0x284134+=0x1){_0xc115da=_0x284134/_0x2bf5a9;_0x4fcb56=(_0x2abcb8*_0xc115da+_0xe21f75)/_0x472ba0;_0x1909c5=erlangb(_0x4fcb56,_0x5be846);_0x2193c1=_0x4fcb56/_0x5be846*(0x1-erlangb(_0x4fcb56,_0x5be846));}return _0x2ab6cd({'erlangCalls':_0x284134,'erlangCallToSecond':_0x2bf5a9/_0x284134,'erlangAbandonmentRate':_0x1909c5,'erlangBusyFactor':_0x2193c1});});};module[_0x85cd('0x214')]=Dialer;
\ No newline at end of file
index 52d387f..bea6504 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a26=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','campaigntype','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','droptime','queue','reason','callback','callbackuniqueid','callbackat','recallme','ListId'];(function(_0x51e97f,_0x44a9f7){var _0x406a1c=function(_0x1d6949){while(--_0x1d6949){_0x51e97f['push'](_0x51e97f['shift']());}};_0x406a1c(++_0x44a9f7);}(_0x6a26,0xa6));var _0x66a2=function(_0x4fb073,_0x2e92e8){_0x4fb073=_0x4fb073-0x0;var _0x32401f=_0x6a26[_0x4fb073];return _0x32401f;};'use strict';var util=require(_0x66a2('0x0'));var _=require(_0x66a2('0x1'));var moment=require(_0x66a2('0x2'));function getSeconds(_0xeb22e7,_0x5cc17b){var _0x56eb22=moment(_0xeb22e7)['milliseconds'](0x0);var _0x22e381=moment(_0x5cc17b)[_0x66a2('0x3')](0x0);return _0x56eb22[_0x66a2('0x4')](_0x22e381,_0x66a2('0x5'));}function QueueCallerAbandon(_0x344203,_0x373f81){this['scheduledat']=_0x344203[_0x66a2('0x6')];this['type']=_0x344203['type'];this[_0x66a2('0x7')]=_0x344203[_0x66a2('0x8')]===_0x66a2('0x9')?'queue':_0x344203['type'];this['countbusyretry']=_0x344203[_0x66a2('0xa')];this[_0x66a2('0xb')]=_0x344203[_0x66a2('0xb')];this[_0x66a2('0xc')]=_0x344203[_0x66a2('0xc')];this[_0x66a2('0xd')]=_0x344203[_0x66a2('0xa')]+_0x344203[_0x66a2('0xb')]+_0x344203[_0x66a2('0xc')]+_0x344203[_0x66a2('0xe')]+_0x344203[_0x66a2('0xf')]+_0x344203['countabandonedretry']+_0x344203[_0x66a2('0x10')]+_0x344203[_0x66a2('0x11')];this[_0x66a2('0xe')]=_0x344203[_0x66a2('0xe')];this[_0x66a2('0xf')]=_0x344203['countdropretry'];this[_0x66a2('0x12')]=_0x344203[_0x66a2('0x12')];this['countmachineretry']=_0x344203['countmachineretry'];this[_0x66a2('0x11')]=_0x344203[_0x66a2('0x11')];this[_0x66a2('0x13')]=_0x373f81[_0x66a2('0x13')];this['calleridname']=_0x344203[_0x66a2('0x14')];this[_0x66a2('0x15')]=_0x344203[_0x66a2('0x16')];this[_0x66a2('0x17')]=_0x344203[_0x66a2('0x17')];this[_0x66a2('0x18')]=_0x344203[_0x66a2('0x18')];this['droptime']=_0x344203['droptime'];this[_0x66a2('0x19')]=this[_0x66a2('0x1a')];this['ringtime']=getSeconds(_0x344203[_0x66a2('0x18')],_0x344203['starttime']);this['holdtime']=getSeconds(this[_0x66a2('0x1a')],_0x344203[_0x66a2('0x18')]);this['talktime']=0x0;this['queue']=_0x373f81[_0x66a2('0x1b')];this['membername']=_0x373f81['connectedlinename'];this['reason']=_0x373f81[_0x66a2('0x1c')];this['callback']=_0x344203[_0x66a2('0x1d')];this['callbackuniqueid']=_0x344203[_0x66a2('0x1e')];this['callbackat']=_0x344203[_0x66a2('0x1f')];this[_0x66a2('0x20')]=_0x344203[_0x66a2('0x20')];this['ContactId']=_0x344203['ContactId'];this[_0x66a2('0x21')]=_0x344203[_0x66a2('0x21')];this[_0x66a2('0x22')]=_0x344203['UserId'];this[_0x66a2('0x23')]=_0x344203[_0x66a2('0x23')];this[_0x66a2('0x24')]=_0x344203['CampaignId'];this[_0x66a2('0x25')]=_0x344203[_0x66a2('0x25')]||'';this[_0x66a2('0x26')]=_0x344203['originatecalleridname']||'';}module[_0x66a2('0x27')]=QueueCallerAbandon;
\ No newline at end of file
+var _0x9fc5=['calleridname','name','number','starttime','responsetime','droptime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','scheduledat','campaigntype','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid'];(function(_0x438627,_0x4840dd){var _0x4b6c19=function(_0x2f6995){while(--_0x2f6995){_0x438627['push'](_0x438627['shift']());}};_0x4b6c19(++_0x4840dd);}(_0x9fc5,0x8e));var _0x59fc=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9fc5[_0x1facfa];return _0x9ec701;};'use strict';var util=require(_0x59fc('0x0'));var _=require('lodash');var moment=require(_0x59fc('0x1'));function getSeconds(_0x8732d,_0x279ff8){var _0x32c067=moment(_0x8732d)[_0x59fc('0x2')](0x0);var _0x1de52c=moment(_0x279ff8)['milliseconds'](0x0);return _0x32c067['diff'](_0x1de52c,'seconds');}function QueueCallerAbandon(_0x55adf7,_0x45a72e){this[_0x59fc('0x3')]=_0x55adf7[_0x59fc('0x3')];this['type']=_0x55adf7['type'];this[_0x59fc('0x4')]=_0x55adf7[_0x59fc('0x5')]===_0x59fc('0x6')?_0x59fc('0x7'):_0x55adf7[_0x59fc('0x5')];this[_0x59fc('0x8')]=_0x55adf7[_0x59fc('0x8')];this[_0x59fc('0x9')]=_0x55adf7[_0x59fc('0x9')];this[_0x59fc('0xa')]=_0x55adf7[_0x59fc('0xa')];this[_0x59fc('0xb')]=_0x55adf7['countbusyretry']+_0x55adf7[_0x59fc('0x9')]+_0x55adf7['countnoanswerretry']+_0x55adf7[_0x59fc('0xc')]+_0x55adf7['countdropretry']+_0x55adf7[_0x59fc('0xd')]+_0x55adf7[_0x59fc('0xe')]+_0x55adf7[_0x59fc('0xf')];this[_0x59fc('0xc')]=_0x55adf7[_0x59fc('0xc')];this['countdropretry']=_0x55adf7[_0x59fc('0x10')];this[_0x59fc('0xd')]=_0x55adf7['countabandonedretry'];this[_0x59fc('0xe')]=_0x55adf7[_0x59fc('0xe')];this[_0x59fc('0xf')]=_0x55adf7[_0x59fc('0xf')];this[_0x59fc('0x11')]=_0x45a72e[_0x59fc('0x11')];this[_0x59fc('0x12')]=_0x55adf7[_0x59fc('0x13')];this['calleridnum']=_0x55adf7[_0x59fc('0x14')];this[_0x59fc('0x15')]=_0x55adf7[_0x59fc('0x15')];this[_0x59fc('0x16')]=_0x55adf7['responsetime'];this[_0x59fc('0x17')]=_0x55adf7[_0x59fc('0x17')];this['endtime']=this[_0x59fc('0x17')];this[_0x59fc('0x18')]=getSeconds(_0x55adf7[_0x59fc('0x16')],_0x55adf7[_0x59fc('0x15')]);this[_0x59fc('0x19')]=getSeconds(this[_0x59fc('0x17')],_0x55adf7[_0x59fc('0x16')]);this[_0x59fc('0x1a')]=0x0;this[_0x59fc('0x7')]=_0x45a72e['queue'];this[_0x59fc('0x1b')]=_0x45a72e[_0x59fc('0x1c')];this['reason']=_0x45a72e[_0x59fc('0x1d')];this['callback']=_0x55adf7['callback'];this[_0x59fc('0x1e')]=_0x55adf7['callbackuniqueid'];this[_0x59fc('0x1f')]=_0x55adf7['callbackat'];this['recallme']=_0x55adf7[_0x59fc('0x20')];this['ContactId']=_0x55adf7[_0x59fc('0x21')];this[_0x59fc('0x22')]=_0x55adf7[_0x59fc('0x22')];this[_0x59fc('0x23')]=_0x55adf7[_0x59fc('0x23')];this[_0x59fc('0x24')]=_0x55adf7[_0x59fc('0x24')];this[_0x59fc('0x25')]=_0x55adf7[_0x59fc('0x25')];this[_0x59fc('0x26')]=_0x55adf7[_0x59fc('0x26')]||'';this[_0x59fc('0x27')]=_0x55adf7[_0x59fc('0x27')]||'';}module['exports']=QueueCallerAbandon;
\ No newline at end of file
index 3a39502..a272e3d 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(_0x2e1f25,_0x299328){var _0x40454a=function(_0x4d7483){while(--_0x4d7483){_0x2e1f25['push'](_0x2e1f25['shift']());}};_0x40454a(++_0x299328);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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(_0x398726,_0x2699c2){var _0x106133=function(_0x1ddf86){while(--_0x1ddf86){_0x398726['push'](_0x398726['shift']());}};_0x106133(++_0x2699c2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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 c8a268d..8ef8c88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97d1=['actions','syncNewchannel','bind','varset','newstate','syncNewState','newexten','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','prototype','context','from-voip-provider','hasOwnProperty','exten','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','syncVarSet','variable','channelstate','channelstatedesc','value','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','create','parse','.pdf','application/pdf','then','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','pick','response','reason','update','AttachmentId','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','faxpages','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','isNil','active','SIP/%s','reachable','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks'];(function(_0x441d10,_0x3f6cae){var _0x36dda3=function(_0x2b21bc){while(--_0x2b21bc){_0x441d10['push'](_0x441d10['shift']());}};_0x36dda3(++_0x3f6cae);}(_0x97d1,0x67));var _0x197d=function(_0x105a8a,_0x15a3a2){_0x105a8a=_0x105a8a-0x0;var _0x105a0e=_0x97d1[_0x105a8a];return _0x105a0e;};'use strict';var util=require(_0x197d('0x0'));var _=require(_0x197d('0x1'));var BPromise=require(_0x197d('0x2'));var uuid=require(_0x197d('0x3'));var moment=require(_0x197d('0x4'));var path=require(_0x197d('0x5'));var tiff2pdf=require(_0x197d('0x6'));var gs=require(_0x197d('0x7'));var logger=require(_0x197d('0x8'))(_0x197d('0x9'));var ami=require(_0x197d('0xa'));var rpcDb=require(_0x197d('0xb'));var Channel=require(_0x197d('0xc'));var ut=require(_0x197d('0xd'));var Action=require(_0x197d('0xe'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x197d('0xf'));var faxMessage=require(_0x197d('0x10'));function Fax(_0x393286){this['channels']={};this[_0x197d('0x11')]=_0x393286[_0x197d('0x11')];this[_0x197d('0x12')]=_0x393286['trunks'];this[_0x197d('0x13')]={};ami['on']('newchannel',this[_0x197d('0x14')][_0x197d('0x15')](this));ami['on'](_0x197d('0x16'),this['syncVarSet']['bind'](this));ami['on'](_0x197d('0x17'),this[_0x197d('0x18')]['bind'](this));ami['on'](_0x197d('0x19'),this[_0x197d('0x1a')][_0x197d('0x15')](this));ami['on']('faxstatus',this[_0x197d('0x1b')][_0x197d('0x15')](this));ami['on'](_0x197d('0x1c'),this[_0x197d('0x1d')][_0x197d('0x15')](this));ami['on'](_0x197d('0x1e'),this[_0x197d('0x1f')]['bind'](this));ami['on']('originateresponse',this['syncOriginateResponse']['bind'](this));}Fax[_0x197d('0x20')]['syncNewchannel']=function(_0x4829bf){if(_0x4829bf[_0x197d('0x21')]===_0x197d('0x22')){for(var _0x454251 in this['faxAccounts']){if(this[_0x197d('0x11')][_0x197d('0x23')](_0x454251)){if(_0x4829bf[_0x197d('0x24')]===this[_0x197d('0x11')][_0x454251]['localstationid']){this[_0x197d('0x25')][_0x4829bf['uniqueid']]={};this[_0x197d('0x25')][_0x4829bf[_0x197d('0x26')]][_0x197d('0x27')]=_0x4829bf['channel'];this['channels'][_0x4829bf[_0x197d('0x26')]]['id']=this[_0x197d('0x11')][_0x454251]['id'];this[_0x197d('0x25')][_0x4829bf[_0x197d('0x26')]][_0x197d('0x28')]=this['faxAccounts'][_0x454251]['name'];logger['info'](_0x4829bf[_0x197d('0x26')],'\x20syncNewchannel\x20');}}}}if(this['actions'][_0x4829bf[_0x197d('0x26')]]){this[_0x197d('0x25')][_0x4829bf[_0x197d('0x26')]]={};this[_0x197d('0x25')][_0x4829bf[_0x197d('0x26')]]['channel']=_0x4829bf[_0x197d('0x27')];logger[_0x197d('0x29')](_0x4829bf[_0x197d('0x26')],_0x197d('0x2a'));}};Fax['prototype'][_0x197d('0x2b')]=function(_0x541b02){if(this[_0x197d('0x25')][_0x541b02[_0x197d('0x26')]]){for(var _0x259179 in _0x541b02['variable']){if(_0x541b02[_0x197d('0x2c')][_0x197d('0x23')](_0x259179)){this[_0x197d('0x25')][_0x541b02[_0x197d('0x26')]][_0x259179]=_0x541b02['value'];}}}};Fax[_0x197d('0x20')][_0x197d('0x18')]=function(_0xb600c4){if(this[_0x197d('0x25')][_0xb600c4[_0x197d('0x26')]]){this[_0x197d('0x25')][_0xb600c4[_0x197d('0x26')]][_0x197d('0x2d')]=_0xb600c4['channelstate'];this[_0x197d('0x25')][_0xb600c4['uniqueid']][_0x197d('0x2e')]=_0xb600c4['channelstatedesc'];}};Fax[_0x197d('0x20')][_0x197d('0x1a')]=function(_0x35139f){if(this[_0x197d('0x25')][_0x35139f['uniqueid']]){for(var _0x34f694 in _0x35139f[_0x197d('0x2c')]){if(_0x35139f[_0x197d('0x2c')][_0x197d('0x23')](_0x34f694)){this[_0x197d('0x25')][_0x35139f['uniqueid']][_0x34f694]=_0x35139f[_0x197d('0x2f')];}}}};Fax[_0x197d('0x20')][_0x197d('0x1b')]=function(_0x25d7d7){if(this[_0x197d('0x25')][_0x25d7d7['uniqueid']]){this['channels'][_0x25d7d7[_0x197d('0x26')]][_0x197d('0x30')]=_0x25d7d7[_0x197d('0x30')];this[_0x197d('0x25')][_0x25d7d7['uniqueid']]['status']=_0x25d7d7[_0x197d('0x31')];this[_0x197d('0x25')][_0x25d7d7[_0x197d('0x26')]]['localstationid']=_0x25d7d7[_0x197d('0x32')];this['channels'][_0x25d7d7[_0x197d('0x26')]][_0x197d('0x33')]=_0x25d7d7['filename'];logger[_0x197d('0x29')](_0x25d7d7[_0x197d('0x26')],_0x197d('0x34'));}};Fax[_0x197d('0x20')][_0x197d('0x1d')]=function(_0x6dc998){var _0x1435f7=this;if(this[_0x197d('0x25')][_0x6dc998[_0x197d('0x26')]]){var _0xf53879=this['channels'][_0x6dc998['uniqueid']]['id'];this[_0x197d('0x25')][_0x6dc998[_0x197d('0x26')]]['remotestationid']=_0x6dc998[_0x197d('0x35')];this[_0x197d('0x25')][_0x6dc998[_0x197d('0x26')]][_0x197d('0x36')]=_0x6dc998[_0x197d('0x36')];this[_0x197d('0x25')][_0x6dc998[_0x197d('0x26')]][_0x197d('0x32')]=_0x6dc998[_0x197d('0x32')];this['channels'][_0x6dc998['uniqueid']]['resolution']=_0x6dc998[_0x197d('0x37')];this[_0x197d('0x25')][_0x6dc998[_0x197d('0x26')]][_0x197d('0x38')]=_0x6dc998[_0x197d('0x38')];this[_0x197d('0x25')][_0x6dc998[_0x197d('0x26')]][_0x197d('0x33')]=_0x6dc998['filename'];this[_0x197d('0x25')][_0x6dc998[_0x197d('0x26')]][_0x197d('0x39')]=_0x6dc998['calleridnum'];if(this['channels'][_0x6dc998[_0x197d('0x26')]][_0x197d('0x36')]>0x0){tiff2pdf(_0x6dc998[_0x197d('0x33')],_0x197d('0x3a'),function(_0x3d15fa){logger[_0x197d('0x29')](_0x6dc998[_0x197d('0x26')],'\x20result\x20conversion\x20file\x20',_0x3d15fa[_0x197d('0x3b')]);attachment[_0x197d('0x3c')]({'name':path[_0x197d('0x3d')](_0x6dc998[_0x197d('0x33')])[_0x197d('0x28')],'basename':path[_0x197d('0x3d')](_0x6dc998['filename'])[_0x197d('0x28')]+_0x197d('0x3e'),'type':_0x197d('0x3f')})[_0x197d('0x40')](function(_0x5a35ec){faxAccount['notify'](_0xf53879,{'from':_0x6dc998[_0x197d('0x39')],'mapKey':_0x197d('0x9'),'body':path[_0x197d('0x3d')](_0x6dc998[_0x197d('0x33')])[_0x197d('0x28')]+_0x197d('0x3e'),'AttachmentId':_0x5a35ec['id']})[_0x197d('0x41')](function(_0x15db2b){logger[_0x197d('0x42')](_0x6dc998[_0x197d('0x26')],_0x197d('0x43'),JSON[_0x197d('0x44')](_0x15db2b));});})[_0x197d('0x41')](function(_0x435b9a){logger['error'](_0x6dc998['uniqueid'],_0x197d('0x45'),JSON[_0x197d('0x44')](_0x435b9a));});});}logger[_0x197d('0x29')](_0x6dc998[_0x197d('0x26')],'\x20receiveFax\x20');}};Fax['prototype'][_0x197d('0x46')]=function(_0x49ac9e){if(this[_0x197d('0x13')][_0x49ac9e[_0x197d('0x26')]]){_[_0x197d('0x47')](this[_0x197d('0x25')][_0x49ac9e[_0x197d('0x26')]],_[_0x197d('0x48')](_0x49ac9e,[_0x197d('0x49'),_0x197d('0x4a')]));}};function updateStatus(_0x440e0c){if(_0x440e0c['AttachmentId']){faxMessage[_0x197d('0x4b')](_0x440e0c[_0x197d('0x4c')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x197d('0x40')](function(_0x454a3c){ut[_0x197d('0x4d')](_0x197d('0x4e'),_0x454a3c);})[_0x197d('0x41')](function(_0x3d3d5c){ut['logger']('[Fax][Message][Error][NoUpdate1]',_0x3d3d5c);});}else{ut[_0x197d('0x4d')](_0x197d('0x4f'));}}Fax[_0x197d('0x20')]['updateStatus']=function(_0x2e3152,_0x1de8e0,_0x5b5b76){var _0x477660=this;var _0x285865={};if(_0x1de8e0){_0x285865={'read':_0x1de8e0};}else{_0x285865={'failMessage':_0x5b5b76};}if(this['actions'][_0x2e3152][_0x197d('0x4c')]){faxMessage['update'](this[_0x197d('0x13')][_0x2e3152][_0x197d('0x4c')],_0x285865)[_0x197d('0x40')](function(_0x2f196e){ut['logger'](_0x197d('0x50'),_0x2f196e);})[_0x197d('0x41')](function(_0x372f5f){ut[_0x197d('0x4d')](_0x197d('0x51'),_0x372f5f);})[_0x197d('0x52')](function(){delete _0x477660[_0x197d('0x25')][_0x2e3152];delete _0x477660[_0x197d('0x13')][_0x2e3152];});}else{ut[_0x197d('0x4d')]('[Fax][Message][NoUpdate2]');delete this[_0x197d('0x25')][_0x2e3152];delete this['actions'][_0x2e3152];}};Fax['prototype']['syncHangup']=function(_0x4d16ef){var _0x30911=this;if(this[_0x197d('0x25')][_0x4d16ef[_0x197d('0x26')]]){if(this[_0x197d('0x13')][_0x4d16ef['uniqueid']]){this[_0x197d('0x25')][_0x4d16ef[_0x197d('0x26')]]['id']=this[_0x197d('0x13')][_0x4d16ef[_0x197d('0x26')]]['id'];this['channels'][_0x4d16ef[_0x197d('0x26')]][_0x197d('0x28')]=this[_0x197d('0x13')][_0x4d16ef[_0x197d('0x26')]][_0x197d('0x28')];}logger[_0x197d('0x29')](_0x4d16ef[_0x197d('0x26')],this[_0x197d('0x13')][_0x4d16ef['uniqueid']]?_0x197d('0x53'):'\x20hangup\x20faxRiceive\x20',JSON[_0x197d('0x44')](this[_0x197d('0x25')][_0x4d16ef[_0x197d('0x26')]]));if(this['actions'][_0x4d16ef['uniqueid']]){if(this[_0x197d('0x25')][_0x4d16ef[_0x197d('0x26')]][_0x197d('0x54')]>0x0&&this[_0x197d('0x25')][_0x4d16ef[_0x197d('0x26')]]['faxstatus']==='SUCCESS'){this[_0x197d('0x55')](_0x4d16ef[_0x197d('0x26')],!![]);}else{this[_0x197d('0x55')](_0x4d16ef[_0x197d('0x26')],![],this[_0x197d('0x25')][_0x4d16ef[_0x197d('0x26')]][_0x197d('0x56')]?_0x197d('0x57')+this[_0x197d('0x25')][_0x4d16ef[_0x197d('0x26')]][_0x197d('0x56')]:_0x197d('0x58'));}}}};Fax[_0x197d('0x20')][_0x197d('0x59')]=function(_0x20c28b){var _0x380488=this;return new BPromise(function(_0x4cc7df,_0x2b339e){_0x380488[_0x197d('0x5a')](_0x20c28b,_0x380488['faxAccounts'][_0x20c28b['FaxAccountId']])[_0x197d('0x40')](function(_0x4e1d2c){ut['logger']('[Fax][execOriginate][success]',_0x4e1d2c);_0x4cc7df(ut[_0x197d('0x3b')](_0x197d('0x5b')));})[_0x197d('0x41')](function(_0x43aa08){ut[_0x197d('0x4d')](_0x197d('0x5c'),_0x43aa08);updateStatus(_0x20c28b);_0x2b339e(ut[_0x197d('0x3b')](_0x197d('0x5d')));});});};Fax['prototype'][_0x197d('0x5e')]=function(_0x58d83a){var _0x6269e7=this;return new BPromise(function(_0x5444cc,_0x1294dd){var _0x59978c=_0x6269e7[_0x197d('0x5f')](_0x6269e7[_0x197d('0x11')][_0x58d83a[_0x197d('0x60')]][_0x197d('0x61')],_0x58d83a);if(_0x59978c[_0x197d('0x62')]){_0x5444cc(ut[_0x197d('0x3b')](_0x197d('0x63')));}else{_0x1294dd(ut[_0x197d('0x3b')](_0x59978c['message']));}});};function originate(_0x270e55,_0x4cf19f,_0x29870b){return new BPromise(function(_0x2fc3cb,_0x2cc7c9){if(_0x29870b){var _0x5a5df9=util[_0x197d('0x64')](_0x197d('0x65'),path[_0x197d('0x3d')](_0x270e55[_0x197d('0x5')])[_0x197d('0x28')],_0x270e55['path']);gs[_0x197d('0x66')](_0x5a5df9)[_0x197d('0x40')](function(){_0x270e55[_0x197d('0x5')]=util[_0x197d('0x64')](_0x197d('0x67'),path['parse'](_0x270e55[_0x197d('0x5')])[_0x197d('0x68')],path[_0x197d('0x3d')](_0x270e55[_0x197d('0x5')])['name']);_0x4cf19f[_0x197d('0x69')]=_0x270e55[_0x197d('0x5')];ut[_0x197d('0x4d')](_0x197d('0x6a'),'');ami[_0x197d('0x6b')](ut['variablesAction'](_0x270e55,_0x4cf19f))[_0x197d('0x40')](function(_0x35e506){_0x2fc3cb(_0x35e506);})[_0x197d('0x41')](function(_0x171737){_0x2cc7c9(_0x171737);});})[_0x197d('0x41')](function(_0x17900a){_0x2cc7c9(_0x17900a);});}else{ami[_0x197d('0x6b')](ut[_0x197d('0x6c')](_0x270e55,_0x4cf19f))[_0x197d('0x40')](function(_0x6e84ed){_0x2fc3cb(_0x6e84ed);})[_0x197d('0x41')](function(_0x243ada){_0x2cc7c9(_0x243ada);});}});}Fax[_0x197d('0x20')]['execOriginate']=function(_0x5426e7,_0x2fd9c7){var _0x78cffc=this;return new BPromise(function(_0x2d5cac,_0x4e8273){var _0x3756ef=uuid['v4']();var _0x147abf=ut[_0x197d('0x6d')](_0x5426e7,_0x2fd9c7);_0x78cffc[_0x197d('0x13')][_0x3756ef]=new Action(_0x3756ef,_0x2fd9c7,_0x5426e7);var _0x4fc20b=_0x78cffc[_0x197d('0x13')][_0x3756ef];if(path['parse'](_0x5426e7[_0x197d('0x5')])['ext']===_0x197d('0x3e')){originate(_0x4fc20b,_0x147abf,!![])[_0x197d('0x40')](function(_0x3296f0){_0x2d5cac(_0x3296f0);})[_0x197d('0x41')](function(_0x350eae){_0x4e8273(_0x350eae);});}else{originate(_0x4fc20b,_0x147abf,![])[_0x197d('0x40')](function(_0xc2ed93){_0x2d5cac(_0xc2ed93);})[_0x197d('0x41')](function(_0x5c7de0){_0x4e8273(_0x5c7de0);});}});};Fax[_0x197d('0x20')]['isTrunkReachable']=function(_0x5d6ec2){return!_[_0x197d('0x6e')](_0x5d6ec2)&&!_['isNil'](_0x5d6ec2[_0x197d('0x28')])&&!_['isNil'](_0x5d6ec2[_0x197d('0x6f')])&&_0x5d6ec2[_0x197d('0x6f')]&&!_[_0x197d('0x6e')](this['trunks'][util[_0x197d('0x64')](_0x197d('0x70'),_0x5d6ec2['name'])])&&!_[_0x197d('0x6e')](this[_0x197d('0x12')][util[_0x197d('0x64')]('SIP/%s',_0x5d6ec2['name'])][_0x197d('0x31')])&&(this[_0x197d('0x12')][util[_0x197d('0x64')](_0x197d('0x70'),_0x5d6ec2[_0x197d('0x28')])][_0x197d('0x31')]===_0x197d('0x71')||this[_0x197d('0x12')][util[_0x197d('0x64')](_0x197d('0x70'),_0x5d6ec2[_0x197d('0x28')])][_0x197d('0x31')]==='unmonitored');};Fax[_0x197d('0x20')][_0x197d('0x5f')]=function(_0x41d85e,_0x11737c){if(!this[_0x197d('0x72')](_0x41d85e)){ut[_0x197d('0x4d')](_0x197d('0x73'),_[_0x197d('0x6e')](_0x41d85e)?'':_0x41d85e['name']+_0x197d('0x74'));return{'isValid':![],'message':_0x197d('0x75')};}if(_['isNil'](_0x11737c['fax'])){ut[_0x197d('0x4d')]('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0x11737c));return{'isValid':![],'message':'Empty\x20Fax'};}if(_['isNil'](_0x11737c[_0x197d('0x5')])){ut[_0x197d('0x4d')](_0x197d('0x76'),JSON[_0x197d('0x44')](_0x11737c));return{'isValid':![],'message':_0x197d('0x77')};}return{'isValid':!![],'message':_0x197d('0x78')};};module[_0x197d('0x79')]=Fax;
\ No newline at end of file
+var _0x7635=['[Fax][Message][Error][NoUpdate2]','updateStatus','then','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','message','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','bluebird','uuid','moment','path','tiff2pdf','./util/gs','fax','../ami','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','syncVarSet','newstate','syncNewState','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','hasOwnProperty','exten','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','localstationid','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','create','parse','.pdf','error','stringify','catch','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]'];(function(_0x4bdafc,_0x3d804b){var _0x135b21=function(_0x7abddb){while(--_0x7abddb){_0x4bdafc['push'](_0x4bdafc['shift']());}};_0x135b21(++_0x3d804b);}(_0x7635,0x194));var _0x5763=function(_0x2463e2,_0x1a75c9){_0x2463e2=_0x2463e2-0x0;var _0x358990=_0x7635[_0x2463e2];return _0x358990;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x5763('0x0'));var uuid=require(_0x5763('0x1'));var moment=require(_0x5763('0x2'));var path=require(_0x5763('0x3'));var tiff2pdf=require(_0x5763('0x4'));var gs=require(_0x5763('0x5'));var logger=require('../../../config/logger')(_0x5763('0x6'));var ami=require(_0x5763('0x7'));var rpcDb=require('./rpcDb');var Channel=require(_0x5763('0x8'));var ut=require(_0x5763('0x9'));var Action=require(_0x5763('0xa'));var faxAccount=require(_0x5763('0xb'));var attachment=require(_0x5763('0xc'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x47795c){this['channels']={};this['faxAccounts']=_0x47795c[_0x5763('0xd')];this[_0x5763('0xe')]=_0x47795c[_0x5763('0xe')];this[_0x5763('0xf')]={};ami['on'](_0x5763('0x10'),this[_0x5763('0x11')][_0x5763('0x12')](this));ami['on']('varset',this[_0x5763('0x13')]['bind'](this));ami['on'](_0x5763('0x14'),this[_0x5763('0x15')]['bind'](this));ami['on']('newexten',this[_0x5763('0x16')][_0x5763('0x12')](this));ami['on'](_0x5763('0x17'),this[_0x5763('0x18')][_0x5763('0x12')](this));ami['on'](_0x5763('0x19'),this[_0x5763('0x1a')][_0x5763('0x12')](this));ami['on'](_0x5763('0x1b'),this[_0x5763('0x1c')][_0x5763('0x12')](this));ami['on'](_0x5763('0x1d'),this[_0x5763('0x1e')][_0x5763('0x12')](this));}Fax[_0x5763('0x1f')]['syncNewchannel']=function(_0x4a8bfb){if(_0x4a8bfb[_0x5763('0x20')]==='from-voip-provider'){for(var _0x4bbf29 in this[_0x5763('0xd')]){if(this['faxAccounts'][_0x5763('0x21')](_0x4bbf29)){if(_0x4a8bfb[_0x5763('0x22')]===this[_0x5763('0xd')][_0x4bbf29]['localstationid']){this[_0x5763('0x23')][_0x4a8bfb[_0x5763('0x24')]]={};this['channels'][_0x4a8bfb[_0x5763('0x24')]]['channel']=_0x4a8bfb[_0x5763('0x25')];this[_0x5763('0x23')][_0x4a8bfb[_0x5763('0x24')]]['id']=this['faxAccounts'][_0x4bbf29]['id'];this[_0x5763('0x23')][_0x4a8bfb[_0x5763('0x24')]][_0x5763('0x26')]=this[_0x5763('0xd')][_0x4bbf29][_0x5763('0x26')];logger[_0x5763('0x27')](_0x4a8bfb[_0x5763('0x24')],_0x5763('0x28'));}}}}if(this[_0x5763('0xf')][_0x4a8bfb[_0x5763('0x24')]]){this[_0x5763('0x23')][_0x4a8bfb['uniqueid']]={};this[_0x5763('0x23')][_0x4a8bfb[_0x5763('0x24')]][_0x5763('0x25')]=_0x4a8bfb[_0x5763('0x25')];logger[_0x5763('0x27')](_0x4a8bfb[_0x5763('0x24')],_0x5763('0x28'));}};Fax['prototype']['syncVarSet']=function(_0xeaa7cd){if(this[_0x5763('0x23')][_0xeaa7cd[_0x5763('0x24')]]){for(var _0x1caedb in _0xeaa7cd['variable']){if(_0xeaa7cd[_0x5763('0x29')][_0x5763('0x21')](_0x1caedb)){this['channels'][_0xeaa7cd['uniqueid']][_0x1caedb]=_0xeaa7cd[_0x5763('0x2a')];}}}};Fax['prototype'][_0x5763('0x15')]=function(_0x134ba6){if(this[_0x5763('0x23')][_0x134ba6[_0x5763('0x24')]]){this['channels'][_0x134ba6[_0x5763('0x24')]]['channelstate']=_0x134ba6[_0x5763('0x2b')];this[_0x5763('0x23')][_0x134ba6[_0x5763('0x24')]][_0x5763('0x2c')]=_0x134ba6[_0x5763('0x2c')];}};Fax[_0x5763('0x1f')]['syncNewExten']=function(_0x2f8476){if(this[_0x5763('0x23')][_0x2f8476[_0x5763('0x24')]]){for(var _0x3fdc45 in _0x2f8476[_0x5763('0x29')]){if(_0x2f8476['variable']['hasOwnProperty'](_0x3fdc45)){this[_0x5763('0x23')][_0x2f8476[_0x5763('0x24')]][_0x3fdc45]=_0x2f8476[_0x5763('0x2a')];}}}};Fax[_0x5763('0x1f')][_0x5763('0x18')]=function(_0x587055){if(this['channels'][_0x587055[_0x5763('0x24')]]){this['channels'][_0x587055[_0x5763('0x24')]][_0x5763('0x2d')]=_0x587055[_0x5763('0x2d')];this[_0x5763('0x23')][_0x587055[_0x5763('0x24')]][_0x5763('0x2e')]=_0x587055['status'];this['channels'][_0x587055[_0x5763('0x24')]]['localstationid']=_0x587055[_0x5763('0x2f')];this[_0x5763('0x23')][_0x587055[_0x5763('0x24')]][_0x5763('0x30')]=_0x587055['filename'];logger[_0x5763('0x27')](_0x587055[_0x5763('0x24')],'\x20syncFaxStatus\x20');}};Fax[_0x5763('0x1f')][_0x5763('0x1a')]=function(_0x1f7eda){var _0x3abd9e=this;if(this[_0x5763('0x23')][_0x1f7eda[_0x5763('0x24')]]){var _0x6b7f6c=this['channels'][_0x1f7eda[_0x5763('0x24')]]['id'];this[_0x5763('0x23')][_0x1f7eda[_0x5763('0x24')]][_0x5763('0x31')]=_0x1f7eda['remotestationid'];this['channels'][_0x1f7eda[_0x5763('0x24')]][_0x5763('0x32')]=_0x1f7eda[_0x5763('0x32')];this[_0x5763('0x23')][_0x1f7eda[_0x5763('0x24')]][_0x5763('0x2f')]=_0x1f7eda[_0x5763('0x2f')];this[_0x5763('0x23')][_0x1f7eda['uniqueid']][_0x5763('0x33')]=_0x1f7eda['resolution'];this[_0x5763('0x23')][_0x1f7eda[_0x5763('0x24')]][_0x5763('0x34')]=_0x1f7eda['transferrate'];this[_0x5763('0x23')][_0x1f7eda[_0x5763('0x24')]][_0x5763('0x30')]=_0x1f7eda['filename'];this[_0x5763('0x23')][_0x1f7eda[_0x5763('0x24')]][_0x5763('0x35')]=_0x1f7eda[_0x5763('0x35')];if(this[_0x5763('0x23')][_0x1f7eda[_0x5763('0x24')]][_0x5763('0x32')]>0x0){tiff2pdf(_0x1f7eda[_0x5763('0x30')],_0x5763('0x36'),function(_0x416286){logger['info'](_0x1f7eda[_0x5763('0x24')],'\x20result\x20conversion\x20file\x20',_0x416286['message']);attachment[_0x5763('0x37')]({'name':path[_0x5763('0x38')](_0x1f7eda[_0x5763('0x30')])[_0x5763('0x26')],'basename':path['parse'](_0x1f7eda[_0x5763('0x30')])[_0x5763('0x26')]+'.pdf','type':'application/pdf'})['then'](function(_0x33f99b){faxAccount['notify'](_0x6b7f6c,{'from':_0x1f7eda['calleridnum'],'mapKey':_0x5763('0x6'),'body':path[_0x5763('0x38')](_0x1f7eda[_0x5763('0x30')])['name']+_0x5763('0x39'),'AttachmentId':_0x33f99b['id']})['catch'](function(_0x4d2588){logger[_0x5763('0x3a')](_0x1f7eda[_0x5763('0x24')],'\x20notify\x20',JSON[_0x5763('0x3b')](_0x4d2588));});})[_0x5763('0x3c')](function(_0x13f797){logger[_0x5763('0x3a')](_0x1f7eda['uniqueid'],_0x5763('0x3d'),JSON[_0x5763('0x3b')](_0x13f797));});});}logger[_0x5763('0x27')](_0x1f7eda[_0x5763('0x24')],_0x5763('0x3d'));}};Fax['prototype']['syncOriginateResponse']=function(_0x525f12){if(this[_0x5763('0xf')][_0x525f12[_0x5763('0x24')]]){_[_0x5763('0x3e')](this[_0x5763('0x23')][_0x525f12[_0x5763('0x24')]],_[_0x5763('0x3f')](_0x525f12,[_0x5763('0x40'),_0x5763('0x41')]));}};function updateStatus(_0x31a6a7){if(_0x31a6a7[_0x5763('0x42')]){faxMessage[_0x5763('0x43')](_0x31a6a7[_0x5763('0x42')],{'failMessage':_0x5763('0x44')})['then'](function(_0x1f7e39){ut[_0x5763('0x45')](_0x5763('0x46'),_0x1f7e39);})[_0x5763('0x3c')](function(_0x5c53db){ut['logger'](_0x5763('0x47'),_0x5c53db);});}else{ut[_0x5763('0x45')](_0x5763('0x48'));}}Fax[_0x5763('0x1f')][_0x5763('0x49')]=function(_0x4ca1b6,_0x2c8b94,_0x2854c1){var _0x44a586=this;var _0xd72d1a={};if(_0x2c8b94){_0xd72d1a={'read':_0x2c8b94};}else{_0xd72d1a={'failMessage':_0x2854c1};}if(this['actions'][_0x4ca1b6][_0x5763('0x42')]){faxMessage[_0x5763('0x43')](this[_0x5763('0xf')][_0x4ca1b6][_0x5763('0x42')],_0xd72d1a)[_0x5763('0x4a')](function(_0x110391){ut['logger'](_0x5763('0x4b'),_0x110391);})[_0x5763('0x3c')](function(_0x5accc3){ut[_0x5763('0x45')](_0x5763('0x4c'),_0x5accc3);})[_0x5763('0x4d')](function(){delete _0x44a586[_0x5763('0x23')][_0x4ca1b6];delete _0x44a586[_0x5763('0xf')][_0x4ca1b6];});}else{ut['logger'](_0x5763('0x4e'));delete this[_0x5763('0x23')][_0x4ca1b6];delete this[_0x5763('0xf')][_0x4ca1b6];}};Fax[_0x5763('0x1f')][_0x5763('0x1c')]=function(_0x2adfa5){var _0x20d5e0=this;if(this[_0x5763('0x23')][_0x2adfa5['uniqueid']]){if(this['actions'][_0x2adfa5[_0x5763('0x24')]]){this['channels'][_0x2adfa5['uniqueid']]['id']=this[_0x5763('0xf')][_0x2adfa5[_0x5763('0x24')]]['id'];this['channels'][_0x2adfa5[_0x5763('0x24')]][_0x5763('0x26')]=this[_0x5763('0xf')][_0x2adfa5[_0x5763('0x24')]][_0x5763('0x26')];}logger['info'](_0x2adfa5[_0x5763('0x24')],this['actions'][_0x2adfa5[_0x5763('0x24')]]?_0x5763('0x4f'):_0x5763('0x50'),JSON[_0x5763('0x3b')](this[_0x5763('0x23')][_0x2adfa5[_0x5763('0x24')]]));if(this[_0x5763('0xf')][_0x2adfa5[_0x5763('0x24')]]){if(this[_0x5763('0x23')][_0x2adfa5[_0x5763('0x24')]][_0x5763('0x51')]>0x0&&this[_0x5763('0x23')][_0x2adfa5[_0x5763('0x24')]]['faxstatus']===_0x5763('0x52')){this[_0x5763('0x49')](_0x2adfa5['uniqueid'],!![]);}else{this[_0x5763('0x49')](_0x2adfa5[_0x5763('0x24')],![],this[_0x5763('0x23')][_0x2adfa5[_0x5763('0x24')]][_0x5763('0x53')]?'SENDING\x20FAILED:\x20'+this['channels'][_0x2adfa5[_0x5763('0x24')]][_0x5763('0x53')]:'SENDING\x20FAILED');}}}};Fax['prototype'][_0x5763('0x54')]=function(_0x4647d2){var _0x3e6e86=this;return new BPromise(function(_0x56dc2c,_0x301ce0){_0x3e6e86[_0x5763('0x55')](_0x4647d2,_0x3e6e86[_0x5763('0xd')][_0x4647d2[_0x5763('0x56')]])[_0x5763('0x4a')](function(_0x2d3318){ut[_0x5763('0x45')](_0x5763('0x57'),_0x2d3318);_0x56dc2c(ut['message'](_0x5763('0x58')));})[_0x5763('0x3c')](function(_0x49a39b){ut['logger']('[Fax][execOriginate][failure]',_0x49a39b);updateStatus(_0x4647d2);_0x301ce0(ut['message'](_0x5763('0x59')));});});};Fax[_0x5763('0x1f')][_0x5763('0x5a')]=function(_0x21dab4){var _0x1a83b1=this;return new BPromise(function(_0x544d56,_0x4e1a04){var _0x4ba262=_0x1a83b1[_0x5763('0x5b')](_0x1a83b1[_0x5763('0xd')][_0x21dab4[_0x5763('0x56')]][_0x5763('0x5c')],_0x21dab4);if(_0x4ba262[_0x5763('0x5d')]){_0x544d56(ut[_0x5763('0x5e')]('Trunk\x20Reachable'));}else{_0x4e1a04(ut[_0x5763('0x5e')](_0x4ba262[_0x5763('0x5e')]));}});};function originate(_0x2ee631,_0x5224b7,_0x388312){return new BPromise(function(_0x178e2b,_0x3e97c2){if(_0x388312){var _0x48111a=util[_0x5763('0x5f')](_0x5763('0x60'),path['parse'](_0x2ee631[_0x5763('0x3')])[_0x5763('0x26')],_0x2ee631[_0x5763('0x3')]);gs[_0x5763('0x61')](_0x48111a)['then'](function(){_0x2ee631['path']=util[_0x5763('0x5f')](_0x5763('0x62'),path[_0x5763('0x38')](_0x2ee631[_0x5763('0x3')])[_0x5763('0x63')],path[_0x5763('0x38')](_0x2ee631[_0x5763('0x3')])[_0x5763('0x26')]);_0x5224b7[_0x5763('0x64')]=_0x2ee631[_0x5763('0x3')];ut[_0x5763('0x45')](_0x5763('0x65'),'');ami[_0x5763('0x66')](ut[_0x5763('0x67')](_0x2ee631,_0x5224b7))[_0x5763('0x4a')](function(_0x107050){_0x178e2b(_0x107050);})['catch'](function(_0x1f07eb){_0x3e97c2(_0x1f07eb);});})[_0x5763('0x3c')](function(_0x26fe74){_0x3e97c2(_0x26fe74);});}else{ami[_0x5763('0x66')](ut['variablesAction'](_0x2ee631,_0x5224b7))[_0x5763('0x4a')](function(_0x19caac){_0x178e2b(_0x19caac);})[_0x5763('0x3c')](function(_0x36214e){_0x3e97c2(_0x36214e);});}});}Fax[_0x5763('0x1f')][_0x5763('0x55')]=function(_0x380595,_0x3f3d00){var _0x5d53d4=this;return new BPromise(function(_0x5869bb,_0x373382){var _0x3ed4ae=uuid['v4']();var _0x1fe0ba=ut['addVariables'](_0x380595,_0x3f3d00);_0x5d53d4[_0x5763('0xf')][_0x3ed4ae]=new Action(_0x3ed4ae,_0x3f3d00,_0x380595);var _0x3e9818=_0x5d53d4[_0x5763('0xf')][_0x3ed4ae];if(path['parse'](_0x380595[_0x5763('0x3')])['ext']===_0x5763('0x39')){originate(_0x3e9818,_0x1fe0ba,!![])[_0x5763('0x4a')](function(_0x4c1276){_0x5869bb(_0x4c1276);})['catch'](function(_0x59be1c){_0x373382(_0x59be1c);});}else{originate(_0x3e9818,_0x1fe0ba,![])[_0x5763('0x4a')](function(_0x592444){_0x5869bb(_0x592444);})[_0x5763('0x3c')](function(_0x5c55fd){_0x373382(_0x5c55fd);});}});};Fax[_0x5763('0x1f')][_0x5763('0x68')]=function(_0x4f7703){return!_[_0x5763('0x69')](_0x4f7703)&&!_['isNil'](_0x4f7703[_0x5763('0x26')])&&!_[_0x5763('0x69')](_0x4f7703[_0x5763('0x6a')])&&_0x4f7703[_0x5763('0x6a')]&&!_['isNil'](this[_0x5763('0xe')][util[_0x5763('0x5f')]('SIP/%s',_0x4f7703[_0x5763('0x26')])])&&!_[_0x5763('0x69')](this[_0x5763('0xe')][util[_0x5763('0x5f')]('SIP/%s',_0x4f7703[_0x5763('0x26')])]['status'])&&(this['trunks'][util['format'](_0x5763('0x6b'),_0x4f7703[_0x5763('0x26')])][_0x5763('0x2e')]===_0x5763('0x6c')||this['trunks'][util[_0x5763('0x5f')](_0x5763('0x6b'),_0x4f7703['name'])][_0x5763('0x2e')]===_0x5763('0x6d'));};Fax[_0x5763('0x1f')][_0x5763('0x5b')]=function(_0x5f1baf,_0x19e8b3){if(!this[_0x5763('0x68')](_0x5f1baf)){ut[_0x5763('0x45')](_0x5763('0x6e'),_[_0x5763('0x69')](_0x5f1baf)?'':_0x5f1baf[_0x5763('0x26')]+_0x5763('0x6f'));return{'isValid':![],'message':_0x5763('0x70')};}if(_[_0x5763('0x69')](_0x19e8b3[_0x5763('0x6')])){ut['logger'](_0x5763('0x71'),JSON[_0x5763('0x3b')](_0x19e8b3));return{'isValid':![],'message':_0x5763('0x72')};}if(_[_0x5763('0x69')](_0x19e8b3[_0x5763('0x3')])){ut[_0x5763('0x45')](_0x5763('0x73'),JSON['stringify'](_0x19e8b3));return{'isValid':![],'message':_0x5763('0x74')};}return{'isValid':!![],'message':_0x5763('0x75')};};module[_0x5763('0x76')]=Fax;
\ No newline at end of file
index 47d7b04..815feea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa94b=['catch','[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa94b,0x6a));var _0xba94=function(_0x27da9e,_0x219cbd){_0x27da9e=_0x27da9e-0x0;var _0x110e7e=_0xa94b[_0x27da9e];return _0x110e7e;};'use strict';var util=require(_0xba94('0x0'));var BPromise=require(_0xba94('0x1'));var logger=require(_0xba94('0x2'))(_0xba94('0x3'));var _=require(_0xba94('0x4'));var faxAccount=require(_0xba94('0x5'));function loggerCatch(_0xb94aa2){return function(_0x48ed33){logger[_0xba94('0x6')](_0xb94aa2,util[_0xba94('0x7')](_0x48ed33,{'showHidden':![],'depth':null}));};}exports[_0xba94('0x8')]=function(_0x5644d3,_0x381801){return BPromise[_0xba94('0x9')]()[_0xba94('0xa')](faxAccount[_0xba94('0x8')](_0x5644d3,_0x381801))[_0xba94('0xb')](loggerCatch(_0xba94('0xc')));};
\ No newline at end of file
+var _0x0a7a=['[Notify]\x20','util','bluebird','preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve','then','catch'];(function(_0x5ace87,_0x1612f9){var _0x1b985b=function(_0x557e82){while(--_0x557e82){_0x5ace87['push'](_0x5ace87['shift']());}};_0x1b985b(++_0x1612f9);}(_0x0a7a,0x18d));var _0xa0a7=function(_0x9ea7f3,_0x4eab77){_0x9ea7f3=_0x9ea7f3-0x0;var _0x44bc26=_0x0a7a[_0x9ea7f3];return _0x44bc26;};'use strict';var util=require(_0xa0a7('0x0'));var BPromise=require(_0xa0a7('0x1'));var logger=require('../../../config/logger')(_0xa0a7('0x2'));var _=require(_0xa0a7('0x3'));var faxAccount=require(_0xa0a7('0x4'));function loggerCatch(_0x575760){return function(_0x42033a){logger[_0xa0a7('0x5')](_0x575760,util[_0xa0a7('0x6')](_0x42033a,{'showHidden':![],'depth':null}));};}exports[_0xa0a7('0x7')]=function(_0x52f94d,_0x367ff1){return BPromise[_0xa0a7('0x8')]()[_0xa0a7('0x9')](faxAccount[_0xa0a7('0x7')](_0x52f94d,_0x367ff1))[_0xa0a7('0xa')](loggerCatch(_0xa0a7('0xb')));};
\ No newline at end of file
index e69abdf..98f1cde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59dc=['inspect','util','../../../../config/logger','fax','bluebird','child_process','exec','execute','info','Exec\x20gs'];(function(_0x14f6db,_0x4d9f26){var _0x45344d=function(_0x44cace){while(--_0x44cace){_0x14f6db['push'](_0x14f6db['shift']());}};_0x45344d(++_0x4d9f26);}(_0x59dc,0x105));var _0xc59d=function(_0x15a2da,_0x545bf3){_0x15a2da=_0x15a2da-0x0;var _0x25a18a=_0x59dc[_0x15a2da];return _0x25a18a;};'use strict';var util=require(_0xc59d('0x0'));var logger=require(_0xc59d('0x1'))(_0xc59d('0x2'));var BPromise=require(_0xc59d('0x3'));var exec=require(_0xc59d('0x4'))[_0xc59d('0x5')];exports[_0xc59d('0x6')]=function(_0x2c7199){return new BPromise(function(_0x5c3f51,_0x4cc193){exec(_0x2c7199,function(_0x2cda44,_0x59b8f9,_0x30e64c){logger[_0xc59d('0x7')]('Exec\x20gs',_0x59b8f9);if(_0x2cda44){logger[_0xc59d('0x7')](_0xc59d('0x8'),'\x20Error\x20:',util[_0xc59d('0x9')](_0x2cda44,{'showHidden':![],'depth':null}),_0x59b8f9,_0x30e64c);_0x4cc193(_0x2cda44);}_0x5c3f51(_0x59b8f9);});});};
\ No newline at end of file
+var _0xca39=['\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird','exec','execute','info','Exec\x20gs'];(function(_0xe28870,_0x252764){var _0x2cd2eb=function(_0x4c6e2a){while(--_0x4c6e2a){_0xe28870['push'](_0xe28870['shift']());}};_0x2cd2eb(++_0x252764);}(_0xca39,0x84));var _0x9ca3=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xca39[_0x5b644e];return _0x49c6bf;};'use strict';var util=require(_0x9ca3('0x0'));var logger=require(_0x9ca3('0x1'))(_0x9ca3('0x2'));var BPromise=require(_0x9ca3('0x3'));var exec=require('child_process')[_0x9ca3('0x4')];exports[_0x9ca3('0x5')]=function(_0x221387){return new BPromise(function(_0x578c89,_0x563f6d){exec(_0x221387,function(_0x595bee,_0x2cf779,_0x266a37){logger[_0x9ca3('0x6')](_0x9ca3('0x7'),_0x2cf779);if(_0x595bee){logger[_0x9ca3('0x6')]('Exec\x20gs',_0x9ca3('0x8'),util[_0x9ca3('0x9')](_0x595bee,{'showHidden':![],'depth':null}),_0x2cf779,_0x266a37);_0x563f6d(_0x595bee);}_0x578c89(_0x2cf779);});});};
\ No newline at end of file
index 97472ac..a7aeb17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbee3=['uniqueid','originate','channel','xcally-motion-fax','\x22%s\x22\x20<%s>','headerinfo','util','lodash','moment','fax','logger','info','addVariables','ecm','maxrate','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path'];(function(_0x3a596d,_0x408752){var _0x42147e=function(_0x25cee8){while(--_0x25cee8){_0x3a596d['push'](_0x3a596d['shift']());}};_0x42147e(++_0x408752);}(_0xbee3,0x1ea));var _0x3bee=function(_0x498f45,_0x33a0d7){_0x498f45=_0x498f45-0x0;var _0x5dedf1=_0xbee3[_0x498f45];return _0x5dedf1;};'use strict';var util=require(_0x3bee('0x0'));var _=require(_0x3bee('0x1'));var moment=require(_0x3bee('0x2'));var logger=require('../../../../config/logger')(_0x3bee('0x3'));exports['message']=function(_0x20d41e){return{'message':_0x20d41e};};exports[_0x3bee('0x4')]=function(_0x19a838,_0x36ff33){logger[_0x3bee('0x5')](_0x19a838,util['inspect'](_0x36ff33,{'showHidden':![],'depth':null}));};exports[_0x3bee('0x6')]=function(_0x2257ea,_0x4e01ba){var _0x3f8e2a={'XMF-ECM':_0x4e01ba[_0x3bee('0x7')],'XMF-HEADERINFO':_0x4e01ba['headerinfo'],'XMF-MINRATE':_0x4e01ba['minrate'],'XMF-MAXRATE':_0x4e01ba[_0x3bee('0x8')],'XMF-MODEM':util['format'](_0x3bee('0x9'),_0x4e01ba[_0x3bee('0xa')]),'XMF-GATEWAY':_0x4e01ba[_0x3bee('0xb')],'XMF-FAXDETECT':_0x4e01ba[_0x3bee('0xc')],'XMF-T38TIMEOUT':_0x4e01ba[_0x3bee('0xd')],'XMF-LOCALSTATIONID':_0x4e01ba[_0x3bee('0xe')],'XMF-PATH':_0x2257ea[_0x3bee('0xf')]};return _0x3f8e2a;};exports['variablesAction']=function(_0x2233ee,_0x327de5){return{'actionid':_0x2233ee[_0x3bee('0x10')],'action':_0x3bee('0x11'),'channel':_0x2233ee[_0x3bee('0x12')],'Exten':_0x3bee('0x13'),'Context':'from-sip','Priority':'1','callerid':util['format'](_0x3bee('0x14'),_0x2233ee[_0x3bee('0x15')]?_0x2233ee[_0x3bee('0x15')]:'',_0x2233ee[_0x3bee('0xe')]),'variable':_0x327de5,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2233ee[_0x3bee('0x10')]};};
\ No newline at end of file
+var _0xdfe0=['uniqueid','util','lodash','moment','../../../../config/logger','fax','message','info','inspect','ecm','headerinfo','minrate','\x22%s\x22','modem','gateway','faxdetect','localstationid','path','variablesAction','channel','xcally-motion-fax','from-sip'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xdfe0,0x85));var _0x0dfe=function(_0x40ef43,_0x4df08e){_0x40ef43=_0x40ef43-0x0;var _0x3182f4=_0xdfe0[_0x40ef43];return _0x3182f4;};'use strict';var util=require(_0x0dfe('0x0'));var _=require(_0x0dfe('0x1'));var moment=require(_0x0dfe('0x2'));var logger=require(_0x0dfe('0x3'))(_0x0dfe('0x4'));exports[_0x0dfe('0x5')]=function(_0x114f67){return{'message':_0x114f67};};exports['logger']=function(_0x513e0e,_0x30ea02){logger[_0x0dfe('0x6')](_0x513e0e,util[_0x0dfe('0x7')](_0x30ea02,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x521025,_0x237b43){var _0x25dba1={'XMF-ECM':_0x237b43[_0x0dfe('0x8')],'XMF-HEADERINFO':_0x237b43[_0x0dfe('0x9')],'XMF-MINRATE':_0x237b43[_0x0dfe('0xa')],'XMF-MAXRATE':_0x237b43['maxrate'],'XMF-MODEM':util['format'](_0x0dfe('0xb'),_0x237b43[_0x0dfe('0xc')]),'XMF-GATEWAY':_0x237b43[_0x0dfe('0xd')],'XMF-FAXDETECT':_0x237b43[_0x0dfe('0xe')],'XMF-T38TIMEOUT':_0x237b43['t38timeout'],'XMF-LOCALSTATIONID':_0x237b43[_0x0dfe('0xf')],'XMF-PATH':_0x521025[_0x0dfe('0x10')]};return _0x25dba1;};exports[_0x0dfe('0x11')]=function(_0x52c90a,_0x6a934d){return{'actionid':_0x52c90a['uniqueid'],'action':'originate','channel':_0x52c90a[_0x0dfe('0x12')],'Exten':_0x0dfe('0x13'),'Context':_0x0dfe('0x14'),'Priority':'1','callerid':util['format']('\x22%s\x22\x20<%s>',_0x52c90a[_0x0dfe('0x9')]?_0x52c90a['headerinfo']:'',_0x52c90a['localstationid']),'variable':_0x6a934d,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x52c90a[_0x0dfe('0x15')]};};
\ No newline at end of file
index 0fc9e94..de54507 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4da9=['getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','log','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','hour','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts'];(function(_0x1f29b2,_0x1db7a2){var _0x1c8c2f=function(_0x2ad5b0){while(--_0x2ad5b0){_0x1f29b2['push'](_0x1f29b2['shift']());}};_0x1c8c2f(++_0x1db7a2);}(_0x4da9,0x158));var _0x94da=function(_0x78937a,_0x45058b){_0x78937a=_0x78937a-0x0;var _0xd5e2e9=_0x4da9[_0x78937a];return _0xd5e2e9;};'use strict';var BPromise=require(_0x94da('0x0'));var util=require(_0x94da('0x1'));var moment=require(_0x94da('0x2'));var server=require(_0x94da('0x3'));var Realtime=require(_0x94da('0x4'));var Report=require(_0x94da('0x5'));var Acw=require(_0x94da('0x6'));var Trigger=require(_0x94da('0x7'));var Dialer=require('./dialer');var Preview=require('./preview');var Fax=require('./fax');var user=require(_0x94da('0x8'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x94da('0x9'));var voiceCallReport=require(_0x94da('0xa'));var trunk=require('./rpc/trunk');var trigger=require(_0x94da('0xb'));var template=require(_0x94da('0xc'));var cmHopperHistory=require(_0x94da('0xd'));var campaign=require(_0x94da('0xe'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x94da('0xf'));var zendesk=require(_0x94da('0x10'));var salesforce=require(_0x94da('0x11'));var sugarcrm=require(_0x94da('0x12'));var freshdesk=require(_0x94da('0x13'));var desk=require(_0x94da('0x14'));var zoho=require(_0x94da('0x15'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x94da('0x16'));var servicenow=require(_0x94da('0x17'));var dynamics365=require(_0x94da('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x94da('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x94da('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x94da('0x1a')](user[_0x94da('0x1b')]())['then'](realtime[_0x94da('0x1c')]())[_0x94da('0x1a')](user[_0x94da('0x1d')]())[_0x94da('0x1a')](realtime[_0x94da('0x1e')]())['then'](trunk[_0x94da('0x1f')]())['then'](realtime[_0x94da('0x20')]())['then'](voiceQueue[_0x94da('0x21')]())[_0x94da('0x1a')](realtime['initVoiceQueues']())[_0x94da('0x1a')](trigger['getTriggers']())[_0x94da('0x1a')](realtime['initTriggers']())['then'](template[_0x94da('0x22')]())[_0x94da('0x1a')](realtime[_0x94da('0x23')]())['then'](zendesk['getZendeskAccounts']())[_0x94da('0x1a')](realtime[_0x94da('0x24')]())[_0x94da('0x1a')](salesforce[_0x94da('0x25')]())[_0x94da('0x1a')](realtime[_0x94da('0x26')]())[_0x94da('0x1a')](sugarcrm[_0x94da('0x27')]())['then'](realtime['initSugarcrmAccounts']())['then'](freshdesk['getFreshdeskAccounts']())[_0x94da('0x1a')](realtime['initFreshdeskAccounts']())[_0x94da('0x1a')](desk[_0x94da('0x28')]())[_0x94da('0x1a')](realtime[_0x94da('0x29')]())[_0x94da('0x1a')](zoho['getZohoAccounts']())[_0x94da('0x1a')](realtime[_0x94da('0x2a')]())[_0x94da('0x1a')](vtiger[_0x94da('0x2b')]())[_0x94da('0x1a')](realtime[_0x94da('0x2c')]())[_0x94da('0x1a')](freshsales[_0x94da('0x2d')]())['then'](realtime[_0x94da('0x2e')]())[_0x94da('0x1a')](servicenow[_0x94da('0x2f')]())['then'](realtime[_0x94da('0x30')]())[_0x94da('0x1a')](dynamics365[_0x94da('0x31')]())[_0x94da('0x1a')](realtime['initDynamics365Accounts']())[_0x94da('0x1a')](campaign[_0x94da('0x32')]())[_0x94da('0x1a')](realtime['initCampaigns']())[_0x94da('0x1a')](voiceExtension[_0x94da('0x33')]())[_0x94da('0x1a')](realtime['initVoiceExtensions']())[_0x94da('0x1a')](faxAccount[_0x94da('0x34')]())[_0x94da('0x1a')](realtime[_0x94da('0x35')]())[_0x94da('0x1a')](function(){return realtime;});}function initParams(){return BPromise[_0x94da('0x36')]()[_0x94da('0x1a')](voiceQueueReport[_0x94da('0x37')]())[_0x94da('0x1a')](realtime[_0x94da('0x38')]())[_0x94da('0x1a')](cmHopperHistory[_0x94da('0x39')]())['then'](realtime[_0x94da('0x3a')]())[_0x94da('0x1a')](cmHopperHistory[_0x94da('0x3b')]())[_0x94da('0x1a')](realtime[_0x94da('0x3c')]())[_0x94da('0x1a')](voiceCallReport['getVoiceCallReports']())[_0x94da('0x1a')](realtime[_0x94da('0x3d')]())[_0x94da('0x1a')](function(_0x56c975){})['catch'](function(_0x311d3b){console['log'](_0x311d3b);});}function main(){return server['listen'](realtime,preview,fax)[_0x94da('0x1a')](function(_0x331af4){return initRealtime();})['then'](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x94da('0x3e')](function(_0x15f241){console[_0x94da('0x3f')](_0x15f241);});}main();
\ No newline at end of file
+var _0xfe1c=['./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','get','hour','resolve','then','getAgents','initAgents','getTrunks','initTrunks','initVoiceQueues','getTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','listen','log','util','moment','./server','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount'];(function(_0xc054d1,_0x327b08){var _0x3e67dd=function(_0x38da3a){while(--_0x38da3a){_0xc054d1['push'](_0xc054d1['shift']());}};_0x3e67dd(++_0x327b08);}(_0xfe1c,0x13d));var _0xcfe1=function(_0x11988d,_0x5a0605){_0x11988d=_0x11988d-0x0;var _0x5468e0=_0xfe1c[_0x11988d];return _0x5468e0;};'use strict';var BPromise=require('bluebird');var util=require(_0xcfe1('0x0'));var moment=require(_0xcfe1('0x1'));var server=require(_0xcfe1('0x2'));var Realtime=require('./realtime');var Report=require(_0xcfe1('0x3'));var Acw=require(_0xcfe1('0x4'));var Trigger=require(_0xcfe1('0x5'));var Dialer=require(_0xcfe1('0x6'));var Preview=require(_0xcfe1('0x7'));var Fax=require(_0xcfe1('0x8'));var user=require('./rpc/user');var voiceQueue=require(_0xcfe1('0x9'));var voiceQueueReport=require(_0xcfe1('0xa'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0xcfe1('0xb'));var trigger=require(_0xcfe1('0xc'));var template=require(_0xcfe1('0xd'));var cmHopperHistory=require(_0xcfe1('0xe'));var campaign=require(_0xcfe1('0xf'));var voiceExtension=require(_0xcfe1('0x10'));var faxAccount=require(_0xcfe1('0x11'));var zendesk=require(_0xcfe1('0x12'));var salesforce=require(_0xcfe1('0x13'));var sugarcrm=require(_0xcfe1('0x14'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0xcfe1('0x15'));var zoho=require(_0xcfe1('0x16'));var vtiger=require(_0xcfe1('0x17'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0xcfe1('0x18'));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()[_0xcfe1('0x19')](_0xcfe1('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xcfe1('0x19')](_0xcfe1('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xcfe1('0x1b')]()[_0xcfe1('0x1c')](user[_0xcfe1('0x1d')]())[_0xcfe1('0x1c')](realtime[_0xcfe1('0x1e')]())[_0xcfe1('0x1c')](user['getTelephones']())[_0xcfe1('0x1c')](realtime['initTelephones']())[_0xcfe1('0x1c')](trunk[_0xcfe1('0x1f')]())[_0xcfe1('0x1c')](realtime[_0xcfe1('0x20')]())['then'](voiceQueue['getVoiceQueues']())[_0xcfe1('0x1c')](realtime[_0xcfe1('0x21')]())[_0xcfe1('0x1c')](trigger[_0xcfe1('0x22')]())[_0xcfe1('0x1c')](realtime['initTriggers']())['then'](template['getTemplates']())[_0xcfe1('0x1c')](realtime[_0xcfe1('0x23')]())[_0xcfe1('0x1c')](zendesk[_0xcfe1('0x24')]())['then'](realtime[_0xcfe1('0x25')]())[_0xcfe1('0x1c')](salesforce[_0xcfe1('0x26')]())['then'](realtime['initSalesforceAccounts']())[_0xcfe1('0x1c')](sugarcrm[_0xcfe1('0x27')]())['then'](realtime[_0xcfe1('0x28')]())['then'](freshdesk[_0xcfe1('0x29')]())[_0xcfe1('0x1c')](realtime[_0xcfe1('0x2a')]())[_0xcfe1('0x1c')](desk[_0xcfe1('0x2b')]())[_0xcfe1('0x1c')](realtime[_0xcfe1('0x2c')]())[_0xcfe1('0x1c')](zoho['getZohoAccounts']())[_0xcfe1('0x1c')](realtime[_0xcfe1('0x2d')]())[_0xcfe1('0x1c')](vtiger[_0xcfe1('0x2e')]())['then'](realtime[_0xcfe1('0x2f')]())[_0xcfe1('0x1c')](freshsales['getFreshsalesAccounts']())[_0xcfe1('0x1c')](realtime[_0xcfe1('0x30')]())[_0xcfe1('0x1c')](servicenow[_0xcfe1('0x31')]())[_0xcfe1('0x1c')](realtime[_0xcfe1('0x32')]())[_0xcfe1('0x1c')](dynamics365[_0xcfe1('0x33')]())[_0xcfe1('0x1c')](realtime[_0xcfe1('0x34')]())['then'](campaign[_0xcfe1('0x35')]())['then'](realtime[_0xcfe1('0x36')]())['then'](voiceExtension[_0xcfe1('0x37')]())[_0xcfe1('0x1c')](realtime[_0xcfe1('0x38')]())[_0xcfe1('0x1c')](faxAccount[_0xcfe1('0x39')]())[_0xcfe1('0x1c')](realtime[_0xcfe1('0x3a')]())[_0xcfe1('0x1c')](function(){return realtime;});}function initParams(){return BPromise[_0xcfe1('0x1b')]()[_0xcfe1('0x1c')](voiceQueueReport[_0xcfe1('0x3b')]())[_0xcfe1('0x1c')](realtime[_0xcfe1('0x3c')]())[_0xcfe1('0x1c')](cmHopperHistory[_0xcfe1('0x3d')]())[_0xcfe1('0x1c')](realtime[_0xcfe1('0x3e')]())[_0xcfe1('0x1c')](cmHopperHistory[_0xcfe1('0x3f')]())[_0xcfe1('0x1c')](realtime['initCampaignHopperHistory']())[_0xcfe1('0x1c')](voiceCallReport[_0xcfe1('0x40')]())[_0xcfe1('0x1c')](realtime['initVoiceCallReports']())[_0xcfe1('0x1c')](function(_0xdcdd0d){})['catch'](function(_0xfb1759){console['log'](_0xfb1759);});}function main(){return server[_0xcfe1('0x41')](realtime,preview,fax)[_0xcfe1('0x1c')](function(_0x1d58b6){return initRealtime();})['then'](function(){return initParams();})[_0xcfe1('0x1c')](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x3038c7){console[_0xcfe1('0x42')](_0x3038c7);});}main();
\ No newline at end of file
index 3430ea6..889cd98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusQueue','onhold','local','updateStatusRealtime','state','idle','inuse','talking','statePause','voiceStatusTime','toNumber','voiceStatusCallerIdNumber','stringify','format','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','defaults','redis','socket.io-emitter'];(function(_0x5563de,_0x3590a5){var _0x5ca6de=function(_0x48cc84){while(--_0x48cc84){_0x5563de['push'](_0x5563de['shift']());}};_0x5ca6de(++_0x3590a5);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4164f2,_0x38669f){_0x4164f2=_0x4164f2-0x0;var _0x2575c7=_0xcb91[_0x4164f2];return _0x2575c7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var md5=require(_0x1cb9('0x1'));var Redis=require(_0x1cb9('0x2'));var config=require(_0x1cb9('0x3'));config['redis']=_[_0x1cb9('0x4')](config[_0x1cb9('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x1cb9('0x6'))(new Redis(config[_0x1cb9('0x5')]));function Agent(_0x53ffbd){this['id']=_0x53ffbd['id']||0x0;this[_0x1cb9('0x7')]=_0x53ffbd[_0x1cb9('0x7')]||'';this['email']=_0x53ffbd[_0x1cb9('0x8')]||'';this[_0x1cb9('0x9')]=_0x53ffbd['accountcode']||'';this[_0x1cb9('0xa')]=_0x53ffbd['fullname']||'';this['state']=_0x1cb9('0xb');this[_0x1cb9('0xc')]=0x0;this[_0x1cb9('0xd')]=_0x1cb9('0xb');this[_0x1cb9('0xe')]='';this['phone']='';this[_0x1cb9('0xf')]='';this[_0x1cb9('0x10')]='';this[_0x1cb9('0x11')]=_0x53ffbd[_0x1cb9('0x11')]||![];this[_0x1cb9('0x12')]='unknown';this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x1cb9('0x13')]='';this[_0x1cb9('0x14')]=![];this[_0x1cb9('0x15')]=![];this[_0x1cb9('0x1')]='';}Agent['prototype'][_0x1cb9('0x16')]=function(_0x6ef389){var _0x1b3cd7;if(_0x6ef389&&_0x6ef389[_0x1cb9('0x17')]){_0x1b3cd7=_0x6ef389[_0x1cb9('0x17')]['toLowerCase']();switch(_0x1b3cd7){case'not_inuse':_0x1b3cd7=_0x1cb9('0x18');break;case _0x1cb9('0x19'):_0x1b3cd7=_0x1cb9('0x1a');break;}}if(_0x1b3cd7&&this[_0x1cb9('0x12')]!==_0x1b3cd7||_0x6ef389[_0x1cb9('0x1b')]){this[_0x1cb9('0x1c')]=_[_0x1cb9('0x1d')](moment()['format']('x'));}if(_0x1b3cd7){this['voiceStatus']=_0x1b3cd7;}var _0x1b2fa6={'id':this['id'],'name':this[_0x1cb9('0x7')],'email':this[_0x1cb9('0x8')],'accountcode':this[_0x1cb9('0x9')],'fullname':this[_0x1cb9('0xa')],'state':this[_0x1cb9('0x17')],'stateTime':this[_0x1cb9('0xc')],'status':this['status'],'address':this['address'],'online':this[_0x1cb9('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x1cb9('0x1c')],'voiceStatusCallerIdNumber':this[_0x1cb9('0x1e')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0x1cb9('0x14')]};var _0x325637=md5(JSON[_0x1cb9('0x1f')](_0x1b2fa6));if(this[_0x1cb9('0x1')]!==_0x325637){this[_0x1cb9('0x1')]=_0x325637;io['to'](util[_0x1cb9('0x20')]('user:%s',_0x1b2fa6['name']))[_0x1cb9('0x21')]('user:save',_0x1b2fa6);io[_0x1cb9('0x21')](_0x1cb9('0x22'),_0x1b2fa6);}};module[_0x1cb9('0x23')]=Agent;
\ No newline at end of file
+var _0x70e0=['name','voiceStatusQueue','onhold','stringify','md5','user:%s','user:save','emit','user:presence','lodash','util','moment','../../../config/environment','redis','defaults','socket.io-emitter','email','accountcode','fullname','state','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','local','toLowerCase','not_inuse','idle','inuse','statePause','toNumber','format'];(function(_0x1d5385,_0x17e29f){var _0x55ea1e=function(_0x781ffe){while(--_0x781ffe){_0x1d5385['push'](_0x1d5385['shift']());}};_0x55ea1e(++_0x17e29f);}(_0x70e0,0x17b));var _0x070e=function(_0x384638,_0x57f4ed){_0x384638=_0x384638-0x0;var _0x2e1a39=_0x70e0[_0x384638];return _0x2e1a39;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x070e('0x3'));config[_0x070e('0x4')]=_[_0x070e('0x5')](config[_0x070e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x6'))(new Redis(config['redis']));function Agent(_0x46fe68){this['id']=_0x46fe68['id']||0x0;this['name']=_0x46fe68['name']||'';this['email']=_0x46fe68[_0x070e('0x7')]||'';this[_0x070e('0x8')]=_0x46fe68[_0x070e('0x8')]||'';this[_0x070e('0x9')]=_0x46fe68[_0x070e('0x9')]||'';this[_0x070e('0xa')]=_0x070e('0xb');this['stateTime']=0x0;this['status']=_0x070e('0xb');this[_0x070e('0xc')]='';this[_0x070e('0xd')]='';this[_0x070e('0xe')]='';this[_0x070e('0xf')]='';this[_0x070e('0x10')]=_0x46fe68[_0x070e('0x10')]||![];this[_0x070e('0x11')]=_0x070e('0xb');this[_0x070e('0x12')]=0x0;this[_0x070e('0x13')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x070e('0x14')]=![];this['md5']='';}Agent['prototype']['updateStatusRealtime']=function(_0x11d2ce){var _0x14c3fd;if(_0x11d2ce&&_0x11d2ce['state']){_0x14c3fd=_0x11d2ce['state'][_0x070e('0x15')]();switch(_0x14c3fd){case _0x070e('0x16'):_0x14c3fd=_0x070e('0x17');break;case _0x070e('0x18'):_0x14c3fd='talking';break;}}if(_0x14c3fd&&this['voiceStatus']!==_0x14c3fd||_0x11d2ce[_0x070e('0x19')]){this[_0x070e('0x12')]=_[_0x070e('0x1a')](moment()[_0x070e('0x1b')]('x'));}if(_0x14c3fd){this[_0x070e('0x11')]=_0x14c3fd;}var _0x5037eb={'id':this['id'],'name':this[_0x070e('0x1c')],'email':this[_0x070e('0x7')],'accountcode':this[_0x070e('0x8')],'fullname':this[_0x070e('0x9')],'state':this[_0x070e('0xa')],'stateTime':this['stateTime'],'status':this['status'],'address':this['address'],'online':this[_0x070e('0x10')],'voiceStatus':this[_0x070e('0x11')],'voiceStatusTime':this[_0x070e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x070e('0x1d')],'interface':this['interface'],'onhold':this[_0x070e('0x1e')]};var _0x3f6985=md5(JSON[_0x070e('0x1f')](_0x5037eb));if(this[_0x070e('0x20')]!==_0x3f6985){this[_0x070e('0x20')]=_0x3f6985;io['to'](util[_0x070e('0x1b')](_0x070e('0x21'),_0x5037eb[_0x070e('0x1c')]))['emit'](_0x070e('0x22'),_0x5037eb);io[_0x070e('0x23')](_0x070e('0x24'),_0x5037eb);}};module['exports']=Agent;
\ No newline at end of file
index 51ce4c5..d55d012 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5694=['dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','temp','ivrAnswerCallsDay','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence'];(function(_0x4a591e,_0x16f954){var _0x57a6ea=function(_0x26ca66){while(--_0x26ca66){_0x4a591e['push'](_0x4a591e['shift']());}};_0x57a6ea(++_0x16f954);}(_0x5694,0x1f2));var _0x4569=function(_0x54673a,_0x233063){_0x54673a=_0x54673a-0x0;var _0x22d19f=_0x5694[_0x54673a];return _0x22d19f;};'use strict';function Campaign(_0x1e595){this['id']=_0x1e595['id']||0x0;this[_0x4569('0x0')]=_0x1e595[_0x4569('0x0')]||'';this['type']=_0x1e595[_0x4569('0x1')]||_0x4569('0x2');this[_0x4569('0x3')]=0x0;this[_0x4569('0x4')]=0x0;this[_0x4569('0x5')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x4569('0x6')]='';this[_0x4569('0x7')]=!![];this[_0x4569('0x8')]=_0x1e595[_0x4569('0x8')];this['limitCalls']=_0x1e595[_0x4569('0x9')];this[_0x4569('0xa')]=_0x1e595[_0x4569('0xa')]||null;this[_0x4569('0xb')]=_0x1e595[_0x4569('0xb')]?_0x1e595['dialGlobalInterval']:null;this[_0x4569('0xc')]=_0x1e595[_0x4569('0xc')];this[_0x4569('0xd')]=_0x1e595[_0x4569('0xd')];this[_0x4569('0xe')]=_0x1e595['dialOriginateTimeout']||0x1e;this['dialCongestionMaxRetry']=_0x1e595[_0x4569('0xf')];this[_0x4569('0x10')]=_0x1e595[_0x4569('0x10')];this[_0x4569('0x11')]=_0x1e595['dialBusyMaxRetry'];this[_0x4569('0x12')]=_0x1e595['dialBusyRetryFrequency'];this[_0x4569('0x13')]=_0x1e595[_0x4569('0x13')];this[_0x4569('0x14')]=_0x1e595[_0x4569('0x14')];this[_0x4569('0x15')]=_0x1e595[_0x4569('0x15')];this['dialNoSuchNumberMaxRetry']=_0x1e595['dialNoSuchNumberMaxRetry']||0x3;this[_0x4569('0x16')]=_0x1e595[_0x4569('0x16')]||0x96;this['dialDropMaxRetry']=_0x1e595[_0x4569('0x17')]||0x3;this['dialDropRetryFrequency']=_0x1e595['dialDropRetryFrequency']||0x96;this[_0x4569('0x18')]=_0x1e595['dialAbandonedMaxRetry']||0x3;this[_0x4569('0x19')]=_0x1e595['dialAbandonedRetryFrequency']||0x96;this[_0x4569('0x1a')]=_0x1e595[_0x4569('0x1a')]||0x3;this['dialMachineRetryFrequency']=_0x1e595[_0x4569('0x1b')]||0x96;this[_0x4569('0x1c')]=_0x1e595['dialAgentRejectMaxRetry']||0x3;this[_0x4569('0x1d')]=_0x1e595[_0x4569('0x1d')]||0x96;this['dialOrderByScheduledAt']=_0x1e595[_0x4569('0x1e')]||_0x4569('0x1f');this['dialPrefix']=_0x1e595['dialPrefix']||undefined;this[_0x4569('0x20')]=_0x1e595[_0x4569('0x20')]||undefined;this[_0x4569('0x21')]=_0x1e595[_0x4569('0x21')]||undefined;this[_0x4569('0x22')]=_0x1e595['TrunkBackup']?_0x1e595[_0x4569('0x22')]:undefined;this[_0x4569('0x23')]=_0x1e595[_0x4569('0x23')]?_0x1e595[_0x4569('0x23')]:undefined;this[_0x4569('0x24')]=_0x1e595['Interval']?_0x1e595[_0x4569('0x24')]:undefined;this[_0x4569('0x25')]=_0x1e595[_0x4569('0x25')]?_0x1e595[_0x4569('0x25')]:undefined;this[_0x4569('0x26')]=_0x1e595[_0x4569('0x25')]?_0x1e595[_0x4569('0x25')]['name']:undefined;this[_0x4569('0x27')]=_0x1e595[_0x4569('0x27')]||![];this[_0x4569('0x28')]=_0x1e595['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x1e595[_0x4569('0x29')];this[_0x4569('0x2a')]=_0x1e595[_0x4569('0x2a')];this[_0x4569('0x2b')]=_0x1e595[_0x4569('0x2b')];this[_0x4569('0x2c')]=_0x1e595[_0x4569('0x2c')];this[_0x4569('0x2d')]=_0x1e595[_0x4569('0x2d')];this[_0x4569('0x2e')]=_0x1e595['dialAMDMaximumNumberOfWords'];this[_0x4569('0x2f')]=_0x1e595[_0x4569('0x2f')];this[_0x4569('0x30')]=_0x1e595[_0x4569('0x30')];}module['exports']=Campaign;
\ No newline at end of file
+var _0x35d9=['dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','name','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','type','campaign','temp','ivrAnswerCallsDay','ivrTotalCallsDays','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry'];(function(_0xab0515,_0x4b8ab2){var _0x443d59=function(_0xfd6c59){while(--_0xfd6c59){_0xab0515['push'](_0xab0515['shift']());}};_0x443d59(++_0x4b8ab2);}(_0x35d9,0xe6));var _0x935d=function(_0x7a4c3,_0x365412){_0x7a4c3=_0x7a4c3-0x0;var _0x22ca82=_0x35d9[_0x7a4c3];return _0x22ca82;};'use strict';function Campaign(_0x497929){this['id']=_0x497929['id']||0x0;this['name']=_0x497929['name']||'';this[_0x935d('0x0')]=_0x497929[_0x935d('0x0')]||_0x935d('0x1');this['originated']=0x0;this[_0x935d('0x2')]=0x0;this[_0x935d('0x3')]=0x0;this[_0x935d('0x4')]=0x0;this['message']='';this['sendMessageOneNotActive']=!![];this['active']=_0x497929[_0x935d('0x5')];this[_0x935d('0x6')]=_0x497929[_0x935d('0x6')];this[_0x935d('0x7')]=_0x497929[_0x935d('0x7')]||null;this[_0x935d('0x8')]=_0x497929[_0x935d('0x8')]?_0x497929[_0x935d('0x8')]:null;this[_0x935d('0x9')]=_0x497929[_0x935d('0x9')];this[_0x935d('0xa')]=_0x497929[_0x935d('0xa')];this[_0x935d('0xb')]=_0x497929[_0x935d('0xb')]||0x1e;this[_0x935d('0xc')]=_0x497929[_0x935d('0xc')];this[_0x935d('0xd')]=_0x497929[_0x935d('0xd')];this[_0x935d('0xe')]=_0x497929[_0x935d('0xe')];this[_0x935d('0xf')]=_0x497929['dialBusyRetryFrequency'];this[_0x935d('0x10')]=_0x497929['dialNoAnswerMaxRetry'];this[_0x935d('0x11')]=_0x497929[_0x935d('0x11')];this[_0x935d('0x12')]=_0x497929[_0x935d('0x12')];this[_0x935d('0x13')]=_0x497929[_0x935d('0x13')]||0x3;this[_0x935d('0x14')]=_0x497929[_0x935d('0x14')]||0x96;this[_0x935d('0x15')]=_0x497929[_0x935d('0x15')]||0x3;this[_0x935d('0x16')]=_0x497929['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x497929[_0x935d('0x17')]||0x3;this[_0x935d('0x18')]=_0x497929[_0x935d('0x18')]||0x96;this[_0x935d('0x19')]=_0x497929[_0x935d('0x19')]||0x3;this[_0x935d('0x1a')]=_0x497929[_0x935d('0x1a')]||0x96;this[_0x935d('0x1b')]=_0x497929[_0x935d('0x1b')]||0x3;this['dialAgentRejectRetryFrequency']=_0x497929[_0x935d('0x1c')]||0x96;this['dialOrderByScheduledAt']=_0x497929[_0x935d('0x1d')]||'DESC';this[_0x935d('0x1e')]=_0x497929[_0x935d('0x1e')]||undefined;this[_0x935d('0x1f')]=_0x497929[_0x935d('0x1f')]||undefined;this[_0x935d('0x20')]=_0x497929['dialCutDigit']||undefined;this[_0x935d('0x21')]=_0x497929['TrunkBackup']?_0x497929[_0x935d('0x21')]:undefined;this[_0x935d('0x22')]=_0x497929['Trunk']?_0x497929[_0x935d('0x22')]:undefined;this[_0x935d('0x23')]=_0x497929[_0x935d('0x23')]?_0x497929['Interval']:undefined;this['SquareProject']=_0x497929[_0x935d('0x24')]?_0x497929[_0x935d('0x24')]:undefined;this[_0x935d('0x25')]=_0x497929[_0x935d('0x24')]?_0x497929[_0x935d('0x24')][_0x935d('0x26')]:undefined;this[_0x935d('0x27')]=_0x497929[_0x935d('0x27')]||![];this['dialAMDInitialSilence']=_0x497929[_0x935d('0x28')];this[_0x935d('0x29')]=_0x497929[_0x935d('0x29')];this['dialAMDAfterGreetingSilence']=_0x497929[_0x935d('0x2a')];this[_0x935d('0x2b')]=_0x497929[_0x935d('0x2b')];this[_0x935d('0x2c')]=_0x497929['dialAMDMinWordLength'];this[_0x935d('0x2d')]=_0x497929[_0x935d('0x2d')];this[_0x935d('0x2e')]=_0x497929[_0x935d('0x2e')];this['dialAMDSilenceThreshold']=_0x497929[_0x935d('0x2f')];this[_0x935d('0x30')]=_0x497929[_0x935d('0x30')];}module[_0x935d('0x31')]=Campaign;
\ No newline at end of file
index 597dcd3..77a839e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6244=['calleridname','connectedlinenum','connectedlinename','accountcode','uniqueid','linkedid','exten','answered','answertime','endtime','abandoned','lastdata','duration','billableseconds','type','tag','disposition','monitor','queue','monitors','transfercalleridnum','transferType','mohtime','exports','starttime','channel','calleridnum'];(function(_0x37c455,_0xbe5637){var _0x3ff4a0=function(_0xb3191b){while(--_0xb3191b){_0x37c455['push'](_0x37c455['shift']());}};_0x3ff4a0(++_0xbe5637);}(_0x6244,0x1ad));var _0x4624=function(_0x346741,_0x534b43){_0x346741=_0x346741-0x0;var _0x2047e5=_0x6244[_0x346741];return _0x2047e5;};'use strict';function Channel(){this[_0x4624('0x0')]=null;this[_0x4624('0x1')]='';this['destinationchannel']='';this[_0x4624('0x2')]=0x0;this[_0x4624('0x3')]='';this[_0x4624('0x4')]=undefined;this[_0x4624('0x5')]=undefined;this[_0x4624('0x6')]=0x0;this['context']='';this[_0x4624('0x7')]=0x0;this[_0x4624('0x8')]=0x0;this[_0x4624('0x9')]=0x0;this[_0x4624('0xa')]=![];this[_0x4624('0xb')]=null;this[_0x4624('0xc')]=null;this['unmanaged']=![];this[_0x4624('0xd')]=![];this['lastapplication']='';this[_0x4624('0xe')]='';this[_0x4624('0xf')]=0x0;this[_0x4624('0x10')]=0x0;this['holdtime']=0x0;this[_0x4624('0x11')]=null;this[_0x4624('0x12')]=null;this[_0x4624('0x13')]=null;this[_0x4624('0x14')]=![];this['monitorFilename']=null;this[_0x4624('0x15')]=null;this[_0x4624('0x16')]=[];this[_0x4624('0x17')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x4624('0x18')]=undefined;this[_0x4624('0x19')]=0x0;}module[_0x4624('0x1a')]=Channel;
\ No newline at end of file
+var _0x782b=['mohtime','exports','destinationchannel','calleridname','connectedlinenum','connectedlinename','context','uniqueid','linkedid','exten','answered','answertime','endtime','abandoned','lastapplication','lastdata','duration','holdtime','type','tag','disposition','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType'];(function(_0x1ed0d3,_0x7fceb2){var _0x3a1c39=function(_0x4f51f4){while(--_0x4f51f4){_0x1ed0d3['push'](_0x1ed0d3['shift']());}};_0x3a1c39(++_0x7fceb2);}(_0x782b,0x89));var _0xb782=function(_0x58cbdc,_0x16bb11){_0x58cbdc=_0x58cbdc-0x0;var _0x5d6f3d=_0x782b[_0x58cbdc];return _0x5d6f3d;};'use strict';function Channel(){this['starttime']=null;this['channel']='';this[_0xb782('0x0')]='';this['calleridnum']=0x0;this[_0xb782('0x1')]='';this[_0xb782('0x2')]=undefined;this[_0xb782('0x3')]=undefined;this['accountcode']=0x0;this[_0xb782('0x4')]='';this[_0xb782('0x5')]=0x0;this[_0xb782('0x6')]=0x0;this[_0xb782('0x7')]=0x0;this[_0xb782('0x8')]=![];this[_0xb782('0x9')]=null;this[_0xb782('0xa')]=null;this['unmanaged']=![];this[_0xb782('0xb')]=![];this[_0xb782('0xc')]='';this[_0xb782('0xd')]='';this[_0xb782('0xe')]=0x0;this['billableseconds']=0x0;this[_0xb782('0xf')]=0x0;this[_0xb782('0x10')]=null;this[_0xb782('0x11')]=null;this[_0xb782('0x12')]=null;this['monitor']=![];this[_0xb782('0x13')]=null;this[_0xb782('0x14')]=null;this[_0xb782('0x15')]=[];this[_0xb782('0x16')]=undefined;this[_0xb782('0x17')]=undefined;this[_0xb782('0x18')]=undefined;this[_0xb782('0x19')]=0x0;}module[_0xb782('0x1a')]=Channel;
\ No newline at end of file
index df53fb2..a3881ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f9a=['name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports'];(function(_0x410bad,_0x5e69e4){var _0x295eb8=function(_0x5ec5a5){while(--_0x5ec5a5){_0x410bad['push'](_0x410bad['shift']());}};_0x295eb8(++_0x5e69e4);}(_0x3f9a,0x1d4));var _0xa3f9=function(_0xb82940,_0x530318){_0xb82940=_0xb82940-0x0;var _0x2e152a=_0x3f9a[_0xb82940];return _0x2e152a;};'use strict';function DeskAccount(_0x1341ac){this['id']=_0x1341ac['id']||0x0;this[_0xa3f9('0x0')]=_0x1341ac[_0xa3f9('0x0')]||'';this['username']=_0x1341ac[_0xa3f9('0x1')]||'';this[_0xa3f9('0x2')]=_0x1341ac['remoteUri']||'';this[_0xa3f9('0x3')]=_0x1341ac[_0xa3f9('0x3')]||'';this[_0xa3f9('0x4')]=_0x1341ac['password']||'';this[_0xa3f9('0x5')]=_0x1341ac['consumerKey']||'';this[_0xa3f9('0x6')]=_0x1341ac[_0xa3f9('0x6')]||'';this[_0xa3f9('0x7')]=_0x1341ac[_0xa3f9('0x7')]||'';this[_0xa3f9('0x8')]=_0x1341ac[_0xa3f9('0x8')]||'';this['type']=_0x1341ac[_0xa3f9('0x9')]||'';this[_0xa3f9('0xa')]=_0x1341ac['serverUrl']||'';this[_0xa3f9('0xb')]=_0x1341ac[_0xa3f9('0xb')]||{};}module[_0xa3f9('0xc')]=DeskAccount;
\ No newline at end of file
+var _0x7fa5=['consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey'];(function(_0x4d44e7,_0x474f27){var _0x330d51=function(_0x3bb475){while(--_0x3bb475){_0x4d44e7['push'](_0x4d44e7['shift']());}};_0x330d51(++_0x474f27);}(_0x7fa5,0xb0));var _0x57fa=function(_0x498400,_0x9aeb4a){_0x498400=_0x498400-0x0;var _0x2eaae5=_0x7fa5[_0x498400];return _0x2eaae5;};'use strict';function DeskAccount(_0x1d84b9){this['id']=_0x1d84b9['id']||0x0;this[_0x57fa('0x0')]=_0x1d84b9['name']||'';this[_0x57fa('0x1')]=_0x1d84b9[_0x57fa('0x1')]||'';this[_0x57fa('0x2')]=_0x1d84b9['remoteUri']||'';this[_0x57fa('0x3')]=_0x1d84b9['authType']||'';this['password']=_0x1d84b9[_0x57fa('0x4')]||'';this[_0x57fa('0x5')]=_0x1d84b9['consumerKey']||'';this[_0x57fa('0x6')]=_0x1d84b9[_0x57fa('0x6')]||'';this[_0x57fa('0x7')]=_0x1d84b9[_0x57fa('0x7')]||'';this[_0x57fa('0x8')]=_0x1d84b9[_0x57fa('0x8')]||'';this['type']=_0x1d84b9[_0x57fa('0x9')]||'';this[_0x57fa('0xa')]=_0x1d84b9[_0x57fa('0xa')]||'';this[_0x57fa('0xb')]=_0x1d84b9[_0x57fa('0xb')]||{};}module[_0x57fa('0xc')]=DeskAccount;
\ No newline at end of file
index 1bfa016..3d20347 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['Configurations','exports','name','password','remoteUri','tenantId','clientId','clientSecret','serverUrl'];(function(_0xa63ea3,_0x4367ff){var _0x2aa5ff=function(_0x30dc84){while(--_0x30dc84){_0xa63ea3['push'](_0xa63ea3['shift']());}};_0x2aa5ff(++_0x4367ff);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';function Dynamics365Account(_0x5d04de){this['id']=_0x5d04de['id']||0x0;this[_0x0d8b('0x0')]=_0x5d04de['name']||'';this['username']=_0x5d04de['username']||'';this[_0x0d8b('0x1')]=_0x5d04de[_0x0d8b('0x1')]||'';this[_0x0d8b('0x2')]=_0x5d04de[_0x0d8b('0x2')]||'';this[_0x0d8b('0x3')]=_0x5d04de['tenantId']||'';this['clientId']=_0x5d04de[_0x0d8b('0x4')]||'';this[_0x0d8b('0x5')]=_0x5d04de[_0x0d8b('0x5')]||{};this['serverUrl']=_0x5d04de[_0x0d8b('0x6')]||'';this[_0x0d8b('0x7')]=_0x5d04de['Configurations']||{};}module[_0x0d8b('0x8')]=Dynamics365Account;
\ No newline at end of file
+var _0x5ff3=['exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations'];(function(_0x113db1,_0x275222){var _0x894ad=function(_0x46c664){while(--_0x46c664){_0x113db1['push'](_0x113db1['shift']());}};_0x894ad(++_0x275222);}(_0x5ff3,0x17d));var _0x35ff=function(_0x2bd570,_0xb32b5){_0x2bd570=_0x2bd570-0x0;var _0x3363a6=_0x5ff3[_0x2bd570];return _0x3363a6;};'use strict';function Dynamics365Account(_0x2fc021){this['id']=_0x2fc021['id']||0x0;this[_0x35ff('0x0')]=_0x2fc021['name']||'';this[_0x35ff('0x1')]=_0x2fc021['username']||'';this[_0x35ff('0x2')]=_0x2fc021[_0x35ff('0x2')]||'';this[_0x35ff('0x3')]=_0x2fc021[_0x35ff('0x3')]||'';this['tenantId']=_0x2fc021[_0x35ff('0x4')]||'';this[_0x35ff('0x5')]=_0x2fc021[_0x35ff('0x5')]||'';this[_0x35ff('0x6')]=_0x2fc021[_0x35ff('0x6')]||{};this['serverUrl']=_0x2fc021[_0x35ff('0x7')]||'';this['Configurations']=_0x2fc021[_0x35ff('0x8')]||{};}module[_0x35ff('0x9')]=Dynamics365Account;
\ No newline at end of file
index 7543a41..2cacb1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x632f=['v17,v27,v29','gateway','faxdetect','t38timeout','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem'];(function(_0x1ef805,_0x8dedd1){var _0x4b196d=function(_0x5acbd0){while(--_0x5acbd0){_0x1ef805['push'](_0x1ef805['shift']());}};_0x4b196d(++_0x8dedd1);}(_0x632f,0x1e5));var _0xf632=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x632f[_0x5d4607];return _0x5e4a86;};'use strict';function FaxAccount(_0x428c0f){this['id']=_0x428c0f['id']||0x0;this[_0xf632('0x0')]=_0x428c0f[_0xf632('0x0')]||'';this[_0xf632('0x1')]=_0x428c0f[_0xf632('0x1')];this[_0xf632('0x2')]=_0x428c0f[_0xf632('0x2')];this[_0xf632('0x3')]=_0x428c0f[_0xf632('0x3')];this[_0xf632('0x4')]=_0x428c0f[_0xf632('0x4')];this[_0xf632('0x5')]=_0x428c0f[_0xf632('0x5')]||0x960;this[_0xf632('0x6')]=_0x428c0f[_0xf632('0x6')]||0x3840;this[_0xf632('0x7')]=_0x428c0f['modem']||_0xf632('0x8');this[_0xf632('0x9')]=_0x428c0f['gateway']||'no';this['faxdetect']=_0x428c0f[_0xf632('0xa')]||'no';this[_0xf632('0xb')]=_0x428c0f[_0xf632('0xb')]||0x1388;this['tech']=_0x428c0f['tech']||_0xf632('0xc');this[_0xf632('0xd')]=_0x428c0f[_0xf632('0xd')]?_0x428c0f[_0xf632('0xd')]:undefined;this[_0xf632('0xe')]=_0x428c0f[_0xf632('0xe')];this[_0xf632('0xf')]=_0x428c0f[_0xf632('0xf')];}module[_0xf632('0x10')]=FaxAccount;
\ No newline at end of file
+var _0x2134=['minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid'];(function(_0x1780f8,_0x11ba93){var _0x33a410=function(_0x2a015f){while(--_0x2a015f){_0x1780f8['push'](_0x1780f8['shift']());}};_0x33a410(++_0x11ba93);}(_0x2134,0x12d));var _0x4213=function(_0x421716,_0x48f9f1){_0x421716=_0x421716-0x0;var _0x3c9ace=_0x2134[_0x421716];return _0x3c9ace;};'use strict';function FaxAccount(_0x5cb86d){this['id']=_0x5cb86d['id']||0x0;this[_0x4213('0x0')]=_0x5cb86d['name']||'';this[_0x4213('0x1')]=_0x5cb86d['description'];this[_0x4213('0x2')]=_0x5cb86d['ecm'];this[_0x4213('0x3')]=_0x5cb86d[_0x4213('0x3')];this[_0x4213('0x4')]=_0x5cb86d['localstationid'];this['minrate']=_0x5cb86d[_0x4213('0x5')]||0x960;this[_0x4213('0x6')]=_0x5cb86d['maxrate']||0x3840;this[_0x4213('0x7')]=_0x5cb86d['modem']||_0x4213('0x8');this[_0x4213('0x9')]=_0x5cb86d[_0x4213('0x9')]||'no';this['faxdetect']=_0x5cb86d[_0x4213('0xa')]||'no';this[_0x4213('0xb')]=_0x5cb86d[_0x4213('0xb')]||0x1388;this['tech']=_0x5cb86d['tech']||_0x4213('0xc');this[_0x4213('0xd')]=_0x5cb86d[_0x4213('0xd')]?_0x5cb86d[_0x4213('0xd')]:undefined;this[_0x4213('0xe')]=_0x5cb86d[_0x4213('0xe')];this['key']=_0x5cb86d[_0x4213('0xf')];}module[_0x4213('0x10')]=FaxAccount;
\ No newline at end of file
index 04beecc..6239e1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde33=['remoteUri','serverUrl','Configurations','exports','name','username','token'];(function(_0xda65c1,_0x5aa11a){var _0x26eb9e=function(_0x2d0386){while(--_0x2d0386){_0xda65c1['push'](_0xda65c1['shift']());}};_0x26eb9e(++_0x5aa11a);}(_0xde33,0xba));var _0x3de3=function(_0xe2002f,_0x42ded7){_0xe2002f=_0xe2002f-0x0;var _0x5e9477=_0xde33[_0xe2002f];return _0x5e9477;};'use strict';function FreshdeskAccount(_0x105e00){this['id']=_0x105e00['id']||0x0;this[_0x3de3('0x0')]=_0x105e00[_0x3de3('0x0')]||'';this[_0x3de3('0x1')]=_0x105e00['username']||'';this['apiKey']=_0x105e00[_0x3de3('0x2')]||'';this[_0x3de3('0x3')]=_0x105e00[_0x3de3('0x3')]||'';this[_0x3de3('0x4')]=_0x105e00[_0x3de3('0x4')]||'';this[_0x3de3('0x5')]=_0x105e00[_0x3de3('0x5')]||{};}module[_0x3de3('0x6')]=FreshdeskAccount;
\ No newline at end of file
+var _0x6a15=['username','apiKey','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x4c8185,_0x3a1b3f){var _0x438196=function(_0x565c47){while(--_0x565c47){_0x4c8185['push'](_0x4c8185['shift']());}};_0x438196(++_0x3a1b3f);}(_0x6a15,0x14f));var _0x56a1=function(_0x5696f0,_0x420779){_0x5696f0=_0x5696f0-0x0;var _0x4c78e5=_0x6a15[_0x5696f0];return _0x4c78e5;};'use strict';function FreshdeskAccount(_0x57ef23){this['id']=_0x57ef23['id']||0x0;this[_0x56a1('0x0')]=_0x57ef23['name']||'';this[_0x56a1('0x1')]=_0x57ef23[_0x56a1('0x1')]||'';this[_0x56a1('0x2')]=_0x57ef23[_0x56a1('0x3')]||'';this[_0x56a1('0x4')]=_0x57ef23[_0x56a1('0x4')]||'';this[_0x56a1('0x5')]=_0x57ef23[_0x56a1('0x5')]||'';this[_0x56a1('0x6')]=_0x57ef23['Configurations']||{};}module[_0x56a1('0x7')]=FreshdeskAccount;
\ No newline at end of file
index 8032c7d..1402b75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7e6=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x46451c,_0x88ddd){var _0x12dce4=function(_0x2e4087){while(--_0x2e4087){_0x46451c['push'](_0x46451c['shift']());}};_0x12dce4(++_0x88ddd);}(_0xa7e6,0x74));var _0x6a7e=function(_0x5bf9e0,_0x400291){_0x5bf9e0=_0x5bf9e0-0x0;var _0x2d4653=_0xa7e6[_0x5bf9e0];return _0x2d4653;};'use strict';function FreshsalesAccount(_0x495a94){this['id']=_0x495a94['id']||0x0;this[_0x6a7e('0x0')]=_0x495a94[_0x6a7e('0x0')]||'';this[_0x6a7e('0x1')]=_0x495a94[_0x6a7e('0x1')]||'';this[_0x6a7e('0x2')]=_0x495a94['token']||'';this[_0x6a7e('0x3')]=_0x495a94[_0x6a7e('0x3')]||'';this[_0x6a7e('0x4')]=_0x495a94[_0x6a7e('0x4')]||'';this[_0x6a7e('0x5')]=_0x495a94['Configurations']||{};}module[_0x6a7e('0x6')]=FreshsalesAccount;
\ No newline at end of file
+var _0x576b=['token','remoteUri','serverUrl','Configurations','exports','username'];(function(_0x51ed62,_0x574379){var _0x34aee3=function(_0x2958bc){while(--_0x2958bc){_0x51ed62['push'](_0x51ed62['shift']());}};_0x34aee3(++_0x574379);}(_0x576b,0x1d9));var _0xb576=function(_0x2afcd4,_0x2d1409){_0x2afcd4=_0x2afcd4-0x0;var _0x3acbe8=_0x576b[_0x2afcd4];return _0x3acbe8;};'use strict';function FreshsalesAccount(_0x312dc9){this['id']=_0x312dc9['id']||0x0;this['name']=_0x312dc9['name']||'';this[_0xb576('0x0')]=_0x312dc9[_0xb576('0x0')]||'';this['apiKey']=_0x312dc9[_0xb576('0x1')]||'';this[_0xb576('0x2')]=_0x312dc9['remoteUri']||'';this[_0xb576('0x3')]=_0x312dc9[_0xb576('0x3')]||'';this[_0xb576('0x4')]=_0x312dc9[_0xb576('0x4')]||{};}module[_0xb576('0x5')]=FreshsalesAccount;
\ No newline at end of file
index 6269f5e..066c7bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa863=['channel','accountcode','context','holdtime','lastAssignedTo','motionChannel','voice','variables','exports','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexit','originalposition'];(function(_0x43a7ce,_0x309be4){var _0xf5d9db=function(_0x1cd2d1){while(--_0x1cd2d1){_0x43a7ce['push'](_0x43a7ce['shift']());}};_0xf5d9db(++_0x309be4);}(_0xa863,0x106));var _0x3a86=function(_0xd19c,_0x35cfb2){_0xd19c=_0xd19c-0x0;var _0x183d3d=_0xa863[_0xd19c];return _0x183d3d;};'use strict';function QueueReport(){this['type']=_0x3a86('0x0');this[_0x3a86('0x1')]='';this[_0x3a86('0x2')]='';this[_0x3a86('0x3')]='';this[_0x3a86('0x4')]='';this[_0x3a86('0x5')]=null;this[_0x3a86('0x6')]=null;this[_0x3a86('0x7')]=0x1;this[_0x3a86('0x8')]=0x1;this[_0x3a86('0x9')]=![];this['queuecallerabandonAt']=null;this[_0x3a86('0xa')]=![];this[_0x3a86('0xb')]=null;this[_0x3a86('0xc')]=![];this['queuecallerexitAt']=null;this[_0x3a86('0xd')]=0x1;this[_0x3a86('0xe')]='';this['connectedlinenum']='';this['connectedlinename']='';this[_0x3a86('0xf')]='';this[_0x3a86('0x10')]='';this['exten']='';this['priority']='';this[_0x3a86('0x11')]=0x0;this['assigned']=![];this[_0x3a86('0x12')]='';this[_0x3a86('0x13')]=_0x3a86('0x14');this['mohtime']=0x0;this[_0x3a86('0x15')]={};}module[_0x3a86('0x16')]=QueueReport;
\ No newline at end of file
+var _0x3112=['assigned','lastAssignedTo','motionChannel','voice','mohtime','variables','type','inbound','uniqueid','calleridnum','queue','queuecallerjoinAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','connectedlinename','accountcode','context','priority','holdtime'];(function(_0x540cfe,_0x4c2fcb){var _0x469b68=function(_0x4555be){while(--_0x4555be){_0x540cfe['push'](_0x540cfe['shift']());}};_0x469b68(++_0x4c2fcb);}(_0x3112,0x1e1));var _0x2311=function(_0x50a0a7,_0x1f845f){_0x50a0a7=_0x50a0a7-0x0;var _0x2c67e0=_0x3112[_0x50a0a7];return _0x2c67e0;};'use strict';function QueueReport(){this[_0x2311('0x0')]=_0x2311('0x1');this[_0x2311('0x2')]='';this[_0x2311('0x3')]='';this['calleridname']='';this[_0x2311('0x4')]='';this[_0x2311('0x5')]=null;this['queuecallerleaveAt']=null;this['position']=0x1;this[_0x2311('0x6')]=0x1;this[_0x2311('0x7')]=![];this[_0x2311('0x8')]=null;this[_0x2311('0x9')]=![];this[_0x2311('0xa')]=null;this[_0x2311('0xb')]=![];this[_0x2311('0xc')]=null;this[_0x2311('0xd')]=0x1;this['channel']='';this['connectedlinenum']='';this[_0x2311('0xe')]='';this[_0x2311('0xf')]='';this[_0x2311('0x10')]='';this['exten']='';this[_0x2311('0x11')]='';this[_0x2311('0x12')]=0x0;this[_0x2311('0x13')]=![];this[_0x2311('0x14')]='';this[_0x2311('0x15')]=_0x2311('0x16');this[_0x2311('0x17')]=0x0;this[_0x2311('0x18')]={};}module['exports']=QueueReport;
\ No newline at end of file
index 4360e54..369dd01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb94c=['Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl'];(function(_0x5c2f86,_0x55e2d5){var _0x544b2=function(_0x233b2a){while(--_0x233b2a){_0x5c2f86['push'](_0x5c2f86['shift']());}};_0x544b2(++_0x55e2d5);}(_0xb94c,0x176));var _0xcb94=function(_0x418e4d,_0x1d1fb7){_0x418e4d=_0x418e4d-0x0;var _0x3387f2=_0xb94c[_0x418e4d];return _0x3387f2;};'use strict';function SalesforceAccount(_0x3fe1cb){this['id']=_0x3fe1cb['id']||0x0;this[_0xcb94('0x0')]=_0x3fe1cb['name']||'';this[_0xcb94('0x1')]=_0x3fe1cb[_0xcb94('0x1')]||'';this['remoteUri']=_0x3fe1cb[_0xcb94('0x2')]||'';this['password']=_0x3fe1cb[_0xcb94('0x3')]||'';this[_0xcb94('0x4')]=_0x3fe1cb[_0xcb94('0x4')]||'';this[_0xcb94('0x5')]=_0x3fe1cb[_0xcb94('0x5')]||'';this['securityToken']=_0x3fe1cb[_0xcb94('0x6')]||'';this[_0xcb94('0x7')]=_0x3fe1cb[_0xcb94('0x7')]||_0xcb94('0x8');this[_0xcb94('0x9')]=_0x3fe1cb['serverUrl']||'';this[_0xcb94('0xa')]=_0x3fe1cb[_0xcb94('0xa')]||{};}module[_0xcb94('0xb')]=SalesforceAccount;
\ No newline at end of file
+var _0x5360=['serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','securityToken','type'];(function(_0x42c0e4,_0x36f07b){var _0x45175d=function(_0x13e832){while(--_0x13e832){_0x42c0e4['push'](_0x42c0e4['shift']());}};_0x45175d(++_0x36f07b);}(_0x5360,0x157));var _0x0536=function(_0x4096e0,_0x15daed){_0x4096e0=_0x4096e0-0x0;var _0x19c212=_0x5360[_0x4096e0];return _0x19c212;};'use strict';function SalesforceAccount(_0x1920b0){this['id']=_0x1920b0['id']||0x0;this[_0x0536('0x0')]=_0x1920b0[_0x0536('0x0')]||'';this[_0x0536('0x1')]=_0x1920b0['username']||'';this['remoteUri']=_0x1920b0[_0x0536('0x2')]||'';this['password']=_0x1920b0[_0x0536('0x3')]||'';this[_0x0536('0x4')]=_0x1920b0['clientId']||'';this['clientSecret']=_0x1920b0['clientSecret']||'';this[_0x0536('0x5')]=_0x1920b0[_0x0536('0x5')]||'';this[_0x0536('0x6')]=_0x1920b0[_0x0536('0x6')]||'integrationTab';this[_0x0536('0x7')]=_0x1920b0[_0x0536('0x7')]||'';this[_0x0536('0x8')]=_0x1920b0['Configurations']||{};}module[_0x0536('0x9')]=SalesforceAccount;
\ No newline at end of file
index c9508df..80c50af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf4c=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x1357e9,_0x24f365){var _0x56343e=function(_0x13994a){while(--_0x13994a){_0x1357e9['push'](_0x1357e9['shift']());}};_0x56343e(++_0x24f365);}(_0xbf4c,0x189));var _0xcbf4=function(_0x153d3f,_0x242877){_0x153d3f=_0x153d3f-0x0;var _0x3e78a5=_0xbf4c[_0x153d3f];return _0x3e78a5;};'use strict';function ServicenowAccount(_0x618099){this['id']=_0x618099['id']||0x0;this['name']=_0x618099[_0xcbf4('0x0')]||'';this[_0xcbf4('0x1')]=_0x618099[_0xcbf4('0x1')]||'';this['password']=_0x618099[_0xcbf4('0x2')]||'';this[_0xcbf4('0x3')]=_0x618099[_0xcbf4('0x3')]||'';this['serverUrl']=_0x618099[_0xcbf4('0x4')]||'';this[_0xcbf4('0x5')]=_0x618099[_0xcbf4('0x5')]||{};}module[_0xcbf4('0x6')]=ServicenowAccount;
\ No newline at end of file
+var _0x53da=['password','remoteUri','serverUrl','Configurations','exports','username'];(function(_0xf15f81,_0x3757a1){var _0x5d5673=function(_0x46f874){while(--_0x46f874){_0xf15f81['push'](_0xf15f81['shift']());}};_0x5d5673(++_0x3757a1);}(_0x53da,0x14f));var _0xa53d=function(_0x2ef70f,_0x26e938){_0x2ef70f=_0x2ef70f-0x0;var _0x396339=_0x53da[_0x2ef70f];return _0x396339;};'use strict';function ServicenowAccount(_0x3b823c){this['id']=_0x3b823c['id']||0x0;this['name']=_0x3b823c['name']||'';this['username']=_0x3b823c[_0xa53d('0x0')]||'';this[_0xa53d('0x1')]=_0x3b823c[_0xa53d('0x1')]||'';this[_0xa53d('0x2')]=_0x3b823c['remoteUri']||'';this[_0xa53d('0x3')]=_0x3b823c[_0xa53d('0x3')]||'';this[_0xa53d('0x4')]=_0x3b823c[_0xa53d('0x4')]||{};}module[_0xa53d('0x5')]=ServicenowAccount;
\ No newline at end of file
index 16bee7d..22bc5c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x975f=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x975f,0x109));var _0xf975=function(_0x7729b1,_0x468322){_0x7729b1=_0x7729b1-0x0;var _0x349504=_0x975f[_0x7729b1];return _0x349504;};'use strict';function SugarcrmAccount(_0x15a84f){this['id']=_0x15a84f['id']||0x0;this[_0xf975('0x0')]=_0x15a84f['name']||'';this['username']=_0x15a84f[_0xf975('0x1')]||'';this[_0xf975('0x2')]=_0x15a84f['password']||'';this[_0xf975('0x3')]=_0x15a84f[_0xf975('0x3')]||'';this[_0xf975('0x4')]=_0x15a84f[_0xf975('0x4')]||'';this['Configurations']=_0x15a84f[_0xf975('0x5')]||{};}module[_0xf975('0x6')]=SugarcrmAccount;
\ No newline at end of file
+var _0xec19=['serverUrl','exports','name','password','remoteUri'];(function(_0x232117,_0x4112e6){var _0x3b47ca=function(_0x497f60){while(--_0x497f60){_0x232117['push'](_0x232117['shift']());}};_0x3b47ca(++_0x4112e6);}(_0xec19,0xc0));var _0x9ec1=function(_0x27a886,_0x58e678){_0x27a886=_0x27a886-0x0;var _0x423e00=_0xec19[_0x27a886];return _0x423e00;};'use strict';function SugarcrmAccount(_0x51dd70){this['id']=_0x51dd70['id']||0x0;this[_0x9ec1('0x0')]=_0x51dd70['name']||'';this['username']=_0x51dd70['username']||'';this[_0x9ec1('0x1')]=_0x51dd70[_0x9ec1('0x1')]||'';this['remoteUri']=_0x51dd70[_0x9ec1('0x2')]||'';this[_0x9ec1('0x3')]=_0x51dd70[_0x9ec1('0x3')]||'';this['Configurations']=_0x51dd70['Configurations']||{};}module[_0x9ec1('0x4')]=SugarcrmAccount;
\ No newline at end of file
index 5b96f95..08d87b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf290=['state','unknown','stateTime','status','exports','name','accountcode'];(function(_0x553095,_0x427c95){var _0xfbbe43=function(_0x35005a){while(--_0x35005a){_0x553095['push'](_0x553095['shift']());}};_0xfbbe43(++_0x427c95);}(_0xf290,0xde));var _0x0f29=function(_0x4de1b1,_0x18c64c){_0x4de1b1=_0x4de1b1-0x0;var _0x639f27=_0xf290[_0x4de1b1];return _0x639f27;};'use strict';function Telephone(_0x1149f4){this['id']=_0x1149f4['id']||0x0;this[_0x0f29('0x0')]=_0x1149f4['name']||'';this[_0x0f29('0x1')]=_0x1149f4['accountcode']||'';this[_0x0f29('0x2')]=_0x0f29('0x3');this[_0x0f29('0x4')]=0x0;this[_0x0f29('0x5')]=_0x0f29('0x3');this['address']='';}module[_0x0f29('0x6')]=Telephone;
\ No newline at end of file
+var _0x220b=['unknown','status','address','exports','name','accountcode'];(function(_0x17bb31,_0x2fc6f8){var _0x505c71=function(_0x5013cf){while(--_0x5013cf){_0x17bb31['push'](_0x17bb31['shift']());}};_0x505c71(++_0x2fc6f8);}(_0x220b,0x1a2));var _0xb220=function(_0x4b174a,_0x33a017){_0x4b174a=_0x4b174a-0x0;var _0x3cd7bf=_0x220b[_0x4b174a];return _0x3cd7bf;};'use strict';function Telephone(_0x3afc00){this['id']=_0x3afc00['id']||0x0;this[_0xb220('0x0')]=_0x3afc00[_0xb220('0x0')]||'';this[_0xb220('0x1')]=_0x3afc00[_0xb220('0x1')]||'';this['state']=_0xb220('0x2');this['stateTime']=0x0;this[_0xb220('0x3')]='unknown';this[_0xb220('0x4')]='';}module[_0xb220('0x5')]=Telephone;
\ No newline at end of file
index a626331..1002cea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['exports','name'];(function(_0x1ae4d,_0x55d7f2){var _0x22440d=function(_0x38b5a0){while(--_0x38b5a0){_0x1ae4d['push'](_0x1ae4d['shift']());}};_0x22440d(++_0x55d7f2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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(_0x3c4169,_0x3e1996){var _0x18e52a=function(_0x5cd02c){while(--_0x5cd02c){_0x3c4169['push'](_0x3c4169['shift']());}};_0x18e52a(++_0x3e1996);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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 1a7d9c6..4ade697 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ffd=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x35f461,_0x5b38e7){var _0x3390dd=function(_0x5d0072){while(--_0x5d0072){_0x35f461['push'](_0x35f461['shift']());}};_0x3390dd(++_0x5b38e7);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x4f0d23,_0x3f8652){_0x4f0d23=_0x4f0d23-0x0;var _0xcb57f5=_0x9ffd[_0x4f0d23];return _0xcb57f5;};'use strict';function Trigger(_0x4c26a1){this['id']=_0x4c26a1['id']||0x0;this[_0xd9ff('0x0')]=_0x4c26a1[_0xd9ff('0x0')]||'';this['channel']=_0x4c26a1[_0xd9ff('0x1')]||_0xd9ff('0x2');this[_0xd9ff('0x3')]=_0x4c26a1[_0xd9ff('0x3')]||![];this['AllConditions']=_0x4c26a1[_0xd9ff('0x4')]||[];this[_0xd9ff('0x5')]=_0x4c26a1['AnyConditions']||[];this[_0xd9ff('0x6')]=_0x4c26a1[_0xd9ff('0x6')]||[];}module[_0xd9ff('0x7')]=Trigger;
\ No newline at end of file
+var _0x5f66=['AllConditions','AnyConditions','Actions','name','channel','voice','status'];(function(_0x457b64,_0x49a219){var _0x437111=function(_0x3dad3d){while(--_0x3dad3d){_0x457b64['push'](_0x457b64['shift']());}};_0x437111(++_0x49a219);}(_0x5f66,0x1a0));var _0x65f6=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x5f66[_0x580576];return _0x3f55a0;};'use strict';function Trigger(_0x253044){this['id']=_0x253044['id']||0x0;this[_0x65f6('0x0')]=_0x253044['name']||'';this[_0x65f6('0x1')]=_0x253044[_0x65f6('0x1')]||_0x65f6('0x2');this[_0x65f6('0x3')]=_0x253044[_0x65f6('0x3')]||![];this['AllConditions']=_0x253044[_0x65f6('0x4')]||[];this['AnyConditions']=_0x253044[_0x65f6('0x5')]||[];this[_0x65f6('0x6')]=_0x253044['Actions']||[];}module['exports']=Trigger;
\ No newline at end of file
index d4a8bac..e52c1f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x974c=['indexOf','split','port','domainport','refresh','stateRegistry','registrationtime','defaultuser','active','name','unknown','stateTime','registry'];(function(_0x57d475,_0x4d9c33){var _0x46c459=function(_0x206594){while(--_0x206594){_0x57d475['push'](_0x57d475['shift']());}};_0x46c459(++_0x4d9c33);}(_0x974c,0xb1));var _0xc974=function(_0x16e65f,_0x5a7261){_0x16e65f=_0x16e65f-0x0;var _0x5dee3f=_0x974c[_0x16e65f];return _0x5dee3f;};'use strict';function Trunk(_0x4b894e){this['id']=_0x4b894e['id']||0x0;this[_0xc974('0x0')]=_0x4b894e['active']||![];this[_0xc974('0x1')]=_0x4b894e[_0xc974('0x1')]||'';this['state']=_0xc974('0x2');this[_0xc974('0x3')]=0x0;this['status']=_0xc974('0x2');this[_0xc974('0x4')]=_0x4b894e[_0xc974('0x4')]&&_0x4b894e[_0xc974('0x4')][_0xc974('0x5')](':')?_0x4b894e[_0xc974('0x4')][_0xc974('0x6')](':')[0x0]:'';this['host']='';this[_0xc974('0x7')]='';this['domain']='';this[_0xc974('0x8')]='';this[_0xc974('0x9')]='';this[_0xc974('0xa')]=_0xc974('0x2');this[_0xc974('0xb')]='';this['address']='';this[_0xc974('0xc')]=_0x4b894e['defaultuser']||'';}module['exports']=Trunk;
\ No newline at end of file
+var _0x772a=['registrationtime','address','defaultuser','exports','active','state','unknown','stateTime','registry','indexOf','split','host','port','domain','domainport','refresh','stateRegistry'];(function(_0x266ca4,_0x152c86){var _0x21a03a=function(_0x4e9b3e){while(--_0x4e9b3e){_0x266ca4['push'](_0x266ca4['shift']());}};_0x21a03a(++_0x152c86);}(_0x772a,0x9d));var _0xa772=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x772a[_0x243b59];return _0x3e1676;};'use strict';function Trunk(_0x427883){this['id']=_0x427883['id']||0x0;this[_0xa772('0x0')]=_0x427883[_0xa772('0x0')]||![];this['name']=_0x427883['name']||'';this[_0xa772('0x1')]=_0xa772('0x2');this[_0xa772('0x3')]=0x0;this['status']=_0xa772('0x2');this['registry']=_0x427883[_0xa772('0x4')]&&_0x427883['registry'][_0xa772('0x5')](':')?_0x427883[_0xa772('0x4')][_0xa772('0x6')](':')[0x0]:'';this[_0xa772('0x7')]='';this[_0xa772('0x8')]='';this[_0xa772('0x9')]='';this[_0xa772('0xa')]='';this[_0xa772('0xb')]='';this[_0xa772('0xc')]=_0xa772('0x2');this[_0xa772('0xd')]='';this[_0xa772('0xe')]='';this['defaultuser']=_0x427883[_0xa772('0xf')]||'';}module[_0xa772('0x10')]=Trunk;
\ No newline at end of file
index f50f2c0..b786291 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68af=['exports','exten','recordingFormat','none','mandatoryDisposition'];(function(_0x42458c,_0x1acdc0){var _0x5c2872=function(_0x1c4ac1){while(--_0x1c4ac1){_0x42458c['push'](_0x42458c['shift']());}};_0x5c2872(++_0x1acdc0);}(_0x68af,0x19b));var _0xf68a=function(_0x150d01,_0x40fad1){_0x150d01=_0x150d01-0x0;var _0x28e865=_0x68af[_0x150d01];return _0x28e865;};'use strict';function voiceExtension(_0x5e80bf){this['id']=_0x5e80bf['id']||0x0;this[_0xf68a('0x0')]=_0x5e80bf['exten']||'';this['recordingFormat']=_0x5e80bf[_0xf68a('0x1')]||_0xf68a('0x2');this[_0xf68a('0x3')]=_0x5e80bf['mandatoryDisposition']||![];}module[_0xf68a('0x4')]=voiceExtension;
\ No newline at end of file
+var _0x98af=['mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x21cc45,_0x22eff2){var _0x169c76=function(_0x540230){while(--_0x540230){_0x21cc45['push'](_0x21cc45['shift']());}};_0x169c76(++_0x22eff2);}(_0x98af,0x92));var _0xf98a=function(_0x3a2e49,_0x21ebea){_0x3a2e49=_0x3a2e49-0x0;var _0x257140=_0x98af[_0x3a2e49];return _0x257140;};'use strict';function voiceExtension(_0x36583e){this['id']=_0x36583e['id']||0x0;this['exten']=_0x36583e[_0xf98a('0x0')]||'';this[_0xf98a('0x1')]=_0x36583e[_0xf98a('0x1')]||'none';this[_0xf98a('0x2')]=_0x36583e[_0xf98a('0x2')]||![];}module[_0xf98a('0x3')]=voiceExtension;
\ No newline at end of file
index 0f046b0..9002afe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe082=['startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','invalid','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','sumBillable','unmanaged','loggedIn','available','acw','acwTimeout','autopause','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xe082,0x8f));var _0x2e08=function(_0x70bb8,_0x1da278){_0x70bb8=_0x70bb8-0x0;var _0x48ba84=_0xe082[_0x70bb8];return _0x48ba84;};'use strict';var statusDesc=[_0x2e08('0x0'),_0x2e08('0x1'),_0x2e08('0x2'),'busy',_0x2e08('0x3'),_0x2e08('0x4'),_0x2e08('0x5'),_0x2e08('0x6'),_0x2e08('0x7')];var monitorFormat={'wav':_0x2e08('0x8'),'wav49':_0x2e08('0x9'),'gsm':_0x2e08('0xa')};var strategy={'rrmemory':_0x2e08('0xb'),'roundrobin':_0x2e08('0xc')};function VoiceQueue(_0x1036b1){this['id']=_0x1036b1['id']||0x0;this[_0x2e08('0xd')]=_0x1036b1[_0x2e08('0xd')]||'';this[_0x2e08('0xe')]=_0x1036b1[_0x2e08('0xe')]||'';this['type']=_0x1036b1[_0x2e08('0xf')]||_0x2e08('0x10');this[_0x2e08('0x11')]=0x0;this[_0x2e08('0x12')]=0x0;this[_0x2e08('0x13')]=0x0;this[_0x2e08('0x14')]=0x0;this[_0x2e08('0x15')]=0x0;this['sumHoldTime']=0x0;this[_0x2e08('0x16')]=0x0;this[_0x2e08('0x17')]=0x0;this['abandoned']=0x0;this[_0x2e08('0x18')]=0x0;this[_0x2e08('0x19')]=0x0;this[_0x2e08('0x1a')]=_0x1036b1[_0x2e08('0x1a')]||![];this[_0x2e08('0x1b')]=_0x1036b1[_0x2e08('0x1b')]||0xa;this['autopause']=_0x1036b1[_0x2e08('0x1c')]||'no';this['sendMessageOneNotActive']=!![];this['message']='';this[_0x2e08('0x1d')]=0x0;this[_0x2e08('0x1e')]=0x0;this[_0x2e08('0x1f')]=_0x1036b1['dialTimezone']||null;this['dialGlobalInterval']=_0x1036b1[_0x2e08('0x20')]?_0x1036b1[_0x2e08('0x20')]:null;this[_0x2e08('0x21')]=_0x1036b1[_0x2e08('0x21')];this[_0x2e08('0x22')]=_0x1036b1[_0x2e08('0x22')]||'progressive';this[_0x2e08('0x23')]=_0x1036b1['dialLimitChannel']||0x0;this['dialLimitQueue']=_0x1036b1[_0x2e08('0x24')]||0x0;this[_0x2e08('0x25')]=_0x1036b1[_0x2e08('0x25')]||0x1;this[_0x2e08('0x26')]=_0x1036b1[_0x2e08('0x26')]||_0x2e08('0x27');this[_0x2e08('0x28')]=_0x1036b1[_0x2e08('0x28')]||0.03;this[_0x2e08('0x29')]=_0x1036b1[_0x2e08('0x29')]||0x258;this['dialOriginateCallerIdName']=_0x1036b1['dialOriginateCallerIdName']||_0x2e08('0x2a');this[_0x2e08('0x2b')]=_0x1036b1[_0x2e08('0x2b')]||_0x2e08('0x2a');this[_0x2e08('0x2c')]=_0x1036b1[_0x2e08('0x2c')]||0x1e;this[_0x2e08('0x2d')]=_0x1036b1['dialQueueOptions']||_0x2e08('0x2e');this['dialQueueTimeout']=_0x1036b1[_0x2e08('0x2f')]||0x3;this[_0x2e08('0x30')]=_0x1036b1[_0x2e08('0x30')]||undefined;this[_0x2e08('0x31')]=_0x1036b1['dialCongestionMaxRetry']||0x3;this[_0x2e08('0x32')]=_0x1036b1[_0x2e08('0x32')]||0x96;this['dialBusyMaxRetry']=_0x1036b1[_0x2e08('0x33')]||0x3;this['dialBusyRetryFrequency']=_0x1036b1['dialBusyRetryFrequency']||0x96;this[_0x2e08('0x34')]=_0x1036b1[_0x2e08('0x34')]||0x3;this[_0x2e08('0x35')]=_0x1036b1[_0x2e08('0x35')]||0x96;this[_0x2e08('0x36')]=_0x1036b1['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x1036b1['dialNoSuchNumberRetryFrequency']||0x96;this[_0x2e08('0x37')]=_0x1036b1[_0x2e08('0x37')]||0x3;this[_0x2e08('0x38')]=_0x1036b1[_0x2e08('0x38')]||0x96;this['dialAbandonedMaxRetry']=_0x1036b1[_0x2e08('0x39')]||0x3;this[_0x2e08('0x3a')]=_0x1036b1[_0x2e08('0x3a')]||0x96;this['dialMachineMaxRetry']=_0x1036b1[_0x2e08('0x3b')]||0x3;this['dialMachineRetryFrequency']=_0x1036b1[_0x2e08('0x3c')]||0x96;this[_0x2e08('0x3d')]=_0x1036b1[_0x2e08('0x3d')]||0x3;this['dialAgentRejectRetryFrequency']=_0x1036b1[_0x2e08('0x3e')]||0x96;this[_0x2e08('0x3f')]=_0x1036b1['dialGlobalMaxRetry']||0x4;this['Trunk']=_0x1036b1['Trunk']?_0x1036b1['Trunk']:undefined;this[_0x2e08('0x40')]=_0x1036b1[_0x2e08('0x40')]?_0x1036b1['TrunkBackup']:undefined;this[_0x2e08('0x41')]=_0x1036b1['dialPrefix']||undefined;this['Interval']=_0x1036b1[_0x2e08('0x42')]?_0x1036b1['Interval']:undefined;this[_0x2e08('0x43')]=_0x1036b1[_0x2e08('0x43')]||_0x2e08('0x44');this[_0x2e08('0x45')]=_0x1036b1[_0x2e08('0x45')]||undefined;this[_0x2e08('0x46')]=_0x1036b1['dialCutDigit']||undefined;this[_0x2e08('0x47')]=strategy[_0x1036b1[_0x2e08('0x47')]]||_0x2e08('0xb');this[_0x2e08('0x48')]=!![];this[_0x2e08('0x49')]=_0x1036b1[_0x2e08('0x49')]||![];this[_0x2e08('0x4a')]=_0x1036b1[_0x2e08('0x4a')];this[_0x2e08('0x4b')]=_0x1036b1[_0x2e08('0x4b')];this[_0x2e08('0x4c')]=_0x1036b1['dialAMDAfterGreetingSilence'];this[_0x2e08('0x4d')]=_0x1036b1[_0x2e08('0x4d')];this[_0x2e08('0x4e')]=_0x1036b1['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x1036b1[_0x2e08('0x4f')];this[_0x2e08('0x50')]=_0x1036b1[_0x2e08('0x50')];this[_0x2e08('0x51')]=_0x1036b1[_0x2e08('0x51')];this['dialAMDMaximumWordLength']=_0x1036b1[_0x2e08('0x52')];this[_0x2e08('0x53')]=0x0;this[_0x2e08('0x54')]=0x0;this[_0x2e08('0x55')]=_0x1036b1['timeout'];this[_0x2e08('0x56')]=0x0;this[_0x2e08('0x57')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x2e08('0x58')]=0x0;this[_0x2e08('0x59')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x2e08('0x5a')]=0x0;this[_0x2e08('0x5b')]=0x0;this[_0x2e08('0x5c')]=0x0;this[_0x2e08('0x5d')]=0x0;this[_0x2e08('0x5e')]=0x0;this[_0x2e08('0x5f')]=0x0;this[_0x2e08('0x60')]=0x0;this[_0x2e08('0x61')]=0x0;this[_0x2e08('0x62')]=undefined;this[_0x2e08('0x63')]=undefined;this[_0x2e08('0x64')]=undefined;this[_0x2e08('0x65')]=1.05;this[_0x2e08('0x66')]=0x0;this[_0x2e08('0x67')]=0x0;this[_0x2e08('0x68')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x2e08('0x69')]=0x0;this[_0x2e08('0x6a')]=0x0;this['predictiveIntervalPauses']=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x2e08('0x6b')]=_0x1036b1['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x2e08('0x6c')]=_0x1036b1[_0x2e08('0x6d')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x2e08('0x6e')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x2e08('0x6f')]=0x0;this['erlangCallToSecond']=0x0;this[_0x2e08('0x70')]=0x0;this['erlangBusyFactor']=0x0;this[_0x2e08('0x71')]=_0x1036b1[_0x2e08('0x71')]||0x1e;this[_0x2e08('0x72')]=_0x1036b1['dialRecallInQueue']||![];this[_0x2e08('0x73')]=_0x1036b1[_0x2e08('0x73')]||undefined;this['dialAgiAfterHangupClient']=_0x1036b1[_0x2e08('0x74')]||![];this[_0x2e08('0x75')]=_0x1036b1[_0x2e08('0x75')]||![];this['monitor_format']=monitorFormat[_0x1036b1[_0x2e08('0xe')]]?monitorFormat[_0x1036b1[_0x2e08('0xe')]]:undefined;this[_0x2e08('0x76')]=_0x1036b1['mandatoryDisposition']||![];this['mandatoryDispositionPause']=_0x1036b1['mandatoryDispositionPause']?_0x1036b1[_0x2e08('0x77')]:undefined;}module[_0x2e08('0x78')]=VoiceQueue;
\ No newline at end of file
+var _0xcf98=['total','sumBillable','unmanaged','acw','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type'];(function(_0x3f3688,_0x27cd88){var _0x5370de=function(_0xc7eaa2){while(--_0xc7eaa2){_0x3f3688['push'](_0x3f3688['shift']());}};_0x5370de(++_0x27cd88);}(_0xcf98,0xc8));var _0x8cf9=function(_0x2c79a4,_0x5c0d9f){_0x2c79a4=_0x2c79a4-0x0;var _0x11fd19=_0xcf98[_0x2c79a4];return _0x11fd19;};'use strict';var statusDesc=[_0x8cf9('0x0'),_0x8cf9('0x1'),_0x8cf9('0x2'),_0x8cf9('0x3'),'invalid',_0x8cf9('0x4'),_0x8cf9('0x5'),_0x8cf9('0x6'),_0x8cf9('0x7')];var monitorFormat={'wav':_0x8cf9('0x8'),'wav49':_0x8cf9('0x9'),'gsm':_0x8cf9('0xa')};var strategy={'rrmemory':_0x8cf9('0xb'),'roundrobin':_0x8cf9('0xc')};function VoiceQueue(_0x1a95f9){this['id']=_0x1a95f9['id']||0x0;this[_0x8cf9('0xd')]=_0x1a95f9[_0x8cf9('0xd')]||'';this['monitor_format']=_0x1a95f9[_0x8cf9('0xe')]||'';this[_0x8cf9('0xf')]=_0x1a95f9['type']||'inbound';this['waiting']=0x0;this['talking']=0x0;this[_0x8cf9('0x10')]=0x0;this['answered']=0x0;this['sumDuration']=0x0;this['sumHoldTime']=0x0;this[_0x8cf9('0x11')]=0x0;this[_0x8cf9('0x12')]=0x0;this['abandoned']=0x0;this['loggedIn']=0x0;this['available']=0x0;this[_0x8cf9('0x13')]=_0x1a95f9[_0x8cf9('0x13')]||![];this['acwTimeout']=_0x1a95f9['acwTimeout']||0xa;this[_0x8cf9('0x14')]=_0x1a95f9[_0x8cf9('0x14')]||'no';this[_0x8cf9('0x15')]=!![];this[_0x8cf9('0x16')]='';this[_0x8cf9('0x17')]=0x0;this[_0x8cf9('0x18')]=0x0;this[_0x8cf9('0x19')]=_0x1a95f9['dialTimezone']||null;this[_0x8cf9('0x1a')]=_0x1a95f9[_0x8cf9('0x1a')]?_0x1a95f9[_0x8cf9('0x1a')]:null;this['dialActive']=_0x1a95f9[_0x8cf9('0x1b')];this[_0x8cf9('0x1c')]=_0x1a95f9[_0x8cf9('0x1c')]||_0x8cf9('0x1d');this[_0x8cf9('0x1e')]=_0x1a95f9[_0x8cf9('0x1e')]||0x0;this[_0x8cf9('0x1f')]=_0x1a95f9[_0x8cf9('0x1f')]||0x0;this[_0x8cf9('0x20')]=_0x1a95f9[_0x8cf9('0x20')]||0x1;this[_0x8cf9('0x21')]=_0x1a95f9['dialPredictiveOptimization']||_0x8cf9('0x22');this[_0x8cf9('0x23')]=_0x1a95f9[_0x8cf9('0x23')]||0.03;this[_0x8cf9('0x24')]=_0x1a95f9[_0x8cf9('0x24')]||0x258;this['dialOriginateCallerIdName']=_0x1a95f9['dialOriginateCallerIdName']||'anonymous';this[_0x8cf9('0x25')]=_0x1a95f9[_0x8cf9('0x25')]||_0x8cf9('0x26');this[_0x8cf9('0x27')]=_0x1a95f9['dialOriginateTimeout']||0x1e;this[_0x8cf9('0x28')]=_0x1a95f9[_0x8cf9('0x28')]||_0x8cf9('0x29');this[_0x8cf9('0x2a')]=_0x1a95f9[_0x8cf9('0x2a')]||0x3;this[_0x8cf9('0x2b')]=_0x1a95f9[_0x8cf9('0x2b')]||undefined;this[_0x8cf9('0x2c')]=_0x1a95f9['dialCongestionMaxRetry']||0x3;this[_0x8cf9('0x2d')]=_0x1a95f9[_0x8cf9('0x2d')]||0x96;this['dialBusyMaxRetry']=_0x1a95f9[_0x8cf9('0x2e')]||0x3;this['dialBusyRetryFrequency']=_0x1a95f9[_0x8cf9('0x2f')]||0x96;this[_0x8cf9('0x30')]=_0x1a95f9[_0x8cf9('0x30')]||0x3;this[_0x8cf9('0x31')]=_0x1a95f9['dialNoAnswerRetryFrequency']||0x96;this[_0x8cf9('0x32')]=_0x1a95f9[_0x8cf9('0x32')]||0x3;this[_0x8cf9('0x33')]=_0x1a95f9['dialNoSuchNumberRetryFrequency']||0x96;this[_0x8cf9('0x34')]=_0x1a95f9['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x1a95f9['dialDropRetryFrequency']||0x96;this[_0x8cf9('0x35')]=_0x1a95f9[_0x8cf9('0x35')]||0x3;this[_0x8cf9('0x36')]=_0x1a95f9['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x1a95f9[_0x8cf9('0x37')]||0x3;this[_0x8cf9('0x38')]=_0x1a95f9['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x1a95f9[_0x8cf9('0x39')]||0x3;this[_0x8cf9('0x3a')]=_0x1a95f9[_0x8cf9('0x3a')]||0x96;this[_0x8cf9('0x3b')]=_0x1a95f9[_0x8cf9('0x3b')]||0x4;this[_0x8cf9('0x3c')]=_0x1a95f9[_0x8cf9('0x3c')]?_0x1a95f9['Trunk']:undefined;this[_0x8cf9('0x3d')]=_0x1a95f9[_0x8cf9('0x3d')]?_0x1a95f9[_0x8cf9('0x3d')]:undefined;this[_0x8cf9('0x3e')]=_0x1a95f9['dialPrefix']||undefined;this[_0x8cf9('0x3f')]=_0x1a95f9['Interval']?_0x1a95f9[_0x8cf9('0x3f')]:undefined;this['dialOrderByScheduledAt']=_0x1a95f9['dialOrderByScheduledAt']||_0x8cf9('0x40');this[_0x8cf9('0x41')]=_0x1a95f9[_0x8cf9('0x41')]||undefined;this[_0x8cf9('0x42')]=_0x1a95f9[_0x8cf9('0x42')]||undefined;this['strategy']=strategy[_0x1a95f9[_0x8cf9('0x43')]]||_0x8cf9('0xb');this['queueStatusComplete']=!![];this[_0x8cf9('0x44')]=_0x1a95f9[_0x8cf9('0x44')]||![];this[_0x8cf9('0x45')]=_0x1a95f9[_0x8cf9('0x45')];this[_0x8cf9('0x46')]=_0x1a95f9[_0x8cf9('0x46')];this[_0x8cf9('0x47')]=_0x1a95f9['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x1a95f9[_0x8cf9('0x48')];this['dialAMDMinWordLength']=_0x1a95f9[_0x8cf9('0x49')];this[_0x8cf9('0x4a')]=_0x1a95f9[_0x8cf9('0x4a')];this[_0x8cf9('0x4b')]=_0x1a95f9[_0x8cf9('0x4b')];this[_0x8cf9('0x4c')]=_0x1a95f9['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x1a95f9['dialAMDMaximumWordLength'];this['outboundRejectCallsDay']=0x0;this[_0x8cf9('0x4d')]=0x0;this[_0x8cf9('0x4e')]=_0x1a95f9[_0x8cf9('0x4e')];this[_0x8cf9('0x4f')]=0x0;this[_0x8cf9('0x50')]=0x0;this[_0x8cf9('0x51')]=0x0;this[_0x8cf9('0x52')]=0x0;this[_0x8cf9('0x53')]=0x0;this['outboundNoSuchCallsDay']=0x0;this['outboundUnknownCallsDay']=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x8cf9('0x54')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x8cf9('0x55')]=0x0;this['outboundReCallsDay']=0x0;this[_0x8cf9('0x56')]=0x0;this[_0x8cf9('0x57')]=undefined;this[_0x8cf9('0x58')]=undefined;this['handlePredictive']=undefined;this[_0x8cf9('0x59')]=1.05;this[_0x8cf9('0x5a')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x8cf9('0x5b')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x8cf9('0x5c')]=0x0;this[_0x8cf9('0x5d')]=0x0;this['predictiveIntervalAvailable']=0x0;this['predictiveIntervalMaxThreshold']=_0x1a95f9[_0x8cf9('0x5e')]||0x14;this[_0x8cf9('0x5f')]=_0x1a95f9[_0x8cf9('0x5e')]||0xa;this[_0x8cf9('0x60')]=0x0;this[_0x8cf9('0x61')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x8cf9('0x62')]=0x0;this['erlangCallToSecond']=0x0;this['erlangAbandonmentRate']=0x0;this[_0x8cf9('0x63')]=0x0;this[_0x8cf9('0x64')]=_0x1a95f9[_0x8cf9('0x64')]||0x1e;this[_0x8cf9('0x65')]=_0x1a95f9['dialRecallInQueue']||![];this[_0x8cf9('0x66')]=_0x1a95f9['dialQueueProject2']||undefined;this[_0x8cf9('0x67')]=_0x1a95f9[_0x8cf9('0x67')]||![];this[_0x8cf9('0x68')]=_0x1a95f9[_0x8cf9('0x68')]||![];this[_0x8cf9('0xe')]=monitorFormat[_0x1a95f9[_0x8cf9('0xe')]]?monitorFormat[_0x1a95f9[_0x8cf9('0xe')]]:undefined;this[_0x8cf9('0x69')]=_0x1a95f9[_0x8cf9('0x69')]||![];this[_0x8cf9('0x6a')]=_0x1a95f9[_0x8cf9('0x6a')]?_0x1a95f9[_0x8cf9('0x6a')]:undefined;}module[_0x8cf9('0x6b')]=VoiceQueue;
\ No newline at end of file
index 3a842fc..18d07fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x699e=['remoteUri','serverUrl','Configurations','name','accessKey'];(function(_0x37756b,_0x24db76){var _0x46efec=function(_0x319807){while(--_0x319807){_0x37756b['push'](_0x37756b['shift']());}};_0x46efec(++_0x24db76);}(_0x699e,0x175));var _0xe699=function(_0x5d53ac,_0x5415f9){_0x5d53ac=_0x5d53ac-0x0;var _0x2a9615=_0x699e[_0x5d53ac];return _0x2a9615;};'use strict';function VtigerAccount(_0x428198){this['id']=_0x428198['id']||0x0;this[_0xe699('0x0')]=_0x428198[_0xe699('0x0')]||'';this['username']=_0x428198['username']||'';this[_0xe699('0x1')]=_0x428198[_0xe699('0x1')]||'';this[_0xe699('0x2')]=_0x428198['remoteUri']||'';this[_0xe699('0x3')]=_0x428198[_0xe699('0x3')]||'';this[_0xe699('0x4')]=_0x428198[_0xe699('0x4')]||{};}module['exports']=VtigerAccount;
\ No newline at end of file
+var _0x5419=['Configurations','exports','name','username','accessKey','remoteUri','serverUrl'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x5419,0x175));var _0x9541=function(_0x20edb2,_0x127ca7){_0x20edb2=_0x20edb2-0x0;var _0x24e94a=_0x5419[_0x20edb2];return _0x24e94a;};'use strict';function VtigerAccount(_0xf35b2e){this['id']=_0xf35b2e['id']||0x0;this[_0x9541('0x0')]=_0xf35b2e[_0x9541('0x0')]||'';this[_0x9541('0x1')]=_0xf35b2e[_0x9541('0x1')]||'';this[_0x9541('0x2')]=_0xf35b2e[_0x9541('0x2')]||'';this[_0x9541('0x3')]=_0xf35b2e[_0x9541('0x3')]||'';this[_0x9541('0x4')]=_0xf35b2e['serverUrl']||'';this[_0x9541('0x5')]=_0xf35b2e[_0x9541('0x5')]||{};}module[_0x9541('0x6')]=VtigerAccount;
\ No newline at end of file
index f72d18c..b9c479f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82fb=['username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x27f004,_0x1a1e9d){var _0x411a9d=function(_0x41a952){while(--_0x41a952){_0x27f004['push'](_0x27f004['shift']());}};_0x411a9d(++_0x1a1e9d);}(_0x82fb,0x15f));var _0xb82f=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x82fb[_0x4565bf];return _0x5610ba;};'use strict';function ZendeskAccount(_0x32a6b8){this['id']=_0x32a6b8['id']||0x0;this['name']=_0x32a6b8[_0xb82f('0x0')]||'';this[_0xb82f('0x1')]=_0x32a6b8[_0xb82f('0x1')]||'';this[_0xb82f('0x2')]=_0x32a6b8[_0xb82f('0x2')]||'';this['token']=_0x32a6b8[_0xb82f('0x3')]||'';this[_0xb82f('0x4')]=_0x32a6b8[_0xb82f('0x4')]||'';this[_0xb82f('0x5')]=_0x32a6b8['authType']||'';this[_0xb82f('0x6')]=_0x32a6b8['type']||_0xb82f('0x7');this['serverUrl']=_0x32a6b8[_0xb82f('0x8')]||'';this['Configurations']=_0x32a6b8[_0xb82f('0x9')]||{};}module[_0xb82f('0xa')]=ZendeskAccount;
\ No newline at end of file
+var _0x2de2=['password','token','remoteUri','type','integrationTab','serverUrl','name','username'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x2de2,0x15e));var _0x22de=function(_0x1dba54,_0x3a217b){_0x1dba54=_0x1dba54-0x0;var _0x217cbd=_0x2de2[_0x1dba54];return _0x217cbd;};'use strict';function ZendeskAccount(_0x2b8571){this['id']=_0x2b8571['id']||0x0;this[_0x22de('0x0')]=_0x2b8571['name']||'';this[_0x22de('0x1')]=_0x2b8571[_0x22de('0x1')]||'';this[_0x22de('0x2')]=_0x2b8571['password']||'';this[_0x22de('0x3')]=_0x2b8571['token']||'';this[_0x22de('0x4')]=_0x2b8571[_0x22de('0x4')]||'';this['authType']=_0x2b8571['authType']||'';this[_0x22de('0x5')]=_0x2b8571[_0x22de('0x5')]||_0x22de('0x6');this[_0x22de('0x7')]=_0x2b8571[_0x22de('0x7')]||'';this['Configurations']=_0x2b8571['Configurations']||{};}module['exports']=ZendeskAccount;
\ No newline at end of file
index d04a43f..3631a96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0183=['Configurations','exports','name','host','zone','clientSecret','serverUrl','code','refreshToken'];(function(_0x196854,_0x1a4f71){var _0x5f5023=function(_0x164185){while(--_0x164185){_0x196854['push'](_0x196854['shift']());}};_0x5f5023(++_0x1a4f71);}(_0x0183,0x197));var _0x3018=function(_0x174654,_0x38a11b){_0x174654=_0x174654-0x0;var _0x574521=_0x0183[_0x174654];return _0x574521;};'use strict';function ZohoAccount(_0x9c5e6e){this['id']=_0x9c5e6e['id']||0x0;this[_0x3018('0x0')]=_0x9c5e6e[_0x3018('0x0')]||'';this['description']=_0x9c5e6e['description']||'';this[_0x3018('0x1')]=_0x9c5e6e[_0x3018('0x1')]||'';this[_0x3018('0x2')]=_0x9c5e6e[_0x3018('0x2')]||'';this['clientId']=_0x9c5e6e['clientId']||'';this['clientSecret']=_0x9c5e6e[_0x3018('0x3')]||'';this[_0x3018('0x4')]=_0x9c5e6e['serverUrl']||'';this['code']=_0x9c5e6e[_0x3018('0x5')]||'';this[_0x3018('0x6')]=_0x9c5e6e[_0x3018('0x6')]||'';this[_0x3018('0x7')]=_0x9c5e6e[_0x3018('0x7')]||{};}module[_0x3018('0x8')]=ZohoAccount;
\ No newline at end of file
+var _0x5970=['serverUrl','code','Configurations','name','description','host','clientId','clientSecret'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x5970,0x123));var _0x0597=function(_0x239935,_0x1a9f04){_0x239935=_0x239935-0x0;var _0x4b3f2c=_0x5970[_0x239935];return _0x4b3f2c;};'use strict';function ZohoAccount(_0x5dd3ed){this['id']=_0x5dd3ed['id']||0x0;this[_0x0597('0x0')]=_0x5dd3ed[_0x0597('0x0')]||'';this[_0x0597('0x1')]=_0x5dd3ed[_0x0597('0x1')]||'';this[_0x0597('0x2')]=_0x5dd3ed['host']||'';this['zone']=_0x5dd3ed['zone']||'';this[_0x0597('0x3')]=_0x5dd3ed['clientId']||'';this[_0x0597('0x4')]=_0x5dd3ed['clientSecret']||'';this[_0x0597('0x5')]=_0x5dd3ed['serverUrl']||'';this[_0x0597('0x6')]=_0x5dd3ed[_0x0597('0x6')]||'';this['refreshToken']=_0x5dd3ed['refreshToken']||'';this[_0x0597('0x7')]=_0x5dd3ed[_0x0597('0x7')]||{};}module['exports']=ZohoAccount;
\ No newline at end of file
index 36c39fe..a60df43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef8c=['countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','getCaller','\x22%s\x22\x20<%s>','calleridname','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','phone','Contact','firstName','lastName','active','calleridnum','scheduledat','countbusyretry'];(function(_0x329d8d,_0x48b6c2){var _0x3bf18f=function(_0x151e83){while(--_0x151e83){_0x329d8d['push'](_0x329d8d['shift']());}};_0x3bf18f(++_0x48b6c2);}(_0xef8c,0xea));var _0xcef8=function(_0x5d6392,_0x271a01){_0x5d6392=_0x5d6392-0x0;var _0x5808ab=_0xef8c[_0x5d6392];return _0x5808ab;};'use strict';var util=require(_0xcef8('0x0'));var _=require(_0xcef8('0x1'));var moment=require(_0xcef8('0x2'));function checkNameSurname(_0x23fc75,_0x71b903,_0x55ed3a){var _0x56a1bf='';if(!_[_0xcef8('0x3')](_0x71b903)&&_0xcef8('0x4')===typeof _0x71b903){_0x56a1bf+=_0x71b903;}if(!_[_0xcef8('0x3')](_0x55ed3a)&&_0xcef8('0x4')===typeof _0x55ed3a){_0x56a1bf+='\x20'+_0x55ed3a;}if(_0x56a1bf!==''){return _0x56a1bf;}return _0x23fc75;}function Action(_0x39c309,_0x166dd4,_0x2b0dd6,_0x2b7de8,_0x155def){this[_0xcef8('0x5')]=_0x2b0dd6||undefined;this[_0xcef8('0x6')]=_0x39c309['id'];this[_0xcef8('0x7')]=_0x166dd4[_0xcef8('0x8')];this[_0xcef8('0x9')]=_0x166dd4['type'];this[_0xcef8('0xa')]=_0xcef8('0x7');this[_0xcef8('0xb')]=![];this[_0xcef8('0xc')]=_['isNil'](_0x39c309[_0xcef8('0xd')])?undefined:_0x39c309[_0xcef8('0xd')][_0xcef8('0x8')];this[_0xcef8('0xe')]=this[_0xcef8('0xc')]?util[_0xcef8('0xf')]('SIP/%s',this[_0xcef8('0xc')]):_0x2b7de8||undefined;this['calleridname']=checkNameSurname(_0x39c309['Contact'][_0xcef8('0x10')],_0x39c309[_0xcef8('0x11')][_0xcef8('0x12')],_0x39c309[_0xcef8('0x11')][_0xcef8('0x13')]);this[_0xcef8('0x14')]=_0x39c309[_0xcef8('0x14')]||![];this[_0xcef8('0x15')]=_0x39c309[_0xcef8('0x11')][_0xcef8('0x10')];this[_0xcef8('0x16')]=_0x39c309['scheduledat'];this[_0xcef8('0x17')]=_0x39c309[_0xcef8('0x17')]||0x0;this[_0xcef8('0x18')]=_0x39c309['countcongestionretry']||0x0;this[_0xcef8('0x19')]=_0x39c309[_0xcef8('0x19')]||0x0;this['countglobal']=(_0x39c309[_0xcef8('0x17')]||0x0)+(_0x39c309[_0xcef8('0x18')]||0x0)+(_0x39c309['countnoanswerretry']||0x0)+(_0x39c309[_0xcef8('0x1a')]||0x0)+(_0x39c309[_0xcef8('0x1b')]||0x0)+(_0x39c309['countabandonedretry']||0x0)+(_0x39c309[_0xcef8('0x1c')]||0x0)+(_0x39c309[_0xcef8('0x1d')]||0x0);this[_0xcef8('0x1a')]=_0x39c309['countnosuchnumberretry']||0x0;this[_0xcef8('0x1b')]=_0x39c309[_0xcef8('0x1b')]||0x0;this[_0xcef8('0x1e')]=_0x39c309[_0xcef8('0x1e')]||0x0;this[_0xcef8('0x1c')]=_0x39c309[_0xcef8('0x1c')]||0x0;this[_0xcef8('0x1d')]=_0x39c309[_0xcef8('0x1d')]||0x0;this['callback']=_0x39c309['callback'];this[_0xcef8('0x1f')]=_0x39c309['callbackuniqueid'];this[_0xcef8('0x20')]=_0x39c309[_0xcef8('0x20')];this['recallme']=_0x39c309[_0xcef8('0x21')];this['ContactId']=_0x39c309[_0xcef8('0x22')];this['ListId']=_0x39c309[_0xcef8('0x23')];this[_0xcef8('0x24')]=_[_0xcef8('0x3')](_0x39c309['Agent'])?_0x39c309[_0xcef8('0x24')]:_0x39c309['Agent']['id'];this[_0xcef8('0x25')]=_0x39c309[_0xcef8('0x25')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action['prototype'][_0xcef8('0x26')]=function(){return util[_0xcef8('0xf')](_0xcef8('0x27'),this[_0xcef8('0x28')],this[_0xcef8('0x29')]);};module[_0xcef8('0x2a')]=Action;
\ No newline at end of file
+var _0xa6d6=['name','type','membername','Agent','SIP/%s','calleridname','Contact','phone','firstName','active','calleridnum','scheduledat','countbusyretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','getCaller','\x22%s\x22\x20<%s>','number','util','isNil','string','uniqueid','idContact','queue'];(function(_0x1d2195,_0x4b8096){var _0x4962cd=function(_0x301f5a){while(--_0x301f5a){_0x1d2195['push'](_0x1d2195['shift']());}};_0x4962cd(++_0x4b8096);}(_0xa6d6,0x122));var _0x6a6d=function(_0x41b1df,_0x135b98){_0x41b1df=_0x41b1df-0x0;var _0x29eb06=_0xa6d6[_0x41b1df];return _0x29eb06;};'use strict';var util=require(_0x6a6d('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x45c46a,_0x4a9d30,_0x34ef76){var _0x34df9c='';if(!_['isNil'](_0x4a9d30)&&'string'===typeof _0x4a9d30){_0x34df9c+=_0x4a9d30;}if(!_[_0x6a6d('0x1')](_0x34ef76)&&_0x6a6d('0x2')===typeof _0x34ef76){_0x34df9c+='\x20'+_0x34ef76;}if(_0x34df9c!==''){return _0x34df9c;}return _0x45c46a;}function Action(_0xbba19a,_0x3fc482,_0x3f8666,_0x9c4480,_0xdea8da){this[_0x6a6d('0x3')]=_0x3f8666||undefined;this[_0x6a6d('0x4')]=_0xbba19a['id'];this[_0x6a6d('0x5')]=_0x3fc482[_0x6a6d('0x6')];this['type']=_0x3fc482[_0x6a6d('0x7')];this['campaigntype']=_0x6a6d('0x5');this['dialAnswer']=![];this[_0x6a6d('0x8')]=_[_0x6a6d('0x1')](_0xbba19a[_0x6a6d('0x9')])?undefined:_0xbba19a[_0x6a6d('0x9')][_0x6a6d('0x6')];this['channelAgent']=this[_0x6a6d('0x8')]?util['format'](_0x6a6d('0xa'),this[_0x6a6d('0x8')]):_0x9c4480||undefined;this[_0x6a6d('0xb')]=checkNameSurname(_0xbba19a[_0x6a6d('0xc')][_0x6a6d('0xd')],_0xbba19a[_0x6a6d('0xc')][_0x6a6d('0xe')],_0xbba19a['Contact']['lastName']);this['active']=_0xbba19a[_0x6a6d('0xf')]||![];this[_0x6a6d('0x10')]=_0xbba19a[_0x6a6d('0xc')][_0x6a6d('0xd')];this[_0x6a6d('0x11')]=_0xbba19a[_0x6a6d('0x11')];this[_0x6a6d('0x12')]=_0xbba19a[_0x6a6d('0x12')]||0x0;this['countcongestionretry']=_0xbba19a['countcongestionretry']||0x0;this[_0x6a6d('0x13')]=_0xbba19a['countnoanswerretry']||0x0;this[_0x6a6d('0x14')]=(_0xbba19a[_0x6a6d('0x12')]||0x0)+(_0xbba19a['countcongestionretry']||0x0)+(_0xbba19a[_0x6a6d('0x13')]||0x0)+(_0xbba19a[_0x6a6d('0x15')]||0x0)+(_0xbba19a['countdropretry']||0x0)+(_0xbba19a[_0x6a6d('0x16')]||0x0)+(_0xbba19a['countmachineretry']||0x0)+(_0xbba19a[_0x6a6d('0x17')]||0x0);this[_0x6a6d('0x15')]=_0xbba19a[_0x6a6d('0x15')]||0x0;this[_0x6a6d('0x18')]=_0xbba19a['countdropretry']||0x0;this['countabandonedretry']=_0xbba19a['countabandonedretry']||0x0;this[_0x6a6d('0x19')]=_0xbba19a[_0x6a6d('0x19')]||0x0;this[_0x6a6d('0x17')]=_0xbba19a[_0x6a6d('0x17')]||0x0;this[_0x6a6d('0x1a')]=_0xbba19a[_0x6a6d('0x1a')];this['callbackuniqueid']=_0xbba19a['callbackuniqueid'];this[_0x6a6d('0x1b')]=_0xbba19a['callbackat'];this[_0x6a6d('0x1c')]=_0xbba19a[_0x6a6d('0x1c')];this[_0x6a6d('0x1d')]=_0xbba19a[_0x6a6d('0x1d')];this[_0x6a6d('0x1e')]=_0xbba19a[_0x6a6d('0x1e')];this[_0x6a6d('0x1f')]=_[_0x6a6d('0x1')](_0xbba19a['Agent'])?_0xbba19a[_0x6a6d('0x1f')]:_0xbba19a['Agent']['id'];this[_0x6a6d('0x20')]=_0xbba19a['VoiceQueueId'];this[_0x6a6d('0x21')]='';this['originatecalleridname']='';}Action['prototype'][_0x6a6d('0x22')]=function(){return util['format'](_0x6a6d('0x23'),this[_0x6a6d('0xb')],this[_0x6a6d('0x24')]);};module['exports']=Action;
\ No newline at end of file
index 6ae68ec..44c7cac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fa3=['merge','toLowerVariables','channelAgent','destconnectedlinenum','calleridnum','accountcode','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','responsetime','response','custom:agentringnoanswer','rejected','[syncHangup][talking]','cause','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','syncVarSet','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','bluebird','uuid','moment','md5','../../../config/environment','../../../config/logger','preview','../ami','./rpcDb','./action','./util/util','defaults','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','trunks','actions','clockClearZombieChannels','syncOriginateResponse','bind','hangup','syncHangup','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','attendedtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalPauses','message','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','Trunk','active','Interval','stringify','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','setMessage','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','UserId','VoiceQueueId','ListId','Action','status','channel','catch','updateOriginated','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','size','hasOwnProperty','recallMe','getContactRecallMe','agentReadyId','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','run','then','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','createCustomerHistory','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','NOT_ACTIVE','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countglobal','custom:agentnosuchnumber','buildObj','nosuchnumber','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','createCustomerFinal','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','linkedid','answertime','[syncHangup][talking][increment]','uniqueid','custom:agentconnect','connect','complete','answered','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','sumDuration','talktime','[syncHangup][talking][decrement]','\x20Queue','Busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','dialBusyRetryFrequency','activeContact','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','countnoanswerretry','dialNoAnswerRetryFrequency','CONGESTION','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','dialAgentRejectRetryFrequency','countabandonedretry','Abandoned','countabandonedetry','dialAbandonedMaxRety','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','ANSWER','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','checkInBlack','Contact','phone','agents','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','Calling','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','checkIsBlackList','Contact.phone','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables'];(function(_0x198775,_0x29077e){var _0x389c74=function(_0x425690){while(--_0x425690){_0x198775['push'](_0x198775['shift']());}};_0x389c74(++_0x29077e);}(_0x7fa3,0x177));var _0x37fa=function(_0x442ae1,_0x34e977){_0x442ae1=_0x442ae1-0x0;var _0x585adb=_0x7fa3[_0x442ae1];return _0x585adb;};'use strict';var util=require(_0x37fa('0x0'));var _=require('lodash');var BPromise=require(_0x37fa('0x1'));var uuid=require(_0x37fa('0x2'));var moment=require(_0x37fa('0x3'));var md5=require(_0x37fa('0x4'));var Redis=require('ioredis');var config=require(_0x37fa('0x5'));var logger=require(_0x37fa('0x6'))(_0x37fa('0x7'));var loggerAction=require(_0x37fa('0x6'))('actionPreview');var ami=require(_0x37fa('0x8'));var rpcDb=require(_0x37fa('0x9'));var Action=require(_0x37fa('0xa'));var ut=require(_0x37fa('0xb'));config['redis']=_[_0x37fa('0xc')](config[_0x37fa('0xd')],{'host':_0x37fa('0xe'),'port':0x18eb});var io=require(_0x37fa('0xf'))(new Redis(config[_0x37fa('0xd')]));var Sequence=function(){};Sequence[_0x37fa('0x10')][_0x37fa('0x11')]=function(_0x416133){this[_0x37fa('0x12')]=this['tail']?this[_0x37fa('0x12')][_0x37fa('0x13')](_0x416133):_0x416133();};function Preview(_0x49eec2){this[_0x37fa('0x14')]=new Sequence();this[_0x37fa('0x15')]=_0x49eec2['voiceQueues'];this[_0x37fa('0x16')]=_0x49eec2[_0x37fa('0x16')];this[_0x37fa('0x17')]={};this['agents']=_0x49eec2['agents'];this[_0x37fa('0x18')]=0x0;ami['on']('originateresponse',this[_0x37fa('0x19')][_0x37fa('0x1a')](this));ami['on'](_0x37fa('0x1b'),this[_0x37fa('0x1c')]['bind'](this));ami['on']('hanguprequest',this[_0x37fa('0x1d')][_0x37fa('0x1a')](this));ami['on'](_0x37fa('0x1e'),this[_0x37fa('0x1f')][_0x37fa('0x1a')](this));ami['on'](_0x37fa('0x20'),this[_0x37fa('0x21')][_0x37fa('0x1a')](this));ami['on'](_0x37fa('0x22'),this['syncVarSet'][_0x37fa('0x1a')](this));ami['on'](_0x37fa('0x23'),this['syncAttendedTransfer'][_0x37fa('0x1a')](this));ami['on']('blindtransfer',this[_0x37fa('0x24')]['bind'](this));this[_0x37fa('0x25')](this['campaignsPreview']);}function emit(_0x1a62e9,_0x34bed2,_0x55d5dc){io['to'](_0x1a62e9)[_0x37fa('0x26')](_0x34bed2,_0x55d5dc);}function emitCampaignPreview(_0x480578){if(_0x480578[_0x37fa('0x27')]===_0x37fa('0x28')){var _0x55967c={'id':_0x480578['id'],'name':_0x480578[_0x37fa('0x29')],'strategy':_0x480578[_0x37fa('0x2a')],'answered':_0x480578['answered'],'available':_0x480578[_0x37fa('0x2b')],'loggedIn':_0x480578[_0x37fa('0x2c')],'pTalking':_0x480578[_0x37fa('0x2d')],'sumBillable':_0x480578[_0x37fa('0x2e')],'sumDuration':_0x480578['sumDuration'],'sumHoldTime':_0x480578[_0x37fa('0x2f')]||0x0,'talking':_0x480578[_0x37fa('0x30')],'total':_0x480578[_0x37fa('0x31')],'type':_0x480578[_0x37fa('0x27')],'unmanaged':_0x480578[_0x37fa('0x32')],'abandoned':_0x480578[_0x37fa('0x33')],'waiting':_0x480578[_0x37fa('0x34')],'loggedInDb':_0x480578[_0x37fa('0x35')],'dialActive':_0x480578[_0x37fa('0x36')],'dialMethod':_0x480578[_0x37fa('0x37')],'dialOriginateCallerIdName':_0x480578['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x480578[_0x37fa('0x38')],'dialOriginateTimeout':_0x480578[_0x37fa('0x39')],'dialPrefix':_0x480578[_0x37fa('0x3a')],'outboundAnswerAgiCallsDay':_0x480578[_0x37fa('0x3b')],'outboundAnswerCallsDay':_0x480578[_0x37fa('0x3c')],'outboundBlacklistCallsDay':_0x480578['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x480578[_0x37fa('0x3d')],'outboundCongestionCallsDay':_0x480578['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x480578[_0x37fa('0x3e')],'outboundDropCallsDayCallersExit':_0x480578[_0x37fa('0x3f')],'outboundDropCallsDayTimeout':_0x480578[_0x37fa('0x40')],'outboundNoAnswerCallsDay':_0x480578[_0x37fa('0x41')],'outboundNoSuchCallsDay':_0x480578['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x480578[_0x37fa('0x42')],'outboundReCallsDay':_0x480578[_0x37fa('0x43')],'outboundRejectCallsDay':_0x480578[_0x37fa('0x44')],'outboundUnknownCallsDay':_0x480578['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x480578[_0x37fa('0x45')],'predictiveIntervalAnsweredCalls':_0x480578[_0x37fa('0x46')],'predictiveIntervalAvgHoldtime':_0x480578[_0x37fa('0x47')],'predictiveIntervalAvgTalktime':_0x480578['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x480578['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x480578[_0x37fa('0x48')],'predictiveIntervalErlangCalls':_0x480578[_0x37fa('0x49')],'predictiveIntervalErlangCallsDroppedCalls':_0x480578['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x480578[_0x37fa('0x4a')],'predictiveIntervalMultiplicativeFactor':_0x480578['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x480578[_0x37fa('0x4b')],'predictiveIntervalAvailable':_0x480578['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x480578['predictiveIntervalTotalCalls'],'message':_0x480578[_0x37fa('0x4c')],'originated':_0x480578[_0x37fa('0x4d')],'erlangCalls':_0x480578[_0x37fa('0x4e')],'erlangCallToSecond':_0x480578[_0x37fa('0x4f')],'erlangAbandonmentRate':_0x480578['erlangAbandonmentRate'],'erlangBusyFactor':_0x480578[_0x37fa('0x50')],'startPredictive':_0x480578['startPredictive'],'startProgressive':_0x480578['startProgressive']};if(_0x480578[_0x37fa('0x51')]){_0x55967c[_0x37fa('0x51')]={'id':_0x480578[_0x37fa('0x51')]['id'],'name':_0x480578[_0x37fa('0x51')]['name'],'active':_0x480578['Trunk'][_0x37fa('0x52')],'callerid':_0x480578[_0x37fa('0x51')]['callerid']};}if(_0x480578['Interval']){_0x55967c[_0x37fa('0x53')]={'id':_0x480578[_0x37fa('0x53')]['id'],'name':_0x480578[_0x37fa('0x53')][_0x37fa('0x29')]};}var _0x15613f=md5(JSON[_0x37fa('0x54')](_0x55967c));if(_0x480578[_0x37fa('0x4')]!==_0x15613f){_0x480578[_0x37fa('0x4')]=_0x15613f;emit(util['format']('voice:queue:%s',_0x55967c['name']),_0x37fa('0x55'),_0x55967c);}}}function emitVoiceQueueChannelRemove(_0x172ee0){logger[_0x37fa('0x56')](_0x37fa('0x57'),JSON[_0x37fa('0x54')](_0x172ee0));emit(util[_0x37fa('0x58')]('voice:queue:%s',_0x172ee0['name']),_0x37fa('0x59'),_0x172ee0);io[_0x37fa('0x26')](_0x37fa('0x5a'),_0x172ee0);}function notSendMessagesQueue(_0x26e6f1){if(_0x26e6f1['sendMessageOneNotActive']){if(_0x26e6f1[_0x37fa('0x4d')]===0x0&&_0x26e6f1[_0x37fa('0x2d')]===0x0){_0x26e6f1[_0x37fa('0x5b')]=![];_0x26e6f1[_0x37fa('0x2b')]=0x0;_0x26e6f1[_0x37fa('0x5c')]=0x0;_0x26e6f1[_0x37fa('0x4c')]='NOT_ACTIVE';ut[_0x37fa('0x5d')](_0x37fa('0x5e'),_0x26e6f1[_0x37fa('0x29')]+_0x37fa('0x5f'));}else{_0x26e6f1[_0x37fa('0x4c')]=_0x37fa('0x60');ut['logger'](_0x37fa('0x5e'),_0x26e6f1[_0x37fa('0x29')]+_0x37fa('0x61'));}emitCampaignPreview(_0x26e6f1);}}Preview[_0x37fa('0x10')][_0x37fa('0x25')]=function(){var _0x46d6ad=this;setInterval(function(){_0x46d6ad[_0x37fa('0x62')]();},0x7cf);};Preview[_0x37fa('0x10')]['syncCampaigns']=function(){var _0x5bad10=this[_0x37fa('0x15')];this[_0x37fa('0x18')]+=0x1;for(var _0x454d70 in _0x5bad10){if(_0x5bad10['hasOwnProperty'](_0x454d70)&&(_0x5bad10[_0x454d70][_0x37fa('0x37')]==='preview'||_0x5bad10[_0x454d70]['dialMethod']==='booked')&&_0x5bad10[_0x454d70][_0x37fa('0x27')]===_0x37fa('0x28')){if(this[_0x37fa('0x18')]>0x7){this[_0x37fa('0x18')]=0x0;this['clearZombieChannels']();}}if(_0x5bad10['hasOwnProperty'](_0x454d70)&&_0x5bad10[_0x454d70]['dialMethod']===_0x37fa('0x7')&&_0x5bad10[_0x454d70][_0x37fa('0x27')]==='outbound'){if(_0x5bad10[_0x454d70][_0x37fa('0x36')]){this[_0x37fa('0x63')](_0x5bad10[_0x454d70]);this['recallMe'](_0x5bad10[_0x454d70]);}else{notSendMessagesQueue(_0x5bad10[_0x454d70]);}}}};Preview[_0x37fa('0x10')][_0x37fa('0x64')]=function(_0x4d77bf){var _0x3a67c6=this;this[_0x37fa('0x14')][_0x37fa('0x11')](function(){if(!_[_0x37fa('0x65')](_0x3a67c6['actions'][_0x4d77bf])){loggerAction[_0x37fa('0x56')](_0x37fa('0x66'),_0x4d77bf,_0x37fa('0x67'),_0x3a67c6[_0x37fa('0x17')][_0x4d77bf][_0x37fa('0x68')],_0x37fa('0x69'),JSON[_0x37fa('0x54')](_0x3a67c6[_0x37fa('0x15')][_0x3a67c6[_0x37fa('0x17')][_0x4d77bf]['queue']][_0x37fa('0x4d')]),_0x37fa('0x6a'),JSON['stringify'](_0x3a67c6[_0x37fa('0x15')][_0x3a67c6[_0x37fa('0x17')][_0x4d77bf][_0x37fa('0x68')]][_0x37fa('0x2d')]),JSON[_0x37fa('0x54')](_0x3a67c6['actions'][_0x4d77bf][_0x37fa('0x6b')]),JSON['stringify'](_[_0x37fa('0x6c')](_0x3a67c6[_0x37fa('0x17')][_0x4d77bf],['contactId',_0x37fa('0x6d'),_0x37fa('0x6e'),_0x37fa('0x6f')])));return ami[_0x37fa('0x70')]({'action':_0x37fa('0x71'),'channel':_0x3a67c6[_0x37fa('0x17')][_0x4d77bf][_0x37fa('0x72')]})[_0x37fa('0x73')](function(_0x53524c){if(_0x53524c[_0x37fa('0x4c')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x3a67c6[_0x37fa('0x17')][_0x4d77bf]){ut[_0x37fa('0x74')](_0x3a67c6[_0x37fa('0x15')][_0x3a67c6[_0x37fa('0x17')][_0x4d77bf][_0x37fa('0x68')]],'[clearZombieChannel]');if(_0x3a67c6[_0x37fa('0x17')][_0x4d77bf][_0x37fa('0x6b')]===!![]){ut[_0x37fa('0x75')](_0x3a67c6[_0x37fa('0x15')][_0x3a67c6[_0x37fa('0x17')][_0x4d77bf][_0x37fa('0x68')]],'[clearZombieChannel]');ut[_0x37fa('0x76')](_0x37fa('0x77')+_0x4d77bf,_0x3a67c6[_0x37fa('0x17')][_0x4d77bf]['queue']);}ut[_0x37fa('0x76')](_0x37fa('0x78')+_0x4d77bf,_0x3a67c6[_0x37fa('0x17')][_0x4d77bf][_0x37fa('0x68')]);delete _0x3a67c6['actions'][_0x4d77bf];}},0x2328);}});}});};Preview[_0x37fa('0x10')][_0x37fa('0x79')]=function(){var _0x2b65fc=this;loggerAction[_0x37fa('0x56')](_0x37fa('0x7a'),_[_0x37fa('0x7b')](this[_0x37fa('0x17')]));for(var _0x10bc2f in this[_0x37fa('0x17')]){if(_0x2b65fc[_0x37fa('0x17')][_0x37fa('0x7c')](_0x10bc2f)){_0x2b65fc[_0x37fa('0x64')](_0x10bc2f);}}};Preview[_0x37fa('0x10')][_0x37fa('0x7d')]=function(_0x5ab026){var _0x1027bb=this;rpcDb[_0x37fa('0x7e')](_0x5ab026['id'],ut[_0x37fa('0x7f')](this['agents']))['then'](function(_0x547dac){if(!_[_0x37fa('0x65')](_0x547dac)){for(var _0xcb4bbc=0x0;_0xcb4bbc<_0x547dac[_0x37fa('0x80')];_0xcb4bbc+=0x1){if(ut[_0x37fa('0x81')](_0x547dac[_0xcb4bbc][_0x37fa('0x82')])<_0x5ab026[_0x37fa('0x83')]*0x3c){if(_0x547dac[_0xcb4bbc][_0x37fa('0x84')]&&!_0x547dac[_0xcb4bbc][_0x37fa('0x84')]['voicePause']){_0x1027bb[_0x37fa('0x85')](_0x547dac[_0xcb4bbc]['id'])[_0x37fa('0x86')](ut[_0x37fa('0x87')](_0x37fa('0x88')))[_0x37fa('0x73')](ut[_0x37fa('0x87')](_0x37fa('0x88')));}else{rpcDb[_0x37fa('0x89')](_0x547dac[_0xcb4bbc]['id']);}}else{var _0x3f8289=new Action(_0x547dac[_0xcb4bbc],_0x5ab026);_0x3f8289[_0x37fa('0x8a')]=moment()[_0x37fa('0x58')](_0x37fa('0x8b'));_0x5ab026['outboundReCallsDay']+=0x1;ut[_0x37fa('0x8c')](_0x3f8289,0x17,_0x37fa('0x8d'));if(_0x5ab026[_0x37fa('0x8e')]){rpcDb['rescheduleContactInQueue'](ut[_0x37fa('0x8f')](_0x547dac[_0xcb4bbc]));rpcDb['createCustomerHistory'](_0x3f8289,_0x37fa('0x90'));}else{ut[_0x37fa('0x8c')](_0x3f8289,0x16,'RecallFailedTimeout');rpcDb[_0x37fa('0x91')](_0x3f8289,_0x37fa('0x92'));rpcDb['createCustomerFinal'](_0x3f8289,_0x37fa('0x92'));}}}}})[_0x37fa('0x73')](ut['logger2'](_0x37fa('0x93')));};Preview['prototype']['setMessage']=function(_0x1a5666){_0x1a5666['sendMessageOneNotActive']=!![];if(ut[_0x37fa('0x94')](_0x1a5666[_0x37fa('0x2c')])){_0x1a5666['message']=_0x37fa('0x95');}else if(!ut['isActive'](_0x1a5666['dialActive'])){_0x1a5666['message']=_0x37fa('0x96');}else if(!this[_0x37fa('0x97')](_0x1a5666[_0x37fa('0x51')])){if(!this['isTrunkReachable'](_0x1a5666['TrunkBackup'])){_0x1a5666['message']=_0x37fa('0x98');}else{_0x1a5666['message']=_0x37fa('0x99');}}else{_0x1a5666[_0x37fa('0x4c')]=_0x37fa('0x99');}emitCampaignPreview(_0x1a5666);};Preview['prototype'][_0x37fa('0x9a')]=function(_0x26b95a,_0x4f0df0,_0x364e7a){var _0xa28b85=this;var _0x25c359=this[_0x37fa('0x17')][_0x4f0df0];var _0x268c0f=this['campaignsPreview'][_0x25c359[_0x37fa('0x68')]];var _0x50d876;if(_0x268c0f){switch(_0x364e7a){case'1':_0x268c0f[_0x37fa('0x9b')]+=0x1;_0x25c359['countnosuchnumberretry']+=0x1;_0x25c359[_0x37fa('0x9c')]=ut['totalGlobal'](_0x25c359);ut[_0x37fa('0x8c')](_0x25c359,0x0,'NoSuchNumber');ami[_0x37fa('0x26')](_0x37fa('0x9d'),ut[_0x37fa('0x9e')](_0x25c359,_0x37fa('0x9f')));rpcDb[_0x37fa('0x91')](_0x25c359,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0x37fa('0xa0')](_0x25c359)>=_0x268c0f[_0x37fa('0xa1')]){_0x50d876=ut[_0x37fa('0xa2')](_0x25c359,0xf,_0x37fa('0xa3'));rpcDb['createCustomerFinal'](_0x50d876,_0x37fa('0xa4'));}else{if(_0x25c359[_0x37fa('0xa5')]>=_0x268c0f[_0x37fa('0xa6')]){rpcDb[_0x37fa('0xa7')](_0x25c359,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x37fa('0xa8')](ut[_0x37fa('0xa9')](_0x25c359,_0x37fa('0xa5'),_0x268c0f[_0x37fa('0xaa')]),_0x25c359[_0x37fa('0xab')],_0x25c359['activeContact']);}}delete this[_0x37fa('0x17')][_0x26b95a[_0x37fa('0xac')]];break;case'ANSWER':var _0x500107=moment()[_0x37fa('0x58')](_0x37fa('0x8b'));_0x25c359['responsetime']=_0x500107;_0x25c359[_0x37fa('0xad')]=_0x500107;_0x25c359[_0x37fa('0x6b')]=!![];_0x268c0f[_0x37fa('0x2d')]+=0x1;logger[_0x37fa('0x56')](_0x37fa('0xae'),_0x25c359[_0x37fa('0xaf')],'\x20Queue',_0x268c0f[_0x37fa('0x29')],_0x37fa('0x6a'),_0x268c0f[_0x37fa('0x2d')]);ami[_0x37fa('0x26')](_0x37fa('0xb0'),ut[_0x37fa('0x9e')](_0x25c359,_0x37fa('0xb1'),this[_0x37fa('0x15')][_0x25c359['queue']]));if(_0x268c0f['acw']){ami[_0x37fa('0x26')]('custom:agentConnectPreview',ut['buildAcw'](_0x25c359));}break;case'16':ami['emit']('custom:agentcomplete',ut[_0x37fa('0x9e')](_0x25c359,'complete',this[_0x37fa('0x15')][_0x25c359[_0x37fa('0x68')]]));emitVoiceQueueChannelRemove(ut[_0x37fa('0x9e')](_0x25c359,_0x37fa('0xb2')));_0x268c0f[_0x37fa('0x3c')]+=0x1;_0x268c0f[_0x37fa('0x31')]+=0x1;_0x268c0f[_0x37fa('0xb3')]+=0x1;ut['decrementTalkink'](_0x268c0f,_0x37fa('0xb4'));_0x25c359['countglobal']=ut[_0x37fa('0xa0')](_0x25c359);ut[_0x37fa('0x8c')](_0x25c359,0x4,_0x37fa('0xb5'));rpcDb[_0x37fa('0x91')](_0x25c359,_0x37fa('0xb6'));rpcDb[_0x37fa('0xa7')](_0x25c359,_0x37fa('0xb7'));rpcDb['crateCustomerReportQueue'](_0x25c359);_0x268c0f[_0x37fa('0xb8')]+=_0x25c359[_0x37fa('0xb9')];_0x268c0f[_0x37fa('0x2e')]+=_0x25c359[_0x37fa('0xb9')];logger[_0x37fa('0x56')](_0x37fa('0xba'),_0x25c359[_0x37fa('0xaf')],_0x37fa('0xbb'),_0x268c0f[_0x37fa('0x29')],_0x37fa('0x6a'),_0x268c0f['pTalking']);delete this[_0x37fa('0x17')][_0x26b95a[_0x37fa('0xac')]];break;case'BUSY':_0x268c0f[_0x37fa('0x3d')]+=0x1;_0x25c359['countbusyretry']+=0x1;_0x25c359[_0x37fa('0x9c')]=ut[_0x37fa('0xa0')](_0x25c359);ut[_0x37fa('0x8c')](_0x25c359,0x5,_0x37fa('0xbc'));ami[_0x37fa('0x26')]('custom:agentbusy',ut['buildObj'](_0x25c359,'busy'));rpcDb['createCustomerHistory'](_0x25c359,_0x37fa('0xbd'));if(ut['totalGlobal'](_0x25c359)>=_0x268c0f['dialGlobalMaxRetry']){_0x50d876=ut['cloneAction'](_0x25c359,0xf,_0x37fa('0xa3'));rpcDb[_0x37fa('0xa7')](_0x50d876,_0x37fa('0xbe'));}else{if(_0x25c359[_0x37fa('0xbf')]>=_0x268c0f[_0x37fa('0xc0')]){rpcDb[_0x37fa('0xa7')](_0x25c359,_0x37fa('0xbd'));}else{rpcDb[_0x37fa('0xa8')](ut[_0x37fa('0xa9')](_0x25c359,_0x37fa('0xbf'),_0x268c0f[_0x37fa('0xc1')]),_0x25c359[_0x37fa('0xab')],_0x25c359[_0x37fa('0xc2')]);}}break;case'NOANSWER':_0x268c0f[_0x37fa('0x41')]+=0x1;_0x25c359['countnoanswerretry']+=0x1;_0x25c359[_0x37fa('0x9c')]=ut[_0x37fa('0xa0')](_0x25c359);ut[_0x37fa('0x8c')](_0x25c359,0x3,'NoAnswer');ami[_0x37fa('0x26')](_0x37fa('0xc3'),ut[_0x37fa('0x9e')](_0x25c359,_0x37fa('0xc4')));rpcDb[_0x37fa('0x91')](_0x25c359,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0x37fa('0xa0')](_0x25c359)>=_0x268c0f[_0x37fa('0xa1')]){_0x50d876=ut['cloneAction'](_0x25c359,0xf,_0x37fa('0xa3'));rpcDb['createCustomerFinal'](_0x50d876,_0x37fa('0xc5'));}else{if(_0x25c359['countnoanswerretry']>=_0x268c0f[_0x37fa('0xc6')]){rpcDb[_0x37fa('0xa7')](_0x25c359,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x37fa('0xa8')](ut[_0x37fa('0xa9')](_0x25c359,_0x37fa('0xc7'),_0x268c0f[_0x37fa('0xc8')]),_0x25c359[_0x37fa('0xab')],_0x25c359[_0x37fa('0xc2')]);}}break;case _0x37fa('0xc9'):_0x268c0f[_0x37fa('0xca')]+=0x1;_0x25c359['countcongestionretry']+=0x1;_0x25c359[_0x37fa('0x9c')]=ut[_0x37fa('0xa0')](_0x25c359);ut[_0x37fa('0x8c')](_0x25c359,0x8,_0x37fa('0xcb'));ami[_0x37fa('0x26')](_0x37fa('0xcc'),ut['buildObj'](_0x25c359,_0x37fa('0xcd')));rpcDb['createCustomerHistory'](_0x25c359,_0x37fa('0xce'));if(ut[_0x37fa('0xa0')](_0x25c359)>=_0x268c0f['dialGlobalMaxRetry']){_0x50d876=ut[_0x37fa('0xa2')](_0x25c359,0xf,_0x37fa('0xa3'));rpcDb[_0x37fa('0xa7')](_0x50d876,_0x37fa('0xcf'));}else{if(_0x25c359['countcongestionretry']>=_0x268c0f['dialCongestionMaxRetry']){rpcDb[_0x37fa('0xa7')](_0x25c359,_0x37fa('0xce'));}else{rpcDb[_0x37fa('0xa8')](ut[_0x37fa('0xa9')](_0x25c359,_0x37fa('0xd0'),_0x268c0f[_0x37fa('0xc1')]),_0x25c359['unlockAgent'],_0x25c359[_0x37fa('0xc2')]);}}break;case _0x37fa('0xd1'):_0x268c0f[_0x37fa('0x44')]+=0x1;_0x25c359[_0x37fa('0xd2')]+=0x1;_0x25c359[_0x37fa('0x9c')]=ut['totalGlobal'](_0x25c359);ut['logCustomer'](_0x25c359,0x14,_0x37fa('0xd3'));ami[_0x37fa('0x26')](_0x37fa('0xd4'),ut[_0x37fa('0x9e')](_0x25c359,_0x37fa('0xd5')));rpcDb[_0x37fa('0x91')](_0x25c359,_0x37fa('0xd6'));if(ut[_0x37fa('0xa0')](_0x25c359)>=_0x268c0f[_0x37fa('0xa1')]){_0x50d876=ut[_0x37fa('0xa2')](_0x25c359,0x14,_0x37fa('0xd3'));rpcDb['createCustomerFinal'](_0x50d876,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x25c359['countagentrejectretry']>=_0x268c0f['dialAgentRejectMaxRetry']){rpcDb[_0x37fa('0xa7')](_0x25c359,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x37fa('0xa8')](ut[_0x37fa('0xa9')](_0x25c359,_0x37fa('0xd2'),_0x268c0f[_0x37fa('0xd7')]),_0x25c359[_0x37fa('0xab')],_0x25c359[_0x37fa('0xc2')]);}}break;case'ABANDONED':_0x268c0f[_0x37fa('0x45')]+=0x1;_0x25c359[_0x37fa('0xd8')]+=0x1;_0x25c359['countglobal']=ut[_0x37fa('0xa0')](_0x25c359);ut[_0x37fa('0x8c')](_0x25c359,0xb,_0x37fa('0xd9'));rpcDb['createCustomerHistory'](_0x25c359,'[callProgressDetectingCustomer][logAbandoned]');if(ut[_0x37fa('0xa0')](_0x25c359)>=_0x268c0f['dialGlobalMaxRetry']){_0x50d876=ut[_0x37fa('0xa2')](_0x25c359,0xf,_0x37fa('0xa3'));rpcDb[_0x37fa('0xa7')](_0x50d876,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x25c359[_0x37fa('0xda')]>=_0x268c0f[_0x37fa('0xdb')]){rpcDb['createCustomerFinal'](_0x25c359,_0x37fa('0xdc'));}else{rpcDb[_0x37fa('0xa8')](ut[_0x37fa('0xa9')](_0x25c359,_0x37fa('0xd8'),_0x268c0f[_0x37fa('0xdd')]),_0x25c359[_0x37fa('0xab')],_0x25c359[_0x37fa('0xc2')]);}}break;case'18':_0x268c0f[_0x37fa('0xde')]+=0x1;_0x25c359[_0x37fa('0xdf')]+=0x1;_0x25c359[_0x37fa('0x9c')]=ut[_0x37fa('0xa0')](_0x25c359);ut[_0x37fa('0x8c')](_0x25c359,0x12,_0x26b95a[_0x37fa('0xe0')]||_0x26b95a[_0x37fa('0xe1')]);ami[_0x37fa('0x26')]('custom:amd',ut['buildObj'](_0x25c359,_0x37fa('0xe2')));rpcDb[_0x37fa('0x91')](_0x25c359,_0x37fa('0xe3'));if(ut[_0x37fa('0xa0')](_0x25c359)>=_0x268c0f[_0x37fa('0xa1')]){_0x50d876=ut[_0x37fa('0xa2')](_0x25c359,0xf,'Global');rpcDb[_0x37fa('0xa7')](_0x50d876,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0x37fa('0xa7')](_0x25c359,'[callProgressDetectingCustomer][hangupInAMD]');}delete this['actions'][_0x26b95a[_0x37fa('0xac')]];break;case'19':_0x268c0f['outboundUnknownCallsDay']+=0x1;_0x25c359[_0x37fa('0x9c')]=ut[_0x37fa('0xa0')](_0x25c359);ut[_0x37fa('0x8c')](_0x25c359,0x13,_0x26b95a[_0x37fa('0xe0')]||_0x26b95a['dialstatus']);ami[_0x37fa('0x26')]('custom:amd',ut['buildObj'](_0x25c359,_0x37fa('0xe2')));rpcDb['createCustomerHistory'](_0x25c359,'[callProgressDetectingCustomer][machine]');if(ut[_0x37fa('0xa0')](_0x25c359)>=_0x268c0f[_0x37fa('0xa1')]){_0x50d876=ut['cloneAction'](_0x25c359,0xf,_0x37fa('0xa3'));rpcDb['createCustomerFinal'](_0x50d876,_0x37fa('0xe4'));}else{rpcDb[_0x37fa('0xa7')](_0x25c359,'[callProgressDetectingCustomer][machine]');}delete this[_0x37fa('0x17')][_0x26b95a[_0x37fa('0xac')]];break;default:if(_0x25c359[_0x37fa('0x6b')]){ut['decrementTalkink'](_0x268c0f,'[default]');ut[_0x37fa('0x76')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x268c0f[_0x37fa('0x29')],_0x26b95a);}_0x268c0f['outboundUnknownCallsDay']+=0x1;_0x25c359['countglobal']=ut[_0x37fa('0xa0')](_0x25c359);ut['logCustomer'](_0x25c359,0xc,_0x26b95a[_0x37fa('0xe0')]||_0x26b95a[_0x37fa('0xe1')]);rpcDb[_0x37fa('0x91')](_0x25c359,_0x37fa('0xe5'));if(ut[_0x37fa('0xa0')](_0x25c359)>=_0x268c0f[_0x37fa('0xa1')]){_0x50d876=ut['cloneAction'](_0x25c359,0xf,_0x37fa('0xa3'));rpcDb[_0x37fa('0xa7')](_0x50d876,_0x37fa('0xe6'));}else{rpcDb['createCustomerFinal'](_0x25c359,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x37fa('0x17')][_0x26b95a[_0x37fa('0xac')]];}if(!(_0x25c359['dialAnswer']&&_0x364e7a==='16')){ut[_0x37fa('0x74')](_0x268c0f,_0x37fa('0xe7'));logger[_0x37fa('0x56')](_0x37fa('0xe8'),_0x25c359[_0x37fa('0xaf')],_0x37fa('0xbb'),_0x268c0f[_0x37fa('0x29')],_0x37fa('0x69'),_0x268c0f[_0x37fa('0x4d')]);}if(_0x364e7a!==_0x37fa('0xe9')){delete this[_0x37fa('0x17')][_0x26b95a['linkedid']];delete this['actions'][_0x26b95a[_0x37fa('0xea')]];}}};Preview[_0x37fa('0x10')][_0x37fa('0xeb')]=function(_0x5d15ed,_0x23a2aa,_0xb651e3){if(_[_0x37fa('0xec')](_0x23a2aa)&&_0x37fa('0xed')!==typeof _0x23a2aa){return;}if(_[_0x37fa('0xec')](_0xb651e3)&&_0x37fa('0xed')!==typeof _0xb651e3){return;}switch(_0xb651e3[_0x37fa('0xee')]){case'0':ut['logAgent'](_0x5d15ed,0x0,_0x37fa('0xef'));rpcDb[_0x37fa('0xf0')](_0x5d15ed,_0x37fa('0xf1'));break;case'3':ut[_0x37fa('0xf2')](_0x5d15ed,0x3,_0x37fa('0xf3'));rpcDb[_0x37fa('0xf0')](_0x5d15ed,_0x37fa('0xf4'));break;case'5':ut[_0x37fa('0xf2')](_0x5d15ed,0x5,_0x37fa('0xbc'));rpcDb[_0x37fa('0xf0')](_0x5d15ed,_0x37fa('0xf5'));break;case'8':ut[_0x37fa('0xf2')](_0x5d15ed,0x8,_0x37fa('0xcb'));rpcDb[_0x37fa('0xf0')](_0x5d15ed,_0x37fa('0xf6'));break;case'22':ut[_0x37fa('0xf2')](_0x5d15ed,0x16,_0x37fa('0xf7'));rpcDb[_0x37fa('0xf0')](_0x5d15ed,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x37fa('0xf2')](_0x5d15ed,0xc,_0xb651e3[_0x37fa('0xee')]);rpcDb[_0x37fa('0xf0')](_0x5d15ed,_0x37fa('0xf6'));}ut['updateOriginated'](_0x23a2aa,_0x37fa('0xf8'));logger[_0x37fa('0x56')]('[originated][decrement][callProgressDetectingAgent]',_0x5d15ed[_0x37fa('0xaf')],_0x37fa('0xbb'),_0x23a2aa['name'],'originated:\x20',_0x23a2aa[_0x37fa('0x4d')]);delete this[_0x37fa('0x17')][_0x5d15ed[_0x37fa('0xaf')]];};Preview['prototype'][_0x37fa('0xf9')]=function(_0x7f5e0f,_0x3c1d8c,_0x244e38,_0x73a021,_0x1f4575){var _0x578ac9=this;return new BPromise(function(_0x53cc68,_0x2f3b08){if(_['isNil'](_0x3c1d8c)||_[_0x37fa('0x65')](_0x3c1d8c[_0x37fa('0xfa')])||_[_0x37fa('0x65')](_0x3c1d8c[_0x37fa('0xfa')][_0x37fa('0xfb')])||_[_0x37fa('0x65')](_0x3c1d8c[_0x37fa('0x6e')])){_0x2f3b08(ut[_0x37fa('0x4c')]('Contact\x20is\x20undefined',_0x73a021,_0x1f4575));return;}var _0x20fd41=uuid['v4']();var _0xac99f1=_0x578ac9[_0x37fa('0x15')][_0x3c1d8c[_0x37fa('0x67')][_0x37fa('0x29')]];var _0x53fa3c=_0x244e38?_0x578ac9[_0x37fa('0xfc')][_0x244e38]['id']:undefined;_0x578ac9['actions'][_0x20fd41]=new Action(_0x3c1d8c,_0xac99f1,_0x20fd41,_0x244e38,_0x53fa3c);var _0x4a5d60=_0x578ac9['actions'][_0x20fd41];_0x4a5d60['unlockAgent']=_0x73a021;_0x4a5d60[_0x37fa('0xc2')]=_0x1f4575;_0x4a5d60[_0x37fa('0xfd')]=_0x244e38;if(_[_0x37fa('0xfe')](_0x7f5e0f)){_0x578ac9[_0x37fa('0xff')](_0x4a5d60,_0xac99f1,_0x3c1d8c,_0x244e38)['then'](function(_0x1df6ca){logger[_0x37fa('0x56')](_0x37fa('0x100'),_0x37fa('0x101')+_0x4a5d60[_0x37fa('0x68')]+_0x37fa('0x102')+_0x4a5d60[_0x37fa('0x103')],JSON['stringify'](_0x1df6ca));ami['emit'](_0x37fa('0x104'),ut['buildObj'](_0x4a5d60,'called',_0x578ac9[_0x37fa('0x15')][_0x4a5d60['queue']]));_0x53cc68(ut['message'](_0x37fa('0x105')));})['catch'](function(_0xc55c37){ut[_0x37fa('0x5d')]('[Preview][execCall][failure]',_0xc55c37);_0x2f3b08(ut[_0x37fa('0x4c')](_0x37fa('0x106'),_0x73a021,_0x1f4575));});}else{_0xac99f1['outboundBlacklistCallsDay']+=0x1;ut[_0x37fa('0x107')](_0x4a5d60);rpcDb[_0x37fa('0x108')](_0x4a5d60,_0x37fa('0x109'));delete _0x578ac9[_0x37fa('0x17')][_0x20fd41];_0x2f3b08(ut[_0x37fa('0x4c')]('Contact\x20in\x20black\x20List',_0x73a021,_0x1f4575));}});};Preview['prototype'][_0x37fa('0x97')]=function(_0x1ca43f){return!_[_0x37fa('0x65')](_0x1ca43f)&&!_['isNil'](_0x1ca43f[_0x37fa('0x29')])&&!_[_0x37fa('0x65')](_0x1ca43f['active'])&&_0x1ca43f[_0x37fa('0x52')]&&!_[_0x37fa('0x65')](this[_0x37fa('0x16')][util[_0x37fa('0x58')](_0x37fa('0x10a'),_0x1ca43f[_0x37fa('0x29')])])&&!_[_0x37fa('0x65')](this[_0x37fa('0x16')][util['format'](_0x37fa('0x10a'),_0x1ca43f[_0x37fa('0x29')])][_0x37fa('0x71')])&&(this[_0x37fa('0x16')][util['format']('SIP/%s',_0x1ca43f[_0x37fa('0x29')])]['status']===_0x37fa('0x10b')||this[_0x37fa('0x16')][util[_0x37fa('0x58')](_0x37fa('0x10a'),_0x1ca43f[_0x37fa('0x29')])]['status']===_0x37fa('0x10c'));};Preview['prototype'][_0x37fa('0x85')]=function(_0xaccb84,_0x509890){var _0x2bfc60=this;return new BPromise(function(_0x4d98be,_0x2cc09d){_0x2bfc60[_0x37fa('0x10d')](_0xaccb84,_0x509890)[_0x37fa('0x86')](function(_0x1ff5ed){_0x4d98be(_[_0x37fa('0x6c')](_0x1ff5ed,[_0x37fa('0x4c')]));})[_0x37fa('0x73')](function(_0x358b30){if(_0x358b30[_0x37fa('0x10e')]){rpcDb[_0x37fa('0x10f')](_0xaccb84);}if(_0x358b30[_0x37fa('0x52')]){rpcDb[_0x37fa('0x89')](_0xaccb84);}_0x2cc09d(_['pick'](_0x358b30,['message']));});});};Preview[_0x37fa('0x10')][_0x37fa('0x10d')]=function(_0x2dfa6b,_0x1eadb0){var _0x27d0ab=this;return new BPromise(function(_0x15a67a,_0x15f4a7){var _0x823d89,_0x5cad75;rpcDb[_0x37fa('0x110')](_0x2dfa6b)['then'](function(_0x2e2d58){if(!_[_0x37fa('0x65')](_0x2e2d58[0x0])){_0x5cad75=_0x2e2d58[0x0][_0x37fa('0x111')]?![]:!![];_0x823d89=_0x2e2d58[0x0][_0x37fa('0x111')]?!![]:![];_0x823d89=_0x1eadb0?!![]:_0x823d89;}var _0x272780=_0x27d0ab[_0x37fa('0x112')](_0x2e2d58);if(_0x272780['isValid']){rpcDb[_0x37fa('0x113')](_[_0x37fa('0x6c')](_0x2e2d58[0x0],[_0x37fa('0x6e'),_0x37fa('0x114')]))['then'](function(_0x588320){_0x27d0ab[_0x37fa('0xf9')](_0x588320,_0x2e2d58[0x0],_0x1eadb0,_0x5cad75,_0x823d89)[_0x37fa('0x86')](function(_0x5d08f9){_0x15a67a(_0x5d08f9);})[_0x37fa('0x73')](function(_0x56d2bd){_0x15f4a7(_0x56d2bd);});})[_0x37fa('0x73')](function(_0x5d8728){ut['logger']('[Preview][checkIsBlackList]',_0x5d8728);_0x15f4a7(ut[_0x37fa('0x4c')](_0x37fa('0x115'),_0x5cad75,_0x823d89));});}else{_0x15f4a7(ut[_0x37fa('0x4c')](_0x272780['message'],_0x5cad75,_0x823d89));}})[_0x37fa('0x73')](function(_0x305f2f){ut[_0x37fa('0x5d')](_0x37fa('0x116'),_0x305f2f);_0x15f4a7(ut[_0x37fa('0x4c')](_0x37fa('0x115'),![],!![]));});});};Preview[_0x37fa('0x10')]['validateContact']=function(_0x3cb22a){if(_['isNil'](_0x3cb22a)||_['isEmpty'](_0x3cb22a)||!_[_0x37fa('0x65')](_0x3cb22a[0x0][_0x37fa('0x84')])&&_['isNil'](_0x3cb22a[0x0][_0x37fa('0x84')]['name'])){ut[_0x37fa('0x5d')](_0x37fa('0x117'),_0x3cb22a);return{'isValid':![],'message':_0x37fa('0x118')};}var _0x59133c=this[_0x37fa('0x15')][_0x3cb22a[0x0][_0x37fa('0x67')][_0x37fa('0x29')]];_0x59133c[_0x37fa('0x4c')]=_0x37fa('0x99');if(_[_0x37fa('0x65')](_0x59133c)){ut[_0x37fa('0x5d')](_0x37fa('0x119'),_0x59133c);return{'isValid':![],'message':_0x37fa('0x11a')};}if(!this[_0x37fa('0x97')](_0x59133c[_0x37fa('0x51')])){ut[_0x37fa('0x5d')](_0x37fa('0x11b'),_0x37fa('0x11c')+_0x59133c[_0x37fa('0x29')]+_0x37fa('0x11d'));if(!this[_0x37fa('0x97')](_0x59133c[_0x37fa('0x11e')])){ut['logger'](_0x37fa('0x11b'),_0x59133c[_0x37fa('0x29')]+_0x37fa('0x11f'));return{'isValid':![],'message':_0x37fa('0x120')};}}if(!ut[_0x37fa('0x121')](_0x59133c['dialActive'])){ut[_0x37fa('0x5d')](_0x37fa('0x122'),_0x59133c[_0x37fa('0x29')]+_0x37fa('0x123'));return{'isValid':![],'message':_0x37fa('0x11c')+_0x59133c[_0x37fa('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x37fa('0x124')};};Preview[_0x37fa('0x10')]['execCall']=function(_0x625d5f,_0x49dc64,_0x457eea,_0x4234cd){var _0x1c9229=this;return new BPromise(function(_0x49bba3,_0x639f7c){var _0x43f74b=_0x625d5f[_0x37fa('0xaf')];var _0x150741=_0x1c9229[_0x37fa('0x97')](_0x49dc64[_0x37fa('0x51')])?util[_0x37fa('0x58')](_0x37fa('0x125'),_0x49dc64[_0x37fa('0x51')][_0x37fa('0x29')],_['isNil'](_0x49dc64[_0x37fa('0x3a')])?'':_0x49dc64[_0x37fa('0x3a')][_0x37fa('0x126')]()||'',_0x49dc64[_0x37fa('0x127')]>0x0?_0x457eea[_0x37fa('0xfa')][_0x37fa('0xfb')][_0x37fa('0x128')](_0x49dc64['dialCutDigit']):_0x457eea[_0x37fa('0xfa')][_0x37fa('0xfb')]):util[_0x37fa('0x58')]('SIP/%s/%s%s',_[_0x37fa('0x65')](_0x49dc64['TrunkBackup'])?_0x49dc64[_0x37fa('0x51')][_0x37fa('0x29')]:_0x49dc64[_0x37fa('0x11e')][_0x37fa('0x29')],_[_0x37fa('0x65')](_0x49dc64['dialPrefix'])?'':_0x49dc64[_0x37fa('0x3a')][_0x37fa('0x126')]()||'',_0x49dc64[_0x37fa('0x127')]>0x0?_0x457eea[_0x37fa('0xfa')]['phone'][_0x37fa('0x128')](_0x49dc64[_0x37fa('0x127')]):_0x457eea[_0x37fa('0xfa')][_0x37fa('0xfb')]);var _0x366188=_0x1c9229[_0x37fa('0x97')](_0x49dc64[_0x37fa('0x51')])?ut[_0x37fa('0x129')](_0x49dc64[_0x37fa('0x51')]['callerid'],_0x49dc64[_0x37fa('0x12a')],_0x49dc64[_0x37fa('0x12b')]>0x0?ut['getCallerIdRandom'](_0x49dc64[_0x37fa('0x38')],_0x49dc64[_0x37fa('0x12b')]):_0x49dc64[_0x37fa('0x38')]):ut[_0x37fa('0x129')](_[_0x37fa('0x65')](_0x49dc64[_0x37fa('0x11e')])?_0x49dc64['Trunk']['callerid']:_0x49dc64[_0x37fa('0x11e')]['callerid'],_0x49dc64['dialOriginateCallerIdName'],_0x49dc64['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x49dc64[_0x37fa('0x38')],_0x49dc64[_0x37fa('0x12b')]):_0x49dc64[_0x37fa('0x38')]);if(_0x366188){_0x625d5f[_0x37fa('0x12c')]=ut[_0x37fa('0x12d')](_0x366188);_0x625d5f[_0x37fa('0x12e')]=ut[_0x37fa('0x12f')](_0x366188);}var _0x192f3b=ut[_0x37fa('0x130')](_0x49dc64,_0x457eea,_0x150741,_0x366188,_0x43f74b,_0x625d5f);_[_0x37fa('0x131')](_0x625d5f,ut[_0x37fa('0x132')](_0x192f3b));_0x625d5f[_0x37fa('0x8a')]=moment()[_0x37fa('0x58')](_0x37fa('0x8b'));ami['Action'](ut['variablesAction'](_0x625d5f,_0x49dc64,_0x192f3b,_0x625d5f[_0x37fa('0xc2')],_0x4234cd))[_0x37fa('0x86')](function(_0x419108){var _0x5091a8=_0x625d5f[_0x37fa('0x133')];if(!_[_0x37fa('0x65')](_0x5091a8)){if(!_[_0x37fa('0x65')](_0x1c9229[_0x37fa('0xfc')][_0x5091a8])){_0x1c9229['agents'][_0x5091a8][_0x37fa('0x134')]=_0x625d5f[_0x37fa('0x135')];emit(util[_0x37fa('0x58')]('user:%s',_0x1c9229[_0x37fa('0xfc')][_0x5091a8][_0x37fa('0x29')]),'user:agentconnect',{'destaccountcode':_0x1c9229[_0x37fa('0xfc')][_0x5091a8][_0x37fa('0x136')],'destconnectedlinenum':_0x625d5f[_0x37fa('0x135')]});}}_0x49dc64['originated']+=0x1;logger[_0x37fa('0x56')](_0x37fa('0x137'),_0x43f74b,_0x37fa('0xbb'),_0x49dc64[_0x37fa('0x29')],_0x37fa('0x69'),_0x49dc64[_0x37fa('0x4d')]);_0x49bba3(_0x419108);})[_0x37fa('0x73')](function(_0x647d35){ut['logAgent'](_0x625d5f,0xe,_0x37fa('0x138'));rpcDb['createAgentHistory'](_0x625d5f,_0x37fa('0x139'));_0x639f7c(_0x647d35);});});};Preview[_0x37fa('0x10')][_0x37fa('0x21')]=function(_0x18c2e4){if(this[_0x37fa('0x17')][_0x18c2e4[_0x37fa('0xac')]]){this[_0x37fa('0x17')][_0x18c2e4[_0x37fa('0xac')]][_0x37fa('0x72')]=_0x18c2e4[_0x37fa('0x72')];}};Preview[_0x37fa('0x10')][_0x37fa('0x19')]=function(_0x3c3757){var _0x4d31b2=this;var _0x20a95b=this[_0x37fa('0x17')][_0x3c3757[_0x37fa('0x13a')]];if(_0x20a95b){if(_0x20a95b[_0x37fa('0xfd')]&&this[_0x37fa('0xfc')][_0x20a95b[_0x37fa('0xfd')]]){ut[_0x37fa('0x13b')](_0x20a95b,this[_0x37fa('0xfc')][_0x20a95b[_0x37fa('0xfd')]][_0x37fa('0x29')],this['agents'][_0x20a95b['lookAgent']]['id']);}var _0x2e6816=_['clone'](_0x20a95b);_0x2e6816[_0x37fa('0x13c')]=moment()[_0x37fa('0x58')](_0x37fa('0x8b'));var _0x4acc6e=_0x4d31b2[_0x37fa('0x15')][_0x20a95b[_0x37fa('0x68')]];if(ut['isFailure'](_0x3c3757[_0x37fa('0x13d')])){if(_0x20a95b[_0x37fa('0xab')]){rpcDb[_0x37fa('0x10f')](_0x20a95b[_0x37fa('0x103')]);}if(_0x20a95b[_0x37fa('0xc2')]){rpcDb['disableContact'](_0x20a95b['idContact']);}ami[_0x37fa('0x26')](_0x37fa('0x13e'),ut[_0x37fa('0x9e')](_0x20a95b,_0x37fa('0x13f'),this[_0x37fa('0x15')][_0x20a95b['queue']]));this[_0x37fa('0xeb')](_0x2e6816,_0x4acc6e,_0x3c3757);}else{_0x20a95b['starttime']=moment()[_0x37fa('0x58')](_0x37fa('0x8b'));ut[_0x37fa('0xf2')](_0x2e6816,0x4,_0x37fa('0xb5'));rpcDb[_0x37fa('0xf0')](_0x2e6816,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x37fa('0x10')][_0x37fa('0x1c')]=function(_0x292c83){var _0x2e6c16=this;var _0x7157a4=this[_0x37fa('0x17')][_0x292c83[_0x37fa('0xac')]];var _0xce0156;if(_0x7157a4){_0xce0156=this[_0x37fa('0x15')][_0x7157a4[_0x37fa('0x68')]];logger[_0x37fa('0x56')](_0x37fa('0x140'),_0x292c83[_0x37fa('0xac')],_0x37fa('0xbb'),_0xce0156['name'],_0x37fa('0x6a'),_0xce0156[_0x37fa('0x2d')]);}if(this[_0x37fa('0x17')][_0x292c83[_0x37fa('0xac')]]&&_0x292c83[_0x37fa('0xac')]!==_0x292c83[_0x37fa('0xaf')]){if(_0x292c83[_0x37fa('0x141')]==='16'&&this[_0x37fa('0x17')][_0x292c83[_0x37fa('0xac')]][_0x37fa('0x6b')]){this[_0x37fa('0x9a')](_0x292c83,_0x292c83[_0x37fa('0xac')],_0x292c83[_0x37fa('0x141')]);}else if(this['actions'][_0x292c83[_0x37fa('0xac')]][_0x37fa('0x6b')]){logger[_0x37fa('0x56')]('[syncHangup][talking][cause]',_0x292c83['linkedid'],_0x292c83[_0x37fa('0x141')],_0x37fa('0xbb'),_0xce0156['name'],_0x37fa('0x6a'),_0xce0156[_0x37fa('0x2d')]);this[_0x37fa('0x9a')](_0x292c83,_0x292c83[_0x37fa('0xac')],_0x292c83['cause']);}}else if(_0x7157a4&&_[_0x37fa('0x65')](_0x7157a4[_0x37fa('0x142')])&&_0xce0156[_0x37fa('0x143')]&&_0x292c83[_0x37fa('0xac')]===_0x292c83['uniqueid']&&_[_0x37fa('0x65')](_0x292c83['reason'])&&_0x292c83[_0x37fa('0x141')]==='16'&&_0x292c83[_0x37fa('0x144')]==='6'&&_[_0x37fa('0xec')](_0x7157a4[_0x37fa('0x145')])){if(_0x7157a4[_0x37fa('0xab')]){rpcDb[_0x37fa('0x10f')](_0x7157a4[_0x37fa('0x103')]);}if(_0x7157a4[_0x37fa('0xc2')]){rpcDb[_0x37fa('0x89')](_0x7157a4[_0x37fa('0x103')]);}_0x292c83[_0x37fa('0xee')]='22';this[_0x37fa('0xeb')](_0x7157a4,_0xce0156,_0x292c83);}else if(_0x7157a4&&_0x7157a4[_0x37fa('0x145')]){if(_0x292c83[_0x37fa('0x141')]==='16'&&this[_0x37fa('0x17')][_0x292c83[_0x37fa('0xac')]][_0x37fa('0x6b')]){logger['info'](_0x37fa('0x146'),_0x292c83[_0x37fa('0xac')],_0x292c83['cause'],'\x20Queue',_0xce0156[_0x37fa('0x29')],'pTalking:\x20',_0xce0156[_0x37fa('0x2d')]);this['callProgressDetectingCustomer'](_0x292c83,_0x292c83[_0x37fa('0xac')],_0x292c83[_0x37fa('0x141')]);}else if(this['actions'][_0x292c83[_0x37fa('0xac')]]['dialAnswer']){logger[_0x37fa('0x56')]('[syncHangup][talking][cause]',_0x292c83[_0x37fa('0xac')],_0x292c83[_0x37fa('0x141')],_0x37fa('0xbb'),_0xce0156[_0x37fa('0x29')],'pTalking:\x20',_0xce0156[_0x37fa('0x2d')]);this['callProgressDetectingCustomer'](_0x292c83,_0x292c83['linkedid'],_0x292c83[_0x37fa('0x141')]);}}};Preview[_0x37fa('0x10')][_0x37fa('0x1f')]=function(_0x5f013c){if(this[_0x37fa('0x17')][_0x5f013c['destlinkedid']]&&_0x5f013c['destlinkedid']!==_0x5f013c[_0x37fa('0x147')]){this[_0x37fa('0x9a')](_0x5f013c,_0x5f013c[_0x37fa('0xea')],_0x5f013c['dialstatus']);}};Preview[_0x37fa('0x10')][_0x37fa('0x1d')]=function(_0x2f86c7){if(this[_0x37fa('0x17')][_0x2f86c7[_0x37fa('0xac')]]&&_0x2f86c7[_0x37fa('0xac')]!==_0x2f86c7[_0x37fa('0xaf')]&&!this['actions'][_0x2f86c7[_0x37fa('0xac')]]['dialAnswer']){if(_0x2f86c7['cause']==='1'){this[_0x37fa('0x9a')](_0x2f86c7,_0x2f86c7['linkedid'],_0x2f86c7['cause']);}}};Preview[_0x37fa('0x10')][_0x37fa('0x148')]=function(_0xb40e14,_0x6a2013,_0x1a07c9){if(this[_0x37fa('0x17')][_0xb40e14]){if(_[_0x37fa('0x65')](this[_0x37fa('0x17')][_0xb40e14][_0x37fa('0x149')])){this['actions'][_0xb40e14][_0x37fa('0x149')]={};}this[_0x37fa('0x17')][_0xb40e14][_0x37fa('0x149')][_0x6a2013]=_0x1a07c9;}};Preview[_0x37fa('0x10')][_0x37fa('0x14a')]=function(_0x38ca25){try{if(!_[_0x37fa('0x65')](_0x38ca25)){if(ut['filterKey'](_[_0x37fa('0x14b')](_0x38ca25[_0x37fa('0x14c')])[0x0])){this[_0x37fa('0x148')](_0x38ca25[_0x37fa('0xaf')],_['keys'](_0x38ca25[_0x37fa('0x14c')])[0x0],_0x38ca25[_0x37fa('0x14d')]);}}}catch(_0x1e5c92){logger[_0x37fa('0x14e')](_0x37fa('0x14f'),util[_0x37fa('0x150')](_0x1e5c92,{'showHidden':![],'depth':null}));}};Preview[_0x37fa('0x10')]['syncAttendedTransfer']=function(_0x4fc579){if(_0x4fc579){if(this[_0x37fa('0x17')][_0x4fc579[_0x37fa('0x151')]]){this[_0x37fa('0x17')][_0x4fc579[_0x37fa('0x151')]][_0x37fa('0x145')]=!![];}}};Preview[_0x37fa('0x10')][_0x37fa('0x24')]=function(_0x22dcb9){if(_0x22dcb9){if(this[_0x37fa('0x17')][_0x22dcb9[_0x37fa('0x152')]]){this['actions'][_0x22dcb9[_0x37fa('0x152')]][_0x37fa('0x145')]=!![];}}};module[_0x37fa('0x153')]=Preview;
\ No newline at end of file
+var _0x7602=['CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','cause-txt','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','custom:amd','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','ANSWER','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','isNil','Contact','lookAgent','isEmpty','execCall','then','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','unmonitored','execRun','unlock','unlockContact','pick','getContactPreview','checkIsBlackList','Contact.phone','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','\x20Not\x20Active','SIP/%s/%s%s','trim','dialCutDigit','phone','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdName','originatecalleridname','extractCalleridName','extractCalleridNumber','merge','starttime','variablesAction','channelAgent','calleridnum','user:%s','accountcode','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','syncHangupRequest','addVariable','variables','syncVarSet','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','moment','md5','ioredis','../../../config/logger','preview','actionPreview','./action','./util/util','defaults','redis','socket.io-emitter','prototype','enqueue','tail','finally','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','bind','hangup','syncHangup','hanguprequest','dialend','newexten','syncNewExten','varset','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','outbound','name','strategy','available','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','erlangCallToSecond','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','paused','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','logger','\x20is\x20disactive','syncCampaigns','booked','type','clearZombieChannels','setMessage','recallMe','sequence','[clearZombieChannels][talking]','Queue','originated:\x20','contactId','VoiceQueueId','ListId','Action','status','channel','catch','updateOriginated','queue','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[action]','size','clearZombieChannel','getContactRecallMe','agentReadyId','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','loggedIn','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','linkedid','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','pTalking:\x20','custom:agentconnect','connect','acw','buildAcw','custom:agentcomplete','complete','answered','[16]','totalGlobal','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','\x20Queue','BUSY','countbusyretry','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','NoAnswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerRetryFrequency','activeContact'];(function(_0x3fe152,_0x1b50c8){var _0x292080=function(_0x45dfb3){while(--_0x45dfb3){_0x3fe152['push'](_0x3fe152['shift']());}};_0x292080(++_0x1b50c8);}(_0x7602,0x8e));var _0x2760=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x7602[_0xc4001c];return _0x49f7bc;};'use strict';var util=require(_0x2760('0x0'));var _=require(_0x2760('0x1'));var BPromise=require(_0x2760('0x2'));var uuid=require('uuid');var moment=require(_0x2760('0x3'));var md5=require(_0x2760('0x4'));var Redis=require(_0x2760('0x5'));var config=require('../../../config/environment');var logger=require(_0x2760('0x6'))(_0x2760('0x7'));var loggerAction=require(_0x2760('0x6'))(_0x2760('0x8'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Action=require(_0x2760('0x9'));var ut=require(_0x2760('0xa'));config['redis']=_[_0x2760('0xb')](config[_0x2760('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0x2760('0xd'))(new Redis(config[_0x2760('0xc')]));var Sequence=function(){};Sequence[_0x2760('0xe')][_0x2760('0xf')]=function(_0x2a37ca){this[_0x2760('0x10')]=this[_0x2760('0x10')]?this['tail'][_0x2760('0x11')](_0x2a37ca):_0x2a37ca();};function Preview(_0x2ff5c1){this['sequence']=new Sequence();this[_0x2760('0x12')]=_0x2ff5c1[_0x2760('0x13')];this[_0x2760('0x14')]=_0x2ff5c1['trunks'];this[_0x2760('0x15')]={};this['agents']=_0x2ff5c1[_0x2760('0x16')];this[_0x2760('0x17')]=0x0;ami['on'](_0x2760('0x18'),this['syncOriginateResponse'][_0x2760('0x19')](this));ami['on'](_0x2760('0x1a'),this[_0x2760('0x1b')][_0x2760('0x19')](this));ami['on'](_0x2760('0x1c'),this['syncHangupRequest']['bind'](this));ami['on'](_0x2760('0x1d'),this['syncDialEnd'][_0x2760('0x19')](this));ami['on'](_0x2760('0x1e'),this[_0x2760('0x1f')][_0x2760('0x19')](this));ami['on'](_0x2760('0x20'),this['syncVarSet']['bind'](this));ami['on'](_0x2760('0x21'),this[_0x2760('0x22')][_0x2760('0x19')](this));ami['on'](_0x2760('0x23'),this[_0x2760('0x24')][_0x2760('0x19')](this));this[_0x2760('0x25')](this['campaignsPreview']);}function emit(_0x9f055b,_0x457fdf,_0x4db21f){io['to'](_0x9f055b)[_0x2760('0x26')](_0x457fdf,_0x4db21f);}function emitCampaignPreview(_0x33bf65){if(_0x33bf65['type']===_0x2760('0x27')){var _0x469ae0={'id':_0x33bf65['id'],'name':_0x33bf65[_0x2760('0x28')],'strategy':_0x33bf65[_0x2760('0x29')],'answered':_0x33bf65['answered'],'available':_0x33bf65[_0x2760('0x2a')],'loggedIn':_0x33bf65['loggedIn'],'pTalking':_0x33bf65[_0x2760('0x2b')],'sumBillable':_0x33bf65[_0x2760('0x2c')],'sumDuration':_0x33bf65[_0x2760('0x2d')],'sumHoldTime':_0x33bf65[_0x2760('0x2e')]||0x0,'talking':_0x33bf65[_0x2760('0x2f')],'total':_0x33bf65[_0x2760('0x30')],'type':_0x33bf65['type'],'unmanaged':_0x33bf65['unmanaged'],'abandoned':_0x33bf65[_0x2760('0x31')],'waiting':_0x33bf65[_0x2760('0x32')],'loggedInDb':_0x33bf65[_0x2760('0x33')],'dialActive':_0x33bf65[_0x2760('0x34')],'dialMethod':_0x33bf65[_0x2760('0x35')],'dialOriginateCallerIdName':_0x33bf65['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x33bf65[_0x2760('0x36')],'dialOriginateTimeout':_0x33bf65[_0x2760('0x37')],'dialPrefix':_0x33bf65[_0x2760('0x38')],'outboundAnswerAgiCallsDay':_0x33bf65['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x33bf65[_0x2760('0x39')],'outboundBlacklistCallsDay':_0x33bf65[_0x2760('0x3a')],'outboundBusyCallsDay':_0x33bf65[_0x2760('0x3b')],'outboundCongestionCallsDay':_0x33bf65['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x33bf65['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x33bf65[_0x2760('0x3c')],'outboundDropCallsDayTimeout':_0x33bf65['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x33bf65[_0x2760('0x3d')],'outboundNoSuchCallsDay':_0x33bf65['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x33bf65[_0x2760('0x3e')],'outboundReCallsDay':_0x33bf65[_0x2760('0x3f')],'outboundRejectCallsDay':_0x33bf65['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x33bf65[_0x2760('0x40')],'outboundAbandonedCallsDay':_0x33bf65['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x33bf65[_0x2760('0x41')],'predictiveIntervalAvgHoldtime':_0x33bf65[_0x2760('0x42')],'predictiveIntervalAvgTalktime':_0x33bf65['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x33bf65['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x33bf65[_0x2760('0x43')],'predictiveIntervalErlangCalls':_0x33bf65[_0x2760('0x44')],'predictiveIntervalErlangCallsDroppedCalls':_0x33bf65[_0x2760('0x45')],'predictiveIntervalHitRate':_0x33bf65[_0x2760('0x46')],'predictiveIntervalMultiplicativeFactor':_0x33bf65[_0x2760('0x47')],'predictiveIntervalPauses':_0x33bf65[_0x2760('0x48')],'predictiveIntervalAvailable':_0x33bf65[_0x2760('0x49')],'predictiveIntervalTotalCalls':_0x33bf65[_0x2760('0x4a')],'message':_0x33bf65[_0x2760('0x4b')],'originated':_0x33bf65['originated'],'erlangCalls':_0x33bf65['erlangCalls'],'erlangCallToSecond':_0x33bf65[_0x2760('0x4c')],'erlangAbandonmentRate':_0x33bf65['erlangAbandonmentRate'],'erlangBusyFactor':_0x33bf65['erlangBusyFactor'],'startPredictive':_0x33bf65[_0x2760('0x4d')],'startProgressive':_0x33bf65[_0x2760('0x4e')]};if(_0x33bf65['Trunk']){_0x469ae0[_0x2760('0x4f')]={'id':_0x33bf65['Trunk']['id'],'name':_0x33bf65[_0x2760('0x4f')][_0x2760('0x28')],'active':_0x33bf65[_0x2760('0x4f')][_0x2760('0x50')],'callerid':_0x33bf65['Trunk'][_0x2760('0x51')]};}if(_0x33bf65[_0x2760('0x52')]){_0x469ae0[_0x2760('0x52')]={'id':_0x33bf65[_0x2760('0x52')]['id'],'name':_0x33bf65['Interval'][_0x2760('0x28')]};}var _0x1db563=md5(JSON[_0x2760('0x53')](_0x469ae0));if(_0x33bf65[_0x2760('0x4')]!==_0x1db563){_0x33bf65[_0x2760('0x4')]=_0x1db563;emit(util[_0x2760('0x54')](_0x2760('0x55'),_0x469ae0[_0x2760('0x28')]),_0x2760('0x56'),_0x469ae0);}}}function emitVoiceQueueChannelRemove(_0x4e4f5a){logger[_0x2760('0x57')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x2760('0x53')](_0x4e4f5a));emit(util[_0x2760('0x54')](_0x2760('0x55'),_0x4e4f5a[_0x2760('0x28')]),_0x2760('0x58'),_0x4e4f5a);io['emit'](_0x2760('0x59'),_0x4e4f5a);}function notSendMessagesQueue(_0x4baacc){if(_0x4baacc[_0x2760('0x5a')]){if(_0x4baacc[_0x2760('0x5b')]===0x0&&_0x4baacc['pTalking']===0x0){_0x4baacc['sendMessageOneNotActive']=![];_0x4baacc[_0x2760('0x2a')]=0x0;_0x4baacc[_0x2760('0x5c')]=0x0;_0x4baacc[_0x2760('0x4b')]=_0x2760('0x5d');ut['logger'](_0x2760('0x5e'),_0x4baacc[_0x2760('0x28')]+_0x2760('0x5f'));}else{_0x4baacc[_0x2760('0x4b')]=_0x2760('0x60');ut[_0x2760('0x61')](_0x2760('0x5e'),_0x4baacc[_0x2760('0x28')]+_0x2760('0x62'));}emitCampaignPreview(_0x4baacc);}}Preview[_0x2760('0xe')]['loopCampaigns']=function(){var _0x355f50=this;setInterval(function(){_0x355f50[_0x2760('0x63')]();},0x7cf);};Preview['prototype'][_0x2760('0x63')]=function(){var _0x798430=this[_0x2760('0x12')];this[_0x2760('0x17')]+=0x1;for(var _0x3a69eb in _0x798430){if(_0x798430['hasOwnProperty'](_0x3a69eb)&&(_0x798430[_0x3a69eb][_0x2760('0x35')]==='preview'||_0x798430[_0x3a69eb]['dialMethod']===_0x2760('0x64'))&&_0x798430[_0x3a69eb][_0x2760('0x65')]===_0x2760('0x27')){if(this[_0x2760('0x17')]>0x7){this[_0x2760('0x17')]=0x0;this[_0x2760('0x66')]();}}if(_0x798430['hasOwnProperty'](_0x3a69eb)&&_0x798430[_0x3a69eb][_0x2760('0x35')]==='preview'&&_0x798430[_0x3a69eb]['type']===_0x2760('0x27')){if(_0x798430[_0x3a69eb][_0x2760('0x34')]){this[_0x2760('0x67')](_0x798430[_0x3a69eb]);this[_0x2760('0x68')](_0x798430[_0x3a69eb]);}else{notSendMessagesQueue(_0x798430[_0x3a69eb]);}}}};Preview['prototype']['clearZombieChannel']=function(_0x20dd92){var _0x3a0e8c=this;this[_0x2760('0x69')][_0x2760('0xf')](function(){if(!_['isNil'](_0x3a0e8c[_0x2760('0x15')][_0x20dd92])){loggerAction[_0x2760('0x57')](_0x2760('0x6a'),_0x20dd92,_0x2760('0x6b'),_0x3a0e8c[_0x2760('0x15')][_0x20dd92]['queue'],_0x2760('0x6c'),JSON['stringify'](_0x3a0e8c[_0x2760('0x12')][_0x3a0e8c['actions'][_0x20dd92]['queue']][_0x2760('0x5b')]),'pTalking:\x20',JSON[_0x2760('0x53')](_0x3a0e8c[_0x2760('0x12')][_0x3a0e8c['actions'][_0x20dd92]['queue']]['pTalking']),JSON[_0x2760('0x53')](_0x3a0e8c[_0x2760('0x15')][_0x20dd92]['dialAnswer']),JSON[_0x2760('0x53')](_['pick'](_0x3a0e8c[_0x2760('0x15')][_0x20dd92],[_0x2760('0x6d'),'UserId',_0x2760('0x6e'),_0x2760('0x6f')])));return ami[_0x2760('0x70')]({'action':_0x2760('0x71'),'channel':_0x3a0e8c['actions'][_0x20dd92][_0x2760('0x72')]})[_0x2760('0x73')](function(_0x60024e){if(_0x60024e[_0x2760('0x4b')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x3a0e8c[_0x2760('0x15')][_0x20dd92]){ut[_0x2760('0x74')](_0x3a0e8c[_0x2760('0x12')][_0x3a0e8c[_0x2760('0x15')][_0x20dd92][_0x2760('0x75')]],_0x2760('0x76'));if(_0x3a0e8c[_0x2760('0x15')][_0x20dd92][_0x2760('0x77')]===!![]){ut[_0x2760('0x78')](_0x3a0e8c['campaignsPreview'][_0x3a0e8c[_0x2760('0x15')][_0x20dd92]['queue']],_0x2760('0x76'));ut[_0x2760('0x79')](_0x2760('0x7a')+_0x20dd92,_0x3a0e8c['actions'][_0x20dd92][_0x2760('0x75')]);}ut[_0x2760('0x79')]('[Dialer][checkChannel][Preview]'+_0x20dd92,_0x3a0e8c[_0x2760('0x15')][_0x20dd92]['queue']);delete _0x3a0e8c[_0x2760('0x15')][_0x20dd92];}},0x2328);}});}});};Preview[_0x2760('0xe')][_0x2760('0x66')]=function(){var _0x4b9252=this;loggerAction[_0x2760('0x57')](_0x2760('0x7b'),_[_0x2760('0x7c')](this[_0x2760('0x15')]));for(var _0x1869bd in this[_0x2760('0x15')]){if(_0x4b9252[_0x2760('0x15')]['hasOwnProperty'](_0x1869bd)){_0x4b9252[_0x2760('0x7d')](_0x1869bd);}}};Preview[_0x2760('0xe')][_0x2760('0x68')]=function(_0x2753a2){var _0x3c0582=this;rpcDb[_0x2760('0x7e')](_0x2753a2['id'],ut[_0x2760('0x7f')](this['agents']))['then'](function(_0x5e4686){if(!_['isNil'](_0x5e4686)){for(var _0x2bfa60=0x0;_0x2bfa60<_0x5e4686[_0x2760('0x80')];_0x2bfa60+=0x1){if(ut[_0x2760('0x81')](_0x5e4686[_0x2bfa60][_0x2760('0x82')])<_0x2753a2[_0x2760('0x83')]*0x3c){if(_0x5e4686[_0x2bfa60][_0x2760('0x84')]&&!_0x5e4686[_0x2bfa60][_0x2760('0x84')][_0x2760('0x85')]){_0x3c0582[_0x2760('0x86')](_0x5e4686[_0x2bfa60]['id'])['then'](ut[_0x2760('0x87')](_0x2760('0x88')))[_0x2760('0x73')](ut[_0x2760('0x87')](_0x2760('0x88')));}else{rpcDb[_0x2760('0x89')](_0x5e4686[_0x2bfa60]['id']);}}else{var _0x16d7df=new Action(_0x5e4686[_0x2bfa60],_0x2753a2);_0x16d7df['starttime']=moment()[_0x2760('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0x2753a2['outboundReCallsDay']+=0x1;ut[_0x2760('0x8a')](_0x16d7df,0x17,_0x2760('0x8b'));if(_0x2753a2[_0x2760('0x8c')]){rpcDb[_0x2760('0x8d')](ut[_0x2760('0x8e')](_0x5e4686[_0x2bfa60]));rpcDb['createCustomerHistory'](_0x16d7df,_0x2760('0x8f'));}else{ut[_0x2760('0x8a')](_0x16d7df,0x16,_0x2760('0x90'));rpcDb[_0x2760('0x91')](_0x16d7df,'[HistoryRecallClose]');rpcDb[_0x2760('0x92')](_0x16d7df,_0x2760('0x93'));}}}}})[_0x2760('0x73')](ut[_0x2760('0x87')](_0x2760('0x94')));};Preview['prototype']['setMessage']=function(_0x335852){_0x335852[_0x2760('0x5a')]=!![];if(ut['IsNotLoggedIn'](_0x335852[_0x2760('0x95')])){_0x335852['message']='AGENTS_NOT_LOGGED';}else if(!ut[_0x2760('0x96')](_0x335852['dialActive'])){_0x335852[_0x2760('0x4b')]=_0x2760('0x5d');}else if(!this[_0x2760('0x97')](_0x335852[_0x2760('0x4f')])){if(!this[_0x2760('0x97')](_0x335852[_0x2760('0x98')])){_0x335852[_0x2760('0x4b')]=_0x2760('0x99');}else{_0x335852[_0x2760('0x4b')]='ACTIVE';}}else{_0x335852[_0x2760('0x4b')]=_0x2760('0x9a');}emitCampaignPreview(_0x335852);};Preview[_0x2760('0xe')]['callProgressDetectingCustomer']=function(_0x266a3f,_0x37cdee,_0xd2445b){var _0x2380b9=this;var _0x39c3e6=this[_0x2760('0x15')][_0x37cdee];var _0x2c157b=this[_0x2760('0x12')][_0x39c3e6[_0x2760('0x75')]];var _0x268b60;if(_0x2c157b){switch(_0xd2445b){case'1':_0x2c157b[_0x2760('0x9b')]+=0x1;_0x39c3e6[_0x2760('0x9c')]+=0x1;_0x39c3e6[_0x2760('0x9d')]=ut['totalGlobal'](_0x39c3e6);ut[_0x2760('0x8a')](_0x39c3e6,0x0,_0x2760('0x9e'));ami[_0x2760('0x26')](_0x2760('0x9f'),ut[_0x2760('0xa0')](_0x39c3e6,_0x2760('0xa1')));rpcDb[_0x2760('0x91')](_0x39c3e6,_0x2760('0xa2'));if(ut['totalGlobal'](_0x39c3e6)>=_0x2c157b[_0x2760('0xa3')]){_0x268b60=ut[_0x2760('0xa4')](_0x39c3e6,0xf,_0x2760('0xa5'));rpcDb[_0x2760('0x92')](_0x268b60,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x39c3e6['countnosuchnumberretry']>=_0x2c157b[_0x2760('0xa6')]){rpcDb['createCustomerFinal'](_0x39c3e6,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x2760('0xa7')](ut[_0x2760('0xa8')](_0x39c3e6,'countnosuchnumberretry',_0x2c157b[_0x2760('0xa9')]),_0x39c3e6[_0x2760('0xaa')],_0x39c3e6['activeContact']);}}delete this[_0x2760('0x15')][_0x266a3f[_0x2760('0xab')]];break;case'ANSWER':var _0x113dac=moment()[_0x2760('0x54')](_0x2760('0xac'));_0x39c3e6[_0x2760('0xad')]=_0x113dac;_0x39c3e6[_0x2760('0xae')]=_0x113dac;_0x39c3e6[_0x2760('0x77')]=!![];_0x2c157b[_0x2760('0x2b')]+=0x1;logger[_0x2760('0x57')](_0x2760('0xaf'),_0x39c3e6[_0x2760('0xb0')],'\x20Queue',_0x2c157b[_0x2760('0x28')],_0x2760('0xb1'),_0x2c157b[_0x2760('0x2b')]);ami[_0x2760('0x26')](_0x2760('0xb2'),ut[_0x2760('0xa0')](_0x39c3e6,_0x2760('0xb3'),this[_0x2760('0x12')][_0x39c3e6[_0x2760('0x75')]]));if(_0x2c157b[_0x2760('0xb4')]){ami[_0x2760('0x26')]('custom:agentConnectPreview',ut[_0x2760('0xb5')](_0x39c3e6));}break;case'16':ami[_0x2760('0x26')](_0x2760('0xb6'),ut[_0x2760('0xa0')](_0x39c3e6,_0x2760('0xb7'),this[_0x2760('0x12')][_0x39c3e6[_0x2760('0x75')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x39c3e6,_0x2760('0xb7')));_0x2c157b[_0x2760('0x39')]+=0x1;_0x2c157b[_0x2760('0x30')]+=0x1;_0x2c157b[_0x2760('0xb8')]+=0x1;ut[_0x2760('0x78')](_0x2c157b,_0x2760('0xb9'));_0x39c3e6[_0x2760('0x9d')]=ut[_0x2760('0xba')](_0x39c3e6);ut[_0x2760('0x8a')](_0x39c3e6,0x4,_0x2760('0xbb'));rpcDb[_0x2760('0x91')](_0x39c3e6,_0x2760('0xbc'));rpcDb[_0x2760('0x92')](_0x39c3e6,_0x2760('0xbd'));rpcDb[_0x2760('0xbe')](_0x39c3e6);_0x2c157b[_0x2760('0x2d')]+=_0x39c3e6[_0x2760('0xbf')];_0x2c157b[_0x2760('0x2c')]+=_0x39c3e6[_0x2760('0xbf')];logger[_0x2760('0x57')](_0x2760('0xc0'),_0x39c3e6[_0x2760('0xb0')],_0x2760('0xc1'),_0x2c157b[_0x2760('0x28')],_0x2760('0xb1'),_0x2c157b[_0x2760('0x2b')]);delete this['actions'][_0x266a3f[_0x2760('0xab')]];break;case _0x2760('0xc2'):_0x2c157b['outboundBusyCallsDay']+=0x1;_0x39c3e6[_0x2760('0xc3')]+=0x1;_0x39c3e6[_0x2760('0x9d')]=ut[_0x2760('0xba')](_0x39c3e6);ut[_0x2760('0x8a')](_0x39c3e6,0x5,'Busy');ami[_0x2760('0x26')](_0x2760('0xc4'),ut[_0x2760('0xa0')](_0x39c3e6,_0x2760('0xc5')));rpcDb[_0x2760('0x91')](_0x39c3e6,'[callProgressDetectingCustomer][logBusy]');if(ut['totalGlobal'](_0x39c3e6)>=_0x2c157b[_0x2760('0xa3')]){_0x268b60=ut[_0x2760('0xa4')](_0x39c3e6,0xf,_0x2760('0xa5'));rpcDb[_0x2760('0x92')](_0x268b60,_0x2760('0xc6'));}else{if(_0x39c3e6[_0x2760('0xc3')]>=_0x2c157b[_0x2760('0xc7')]){rpcDb[_0x2760('0x92')](_0x39c3e6,_0x2760('0xc8'));}else{rpcDb[_0x2760('0xa7')](ut[_0x2760('0xa8')](_0x39c3e6,_0x2760('0xc3'),_0x2c157b[_0x2760('0xc9')]),_0x39c3e6[_0x2760('0xaa')],_0x39c3e6['activeContact']);}}break;case _0x2760('0xca'):_0x2c157b[_0x2760('0x3d')]+=0x1;_0x39c3e6[_0x2760('0xcb')]+=0x1;_0x39c3e6[_0x2760('0x9d')]=ut[_0x2760('0xba')](_0x39c3e6);ut['logCustomer'](_0x39c3e6,0x3,_0x2760('0xcc'));ami['emit']('custom:agentnoanswer',ut[_0x2760('0xa0')](_0x39c3e6,_0x2760('0xcd')));rpcDb[_0x2760('0x91')](_0x39c3e6,_0x2760('0xce'));if(ut[_0x2760('0xba')](_0x39c3e6)>=_0x2c157b[_0x2760('0xa3')]){_0x268b60=ut[_0x2760('0xa4')](_0x39c3e6,0xf,'Global');rpcDb['createCustomerFinal'](_0x268b60,_0x2760('0xcf'));}else{if(_0x39c3e6['countnoanswerretry']>=_0x2c157b['dialNoAnswerMaxRetry']){rpcDb['createCustomerFinal'](_0x39c3e6,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x2760('0xa7')](ut[_0x2760('0xa8')](_0x39c3e6,_0x2760('0xcb'),_0x2c157b[_0x2760('0xd0')]),_0x39c3e6[_0x2760('0xaa')],_0x39c3e6[_0x2760('0xd1')]);}}break;case _0x2760('0xd2'):_0x2c157b[_0x2760('0xd3')]+=0x1;_0x39c3e6[_0x2760('0xd4')]+=0x1;_0x39c3e6[_0x2760('0x9d')]=ut[_0x2760('0xba')](_0x39c3e6);ut[_0x2760('0x8a')](_0x39c3e6,0x8,_0x2760('0xd5'));ami[_0x2760('0x26')](_0x2760('0xd6'),ut[_0x2760('0xa0')](_0x39c3e6,_0x2760('0xd7')));rpcDb[_0x2760('0x91')](_0x39c3e6,_0x2760('0xd8'));if(ut[_0x2760('0xba')](_0x39c3e6)>=_0x2c157b[_0x2760('0xa3')]){_0x268b60=ut[_0x2760('0xa4')](_0x39c3e6,0xf,_0x2760('0xa5'));rpcDb['createCustomerFinal'](_0x268b60,_0x2760('0xd9'));}else{if(_0x39c3e6[_0x2760('0xd4')]>=_0x2c157b[_0x2760('0xda')]){rpcDb[_0x2760('0x92')](_0x39c3e6,_0x2760('0xd8'));}else{rpcDb[_0x2760('0xa7')](ut[_0x2760('0xa8')](_0x39c3e6,_0x2760('0xd4'),_0x2c157b[_0x2760('0xc9')]),_0x39c3e6[_0x2760('0xaa')],_0x39c3e6[_0x2760('0xd1')]);}}break;case _0x2760('0xdb'):_0x2c157b[_0x2760('0xdc')]+=0x1;_0x39c3e6[_0x2760('0xdd')]+=0x1;_0x39c3e6[_0x2760('0x9d')]=ut[_0x2760('0xba')](_0x39c3e6);ut[_0x2760('0x8a')](_0x39c3e6,0x14,_0x2760('0xde'));ami[_0x2760('0x26')](_0x2760('0xdf'),ut[_0x2760('0xa0')](_0x39c3e6,_0x2760('0xe0')));rpcDb[_0x2760('0x91')](_0x39c3e6,_0x2760('0xe1'));if(ut[_0x2760('0xba')](_0x39c3e6)>=_0x2c157b[_0x2760('0xa3')]){_0x268b60=ut[_0x2760('0xa4')](_0x39c3e6,0x14,_0x2760('0xde'));rpcDb[_0x2760('0x92')](_0x268b60,_0x2760('0xe2'));}else{if(_0x39c3e6[_0x2760('0xdd')]>=_0x2c157b[_0x2760('0xe3')]){rpcDb[_0x2760('0x92')](_0x39c3e6,_0x2760('0xe2'));}else{rpcDb[_0x2760('0xa7')](ut[_0x2760('0xa8')](_0x39c3e6,_0x2760('0xdd'),_0x2c157b['dialAgentRejectRetryFrequency']),_0x39c3e6['unlockAgent'],_0x39c3e6[_0x2760('0xd1')]);}}break;case _0x2760('0xe4'):_0x2c157b['outboundAbandonedCallsDay']+=0x1;_0x39c3e6[_0x2760('0xe5')]+=0x1;_0x39c3e6[_0x2760('0x9d')]=ut[_0x2760('0xba')](_0x39c3e6);ut[_0x2760('0x8a')](_0x39c3e6,0xb,_0x2760('0xe6'));rpcDb[_0x2760('0x91')](_0x39c3e6,_0x2760('0xe7'));if(ut['totalGlobal'](_0x39c3e6)>=_0x2c157b[_0x2760('0xa3')]){_0x268b60=ut[_0x2760('0xa4')](_0x39c3e6,0xf,_0x2760('0xa5'));rpcDb[_0x2760('0x92')](_0x268b60,_0x2760('0xe7'));}else{if(_0x39c3e6[_0x2760('0xe8')]>=_0x2c157b[_0x2760('0xe9')]){rpcDb[_0x2760('0x92')](_0x39c3e6,_0x2760('0xe7'));}else{rpcDb[_0x2760('0xa7')](ut[_0x2760('0xa8')](_0x39c3e6,_0x2760('0xe5'),_0x2c157b[_0x2760('0xea')]),_0x39c3e6['unlockAgent'],_0x39c3e6['activeContact']);}}break;case'18':_0x2c157b[_0x2760('0x40')]+=0x1;_0x39c3e6['countmachineretry']+=0x1;_0x39c3e6[_0x2760('0x9d')]=ut['totalGlobal'](_0x39c3e6);ut[_0x2760('0x8a')](_0x39c3e6,0x12,_0x266a3f[_0x2760('0xeb')]||_0x266a3f[_0x2760('0xec')]);ami[_0x2760('0x26')]('custom:amd',ut['buildObj'](_0x39c3e6,_0x2760('0xed')));rpcDb[_0x2760('0x91')](_0x39c3e6,_0x2760('0xee'));if(ut[_0x2760('0xba')](_0x39c3e6)>=_0x2c157b[_0x2760('0xa3')]){_0x268b60=ut[_0x2760('0xa4')](_0x39c3e6,0xf,_0x2760('0xa5'));rpcDb['createCustomerFinal'](_0x268b60,_0x2760('0xee'));}else{rpcDb[_0x2760('0x92')](_0x39c3e6,'[callProgressDetectingCustomer][hangupInAMD]');}delete this['actions'][_0x266a3f['linkedid']];break;case'19':_0x2c157b[_0x2760('0x40')]+=0x1;_0x39c3e6['countglobal']=ut[_0x2760('0xba')](_0x39c3e6);ut[_0x2760('0x8a')](_0x39c3e6,0x13,_0x266a3f[_0x2760('0xeb')]||_0x266a3f[_0x2760('0xec')]);ami['emit'](_0x2760('0xef'),ut[_0x2760('0xa0')](_0x39c3e6,'amd'));rpcDb[_0x2760('0x91')](_0x39c3e6,_0x2760('0xf0'));if(ut['totalGlobal'](_0x39c3e6)>=_0x2c157b[_0x2760('0xa3')]){_0x268b60=ut[_0x2760('0xa4')](_0x39c3e6,0xf,'Global');rpcDb[_0x2760('0x92')](_0x268b60,_0x2760('0xf0'));}else{rpcDb[_0x2760('0x92')](_0x39c3e6,_0x2760('0xf0'));}delete this[_0x2760('0x15')][_0x266a3f[_0x2760('0xab')]];break;default:if(_0x39c3e6['dialAnswer']){ut[_0x2760('0x78')](_0x2c157b,'[default]');ut[_0x2760('0x79')](_0x2760('0xf1')+_0x2c157b[_0x2760('0x28')],_0x266a3f);}_0x2c157b['outboundUnknownCallsDay']+=0x1;_0x39c3e6[_0x2760('0x9d')]=ut[_0x2760('0xba')](_0x39c3e6);ut[_0x2760('0x8a')](_0x39c3e6,0xc,_0x266a3f['cause-txt']||_0x266a3f[_0x2760('0xec')]);rpcDb[_0x2760('0x91')](_0x39c3e6,_0x2760('0xf2'));if(ut['totalGlobal'](_0x39c3e6)>=_0x2c157b[_0x2760('0xa3')]){_0x268b60=ut[_0x2760('0xa4')](_0x39c3e6,0xf,_0x2760('0xa5'));rpcDb['createCustomerFinal'](_0x268b60,_0x2760('0xf3'));}else{rpcDb[_0x2760('0x92')](_0x39c3e6,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x2760('0x15')][_0x266a3f[_0x2760('0xab')]];}if(!(_0x39c3e6[_0x2760('0x77')]&&_0xd2445b==='16')){ut[_0x2760('0x74')](_0x2c157b,'[callProgressDetectingCustomer]');logger[_0x2760('0x57')](_0x2760('0xf4'),_0x39c3e6[_0x2760('0xb0')],_0x2760('0xc1'),_0x2c157b[_0x2760('0x28')],_0x2760('0x6c'),_0x2c157b[_0x2760('0x5b')]);}if(_0xd2445b!==_0x2760('0xf5')){delete this[_0x2760('0x15')][_0x266a3f[_0x2760('0xab')]];delete this[_0x2760('0x15')][_0x266a3f['destlinkedid']];}}};Preview[_0x2760('0xe')][_0x2760('0xf6')]=function(_0x28aa60,_0x409706,_0x363bab){if(_[_0x2760('0xf7')](_0x409706)&&_0x2760('0xf8')!==typeof _0x409706){return;}if(_['isUndefined'](_0x363bab)&&_0x2760('0xf8')!==typeof _0x363bab){return;}switch(_0x363bab[_0x2760('0xf9')]){case'0':ut[_0x2760('0xfa')](_0x28aa60,0x0,_0x2760('0x9e'));rpcDb['createAgentHistory'](_0x28aa60,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x2760('0xfa')](_0x28aa60,0x3,_0x2760('0xcc'));rpcDb[_0x2760('0xfb')](_0x28aa60,_0x2760('0xfc'));break;case'5':ut[_0x2760('0xfa')](_0x28aa60,0x5,_0x2760('0xfd'));rpcDb[_0x2760('0xfb')](_0x28aa60,_0x2760('0xfe'));break;case'8':ut[_0x2760('0xfa')](_0x28aa60,0x8,'Congestion');rpcDb['createAgentHistory'](_0x28aa60,_0x2760('0xff'));break;case'22':ut[_0x2760('0xfa')](_0x28aa60,0x16,_0x2760('0x100'));rpcDb[_0x2760('0xfb')](_0x28aa60,_0x2760('0x101'));break;default:ut[_0x2760('0xfa')](_0x28aa60,0xc,_0x363bab[_0x2760('0xf9')]);rpcDb[_0x2760('0xfb')](_0x28aa60,_0x2760('0xff'));}ut['updateOriginated'](_0x409706,'[callProgressDetectingAgent]');logger[_0x2760('0x57')]('[originated][decrement][callProgressDetectingAgent]',_0x28aa60[_0x2760('0xb0')],_0x2760('0xc1'),_0x409706['name'],'originated:\x20',_0x409706[_0x2760('0x5b')]);delete this['actions'][_0x28aa60['uniqueid']];};Preview['prototype']['checkInBlack']=function(_0x13eb7e,_0x409907,_0x248781,_0x18c24e,_0x4851bf){var _0x2bf000=this;return new BPromise(function(_0x2c0bed,_0x3a5eee){if(_['isNil'](_0x409907)||_[_0x2760('0x102')](_0x409907[_0x2760('0x103')])||_[_0x2760('0x102')](_0x409907[_0x2760('0x103')]['phone'])||_[_0x2760('0x102')](_0x409907[_0x2760('0x6e')])){_0x3a5eee(ut[_0x2760('0x4b')]('Contact\x20is\x20undefined',_0x18c24e,_0x4851bf));return;}var _0x1d7dd5=uuid['v4']();var _0x3ca313=_0x2bf000['campaignsPreview'][_0x409907[_0x2760('0x6b')][_0x2760('0x28')]];var _0x3c845b=_0x248781?_0x2bf000['agents'][_0x248781]['id']:undefined;_0x2bf000[_0x2760('0x15')][_0x1d7dd5]=new Action(_0x409907,_0x3ca313,_0x1d7dd5,_0x248781,_0x3c845b);var _0x25208b=_0x2bf000['actions'][_0x1d7dd5];_0x25208b[_0x2760('0xaa')]=_0x18c24e;_0x25208b[_0x2760('0xd1')]=_0x4851bf;_0x25208b[_0x2760('0x104')]=_0x248781;if(_[_0x2760('0x105')](_0x13eb7e)){_0x2bf000[_0x2760('0x106')](_0x25208b,_0x3ca313,_0x409907,_0x248781)[_0x2760('0x107')](function(_0xb478d2){logger['info'](_0x2760('0x108'),_0x2760('0x109')+_0x25208b[_0x2760('0x75')]+_0x2760('0x10a')+_0x25208b[_0x2760('0x10b')],JSON[_0x2760('0x53')](_0xb478d2));ami[_0x2760('0x26')](_0x2760('0x10c'),ut['buildObj'](_0x25208b,_0x2760('0x10d'),_0x2bf000['campaignsPreview'][_0x25208b[_0x2760('0x75')]]));_0x2c0bed(ut[_0x2760('0x4b')](_0x2760('0x10e')));})[_0x2760('0x73')](function(_0x919242){ut[_0x2760('0x61')](_0x2760('0x10f'),_0x919242);_0x3a5eee(ut[_0x2760('0x4b')]('Call\x20failed',_0x18c24e,_0x4851bf));});}else{_0x3ca313['outboundBlacklistCallsDay']+=0x1;ut[_0x2760('0x110')](_0x25208b);rpcDb[_0x2760('0x111')](_0x25208b,_0x2760('0x112'));delete _0x2bf000[_0x2760('0x15')][_0x1d7dd5];_0x3a5eee(ut[_0x2760('0x4b')](_0x2760('0x113'),_0x18c24e,_0x4851bf));}});};Preview[_0x2760('0xe')][_0x2760('0x97')]=function(_0x5dcfe4){return!_[_0x2760('0x102')](_0x5dcfe4)&&!_[_0x2760('0x102')](_0x5dcfe4[_0x2760('0x28')])&&!_[_0x2760('0x102')](_0x5dcfe4['active'])&&_0x5dcfe4['active']&&!_[_0x2760('0x102')](this[_0x2760('0x14')][util['format'](_0x2760('0x114'),_0x5dcfe4[_0x2760('0x28')])])&&!_[_0x2760('0x102')](this['trunks'][util['format'](_0x2760('0x114'),_0x5dcfe4[_0x2760('0x28')])][_0x2760('0x71')])&&(this[_0x2760('0x14')][util['format'](_0x2760('0x114'),_0x5dcfe4[_0x2760('0x28')])][_0x2760('0x71')]==='reachable'||this['trunks'][util['format']('SIP/%s',_0x5dcfe4[_0x2760('0x28')])][_0x2760('0x71')]===_0x2760('0x115'));};Preview[_0x2760('0xe')]['run']=function(_0x5f361e,_0x54c1f6){var _0x1ac461=this;return new BPromise(function(_0x42afdd,_0x40ba3e){_0x1ac461[_0x2760('0x116')](_0x5f361e,_0x54c1f6)[_0x2760('0x107')](function(_0x29079b){_0x42afdd(_['pick'](_0x29079b,[_0x2760('0x4b')]));})[_0x2760('0x73')](function(_0xe51a5f){if(_0xe51a5f[_0x2760('0x117')]){rpcDb[_0x2760('0x118')](_0x5f361e);}if(_0xe51a5f[_0x2760('0x50')]){rpcDb['disableContact'](_0x5f361e);}_0x40ba3e(_[_0x2760('0x119')](_0xe51a5f,[_0x2760('0x4b')]));});});};Preview[_0x2760('0xe')][_0x2760('0x116')]=function(_0x1c61c1,_0x1bc817){var _0x5894f8=this;return new BPromise(function(_0x24a4ed,_0x27fcfd){var _0x10e662,_0x12a31c;rpcDb[_0x2760('0x11a')](_0x1c61c1)[_0x2760('0x107')](function(_0x2cc19b){if(!_[_0x2760('0x102')](_0x2cc19b[0x0])){_0x12a31c=_0x2cc19b[0x0]['recallme']?![]:!![];_0x10e662=_0x2cc19b[0x0]['recallme']?!![]:![];_0x10e662=_0x1bc817?!![]:_0x10e662;}var _0x512122=_0x5894f8['validateContact'](_0x2cc19b);if(_0x512122['isValid']){rpcDb[_0x2760('0x11b')](_[_0x2760('0x119')](_0x2cc19b[0x0],['VoiceQueueId',_0x2760('0x11c')]))[_0x2760('0x107')](function(_0x2c7118){_0x5894f8[_0x2760('0x11d')](_0x2c7118,_0x2cc19b[0x0],_0x1bc817,_0x12a31c,_0x10e662)[_0x2760('0x107')](function(_0x179a45){_0x24a4ed(_0x179a45);})['catch'](function(_0xfc3a0d){_0x27fcfd(_0xfc3a0d);});})[_0x2760('0x73')](function(_0x5b634f){ut[_0x2760('0x61')](_0x2760('0x11e'),_0x5b634f);_0x27fcfd(ut[_0x2760('0x4b')](_0x2760('0x11f'),_0x12a31c,_0x10e662));});}else{_0x27fcfd(ut[_0x2760('0x4b')](_0x512122[_0x2760('0x4b')],_0x12a31c,_0x10e662));}})[_0x2760('0x73')](function(_0x147ac9){ut[_0x2760('0x61')](_0x2760('0x120'),_0x147ac9);_0x27fcfd(ut[_0x2760('0x4b')](_0x2760('0x11f'),![],!![]));});});};Preview['prototype'][_0x2760('0x121')]=function(_0x5b2f74){if(_[_0x2760('0x102')](_0x5b2f74)||_[_0x2760('0x105')](_0x5b2f74)||!_[_0x2760('0x102')](_0x5b2f74[0x0][_0x2760('0x84')])&&_['isNil'](_0x5b2f74[0x0][_0x2760('0x84')]['name'])){ut['logger'](_0x2760('0x122'),_0x5b2f74);return{'isValid':![],'message':_0x2760('0x123')};}var _0xd95181=this[_0x2760('0x12')][_0x5b2f74[0x0]['Queue'][_0x2760('0x28')]];_0xd95181[_0x2760('0x4b')]='ACTIVE';if(_[_0x2760('0x102')](_0xd95181)){ut[_0x2760('0x61')](_0x2760('0x124'),_0xd95181);return{'isValid':![],'message':_0x2760('0x125')};}if(!this[_0x2760('0x97')](_0xd95181[_0x2760('0x4f')])){ut[_0x2760('0x61')](_0x2760('0x126'),_0x2760('0x127')+_0xd95181[_0x2760('0x28')]+_0x2760('0x128'));if(!this[_0x2760('0x97')](_0xd95181['TrunkBackup'])){ut[_0x2760('0x61')](_0x2760('0x126'),_0xd95181[_0x2760('0x28')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x2760('0x129')};}}if(!ut['isActive'](_0xd95181[_0x2760('0x34')])){ut[_0x2760('0x61')]('[Preview][validateContact][Campaign\x20Active]',_0xd95181['name']+_0x2760('0x12a'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0xd95181[_0x2760('0x28')]+_0x2760('0x12a')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x2760('0xe')][_0x2760('0x106')]=function(_0x2a3c38,_0x3e914c,_0x5746a9,_0x4f9199){var _0x269c87=this;return new BPromise(function(_0x2b590b,_0x1f811d){var _0x473668=_0x2a3c38[_0x2760('0xb0')];var _0x40ef1a=_0x269c87[_0x2760('0x97')](_0x3e914c['Trunk'])?util[_0x2760('0x54')](_0x2760('0x12b'),_0x3e914c['Trunk'][_0x2760('0x28')],_[_0x2760('0x102')](_0x3e914c[_0x2760('0x38')])?'':_0x3e914c['dialPrefix'][_0x2760('0x12c')]()||'',_0x3e914c[_0x2760('0x12d')]>0x0?_0x5746a9[_0x2760('0x103')][_0x2760('0x12e')][_0x2760('0x12f')](_0x3e914c[_0x2760('0x12d')]):_0x5746a9[_0x2760('0x103')][_0x2760('0x12e')]):util[_0x2760('0x54')]('SIP/%s/%s%s',_[_0x2760('0x102')](_0x3e914c[_0x2760('0x98')])?_0x3e914c['Trunk'][_0x2760('0x28')]:_0x3e914c[_0x2760('0x98')][_0x2760('0x28')],_[_0x2760('0x102')](_0x3e914c[_0x2760('0x38')])?'':_0x3e914c[_0x2760('0x38')][_0x2760('0x12c')]()||'',_0x3e914c[_0x2760('0x12d')]>0x0?_0x5746a9['Contact']['phone'][_0x2760('0x12f')](_0x3e914c[_0x2760('0x12d')]):_0x5746a9[_0x2760('0x103')]['phone']);var _0x48acd0=_0x269c87[_0x2760('0x97')](_0x3e914c['Trunk'])?ut[_0x2760('0x130')](_0x3e914c[_0x2760('0x4f')]['callerid'],_0x3e914c['dialOriginateCallerIdName'],_0x3e914c[_0x2760('0x131')]>0x0?ut[_0x2760('0x132')](_0x3e914c['dialOriginateCallerIdNumber'],_0x3e914c[_0x2760('0x131')]):_0x3e914c[_0x2760('0x36')]):ut[_0x2760('0x130')](_[_0x2760('0x102')](_0x3e914c[_0x2760('0x98')])?_0x3e914c[_0x2760('0x4f')][_0x2760('0x51')]:_0x3e914c[_0x2760('0x98')][_0x2760('0x51')],_0x3e914c[_0x2760('0x133')],_0x3e914c[_0x2760('0x131')]>0x0?ut[_0x2760('0x132')](_0x3e914c[_0x2760('0x36')],_0x3e914c[_0x2760('0x131')]):_0x3e914c['dialOriginateCallerIdNumber']);if(_0x48acd0){_0x2a3c38[_0x2760('0x134')]=ut[_0x2760('0x135')](_0x48acd0);_0x2a3c38['originatecalleridnum']=ut[_0x2760('0x136')](_0x48acd0);}var _0x2a147a=ut['addVariables'](_0x3e914c,_0x5746a9,_0x40ef1a,_0x48acd0,_0x473668,_0x2a3c38);_[_0x2760('0x137')](_0x2a3c38,ut['toLowerVariables'](_0x2a147a));_0x2a3c38[_0x2760('0x138')]=moment()[_0x2760('0x54')](_0x2760('0xac'));ami[_0x2760('0x70')](ut[_0x2760('0x139')](_0x2a3c38,_0x3e914c,_0x2a147a,_0x2a3c38[_0x2760('0xd1')],_0x4f9199))[_0x2760('0x107')](function(_0x266157){var _0x563444=_0x2a3c38[_0x2760('0x13a')];if(!_[_0x2760('0x102')](_0x563444)){if(!_[_0x2760('0x102')](_0x269c87['agents'][_0x563444])){_0x269c87['agents'][_0x563444]['destconnectedlinenum']=_0x2a3c38[_0x2760('0x13b')];emit(util[_0x2760('0x54')](_0x2760('0x13c'),_0x269c87[_0x2760('0x16')][_0x563444][_0x2760('0x28')]),'user:agentconnect',{'destaccountcode':_0x269c87[_0x2760('0x16')][_0x563444][_0x2760('0x13d')],'destconnectedlinenum':_0x2a3c38['calleridnum']});}}_0x3e914c['originated']+=0x1;logger[_0x2760('0x57')](_0x2760('0x13e'),_0x473668,_0x2760('0xc1'),_0x3e914c[_0x2760('0x28')],_0x2760('0x6c'),_0x3e914c[_0x2760('0x5b')]);_0x2b590b(_0x266157);})[_0x2760('0x73')](function(_0x3a486e){ut[_0x2760('0xfa')](_0x2a3c38,0xe,_0x2760('0x13f'));rpcDb[_0x2760('0xfb')](_0x2a3c38,_0x2760('0x140'));_0x1f811d(_0x3a486e);});});};Preview[_0x2760('0xe')]['syncNewExten']=function(_0x3fb864){if(this[_0x2760('0x15')][_0x3fb864[_0x2760('0xab')]]){this[_0x2760('0x15')][_0x3fb864['linkedid']][_0x2760('0x72')]=_0x3fb864['channel'];}};Preview[_0x2760('0xe')]['syncOriginateResponse']=function(_0xd6ff9e){var _0x37856d=this;var _0x364c78=this['actions'][_0xd6ff9e[_0x2760('0x141')]];if(_0x364c78){if(_0x364c78[_0x2760('0x104')]&&this[_0x2760('0x16')][_0x364c78['lookAgent']]){ut[_0x2760('0x142')](_0x364c78,this[_0x2760('0x16')][_0x364c78[_0x2760('0x104')]][_0x2760('0x28')],this[_0x2760('0x16')][_0x364c78[_0x2760('0x104')]]['id']);}var _0x3bc4bd=_[_0x2760('0x143')](_0x364c78);_0x3bc4bd[_0x2760('0xad')]=moment()[_0x2760('0x54')](_0x2760('0xac'));var _0x2be019=_0x37856d['campaignsPreview'][_0x364c78[_0x2760('0x75')]];if(ut[_0x2760('0x144')](_0xd6ff9e[_0x2760('0x145')])){if(_0x364c78[_0x2760('0xaa')]){rpcDb['unlockContact'](_0x364c78[_0x2760('0x10b')]);}if(_0x364c78['activeContact']){rpcDb[_0x2760('0x89')](_0x364c78[_0x2760('0x10b')]);}ami['emit'](_0x2760('0x146'),ut[_0x2760('0xa0')](_0x364c78,_0x2760('0x147'),this[_0x2760('0x12')][_0x364c78[_0x2760('0x75')]]));this[_0x2760('0xf6')](_0x3bc4bd,_0x2be019,_0xd6ff9e);}else{_0x364c78[_0x2760('0x138')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ut['logAgent'](_0x3bc4bd,0x4,_0x2760('0xbb'));rpcDb['createAgentHistory'](_0x3bc4bd,_0x2760('0x148'));}}};Preview[_0x2760('0xe')][_0x2760('0x1b')]=function(_0xf40737){var _0x45d437=this;var _0x21c73a=this[_0x2760('0x15')][_0xf40737[_0x2760('0xab')]];var _0x3fe16b;if(_0x21c73a){_0x3fe16b=this[_0x2760('0x12')][_0x21c73a[_0x2760('0x75')]];logger[_0x2760('0x57')](_0x2760('0x149'),_0xf40737[_0x2760('0xab')],_0x2760('0xc1'),_0x3fe16b[_0x2760('0x28')],_0x2760('0xb1'),_0x3fe16b[_0x2760('0x2b')]);}if(this[_0x2760('0x15')][_0xf40737[_0x2760('0xab')]]&&_0xf40737[_0x2760('0xab')]!==_0xf40737[_0x2760('0xb0')]){if(_0xf40737[_0x2760('0x14a')]==='16'&&this[_0x2760('0x15')][_0xf40737[_0x2760('0xab')]][_0x2760('0x77')]){this[_0x2760('0x14b')](_0xf40737,_0xf40737[_0x2760('0xab')],_0xf40737[_0x2760('0x14a')]);}else if(this[_0x2760('0x15')][_0xf40737[_0x2760('0xab')]][_0x2760('0x77')]){logger[_0x2760('0x57')](_0x2760('0x14c'),_0xf40737[_0x2760('0xab')],_0xf40737['cause'],'\x20Queue',_0x3fe16b[_0x2760('0x28')],_0x2760('0xb1'),_0x3fe16b['pTalking']);this[_0x2760('0x14b')](_0xf40737,_0xf40737['linkedid'],_0xf40737['cause']);}}else if(_0x21c73a&&_[_0x2760('0x102')](_0x21c73a[_0x2760('0x14d')])&&_0x3fe16b[_0x2760('0x14e')]&&_0xf40737['linkedid']===_0xf40737['uniqueid']&&_[_0x2760('0x102')](_0xf40737[_0x2760('0xf9')])&&_0xf40737[_0x2760('0x14a')]==='16'&&_0xf40737['channelstate']==='6'&&_[_0x2760('0xf7')](_0x21c73a[_0x2760('0x14f')])){if(_0x21c73a[_0x2760('0xaa')]){rpcDb[_0x2760('0x118')](_0x21c73a[_0x2760('0x10b')]);}if(_0x21c73a[_0x2760('0xd1')]){rpcDb[_0x2760('0x89')](_0x21c73a[_0x2760('0x10b')]);}_0xf40737[_0x2760('0xf9')]='22';this[_0x2760('0xf6')](_0x21c73a,_0x3fe16b,_0xf40737);}else if(_0x21c73a&&_0x21c73a[_0x2760('0x14f')]){if(_0xf40737['cause']==='16'&&this[_0x2760('0x15')][_0xf40737['linkedid']][_0x2760('0x77')]){logger['info'](_0x2760('0x150'),_0xf40737[_0x2760('0xab')],_0xf40737['cause'],_0x2760('0xc1'),_0x3fe16b[_0x2760('0x28')],_0x2760('0xb1'),_0x3fe16b[_0x2760('0x2b')]);this[_0x2760('0x14b')](_0xf40737,_0xf40737[_0x2760('0xab')],_0xf40737[_0x2760('0x14a')]);}else if(this[_0x2760('0x15')][_0xf40737[_0x2760('0xab')]][_0x2760('0x77')]){logger[_0x2760('0x57')]('[syncHangup][talking][cause]',_0xf40737['linkedid'],_0xf40737[_0x2760('0x14a')],_0x2760('0xc1'),_0x3fe16b[_0x2760('0x28')],_0x2760('0xb1'),_0x3fe16b[_0x2760('0x2b')]);this['callProgressDetectingCustomer'](_0xf40737,_0xf40737[_0x2760('0xab')],_0xf40737[_0x2760('0x14a')]);}}};Preview[_0x2760('0xe')]['syncDialEnd']=function(_0x540d3b){if(this[_0x2760('0x15')][_0x540d3b[_0x2760('0x151')]]&&_0x540d3b[_0x2760('0x151')]!==_0x540d3b[_0x2760('0x152')]){this[_0x2760('0x14b')](_0x540d3b,_0x540d3b[_0x2760('0x151')],_0x540d3b[_0x2760('0xec')]);}};Preview['prototype'][_0x2760('0x153')]=function(_0x2c83a7){if(this[_0x2760('0x15')][_0x2c83a7['linkedid']]&&_0x2c83a7[_0x2760('0xab')]!==_0x2c83a7[_0x2760('0xb0')]&&!this[_0x2760('0x15')][_0x2c83a7[_0x2760('0xab')]]['dialAnswer']){if(_0x2c83a7[_0x2760('0x14a')]==='1'){this[_0x2760('0x14b')](_0x2c83a7,_0x2c83a7[_0x2760('0xab')],_0x2c83a7[_0x2760('0x14a')]);}}};Preview[_0x2760('0xe')][_0x2760('0x154')]=function(_0x4f3486,_0x3e15b3,_0x6a66a9){if(this[_0x2760('0x15')][_0x4f3486]){if(_['isNil'](this['actions'][_0x4f3486][_0x2760('0x155')])){this[_0x2760('0x15')][_0x4f3486][_0x2760('0x155')]={};}this[_0x2760('0x15')][_0x4f3486]['variables'][_0x3e15b3]=_0x6a66a9;}};Preview[_0x2760('0xe')][_0x2760('0x156')]=function(_0x14fe6f){try{if(!_[_0x2760('0x102')](_0x14fe6f)){if(ut['filterKey'](_[_0x2760('0x157')](_0x14fe6f[_0x2760('0x158')])[0x0])){this['addVariable'](_0x14fe6f[_0x2760('0xb0')],_[_0x2760('0x157')](_0x14fe6f[_0x2760('0x158')])[0x0],_0x14fe6f[_0x2760('0x159')]);}}}catch(_0x32a29a){logger[_0x2760('0x15a')](_0x2760('0x15b'),util[_0x2760('0x15c')](_0x32a29a,{'showHidden':![],'depth':null}));}};Preview[_0x2760('0xe')]['syncAttendedTransfer']=function(_0x5eb467){if(_0x5eb467){if(this[_0x2760('0x15')][_0x5eb467[_0x2760('0x15d')]]){this[_0x2760('0x15')][_0x5eb467[_0x2760('0x15d')]][_0x2760('0x14f')]=!![];}}};Preview['prototype'][_0x2760('0x24')]=function(_0x3e9a99){if(_0x3e9a99){if(this['actions'][_0x3e9a99['transfererlinkedid']]){this[_0x2760('0x15')][_0x3e9a99[_0x2760('0x15e')]]['transfer']=!![];}}};module[_0x2760('0x15f')]=Preview;
\ No newline at end of file
index b467c4a..4761602 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1b4=['[countReScheduled]\x20','unlockContact','disableContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','../../../config/logger','lodash','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','then','createHistory','catch','[createHistory]\x20','resolve','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','UserId','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled'];(function(_0x5c6244,_0x112ab8){var _0x5800ce=function(_0x304e3d){while(--_0x304e3d){_0x5c6244['push'](_0x5c6244['shift']());}};_0x5800ce(++_0x112ab8);}(_0xa1b4,0x8a));var _0x4a1b=function(_0xce9195,_0x1963e1){_0xce9195=_0xce9195-0x0;var _0x530fe6=_0xa1b4[_0xce9195];return _0x530fe6;};'use strict';var util=require(_0x4a1b('0x0'));var BPromise=require('bluebird');var logger=require(_0x4a1b('0x1'))('preview');var _=require(_0x4a1b('0x2'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x4a1b('0x3'));var cmHopperBlack=require(_0x4a1b('0x4'));var voiceQueueRt=require(_0x4a1b('0x5'));var agentReportPreview=require(_0x4a1b('0x6'));var voiceQueueReport=require(_0x4a1b('0x7'));function loggerCatch(_0x37f51f){return function(_0x1e1eeb){logger['error'](_0x37f51f,util[_0x4a1b('0x8')](_0x1e1eeb,{'showHidden':![],'depth':null}));};}function create(_0x215185){return BPromise['resolve']()[_0x4a1b('0x9')](cmHopperHistory[_0x4a1b('0xa')](_0x215185))[_0x4a1b('0xb')](loggerCatch(_0x4a1b('0xc')));}function createAgent(_0x45fbc6){return BPromise[_0x4a1b('0xd')]()[_0x4a1b('0x9')](agentReportPreview[_0x4a1b('0xa')](_0x45fbc6))[_0x4a1b('0xb')](loggerCatch(_0x4a1b('0xc')));}function moveContact(_0x2bd4ce){return BPromise[_0x4a1b('0xd')]()[_0x4a1b('0x9')](cmHopper[_0x4a1b('0xe')](_0x2bd4ce,!![]))[_0x4a1b('0xb')](loggerCatch(_0x4a1b('0xf')));}exports[_0x4a1b('0x10')]=function(_0x4c68a3){return BPromise['resolve']()[_0x4a1b('0x9')](cmHopperBlack[_0x4a1b('0x10')](_0x4c68a3))[_0x4a1b('0xb')](loggerCatch(_0x4a1b('0x11')));};exports['getContactPreview']=function(_0x4e2cf1){return BPromise[_0x4a1b('0xd')]()[_0x4a1b('0x9')](cmHopper[_0x4a1b('0x12')](_0x4e2cf1))[_0x4a1b('0xb')](loggerCatch('[getContactPreview]\x20'));};exports[_0x4a1b('0xa')]=function(_0x87c907,_0x4fc505){create(_0x87c907)[_0x4a1b('0xb')](loggerCatch(_0x4fc505));moveContact(_0x87c907)['catch'](loggerCatch(_0x4fc505));};exports[_0x4a1b('0x13')]=function(_0x4e7c3d,_0xd70c44){createAgent(_0x4e7c3d)[_0x4a1b('0xb')](loggerCatch(_0xd70c44));};exports[_0x4a1b('0x14')]=function(_0x2f75ae,_0x2bea0a){create(_0x2f75ae)[_0x4a1b('0xb')](loggerCatch(_0x2bea0a));};exports[_0x4a1b('0x15')]=function(_0x579637,_0x5e0e81){moveContact(_0x579637)[_0x4a1b('0xb')](loggerCatch(_0x5e0e81));};exports['rescheduleContact']=function(_0x58a2f1,_0x2141b9,_0x3617e1){if(_0x2141b9){_0x58a2f1[_0x4a1b('0x16')]=null;}if(_0x3617e1){_0x58a2f1[_0x4a1b('0x17')]=![];}return BPromise['resolve']()[_0x4a1b('0x9')](cmHopper[_0x4a1b('0x18')](_0x58a2f1))[_0x4a1b('0xb')](loggerCatch(_0x4a1b('0x19')));};exports[_0x4a1b('0x1a')]=function(_0x331041){return BPromise[_0x4a1b('0xd')]()[_0x4a1b('0x9')](cmHopper[_0x4a1b('0x1a')](_0x331041))[_0x4a1b('0xb')](loggerCatch(_0x4a1b('0x1b')));};exports[_0x4a1b('0x1c')]=function(_0x4608a1){return BPromise[_0x4a1b('0xd')]()[_0x4a1b('0x9')](cmHopper[_0x4a1b('0x1c')]({'UserId':null},_0x4608a1,0x1))[_0x4a1b('0xb')](loggerCatch('[unlockContact]\x20'));};exports[_0x4a1b('0x1d')]=function(_0x3196cd){return BPromise[_0x4a1b('0xd')]()[_0x4a1b('0x9')](cmHopper[_0x4a1b('0x1c')]({'active':![]},_0x3196cd,0x1))[_0x4a1b('0xb')](loggerCatch('[activeContact]\x20'));};exports[_0x4a1b('0x1e')]=function(_0xf1e58d){var _0x5941ed={};_0x5941ed[_0x4a1b('0x1f')]=_0xf1e58d[_0x4a1b('0x1f')];_0x5941ed[_0x4a1b('0x20')]=_0xf1e58d[_0x4a1b('0x20')];_0x5941ed[_0x4a1b('0x21')]=_0xf1e58d[_0x4a1b('0x21')];_0x5941ed[_0x4a1b('0x22')]=_0xf1e58d[_0x4a1b('0x22')];_0x5941ed['queue']=_0xf1e58d[_0x4a1b('0x23')];_0x5941ed[_0x4a1b('0x24')]=_0xf1e58d['answertime'];_0x5941ed['queuecallerleaveAt']=_0xf1e58d[_0x4a1b('0x25')];_0x5941ed['queuecallercomplete']=0x1;_0x5941ed[_0x4a1b('0x26')]=_0xf1e58d[_0x4a1b('0x27')];_0x5941ed[_0x4a1b('0x28')]=_0xf1e58d[_0x4a1b('0x29')];_0x5941ed[_0x4a1b('0x2a')]=_0x4a1b('0x2b');_0x5941ed['exten']=_0x4a1b('0x2c');_0x5941ed[_0x4a1b('0x2d')]=0x0;_0x5941ed[_0x4a1b('0x2e')]=0x1;_0x5941ed[_0x4a1b('0x2f')]=_0xf1e58d['membername'];_0x5941ed[_0x4a1b('0x30')]=_0x4a1b('0x31');return BPromise[_0x4a1b('0xd')]()[_0x4a1b('0x9')](voiceQueueReport[_0x4a1b('0x32')](_0x5941ed))[_0x4a1b('0xb')](loggerCatch('[voiceQueueReport]\x20'));};exports['getContactRecallMe']=function(_0x32e5cc,_0x9a0e2b){return BPromise[_0x4a1b('0xd')]()[_0x4a1b('0x9')](cmHopper[_0x4a1b('0x33')](_0x32e5cc,_0x9a0e2b))['catch'](loggerCatch(_0x4a1b('0x34')));};exports[_0x4a1b('0x35')]=function(_0x2ef8f1){return BPromise[_0x4a1b('0xd')]()[_0x4a1b('0x9')](cmHopper[_0x4a1b('0x18')](_0x2ef8f1,!![],!![]))[_0x4a1b('0xb')](loggerCatch(_0x4a1b('0x36')));};
\ No newline at end of file
+var _0x430d=['xcally-motion-preview','holdtime','queuecallerexitreason','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','bluebird','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error','inspect','resolve','createHistory','catch','then','[createHistory]\x20','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerHistory','createCustomerFinal','UserId','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercompleteAt','connectedlinename','membername','context','from-sip','exten'];(function(_0x3453c7,_0x52a272){var _0x25b73d=function(_0x2db061){while(--_0x2db061){_0x3453c7['push'](_0x3453c7['shift']());}};_0x25b73d(++_0x52a272);}(_0x430d,0x112));var _0xd430=function(_0x4ad78a,_0x1dbc74){_0x4ad78a=_0x4ad78a-0x0;var _0xec43a0=_0x430d[_0x4ad78a];return _0xec43a0;};'use strict';var util=require('util');var BPromise=require(_0xd430('0x0'));var logger=require('../../../config/logger')(_0xd430('0x1'));var _=require(_0xd430('0x2'));var cmHopper=require(_0xd430('0x3'));var cmHopperFinal=require(_0xd430('0x4'));var cmHopperHistory=require(_0xd430('0x5'));var cmHopperBlack=require(_0xd430('0x6'));var voiceQueueRt=require(_0xd430('0x7'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xd430('0x8'));function loggerCatch(_0x49ce9f){return function(_0x3fd26a){logger[_0xd430('0x9')](_0x49ce9f,util[_0xd430('0xa')](_0x3fd26a,{'showHidden':![],'depth':null}));};}function create(_0x3dc99e){return BPromise[_0xd430('0xb')]()['then'](cmHopperHistory[_0xd430('0xc')](_0x3dc99e))[_0xd430('0xd')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x2c8af4){return BPromise[_0xd430('0xb')]()[_0xd430('0xe')](agentReportPreview[_0xd430('0xc')](_0x2c8af4))[_0xd430('0xd')](loggerCatch(_0xd430('0xf')));}function moveContact(_0x52a05f){return BPromise['resolve']()[_0xd430('0xe')](cmHopper['moveContactManagedDialer'](_0x52a05f,!![]))[_0xd430('0xd')](loggerCatch(_0xd430('0x10')));}exports[_0xd430('0x11')]=function(_0x239df6){return BPromise[_0xd430('0xb')]()[_0xd430('0xe')](cmHopperBlack['checkIsBlackList'](_0x239df6))[_0xd430('0xd')](loggerCatch(_0xd430('0x12')));};exports['getContactPreview']=function(_0x4cdb13){return BPromise['resolve']()[_0xd430('0xe')](cmHopper[_0xd430('0x13')](_0x4cdb13))[_0xd430('0xd')](loggerCatch(_0xd430('0x14')));};exports[_0xd430('0xc')]=function(_0x422a94,_0x24c66c){create(_0x422a94)[_0xd430('0xd')](loggerCatch(_0x24c66c));moveContact(_0x422a94)[_0xd430('0xd')](loggerCatch(_0x24c66c));};exports['createAgentHistory']=function(_0x508075,_0x4b24a4){createAgent(_0x508075)[_0xd430('0xd')](loggerCatch(_0x4b24a4));};exports[_0xd430('0x15')]=function(_0x23b327,_0x1d8abc){create(_0x23b327)['catch'](loggerCatch(_0x1d8abc));};exports[_0xd430('0x16')]=function(_0x37bc3b,_0x18faca){moveContact(_0x37bc3b)[_0xd430('0xd')](loggerCatch(_0x18faca));};exports['rescheduleContact']=function(_0x2a099d,_0x267ff4,_0x1a5215){if(_0x267ff4){_0x2a099d[_0xd430('0x17')]=null;}if(_0x1a5215){_0x2a099d[_0xd430('0x18')]=![];}return BPromise[_0xd430('0xb')]()[_0xd430('0xe')](cmHopper[_0xd430('0x19')](_0x2a099d))[_0xd430('0xd')](loggerCatch(_0xd430('0x1a')));};exports[_0xd430('0x1b')]=function(_0x4c05b7){return BPromise[_0xd430('0xb')]()[_0xd430('0xe')](cmHopper[_0xd430('0x1b')](_0x4c05b7))['catch'](loggerCatch('[countReScheduled]\x20'));};exports[_0xd430('0x1c')]=function(_0x2a960d){return BPromise[_0xd430('0xb')]()[_0xd430('0xe')](cmHopper['unlockContact']({'UserId':null},_0x2a960d,0x1))[_0xd430('0xd')](loggerCatch(_0xd430('0x1d')));};exports[_0xd430('0x1e')]=function(_0x3c173f){return BPromise[_0xd430('0xb')]()[_0xd430('0xe')](cmHopper[_0xd430('0x1c')]({'active':![]},_0x3c173f,0x1))[_0xd430('0xd')](loggerCatch('[activeContact]\x20'));};exports['crateCustomerReportQueue']=function(_0x38da34){var _0x5545a7={};_0x5545a7[_0xd430('0x1f')]=_0x38da34['type'];_0x5545a7[_0xd430('0x20')]=_0x38da34[_0xd430('0x20')];_0x5545a7[_0xd430('0x21')]=_0x38da34[_0xd430('0x21')];_0x5545a7[_0xd430('0x22')]=_0x38da34[_0xd430('0x22')];_0x5545a7['queue']=_0x38da34[_0xd430('0x23')];_0x5545a7[_0xd430('0x24')]=_0x38da34[_0xd430('0x25')];_0x5545a7['queuecallerleaveAt']=_0x38da34[_0xd430('0x25')];_0x5545a7['queuecallercomplete']=0x1;_0x5545a7[_0xd430('0x26')]=_0x38da34['endtime'];_0x5545a7[_0xd430('0x27')]=_0x38da34[_0xd430('0x28')];_0x5545a7[_0xd430('0x29')]=_0xd430('0x2a');_0x5545a7[_0xd430('0x2b')]=_0xd430('0x2c');_0x5545a7[_0xd430('0x2d')]=0x0;_0x5545a7['assigned']=0x1;_0x5545a7['lastAssignedTo']=_0x38da34[_0xd430('0x28')];_0x5545a7[_0xd430('0x2e')]=_0xd430('0x2f');return BPromise[_0xd430('0xb')]()[_0xd430('0xe')](voiceQueueReport[_0xd430('0x30')](_0x5545a7))[_0xd430('0xd')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0xd430('0x31')]=function(_0x19594e,_0x32d416){return BPromise[_0xd430('0xb')]()[_0xd430('0xe')](cmHopper[_0xd430('0x31')](_0x19594e,_0x32d416))[_0xd430('0xd')](loggerCatch(_0xd430('0x32')));};exports[_0xd430('0x33')]=function(_0x58205a){return BPromise[_0xd430('0xb')]()[_0xd430('0xe')](cmHopper['rescheduleContact'](_0x58205a,!![],!![]))['catch'](loggerCatch(_0xd430('0x34')));};
\ No newline at end of file
index b147227..9844388 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x253e=['[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','queue','channelAgent','motionChannel','voice','mandatoryDisposition','buildAcw','interface','agentReadyId','status','push','seconds','createBody','filterKey','idContact','type','dialAnswer','countglobal','callbackuniqueid','recallme','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosjitterbridged','getCallerIdRandom','pow','replace','match','util','lodash','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','loggerCatch','error','inspect','logger','info','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','Blacklist','responsetime','logAgent','ringtime','starttime','membername','UserId','state','statedesc','endtime','answertime','Failure','RECALL','uniqueid','originate','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','Global','scheduledAt','active','scheduledat','minutes','ListId','pTalking'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x253e,0x1ae));var _0xe253=function(_0x21222a,_0xa2aa7b){_0x21222a=_0x21222a-0x0;var _0x4cf9e9=_0x253e[_0x21222a];return _0x4cf9e9;};'use strict';var util=require(_0xe253('0x0'));var _=require(_0xe253('0x1'));var moment=require('moment');var logger=require(_0xe253('0x2'))(_0xe253('0x3'));var ipAgi=process[_0xe253('0x4')][_0xe253('0x5')]||_0xe253('0x6');function getSeconds(_0x2c5791,_0xc6e9b0){var _0x5513ff=moment(_0x2c5791)[_0xe253('0x7')](0x0);var _0x57b465=moment(_0xc6e9b0)[_0xe253('0x7')](0x0);return _0x5513ff[_0xe253('0x8')](_0x57b465,'seconds');}exports[_0xe253('0x9')]=function(_0x3fc7c3){return function(_0x323841){logger[_0xe253('0xa')](_0x3fc7c3,util[_0xe253('0xb')](_0x323841,{'showHidden':![],'depth':null}));};};exports[_0xe253('0xc')]=function(_0x493522,_0x5307fe){logger[_0xe253('0xd')](_0x493522,util[_0xe253('0xb')](_0x5307fe,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x260138,_0x8d9582){logger[_0xe253('0xa')](_0x260138,util[_0xe253('0xb')](_0x8d9582,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x487558){return function(_0x3daefd){logger[_0xe253('0xd')](_0x487558,util[_0xe253('0xb')](_0x3daefd,{'showHidden':![],'depth':null}));};};exports[_0xe253('0xe')]=function(_0x3adbe1,_0x50111c,_0x4f7b04){return{'message':_0x3adbe1,'unlock':_0x50111c,'active':_0x4f7b04};};exports['getCallerId']=function(_0x48313d,_0x28c429,_0x3a6aa8){if(!_[_0xe253('0xf')](_0x3a6aa8)&&_0xe253('0x10')===typeof _0x3a6aa8&&!_[_0xe253('0x11')](_0x3a6aa8)){if(!_['isUndefined'](_0x28c429)&&_0xe253('0x10')===typeof _0x28c429&&!_[_0xe253('0x11')](_0x28c429)){return util[_0xe253('0x12')](_0xe253('0x13'),_0x28c429,_0x3a6aa8);}return util[_0xe253('0x12')](_0xe253('0x13'),_0x3a6aa8,_0x3a6aa8);}if(!_[_0xe253('0xf')](_0x48313d)&&_0xe253('0x10')===typeof _0x48313d&&!_[_0xe253('0x11')](_0x48313d)){return _0x48313d;}return _0xe253('0x14');};exports[_0xe253('0x15')]=function(_0x499b67){if(_[_0xe253('0x16')](_0x499b67)){return![];}return _0x499b67;};exports[_0xe253('0x17')]=function(_0x4ed500,_0x40e688,_0x174540,_0x4a8bc2,_0x30e295,_0x30472f){var _0x2f91ab={'XMD-QUEUE':_0x40e688[_0xe253('0x18')]?_0x40e688[_0xe253('0x18')][_0xe253('0x19')]:'','XMD-CALLERID':_0x4a8bc2,'XMD-CALLERID-PREVIEW':_0x30472f?util[_0xe253('0x12')](_0xe253('0x13'),_0x30472f[_0xe253('0x1a')],_0x30472f[_0xe253('0x1b')]):_0x4a8bc2,'XMD-DIALID':_0x30e295,'XMD-CONTACTID':_0x40e688[_0xe253('0x1c')],'XMD-CDRTYPE':_0xe253('0x1d'),'CALLERID(all)':_0x4a8bc2,'XMD-VOICEQUEUEID':_0x40e688[_0xe253('0x1e')],'XMD-DIALCHANNEL':_0x174540,'XMD-DIALTIMEOUT':_0x4ed500[_0xe253('0x1f')]||0x1e,'XMD-DIALOPTIONS':util[_0xe253('0x12')](_0xe253('0x20'),_0x4ed500[_0xe253('0x21')]?'g':'',_[_0xe253('0x11')](_0x4ed500[_0xe253('0x22')])?'':_0xe253('0x23')),'XMD-DIALURL':_0x4ed500[_0xe253('0x24')]||'','XMD-AGI':_0x4ed500['dialQueueProject']?util[_0xe253('0x12')](_0xe253('0x25'),ipAgi,_0x4ed500['dialQueueProject']):_0xe253('0x26'),'XMD-AGIAFTER':_0x4ed500[_0xe253('0x21')]?util[_0xe253('0x12')](_0xe253('0x25'),ipAgi,_0x4ed500['dialQueueProject2']):'NONE','XMD-ORIGINATECALLERIDNUM':_0x30472f?_0x30472f[_0xe253('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x30472f?_0x30472f['originatecalleridname']:'','XMD-DESTINATION':_0xe253('0x28')};if(!_['isEmpty'](_0x4ed500[_0xe253('0x22')])){_0x2f91ab[util[_0xe253('0x12')]('%s',_0xe253('0x29'))]=_0x4ed500[_0xe253('0x22')];_0x2f91ab[util[_0xe253('0x12')]('%s',_0xe253('0x2a'))]=_0x30e295;}if(_0x40e688&&_0x40e688['Contact']){for(var _0xa15fa4 in _0x40e688[_0xe253('0x2b')]){if(_0x40e688[_0xe253('0x2b')][_0xe253('0x2c')](_0xa15fa4)){if(!_['isNil'](_0x40e688[_0xe253('0x2b')][_0xa15fa4])&&_0xa15fa4!=='id'&&_0xa15fa4!==_0xe253('0x2d')&&_0xa15fa4!==_0xe253('0x2e')&&_0xa15fa4!==_0xe253('0x2f')){_0x2f91ab[util['format'](_0xe253('0x30'),_0xe253('0x31'),_[_0xe253('0x32')](_0xa15fa4))]=_0x40e688[_0xe253('0x2b')][_0xa15fa4];}}}}return _0x2f91ab;};exports[_0xe253('0x33')]=function(_0xda192f){var _0x51aa37={};for(var _0x17d8f6 in _0xda192f){if(_0xda192f['hasOwnProperty'](_0x17d8f6)){_0x51aa37[util['format']('%s',_[_0xe253('0x34')](_0x17d8f6))]=_0xda192f[_0x17d8f6];}}return{'variables':_0x51aa37};};exports['updateOriginated']=function(_0x47bdfb,_0x224816){if(!_['isNil'](_0x47bdfb)){if(_0x47bdfb[_0xe253('0x2c')](_0xe253('0x35'))){if(_0x47bdfb[_0xe253('0x35')]>0x0){_0x47bdfb['originated']-=0x1;}else{logger[_0xe253('0xa')](_0xe253('0x36'),_0x224816);}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x224816);}};exports[_0xe253('0x37')]=function(_0x2cb4b4){var _0x2b4309=moment()['format'](_0xe253('0x38'));_0x2cb4b4['state']=0xd;_0x2cb4b4['statedesc']=_0xe253('0x39');_0x2cb4b4['starttime']=_0x2b4309;_0x2cb4b4[_0xe253('0x3a')]=_0x2b4309;_0x2cb4b4['endtime']=_0x2b4309;};exports[_0xe253('0x3b')]=function(_0x2896cd,_0x10e0d3,_0x25f688){var _0xb4ecdb=moment()['format'](_0xe253('0x38'));_0x2896cd['state']=_0x10e0d3;_0x2896cd['statedesc']=_0x25f688;_0x2896cd[_0xe253('0x3a')]=_0xb4ecdb;_0x2896cd[_0xe253('0x3c')]=getSeconds(_0x2896cd['responsetime'],_0x2896cd[_0xe253('0x3d')]);};exports['logLookAgent']=function(_0x2c52d5,_0x513ae0,_0x250f87){_0x2c52d5[_0xe253('0x3e')]=_0x513ae0;_0x2c52d5[_0xe253('0x3f')]=_0x250f87;};exports['logCustomer']=function(_0x542a13,_0x59fe97,_0x2ec675){var _0x159908=moment()[_0xe253('0x12')](_0xe253('0x38'));_0x542a13[_0xe253('0x40')]=_0x59fe97;_0x542a13[_0xe253('0x41')]=_0x2ec675;_0x542a13[_0xe253('0x3a')]=_0x542a13['responsetime']?_0x542a13[_0xe253('0x3a')]:_0x159908;_0x542a13[_0xe253('0x42')]=_0x542a13['endtime']?_0x542a13['endtime']:_0x159908;_0x542a13[_0xe253('0x3c')]=getSeconds(_0x542a13[_0xe253('0x3a')]||0x0,_0x542a13['starttime']||0x0);_0x542a13['talktime']=_0x542a13[_0xe253('0x43')]?getSeconds(_0x542a13[_0xe253('0x42')],_0x542a13[_0xe253('0x43')]):0x0;};exports['isFailure']=function(_0xd7a5c5){return _0xd7a5c5===_0xe253('0x44');};exports['variablesAction']=function(_0x531f24,_0x54f38e,_0x55e806,_0x283892,_0x433c4d){var _0x49bfa2=_0x283892?_0xe253('0x45'):_0x531f24[_0xe253('0x1a')];_0x49bfa2=_0x433c4d?'BOOKED':_0x49bfa2;return{'actionid':_0x531f24[_0xe253('0x46')],'action':_0xe253('0x47'),'channel':_0x531f24['channelAgent'],'callerid':util['format'](_0xe253('0x13'),_0x49bfa2,_0x531f24['calleridnum']),'Exten':_0xe253('0x28'),'Context':_0xe253('0x48'),'Priority':'1','variable':_0x55e806,'timeout':(_0x54f38e[_0xe253('0x49')]||0x1e)*0x3e8,'async':!![],'channelid':_0x531f24[_0xe253('0x46')]};};exports[_0xe253('0x4a')]=function(_0x202540){return _0x202540[_0xe253('0x4b')]+_0x202540[_0xe253('0x4c')]+_0x202540[_0xe253('0x4d')]+_0x202540['countagentrejectretry']+_0x202540[_0xe253('0x4e')];};exports['cloneAction']=function(_0x439308){var _0x25390b=_['clone'](_0x439308);_0x25390b['state']=0xf;_0x25390b[_0xe253('0x41')]=_0xe253('0x4f');return _0x25390b;};exports[_0xe253('0x50')]=function(_0x1a503c,_0x392414,_0xeb64a4){var _0x3fa4b3={};_0x3fa4b3[_0x392414]=_0x1a503c[_0x392414];_0x3fa4b3[_0xe253('0x51')]=![];_0x3fa4b3[_0xe253('0x52')]=moment()['add'](_0xeb64a4,_0xe253('0x53'))[_0xe253('0x12')](_0xe253('0x38'));_0x3fa4b3[_0xe253('0x1c')]=_0x1a503c[_0xe253('0x1c')];_0x3fa4b3[_0xe253('0x54')]=_0x1a503c[_0xe253('0x54')];_0x3fa4b3[_0xe253('0x1e')]=_0x1a503c[_0xe253('0x1e')]||undefined;return _0x3fa4b3;};exports['decrementTalkink']=function(_0x574c04,_0x5119fb){if(!_[_0xe253('0x16')](_0x574c04)){if(_0x574c04[_0xe253('0x55')]>0x0){_0x574c04[_0xe253('0x55')]-=0x1;}else{logger['error'](_0x5119fb,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xe253('0xa')](_0x5119fb,_0xe253('0x56'));}};exports['IsNotLoggedIn']=function(_0x51f1f1){if(_0x51f1f1<=0x0){return!![];}return![];};exports['buildObj']=function(_0xc0078,_0x103aec,_0x227ca2){_0xc0078[_0xe253('0x57')]=_0x103aec;_0xc0078['name']=_0xc0078[_0xe253('0x58')];_0xc0078['interface']=_0xc0078[_0xe253('0x59')];_0xc0078[_0xe253('0x5a')]=_0xe253('0x5b');if(_0x227ca2){_0xc0078[_0xe253('0x5c')]=_0x227ca2[_0xe253('0x5c')];}return _0xc0078;};exports[_0xe253('0x5d')]=function(_0x4b8d6f){var _0x3743c7={};_0x3743c7[_0xe253('0x58')]=_0x4b8d6f[_0xe253('0x58')];_0x3743c7[_0xe253('0x5e')]=_0x4b8d6f[_0xe253('0x59')];_0x3743c7[_0xe253('0x46')]=_0x4b8d6f[_0xe253('0x46')];return _0x3743c7;};exports[_0xe253('0x5f')]=function(_0x4cc240){var _0x80735c=[];for(var _0x42f216 in _0x4cc240){if(_0x4cc240[_0xe253('0x2c')](_0x42f216)){if(!_['isNil'](_0x4cc240[_0x42f216])&&_0x4cc240[_0x42f216][_0xe253('0x40')]==='not_inuse'&&_0x4cc240[_0x42f216][_0xe253('0x60')]==='reachable'){_0x80735c[_0xe253('0x61')](_0x4cc240[_0x42f216]['id']);}}}return _0x80735c;};exports['getDiff']=function(_0x299e18){var _0x4e28aa=moment()[_0xe253('0x7')](0x0);var _0x48c9fc=moment(_0x299e18)[_0xe253('0x7')](0x0);return _0x4e28aa[_0xe253('0x8')](_0x48c9fc,_0xe253('0x62'));};exports[_0xe253('0x63')]=function(_0x1a737c){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x1a737c['ContactId'],'ListId':_0x1a737c['ListId'],'VoiceQueueId':_0x1a737c[_0xe253('0x1e')]||undefined,'CampaignId':_0x1a737c['CampaignId']||undefined};};exports[_0xe253('0x64')]=function(_0x56d7d5){if(_0x56d7d5==='uniqueid'||_0x56d7d5===_0xe253('0x65')||_0x56d7d5===_0xe253('0x58')||_0x56d7d5===_0xe253('0x66')||_0x56d7d5==='campaigntype'||_0x56d7d5===_0xe253('0x67')||_0x56d7d5===_0xe253('0x3e')||_0x56d7d5===_0xe253('0x59')||_0x56d7d5===_0xe253('0x1a')||_0x56d7d5===_0xe253('0x51')||_0x56d7d5===_0xe253('0x1b')||_0x56d7d5===_0xe253('0x52')||_0x56d7d5===_0xe253('0x4b')||_0x56d7d5===_0xe253('0x4c')||_0x56d7d5==='countnoanswerretry'||_0x56d7d5===_0xe253('0x68')||_0x56d7d5==='callback'||_0x56d7d5===_0xe253('0x69')||_0x56d7d5==='callbackat'||_0x56d7d5===_0xe253('0x6a')||_0x56d7d5==='ContactId'||_0x56d7d5===_0xe253('0x54')||_0x56d7d5===_0xe253('0x3f')||_0x56d7d5===_0xe253('0x1e')||_0x56d7d5==='sipcallid'||_0x56d7d5===_0xe253('0x6b')||_0x56d7d5===_0xe253('0x6c')||_0x56d7d5==='xmd-phone'||_0x56d7d5===_0xe253('0x6d')||_0x56d7d5==='xmd-dialurl'||_0x56d7d5==='xmd-dialtimeout'||_0x56d7d5===_0xe253('0x6e')||_0x56d7d5===_0xe253('0x6f')||_0x56d7d5===_0xe253('0x70')||_0x56d7d5===_0xe253('0x71')||_0x56d7d5===_0xe253('0x72')||_0x56d7d5===_0xe253('0x73')||_0x56d7d5==='xmd-agiafter'||_0x56d7d5===_0xe253('0x74')||_0x56d7d5==='rtpaudioqos'||_0x56d7d5===_0xe253('0x75')||_0x56d7d5===_0xe253('0x76')||_0x56d7d5==='rtpaudioqosjitterbridged'||_0x56d7d5===_0xe253('0x77')||_0x56d7d5===_0xe253('0x78')||_0x56d7d5===_0xe253('0x79')||_0x56d7d5===_0xe253('0x7a')||_0x56d7d5===_0xe253('0x7b')||_0x56d7d5===_0xe253('0x75')||_0x56d7d5==='rtpaudioqosjitter'||_0x56d7d5===_0xe253('0x7c')||_0x56d7d5===_0xe253('0x77')||_0x56d7d5===_0xe253('0x78')||_0x56d7d5===_0xe253('0x79')||_0x56d7d5===_0xe253('0x7a')||_0x56d7d5==='bridgepeer'||_0x56d7d5==='bridgepvtcallid'||_0x56d7d5===_0xe253('0x40')||_0x56d7d5==='statedesc'){return![];}return!![];};exports[_0xe253('0x7d')]=function(_0x24c8ff,_0x2d6e60){var _0x33bc11,_0x127890,_0x1a164e;if(_0x2d6e60<=0x0){_0x2d6e60=0x1;}_0x33bc11=new RegExp('\x5cw{0,'+_0x2d6e60+'}$');_0x127890=Math['pow'](0xa,_0x2d6e60-0x1);_0x1a164e=Math[_0xe253('0x7e')](0xa,_0x2d6e60)-0x1;return util[_0xe253('0x12')]('%s',_[_0xe253('0x7f')](_0x24c8ff,_0x33bc11,_['random'](_0x127890,_0x1a164e)));};exports['extractCalleridName']=function(_0x50acd5){var _0x1fdc9f=_0x50acd5[_0xe253('0x80')](/"(.*?)"/);return _0x1fdc9f?_0x1fdc9f[0x1]:_0x50acd5;};exports['extractCalleridNumber']=function(_0x4f8ca4){var _0x1ab910=_0x4f8ca4['match'](/<(.*?)>/);return _0x1ab910?_0x1ab910[0x1]:_0x4f8ca4;};
\ No newline at end of file
+var _0x5291=['originatecalleridnum','_XCALLY_MIXMONITOR_FORMAT','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','starttime','responsetime','endtime','logAgent','statedesc','ringtime','logLookAgent','membername','UserId','logCustomer','talktime','answertime','isFailure','variablesAction','RECALL','uniqueid','originate','channelAgent','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledat','add','minutes','ListId','VoiceQueueId','decrementTalkink','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','interface','motionChannel','voice','mandatoryDisposition','buildAcw','queue','agentReadyId','not_inuse','status','reachable','getDiff','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','calleridname','active','callback','callbackuniqueid','callbackat','recallme','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialchannel','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosloss','bridgepeer','bridgepvtcallid','pow','replace','extractCalleridName','match','lodash','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','error','inspect','logger','info','loggerError','logger2','message','getCallerId','isEmpty','isUndefined','\x22%s\x22\x20<%s>','format','string','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridnum','ContactId','dialer','dialOriginateTimeout','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x5291,0x177));var _0x1529=function(_0x2fd027,_0x4c9fba){_0x2fd027=_0x2fd027-0x0;var _0x43d4cb=_0x5291[_0x2fd027];return _0x43d4cb;};'use strict';var util=require('util');var _=require(_0x1529('0x0'));var moment=require('moment');var logger=require('../../../../config/logger')(_0x1529('0x1'));var ipAgi=process[_0x1529('0x2')][_0x1529('0x3')]||_0x1529('0x4');function getSeconds(_0xdb0509,_0x57faa2){var _0x3462d3=moment(_0xdb0509)[_0x1529('0x5')](0x0);var _0x4e281f=moment(_0x57faa2)[_0x1529('0x5')](0x0);return _0x3462d3[_0x1529('0x6')](_0x4e281f,_0x1529('0x7'));}exports['loggerCatch']=function(_0xbd388a){return function(_0x2332cf){logger[_0x1529('0x8')](_0xbd388a,util[_0x1529('0x9')](_0x2332cf,{'showHidden':![],'depth':null}));};};exports[_0x1529('0xa')]=function(_0xd4a79e,_0x58c089){logger[_0x1529('0xb')](_0xd4a79e,util[_0x1529('0x9')](_0x58c089,{'showHidden':![],'depth':null}));};exports[_0x1529('0xc')]=function(_0x10fd7a,_0x450219){logger['error'](_0x10fd7a,util[_0x1529('0x9')](_0x450219,{'showHidden':![],'depth':null}));};exports[_0x1529('0xd')]=function(_0x2c8d19){return function(_0x3b6537){logger[_0x1529('0xb')](_0x2c8d19,util[_0x1529('0x9')](_0x3b6537,{'showHidden':![],'depth':null}));};};exports[_0x1529('0xe')]=function(_0x551477,_0x3206d4,_0x38ec28){return{'message':_0x551477,'unlock':_0x3206d4,'active':_0x38ec28};};exports[_0x1529('0xf')]=function(_0x4a57f5,_0x18ae94,_0x433be0){if(!_['isUndefined'](_0x433be0)&&'string'===typeof _0x433be0&&!_[_0x1529('0x10')](_0x433be0)){if(!_[_0x1529('0x11')](_0x18ae94)&&'string'===typeof _0x18ae94&&!_['isEmpty'](_0x18ae94)){return util['format'](_0x1529('0x12'),_0x18ae94,_0x433be0);}return util[_0x1529('0x13')](_0x1529('0x12'),_0x433be0,_0x433be0);}if(!_['isUndefined'](_0x4a57f5)&&_0x1529('0x14')===typeof _0x4a57f5&&!_[_0x1529('0x10')](_0x4a57f5)){return _0x4a57f5;}return _0x1529('0x15');};exports[_0x1529('0x16')]=function(_0xad0b12){if(_[_0x1529('0x17')](_0xad0b12)){return![];}return _0xad0b12;};exports['addVariables']=function(_0x59a7cf,_0x26387d,_0x35b1b2,_0x453f7a,_0x323237,_0x3684bb){var _0x45e622={'XMD-QUEUE':_0x26387d[_0x1529('0x18')]?_0x26387d[_0x1529('0x18')][_0x1529('0x19')]:'','XMD-CALLERID':_0x453f7a,'XMD-CALLERID-PREVIEW':_0x3684bb?util[_0x1529('0x13')](_0x1529('0x12'),_0x3684bb['calleridname'],_0x3684bb[_0x1529('0x1a')]):_0x453f7a,'XMD-DIALID':_0x323237,'XMD-CONTACTID':_0x26387d[_0x1529('0x1b')],'XMD-CDRTYPE':_0x1529('0x1c'),'CALLERID(all)':_0x453f7a,'XMD-VOICEQUEUEID':_0x26387d['VoiceQueueId'],'XMD-DIALCHANNEL':_0x35b1b2,'XMD-DIALTIMEOUT':_0x59a7cf[_0x1529('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0x1529('0x13')]('\x22rtTxX%s%s\x22',_0x59a7cf['dialQueueProject2']?'g':'',_[_0x1529('0x10')](_0x59a7cf[_0x1529('0x1e')])?'':_0x1529('0x1f')),'XMD-DIALURL':_0x59a7cf['dialPreviewUrl']||'','XMD-AGI':_0x59a7cf[_0x1529('0x20')]?util[_0x1529('0x13')](_0x1529('0x21'),ipAgi,_0x59a7cf[_0x1529('0x20')]):_0x1529('0x22'),'XMD-AGIAFTER':_0x59a7cf[_0x1529('0x23')]?util[_0x1529('0x13')](_0x1529('0x21'),ipAgi,_0x59a7cf[_0x1529('0x23')]):_0x1529('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x3684bb?_0x3684bb[_0x1529('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x3684bb?_0x3684bb['originatecalleridname']:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_[_0x1529('0x10')](_0x59a7cf[_0x1529('0x1e')])){_0x45e622[util['format']('%s',_0x1529('0x25'))]=_0x59a7cf['monitor_format'];_0x45e622[util[_0x1529('0x13')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x323237;}if(_0x26387d&&_0x26387d[_0x1529('0x26')]){for(var _0x1220a6 in _0x26387d[_0x1529('0x26')]){if(_0x26387d[_0x1529('0x26')]['hasOwnProperty'](_0x1220a6)){if(!_[_0x1529('0x17')](_0x26387d['Contact'][_0x1220a6])&&_0x1220a6!=='id'&&_0x1220a6!==_0x1529('0x27')&&_0x1220a6!==_0x1529('0x28')&&_0x1220a6!==_0x1529('0x29')){_0x45e622[util[_0x1529('0x13')](_0x1529('0x2a'),_0x1529('0x2b'),_[_0x1529('0x2c')](_0x1220a6))]=_0x26387d[_0x1529('0x26')][_0x1220a6];}}}}return _0x45e622;};exports[_0x1529('0x2d')]=function(_0x20e4c7){var _0x190b28={};for(var _0x5ead01 in _0x20e4c7){if(_0x20e4c7[_0x1529('0x2e')](_0x5ead01)){_0x190b28[util[_0x1529('0x13')]('%s',_[_0x1529('0x2f')](_0x5ead01))]=_0x20e4c7[_0x5ead01];}}return{'variables':_0x190b28};};exports[_0x1529('0x30')]=function(_0x314e42,_0x5ae290){if(!_[_0x1529('0x17')](_0x314e42)){if(_0x314e42[_0x1529('0x2e')](_0x1529('0x31'))){if(_0x314e42['originated']>0x0){_0x314e42[_0x1529('0x31')]-=0x1;}else{logger['error'](_0x1529('0x32'),_0x5ae290);}}}else{logger[_0x1529('0x8')](_0x1529('0x33'),_0x5ae290);}};exports['logBlacklist']=function(_0x323089){var _0x416776=moment()[_0x1529('0x13')](_0x1529('0x34'));_0x323089[_0x1529('0x35')]=0xd;_0x323089['statedesc']='Blacklist';_0x323089[_0x1529('0x36')]=_0x416776;_0x323089[_0x1529('0x37')]=_0x416776;_0x323089[_0x1529('0x38')]=_0x416776;};exports[_0x1529('0x39')]=function(_0x34a72a,_0x18142d,_0x2554ca){var _0x38bc8c=moment()[_0x1529('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x34a72a['state']=_0x18142d;_0x34a72a[_0x1529('0x3a')]=_0x2554ca;_0x34a72a[_0x1529('0x37')]=_0x38bc8c;_0x34a72a[_0x1529('0x3b')]=getSeconds(_0x34a72a['responsetime'],_0x34a72a['starttime']);};exports[_0x1529('0x3c')]=function(_0x47c564,_0x535cb6,_0x5977c0){_0x47c564[_0x1529('0x3d')]=_0x535cb6;_0x47c564[_0x1529('0x3e')]=_0x5977c0;};exports[_0x1529('0x3f')]=function(_0x3541d0,_0x4fd91b,_0x432a85){var _0x34a2e7=moment()['format'](_0x1529('0x34'));_0x3541d0[_0x1529('0x35')]=_0x4fd91b;_0x3541d0[_0x1529('0x3a')]=_0x432a85;_0x3541d0['responsetime']=_0x3541d0['responsetime']?_0x3541d0[_0x1529('0x37')]:_0x34a2e7;_0x3541d0[_0x1529('0x38')]=_0x3541d0['endtime']?_0x3541d0[_0x1529('0x38')]:_0x34a2e7;_0x3541d0['ringtime']=getSeconds(_0x3541d0[_0x1529('0x37')]||0x0,_0x3541d0[_0x1529('0x36')]||0x0);_0x3541d0[_0x1529('0x40')]=_0x3541d0[_0x1529('0x41')]?getSeconds(_0x3541d0[_0x1529('0x38')],_0x3541d0['answertime']):0x0;};exports[_0x1529('0x42')]=function(_0x541060){return _0x541060==='Failure';};exports[_0x1529('0x43')]=function(_0x1b7683,_0x146265,_0x10e3ec,_0x5d2b84,_0x2c71e5){var _0x58f80a=_0x5d2b84?_0x1529('0x44'):_0x1b7683['calleridname'];_0x58f80a=_0x2c71e5?'BOOKED':_0x58f80a;return{'actionid':_0x1b7683[_0x1529('0x45')],'action':_0x1529('0x46'),'channel':_0x1b7683[_0x1529('0x47')],'callerid':util[_0x1529('0x13')](_0x1529('0x12'),_0x58f80a,_0x1b7683['calleridnum']),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x10e3ec,'timeout':(_0x146265[_0x1529('0x48')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1b7683[_0x1529('0x45')]};};exports[_0x1529('0x49')]=function(_0x11ea12){return _0x11ea12[_0x1529('0x4a')]+_0x11ea12[_0x1529('0x4b')]+_0x11ea12[_0x1529('0x4c')]+_0x11ea12[_0x1529('0x4d')]+_0x11ea12[_0x1529('0x4e')];};exports[_0x1529('0x4f')]=function(_0x561ffe){var _0x4e32ec=_[_0x1529('0x50')](_0x561ffe);_0x4e32ec[_0x1529('0x35')]=0xf;_0x4e32ec[_0x1529('0x3a')]=_0x1529('0x51');return _0x4e32ec;};exports['scheduledAt']=function(_0x14d023,_0x4504d4,_0xf446d3){var _0x3a815e={};_0x3a815e[_0x4504d4]=_0x14d023[_0x4504d4];_0x3a815e['active']=![];_0x3a815e[_0x1529('0x52')]=moment()[_0x1529('0x53')](_0xf446d3,_0x1529('0x54'))[_0x1529('0x13')](_0x1529('0x34'));_0x3a815e[_0x1529('0x1b')]=_0x14d023['ContactId'];_0x3a815e[_0x1529('0x55')]=_0x14d023[_0x1529('0x55')];_0x3a815e[_0x1529('0x56')]=_0x14d023[_0x1529('0x56')]||undefined;return _0x3a815e;};exports[_0x1529('0x57')]=function(_0x46e4e6,_0x299ef8){if(!_[_0x1529('0x17')](_0x46e4e6)){if(_0x46e4e6['pTalking']>0x0){_0x46e4e6['pTalking']-=0x1;}else{logger[_0x1529('0x8')](_0x299ef8,_0x1529('0x58'));}}else{logger[_0x1529('0x8')](_0x299ef8,_0x1529('0x59'));}};exports[_0x1529('0x5a')]=function(_0x23e076){if(_0x23e076<=0x0){return!![];}return![];};exports[_0x1529('0x5b')]=function(_0x59b66d,_0x21e6ca,_0x54e749){_0x59b66d[_0x1529('0x5c')]=_0x21e6ca;_0x59b66d[_0x1529('0x19')]=_0x59b66d['queue'];_0x59b66d[_0x1529('0x5d')]=_0x59b66d['channelAgent'];_0x59b66d[_0x1529('0x5e')]=_0x1529('0x5f');if(_0x54e749){_0x59b66d[_0x1529('0x60')]=_0x54e749[_0x1529('0x60')];}return _0x59b66d;};exports[_0x1529('0x61')]=function(_0x1c3ba9){var _0x46ea26={};_0x46ea26[_0x1529('0x62')]=_0x1c3ba9[_0x1529('0x62')];_0x46ea26[_0x1529('0x5d')]=_0x1c3ba9[_0x1529('0x47')];_0x46ea26[_0x1529('0x45')]=_0x1c3ba9[_0x1529('0x45')];return _0x46ea26;};exports[_0x1529('0x63')]=function(_0x4aebc6){var _0x20328c=[];for(var _0x4354de in _0x4aebc6){if(_0x4aebc6['hasOwnProperty'](_0x4354de)){if(!_[_0x1529('0x17')](_0x4aebc6[_0x4354de])&&_0x4aebc6[_0x4354de]['state']===_0x1529('0x64')&&_0x4aebc6[_0x4354de][_0x1529('0x65')]===_0x1529('0x66')){_0x20328c['push'](_0x4aebc6[_0x4354de]['id']);}}}return _0x20328c;};exports[_0x1529('0x67')]=function(_0x196450){var _0x37027e=moment()[_0x1529('0x5')](0x0);var _0x209234=moment(_0x196450)[_0x1529('0x5')](0x0);return _0x37027e[_0x1529('0x6')](_0x209234,'seconds');};exports['createBody']=function(_0x472db5){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x472db5[_0x1529('0x1b')],'ListId':_0x472db5[_0x1529('0x55')],'VoiceQueueId':_0x472db5[_0x1529('0x56')]||undefined,'CampaignId':_0x472db5[_0x1529('0x68')]||undefined};};exports[_0x1529('0x69')]=function(_0x4c64c7){if(_0x4c64c7===_0x1529('0x45')||_0x4c64c7===_0x1529('0x6a')||_0x4c64c7===_0x1529('0x62')||_0x4c64c7===_0x1529('0x6b')||_0x4c64c7===_0x1529('0x6c')||_0x4c64c7===_0x1529('0x6d')||_0x4c64c7===_0x1529('0x3d')||_0x4c64c7===_0x1529('0x47')||_0x4c64c7===_0x1529('0x6e')||_0x4c64c7===_0x1529('0x6f')||_0x4c64c7===_0x1529('0x1a')||_0x4c64c7===_0x1529('0x52')||_0x4c64c7==='countbusyretry'||_0x4c64c7===_0x1529('0x4b')||_0x4c64c7===_0x1529('0x4c')||_0x4c64c7==='countglobal'||_0x4c64c7===_0x1529('0x70')||_0x4c64c7===_0x1529('0x71')||_0x4c64c7===_0x1529('0x72')||_0x4c64c7===_0x1529('0x73')||_0x4c64c7===_0x1529('0x1b')||_0x4c64c7===_0x1529('0x55')||_0x4c64c7==='UserId'||_0x4c64c7===_0x1529('0x56')||_0x4c64c7==='sipcallid'||_0x4c64c7==='xmd-voicequeueid'||_0x4c64c7===_0x1529('0x74')||_0x4c64c7===_0x1529('0x75')||_0x4c64c7==='xmd-listid'||_0x4c64c7===_0x1529('0x76')||_0x4c64c7===_0x1529('0x77')||_0x4c64c7==='xmd-dialoptions'||_0x4c64c7==='xmd-dialid'||_0x4c64c7===_0x1529('0x78')||_0x4c64c7==='xmd-contactid'||_0x4c64c7==='xmd-cdrtype'||_0x4c64c7==='xmd-callerid'||_0x4c64c7===_0x1529('0x79')||_0x4c64c7===_0x1529('0x7a')||_0x4c64c7===_0x1529('0x7b')||_0x4c64c7===_0x1529('0x7c')||_0x4c64c7===_0x1529('0x7d')||_0x4c64c7===_0x1529('0x7e')||_0x4c64c7==='rtpaudioqosloss'||_0x4c64c7===_0x1529('0x7f')||_0x4c64c7===_0x1529('0x80')||_0x4c64c7===_0x1529('0x81')||_0x4c64c7===_0x1529('0x7b')||_0x4c64c7==='rtpaudioqosbridged'||_0x4c64c7==='rtpaudioqosjitter'||_0x4c64c7===_0x1529('0x7e')||_0x4c64c7===_0x1529('0x82')||_0x4c64c7===_0x1529('0x7f')||_0x4c64c7===_0x1529('0x80')||_0x4c64c7===_0x1529('0x81')||_0x4c64c7===_0x1529('0x83')||_0x4c64c7===_0x1529('0x84')||_0x4c64c7===_0x1529('0x35')||_0x4c64c7==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x2685d1,_0x45d955){var _0x4c35ad,_0x5bd311,_0x321bba;if(_0x45d955<=0x0){_0x45d955=0x1;}_0x4c35ad=new RegExp('\x5cw{0,'+_0x45d955+'}$');_0x5bd311=Math['pow'](0xa,_0x45d955-0x1);_0x321bba=Math[_0x1529('0x85')](0xa,_0x45d955)-0x1;return util[_0x1529('0x13')]('%s',_[_0x1529('0x86')](_0x2685d1,_0x4c35ad,_['random'](_0x5bd311,_0x321bba)));};exports[_0x1529('0x87')]=function(_0x398361){var _0x52007c=_0x398361[_0x1529('0x88')](/"(.*?)"/);return _0x52007c?_0x52007c[0x1]:_0x398361;};exports['extractCalleridNumber']=function(_0x1f7778){var _0xb25660=_0x1f7778[_0x1529('0x88')](/<(.*?)>/);return _0xb25660?_0xb25660[0x1]:_0x1f7778;};
\ No newline at end of file
index f1d0937..2d831f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8221=['boolean','queueremove','queuepause','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number'];(function(_0x22bea1,_0x39476f){var _0x4cc8f9=function(_0x3a6588){while(--_0x3a6588){_0x22bea1['push'](_0x22bea1['shift']());}};_0x4cc8f9(++_0x39476f);}(_0x8221,0x16f));var _0x1822=function(_0x245afe,_0x319cde){_0x245afe=_0x245afe-0x0;var _0x4eefde=_0x8221[_0x245afe];return _0x4eefde;};'use strict';exports[_0x1822('0x0')]={'queue':{'type':_0x1822('0x1'),'required':!![]},'interface':{'type':_0x1822('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x1822('0x2'),'required':![]},'paused':{'type':_0x1822('0x3'),'required':![]}};exports[_0x1822('0x4')]={'queue':{'type':_0x1822('0x1'),'required':!![]},'interface':{'type':_0x1822('0x1'),'required':!![]}};exports[_0x1822('0x5')]={'interface':{'type':_0x1822('0x1'),'required':!![]},'paused':{'type':_0x1822('0x3')},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':_0x1822('0x1'),'required':![]}};exports[_0x1822('0x6')]={'uniqueid':{'type':_0x1822('0x1'),'required':!![]}};exports[_0x1822('0x7')]={'uniqueid':{'type':_0x1822('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0x1822('0x1')},'mixmonitorid':{'type':_0x1822('0x1')}};exports[_0x1822('0x8')]={'uniqueid':{'type':_0x1822('0x1'),'required':!![]}};exports[_0x1822('0x9')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x1822('0x1'),'required':!![]},'context':{'type':_0x1822('0x1')}};
\ No newline at end of file
+var _0x6d11=['queueadd','string','number','queuepause','boolean','reload','voicequeuechannelhangup','voicequeuechannelredirect'];(function(_0x256ee7,_0x5b3f38){var _0x2b9aa2=function(_0x4bf505){while(--_0x4bf505){_0x256ee7['push'](_0x256ee7['shift']());}};_0x2b9aa2(++_0x5b3f38);}(_0x6d11,0x1e8));var _0x16d1=function(_0x5ef7cc,_0x5f4f54){_0x5ef7cc=_0x5ef7cc-0x0;var _0x4e662a=_0x6d11[_0x5ef7cc];return _0x4e662a;};'use strict';exports[_0x16d1('0x0')]={'queue':{'type':_0x16d1('0x1'),'required':!![]},'interface':{'type':_0x16d1('0x1'),'required':!![]},'membername':{'type':_0x16d1('0x1'),'required':!![]},'penalty':{'type':_0x16d1('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports['queueremove']={'queue':{'type':_0x16d1('0x1'),'required':!![]},'interface':{'type':_0x16d1('0x1'),'required':!![]}};exports[_0x16d1('0x3')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0x16d1('0x4')},'reason':{'type':_0x16d1('0x1'),'required':![]}};exports[_0x16d1('0x5')]={'module':{'type':'string','required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':'string','required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x16d1('0x1'),'required':!![]},'filename':{'type':_0x16d1('0x1')},'format':{'type':_0x16d1('0x1')},'mixmonitorid':{'type':_0x16d1('0x1')}};exports[_0x16d1('0x6')]={'uniqueid':{'type':_0x16d1('0x1'),'required':!![]}};exports[_0x16d1('0x7')]={'uniqueid':{'type':_0x16d1('0x1'),'required':!![]},'exten':{'type':_0x16d1('0x1'),'required':!![]},'context':{'type':_0x16d1('0x1')}};
\ No newline at end of file
index c05f98b..c0e3fc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d44=['initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','merge','groupBy','queue','queuecallerexit','unmanaged','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','diff','seconds','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','campaigns','dialQueueProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','lodash','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/freshsalesAccount','../model/faxAccount','agents','telephones','voiceQueues','triggers','outbound','queueChannels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','name','hasOwnProperty','isNil','interface','total','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','answered','abandoned','sumHoldTime','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','SIP/%s','isUndefined','initTelephones','length','initTrunks','trunks','initVoiceQueues','templates','initZendeskAccounts'];(function(_0x5962ad,_0x3074bf){var _0x13e49e=function(_0xfa9e4b){while(--_0xfa9e4b){_0x5962ad['push'](_0x5962ad['shift']());}};_0x13e49e(++_0x3074bf);}(_0x6d44,0xfc));var _0x46d4=function(_0xe86041,_0x2fbd7b){_0xe86041=_0xe86041-0x0;var _0x1230a9=_0x6d44[_0xe86041];return _0x1230a9;};'use strict';var BPromise=require(_0x46d4('0x0'));var util=require(_0x46d4('0x1'));var _=require(_0x46d4('0x2'));var moment=require('moment');var Agent=require(_0x46d4('0x3'));var Telephone=require(_0x46d4('0x4'));var Trunk=require(_0x46d4('0x5'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x46d4('0x6'));var Template=require('../model/template');var Campaign=require(_0x46d4('0x7'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x46d4('0x8'));var SalesforceAccount=require(_0x46d4('0x9'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x46d4('0xa'));var ZohoAccount=require(_0x46d4('0xb'));var DeskAccount=require(_0x46d4('0xc'));var VtigerAccount=require(_0x46d4('0xd'));var ServicenowAccount=require(_0x46d4('0xe'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x46d4('0xf'));var FaxAccount=require(_0x46d4('0x10'));var Realtime=function(){this[_0x46d4('0x11')]={};this[_0x46d4('0x12')]={};this['trunks']={};this[_0x46d4('0x13')]={};this[_0x46d4('0x14')]={};this['campaigns']={};this['templates']={};this[_0x46d4('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this['channels']={};this[_0x46d4('0x16')]={};this[_0x46d4('0x17')]={};this['timers']={};this[_0x46d4('0x18')]={};this[_0x46d4('0x19')]={};this[_0x46d4('0x1a')]={};this[_0x46d4('0x1b')]={};this[_0x46d4('0x1c')]={};this[_0x46d4('0x1d')]={};this[_0x46d4('0x1e')]={};this['vtigerAccounts']={};this[_0x46d4('0x1f')]={};this[_0x46d4('0x20')]={};this[_0x46d4('0x21')]={};this[_0x46d4('0x22')]={};};function freeIsNotKey(_0x1bebbf,_0x1d7bed,_0x2ee621){var _0x1ffb17=_['mapKeys'](_0x1bebbf,function(_0x4b762c,_0x58936d){return _0x4b762c[_0x2ee621];});for(var _0x6beac in _0x1d7bed){if(_0x1d7bed['hasOwnProperty'](_0x6beac)){if(!_0x1ffb17[_0x6beac]){delete _0x1d7bed[_0x6beac];}}}}function freeIsNotKeySip(_0x3d8f81,_0x568c64){var _0x20de28=_[_0x46d4('0x23')](_0x3d8f81,function(_0x161a40,_0x5a8b29){return util[_0x46d4('0x24')]('SIP/%s',_0x161a40[_0x46d4('0x25')]);});for(var _0x16424b in _0x568c64){if(_0x568c64[_0x46d4('0x26')](_0x16424b)){if(!_0x20de28[_0x16424b]){delete _0x568c64[_0x16424b];}}}}function freeIsNotKeyAgent(_0x49df0c,_0x10958e){var _0x200464=_[_0x46d4('0x23')](_0x49df0c,function(_0x259a0c,_0x1ff5e6){var _0x43b641=_[_0x46d4('0x27')](_0x259a0c[_0x46d4('0x28')])?util[_0x46d4('0x24')]('SIP/%s',_0x259a0c[_0x46d4('0x25')]):_0x259a0c['interface'];return _0x43b641;});for(var _0x325617 in _0x10958e){if(_0x10958e[_0x46d4('0x26')](_0x325617)){if(!_0x200464[_0x325617]){delete _0x10958e[_0x325617];}}}}function clearVoiceCallReports(_0x12192c){_0x12192c[_0x46d4('0x29')]=0x0;_0x12192c['answered']=0x0;_0x12192c['sumHoldTime']=0x0;_0x12192c[_0x46d4('0x2a')]=0x0;_0x12192c[_0x46d4('0x2b')]=0x0;}function clearCampaigns(_0xd9c2ff){if(!_[_0x46d4('0x2c')](_0xd9c2ff)){for(var _0x96ce0e in _0xd9c2ff){if(_0xd9c2ff['hasOwnProperty'](_0x96ce0e)){_0xd9c2ff[_0x96ce0e][_0x46d4('0x2d')]=0x0;_0xd9c2ff[_0x96ce0e][_0x46d4('0x2e')]=0x0;}}}}function clearVoiceQueues(_0x438e9c){if(!_[_0x46d4('0x2c')](_0x438e9c)){for(var _0x351492 in _0x438e9c){if(_0x438e9c[_0x46d4('0x26')](_0x351492)){_0x438e9c[_0x351492][_0x46d4('0x29')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x2f')]=0x0;_0x438e9c[_0x351492]['unmanaged']=0x0;_0x438e9c[_0x351492][_0x46d4('0x30')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x31')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x2a')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x2b')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x32')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x33')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x34')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x35')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x36')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x37')]=0x0;_0x438e9c[_0x351492]['outboundDropCallsDayTimeout']=0x0;_0x438e9c[_0x351492][_0x46d4('0x38')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x39')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x3a')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x3b')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x3c')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x32')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x3d')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x3e')]=!![];}}}}Realtime[_0x46d4('0x3f')][_0x46d4('0x40')]=function(_0x440614,_0x2fb472){for(var _0x201aa3 in _0x2fb472){if(_0x440614[_0x46d4('0x26')](_0x201aa3)){_0x440614[_0x201aa3]=_0x2fb472[_0x201aa3];}}};Realtime[_0x46d4('0x3f')][_0x46d4('0x41')]=function(){var _0x408183=this;return function(_0x2f962f){if(_0x2f962f){freeIsNotKeyAgent(_0x2f962f,_0x408183['agents']);for(var _0x153d2d=0x0,_0x156737={},_0x54ab12={};_0x153d2d<_0x2f962f['length'];_0x153d2d+=0x1){_0x156737=_0x2f962f[_0x153d2d];var _0x17ddc5=_['isNil'](_0x156737[_0x46d4('0x28')])?util[_0x46d4('0x24')](_0x46d4('0x42'),_0x156737[_0x46d4('0x25')]):_0x156737['interface'];if(_[_0x46d4('0x43')](_0x408183[_0x46d4('0x11')][_0x17ddc5])){_0x408183[_0x46d4('0x11')][_0x17ddc5]=new Agent(_0x156737);}else{_0x408183[_0x46d4('0x40')](_0x408183[_0x46d4('0x11')][_0x17ddc5],_0x156737);}}}return _0x408183[_0x46d4('0x11')];};};Realtime['prototype'][_0x46d4('0x44')]=function(){var _0x5e8116=this;return function(_0x1762a2){if(_0x1762a2){freeIsNotKeySip(_0x1762a2,_0x5e8116[_0x46d4('0x12')]);for(var _0x3060d7=0x0,_0x4d0b8a={},_0x571962={};_0x3060d7<_0x1762a2[_0x46d4('0x45')];_0x3060d7+=0x1){_0x4d0b8a=_0x1762a2[_0x3060d7];if(_['isUndefined'](_0x5e8116[_0x46d4('0x12')][util['format'](_0x46d4('0x42'),_0x4d0b8a[_0x46d4('0x25')])])){_0x5e8116[_0x46d4('0x12')][util['format'](_0x46d4('0x42'),_0x4d0b8a[_0x46d4('0x25')])]=new Telephone(_0x4d0b8a);}else{_0x5e8116['mergeFromDatabase'](_0x5e8116['telephones'][util[_0x46d4('0x24')]('SIP/%s',_0x4d0b8a[_0x46d4('0x25')])],_0x4d0b8a);}}}return _0x5e8116['telephones'];};};Realtime[_0x46d4('0x3f')][_0x46d4('0x46')]=function(){var _0x1a0a6f=this;return function(_0xfa2668){if(_0xfa2668){freeIsNotKeySip(_0xfa2668,_0x1a0a6f[_0x46d4('0x47')]);for(var _0x1da9c9=0x0,_0x4d8dda={},_0x30268b={};_0x1da9c9<_0xfa2668[_0x46d4('0x45')];_0x1da9c9+=0x1){_0x4d8dda=_0xfa2668[_0x1da9c9];if(_[_0x46d4('0x43')](_0x1a0a6f[_0x46d4('0x47')][util[_0x46d4('0x24')](_0x46d4('0x42'),_0x4d8dda[_0x46d4('0x25')])])){_0x1a0a6f[_0x46d4('0x47')][util[_0x46d4('0x24')](_0x46d4('0x42'),_0x4d8dda[_0x46d4('0x25')])]=new Trunk(_0x4d8dda);}else{_0x1a0a6f['mergeFromDatabase'](_0x1a0a6f[_0x46d4('0x47')][util['format'](_0x46d4('0x42'),_0x4d8dda[_0x46d4('0x25')])],_0x4d8dda);}}}return _0x1a0a6f[_0x46d4('0x47')];};};Realtime['prototype'][_0x46d4('0x48')]=function(){var _0x339c62=this;return function(_0x117287){if(_0x117287){freeIsNotKey(_0x117287,_0x339c62[_0x46d4('0x13')],_0x46d4('0x25'));for(var _0x5e284d=0x0,_0x42ebc3={},_0x55dd85={};_0x5e284d<_0x117287[_0x46d4('0x45')];_0x5e284d+=0x1){_0x42ebc3=_0x117287[_0x5e284d];if(_['isUndefined'](_0x339c62[_0x46d4('0x13')][_0x42ebc3['name']])){_0x339c62['voiceQueues'][_0x42ebc3[_0x46d4('0x25')]]=new VoiceQueue(_0x42ebc3);}else{_0x339c62[_0x46d4('0x40')](_0x339c62[_0x46d4('0x13')][_0x42ebc3[_0x46d4('0x25')]],_0x42ebc3);}}}return _0x339c62['voiceQueues'];};};Realtime[_0x46d4('0x3f')]['initTriggers']=function(){var _0x385f8b=this;return function(_0x562293){if(_0x562293){freeIsNotKey(_0x562293,_0x385f8b[_0x46d4('0x14')],'id');for(var _0xb6645c=0x0,_0x111d9a={},_0x507a39={};_0xb6645c<_0x562293[_0x46d4('0x45')];_0xb6645c+=0x1){_0x111d9a=_0x562293[_0xb6645c];if(_['isUndefined'](_0x385f8b[_0x46d4('0x14')][_0x111d9a['id']])){_0x385f8b[_0x46d4('0x14')][_0x111d9a['id']]=new Trigger(_0x111d9a);}else{_0x385f8b[_0x46d4('0x40')](_0x385f8b['triggers'][_0x111d9a['id']],_0x111d9a);}}}return _0x385f8b['triggers'];};};Realtime[_0x46d4('0x3f')]['initTemplates']=function(){var _0xc3dcff=this;return function(_0x55351e){if(_0x55351e){freeIsNotKey(_0x55351e,_0xc3dcff[_0x46d4('0x49')],'id');for(var _0x1ad375=0x0,_0x439711={},_0x511fb0={};_0x1ad375<_0x55351e[_0x46d4('0x45')];_0x1ad375+=0x1){_0x439711=_0x55351e[_0x1ad375];if(_['isUndefined'](_0xc3dcff[_0x46d4('0x49')][_0x439711['id']])){_0xc3dcff['templates'][_0x439711['id']]=new Template(_0x439711);}else{_0xc3dcff[_0x46d4('0x40')](_0xc3dcff[_0x46d4('0x49')][_0x439711['id']],_0x439711);}}}return _0xc3dcff['templates'];};};Realtime[_0x46d4('0x3f')][_0x46d4('0x4a')]=function(){var _0x5a2125=this;return function(_0x42a3e5){if(_0x42a3e5){freeIsNotKey(_0x42a3e5,_0x5a2125[_0x46d4('0x19')],'id');for(var _0x3bc5ac=0x0,_0x59a394={},_0x118262={};_0x3bc5ac<_0x42a3e5['length'];_0x3bc5ac+=0x1){_0x59a394=_0x42a3e5[_0x3bc5ac];if(_['isUndefined'](_0x5a2125[_0x46d4('0x19')][_0x59a394['id']])){_0x5a2125[_0x46d4('0x19')][_0x59a394['id']]=new ZendeskAccount(_0x59a394);}else{_0x5a2125[_0x46d4('0x40')](_0x5a2125[_0x46d4('0x19')][_0x59a394['id']],_0x59a394);}}}return _0x5a2125[_0x46d4('0x19')];};};Realtime[_0x46d4('0x3f')]['initSalesforceAccounts']=function(){var _0x1d04ce=this;return function(_0x55e3bb){if(_0x55e3bb){freeIsNotKey(_0x55e3bb,_0x1d04ce[_0x46d4('0x1a')],'id');for(var _0x3fec6d=0x0,_0x1a45d6={},_0x5da8d2={};_0x3fec6d<_0x55e3bb[_0x46d4('0x45')];_0x3fec6d+=0x1){_0x1a45d6=_0x55e3bb[_0x3fec6d];if(_[_0x46d4('0x43')](_0x1d04ce[_0x46d4('0x1a')][_0x1a45d6['id']])){_0x1d04ce[_0x46d4('0x1a')][_0x1a45d6['id']]=new SalesforceAccount(_0x1a45d6);}else{_0x1d04ce[_0x46d4('0x40')](_0x1d04ce[_0x46d4('0x1a')][_0x1a45d6['id']],_0x1a45d6);}}}return _0x1d04ce[_0x46d4('0x1a')];};};Realtime['prototype'][_0x46d4('0x4b')]=function(){var _0x44610b=this;return function(_0x1ef747){if(_0x1ef747){freeIsNotKey(_0x1ef747,_0x44610b['freshdeskAccounts'],'id');for(var _0x2d5997=0x0,_0x1c7206={},_0x3a8605={};_0x2d5997<_0x1ef747['length'];_0x2d5997+=0x1){_0x1c7206=_0x1ef747[_0x2d5997];if(_[_0x46d4('0x43')](_0x44610b[_0x46d4('0x1c')][_0x1c7206['id']])){_0x44610b[_0x46d4('0x1c')][_0x1c7206['id']]=new FreshdeskAccount(_0x1c7206);}else{_0x44610b[_0x46d4('0x40')](_0x44610b[_0x46d4('0x1c')][_0x1c7206['id']],_0x1c7206);}}}return _0x44610b[_0x46d4('0x1c')];};};Realtime['prototype'][_0x46d4('0x4c')]=function(){var _0x2e202b=this;return function(_0x301a94){if(_0x301a94){freeIsNotKey(_0x301a94,_0x2e202b[_0x46d4('0x1d')],'id');for(var _0x2c5d0a=0x0,_0x532a7f={},_0x1f10ee={};_0x2c5d0a<_0x301a94['length'];_0x2c5d0a+=0x1){_0x532a7f=_0x301a94[_0x2c5d0a];if(_[_0x46d4('0x43')](_0x2e202b[_0x46d4('0x1d')][_0x532a7f['id']])){_0x2e202b[_0x46d4('0x1d')][_0x532a7f['id']]=new ZohoAccount(_0x532a7f);}else{_0x2e202b[_0x46d4('0x40')](_0x2e202b[_0x46d4('0x1d')][_0x532a7f['id']],_0x532a7f);}}}return _0x2e202b[_0x46d4('0x1d')];};};Realtime['prototype'][_0x46d4('0x4d')]=function(){var _0x2c63d0=this;return function(_0x5305f3){if(_0x5305f3){freeIsNotKey(_0x5305f3,_0x2c63d0['deskAccounts'],'id');for(var _0x21ba20=0x0,_0x12c5db={},_0x4be256={};_0x21ba20<_0x5305f3[_0x46d4('0x45')];_0x21ba20+=0x1){_0x12c5db=_0x5305f3[_0x21ba20];if(_['isUndefined'](_0x2c63d0[_0x46d4('0x1e')][_0x12c5db['id']])){_0x2c63d0['deskAccounts'][_0x12c5db['id']]=new DeskAccount(_0x12c5db);}else{_0x2c63d0[_0x46d4('0x40')](_0x2c63d0['deskAccounts'][_0x12c5db['id']],_0x12c5db);}}}return _0x2c63d0['deskAccounts'];};};Realtime[_0x46d4('0x3f')][_0x46d4('0x4e')]=function(){var _0x1f31ec=this;return function(_0x4ce374){if(_0x4ce374){freeIsNotKey(_0x4ce374,_0x1f31ec[_0x46d4('0x1b')],'id');for(var _0x1f1b16=0x0,_0x50f7a3={},_0x48b15a={};_0x1f1b16<_0x4ce374['length'];_0x1f1b16+=0x1){_0x50f7a3=_0x4ce374[_0x1f1b16];if(_[_0x46d4('0x43')](_0x1f31ec[_0x46d4('0x1b')][_0x50f7a3['id']])){_0x1f31ec[_0x46d4('0x1b')][_0x50f7a3['id']]=new SugarcrmAccount(_0x50f7a3);}else{_0x1f31ec['mergeFromDatabase'](_0x1f31ec['sugarcrmAccounts'][_0x50f7a3['id']],_0x50f7a3);}}}return _0x1f31ec[_0x46d4('0x1b')];};};Realtime[_0x46d4('0x3f')]['initVtigerAccounts']=function(){var _0x5b64be=this;return function(_0x2ae8cf){if(_0x2ae8cf){freeIsNotKey(_0x2ae8cf,_0x5b64be[_0x46d4('0x4f')],'id');for(var _0x117d93=0x0,_0x53f7f7={},_0x45228b={};_0x117d93<_0x2ae8cf['length'];_0x117d93+=0x1){_0x53f7f7=_0x2ae8cf[_0x117d93];if(_['isUndefined'](_0x5b64be[_0x46d4('0x4f')][_0x53f7f7['id']])){_0x5b64be[_0x46d4('0x4f')][_0x53f7f7['id']]=new VtigerAccount(_0x53f7f7);}else{_0x5b64be['mergeFromDatabase'](_0x5b64be[_0x46d4('0x4f')][_0x53f7f7['id']],_0x53f7f7);}}}return _0x5b64be[_0x46d4('0x4f')];};};Realtime[_0x46d4('0x3f')][_0x46d4('0x50')]=function(){var _0xdc4b37=this;return function(_0x192183){if(_0x192183){freeIsNotKey(_0x192183,_0xdc4b37[_0x46d4('0x1f')],'id');for(var _0x50bc16=0x0,_0x39e4dd={},_0x6c3787={};_0x50bc16<_0x192183['length'];_0x50bc16+=0x1){_0x39e4dd=_0x192183[_0x50bc16];if(_[_0x46d4('0x43')](_0xdc4b37[_0x46d4('0x1f')][_0x39e4dd['id']])){_0xdc4b37['servicenowAccounts'][_0x39e4dd['id']]=new ServicenowAccount(_0x39e4dd);}else{_0xdc4b37['mergeFromDatabase'](_0xdc4b37[_0x46d4('0x1f')][_0x39e4dd['id']],_0x39e4dd);}}}return _0xdc4b37['servicenowAccounts'];};};Realtime[_0x46d4('0x3f')][_0x46d4('0x51')]=function(){var _0x4e3cb4=this;return function(_0x3f50a4){if(_0x3f50a4){freeIsNotKey(_0x3f50a4,_0x4e3cb4['dynamics365Accounts'],'id');for(var _0x6a705e=0x0,_0x39a2e4={},_0x541e47={};_0x6a705e<_0x3f50a4[_0x46d4('0x45')];_0x6a705e+=0x1){_0x39a2e4=_0x3f50a4[_0x6a705e];if(_[_0x46d4('0x43')](_0x4e3cb4[_0x46d4('0x20')][_0x39a2e4['id']])){_0x4e3cb4['dynamics365Accounts'][_0x39a2e4['id']]=new Dynamics365Account(_0x39a2e4);}else{_0x4e3cb4[_0x46d4('0x40')](_0x4e3cb4[_0x46d4('0x20')][_0x39a2e4['id']],_0x39a2e4);}}}return _0x4e3cb4['dynamics365Accounts'];};};Realtime[_0x46d4('0x3f')][_0x46d4('0x52')]=function(){var _0x39aee3=this;return function(_0xd4332){if(_0xd4332){freeIsNotKey(_0xd4332,_0x39aee3[_0x46d4('0x21')],'id');for(var _0x5b16f6=0x0,_0x45d564={},_0x3ddcdf={};_0x5b16f6<_0xd4332[_0x46d4('0x45')];_0x5b16f6+=0x1){_0x45d564=_0xd4332[_0x5b16f6];if(_['isUndefined'](_0x39aee3[_0x46d4('0x21')][_0x45d564['id']])){_0x39aee3[_0x46d4('0x21')][_0x45d564['id']]=new FreshsalesAccount(_0x45d564);}else{_0x39aee3[_0x46d4('0x40')](_0x39aee3['freshsalesAccounts'][_0x45d564['id']],_0x45d564);}}}return _0x39aee3['freshsalesAccounts'];};};Realtime[_0x46d4('0x3f')]['initVoiceQueueHopperHistory']=function(){var _0x488d93=this;return function(_0xe06121){for(var _0xe55eca=0x0;_0xe55eca<_0xe06121[_0x46d4('0x45')];_0xe55eca+=0x1){_[_0x46d4('0x53')](_0x488d93[_0x46d4('0x13')][_0xe06121[_0xe55eca]['name']],_0xe06121[_0xe55eca]);}return _0x488d93[_0x46d4('0x13')];};};Realtime[_0x46d4('0x3f')]['initVoiceQueueReports']=function(){var _0x17ccf7=this;return function(_0x2ce403){clearVoiceQueues(_0x17ccf7[_0x46d4('0x13')]);if(_0x2ce403){_0x2ce403=_[_0x46d4('0x54')](_0x2ce403,'uniqueid');for(var _0x455474 in _0x2ce403){if(_0x2ce403['hasOwnProperty'](_0x455474)){var _0x228642={};for(var _0x2cdb94=0x0;_0x2cdb94<_0x2ce403[_0x455474][_0x46d4('0x45')];_0x2cdb94+=0x1){var _0x360980=_0x2ce403[_0x455474][_0x2cdb94][_0x46d4('0x55')];if(_0x17ccf7[_0x46d4('0x13')][_0x360980]){if(_0x2ce403[_0x455474][_0x2cdb94][_0x46d4('0x56')]){_0x17ccf7['voiceQueues'][_0x360980][_0x46d4('0x57')]+=0x1;}if(_0x2ce403[_0x455474][_0x2cdb94][_0x46d4('0x58')]){_0x17ccf7[_0x46d4('0x13')][_0x360980]['abandoned']+=0x1;}_0x17ccf7['voiceQueues'][_0x360980][_0x46d4('0x31')]+=moment(_0x2ce403[_0x455474][_0x2cdb94][_0x46d4('0x59')])['diff'](moment(_0x2ce403[_0x455474][_0x2cdb94][_0x46d4('0x5a')]),'seconds')||0x0;if(_0x2cdb94===_0x2ce403[_0x455474][_0x46d4('0x45')]-0x1){_0x17ccf7[_0x46d4('0x13')][_0x360980][_0x46d4('0x2a')]+=moment(_0x2ce403[_0x455474][_0x2cdb94][_0x46d4('0x5b')]||_0x2ce403[_0x455474][_0x2cdb94][_0x46d4('0x5c')]||_0x2ce403[_0x455474][_0x2cdb94][_0x46d4('0x5d')])[_0x46d4('0x5e')](moment(_0x2ce403[_0x455474][_0x2cdb94]['queuecallerjoinAt']),_0x46d4('0x5f'))||0x0;_0x17ccf7[_0x46d4('0x13')][_0x360980][_0x46d4('0x29')]+=0x1;if(_0x2ce403[_0x455474][_0x2cdb94][_0x46d4('0x60')]){_0x17ccf7['voiceQueues'][_0x360980][_0x46d4('0x2f')]+=0x1;_0x17ccf7[_0x46d4('0x13')][_0x360980][_0x46d4('0x2b')]+=moment(_0x2ce403[_0x455474][_0x2cdb94][_0x46d4('0x5b')])[_0x46d4('0x5e')](moment(_0x2ce403[_0x455474][_0x2cdb94][_0x46d4('0x59')]),_0x46d4('0x5f'))||0x0;}}else{_0x17ccf7[_0x46d4('0x13')][_0x360980]['sumDuration']+=_0x17ccf7[_0x46d4('0x13')][_0x360980]['sumHoldTime']||0x0;}}}}}}return _0x17ccf7[_0x46d4('0x13')];};};Realtime['prototype'][_0x46d4('0x61')]=function(){var _0x3c90aa=this;return function(_0xf9a28c){clearVoiceCallReports(_0x3c90aa[_0x46d4('0x15')]);if(_0xf9a28c){for(var _0xdf787c=0x0;_0xdf787c<_0xf9a28c[_0x46d4('0x45')];_0xdf787c+=0x1){_0x3c90aa['outbound']['total']+=0x1;_0x3c90aa[_0x46d4('0x15')][_0x46d4('0x2a')]+=_0xf9a28c[_0xdf787c][_0x46d4('0x62')];if(_0xf9a28c[_0xdf787c][_0x46d4('0x63')]===_0x46d4('0x64')){_0x3c90aa[_0x46d4('0x15')]['answered']+=0x1;_0x3c90aa[_0x46d4('0x15')][_0x46d4('0x31')]+=_0xf9a28c[_0xdf787c][_0x46d4('0x62')]-_0xf9a28c[_0xdf787c][_0x46d4('0x65')]||0x0;_0x3c90aa['outbound']['sumBillable']+=_0xf9a28c[_0xdf787c]['billableseconds'];}}}return _0x3c90aa[_0x46d4('0x15')];};};Realtime['prototype']['initCampaigns']=function(){var _0x540533=this;return function(_0x576455){if(_0x576455){freeIsNotKey(_0x576455,_0x540533[_0x46d4('0x66')],_0x46d4('0x25'));for(var _0x5609a7=0x0,_0x2b9a97={};_0x5609a7<_0x576455[_0x46d4('0x45')];_0x5609a7+=0x1){_0x2b9a97=_0x576455[_0x5609a7];if(_[_0x46d4('0x43')](_0x540533[_0x46d4('0x66')][_0x2b9a97[_0x46d4('0x25')]])){_0x540533['campaigns'][_0x2b9a97[_0x46d4('0x25')]]=new Campaign(_0x2b9a97);}else{_0x540533[_0x46d4('0x40')](_0x540533[_0x46d4('0x66')][_0x2b9a97[_0x46d4('0x25')]],_0x2b9a97);_0x540533[_0x46d4('0x66')][_0x2b9a97[_0x46d4('0x25')]][_0x46d4('0x67')]=_0x2b9a97['SquareProject']?_0x2b9a97['SquareProject'][_0x46d4('0x25')]:undefined;}}}return _0x540533[_0x46d4('0x66')];};};Realtime[_0x46d4('0x3f')][_0x46d4('0x68')]=function(){var _0x4c9649=this;return function(_0x6402c0){if(_0x6402c0){freeIsNotKey(_0x6402c0,_0x4c9649[_0x46d4('0x69')],'id');for(var _0x54e2a8=0x0,_0x21ba8b={};_0x54e2a8<_0x6402c0[_0x46d4('0x45')];_0x54e2a8+=0x1){_0x21ba8b=_0x6402c0[_0x54e2a8];if(_['isUndefined'](_0x4c9649[_0x46d4('0x69')][_0x21ba8b['id']])){_0x4c9649[_0x46d4('0x69')][_0x21ba8b['id']]=new VoiceExtension(_0x21ba8b);}else{_0x4c9649['mergeFromDatabase'](_0x4c9649[_0x46d4('0x69')][_0x21ba8b['id']],_0x21ba8b);}}}return _0x4c9649[_0x46d4('0x69')];};};Realtime[_0x46d4('0x3f')][_0x46d4('0x6a')]=function(){var _0x3d1cd9=this;return function(_0x3c05b8){clearCampaigns(_0x3d1cd9['campaigns']);for(var _0x173258=0x0;_0x173258<_0x3c05b8[_0x46d4('0x45')];_0x173258+=0x1){_[_0x46d4('0x53')](_0x3d1cd9[_0x46d4('0x66')][_0x3c05b8[_0x173258]['name']],_0x3c05b8[_0x173258]);}return _0x3d1cd9[_0x46d4('0x66')];};};Realtime[_0x46d4('0x3f')][_0x46d4('0x6b')]=function(){var _0x736060=this;return function(_0x7d4b0b){if(_0x7d4b0b){freeIsNotKey(_0x7d4b0b,_0x736060[_0x46d4('0x22')],'id');for(var _0x51b453=0x0,_0x3478cc={},_0x5e8678={};_0x51b453<_0x7d4b0b[_0x46d4('0x45')];_0x51b453+=0x1){_0x3478cc=_0x7d4b0b[_0x51b453];if(_[_0x46d4('0x43')](_0x736060['faxAccounts'][_0x3478cc['id']])){_0x736060[_0x46d4('0x22')][_0x3478cc['id']]=new FaxAccount(_0x3478cc);}else{_0x736060[_0x46d4('0x40')](_0x736060[_0x46d4('0x22')][_0x3478cc['id']],_0x3478cc);}}}return _0x736060[_0x46d4('0x22')];};};module[_0x46d4('0x6c')]=Realtime;
\ No newline at end of file
+var _0x0ce0=['deskAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','name','isNil','interface','total','answered','sumDuration','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','sumHoldTime','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','SIP/%s','isUndefined','initTelephones','length','initTrunks','trunks','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','dynamics365Accounts','merge','initVoiceQueueReports','groupBy','queue','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','queuecallerjoinAt','queuecallercompleteAt','queuecallerexitAt','diff','seconds','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','moment','../model/agent','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','voiceQueues','triggers','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts'];(function(_0xa1760c,_0x5ef2ae){var _0xc4f315=function(_0x33c08a){while(--_0x33c08a){_0xa1760c['push'](_0xa1760c['shift']());}};_0xc4f315(++_0x5ef2ae);}(_0x0ce0,0xbf));var _0x00ce=function(_0xdbb6cb,_0x3b8fda){_0xdbb6cb=_0xdbb6cb-0x0;var _0x476b50=_0x0ce0[_0xdbb6cb];return _0x476b50;};'use strict';var BPromise=require(_0x00ce('0x0'));var util=require(_0x00ce('0x1'));var _=require('lodash');var moment=require(_0x00ce('0x2'));var Agent=require(_0x00ce('0x3'));var Telephone=require('../model/telephone');var Trunk=require('../model/trunk');var VoiceQueue=require(_0x00ce('0x4'));var Trigger=require(_0x00ce('0x5'));var Template=require(_0x00ce('0x6'));var Campaign=require(_0x00ce('0x7'));var VoiceExtension=require(_0x00ce('0x8'));var ZendeskAccount=require(_0x00ce('0x9'));var SalesforceAccount=require(_0x00ce('0xa'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x00ce('0xb'));var ZohoAccount=require(_0x00ce('0xc'));var DeskAccount=require(_0x00ce('0xd'));var VtigerAccount=require(_0x00ce('0xe'));var ServicenowAccount=require(_0x00ce('0xf'));var Dynamics365Account=require(_0x00ce('0x10'));var FreshsalesAccount=require(_0x00ce('0x11'));var FaxAccount=require(_0x00ce('0x12'));var Realtime=function(){this[_0x00ce('0x13')]={};this[_0x00ce('0x14')]={};this['trunks']={};this[_0x00ce('0x15')]={};this[_0x00ce('0x16')]={};this['campaigns']={};this[_0x00ce('0x17')]={};this[_0x00ce('0x18')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x00ce('0x19')]={};this[_0x00ce('0x1a')]={};this[_0x00ce('0x1b')]={};this[_0x00ce('0x1c')]={};this['timers']={};this[_0x00ce('0x1d')]={};this[_0x00ce('0x1e')]={};this[_0x00ce('0x1f')]={};this[_0x00ce('0x20')]={};this[_0x00ce('0x21')]={};this[_0x00ce('0x22')]={};this[_0x00ce('0x23')]={};this[_0x00ce('0x24')]={};this[_0x00ce('0x25')]={};this['dynamics365Accounts']={};this[_0x00ce('0x26')]={};this[_0x00ce('0x27')]={};};function freeIsNotKey(_0x48a22b,_0x4dd265,_0x596942){var _0x4e5bab=_[_0x00ce('0x28')](_0x48a22b,function(_0x38514c,_0x55fb04){return _0x38514c[_0x596942];});for(var _0x3dcd36 in _0x4dd265){if(_0x4dd265[_0x00ce('0x29')](_0x3dcd36)){if(!_0x4e5bab[_0x3dcd36]){delete _0x4dd265[_0x3dcd36];}}}}function freeIsNotKeySip(_0x42b36d,_0x5a1b1a){var _0xc90d56=_[_0x00ce('0x28')](_0x42b36d,function(_0x52c9d2,_0x27dfad){return util[_0x00ce('0x2a')]('SIP/%s',_0x52c9d2[_0x00ce('0x2b')]);});for(var _0x57eda9 in _0x5a1b1a){if(_0x5a1b1a[_0x00ce('0x29')](_0x57eda9)){if(!_0xc90d56[_0x57eda9]){delete _0x5a1b1a[_0x57eda9];}}}}function freeIsNotKeyAgent(_0x3be4b0,_0x181e9d){var _0x1993f8=_[_0x00ce('0x28')](_0x3be4b0,function(_0x5f3887,_0x7e0de3){var _0x323838=_[_0x00ce('0x2c')](_0x5f3887[_0x00ce('0x2d')])?util[_0x00ce('0x2a')]('SIP/%s',_0x5f3887['name']):_0x5f3887[_0x00ce('0x2d')];return _0x323838;});for(var _0x29a584 in _0x181e9d){if(_0x181e9d[_0x00ce('0x29')](_0x29a584)){if(!_0x1993f8[_0x29a584]){delete _0x181e9d[_0x29a584];}}}}function clearVoiceCallReports(_0x4a1827){_0x4a1827[_0x00ce('0x2e')]=0x0;_0x4a1827[_0x00ce('0x2f')]=0x0;_0x4a1827['sumHoldTime']=0x0;_0x4a1827[_0x00ce('0x30')]=0x0;_0x4a1827[_0x00ce('0x31')]=0x0;}function clearCampaigns(_0x2fae04){if(!_[_0x00ce('0x32')](_0x2fae04)){for(var _0x5c84a2 in _0x2fae04){if(_0x2fae04[_0x00ce('0x29')](_0x5c84a2)){_0x2fae04[_0x5c84a2]['ivrTotalCallsDays']=0x0;_0x2fae04[_0x5c84a2][_0x00ce('0x33')]=0x0;}}}}function clearVoiceQueues(_0x516859){if(!_['isEmpty'](_0x516859)){for(var _0x38bedd in _0x516859){if(_0x516859[_0x00ce('0x29')](_0x38bedd)){_0x516859[_0x38bedd][_0x00ce('0x2e')]=0x0;_0x516859[_0x38bedd][_0x00ce('0x2f')]=0x0;_0x516859[_0x38bedd][_0x00ce('0x34')]=0x0;_0x516859[_0x38bedd]['abandoned']=0x0;_0x516859[_0x38bedd][_0x00ce('0x35')]=0x0;_0x516859[_0x38bedd]['sumDuration']=0x0;_0x516859[_0x38bedd][_0x00ce('0x31')]=0x0;_0x516859[_0x38bedd][_0x00ce('0x36')]=0x0;_0x516859[_0x38bedd][_0x00ce('0x37')]=0x0;_0x516859[_0x38bedd][_0x00ce('0x38')]=0x0;_0x516859[_0x38bedd][_0x00ce('0x39')]=0x0;_0x516859[_0x38bedd][_0x00ce('0x3a')]=0x0;_0x516859[_0x38bedd][_0x00ce('0x3b')]=0x0;_0x516859[_0x38bedd][_0x00ce('0x3c')]=0x0;_0x516859[_0x38bedd][_0x00ce('0x3d')]=0x0;_0x516859[_0x38bedd]['outboundBlacklistCallsDay']=0x0;_0x516859[_0x38bedd][_0x00ce('0x3e')]=0x0;_0x516859[_0x38bedd][_0x00ce('0x3f')]=0x0;_0x516859[_0x38bedd]['outboundReCallsDay']=0x0;_0x516859[_0x38bedd][_0x00ce('0x36')]=0x0;_0x516859[_0x38bedd][_0x00ce('0x40')]=0x0;_0x516859[_0x38bedd][_0x00ce('0x41')]=!![];}}}}Realtime[_0x00ce('0x42')][_0x00ce('0x43')]=function(_0x181e56,_0x2e3189){for(var _0x4ac009 in _0x2e3189){if(_0x181e56[_0x00ce('0x29')](_0x4ac009)){_0x181e56[_0x4ac009]=_0x2e3189[_0x4ac009];}}};Realtime[_0x00ce('0x42')]['initAgents']=function(){var _0x136f28=this;return function(_0x3cefd8){if(_0x3cefd8){freeIsNotKeyAgent(_0x3cefd8,_0x136f28[_0x00ce('0x13')]);for(var _0x315265=0x0,_0x5ae5b1={},_0x356138={};_0x315265<_0x3cefd8['length'];_0x315265+=0x1){_0x5ae5b1=_0x3cefd8[_0x315265];var _0x2c9fcb=_[_0x00ce('0x2c')](_0x5ae5b1['interface'])?util['format'](_0x00ce('0x44'),_0x5ae5b1[_0x00ce('0x2b')]):_0x5ae5b1[_0x00ce('0x2d')];if(_[_0x00ce('0x45')](_0x136f28['agents'][_0x2c9fcb])){_0x136f28['agents'][_0x2c9fcb]=new Agent(_0x5ae5b1);}else{_0x136f28[_0x00ce('0x43')](_0x136f28[_0x00ce('0x13')][_0x2c9fcb],_0x5ae5b1);}}}return _0x136f28[_0x00ce('0x13')];};};Realtime[_0x00ce('0x42')][_0x00ce('0x46')]=function(){var _0x3d7910=this;return function(_0x1d71d3){if(_0x1d71d3){freeIsNotKeySip(_0x1d71d3,_0x3d7910[_0x00ce('0x14')]);for(var _0x4ccdd9=0x0,_0xeafc9={},_0x1b3185={};_0x4ccdd9<_0x1d71d3[_0x00ce('0x47')];_0x4ccdd9+=0x1){_0xeafc9=_0x1d71d3[_0x4ccdd9];if(_[_0x00ce('0x45')](_0x3d7910['telephones'][util[_0x00ce('0x2a')](_0x00ce('0x44'),_0xeafc9['name'])])){_0x3d7910['telephones'][util['format'](_0x00ce('0x44'),_0xeafc9['name'])]=new Telephone(_0xeafc9);}else{_0x3d7910[_0x00ce('0x43')](_0x3d7910['telephones'][util[_0x00ce('0x2a')](_0x00ce('0x44'),_0xeafc9[_0x00ce('0x2b')])],_0xeafc9);}}}return _0x3d7910[_0x00ce('0x14')];};};Realtime[_0x00ce('0x42')][_0x00ce('0x48')]=function(){var _0x3539ca=this;return function(_0x398e0f){if(_0x398e0f){freeIsNotKeySip(_0x398e0f,_0x3539ca['trunks']);for(var _0x2ee7c7=0x0,_0x20efef={},_0xf21557={};_0x2ee7c7<_0x398e0f[_0x00ce('0x47')];_0x2ee7c7+=0x1){_0x20efef=_0x398e0f[_0x2ee7c7];if(_[_0x00ce('0x45')](_0x3539ca[_0x00ce('0x49')][util[_0x00ce('0x2a')](_0x00ce('0x44'),_0x20efef[_0x00ce('0x2b')])])){_0x3539ca[_0x00ce('0x49')][util['format'](_0x00ce('0x44'),_0x20efef[_0x00ce('0x2b')])]=new Trunk(_0x20efef);}else{_0x3539ca[_0x00ce('0x43')](_0x3539ca[_0x00ce('0x49')][util[_0x00ce('0x2a')](_0x00ce('0x44'),_0x20efef[_0x00ce('0x2b')])],_0x20efef);}}}return _0x3539ca['trunks'];};};Realtime[_0x00ce('0x42')][_0x00ce('0x4a')]=function(){var _0x400b4c=this;return function(_0x19733a){if(_0x19733a){freeIsNotKey(_0x19733a,_0x400b4c[_0x00ce('0x15')],_0x00ce('0x2b'));for(var _0x1d5de2=0x0,_0x42f650={},_0x2447af={};_0x1d5de2<_0x19733a[_0x00ce('0x47')];_0x1d5de2+=0x1){_0x42f650=_0x19733a[_0x1d5de2];if(_['isUndefined'](_0x400b4c[_0x00ce('0x15')][_0x42f650[_0x00ce('0x2b')]])){_0x400b4c[_0x00ce('0x15')][_0x42f650['name']]=new VoiceQueue(_0x42f650);}else{_0x400b4c[_0x00ce('0x43')](_0x400b4c[_0x00ce('0x15')][_0x42f650[_0x00ce('0x2b')]],_0x42f650);}}}return _0x400b4c[_0x00ce('0x15')];};};Realtime[_0x00ce('0x42')][_0x00ce('0x4b')]=function(){var _0xca74b8=this;return function(_0x10fe97){if(_0x10fe97){freeIsNotKey(_0x10fe97,_0xca74b8['triggers'],'id');for(var _0x298db4=0x0,_0x5f38af={},_0x412a49={};_0x298db4<_0x10fe97[_0x00ce('0x47')];_0x298db4+=0x1){_0x5f38af=_0x10fe97[_0x298db4];if(_['isUndefined'](_0xca74b8[_0x00ce('0x16')][_0x5f38af['id']])){_0xca74b8[_0x00ce('0x16')][_0x5f38af['id']]=new Trigger(_0x5f38af);}else{_0xca74b8[_0x00ce('0x43')](_0xca74b8[_0x00ce('0x16')][_0x5f38af['id']],_0x5f38af);}}}return _0xca74b8[_0x00ce('0x16')];};};Realtime[_0x00ce('0x42')][_0x00ce('0x4c')]=function(){var _0x114175=this;return function(_0x44ba3c){if(_0x44ba3c){freeIsNotKey(_0x44ba3c,_0x114175['templates'],'id');for(var _0x5841e9=0x0,_0x55a862={},_0x2d8130={};_0x5841e9<_0x44ba3c[_0x00ce('0x47')];_0x5841e9+=0x1){_0x55a862=_0x44ba3c[_0x5841e9];if(_['isUndefined'](_0x114175[_0x00ce('0x17')][_0x55a862['id']])){_0x114175['templates'][_0x55a862['id']]=new Template(_0x55a862);}else{_0x114175[_0x00ce('0x43')](_0x114175[_0x00ce('0x17')][_0x55a862['id']],_0x55a862);}}}return _0x114175[_0x00ce('0x17')];};};Realtime[_0x00ce('0x42')][_0x00ce('0x4d')]=function(){var _0x283d7b=this;return function(_0x2caa0a){if(_0x2caa0a){freeIsNotKey(_0x2caa0a,_0x283d7b[_0x00ce('0x1e')],'id');for(var _0x929a75=0x0,_0x1452e4={},_0x214e7d={};_0x929a75<_0x2caa0a[_0x00ce('0x47')];_0x929a75+=0x1){_0x1452e4=_0x2caa0a[_0x929a75];if(_[_0x00ce('0x45')](_0x283d7b[_0x00ce('0x1e')][_0x1452e4['id']])){_0x283d7b[_0x00ce('0x1e')][_0x1452e4['id']]=new ZendeskAccount(_0x1452e4);}else{_0x283d7b[_0x00ce('0x43')](_0x283d7b[_0x00ce('0x1e')][_0x1452e4['id']],_0x1452e4);}}}return _0x283d7b[_0x00ce('0x1e')];};};Realtime[_0x00ce('0x42')][_0x00ce('0x4e')]=function(){var _0x1b31a5=this;return function(_0x2d38c1){if(_0x2d38c1){freeIsNotKey(_0x2d38c1,_0x1b31a5[_0x00ce('0x1f')],'id');for(var _0x1e219a=0x0,_0x2a4b13={},_0xd3de7a={};_0x1e219a<_0x2d38c1['length'];_0x1e219a+=0x1){_0x2a4b13=_0x2d38c1[_0x1e219a];if(_['isUndefined'](_0x1b31a5['salesforceAccounts'][_0x2a4b13['id']])){_0x1b31a5[_0x00ce('0x1f')][_0x2a4b13['id']]=new SalesforceAccount(_0x2a4b13);}else{_0x1b31a5['mergeFromDatabase'](_0x1b31a5[_0x00ce('0x1f')][_0x2a4b13['id']],_0x2a4b13);}}}return _0x1b31a5['salesforceAccounts'];};};Realtime['prototype'][_0x00ce('0x4f')]=function(){var _0x1c86ef=this;return function(_0x359715){if(_0x359715){freeIsNotKey(_0x359715,_0x1c86ef['freshdeskAccounts'],'id');for(var _0x7218e2=0x0,_0x506e19={},_0xfd0e8d={};_0x7218e2<_0x359715[_0x00ce('0x47')];_0x7218e2+=0x1){_0x506e19=_0x359715[_0x7218e2];if(_[_0x00ce('0x45')](_0x1c86ef[_0x00ce('0x21')][_0x506e19['id']])){_0x1c86ef[_0x00ce('0x21')][_0x506e19['id']]=new FreshdeskAccount(_0x506e19);}else{_0x1c86ef['mergeFromDatabase'](_0x1c86ef[_0x00ce('0x21')][_0x506e19['id']],_0x506e19);}}}return _0x1c86ef[_0x00ce('0x21')];};};Realtime[_0x00ce('0x42')][_0x00ce('0x50')]=function(){var _0xc871bf=this;return function(_0x472586){if(_0x472586){freeIsNotKey(_0x472586,_0xc871bf[_0x00ce('0x22')],'id');for(var _0x3c3dce=0x0,_0x12bad5={},_0xe6d122={};_0x3c3dce<_0x472586[_0x00ce('0x47')];_0x3c3dce+=0x1){_0x12bad5=_0x472586[_0x3c3dce];if(_[_0x00ce('0x45')](_0xc871bf[_0x00ce('0x22')][_0x12bad5['id']])){_0xc871bf['zohoAccounts'][_0x12bad5['id']]=new ZohoAccount(_0x12bad5);}else{_0xc871bf[_0x00ce('0x43')](_0xc871bf['zohoAccounts'][_0x12bad5['id']],_0x12bad5);}}}return _0xc871bf[_0x00ce('0x22')];};};Realtime[_0x00ce('0x42')][_0x00ce('0x51')]=function(){var _0x75a706=this;return function(_0x2110b9){if(_0x2110b9){freeIsNotKey(_0x2110b9,_0x75a706[_0x00ce('0x23')],'id');for(var _0x4f9ced=0x0,_0x21981a={},_0x463241={};_0x4f9ced<_0x2110b9[_0x00ce('0x47')];_0x4f9ced+=0x1){_0x21981a=_0x2110b9[_0x4f9ced];if(_[_0x00ce('0x45')](_0x75a706[_0x00ce('0x23')][_0x21981a['id']])){_0x75a706[_0x00ce('0x23')][_0x21981a['id']]=new DeskAccount(_0x21981a);}else{_0x75a706[_0x00ce('0x43')](_0x75a706['deskAccounts'][_0x21981a['id']],_0x21981a);}}}return _0x75a706[_0x00ce('0x23')];};};Realtime[_0x00ce('0x42')][_0x00ce('0x52')]=function(){var _0x57ac2d=this;return function(_0x1e43a6){if(_0x1e43a6){freeIsNotKey(_0x1e43a6,_0x57ac2d[_0x00ce('0x20')],'id');for(var _0x415fa8=0x0,_0x4a78fd={},_0x454a2d={};_0x415fa8<_0x1e43a6[_0x00ce('0x47')];_0x415fa8+=0x1){_0x4a78fd=_0x1e43a6[_0x415fa8];if(_[_0x00ce('0x45')](_0x57ac2d[_0x00ce('0x20')][_0x4a78fd['id']])){_0x57ac2d[_0x00ce('0x20')][_0x4a78fd['id']]=new SugarcrmAccount(_0x4a78fd);}else{_0x57ac2d[_0x00ce('0x43')](_0x57ac2d['sugarcrmAccounts'][_0x4a78fd['id']],_0x4a78fd);}}}return _0x57ac2d[_0x00ce('0x20')];};};Realtime[_0x00ce('0x42')][_0x00ce('0x53')]=function(){var _0x1902e1=this;return function(_0x489131){if(_0x489131){freeIsNotKey(_0x489131,_0x1902e1['vtigerAccounts'],'id');for(var _0x448267=0x0,_0x194ccf={},_0x43bab6={};_0x448267<_0x489131['length'];_0x448267+=0x1){_0x194ccf=_0x489131[_0x448267];if(_[_0x00ce('0x45')](_0x1902e1['vtigerAccounts'][_0x194ccf['id']])){_0x1902e1['vtigerAccounts'][_0x194ccf['id']]=new VtigerAccount(_0x194ccf);}else{_0x1902e1['mergeFromDatabase'](_0x1902e1[_0x00ce('0x24')][_0x194ccf['id']],_0x194ccf);}}}return _0x1902e1[_0x00ce('0x24')];};};Realtime[_0x00ce('0x42')][_0x00ce('0x54')]=function(){var _0x482c1f=this;return function(_0x1ec83c){if(_0x1ec83c){freeIsNotKey(_0x1ec83c,_0x482c1f[_0x00ce('0x25')],'id');for(var _0xfb0264=0x0,_0x329912={},_0xb4ed9d={};_0xfb0264<_0x1ec83c[_0x00ce('0x47')];_0xfb0264+=0x1){_0x329912=_0x1ec83c[_0xfb0264];if(_[_0x00ce('0x45')](_0x482c1f[_0x00ce('0x25')][_0x329912['id']])){_0x482c1f['servicenowAccounts'][_0x329912['id']]=new ServicenowAccount(_0x329912);}else{_0x482c1f[_0x00ce('0x43')](_0x482c1f[_0x00ce('0x25')][_0x329912['id']],_0x329912);}}}return _0x482c1f[_0x00ce('0x25')];};};Realtime['prototype'][_0x00ce('0x55')]=function(){var _0x2fd360=this;return function(_0x19dc04){if(_0x19dc04){freeIsNotKey(_0x19dc04,_0x2fd360[_0x00ce('0x56')],'id');for(var _0x10e41e=0x0,_0x55f6d4={},_0x9dcda9={};_0x10e41e<_0x19dc04[_0x00ce('0x47')];_0x10e41e+=0x1){_0x55f6d4=_0x19dc04[_0x10e41e];if(_[_0x00ce('0x45')](_0x2fd360[_0x00ce('0x56')][_0x55f6d4['id']])){_0x2fd360[_0x00ce('0x56')][_0x55f6d4['id']]=new Dynamics365Account(_0x55f6d4);}else{_0x2fd360[_0x00ce('0x43')](_0x2fd360[_0x00ce('0x56')][_0x55f6d4['id']],_0x55f6d4);}}}return _0x2fd360[_0x00ce('0x56')];};};Realtime[_0x00ce('0x42')]['initFreshsalesAccounts']=function(){var _0x7e752f=this;return function(_0x4726da){if(_0x4726da){freeIsNotKey(_0x4726da,_0x7e752f[_0x00ce('0x26')],'id');for(var _0x2b5601=0x0,_0x158c0f={},_0x1cb9ab={};_0x2b5601<_0x4726da['length'];_0x2b5601+=0x1){_0x158c0f=_0x4726da[_0x2b5601];if(_[_0x00ce('0x45')](_0x7e752f['freshsalesAccounts'][_0x158c0f['id']])){_0x7e752f[_0x00ce('0x26')][_0x158c0f['id']]=new FreshsalesAccount(_0x158c0f);}else{_0x7e752f[_0x00ce('0x43')](_0x7e752f[_0x00ce('0x26')][_0x158c0f['id']],_0x158c0f);}}}return _0x7e752f[_0x00ce('0x26')];};};Realtime[_0x00ce('0x42')]['initVoiceQueueHopperHistory']=function(){var _0x264390=this;return function(_0x22838b){for(var _0x5773b7=0x0;_0x5773b7<_0x22838b[_0x00ce('0x47')];_0x5773b7+=0x1){_[_0x00ce('0x57')](_0x264390['voiceQueues'][_0x22838b[_0x5773b7][_0x00ce('0x2b')]],_0x22838b[_0x5773b7]);}return _0x264390[_0x00ce('0x15')];};};Realtime[_0x00ce('0x42')][_0x00ce('0x58')]=function(){var _0x2d71f4=this;return function(_0x4e2556){clearVoiceQueues(_0x2d71f4[_0x00ce('0x15')]);if(_0x4e2556){_0x4e2556=_[_0x00ce('0x59')](_0x4e2556,'uniqueid');for(var _0x46a66f in _0x4e2556){if(_0x4e2556['hasOwnProperty'](_0x46a66f)){var _0x54b839={};for(var _0x1a55f7=0x0;_0x1a55f7<_0x4e2556[_0x46a66f][_0x00ce('0x47')];_0x1a55f7+=0x1){var _0x19868a=_0x4e2556[_0x46a66f][_0x1a55f7][_0x00ce('0x5a')];if(_0x2d71f4[_0x00ce('0x15')][_0x19868a]){if(_0x4e2556[_0x46a66f][_0x1a55f7][_0x00ce('0x5b')]){_0x2d71f4[_0x00ce('0x15')][_0x19868a]['unmanaged']+=0x1;}if(_0x4e2556[_0x46a66f][_0x1a55f7][_0x00ce('0x5c')]){_0x2d71f4['voiceQueues'][_0x19868a][_0x00ce('0x5d')]+=0x1;}_0x2d71f4[_0x00ce('0x15')][_0x19868a][_0x00ce('0x35')]+=moment(_0x4e2556[_0x46a66f][_0x1a55f7][_0x00ce('0x5e')])['diff'](moment(_0x4e2556[_0x46a66f][_0x1a55f7][_0x00ce('0x5f')]),'seconds')||0x0;if(_0x1a55f7===_0x4e2556[_0x46a66f][_0x00ce('0x47')]-0x1){_0x2d71f4[_0x00ce('0x15')][_0x19868a][_0x00ce('0x30')]+=moment(_0x4e2556[_0x46a66f][_0x1a55f7][_0x00ce('0x60')]||_0x4e2556[_0x46a66f][_0x1a55f7]['queuecallerabandonAt']||_0x4e2556[_0x46a66f][_0x1a55f7][_0x00ce('0x61')])[_0x00ce('0x62')](moment(_0x4e2556[_0x46a66f][_0x1a55f7][_0x00ce('0x5f')]),_0x00ce('0x63'))||0x0;_0x2d71f4['voiceQueues'][_0x19868a]['total']+=0x1;if(_0x4e2556[_0x46a66f][_0x1a55f7]['queuecallercomplete']){_0x2d71f4[_0x00ce('0x15')][_0x19868a]['answered']+=0x1;_0x2d71f4[_0x00ce('0x15')][_0x19868a][_0x00ce('0x31')]+=moment(_0x4e2556[_0x46a66f][_0x1a55f7]['queuecallercompleteAt'])['diff'](moment(_0x4e2556[_0x46a66f][_0x1a55f7][_0x00ce('0x5e')]),_0x00ce('0x63'))||0x0;}}else{_0x2d71f4[_0x00ce('0x15')][_0x19868a][_0x00ce('0x30')]+=_0x2d71f4[_0x00ce('0x15')][_0x19868a][_0x00ce('0x35')]||0x0;}}}}}}return _0x2d71f4['voiceQueues'];};};Realtime[_0x00ce('0x42')][_0x00ce('0x64')]=function(){var _0x11b8df=this;return function(_0x4d78d5){clearVoiceCallReports(_0x11b8df[_0x00ce('0x18')]);if(_0x4d78d5){for(var _0x598979=0x0;_0x598979<_0x4d78d5[_0x00ce('0x47')];_0x598979+=0x1){_0x11b8df['outbound']['total']+=0x1;_0x11b8df[_0x00ce('0x18')][_0x00ce('0x30')]+=_0x4d78d5[_0x598979][_0x00ce('0x65')];if(_0x4d78d5[_0x598979][_0x00ce('0x66')]===_0x00ce('0x67')){_0x11b8df['outbound'][_0x00ce('0x2f')]+=0x1;_0x11b8df[_0x00ce('0x18')][_0x00ce('0x35')]+=_0x4d78d5[_0x598979][_0x00ce('0x65')]-_0x4d78d5[_0x598979][_0x00ce('0x68')]||0x0;_0x11b8df[_0x00ce('0x18')]['sumBillable']+=_0x4d78d5[_0x598979][_0x00ce('0x68')];}}}return _0x11b8df[_0x00ce('0x18')];};};Realtime[_0x00ce('0x42')][_0x00ce('0x69')]=function(){var _0x58afcc=this;return function(_0x351b95){if(_0x351b95){freeIsNotKey(_0x351b95,_0x58afcc[_0x00ce('0x6a')],_0x00ce('0x2b'));for(var _0x54f362=0x0,_0x40cbed={};_0x54f362<_0x351b95[_0x00ce('0x47')];_0x54f362+=0x1){_0x40cbed=_0x351b95[_0x54f362];if(_[_0x00ce('0x45')](_0x58afcc[_0x00ce('0x6a')][_0x40cbed[_0x00ce('0x2b')]])){_0x58afcc['campaigns'][_0x40cbed[_0x00ce('0x2b')]]=new Campaign(_0x40cbed);}else{_0x58afcc[_0x00ce('0x43')](_0x58afcc[_0x00ce('0x6a')][_0x40cbed[_0x00ce('0x2b')]],_0x40cbed);_0x58afcc[_0x00ce('0x6a')][_0x40cbed['name']][_0x00ce('0x6b')]=_0x40cbed['SquareProject']?_0x40cbed[_0x00ce('0x6c')]['name']:undefined;}}}return _0x58afcc[_0x00ce('0x6a')];};};Realtime[_0x00ce('0x42')][_0x00ce('0x6d')]=function(){var _0x2ca888=this;return function(_0x126954){if(_0x126954){freeIsNotKey(_0x126954,_0x2ca888[_0x00ce('0x19')],'id');for(var _0x146757=0x0,_0x443453={};_0x146757<_0x126954[_0x00ce('0x47')];_0x146757+=0x1){_0x443453=_0x126954[_0x146757];if(_[_0x00ce('0x45')](_0x2ca888[_0x00ce('0x19')][_0x443453['id']])){_0x2ca888[_0x00ce('0x19')][_0x443453['id']]=new VoiceExtension(_0x443453);}else{_0x2ca888[_0x00ce('0x43')](_0x2ca888[_0x00ce('0x19')][_0x443453['id']],_0x443453);}}}return _0x2ca888[_0x00ce('0x19')];};};Realtime['prototype'][_0x00ce('0x6e')]=function(){var _0xa73729=this;return function(_0x2dcdf4){clearCampaigns(_0xa73729[_0x00ce('0x6a')]);for(var _0xeca7ed=0x0;_0xeca7ed<_0x2dcdf4[_0x00ce('0x47')];_0xeca7ed+=0x1){_[_0x00ce('0x57')](_0xa73729[_0x00ce('0x6a')][_0x2dcdf4[_0xeca7ed][_0x00ce('0x2b')]],_0x2dcdf4[_0xeca7ed]);}return _0xa73729['campaigns'];};};Realtime['prototype'][_0x00ce('0x6f')]=function(){var _0x4137e8=this;return function(_0x95eff0){if(_0x95eff0){freeIsNotKey(_0x95eff0,_0x4137e8[_0x00ce('0x27')],'id');for(var _0x1378ae=0x0,_0x4f6cfb={},_0xa095e={};_0x1378ae<_0x95eff0[_0x00ce('0x47')];_0x1378ae+=0x1){_0x4f6cfb=_0x95eff0[_0x1378ae];if(_[_0x00ce('0x45')](_0x4137e8['faxAccounts'][_0x4f6cfb['id']])){_0x4137e8[_0x00ce('0x27')][_0x4f6cfb['id']]=new FaxAccount(_0x4f6cfb);}else{_0x4137e8[_0x00ce('0x43')](_0x4137e8[_0x00ce('0x27')][_0x4f6cfb['id']],_0x4f6cfb);}}}return _0x4137e8['faxAccounts'];};};module[_0x00ce('0x70')]=Realtime;
\ No newline at end of file
index dcfdafd..7d4595b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeae9=['context','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','channel','calleridnum','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','monitors','length','filename','createdAt','exten','connectedlinename','xcally-motion-dialer','forEach','startsWith','substring','indexOf','mobile','phone','lastIndexOf','membername','transfererlinkedid','exports','lodash','util','../../../config/environment','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','agents','telephones','realtime','xdr','disabled','custom:voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','prototype','findAgent','find','name','isNil','accountcode','interface','SIP/%s','voiceQueueReport','connectedlinenum','queuecallercompleteAt','format','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','voiceCallReport','destination','type','lastapplication','queue','lastdata','callerid'];(function(_0x2ae960,_0x2ba93c){var _0x5cced8=function(_0x19b7b5){while(--_0x19b7b5){_0x2ae960['push'](_0x2ae960['shift']());}};_0x5cced8(++_0x2ba93c);}(_0xeae9,0xc1));var _0x9eae=function(_0x266247,_0x406437){_0x266247=_0x266247-0x0;var _0x335374=_0xeae9[_0x266247];return _0x335374;};'use strict';var _=require(_0x9eae('0x0'));var moment=require('moment');var util=require(_0x9eae('0x1'));var config=require(_0x9eae('0x2'));var ami=require(_0x9eae('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x9eae('0x4'));var RpcVoiceDialReport=require(_0x9eae('0x5'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x9eae('0x6'));var RpcVoiceRecording=require(_0x9eae('0x7'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x9eae('0x8'));var VoiceCallReport=require(_0x9eae('0x9'));var VoiceAgentReport=require(_0x9eae('0xa'));var VoiceDialReport=require(_0x9eae('0xb'));var UserReport=require('./userReport');function Report(_0x113af8){this['realtime']=_0x113af8;this[_0x9eae('0xc')]=_0x113af8[_0x9eae('0xc')];this[_0x9eae('0xd')]=_0x113af8['telephones'];}Report['prototype']['sync']=function(_0x47f155){var _0x3b562e=new VoiceQueueReport(this[_0x9eae('0xe')]);var _0x24161e=new VoiceAgentReport(this[_0x9eae('0xe')]);var _0xeef11c=new VoiceDialReport(this[_0x9eae('0xe')]);var _0x5f263a=new VoiceCallReport(this['realtime']);var _0x34b009=new UserReport(this['realtime']);if(config[_0x9eae('0xf')]&&config[_0x9eae('0xf')][_0x9eae('0x10')]){ami['on'](_0x9eae('0x11'),this['voiceQueueReport'][_0x9eae('0x12')](this));ami['on'](_0x9eae('0x13'),this['voiceCallReport'][_0x9eae('0x12')](this));ami['on'](_0x9eae('0x14'),this[_0x9eae('0x15')]['bind'](this));ami['on'](_0x9eae('0x16'),this[_0x9eae('0x17')][_0x9eae('0x12')](this));ami['on'](_0x9eae('0x18'),this[_0x9eae('0x19')][_0x9eae('0x12')](this));ami['on'](_0x9eae('0x1a'),this[_0x9eae('0x1b')]['bind'](this));}};Report[_0x9eae('0x1c')][_0x9eae('0x1d')]=function(_0x45d9c0){var _0x352a8d;_0x352a8d=_[_0x9eae('0x1e')](this[_0x9eae('0xc')],function(_0x541cfb){return _0x541cfb['accountcode']==_0x45d9c0||_0x541cfb[_0x9eae('0x1f')]==_0x45d9c0;});if(_[_0x9eae('0x20')](_0x352a8d)){var _0x231e13=_['find'](this[_0x9eae('0xd')],function(_0x1cdc76){return _0x1cdc76[_0x9eae('0x21')]==_0x45d9c0||_0x1cdc76[_0x9eae('0x1f')]==_0x45d9c0;});if(_0x231e13){_0x352a8d=_[_0x9eae('0x1e')](this[_0x9eae('0xc')],function(_0x5bd522){return _0x5bd522[_0x9eae('0x22')]==util['format'](_0x9eae('0x23'),_0x231e13[_0x9eae('0x1f')]);});}}return _0x352a8d;};Report['prototype'][_0x9eae('0x24')]=function(_0x5cebb7){for(var _0x4aded8=0x0;_0x4aded8<_0x5cebb7['length'];_0x4aded8+=0x1){var _0x11833b=this[_0x9eae('0x1d')](_0x5cebb7[_0x4aded8][_0x9eae('0x25')]);if(_0x11833b){_0x5cebb7[_0x4aded8][_0x9eae('0x21')]=_0x11833b['accountcode'];_0x5cebb7[_0x4aded8]['assigned']=!![];_0x5cebb7[_0x4aded8]['lastAssignedTo']=_0x11833b[_0x9eae('0x1f')];_0x5cebb7[_0x4aded8][_0x9eae('0x22')]=_[_0x9eae('0x20')](_0x11833b['interface'])?util['format'](_0x9eae('0x23'),_0x11833b['name']):_0x11833b[_0x9eae('0x22')];if(_0x5cebb7[_0x4aded8]['queuecallercomplete']){_0x5cebb7[_0x4aded8][_0x9eae('0x26')]=moment()[_0x9eae('0x27')](_0x9eae('0x28'));}if(_0x5cebb7[_0x4aded8]['queuecallerexit']){_0x5cebb7[_0x4aded8][_0x9eae('0x29')]=moment()[_0x9eae('0x27')](_0x9eae('0x28'));}RpcMemberReport[_0x9eae('0x24')](_0x5cebb7[_0x4aded8]);}RpcVoiceQueueReport[_0x9eae('0x2a')](_0x5cebb7[_0x4aded8]);}};function extractCalleridNumber(_0x54b46e){var _0x33dbd1=_0x54b46e['match'](/<(.*?)>/);return _0x33dbd1?_0x33dbd1[0x1]:_0x54b46e;}Report[_0x9eae('0x1c')][_0x9eae('0x2b')]=function(_0xe79fb3){_0xe79fb3[_0x9eae('0x2c')]=_0xe79fb3[_0x9eae('0x2c')]||_0xe79fb3['exten'];if(_0xe79fb3[_0x9eae('0x2d')]=='dialer'){_0xe79fb3[_0x9eae('0x2e')]=_0x9eae('0x2f');_0xe79fb3[_0x9eae('0x30')]=_0xe79fb3[_0x9eae('0x2f')];if(_0xe79fb3['context']=='from-voip-provider'){_0xe79fb3[_0x9eae('0x21')]='';_0xe79fb3[_0x9eae('0x2c')]=extractCalleridNumber(_0xe79fb3[_0x9eae('0x31')]);}else if(_0xe79fb3[_0x9eae('0x32')]==_0x9eae('0x33')){if(_0xe79fb3['destination']==_0x9eae('0x34')){_0xe79fb3[_0x9eae('0x2c')]=extractCalleridNumber(_0xe79fb3[_0x9eae('0x35')]);_0xe79fb3['calleridnum']=_0xe79fb3[_0x9eae('0x36')];_0xe79fb3[_0x9eae('0x37')]=[_0xe79fb3[_0x9eae('0x38')],_0xe79fb3['channel']=_0xe79fb3['destinationchannel']][0x0];_0xe79fb3[_0x9eae('0x31')]=_0xe79fb3['calleridpreview'];}else{_0xe79fb3[_0x9eae('0x2c')]=_0xe79fb3['calleridnum'];_0xe79fb3[_0x9eae('0x39')]=_0xe79fb3[_0x9eae('0x36')];if(_0xe79fb3['disposition']=='ANSWERED'){_0xe79fb3[_0x9eae('0x21')]=_0xe79fb3[_0x9eae('0x25')];}else{_0xe79fb3[_0x9eae('0x21')]='';}}}}else{_0xe79fb3[_0x9eae('0x31')]=util[_0x9eae('0x27')](_0x9eae('0x3a'),_0xe79fb3[_0x9eae('0x3b')],_0xe79fb3[_0x9eae('0x39')]);}if(RpcVoiceTransferReport[_0x9eae('0x3c')][_0xe79fb3[_0x9eae('0x3d')]]){var _0x505b7e=RpcVoiceTransferReport[_0x9eae('0x3c')][_0xe79fb3[_0x9eae('0x3d')]];_0x505b7e[_0x9eae('0x3e')]=_0xe79fb3[_0x9eae('0x3f')];RpcVoiceTransferReport[_0x9eae('0x19')](_0x505b7e);delete RpcVoiceTransferReport[_0x9eae('0x3c')][_0xe79fb3[_0x9eae('0x3d')]];}RpcVoiceCallReport[_0x9eae('0x2a')](_0xe79fb3);if(_0xe79fb3['monitor']){for(var _0x28aac1=0x0;_0x28aac1<_0xe79fb3[_0x9eae('0x40')][_0x9eae('0x41')];_0x28aac1+=0x1){_0xe79fb3['monitorFilename']=_0xe79fb3['monitors'][_0x28aac1][_0x9eae('0x42')];_0xe79fb3[_0x9eae('0x43')]=_0xe79fb3[_0x9eae('0x40')][_0x28aac1][_0x9eae('0x43')];if(_0xe79fb3[_0x9eae('0x44')]==_0x9eae('0x34')){_0xe79fb3[_0x9eae('0x39')]=_0xe79fb3[_0x9eae('0x25')];_0xe79fb3[_0x9eae('0x3b')]=_0xe79fb3[_0x9eae('0x45')];_0xe79fb3[_0x9eae('0x25')]=_0xe79fb3[_0x9eae('0x21')];_0xe79fb3[_0x9eae('0x45')]=_0xe79fb3['membername'];_0xe79fb3[_0x9eae('0x44')]=_0xe79fb3[_0x9eae('0x36')];}else if(_0xe79fb3[_0x9eae('0x44')]==_0x9eae('0x46')){_0xe79fb3[_0x9eae('0x39')]=_0xe79fb3[_0x9eae('0x2c')];_0xe79fb3[_0x9eae('0x44')]=_0xe79fb3[_0x9eae('0x36')];}RpcVoiceRecording[_0x9eae('0x2a')](_0xe79fb3);}}};Report[_0x9eae('0x1c')][_0x9eae('0x15')]=function(_0x53c039){if(_['isArray'](_0x53c039)){_0x53c039[_0x9eae('0x47')](function(_0x186f11){RpcVoiceAgentReport['create'](_0x186f11);});}else{RpcVoiceAgentReport[_0x9eae('0x2a')](_0x53c039);}};Report[_0x9eae('0x1c')][_0x9eae('0x17')]=function(_0x217b69){RpcVoiceDialReport[_0x9eae('0x2a')](_0x217b69);var _0x5aff38;var _0x2a0950;var _0xb97f60=_0x217b69[_0x9eae('0x38')];if(_[_0x9eae('0x48')](_0xb97f60,'Local')){_0x2a0950=_0xb97f60[_0x9eae('0x49')](_0xb97f60[_0x9eae('0x4a')]('/')+0x1,_0xb97f60[_0x9eae('0x4a')]('@'));_0x5aff38=_[_0x9eae('0x1e')](this[_0x9eae('0xc')],function(_0x2906fb){return _0x2906fb[_0x9eae('0x4b')]==_0x2a0950||_0x2906fb[_0x9eae('0x4c')]==_0x2a0950||_0x2906fb['accountcode']==_0x2a0950;});}else{_0x2a0950=_0xb97f60['substring'](_0xb97f60[_0x9eae('0x4a')]('/')+0x1,_0xb97f60[_0x9eae('0x4d')]('-'));_0x5aff38=this[_0x9eae('0x1d')](_0x2a0950);}if(_0x5aff38){_0x217b69[_0x9eae('0x22')]=_[_0x9eae('0x20')](_0x5aff38[_0x9eae('0x22')])?util[_0x9eae('0x27')](_0x9eae('0x23'),_0x5aff38[_0x9eae('0x1f')]):_0x5aff38['interface'];_0x217b69[_0x9eae('0x4e')]=_0x5aff38[_0x9eae('0x1f')];_0x217b69[_0x9eae('0x21')]=_0x5aff38['accountcode'];RpcMemberReport[_0x9eae('0x17')](_0x217b69);}};Report[_0x9eae('0x1c')][_0x9eae('0x19')]=function(_0x2cbac0){RpcVoiceTransferReport[_0x9eae('0x3c')][_0x2cbac0[_0x9eae('0x4f')]]=_0x2cbac0;};Report[_0x9eae('0x1c')][_0x9eae('0x1b')]=function(_0x5bd5c6){RpcVoiceTransferReport['attendedTransfer'](_0x5bd5c6);};module[_0x9eae('0x50')]=Report;
\ No newline at end of file
+var _0xc00b=['queuecallerexitAt','create','match','voiceCallReport','exten','type','dialer','lastapplication','queue','lastdata','context','destination','callerid','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','transfereelinkedid','uniqueid','linkedid','monitor','monitors','monitorFilename','filename','connectedlinename','membername','xcally-motion-dialer','forEach','startsWith','substring','indexOf','lastIndexOf','exports','lodash','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','interface','format','length','connectedlinenum','assigned','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit'];(function(_0x4dacd0,_0x13609a){var _0xd520e6=function(_0x48118e){while(--_0x48118e){_0x4dacd0['push'](_0x4dacd0['shift']());}};_0xd520e6(++_0x13609a);}(_0xc00b,0x12a));var _0xbc00=function(_0x4cd846,_0x4a0f50){_0x4cd846=_0x4cd846-0x0;var _0x2f2a7d=_0xc00b[_0x4cd846];return _0x2f2a7d;};'use strict';var _=require(_0xbc00('0x0'));var moment=require('moment');var util=require(_0xbc00('0x1'));var config=require(_0xbc00('0x2'));var ami=require(_0xbc00('0x3'));var RpcVoiceAgentReport=require(_0xbc00('0x4'));var RpcVoiceCallReport=require(_0xbc00('0x5'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xbc00('0x6'));var RpcVoiceQueueReport=require(_0xbc00('0x7'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0xbc00('0x8'));var VoiceQueueReport=require(_0xbc00('0x9'));var VoiceCallReport=require(_0xbc00('0xa'));var VoiceAgentReport=require(_0xbc00('0xb'));var VoiceDialReport=require(_0xbc00('0xc'));var UserReport=require('./userReport');function Report(_0x16e60f){this[_0xbc00('0xd')]=_0x16e60f;this[_0xbc00('0xe')]=_0x16e60f[_0xbc00('0xe')];this[_0xbc00('0xf')]=_0x16e60f[_0xbc00('0xf')];}Report[_0xbc00('0x10')][_0xbc00('0x11')]=function(_0x3a24a2){var _0x2212e3=new VoiceQueueReport(this['realtime']);var _0x3988d4=new VoiceAgentReport(this[_0xbc00('0xd')]);var _0x188438=new VoiceDialReport(this['realtime']);var _0x4f5412=new VoiceCallReport(this[_0xbc00('0xd')]);var _0x5b10e1=new UserReport(this[_0xbc00('0xd')]);if(config[_0xbc00('0x12')]&&config['xdr'][_0xbc00('0x13')]){ami['on'](_0xbc00('0x14'),this[_0xbc00('0x15')][_0xbc00('0x16')](this));ami['on'](_0xbc00('0x17'),this['voiceCallReport']['bind'](this));ami['on'](_0xbc00('0x18'),this[_0xbc00('0x19')][_0xbc00('0x16')](this));ami['on'](_0xbc00('0x1a'),this[_0xbc00('0x1b')][_0xbc00('0x16')](this));ami['on'](_0xbc00('0x1c'),this[_0xbc00('0x1d')]['bind'](this));ami['on'](_0xbc00('0x1e'),this[_0xbc00('0x1f')][_0xbc00('0x16')](this));}};Report[_0xbc00('0x10')][_0xbc00('0x20')]=function(_0x102bfd){var _0x3417e7;_0x3417e7=_[_0xbc00('0x21')](this[_0xbc00('0xe')],function(_0x140c5c){return _0x140c5c[_0xbc00('0x22')]==_0x102bfd||_0x140c5c[_0xbc00('0x23')]==_0x102bfd;});if(_[_0xbc00('0x24')](_0x3417e7)){var _0x4a182c=_[_0xbc00('0x21')](this[_0xbc00('0xf')],function(_0x381928){return _0x381928['accountcode']==_0x102bfd||_0x381928[_0xbc00('0x23')]==_0x102bfd;});if(_0x4a182c){_0x3417e7=_[_0xbc00('0x21')](this[_0xbc00('0xe')],function(_0x41d0e8){return _0x41d0e8[_0xbc00('0x25')]==util[_0xbc00('0x26')]('SIP/%s',_0x4a182c[_0xbc00('0x23')]);});}}return _0x3417e7;};Report[_0xbc00('0x10')][_0xbc00('0x15')]=function(_0x533779){for(var _0x2449cb=0x0;_0x2449cb<_0x533779[_0xbc00('0x27')];_0x2449cb+=0x1){var _0x68fbe8=this[_0xbc00('0x20')](_0x533779[_0x2449cb][_0xbc00('0x28')]);if(_0x68fbe8){_0x533779[_0x2449cb][_0xbc00('0x22')]=_0x68fbe8[_0xbc00('0x22')];_0x533779[_0x2449cb][_0xbc00('0x29')]=!![];_0x533779[_0x2449cb]['lastAssignedTo']=_0x68fbe8[_0xbc00('0x23')];_0x533779[_0x2449cb][_0xbc00('0x25')]=_[_0xbc00('0x24')](_0x68fbe8[_0xbc00('0x25')])?util['format']('SIP/%s',_0x68fbe8['name']):_0x68fbe8[_0xbc00('0x25')];if(_0x533779[_0x2449cb][_0xbc00('0x2a')]){_0x533779[_0x2449cb][_0xbc00('0x2b')]=moment()[_0xbc00('0x26')](_0xbc00('0x2c'));}if(_0x533779[_0x2449cb][_0xbc00('0x2d')]){_0x533779[_0x2449cb][_0xbc00('0x2e')]=moment()[_0xbc00('0x26')](_0xbc00('0x2c'));}RpcMemberReport[_0xbc00('0x15')](_0x533779[_0x2449cb]);}RpcVoiceQueueReport[_0xbc00('0x2f')](_0x533779[_0x2449cb]);}};function extractCalleridNumber(_0x337fec){var _0x35b3bf=_0x337fec[_0xbc00('0x30')](/<(.*?)>/);return _0x35b3bf?_0x35b3bf[0x1]:_0x337fec;}Report[_0xbc00('0x10')][_0xbc00('0x31')]=function(_0x5f2076){_0x5f2076['destination']=_0x5f2076['destination']||_0x5f2076[_0xbc00('0x32')];if(_0x5f2076[_0xbc00('0x33')]==_0xbc00('0x34')){_0x5f2076[_0xbc00('0x35')]=_0xbc00('0x36');_0x5f2076[_0xbc00('0x37')]=_0x5f2076['queue'];if(_0x5f2076[_0xbc00('0x38')]=='from-voip-provider'){_0x5f2076[_0xbc00('0x22')]='';_0x5f2076[_0xbc00('0x39')]=extractCalleridNumber(_0x5f2076[_0xbc00('0x3a')]);}else if(_0x5f2076[_0xbc00('0x38')]=='from-sip'){if(_0x5f2076[_0xbc00('0x39')]==_0xbc00('0x3b')){_0x5f2076[_0xbc00('0x39')]=extractCalleridNumber(_0x5f2076[_0xbc00('0x3c')]);_0x5f2076[_0xbc00('0x3d')]=_0x5f2076[_0xbc00('0x3e')];_0x5f2076[_0xbc00('0x3f')]=[_0x5f2076['channel'],_0x5f2076[_0xbc00('0x40')]=_0x5f2076[_0xbc00('0x3f')]][0x0];_0x5f2076[_0xbc00('0x3a')]=_0x5f2076[_0xbc00('0x3c')];}else{_0x5f2076[_0xbc00('0x39')]=_0x5f2076[_0xbc00('0x3d')];_0x5f2076[_0xbc00('0x3d')]=_0x5f2076['originatecalleridnum'];if(_0x5f2076[_0xbc00('0x41')]==_0xbc00('0x42')){_0x5f2076[_0xbc00('0x22')]=_0x5f2076[_0xbc00('0x28')];}else{_0x5f2076['accountcode']='';}}}}else{_0x5f2076[_0xbc00('0x3a')]=util[_0xbc00('0x26')](_0xbc00('0x43'),_0x5f2076[_0xbc00('0x44')],_0x5f2076[_0xbc00('0x3d')]);}if(RpcVoiceTransferReport[_0xbc00('0x45')][_0x5f2076['linkedid']]){var _0x4e6d43=RpcVoiceTransferReport['transfers'][_0x5f2076['linkedid']];_0x4e6d43[_0xbc00('0x46')]=_0x5f2076[_0xbc00('0x47')];RpcVoiceTransferReport[_0xbc00('0x1d')](_0x4e6d43);delete RpcVoiceTransferReport[_0xbc00('0x45')][_0x5f2076[_0xbc00('0x48')]];}RpcVoiceCallReport[_0xbc00('0x2f')](_0x5f2076);if(_0x5f2076[_0xbc00('0x49')]){for(var _0x5bcadd=0x0;_0x5bcadd<_0x5f2076[_0xbc00('0x4a')][_0xbc00('0x27')];_0x5bcadd+=0x1){_0x5f2076[_0xbc00('0x4b')]=_0x5f2076[_0xbc00('0x4a')][_0x5bcadd][_0xbc00('0x4c')];_0x5f2076['createdAt']=_0x5f2076['monitors'][_0x5bcadd]['createdAt'];if(_0x5f2076['exten']=='xcally-motion-preview'){_0x5f2076['calleridnum']=_0x5f2076[_0xbc00('0x28')];_0x5f2076[_0xbc00('0x44')]=_0x5f2076[_0xbc00('0x4d')];_0x5f2076[_0xbc00('0x28')]=_0x5f2076[_0xbc00('0x22')];_0x5f2076[_0xbc00('0x4d')]=_0x5f2076[_0xbc00('0x4e')];_0x5f2076[_0xbc00('0x32')]=_0x5f2076['originatecalleridnum'];}else if(_0x5f2076[_0xbc00('0x32')]==_0xbc00('0x4f')){_0x5f2076[_0xbc00('0x3d')]=_0x5f2076['destination'];_0x5f2076['exten']=_0x5f2076['originatecalleridnum'];}RpcVoiceRecording[_0xbc00('0x2f')](_0x5f2076);}}};Report['prototype'][_0xbc00('0x19')]=function(_0x507da2){if(_['isArray'](_0x507da2)){_0x507da2[_0xbc00('0x50')](function(_0x556031){RpcVoiceAgentReport['create'](_0x556031);});}else{RpcVoiceAgentReport['create'](_0x507da2);}};Report[_0xbc00('0x10')][_0xbc00('0x1b')]=function(_0x5514b6){RpcVoiceDialReport[_0xbc00('0x2f')](_0x5514b6);var _0x2858aa;var _0x5998ab;var _0x2ea833=_0x5514b6[_0xbc00('0x40')];if(_[_0xbc00('0x51')](_0x2ea833,'Local')){_0x5998ab=_0x2ea833[_0xbc00('0x52')](_0x2ea833[_0xbc00('0x53')]('/')+0x1,_0x2ea833[_0xbc00('0x53')]('@'));_0x2858aa=_[_0xbc00('0x21')](this[_0xbc00('0xe')],function(_0x4122cc){return _0x4122cc['mobile']==_0x5998ab||_0x4122cc['phone']==_0x5998ab||_0x4122cc[_0xbc00('0x22')]==_0x5998ab;});}else{_0x5998ab=_0x2ea833[_0xbc00('0x52')](_0x2ea833['indexOf']('/')+0x1,_0x2ea833[_0xbc00('0x54')]('-'));_0x2858aa=this[_0xbc00('0x20')](_0x5998ab);}if(_0x2858aa){_0x5514b6[_0xbc00('0x25')]=_['isNil'](_0x2858aa['interface'])?util[_0xbc00('0x26')]('SIP/%s',_0x2858aa[_0xbc00('0x23')]):_0x2858aa['interface'];_0x5514b6['membername']=_0x2858aa[_0xbc00('0x23')];_0x5514b6[_0xbc00('0x22')]=_0x2858aa[_0xbc00('0x22')];RpcMemberReport['voiceDialReport'](_0x5514b6);}};Report[_0xbc00('0x10')][_0xbc00('0x1d')]=function(_0x5c65a2){RpcVoiceTransferReport[_0xbc00('0x45')][_0x5c65a2['transfererlinkedid']]=_0x5c65a2;};Report[_0xbc00('0x10')][_0xbc00('0x1f')]=function(_0x5ed360){RpcVoiceTransferReport[_0xbc00('0x1f')](_0x5ed360);};module[_0xbc00('0x55')]=Report;
\ No newline at end of file
index a80b717..8f7ddf9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d65=['[userReport][sipshowregistry]','[userReport][devicestatelist]','inspect','prototype','isUndefined','emit','isNotNull','[userReport][registry]\x20registry:%s\x20state:%s','username','[userReport][registry]','find','stateRegistry','merge','omit','event','actionid','state','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','info','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','debug','[userReport][devicestatechange]','local','toLowerCase','inuse','stateTime','toNumber','updateStatusRealtime','telephone:%s','startsWith','Local','substring','indexOf','mobile','accountcode','peerstatus','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','bluebird','../../../config/logger','ami','../ami','redis','defaults','localhost','trunks','agents','telephones','registryentry','syncRegistry','registry','bind','devicestatechange','syncDeviceState','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4d65,0xc0));var _0x54d6=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0x4d65[_0x18a79d];return _0x4f8848;};'use strict';var _=require(_0x54d6('0x0'));var moment=require('moment');var util=require('util');var Redis=require('ioredis');var BPromise=require(_0x54d6('0x1'));var config=require('../../../config/environment');var logger=require(_0x54d6('0x2'))(_0x54d6('0x3'));var ami=require(_0x54d6('0x4'));config[_0x54d6('0x5')]=_[_0x54d6('0x6')](config[_0x54d6('0x5')],{'host':_0x54d6('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x54d6('0x5')]));function UserReport(_0x45347c){this[_0x54d6('0x8')]=_0x45347c['trunks'];this[_0x54d6('0x9')]=_0x45347c[_0x54d6('0x9')];this[_0x54d6('0xa')]=_0x45347c[_0x54d6('0xa')];ami['on'](_0x54d6('0xb'),this[_0x54d6('0xc')]['bind'](this));ami['on'](_0x54d6('0xd'),this[_0x54d6('0xc')][_0x54d6('0xe')](this));ami['on'](_0x54d6('0xf'),this[_0x54d6('0x10')]['bind'](this));ami['on']('peerstatus',this[_0x54d6('0x11')][_0x54d6('0xe')](this));return this[_0x54d6('0x12')]();}function showSipRegistrations(){Promise[_0x54d6('0x13')]()[_0x54d6('0x14')](ami[_0x54d6('0x15')]())[_0x54d6('0x16')](function(_0x2458fa){logger[_0x54d6('0x17')](_0x54d6('0x18'),util['inspect'](_0x2458fa,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x54d6('0x13')]()[_0x54d6('0x14')](ami['actionDeviceStateList']())[_0x54d6('0x16')](function(_0x441e74){logger[_0x54d6('0x17')](_0x54d6('0x19'),util[_0x54d6('0x1a')](_0x441e74,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x54d6('0x13')]()[_0x54d6('0x14')](ami['actionSipPeerStatus']())['catch'](function(_0x3c395d){logger[_0x54d6('0x17')]('[userReport][sippeerstatus]',util['inspect'](_0x3c395d,{'showHidden':![],'depth':null}));});}UserReport[_0x54d6('0x1b')]['syncRealtimeShow']=function(){setInterval(function(){BPromise['resolve']()[_0x54d6('0x14')](showSipRegistrations())[_0x54d6('0x14')](listDeviceStates())[_0x54d6('0x14')](showPeersStatus());},0x32c8);};UserReport['prototype']['isNotNull']=function(_0x533eb3){return _0x533eb3!==null&&!_[_0x54d6('0x1c')](_0x533eb3);};UserReport[_0x54d6('0x1b')]['emit']=function(_0x124d02,_0x2b4d0b,_0x247ab8){io['to'](_0x124d02)[_0x54d6('0x1d')](_0x2b4d0b,_0x247ab8);};UserReport[_0x54d6('0x1b')][_0x54d6('0xc')]=function(_0x4b7eaa){try{if(this[_0x54d6('0x1e')](_0x4b7eaa)){logger['info'](_0x54d6('0x1f'),_0x4b7eaa[_0x54d6('0x20')],_0x4b7eaa['state']);logger['debug'](_0x54d6('0x21'),util['inspect'](_0x4b7eaa,{'showHidden':![],'depth':null}));var _0x4ecfde=_[_0x54d6('0x22')](this['trunks'],{'defaultuser':_0x4b7eaa[_0x54d6('0x20')]});if(_0x4ecfde){_0x4b7eaa[_0x54d6('0x23')]=_0x4b7eaa['state'];_[_0x54d6('0x24')](_0x4ecfde,_[_0x54d6('0x25')](_0x4b7eaa,[_0x54d6('0x26'),_0x54d6('0x27'),_0x54d6('0x20'),_0x54d6('0x28')]));logger['debug'](_0x54d6('0x29'),util[_0x54d6('0x1a')](_0x4ecfde,{'showHidden':![],'depth':null}));this[_0x54d6('0x1d')](util[_0x54d6('0x2a')](_0x54d6('0x2b'),_0x4ecfde[_0x54d6('0x2c')]),_0x54d6('0x2d'),_0x4ecfde);}}}catch(_0xeeafde){logger[_0x54d6('0x17')](_0x54d6('0x21'),util['inspect'](_0xeeafde,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncDeviceState']=function(_0x378daa){try{if(this[_0x54d6('0x1e')](_0x378daa)){logger[_0x54d6('0x2e')](_0x54d6('0x2f'),_0x378daa[_0x54d6('0x30')],_0x378daa[_0x54d6('0x28')]);logger[_0x54d6('0x31')](_0x54d6('0x32'),util[_0x54d6('0x1a')](_0x378daa,{'showHidden':![],'depth':null}));if(this[_0x54d6('0x9')][_0x378daa[_0x54d6('0x30')]]){if(!this[_0x54d6('0x9')][_0x378daa[_0x54d6('0x30')]][_0x54d6('0x33')]||_0x378daa[_0x54d6('0x28')][_0x54d6('0x34')]()==_0x54d6('0x35')){this[_0x54d6('0x9')][_0x378daa[_0x54d6('0x30')]][_0x54d6('0x33')]=![];if(this[_0x54d6('0x9')][_0x378daa['device']][_0x54d6('0x28')]!==_0x378daa[_0x54d6('0x28')][_0x54d6('0x34')]()){this['agents'][_0x378daa[_0x54d6('0x30')]][_0x54d6('0x36')]=_[_0x54d6('0x37')](moment()[_0x54d6('0x2a')]('x'));}this[_0x54d6('0x9')][_0x378daa[_0x54d6('0x30')]][_0x54d6('0x28')]=_0x378daa['state'][_0x54d6('0x34')]();this[_0x54d6('0x9')][_0x378daa[_0x54d6('0x30')]][_0x54d6('0x38')](_0x378daa);}}else if(this[_0x54d6('0xa')][_0x378daa[_0x54d6('0x30')]]){if(this['telephones'][_0x378daa[_0x54d6('0x30')]]['state']!==_0x378daa[_0x54d6('0x28')][_0x54d6('0x34')]()){this['telephones'][_0x378daa[_0x54d6('0x30')]][_0x54d6('0x36')]=_['toNumber'](moment()['format']('x'));}this[_0x54d6('0xa')][_0x378daa[_0x54d6('0x30')]]['state']=_0x378daa[_0x54d6('0x28')][_0x54d6('0x34')]();logger[_0x54d6('0x31')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util['inspect'](this[_0x54d6('0xa')][_0x378daa[_0x54d6('0x30')]],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x54d6('0x39'),this[_0x54d6('0xa')][_0x378daa[_0x54d6('0x30')]][_0x54d6('0x2c')]),'telephone:save',this[_0x54d6('0xa')][_0x378daa['device']]);}else if(this[_0x54d6('0x8')][_0x378daa[_0x54d6('0x30')]]){if(this[_0x54d6('0x8')][_0x378daa[_0x54d6('0x30')]][_0x54d6('0x28')]!==_0x378daa[_0x54d6('0x28')][_0x54d6('0x34')]()){this[_0x54d6('0x8')][_0x378daa[_0x54d6('0x30')]][_0x54d6('0x36')]=_['toNumber'](moment()[_0x54d6('0x2a')]('x'));}this[_0x54d6('0x8')][_0x378daa[_0x54d6('0x30')]][_0x54d6('0x28')]=_0x378daa[_0x54d6('0x28')]['toLowerCase']();logger[_0x54d6('0x31')]('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util['inspect'](this['trunks'][_0x378daa[_0x54d6('0x30')]],{'showHidden':![],'depth':null}));this[_0x54d6('0x1d')](util[_0x54d6('0x2a')](_0x54d6('0x2b'),this['trunks'][_0x378daa['device']][_0x54d6('0x2c')]),_0x54d6('0x2d'),this[_0x54d6('0x8')][_0x378daa['device']]);}else if(_[_0x54d6('0x3a')](_0x378daa[_0x54d6('0x30')],_0x54d6('0x3b'))){var _0x7b462=_0x378daa[_0x54d6('0x30')];var _0xc04f12=_0x7b462[_0x54d6('0x3c')](_0x7b462[_0x54d6('0x3d')]('/')+0x1,_0x7b462[_0x54d6('0x3d')]('@'));var _0x2736e3=_[_0x54d6('0x22')](this[_0x54d6('0x9')],function(_0x1aeb47){return _0x1aeb47[_0x54d6('0x3e')]==_0xc04f12||_0x1aeb47['phone']==_0xc04f12||_0x1aeb47[_0x54d6('0x3f')]==_0xc04f12;});if(_0x2736e3){if(_0x2736e3[_0x54d6('0x28')]!==_0x378daa[_0x54d6('0x28')]['toLowerCase']()){_0x2736e3[_0x54d6('0x36')]=_[_0x54d6('0x37')](moment()[_0x54d6('0x2a')]('x'));}_0x2736e3[_0x54d6('0x28')]=_0x378daa['state'][_0x54d6('0x34')]();_0x2736e3[_0x54d6('0x33')]=!![];_0x2736e3[_0x54d6('0x38')](_0x378daa);}}}}catch(_0x118ed9){logger['error'](_0x54d6('0x32'),util[_0x54d6('0x1a')](_0x118ed9,{'showHidden':![],'depth':null}));}};UserReport[_0x54d6('0x1b')][_0x54d6('0x11')]=function(_0x44b6b0){try{if(this[_0x54d6('0x1e')](_0x44b6b0)&&this['isNotNull'](_0x44b6b0[_0x54d6('0x40')])){logger[_0x54d6('0x2e')]('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x44b6b0[_0x54d6('0x41')],_0x44b6b0[_0x54d6('0x42')],_0x44b6b0[_0x54d6('0x40')]);logger['debug'](_0x54d6('0x43'),util[_0x54d6('0x1a')](_0x44b6b0,{'showHidden':![],'depth':null}));if(this[_0x54d6('0x9')][_0x44b6b0[_0x54d6('0x41')]]){if(!this[_0x54d6('0x9')][_0x44b6b0['peer']][_0x54d6('0x33')]||_0x44b6b0['peerstatus']['toLowerCase']()==_0x54d6('0x44')){this['agents'][_0x44b6b0[_0x54d6('0x41')]]['local']=![];this[_0x54d6('0x9')][_0x44b6b0['peer']][_0x54d6('0x45')]=_0x44b6b0[_0x54d6('0x40')]['toLowerCase']();this[_0x54d6('0x9')][_0x44b6b0[_0x54d6('0x41')]]['address']=_0x44b6b0[_0x54d6('0x42')];this[_0x54d6('0x9')][_0x44b6b0[_0x54d6('0x41')]]['updateStatusRealtime'](_0x44b6b0);}}else if(this[_0x54d6('0xa')][_0x44b6b0[_0x54d6('0x41')]]){this[_0x54d6('0xa')][_0x44b6b0[_0x54d6('0x41')]][_0x54d6('0x45')]=_0x44b6b0[_0x54d6('0x40')]['toLowerCase']();this[_0x54d6('0xa')][_0x44b6b0[_0x54d6('0x41')]]['address']=_0x44b6b0[_0x54d6('0x42')];logger[_0x54d6('0x31')]('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util[_0x54d6('0x1a')](this['telephones'][_0x44b6b0[_0x54d6('0x41')]],{'showHidden':![],'depth':null}));this[_0x54d6('0x1d')](util[_0x54d6('0x2a')]('telephone:%s',this[_0x54d6('0xa')][_0x44b6b0['peer']][_0x54d6('0x2c')]),'telephone:save',this['telephones'][_0x44b6b0[_0x54d6('0x41')]]);}else if(this[_0x54d6('0x8')][_0x44b6b0[_0x54d6('0x41')]]){this[_0x54d6('0x8')][_0x44b6b0[_0x54d6('0x41')]][_0x54d6('0x45')]=_0x44b6b0['peerstatus'][_0x54d6('0x34')]();this[_0x54d6('0x8')][_0x44b6b0[_0x54d6('0x41')]]['address']=_0x44b6b0[_0x54d6('0x42')];logger[_0x54d6('0x31')](_0x54d6('0x46'),util[_0x54d6('0x1a')](this[_0x54d6('0x8')][_0x44b6b0[_0x54d6('0x41')]],{'showHidden':![],'depth':null}));this[_0x54d6('0x1d')](util['format']('trunk:%s',this[_0x54d6('0x8')][_0x44b6b0[_0x54d6('0x41')]]['name']),_0x54d6('0x2d'),this[_0x54d6('0x8')][_0x44b6b0[_0x54d6('0x41')]]);}}}catch(_0x40d366){logger[_0x54d6('0x17')](_0x54d6('0x43'),util[_0x54d6('0x1a')](_0x40d366,{'showHidden':![],'depth':null}));}};module[_0x54d6('0x47')]=UserReport;
\ No newline at end of file
+var _0x7a52=['trunks','agents','telephones','registryentry','syncRegistry','bind','devicestatechange','peerstatus','syncRealtimeShow','then','actionSipShowRegistry','catch','error','resolve','actionDeviceStateList','inspect','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isUndefined','emit','isNotNull','info','username','debug','[userReport][registry]','find','state','merge','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:save','syncDeviceState','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','inuse','toNumber','updateStatusRealtime','stateTime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','name','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:%s','startsWith','Local','substring','indexOf','mobile','phone','accountcode','syncPeerStatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','[userReport][peerstatus]','peer','registered','status','address','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:%s','exports','moment','util','ioredis','../../../config/environment','ami','../ami','redis','defaults','localhost','socket.io-emitter'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x7a52,0x177));var _0x27a5=function(_0x1a8355,_0x31083b){_0x1a8355=_0x1a8355-0x0;var _0x2e1590=_0x7a52[_0x1a8355];return _0x2e1590;};'use strict';var _=require('lodash');var moment=require(_0x27a5('0x0'));var util=require(_0x27a5('0x1'));var Redis=require(_0x27a5('0x2'));var BPromise=require('bluebird');var config=require(_0x27a5('0x3'));var logger=require('../../../config/logger')(_0x27a5('0x4'));var ami=require(_0x27a5('0x5'));config[_0x27a5('0x6')]=_[_0x27a5('0x7')](config[_0x27a5('0x6')],{'host':_0x27a5('0x8'),'port':0x18eb});var io=require(_0x27a5('0x9'))(new Redis(config['redis']));function UserReport(_0x1ebba5){this[_0x27a5('0xa')]=_0x1ebba5[_0x27a5('0xa')];this[_0x27a5('0xb')]=_0x1ebba5['agents'];this[_0x27a5('0xc')]=_0x1ebba5[_0x27a5('0xc')];ami['on'](_0x27a5('0xd'),this[_0x27a5('0xe')][_0x27a5('0xf')](this));ami['on']('registry',this['syncRegistry']['bind'](this));ami['on'](_0x27a5('0x10'),this['syncDeviceState']['bind'](this));ami['on'](_0x27a5('0x11'),this['syncPeerStatus'][_0x27a5('0xf')](this));return this[_0x27a5('0x12')]();}function showSipRegistrations(){Promise['resolve']()[_0x27a5('0x13')](ami[_0x27a5('0x14')]())[_0x27a5('0x15')](function(_0x39d69c){logger[_0x27a5('0x16')]('[userReport][sipshowregistry]',util['inspect'](_0x39d69c,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x27a5('0x17')]()[_0x27a5('0x13')](ami[_0x27a5('0x18')]())['catch'](function(_0x323145){logger['error']('[userReport][devicestatelist]',util[_0x27a5('0x19')](_0x323145,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x27a5('0x17')]()[_0x27a5('0x13')](ami[_0x27a5('0x1a')]())[_0x27a5('0x15')](function(_0xd74da7){logger[_0x27a5('0x16')](_0x27a5('0x1b'),util['inspect'](_0xd74da7,{'showHidden':![],'depth':null}));});}UserReport[_0x27a5('0x1c')][_0x27a5('0x12')]=function(){setInterval(function(){BPromise['resolve']()['then'](showSipRegistrations())[_0x27a5('0x13')](listDeviceStates())[_0x27a5('0x13')](showPeersStatus());},0x32c8);};UserReport[_0x27a5('0x1c')]['isNotNull']=function(_0x5a7b8c){return _0x5a7b8c!==null&&!_[_0x27a5('0x1d')](_0x5a7b8c);};UserReport[_0x27a5('0x1c')][_0x27a5('0x1e')]=function(_0xd522bb,_0x5a4611,_0xcedd9c){io['to'](_0xd522bb)[_0x27a5('0x1e')](_0x5a4611,_0xcedd9c);};UserReport[_0x27a5('0x1c')][_0x27a5('0xe')]=function(_0x5675be){try{if(this[_0x27a5('0x1f')](_0x5675be)){logger[_0x27a5('0x20')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x5675be[_0x27a5('0x21')],_0x5675be['state']);logger[_0x27a5('0x22')](_0x27a5('0x23'),util[_0x27a5('0x19')](_0x5675be,{'showHidden':![],'depth':null}));var _0x715f4d=_[_0x27a5('0x24')](this['trunks'],{'defaultuser':_0x5675be[_0x27a5('0x21')]});if(_0x715f4d){_0x5675be['stateRegistry']=_0x5675be[_0x27a5('0x25')];_[_0x27a5('0x26')](_0x715f4d,_[_0x27a5('0x27')](_0x5675be,[_0x27a5('0x28'),_0x27a5('0x29'),'username','state']));logger[_0x27a5('0x22')](_0x27a5('0x2a'),util[_0x27a5('0x19')](_0x715f4d,{'showHidden':![],'depth':null}));this[_0x27a5('0x1e')](util[_0x27a5('0x2b')]('trunk:%s',_0x715f4d['name']),_0x27a5('0x2c'),_0x715f4d);}}}catch(_0x43a85b){logger[_0x27a5('0x16')]('[userReport][registry]',util[_0x27a5('0x19')](_0x43a85b,{'showHidden':![],'depth':null}));}};UserReport[_0x27a5('0x1c')][_0x27a5('0x2d')]=function(_0x48cefc){try{if(this[_0x27a5('0x1f')](_0x48cefc)){logger[_0x27a5('0x20')](_0x27a5('0x2e'),_0x48cefc[_0x27a5('0x2f')],_0x48cefc[_0x27a5('0x25')]);logger[_0x27a5('0x22')](_0x27a5('0x30'),util[_0x27a5('0x19')](_0x48cefc,{'showHidden':![],'depth':null}));if(this[_0x27a5('0xb')][_0x48cefc[_0x27a5('0x2f')]]){if(!this[_0x27a5('0xb')][_0x48cefc[_0x27a5('0x2f')]][_0x27a5('0x31')]||_0x48cefc[_0x27a5('0x25')][_0x27a5('0x32')]()==_0x27a5('0x33')){this[_0x27a5('0xb')][_0x48cefc[_0x27a5('0x2f')]][_0x27a5('0x31')]=![];if(this[_0x27a5('0xb')][_0x48cefc[_0x27a5('0x2f')]][_0x27a5('0x25')]!==_0x48cefc[_0x27a5('0x25')]['toLowerCase']()){this[_0x27a5('0xb')][_0x48cefc[_0x27a5('0x2f')]]['stateTime']=_[_0x27a5('0x34')](moment()[_0x27a5('0x2b')]('x'));}this['agents'][_0x48cefc['device']]['state']=_0x48cefc[_0x27a5('0x25')]['toLowerCase']();this[_0x27a5('0xb')][_0x48cefc[_0x27a5('0x2f')]][_0x27a5('0x35')](_0x48cefc);}}else if(this[_0x27a5('0xc')][_0x48cefc['device']]){if(this[_0x27a5('0xc')][_0x48cefc[_0x27a5('0x2f')]][_0x27a5('0x25')]!==_0x48cefc[_0x27a5('0x25')][_0x27a5('0x32')]()){this[_0x27a5('0xc')][_0x48cefc[_0x27a5('0x2f')]][_0x27a5('0x36')]=_[_0x27a5('0x34')](moment()['format']('x'));}this[_0x27a5('0xc')][_0x48cefc[_0x27a5('0x2f')]]['state']=_0x48cefc[_0x27a5('0x25')][_0x27a5('0x32')]();logger['debug'](_0x27a5('0x37'),util[_0x27a5('0x19')](this['telephones'][_0x48cefc[_0x27a5('0x2f')]],{'showHidden':![],'depth':null}));this[_0x27a5('0x1e')](util[_0x27a5('0x2b')]('telephone:%s',this[_0x27a5('0xc')][_0x48cefc[_0x27a5('0x2f')]][_0x27a5('0x38')]),_0x27a5('0x39'),this[_0x27a5('0xc')][_0x48cefc['device']]);}else if(this[_0x27a5('0xa')][_0x48cefc[_0x27a5('0x2f')]]){if(this['trunks'][_0x48cefc[_0x27a5('0x2f')]]['state']!==_0x48cefc[_0x27a5('0x25')][_0x27a5('0x32')]()){this[_0x27a5('0xa')][_0x48cefc[_0x27a5('0x2f')]][_0x27a5('0x36')]=_[_0x27a5('0x34')](moment()[_0x27a5('0x2b')]('x'));}this['trunks'][_0x48cefc[_0x27a5('0x2f')]][_0x27a5('0x25')]=_0x48cefc['state'][_0x27a5('0x32')]();logger[_0x27a5('0x22')](_0x27a5('0x3a'),util[_0x27a5('0x19')](this[_0x27a5('0xa')][_0x48cefc[_0x27a5('0x2f')]],{'showHidden':![],'depth':null}));this[_0x27a5('0x1e')](util['format'](_0x27a5('0x3b'),this[_0x27a5('0xa')][_0x48cefc[_0x27a5('0x2f')]][_0x27a5('0x38')]),'trunk:save',this[_0x27a5('0xa')][_0x48cefc['device']]);}else if(_[_0x27a5('0x3c')](_0x48cefc[_0x27a5('0x2f')],_0x27a5('0x3d'))){var _0x377973=_0x48cefc[_0x27a5('0x2f')];var _0x32468b=_0x377973[_0x27a5('0x3e')](_0x377973[_0x27a5('0x3f')]('/')+0x1,_0x377973[_0x27a5('0x3f')]('@'));var _0x55bea0=_[_0x27a5('0x24')](this['agents'],function(_0x564ded){return _0x564ded[_0x27a5('0x40')]==_0x32468b||_0x564ded[_0x27a5('0x41')]==_0x32468b||_0x564ded[_0x27a5('0x42')]==_0x32468b;});if(_0x55bea0){if(_0x55bea0[_0x27a5('0x25')]!==_0x48cefc[_0x27a5('0x25')][_0x27a5('0x32')]()){_0x55bea0[_0x27a5('0x36')]=_[_0x27a5('0x34')](moment()[_0x27a5('0x2b')]('x'));}_0x55bea0[_0x27a5('0x25')]=_0x48cefc[_0x27a5('0x25')][_0x27a5('0x32')]();_0x55bea0[_0x27a5('0x31')]=!![];_0x55bea0[_0x27a5('0x35')](_0x48cefc);}}}}catch(_0x45ef04){logger['error'](_0x27a5('0x30'),util[_0x27a5('0x19')](_0x45ef04,{'showHidden':![],'depth':null}));}};UserReport[_0x27a5('0x1c')][_0x27a5('0x43')]=function(_0xcaa7bf){try{if(this[_0x27a5('0x1f')](_0xcaa7bf)&&this[_0x27a5('0x1f')](_0xcaa7bf[_0x27a5('0x11')])){logger[_0x27a5('0x20')](_0x27a5('0x44'),_0xcaa7bf['peer'],_0xcaa7bf['address'],_0xcaa7bf[_0x27a5('0x11')]);logger[_0x27a5('0x22')](_0x27a5('0x45'),util[_0x27a5('0x19')](_0xcaa7bf,{'showHidden':![],'depth':null}));if(this[_0x27a5('0xb')][_0xcaa7bf[_0x27a5('0x46')]]){if(!this['agents'][_0xcaa7bf[_0x27a5('0x46')]]['local']||_0xcaa7bf[_0x27a5('0x11')][_0x27a5('0x32')]()==_0x27a5('0x47')){this['agents'][_0xcaa7bf[_0x27a5('0x46')]][_0x27a5('0x31')]=![];this[_0x27a5('0xb')][_0xcaa7bf[_0x27a5('0x46')]][_0x27a5('0x48')]=_0xcaa7bf['peerstatus'][_0x27a5('0x32')]();this[_0x27a5('0xb')][_0xcaa7bf[_0x27a5('0x46')]]['address']=_0xcaa7bf[_0x27a5('0x49')];this[_0x27a5('0xb')][_0xcaa7bf[_0x27a5('0x46')]]['updateStatusRealtime'](_0xcaa7bf);}}else if(this[_0x27a5('0xc')][_0xcaa7bf[_0x27a5('0x46')]]){this['telephones'][_0xcaa7bf[_0x27a5('0x46')]][_0x27a5('0x48')]=_0xcaa7bf[_0x27a5('0x11')][_0x27a5('0x32')]();this[_0x27a5('0xc')][_0xcaa7bf['peer']]['address']=_0xcaa7bf['address'];logger['debug'](_0x27a5('0x4a'),util['inspect'](this['telephones'][_0xcaa7bf[_0x27a5('0x46')]],{'showHidden':![],'depth':null}));this[_0x27a5('0x1e')](util['format'](_0x27a5('0x4b'),this[_0x27a5('0xc')][_0xcaa7bf['peer']]['name']),_0x27a5('0x39'),this[_0x27a5('0xc')][_0xcaa7bf[_0x27a5('0x46')]]);}else if(this[_0x27a5('0xa')][_0xcaa7bf[_0x27a5('0x46')]]){this[_0x27a5('0xa')][_0xcaa7bf['peer']][_0x27a5('0x48')]=_0xcaa7bf[_0x27a5('0x11')]['toLowerCase']();this[_0x27a5('0xa')][_0xcaa7bf[_0x27a5('0x46')]]['address']=_0xcaa7bf[_0x27a5('0x49')];logger[_0x27a5('0x22')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util[_0x27a5('0x19')](this[_0x27a5('0xa')][_0xcaa7bf[_0x27a5('0x46')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x27a5('0x2b')]('trunk:%s',this[_0x27a5('0xa')][_0xcaa7bf[_0x27a5('0x46')]][_0x27a5('0x38')]),'trunk:save',this[_0x27a5('0xa')][_0xcaa7bf[_0x27a5('0x46')]]);}}}catch(_0x49613e){logger['error'](_0x27a5('0x45'),util[_0x27a5('0x19')](_0x49613e,{'showHidden':![],'depth':null}));}};module[_0x27a5('0x4c')]=UserReport;
\ No newline at end of file
index ad4333b..3055cfa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x614b=['bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','values','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','transfereeuniqueid','origtransfereruniqueid','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','onhold','[%s][voiceAgentReport][musiconholdstart]','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStop','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','destuniqueid','debug','uniqueid','inspect','YYYY-MM-DD\x20HH:mm:ss','called','queue','mandatoryDisposition','type','inbound','variables','voice','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','membername','error','[%s][voiceAgentReport][agentcalled]','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','voiceChannels','routealias','interface','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:%s','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','lastevent','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','[%s][voiceAgentReport][queuecallerabandon]','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','acwTimeout','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer'];(function(_0x586d01,_0x60c90f){var _0x40691c=function(_0x9d2cf3){while(--_0x9d2cf3){_0x586d01['push'](_0x586d01['shift']());}};_0x40691c(++_0x60c90f);}(_0x614b,0xb3));var _0xb614=function(_0x45872a,_0x4e1103){_0x45872a=_0x45872a-0x0;var _0x37d69f=_0x614b[_0x45872a];return _0x37d69f;};'use strict';var _=require(_0xb614('0x0'));var moment=require(_0xb614('0x1'));var util=require('util');var Redis=require(_0xb614('0x2'));var config=require(_0xb614('0x3'));var logger=require(_0xb614('0x4'))(_0xb614('0x5'));var ami=require(_0xb614('0x6'));config[_0xb614('0x7')]=_[_0xb614('0x8')](config[_0xb614('0x7')],{'host':_0xb614('0x9'),'port':0x18eb});var io=require(_0xb614('0xa'))(new Redis(config[_0xb614('0x7')]));function VoiceAgentReport(_0xe2c67a){this[_0xb614('0xb')]={};this['voiceChannels']=_0xe2c67a[_0xb614('0xb')];this[_0xb614('0xc')]=_0xe2c67a[_0xb614('0xc')];this[_0xb614('0xd')]=_0xe2c67a[_0xb614('0xd')];this['variables']={};ami['on'](_0xb614('0xe'),this[_0xb614('0xf')][_0xb614('0x10')](this));ami['on'](_0xb614('0x11'),this[_0xb614('0x12')]['bind'](this));ami['on'](_0xb614('0x13'),this[_0xb614('0x14')][_0xb614('0x10')](this));ami['on'](_0xb614('0x15'),this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0xb614('0x16'),this[_0xb614('0x17')][_0xb614('0x10')](this));ami['on'](_0xb614('0x18'),this[_0xb614('0x19')][_0xb614('0x10')](this));ami['on'](_0xb614('0x1a'),this[_0xb614('0x1b')]['bind'](this));ami['on'](_0xb614('0x1c'),this['syncMusicOnHoldStart'][_0xb614('0x10')](this));ami['on']('musiconholdstop',this[_0xb614('0x1d')][_0xb614('0x10')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0xb614('0x10')](this));ami['on']('blindtransfer',this[_0xb614('0x1e')][_0xb614('0x10')](this));}VoiceAgentReport[_0xb614('0x1f')][_0xb614('0x20')]=function(_0x2d392c,_0x31ab11,_0x2c5922){io['to'](_0x2d392c)[_0xb614('0x20')](_0x31ab11,_0x2c5922);};VoiceAgentReport[_0xb614('0x1f')][_0xb614('0x21')]=function(_0x1b3ab0){return _0x1b3ab0!==null&&!_[_0xb614('0x22')](_0x1b3ab0);};VoiceAgentReport[_0xb614('0x1f')][_0xb614('0xf')]=function(_0x381273){try{if(this[_0xb614('0x21')](_0x381273)){logger[_0xb614('0x23')](_0xb614('0x24'),_0x381273['uniqueid'],_0x381273['membername'],_0x381273[_0xb614('0x25')]);logger[_0xb614('0x26')]('[%s][voiceAgentReport][agentcalled]\x20event:',_0x381273[_0xb614('0x27')],util[_0xb614('0x28')](_0x381273,{'showHidden':![],'depth':null}));if(_[_0xb614('0x22')](this['channels'][_0x381273['uniqueid']])){this['channels'][_0x381273['uniqueid']]={};}if(_['isUndefined'](this[_0xb614('0xb')][_0x381273[_0xb614('0x27')]][_0x381273[_0xb614('0x25')]])){this[_0xb614('0xb')][_0x381273[_0xb614('0x27')]][_0x381273[_0xb614('0x25')]]={'agentcalledAt':moment()['format'](_0xb614('0x29')),'lastevent':_0xb614('0x2a'),'mandatoryDisposition':this[_0xb614('0xc')][_0x381273['queue']]?this[_0xb614('0xc')][_0x381273[_0xb614('0x2b')]][_0xb614('0x2c')]||![]:![],'type':this[_0xb614('0xc')][_0x381273['queue']]?this[_0xb614('0xc')][_0x381273[_0xb614('0x2b')]][_0xb614('0x2d')]||_0xb614('0x2e'):'inbound','variables':this[_0xb614('0x2f')][_0x381273[_0xb614('0x27')]],'motionChannel':_0xb614('0x30')};}_['merge'](this['channels'][_0x381273['uniqueid']][_0x381273[_0xb614('0x25')]],_[_0xb614('0x31')](_0x381273,[_0xb614('0x32'),_0xb614('0x33')]));logger[_0xb614('0x26')](_0xb614('0x34'),_0x381273[_0xb614('0x27')],util[_0xb614('0x28')](this[_0xb614('0xb')][_0x381273[_0xb614('0x27')]][_0x381273[_0xb614('0x25')]],{'showHidden':![],'depth':null}));ami[_0xb614('0x20')](_0xb614('0x35'),this['channels'][_0x381273['uniqueid']][_0x381273[_0xb614('0x25')]]);logger[_0xb614('0x26')](_0xb614('0x36'),_0x381273['uniqueid'],util[_0xb614('0x28')](this['channels'][_0x381273[_0xb614('0x27')]][_0x381273[_0xb614('0x25')]],{'showHidden':![],'depth':null}));this[_0xb614('0x20')](util[_0xb614('0x37')]('user:%s',_0x381273[_0xb614('0x38')]),'user:called',this['channels'][_0x381273[_0xb614('0x27')]][_0x381273[_0xb614('0x25')]]);}}catch(_0x54558b){logger[_0xb614('0x39')](_0xb614('0x3a'),_0x381273[_0xb614('0x27')],util[_0xb614('0x28')](_0x54558b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb614('0x1f')][_0xb614('0x12')]=function(_0x26dacf){try{if(this[_0xb614('0x21')](_0x26dacf)){if(this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]]){logger[_0xb614('0x26')]('[%s][voiceAgentReport][agentconnect]\x20event:',_0x26dacf[_0xb614('0x27')],util['inspect'](_0x26dacf,{'showHidden':![],'depth':null}));for(var _0x2404dd in this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]]){if(this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0xb614('0x3b')](_0x2404dd)){if(_0x26dacf[_0xb614('0x25')]===_0x2404dd){logger[_0xb614('0x23')](_0xb614('0x3c'),_0x26dacf['uniqueid'],_0x26dacf['membername'],_0x26dacf['destuniqueid']);this[_0xb614('0xb')][_0x26dacf['uniqueid']][_0x2404dd][_0xb614('0x3d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x26dacf[_0xb614('0x27')]][_0x2404dd]['connectedlinename']=_0x26dacf[_0xb614('0x3e')];this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x2404dd][_0xb614('0x3f')]=_0x26dacf['connectedlinenum'];this[_0xb614('0xb')][_0x26dacf['uniqueid']][_0x2404dd][_0xb614('0x40')]=_0x26dacf['destchannelstate'];this[_0xb614('0xb')][_0x26dacf['uniqueid']][_0x2404dd][_0xb614('0x41')]=_0x26dacf[_0xb614('0x41')];this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x2404dd][_0xb614('0x42')]=_0x26dacf[_0xb614('0x42')];this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x2404dd]['lastevent']='connect';if(this[_0xb614('0x43')][this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x2404dd][_0xb614('0x27')]]){var _0x806c04=this[_0xb614('0x43')][this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x2404dd][_0xb614('0x27')]][_0xb614('0x44')];this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x2404dd]['routealias']=_0x806c04;_0x26dacf[_0xb614('0x44')]=_0x806c04;}_['merge'](this[_0xb614('0xd')][_0x26dacf[_0xb614('0x45')]],_[_0xb614('0x46')](_0x26dacf,['queue',_0xb614('0x47'),_0xb614('0x44')]));logger[_0xb614('0x26')](_0xb614('0x48'),_0x26dacf[_0xb614('0x27')],util['inspect'](this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x26dacf[_0xb614('0x25')]],{'showHidden':![],'depth':null}));ami[_0xb614('0x20')](_0xb614('0x49'),this[_0xb614('0xb')][_0x26dacf['uniqueid']][_0x26dacf[_0xb614('0x25')]]);logger['debug'](_0xb614('0x4a'),_0x26dacf['uniqueid'],util[_0xb614('0x28')](this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x26dacf[_0xb614('0x25')]],{'showHidden':![],'depth':null}));this[_0xb614('0x20')](util[_0xb614('0x37')](_0xb614('0x4b'),_0x26dacf['membername']),'user:agentconnect',this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x26dacf[_0xb614('0x25')]]);}else if(!this['channels'][_0x26dacf[_0xb614('0x27')]][_0x2404dd][_0xb614('0x13')]&&!this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x2404dd]['agentcomplete']){logger[_0xb614('0x23')](_0xb614('0x4c'),_0x26dacf[_0xb614('0x27')],this[_0xb614('0xb')][_0x26dacf['uniqueid']][_0x2404dd][_0xb614('0x38')],_0x2404dd);this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x2404dd]['agentringnoanswer']=!![];this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x2404dd][_0xb614('0x4d')]=moment()[_0xb614('0x37')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x26dacf['uniqueid']][_0x2404dd][_0xb614('0x4e')]=_0x26dacf[_0xb614('0x25')];this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x2404dd][_0xb614('0x4f')]=_0x26dacf['membername'];this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x2404dd]['lastevent']=_0xb614('0x50');this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x2404dd][_0xb614('0x51')]='answered_elsewhere';logger[_0xb614('0x26')](_0xb614('0x52'),_0x26dacf[_0xb614('0x27')],util['inspect'](this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x2404dd],{'showHidden':![],'depth':null}));ami[_0xb614('0x20')](_0xb614('0x53'),this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x2404dd]);}}}}}}catch(_0xc834d7){logger['error'](_0xb614('0x54'),_0x26dacf[_0xb614('0x27')],util['inspect'](_0xc834d7,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xb614('0x14')]=function(_0x538e4d){try{if(this['isNotNull'](_0x538e4d)){logger[_0xb614('0x26')](_0xb614('0x55'),_0x538e4d[_0xb614('0x27')],util[_0xb614('0x28')](_0x538e4d,{'showHidden':![],'depth':null}));if(this[_0xb614('0xb')][_0x538e4d[_0xb614('0x27')]]&&this['channels'][_0x538e4d[_0xb614('0x27')]][_0x538e4d[_0xb614('0x25')]]){logger[_0xb614('0x23')](_0xb614('0x56'),_0x538e4d[_0xb614('0x27')],_0x538e4d[_0xb614('0x38')],_0x538e4d['destuniqueid']);this['channels'][_0x538e4d['uniqueid']][_0x538e4d[_0xb614('0x25')]][_0xb614('0x13')]=!![];this[_0xb614('0xb')][_0x538e4d[_0xb614('0x27')]][_0x538e4d[_0xb614('0x25')]][_0xb614('0x4d')]=moment()[_0xb614('0x37')](_0xb614('0x29'));this['channels'][_0x538e4d[_0xb614('0x27')]][_0x538e4d[_0xb614('0x25')]][_0xb614('0x57')]=_0xb614('0x58');this[_0xb614('0xb')][_0x538e4d[_0xb614('0x27')]][_0x538e4d[_0xb614('0x25')]][_0xb614('0x51')]=_0xb614('0x58');logger[_0xb614('0x26')](_0xb614('0x59'),_0x538e4d[_0xb614('0x27')],util[_0xb614('0x28')](this['channels'][_0x538e4d['uniqueid']][_0x538e4d['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0xb614('0x20')](_0xb614('0x5a'),this[_0xb614('0xb')][_0x538e4d['uniqueid']][_0x538e4d['destuniqueid']]);}}}catch(_0x56c2a9){logger[_0xb614('0x39')](_0xb614('0x5b'),_0x538e4d[_0xb614('0x27')],util[_0xb614('0x28')](_0x56c2a9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb614('0x1f')]['syncQueueCallerAbandon']=function(_0x3a3c59){try{if(this[_0xb614('0x21')](_0x3a3c59)){logger[_0xb614('0x26')](_0xb614('0x5c'),_0x3a3c59[_0xb614('0x27')],util['inspect'](_0x3a3c59,{'showHidden':![],'depth':null}));if(this[_0xb614('0xb')][_0x3a3c59['uniqueid']]){for(var _0x471c4a in this[_0xb614('0xb')][_0x3a3c59['uniqueid']]){if(this[_0xb614('0xb')][_0x3a3c59[_0xb614('0x27')]][_0xb614('0x3b')](_0x471c4a)&&!this[_0xb614('0xb')][_0x3a3c59[_0xb614('0x27')]][_0x471c4a][_0xb614('0x13')]&&!this[_0xb614('0xb')][_0x3a3c59[_0xb614('0x27')]][_0x471c4a]['agentcomplete']){logger[_0xb614('0x23')](_0xb614('0x5d'),_0x3a3c59[_0xb614('0x27')],this['channels'][_0x3a3c59[_0xb614('0x27')]][_0x471c4a]['membername'],_0x471c4a);this[_0xb614('0xb')][_0x3a3c59['uniqueid']][_0x471c4a][_0xb614('0x13')]=!![];this[_0xb614('0xb')][_0x3a3c59[_0xb614('0x27')]][_0x471c4a][_0xb614('0x4d')]=moment()[_0xb614('0x37')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x3a3c59[_0xb614('0x27')]][_0x471c4a]['lastevent']=_0xb614('0x5e');this['channels'][_0x3a3c59[_0xb614('0x27')]][_0x471c4a]['reason']=_0xb614('0x5e');logger[_0xb614('0x26')](_0xb614('0x5f'),_0x3a3c59[_0xb614('0x27')],util[_0xb614('0x28')](this['channels'][_0x3a3c59[_0xb614('0x27')]][_0x471c4a],{'showHidden':![],'depth':null}));ami['emit']('custom:agentqueuecallerabandon',this[_0xb614('0xb')][_0x3a3c59[_0xb614('0x27')]][_0x471c4a]);}}}}}catch(_0x45b470){logger[_0xb614('0x39')](_0xb614('0x60'),_0x3a3c59[_0xb614('0x27')],util['inspect'](_0x45b470,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb614('0x1f')]['syncAgentComplete']=function(_0x7d30ec){try{if(this['isNotNull'](_0x7d30ec)){logger[_0xb614('0x26')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x7d30ec[_0xb614('0x27')],util[_0xb614('0x28')](_0x7d30ec,{'showHidden':![],'depth':null}));if(this[_0xb614('0xb')][_0x7d30ec[_0xb614('0x27')]]){for(var _0x426896 in this['channels'][_0x7d30ec['uniqueid']]){if(this['channels'][_0x7d30ec[_0xb614('0x27')]]['hasOwnProperty'](_0x426896)){if(this[_0xb614('0xb')][_0x7d30ec[_0xb614('0x27')]][_0x426896][_0xb614('0x3d')]&&!this['channels'][_0x7d30ec[_0xb614('0x27')]][_0x426896][_0xb614('0x16')]){logger[_0xb614('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x7d30ec[_0xb614('0x27')],this[_0xb614('0xb')][_0x7d30ec[_0xb614('0x27')]][_0x426896][_0xb614('0x38')],_0x426896);this[_0xb614('0xb')][_0x7d30ec[_0xb614('0x27')]][_0x426896][_0xb614('0x16')]=!![];this['channels'][_0x7d30ec['uniqueid']][_0x426896][_0xb614('0x61')]=moment()[_0xb614('0x37')](_0xb614('0x29'));this[_0xb614('0xb')][_0x7d30ec[_0xb614('0x27')]][_0x426896][_0xb614('0x57')]=_0xb614('0x62');this[_0xb614('0xb')][_0x7d30ec[_0xb614('0x27')]][_0x426896][_0xb614('0x51')]=_0x7d30ec['reason']==_0xb614('0x63')?_0xb614('0x64'):_0x7d30ec[_0xb614('0x51')];this[_0xb614('0xb')][_0x7d30ec[_0xb614('0x27')]][_0x426896][_0xb614('0x65')]=_0x7d30ec['talktime'];if(this['voiceQueues'][_0x7d30ec[_0xb614('0x2b')]]&&this[_0xb614('0xc')][_0x7d30ec[_0xb614('0x2b')]][_0xb614('0x66')]){this[_0xb614('0xb')][_0x7d30ec[_0xb614('0x27')]][_0x426896][_0xb614('0x67')]=this[_0xb614('0xc')][_0x7d30ec[_0xb614('0x2b')]][_0xb614('0x68')];this[_0xb614('0xb')][_0x7d30ec['uniqueid']][_0x426896]['agentacw']=!![];}this[_0xb614('0xd')][_0x7d30ec[_0xb614('0x45')]]=_['omit'](this['agents'][_0x7d30ec['interface']],[_0xb614('0x2b'),_0xb614('0x47')]);logger['debug'](_0xb614('0x69'),_0x7d30ec['uniqueid'],util[_0xb614('0x28')](this[_0xb614('0xb')][_0x7d30ec[_0xb614('0x27')]][_0x426896],{'showHidden':![],'depth':null}));ami[_0xb614('0x20')]('custom:agentcomplete',this['channels'][_0x7d30ec[_0xb614('0x27')]][_0x426896]);logger[_0xb614('0x26')](_0xb614('0x6a'),_0x7d30ec[_0xb614('0x27')],util['inspect'](this['channels'][_0x7d30ec[_0xb614('0x27')]][_0x426896],{'showHidden':![],'depth':null}));this[_0xb614('0x20')](util['format'](_0xb614('0x4b'),_0x7d30ec[_0xb614('0x38')]),'user:agentcomplete',this['channels'][_0x7d30ec['uniqueid']][_0x426896]);}}}}}}catch(_0x334cff){logger[_0xb614('0x39')]('[%s][voiceAgentReport][agentcomplete]',_0x7d30ec[_0xb614('0x27')],util[_0xb614('0x28')](_0x334cff,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb614('0x1f')][_0xb614('0x19')]=function(_0x23ec37){try{if(this[_0xb614('0x21')](_0x23ec37)){logger[_0xb614('0x26')](_0xb614('0x6b'),_0x23ec37[_0xb614('0x27')],util[_0xb614('0x28')](_0x23ec37,{'showHidden':![],'depth':null}));this[_0xb614('0x6c')](_0x23ec37[_0xb614('0x27')],_[_0xb614('0x6d')](_0x23ec37[_0xb614('0x6e')])[0x0],_0x23ec37[_0xb614('0x6f')]);if(this[_0xb614('0xb')][_0x23ec37['uniqueid']]){for(var _0x2385dd in this['channels'][_0x23ec37[_0xb614('0x27')]]){if(this['channels'][_0x23ec37[_0xb614('0x27')]][_0xb614('0x3b')](_0x2385dd)){logger[_0xb614('0x23')](_0xb614('0x70'),_0x23ec37[_0xb614('0x27')],_0x2385dd,_[_0xb614('0x6d')](_0x23ec37[_0xb614('0x6e')])[0x0],_0x23ec37[_0xb614('0x6f')]);if(_[_0xb614('0x22')](this['channels'][_0x23ec37[_0xb614('0x27')]][_0x2385dd][_0xb614('0x2f')])){this['channels'][_0x23ec37[_0xb614('0x27')]][_0x2385dd][_0xb614('0x2f')]={};}this['channels'][_0x23ec37[_0xb614('0x27')]][_0x2385dd][_0xb614('0x2f')]=this['variables'][_0x23ec37[_0xb614('0x27')]];}}}}}catch(_0x23838b){logger[_0xb614('0x39')]('[%s][voiceAgentReport][varset]',_0x23ec37[_0xb614('0x27')],util[_0xb614('0x28')](_0x23838b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb614('0x1f')][_0xb614('0x6c')]=function(_0x52c920,_0x2180c6,_0x48ed7d){var _0xe8e4ba=['rtpaudioqos',_0xb614('0x71'),'rtpaudioqosjitter',_0xb614('0x72'),_0xb614('0x73'),_0xb614('0x74'),'rtpaudioqosrtt',_0xb614('0x75'),_0xb614('0x76'),_0xb614('0x77'),_0xb614('0x78'),_0xb614('0x79'),'membercalls',_0xb614('0x7a'),_0xb614('0x7b'),_0xb614('0x7c'),_0xb614('0x38'),_0xb614('0x7d'),_0xb614('0x7e')];if(!_[_0xb614('0x7f')](_0x2180c6)&&!_['includes'](_0xe8e4ba,_0x2180c6)){if(_[_0xb614('0x22')](this[_0xb614('0x2f')][_0x52c920])){this[_0xb614('0x2f')][_0x52c920]={};}this[_0xb614('0x2f')][_0x52c920][_0x2180c6]=_0x48ed7d;}};VoiceAgentReport['prototype']['syncHangup']=function(_0x38f7ea){try{if(this[_0xb614('0x21')](_0x38f7ea)){logger['debug']('[%s][voiceAgentReport][hangup]\x20event:',_0x38f7ea[_0xb614('0x27')],util[_0xb614('0x28')](_0x38f7ea,{'showHidden':![],'depth':null}));if(this[_0xb614('0xb')][_0x38f7ea[_0xb614('0x27')]]){for(var _0x2577f0 in this[_0xb614('0xb')][_0x38f7ea['uniqueid']]){if(this[_0xb614('0xb')][_0x38f7ea[_0xb614('0x27')]][_0xb614('0x3b')](_0x2577f0)){if(this[_0xb614('0xb')][_0x38f7ea[_0xb614('0x27')]][_0x2577f0][_0xb614('0x51')]==_0xb614('0x63')&&this[_0xb614('0xb')][_0x38f7ea['uniqueid']][_0x2577f0][_0xb614('0x16')]){logger['info'](_0xb614('0x80'),_0x38f7ea['uniqueid'],_0x2577f0);this[_0xb614('0xb')][_0x38f7ea[_0xb614('0x27')]][_0x2577f0][_0xb614('0x61')]=moment()['format'](_0xb614('0x29'));}}}logger['debug']('[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:',_0x38f7ea[_0xb614('0x27')],util['inspect'](_['values'](this[_0xb614('0xb')][_0x38f7ea['uniqueid']]),{'showHidden':![],'depth':null}));ami[_0xb614('0x20')]('custom:voiceAgentReport',_[_0xb614('0x81')](this[_0xb614('0xb')][_0x38f7ea[_0xb614('0x27')]]));delete this[_0xb614('0xb')][_0x38f7ea['uniqueid']];}if(this[_0xb614('0x2f')][_0x38f7ea[_0xb614('0x27')]]){delete this['variables'][_0x38f7ea[_0xb614('0x27')]];}}}catch(_0x1dc0eb){logger[_0xb614('0x39')](_0xb614('0x82'),_0x38f7ea[_0xb614('0x27')],util[_0xb614('0x28')](_0x1dc0eb,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb614('0x1f')][_0xb614('0x83')]=function(_0x55825a){try{if(this['isNotNull'](_0x55825a)){logger['debug']('[%s][voiceAgentReport][attendedtransfer]\x20event:',_0x55825a[_0xb614('0x27')],util[_0xb614('0x28')](_0x55825a,{'showHidden':![],'depth':null}));if(this[_0xb614('0xb')][_0x55825a[_0xb614('0x84')]]){for(var _0x2a2012 in this[_0xb614('0xb')][_0x55825a[_0xb614('0x84')]]){if(this['channels'][_0x55825a[_0xb614('0x84')]][_0xb614('0x3b')](_0x2a2012)){if(_0x55825a[_0xb614('0x85')]===_0x2a2012){logger[_0xb614('0x23')]('[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x55825a[_0xb614('0x27')],this['channels'][_0x55825a[_0xb614('0x84')]][_0x2a2012][_0xb614('0x38')],_0x2a2012);var _0x2fa260=moment();this[_0xb614('0xb')][_0x55825a['transfereeuniqueid']][_0x2a2012][_0xb614('0x16')]=!![];this[_0xb614('0xb')][_0x55825a[_0xb614('0x84')]][_0x2a2012]['agentcompleteAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x55825a['transfereeuniqueid']][_0x2a2012][_0xb614('0x57')]=_0xb614('0x62');this[_0xb614('0xb')][_0x55825a[_0xb614('0x84')]][_0x2a2012][_0xb614('0x51')]='transfer';this['channels'][_0x55825a[_0xb614('0x84')]][_0x2a2012][_0xb614('0x65')]=_0x2fa260[_0xb614('0x86')](this[_0xb614('0xb')][_0x55825a[_0xb614('0x84')]][_0x2a2012][_0xb614('0x3d')],_0xb614('0x87'));}}}}if(this[_0xb614('0xb')][_0x55825a[_0xb614('0x88')]]){var _0xf13a84=this[_0xb614('0xb')][_0x55825a[_0xb614('0x88')]];this[_0xb614('0xb')][_0x55825a[_0xb614('0x88')]]=this[_0xb614('0xb')][_0x55825a[_0xb614('0x84')]];this['channels'][_0x55825a[_0xb614('0x84')]]=_0xf13a84;}}}catch(_0x54776f){logger[_0xb614('0x39')](_0xb614('0x89'),_0x55825a[_0xb614('0x27')],util[_0xb614('0x28')](_0x54776f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb614('0x1f')][_0xb614('0x1e')]=function(_0x1be96b){try{if(this[_0xb614('0x21')](_0x1be96b)){logger['debug'](_0xb614('0x8a'),_0x1be96b[_0xb614('0x27')],util[_0xb614('0x28')](_0x1be96b,{'showHidden':![],'depth':null}));if(this[_0xb614('0xb')][_0x1be96b[_0xb614('0x84')]]){for(var _0x2eb521 in this[_0xb614('0xb')][_0x1be96b[_0xb614('0x84')]]){if(this[_0xb614('0xb')][_0x1be96b[_0xb614('0x84')]][_0xb614('0x3b')](_0x2eb521)){if(_0x1be96b[_0xb614('0x8b')]===_0x2eb521){logger[_0xb614('0x23')]('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x1be96b[_0xb614('0x27')],this['channels'][_0x1be96b['transfereeuniqueid']][_0x2eb521][_0xb614('0x38')],_0x2eb521);var _0x4c26f8=moment();this[_0xb614('0xb')][_0x1be96b['transfereeuniqueid']][_0x2eb521][_0xb614('0x16')]=!![];this[_0xb614('0xb')][_0x1be96b['transfereeuniqueid']][_0x2eb521][_0xb614('0x61')]=_0x4c26f8;this[_0xb614('0xb')][_0x1be96b[_0xb614('0x84')]][_0x2eb521][_0xb614('0x57')]=_0xb614('0x62');this[_0xb614('0xb')][_0x1be96b[_0xb614('0x84')]][_0x2eb521]['reason']=_0xb614('0x63');this[_0xb614('0xb')][_0x1be96b[_0xb614('0x84')]][_0x2eb521][_0xb614('0x65')]=_0x4c26f8[_0xb614('0x86')](this[_0xb614('0xb')][_0x1be96b[_0xb614('0x84')]][_0x2eb521]['agentconnectAt'],_0xb614('0x87'));}}}}}}catch(_0x57ac32){logger['error'](_0xb614('0x8c'),_0x1be96b[_0xb614('0x27')],util[_0xb614('0x28')](_0x57ac32,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStart']=function(_0x104759){var _0x32480a='';try{if(this[_0xb614('0x21')](_0x104759)){logger[_0xb614('0x26')](_0xb614('0x8d'),_0x104759['uniqueid'],util[_0xb614('0x28')](_0x104759,{'showHidden':![],'depth':null}));if(_0x104759[_0xb614('0x8e')]){_0x32480a=_0x104759[_0xb614('0x8e')][_0xb614('0x8f')](0x0,_0x104759[_0xb614('0x8e')]['lastIndexOf']('-'));if(this['agents'][_0x32480a]){logger[_0xb614('0x23')]('[%s][voiceAgentReport][musiconholdstart]\x20interface:%s',_0x104759[_0xb614('0x27')],_0x32480a);this[_0xb614('0xd')][_0x32480a][_0xb614('0x90')]=!![];}}}}catch(_0x5d6030){logger[_0xb614('0x39')](_0xb614('0x91'),_0x104759[_0xb614('0x27')],util[_0xb614('0x28')](_0x5d6030,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb614('0x1f')][_0xb614('0x1d')]=function(_0x431940){var _0x303e73='';try{if(this[_0xb614('0x21')](_0x431940)){logger['debug']('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x431940[_0xb614('0x27')],util['inspect'](_0x431940,{'showHidden':![],'depth':null}));if(_0x431940[_0xb614('0x8e')]){_0x303e73=_0x431940['channel'][_0xb614('0x8f')](0x0,_0x431940['channel'][_0xb614('0x92')]('-'));if(this['agents'][_0x303e73]){logger[_0xb614('0x23')](_0xb614('0x93'),_0x431940[_0xb614('0x27')],_0x303e73);this[_0xb614('0xd')][_0x303e73][_0xb614('0x90')]=![];}}}}catch(_0x206e69){logger[_0xb614('0x39')](_0xb614('0x94'),_0x431940[_0xb614('0x27')],util[_0xb614('0x28')](_0x206e69,{'showHidden':![],'depth':null}));}};module[_0xb614('0x95')]=VoiceAgentReport;
\ No newline at end of file
+var _0x1250=['reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','syncAgentComplete','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','transfer','agent','talktime','acw','acwtime','acwTimeout','agentacw','omit','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','keys','value','variable','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','seconds','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','diff','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','onhold','exports','lodash','util','ioredis','../../../config/environment','../../../config/logger','ami','defaults','redis','localhost','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','info','uniqueid','destuniqueid','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','isUndefined','YYYY-MM-DD\x20HH:mm:ss','queue','type','inbound','voice','merge','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','debug','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','user:%s','membername','user:called','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','holdtime','lastevent','connect','routealias','interface','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','agentcomplete','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answered_elsewhere'];(function(_0x5a4f3b,_0x344159){var _0x33e973=function(_0x2ff5b0){while(--_0x2ff5b0){_0x5a4f3b['push'](_0x5a4f3b['shift']());}};_0x33e973(++_0x344159);}(_0x1250,0xde));var _0x0125=function(_0x31654a,_0x3d7d79){_0x31654a=_0x31654a-0x0;var _0x107dfa=_0x1250[_0x31654a];return _0x107dfa;};'use strict';var _=require(_0x0125('0x0'));var moment=require('moment');var util=require(_0x0125('0x1'));var Redis=require(_0x0125('0x2'));var config=require(_0x0125('0x3'));var logger=require(_0x0125('0x4'))(_0x0125('0x5'));var ami=require('../ami');config['redis']=_[_0x0125('0x6')](config[_0x0125('0x7')],{'host':_0x0125('0x8'),'port':0x18eb});var io=require(_0x0125('0x9'))(new Redis(config[_0x0125('0x7')]));function VoiceAgentReport(_0x583d1f){this[_0x0125('0xa')]={};this[_0x0125('0xb')]=_0x583d1f[_0x0125('0xa')];this[_0x0125('0xc')]=_0x583d1f['voiceQueues'];this[_0x0125('0xd')]=_0x583d1f['agents'];this[_0x0125('0xe')]={};ami['on'](_0x0125('0xf'),this[_0x0125('0x10')][_0x0125('0x11')](this));ami['on']('agentconnect',this['syncAgentConnect']['bind'](this));ami['on'](_0x0125('0x12'),this[_0x0125('0x13')][_0x0125('0x11')](this));ami['on'](_0x0125('0x14'),this[_0x0125('0x15')][_0x0125('0x11')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x0125('0x11')](this));ami['on'](_0x0125('0x16'),this[_0x0125('0x17')]['bind'](this));ami['on'](_0x0125('0x18'),this[_0x0125('0x19')][_0x0125('0x11')](this));ami['on']('musiconholdstart',this[_0x0125('0x1a')][_0x0125('0x11')](this));ami['on'](_0x0125('0x1b'),this[_0x0125('0x1c')][_0x0125('0x11')](this));ami['on'](_0x0125('0x1d'),this[_0x0125('0x1e')]['bind'](this));ami['on'](_0x0125('0x1f'),this[_0x0125('0x20')][_0x0125('0x11')](this));}VoiceAgentReport[_0x0125('0x21')]['emit']=function(_0x334491,_0x325b52,_0x79c804){io['to'](_0x334491)[_0x0125('0x22')](_0x325b52,_0x79c804);};VoiceAgentReport[_0x0125('0x21')][_0x0125('0x23')]=function(_0x1e4b3a){return _0x1e4b3a!==null&&!_['isUndefined'](_0x1e4b3a);};VoiceAgentReport['prototype'][_0x0125('0x10')]=function(_0x4546de){try{if(this[_0x0125('0x23')](_0x4546de)){logger[_0x0125('0x24')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x4546de[_0x0125('0x25')],_0x4546de['membername'],_0x4546de[_0x0125('0x26')]);logger['debug'](_0x0125('0x27'),_0x4546de[_0x0125('0x25')],util[_0x0125('0x28')](_0x4546de,{'showHidden':![],'depth':null}));if(_[_0x0125('0x29')](this[_0x0125('0xa')][_0x4546de[_0x0125('0x25')]])){this[_0x0125('0xa')][_0x4546de[_0x0125('0x25')]]={};}if(_['isUndefined'](this[_0x0125('0xa')][_0x4546de[_0x0125('0x25')]][_0x4546de[_0x0125('0x26')]])){this[_0x0125('0xa')][_0x4546de[_0x0125('0x25')]][_0x4546de['destuniqueid']]={'agentcalledAt':moment()['format'](_0x0125('0x2a')),'lastevent':'called','mandatoryDisposition':this['voiceQueues'][_0x4546de['queue']]?this[_0x0125('0xc')][_0x4546de[_0x0125('0x2b')]]['mandatoryDisposition']||![]:![],'type':this[_0x0125('0xc')][_0x4546de[_0x0125('0x2b')]]?this[_0x0125('0xc')][_0x4546de[_0x0125('0x2b')]][_0x0125('0x2c')]||'inbound':_0x0125('0x2d'),'variables':this[_0x0125('0xe')][_0x4546de['uniqueid']],'motionChannel':_0x0125('0x2e')};}_[_0x0125('0x2f')](this['channels'][_0x4546de['uniqueid']][_0x4546de[_0x0125('0x26')]],_['omit'](_0x4546de,['event',_0x0125('0x30')]));logger['debug'](_0x0125('0x31'),_0x4546de[_0x0125('0x25')],util[_0x0125('0x28')](this[_0x0125('0xa')][_0x4546de[_0x0125('0x25')]][_0x4546de[_0x0125('0x26')]],{'showHidden':![],'depth':null}));ami[_0x0125('0x22')]('custom:agentcalled',this['channels'][_0x4546de[_0x0125('0x25')]][_0x4546de['destuniqueid']]);logger[_0x0125('0x32')](_0x0125('0x33'),_0x4546de['uniqueid'],util[_0x0125('0x28')](this[_0x0125('0xa')][_0x4546de[_0x0125('0x25')]][_0x4546de['destuniqueid']],{'showHidden':![],'depth':null}));this['emit'](util[_0x0125('0x34')](_0x0125('0x35'),_0x4546de[_0x0125('0x36')]),_0x0125('0x37'),this[_0x0125('0xa')][_0x4546de['uniqueid']][_0x4546de[_0x0125('0x26')]]);}}catch(_0x4aa5c1){logger[_0x0125('0x38')](_0x0125('0x39'),_0x4546de[_0x0125('0x25')],util[_0x0125('0x28')](_0x4aa5c1,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0125('0x3a')]=function(_0x2b928f){try{if(this[_0x0125('0x23')](_0x2b928f)){if(this['channels'][_0x2b928f[_0x0125('0x25')]]){logger[_0x0125('0x32')](_0x0125('0x3b'),_0x2b928f[_0x0125('0x25')],util[_0x0125('0x28')](_0x2b928f,{'showHidden':![],'depth':null}));for(var _0x4b062c in this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]]){if(this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x0125('0x3c')](_0x4b062c)){if(_0x2b928f[_0x0125('0x26')]===_0x4b062c){logger[_0x0125('0x24')](_0x0125('0x3d'),_0x2b928f[_0x0125('0x25')],_0x2b928f[_0x0125('0x36')],_0x2b928f[_0x0125('0x26')]);this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x4b062c][_0x0125('0x3e')]=moment()['format'](_0x0125('0x2a'));this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x4b062c][_0x0125('0x3f')]=_0x2b928f[_0x0125('0x3f')];this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x4b062c][_0x0125('0x40')]=_0x2b928f[_0x0125('0x40')];this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x4b062c][_0x0125('0x41')]=_0x2b928f['destchannelstate'];this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x4b062c]['destchannelstatedesc']=_0x2b928f['destchannelstatedesc'];this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x4b062c][_0x0125('0x42')]=_0x2b928f['holdtime'];this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x4b062c][_0x0125('0x43')]=_0x0125('0x44');if(this[_0x0125('0xb')][this[_0x0125('0xa')][_0x2b928f['uniqueid']][_0x4b062c][_0x0125('0x25')]]){var _0x5f53ae=this[_0x0125('0xb')][this['channels'][_0x2b928f[_0x0125('0x25')]][_0x4b062c]['uniqueid']][_0x0125('0x45')];this['channels'][_0x2b928f['uniqueid']][_0x4b062c][_0x0125('0x45')]=_0x5f53ae;_0x2b928f['routealias']=_0x5f53ae;}_['merge'](this[_0x0125('0xd')][_0x2b928f[_0x0125('0x46')]],_[_0x0125('0x47')](_0x2b928f,[_0x0125('0x2b'),_0x0125('0x48'),_0x0125('0x45')]));logger[_0x0125('0x32')](_0x0125('0x49'),_0x2b928f[_0x0125('0x25')],util[_0x0125('0x28')](this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x2b928f[_0x0125('0x26')]],{'showHidden':![],'depth':null}));ami[_0x0125('0x22')](_0x0125('0x4a'),this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x2b928f[_0x0125('0x26')]]);logger[_0x0125('0x32')](_0x0125('0x4b'),_0x2b928f['uniqueid'],util[_0x0125('0x28')](this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x2b928f[_0x0125('0x26')]],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x0125('0x35'),_0x2b928f[_0x0125('0x36')]),_0x0125('0x4c'),this['channels'][_0x2b928f[_0x0125('0x25')]][_0x2b928f[_0x0125('0x26')]]);}else if(!this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x4b062c]['agentringnoanswer']&&!this['channels'][_0x2b928f[_0x0125('0x25')]][_0x4b062c][_0x0125('0x4d')]){logger[_0x0125('0x24')](_0x0125('0x4e'),_0x2b928f[_0x0125('0x25')],this['channels'][_0x2b928f[_0x0125('0x25')]][_0x4b062c][_0x0125('0x36')],_0x4b062c);this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x4b062c][_0x0125('0x12')]=!![];this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x4b062c][_0x0125('0x4f')]=moment()[_0x0125('0x34')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x4b062c][_0x0125('0x50')]=_0x2b928f[_0x0125('0x26')];this['channels'][_0x2b928f[_0x0125('0x25')]][_0x4b062c]['answeredelsewheremembername']=_0x2b928f[_0x0125('0x36')];this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x4b062c][_0x0125('0x43')]=_0x0125('0x51');this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x4b062c][_0x0125('0x52')]=_0x0125('0x51');logger['debug'](_0x0125('0x53'),_0x2b928f[_0x0125('0x25')],util[_0x0125('0x28')](this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x4b062c],{'showHidden':![],'depth':null}));ami['emit']('custom:agentansweredelsewhere',this['channels'][_0x2b928f[_0x0125('0x25')]][_0x4b062c]);}}}}}}catch(_0x29053b){logger[_0x0125('0x38')](_0x0125('0x54'),_0x2b928f[_0x0125('0x25')],util['inspect'](_0x29053b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0125('0x21')][_0x0125('0x13')]=function(_0x15dd30){try{if(this[_0x0125('0x23')](_0x15dd30)){logger[_0x0125('0x32')](_0x0125('0x55'),_0x15dd30[_0x0125('0x25')],util[_0x0125('0x28')](_0x15dd30,{'showHidden':![],'depth':null}));if(this[_0x0125('0xa')][_0x15dd30[_0x0125('0x25')]]&&this[_0x0125('0xa')][_0x15dd30[_0x0125('0x25')]][_0x15dd30[_0x0125('0x26')]]){logger[_0x0125('0x24')](_0x0125('0x56'),_0x15dd30['uniqueid'],_0x15dd30[_0x0125('0x36')],_0x15dd30[_0x0125('0x26')]);this['channels'][_0x15dd30['uniqueid']][_0x15dd30['destuniqueid']][_0x0125('0x12')]=!![];this[_0x0125('0xa')][_0x15dd30[_0x0125('0x25')]][_0x15dd30[_0x0125('0x26')]]['agentringnoanswerAt']=moment()[_0x0125('0x34')](_0x0125('0x2a'));this[_0x0125('0xa')][_0x15dd30[_0x0125('0x25')]][_0x15dd30[_0x0125('0x26')]][_0x0125('0x43')]=_0x0125('0x57');this[_0x0125('0xa')][_0x15dd30[_0x0125('0x25')]][_0x15dd30[_0x0125('0x26')]][_0x0125('0x52')]=_0x0125('0x57');logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x15dd30[_0x0125('0x25')],util[_0x0125('0x28')](this['channels'][_0x15dd30[_0x0125('0x25')]][_0x15dd30[_0x0125('0x26')]],{'showHidden':![],'depth':null}));ami[_0x0125('0x22')](_0x0125('0x58'),this[_0x0125('0xa')][_0x15dd30[_0x0125('0x25')]][_0x15dd30['destuniqueid']]);}}}catch(_0x21c565){logger[_0x0125('0x38')]('[%s][voiceAgentReport][agentringnoanswer]',_0x15dd30['uniqueid'],util[_0x0125('0x28')](_0x21c565,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0125('0x15')]=function(_0x58fb65){try{if(this['isNotNull'](_0x58fb65)){logger[_0x0125('0x32')]('[%s][voiceAgentReport][queuecallerabandon]\x20event:',_0x58fb65[_0x0125('0x25')],util['inspect'](_0x58fb65,{'showHidden':![],'depth':null}));if(this[_0x0125('0xa')][_0x58fb65['uniqueid']]){for(var _0x5b48d7 in this[_0x0125('0xa')][_0x58fb65[_0x0125('0x25')]]){if(this[_0x0125('0xa')][_0x58fb65[_0x0125('0x25')]]['hasOwnProperty'](_0x5b48d7)&&!this[_0x0125('0xa')][_0x58fb65[_0x0125('0x25')]][_0x5b48d7][_0x0125('0x12')]&&!this[_0x0125('0xa')][_0x58fb65['uniqueid']][_0x5b48d7]['agentcomplete']){logger['info'](_0x0125('0x59'),_0x58fb65[_0x0125('0x25')],this[_0x0125('0xa')][_0x58fb65['uniqueid']][_0x5b48d7][_0x0125('0x36')],_0x5b48d7);this[_0x0125('0xa')][_0x58fb65['uniqueid']][_0x5b48d7][_0x0125('0x12')]=!![];this['channels'][_0x58fb65['uniqueid']][_0x5b48d7][_0x0125('0x4f')]=moment()['format'](_0x0125('0x2a'));this[_0x0125('0xa')][_0x58fb65[_0x0125('0x25')]][_0x5b48d7][_0x0125('0x43')]=_0x0125('0x5a');this[_0x0125('0xa')][_0x58fb65[_0x0125('0x25')]][_0x5b48d7][_0x0125('0x52')]=_0x0125('0x5a');logger[_0x0125('0x32')](_0x0125('0x5b'),_0x58fb65[_0x0125('0x25')],util[_0x0125('0x28')](this[_0x0125('0xa')][_0x58fb65[_0x0125('0x25')]][_0x5b48d7],{'showHidden':![],'depth':null}));ami[_0x0125('0x22')](_0x0125('0x5c'),this[_0x0125('0xa')][_0x58fb65[_0x0125('0x25')]][_0x5b48d7]);}}}}}catch(_0x1dd45a){logger[_0x0125('0x38')](_0x0125('0x5d'),_0x58fb65[_0x0125('0x25')],util['inspect'](_0x1dd45a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0125('0x21')][_0x0125('0x5e')]=function(_0x5db041){try{if(this[_0x0125('0x23')](_0x5db041)){logger[_0x0125('0x32')](_0x0125('0x5f'),_0x5db041[_0x0125('0x25')],util[_0x0125('0x28')](_0x5db041,{'showHidden':![],'depth':null}));if(this[_0x0125('0xa')][_0x5db041[_0x0125('0x25')]]){for(var _0x11b202 in this[_0x0125('0xa')][_0x5db041[_0x0125('0x25')]]){if(this[_0x0125('0xa')][_0x5db041[_0x0125('0x25')]][_0x0125('0x3c')](_0x11b202)){if(this['channels'][_0x5db041['uniqueid']][_0x11b202][_0x0125('0x3e')]&&!this['channels'][_0x5db041['uniqueid']][_0x11b202][_0x0125('0x4d')]){logger['info'](_0x0125('0x60'),_0x5db041['uniqueid'],this[_0x0125('0xa')][_0x5db041[_0x0125('0x25')]][_0x11b202][_0x0125('0x36')],_0x11b202);this[_0x0125('0xa')][_0x5db041[_0x0125('0x25')]][_0x11b202][_0x0125('0x4d')]=!![];this['channels'][_0x5db041['uniqueid']][_0x11b202][_0x0125('0x61')]=moment()[_0x0125('0x34')](_0x0125('0x2a'));this[_0x0125('0xa')][_0x5db041[_0x0125('0x25')]][_0x11b202][_0x0125('0x43')]='complete';this[_0x0125('0xa')][_0x5db041[_0x0125('0x25')]][_0x11b202]['reason']=_0x5db041[_0x0125('0x52')]==_0x0125('0x62')?_0x0125('0x63'):_0x5db041['reason'];this[_0x0125('0xa')][_0x5db041[_0x0125('0x25')]][_0x11b202][_0x0125('0x64')]=_0x5db041['talktime'];if(this['voiceQueues'][_0x5db041[_0x0125('0x2b')]]&&this[_0x0125('0xc')][_0x5db041[_0x0125('0x2b')]][_0x0125('0x65')]){this[_0x0125('0xa')][_0x5db041[_0x0125('0x25')]][_0x11b202][_0x0125('0x66')]=this[_0x0125('0xc')][_0x5db041[_0x0125('0x2b')]][_0x0125('0x67')];this[_0x0125('0xa')][_0x5db041['uniqueid']][_0x11b202][_0x0125('0x68')]=!![];}this['agents'][_0x5db041[_0x0125('0x46')]]=_[_0x0125('0x69')](this[_0x0125('0xd')][_0x5db041[_0x0125('0x46')]],[_0x0125('0x2b'),_0x0125('0x48')]);logger[_0x0125('0x32')](_0x0125('0x6a'),_0x5db041[_0x0125('0x25')],util['inspect'](this[_0x0125('0xa')][_0x5db041[_0x0125('0x25')]][_0x11b202],{'showHidden':![],'depth':null}));ami[_0x0125('0x22')](_0x0125('0x6b'),this['channels'][_0x5db041[_0x0125('0x25')]][_0x11b202]);logger[_0x0125('0x32')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:',_0x5db041['uniqueid'],util['inspect'](this[_0x0125('0xa')][_0x5db041['uniqueid']][_0x11b202],{'showHidden':![],'depth':null}));this[_0x0125('0x22')](util['format'](_0x0125('0x35'),_0x5db041[_0x0125('0x36')]),_0x0125('0x6c'),this['channels'][_0x5db041['uniqueid']][_0x11b202]);}}}}}}catch(_0x31dc95){logger[_0x0125('0x38')](_0x0125('0x6d'),_0x5db041[_0x0125('0x25')],util[_0x0125('0x28')](_0x31dc95,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0125('0x21')][_0x0125('0x17')]=function(_0x5891a4){try{if(this[_0x0125('0x23')](_0x5891a4)){logger[_0x0125('0x32')](_0x0125('0x6e'),_0x5891a4[_0x0125('0x25')],util[_0x0125('0x28')](_0x5891a4,{'showHidden':![],'depth':null}));this['addVariable'](_0x5891a4[_0x0125('0x25')],_[_0x0125('0x6f')](_0x5891a4['variable'])[0x0],_0x5891a4[_0x0125('0x70')]);if(this[_0x0125('0xa')][_0x5891a4['uniqueid']]){for(var _0x402567 in this[_0x0125('0xa')][_0x5891a4[_0x0125('0x25')]]){if(this[_0x0125('0xa')][_0x5891a4[_0x0125('0x25')]][_0x0125('0x3c')](_0x402567)){logger[_0x0125('0x24')]('[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s',_0x5891a4[_0x0125('0x25')],_0x402567,_[_0x0125('0x6f')](_0x5891a4[_0x0125('0x71')])[0x0],_0x5891a4[_0x0125('0x70')]);if(_[_0x0125('0x29')](this[_0x0125('0xa')][_0x5891a4['uniqueid']][_0x402567][_0x0125('0xe')])){this['channels'][_0x5891a4[_0x0125('0x25')]][_0x402567][_0x0125('0xe')]={};}this[_0x0125('0xa')][_0x5891a4['uniqueid']][_0x402567][_0x0125('0xe')]=this[_0x0125('0xe')][_0x5891a4[_0x0125('0x25')]];}}}}}catch(_0x160263){logger[_0x0125('0x38')](_0x0125('0x72'),_0x5891a4[_0x0125('0x25')],util[_0x0125('0x28')](_0x160263,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0125('0x21')]['addVariable']=function(_0x49c85a,_0x3f6519,_0x57fc50){var _0x4ca00f=[_0x0125('0x73'),_0x0125('0x74'),'rtpaudioqosjitter',_0x0125('0x75'),'rtpaudioqosloss',_0x0125('0x76'),_0x0125('0x77'),_0x0125('0x78'),'sipcallid',_0x0125('0x79'),_0x0125('0x7a'),'bridgepvtcallid','membercalls',_0x0125('0x7b'),_0x0125('0x7c'),_0x0125('0x7d'),'membername',_0x0125('0x7e'),_0x0125('0x7f')];if(!_['isNil'](_0x3f6519)&&!_[_0x0125('0x80')](_0x4ca00f,_0x3f6519)){if(_['isUndefined'](this[_0x0125('0xe')][_0x49c85a])){this[_0x0125('0xe')][_0x49c85a]={};}this[_0x0125('0xe')][_0x49c85a][_0x3f6519]=_0x57fc50;}};VoiceAgentReport[_0x0125('0x21')][_0x0125('0x19')]=function(_0x5e5d20){try{if(this[_0x0125('0x23')](_0x5e5d20)){logger[_0x0125('0x32')]('[%s][voiceAgentReport][hangup]\x20event:',_0x5e5d20['uniqueid'],util[_0x0125('0x28')](_0x5e5d20,{'showHidden':![],'depth':null}));if(this[_0x0125('0xa')][_0x5e5d20[_0x0125('0x25')]]){for(var _0x9a1bee in this['channels'][_0x5e5d20[_0x0125('0x25')]]){if(this[_0x0125('0xa')][_0x5e5d20[_0x0125('0x25')]]['hasOwnProperty'](_0x9a1bee)){if(this[_0x0125('0xa')][_0x5e5d20[_0x0125('0x25')]][_0x9a1bee][_0x0125('0x52')]=='transfer'&&this[_0x0125('0xa')][_0x5e5d20[_0x0125('0x25')]][_0x9a1bee][_0x0125('0x4d')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x5e5d20[_0x0125('0x25')],_0x9a1bee);this[_0x0125('0xa')][_0x5e5d20[_0x0125('0x25')]][_0x9a1bee][_0x0125('0x61')]=moment()[_0x0125('0x34')](_0x0125('0x2a'));}}}logger[_0x0125('0x32')](_0x0125('0x81'),_0x5e5d20[_0x0125('0x25')],util[_0x0125('0x28')](_[_0x0125('0x82')](this[_0x0125('0xa')][_0x5e5d20[_0x0125('0x25')]]),{'showHidden':![],'depth':null}));ami[_0x0125('0x22')]('custom:voiceAgentReport',_[_0x0125('0x82')](this[_0x0125('0xa')][_0x5e5d20['uniqueid']]));delete this[_0x0125('0xa')][_0x5e5d20[_0x0125('0x25')]];}if(this[_0x0125('0xe')][_0x5e5d20[_0x0125('0x25')]]){delete this[_0x0125('0xe')][_0x5e5d20['uniqueid']];}}}catch(_0x1be698){logger[_0x0125('0x38')](_0x0125('0x83'),_0x5e5d20[_0x0125('0x25')],util['inspect'](_0x1be698,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0125('0x1e')]=function(_0xa53272){try{if(this[_0x0125('0x23')](_0xa53272)){logger[_0x0125('0x32')](_0x0125('0x84'),_0xa53272[_0x0125('0x25')],util['inspect'](_0xa53272,{'showHidden':![],'depth':null}));if(this[_0x0125('0xa')][_0xa53272[_0x0125('0x85')]]){for(var _0x13a2e9 in this['channels'][_0xa53272['transfereeuniqueid']]){if(this[_0x0125('0xa')][_0xa53272['transfereeuniqueid']][_0x0125('0x3c')](_0x13a2e9)){if(_0xa53272[_0x0125('0x86')]===_0x13a2e9){logger[_0x0125('0x24')](_0x0125('0x87'),_0xa53272[_0x0125('0x25')],this[_0x0125('0xa')][_0xa53272[_0x0125('0x85')]][_0x13a2e9][_0x0125('0x36')],_0x13a2e9);var _0x244177=moment();this[_0x0125('0xa')][_0xa53272[_0x0125('0x85')]][_0x13a2e9][_0x0125('0x4d')]=!![];this['channels'][_0xa53272['transfereeuniqueid']][_0x13a2e9]['agentcompleteAt']=moment()[_0x0125('0x34')](_0x0125('0x2a'));this[_0x0125('0xa')][_0xa53272['transfereeuniqueid']][_0x13a2e9][_0x0125('0x43')]='complete';this[_0x0125('0xa')][_0xa53272[_0x0125('0x85')]][_0x13a2e9]['reason']=_0x0125('0x62');this['channels'][_0xa53272[_0x0125('0x85')]][_0x13a2e9]['talktime']=_0x244177['diff'](this['channels'][_0xa53272[_0x0125('0x85')]][_0x13a2e9][_0x0125('0x3e')],_0x0125('0x88'));}}}}if(this[_0x0125('0xa')][_0xa53272['secondtransfereruniqueid']]){var _0x1f4a44=this[_0x0125('0xa')][_0xa53272['secondtransfereruniqueid']];this[_0x0125('0xa')][_0xa53272['secondtransfereruniqueid']]=this['channels'][_0xa53272[_0x0125('0x85')]];this[_0x0125('0xa')][_0xa53272['transfereeuniqueid']]=_0x1f4a44;}}}catch(_0x21d4f9){logger[_0x0125('0x38')](_0x0125('0x89'),_0xa53272[_0x0125('0x25')],util[_0x0125('0x28')](_0x21d4f9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0125('0x21')][_0x0125('0x20')]=function(_0x2cd85a){try{if(this[_0x0125('0x23')](_0x2cd85a)){logger[_0x0125('0x32')](_0x0125('0x8a'),_0x2cd85a['uniqueid'],util[_0x0125('0x28')](_0x2cd85a,{'showHidden':![],'depth':null}));if(this['channels'][_0x2cd85a[_0x0125('0x85')]]){for(var _0x418ecf in this[_0x0125('0xa')][_0x2cd85a[_0x0125('0x85')]]){if(this[_0x0125('0xa')][_0x2cd85a[_0x0125('0x85')]][_0x0125('0x3c')](_0x418ecf)){if(_0x2cd85a['transfereruniqueid']===_0x418ecf){logger[_0x0125('0x24')](_0x0125('0x8b'),_0x2cd85a['uniqueid'],this['channels'][_0x2cd85a[_0x0125('0x85')]][_0x418ecf][_0x0125('0x36')],_0x418ecf);var _0x8bd46d=moment();this[_0x0125('0xa')][_0x2cd85a[_0x0125('0x85')]][_0x418ecf]['agentcomplete']=!![];this['channels'][_0x2cd85a[_0x0125('0x85')]][_0x418ecf][_0x0125('0x61')]=_0x8bd46d;this[_0x0125('0xa')][_0x2cd85a[_0x0125('0x85')]][_0x418ecf]['lastevent']=_0x0125('0x8c');this[_0x0125('0xa')][_0x2cd85a[_0x0125('0x85')]][_0x418ecf][_0x0125('0x52')]=_0x0125('0x62');this[_0x0125('0xa')][_0x2cd85a[_0x0125('0x85')]][_0x418ecf][_0x0125('0x64')]=_0x8bd46d[_0x0125('0x8d')](this[_0x0125('0xa')][_0x2cd85a[_0x0125('0x85')]][_0x418ecf]['agentconnectAt'],'seconds');}}}}}}catch(_0x15fe7d){logger[_0x0125('0x38')](_0x0125('0x8e'),_0x2cd85a[_0x0125('0x25')],util['inspect'](_0x15fe7d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0125('0x21')][_0x0125('0x1a')]=function(_0x4bebb7){var _0x1ed095='';try{if(this[_0x0125('0x23')](_0x4bebb7)){logger['debug'](_0x0125('0x8f'),_0x4bebb7[_0x0125('0x25')],util[_0x0125('0x28')](_0x4bebb7,{'showHidden':![],'depth':null}));if(_0x4bebb7[_0x0125('0x90')]){_0x1ed095=_0x4bebb7[_0x0125('0x90')][_0x0125('0x91')](0x0,_0x4bebb7[_0x0125('0x90')][_0x0125('0x92')]('-'));if(this['agents'][_0x1ed095]){logger[_0x0125('0x24')](_0x0125('0x93'),_0x4bebb7[_0x0125('0x25')],_0x1ed095);this['agents'][_0x1ed095]['onhold']=!![];}}}}catch(_0x4f46dd){logger[_0x0125('0x38')]('[%s][voiceAgentReport][musiconholdstart]',_0x4bebb7[_0x0125('0x25')],util[_0x0125('0x28')](_0x4f46dd,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0125('0x21')][_0x0125('0x1c')]=function(_0x5468dd){var _0x41c35a='';try{if(this['isNotNull'](_0x5468dd)){logger['debug'](_0x0125('0x94'),_0x5468dd[_0x0125('0x25')],util[_0x0125('0x28')](_0x5468dd,{'showHidden':![],'depth':null}));if(_0x5468dd[_0x0125('0x90')]){_0x41c35a=_0x5468dd[_0x0125('0x90')]['substring'](0x0,_0x5468dd['channel'][_0x0125('0x92')]('-'));if(this['agents'][_0x41c35a]){logger[_0x0125('0x24')](_0x0125('0x95'),_0x5468dd[_0x0125('0x25')],_0x41c35a);this[_0x0125('0xd')][_0x41c35a][_0x0125('0x96')]=![];}}}}catch(_0x7756f6){logger[_0x0125('0x38')]('[%s][voiceAgentReport][musiconholdstop]',_0x5468dd['uniqueid'],util[_0x0125('0x28')](_0x7756f6,{'showHidden':![],'depth':null}));}};module[_0x0125('0x97')]=VoiceAgentReport;
\ No newline at end of file
index 584a7ca..bf26628 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x56f2=['type','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','routeid','ATTENDED','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfererchannel','transfereruniqueid','[%s][voiceCallReport][musiconholdstart]\x20event:','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','syncMusicOnHoldStop','[%s][voiceCallReport][musiconholdstop]\x20event:','mohstarttime','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','bluebird','path','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','unknown','inuse','busy','invalid','unavailable','ringinuse','set','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','BUSY','redis','defaults','localhost','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','actionCoreShowChannels','error','inspect','isUndefined','prototype','emit','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','uniqueid','linkedid','merge','keys','context','from-sip','channel','split','exten','xcally-motion-preview','connectedlinenum','user:%s','name','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','syncNewChannel','isNotNull','[%s][voiceCallReport][newchannel]\x20event:','info','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','format','YYYY-MM-DD\x20HH:mm:ss','disposition','channelstate','destconnectedlinenum','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','OutgoingSpoolFailed','application','toLowerCase','applicationdata','startsWith','CDR(routeAlias)','appdata','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','includes','lastapplication','match','queue','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','starttime','holdtime','diff','connectedlinename','toNumber','membername','routealias','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','monitorFilename','find','isNil','monitors','push','rec','[%s][voiceCallReport][mixMonitorFilename]','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','[%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','parse','sipcalllinkedid','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','resolve','then','transferType','isEmpty','getSettings','StopMixMonitor','catch','Action','destinationchannel','finally','webbar:stopmonitors','event'];(function(_0x109549,_0x5a7c70){var _0x44cfa6=function(_0x424e45){while(--_0x424e45){_0x109549['push'](_0x109549['shift']());}};_0x44cfa6(++_0x5a7c70);}(_0x56f2,0xe8));var _0x256f=function(_0xc073cd,_0x38e1ae){_0xc073cd=_0xc073cd-0x0;var _0x57616c=_0x56f2[_0xc073cd];return _0x57616c;};'use strict';var BPromise=require(_0x256f('0x0'));var _=require('lodash');var moment=require('moment');var util=require('util');var path=require(_0x256f('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x256f('0x2'))(_0x256f('0x3'));var ami=require(_0x256f('0x4'));var Channel=require(_0x256f('0x5'));var RpcSetting=require(_0x256f('0x6'));var statusDesc=[_0x256f('0x7'),'not_inuse',_0x256f('0x8'),_0x256f('0x9'),_0x256f('0xa'),_0x256f('0xb'),'ringing',_0x256f('0xc'),'onhold'];var applications=[_0x256f('0xd'),'queue',_0x256f('0xe'),_0x256f('0xf'),_0x256f('0x10'),_0x256f('0x11')];var dispositions=[_0x256f('0x12'),_0x256f('0x13'),_0x256f('0x13'),_0x256f('0x12'),'NO\x20ANSWER','NO\x20ANSWER','ANSWERED',_0x256f('0x14'),_0x256f('0x13'),_0x256f('0x13'),_0x256f('0x13')];var actions={};config[_0x256f('0x15')]=_[_0x256f('0x16')](config[_0x256f('0x15')],{'host':_0x256f('0x17'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x256f('0x15')]));function VoiceCallReport(_0x304e78){this[_0x256f('0x18')]=_0x304e78[_0x256f('0x18')];this[_0x256f('0x19')]=_0x304e78['agents'];this[_0x256f('0x1a')]={};ami['on'](_0x256f('0x1b'),this[_0x256f('0x1c')][_0x256f('0x1d')](this));ami['on'](_0x256f('0x1e'),this[_0x256f('0x1c')][_0x256f('0x1d')](this));ami['on']('newchannel',this['syncNewChannel']['bind'](this));ami['on'](_0x256f('0x1f'),this[_0x256f('0x20')][_0x256f('0x1d')](this));ami['on'](_0x256f('0x21'),this[_0x256f('0x22')]['bind'](this));ami['on'](_0x256f('0x23'),this[_0x256f('0x24')][_0x256f('0x1d')](this));ami['on'](_0x256f('0x25'),this['syncNewCallerId']['bind'](this));ami['on']('attendedtransfer',this[_0x256f('0x26')][_0x256f('0x1d')](this));ami['on'](_0x256f('0x27'),this[_0x256f('0x28')]['bind'](this));ami['on'](_0x256f('0x29'),this['syncMusicOnHoldStart']['bind'](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop'][_0x256f('0x1d')](this));try{logger['info']('[voiceCallReport][coreshowchannels]\x20started');ami[_0x256f('0x2a')]();}catch(_0x4b7f45){logger[_0x256f('0x2b')]('[voiceCallReport][coreshowchannels]',util[_0x256f('0x2c')](_0x4b7f45,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype']['isNotNull']=function(_0xcd2e4b){return _0xcd2e4b!==null&&!_[_0x256f('0x2d')](_0xcd2e4b);};VoiceCallReport[_0x256f('0x2e')][_0x256f('0x2f')]=function(_0x679a74,_0xc7fd58,_0x343d14){io['to'](_0x679a74)[_0x256f('0x2f')](_0xc7fd58,_0x343d14);};VoiceCallReport[_0x256f('0x2e')]['syncNewCallerId']=function(_0xd31de1){try{if(this['isNotNull'](_0xd31de1)){logger['info']('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0xd31de1['uniqueid'],_0xd31de1[_0x256f('0x30')],_0xd31de1[_0x256f('0x31')]);logger[_0x256f('0x32')](_0x256f('0x33'),_0xd31de1[_0x256f('0x34')],util[_0x256f('0x2c')](_0xd31de1,{'showHidden':![],'depth':null}));if(_0xd31de1[_0x256f('0x34')]===_0xd31de1[_0x256f('0x35')]){if(!_[_0x256f('0x2d')](this[_0x256f('0x18')][_0xd31de1[_0x256f('0x34')]])){_[_0x256f('0x36')](this[_0x256f('0x18')][_0xd31de1[_0x256f('0x34')]],_['pick'](_0xd31de1,_[_0x256f('0x37')](this[_0x256f('0x18')][_0xd31de1[_0x256f('0x34')]])));}}if(_0xd31de1[_0x256f('0x38')]===_0x256f('0x39')){if(this['agents'][_0xd31de1[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]]){if(_0xd31de1[_0x256f('0x3c')]==_0x256f('0x3d')){this['agents'][_0xd31de1[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]]['destconnectedlinenum']=_0xd31de1[_0x256f('0x3e')];this[_0x256f('0x2f')](util['format'](_0x256f('0x3f'),this[_0x256f('0x19')][_0xd31de1[_0x256f('0x3a')]['split']('-')[0x0]][_0x256f('0x40')]),_0x256f('0x41'),{'destaccountcode':this[_0x256f('0x19')][_0xd31de1[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]][_0x256f('0x42')],'destconnectedlinenum':_0xd31de1[_0x256f('0x3e')]});}}}}}catch(_0x304b3f){logger['error'](_0x256f('0x43'),_0xd31de1[_0x256f('0x34')],util['inspect'](_0x304b3f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x256f('0x2e')][_0x256f('0x44')]=function(_0x29cc86){try{if(this[_0x256f('0x45')](_0x29cc86)){logger[_0x256f('0x32')](_0x256f('0x46'),_0x29cc86[_0x256f('0x34')],util['inspect'](_0x29cc86,{'showHidden':![],'depth':null}));if(_0x29cc86[_0x256f('0x34')]===_0x29cc86[_0x256f('0x35')]&&_0x29cc86['channel']!='OutgoingSpoolFailed'){if(_['isUndefined'](this[_0x256f('0x18')][_0x29cc86[_0x256f('0x34')]])){logger[_0x256f('0x47')](_0x256f('0x48'),_0x29cc86['uniqueid'],_0x29cc86[_0x256f('0x38')],_0x29cc86[_0x256f('0x3c')]);this[_0x256f('0x18')][_0x29cc86[_0x256f('0x34')]]=new Channel();this['channels'][_0x29cc86['uniqueid']]['starttime']=moment()[_0x256f('0x49')](_0x256f('0x4a'));this[_0x256f('0x18')][_0x29cc86[_0x256f('0x34')]][_0x256f('0x4b')]=dispositions[_['toNumber'](_0x29cc86[_0x256f('0x4c')])];_[_0x256f('0x36')](this[_0x256f('0x18')][_0x29cc86['uniqueid']],_['pick'](_0x29cc86,_[_0x256f('0x37')](this[_0x256f('0x18')][_0x29cc86[_0x256f('0x34')]])));if(_0x29cc86[_0x256f('0x38')]===_0x256f('0x39')){if(this['agents'][_0x29cc86[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]]){if(_[_0x256f('0x2d')](this[_0x256f('0x19')][_0x29cc86[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]][_0x256f('0x4d')])){this[_0x256f('0x19')][_0x29cc86[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]][_0x256f('0x4d')]=_0x29cc86['exten'];logger['debug'](_0x256f('0x4e'),_0x29cc86['uniqueid'],util[_0x256f('0x2c')]({'destaccountcode':this[_0x256f('0x19')][_0x29cc86[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x29cc86[_0x256f('0x3c')]},{'showHidden':![],'depth':null}));this[_0x256f('0x2f')](util[_0x256f('0x49')]('user:%s',this[_0x256f('0x19')][_0x29cc86[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]][_0x256f('0x40')]),_0x256f('0x41'),{'destaccountcode':this['agents'][_0x29cc86['channel'][_0x256f('0x3b')]('-')[0x0]][_0x256f('0x42')],'destconnectedlinenum':_0x29cc86[_0x256f('0x3c')]});}}}}}}}catch(_0x20dd3b){logger[_0x256f('0x2b')](_0x256f('0x4f'),_0x29cc86[_0x256f('0x34')],util['inspect'](_0x20dd3b,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x256f('0x1c')]=function(_0x50cc96){try{if(this[_0x256f('0x45')](_0x50cc96)){logger[_0x256f('0x32')](_0x256f('0x50'),_0x50cc96['uniqueid'],util[_0x256f('0x2c')](_0x50cc96,{'showHidden':![],'depth':null}));if(_0x50cc96[_0x256f('0x34')]===_0x50cc96[_0x256f('0x35')]&&_0x50cc96[_0x256f('0x3c')]!='h'&&_0x50cc96[_0x256f('0x3a')]!=_0x256f('0x51')){_0x50cc96[_0x256f('0x52')]=_0x50cc96[_0x256f('0x52')][_0x256f('0x53')]();_0x50cc96[_0x256f('0x54')]=_0x50cc96['appdata']&&_0x50cc96['appdata'][_0x256f('0x55')](_0x256f('0x56'))?_0x50cc96[_0x256f('0x57')]:(_0x50cc96['appdata']||_0x50cc96['applicationdata'])['toLowerCase']();logger[_0x256f('0x47')](_0x256f('0x58'),_0x50cc96[_0x256f('0x34')],_0x50cc96[_0x256f('0x52')],_0x50cc96['applicationdata']);if(_[_0x256f('0x2d')](this[_0x256f('0x18')][_0x50cc96[_0x256f('0x34')]])){this[_0x256f('0x18')][_0x50cc96[_0x256f('0x34')]]=new Channel();this['channels'][_0x50cc96['uniqueid']]['starttime']=_0x50cc96[_0x256f('0x59')]?moment()[_0x256f('0x5a')](moment[_0x256f('0x59')](_0x50cc96[_0x256f('0x59')])[_0x256f('0x5b')](),_0x256f('0x5b'))['format'](_0x256f('0x4a')):moment()[_0x256f('0x49')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x256f('0x18')][_0x50cc96[_0x256f('0x34')]][_0x256f('0x4b')]='NO\x20ANSWER';}_[_0x256f('0x36')](this[_0x256f('0x18')][_0x50cc96[_0x256f('0x34')]],_['pick'](_0x50cc96,_[_0x256f('0x37')](this[_0x256f('0x18')][_0x50cc96[_0x256f('0x34')]])));if(_[_0x256f('0x5c')](applications,_0x50cc96[_0x256f('0x52')])){this['channels'][_0x50cc96[_0x256f('0x34')]][_0x256f('0x5d')]=_0x50cc96[_0x256f('0x52')];this[_0x256f('0x18')][_0x50cc96['uniqueid']]['lastdata']=_0x50cc96['applicationdata'];if(_0x50cc96['application']===_0x256f('0xd')&&_['startsWith'](_0x50cc96[_0x256f('0x54')][_0x256f('0x53')](),'cdr(')){var _0x47cf75=_0x50cc96[_0x256f('0x54')]['split']('=');var _0x5eacca=_0x47cf75[0x0][_0x256f('0x53')]()[_0x256f('0x5e')](/cdr\((.*)\)/);if(_0x5eacca){this[_0x256f('0x18')][_0x50cc96['uniqueid']][_0x5eacca[0x1]]=_0x47cf75[0x1];}}else if(_0x50cc96[_0x256f('0x52')]===_0x256f('0x5f')){this[_0x256f('0x18')][_0x50cc96[_0x256f('0x34')]]['queue']=_0x50cc96['applicationdata'][_0x256f('0x3b')](',')[0x0];}}}}}catch(_0x5b5c10){logger[_0x256f('0x2b')]('[%s][voiceCallReport][newexten]',_0x50cc96['uniqueid'],util['inspect'](_0x5b5c10,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x256f('0x20')]=function(_0x5c9a79){try{if(this[_0x256f('0x45')](_0x5c9a79)){logger[_0x256f('0x47')](_0x256f('0x60'),_0x5c9a79[_0x256f('0x34')],_0x5c9a79[_0x256f('0x35')],_0x5c9a79[_0x256f('0x30')],_0x5c9a79[_0x256f('0x31')]);logger['debug'](_0x256f('0x61'),_0x5c9a79[_0x256f('0x34')],util[_0x256f('0x2c')](_0x5c9a79,{'showHidden':![],'depth':null}));if(_0x5c9a79[_0x256f('0x34')]!==_0x5c9a79[_0x256f('0x35')]){if(this[_0x256f('0x18')][_0x5c9a79[_0x256f('0x35')]]){if(_0x5c9a79[_0x256f('0x4c')]==='6'){if(!this['channels'][_0x5c9a79[_0x256f('0x35')]]['answered']){var _0x1e1116=moment();this['channels'][_0x5c9a79['linkedid']][_0x256f('0x62')]=!![];this[_0x256f('0x18')][_0x5c9a79['linkedid']][_0x256f('0x63')]=_0x1e1116['format'](_0x256f('0x4a'));if(this[_0x256f('0x18')][_0x5c9a79[_0x256f('0x35')]][_0x256f('0x64')]){this[_0x256f('0x18')][_0x5c9a79['linkedid']][_0x256f('0x65')]=_0x1e1116[_0x256f('0x66')](this[_0x256f('0x18')][_0x5c9a79['linkedid']]['starttime'],_0x256f('0x5b'));}}this[_0x256f('0x18')][_0x5c9a79[_0x256f('0x35')]][_0x256f('0x35')]=_0x5c9a79[_0x256f('0x34')];if(_0x5c9a79[_0x256f('0x31')]!==_0x256f('0x3d')){this[_0x256f('0x18')][_0x5c9a79['linkedid']][_0x256f('0x3e')]=_0x5c9a79[_0x256f('0x31')];}this['channels'][_0x5c9a79[_0x256f('0x35')]][_0x256f('0x67')]=_0x5c9a79[_0x256f('0x30')];this['channels'][_0x5c9a79[_0x256f('0x35')]]['destinationchannel']=_0x5c9a79['channel'];this[_0x256f('0x18')][_0x5c9a79[_0x256f('0x35')]]['disposition']=dispositions[_[_0x256f('0x68')](_0x5c9a79[_0x256f('0x4c')])];if(this['agents'][_0x5c9a79[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]]){this[_0x256f('0x18')][_0x5c9a79['linkedid']]['UserId']=this['agents'][_0x5c9a79['channel'][_0x256f('0x3b')]('-')[0x0]]['id'];this['channels'][_0x5c9a79[_0x256f('0x35')]][_0x256f('0x69')]=this[_0x256f('0x19')][_0x5c9a79[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]]['name'];}}}}else{if(this[_0x256f('0x18')][_0x5c9a79['uniqueid']]){if(_0x5c9a79[_0x256f('0x4c')]==='6'){if(this[_0x256f('0x19')][_0x5c9a79['channel'][_0x256f('0x3b')]('-')[0x0]]){this[_0x256f('0x18')][_0x5c9a79[_0x256f('0x34')]]['UserId']=this['agents'][_0x5c9a79[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]]['id'];this[_0x256f('0x18')][_0x5c9a79[_0x256f('0x34')]]['membername']=this[_0x256f('0x19')][_0x5c9a79[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]][_0x256f('0x40')];}}}}if(_0x5c9a79[_0x256f('0x4c')]==='6'&&_0x5c9a79[_0x256f('0x38')]===_0x256f('0x39')){if(this[_0x256f('0x19')][_0x5c9a79[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]]){this[_0x256f('0x19')][_0x5c9a79[_0x256f('0x3a')]['split']('-')[0x0]]['destconnectedlinenum']=_0x5c9a79[_0x256f('0x3c')];var _0x219d51;if(this[_0x256f('0x18')][_0x5c9a79[_0x256f('0x34')]])_0x219d51=this[_0x256f('0x18')][_0x5c9a79[_0x256f('0x34')]][_0x256f('0x6a')];else if(this[_0x256f('0x18')][_0x5c9a79[_0x256f('0x35')]])_0x219d51=this['channels'][_0x5c9a79[_0x256f('0x35')]][_0x256f('0x6a')];logger[_0x256f('0x32')]('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x5c9a79['uniqueid'],util[_0x256f('0x2c')]({'destaccountcode':this['agents'][_0x5c9a79['channel']['split']('-')[0x0]][_0x256f('0x42')],'destconnectedlinenum':_0x5c9a79[_0x256f('0x3c')],'routealias':_0x219d51},{'showHidden':![],'depth':null}));this[_0x256f('0x2f')](util[_0x256f('0x49')](_0x256f('0x3f'),this[_0x256f('0x19')][_0x5c9a79[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]][_0x256f('0x40')]),_0x256f('0x41'),{'destaccountcode':this[_0x256f('0x19')][_0x5c9a79[_0x256f('0x3a')]['split']('-')[0x0]][_0x256f('0x42')],'destconnectedlinenum':_0x5c9a79[_0x256f('0x3c')],'routealias':_0x219d51});}}}}catch(_0x2057b7){logger[_0x256f('0x2b')](_0x256f('0x6b'),_0x5c9a79[_0x256f('0x34')],util[_0x256f('0x2c')](_0x2057b7,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x256f('0x2e')][_0x256f('0x6c')]=function(_0xc4279b,_0x4b2eb4){try{if(this[_0x256f('0x18')][_0xc4279b]){logger[_0x256f('0x47')](_0x256f('0x6d'),_0xc4279b,_0x4b2eb4);this['channels'][_0xc4279b][_0x256f('0x6e')]=!![];if(_[_0x256f('0x6f')](_0x4b2eb4,_0x256f('0x70'))){_0x4b2eb4=_0x4b2eb4[_0x256f('0x71')](_0x256f('0x70'),'.WAV');}this[_0x256f('0x18')][_0xc4279b][_0x256f('0x72')]=_0x4b2eb4;var _0x1e7ba2=_[_0x256f('0x73')](this[_0x256f('0x18')][_0xc4279b]['monitors'],{'filename':_0x4b2eb4});if(_[_0x256f('0x74')](_0x1e7ba2)){this[_0x256f('0x18')][_0xc4279b][_0x256f('0x75')][_0x256f('0x76')]({'filename':_0x4b2eb4,'createdAt':moment()['format'](_0x256f('0x4a')),'mixmonitorid':'','status':_0x256f('0x77')});}}}catch(_0x3da4cb){logger[_0x256f('0x2b')](_0x256f('0x78'),_0xc4279b,util[_0x256f('0x2c')](_0x3da4cb,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x256f('0x2e')]['syncVarSet']=function(_0xd68d4e){try{if(this[_0x256f('0x45')](_0xd68d4e)){logger[_0x256f('0x32')]('[%s][voiceCallReport][varset]\x20event:',_0xd68d4e['uniqueid'],util[_0x256f('0x2c')](_0xd68d4e,{'showHidden':![],'depth':null}));if(this[_0x256f('0x18')][_0xd68d4e['uniqueid']]&&_0xd68d4e[_0x256f('0x3a')]!=_0x256f('0x51')){if(this[_0x256f('0x45')](_0xd68d4e[_0x256f('0x79')])){if(this[_0x256f('0x45')](_0xd68d4e['variable'][_0x256f('0x7a')])){logger[_0x256f('0x47')](_0x256f('0x7b'),_0xd68d4e[_0x256f('0x34')],_0xd68d4e['value']);this[_0x256f('0x6c')](_0xd68d4e['uniqueid'],_0xd68d4e[_0x256f('0x7c')]);}else if(this['isNotNull'](_0xd68d4e[_0x256f('0x79')][_0x256f('0x7d')])){logger['info'](_0x256f('0x7e'),_0xd68d4e[_0x256f('0x34')],_0xd68d4e[_0x256f('0x7c')]);this[_0x256f('0x18')][_0xd68d4e[_0x256f('0x34')]][_0x256f('0x31')]=_0xd68d4e[_0x256f('0x7c')];}else if(this[_0x256f('0x45')](_0xd68d4e[_0x256f('0x79')][_0x256f('0x7f')])){logger[_0x256f('0x47')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s',_0xd68d4e[_0x256f('0x34')],_0xd68d4e[_0x256f('0x7c')]);this['channels'][_0xd68d4e[_0x256f('0x34')]][_0x256f('0x80')]=_0xd68d4e['value'];}else if(this['isNotNull'](_0xd68d4e[_0x256f('0x79')][_0x256f('0x81')])){logger[_0x256f('0x47')](_0x256f('0x82'),_0xd68d4e[_0x256f('0x34')],_0xd68d4e[_0x256f('0x7c')]);this[_0x256f('0x18')][_0xd68d4e[_0x256f('0x34')]]['type']=_0xd68d4e[_0x256f('0x7c')];}else if(this[_0x256f('0x45')](_0xd68d4e[_0x256f('0x79')][_0x256f('0x83')])){logger[_0x256f('0x47')](_0x256f('0x84'),_0xd68d4e[_0x256f('0x34')],_0xd68d4e[_0x256f('0x7c')]['split'](',')[0x0]);this[_0x256f('0x18')][_0xd68d4e[_0x256f('0x34')]][_0x256f('0x5f')]=_0xd68d4e[_0x256f('0x7c')]['split'](',')[0x0];}else if(this['isNotNull'](_0xd68d4e[_0x256f('0x79')][_0x256f('0x85')])){logger['info'](_0x256f('0x86'),_0xd68d4e[_0x256f('0x34')],_0xd68d4e[_0x256f('0x7c')]);this['channels'][_0xd68d4e[_0x256f('0x34')]]['originatecalleridnum']=_0xd68d4e[_0x256f('0x7c')];}else if(this['isNotNull'](_0xd68d4e[_0x256f('0x79')][_0x256f('0x87')])){logger[_0x256f('0x47')](_0x256f('0x88'),_0xd68d4e[_0x256f('0x34')],_0xd68d4e[_0x256f('0x7c')]);this[_0x256f('0x18')][_0xd68d4e['uniqueid']][_0x256f('0x89')]=_0xd68d4e[_0x256f('0x7c')];}else if(this[_0x256f('0x45')](_0xd68d4e[_0x256f('0x79')]['xmd-callerid-preview'])){logger[_0x256f('0x47')](_0x256f('0x8a'),_0xd68d4e[_0x256f('0x34')],_0xd68d4e[_0x256f('0x7c')]);this[_0x256f('0x18')][_0xd68d4e['uniqueid']][_0x256f('0x8b')]=_0xd68d4e[_0x256f('0x7c')];}else if(this[_0x256f('0x45')](_0xd68d4e['variable'][_0x256f('0x8c')])){logger[_0x256f('0x47')](_0x256f('0x8d'),_0xd68d4e['uniqueid'],_0xd68d4e['value']);this[_0x256f('0x18')][_0xd68d4e[_0x256f('0x34')]][_0x256f('0x5f')]=_0xd68d4e['value'];}else if(this[_0x256f('0x45')](_0xd68d4e[_0x256f('0x79')][_0x256f('0x8e')])){logger[_0x256f('0x47')](_0x256f('0x8f'),_0xd68d4e['uniqueid'],_0xd68d4e[_0x256f('0x7c')]);this[_0x256f('0x18')][_0xd68d4e[_0x256f('0x34')]][_0x256f('0x90')]=_0xd68d4e[_0x256f('0x7c')];}}}else if(this[_0x256f('0x45')](_0xd68d4e['variable'][_0x256f('0x7a')])){if(_0xd68d4e['value']){var _0xbec3bd=path[_0x256f('0x91')](_0xd68d4e[_0x256f('0x7c')])[_0x256f('0x40')];logger['info'](_0x256f('0x7b'),_0xbec3bd,_0xd68d4e['value']);this[_0x256f('0x6c')](_0xbec3bd,_0xd68d4e['value']);}}else if(this[_0x256f('0x18')][_0xd68d4e[_0x256f('0x35')]]){if(this['isNotNull'](_0xd68d4e[_0x256f('0x79')])){if(this[_0x256f('0x45')](_0xd68d4e[_0x256f('0x79')][_0x256f('0x8e')])){logger[_0x256f('0x47')](_0x256f('0x8f'),_0xd68d4e[_0x256f('0x35')],_0xd68d4e[_0x256f('0x7c')]);this[_0x256f('0x18')][_0xd68d4e[_0x256f('0x35')]][_0x256f('0x92')]=_0xd68d4e[_0x256f('0x7c')];}}}}}catch(_0x43df1c){logger[_0x256f('0x2b')]('[%s][voiceCallReport][varset]',_0xd68d4e[_0x256f('0x34')],util[_0x256f('0x2c')](_0x43df1c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x256f('0x2e')][_0x256f('0x24')]=function(_0x2fef04){try{if(this['isNotNull'](_0x2fef04)){logger[_0x256f('0x32')](_0x256f('0x93'),_0x2fef04[_0x256f('0x34')],util[_0x256f('0x2c')](_0x2fef04,{'showHidden':![],'depth':null}));if(this[_0x256f('0x18')][_0x2fef04['uniqueid']]){logger[_0x256f('0x47')](_0x256f('0x94'),_0x2fef04[_0x256f('0x34')],_0x2fef04[_0x256f('0x95')]);var _0x2be543=moment();this[_0x256f('0x18')][_0x2fef04[_0x256f('0x34')]][_0x256f('0x96')]=_0x2be543[_0x256f('0x49')](_0x256f('0x4a'));this['channels'][_0x2fef04['uniqueid']][_0x256f('0x59')]=_0x2be543[_0x256f('0x66')](this['channels'][_0x2fef04[_0x256f('0x34')]]['starttime'],_0x256f('0x5b'));if(this[_0x256f('0x18')][_0x2fef04[_0x256f('0x34')]]['answered']){this[_0x256f('0x18')][_0x2fef04[_0x256f('0x34')]][_0x256f('0x97')]=_0x2be543['diff'](this[_0x256f('0x18')][_0x2fef04[_0x256f('0x34')]][_0x256f('0x63')],_0x256f('0x5b'));this[_0x256f('0x18')][_0x2fef04[_0x256f('0x34')]][_0x256f('0x65')]=this['channels'][_0x2fef04['uniqueid']][_0x256f('0x59')]-this[_0x256f('0x18')][_0x2fef04[_0x256f('0x34')]]['billableseconds'];}if(_0x2fef04[_0x256f('0x38')]===_0x256f('0x39')){if(this[_0x256f('0x19')][_0x2fef04[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]]){this[_0x256f('0x19')][_0x2fef04[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]]=_['omit'](this[_0x256f('0x19')][_0x2fef04[_0x256f('0x3a')]['split']('-')[0x0]],['destconnectedlinenum']);logger['debug'](_0x256f('0x98'),_0x2fef04[_0x256f('0x34')],util[_0x256f('0x2c')]({'id':this[_0x256f('0x19')][_0x2fef04[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]]['id'],'destaccountcode':this[_0x256f('0x19')][_0x2fef04[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]][_0x256f('0x42')]},{'showHidden':![],'depth':null}));this[_0x256f('0x2f')](util[_0x256f('0x49')]('user:%s',this['agents'][_0x2fef04[_0x256f('0x3a')]['split']('-')[0x0]][_0x256f('0x40')]),_0x256f('0x99'),{'id':this['agents'][_0x2fef04['channel'][_0x256f('0x3b')]('-')[0x0]]['id'],'destaccountcode':this[_0x256f('0x19')][_0x2fef04[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]][_0x256f('0x42')]});}}var _0x72153b=this;Promise[_0x256f('0x9a')]()[_0x256f('0x9b')](function(){var _0x56df51=_0x72153b['channels'][_0x2fef04[_0x256f('0x34')]];if(typeof _0x56df51[_0x256f('0x9c')]==='undefined')return;if(_[_0x256f('0x9d')](_0x56df51[_0x256f('0x75')]))return;return RpcSetting[_0x256f('0x9e')]()[_0x256f('0x9b')](function(_0x413875){if(!_0x413875['stopRecordingOnTransfer'])return;return Promise['resolve']()[_0x256f('0x9b')](function(){return ami['Action']({'action':_0x256f('0x9f'),'channel':_0x56df51[_0x256f('0x3a')]})[_0x256f('0xa0')](function(){});})['then'](function(){return ami[_0x256f('0xa1')]({'action':_0x256f('0x9f'),'channel':_0x56df51[_0x256f('0xa2')]})[_0x256f('0xa0')](function(){})[_0x256f('0xa3')](function(){var _0x4a2842=_0x72153b[_0x256f('0x19')][_0x56df51['destinationchannel'][_0x256f('0x3b')]('-')[0x0]];if(!_0x4a2842)return;io[_0x256f('0x2f')](_0x256f('0xa4'),{'agentId':_0x4a2842['id'],'uniqueid':_0x56df51[_0x256f('0x34')]});});});});})[_0x256f('0x9b')](function(){if(_0x2fef04[_0x256f('0xa5')]==='BlindTransfer'){_0x72153b['blindTransfers'][_0x2fef04[_0x256f('0x34')]]=_0x72153b[_0x256f('0x18')][_0x2fef04['uniqueid']];}else{if(_0x72153b['channels'][_0x2fef04['uniqueid']][_0x256f('0xa6')]===_0x256f('0xa7')&&_0x72153b[_0x256f('0x1a')][_0x2fef04['uniqueid']]){_0x72153b[_0x256f('0x18')][_0x2fef04[_0x256f('0x34')]][_0x256f('0x34')]=[_0x72153b[_0x256f('0x18')][_0x2fef04[_0x256f('0x34')]][_0x256f('0x35')],_0x72153b[_0x256f('0x18')][_0x2fef04[_0x256f('0x34')]][_0x256f('0x35')]=_0x72153b[_0x256f('0x18')][_0x2fef04[_0x256f('0x34')]][_0x256f('0x34')]][0x0];delete _0x72153b[_0x256f('0x1a')][_0x2fef04[_0x256f('0x34')]];}}logger[_0x256f('0x32')](_0x256f('0xa8'),_0x2fef04[_0x256f('0x34')],util['inspect'](_0x72153b['channels'][_0x2fef04[_0x256f('0x34')]],{'showHidden':![],'depth':null}));ami[_0x256f('0x2f')](_0x256f('0xa9'),_0x72153b[_0x256f('0x18')][_0x2fef04[_0x256f('0x34')]]);delete _0x72153b[_0x256f('0x18')][_0x2fef04[_0x256f('0x34')]];});}}}catch(_0x2bca24){logger['error']('[%s][voiceCallReport][hangup]',_0x2fef04[_0x256f('0x34')],util[_0x256f('0x2c')](_0x2bca24,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x256f('0x2e')][_0x256f('0x26')]=function(_0x4746d4){try{if(this[_0x256f('0x45')](_0x4746d4)){logger[_0x256f('0x47')](_0x256f('0xaa'),_0x4746d4[_0x256f('0x34')],_0x4746d4['origtransferercalleridnum'],_0x4746d4[_0x256f('0xab')]);logger[_0x256f('0x32')](_0x256f('0xac'),_0x4746d4[_0x256f('0x34')],util[_0x256f('0x2c')](_0x4746d4,{'showHidden':![],'depth':null}));if(this[_0x256f('0x18')][_0x4746d4[_0x256f('0xad')]]){this[_0x256f('0x18')][_0x4746d4['transfereeuniqueid']][_0x256f('0xae')]=_0x4746d4[_0x256f('0xaf')];this[_0x256f('0x18')][_0x4746d4[_0x256f('0xad')]][_0x256f('0xb0')]=_0x4746d4[_0x256f('0xab')];if(this[_0x256f('0x18')][_0x4746d4[_0x256f('0xb1')]]){var _0x5e7a86=this[_0x256f('0x18')][_0x4746d4[_0x256f('0xb1')]];this[_0x256f('0x18')][_0x4746d4[_0x256f('0xb1')]]=this[_0x256f('0x18')][_0x4746d4[_0x256f('0xad')]];this['channels'][_0x4746d4['transfereeuniqueid']]=_0x5e7a86;}}else if(this['channels'][_0x4746d4[_0x256f('0xb2')]]){this[_0x256f('0x18')][_0x4746d4['transfertargetuniqueid']][_0x256f('0xae')]=_0x4746d4[_0x256f('0xaf')];this['channels'][_0x4746d4['transfertargetuniqueid']][_0x256f('0xb0')]=_0x4746d4[_0x256f('0xab')];if(this['channels'][_0x4746d4[_0x256f('0xb3')]]){var _0x5e7a86=this[_0x256f('0x18')][_0x4746d4[_0x256f('0xb3')]];this[_0x256f('0x18')][_0x4746d4[_0x256f('0xb3')]]=this['channels'][_0x4746d4['transfertargetuniqueid']];this[_0x256f('0x18')][_0x4746d4[_0x256f('0xb2')]]=_0x5e7a86;}}if((this[_0x256f('0x18')][_0x4746d4[_0x256f('0xb3')]]||this[_0x256f('0x18')][_0x4746d4[_0x256f('0xb4')]])&&this[_0x256f('0x18')][_0x4746d4[_0x256f('0xb1')]]){var _0x4bb270=_[_0x256f('0xb5')]([this[_0x256f('0x18')][_0x4746d4[_0x256f('0xb3')]],this[_0x256f('0x18')][_0x4746d4[_0x256f('0xb4')]],this[_0x256f('0x18')][_0x4746d4[_0x256f('0xb1')]]],function(_0x452ee4){return _0x452ee4&&_0x452ee4[_0x256f('0xa6')]===_0x256f('0xa7')&&_0x452ee4[_0x256f('0xb6')];});if(_0x4bb270){if(this[_0x256f('0x18')][_0x4746d4[_0x256f('0xb3')]])this[_0x256f('0x18')][_0x4746d4['origtransfereruniqueid']][_0x256f('0x9c')]=_0x256f('0xb7');if(this[_0x256f('0x18')][_0x4746d4[_0x256f('0xb4')]])this[_0x256f('0x18')][_0x4746d4[_0x256f('0xb4')]][_0x256f('0x9c')]=_0x256f('0xb7');this[_0x256f('0x18')][_0x4746d4[_0x256f('0xb1')]][_0x256f('0x9c')]=_0x256f('0xb7');}}}}catch(_0x2b8ad7){logger[_0x256f('0x2b')]('[%s][voiceCallReport][attendedtransfer]',_0x4746d4['uniqueid'],util['inspect'](_0x2b8ad7,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x256f('0x2e')]['syncBlindTransfer']=function(_0x542efa){try{if(this[_0x256f('0x45')](_0x542efa)){logger[_0x256f('0x47')](_0x256f('0xb8'),_0x542efa['uniqueid'],_0x542efa['transfereecalleridnum'],_0x542efa[_0x256f('0xb9')]);logger['debug'](_0x256f('0xba'),_0x542efa[_0x256f('0x34')],util[_0x256f('0x2c')](_0x542efa,{'showHidden':![],'depth':null}));if(this['channels'][_0x542efa[_0x256f('0xad')]]){this[_0x256f('0x18')][_0x542efa['transfereeuniqueid']][_0x256f('0xae')]=_0x542efa['transfereecalleridnum'];this['channels'][_0x542efa[_0x256f('0xad')]]['transferconnectedlinenum']=_0x542efa['extension'];this['channels'][_0x542efa[_0x256f('0xad')]][_0x256f('0x9c')]=_0x256f('0xbb');this[_0x256f('0x24')]({'event':'BlindTransfer','uniqueid':_0x542efa['transfereeuniqueid'],'context':_0x542efa[_0x256f('0x38')],'channel':_0x542efa[_0x256f('0xbc')]});}else{this[_0x256f('0x18')][_0x542efa[_0x256f('0xbd')]][_0x256f('0x9c')]=_0x256f('0xbb');}}}catch(_0xbf44b8){logger[_0x256f('0x2b')]('[%s][voiceCallReport][blindtransfer]',_0x542efa[_0x256f('0x34')],util[_0x256f('0x2c')](_0xbf44b8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x256f('0x2e')]['syncMusicOnHoldStart']=function(_0x3cd240){try{if(this['isNotNull'](_0x3cd240)){logger[_0x256f('0x32')](_0x256f('0xbe'),_0x3cd240['uniqueid'],util[_0x256f('0x2c')](_0x3cd240,{'showHidden':![],'depth':null}));if(this['channels'][_0x3cd240[_0x256f('0x34')]]){if(!_[_0x256f('0x74')](this[_0x256f('0x18')][_0x3cd240[_0x256f('0x34')]][_0x256f('0x63')])){this[_0x256f('0x18')][_0x3cd240['uniqueid']]['mohstarttime']=moment()['format'](_0x256f('0x4a'));logger['info'](_0x256f('0xbf'),_0x3cd240[_0x256f('0x34')],this['channels'][_0x3cd240[_0x256f('0x34')]]['mohstarttime']);}}}}catch(_0x2df722){logger[_0x256f('0x2b')](_0x256f('0xc0'),_0x3cd240[_0x256f('0x34')],util['inspect'](_0x2df722,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x256f('0xc1')]=function(_0x20762b){try{if(this[_0x256f('0x45')](_0x20762b)){logger[_0x256f('0x32')](_0x256f('0xc2'),_0x20762b[_0x256f('0x34')],util['inspect'](_0x20762b,{'showHidden':![],'depth':null}));if(this[_0x256f('0x18')][_0x20762b[_0x256f('0x34')]]){if(!_[_0x256f('0x74')](this[_0x256f('0x18')][_0x20762b['uniqueid']][_0x256f('0xc3')])){this[_0x256f('0x18')][_0x20762b[_0x256f('0x34')]][_0x256f('0xc4')]+=moment()[_0x256f('0xc5')](0x0)[_0x256f('0x66')](this['channels'][_0x20762b['uniqueid']][_0x256f('0xc3')],_0x256f('0x5b'));logger[_0x256f('0x47')](_0x256f('0xc6'),_0x20762b[_0x256f('0x34')],this[_0x256f('0x18')][_0x20762b['uniqueid']][_0x256f('0xc4')]);delete this[_0x256f('0x18')][_0x20762b[_0x256f('0x34')]][_0x256f('0xc3')];}}}}catch(_0x532bf7){logger[_0x256f('0x2b')]('[%s][voiceCallReport][musiconholdstop]',_0x20762b['uniqueid'],util['inspect'](_0x532bf7,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport;
\ No newline at end of file
+var _0x8620=['[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','endtime','billableseconds','user:agentcomplete','resolve','then','transferType','isEmpty','getSettings','stopRecordingOnTransfer','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','event','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','some','origtransfererlinkedid','routeid','ATTENDED','syncBlindTransfer','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','BLIND','transfererchannel','transfereruniqueid','syncMusicOnHoldStart','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','exports','lodash','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','unknown','not_inuse','inuse','busy','invalid','ringing','onhold','set','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','BUSY','localhost','socket.io-emitter','redis','channels','agents','blindTransfers','syncNewExten','bind','newexten','newchannel','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','musiconholdstart','musiconholdstop','actionCoreShowChannels','inspect','prototype','isNotNull','isUndefined','emit','info','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','merge','keys','context','from-sip','split','exten','destconnectedlinenum','connectedlinenum','format','user:%s','channel','name','error','syncNewChannel','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','YYYY-MM-DD\x20HH:mm:ss','disposition','channelstate','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','user:agentconnect','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','starttime','duration','subtract','seconds','pick','includes','lastapplication','lastdata','cdr(','match','queue','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridname','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','diff','xcally-motion-preview','connectedlinename','toNumber','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','syncMixMonitorFilename','monitor','replace','.wav49','monitorFilename','isNil','monitors','push','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','value','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','mixmonitor_filename','parse','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','sipcallid','sipcalllinkedid'];(function(_0x4ec356,_0x3763df){var _0x5b18e6=function(_0xbd7ba5){while(--_0xbd7ba5){_0x4ec356['push'](_0x4ec356['shift']());}};_0x5b18e6(++_0x3763df);}(_0x8620,0x1c7));var _0x0862=function(_0x57ecad,_0x1027e5){_0x57ecad=_0x57ecad-0x0;var _0x471d7c=_0x8620[_0x57ecad];return _0x471d7c;};'use strict';var BPromise=require('bluebird');var _=require(_0x0862('0x0'));var moment=require('moment');var util=require(_0x0862('0x1'));var path=require('path');var Redis=require(_0x0862('0x2'));var config=require(_0x0862('0x3'));var logger=require(_0x0862('0x4'))(_0x0862('0x5'));var ami=require(_0x0862('0x6'));var Channel=require(_0x0862('0x7'));var RpcSetting=require(_0x0862('0x8'));var statusDesc=[_0x0862('0x9'),_0x0862('0xa'),_0x0862('0xb'),_0x0862('0xc'),_0x0862('0xd'),'unavailable',_0x0862('0xe'),'ringinuse',_0x0862('0xf')];var applications=[_0x0862('0x10'),'queue',_0x0862('0x11'),_0x0862('0x12'),_0x0862('0x13'),_0x0862('0x14')];var dispositions=[_0x0862('0x15'),_0x0862('0x16'),'FAILED',_0x0862('0x15'),'NO\x20ANSWER',_0x0862('0x15'),'ANSWERED',_0x0862('0x17'),'FAILED',_0x0862('0x16'),_0x0862('0x16')];var actions={};config['redis']=_['defaults'](config['redis'],{'host':_0x0862('0x18'),'port':0x18eb});var io=require(_0x0862('0x19'))(new Redis(config[_0x0862('0x1a')]));function VoiceCallReport(_0x5ac489){this[_0x0862('0x1b')]=_0x5ac489[_0x0862('0x1b')];this['agents']=_0x5ac489[_0x0862('0x1c')];this[_0x0862('0x1d')]={};ami['on']('coreshowchannel',this[_0x0862('0x1e')][_0x0862('0x1f')](this));ami['on'](_0x0862('0x20'),this[_0x0862('0x1e')][_0x0862('0x1f')](this));ami['on'](_0x0862('0x21'),this['syncNewChannel'][_0x0862('0x1f')](this));ami['on'](_0x0862('0x22'),this[_0x0862('0x23')][_0x0862('0x1f')](this));ami['on'](_0x0862('0x24'),this[_0x0862('0x25')][_0x0862('0x1f')](this));ami['on'](_0x0862('0x26'),this[_0x0862('0x27')][_0x0862('0x1f')](this));ami['on']('newcallerid',this[_0x0862('0x28')][_0x0862('0x1f')](this));ami['on'](_0x0862('0x29'),this[_0x0862('0x2a')][_0x0862('0x1f')](this));ami['on'](_0x0862('0x2b'),this['syncBlindTransfer'][_0x0862('0x1f')](this));ami['on'](_0x0862('0x2c'),this['syncMusicOnHoldStart'][_0x0862('0x1f')](this));ami['on'](_0x0862('0x2d'),this['syncMusicOnHoldStop']['bind'](this));try{logger['info']('[voiceCallReport][coreshowchannels]\x20started');ami[_0x0862('0x2e')]();}catch(_0x3af219){logger['error']('[voiceCallReport][coreshowchannels]',util[_0x0862('0x2f')](_0x3af219,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x0862('0x30')][_0x0862('0x31')]=function(_0x45c8c2){return _0x45c8c2!==null&&!_[_0x0862('0x32')](_0x45c8c2);};VoiceCallReport['prototype']['emit']=function(_0xb3d3b9,_0x1e2142,_0x1c856c){io['to'](_0xb3d3b9)[_0x0862('0x33')](_0x1e2142,_0x1c856c);};VoiceCallReport[_0x0862('0x30')][_0x0862('0x28')]=function(_0x2112ba){try{if(this[_0x0862('0x31')](_0x2112ba)){logger[_0x0862('0x34')](_0x0862('0x35'),_0x2112ba[_0x0862('0x36')],_0x2112ba['calleridname'],_0x2112ba[_0x0862('0x37')]);logger[_0x0862('0x38')](_0x0862('0x39'),_0x2112ba[_0x0862('0x36')],util[_0x0862('0x2f')](_0x2112ba,{'showHidden':![],'depth':null}));if(_0x2112ba['uniqueid']===_0x2112ba[_0x0862('0x3a')]){if(!_['isUndefined'](this[_0x0862('0x1b')][_0x2112ba['uniqueid']])){_[_0x0862('0x3b')](this['channels'][_0x2112ba[_0x0862('0x36')]],_['pick'](_0x2112ba,_[_0x0862('0x3c')](this['channels'][_0x2112ba['uniqueid']])));}}if(_0x2112ba[_0x0862('0x3d')]===_0x0862('0x3e')){if(this[_0x0862('0x1c')][_0x2112ba['channel'][_0x0862('0x3f')]('-')[0x0]]){if(_0x2112ba[_0x0862('0x40')]=='xcally-motion-preview'){this['agents'][_0x2112ba['channel'][_0x0862('0x3f')]('-')[0x0]][_0x0862('0x41')]=_0x2112ba[_0x0862('0x42')];this[_0x0862('0x33')](util[_0x0862('0x43')](_0x0862('0x44'),this['agents'][_0x2112ba[_0x0862('0x45')][_0x0862('0x3f')]('-')[0x0]][_0x0862('0x46')]),'user:agentconnect',{'destaccountcode':this['agents'][_0x2112ba['channel'][_0x0862('0x3f')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x2112ba[_0x0862('0x42')]});}}}}}catch(_0x4619a6){logger[_0x0862('0x47')]('[%s][voiceCallReport][newcallerid]',_0x2112ba['uniqueid'],util[_0x0862('0x2f')](_0x4619a6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0862('0x30')][_0x0862('0x48')]=function(_0x4ac126){try{if(this[_0x0862('0x31')](_0x4ac126)){logger[_0x0862('0x38')](_0x0862('0x49'),_0x4ac126[_0x0862('0x36')],util[_0x0862('0x2f')](_0x4ac126,{'showHidden':![],'depth':null}));if(_0x4ac126[_0x0862('0x36')]===_0x4ac126[_0x0862('0x3a')]&&_0x4ac126['channel']!=_0x0862('0x4a')){if(_['isUndefined'](this['channels'][_0x4ac126['uniqueid']])){logger[_0x0862('0x34')](_0x0862('0x4b'),_0x4ac126['uniqueid'],_0x4ac126[_0x0862('0x3d')],_0x4ac126[_0x0862('0x40')]);this[_0x0862('0x1b')][_0x4ac126[_0x0862('0x36')]]=new Channel();this[_0x0862('0x1b')][_0x4ac126[_0x0862('0x36')]]['starttime']=moment()[_0x0862('0x43')](_0x0862('0x4c'));this[_0x0862('0x1b')][_0x4ac126[_0x0862('0x36')]][_0x0862('0x4d')]=dispositions[_['toNumber'](_0x4ac126[_0x0862('0x4e')])];_['merge'](this[_0x0862('0x1b')][_0x4ac126[_0x0862('0x36')]],_['pick'](_0x4ac126,_[_0x0862('0x3c')](this[_0x0862('0x1b')][_0x4ac126['uniqueid']])));if(_0x4ac126['context']===_0x0862('0x3e')){if(this[_0x0862('0x1c')][_0x4ac126['channel']['split']('-')[0x0]]){if(_['isUndefined'](this[_0x0862('0x1c')][_0x4ac126[_0x0862('0x45')]['split']('-')[0x0]][_0x0862('0x41')])){this[_0x0862('0x1c')][_0x4ac126[_0x0862('0x45')][_0x0862('0x3f')]('-')[0x0]][_0x0862('0x41')]=_0x4ac126[_0x0862('0x40')];logger[_0x0862('0x38')](_0x0862('0x4f'),_0x4ac126[_0x0862('0x36')],util['inspect']({'destaccountcode':this['agents'][_0x4ac126[_0x0862('0x45')][_0x0862('0x3f')]('-')[0x0]][_0x0862('0x50')],'destconnectedlinenum':_0x4ac126[_0x0862('0x40')]},{'showHidden':![],'depth':null}));this[_0x0862('0x33')](util['format'](_0x0862('0x44'),this['agents'][_0x4ac126['channel']['split']('-')[0x0]][_0x0862('0x46')]),_0x0862('0x51'),{'destaccountcode':this[_0x0862('0x1c')][_0x4ac126[_0x0862('0x45')][_0x0862('0x3f')]('-')[0x0]][_0x0862('0x50')],'destconnectedlinenum':_0x4ac126[_0x0862('0x40')]});}}}}}}}catch(_0x36d9a1){logger[_0x0862('0x47')](_0x0862('0x52'),_0x4ac126[_0x0862('0x36')],util[_0x0862('0x2f')](_0x36d9a1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0862('0x30')]['syncNewExten']=function(_0x447536){try{if(this[_0x0862('0x31')](_0x447536)){logger[_0x0862('0x38')](_0x0862('0x53'),_0x447536[_0x0862('0x36')],util[_0x0862('0x2f')](_0x447536,{'showHidden':![],'depth':null}));if(_0x447536[_0x0862('0x36')]===_0x447536[_0x0862('0x3a')]&&_0x447536['exten']!='h'&&_0x447536[_0x0862('0x45')]!=_0x0862('0x4a')){_0x447536[_0x0862('0x54')]=_0x447536[_0x0862('0x54')][_0x0862('0x55')]();_0x447536[_0x0862('0x56')]=_0x447536[_0x0862('0x57')]&&_0x447536[_0x0862('0x57')][_0x0862('0x58')](_0x0862('0x59'))?_0x447536['appdata']:(_0x447536[_0x0862('0x57')]||_0x447536[_0x0862('0x56')])['toLowerCase']();logger[_0x0862('0x34')]('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0x447536[_0x0862('0x36')],_0x447536[_0x0862('0x54')],_0x447536[_0x0862('0x56')]);if(_[_0x0862('0x32')](this[_0x0862('0x1b')][_0x447536[_0x0862('0x36')]])){this[_0x0862('0x1b')][_0x447536[_0x0862('0x36')]]=new Channel();this[_0x0862('0x1b')][_0x447536[_0x0862('0x36')]][_0x0862('0x5a')]=_0x447536[_0x0862('0x5b')]?moment()[_0x0862('0x5c')](moment[_0x0862('0x5b')](_0x447536['duration'])[_0x0862('0x5d')](),'seconds')['format'](_0x0862('0x4c')):moment()[_0x0862('0x43')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x447536[_0x0862('0x36')]]['disposition']='NO\x20ANSWER';}_[_0x0862('0x3b')](this[_0x0862('0x1b')][_0x447536[_0x0862('0x36')]],_[_0x0862('0x5e')](_0x447536,_[_0x0862('0x3c')](this['channels'][_0x447536[_0x0862('0x36')]])));if(_[_0x0862('0x5f')](applications,_0x447536[_0x0862('0x54')])){this['channels'][_0x447536[_0x0862('0x36')]][_0x0862('0x60')]=_0x447536[_0x0862('0x54')];this[_0x0862('0x1b')][_0x447536[_0x0862('0x36')]][_0x0862('0x61')]=_0x447536['applicationdata'];if(_0x447536[_0x0862('0x54')]==='set'&&_[_0x0862('0x58')](_0x447536[_0x0862('0x56')][_0x0862('0x55')](),_0x0862('0x62'))){var _0x33c8e3=_0x447536[_0x0862('0x56')][_0x0862('0x3f')]('=');var _0xd9a0a0=_0x33c8e3[0x0][_0x0862('0x55')]()[_0x0862('0x63')](/cdr\((.*)\)/);if(_0xd9a0a0){this[_0x0862('0x1b')][_0x447536[_0x0862('0x36')]][_0xd9a0a0[0x1]]=_0x33c8e3[0x1];}}else if(_0x447536[_0x0862('0x54')]===_0x0862('0x64')){this[_0x0862('0x1b')][_0x447536[_0x0862('0x36')]][_0x0862('0x64')]=_0x447536['applicationdata'][_0x0862('0x3f')](',')[0x0];}}}}}catch(_0x2bfb77){logger[_0x0862('0x47')]('[%s][voiceCallReport][newexten]',_0x447536[_0x0862('0x36')],util[_0x0862('0x2f')](_0x2bfb77,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0862('0x30')][_0x0862('0x23')]=function(_0x497963){try{if(this['isNotNull'](_0x497963)){logger[_0x0862('0x34')](_0x0862('0x65'),_0x497963[_0x0862('0x36')],_0x497963[_0x0862('0x3a')],_0x497963[_0x0862('0x66')],_0x497963[_0x0862('0x37')]);logger[_0x0862('0x38')](_0x0862('0x67'),_0x497963[_0x0862('0x36')],util[_0x0862('0x2f')](_0x497963,{'showHidden':![],'depth':null}));if(_0x497963[_0x0862('0x36')]!==_0x497963['linkedid']){if(this[_0x0862('0x1b')][_0x497963[_0x0862('0x3a')]]){if(_0x497963[_0x0862('0x4e')]==='6'){if(!this[_0x0862('0x1b')][_0x497963[_0x0862('0x3a')]]['answered']){var _0x25589b=moment();this[_0x0862('0x1b')][_0x497963[_0x0862('0x3a')]][_0x0862('0x68')]=!![];this[_0x0862('0x1b')][_0x497963['linkedid']][_0x0862('0x69')]=_0x25589b[_0x0862('0x43')](_0x0862('0x4c'));if(this[_0x0862('0x1b')][_0x497963[_0x0862('0x3a')]][_0x0862('0x5a')]){this[_0x0862('0x1b')][_0x497963[_0x0862('0x3a')]][_0x0862('0x6a')]=_0x25589b[_0x0862('0x6b')](this[_0x0862('0x1b')][_0x497963['linkedid']][_0x0862('0x5a')],_0x0862('0x5d'));}}this[_0x0862('0x1b')][_0x497963[_0x0862('0x3a')]]['linkedid']=_0x497963[_0x0862('0x36')];if(_0x497963[_0x0862('0x37')]!==_0x0862('0x6c')){this[_0x0862('0x1b')][_0x497963[_0x0862('0x3a')]][_0x0862('0x42')]=_0x497963[_0x0862('0x37')];}this[_0x0862('0x1b')][_0x497963[_0x0862('0x3a')]][_0x0862('0x6d')]=_0x497963[_0x0862('0x66')];this['channels'][_0x497963['linkedid']]['destinationchannel']=_0x497963['channel'];this[_0x0862('0x1b')][_0x497963[_0x0862('0x3a')]]['disposition']=dispositions[_[_0x0862('0x6e')](_0x497963[_0x0862('0x4e')])];if(this[_0x0862('0x1c')][_0x497963['channel'][_0x0862('0x3f')]('-')[0x0]]){this[_0x0862('0x1b')][_0x497963[_0x0862('0x3a')]][_0x0862('0x6f')]=this[_0x0862('0x1c')][_0x497963[_0x0862('0x45')][_0x0862('0x3f')]('-')[0x0]]['id'];this[_0x0862('0x1b')][_0x497963['linkedid']][_0x0862('0x70')]=this[_0x0862('0x1c')][_0x497963[_0x0862('0x45')][_0x0862('0x3f')]('-')[0x0]]['name'];}}}}else{if(this[_0x0862('0x1b')][_0x497963[_0x0862('0x36')]]){if(_0x497963[_0x0862('0x4e')]==='6'){if(this[_0x0862('0x1c')][_0x497963['channel'][_0x0862('0x3f')]('-')[0x0]]){this[_0x0862('0x1b')][_0x497963[_0x0862('0x36')]][_0x0862('0x6f')]=this[_0x0862('0x1c')][_0x497963['channel']['split']('-')[0x0]]['id'];this[_0x0862('0x1b')][_0x497963[_0x0862('0x36')]][_0x0862('0x70')]=this[_0x0862('0x1c')][_0x497963['channel'][_0x0862('0x3f')]('-')[0x0]]['name'];}}}}if(_0x497963[_0x0862('0x4e')]==='6'&&_0x497963[_0x0862('0x3d')]===_0x0862('0x3e')){if(this[_0x0862('0x1c')][_0x497963[_0x0862('0x45')][_0x0862('0x3f')]('-')[0x0]]){this[_0x0862('0x1c')][_0x497963[_0x0862('0x45')]['split']('-')[0x0]]['destconnectedlinenum']=_0x497963[_0x0862('0x40')];var _0x53779f;if(this[_0x0862('0x1b')][_0x497963[_0x0862('0x36')]])_0x53779f=this['channels'][_0x497963[_0x0862('0x36')]][_0x0862('0x71')];else if(this[_0x0862('0x1b')][_0x497963[_0x0862('0x3a')]])_0x53779f=this[_0x0862('0x1b')][_0x497963[_0x0862('0x3a')]][_0x0862('0x71')];logger[_0x0862('0x38')](_0x0862('0x72'),_0x497963['uniqueid'],util[_0x0862('0x2f')]({'destaccountcode':this[_0x0862('0x1c')][_0x497963[_0x0862('0x45')][_0x0862('0x3f')]('-')[0x0]][_0x0862('0x50')],'destconnectedlinenum':_0x497963[_0x0862('0x40')],'routealias':_0x53779f},{'showHidden':![],'depth':null}));this[_0x0862('0x33')](util[_0x0862('0x43')]('user:%s',this[_0x0862('0x1c')][_0x497963['channel'][_0x0862('0x3f')]('-')[0x0]][_0x0862('0x46')]),_0x0862('0x51'),{'destaccountcode':this[_0x0862('0x1c')][_0x497963['channel'][_0x0862('0x3f')]('-')[0x0]][_0x0862('0x50')],'destconnectedlinenum':_0x497963[_0x0862('0x40')],'routealias':_0x53779f});}}}}catch(_0x5aa717){logger[_0x0862('0x47')]('[%s][voiceCallReport][newstate]',_0x497963[_0x0862('0x36')],util[_0x0862('0x2f')](_0x5aa717,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0862('0x30')][_0x0862('0x73')]=function(_0x4c3e1d,_0x3266a3){try{if(this[_0x0862('0x1b')][_0x4c3e1d]){logger[_0x0862('0x34')]('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x4c3e1d,_0x3266a3);this[_0x0862('0x1b')][_0x4c3e1d][_0x0862('0x74')]=!![];if(_['endsWith'](_0x3266a3,'.wav49')){_0x3266a3=_0x3266a3[_0x0862('0x75')](_0x0862('0x76'),'.WAV');}this[_0x0862('0x1b')][_0x4c3e1d][_0x0862('0x77')]=_0x3266a3;var _0x33d5e7=_['find'](this[_0x0862('0x1b')][_0x4c3e1d]['monitors'],{'filename':_0x3266a3});if(_[_0x0862('0x78')](_0x33d5e7)){this[_0x0862('0x1b')][_0x4c3e1d][_0x0862('0x79')][_0x0862('0x7a')]({'filename':_0x3266a3,'createdAt':moment()[_0x0862('0x43')](_0x0862('0x4c')),'mixmonitorid':'','status':'rec'});}}}catch(_0xf7522b){logger[_0x0862('0x47')](_0x0862('0x7b'),_0x4c3e1d,util[_0x0862('0x2f')](_0xf7522b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0862('0x30')][_0x0862('0x25')]=function(_0xc650e0){try{if(this[_0x0862('0x31')](_0xc650e0)){logger[_0x0862('0x38')](_0x0862('0x7c'),_0xc650e0[_0x0862('0x36')],util[_0x0862('0x2f')](_0xc650e0,{'showHidden':![],'depth':null}));if(this[_0x0862('0x1b')][_0xc650e0[_0x0862('0x36')]]&&_0xc650e0[_0x0862('0x45')]!=_0x0862('0x4a')){if(this[_0x0862('0x31')](_0xc650e0[_0x0862('0x7d')])){if(this[_0x0862('0x31')](_0xc650e0[_0x0862('0x7d')]['mixmonitor_filename'])){logger[_0x0862('0x34')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0xc650e0[_0x0862('0x36')],_0xc650e0[_0x0862('0x7e')]);this[_0x0862('0x73')](_0xc650e0[_0x0862('0x36')],_0xc650e0['value']);}else if(this[_0x0862('0x31')](_0xc650e0['variable']['xmd-phone'])){logger[_0x0862('0x34')](_0x0862('0x7f'),_0xc650e0[_0x0862('0x36')],_0xc650e0[_0x0862('0x7e')]);this[_0x0862('0x1b')][_0xc650e0[_0x0862('0x36')]][_0x0862('0x37')]=_0xc650e0[_0x0862('0x7e')];}else if(this[_0x0862('0x31')](_0xc650e0[_0x0862('0x7d')][_0x0862('0x80')])){logger['info'](_0x0862('0x81'),_0xc650e0[_0x0862('0x36')],_0xc650e0[_0x0862('0x7e')]);this[_0x0862('0x1b')][_0xc650e0[_0x0862('0x36')]][_0x0862('0x82')]=_0xc650e0['value'];}else if(this[_0x0862('0x31')](_0xc650e0[_0x0862('0x7d')][_0x0862('0x83')])){logger[_0x0862('0x34')](_0x0862('0x84'),_0xc650e0[_0x0862('0x36')],_0xc650e0[_0x0862('0x7e')]);this[_0x0862('0x1b')][_0xc650e0['uniqueid']][_0x0862('0x85')]=_0xc650e0['value'];}else if(this['isNotNull'](_0xc650e0['variable']['xmd-queue'])){logger['info'](_0x0862('0x86'),_0xc650e0['uniqueid'],_0xc650e0['value'][_0x0862('0x3f')](',')[0x0]);this['channels'][_0xc650e0['uniqueid']][_0x0862('0x64')]=_0xc650e0[_0x0862('0x7e')][_0x0862('0x3f')](',')[0x0];}else if(this[_0x0862('0x31')](_0xc650e0['variable'][_0x0862('0x87')])){logger[_0x0862('0x34')](_0x0862('0x88'),_0xc650e0[_0x0862('0x36')],_0xc650e0['value']);this['channels'][_0xc650e0[_0x0862('0x36')]][_0x0862('0x89')]=_0xc650e0[_0x0862('0x7e')];}else if(this['isNotNull'](_0xc650e0[_0x0862('0x7d')][_0x0862('0x8a')])){logger[_0x0862('0x34')](_0x0862('0x8b'),_0xc650e0[_0x0862('0x36')],_0xc650e0[_0x0862('0x7e')]);this[_0x0862('0x1b')][_0xc650e0['uniqueid']]['destination']=_0xc650e0[_0x0862('0x7e')];}else if(this[_0x0862('0x31')](_0xc650e0[_0x0862('0x7d')][_0x0862('0x8c')])){logger[_0x0862('0x34')](_0x0862('0x8d'),_0xc650e0[_0x0862('0x36')],_0xc650e0[_0x0862('0x7e')]);this[_0x0862('0x1b')][_0xc650e0[_0x0862('0x36')]][_0x0862('0x8e')]=_0xc650e0['value'];}else if(this['isNotNull'](_0xc650e0[_0x0862('0x7d')][_0x0862('0x8f')])){logger[_0x0862('0x34')](_0x0862('0x90'),_0xc650e0[_0x0862('0x36')],_0xc650e0[_0x0862('0x7e')]);this[_0x0862('0x1b')][_0xc650e0['uniqueid']][_0x0862('0x64')]=_0xc650e0[_0x0862('0x7e')];}else if(this[_0x0862('0x31')](_0xc650e0[_0x0862('0x7d')]['sipcallid'])){logger[_0x0862('0x34')](_0x0862('0x91'),_0xc650e0[_0x0862('0x36')],_0xc650e0[_0x0862('0x7e')]);this[_0x0862('0x1b')][_0xc650e0['uniqueid']]['sipcalluniqueid']=_0xc650e0[_0x0862('0x7e')];}}}else if(this[_0x0862('0x31')](_0xc650e0['variable'][_0x0862('0x92')])){if(_0xc650e0[_0x0862('0x7e')]){var _0x65912a=path[_0x0862('0x93')](_0xc650e0[_0x0862('0x7e')])[_0x0862('0x46')];logger[_0x0862('0x34')](_0x0862('0x94'),_0x65912a,_0xc650e0['value']);this[_0x0862('0x73')](_0x65912a,_0xc650e0[_0x0862('0x7e')]);}}else if(this[_0x0862('0x1b')][_0xc650e0[_0x0862('0x3a')]]){if(this[_0x0862('0x31')](_0xc650e0[_0x0862('0x7d')])){if(this['isNotNull'](_0xc650e0[_0x0862('0x7d')][_0x0862('0x95')])){logger[_0x0862('0x34')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0xc650e0[_0x0862('0x3a')],_0xc650e0[_0x0862('0x7e')]);this[_0x0862('0x1b')][_0xc650e0['linkedid']][_0x0862('0x96')]=_0xc650e0[_0x0862('0x7e')];}}}}}catch(_0x439327){logger['error'](_0x0862('0x97'),_0xc650e0[_0x0862('0x36')],util['inspect'](_0x439327,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0862('0x30')][_0x0862('0x27')]=function(_0x3451d0){try{if(this['isNotNull'](_0x3451d0)){logger[_0x0862('0x38')](_0x0862('0x98'),_0x3451d0['uniqueid'],util['inspect'](_0x3451d0,{'showHidden':![],'depth':null}));if(this[_0x0862('0x1b')][_0x3451d0['uniqueid']]){logger[_0x0862('0x34')](_0x0862('0x99'),_0x3451d0[_0x0862('0x36')],_0x3451d0['cause-txt']);var _0x3a8eee=moment();this[_0x0862('0x1b')][_0x3451d0[_0x0862('0x36')]][_0x0862('0x9a')]=_0x3a8eee['format'](_0x0862('0x4c'));this['channels'][_0x3451d0['uniqueid']][_0x0862('0x5b')]=_0x3a8eee[_0x0862('0x6b')](this[_0x0862('0x1b')][_0x3451d0['uniqueid']][_0x0862('0x5a')],_0x0862('0x5d'));if(this[_0x0862('0x1b')][_0x3451d0['uniqueid']][_0x0862('0x68')]){this[_0x0862('0x1b')][_0x3451d0[_0x0862('0x36')]][_0x0862('0x9b')]=_0x3a8eee[_0x0862('0x6b')](this[_0x0862('0x1b')][_0x3451d0[_0x0862('0x36')]][_0x0862('0x69')],_0x0862('0x5d'));this[_0x0862('0x1b')][_0x3451d0['uniqueid']]['holdtime']=this[_0x0862('0x1b')][_0x3451d0[_0x0862('0x36')]][_0x0862('0x5b')]-this[_0x0862('0x1b')][_0x3451d0['uniqueid']][_0x0862('0x9b')];}if(_0x3451d0['context']===_0x0862('0x3e')){if(this['agents'][_0x3451d0[_0x0862('0x45')][_0x0862('0x3f')]('-')[0x0]]){this[_0x0862('0x1c')][_0x3451d0[_0x0862('0x45')][_0x0862('0x3f')]('-')[0x0]]=_['omit'](this['agents'][_0x3451d0[_0x0862('0x45')][_0x0862('0x3f')]('-')[0x0]],[_0x0862('0x41')]);logger[_0x0862('0x38')]('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x3451d0[_0x0862('0x36')],util[_0x0862('0x2f')]({'id':this[_0x0862('0x1c')][_0x3451d0[_0x0862('0x45')][_0x0862('0x3f')]('-')[0x0]]['id'],'destaccountcode':this[_0x0862('0x1c')][_0x3451d0['channel'][_0x0862('0x3f')]('-')[0x0]][_0x0862('0x50')]},{'showHidden':![],'depth':null}));this[_0x0862('0x33')](util[_0x0862('0x43')]('user:%s',this[_0x0862('0x1c')][_0x3451d0[_0x0862('0x45')]['split']('-')[0x0]][_0x0862('0x46')]),_0x0862('0x9c'),{'id':this[_0x0862('0x1c')][_0x3451d0[_0x0862('0x45')][_0x0862('0x3f')]('-')[0x0]]['id'],'destaccountcode':this[_0x0862('0x1c')][_0x3451d0[_0x0862('0x45')][_0x0862('0x3f')]('-')[0x0]][_0x0862('0x50')]});}}var _0x11f2f3=this;Promise[_0x0862('0x9d')]()[_0x0862('0x9e')](function(){var _0x19df61=_0x11f2f3[_0x0862('0x1b')][_0x3451d0[_0x0862('0x36')]];if(typeof _0x19df61[_0x0862('0x9f')]==='undefined')return;if(_[_0x0862('0xa0')](_0x19df61['monitors']))return;return RpcSetting[_0x0862('0xa1')]()[_0x0862('0x9e')](function(_0x6e28d){if(!_0x6e28d[_0x0862('0xa2')])return;return Promise[_0x0862('0x9d')]()['then'](function(){return ami[_0x0862('0xa3')]({'action':_0x0862('0xa4'),'channel':_0x19df61['channel']})['catch'](function(){});})[_0x0862('0x9e')](function(){return ami['Action']({'action':'StopMixMonitor','channel':_0x19df61['destinationchannel']})[_0x0862('0xa5')](function(){})[_0x0862('0xa6')](function(){var _0x12b064=_0x11f2f3[_0x0862('0x1c')][_0x19df61['destinationchannel']['split']('-')[0x0]];if(!_0x12b064)return;io['emit'](_0x0862('0xa7'),{'agentId':_0x12b064['id'],'uniqueid':_0x19df61[_0x0862('0x36')]});});});});})['then'](function(){if(_0x3451d0[_0x0862('0xa8')]==='BlindTransfer'){_0x11f2f3[_0x0862('0x1d')][_0x3451d0[_0x0862('0x36')]]=_0x11f2f3[_0x0862('0x1b')][_0x3451d0[_0x0862('0x36')]];}else{if(_0x11f2f3[_0x0862('0x1b')][_0x3451d0[_0x0862('0x36')]][_0x0862('0x85')]===_0x0862('0xa9')&&_0x11f2f3[_0x0862('0x1d')][_0x3451d0[_0x0862('0x36')]]){_0x11f2f3['channels'][_0x3451d0[_0x0862('0x36')]][_0x0862('0x36')]=[_0x11f2f3['channels'][_0x3451d0[_0x0862('0x36')]][_0x0862('0x3a')],_0x11f2f3[_0x0862('0x1b')][_0x3451d0[_0x0862('0x36')]]['linkedid']=_0x11f2f3[_0x0862('0x1b')][_0x3451d0['uniqueid']][_0x0862('0x36')]][0x0];delete _0x11f2f3[_0x0862('0x1d')][_0x3451d0[_0x0862('0x36')]];}}logger[_0x0862('0x38')](_0x0862('0xaa'),_0x3451d0[_0x0862('0x36')],util[_0x0862('0x2f')](_0x11f2f3[_0x0862('0x1b')][_0x3451d0[_0x0862('0x36')]],{'showHidden':![],'depth':null}));ami[_0x0862('0x33')](_0x0862('0xab'),_0x11f2f3[_0x0862('0x1b')][_0x3451d0[_0x0862('0x36')]]);delete _0x11f2f3[_0x0862('0x1b')][_0x3451d0[_0x0862('0x36')]];});}}}catch(_0x4e2077){logger[_0x0862('0x47')](_0x0862('0xac'),_0x3451d0[_0x0862('0x36')],util['inspect'](_0x4e2077,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0862('0x30')][_0x0862('0x2a')]=function(_0x581141){try{if(this[_0x0862('0x31')](_0x581141)){logger[_0x0862('0x34')](_0x0862('0xad'),_0x581141[_0x0862('0x36')],_0x581141[_0x0862('0xae')],_0x581141['transfertargetcalleridnum']);logger['debug'](_0x0862('0xaf'),_0x581141['uniqueid'],util[_0x0862('0x2f')](_0x581141,{'showHidden':![],'depth':null}));if(this['channels'][_0x581141[_0x0862('0xb0')]]){this['channels'][_0x581141[_0x0862('0xb0')]][_0x0862('0xb1')]=_0x581141[_0x0862('0xae')];this[_0x0862('0x1b')][_0x581141[_0x0862('0xb0')]][_0x0862('0xb2')]=_0x581141[_0x0862('0xb3')];if(this[_0x0862('0x1b')][_0x581141['secondtransfereruniqueid']]){var _0x418f0c=this['channels'][_0x581141['secondtransfereruniqueid']];this[_0x0862('0x1b')][_0x581141[_0x0862('0xb4')]]=this[_0x0862('0x1b')][_0x581141[_0x0862('0xb0')]];this[_0x0862('0x1b')][_0x581141[_0x0862('0xb0')]]=_0x418f0c;}}else if(this[_0x0862('0x1b')][_0x581141['transfertargetuniqueid']]){this[_0x0862('0x1b')][_0x581141['transfertargetuniqueid']][_0x0862('0xb1')]=_0x581141[_0x0862('0xae')];this[_0x0862('0x1b')][_0x581141[_0x0862('0xb5')]][_0x0862('0xb2')]=_0x581141['transfertargetcalleridnum'];if(this[_0x0862('0x1b')][_0x581141['origtransfereruniqueid']]){var _0x418f0c=this[_0x0862('0x1b')][_0x581141['origtransfereruniqueid']];this[_0x0862('0x1b')][_0x581141[_0x0862('0xb6')]]=this[_0x0862('0x1b')][_0x581141[_0x0862('0xb5')]];this[_0x0862('0x1b')][_0x581141[_0x0862('0xb5')]]=_0x418f0c;}}if((this[_0x0862('0x1b')][_0x581141[_0x0862('0xb6')]]||this[_0x0862('0x1b')][_0x581141['origtransfererlinkedid']])&&this[_0x0862('0x1b')][_0x581141[_0x0862('0xb4')]]){var _0x3cfea9=_[_0x0862('0xb7')]([this[_0x0862('0x1b')][_0x581141[_0x0862('0xb6')]],this[_0x0862('0x1b')][_0x581141[_0x0862('0xb8')]],this['channels'][_0x581141[_0x0862('0xb4')]]],function(_0x419865){return _0x419865&&_0x419865[_0x0862('0x85')]==='outbound'&&_0x419865[_0x0862('0xb9')];});if(_0x3cfea9){if(this[_0x0862('0x1b')][_0x581141[_0x0862('0xb6')]])this[_0x0862('0x1b')][_0x581141[_0x0862('0xb6')]][_0x0862('0x9f')]=_0x0862('0xba');if(this[_0x0862('0x1b')][_0x581141[_0x0862('0xb8')]])this[_0x0862('0x1b')][_0x581141[_0x0862('0xb8')]][_0x0862('0x9f')]='ATTENDED';this[_0x0862('0x1b')][_0x581141[_0x0862('0xb4')]][_0x0862('0x9f')]=_0x0862('0xba');}}}}catch(_0x3dd38d){logger[_0x0862('0x47')]('[%s][voiceCallReport][attendedtransfer]',_0x581141[_0x0862('0x36')],util['inspect'](_0x3dd38d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0862('0x30')][_0x0862('0xbb')]=function(_0x5b4944){try{if(this[_0x0862('0x31')](_0x5b4944)){logger[_0x0862('0x34')](_0x0862('0xbc'),_0x5b4944[_0x0862('0x36')],_0x5b4944[_0x0862('0xbd')],_0x5b4944[_0x0862('0xbe')]);logger[_0x0862('0x38')]('[%s][voiceCallReport][blindtransfer]\x20event:',_0x5b4944['uniqueid'],util['inspect'](_0x5b4944,{'showHidden':![],'depth':null}));if(this['channels'][_0x5b4944[_0x0862('0xb0')]]){this['channels'][_0x5b4944[_0x0862('0xb0')]][_0x0862('0xb1')]=_0x5b4944['transfereecalleridnum'];this['channels'][_0x5b4944[_0x0862('0xb0')]][_0x0862('0xb2')]=_0x5b4944[_0x0862('0xbe')];this[_0x0862('0x1b')][_0x5b4944['transfereeuniqueid']][_0x0862('0x9f')]=_0x0862('0xbf');this['syncHangup']({'event':'BlindTransfer','uniqueid':_0x5b4944[_0x0862('0xb0')],'context':_0x5b4944[_0x0862('0x3d')],'channel':_0x5b4944[_0x0862('0xc0')]});}else{this[_0x0862('0x1b')][_0x5b4944[_0x0862('0xc1')]]['transferType']='BLIND';}}}catch(_0x2d9495){logger['error']('[%s][voiceCallReport][blindtransfer]',_0x5b4944[_0x0862('0x36')],util[_0x0862('0x2f')](_0x2d9495,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0862('0x30')][_0x0862('0xc2')]=function(_0xae14ec){try{if(this[_0x0862('0x31')](_0xae14ec)){logger[_0x0862('0x38')](_0x0862('0xc3'),_0xae14ec['uniqueid'],util[_0x0862('0x2f')](_0xae14ec,{'showHidden':![],'depth':null}));if(this[_0x0862('0x1b')][_0xae14ec[_0x0862('0x36')]]){if(!_[_0x0862('0x78')](this[_0x0862('0x1b')][_0xae14ec[_0x0862('0x36')]]['answertime'])){this['channels'][_0xae14ec['uniqueid']]['mohstarttime']=moment()[_0x0862('0x43')](_0x0862('0x4c'));logger[_0x0862('0x34')]('[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s',_0xae14ec[_0x0862('0x36')],this[_0x0862('0x1b')][_0xae14ec[_0x0862('0x36')]][_0x0862('0xc4')]);}}}}catch(_0x304099){logger['error']('[%s][voiceCallReport][musiconholdstart]',_0xae14ec['uniqueid'],util[_0x0862('0x2f')](_0x304099,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0862('0x30')]['syncMusicOnHoldStop']=function(_0x1d06e3){try{if(this[_0x0862('0x31')](_0x1d06e3)){logger['debug'](_0x0862('0xc5'),_0x1d06e3[_0x0862('0x36')],util[_0x0862('0x2f')](_0x1d06e3,{'showHidden':![],'depth':null}));if(this[_0x0862('0x1b')][_0x1d06e3[_0x0862('0x36')]]){if(!_[_0x0862('0x78')](this['channels'][_0x1d06e3[_0x0862('0x36')]][_0x0862('0xc4')])){this[_0x0862('0x1b')][_0x1d06e3[_0x0862('0x36')]][_0x0862('0xc6')]+=moment()[_0x0862('0xc7')](0x0)[_0x0862('0x6b')](this[_0x0862('0x1b')][_0x1d06e3[_0x0862('0x36')]]['mohstarttime'],_0x0862('0x5d'));logger[_0x0862('0x34')](_0x0862('0xc8'),_0x1d06e3['uniqueid'],this['channels'][_0x1d06e3[_0x0862('0x36')]][_0x0862('0xc6')]);delete this[_0x0862('0x1b')][_0x1d06e3[_0x0862('0x36')]]['mohstarttime'];}}}}catch(_0x24c049){logger[_0x0862('0x47')]('[%s][voiceCallReport][musiconholdstop]',_0x1d06e3['uniqueid'],util[_0x0862('0x2f')](_0x24c049,{'showHidden':![],'depth':null}));}};module[_0x0862('0xc9')]=VoiceCallReport;
\ No newline at end of file
index 291d813..8ee032e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb57d=['membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','info','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','duration','diff','complete','total','answered','seconds','billableseconds','sumHoldTime','holdtime','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','toLowerCase','set','applicationdata','appdata','startsWith','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','[%s][voiceDialReport][newexten]','exports','lodash','moment','util','ioredis','../../../config/logger','ami','../ami','defaults','redis','localhost','socket.io-emitter','channels','outbound','applications','dialbegin','bind','syncDialEnd','varset','syncVarSet','newexten','syncNewExten','hangup','syncHangup','isNotNull','prototype','emit','syncDialBegin','debug','[%s][voiceDialReport][dialbegin]\x20event:','inspect','uniqueid','merge','format','substring','channel','lastIndexOf','omit','event','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','YYYY-MM-DD\x20HH:mm:ss','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','error','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','keys','variable','outboundrouteid','isUndefined','value','variables','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','addVariable','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid'];(function(_0x33368a,_0x132fe3){var _0x4713ff=function(_0x5da8ef){while(--_0x5da8ef){_0x33368a['push'](_0x33368a['shift']());}};_0x4713ff(++_0x132fe3);}(_0xb57d,0xa5));var _0xdb57=function(_0x6fa8f9,_0x5d48d2){_0x6fa8f9=_0x6fa8f9-0x0;var _0x39b579=_0xb57d[_0x6fa8f9];return _0x39b579;};'use strict';var _=require(_0xdb57('0x0'));var moment=require(_0xdb57('0x1'));var util=require(_0xdb57('0x2'));var Redis=require(_0xdb57('0x3'));var config=require('../../../config/environment');var logger=require(_0xdb57('0x4'))(_0xdb57('0x5'));var ami=require(_0xdb57('0x6'));config['redis']=_[_0xdb57('0x7')](config[_0xdb57('0x8')],{'host':_0xdb57('0x9'),'port':0x18eb});var io=require(_0xdb57('0xa'))(new Redis(config[_0xdb57('0x8')]));function VoiceDialReport(_0x4f494a){this[_0xdb57('0xb')]=_0x4f494a['outboundChannels'];this[_0xdb57('0xc')]=_0x4f494a['outbound'];this[_0xdb57('0xd')]={};this['variables']={};ami['on'](_0xdb57('0xe'),this['syncDialBegin'][_0xdb57('0xf')](this));ami['on']('dialend',this[_0xdb57('0x10')][_0xdb57('0xf')](this));ami['on'](_0xdb57('0x11'),this[_0xdb57('0x12')][_0xdb57('0xf')](this));ami['on'](_0xdb57('0x13'),this[_0xdb57('0x14')][_0xdb57('0xf')](this));ami['on'](_0xdb57('0x15'),this[_0xdb57('0x16')][_0xdb57('0xf')](this));}VoiceDialReport['prototype'][_0xdb57('0x17')]=function(_0x3dcb05){return _0x3dcb05!==null&&!_['isUndefined'](_0x3dcb05);};VoiceDialReport[_0xdb57('0x18')][_0xdb57('0x19')]=function(_0x4bb4f,_0x267258,_0x1be55a){io['to'](_0x4bb4f)[_0xdb57('0x19')](_0x267258,_0x1be55a);};VoiceDialReport[_0xdb57('0x18')][_0xdb57('0x1a')]=function(_0x28200b){try{if(this[_0xdb57('0x17')](_0x28200b)){logger[_0xdb57('0x1b')](_0xdb57('0x1c'),_0x28200b['uniqueid'],util[_0xdb57('0x1d')](_0x28200b,{'showHidden':![],'depth':null}));if(this[_0xdb57('0xb')][_0x28200b[_0xdb57('0x1e')]]){_[_0xdb57('0x1f')](this[_0xdb57('0xb')][_0x28200b['uniqueid']],{'starttime':moment()[_0xdb57('0x20')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':'called','interface':_0x28200b['channel'][_0xdb57('0x21')](0x0,_0x28200b[_0xdb57('0x22')][_0xdb57('0x23')]('-')),'membername':_0x28200b[_0xdb57('0x22')][_0xdb57('0x21')](_0x28200b['channel']['lastIndexOf']('/')+0x1,_0x28200b[_0xdb57('0x22')]['lastIndexOf']('-'))},_[_0xdb57('0x24')](_0x28200b,[_0xdb57('0x25'),'privilege']));logger['info'](_0xdb57('0x26'),_0x28200b[_0xdb57('0x1e')],this[_0xdb57('0xb')][_0x28200b[_0xdb57('0x1e')]][_0xdb57('0x27')],this[_0xdb57('0xb')][_0x28200b[_0xdb57('0x1e')]]['interface']);logger[_0xdb57('0x1b')]('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x28200b[_0xdb57('0x1e')],util[_0xdb57('0x1d')](this[_0xdb57('0xb')][_0x28200b[_0xdb57('0x1e')]],{'showHidden':![],'depth':null}));if(this[_0xdb57('0xd')][_0x28200b['uniqueid']])_[_0xdb57('0x1f')](this[_0xdb57('0xb')][_0x28200b[_0xdb57('0x1e')]],this[_0xdb57('0xd')][_0x28200b[_0xdb57('0x1e')]]);this[_0xdb57('0x19')](_0xdb57('0x28'),_0xdb57('0x29'),this[_0xdb57('0xb')][_0x28200b['uniqueid']]);logger['debug'](_0xdb57('0x2a'),_0x28200b[_0xdb57('0x1e')],util[_0xdb57('0x1d')](this[_0xdb57('0xb')][_0x28200b[_0xdb57('0x1e')]],{'showHidden':![],'depth':null}));ami[_0xdb57('0x19')](_0xdb57('0x2b'),this[_0xdb57('0xb')][_0x28200b[_0xdb57('0x1e')]]);}}}catch(_0x56642c){logger['error']('[%s][voiceDialReport][dialbegin]',_0x28200b['uniqueid'],util[_0xdb57('0x1d')](_0x56642c,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xdb57('0x18')][_0xdb57('0x10')]=function(_0x56735c){try{if(this[_0xdb57('0x17')](_0x56735c)){logger[_0xdb57('0x1b')](_0xdb57('0x2c'),_0x56735c[_0xdb57('0x1e')],util['inspect'](_0x56735c,{'showHidden':![],'depth':null}));if(this[_0xdb57('0xb')][_0x56735c[_0xdb57('0x1e')]]){this[_0xdb57('0xb')][_0x56735c[_0xdb57('0x1e')]][_0xdb57('0x2d')]=_0x56735c[_0xdb57('0x2d')];if(_0x56735c['dialstatus']===_0xdb57('0x2e')){this['channels'][_0x56735c[_0xdb57('0x1e')]][_0xdb57('0x2f')]=_0x56735c[_0xdb57('0x2f')];this[_0xdb57('0xb')][_0x56735c[_0xdb57('0x1e')]][_0xdb57('0x30')]=_0x56735c[_0xdb57('0x30')];this[_0xdb57('0xb')][_0x56735c[_0xdb57('0x1e')]][_0xdb57('0x31')]=moment()[_0xdb57('0x20')](_0xdb57('0x32'));this[_0xdb57('0xb')][_0x56735c[_0xdb57('0x1e')]][_0xdb57('0x33')]=_0xdb57('0x34');logger['info'](_0xdb57('0x35'),_0x56735c['uniqueid'],_0x56735c[_0xdb57('0x22')]['substring'](_0x56735c['channel']['lastIndexOf']('/')+0x1,_0x56735c[_0xdb57('0x22')]['lastIndexOf']('-')));logger[_0xdb57('0x1b')](_0xdb57('0x36'),_0x56735c[_0xdb57('0x1e')],util[_0xdb57('0x1d')](this['channels'][_0x56735c[_0xdb57('0x1e')]],{'showHidden':![],'depth':null}));ami[_0xdb57('0x19')]('custom:dialconnect',this[_0xdb57('0xb')][_0x56735c[_0xdb57('0x1e')]]);}logger['debug'](_0xdb57('0x37'),_0x56735c[_0xdb57('0x1e')],util[_0xdb57('0x1d')](this[_0xdb57('0xb')][_0x56735c[_0xdb57('0x1e')]],{'showHidden':![],'depth':null}));this[_0xdb57('0x19')](_0xdb57('0x28'),'voice_outbound_channel:save',this[_0xdb57('0xb')][_0x56735c[_0xdb57('0x1e')]]);}}}catch(_0x2e49f7){logger[_0xdb57('0x38')](_0xdb57('0x39'),_0x56735c[_0xdb57('0x1e')],util['inspect'](_0x2e49f7,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xdb57('0x18')][_0xdb57('0x12')]=function(_0x134df6){try{if(this[_0xdb57('0x17')](_0x134df6)){logger[_0xdb57('0x1b')](_0xdb57('0x3a'),_0x134df6[_0xdb57('0x1e')],util[_0xdb57('0x1d')](_0x134df6,{'showHidden':![],'depth':null}));this['addVariable'](_0x134df6[_0xdb57('0x1e')],_[_0xdb57('0x3b')](_0x134df6[_0xdb57('0x3c')])[0x0],_0x134df6['value']);if(this[_0xdb57('0x17')](_0x134df6[_0xdb57('0x3c')])&&this['isNotNull'](_0x134df6[_0xdb57('0x3c')][_0xdb57('0x3d')])){if(_[_0xdb57('0x3e')](this['channels'][_0x134df6[_0xdb57('0x1e')]])){this[_0xdb57('0xb')][_0x134df6[_0xdb57('0x1e')]]={'routeId':_0x134df6[_0xdb57('0x3f')],'variables':this[_0xdb57('0x40')][_0x134df6[_0xdb57('0x1e')]],'motionChannel':_0xdb57('0x41')};logger['info'](_0xdb57('0x42'),_0x134df6[_0xdb57('0x1e')],_0x134df6[_0xdb57('0x3c')][_0xdb57('0x3d')],_[_0xdb57('0x3b')](_0x134df6[_0xdb57('0x3c')])[0x0],_0x134df6[_0xdb57('0x3f')]);logger[_0xdb57('0x1b')](_0xdb57('0x43'),_0x134df6[_0xdb57('0x1e')],util[_0xdb57('0x1d')](this[_0xdb57('0xb')][_0x134df6[_0xdb57('0x1e')]],{'showHidden':![],'depth':null}));this['emit'](_0xdb57('0x28'),_0xdb57('0x29'),this[_0xdb57('0xb')][_0x134df6['uniqueid']]);}}}}catch(_0x539182){logger[_0xdb57('0x38')](_0xdb57('0x44'),_0x134df6[_0xdb57('0x1e')],util[_0xdb57('0x1d')](_0x539182,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xdb57('0x18')][_0xdb57('0x45')]=function(_0x544009,_0x45d770,_0x5cf8ca){var _0x236f41=['rtpaudioqos',_0xdb57('0x46'),_0xdb57('0x47'),'rtpaudioqosjitterbridged','rtpaudioqosloss',_0xdb57('0x48'),'rtpaudioqosrtt','rtpaudioqosrttbridged',_0xdb57('0x49'),_0xdb57('0x4a'),_0xdb57('0x4b'),_0xdb57('0x4c'),_0xdb57('0x4d'),_0xdb57('0x4e'),'memberinterface',_0xdb57('0x4f'),_0xdb57('0x27'),_0xdb57('0x50'),_0xdb57('0x51')];if(!_[_0xdb57('0x52')](_0x45d770)&&!_[_0xdb57('0x53')](_0x236f41,_0x45d770)){if(_[_0xdb57('0x3e')](this['variables'][_0x544009])){this[_0xdb57('0x40')][_0x544009]={};}this[_0xdb57('0x40')][_0x544009][_0x45d770]=_0x5cf8ca;}};VoiceDialReport[_0xdb57('0x18')][_0xdb57('0x16')]=function(_0x3e9a64){try{if(this['isNotNull'](_0x3e9a64)){logger[_0xdb57('0x1b')](_0xdb57('0x54'),_0x3e9a64[_0xdb57('0x1e')],util[_0xdb57('0x1d')](_0x3e9a64,{'showHidden':![],'depth':null}));if(this[_0xdb57('0xb')][_0x3e9a64['uniqueid']]){logger[_0xdb57('0x55')](_0xdb57('0x56'),_0x3e9a64[_0xdb57('0x1e')],_0x3e9a64[_0xdb57('0x57')]);this[_0xdb57('0xb')][_0x3e9a64['uniqueid']][_0xdb57('0x58')]=moment()['format'](_0xdb57('0x32'));this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x1e')]][_0xdb57('0x59')]=moment(this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x1e')]]['endtime'])[_0xdb57('0x5a')](this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x1e')]]['starttime'],'seconds');this['channels'][_0x3e9a64['uniqueid']][_0xdb57('0x33')]=_0xdb57('0x5b');this[_0xdb57('0xc')][_0xdb57('0x5c')]+=0x1;if(this['channels'][_0x3e9a64[_0xdb57('0x1e')]][_0xdb57('0x31')]){this['outbound'][_0xdb57('0x5d')]+=0x1;this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x1e')]]['holdtime']=moment(this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x1e')]]['answertime'])[_0xdb57('0x5a')](this[_0xdb57('0xb')][_0x3e9a64['uniqueid']]['starttime'],_0xdb57('0x5e'));this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x1e')]][_0xdb57('0x5f')]=moment(this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x1e')]][_0xdb57('0x58')])[_0xdb57('0x5a')](this[_0xdb57('0xb')][_0x3e9a64['uniqueid']][_0xdb57('0x31')],'seconds');this[_0xdb57('0xc')][_0xdb57('0x60')]+=this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x1e')]][_0xdb57('0x61')]||0x0;this['outbound']['sumBillable']+=this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x1e')]][_0xdb57('0x5f')];}this[_0xdb57('0xc')][_0xdb57('0x62')]+=this[_0xdb57('0xb')][_0x3e9a64['uniqueid']][_0xdb57('0x59')];logger[_0xdb57('0x1b')](_0xdb57('0x63'),_0x3e9a64[_0xdb57('0x1e')],util['inspect'](this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x1e')]],{'showHidden':![],'depth':null}));ami[_0xdb57('0x19')](_0xdb57('0x64'),this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x1e')]]);logger['debug'](_0xdb57('0x65'),_0x3e9a64[_0xdb57('0x1e')],util[_0xdb57('0x1d')](this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x1e')]],{'showHidden':![],'depth':null}));ami['emit'](_0xdb57('0x66'),this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x1e')]]);logger[_0xdb57('0x1b')](_0xdb57('0x67'),_0x3e9a64[_0xdb57('0x1e')],util[_0xdb57('0x1d')](this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x1e')]],{'showHidden':![],'depth':null}));this['emit'](_0xdb57('0x28'),_0xdb57('0x68'),this[_0xdb57('0xc')]);logger[_0xdb57('0x55')](_0xdb57('0x69'),JSON[_0xdb57('0x6a')](this[_0xdb57('0xb')][_0x3e9a64['uniqueid']]));logger[_0xdb57('0x1b')](_0xdb57('0x6b'),_0x3e9a64[_0xdb57('0x1e')],util[_0xdb57('0x1d')](this['channels'][_0x3e9a64[_0xdb57('0x1e')]],{'showHidden':![],'depth':null}));this[_0xdb57('0x19')](_0xdb57('0x28'),_0xdb57('0x6c'),this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x1e')]]);delete this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x1e')]];}else if(this['channels'][_0x3e9a64[_0xdb57('0x6d')]]){this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x6d')]][_0xdb57('0x1e')]=this['channels'][_0x3e9a64[_0xdb57('0x6d')]]['destuniqueid'];}if(this['variables'][_0x3e9a64[_0xdb57('0x1e')]]){delete this[_0xdb57('0x40')][_0x3e9a64[_0xdb57('0x1e')]];}}}catch(_0x4c1654){logger[_0xdb57('0x38')](_0xdb57('0x6e'),_0x3e9a64[_0xdb57('0x1e')],util['inspect'](_0x4c1654,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xdb57('0x14')]=function(_0x2e9b11){try{if(this[_0xdb57('0x17')](_0x2e9b11)){logger[_0xdb57('0x1b')](_0xdb57('0x6f'),_0x2e9b11[_0xdb57('0x1e')],util[_0xdb57('0x1d')](_0x2e9b11,{'showHidden':![],'depth':null}));if(_0x2e9b11['application'][_0xdb57('0x70')]()===_0xdb57('0x71')){_0x2e9b11[_0xdb57('0x72')]=(_0x2e9b11[_0xdb57('0x73')]||_0x2e9b11[_0xdb57('0x72')])[_0xdb57('0x70')]();if(_[_0xdb57('0x74')](_0x2e9b11['applicationdata'],'cdr(')){if(_[_0xdb57('0x3e')](this[_0xdb57('0xd')][_0x2e9b11[_0xdb57('0x1e')]]))this['applications'][_0x2e9b11['uniqueid']]={};logger[_0xdb57('0x55')](_0xdb57('0x75'),_0x2e9b11[_0xdb57('0x1e')],_0x2e9b11['application'],_0x2e9b11[_0xdb57('0x72')]);var _0x55fac0=_0x2e9b11[_0xdb57('0x72')][_0xdb57('0x76')]('=');var _0x176729=_0x55fac0[0x0]['match'](/cdr\((.*)\)/);if(_0x176729)this[_0xdb57('0xd')][_0x2e9b11[_0xdb57('0x1e')]][_0x176729[0x1]]=_0x55fac0[0x1];}}}}catch(_0x4821cb){logger['error'](_0xdb57('0x77'),_0x2e9b11['uniqueid'],util[_0xdb57('0x1d')](_0x4821cb,{'showHidden':![],'depth':null}));}};module[_0xdb57('0x78')]=VoiceDialReport;
\ No newline at end of file
+var _0x9edf=['voice','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','duration','diff','starttime','seconds','lastevent','complete','total','answertime','holdtime','billableseconds','sumHoldTime','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','applicationdata','appdata','toLowerCase','startsWith','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','match','exports','moment','../../../config/environment','ami','../ami','defaults','redis','localhost','socket.io-emitter','channels','outboundChannels','outbound','applications','variables','syncDialBegin','syncDialEnd','varset','syncVarSet','bind','syncNewExten','syncHangup','prototype','isNotNull','isUndefined','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','format','called','channel','substring','lastIndexOf','omit','event','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','dialstatus','connectedlinenum','connectedlinename','YYYY-MM-DD\x20HH:mm:ss','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','variable','outboundrouteid','value'];(function(_0x2d457a,_0xb3f867){var _0x31a7a0=function(_0x3f474f){while(--_0x3f474f){_0x2d457a['push'](_0x2d457a['shift']());}};_0x31a7a0(++_0xb3f867);}(_0x9edf,0xae));var _0xf9ed=function(_0x55599d,_0x51a245){_0x55599d=_0x55599d-0x0;var _0x7416d4=_0x9edf[_0x55599d];return _0x7416d4;};'use strict';var _=require('lodash');var moment=require(_0xf9ed('0x0'));var util=require('util');var Redis=require('ioredis');var config=require(_0xf9ed('0x1'));var logger=require('../../../config/logger')(_0xf9ed('0x2'));var ami=require(_0xf9ed('0x3'));config['redis']=_[_0xf9ed('0x4')](config[_0xf9ed('0x5')],{'host':_0xf9ed('0x6'),'port':0x18eb});var io=require(_0xf9ed('0x7'))(new Redis(config[_0xf9ed('0x5')]));function VoiceDialReport(_0x2f321f){this[_0xf9ed('0x8')]=_0x2f321f[_0xf9ed('0x9')];this[_0xf9ed('0xa')]=_0x2f321f[_0xf9ed('0xa')];this[_0xf9ed('0xb')]={};this[_0xf9ed('0xc')]={};ami['on']('dialbegin',this[_0xf9ed('0xd')]['bind'](this));ami['on']('dialend',this[_0xf9ed('0xe')]['bind'](this));ami['on'](_0xf9ed('0xf'),this[_0xf9ed('0x10')][_0xf9ed('0x11')](this));ami['on']('newexten',this[_0xf9ed('0x12')]['bind'](this));ami['on']('hangup',this[_0xf9ed('0x13')]['bind'](this));}VoiceDialReport[_0xf9ed('0x14')][_0xf9ed('0x15')]=function(_0x3a5e9b){return _0x3a5e9b!==null&&!_[_0xf9ed('0x16')](_0x3a5e9b);};VoiceDialReport[_0xf9ed('0x14')]['emit']=function(_0x3d9a5e,_0x58549a,_0xa99c28){io['to'](_0x3d9a5e)[_0xf9ed('0x17')](_0x58549a,_0xa99c28);};VoiceDialReport[_0xf9ed('0x14')]['syncDialBegin']=function(_0x2224b8){try{if(this[_0xf9ed('0x15')](_0x2224b8)){logger[_0xf9ed('0x18')](_0xf9ed('0x19'),_0x2224b8[_0xf9ed('0x1a')],util[_0xf9ed('0x1b')](_0x2224b8,{'showHidden':![],'depth':null}));if(this[_0xf9ed('0x8')][_0x2224b8[_0xf9ed('0x1a')]]){_[_0xf9ed('0x1c')](this[_0xf9ed('0x8')][_0x2224b8[_0xf9ed('0x1a')]],{'starttime':moment()[_0xf9ed('0x1d')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0xf9ed('0x1e'),'interface':_0x2224b8[_0xf9ed('0x1f')][_0xf9ed('0x20')](0x0,_0x2224b8[_0xf9ed('0x1f')][_0xf9ed('0x21')]('-')),'membername':_0x2224b8[_0xf9ed('0x1f')]['substring'](_0x2224b8[_0xf9ed('0x1f')]['lastIndexOf']('/')+0x1,_0x2224b8['channel'][_0xf9ed('0x21')]('-'))},_[_0xf9ed('0x22')](_0x2224b8,[_0xf9ed('0x23'),'privilege']));logger[_0xf9ed('0x24')](_0xf9ed('0x25'),_0x2224b8[_0xf9ed('0x1a')],this['channels'][_0x2224b8[_0xf9ed('0x1a')]][_0xf9ed('0x26')],this['channels'][_0x2224b8[_0xf9ed('0x1a')]]['interface']);logger['debug']('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x2224b8[_0xf9ed('0x1a')],util[_0xf9ed('0x1b')](this[_0xf9ed('0x8')][_0x2224b8[_0xf9ed('0x1a')]],{'showHidden':![],'depth':null}));if(this[_0xf9ed('0xb')][_0x2224b8[_0xf9ed('0x1a')]])_['merge'](this[_0xf9ed('0x8')][_0x2224b8['uniqueid']],this[_0xf9ed('0xb')][_0x2224b8[_0xf9ed('0x1a')]]);this['emit'](_0xf9ed('0x27'),_0xf9ed('0x28'),this['channels'][_0x2224b8[_0xf9ed('0x1a')]]);logger['debug'](_0xf9ed('0x29'),_0x2224b8[_0xf9ed('0x1a')],util[_0xf9ed('0x1b')](this[_0xf9ed('0x8')][_0x2224b8[_0xf9ed('0x1a')]],{'showHidden':![],'depth':null}));ami[_0xf9ed('0x17')](_0xf9ed('0x2a'),this['channels'][_0x2224b8[_0xf9ed('0x1a')]]);}}}catch(_0x1c52d9){logger[_0xf9ed('0x2b')](_0xf9ed('0x2c'),_0x2224b8[_0xf9ed('0x1a')],util[_0xf9ed('0x1b')](_0x1c52d9,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncDialEnd']=function(_0x285214){try{if(this[_0xf9ed('0x15')](_0x285214)){logger[_0xf9ed('0x18')]('[%s][voiceDialReport][dialend]\x20event:',_0x285214[_0xf9ed('0x1a')],util[_0xf9ed('0x1b')](_0x285214,{'showHidden':![],'depth':null}));if(this[_0xf9ed('0x8')][_0x285214[_0xf9ed('0x1a')]]){this['channels'][_0x285214[_0xf9ed('0x1a')]]['dialstatus']=_0x285214[_0xf9ed('0x2d')];if(_0x285214['dialstatus']==='ANSWER'){this[_0xf9ed('0x8')][_0x285214['uniqueid']][_0xf9ed('0x2e')]=_0x285214['connectedlinenum'];this[_0xf9ed('0x8')][_0x285214[_0xf9ed('0x1a')]]['connectedlinename']=_0x285214[_0xf9ed('0x2f')];this[_0xf9ed('0x8')][_0x285214[_0xf9ed('0x1a')]]['answertime']=moment()[_0xf9ed('0x1d')](_0xf9ed('0x30'));this[_0xf9ed('0x8')][_0x285214[_0xf9ed('0x1a')]]['lastevent']=_0xf9ed('0x31');logger[_0xf9ed('0x24')](_0xf9ed('0x32'),_0x285214[_0xf9ed('0x1a')],_0x285214['channel'][_0xf9ed('0x20')](_0x285214['channel'][_0xf9ed('0x21')]('/')+0x1,_0x285214['channel']['lastIndexOf']('-')));logger[_0xf9ed('0x18')](_0xf9ed('0x33'),_0x285214[_0xf9ed('0x1a')],util[_0xf9ed('0x1b')](this[_0xf9ed('0x8')][_0x285214[_0xf9ed('0x1a')]],{'showHidden':![],'depth':null}));ami[_0xf9ed('0x17')](_0xf9ed('0x34'),this[_0xf9ed('0x8')][_0x285214['uniqueid']]);}logger[_0xf9ed('0x18')](_0xf9ed('0x35'),_0x285214['uniqueid'],util[_0xf9ed('0x1b')](this['channels'][_0x285214[_0xf9ed('0x1a')]],{'showHidden':![],'depth':null}));this[_0xf9ed('0x17')](_0xf9ed('0x27'),'voice_outbound_channel:save',this[_0xf9ed('0x8')][_0x285214[_0xf9ed('0x1a')]]);}}}catch(_0x4e7846){logger['error']('[%s][voiceDialReport][dialend]',_0x285214[_0xf9ed('0x1a')],util[_0xf9ed('0x1b')](_0x4e7846,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xf9ed('0x14')][_0xf9ed('0x10')]=function(_0x547912){try{if(this['isNotNull'](_0x547912)){logger['debug'](_0xf9ed('0x36'),_0x547912['uniqueid'],util[_0xf9ed('0x1b')](_0x547912,{'showHidden':![],'depth':null}));this[_0xf9ed('0x37')](_0x547912['uniqueid'],_[_0xf9ed('0x38')](_0x547912[_0xf9ed('0x39')])[0x0],_0x547912['value']);if(this[_0xf9ed('0x15')](_0x547912[_0xf9ed('0x39')])&&this[_0xf9ed('0x15')](_0x547912[_0xf9ed('0x39')][_0xf9ed('0x3a')])){if(_[_0xf9ed('0x16')](this[_0xf9ed('0x8')][_0x547912[_0xf9ed('0x1a')]])){this[_0xf9ed('0x8')][_0x547912[_0xf9ed('0x1a')]]={'routeId':_0x547912[_0xf9ed('0x3b')],'variables':this[_0xf9ed('0xc')][_0x547912['uniqueid']],'motionChannel':_0xf9ed('0x3c')};logger[_0xf9ed('0x24')]('[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s',_0x547912[_0xf9ed('0x1a')],_0x547912[_0xf9ed('0x39')][_0xf9ed('0x3a')],_['keys'](_0x547912[_0xf9ed('0x39')])[0x0],_0x547912['value']);logger[_0xf9ed('0x18')](_0xf9ed('0x3d'),_0x547912[_0xf9ed('0x1a')],util[_0xf9ed('0x1b')](this[_0xf9ed('0x8')][_0x547912[_0xf9ed('0x1a')]],{'showHidden':![],'depth':null}));this[_0xf9ed('0x17')](_0xf9ed('0x27'),_0xf9ed('0x28'),this[_0xf9ed('0x8')][_0x547912[_0xf9ed('0x1a')]]);}}}}catch(_0x30e670){logger[_0xf9ed('0x2b')]('[%s][voiceDialReport][varset]',_0x547912[_0xf9ed('0x1a')],util['inspect'](_0x30e670,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['addVariable']=function(_0x5a9dca,_0x4f4344,_0x2cdd5a){var _0x13e940=[_0xf9ed('0x3e'),_0xf9ed('0x3f'),_0xf9ed('0x40'),_0xf9ed('0x41'),_0xf9ed('0x42'),_0xf9ed('0x43'),'rtpaudioqosrtt',_0xf9ed('0x44'),'sipcallid',_0xf9ed('0x45'),_0xf9ed('0x46'),_0xf9ed('0x47'),_0xf9ed('0x48'),_0xf9ed('0x49'),_0xf9ed('0x4a'),_0xf9ed('0x4b'),_0xf9ed('0x26'),_0xf9ed('0x4c'),_0xf9ed('0x4d')];if(!_[_0xf9ed('0x4e')](_0x4f4344)&&!_['includes'](_0x13e940,_0x4f4344)){if(_[_0xf9ed('0x16')](this[_0xf9ed('0xc')][_0x5a9dca])){this['variables'][_0x5a9dca]={};}this[_0xf9ed('0xc')][_0x5a9dca][_0x4f4344]=_0x2cdd5a;}};VoiceDialReport[_0xf9ed('0x14')]['syncHangup']=function(_0x49ab43){try{if(this[_0xf9ed('0x15')](_0x49ab43)){logger[_0xf9ed('0x18')]('[%s][voiceDialReport][hangup]\x20event:',_0x49ab43['uniqueid'],util[_0xf9ed('0x1b')](_0x49ab43,{'showHidden':![],'depth':null}));if(this['channels'][_0x49ab43[_0xf9ed('0x1a')]]){logger[_0xf9ed('0x24')](_0xf9ed('0x4f'),_0x49ab43[_0xf9ed('0x1a')],_0x49ab43[_0xf9ed('0x50')]);this['channels'][_0x49ab43[_0xf9ed('0x1a')]][_0xf9ed('0x51')]=moment()['format'](_0xf9ed('0x30'));this[_0xf9ed('0x8')][_0x49ab43[_0xf9ed('0x1a')]][_0xf9ed('0x52')]=moment(this['channels'][_0x49ab43[_0xf9ed('0x1a')]][_0xf9ed('0x51')])[_0xf9ed('0x53')](this[_0xf9ed('0x8')][_0x49ab43[_0xf9ed('0x1a')]][_0xf9ed('0x54')],_0xf9ed('0x55'));this[_0xf9ed('0x8')][_0x49ab43[_0xf9ed('0x1a')]][_0xf9ed('0x56')]=_0xf9ed('0x57');this[_0xf9ed('0xa')][_0xf9ed('0x58')]+=0x1;if(this[_0xf9ed('0x8')][_0x49ab43[_0xf9ed('0x1a')]][_0xf9ed('0x59')]){this[_0xf9ed('0xa')]['answered']+=0x1;this[_0xf9ed('0x8')][_0x49ab43[_0xf9ed('0x1a')]][_0xf9ed('0x5a')]=moment(this[_0xf9ed('0x8')][_0x49ab43[_0xf9ed('0x1a')]][_0xf9ed('0x59')])[_0xf9ed('0x53')](this[_0xf9ed('0x8')][_0x49ab43[_0xf9ed('0x1a')]][_0xf9ed('0x54')],_0xf9ed('0x55'));this[_0xf9ed('0x8')][_0x49ab43['uniqueid']][_0xf9ed('0x5b')]=moment(this[_0xf9ed('0x8')][_0x49ab43[_0xf9ed('0x1a')]][_0xf9ed('0x51')])[_0xf9ed('0x53')](this[_0xf9ed('0x8')][_0x49ab43[_0xf9ed('0x1a')]][_0xf9ed('0x59')],_0xf9ed('0x55'));this['outbound'][_0xf9ed('0x5c')]+=this[_0xf9ed('0x8')][_0x49ab43['uniqueid']][_0xf9ed('0x5a')]||0x0;this['outbound'][_0xf9ed('0x5d')]+=this[_0xf9ed('0x8')][_0x49ab43[_0xf9ed('0x1a')]][_0xf9ed('0x5b')];}this[_0xf9ed('0xa')][_0xf9ed('0x5e')]+=this[_0xf9ed('0x8')][_0x49ab43[_0xf9ed('0x1a')]]['duration'];logger[_0xf9ed('0x18')](_0xf9ed('0x5f'),_0x49ab43[_0xf9ed('0x1a')],util['inspect'](this[_0xf9ed('0x8')][_0x49ab43[_0xf9ed('0x1a')]],{'showHidden':![],'depth':null}));ami[_0xf9ed('0x17')]('custom:voiceDialReport',this['channels'][_0x49ab43['uniqueid']]);logger['debug'](_0xf9ed('0x60'),_0x49ab43[_0xf9ed('0x1a')],util[_0xf9ed('0x1b')](this['channels'][_0x49ab43['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xf9ed('0x17')]('custom:dialend',this[_0xf9ed('0x8')][_0x49ab43['uniqueid']]);logger[_0xf9ed('0x18')](_0xf9ed('0x61'),_0x49ab43[_0xf9ed('0x1a')],util[_0xf9ed('0x1b')](this[_0xf9ed('0x8')][_0x49ab43[_0xf9ed('0x1a')]],{'showHidden':![],'depth':null}));this[_0xf9ed('0x17')](_0xf9ed('0x27'),_0xf9ed('0x62'),this[_0xf9ed('0xa')]);logger[_0xf9ed('0x24')](_0xf9ed('0x63'),JSON[_0xf9ed('0x64')](this[_0xf9ed('0x8')][_0x49ab43['uniqueid']]));logger[_0xf9ed('0x18')](_0xf9ed('0x65'),_0x49ab43[_0xf9ed('0x1a')],util[_0xf9ed('0x1b')](this['channels'][_0x49ab43[_0xf9ed('0x1a')]],{'showHidden':![],'depth':null}));this[_0xf9ed('0x17')](_0xf9ed('0x27'),_0xf9ed('0x66'),this['channels'][_0x49ab43[_0xf9ed('0x1a')]]);delete this[_0xf9ed('0x8')][_0x49ab43[_0xf9ed('0x1a')]];}else if(this[_0xf9ed('0x8')][_0x49ab43[_0xf9ed('0x67')]]){this[_0xf9ed('0x8')][_0x49ab43['linkedid']]['uniqueid']=this['channels'][_0x49ab43[_0xf9ed('0x67')]][_0xf9ed('0x68')];}if(this['variables'][_0x49ab43[_0xf9ed('0x1a')]]){delete this[_0xf9ed('0xc')][_0x49ab43[_0xf9ed('0x1a')]];}}}catch(_0x1f9352){logger[_0xf9ed('0x2b')](_0xf9ed('0x69'),_0x49ab43[_0xf9ed('0x1a')],util[_0xf9ed('0x1b')](_0x1f9352,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xf9ed('0x14')][_0xf9ed('0x12')]=function(_0x4fcd43){try{if(this['isNotNull'](_0x4fcd43)){logger[_0xf9ed('0x18')](_0xf9ed('0x6a'),_0x4fcd43[_0xf9ed('0x1a')],util[_0xf9ed('0x1b')](_0x4fcd43,{'showHidden':![],'depth':null}));if(_0x4fcd43[_0xf9ed('0x6b')]['toLowerCase']()==='set'){_0x4fcd43[_0xf9ed('0x6c')]=(_0x4fcd43[_0xf9ed('0x6d')]||_0x4fcd43[_0xf9ed('0x6c')])[_0xf9ed('0x6e')]();if(_[_0xf9ed('0x6f')](_0x4fcd43['applicationdata'],_0xf9ed('0x70'))){if(_[_0xf9ed('0x16')](this['applications'][_0x4fcd43[_0xf9ed('0x1a')]]))this[_0xf9ed('0xb')][_0x4fcd43[_0xf9ed('0x1a')]]={};logger[_0xf9ed('0x24')](_0xf9ed('0x71'),_0x4fcd43[_0xf9ed('0x1a')],_0x4fcd43[_0xf9ed('0x6b')],_0x4fcd43[_0xf9ed('0x6c')]);var _0x4ab455=_0x4fcd43[_0xf9ed('0x6c')][_0xf9ed('0x72')]('=');var _0x4b0bae=_0x4ab455[0x0][_0xf9ed('0x73')](/cdr\((.*)\)/);if(_0x4b0bae)this['applications'][_0x4fcd43[_0xf9ed('0x1a')]][_0x4b0bae[0x1]]=_0x4ab455[0x1];}}}}catch(_0x3a68b0){logger[_0xf9ed('0x2b')]('[%s][voiceDialReport][newexten]',_0x4fcd43[_0xf9ed('0x1a')],util[_0xf9ed('0x1b')](_0x3a68b0,{'showHidden':![],'depth':null}));}};module[_0xf9ed('0x74')]=VoiceDialReport;
\ No newline at end of file
index 9bbf3f6..50e63fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5ba=['waiting','queueStatusComplete','unlockRR','clearZombieChannels','switch','isNil','channel','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','inspect','syncFullyBooted','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','debug',']\x20sending\x20voice_queue_channel:save\x20event:','voice_queue_channel:save','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','uniqueid','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','inbound','strategy','answered','available','loggedIn','sumBillable','Trunk','active','callerid','Interval','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','isNotNull','isUndefined','Action','queues','catch','[voiceQueueReport][queues]','then','[voiceQueueReport][queuesummary]','queue','info','[voiceQueueReport][queuesummary]\x20name:%s','callers','toNumber','loggedin','custom:queuesummary','syncQueueCallerJoin','[%s][voiceQueueReport][queuecallerjoin]','type','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','keys','push','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','ABANDONED','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','emitVoiceQueueChannelSave','[%s][voiceQueueReport][queuecallerleave]','syncAgentConnect','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentconnect]','[%s][voiceQueueReport][agentcomplete]','membername','queuecallerexitAt','transfer','reason','queuecallerexitreason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','linkedid','queuecallerexit','add','seconds','FORWARD','transferexten','destexten','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','toUpperCase','[%s][voiceQueueReport][varset]','addVariable','variable','queuestatus','value','CONTINUE','TIMEOUT','lastevent','timeout','custom:timeout','varset','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','includes','length','unmanaged','abandoned','diff','milliseconds','total','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','sumDuration','sumHoldTime','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][hangup]','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','transferuniqueid','secondtransfereruniqueid','ATTENDEDTRANSFER','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','syncBlindTransfer','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','transfertype','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstart]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','CDR(routeAlias)','cdr(','split','[%s][voiceQueueReport][newexten]','exports','lodash','moment','util','md5','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','redis','defaults','localhost','socket.io-emitter','prototype','tail','finally','sequence','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncVarSet','hangup','syncHangup','syncNewExten','musiconholdstart','syncMusicOnHoldStart','attendedtransfer','blindtransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','pTalking'];(function(_0x2155b1,_0x3995ce){var _0x4a81db=function(_0x252f62){while(--_0x252f62){_0x2155b1['push'](_0x2155b1['shift']());}};_0x4a81db(++_0x3995ce);}(_0xc5ba,0xb9));var _0xac5b=function(_0x40b66c,_0x578758){_0x40b66c=_0x40b66c-0x0;var _0x2fd22b=_0xc5ba[_0x40b66c];return _0x2fd22b;};'use strict';var _=require(_0xac5b('0x0'));var moment=require(_0xac5b('0x1'));var util=require(_0xac5b('0x2'));var md5=require(_0xac5b('0x3'));var Redis=require(_0xac5b('0x4'));var config=require(_0xac5b('0x5'));var logger=require(_0xac5b('0x6'))(_0xac5b('0x7'));var ami=require(_0xac5b('0x8'));var QueueReport=require(_0xac5b('0x9'));config[_0xac5b('0xa')]=_[_0xac5b('0xb')](config[_0xac5b('0xa')],{'host':_0xac5b('0xc'),'port':0x18eb});var io=require(_0xac5b('0xd'))(new Redis(config[_0xac5b('0xa')]));var Sequence=function(){};Sequence[_0xac5b('0xe')]['enqueue']=function(_0x525e20){this[_0xac5b('0xf')]=this['tail']?this[_0xac5b('0xf')][_0xac5b('0x10')](_0x525e20):_0x525e20();};function VoiceQueueReport(_0x221d70){this[_0xac5b('0x11')]=new Sequence();this[_0xac5b('0x12')]={};this[_0xac5b('0x13')]=_0x221d70[_0xac5b('0x13')];this[_0xac5b('0x14')]=_0x221d70[_0xac5b('0x15')];this['voiceQueues']=_0x221d70[_0xac5b('0x16')];this[_0xac5b('0x17')]=!![];this[_0xac5b('0x18')]=_0x221d70[_0xac5b('0x18')];this[_0xac5b('0x19')]={};ami['on'](_0xac5b('0x1a'),this[_0xac5b('0x1b')][_0xac5b('0x1c')](this));ami['on'](_0xac5b('0x1d'),this[_0xac5b('0x1e')][_0xac5b('0x1c')](this));ami['on'](_0xac5b('0x1f'),this['syncQueueCallerJoin'][_0xac5b('0x1c')](this));ami['on'](_0xac5b('0x20'),this[_0xac5b('0x21')][_0xac5b('0x1c')](this));ami['on'](_0xac5b('0x22'),this[_0xac5b('0x23')][_0xac5b('0x1c')](this));ami['on'](_0xac5b('0x24'),this[_0xac5b('0x25')][_0xac5b('0x1c')](this));ami['on'](_0xac5b('0x26'),this['syncAgentConnect'][_0xac5b('0x1c')](this));ami['on']('varset',this[_0xac5b('0x27')]['bind'](this));ami['on'](_0xac5b('0x28'),this[_0xac5b('0x29')]['bind'](this));ami['on']('fullybooted',this['syncFullyBooted'][_0xac5b('0x1c')](this));ami['on']('newexten',this[_0xac5b('0x2a')][_0xac5b('0x1c')](this));ami['on'](_0xac5b('0x2b'),this[_0xac5b('0x2c')][_0xac5b('0x1c')](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop']['bind'](this));ami['on'](_0xac5b('0x2d'),this['syncAttendedTransfer'][_0xac5b('0x1c')](this));ami['on'](_0xac5b('0x2e'),this['syncBlindTransfer'][_0xac5b('0x1c')](this));this[_0xac5b('0x2f')]();this[_0xac5b('0x30')]();}function clearChannels(_0x44209e){if(!_[_0xac5b('0x31')](_0x44209e)){for(var _0x40e99f in _0x44209e){if(_0x44209e[_0xac5b('0x32')](_0x40e99f)){delete _0x44209e[_0x40e99f];}}}}function clearCampaigns(_0x44127a){if(!_[_0xac5b('0x31')](_0x44127a)){for(var _0x16a03a in _0x44127a){if(_0x44127a['hasOwnProperty'](_0x16a03a)){_0x44127a[_0x16a03a][_0xac5b('0x33')]=0x0;}}}}function clearVoiceQueues(_0xa48194){if(!_[_0xac5b('0x31')](_0xa48194)){for(var _0x4191a7 in _0xa48194){if(_0xa48194[_0xac5b('0x32')](_0x4191a7)){_0xa48194[_0x4191a7][_0xac5b('0x33')]=0x0;_0xa48194[_0x4191a7][_0xac5b('0x34')]=0x0;_0xa48194[_0x4191a7][_0xac5b('0x35')]=0x0;_0xa48194[_0x4191a7][_0xac5b('0x36')]=0x0;_0xa48194[_0x4191a7][_0xac5b('0x37')]=!![];}}}}function clearAgentBooked(_0x36f1e4){if(!_['isEmpty'](_0x36f1e4)){for(var _0x27891e in _0x36f1e4){if(_0x36f1e4[_0xac5b('0x32')](_0x27891e)){_0x36f1e4[_0x27891e][_0xac5b('0x38')]=!![];}}}}VoiceQueueReport['prototype'][_0xac5b('0x39')]=function(){var _0x595e84=this;for(var _0x3b4a99 in this[_0xac5b('0x14')]){if(this[_0xac5b('0x14')][_0xac5b('0x32')](_0x3b4a99)&&!this['channels'][_0x3b4a99][_0xac5b('0x3a')]){this['sequence']['enqueue'](function(){if(!_[_0xac5b('0x3b')](_0x595e84[_0xac5b('0x14')][_0x3b4a99])){return ami['Action']({'action':'status','channel':_0x595e84[_0xac5b('0x14')][_0x3b4a99][_0xac5b('0x3c')]})['catch'](function(_0x424773){if(_0x424773[_0xac5b('0x3d')]===_0xac5b('0x3e')){setTimeout(function(){if(_0x595e84['channels'][_0x3b4a99]){delete _0x595e84['channels'][_0x3b4a99];logger[_0xac5b('0x3f')](_0xac5b('0x40'),_0x3b4a99,util['inspect'](_0x424773,{'showHidden':![],'depth':null}));}if(_0x595e84[_0xac5b('0x12')][_0x3b4a99]){delete _0x595e84[_0xac5b('0x12')][_0x3b4a99];logger[_0xac5b('0x3f')](_0xac5b('0x41'),_0x3b4a99,util['inspect'](_0x424773,{'showHidden':![],'depth':null}));}if(_0x595e84[_0xac5b('0x19')][_0x3b4a99]){delete _0x595e84[_0xac5b('0x19')][_0x3b4a99];logger[_0xac5b('0x3f')](_0xac5b('0x42'),_0x3b4a99,util[_0xac5b('0x43')](_0x424773,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport['prototype'][_0xac5b('0x44')]=function(){logger['error'](_0xac5b('0x45'));clearChannels(this['channels']);this[_0xac5b('0x46')](this[_0xac5b('0x12')]);clearAgentBooked(this[_0xac5b('0x13')]);clearVoiceQueues(this[_0xac5b('0x16')]);clearCampaigns(this[_0xac5b('0x18')]);};VoiceQueueReport[_0xac5b('0xe')]['clearQueueReport']=function(_0x419dfc){var _0xbada8a=this;if(!_[_0xac5b('0x31')](_0x419dfc)){for(var _0x3d2528 in _0x419dfc){if(_0x419dfc[_0xac5b('0x32')](_0x3d2528)){_0xbada8a[_0xac5b('0x47')](_0x419dfc[_0x3d2528],_0xac5b('0x48'));delete _0x419dfc[_0x3d2528];}}}};VoiceQueueReport['prototype'][_0xac5b('0x49')]=function(_0x2f4e74,_0x1d918f,_0x1e1e03){io['to'](_0x2f4e74)[_0xac5b('0x49')](_0x1d918f,_0x1e1e03);};VoiceQueueReport[_0xac5b('0xe')]['emitVoiceQueueChannelSave']=function(_0x2a0d37,_0x5530c7){logger[_0xac5b('0x4a')]('[%s][voiceQueueReport]['+_0x5530c7+_0xac5b('0x4b'),_0x2a0d37['uniqueid'],util['inspect'](_0x2a0d37,{'showHidden':![],'depth':null}));this['emit'](util['format']('voice:queue:%s',_0x2a0d37['name']),_0xac5b('0x4c'),_0x2a0d37);io['emit'](_0xac5b('0x4d'),_0x2a0d37);};VoiceQueueReport[_0xac5b('0xe')][_0xac5b('0x47')]=function(_0x5c003a,_0x47d5ea){logger[_0xac5b('0x4a')]('[%s][voiceQueueReport]['+_0x47d5ea+_0xac5b('0x4e'),_0x5c003a[_0xac5b('0x4f')],util[_0xac5b('0x43')](_0x5c003a,{'showHidden':![],'depth':null}));this[_0xac5b('0x49')](util['format'](_0xac5b('0x50'),_0x5c003a[_0xac5b('0x51')]),_0xac5b('0x52'),_0x5c003a);io['emit'](_0xac5b('0x53'),_0x5c003a);};VoiceQueueReport['prototype'][_0xac5b('0x54')]=function(_0x2743a2,_0x159e8c){if(_0x2743a2['type']===_0xac5b('0x55')){var _0x599cdc={'id':_0x2743a2['id'],'name':_0x2743a2[_0xac5b('0x51')],'strategy':_0x2743a2[_0xac5b('0x56')],'answered':_0x2743a2[_0xac5b('0x57')],'available':_0x2743a2[_0xac5b('0x58')],'loggedIn':_0x2743a2[_0xac5b('0x59')],'pTalking':_0x2743a2[_0xac5b('0x35')],'sumBillable':_0x2743a2[_0xac5b('0x5a')],'sumDuration':_0x2743a2['sumDuration'],'sumHoldTime':_0x2743a2['sumHoldTime']||0x0,'talking':_0x2743a2[_0xac5b('0x34')],'total':_0x2743a2['total'],'type':_0x2743a2['type'],'unmanaged':_0x2743a2['unmanaged'],'abandoned':_0x2743a2['abandoned'],'waiting':_0x2743a2['waiting']};if(_0x2743a2[_0xac5b('0x5b')]){_0x599cdc[_0xac5b('0x5b')]={'id':_0x2743a2[_0xac5b('0x5b')]['id'],'name':_0x2743a2[_0xac5b('0x5b')][_0xac5b('0x51')],'active':_0x2743a2['Trunk'][_0xac5b('0x5c')],'callerid':_0x2743a2[_0xac5b('0x5b')][_0xac5b('0x5d')]};}if(_0x2743a2[_0xac5b('0x5e')]){_0x599cdc[_0xac5b('0x5e')]={'id':_0x2743a2[_0xac5b('0x5e')]['id'],'name':_0x2743a2[_0xac5b('0x5e')][_0xac5b('0x51')]};}var _0x1e47fb=md5(JSON['stringify'](_0x599cdc));if(_0x2743a2[_0xac5b('0x3')]!==_0x1e47fb){_0x2743a2[_0xac5b('0x3')]=_0x1e47fb;logger[_0xac5b('0x4a')](_0xac5b('0x5f')+_0x159e8c+_0xac5b('0x60'),util[_0xac5b('0x43')](_0x599cdc,{'showHidden':![],'depth':null}));this[_0xac5b('0x49')](util['format'](_0xac5b('0x50'),_0x599cdc[_0xac5b('0x51')]),'voice_queue:save',_0x599cdc);}}};VoiceQueueReport['prototype'][_0xac5b('0x61')]=function(_0x4002ab){return _0x4002ab!==null&&!_[_0xac5b('0x62')](_0x4002ab);};VoiceQueueReport[_0xac5b('0xe')][_0xac5b('0x30')]=function(){var _0x626c29=this;setInterval(function(){_0x626c29[_0xac5b('0x39')]();ami[_0xac5b('0x63')]({'action':_0xac5b('0x64')})[_0xac5b('0x65')](function(_0x2ce3e9){logger[_0xac5b('0x3f')](_0xac5b('0x66'),util[_0xac5b('0x43')](_0x2ce3e9,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0xac5b('0xe')][_0xac5b('0x2f')]=function(){var _0x34be27=this;setInterval(function(){if(_0x34be27[_0xac5b('0x17')]){return ami[_0xac5b('0x63')]({'action':_0xac5b('0x1a')})[_0xac5b('0x67')](function(_0x1be6ff){_0x34be27[_0xac5b('0x17')]=![];})[_0xac5b('0x65')](function(_0x40944c){logger['error'](_0xac5b('0x68'),util[_0xac5b('0x43')](_0x40944c,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0xac5b('0xe')][_0xac5b('0x1b')]=function(_0x561c3c){try{if(this[_0xac5b('0x61')](_0x561c3c)&&this[_0xac5b('0x61')](_0x561c3c[_0xac5b('0x69')])){logger[_0xac5b('0x4a')]('[voiceQueueReport][queuesummary]\x20event:',util[_0xac5b('0x43')](_0x561c3c,{'showHidden':![],'depth':null}));if(this[_0xac5b('0x16')][_0x561c3c[_0xac5b('0x69')]]){logger[_0xac5b('0x6a')](_0xac5b('0x6b'),_0x561c3c[_0xac5b('0x69')]);var _0x26a187=_['countBy'](this[_0xac5b('0x14')],'queue')[_0x561c3c[_0xac5b('0x69')]]||0x0;var _0x156779=_0x26a187-_0x561c3c[_0xac5b('0x6c')];if(this[_0xac5b('0x16')][_0x561c3c[_0xac5b('0x69')]][_0xac5b('0x36')]!==_['toNumber'](_0x561c3c[_0xac5b('0x6c')])||this[_0xac5b('0x16')][_0x561c3c['queue']][_0xac5b('0x59')]!==_[_0xac5b('0x6d')](_0x561c3c['loggedin'])||this[_0xac5b('0x16')][_0x561c3c['queue']][_0xac5b('0x58')]!==_[_0xac5b('0x6d')](_0x561c3c[_0xac5b('0x58')])||this['voiceQueues'][_0x561c3c[_0xac5b('0x69')]][_0xac5b('0x34')]!==_0x156779){this[_0xac5b('0x16')][_0x561c3c[_0xac5b('0x69')]][_0xac5b('0x36')]=_['toNumber'](_0x561c3c['callers']);this['voiceQueues'][_0x561c3c[_0xac5b('0x69')]][_0xac5b('0x59')]=_[_0xac5b('0x6d')](_0x561c3c['loggedin']);this[_0xac5b('0x16')][_0x561c3c[_0xac5b('0x69')]][_0xac5b('0x58')]=_[_0xac5b('0x6d')](_0x561c3c[_0xac5b('0x58')]);this[_0xac5b('0x16')][_0x561c3c['queue']]['talking']=_0x156779>0x0?_0x156779:0x0;this['voiceQueues'][_0x561c3c[_0xac5b('0x69')]][_0xac5b('0x34')]=this[_0xac5b('0x16')][_0x561c3c[_0xac5b('0x69')]][_0xac5b('0x34')]>_[_0xac5b('0x6d')](_0x561c3c[_0xac5b('0x6e')])?_[_0xac5b('0x6d')](_0x561c3c[_0xac5b('0x6e')]):this[_0xac5b('0x16')][_0x561c3c['queue']][_0xac5b('0x34')];this[_0xac5b('0x54')](this['voiceQueues'][_0x561c3c[_0xac5b('0x69')]],_0xac5b('0x1a'));}logger[_0xac5b('0x4a')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0xac5b('0x43')](this['voiceQueues'][_0x561c3c[_0xac5b('0x69')]],{'showHidden':![],'depth':null}));ami['emit'](_0xac5b('0x6f'),this['voiceQueues'][_0x561c3c[_0xac5b('0x69')]]);}}}catch(_0x5bcc27){logger[_0xac5b('0x3f')](_0xac5b('0x68'),util[_0xac5b('0x43')](_0x5bcc27,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xac5b('0xe')]['syncQueueSummaryComplete']=function(_0x352930){logger['debug']('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0xac5b('0x43')](_0x352930,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport['prototype'][_0xac5b('0x70')]=function(_0x4c7cd5){try{if(this[_0xac5b('0x61')](_0x4c7cd5)){logger[_0xac5b('0x4a')](_0xac5b('0x71'),_0x4c7cd5[_0xac5b('0x4f')],util['inspect'](_0x4c7cd5,{'showHidden':![],'depth':null}));if(_[_0xac5b('0x62')](this[_0xac5b('0x12')][_0x4c7cd5[_0xac5b('0x4f')]]))this[_0xac5b('0x12')][_0x4c7cd5[_0xac5b('0x4f')]]=[];if(_[_0xac5b('0x62')](this['channels'][_0x4c7cd5[_0xac5b('0x4f')]]))this[_0xac5b('0x14')][_0x4c7cd5[_0xac5b('0x4f')]]={};var _0x4b6d41=new QueueReport();_0x4b6d41[_0xac5b('0x51')]=_0x4c7cd5[_0xac5b('0x69')];_0x4b6d41[_0xac5b('0x72')]=this['voiceQueues'][_0x4b6d41['name']]&&this['voiceQueues'][_0x4b6d41['name']][_0xac5b('0x72')]?this[_0xac5b('0x16')][_0x4b6d41['name']]['type']||_0xac5b('0x55'):'inbound';_0x4b6d41[_0xac5b('0x69')]=_0x4c7cd5[_0xac5b('0x69')];_0x4b6d41[_0xac5b('0x73')]=moment()[_0xac5b('0x74')](_0xac5b('0x75'));_0x4b6d41[_0xac5b('0x76')]=_0x4c7cd5[_0xac5b('0x76')];_0x4b6d41[_0xac5b('0x77')]=_0x4c7cd5['count'];_0x4b6d41[_0xac5b('0x4f')]=_0x4c7cd5[_0xac5b('0x4f')];_0x4b6d41[_0xac5b('0x78')]=this[_0xac5b('0x14')][_0x4c7cd5[_0xac5b('0x4f')]][_0xac5b('0x78')];logger[_0xac5b('0x6a')](_0xac5b('0x79'),_0x4b6d41[_0xac5b('0x51')],_0x4b6d41[_0xac5b('0x72')]);_[_0xac5b('0x7a')](_0x4b6d41,_['pick'](_0x4c7cd5,_[_0xac5b('0x7b')](_0x4b6d41)));this[_0xac5b('0x12')][_0x4c7cd5['uniqueid']][_0xac5b('0x7c')](_0x4b6d41);this[_0xac5b('0x14')][_0x4c7cd5[_0xac5b('0x4f')]]=_0x4b6d41;this['emitVoiceQueueChannelSave'](_0x4b6d41,_0xac5b('0x1f'));}}catch(_0x3d863d){logger[_0xac5b('0x3f')](_0xac5b('0x71'),_0x4c7cd5[_0xac5b('0x4f')],util['inspect'](_0x3d863d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xac5b('0xe')][_0xac5b('0x21')]=function(_0x2feffd){try{if(this[_0xac5b('0x61')](_0x2feffd)){logger['debug'](_0xac5b('0x7d'),_0x2feffd['uniqueid'],util[_0xac5b('0x43')](_0x2feffd,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2feffd[_0xac5b('0x4f')]]){var _0x372c9d=_[_0xac5b('0x7e')](this['queueReports'][_0x2feffd[_0xac5b('0x4f')]]);_0x372c9d[_0xac5b('0x7f')]=![];_0x372c9d[_0xac5b('0x80')]=null;_0x372c9d[_0xac5b('0x81')]=_0x2feffd[_0xac5b('0x81')];_0x372c9d[_0xac5b('0x82')]=_0x2feffd[_0xac5b('0x82')];_0x372c9d[_0xac5b('0x20')]=!![];_0x372c9d[_0xac5b('0x83')]=moment()[_0xac5b('0x74')](_0xac5b('0x75'));_0x372c9d['queuecallerexitreason']=_0xac5b('0x84');_0x372c9d['lastAssignedTo']=null;logger['info'](_0xac5b('0x85'),_0x372c9d['name'],_0x372c9d[_0xac5b('0x72')]);this[_0xac5b('0x14')][_0x2feffd[_0xac5b('0x4f')]]=_0x372c9d;this[_0xac5b('0x47')](_0x372c9d,_0xac5b('0x20'));}}}catch(_0x5222d0){logger[_0xac5b('0x3f')]('[%s][voiceQueueReport][queuecallerabandon]',_0x2feffd[_0xac5b('0x4f')],util['inspect'](_0x5222d0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xac5b('0xe')][_0xac5b('0x23')]=function(_0x522c48){try{if(this['isNotNull'](_0x522c48)){logger[_0xac5b('0x4a')]('[%s][voiceQueueReport][queuecallerleave]',_0x522c48['uniqueid'],util[_0xac5b('0x43')](_0x522c48,{'showHidden':![],'depth':null}));if(this[_0xac5b('0x12')][_0x522c48[_0xac5b('0x4f')]]){var _0x213acf=_[_0xac5b('0x7e')](this[_0xac5b('0x12')][_0x522c48['uniqueid']]);_0x213acf[_0xac5b('0x86')]=moment()[_0xac5b('0x74')]('YYYY-MM-DD\x20HH:mm:ss');_0x213acf[_0xac5b('0x87')]=_0x522c48[_0xac5b('0x87')];_0x213acf[_0xac5b('0x88')]=_0x522c48[_0xac5b('0x88')];logger['info'](_0xac5b('0x89'),_0x213acf[_0xac5b('0x51')],_0x213acf[_0xac5b('0x72')],_0x522c48[_0xac5b('0x87')],_0x522c48[_0xac5b('0x88')]);this[_0xac5b('0x14')][_0x522c48[_0xac5b('0x4f')]]=_0x213acf;this[_0xac5b('0x8a')](_0x213acf,_0xac5b('0x22'));}}}catch(_0x25141c){logger[_0xac5b('0x3f')](_0xac5b('0x8b'),_0x522c48[_0xac5b('0x4f')],util[_0xac5b('0x43')](_0x25141c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xac5b('0xe')][_0xac5b('0x8c')]=function(_0x3fffce){try{if(this['isNotNull'](_0x3fffce)){logger['debug']('[%s][voiceQueueReport][agentconnect]',_0x3fffce[_0xac5b('0x4f')],util['inspect'](_0x3fffce,{'showHidden':![],'depth':null}));if(this[_0xac5b('0x12')][_0x3fffce[_0xac5b('0x4f')]]){var _0x59ef2c=_[_0xac5b('0x7e')](this[_0xac5b('0x12')][_0x3fffce[_0xac5b('0x4f')]]);_0x59ef2c[_0xac5b('0x7f')]=!![];_0x59ef2c['queuecallerexitreason']='COMPLETEDBYAGENT';logger[_0xac5b('0x6a')](_0xac5b('0x8d'),_0x59ef2c['name'],_0x59ef2c[_0xac5b('0x72')]);}}}catch(_0x4f428a){logger['error'](_0xac5b('0x8e'),_0x3fffce[_0xac5b('0x4f')],util[_0xac5b('0x43')](_0x4f428a,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xac5b('0x25')]=function(_0xe6543b){try{if(this[_0xac5b('0x61')](_0xe6543b)){logger['debug'](_0xac5b('0x8f'),_0xe6543b[_0xac5b('0x4f')],util[_0xac5b('0x43')](_0xe6543b,{'showHidden':![],'depth':null}));if(this[_0xac5b('0x12')][_0xe6543b[_0xac5b('0x4f')]]){var _0x381895=_[_0xac5b('0x7e')](this[_0xac5b('0x12')][_0xe6543b[_0xac5b('0x4f')]]);_0x381895[_0xac5b('0x20')]=![];_0x381895[_0xac5b('0x83')]=null;_0x381895['assigned']=!![];_0x381895['lastAssignedTo']=_0xe6543b[_0xac5b('0x90')];_0x381895[_0xac5b('0x81')]=_0xe6543b[_0xac5b('0x81')];_0x381895[_0xac5b('0x7f')]=!![];_0x381895['queuecallerexit']=![];_0x381895[_0xac5b('0x91')]=null;if(!_0x381895[_0xac5b('0x92')]){if(_0xe6543b[_0xac5b('0x93')]==_0xac5b('0x92')){_0x381895[_0xac5b('0x94')]=_0xac5b('0x95');logger[_0xac5b('0x6a')](_0xac5b('0x96'),_0x381895[_0xac5b('0x51')],_0x381895[_0xac5b('0x72')]);}else{if(_[_0xac5b('0x97')](_0xe6543b[_0xac5b('0x3c')][_0xac5b('0x98')](),_0xac5b('0x99'))){if(this[_0xac5b('0x12')][_0xe6543b[_0xac5b('0x9a')]]){var _0x412734=_[_0xac5b('0x7e')](this['queueReports'][_0xe6543b[_0xac5b('0x9a')]]);_0x412734[_0xac5b('0x7f')]=![];_0x412734[_0xac5b('0x9b')]=!![];_0x412734[_0xac5b('0x91')]=moment(_0x381895[_0xac5b('0x73')])[_0xac5b('0x9c')](_0xe6543b[_0xac5b('0x81')],_0xac5b('0x9d'))[_0xac5b('0x74')](_0xac5b('0x75'));_0x412734[_0xac5b('0x94')]='FORWARDTRANSFER';_0x412734['transfer']=!![];_0x412734['transfertype']=_0xac5b('0x9e');_0x412734[_0xac5b('0x9f')]=_0xe6543b[_0xac5b('0xa0')];_0x412734['transferuniqueid']=_0xe6543b[_0xac5b('0x4f')];logger[_0xac5b('0x6a')](_0xac5b('0xa1'),_0x412734[_0xac5b('0x51')],_0x412734[_0xac5b('0x72')]);var _0x115f09=this['queueReports'][_0xe6543b['linkedid']];this[_0xac5b('0x12')][_0xe6543b[_0xac5b('0x9a')]]=this[_0xac5b('0x12')][_0xe6543b[_0xac5b('0x4f')]];this[_0xac5b('0x12')][_0xe6543b[_0xac5b('0x4f')]]=_0x115f09;}}else{_0x381895[_0xac5b('0x94')]=_0xac5b('0xa2')+_0xe6543b[_0xac5b('0x93')][_0xac5b('0xa3')]();logger[_0xac5b('0x6a')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x381895['name'],_0x381895[_0xac5b('0x72')],_0x381895[_0xac5b('0x94')]);}}}this['channels'][_0xe6543b[_0xac5b('0x4f')]]=_0x381895;this[_0xac5b('0x47')](_0x381895,_0xac5b('0x24'));}}}catch(_0x3ebcb7){logger['error'](_0xac5b('0x8f'),_0xe6543b[_0xac5b('0x4f')],util['inspect'](_0x3ebcb7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xac5b('0xe')][_0xac5b('0x27')]=function(_0x35a093){try{if(this[_0xac5b('0x61')](_0x35a093)){logger[_0xac5b('0x4a')](_0xac5b('0xa4'),_0x35a093[_0xac5b('0x4f')],util[_0xac5b('0x43')](_0x35a093,{'showHidden':![],'depth':null}));this[_0xac5b('0xa5')](_0x35a093[_0xac5b('0x4f')],_[_0xac5b('0x7b')](_0x35a093['variable'])[0x0],_0x35a093['value']);if(this['queueReports'][_0x35a093[_0xac5b('0x4f')]]){var _0x3bf6eb=_[_0xac5b('0x7e')](this[_0xac5b('0x12')][_0x35a093[_0xac5b('0x4f')]]);if(_0x3bf6eb){if(this[_0xac5b('0x61')](_0x35a093[_0xac5b('0xa6')])&&this[_0xac5b('0x61')](_0x35a093[_0xac5b('0xa6')][_0xac5b('0xa7')])){switch(_0x35a093[_0xac5b('0xa8')]){case _0xac5b('0xa9'):_0x3bf6eb[_0xac5b('0x9b')]=![];_0x3bf6eb[_0xac5b('0x91')]=null;break;case _0xac5b('0xaa'):_0x3bf6eb[_0xac5b('0xab')]=_0xac5b('0xac');_0x3bf6eb[_0xac5b('0x9b')]=!![];_0x3bf6eb[_0xac5b('0x91')]=moment()[_0xac5b('0x74')]('YYYY-MM-DD\x20HH:mm:ss');_0x3bf6eb[_0xac5b('0x86')]=moment()[_0xac5b('0x74')](_0xac5b('0x75'));logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x35a093['uniqueid'],util['inspect'](_0x3bf6eb,{'showHidden':![],'depth':null}));ami[_0xac5b('0x49')](_0xac5b('0xad'),_0x3bf6eb);break;default:_0x3bf6eb['queuecallerexit']=!![];_0x3bf6eb[_0xac5b('0x91')]=moment()[_0xac5b('0x74')](_0xac5b('0x75'));_0x3bf6eb[_0xac5b('0x86')]=moment()[_0xac5b('0x74')](_0xac5b('0x75'));}_0x3bf6eb['queuecallerabandon']=![];_0x3bf6eb[_0xac5b('0x83')]=null;_0x3bf6eb[_0xac5b('0x94')]=_0x35a093[_0xac5b('0xa8')];this[_0xac5b('0x14')][_0x35a093[_0xac5b('0x4f')]]=_0x3bf6eb;this['emitVoiceQueueChannelRemove'](_0x3bf6eb,_0xac5b('0xae'));}else if(this[_0xac5b('0x61')](_0x35a093[_0xac5b('0xa6')])&&this[_0xac5b('0x61')](_0x35a093[_0xac5b('0xa6')]['queueposition'])){if(!_0x3bf6eb[_0xac5b('0x20')]){_0x3bf6eb[_0xac5b('0x9b')]=!![];_0x3bf6eb['queuecallerexitAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3bf6eb[_0xac5b('0x94')]=_0xac5b('0xaf');_0x3bf6eb[_0xac5b('0x86')]=moment()[_0xac5b('0x74')](_0xac5b('0x75'));this[_0xac5b('0x14')][_0x35a093['uniqueid']]=_0x3bf6eb;}}logger['info'](_0xac5b('0xb0'),_0x35a093[_0xac5b('0x4f')],_0x3bf6eb[_0xac5b('0x51')],_0x3bf6eb[_0xac5b('0x72')],_[_0xac5b('0x7b')](_0x35a093['variable'])[0x0],_0x35a093['value']);_0x3bf6eb[_0xac5b('0x19')]=this[_0xac5b('0x19')][_0x35a093[_0xac5b('0x4f')]];}}}}catch(_0x6030c2){logger[_0xac5b('0x3f')](_0xac5b('0xa4'),_0x35a093['uniqueid'],util[_0xac5b('0x43')](_0x6030c2,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['addVariable']=function(_0xf3f246,_0x1b879c,_0x20d341){var _0x344392=[_0xac5b('0xb1'),_0xac5b('0xb2'),_0xac5b('0xb3'),_0xac5b('0xb4'),_0xac5b('0xb5'),'rtpaudioqoslossbridged',_0xac5b('0xb6'),_0xac5b('0xb7'),_0xac5b('0xb8'),'sipuri',_0xac5b('0xb9'),_0xac5b('0xba'),_0xac5b('0xbb'),_0xac5b('0xbc'),_0xac5b('0xbd'),_0xac5b('0xbe'),'membername','memberpenalty','memberrealtime'];if(!_[_0xac5b('0x3b')](_0x1b879c)&&!_[_0xac5b('0xbf')](_0x344392,_0x1b879c)){if(_[_0xac5b('0x62')](this[_0xac5b('0x19')][_0xf3f246])){this['variables'][_0xf3f246]={};}this[_0xac5b('0x19')][_0xf3f246][_0x1b879c]=_0x20d341;}};VoiceQueueReport['prototype'][_0xac5b('0x29')]=function(_0x203de6){try{if(this['isNotNull'](_0x203de6)){logger['debug']('[%s][voiceQueueReport][hangup]',_0x203de6[_0xac5b('0x4f')],util['inspect'](_0x203de6,{'showHidden':![],'depth':null}));if(this[_0xac5b('0x12')][_0x203de6[_0xac5b('0x4f')]]){for(var _0x26bb01=0x0,_0x12ff12={};_0x26bb01<this[_0xac5b('0x12')][_0x203de6['uniqueid']][_0xac5b('0xc0')];_0x26bb01+=0x1){_0x12ff12=this[_0xac5b('0x12')][_0x203de6['uniqueid']][_0x26bb01];if(this[_0xac5b('0x16')][_0x12ff12[_0xac5b('0x69')]]){if(_0x12ff12[_0xac5b('0x9b')]&&_0x12ff12['transfer']!=!![]){this[_0xac5b('0x16')][_0x12ff12[_0xac5b('0x69')]][_0xac5b('0xc1')]+=0x1;}if(_0x12ff12[_0xac5b('0x20')]){this[_0xac5b('0x16')][_0x12ff12[_0xac5b('0x69')]][_0xac5b('0xc2')]+=0x1;}this[_0xac5b('0x16')][_0x12ff12[_0xac5b('0x69')]]['sumHoldTime']+=moment(_0x12ff12[_0xac5b('0x86')])[_0xac5b('0xc3')](_0x12ff12[_0xac5b('0x73')],_0xac5b('0x9d'))||0x0;if(_0x26bb01===this[_0xac5b('0x12')][_0x203de6['uniqueid']]['length']-0x1){this[_0xac5b('0x16')][_0x12ff12[_0xac5b('0x69')]]['sumDuration']+=moment()[_0xac5b('0xc4')](0x0)[_0xac5b('0xc3')](_0x12ff12[_0xac5b('0x73')],_0xac5b('0x9d'));this['voiceQueues'][_0x12ff12[_0xac5b('0x69')]][_0xac5b('0xc5')]+=0x1;if(_0x12ff12[_0xac5b('0x7f')]){this[_0xac5b('0x16')][_0x12ff12[_0xac5b('0x69')]][_0xac5b('0x57')]+=0x1;this['voiceQueues'][_0x12ff12[_0xac5b('0x69')]][_0xac5b('0x5a')]+=moment()[_0xac5b('0xc4')](0x0)['diff'](_0x12ff12[_0xac5b('0x86')],_0xac5b('0x9d'));_0x12ff12[_0xac5b('0x80')]=moment()[_0xac5b('0x74')](_0xac5b('0x75'));_0x12ff12[_0xac5b('0x9b')]=![];_0x12ff12[_0xac5b('0x91')]=null;}if(_0x12ff12['queuecallerexit']&&_0x12ff12[_0xac5b('0x92')]!=!![]){_0x12ff12[_0xac5b('0xab')]=_0xac5b('0xc1');logger[_0xac5b('0x4a')](_0xac5b('0xc6'),_0x203de6['uniqueid'],util[_0xac5b('0x43')](_0x12ff12,{'showHidden':![],'depth':null}));ami[_0xac5b('0x49')]('custom:queuecallerunmanaged',_0x12ff12);}if(_0x12ff12[_0xac5b('0x20')]){_0x12ff12['lastevent']=_0xac5b('0xc2');logger[_0xac5b('0x4a')](_0xac5b('0xc7'),_0x203de6['uniqueid'],util['inspect'](_0x12ff12,{'showHidden':![],'depth':null}));ami['emit']('custom:queuecallerabandon',_0x12ff12);}}else{this['voiceQueues'][_0x12ff12[_0xac5b('0x69')]][_0xac5b('0xc8')]+=this[_0xac5b('0x16')][_0x12ff12['queue']][_0xac5b('0xc9')];}logger[_0xac5b('0x6a')]('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0x203de6['uniqueid'],_0x12ff12['name'],_0x12ff12['type'],_0x203de6['cause-txt']);this[_0xac5b('0x14')][_0x203de6['uniqueid']]=_0x12ff12;this[_0xac5b('0x47')](_0x12ff12,_0xac5b('0x28'));this['emitVoiceQueueSummary'](this[_0xac5b('0x16')][_0x12ff12[_0xac5b('0x69')]],_0xac5b('0x28'));}}logger[_0xac5b('0x4a')](_0xac5b('0xca'),_0x203de6[_0xac5b('0x4f')],util[_0xac5b('0x43')](this[_0xac5b('0x12')][_0x203de6[_0xac5b('0x4f')]],{'showHidden':![],'depth':null}));ami[_0xac5b('0x49')](_0xac5b('0xcb'),this[_0xac5b('0x12')][_0x203de6[_0xac5b('0x4f')]]);delete this[_0xac5b('0x12')][_0x203de6[_0xac5b('0x4f')]];delete this[_0xac5b('0x14')][_0x203de6[_0xac5b('0x4f')]];}if(this[_0xac5b('0x19')][_0x203de6[_0xac5b('0x4f')]]){delete this[_0xac5b('0x19')][_0x203de6[_0xac5b('0x4f')]];}}}catch(_0x5481cb){logger[_0xac5b('0x3f')](_0xac5b('0xcc'),_0x203de6[_0xac5b('0x4f')],util[_0xac5b('0x43')](_0x5481cb,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAttendedTransfer']=function(_0x3fd484){try{if(this['isNotNull'](_0x3fd484)){logger[_0xac5b('0x4a')](_0xac5b('0xcd'),_0x3fd484[_0xac5b('0x4f')],util['inspect'](_0x3fd484,{'showHidden':![],'depth':null}));var _0x284184;if(this[_0xac5b('0x12')][_0x3fd484[_0xac5b('0xce')]]){_0x284184=_['last'](this['queueReports'][_0x3fd484['transfereeuniqueid']]);_0x284184[_0xac5b('0x9f')]=_0x3fd484[_0xac5b('0xcf')];_0x284184[_0xac5b('0xd0')]=_0x3fd484[_0xac5b('0xd1')];_0x284184['queuecallerexitreason']=_0xac5b('0xd2');_0x284184[_0xac5b('0x92')]=!![];_0x284184['transfertype']='ATTENDED';if(this[_0xac5b('0x12')][_0x3fd484['secondtransfereruniqueid']]){var _0x4f5b1e=this[_0xac5b('0x12')][_0x3fd484[_0xac5b('0xd1')]];this['queueReports'][_0x3fd484[_0xac5b('0xd1')]]=this[_0xac5b('0x12')][_0x3fd484[_0xac5b('0xce')]];this[_0xac5b('0x12')][_0x3fd484[_0xac5b('0xce')]]=_0x4f5b1e;var _0x54a9b4=_['last'](this[_0xac5b('0x12')][_0x3fd484[_0xac5b('0xce')]]);_0x54a9b4[_0xac5b('0x3a')]=!![];}logger[_0xac5b('0x6a')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x3fd484['uniqueid'],_0x284184['name'],_0x284184[_0xac5b('0x72')],_0x284184['transferexten'],_0x284184['transferuniqueid']);}else if(this[_0xac5b('0x12')][_0x3fd484[_0xac5b('0xd3')]]){_0x284184=_[_0xac5b('0x7e')](this[_0xac5b('0x12')][_0x3fd484[_0xac5b('0xd3')]]);_0x284184['transferexten']=_0x3fd484[_0xac5b('0xd4')];_0x284184['transferuniqueid']=_0x3fd484[_0xac5b('0xd5')];_0x284184['queuecallerexitreason']=_0xac5b('0xd2');_0x284184[_0xac5b('0x92')]=!![];_0x284184['transfertype']='ATTENDED';if(this[_0xac5b('0x12')][_0x3fd484[_0xac5b('0xd5')]]){var _0x4f5b1e=this[_0xac5b('0x12')][_0x3fd484[_0xac5b('0xd5')]];this['queueReports'][_0x3fd484['origtransfereruniqueid']]=this[_0xac5b('0x12')][_0x3fd484[_0xac5b('0xd3')]];this[_0xac5b('0x12')][_0x3fd484['transfertargetuniqueid']]=_0x4f5b1e;var _0x54a9b4=_[_0xac5b('0x7e')](this[_0xac5b('0x12')][_0x3fd484['transfertargetuniqueid']]);_0x54a9b4[_0xac5b('0x3a')]=!![];}logger[_0xac5b('0x6a')](_0xac5b('0xd6'),_0x3fd484['uniqueid'],_0x284184[_0xac5b('0x51')],_0x284184[_0xac5b('0x72')],_0x284184['transferexten'],_0x284184[_0xac5b('0xd0')]);}}}catch(_0x30b7d6){logger[_0xac5b('0x3f')](_0xac5b('0xcd'),_0x3fd484[_0xac5b('0x4f')],util[_0xac5b('0x43')](_0x30b7d6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xac5b('0xe')][_0xac5b('0xd7')]=function(_0x3e5eba){try{if(this[_0xac5b('0x61')](_0x3e5eba)){logger[_0xac5b('0x4a')](_0xac5b('0xd8'),_0x3e5eba[_0xac5b('0x4f')],util['inspect'](_0x3e5eba,{'showHidden':![],'depth':null}));if(this[_0xac5b('0x12')][_0x3e5eba[_0xac5b('0xce')]]){var _0x29a070=_[_0xac5b('0x7e')](this['queueReports'][_0x3e5eba[_0xac5b('0xce')]]);_0x29a070[_0xac5b('0x94')]=_0xac5b('0xd9');_0x29a070[_0xac5b('0x92')]=!![];_0x29a070[_0xac5b('0xda')]='BLIND';_0x29a070['transferexten']=_0x3e5eba[_0xac5b('0xdb')];_0x29a070[_0xac5b('0xd0')]=_0x3e5eba[_0xac5b('0xce')];logger[_0xac5b('0x6a')](_0xac5b('0xdc'),_0x3e5eba['uniqueid'],_0x29a070[_0xac5b('0x51')],_0x29a070[_0xac5b('0x72')],_0x29a070['transferexten'],_0x29a070['transferuniqueid']);this['syncHangup']({'event':_0xac5b('0xdd'),'uniqueid':_0x3e5eba[_0xac5b('0xce')],'context':_0x3e5eba[_0xac5b('0xde')],'channel':_0x3e5eba[_0xac5b('0xdf')]});}}}catch(_0x6287c0){logger['error'](_0xac5b('0xd8'),_0x3e5eba[_0xac5b('0x4f')],util['inspect'](_0x6287c0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xac5b('0xe')][_0xac5b('0x2c')]=function(_0x1c5eae){try{if(this[_0xac5b('0x61')](_0x1c5eae)){logger[_0xac5b('0x4a')]('[%s][voiceQueueReport][musiconholdstart]',_0x1c5eae[_0xac5b('0x4f')],util[_0xac5b('0x43')](_0x1c5eae,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1c5eae[_0xac5b('0x4f')]]){var _0x255567=_[_0xac5b('0x7e')](this['queueReports'][_0x1c5eae['uniqueid']]);if(!_[_0xac5b('0x3b')](_0x255567[_0xac5b('0x86')])){_0x255567[_0xac5b('0xe0')]=moment()[_0xac5b('0x74')](_0xac5b('0x75'));logger['info'](_0xac5b('0xe1'),_0x1c5eae['uniqueid'],_0x255567[_0xac5b('0xe0')]);}}}}catch(_0x542be1){logger['error'](_0xac5b('0xe2'),_0x1c5eae[_0xac5b('0x4f')],util['inspect'](_0x542be1,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncMusicOnHoldStop']=function(_0x3715ae){try{if(this[_0xac5b('0x61')](_0x3715ae)){logger[_0xac5b('0x4a')]('[%s][voiceQueueReport][musiconholdstop]',_0x3715ae[_0xac5b('0x4f')],util[_0xac5b('0x43')](_0x3715ae,{'showHidden':![],'depth':null}));if(this[_0xac5b('0x12')][_0x3715ae[_0xac5b('0x4f')]]){var _0x19146e=_[_0xac5b('0x7e')](this['queueReports'][_0x3715ae['uniqueid']]);if(!_[_0xac5b('0x3b')](_0x19146e[_0xac5b('0xe0')])){_0x19146e[_0xac5b('0xe3')]+=moment()[_0xac5b('0xc4')](0x0)[_0xac5b('0xc3')](_0x19146e['mohstarttime'],_0xac5b('0x9d'));logger[_0xac5b('0x6a')](_0xac5b('0xe4'),_0x3715ae['uniqueid'],_0x19146e['mohtime']);delete _0x19146e[_0xac5b('0xe0')];}}}}catch(_0x3555){logger['error']('[%s][voiceQueueReport][musiconholdstop]',_0x3715ae[_0xac5b('0x4f')],util[_0xac5b('0x43')](_0x3555,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xac5b('0xe')][_0xac5b('0x2a')]=function(_0x146358){try{if(this[_0xac5b('0x61')](_0x146358)){logger[_0xac5b('0x4a')](_0xac5b('0xe5'),_0x146358[_0xac5b('0x4f')],util[_0xac5b('0x43')](_0x146358,{'showHidden':![],'depth':null}));if(_0x146358[_0xac5b('0xe6')][_0xac5b('0x98')]()===_0xac5b('0xe7')){_0x146358[_0xac5b('0xe8')]=_0x146358[_0xac5b('0xe9')]&&_0x146358[_0xac5b('0xe9')][_0xac5b('0x97')](_0xac5b('0xea'))?_0x146358[_0xac5b('0xe9')]:(_0x146358[_0xac5b('0xe9')]||_0x146358[_0xac5b('0xe8')])[_0xac5b('0x98')]();if(_[_0xac5b('0x97')](_0x146358[_0xac5b('0xe8')]['toLowerCase'](),_0xac5b('0xeb'))){logger[_0xac5b('0x6a')]('[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s',_0x146358[_0xac5b('0x4f')],_0x146358[_0xac5b('0xe6')],_0x146358[_0xac5b('0xe8')]);if(_['isUndefined'](this[_0xac5b('0x14')][_0x146358['uniqueid']]))this[_0xac5b('0x14')][_0x146358[_0xac5b('0x4f')]]={};var _0x3f71e1=_0x146358[_0xac5b('0xe8')][_0xac5b('0xec')]('=');var _0x7a6929=_0x3f71e1[0x0][_0xac5b('0x98')]()['match'](/cdr\((.*)\)/);if(_0x7a6929)this[_0xac5b('0x14')][_0x146358['uniqueid']][_0x7a6929[0x1]]=_0x3f71e1[0x1];}}}}catch(_0x4c91d0){logger[_0xac5b('0x3f')](_0xac5b('0xed'),_0x146358['uniqueid'],util[_0xac5b('0x43')](_0x4c91d0,{'showHidden':![],'depth':null}));}};module[_0xac5b('0xee')]=VoiceQueueReport;
\ No newline at end of file
+var _0x3f8c=['[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfereruniqueid','ATTENDEDTRANSFER','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','ATTENDED','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','extension','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][musiconholdstop]','[%s][voiceQueueReport][newexten]\x20event:','appdata','CDR(routeAlias)','applicationdata','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','application','match','[%s][voiceQueueReport][newexten]','exports','util','md5','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','prototype','tail','finally','sequence','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','agentconnect','syncAgentConnect','syncVarSet','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','waiting','queueStatusComplete','unlockRR','switch','enqueue','isNil','status','channel','catch','error','[%s][voiceQueueReport][checkChannel]','inspect','queueReports','[%s][voiceQueueReport][checkQueueReport]','variables','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','emit','emitVoiceQueueChannelSave','debug','uniqueid','format','voice_queue_channel:save','voice_queue_presence:save','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:remove\x20event:','name','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','strategy','answered','loggedIn','pTalking','sumDuration','sumHoldTime','total','abandoned','Trunk','active','callerid','Interval','stringify','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice:queue:%s','voice_queue:save','isNotNull','isUndefined','clearZombieChannels','Action','queues','[voiceQueueReport][queues]','then','queue','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','callers','toNumber','loggedin','available','[voiceQueueReport][queuesummary]','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','position','count','routealias','merge','push','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerexitreason','ABANDONED','lastAssignedTo','syncQueueCallerLeave','queuecallerleaveAt','connectedlinenum','connectedlinename','[%s][voiceQueueReport][agentconnect]','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','queuecallerabandonAt','assigned','queuecallerexit','queuecallerexitAt','transfer','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','add','seconds','YYYY-MM-DD\x20HH:mm:ss','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','linkedid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','agentcomplete','[%s][voiceQueueReport][varset]','keys','variable','value','queuestatus','CONTINUE','TIMEOUT','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','EXITWITHKEY','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','membername','includes','[%s][voiceQueueReport][hangup]','length','diff','milliseconds','sumBillable','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','hangup','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','syncAttendedTransfer'];(function(_0x1282ab,_0x2cfddf){var _0x56cd0c=function(_0x23cc56){while(--_0x23cc56){_0x1282ab['push'](_0x1282ab['shift']());}};_0x56cd0c(++_0x2cfddf);}(_0x3f8c,0x104));var _0xc3f8=function(_0x3346be,_0x50de19){_0x3346be=_0x3346be-0x0;var _0x2437ce=_0x3f8c[_0x3346be];return _0x2437ce;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0xc3f8('0x0'));var md5=require(_0xc3f8('0x1'));var Redis=require(_0xc3f8('0x2'));var config=require(_0xc3f8('0x3'));var logger=require('../../../config/logger')('ami');var ami=require('../ami');var QueueReport=require('../model/queueReport');config['redis']=_[_0xc3f8('0x4')](config[_0xc3f8('0x5')],{'host':_0xc3f8('0x6'),'port':0x18eb});var io=require(_0xc3f8('0x7'))(new Redis(config[_0xc3f8('0x5')]));var Sequence=function(){};Sequence[_0xc3f8('0x8')]['enqueue']=function(_0x28397e){this[_0xc3f8('0x9')]=this[_0xc3f8('0x9')]?this[_0xc3f8('0x9')][_0xc3f8('0xa')](_0x28397e):_0x28397e();};function VoiceQueueReport(_0x67f688){this[_0xc3f8('0xb')]=new Sequence();this['queueReports']={};this[_0xc3f8('0xc')]=_0x67f688[_0xc3f8('0xc')];this[_0xc3f8('0xd')]=_0x67f688[_0xc3f8('0xe')];this['voiceQueues']=_0x67f688[_0xc3f8('0xf')];this[_0xc3f8('0x10')]=!![];this[_0xc3f8('0x11')]=_0x67f688[_0xc3f8('0x11')];this['variables']={};ami['on'](_0xc3f8('0x12'),this[_0xc3f8('0x13')][_0xc3f8('0x14')](this));ami['on'](_0xc3f8('0x15'),this[_0xc3f8('0x16')][_0xc3f8('0x14')](this));ami['on'](_0xc3f8('0x17'),this[_0xc3f8('0x18')][_0xc3f8('0x14')](this));ami['on'](_0xc3f8('0x19'),this[_0xc3f8('0x1a')][_0xc3f8('0x14')](this));ami['on'](_0xc3f8('0x1b'),this['syncQueueCallerLeave'][_0xc3f8('0x14')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0xc3f8('0x14')](this));ami['on'](_0xc3f8('0x1c'),this[_0xc3f8('0x1d')][_0xc3f8('0x14')](this));ami['on']('varset',this[_0xc3f8('0x1e')][_0xc3f8('0x14')](this));ami['on']('hangup',this[_0xc3f8('0x1f')]['bind'](this));ami['on'](_0xc3f8('0x20'),this[_0xc3f8('0x21')][_0xc3f8('0x14')](this));ami['on']('newexten',this['syncNewExten'][_0xc3f8('0x14')](this));ami['on'](_0xc3f8('0x22'),this[_0xc3f8('0x23')][_0xc3f8('0x14')](this));ami['on'](_0xc3f8('0x24'),this[_0xc3f8('0x25')][_0xc3f8('0x14')](this));ami['on'](_0xc3f8('0x26'),this['syncAttendedTransfer']['bind'](this));ami['on']('blindtransfer',this[_0xc3f8('0x27')]['bind'](this));this[_0xc3f8('0x28')]();this[_0xc3f8('0x29')]();}function clearChannels(_0x5c13fc){if(!_[_0xc3f8('0x2a')](_0x5c13fc)){for(var _0x327b2d in _0x5c13fc){if(_0x5c13fc[_0xc3f8('0x2b')](_0x327b2d)){delete _0x5c13fc[_0x327b2d];}}}}function clearCampaigns(_0xb883b5){if(!_[_0xc3f8('0x2a')](_0xb883b5)){for(var _0x9d43b4 in _0xb883b5){if(_0xb883b5[_0xc3f8('0x2b')](_0x9d43b4)){_0xb883b5[_0x9d43b4][_0xc3f8('0x2c')]=0x0;}}}}function clearVoiceQueues(_0x21b002){if(!_[_0xc3f8('0x2a')](_0x21b002)){for(var _0x22c8e6 in _0x21b002){if(_0x21b002[_0xc3f8('0x2b')](_0x22c8e6)){_0x21b002[_0x22c8e6][_0xc3f8('0x2c')]=0x0;_0x21b002[_0x22c8e6][_0xc3f8('0x2d')]=0x0;_0x21b002[_0x22c8e6]['pTalking']=0x0;_0x21b002[_0x22c8e6][_0xc3f8('0x2e')]=0x0;_0x21b002[_0x22c8e6][_0xc3f8('0x2f')]=!![];}}}}function clearAgentBooked(_0x218029){if(!_['isEmpty'](_0x218029)){for(var _0x151bba in _0x218029){if(_0x218029['hasOwnProperty'](_0x151bba)){_0x218029[_0x151bba][_0xc3f8('0x30')]=!![];}}}}VoiceQueueReport[_0xc3f8('0x8')]['clearZombieChannels']=function(){var _0x48b32e=this;for(var _0x21a225 in this[_0xc3f8('0xd')]){if(this[_0xc3f8('0xd')][_0xc3f8('0x2b')](_0x21a225)&&!this[_0xc3f8('0xd')][_0x21a225][_0xc3f8('0x31')]){this[_0xc3f8('0xb')][_0xc3f8('0x32')](function(){if(!_[_0xc3f8('0x33')](_0x48b32e[_0xc3f8('0xd')][_0x21a225])){return ami['Action']({'action':_0xc3f8('0x34'),'channel':_0x48b32e[_0xc3f8('0xd')][_0x21a225][_0xc3f8('0x35')]})[_0xc3f8('0x36')](function(_0x31e86){if(_0x31e86['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x48b32e[_0xc3f8('0xd')][_0x21a225]){delete _0x48b32e[_0xc3f8('0xd')][_0x21a225];logger[_0xc3f8('0x37')](_0xc3f8('0x38'),_0x21a225,util[_0xc3f8('0x39')](_0x31e86,{'showHidden':![],'depth':null}));}if(_0x48b32e['queueReports'][_0x21a225]){delete _0x48b32e[_0xc3f8('0x3a')][_0x21a225];logger[_0xc3f8('0x37')](_0xc3f8('0x3b'),_0x21a225,util['inspect'](_0x31e86,{'showHidden':![],'depth':null}));}if(_0x48b32e[_0xc3f8('0x3c')][_0x21a225]){delete _0x48b32e[_0xc3f8('0x3c')][_0x21a225];logger[_0xc3f8('0x37')]('[%s][voiceQueueReport][checkVariables]',_0x21a225,util[_0xc3f8('0x39')](_0x31e86,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0xc3f8('0x8')]['syncFullyBooted']=function(){logger[_0xc3f8('0x37')](_0xc3f8('0x3d'));clearChannels(this[_0xc3f8('0xd')]);this[_0xc3f8('0x3e')](this[_0xc3f8('0x3a')]);clearAgentBooked(this[_0xc3f8('0xc')]);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0xc3f8('0x11')]);};VoiceQueueReport[_0xc3f8('0x8')][_0xc3f8('0x3e')]=function(_0x2f589d){var _0x17aff0=this;if(!_['isEmpty'](_0x2f589d)){for(var _0x3dede2 in _0x2f589d){if(_0x2f589d[_0xc3f8('0x2b')](_0x3dede2)){_0x17aff0[_0xc3f8('0x3f')](_0x2f589d[_0x3dede2],'clearqueuereport');delete _0x2f589d[_0x3dede2];}}}};VoiceQueueReport[_0xc3f8('0x8')][_0xc3f8('0x40')]=function(_0x1e48aa,_0x2d4167,_0x57e51d){io['to'](_0x1e48aa)[_0xc3f8('0x40')](_0x2d4167,_0x57e51d);};VoiceQueueReport[_0xc3f8('0x8')][_0xc3f8('0x41')]=function(_0x37b104,_0x55ae1f){logger[_0xc3f8('0x42')]('[%s][voiceQueueReport]['+_0x55ae1f+']\x20sending\x20voice_queue_channel:save\x20event:',_0x37b104[_0xc3f8('0x43')],util[_0xc3f8('0x39')](_0x37b104,{'showHidden':![],'depth':null}));this[_0xc3f8('0x40')](util[_0xc3f8('0x44')]('voice:queue:%s',_0x37b104['name']),_0xc3f8('0x45'),_0x37b104);io[_0xc3f8('0x40')](_0xc3f8('0x46'),_0x37b104);};VoiceQueueReport[_0xc3f8('0x8')][_0xc3f8('0x3f')]=function(_0x465547,_0x3113b4){logger[_0xc3f8('0x42')](_0xc3f8('0x47')+_0x3113b4+_0xc3f8('0x48'),_0x465547[_0xc3f8('0x43')],util['inspect'](_0x465547,{'showHidden':![],'depth':null}));this[_0xc3f8('0x40')](util[_0xc3f8('0x44')]('voice:queue:%s',_0x465547[_0xc3f8('0x49')]),_0xc3f8('0x4a'),_0x465547);io['emit'](_0xc3f8('0x4b'),_0x465547);};VoiceQueueReport[_0xc3f8('0x8')][_0xc3f8('0x4c')]=function(_0x198ef2,_0x2521c2){if(_0x198ef2[_0xc3f8('0x4d')]===_0xc3f8('0x4e')){var _0x3bf513={'id':_0x198ef2['id'],'name':_0x198ef2[_0xc3f8('0x49')],'strategy':_0x198ef2[_0xc3f8('0x4f')],'answered':_0x198ef2[_0xc3f8('0x50')],'available':_0x198ef2['available'],'loggedIn':_0x198ef2[_0xc3f8('0x51')],'pTalking':_0x198ef2[_0xc3f8('0x52')],'sumBillable':_0x198ef2['sumBillable'],'sumDuration':_0x198ef2[_0xc3f8('0x53')],'sumHoldTime':_0x198ef2[_0xc3f8('0x54')]||0x0,'talking':_0x198ef2[_0xc3f8('0x2d')],'total':_0x198ef2[_0xc3f8('0x55')],'type':_0x198ef2['type'],'unmanaged':_0x198ef2['unmanaged'],'abandoned':_0x198ef2[_0xc3f8('0x56')],'waiting':_0x198ef2[_0xc3f8('0x2e')]};if(_0x198ef2[_0xc3f8('0x57')]){_0x3bf513['Trunk']={'id':_0x198ef2[_0xc3f8('0x57')]['id'],'name':_0x198ef2[_0xc3f8('0x57')][_0xc3f8('0x49')],'active':_0x198ef2[_0xc3f8('0x57')][_0xc3f8('0x58')],'callerid':_0x198ef2['Trunk'][_0xc3f8('0x59')]};}if(_0x198ef2[_0xc3f8('0x5a')]){_0x3bf513['Interval']={'id':_0x198ef2[_0xc3f8('0x5a')]['id'],'name':_0x198ef2[_0xc3f8('0x5a')][_0xc3f8('0x49')]};}var _0x2916c8=md5(JSON[_0xc3f8('0x5b')](_0x3bf513));if(_0x198ef2[_0xc3f8('0x1')]!==_0x2916c8){_0x198ef2[_0xc3f8('0x1')]=_0x2916c8;logger['debug'](_0xc3f8('0x5c')+_0x2521c2+_0xc3f8('0x5d'),util['inspect'](_0x3bf513,{'showHidden':![],'depth':null}));this[_0xc3f8('0x40')](util[_0xc3f8('0x44')](_0xc3f8('0x5e'),_0x3bf513[_0xc3f8('0x49')]),_0xc3f8('0x5f'),_0x3bf513);}}};VoiceQueueReport[_0xc3f8('0x8')][_0xc3f8('0x60')]=function(_0x4d58b2){return _0x4d58b2!==null&&!_[_0xc3f8('0x61')](_0x4d58b2);};VoiceQueueReport[_0xc3f8('0x8')][_0xc3f8('0x29')]=function(){var _0x267c95=this;setInterval(function(){_0x267c95[_0xc3f8('0x62')]();ami[_0xc3f8('0x63')]({'action':_0xc3f8('0x64')})[_0xc3f8('0x36')](function(_0x4fc02c){logger['error'](_0xc3f8('0x65'),util[_0xc3f8('0x39')](_0x4fc02c,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport['prototype']['loopQueueSummary']=function(){var _0x773d56=this;setInterval(function(){if(_0x773d56['flagQueueSummary']){return ami[_0xc3f8('0x63')]({'action':_0xc3f8('0x12')})[_0xc3f8('0x66')](function(_0x5292a0){_0x773d56[_0xc3f8('0x10')]=![];})['catch'](function(_0x4d8436){logger[_0xc3f8('0x37')]('[voiceQueueReport][queuesummary]',util[_0xc3f8('0x39')](_0x4d8436,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0xc3f8('0x8')][_0xc3f8('0x13')]=function(_0x490f37){try{if(this[_0xc3f8('0x60')](_0x490f37)&&this[_0xc3f8('0x60')](_0x490f37[_0xc3f8('0x67')])){logger[_0xc3f8('0x42')](_0xc3f8('0x68'),util['inspect'](_0x490f37,{'showHidden':![],'depth':null}));if(this['voiceQueues'][_0x490f37[_0xc3f8('0x67')]]){logger[_0xc3f8('0x69')](_0xc3f8('0x6a'),_0x490f37[_0xc3f8('0x67')]);var _0x1c7f08=_['countBy'](this[_0xc3f8('0xd')],'queue')[_0x490f37[_0xc3f8('0x67')]]||0x0;var _0x337029=_0x1c7f08-_0x490f37[_0xc3f8('0x6b')];if(this[_0xc3f8('0xf')][_0x490f37['queue']][_0xc3f8('0x2e')]!==_['toNumber'](_0x490f37['callers'])||this['voiceQueues'][_0x490f37['queue']][_0xc3f8('0x51')]!==_[_0xc3f8('0x6c')](_0x490f37[_0xc3f8('0x6d')])||this[_0xc3f8('0xf')][_0x490f37[_0xc3f8('0x67')]][_0xc3f8('0x6e')]!==_[_0xc3f8('0x6c')](_0x490f37[_0xc3f8('0x6e')])||this['voiceQueues'][_0x490f37[_0xc3f8('0x67')]][_0xc3f8('0x2d')]!==_0x337029){this[_0xc3f8('0xf')][_0x490f37[_0xc3f8('0x67')]][_0xc3f8('0x2e')]=_['toNumber'](_0x490f37[_0xc3f8('0x6b')]);this[_0xc3f8('0xf')][_0x490f37[_0xc3f8('0x67')]][_0xc3f8('0x51')]=_[_0xc3f8('0x6c')](_0x490f37['loggedin']);this[_0xc3f8('0xf')][_0x490f37[_0xc3f8('0x67')]][_0xc3f8('0x6e')]=_[_0xc3f8('0x6c')](_0x490f37[_0xc3f8('0x6e')]);this[_0xc3f8('0xf')][_0x490f37['queue']][_0xc3f8('0x2d')]=_0x337029>0x0?_0x337029:0x0;this[_0xc3f8('0xf')][_0x490f37[_0xc3f8('0x67')]]['talking']=this[_0xc3f8('0xf')][_0x490f37[_0xc3f8('0x67')]]['talking']>_['toNumber'](_0x490f37[_0xc3f8('0x6d')])?_[_0xc3f8('0x6c')](_0x490f37['loggedin']):this[_0xc3f8('0xf')][_0x490f37[_0xc3f8('0x67')]][_0xc3f8('0x2d')];this[_0xc3f8('0x4c')](this[_0xc3f8('0xf')][_0x490f37[_0xc3f8('0x67')]],_0xc3f8('0x12'));}logger[_0xc3f8('0x42')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util['inspect'](this[_0xc3f8('0xf')][_0x490f37['queue']],{'showHidden':![],'depth':null}));ami['emit']('custom:queuesummary',this['voiceQueues'][_0x490f37['queue']]);}}}catch(_0x2ba4ad){logger[_0xc3f8('0x37')](_0xc3f8('0x6f'),util[_0xc3f8('0x39')](_0x2ba4ad,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xc3f8('0x16')]=function(_0x2d0b58){logger['debug'](_0xc3f8('0x70'),util[_0xc3f8('0x39')](_0x2d0b58,{'showHidden':![],'depth':null}));this[_0xc3f8('0x10')]=!![];};VoiceQueueReport['prototype'][_0xc3f8('0x18')]=function(_0x5e3125){try{if(this['isNotNull'](_0x5e3125)){logger['debug'](_0xc3f8('0x71'),_0x5e3125[_0xc3f8('0x43')],util['inspect'](_0x5e3125,{'showHidden':![],'depth':null}));if(_[_0xc3f8('0x61')](this[_0xc3f8('0x3a')][_0x5e3125['uniqueid']]))this[_0xc3f8('0x3a')][_0x5e3125[_0xc3f8('0x43')]]=[];if(_['isUndefined'](this[_0xc3f8('0xd')][_0x5e3125['uniqueid']]))this[_0xc3f8('0xd')][_0x5e3125[_0xc3f8('0x43')]]={};var _0x4cc654=new QueueReport();_0x4cc654['name']=_0x5e3125[_0xc3f8('0x67')];_0x4cc654[_0xc3f8('0x4d')]=this['voiceQueues'][_0x4cc654[_0xc3f8('0x49')]]&&this['voiceQueues'][_0x4cc654[_0xc3f8('0x49')]]['type']?this[_0xc3f8('0xf')][_0x4cc654[_0xc3f8('0x49')]][_0xc3f8('0x4d')]||_0xc3f8('0x4e'):_0xc3f8('0x4e');_0x4cc654[_0xc3f8('0x67')]=_0x5e3125[_0xc3f8('0x67')];_0x4cc654[_0xc3f8('0x72')]=moment()[_0xc3f8('0x44')]('YYYY-MM-DD\x20HH:mm:ss');_0x4cc654[_0xc3f8('0x73')]=_0x5e3125[_0xc3f8('0x73')];_0x4cc654[_0xc3f8('0x74')]=_0x5e3125[_0xc3f8('0x74')];_0x4cc654[_0xc3f8('0x43')]=_0x5e3125['uniqueid'];_0x4cc654[_0xc3f8('0x75')]=this[_0xc3f8('0xd')][_0x5e3125[_0xc3f8('0x43')]][_0xc3f8('0x75')];logger[_0xc3f8('0x69')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x4cc654[_0xc3f8('0x49')],_0x4cc654[_0xc3f8('0x4d')]);_[_0xc3f8('0x76')](_0x4cc654,_['pick'](_0x5e3125,_['keys'](_0x4cc654)));this[_0xc3f8('0x3a')][_0x5e3125[_0xc3f8('0x43')]][_0xc3f8('0x77')](_0x4cc654);this[_0xc3f8('0xd')][_0x5e3125['uniqueid']]=_0x4cc654;this[_0xc3f8('0x41')](_0x4cc654,_0xc3f8('0x17'));}}catch(_0x33b52c){logger['error'](_0xc3f8('0x71'),_0x5e3125[_0xc3f8('0x43')],util['inspect'](_0x33b52c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xc3f8('0x1a')]=function(_0xc4cd8c){try{if(this['isNotNull'](_0xc4cd8c)){logger[_0xc3f8('0x42')](_0xc3f8('0x78'),_0xc4cd8c['uniqueid'],util[_0xc3f8('0x39')](_0xc4cd8c,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xc4cd8c[_0xc3f8('0x43')]]){var _0x4d0d48=_[_0xc3f8('0x79')](this[_0xc3f8('0x3a')][_0xc4cd8c[_0xc3f8('0x43')]]);_0x4d0d48[_0xc3f8('0x7a')]=![];_0x4d0d48[_0xc3f8('0x7b')]=null;_0x4d0d48[_0xc3f8('0x7c')]=_0xc4cd8c[_0xc3f8('0x7c')];_0x4d0d48[_0xc3f8('0x7d')]=_0xc4cd8c[_0xc3f8('0x7d')];_0x4d0d48['queuecallerabandon']=!![];_0x4d0d48['queuecallerabandonAt']=moment()[_0xc3f8('0x44')]('YYYY-MM-DD\x20HH:mm:ss');_0x4d0d48[_0xc3f8('0x7e')]=_0xc3f8('0x7f');_0x4d0d48[_0xc3f8('0x80')]=null;logger[_0xc3f8('0x69')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x4d0d48[_0xc3f8('0x49')],_0x4d0d48[_0xc3f8('0x4d')]);this[_0xc3f8('0xd')][_0xc4cd8c[_0xc3f8('0x43')]]=_0x4d0d48;this[_0xc3f8('0x3f')](_0x4d0d48,_0xc3f8('0x19'));}}}catch(_0x457c39){logger[_0xc3f8('0x37')](_0xc3f8('0x78'),_0xc4cd8c['uniqueid'],util['inspect'](_0x457c39,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc3f8('0x8')][_0xc3f8('0x81')]=function(_0x1f2314){try{if(this['isNotNull'](_0x1f2314)){logger[_0xc3f8('0x42')]('[%s][voiceQueueReport][queuecallerleave]',_0x1f2314[_0xc3f8('0x43')],util['inspect'](_0x1f2314,{'showHidden':![],'depth':null}));if(this[_0xc3f8('0x3a')][_0x1f2314[_0xc3f8('0x43')]]){var _0x2ac0a8=_[_0xc3f8('0x79')](this[_0xc3f8('0x3a')][_0x1f2314[_0xc3f8('0x43')]]);_0x2ac0a8[_0xc3f8('0x82')]=moment()[_0xc3f8('0x44')]('YYYY-MM-DD\x20HH:mm:ss');_0x2ac0a8[_0xc3f8('0x83')]=_0x1f2314[_0xc3f8('0x83')];_0x2ac0a8[_0xc3f8('0x84')]=_0x1f2314[_0xc3f8('0x84')];logger[_0xc3f8('0x69')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x2ac0a8[_0xc3f8('0x49')],_0x2ac0a8[_0xc3f8('0x4d')],_0x1f2314[_0xc3f8('0x83')],_0x1f2314[_0xc3f8('0x84')]);this['channels'][_0x1f2314['uniqueid']]=_0x2ac0a8;this[_0xc3f8('0x41')](_0x2ac0a8,_0xc3f8('0x1b'));}}}catch(_0x49fdc5){logger['error']('[%s][voiceQueueReport][queuecallerleave]',_0x1f2314[_0xc3f8('0x43')],util['inspect'](_0x49fdc5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc3f8('0x8')][_0xc3f8('0x1d')]=function(_0x19e469){try{if(this[_0xc3f8('0x60')](_0x19e469)){logger[_0xc3f8('0x42')](_0xc3f8('0x85'),_0x19e469[_0xc3f8('0x43')],util['inspect'](_0x19e469,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x19e469['uniqueid']]){var _0x4ea284=_[_0xc3f8('0x79')](this['queueReports'][_0x19e469[_0xc3f8('0x43')]]);_0x4ea284[_0xc3f8('0x7a')]=!![];_0x4ea284[_0xc3f8('0x7e')]='COMPLETEDBYAGENT';logger[_0xc3f8('0x69')](_0xc3f8('0x86'),_0x4ea284['name'],_0x4ea284[_0xc3f8('0x4d')]);}}}catch(_0x1b746d){logger[_0xc3f8('0x37')]('[%s][voiceQueueReport][agentconnect]',_0x19e469[_0xc3f8('0x43')],util[_0xc3f8('0x39')](_0x1b746d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc3f8('0x8')]['syncAgentComplete']=function(_0x1704e5){try{if(this[_0xc3f8('0x60')](_0x1704e5)){logger[_0xc3f8('0x42')](_0xc3f8('0x87'),_0x1704e5[_0xc3f8('0x43')],util[_0xc3f8('0x39')](_0x1704e5,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1704e5[_0xc3f8('0x43')]]){var _0x4fd13c=_['last'](this[_0xc3f8('0x3a')][_0x1704e5[_0xc3f8('0x43')]]);_0x4fd13c['queuecallerabandon']=![];_0x4fd13c[_0xc3f8('0x88')]=null;_0x4fd13c[_0xc3f8('0x89')]=!![];_0x4fd13c[_0xc3f8('0x80')]=_0x1704e5['membername'];_0x4fd13c['holdtime']=_0x1704e5[_0xc3f8('0x7c')];_0x4fd13c['queuecallercomplete']=!![];_0x4fd13c[_0xc3f8('0x8a')]=![];_0x4fd13c[_0xc3f8('0x8b')]=null;if(!_0x4fd13c[_0xc3f8('0x8c')]){if(_0x1704e5['reason']==_0xc3f8('0x8c')){_0x4fd13c[_0xc3f8('0x7e')]=_0xc3f8('0x8d');logger[_0xc3f8('0x69')](_0xc3f8('0x8e'),_0x4fd13c[_0xc3f8('0x49')],_0x4fd13c['type']);}else{if(_[_0xc3f8('0x8f')](_0x1704e5[_0xc3f8('0x35')][_0xc3f8('0x90')](),_0xc3f8('0x91'))){if(this[_0xc3f8('0x3a')][_0x1704e5['linkedid']]){var _0x1fe97d=_[_0xc3f8('0x79')](this[_0xc3f8('0x3a')][_0x1704e5['linkedid']]);_0x1fe97d[_0xc3f8('0x7a')]=![];_0x1fe97d[_0xc3f8('0x8a')]=!![];_0x1fe97d[_0xc3f8('0x8b')]=moment(_0x4fd13c[_0xc3f8('0x72')])[_0xc3f8('0x92')](_0x1704e5['holdtime'],_0xc3f8('0x93'))[_0xc3f8('0x44')](_0xc3f8('0x94'));_0x1fe97d[_0xc3f8('0x7e')]=_0xc3f8('0x95');_0x1fe97d[_0xc3f8('0x8c')]=!![];_0x1fe97d[_0xc3f8('0x96')]=_0xc3f8('0x97');_0x1fe97d[_0xc3f8('0x98')]=_0x1704e5[_0xc3f8('0x99')];_0x1fe97d[_0xc3f8('0x9a')]=_0x1704e5['uniqueid'];logger['info'](_0xc3f8('0x9b'),_0x1fe97d['name'],_0x1fe97d['type']);var _0x29a544=this[_0xc3f8('0x3a')][_0x1704e5[_0xc3f8('0x9c')]];this[_0xc3f8('0x3a')][_0x1704e5['linkedid']]=this[_0xc3f8('0x3a')][_0x1704e5[_0xc3f8('0x43')]];this['queueReports'][_0x1704e5[_0xc3f8('0x43')]]=_0x29a544;}}else{_0x4fd13c[_0xc3f8('0x7e')]='COMPLETEDBY'+_0x1704e5['reason']['toUpperCase']();logger[_0xc3f8('0x69')](_0xc3f8('0x9d'),_0x4fd13c[_0xc3f8('0x49')],_0x4fd13c[_0xc3f8('0x4d')],_0x4fd13c[_0xc3f8('0x7e')]);}}}this[_0xc3f8('0xd')][_0x1704e5[_0xc3f8('0x43')]]=_0x4fd13c;this[_0xc3f8('0x3f')](_0x4fd13c,_0xc3f8('0x9e'));}}}catch(_0x4c55ae){logger['error'](_0xc3f8('0x87'),_0x1704e5[_0xc3f8('0x43')],util[_0xc3f8('0x39')](_0x4c55ae,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc3f8('0x8')][_0xc3f8('0x1e')]=function(_0x21fe09){try{if(this[_0xc3f8('0x60')](_0x21fe09)){logger[_0xc3f8('0x42')](_0xc3f8('0x9f'),_0x21fe09['uniqueid'],util[_0xc3f8('0x39')](_0x21fe09,{'showHidden':![],'depth':null}));this['addVariable'](_0x21fe09['uniqueid'],_[_0xc3f8('0xa0')](_0x21fe09[_0xc3f8('0xa1')])[0x0],_0x21fe09[_0xc3f8('0xa2')]);if(this[_0xc3f8('0x3a')][_0x21fe09[_0xc3f8('0x43')]]){var _0x1be9fe=_['last'](this[_0xc3f8('0x3a')][_0x21fe09[_0xc3f8('0x43')]]);if(_0x1be9fe){if(this[_0xc3f8('0x60')](_0x21fe09['variable'])&&this['isNotNull'](_0x21fe09[_0xc3f8('0xa1')][_0xc3f8('0xa3')])){switch(_0x21fe09['value']){case _0xc3f8('0xa4'):_0x1be9fe[_0xc3f8('0x8a')]=![];_0x1be9fe['queuecallerexitAt']=null;break;case _0xc3f8('0xa5'):_0x1be9fe[_0xc3f8('0xa6')]=_0xc3f8('0xa7');_0x1be9fe[_0xc3f8('0x8a')]=!![];_0x1be9fe[_0xc3f8('0x8b')]=moment()['format'](_0xc3f8('0x94'));_0x1be9fe['queuecallerleaveAt']=moment()[_0xc3f8('0x44')](_0xc3f8('0x94'));logger['debug'](_0xc3f8('0xa8'),_0x21fe09[_0xc3f8('0x43')],util[_0xc3f8('0x39')](_0x1be9fe,{'showHidden':![],'depth':null}));ami[_0xc3f8('0x40')](_0xc3f8('0xa9'),_0x1be9fe);break;default:_0x1be9fe[_0xc3f8('0x8a')]=!![];_0x1be9fe[_0xc3f8('0x8b')]=moment()[_0xc3f8('0x44')](_0xc3f8('0x94'));_0x1be9fe[_0xc3f8('0x82')]=moment()[_0xc3f8('0x44')](_0xc3f8('0x94'));}_0x1be9fe[_0xc3f8('0x19')]=![];_0x1be9fe[_0xc3f8('0x88')]=null;_0x1be9fe[_0xc3f8('0x7e')]=_0x21fe09[_0xc3f8('0xa2')];this[_0xc3f8('0xd')][_0x21fe09[_0xc3f8('0x43')]]=_0x1be9fe;this[_0xc3f8('0x3f')](_0x1be9fe,'varset');}else if(this[_0xc3f8('0x60')](_0x21fe09[_0xc3f8('0xa1')])&&this['isNotNull'](_0x21fe09[_0xc3f8('0xa1')]['queueposition'])){if(!_0x1be9fe[_0xc3f8('0x19')]){_0x1be9fe['queuecallerexit']=!![];_0x1be9fe[_0xc3f8('0x8b')]=moment()[_0xc3f8('0x44')](_0xc3f8('0x94'));_0x1be9fe['queuecallerexitreason']=_0xc3f8('0xaa');_0x1be9fe[_0xc3f8('0x82')]=moment()[_0xc3f8('0x44')](_0xc3f8('0x94'));this[_0xc3f8('0xd')][_0x21fe09[_0xc3f8('0x43')]]=_0x1be9fe;}}logger[_0xc3f8('0x69')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x21fe09[_0xc3f8('0x43')],_0x1be9fe[_0xc3f8('0x49')],_0x1be9fe[_0xc3f8('0x4d')],_[_0xc3f8('0xa0')](_0x21fe09[_0xc3f8('0xa1')])[0x0],_0x21fe09[_0xc3f8('0xa2')]);_0x1be9fe[_0xc3f8('0x3c')]=this[_0xc3f8('0x3c')][_0x21fe09[_0xc3f8('0x43')]];}}}}catch(_0x2e649c){logger[_0xc3f8('0x37')](_0xc3f8('0x9f'),_0x21fe09[_0xc3f8('0x43')],util[_0xc3f8('0x39')](_0x2e649c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xc3f8('0xab')]=function(_0x5c7c23,_0x3648b5,_0x47a3ab){var _0x59bc35=[_0xc3f8('0xac'),_0xc3f8('0xad'),_0xc3f8('0xae'),'rtpaudioqosjitterbridged','rtpaudioqosloss',_0xc3f8('0xaf'),_0xc3f8('0xb0'),_0xc3f8('0xb1'),_0xc3f8('0xb2'),_0xc3f8('0xb3'),'bridgepeer',_0xc3f8('0xb4'),_0xc3f8('0xb5'),_0xc3f8('0xb6'),'memberinterface','memberlastcall',_0xc3f8('0xb7'),'memberpenalty','memberrealtime'];if(!_['isNil'](_0x3648b5)&&!_[_0xc3f8('0xb8')](_0x59bc35,_0x3648b5)){if(_[_0xc3f8('0x61')](this[_0xc3f8('0x3c')][_0x5c7c23])){this[_0xc3f8('0x3c')][_0x5c7c23]={};}this['variables'][_0x5c7c23][_0x3648b5]=_0x47a3ab;}};VoiceQueueReport[_0xc3f8('0x8')][_0xc3f8('0x1f')]=function(_0x277146){try{if(this['isNotNull'](_0x277146)){logger[_0xc3f8('0x42')](_0xc3f8('0xb9'),_0x277146[_0xc3f8('0x43')],util[_0xc3f8('0x39')](_0x277146,{'showHidden':![],'depth':null}));if(this[_0xc3f8('0x3a')][_0x277146['uniqueid']]){for(var _0x210283=0x0,_0x2fc7e2={};_0x210283<this[_0xc3f8('0x3a')][_0x277146[_0xc3f8('0x43')]][_0xc3f8('0xba')];_0x210283+=0x1){_0x2fc7e2=this[_0xc3f8('0x3a')][_0x277146['uniqueid']][_0x210283];if(this[_0xc3f8('0xf')][_0x2fc7e2[_0xc3f8('0x67')]]){if(_0x2fc7e2['queuecallerexit']&&_0x2fc7e2[_0xc3f8('0x8c')]!=!![]){this[_0xc3f8('0xf')][_0x2fc7e2[_0xc3f8('0x67')]]['unmanaged']+=0x1;}if(_0x2fc7e2[_0xc3f8('0x19')]){this['voiceQueues'][_0x2fc7e2[_0xc3f8('0x67')]][_0xc3f8('0x56')]+=0x1;}this[_0xc3f8('0xf')][_0x2fc7e2[_0xc3f8('0x67')]][_0xc3f8('0x54')]+=moment(_0x2fc7e2[_0xc3f8('0x82')])[_0xc3f8('0xbb')](_0x2fc7e2[_0xc3f8('0x72')],_0xc3f8('0x93'))||0x0;if(_0x210283===this[_0xc3f8('0x3a')][_0x277146[_0xc3f8('0x43')]][_0xc3f8('0xba')]-0x1){this[_0xc3f8('0xf')][_0x2fc7e2[_0xc3f8('0x67')]][_0xc3f8('0x53')]+=moment()[_0xc3f8('0xbc')](0x0)['diff'](_0x2fc7e2[_0xc3f8('0x72')],_0xc3f8('0x93'));this[_0xc3f8('0xf')][_0x2fc7e2[_0xc3f8('0x67')]][_0xc3f8('0x55')]+=0x1;if(_0x2fc7e2['queuecallercomplete']){this[_0xc3f8('0xf')][_0x2fc7e2[_0xc3f8('0x67')]][_0xc3f8('0x50')]+=0x1;this[_0xc3f8('0xf')][_0x2fc7e2[_0xc3f8('0x67')]][_0xc3f8('0xbd')]+=moment()[_0xc3f8('0xbc')](0x0)['diff'](_0x2fc7e2[_0xc3f8('0x82')],'seconds');_0x2fc7e2['queuecallercompleteAt']=moment()[_0xc3f8('0x44')](_0xc3f8('0x94'));_0x2fc7e2[_0xc3f8('0x8a')]=![];_0x2fc7e2[_0xc3f8('0x8b')]=null;}if(_0x2fc7e2[_0xc3f8('0x8a')]&&_0x2fc7e2['transfer']!=!![]){_0x2fc7e2[_0xc3f8('0xa6')]='unmanaged';logger[_0xc3f8('0x42')](_0xc3f8('0xbe'),_0x277146['uniqueid'],util[_0xc3f8('0x39')](_0x2fc7e2,{'showHidden':![],'depth':null}));ami[_0xc3f8('0x40')]('custom:queuecallerunmanaged',_0x2fc7e2);}if(_0x2fc7e2[_0xc3f8('0x19')]){_0x2fc7e2[_0xc3f8('0xa6')]=_0xc3f8('0x56');logger[_0xc3f8('0x42')](_0xc3f8('0xbf'),_0x277146[_0xc3f8('0x43')],util[_0xc3f8('0x39')](_0x2fc7e2,{'showHidden':![],'depth':null}));ami[_0xc3f8('0x40')](_0xc3f8('0xc0'),_0x2fc7e2);}}else{this[_0xc3f8('0xf')][_0x2fc7e2[_0xc3f8('0x67')]]['sumDuration']+=this[_0xc3f8('0xf')][_0x2fc7e2['queue']][_0xc3f8('0x54')];}logger['info'](_0xc3f8('0xc1'),_0x277146[_0xc3f8('0x43')],_0x2fc7e2['name'],_0x2fc7e2['type'],_0x277146['cause-txt']);this[_0xc3f8('0xd')][_0x277146[_0xc3f8('0x43')]]=_0x2fc7e2;this[_0xc3f8('0x3f')](_0x2fc7e2,_0xc3f8('0xc2'));this[_0xc3f8('0x4c')](this[_0xc3f8('0xf')][_0x2fc7e2[_0xc3f8('0x67')]],_0xc3f8('0xc2'));}}logger[_0xc3f8('0x42')](_0xc3f8('0xc3'),_0x277146[_0xc3f8('0x43')],util[_0xc3f8('0x39')](this['queueReports'][_0x277146[_0xc3f8('0x43')]],{'showHidden':![],'depth':null}));ami[_0xc3f8('0x40')](_0xc3f8('0xc4'),this[_0xc3f8('0x3a')][_0x277146[_0xc3f8('0x43')]]);delete this[_0xc3f8('0x3a')][_0x277146[_0xc3f8('0x43')]];delete this[_0xc3f8('0xd')][_0x277146[_0xc3f8('0x43')]];}if(this['variables'][_0x277146[_0xc3f8('0x43')]]){delete this[_0xc3f8('0x3c')][_0x277146[_0xc3f8('0x43')]];}}}catch(_0x244614){logger[_0xc3f8('0x37')](_0xc3f8('0xb9'),_0x277146[_0xc3f8('0x43')],util[_0xc3f8('0x39')](_0x244614,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc3f8('0x8')][_0xc3f8('0xc5')]=function(_0x1fe7db){try{if(this[_0xc3f8('0x60')](_0x1fe7db)){logger[_0xc3f8('0x42')](_0xc3f8('0xc6'),_0x1fe7db[_0xc3f8('0x43')],util[_0xc3f8('0x39')](_0x1fe7db,{'showHidden':![],'depth':null}));var _0xaa82a6;if(this[_0xc3f8('0x3a')][_0x1fe7db[_0xc3f8('0xc7')]]){_0xaa82a6=_[_0xc3f8('0x79')](this[_0xc3f8('0x3a')][_0x1fe7db[_0xc3f8('0xc7')]]);_0xaa82a6['transferexten']=_0x1fe7db['secondtransfererexten'];_0xaa82a6['transferuniqueid']=_0x1fe7db[_0xc3f8('0xc8')];_0xaa82a6[_0xc3f8('0x7e')]=_0xc3f8('0xc9');_0xaa82a6['transfer']=!![];_0xaa82a6['transfertype']='ATTENDED';if(this[_0xc3f8('0x3a')][_0x1fe7db[_0xc3f8('0xc8')]]){var _0x2fbb31=this[_0xc3f8('0x3a')][_0x1fe7db[_0xc3f8('0xc8')]];this['queueReports'][_0x1fe7db['secondtransfereruniqueid']]=this[_0xc3f8('0x3a')][_0x1fe7db['transfereeuniqueid']];this['queueReports'][_0x1fe7db[_0xc3f8('0xc7')]]=_0x2fbb31;var _0x2087f7=_['last'](this['queueReports'][_0x1fe7db[_0xc3f8('0xc7')]]);_0x2087f7[_0xc3f8('0x31')]=!![];}logger[_0xc3f8('0x69')](_0xc3f8('0xca'),_0x1fe7db['uniqueid'],_0xaa82a6[_0xc3f8('0x49')],_0xaa82a6[_0xc3f8('0x4d')],_0xaa82a6[_0xc3f8('0x98')],_0xaa82a6[_0xc3f8('0x9a')]);}else if(this[_0xc3f8('0x3a')][_0x1fe7db['transfertargetuniqueid']]){_0xaa82a6=_[_0xc3f8('0x79')](this[_0xc3f8('0x3a')][_0x1fe7db[_0xc3f8('0xcb')]]);_0xaa82a6[_0xc3f8('0x98')]=_0x1fe7db[_0xc3f8('0xcc')];_0xaa82a6['transferuniqueid']=_0x1fe7db[_0xc3f8('0xcd')];_0xaa82a6[_0xc3f8('0x7e')]='ATTENDEDTRANSFER';_0xaa82a6['transfer']=!![];_0xaa82a6[_0xc3f8('0x96')]=_0xc3f8('0xce');if(this[_0xc3f8('0x3a')][_0x1fe7db[_0xc3f8('0xcd')]]){var _0x2fbb31=this['queueReports'][_0x1fe7db[_0xc3f8('0xcd')]];this['queueReports'][_0x1fe7db['origtransfereruniqueid']]=this[_0xc3f8('0x3a')][_0x1fe7db[_0xc3f8('0xcb')]];this[_0xc3f8('0x3a')][_0x1fe7db[_0xc3f8('0xcb')]]=_0x2fbb31;var _0x2087f7=_[_0xc3f8('0x79')](this[_0xc3f8('0x3a')][_0x1fe7db[_0xc3f8('0xcb')]]);_0x2087f7[_0xc3f8('0x31')]=!![];}logger['info'](_0xc3f8('0xca'),_0x1fe7db[_0xc3f8('0x43')],_0xaa82a6[_0xc3f8('0x49')],_0xaa82a6['type'],_0xaa82a6[_0xc3f8('0x98')],_0xaa82a6[_0xc3f8('0x9a')]);}}}catch(_0xb1009a){logger[_0xc3f8('0x37')](_0xc3f8('0xc6'),_0x1fe7db[_0xc3f8('0x43')],util['inspect'](_0xb1009a,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xc3f8('0x27')]=function(_0x4dfa1e){try{if(this[_0xc3f8('0x60')](_0x4dfa1e)){logger[_0xc3f8('0x42')](_0xc3f8('0xcf'),_0x4dfa1e['uniqueid'],util['inspect'](_0x4dfa1e,{'showHidden':![],'depth':null}));if(this[_0xc3f8('0x3a')][_0x4dfa1e[_0xc3f8('0xc7')]]){var _0x2aceb8=_[_0xc3f8('0x79')](this[_0xc3f8('0x3a')][_0x4dfa1e[_0xc3f8('0xc7')]]);_0x2aceb8['queuecallerexitreason']=_0xc3f8('0xd0');_0x2aceb8[_0xc3f8('0x8c')]=!![];_0x2aceb8[_0xc3f8('0x96')]='BLIND';_0x2aceb8[_0xc3f8('0x98')]=_0x4dfa1e[_0xc3f8('0xd1')];_0x2aceb8[_0xc3f8('0x9a')]=_0x4dfa1e['transfereeuniqueid'];logger[_0xc3f8('0x69')]('[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x4dfa1e[_0xc3f8('0x43')],_0x2aceb8['name'],_0x2aceb8[_0xc3f8('0x4d')],_0x2aceb8[_0xc3f8('0x98')],_0x2aceb8[_0xc3f8('0x9a')]);this[_0xc3f8('0x1f')]({'event':_0xc3f8('0xd2'),'uniqueid':_0x4dfa1e['transfereeuniqueid'],'context':_0x4dfa1e[_0xc3f8('0xd3')],'channel':_0x4dfa1e[_0xc3f8('0xd4')]});}}}catch(_0x357cec){logger['error'](_0xc3f8('0xcf'),_0x4dfa1e[_0xc3f8('0x43')],util[_0xc3f8('0x39')](_0x357cec,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc3f8('0x8')][_0xc3f8('0x23')]=function(_0x14926d){try{if(this['isNotNull'](_0x14926d)){logger['debug'](_0xc3f8('0xd5'),_0x14926d[_0xc3f8('0x43')],util[_0xc3f8('0x39')](_0x14926d,{'showHidden':![],'depth':null}));if(this[_0xc3f8('0x3a')][_0x14926d['uniqueid']]){var _0x302062=_[_0xc3f8('0x79')](this[_0xc3f8('0x3a')][_0x14926d['uniqueid']]);if(!_[_0xc3f8('0x33')](_0x302062[_0xc3f8('0x82')])){_0x302062[_0xc3f8('0xd6')]=moment()[_0xc3f8('0x44')](_0xc3f8('0x94'));logger[_0xc3f8('0x69')](_0xc3f8('0xd7'),_0x14926d[_0xc3f8('0x43')],_0x302062[_0xc3f8('0xd6')]);}}}}catch(_0x51870e){logger[_0xc3f8('0x37')](_0xc3f8('0xd5'),_0x14926d[_0xc3f8('0x43')],util[_0xc3f8('0x39')](_0x51870e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc3f8('0x8')][_0xc3f8('0x25')]=function(_0x4f8ce7){try{if(this['isNotNull'](_0x4f8ce7)){logger[_0xc3f8('0x42')]('[%s][voiceQueueReport][musiconholdstop]',_0x4f8ce7[_0xc3f8('0x43')],util[_0xc3f8('0x39')](_0x4f8ce7,{'showHidden':![],'depth':null}));if(this[_0xc3f8('0x3a')][_0x4f8ce7[_0xc3f8('0x43')]]){var _0x2b500b=_['last'](this['queueReports'][_0x4f8ce7[_0xc3f8('0x43')]]);if(!_[_0xc3f8('0x33')](_0x2b500b[_0xc3f8('0xd6')])){_0x2b500b[_0xc3f8('0xd8')]+=moment()[_0xc3f8('0xbc')](0x0)[_0xc3f8('0xbb')](_0x2b500b[_0xc3f8('0xd6')],_0xc3f8('0x93'));logger['info'](_0xc3f8('0xd9'),_0x4f8ce7[_0xc3f8('0x43')],_0x2b500b[_0xc3f8('0xd8')]);delete _0x2b500b[_0xc3f8('0xd6')];}}}}catch(_0x567ee3){logger[_0xc3f8('0x37')](_0xc3f8('0xda'),_0x4f8ce7['uniqueid'],util[_0xc3f8('0x39')](_0x567ee3,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncNewExten']=function(_0x1c3b72){try{if(this['isNotNull'](_0x1c3b72)){logger[_0xc3f8('0x42')](_0xc3f8('0xdb'),_0x1c3b72['uniqueid'],util['inspect'](_0x1c3b72,{'showHidden':![],'depth':null}));if(_0x1c3b72['application'][_0xc3f8('0x90')]()==='set'){_0x1c3b72['applicationdata']=_0x1c3b72[_0xc3f8('0xdc')]&&_0x1c3b72['appdata']['startsWith'](_0xc3f8('0xdd'))?_0x1c3b72[_0xc3f8('0xdc')]:(_0x1c3b72[_0xc3f8('0xdc')]||_0x1c3b72[_0xc3f8('0xde')])['toLowerCase']();if(_[_0xc3f8('0x8f')](_0x1c3b72[_0xc3f8('0xde')][_0xc3f8('0x90')](),_0xc3f8('0xdf'))){logger[_0xc3f8('0x69')](_0xc3f8('0xe0'),_0x1c3b72[_0xc3f8('0x43')],_0x1c3b72[_0xc3f8('0xe1')],_0x1c3b72[_0xc3f8('0xde')]);if(_[_0xc3f8('0x61')](this['channels'][_0x1c3b72[_0xc3f8('0x43')]]))this[_0xc3f8('0xd')][_0x1c3b72[_0xc3f8('0x43')]]={};var _0x15169b=_0x1c3b72[_0xc3f8('0xde')]['split']('=');var _0x153f9c=_0x15169b[0x0][_0xc3f8('0x90')]()[_0xc3f8('0xe2')](/cdr\((.*)\)/);if(_0x153f9c)this['channels'][_0x1c3b72[_0xc3f8('0x43')]][_0x153f9c[0x1]]=_0x15169b[0x1];}}}}catch(_0x3d9097){logger['error'](_0xc3f8('0xe3'),_0x1c3b72[_0xc3f8('0x43')],util[_0xc3f8('0x39')](_0x3d9097,{'showHidden':![],'depth':null}));}};module[_0xc3f8('0xe4')]=VoiceQueueReport;
\ No newline at end of file
index d12d26a..c551154 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1025=['Request','CreateReportAgentPreview','createHistory','campaign','queue'];(function(_0x4c7ebb,_0x1c5ed0){var _0xeec311=function(_0x25a56d){while(--_0x25a56d){_0x4c7ebb['push'](_0x4c7ebb['shift']());}};_0xeec311(++_0x1c5ed0);}(_0x1025,0xe8));var _0x5102=function(_0x244e2d,_0x302d40){_0x244e2d=_0x244e2d-0x0;var _0x3df084=_0x1025[_0x244e2d];return _0x3df084;};'use strict';var client=require('../client');exports[_0x5102('0x0')]=function(_0x422871){return function(){_0x422871[_0x5102('0x1')]=_0x422871[_0x5102('0x2')];return client[_0x5102('0x3')](_0x5102('0x4'),{'body':_0x422871,'log':_0x5102('0x4')});};};
\ No newline at end of file
+var _0x9c04=['Request','CreateReportAgentPreview','../client','createHistory','campaign','queue'];(function(_0x468f46,_0x39ecf4){var _0x41998f=function(_0xfe53e){while(--_0xfe53e){_0x468f46['push'](_0x468f46['shift']());}};_0x41998f(++_0x39ecf4);}(_0x9c04,0x116));var _0x49c0=function(_0x300b26,_0x3a9b67){_0x300b26=_0x300b26-0x0;var _0x5cb1ae=_0x9c04[_0x300b26];return _0x5cb1ae;};'use strict';var client=require(_0x49c0('0x0'));exports[_0x49c0('0x1')]=function(_0x490e32){return function(){_0x490e32[_0x49c0('0x2')]=_0x490e32[_0x49c0('0x3')];return client[_0x49c0('0x4')](_0x49c0('0x5'),{'body':_0x490e32,'log':_0x49c0('0x5')});};};
\ No newline at end of file
index 6d437e2..e52fcb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x337f=['create','CreateAttachment','../client'];(function(_0x99c088,_0x231ca3){var _0x280eef=function(_0x43b123){while(--_0x43b123){_0x99c088['push'](_0x99c088['shift']());}};_0x280eef(++_0x231ca3);}(_0x337f,0x11c));var _0xf337=function(_0x2267a2,_0x453e4b){_0x2267a2=_0x2267a2-0x0;var _0x1406a7=_0x337f[_0x2267a2];return _0x1406a7;};'use strict';var client=require(_0xf337('0x0'));exports[_0xf337('0x1')]=function(_0x1c771a){return client['Request'](_0xf337('0x2'),{'body':_0x1c771a,'log':_0xf337('0x2')});};
\ No newline at end of file
+var _0xb240=['Request','CreateAttachment','../client','create'];(function(_0x223db5,_0x135f20){var _0x1b8bb7=function(_0x1c11c2){while(--_0x1c11c2){_0x223db5['push'](_0x223db5['shift']());}};_0x1b8bb7(++_0x135f20);}(_0xb240,0x7e));var _0x0b24=function(_0x483b20,_0x4e9118){_0x483b20=_0x483b20-0x0;var _0x1f404f=_0xb240[_0x483b20];return _0x1f404f;};'use strict';var client=require(_0x0b24('0x0'));exports[_0x0b24('0x1')]=function(_0x1a79be){return client[_0x0b24('0x2')](_0x0b24('0x3'),{'body':_0x1a79be,'log':_0x0b24('0x3')});};
\ No newline at end of file
index ef176cf..a2cf01a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['Trunk','active','TrunkBackup','callerid','Interval','Intervals','interval','SquareProject','getCampaign','../client','getCampaigns','Request','GetCampaign','name','type','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialGlobalInterval','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit'];(function(_0x57a5e5,_0x18b0d6){var _0x354012=function(_0x34d87b){while(--_0x34d87b){_0x57a5e5['push'](_0x57a5e5['shift']());}};_0x354012(++_0x18b0d6);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xc4aa[_0x5a776b];return _0xbbef59;};'use strict';var client=require(_0xac4a('0x0'));exports[_0xac4a('0x1')]=function(){return function(){return client[_0xac4a('0x2')](_0xac4a('0x3'),{'options':{'raw':![],'attributes':['id',_0xac4a('0x4'),_0xac4a('0x5'),'active','limitCalls','dialOriginateCallerIdName',_0xac4a('0x6'),_0xac4a('0x7'),_0xac4a('0x8'),_0xac4a('0x9'),_0xac4a('0xa'),_0xac4a('0xb'),_0xac4a('0xc'),_0xac4a('0xd'),'dialGlobalMaxRetry','dialNoSuchNumberMaxRetry',_0xac4a('0xe'),_0xac4a('0xf'),_0xac4a('0x10'),'dialAbandonedMaxRetry',_0xac4a('0x11'),_0xac4a('0x12'),_0xac4a('0x13'),'dialAgentRejectMaxRetry',_0xac4a('0x14'),'dialTimezone',_0xac4a('0x15'),'dialAMDActive',_0xac4a('0x16'),_0xac4a('0x17'),_0xac4a('0x18'),'dialAMDTotalAnalysisTime',_0xac4a('0x19'),_0xac4a('0x1a'),_0xac4a('0x1b'),_0xac4a('0x1c'),_0xac4a('0x1d'),_0xac4a('0x1e'),_0xac4a('0x1f'),_0xac4a('0x20'),_0xac4a('0x21')],'include':[{'model':_0xac4a('0x22'),'as':_0xac4a('0x22'),'attributes':['id',_0xac4a('0x4'),'callerid',_0xac4a('0x23')]},{'model':_0xac4a('0x22'),'as':_0xac4a('0x24'),'attributes':['id',_0xac4a('0x4'),_0xac4a('0x25'),_0xac4a('0x23')]},{'model':_0xac4a('0x26'),'as':_0xac4a('0x26'),'attributes':['id','name'],'include':[{'model':'Interval','as':_0xac4a('0x27'),'attributes':['id',_0xac4a('0x4'),_0xac4a('0x28')]}]},{'model':'SquareProject','as':_0xac4a('0x29'),'attributes':['id',_0xac4a('0x4')]}]},'log':_0xac4a('0x2a')});};};
\ 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(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x2ef3,0xba));var _0x32ef=function(_0x1cd285,_0x6148a8){_0x1cd285=_0x1cd285-0x0;var _0x5b2675=_0x2ef3[_0x1cd285];return _0x5b2675;};'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 34d5290..7830131 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x276a=['CreateCmContact','getContacts','GetCmContact','../client','createContact','Request'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x276a,0x87));var _0xa276=function(_0x385214,_0x210844){_0x385214=_0x385214-0x0;var _0x375ffe=_0x276a[_0x385214];return _0x375ffe;};'use strict';var client=require(_0xa276('0x0'));exports[_0xa276('0x1')]=function(_0x7e74b4){return function(){return client[_0xa276('0x2')](_0xa276('0x3'),{'body':_0x7e74b4,'log':'CreateCmContact'});};};exports[_0xa276('0x4')]=function(_0x5c2601){return function(){return client[_0xa276('0x2')]('GetCmContact',{'options':_0x5c2601,'log':_0xa276('0x5')});};};
\ No newline at end of file
+var _0xf036=['CreateCmContact','getContacts','GetCmContact','../client','Request'];(function(_0x285824,_0x3da647){var _0x311d7e=function(_0x2f3de0){while(--_0x2f3de0){_0x285824['push'](_0x285824['shift']());}};_0x311d7e(++_0x3da647);}(_0xf036,0xcb));var _0x6f03=function(_0x1a860a,_0x282bea){_0x1a860a=_0x1a860a-0x0;var _0x50c4d2=_0xf036[_0x1a860a];return _0x50c4d2;};'use strict';var client=require(_0x6f03('0x0'));exports['createContact']=function(_0x4c8aeb){return function(){return client[_0x6f03('0x1')](_0x6f03('0x2'),{'body':_0x4c8aeb,'log':_0x6f03('0x2')});};};exports[_0x6f03('0x3')]=function(_0x370d9e){return function(){return client['Request'](_0x6f03('0x4'),{'options':_0x370d9e,'log':_0x6f03('0x4')});};};
\ No newline at end of file
index 7277a8d..1ef6be5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae4a=['priority','DESC','scheduledat','ASC','GetContactDialerIvr','moveContactManagedDialer','campaign','queue','MoveContactManagedDialer','countReScheduled','CountReScheduled','GetCmHopperPreview','User','name','Queue','unlockContact','GetContactRecallMe','Agent','voicePause','moment','lodash','getContacts','Request','GetCmHopper','CmContact','Contact','getCmHopper','UpdateCmHopper','format','YYYY-MM-DD\x20HH:mm:ss','rescheduleContact','ContactId','VoiceQueueId','CampaignId','destroyContact','DestroyCmHopper','getContactDialer','GetContactDialer'];(function(_0x5a3e69,_0x346f71){var _0x27073b=function(_0x36283e){while(--_0x36283e){_0x5a3e69['push'](_0x5a3e69['shift']());}};_0x27073b(++_0x346f71);}(_0xae4a,0xd1));var _0xaae4=function(_0x5c0b26,_0x2d269c){_0x5c0b26=_0x5c0b26-0x0;var _0x458668=_0xae4a[_0x5c0b26];return _0x458668;};'use strict';var client=require('../client');var moment=require(_0xaae4('0x0'));var _=require(_0xaae4('0x1'));exports[_0xaae4('0x2')]=function(_0x522241,_0x2b8a14){return function(){return client[_0xaae4('0x3')](_0xaae4('0x4'),{'options':{'where':{'VoiceQueueId':_0x522241},'include':[{'model':_0xaae4('0x5'),'as':_0xaae4('0x6')}],'limit':_0x2b8a14,'raw':![]},'log':_0xaae4('0x7')});};};exports['updateContacts']=function(_0x3cccd7,_0x5871b9,_0x5607d7){return function(){return client[_0xaae4('0x3')](_0xaae4('0x8'),{'body':_0x3cccd7,'options':{'where':{'VoiceQueueId':_0x5871b9,'scheduledat':{'$lte':moment()[_0xaae4('0x9')](_0xaae4('0xa'))}},'limit':_0x5607d7},'log':_0xaae4('0x8')});};};exports[_0xaae4('0xb')]=function(_0xf12b87){return function(){return client[_0xaae4('0x3')]('UpdateCmHopper',{'body':_0xf12b87,'options':{'where':{'ContactId':_0xf12b87[_0xaae4('0xc')],'ListId':_0xf12b87['ListId'],'VoiceQueueId':_0xf12b87[_0xaae4('0xd')],'CampaignId':_0xf12b87[_0xaae4('0xe')]}},'log':'rescheduleContact'});};};exports[_0xaae4('0xf')]=function(_0x12e770,_0x298195,_0x42fd1d){return function(){return client[_0xaae4('0x3')](_0xaae4('0x10'),{'options':{'where':{'VoiceQueueId':_0x12e770,'ListId':_0x298195,'ContactId':_0x42fd1d}},'log':'DestroyCmHopper'});};};exports[_0xaae4('0x11')]=function(_0x3e486e,_0x7aac12,_0x88cc8b,_0x5b37c1){return function(){return client[_0xaae4('0x3')](_0xaae4('0x12'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x3e486e,'active':![],'scheduledat':{'$lte':moment()['format'](_0xaae4('0xa'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x7aac12}}]},'order':[[_0xaae4('0x13'),_0xaae4('0x14')],[_0xaae4('0x15'),_0x5b37c1],['id','ASC']],'raw':!![],'limit':_0x88cc8b},'log':_0xaae4('0x12')});};};exports['getContactDialerIvr']=function(_0x54fbf0,_0x14ff38,_0x4486cb){return function(){return client['Request'](_0xaae4('0x12'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x54fbf0,'active':![],'scheduledat':{'$lte':moment()[_0xaae4('0x9')](_0xaae4('0xa'))}},'include':[{'model':_0xaae4('0x5'),'as':_0xaae4('0x6')}],'order':[[_0xaae4('0x13'),_0xaae4('0x14')],[_0xaae4('0x15'),_0x4486cb],['id',_0xaae4('0x16')]],'raw':!![],'limit':_0x14ff38},'log':_0xaae4('0x17')});};};exports[_0xaae4('0x18')]=function(_0x2605ec,_0x557f80){return function(){_0x2605ec[_0xaae4('0x19')]=_0x2605ec[_0xaae4('0x1a')];return client[_0xaae4('0x3')](_0xaae4('0x1b'),{'body':_0x2605ec,'options':{'where':{'ContactId':_0x2605ec[_0xaae4('0xc')],'ListId':_0x2605ec['ListId'],'VoiceQueueId':_0x2605ec[_0xaae4('0xd')],'CampaignId':_0x2605ec['CampaignId'],'active':_0x557f80?undefined:!![]}},'log':'MoveContactManagedDialer'});};};exports[_0xaae4('0x1c')]=function(_0x120654){return function(){return client[_0xaae4('0x3')](_0xaae4('0x1d'),{'options':{'where':{'VoiceQueueId':_0x120654['id']?_0x120654['id']||null:null}},'log':_0xaae4('0x1c')});};};exports['getContactPreview']=function(_0x40d09e){return function(){return client[_0xaae4('0x3')](_0xaae4('0x1e'),{'options':{'where':{'id':_0x40d09e},'include':[{'model':_0xaae4('0x5'),'as':'Contact'},{'model':_0xaae4('0x1f'),'as':'Agent','attributes':['id',_0xaae4('0x20')]},{'model':'VoiceQueue','as':_0xaae4('0x21'),'attributes':['id',_0xaae4('0x20')]}],'raw':!![]},'log':'getCmHopper'});};};exports[_0xaae4('0x22')]=function(_0x331e3e,_0x4ef04e,_0x279e29){return function(){return client[_0xaae4('0x3')](_0xaae4('0x8'),{'body':_0x331e3e,'options':{'where':{'id':_0x4ef04e},'limit':_0x279e29},'log':_0xaae4('0x8')});};};exports['getContactRecallMe']=function(_0x5d7423,_0x19848c){return function(){return client[_0xaae4('0x3')](_0xaae4('0x23'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x5d7423,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()['format'](_0xaae4('0xa'))},'UserId':{'$in':_0x19848c}},'order':[['priority',_0xaae4('0x14')],[_0xaae4('0x15'),_0xaae4('0x14')],['id',_0xaae4('0x16')]],'include':[{'model':_0xaae4('0x5'),'as':_0xaae4('0x6')},{'model':'User','as':_0xaae4('0x24'),'attributes':['id','name',_0xaae4('0x25')]}],'group':'db.CmHopper.UserId','raw':!![]},'log':_0xaae4('0x12')});};};
\ No newline at end of file
+var _0x9115=['MoveContactManagedDialer','VoiceQueueId','countReScheduled','getContactPreview','GetCmHopperPreview','User','Agent','name','VoiceQueue','Queue','unlockContact','getContactRecallMe','GetContactRecallMe','DESC','moment','Request','GetCmHopper','CmContact','Contact','getCmHopper','updateContacts','UpdateCmHopper','YYYY-MM-DD\x20HH:mm:ss','rescheduleContact','ContactId','ListId','CampaignId','destroyContact','DestroyCmHopper','getContactDialer','format','scheduledat','ASC','GetContactDialer','getContactDialerIvr','priority','GetContactDialerIvr','moveContactManagedDialer','campaign'];(function(_0x2c1e7a,_0x155f86){var _0xcacb4f=function(_0x2b2eb3){while(--_0x2b2eb3){_0x2c1e7a['push'](_0x2c1e7a['shift']());}};_0xcacb4f(++_0x155f86);}(_0x9115,0x1e2));var _0x5911=function(_0x456b57,_0x58691a){_0x456b57=_0x456b57-0x0;var _0x18f49f=_0x9115[_0x456b57];return _0x18f49f;};'use strict';var client=require('../client');var moment=require(_0x5911('0x0'));var _=require('lodash');exports['getContacts']=function(_0x3e207c,_0x322a89){return function(){return client[_0x5911('0x1')](_0x5911('0x2'),{'options':{'where':{'VoiceQueueId':_0x3e207c},'include':[{'model':_0x5911('0x3'),'as':_0x5911('0x4')}],'limit':_0x322a89,'raw':![]},'log':_0x5911('0x5')});};};exports[_0x5911('0x6')]=function(_0x55e38f,_0xe1ca4f,_0x36ec31){return function(){return client['Request'](_0x5911('0x7'),{'body':_0x55e38f,'options':{'where':{'VoiceQueueId':_0xe1ca4f,'scheduledat':{'$lte':moment()['format'](_0x5911('0x8'))}},'limit':_0x36ec31},'log':_0x5911('0x7')});};};exports[_0x5911('0x9')]=function(_0x496f7a){return function(){return client[_0x5911('0x1')](_0x5911('0x7'),{'body':_0x496f7a,'options':{'where':{'ContactId':_0x496f7a[_0x5911('0xa')],'ListId':_0x496f7a[_0x5911('0xb')],'VoiceQueueId':_0x496f7a['VoiceQueueId'],'CampaignId':_0x496f7a[_0x5911('0xc')]}},'log':'rescheduleContact'});};};exports[_0x5911('0xd')]=function(_0x2b1e6d,_0x165d85,_0x22c370){return function(){return client[_0x5911('0x1')](_0x5911('0xe'),{'options':{'where':{'VoiceQueueId':_0x2b1e6d,'ListId':_0x165d85,'ContactId':_0x22c370}},'log':_0x5911('0xe')});};};exports[_0x5911('0xf')]=function(_0x141069,_0xf1a21,_0x13836c,_0x16ee3d){return function(){return client[_0x5911('0x1')]('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x141069,'active':![],'scheduledat':{'$lte':moment()[_0x5911('0x10')](_0x5911('0x8'))},'$or':[{'UserId':null},{'UserId':{'$in':_0xf1a21}}]},'order':[['priority','DESC'],[_0x5911('0x11'),_0x16ee3d],['id',_0x5911('0x12')]],'raw':!![],'limit':_0x13836c},'log':_0x5911('0x13')});};};exports[_0x5911('0x14')]=function(_0x2446d3,_0x19ccbd,_0x41da68){return function(){return client[_0x5911('0x1')](_0x5911('0x13'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x2446d3,'active':![],'scheduledat':{'$lte':moment()[_0x5911('0x10')](_0x5911('0x8'))}},'include':[{'model':_0x5911('0x3'),'as':_0x5911('0x4')}],'order':[[_0x5911('0x15'),'DESC'],[_0x5911('0x11'),_0x41da68],['id',_0x5911('0x12')]],'raw':!![],'limit':_0x19ccbd},'log':_0x5911('0x16')});};};exports[_0x5911('0x17')]=function(_0x2227c0,_0x2c3928){return function(){_0x2227c0[_0x5911('0x18')]=_0x2227c0['queue'];return client[_0x5911('0x1')](_0x5911('0x19'),{'body':_0x2227c0,'options':{'where':{'ContactId':_0x2227c0[_0x5911('0xa')],'ListId':_0x2227c0['ListId'],'VoiceQueueId':_0x2227c0[_0x5911('0x1a')],'CampaignId':_0x2227c0[_0x5911('0xc')],'active':_0x2c3928?undefined:!![]}},'log':_0x5911('0x19')});};};exports[_0x5911('0x1b')]=function(_0x38b6d3){return function(){return client[_0x5911('0x1')]('CountReScheduled',{'options':{'where':{'VoiceQueueId':_0x38b6d3['id']?_0x38b6d3['id']||null:null}},'log':'countReScheduled'});};};exports[_0x5911('0x1c')]=function(_0x47c1bf){return function(){return client[_0x5911('0x1')](_0x5911('0x1d'),{'options':{'where':{'id':_0x47c1bf},'include':[{'model':_0x5911('0x3'),'as':_0x5911('0x4')},{'model':_0x5911('0x1e'),'as':_0x5911('0x1f'),'attributes':['id',_0x5911('0x20')]},{'model':_0x5911('0x21'),'as':_0x5911('0x22'),'attributes':['id',_0x5911('0x20')]}],'raw':!![]},'log':_0x5911('0x5')});};};exports[_0x5911('0x23')]=function(_0x34c717,_0x472a16,_0x433888){return function(){return client['Request'](_0x5911('0x7'),{'body':_0x34c717,'options':{'where':{'id':_0x472a16},'limit':_0x433888},'log':'UpdateCmHopper'});};};exports[_0x5911('0x24')]=function(_0x4efabf,_0xb880e5){return function(){return client[_0x5911('0x1')](_0x5911('0x25'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x4efabf,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x5911('0x10')](_0x5911('0x8'))},'UserId':{'$in':_0xb880e5}},'order':[['priority',_0x5911('0x26')],[_0x5911('0x11'),'DESC'],['id','ASC']],'include':[{'model':'CmContact','as':_0x5911('0x4')},{'model':'User','as':_0x5911('0x1f'),'attributes':['id','name','voicePause']}],'group':'db.CmHopper.UserId','raw':!![]},'log':_0x5911('0x13')});};};
\ No newline at end of file
index 5516f82..7bc5920 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x087b=['Request','CampaignId','GetCmHopperBlackIvr','../client','checkIsBlackList','GetCmHopperBlack','Contact','phone','checkIsBlackListIvr'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x087b,0x11a));var _0xb087=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x087b[_0x40220a];return _0x3903cc;};'use strict';var client=require(_0xb087('0x0'));exports[_0xb087('0x1')]=function(_0x556d8c){return function(){return client['Request'](_0xb087('0x2'),{'options':{'where':{'VoiceQueueId':_0x556d8c['VoiceQueueId'],'phone':_0x556d8c[_0xb087('0x3')][_0xb087('0x4')]},'raw':![]},'log':_0xb087('0x2')});};};exports[_0xb087('0x5')]=function(_0x183efd){return function(){return client[_0xb087('0x6')](_0xb087('0x2'),{'options':{'where':{'CampaignId':_0x183efd[_0xb087('0x7')],'phone':_0x183efd[_0xb087('0x3')][_0xb087('0x4')]},'raw':![]},'log':_0xb087('0x8')});};};
\ No newline at end of file
+var _0x97c1=['Request','Contact','phone','GetCmHopperBlack','checkIsBlackListIvr','CampaignId','GetCmHopperBlackIvr','../client','checkIsBlackList'];(function(_0x3208f9,_0x2a8be0){var _0x4dea35=function(_0x6f2bd7){while(--_0x6f2bd7){_0x3208f9['push'](_0x3208f9['shift']());}};_0x4dea35(++_0x2a8be0);}(_0x97c1,0xdf));var _0x197c=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x97c1[_0x59ee6f];return _0x4c0979;};'use strict';var client=require(_0x197c('0x0'));exports[_0x197c('0x1')]=function(_0x55b95a){return function(){return client[_0x197c('0x2')]('GetCmHopperBlack',{'options':{'where':{'VoiceQueueId':_0x55b95a['VoiceQueueId'],'phone':_0x55b95a[_0x197c('0x3')][_0x197c('0x4')]},'raw':![]},'log':_0x197c('0x5')});};};exports[_0x197c('0x6')]=function(_0x40863c){return function(){return client['Request']('GetCmHopperBlack',{'options':{'where':{'CampaignId':_0x40863c[_0x197c('0x7')],'phone':_0x40863c[_0x197c('0x3')][_0x197c('0x4')]},'raw':![]},'log':_0x197c('0x8')});};};
\ No newline at end of file
index 7cc27f4..06b6263 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec5b=['campaign','queue','Request','CreateCmHopperFinal','../client','createContact'];(function(_0x3fcff8,_0x28450e){var _0x155baa=function(_0x3c0a8c){while(--_0x3c0a8c){_0x3fcff8['push'](_0x3fcff8['shift']());}};_0x155baa(++_0x28450e);}(_0xec5b,0x16c));var _0xbec5=function(_0x2c3480,_0x36f8f4){_0x2c3480=_0x2c3480-0x0;var _0x289f84=_0xec5b[_0x2c3480];return _0x289f84;};'use strict';var client=require(_0xbec5('0x0'));exports[_0xbec5('0x1')]=function(_0x397702){return function(){_0x397702[_0xbec5('0x2')]=_0x397702[_0xbec5('0x3')];return client[_0xbec5('0x4')](_0xbec5('0x5'),{'body':_0x397702,'log':_0xbec5('0x5')});};};
\ No newline at end of file
+var _0xfeaa=['queue','Request','CreateCmHopperFinal','../client','createContact'];(function(_0x340380,_0x4bd2a8){var _0x49ce1c=function(_0x4cb9e2){while(--_0x4cb9e2){_0x340380['push'](_0x340380['shift']());}};_0x49ce1c(++_0x4bd2a8);}(_0xfeaa,0x157));var _0xafea=function(_0x3573a5,_0x562251){_0x3573a5=_0x3573a5-0x0;var _0x5c8fc1=_0xfeaa[_0x3573a5];return _0x5c8fc1;};'use strict';var client=require(_0xafea('0x0'));exports[_0xafea('0x1')]=function(_0x22a549){return function(){_0x22a549['campaign']=_0x22a549[_0xafea('0x2')];return client[_0xafea('0x3')](_0xafea('0x4'),{'body':_0x22a549,'log':_0xafea('0x4')});};};
\ No newline at end of file
index 0311cbb..fba3bde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a87=['ivr','GetCampaignHopperHistory','moment','createHistory','campaign','Request','CreateCmHopperHistory','avgHandleTime','subtract','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','startOf','day','GetVoiceQueueHopperHistory','getCampaignHopperHistory','endOf'];(function(_0x3dfe75,_0xf992f1){var _0x2982de=function(_0x537606){while(--_0x537606){_0x3dfe75['push'](_0x3dfe75['shift']());}};_0x2982de(++_0xf992f1);}(_0x3a87,0xda));var _0x73a8=function(_0x3aaf0a,_0x450970){_0x3aaf0a=_0x3aaf0a-0x0;var _0x33e6bc=_0x3a87[_0x3aaf0a];return _0x33e6bc;};'use strict';var client=require('../client');var moment=require(_0x73a8('0x0'));exports[_0x73a8('0x1')]=function(_0x1e5a9f){return function(){_0x1e5a9f[_0x73a8('0x2')]=_0x1e5a9f['queue'];return client[_0x73a8('0x3')]('CreateCmHopperHistory',{'body':_0x1e5a9f,'log':_0x73a8('0x4')});};};exports[_0x73a8('0x5')]=function(_0x25f029){return function(){return client[_0x73a8('0x3')]('AvgHandleTime',{'options':{'where':{'endtime':{'$between':[moment()[_0x73a8('0x6')](_0x25f029,'minutes')[_0x73a8('0x7')](_0x73a8('0x8')),moment()[_0x73a8('0x7')](_0x73a8('0x8'))]}},'raw':![]},'log':_0x73a8('0x9')});};};exports[_0x73a8('0xa')]=function(_0x59e5f8){return function(){return client['Request']('GetVoiceQueueHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()[_0x73a8('0xb')](_0x73a8('0xc'))[_0x73a8('0x7')](_0x73a8('0x8')),moment()['endOf']('day')[_0x73a8('0x7')]('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':'queue'},'raw':![]},'log':_0x73a8('0xd')});};};exports[_0x73a8('0xe')]=function(_0x33db3e){return function(){return client[_0x73a8('0x3')]('GetCampaignHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0x73a8('0xc'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x73a8('0xf')]('day')['format']('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':_0x73a8('0x10')},'raw':![]},'log':_0x73a8('0x11')});};};
\ No newline at end of file
+var _0xe8c1=['moment','createHistory','campaign','queue','Request','CreateCmHopperHistory','avgHandleTime','AvgHandleTime','subtract','minutes','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','startOf','day','endOf','getCampaignHopperHistory','GetCampaignHopperHistory','ivr'];(function(_0x6be975,_0x567f5a){var _0x56c7e6=function(_0x5e0ea2){while(--_0x5e0ea2){_0x6be975['push'](_0x6be975['shift']());}};_0x56c7e6(++_0x567f5a);}(_0xe8c1,0xbd));var _0x1e8c=function(_0x71e493,_0x4308b7){_0x71e493=_0x71e493-0x0;var _0x3d40ab=_0xe8c1[_0x71e493];return _0x3d40ab;};'use strict';var client=require('../client');var moment=require(_0x1e8c('0x0'));exports[_0x1e8c('0x1')]=function(_0x10ee43){return function(){_0x10ee43[_0x1e8c('0x2')]=_0x10ee43[_0x1e8c('0x3')];return client[_0x1e8c('0x4')](_0x1e8c('0x5'),{'body':_0x10ee43,'log':'CreateCmHopperHistory'});};};exports[_0x1e8c('0x6')]=function(_0xf38d1e){return function(){return client[_0x1e8c('0x4')](_0x1e8c('0x7'),{'options':{'where':{'endtime':{'$between':[moment()[_0x1e8c('0x8')](_0xf38d1e,_0x1e8c('0x9'))[_0x1e8c('0xa')](_0x1e8c('0xb')),moment()[_0x1e8c('0xa')](_0x1e8c('0xb'))]}},'raw':![]},'log':_0x1e8c('0xc')});};};exports[_0x1e8c('0xd')]=function(_0x5e78c2){return function(){return client[_0x1e8c('0x4')](_0x1e8c('0xe'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x1e8c('0xf')](_0x1e8c('0x10'))['format'](_0x1e8c('0xb')),moment()[_0x1e8c('0x11')](_0x1e8c('0x10'))[_0x1e8c('0xa')](_0x1e8c('0xb'))]},'campaigntype':_0x1e8c('0x3')},'raw':![]},'log':_0x1e8c('0xe')});};};exports[_0x1e8c('0x12')]=function(_0x534353){return function(){return client[_0x1e8c('0x4')](_0x1e8c('0x13'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x1e8c('0xf')](_0x1e8c('0x10'))[_0x1e8c('0xa')](_0x1e8c('0xb')),moment()['endOf'](_0x1e8c('0x10'))[_0x1e8c('0xa')](_0x1e8c('0xb'))]},'campaigntype':_0x1e8c('0x14')},'raw':![]},'log':_0x1e8c('0x13')});};};
\ No newline at end of file
index 3ad49e9..3424b39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24bb=['ListId','key','Trunk','callerid','getFaxAccount','notify','NotifyFaxAccount','../client','Request','name','description','headerinfo','maxrate','modem','gateway','tech','TrunkId'];(function(_0x4ab41f,_0x5c6bc5){var _0x4f7de5=function(_0x2b6c91){while(--_0x2b6c91){_0x4ab41f['push'](_0x4ab41f['shift']());}};_0x4f7de5(++_0x5c6bc5);}(_0x24bb,0x19f));var _0xb24b=function(_0x3fc071,_0x4477d6){_0x3fc071=_0x3fc071-0x0;var _0x342a97=_0x24bb[_0x3fc071];return _0x342a97;};'use strict';var client=require(_0xb24b('0x0'));exports['getFaxAccounts']=function(){return function(){return client[_0xb24b('0x1')]('GetFaxAccount',{'options':{'raw':![],'attributes':['id',_0xb24b('0x2'),_0xb24b('0x3'),'ecm',_0xb24b('0x4'),'localstationid','minrate',_0xb24b('0x5'),_0xb24b('0x6'),_0xb24b('0x7'),'faxdetect','t38timeout',_0xb24b('0x8'),_0xb24b('0x9'),_0xb24b('0xa'),_0xb24b('0xb')],'include':[{'model':_0xb24b('0xc'),'as':_0xb24b('0xc'),'attributes':['id',_0xb24b('0x2'),_0xb24b('0xd'),'active']}]},'log':_0xb24b('0xe')});};};exports[_0xb24b('0xf')]=function(_0x3d68d3,_0x24a9c7){return client['Request']('NotifyFaxAccount',{'account':{'id':_0x3d68d3},'body':_0x24a9c7,'log':_0xb24b('0x10')});};
\ No newline at end of file
+var _0x6bab=['ecm','headerinfo','localstationid','minrate','modem','faxdetect','t38timeout','tech','TrunkId','ListId','key','Trunk','name','active','NotifyFaxAccount','../client','getFaxAccounts','Request','GetFaxAccount','description'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x6bab,0x1c7));var _0xb6ba=function(_0x304b67,_0x31cb39){_0x304b67=_0x304b67-0x0;var _0x493afb=_0x6bab[_0x304b67];return _0x493afb;};'use strict';var client=require(_0xb6ba('0x0'));exports[_0xb6ba('0x1')]=function(){return function(){return client[_0xb6ba('0x2')](_0xb6ba('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xb6ba('0x4'),_0xb6ba('0x5'),_0xb6ba('0x6'),_0xb6ba('0x7'),_0xb6ba('0x8'),'maxrate',_0xb6ba('0x9'),'gateway',_0xb6ba('0xa'),_0xb6ba('0xb'),_0xb6ba('0xc'),_0xb6ba('0xd'),_0xb6ba('0xe'),_0xb6ba('0xf')],'include':[{'model':_0xb6ba('0x10'),'as':_0xb6ba('0x10'),'attributes':['id',_0xb6ba('0x11'),'callerid',_0xb6ba('0x12')]}]},'log':'getFaxAccount'});};};exports['notify']=function(_0x5c556d,_0x31e74b){return client[_0xb6ba('0x2')](_0xb6ba('0x13'),{'account':{'id':_0x5c556d},'body':_0x31e74b,'log':'NotifyFaxAccount'});};
\ No newline at end of file
index ff3a09a..7dfd9b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b11=['../client','update','UpdateFaxMessage'];(function(_0x508a75,_0x219a2a){var _0x766b98=function(_0x16461e){while(--_0x16461e){_0x508a75['push'](_0x508a75['shift']());}};_0x766b98(++_0x219a2a);}(_0x8b11,0x93));var _0x18b1=function(_0xe49211,_0x25d19c){_0xe49211=_0xe49211-0x0;var _0x5d1e5c=_0x8b11[_0xe49211];return _0x5d1e5c;};'use strict';var client=require(_0x18b1('0x0'));exports[_0x18b1('0x1')]=function(_0x35de63,_0x2154e3){return client['Request']('UpdateFaxMessage',{'body':_0x2154e3,'options':{'where':{'AttachmentId':_0x35de63}},'log':_0x18b1('0x2')});};
\ No newline at end of file
+var _0x90e2=['Request','UpdateFaxMessage','../client','update'];(function(_0x2edc93,_0x459111){var _0x15a87d=function(_0x4f5629){while(--_0x4f5629){_0x2edc93['push'](_0x2edc93['shift']());}};_0x15a87d(++_0x459111);}(_0x90e2,0x76));var _0x290e=function(_0x1d03f5,_0x57b015){_0x1d03f5=_0x1d03f5-0x0;var _0x7c93e6=_0x90e2[_0x1d03f5];return _0x7c93e6;};'use strict';var client=require(_0x290e('0x0'));exports[_0x290e('0x1')]=function(_0x40430f,_0x12b585){return client[_0x290e('0x2')](_0x290e('0x3'),{'body':_0x12b585,'options':{'where':{'AttachmentId':_0x40430f}},'log':'UpdateFaxMessage'});};
\ No newline at end of file
index 70afca5..90fead9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d3b=['type','serverUrl','DeskConfiguration','Configurations','DeskField','Subjects','content','variableName','Variable','key','Fields','idField','nameField','customField','Tag','Tags','../../client','getDeskAccounts','Request','GetDeskAccount','name','description','authType'];(function(_0x1d3019,_0x8dbbd5){var _0x36458e=function(_0x5d60db){while(--_0x5d60db){_0x1d3019['push'](_0x1d3019['shift']());}};_0x36458e(++_0x8dbbd5);}(_0x5d3b,0x152));var _0xb5d3=function(_0x5b2660,_0x444e2f){_0x5b2660=_0x5b2660-0x0;var _0x12b2c0=_0x5d3b[_0x5b2660];return _0x12b2c0;};'use strict';var client=require(_0xb5d3('0x0'));exports[_0xb5d3('0x1')]=function(){return function(_0x19c8f1){return client[_0xb5d3('0x2')](_0xb5d3('0x3'),{'options':{'raw':![],'attributes':['id',_0xb5d3('0x4'),_0xb5d3('0x5'),'username','password','remoteUri',_0xb5d3('0x6'),_0xb5d3('0x7'),_0xb5d3('0x8')],'include':[{'model':_0xb5d3('0x9'),'as':_0xb5d3('0xa'),'attributes':['id',_0xb5d3('0x4')],'include':[{'model':_0xb5d3('0xb'),'as':_0xb5d3('0xc'),'attributes':['id',_0xb5d3('0x7'),_0xb5d3('0xd'),_0xb5d3('0xe')],'include':[{'model':_0xb5d3('0xf'),'as':_0xb5d3('0xf'),'attributes':['id','name']}]},{'model':_0xb5d3('0xb'),'as':'Descriptions','attributes':['id','type',_0xb5d3('0xd'),_0xb5d3('0x10'),'keyType','keyContent',_0xb5d3('0xe')],'include':[{'model':_0xb5d3('0xf'),'as':_0xb5d3('0xf'),'attributes':['id','name']}]},{'model':_0xb5d3('0xb'),'as':_0xb5d3('0x11'),'attributes':['id',_0xb5d3('0x7'),_0xb5d3('0xd'),_0xb5d3('0x12'),_0xb5d3('0x13'),_0xb5d3('0x14'),_0xb5d3('0xe')],'include':[{'model':_0xb5d3('0xf'),'as':'Variable','attributes':['id','name']}]},{'model':_0xb5d3('0x15'),'as':_0xb5d3('0x16'),'attributes':['id',_0xb5d3('0x4')]}]}]},'log':_0xb5d3('0x3')});};};
\ No newline at end of file
+var _0xdb39=['../../client','getDeskAccounts','Request','name','description','username','password','remoteUri','authType','type','DeskConfiguration','Configurations','DeskField','Subjects','content','Variable','Descriptions','key','keyType','keyContent','variableName','idField','nameField','customField','Tag','GetDeskAccount'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xdb39,0x104));var _0x9db3=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xdb39[_0x1928c9];return _0x51b5fb;};'use strict';var client=require(_0x9db3('0x0'));exports[_0x9db3('0x1')]=function(){return function(_0x2e2df4){return client[_0x9db3('0x2')]('GetDeskAccount',{'options':{'raw':![],'attributes':['id',_0x9db3('0x3'),_0x9db3('0x4'),_0x9db3('0x5'),_0x9db3('0x6'),_0x9db3('0x7'),_0x9db3('0x8'),_0x9db3('0x9'),'serverUrl'],'include':[{'model':_0x9db3('0xa'),'as':_0x9db3('0xb'),'attributes':['id',_0x9db3('0x3')],'include':[{'model':_0x9db3('0xc'),'as':_0x9db3('0xd'),'attributes':['id','type',_0x9db3('0xe'),'variableName'],'include':[{'model':_0x9db3('0xf'),'as':_0x9db3('0xf'),'attributes':['id',_0x9db3('0x3')]}]},{'model':_0x9db3('0xc'),'as':_0x9db3('0x10'),'attributes':['id',_0x9db3('0x9'),_0x9db3('0xe'),_0x9db3('0x11'),_0x9db3('0x12'),_0x9db3('0x13'),_0x9db3('0x14')],'include':[{'model':_0x9db3('0xf'),'as':_0x9db3('0xf'),'attributes':['id',_0x9db3('0x3')]}]},{'model':_0x9db3('0xc'),'as':'Fields','attributes':['id',_0x9db3('0x9'),_0x9db3('0xe'),_0x9db3('0x15'),_0x9db3('0x16'),_0x9db3('0x17'),'variableName'],'include':[{'model':_0x9db3('0xf'),'as':_0x9db3('0xf'),'attributes':['id',_0x9db3('0x3')]}]},{'model':_0x9db3('0x18'),'as':'Tags','attributes':['id',_0x9db3('0x3')]}]}]},'log':_0x9db3('0x19')});};};
\ No newline at end of file
index 18f6130..d3e28a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x820a=['key','keyContent','Dynamics365Field','Fields','idField','nameField','customField','GetDynamics365Account','../../client','getDynamics365Accounts','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Dynamics365Configuration','name','ticketType','Subjects','type','content','variableName','Variable'];(function(_0x34232c,_0x18e61d){var _0x4d4f4e=function(_0x1aeb3d){while(--_0x1aeb3d){_0x34232c['push'](_0x34232c['shift']());}};_0x4d4f4e(++_0x18e61d);}(_0x820a,0x134));var _0xa820=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x820a[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xa820('0x0'));exports[_0xa820('0x1')]=function(){return function(_0x2e4c4b){return client['Request']('GetDynamics365Account',{'options':{'raw':![],'attributes':['id','name',_0xa820('0x2'),_0xa820('0x3'),_0xa820('0x4'),_0xa820('0x5'),_0xa820('0x6'),_0xa820('0x7'),_0xa820('0x8'),'description'],'include':[{'model':_0xa820('0x9'),'as':'Configurations','attributes':['id',_0xa820('0xa'),_0xa820('0xb')],'include':[{'model':'Dynamics365Field','as':_0xa820('0xc'),'attributes':['id',_0xa820('0xd'),_0xa820('0xe'),_0xa820('0xf')],'include':[{'model':_0xa820('0x10'),'as':_0xa820('0x10'),'attributes':['id','name']}]},{'model':'Dynamics365Field','as':'Descriptions','attributes':['id',_0xa820('0xd'),'content',_0xa820('0x11'),'keyType',_0xa820('0x12'),_0xa820('0xf')],'include':[{'model':_0xa820('0x10'),'as':_0xa820('0x10'),'attributes':['id',_0xa820('0xa')]}]},{'model':_0xa820('0x13'),'as':_0xa820('0x14'),'attributes':['id',_0xa820('0xd'),_0xa820('0xe'),_0xa820('0x15'),_0xa820('0x16'),_0xa820('0x17'),'variableName'],'include':[{'model':_0xa820('0x10'),'as':_0xa820('0x10'),'attributes':['id',_0xa820('0xa')]}]}]}]},'log':_0xa820('0x18')});};};
\ No newline at end of file
+var _0x9807=['Request','GetDynamics365Account','name','username','password','remoteUri','clientId','clientSecret','serverUrl','description','Dynamics365Configuration','ticketType','type','variableName','Variable','Dynamics365Field','Descriptions','content','key','keyType','Fields','idField','nameField','customField','getDynamics365Accounts'];(function(_0x5a8b59,_0x46b70d){var _0x544367=function(_0x1489d7){while(--_0x1489d7){_0x5a8b59['push'](_0x5a8b59['shift']());}};_0x544367(++_0x46b70d);}(_0x9807,0xe0));var _0x7980=function(_0x222264,_0x4ecc9f){_0x222264=_0x222264-0x0;var _0x47da73=_0x9807[_0x222264];return _0x47da73;};'use strict';var client=require('../../client');exports[_0x7980('0x0')]=function(){return function(_0x11f098){return client[_0x7980('0x1')](_0x7980('0x2'),{'options':{'raw':![],'attributes':['id',_0x7980('0x3'),_0x7980('0x4'),_0x7980('0x5'),_0x7980('0x6'),'tenantId',_0x7980('0x7'),_0x7980('0x8'),_0x7980('0x9'),_0x7980('0xa')],'include':[{'model':_0x7980('0xb'),'as':'Configurations','attributes':['id',_0x7980('0x3'),_0x7980('0xc')],'include':[{'model':'Dynamics365Field','as':'Subjects','attributes':['id',_0x7980('0xd'),'content',_0x7980('0xe')],'include':[{'model':_0x7980('0xf'),'as':_0x7980('0xf'),'attributes':['id',_0x7980('0x3')]}]},{'model':_0x7980('0x10'),'as':_0x7980('0x11'),'attributes':['id',_0x7980('0xd'),_0x7980('0x12'),_0x7980('0x13'),_0x7980('0x14'),'keyContent',_0x7980('0xe')],'include':[{'model':_0x7980('0xf'),'as':_0x7980('0xf'),'attributes':['id','name']}]},{'model':_0x7980('0x10'),'as':_0x7980('0x15'),'attributes':['id',_0x7980('0xd'),_0x7980('0x12'),_0x7980('0x16'),_0x7980('0x17'),_0x7980('0x18'),_0x7980('0xe')],'include':[{'model':_0x7980('0xf'),'as':'Variable','attributes':['id',_0x7980('0x3')]}]}]}]},'log':_0x7980('0x2')});};};
\ No newline at end of file
index 6ac20a0..be5df13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd138=['content','key','keyContent','Fields','idField','nameField','customField','GetFreshdeskAccount','../../client','getFreshdeskAccounts','username','serverUrl','FreshdeskField','Subjects','type','variableName','Variable','name'];(function(_0x536ed8,_0x2be4ec){var _0x5e351c=function(_0x555a5c){while(--_0x555a5c){_0x536ed8['push'](_0x536ed8['shift']());}};_0x5e351c(++_0x2be4ec);}(_0xd138,0x1dc));var _0x8d13=function(_0x25fb9b,_0x38f646){_0x25fb9b=_0x25fb9b-0x0;var _0x47d1d4=_0xd138[_0x25fb9b];return _0x47d1d4;};'use strict';var client=require(_0x8d13('0x0'));exports[_0x8d13('0x1')]=function(){return function(_0x12ccbb){return client['Request']('GetFreshdeskAccount',{'options':{'raw':![],'attributes':['id','name',_0x8d13('0x2'),'apiKey','remoteUri',_0x8d13('0x3')],'include':[{'model':'FreshdeskConfiguration','as':'Configurations','attributes':['id','name'],'include':[{'model':'Tag','attributes':['id','name']},{'model':_0x8d13('0x4'),'as':_0x8d13('0x5'),'attributes':['id',_0x8d13('0x6'),'content',_0x8d13('0x7')],'include':[{'model':'Variable','as':_0x8d13('0x8'),'attributes':['id',_0x8d13('0x9')]}]},{'model':'FreshdeskField','as':'Descriptions','attributes':['id',_0x8d13('0x6'),_0x8d13('0xa'),_0x8d13('0xb'),'keyType',_0x8d13('0xc'),_0x8d13('0x7')],'include':[{'model':_0x8d13('0x8'),'as':'Variable','attributes':['id',_0x8d13('0x9')]}]},{'model':_0x8d13('0x4'),'as':_0x8d13('0xd'),'attributes':['id',_0x8d13('0x6'),_0x8d13('0xa'),_0x8d13('0xe'),_0x8d13('0xf'),_0x8d13('0x10'),_0x8d13('0x7')],'include':[{'model':'Variable','as':_0x8d13('0x8'),'attributes':['id','name']}]}]}]},'log':_0x8d13('0x11')});};};
\ No newline at end of file
+var _0xbe99=['Configurations','Tag','name','type','content','variableName','Variable','FreshdeskField','Descriptions','key','keyType','keyContent','Fields','idField','nameField','../../client','getFreshdeskAccounts','Request','GetFreshdeskAccount','username','remoteUri','serverUrl','FreshdeskConfiguration'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xbe99,0x196));var _0x9be9=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xbe99[_0x4e1d03];return _0x362d4b;};'use strict';var client=require(_0x9be9('0x0'));exports[_0x9be9('0x1')]=function(){return function(_0x382688){return client[_0x9be9('0x2')](_0x9be9('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x9be9('0x4'),'apiKey',_0x9be9('0x5'),_0x9be9('0x6')],'include':[{'model':_0x9be9('0x7'),'as':_0x9be9('0x8'),'attributes':['id','name'],'include':[{'model':_0x9be9('0x9'),'attributes':['id',_0x9be9('0xa')]},{'model':'FreshdeskField','as':'Subjects','attributes':['id',_0x9be9('0xb'),_0x9be9('0xc'),_0x9be9('0xd')],'include':[{'model':_0x9be9('0xe'),'as':_0x9be9('0xe'),'attributes':['id',_0x9be9('0xa')]}]},{'model':_0x9be9('0xf'),'as':_0x9be9('0x10'),'attributes':['id',_0x9be9('0xb'),_0x9be9('0xc'),_0x9be9('0x11'),_0x9be9('0x12'),_0x9be9('0x13'),_0x9be9('0xd')],'include':[{'model':_0x9be9('0xe'),'as':_0x9be9('0xe'),'attributes':['id',_0x9be9('0xa')]}]},{'model':'FreshdeskField','as':_0x9be9('0x14'),'attributes':['id',_0x9be9('0xb'),_0x9be9('0xc'),_0x9be9('0x15'),_0x9be9('0x16'),'customField',_0x9be9('0xd')],'include':[{'model':_0x9be9('0xe'),'as':_0x9be9('0xe'),'attributes':['id','name']}]}]}]},'log':_0x9be9('0x3')});};};
\ No newline at end of file
index 30dfd33..1a64210 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabce=['name','Subjects','content','variableName','Variable','FreshsalesField','Descriptions','type','key','keyType','keyContent','GetFreshsalesccount','../../client','getFreshsalesAccounts','Request','GetFreshsalesAccount','apiKey','remoteUri','serverUrl'];(function(_0x197fd5,_0x51b4ce){var _0x423bc3=function(_0x547f58){while(--_0x547f58){_0x197fd5['push'](_0x197fd5['shift']());}};_0x423bc3(++_0x51b4ce);}(_0xabce,0x103));var _0xeabc=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0xabce[_0x1d9aa0];return _0x226868;};'use strict';var client=require(_0xeabc('0x0'));exports[_0xeabc('0x1')]=function(){return function(_0x357cda){return client[_0xeabc('0x2')](_0xeabc('0x3'),{'options':{'raw':![],'attributes':['id','name','username',_0xeabc('0x4'),_0xeabc('0x5'),_0xeabc('0x6')],'include':[{'model':'FreshsalesConfiguration','as':'Configurations','attributes':['id',_0xeabc('0x7')],'include':[{'model':'FreshsalesField','as':_0xeabc('0x8'),'attributes':['id','type',_0xeabc('0x9'),_0xeabc('0xa')],'include':[{'model':_0xeabc('0xb'),'as':'Variable','attributes':['id',_0xeabc('0x7')]}]},{'model':_0xeabc('0xc'),'as':_0xeabc('0xd'),'attributes':['id',_0xeabc('0xe'),_0xeabc('0x9'),_0xeabc('0xf'),_0xeabc('0x10'),_0xeabc('0x11'),_0xeabc('0xa')],'include':[{'model':_0xeabc('0xb'),'as':_0xeabc('0xb'),'attributes':['id',_0xeabc('0x7')]}]}]}]},'log':_0xeabc('0x12')});};};
\ No newline at end of file
+var _0xffd6=['variableName','Variable','FreshsalesField','key','keyType','keyContent','GetFreshsalesccount','../../client','getFreshsalesAccounts','name','username','apiKey','serverUrl','FreshsalesConfiguration','Configurations','Subjects','type','content'];(function(_0x270a0a,_0x49b09e){var _0xa8c779=function(_0x3ad8fd){while(--_0x3ad8fd){_0x270a0a['push'](_0x270a0a['shift']());}};_0xa8c779(++_0x49b09e);}(_0xffd6,0x97));var _0x6ffd=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0xffd6[_0xa6cc5c];return _0x44803d;};'use strict';var client=require(_0x6ffd('0x0'));exports[_0x6ffd('0x1')]=function(){return function(_0x292378){return client['Request']('GetFreshsalesAccount',{'options':{'raw':![],'attributes':['id',_0x6ffd('0x2'),_0x6ffd('0x3'),_0x6ffd('0x4'),'remoteUri',_0x6ffd('0x5')],'include':[{'model':_0x6ffd('0x6'),'as':_0x6ffd('0x7'),'attributes':['id',_0x6ffd('0x2')],'include':[{'model':'FreshsalesField','as':_0x6ffd('0x8'),'attributes':['id',_0x6ffd('0x9'),_0x6ffd('0xa'),_0x6ffd('0xb')],'include':[{'model':_0x6ffd('0xc'),'as':'Variable','attributes':['id',_0x6ffd('0x2')]}]},{'model':_0x6ffd('0xd'),'as':'Descriptions','attributes':['id',_0x6ffd('0x9'),_0x6ffd('0xa'),_0x6ffd('0xe'),_0x6ffd('0xf'),_0x6ffd('0x10'),_0x6ffd('0xb')],'include':[{'model':_0x6ffd('0xc'),'as':'Variable','attributes':['id',_0x6ffd('0x2')]}]}]}]},'log':_0x6ffd('0x11')});};};
\ No newline at end of file
index dc8445e..2baead8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bf7=['clientId','type','SalesforceConfiguration','Configurations','moduleSearch','moduleCreate','ticketType','leadId','additionalSearchAccount','additionalSearchContact','Subjects','Variable','SalesforceField','Descriptions','Fields','../../client','Request','GetSalesforceAccount','name','username','password'];(function(_0x6cafde,_0x7426ea){var _0xe2d6f7=function(_0xea797f){while(--_0xea797f){_0x6cafde['push'](_0x6cafde['shift']());}};_0xe2d6f7(++_0x7426ea);}(_0x0bf7,0x14a));var _0x70bf=function(_0x10d95f,_0x354395){_0x10d95f=_0x10d95f-0x0;var _0x2e0765=_0x0bf7[_0x10d95f];return _0x2e0765;};'use strict';var client=require(_0x70bf('0x0'));exports['getSalesforceAccounts']=function(){return function(_0x2fda82){return client[_0x70bf('0x1')](_0x70bf('0x2'),{'options':{'raw':![],'attributes':['id',_0x70bf('0x3'),_0x70bf('0x4'),_0x70bf('0x5'),'remoteUri',_0x70bf('0x6'),'clientSecret','securityToken','serverUrl',_0x70bf('0x7')],'include':[{'model':_0x70bf('0x8'),'as':_0x70bf('0x9'),'attributes':['id',_0x70bf('0x3'),_0x70bf('0xa'),_0x70bf('0xb'),_0x70bf('0xc'),_0x70bf('0xd'),_0x70bf('0xe'),_0x70bf('0xf'),'additionalSearchLead'],'include':[{'model':'SalesforceField','as':_0x70bf('0x10'),'include':[{'model':'Variable','as':_0x70bf('0x11'),'attributes':['id',_0x70bf('0x3')]}]},{'model':_0x70bf('0x12'),'as':_0x70bf('0x13'),'include':[{'model':_0x70bf('0x11'),'as':'Variable','attributes':['id',_0x70bf('0x3')]}]},{'model':_0x70bf('0x12'),'as':_0x70bf('0x14'),'include':[{'model':'Variable','as':_0x70bf('0x11'),'attributes':['id','name']}]}]}]},'log':'GetSalesforceAccount'});};};
\ No newline at end of file
+var _0x3d70=['serverUrl','type','SalesforceConfiguration','Configurations','moduleSearch','moduleCreate','ticketType','additionalSearchAccount','additionalSearchContact','SalesforceField','Subjects','Variable','Descriptions','Fields','GetSalesforceAccount','getSalesforceAccounts','Request','name','password','remoteUri','clientSecret'];(function(_0x92ac5f,_0x49322c){var _0x307b33=function(_0x25c894){while(--_0x25c894){_0x92ac5f['push'](_0x92ac5f['shift']());}};_0x307b33(++_0x49322c);}(_0x3d70,0xf6));var _0x03d7=function(_0x3dc538,_0x4f7702){_0x3dc538=_0x3dc538-0x0;var _0x72c2fd=_0x3d70[_0x3dc538];return _0x72c2fd;};'use strict';var client=require('../../client');exports[_0x03d7('0x0')]=function(){return function(_0x2709ea){return client[_0x03d7('0x1')]('GetSalesforceAccount',{'options':{'raw':![],'attributes':['id',_0x03d7('0x2'),'username',_0x03d7('0x3'),_0x03d7('0x4'),'clientId',_0x03d7('0x5'),'securityToken',_0x03d7('0x6'),_0x03d7('0x7')],'include':[{'model':_0x03d7('0x8'),'as':_0x03d7('0x9'),'attributes':['id','name',_0x03d7('0xa'),_0x03d7('0xb'),_0x03d7('0xc'),'leadId',_0x03d7('0xd'),_0x03d7('0xe'),'additionalSearchLead'],'include':[{'model':_0x03d7('0xf'),'as':_0x03d7('0x10'),'include':[{'model':_0x03d7('0x11'),'as':_0x03d7('0x11'),'attributes':['id',_0x03d7('0x2')]}]},{'model':_0x03d7('0xf'),'as':_0x03d7('0x12'),'include':[{'model':_0x03d7('0x11'),'as':_0x03d7('0x11'),'attributes':['id','name']}]},{'model':'SalesforceField','as':_0x03d7('0x13'),'include':[{'model':_0x03d7('0x11'),'as':_0x03d7('0x11'),'attributes':['id',_0x03d7('0x2')]}]}]}]},'log':_0x03d7('0x14')});};};
\ No newline at end of file
index c4bec7a..1cca943 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x524e=['name','description','username','password','email','remoteUri','serverUrl','Configurations','ServicenowField','type','content','variableName','Variable','Descriptions','key','keyType','keyContent','Fields','idField','nameField','Request','GetServicenowAccount'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x524e,0x15e));var _0xe524=function(_0x2f2732,_0x5a4ab2){_0x2f2732=_0x2f2732-0x0;var _0x54207b=_0x524e[_0x2f2732];return _0x54207b;};'use strict';var client=require('../../client');exports['getServicenowAccounts']=function(){return function(_0x353d8a){return client[_0xe524('0x0')](_0xe524('0x1'),{'options':{'raw':![],'attributes':['id',_0xe524('0x2'),_0xe524('0x3'),_0xe524('0x4'),_0xe524('0x5'),_0xe524('0x6'),_0xe524('0x7'),_0xe524('0x8')],'include':[{'model':'ServicenowConfiguration','as':_0xe524('0x9'),'attributes':['id',_0xe524('0x2')],'include':[{'model':_0xe524('0xa'),'as':'Subjects','attributes':['id',_0xe524('0xb'),_0xe524('0xc'),_0xe524('0xd')],'include':[{'model':_0xe524('0xe'),'as':_0xe524('0xe'),'attributes':['id',_0xe524('0x2')]}]},{'model':_0xe524('0xa'),'as':_0xe524('0xf'),'attributes':['id',_0xe524('0xb'),_0xe524('0xc'),_0xe524('0x10'),_0xe524('0x11'),_0xe524('0x12'),_0xe524('0xd')],'include':[{'model':_0xe524('0xe'),'as':_0xe524('0xe'),'attributes':['id','name']}]},{'model':'ServicenowField','as':_0xe524('0x13'),'attributes':['id',_0xe524('0xb'),_0xe524('0xc'),_0xe524('0x14'),_0xe524('0x15'),'customField',_0xe524('0xd')],'include':[{'model':'Variable','as':_0xe524('0xe'),'attributes':['id',_0xe524('0x2')]}]}]}]},'log':'GetServicenowkAccount'});};};
\ No newline at end of file
+var _0xe2fe=['type','variableName','Variable','keyType','Fields','content','nameField','GetServicenowkAccount','../../client','Request','name','description','username','password','email','serverUrl','ServicenowConfiguration','ServicenowField'];(function(_0x495149,_0xcec839){var _0x42e96f=function(_0x563325){while(--_0x563325){_0x495149['push'](_0x495149['shift']());}};_0x42e96f(++_0xcec839);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xee2f('0x0'));exports['getServicenowAccounts']=function(){return function(_0x521787){return client[_0xee2f('0x1')]('GetServicenowAccount',{'options':{'raw':![],'attributes':['id',_0xee2f('0x2'),_0xee2f('0x3'),_0xee2f('0x4'),_0xee2f('0x5'),_0xee2f('0x6'),'remoteUri',_0xee2f('0x7')],'include':[{'model':_0xee2f('0x8'),'as':'Configurations','attributes':['id',_0xee2f('0x2')],'include':[{'model':_0xee2f('0x9'),'as':'Subjects','attributes':['id',_0xee2f('0xa'),'content',_0xee2f('0xb')],'include':[{'model':_0xee2f('0xc'),'as':'Variable','attributes':['id',_0xee2f('0x2')]}]},{'model':_0xee2f('0x9'),'as':'Descriptions','attributes':['id','type','content','key',_0xee2f('0xd'),'keyContent','variableName'],'include':[{'model':'Variable','as':_0xee2f('0xc'),'attributes':['id',_0xee2f('0x2')]}]},{'model':_0xee2f('0x9'),'as':_0xee2f('0xe'),'attributes':['id',_0xee2f('0xa'),_0xee2f('0xf'),'idField',_0xee2f('0x10'),'customField',_0xee2f('0xb')],'include':[{'model':_0xee2f('0xc'),'as':'Variable','attributes':['id',_0xee2f('0x2')]}]}]}]},'log':_0xee2f('0x11')});};};
\ No newline at end of file
index e50f0cc..93804cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14a0=['variableName','key','keyContent','Variable','SugarcrmField','Fields','idField','nameField','customField','getSugarcrmAccounts','Request','GetSugarcrmAccount','name','username','password','SugarcrmConfiguration','Configurations','type','content'];(function(_0x4acdd0,_0x4d1f59){var _0x392ba5=function(_0x30cab7){while(--_0x30cab7){_0x4acdd0['push'](_0x4acdd0['shift']());}};_0x392ba5(++_0x4d1f59);}(_0x14a0,0x8e));var _0x014a=function(_0x36e562,_0x21af70){_0x36e562=_0x36e562-0x0;var _0x1d3f6f=_0x14a0[_0x36e562];return _0x1d3f6f;};'use strict';var client=require('../../client');exports[_0x014a('0x0')]=function(){return function(_0x451138){return client[_0x014a('0x1')](_0x014a('0x2'),{'options':{'raw':![],'attributes':['id',_0x014a('0x3'),_0x014a('0x4'),_0x014a('0x5'),'remoteUri','serverUrl'],'include':[{'model':_0x014a('0x6'),'as':_0x014a('0x7'),'attributes':['id',_0x014a('0x3')],'include':[{'model':'SugarcrmField','as':'Subjects','attributes':['id',_0x014a('0x8'),_0x014a('0x9'),_0x014a('0xa')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x014a('0x3')]}]},{'model':'SugarcrmField','as':'Descriptions','attributes':['id','type','content',_0x014a('0xb'),'keyType',_0x014a('0xc'),_0x014a('0xa')],'include':[{'model':'Variable','as':_0x014a('0xd'),'attributes':['id',_0x014a('0x3')]}]},{'model':_0x014a('0xe'),'as':_0x014a('0xf'),'attributes':['id',_0x014a('0x8'),_0x014a('0x9'),_0x014a('0x10'),_0x014a('0x11'),_0x014a('0x12'),_0x014a('0xa')],'include':[{'model':_0x014a('0xd'),'as':_0x014a('0xd'),'attributes':['id','name']}]}]}]},'log':_0x014a('0x2')});};};
\ No newline at end of file
+var _0x2ef3=['SugarcrmField','Descriptions','keyType','keyContent','Fields','idField','../../client','getSugarcrmAccounts','Request','GetSugarcrmAccount','name','password','remoteUri','SugarcrmConfiguration','Configurations','Subjects','type','content','variableName','Variable'];(function(_0x22c33e,_0x5ad81d){var _0x51bf68=function(_0x22b612){while(--_0x22b612){_0x22c33e['push'](_0x22c33e['shift']());}};_0x51bf68(++_0x5ad81d);}(_0x2ef3,0xba));var _0x32ef=function(_0x55e7e0,_0x4c846b){_0x55e7e0=_0x55e7e0-0x0;var _0x3609c9=_0x2ef3[_0x55e7e0];return _0x3609c9;};'use strict';var client=require(_0x32ef('0x0'));exports[_0x32ef('0x1')]=function(){return function(_0x47513a){return client[_0x32ef('0x2')](_0x32ef('0x3'),{'options':{'raw':![],'attributes':['id',_0x32ef('0x4'),'username',_0x32ef('0x5'),_0x32ef('0x6'),'serverUrl'],'include':[{'model':_0x32ef('0x7'),'as':_0x32ef('0x8'),'attributes':['id','name'],'include':[{'model':'SugarcrmField','as':_0x32ef('0x9'),'attributes':['id',_0x32ef('0xa'),_0x32ef('0xb'),_0x32ef('0xc')],'include':[{'model':_0x32ef('0xd'),'as':_0x32ef('0xd'),'attributes':['id',_0x32ef('0x4')]}]},{'model':_0x32ef('0xe'),'as':_0x32ef('0xf'),'attributes':['id',_0x32ef('0xa'),'content','key',_0x32ef('0x10'),_0x32ef('0x11'),_0x32ef('0xc')],'include':[{'model':_0x32ef('0xd'),'as':'Variable','attributes':['id',_0x32ef('0x4')]}]},{'model':'SugarcrmField','as':_0x32ef('0x12'),'attributes':['id','type',_0x32ef('0xb'),_0x32ef('0x13'),'nameField','customField',_0x32ef('0xc')],'include':[{'model':'Variable','as':_0x32ef('0xd'),'attributes':['id',_0x32ef('0x4')]}]}]}]},'log':_0x32ef('0x3')});};};
\ No newline at end of file
index f5393a6..38a7e89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb478=['Request','GetVtigerAccount','name','description','accessKey','remoteUri','serverUrl','Configurations','Subjects','content','Variable','VtigerField','Descriptions','type','key','keyType','keyContent','variableName','Fields','idField','nameField','customField','../../client'];(function(_0x515fd8,_0x18c4b4){var _0x362762=function(_0x5575af){while(--_0x5575af){_0x515fd8['push'](_0x515fd8['shift']());}};_0x362762(++_0x18c4b4);}(_0xb478,0xce));var _0x8b47=function(_0x1895b7,_0x21fbc7){_0x1895b7=_0x1895b7-0x0;var _0x1aecdc=_0xb478[_0x1895b7];return _0x1aecdc;};'use strict';var client=require(_0x8b47('0x0'));exports['getVtigerAccounts']=function(){return function(_0x323ef8){return client[_0x8b47('0x1')](_0x8b47('0x2'),{'options':{'raw':![],'attributes':['id',_0x8b47('0x3'),_0x8b47('0x4'),'username',_0x8b47('0x5'),_0x8b47('0x6'),_0x8b47('0x7')],'include':[{'model':'VtigerConfiguration','as':_0x8b47('0x8'),'attributes':['id',_0x8b47('0x3')],'include':[{'model':'VtigerField','as':_0x8b47('0x9'),'attributes':['id','type',_0x8b47('0xa'),'variableName'],'include':[{'model':_0x8b47('0xb'),'as':_0x8b47('0xb'),'attributes':['id',_0x8b47('0x3')]}]},{'model':_0x8b47('0xc'),'as':_0x8b47('0xd'),'attributes':['id',_0x8b47('0xe'),_0x8b47('0xa'),_0x8b47('0xf'),_0x8b47('0x10'),_0x8b47('0x11'),_0x8b47('0x12')],'include':[{'model':_0x8b47('0xb'),'as':_0x8b47('0xb'),'attributes':['id',_0x8b47('0x3')]}]},{'model':'VtigerField','as':_0x8b47('0x13'),'attributes':['id',_0x8b47('0xe'),'content',_0x8b47('0x14'),_0x8b47('0x15'),_0x8b47('0x16'),'variableName'],'include':[{'model':_0x8b47('0xb'),'as':'Variable','attributes':['id','name']}]}]}]},'log':_0x8b47('0x2')});};};
\ No newline at end of file
+var _0x86e5=['name','description','username','accessKey','remoteUri','serverUrl','VtigerConfiguration','Configurations','VtigerField','Subjects','type','content','variableName','Variable','Descriptions','key','Fields','idField','nameField','customField','GetVtigerAccount','../../client','getVtigerAccounts','Request'];(function(_0x241b4b,_0x206d5a){var _0x2220d0=function(_0x319241){while(--_0x319241){_0x241b4b['push'](_0x241b4b['shift']());}};_0x2220d0(++_0x206d5a);}(_0x86e5,0x1ad));var _0x586e=function(_0x4d2b30,_0x953bcd){_0x4d2b30=_0x4d2b30-0x0;var _0xd6f69=_0x86e5[_0x4d2b30];return _0xd6f69;};'use strict';var client=require(_0x586e('0x0'));exports[_0x586e('0x1')]=function(){return function(_0x3b2954){return client[_0x586e('0x2')]('GetVtigerAccount',{'options':{'raw':![],'attributes':['id',_0x586e('0x3'),_0x586e('0x4'),_0x586e('0x5'),_0x586e('0x6'),_0x586e('0x7'),_0x586e('0x8')],'include':[{'model':_0x586e('0x9'),'as':_0x586e('0xa'),'attributes':['id','name'],'include':[{'model':_0x586e('0xb'),'as':_0x586e('0xc'),'attributes':['id',_0x586e('0xd'),_0x586e('0xe'),_0x586e('0xf')],'include':[{'model':_0x586e('0x10'),'as':_0x586e('0x10'),'attributes':['id',_0x586e('0x3')]}]},{'model':_0x586e('0xb'),'as':_0x586e('0x11'),'attributes':['id',_0x586e('0xd'),_0x586e('0xe'),_0x586e('0x12'),'keyType','keyContent','variableName'],'include':[{'model':_0x586e('0x10'),'as':_0x586e('0x10'),'attributes':['id',_0x586e('0x3')]}]},{'model':_0x586e('0xb'),'as':_0x586e('0x13'),'attributes':['id',_0x586e('0xd'),_0x586e('0xe'),_0x586e('0x14'),_0x586e('0x15'),_0x586e('0x16'),_0x586e('0xf')],'include':[{'model':_0x586e('0x10'),'as':_0x586e('0x10'),'attributes':['id','name']}]}]}]},'log':_0x586e('0x17')});};};
\ No newline at end of file
index 0276ddb..bb36a8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeffc=['Tag','Subjects','type','content','variableName','ZendeskField','Descriptions','key','keyContent','Variable','Fields','idField','customField','../../client','getZendeskAccounts','Request','GetZendeskAccount','name','username','password','token','authType','serverUrl','ZendeskConfiguration'];(function(_0x43c327,_0x5e636d){var _0x1488bb=function(_0xf5de11){while(--_0xf5de11){_0x43c327['push'](_0x43c327['shift']());}};_0x1488bb(++_0x5e636d);}(_0xeffc,0xb5));var _0xceff=function(_0x32b075,_0x1d0c22){_0x32b075=_0x32b075-0x0;var _0x5d91fb=_0xeffc[_0x32b075];return _0x5d91fb;};'use strict';var client=require(_0xceff('0x0'));exports[_0xceff('0x1')]=function(){return function(_0x2096b7){return client[_0xceff('0x2')](_0xceff('0x3'),{'options':{'raw':![],'attributes':['id',_0xceff('0x4'),_0xceff('0x5'),_0xceff('0x6'),_0xceff('0x7'),'remoteUri',_0xceff('0x8'),_0xceff('0x9'),'type'],'include':[{'model':_0xceff('0xa'),'as':'Configurations','attributes':['id',_0xceff('0x4')],'include':[{'model':_0xceff('0xb'),'attributes':['id',_0xceff('0x4')]},{'model':'ZendeskField','as':_0xceff('0xc'),'attributes':['id',_0xceff('0xd'),_0xceff('0xe'),_0xceff('0xf')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0xceff('0x4')]}]},{'model':_0xceff('0x10'),'as':_0xceff('0x11'),'attributes':['id','type',_0xceff('0xe'),_0xceff('0x12'),'keyType',_0xceff('0x13'),_0xceff('0xf')],'include':[{'model':_0xceff('0x14'),'as':_0xceff('0x14'),'attributes':['id',_0xceff('0x4')]}]},{'model':_0xceff('0x10'),'as':_0xceff('0x15'),'attributes':['id',_0xceff('0xd'),_0xceff('0xe'),_0xceff('0x16'),'nameField',_0xceff('0x17'),_0xceff('0xf')],'include':[{'model':'Variable','as':'Variable','attributes':['id','name']}]}]}]},'log':_0xceff('0x3')});};};
\ No newline at end of file
+var _0xf8a9=['keyContent','Fields','nameField','customField','../../client','getZendeskAccounts','Request','GetZendeskAccount','name','password','authType','serverUrl','type','ZendeskConfiguration','Configurations','Tag','ZendeskField','content','variableName','Variable','Descriptions'];(function(_0x514e89,_0x2db9c6){var _0x30f011=function(_0x8d4493){while(--_0x8d4493){_0x514e89['push'](_0x514e89['shift']());}};_0x30f011(++_0x2db9c6);}(_0xf8a9,0xac));var _0x9f8a=function(_0x2acd19,_0x168295){_0x2acd19=_0x2acd19-0x0;var _0x2b37c2=_0xf8a9[_0x2acd19];return _0x2b37c2;};'use strict';var client=require(_0x9f8a('0x0'));exports[_0x9f8a('0x1')]=function(){return function(_0x2c3799){return client[_0x9f8a('0x2')](_0x9f8a('0x3'),{'options':{'raw':![],'attributes':['id',_0x9f8a('0x4'),'username',_0x9f8a('0x5'),'token','remoteUri',_0x9f8a('0x6'),_0x9f8a('0x7'),_0x9f8a('0x8')],'include':[{'model':_0x9f8a('0x9'),'as':_0x9f8a('0xa'),'attributes':['id',_0x9f8a('0x4')],'include':[{'model':_0x9f8a('0xb'),'attributes':['id',_0x9f8a('0x4')]},{'model':_0x9f8a('0xc'),'as':'Subjects','attributes':['id',_0x9f8a('0x8'),_0x9f8a('0xd'),_0x9f8a('0xe')],'include':[{'model':_0x9f8a('0xf'),'as':_0x9f8a('0xf'),'attributes':['id',_0x9f8a('0x4')]}]},{'model':_0x9f8a('0xc'),'as':_0x9f8a('0x10'),'attributes':['id',_0x9f8a('0x8'),_0x9f8a('0xd'),'key','keyType',_0x9f8a('0x11'),_0x9f8a('0xe')],'include':[{'model':_0x9f8a('0xf'),'as':_0x9f8a('0xf'),'attributes':['id',_0x9f8a('0x4')]}]},{'model':_0x9f8a('0xc'),'as':_0x9f8a('0x12'),'attributes':['id',_0x9f8a('0x8'),'content','idField',_0x9f8a('0x13'),_0x9f8a('0x14'),_0x9f8a('0xe')],'include':[{'model':_0x9f8a('0xf'),'as':_0x9f8a('0xf'),'attributes':['id',_0x9f8a('0x4')]}]}]}]},'log':_0x9f8a('0x3')});};};
\ No newline at end of file
index e927724..2040e8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad7f=['nameField','customField','getZohoAccounts','Request','GetZohoAccount','name','host','clientSecret','serverUrl','ZohoConfiguration','Configurations','moduleCreate','moduleSearch','description','ZohoField','Subjects','type','Variable','content','key','keyType','variableName','Fields','idField'];(function(_0x8cce22,_0x27ebbd){var _0xfb2668=function(_0x407014){while(--_0x407014){_0x8cce22['push'](_0x8cce22['shift']());}};_0xfb2668(++_0x27ebbd);}(_0xad7f,0x182));var _0xfad7=function(_0x217ecd,_0x5b35da){_0x217ecd=_0x217ecd-0x0;var _0x50b480=_0xad7f[_0x217ecd];return _0x50b480;};'use strict';var client=require('../../client');exports[_0xfad7('0x0')]=function(){return function(_0x374273){return client[_0xfad7('0x1')](_0xfad7('0x2'),{'options':{'raw':![],'attributes':['id',_0xfad7('0x3'),'description',_0xfad7('0x4'),'zone','clientId',_0xfad7('0x5'),_0xfad7('0x6'),'code','refreshToken'],'include':[{'model':_0xfad7('0x7'),'as':_0xfad7('0x8'),'attributes':['id','name',_0xfad7('0x9'),_0xfad7('0xa'),_0xfad7('0xb')],'include':[{'model':_0xfad7('0xc'),'as':_0xfad7('0xd'),'attributes':['id',_0xfad7('0xe'),'content','variableName'],'include':[{'model':_0xfad7('0xf'),'as':_0xfad7('0xf'),'attributes':['id',_0xfad7('0x3')]}]},{'model':_0xfad7('0xc'),'as':'Descriptions','attributes':['id',_0xfad7('0xe'),_0xfad7('0x10'),_0xfad7('0x11'),_0xfad7('0x12'),'keyContent',_0xfad7('0x13')],'include':[{'model':_0xfad7('0xf'),'as':_0xfad7('0xf'),'attributes':['id',_0xfad7('0x3')]}]},{'model':_0xfad7('0xc'),'as':_0xfad7('0x14'),'attributes':['id',_0xfad7('0xe'),'content',_0xfad7('0x15'),_0xfad7('0x16'),_0xfad7('0x17'),_0xfad7('0x13')],'include':[{'model':_0xfad7('0xf'),'as':_0xfad7('0xf'),'attributes':['id',_0xfad7('0x3')]}]}]}]},'log':_0xfad7('0x2')});};};
\ No newline at end of file
+var _0xe680=['customField','getZohoAccounts','GetZohoAccount','name','description','host','clientSecret','code','refreshToken','ZohoConfiguration','moduleCreate','moduleSearch','ZohoField','Subjects','type','content','variableName','Variable','key','keyType','keyContent','idField','nameField'];(function(_0x40464c,_0x2e7517){var _0x3da8c9=function(_0x6d211b){while(--_0x6d211b){_0x40464c['push'](_0x40464c['shift']());}};_0x3da8c9(++_0x2e7517);}(_0xe680,0x1b6));var _0x0e68=function(_0xef4fc0,_0x33cc41){_0xef4fc0=_0xef4fc0-0x0;var _0x57dade=_0xe680[_0xef4fc0];return _0x57dade;};'use strict';var client=require('../../client');exports[_0x0e68('0x0')]=function(){return function(_0x28e6dc){return client['Request'](_0x0e68('0x1'),{'options':{'raw':![],'attributes':['id',_0x0e68('0x2'),_0x0e68('0x3'),_0x0e68('0x4'),'zone','clientId',_0x0e68('0x5'),'serverUrl',_0x0e68('0x6'),_0x0e68('0x7')],'include':[{'model':_0x0e68('0x8'),'as':'Configurations','attributes':['id','name',_0x0e68('0x9'),_0x0e68('0xa'),_0x0e68('0x3')],'include':[{'model':_0x0e68('0xb'),'as':_0x0e68('0xc'),'attributes':['id',_0x0e68('0xd'),_0x0e68('0xe'),_0x0e68('0xf')],'include':[{'model':_0x0e68('0x10'),'as':_0x0e68('0x10'),'attributes':['id',_0x0e68('0x2')]}]},{'model':_0x0e68('0xb'),'as':'Descriptions','attributes':['id',_0x0e68('0xd'),_0x0e68('0xe'),_0x0e68('0x11'),_0x0e68('0x12'),_0x0e68('0x13'),_0x0e68('0xf')],'include':[{'model':'Variable','as':_0x0e68('0x10'),'attributes':['id','name']}]},{'model':_0x0e68('0xb'),'as':'Fields','attributes':['id','type',_0x0e68('0xe'),_0x0e68('0x14'),_0x0e68('0x15'),_0x0e68('0x16'),_0x0e68('0xf')],'include':[{'model':_0x0e68('0x10'),'as':_0x0e68('0x10'),'attributes':['id','name']}]}]}]},'log':_0x0e68('0x1')});};};
\ No newline at end of file
index e85637f..8bb47da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x069b=['diff','seconds','inbound','calleridnum','agent','accountcode','toNumber','voiceDialReport','membername','TALKING','endtime','starttime','outbound','exten','uniqueid','moment','lodash','util','../client','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','interface','format','SIP/%s','queuecallerleaveAt'];(function(_0x52a95b,_0x12b149){var _0x476d7b=function(_0x3b7b47){while(--_0x3b7b47){_0x52a95b['push'](_0x52a95b['shift']());}};_0x476d7b(++_0x12b149);}(_0x069b,0x10b));var _0xb069=function(_0x5687e6,_0x4e44ad){_0x5687e6=_0x5687e6-0x0;var _0x4a1b13=_0x069b[_0x5687e6];return _0x4a1b13;};'use strict';var moment=require(_0xb069('0x0'));var _=require(_0xb069('0x1'));var util=require(_0xb069('0x2'));var client=require(_0xb069('0x3'));exports['voiceQueueReport']=function(_0x3f71f7){var _0x3119b9=_0x3f71f7[_0xb069('0x4')]||_0x3f71f7[_0xb069('0x5')];return client[_0xb069('0x6')](_0xb069('0x7'),{'body':{'channel':_0xb069('0x8'),'membername':_0x3f71f7['lastAssignedTo'],'interface':_['isNil'](_0x3f71f7[_0xb069('0x9')])?util[_0xb069('0xa')](_0xb069('0xb'),_0x3f71f7['lastAssignedTo']):_0x3f71f7[_0xb069('0x9')],'type':'TALKING','enterAt':_0x3f71f7[_0xb069('0xc')],'exitAt':_0x3119b9,'duration':moment(_0x3119b9)[_0xb069('0xd')](_0x3f71f7['queuecallerleaveAt'],_0xb069('0xe')),'data1':_0xb069('0xf'),'data2':_0x3f71f7[_0xb069('0x10')],'data3':_0x3f71f7['exten'],'data4':null,'data5':_0x3f71f7['queue'],'role':_0xb069('0x11'),'internal':_0x3f71f7[_0xb069('0x12')]?_[_0xb069('0x13')](_0x3f71f7[_0xb069('0x12')]):undefined,'uniqueid':_0x3f71f7['uniqueid']},'log':_0xb069('0x7')});};exports[_0xb069('0x14')]=function(_0x41bb89){return client[_0xb069('0x6')](_0xb069('0x7'),{'body':{'channel':_0xb069('0x8'),'membername':_0x41bb89[_0xb069('0x15')],'interface':_0x41bb89[_0xb069('0x9')],'type':_0xb069('0x16'),'enterAt':_0x41bb89['starttime'],'exitAt':_0x41bb89[_0xb069('0x17')],'duration':moment(_0x41bb89[_0xb069('0x17')])[_0xb069('0xd')](_0x41bb89[_0xb069('0x18')],_0xb069('0xe'))>=0x0?moment(_0x41bb89['endtime'])[_0xb069('0xd')](_0x41bb89['starttime'],_0xb069('0xe')):null,'data1':_0xb069('0x19'),'data2':_0x41bb89[_0xb069('0x12')],'data3':_0x41bb89[_0xb069('0x1a')],'data4':_0x41bb89['dialstring']||null,'role':_0xb069('0x11'),'internal':_0x41bb89[_0xb069('0x12')]?_['toNumber'](_0x41bb89[_0xb069('0x12')]):undefined,'uniqueid':_0x41bb89[_0xb069('0x1b')]},'log':'CreateMemberReport'});};
\ No newline at end of file
+var _0x83de=['isNil','interface','format','SIP/%s','TALKING','diff','seconds','inbound','calleridnum','exten','queue','accountcode','uniqueid','voiceDialReport','Request','membername','starttime','endtime','outbound','dialstring','toNumber','moment','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','CreateMemberReport','voice','lastAssignedTo'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x83de,0x105));var _0xe83d=function(_0x2edc27,_0x675f73){_0x2edc27=_0x2edc27-0x0;var _0x17c2dc=_0x83de[_0x2edc27];return _0x17c2dc;};'use strict';var moment=require(_0xe83d('0x0'));var _=require(_0xe83d('0x1'));var util=require(_0xe83d('0x2'));var client=require(_0xe83d('0x3'));exports[_0xe83d('0x4')]=function(_0x13086f){var _0x57c112=_0x13086f[_0xe83d('0x5')]||_0x13086f['queuecallerexitAt'];return client['Request'](_0xe83d('0x6'),{'body':{'channel':_0xe83d('0x7'),'membername':_0x13086f[_0xe83d('0x8')],'interface':_[_0xe83d('0x9')](_0x13086f[_0xe83d('0xa')])?util[_0xe83d('0xb')](_0xe83d('0xc'),_0x13086f[_0xe83d('0x8')]):_0x13086f['interface'],'type':_0xe83d('0xd'),'enterAt':_0x13086f['queuecallerleaveAt'],'exitAt':_0x57c112,'duration':moment(_0x57c112)[_0xe83d('0xe')](_0x13086f['queuecallerleaveAt'],_0xe83d('0xf')),'data1':_0xe83d('0x10'),'data2':_0x13086f[_0xe83d('0x11')],'data3':_0x13086f[_0xe83d('0x12')],'data4':null,'data5':_0x13086f[_0xe83d('0x13')],'role':'agent','internal':_0x13086f['accountcode']?_['toNumber'](_0x13086f[_0xe83d('0x14')]):undefined,'uniqueid':_0x13086f[_0xe83d('0x15')]},'log':_0xe83d('0x6')});};exports[_0xe83d('0x16')]=function(_0xf7b3ca){return client[_0xe83d('0x17')](_0xe83d('0x6'),{'body':{'channel':_0xe83d('0x7'),'membername':_0xf7b3ca[_0xe83d('0x18')],'interface':_0xf7b3ca[_0xe83d('0xa')],'type':_0xe83d('0xd'),'enterAt':_0xf7b3ca[_0xe83d('0x19')],'exitAt':_0xf7b3ca[_0xe83d('0x1a')],'duration':moment(_0xf7b3ca['endtime'])[_0xe83d('0xe')](_0xf7b3ca[_0xe83d('0x19')],_0xe83d('0xf'))>=0x0?moment(_0xf7b3ca[_0xe83d('0x1a')])[_0xe83d('0xe')](_0xf7b3ca[_0xe83d('0x19')],_0xe83d('0xf')):null,'data1':_0xe83d('0x1b'),'data2':_0xf7b3ca[_0xe83d('0x14')],'data3':_0xf7b3ca['exten'],'data4':_0xf7b3ca[_0xe83d('0x1c')]||null,'role':'agent','internal':_0xf7b3ca[_0xe83d('0x14')]?_[_0xe83d('0x1d')](_0xf7b3ca[_0xe83d('0x14')]):undefined,'uniqueid':_0xf7b3ca[_0xe83d('0x15')]},'log':_0xe83d('0x6')});};
\ No newline at end of file
index ce03b47..42ffa4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x220b=['ShowSetting','stopRecordingOnTransfer','getSettings','Request'];(function(_0x241cb7,_0x580fbb){var _0x199d0d=function(_0x41b7d4){while(--_0x41b7d4){_0x241cb7['push'](_0x241cb7['shift']());}};_0x199d0d(++_0x580fbb);}(_0x220b,0x1a2));var _0xb220=function(_0x256d6a,_0x2f002f){_0x256d6a=_0x256d6a-0x0;var _0x460058=_0x220b[_0x256d6a];return _0x460058;};'use strict';var client=require('../client');exports[_0xb220('0x0')]=function(){return client[_0xb220('0x1')](_0xb220('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xb220('0x3')]},'log':'GetSettings'});};
\ No newline at end of file
+var _0xb49a=['stopRecordingOnTransfer','../client','getSettings','Request','ShowSetting'];(function(_0x228091,_0x54ab0c){var _0x3d6c8e=function(_0x123dfd){while(--_0x123dfd){_0x228091['push'](_0x228091['shift']());}};_0x3d6c8e(++_0x54ab0c);}(_0xb49a,0xfb));var _0xab49=function(_0x33ec17,_0x1fd9e9){_0x33ec17=_0x33ec17-0x0;var _0x46eceb=_0xb49a[_0x33ec17];return _0x46eceb;};'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
index f4a1063..4ba90c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3c6=['name','html','GetTemplate','../client','getTemplates','Request'];(function(_0x36a77e,_0x232297){var _0x4ef836=function(_0x485166){while(--_0x485166){_0x36a77e['push'](_0x36a77e['shift']());}};_0x4ef836(++_0x232297);}(_0xa3c6,0xb1));var _0x6a3c=function(_0x3fe727,_0x4173cd){_0x3fe727=_0x3fe727-0x0;var _0x277c45=_0xa3c6[_0x3fe727];return _0x277c45;};'use strict';var client=require(_0x6a3c('0x0'));exports[_0x6a3c('0x1')]=function(_0x7ba933){return function(_0x28b56b){return client[_0x6a3c('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x6a3c('0x3'),_0x6a3c('0x4')]},'log':_0x6a3c('0x5')});};};
\ No newline at end of file
+var _0x3925=['GetTemplate','name','../client','getTemplates','Request'];(function(_0x1aed80,_0x3ca6f6){var _0x43961e=function(_0x43bf2b){while(--_0x43bf2b){_0x1aed80['push'](_0x1aed80['shift']());}};_0x43961e(++_0x3ca6f6);}(_0x3925,0x1ba));var _0x5392=function(_0x513e46,_0x798ec6){_0x513e46=_0x513e46-0x0;var _0x5dc950=_0x3925[_0x513e46];return _0x5dc950;};'use strict';var client=require(_0x5392('0x0'));exports[_0x5392('0x1')]=function(_0x91191e){return function(_0x126191){return client[_0x5392('0x2')](_0x5392('0x3'),{'options':{'raw':!![],'attributes':['id',_0x5392('0x4'),'html']},'log':'GetTemplate'});};};
\ No newline at end of file
index 2629d95..e8ef6d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8bd=['data4','data5','data6','data7','../client','getTriggers','GetTrigger','name','status','Condition','AllConditions','field','operator','value','AnyConditions','Action','Actions','action','data2','data3'];(function(_0xeecd58,_0x15b2bd){var _0x6757e4=function(_0x35c160){while(--_0x35c160){_0xeecd58['push'](_0xeecd58['shift']());}};_0x6757e4(++_0x15b2bd);}(_0xc8bd,0x158));var _0xdc8b=function(_0x2820fc,_0x481318){_0x2820fc=_0x2820fc-0x0;var _0x1e1508=_0xc8bd[_0x2820fc];return _0x1e1508;};'use strict';var client=require(_0xdc8b('0x0'));exports[_0xdc8b('0x1')]=function(_0x3f5306){return function(_0x159810){return client['Request'](_0xdc8b('0x2'),{'options':{'raw':![],'attributes':['id',_0xdc8b('0x3'),'channel',_0xdc8b('0x4')],'include':[{'model':_0xdc8b('0x5'),'as':_0xdc8b('0x6'),'attributes':['id',_0xdc8b('0x7'),_0xdc8b('0x8'),_0xdc8b('0x9')]},{'model':_0xdc8b('0x5'),'as':_0xdc8b('0xa'),'attributes':['id','field',_0xdc8b('0x8'),_0xdc8b('0x9')]},{'model':_0xdc8b('0xb'),'as':_0xdc8b('0xc'),'attributes':['id',_0xdc8b('0xd'),'data1',_0xdc8b('0xe'),_0xdc8b('0xf'),_0xdc8b('0x10'),_0xdc8b('0x11'),_0xdc8b('0x12'),_0xdc8b('0x13')]}]},'log':'GetTrigger'});};};
\ No newline at end of file
+var _0xc8de=['channel','Condition','AllConditions','field','operator','AnyConditions','value','Action','Actions','action','data1','data2','data3','data4','data6','Request','GetTrigger','name'];(function(_0x165ade,_0x3ef17c){var _0x3e418a=function(_0x455fd9){while(--_0x455fd9){_0x165ade['push'](_0x165ade['shift']());}};_0x3e418a(++_0x3ef17c);}(_0xc8de,0x69));var _0xec8d=function(_0x1293f7,_0x4876be){_0x1293f7=_0x1293f7-0x0;var _0x2bd457=_0xc8de[_0x1293f7];return _0x2bd457;};'use strict';var client=require('../client');exports['getTriggers']=function(_0x24036c){return function(_0xf8fc37){return client[_0xec8d('0x0')](_0xec8d('0x1'),{'options':{'raw':![],'attributes':['id',_0xec8d('0x2'),_0xec8d('0x3'),'status'],'include':[{'model':_0xec8d('0x4'),'as':_0xec8d('0x5'),'attributes':['id',_0xec8d('0x6'),_0xec8d('0x7'),'value']},{'model':_0xec8d('0x4'),'as':_0xec8d('0x8'),'attributes':['id',_0xec8d('0x6'),_0xec8d('0x7'),_0xec8d('0x9')]},{'model':_0xec8d('0xa'),'as':_0xec8d('0xb'),'attributes':['id',_0xec8d('0xc'),_0xec8d('0xd'),_0xec8d('0xe'),_0xec8d('0xf'),_0xec8d('0x10'),'data5',_0xec8d('0x11'),'data7']}]},'log':_0xec8d('0x1')});};};
\ No newline at end of file
index b2a0813..ed538d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b36=['GetTrunk','getTrunks','Request','registry','defaultuser'];(function(_0x307ef5,_0x5dbf62){var _0x378b98=function(_0x24ff53){while(--_0x24ff53){_0x307ef5['push'](_0x307ef5['shift']());}};_0x378b98(++_0x5dbf62);}(_0x1b36,0x169));var _0x61b3=function(_0x5c54da,_0x4e74d5){_0x5c54da=_0x5c54da-0x0;var _0x40c155=_0x1b36[_0x5c54da];return _0x40c155;};'use strict';var client=require('../client');exports[_0x61b3('0x0')]=function(_0x8b6a30){return function(_0x598916){return client[_0x61b3('0x1')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x61b3('0x2'),_0x61b3('0x3')]},'log':_0x61b3('0x4')});};};
\ No newline at end of file
+var _0x637f=['GetTrunk','name','Request'];(function(_0x25e754,_0x200eba){var _0x1d991e=function(_0x1601ba){while(--_0x1601ba){_0x25e754['push'](_0x25e754['shift']());}};_0x1d991e(++_0x200eba);}(_0x637f,0x1af));var _0xf637=function(_0x39c8f2,_0x23df6c){_0x39c8f2=_0x39c8f2-0x0;var _0x445526=_0x637f[_0x39c8f2];return _0x445526;};'use strict';var client=require('../client');exports['getTrunks']=function(_0x1c58a5){return function(_0x49f8ae){return client[_0xf637('0x0')](_0xf637('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xf637('0x2'),'registry','defaultuser']},'log':'GetTrunk'});};};
\ No newline at end of file
index eea50a4..b62d53b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['../client','getAgents','Request','GetUser','name','email','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','mobile','interface','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','agent','lastPauseAt'];(function(_0x1151ec,_0x4576b9){var _0xce4b78=function(_0x9d4742){while(--_0x9d4742){_0x1151ec['push'](_0x1151ec['shift']());}};_0xce4b78(++_0x4576b9);}(_0x34e8,0x12c));var _0x834e=function(_0x5bb702,_0x44a577){_0x5bb702=_0x5bb702-0x0;var _0x5604b9=_0x34e8[_0x5bb702];return _0x5604b9;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6'),_0x834e('0x7'),_0x834e('0x8'),_0x834e('0x9'),_0x834e('0xa'),'lastPauseAt',_0x834e('0xb'),'phone',_0x834e('0xc'),_0x834e('0xd')]},'log':_0x834e('0x1')});};};exports[_0x834e('0xe')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':!![],'where':{'role':_0x834e('0xf')},'attributes':['id',_0x834e('0x4'),_0x834e('0x6'),_0x834e('0x10')]},'log':_0x834e('0xe')});};};exports[_0x834e('0x11')]=function(_0x14038b,_0x2e1a37,_0x293514){return client[_0x834e('0x2')](_0x834e('0x12'),{'body':{'type':_0x2e1a37,'uniqueid':_0x293514},'options':{'where':{'id':_0x14038b['id']}},'log':'savePause'});};exports[_0x834e('0x13')]=function(_0x6cd9b9){return client['Request'](_0x834e('0x14'),{'body':{},'options':{'where':{'id':_0x6cd9b9['id']}},'log':_0x834e('0x11')});};exports[_0x834e('0x15')]=function(_0x21cc0a){return client['Request'](_0x834e('0x16'),{'options':{'raw':![],'where':{'role':_0x834e('0x17'),'id':_0x21cc0a},'attributes':['id','name',_0x834e('0x5'),'accountcode',_0x834e('0x7'),_0x834e('0x8'),'lastLoginAt',_0x834e('0xa'),_0x834e('0x18'),_0x834e('0xb'),'interface']},'log':_0x834e('0x15')});};
\ No newline at end of file
+var _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x4cbf09,_0x5abcfc){var _0x503383=function(_0x294c6b){while(--_0x294c6b){_0x4cbf09['push'](_0x4cbf09['shift']());}};_0x503383(++_0x5abcfc);}(_0x9c44,0x178));var _0x49c4=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9c44[_0xfae23b];return _0x200640;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});};
\ No newline at end of file
index b27fcc3..10d65b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x515b=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','create'];(function(_0x446cce,_0x377102){var _0x541b3f=function(_0x1c14ee){while(--_0x1c14ee){_0x446cce['push'](_0x446cce['shift']());}};_0x541b3f(++_0x377102);}(_0x515b,0xfa));var _0xb515=function(_0x27cc6d,_0x1cd770){_0x27cc6d=_0x27cc6d-0x0;var _0x1f87f0=_0x515b[_0x27cc6d];return _0x1f87f0;};'use strict';var client=require(_0xb515('0x0'));exports[_0xb515('0x1')]=function(_0x2867e9){return client[_0xb515('0x2')](_0xb515('0x3'),{'body':_0x2867e9,'log':_0xb515('0x3')});};exports[_0xb515('0x4')]=function(_0x4e7a74,_0x51c6ae,_0x374620){return client[_0xb515('0x2')](_0xb515('0x5'),{'body':_0x4e7a74,'options':{'where':{'uniqueid':_0x51c6ae,'interface':_0x374620,'agentcomplete':!![]}},'log':_0xb515('0x5')});};
\ No newline at end of file
+var _0xa19d=['create','CreateVoiceAgentReport','update','Request','UpdateVoiceAgentReport','../client'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xa19d,0x12b));var _0xda19=function(_0x7679ae,_0x5a55cf){_0x7679ae=_0x7679ae-0x0;var _0x28eed9=_0xa19d[_0x7679ae];return _0x28eed9;};'use strict';var client=require(_0xda19('0x0'));exports[_0xda19('0x1')]=function(_0x18a52a){return client['Request'](_0xda19('0x2'),{'body':_0x18a52a,'log':_0xda19('0x2')});};exports[_0xda19('0x3')]=function(_0x45c5bb,_0x131649,_0x3571c9){return client[_0xda19('0x4')](_0xda19('0x5'),{'body':_0x45c5bb,'options':{'where':{'uniqueid':_0x131649,'interface':_0x3571c9,'agentcomplete':!![]}},'log':_0xda19('0x5')});};
\ No newline at end of file
index 19d6014..b32e607 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2763=['endOf','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','create','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','GetVoiceCallReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x768345,_0x2ab450){var _0x48550a=function(_0x3f88b6){while(--_0x3f88b6){_0x768345['push'](_0x768345['shift']());}};_0x48550a(++_0x2ab450);}(_0x2763,0xcc));var _0x3276=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2763[_0x14add3];return _0x4a174f;};'use strict';var moment=require(_0x3276('0x0'));var util=require(_0x3276('0x1'));var _=require(_0x3276('0x2'));var client=require(_0x3276('0x3'));exports[_0x3276('0x4')]=function(_0x5c5b03){return client['Request'](_0x3276('0x5'),{'body':_[_0x3276('0x6')](_0x5c5b03,{'source':_0x5c5b03[_0x3276('0x7')],'destinationcontext':_0x5c5b03[_0x3276('0x8')],'callerid':_0x5c5b03[_0x3276('0x9')],'amaflags':_0x3276('0xa')}),'log':_0x3276('0x5')});};exports['getVoiceCallReports']=function(){return function(){return client['Request'](_0x3276('0xb'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x3276('0xc')](_0x3276('0xd'))[_0x3276('0xe')](_0x3276('0xf')),moment()[_0x3276('0x10')](_0x3276('0xd'))[_0x3276('0xe')](_0x3276('0xf'))]}},'attributes':[_0x3276('0x11'),_0x3276('0x12'),_0x3276('0x13'),_0x3276('0x14')]},'log':_0x3276('0x15')});};};
\ No newline at end of file
+var _0x2193=['lodash','../client','Request','CreateVoiceCallReport','merge','context','callerid','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','type','duration','moment'];(function(_0x5c1911,_0x5063d9){var _0x360290=function(_0x5081a7){while(--_0x5081a7){_0x5c1911['push'](_0x5c1911['shift']());}};_0x360290(++_0x5063d9);}(_0x2193,0x1ec));var _0x3219=function(_0x3901f4,_0x1c530b){_0x3901f4=_0x3901f4-0x0;var _0x23f3ac=_0x2193[_0x3901f4];return _0x23f3ac;};'use strict';var moment=require(_0x3219('0x0'));var util=require('util');var _=require(_0x3219('0x1'));var client=require(_0x3219('0x2'));exports['create']=function(_0x2cda12){return client[_0x3219('0x3')](_0x3219('0x4'),{'body':_[_0x3219('0x5')](_0x2cda12,{'source':_0x2cda12['calleridnum'],'destinationcontext':_0x2cda12[_0x3219('0x6')],'callerid':_0x2cda12[_0x3219('0x7')],'amaflags':'DOCUMENTATION'}),'log':'CreateVoiceCallReport'});};exports[_0x3219('0x8')]=function(){return function(){return client[_0x3219('0x3')](_0x3219('0x9'),{'options':{'where':{'type':[_0x3219('0xa')],'createdAt':{'$between':[moment()[_0x3219('0xb')](_0x3219('0xc'))[_0x3219('0xd')](_0x3219('0xe')),moment()['endOf']('day')['format']('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x3219('0xf'),'disposition',_0x3219('0x10'),'billableseconds']},'log':'GetVoiceCallReports'});};};
\ No newline at end of file
index 94e3057..d1cdec5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23ba=['CreateVoiceDialReport','../client'];(function(_0x519051,_0x6675fe){var _0x43b9c9=function(_0x1dfaaf){while(--_0x1dfaaf){_0x519051['push'](_0x519051['shift']());}};_0x43b9c9(++_0x6675fe);}(_0x23ba,0x143));var _0xa23b=function(_0x11bf53,_0x47b0a6){_0x11bf53=_0x11bf53-0x0;var _0x19d79c=_0x23ba[_0x11bf53];return _0x19d79c;};'use strict';var client=require(_0xa23b('0x0'));exports['create']=function(_0x17f2ad){return client['Request'](_0xa23b('0x1'),{'body':_0x17f2ad,'log':_0xa23b('0x1')});};
\ No newline at end of file
+var _0xcd9b=['Request','CreateVoiceDialReport','../client','create'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xcd9b,0x1a2));var _0xbcd9=function(_0x3b71e4,_0x37cb07){_0x3b71e4=_0x3b71e4-0x0;var _0x446838=_0xcd9b[_0x3b71e4];return _0x446838;};'use strict';var client=require(_0xbcd9('0x0'));exports[_0xbcd9('0x1')]=function(_0x21e64){return client[_0xbcd9('0x2')](_0xbcd9('0x3'),{'body':_0x21e64,'log':_0xbcd9('0x3')});};
\ No newline at end of file
index 38b6b05..eb8fe2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd6f=['Request','GetVoiceExtension','exten','../client','getVoiceExtensions'];(function(_0xb3f12b,_0x40e1e8){var _0x50e42f=function(_0x51507e){while(--_0x51507e){_0xb3f12b['push'](_0xb3f12b['shift']());}};_0x50e42f(++_0x40e1e8);}(_0xfd6f,0x19d));var _0xffd6=function(_0x383527,_0x36992d){_0x383527=_0x383527-0x0;var _0x1a05aa=_0xfd6f[_0x383527];return _0x1a05aa;};'use strict';var client=require(_0xffd6('0x0'));exports[_0xffd6('0x1')]=function(){return function(){return client[_0xffd6('0x2')](_0xffd6('0x3'),{'options':{'raw':!![],'attributes':['id',_0xffd6('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xffd6('0x1')});};};
\ No newline at end of file
+var _0xe87e=['exten','../client','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x1fdd09,_0x188de4){var _0x52c681=function(_0x2ac787){while(--_0x2ac787){_0x1fdd09['push'](_0x1fdd09['shift']());}};_0x52c681(++_0x188de4);}(_0xe87e,0x17d));var _0xee87=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0xe87e[_0x556927];return _0x5f1235;};'use strict';var client=require(_0xee87('0x0'));exports[_0xee87('0x1')]=function(){return function(){return client[_0xee87('0x2')](_0xee87('0x3'),{'options':{'raw':!![],'attributes':['id',_0xee87('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xee87('0x1')});};};
\ No newline at end of file
index 980b60b..d69ee43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a98=['dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','Pause','mandatoryDispositionPause','TrunkBackup','active','Interval','Intervals','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','monitor_format','type','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt'];(function(_0x5ce4d2,_0x2365f7){var _0x1e5009=function(_0x33aabf){while(--_0x33aabf){_0x5ce4d2['push'](_0x5ce4d2['shift']());}};_0x1e5009(++_0x2365f7);}(_0x7a98,0xc9));var _0x87a9=function(_0x50c5a7,_0x10cf88){_0x50c5a7=_0x50c5a7-0x0;var _0xe2bf08=_0x7a98[_0x50c5a7];return _0xe2bf08;};'use strict';var client=require(_0x87a9('0x0'));exports[_0x87a9('0x1')]=function(){return function(){return client[_0x87a9('0x2')](_0x87a9('0x3'),{'options':{'raw':![],'attributes':['id',_0x87a9('0x4'),_0x87a9('0x5'),_0x87a9('0x6'),'autopause',_0x87a9('0x7'),_0x87a9('0x8'),_0x87a9('0x9'),_0x87a9('0xa'),'dialLimitChannel',_0x87a9('0xb'),_0x87a9('0xc'),'dialPredictiveOptimization',_0x87a9('0xd'),'dialPredictiveInterval',_0x87a9('0xe'),_0x87a9('0xf'),_0x87a9('0x10'),_0x87a9('0x11'),_0x87a9('0x12'),'dialQueueProject',_0x87a9('0x13'),_0x87a9('0x14'),'dialBusyMaxRetry',_0x87a9('0x15'),'dialNoAnswerMaxRetry',_0x87a9('0x16'),_0x87a9('0x17'),'dialTimezone',_0x87a9('0x18'),_0x87a9('0x19'),_0x87a9('0x1a'),_0x87a9('0x1b'),_0x87a9('0x1c'),'dialAMDGreeting',_0x87a9('0x1d'),_0x87a9('0x1e'),_0x87a9('0x1f'),_0x87a9('0x20'),'dialAMDMaximumNumberOfWords',_0x87a9('0x21'),_0x87a9('0x22'),_0x87a9('0x23'),_0x87a9('0x24'),_0x87a9('0x25'),_0x87a9('0x26'),_0x87a9('0x27'),_0x87a9('0x28'),_0x87a9('0x29'),_0x87a9('0x7'),_0x87a9('0x2a'),_0x87a9('0x2b'),_0x87a9('0x2c'),_0x87a9('0x2d'),'dialNoSuchNumberRetryFrequency',_0x87a9('0x2e'),'dialDropRetryFrequency',_0x87a9('0x2f'),'dialAbandonedRetryFrequency',_0x87a9('0x30'),_0x87a9('0x31'),'dialAgentRejectMaxRetry',_0x87a9('0x32'),'mandatoryDisposition',_0x87a9('0x33'),_0x87a9('0x34')],'include':[{'model':_0x87a9('0x35'),'as':_0x87a9('0x35'),'attributes':['id',_0x87a9('0x4'),'callerid','active']},{'model':_0x87a9('0x36'),'as':_0x87a9('0x37'),'attributes':['id',_0x87a9('0x4')]},{'model':_0x87a9('0x35'),'as':_0x87a9('0x38'),'attributes':['id','name','callerid',_0x87a9('0x39')]},{'model':'Interval','as':_0x87a9('0x3a'),'attributes':['id','name'],'include':[{'model':_0x87a9('0x3a'),'as':_0x87a9('0x3b'),'attributes':['id',_0x87a9('0x4'),'interval']}]}]},'log':'getVoiceQueues'});};};
\ No newline at end of file
+var _0x232c=['dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','autopause','type','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout'];(function(_0x146961,_0x9b5d75){var _0x17e6d0=function(_0x33ad43){while(--_0x33ad43){_0x146961['push'](_0x146961['shift']());}};_0x17e6d0(++_0x9b5d75);}(_0x232c,0x144));var _0xc232=function(_0x48a93a,_0x175ecb){_0x48a93a=_0x48a93a-0x0;var _0x1f5c1e=_0x232c[_0x48a93a];return _0x1f5c1e;};'use strict';var client=require(_0xc232('0x0'));exports[_0xc232('0x1')]=function(){return function(){return client[_0xc232('0x2')](_0xc232('0x3'),{'options':{'raw':![],'attributes':['id',_0xc232('0x4'),_0xc232('0x5'),'acwTimeout',_0xc232('0x6'),'monitor_format',_0xc232('0x7'),'dialActive',_0xc232('0x8'),_0xc232('0x9'),'dialLimitQueue',_0xc232('0xa'),_0xc232('0xb'),_0xc232('0xc'),_0xc232('0xd'),_0xc232('0xe'),_0xc232('0xf'),_0xc232('0x10'),_0xc232('0x11'),'dialQueueTimeout',_0xc232('0x12'),_0xc232('0x13'),_0xc232('0x14'),_0xc232('0x15'),'dialBusyRetryFrequency','dialNoAnswerMaxRetry',_0xc232('0x16'),'dialGlobalMaxRetry',_0xc232('0x17'),_0xc232('0x18'),_0xc232('0x19'),_0xc232('0x1a'),'dialAMDActive',_0xc232('0x1b'),_0xc232('0x1c'),_0xc232('0x1d'),_0xc232('0x1e'),_0xc232('0x1f'),_0xc232('0x20'),'dialAMDMaximumNumberOfWords',_0xc232('0x21'),_0xc232('0x22'),'timeout',_0xc232('0x23'),_0xc232('0x24'),'dialOrderByScheduledAt',_0xc232('0x25'),_0xc232('0x26'),_0xc232('0x27'),_0xc232('0x28'),_0xc232('0x29'),_0xc232('0x2a'),_0xc232('0x2b'),_0xc232('0x2c'),_0xc232('0x2d'),'dialDropMaxRetry',_0xc232('0x2e'),'dialAbandonedMaxRetry',_0xc232('0x2f'),_0xc232('0x30'),'dialMachineRetryFrequency',_0xc232('0x31'),_0xc232('0x32'),'mandatoryDisposition',_0xc232('0x33'),'dialPredictiveIntervalMinThreshold'],'include':[{'model':_0xc232('0x34'),'as':_0xc232('0x34'),'attributes':['id',_0xc232('0x4'),_0xc232('0x35'),_0xc232('0x36')]},{'model':_0xc232('0x37'),'as':_0xc232('0x38'),'attributes':['id','name']},{'model':_0xc232('0x34'),'as':_0xc232('0x39'),'attributes':['id','name',_0xc232('0x35'),'active']},{'model':_0xc232('0x3a'),'as':'Interval','attributes':['id',_0xc232('0x4')],'include':[{'model':_0xc232('0x3a'),'as':_0xc232('0x3b'),'attributes':['id',_0xc232('0x4'),'interval']}]}]},'log':_0xc232('0x1')});};};
\ No newline at end of file
index dc830f8..899a317 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(_0x18fc81,_0x7e7392){var _0x1f1bf4=function(_0x2a06d3){while(--_0x2a06d3){_0x18fc81['push'](_0x18fc81['shift']());}};_0x1f1bf4(++_0x7e7392);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};};
\ No newline at end of file
+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(_0x481aaf,_0xec1c7a){var _0x23c8e0=function(_0x2f97d2){while(--_0x2f97d2){_0x481aaf['push'](_0x481aaf['shift']());}};_0x23c8e0(++_0xec1c7a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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 0b207d9..4750dce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x235f=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x8047da,_0x5ab144){var _0x364806=function(_0x3dc1d8){while(--_0x3dc1d8){_0x8047da['push'](_0x8047da['shift']());}};_0x364806(++_0x5ab144);}(_0x235f,0x67));var _0xf235=function(_0x511bd1,_0x223e5b){_0x511bd1=_0x511bd1-0x0;var _0x4c48ec=_0x235f[_0x511bd1];return _0x4c48ec;};'use strict';var client=require(_0xf235('0x0'));exports[_0xf235('0x1')]=function(_0x50e147){return function(){return client['Request'](_0xf235('0x2'),{'options':{'where':{'VoiceQueueId':_0x50e147,'paused':!![]},'raw':!![]},'log':_0xf235('0x1')});};};
\ No newline at end of file
+var _0xfabf=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x56fc31,_0xeb5697){var _0x3b611b=function(_0xceb96d){while(--_0xceb96d){_0x56fc31['push'](_0x56fc31['shift']());}};_0x3b611b(++_0xeb5697);}(_0xfabf,0x15d));var _0xffab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfabf[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xffab('0x0'));exports[_0xffab('0x1')]=function(_0x14240a){return function(){return client[_0xffab('0x2')](_0xffab('0x3'),{'options':{'where':{'VoiceQueueId':_0x14240a,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};};
\ No newline at end of file
index bc0335a..ddbc5f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x363934,_0x317855){var _0x37b9d7=function(_0x1f8cf9){while(--_0x1f8cf9){_0x363934['push'](_0x363934['shift']());}};_0x37b9d7(++_0x317855);}(_0x7a54,0x106));var _0x47a5=function(_0x64b61d,_0x3e5dec){_0x64b61d=_0x64b61d-0x0;var _0x4ba44d=_0x7a54[_0x64b61d];return _0x4ba44d;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});};
\ No newline at end of file
+var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x387d23,_0xe0afa2){var _0x4fc5de=function(_0x2060be){while(--_0x2060be){_0x387d23['push'](_0x387d23['shift']());}};_0x4fc5de(++_0xe0afa2);}(_0x7a54,0x106));var _0x47a5=function(_0x599847,_0x15e045){_0x599847=_0x599847-0x0;var _0x4df188=_0x7a54[_0x599847];return _0x4df188;};'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 7272e92..1111bfc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4077=['transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','context','blind','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransferercontext','secondtransfererexten','origtransfererlinkedid'];(function(_0x4f9673,_0x4313bd){var _0x337e5e=function(_0x5677cf){while(--_0x5677cf){_0x4f9673['push'](_0x4f9673['shift']());}};_0x337e5e(++_0x4313bd);}(_0x4077,0x1a1));var _0x7407=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4077[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x7407('0x0'));exports[_0x7407('0x1')]={};exports[_0x7407('0x2')]=function(_0x14ca13){return client[_0x7407('0x3')](_0x7407('0x4'),{'body':{'result':_0x14ca13[_0x7407('0x5')],'transfererchannel':_0x14ca13[_0x7407('0x6')],'transferercalleridnum':_0x14ca13[_0x7407('0x7')],'transferercalleridname':_0x14ca13[_0x7407('0x8')],'transfererconnectedlinenum':_0x14ca13[_0x7407('0x9')],'transfererconnectedlinename':_0x14ca13[_0x7407('0xa')],'transfereraccountcode':_0x14ca13[_0x7407('0xb')],'transferercontext':_0x14ca13['transferercontext'],'transfererexten':_0x14ca13['transfererexten'],'transfererlinkedid':_0x14ca13[_0x7407('0xc')],'transfereechannel':_0x14ca13[_0x7407('0xd')],'transfereecalleridnum':_0x14ca13[_0x7407('0xe')],'transfereecalleridname':_0x14ca13['transfereecalleridname'],'transfereeconnectedlinenum':_0x14ca13[_0x7407('0xf')],'transfereeconnectedlinename':_0x14ca13[_0x7407('0x10')],'transfereeaccountcode':_0x14ca13[_0x7407('0x11')],'transfereecontext':_0x14ca13['transfereecontext'],'transfereeexten':_0x14ca13['transfereeexten'],'transfereelinkedid':_0x14ca13['transfereelinkedid'],'isexternal':_0x14ca13['isexternal'],'context':_0x14ca13[_0x7407('0x12')],'extension':_0x14ca13['extension'],'type':_0x7407('0x13')},'log':_0x7407('0x4')});};exports['attendedTransfer']=function(_0xc4c7c4){return client[_0x7407('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0xc4c7c4[_0x7407('0x5')],'transfererchannel':_0xc4c7c4[_0x7407('0x14')],'transferercalleridnum':_0xc4c7c4[_0x7407('0x15')],'transferercalleridname':_0xc4c7c4[_0x7407('0x16')],'transfererconnectedlinenum':_0xc4c7c4[_0x7407('0x17')],'transfererconnectedlinename':_0xc4c7c4['secondtransfererconnectedlinename'],'transfereraccountcode':_0xc4c7c4['origtransfereraccountcode'],'transferercontext':_0xc4c7c4[_0x7407('0x18')],'transfererexten':_0xc4c7c4[_0x7407('0x19')],'transfererlinkedid':_0xc4c7c4[_0x7407('0x1a')],'transfereechannel':_0xc4c7c4[_0x7407('0x1b')],'transfereecalleridnum':_0xc4c7c4['transfertargetcalleridnum'],'transfereecalleridname':_0xc4c7c4[_0x7407('0x1c')],'transfereeconnectedlinenum':_0xc4c7c4[_0x7407('0x1d')],'transfereeconnectedlinename':_0xc4c7c4[_0x7407('0x1e')],'transfereeaccountcode':_0xc4c7c4['transfertargetaccountcode'],'transfereecontext':_0xc4c7c4[_0x7407('0x1f')],'transfereeexten':_0xc4c7c4[_0x7407('0x20')],'transfereelinkedid':_0xc4c7c4[_0x7407('0x21')],'isexternal':_0xc4c7c4['isexternal'],'context':_0xc4c7c4[_0x7407('0x22')],'extension':_0xc4c7c4[_0x7407('0x23')],'type':_0x7407('0x24')},'log':_0x7407('0x4')});};
\ No newline at end of file
+var _0x3955=['transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridname','transfererconnectedlinenum','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum'];(function(_0x505315,_0x8b9fef){var _0x349f64=function(_0x41dd8f){while(--_0x41dd8f){_0x505315['push'](_0x505315['shift']());}};_0x349f64(++_0x8b9fef);}(_0x3955,0xfd));var _0x5395=function(_0x328cd6,_0xdd3dd6){_0x328cd6=_0x328cd6-0x0;var _0x993bb3=_0x3955[_0x328cd6];return _0x993bb3;};'use strict';var client=require('../client');exports[_0x5395('0x0')]={};exports[_0x5395('0x1')]=function(_0x46f1b2){return client[_0x5395('0x2')](_0x5395('0x3'),{'body':{'result':_0x46f1b2[_0x5395('0x4')],'transfererchannel':_0x46f1b2[_0x5395('0x5')],'transferercalleridnum':_0x46f1b2['transferercalleridnum'],'transferercalleridname':_0x46f1b2[_0x5395('0x6')],'transfererconnectedlinenum':_0x46f1b2[_0x5395('0x7')],'transfererconnectedlinename':_0x46f1b2['transfererconnectedlinename'],'transfereraccountcode':_0x46f1b2['transfereraccountcode'],'transferercontext':_0x46f1b2[_0x5395('0x8')],'transfererexten':_0x46f1b2[_0x5395('0x9')],'transfererlinkedid':_0x46f1b2[_0x5395('0xa')],'transfereechannel':_0x46f1b2[_0x5395('0xb')],'transfereecalleridnum':_0x46f1b2[_0x5395('0xc')],'transfereecalleridname':_0x46f1b2['transfereecalleridname'],'transfereeconnectedlinenum':_0x46f1b2['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x46f1b2[_0x5395('0xd')],'transfereeaccountcode':_0x46f1b2[_0x5395('0xe')],'transfereecontext':_0x46f1b2[_0x5395('0xf')],'transfereeexten':_0x46f1b2[_0x5395('0x10')],'transfereelinkedid':_0x46f1b2[_0x5395('0x11')],'isexternal':_0x46f1b2[_0x5395('0x12')],'context':_0x46f1b2[_0x5395('0x13')],'extension':_0x46f1b2[_0x5395('0x14')],'type':_0x5395('0x15')},'log':_0x5395('0x3')});};exports[_0x5395('0x16')]=function(_0xdafe48){return client[_0x5395('0x2')](_0x5395('0x3'),{'body':{'result':_0xdafe48['result'],'transfererchannel':_0xdafe48[_0x5395('0x17')],'transferercalleridnum':_0xdafe48['origtransferercalleridnum'],'transferercalleridname':_0xdafe48[_0x5395('0x18')],'transfererconnectedlinenum':_0xdafe48['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0xdafe48[_0x5395('0x19')],'transfereraccountcode':_0xdafe48[_0x5395('0x1a')],'transferercontext':_0xdafe48['secondtransferercontext'],'transfererexten':_0xdafe48[_0x5395('0x1b')],'transfererlinkedid':_0xdafe48[_0x5395('0x1c')],'transfereechannel':_0xdafe48[_0x5395('0x1d')],'transfereecalleridnum':_0xdafe48[_0x5395('0x1e')],'transfereecalleridname':_0xdafe48['transfertargetcalleridname'],'transfereeconnectedlinenum':_0xdafe48[_0x5395('0x1f')],'transfereeconnectedlinename':_0xdafe48[_0x5395('0x20')],'transfereeaccountcode':_0xdafe48['transfertargetaccountcode'],'transfereecontext':_0xdafe48[_0x5395('0x21')],'transfereeexten':_0xdafe48[_0x5395('0x22')],'transfereelinkedid':_0xdafe48[_0x5395('0x23')],'isexternal':_0xdafe48[_0x5395('0x12')],'context':_0xdafe48[_0x5395('0x24')],'extension':_0xdafe48[_0x5395('0x25')],'type':'attended'},'log':_0x5395('0x3')});};
\ No newline at end of file
index 5521929..f8d6669 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd9fb=['sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','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','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','omit','values','channels','length','map','find','uniqueid','channel','format','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','push','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','voicechannel','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','http','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../ami','listen','%s/%s','SIP','name','timers','timer','updateStatusRealtime','QueuePause','error','asterisk','username','join','pick','keys','module','action','Reload','Action','message','isConnected','ami\x20disconnected','command','Command','then','content','catch','voiceQueues','strategy','loggedIn','pTalking','sumBillable'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xd9fb,0x189));var _0xbd9f=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xd9fb[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0xbd9f('0x0'));var util=require(_0xbd9f('0x1'));var jayson=require(_0xbd9f('0x2'));var schema=require(_0xbd9f('0x3'));var BPromise=require(_0xbd9f('0x4'));var moment=require(_0xbd9f('0x5'));var config=require(_0xbd9f('0x6'));var properties=require('../properties');var ami=require(_0xbd9f('0x7'));exports[_0xbd9f('0x8')]=function(_0x4ce2e2,_0x469446,_0x5b6052){return new BPromise(function(_0x2e7eea,_0x43a5a2){var _0x5e2143={'QueuePause':function(_0x30f0ae){return new Promise(function(_0x16f086,_0x3dbc8e){var _0x2196a6=util['format'](_0xbd9f('0x9'),_0xbd9f('0xa'),_0x30f0ae[_0xbd9f('0xb')]);if(_0x4ce2e2[_0xbd9f('0xc')]&&_0x4ce2e2[_0xbd9f('0xc')][_0x2196a6]&&_0x4ce2e2[_0xbd9f('0xc')][_0x2196a6][_0xbd9f('0xd')]){_0x4ce2e2['timers'][_0x2196a6]['updateAcw']();}if(_0x4ce2e2['agents'][_0x2196a6]){_0x4ce2e2['agents'][_0x2196a6][_0xbd9f('0xe')]({'statePause':_0x30f0ae['pause']?!![]:![]});}_0x16f086({'code':0xc8,'message':_0xbd9f('0xf')});});},'Reload':function(_0x44672c){var _0x3030f5=this;return new Promise(function(_0x530513,_0x1430fc){if(ami['isConnected']()==![]){return _0x1430fc(_0x3030f5[_0xbd9f('0x10')](0x1f4,[config[_0xbd9f('0x11')]['ip'],config[_0xbd9f('0x11')][_0xbd9f('0x12')],'ami\x20disconnected'][_0xbd9f('0x13')]('\x20')));}_0x44672c=_[_0xbd9f('0x14')](_0x44672c,_[_0xbd9f('0x15')](properties[_0xbd9f('0x16')]));_0x44672c[_0xbd9f('0x17')]=_0xbd9f('0x18');return ami[_0xbd9f('0x19')](_0x44672c)['then'](function(_0x49a818){_0x530513({'code':0xc8,'message':_0x49a818[_0xbd9f('0x1a')]});})['catch'](function(_0x2f52dd){_0x1430fc(_0x3030f5[_0xbd9f('0x10')](0x1f5,_0x2f52dd[_0xbd9f('0x1a')]));});});},'Command':function(_0x1a42a0){var _0x2c276b=this;return new Promise(function(_0x381f68,_0x3f6c17){if(ami[_0xbd9f('0x1b')]()==![]){return _0x3f6c17(_0x2c276b['error'](0x1f4,[config[_0xbd9f('0x11')]['ip'],config[_0xbd9f('0x11')][_0xbd9f('0x12')],_0xbd9f('0x1c')][_0xbd9f('0x13')]('\x20')));}_0x1a42a0=_[_0xbd9f('0x14')](_0x1a42a0,_0xbd9f('0x1d'));_0x1a42a0[_0xbd9f('0x17')]=_0xbd9f('0x1e');return ami[_0xbd9f('0x19')](_0x1a42a0)[_0xbd9f('0x1f')](function(_0x4e929d){_0x381f68({'code':0xc8,'message':_0x4e929d[_0xbd9f('0x20')]});})[_0xbd9f('0x21')](function(_0x256aec){_0x3f6c17(_0x2c276b[_0xbd9f('0x10')](0x1f5,_0x256aec['message']));});});},'VoiceQueues':function(_0x3e0ba5){return new Promise(function(_0x2eca22,_0x278a10){var _0x36f503=[];for(var _0x46fcc0 in _0x4ce2e2[_0xbd9f('0x22')]){if(_0x4ce2e2[_0xbd9f('0x22')]['hasOwnProperty'](_0x46fcc0)){var _0xd89fc2=_0x4ce2e2[_0xbd9f('0x22')][_0x46fcc0];var _0xa46ce3={'id':_0xd89fc2['id'],'name':_0xd89fc2[_0xbd9f('0xb')],'strategy':_0xd89fc2[_0xbd9f('0x23')],'answered':_0xd89fc2['answered'],'available':_0xd89fc2['available'],'loggedIn':_0xd89fc2[_0xbd9f('0x24')],'pTalking':_0xd89fc2[_0xbd9f('0x25')],'sumBillable':_0xd89fc2[_0xbd9f('0x26')],'sumDuration':_0xd89fc2['sumDuration'],'sumHoldTime':_0xd89fc2[_0xbd9f('0x27')]||0x0,'talking':_0xd89fc2[_0xbd9f('0x28')],'total':_0xd89fc2[_0xbd9f('0x29')],'type':_0xd89fc2['type'],'unmanaged':_0xd89fc2[_0xbd9f('0x2a')],'abandoned':_0xd89fc2[_0xbd9f('0x2b')],'waiting':_0xd89fc2[_0xbd9f('0x2c')],'loggedInDb':_0xd89fc2[_0xbd9f('0x2d')]};if(_0xd89fc2[_0xbd9f('0x2e')]===_0xbd9f('0x2f')){_0xa46ce3[_0xbd9f('0x30')]=_0xd89fc2['dialActive'];_0xa46ce3['dialMethod']=_0xd89fc2[_0xbd9f('0x31')];_0xa46ce3[_0xbd9f('0x32')]=_0xd89fc2[_0xbd9f('0x32')];_0xa46ce3[_0xbd9f('0x33')]=_0xd89fc2[_0xbd9f('0x33')];_0xa46ce3[_0xbd9f('0x34')]=_0xd89fc2[_0xbd9f('0x34')];_0xa46ce3[_0xbd9f('0x35')]=_0xd89fc2[_0xbd9f('0x35')];_0xa46ce3['temp']=_0xd89fc2['temp'];_0xa46ce3[_0xbd9f('0x36')]=_0xd89fc2['outboundAnswerAgiCallsDay'];_0xa46ce3['outboundAnswerCallsDay']=_0xd89fc2[_0xbd9f('0x37')];_0xa46ce3[_0xbd9f('0x38')]=_0xd89fc2[_0xbd9f('0x38')];_0xa46ce3[_0xbd9f('0x39')]=_0xd89fc2[_0xbd9f('0x39')];_0xa46ce3[_0xbd9f('0x3a')]=_0xd89fc2[_0xbd9f('0x3a')];_0xa46ce3[_0xbd9f('0x3b')]=_0xd89fc2['outboundDropCallsDayACS'];_0xa46ce3[_0xbd9f('0x3c')]=_0xd89fc2[_0xbd9f('0x3c')];_0xa46ce3[_0xbd9f('0x3d')]=_0xd89fc2['outboundDropCallsDayTimeout'];_0xa46ce3['outboundNoAnswerCallsDay']=_0xd89fc2[_0xbd9f('0x3e')];_0xa46ce3[_0xbd9f('0x3f')]=_0xd89fc2['outboundNoSuchCallsDay'];_0xa46ce3[_0xbd9f('0x40')]=_0xd89fc2['outboundOriginateFailureCallsDay'];_0xa46ce3[_0xbd9f('0x41')]=_0xd89fc2[_0xbd9f('0x41')];_0xa46ce3[_0xbd9f('0x42')]=_0xd89fc2[_0xbd9f('0x42')];_0xa46ce3[_0xbd9f('0x43')]=_0xd89fc2['outboundUnknownCallsDay'];_0xa46ce3[_0xbd9f('0x44')]=_0xd89fc2[_0xbd9f('0x44')];_0xa46ce3['predictiveIntervalAvgHoldtime']=_0xd89fc2[_0xbd9f('0x45')];_0xa46ce3[_0xbd9f('0x46')]=_0xd89fc2[_0xbd9f('0x46')];_0xa46ce3[_0xbd9f('0x47')]=_0xd89fc2['predictiveIntervalDroppedCallsCallersExit'];_0xa46ce3[_0xbd9f('0x48')]=_0xd89fc2[_0xbd9f('0x48')];_0xa46ce3[_0xbd9f('0x49')]=_0xd89fc2[_0xbd9f('0x49')];_0xa46ce3['predictiveIntervalErlangCallsDroppedCalls']=_0xd89fc2[_0xbd9f('0x4a')];_0xa46ce3[_0xbd9f('0x4b')]=_0xd89fc2[_0xbd9f('0x4b')];_0xa46ce3[_0xbd9f('0x4c')]=_0xd89fc2['predictiveIntervalMultiplicativeFactor'];_0xa46ce3['predictiveIntervalPauses']=_0xd89fc2[_0xbd9f('0x4d')];_0xa46ce3[_0xbd9f('0x4e')]=_0xd89fc2['predictiveIntervalAvailable'];_0xa46ce3[_0xbd9f('0x4f')]=_0xd89fc2['predictiveIntervalTotalCalls'];_0xa46ce3[_0xbd9f('0x1a')]=_0xd89fc2['message'];_0xa46ce3[_0xbd9f('0x50')]=_0xd89fc2[_0xbd9f('0x50')];_0xa46ce3['erlangCalls']=_0xd89fc2['erlangCalls'];_0xa46ce3['erlangCallToSecond']=_0xd89fc2[_0xbd9f('0x51')];_0xa46ce3[_0xbd9f('0x52')]=_0xd89fc2['erlangAbandonmentRate'];_0xa46ce3['erlangBusyFactor']=_0xd89fc2[_0xbd9f('0x53')];_0xa46ce3[_0xbd9f('0x54')]=_0xd89fc2[_0xbd9f('0x54')];_0xa46ce3[_0xbd9f('0x55')]=_0xd89fc2['startProgressive'];}if(_0xd89fc2[_0xbd9f('0x56')]){_0xa46ce3[_0xbd9f('0x56')]={'id':_0xd89fc2[_0xbd9f('0x56')]['id'],'name':_0xd89fc2[_0xbd9f('0x56')][_0xbd9f('0xb')],'active':_0xd89fc2['Trunk'][_0xbd9f('0x57')],'callerid':_0xd89fc2[_0xbd9f('0x56')][_0xbd9f('0x58')]};}if(_0xd89fc2[_0xbd9f('0x59')]){_0xa46ce3['Interval']={'id':_0xd89fc2[_0xbd9f('0x59')]['id'],'name':_0xd89fc2[_0xbd9f('0x59')][_0xbd9f('0xb')]};}_0x36f503['push'](_0xa46ce3);}}_0x2eca22({'count':_0x36f503['length'],'rows':_0x36f503});});},'UpdateVoiceQueue':function(_0xba219a){return new Promise(function(_0x387a7c,_0xd5d97b){var _0x175601=_['find'](_0x4ce2e2[_0xbd9f('0x22')],{'id':parseInt(_0xba219a['id'])});var _0x174125=_[_0xbd9f('0x5a')](_0xba219a,['id']);if(_0x175601){for(var _0x254075 in _0x174125){if(typeof _0x174125[_0x254075]!=='undefined'&&typeof _0x175601[_0x254075]!=='undefined'){_0x175601[_0x254075]=_0x174125[_0x254075];}}_0x387a7c(_0x175601);}else{_0xd5d97b();}});},'VoiceChannels':function(_0x525ca3){return new Promise(function(_0x23f7b2,_0x11e5d3){var _0x585065=_[_0xbd9f('0x5b')](_0x4ce2e2[_0xbd9f('0x5c')]);_0x23f7b2({'count':_0x585065[_0xbd9f('0x5d')],'rows':_0x585065});});},'VoiceChannelMixMonitor':function(_0x45bf27){var _0x141eaf=this;return new Promise(function(_0xbeca49,_0x157177){if(ami[_0xbd9f('0x1b')]()==![]){return _0x157177(_0x141eaf[_0xbd9f('0x10')](0x1f4,[config[_0xbd9f('0x11')]['ip'],config[_0xbd9f('0x11')][_0xbd9f('0x12')],_0xbd9f('0x1c')][_0xbd9f('0x13')]('\x20')));}var _0x31d6dc=schema(properties['voicechannel'])[_0xbd9f('0x3')](_0x45bf27);if(_0x31d6dc['length']>0x0){return _0x157177(_0x141eaf[_0xbd9f('0x10')](0x1f4,_[_0xbd9f('0x5e')](_0x31d6dc,'message')['join'](',\x20')));}var _0x3334c6=_[_0xbd9f('0x5f')](_0x4ce2e2[_0xbd9f('0x5c')],{'uniqueid':_0x45bf27[_0xbd9f('0x60')]});if(_0x3334c6&&_0x3334c6[_0xbd9f('0x61')]){var _0x786cdf=util[_0xbd9f('0x62')](_0xbd9f('0x63'),_0x45bf27[_0xbd9f('0x64')]||_0x45bf27[_0xbd9f('0x60')],_0x45bf27['format']||_0xbd9f('0x65'));return ami['Action']({'action':_0xbd9f('0x66'),'channel':_0x3334c6[_0xbd9f('0x61')],'file':_0x786cdf,'options':_0xbd9f('0x67')})[_0xbd9f('0x1f')](function(_0x1b9ca7){var _0x58fe5f=_[_0xbd9f('0x5f')](_0x3334c6[_0xbd9f('0x68')],{'filename':_0xbd9f('0x69')+_0x786cdf[_0xbd9f('0x6a')]()});if(_[_0xbd9f('0x6b')](_0x58fe5f)){_0x3334c6[_0xbd9f('0x68')][_0xbd9f('0x6c')]({'filename':_0xbd9f('0x69')+_0x786cdf[_0xbd9f('0x6a')](),'createdAt':moment()[_0xbd9f('0x62')](_0xbd9f('0x6d')),'mixmonitorid':_0x1b9ca7[_0xbd9f('0x6e')],'status':_0xbd9f('0x6f')});}else{_0x58fe5f[_0xbd9f('0x6e')]=_0x1b9ca7[_0xbd9f('0x6e')];_0x58fe5f[_0xbd9f('0x70')]=_0xbd9f('0x6f');}_0xbeca49({'code':0xc8,'message':[_0x45bf27[_0xbd9f('0x60')],_0xbd9f('0x71'),_0x1b9ca7[_0xbd9f('0x6e')]]['join']('\x20'),'mixmonitorid':_0x1b9ca7['mixmonitorid']});})[_0xbd9f('0x21')](function(_0x7d17f3){_0x157177(_0x141eaf[_0xbd9f('0x10')](0x1f5,[_0x45bf27['uniqueid'],_0x7d17f3['message'][_0xbd9f('0x6a')]()][_0xbd9f('0x13')]('\x20')));});}else{return _0x157177(_0x141eaf[_0xbd9f('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x36806a){var _0x23c56c=this;return new Promise(function(_0x55341e,_0xecee10){if(ami['isConnected']()==![]){return _0xecee10(_0x23c56c[_0xbd9f('0x10')](0x1f4,[config[_0xbd9f('0x11')]['ip'],config[_0xbd9f('0x11')][_0xbd9f('0x12')],_0xbd9f('0x1c')][_0xbd9f('0x13')]('\x20')));}var _0x29e082=schema(properties[_0xbd9f('0x72')])[_0xbd9f('0x3')](_0x36806a);if(_0x29e082[_0xbd9f('0x5d')]>0x0){return _0xecee10(_0x23c56c[_0xbd9f('0x10')](0x1f4,_[_0xbd9f('0x5e')](_0x29e082,'message')['join'](',\x20')));}var _0x59423b=_[_0xbd9f('0x5f')](_0x4ce2e2[_0xbd9f('0x5c')],{'uniqueid':_0x36806a[_0xbd9f('0x60')]});if(_0x59423b){return BPromise[_0xbd9f('0x73')]()[_0xbd9f('0x1f')](function(){if(_0x59423b[_0xbd9f('0x61')]){return ami[_0xbd9f('0x19')]({'action':_0xbd9f('0x74'),'channel':_0x59423b['channel'],'mixmonitorid':_0x36806a[_0xbd9f('0x6e')]})[_0xbd9f('0x21')](function(_0x552ada){});}})[_0xbd9f('0x1f')](function(){if(_0x59423b[_0xbd9f('0x75')]){return ami[_0xbd9f('0x19')]({'action':'StopMixMonitor','channel':_0x59423b['destinationchannel'],'mixmonitorid':_0x36806a[_0xbd9f('0x6e')]})[_0xbd9f('0x21')](function(_0x2cb9d9){});}})[_0xbd9f('0x1f')](function(_0x2db02a){var _0x1725f1=_[_0xbd9f('0x5f')](_0x59423b[_0xbd9f('0x68')],{'mixmonitorid':_0x36806a[_0xbd9f('0x6e')]});if(_0x1725f1){_0x1725f1['status']=_0xbd9f('0x76');}})[_0xbd9f('0x1f')](function(){var _0x27f25d=util[_0xbd9f('0x62')](_0xbd9f('0x63'),_0x36806a[_0xbd9f('0x64')]||_0x36806a[_0xbd9f('0x60')],_0x36806a[_0xbd9f('0x62')]||_0xbd9f('0x65'));var _0x42b6af=_[_0xbd9f('0x5f')](_0x59423b['monitors'],{'filename':_0xbd9f('0x69')+_0x27f25d[_0xbd9f('0x6a')]()});if(_0x42b6af){_0x42b6af[_0xbd9f('0x70')]=_0xbd9f('0x76');}})[_0xbd9f('0x1f')](function(){_0x55341e({'code':0xc8,'message':[_0x36806a[_0xbd9f('0x60')],_0xbd9f('0x77')][_0xbd9f('0x13')]('\x20')});})[_0xbd9f('0x21')](function(_0x5add9c){_0xecee10(_0x23c56c[_0xbd9f('0x10')](0x1f5,[_0x36806a[_0xbd9f('0x60')],_0x5add9c['message'][_0xbd9f('0x6a')]()]['join']('\x20')));});}else{return _0xecee10(_0x23c56c[_0xbd9f('0x10')](0x1f5,_0xbd9f('0x78')));}});},'VoiceQueuesChannels':function(_0x197b9d){return new Promise(function(_0x5162bf,_0x599a3a){var _0x48f037=_[_0xbd9f('0x5b')](_0x4ce2e2[_0xbd9f('0x79')]);_0x5162bf({'count':_0x48f037[_0xbd9f('0x5d')],'rows':_0x48f037});});},'VoiceQueuesChannel':function(_0x1600f9){var _0x35d96f=this;return new Promise(function(_0x5e1db0,_0x236a33){var _0x3f14e3=schema(properties['voicequeuechannel'])[_0xbd9f('0x3')](_0x1600f9);if(_0x3f14e3[_0xbd9f('0x5d')]>0x0){return _0x236a33(_0x35d96f[_0xbd9f('0x10')](0x1f4,_[_0xbd9f('0x5e')](_0x3f14e3,'message')[_0xbd9f('0x13')](',\x20')));}var _0x2f55c6=_['find'](_0x4ce2e2[_0xbd9f('0x79')],{'uniqueid':_0x1600f9['uniqueid']});if(_0x2f55c6){_0x5e1db0(_0x2f55c6);}else{return _0x236a33(_0x35d96f['error'](0x1f5,_0xbd9f('0x78')));}});},'VoiceQueuesChannelHangup':function(_0x444792){var _0x164569=this;return new Promise(function(_0x54cec3,_0x2914ce){if(ami[_0xbd9f('0x1b')]()==![]){return _0x2914ce(_0x164569['error'](0x1f4,[config[_0xbd9f('0x11')]['ip'],config['asterisk']['username'],'ami\x20disconnected']['join']('\x20')));}var _0x39062c=schema(properties[_0xbd9f('0x7a')])['validate'](_0x444792);if(_0x39062c[_0xbd9f('0x5d')]>0x0){return _0x2914ce(_0x164569['error'](0x1f4,_['map'](_0x39062c,'message')[_0xbd9f('0x13')](',\x20')));}var _0x3a3586=_[_0xbd9f('0x5f')](_0x4ce2e2[_0xbd9f('0x79')],{'uniqueid':_0x444792[_0xbd9f('0x60')]});if(_0x3a3586&&_0x3a3586[_0xbd9f('0x61')]){return ami[_0xbd9f('0x19')]({'action':_0xbd9f('0x7b'),'channel':_0x3a3586[_0xbd9f('0x61')]})[_0xbd9f('0x1f')](function(_0x45755a){_0x54cec3({'code':0xc8,'message':[_0x444792[_0xbd9f('0x60')],_0x45755a['message'][_0xbd9f('0x6a')]()]['join']('\x20')});})[_0xbd9f('0x21')](function(_0x34f158){_0x2914ce(_0x164569[_0xbd9f('0x10')](0x1f5,[_0x444792[_0xbd9f('0x60')],_0x34f158['message'][_0xbd9f('0x6a')]()][_0xbd9f('0x13')]('\x20')));});}else{return _0x2914ce(_0x164569['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x25ecb1){var _0x10a6bc=this;return new Promise(function(_0x1b5f8c,_0x25d8a8){if(ami[_0xbd9f('0x1b')]()==![]){return _0x25d8a8(_0x10a6bc[_0xbd9f('0x10')](0x1f4,[config[_0xbd9f('0x11')]['ip'],config[_0xbd9f('0x11')]['username'],_0xbd9f('0x1c')]['join']('\x20')));}var _0x4edcd4=schema(properties[_0xbd9f('0x7c')])[_0xbd9f('0x3')](_0x25ecb1);if(_0x4edcd4['length']>0x0){return _0x25d8a8(_0x10a6bc['error'](0x1f4,_['map'](_0x4edcd4,_0xbd9f('0x1a'))[_0xbd9f('0x13')](',\x20')));}var _0x4b7920=_[_0xbd9f('0x5f')](_0x4ce2e2['queueChannels'],{'uniqueid':_0x25ecb1[_0xbd9f('0x60')]});if(_0x4b7920&&_0x4b7920[_0xbd9f('0x61')]){return ami[_0xbd9f('0x19')]({'action':_0xbd9f('0x7d'),'channel':_0x4b7920['channel'],'exten':_0x25ecb1[_0xbd9f('0x7e')],'context':_0x25ecb1['context']||_0x4b7920[_0xbd9f('0x7f')],'priority':0x1})[_0xbd9f('0x1f')](function(_0x1cb0b1){_0x1b5f8c({'code':0xc8,'message':[_0x25ecb1[_0xbd9f('0x60')],_0x1cb0b1[_0xbd9f('0x1a')][_0xbd9f('0x6a')]()]['join']('\x20')});})[_0xbd9f('0x21')](function(_0x3fb0d6){_0x25d8a8(_0x10a6bc['error'](0x1f5,[_0x25ecb1[_0xbd9f('0x60')],_0x3fb0d6[_0xbd9f('0x1a')][_0xbd9f('0x6a')]()][_0xbd9f('0x13')]('\x20')));});}else{return _0x25d8a8(_0x10a6bc['error'](0x1f5,_0xbd9f('0x78')));}});},'Agents':function(_0x21db4e){return new Promise(function(_0x527595,_0x3626ce){var _0x4a130d=_[_0xbd9f('0x5b')](_0x4ce2e2['agents']);_0x527595({'count':_0x4a130d[_0xbd9f('0x5d')],'rows':_0x4a130d});});},'Telephones':function(_0x423a2d){return new Promise(function(_0xcfb788,_0x4f3679){var _0x2808cd=_['values'](_0x4ce2e2[_0xbd9f('0x80')]);_0xcfb788({'count':_0x2808cd[_0xbd9f('0x5d')],'rows':_0x2808cd});});},'Trunks':function(_0x115639){return new Promise(function(_0x1b8f4f,_0x4b3e44){var _0x3063a0=_[_0xbd9f('0x5b')](_0x4ce2e2[_0xbd9f('0x81')]);_0x1b8f4f({'count':_0x3063a0[_0xbd9f('0x5d')],'rows':_0x3063a0});});},'OutboundChannels':function(_0x1c8b01){return new Promise(function(_0x210873,_0x20faf6){var _0x58b49c=_['values'](_0x4ce2e2[_0xbd9f('0x82')]);_0x210873({'count':_0x58b49c[_0xbd9f('0x5d')],'rows':_0x58b49c});});},'Outbound':function(_0x551b08){return new Promise(function(_0x156740,_0x4e4bd9){_0x156740(_0x4ce2e2[_0xbd9f('0x2f')]);});},'Campaigns':function(_0x274221){return new Promise(function(_0x3fb6fe,_0x3e8881){var _0x376314=_[_0xbd9f('0x5b')](_0x4ce2e2[_0xbd9f('0x83')]);_0x3fb6fe({'count':_0x376314[_0xbd9f('0x5d')],'rows':_0x376314});});},'VoiceQueuesPreview':function(_0x1aa387){var _0x5447b1=this;return new Promise(function(_0x56976c,_0x23eff7){_0x469446[_0xbd9f('0x84')](_0x1aa387['id'])['then'](function(_0x5dc5a2){_0x56976c({'code':0xc8,'message':_0x5dc5a2[_0xbd9f('0x1a')]});})[_0xbd9f('0x21')](function(_0x346b86){_0x23eff7(_0x5447b1[_0xbd9f('0x10')](0x1f4,_0x346b86[_0xbd9f('0x1a')]));});});},'EventManager':function(_0x3a564b){var _0x14f9f0=this;return new Promise(function(_0x571c68,_0x3d9322){if(!_0x3a564b[_0xbd9f('0x85')]){return _0x3d9322(_0x14f9f0['error'](0x1f4,_0xbd9f('0x86')));}ami[_0xbd9f('0x87')](_0xbd9f('0x88')+_0x3a564b[_0xbd9f('0x85')],_0x3a564b[_0xbd9f('0x1a')]);_0x571c68({'code':0xc8,'message':_0x3a564b});});},'FaxAccounts':function(_0x43d375){return new Promise(function(_0x538984,_0x4a3db3){var _0x22f7ad=_[_0xbd9f('0x5b')](_0x4ce2e2[_0xbd9f('0x89')]);_0x538984({'count':_0x22f7ad['length'],'rows':_0x22f7ad});});},'SendFax':function(_0x35c2a1){var _0x55b4e5=this;return new Promise(function(_0x5bc569,_0x5a3bce){_0x5b6052[_0xbd9f('0x8a')](_0x35c2a1)[_0xbd9f('0x1f')](function(_0x3826f3){_0x5bc569({'code':0xc8,'message':_0x3826f3[_0xbd9f('0x1a')]});})['catch'](function(_0x49dc1e){_0x5a3bce(_0x55b4e5[_0xbd9f('0x10')](0x1f4,_0x49dc1e[_0xbd9f('0x1a')]));});});},'CheckAfterSend':function(_0x3061d1){var _0x24c576=this;return new Promise(function(_0x6bd70f,_0x5d7e50){_0x5b6052[_0xbd9f('0x8b')](_0x3061d1)[_0xbd9f('0x1f')](function(_0x3fa6cc){_0x6bd70f({'code':0xc8,'message':_0x3fa6cc['message']});})[_0xbd9f('0x21')](function(_0x1dafa4){_0x5d7e50(_0x24c576[_0xbd9f('0x10')](0x1f4,_0x1dafa4[_0xbd9f('0x1a')]));});});}};var _0x5aa1f4=jayson['server'](_0x5e2143)[_0xbd9f('0x8c')]();_0x5aa1f4['on'](_0xbd9f('0x10'),function(_0x3f7729){return _0x43a5a2(_0x3f7729);});_0x5aa1f4[_0xbd9f('0x8')](0x232a,'127.0.0.1',function(){console[_0xbd9f('0x8d')](_0xbd9f('0x8e'),0x232a);return _0x2e7eea(_0xbd9f('0x8f')+0x232a);});});};
\ No newline at end of file
+var _0x236d=['QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','message','command','Command','Action','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','Trunk','callerid','Interval','push','omit','undefined','values','channels','length','voicechannel','map','find','%s.%s','filename','wav','MixMonitor','channel','ai(mixmonitorid)','then','monitors','toLowerCase','isNil','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','uniqueid','MixMonitor\x20Success','catch','StopMixMonitor','destinationchannel','status','stop','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','context','telephones','outboundChannels','campaigns','Event\x20name\x20mandatory','emit','custom:','faxAccounts','checkAfterSend','server','http','listen','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','validate','moment','../../../config/environment','../properties','../ami','format','%s/%s','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause'];(function(_0x2744df,_0xcd7a2e){var _0x24b140=function(_0x834226){while(--_0x834226){_0x2744df['push'](_0x2744df['shift']());}};_0x24b140(++_0xcd7a2e);}(_0x236d,0x7e));var _0xd236=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x236d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd236('0x0'));var util=require(_0xd236('0x1'));var jayson=require('jayson/promise');var schema=require(_0xd236('0x2'));var BPromise=require('bluebird');var moment=require(_0xd236('0x3'));var config=require(_0xd236('0x4'));var properties=require(_0xd236('0x5'));var ami=require(_0xd236('0x6'));exports['listen']=function(_0x56bc88,_0x234912,_0x29a67c){return new BPromise(function(_0x75d84c,_0x1aedc6){var _0x58c59e={'QueuePause':function(_0x54ac9c){return new Promise(function(_0x2d9025,_0x18d969){var _0x4e0460=util[_0xd236('0x7')](_0xd236('0x8'),'SIP',_0x54ac9c[_0xd236('0x9')]);if(_0x56bc88[_0xd236('0xa')]&&_0x56bc88[_0xd236('0xa')][_0x4e0460]&&_0x56bc88['timers'][_0x4e0460][_0xd236('0xb')]){_0x56bc88[_0xd236('0xa')][_0x4e0460][_0xd236('0xc')]();}if(_0x56bc88['agents'][_0x4e0460]){_0x56bc88[_0xd236('0xd')][_0x4e0460][_0xd236('0xe')]({'statePause':_0x54ac9c[_0xd236('0xf')]?!![]:![]});}_0x2d9025({'code':0xc8,'message':_0xd236('0x10')});});},'Reload':function(_0x21f27b){var _0x224469=this;return new Promise(function(_0x206b35,_0x974c47){if(ami[_0xd236('0x11')]()==![]){return _0x974c47(_0x224469[_0xd236('0x12')](0x1f4,[config[_0xd236('0x13')]['ip'],config[_0xd236('0x13')][_0xd236('0x14')],_0xd236('0x15')][_0xd236('0x16')]('\x20')));}_0x21f27b=_[_0xd236('0x17')](_0x21f27b,_[_0xd236('0x18')](properties[_0xd236('0x19')]));_0x21f27b[_0xd236('0x1a')]=_0xd236('0x1b');return ami['Action'](_0x21f27b)['then'](function(_0x216a25){_0x206b35({'code':0xc8,'message':_0x216a25[_0xd236('0x1c')]});})['catch'](function(_0x11c6ec){_0x974c47(_0x224469[_0xd236('0x12')](0x1f5,_0x11c6ec[_0xd236('0x1c')]));});});},'Command':function(_0x595fd4){var _0x355b65=this;return new Promise(function(_0x1b6aaa,_0x31f0bb){if(ami['isConnected']()==![]){return _0x31f0bb(_0x355b65[_0xd236('0x12')](0x1f4,[config[_0xd236('0x13')]['ip'],config[_0xd236('0x13')][_0xd236('0x14')],_0xd236('0x15')]['join']('\x20')));}_0x595fd4=_[_0xd236('0x17')](_0x595fd4,_0xd236('0x1d'));_0x595fd4[_0xd236('0x1a')]=_0xd236('0x1e');return ami[_0xd236('0x1f')](_0x595fd4)['then'](function(_0x4a35d0){_0x1b6aaa({'code':0xc8,'message':_0x4a35d0[_0xd236('0x20')]});})['catch'](function(_0x22924d){_0x31f0bb(_0x355b65['error'](0x1f5,_0x22924d[_0xd236('0x1c')]));});});},'VoiceQueues':function(_0x2174f5){return new Promise(function(_0x234930,_0x49d822){var _0x41049a=[];for(var _0x339b08 in _0x56bc88[_0xd236('0x21')]){if(_0x56bc88[_0xd236('0x21')][_0xd236('0x22')](_0x339b08)){var _0x17f927=_0x56bc88[_0xd236('0x21')][_0x339b08];var _0x21eeab={'id':_0x17f927['id'],'name':_0x17f927[_0xd236('0x9')],'strategy':_0x17f927[_0xd236('0x23')],'answered':_0x17f927[_0xd236('0x24')],'available':_0x17f927[_0xd236('0x25')],'loggedIn':_0x17f927[_0xd236('0x26')],'pTalking':_0x17f927[_0xd236('0x27')],'sumBillable':_0x17f927[_0xd236('0x28')],'sumDuration':_0x17f927[_0xd236('0x29')],'sumHoldTime':_0x17f927[_0xd236('0x2a')]||0x0,'talking':_0x17f927[_0xd236('0x2b')],'total':_0x17f927[_0xd236('0x2c')],'type':_0x17f927[_0xd236('0x2d')],'unmanaged':_0x17f927[_0xd236('0x2e')],'abandoned':_0x17f927[_0xd236('0x2f')],'waiting':_0x17f927[_0xd236('0x30')],'loggedInDb':_0x17f927[_0xd236('0x31')]};if(_0x17f927[_0xd236('0x2d')]===_0xd236('0x32')){_0x21eeab[_0xd236('0x33')]=_0x17f927[_0xd236('0x33')];_0x21eeab[_0xd236('0x34')]=_0x17f927['dialMethod'];_0x21eeab[_0xd236('0x35')]=_0x17f927['dialOriginateCallerIdName'];_0x21eeab[_0xd236('0x36')]=_0x17f927[_0xd236('0x36')];_0x21eeab[_0xd236('0x37')]=_0x17f927['dialOriginateTimeout'];_0x21eeab[_0xd236('0x38')]=_0x17f927[_0xd236('0x38')];_0x21eeab[_0xd236('0x39')]=_0x17f927[_0xd236('0x39')];_0x21eeab[_0xd236('0x3a')]=_0x17f927[_0xd236('0x3a')];_0x21eeab[_0xd236('0x3b')]=_0x17f927['outboundAnswerCallsDay'];_0x21eeab[_0xd236('0x3c')]=_0x17f927['outboundBlacklistCallsDay'];_0x21eeab[_0xd236('0x3d')]=_0x17f927['outboundBusyCallsDay'];_0x21eeab[_0xd236('0x3e')]=_0x17f927[_0xd236('0x3e')];_0x21eeab[_0xd236('0x3f')]=_0x17f927[_0xd236('0x3f')];_0x21eeab[_0xd236('0x40')]=_0x17f927[_0xd236('0x40')];_0x21eeab[_0xd236('0x41')]=_0x17f927[_0xd236('0x41')];_0x21eeab[_0xd236('0x42')]=_0x17f927[_0xd236('0x42')];_0x21eeab[_0xd236('0x43')]=_0x17f927[_0xd236('0x43')];_0x21eeab[_0xd236('0x44')]=_0x17f927['outboundOriginateFailureCallsDay'];_0x21eeab[_0xd236('0x45')]=_0x17f927[_0xd236('0x45')];_0x21eeab[_0xd236('0x46')]=_0x17f927['outboundRejectCallsDay'];_0x21eeab[_0xd236('0x47')]=_0x17f927[_0xd236('0x47')];_0x21eeab[_0xd236('0x48')]=_0x17f927[_0xd236('0x48')];_0x21eeab[_0xd236('0x49')]=_0x17f927[_0xd236('0x49')];_0x21eeab['predictiveIntervalAvgTalktime']=_0x17f927[_0xd236('0x4a')];_0x21eeab[_0xd236('0x4b')]=_0x17f927[_0xd236('0x4b')];_0x21eeab[_0xd236('0x4c')]=_0x17f927[_0xd236('0x4c')];_0x21eeab[_0xd236('0x4d')]=_0x17f927['predictiveIntervalErlangCalls'];_0x21eeab[_0xd236('0x4e')]=_0x17f927[_0xd236('0x4e')];_0x21eeab[_0xd236('0x4f')]=_0x17f927['predictiveIntervalHitRate'];_0x21eeab[_0xd236('0x50')]=_0x17f927['predictiveIntervalMultiplicativeFactor'];_0x21eeab[_0xd236('0x51')]=_0x17f927['predictiveIntervalPauses'];_0x21eeab['predictiveIntervalAvailable']=_0x17f927[_0xd236('0x52')];_0x21eeab[_0xd236('0x53')]=_0x17f927[_0xd236('0x53')];_0x21eeab[_0xd236('0x1c')]=_0x17f927[_0xd236('0x1c')];_0x21eeab['originated']=_0x17f927['originated'];_0x21eeab[_0xd236('0x54')]=_0x17f927[_0xd236('0x54')];_0x21eeab['erlangCallToSecond']=_0x17f927[_0xd236('0x55')];_0x21eeab[_0xd236('0x56')]=_0x17f927[_0xd236('0x56')];_0x21eeab['erlangBusyFactor']=_0x17f927['erlangBusyFactor'];_0x21eeab['startPredictive']=_0x17f927[_0xd236('0x57')];_0x21eeab['startProgressive']=_0x17f927['startProgressive'];}if(_0x17f927[_0xd236('0x58')]){_0x21eeab[_0xd236('0x58')]={'id':_0x17f927[_0xd236('0x58')]['id'],'name':_0x17f927[_0xd236('0x58')][_0xd236('0x9')],'active':_0x17f927['Trunk']['active'],'callerid':_0x17f927[_0xd236('0x58')][_0xd236('0x59')]};}if(_0x17f927[_0xd236('0x5a')]){_0x21eeab[_0xd236('0x5a')]={'id':_0x17f927[_0xd236('0x5a')]['id'],'name':_0x17f927[_0xd236('0x5a')]['name']};}_0x41049a[_0xd236('0x5b')](_0x21eeab);}}_0x234930({'count':_0x41049a['length'],'rows':_0x41049a});});},'UpdateVoiceQueue':function(_0x2abf6f){return new Promise(function(_0x2b469f,_0x57c0cf){var _0x5efa49=_['find'](_0x56bc88['voiceQueues'],{'id':parseInt(_0x2abf6f['id'])});var _0x43ba74=_[_0xd236('0x5c')](_0x2abf6f,['id']);if(_0x5efa49){for(var _0x33394b in _0x43ba74){if(typeof _0x43ba74[_0x33394b]!==_0xd236('0x5d')&&typeof _0x5efa49[_0x33394b]!==_0xd236('0x5d')){_0x5efa49[_0x33394b]=_0x43ba74[_0x33394b];}}_0x2b469f(_0x5efa49);}else{_0x57c0cf();}});},'VoiceChannels':function(_0x50060b){return new Promise(function(_0x50a4a8,_0x2f3b1f){var _0x7c0650=_[_0xd236('0x5e')](_0x56bc88[_0xd236('0x5f')]);_0x50a4a8({'count':_0x7c0650[_0xd236('0x60')],'rows':_0x7c0650});});},'VoiceChannelMixMonitor':function(_0x10a521){var _0x5eb88c=this;return new Promise(function(_0x2be871,_0x48a1db){if(ami[_0xd236('0x11')]()==![]){return _0x48a1db(_0x5eb88c[_0xd236('0x12')](0x1f4,[config['asterisk']['ip'],config[_0xd236('0x13')][_0xd236('0x14')],'ami\x20disconnected']['join']('\x20')));}var _0x135cfc=schema(properties[_0xd236('0x61')])[_0xd236('0x2')](_0x10a521);if(_0x135cfc[_0xd236('0x60')]>0x0){return _0x48a1db(_0x5eb88c['error'](0x1f4,_[_0xd236('0x62')](_0x135cfc,_0xd236('0x1c'))[_0xd236('0x16')](',\x20')));}var _0x18d606=_[_0xd236('0x63')](_0x56bc88[_0xd236('0x5f')],{'uniqueid':_0x10a521['uniqueid']});if(_0x18d606&&_0x18d606['channel']){var _0x3e0974=util['format'](_0xd236('0x64'),_0x10a521[_0xd236('0x65')]||_0x10a521['uniqueid'],_0x10a521[_0xd236('0x7')]||_0xd236('0x66'));return ami['Action']({'action':_0xd236('0x67'),'channel':_0x18d606[_0xd236('0x68')],'file':_0x3e0974,'options':_0xd236('0x69')})[_0xd236('0x6a')](function(_0x5b9337){var _0x4bb567=_[_0xd236('0x63')](_0x18d606[_0xd236('0x6b')],{'filename':'/var/spool/asterisk/monitor/'+_0x3e0974[_0xd236('0x6c')]()});if(_[_0xd236('0x6d')](_0x4bb567)){_0x18d606[_0xd236('0x6b')][_0xd236('0x5b')]({'filename':_0xd236('0x6e')+_0x3e0974['toLowerCase'](),'createdAt':moment()[_0xd236('0x7')](_0xd236('0x6f')),'mixmonitorid':_0x5b9337[_0xd236('0x70')],'status':'rec'});}else{_0x4bb567[_0xd236('0x70')]=_0x5b9337['mixmonitorid'];_0x4bb567['status']=_0xd236('0x71');}_0x2be871({'code':0xc8,'message':[_0x10a521[_0xd236('0x72')],_0xd236('0x73'),_0x5b9337[_0xd236('0x70')]][_0xd236('0x16')]('\x20'),'mixmonitorid':_0x5b9337[_0xd236('0x70')]});})[_0xd236('0x74')](function(_0x5f518e){_0x48a1db(_0x5eb88c[_0xd236('0x12')](0x1f5,[_0x10a521[_0xd236('0x72')],_0x5f518e[_0xd236('0x1c')][_0xd236('0x6c')]()][_0xd236('0x16')]('\x20')));});}else{return _0x48a1db(_0x5eb88c[_0xd236('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x382ef0){var _0x405514=this;return new Promise(function(_0x1cd1f2,_0x498ec5){if(ami[_0xd236('0x11')]()==![]){return _0x498ec5(_0x405514[_0xd236('0x12')](0x1f4,[config[_0xd236('0x13')]['ip'],config['asterisk'][_0xd236('0x14')],_0xd236('0x15')][_0xd236('0x16')]('\x20')));}var _0x3413b0=schema(properties['voicechannel'])[_0xd236('0x2')](_0x382ef0);if(_0x3413b0['length']>0x0){return _0x498ec5(_0x405514[_0xd236('0x12')](0x1f4,_['map'](_0x3413b0,_0xd236('0x1c'))['join'](',\x20')));}var _0x28cb18=_[_0xd236('0x63')](_0x56bc88['channels'],{'uniqueid':_0x382ef0[_0xd236('0x72')]});if(_0x28cb18){return BPromise['resolve']()[_0xd236('0x6a')](function(){if(_0x28cb18[_0xd236('0x68')]){return ami['Action']({'action':_0xd236('0x75'),'channel':_0x28cb18[_0xd236('0x68')],'mixmonitorid':_0x382ef0['mixmonitorid']})['catch'](function(_0x46766c){});}})[_0xd236('0x6a')](function(){if(_0x28cb18['destinationchannel']){return ami[_0xd236('0x1f')]({'action':'StopMixMonitor','channel':_0x28cb18[_0xd236('0x76')],'mixmonitorid':_0x382ef0[_0xd236('0x70')]})['catch'](function(_0x24f720){});}})[_0xd236('0x6a')](function(_0x275f2b){var _0x12dcb5=_['find'](_0x28cb18[_0xd236('0x6b')],{'mixmonitorid':_0x382ef0[_0xd236('0x70')]});if(_0x12dcb5){_0x12dcb5[_0xd236('0x77')]='stop';}})[_0xd236('0x6a')](function(){var _0x4db755=util[_0xd236('0x7')](_0xd236('0x64'),_0x382ef0[_0xd236('0x65')]||_0x382ef0['uniqueid'],_0x382ef0[_0xd236('0x7')]||_0xd236('0x66'));var _0x2c2046=_[_0xd236('0x63')](_0x28cb18['monitors'],{'filename':_0xd236('0x6e')+_0x4db755[_0xd236('0x6c')]()});if(_0x2c2046){_0x2c2046[_0xd236('0x77')]=_0xd236('0x78');}})['then'](function(){_0x1cd1f2({'code':0xc8,'message':[_0x382ef0[_0xd236('0x72')],_0xd236('0x79')]['join']('\x20')});})['catch'](function(_0x19a083){_0x498ec5(_0x405514[_0xd236('0x12')](0x1f5,[_0x382ef0[_0xd236('0x72')],_0x19a083[_0xd236('0x1c')][_0xd236('0x6c')]()][_0xd236('0x16')]('\x20')));});}else{return _0x498ec5(_0x405514[_0xd236('0x12')](0x1f5,_0xd236('0x7a')));}});},'VoiceQueuesChannels':function(_0x5e0830){return new Promise(function(_0xa816f6,_0x1c43de){var _0x5711f8=_[_0xd236('0x5e')](_0x56bc88[_0xd236('0x7b')]);_0xa816f6({'count':_0x5711f8['length'],'rows':_0x5711f8});});},'VoiceQueuesChannel':function(_0x179216){var _0x1cdc97=this;return new Promise(function(_0x48b284,_0x1cd0df){var _0x3ae9aa=schema(properties[_0xd236('0x7c')])['validate'](_0x179216);if(_0x3ae9aa['length']>0x0){return _0x1cd0df(_0x1cdc97['error'](0x1f4,_[_0xd236('0x62')](_0x3ae9aa,'message')['join'](',\x20')));}var _0x273b4e=_[_0xd236('0x63')](_0x56bc88[_0xd236('0x7b')],{'uniqueid':_0x179216[_0xd236('0x72')]});if(_0x273b4e){_0x48b284(_0x273b4e);}else{return _0x1cd0df(_0x1cdc97['error'](0x1f5,_0xd236('0x7a')));}});},'VoiceQueuesChannelHangup':function(_0xd52822){var _0x46ed28=this;return new Promise(function(_0x4d1ba5,_0x33e00b){if(ami[_0xd236('0x11')]()==![]){return _0x33e00b(_0x46ed28[_0xd236('0x12')](0x1f4,[config[_0xd236('0x13')]['ip'],config[_0xd236('0x13')]['username'],'ami\x20disconnected'][_0xd236('0x16')]('\x20')));}var _0x4ff84b=schema(properties[_0xd236('0x7d')])[_0xd236('0x2')](_0xd52822);if(_0x4ff84b[_0xd236('0x60')]>0x0){return _0x33e00b(_0x46ed28['error'](0x1f4,_[_0xd236('0x62')](_0x4ff84b,_0xd236('0x1c'))['join'](',\x20')));}var _0x2af800=_[_0xd236('0x63')](_0x56bc88['queueChannels'],{'uniqueid':_0xd52822[_0xd236('0x72')]});if(_0x2af800&&_0x2af800[_0xd236('0x68')]){return ami['Action']({'action':'Hangup','channel':_0x2af800[_0xd236('0x68')]})[_0xd236('0x6a')](function(_0x4ae910){_0x4d1ba5({'code':0xc8,'message':[_0xd52822[_0xd236('0x72')],_0x4ae910['message'][_0xd236('0x6c')]()][_0xd236('0x16')]('\x20')});})['catch'](function(_0x26f817){_0x33e00b(_0x46ed28[_0xd236('0x12')](0x1f5,[_0xd52822['uniqueid'],_0x26f817[_0xd236('0x1c')]['toLowerCase']()][_0xd236('0x16')]('\x20')));});}else{return _0x33e00b(_0x46ed28[_0xd236('0x12')](0x1f5,_0xd236('0x7a')));}});},'VoiceQueuesChannelRedirect':function(_0x1f09a0){var _0x5bbb22=this;return new Promise(function(_0x53fe9a,_0x2f31aa){if(ami['isConnected']()==![]){return _0x2f31aa(_0x5bbb22[_0xd236('0x12')](0x1f4,[config[_0xd236('0x13')]['ip'],config['asterisk'][_0xd236('0x14')],_0xd236('0x15')]['join']('\x20')));}var _0x14d8cf=schema(properties[_0xd236('0x7e')])[_0xd236('0x2')](_0x1f09a0);if(_0x14d8cf['length']>0x0){return _0x2f31aa(_0x5bbb22['error'](0x1f4,_[_0xd236('0x62')](_0x14d8cf,_0xd236('0x1c'))[_0xd236('0x16')](',\x20')));}var _0x1be4dc=_['find'](_0x56bc88[_0xd236('0x7b')],{'uniqueid':_0x1f09a0['uniqueid']});if(_0x1be4dc&&_0x1be4dc['channel']){return ami[_0xd236('0x1f')]({'action':'Redirect','channel':_0x1be4dc[_0xd236('0x68')],'exten':_0x1f09a0['exten'],'context':_0x1f09a0[_0xd236('0x7f')]||_0x1be4dc[_0xd236('0x7f')],'priority':0x1})[_0xd236('0x6a')](function(_0x8a1a59){_0x53fe9a({'code':0xc8,'message':[_0x1f09a0[_0xd236('0x72')],_0x8a1a59['message'][_0xd236('0x6c')]()][_0xd236('0x16')]('\x20')});})[_0xd236('0x74')](function(_0x266aa2){_0x2f31aa(_0x5bbb22['error'](0x1f5,[_0x1f09a0[_0xd236('0x72')],_0x266aa2[_0xd236('0x1c')][_0xd236('0x6c')]()][_0xd236('0x16')]('\x20')));});}else{return _0x2f31aa(_0x5bbb22[_0xd236('0x12')](0x1f5,_0xd236('0x7a')));}});},'Agents':function(_0x410f52){return new Promise(function(_0x5d17fd,_0xb64a46){var _0x1aab34=_[_0xd236('0x5e')](_0x56bc88[_0xd236('0xd')]);_0x5d17fd({'count':_0x1aab34['length'],'rows':_0x1aab34});});},'Telephones':function(_0x1df939){return new Promise(function(_0x2b6c30,_0x2546d2){var _0x2fcd31=_[_0xd236('0x5e')](_0x56bc88[_0xd236('0x80')]);_0x2b6c30({'count':_0x2fcd31[_0xd236('0x60')],'rows':_0x2fcd31});});},'Trunks':function(_0x4a4339){return new Promise(function(_0x4d1357,_0x49bd98){var _0x3823ca=_[_0xd236('0x5e')](_0x56bc88['trunks']);_0x4d1357({'count':_0x3823ca[_0xd236('0x60')],'rows':_0x3823ca});});},'OutboundChannels':function(_0x45d4fb){return new Promise(function(_0x6f16c6,_0x1f3eac){var _0x4a222d=_[_0xd236('0x5e')](_0x56bc88[_0xd236('0x81')]);_0x6f16c6({'count':_0x4a222d[_0xd236('0x60')],'rows':_0x4a222d});});},'Outbound':function(_0x45a3b5){return new Promise(function(_0x3d6705,_0x2d3af4){_0x3d6705(_0x56bc88[_0xd236('0x32')]);});},'Campaigns':function(_0x19289f){return new Promise(function(_0x38ec5c,_0x50d84b){var _0x4d5720=_[_0xd236('0x5e')](_0x56bc88[_0xd236('0x82')]);_0x38ec5c({'count':_0x4d5720['length'],'rows':_0x4d5720});});},'VoiceQueuesPreview':function(_0x1401eb){var _0xa2ad92=this;return new Promise(function(_0x5849ea,_0x8067){_0x234912['run'](_0x1401eb['id'])['then'](function(_0x470133){_0x5849ea({'code':0xc8,'message':_0x470133[_0xd236('0x1c')]});})[_0xd236('0x74')](function(_0x51bd3d){_0x8067(_0xa2ad92[_0xd236('0x12')](0x1f4,_0x51bd3d[_0xd236('0x1c')]));});});},'EventManager':function(_0x4767e8){var _0x159d95=this;return new Promise(function(_0xe2c327,_0x30cabd){if(!_0x4767e8['event']){return _0x30cabd(_0x159d95[_0xd236('0x12')](0x1f4,_0xd236('0x83')));}ami[_0xd236('0x84')](_0xd236('0x85')+_0x4767e8['event'],_0x4767e8[_0xd236('0x1c')]);_0xe2c327({'code':0xc8,'message':_0x4767e8});});},'FaxAccounts':function(_0x1250a8){return new Promise(function(_0x3a5218,_0x4312bd){var _0x32969e=_['values'](_0x56bc88[_0xd236('0x86')]);_0x3a5218({'count':_0x32969e[_0xd236('0x60')],'rows':_0x32969e});});},'SendFax':function(_0x3f0914){var _0x55b52d=this;return new Promise(function(_0xf08595,_0x5928cc){_0x29a67c['send'](_0x3f0914)[_0xd236('0x6a')](function(_0x36a924){_0xf08595({'code':0xc8,'message':_0x36a924[_0xd236('0x1c')]});})[_0xd236('0x74')](function(_0x407cd8){_0x5928cc(_0x55b52d[_0xd236('0x12')](0x1f4,_0x407cd8['message']));});});},'CheckAfterSend':function(_0x40b911){var _0x22d3b7=this;return new Promise(function(_0x5de836,_0x5a84e2){_0x29a67c[_0xd236('0x87')](_0x40b911)['then'](function(_0x3384eb){_0x5de836({'code':0xc8,'message':_0x3384eb[_0xd236('0x1c')]});})[_0xd236('0x74')](function(_0x5846ac){_0x5a84e2(_0x22d3b7[_0xd236('0x12')](0x1f4,_0x5846ac[_0xd236('0x1c')]));});});}};var _0x1795dc=jayson[_0xd236('0x88')](_0x58c59e)[_0xd236('0x89')]();_0x1795dc['on'](_0xd236('0x12'),function(_0x336a91){return _0x1aedc6(_0x336a91);});_0x1795dc[_0xd236('0x8a')](0x232a,_0xd236('0x8b'),function(){console['log'](_0xd236('0x8c'),0x232a);return _0x75d84c(_0xd236('0x8d')+0x232a);});});};
\ No newline at end of file
index 1674ea3..0836d24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f0d=['length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','info','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','<unknown>','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','toLowerCase','bluebird','ioredis','util','../../../../config/environment','trigger','../../rpc/cmContact','redis','defaults','socket.io-emitter','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','scheduledAt','updatedAt','resolve','then','isEmpty'];(function(_0x56f8de,_0x143cc4){var _0x5d83b5=function(_0x42738c){while(--_0x42738c){_0x56f8de['push'](_0x56f8de['shift']());}};_0x5d83b5(++_0x143cc4);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x37a6fd,_0x25edae){_0x37a6fd=_0x37a6fd-0x0;var _0x572126=_0x6f0d[_0x37a6fd];return _0x572126;};'use strict';var _=require('lodash');var BPromise=require(_0xd6f0('0x0'));var Redis=require(_0xd6f0('0x1'));var util=require(_0xd6f0('0x2'));var config=require(_0xd6f0('0x3'));var logger=require('../../../../config/logger')(_0xd6f0('0x4'));var cmContactRpc=require(_0xd6f0('0x5'));config[_0xd6f0('0x6')]=_[_0xd6f0('0x7')](config[_0xd6f0('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xd6f0('0x8'))(new Redis(config['redis']));function emit(_0xe21ac4,_0x1af29c,_0x8b89a9,_0x1a48a0,_0x4c4916){logger['info'](_0xd6f0('0x9'),_0xe21ac4,_0x1af29c['id'],_0x8b89a9,_0x1a48a0,JSON[_0xd6f0('0xa')](_0x4c4916));io['to'](_0x8b89a9)[_0xd6f0('0xb')](_0x1a48a0,_0x4c4916);}exports[_0xd6f0('0xc')]=function(_0x225dcf,_0x4db64a,_0x136eee,_0xee144c){var _0x329f69,_0x44bba6;var _0x4d10a1={};var _0x1ce8d5=Number(_0x136eee[_0xd6f0('0xd')]);var _0x306aad=_0x136eee[_0xd6f0('0xe')]?Boolean(Number(_0x136eee[_0xd6f0('0xe')])):![];var _0x409549;var _0x2bf5b8=![];if(!_[_0xd6f0('0xf')](_0x136eee[_0xd6f0('0x10')])){if(_0x136eee['data5']=='1')_0x2bf5b8=!![];}if(!_0x2bf5b8){if(_0xee144c[_0xd6f0('0x11')]){_0x4d10a1['id']=_0xee144c[_0xd6f0('0x11')];}}if(!_0x4d10a1['id']){_0x4d10a1['ListId']=_0x1ce8d5;_0x409549=_0x136eee[_0xd6f0('0x12')]&&_0x136eee['data3']!=='0'?_0x136eee[_0xd6f0('0x12')][_0xd6f0('0x13')](','):[_0xd6f0('0x14')];_0x4d10a1[_0xd6f0('0x15')]=_[_0xd6f0('0x16')](_0x409549,function(_0x61defb){var _0x25da0c={};_0x25da0c[_0x61defb]=_0xee144c[_0xd6f0('0x17')]?_0xee144c[_0xd6f0('0x18')]:_0xee144c[_0xd6f0('0x19')];return _0x25da0c;});}var _0x23ab6c=['id',_0xd6f0('0x1a'),_0xd6f0('0x1b'),_0xd6f0('0x14'),_0xd6f0('0x1c'),_0xd6f0('0x1d'),'ListId','createdAt',_0xd6f0('0x1e'),_0xd6f0('0x1f')];var _0x1158dc=_['union'](_0x23ab6c,_0x409549);BPromise[_0xd6f0('0x20')]()[_0xd6f0('0x21')](cmContactRpc['getContacts']({'attributes':_0x1158dc,'where':_0x4d10a1}))[_0xd6f0('0x21')](function(_0x515687){_0x44bba6=_0x515687;if(!_[_0xd6f0('0x22')](_0x44bba6)){if(_0x44bba6[_0xd6f0('0x23')]===0x1){_0x329f69=_0x44bba6[0x0];logger['info'](_0xd6f0('0x24'),_0xee144c[_0xd6f0('0x25')],_0x4db64a['id'],_0x329f69['id']);}else{logger['info'](_0xd6f0('0x26'),_0xee144c[_0xd6f0('0x25')],_0x4db64a['id'],_[_0xd6f0('0x16')](_0x44bba6,'id')['join'](','));}return;}else{logger[_0xd6f0('0x27')](_0xd6f0('0x28'),_0xee144c['uniqueid'],_0x4db64a['id']);var _0xcea0ae={'ListId':_0x1ce8d5};var _0x551be8=_0x136eee[_0xd6f0('0x29')]&&_0x136eee[_0xd6f0('0x29')]!=='0'?_0x136eee[_0xd6f0('0x29')]:_0xd6f0('0x14');if(_0x306aad){logger[_0xd6f0('0x27')](_0xd6f0('0x2a'),_0xee144c[_0xd6f0('0x25')],_0x4db64a['id']);_0xcea0ae[_0x551be8]=_[_0xd6f0('0xf')](_0xee144c['routeId'])?_0xee144c[_0xd6f0('0x19')]:_0xee144c[_0xd6f0('0x18')];if(_['isNil'](_0xee144c[_0xd6f0('0x17')])){_0xcea0ae[_0xd6f0('0x1a')]=_0xee144c[_0xd6f0('0x2b')]&&_0xee144c[_0xd6f0('0x2b')]!==_0xd6f0('0x2c')?_0xee144c[_0xd6f0('0x2b')]:_0xd6f0('0x2d');}else{_0xcea0ae[_0xd6f0('0x1a')]=_0xee144c[_0xd6f0('0x2e')]&&_0xee144c[_0xd6f0('0x2e')]!==_0xd6f0('0x2c')?_0xee144c[_0xd6f0('0x2e')]:_0xd6f0('0x2d');}return BPromise[_0xd6f0('0x20')]()[_0xd6f0('0x21')](cmContactRpc[_0xd6f0('0x2f')](_0xcea0ae))[_0xd6f0('0x21')](function(_0x376890){_0x329f69=_0x376890;_0x44bba6[_0xd6f0('0x30')](_0x376890);if(_0x329f69){logger[_0xd6f0('0x27')](_0xd6f0('0x31'),_0xee144c[_0xd6f0('0x25')],_0x4db64a['id'],_0x329f69['id']);}return;});}else{logger['info'](_0xd6f0('0x32'),_0xee144c['uniqueid'],_0x4db64a['id']);_0xcea0ae[_0x551be8]=_['isNil'](_0xee144c[_0xd6f0('0x17')])?_0xee144c[_0xd6f0('0x19')]:_0xee144c[_0xd6f0('0x18')];if(_[_0xd6f0('0xf')](_0xee144c[_0xd6f0('0x17')])){_0xcea0ae['firstName']=_0xee144c[_0xd6f0('0x2b')]&&_0xee144c['calleridname']!==_0xd6f0('0x2c')?_0xee144c[_0xd6f0('0x2b')]:_0xd6f0('0x2d');}else{_0xcea0ae[_0xd6f0('0x1a')]=_0xee144c[_0xd6f0('0x2e')]&&_0xee144c['destcalleridname']!=='<unknown>'?_0xee144c[_0xd6f0('0x2e')]:_0xd6f0('0x2d');}_0x329f69=_0xcea0ae;_0x44bba6['push'](_0xcea0ae);return;}}})[_0xd6f0('0x21')](function(){if(_0x225dcf){emit(_0xee144c['uniqueid'],_0x4db64a,util[_0xd6f0('0x33')](_0xd6f0('0x34'),_0x225dcf[_0xd6f0('0x35')]),util[_0xd6f0('0x33')](_0xd6f0('0x36'),_0x136eee[_0xd6f0('0x37')][_0xd6f0('0x38')]()),{'evt':_['merge'](_0xee144c,{'autoCreate':_0x306aad}),'contact':_0x329f69===undefined?{}:_0x329f69,'contacts':_0x44bba6['length']===0x0?undefined:_0x44bba6});}});};
\ No newline at end of file
+var _0xf3cd=['isEmpty','length','info','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','calleridname','<unknown>','destcalleridname','Unknown','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','name','trigger:%s','action','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','stringify','emit','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','createdAt','scheduledAt','updatedAt','resolve','getContacts','then'];(function(_0x4ff0a6,_0x6c0a3b){var _0x440b4e=function(_0x1a712b){while(--_0x1a712b){_0x4ff0a6['push'](_0x4ff0a6['shift']());}};_0x440b4e(++_0x6c0a3b);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x5a7e3c,_0xdc9219){_0x5a7e3c=_0x5a7e3c-0x0;var _0x59252b=_0xf3cd[_0x5a7e3c];return _0x59252b;};'use strict';var _=require(_0xdf3c('0x0'));var BPromise=require(_0xdf3c('0x1'));var Redis=require(_0xdf3c('0x2'));var util=require(_0xdf3c('0x3'));var config=require(_0xdf3c('0x4'));var logger=require(_0xdf3c('0x5'))('trigger');var cmContactRpc=require(_0xdf3c('0x6'));config[_0xdf3c('0x7')]=_[_0xdf3c('0x8')](config['redis'],{'host':_0xdf3c('0x9'),'port':0x18eb});var io=require(_0xdf3c('0xa'))(new Redis(config[_0xdf3c('0x7')]));function emit(_0x1f0601,_0x106021,_0x28edae,_0x52c073,_0x15705d){logger['info']('[CM][%s][%s]',_0x1f0601,_0x106021['id'],_0x28edae,_0x52c073,JSON[_0xdf3c('0xb')](_0x15705d));io['to'](_0x28edae)[_0xdf3c('0xc')](_0x52c073,_0x15705d);}exports['exec']=function(_0x1dba4c,_0x205f33,_0x2d420c,_0x21a6e5){var _0x3a3154,_0x1c456b;var _0xf7da9d={};var _0x32d2db=Number(_0x2d420c['data1']);var _0x1d483c=_0x2d420c[_0xdf3c('0xd')]?Boolean(Number(_0x2d420c[_0xdf3c('0xd')])):![];var _0x17319c;var _0x59e431=![];if(!_[_0xdf3c('0xe')](_0x2d420c[_0xdf3c('0xf')])){if(_0x2d420c[_0xdf3c('0xf')]=='1')_0x59e431=!![];}if(!_0x59e431){if(_0x21a6e5['xmd-contactid']){_0xf7da9d['id']=_0x21a6e5[_0xdf3c('0x10')];}}if(!_0xf7da9d['id']){_0xf7da9d[_0xdf3c('0x11')]=_0x32d2db;_0x17319c=_0x2d420c[_0xdf3c('0x12')]&&_0x2d420c[_0xdf3c('0x12')]!=='0'?_0x2d420c[_0xdf3c('0x12')][_0xdf3c('0x13')](','):[_0xdf3c('0x14')];_0xf7da9d[_0xdf3c('0x15')]=_[_0xdf3c('0x16')](_0x17319c,function(_0x5d3991){var _0x54cdd4={};_0x54cdd4[_0x5d3991]=_0x21a6e5[_0xdf3c('0x17')]?_0x21a6e5[_0xdf3c('0x18')]:_0x21a6e5[_0xdf3c('0x19')];return _0x54cdd4;});}var _0x18d4ec=['id',_0xdf3c('0x1a'),_0xdf3c('0x1b'),_0xdf3c('0x14'),_0xdf3c('0x1c'),_0xdf3c('0x1d'),_0xdf3c('0x11'),_0xdf3c('0x1e'),_0xdf3c('0x1f'),_0xdf3c('0x20')];var _0x5d2390=_['union'](_0x18d4ec,_0x17319c);BPromise[_0xdf3c('0x21')]()['then'](cmContactRpc[_0xdf3c('0x22')]({'attributes':_0x5d2390,'where':_0xf7da9d}))[_0xdf3c('0x23')](function(_0x36552e){_0x1c456b=_0x36552e;if(!_[_0xdf3c('0x24')](_0x1c456b)){if(_0x1c456b[_0xdf3c('0x25')]===0x1){_0x3a3154=_0x1c456b[0x0];logger[_0xdf3c('0x26')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x21a6e5[_0xdf3c('0x27')],_0x205f33['id'],_0x3a3154['id']);}else{logger[_0xdf3c('0x26')](_0xdf3c('0x28'),_0x21a6e5[_0xdf3c('0x27')],_0x205f33['id'],_[_0xdf3c('0x16')](_0x1c456b,'id')[_0xdf3c('0x29')](','));}return;}else{logger[_0xdf3c('0x26')](_0xdf3c('0x2a'),_0x21a6e5[_0xdf3c('0x27')],_0x205f33['id']);var _0x1adee4={'ListId':_0x32d2db};var _0x4c076c=_0x2d420c[_0xdf3c('0x2b')]&&_0x2d420c[_0xdf3c('0x2b')]!=='0'?_0x2d420c['data4']:_0xdf3c('0x14');if(_0x1d483c){logger['info']('[CM][%s][%s]\x20Autocreate\x20enabled',_0x21a6e5['uniqueid'],_0x205f33['id']);_0x1adee4[_0x4c076c]=_[_0xdf3c('0xe')](_0x21a6e5[_0xdf3c('0x17')])?_0x21a6e5['calleridnum']:_0x21a6e5['destcalleridnum'];if(_[_0xdf3c('0xe')](_0x21a6e5[_0xdf3c('0x17')])){_0x1adee4[_0xdf3c('0x1a')]=_0x21a6e5[_0xdf3c('0x2c')]&&_0x21a6e5['calleridname']!==_0xdf3c('0x2d')?_0x21a6e5[_0xdf3c('0x2c')]:'Unknown';}else{_0x1adee4['firstName']=_0x21a6e5[_0xdf3c('0x2e')]&&_0x21a6e5[_0xdf3c('0x2e')]!==_0xdf3c('0x2d')?_0x21a6e5['destcalleridname']:_0xdf3c('0x2f');}return BPromise[_0xdf3c('0x21')]()[_0xdf3c('0x23')](cmContactRpc[_0xdf3c('0x30')](_0x1adee4))['then'](function(_0xda0de0){_0x3a3154=_0xda0de0;_0x1c456b[_0xdf3c('0x31')](_0xda0de0);if(_0x3a3154){logger['info'](_0xdf3c('0x32'),_0x21a6e5[_0xdf3c('0x27')],_0x205f33['id'],_0x3a3154['id']);}return;});}else{logger[_0xdf3c('0x26')](_0xdf3c('0x33'),_0x21a6e5['uniqueid'],_0x205f33['id']);_0x1adee4[_0x4c076c]=_[_0xdf3c('0xe')](_0x21a6e5[_0xdf3c('0x17')])?_0x21a6e5[_0xdf3c('0x19')]:_0x21a6e5[_0xdf3c('0x18')];if(_['isNil'](_0x21a6e5[_0xdf3c('0x17')])){_0x1adee4[_0xdf3c('0x1a')]=_0x21a6e5['calleridname']&&_0x21a6e5['calleridname']!==_0xdf3c('0x2d')?_0x21a6e5['calleridname']:_0xdf3c('0x2f');}else{_0x1adee4['firstName']=_0x21a6e5['destcalleridname']&&_0x21a6e5['destcalleridname']!==_0xdf3c('0x2d')?_0x21a6e5[_0xdf3c('0x2e')]:_0xdf3c('0x2f');}_0x3a3154=_0x1adee4;_0x1c456b[_0xdf3c('0x31')](_0x1adee4);return;}}})['then'](function(){if(_0x1dba4c){emit(_0x21a6e5['uniqueid'],_0x205f33,util[_0xdf3c('0x34')]('user:%s',_0x1dba4c[_0xdf3c('0x35')]),util[_0xdf3c('0x34')](_0xdf3c('0x36'),_0x2d420c[_0xdf3c('0x37')][_0xdf3c('0x38')]()),{'evt':_[_0xdf3c('0x39')](_0x21a6e5,{'autoCreate':_0x1d483c}),'contact':_0x3a3154===undefined?{}:_0x3a3154,'contacts':_0x1c456b[_0xdf3c('0x25')]===0x0?undefined:_0x1c456b});}});};
\ No newline at end of file
index 4c20db7..a0c9cc8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16a3=['./integration','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','defaults','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','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:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','prototype','info','emit','undefined','motionChannel','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions','length','action','motionbar','data1','templates','data2','render','html','template\x20not\x20found','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','data5','windowHeight','data6','winApplication','winArguments','format','user:%s','trigger:%s:%s','toLowerCase','jscripty','name','trigger:%s','exec','integration','urlforward','script','parse','query','search','replace','channel','AllConditions','every','AnyConditions','some','checkConditions','field','account','chat','ChatWebsiteId','upperFirst','AccountId','operator','value','interaction','message','event','queue','agent','membername','lastevent','routeId','exports','url','mustache','ioredis','./urlforward'];(function(_0x57fcd6,_0x70b457){var _0x5b6c73=function(_0x366b6a){while(--_0x366b6a){_0x57fcd6['push'](_0x57fcd6['shift']());}};_0x5b6c73(++_0x70b457);}(_0x16a3,0x1e0));var _0x316a=function(_0x118bef,_0xf18c96){_0x118bef=_0x118bef-0x0;var _0x406be6=_0x16a3[_0x118bef];return _0x406be6;};'use strict';var util=require('util');var _=require('lodash');var url=require(_0x316a('0x0'));var Mustache=require(_0x316a('0x1'));var Redis=require(_0x316a('0x2'));var urlforward=require(_0x316a('0x3'));var integration=require(_0x316a('0x4'));var cmContact=require(_0x316a('0x5'));var script=require(_0x316a('0x6'));var config=require(_0x316a('0x7'));var logger=require(_0x316a('0x8'))(_0x316a('0x9'));var ami=require(_0x316a('0xa'));config['redis']=_[_0x316a('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x316a('0xc'))(new Redis(config['redis']));var operators={'equals':function(_0x203555,_0x217477){return _0x203555==_0x217477;},'not_equals':function(_0x56c4f9,_0x1e5c7e){return _0x56c4f9!=_0x1e5c7e;}};var barAndWebActions=[_0x316a('0xd'),'url',_0x316a('0xe')];function Trigger(_0x47c0c2){this[_0x316a('0xf')]=_0x47c0c2[_0x316a('0xf')];this[_0x316a('0x10')]=_0x47c0c2[_0x316a('0x10')];this[_0x316a('0x11')]=_0x47c0c2['voiceQueues'];this['templates']=_0x47c0c2['templates'];this[_0x316a('0x12')]=_0x47c0c2[_0x316a('0x12')];this[_0x316a('0x13')]=_0x47c0c2['zendeskAccounts'];this[_0x316a('0x14')]=_0x47c0c2[_0x316a('0x14')];this[_0x316a('0x15')]=_0x47c0c2[_0x316a('0x15')];this[_0x316a('0x16')]=_0x47c0c2[_0x316a('0x16')];this[_0x316a('0x17')]=_0x47c0c2[_0x316a('0x17')];this[_0x316a('0x18')]=_0x47c0c2['deskAccounts'];this[_0x316a('0x19')]=_0x47c0c2[_0x316a('0x19')];this[_0x316a('0x1a')]=_0x47c0c2[_0x316a('0x1a')];this[_0x316a('0x1b')]=_0x47c0c2[_0x316a('0x1b')];this[_0x316a('0x1c')]=_0x47c0c2['freshsalesAccounts'];this[_0x316a('0x1d')]={'zendesk':this[_0x316a('0x13')],'salesforce':this[_0x316a('0x15')],'freshdesk':this[_0x316a('0x14')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0x316a('0x17')],'desk':this[_0x316a('0x18')],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0x316a('0x1b')],'freshsales':this[_0x316a('0x1c')],'servicenow':this[_0x316a('0x1a')]};ami['on'](_0x316a('0x1e'),this[_0x316a('0x1f')][_0x316a('0x20')](this));ami['on'](_0x316a('0x21'),this[_0x316a('0x1f')][_0x316a('0x20')](this));ami['on']('custom:agentringnoanswer',this['syncCustomEvent'][_0x316a('0x20')](this));ami['on']('custom:agentcomplete',this[_0x316a('0x1f')][_0x316a('0x20')](this));ami['on'](_0x316a('0x22'),this[_0x316a('0x1f')][_0x316a('0x20')](this));ami['on'](_0x316a('0x23'),this[_0x316a('0x1f')][_0x316a('0x20')](this));ami['on'](_0x316a('0x24'),this['syncCustomEvent'][_0x316a('0x20')](this));ami['on'](_0x316a('0x25'),this[_0x316a('0x1f')][_0x316a('0x20')](this));ami['on'](_0x316a('0x26'),this[_0x316a('0x1f')]['bind'](this));ami['on'](_0x316a('0x27'),this[_0x316a('0x1f')][_0x316a('0x20')](this));ami['on'](_0x316a('0x28'),this[_0x316a('0x1f')][_0x316a('0x20')](this));ami['on']('custom:timeout',this[_0x316a('0x1f')]['bind'](this));ami['on'](_0x316a('0x29'),this[_0x316a('0x2a')][_0x316a('0x20')](this));ami['on'](_0x316a('0x2b'),this[_0x316a('0x2a')][_0x316a('0x20')](this));ami['on'](_0x316a('0x2c'),this['syncAgentDial'][_0x316a('0x20')](this));ami['on'](_0x316a('0x2d'),this[_0x316a('0x1f')][_0x316a('0x20')](this));ami['on']('custom:closedinteraction',this[_0x316a('0x1f')][_0x316a('0x20')](this));ami['on']('custom:substatus',this[_0x316a('0x1f')][_0x316a('0x20')](this));ami['on'](_0x316a('0x2e'),this['syncCustomEvent'][_0x316a('0x20')](this));ami['on']('custom:outgoingmessage',this[_0x316a('0x1f')]['bind'](this));ami['on'](_0x316a('0x2f'),this[_0x316a('0x1f')][_0x316a('0x20')](this));ami['on'](_0x316a('0x30'),this[_0x316a('0x1f')][_0x316a('0x20')](this));}Trigger[_0x316a('0x31')]['emit']=function(_0x490ece,_0x3c92fc,_0x123fe7){logger[_0x316a('0x32')](_0x490ece,_0x3c92fc,JSON['stringify'](_0x123fe7));io['to'](_0x490ece)[_0x316a('0x33')](_0x3c92fc,_0x123fe7);};Trigger[_0x316a('0x31')][_0x316a('0x1f')]=function(_0x5a2509){var _0x5928da=_['clone'](_0x5a2509);if(typeof _0x5928da['motionChannel']===_0x316a('0x34')){_0x5928da[_0x316a('0x35')]='voice';}this[_0x316a('0x36')](_0x5928da);};Trigger[_0x316a('0x31')]['syncAgentDial']=function(_0x28c8fc){if(this['agents'][_0x28c8fc[_0x316a('0x37')]]){this[_0x316a('0x1f')](_0x28c8fc);}};Trigger['prototype'][_0x316a('0x36')]=function(_0x2031e5){var _0x152154;for(var _0x24c766 in this[_0x316a('0xf')]){if(this[_0x316a('0xf')][_0x316a('0x38')](_0x24c766)){if(this[_0x316a('0xf')][_0x24c766][_0x316a('0x39')]){_0x152154=this[_0x316a('0x3a')](this[_0x316a('0xf')][_0x24c766],_0x2031e5);if(_0x152154){_[_0x316a('0x3b')](_0x2031e5,_0x2031e5[_0x316a('0x3c')]);for(var _0x5ebca3=0x0,_0x3b8af3,_0x52daa9,_0x1c1a7a;_0x5ebca3<this[_0x316a('0xf')][_0x24c766][_0x316a('0x3d')][_0x316a('0x3e')];_0x5ebca3+=0x1){_0x3b8af3=this[_0x316a('0xf')][_0x24c766]['Actions'][_0x5ebca3];if(this[_0x316a('0x10')][_0x2031e5[_0x316a('0x37')]]){switch(_0x3b8af3[_0x316a('0x3f')]['toLowerCase']()){case'contactmanager':break;case _0x316a('0x40'):case'browser':var _0x2da2b2={};switch(barAndWebActions[_0x3b8af3[_0x316a('0x41')]]){case _0x316a('0xd'):_0x2da2b2['TemplateId']=_0x3b8af3['data2'];_0x2da2b2['html']=this[_0x316a('0x42')][_0x3b8af3[_0x316a('0x43')]]?Mustache[_0x316a('0x44')](this[_0x316a('0x42')][_0x3b8af3[_0x316a('0x43')]][_0x316a('0x45')],_0x2031e5):_0x316a('0x46');break;case'url':_0x2da2b2['uri']=this[_0x316a('0x47')](_0x3b8af3[_0x316a('0x43')],_0x2031e5,_[_0x316a('0x48')](_0x3b8af3['data3'])?!![]:parseInt(_0x3b8af3[_0x316a('0x49')],0xa));if(_[_0x316a('0x48')](_0x3b8af3[_0x316a('0x4a')])){_0x2da2b2[_0x316a('0x4b')]='0';}else{_0x2da2b2[_0x316a('0x4c')]=_0x3b8af3[_0x316a('0x4a')];_0x2da2b2[_0x316a('0x4d')]=_['isNil'](_0x3b8af3['data5'])?'800':_0x3b8af3[_0x316a('0x4e')];_0x2da2b2[_0x316a('0x4f')]=_[_0x316a('0x48')](_0x3b8af3[_0x316a('0x50')])?'600':_0x3b8af3[_0x316a('0x50')];}break;case _0x316a('0xe'):_0x2da2b2[_0x316a('0x51')]=_0x3b8af3[_0x316a('0x43')]?Mustache[_0x316a('0x44')](_0x3b8af3[_0x316a('0x43')],_0x2031e5):'';_0x2da2b2[_0x316a('0x52')]=_0x3b8af3['data3']?Mustache[_0x316a('0x44')](_0x3b8af3[_0x316a('0x49')],_0x2031e5):'';break;}this[_0x316a('0x33')](util[_0x316a('0x53')](_0x316a('0x54'),this[_0x316a('0x10')][_0x2031e5[_0x316a('0x37')]]['name']),util[_0x316a('0x53')](_0x316a('0x55'),_0x3b8af3[_0x316a('0x3f')][_0x316a('0x56')](),barAndWebActions[_0x3b8af3[_0x316a('0x41')]]),_[_0x316a('0x3b')](_0x2da2b2,_0x2031e5));break;case _0x316a('0x57'):this[_0x316a('0x33')](util[_0x316a('0x53')](_0x316a('0x54'),this['agents'][_0x2031e5[_0x316a('0x37')]][_0x316a('0x58')]),util[_0x316a('0x53')](_0x316a('0x59'),_0x3b8af3['action'][_0x316a('0x56')]()),_[_0x316a('0x3b')]({'ProjectId':parseInt(_0x3b8af3[_0x316a('0x41')],0xa)},_0x2031e5));break;default:this[_0x316a('0x33')](util[_0x316a('0x53')]('user:%s',this['agents'][_0x2031e5[_0x316a('0x37')]][_0x316a('0x58')]),util[_0x316a('0x53')]('trigger:%s',_0x3b8af3[_0x316a('0x3f')][_0x316a('0x56')]()),_[_0x316a('0x3b')]({},_0x3b8af3,_0x2031e5));}}switch(_0x3b8af3[_0x316a('0x3f')]['toLowerCase']()){case'contactmanager':cmContact[_0x316a('0x5a')](this[_0x316a('0x10')][_0x2031e5[_0x316a('0x37')]],this['triggers'][_0x24c766],_0x3b8af3,_0x2031e5);break;case _0x316a('0x5b'):integration[_0x316a('0x5a')](_0x3b8af3,_0x2031e5,this[_0x316a('0x1d')],this[_0x316a('0x10')][_0x2031e5['interface']],this['voiceQueues'][_0x2031e5['queue']],this[_0x316a('0x12')][_0x2031e5['routeId']]);break;case _0x316a('0x5c'):urlforward[_0x316a('0x5a')](_0x3b8af3,_0x2031e5);break;case _0x316a('0x5d'):script['exec'](_0x3b8af3,_0x2031e5);break;}}}}}}};Trigger[_0x316a('0x31')][_0x316a('0x47')]=function(_0x270314,_0xafd45e,_0xd5dc67){var _0x4ed712=url[_0x316a('0x5e')](Mustache[_0x316a('0x44')](_0x270314,_0xafd45e),!![]);if(_0xd5dc67){_['merge'](_0x4ed712[_0x316a('0x5f')],_0xafd45e);}delete _0x4ed712[_0x316a('0x60')];var _0x290ce7=url['format'](_0x4ed712);_0x290ce7=_0x290ce7[_0x316a('0x61')](/\/\?/g,'?');return _0x290ce7;};Trigger[_0x316a('0x31')][_0x316a('0x3a')]=function(_0x398c71,_0x5561d4){var _0x528eec=!![];var _0x52cf8f=!![];var _0x83888c=![];if(_0x398c71[_0x316a('0x62')]===_0x5561d4[_0x316a('0x35')]){_0x83888c=!![];}if(_0x398c71[_0x316a('0x63')][_0x316a('0x3e')]){_0x528eec=_[_0x316a('0x64')](_0x398c71[_0x316a('0x63')],this['checkConditions'](_0x5561d4,_0x398c71[_0x316a('0x62')]));}if(_0x398c71[_0x316a('0x65')][_0x316a('0x3e')]){_0x52cf8f=_[_0x316a('0x66')](_0x398c71['AnyConditions'],this['checkConditions'](_0x5561d4,_0x398c71['channel']));}return _0x83888c&&_0x528eec&&_0x52cf8f;};Trigger[_0x316a('0x31')][_0x316a('0x67')]=function(_0x14506a,_0x2288de){return function(_0x304163){switch(_0x304163[_0x316a('0x68')]){case _0x316a('0x69'):if(_0x14506a[_0x316a('0x62')]===_0x2288de){if(_0x2288de===_0x316a('0x6a')){return _0x14506a[_0x316a('0x6b')]?operators[_0x304163['operator']](Number(_0x304163['value']),_0x14506a[_0x316a('0x6b')]):![];}else{return _0x14506a[_[_0x316a('0x6c')](_0x2288de)+_0x316a('0x6d')]?operators[_0x304163[_0x316a('0x6e')]](Number(_0x304163[_0x316a('0x6f')]),_0x14506a[_['upperFirst'](_0x2288de)+'AccountId']):![];}}break;case _0x316a('0x70'):case _0x316a('0x71'):if(_0x14506a['channel']===_0x2288de){return _0x14506a[_0x316a('0x72')]?operators[_0x304163['operator']](_0x304163[_0x316a('0x6f')],_0x14506a[_0x316a('0x72')]):![];}break;case'queue':return _0x14506a['queue']?operators[_0x304163[_0x316a('0x6e')]](_0x304163[_0x316a('0x6f')],_0x14506a[_0x316a('0x73')]):![];case _0x316a('0x74'):return _0x14506a[_0x316a('0x75')]?operators[_0x304163['operator']](_0x304163[_0x316a('0x6f')],_0x14506a[_0x316a('0x75')]):![];case'lastevent':return _0x14506a['lastevent']?operators[_0x304163[_0x316a('0x6e')]](_0x304163['value'],_0x14506a[_0x316a('0x76')]):![];case _0x316a('0x77'):return _0x14506a[_0x316a('0x77')]?operators[_0x304163[_0x316a('0x6e')]](_0x304163[_0x316a('0x6f')],_0x14506a['routeId']):![];}return![];};};module[_0x316a('0x78')]=Trigger;
\ No newline at end of file
+var _0xd125=['contactmanager','exec','accounts','voiceQueues','queue','routeId','script','query','search','replace','channel','AllConditions','every','checkConditions','AnyConditions','some','account','chat','ChatWebsiteId','operator','upperFirst','AccountId','value','interaction','message','event','agent','membername','lastevent','exports','lodash','url','mustache','ioredis','./urlforward','./cmContact','./script','../../../config/logger','../ami','redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','agents','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','deskAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:amd','custom:queuecallerabandon','custom:timeout','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:substatus','custom:incomingmessage','custom:rejectmessage','prototype','emit','stringify','clone','motionChannel','undefined','voice','checkTriggers','status','checkTrigger','merge','Actions','length','interface','action','toLowerCase','motionbar','browser','TemplateId','html','data2','uri','buildUri','isNil','data4','windowWidth','data5','800','windowHeight','data6','600','winApplication','winArguments','render','format','user:%s','name','trigger:%s:%s','data1','trigger:%s'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xd125,0x92));var _0x5d12=function(_0x5eb1fb,_0x158aba){_0x5eb1fb=_0x5eb1fb-0x0;var _0x479d24=_0xd125[_0x5eb1fb];return _0x479d24;};'use strict';var util=require('util');var _=require(_0x5d12('0x0'));var url=require(_0x5d12('0x1'));var Mustache=require(_0x5d12('0x2'));var Redis=require(_0x5d12('0x3'));var urlforward=require(_0x5d12('0x4'));var integration=require('./integration');var cmContact=require(_0x5d12('0x5'));var script=require(_0x5d12('0x6'));var config=require('../../../config/environment');var logger=require(_0x5d12('0x7'))('trigger');var ami=require(_0x5d12('0x8'));config[_0x5d12('0x9')]=_[_0x5d12('0xa')](config[_0x5d12('0x9')],{'host':_0x5d12('0xb'),'port':0x18eb});var io=require(_0x5d12('0xc'))(new Redis(config['redis']));var operators={'equals':function(_0x2682aa,_0x4fce25){return _0x2682aa==_0x4fce25;},'not_equals':function(_0x414f40,_0x30826c){return _0x414f40!=_0x30826c;}};var barAndWebActions=[_0x5d12('0xd'),_0x5d12('0x1'),_0x5d12('0xe')];function Trigger(_0x674838){this[_0x5d12('0xf')]=_0x674838[_0x5d12('0xf')];this[_0x5d12('0x10')]=_0x674838[_0x5d12('0x10')];this['voiceQueues']=_0x674838['voiceQueues'];this[_0x5d12('0x11')]=_0x674838[_0x5d12('0x11')];this[_0x5d12('0x12')]=_0x674838[_0x5d12('0x12')];this[_0x5d12('0x13')]=_0x674838[_0x5d12('0x13')];this[_0x5d12('0x14')]=_0x674838[_0x5d12('0x14')];this[_0x5d12('0x15')]=_0x674838[_0x5d12('0x15')];this[_0x5d12('0x16')]=_0x674838[_0x5d12('0x16')];this[_0x5d12('0x17')]=_0x674838[_0x5d12('0x17')];this['deskAccounts']=_0x674838['deskAccounts'];this['vtigerAccounts']=_0x674838[_0x5d12('0x18')];this[_0x5d12('0x19')]=_0x674838[_0x5d12('0x19')];this[_0x5d12('0x1a')]=_0x674838[_0x5d12('0x1a')];this[_0x5d12('0x1b')]=_0x674838[_0x5d12('0x1b')];this['accounts']={'zendesk':this[_0x5d12('0x13')],'salesforce':this[_0x5d12('0x15')],'freshdesk':this[_0x5d12('0x14')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this['zohoAccounts'],'desk':this[_0x5d12('0x1c')],'vtiger':this[_0x5d12('0x18')],'dynamics365':this[_0x5d12('0x1a')],'freshsales':this[_0x5d12('0x1b')],'servicenow':this[_0x5d12('0x19')]};ami['on'](_0x5d12('0x1d'),this[_0x5d12('0x1e')][_0x5d12('0x1f')](this));ami['on']('custom:agentconnect',this['syncCustomEvent'][_0x5d12('0x1f')](this));ami['on']('custom:agentringnoanswer',this[_0x5d12('0x1e')][_0x5d12('0x1f')](this));ami['on']('custom:agentcomplete',this[_0x5d12('0x1e')][_0x5d12('0x1f')](this));ami['on'](_0x5d12('0x20'),this[_0x5d12('0x1e')]['bind'](this));ami['on'](_0x5d12('0x21'),this[_0x5d12('0x1e')][_0x5d12('0x1f')](this));ami['on'](_0x5d12('0x22'),this[_0x5d12('0x1e')][_0x5d12('0x1f')](this));ami['on'](_0x5d12('0x23'),this[_0x5d12('0x1e')][_0x5d12('0x1f')](this));ami['on']('custom:agentreject',this[_0x5d12('0x1e')][_0x5d12('0x1f')](this));ami['on'](_0x5d12('0x24'),this[_0x5d12('0x1e')][_0x5d12('0x1f')](this));ami['on'](_0x5d12('0x25'),this[_0x5d12('0x1e')][_0x5d12('0x1f')](this));ami['on'](_0x5d12('0x26'),this[_0x5d12('0x1e')][_0x5d12('0x1f')](this));ami['on']('custom:dialbegin',this[_0x5d12('0x27')][_0x5d12('0x1f')](this));ami['on'](_0x5d12('0x28'),this[_0x5d12('0x27')][_0x5d12('0x1f')](this));ami['on'](_0x5d12('0x29'),this[_0x5d12('0x27')]['bind'](this));ami['on'](_0x5d12('0x2a'),this['syncCustomEvent']['bind'](this));ami['on']('custom:closedinteraction',this[_0x5d12('0x1e')][_0x5d12('0x1f')](this));ami['on'](_0x5d12('0x2b'),this[_0x5d12('0x1e')][_0x5d12('0x1f')](this));ami['on'](_0x5d12('0x2c'),this['syncCustomEvent'][_0x5d12('0x1f')](this));ami['on']('custom:outgoingmessage',this[_0x5d12('0x1e')][_0x5d12('0x1f')](this));ami['on']('custom:acceptmessage',this[_0x5d12('0x1e')][_0x5d12('0x1f')](this));ami['on'](_0x5d12('0x2d'),this[_0x5d12('0x1e')][_0x5d12('0x1f')](this));}Trigger[_0x5d12('0x2e')][_0x5d12('0x2f')]=function(_0x1c0393,_0x15b895,_0x35a634){logger['info'](_0x1c0393,_0x15b895,JSON[_0x5d12('0x30')](_0x35a634));io['to'](_0x1c0393)['emit'](_0x15b895,_0x35a634);};Trigger[_0x5d12('0x2e')][_0x5d12('0x1e')]=function(_0x4a5cfa){var _0x307027=_[_0x5d12('0x31')](_0x4a5cfa);if(typeof _0x307027[_0x5d12('0x32')]===_0x5d12('0x33')){_0x307027[_0x5d12('0x32')]=_0x5d12('0x34');}this[_0x5d12('0x35')](_0x307027);};Trigger[_0x5d12('0x2e')][_0x5d12('0x27')]=function(_0x45d18e){if(this[_0x5d12('0x10')][_0x45d18e['interface']]){this['syncCustomEvent'](_0x45d18e);}};Trigger['prototype'][_0x5d12('0x35')]=function(_0x2d2405){var _0x67ae8f;for(var _0x1c918d in this[_0x5d12('0xf')]){if(this['triggers']['hasOwnProperty'](_0x1c918d)){if(this[_0x5d12('0xf')][_0x1c918d][_0x5d12('0x36')]){_0x67ae8f=this[_0x5d12('0x37')](this[_0x5d12('0xf')][_0x1c918d],_0x2d2405);if(_0x67ae8f){_[_0x5d12('0x38')](_0x2d2405,_0x2d2405['variables']);for(var _0x3e5ce4=0x0,_0x54a5d4,_0x528c37,_0x1debce;_0x3e5ce4<this['triggers'][_0x1c918d][_0x5d12('0x39')][_0x5d12('0x3a')];_0x3e5ce4+=0x1){_0x54a5d4=this[_0x5d12('0xf')][_0x1c918d][_0x5d12('0x39')][_0x3e5ce4];if(this['agents'][_0x2d2405[_0x5d12('0x3b')]]){switch(_0x54a5d4[_0x5d12('0x3c')][_0x5d12('0x3d')]()){case'contactmanager':break;case _0x5d12('0x3e'):case _0x5d12('0x3f'):var _0x21c148={};switch(barAndWebActions[_0x54a5d4['data1']]){case _0x5d12('0xd'):_0x21c148[_0x5d12('0x40')]=_0x54a5d4['data2'];_0x21c148[_0x5d12('0x41')]=this[_0x5d12('0x11')][_0x54a5d4[_0x5d12('0x42')]]?Mustache['render'](this[_0x5d12('0x11')][_0x54a5d4['data2']][_0x5d12('0x41')],_0x2d2405):'template\x20not\x20found';break;case'url':_0x21c148[_0x5d12('0x43')]=this[_0x5d12('0x44')](_0x54a5d4['data2'],_0x2d2405,_[_0x5d12('0x45')](_0x54a5d4['data3'])?!![]:parseInt(_0x54a5d4['data3'],0xa));if(_[_0x5d12('0x45')](_0x54a5d4[_0x5d12('0x46')])){_0x21c148['location']='0';}else{_0x21c148['uriLocation']=_0x54a5d4[_0x5d12('0x46')];_0x21c148[_0x5d12('0x47')]=_[_0x5d12('0x45')](_0x54a5d4[_0x5d12('0x48')])?_0x5d12('0x49'):_0x54a5d4['data5'];_0x21c148[_0x5d12('0x4a')]=_[_0x5d12('0x45')](_0x54a5d4[_0x5d12('0x4b')])?_0x5d12('0x4c'):_0x54a5d4[_0x5d12('0x4b')];}break;case _0x5d12('0xe'):_0x21c148[_0x5d12('0x4d')]=_0x54a5d4[_0x5d12('0x42')]?Mustache['render'](_0x54a5d4[_0x5d12('0x42')],_0x2d2405):'';_0x21c148[_0x5d12('0x4e')]=_0x54a5d4['data3']?Mustache[_0x5d12('0x4f')](_0x54a5d4['data3'],_0x2d2405):'';break;}this[_0x5d12('0x2f')](util[_0x5d12('0x50')](_0x5d12('0x51'),this['agents'][_0x2d2405[_0x5d12('0x3b')]][_0x5d12('0x52')]),util[_0x5d12('0x50')](_0x5d12('0x53'),_0x54a5d4['action'][_0x5d12('0x3d')](),barAndWebActions[_0x54a5d4[_0x5d12('0x54')]]),_[_0x5d12('0x38')](_0x21c148,_0x2d2405));break;case'jscripty':this[_0x5d12('0x2f')](util[_0x5d12('0x50')](_0x5d12('0x51'),this[_0x5d12('0x10')][_0x2d2405[_0x5d12('0x3b')]][_0x5d12('0x52')]),util[_0x5d12('0x50')](_0x5d12('0x55'),_0x54a5d4[_0x5d12('0x3c')][_0x5d12('0x3d')]()),_[_0x5d12('0x38')]({'ProjectId':parseInt(_0x54a5d4[_0x5d12('0x54')],0xa)},_0x2d2405));break;default:this['emit'](util[_0x5d12('0x50')](_0x5d12('0x51'),this['agents'][_0x2d2405[_0x5d12('0x3b')]][_0x5d12('0x52')]),util[_0x5d12('0x50')](_0x5d12('0x55'),_0x54a5d4[_0x5d12('0x3c')][_0x5d12('0x3d')]()),_['merge']({},_0x54a5d4,_0x2d2405));}}switch(_0x54a5d4[_0x5d12('0x3c')]['toLowerCase']()){case _0x5d12('0x56'):cmContact[_0x5d12('0x57')](this[_0x5d12('0x10')][_0x2d2405[_0x5d12('0x3b')]],this[_0x5d12('0xf')][_0x1c918d],_0x54a5d4,_0x2d2405);break;case'integration':integration[_0x5d12('0x57')](_0x54a5d4,_0x2d2405,this[_0x5d12('0x58')],this[_0x5d12('0x10')][_0x2d2405['interface']],this[_0x5d12('0x59')][_0x2d2405[_0x5d12('0x5a')]],this['voiceExtensions'][_0x2d2405[_0x5d12('0x5b')]]);break;case'urlforward':urlforward['exec'](_0x54a5d4,_0x2d2405);break;case _0x5d12('0x5c'):script[_0x5d12('0x57')](_0x54a5d4,_0x2d2405);break;}}}}}}};Trigger[_0x5d12('0x2e')][_0x5d12('0x44')]=function(_0x7c5a20,_0x38e617,_0x41dd16){var _0x5eb3e9=url['parse'](Mustache[_0x5d12('0x4f')](_0x7c5a20,_0x38e617),!![]);if(_0x41dd16){_[_0x5d12('0x38')](_0x5eb3e9[_0x5d12('0x5d')],_0x38e617);}delete _0x5eb3e9[_0x5d12('0x5e')];var _0x52fa88=url[_0x5d12('0x50')](_0x5eb3e9);_0x52fa88=_0x52fa88[_0x5d12('0x5f')](/\/\?/g,'?');return _0x52fa88;};Trigger['prototype'][_0x5d12('0x37')]=function(_0x5ba291,_0x57e123){var _0x4cc356=!![];var _0xd8953c=!![];var _0x224ba4=![];if(_0x5ba291[_0x5d12('0x60')]===_0x57e123[_0x5d12('0x32')]){_0x224ba4=!![];}if(_0x5ba291[_0x5d12('0x61')][_0x5d12('0x3a')]){_0x4cc356=_[_0x5d12('0x62')](_0x5ba291[_0x5d12('0x61')],this[_0x5d12('0x63')](_0x57e123,_0x5ba291[_0x5d12('0x60')]));}if(_0x5ba291[_0x5d12('0x64')]['length']){_0xd8953c=_[_0x5d12('0x65')](_0x5ba291[_0x5d12('0x64')],this[_0x5d12('0x63')](_0x57e123,_0x5ba291['channel']));}return _0x224ba4&&_0x4cc356&&_0xd8953c;};Trigger[_0x5d12('0x2e')][_0x5d12('0x63')]=function(_0x35ac5d,_0x2969cc){return function(_0x5bc5cb){switch(_0x5bc5cb['field']){case _0x5d12('0x66'):if(_0x35ac5d[_0x5d12('0x60')]===_0x2969cc){if(_0x2969cc===_0x5d12('0x67')){return _0x35ac5d[_0x5d12('0x68')]?operators[_0x5bc5cb[_0x5d12('0x69')]](Number(_0x5bc5cb['value']),_0x35ac5d[_0x5d12('0x68')]):![];}else{return _0x35ac5d[_[_0x5d12('0x6a')](_0x2969cc)+_0x5d12('0x6b')]?operators[_0x5bc5cb['operator']](Number(_0x5bc5cb[_0x5d12('0x6c')]),_0x35ac5d[_[_0x5d12('0x6a')](_0x2969cc)+_0x5d12('0x6b')]):![];}}break;case _0x5d12('0x6d'):case _0x5d12('0x6e'):if(_0x35ac5d[_0x5d12('0x60')]===_0x2969cc){return _0x35ac5d['event']?operators[_0x5bc5cb[_0x5d12('0x69')]](_0x5bc5cb[_0x5d12('0x6c')],_0x35ac5d[_0x5d12('0x6f')]):![];}break;case _0x5d12('0x5a'):return _0x35ac5d[_0x5d12('0x5a')]?operators[_0x5bc5cb[_0x5d12('0x69')]](_0x5bc5cb[_0x5d12('0x6c')],_0x35ac5d['queue']):![];case _0x5d12('0x70'):return _0x35ac5d[_0x5d12('0x71')]?operators[_0x5bc5cb[_0x5d12('0x69')]](_0x5bc5cb['value'],_0x35ac5d[_0x5d12('0x71')]):![];case _0x5d12('0x72'):return _0x35ac5d[_0x5d12('0x72')]?operators[_0x5bc5cb[_0x5d12('0x69')]](_0x5bc5cb[_0x5d12('0x6c')],_0x35ac5d['lastevent']):![];case _0x5d12('0x5b'):return _0x35ac5d['routeId']?operators[_0x5bc5cb['operator']](_0x5bc5cb[_0x5d12('0x6c')],_0x35ac5d[_0x5d12('0x5b')]):![];}return![];};};module[_0x5d12('0x73')]=Trigger;
\ No newline at end of file
index f789f5e..d619d44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','custom_fields','variable','variableName','idField','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','recordingURL','The\x20User\x20ID\x20is:','destcalleridnum','Ticket\x20created!','[OUTBOUND]','unmanaged','lastevent','Recording\x20is\x20enabled!','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','remoteUri','total_entries','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','%s/users/me','debug','stringify','authType','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x5fc3,0xa8));var _0x35fc=function(_0x27e811,_0x20137c){_0x27e811=_0x27e811-0x0;var _0x1627fa=_0x5fc3[_0x27e811];return _0x1627fa;};'use strict';var _=require(_0x35fc('0x0'));var rp=require(_0x35fc('0x1'));var md5=require('md5');var util=require(_0x35fc('0x2'));var Redis=require(_0x35fc('0x3'));var intUtil=require(_0x35fc('0x4'));var config=require(_0x35fc('0x5'));var logger=require(_0x35fc('0x6'))('desk');config[_0x35fc('0x7')]=_[_0x35fc('0x8')](config[_0x35fc('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x35fc('0x7')]));function emit(_0x508b32,_0x16e153,_0x27524f){io['to'](_0x508b32)[_0x35fc('0x9')](_0x16e153,_0x27524f);}var headers={'Content-Type':_0x35fc('0xa'),'Accept':_0x35fc('0xa')};function getUser(_0xf9d3a6,_0x2051ab){if(intUtil['validateEmail'](_0x2051ab)===!![]){logger[_0x35fc('0xb')](_0x35fc('0xc'),_0x2051ab);return request({'uri':util['format'](_0x35fc('0xd'),_0xf9d3a6[_0x35fc('0xe')])})['then'](function(_0xda83fb){if(_0xda83fb[_0x35fc('0xf')]){return _['find'](_0xda83fb['_embedded'][_0x35fc('0x10')],{'email':_0x2051ab});}})['then'](function(_0x397738){if(_0x397738){logger[_0x35fc('0xb')](_0x35fc('0x11'));return _0x397738;}else{logger[_0x35fc('0xb')](_0x35fc('0x12'));return request({'uri':util['format']('%s/users/me',_0xf9d3a6['remoteUri'])});}});}else{logger['info'](_0x35fc('0x13'));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x15'),_0xf9d3a6[_0x35fc('0xe')])});}}function request(_0x227a49){logger[_0x35fc('0x16')]('[HTTP]',JSON[_0x35fc('0x17')](_0x227a49));return rp(_[_0x35fc('0x8')](_0x227a49,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x41e165){var _0x363e47;if(_0x41e165[_0x35fc('0x18')]==='basic'){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x19'),_0x41e165[_0x35fc('0x1a')],_0x41e165['password']);}else if(_0x41e165[_0x35fc('0x18')]===_0x35fc('0x1b')){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x1c'),_0x41e165[_0x35fc('0x1a')],_0x41e165[_0x35fc('0x1b')]);}return util[_0x35fc('0x14')](_0x35fc('0x1d'),new Buffer(_0x363e47)[_0x35fc('0x1e')](_0x35fc('0x1f')));}function getEndUser(_0x5bd2b8,_0x323aee,_0xd5399f){logger[_0x35fc('0xb')](_0x35fc('0x20'),_0xd5399f);return request({'uri':util[_0x35fc('0x14')]('%s/customers/search',_0x5bd2b8[_0x35fc('0xe')]),'qs':{'phone':_0xd5399f}})[_0x35fc('0x21')](function(_0x561bf8){if(_0x561bf8[_0x35fc('0xf')]){logger[_0x35fc('0xb')](_0x35fc('0x22'));return _0x561bf8['_embedded'][_0x35fc('0x10')][0x0];}else{logger['info'](_0x35fc('0x23'));return request({'uri':util[_0x35fc('0x14')]('%s/customers',_0x5bd2b8['remoteUri']),'method':_0x35fc('0x24'),'body':{'first_name':_0x323aee,'title':_0x323aee,'phone_numbers':[{'type':'work','value':_0xd5399f}]}});}});}function getTags(_0x274208,_0x1a5d92){var _0x57001c=[];if(_0x274208&&_0x274208[_0x35fc('0x25')]>0x0){_0x57001c=_[_0x35fc('0x26')](_0x274208,_0x1a5d92);}return _0x57001c;}function getCustomFields(_0x383837,_0x9f3c8a){var _0x3735da=[];var _0x134dfa={'custom_fields':{}};if(_0x383837[_0x35fc('0x25')]>0x0){_[_0x35fc('0x27')](_0x383837,function(_0x54aedc){if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc['type'])&&_0x54aedc[_0x35fc('0x2b')]&&!_0x54aedc[_0x35fc('0x2c')]){_0x134dfa[_0x54aedc[_0x35fc('0x2b')][_0x35fc('0x2d')]()]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc[_0x35fc('0x2f')])&&_0x54aedc['idField']&&_0x54aedc['customField']){_0x134dfa[_0x35fc('0x30')][_0x54aedc['idField']]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_0x54aedc[_0x35fc('0x2f')]===_0x35fc('0x31')&&_0x54aedc[_0x35fc('0x32')]&&_0x54aedc[_0x35fc('0x33')]&&_0x54aedc['customField']){_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]][_0x35fc('0x1e')]());}else if(_0x54aedc[_0x35fc('0x2f')]==='customVariable'&&_0x54aedc[_0x35fc('0x34')]&&_0x54aedc[_0x35fc('0x34')][_0x35fc('0x35')]&&_0x54aedc['idField']&&_0x54aedc[_0x35fc('0x2c')]){_0x9f3c8a[_0x54aedc['Variable'][_0x35fc('0x35')][_0x35fc('0x2d')]()]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc['Variable']['name']['toLowerCase']()][_0x35fc('0x1e')]());}});}if(_0x134dfa['priority']){_0x134dfa[_0x35fc('0x36')]=Number(_0x134dfa['priority']);}return _0x134dfa;}function getTicket(_0x9c6b65,_0x1f2d66,_0x2ca9ac,_0x22b724,_0x1c10e0){logger[_0x35fc('0xb')](_0x35fc('0x37'));var _0x4ec0dc=_[_0x35fc('0x38')]({'subject':intUtil[_0x35fc('0x39')](_0x22b724['Subjects'],_0x1c10e0,'\x20'),'type':_0x35fc('0x3a'),'status':_0x35fc('0x3b'),'labels':[_0x35fc('0x3c'),_0x35fc('0x3d'),_0x35fc('0x3e')][_0x35fc('0x3f')](getTags(_0x22b724['Tags'],_0x35fc('0x35'))),'description':intUtil[_0x35fc('0x39')](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x35fc('0x41'),_0x1f2d66['id']),'class':_0x35fc('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a')}},getCustomFields(_0x22b724[_0x35fc('0x43')],_0x1c10e0));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x44'),_0x9c6b65[_0x35fc('0xe')],_0x2ca9ac['id']),'method':_0x35fc('0x24'),'body':_0x4ec0dc});}exports[_0x35fc('0x45')]=function(_0x3ec51f,_0x5a7e9e,_0x596e83,_0x210d5d,_0x36fcf9,_0x4fdc6d){var _0x5c2e5c,_0x4ff202;_0x4fdc6d[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x4fdc6d['remoteUri']);_0x4fdc6d[_0x35fc('0x47')]=intUtil[_0x35fc('0x46')](_0x4fdc6d[_0x35fc('0x47')]);if(_0x36fcf9&&_0x36fcf9[_0x35fc('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a7e9e['recordingURL']=util['format'](_0x35fc('0x49'),_0x4fdc6d[_0x35fc('0x47')],_0x5a7e9e['uniqueid'],md5(_0x5a7e9e[_0x35fc('0x4a')]));}else{_0x5a7e9e['recordingURL']='';}headers[_0x35fc('0x4b')]=getAuth(_0x4fdc6d);return getUser(_0x4fdc6d,_0x210d5d[_0x35fc('0x4c')])[_0x35fc('0x21')](function(_0x2de5d1){_0x5c2e5c=_0x2de5d1;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x5c2e5c['id']);return getEndUser(_0x4fdc6d,_0x5a7e9e[_0x35fc('0x4d')],_0x5a7e9e[_0x35fc('0x4e')]);})['then'](function(_0x18181b){_0x4ff202=_0x18181b;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x4ff202['id']);return getTicket(_0x4fdc6d,_0x5c2e5c,_0x4ff202,_0x596e83,_0x5a7e9e);})[_0x35fc('0x21')](function(_0x5bc8c3){if(_0x5bc8c3){logger[_0x35fc('0xb')]('Ticket\x20created!');logger['info'](_0x35fc('0x50'),_0x5bc8c3['id']);switch(_0x4fdc6d[_0x35fc('0x2f')]){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x53'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d['name']),_0x35fc('0x55'),{'recordId':_0x5bc8c3['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d[_0x35fc('0x35')]),_0x35fc('0x58'),{'uri':util[_0x35fc('0x14')](_0x35fc('0x59'),_0x5bc8c3['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x52'),_0x35fc('0x5b'));}}})['catch'](function(_0x553ed6){console[_0x35fc('0x5a')](_0x553ed6);logger[_0x35fc('0x5a')](_0x35fc('0x52'),JSON[_0x35fc('0x17')](_0x553ed6));});};exports[_0x35fc('0x5c')]=function(_0x3e6494,_0x4a4798,_0x4f024c,_0x388521,_0x19b2ce,_0x395d63,_0x38bc78){var _0x5b2595,_0x467980;_0x395d63[_0x35fc('0xe')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0xe')]);_0x395d63[_0x35fc('0x47')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0x47')]);if(_0x38bc78&&_0x38bc78[_0x35fc('0x5d')]&&_0x38bc78[_0x35fc('0x5d')]!==_0x35fc('0x5e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4798[_0x35fc('0x5f')]=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x395d63[_0x35fc('0x47')],_0x4a4798[_0x35fc('0x4a')],md5(_0x4a4798[_0x35fc('0x4a')]));}headers[_0x35fc('0x4b')]=getAuth(_0x395d63);return getUser(_0x395d63,_0x388521[_0x35fc('0x4c')])['then'](function(_0x2d9d45){_0x5b2595=_0x2d9d45;logger[_0x35fc('0xb')](_0x35fc('0x60'),_0x5b2595['id']);return getEndUser(_0x395d63,_0x4a4798['destcalleridname'],_0x4a4798[_0x35fc('0x61')]);})[_0x35fc('0x21')](function(_0x47fb1a){_0x467980=_0x47fb1a;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x467980['id']);return getTicket(_0x395d63,_0x5b2595,_0x467980,_0x4f024c,_0x4a4798);})[_0x35fc('0x21')](function(_0x1c4c33){if(_0x1c4c33){logger[_0x35fc('0xb')](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x1c4c33['id']);switch(_0x395d63['type']){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:desk:display',{'recordId':_0x1c4c33['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x395d63[_0x35fc('0xe')],_0x1c4c33['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x63'),_0x35fc('0x5b'));}}})['catch'](function(_0x458eb8){logger[_0x35fc('0x5a')](_0x35fc('0x63'),JSON[_0x35fc('0x17')](_0x458eb8));});};exports[_0x35fc('0x64')]=function(_0x1d0e53,_0x27071b,_0x2127e0,_0x462ceb,_0x4c3ace,_0x35d7c8){var _0x47c75f,_0xfbd737;_0x35d7c8[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x35d7c8[_0x35fc('0xe')]);_0x35d7c8['serverUrl']=intUtil[_0x35fc('0x46')](_0x35d7c8['serverUrl']);if(_0x4c3ace&&_0x4c3ace['monitor_format']){logger['info']('['+_0x27071b[_0x35fc('0x65')]['toUpperCase']()+']',_0x35fc('0x66'));_0x27071b['recordingURL']=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d7c8[_0x35fc('0x47')],_0x27071b[_0x35fc('0x4a')],md5(_0x27071b[_0x35fc('0x4a')]));}else{_0x27071b[_0x35fc('0x5f')]='';}headers['Authorization']=getAuth(_0x35d7c8);return getUser(_0x35d7c8)[_0x35fc('0x21')](function(_0x1e2214){_0x47c75f=_0x1e2214;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x47c75f['id']);return getEndUser(_0x35d7c8,_0x27071b[_0x35fc('0x4d')],_0x27071b[_0x35fc('0x4e')]);})[_0x35fc('0x21')](function(_0x3c1b56){_0xfbd737=_0x3c1b56;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0xfbd737['id']);return getTicket(_0x35d7c8,_0x47c75f,_0xfbd737,_0x2127e0,_0x27071b);})[_0x35fc('0x21')](function(_0x4464d5){if(_0x4464d5){logger['info'](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x4464d5['id']);}})['catch'](function(_0x1c88d8){logger[_0x35fc('0x5a')]('['+_0x27071b['lastevent']['toUpperCase']()+']',JSON[_0x35fc('0x17')](_0x1c88d8));});};
\ No newline at end of file
+var _0x326f=['catch','stringify','unmanaged','lastevent','toUpperCase','lodash','util','ioredis','./util','../../../../config/environment','../../../../config/logger','desk','redis','defaults','localhost','validateEmail','info','Getting\x20agent\x20with\x20email','%s/users','then','total_entries','_embedded','entries','Agent\x20found!','format','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','debug','[HTTP]','GET','authType','basic','password','%s/token:%s','Basic\x20%s','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','work','map','length','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','custom_fields','toString','variable','variableName','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','getString','Subjects','xCALLY','concat','Descriptions','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','integrationTab','%s/agent/tickets/%s'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x326f,0xd1));var _0xf326=function(_0x1a6551,_0x22e7c3){_0x1a6551=_0x1a6551-0x0;var _0x5379d9=_0x326f[_0x1a6551];return _0x5379d9;};'use strict';var _=require(_0xf326('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xf326('0x1'));var Redis=require(_0xf326('0x2'));var intUtil=require(_0xf326('0x3'));var config=require(_0xf326('0x4'));var logger=require(_0xf326('0x5'))(_0xf326('0x6'));config[_0xf326('0x7')]=_[_0xf326('0x8')](config[_0xf326('0x7')],{'host':_0xf326('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf326('0x7')]));function emit(_0x3851eb,_0x165f95,_0x1e7b8a){io['to'](_0x3851eb)['emit'](_0x165f95,_0x1e7b8a);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getUser(_0x3bacf2,_0x1fc80e){if(intUtil[_0xf326('0xa')](_0x1fc80e)===!![]){logger[_0xf326('0xb')](_0xf326('0xc'),_0x1fc80e);return request({'uri':util['format'](_0xf326('0xd'),_0x3bacf2['remoteUri'])})[_0xf326('0xe')](function(_0x4aaf3a){if(_0x4aaf3a[_0xf326('0xf')]){return _['find'](_0x4aaf3a[_0xf326('0x10')][_0xf326('0x11')],{'email':_0x1fc80e});}})['then'](function(_0x342fe5){if(_0x342fe5){logger[_0xf326('0xb')](_0xf326('0x12'));return _0x342fe5;}else{logger[_0xf326('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xf326('0x13')]('%s/users/me',_0x3bacf2['remoteUri'])});}});}else{logger[_0xf326('0xb')](_0xf326('0x14'));return request({'uri':util[_0xf326('0x13')](_0xf326('0x15'),_0x3bacf2[_0xf326('0x16')])});}}function request(_0x287a2a){logger[_0xf326('0x17')](_0xf326('0x18'),JSON['stringify'](_0x287a2a));return rp(_[_0xf326('0x8')](_0x287a2a,{'method':_0xf326('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x18bee3){var _0x31ffb9;if(_0x18bee3[_0xf326('0x1a')]===_0xf326('0x1b')){_0x31ffb9=util['format']('%s:%s',_0x18bee3['username'],_0x18bee3[_0xf326('0x1c')]);}else if(_0x18bee3[_0xf326('0x1a')]==='token'){_0x31ffb9=util['format'](_0xf326('0x1d'),_0x18bee3['username'],_0x18bee3['token']);}return util[_0xf326('0x13')](_0xf326('0x1e'),new Buffer(_0x31ffb9)['toString']('base64'));}function getEndUser(_0x19b8ba,_0xb1efcf,_0x5f21a2){logger[_0xf326('0xb')](_0xf326('0x1f'),_0x5f21a2);return request({'uri':util[_0xf326('0x13')](_0xf326('0x20'),_0x19b8ba[_0xf326('0x16')]),'qs':{'phone':_0x5f21a2}})[_0xf326('0xe')](function(_0x5ce532){if(_0x5ce532['total_entries']){logger['info'](_0xf326('0x21'));return _0x5ce532[_0xf326('0x10')][_0xf326('0x11')][0x0];}else{logger[_0xf326('0xb')](_0xf326('0x22'));return request({'uri':util[_0xf326('0x13')]('%s/customers',_0x19b8ba[_0xf326('0x16')]),'method':_0xf326('0x23'),'body':{'first_name':_0xb1efcf,'title':_0xb1efcf,'phone_numbers':[{'type':_0xf326('0x24'),'value':_0x5f21a2}]}});}});}function getTags(_0x581531,_0x1617d2){var _0x55ad0f=[];if(_0x581531&&_0x581531['length']>0x0){_0x55ad0f=_[_0xf326('0x25')](_0x581531,_0x1617d2);}return _0x55ad0f;}function getCustomFields(_0x1ae23a,_0x2fa28e){var _0x5dbe63=[];var _0xc115d9={'custom_fields':{}};if(_0x1ae23a[_0xf326('0x26')]>0x0){_['forEach'](_0x1ae23a,function(_0x225776){if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776[_0xf326('0x2a')])&&_0x225776[_0xf326('0x2b')]&&!_0x225776[_0xf326('0x2c')]){_0xc115d9[_0x225776[_0xf326('0x2b')][_0xf326('0x2d')]()]=_0x225776[_0xf326('0x2e')]['toString']();}else if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776['type'])&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x225776['content'][_0xf326('0x31')]();}else if(_0x225776[_0xf326('0x2a')]===_0xf326('0x32')&&_0x225776[_0xf326('0x33')]&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776[_0xf326('0x33')]]&&(_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x2fa28e[_0x225776[_0xf326('0x33')]][_0xf326('0x31')]());}else if(_0x225776['type']===_0xf326('0x34')&&_0x225776['Variable']&&_0x225776[_0xf326('0x35')]['name']&&_0x225776['idField']&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776['Variable'][_0xf326('0x36')]['toLowerCase']()]&&(_0xc115d9[_0xf326('0x30')][_0x225776[_0xf326('0x2f')]]=_0x2fa28e[_0x225776[_0xf326('0x35')]['name'][_0xf326('0x2d')]()][_0xf326('0x31')]());}});}if(_0xc115d9['priority']){_0xc115d9[_0xf326('0x37')]=Number(_0xc115d9[_0xf326('0x37')]);}return _0xc115d9;}function getTicket(_0x40fa7a,_0xaf65e0,_0x51076c,_0x2c4416,_0xb1ef35){logger[_0xf326('0xb')](_0xf326('0x38'));var _0x1d88ed=_['merge']({'subject':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3a')],_0xb1ef35,'\x20'),'type':'phone','status':'new','labels':[_0xf326('0x3b'),'Motion','CTI'][_0xf326('0x3c')](getTags(_0x2c4416['Tags'],_0xf326('0x36'))),'description':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a'),'_links':{'assigned_user':{'href':util[_0xf326('0x13')]('/api/v2/users/%d',_0xaf65e0['id']),'class':_0xf326('0x3e')}},'message':{'direction':'in','body':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a')}},getCustomFields(_0x2c4416[_0xf326('0x3f')],_0xb1ef35));return request({'uri':util[_0xf326('0x13')](_0xf326('0x40'),_0x40fa7a[_0xf326('0x16')],_0x51076c['id']),'method':_0xf326('0x23'),'body':_0x1d88ed});}exports[_0xf326('0x41')]=function(_0x1227d3,_0x361776,_0x2bab13,_0x50d63f,_0x1b6126,_0x1637dc){var _0x2ed1a7,_0x270288;_0x1637dc[_0xf326('0x16')]=intUtil[_0xf326('0x42')](_0x1637dc['remoteUri']);_0x1637dc[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x1637dc['serverUrl']);if(_0x1b6126&&_0x1b6126[_0xf326('0x44')]){logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x46'));_0x361776[_0xf326('0x47')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1637dc[_0xf326('0x43')],_0x361776[_0xf326('0x48')],md5(_0x361776['uniqueid']));}else{_0x361776['recordingURL']='';}headers[_0xf326('0x49')]=getAuth(_0x1637dc);return getUser(_0x1637dc,_0x50d63f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x5b3705){_0x2ed1a7=_0x5b3705;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2ed1a7['id']);return getEndUser(_0x1637dc,_0x361776[_0xf326('0x4c')],_0x361776[_0xf326('0x4d')]);})[_0xf326('0xe')](function(_0x2d9bba){_0x270288=_0x2d9bba;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x270288['id']);return getTicket(_0x1637dc,_0x2ed1a7,_0x270288,_0x2bab13,_0x361776);})[_0xf326('0xe')](function(_0x27ced1){if(_0x27ced1){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x27ced1['id']);switch(_0x1637dc[_0xf326('0x2a')]){case'integrationTab':logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x51'));emit(util[_0xf326('0x13')]('user:%s',_0x50d63f[_0xf326('0x36')]),_0xf326('0x52'),{'recordId':_0x27ced1['id']});break;case _0xf326('0x53'):logger[_0xf326('0xb')]('[QUEUE]',_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x50d63f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x27ced1['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x45'),_0xf326('0x58'));}}})['catch'](function(_0x102fba){console[_0xf326('0x57')](_0x102fba);logger[_0xf326('0x57')]('[QUEUE]',JSON['stringify'](_0x102fba));});};exports[_0xf326('0x59')]=function(_0x5b4832,_0x1cf58f,_0x554277,_0x458e5f,_0x7ee57,_0x28c959,_0x25e091){var _0x212594,_0x35d3c8;_0x28c959[_0xf326('0x16')]=intUtil['stripTrailingSlash'](_0x28c959[_0xf326('0x16')]);_0x28c959[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28c959['serverUrl']);if(_0x25e091&&_0x25e091[_0xf326('0x5a')]&&_0x25e091[_0xf326('0x5a')]!==_0xf326('0x5b')){logger[_0xf326('0xb')](_0xf326('0x5c'),'Recording\x20is\x20enabled!');_0x1cf58f[_0xf326('0x47')]=util[_0xf326('0x13')](_0xf326('0x5d'),_0x28c959[_0xf326('0x43')],_0x1cf58f['uniqueid'],md5(_0x1cf58f[_0xf326('0x48')]));}headers[_0xf326('0x49')]=getAuth(_0x28c959);return getUser(_0x28c959,_0x458e5f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x4d3b9e){_0x212594=_0x4d3b9e;logger['info'](_0xf326('0x4b'),_0x212594['id']);return getEndUser(_0x28c959,_0x1cf58f[_0xf326('0x5e')],_0x1cf58f['destcalleridnum']);})[_0xf326('0xe')](function(_0x29de71){_0x35d3c8=_0x29de71;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x35d3c8['id']);return getTicket(_0x28c959,_0x212594,_0x35d3c8,_0x554277,_0x1cf58f);})['then'](function(_0xb1c18c){if(_0xb1c18c){logger['info']('Ticket\x20created!');logger[_0xf326('0xb')]('The\x20Ticket\x20ID\x20is:',_0xb1c18c['id']);switch(_0x28c959[_0xf326('0x2a')]){case _0xf326('0x5f'):logger[_0xf326('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),'trigger:desk:display',{'recordId':_0xb1c18c['id']});break;case _0xf326('0x53'):logger['info'](_0xf326('0x45'),_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util[_0xf326('0x13')](_0xf326('0x60'),_0x28c959[_0xf326('0x16')],_0xb1c18c['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x5c'),_0xf326('0x58'));}}})[_0xf326('0x61')](function(_0x4ca1b8){logger[_0xf326('0x57')]('[OUTBOUND]',JSON[_0xf326('0x62')](_0x4ca1b8));});};exports[_0xf326('0x63')]=function(_0x5e858d,_0x2b770c,_0x5283da,_0x3255b2,_0xd55246,_0x28f3cb){var _0x2d45c9,_0x31b6dd;_0x28f3cb['remoteUri']=intUtil['stripTrailingSlash'](_0x28f3cb[_0xf326('0x16')]);_0x28f3cb[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28f3cb[_0xf326('0x43')]);if(_0xd55246&&_0xd55246[_0xf326('0x44')]){logger['info']('['+_0x2b770c[_0xf326('0x64')][_0xf326('0x65')]()+']','Recording\x20is\x20enabled!');_0x2b770c['recordingURL']=util['format'](_0xf326('0x5d'),_0x28f3cb[_0xf326('0x43')],_0x2b770c[_0xf326('0x48')],md5(_0x2b770c[_0xf326('0x48')]));}else{_0x2b770c[_0xf326('0x47')]='';}headers[_0xf326('0x49')]=getAuth(_0x28f3cb);return getUser(_0x28f3cb)[_0xf326('0xe')](function(_0x4b9013){_0x2d45c9=_0x4b9013;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2d45c9['id']);return getEndUser(_0x28f3cb,_0x2b770c[_0xf326('0x4c')],_0x2b770c[_0xf326('0x4d')]);})['then'](function(_0x3717fe){_0x31b6dd=_0x3717fe;logger['info']('The\x20Enduser\x20ID\x20is:',_0x31b6dd['id']);return getTicket(_0x28f3cb,_0x2d45c9,_0x31b6dd,_0x5283da,_0x2b770c);})[_0xf326('0xe')](function(_0x540fa0){if(_0x540fa0){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x540fa0['id']);}})[_0xf326('0x61')](function(_0x541491){logger['error']('['+_0x2b770c['lastevent'][_0xf326('0x65')]()+']',JSON[_0xf326('0x62')](_0x541491));});};
\ No newline at end of file
index 4d9d5c1..f4fe696 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe799=['validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','Bearer\x20','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','%2b','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','includes','picklist','nameField','customField','indexOf','content','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','ticketType','callDirection','queue','headers','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','remoteUri','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','./util','ioredis','../../../../config/logger','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','username','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xe799,0x11c));var _0x9e79=function(_0x21bd5e,_0x3d2bc6){_0x21bd5e=_0x21bd5e-0x0;var _0x4b500d=_0xe799[_0x21bd5e];return _0x4b500d;};'use strict';var _=require(_0x9e79('0x0'));var BPromise=require(_0x9e79('0x1'));var rp=require(_0x9e79('0x2'));var util=require(_0x9e79('0x3'));var intUtil=require(_0x9e79('0x4'));var md5=require('md5');var Redis=require(_0x9e79('0x5'));var logger=require(_0x9e79('0x6'))('dynamics365');var config=require(_0x9e79('0x7'));config[_0x9e79('0x8')]=_[_0x9e79('0x9')](config[_0x9e79('0x8')],{'host':_0x9e79('0xa'),'port':0x18eb});var io=require(_0x9e79('0xb'))(new Redis(config[_0x9e79('0x8')]));function getAuthToken(_0x10d6a2,_0x4a3eaa,_0x4093f7){var _0x5d34f8={'method':_0x9e79('0xc'),'uri':_0x4a3eaa,'form':{'client_id':_0x10d6a2[_0x9e79('0xd')],'resource':_0x10d6a2['remoteUri'],'username':_0x10d6a2[_0x9e79('0xe')],'password':_0x10d6a2[_0x9e79('0xf')],'grant_type':_0x9e79('0xf'),'client_secret':_0x10d6a2[_0x9e79('0x10')]},'json':!![]};return rp(_0x5d34f8)[_0x9e79('0x11')](function(_0x5e4158){return _0x5e4158[_0x9e79('0x12')];})[_0x9e79('0x13')](function(_0x9acf14){logger[_0x9e79('0x14')]('['+[_0x4093f7[_0x9e79('0x15')]()]+_0x9e79('0x16'));return _0x9acf14[_0x9e79('0x17')];});}function getUser(_0x2a8f66,_0x37ea46,_0x201474,_0x1980b6,_0x326692,_0x4ad49a){return new BPromise(function(_0x4eddc0,_0x34b388){return getAuthToken(_0x37ea46,_0x1980b6,_0x4ad49a)[_0x9e79('0x11')](function(_0x4e8f6d){var _0x59f57e={'method':_0x9e79('0x18'),'uri':_0x326692+_0x9e79('0x19'),'headers':{'Authorization':'Bearer\x20'+_0x4e8f6d,'OData-Version':_0x9e79('0x1a')},'json':!![]};return rp(_0x59f57e);})[_0x9e79('0x11')](function(_0xb8dc5d){var _0x2e145d=_0xb8dc5d[_0x9e79('0x1b')];var _0x316eb4=![];var _0x17a970=null;if(!_['isNil'](_0x201474)){if(intUtil[_0x9e79('0x1c')](_0x201474[_0x9e79('0x1d')])){_0x2a8f66[_0x9e79('0x1e')]=_0x201474[_0x9e79('0x1d')];for(_0x17a970=0x0;_0x17a970<_0x2e145d[_0x9e79('0x1f')];_0x17a970++){if(_0x2e145d[_0x17a970][_0x9e79('0x20')]===_0x201474[_0x9e79('0x1d')]&&!_0x2e145d[_0x17a970][_0x9e79('0x21')]){_0x316eb4=!![];logger[_0x9e79('0x22')]('['+[_0x4ad49a[_0x9e79('0x15')]()]+_0x9e79('0x23')+_0x2e145d[_0x17a970][_0x9e79('0x24')]+'!');_0x2a8f66['userId']=_0x2e145d[_0x17a970][_0x9e79('0x24')];}}}}if(!_0x316eb4){logger[_0x9e79('0x22')]('['+[_0x4ad49a[_0x9e79('0x15')]()]+_0x9e79('0x25'));_0x2a8f66[_0x9e79('0x1e')]=_0x37ea46[_0x9e79('0xe')];for(_0x17a970=0x0;_0x17a970<_0x2e145d[_0x9e79('0x1f')];_0x17a970++){if(_0x2e145d[_0x17a970][_0x9e79('0x20')]===_0x37ea46['username']){_0x2a8f66[_0x9e79('0x26')]=_0x2e145d[_0x17a970]['systemuserid'];}}}_0x4eddc0(_0x2a8f66);})['catch'](function(_0x59f32a){_0x34b388(_0x59f32a[_0x9e79('0x17')]);});});}function createEndUser(_0x4c5f69,_0x290b3e,_0x4e89f6,_0x165d82,_0x497669,_0x4f657a){return new BPromise(function(_0x19c6ed,_0x1bd18d){return getAuthToken(_0x290b3e,_0x4e89f6,_0x4f657a)[_0x9e79('0x11')](function(_0x1ae332){var _0x20ffc5=_0x4f657a[_0x9e79('0x27')]()===_0x9e79('0x28')?_0x497669[_0x9e79('0x29')]:_0x497669[_0x9e79('0x2a')];var _0x43a4d7={'method':_0x9e79('0xc'),'uri':_0x165d82+_0x9e79('0x2b'),'body':{'telephone1':_0x20ffc5,'fullname':_0x20ffc5,'firstname':_0x20ffc5,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x9e79('0x2c')+_0x4c5f69[_0x9e79('0x26')]+')'},'headers':{'Authorization':_0x9e79('0x2d')+_0x1ae332,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x43a4d7);})['then'](function(_0x3e9a1a){var _0x25563f=_0x3e9a1a['headers'][_0x9e79('0x2e')];var _0xa67cf=_0x25563f[_0x9e79('0x2f')](_0x25563f[_0x9e79('0x30')]('(')+0x1,_0x25563f[_0x9e79('0x30')](')'));_0x4c5f69[_0x9e79('0x31')]=_0xa67cf;_0x19c6ed(_0x4c5f69);})[_0x9e79('0x13')](function(_0x5cf216){_0x1bd18d(_0x5cf216['message']);});});}function getEndUser(_0x43f1d0,_0x32474f,_0x56a2d4,_0x4300b4,_0x24eb51,_0x567ef9){return new BPromise(function(_0x21843b,_0x51fa76){var _0x1deaae=_0x567ef9[_0x9e79('0x27')]()===_0x9e79('0x28')?_0x24eb51['destcalleridnum']:_0x24eb51['calleridnum'];return getAuthToken(_0x32474f,_0x56a2d4,_0x567ef9)['then'](function(_0x1678b4){var _0x5e404b={'method':'GET','uri':_0x4300b4+_0x9e79('0x32')+_0x1deaae['replace']('+',_0x9e79('0x33'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x1678b4,'If-None-Match':null,'OData-Version':_0x9e79('0x1a')},'json':!![]};return rp(_0x5e404b);})[_0x9e79('0x11')](function(_0xdb8016){var _0x376914=null;if(_0xdb8016){var _0x5e652e=_0xdb8016[_0x9e79('0x1b')];var _0x2f1cfb=![];for(_0x376914=0x0;_0x376914<_0x5e652e[_0x9e79('0x1f')];_0x376914++){if(_0x5e652e[_0x376914][_0x9e79('0x34')]===_0x1deaae){_0x2f1cfb=!![];_0x43f1d0[_0x9e79('0x31')]=_0x5e652e[_0x376914][_0x9e79('0x35')];}}if(_0x2f1cfb){_0x21843b(_0x43f1d0);}else{return createEndUser(_0x43f1d0,_0x32474f,_0x56a2d4,_0x4300b4,_0x24eb51,_0x567ef9)['then'](function(_0x582fd9){logger[_0x9e79('0x22')]('['+[_0x567ef9[_0x9e79('0x15')]()]+_0x9e79('0x36'),_0x582fd9[_0x9e79('0x31')]);_0x21843b(_0x582fd9);});}}else{return createEndUser(_0x43f1d0,_0x32474f,_0x56a2d4,_0x4300b4,_0x24eb51,_0x567ef9)[_0x9e79('0x11')](function(_0xcda90){logger[_0x9e79('0x22')]('['+[_0x567ef9[_0x9e79('0x15')]()]+_0x9e79('0x37'),_0xcda90[_0x9e79('0x31')]);_0x21843b(_0xcda90);});}});});}function getCustomFields(_0x296b00,_0x10b32d,_0x3d7533){var _0x910be5={};if(_0x296b00['length']>0x0){_['forEach'](_0x296b00,function(_0x532e22){if(_[_0x9e79('0x38')](['string',_0x9e79('0x39')],_0x532e22['type'])&&_0x532e22[_0x9e79('0x3a')]&&!_0x532e22[_0x9e79('0x3b')]){var _0x1478ee=_0x532e22['idField'][_0x9e79('0x27')]();var _0x58b6da=_0x1478ee['substring'](0x0,_0x1478ee[_0x9e79('0x3c')]('_'));var _0x4d8d3b=_0x1478ee[_0x9e79('0x2f')](_0x1478ee[_0x9e79('0x3c')]('_')+0x1);if(_0x58b6da===_0x3d7533){_0x910be5[_0x4d8d3b]=_0x532e22[_0x9e79('0x3d')];}}});}return _0x910be5;}function getTicket(_0x42a97f,_0x23615e,_0x346f81,_0x173178,_0x2c8939,_0x52a445,_0x20fbc7){return new BPromise(function(_0x54b3cc,_0x10e23b){var _0x450a0c;return getAuthToken(_0x23615e,_0x346f81,_0x20fbc7)[_0x9e79('0x11')](function(_0x5ef6ba){if(_0x52a445['ticketType']===_0x9e79('0x3e')){_0x450a0c={'method':_0x9e79('0xc'),'uri':_0x173178+_0x9e79('0x3f'),'body':Object[_0x9e79('0x40')]({},{'title':intUtil[_0x9e79('0x41')](_0x52a445[_0x9e79('0x42')],_0x2c8939,'\x20'),'description':intUtil[_0x9e79('0x41')](_0x52a445[_0x9e79('0x43')],_0x2c8939,'\x0a'),'customerid_contact@odata.bind':_0x9e79('0x44')+_0x42a97f[_0x9e79('0x31')]+')','ownerid@odata.bind':_0x9e79('0x2c')+_0x42a97f[_0x9e79('0x26')]+')','caseorigincode':'1'},getCustomFields(_0x52a445[_0x9e79('0x45')],_0x2c8939,_0x52a445[_0x9e79('0x46')])),'headers':{'Authorization':_0x9e79('0x2d')+_0x5ef6ba,'OData-Version':_0x9e79('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x52a445[_0x9e79('0x46')]==='phonecall'){_0x450a0c={'method':_0x9e79('0xc'),'uri':_0x173178+'phonecalls','body':Object[_0x9e79('0x40')]({},{'subject':intUtil[_0x9e79('0x41')](_0x52a445[_0x9e79('0x42')],_0x2c8939,'\x20'),'phonenumber':String(_0x2c8939[_0x9e79('0x2a')]),'description':intUtil[_0x9e79('0x41')](_0x52a445[_0x9e79('0x43')],_0x2c8939,'\x0a'),'regardingobjectid_contact@odata.bind':_0x9e79('0x44')+_0x42a97f[_0x9e79('0x31')]+')','ownerid@odata.bind':_0x9e79('0x2c')+_0x42a97f[_0x9e79('0x26')]+')','directioncode':_0x42a97f[_0x9e79('0x47')]===_0x9e79('0x48')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x9e79('0x2c')+_0x42a97f[_0x9e79('0x26')]+')','participationtypemask':_0x42a97f[_0x9e79('0x47')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x9e79('0x44')+_0x42a97f[_0x9e79('0x31')]+')','participationtypemask':_0x42a97f[_0x9e79('0x47')]===_0x9e79('0x48')?0x1:0x2}]},getCustomFields(_0x52a445[_0x9e79('0x45')],_0x2c8939,_0x52a445[_0x9e79('0x46')])),'headers':{'Authorization':_0x9e79('0x2d')+_0x5ef6ba,'OData-Version':_0x9e79('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x450a0c);})[_0x9e79('0x11')](function(_0x2ec85f){var _0x137903=_0x2ec85f[_0x9e79('0x49')]['odata-entityid'];var _0x50a778=_0x137903['substring'](_0x137903[_0x9e79('0x30')]('(')+0x1,_0x137903['lastIndexOf'](')'));_0x42a97f[_0x9e79('0x4a')]=_0x50a778;_0x54b3cc(_0x42a97f);})['catch'](function(_0x59000f){_0x10e23b(_0x59000f[_0x9e79('0x17')]);});});}function emit(_0x1d0ba3,_0x7846a,_0x5e6eeb,_0x52d065){var _0xf62e05={'uri':util[_0x9e79('0x4b')](_0x9e79('0x4c'),_0x1d0ba3,_0x5e6eeb,_0x52d065)};io['to'](util[_0x9e79('0x4b')](_0x9e79('0x4d'),_0x7846a))[_0x9e79('0x4e')](_0x9e79('0x4f'),_0xf62e05);}exports['cs']=function(_0x229911,_0x1a71b7,_0x5e2ac7,_0x3ba211,_0x5b6312,_0x2e3a26,_0x35427f,_0x14b89c){var _0x1b4513={};_0x2e3a26['remoteUri']=intUtil[_0x9e79('0x50')](_0x2e3a26[_0x9e79('0x51')]);_0x2e3a26[_0x9e79('0x52')]=intUtil[_0x9e79('0x50')](_0x2e3a26[_0x9e79('0x52')]);_0x1b4513[_0x9e79('0x47')]=_0x14b89c==='queue'||_0x14b89c===_0x9e79('0x53')?'queue':_0x9e79('0x28');var _0x466b37=util[_0x9e79('0x4b')](_0x9e79('0x54'),_0x2e3a26['remoteUri']);var _0x1f31e9=util[_0x9e79('0x4b')](_0x9e79('0x55'),_0x2e3a26[_0x9e79('0x56')]);var _0x20f965=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2e3a26[_0x9e79('0x52')],_0x1a71b7[_0x9e79('0x57')],md5(_0x1a71b7[_0x9e79('0x57')]));if(_0x5b6312&&_0x5b6312[_0x9e79('0x58')]){logger['info'](_0x9e79('0x59'),_0x9e79('0x5a'));_0x1a71b7[_0x9e79('0x5b')]=_0x20f965;}else if(_0x35427f&&_0x35427f[_0x9e79('0x5c')]&&_0x35427f[_0x9e79('0x5c')]!==_0x9e79('0x5d')){logger[_0x9e79('0x22')](_0x9e79('0x5e'),'Recording\x20is\x20enabled!');_0x1a71b7[_0x9e79('0x5b')]=_0x20f965;}else{_0x1a71b7[_0x9e79('0x5b')]='';}return getUser(_0x1b4513,_0x2e3a26,_0x3ba211,_0x1f31e9,_0x466b37,_0x14b89c)['then'](function(_0x14fd3d){logger[_0x9e79('0x22')]('['+_0x14b89c['toUpperCase']()+_0x9e79('0x5f'),_0x14fd3d[_0x9e79('0x26')]);logger['info']('['+_0x14b89c[_0x9e79('0x15')]()+_0x9e79('0x60'),_0x14fd3d[_0x9e79('0x1e')]);return getEndUser(_0x14fd3d,_0x2e3a26,_0x1f31e9,_0x466b37,_0x1a71b7,_0x14b89c);})[_0x9e79('0x11')](function(_0x5e640f){logger['info']('['+_0x14b89c[_0x9e79('0x15')]()+_0x9e79('0x61'),_0x5e640f['enduserId']);logger['info']('['+_0x14b89c[_0x9e79('0x15')]()+_0x9e79('0x62'),_0x1a71b7['calleridnum']);return getTicket(_0x5e640f,_0x2e3a26,_0x1f31e9,_0x466b37,_0x1a71b7,_0x5e2ac7,_0x14b89c);})[_0x9e79('0x11')](function(_0x4c313e){logger['info'](util[_0x9e79('0x4b')]('['+_0x14b89c[_0x9e79('0x15')]()+_0x9e79('0x63'),_0x5e2ac7['ticketType'],_0x4c313e[_0x9e79('0x4a')]));logger[_0x9e79('0x22')](util['format']('['+_0x14b89c[_0x9e79('0x15')]()+']\x20Call\x20direction:\x20%s',_0x14b89c));if(_0x14b89c!=='unmanaged'){logger[_0x9e79('0x22')]('['+_0x14b89c[_0x9e79('0x15')]()+']',_0x9e79('0x64'));emit(_0x2e3a26[_0x9e79('0x51')],_0x3ba211[_0x9e79('0x65')],_0x5e2ac7[_0x9e79('0x46')],_0x4c313e['ticketId']);}})[_0x9e79('0x13')](function(_0x4560f5){logger['error']('['+_0x14b89c['toUpperCase']()+_0x9e79('0x66'),util[_0x9e79('0x67')](_0x4560f5,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x266c=['phonecalls','Descriptions','callDirection','queue','Fields','headers','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','localhost','clientId','remoteUri','password','clientSecret','then','access_token','catch','toUpperCase',']\x20Wrong\x20credentials!','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','isNil','validateEmail','email','userEmail','internalemailaddress','isdisabled','info','systemuserid','userId','username','length','message','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','odata-entityid','lastIndexOf','enduserId','GET','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','value','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','string','picklist','type','nameField','substring','indexOf','content','ticketType','incident','assign','getString','Subjects','/contacts(','phonecall','POST'];(function(_0x2145e6,_0x1ccb9d){var _0x43a73e=function(_0x4ccb8d){while(--_0x4ccb8d){_0x2145e6['push'](_0x2145e6['shift']());}};_0x43a73e(++_0x1ccb9d);}(_0x266c,0x1b5));var _0xc266=function(_0x27d9a5,_0x50475f){_0x27d9a5=_0x27d9a5-0x0;var _0x3aa437=_0x266c[_0x27d9a5];return _0x3aa437;};'use strict';var _=require(_0xc266('0x0'));var BPromise=require('bluebird');var rp=require('request-promise');var util=require(_0xc266('0x1'));var intUtil=require(_0xc266('0x2'));var md5=require(_0xc266('0x3'));var Redis=require(_0xc266('0x4'));var logger=require(_0xc266('0x5'))(_0xc266('0x6'));var config=require(_0xc266('0x7'));config['redis']=_['defaults'](config[_0xc266('0x8')],{'host':_0xc266('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc266('0x8')]));function getAuthToken(_0x4ba210,_0x5e0a0e,_0x5e629b){var _0x31f1a9={'method':'POST','uri':_0x5e0a0e,'form':{'client_id':_0x4ba210[_0xc266('0xa')],'resource':_0x4ba210[_0xc266('0xb')],'username':_0x4ba210['username'],'password':_0x4ba210[_0xc266('0xc')],'grant_type':'password','client_secret':_0x4ba210[_0xc266('0xd')]},'json':!![]};return rp(_0x31f1a9)[_0xc266('0xe')](function(_0x43cb5c){return _0x43cb5c[_0xc266('0xf')];})[_0xc266('0x10')](function(_0x115ed7){logger['error']('['+[_0x5e629b[_0xc266('0x11')]()]+_0xc266('0x12'));return _0x115ed7['message'];});}function getUser(_0x3c2553,_0x1baace,_0x1194ac,_0x3e436e,_0x171979,_0x3b7600){return new BPromise(function(_0x21a9ea,_0x50c718){return getAuthToken(_0x1baace,_0x3e436e,_0x3b7600)[_0xc266('0xe')](function(_0x62a570){var _0x5ed556={'method':'GET','uri':_0x171979+_0xc266('0x13'),'headers':{'Authorization':_0xc266('0x14')+_0x62a570,'OData-Version':_0xc266('0x15')},'json':!![]};return rp(_0x5ed556);})[_0xc266('0xe')](function(_0x24372a){var _0x28e63d=_0x24372a['value'];var _0x54ee84=![];var _0x32bd41=null;if(!_[_0xc266('0x16')](_0x1194ac)){if(intUtil[_0xc266('0x17')](_0x1194ac[_0xc266('0x18')])){_0x3c2553[_0xc266('0x19')]=_0x1194ac[_0xc266('0x18')];for(_0x32bd41=0x0;_0x32bd41<_0x28e63d['length'];_0x32bd41++){if(_0x28e63d[_0x32bd41][_0xc266('0x1a')]===_0x1194ac[_0xc266('0x18')]&&!_0x28e63d[_0x32bd41][_0xc266('0x1b')]){_0x54ee84=!![];logger[_0xc266('0x1c')]('['+[_0x3b7600[_0xc266('0x11')]()]+']\x20Agent\x20found\x20'+_0x28e63d[_0x32bd41][_0xc266('0x1d')]+'!');_0x3c2553[_0xc266('0x1e')]=_0x28e63d[_0x32bd41]['systemuserid'];}}}}if(!_0x54ee84){logger[_0xc266('0x1c')]('['+[_0x3b7600[_0xc266('0x11')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x3c2553[_0xc266('0x19')]=_0x1baace[_0xc266('0x1f')];for(_0x32bd41=0x0;_0x32bd41<_0x28e63d[_0xc266('0x20')];_0x32bd41++){if(_0x28e63d[_0x32bd41]['internalemailaddress']===_0x1baace[_0xc266('0x1f')]){_0x3c2553[_0xc266('0x1e')]=_0x28e63d[_0x32bd41][_0xc266('0x1d')];}}}_0x21a9ea(_0x3c2553);})['catch'](function(_0x4a3343){_0x50c718(_0x4a3343[_0xc266('0x21')]);});});}function createEndUser(_0x3be746,_0xaa49f,_0xe039f4,_0x4f2953,_0x465378,_0x38cc6a){return new BPromise(function(_0x2efd35,_0x4d5423){return getAuthToken(_0xaa49f,_0xe039f4,_0x38cc6a)[_0xc266('0xe')](function(_0x2771de){var _0x2f12f0=_0x38cc6a[_0xc266('0x22')]()===_0xc266('0x23')?_0x465378[_0xc266('0x24')]:_0x465378[_0xc266('0x25')];var _0x1f1f65={'method':'POST','uri':_0x4f2953+_0xc266('0x26'),'body':{'telephone1':_0x2f12f0,'fullname':_0x2f12f0,'firstname':_0x2f12f0,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xc266('0x27')+_0x3be746[_0xc266('0x1e')]+')'},'headers':{'Authorization':_0xc266('0x14')+_0x2771de,'OData-Version':_0xc266('0x15')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x1f1f65);})[_0xc266('0xe')](function(_0x1e683c){var _0xf45f83=_0x1e683c['headers'][_0xc266('0x28')];var _0x153caf=_0xf45f83['substring'](_0xf45f83['lastIndexOf']('(')+0x1,_0xf45f83[_0xc266('0x29')](')'));_0x3be746[_0xc266('0x2a')]=_0x153caf;_0x2efd35(_0x3be746);})[_0xc266('0x10')](function(_0x4289ae){_0x4d5423(_0x4289ae[_0xc266('0x21')]);});});}function getEndUser(_0x458b29,_0x5e9a4b,_0x5335d6,_0x157f8d,_0x44d936,_0x1e331c){return new BPromise(function(_0x17b581,_0x2ff6ec){var _0x57b362=_0x1e331c[_0xc266('0x22')]()==='outbound'?_0x44d936[_0xc266('0x24')]:_0x44d936[_0xc266('0x25')];return getAuthToken(_0x5e9a4b,_0x5335d6,_0x1e331c)[_0xc266('0xe')](function(_0x3d8e5a){var _0x131d1e={'method':_0xc266('0x2b'),'uri':_0x157f8d+_0xc266('0x2c')+_0x57b362[_0xc266('0x2d')]('+','%2b')+'\x27','headers':{'Authorization':_0xc266('0x14')+_0x3d8e5a,'If-None-Match':null,'OData-Version':_0xc266('0x15')},'json':!![]};return rp(_0x131d1e);})['then'](function(_0x10a1f1){var _0x171830=null;if(_0x10a1f1){var _0x12631d=_0x10a1f1[_0xc266('0x2e')];var _0x1a1081=![];for(_0x171830=0x0;_0x171830<_0x12631d[_0xc266('0x20')];_0x171830++){if(_0x12631d[_0x171830][_0xc266('0x2f')]===_0x57b362){_0x1a1081=!![];_0x458b29[_0xc266('0x2a')]=_0x12631d[_0x171830][_0xc266('0x30')];}}if(_0x1a1081){_0x17b581(_0x458b29);}else{return createEndUser(_0x458b29,_0x5e9a4b,_0x5335d6,_0x157f8d,_0x44d936,_0x1e331c)['then'](function(_0x26267c){logger[_0xc266('0x1c')]('['+[_0x1e331c[_0xc266('0x11')]()]+_0xc266('0x31'),_0x26267c['enduserId']);_0x17b581(_0x26267c);});}}else{return createEndUser(_0x458b29,_0x5e9a4b,_0x5335d6,_0x157f8d,_0x44d936,_0x1e331c)[_0xc266('0xe')](function(_0x144d4a){logger[_0xc266('0x1c')]('['+[_0x1e331c[_0xc266('0x11')]()]+_0xc266('0x32'),_0x144d4a[_0xc266('0x2a')]);_0x17b581(_0x144d4a);});}});});}function getCustomFields(_0x383ec6,_0x7ef944,_0x282957){var _0x535cba={};if(_0x383ec6[_0xc266('0x20')]>0x0){_[_0xc266('0x33')](_0x383ec6,function(_0x1eb098){if(_[_0xc266('0x34')]([_0xc266('0x35'),_0xc266('0x36')],_0x1eb098[_0xc266('0x37')])&&_0x1eb098[_0xc266('0x38')]&&!_0x1eb098['customField']){var _0x3a60df=_0x1eb098['idField'][_0xc266('0x22')]();var _0x5c736c=_0x3a60df[_0xc266('0x39')](0x0,_0x3a60df[_0xc266('0x3a')]('_'));var _0x240788=_0x3a60df[_0xc266('0x39')](_0x3a60df['indexOf']('_')+0x1);if(_0x5c736c===_0x282957){_0x535cba[_0x240788]=_0x1eb098[_0xc266('0x3b')];}}});}return _0x535cba;}function getTicket(_0x4147a3,_0x5f30f2,_0xc12da9,_0x98dcad,_0x48308b,_0x59ac4d,_0x32643c){return new BPromise(function(_0x25e421,_0x1f20b4){var _0x1030cb;return getAuthToken(_0x5f30f2,_0xc12da9,_0x32643c)[_0xc266('0xe')](function(_0x5925fe){if(_0x59ac4d[_0xc266('0x3c')]===_0xc266('0x3d')){_0x1030cb={'method':'POST','uri':_0x98dcad+'incidents','body':Object[_0xc266('0x3e')]({},{'title':intUtil[_0xc266('0x3f')](_0x59ac4d[_0xc266('0x40')],_0x48308b,'\x20'),'description':intUtil[_0xc266('0x3f')](_0x59ac4d['Descriptions'],_0x48308b,'\x0a'),'customerid_contact@odata.bind':_0xc266('0x41')+_0x4147a3[_0xc266('0x2a')]+')','ownerid@odata.bind':'/systemusers('+_0x4147a3[_0xc266('0x1e')]+')','caseorigincode':'1'},getCustomFields(_0x59ac4d['Fields'],_0x48308b,_0x59ac4d[_0xc266('0x3c')])),'headers':{'Authorization':_0xc266('0x14')+_0x5925fe,'OData-Version':_0xc266('0x15')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x59ac4d[_0xc266('0x3c')]===_0xc266('0x42')){_0x1030cb={'method':_0xc266('0x43'),'uri':_0x98dcad+_0xc266('0x44'),'body':Object[_0xc266('0x3e')]({},{'subject':intUtil[_0xc266('0x3f')](_0x59ac4d[_0xc266('0x40')],_0x48308b,'\x20'),'phonenumber':String(_0x48308b['calleridnum']),'description':intUtil[_0xc266('0x3f')](_0x59ac4d[_0xc266('0x45')],_0x48308b,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x4147a3[_0xc266('0x2a')]+')','ownerid@odata.bind':_0xc266('0x27')+_0x4147a3[_0xc266('0x1e')]+')','directioncode':_0x4147a3[_0xc266('0x46')]===_0xc266('0x47')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xc266('0x27')+_0x4147a3[_0xc266('0x1e')]+')','participationtypemask':_0x4147a3[_0xc266('0x46')]===_0xc266('0x47')?0x2:0x1},{'partyid_contact@odata.bind':_0xc266('0x41')+_0x4147a3['enduserId']+')','participationtypemask':_0x4147a3['callDirection']==='queue'?0x1:0x2}]},getCustomFields(_0x59ac4d[_0xc266('0x48')],_0x48308b,_0x59ac4d[_0xc266('0x3c')])),'headers':{'Authorization':'Bearer\x20'+_0x5925fe,'OData-Version':_0xc266('0x15')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1030cb);})[_0xc266('0xe')](function(_0x8d7cb0){var _0x2ce889=_0x8d7cb0[_0xc266('0x49')][_0xc266('0x28')];var _0x454c05=_0x2ce889[_0xc266('0x39')](_0x2ce889[_0xc266('0x29')]('(')+0x1,_0x2ce889['lastIndexOf'](')'));_0x4147a3[_0xc266('0x4a')]=_0x454c05;_0x25e421(_0x4147a3);})[_0xc266('0x10')](function(_0x510a78){_0x1f20b4(_0x510a78[_0xc266('0x21')]);});});}function emit(_0x52a4a0,_0x12845e,_0x57d56b,_0x1bc492){var _0x187a8f={'uri':util[_0xc266('0x4b')](_0xc266('0x4c'),_0x52a4a0,_0x57d56b,_0x1bc492)};io['to'](util[_0xc266('0x4b')](_0xc266('0x4d'),_0x12845e))[_0xc266('0x4e')](_0xc266('0x4f'),_0x187a8f);}exports['cs']=function(_0x25c353,_0x226d33,_0x479d32,_0x3b9a81,_0x564445,_0x3ecaff,_0x31d14f,_0x33df02){var _0x13b6fb={};_0x3ecaff[_0xc266('0xb')]=intUtil[_0xc266('0x50')](_0x3ecaff[_0xc266('0xb')]);_0x3ecaff[_0xc266('0x51')]=intUtil[_0xc266('0x50')](_0x3ecaff[_0xc266('0x51')]);_0x13b6fb['callDirection']=_0x33df02==='queue'||_0x33df02==='unmanaged'?'queue':_0xc266('0x23');var _0x441bf5=util[_0xc266('0x4b')]('%s/api/data/v9.0/',_0x3ecaff['remoteUri']);var _0x220d64=util[_0xc266('0x4b')]('https://login.microsoftonline.com/%s/oauth2/token',_0x3ecaff[_0xc266('0x52')]);var _0x164fb8=util['format'](_0xc266('0x53'),_0x3ecaff['serverUrl'],_0x226d33[_0xc266('0x54')],md5(_0x226d33[_0xc266('0x54')]));if(_0x564445&&_0x564445[_0xc266('0x55')]){logger[_0xc266('0x1c')](_0xc266('0x56'),'Recording\x20is\x20enabled!');_0x226d33[_0xc266('0x57')]=_0x164fb8;}else if(_0x31d14f&&_0x31d14f[_0xc266('0x58')]&&_0x31d14f['recordingFormat']!==_0xc266('0x59')){logger['info'](_0xc266('0x5a'),_0xc266('0x5b'));_0x226d33[_0xc266('0x57')]=_0x164fb8;}else{_0x226d33['recordingURL']='';}return getUser(_0x13b6fb,_0x3ecaff,_0x3b9a81,_0x220d64,_0x441bf5,_0x33df02)[_0xc266('0xe')](function(_0x155cf6){logger[_0xc266('0x1c')]('['+_0x33df02['toUpperCase']()+']\x20The\x20User\x20ID\x20is:',_0x155cf6[_0xc266('0x1e')]);logger[_0xc266('0x1c')]('['+_0x33df02[_0xc266('0x11')]()+_0xc266('0x5c'),_0x155cf6[_0xc266('0x19')]);return getEndUser(_0x155cf6,_0x3ecaff,_0x220d64,_0x441bf5,_0x226d33,_0x33df02);})[_0xc266('0xe')](function(_0x55d2e6){logger['info']('['+_0x33df02['toUpperCase']()+_0xc266('0x5d'),_0x55d2e6[_0xc266('0x2a')]);logger[_0xc266('0x1c')]('['+_0x33df02[_0xc266('0x11')]()+_0xc266('0x5e'),_0x226d33[_0xc266('0x25')]);return getTicket(_0x55d2e6,_0x3ecaff,_0x220d64,_0x441bf5,_0x226d33,_0x479d32,_0x33df02);})['then'](function(_0x773120){logger[_0xc266('0x1c')](util['format']('['+_0x33df02[_0xc266('0x11')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x479d32['ticketType'],_0x773120[_0xc266('0x4a')]));logger[_0xc266('0x1c')](util['format']('['+_0x33df02['toUpperCase']()+_0xc266('0x5f'),_0x33df02));if(_0x33df02!=='unmanaged'){logger['info']('['+_0x33df02[_0xc266('0x11')]()+']',_0xc266('0x60'));emit(_0x3ecaff[_0xc266('0xb')],_0x3b9a81[_0xc266('0x61')],_0x479d32['ticketType'],_0x773120[_0xc266('0x4a')]);}})['catch'](function(_0x3cdb35){logger[_0xc266('0x62')]('['+_0x33df02[_0xc266('0x11')]()+_0xc266('0x63'),util[_0xc266('0x64')](_0x3cdb35,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 5eead1d..d861bd7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf831=['forEach','includes','string','type','customField','nameField','toLowerCase','content','picklist','idField','push','variable','variableName','customVariable','Variable','queue','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','catch','monitor_format','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','request-promise','md5','util','ioredis','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','merge','format','calleridname','calleridnum','getString','Subjects','Descriptions','<br>','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','POST','then','info','Ticket\x20created!','%s/api/v2/agents','remoteUri','length','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','Enduser\x20found!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','GET','map'];(function(_0xf428de,_0x2c619a){var _0x193e25=function(_0x2934f2){while(--_0x2934f2){_0xf428de['push'](_0xf428de['shift']());}};_0x193e25(++_0x2c619a);}(_0xf831,0x89));var _0x1f83=function(_0x5a8d0d,_0x3ed8aa){_0x5a8d0d=_0x5a8d0d-0x0;var _0xedf21f=_0xf831[_0x5a8d0d];return _0xedf21f;};'use strict';var _=require('lodash');var rp=require(_0x1f83('0x0'));var md5=require(_0x1f83('0x1'));var util=require(_0x1f83('0x2'));var Redis=require(_0x1f83('0x3'));var intUtil=require('./util');var config=require(_0x1f83('0x4'));var logger=require('../../../../config/logger')('freshdesk');config[_0x1f83('0x5')]=_[_0x1f83('0x6')](config[_0x1f83('0x5')],{'host':_0x1f83('0x7'),'port':0x18eb});var io=require(_0x1f83('0x8'))(new Redis(config['redis']));var headers={'Content-Type':_0x1f83('0x9'),'Accept':'application/json'};function emit(_0x5ccc58,_0x526ed2,_0x2cb258){io['to'](_0x5ccc58)[_0x1f83('0xa')](_0x526ed2,_0x2cb258);}function getTicket(_0xf6d404,_0x113968,_0x32f2cf,_0x30f251,_0x1c6d87){logger['info'](_0x1f83('0xb'));var _0x417788=_[_0x1f83('0xc')]({'responder_id':_0x113968['id'],'requester_id':_0x32f2cf['id'],'name':util[_0x1f83('0xd')]('Caller\x20-\x20%s',_0x1c6d87[_0x1f83('0xe')]),'phone':_0x1c6d87[_0x1f83('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x1f83('0x10')](_0x30f251[_0x1f83('0x11')],_0x1c6d87,'\x20'),'description':intUtil[_0x1f83('0x10')](_0x30f251[_0x1f83('0x12')],_0x1c6d87,_0x1f83('0x13')),'tags':getTags(_0x30f251['Tags'],_0x1f83('0x14'))},getCustomFields(_0x30f251[_0x1f83('0x15')],_0x1c6d87));_0x417788[_0x1f83('0x16')]=_[_0x1f83('0x17')](_[_0x1f83('0x18')](_0x417788[_0x1f83('0x16')],'id'),_0x1f83('0x19'));return request({'uri':util['format'](_0x1f83('0x1a'),_0xf6d404['remoteUri']),'method':_0x1f83('0x1b'),'body':_0x417788})[_0x1f83('0x1c')](function(_0x384898){logger[_0x1f83('0x1d')](_0x1f83('0x1e'));return _0x384898;});}function getUser(_0x2d5020,_0x31ed7c){if(intUtil['validateEmail'](_0x31ed7c)){return request({'uri':util['format'](_0x1f83('0x1f'),_0x2d5020[_0x1f83('0x20')]),'qs':{'email':_0x31ed7c}})[_0x1f83('0x1c')](function(_0x301711){if(_0x301711[_0x1f83('0x21')]){logger[_0x1f83('0x1d')](_0x1f83('0x22'));return _[_0x1f83('0x23')](_0x301711,function(_0x2bd619){return _0x2bd619[_0x1f83('0x24')][_0x1f83('0x25')]===_0x31ed7c;});}else{logger['info'](_0x1f83('0x26'));return request({'uri':util[_0x1f83('0xd')](_0x1f83('0x27'),_0x2d5020[_0x1f83('0x20')])})[_0x1f83('0x1c')](function(_0x51897d){logger[_0x1f83('0x1d')](_0x1f83('0x28'));return _0x51897d;});}});}else{logger[_0x1f83('0x1d')](_0x1f83('0x29'));return request({'uri':util[_0x1f83('0xd')]('%s/api/v2/agents/me',_0x2d5020[_0x1f83('0x20')])})['then'](function(_0x413cad){logger['info'](_0x1f83('0x28'));return _0x413cad;});}}function getEndUser(_0x369f14,_0xb83572,_0xbba255){logger[_0x1f83('0x1d')](_0x1f83('0x2a'),_0xbba255);return request({'uri':util[_0x1f83('0xd')]('%s/api/v2/contacts',_0x369f14['remoteUri']),'qs':{'phone':_0xbba255}})[_0x1f83('0x1c')](function(_0x47cde4){if(_0x47cde4['length']){logger['info'](_0x1f83('0x2b'));return _[_0x1f83('0x23')](_0x47cde4,{'phone':_0xbba255});}else{logger[_0x1f83('0x1d')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x1f83('0xd')](_0x1f83('0x2c'),_0x369f14[_0x1f83('0x20')]),'method':_0x1f83('0x1b'),'body':{'name':_0xb83572,'phone':_0xbba255}})[_0x1f83('0x1c')](function(_0x1a4542){logger['info'](_0x1f83('0x2d'));return _0x1a4542;});}});}function getAuth(_0x429dfe){return util[_0x1f83('0xd')](_0x1f83('0x2e'),new Buffer(_0x429dfe[_0x1f83('0x2f')]+':X')[_0x1f83('0x30')](_0x1f83('0x31')));}function request(_0x51a0be){logger[_0x1f83('0x32')](_0x1f83('0x33'),JSON[_0x1f83('0x34')](_0x51a0be));return rp(_[_0x1f83('0x6')](_0x51a0be,{'method':_0x1f83('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x50814b,_0x11a391){var _0x5d4bc4=[];if(_0x50814b&&_0x50814b[_0x1f83('0x21')]>0x0){_0x5d4bc4=_[_0x1f83('0x36')](_0x50814b,_0x11a391);}return _0x5d4bc4;}function getCustomFields(_0x2c95d2,_0x165e32){var _0x36d6b8=[];var _0x4f8ff4={'custom_fields':[]};if(_0x2c95d2[_0x1f83('0x21')]>0x0){_[_0x1f83('0x37')](_0x2c95d2,function(_0x5cc246){if(_[_0x1f83('0x38')]([_0x1f83('0x39'),'picklist'],_0x5cc246[_0x1f83('0x3a')])&&_0x5cc246['nameField']&&!_0x5cc246[_0x1f83('0x3b')]){_0x4f8ff4[_0x5cc246[_0x1f83('0x3c')][_0x1f83('0x3d')]()]=_0x5cc246[_0x1f83('0x3e')][_0x1f83('0x30')]();}else if(_[_0x1f83('0x38')]([_0x1f83('0x39'),_0x1f83('0x3f')],_0x5cc246[_0x1f83('0x3a')])&&_0x5cc246[_0x1f83('0x40')]&&_0x5cc246['customField']){_0x4f8ff4['custom_fields'][_0x1f83('0x41')]({'id':_0x5cc246[_0x1f83('0x40')],'value':_0x5cc246[_0x1f83('0x3e')][_0x1f83('0x30')]()});}else if(_0x5cc246[_0x1f83('0x3a')]===_0x1f83('0x42')&&_0x5cc246['variableName']&&_0x5cc246[_0x1f83('0x40')]&&_0x5cc246['customField']){_0x165e32[_0x5cc246[_0x1f83('0x43')]]&&_0x4f8ff4[_0x1f83('0x16')][_0x1f83('0x41')]({'id':_0x5cc246[_0x1f83('0x40')],'value':_0x165e32[_0x5cc246[_0x1f83('0x43')]][_0x1f83('0x30')]()});}else if(_0x5cc246[_0x1f83('0x3a')]===_0x1f83('0x44')&&_0x5cc246[_0x1f83('0x45')]&&_0x5cc246['Variable'][_0x1f83('0x14')]&&_0x5cc246[_0x1f83('0x40')]&&_0x5cc246[_0x1f83('0x3b')]){_0x165e32[_0x5cc246[_0x1f83('0x45')][_0x1f83('0x14')][_0x1f83('0x3d')]()]&&_0x4f8ff4[_0x1f83('0x16')][_0x1f83('0x41')]({'id':_0x5cc246[_0x1f83('0x40')],'value':_0x165e32[_0x5cc246[_0x1f83('0x45')][_0x1f83('0x14')][_0x1f83('0x3d')]()][_0x1f83('0x30')]()});}});}return _0x4f8ff4;}exports[_0x1f83('0x46')]=function(_0x297de1,_0x835a18,_0x2a6386,_0xd22cbe,_0x2453bd,_0x2d46ac){var _0x588281,_0x33c25f;_0x2d46ac['remoteUri']=intUtil['stripTrailingSlash'](_0x2d46ac['remoteUri']);_0x2d46ac[_0x1f83('0x47')]=intUtil[_0x1f83('0x48')](_0x2d46ac[_0x1f83('0x47')]);if(_0x2453bd&&_0x2453bd['monitor_format']){logger['info'](_0x1f83('0x49'),'Recording\x20is\x20enabled!');_0x835a18[_0x1f83('0x4a')]=util[_0x1f83('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2d46ac['serverUrl'],_0x835a18['uniqueid'],md5(_0x835a18[_0x1f83('0x4b')]));}else{_0x835a18[_0x1f83('0x4a')]='';}headers[_0x1f83('0x4c')]=getAuth(_0x2d46ac);return getUser(_0x2d46ac,_0xd22cbe[_0x1f83('0x25')])['then'](function(_0x3d3cd2){_0x588281=_0x3d3cd2;logger['info'](_0x1f83('0x4d'),_0x588281['id']);return getEndUser(_0x2d46ac,_0x835a18[_0x1f83('0xe')],_0x835a18[_0x1f83('0xf')]);})[_0x1f83('0x1c')](function(_0x3ce7b6){_0x33c25f=_0x3ce7b6;logger[_0x1f83('0x1d')](_0x1f83('0x4e'),_0x33c25f['id']);return getTicket(_0x2d46ac,_0x588281,_0x33c25f,_0x2a6386,_0x835a18);})[_0x1f83('0x1c')](function(_0x193b10){if(_0x193b10&&_0x193b10['id']){logger[_0x1f83('0x1d')](_0x1f83('0x1e'));logger[_0x1f83('0x1d')](_0x1f83('0x4f'),_0x193b10['id']);logger[_0x1f83('0x1d')](_0x1f83('0x49'),_0x1f83('0x50'));emit(util[_0x1f83('0xd')](_0x1f83('0x51'),_0xd22cbe[_0x1f83('0x14')]),_0x1f83('0x52'),{'uri':util[_0x1f83('0xd')](_0x1f83('0x53'),_0x2d46ac[_0x1f83('0x20')],_0x193b10['id'])});}})['catch'](function(_0x1b02db){logger[_0x1f83('0x54')](_0x1f83('0x49'),JSON['stringify'](_0x1b02db));});};exports['outbound']=function(_0x3f7b98,_0xb35c49,_0x50e532,_0xa96788,_0x3b30ee,_0x356f76,_0x2a6768){var _0x18e3fb,_0x526741;_0x356f76[_0x1f83('0x20')]=intUtil[_0x1f83('0x48')](_0x356f76[_0x1f83('0x20')]);_0x356f76[_0x1f83('0x47')]=intUtil[_0x1f83('0x48')](_0x356f76['serverUrl']);if(_0x2a6768&&_0x2a6768[_0x1f83('0x55')]&&_0x2a6768[_0x1f83('0x55')]!==_0x1f83('0x56')){logger[_0x1f83('0x1d')](_0x1f83('0x57'),_0x1f83('0x58'));_0xb35c49[_0x1f83('0x4a')]=util[_0x1f83('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x356f76[_0x1f83('0x47')],_0xb35c49[_0x1f83('0x4b')],md5(_0xb35c49['uniqueid']));}headers['Authorization']=getAuth(_0x356f76);return getUser(_0x356f76,_0xa96788[_0x1f83('0x25')])[_0x1f83('0x1c')](function(_0x4aab33){_0x18e3fb=_0x4aab33;logger['info'](_0x1f83('0x4d'),_0x18e3fb['id']);return getEndUser(_0x356f76,_0xb35c49[_0x1f83('0x59')],_0xb35c49[_0x1f83('0x5a')]);})[_0x1f83('0x1c')](function(_0x374868){_0x526741=_0x374868;logger['info'](_0x1f83('0x4e'),_0x526741['id']);return getTicket(_0x356f76,_0x18e3fb,_0x526741,_0x50e532,_0xb35c49);})[_0x1f83('0x1c')](function(_0x27ddc2){if(_0x27ddc2&&_0x27ddc2['id']){logger[_0x1f83('0x1d')](_0x1f83('0x1e'));logger[_0x1f83('0x1d')](_0x1f83('0x4f'),_0x27ddc2['id']);logger[_0x1f83('0x1d')](_0x1f83('0x57'),_0x1f83('0x50'));emit(util[_0x1f83('0xd')]('user:%s',_0xa96788['name']),'trigger:browser:url',{'uri':util[_0x1f83('0xd')]('%s/helpdesk/tickets/%d',_0x356f76[_0x1f83('0x20')],_0x27ddc2['id'])});}})[_0x1f83('0x5b')](function(_0x56987f){logger['error'](_0x1f83('0x57'),JSON[_0x1f83('0x34')](_0x56987f));});};exports['unmanaged']=function(_0x5916b2,_0x42b285,_0xdccb5c,_0x53458f,_0x32427b,_0x2b7ce2){var _0x519f26,_0x4b6a45;_0x2b7ce2['remoteUri']=intUtil[_0x1f83('0x48')](_0x2b7ce2[_0x1f83('0x20')]);_0x2b7ce2['serverUrl']=intUtil[_0x1f83('0x48')](_0x2b7ce2[_0x1f83('0x47')]);if(_0x32427b&&_0x32427b[_0x1f83('0x5c')]){logger[_0x1f83('0x1d')]('['+_0x42b285[_0x1f83('0x5d')][_0x1f83('0x5e')]()+']',_0x1f83('0x58'));_0x42b285[_0x1f83('0x4a')]=util[_0x1f83('0xd')](_0x1f83('0x5f'),_0x2b7ce2[_0x1f83('0x47')],_0x42b285[_0x1f83('0x4b')],md5(_0x42b285[_0x1f83('0x4b')]));}else{_0x42b285[_0x1f83('0x4a')]='';}headers[_0x1f83('0x4c')]=getAuth(_0x2b7ce2);return getUser(_0x2b7ce2,'')[_0x1f83('0x1c')](function(_0x1a8730){_0x519f26=_0x1a8730;logger[_0x1f83('0x1d')](_0x1f83('0x4d'),_0x519f26['id']);return getEndUser(_0x2b7ce2,_0x42b285[_0x1f83('0xe')],_0x42b285['calleridnum']);})[_0x1f83('0x1c')](function(_0x8ee51c){_0x4b6a45=_0x8ee51c;logger[_0x1f83('0x1d')](_0x1f83('0x4e'),_0x4b6a45['id']);return getTicket(_0x2b7ce2,_0x519f26,_0x4b6a45,_0xdccb5c,_0x42b285);})[_0x1f83('0x1c')](function(_0x3f6209){if(_0x3f6209){logger[_0x1f83('0x1d')](_0x1f83('0x1e'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x3f6209['id']);}})[_0x1f83('0x5b')](function(_0x2488c3){logger[_0x1f83('0x54')]('['+_0x42b285[_0x1f83('0x5d')][_0x1f83('0x5e')]()+']',JSON[_0x1f83('0x34')](_0x2488c3));});};
\ No newline at end of file
+var _0xc366=['./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridnum','Subjects','Descriptions','<br>','Tags','name','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','info','validateEmail','length','Agent\x20found!','find','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Basic\x20%s','apiKey','toString','base64','[HTTP]','stringify','nameField','toLowerCase','content','includes','string','picklist','type','customField','idField','variableName','push','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','outbound','recordingFormat','none','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','trigger:browser:url','%s/helpdesk/tickets/%d','unmanaged','calleridname','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc366,0x1cc));var _0x6c36=function(_0xd056bc,_0x506c5c){_0xd056bc=_0xd056bc-0x0;var _0x5c29a8=_0xc366[_0xd056bc];return _0x5c29a8;};'use strict';var _=require(_0x6c36('0x0'));var rp=require(_0x6c36('0x1'));var md5=require(_0x6c36('0x2'));var util=require(_0x6c36('0x3'));var Redis=require(_0x6c36('0x4'));var intUtil=require(_0x6c36('0x5'));var config=require(_0x6c36('0x6'));var logger=require(_0x6c36('0x7'))(_0x6c36('0x8'));config[_0x6c36('0x9')]=_[_0x6c36('0xa')](config['redis'],{'host':_0x6c36('0xb'),'port':0x18eb});var io=require(_0x6c36('0xc'))(new Redis(config[_0x6c36('0x9')]));var headers={'Content-Type':_0x6c36('0xd'),'Accept':_0x6c36('0xd')};function emit(_0x347db2,_0x38758f,_0x361476){io['to'](_0x347db2)['emit'](_0x38758f,_0x361476);}function getTicket(_0x2ab9cf,_0x3b72b3,_0x41e723,_0x2a7270,_0x424024){logger['info'](_0x6c36('0xe'));var _0x5622c3=_[_0x6c36('0xf')]({'responder_id':_0x3b72b3['id'],'requester_id':_0x41e723['id'],'name':util[_0x6c36('0x10')](_0x6c36('0x11'),_0x424024['calleridname']),'phone':_0x424024[_0x6c36('0x12')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x2a7270[_0x6c36('0x13')],_0x424024,'\x20'),'description':intUtil['getString'](_0x2a7270[_0x6c36('0x14')],_0x424024,_0x6c36('0x15')),'tags':getTags(_0x2a7270[_0x6c36('0x16')],_0x6c36('0x17'))},getCustomFields(_0x2a7270['Fields'],_0x424024));_0x5622c3[_0x6c36('0x18')]=_[_0x6c36('0x19')](_[_0x6c36('0x1a')](_0x5622c3['custom_fields'],'id'),_0x6c36('0x1b'));return request({'uri':util['format'](_0x6c36('0x1c'),_0x2ab9cf[_0x6c36('0x1d')]),'method':_0x6c36('0x1e'),'body':_0x5622c3})[_0x6c36('0x1f')](function(_0x3b18b6){logger[_0x6c36('0x20')]('Ticket\x20created!');return _0x3b18b6;});}function getUser(_0x2c14b6,_0x52f062){if(intUtil[_0x6c36('0x21')](_0x52f062)){return request({'uri':util[_0x6c36('0x10')]('%s/api/v2/agents',_0x2c14b6[_0x6c36('0x1d')]),'qs':{'email':_0x52f062}})[_0x6c36('0x1f')](function(_0x1260f5){if(_0x1260f5[_0x6c36('0x22')]){logger[_0x6c36('0x20')](_0x6c36('0x23'));return _[_0x6c36('0x24')](_0x1260f5,function(_0x1e2ecf){return _0x1e2ecf['contact'][_0x6c36('0x25')]===_0x52f062;});}else{logger[_0x6c36('0x20')](_0x6c36('0x26'));return request({'uri':util[_0x6c36('0x10')](_0x6c36('0x27'),_0x2c14b6[_0x6c36('0x1d')])})[_0x6c36('0x1f')](function(_0x5b818d){logger[_0x6c36('0x20')](_0x6c36('0x28'));return _0x5b818d;});}});}else{logger[_0x6c36('0x20')](_0x6c36('0x29'));return request({'uri':util[_0x6c36('0x10')](_0x6c36('0x27'),_0x2c14b6[_0x6c36('0x1d')])})['then'](function(_0x5bf4f6){logger[_0x6c36('0x20')]('Admin\x20account\x20selected.');return _0x5bf4f6;});}}function getEndUser(_0x3c1283,_0x25171c,_0x37c36c){logger['info']('Searching\x20enduser\x20with\x20phone',_0x37c36c);return request({'uri':util[_0x6c36('0x10')](_0x6c36('0x2a'),_0x3c1283[_0x6c36('0x1d')]),'qs':{'phone':_0x37c36c}})[_0x6c36('0x1f')](function(_0x52829d){if(_0x52829d['length']){logger['info'](_0x6c36('0x2b'));return _[_0x6c36('0x24')](_0x52829d,{'phone':_0x37c36c});}else{logger[_0x6c36('0x20')](_0x6c36('0x2c'));return request({'uri':util[_0x6c36('0x10')]('%s/api/v2/contacts',_0x3c1283[_0x6c36('0x1d')]),'method':'POST','body':{'name':_0x25171c,'phone':_0x37c36c}})[_0x6c36('0x1f')](function(_0x3297d3){logger['info']('Enduser\x20created.');return _0x3297d3;});}});}function getAuth(_0x9ed878){return util[_0x6c36('0x10')](_0x6c36('0x2d'),new Buffer(_0x9ed878[_0x6c36('0x2e')]+':X')[_0x6c36('0x2f')](_0x6c36('0x30')));}function request(_0x101c90){logger['debug'](_0x6c36('0x31'),JSON[_0x6c36('0x32')](_0x101c90));return rp(_[_0x6c36('0xa')](_0x101c90,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x53e975,_0x675422){var _0x5a8248=[];if(_0x53e975&&_0x53e975[_0x6c36('0x22')]>0x0){_0x5a8248=_['map'](_0x53e975,_0x675422);}return _0x5a8248;}function getCustomFields(_0x7d02ff,_0x33d1d4){var _0x509f05=[];var _0x539dee={'custom_fields':[]};if(_0x7d02ff[_0x6c36('0x22')]>0x0){_['forEach'](_0x7d02ff,function(_0x1c3b8b){if(_['includes'](['string','picklist'],_0x1c3b8b['type'])&&_0x1c3b8b[_0x6c36('0x33')]&&!_0x1c3b8b['customField']){_0x539dee[_0x1c3b8b[_0x6c36('0x33')][_0x6c36('0x34')]()]=_0x1c3b8b[_0x6c36('0x35')]['toString']();}else if(_[_0x6c36('0x36')]([_0x6c36('0x37'),_0x6c36('0x38')],_0x1c3b8b[_0x6c36('0x39')])&&_0x1c3b8b['idField']&&_0x1c3b8b[_0x6c36('0x3a')]){_0x539dee[_0x6c36('0x18')]['push']({'id':_0x1c3b8b[_0x6c36('0x3b')],'value':_0x1c3b8b[_0x6c36('0x35')]['toString']()});}else if(_0x1c3b8b[_0x6c36('0x39')]==='variable'&&_0x1c3b8b[_0x6c36('0x3c')]&&_0x1c3b8b[_0x6c36('0x3b')]&&_0x1c3b8b['customField']){_0x33d1d4[_0x1c3b8b[_0x6c36('0x3c')]]&&_0x539dee[_0x6c36('0x18')][_0x6c36('0x3d')]({'id':_0x1c3b8b['idField'],'value':_0x33d1d4[_0x1c3b8b['variableName']]['toString']()});}else if(_0x1c3b8b['type']===_0x6c36('0x3e')&&_0x1c3b8b[_0x6c36('0x3f')]&&_0x1c3b8b['Variable'][_0x6c36('0x17')]&&_0x1c3b8b[_0x6c36('0x3b')]&&_0x1c3b8b[_0x6c36('0x3a')]){_0x33d1d4[_0x1c3b8b[_0x6c36('0x3f')]['name'][_0x6c36('0x34')]()]&&_0x539dee[_0x6c36('0x18')]['push']({'id':_0x1c3b8b[_0x6c36('0x3b')],'value':_0x33d1d4[_0x1c3b8b[_0x6c36('0x3f')][_0x6c36('0x17')][_0x6c36('0x34')]()][_0x6c36('0x2f')]()});}});}return _0x539dee;}exports[_0x6c36('0x40')]=function(_0x2c0e60,_0x3dffd2,_0x2cf307,_0x341cd5,_0x10306e,_0x25517f){var _0x26811e,_0x2b0256;_0x25517f[_0x6c36('0x1d')]=intUtil[_0x6c36('0x41')](_0x25517f[_0x6c36('0x1d')]);_0x25517f[_0x6c36('0x42')]=intUtil[_0x6c36('0x41')](_0x25517f[_0x6c36('0x42')]);if(_0x10306e&&_0x10306e[_0x6c36('0x43')]){logger['info'](_0x6c36('0x44'),'Recording\x20is\x20enabled!');_0x3dffd2[_0x6c36('0x45')]=util[_0x6c36('0x10')](_0x6c36('0x46'),_0x25517f[_0x6c36('0x42')],_0x3dffd2['uniqueid'],md5(_0x3dffd2[_0x6c36('0x47')]));}else{_0x3dffd2[_0x6c36('0x45')]='';}headers[_0x6c36('0x48')]=getAuth(_0x25517f);return getUser(_0x25517f,_0x341cd5[_0x6c36('0x25')])[_0x6c36('0x1f')](function(_0x2362bb){_0x26811e=_0x2362bb;logger['info']('The\x20User\x20ID\x20is:',_0x26811e['id']);return getEndUser(_0x25517f,_0x3dffd2['calleridname'],_0x3dffd2[_0x6c36('0x12')]);})[_0x6c36('0x1f')](function(_0xff3f7c){_0x2b0256=_0xff3f7c;logger[_0x6c36('0x20')](_0x6c36('0x49'),_0x2b0256['id']);return getTicket(_0x25517f,_0x26811e,_0x2b0256,_0x2cf307,_0x3dffd2);})[_0x6c36('0x1f')](function(_0x4837fe){if(_0x4837fe&&_0x4837fe['id']){logger[_0x6c36('0x20')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x4837fe['id']);logger[_0x6c36('0x20')](_0x6c36('0x44'),_0x6c36('0x4a'));emit(util[_0x6c36('0x10')](_0x6c36('0x4b'),_0x341cd5[_0x6c36('0x17')]),'trigger:browser:url',{'uri':util[_0x6c36('0x10')]('%s/helpdesk/tickets/%d',_0x25517f[_0x6c36('0x1d')],_0x4837fe['id'])});}})[_0x6c36('0x4c')](function(_0x232091){logger[_0x6c36('0x4d')](_0x6c36('0x44'),JSON[_0x6c36('0x32')](_0x232091));});};exports[_0x6c36('0x4e')]=function(_0x1ff627,_0x1708e4,_0x58bb0a,_0x6341d3,_0x5523b5,_0x21c0c7,_0x17fe2d){var _0x20b6c6,_0x5dbda0;_0x21c0c7[_0x6c36('0x1d')]=intUtil[_0x6c36('0x41')](_0x21c0c7[_0x6c36('0x1d')]);_0x21c0c7[_0x6c36('0x42')]=intUtil[_0x6c36('0x41')](_0x21c0c7['serverUrl']);if(_0x17fe2d&&_0x17fe2d[_0x6c36('0x4f')]&&_0x17fe2d[_0x6c36('0x4f')]!==_0x6c36('0x50')){logger[_0x6c36('0x20')]('[OUTBOUND]',_0x6c36('0x51'));_0x1708e4['recordingURL']=util[_0x6c36('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x21c0c7[_0x6c36('0x42')],_0x1708e4[_0x6c36('0x47')],md5(_0x1708e4[_0x6c36('0x47')]));}headers['Authorization']=getAuth(_0x21c0c7);return getUser(_0x21c0c7,_0x6341d3[_0x6c36('0x25')])['then'](function(_0x293563){_0x20b6c6=_0x293563;logger[_0x6c36('0x20')](_0x6c36('0x52'),_0x20b6c6['id']);return getEndUser(_0x21c0c7,_0x1708e4[_0x6c36('0x53')],_0x1708e4[_0x6c36('0x54')]);})[_0x6c36('0x1f')](function(_0x3624f9){_0x5dbda0=_0x3624f9;logger['info'](_0x6c36('0x49'),_0x5dbda0['id']);return getTicket(_0x21c0c7,_0x20b6c6,_0x5dbda0,_0x58bb0a,_0x1708e4);})[_0x6c36('0x1f')](function(_0x7a008b){if(_0x7a008b&&_0x7a008b['id']){logger[_0x6c36('0x20')]('Ticket\x20created!');logger[_0x6c36('0x20')](_0x6c36('0x55'),_0x7a008b['id']);logger[_0x6c36('0x20')](_0x6c36('0x56'),_0x6c36('0x4a'));emit(util[_0x6c36('0x10')](_0x6c36('0x4b'),_0x6341d3[_0x6c36('0x17')]),_0x6c36('0x57'),{'uri':util[_0x6c36('0x10')](_0x6c36('0x58'),_0x21c0c7[_0x6c36('0x1d')],_0x7a008b['id'])});}})[_0x6c36('0x4c')](function(_0x579e43){logger[_0x6c36('0x4d')](_0x6c36('0x56'),JSON[_0x6c36('0x32')](_0x579e43));});};exports[_0x6c36('0x59')]=function(_0x2e3a3b,_0x5c9a22,_0x35398b,_0x573ea7,_0x3599d7,_0x3d2486){var _0x1bd9a4,_0x39b1c6;_0x3d2486[_0x6c36('0x1d')]=intUtil['stripTrailingSlash'](_0x3d2486[_0x6c36('0x1d')]);_0x3d2486[_0x6c36('0x42')]=intUtil['stripTrailingSlash'](_0x3d2486['serverUrl']);if(_0x3599d7&&_0x3599d7['monitor_format']){logger[_0x6c36('0x20')]('['+_0x5c9a22['lastevent']['toUpperCase']()+']',_0x6c36('0x51'));_0x5c9a22[_0x6c36('0x45')]=util[_0x6c36('0x10')](_0x6c36('0x46'),_0x3d2486[_0x6c36('0x42')],_0x5c9a22[_0x6c36('0x47')],md5(_0x5c9a22[_0x6c36('0x47')]));}else{_0x5c9a22[_0x6c36('0x45')]='';}headers[_0x6c36('0x48')]=getAuth(_0x3d2486);return getUser(_0x3d2486,'')[_0x6c36('0x1f')](function(_0x3453e8){_0x1bd9a4=_0x3453e8;logger[_0x6c36('0x20')](_0x6c36('0x52'),_0x1bd9a4['id']);return getEndUser(_0x3d2486,_0x5c9a22[_0x6c36('0x5a')],_0x5c9a22[_0x6c36('0x12')]);})[_0x6c36('0x1f')](function(_0x3ee19c){_0x39b1c6=_0x3ee19c;logger['info'](_0x6c36('0x49'),_0x39b1c6['id']);return getTicket(_0x3d2486,_0x1bd9a4,_0x39b1c6,_0x35398b,_0x5c9a22);})[_0x6c36('0x1f')](function(_0x118632){if(_0x118632){logger[_0x6c36('0x20')]('Ticket\x20created!');logger[_0x6c36('0x20')]('The\x20Ticket\x20ID\x20is:',_0x118632['id']);}})[_0x6c36('0x4c')](function(_0x3986be){logger['error']('['+_0x5c9a22[_0x6c36('0x5b')][_0x6c36('0x5c')]()+']',JSON[_0x6c36('0x32')](_0x3986be));});};
\ No newline at end of file
index ac1389b..cd5bfbf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0e1=['../../../../config/logger','freshsales','redis','defaults','socket.io-emitter','GET','/api/selector/owners','headers','Getting\x20admin\x20information','then','users','length','email','adminEmail','adminId','info','Admin\x20found:','Requested\x20Resource\x20not\x20Found','error','toUpperCase','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','User\x20found:','userId','Admin\x20selected','userEmail','catch','message','&entities=contact','contacts','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','POST','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','Token\x20token=','remoteUri','serverUrl','stripTrailingSlash','username','toLowerCase','destcalleridnum','calleridnum','unmanaged','outbound','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','md5','util','moment','ioredis','./util','../../../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd0e1,0xa2));var _0x1d0e=function(_0x3967fc,_0x353ab6){_0x3967fc=_0x3967fc-0x0;var _0x5d332c=_0xd0e1[_0x3967fc];return _0x5d332c;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x1d0e('0x0'));var util=require(_0x1d0e('0x1'));var moment=require(_0x1d0e('0x2'));var Promise=require('bluebird');var Redis=require(_0x1d0e('0x3'));var intUtil=require(_0x1d0e('0x4'));var config=require(_0x1d0e('0x5'));var logger=require(_0x1d0e('0x6'))(_0x1d0e('0x7'));config[_0x1d0e('0x8')]=_[_0x1d0e('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x1d0e('0xa'))(new Redis(config[_0x1d0e('0x8')]));function getAdminId(_0x330620,_0x1ca306,_0x300ca9,_0x100b74){return new Promise(function(_0x12566d,_0x28a0af){var _0x17ec4b=![];var _0x95e0a0={'method':_0x1d0e('0xb'),'uri':_0x100b74+_0x1d0e('0xc'),'json':!![]};_0x95e0a0[_0x1d0e('0xd')]=_0x300ca9;logger['info'](_0x1d0e('0xe'));return rp(_0x95e0a0)[_0x1d0e('0xf')](function(_0x1ee778){if(_0x1ee778){var _0x239b41=_0x1ee778[_0x1d0e('0x10')];var _0x596b47=null;for(_0x596b47=0x0;_0x596b47<_0x239b41[_0x1d0e('0x11')];_0x596b47++){if(_0x239b41[_0x596b47][_0x1d0e('0x12')]===_0x330620[_0x1d0e('0x13')]){_0x330620[_0x1d0e('0x14')]=_0x239b41[_0x596b47]['id'];_0x17ec4b=!![];}}if(_0x17ec4b){logger[_0x1d0e('0x15')](_0x1d0e('0x16'),_0x330620['adminId']);_0x12566d(_0x330620);}else{_0x28a0af({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x28a0af({'statusCode':0x194,'message':_0x1d0e('0x17')});}})['catch'](function(_0x8cf990){logger[_0x1d0e('0x18')]('['+[_0x1ca306[_0x1d0e('0x19')]()]+']',_0x8cf990['message']);_0x28a0af(_0x8cf990);});});}function getUser(_0x35234b,_0x21d586,_0x2db338){return function(_0x400c4c){return new Promise(function(_0x5bd7af,_0xb11ff6){var _0x38e47d={'method':'GET','uri':_0x2db338+_0x1d0e('0xc'),'json':!![]};_0x38e47d['headers']=_0x21d586;logger[_0x1d0e('0x15')](_0x1d0e('0x1a'));return rp(_0x38e47d)[_0x1d0e('0xf')](function(_0x3603af){if(_0x3603af){var _0x34bff5=_0x3603af[_0x1d0e('0x10')];var _0x4de627=![];var _0x333b7d=null;if(_0x400c4c[_0x1d0e('0x1b')]!==null){logger[_0x1d0e('0x15')](_0x1d0e('0x1c'),_0x400c4c[_0x1d0e('0x1b')]);_0x400c4c['userEmail']=_0x400c4c[_0x1d0e('0x1b')];for(_0x333b7d=0x0;_0x333b7d<_0x34bff5[_0x1d0e('0x11')];_0x333b7d++){if(_0x34bff5[_0x333b7d][_0x1d0e('0x12')]===_0x400c4c[_0x1d0e('0x1b')]){_0x4de627=!![];_0x400c4c['userId']=_0x34bff5[_0x333b7d]['id'];logger[_0x1d0e('0x15')](_0x1d0e('0x1d'),_0x400c4c[_0x1d0e('0x1e')]);}}}if(!_0x4de627){logger['info'](_0x1d0e('0x1f'));_0x400c4c[_0x1d0e('0x20')]=_0x400c4c[_0x1d0e('0x13')];_0x400c4c[_0x1d0e('0x1e')]=_0x400c4c[_0x1d0e('0x14')];_0x4de627=!![];}if(_0x4de627){_0x5bd7af(_0x400c4c);}else{_0xb11ff6({'statusCode':0x194,'message':_0x1d0e('0x17')});}}else{_0xb11ff6({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x1d0e('0x21')](function(_0x18c253){logger[_0x1d0e('0x18')]('['+[_0x35234b[_0x1d0e('0x19')]()]+']',_0x18c253[_0x1d0e('0x22')]);_0xb11ff6(_0x18c253);});});};}function searchContact(_0x35e6e8,_0x4053af,_0x540fc7,_0x2830ce){return new Promise(function(_0x1e7d1a,_0x5d528a){var _0x1dd437={'method':_0x1d0e('0xb'),'headers':_0x4053af,'uri':_0x35e6e8+'/api/lookup?q='+_0x2830ce+'&f='+_0x540fc7+_0x1d0e('0x23'),'json':!![]};rp(_0x1dd437)[_0x1d0e('0xf')](function(_0xaf38e9){var _0x290b7f=_['find'](_0xaf38e9['contacts'][_0x1d0e('0x24')],[_0x540fc7,_0x2830ce]);_0x1e7d1a(_0x290b7f);})[_0x1d0e('0x21')](function(_0xcebd9b){_0x5d528a(_0xcebd9b);});});}function getEndUser(_0x4cabe8,_0x4d37c6,_0xb9e41f){return function(_0x1837a2){return new Promise(function(_0x4ccf41,_0x6df9a5){logger[_0x1d0e('0x15')](util['format']('Searching\x20contact\x20with\x20phone\x20%s',_0x1837a2[_0x1d0e('0x25')]));searchContact(_0xb9e41f,_0x4d37c6,_0x1d0e('0x26'),_0x1837a2[_0x1d0e('0x25')])[_0x1d0e('0xf')](function(_0x316aac){if(_0x316aac){_0x1837a2[_0x1d0e('0x27')]=_0x316aac['id'];logger[_0x1d0e('0x15')](_0x1d0e('0x28'),_0x1837a2['endUserId']);return _0x4ccf41(_0x1837a2);}searchContact(_0xb9e41f,_0x4d37c6,_0x1d0e('0x29'),_0x1837a2[_0x1d0e('0x25')])['then'](function(_0x31637d){if(_0x31637d){_0x1837a2[_0x1d0e('0x27')]=_0x31637d['id'];logger['info'](_0x1d0e('0x2a'),_0x1837a2[_0x1d0e('0x27')]);return _0x4ccf41(_0x1837a2);}createEndUser(_0x1837a2,_0x4cabe8,_0x4d37c6,_0xb9e41f)[_0x1d0e('0xf')](function(_0x4869d3){logger[_0x1d0e('0x15')](_0x1d0e('0x2b'),_0x4869d3[_0x1d0e('0x27')]);return _0x4ccf41(_0x4869d3);});});})['catch'](function(_0x5bd106){_0x6df9a5(_0x5bd106);});});};}function createEndUser(_0x24dae4,_0x1572df,_0x16559b,_0x1650cd){return new Promise(function(_0x3a5eb9,_0x2891fd){var _0x526273=moment();var _0x49dd3b={'method':'POST','uri':_0x1650cd+'/api/contacts','body':{'contact':{'last_name':_0x24dae4[_0x1d0e('0x25')],'work_number':_0x24dae4[_0x1d0e('0x25')],'mobile_number':_0x24dae4['contactNumber'],'owner_id':_0x24dae4[_0x1d0e('0x1e')],'created_at':_0x526273[_0x1d0e('0x2c')](_0x1d0e('0x2d'))}},'json':!![]};_0x49dd3b[_0x1d0e('0xd')]=_0x16559b;logger[_0x1d0e('0x15')](_0x1d0e('0x2e'));return rp(_0x49dd3b)[_0x1d0e('0xf')](function(_0x4af6ff){_0x24dae4[_0x1d0e('0x27')]=_0x4af6ff[_0x1d0e('0x2f')]['id'];_0x3a5eb9(_0x24dae4);})[_0x1d0e('0x21')](function(_0x5ad052){logger[_0x1d0e('0x18')]('['+[_0x1572df[_0x1d0e('0x19')]()]+']',_0x5ad052[_0x1d0e('0x22')]);_0x2891fd(_0x5ad052[_0x1d0e('0x22')]);});});}function getTicket(_0x3484ca,_0x4ec1bf,_0x5a14eb,_0xae5321,_0x551aa1){return function(_0x3ce179){logger[_0x1d0e('0x15')](_0x1d0e('0x30'));return new Promise(function(_0x5073db,_0x3bee1b){var _0x5e43f6=moment();var _0x3e9080={'method':_0x1d0e('0x31'),'uri':_0x5a14eb+_0x1d0e('0x32'),'body':{'title':intUtil[_0x1d0e('0x33')](_0xae5321[_0x1d0e('0x34')],_0x551aa1,'\x20'),'description':intUtil['getString'](_0xae5321[_0x1d0e('0x35')],_0x551aa1,'\x0a'),'owner_id':_0x3ce179[_0x1d0e('0x1e')],'creater_id':_0x3ce179[_0x1d0e('0x14')],'targetable_id':_0x3ce179[_0x1d0e('0x27')],'targetable_type':_0x1d0e('0x36'),'created_at':_0x5e43f6[_0x1d0e('0x2c')](_0x1d0e('0x2d')),'due_date':_0x5e43f6[_0x1d0e('0x37')](0x1e,'m')[_0x1d0e('0x2c')](_0x1d0e('0x2d'))},'json':!![]};_0x3e9080[_0x1d0e('0xd')]=_0x4ec1bf;return rp(_0x3e9080)[_0x1d0e('0xf')](function(_0x128433){_0x3ce179[_0x1d0e('0x38')]=_0x128433[_0x1d0e('0x39')]['id'];logger[_0x1d0e('0x15')](_0x1d0e('0x3a'),_0x3ce179[_0x1d0e('0x38')]);_0x5073db(_0x3ce179);})['catch'](function(_0x1dd4b5){logger[_0x1d0e('0x18')]('['+[_0x3484ca[_0x1d0e('0x19')]()]+']',_0x1dd4b5['message']);_0x3bee1b(_0x1dd4b5[_0x1d0e('0x22')]);});});};}function emit(_0x2cc3b4,_0x3e1be4,_0x1f7aa6){var _0x119916={'uri':_0x2cc3b4+_0x1d0e('0x3b')+_0x1f7aa6};io['to'](util[_0x1d0e('0x2c')](_0x1d0e('0x3c'),_0x3e1be4))[_0x1d0e('0x3d')]('trigger:browser:url',_0x119916);}exports['cs']=function(_0x1506f3,_0x1e39ca,_0x475dce,_0x2eb508,_0x5c5268,_0x383533,_0x14d25d,_0x55c422){var _0x40b096={};var _0x152489={'Authorization':_0x1d0e('0x3e')+_0x383533['apiKey']};_0x383533['remoteUri']=intUtil['stripTrailingSlash'](_0x383533[_0x1d0e('0x3f')]);_0x383533[_0x1d0e('0x40')]=intUtil[_0x1d0e('0x41')](_0x383533[_0x1d0e('0x40')]);var _0x1bacc6=_0x383533[_0x1d0e('0x3f')];_0x40b096[_0x1d0e('0x13')]=_0x383533[_0x1d0e('0x42')];_0x40b096[_0x1d0e('0x25')]=_0x55c422[_0x1d0e('0x43')]()==='outbound'?_0x1e39ca[_0x1d0e('0x44')]:_0x1e39ca[_0x1d0e('0x45')];_0x40b096['callDirection']=_0x55c422==='queue'||_0x55c422===_0x1d0e('0x46')?'queue':_0x1d0e('0x47');if(_0x2eb508){_0x40b096[_0x1d0e('0x1b')]=_0x2eb508['email'];}var _0x5f0ead=util[_0x1d0e('0x2c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x383533[_0x1d0e('0x40')],_0x1e39ca['uniqueid'],md5(_0x1e39ca['uniqueid']));if(_0x5c5268&&_0x5c5268[_0x1d0e('0x48')]){logger[_0x1d0e('0x15')](_0x1d0e('0x49'),_0x1d0e('0x4a'));_0x1e39ca[_0x1d0e('0x4b')]=_0x5f0ead;}else if(_0x14d25d&&_0x14d25d[_0x1d0e('0x4c')]&&_0x14d25d[_0x1d0e('0x4c')]!==_0x1d0e('0x4d')){logger[_0x1d0e('0x15')](_0x1d0e('0x4e'),'Recording\x20is\x20enabled!');_0x1e39ca[_0x1d0e('0x4b')]=_0x5f0ead;}else{_0x1e39ca[_0x1d0e('0x4b')]='';}return getAdminId(_0x40b096,_0x55c422,_0x152489,_0x1bacc6)[_0x1d0e('0xf')](getUser(_0x55c422,_0x152489,_0x1bacc6))[_0x1d0e('0xf')](getEndUser(_0x55c422,_0x152489,_0x1bacc6))[_0x1d0e('0xf')](getTicket(_0x55c422,_0x152489,_0x1bacc6,_0x475dce,_0x1e39ca))[_0x1d0e('0xf')](function(_0x1cd248){logger[_0x1d0e('0x15')](util['format'](_0x1d0e('0x4f'),_0x1cd248[_0x1d0e('0x38')]));if(_0x55c422!==_0x1d0e('0x46')){logger[_0x1d0e('0x15')]('['+[_0x55c422[_0x1d0e('0x19')]()]+']',_0x1d0e('0x50'));emit(_0x1bacc6,_0x2eb508[_0x1d0e('0x51')],_0x1cd248[_0x1d0e('0x27')]);}})[_0x1d0e('0x21')](function(_0x714d33){logger[_0x1d0e('0x18')]('['+[_0x55c422[_0x1d0e('0x19')]()]+_0x1d0e('0x52'),util[_0x1d0e('0x53')](_0x714d33,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x63ef=['format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','headers','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','/api/tasks','getString','Contact','add','ticketId','Task\x20created:','/contacts/','user:%s','emit','Token\x20token=','stripTrailingSlash','remoteUri','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','serverUrl','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','util','moment','bluebird','ioredis','./util','../../../../config/environment','freshsales','redis','defaults','localhost','GET','/api/selector/owners','info','Getting\x20admin\x20information','then','users','length','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','error','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','User\x20found:','userId','Admin\x20selected','catch','toUpperCase','/api/lookup?q=','&f=','&entities=contact','find','contacts'];(function(_0x53cc73,_0x23e1fd){var _0x13e91d=function(_0x551a1a){while(--_0x551a1a){_0x53cc73['push'](_0x53cc73['shift']());}};_0x13e91d(++_0x23e1fd);}(_0x63ef,0x80));var _0xf63e=function(_0x43b08,_0x15f967){_0x43b08=_0x43b08-0x0;var _0x5e05f4=_0x63ef[_0x43b08];return _0x5e05f4;};'use strict';var _=require(_0xf63e('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xf63e('0x1'));var moment=require(_0xf63e('0x2'));var Promise=require(_0xf63e('0x3'));var Redis=require(_0xf63e('0x4'));var intUtil=require(_0xf63e('0x5'));var config=require(_0xf63e('0x6'));var logger=require('../../../../config/logger')(_0xf63e('0x7'));config[_0xf63e('0x8')]=_[_0xf63e('0x9')](config[_0xf63e('0x8')],{'host':_0xf63e('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminId(_0x1c1001,_0xacde63,_0x5ebdfc,_0x37bdd6){return new Promise(function(_0x1a8413,_0x2af192){var _0x2fdf04=![];var _0x492367={'method':_0xf63e('0xb'),'uri':_0x37bdd6+_0xf63e('0xc'),'json':!![]};_0x492367['headers']=_0x5ebdfc;logger[_0xf63e('0xd')](_0xf63e('0xe'));return rp(_0x492367)[_0xf63e('0xf')](function(_0x46c3fe){if(_0x46c3fe){var _0x5b54c2=_0x46c3fe[_0xf63e('0x10')];var _0x1f45ce=null;for(_0x1f45ce=0x0;_0x1f45ce<_0x5b54c2[_0xf63e('0x11')];_0x1f45ce++){if(_0x5b54c2[_0x1f45ce]['email']===_0x1c1001[_0xf63e('0x12')]){_0x1c1001[_0xf63e('0x13')]=_0x5b54c2[_0x1f45ce]['id'];_0x2fdf04=!![];}}if(_0x2fdf04){logger[_0xf63e('0xd')](_0xf63e('0x14'),_0x1c1001[_0xf63e('0x13')]);_0x1a8413(_0x1c1001);}else{_0x2af192({'statusCode':0x194,'message':_0xf63e('0x15')});}}else{_0x2af192({'statusCode':0x194,'message':_0xf63e('0x15')});}})['catch'](function(_0x52b3d9){logger[_0xf63e('0x16')]('['+[_0xacde63['toUpperCase']()]+']',_0x52b3d9[_0xf63e('0x17')]);_0x2af192(_0x52b3d9);});});}function getUser(_0x16b74e,_0x365f0b,_0x41bfbf){return function(_0x24d349){return new Promise(function(_0x4b634f,_0x2b4c4f){var _0x864e89={'method':_0xf63e('0xb'),'uri':_0x41bfbf+_0xf63e('0xc'),'json':!![]};_0x864e89['headers']=_0x365f0b;logger[_0xf63e('0xd')](_0xf63e('0x18'));return rp(_0x864e89)[_0xf63e('0xf')](function(_0x5fc339){if(_0x5fc339){var _0x32f8ab=_0x5fc339['users'];var _0x32b3f3=![];var _0x4e720d=null;if(_0x24d349[_0xf63e('0x19')]!==null){logger[_0xf63e('0xd')](_0xf63e('0x1a'),_0x24d349[_0xf63e('0x19')]);_0x24d349[_0xf63e('0x1b')]=_0x24d349['agentEmail'];for(_0x4e720d=0x0;_0x4e720d<_0x32f8ab[_0xf63e('0x11')];_0x4e720d++){if(_0x32f8ab[_0x4e720d]['email']===_0x24d349[_0xf63e('0x19')]){_0x32b3f3=!![];_0x24d349['userId']=_0x32f8ab[_0x4e720d]['id'];logger[_0xf63e('0xd')](_0xf63e('0x1c'),_0x24d349[_0xf63e('0x1d')]);}}}if(!_0x32b3f3){logger['info'](_0xf63e('0x1e'));_0x24d349[_0xf63e('0x1b')]=_0x24d349['adminEmail'];_0x24d349[_0xf63e('0x1d')]=_0x24d349[_0xf63e('0x13')];_0x32b3f3=!![];}if(_0x32b3f3){_0x4b634f(_0x24d349);}else{_0x2b4c4f({'statusCode':0x194,'message':_0xf63e('0x15')});}}else{_0x2b4c4f({'statusCode':0x194,'message':_0xf63e('0x15')});}})[_0xf63e('0x1f')](function(_0x5a8655){logger[_0xf63e('0x16')]('['+[_0x16b74e[_0xf63e('0x20')]()]+']',_0x5a8655[_0xf63e('0x17')]);_0x2b4c4f(_0x5a8655);});});};}function searchContact(_0x1872f9,_0x529425,_0x4af9ea,_0x4b36bc){return new Promise(function(_0x288a5c,_0x56336e){var _0x38b12f={'method':'GET','headers':_0x529425,'uri':_0x1872f9+_0xf63e('0x21')+_0x4b36bc+_0xf63e('0x22')+_0x4af9ea+_0xf63e('0x23'),'json':!![]};rp(_0x38b12f)[_0xf63e('0xf')](function(_0x171edb){var _0x3ea237=_[_0xf63e('0x24')](_0x171edb[_0xf63e('0x25')][_0xf63e('0x25')],[_0x4af9ea,_0x4b36bc]);_0x288a5c(_0x3ea237);})[_0xf63e('0x1f')](function(_0x2a28fe){_0x56336e(_0x2a28fe);});});}function getEndUser(_0x23ef7b,_0x2dddc5,_0x384d33){return function(_0x23d551){return new Promise(function(_0x2d1947,_0x5edf65){logger['info'](util[_0xf63e('0x26')](_0xf63e('0x27'),_0x23d551[_0xf63e('0x28')]));searchContact(_0x384d33,_0x2dddc5,_0xf63e('0x29'),_0x23d551['contactNumber'])[_0xf63e('0xf')](function(_0x237884){if(_0x237884){_0x23d551[_0xf63e('0x2a')]=_0x237884['id'];logger['info'](_0xf63e('0x2b'),_0x23d551[_0xf63e('0x2a')]);return _0x2d1947(_0x23d551);}searchContact(_0x384d33,_0x2dddc5,_0xf63e('0x2c'),_0x23d551[_0xf63e('0x28')])['then'](function(_0x49b1ed){if(_0x49b1ed){_0x23d551[_0xf63e('0x2a')]=_0x49b1ed['id'];logger[_0xf63e('0xd')]('Contact\x20found\x20work_number:',_0x23d551['endUserId']);return _0x2d1947(_0x23d551);}createEndUser(_0x23d551,_0x23ef7b,_0x2dddc5,_0x384d33)[_0xf63e('0xf')](function(_0x247463){logger[_0xf63e('0xd')]('Contact\x20created:',_0x247463[_0xf63e('0x2a')]);return _0x2d1947(_0x247463);});});})[_0xf63e('0x1f')](function(_0x393e47){_0x5edf65(_0x393e47);});});};}function createEndUser(_0x540b00,_0x47b58f,_0x55b562,_0x1e65d9){return new Promise(function(_0x4409ad,_0x1a9549){var _0x1a0f23=moment();var _0x10af65={'method':_0xf63e('0x2d'),'uri':_0x1e65d9+_0xf63e('0x2e'),'body':{'contact':{'last_name':_0x540b00['contactNumber'],'work_number':_0x540b00[_0xf63e('0x28')],'mobile_number':_0x540b00[_0xf63e('0x28')],'owner_id':_0x540b00[_0xf63e('0x1d')],'created_at':_0x1a0f23['format'](_0xf63e('0x2f'))}},'json':!![]};_0x10af65[_0xf63e('0x30')]=_0x55b562;logger['info'](_0xf63e('0x31'));return rp(_0x10af65)[_0xf63e('0xf')](function(_0x1ce190){_0x540b00[_0xf63e('0x2a')]=_0x1ce190[_0xf63e('0x32')]['id'];_0x4409ad(_0x540b00);})[_0xf63e('0x1f')](function(_0x43eb0b){logger[_0xf63e('0x16')]('['+[_0x47b58f['toUpperCase']()]+']',_0x43eb0b[_0xf63e('0x17')]);_0x1a9549(_0x43eb0b[_0xf63e('0x17')]);});});}function getTicket(_0x143b70,_0x3939b6,_0x206f4f,_0x311a45,_0x553080){return function(_0x278913){logger[_0xf63e('0xd')]('Creating\x20new\x20task');return new Promise(function(_0x57181a,_0xe519e5){var _0x274466=moment();var _0x5bcc3b={'method':_0xf63e('0x2d'),'uri':_0x206f4f+_0xf63e('0x33'),'body':{'title':intUtil['getString'](_0x311a45['Subjects'],_0x553080,'\x20'),'description':intUtil[_0xf63e('0x34')](_0x311a45['Descriptions'],_0x553080,'\x0a'),'owner_id':_0x278913[_0xf63e('0x1d')],'creater_id':_0x278913['adminId'],'targetable_id':_0x278913[_0xf63e('0x2a')],'targetable_type':_0xf63e('0x35'),'created_at':_0x274466[_0xf63e('0x26')](_0xf63e('0x2f')),'due_date':_0x274466[_0xf63e('0x36')](0x1e,'m')[_0xf63e('0x26')](_0xf63e('0x2f'))},'json':!![]};_0x5bcc3b[_0xf63e('0x30')]=_0x3939b6;return rp(_0x5bcc3b)[_0xf63e('0xf')](function(_0x59838c){_0x278913[_0xf63e('0x37')]=_0x59838c['task']['id'];logger[_0xf63e('0xd')](_0xf63e('0x38'),_0x278913[_0xf63e('0x37')]);_0x57181a(_0x278913);})[_0xf63e('0x1f')](function(_0x5b29da){logger[_0xf63e('0x16')]('['+[_0x143b70['toUpperCase']()]+']',_0x5b29da[_0xf63e('0x17')]);_0xe519e5(_0x5b29da['message']);});});};}function emit(_0x486baa,_0x451c56,_0xa16397){var _0x51cbfd={'uri':_0x486baa+_0xf63e('0x39')+_0xa16397};io['to'](util['format'](_0xf63e('0x3a'),_0x451c56))[_0xf63e('0x3b')]('trigger:browser:url',_0x51cbfd);}exports['cs']=function(_0x5e92f9,_0x2ea247,_0xc4d25f,_0xfcbd66,_0x2fca68,_0x4116f1,_0x1298ea,_0x35f9bd){var _0x178799={};var _0x5dde46={'Authorization':_0xf63e('0x3c')+_0x4116f1['apiKey']};_0x4116f1['remoteUri']=intUtil[_0xf63e('0x3d')](_0x4116f1[_0xf63e('0x3e')]);_0x4116f1['serverUrl']=intUtil[_0xf63e('0x3d')](_0x4116f1['serverUrl']);var _0x28c811=_0x4116f1['remoteUri'];_0x178799['adminEmail']=_0x4116f1[_0xf63e('0x3f')];_0x178799[_0xf63e('0x28')]=_0x35f9bd[_0xf63e('0x40')]()===_0xf63e('0x41')?_0x2ea247[_0xf63e('0x42')]:_0x2ea247[_0xf63e('0x43')];_0x178799[_0xf63e('0x44')]=_0x35f9bd===_0xf63e('0x45')||_0x35f9bd===_0xf63e('0x46')?'queue':_0xf63e('0x41');if(_0xfcbd66){_0x178799[_0xf63e('0x19')]=_0xfcbd66['email'];}var _0x3bf8d1=util[_0xf63e('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4116f1[_0xf63e('0x47')],_0x2ea247[_0xf63e('0x48')],md5(_0x2ea247['uniqueid']));if(_0x2fca68&&_0x2fca68[_0xf63e('0x49')]){logger['info'](_0xf63e('0x4a'),_0xf63e('0x4b'));_0x2ea247[_0xf63e('0x4c')]=_0x3bf8d1;}else if(_0x1298ea&&_0x1298ea[_0xf63e('0x4d')]&&_0x1298ea['recordingFormat']!==_0xf63e('0x4e')){logger[_0xf63e('0xd')](_0xf63e('0x4f'),_0xf63e('0x4b'));_0x2ea247['recordingURL']=_0x3bf8d1;}else{_0x2ea247[_0xf63e('0x4c')]='';}return getAdminId(_0x178799,_0x35f9bd,_0x5dde46,_0x28c811)[_0xf63e('0xf')](getUser(_0x35f9bd,_0x5dde46,_0x28c811))[_0xf63e('0xf')](getEndUser(_0x35f9bd,_0x5dde46,_0x28c811))[_0xf63e('0xf')](getTicket(_0x35f9bd,_0x5dde46,_0x28c811,_0xc4d25f,_0x2ea247))[_0xf63e('0xf')](function(_0x3f2da5){logger[_0xf63e('0xd')](util[_0xf63e('0x26')](_0xf63e('0x50'),_0x3f2da5[_0xf63e('0x37')]));if(_0x35f9bd!==_0xf63e('0x46')){logger[_0xf63e('0xd')]('['+[_0x35f9bd[_0xf63e('0x20')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x28c811,_0xfcbd66['name'],_0x3f2da5[_0xf63e('0x2a')]);}})[_0xf63e('0x1f')](function(_0x5acd43){logger[_0xf63e('0x16')]('['+[_0x35f9bd[_0xf63e('0x20')]()]+_0xf63e('0x51'),util[_0xf63e('0x52')](_0x5acd43,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 95578a3..864d8be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c3a=['lodash','./zendesk','./salesforce','./freshdesk','./desk','./vtiger','./servicenow','./freshsales','salesforce','freshdesk','zoho','desk','vtiger','servicenow','exec','includes','data1','toLowerCase','find','Configurations','data3','queue','outbound','EVENT\x20UNKNOWN','unmanaged','zendesk','sugarcrm','freshsales','dynamics365','log','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','data2'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0c3a,0x90));var _0xa0c3=function(_0x4b90f8,_0x3a3331){_0x4b90f8=_0x4b90f8-0x0;var _0x3723f3=_0x0c3a[_0x4b90f8];return _0x3723f3;};'use strict';var _=require(_0xa0c3('0x0'));var util=require('util');var zendesk=require(_0xa0c3('0x1'));var salesforce=require(_0xa0c3('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0xa0c3('0x3'));var zoho=require('./zoho');var desk=require(_0xa0c3('0x4'));var vtiger=require(_0xa0c3('0x5'));var servicenow=require(_0xa0c3('0x6'));var dynamics365=require('./dynamics365');var freshsales=require(_0xa0c3('0x7'));var integrations=['zendesk',_0xa0c3('0x8'),'sugarcrm',_0xa0c3('0x9'),_0xa0c3('0xa'),_0xa0c3('0xb'),_0xa0c3('0xc'),'dynamics365','freshsales',_0xa0c3('0xd')];exports[_0xa0c3('0xe')]=function(_0x21771c,_0x41d326,_0x317a45,_0x112976,_0x2e2794,_0x8b87d1){if(_0x317a45){if(_[_0xa0c3('0xf')](integrations,_0x21771c[_0xa0c3('0x10')][_0xa0c3('0x11')]())){try{var _0x434f20=null;var _0x2c2cff='';var _0x28c0d7=_0x317a45[_0x21771c[_0xa0c3('0x10')]['toLowerCase']()];if(_0x28c0d7){var _0x402758=_0x28c0d7[_0x21771c['data2']];if(_0x402758){var _0x411925=_[_0xa0c3('0x12')](_0x402758[_0xa0c3('0x13')],{'id':parseInt(_0x21771c[_0xa0c3('0x14')],0xa)});if(_0x411925){if(_0x112976){if(_0x2e2794&&_0x41d326[_0xa0c3('0x15')]){_0x2c2cff=_0xa0c3('0x15');}else if(_0x41d326['routeId']){_0x2c2cff=_0xa0c3('0x16');}else{console['log'](_0xa0c3('0x17'),_0x41d326);}}else{_0x2c2cff=_0xa0c3('0x18');}switch(_0x21771c['data1'][_0xa0c3('0x11')]()){case _0xa0c3('0x19'):zendesk[_0x2c2cff](_0x21771c,_0x41d326,_0x411925,_0x112976,_0x2e2794,_0x402758,_0x8b87d1);break;case _0xa0c3('0x8'):salesforce[_0x2c2cff](_0x21771c,_0x41d326,_0x411925,_0x112976,_0x2e2794,_0x402758,_0x8b87d1);break;case _0xa0c3('0x1a'):sugarcrm[_0x2c2cff](_0x21771c,_0x41d326,_0x411925,_0x112976,_0x2e2794,_0x402758,_0x8b87d1);break;case _0xa0c3('0x9'):freshdesk[_0x2c2cff](_0x21771c,_0x41d326,_0x411925,_0x112976,_0x2e2794,_0x402758,_0x8b87d1);break;case _0xa0c3('0xa'):zoho[_0x2c2cff](_0x21771c,_0x41d326,_0x411925,_0x112976,_0x2e2794,_0x402758,_0x8b87d1);break;case _0xa0c3('0xb'):desk[_0x2c2cff](_0x21771c,_0x41d326,_0x411925,_0x112976,_0x2e2794,_0x402758,_0x8b87d1);break;case _0xa0c3('0xc'):vtiger[_0x2c2cff](_0x21771c,_0x41d326,_0x411925,_0x112976,_0x2e2794,_0x402758,_0x8b87d1);break;case _0xa0c3('0x1b'):freshsales['cs'](_0x21771c,_0x41d326,_0x411925,_0x112976,_0x2e2794,_0x402758,_0x8b87d1,_0x2c2cff);break;case _0xa0c3('0xd'):servicenow['cs'](_0x21771c,_0x41d326,_0x411925,_0x112976,_0x2e2794,_0x402758,_0x8b87d1,_0x2c2cff);break;case _0xa0c3('0x1c'):dynamics365['cs'](_0x21771c,_0x41d326,_0x411925,_0x112976,_0x2e2794,_0x402758,_0x8b87d1,_0x2c2cff);break;default:console[_0xa0c3('0x1d')](_0xa0c3('0x1e'));}}else{_0x434f20=require(_0xa0c3('0x1f'))(_0x21771c[_0xa0c3('0x10')]['toLowerCase']());_0x434f20[_0xa0c3('0x20')](_0xa0c3('0x21'),util[_0xa0c3('0x22')]('%s\x20configuration\x20#%s\x20not\x20found',_0x21771c[_0xa0c3('0x10')][_0xa0c3('0x11')](),_0x21771c['data3']));}}else{_0x434f20=require(_0xa0c3('0x1f'))(_0x21771c[_0xa0c3('0x10')][_0xa0c3('0x11')]());_0x434f20[_0xa0c3('0x20')](_0xa0c3('0x21'),util[_0xa0c3('0x22')]('%s\x20account\x20#%s\x20not\x20found',_0x21771c['data1'][_0xa0c3('0x11')](),_0x21771c[_0xa0c3('0x23')]));}}else{}}catch(_0x4428c1){console[_0xa0c3('0x20')](_0x4428c1);}}}};
\ No newline at end of file
+var _0x70ff=['outbound','log','EVENT\x20UNKNOWN','unmanaged','unknown\x20integration','error','format','%s\x20configuration\x20#%s\x20not\x20found','data3','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','freshdesk','zoho','desk','vtiger','freshsales','servicenow','includes','data1','toLowerCase','data2','find','queue','routeId'];(function(_0x5b48fa,_0xef0e9b){var _0xc52987=function(_0xcb5ef0){while(--_0xcb5ef0){_0x5b48fa['push'](_0x5b48fa['shift']());}};_0xc52987(++_0xef0e9b);}(_0x70ff,0x1a2));var _0xf70f=function(_0x502eb0,_0x6d0814){_0x502eb0=_0x502eb0-0x0;var _0x4f78e4=_0x70ff[_0x502eb0];return _0x4f78e4;};'use strict';var _=require(_0xf70f('0x0'));var util=require(_0xf70f('0x1'));var zendesk=require(_0xf70f('0x2'));var salesforce=require(_0xf70f('0x3'));var sugarcrm=require(_0xf70f('0x4'));var freshdesk=require(_0xf70f('0x5'));var zoho=require('./zoho');var desk=require(_0xf70f('0x6'));var vtiger=require(_0xf70f('0x7'));var servicenow=require(_0xf70f('0x8'));var dynamics365=require(_0xf70f('0x9'));var freshsales=require(_0xf70f('0xa'));var integrations=[_0xf70f('0xb'),_0xf70f('0xc'),'sugarcrm',_0xf70f('0xd'),_0xf70f('0xe'),_0xf70f('0xf'),_0xf70f('0x10'),'dynamics365',_0xf70f('0x11'),_0xf70f('0x12')];exports['exec']=function(_0x182016,_0x4b1ebf,_0x22f1f9,_0x3ddc20,_0x24a923,_0x4af47e){if(_0x22f1f9){if(_[_0xf70f('0x13')](integrations,_0x182016[_0xf70f('0x14')][_0xf70f('0x15')]())){try{var _0x458ae6=null;var _0x5aaa33='';var _0x5a5f8f=_0x22f1f9[_0x182016[_0xf70f('0x14')][_0xf70f('0x15')]()];if(_0x5a5f8f){var _0x329ffc=_0x5a5f8f[_0x182016[_0xf70f('0x16')]];if(_0x329ffc){var _0x56986a=_[_0xf70f('0x17')](_0x329ffc['Configurations'],{'id':parseInt(_0x182016['data3'],0xa)});if(_0x56986a){if(_0x3ddc20){if(_0x24a923&&_0x4b1ebf[_0xf70f('0x18')]){_0x5aaa33=_0xf70f('0x18');}else if(_0x4b1ebf[_0xf70f('0x19')]){_0x5aaa33=_0xf70f('0x1a');}else{console[_0xf70f('0x1b')](_0xf70f('0x1c'),_0x4b1ebf);}}else{_0x5aaa33=_0xf70f('0x1d');}switch(_0x182016[_0xf70f('0x14')][_0xf70f('0x15')]()){case _0xf70f('0xb'):zendesk[_0x5aaa33](_0x182016,_0x4b1ebf,_0x56986a,_0x3ddc20,_0x24a923,_0x329ffc,_0x4af47e);break;case _0xf70f('0xc'):salesforce[_0x5aaa33](_0x182016,_0x4b1ebf,_0x56986a,_0x3ddc20,_0x24a923,_0x329ffc,_0x4af47e);break;case'sugarcrm':sugarcrm[_0x5aaa33](_0x182016,_0x4b1ebf,_0x56986a,_0x3ddc20,_0x24a923,_0x329ffc,_0x4af47e);break;case _0xf70f('0xd'):freshdesk[_0x5aaa33](_0x182016,_0x4b1ebf,_0x56986a,_0x3ddc20,_0x24a923,_0x329ffc,_0x4af47e);break;case'zoho':zoho[_0x5aaa33](_0x182016,_0x4b1ebf,_0x56986a,_0x3ddc20,_0x24a923,_0x329ffc,_0x4af47e);break;case'desk':desk[_0x5aaa33](_0x182016,_0x4b1ebf,_0x56986a,_0x3ddc20,_0x24a923,_0x329ffc,_0x4af47e);break;case _0xf70f('0x10'):vtiger[_0x5aaa33](_0x182016,_0x4b1ebf,_0x56986a,_0x3ddc20,_0x24a923,_0x329ffc,_0x4af47e);break;case'freshsales':freshsales['cs'](_0x182016,_0x4b1ebf,_0x56986a,_0x3ddc20,_0x24a923,_0x329ffc,_0x4af47e,_0x5aaa33);break;case _0xf70f('0x12'):servicenow['cs'](_0x182016,_0x4b1ebf,_0x56986a,_0x3ddc20,_0x24a923,_0x329ffc,_0x4af47e,_0x5aaa33);break;case'dynamics365':dynamics365['cs'](_0x182016,_0x4b1ebf,_0x56986a,_0x3ddc20,_0x24a923,_0x329ffc,_0x4af47e,_0x5aaa33);break;default:console[_0xf70f('0x1b')](_0xf70f('0x1e'));}}else{_0x458ae6=require('../../../../config/logger')(_0x182016['data1']['toLowerCase']());_0x458ae6[_0xf70f('0x1f')]('[EXEC]',util[_0xf70f('0x20')](_0xf70f('0x21'),_0x182016[_0xf70f('0x14')][_0xf70f('0x15')](),_0x182016[_0xf70f('0x22')]));}}else{_0x458ae6=require(_0xf70f('0x23'))(_0x182016[_0xf70f('0x14')][_0xf70f('0x15')]());_0x458ae6[_0xf70f('0x1f')]('[EXEC]',util[_0xf70f('0x20')](_0xf70f('0x24'),_0x182016[_0xf70f('0x14')]['toLowerCase'](),_0x182016[_0xf70f('0x16')]));}}else{}}catch(_0x1d4b54){console[_0xf70f('0x1f')](_0x1d4b54);}}}};
\ No newline at end of file
index c921f98..6263798 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81f4=['WhoId','account','WhatId','ticketType','Case','ContactId','AccountId','lead','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','validateEmail','User','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','identity','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','account_contact_lead','additionalSearchAccount','Account','Lead','Phone','attributes','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','<unknown>','format','Caller\x20-\x20%s','No\x20Company','upperFirst','forEach','includes','picklist','idField','content','toString','variableName','customVariable','Variable','toLowerCase','securityToken','remoteUri','https://login.salesforce.com','login','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','name','integrationTab','trigger:salesforce:display','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','Salesforce\x20account\x20type\x20not\x20recognized','catch','toUpperCase','isNil','lastevent',']\x20Ticket\x20%s\x20created.','lodash','request-promise','moment','util','./util','salesforce','redis','localhost','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','Task','utc','IsReminderSet','IsRecurrence','contact','endUserType'];(function(_0x223d34,_0x3e5231){var _0x2a32eb=function(_0xbf7aa){while(--_0xbf7aa){_0x223d34['push'](_0x223d34['shift']());}};_0x2a32eb(++_0x3e5231);}(_0x81f4,0x163));var _0x481f=function(_0x4040b7,_0x3bf5fd){_0x4040b7=_0x4040b7-0x0;var _0x456961=_0x81f4[_0x4040b7];return _0x456961;};'use strict';var _=require(_0x481f('0x0'));var rp=require(_0x481f('0x1'));var moment=require(_0x481f('0x2'));var BPromise=require('bluebird');var md5=require('md5');var jsforce=require('jsforce');var util=require(_0x481f('0x3'));var Redis=require('ioredis');var intUtil=require(_0x481f('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x481f('0x5'));config['redis']=_['defaults'](config[_0x481f('0x6')],{'host':_0x481f('0x7'),'port':0x18eb});var io=require(_0x481f('0x8'))(new Redis(config[_0x481f('0x6')]));function emit(_0x2d7345,_0x246675,_0x4044f3){io['to'](_0x2d7345)[_0x481f('0x9')](_0x246675,_0x4044f3);}function getTicket(_0x3ebbfc,_0x1e07bb,_0x1466dc,_0x3d31c9,_0x523a2a,_0x393a3f,_0x5949ed,_0x28f27b){var _0x30cb7d=Object[_0x481f('0xa')]({},{'OwnerId':_0x1e07bb['id'],'Subject':intUtil[_0x481f('0xb')](_0x3d31c9[_0x481f('0xc')],_0x523a2a,'\x20'),'Description':intUtil[_0x481f('0xb')](_0x3d31c9[_0x481f('0xd')],_0x523a2a,'\x0a')},getCustomFields(_0x393a3f,_0x523a2a));if(_0x1466dc){if(_0x3d31c9['ticketType']===_0x481f('0xe')){_0x30cb7d['ActivityDate']=moment[_0x481f('0xf')]();_0x30cb7d[_0x481f('0x10')]=![];_0x30cb7d[_0x481f('0x11')]=![];if(_0x1466dc['endUserType']===_0x481f('0x12')||_0x1466dc[_0x481f('0x13')]==='lead'){_0x30cb7d[_0x481f('0x14')]=_0x1466dc['id'];}else if(_0x1466dc[_0x481f('0x13')]===_0x481f('0x15')){_0x30cb7d[_0x481f('0x16')]=_0x1466dc['id'];}}else if(_0x3d31c9[_0x481f('0x17')]===_0x481f('0x18')){if(_0x1466dc[_0x481f('0x13')]===_0x481f('0x12')){_0x30cb7d[_0x481f('0x19')]=_0x1466dc['id'];}else if(_0x1466dc[_0x481f('0x13')]===_0x481f('0x15')){_0x30cb7d[_0x481f('0x1a')]=_0x1466dc['id'];}else if(_0x1466dc['endUserType']===_0x481f('0x1b')&&_0x3d31c9[_0x481f('0x1c')]){_0x30cb7d[_0x3d31c9['leadId']]=_0x1466dc['id'];}else{logger['info'](_0x481f('0x1d'));}}}return _0x5949ed[_0x481f('0x1e')](_0x3d31c9[_0x481f('0x17')])[_0x481f('0x1f')](_0x30cb7d);}function getUser(_0x36fe66,_0x149298,_0x5573de){if(!_['isNil'](_0x149298)&&intUtil[_0x481f('0x20')](_0x149298)){var _0x445c50={'Email':_0x149298};var _0x608f31={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5573de[_0x481f('0x1e')](_0x481f('0x21'))[_0x481f('0x22')](_0x445c50,_0x608f31)[_0x481f('0x23')]()[_0x481f('0x24')](function(_0x5ef1c6){if(_0x5ef1c6[_0x481f('0x25')]){var _0x5c7ff2=_[_0x481f('0x22')](_0x5ef1c6,function(_0xdda790){return _0xdda790[_0x481f('0x26')]===_0x149298;});if(_0x5c7ff2){logger['info'](_0x481f('0x27'),_0x149298);return BPromise[_0x481f('0x28')]({'id':_0x5c7ff2['Id'],'name':_0x5c7ff2[_0x481f('0x29')]});}}else{logger[_0x481f('0x2a')](_0x481f('0x2b'),_0x149298);return _0x5573de['identity']()[_0x481f('0x24')](function(_0xbfe4b0){return BPromise[_0x481f('0x28')]({'id':_0xbfe4b0[_0x481f('0x2c')],'name':_0xbfe4b0['display_name']});});}});}else{logger[_0x481f('0x2a')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x149298);return _0x5573de[_0x481f('0x2d')]()[_0x481f('0x24')](function(_0x3aec9f){return BPromise[_0x481f('0x28')]({'id':_0x3aec9f['user_id'],'name':_0x3aec9f[_0x481f('0x2e')]});});}}function getEndUser(_0x432dfd,_0x4fae80,_0x4a73c7,_0x2ee240,_0x3cdde9){var _0x59fa45={'$or':{'Phone':_0x2ee240}};var _0x2782fe={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x481f('0x24')](function(){logger['info'](_0x481f('0x2f'),_0x2ee240,_0x4fae80['moduleSearch']);switch(_0x4fae80[_0x481f('0x30')]){case _0x481f('0x31'):var _0x5d51f4=_[_0x481f('0x32')](_0x59fa45);if(_0x4fae80[_0x481f('0x33')]){var _0x2cb4f1={};_0x2cb4f1[_0x4fae80[_0x481f('0x33')]]=_0x2ee240;_[_0x481f('0x34')](_0x5d51f4[_0x481f('0x35')],_0x2cb4f1);}return _0x3cdde9['sobject'](_0x481f('0x36'))[_0x481f('0x22')](_0x5d51f4,_0x2782fe)['execute']()[_0x481f('0x24')](function(_0x1d5197){if(_0x1d5197&&_0x1d5197[_0x481f('0x25')]){return _0x1d5197;}else{var _0x497f15=_[_0x481f('0x32')](_0x59fa45);if(_0x4fae80['additionalSearchLead']){var _0x113292={};_0x113292[_0x4fae80[_0x481f('0x37')]]=_0x2ee240;_[_0x481f('0x34')](_0x497f15[_0x481f('0x35')],_0x113292);}return _0x3cdde9['sobject']('Lead')['find'](_0x497f15,_0x2782fe);}});case _0x481f('0x38'):var _0x9a5f9a=_[_0x481f('0x32')](_0x59fa45);if(_0x4fae80[_0x481f('0x39')]){var _0x2cb4f1={};_0x2cb4f1[_0x4fae80[_0x481f('0x39')]]=_0x2ee240;_['merge'](_0x9a5f9a[_0x481f('0x35')],_0x2cb4f1);}return _0x3cdde9[_0x481f('0x1e')](_0x481f('0x3a'))[_0x481f('0x22')](_0x9a5f9a,_0x2782fe)['execute']()['then'](function(_0x1562b9){if(_0x1562b9&&_0x1562b9['length']){return _0x1562b9;}else{var _0x1b2933=_[_0x481f('0x32')](_0x59fa45);if(_0x4fae80[_0x481f('0x33')]){var _0x4a7503={};_0x4a7503[_0x4fae80['additionalSearchContact']]=_0x2ee240;_[_0x481f('0x34')](_0x1b2933['$or'],_0x4a7503);}return _0x3cdde9['sobject'](_0x481f('0x36'))[_0x481f('0x22')](_0x1b2933,_0x2782fe)[_0x481f('0x24')](function(_0x5396ad){if(_0x5396ad&&_0x5396ad[_0x481f('0x25')]){return _0x5396ad;}else{var _0xa49f32=_['cloneDeep'](_0x59fa45);if(_0x4fae80[_0x481f('0x37')]){var _0x55e314={};_0x55e314[_0x4fae80[_0x481f('0x37')]]=_0x2ee240;_[_0x481f('0x34')](_0xa49f32[_0x481f('0x35')],_0x55e314);}return _0x3cdde9['sobject'](_0x481f('0x3b'))['find'](_0xa49f32,_0x2782fe);}});}});case _0x481f('0x12'):var _0x5d51f4=_[_0x481f('0x32')](_0x59fa45);if(_0x4fae80[_0x481f('0x33')]){var _0x2cb4f1={};_0x2cb4f1[_0x4fae80[_0x481f('0x33')]]=_0x2ee240;_[_0x481f('0x34')](_0x5d51f4[_0x481f('0x35')],_0x2cb4f1);}return _0x3cdde9[_0x481f('0x1e')](_0x481f('0x36'))[_0x481f('0x22')](_0x5d51f4,_0x2782fe)[_0x481f('0x23')]();case _0x481f('0x1b'):var _0xf9e297=_[_0x481f('0x32')](_0x59fa45);if(_0x4fae80[_0x481f('0x37')]){var _0x2cb4f1={};_0x2cb4f1[_0x4fae80[_0x481f('0x37')]]=_0x2ee240;_['merge'](_0xf9e297[_0x481f('0x35')],_0x2cb4f1);}return _0x3cdde9[_0x481f('0x1e')](_0x481f('0x3b'))[_0x481f('0x22')](_0xf9e297,_0x2782fe);case'account':var _0x9a5f9a=_[_0x481f('0x32')](_0x59fa45);if(_0x4fae80[_0x481f('0x39')]){var _0x2cb4f1={};_0x2cb4f1[_0x4fae80[_0x481f('0x39')]]=_0x2ee240;_['merge'](_0x9a5f9a[_0x481f('0x35')],_0x2cb4f1);}return _0x3cdde9[_0x481f('0x1e')](_0x481f('0x3a'))['find'](_0x9a5f9a,_0x2782fe);default:return null;}})[_0x481f('0x24')](function(_0x138347){if(_0x138347&&_0x138347[_0x481f('0x25')]){var _0x2cc14c=_['first'](_0x138347);if(_0x2cc14c){return BPromise[_0x481f('0x28')]({'id':_0x2cc14c['Id'],'name':_0x2cc14c[_0x481f('0x29')],'phone':_0x2cc14c[_0x481f('0x3c')],'endUserType':_0x2cc14c[_0x481f('0x3d')][_0x481f('0x3e')]['toLowerCase']()});}}})['then'](function(_0x496bbc){if(_0x496bbc){logger[_0x481f('0x2a')](_0x481f('0x3f'),_0x496bbc[_0x481f('0x13')],_0x2ee240);return BPromise['resolve'](_0x496bbc);}else{logger['info'](_0x481f('0x40'),_0x2ee240);var _0x13e5b6={'Phone':_0x2ee240};if(_0x4fae80[_0x481f('0x41')]){if(_0x4fae80[_0x481f('0x41')]===_0x481f('0x12')){logger[_0x481f('0x2a')](_0x481f('0x42'),_0x2ee240,_0x4fae80[_0x481f('0x41')]);_0x13e5b6[_0x481f('0x43')]=_0x4a73c7!==_0x481f('0x44')?_0x4a73c7:util[_0x481f('0x45')](_0x481f('0x46'),_0x2ee240);}else if(_0x4fae80[_0x481f('0x41')]==='lead'){logger[_0x481f('0x2a')](_0x481f('0x42'),_0x2ee240,_0x4fae80[_0x481f('0x41')]);_0x13e5b6[_0x481f('0x43')]=_0x4a73c7!==_0x481f('0x44')?_0x4a73c7:util[_0x481f('0x45')](_0x481f('0x46'),_0x2ee240);_0x13e5b6['Company']=_0x481f('0x47');}else if(_0x4fae80['moduleCreate']==='account'){logger[_0x481f('0x2a')](_0x481f('0x42'),_0x2ee240,_0x4fae80[_0x481f('0x41')]);_0x13e5b6[_0x481f('0x29')]=_0x4a73c7!==_0x481f('0x44')?_0x4a73c7:util[_0x481f('0x45')]('Caller\x20-\x20%s',_0x2ee240);}else{return null;}}return _0x3cdde9['sobject'](_[_0x481f('0x48')](_0x4fae80[_0x481f('0x41')]))[_0x481f('0x1f')](_0x13e5b6)[_0x481f('0x24')](function(_0x581cd0){return BPromise[_0x481f('0x28')]({'id':_0x581cd0['id'],'endUserType':_0x4fae80['moduleCreate']});});}});}function getCustomFields(_0x17e948,_0x4b1765){var _0x10c1c6={};if(_0x17e948[_0x481f('0x25')]>0x0){_[_0x481f('0x49')](_0x17e948,function(_0x23bd70){if(_[_0x481f('0x4a')](['string',_0x481f('0x4b')],_0x23bd70[_0x481f('0x3e')])&&_0x23bd70[_0x481f('0x4c')]){_0x10c1c6[_0x23bd70['idField']]=_0x23bd70[_0x481f('0x4d')][_0x481f('0x4e')]();}else if(_0x23bd70[_0x481f('0x3e')]==='variable'&&_0x23bd70[_0x481f('0x4f')]&&_0x23bd70[_0x481f('0x4c')]){_0x4b1765[_0x23bd70[_0x481f('0x4f')]]&&(_0x10c1c6[_0x23bd70['idField']]=_0x4b1765[_0x23bd70[_0x481f('0x4f')]][_0x481f('0x4e')]());}else if(_0x23bd70[_0x481f('0x3e')]===_0x481f('0x50')&&_0x23bd70[_0x481f('0x51')]&&_0x23bd70[_0x481f('0x51')]['name']&&_0x23bd70['idField']){_0x4b1765[_0x23bd70[_0x481f('0x51')]['name'][_0x481f('0x52')]()]&&(_0x10c1c6[_0x23bd70['idField']]=_0x4b1765[_0x23bd70[_0x481f('0x51')]['name'][_0x481f('0x52')]()][_0x481f('0x4e')]());}});}return _0x10c1c6;}function getConnection(_0x3221e0){var _0x1c4e22=_0x3221e0['password']['concat'](_0x3221e0[_0x481f('0x53')]);var _0x2fa67e=new jsforce['Connection']({'oauth2':{'loginUrl':_0x3221e0[_0x481f('0x54')]||_0x481f('0x55'),'clientId':_0x3221e0['clientId'],'clientSecret':_0x3221e0['clientSecret']}});return _0x2fa67e[_0x481f('0x56')](_0x3221e0['username'],_0x1c4e22)[_0x481f('0x24')](function(){logger[_0x481f('0x2a')]('Connection\x20established.');return _0x2fa67e;});}exports[_0x481f('0x57')]=function(_0x3c7a9a,_0x5eee0c,_0x4d15ed,_0x274d99,_0x1d5107,_0x182c5a){var _0x5bf479,_0x1791f4,_0x1e6486,_0x11a770;_0x182c5a[_0x481f('0x58')]=intUtil[_0x481f('0x59')](_0x182c5a[_0x481f('0x58')]);_0x182c5a[_0x481f('0x54')]=intUtil['stripTrailingSlash'](_0x182c5a['remoteUri']);if(_0x1d5107&&_0x1d5107[_0x481f('0x5a')]){logger[_0x481f('0x2a')]('[QUEUE]',_0x481f('0x5b'));_0x5eee0c[_0x481f('0x5c')]=util[_0x481f('0x45')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x182c5a[_0x481f('0x58')],_0x5eee0c['uniqueid'],md5(_0x5eee0c[_0x481f('0x5d')]));}else{_0x5eee0c[_0x481f('0x5c')]='';}return getConnection(_0x182c5a)[_0x481f('0x24')](function(_0x167f62){_0x11a770=_0x167f62;return getUser(_0x182c5a,_0x274d99[_0x481f('0x5e')],_0x11a770);})['then'](function(_0x82cc58){_0x5bf479=_0x82cc58;return getEndUser(_0x182c5a,_0x4d15ed,_0x5eee0c['calleridname'],_0x5eee0c[_0x481f('0x5f')],_0x11a770);})[_0x481f('0x24')](function(_0x5c7d4b){_0x1791f4=_0x5c7d4b;return getTicket(_0x182c5a,_0x5bf479,_0x1791f4,_0x4d15ed,_0x5eee0c,_0x4d15ed[_0x481f('0x60')],_0x11a770,_0x481f('0x57'));})[_0x481f('0x24')](function(_0x3057df){_0x1e6486=_0x3057df;logger[_0x481f('0x2a')](_0x481f('0x61'),_0x1e6486['id']);logger[_0x481f('0x2a')](_0x481f('0x62'),_0x1e6486['id'],_0x274d99[_0x481f('0x63')],_0x182c5a[_0x481f('0x3e')]);switch(_0x182c5a[_0x481f('0x3e')]){case _0x481f('0x64'):emit(util[_0x481f('0x45')]('user:%s',_0x274d99[_0x481f('0x63')]),_0x481f('0x65'),{'recordId':_0x1e6486['id']});break;case'newTab':emit(util[_0x481f('0x45')](_0x481f('0x66'),_0x274d99[_0x481f('0x63')]),_0x481f('0x67'),{'uri':util[_0x481f('0x45')](_0x481f('0x68'),_0x11a770[_0x481f('0x69')],_0x1e6486['id'])});break;default:logger[_0x481f('0x6a')](_0x481f('0x6b'));}})['catch'](function(_0x39cd7a){logger[_0x481f('0x6a')](_0x481f('0x6c'),_0x39cd7a);});};exports[_0x481f('0x6d')]=function(_0x4e9c60,_0x4780a4,_0xe9cba4,_0x232c18,_0x5dddda,_0x1ab208,_0x5bdda7){var _0x258ab1,_0x28a6e3,_0x454496,_0x46b41b;_0x1ab208['serverUrl']=intUtil['stripTrailingSlash'](_0x1ab208[_0x481f('0x58')]);_0x1ab208[_0x481f('0x54')]=intUtil[_0x481f('0x59')](_0x1ab208[_0x481f('0x54')]);if(_0x5bdda7&&_0x5bdda7[_0x481f('0x6e')]&&_0x5bdda7[_0x481f('0x6e')]!==_0x481f('0x6f')){logger[_0x481f('0x2a')](_0x481f('0x70'),_0x481f('0x5b'));_0x4780a4['recordingURL']=util[_0x481f('0x45')](_0x481f('0x71'),_0x1ab208[_0x481f('0x58')],_0x4780a4[_0x481f('0x5d')],md5(_0x4780a4[_0x481f('0x5d')]));}return getConnection(_0x1ab208)[_0x481f('0x24')](function(_0x2a4744){_0x46b41b=_0x2a4744;return getUser(_0x1ab208,_0x232c18[_0x481f('0x5e')],_0x46b41b);})[_0x481f('0x24')](function(_0x20d4b2){_0x258ab1=_0x20d4b2;return getEndUser(_0x1ab208,_0xe9cba4,_0x4780a4[_0x481f('0x72')],_0x4780a4[_0x481f('0x73')],_0x46b41b);})[_0x481f('0x24')](function(_0x55999d){_0x28a6e3=_0x55999d;return getTicket(_0x1ab208,_0x258ab1,_0x28a6e3,_0xe9cba4,_0x4780a4,_0xe9cba4['Fields'],_0x46b41b,_0x481f('0x6d'));})['then'](function(_0x4b1f83){_0x454496=_0x4b1f83;logger[_0x481f('0x2a')](_0x481f('0x74'),_0x454496['id']);logger['info'](_0x481f('0x75'),_0x454496['id'],_0x232c18['name'],_0x1ab208['type']);switch(_0x1ab208[_0x481f('0x3e')]){case'integrationTab':emit(util[_0x481f('0x45')](_0x481f('0x66'),_0x232c18[_0x481f('0x63')]),_0x481f('0x65'),{'recordId':_0x454496['id']});break;case _0x481f('0x76'):emit(util['format'](_0x481f('0x66'),_0x232c18[_0x481f('0x63')]),_0x481f('0x67'),{'uri':util[_0x481f('0x45')](_0x481f('0x68'),_0x46b41b['instanceUrl'],_0x454496['id'])});break;default:logger['error'](_0x481f('0x70'),_0x481f('0x77'));}})[_0x481f('0x78')](function(_0x3fbd2a){logger[_0x481f('0x6a')]('[OUTBOUND]',_0x3fbd2a);});};exports['unmanaged']=function(_0x1040b7,_0x1ba8ab,_0x15536e,_0x36f829,_0x5938fa,_0xfedf2f){var _0x4fdc4e,_0x32ed8a,_0x6105a8,_0x3594f9;_0xfedf2f[_0x481f('0x58')]=intUtil['stripTrailingSlash'](_0xfedf2f['serverUrl']);_0xfedf2f[_0x481f('0x54')]=intUtil[_0x481f('0x59')](_0xfedf2f[_0x481f('0x54')]);if(_0x5938fa&&_0x5938fa[_0x481f('0x5a')]){logger[_0x481f('0x2a')]('['+_0x1ba8ab['lastevent'][_0x481f('0x79')]()+']',_0x481f('0x5b'));_0x1ba8ab[_0x481f('0x5c')]=util['format'](_0x481f('0x71'),_0xfedf2f[_0x481f('0x58')],_0x1ba8ab['uniqueid'],md5(_0x1ba8ab[_0x481f('0x5d')]));}else{_0x1ba8ab[_0x481f('0x5c')]='';}return getConnection(_0xfedf2f)[_0x481f('0x24')](function(_0x30b932){_0x3594f9=_0x30b932;if(!_[_0x481f('0x7a')](_0x36f829)){return getUser(_0xfedf2f,_0x36f829['name'],_0x3594f9);}else{return getUser(_0xfedf2f,null,_0x3594f9);}})[_0x481f('0x24')](function(_0x331ee4){_0x4fdc4e=_0x331ee4;return getEndUser(_0xfedf2f,_0x15536e,_0x1ba8ab['calleridname'],_0x1ba8ab[_0x481f('0x5f')],_0x3594f9);})['then'](function(_0x119b50){_0x32ed8a=_0x119b50;return getTicket(_0xfedf2f,_0x4fdc4e,_0x32ed8a,_0x15536e,_0x1ba8ab,_0x15536e[_0x481f('0x60')],_0x3594f9);})['then'](function(_0x2dcffa){_0x6105a8=_0x2dcffa;logger['info']('['+_0x1ba8ab[_0x481f('0x7b')][_0x481f('0x79')]()+_0x481f('0x7c'),_0x6105a8['id']);logger['info']('['+_0x1ba8ab[_0x481f('0x7b')][_0x481f('0x79')]()+']\x20Integration\x20account\x20type\x20%s.',_0xfedf2f[_0x481f('0x3e')]);})[_0x481f('0x78')](function(_0x19de38){logger[_0x481f('0x6a')]('['+_0x1ba8ab[_0x481f('0x7b')]['toUpperCase']()+']',_0x19de38);});};
\ No newline at end of file
+var _0x858b=['trigger:salesforce:display','newTab','user:%s','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','[OUTBOUND]','recordingURL','Fields','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:browser:url','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','isNil','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','moment','md5','jsforce','util','./util','../../../../config/environment','../../../../config/logger','salesforce','defaults','redis','localhost','socket.io-emitter','emit','getString','Descriptions','ticketType','Task','utc','endUserType','contact','lead','WhoId','WhatId','Case','ContactId','account','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','validateEmail','find','then','length','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','resolve','display_name','identity','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','execute','additionalSearchLead','$or','Lead','account_contact_lead','additionalSearchAccount','Contact','Account','first','Name','Phone','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','Caller\x20-\x20%s','<unknown>','format','Company','No\x20Company','upperFirst','forEach','includes','picklist','idField','content','toString','variableName','customVariable','Variable','name','toLowerCase','password','concat','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab'];(function(_0x3c03cc,_0x25723f){var _0xf7e817=function(_0x307054){while(--_0x307054){_0x3c03cc['push'](_0x3c03cc['shift']());}};_0xf7e817(++_0x25723f);}(_0x858b,0x114));var _0xb858=function(_0x3b19ea,_0x518b6b){_0x3b19ea=_0x3b19ea-0x0;var _0x40ece9=_0x858b[_0x3b19ea];return _0x40ece9;};'use strict';var _=require(_0xb858('0x0'));var rp=require('request-promise');var moment=require(_0xb858('0x1'));var BPromise=require('bluebird');var md5=require(_0xb858('0x2'));var jsforce=require(_0xb858('0x3'));var util=require(_0xb858('0x4'));var Redis=require('ioredis');var intUtil=require(_0xb858('0x5'));var config=require(_0xb858('0x6'));var logger=require(_0xb858('0x7'))(_0xb858('0x8'));config['redis']=_[_0xb858('0x9')](config[_0xb858('0xa')],{'host':_0xb858('0xb'),'port':0x18eb});var io=require(_0xb858('0xc'))(new Redis(config[_0xb858('0xa')]));function emit(_0x3c5ea5,_0x1e37ed,_0x5e7451){io['to'](_0x3c5ea5)[_0xb858('0xd')](_0x1e37ed,_0x5e7451);}function getTicket(_0x15d483,_0x2b57bc,_0x369806,_0x4f8af4,_0x3e91b3,_0x1820ce,_0x232fb2,_0x44bee3){var _0x1115d0=Object['assign']({},{'OwnerId':_0x2b57bc['id'],'Subject':intUtil[_0xb858('0xe')](_0x4f8af4['Subjects'],_0x3e91b3,'\x20'),'Description':intUtil[_0xb858('0xe')](_0x4f8af4[_0xb858('0xf')],_0x3e91b3,'\x0a')},getCustomFields(_0x1820ce,_0x3e91b3));if(_0x369806){if(_0x4f8af4[_0xb858('0x10')]===_0xb858('0x11')){_0x1115d0['ActivityDate']=moment[_0xb858('0x12')]();_0x1115d0['IsReminderSet']=![];_0x1115d0['IsRecurrence']=![];if(_0x369806[_0xb858('0x13')]===_0xb858('0x14')||_0x369806[_0xb858('0x13')]===_0xb858('0x15')){_0x1115d0[_0xb858('0x16')]=_0x369806['id'];}else if(_0x369806[_0xb858('0x13')]==='account'){_0x1115d0[_0xb858('0x17')]=_0x369806['id'];}}else if(_0x4f8af4['ticketType']===_0xb858('0x18')){if(_0x369806[_0xb858('0x13')]==='contact'){_0x1115d0[_0xb858('0x19')]=_0x369806['id'];}else if(_0x369806['endUserType']===_0xb858('0x1a')){_0x1115d0[_0xb858('0x1b')]=_0x369806['id'];}else if(_0x369806[_0xb858('0x13')]===_0xb858('0x15')&&_0x4f8af4['leadId']){_0x1115d0[_0x4f8af4[_0xb858('0x1c')]]=_0x369806['id'];}else{logger[_0xb858('0x1d')](_0xb858('0x1e'));}}}return _0x232fb2[_0xb858('0x1f')](_0x4f8af4[_0xb858('0x10')])[_0xb858('0x20')](_0x1115d0);}function getUser(_0x144ad6,_0x480ff0,_0x45b019){if(!_['isNil'](_0x480ff0)&&intUtil[_0xb858('0x21')](_0x480ff0)){var _0x356b56={'Email':_0x480ff0};var _0x5d0069={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x45b019[_0xb858('0x1f')]('User')[_0xb858('0x22')](_0x356b56,_0x5d0069)['execute']()[_0xb858('0x23')](function(_0x54824f){if(_0x54824f[_0xb858('0x24')]){var _0x436554=_['find'](_0x54824f,function(_0x17c5ae){return _0x17c5ae['Email']===_0x480ff0;});if(_0x436554){logger[_0xb858('0x1d')]('Agent\x20%s\x20found.',_0x480ff0);return BPromise['resolve']({'id':_0x436554['Id'],'name':_0x436554['Name']});}}else{logger[_0xb858('0x1d')](_0xb858('0x25'),_0x480ff0);return _0x45b019['identity']()[_0xb858('0x23')](function(_0xda1af7){return BPromise[_0xb858('0x26')]({'id':_0xda1af7['user_id'],'name':_0xda1af7[_0xb858('0x27')]});});}});}else{logger[_0xb858('0x1d')](_0xb858('0x25'),_0x480ff0);return _0x45b019[_0xb858('0x28')]()['then'](function(_0x1dcc52){return BPromise['resolve']({'id':_0x1dcc52[_0xb858('0x29')],'name':_0x1dcc52[_0xb858('0x27')]});});}}function getEndUser(_0x4f8c08,_0x5136db,_0x3b364a,_0x7021f6,_0xf8e934){var _0x39577e={'$or':{'Phone':_0x7021f6}};var _0xf174c2={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xb858('0x26')]()['then'](function(){logger[_0xb858('0x1d')](_0xb858('0x2a'),_0x7021f6,_0x5136db[_0xb858('0x2b')]);switch(_0x5136db[_0xb858('0x2b')]){case _0xb858('0x2c'):var _0x30d1d4=_[_0xb858('0x2d')](_0x39577e);if(_0x5136db[_0xb858('0x2e')]){var _0x5ccc2d={};_0x5ccc2d[_0x5136db[_0xb858('0x2e')]]=_0x7021f6;_[_0xb858('0x2f')](_0x30d1d4['$or'],_0x5ccc2d);}return _0xf8e934['sobject']('Contact')['find'](_0x30d1d4,_0xf174c2)[_0xb858('0x30')]()[_0xb858('0x23')](function(_0x37393c){if(_0x37393c&&_0x37393c['length']){return _0x37393c;}else{var _0x5abac9=_[_0xb858('0x2d')](_0x39577e);if(_0x5136db['additionalSearchLead']){var _0x12ed80={};_0x12ed80[_0x5136db[_0xb858('0x31')]]=_0x7021f6;_['merge'](_0x5abac9[_0xb858('0x32')],_0x12ed80);}return _0xf8e934[_0xb858('0x1f')](_0xb858('0x33'))[_0xb858('0x22')](_0x5abac9,_0xf174c2);}});case _0xb858('0x34'):var _0x111ee4=_[_0xb858('0x2d')](_0x39577e);if(_0x5136db['additionalSearchAccount']){var _0x5ccc2d={};_0x5ccc2d[_0x5136db[_0xb858('0x35')]]=_0x7021f6;_[_0xb858('0x2f')](_0x111ee4['$or'],_0x5ccc2d);}return _0xf8e934[_0xb858('0x1f')]('Account')['find'](_0x111ee4,_0xf174c2)[_0xb858('0x30')]()[_0xb858('0x23')](function(_0x1574e8){if(_0x1574e8&&_0x1574e8[_0xb858('0x24')]){return _0x1574e8;}else{var _0x151033=_[_0xb858('0x2d')](_0x39577e);if(_0x5136db['additionalSearchContact']){var _0x333ead={};_0x333ead[_0x5136db[_0xb858('0x2e')]]=_0x7021f6;_[_0xb858('0x2f')](_0x151033[_0xb858('0x32')],_0x333ead);}return _0xf8e934[_0xb858('0x1f')](_0xb858('0x36'))[_0xb858('0x22')](_0x151033,_0xf174c2)[_0xb858('0x23')](function(_0x11c5a1){if(_0x11c5a1&&_0x11c5a1[_0xb858('0x24')]){return _0x11c5a1;}else{var _0x3dc26a=_['cloneDeep'](_0x39577e);if(_0x5136db[_0xb858('0x31')]){var _0x3b487d={};_0x3b487d[_0x5136db[_0xb858('0x31')]]=_0x7021f6;_[_0xb858('0x2f')](_0x3dc26a[_0xb858('0x32')],_0x3b487d);}return _0xf8e934[_0xb858('0x1f')](_0xb858('0x33'))[_0xb858('0x22')](_0x3dc26a,_0xf174c2);}});}});case'contact':var _0x30d1d4=_[_0xb858('0x2d')](_0x39577e);if(_0x5136db[_0xb858('0x2e')]){var _0x5ccc2d={};_0x5ccc2d[_0x5136db[_0xb858('0x2e')]]=_0x7021f6;_[_0xb858('0x2f')](_0x30d1d4['$or'],_0x5ccc2d);}return _0xf8e934[_0xb858('0x1f')]('Contact')[_0xb858('0x22')](_0x30d1d4,_0xf174c2)[_0xb858('0x30')]();case _0xb858('0x15'):var _0x573c8b=_['cloneDeep'](_0x39577e);if(_0x5136db[_0xb858('0x31')]){var _0x5ccc2d={};_0x5ccc2d[_0x5136db[_0xb858('0x31')]]=_0x7021f6;_[_0xb858('0x2f')](_0x573c8b['$or'],_0x5ccc2d);}return _0xf8e934[_0xb858('0x1f')]('Lead')[_0xb858('0x22')](_0x573c8b,_0xf174c2);case'account':var _0x111ee4=_['cloneDeep'](_0x39577e);if(_0x5136db[_0xb858('0x35')]){var _0x5ccc2d={};_0x5ccc2d[_0x5136db[_0xb858('0x35')]]=_0x7021f6;_[_0xb858('0x2f')](_0x111ee4['$or'],_0x5ccc2d);}return _0xf8e934['sobject'](_0xb858('0x37'))['find'](_0x111ee4,_0xf174c2);default:return null;}})['then'](function(_0x4d50e0){if(_0x4d50e0&&_0x4d50e0['length']){var _0x143d9e=_[_0xb858('0x38')](_0x4d50e0);if(_0x143d9e){return BPromise[_0xb858('0x26')]({'id':_0x143d9e['Id'],'name':_0x143d9e[_0xb858('0x39')],'phone':_0x143d9e[_0xb858('0x3a')],'endUserType':_0x143d9e['attributes'][_0xb858('0x3b')]['toLowerCase']()});}}})[_0xb858('0x23')](function(_0x5f225d){if(_0x5f225d){logger['info'](_0xb858('0x3c'),_0x5f225d[_0xb858('0x13')],_0x7021f6);return BPromise[_0xb858('0x26')](_0x5f225d);}else{logger[_0xb858('0x1d')](_0xb858('0x3d'),_0x7021f6);var _0x56d828={'Phone':_0x7021f6};if(_0x5136db['moduleCreate']){if(_0x5136db[_0xb858('0x3e')]===_0xb858('0x14')){logger[_0xb858('0x1d')](_0xb858('0x3f'),_0x7021f6,_0x5136db[_0xb858('0x3e')]);_0x56d828[_0xb858('0x40')]=_0x3b364a!=='<unknown>'?_0x3b364a:util['format'](_0xb858('0x41'),_0x7021f6);}else if(_0x5136db[_0xb858('0x3e')]==='lead'){logger[_0xb858('0x1d')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x7021f6,_0x5136db[_0xb858('0x3e')]);_0x56d828[_0xb858('0x40')]=_0x3b364a!==_0xb858('0x42')?_0x3b364a:util[_0xb858('0x43')](_0xb858('0x41'),_0x7021f6);_0x56d828[_0xb858('0x44')]=_0xb858('0x45');}else if(_0x5136db['moduleCreate']===_0xb858('0x1a')){logger[_0xb858('0x1d')](_0xb858('0x3f'),_0x7021f6,_0x5136db['moduleCreate']);_0x56d828[_0xb858('0x39')]=_0x3b364a!==_0xb858('0x42')?_0x3b364a:util[_0xb858('0x43')]('Caller\x20-\x20%s',_0x7021f6);}else{return null;}}return _0xf8e934[_0xb858('0x1f')](_[_0xb858('0x46')](_0x5136db[_0xb858('0x3e')]))[_0xb858('0x20')](_0x56d828)['then'](function(_0x3bcdb8){return BPromise['resolve']({'id':_0x3bcdb8['id'],'endUserType':_0x5136db['moduleCreate']});});}});}function getCustomFields(_0x4f673f,_0x2307f0){var _0x48eb0c={};if(_0x4f673f['length']>0x0){_[_0xb858('0x47')](_0x4f673f,function(_0x485544){if(_[_0xb858('0x48')](['string',_0xb858('0x49')],_0x485544[_0xb858('0x3b')])&&_0x485544[_0xb858('0x4a')]){_0x48eb0c[_0x485544[_0xb858('0x4a')]]=_0x485544[_0xb858('0x4b')][_0xb858('0x4c')]();}else if(_0x485544['type']==='variable'&&_0x485544[_0xb858('0x4d')]&&_0x485544[_0xb858('0x4a')]){_0x2307f0[_0x485544[_0xb858('0x4d')]]&&(_0x48eb0c[_0x485544['idField']]=_0x2307f0[_0x485544['variableName']][_0xb858('0x4c')]());}else if(_0x485544[_0xb858('0x3b')]===_0xb858('0x4e')&&_0x485544[_0xb858('0x4f')]&&_0x485544[_0xb858('0x4f')][_0xb858('0x50')]&&_0x485544[_0xb858('0x4a')]){_0x2307f0[_0x485544[_0xb858('0x4f')][_0xb858('0x50')][_0xb858('0x51')]()]&&(_0x48eb0c[_0x485544[_0xb858('0x4a')]]=_0x2307f0[_0x485544[_0xb858('0x4f')]['name']['toLowerCase']()][_0xb858('0x4c')]());}});}return _0x48eb0c;}function getConnection(_0x593b92){var _0x4afe24=_0x593b92[_0xb858('0x52')][_0xb858('0x53')](_0x593b92['securityToken']);var _0x33c15b=new jsforce[(_0xb858('0x54'))]({'oauth2':{'loginUrl':_0x593b92[_0xb858('0x55')]||_0xb858('0x56'),'clientId':_0x593b92[_0xb858('0x57')],'clientSecret':_0x593b92[_0xb858('0x58')]}});return _0x33c15b[_0xb858('0x59')](_0x593b92[_0xb858('0x5a')],_0x4afe24)[_0xb858('0x23')](function(){logger[_0xb858('0x1d')](_0xb858('0x5b'));return _0x33c15b;});}exports[_0xb858('0x5c')]=function(_0x5c317c,_0x3aee97,_0x3b2220,_0x379a9d,_0xa56d2d,_0x49e810){var _0x111cda,_0x3bf59a,_0x1ed865,_0x246385;_0x49e810[_0xb858('0x5d')]=intUtil[_0xb858('0x5e')](_0x49e810[_0xb858('0x5d')]);_0x49e810[_0xb858('0x55')]=intUtil[_0xb858('0x5e')](_0x49e810[_0xb858('0x55')]);if(_0xa56d2d&&_0xa56d2d[_0xb858('0x5f')]){logger[_0xb858('0x1d')](_0xb858('0x60'),_0xb858('0x61'));_0x3aee97['recordingURL']=util['format'](_0xb858('0x62'),_0x49e810[_0xb858('0x5d')],_0x3aee97[_0xb858('0x63')],md5(_0x3aee97[_0xb858('0x63')]));}else{_0x3aee97['recordingURL']='';}return getConnection(_0x49e810)[_0xb858('0x23')](function(_0x5718cc){_0x246385=_0x5718cc;return getUser(_0x49e810,_0x379a9d[_0xb858('0x64')],_0x246385);})[_0xb858('0x23')](function(_0x364c0b){_0x111cda=_0x364c0b;return getEndUser(_0x49e810,_0x3b2220,_0x3aee97[_0xb858('0x65')],_0x3aee97[_0xb858('0x66')],_0x246385);})[_0xb858('0x23')](function(_0x3a575b){_0x3bf59a=_0x3a575b;return getTicket(_0x49e810,_0x111cda,_0x3bf59a,_0x3b2220,_0x3aee97,_0x3b2220['Fields'],_0x246385,'queue');})[_0xb858('0x23')](function(_0x333d0b){_0x1ed865=_0x333d0b;logger['info']('[QUEUE]\x20Ticket\x20%s\x20created',_0x1ed865['id']);logger[_0xb858('0x1d')](_0xb858('0x67'),_0x1ed865['id'],_0x379a9d[_0xb858('0x50')],_0x49e810[_0xb858('0x3b')]);switch(_0x49e810[_0xb858('0x3b')]){case _0xb858('0x68'):emit(util[_0xb858('0x43')]('user:%s',_0x379a9d[_0xb858('0x50')]),_0xb858('0x69'),{'recordId':_0x1ed865['id']});break;case _0xb858('0x6a'):emit(util[_0xb858('0x43')](_0xb858('0x6b'),_0x379a9d[_0xb858('0x50')]),'trigger:browser:url',{'uri':util['format'](_0xb858('0x6c'),_0x246385['instanceUrl'],_0x1ed865['id'])});break;default:logger[_0xb858('0x6d')](_0xb858('0x6e'));}})[_0xb858('0x6f')](function(_0x56a35a){logger[_0xb858('0x6d')](_0xb858('0x60'),_0x56a35a);});};exports[_0xb858('0x70')]=function(_0xdedccf,_0x408b5a,_0x2c128f,_0x3e1e97,_0x4f54da,_0x143c17,_0x48127f){var _0x46d02f,_0xc4c89e,_0x417067,_0x3dfa61;_0x143c17['serverUrl']=intUtil['stripTrailingSlash'](_0x143c17[_0xb858('0x5d')]);_0x143c17[_0xb858('0x55')]=intUtil[_0xb858('0x5e')](_0x143c17[_0xb858('0x55')]);if(_0x48127f&&_0x48127f[_0xb858('0x71')]&&_0x48127f['recordingFormat']!=='none'){logger[_0xb858('0x1d')](_0xb858('0x72'),'Recording\x20is\x20enabled!');_0x408b5a[_0xb858('0x73')]=util[_0xb858('0x43')](_0xb858('0x62'),_0x143c17[_0xb858('0x5d')],_0x408b5a[_0xb858('0x63')],md5(_0x408b5a['uniqueid']));}return getConnection(_0x143c17)[_0xb858('0x23')](function(_0x26117e){_0x3dfa61=_0x26117e;return getUser(_0x143c17,_0x3e1e97[_0xb858('0x64')],_0x3dfa61);})[_0xb858('0x23')](function(_0x5dfe87){_0x46d02f=_0x5dfe87;return getEndUser(_0x143c17,_0x2c128f,_0x408b5a['destcalleridname'],_0x408b5a['destcalleridnum'],_0x3dfa61);})[_0xb858('0x23')](function(_0x6a38c){_0xc4c89e=_0x6a38c;return getTicket(_0x143c17,_0x46d02f,_0xc4c89e,_0x2c128f,_0x408b5a,_0x2c128f[_0xb858('0x74')],_0x3dfa61,'outbound');})[_0xb858('0x23')](function(_0x42d527){_0x417067=_0x42d527;logger[_0xb858('0x1d')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x417067['id']);logger[_0xb858('0x1d')](_0xb858('0x75'),_0x417067['id'],_0x3e1e97[_0xb858('0x50')],_0x143c17['type']);switch(_0x143c17['type']){case'integrationTab':emit(util[_0xb858('0x43')](_0xb858('0x6b'),_0x3e1e97[_0xb858('0x50')]),_0xb858('0x69'),{'recordId':_0x417067['id']});break;case _0xb858('0x6a'):emit(util['format'](_0xb858('0x6b'),_0x3e1e97[_0xb858('0x50')]),_0xb858('0x76'),{'uri':util[_0xb858('0x43')]('%s/%s/e',_0x3dfa61[_0xb858('0x77')],_0x417067['id'])});break;default:logger[_0xb858('0x6d')](_0xb858('0x72'),_0xb858('0x78'));}})[_0xb858('0x6f')](function(_0x2740fa){logger['error'](_0xb858('0x72'),_0x2740fa);});};exports[_0xb858('0x79')]=function(_0x434493,_0x2b43ef,_0x5b39a9,_0x1562e4,_0x4ef898,_0x432266){var _0x4a3182,_0x6bb8b2,_0x5a25dc,_0x5be504;_0x432266[_0xb858('0x5d')]=intUtil[_0xb858('0x5e')](_0x432266[_0xb858('0x5d')]);_0x432266[_0xb858('0x55')]=intUtil[_0xb858('0x5e')](_0x432266[_0xb858('0x55')]);if(_0x4ef898&&_0x4ef898[_0xb858('0x5f')]){logger[_0xb858('0x1d')]('['+_0x2b43ef[_0xb858('0x7a')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x2b43ef[_0xb858('0x73')]=util[_0xb858('0x43')](_0xb858('0x62'),_0x432266[_0xb858('0x5d')],_0x2b43ef[_0xb858('0x63')],md5(_0x2b43ef[_0xb858('0x63')]));}else{_0x2b43ef['recordingURL']='';}return getConnection(_0x432266)[_0xb858('0x23')](function(_0x3e5b5a){_0x5be504=_0x3e5b5a;if(!_[_0xb858('0x7b')](_0x1562e4)){return getUser(_0x432266,_0x1562e4[_0xb858('0x50')],_0x5be504);}else{return getUser(_0x432266,null,_0x5be504);}})[_0xb858('0x23')](function(_0x3a1e4f){_0x4a3182=_0x3a1e4f;return getEndUser(_0x432266,_0x5b39a9,_0x2b43ef['calleridname'],_0x2b43ef[_0xb858('0x66')],_0x5be504);})[_0xb858('0x23')](function(_0x1138dd){_0x6bb8b2=_0x1138dd;return getTicket(_0x432266,_0x4a3182,_0x6bb8b2,_0x5b39a9,_0x2b43ef,_0x5b39a9['Fields'],_0x5be504);})[_0xb858('0x23')](function(_0x3cde83){_0x5a25dc=_0x3cde83;logger[_0xb858('0x1d')]('['+_0x2b43ef[_0xb858('0x7a')][_0xb858('0x7c')]()+_0xb858('0x7d'),_0x5a25dc['id']);logger[_0xb858('0x1d')]('['+_0x2b43ef[_0xb858('0x7a')]['toUpperCase']()+_0xb858('0x7e'),_0x432266['type']);})[_0xb858('0x6f')](function(_0x68412f){logger[_0xb858('0x6d')]('['+_0x2b43ef['lastevent'][_0xb858('0x7c')]()+']',_0x68412f);});};
\ No newline at end of file
index b6afa48..2904148 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb2b=['],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','userId','adminEmail',']\x20using\x20admin\x20profile','POST','user','endUserNumber','true','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','endUserId','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','toLowerCase','toString','idField','content','variableName','customField','customVariable','Variable','name','incident','assign','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','push','all','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','trigger:browser:url','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','length','adminId','result','sys_id','info','toUpperCase','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail'];(function(_0x36e963,_0x61d1f9){var _0x5e4971=function(_0x1d1eeb){while(--_0x1d1eeb){_0x36e963['push'](_0x36e963['shift']());}};_0x5e4971(++_0x61d1f9);}(_0xfb2b,0x121));var _0xbfb2=function(_0x3923d4,_0x41d061){_0x3923d4=_0x3923d4-0x0;var _0x3179ed=_0xfb2b[_0x3923d4];return _0x3179ed;};'use strict';var _=require(_0xbfb2('0x0'));var Promise=require('bluebird');var rp=require(_0xbfb2('0x1'));var util=require('util');var md5=require(_0xbfb2('0x2'));var Redis=require(_0xbfb2('0x3'));var intUtil=require(_0xbfb2('0x4'));var config=require(_0xbfb2('0x5'));var logger=require(_0xbfb2('0x6'))(_0xbfb2('0x7'));config[_0xbfb2('0x8')]=_[_0xbfb2('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xbfb2('0xa'))(new Redis(config[_0xbfb2('0x8')]));function getAdminUser(_0xc56711,_0xd4e3c7,_0x4cd42a,_0x3c4ae4,_0x3d8bd2,_0x2fe9de){return new Promise(function(_0x1e25b4,_0x5f2f7f){var _0x3fb5f7={'method':_0xbfb2('0xb'),'uri':_0x3c4ae4+_0xbfb2('0xc')+'&'+_0x3d8bd2+'&'+_0x2fe9de,'auth':_0xd4e3c7,'json':!![]};return rp(_0x3fb5f7)[_0xbfb2('0xd')](function(_0x168b2d){if(_0x168b2d['result'][_0xbfb2('0xe')]>0x0){_0x4cd42a[_0xbfb2('0xf')]=_0x168b2d[_0xbfb2('0x10')][0x0][_0xbfb2('0x11')];}logger[_0xbfb2('0x12')]('['+[_0xc56711[_0xbfb2('0x13')]()]+'],\x20getAdminUser\x20crm',_0x4cd42a);_0x1e25b4(_0x4cd42a);})[_0xbfb2('0x14')](function(_0x28ebe3){logger[_0xbfb2('0x15')]('['+[_0xc56711[_0xbfb2('0x13')]()]+']',_0x28ebe3['message']);_0x5f2f7f(_0x28ebe3[_0xbfb2('0x16')]);});});}function getUser(_0x2b27aa,_0x4dda27,_0x26b9ea,_0x4e049d,_0x1c8eca){return function(_0x1cbfbc){logger[_0xbfb2('0x12')]('['+[_0x2b27aa['toUpperCase']()]+_0xbfb2('0x17'),_0x1cbfbc);return new Promise(function(_0x1bd69a,_0x285ee0){if(intUtil[_0xbfb2('0x18')](_0x1cbfbc[_0xbfb2('0x19')])){var _0x2512c7={'method':_0xbfb2('0xb'),'uri':_0x26b9ea+'sys_user?sysparm_query=email%3D'+_0x1cbfbc[_0xbfb2('0x19')]+'&'+_0x4e049d+'&'+_0x1c8eca,'auth':_0x4dda27,'json':!![]};logger['info']('['+[_0x2b27aa[_0xbfb2('0x13')]()]+_0xbfb2('0x1a'),_0x2512c7);return rp(_0x2512c7)[_0xbfb2('0xd')](function(_0x481de8){logger[_0xbfb2('0x12')]('['+[_0x2b27aa['toUpperCase']()]+_0xbfb2('0x1b'),_0x481de8);if(_0x481de8[_0xbfb2('0x10')][_0xbfb2('0xe')]>0x0&&String(_0x481de8[_0xbfb2('0x10')][0x0]['active'])==='true'){_0x1cbfbc[_0xbfb2('0x1c')]=_0x481de8[_0xbfb2('0x10')][0x0][_0xbfb2('0x11')];}else{_0x1cbfbc[_0xbfb2('0x1c')]=_0x1cbfbc[_0xbfb2('0xf')];_0x1cbfbc['userEmail']=_0x1cbfbc[_0xbfb2('0x1d')];}logger[_0xbfb2('0x12')]('['+[_0x2b27aa[_0xbfb2('0x13')]()]+'],\x20getUser\x20crm',_0x1cbfbc);_0x1bd69a(_0x1cbfbc);})[_0xbfb2('0x14')](function(_0x4ea012){logger[_0xbfb2('0x15')]('['+[_0x2b27aa[_0xbfb2('0x13')]()]+']',_0x4ea012['message']);_0x285ee0(_0x4ea012[_0xbfb2('0x16')]);});}else{logger[_0xbfb2('0x12')]('['+[_0x2b27aa[_0xbfb2('0x13')]()]+_0xbfb2('0x1e'));_0x1cbfbc[_0xbfb2('0x1c')]=_0x1cbfbc['adminId'];_0x1cbfbc[_0xbfb2('0x19')]=_0x1cbfbc[_0xbfb2('0x1d')];_0x1bd69a(_0x1cbfbc);}});};}function createEndUser(_0x1c003a,_0x59dc8d,_0x32b07d,_0x2491f1,_0x250953){logger[_0xbfb2('0x12')]('['+[_0x1c003a[_0xbfb2('0x13')]()]+'],\x20createEndUser\x20input\x20crm',_0x32b07d);return new Promise(function(_0x4d3be1,_0x1af2ed){var _0xdbdfa4={'method':_0xbfb2('0x1f'),'uri':_0x2491f1+'sys_user?'+_0x250953,'body':{'user_name':_0x32b07d['endUserNumber'],'roles':_0xbfb2('0x20'),'first_name':_0x32b07d[_0xbfb2('0x21')],'active':_0xbfb2('0x22'),'date_format':_0xbfb2('0x23'),'phone':_0x32b07d[_0xbfb2('0x21')]},'auth':_0x59dc8d,'json':!![]};return rp(_0xdbdfa4)['then'](function(_0x135104){logger[_0xbfb2('0x12')]('['+[_0x1c003a[_0xbfb2('0x13')]()]+_0xbfb2('0x24'),_0x135104[_0xbfb2('0x10')]);_0x32b07d['endUserId']=_0x135104['result'][_0xbfb2('0x11')];_0x4d3be1(_0x32b07d);})[_0xbfb2('0x14')](function(_0x7c7802){logger['error']('['+[_0x1c003a[_0xbfb2('0x13')]()]+']',_0x7c7802[_0xbfb2('0x16')]);_0x1af2ed(_0x7c7802[_0xbfb2('0x16')]);});});}function getEndUser(_0x5b7e4f,_0x387f94,_0xdede98,_0x2070d4,_0xc96532){return function(_0x4d9e84){logger[_0xbfb2('0x12')]('['+[_0x5b7e4f[_0xbfb2('0x13')]()]+_0xbfb2('0x25'),_0x4d9e84);return new Promise(function(_0xeb49af,_0xba8cba){var _0x437cc6={'method':_0xbfb2('0xb'),'uri':_0xdede98+'sys_user?sysparm_query=phone%3D'+_0x4d9e84[_0xbfb2('0x21')]+'&'+_0x2070d4+'&'+_0xc96532,'auth':_0x387f94,'json':!![]};return rp(_0x437cc6)[_0xbfb2('0xd')](function(_0x2246c8){if(_0x2246c8[_0xbfb2('0x10')][_0xbfb2('0xe')]>0x0){_0x4d9e84[_0xbfb2('0x26')]=_0x2246c8[_0xbfb2('0x10')][0x0][_0xbfb2('0x11')];logger[_0xbfb2('0x12')]('['+[_0x5b7e4f[_0xbfb2('0x13')]()]+'],\x20getEndUser\x20crm',_0x4d9e84);_0xeb49af(_0x4d9e84);}else{return createEndUser(_0x5b7e4f,_0x387f94,_0x4d9e84,_0xdede98,_0x2070d4)[_0xbfb2('0xd')](function(_0x5bc14c){logger[_0xbfb2('0x12')]('['+[_0x5b7e4f['toUpperCase']()]+_0xbfb2('0x27'),_0x5bc14c);_0xeb49af(_0x5bc14c);});}})['catch'](function(_0x58e3ff){logger['error']('['+[_0x5b7e4f[_0xbfb2('0x13')]()]+']',_0x58e3ff[_0xbfb2('0x16')]);_0xba8cba(_0x58e3ff[_0xbfb2('0x16')]);});});};}function getCustomFields(_0x174894,_0x205c07){var _0x22e9a4={};if(_0x174894[_0xbfb2('0xe')]>0x0){_[_0xbfb2('0x28')](_0x174894,function(_0x40987e){if(_[_0xbfb2('0x29')]([_0xbfb2('0x2a'),_0xbfb2('0x2b')],_0x40987e[_0xbfb2('0x2c')])&&_0x40987e[_0xbfb2('0x2d')]&&!_0x40987e['customField']){_0x22e9a4[_0x40987e[_0xbfb2('0x2d')][_0xbfb2('0x2e')]()]=_0x40987e['content'][_0xbfb2('0x2f')]();}else if(_[_0xbfb2('0x29')]([_0xbfb2('0x2a'),_0xbfb2('0x2b')],_0x40987e[_0xbfb2('0x2c')])&&_0x40987e[_0xbfb2('0x30')]&&_0x40987e['customField']){_0x22e9a4[_0x40987e[_0xbfb2('0x30')][_0xbfb2('0x2e')]()]=_0x40987e[_0xbfb2('0x31')][_0xbfb2('0x2f')]();}else if(_0x40987e[_0xbfb2('0x2c')]==='variable'&&_0x40987e[_0xbfb2('0x32')]&&_0x40987e[_0xbfb2('0x30')]&&_0x40987e[_0xbfb2('0x33')]){_0x22e9a4[_0x40987e[_0xbfb2('0x30')][_0xbfb2('0x2e')]()]=_0x205c07[_0x40987e['variableName']][_0xbfb2('0x2f')]();}else if(_0x40987e[_0xbfb2('0x2c')]===_0xbfb2('0x34')&&_0x40987e[_0xbfb2('0x35')]&&_0x40987e['Variable'][_0xbfb2('0x36')]&&_0x40987e['idField']&&_0x40987e['customField']){_0x22e9a4[_0x40987e[_0xbfb2('0x30')][_0xbfb2('0x2e')]()]=_0x205c07[_0x40987e[_0xbfb2('0x35')][_0xbfb2('0x36')]['toLowerCase']()][_0xbfb2('0x2f')]();}});}return _0x22e9a4;}function getTicket(_0x2615bb,_0x148648,_0x223e53,_0x3f7d31,_0x2533cf,_0x2f4a98){return function(_0x3698fe){logger[_0xbfb2('0x12')]('['+[_0x2615bb[_0xbfb2('0x13')]()]+']\x20getTicket\x20input\x20crm',_0x3698fe);return new Promise(function(_0x3615a8,_0x54e83c){var _0x3a28e2=_0x2615bb[_0xbfb2('0x2e')]()==='outbound'?_0x3698fe[_0xbfb2('0x1c')]:_0x3698fe[_0xbfb2('0x26')];var _0x6670b6={'method':_0xbfb2('0x1f'),'uri':_0x223e53+_0xbfb2('0x37')+'?'+_0x2f4a98,'body':Object[_0xbfb2('0x38')]({},{'active':_0xbfb2('0x22'),'caller_id':_0x3a28e2,'assigned_to':_0x3698fe[_0xbfb2('0x1c')],'short_description':intUtil[_0xbfb2('0x39')](_0x3f7d31[_0xbfb2('0x3a')],_0x2533cf,'\x20'),'description':intUtil[_0xbfb2('0x39')](_0x3f7d31['Descriptions'],_0x2533cf,'\x0a')},getCustomFields(_0x3f7d31[_0xbfb2('0x3b')],_0x2533cf)),'auth':_0x148648,'json':!![]};return rp(_0x6670b6)[_0xbfb2('0xd')](function(_0x12540a){logger[_0xbfb2('0x12')]('['+[_0x2615bb['toUpperCase']()]+_0xbfb2('0x3c'),_0x12540a[_0xbfb2('0x10')]);_0x3698fe[_0xbfb2('0x3d')]=_0x12540a[_0xbfb2('0x10')]['sys_id'];_0x3698fe[_0xbfb2('0x3e')]=_0x12540a['result'][_0xbfb2('0x3f')];logger[_0xbfb2('0x12')]('['+[_0x2615bb[_0xbfb2('0x13')]()]+_0xbfb2('0x40'),_0x3698fe);_0x3615a8(_0x3698fe);})['catch'](function(_0x4b9bfc){logger['error']('['+[_0x2615bb[_0xbfb2('0x13')]()]+']',_0x4b9bfc[_0xbfb2('0x16')]);_0x54e83c(_0x4b9bfc[_0xbfb2('0x16')]);});});};}function createRemoteTag(_0x21d7fc,_0x40b0f3,_0x3a421b,_0x396b96){return new Promise(function(_0x43c9e5,_0x3e2743){var _0x4746dc={'method':'POST','uri':_0x3a421b+_0xbfb2('0x41')+'?'+_0x396b96,'body':{'short_description':_0x21d7fc,'global':!![],'active':!![],'name':_0x21d7fc},'auth':_0x40b0f3,'json':!![]};return rp(_0x4746dc)[_0xbfb2('0xd')](function(_0x42e051){var _0x4e6faf=_0x42e051['result'][_0xbfb2('0x11')];_0x43c9e5(_0x4e6faf);});});}function getRemoteTag(_0x1fb20c,_0x27f319,_0xd5f5e,_0x5188ec,_0xe3a5ae){return new Promise(function(_0x15f517,_0x5c14e1){var _0x2e5615={'method':'GET','uri':_0xd5f5e+_0xbfb2('0x41')+_0xbfb2('0x42')+_0x1fb20c+'&'+_0x5188ec,'auth':_0x27f319,'json':!![]};return rp(_0x2e5615)[_0xbfb2('0xd')](function(_0x5547f4){if(_0x5547f4[_0xbfb2('0x10')][_0xbfb2('0xe')]>0x0){var _0x1316ba=_0x5547f4[_0xbfb2('0x10')][0x0]['sys_id'];_0x15f517(_0x1316ba);}else{return createRemoteTag(_0x1fb20c,_0x27f319,_0xd5f5e,_0x5188ec)[_0xbfb2('0xd')](function(_0x16f618){_0x15f517(_0x16f618);});}});});}function assignTagToIncident(_0x35dab0,_0x2882c5,_0x10c4fe,_0x34c957,_0x274ad4){return new Promise(function(_0x56e7ad,_0x3e19ed){var _0x122165={'method':_0xbfb2('0x1f'),'uri':_0x10c4fe+_0xbfb2('0x43')+'?'+_0x274ad4,'body':{'label':_0x35dab0,'table':_0xbfb2('0x37'),'id_type':_0xbfb2('0x44'),'table_key':_0x34c957[_0xbfb2('0x3d')],'title':'Incident\x20-\x20'+_0x34c957[_0xbfb2('0x3e')],'id_display':_0x34c957[_0xbfb2('0x3e')]},'auth':_0x2882c5,'json':!![]};return rp(_0x122165)[_0xbfb2('0xd')](function(_0x477237){_0x56e7ad();})[_0xbfb2('0x14')](function(){_0x56e7ad();});});}function manageTags(_0xc79fc4,_0x277fee,_0x4cc795,_0x2d9e21,_0x5155d6,_0x8cf9d5,_0x1ff72d){return new Promise(function(_0x3a1874,_0x17ed0a){var _0x3a3c41=[];_0x277fee[_0xbfb2('0x28')](function(_0x170cd9){_0x3a3c41[_0xbfb2('0x45')](getRemoteTag(_0x170cd9,_0x4cc795,_0x2d9e21,_0x8cf9d5,_0x1ff72d));});return Promise[_0xbfb2('0x46')](_0x3a3c41)[_0xbfb2('0xd')](function(_0x5719c0){if(_0x5719c0[_0xbfb2('0xe')]){logger['info']('['+[_0xc79fc4[_0xbfb2('0x13')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x5719c0);var _0x20ddc1=[];_0x5719c0[_0xbfb2('0x28')](function(_0x3c68cd){_0x20ddc1[_0xbfb2('0x45')](assignTagToIncident(_0x3c68cd,_0x4cc795,_0x2d9e21,_0x5155d6,_0x8cf9d5));});return Promise['all'](_0x20ddc1)[_0xbfb2('0xd')](function(){_0x3a1874();})['catch'](function(){_0x3a1874();});}else{_0x3a1874();}});});}function getTags(_0x53f41f,_0x5a96c9,_0x3d84e0,_0x3ff4f4,_0x476d38,_0x2d25ba){return function(_0x2fa148){return new Promise(function(_0x139a59,_0x8a2de){var _0xae1869=[];var _0x5e0695=_0x3ff4f4['Tags'];if(_0x5e0695&&_0x5e0695[_0xbfb2('0xe')]>0x0){_0xae1869=_[_0xbfb2('0x47')](_0x5e0695,'name');}if(_0xae1869[_0xbfb2('0xe')]>0x0){return manageTags(_0x53f41f,_0xae1869,_0x5a96c9,_0x3d84e0,_0x2fa148,_0x476d38,_0x2d25ba)[_0xbfb2('0xd')](function(){_0x139a59(_0x2fa148);});}else{_0x139a59(_0x2fa148);}});};}function emit(_0x538479,_0x27287c,_0xcfef5f){var _0x13baa7=_0xbfb2('0x48')+_0xbfb2('0x49')+_0xbfb2('0x4a')+'%255EORDERBYDESCnumber';var _0x7779d9={'uri':_0x538479+_0xbfb2('0x4b')+_0xcfef5f+_0x13baa7};io['to'](util[_0xbfb2('0x4c')]('user:%s',_0x27287c))[_0xbfb2('0x4d')](_0xbfb2('0x4e'),_0x7779d9);}exports['cs']=function(_0x28b3af,_0x1e4509,_0x180195,_0x3eeed2,_0x330810,_0x4b80a9,_0x18c837,_0x15f80c){var _0x1da73d={};var _0xa75515={'user':_0x4b80a9[_0xbfb2('0x4f')],'pass':_0x4b80a9[_0xbfb2('0x50')]};var _0x44de6d=_0xbfb2('0x51');var _0x392dea='sysparm_display_value=true';_0x4b80a9[_0xbfb2('0x52')]=intUtil[_0xbfb2('0x53')](_0x4b80a9[_0xbfb2('0x52')]);_0x4b80a9[_0xbfb2('0x54')]=intUtil['stripTrailingSlash'](_0x4b80a9['serverUrl']);var _0x563c5a=util[_0xbfb2('0x4c')](_0xbfb2('0x55'),_0x4b80a9[_0xbfb2('0x52')]);_0x1da73d[_0xbfb2('0x19')]=!_[_0xbfb2('0x56')](_0x3eeed2)?_0x3eeed2[_0xbfb2('0x57')]:null;_0x1da73d[_0xbfb2('0x1d')]=_0x4b80a9[_0xbfb2('0x57')];_0x1da73d[_0xbfb2('0x21')]=_0x15f80c[_0xbfb2('0x2e')]()==='outbound'?_0x1e4509[_0xbfb2('0x58')]:_0x1e4509[_0xbfb2('0x59')];_0x1da73d[_0xbfb2('0x5a')]=_0x15f80c==='queue'||_0x15f80c===_0xbfb2('0x5b')?'queue':_0xbfb2('0x5c');var _0x35c717=util[_0xbfb2('0x4c')](_0xbfb2('0x5d'),_0x4b80a9[_0xbfb2('0x54')],_0x1e4509['uniqueid'],md5(_0x1e4509['uniqueid']));if(_0x330810&&_0x330810[_0xbfb2('0x5e')]){logger[_0xbfb2('0x12')](_0xbfb2('0x5f'),'Recording\x20is\x20enabled!');_0x1e4509[_0xbfb2('0x60')]=_0x35c717;}else if(_0x18c837&&_0x18c837['recordingFormat']&&_0x18c837[_0xbfb2('0x61')]!==_0xbfb2('0x62')){logger[_0xbfb2('0x12')](_0xbfb2('0x63'),'Recording\x20is\x20enabled!');_0x1e4509['recordingURL']=_0x35c717;}else{_0x1e4509['recordingURL']='';}return getAdminUser(_0x15f80c,_0xa75515,_0x1da73d,_0x563c5a,_0x392dea,_0x44de6d)[_0xbfb2('0xd')](getUser(_0x15f80c,_0xa75515,_0x563c5a,_0x392dea,_0x44de6d))[_0xbfb2('0xd')](getEndUser(_0x15f80c,_0xa75515,_0x563c5a,_0x392dea,_0x44de6d))[_0xbfb2('0xd')](getTicket(_0x15f80c,_0xa75515,_0x563c5a,_0x180195,_0x1e4509,_0x392dea))[_0xbfb2('0xd')](function(_0x5ebd7c){logger['info'](util[_0xbfb2('0x4c')](_0xbfb2('0x64'),_0x5ebd7c['ticketId']));logger['info'](util['format'](_0xbfb2('0x65'),_0x15f80c));if(_0x15f80c!==_0xbfb2('0x5b')){logger[_0xbfb2('0x12')]('['+[_0x15f80c['toUpperCase']()]+']',_0xbfb2('0x66'));emit(_0x4b80a9[_0xbfb2('0x52')],_0x3eeed2[_0xbfb2('0x36')],_0x5ebd7c[_0xbfb2('0x3d')]);}})[_0xbfb2('0x14')](function(_0x810dd6){logger[_0xbfb2('0x15')]('['+[_0x15f80c['toUpperCase']()]+_0xbfb2('0x67'),util[_0xbfb2('0x68')](_0x810dd6,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xc79d=['active','sys_id','adminEmail','],\x20getUser\x20crm','userId','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','true','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident\x20-\x20',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','all','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','format','user:%s','emit','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','outbound','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','recordingFormat','none','[OUTBOUND]','recordingURL','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','request-promise','util','md5','./util','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','info','toUpperCase','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity'];(function(_0x3f6221,_0x2712f3){var _0x361da9=function(_0x407093){while(--_0x407093){_0x3f6221['push'](_0x3f6221['shift']());}};_0x361da9(++_0x2712f3);}(_0xc79d,0xc4));var _0xdc79=function(_0x48b20d,_0x5261ef){_0x48b20d=_0x48b20d-0x0;var _0x17ecd1=_0xc79d[_0x48b20d];return _0x17ecd1;};'use strict';var _=require(_0xdc79('0x0'));var Promise=require('bluebird');var rp=require(_0xdc79('0x1'));var util=require(_0xdc79('0x2'));var md5=require(_0xdc79('0x3'));var Redis=require('ioredis');var intUtil=require(_0xdc79('0x4'));var config=require('../../../../config/environment');var logger=require(_0xdc79('0x5'))(_0xdc79('0x6'));config[_0xdc79('0x7')]=_['defaults'](config[_0xdc79('0x7')],{'host':_0xdc79('0x8'),'port':0x18eb});var io=require(_0xdc79('0x9'))(new Redis(config[_0xdc79('0x7')]));function getAdminUser(_0x4336e3,_0x38f767,_0x121d60,_0x1205d0,_0x46122e,_0x13e100){return new Promise(function(_0x38deab,_0x2f36d6){var _0x29246a={'method':_0xdc79('0xa'),'uri':_0x1205d0+_0xdc79('0xb')+'&'+_0x46122e+'&'+_0x13e100,'auth':_0x38f767,'json':!![]};return rp(_0x29246a)[_0xdc79('0xc')](function(_0x2862fe){if(_0x2862fe[_0xdc79('0xd')][_0xdc79('0xe')]>0x0){_0x121d60[_0xdc79('0xf')]=_0x2862fe[_0xdc79('0xd')][0x0]['sys_id'];}logger[_0xdc79('0x10')]('['+[_0x4336e3[_0xdc79('0x11')]()]+'],\x20getAdminUser\x20crm',_0x121d60);_0x38deab(_0x121d60);})[_0xdc79('0x12')](function(_0x5270a8){logger[_0xdc79('0x13')]('['+[_0x4336e3[_0xdc79('0x11')]()]+']',_0x5270a8[_0xdc79('0x14')]);_0x2f36d6(_0x5270a8['message']);});});}function getUser(_0x3f1596,_0x3075b3,_0x3b0b83,_0x58814b,_0x5e1666){return function(_0x4b9da9){logger['info']('['+[_0x3f1596[_0xdc79('0x11')]()]+_0xdc79('0x15'),_0x4b9da9);return new Promise(function(_0x16c91e,_0x2f2997){if(intUtil[_0xdc79('0x16')](_0x4b9da9[_0xdc79('0x17')])){var _0x2d8375={'method':_0xdc79('0xa'),'uri':_0x3b0b83+_0xdc79('0x18')+_0x4b9da9[_0xdc79('0x17')]+'&'+_0x58814b+'&'+_0x5e1666,'auth':_0x3075b3,'json':!![]};logger['info']('['+[_0x3f1596['toUpperCase']()]+'],\x20getUser\x20rp\x20obj',_0x2d8375);return rp(_0x2d8375)[_0xdc79('0xc')](function(_0x5247ec){logger[_0xdc79('0x10')]('['+[_0x3f1596[_0xdc79('0x11')]()]+_0xdc79('0x19'),_0x5247ec);if(_0x5247ec['result']['length']>0x0&&String(_0x5247ec[_0xdc79('0xd')][0x0][_0xdc79('0x1a')])==='true'){_0x4b9da9['userId']=_0x5247ec[_0xdc79('0xd')][0x0][_0xdc79('0x1b')];}else{_0x4b9da9['userId']=_0x4b9da9['adminId'];_0x4b9da9[_0xdc79('0x17')]=_0x4b9da9[_0xdc79('0x1c')];}logger[_0xdc79('0x10')]('['+[_0x3f1596['toUpperCase']()]+_0xdc79('0x1d'),_0x4b9da9);_0x16c91e(_0x4b9da9);})[_0xdc79('0x12')](function(_0x51cf46){logger[_0xdc79('0x13')]('['+[_0x3f1596[_0xdc79('0x11')]()]+']',_0x51cf46[_0xdc79('0x14')]);_0x2f2997(_0x51cf46[_0xdc79('0x14')]);});}else{logger['info']('['+[_0x3f1596[_0xdc79('0x11')]()]+']\x20using\x20admin\x20profile');_0x4b9da9[_0xdc79('0x1e')]=_0x4b9da9[_0xdc79('0xf')];_0x4b9da9[_0xdc79('0x17')]=_0x4b9da9['adminEmail'];_0x16c91e(_0x4b9da9);}});};}function createEndUser(_0x29a752,_0x323a2a,_0x24e36f,_0x15b25f,_0x53e2f9){logger[_0xdc79('0x10')]('['+[_0x29a752[_0xdc79('0x11')]()]+_0xdc79('0x1f'),_0x24e36f);return new Promise(function(_0x4b98c1,_0x542986){var _0xbe0c1f={'method':_0xdc79('0x20'),'uri':_0x15b25f+_0xdc79('0x21')+_0x53e2f9,'body':{'user_name':_0x24e36f['endUserNumber'],'roles':_0xdc79('0x22'),'first_name':_0x24e36f[_0xdc79('0x23')],'active':_0xdc79('0x24'),'date_format':_0xdc79('0x25'),'phone':_0x24e36f[_0xdc79('0x23')]},'auth':_0x323a2a,'json':!![]};return rp(_0xbe0c1f)['then'](function(_0x327576){logger[_0xdc79('0x10')]('['+[_0x29a752[_0xdc79('0x11')]()]+_0xdc79('0x26'),_0x327576['result']);_0x24e36f[_0xdc79('0x27')]=_0x327576[_0xdc79('0xd')][_0xdc79('0x1b')];_0x4b98c1(_0x24e36f);})[_0xdc79('0x12')](function(_0x147d43){logger[_0xdc79('0x13')]('['+[_0x29a752[_0xdc79('0x11')]()]+']',_0x147d43[_0xdc79('0x14')]);_0x542986(_0x147d43[_0xdc79('0x14')]);});});}function getEndUser(_0x3a32af,_0x188cb9,_0x11071e,_0x14d50f,_0x21b64a){return function(_0x4de6cc){logger['info']('['+[_0x3a32af[_0xdc79('0x11')]()]+_0xdc79('0x28'),_0x4de6cc);return new Promise(function(_0xf841a4,_0x133958){var _0x5d3f20={'method':_0xdc79('0xa'),'uri':_0x11071e+_0xdc79('0x29')+_0x4de6cc[_0xdc79('0x23')]+'&'+_0x14d50f+'&'+_0x21b64a,'auth':_0x188cb9,'json':!![]};return rp(_0x5d3f20)['then'](function(_0x1ab7fb){if(_0x1ab7fb[_0xdc79('0xd')][_0xdc79('0xe')]>0x0){_0x4de6cc[_0xdc79('0x27')]=_0x1ab7fb['result'][0x0][_0xdc79('0x1b')];logger[_0xdc79('0x10')]('['+[_0x3a32af[_0xdc79('0x11')]()]+_0xdc79('0x2a'),_0x4de6cc);_0xf841a4(_0x4de6cc);}else{return createEndUser(_0x3a32af,_0x188cb9,_0x4de6cc,_0x11071e,_0x14d50f)[_0xdc79('0xc')](function(_0x32974b){logger[_0xdc79('0x10')]('['+[_0x3a32af[_0xdc79('0x11')]()]+'],\x20createEndUser\x20crm',_0x32974b);_0xf841a4(_0x32974b);});}})['catch'](function(_0x44f5d6){logger['error']('['+[_0x3a32af[_0xdc79('0x11')]()]+']',_0x44f5d6[_0xdc79('0x14')]);_0x133958(_0x44f5d6[_0xdc79('0x14')]);});});};}function getCustomFields(_0x15cd1c,_0x404e3d){var _0x1674e9={};if(_0x15cd1c[_0xdc79('0xe')]>0x0){_[_0xdc79('0x2b')](_0x15cd1c,function(_0x33ded5){if(_[_0xdc79('0x2c')]([_0xdc79('0x2d'),_0xdc79('0x2e')],_0x33ded5[_0xdc79('0x2f')])&&_0x33ded5[_0xdc79('0x30')]&&!_0x33ded5[_0xdc79('0x31')]){_0x1674e9[_0x33ded5['nameField'][_0xdc79('0x32')]()]=_0x33ded5[_0xdc79('0x33')][_0xdc79('0x34')]();}else if(_[_0xdc79('0x2c')](['string','picklist'],_0x33ded5[_0xdc79('0x2f')])&&_0x33ded5[_0xdc79('0x35')]&&_0x33ded5[_0xdc79('0x31')]){_0x1674e9[_0x33ded5['idField'][_0xdc79('0x32')]()]=_0x33ded5[_0xdc79('0x33')][_0xdc79('0x34')]();}else if(_0x33ded5[_0xdc79('0x2f')]==='variable'&&_0x33ded5[_0xdc79('0x36')]&&_0x33ded5[_0xdc79('0x35')]&&_0x33ded5[_0xdc79('0x31')]){_0x1674e9[_0x33ded5['idField'][_0xdc79('0x32')]()]=_0x404e3d[_0x33ded5[_0xdc79('0x36')]][_0xdc79('0x34')]();}else if(_0x33ded5[_0xdc79('0x2f')]===_0xdc79('0x37')&&_0x33ded5[_0xdc79('0x38')]&&_0x33ded5[_0xdc79('0x38')][_0xdc79('0x39')]&&_0x33ded5[_0xdc79('0x35')]&&_0x33ded5['customField']){_0x1674e9[_0x33ded5[_0xdc79('0x35')][_0xdc79('0x32')]()]=_0x404e3d[_0x33ded5[_0xdc79('0x38')]['name'][_0xdc79('0x32')]()][_0xdc79('0x34')]();}});}return _0x1674e9;}function getTicket(_0x42ca07,_0x465079,_0x161c28,_0x25ea9c,_0x10eeb5,_0x44009a){return function(_0x18c8c4){logger[_0xdc79('0x10')]('['+[_0x42ca07[_0xdc79('0x11')]()]+_0xdc79('0x3a'),_0x18c8c4);return new Promise(function(_0x4c3686,_0x7c2833){var _0x1a607e=_0x42ca07[_0xdc79('0x32')]()==='outbound'?_0x18c8c4[_0xdc79('0x1e')]:_0x18c8c4[_0xdc79('0x27')];var _0x46e0d8={'method':_0xdc79('0x20'),'uri':_0x161c28+'incident'+'?'+_0x44009a,'body':Object[_0xdc79('0x3b')]({},{'active':_0xdc79('0x24'),'caller_id':_0x1a607e,'assigned_to':_0x18c8c4[_0xdc79('0x1e')],'short_description':intUtil[_0xdc79('0x3c')](_0x25ea9c[_0xdc79('0x3d')],_0x10eeb5,'\x20'),'description':intUtil[_0xdc79('0x3c')](_0x25ea9c[_0xdc79('0x3e')],_0x10eeb5,'\x0a')},getCustomFields(_0x25ea9c[_0xdc79('0x3f')],_0x10eeb5)),'auth':_0x465079,'json':!![]};return rp(_0x46e0d8)['then'](function(_0x22ebd5){logger[_0xdc79('0x10')]('['+[_0x42ca07[_0xdc79('0x11')]()]+_0xdc79('0x40'),_0x22ebd5['result']);_0x18c8c4[_0xdc79('0x41')]=_0x22ebd5['result'][_0xdc79('0x1b')];_0x18c8c4[_0xdc79('0x42')]=_0x22ebd5[_0xdc79('0xd')][_0xdc79('0x43')];logger[_0xdc79('0x10')]('['+[_0x42ca07[_0xdc79('0x11')]()]+_0xdc79('0x44'),_0x18c8c4);_0x4c3686(_0x18c8c4);})[_0xdc79('0x12')](function(_0x37d36c){logger[_0xdc79('0x13')]('['+[_0x42ca07['toUpperCase']()]+']',_0x37d36c['message']);_0x7c2833(_0x37d36c[_0xdc79('0x14')]);});});};}function createRemoteTag(_0x15ca10,_0x54b05a,_0x5dd46b,_0x37f848){return new Promise(function(_0xe07778,_0x10845c){var _0x2076ee={'method':_0xdc79('0x20'),'uri':_0x5dd46b+_0xdc79('0x45')+'?'+_0x37f848,'body':{'short_description':_0x15ca10,'global':!![],'active':!![],'name':_0x15ca10},'auth':_0x54b05a,'json':!![]};return rp(_0x2076ee)['then'](function(_0xca55d){var _0x50e02b=_0xca55d[_0xdc79('0xd')][_0xdc79('0x1b')];_0xe07778(_0x50e02b);});});}function getRemoteTag(_0x18be9b,_0x424f28,_0x59c460,_0x1811a9,_0x34e888){return new Promise(function(_0x3c5f8f,_0x72e125){var _0x33d0a7={'method':_0xdc79('0xa'),'uri':_0x59c460+_0xdc79('0x45')+_0xdc79('0x46')+_0x18be9b+'&'+_0x1811a9,'auth':_0x424f28,'json':!![]};return rp(_0x33d0a7)[_0xdc79('0xc')](function(_0x263bf3){if(_0x263bf3[_0xdc79('0xd')][_0xdc79('0xe')]>0x0){var _0x280218=_0x263bf3[_0xdc79('0xd')][0x0][_0xdc79('0x1b')];_0x3c5f8f(_0x280218);}else{return createRemoteTag(_0x18be9b,_0x424f28,_0x59c460,_0x1811a9)[_0xdc79('0xc')](function(_0x191490){_0x3c5f8f(_0x191490);});}});});}function assignTagToIncident(_0x536c04,_0x8fb059,_0x39b393,_0x1044b4,_0x425e09){return new Promise(function(_0x2acde7,_0x3e2d8c){var _0x9edf41={'method':_0xdc79('0x20'),'uri':_0x39b393+_0xdc79('0x47')+'?'+_0x425e09,'body':{'label':_0x536c04,'table':'incident','id_type':'Incident','table_key':_0x1044b4[_0xdc79('0x41')],'title':_0xdc79('0x48')+_0x1044b4[_0xdc79('0x42')],'id_display':_0x1044b4[_0xdc79('0x42')]},'auth':_0x8fb059,'json':!![]};return rp(_0x9edf41)[_0xdc79('0xc')](function(_0x60469e){_0x2acde7();})['catch'](function(){_0x2acde7();});});}function manageTags(_0x48d86c,_0x301b9b,_0x5d0792,_0x3382ad,_0x424d25,_0x569626,_0x1843d7){return new Promise(function(_0x435613,_0x406427){var _0x2da4db=[];_0x301b9b[_0xdc79('0x2b')](function(_0x1c85fd){_0x2da4db['push'](getRemoteTag(_0x1c85fd,_0x5d0792,_0x3382ad,_0x569626,_0x1843d7));});return Promise['all'](_0x2da4db)[_0xdc79('0xc')](function(_0x109065){if(_0x109065[_0xdc79('0xe')]){logger['info']('['+[_0x48d86c[_0xdc79('0x11')]()]+_0xdc79('0x49'),_0x109065);var _0x83652a=[];_0x109065[_0xdc79('0x2b')](function(_0x5b914c){_0x83652a[_0xdc79('0x4a')](assignTagToIncident(_0x5b914c,_0x5d0792,_0x3382ad,_0x424d25,_0x569626));});return Promise[_0xdc79('0x4b')](_0x83652a)['then'](function(){_0x435613();})[_0xdc79('0x12')](function(){_0x435613();});}else{_0x435613();}});});}function getTags(_0x92934a,_0x3a41e2,_0x57e332,_0x49d4f1,_0x1d1723,_0x48fd60){return function(_0x275791){return new Promise(function(_0x340638,_0x4cf449){var _0x2f96a3=[];var _0x34fe46=_0x49d4f1[_0xdc79('0x4c')];if(_0x34fe46&&_0x34fe46[_0xdc79('0xe')]>0x0){_0x2f96a3=_['map'](_0x34fe46,_0xdc79('0x39'));}if(_0x2f96a3['length']>0x0){return manageTags(_0x92934a,_0x2f96a3,_0x3a41e2,_0x57e332,_0x275791,_0x1d1723,_0x48fd60)[_0xdc79('0xc')](function(){_0x340638(_0x275791);});}else{_0x340638(_0x275791);}});};}function emit(_0x40a8e7,_0x466035,_0x3781ee){var _0xe4ed5f=_0xdc79('0x4d')+_0xdc79('0x4e')+_0xdc79('0x4f')+_0xdc79('0x50');var _0x532034={'uri':_0x40a8e7+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x3781ee+_0xe4ed5f};io['to'](util[_0xdc79('0x51')](_0xdc79('0x52'),_0x466035))[_0xdc79('0x53')]('trigger:browser:url',_0x532034);}exports['cs']=function(_0x38d16b,_0x3e72fb,_0x4321ef,_0x32ca4e,_0x12eaee,_0x5de246,_0x2a6e12,_0x23e0ed){var _0x22c064={};var _0x1361ce={'user':_0x5de246[_0xdc79('0x54')],'pass':_0x5de246[_0xdc79('0x55')]};var _0x436112=_0xdc79('0x56');var _0x1480d3=_0xdc79('0x57');_0x5de246[_0xdc79('0x58')]=intUtil[_0xdc79('0x59')](_0x5de246[_0xdc79('0x58')]);_0x5de246[_0xdc79('0x5a')]=intUtil['stripTrailingSlash'](_0x5de246['serverUrl']);var _0x5996c4=util[_0xdc79('0x51')](_0xdc79('0x5b'),_0x5de246['remoteUri']);_0x22c064[_0xdc79('0x17')]=!_[_0xdc79('0x5c')](_0x32ca4e)?_0x32ca4e[_0xdc79('0x5d')]:null;_0x22c064[_0xdc79('0x1c')]=_0x5de246[_0xdc79('0x5d')];_0x22c064['endUserNumber']=_0x23e0ed[_0xdc79('0x32')]()===_0xdc79('0x5e')?_0x3e72fb[_0xdc79('0x5f')]:_0x3e72fb[_0xdc79('0x60')];_0x22c064[_0xdc79('0x61')]=_0x23e0ed==='queue'||_0x23e0ed==='unmanaged'?_0xdc79('0x62'):_0xdc79('0x5e');var _0x3d5f64=util[_0xdc79('0x51')](_0xdc79('0x63'),_0x5de246[_0xdc79('0x5a')],_0x3e72fb[_0xdc79('0x64')],md5(_0x3e72fb[_0xdc79('0x64')]));if(_0x12eaee&&_0x12eaee['monitor_format']){logger[_0xdc79('0x10')](_0xdc79('0x65'),'Recording\x20is\x20enabled!');_0x3e72fb['recordingURL']=_0x3d5f64;}else if(_0x2a6e12&&_0x2a6e12[_0xdc79('0x66')]&&_0x2a6e12[_0xdc79('0x66')]!==_0xdc79('0x67')){logger[_0xdc79('0x10')](_0xdc79('0x68'),'Recording\x20is\x20enabled!');_0x3e72fb[_0xdc79('0x69')]=_0x3d5f64;}else{_0x3e72fb[_0xdc79('0x69')]='';}return getAdminUser(_0x23e0ed,_0x1361ce,_0x22c064,_0x5996c4,_0x1480d3,_0x436112)[_0xdc79('0xc')](getUser(_0x23e0ed,_0x1361ce,_0x5996c4,_0x1480d3,_0x436112))[_0xdc79('0xc')](getEndUser(_0x23e0ed,_0x1361ce,_0x5996c4,_0x1480d3,_0x436112))[_0xdc79('0xc')](getTicket(_0x23e0ed,_0x1361ce,_0x5996c4,_0x4321ef,_0x3e72fb,_0x1480d3))[_0xdc79('0xc')](function(_0x475604){logger[_0xdc79('0x10')](util[_0xdc79('0x51')]('The\x20ticket\x20ID\x20is:\x20%s',_0x475604[_0xdc79('0x41')]));logger[_0xdc79('0x10')](util[_0xdc79('0x51')](_0xdc79('0x6a'),_0x23e0ed));if(_0x23e0ed!==_0xdc79('0x6b')){logger[_0xdc79('0x10')]('['+[_0x23e0ed[_0xdc79('0x11')]()]+']',_0xdc79('0x6c'));emit(_0x5de246[_0xdc79('0x58')],_0x32ca4e[_0xdc79('0x39')],_0x475604[_0xdc79('0x41')]);}})[_0xdc79('0x12')](function(_0x46a3fa){logger[_0xdc79('0x13')]('['+[_0x23e0ed[_0xdc79('0x11')]()]+_0xdc79('0x6d'),util[_0xdc79('0x6e')](_0x46a3fa,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 44fc679..e019623 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a75=['users','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...','catch','error','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','Ticket\x20created!','contacts','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','trigger:browser:url','unmanaged','lastevent','toUpperCase','calleridname','Fields','request-promise','md5','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','POST','emit','info','Creating\x20new\x20ticket...','getString','Subjects','assigned_user_id','created_by','Descriptions','replace','parent_id','parent_type','Contacts','parent_name','name','direction','length','forEach','variableName','push','JSON','stringify','Calls','format','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','find','entry_list','name_value_list','user_name','value','Agent\x20found!','resolve','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','idField','custom_fields','content','variable','customVariable','Variable','username','password','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','The\x20Ticket\x20ID\x20is:'];(function(_0x5af5e4,_0x4458d0){var _0x48ecdc=function(_0x2055f8){while(--_0x2055f8){_0x5af5e4['push'](_0x5af5e4['shift']());}};_0x48ecdc(++_0x4458d0);}(_0x4a75,0x17d));var _0x54a7=function(_0xf51c06,_0x388e5b){_0xf51c06=_0xf51c06-0x0;var _0x1d5420=_0x4a75[_0xf51c06];return _0x1d5420;};'use strict';var _=require('lodash');var rp=require(_0x54a7('0x0'));var BPromise=require('bluebird');var md5=require(_0x54a7('0x1'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x54a7('0x2'));var config=require(_0x54a7('0x3'));var logger=require(_0x54a7('0x4'))(_0x54a7('0x5'));config[_0x54a7('0x6')]=_[_0x54a7('0x7')](config['redis'],{'host':_0x54a7('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x54a7('0x6')]));var def={'method':_0x54a7('0x9'),'json':!![]};function emit(_0x253865,_0x4ead46,_0x4e3cae){io['to'](_0x253865)[_0x54a7('0xa')](_0x4ead46,_0x4e3cae);}function getTicket(_0x2359d0,_0x14494a,_0x1512d7,_0x14ebbf,_0x765782,_0x4c1f54,_0x3c2669,_0x4be78a){logger[_0x54a7('0xb')](_0x54a7('0xc'));var _0x578434=new Date();var _0x2e47c3=[{'name':'name','value':intUtil[_0x54a7('0xd')](_0x14ebbf[_0x54a7('0xe')],_0x765782,'\x20')},{'name':_0x54a7('0xf'),'value':_0x14494a['id']},{'name':_0x54a7('0x10'),'value':_0x14494a['id']},{'name':'description','value':intUtil[_0x54a7('0xd')](_0x14ebbf[_0x54a7('0x11')],_0x765782,'\x0a')},{'name':'date_start','value':_0x578434['toISOString']()['slice'](0x0,0x13)[_0x54a7('0x12')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x54a7('0x13'),'value':_0x1512d7['id']},{'name':_0x54a7('0x14'),'value':_0x54a7('0x15')},{'name':_0x54a7('0x16'),'value':_0x1512d7[_0x54a7('0x17')]},{'name':_0x54a7('0x18'),'value':_0x4be78a}];if(_0x4c1f54[_0x54a7('0x19')]){_[_0x54a7('0x1a')](_0x4c1f54,function(_0x1e11c8){if(_0x765782[_0x1e11c8[_0x54a7('0x1b')]]){_0x2e47c3[_0x54a7('0x1c')]({'name':_0x1e11c8['idField'],'value':_0x765782[_0x1e11c8[_0x54a7('0x1b')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x54a7('0x1d'),'response_type':_0x54a7('0x1d'),'rest_data':JSON[_0x54a7('0x1e')]({'session':_0x3c2669['id'],'module_name':_0x54a7('0x1f'),'name_value_list':_0x2e47c3})}});}function getAuth(_0x3d00e6){return util[_0x54a7('0x20')]('Basic\x20%s',new Buffer(_0x3d00e6['apiKey']+':X')[_0x54a7('0x21')](_0x54a7('0x22')));}function getServerInfo(_0x11a100){return request({'form':{'method':_0x54a7('0x23'),'input_type':_0x54a7('0x1d'),'response_type':_0x54a7('0x1d'),'rest_data':JSON['stringify']({'session':_0x11a100['id']})}});}function getUser(_0x27bb44,_0x345d2f,_0x550fec){if(!_[_0x54a7('0x24')](_0x345d2f)){logger['info'](_0x54a7('0x25'),_0x345d2f);return request({'form':{'method':'get_entry_list','input_type':_0x54a7('0x1d'),'response_type':_0x54a7('0x1d'),'rest_data':JSON[_0x54a7('0x1e')]({'session':_0x550fec['id'],'module_name':_0x54a7('0x26'),'query':util[_0x54a7('0x20')](_0x54a7('0x27'),_0x345d2f),'order_by':'','offset':'0','select_fields':['id','name','user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x54a7('0x28')](function(_0x58977c){if(_0x58977c['entry_list'][_0x54a7('0x19')]){var _0x161b0f=_[_0x54a7('0x29')](_0x58977c[_0x54a7('0x2a')],function(_0x1d10cd){return _0x1d10cd[_0x54a7('0x2b')][_0x54a7('0x2c')][_0x54a7('0x2d')]===_0x345d2f;});if(_0x161b0f){logger['info'](_0x54a7('0x2e'));return BPromise[_0x54a7('0x2f')]({'id':_0x161b0f[_0x54a7('0x2b')]['id'][_0x54a7('0x2d')],'name':_0x161b0f[_0x54a7('0x2b')][_0x54a7('0x17')]['value']});}}logger[_0x54a7('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x54a7('0x2f')]({'id':_0x550fec[_0x54a7('0x2b')]['user_id']['value'],'name':_0x550fec[_0x54a7('0x2b')][_0x54a7('0x2c')][_0x54a7('0x2d')]});});}else{logger[_0x54a7('0xb')](_0x54a7('0x30'));return BPromise[_0x54a7('0x2f')]({'id':_0x550fec[_0x54a7('0x2b')][_0x54a7('0x31')][_0x54a7('0x2d')],'name':_0x550fec[_0x54a7('0x2b')]['user_name']['value']});}}function getEndUser(_0x52b8b9,_0x2d1afa,_0x1c8fb1,_0x1b67ca){logger['info'](_0x54a7('0x32'),_0x1c8fb1);return request({'form':{'method':_0x54a7('0x33'),'input_type':_0x54a7('0x1d'),'response_type':_0x54a7('0x1d'),'rest_data':JSON[_0x54a7('0x1e')]({'session':_0x1b67ca['id'],'module_name':_0x54a7('0x15'),'query':util[_0x54a7('0x20')](_0x54a7('0x34'),_0x1c8fb1),'order_by':'','offset':'0','select_fields':['id',_0x54a7('0x17'),_0x54a7('0x35')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x3a4698){if(_0x3a4698['entry_list'][_0x54a7('0x19')]){var _0x1989e1=_[_0x54a7('0x29')](_0x3a4698[_0x54a7('0x2a')],function(_0x17bfe3){return _0x17bfe3['name_value_list'][_0x54a7('0x35')][_0x54a7('0x2d')]===_0x1c8fb1;});if(_0x1989e1){logger['info']('Enduser\x20found!');return BPromise[_0x54a7('0x2f')]({'id':_0x1989e1[_0x54a7('0x2b')]['id']['value'],'name':_0x1989e1['name_value_list']['name'][_0x54a7('0x2d')],'phone':_0x1989e1['name_value_list'][_0x54a7('0x35')][_0x54a7('0x2d')]});}}else{logger['info'](_0x54a7('0x36'));return request({'form':{'method':_0x54a7('0x37'),'input_type':_0x54a7('0x1d'),'response_type':'JSON','rest_data':JSON[_0x54a7('0x1e')]({'session':_0x1b67ca['id'],'module_name':_0x54a7('0x15'),'name_value_list':[{'name':_0x54a7('0x38'),'value':_0x2d1afa!=='<unknown>'?_0x2d1afa:util[_0x54a7('0x20')]('Caller\x20-\x20%s',_0x1c8fb1)},{'name':_0x54a7('0x35'),'value':_0x1c8fb1}]})}})[_0x54a7('0x28')](function(_0x458177){logger[_0x54a7('0xb')](_0x54a7('0x39'));return BPromise[_0x54a7('0x2f')]({'id':_0x458177['id'],'name':_0x458177['entry_list'][_0x54a7('0x38')][_0x54a7('0x2d')],'phone':_0x458177[_0x54a7('0x2a')][_0x54a7('0x35')][_0x54a7('0x2d')]});});}});}function request(_0x51c82b){logger[_0x54a7('0x3a')](_0x54a7('0x3b'),JSON[_0x54a7('0x1e')](_0x51c82b));return rp(_[_0x54a7('0x3c')](def,_0x51c82b));}function getTags(_0x463535,_0x324399){var _0x2cf3ef=[];if(_0x463535&&_0x463535[_0x54a7('0x19')]>0x0){_0x2cf3ef=_[_0x54a7('0x3d')](_0x463535,_0x324399);}return _0x2cf3ef;}function getCustomFields(_0x53d6b9,_0x4351d2){var _0x3e299d=[];var _0x1ef4b3={'custom_fields':[]};if(_0x53d6b9['length']>0x0){_[_0x54a7('0x1a')](_0x53d6b9,function(_0x4e9372){if(_0x4e9372[_0x54a7('0x3e')]===_0x54a7('0x3f')&&_0x4e9372[_0x54a7('0x40')]&&!_0x4e9372[_0x54a7('0x41')]){_0x1ef4b3[_0x4e9372[_0x54a7('0x40')][_0x54a7('0x42')]()]=_0x4e9372['content'][_0x54a7('0x21')]();}else if(_0x4e9372[_0x54a7('0x3e')]===_0x54a7('0x3f')&&_0x4e9372[_0x54a7('0x43')]&&_0x4e9372[_0x54a7('0x41')]){_0x1ef4b3[_0x54a7('0x44')][_0x54a7('0x1c')]({'id':_0x4e9372['idField'],'value':_0x4e9372[_0x54a7('0x45')][_0x54a7('0x21')]()});}else if(_0x4e9372[_0x54a7('0x3e')]===_0x54a7('0x46')&&_0x4e9372[_0x54a7('0x1b')]&&_0x4e9372['idField']&&_0x4e9372[_0x54a7('0x41')]){_0x4351d2[_0x4e9372['variableName']]&&_0x1ef4b3[_0x54a7('0x44')]['push']({'id':_0x4e9372[_0x54a7('0x43')],'value':_0x4351d2[_0x4e9372[_0x54a7('0x1b')]]['toString']()});}else if(_0x4e9372[_0x54a7('0x3e')]===_0x54a7('0x47')&&_0x4e9372[_0x54a7('0x48')]&&_0x4e9372[_0x54a7('0x48')][_0x54a7('0x17')]&&_0x4e9372['idField']&&_0x4e9372['customField']){_0x4351d2[_0x4e9372['Variable'][_0x54a7('0x17')][_0x54a7('0x42')]()]&&_0x1ef4b3[_0x54a7('0x44')]['push']({'id':_0x4e9372[_0x54a7('0x43')],'value':_0x4351d2[_0x4e9372[_0x54a7('0x48')][_0x54a7('0x17')][_0x54a7('0x42')]()][_0x54a7('0x21')]()});}});}return _0x1ef4b3;}function getConnection(_0x4d2fe7){return request({'method':_0x54a7('0x9'),'form':{'method':'login','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x54a7('0x1e')]({'user_auth':{'user_name':_0x4d2fe7[_0x54a7('0x49')],'password':_0x4d2fe7[_0x54a7('0x4a')],'encryption':'PLAIN'},'application':_0x54a7('0x4b')})}})[_0x54a7('0x28')](function(_0x466231){var _0x1a6c9f=_0x466231;if(_0x1a6c9f['id']){def[_0x54a7('0x4c')]=_0x1a6c9f['id'];return BPromise[_0x54a7('0x2f')](_0x1a6c9f);}else{throw new Error(util[_0x54a7('0x20')](_0x54a7('0x4d'),_0x4d2fe7['id']));}});}function setRelationship(_0x25c84a,_0x54fd97,_0x31a0b2,_0x39cf4b){return request({'form':{'method':_0x54a7('0x4e'),'input_type':_0x54a7('0x1d'),'response_type':_0x54a7('0x1d'),'rest_data':JSON['stringify']({'session':_0x25c84a['id'],'module_name':'Calls','module_id':_0x31a0b2['id'],'link_field_name':_0x39cf4b,'related_ids':[_0x54fd97['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x54a7('0x4f')]=function(_0xeb0f66,_0x325546,_0x31a9c9,_0x32cb9e,_0x422715,_0x4ddd3c){var _0x223a5d,_0x187294,_0x306674,_0x1ce618;_0x4ddd3c[_0x54a7('0x50')]=intUtil[_0x54a7('0x51')](_0x4ddd3c[_0x54a7('0x50')]);_0x4ddd3c[_0x54a7('0x52')]=intUtil[_0x54a7('0x51')](_0x4ddd3c[_0x54a7('0x52')]);def[_0x54a7('0x53')]=util['format'](_0x54a7('0x54'),_0x4ddd3c[_0x54a7('0x50')]);if(_0x422715&&_0x422715[_0x54a7('0x55')]){logger[_0x54a7('0xb')](_0x54a7('0x56'),_0x54a7('0x57'));_0x325546['recordingURL']=util[_0x54a7('0x20')](_0x54a7('0x58'),_0x4ddd3c[_0x54a7('0x52')],_0x325546[_0x54a7('0x59')],md5(_0x325546[_0x54a7('0x59')]));}else{_0x325546[_0x54a7('0x5a')]='';}return getConnection(_0x4ddd3c)[_0x54a7('0x28')](function(_0x401bf2){_0x1ce618=_0x401bf2;return getUser(_0x4ddd3c,_0x32cb9e[_0x54a7('0x17')],_0x1ce618);})[_0x54a7('0x28')](function(_0x5156a4){_0x223a5d=_0x5156a4;logger[_0x54a7('0xb')]('The\x20User\x20ID\x20is:',_0x223a5d['id']);return getEndUser(_0x4ddd3c,_0x325546['calleridname'],_0x325546[_0x54a7('0x5b')],_0x1ce618);})[_0x54a7('0x28')](function(_0x329cfa){_0x187294=_0x329cfa;logger[_0x54a7('0xb')](_0x54a7('0x5c'),_0x187294['id']);return getTicket(_0x4ddd3c,_0x223a5d,_0x187294,_0x31a9c9,_0x325546,_0x31a9c9['Fields'],_0x1ce618,_0x54a7('0x5d'));})['then'](function(_0x22f7a3){_0x306674=_0x22f7a3;logger[_0x54a7('0xb')]('Ticket\x20created!');logger[_0x54a7('0xb')](_0x54a7('0x5e'),_0x306674['id']);return setRelationship(_0x1ce618,_0x223a5d,_0x306674,_0x54a7('0x5f'));})[_0x54a7('0x28')](function(){return setRelationship(_0x1ce618,_0x187294,_0x306674,'contacts');})[_0x54a7('0x28')](function(){return getServerInfo(_0x1ce618);})['then'](function(_0x1281d1){var _0x13d73c=parseInt(_0x1281d1[_0x54a7('0x60')][_0x54a7('0x61')](0x0));var _0x423a1b=util[_0x54a7('0x20')](_0x54a7('0x62'),_0x4ddd3c['remoteUri'],_0x306674['id']);if(_0x13d73c>0x6){_0x423a1b=util[_0x54a7('0x20')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x4ddd3c[_0x54a7('0x50')],_0x306674['id']);}logger['info'](_0x54a7('0x56'),_0x54a7('0x63'));emit(util[_0x54a7('0x20')]('user:%s',_0x32cb9e[_0x54a7('0x17')]),'trigger:browser:url',{'uri':_0x423a1b});})[_0x54a7('0x64')](function(_0x369383){logger[_0x54a7('0x65')](_0x54a7('0x56'),JSON[_0x54a7('0x1e')](_0x369383));});};exports[_0x54a7('0x66')]=function(_0x3b2aa6,_0x5ccd00,_0x4ec21,_0x27fd07,_0x45129d,_0x431903,_0x22edd1){var _0x497cb6,_0x155ee6,_0x395fc4,_0x6ac9ab;_0x431903[_0x54a7('0x50')]=intUtil[_0x54a7('0x51')](_0x431903[_0x54a7('0x50')]);_0x431903[_0x54a7('0x52')]=intUtil['stripTrailingSlash'](_0x431903['serverUrl']);def[_0x54a7('0x53')]=util[_0x54a7('0x20')]('%s/service/v4_1/rest.php',_0x431903['remoteUri']);if(_0x22edd1&&_0x22edd1[_0x54a7('0x67')]&&_0x22edd1[_0x54a7('0x67')]!==_0x54a7('0x68')){logger['info'](_0x54a7('0x69'),'Recording\x20is\x20enabled!');_0x5ccd00[_0x54a7('0x5a')]=util[_0x54a7('0x20')](_0x54a7('0x58'),_0x431903[_0x54a7('0x52')],_0x5ccd00['uniqueid'],md5(_0x5ccd00[_0x54a7('0x59')]));}return getConnection(_0x431903)[_0x54a7('0x28')](function(_0x3ee595){_0x6ac9ab=_0x3ee595;return getUser(_0x431903,_0x27fd07[_0x54a7('0x17')],_0x6ac9ab);})[_0x54a7('0x28')](function(_0x521ba1){_0x497cb6=_0x521ba1;logger['info'](_0x54a7('0x6a'),_0x497cb6['id']);return getEndUser(_0x431903,_0x5ccd00[_0x54a7('0x6b')],_0x5ccd00[_0x54a7('0x6c')],_0x6ac9ab);})[_0x54a7('0x28')](function(_0x116ca4){_0x155ee6=_0x116ca4;logger['info'](_0x54a7('0x5c'),_0x155ee6['id']);return getTicket(_0x431903,_0x497cb6,_0x155ee6,_0x4ec21,_0x5ccd00,_0x4ec21['Fields'],_0x6ac9ab,_0x54a7('0x6d'));})[_0x54a7('0x28')](function(_0x4f4bcb){_0x395fc4=_0x4f4bcb;logger[_0x54a7('0xb')](_0x54a7('0x6e'));logger[_0x54a7('0xb')](_0x54a7('0x5e'),_0x395fc4['id']);return setRelationship(_0x6ac9ab,_0x497cb6,_0x395fc4,'users');})[_0x54a7('0x28')](function(){return setRelationship(_0x6ac9ab,_0x155ee6,_0x395fc4,_0x54a7('0x6f'));})['then'](function(){return getServerInfo(_0x6ac9ab);})['then'](function(_0x1b81c7){var _0x44373b=parseInt(_0x1b81c7[_0x54a7('0x60')]['charAt'](0x0));var _0x1bcda8=util[_0x54a7('0x20')](_0x54a7('0x62'),_0x431903[_0x54a7('0x50')],_0x395fc4['id']);if(_0x44373b>0x6){_0x1bcda8=util[_0x54a7('0x20')](_0x54a7('0x70'),_0x431903[_0x54a7('0x50')],_0x395fc4['id']);}logger['info']('[OUTBOUND]',_0x54a7('0x63'));emit(util[_0x54a7('0x20')]('user:%s',_0x27fd07['name']),_0x54a7('0x71'),{'uri':_0x1bcda8});})[_0x54a7('0x64')](function(_0x5e36dc){logger[_0x54a7('0x65')]('[OUTBOUND]',JSON['stringify'](_0x5e36dc));});};exports[_0x54a7('0x72')]=function(_0x3ede85,_0x18d4a1,_0x123628,_0x52dc05,_0x46e4dd,_0x212b33){var _0x3b80cf,_0x3858c2,_0x318739,_0x1e0e93;_0x212b33['remoteUri']=intUtil[_0x54a7('0x51')](_0x212b33['remoteUri']);_0x212b33[_0x54a7('0x52')]=intUtil[_0x54a7('0x51')](_0x212b33[_0x54a7('0x52')]);def[_0x54a7('0x53')]=util['format']('%s/service/v4_1/rest.php',_0x212b33[_0x54a7('0x50')]);if(_0x46e4dd&&_0x46e4dd['monitor_format']){logger['info']('['+_0x18d4a1[_0x54a7('0x73')][_0x54a7('0x74')]()+']',_0x54a7('0x57'));_0x18d4a1[_0x54a7('0x5a')]=util[_0x54a7('0x20')](_0x54a7('0x58'),_0x212b33['serverUrl'],_0x18d4a1[_0x54a7('0x59')],md5(_0x18d4a1[_0x54a7('0x59')]));}else{_0x18d4a1[_0x54a7('0x5a')]='';}return getConnection(_0x212b33)[_0x54a7('0x28')](function(_0x3d1c09){_0x1e0e93=_0x3d1c09;if(!_[_0x54a7('0x24')](_0x52dc05)){return getUser(_0x212b33,_0x52dc05[_0x54a7('0x17')],_0x1e0e93);}else{return getUser(_0x212b33,null,_0x1e0e93);}})[_0x54a7('0x28')](function(_0x4bd9d3){_0x3b80cf=_0x4bd9d3;logger['info'](_0x54a7('0x6a'),_0x3b80cf['id']);return getEndUser(_0x212b33,_0x18d4a1[_0x54a7('0x75')],_0x18d4a1[_0x54a7('0x5b')],_0x1e0e93);})['then'](function(_0x5e8964){_0x3858c2=_0x5e8964;logger[_0x54a7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x3858c2['id']);return getTicket(_0x212b33,_0x3b80cf,_0x3858c2,_0x123628,_0x18d4a1,_0x123628[_0x54a7('0x76')],_0x1e0e93,'Inbound');})[_0x54a7('0x28')](function(_0x154d0e){_0x318739=_0x154d0e;logger[_0x54a7('0xb')](_0x54a7('0x6e'));logger['info'](_0x54a7('0x5e'),_0x318739['id']);return setRelationship(_0x1e0e93,_0x3b80cf,_0x318739,'users');})['then'](function(){return setRelationship(_0x1e0e93,_0x3858c2,_0x318739,'contacts');})[_0x54a7('0x28')](function(){return getServerInfo(_0x1e0e93);})['catch'](function(_0x356c68){logger[_0x54a7('0x65')]('['+_0x18d4a1[_0x54a7('0x73')][_0x54a7('0x74')]()+']',JSON[_0x54a7('0x1e')](_0x356c68));});};
\ No newline at end of file
+var _0x5751=['[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','unmanaged','lastevent','toUpperCase','request-promise','md5','util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','name','Subjects','assigned_user_id','getString','date_start','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','variableName','push','idField','set_entry','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','JSON','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','find','name_value_list','value','Agent\x20found!','resolve','user_id','Searching\x20enduser\x20with\x20phone','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','<unknown>','Caller\x20-\x20%s','then','Enduser\x20created.','debug','[HTTP]','merge','map','forEach','nameField','toLowerCase','content','string','custom_fields','type','variable','customField','Variable','POST','login','username','password','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','stripTrailingSlash','remoteUri','serverUrl','uri','%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','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','error','outbound','recordingFormat','none'];(function(_0x3640e9,_0x57bbee){var _0x38732c=function(_0x55963f){while(--_0x55963f){_0x3640e9['push'](_0x3640e9['shift']());}};_0x38732c(++_0x57bbee);}(_0x5751,0x86));var _0x1575=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0x5751[_0x5cb1af];return _0x8d7940;};'use strict';var _=require('lodash');var rp=require(_0x1575('0x0'));var BPromise=require('bluebird');var md5=require(_0x1575('0x1'));var util=require(_0x1575('0x2'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x1575('0x3'));var logger=require(_0x1575('0x4'))(_0x1575('0x5'));config[_0x1575('0x6')]=_[_0x1575('0x7')](config[_0x1575('0x6')],{'host':_0x1575('0x8'),'port':0x18eb});var io=require(_0x1575('0x9'))(new Redis(config['redis']));var def={'method':'POST','json':!![]};function emit(_0x2ddaf2,_0x4dd058,_0x148667){io['to'](_0x2ddaf2)[_0x1575('0xa')](_0x4dd058,_0x148667);}function getTicket(_0x3284fc,_0x140cba,_0x3c842b,_0x2ba4a1,_0x3985a3,_0x290f3d,_0x5e03f7,_0x139161){logger[_0x1575('0xb')](_0x1575('0xc'));var _0x3bcc64=new Date();var _0x432eb5=[{'name':_0x1575('0xd'),'value':intUtil['getString'](_0x2ba4a1[_0x1575('0xe')],_0x3985a3,'\x20')},{'name':_0x1575('0xf'),'value':_0x140cba['id']},{'name':'created_by','value':_0x140cba['id']},{'name':'description','value':intUtil[_0x1575('0x10')](_0x2ba4a1['Descriptions'],_0x3985a3,'\x0a')},{'name':_0x1575('0x11'),'value':_0x3bcc64['toISOString']()[_0x1575('0x12')](0x0,0x13)[_0x1575('0x13')]('T','\x20')},{'name':_0x1575('0x14'),'value':'0'},{'name':_0x1575('0x15'),'value':'15'},{'name':_0x1575('0x16'),'value':_0x3c842b['id']},{'name':_0x1575('0x17'),'value':_0x1575('0x18')},{'name':_0x1575('0x19'),'value':_0x3c842b['name']},{'name':_0x1575('0x1a'),'value':_0x139161}];if(_0x290f3d[_0x1575('0x1b')]){_['forEach'](_0x290f3d,function(_0x3489a6){if(_0x3985a3[_0x3489a6[_0x1575('0x1c')]]){_0x432eb5[_0x1575('0x1d')]({'name':_0x3489a6[_0x1575('0x1e')],'value':_0x3985a3[_0x3489a6[_0x1575('0x1c')]]});}});}return request({'form':{'method':_0x1575('0x1f'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x1575('0x20')]({'session':_0x5e03f7['id'],'module_name':_0x1575('0x21'),'name_value_list':_0x432eb5})}});}function getAuth(_0x51c29e){return util[_0x1575('0x22')](_0x1575('0x23'),new Buffer(_0x51c29e[_0x1575('0x24')]+':X')[_0x1575('0x25')](_0x1575('0x26')));}function getServerInfo(_0x44aeeb){return request({'form':{'method':'get_server_info','input_type':_0x1575('0x27'),'response_type':_0x1575('0x27'),'rest_data':JSON[_0x1575('0x20')]({'session':_0x44aeeb['id']})}});}function getUser(_0x298160,_0xf324ae,_0xe91bd){if(!_[_0x1575('0x28')](_0xf324ae)){logger['info'](_0x1575('0x29'),_0xf324ae);return request({'form':{'method':_0x1575('0x2a'),'input_type':_0x1575('0x27'),'response_type':_0x1575('0x27'),'rest_data':JSON[_0x1575('0x20')]({'session':_0xe91bd['id'],'module_name':_0x1575('0x2b'),'query':util[_0x1575('0x22')](_0x1575('0x2c'),_0xf324ae),'order_by':'','offset':'0','select_fields':['id',_0x1575('0xd'),_0x1575('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x5813f3){if(_0x5813f3[_0x1575('0x2e')][_0x1575('0x1b')]){var _0x174f5f=_[_0x1575('0x2f')](_0x5813f3[_0x1575('0x2e')],function(_0x35a2df){return _0x35a2df[_0x1575('0x30')][_0x1575('0x2d')][_0x1575('0x31')]===_0xf324ae;});if(_0x174f5f){logger[_0x1575('0xb')](_0x1575('0x32'));return BPromise[_0x1575('0x33')]({'id':_0x174f5f[_0x1575('0x30')]['id'][_0x1575('0x31')],'name':_0x174f5f[_0x1575('0x30')][_0x1575('0xd')][_0x1575('0x31')]});}}logger[_0x1575('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x1575('0x33')]({'id':_0xe91bd[_0x1575('0x30')][_0x1575('0x34')]['value'],'name':_0xe91bd[_0x1575('0x30')][_0x1575('0x2d')]['value']});});}else{logger[_0x1575('0xb')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0xe91bd[_0x1575('0x30')][_0x1575('0x34')][_0x1575('0x31')],'name':_0xe91bd[_0x1575('0x30')]['user_name'][_0x1575('0x31')]});}}function getEndUser(_0x2f4a95,_0x51f585,_0x4d581f,_0x5c133d){logger[_0x1575('0xb')](_0x1575('0x35'),_0x4d581f);return request({'form':{'method':_0x1575('0x2a'),'input_type':_0x1575('0x27'),'response_type':_0x1575('0x27'),'rest_data':JSON['stringify']({'session':_0x5c133d['id'],'module_name':_0x1575('0x18'),'query':util[_0x1575('0x22')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x4d581f),'order_by':'','offset':'0','select_fields':['id',_0x1575('0xd'),_0x1575('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x3d1f7f){if(_0x3d1f7f['entry_list'][_0x1575('0x1b')]){var _0x22f409=_[_0x1575('0x2f')](_0x3d1f7f[_0x1575('0x2e')],function(_0xef926a){return _0xef926a[_0x1575('0x30')][_0x1575('0x36')]['value']===_0x4d581f;});if(_0x22f409){logger['info'](_0x1575('0x37'));return BPromise[_0x1575('0x33')]({'id':_0x22f409[_0x1575('0x30')]['id'][_0x1575('0x31')],'name':_0x22f409[_0x1575('0x30')]['name'][_0x1575('0x31')],'phone':_0x22f409[_0x1575('0x30')]['phone_home'][_0x1575('0x31')]});}}else{logger[_0x1575('0xb')](_0x1575('0x38'));return request({'form':{'method':_0x1575('0x1f'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x1575('0x20')]({'session':_0x5c133d['id'],'module_name':_0x1575('0x18'),'name_value_list':[{'name':_0x1575('0x39'),'value':_0x51f585!==_0x1575('0x3a')?_0x51f585:util[_0x1575('0x22')](_0x1575('0x3b'),_0x4d581f)},{'name':_0x1575('0x36'),'value':_0x4d581f}]})}})[_0x1575('0x3c')](function(_0x716918){logger[_0x1575('0xb')](_0x1575('0x3d'));return BPromise['resolve']({'id':_0x716918['id'],'name':_0x716918[_0x1575('0x2e')][_0x1575('0x39')][_0x1575('0x31')],'phone':_0x716918[_0x1575('0x2e')][_0x1575('0x36')][_0x1575('0x31')]});});}});}function request(_0x20bbec){logger[_0x1575('0x3e')](_0x1575('0x3f'),JSON[_0x1575('0x20')](_0x20bbec));return rp(_[_0x1575('0x40')](def,_0x20bbec));}function getTags(_0x158d1f,_0x270644){var _0x3e4823=[];if(_0x158d1f&&_0x158d1f[_0x1575('0x1b')]>0x0){_0x3e4823=_[_0x1575('0x41')](_0x158d1f,_0x270644);}return _0x3e4823;}function getCustomFields(_0x1e698f,_0x3c9f69){var _0x351f7f=[];var _0x3c9d25={'custom_fields':[]};if(_0x1e698f['length']>0x0){_[_0x1575('0x42')](_0x1e698f,function(_0x449c85){if(_0x449c85['type']==='string'&&_0x449c85[_0x1575('0x43')]&&!_0x449c85['customField']){_0x3c9d25[_0x449c85['nameField'][_0x1575('0x44')]()]=_0x449c85[_0x1575('0x45')][_0x1575('0x25')]();}else if(_0x449c85['type']===_0x1575('0x46')&&_0x449c85[_0x1575('0x1e')]&&_0x449c85['customField']){_0x3c9d25[_0x1575('0x47')]['push']({'id':_0x449c85[_0x1575('0x1e')],'value':_0x449c85[_0x1575('0x45')][_0x1575('0x25')]()});}else if(_0x449c85[_0x1575('0x48')]===_0x1575('0x49')&&_0x449c85[_0x1575('0x1c')]&&_0x449c85['idField']&&_0x449c85[_0x1575('0x4a')]){_0x3c9f69[_0x449c85[_0x1575('0x1c')]]&&_0x3c9d25[_0x1575('0x47')]['push']({'id':_0x449c85[_0x1575('0x1e')],'value':_0x3c9f69[_0x449c85[_0x1575('0x1c')]][_0x1575('0x25')]()});}else if(_0x449c85['type']==='customVariable'&&_0x449c85[_0x1575('0x4b')]&&_0x449c85[_0x1575('0x4b')]['name']&&_0x449c85['idField']&&_0x449c85['customField']){_0x3c9f69[_0x449c85[_0x1575('0x4b')]['name'][_0x1575('0x44')]()]&&_0x3c9d25['custom_fields'][_0x1575('0x1d')]({'id':_0x449c85[_0x1575('0x1e')],'value':_0x3c9f69[_0x449c85[_0x1575('0x4b')][_0x1575('0xd')][_0x1575('0x44')]()][_0x1575('0x25')]()});}});}return _0x3c9d25;}function getConnection(_0x1bf387){return request({'method':_0x1575('0x4c'),'form':{'method':_0x1575('0x4d'),'input_type':_0x1575('0x27'),'response_type':_0x1575('0x27'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x1bf387[_0x1575('0x4e')],'password':_0x1bf387[_0x1575('0x4f')],'encryption':'PLAIN'},'application':_0x1575('0x50')})}})[_0x1575('0x3c')](function(_0x5bdd6e){var _0x1a8d6f=_0x5bdd6e;if(_0x1a8d6f['id']){def[_0x1575('0x51')]=_0x1a8d6f['id'];return BPromise['resolve'](_0x1a8d6f);}else{throw new Error(util[_0x1575('0x22')](_0x1575('0x52'),_0x1bf387['id']));}});}function setRelationship(_0x418e3e,_0x24aaa3,_0xc59405,_0x1a6507){return request({'form':{'method':_0x1575('0x53'),'input_type':_0x1575('0x27'),'response_type':_0x1575('0x27'),'rest_data':JSON[_0x1575('0x20')]({'session':_0x418e3e['id'],'module_name':_0x1575('0x21'),'module_id':_0xc59405['id'],'link_field_name':_0x1a6507,'related_ids':[_0x24aaa3['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x1575('0x54')]=function(_0x2ce055,_0x585188,_0x42e081,_0x400ccc,_0x1e55e6,_0x4f7e1c){var _0x4b9caa,_0x7b331a,_0x18999d,_0x4bfb1d;_0x4f7e1c['remoteUri']=intUtil[_0x1575('0x55')](_0x4f7e1c[_0x1575('0x56')]);_0x4f7e1c[_0x1575('0x57')]=intUtil[_0x1575('0x55')](_0x4f7e1c[_0x1575('0x57')]);def[_0x1575('0x58')]=util['format'](_0x1575('0x59'),_0x4f7e1c[_0x1575('0x56')]);if(_0x1e55e6&&_0x1e55e6[_0x1575('0x5a')]){logger['info'](_0x1575('0x5b'),_0x1575('0x5c'));_0x585188[_0x1575('0x5d')]=util['format'](_0x1575('0x5e'),_0x4f7e1c[_0x1575('0x57')],_0x585188[_0x1575('0x5f')],md5(_0x585188[_0x1575('0x5f')]));}else{_0x585188[_0x1575('0x5d')]='';}return getConnection(_0x4f7e1c)['then'](function(_0x4f5d64){_0x4bfb1d=_0x4f5d64;return getUser(_0x4f7e1c,_0x400ccc[_0x1575('0xd')],_0x4bfb1d);})[_0x1575('0x3c')](function(_0x194b30){_0x4b9caa=_0x194b30;logger[_0x1575('0xb')](_0x1575('0x60'),_0x4b9caa['id']);return getEndUser(_0x4f7e1c,_0x585188[_0x1575('0x61')],_0x585188['calleridnum'],_0x4bfb1d);})[_0x1575('0x3c')](function(_0x166273){_0x7b331a=_0x166273;logger[_0x1575('0xb')](_0x1575('0x62'),_0x7b331a['id']);return getTicket(_0x4f7e1c,_0x4b9caa,_0x7b331a,_0x42e081,_0x585188,_0x42e081[_0x1575('0x63')],_0x4bfb1d,_0x1575('0x64'));})['then'](function(_0x31ae32){_0x18999d=_0x31ae32;logger[_0x1575('0xb')](_0x1575('0x65'));logger[_0x1575('0xb')]('The\x20Ticket\x20ID\x20is:',_0x18999d['id']);return setRelationship(_0x4bfb1d,_0x4b9caa,_0x18999d,_0x1575('0x66'));})[_0x1575('0x3c')](function(){return setRelationship(_0x4bfb1d,_0x7b331a,_0x18999d,_0x1575('0x67'));})[_0x1575('0x3c')](function(){return getServerInfo(_0x4bfb1d);})['then'](function(_0x37e265){var _0x3fed8b=parseInt(_0x37e265[_0x1575('0x68')][_0x1575('0x69')](0x0));var _0x3d4543=util['format'](_0x1575('0x6a'),_0x4f7e1c[_0x1575('0x56')],_0x18999d['id']);if(_0x3fed8b>0x6){_0x3d4543=util[_0x1575('0x22')](_0x1575('0x6b'),_0x4f7e1c[_0x1575('0x56')],_0x18999d['id']);}logger['info'](_0x1575('0x5b'),_0x1575('0x6c'));emit(util[_0x1575('0x22')]('user:%s',_0x400ccc[_0x1575('0xd')]),'trigger:browser:url',{'uri':_0x3d4543});})[_0x1575('0x6d')](function(_0x280278){logger[_0x1575('0x6e')](_0x1575('0x5b'),JSON['stringify'](_0x280278));});};exports[_0x1575('0x6f')]=function(_0x330a2a,_0x55adae,_0x3d04a0,_0x49ce76,_0x4bbf56,_0x3f2627,_0xe785a3){var _0x15a4d4,_0x3178db,_0x9676d4,_0x22298e;_0x3f2627['remoteUri']=intUtil[_0x1575('0x55')](_0x3f2627[_0x1575('0x56')]);_0x3f2627['serverUrl']=intUtil[_0x1575('0x55')](_0x3f2627[_0x1575('0x57')]);def['uri']=util['format'](_0x1575('0x59'),_0x3f2627[_0x1575('0x56')]);if(_0xe785a3&&_0xe785a3[_0x1575('0x70')]&&_0xe785a3[_0x1575('0x70')]!==_0x1575('0x71')){logger[_0x1575('0xb')](_0x1575('0x72'),'Recording\x20is\x20enabled!');_0x55adae[_0x1575('0x5d')]=util['format'](_0x1575('0x5e'),_0x3f2627[_0x1575('0x57')],_0x55adae[_0x1575('0x5f')],md5(_0x55adae[_0x1575('0x5f')]));}return getConnection(_0x3f2627)[_0x1575('0x3c')](function(_0xaabb7c){_0x22298e=_0xaabb7c;return getUser(_0x3f2627,_0x49ce76['name'],_0x22298e);})['then'](function(_0x446795){_0x15a4d4=_0x446795;logger['info']('The\x20User\x20ID\x20is:',_0x15a4d4['id']);return getEndUser(_0x3f2627,_0x55adae[_0x1575('0x73')],_0x55adae[_0x1575('0x74')],_0x22298e);})[_0x1575('0x3c')](function(_0x398f76){_0x3178db=_0x398f76;logger[_0x1575('0xb')](_0x1575('0x62'),_0x3178db['id']);return getTicket(_0x3f2627,_0x15a4d4,_0x3178db,_0x3d04a0,_0x55adae,_0x3d04a0[_0x1575('0x63')],_0x22298e,_0x1575('0x75'));})['then'](function(_0x492fec){_0x9676d4=_0x492fec;logger['info'](_0x1575('0x65'));logger['info'](_0x1575('0x76'),_0x9676d4['id']);return setRelationship(_0x22298e,_0x15a4d4,_0x9676d4,_0x1575('0x66'));})['then'](function(){return setRelationship(_0x22298e,_0x3178db,_0x9676d4,_0x1575('0x67'));})['then'](function(){return getServerInfo(_0x22298e);})[_0x1575('0x3c')](function(_0x295d5d){var _0x359c0f=parseInt(_0x295d5d['version']['charAt'](0x0));var _0x2b59ff=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x3f2627['remoteUri'],_0x9676d4['id']);if(_0x359c0f>0x6){_0x2b59ff=util['format']('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x3f2627[_0x1575('0x56')],_0x9676d4['id']);}logger[_0x1575('0xb')](_0x1575('0x72'),_0x1575('0x6c'));emit(util['format'](_0x1575('0x77'),_0x49ce76[_0x1575('0xd')]),_0x1575('0x78'),{'uri':_0x2b59ff});})[_0x1575('0x6d')](function(_0x375b45){logger[_0x1575('0x6e')]('[OUTBOUND]',JSON['stringify'](_0x375b45));});};exports[_0x1575('0x79')]=function(_0x54a4e6,_0x51a82d,_0x66e86a,_0x405536,_0x36cf56,_0xcfe6ed){var _0x521fea,_0x55ee1f,_0x12cf9e,_0x7c1261;_0xcfe6ed['remoteUri']=intUtil[_0x1575('0x55')](_0xcfe6ed['remoteUri']);_0xcfe6ed[_0x1575('0x57')]=intUtil[_0x1575('0x55')](_0xcfe6ed[_0x1575('0x57')]);def['uri']=util['format']('%s/service/v4_1/rest.php',_0xcfe6ed['remoteUri']);if(_0x36cf56&&_0x36cf56[_0x1575('0x5a')]){logger[_0x1575('0xb')]('['+_0x51a82d[_0x1575('0x7a')][_0x1575('0x7b')]()+']',_0x1575('0x5c'));_0x51a82d[_0x1575('0x5d')]=util[_0x1575('0x22')](_0x1575('0x5e'),_0xcfe6ed[_0x1575('0x57')],_0x51a82d[_0x1575('0x5f')],md5(_0x51a82d[_0x1575('0x5f')]));}else{_0x51a82d[_0x1575('0x5d')]='';}return getConnection(_0xcfe6ed)[_0x1575('0x3c')](function(_0x53110c){_0x7c1261=_0x53110c;if(!_['isNil'](_0x405536)){return getUser(_0xcfe6ed,_0x405536[_0x1575('0xd')],_0x7c1261);}else{return getUser(_0xcfe6ed,null,_0x7c1261);}})[_0x1575('0x3c')](function(_0x5c6a2a){_0x521fea=_0x5c6a2a;logger['info']('The\x20User\x20ID\x20is:',_0x521fea['id']);return getEndUser(_0xcfe6ed,_0x51a82d[_0x1575('0x61')],_0x51a82d['calleridnum'],_0x7c1261);})[_0x1575('0x3c')](function(_0xb74bd5){_0x55ee1f=_0xb74bd5;logger[_0x1575('0xb')](_0x1575('0x62'),_0x55ee1f['id']);return getTicket(_0xcfe6ed,_0x521fea,_0x55ee1f,_0x66e86a,_0x51a82d,_0x66e86a['Fields'],_0x7c1261,_0x1575('0x64'));})[_0x1575('0x3c')](function(_0x2d54ad){_0x12cf9e=_0x2d54ad;logger['info'](_0x1575('0x65'));logger[_0x1575('0xb')](_0x1575('0x76'),_0x12cf9e['id']);return setRelationship(_0x7c1261,_0x521fea,_0x12cf9e,_0x1575('0x66'));})[_0x1575('0x3c')](function(){return setRelationship(_0x7c1261,_0x55ee1f,_0x12cf9e,_0x1575('0x67'));})[_0x1575('0x3c')](function(){return getServerInfo(_0x7c1261);})[_0x1575('0x6d')](function(_0x558a67){logger[_0x1575('0x6e')]('['+_0x51a82d[_0x1575('0x7a')][_0x1575('0x7b')]()+']',JSON[_0x1575('0x20')](_0x558a67));});};
\ No newline at end of file
index b55dd39..a978fd3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcab0=['customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','variable','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length','sortBy','type','string','variableName','push','toString'];(function(_0x5bd03c,_0x1558dc){var _0x37d752=function(_0x1c6a94){while(--_0x1c6a94){_0x5bd03c['push'](_0x5bd03c['shift']());}};_0x37d752(++_0x1558dc);}(_0xcab0,0x87));var _0x0cab=function(_0x593e44,_0x589362){_0x593e44=_0x593e44-0x0;var _0x884f76=_0xcab0[_0x593e44];return _0x884f76;};'use strict';var _=require(_0x0cab('0x0'));var util=require(_0x0cab('0x1'));exports[_0x0cab('0x2')]=function(_0x13b1ba,_0x2ad35e,_0x201196){var _0x2ce2ce=[];if(_0x13b1ba[_0x0cab('0x3')]>0x0){var _0x2762a3=_[_0x0cab('0x4')](_0x13b1ba,['id']);for(var _0x2c77c9=0x0;_0x2c77c9<_0x2762a3[_0x0cab('0x3')];_0x2c77c9++){var _0x1558ce=_0x2762a3[_0x2c77c9];if(_0x1558ce[_0x0cab('0x5')]===_0x0cab('0x6')){_0x2ce2ce['push'](_0x1558ce['content']);}else if(_0x1558ce[_0x0cab('0x5')]==='variable'&&_0x1558ce[_0x0cab('0x7')]){_0x2ad35e[_0x1558ce[_0x0cab('0x7')]]&&_0x2ce2ce[_0x0cab('0x8')](_0x2ad35e[_0x1558ce[_0x0cab('0x7')]][_0x0cab('0x9')]());}else if(_0x1558ce[_0x0cab('0x5')]===_0x0cab('0xa')&&_0x1558ce[_0x0cab('0xb')]&&_0x1558ce[_0x0cab('0xb')]['name']){_0x2ad35e[_0x1558ce['Variable'][_0x0cab('0xc')][_0x0cab('0xd')]()]&&_0x2ce2ce[_0x0cab('0x8')](_0x2ad35e[_0x1558ce[_0x0cab('0xb')][_0x0cab('0xc')]['toLowerCase']()][_0x0cab('0x9')]());}else if(_0x1558ce[_0x0cab('0x5')]===_0x0cab('0xe')){if(_0x1558ce[_0x0cab('0xf')]===_0x0cab('0x6')&&_0x1558ce[_0x0cab('0x10')]){_0x2ce2ce[_0x0cab('0x8')](util[_0x0cab('0x11')](_0x0cab('0x12'),_0x1558ce[_0x0cab('0x10')],_0x1558ce[_0x0cab('0x13')]));}else if(_0x1558ce[_0x0cab('0xf')]===_0x0cab('0x14')&&_0x1558ce[_0x0cab('0x7')]&&_0x1558ce[_0x0cab('0x10')]){_0x2ad35e[_0x1558ce['variableName']]&&_0x2ce2ce[_0x0cab('0x8')](util['format'](_0x0cab('0x12'),_0x1558ce[_0x0cab('0x10')],_0x2ad35e[_0x1558ce[_0x0cab('0x7')]]));}else if(_0x1558ce[_0x0cab('0xf')]===_0x0cab('0xa')&&_0x1558ce['Variable']&&_0x1558ce['Variable'][_0x0cab('0xc')]&&_0x1558ce[_0x0cab('0x10')]){_0x2ad35e[_0x1558ce[_0x0cab('0xb')]['name'][_0x0cab('0xd')]()]&&_0x2ce2ce['push'](util[_0x0cab('0x11')]('%s:\x20%s',_0x1558ce['key'],_0x2ad35e[_0x1558ce[_0x0cab('0xb')]['name']['toLowerCase']()]));}}}}return _0x2ce2ce[_0x0cab('0x15')](_0x201196);};exports[_0x0cab('0x16')]=function(_0x25cb54){var _0x91ebe2=_0x25cb54[_0x0cab('0x17')](-0x1);if(_0x91ebe2==='/'){_0x25cb54=_0x25cb54[_0x0cab('0x18')](0x0,_0x25cb54[_0x0cab('0x19')](_0x91ebe2));}return _0x25cb54;};exports[_0x0cab('0x1a')]=function(_0x50f3cc){if(!_[_0x0cab('0x1b')](_0x50f3cc)&&_0x50f3cc!==''){var _0x36a592=/^(([^<>()\[\]\\.,;:\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 _0x36a592[_0x0cab('0x1c')](String(_0x50f3cc)[_0x0cab('0xd')]());}else{return![];}};
\ No newline at end of file
+var _0x0be7=['sortBy','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','format','%s:\x20%s','key','keyContent','keyType','join','stripTrailingSlash','slice','substring','validateEmail','test','lodash','util','getString'];(function(_0x46becf,_0x14443c){var _0x315605=function(_0x523cf8){while(--_0x523cf8){_0x46becf['push'](_0x46becf['shift']());}};_0x315605(++_0x14443c);}(_0x0be7,0x14f));var _0x70be=function(_0x1ccd70,_0x5d606c){_0x1ccd70=_0x1ccd70-0x0;var _0x5ad0af=_0x0be7[_0x1ccd70];return _0x5ad0af;};'use strict';var _=require(_0x70be('0x0'));var util=require(_0x70be('0x1'));exports[_0x70be('0x2')]=function(_0x354344,_0x55e522,_0x5dd66c){var _0x123288=[];if(_0x354344['length']>0x0){var _0x1515b8=_[_0x70be('0x3')](_0x354344,['id']);for(var _0x3ffbb2=0x0;_0x3ffbb2<_0x1515b8['length'];_0x3ffbb2++){var _0x759251=_0x1515b8[_0x3ffbb2];if(_0x759251[_0x70be('0x4')]===_0x70be('0x5')){_0x123288[_0x70be('0x6')](_0x759251[_0x70be('0x7')]);}else if(_0x759251['type']===_0x70be('0x8')&&_0x759251['variableName']){_0x55e522[_0x759251[_0x70be('0x9')]]&&_0x123288[_0x70be('0x6')](_0x55e522[_0x759251[_0x70be('0x9')]][_0x70be('0xa')]());}else if(_0x759251['type']===_0x70be('0xb')&&_0x759251[_0x70be('0xc')]&&_0x759251['Variable'][_0x70be('0xd')]){_0x55e522[_0x759251[_0x70be('0xc')][_0x70be('0xd')]['toLowerCase']()]&&_0x123288[_0x70be('0x6')](_0x55e522[_0x759251[_0x70be('0xc')]['name'][_0x70be('0xe')]()][_0x70be('0xa')]());}else if(_0x759251[_0x70be('0x4')]==='keyValue'){if(_0x759251['keyType']==='string'&&_0x759251['key']){_0x123288[_0x70be('0x6')](util[_0x70be('0xf')](_0x70be('0x10'),_0x759251[_0x70be('0x11')],_0x759251[_0x70be('0x12')]));}else if(_0x759251[_0x70be('0x13')]==='variable'&&_0x759251[_0x70be('0x9')]&&_0x759251[_0x70be('0x11')]){_0x55e522[_0x759251['variableName']]&&_0x123288[_0x70be('0x6')](util[_0x70be('0xf')](_0x70be('0x10'),_0x759251['key'],_0x55e522[_0x759251[_0x70be('0x9')]]));}else if(_0x759251[_0x70be('0x13')]===_0x70be('0xb')&&_0x759251[_0x70be('0xc')]&&_0x759251[_0x70be('0xc')][_0x70be('0xd')]&&_0x759251[_0x70be('0x11')]){_0x55e522[_0x759251[_0x70be('0xc')][_0x70be('0xd')][_0x70be('0xe')]()]&&_0x123288[_0x70be('0x6')](util[_0x70be('0xf')](_0x70be('0x10'),_0x759251['key'],_0x55e522[_0x759251[_0x70be('0xc')][_0x70be('0xd')][_0x70be('0xe')]()]));}}}}return _0x123288[_0x70be('0x14')](_0x5dd66c);};exports[_0x70be('0x15')]=function(_0x324471){var _0xe20e5e=_0x324471[_0x70be('0x16')](-0x1);if(_0xe20e5e==='/'){_0x324471=_0x324471[_0x70be('0x17')](0x0,_0x324471['lastIndexOf'](_0xe20e5e));}return _0x324471;};exports[_0x70be('0x18')]=function(_0x32c06c){if(!_['isNil'](_0x32c06c)&&_0x32c06c!==''){var _0x254024=/^(([^<>()\[\]\\.,;:\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 _0x254024[_0x70be('0x19')](String(_0x32c06c)[_0x70be('0xe')]());}else{return![];}};
\ No newline at end of file
index a512f22..9bdb919 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x4aebaa,_0x1e17d3){var _0x38cd3d=function(_0x25dbcb){while(--_0x25dbcb){_0x4aebaa['push'](_0x4aebaa['shift']());}};_0x38cd3d(++_0x1e17d3);}(_0x9c44,0x178));var _0x49c4=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x9c44[_0x1969a7];return _0x3d665f;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});};
\ No newline at end of file
+var _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(_0x78c59,_0x46c42b){var _0x376423=function(_0x58a54d){while(--_0x58a54d){_0x78c59['push'](_0x78c59['shift']());}};_0x376423(++_0x46c42b);}(_0xe706,0xa3));var _0x6e70=function(_0x2c3483,_0x22f134){_0x2c3483=_0x2c3483-0x0;var _0x4e945f=_0xe706[_0x2c3483];return _0x4e945f;};'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
index cbe202e..8812006 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f90=['destcalleridnum','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','Zendesk\x20account\x20type\x20not\x20recognized','error','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','emit','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','Tags','name','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','info','Getting\x20agent\x20with\x20email','%s/search.json','count','Agent\x20found!','results','agent','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','filter','end-user','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','base64','debug','[HTTP]','length','map','forEach','string','picklist','nameField','customField','toLowerCase','toString','type','custom_fields','push','content','variable','idField','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','newTab','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname'];(function(_0x1c43b6,_0x17d244){var _0x2d7fa8=function(_0xa7013e){while(--_0xa7013e){_0x1c43b6['push'](_0x1c43b6['shift']());}};_0x2d7fa8(++_0x17d244);}(_0x9f90,0xe9));var _0x09f9=function(_0x50c1a4,_0x4f7d7b){_0x50c1a4=_0x50c1a4-0x0;var _0x52e89a=_0x9f90[_0x50c1a4];return _0x52e89a;};'use strict';var _=require(_0x09f9('0x0'));var rp=require(_0x09f9('0x1'));var md5=require(_0x09f9('0x2'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x09f9('0x3'));var config=require(_0x09f9('0x4'));var logger=require(_0x09f9('0x5'))(_0x09f9('0x6'));config[_0x09f9('0x7')]=_[_0x09f9('0x8')](config[_0x09f9('0x7')],{'host':_0x09f9('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x36e2ae,_0xdd70c2,_0x45bfac){io['to'](_0x36e2ae)[_0x09f9('0xa')](_0xdd70c2,_0x45bfac);}var headers={'Content-Type':_0x09f9('0xb'),'Accept':'application/json'};function getTicket(_0x140e73,_0x21ab59,_0x542810,_0x8df316,_0x50a415){logger['info'](_0x09f9('0xc'));return request({'uri':util[_0x09f9('0xd')](_0x09f9('0xe'),_0x140e73[_0x09f9('0xf')]),'method':_0x09f9('0x10'),'body':{'ticket':_['merge']({'requester_id':_0x542810['id'],'submitter_id':_0x21ab59?_0x21ab59['id']:undefined,'assignee_id':_0x21ab59?_0x21ab59['id']:undefined,'tags':getTags(_0x8df316[_0x09f9('0x11')],_0x09f9('0x12')),'subject':intUtil['getString'](_0x8df316[_0x09f9('0x13')],_0x50a415,'\x20'),'description':intUtil['getString'](_0x8df316['Descriptions'],_0x50a415,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x8df316[_0x09f9('0x14')],_0x50a415,'\x0a')}},getCustomFields(_0x8df316[_0x09f9('0x15')],_0x50a415))}})[_0x09f9('0x16')](function(_0x804796){logger['info'](_0x09f9('0x17'));return _0x804796[_0x09f9('0x18')];});}function getUser(_0x3a06d6,_0x6b32d3){if(intUtil[_0x09f9('0x19')](_0x6b32d3)){logger[_0x09f9('0x1a')](_0x09f9('0x1b'),_0x6b32d3);return request({'uri':util[_0x09f9('0xd')](_0x09f9('0x1c'),_0x3a06d6[_0x09f9('0xf')]),'qs':{'query':util[_0x09f9('0xd')]('type:user\x20role:agent\x20email:%s',_0x6b32d3)}})[_0x09f9('0x16')](function(_0x56ea4){if(_0x56ea4[_0x09f9('0x1d')]){logger[_0x09f9('0x1a')](_0x09f9('0x1e'));return _['find'](_0x56ea4[_0x09f9('0x1f')],{'email':_0x6b32d3,'role':_0x09f9('0x20')});}else{logger[_0x09f9('0x1a')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me.json',_0x3a06d6[_0x09f9('0xf')])})[_0x09f9('0x16')](function(_0x275f90){logger[_0x09f9('0x1a')]('Admin\x20account\x20selected.');return _0x275f90[_0x09f9('0x21')];});}});}else{logger['info'](_0x09f9('0x22'));return request({'uri':util['format'](_0x09f9('0x23'),_0x3a06d6[_0x09f9('0xf')])})[_0x09f9('0x16')](function(_0x1bbfb4){logger['info'](_0x09f9('0x24'));return _0x1bbfb4['user'];});}}function getEndUser(_0x375032,_0x4b0687,_0x2baff3){logger['info']('Searching\x20enduser\x20with\x20phone',_0x2baff3);return request({'uri':util['format'](_0x09f9('0x1c'),_0x375032['remoteUri']),'qs':{'query':util[_0x09f9('0xd')]('type:user\x20role:end-user\x20phone:%s',_0x2baff3)}})['then'](function(_0xe5cd36){var _0x4a4b84;if(_0xe5cd36[_0x09f9('0x1f')]['length']){_0xe5cd36[_0x09f9('0x1f')]=_[_0x09f9('0x25')](_0xe5cd36[_0x09f9('0x1f')],{'suspended':![],'role':_0x09f9('0x26')});if(_0xe5cd36[_0x09f9('0x1f')]['length']){_0x4a4b84=_['first'](_0xe5cd36['results']);}}if(_0x4a4b84){logger[_0x09f9('0x1a')]('Enduser\x20found!');return _0x4a4b84;}else{logger['info'](_0x09f9('0x27'));return request({'uri':util[_0x09f9('0xd')](_0x09f9('0x28'),_0x375032['remoteUri']),'method':_0x09f9('0x10'),'body':{'user':{'role':_0x09f9('0x26'),'name':util[_0x09f9('0xd')](_0x09f9('0x29'),_0x4b0687||_0x2baff3),'phone':_0x2baff3}}})['then'](function(_0x3457ed){logger['info'](_0x09f9('0x2a'));return _0x3457ed['user'];});}});}function getAuth(_0x513f02){var _0x46d5a1;if(_0x513f02[_0x09f9('0x2b')]===_0x09f9('0x2c')){_0x46d5a1=util['format'](_0x09f9('0x2d'),_0x513f02[_0x09f9('0x2e')],_0x513f02[_0x09f9('0x2c')]);}else if(_0x513f02['authType']===_0x09f9('0x2f')){_0x46d5a1=util[_0x09f9('0xd')](_0x09f9('0x30'),_0x513f02[_0x09f9('0x2e')],_0x513f02[_0x09f9('0x2f')]);}return util['format'](_0x09f9('0x31'),new Buffer(_0x46d5a1)['toString'](_0x09f9('0x32')));}function request(_0x1662b2){logger[_0x09f9('0x33')](_0x09f9('0x34'),JSON['stringify'](_0x1662b2));return rp(_[_0x09f9('0x8')](_0x1662b2,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x3a6e0c,_0x42ca7c){var _0x58bc07=[];if(_0x3a6e0c&&_0x3a6e0c[_0x09f9('0x35')]>0x0){_0x58bc07=_[_0x09f9('0x36')](_0x3a6e0c,_0x42ca7c);}return _0x58bc07;}function getCustomFields(_0x4cf4d3,_0x597256){var _0x326f97=[];var _0x70306c={'custom_fields':[]};if(_0x4cf4d3[_0x09f9('0x35')]>0x0){_[_0x09f9('0x37')](_0x4cf4d3,function(_0x2df67){if(_['includes']([_0x09f9('0x38'),_0x09f9('0x39')],_0x2df67['type'])&&_0x2df67[_0x09f9('0x3a')]&&!_0x2df67[_0x09f9('0x3b')]){_0x70306c[_0x2df67[_0x09f9('0x3a')][_0x09f9('0x3c')]()]=_0x2df67['content'][_0x09f9('0x3d')]();}else if(_['includes']([_0x09f9('0x38'),_0x09f9('0x39')],_0x2df67[_0x09f9('0x3e')])&&_0x2df67['idField']&&_0x2df67[_0x09f9('0x3b')]){_0x70306c[_0x09f9('0x3f')][_0x09f9('0x40')]({'id':_0x2df67['idField'],'value':_0x2df67[_0x09f9('0x41')]['toString']()});}else if(_0x2df67[_0x09f9('0x3e')]===_0x09f9('0x42')&&_0x2df67['variableName']&&_0x2df67[_0x09f9('0x43')]&&_0x2df67['customField']){_0x597256[_0x2df67[_0x09f9('0x44')]]&&_0x70306c['custom_fields'][_0x09f9('0x40')]({'id':_0x2df67['idField'],'value':_0x597256[_0x2df67[_0x09f9('0x44')]][_0x09f9('0x3d')]()});}else if(_0x2df67[_0x09f9('0x3e')]===_0x09f9('0x45')&&_0x2df67['Variable']&&_0x2df67[_0x09f9('0x46')][_0x09f9('0x12')]&&_0x2df67[_0x09f9('0x43')]&&_0x2df67[_0x09f9('0x3b')]){_0x597256[_0x2df67[_0x09f9('0x46')][_0x09f9('0x12')][_0x09f9('0x3c')]()]&&_0x70306c['custom_fields'][_0x09f9('0x40')]({'id':_0x2df67[_0x09f9('0x43')],'value':_0x597256[_0x2df67[_0x09f9('0x46')][_0x09f9('0x12')]['toLowerCase']()][_0x09f9('0x3d')]()});}});}return _0x70306c;}exports[_0x09f9('0x47')]=function(_0xfdc4e0,_0x3002eb,_0x17cb92,_0x3939ed,_0x53b8f7,_0x4d37b6){var _0x403ca3,_0x5dd876;_0x4d37b6[_0x09f9('0xf')]=intUtil[_0x09f9('0x48')](_0x4d37b6['remoteUri']);_0x4d37b6[_0x09f9('0x49')]=intUtil[_0x09f9('0x48')](_0x4d37b6[_0x09f9('0x49')]);if(_0x53b8f7&&_0x53b8f7[_0x09f9('0x4a')]){logger[_0x09f9('0x1a')](_0x09f9('0x4b'),_0x09f9('0x4c'));_0x3002eb[_0x09f9('0x4d')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4d37b6['serverUrl'],_0x3002eb['uniqueid'],md5(_0x3002eb[_0x09f9('0x4e')]));}else{_0x3002eb[_0x09f9('0x4d')]='';}headers[_0x09f9('0x4f')]=getAuth(_0x4d37b6);return getUser(_0x4d37b6,_0x3939ed[_0x09f9('0x50')])['then'](function(_0x31e7ba){_0x403ca3=_0x31e7ba;logger[_0x09f9('0x1a')](_0x09f9('0x51'),_0x403ca3['id']);return getEndUser(_0x4d37b6,_0x3002eb[_0x09f9('0x52')],_0x3002eb[_0x09f9('0x53')]);})[_0x09f9('0x16')](function(_0x120d12){_0x5dd876=_0x120d12;logger[_0x09f9('0x1a')](_0x09f9('0x54'),_0x5dd876['id']);return getTicket(_0x4d37b6,_0x403ca3,_0x5dd876,_0x17cb92,_0x3002eb);})[_0x09f9('0x16')](function(_0x2b0ac2){if(_0x2b0ac2){logger[_0x09f9('0x1a')](_0x09f9('0x55'),_0x2b0ac2['id']);switch(_0x4d37b6[_0x09f9('0x3e')]){case'integrationTab':logger[_0x09f9('0x1a')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x09f9('0xd')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x4d37b6[_0x09f9('0xf')],_0x403ca3['id'],_0x2b0ac2['id']),'method':'POST'});case _0x09f9('0x56'):logger[_0x09f9('0x1a')](_0x09f9('0x4b'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x09f9('0x57'),_0x3939ed[_0x09f9('0x12')]),_0x09f9('0x58'),{'uri':util[_0x09f9('0xd')](_0x09f9('0x59'),_0x4d37b6[_0x09f9('0xf')][_0x09f9('0x5a')](_0x09f9('0x5b'),''),_0x2b0ac2['id'])});break;default:logger['error'](_0x09f9('0x4b'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x09f9('0x5c')](function(_0x5d121a){logger['error'](_0x09f9('0x5d'),util[_0x09f9('0x5e')](_0x5d121a,{'showHidden':!![],'depth':null}));});};exports[_0x09f9('0x5f')]=function(_0x287e3b,_0x1829b3,_0x3a9f28,_0x3f6205,_0x4700f9,_0x188d40,_0x125bce){var _0x96d703,_0x27b7b2;_0x188d40['remoteUri']=intUtil[_0x09f9('0x48')](_0x188d40[_0x09f9('0xf')]);_0x188d40[_0x09f9('0x49')]=intUtil[_0x09f9('0x48')](_0x188d40[_0x09f9('0x49')]);if(_0x125bce&&_0x125bce['recordingFormat']&&_0x125bce['recordingFormat']!==_0x09f9('0x60')){logger[_0x09f9('0x1a')](_0x09f9('0x61'),_0x09f9('0x4c'));_0x1829b3[_0x09f9('0x4d')]=util[_0x09f9('0xd')](_0x09f9('0x62'),_0x188d40['serverUrl'],_0x1829b3[_0x09f9('0x4e')],md5(_0x1829b3[_0x09f9('0x4e')]));}headers[_0x09f9('0x4f')]=getAuth(_0x188d40);return getUser(_0x188d40,_0x3f6205[_0x09f9('0x50')])['then'](function(_0x40b7c2){_0x96d703=_0x40b7c2;logger[_0x09f9('0x1a')](_0x09f9('0x51'),_0x96d703['id']);return getEndUser(_0x188d40,_0x1829b3[_0x09f9('0x63')],_0x1829b3[_0x09f9('0x64')]);})['then'](function(_0x249dc2){_0x27b7b2=_0x249dc2;logger['info']('The\x20Enduser\x20ID\x20is:',_0x27b7b2['id']);return getTicket(_0x188d40,_0x96d703,_0x27b7b2,_0x3a9f28,_0x1829b3);})['then'](function(_0x29e485){if(_0x29e485){logger[_0x09f9('0x1a')](_0x09f9('0x55'),_0x29e485['id']);switch(_0x188d40['type']){case _0x09f9('0x65'):logger[_0x09f9('0x1a')]('[OUTBOUND]',_0x09f9('0x66'));return request({'uri':util[_0x09f9('0xd')](_0x09f9('0x67'),_0x188d40[_0x09f9('0xf')],_0x96d703['id'],_0x29e485['id']),'method':_0x09f9('0x10')});case _0x09f9('0x56'):logger['info'](_0x09f9('0x61'),_0x09f9('0x68'));emit(util[_0x09f9('0xd')](_0x09f9('0x57'),_0x3f6205[_0x09f9('0x12')]),_0x09f9('0x58'),{'uri':util[_0x09f9('0xd')](_0x09f9('0x59'),_0x188d40['remoteUri'][_0x09f9('0x5a')](_0x09f9('0x5b'),''),_0x29e485['id'])});break;default:logger['error']('[OUTBOUND]',_0x09f9('0x69'));}}})[_0x09f9('0x5c')](function(_0x12e8e9){logger[_0x09f9('0x6a')](_0x09f9('0x6b'),util[_0x09f9('0x5e')](_0x12e8e9,{'showHidden':!![],'depth':null}));});};exports[_0x09f9('0x6c')]=function(_0x396530,_0x4315bd,_0x55be15,_0x4a3d9d,_0xe27b0f,_0x24e2fe){var _0x36712a,_0x54bb9a;_0x24e2fe['remoteUri']=intUtil[_0x09f9('0x48')](_0x24e2fe[_0x09f9('0xf')]);_0x24e2fe[_0x09f9('0x49')]=intUtil[_0x09f9('0x48')](_0x24e2fe[_0x09f9('0x49')]);if(_0xe27b0f&&_0xe27b0f['monitor_format']){logger[_0x09f9('0x1a')]('['+_0x4315bd[_0x09f9('0x6d')][_0x09f9('0x6e')]()+']',_0x09f9('0x4c'));_0x4315bd[_0x09f9('0x4d')]=util[_0x09f9('0xd')](_0x09f9('0x62'),_0x24e2fe[_0x09f9('0x49')],_0x4315bd['uniqueid'],md5(_0x4315bd[_0x09f9('0x4e')]));}else{_0x4315bd[_0x09f9('0x4d')]='';}headers[_0x09f9('0x4f')]=getAuth(_0x24e2fe);return getUser(_0x24e2fe)['then'](function(_0x32e754){_0x36712a=_0x32e754;logger['info'](_0x09f9('0x51'),_0x36712a['id']);return getEndUser(_0x24e2fe,_0x4315bd[_0x09f9('0x52')],_0x4315bd[_0x09f9('0x53')]);})[_0x09f9('0x16')](function(_0x5d9590){_0x54bb9a=_0x5d9590;logger[_0x09f9('0x1a')](_0x09f9('0x54'),_0x54bb9a['id']);return getTicket(_0x24e2fe,_0x36712a,_0x54bb9a,_0x55be15,_0x4315bd);})[_0x09f9('0x16')](function(_0xb9828d){if(_0xb9828d){logger[_0x09f9('0x1a')](_0x09f9('0x55'),_0xb9828d['id']);}})['catch'](function(_0x28b8e2){logger[_0x09f9('0x6a')]('['+_0x4315bd[_0x09f9('0x6d')][_0x09f9('0x6e')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x09f9('0x5e')](_0x28b8e2,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x6554=['email','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','%s/agent/tickets/%s','/api/v2','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','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','then','type:user\x20role:end-user\x20phone:%s','filter','length','Enduser\x20found!','%s/users.json','end-user','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','[HTTP]','GET','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','custom_fields','variable','variableName','push','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','uniqueid','Authorization'];(function(_0x3915d9,_0x307b68){var _0x1f35d4=function(_0xf53b84){while(--_0xf53b84){_0x3915d9['push'](_0x3915d9['shift']());}};_0x1f35d4(++_0x307b68);}(_0x6554,0x171));var _0x4655=function(_0x1054c4,_0xda6074){_0x1054c4=_0x1054c4-0x0;var _0x4b6372=_0x6554[_0x1054c4];return _0x4b6372;};'use strict';var _=require('lodash');var rp=require(_0x4655('0x0'));var md5=require(_0x4655('0x1'));var util=require(_0x4655('0x2'));var Redis=require(_0x4655('0x3'));var intUtil=require(_0x4655('0x4'));var config=require(_0x4655('0x5'));var logger=require(_0x4655('0x6'))('zendesk');config[_0x4655('0x7')]=_[_0x4655('0x8')](config[_0x4655('0x7')],{'host':_0x4655('0x9'),'port':0x18eb});var io=require(_0x4655('0xa'))(new Redis(config[_0x4655('0x7')]));function emit(_0x29e80d,_0x267ba3,_0x496b86){io['to'](_0x29e80d)[_0x4655('0xb')](_0x267ba3,_0x496b86);}var headers={'Content-Type':_0x4655('0xc'),'Accept':'application/json'};function getTicket(_0xb870a2,_0x55b072,_0x45de5d,_0x584ed4,_0x47142e){logger[_0x4655('0xd')](_0x4655('0xe'));return request({'uri':util[_0x4655('0xf')](_0x4655('0x10'),_0xb870a2['remoteUri']),'method':_0x4655('0x11'),'body':{'ticket':_[_0x4655('0x12')]({'requester_id':_0x45de5d['id'],'submitter_id':_0x55b072?_0x55b072['id']:undefined,'assignee_id':_0x55b072?_0x55b072['id']:undefined,'tags':getTags(_0x584ed4[_0x4655('0x13')],_0x4655('0x14')),'subject':intUtil[_0x4655('0x15')](_0x584ed4[_0x4655('0x16')],_0x47142e,'\x20'),'description':intUtil[_0x4655('0x15')](_0x584ed4[_0x4655('0x17')],_0x47142e,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x584ed4['Descriptions'],_0x47142e,'\x0a')}},getCustomFields(_0x584ed4[_0x4655('0x18')],_0x47142e))}})['then'](function(_0x5e05e0){logger[_0x4655('0xd')](_0x4655('0x19'));return _0x5e05e0['ticket'];});}function getUser(_0x2d00dc,_0x20117c){if(intUtil[_0x4655('0x1a')](_0x20117c)){logger[_0x4655('0xd')](_0x4655('0x1b'),_0x20117c);return request({'uri':util['format'](_0x4655('0x1c'),_0x2d00dc[_0x4655('0x1d')]),'qs':{'query':util[_0x4655('0xf')](_0x4655('0x1e'),_0x20117c)}})['then'](function(_0x13e579){if(_0x13e579[_0x4655('0x1f')]){logger['info'](_0x4655('0x20'));return _[_0x4655('0x21')](_0x13e579[_0x4655('0x22')],{'email':_0x20117c,'role':_0x4655('0x23')});}else{logger[_0x4655('0xd')](_0x4655('0x24'));return request({'uri':util['format'](_0x4655('0x25'),_0x2d00dc[_0x4655('0x1d')])})['then'](function(_0x1a3ddb){logger[_0x4655('0xd')](_0x4655('0x26'));return _0x1a3ddb[_0x4655('0x27')];});}});}else{logger[_0x4655('0xd')](_0x4655('0x24'));return request({'uri':util[_0x4655('0xf')](_0x4655('0x25'),_0x2d00dc[_0x4655('0x1d')])})[_0x4655('0x28')](function(_0x23054f){logger[_0x4655('0xd')](_0x4655('0x26'));return _0x23054f[_0x4655('0x27')];});}}function getEndUser(_0x5237a5,_0x3c5b44,_0x5dabae){logger[_0x4655('0xd')]('Searching\x20enduser\x20with\x20phone',_0x5dabae);return request({'uri':util[_0x4655('0xf')]('%s/search.json',_0x5237a5['remoteUri']),'qs':{'query':util[_0x4655('0xf')](_0x4655('0x29'),_0x5dabae)}})[_0x4655('0x28')](function(_0x453cc0){var _0x503ee7;if(_0x453cc0['results']['length']){_0x453cc0['results']=_[_0x4655('0x2a')](_0x453cc0[_0x4655('0x22')],{'suspended':![],'role':'end-user'});if(_0x453cc0[_0x4655('0x22')][_0x4655('0x2b')]){_0x503ee7=_['first'](_0x453cc0[_0x4655('0x22')]);}}if(_0x503ee7){logger[_0x4655('0xd')](_0x4655('0x2c'));return _0x503ee7;}else{logger[_0x4655('0xd')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x4655('0xf')](_0x4655('0x2d'),_0x5237a5[_0x4655('0x1d')]),'method':_0x4655('0x11'),'body':{'user':{'role':_0x4655('0x2e'),'name':util[_0x4655('0xf')](_0x4655('0x2f'),_0x3c5b44||_0x5dabae),'phone':_0x5dabae}}})[_0x4655('0x28')](function(_0x5b8cc3){logger[_0x4655('0xd')](_0x4655('0x30'));return _0x5b8cc3[_0x4655('0x27')];});}});}function getAuth(_0x2bf739){var _0x15b130;if(_0x2bf739[_0x4655('0x31')]===_0x4655('0x32')){_0x15b130=util['format'](_0x4655('0x33'),_0x2bf739[_0x4655('0x34')],_0x2bf739[_0x4655('0x32')]);}else if(_0x2bf739[_0x4655('0x31')]===_0x4655('0x35')){_0x15b130=util[_0x4655('0xf')](_0x4655('0x36'),_0x2bf739[_0x4655('0x34')],_0x2bf739['token']);}return util[_0x4655('0xf')](_0x4655('0x37'),new Buffer(_0x15b130)['toString']('base64'));}function request(_0x28ce40){logger['debug'](_0x4655('0x38'),JSON['stringify'](_0x28ce40));return rp(_[_0x4655('0x8')](_0x28ce40,{'method':_0x4655('0x39'),'headers':headers,'json':!![]}));}function getTags(_0x5008b8,_0x264c67){var _0x33f097=[];if(_0x5008b8&&_0x5008b8['length']>0x0){_0x33f097=_['map'](_0x5008b8,_0x264c67);}return _0x33f097;}function getCustomFields(_0x57ffd9,_0x24bd0b){var _0x36192d=[];var _0x40c7e7={'custom_fields':[]};if(_0x57ffd9['length']>0x0){_[_0x4655('0x3a')](_0x57ffd9,function(_0x266779){if(_[_0x4655('0x3b')]([_0x4655('0x3c'),_0x4655('0x3d')],_0x266779[_0x4655('0x3e')])&&_0x266779[_0x4655('0x3f')]&&!_0x266779[_0x4655('0x40')]){_0x40c7e7[_0x266779[_0x4655('0x3f')][_0x4655('0x41')]()]=_0x266779[_0x4655('0x42')][_0x4655('0x43')]();}else if(_['includes'](['string',_0x4655('0x3d')],_0x266779[_0x4655('0x3e')])&&_0x266779[_0x4655('0x44')]&&_0x266779[_0x4655('0x40')]){_0x40c7e7[_0x4655('0x45')]['push']({'id':_0x266779[_0x4655('0x44')],'value':_0x266779[_0x4655('0x42')]['toString']()});}else if(_0x266779[_0x4655('0x3e')]===_0x4655('0x46')&&_0x266779[_0x4655('0x47')]&&_0x266779[_0x4655('0x44')]&&_0x266779[_0x4655('0x40')]){_0x24bd0b[_0x266779[_0x4655('0x47')]]&&_0x40c7e7[_0x4655('0x45')][_0x4655('0x48')]({'id':_0x266779[_0x4655('0x44')],'value':_0x24bd0b[_0x266779['variableName']][_0x4655('0x43')]()});}else if(_0x266779['type']===_0x4655('0x49')&&_0x266779['Variable']&&_0x266779[_0x4655('0x4a')][_0x4655('0x14')]&&_0x266779['idField']&&_0x266779[_0x4655('0x40')]){_0x24bd0b[_0x266779[_0x4655('0x4a')][_0x4655('0x14')]['toLowerCase']()]&&_0x40c7e7['custom_fields']['push']({'id':_0x266779['idField'],'value':_0x24bd0b[_0x266779[_0x4655('0x4a')][_0x4655('0x14')][_0x4655('0x41')]()][_0x4655('0x43')]()});}});}return _0x40c7e7;}exports[_0x4655('0x4b')]=function(_0x46b692,_0x460680,_0x20353e,_0x5dc217,_0x4fd666,_0xa58431){var _0x45f718,_0x4d2ade;_0xa58431[_0x4655('0x1d')]=intUtil[_0x4655('0x4c')](_0xa58431[_0x4655('0x1d')]);_0xa58431[_0x4655('0x4d')]=intUtil[_0x4655('0x4c')](_0xa58431[_0x4655('0x4d')]);if(_0x4fd666&&_0x4fd666[_0x4655('0x4e')]){logger[_0x4655('0xd')](_0x4655('0x4f'),'Recording\x20is\x20enabled!');_0x460680[_0x4655('0x50')]=util[_0x4655('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xa58431[_0x4655('0x4d')],_0x460680[_0x4655('0x51')],md5(_0x460680['uniqueid']));}else{_0x460680[_0x4655('0x50')]='';}headers[_0x4655('0x52')]=getAuth(_0xa58431);return getUser(_0xa58431,_0x5dc217[_0x4655('0x53')])['then'](function(_0x528e03){_0x45f718=_0x528e03;logger[_0x4655('0xd')]('The\x20User\x20ID\x20is:',_0x45f718['id']);return getEndUser(_0xa58431,_0x460680['calleridname'],_0x460680[_0x4655('0x54')]);})[_0x4655('0x28')](function(_0x42e359){_0x4d2ade=_0x42e359;logger['info'](_0x4655('0x55'),_0x4d2ade['id']);return getTicket(_0xa58431,_0x45f718,_0x4d2ade,_0x20353e,_0x460680);})[_0x4655('0x28')](function(_0x5744b4){if(_0x5744b4){logger[_0x4655('0xd')](_0x4655('0x56'),_0x5744b4['id']);switch(_0xa58431[_0x4655('0x3e')]){case'integrationTab':logger['info'](_0x4655('0x4f'),_0x4655('0x57'));return request({'uri':util[_0x4655('0xf')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0xa58431[_0x4655('0x1d')],_0x45f718['id'],_0x5744b4['id']),'method':_0x4655('0x11')});case'newTab':logger[_0x4655('0xd')](_0x4655('0x4f'),_0x4655('0x58'));emit(util[_0x4655('0xf')](_0x4655('0x59'),_0x5dc217[_0x4655('0x14')]),_0x4655('0x5a'),{'uri':util['format']('%s/agent/tickets/%s',_0xa58431[_0x4655('0x1d')][_0x4655('0x5b')]('/api/v2',''),_0x5744b4['id'])});break;default:logger[_0x4655('0x5c')](_0x4655('0x4f'),_0x4655('0x5d'));}}})[_0x4655('0x5e')](function(_0x25c2fa){logger[_0x4655('0x5c')](_0x4655('0x5f'),util[_0x4655('0x60')](_0x25c2fa,{'showHidden':!![],'depth':null}));});};exports[_0x4655('0x61')]=function(_0x32f077,_0x33590b,_0x8c332a,_0x3dd611,_0x55e2d1,_0xfdecc3,_0x5dcbed){var _0x13b089,_0x552900;_0xfdecc3['remoteUri']=intUtil[_0x4655('0x4c')](_0xfdecc3[_0x4655('0x1d')]);_0xfdecc3[_0x4655('0x4d')]=intUtil[_0x4655('0x4c')](_0xfdecc3['serverUrl']);if(_0x5dcbed&&_0x5dcbed[_0x4655('0x62')]&&_0x5dcbed[_0x4655('0x62')]!=='none'){logger[_0x4655('0xd')](_0x4655('0x63'),_0x4655('0x64'));_0x33590b[_0x4655('0x50')]=util['format'](_0x4655('0x65'),_0xfdecc3['serverUrl'],_0x33590b[_0x4655('0x51')],md5(_0x33590b[_0x4655('0x51')]));}headers[_0x4655('0x52')]=getAuth(_0xfdecc3);return getUser(_0xfdecc3,_0x3dd611[_0x4655('0x53')])[_0x4655('0x28')](function(_0x347924){_0x13b089=_0x347924;logger['info'](_0x4655('0x66'),_0x13b089['id']);return getEndUser(_0xfdecc3,_0x33590b[_0x4655('0x67')],_0x33590b['destcalleridnum']);})['then'](function(_0x21eff6){_0x552900=_0x21eff6;logger[_0x4655('0xd')](_0x4655('0x55'),_0x552900['id']);return getTicket(_0xfdecc3,_0x13b089,_0x552900,_0x8c332a,_0x33590b);})[_0x4655('0x28')](function(_0x21f5fc){if(_0x21f5fc){logger[_0x4655('0xd')](_0x4655('0x56'),_0x21f5fc['id']);switch(_0xfdecc3[_0x4655('0x3e')]){case _0x4655('0x68'):logger[_0x4655('0xd')](_0x4655('0x63'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0x4655('0x69'),_0xfdecc3[_0x4655('0x1d')],_0x13b089['id'],_0x21f5fc['id']),'method':_0x4655('0x11')});case _0x4655('0x6a'):logger['info'](_0x4655('0x63'),_0x4655('0x58'));emit(util[_0x4655('0xf')](_0x4655('0x59'),_0x3dd611[_0x4655('0x14')]),_0x4655('0x5a'),{'uri':util[_0x4655('0xf')](_0x4655('0x6b'),_0xfdecc3[_0x4655('0x1d')]['replace'](_0x4655('0x6c'),''),_0x21f5fc['id'])});break;default:logger[_0x4655('0x5c')](_0x4655('0x63'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x4655('0x5e')](function(_0x5d9207){logger['error'](_0x4655('0x6d'),util[_0x4655('0x60')](_0x5d9207,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x491bbc,_0x87e3d7,_0x2df00a,_0x5d89f9,_0x3168de,_0x4d7f90){var _0x26e586,_0x4e2dc3;_0x4d7f90['remoteUri']=intUtil['stripTrailingSlash'](_0x4d7f90[_0x4655('0x1d')]);_0x4d7f90[_0x4655('0x4d')]=intUtil[_0x4655('0x4c')](_0x4d7f90['serverUrl']);if(_0x3168de&&_0x3168de[_0x4655('0x4e')]){logger[_0x4655('0xd')]('['+_0x87e3d7[_0x4655('0x6e')]['toUpperCase']()+']',_0x4655('0x64'));_0x87e3d7[_0x4655('0x50')]=util['format'](_0x4655('0x65'),_0x4d7f90['serverUrl'],_0x87e3d7[_0x4655('0x51')],md5(_0x87e3d7[_0x4655('0x51')]));}else{_0x87e3d7[_0x4655('0x50')]='';}headers[_0x4655('0x52')]=getAuth(_0x4d7f90);return getUser(_0x4d7f90)[_0x4655('0x28')](function(_0x1f37c2){_0x26e586=_0x1f37c2;logger[_0x4655('0xd')](_0x4655('0x66'),_0x26e586['id']);return getEndUser(_0x4d7f90,_0x87e3d7['calleridname'],_0x87e3d7[_0x4655('0x54')]);})[_0x4655('0x28')](function(_0x1e9701){_0x4e2dc3=_0x1e9701;logger['info'](_0x4655('0x55'),_0x4e2dc3['id']);return getTicket(_0x4d7f90,_0x26e586,_0x4e2dc3,_0x2df00a,_0x87e3d7);})['then'](function(_0x5b61f1){if(_0x5b61f1){logger[_0x4655('0xd')]('The\x20Ticket\x20ID\x20is:',_0x5b61f1['id']);}})[_0x4655('0x5e')](function(_0x3fa8bb){logger[_0x4655('0x5c')]('['+_0x87e3d7['lastevent'][_0x4655('0x6f')]()+']'+_0x4655('0x70'),util[_0x4655('0x60')](_0x3fa8bb,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index bfb8f08..81fc6b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9b7=['first_name','last_name','data','SUCCESS','details','moduleCreate','Error:\x20','log','CREATE\x20ERROR','moduleSearch','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Owner','administrator','Subject','Subjects','Description','getString','Descriptions','Who_Id','Last_Name','What_Id','Full_Name','First_Name','$se_module','talktime','utc','mm:ss','endtime','diff','starttime','YYYY-MM-DDTHH:mm:ss','lastevent','called','Call_Result','Called','connect','Answered','rejected','abandoned','Abandoned','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','code','err','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','recordingURL','host','zoho.eu','com','calleridname','calleridnum','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','The\x20User\x20ID\x20is:','destcalleridname','Outbound','[OUTBOUND]','unmanaged','toUpperCase','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','emit','[HTTP]','stringify','length','picklist','type','content','toString','variableName','idField','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','isBefore','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientSecret','refresh_token','then','access_token','add','seconds','error','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','email','Agent\x20found!','findIndex','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','enduserType','POST','https://www.zohoapis.','/crm/v2/','startCase','role'];(function(_0x13583c,_0x4f2af7){var _0x2191d5=function(_0x4cf184){while(--_0x4cf184){_0x13583c['push'](_0x13583c['shift']());}};_0x2191d5(++_0x4f2af7);}(_0xa9b7,0x18a));var _0x7a9b=function(_0x3e82e5,_0xcb388f){_0x3e82e5=_0x3e82e5-0x0;var _0x2338dd=_0xa9b7[_0x3e82e5];return _0x2338dd;};'use strict';var _=require(_0x7a9b('0x0'));var rp=require(_0x7a9b('0x1'));var md5=require(_0x7a9b('0x2'));var util=require(_0x7a9b('0x3'));var intUtil=require(_0x7a9b('0x4'));var moment=require(_0x7a9b('0x5'));var Redis=require(_0x7a9b('0x6'));var BPromise=require(_0x7a9b('0x7'));var config=require(_0x7a9b('0x8'));var logger=require(_0x7a9b('0x9'))(_0x7a9b('0xa'));config[_0x7a9b('0xb')]=_[_0x7a9b('0xc')](config[_0x7a9b('0xb')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7a9b('0xb')]));function emit(_0x1f1cc5,_0x5e96a4,_0x1a7da8){io['to'](_0x1f1cc5)[_0x7a9b('0xd')](_0x5e96a4,_0x1a7da8);}function request(_0x210e9f){logger['debug'](_0x7a9b('0xe'),JSON[_0x7a9b('0xf')](_0x210e9f));return rp(_0x210e9f);}function getCustomFields(_0x1fb36a,_0x3e3ccd){var _0x57723b={};if(_0x1fb36a[_0x7a9b('0x10')]>0x0){_['forEach'](_0x1fb36a,function(_0x2d4011){if(_['includes'](['string',_0x7a9b('0x11')],_0x2d4011[_0x7a9b('0x12')])&&_0x2d4011['idField']){_0x57723b[_0x2d4011['idField']]=_0x2d4011[_0x7a9b('0x13')][_0x7a9b('0x14')]();}else if(_0x2d4011[_0x7a9b('0x12')]==='variable'&&_0x2d4011[_0x7a9b('0x15')]&&_0x2d4011[_0x7a9b('0x16')]&&_0x3e3ccd[_0x2d4011['variableName']]){_0x57723b[_0x2d4011[_0x7a9b('0x16')]]=_0x3e3ccd[_0x2d4011['variableName']][_0x7a9b('0x14')]();}else if(_0x2d4011['type']===_0x7a9b('0x17')&&_0x2d4011[_0x7a9b('0x18')]&&_0x2d4011['Variable']['name']&&_0x2d4011[_0x7a9b('0x16')]&&_0x3e3ccd[_0x2d4011['Variable'][_0x7a9b('0x19')][_0x7a9b('0x1a')]()]){_0x57723b[_0x2d4011[_0x7a9b('0x16')]]=_0x3e3ccd[_0x2d4011[_0x7a9b('0x18')][_0x7a9b('0x19')][_0x7a9b('0x1a')]()][_0x7a9b('0x14')]();}});}return _0x57723b;}function getName(_0x3bfdc1){if(_0x3bfdc1[_0x7a9b('0x1b')]('\x20')>0x0){var _0x4f4a64=_0x3bfdc1[_0x7a9b('0x1c')](/ (.+)/);if(_0x4f4a64[0x1]){return _0x4f4a64;}}return[_0x3bfdc1,_0x3bfdc1];}var accountsTokens={};function getAccessToken(_0x1c2b4a){return new Promise(function(_0x570831,_0x23341b){if(!_[_0x7a9b('0x1d')](accountsTokens[_0x1c2b4a['id']])&&!_[_0x7a9b('0x1d')](accountsTokens[_0x1c2b4a['id']]['access_token'])){if(moment()[_0x7a9b('0x1e')](accountsTokens[_0x1c2b4a['id']]['expires_in'])){_0x570831(accountsTokens[_0x1c2b4a['id']]['access_token']);}}var _0x50d6f0;switch(_0x1c2b4a[_0x7a9b('0x1f')]){case'US':_0x50d6f0=_0x7a9b('0x20');break;case'AU':_0x50d6f0=_0x7a9b('0x21');break;case'EU':_0x50d6f0=_0x7a9b('0x22');break;case'IN':_0x50d6f0=_0x7a9b('0x23');break;case'CN':_0x50d6f0=_0x7a9b('0x24');break;default:_0x50d6f0='https://accounts.zoho.eu';break;}var _0x206767={'method':'POST','uri':_0x50d6f0+_0x7a9b('0x25'),'qs':{'refresh_token':_0x1c2b4a[_0x7a9b('0x26')],'client_id':_0x1c2b4a['clientId'],'client_secret':_0x1c2b4a[_0x7a9b('0x27')],'grant_type':_0x7a9b('0x28')},'json':!![]};return rp(_0x206767)[_0x7a9b('0x29')](function(_0x55baf0){accountsTokens[_0x1c2b4a['id']]={'access_token':_0x55baf0[_0x7a9b('0x2a')],'expires_in':moment()[_0x7a9b('0x2b')](_0x55baf0['expires_in'],_0x7a9b('0x2c'))};_0x570831(_0x55baf0[_0x7a9b('0x2a')]);})['catch'](function(_0x2dc3e2){logger[_0x7a9b('0x2d')]('Failing\x20creating\x20the\x20access_token',_0x2dc3e2[_0x7a9b('0x2e')]);_0x23341b(_0x2dc3e2);});});}function getUser(_0x3b23db,_0x43393f,_0x5214bd,_0x2a0853){logger[_0x7a9b('0x2f')](_0x7a9b('0x30'));return request({'method':_0x7a9b('0x31'),'uri':util[_0x7a9b('0x32')](_0x7a9b('0x33'),_0x43393f),'qs':{'type':_0x7a9b('0x34')},'headers':{'Authorization':_0x7a9b('0x35')+_0x3b23db},'json':!![]})[_0x7a9b('0x29')](function(_0x5798f5){if(_0x5798f5[_0x7a9b('0x36')]){var _0x361c63=-0x1;if(_[_0x7a9b('0x37')](_0x5798f5[_0x7a9b('0x36')])){if(!_[_0x7a9b('0x1d')](_0x2a0853)){_0x361c63=_['findIndex'](_0x5798f5[_0x7a9b('0x36')],function(_0x41df63){return _0x41df63[_0x7a9b('0x38')]===_0x2a0853;});}if(_0x361c63>=0x0){logger[_0x7a9b('0x2f')](_0x7a9b('0x39'));}else{logger[_0x7a9b('0x2f')]('Using\x20the\x20admin\x20account!');_0x361c63=_[_0x7a9b('0x3a')](_0x5798f5[_0x7a9b('0x36')],function(_0x2673b9){return _0x2673b9[_0x7a9b('0x3b')]['name']===_0x7a9b('0x3c');});}return _0x5798f5['users'][_0x361c63];}else{if(_0x5798f5['user']['profile']['name']===_0x7a9b('0x3c')){logger['info']('Using\x20the\x20admin\x20account!');user=_0x5798f5[_0x7a9b('0x3d')];return user;}else{logger[_0x7a9b('0x2d')](_0x7a9b('0x3e'),JSON['stringify'](_0x5798f5));throw new Error(_0x7a9b('0x3f')+JSON[_0x7a9b('0xf')](_0x5798f5));}}}else{logger[_0x7a9b('0x2d')](_0x7a9b('0x3e'),JSON['stringify'](_0x5798f5));throw new Error(_0x7a9b('0x3f')+JSON[_0x7a9b('0xf')](_0x5798f5));}})[_0x7a9b('0x40')](function(_0x19ccae){console['error'](_0x19ccae);});}function getZohoUser(_0x50690e,_0x41f1c3){return new BPromise(function(_0x2fa0ff,_0x533d2e){request(_0x50690e)[_0x7a9b('0x29')](function(_0x2c8217){var _0x39dacc=null;if(_0x2c8217){_0x39dacc=_0x2c8217['data'][0x0];_0x39dacc[_0x7a9b('0x41')]=_0x41f1c3;}_0x2fa0ff(_0x39dacc);})[_0x7a9b('0x40')](function(_0x3d3186){_0x533d2e(_0x3d3186);});});}function createEndUser(_0x2be05c,_0x4d2217,_0x5585e3,_0x5bb526,_0x131653,_0xf8c0b9){var _0x5585e3=getName(_0x5585e3);return request({'method':_0x7a9b('0x42'),'uri':_0x7a9b('0x43')+_0x4d2217+_0x7a9b('0x44')+_[_0x7a9b('0x45')](_0xf8c0b9['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x5585e3[0x1],'First_Name':_0x5585e3[0x0],'Phone':_0x5bb526,'Owner':{'name':!_['isNil'](_0x131653[_0x7a9b('0x46')][_0x7a9b('0x19')])?_0x131653[_0x7a9b('0x46')][_0x7a9b('0x19')]:!_[_0x7a9b('0x1d')](_0x131653[_0x7a9b('0x47')])?_0x131653[_0x7a9b('0x47')]+'\x20'+_0x131653['last_name']:_0x131653[_0x7a9b('0x48')],'id':_0x131653['id']}}]},'headers':{'Authorization':_0x7a9b('0x35')+_0x2be05c},'json':!![]})['then'](function(_0x179217){if(_0x179217&&_0x179217[_0x7a9b('0x49')][0x0]['code']===_0x7a9b('0x4a')){var _0x39f0f2=_0x179217[_0x7a9b('0x49')][0x0][_0x7a9b('0x4b')];_0x39f0f2[_0x7a9b('0x41')]=_[_0x7a9b('0x45')](_0xf8c0b9[_0x7a9b('0x4c')])+'s';return _0x39f0f2;}logger['error'](_0x7a9b('0x3e'),JSON['stringify'](data));throw new Error(_0x7a9b('0x4d')+JSON[_0x7a9b('0xf')](data));})[_0x7a9b('0x40')](function(_0x3cf515){console[_0x7a9b('0x4e')](_0x7a9b('0x4f'),_0x3cf515);});}function getEndUser(_0x40e0b8,_0x5d9b05,_0x138b7f,_0x490a70,_0x2db12a,_0x36f772,_0xefd6ea){var _0x3385e7={'method':_0x7a9b('0x31'),'uri':'','headers':{'Authorization':_0x7a9b('0x35')+_0x40e0b8},'json':!![]};switch(_0xefd6ea[_0x7a9b('0x50')]){case'contact_lead':_0x3385e7[_0x7a9b('0x51')]=_0x7a9b('0x43')+_0x5d9b05+_0x7a9b('0x52')+_0x2db12a+'))';return getZohoUser(_0x3385e7,_0x7a9b('0x53'))['then'](function(_0x3c8efb){if(_0x3c8efb)return _0x3c8efb;_0x3385e7['uri']=_0x7a9b('0x43')+_0x5d9b05+_0x7a9b('0x54')+_0x2db12a+'))';return getZohoUser(_0x3385e7,_0x7a9b('0x55'))[_0x7a9b('0x29')](function(_0x553cc2){if(_0x553cc2)return _0x553cc2;if(_0xefd6ea[_0x7a9b('0x4c')]!=_0x7a9b('0x56')){return createEndUser(_0x40e0b8,_0x5d9b05,_0x490a70,_0x2db12a,_0x36f772,_0xefd6ea);}else{return{};}});});break;case _0x7a9b('0x57'):_0x3385e7[_0x7a9b('0x51')]=_0x7a9b('0x43')+_0x5d9b05+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x2db12a+'))';return getZohoUser(_0x3385e7,_0x7a9b('0x53'))[_0x7a9b('0x29')](function(_0x3b7f47){if(_0x3b7f47)return _0x3b7f47;if(_0xefd6ea[_0x7a9b('0x4c')]!=_0x7a9b('0x56')){return createEndUser(_0x40e0b8,_0x5d9b05,_0x490a70,_0x2db12a,_0x36f772,_0xefd6ea);}else{return{};}});break;case _0x7a9b('0x58'):_0x3385e7[_0x7a9b('0x51')]=_0x7a9b('0x43')+_0x5d9b05+_0x7a9b('0x54')+_0x2db12a+'))';return getZohoUser(_0x3385e7,_0x7a9b('0x55'))['then'](function(_0x876e01){if(_0x876e01)return _0x876e01;if(_0xefd6ea['moduleCreate']!=_0x7a9b('0x56')){return createEndUser(_0x40e0b8,_0x5d9b05,_0x490a70,_0x2db12a,_0x36f772,_0xefd6ea);}else{return{};}});break;}}function getCall(_0x443010,_0x47648a,_0x39e3b1,_0x3a5abd,_0x698eb0,_0x1ad6f7,_0x27242b,_0x34811a){logger[_0x7a9b('0x2f')]('Creating\x20new\x20call...');var _0xc1b40={};_0xc1b40[_0x7a9b('0x59')]={'name':!_[_0x7a9b('0x1d')](_0x3a5abd['role']['name'])&&!_[_0x7a9b('0x1d')](_0x3a5abd[_0x7a9b('0x3b')][_0x7a9b('0x19')])&&_0x3a5abd[_0x7a9b('0x3b')]['name']===_0x7a9b('0x5a')?_0x3a5abd[_0x7a9b('0x46')][_0x7a9b('0x19')]:!_[_0x7a9b('0x1d')](_0x3a5abd[_0x7a9b('0x47')])?_0x3a5abd[_0x7a9b('0x47')]+'\x20'+_0x3a5abd[_0x7a9b('0x48')]:_0x3a5abd[_0x7a9b('0x48')],'id':_0x3a5abd['id']};_0xc1b40[_0x7a9b('0x5b')]=intUtil['getString'](_0x1ad6f7[_0x7a9b('0x5c')],_0x27242b,'\x20');_0xc1b40[_0x7a9b('0x5d')]=intUtil[_0x7a9b('0x5e')](_0x1ad6f7[_0x7a9b('0x5f')],_0x27242b,'\x0a');if(_0x698eb0[_0x7a9b('0x41')]===_0x7a9b('0x53')){_0xc1b40[_0x7a9b('0x60')]={'name':!_['isNil'](_0x698eb0['Full_Name'])?_0x698eb0['Full_Name']:!_['isNil'](_0x698eb0['First_Name'])?_0x698eb0['First_Name']+'\x20'+_0x698eb0[_0x7a9b('0x61')]:_0x698eb0['Last_Name'],'id':_0x698eb0['id']};}if(_0x698eb0['enduserType']==='Leads'){_0xc1b40[_0x7a9b('0x62')]={'name':!_['isNil'](_0x698eb0[_0x7a9b('0x63')])?_0x698eb0['Full_Name']:!_['isNil'](_0x698eb0[_0x7a9b('0x64')])?_0x698eb0['First_Name']+'\x20'+_0x698eb0[_0x7a9b('0x61')]:_0x698eb0[_0x7a9b('0x61')],'id':_0x698eb0['id']};_0xc1b40[_0x7a9b('0x65')]=_['startCase'](_0x698eb0[_0x7a9b('0x41')]);}if(_0x27242b[_0x7a9b('0x66')]){_0xc1b40['Call_Duration']=moment[_0x7a9b('0x67')](parseInt(_0x27242b[_0x7a9b('0x66')])*0x3e8)[_0x7a9b('0x32')](_0x7a9b('0x68'));}else if(_0x27242b['answertime']&&_0x27242b['endtime']){_0xc1b40['Call_Duration']=moment['utc'](moment(_0x27242b[_0x7a9b('0x69')],'YYYY-MM-DDTHH:mm:ss')[_0x7a9b('0x6a')](moment(_0x27242b[_0x7a9b('0x6b')],_0x7a9b('0x6c'))))[_0x7a9b('0x32')](_0x7a9b('0x68'));}switch(_0x27242b[_0x7a9b('0x6d')]){case _0x7a9b('0x6e'):_0xc1b40[_0x7a9b('0x6f')]=_0x7a9b('0x70');break;case'complete':case _0x7a9b('0x71'):_0xc1b40[_0x7a9b('0x6f')]=_0x7a9b('0x72');break;case _0x7a9b('0x73'):_0xc1b40[_0x7a9b('0x6f')]='Rejected';break;case _0x7a9b('0x74'):_0xc1b40['Call_Result']=_0x7a9b('0x75');break;case'timeout':_0xc1b40['Call_Result']='Timeout';default:}_0xc1b40['Call_Start_Time']=(_0x34811a===_0x7a9b('0x76')?moment(_0x27242b[_0x7a9b('0x6b')])[_0x7a9b('0x32')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x27242b[_0x7a9b('0x77')])[_0x7a9b('0x32')](_0x7a9b('0x6c')))||moment()[_0x7a9b('0x32')](_0x7a9b('0x6c'));_0xc1b40[_0x7a9b('0x78')]=_0x34811a||_0x7a9b('0x79');_0xc1b40=_[_0x7a9b('0x7a')](_0xc1b40,getCustomFields(_0x1ad6f7[_0x7a9b('0x7b')],_0x27242b));return request({'method':_0x7a9b('0x42'),'uri':_0x7a9b('0x43')+_0x47648a+_0x7a9b('0x7c'),'headers':{'Authorization':_0x7a9b('0x35')+_0x443010},'body':{'data':[_0xc1b40]},'json':!![]})[_0x7a9b('0x29')](function(_0x49d2df){if(_0x49d2df&&_0x49d2df[_0x7a9b('0x49')][0x0][_0x7a9b('0x7d')]===_0x7a9b('0x4a')){logger[_0x7a9b('0x2f')]('Call\x20created!');return{'id':_0x49d2df[_0x7a9b('0x49')][0x0][_0x7a9b('0x4b')]['id']};}})['catch'](function(_0x3de99a){logger[_0x7a9b('0x2f')](_0x7a9b('0x7e'),_0x3de99a['stack']);console[_0x7a9b('0x4e')](_0x7a9b('0x7e'),_0x3de99a);});}exports['queue']=function(_0x4f4ef9,_0x5eefb1,_0x26d2d2,_0x523a2d,_0x182eb4,_0x358116){var _0x9b895a,_0x2dca18,_0x41a582;_0x358116['host']=intUtil[_0x7a9b('0x7f')](_0x358116['host']);_0x358116['serverUrl']=intUtil['stripTrailingSlash'](_0x358116[_0x7a9b('0x80')]);if(_0x182eb4&&_0x182eb4[_0x7a9b('0x81')]){logger[_0x7a9b('0x2f')](_0x7a9b('0x82'),_0x7a9b('0x83'));_0x5eefb1['recordingURL']=_0x358116[_0x7a9b('0x80')]+_0x7a9b('0x84')+_0x5eefb1[_0x7a9b('0x85')]+_0x7a9b('0x86')+md5(_0x5eefb1[_0x7a9b('0x85')]);}else{_0x5eefb1[_0x7a9b('0x87')]='';}var _0x1c7585=_0x358116[_0x7a9b('0x88')]===_0x7a9b('0x89')?'eu':_0x7a9b('0x8a');return getAccessToken(_0x358116)[_0x7a9b('0x29')](function(_0x2fc647){_0x41a582=_0x2fc647;return getUser(_0x41a582,_0x1c7585,_0x358116,_0x523a2d[_0x7a9b('0x38')]);})[_0x7a9b('0x29')](function(_0x21739){_0x9b895a=_0x21739;logger[_0x7a9b('0x2f')]('The\x20User\x20ID\x20is:',_0x9b895a['id']);return getEndUser(_0x41a582,_0x1c7585,_0x358116,_0x5eefb1[_0x7a9b('0x8b')],_0x5eefb1[_0x7a9b('0x8c')],_0x9b895a,_0x26d2d2);})[_0x7a9b('0x29')](function(_0x10e330){_0x2dca18=_0x10e330;return getCall(_0x41a582,_0x1c7585,_0x358116,_0x9b895a,_0x2dca18,_0x26d2d2,_0x5eefb1,'Inbound');})[_0x7a9b('0x29')](function(_0x19a1f7){if(_0x19a1f7){logger['info'](_0x7a9b('0x8d'),_0x19a1f7['id']);logger[_0x7a9b('0x2f')]('[QUEUE]',_0x7a9b('0x8e'));emit(util[_0x7a9b('0x32')](_0x7a9b('0x8f'),_0x523a2d[_0x7a9b('0x19')]),_0x7a9b('0x90'),{'uri':_0x7a9b('0x91')+_0x358116['host']+_0x7a9b('0x92')+_0x19a1f7['id']});}})[_0x7a9b('0x40')](function(_0x17294b){logger[_0x7a9b('0x2d')](_0x7a9b('0x82'),JSON[_0x7a9b('0xf')](_0x17294b));});};exports[_0x7a9b('0x76')]=function(_0x5c7f5d,_0x38afb2,_0x1b2ac0,_0x2736b7,_0x2b7b94,_0x19bdd3,_0x2d673e){var _0x268307,_0xd5653,_0x503636;_0x19bdd3['host']=intUtil[_0x7a9b('0x7f')](_0x19bdd3[_0x7a9b('0x88')]);_0x19bdd3[_0x7a9b('0x80')]=intUtil[_0x7a9b('0x7f')](_0x19bdd3[_0x7a9b('0x80')]);if(_0x2d673e&&_0x2d673e[_0x7a9b('0x93')]&&_0x2d673e['recordingFormat']!==_0x7a9b('0x94')){logger[_0x7a9b('0x2f')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x38afb2[_0x7a9b('0x87')]=_0x19bdd3[_0x7a9b('0x80')]+'/api/voice/recordings/'+_0x38afb2[_0x7a9b('0x85')]+_0x7a9b('0x86')+md5(_0x38afb2['uniqueid']);}var _0x318545=_0x19bdd3[_0x7a9b('0x88')]===_0x7a9b('0x89')?'eu':_0x7a9b('0x8a');return getAccessToken(_0x19bdd3)[_0x7a9b('0x29')](function(_0x558b98){_0x503636=_0x558b98;return getUser(_0x503636,_0x318545,_0x19bdd3,_0x2736b7[_0x7a9b('0x38')]);})[_0x7a9b('0x29')](function(_0x1ee64e){_0x268307=_0x1ee64e;logger['info'](_0x7a9b('0x95'),_0x268307['id']);return getEndUser(_0x503636,_0x318545,_0x19bdd3,_0x38afb2[_0x7a9b('0x96')],_0x38afb2['destcalleridnum'],_0x268307,_0x1b2ac0);})[_0x7a9b('0x29')](function(_0x52c962){_0xd5653=_0x52c962;return getCall(_0x503636,_0x318545,_0x19bdd3,_0x268307,_0xd5653,_0x1b2ac0,_0x38afb2,_0x7a9b('0x97'));})['then'](function(_0x44135b){if(_0x44135b){logger['info'](_0x7a9b('0x8d'),_0x44135b['id']);logger[_0x7a9b('0x2f')](_0x7a9b('0x98'),_0x7a9b('0x8e'));emit(util[_0x7a9b('0x32')](_0x7a9b('0x8f'),_0x2736b7[_0x7a9b('0x19')]),'trigger:browser:url',{'uri':'https://crm.'+_0x19bdd3[_0x7a9b('0x88')]+_0x7a9b('0x92')+_0x44135b['id']});}})[_0x7a9b('0x40')](function(_0x2dcab8){logger[_0x7a9b('0x2d')](_0x7a9b('0x98'),JSON['stringify'](_0x2dcab8));});};exports[_0x7a9b('0x99')]=function(_0x4d0c5b,_0x3c15f8,_0x48aa89,_0x4d377b,_0x585cd1,_0x417e92){var _0x38e049,_0x5f277b,_0x42ff77;_0x417e92['host']=intUtil[_0x7a9b('0x7f')](_0x417e92['host']);_0x417e92['serverUrl']=intUtil[_0x7a9b('0x7f')](_0x417e92[_0x7a9b('0x80')]);if(_0x585cd1&&_0x585cd1[_0x7a9b('0x81')]){logger['info']('['+_0x3c15f8['lastevent'][_0x7a9b('0x9a')]()+']',_0x7a9b('0x83'));_0x3c15f8[_0x7a9b('0x87')]=_0x417e92[_0x7a9b('0x80')]+_0x7a9b('0x84')+_0x3c15f8['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x3c15f8['uniqueid']);}else{_0x3c15f8[_0x7a9b('0x87')]='';}var _0x4bdece=_0x417e92[_0x7a9b('0x88')]===_0x7a9b('0x89')?'eu':_0x7a9b('0x8a');return getAccessToken(_0x417e92)[_0x7a9b('0x29')](function(_0x5a5212){_0x42ff77=_0x5a5212;return getUser(_0x42ff77,_0x4bdece,_0x417e92);})['then'](function(_0x1aa4bb){_0x38e049=_0x1aa4bb;logger[_0x7a9b('0x2f')](_0x7a9b('0x95'),_0x38e049['id']);return getEndUser(_0x42ff77,_0x4bdece,_0x417e92,_0x3c15f8[_0x7a9b('0x8b')],_0x3c15f8[_0x7a9b('0x8c')],_0x38e049,_0x48aa89);})[_0x7a9b('0x29')](function(_0x3b34d2){_0x5f277b=_0x3b34d2;return getCall(_0x42ff77,_0x4bdece,_0x417e92,_0x38e049,_0x5f277b,_0x48aa89,_0x3c15f8,_0x7a9b('0x79'));})[_0x7a9b('0x29')](function(_0x29381a){if(_0x29381a){logger[_0x7a9b('0x2f')](_0x7a9b('0x8d'),_0x29381a['id']);}})[_0x7a9b('0x40')](function(_0x295a53){logger[_0x7a9b('0x2d')]('['+_0x3c15f8[_0x7a9b('0x6d')]['toUpperCase']()+']',JSON[_0x7a9b('0xf')](_0x295a53));});};
\ No newline at end of file
+var _0x16a4=['recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','uniqueid','zoho.eu','destcalleridname','Outbound','user:%s','/crm/EntityInfo.do?module=Calls&id=','unmanaged','toUpperCase','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','string','picklist','type','idField','content','toString','variableName','customVariable','Variable','name','toLowerCase','indexOf','isNil','access_token','isBefore','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','expires_in','seconds','catch','Failing\x20creating\x20the\x20access_token','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','info','Using\x20the\x20admin\x20account!','Administrator','user','profile','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','error','data','enduserType','https://www.zohoapis.','/crm/v2/','moduleCreate','role','last_name','code','SUCCESS','details','startCase','CREATE\x20ERROR','moduleSearch','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','contact','Creating\x20new\x20call...','administrator','first_name','getString','Subjects','Description','Descriptions','Contacts','Who_Id','Full_Name','First_Name','Last_Name','Leads','What_Id','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','lastevent','called','Call_Result','Called','connect','Answered','rejected','Rejected','abandoned','Abandoned','Timeout','Call_Start_Time','outbound','starttime','agentcalledAt','Call_Type','Inbound','Fields','err','stack','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/downloads?type=uniqueid&token=','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url'];(function(_0x4ccb31,_0x15cef9){var _0x4bce35=function(_0x4c9ac4){while(--_0x4c9ac4){_0x4ccb31['push'](_0x4ccb31['shift']());}};_0x4bce35(++_0x15cef9);}(_0x16a4,0xa5));var _0x416a=function(_0x44740d,_0x59ff15){_0x44740d=_0x44740d-0x0;var _0x1b89e2=_0x16a4[_0x44740d];return _0x1b89e2;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x416a('0x0'));var util=require(_0x416a('0x1'));var intUtil=require(_0x416a('0x2'));var moment=require(_0x416a('0x3'));var Redis=require(_0x416a('0x4'));var BPromise=require(_0x416a('0x5'));var config=require(_0x416a('0x6'));var logger=require(_0x416a('0x7'))('zoho');config[_0x416a('0x8')]=_[_0x416a('0x9')](config[_0x416a('0x8')],{'host':_0x416a('0xa'),'port':0x18eb});var io=require(_0x416a('0xb'))(new Redis(config[_0x416a('0x8')]));function emit(_0x499534,_0x27ba9e,_0x4aed39){io['to'](_0x499534)[_0x416a('0xc')](_0x27ba9e,_0x4aed39);}function request(_0x246937){logger[_0x416a('0xd')](_0x416a('0xe'),JSON[_0x416a('0xf')](_0x246937));return rp(_0x246937);}function getCustomFields(_0x3d744e,_0x333e17){var _0x213bde={};if(_0x3d744e[_0x416a('0x10')]>0x0){_[_0x416a('0x11')](_0x3d744e,function(_0x5f16f4){if(_['includes']([_0x416a('0x12'),_0x416a('0x13')],_0x5f16f4[_0x416a('0x14')])&&_0x5f16f4[_0x416a('0x15')]){_0x213bde[_0x5f16f4[_0x416a('0x15')]]=_0x5f16f4[_0x416a('0x16')][_0x416a('0x17')]();}else if(_0x5f16f4[_0x416a('0x14')]==='variable'&&_0x5f16f4[_0x416a('0x18')]&&_0x5f16f4['idField']&&_0x333e17[_0x5f16f4[_0x416a('0x18')]]){_0x213bde[_0x5f16f4['idField']]=_0x333e17[_0x5f16f4[_0x416a('0x18')]][_0x416a('0x17')]();}else if(_0x5f16f4[_0x416a('0x14')]===_0x416a('0x19')&&_0x5f16f4['Variable']&&_0x5f16f4[_0x416a('0x1a')][_0x416a('0x1b')]&&_0x5f16f4[_0x416a('0x15')]&&_0x333e17[_0x5f16f4[_0x416a('0x1a')][_0x416a('0x1b')]['toLowerCase']()]){_0x213bde[_0x5f16f4[_0x416a('0x15')]]=_0x333e17[_0x5f16f4[_0x416a('0x1a')][_0x416a('0x1b')][_0x416a('0x1c')]()]['toString']();}});}return _0x213bde;}function getName(_0x1bf806){if(_0x1bf806[_0x416a('0x1d')]('\x20')>0x0){var _0x3de8c7=_0x1bf806['split'](/ (.+)/);if(_0x3de8c7[0x1]){return _0x3de8c7;}}return[_0x1bf806,_0x1bf806];}var accountsTokens={};function getAccessToken(_0x424be6){return new Promise(function(_0x30d772,_0x4dfb14){if(!_[_0x416a('0x1e')](accountsTokens[_0x424be6['id']])&&!_[_0x416a('0x1e')](accountsTokens[_0x424be6['id']][_0x416a('0x1f')])){if(moment()[_0x416a('0x20')](accountsTokens[_0x424be6['id']]['expires_in'])){_0x30d772(accountsTokens[_0x424be6['id']][_0x416a('0x1f')]);}}var _0x57ab32;switch(_0x424be6[_0x416a('0x21')]){case'US':_0x57ab32='https://accounts.zoho.com';break;case'AU':_0x57ab32=_0x416a('0x22');break;case'EU':_0x57ab32=_0x416a('0x23');break;case'IN':_0x57ab32=_0x416a('0x24');break;case'CN':_0x57ab32=_0x416a('0x25');break;default:_0x57ab32=_0x416a('0x23');break;}var _0x72828d={'method':_0x416a('0x26'),'uri':_0x57ab32+_0x416a('0x27'),'qs':{'refresh_token':_0x424be6[_0x416a('0x28')],'client_id':_0x424be6[_0x416a('0x29')],'client_secret':_0x424be6[_0x416a('0x2a')],'grant_type':_0x416a('0x2b')},'json':!![]};return rp(_0x72828d)[_0x416a('0x2c')](function(_0x40a074){accountsTokens[_0x424be6['id']]={'access_token':_0x40a074[_0x416a('0x1f')],'expires_in':moment()[_0x416a('0x2d')](_0x40a074[_0x416a('0x2e')],_0x416a('0x2f'))};_0x30d772(_0x40a074['access_token']);})[_0x416a('0x30')](function(_0x4e445d){logger['error'](_0x416a('0x31'),_0x4e445d['stack']);_0x4dfb14(_0x4e445d);});});}function getUser(_0x11c08b,_0x2e534a,_0x566f3c,_0x4a7d36){logger['info'](_0x416a('0x32'));return request({'method':_0x416a('0x33'),'uri':util[_0x416a('0x34')](_0x416a('0x35'),_0x2e534a),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x416a('0x36')+_0x11c08b},'json':!![]})['then'](function(_0x2e4db9){if(_0x2e4db9[_0x416a('0x37')]){var _0x41cfc2=-0x1;if(_[_0x416a('0x38')](_0x2e4db9['users'])){if(!_[_0x416a('0x1e')](_0x4a7d36)){_0x41cfc2=_[_0x416a('0x39')](_0x2e4db9[_0x416a('0x37')],function(_0x216366){return _0x216366[_0x416a('0x3a')]===_0x4a7d36;});}if(_0x41cfc2>=0x0){logger['info']('Agent\x20found!');}else{logger[_0x416a('0x3b')](_0x416a('0x3c'));_0x41cfc2=_[_0x416a('0x39')](_0x2e4db9[_0x416a('0x37')],function(_0x5ffe42){return _0x5ffe42['profile'][_0x416a('0x1b')]===_0x416a('0x3d');});}return _0x2e4db9['users'][_0x41cfc2];}else{if(_0x2e4db9[_0x416a('0x3e')][_0x416a('0x3f')][_0x416a('0x1b')]===_0x416a('0x3d')){logger[_0x416a('0x3b')](_0x416a('0x3c'));user=_0x2e4db9['user'];return user;}else{logger['error'](_0x416a('0x40'),JSON[_0x416a('0xf')](_0x2e4db9));throw new Error(_0x416a('0x41')+JSON['stringify'](_0x2e4db9));}}}else{logger[_0x416a('0x42')](_0x416a('0x40'),JSON[_0x416a('0xf')](_0x2e4db9));throw new Error(_0x416a('0x41')+JSON[_0x416a('0xf')](_0x2e4db9));}})['catch'](function(_0x4f1593){console[_0x416a('0x42')](_0x4f1593);});}function getZohoUser(_0x48922a,_0x26e52d){return new BPromise(function(_0x2722bd,_0x5f399a){request(_0x48922a)[_0x416a('0x2c')](function(_0x29b222){var _0x44623c=null;if(_0x29b222){_0x44623c=_0x29b222[_0x416a('0x43')][0x0];_0x44623c[_0x416a('0x44')]=_0x26e52d;}_0x2722bd(_0x44623c);})[_0x416a('0x30')](function(_0x38e380){_0x5f399a(_0x38e380);});});}function createEndUser(_0x29d084,_0x1a4552,_0x1c6b75,_0x3e8811,_0x21d949,_0x9205f5){var _0x1c6b75=getName(_0x1c6b75);return request({'method':_0x416a('0x26'),'uri':_0x416a('0x45')+_0x1a4552+_0x416a('0x46')+_['startCase'](_0x9205f5[_0x416a('0x47')])+'s','body':{'data':[{'Last_Name':_0x1c6b75[0x1],'First_Name':_0x1c6b75[0x0],'Phone':_0x3e8811,'Owner':{'name':!_['isNil'](_0x21d949[_0x416a('0x48')][_0x416a('0x1b')])?_0x21d949['role'][_0x416a('0x1b')]:!_[_0x416a('0x1e')](_0x21d949['first_name'])?_0x21d949['first_name']+'\x20'+_0x21d949[_0x416a('0x49')]:_0x21d949['last_name'],'id':_0x21d949['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x29d084},'json':!![]})['then'](function(_0x26c374){if(_0x26c374&&_0x26c374['data'][0x0][_0x416a('0x4a')]===_0x416a('0x4b')){var _0x175a51=_0x26c374[_0x416a('0x43')][0x0][_0x416a('0x4c')];_0x175a51['enduserType']=_[_0x416a('0x4d')](_0x9205f5[_0x416a('0x47')])+'s';return _0x175a51;}logger[_0x416a('0x42')](_0x416a('0x40'),JSON[_0x416a('0xf')](data));throw new Error('Error:\x20'+JSON['stringify'](data));})[_0x416a('0x30')](function(_0x1a5340){console['log'](_0x416a('0x4e'),_0x1a5340);});}function getEndUser(_0x25c279,_0x37df6b,_0x1f3e0d,_0x9cfd4c,_0x49bd63,_0x3b963e,_0x171bad){var _0x5735b5={'method':_0x416a('0x33'),'uri':'','headers':{'Authorization':_0x416a('0x36')+_0x25c279},'json':!![]};switch(_0x171bad[_0x416a('0x4f')]){case'contact_lead':_0x5735b5[_0x416a('0x50')]='https://www.zohoapis.'+_0x37df6b+_0x416a('0x51')+_0x49bd63+'))';return getZohoUser(_0x5735b5,'Contacts')['then'](function(_0x168751){if(_0x168751)return _0x168751;_0x5735b5[_0x416a('0x50')]=_0x416a('0x45')+_0x37df6b+_0x416a('0x52')+_0x49bd63+'))';return getZohoUser(_0x5735b5,'Leads')[_0x416a('0x2c')](function(_0x3dadcd){if(_0x3dadcd)return _0x3dadcd;if(_0x171bad['moduleCreate']!='nothing'){return createEndUser(_0x25c279,_0x37df6b,_0x9cfd4c,_0x49bd63,_0x3b963e,_0x171bad);}else{return{};}});});break;case _0x416a('0x53'):_0x5735b5[_0x416a('0x50')]='https://www.zohoapis.'+_0x37df6b+_0x416a('0x51')+_0x49bd63+'))';return getZohoUser(_0x5735b5,'Contacts')[_0x416a('0x2c')](function(_0x1c7899){if(_0x1c7899)return _0x1c7899;if(_0x171bad[_0x416a('0x47')]!='nothing'){return createEndUser(_0x25c279,_0x37df6b,_0x9cfd4c,_0x49bd63,_0x3b963e,_0x171bad);}else{return{};}});break;case'lead':_0x5735b5[_0x416a('0x50')]=_0x416a('0x45')+_0x37df6b+_0x416a('0x52')+_0x49bd63+'))';return getZohoUser(_0x5735b5,'Leads')[_0x416a('0x2c')](function(_0x3032dc){if(_0x3032dc)return _0x3032dc;if(_0x171bad[_0x416a('0x47')]!='nothing'){return createEndUser(_0x25c279,_0x37df6b,_0x9cfd4c,_0x49bd63,_0x3b963e,_0x171bad);}else{return{};}});break;}}function getCall(_0x12e1bf,_0x5b44f4,_0x5ccf5f,_0x34d194,_0x4ea2b5,_0x32b260,_0x2843ff,_0x33628b){logger['info'](_0x416a('0x54'));var _0x14952d={};_0x14952d['Owner']={'name':!_[_0x416a('0x1e')](_0x34d194[_0x416a('0x48')][_0x416a('0x1b')])&&!_[_0x416a('0x1e')](_0x34d194[_0x416a('0x3f')][_0x416a('0x1b')])&&_0x34d194[_0x416a('0x3f')]['name']===_0x416a('0x55')?_0x34d194[_0x416a('0x48')][_0x416a('0x1b')]:!_['isNil'](_0x34d194[_0x416a('0x56')])?_0x34d194[_0x416a('0x56')]+'\x20'+_0x34d194['last_name']:_0x34d194[_0x416a('0x49')],'id':_0x34d194['id']};_0x14952d['Subject']=intUtil[_0x416a('0x57')](_0x32b260[_0x416a('0x58')],_0x2843ff,'\x20');_0x14952d[_0x416a('0x59')]=intUtil['getString'](_0x32b260[_0x416a('0x5a')],_0x2843ff,'\x0a');if(_0x4ea2b5[_0x416a('0x44')]===_0x416a('0x5b')){_0x14952d[_0x416a('0x5c')]={'name':!_[_0x416a('0x1e')](_0x4ea2b5[_0x416a('0x5d')])?_0x4ea2b5[_0x416a('0x5d')]:!_[_0x416a('0x1e')](_0x4ea2b5['First_Name'])?_0x4ea2b5[_0x416a('0x5e')]+'\x20'+_0x4ea2b5['Last_Name']:_0x4ea2b5[_0x416a('0x5f')],'id':_0x4ea2b5['id']};}if(_0x4ea2b5[_0x416a('0x44')]===_0x416a('0x60')){_0x14952d[_0x416a('0x61')]={'name':!_[_0x416a('0x1e')](_0x4ea2b5[_0x416a('0x5d')])?_0x4ea2b5[_0x416a('0x5d')]:!_[_0x416a('0x1e')](_0x4ea2b5['First_Name'])?_0x4ea2b5[_0x416a('0x5e')]+'\x20'+_0x4ea2b5[_0x416a('0x5f')]:_0x4ea2b5['Last_Name'],'id':_0x4ea2b5['id']};_0x14952d[_0x416a('0x62')]=_[_0x416a('0x4d')](_0x4ea2b5['enduserType']);}if(_0x2843ff[_0x416a('0x63')]){_0x14952d[_0x416a('0x64')]=moment[_0x416a('0x65')](parseInt(_0x2843ff['talktime'])*0x3e8)['format'](_0x416a('0x66'));}else if(_0x2843ff[_0x416a('0x67')]&&_0x2843ff[_0x416a('0x68')]){_0x14952d[_0x416a('0x64')]=moment['utc'](moment(_0x2843ff[_0x416a('0x68')],_0x416a('0x69'))['diff'](moment(_0x2843ff['starttime'],'YYYY-MM-DDTHH:mm:ss')))[_0x416a('0x34')](_0x416a('0x66'));}switch(_0x2843ff[_0x416a('0x6a')]){case _0x416a('0x6b'):_0x14952d[_0x416a('0x6c')]=_0x416a('0x6d');break;case'complete':case _0x416a('0x6e'):_0x14952d[_0x416a('0x6c')]=_0x416a('0x6f');break;case _0x416a('0x70'):_0x14952d[_0x416a('0x6c')]=_0x416a('0x71');break;case _0x416a('0x72'):_0x14952d[_0x416a('0x6c')]=_0x416a('0x73');break;case'timeout':_0x14952d[_0x416a('0x6c')]=_0x416a('0x74');default:}_0x14952d[_0x416a('0x75')]=(_0x33628b===_0x416a('0x76')?moment(_0x2843ff[_0x416a('0x77')])[_0x416a('0x34')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x2843ff[_0x416a('0x78')])[_0x416a('0x34')](_0x416a('0x69')))||moment()[_0x416a('0x34')](_0x416a('0x69'));_0x14952d[_0x416a('0x79')]=_0x33628b||_0x416a('0x7a');_0x14952d=_['merge'](_0x14952d,getCustomFields(_0x32b260[_0x416a('0x7b')],_0x2843ff));return request({'method':'POST','uri':_0x416a('0x45')+_0x5b44f4+'/crm/v2/Calls','headers':{'Authorization':_0x416a('0x36')+_0x12e1bf},'body':{'data':[_0x14952d]},'json':!![]})[_0x416a('0x2c')](function(_0x427716){if(_0x427716&&_0x427716[_0x416a('0x43')][0x0][_0x416a('0x4a')]===_0x416a('0x4b')){logger[_0x416a('0x3b')]('Call\x20created!');return{'id':_0x427716[_0x416a('0x43')][0x0][_0x416a('0x4c')]['id']};}})[_0x416a('0x30')](function(_0x424fd1){logger['info'](_0x416a('0x7c'),_0x424fd1[_0x416a('0x7d')]);console['log'](_0x416a('0x7c'),_0x424fd1);});}exports['queue']=function(_0xf9079e,_0xae631,_0x480e5d,_0x17c106,_0x383c42,_0x346987){var _0x581c02,_0x495899,_0x59f2c4;_0x346987[_0x416a('0x7e')]=intUtil[_0x416a('0x7f')](_0x346987[_0x416a('0x7e')]);_0x346987['serverUrl']=intUtil[_0x416a('0x7f')](_0x346987[_0x416a('0x80')]);if(_0x383c42&&_0x383c42[_0x416a('0x81')]){logger['info'](_0x416a('0x82'),_0x416a('0x83'));_0xae631[_0x416a('0x84')]=_0x346987[_0x416a('0x80')]+'/api/voice/recordings/'+_0xae631['uniqueid']+_0x416a('0x85')+md5(_0xae631['uniqueid']);}else{_0xae631[_0x416a('0x84')]='';}var _0x15ebc=_0x346987[_0x416a('0x7e')]==='zoho.eu'?'eu':_0x416a('0x86');return getAccessToken(_0x346987)[_0x416a('0x2c')](function(_0x3e92bf){_0x59f2c4=_0x3e92bf;return getUser(_0x59f2c4,_0x15ebc,_0x346987,_0x17c106[_0x416a('0x3a')]);})[_0x416a('0x2c')](function(_0x199f44){_0x581c02=_0x199f44;logger['info'](_0x416a('0x87'),_0x581c02['id']);return getEndUser(_0x59f2c4,_0x15ebc,_0x346987,_0xae631[_0x416a('0x88')],_0xae631[_0x416a('0x89')],_0x581c02,_0x480e5d);})[_0x416a('0x2c')](function(_0x3676ef){_0x495899=_0x3676ef;return getCall(_0x59f2c4,_0x15ebc,_0x346987,_0x581c02,_0x495899,_0x480e5d,_0xae631,_0x416a('0x7a'));})[_0x416a('0x2c')](function(_0x493ccd){if(_0x493ccd){logger['info'](_0x416a('0x8a'),_0x493ccd['id']);logger[_0x416a('0x3b')](_0x416a('0x82'),_0x416a('0x8b'));emit(util[_0x416a('0x34')]('user:%s',_0x17c106[_0x416a('0x1b')]),_0x416a('0x8c'),{'uri':'https://crm.'+_0x346987['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x493ccd['id']});}})[_0x416a('0x30')](function(_0x4b70ae){logger[_0x416a('0x42')](_0x416a('0x82'),JSON['stringify'](_0x4b70ae));});};exports[_0x416a('0x76')]=function(_0x14c6fe,_0x2b7915,_0x41b71d,_0x567100,_0x3e1412,_0x39eeb3,_0xa657d2){var _0x4bac49,_0x3a685e,_0x1b5432;_0x39eeb3['host']=intUtil['stripTrailingSlash'](_0x39eeb3[_0x416a('0x7e')]);_0x39eeb3[_0x416a('0x80')]=intUtil['stripTrailingSlash'](_0x39eeb3[_0x416a('0x80')]);if(_0xa657d2&&_0xa657d2[_0x416a('0x8d')]&&_0xa657d2[_0x416a('0x8d')]!==_0x416a('0x8e')){logger[_0x416a('0x3b')](_0x416a('0x8f'),'Recording\x20is\x20enabled!');_0x2b7915[_0x416a('0x84')]=_0x39eeb3[_0x416a('0x80')]+_0x416a('0x90')+_0x2b7915[_0x416a('0x91')]+_0x416a('0x85')+md5(_0x2b7915[_0x416a('0x91')]);}var _0x1bac95=_0x39eeb3[_0x416a('0x7e')]===_0x416a('0x92')?'eu':_0x416a('0x86');return getAccessToken(_0x39eeb3)[_0x416a('0x2c')](function(_0x3b127b){_0x1b5432=_0x3b127b;return getUser(_0x1b5432,_0x1bac95,_0x39eeb3,_0x567100[_0x416a('0x3a')]);})['then'](function(_0x242389){_0x4bac49=_0x242389;logger[_0x416a('0x3b')](_0x416a('0x87'),_0x4bac49['id']);return getEndUser(_0x1b5432,_0x1bac95,_0x39eeb3,_0x2b7915[_0x416a('0x93')],_0x2b7915['destcalleridnum'],_0x4bac49,_0x41b71d);})[_0x416a('0x2c')](function(_0x4d85e9){_0x3a685e=_0x4d85e9;return getCall(_0x1b5432,_0x1bac95,_0x39eeb3,_0x4bac49,_0x3a685e,_0x41b71d,_0x2b7915,_0x416a('0x94'));})[_0x416a('0x2c')](function(_0x4acf3a){if(_0x4acf3a){logger['info']('The\x20Call\x20ID\x20is:',_0x4acf3a['id']);logger[_0x416a('0x3b')]('[OUTBOUND]',_0x416a('0x8b'));emit(util[_0x416a('0x34')](_0x416a('0x95'),_0x567100[_0x416a('0x1b')]),_0x416a('0x8c'),{'uri':'https://crm.'+_0x39eeb3[_0x416a('0x7e')]+_0x416a('0x96')+_0x4acf3a['id']});}})[_0x416a('0x30')](function(_0x430f49){logger[_0x416a('0x42')](_0x416a('0x8f'),JSON[_0x416a('0xf')](_0x430f49));});};exports[_0x416a('0x97')]=function(_0x231edf,_0x46646a,_0x16fefd,_0x32cf7d,_0x435f88,_0x5dc8ef){var _0x564aa9,_0x580c5b,_0x5682fa;_0x5dc8ef[_0x416a('0x7e')]=intUtil[_0x416a('0x7f')](_0x5dc8ef['host']);_0x5dc8ef['serverUrl']=intUtil[_0x416a('0x7f')](_0x5dc8ef['serverUrl']);if(_0x435f88&&_0x435f88[_0x416a('0x81')]){logger[_0x416a('0x3b')]('['+_0x46646a[_0x416a('0x6a')][_0x416a('0x98')]()+']',_0x416a('0x83'));_0x46646a[_0x416a('0x84')]=_0x5dc8ef[_0x416a('0x80')]+'/api/voice/recordings/'+_0x46646a[_0x416a('0x91')]+_0x416a('0x85')+md5(_0x46646a['uniqueid']);}else{_0x46646a[_0x416a('0x84')]='';}var _0x2ee9d2=_0x5dc8ef[_0x416a('0x7e')]==='zoho.eu'?'eu':_0x416a('0x86');return getAccessToken(_0x5dc8ef)[_0x416a('0x2c')](function(_0x529517){_0x5682fa=_0x529517;return getUser(_0x5682fa,_0x2ee9d2,_0x5dc8ef);})[_0x416a('0x2c')](function(_0x2e8685){_0x564aa9=_0x2e8685;logger[_0x416a('0x3b')](_0x416a('0x87'),_0x564aa9['id']);return getEndUser(_0x5682fa,_0x2ee9d2,_0x5dc8ef,_0x46646a[_0x416a('0x88')],_0x46646a['calleridnum'],_0x564aa9,_0x16fefd);})[_0x416a('0x2c')](function(_0x2b37ae){_0x580c5b=_0x2b37ae;return getCall(_0x5682fa,_0x2ee9d2,_0x5dc8ef,_0x564aa9,_0x580c5b,_0x16fefd,_0x46646a,_0x416a('0x7a'));})[_0x416a('0x2c')](function(_0x111c47){if(_0x111c47){logger[_0x416a('0x3b')](_0x416a('0x8a'),_0x111c47['id']);}})[_0x416a('0x30')](function(_0x35d980){logger['error']('['+_0x46646a[_0x416a('0x6a')][_0x416a('0x98')]()+']',JSON[_0x416a('0xf')](_0x35d980));});};
\ No newline at end of file
index 57e97ae..1acc966 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcef2=['data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','mustache','exec','data2','render'];(function(_0x22edc5,_0x3a4152){var _0x22f10f=function(_0x108c2c){while(--_0x108c2c){_0x22edc5['push'](_0x22edc5['shift']());}};_0x22f10f(++_0x3a4152);}(_0xcef2,0x69));var _0x2cef=function(_0x4b2e22,_0x282151){_0x4b2e22=_0x4b2e22-0x0;var _0x57a0ee=_0xcef2[_0x4b2e22];return _0x57a0ee;};'use strict';var util=require(_0x2cef('0x0'));var sh=require('shelljs');var Mustache=require(_0x2cef('0x1'));var logger=require('../../../../config/logger')('trigger');exports[_0x2cef('0x2')]=function(_0x284830,_0x129874){var _0x46fb32=_0x284830[_0x2cef('0x3')]?_0x284830[_0x2cef('0x3')]:'Script';var _0x4999e4=_0x284830['data3']?Mustache[_0x2cef('0x4')](_0x284830[_0x2cef('0x5')],_0x129874):_0x129874;sh[_0x2cef('0x2')](_0x4999e4,function(_0x5c5ab5,_0x58261d,_0xb8bd25){if(_0x5c5ab5!==0x0){logger[_0x2cef('0x6')](util[_0x2cef('0x7')](_0x2cef('0x8'),_0x46fb32,_0x4999e4,_0x5c5ab5,_0xb8bd25));}else{logger[_0x2cef('0x9')](util[_0x2cef('0x7')](_0x2cef('0xa'),_0x46fb32,_0x4999e4,_0x58261d));}});};
\ No newline at end of file
+var _0x08db=['data3','render','exec','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','util','mustache','trigger','data2','Script'];(function(_0x419e4a,_0x22f72e){var _0x325aa7=function(_0x371c4d){while(--_0x371c4d){_0x419e4a['push'](_0x419e4a['shift']());}};_0x325aa7(++_0x22f72e);}(_0x08db,0xd3));var _0xb08d=function(_0x4a679b,_0x17f960){_0x4a679b=_0x4a679b-0x0;var _0x454722=_0x08db[_0x4a679b];return _0x454722;};'use strict';var util=require(_0xb08d('0x0'));var sh=require('shelljs');var Mustache=require(_0xb08d('0x1'));var logger=require('../../../../config/logger')(_0xb08d('0x2'));exports['exec']=function(_0x3d53fb,_0x30bb95){var _0xdf8520=_0x3d53fb[_0xb08d('0x3')]?_0x3d53fb[_0xb08d('0x3')]:_0xb08d('0x4');var _0x518957=_0x3d53fb[_0xb08d('0x5')]?Mustache[_0xb08d('0x6')](_0x3d53fb['data3'],_0x30bb95):_0x30bb95;sh[_0xb08d('0x7')](_0x518957,function(_0x44bebd,_0x3b7ba2,_0x2bb918){if(_0x44bebd!==0x0){logger[_0xb08d('0x8')](util[_0xb08d('0x9')](_0xb08d('0xa'),_0xdf8520,_0x518957,_0x44bebd,_0x2bb918));}else{logger[_0xb08d('0xb')](util['format']('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0xdf8520,_0x518957,_0x3b7ba2));}});};
\ No newline at end of file
index 959b6bc..e449675 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c36=['exec','toUpperCase','render','data2','data5','data6','parse','error','stack','data1','GET','POST','PUT','data7','body','info','format','then','isNil','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','request-promise','util','../../../../config/logger','trigger'];(function(_0x540238,_0x2a4d7a){var _0x54bd92=function(_0x4ebafb){while(--_0x4ebafb){_0x540238['push'](_0x540238['shift']());}};_0x54bd92(++_0x2a4d7a);}(_0x9c36,0x88));var _0x69c3=function(_0x153d07,_0x31d657){_0x153d07=_0x153d07-0x0;var _0x1d829f=_0x9c36[_0x153d07];return _0x1d829f;};'use strict';var rp=require(_0x69c3('0x0'));var util=require(_0x69c3('0x1'));var _=require('lodash');var Mustache=require('mustache');var logger=require(_0x69c3('0x2'))(_0x69c3('0x3'));exports[_0x69c3('0x4')]=function(_0x1c91bd,_0x7bca8d){var _0x40ad5b,_0x119ebb;var _0x55a285={'method':_0x1c91bd['data1'][_0x69c3('0x5')](),'uri':Mustache[_0x69c3('0x6')](_0x1c91bd[_0x69c3('0x7')],_0x7bca8d),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x1c91bd[_0x69c3('0x8')])==='number'&&parseInt(_0x1c91bd[_0x69c3('0x8')])>=0x1&&parseInt(_0x1c91bd[_0x69c3('0x8')])<=0xa?parseInt(_0x1c91bd[_0x69c3('0x8')])*0x3e8:0x5*0x3e8};try{_0x55a285['headers']=_0x1c91bd[_0x69c3('0x9')]?JSON[_0x69c3('0xa')](Mustache[_0x69c3('0x6')](_0x1c91bd[_0x69c3('0x9')],_0x7bca8d)):{};}catch(_0x46243e){logger[_0x69c3('0xb')](_0x46243e[_0x69c3('0xc')]);}switch(_0x1c91bd[_0x69c3('0xd')][_0x69c3('0x5')]()){case _0x69c3('0xe'):case'DELETE':_0x40ad5b=null;_0x55a285['qs']=_0x7bca8d;break;case _0x69c3('0xf'):case _0x69c3('0x10'):if(_0x1c91bd[_0x69c3('0x11')]){try{_0x40ad5b=JSON[_0x69c3('0xa')](Mustache['render'](_0x1c91bd['data7'],_0x7bca8d));_0x55a285[_0x69c3('0x12')]=_0x40ad5b;}catch(_0x4a2f6e){logger[_0x69c3('0xb')](_0x4a2f6e[_0x69c3('0xc')]);logger[_0x69c3('0xb')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x40ad5b=_0x7bca8d;_0x55a285[_0x69c3('0x12')]=_0x40ad5b;}break;}logger[_0x69c3('0x13')](util[_0x69c3('0x14')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x1c91bd['data1'],_0x1c91bd[_0x69c3('0x7')],JSON['stringify'](_0x55a285)));rp(_0x55a285)[_0x69c3('0x15')](function(_0xa85a0d){_0x40ad5b=!_[_0x69c3('0x16')](_0x40ad5b)?',\x20request\x20body:\x20'+_0x40ad5b:'';_0x119ebb=typeof _0xa85a0d[_0x69c3('0x12')]==='object'?JSON['stringify'](_0xa85a0d['body']):_0xa85a0d[_0x69c3('0x12')];logger[_0x69c3('0x13')](util[_0x69c3('0x14')](_0x69c3('0x17'),_0x1c91bd['data1'],_0x1c91bd[_0x69c3('0x7')],_0xa85a0d[_0x69c3('0x18')],_0x119ebb));})[_0x69c3('0x19')](function(_0x187af4){logger['error'](util[_0x69c3('0x14')](_0x69c3('0x1a'),_0x1c91bd['data1'],_0x1c91bd['data2'],_0x187af4[_0x69c3('0x18')],_0x187af4[_0x69c3('0x1b')],_0x187af4['message']));});};
\ No newline at end of file
+var _0x653f=['catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash','mustache','trigger','data1','render','data2','data5','number','headers','data6','error','toUpperCase','DELETE','POST','PUT','data7','parse','body','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','stringify','then',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x653f,0x1e0));var _0xf653=function(_0x42a075,_0x5355ee){_0x42a075=_0x42a075-0x0;var _0x43d01f=_0x653f[_0x42a075];return _0x43d01f;};'use strict';var rp=require(_0xf653('0x0'));var util=require(_0xf653('0x1'));var _=require(_0xf653('0x2'));var Mustache=require(_0xf653('0x3'));var logger=require('../../../../config/logger')(_0xf653('0x4'));exports['exec']=function(_0x2c53be,_0x5ca0bc){var _0x2dd334,_0x1896de;var _0x56fe33={'method':_0x2c53be[_0xf653('0x5')]['toUpperCase'](),'uri':Mustache[_0xf653('0x6')](_0x2c53be[_0xf653('0x7')],_0x5ca0bc),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x2c53be[_0xf653('0x8')])===_0xf653('0x9')&&parseInt(_0x2c53be[_0xf653('0x8')])>=0x1&&parseInt(_0x2c53be['data5'])<=0xa?parseInt(_0x2c53be[_0xf653('0x8')])*0x3e8:0x5*0x3e8};try{_0x56fe33[_0xf653('0xa')]=_0x2c53be[_0xf653('0xb')]?JSON['parse'](Mustache[_0xf653('0x6')](_0x2c53be[_0xf653('0xb')],_0x5ca0bc)):{};}catch(_0x28e4e2){logger[_0xf653('0xc')](_0x28e4e2['stack']);}switch(_0x2c53be[_0xf653('0x5')][_0xf653('0xd')]()){case'GET':case _0xf653('0xe'):_0x2dd334=null;_0x56fe33['qs']=_0x5ca0bc;break;case _0xf653('0xf'):case _0xf653('0x10'):if(_0x2c53be[_0xf653('0x11')]){try{_0x2dd334=JSON[_0xf653('0x12')](Mustache[_0xf653('0x6')](_0x2c53be[_0xf653('0x11')],_0x5ca0bc));_0x56fe33[_0xf653('0x13')]=_0x2dd334;}catch(_0x738de6){logger['error'](_0x738de6[_0xf653('0x14')]);logger['error'](_0xf653('0x15'));}}else{_0x2dd334=_0x5ca0bc;_0x56fe33[_0xf653('0x13')]=_0x2dd334;}break;}logger[_0xf653('0x16')](util[_0xf653('0x17')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x2c53be[_0xf653('0x5')],_0x2c53be[_0xf653('0x7')],JSON[_0xf653('0x18')](_0x56fe33)));rp(_0x56fe33)[_0xf653('0x19')](function(_0x261e84){_0x2dd334=!_['isNil'](_0x2dd334)?_0xf653('0x1a')+_0x2dd334:'';_0x1896de=typeof _0x261e84[_0xf653('0x13')]===_0xf653('0x1b')?JSON[_0xf653('0x18')](_0x261e84[_0xf653('0x13')]):_0x261e84[_0xf653('0x13')];logger[_0xf653('0x16')](util[_0xf653('0x17')](_0xf653('0x1c'),_0x2c53be[_0xf653('0x5')],_0x2c53be[_0xf653('0x7')],_0x261e84[_0xf653('0x1d')],_0x1896de));})[_0xf653('0x1e')](function(_0x459f2e){logger[_0xf653('0xc')](util[_0xf653('0x17')](_0xf653('0x1f'),_0x2c53be[_0xf653('0x5')],_0x2c53be[_0xf653('0x7')],_0x459f2e['statusCode'],_0x459f2e[_0xf653('0x20')],_0x459f2e[_0xf653('0x21')]));});};
\ No newline at end of file
index 0972982..ca586da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85ed=['jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug','routing','error','rpc','message','result','catch','exports'];(function(_0x4bb366,_0x582499){var _0x39bbec=function(_0xad0d64){while(--_0xad0d64){_0x4bb366['push'](_0x4bb366['shift']());}};_0x39bbec(++_0x582499);}(_0x85ed,0x140));var _0xd85e=function(_0x277107,_0x3420dc){_0x277107=_0x277107-0x0;var _0x1da046=_0x85ed[_0x277107];return _0x1da046;};'use strict';var jayson=require(_0xd85e('0x0'));var BPromise=require(_0xd85e('0x1'));var logger=require(_0xd85e('0x2'))('routing');var client=jayson[_0xd85e('0x3')][_0xd85e('0x4')]({'port':0x2329});client[_0xd85e('0x5')]=function(_0x1f2453,_0x2d9b3e){return new BPromise(function(_0x21f934,_0xde2d8){return client[_0xd85e('0x6')](_0x1f2453,_0x2d9b3e)[_0xd85e('0x7')](function(_0x381dac){logger[_0xd85e('0x8')]('rpc',_0xd85e('0x9'),_0x1f2453,_0x2d9b3e,_0x381dac);if(_0x381dac[_0xd85e('0xa')]){logger[_0xd85e('0xa')](_0xd85e('0xb'),_0xd85e('0x9'),_0x1f2453,_0x381dac[_0xd85e('0xa')]['message'],_0x2d9b3e);return _0xde2d8(_0x381dac[_0xd85e('0xa')][_0xd85e('0xc')]);}else{return _0x21f934(_0x381dac[_0xd85e('0xd')]);}})[_0xd85e('0xe')](function(_0x3b7f83){logger[_0xd85e('0xa')](_0xd85e('0xb'),_0xd85e('0x9'),_0x1f2453,_0x3b7f83,_0x2d9b3e);return _0xde2d8(_0x3b7f83);});});};module[_0xd85e('0xf')]=client;
\ No newline at end of file
+var _0xef87=['exports','jayson/promise','../../config/logger','routing','client','http','Request','request','then','debug','rpc','error','message','catch'];(function(_0x5a94ac,_0x57438d){var _0x1d6ff4=function(_0x3c0112){while(--_0x3c0112){_0x5a94ac['push'](_0x5a94ac['shift']());}};_0x1d6ff4(++_0x57438d);}(_0xef87,0x135));var _0x7ef8=function(_0x4ea451,_0x89372b){_0x4ea451=_0x4ea451-0x0;var _0x505a20=_0xef87[_0x4ea451];return _0x505a20;};'use strict';var jayson=require(_0x7ef8('0x0'));var BPromise=require('bluebird');var logger=require(_0x7ef8('0x1'))(_0x7ef8('0x2'));var client=jayson[_0x7ef8('0x3')][_0x7ef8('0x4')]({'port':0x2329});client[_0x7ef8('0x5')]=function(_0x460003,_0x5c87aa){return new BPromise(function(_0xd5f55,_0x34988f){return client[_0x7ef8('0x6')](_0x460003,_0x5c87aa)[_0x7ef8('0x7')](function(_0xc144d1){logger[_0x7ef8('0x8')](_0x7ef8('0x9'),_0x7ef8('0x2'),_0x460003,_0x5c87aa,_0xc144d1);if(_0xc144d1[_0x7ef8('0xa')]){logger[_0x7ef8('0xa')](_0x7ef8('0x9'),'routing',_0x460003,_0xc144d1[_0x7ef8('0xa')][_0x7ef8('0xb')],_0x5c87aa);return _0x34988f(_0xc144d1[_0x7ef8('0xa')][_0x7ef8('0xb')]);}else{return _0xd5f55(_0xc144d1['result']);}})[_0x7ef8('0xc')](function(_0x3b864f){logger['error'](_0x7ef8('0x9'),'routing',_0x460003,_0x3b864f,_0x5c87aa);return _0x34988f(_0x3b864f);});});};module[_0x7ef8('0xd')]=client;
\ No newline at end of file
index be42962..56c59dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5829=['./rpc/mailAccount','resolve','getMailAccounts','then','initMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','bluebird','./server','./realtime'];(function(_0x188d31,_0x576e87){var _0x30ed33=function(_0x15f9a5){while(--_0x15f9a5){_0x188d31['push'](_0x188d31['shift']());}};_0x30ed33(++_0x576e87);}(_0x5829,0xf4));var _0x9582=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x5829[_0x2aa0e7];return _0x1472c0;};'use strict';var BPromise=require(_0x9582('0x0'));var server=require(_0x9582('0x1'));var Realtime=require(_0x9582('0x2'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x9582('0x3'));var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x9582('0x4')]()['then'](mailAccount[_0x9582('0x5')]())[_0x9582('0x6')](realtime[_0x9582('0x7')]())[_0x9582('0x6')](function(){email[_0x9582('0x8')](realtime[_0x9582('0x9')]);return realtime;});}function main(){return server[_0x9582('0xa')](realtime,email)[_0x9582('0x6')](function(){return initRealtime();})[_0x9582('0x6')](function(){return setting[_0x9582('0xb')]();})[_0x9582('0x6')](function(_0x4a1395){return setInterval(initRealtime,_0x4a1395[_0x9582('0xc')]*0x3e8);})['catch'](function(_0x1e61f3){console['log'](_0x1e61f3);});}main();
\ No newline at end of file
+var _0x8014=['then','getMailAccounts','mailAccounts','listen','getSettings','loginMailFrequency','catch','bluebird','./realtime','./lib/email','./rpc/mailAccount','resolve'];(function(_0x4f31a7,_0x5091df){var _0x1e74fd=function(_0x3e5cac){while(--_0x3e5cac){_0x4f31a7['push'](_0x4f31a7['shift']());}};_0x1e74fd(++_0x5091df);}(_0x8014,0x163));var _0x4801=function(_0x324012,_0x23f45f){_0x324012=_0x324012-0x0;var _0x435cf2=_0x8014[_0x324012];return _0x435cf2;};'use strict';var BPromise=require(_0x4801('0x0'));var server=require('./server');var Realtime=require(_0x4801('0x1'));var EmailChannel=require(_0x4801('0x2'));var mailAccount=require(_0x4801('0x3'));var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x4801('0x4')]()[_0x4801('0x5')](mailAccount[_0x4801('0x6')]())[_0x4801('0x5')](realtime['initMailAccounts']())[_0x4801('0x5')](function(){email['refresh'](realtime[_0x4801('0x7')]);return realtime;});}function main(){return server[_0x4801('0x8')](realtime,email)['then'](function(){return initRealtime();})[_0x4801('0x5')](function(){return setting[_0x4801('0x9')]();})[_0x4801('0x5')](function(_0x459aa1){return setInterval(initRealtime,_0x459aa1[_0x4801('0xa')]*0x3e8);})[_0x4801('0xb')](function(_0x921c0f){console['log'](_0x921c0f);});}main();
\ No newline at end of file
index e272f71..895f6c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x001e=['mailAccounts','prototype','emit','name','key','active','Imap','messageStatus','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','imapAccounts','box','bind','handleImapEmail','handleImapEnd','error','handleImapError','status','disabled','handleImapBox','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','smtp','send','verifySmtp','Smtp','verified','verify','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info'];(function(_0x999b85,_0x1edc2b){var _0x1d7124=function(_0x59cd29){while(--_0x59cd29){_0x999b85['push'](_0x999b85['shift']());}};_0x1d7124(++_0x1edc2b);}(_0x001e,0x1c1));var _0xe001=function(_0x395be8,_0x285479){_0x395be8=_0x395be8-0x0;var _0x5ceb20=_0x001e[_0x395be8];return _0x5ceb20;};'use strict';var _=require(_0xe001('0x0'));var moment=require(_0xe001('0x1'));var BPromise=require(_0xe001('0x2'));var md5=require(_0xe001('0x3'));var Redis=require(_0xe001('0x4'));var config=require(_0xe001('0x5'));var logger=require(_0xe001('0x6'))(_0xe001('0x7'));config[_0xe001('0x8')]=_['defaults'](config[_0xe001('0x8')],{'host':_0xe001('0x9'),'port':0x18eb});var io=require(_0xe001('0xa'))(new Redis(config[_0xe001('0x8')]));var EmailImap=require(_0xe001('0xb'));var EmailSmtp=require(_0xe001('0xc'));var mailAccount=require(_0xe001('0xd'));var md5Accounts={};function EmailChannel(_0x160ee5){logger[_0xe001('0xe')]('start\x20email\x20channel');this[_0xe001('0xf')]=_0x160ee5['mailAccounts'];this['imapAccounts']={};this['smtp']=new EmailSmtp();}EmailChannel[_0xe001('0x10')][_0xe001('0x11')]=function(_0x20d393){var _0x2a3db5=this[_0xe001('0xf')][_0x20d393];var _0x242191={'id':_0x2a3db5['id'],'name':_0x2a3db5[_0xe001('0x12')],'key':_0x2a3db5[_0xe001('0x13')],'active':_0x2a3db5[_0xe001('0x14')],'Imap':{'status':_0x2a3db5[_0xe001('0x15')]['status'],'messageStatus':_0x2a3db5[_0xe001('0x15')][_0xe001('0x16')],'total':_0x2a3db5[_0xe001('0x15')][_0xe001('0x17')]}};if(_[_0xe001('0x18')](md5Accounts[_0x20d393])){md5Accounts[_0x20d393]={};}var _0x132bbe=md5(JSON[_0xe001('0x19')](_0x242191));if(md5Accounts[_0x20d393][_0xe001('0x3')]!==_0x132bbe){md5Accounts[_0x20d393][_0xe001('0x3')]=_0x132bbe;io['emit'](_0xe001('0x1a'),_0x242191);}};EmailChannel['prototype'][_0xe001('0x1b')]=function(_0x4a8692){for(var _0x39d378 in _0x4a8692){if(_0x4a8692[_0xe001('0x1c')](_0x39d378)){if(_0x4a8692[_0x39d378]['Imap']&&_0x4a8692[_0x39d378]['active']){var _0xe1b4e1=_0x4a8692[_0x39d378][_0xe001('0x15')];if(!this[_0xe001('0x1d')][_0xe001('0x1c')](_0xe1b4e1['id'])){this[_0xe001('0x1d')][_0xe1b4e1['id']]=new EmailImap(_0xe1b4e1,_0x4a8692[_0x39d378][_0xe001('0x7')]);this[_0xe001('0x1d')][_0xe1b4e1['id']]['on'](_0xe001('0x1e'),this['handleImapBox'][_0xe001('0x1f')](this,_0x39d378));this[_0xe001('0x1d')][_0xe1b4e1['id']]['on'](_0xe001('0x7'),this[_0xe001('0x20')]['bind'](this,_0x39d378));this[_0xe001('0x1d')][_0xe1b4e1['id']]['on']('end',this[_0xe001('0x21')][_0xe001('0x1f')](this,_0x39d378));this[_0xe001('0x1d')][_0xe1b4e1['id']]['on'](_0xe001('0x22'),this[_0xe001('0x23')][_0xe001('0x1f')](this,_0x39d378));}}else{if(_[_0xe001('0x18')](this[_0xe001('0xf')][_0x39d378][_0xe001('0x15')])){this[_0xe001('0xf')][_0x39d378]['Imap']={};}this[_0xe001('0xf')][_0x39d378]['Imap'][_0xe001('0x24')]=_0xe001('0x25');this['mailAccounts'][_0x39d378][_0xe001('0x15')][_0xe001('0x16')]='';this[_0xe001('0x11')](_0x39d378);}}}};EmailChannel[_0xe001('0x10')][_0xe001('0x26')]=function(_0xe7220e,_0x40cf15){if(this[_0xe001('0xf')][_0xe7220e]){this[_0xe001('0xf')][_0xe7220e][_0xe001('0x15')][_0xe001('0x24')]=_0xe001('0x27');this[_0xe001('0xf')][_0xe7220e][_0xe001('0x15')][_0xe001('0x16')]=_0x40cf15[_0xe001('0x12')];if(_0x40cf15['messages']){this[_0xe001('0xf')][_0xe7220e]['Imap'][_0xe001('0x17')]=_0x40cf15[_0xe001('0x28')]['total'];}return this['emit'](_0xe7220e);}};EmailChannel['prototype'][_0xe001('0x20')]=function(_0x492b7f,_0x4a4896){logger[_0xe001('0xe')](_0xe001('0x29'),_0x4a4896['firstName'],_0x4a4896[_0xe001('0x2a')],_0x4a4896[_0xe001('0x2b')],_0x492b7f);if(this[_0xe001('0xf')][_0x492b7f]){return mailAccount[_0xe001('0x2c')](_0x492b7f,_0x4a4896)[_0xe001('0x2d')](function(_0x581928){if(_0x581928){logger[_0xe001('0xe')](_0xe001('0x2e'));}})[_0xe001('0x2f')](function(_0x2eaf02){logger['error'](_0xe001('0x30'),JSON[_0xe001('0x19')](_0x2eaf02));});}};EmailChannel[_0xe001('0x10')][_0xe001('0x21')]=function(_0x26b277){if(this[_0xe001('0xf')][_0x26b277]&&this[_0xe001('0xf')][_0x26b277][_0xe001('0x15')]){if(this[_0xe001('0x1d')][this[_0xe001('0xf')][_0x26b277][_0xe001('0x15')]['id']]){delete this[_0xe001('0x1d')][this[_0xe001('0xf')][_0x26b277][_0xe001('0x15')]['id']];}this[_0xe001('0xf')][_0x26b277][_0xe001('0x15')][_0xe001('0x31')]=moment();this['emit'](_0x26b277);}};EmailChannel[_0xe001('0x10')][_0xe001('0x23')]=function(_0x39b040,_0x50d67e){if(this[_0xe001('0xf')][_0x39b040]){this['mailAccounts'][_0x39b040]['Imap'][_0xe001('0x24')]='error';this['mailAccounts'][_0x39b040][_0xe001('0x15')]['messageStatus']=_0x50d67e;return this[_0xe001('0x11')](_0x39b040);}};EmailChannel[_0xe001('0x10')][_0xe001('0x32')]=function(_0x14be89,_0x2af218){return this[_0xe001('0x33')][_0xe001('0x34')](_0x14be89,_0x2af218);};EmailChannel[_0xe001('0x10')][_0xe001('0x35')]=function(_0xfd23c5){var _0x11676a=this;if(this[_0xe001('0xf')][_0xfd23c5['id']]){if(_['isNil'](this[_0xe001('0xf')][_0xfd23c5['id']]['Smtp'])){this[_0xe001('0xf')][_0xfd23c5['id']][_0xe001('0x36')]={};}this['mailAccounts'][_0xfd23c5['id']][_0xe001('0x36')]['lastSync']=moment();return new BPromise(function(_0x5d1690,_0x531b97){return _0x11676a[_0xe001('0x33')]['verify'](_0xfd23c5)[_0xe001('0x2d')](function(_0x3d731e){_0x11676a[_0xe001('0xf')][_0xfd23c5['id']][_0xe001('0x36')][_0xe001('0x24')]=_0xe001('0x37');_0x11676a['mailAccounts'][_0xfd23c5['id']][_0xe001('0x36')][_0xe001('0x16')]='';_0x11676a[_0xe001('0x11')](_0xfd23c5['id']);_0x5d1690(_0x3d731e);})['catch'](function(_0x4844eb){_0x11676a[_0xe001('0xf')][_0xfd23c5['id']][_0xe001('0x36')][_0xe001('0x24')]=_0xe001('0x22');_0x11676a[_0xe001('0xf')][_0xfd23c5['id']][_0xe001('0x36')][_0xe001('0x16')]=_0x4844eb;_0x11676a[_0xe001('0x11')](_0xfd23c5['id']);_0x531b97(_0x4844eb);});});}return this['smtp'][_0xe001('0x38')](_0xfd23c5);};module[_0xe001('0x39')]=EmailChannel;
\ No newline at end of file
+var _0x337a=['ioredis','../../../config/environment','../../../config/logger','email','defaults','redis','localhost','socket.io-emitter','./imap','./smtp','info','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','isNil','stringify','md5','mailAccount:update','refresh','hasOwnProperty','box','handleImapBox','handleImapEmail','bind','end','handleImapEnd','error','handleImapError','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','notify','then','Mail\x20accepted\x20from\x20routing','catch','lastSync','sendMail','verifySmtp','Smtp','verify','verified','exports','lodash','moment','bluebird'];(function(_0x55fb83,_0x1d3856){var _0x59a87a=function(_0x38bdd1){while(--_0x38bdd1){_0x55fb83['push'](_0x55fb83['shift']());}};_0x59a87a(++_0x1d3856);}(_0x337a,0x14d));var _0xa337=function(_0xbcbdcb,_0x652b63){_0xbcbdcb=_0xbcbdcb-0x0;var _0x243fcd=_0x337a[_0xbcbdcb];return _0x243fcd;};'use strict';var _=require(_0xa337('0x0'));var moment=require(_0xa337('0x1'));var BPromise=require(_0xa337('0x2'));var md5=require('md5');var Redis=require(_0xa337('0x3'));var config=require(_0xa337('0x4'));var logger=require(_0xa337('0x5'))(_0xa337('0x6'));config['redis']=_[_0xa337('0x7')](config[_0xa337('0x8')],{'host':_0xa337('0x9'),'port':0x18eb});var io=require(_0xa337('0xa'))(new Redis(config[_0xa337('0x8')]));var EmailImap=require(_0xa337('0xb'));var EmailSmtp=require(_0xa337('0xc'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x1bf8b6){logger[_0xa337('0xd')]('start\x20email\x20channel');this[_0xa337('0xe')]=_0x1bf8b6[_0xa337('0xe')];this[_0xa337('0xf')]={};this[_0xa337('0x10')]=new EmailSmtp();}EmailChannel[_0xa337('0x11')][_0xa337('0x12')]=function(_0x21f6c4){var _0x50044b=this[_0xa337('0xe')][_0x21f6c4];var _0x48b99a={'id':_0x50044b['id'],'name':_0x50044b[_0xa337('0x13')],'key':_0x50044b[_0xa337('0x14')],'active':_0x50044b[_0xa337('0x15')],'Imap':{'status':_0x50044b[_0xa337('0x16')][_0xa337('0x17')],'messageStatus':_0x50044b[_0xa337('0x16')][_0xa337('0x18')],'total':_0x50044b[_0xa337('0x16')][_0xa337('0x19')]}};if(_[_0xa337('0x1a')](md5Accounts[_0x21f6c4])){md5Accounts[_0x21f6c4]={};}var _0x31942a=md5(JSON[_0xa337('0x1b')](_0x48b99a));if(md5Accounts[_0x21f6c4][_0xa337('0x1c')]!==_0x31942a){md5Accounts[_0x21f6c4][_0xa337('0x1c')]=_0x31942a;io[_0xa337('0x12')](_0xa337('0x1d'),_0x48b99a);}};EmailChannel[_0xa337('0x11')][_0xa337('0x1e')]=function(_0x927d96){for(var _0x12c7d8 in _0x927d96){if(_0x927d96[_0xa337('0x1f')](_0x12c7d8)){if(_0x927d96[_0x12c7d8][_0xa337('0x16')]&&_0x927d96[_0x12c7d8]['active']){var _0x259529=_0x927d96[_0x12c7d8][_0xa337('0x16')];if(!this[_0xa337('0xf')][_0xa337('0x1f')](_0x259529['id'])){this[_0xa337('0xf')][_0x259529['id']]=new EmailImap(_0x259529,_0x927d96[_0x12c7d8][_0xa337('0x6')]);this[_0xa337('0xf')][_0x259529['id']]['on'](_0xa337('0x20'),this[_0xa337('0x21')]['bind'](this,_0x12c7d8));this[_0xa337('0xf')][_0x259529['id']]['on']('email',this[_0xa337('0x22')][_0xa337('0x23')](this,_0x12c7d8));this[_0xa337('0xf')][_0x259529['id']]['on'](_0xa337('0x24'),this[_0xa337('0x25')]['bind'](this,_0x12c7d8));this[_0xa337('0xf')][_0x259529['id']]['on'](_0xa337('0x26'),this[_0xa337('0x27')][_0xa337('0x23')](this,_0x12c7d8));}}else{if(_[_0xa337('0x1a')](this[_0xa337('0xe')][_0x12c7d8][_0xa337('0x16')])){this[_0xa337('0xe')][_0x12c7d8][_0xa337('0x16')]={};}this['mailAccounts'][_0x12c7d8][_0xa337('0x16')][_0xa337('0x17')]='disabled';this['mailAccounts'][_0x12c7d8]['Imap'][_0xa337('0x18')]='';this['emit'](_0x12c7d8);}}}};EmailChannel[_0xa337('0x11')][_0xa337('0x21')]=function(_0x113d86,_0x17c033){if(this[_0xa337('0xe')][_0x113d86]){this[_0xa337('0xe')][_0x113d86][_0xa337('0x16')][_0xa337('0x17')]=_0xa337('0x28');this['mailAccounts'][_0x113d86][_0xa337('0x16')]['messageStatus']=_0x17c033[_0xa337('0x13')];if(_0x17c033[_0xa337('0x29')]){this[_0xa337('0xe')][_0x113d86]['Imap'][_0xa337('0x19')]=_0x17c033[_0xa337('0x29')]['total'];}return this[_0xa337('0x12')](_0x113d86);}};EmailChannel['prototype'][_0xa337('0x22')]=function(_0x2e2251,_0x3a5d14){logger[_0xa337('0xd')](_0xa337('0x2a'),_0x3a5d14[_0xa337('0x2b')],_0x3a5d14[_0xa337('0x2c')],_0x3a5d14['from'],_0x2e2251);if(this['mailAccounts'][_0x2e2251]){return mailAccount[_0xa337('0x2d')](_0x2e2251,_0x3a5d14)[_0xa337('0x2e')](function(_0xf91a76){if(_0xf91a76){logger[_0xa337('0xd')](_0xa337('0x2f'));}})[_0xa337('0x30')](function(_0x4aa630){logger[_0xa337('0x26')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0xa337('0x1b')](_0x4aa630));});}};EmailChannel[_0xa337('0x11')][_0xa337('0x25')]=function(_0x2ef259){if(this[_0xa337('0xe')][_0x2ef259]&&this[_0xa337('0xe')][_0x2ef259][_0xa337('0x16')]){if(this['imapAccounts'][this['mailAccounts'][_0x2ef259][_0xa337('0x16')]['id']]){delete this[_0xa337('0xf')][this[_0xa337('0xe')][_0x2ef259][_0xa337('0x16')]['id']];}this[_0xa337('0xe')][_0x2ef259]['Imap'][_0xa337('0x31')]=moment();this[_0xa337('0x12')](_0x2ef259);}};EmailChannel[_0xa337('0x11')][_0xa337('0x27')]=function(_0x508c71,_0x56efa9){if(this[_0xa337('0xe')][_0x508c71]){this[_0xa337('0xe')][_0x508c71]['Imap']['status']=_0xa337('0x26');this[_0xa337('0xe')][_0x508c71][_0xa337('0x16')][_0xa337('0x18')]=_0x56efa9;return this['emit'](_0x508c71);}};EmailChannel['prototype'][_0xa337('0x32')]=function(_0x5e07f4,_0x4bf416){return this[_0xa337('0x10')]['send'](_0x5e07f4,_0x4bf416);};EmailChannel[_0xa337('0x11')][_0xa337('0x33')]=function(_0x4bc1d6){var _0x47a454=this;if(this[_0xa337('0xe')][_0x4bc1d6['id']]){if(_[_0xa337('0x1a')](this[_0xa337('0xe')][_0x4bc1d6['id']][_0xa337('0x34')])){this['mailAccounts'][_0x4bc1d6['id']]['Smtp']={};}this[_0xa337('0xe')][_0x4bc1d6['id']][_0xa337('0x34')][_0xa337('0x31')]=moment();return new BPromise(function(_0x328cb0,_0x4be10c){return _0x47a454['smtp'][_0xa337('0x35')](_0x4bc1d6)[_0xa337('0x2e')](function(_0x241f1d){_0x47a454[_0xa337('0xe')][_0x4bc1d6['id']][_0xa337('0x34')][_0xa337('0x17')]=_0xa337('0x36');_0x47a454[_0xa337('0xe')][_0x4bc1d6['id']]['Smtp'][_0xa337('0x18')]='';_0x47a454[_0xa337('0x12')](_0x4bc1d6['id']);_0x328cb0(_0x241f1d);})[_0xa337('0x30')](function(_0x52f938){_0x47a454[_0xa337('0xe')][_0x4bc1d6['id']]['Smtp'][_0xa337('0x17')]=_0xa337('0x26');_0x47a454[_0xa337('0xe')][_0x4bc1d6['id']]['Smtp'][_0xa337('0x18')]=_0x52f938;_0x47a454[_0xa337('0x12')](_0x4bc1d6['id']);_0x4be10c(_0x52f938);});});}return this[_0xa337('0x10')][_0xa337('0x35')](_0x4bc1d6);};module[_0xa337('0x37')]=EmailChannel;
\ No newline at end of file
index c9b304d..8a3e670 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d9b=['handleMessageEnd','handleSimpleParser','parser','emit','handleFetchEnd','stringify','textCode','hasOwnProperty','exports','util','imap','randomstring','simpleParser','iconv','Iconv','EventEmitter','../../../config/logger','email','mailbox','INBOX','account','getAccount','bind','once','handleEnd','error','connect','inherits','prototype','connTimeout','authTimeout','isNil','user','password','host','port','tls','autotls','getHost','service','anonymous@xcally.com','handleReady','openBox','handleOpenBox','handleError','box','readUnseen','end','UNSEEN','handleReadUnseen','length','message','handleFetchMessage','handleFetchError','closeBox','handleCloseBox','body','handleMessageBody','handleMessageAttributes'];(function(_0x44ad4b,_0x13ccad){var _0x4c0516=function(_0x1a841e){while(--_0x1a841e){_0x44ad4b['push'](_0x44ad4b['shift']());}};_0x4c0516(++_0x13ccad);}(_0x9d9b,0x1e1));var _0xb9d9=function(_0x181779,_0x13a536){_0x181779=_0x181779-0x0;var _0x4b6222=_0x9d9b[_0x181779];return _0x4b6222;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xb9d9('0x0'));var Imap=require(_0xb9d9('0x1'));var _=require('lodash');var rs=require(_0xb9d9('0x2'));var simpleParser=require('mailparser')[_0xb9d9('0x3')];var Iconv=require(_0xb9d9('0x4'))[_0xb9d9('0x5')];var EventEmitter=require('events')[_0xb9d9('0x6')];var utils=require('./utils');var logger=require(_0xb9d9('0x7'))(_0xb9d9('0x8'));function EmailImap(_0x51af61,_0x13743f){this[_0xb9d9('0x9')]=_0xb9d9('0xa');this[_0xb9d9('0xb')]=this[_0xb9d9('0xc')](_0x51af61,_0x13743f);this[_0xb9d9('0x1')]=new Imap(this[_0xb9d9('0xb')]);this['imap']['once']('ready',this['handleReady'][_0xb9d9('0xd')](this));this[_0xb9d9('0x1')][_0xb9d9('0xe')]('end',this[_0xb9d9('0xf')][_0xb9d9('0xd')](this));this['imap']['on'](_0xb9d9('0x10'),this['handleError'][_0xb9d9('0xd')](this));this[_0xb9d9('0x1')][_0xb9d9('0x11')]();}util[_0xb9d9('0x12')](EmailImap,EventEmitter);EmailImap[_0xb9d9('0x13')][_0xb9d9('0xc')]=function(_0x4f0c77,_0xfc9733){var _0x4cbc4d={'connTimeout':_0x4f0c77['connTimeout']?_0x4f0c77[_0xb9d9('0x14')]*0x3e8:0x2710,'authTimeout':_0x4f0c77[_0xb9d9('0x15')]?_0x4f0c77[_0xb9d9('0x15')]*0x3e8:0x1388};if(_[_0xb9d9('0x16')](_0x4f0c77['service'])){if(_0x4f0c77['authentication']){_0x4cbc4d[_0xb9d9('0x17')]=_0x4f0c77['user'];_0x4cbc4d['password']=_0x4f0c77[_0xb9d9('0x18')];}_0x4cbc4d[_0xb9d9('0x19')]=_0x4f0c77[_0xb9d9('0x19')];_0x4cbc4d['port']=_0x4f0c77[_0xb9d9('0x1a')]||0x3e1;if(_0x4f0c77[_0xb9d9('0x1b')]){_0x4cbc4d['tls']=!![];}else{_0x4cbc4d[_0xb9d9('0x1b')]=![];_0x4cbc4d[_0xb9d9('0x1c')]='required';}}else{_0x4cbc4d[_0xb9d9('0x17')]=_0x4f0c77[_0xb9d9('0x17')];_0x4cbc4d['password']=_0x4f0c77[_0xb9d9('0x18')];_0x4cbc4d[_0xb9d9('0x19')]=utils[_0xb9d9('0x1d')](_0x4f0c77[_0xb9d9('0x1e')]);_0x4cbc4d[_0xb9d9('0x1a')]=0x3e1;_0x4cbc4d[_0xb9d9('0x1b')]=!![];}_0x4cbc4d['email']=_0xfc9733||_0x4f0c77[_0xb9d9('0x17')]||_0xb9d9('0x1f');return _0x4cbc4d;};EmailImap['prototype'][_0xb9d9('0x20')]=function(){this[_0xb9d9('0x1')][_0xb9d9('0x21')](this[_0xb9d9('0x9')],![],this['handleOpenBox'][_0xb9d9('0xd')](this));};EmailImap[_0xb9d9('0x13')][_0xb9d9('0x22')]=function(_0x436cb7,_0x2650f7){if(_0x436cb7){this[_0xb9d9('0x23')](_0x436cb7,!![]);}else{this['emit'](_0xb9d9('0x24'),_0x2650f7);this[_0xb9d9('0x25')]();}};EmailImap[_0xb9d9('0x13')]['handleCloseBox']=function(_0x2a30fe){if(_0x2a30fe){this[_0xb9d9('0x23')](_0x2a30fe,!![]);}else{this[_0xb9d9('0x1')][_0xb9d9('0x26')]();}};EmailImap[_0xb9d9('0x13')][_0xb9d9('0x25')]=function(){this[_0xb9d9('0x1')]['search']([_0xb9d9('0x27')],this[_0xb9d9('0x28')][_0xb9d9('0xd')](this));};EmailImap[_0xb9d9('0x13')][_0xb9d9('0x28')]=function(_0x26a480,_0x5dbb27){if(_0x26a480){this[_0xb9d9('0x23')](_0x26a480,!![]);}else{if(_0x5dbb27[_0xb9d9('0x29')]){try{var _0x1f8192=this[_0xb9d9('0x1')]['fetch'](_0x5dbb27,{'bodies':'','markSeen':!![]});_0x1f8192['on'](_0xb9d9('0x2a'),this[_0xb9d9('0x2b')][_0xb9d9('0xd')](this));_0x1f8192[_0xb9d9('0xe')](_0xb9d9('0x10'),this[_0xb9d9('0x2c')]['bind'](this));_0x1f8192['once'](_0xb9d9('0x26'),this['handleFetchEnd'][_0xb9d9('0xd')](this));}catch(_0x2b267b){logger[_0xb9d9('0x10')](_0x2b267b);}}else{this['imap'][_0xb9d9('0x2d')](!![],this[_0xb9d9('0x2e')][_0xb9d9('0xd')](this));}}};EmailImap[_0xb9d9('0x13')][_0xb9d9('0x2b')]=function(_0xffcf20,_0x3a38b8){_0xffcf20['on'](_0xb9d9('0x2f'),this[_0xb9d9('0x30')]['bind'](this));_0xffcf20['once']('attributes',this[_0xb9d9('0x31')][_0xb9d9('0xd')](this));_0xffcf20[_0xb9d9('0xe')](_0xb9d9('0x26'),this[_0xb9d9('0x32')][_0xb9d9('0xd')](this));};EmailImap['prototype']['handleMessageBody']=function(_0x492be2,_0x359a6f){simpleParser(_0x492be2,{'Iconv':Iconv},this[_0xb9d9('0x33')][_0xb9d9('0xd')](this));};EmailImap[_0xb9d9('0x13')][_0xb9d9('0x31')]=function(_0x1f351d){};EmailImap[_0xb9d9('0x13')][_0xb9d9('0x32')]=function(){};EmailImap[_0xb9d9('0x13')][_0xb9d9('0x33')]=function(_0xd8b9a2,_0x2ae9a4){if(_0xd8b9a2){logger[_0xb9d9('0x10')](_0xd8b9a2);}else{var _0x46d9a7=this;utils[_0xb9d9('0x34')](this[_0xb9d9('0xb')],_0x2ae9a4,function(_0x1b4e3e){_0x46d9a7[_0xb9d9('0x35')](_0xb9d9('0x8'),_0x1b4e3e);});}};EmailImap['prototype'][_0xb9d9('0x36')]=function(){this[_0xb9d9('0x1')]['closeBox'](!![],this['handleCloseBox'][_0xb9d9('0xd')](this));};EmailImap['prototype'][_0xb9d9('0x2c')]=function(_0x4c63e3){this['handleError'](_0x4c63e3);this[_0xb9d9('0x1')][_0xb9d9('0x2d')](!![],this[_0xb9d9('0x2e')][_0xb9d9('0xd')](this));};EmailImap[_0xb9d9('0x13')][_0xb9d9('0xf')]=function(){this[_0xb9d9('0x35')](_0xb9d9('0x26'));};EmailImap['prototype']['handleError']=function(_0x3f4b76,_0xb7c4ec){logger[_0xb9d9('0x10')]('handleError',this[_0xb9d9('0xb')][_0xb9d9('0x8')],JSON[_0xb9d9('0x37')](_0x3f4b76));var _0x22c923='';if(_0x3f4b76){if(_0x3f4b76[_0xb9d9('0x38')]){_0x22c923=_0x3f4b76[_0xb9d9('0x38')];}else{for(var _0x10b62e in _0x3f4b76){if(_0x3f4b76[_0xb9d9('0x39')](_0x10b62e)){_0x22c923+=_['upperFirst'](_0x10b62e)+':\x20'+_0x3f4b76[_0x10b62e]+'\x0a';}}}}if(_0xb7c4ec){this[_0xb9d9('0x1')][_0xb9d9('0x26')]();}else{this[_0xb9d9('0x35')](_0xb9d9('0x10'),_0x22c923);this[_0xb9d9('0x35')](_0xb9d9('0x26'));}};module[_0xb9d9('0x3a')]=EmailImap;
\ No newline at end of file
+var _0x9099=['fetch','message','handleFetchMessage','handleFetchError','end','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','account','stringify','textCode','hasOwnProperty','upperFirst','exports','path','imap','lodash','randomstring','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','INBOX','ready','handleReady','bind','once','handleEnd','error','handleError','connect','inherits','prototype','getAccount','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','required','getHost','anonymous@xcally.com','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length'];(function(_0x12b9ea,_0x58e480){var _0x165199=function(_0x237e6a){while(--_0x237e6a){_0x12b9ea['push'](_0x12b9ea['shift']());}};_0x165199(++_0x58e480);}(_0x9099,0x1ac));var _0x9909=function(_0x202c61,_0x3673e0){_0x202c61=_0x202c61-0x0;var _0x540691=_0x9099[_0x202c61];return _0x540691;};'use strict';var fs=require('fs');var path=require(_0x9909('0x0'));var util=require('util');var Imap=require(_0x9909('0x1'));var _=require(_0x9909('0x2'));var rs=require(_0x9909('0x3'));var simpleParser=require(_0x9909('0x4'))[_0x9909('0x5')];var Iconv=require(_0x9909('0x6'))[_0x9909('0x7')];var EventEmitter=require(_0x9909('0x8'))[_0x9909('0x9')];var utils=require(_0x9909('0xa'));var logger=require(_0x9909('0xb'))(_0x9909('0xc'));function EmailImap(_0x3b7391,_0x3dc2dd){this['mailbox']=_0x9909('0xd');this['account']=this['getAccount'](_0x3b7391,_0x3dc2dd);this['imap']=new Imap(this['account']);this[_0x9909('0x1')]['once'](_0x9909('0xe'),this[_0x9909('0xf')][_0x9909('0x10')](this));this['imap'][_0x9909('0x11')]('end',this[_0x9909('0x12')][_0x9909('0x10')](this));this[_0x9909('0x1')]['on'](_0x9909('0x13'),this[_0x9909('0x14')][_0x9909('0x10')](this));this[_0x9909('0x1')][_0x9909('0x15')]();}util[_0x9909('0x16')](EmailImap,EventEmitter);EmailImap[_0x9909('0x17')][_0x9909('0x18')]=function(_0x38c2e3,_0x4618eb){var _0x5699d8={'connTimeout':_0x38c2e3[_0x9909('0x19')]?_0x38c2e3['connTimeout']*0x3e8:0x2710,'authTimeout':_0x38c2e3[_0x9909('0x1a')]?_0x38c2e3['authTimeout']*0x3e8:0x1388};if(_[_0x9909('0x1b')](_0x38c2e3[_0x9909('0x1c')])){if(_0x38c2e3[_0x9909('0x1d')]){_0x5699d8['user']=_0x38c2e3[_0x9909('0x1e')];_0x5699d8[_0x9909('0x1f')]=_0x38c2e3[_0x9909('0x1f')];}_0x5699d8[_0x9909('0x20')]=_0x38c2e3[_0x9909('0x20')];_0x5699d8[_0x9909('0x21')]=_0x38c2e3[_0x9909('0x21')]||0x3e1;if(_0x38c2e3['tls']){_0x5699d8[_0x9909('0x22')]=!![];}else{_0x5699d8[_0x9909('0x22')]=![];_0x5699d8['autotls']=_0x9909('0x23');}}else{_0x5699d8[_0x9909('0x1e')]=_0x38c2e3[_0x9909('0x1e')];_0x5699d8[_0x9909('0x1f')]=_0x38c2e3[_0x9909('0x1f')];_0x5699d8[_0x9909('0x20')]=utils[_0x9909('0x24')](_0x38c2e3['service']);_0x5699d8[_0x9909('0x21')]=0x3e1;_0x5699d8[_0x9909('0x22')]=!![];}_0x5699d8['email']=_0x4618eb||_0x38c2e3['user']||_0x9909('0x25');return _0x5699d8;};EmailImap[_0x9909('0x17')][_0x9909('0xf')]=function(){this[_0x9909('0x1')][_0x9909('0x26')](this['mailbox'],![],this['handleOpenBox'][_0x9909('0x10')](this));};EmailImap[_0x9909('0x17')][_0x9909('0x27')]=function(_0x1c7ee5,_0x52be17){if(_0x1c7ee5){this[_0x9909('0x14')](_0x1c7ee5,!![]);}else{this[_0x9909('0x28')](_0x9909('0x29'),_0x52be17);this[_0x9909('0x2a')]();}};EmailImap['prototype'][_0x9909('0x2b')]=function(_0x22ff12){if(_0x22ff12){this[_0x9909('0x14')](_0x22ff12,!![]);}else{this[_0x9909('0x1')]['end']();}};EmailImap[_0x9909('0x17')][_0x9909('0x2a')]=function(){this[_0x9909('0x1')][_0x9909('0x2c')]([_0x9909('0x2d')],this[_0x9909('0x2e')][_0x9909('0x10')](this));};EmailImap['prototype'][_0x9909('0x2e')]=function(_0x3a3f4f,_0x87ac8a){if(_0x3a3f4f){this[_0x9909('0x14')](_0x3a3f4f,!![]);}else{if(_0x87ac8a[_0x9909('0x2f')]){try{var _0x519066=this[_0x9909('0x1')][_0x9909('0x30')](_0x87ac8a,{'bodies':'','markSeen':!![]});_0x519066['on'](_0x9909('0x31'),this[_0x9909('0x32')][_0x9909('0x10')](this));_0x519066[_0x9909('0x11')](_0x9909('0x13'),this[_0x9909('0x33')]['bind'](this));_0x519066['once'](_0x9909('0x34'),this[_0x9909('0x35')]['bind'](this));}catch(_0x3f218f){logger[_0x9909('0x13')](_0x3f218f);}}else{this[_0x9909('0x1')][_0x9909('0x36')](!![],this[_0x9909('0x2b')][_0x9909('0x10')](this));}}};EmailImap[_0x9909('0x17')]['handleFetchMessage']=function(_0x17a7bd,_0x2686f3){_0x17a7bd['on'](_0x9909('0x37'),this[_0x9909('0x38')][_0x9909('0x10')](this));_0x17a7bd['once'](_0x9909('0x39'),this[_0x9909('0x3a')]['bind'](this));_0x17a7bd[_0x9909('0x11')](_0x9909('0x34'),this[_0x9909('0x3b')][_0x9909('0x10')](this));};EmailImap[_0x9909('0x17')][_0x9909('0x38')]=function(_0x4e23ed,_0x21c1c8){simpleParser(_0x4e23ed,{'Iconv':Iconv},this[_0x9909('0x3c')][_0x9909('0x10')](this));};EmailImap[_0x9909('0x17')][_0x9909('0x3a')]=function(_0x1d1ad6){};EmailImap[_0x9909('0x17')][_0x9909('0x3b')]=function(){};EmailImap[_0x9909('0x17')][_0x9909('0x3c')]=function(_0x31fd11,_0x19d8b4){if(_0x31fd11){logger[_0x9909('0x13')](_0x31fd11);}else{var _0x3facb7=this;utils[_0x9909('0x3d')](this[_0x9909('0x3e')],_0x19d8b4,function(_0x42d63d){_0x3facb7[_0x9909('0x28')](_0x9909('0xc'),_0x42d63d);});}};EmailImap[_0x9909('0x17')][_0x9909('0x35')]=function(){this[_0x9909('0x1')][_0x9909('0x36')](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0x9909('0x17')]['handleFetchError']=function(_0x52724f){this[_0x9909('0x14')](_0x52724f);this[_0x9909('0x1')][_0x9909('0x36')](!![],this[_0x9909('0x2b')]['bind'](this));};EmailImap[_0x9909('0x17')][_0x9909('0x12')]=function(){this[_0x9909('0x28')]('end');};EmailImap[_0x9909('0x17')][_0x9909('0x14')]=function(_0x345ba0,_0x4b0a4c){logger[_0x9909('0x13')](_0x9909('0x14'),this[_0x9909('0x3e')][_0x9909('0xc')],JSON[_0x9909('0x3f')](_0x345ba0));var _0x856057='';if(_0x345ba0){if(_0x345ba0[_0x9909('0x40')]){_0x856057=_0x345ba0[_0x9909('0x40')];}else{for(var _0x4f88f4 in _0x345ba0){if(_0x345ba0[_0x9909('0x41')](_0x4f88f4)){_0x856057+=_[_0x9909('0x42')](_0x4f88f4)+':\x20'+_0x345ba0[_0x4f88f4]+'\x0a';}}}}if(_0x4b0a4c){this['imap'][_0x9909('0x34')]();}else{this[_0x9909('0x28')]('error',_0x856057);this['emit'](_0x9909('0x34'));}};module[_0x9909('0x43')]=EmailImap;
\ No newline at end of file
index 5692497..358bdfb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x300a=['bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail','verify','toString','exports','nodemailer'];(function(_0x552f5d,_0x231959){var _0x3be170=function(_0x516d38){while(--_0x516d38){_0x552f5d['push'](_0x552f5d['shift']());}};_0x3be170(++_0x231959);}(_0x300a,0xcb));var _0xa300=function(_0x255ac0,_0x3f6645){_0x255ac0=_0x255ac0-0x0;var _0x437bf1=_0x300a[_0x255ac0];return _0x437bf1;};'use strict';var nodemailer=require(_0xa300('0x0'));var BPromise=require(_0xa300('0x1'));var inlineBase64=require(_0xa300('0x2'));function EmailSmtp(){}EmailSmtp[_0xa300('0x3')][_0xa300('0x4')]=function(_0x54f975,_0x14b65a){return new BPromise(function(_0x20f678,_0x38e6a1){var _0x40b428=nodemailer[_0xa300('0x5')](_0x54f975);_0x40b428[_0xa300('0x6')](_0xa300('0x7'),inlineBase64());_0x40b428[_0xa300('0x8')](_0x14b65a,function(_0x492046,_0xa54412){if(_0x492046){_0x38e6a1(_0x492046['toString']());}else{_0x20f678(_0xa54412);}});});};EmailSmtp[_0xa300('0x3')]['verify']=function(_0x26d7da){return new BPromise(function(_0x5f2282,_0x187a2f){var _0xb3bcb3=nodemailer['createTransport'](_0x26d7da);_0xb3bcb3[_0xa300('0x9')](function(_0x5e13ea,_0x1512fb){if(_0x5e13ea){_0x187a2f(_0x5e13ea[_0xa300('0xa')]());}else{if(_0x1512fb){_0x5f2282(_0x1512fb);}else{_0x187a2f('Not\x20verifired');}}});});};module[_0xa300('0xb')]=EmailSmtp;
\ No newline at end of file
+var _0xe708=['bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail','toString','verify','Not\x20verifired','exports','nodemailer'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe708,0xc2));var _0x8e70=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0xe708[_0x307d86];return _0x361745;};'use strict';var nodemailer=require(_0x8e70('0x0'));var BPromise=require(_0x8e70('0x1'));var inlineBase64=require(_0x8e70('0x2'));function EmailSmtp(){}EmailSmtp[_0x8e70('0x3')][_0x8e70('0x4')]=function(_0x5de661,_0x4e6ac1){return new BPromise(function(_0x44135f,_0xc19112){var _0x2b3016=nodemailer[_0x8e70('0x5')](_0x5de661);_0x2b3016[_0x8e70('0x6')](_0x8e70('0x7'),inlineBase64());_0x2b3016[_0x8e70('0x8')](_0x4e6ac1,function(_0x12f500,_0x86c3bf){if(_0x12f500){_0xc19112(_0x12f500[_0x8e70('0x9')]());}else{_0x44135f(_0x86c3bf);}});});};EmailSmtp[_0x8e70('0x3')]['verify']=function(_0x4ab1da){return new BPromise(function(_0x51a102,_0x41c0a1){var _0x278582=nodemailer[_0x8e70('0x5')](_0x4ab1da);_0x278582[_0x8e70('0xa')](function(_0x21dfec,_0x52e5cb){if(_0x21dfec){_0x41c0a1(_0x21dfec[_0x8e70('0x9')]());}else{if(_0x52e5cb){_0x51a102(_0x52e5cb);}else{_0x41c0a1(_0x8e70('0xb'));}}});});};module[_0x8e70('0xc')]=EmailSmtp;
\ No newline at end of file
index 392f58b..5e488ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x404d=['getHost','gmail','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','@xcally.com','value','name','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','anonymous','generate','html','replace','includes','<img','attachments','forEach','_SRC','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>','body','textAsHtml','message','originTo','originCc','attach','type','attachment','attachment-','format','now','root','server/files/attachments/','writeFileSync','content','push','contentType','headerLines','Auto-Submitted:\x20auto-replied','line','isAutoreply','parser','from','subject','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','parseBuffer','BodyHTML','Attachments','Title','Data','<p>Empty\x20message</p>'];(function(_0x52d065,_0x31d24){var _0x49f7bc=function(_0x2f0966){while(--_0x2f0966){_0x52d065['push'](_0x52d065['shift']());}};_0x49f7bc(++_0x31d24);}(_0x404d,0x1e9));var _0xd404=function(_0x16a600,_0x49e711){_0x16a600=_0x16a600-0x0;var _0x39834c=_0x404d[_0x16a600];return _0x39834c;};'use strict';var _=require(_0xd404('0x0'));var moment=require(_0xd404('0x1'));var random=require(_0xd404('0x2'));var fs=require('fs');var path=require(_0xd404('0x3'));var util=require(_0xd404('0x4'));var tnef=require(_0xd404('0x5'));var logger=require(_0xd404('0x6'))(_0xd404('0x7'));var config=require(_0xd404('0x8'));function getAddress(_0x4b084c){var _0x10153c=_[_0xd404('0x9')](_0x4b084c['value']);return _0x10153c&&_0x10153c[_0xd404('0xa')]?_0x10153c[_0xd404('0xa')]:'anonymous'+random['generate'](0x6)+_0xd404('0xb');}function getFirstName(_0x3d7e8a){var _0x506b18=_['head'](_0x3d7e8a[_0xd404('0xc')]);if(_0x506b18&&_0x506b18[_0xd404('0xd')]){if(_0x506b18[_0xd404('0xd')]==_0x506b18[_0xd404('0xa')]){return _0x506b18['name']['substring'](0x0,_0x506b18[_0xd404('0xd')][_0xd404('0xe')]('@'));}var _0x569542=_0x506b18[_0xd404('0xd')][_0xd404('0xf')](/\s+/);return _0x569542[_0xd404('0x10')]>0x1?_0x569542[_0xd404('0x11')](0x0,-0x1)[_0xd404('0x12')]('\x20'):_0x506b18[_0xd404('0xd')];}return _0xd404('0x13');}function getLastName(_0x32f760){var _0x1b0dcd=_[_0xd404('0x9')](_0x32f760[_0xd404('0xc')]);if(_0x1b0dcd&&_0x1b0dcd[_0xd404('0xd')]){var _0x28d1e9=_0x1b0dcd[_0xd404('0xd')][_0xd404('0xf')](/\s+/);return _0x28d1e9[_0xd404('0x10')]>0x1?_0x28d1e9[_0xd404('0x14')]():'';}return'';}function getMails(_0xa4d1b2,_0xc5fe91){var _0x122813='';for(var _0x155186=0x0;_0x155186<_0xc5fe91['value'][_0xd404('0x10')];_0x155186+=0x1){if(_0xc5fe91[_0xd404('0xc')][_0x155186]['address']!==_0xa4d1b2){if(!_[_0xd404('0x15')](_0x122813)){_0x122813+=',';}_0x122813+=_0xc5fe91[_0xd404('0xc')][_0x155186]['name']||_0xc5fe91[_0xd404('0xc')][_0x155186][_0xd404('0xa')]||'';_0x122813+='\x20<';_0x122813+=_0xc5fe91[_0xd404('0xc')][_0x155186]['address']?_0xc5fe91[_0xd404('0xc')][_0x155186][_0xd404('0xa')]:_0xd404('0x16')+random[_0xd404('0x17')](0x6)+_0xd404('0xb');_0x122813+='>';}}return _0x122813;}function parseEmail(_0x3b67d4,_0x458f6e,_0x5c0264){if(_0x458f6e[_0xd404('0x18')]){var _0xcc7bf1=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0xcc7bf1['test'](_0x458f6e[_0xd404('0x18')])){_0x458f6e['html']=_0x458f6e['html'][_0xd404('0x19')](_0xcc7bf1,'');}if(_0x458f6e[_0xd404('0x18')][_0xd404('0x1a')](_0xd404('0x1b'))){var _0x4c00de=[];_0x458f6e[_0xd404('0x1c')][_0xd404('0x1d')](_0x13af69=>{_0x4c00de['push'](_0x13af69['filename']);});var _0x3e706a=/<img.*? _SRC(.*?)[^>]+>/g;var _0xaccaa8=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x2d7af8=_0x458f6e[_0xd404('0x18')][_0xd404('0x19')](_0xaccaa8,_0xd404('0x1e'));var _0x256277=_0x2d7af8[_0xd404('0x19')](_0x3e706a,'_IMG');for(let _0x47d0b4=0x0;_0x47d0b4<_0x4c00de[_0xd404('0x10')];_0x47d0b4++){var _0x4a7dfc=_0x256277[_0xd404('0x19')]('_IMG',_0xd404('0x1f')+_0x4c00de[_0x47d0b4]+_0xd404('0x20'));_0x256277=_0x4a7dfc;}_0x458f6e[_0xd404('0x18')]=_0x256277;}_0x5c0264[_0xd404('0x21')]=_0x458f6e[_0xd404('0x18')];}else{_0x5c0264[_0xd404('0x21')]=_0x458f6e[_0xd404('0x22')];}if(_0x5c0264['body']){_0x5c0264['body']=_0x5c0264[_0xd404('0x21')]['replace'](/<a\s+/gi,'<a\x20target=\x22_blank\x22\x20');}if(_0x458f6e['to']){_0x5c0264[_0xd404('0x23')][_0xd404('0x24')]=getMails(null,_0x458f6e['to']);var _0x311a5a=getMails(_0x3b67d4['email'],_0x458f6e['to']);if(!_[_0xd404('0x15')](_0x311a5a)){_0x5c0264['message']['cc']+=_0x311a5a;}}if(_0x458f6e['cc']){_0x5c0264[_0xd404('0x23')][_0xd404('0x25')]=getMails(null,_0x458f6e['cc']);var _0x52a23b=getMails(_0x3b67d4[_0xd404('0x7')],_0x458f6e['cc']);if(!_[_0xd404('0x15')](_0x52a23b)){if(!_[_0xd404('0x15')](_0x5c0264[_0xd404('0x23')]['cc'])){_0x5c0264[_0xd404('0x23')]['cc']+=',';}_0x5c0264['message']['cc']+=_0x52a23b;}}if(!_[_0xd404('0x1a')](_0x5c0264[_0xd404('0x23')][_0xd404('0x24')],_0x3b67d4['email'])&&!_[_0xd404('0x1a')](_0x5c0264[_0xd404('0x23')][_0xd404('0x25')],_0x3b67d4[_0xd404('0x7')])){_0x5c0264['message']['bcc']=_0x3b67d4[_0xd404('0x7')];}if(_0x458f6e[_0xd404('0x1c')]&&_0x458f6e[_0xd404('0x1c')][_0xd404('0x10')]){_0x5c0264[_0xd404('0x23')][_0xd404('0x26')]=_0x458f6e['attachments'][_0xd404('0x10')];for(var _0xd143f3=0x0,_0x1f5675,_0x560a4f,_0xc0a080;_0xd143f3<_0x458f6e[_0xd404('0x1c')][_0xd404('0x10')];_0xd143f3+=0x1){if(_0x458f6e['attachments'][_0xd143f3][_0xd404('0x27')]===_0xd404('0x28')){_0xc0a080=_0x458f6e[_0xd404('0x1c')][_0xd143f3]['filename']||_0xd404('0x29')+_0xd143f3;_0x1f5675=util[_0xd404('0x2a')]('%s-%s',Date[_0xd404('0x2b')](),_0xc0a080);_0x560a4f=path[_0xd404('0x12')](config[_0xd404('0x2c')],_0xd404('0x2d'),_0x1f5675);fs[_0xd404('0x2e')](_0x560a4f,_0x458f6e[_0xd404('0x1c')][_0xd143f3][_0xd404('0x2f')]);_0x5c0264[_0xd404('0x23')]['attachments'][_0xd404('0x30')]({'name':_0xc0a080,'basename':_0x1f5675,'type':_0x458f6e['attachments'][_0xd143f3][_0xd404('0x31')],'filepath':_0x560a4f});}}}if(_0x458f6e[_0xd404('0x32')]&&_0x458f6e['headerLines'][_0xd404('0x10')]>0x0){var _0x539f0f=[_0xd404('0x33'),'X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply'];for(var _0x35494f=0x0;_0x35494f<_0x458f6e[_0xd404('0x32')][_0xd404('0x10')];_0x35494f++){var _0x392afa=_['indexOf'](_0x539f0f,_0x458f6e['headerLines'][_0x35494f][_0xd404('0x34')]);if(_0x392afa>=0x0){_0x5c0264[_0xd404('0x35')]=!![];}}}return _0x5c0264;}exports[_0xd404('0x36')]=function(_0x108cc3,_0x199d66,_0x2c7fcc){var _0x1c0d91={'from':getAddress(_0x199d66['from']),'firstName':getFirstName(_0x199d66[_0xd404('0x37')]),'lastName':getLastName(_0x199d66['from']),'mapKey':_0xd404('0x7'),'message':{'from':getMails(_0x108cc3['email'],_0x199d66[_0xd404('0x37')]),'to':_0x108cc3[_0xd404('0x7')],'cc':'','subject':_0x199d66[_0xd404('0x38')]||'','messageId':_0x199d66['messageId'],'inReplyTo':_0x199d66[_0xd404('0x39')],'sentAt':moment(_0x199d66[_0xd404('0x3a')])[_0xd404('0x2a')](_0xd404('0x3b')),'attach':![],'attachments':[]}};if(!_0x199d66['html']&&!_0x199d66[_0xd404('0x22')]){var _0x1ecdda=_[_0xd404('0x3c')](_0x199d66[_0xd404('0x1c')],{'contentType':_0xd404('0x3d')});if(_0x1ecdda[_0xd404('0x10')]){logger[_0xd404('0x3e')](util[_0xd404('0x2a')](_0xd404('0x3f'),_0x199d66[_0xd404('0x40')]));tnef[_0xd404('0x41')](_['first'](_0x1ecdda)[_0xd404('0x2f')],function(_0x202bd6,_0x3c7213){if(_0x3c7213){_0x199d66[_0xd404('0x18')]=_0x3c7213[_0xd404('0x42')]||'<p>Empty\x20message</p>';if(_0x3c7213[_0xd404('0x43')]){for(var _0x30cc1c=0x0;_0x30cc1c<_0x3c7213['Attachments'][_0xd404('0x10')];_0x30cc1c++){var _0xb8bda4=_0x3c7213[_0xd404('0x43')][_0x30cc1c];_0x1c0d91[_0xd404('0x23')][_0xd404('0x1c')][_0xd404('0x30')]({'filename':_0xb8bda4[_0xd404('0x44')],'content':Buffer[_0xd404('0x37')](_0xb8bda4[_0xd404('0x45')])});}}}_0x2c7fcc(parseEmail(_0x108cc3,_0x199d66,_0x1c0d91));});}else{_0x199d66['html']=_0xd404('0x46');_0x2c7fcc(parseEmail(_0x108cc3,_0x199d66,_0x1c0d91));}}else{_0x2c7fcc(parseEmail(_0x108cc3,_0x199d66,_0x1c0d91));}};exports[_0xd404('0x47')]=function(_0x5c7c68){switch(_0x5c7c68){case _0xd404('0x48'):return _0xd404('0x49');case _0xd404('0x4a'):return'imap.mail.yahoo.com';case _0xd404('0x4b'):return _0xd404('0x4c');case _0xd404('0x4d'):return _0xd404('0x4e');}return _0xd404('0x4f');};
\ No newline at end of file
+var _0x7031=['attachments','attachment','attachment-','format','%s-%s','now','root','server/files/attachments/','writeFileSync','content','contentType','headerLines','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','parser','from','subject','messageId','inReplyTo','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','<p>Empty\x20message</p>','Attachments','Title','Data','getHost','gmail','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','lodash','moment','path','util','../../../config/logger','email','value','address','anonymous','generate','head','name','substring','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','html','replace','includes','<img','forEach','push','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','originTo','message','originCc','bcc'];(function(_0x448f8,_0x2aa1d7){var _0xa73126=function(_0x1fcafa){while(--_0x1fcafa){_0x448f8['push'](_0x448f8['shift']());}};_0xa73126(++_0x2aa1d7);}(_0x7031,0x19a));var _0x1703=function(_0x10371c,_0x4b83a2){_0x10371c=_0x10371c-0x0;var _0x57e601=_0x7031[_0x10371c];return _0x57e601;};'use strict';var _=require(_0x1703('0x0'));var moment=require(_0x1703('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x1703('0x2'));var util=require(_0x1703('0x3'));var tnef=require('node-tnef');var logger=require(_0x1703('0x4'))(_0x1703('0x5'));var config=require('../../../config/environment');function getAddress(_0x1ad53b){var _0x438115=_['head'](_0x1ad53b[_0x1703('0x6')]);return _0x438115&&_0x438115['address']?_0x438115[_0x1703('0x7')]:_0x1703('0x8')+random[_0x1703('0x9')](0x6)+'@xcally.com';}function getFirstName(_0x1cba9a){var _0x3acf9c=_[_0x1703('0xa')](_0x1cba9a['value']);if(_0x3acf9c&&_0x3acf9c[_0x1703('0xb')]){if(_0x3acf9c[_0x1703('0xb')]==_0x3acf9c[_0x1703('0x7')]){return _0x3acf9c[_0x1703('0xb')][_0x1703('0xc')](0x0,_0x3acf9c[_0x1703('0xb')][_0x1703('0xd')]('@'));}var _0xf7acd4=_0x3acf9c[_0x1703('0xb')][_0x1703('0xe')](/\s+/);return _0xf7acd4[_0x1703('0xf')]>0x1?_0xf7acd4[_0x1703('0x10')](0x0,-0x1)[_0x1703('0x11')]('\x20'):_0x3acf9c[_0x1703('0xb')];}return _0x1703('0x12');}function getLastName(_0x1a3ff1){var _0x3de192=_['head'](_0x1a3ff1['value']);if(_0x3de192&&_0x3de192[_0x1703('0xb')]){var _0x467d31=_0x3de192['name'][_0x1703('0xe')](/\s+/);return _0x467d31[_0x1703('0xf')]>0x1?_0x467d31[_0x1703('0x13')]():'';}return'';}function getMails(_0x4c41a3,_0x404ae5){var _0x290ce1='';for(var _0x4d53d1=0x0;_0x4d53d1<_0x404ae5[_0x1703('0x6')][_0x1703('0xf')];_0x4d53d1+=0x1){if(_0x404ae5[_0x1703('0x6')][_0x4d53d1][_0x1703('0x7')]!==_0x4c41a3){if(!_[_0x1703('0x14')](_0x290ce1)){_0x290ce1+=',';}_0x290ce1+=_0x404ae5[_0x1703('0x6')][_0x4d53d1][_0x1703('0xb')]||_0x404ae5['value'][_0x4d53d1]['address']||'';_0x290ce1+='\x20<';_0x290ce1+=_0x404ae5['value'][_0x4d53d1][_0x1703('0x7')]?_0x404ae5['value'][_0x4d53d1][_0x1703('0x7')]:_0x1703('0x8')+random[_0x1703('0x9')](0x6)+'@xcally.com';_0x290ce1+='>';}}return _0x290ce1;}function parseEmail(_0x53f996,_0x3de8a8,_0x4fdf8e){if(_0x3de8a8[_0x1703('0x15')]){var _0x2bf640=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x2bf640['test'](_0x3de8a8[_0x1703('0x15')])){_0x3de8a8['html']=_0x3de8a8[_0x1703('0x15')][_0x1703('0x16')](_0x2bf640,'');}if(_0x3de8a8[_0x1703('0x15')][_0x1703('0x17')](_0x1703('0x18'))){var _0x49d7ab=[];_0x3de8a8['attachments'][_0x1703('0x19')](_0xc49ec=>{_0x49d7ab[_0x1703('0x1a')](_0xc49ec['filename']);});var _0x3c23ea=/<img.*? _SRC(.*?)[^>]+>/g;var _0x2a6184=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x2be6a7=_0x3de8a8[_0x1703('0x15')]['replace'](_0x2a6184,'_SRC');var _0x38afcf=_0x2be6a7[_0x1703('0x16')](_0x3c23ea,'_IMG');for(let _0xa68518=0x0;_0xa68518<_0x49d7ab[_0x1703('0xf')];_0xa68518++){var _0x2adee6=_0x38afcf[_0x1703('0x16')]('_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20'+_0x49d7ab[_0xa68518]+'\x20]</span>');_0x38afcf=_0x2adee6;}_0x3de8a8[_0x1703('0x15')]=_0x38afcf;}_0x4fdf8e[_0x1703('0x1b')]=_0x3de8a8[_0x1703('0x15')];}else{_0x4fdf8e['body']=_0x3de8a8[_0x1703('0x1c')];}if(_0x4fdf8e[_0x1703('0x1b')]){_0x4fdf8e[_0x1703('0x1b')]=_0x4fdf8e[_0x1703('0x1b')][_0x1703('0x16')](/<a\s+/gi,_0x1703('0x1d'));}if(_0x3de8a8['to']){_0x4fdf8e['message'][_0x1703('0x1e')]=getMails(null,_0x3de8a8['to']);var _0x2397d5=getMails(_0x53f996[_0x1703('0x5')],_0x3de8a8['to']);if(!_[_0x1703('0x14')](_0x2397d5)){_0x4fdf8e['message']['cc']+=_0x2397d5;}}if(_0x3de8a8['cc']){_0x4fdf8e[_0x1703('0x1f')]['originCc']=getMails(null,_0x3de8a8['cc']);var _0x2d926a=getMails(_0x53f996[_0x1703('0x5')],_0x3de8a8['cc']);if(!_['isEmpty'](_0x2d926a)){if(!_['isEmpty'](_0x4fdf8e[_0x1703('0x1f')]['cc'])){_0x4fdf8e[_0x1703('0x1f')]['cc']+=',';}_0x4fdf8e['message']['cc']+=_0x2d926a;}}if(!_[_0x1703('0x17')](_0x4fdf8e[_0x1703('0x1f')][_0x1703('0x1e')],_0x53f996[_0x1703('0x5')])&&!_['includes'](_0x4fdf8e['message'][_0x1703('0x20')],_0x53f996[_0x1703('0x5')])){_0x4fdf8e[_0x1703('0x1f')][_0x1703('0x21')]=_0x53f996[_0x1703('0x5')];}if(_0x3de8a8[_0x1703('0x22')]&&_0x3de8a8[_0x1703('0x22')][_0x1703('0xf')]){_0x4fdf8e[_0x1703('0x1f')]['attach']=_0x3de8a8[_0x1703('0x22')]['length'];for(var _0x357b43=0x0,_0x3c11c1,_0x962cc2,_0x29f48b;_0x357b43<_0x3de8a8[_0x1703('0x22')][_0x1703('0xf')];_0x357b43+=0x1){if(_0x3de8a8['attachments'][_0x357b43]['type']===_0x1703('0x23')){_0x29f48b=_0x3de8a8[_0x1703('0x22')][_0x357b43]['filename']||_0x1703('0x24')+_0x357b43;_0x3c11c1=util[_0x1703('0x25')](_0x1703('0x26'),Date[_0x1703('0x27')](),_0x29f48b);_0x962cc2=path[_0x1703('0x11')](config[_0x1703('0x28')],_0x1703('0x29'),_0x3c11c1);fs[_0x1703('0x2a')](_0x962cc2,_0x3de8a8[_0x1703('0x22')][_0x357b43][_0x1703('0x2b')]);_0x4fdf8e[_0x1703('0x1f')][_0x1703('0x22')][_0x1703('0x1a')]({'name':_0x29f48b,'basename':_0x3c11c1,'type':_0x3de8a8[_0x1703('0x22')][_0x357b43][_0x1703('0x2c')],'filepath':_0x962cc2});}}}if(_0x3de8a8[_0x1703('0x2d')]&&_0x3de8a8[_0x1703('0x2d')]['length']>0x0){var _0x4f3dc6=['Auto-Submitted:\x20auto-replied',_0x1703('0x2e'),_0x1703('0x2f')];for(var _0x13e315=0x0;_0x13e315<_0x3de8a8['headerLines'][_0x1703('0xf')];_0x13e315++){var _0x31644e=_[_0x1703('0xd')](_0x4f3dc6,_0x3de8a8['headerLines'][_0x13e315][_0x1703('0x30')]);if(_0x31644e>=0x0){_0x4fdf8e[_0x1703('0x31')]=!![];}}}return _0x4fdf8e;}exports[_0x1703('0x32')]=function(_0x320723,_0x34b455,_0x3ae54e){var _0x48e424={'from':getAddress(_0x34b455['from']),'firstName':getFirstName(_0x34b455[_0x1703('0x33')]),'lastName':getLastName(_0x34b455['from']),'mapKey':_0x1703('0x5'),'message':{'from':getMails(_0x320723[_0x1703('0x5')],_0x34b455[_0x1703('0x33')]),'to':_0x320723[_0x1703('0x5')],'cc':'','subject':_0x34b455[_0x1703('0x34')]||'','messageId':_0x34b455[_0x1703('0x35')],'inReplyTo':_0x34b455[_0x1703('0x36')],'sentAt':moment(_0x34b455['date'])[_0x1703('0x25')](_0x1703('0x37')),'attach':![],'attachments':[]}};if(!_0x34b455[_0x1703('0x15')]&&!_0x34b455[_0x1703('0x1c')]){var _0x1f05ef=_[_0x1703('0x38')](_0x34b455['attachments'],{'contentType':_0x1703('0x39')});if(_0x1f05ef[_0x1703('0xf')]){logger['info'](util[_0x1703('0x25')](_0x1703('0x3a'),_0x34b455[_0x1703('0x35')]));tnef[_0x1703('0x3b')](_[_0x1703('0x3c')](_0x1f05ef)[_0x1703('0x2b')],function(_0x590ce3,_0x76ebd4){if(_0x76ebd4){_0x34b455['html']=_0x76ebd4[_0x1703('0x3d')]||_0x1703('0x3e');if(_0x76ebd4[_0x1703('0x3f')]){for(var _0x55d96f=0x0;_0x55d96f<_0x76ebd4['Attachments']['length'];_0x55d96f++){var _0x425f68=_0x76ebd4[_0x1703('0x3f')][_0x55d96f];_0x48e424[_0x1703('0x1f')]['attachments'][_0x1703('0x1a')]({'filename':_0x425f68[_0x1703('0x40')],'content':Buffer[_0x1703('0x33')](_0x425f68[_0x1703('0x41')])});}}}_0x3ae54e(parseEmail(_0x320723,_0x34b455,_0x48e424));});}else{_0x34b455[_0x1703('0x15')]=_0x1703('0x3e');_0x3ae54e(parseEmail(_0x320723,_0x34b455,_0x48e424));}}else{_0x3ae54e(parseEmail(_0x320723,_0x34b455,_0x48e424));}};exports[_0x1703('0x42')]=function(_0xf23be8){switch(_0xf23be8){case _0x1703('0x43'):return'imap.gmail.com';case _0x1703('0x44'):return _0x1703('0x45');case _0x1703('0x46'):return _0x1703('0x47');case _0x1703('0x48'):return _0x1703('0x49');}return'127.0.0.1';};
\ No newline at end of file
index 6e8e987..b80e77e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6758=['exports','lodash','name','Service','SERV','active','Imap'];(function(_0x41c01c,_0xe3f555){var _0x1a3c03=function(_0x35cafa){while(--_0x35cafa){_0x41c01c['push'](_0x41c01c['shift']());}};_0x1a3c03(++_0xe3f555);}(_0x6758,0x7f));var _0x8675=function(_0x27cb07,_0x2ec9be){_0x27cb07=_0x27cb07-0x0;var _0x411b3b=_0x6758[_0x27cb07];return _0x411b3b;};'use strict';var _=require(_0x8675('0x0'));function MailAccount(_0xad8d57){this['id']=_0xad8d57['id']||0x0;this[_0x8675('0x1')]=_0xad8d57[_0x8675('0x1')]||_0x8675('0x2');this['key']=_0xad8d57['key']||_0x8675('0x3');this[_0x8675('0x4')]=_0xad8d57['active']||![];this[_0x8675('0x5')]=_0xad8d57[_0x8675('0x5')]||[];this['Smtp']=_0xad8d57['Smtp']||[];}module[_0x8675('0x6')]=MailAccount;
\ No newline at end of file
+var _0x619e=['key','SERV','active','Imap','Smtp','exports','name'];(function(_0x48530e,_0x14a74a){var _0x21ee5d=function(_0x4fd7ca){while(--_0x4fd7ca){_0x48530e['push'](_0x48530e['shift']());}};_0x21ee5d(++_0x14a74a);}(_0x619e,0x180));var _0xe619=function(_0x593f13,_0x4301b0){_0x593f13=_0x593f13-0x0;var _0x5e702c=_0x619e[_0x593f13];return _0x5e702c;};'use strict';var _=require('lodash');function MailAccount(_0x4b2c1e){this['id']=_0x4b2c1e['id']||0x0;this[_0xe619('0x0')]=_0x4b2c1e[_0xe619('0x0')]||'Service';this[_0xe619('0x1')]=_0x4b2c1e[_0xe619('0x1')]||_0xe619('0x2');this[_0xe619('0x3')]=_0x4b2c1e['active']||![];this[_0xe619('0x4')]=_0x4b2c1e[_0xe619('0x4')]||[];this[_0xe619('0x5')]=_0x4b2c1e['Smtp']||[];}module[_0xe619('0x6')]=MailAccount;
\ No newline at end of file
index c5b78cc..c194dfa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9466=['length','isUndefined','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','mergeFromDatabase','initMailAccounts'];(function(_0x40657d,_0x4d0cbd){var _0x48baa3=function(_0x4b6107){while(--_0x4b6107){_0x40657d['push'](_0x40657d['shift']());}};_0x48baa3(++_0x4d0cbd);}(_0x9466,0x92));var _0x6946=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x9466[_0x36884e];return _0x1cc367;};'use strict';var _=require(_0x6946('0x0'));var MailAccount=require(_0x6946('0x1'));var Realtime=function(){this[_0x6946('0x2')]={};};function freeIsNotKey(_0x35f2c3,_0xea55a5,_0x128d12){var _0x52d0da=_[_0x6946('0x3')](_0x35f2c3,function(_0x33540f,_0x42ee17){return _0x33540f[_0x128d12];});for(var _0x37ff0a in _0xea55a5){if(_0xea55a5[_0x6946('0x4')](_0x37ff0a)){if(!_0x52d0da[_0x37ff0a]){delete _0xea55a5[_0x37ff0a];}}}}Realtime['prototype'][_0x6946('0x5')]=function(_0x4b32e4,_0x2c8d2a){for(var _0x219470 in _0x2c8d2a){if(_0x4b32e4[_0x6946('0x4')](_0x219470)){_0x4b32e4[_0x219470]=_0x2c8d2a[_0x219470];}}};Realtime['prototype'][_0x6946('0x6')]=function(){var _0x436557=this;return function(_0x27069d){if(_0x27069d){freeIsNotKey(_0x27069d,_0x436557[_0x6946('0x2')],'id');for(var _0x26f732=0x0,_0x3e7765={},_0x93897e={};_0x26f732<_0x27069d[_0x6946('0x7')];_0x26f732+=0x1){_0x3e7765=_0x27069d[_0x26f732];if(_[_0x6946('0x8')](_0x436557[_0x6946('0x2')][_0x3e7765['id']])){_0x436557[_0x6946('0x2')][_0x3e7765['id']]=new MailAccount(_0x3e7765);}else{_['merge'](_0x436557[_0x6946('0x2')][_0x3e7765['id']],_0x3e7765);}}}return _0x436557[_0x6946('0x2')];};};module['exports']=Realtime;
\ No newline at end of file
+var _0xc9ed=['isUndefined','exports','lodash','mailAccounts','mapKeys','hasOwnProperty','prototype','initMailAccounts','length'];(function(_0x2c9b79,_0x7cf58b){var _0x265032=function(_0x188a92){while(--_0x188a92){_0x2c9b79['push'](_0x2c9b79['shift']());}};_0x265032(++_0x7cf58b);}(_0xc9ed,0x158));var _0xdc9e=function(_0x590649,_0x28f93d){_0x590649=_0x590649-0x0;var _0x4e1806=_0xc9ed[_0x590649];return _0x4e1806;};'use strict';var _=require(_0xdc9e('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0xdc9e('0x1')]={};};function freeIsNotKey(_0x205be8,_0x323bb4,_0xcf7aa7){var _0x240f63=_[_0xdc9e('0x2')](_0x205be8,function(_0x437c6c,_0x4dcc39){return _0x437c6c[_0xcf7aa7];});for(var _0x337fab in _0x323bb4){if(_0x323bb4[_0xdc9e('0x3')](_0x337fab)){if(!_0x240f63[_0x337fab]){delete _0x323bb4[_0x337fab];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x3f9202,_0x3825a3){for(var _0x33c850 in _0x3825a3){if(_0x3f9202[_0xdc9e('0x3')](_0x33c850)){_0x3f9202[_0x33c850]=_0x3825a3[_0x33c850];}}};Realtime[_0xdc9e('0x4')][_0xdc9e('0x5')]=function(){var _0x53be04=this;return function(_0xb7eb6b){if(_0xb7eb6b){freeIsNotKey(_0xb7eb6b,_0x53be04[_0xdc9e('0x1')],'id');for(var _0x303744=0x0,_0x36d375={},_0x539242={};_0x303744<_0xb7eb6b[_0xdc9e('0x6')];_0x303744+=0x1){_0x36d375=_0xb7eb6b[_0x303744];if(_[_0xdc9e('0x7')](_0x53be04[_0xdc9e('0x1')][_0x36d375['id']])){_0x53be04[_0xdc9e('0x1')][_0x36d375['id']]=new MailAccount(_0x36d375);}else{_['merge'](_0x53be04[_0xdc9e('0x1')][_0x36d375['id']],_0x36d375);}}}return _0x53be04['mailAccounts'];};};module[_0xdc9e('0x8')]=Realtime;
\ No newline at end of file
index 87fb3c1..7de4302 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd48e=['ListId','MailServerIn','Imap','MailServerOut','getMailAccount','notify','NotifyMailAccount','getMailAccounts','Request','GetMailAccount','name','service','active','key'];(function(_0x47ce46,_0x4f2fa8){var _0x16881c=function(_0x57873b){while(--_0x57873b){_0x47ce46['push'](_0x47ce46['shift']());}};_0x16881c(++_0x4f2fa8);}(_0xd48e,0x93));var _0xed48=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0xd48e[_0x1a9204];return _0x17ca68;};'use strict';var client=require('../client');exports[_0xed48('0x0')]=function(){return function(){return client[_0xed48('0x1')](_0xed48('0x2'),{'options':{'attributes':['id',_0xed48('0x3'),_0xed48('0x4'),'email',_0xed48('0x5'),_0xed48('0x6'),_0xed48('0x7'),'TemplateId'],'raw':![],'include':[{'model':_0xed48('0x8'),'as':_0xed48('0x9')},{'model':_0xed48('0xa'),'as':'Smtp'}]},'log':_0xed48('0xb')});};};exports[_0xed48('0xc')]=function(_0x52a5e2,_0x5f0f1b){return client['Request'](_0xed48('0xd'),{'account':{'id':_0x52a5e2},'body':_0x5f0f1b,'log':_0xed48('0xd')});};
\ No newline at end of file
+var _0x7f7e=['getMailAccount','notify','NotifyMailAccount','../client','Request','GetMailAccount','name','email','key','ListId','Imap','MailServerOut','Smtp'];(function(_0x994e65,_0x3c7807){var _0x1773d1=function(_0x15d7c2){while(--_0x15d7c2){_0x994e65['push'](_0x994e65['shift']());}};_0x1773d1(++_0x3c7807);}(_0x7f7e,0xc6));var _0xe7f7=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x7f7e[_0x46698a];return _0x356db0;};'use strict';var client=require(_0xe7f7('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0xe7f7('0x1')](_0xe7f7('0x2'),{'options':{'attributes':['id',_0xe7f7('0x3'),'service',_0xe7f7('0x4'),'active',_0xe7f7('0x5'),_0xe7f7('0x6'),'TemplateId'],'raw':![],'include':[{'model':'MailServerIn','as':_0xe7f7('0x7')},{'model':_0xe7f7('0x8'),'as':_0xe7f7('0x9')}]},'log':_0xe7f7('0xa')});};};exports[_0xe7f7('0xb')]=function(_0x4f7cbe,_0x1edbe6){return client[_0xe7f7('0x1')]('NotifyMailAccount',{'account':{'id':_0x4f7cbe},'body':_0x1edbe6,'log':_0xe7f7('0xc')});};
\ No newline at end of file
index ff3cd8a..2b80f19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d4e=['../client','getSettings','Request','ShowSetting','GetSettings'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x6d4e,0x109));var _0xe6d4=function(_0x35b7d4,_0x5a5c43){_0x35b7d4=_0x35b7d4-0x0;var _0x4e8cee=_0x6d4e[_0x35b7d4];return _0x4e8cee;};'use strict';var client=require(_0xe6d4('0x0'));exports[_0xe6d4('0x1')]=function(){return client[_0xe6d4('0x2')](_0xe6d4('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0xe6d4('0x4')});};
\ No newline at end of file
+var _0x6944=['ShowSetting','../client','getSettings'];(function(_0x3dcb8d,_0x3f9a35){var _0x3715f5=function(_0x440612){while(--_0x440612){_0x3dcb8d['push'](_0x3dcb8d['shift']());}};_0x3715f5(++_0x3f9a35);}(_0x6944,0x169));var _0x4694=function(_0x54d79f,_0x137980){_0x54d79f=_0x54d79f-0x0;var _0x4b6772=_0x6944[_0x54d79f];return _0x4b6772;};'use strict';var client=require(_0x4694('0x0'));exports[_0x4694('0x1')]=function(){return client['Request'](_0x4694('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':'GetSettings'});};
\ No newline at end of file
index 64bd505..6f30024 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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 91bb9e3..79e678f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x626a=['default','../../routes','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','ioredis','../../config/environment','timeout','listen','port','socket.io','polling','redis','defaults','../../config/triggers'];(function(_0x27d09e,_0x395ecb){var _0x43ee7c=function(_0x3ce2ce){while(--_0x3ce2ce){_0x27d09e['push'](_0x27d09e['shift']());}};_0x43ee7c(++_0x395ecb);}(_0x626a,0x1ce));var _0xa626=function(_0x135f09,_0x1adc3b){_0x135f09=_0x135f09-0x0;var _0x509edf=_0x626a[_0x135f09];return _0x509edf;};'use strict';var _=require(_0xa626('0x0'));var http=require(_0xa626('0x1'));var express=require(_0xa626('0x2'));var sticky=require('sticky-session');var Redis=require(_0xa626('0x3'));var config=require(_0xa626('0x4'));var app=express();var server=http['createServer'](app);server[_0xa626('0x5')]=0xdbba0;if(sticky[_0xa626('0x6')](server,config[_0xa626('0x7')])){var socketio=require(_0xa626('0x8'))(server,{'transports':['websocket',_0xa626('0x9')]});config[_0xa626('0xa')]=_[_0xa626('0xb')](config['redis'],{'host':'localhost','port':0x18eb});socketio['adapter'](require('socket.io-redis')({'pubClient':new Redis(config[_0xa626('0xa')]),'subClient':new Redis(config[_0xa626('0xa')])}));require(_0xa626('0xc'))[_0xa626('0xd')]();require('../../config/socketio')[_0xa626('0xd')](socketio);require('../../config/express')[_0xa626('0xd')](app);require(_0xa626('0xe'))['default'](app);}else{server['once'](_0xa626('0xf'),function(){console[_0xa626('0x10')](_0xa626('0x11'),config[_0xa626('0x7')]);});}exports=module[_0xa626('0x12')]=app;
\ No newline at end of file
+var _0xdae5=['timeout','listen','websocket','defaults','redis','localhost','adapter','socket.io-redis','../../config/triggers','../../config/socketio','default','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','lodash','express','sticky-session','ioredis'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0xdae5,0x16c));var _0x5dae=function(_0x3900da,_0x3b01e8){_0x3900da=_0x3900da-0x0;var _0x357178=_0xdae5[_0x3900da];return _0x357178;};'use strict';var _=require(_0x5dae('0x0'));var http=require('http');var express=require(_0x5dae('0x1'));var sticky=require(_0x5dae('0x2'));var Redis=require(_0x5dae('0x3'));var config=require('../../config/environment');var app=express();var server=http['createServer'](app);server[_0x5dae('0x4')]=0xdbba0;if(sticky[_0x5dae('0x5')](server,config['port'])){var socketio=require('socket.io')(server,{'transports':[_0x5dae('0x6'),'polling']});config['redis']=_[_0x5dae('0x7')](config[_0x5dae('0x8')],{'host':_0x5dae('0x9'),'port':0x18eb});socketio[_0x5dae('0xa')](require(_0x5dae('0xb'))({'pubClient':new Redis(config[_0x5dae('0x8')]),'subClient':new Redis(config['redis'])}));require(_0x5dae('0xc'))['default']();require(_0x5dae('0xd'))[_0x5dae('0xe')](socketio);require(_0x5dae('0xf'))[_0x5dae('0xe')](app);require(_0x5dae('0x10'))[_0x5dae('0xe')](app);}else{server[_0x5dae('0x11')](_0x5dae('0x12'),function(){console[_0x5dae('0x13')](_0x5dae('0x14'),config[_0x5dae('0x15')]);});}exports=module[_0x5dae('0x16')]=app;
\ No newline at end of file
index 6b07708..fdd010f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdac2=['debug','rpc','error','result','catch','exports','bluebird','../../config/logger','routing','client'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0xdac2,0xd8));var _0x2dac=function(_0x42f0d1,_0x45fe4a){_0x42f0d1=_0x42f0d1-0x0;var _0x43f981=_0xdac2[_0x42f0d1];return _0x43f981;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x2dac('0x0'));var logger=require(_0x2dac('0x1'))(_0x2dac('0x2'));var client=jayson[_0x2dac('0x3')]['http']({'port':0x2329});client['Request']=function(_0x156ec8,_0x4c5b94){return new BPromise(function(_0x1ed9d9,_0x574fc9){return client['request'](_0x156ec8,_0x4c5b94)['then'](function(_0x1a0652){logger[_0x2dac('0x4')](_0x2dac('0x5'),_0x2dac('0x2'),_0x156ec8,_0x4c5b94,_0x1a0652);if(_0x1a0652[_0x2dac('0x6')]){logger[_0x2dac('0x6')](_0x2dac('0x5'),_0x2dac('0x2'),_0x156ec8,_0x1a0652[_0x2dac('0x6')]['message'],_0x4c5b94);return _0x574fc9(_0x1a0652[_0x2dac('0x6')]['message']);}else{return _0x1ed9d9(_0x1a0652[_0x2dac('0x7')]);}})[_0x2dac('0x8')](function(_0x5b25b0){logger[_0x2dac('0x6')](_0x2dac('0x5'),'routing',_0x156ec8,_0x5b25b0,_0x4c5b94);return _0x574fc9(_0x5b25b0);});});};module[_0x2dac('0x9')]=client;
\ No newline at end of file
+var _0x6111=['request','then','rpc','error','routing','message','catch','exports','jayson/promise','bluebird','Request'];(function(_0x233716,_0x346676){var _0x302298=function(_0x53d84c){while(--_0x53d84c){_0x233716['push'](_0x233716['shift']());}};_0x302298(++_0x346676);}(_0x6111,0xad));var _0x1611=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6111[_0x19e35c];return _0x3e1fe8;};'use strict';var jayson=require(_0x1611('0x0'));var BPromise=require(_0x1611('0x1'));var logger=require('../../config/logger')('routing');var client=jayson['client']['http']({'port':0x2329});client[_0x1611('0x2')]=function(_0x4f06a1,_0x48078c){return new BPromise(function(_0x4fc4a6,_0x1d4fbc){return client[_0x1611('0x3')](_0x4f06a1,_0x48078c)[_0x1611('0x4')](function(_0x2c9b41){logger['debug'](_0x1611('0x5'),'routing',_0x4f06a1,_0x48078c,_0x2c9b41);if(_0x2c9b41[_0x1611('0x6')]){logger[_0x1611('0x6')](_0x1611('0x5'),_0x1611('0x7'),_0x4f06a1,_0x2c9b41[_0x1611('0x6')]['message'],_0x48078c);return _0x1d4fbc(_0x2c9b41[_0x1611('0x6')][_0x1611('0x8')]);}else{return _0x4fc4a6(_0x2c9b41['result']);}})[_0x1611('0x9')](function(_0x2c2b73){logger[_0x1611('0x6')](_0x1611('0x5'),_0x1611('0x7'),_0x4f06a1,_0x2c2b73,_0x48078c);return _0x1d4fbc(_0x2c2b73);});});};module[_0x1611('0xa')]=client;
\ No newline at end of file
index 8271af1..d67faa6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd66b=['./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','./server'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xd66b,0x133));var _0xbd66=function(_0x3ad468,_0x184f68){_0x3ad468=_0x3ad468-0x0;var _0x180437=_0xd66b[_0x3ad468];return _0x180437;};'use strict';var BPromise=require('bluebird');var server=require(_0xbd66('0x0'));var Realtime=require(_0xbd66('0x1'));var user=require(_0xbd66('0x2'));var interval=require(_0xbd66('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xbd66('0x4'));var smsQueue=require(_0xbd66('0x5'));var mailQueue=require(_0xbd66('0x6'));var faxQueue=require(_0xbd66('0x7'));var whatsappQueue=require(_0xbd66('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xbd66('0x9')]()[_0xbd66('0xa')](user[_0xbd66('0xb')]())[_0xbd66('0xa')](realtime[_0xbd66('0xc')]())[_0xbd66('0xa')](interval[_0xbd66('0xd')]())[_0xbd66('0xa')](realtime[_0xbd66('0xe')]())[_0xbd66('0xa')](openchannelQueue[_0xbd66('0xf')]())[_0xbd66('0xa')](realtime[_0xbd66('0x10')]())['then'](chatQueue[_0xbd66('0x11')]())[_0xbd66('0xa')](realtime[_0xbd66('0x12')]())[_0xbd66('0xa')](smsQueue[_0xbd66('0x13')]())[_0xbd66('0xa')](realtime['initSmsQueues']())['then'](mailQueue['getMailQueues']())[_0xbd66('0xa')](realtime[_0xbd66('0x14')]())[_0xbd66('0xa')](faxQueue[_0xbd66('0x15')]())[_0xbd66('0xa')](realtime[_0xbd66('0x16')]())[_0xbd66('0xa')](whatsappQueue[_0xbd66('0x17')]())[_0xbd66('0xa')](realtime[_0xbd66('0x18')]())[_0xbd66('0xa')](function(){return realtime;});}function main(){return server[_0xbd66('0x19')](realtime)[_0xbd66('0xa')](function(_0x59c897){return initRealtime();})['then'](function(_0x74223d){return setInterval(initRealtime,0x1388);})[_0xbd66('0x1a')](function(_0x237255){console[_0xbd66('0x1b')](_0x237255);});}main();
\ No newline at end of file
+var _0x2787=['initFaxQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initMailQueues'];(function(_0x5cd1d6,_0x198b55){var _0x397fdc=function(_0x201d6b){while(--_0x201d6b){_0x5cd1d6['push'](_0x5cd1d6['shift']());}};_0x397fdc(++_0x198b55);}(_0x2787,0xf8));var _0x7278=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2787[_0x17d9e3];return _0x14192d;};'use strict';var BPromise=require(_0x7278('0x0'));var server=require(_0x7278('0x1'));var Realtime=require(_0x7278('0x2'));var user=require(_0x7278('0x3'));var interval=require(_0x7278('0x4'));var openchannelQueue=require(_0x7278('0x5'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x7278('0x6'));var mailQueue=require(_0x7278('0x7'));var faxQueue=require(_0x7278('0x8'));var whatsappQueue=require(_0x7278('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x7278('0xa')]()['then'](user[_0x7278('0xb')]())[_0x7278('0xc')](realtime[_0x7278('0xd')]())['then'](interval[_0x7278('0xe')]())[_0x7278('0xc')](realtime[_0x7278('0xf')]())[_0x7278('0xc')](openchannelQueue[_0x7278('0x10')]())[_0x7278('0xc')](realtime[_0x7278('0x11')]())[_0x7278('0xc')](chatQueue[_0x7278('0x12')]())[_0x7278('0xc')](realtime[_0x7278('0x13')]())[_0x7278('0xc')](smsQueue[_0x7278('0x14')]())['then'](realtime['initSmsQueues']())[_0x7278('0xc')](mailQueue['getMailQueues']())['then'](realtime[_0x7278('0x15')]())[_0x7278('0xc')](faxQueue['getFaxQueues']())['then'](realtime[_0x7278('0x16')]())['then'](whatsappQueue['getWhatsappQueues']())[_0x7278('0xc')](realtime[_0x7278('0x17')]())[_0x7278('0xc')](function(){return realtime;});}function main(){return server[_0x7278('0x18')](realtime)[_0x7278('0xc')](function(_0x40c89a){return initRealtime();})[_0x7278('0xc')](function(_0x5e8d6a){return setInterval(initRealtime,0x1388);})[_0x7278('0x19')](function(_0x44af3f){console[_0x7278('0x1a')](_0x44af3f);});}main();
\ No newline at end of file
index 28352c6..8aea705 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['ruleRef','name','nextTick','push','call','next','isEqual','restart','isNil','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','fromJSON','isString','parse','register','exports','lodash','util','events','EventEmitter','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','isObject','sync','filter','orderBy','asc','execute','result','clone','consequence'];(function(_0x27a474,_0x9975c4){var _0x3bdf3f=function(_0x2cfa4d){while(--_0x2cfa4d){_0x27a474['push'](_0x27a474['shift']());}};_0x3bdf3f(++_0x9975c4);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xc4aa[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var EventEmitter=require(_0xac4a('0x2'))[_0xac4a('0x3')];function RuleEngine(_0x275161,_0x22469d){this['init']();if(!_['isNil'](_0x275161)){this['register'](_0x275161);}if(_0x22469d){this[_0xac4a('0x4')]=_0x22469d[_0xac4a('0x4')];}return this;}util[_0xac4a('0x5')](RuleEngine,EventEmitter);RuleEngine[_0xac4a('0x6')][_0xac4a('0x7')]=function(_0x15cd34){this[_0xac4a('0x8')]=[];this[_0xac4a('0x9')]=[];};RuleEngine['prototype']['register']=function(_0x1aba6d){if(Array[_0xac4a('0xa')](_0x1aba6d)){this[_0xac4a('0x8')]=this['rules'][_0xac4a('0xb')](_0x1aba6d);}else if(_0x1aba6d!==null&&_[_0xac4a('0xc')](_0x1aba6d)){this[_0xac4a('0x8')]['push'](_0x1aba6d);}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0xd')]=function(){this['activeRules']=this[_0xac4a('0x8')][_0xac4a('0xe')](function(_0x24291d){if(_['isNil'](_0x24291d['on'])){_0x24291d['on']=!![];}if(_0x24291d['on']===!![]){return _0x24291d;}});this[_0xac4a('0x9')]=_[_0xac4a('0xf')](this[_0xac4a('0x9')],['p'],[_0xac4a('0x10')]);};RuleEngine[_0xac4a('0x6')][_0xac4a('0x11')]=function(_0x34bc01,_0x33c287){var _0x190418=![];_0x34bc01[_0xac4a('0x12')]=!![];var _0x11e101=_[_0xac4a('0x13')](_0x34bc01);var _0x4a2119=_[_0xac4a('0x13')](_0x34bc01);var _0x34d797=this[_0xac4a('0x9')];var _0x144553=[];var _0x3e88e3=this[_0xac4a('0x4')];(function FnRuleLoop(_0x28e304){var _0x44ec59={'rules':function(){return _0x34d797;},'rule':function(){return _0x34d797[_0x28e304];},'when':function(_0x546c5d){if(_0x546c5d){var _0x5ac21e=_0x34d797[_0x28e304][_0xac4a('0x14')];_0x5ac21e[_0xac4a('0x15')]=_0x34d797[_0x28e304]['id']||_0x34d797[_0x28e304][_0xac4a('0x16')]||'index_'+_0x28e304;process[_0xac4a('0x17')](function(){_0x144553[_0xac4a('0x18')](_0x5ac21e[_0xac4a('0x15')]);_0x5ac21e[_0xac4a('0x19')](_0x11e101,_0x44ec59);});}else{process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1a')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190418=!![];return FnRuleLoop(0x0);},'next':function(_0xe38996){if(!_0x3e88e3&&!_[_0xac4a('0x1b')](_0x4a2119,_0x11e101)){_0x4a2119=_['clone'](_0x11e101);process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1c')]();});}else{process['nextTick'](function(){if(_[_0xac4a('0x1d')](_0xe38996)){return FnRuleLoop(_0x28e304+0x1);}else{return FnRuleLoop(_0xe38996);}});}}};if(_0x28e304<_0x34d797[_0xac4a('0x1e')]&&_0x190418===![]){var _0x3eacd3=_0x34d797[_0x28e304][_0xac4a('0x1f')];_0x3eacd3['call'](_0x11e101,_0x44ec59);}else{process[_0xac4a('0x17')](function(){_0x11e101[_0xac4a('0x20')]=_0x144553;return _0x33c287?_0x33c287(_0x11e101):_[_0xac4a('0x21')]();});}}(0x0));};RuleEngine[_0xac4a('0x6')][_0xac4a('0x22')]=function(_0x2b0dc2){if(_[_0xac4a('0x1d')](_0x2b0dc2)){return this[_0xac4a('0x8')];}else{var _0x3e2c69=_[_0xac4a('0x23')](_0x2b0dc2);return _[_0xac4a('0xe')](this[_0xac4a('0x8')],_0x3e2c69);}};RuleEngine[_0xac4a('0x6')][_0xac4a('0x24')]=function(_0x1c13dc,_0x20202c){var _0x4e17ce=_0x1c13dc==='on'||_0x1c13dc==='ON'?!![]:![];var _0x23b061=this[_0xac4a('0x22')](_0x20202c);for(var _0x42a33c=0x0,_0x2772fe=_0x23b061[_0xac4a('0x1e')];_0x42a33c<_0x2772fe;_0x42a33c+=0x1){_0x23b061[_0x42a33c]['on']=_0x4e17ce;}this['sync']();};RuleEngine['prototype'][_0xac4a('0x25')]=function(_0x7a948b,_0x1f12d5){_0x7a948b=parseInt(_0x7a948b,0xa);var _0x546b65=this['findRules'](_0x1f12d5);for(var _0x355755=0x0,_0x2896bc=_0x546b65[_0xac4a('0x1e')];_0x355755<_0x2896bc;_0x355755+=0x1){_0x546b65[_0x355755][_0xac4a('0x26')]=_0x7a948b;}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0x27')]=function(){var _0x482afc=this[_0xac4a('0x8')];if(_0x482afc instanceof Array){_0x482afc=_0x482afc['map'](function(_0x17e6de){_0x17e6de[_0xac4a('0x1f')]=_0x17e6de[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x17e6de[_0xac4a('0x14')]=_0x17e6de[_0xac4a('0x14')][_0xac4a('0x28')]();return _0x17e6de;});}else if(!_[_0xac4a('0x1d')](_0x482afc)){_0x482afc[_0xac4a('0x1f')]=_0x482afc[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x482afc[_0xac4a('0x14')]=_0x482afc[_0xac4a('0x14')][_0xac4a('0x28')]();}return _0x482afc;};RuleEngine['prototype'][_0xac4a('0x29')]=function(_0x1c41fb){this['init']();if(_[_0xac4a('0x2a')](_0x1c41fb)){_0x1c41fb=JSON[_0xac4a('0x2b')](_0x1c41fb);}if(_0x1c41fb instanceof Array){_0x1c41fb=_0x1c41fb['map'](function(_0x58804b){_0x58804b[_0xac4a('0x1f')]=eval('('+_0x58804b[_0xac4a('0x1f')]+')');_0x58804b[_0xac4a('0x14')]=eval('('+_0x58804b[_0xac4a('0x14')]+')');return _0x58804b;});}else if(_0x1c41fb!==null&&typeof _0x1c41fb=='object'){_0x1c41fb[_0xac4a('0x1f')]=eval('('+_0x1c41fb[_0xac4a('0x1f')]+')');_0x1c41fb['consequence']=eval('('+_0x1c41fb[_0xac4a('0x14')]+')');}this[_0xac4a('0x2c')](_0x1c41fb);};module[_0xac4a('0x2d')]=RuleEngine;
\ No newline at end of file
+var _0x7a54=['turn','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','exports','lodash','util','events','isNil','register','ignoreFactChanges','inherits','init','rules','activeRules','concat','prototype','sync','filter','orderBy','asc','execute','clone','consequence','ruleRef','name','index_','nextTick','push','call','isEqual','restart','length','condition','matchPath','noop','findRules'];(function(_0x4d5eae,_0x1a3119){var _0x2ca824=function(_0x16a550){while(--_0x16a550){_0x4d5eae['push'](_0x4d5eae['shift']());}};_0x2ca824(++_0x1a3119);}(_0x7a54,0x106));var _0x47a5=function(_0x4a010c,_0x2dfcf7){_0x4a010c=_0x4a010c-0x0;var _0x409222=_0x7a54[_0x4a010c];return _0x409222;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var EventEmitter=require(_0x47a5('0x2'))['EventEmitter'];function RuleEngine(_0x1d33e,_0x4086cd){this['init']();if(!_[_0x47a5('0x3')](_0x1d33e)){this[_0x47a5('0x4')](_0x1d33e);}if(_0x4086cd){this[_0x47a5('0x5')]=_0x4086cd[_0x47a5('0x5')];}return this;}util[_0x47a5('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x47a5('0x7')]=function(_0x59199c){this[_0x47a5('0x8')]=[];this[_0x47a5('0x9')]=[];};RuleEngine['prototype'][_0x47a5('0x4')]=function(_0x5077f3){if(Array['isArray'](_0x5077f3)){this['rules']=this[_0x47a5('0x8')][_0x47a5('0xa')](_0x5077f3);}else if(_0x5077f3!==null&&_['isObject'](_0x5077f3)){this[_0x47a5('0x8')]['push'](_0x5077f3);}this['sync']();};RuleEngine[_0x47a5('0xb')][_0x47a5('0xc')]=function(){this[_0x47a5('0x9')]=this[_0x47a5('0x8')][_0x47a5('0xd')](function(_0xd308b8){if(_[_0x47a5('0x3')](_0xd308b8['on'])){_0xd308b8['on']=!![];}if(_0xd308b8['on']===!![]){return _0xd308b8;}});this['activeRules']=_[_0x47a5('0xe')](this[_0x47a5('0x9')],['p'],[_0x47a5('0xf')]);};RuleEngine[_0x47a5('0xb')][_0x47a5('0x10')]=function(_0x620ee9,_0x3c6c46){var _0x190faa=![];_0x620ee9['result']=!![];var _0x362359=_[_0x47a5('0x11')](_0x620ee9);var _0x3b001e=_[_0x47a5('0x11')](_0x620ee9);var _0x1ef44c=this['activeRules'];var _0x549de3=[];var _0x138bc0=this['ignoreFactChanges'];(function FnRuleLoop(_0x5247fd){var _0x423a81={'rules':function(){return _0x1ef44c;},'rule':function(){return _0x1ef44c[_0x5247fd];},'when':function(_0xaf70a6){if(_0xaf70a6){var _0x2ce454=_0x1ef44c[_0x5247fd][_0x47a5('0x12')];_0x2ce454[_0x47a5('0x13')]=_0x1ef44c[_0x5247fd]['id']||_0x1ef44c[_0x5247fd][_0x47a5('0x14')]||_0x47a5('0x15')+_0x5247fd;process[_0x47a5('0x16')](function(){_0x549de3[_0x47a5('0x17')](_0x2ce454['ruleRef']);_0x2ce454[_0x47a5('0x18')](_0x362359,_0x423a81);});}else{process[_0x47a5('0x16')](function(){_0x423a81['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190faa=!![];return FnRuleLoop(0x0);},'next':function(_0x2b0360){if(!_0x138bc0&&!_[_0x47a5('0x19')](_0x3b001e,_0x362359)){_0x3b001e=_[_0x47a5('0x11')](_0x362359);process['nextTick'](function(){_0x423a81[_0x47a5('0x1a')]();});}else{process[_0x47a5('0x16')](function(){if(_[_0x47a5('0x3')](_0x2b0360)){return FnRuleLoop(_0x5247fd+0x1);}else{return FnRuleLoop(_0x2b0360);}});}}};if(_0x5247fd<_0x1ef44c[_0x47a5('0x1b')]&&_0x190faa===![]){var _0x5ef1b1=_0x1ef44c[_0x5247fd][_0x47a5('0x1c')];_0x5ef1b1[_0x47a5('0x18')](_0x362359,_0x423a81);}else{process['nextTick'](function(){_0x362359[_0x47a5('0x1d')]=_0x549de3;return _0x3c6c46?_0x3c6c46(_0x362359):_[_0x47a5('0x1e')]();});}}(0x0));};RuleEngine[_0x47a5('0xb')][_0x47a5('0x1f')]=function(_0x3abd6a){if(_['isNil'](_0x3abd6a)){return this['rules'];}else{var _0x136745=_['matches'](_0x3abd6a);return _[_0x47a5('0xd')](this['rules'],_0x136745);}};RuleEngine[_0x47a5('0xb')][_0x47a5('0x20')]=function(_0x36ad34,_0x1dac65){var _0x21f296=_0x36ad34==='on'||_0x36ad34==='ON'?!![]:![];var _0x3ba0b7=this[_0x47a5('0x1f')](_0x1dac65);for(var _0x136b14=0x0,_0x16631f=_0x3ba0b7[_0x47a5('0x1b')];_0x136b14<_0x16631f;_0x136b14+=0x1){_0x3ba0b7[_0x136b14]['on']=_0x21f296;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x21')]=function(_0x528582,_0x243210){_0x528582=parseInt(_0x528582,0xa);var _0x51833b=this[_0x47a5('0x1f')](_0x243210);for(var _0x9ac908=0x0,_0x16901f=_0x51833b['length'];_0x9ac908<_0x16901f;_0x9ac908+=0x1){_0x51833b[_0x9ac908][_0x47a5('0x22')]=_0x528582;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x23')]=function(){var _0x51cc81=this['rules'];if(_0x51cc81 instanceof Array){_0x51cc81=_0x51cc81[_0x47a5('0x24')](function(_0xfb5ddb){_0xfb5ddb['condition']=_0xfb5ddb['condition'][_0x47a5('0x25')]();_0xfb5ddb[_0x47a5('0x12')]=_0xfb5ddb['consequence'][_0x47a5('0x25')]();return _0xfb5ddb;});}else if(!_['isNil'](_0x51cc81)){_0x51cc81[_0x47a5('0x1c')]=_0x51cc81[_0x47a5('0x1c')]['toString']();_0x51cc81['consequence']=_0x51cc81[_0x47a5('0x12')]['toString']();}return _0x51cc81;};RuleEngine[_0x47a5('0xb')][_0x47a5('0x26')]=function(_0xf269a8){this['init']();if(_[_0x47a5('0x27')](_0xf269a8)){_0xf269a8=JSON['parse'](_0xf269a8);}if(_0xf269a8 instanceof Array){_0xf269a8=_0xf269a8['map'](function(_0x65542e){_0x65542e['condition']=eval('('+_0x65542e[_0x47a5('0x1c')]+')');_0x65542e['consequence']=eval('('+_0x65542e[_0x47a5('0x12')]+')');return _0x65542e;});}else if(_0xf269a8!==null&&typeof _0xf269a8==_0x47a5('0x28')){_0xf269a8[_0x47a5('0x1c')]=eval('('+_0xf269a8[_0x47a5('0x1c')]+')');_0xf269a8[_0x47a5('0x12')]=eval('('+_0xf269a8[_0x47a5('0x12')]+')');}this[_0x47a5('0x4')](_0xf269a8);};module[_0x47a5('0x29')]=RuleEngine;
\ No newline at end of file
index 06734e9..cb6e05e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f27=['http','request','error','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6f27,0x16e));var _0x76f2=function(_0x1b776e,_0x1d341e){_0x1b776e=_0x1b776e-0x0;var _0x3b8294=_0x6f27[_0x1b776e];return _0x3b8294;};'use strict';var BPromise=require(_0x76f2('0x0'));var jayson=require(_0x76f2('0x1'));var client=jayson[_0x76f2('0x2')][_0x76f2('0x3')]({'port':0x232b});function request(_0x32c3a3,_0x53526b){return new BPromise(function(_0x78fd79,_0x2be21e){return client[_0x76f2('0x4')](_0x32c3a3,_0x53526b)['then'](function(_0x2bd889){if(_0x2bd889[_0x76f2('0x5')]){return _0x2be21e(_0x2bd889[_0x76f2('0x5')]['message']);}else{return _0x78fd79(_0x2bd889['result']);}})[_0x76f2('0x6')](function(_0x16932d){return _0x2be21e(_0x16932d);});});}exports[_0x76f2('0x7')]=function(_0x62c61f,_0xa6eabf){return request(_0x76f2('0x8'),{'account':_0x62c61f,'message':_0xa6eabf});};
\ No newline at end of file
+var _0x9621=['SendMail','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0x47a204,_0x24b906){var _0x5623fc=function(_0x4404ac){while(--_0x4404ac){_0x47a204['push'](_0x47a204['shift']());}};_0x5623fc(++_0x24b906);}(_0x9621,0xeb));var _0x1962=function(_0x1d3416,_0x3b6b97){_0x1d3416=_0x1d3416-0x0;var _0x448885=_0x9621[_0x1d3416];return _0x448885;};'use strict';var BPromise=require(_0x1962('0x0'));var jayson=require(_0x1962('0x1'));var client=jayson[_0x1962('0x2')][_0x1962('0x3')]({'port':0x232b});function request(_0x58ea4e,_0x87b128){return new BPromise(function(_0x34ba85,_0x109982){return client[_0x1962('0x4')](_0x58ea4e,_0x87b128)[_0x1962('0x5')](function(_0x302136){if(_0x302136[_0x1962('0x6')]){return _0x109982(_0x302136[_0x1962('0x6')][_0x1962('0x7')]);}else{return _0x34ba85(_0x302136['result']);}})['catch'](function(_0x4d4932){return _0x109982(_0x4d4932);});});}exports['sendMailMessage']=function(_0x266863,_0x17092a){return request(_0x1962('0x8'),{'account':_0x266863,'message':_0x17092a});};
\ No newline at end of file
index aa15e37..c6e3ff5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x05f3=['moment','md5','ioredis','../../../config/environment','localhost','socket.io-emitter','redis','name','online','voicePause','chatPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','mailStatus','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','updateRealtime','chat','openchannel','fax','sms','whatsapp','length','Status','StatusTime','toNumber','chatCurrentCapacity','mailCurrentCapacity','faxCurrentCapacity','openchannelStatus','stringify','emit','exports'];(function(_0x140330,_0x45e1fa){var _0x263a28=function(_0x545e91){while(--_0x545e91){_0x140330['push'](_0x140330['shift']());}};_0x263a28(++_0x45e1fa);}(_0x05f3,0xf0));var _0x305f=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x05f3[_0x110c3d];return _0x226d67;};'use strict';var _=require('lodash');var moment=require(_0x305f('0x0'));var md5=require(_0x305f('0x1'));var Redis=require(_0x305f('0x2'));var config=require(_0x305f('0x3'));config['redis']=_['defaults'](config['redis'],{'host':_0x305f('0x4'),'port':0x18eb});var io=require(_0x305f('0x5'))(new Redis(config[_0x305f('0x6')]));function Agent(_0x5d7e41){this['id']=_0x5d7e41['id']||0x0;this['name']=_0x5d7e41[_0x305f('0x7')]||'';this[_0x305f('0x8')]=_0x5d7e41[_0x305f('0x8')]||!![];this[_0x305f('0x9')]=_0x5d7e41[_0x305f('0x9')]||![];this[_0x305f('0xa')]=_0x5d7e41['chatPause']||![];this['mailPause']=_0x5d7e41['mailPause']||![];this[_0x305f('0xb')]=_0x5d7e41['faxPause']||![];this[_0x305f('0xc')]=_0x5d7e41[_0x305f('0xc')]||![];this[_0x305f('0xd')]=_0x5d7e41[_0x305f('0xd')]||![];this[_0x305f('0xe')]=_0x305f('0xf');this[_0x305f('0x10')]=0x0;this[_0x305f('0x11')]=_0x5d7e41[_0x305f('0x11')]||0x0;this['chatCurrentCapacity']=0x0;this[_0x305f('0x12')]='unknown';this[_0x305f('0x13')]=0x0;this[_0x305f('0x14')]=_0x5d7e41[_0x305f('0x14')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x305f('0x15')]='unknown';this[_0x305f('0x16')]=0x0;this[_0x305f('0x17')]=_0x5d7e41[_0x305f('0x17')]||0x0;this['faxCurrentCapacity']=0x0;this[_0x305f('0x18')]='unknown';this[_0x305f('0x19')]=0x0;this['smsCapacity']=_0x5d7e41[_0x305f('0x1a')]||0x0;this[_0x305f('0x1b')]=0x0;this[_0x305f('0x1c')]=_0x305f('0xf');this[_0x305f('0x1d')]=0x0;this[_0x305f('0x1e')]=_0x5d7e41[_0x305f('0x1e')]||0x0;this[_0x305f('0x1f')]=0x0;this['openchannelStatus']=_0x305f('0xf');this[_0x305f('0x20')]=0x0;this[_0x305f('0x21')]=_0x5d7e41[_0x305f('0x21')]||0x0;this[_0x305f('0x22')]=0x0;this[_0x305f('0x23')]=![];this[_0x305f('0x24')]=undefined;this[_0x305f('0x1')]='';this['updateRealtime']();}Agent[_0x305f('0x25')][_0x305f('0x26')]=function(_0xf84d0c){if(this[_0xf84d0c+_0x305f('0x27')]>0x0){if(this[_0xf84d0c+_0x305f('0x28')]>0x0&&this[_0xf84d0c+'CurrentCapacity']>=this[_0xf84d0c+_0x305f('0x28')]){return _0x305f('0x29');}else{return _0x305f('0x2a');}}else{return'idle';}};Agent[_0x305f('0x25')][_0x305f('0x2b')]=function(){var _0x531f21=['mail',_0x305f('0x2c'),_0x305f('0x2d'),_0x305f('0x2e'),_0x305f('0x2f'),_0x305f('0x30')];for(var _0x35bbfa=0x0;_0x35bbfa<_0x531f21[_0x305f('0x31')];_0x35bbfa+=0x1){var _0x106613=this[_0x305f('0x26')](_0x531f21[_0x35bbfa]);if(this[_0x531f21[_0x35bbfa]+_0x305f('0x32')]!==_0x106613){this[_0x531f21[_0x35bbfa]+_0x305f('0x33')]=_[_0x305f('0x34')](moment()['format']('x'));}this[_0x531f21[_0x35bbfa]+'Status']=_0x106613;}var _0x24d5c3={'id':this['id'],'name':this['name'],'online':this[_0x305f('0x8')],'voicePause':this[_0x305f('0x9')],'chatPause':this[_0x305f('0xa')],'mailPause':this['mailPause'],'smsPause':this[_0x305f('0xc')],'faxPause':this[_0x305f('0xb')],'openchannelPause':this[_0x305f('0xd')],'chatStatus':this[_0x305f('0xe')],'chatStatusTime':this[_0x305f('0x10')],'chatCapacity':this[_0x305f('0x11')],'chatCurrentCapacity':this[_0x305f('0x35')],'mailStatus':this[_0x305f('0x12')],'mailStatusTime':this[_0x305f('0x13')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x305f('0x36')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0x305f('0x16')],'faxCapacity':this[_0x305f('0x17')],'faxCurrentCapacity':this[_0x305f('0x37')],'smsStatus':this[_0x305f('0x18')],'smsStatusTime':this[_0x305f('0x19')],'smsCapacity':this[_0x305f('0x1a')],'smsCurrentCapacity':this[_0x305f('0x1b')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x305f('0x1d')],'whatsappCapacity':this[_0x305f('0x1e')],'whatsappCurrentCapacity':this[_0x305f('0x1f')],'openchannelStatus':this[_0x305f('0x38')],'openchannelStatusTime':this[_0x305f('0x20')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x305f('0x22')],'busy':this['busy'],'busyQueue':this['busyQueue']};var _0x22915b=md5(JSON[_0x305f('0x39')](_0x24d5c3));if(this[_0x305f('0x1')]!==_0x22915b){this['md5']=_0x22915b;io[_0x305f('0x3a')]('user:save',_0x24d5c3);}};module[_0x305f('0x3b')]=Agent;
\ No newline at end of file
+var _0x9a75=['smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','busyQueue','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','updateRealtime','chat','sms','Status','toNumber','chatCurrentCapacity','openchannelCurrentCapacity','emit','user:save','lodash','moment','md5','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x9a75,0xf1));var _0x59a7=function(_0x312387,_0x4e0e85){_0x312387=_0x312387-0x0;var _0x224945=_0x9a75[_0x312387];return _0x224945;};'use strict';var _=require(_0x59a7('0x0'));var moment=require(_0x59a7('0x1'));var md5=require(_0x59a7('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x59a7('0x3')]=_[_0x59a7('0x4')](config[_0x59a7('0x3')],{'host':_0x59a7('0x5'),'port':0x18eb});var io=require(_0x59a7('0x6'))(new Redis(config[_0x59a7('0x3')]));function Agent(_0x5bc325){this['id']=_0x5bc325['id']||0x0;this[_0x59a7('0x7')]=_0x5bc325[_0x59a7('0x7')]||'';this['online']=_0x5bc325[_0x59a7('0x8')]||!![];this[_0x59a7('0x9')]=_0x5bc325[_0x59a7('0x9')]||![];this[_0x59a7('0xa')]=_0x5bc325[_0x59a7('0xa')]||![];this[_0x59a7('0xb')]=_0x5bc325[_0x59a7('0xb')]||![];this[_0x59a7('0xc')]=_0x5bc325[_0x59a7('0xc')]||![];this[_0x59a7('0xd')]=_0x5bc325['smsPause']||![];this[_0x59a7('0xe')]=_0x5bc325[_0x59a7('0xe')]||![];this[_0x59a7('0xf')]=_0x59a7('0x10');this[_0x59a7('0x11')]=0x0;this[_0x59a7('0x12')]=_0x5bc325[_0x59a7('0x12')]||0x0;this['chatCurrentCapacity']=0x0;this[_0x59a7('0x13')]=_0x59a7('0x10');this[_0x59a7('0x14')]=0x0;this['mailCapacity']=_0x5bc325[_0x59a7('0x15')]||0x0;this[_0x59a7('0x16')]=0x0;this[_0x59a7('0x17')]=_0x59a7('0x10');this['faxStatusTime']=0x0;this['faxCapacity']=_0x5bc325[_0x59a7('0x18')]||0x0;this[_0x59a7('0x19')]=0x0;this[_0x59a7('0x1a')]=_0x59a7('0x10');this[_0x59a7('0x1b')]=0x0;this[_0x59a7('0x1c')]=_0x5bc325[_0x59a7('0x1c')]||0x0;this[_0x59a7('0x1d')]=0x0;this[_0x59a7('0x1e')]=_0x59a7('0x10');this[_0x59a7('0x1f')]=0x0;this[_0x59a7('0x20')]=_0x5bc325['whatsappCapacity']||0x0;this[_0x59a7('0x21')]=0x0;this[_0x59a7('0x22')]=_0x59a7('0x10');this[_0x59a7('0x23')]=0x0;this[_0x59a7('0x24')]=_0x5bc325['openchannelCapacity']||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x59a7('0x25')]=![];this[_0x59a7('0x26')]=undefined;this[_0x59a7('0x2')]='';this['updateRealtime']();}Agent[_0x59a7('0x27')][_0x59a7('0x28')]=function(_0x25843a){if(this[_0x25843a+_0x59a7('0x29')]>0x0){if(this[_0x25843a+_0x59a7('0x2a')]>0x0&&this[_0x25843a+_0x59a7('0x29')]>=this[_0x25843a+_0x59a7('0x2a')]){return _0x59a7('0x2b');}else{return _0x59a7('0x2c');}}else{return'idle';}};Agent[_0x59a7('0x27')][_0x59a7('0x2d')]=function(){var _0x30fca6=['mail',_0x59a7('0x2e'),'openchannel','fax',_0x59a7('0x2f'),'whatsapp'];for(var _0x272db9=0x0;_0x272db9<_0x30fca6['length'];_0x272db9+=0x1){var _0x1a618b=this['getChannelStatus'](_0x30fca6[_0x272db9]);if(this[_0x30fca6[_0x272db9]+_0x59a7('0x30')]!==_0x1a618b){this[_0x30fca6[_0x272db9]+'StatusTime']=_[_0x59a7('0x31')](moment()['format']('x'));}this[_0x30fca6[_0x272db9]+_0x59a7('0x30')]=_0x1a618b;}var _0x3fd9b7={'id':this['id'],'name':this['name'],'online':this['online'],'voicePause':this['voicePause'],'chatPause':this[_0x59a7('0xa')],'mailPause':this[_0x59a7('0xb')],'smsPause':this[_0x59a7('0xd')],'faxPause':this[_0x59a7('0xc')],'openchannelPause':this[_0x59a7('0xe')],'chatStatus':this[_0x59a7('0xf')],'chatStatusTime':this[_0x59a7('0x11')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x59a7('0x32')],'mailStatus':this[_0x59a7('0x13')],'mailStatusTime':this[_0x59a7('0x14')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x59a7('0x16')],'faxStatus':this[_0x59a7('0x17')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x59a7('0x1a')],'smsStatusTime':this[_0x59a7('0x1b')],'smsCapacity':this[_0x59a7('0x1c')],'smsCurrentCapacity':this[_0x59a7('0x1d')],'whatsappStatus':this[_0x59a7('0x1e')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x59a7('0x21')],'openchannelStatus':this[_0x59a7('0x22')],'openchannelStatusTime':this[_0x59a7('0x23')],'openchannelCapacity':this[_0x59a7('0x24')],'openchannelCurrentCapacity':this[_0x59a7('0x33')],'busy':this[_0x59a7('0x25')],'busyQueue':this['busyQueue']};var _0x5a5689=md5(JSON['stringify'](_0x3fd9b7));if(this[_0x59a7('0x2')]!==_0x5a5689){this['md5']=_0x5a5689;io[_0x59a7('0x34')](_0x59a7('0x35'),_0x3fd9b7);}};module['exports']=Agent;
\ No newline at end of file
index a2b4810..d89577b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca46=['util','ioredis','../../../config/environment','localhost','socket.io-emitter','redis','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','online','available','stringify','format','chat:queue:%s','lodash','md5'];(function(_0x2902cc,_0x4d1d00){var _0x5f418f=function(_0x5e3846){while(--_0x5e3846){_0x2902cc['push'](_0x2902cc['shift']());}};_0x5f418f(++_0x4d1d00);}(_0xca46,0x175));var _0x6ca4=function(_0x4acf7e,_0x1e6dfd){_0x4acf7e=_0x4acf7e-0x0;var _0x2e9d7d=_0xca46[_0x4acf7e];return _0x2e9d7d;};'use strict';var _=require(_0x6ca4('0x0'));var md5=require(_0x6ca4('0x1'));var util=require(_0x6ca4('0x2'));var Redis=require(_0x6ca4('0x3'));var config=require(_0x6ca4('0x4'));config['redis']=_['defaults'](config['redis'],{'host':_0x6ca4('0x5'),'port':0x18eb});var io=require(_0x6ca4('0x6'))(new Redis(config[_0x6ca4('0x7')]));function ChatQueue(_0xe95a73){this['id']=_0xe95a73['id']||0x0;this[_0x6ca4('0x8')]=_0xe95a73[_0x6ca4('0x8')]||'';this[_0x6ca4('0x9')]=_0xe95a73[_0x6ca4('0x9')]||0xa;this[_0x6ca4('0xa')]=_0xe95a73['strategy']||'beepall';this[_0x6ca4('0xb')]=_0xe95a73[_0x6ca4('0xb')];this[_0x6ca4('0xc')]={};this[_0x6ca4('0xd')]=0x0;this[_0x6ca4('0x1')]='';this[_0x6ca4('0xe')]();this[_0x6ca4('0xf')]();}ChatQueue[_0x6ca4('0x10')]['updateRouting']=function(){var _0x552eef=this[_0x6ca4('0xc')]['_rr'];this[_0x6ca4('0xc')]=_['map'](this[_0x6ca4('0xb')],'id');this[_0x6ca4('0xc')][_0x6ca4('0x11')]=_0x552eef;};ChatQueue[_0x6ca4('0x10')][_0x6ca4('0xf')]=function(){this[_0x6ca4('0x12')]=0x0;this[_0x6ca4('0x13')]=0x0;for(var _0x6b359a=0x0;_0x6b359a<this['Agents']['length'];_0x6b359a+=0x1){if(this[_0x6ca4('0xb')][_0x6b359a][_0x6ca4('0x14')]){this[_0x6ca4('0x12')]+=0x1;}if(this[_0x6ca4('0xb')][_0x6b359a]['chatPause']){this[_0x6ca4('0x13')]+=0x1;}}this[_0x6ca4('0x15')]=this[_0x6ca4('0x12')]-this[_0x6ca4('0x13')];this[_0x6ca4('0x15')]=this[_0x6ca4('0x15')]>=0x0?this[_0x6ca4('0x15')]:0x0;var _0x52323d={'id':this['id'],'available':this[_0x6ca4('0x15')],'loggedIn':this['loggedIn'],'name':this[_0x6ca4('0x8')],'paused':this[_0x6ca4('0x13')],'waiting':this[_0x6ca4('0xd')]};var _0x44b266=md5(JSON[_0x6ca4('0x16')](_0x52323d));if(this[_0x6ca4('0x1')]!==_0x44b266){this[_0x6ca4('0x1')]=_0x44b266;io['to'](util[_0x6ca4('0x17')](_0x6ca4('0x18'),_0x52323d[_0x6ca4('0x8')]))['emit']('chat_queue:save',_0x52323d);}};module['exports']=ChatQueue;
\ No newline at end of file
+var _0x6cfa=['_rr','map','loggedIn','paused','length','online','chatPause','available','stringify','format','chat:queue:%s','chat_queue:save','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x594f66,_0x4dc536){var _0x188a49=function(_0x2a1985){while(--_0x2a1985){_0x594f66['push'](_0x594f66['shift']());}};_0x188a49(++_0x4dc536);}(_0x6cfa,0x1e8));var _0xa6cf=function(_0xf40652,_0xf47f4a){_0xf40652=_0xf40652-0x0;var _0xe23894=_0x6cfa[_0xf40652];return _0xe23894;};'use strict';var _=require(_0xa6cf('0x0'));var md5=require(_0xa6cf('0x1'));var util=require('util');var Redis=require(_0xa6cf('0x2'));var config=require(_0xa6cf('0x3'));config[_0xa6cf('0x4')]=_[_0xa6cf('0x5')](config[_0xa6cf('0x4')],{'host':_0xa6cf('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa6cf('0x4')]));function ChatQueue(_0x1feb53){this['id']=_0x1feb53['id']||0x0;this[_0xa6cf('0x7')]=_0x1feb53[_0xa6cf('0x7')]||'';this[_0xa6cf('0x8')]=_0x1feb53[_0xa6cf('0x8')]||0xa;this['strategy']=_0x1feb53[_0xa6cf('0x9')]||_0xa6cf('0xa');this[_0xa6cf('0xb')]=_0x1feb53[_0xa6cf('0xb')];this[_0xa6cf('0xc')]={};this[_0xa6cf('0xd')]=0x0;this[_0xa6cf('0x1')]='';this[_0xa6cf('0xe')]();this[_0xa6cf('0xf')]();}ChatQueue['prototype'][_0xa6cf('0xe')]=function(){var _0x57a4d1=this[_0xa6cf('0xc')][_0xa6cf('0x10')];this[_0xa6cf('0xc')]=_[_0xa6cf('0x11')](this[_0xa6cf('0xb')],'id');this[_0xa6cf('0xc')]['_rr']=_0x57a4d1;};ChatQueue['prototype'][_0xa6cf('0xf')]=function(){this[_0xa6cf('0x12')]=0x0;this[_0xa6cf('0x13')]=0x0;for(var _0x1ec0b1=0x0;_0x1ec0b1<this['Agents'][_0xa6cf('0x14')];_0x1ec0b1+=0x1){if(this[_0xa6cf('0xb')][_0x1ec0b1][_0xa6cf('0x15')]){this[_0xa6cf('0x12')]+=0x1;}if(this[_0xa6cf('0xb')][_0x1ec0b1][_0xa6cf('0x16')]){this[_0xa6cf('0x13')]+=0x1;}}this['available']=this[_0xa6cf('0x12')]-this[_0xa6cf('0x13')];this[_0xa6cf('0x17')]=this[_0xa6cf('0x17')]>=0x0?this[_0xa6cf('0x17')]:0x0;var _0x5a24d7={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0xa6cf('0x13')],'waiting':this[_0xa6cf('0xd')]};var _0x342b75=md5(JSON[_0xa6cf('0x18')](_0x5a24d7));if(this['md5']!==_0x342b75){this[_0xa6cf('0x1')]=_0x342b75;io['to'](util[_0xa6cf('0x19')](_0xa6cf('0x1a'),_0x5a24d7[_0xa6cf('0x7')]))['emit'](_0xa6cf('0x1b'),_0x5a24d7);}};module['exports']=ChatQueue;
\ No newline at end of file
index 0da53d1..5f67673 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e90=['prototype','map','Agents','loggedIn','paused','length','faxPause','available','stringify','format','fax:queue:%s','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','beepall','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0xd6b9f,_0x475f93){var _0x38b326=function(_0x3aec1f){while(--_0x3aec1f){_0xd6b9f['push'](_0xd6b9f['shift']());}};_0x38b326(++_0x475f93);}(_0x4e90,0xe4));var _0x04e9=function(_0x20da5d,_0x396eb6){_0x20da5d=_0x20da5d-0x0;var _0x69b4b6=_0x4e90[_0x20da5d];return _0x69b4b6;};'use strict';var _=require(_0x04e9('0x0'));var md5=require(_0x04e9('0x1'));var util=require('util');var Redis=require(_0x04e9('0x2'));var config=require(_0x04e9('0x3'));config[_0x04e9('0x4')]=_[_0x04e9('0x5')](config[_0x04e9('0x4')],{'host':_0x04e9('0x6'),'port':0x18eb});var io=require(_0x04e9('0x7'))(new Redis(config[_0x04e9('0x4')]));function FaxQueue(_0x558936){this['id']=_0x558936['id']||0x0;this[_0x04e9('0x8')]=_0x558936[_0x04e9('0x8')]||'';this[_0x04e9('0x9')]=_0x558936['timeout']||0xa;this['strategy']=_0x558936['strategy']||_0x04e9('0xa');this['Agents']=_0x558936['Agents'];this[_0x04e9('0xb')]={};this[_0x04e9('0xc')]=0x0;this[_0x04e9('0x1')]='';this[_0x04e9('0xd')]();this[_0x04e9('0xe')]();}FaxQueue[_0x04e9('0xf')][_0x04e9('0xd')]=function(){var _0x588aa7=this[_0x04e9('0xb')]['_rr'];this['mapAgentsId']=_[_0x04e9('0x10')](this[_0x04e9('0x11')],'id');this[_0x04e9('0xb')]['_rr']=_0x588aa7;};FaxQueue[_0x04e9('0xf')][_0x04e9('0xe')]=function(){this[_0x04e9('0x12')]=0x0;this[_0x04e9('0x13')]=0x0;for(var _0xc32a04=0x0;_0xc32a04<this[_0x04e9('0x11')][_0x04e9('0x14')];_0xc32a04+=0x1){if(this[_0x04e9('0x11')][_0xc32a04]['online']){this[_0x04e9('0x12')]+=0x1;}if(this[_0x04e9('0x11')][_0xc32a04][_0x04e9('0x15')]){this[_0x04e9('0x13')]+=0x1;}}this[_0x04e9('0x16')]=this[_0x04e9('0x12')]-this['paused'];this[_0x04e9('0x16')]=this[_0x04e9('0x16')]>=0x0?this[_0x04e9('0x16')]:0x0;var _0x492609={'id':this['id'],'available':this[_0x04e9('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x04e9('0x8')],'paused':this[_0x04e9('0x13')],'waiting':this['waiting']};var _0x39d038=md5(JSON[_0x04e9('0x17')](_0x492609));if(this[_0x04e9('0x1')]!==_0x39d038){this[_0x04e9('0x1')]=_0x39d038;io['to'](util[_0x04e9('0x18')](_0x04e9('0x19'),_0x492609[_0x04e9('0x8')]))['emit']('fax_queue:save',_0x492609);}};module[_0x04e9('0x1a')]=FaxQueue;
\ No newline at end of file
+var _0x780d=['name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','length','faxPause','available','waiting','format','fax_queue:save','exports','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter'];(function(_0x23bac0,_0x313b98){var _0x413982=function(_0x13e9bb){while(--_0x13e9bb){_0x23bac0['push'](_0x23bac0['shift']());}};_0x413982(++_0x313b98);}(_0x780d,0x65));var _0xd780=function(_0x5e51c0,_0x481fc4){_0x5e51c0=_0x5e51c0-0x0;var _0x200337=_0x780d[_0x5e51c0];return _0x200337;};'use strict';var _=require('lodash');var md5=require(_0xd780('0x0'));var util=require(_0xd780('0x1'));var Redis=require('ioredis');var config=require(_0xd780('0x2'));config[_0xd780('0x3')]=_[_0xd780('0x4')](config[_0xd780('0x3')],{'host':_0xd780('0x5'),'port':0x18eb});var io=require(_0xd780('0x6'))(new Redis(config[_0xd780('0x3')]));function FaxQueue(_0x4bfd0d){this['id']=_0x4bfd0d['id']||0x0;this[_0xd780('0x7')]=_0x4bfd0d[_0xd780('0x7')]||'';this[_0xd780('0x8')]=_0x4bfd0d['timeout']||0xa;this[_0xd780('0x9')]=_0x4bfd0d[_0xd780('0x9')]||_0xd780('0xa');this[_0xd780('0xb')]=_0x4bfd0d[_0xd780('0xb')];this[_0xd780('0xc')]={};this['waiting']=0x0;this[_0xd780('0x0')]='';this[_0xd780('0xd')]();this[_0xd780('0xe')]();}FaxQueue['prototype'][_0xd780('0xd')]=function(){var _0xc53a80=this['mapAgentsId'][_0xd780('0xf')];this[_0xd780('0xc')]=_[_0xd780('0x10')](this[_0xd780('0xb')],'id');this[_0xd780('0xc')]['_rr']=_0xc53a80;};FaxQueue[_0xd780('0x11')][_0xd780('0xe')]=function(){this[_0xd780('0x12')]=0x0;this[_0xd780('0x13')]=0x0;for(var _0x3a2c35=0x0;_0x3a2c35<this['Agents'][_0xd780('0x14')];_0x3a2c35+=0x1){if(this['Agents'][_0x3a2c35]['online']){this[_0xd780('0x12')]+=0x1;}if(this[_0xd780('0xb')][_0x3a2c35][_0xd780('0x15')]){this[_0xd780('0x13')]+=0x1;}}this[_0xd780('0x16')]=this[_0xd780('0x12')]-this[_0xd780('0x13')];this[_0xd780('0x16')]=this[_0xd780('0x16')]>=0x0?this['available']:0x0;var _0x24b458={'id':this['id'],'available':this[_0xd780('0x16')],'loggedIn':this[_0xd780('0x12')],'name':this[_0xd780('0x7')],'paused':this['paused'],'waiting':this[_0xd780('0x17')]};var _0x5f380e=md5(JSON['stringify'](_0x24b458));if(this[_0xd780('0x0')]!==_0x5f380e){this[_0xd780('0x0')]=_0x5f380e;io['to'](util[_0xd780('0x18')]('fax:queue:%s',_0x24b458[_0xd780('0x7')]))['emit'](_0xd780('0x19'),_0x24b458);}};module[_0xd780('0x1a')]=FaxQueue;
\ No newline at end of file
index 9939f42..5f2d700 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c5f=['Intervals','name'];(function(_0x171ac4,_0x125d4c){var _0x318904=function(_0x48f7b8){while(--_0x48f7b8){_0x171ac4['push'](_0x171ac4['shift']());}};_0x318904(++_0x125d4c);}(_0x1c5f,0x1e5));var _0xf1c5=function(_0x3f6d98,_0x2e1ff4){_0x3f6d98=_0x3f6d98-0x0;var _0x2517ae=_0x1c5f[_0x3f6d98];return _0x2517ae;};'use strict';function Interval(_0x2bac52){this['id']=_0x2bac52['id']||0x0;this[_0xf1c5('0x0')]=_0x2bac52[_0xf1c5('0x0')]||'';this[_0xf1c5('0x1')]=_0x2bac52['Intervals']||{};}module['exports']=Interval;
\ No newline at end of file
+var _0xd6c1=['name','Intervals','exports'];(function(_0x4db8e5,_0x32bec6){var _0x4c4ac4=function(_0x320632){while(--_0x320632){_0x4db8e5['push'](_0x4db8e5['shift']());}};_0x4c4ac4(++_0x32bec6);}(_0xd6c1,0x96));var _0x1d6c=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xd6c1[_0x4a9fb1];return _0x348672;};'use strict';function Interval(_0xa24b71){this['id']=_0xa24b71['id']||0x0;this[_0x1d6c('0x0')]=_0xa24b71['name']||'';this[_0x1d6c('0x1')]=_0xa24b71[_0x1d6c('0x1')]||{};}module[_0x1d6c('0x2')]=Interval;
\ No newline at end of file
index b57ee0d..ea663b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f70=['paused','online','loggedIn','mailPause','available','stringify','mail:queue:%s','emit','exports','ioredis','../../../config/environment','defaults','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','map'];(function(_0x29c5d5,_0x3cca19){var _0xeab79f=function(_0x8bf3bc){while(--_0x8bf3bc){_0x29c5d5['push'](_0x29c5d5['shift']());}};_0xeab79f(++_0x3cca19);}(_0x7f70,0x90));var _0x07f7=function(_0x20e451,_0x353808){_0x20e451=_0x20e451-0x0;var _0x3677a3=_0x7f70[_0x20e451];return _0x3677a3;};'use strict';var _=require('lodash');var md5=require('md5');var util=require('util');var Redis=require(_0x07f7('0x0'));var config=require(_0x07f7('0x1'));config['redis']=_[_0x07f7('0x2')](config[_0x07f7('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x07f7('0x4'))(new Redis(config[_0x07f7('0x3')]));function MailQueue(_0x512c8c){this['id']=_0x512c8c['id']||0x0;this[_0x07f7('0x5')]=_0x512c8c[_0x07f7('0x5')]||'';this[_0x07f7('0x6')]=_0x512c8c[_0x07f7('0x6')]||0xa;this[_0x07f7('0x7')]=_0x512c8c[_0x07f7('0x7')]||_0x07f7('0x8');this[_0x07f7('0x9')]=_0x512c8c['Agents'];this[_0x07f7('0xa')]={};this[_0x07f7('0xb')]=0x0;this[_0x07f7('0xc')]='';this[_0x07f7('0xd')]();this[_0x07f7('0xe')]();}MailQueue[_0x07f7('0xf')]['updateRouting']=function(){var _0x5d930b=this[_0x07f7('0xa')][_0x07f7('0x10')];this[_0x07f7('0xa')]=_[_0x07f7('0x11')](this['Agents'],'id');this['mapAgentsId'][_0x07f7('0x10')]=_0x5d930b;};MailQueue[_0x07f7('0xf')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x07f7('0x12')]=0x0;for(var _0x184fca=0x0;_0x184fca<this[_0x07f7('0x9')]['length'];_0x184fca+=0x1){if(this['Agents'][_0x184fca][_0x07f7('0x13')]){this[_0x07f7('0x14')]+=0x1;}if(this[_0x07f7('0x9')][_0x184fca][_0x07f7('0x15')]){this[_0x07f7('0x12')]+=0x1;}}this[_0x07f7('0x16')]=this['loggedIn']-this[_0x07f7('0x12')];this['available']=this[_0x07f7('0x16')]>=0x0?this[_0x07f7('0x16')]:0x0;var _0x317764={'id':this['id'],'available':this[_0x07f7('0x16')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x07f7('0x12')],'waiting':this[_0x07f7('0xb')]};var _0x308c7a=md5(JSON[_0x07f7('0x17')](_0x317764));if(this[_0x07f7('0xc')]!==_0x308c7a){this[_0x07f7('0xc')]=_0x308c7a;io['to'](util['format'](_0x07f7('0x18'),_0x317764[_0x07f7('0x5')]))[_0x07f7('0x19')]('mail_queue:save',_0x317764);}};module[_0x07f7('0x1a')]=MailQueue;
\ No newline at end of file
+var _0xf572=['format','mail:queue:%s','mail_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','loggedIn','length','online','available','paused','stringify'];(function(_0x332c5a,_0x27c928){var _0x33ec24=function(_0x3ed879){while(--_0x3ed879){_0x332c5a['push'](_0x332c5a['shift']());}};_0x33ec24(++_0x27c928);}(_0xf572,0x17d));var _0x2f57=function(_0x37d501,_0x5a3cd5){_0x37d501=_0x37d501-0x0;var _0x58052e=_0xf572[_0x37d501];return _0x58052e;};'use strict';var _=require('lodash');var md5=require(_0x2f57('0x0'));var util=require(_0x2f57('0x1'));var Redis=require(_0x2f57('0x2'));var config=require(_0x2f57('0x3'));config[_0x2f57('0x4')]=_[_0x2f57('0x5')](config[_0x2f57('0x4')],{'host':_0x2f57('0x6'),'port':0x18eb});var io=require(_0x2f57('0x7'))(new Redis(config[_0x2f57('0x4')]));function MailQueue(_0x375a42){this['id']=_0x375a42['id']||0x0;this[_0x2f57('0x8')]=_0x375a42['name']||'';this[_0x2f57('0x9')]=_0x375a42[_0x2f57('0x9')]||0xa;this[_0x2f57('0xa')]=_0x375a42['strategy']||_0x2f57('0xb');this[_0x2f57('0xc')]=_0x375a42[_0x2f57('0xc')];this['mapAgentsId']={};this[_0x2f57('0xd')]=0x0;this[_0x2f57('0x0')]='';this[_0x2f57('0xe')]();this[_0x2f57('0xf')]();}MailQueue[_0x2f57('0x10')]['updateRouting']=function(){var _0x21477a=this[_0x2f57('0x11')][_0x2f57('0x12')];this[_0x2f57('0x11')]=_['map'](this['Agents'],'id');this[_0x2f57('0x11')][_0x2f57('0x12')]=_0x21477a;};MailQueue[_0x2f57('0x10')][_0x2f57('0xf')]=function(){this[_0x2f57('0x13')]=0x0;this['paused']=0x0;for(var _0x396bae=0x0;_0x396bae<this['Agents'][_0x2f57('0x14')];_0x396bae+=0x1){if(this[_0x2f57('0xc')][_0x396bae][_0x2f57('0x15')]){this[_0x2f57('0x13')]+=0x1;}if(this[_0x2f57('0xc')][_0x396bae]['mailPause']){this['paused']+=0x1;}}this[_0x2f57('0x16')]=this[_0x2f57('0x13')]-this[_0x2f57('0x17')];this[_0x2f57('0x16')]=this[_0x2f57('0x16')]>=0x0?this[_0x2f57('0x16')]:0x0;var _0x4ea227={'id':this['id'],'available':this[_0x2f57('0x16')],'loggedIn':this[_0x2f57('0x13')],'name':this[_0x2f57('0x8')],'paused':this[_0x2f57('0x17')],'waiting':this[_0x2f57('0xd')]};var _0x5191f0=md5(JSON[_0x2f57('0x18')](_0x4ea227));if(this['md5']!==_0x5191f0){this[_0x2f57('0x0')]=_0x5191f0;io['to'](util[_0x2f57('0x19')](_0x2f57('0x1a'),_0x4ea227[_0x2f57('0x8')]))['emit'](_0x2f57('0x1b'),_0x4ea227);}};module[_0x2f57('0x1c')]=MailQueue;
\ No newline at end of file
index 9bf5c46..9532a63 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(_0x53c256,_0x382a24){var _0x25feb6=function(_0x2652fd){while(--_0x2652fd){_0x53c256['push'](_0x53c256['shift']());}};_0x25feb6(++_0x382a24);}(_0x1261,0x144));var _0x1126=function(_0x6acb69,_0xd36dbf){_0x6acb69=_0x6acb69-0x0;var _0x29a021=_0x1261[_0x6acb69];return _0x29a021;};'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 _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x13a145,_0x1597a4){var _0x187f6f=function(_0x3639c8){while(--_0x3639c8){_0x13a145['push'](_0x13a145['shift']());}};_0x187f6f(++_0x1597a4);}(_0x814b,0x1a2));var _0xb814=function(_0xb0de07,_0x3ca2a0){_0xb0de07=_0xb0de07-0x0;var _0x4633d8=_0x814b[_0xb0de07];return _0x4633d8;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627<this[_0xb814('0xc')][_0xb814('0x16')];_0x2ab627+=0x1){if(this[_0xb814('0xc')][_0x2ab627][_0xb814('0x17')]){this[_0xb814('0x14')]+=0x1;}if(this[_0xb814('0xc')][_0x2ab627][_0xb814('0x18')]){this[_0xb814('0x15')]+=0x1;}}this[_0xb814('0x19')]=this[_0xb814('0x14')]-this[_0xb814('0x15')];this['available']=this[_0xb814('0x19')]>=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue;
\ No newline at end of file
index b3f1f89..d98df8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4016=['smsPause','available','waiting','stringify','format','sms:queue:%s','emit','exports','md5','util','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','length','online'];(function(_0x79b649,_0x2115b3){var _0x1af9b1=function(_0x153c9f){while(--_0x153c9f){_0x79b649['push'](_0x79b649['shift']());}};_0x1af9b1(++_0x2115b3);}(_0x4016,0x131));var _0x6401=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x4016[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var md5=require(_0x6401('0x0'));var util=require(_0x6401('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0x6401('0x2')](config['redis'],{'host':_0x6401('0x3'),'port':0x18eb});var io=require(_0x6401('0x4'))(new Redis(config['redis']));function SmsQueue(_0x5c5201){this['id']=_0x5c5201['id']||0x0;this[_0x6401('0x5')]=_0x5c5201[_0x6401('0x5')]||'';this['timeout']=_0x5c5201[_0x6401('0x6')]||0xa;this['strategy']=_0x5c5201[_0x6401('0x7')]||'beepall';this[_0x6401('0x8')]=_0x5c5201[_0x6401('0x8')];this[_0x6401('0x9')]={};this['waiting']=0x0;this['md5']='';this[_0x6401('0xa')]();this[_0x6401('0xb')]();}SmsQueue[_0x6401('0xc')]['updateRouting']=function(){var _0x154a67=this['mapAgentsId']['_rr'];this[_0x6401('0x9')]=_[_0x6401('0xd')](this[_0x6401('0x8')],'id');this[_0x6401('0x9')][_0x6401('0xe')]=_0x154a67;};SmsQueue[_0x6401('0xc')][_0x6401('0xb')]=function(){this[_0x6401('0xf')]=0x0;this[_0x6401('0x10')]=0x0;for(var _0x1f6edf=0x0;_0x1f6edf<this[_0x6401('0x8')][_0x6401('0x11')];_0x1f6edf+=0x1){if(this[_0x6401('0x8')][_0x1f6edf][_0x6401('0x12')]){this['loggedIn']+=0x1;}if(this[_0x6401('0x8')][_0x1f6edf][_0x6401('0x13')]){this[_0x6401('0x10')]+=0x1;}}this[_0x6401('0x14')]=this[_0x6401('0xf')]-this[_0x6401('0x10')];this[_0x6401('0x14')]=this['available']>=0x0?this['available']:0x0;var _0x2d8f2d={'id':this['id'],'available':this['available'],'loggedIn':this[_0x6401('0xf')],'name':this[_0x6401('0x5')],'paused':this[_0x6401('0x10')],'waiting':this[_0x6401('0x15')]};var _0x3e2af8=md5(JSON[_0x6401('0x16')](_0x2d8f2d));if(this[_0x6401('0x0')]!==_0x3e2af8){this['md5']=_0x3e2af8;io['to'](util[_0x6401('0x17')](_0x6401('0x18'),_0x2d8f2d[_0x6401('0x5')]))[_0x6401('0x19')]('sms_queue:save',_0x2d8f2d);}};module[_0x6401('0x1a')]=SmsQueue;
\ No newline at end of file
+var _0xb2b5=['md5','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','length','online','smsPause','available','paused','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting'];(function(_0x2ef44b,_0x553359){var _0x2405b9=function(_0x278290){while(--_0x278290){_0x2ef44b['push'](_0x2ef44b['shift']());}};_0x2405b9(++_0x553359);}(_0xb2b5,0xa3));var _0x5b2b=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xb2b5[_0x273c39];return _0x46d6b5;};'use strict';var _=require('lodash');var md5=require('md5');var util=require('util');var Redis=require('ioredis');var config=require(_0x5b2b('0x0'));config[_0x5b2b('0x1')]=_['defaults'](config['redis'],{'host':_0x5b2b('0x2'),'port':0x18eb});var io=require(_0x5b2b('0x3'))(new Redis(config[_0x5b2b('0x1')]));function SmsQueue(_0x3c073f){this['id']=_0x3c073f['id']||0x0;this['name']=_0x3c073f[_0x5b2b('0x4')]||'';this[_0x5b2b('0x5')]=_0x3c073f['timeout']||0xa;this['strategy']=_0x3c073f[_0x5b2b('0x6')]||_0x5b2b('0x7');this[_0x5b2b('0x8')]=_0x3c073f[_0x5b2b('0x8')];this[_0x5b2b('0x9')]={};this[_0x5b2b('0xa')]=0x0;this[_0x5b2b('0xb')]='';this[_0x5b2b('0xc')]();this['updateRealtime']();}SmsQueue[_0x5b2b('0xd')][_0x5b2b('0xc')]=function(){var _0x53e4ca=this[_0x5b2b('0x9')][_0x5b2b('0xe')];this['mapAgentsId']=_[_0x5b2b('0xf')](this[_0x5b2b('0x8')],'id');this[_0x5b2b('0x9')][_0x5b2b('0xe')]=_0x53e4ca;};SmsQueue[_0x5b2b('0xd')][_0x5b2b('0x10')]=function(){this[_0x5b2b('0x11')]=0x0;this['paused']=0x0;for(var _0x30e9a3=0x0;_0x30e9a3<this['Agents'][_0x5b2b('0x12')];_0x30e9a3+=0x1){if(this[_0x5b2b('0x8')][_0x30e9a3][_0x5b2b('0x13')]){this[_0x5b2b('0x11')]+=0x1;}if(this['Agents'][_0x30e9a3][_0x5b2b('0x14')]){this['paused']+=0x1;}}this[_0x5b2b('0x15')]=this['loggedIn']-this['paused'];this[_0x5b2b('0x15')]=this[_0x5b2b('0x15')]>=0x0?this['available']:0x0;var _0x13eaa1={'id':this['id'],'available':this[_0x5b2b('0x15')],'loggedIn':this[_0x5b2b('0x11')],'name':this[_0x5b2b('0x4')],'paused':this[_0x5b2b('0x16')],'waiting':this['waiting']};var _0x35b589=md5(JSON[_0x5b2b('0x17')](_0x13eaa1));if(this[_0x5b2b('0xb')]!==_0x35b589){this[_0x5b2b('0xb')]=_0x35b589;io['to'](util[_0x5b2b('0x18')](_0x5b2b('0x19'),_0x13eaa1[_0x5b2b('0x4')]))[_0x5b2b('0x1a')](_0x5b2b('0x1b'),_0x13eaa1);}};module[_0x5b2b('0x1c')]=SmsQueue;
\ No newline at end of file
index a736580..9f04b5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f3b=['available','name','format','whatsapp_queue:save','exports','lodash','util','ioredis','defaults','redis','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','waiting','md5','updateRealtime','_rr','map','prototype','length','loggedIn','whatsappPause','paused'];(function(_0x530719,_0x50001d){var _0x473cb8=function(_0x4ae8f8){while(--_0x4ae8f8){_0x530719['push'](_0x530719['shift']());}};_0x473cb8(++_0x50001d);}(_0x8f3b,0x6d));var _0xb8f3=function(_0x26372b,_0x3d81e2){_0x26372b=_0x26372b-0x0;var _0x2e8a9b=_0x8f3b[_0x26372b];return _0x2e8a9b;};'use strict';var _=require(_0xb8f3('0x0'));var md5=require('md5');var util=require(_0xb8f3('0x1'));var Redis=require(_0xb8f3('0x2'));var config=require('../../../config/environment');config['redis']=_[_0xb8f3('0x3')](config[_0xb8f3('0x4')],{'host':_0xb8f3('0x5'),'port':0x18eb});var io=require(_0xb8f3('0x6'))(new Redis(config[_0xb8f3('0x4')]));function WhatsappQueue(_0x3218f2){this['id']=_0x3218f2['id']||0x0;this['name']=_0x3218f2['name']||'';this[_0xb8f3('0x7')]=_0x3218f2[_0xb8f3('0x7')]||0xa;this[_0xb8f3('0x8')]=_0x3218f2[_0xb8f3('0x8')]||_0xb8f3('0x9');this[_0xb8f3('0xa')]=_0x3218f2[_0xb8f3('0xa')];this['mapAgentsId']={};this[_0xb8f3('0xb')]=0x0;this[_0xb8f3('0xc')]='';this['updateRouting']();this[_0xb8f3('0xd')]();}WhatsappQueue['prototype']['updateRouting']=function(){var _0x724d6b=this['mapAgentsId'][_0xb8f3('0xe')];this['mapAgentsId']=_[_0xb8f3('0xf')](this[_0xb8f3('0xa')],'id');this['mapAgentsId'][_0xb8f3('0xe')]=_0x724d6b;};WhatsappQueue[_0xb8f3('0x10')][_0xb8f3('0xd')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x399683=0x0;_0x399683<this['Agents'][_0xb8f3('0x11')];_0x399683+=0x1){if(this[_0xb8f3('0xa')][_0x399683]['online']){this[_0xb8f3('0x12')]+=0x1;}if(this[_0xb8f3('0xa')][_0x399683][_0xb8f3('0x13')]){this[_0xb8f3('0x14')]+=0x1;}}this[_0xb8f3('0x15')]=this['loggedIn']-this[_0xb8f3('0x14')];this[_0xb8f3('0x15')]=this[_0xb8f3('0x15')]>=0x0?this['available']:0x0;var _0x2dc40f={'id':this['id'],'available':this[_0xb8f3('0x15')],'loggedIn':this[_0xb8f3('0x12')],'name':this[_0xb8f3('0x16')],'paused':this[_0xb8f3('0x14')],'waiting':this[_0xb8f3('0xb')]};var _0x3b4322=md5(JSON['stringify'](_0x2dc40f));if(this['md5']!==_0x3b4322){this['md5']=_0x3b4322;io['to'](util[_0xb8f3('0x17')]('whatsapp:queue:%s',_0x2dc40f['name']))['emit'](_0xb8f3('0x18'),_0x2dc40f);}};module[_0xb8f3('0x19')]=WhatsappQueue;
\ No newline at end of file
+var _0xdca0=['whatsapp_queue:save','lodash','md5','util','ioredis','defaults','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','_rr','mapAgentsId','prototype','updateRealtime','loggedIn','paused','length','online','available','waiting','format'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdca0,0x178));var _0x0dca=function(_0x506a54,_0x43ec78){_0x506a54=_0x506a54-0x0;var _0x181ad5=_0xdca0[_0x506a54];return _0x181ad5;};'use strict';var _=require(_0x0dca('0x0'));var md5=require(_0x0dca('0x1'));var util=require(_0x0dca('0x2'));var Redis=require(_0x0dca('0x3'));var config=require('../../../config/environment');config['redis']=_[_0x0dca('0x4')](config[_0x0dca('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x0dca('0x6'))(new Redis(config[_0x0dca('0x5')]));function WhatsappQueue(_0x554960){this['id']=_0x554960['id']||0x0;this[_0x0dca('0x7')]=_0x554960[_0x0dca('0x7')]||'';this[_0x0dca('0x8')]=_0x554960[_0x0dca('0x8')]||0xa;this[_0x0dca('0x9')]=_0x554960[_0x0dca('0x9')]||_0x0dca('0xa');this['Agents']=_0x554960[_0x0dca('0xb')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x0dca('0x1')]='';this['updateRouting']();this['updateRealtime']();}WhatsappQueue['prototype'][_0x0dca('0xc')]=function(){var _0x4290f6=this['mapAgentsId'][_0x0dca('0xd')];this[_0x0dca('0xe')]=_['map'](this[_0x0dca('0xb')],'id');this['mapAgentsId']['_rr']=_0x4290f6;};WhatsappQueue[_0x0dca('0xf')][_0x0dca('0x10')]=function(){this[_0x0dca('0x11')]=0x0;this[_0x0dca('0x12')]=0x0;for(var _0x573e97=0x0;_0x573e97<this['Agents'][_0x0dca('0x13')];_0x573e97+=0x1){if(this[_0x0dca('0xb')][_0x573e97][_0x0dca('0x14')]){this['loggedIn']+=0x1;}if(this[_0x0dca('0xb')][_0x573e97]['whatsappPause']){this[_0x0dca('0x12')]+=0x1;}}this[_0x0dca('0x15')]=this[_0x0dca('0x11')]-this[_0x0dca('0x12')];this[_0x0dca('0x15')]=this['available']>=0x0?this[_0x0dca('0x15')]:0x0;var _0x1701f5={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x0dca('0x7')],'paused':this['paused'],'waiting':this[_0x0dca('0x16')]};var _0x82e245=md5(JSON['stringify'](_0x1701f5));if(this['md5']!==_0x82e245){this['md5']=_0x82e245;io['to'](util[_0x0dca('0x17')]('whatsapp:queue:%s',_0x1701f5['name']))['emit'](_0x0dca('0x18'),_0x1701f5);}};module['exports']=WhatsappQueue;
\ No newline at end of file
index 4fc50e6..def2270 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x519c6b,_0x3c4325){var _0x43d87c=function(_0x39775a){while(--_0x39775a){_0x519c6b['push'](_0x519c6b['shift']());}};_0x43d87c(++_0x3c4325);}(_0xb10b,0x12a));var _0xbb10=function(_0x3cb83f,_0x2bc6dd){_0x3cb83f=_0x3cb83f-0x0;var _0x105d68=_0xb10b[_0x3cb83f];return _0x105d68;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime;
\ No newline at end of file
+var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x18a4fb,_0x3891b9){var _0x5b1f95=function(_0x11b2fd){while(--_0x11b2fd){_0x18a4fb['push'](_0x18a4fb['shift']());}};_0x5b1f95(++_0x3891b9);}(_0xb10b,0x12a));var _0xbb10=function(_0x282442,_0x135555){_0x282442=_0x282442-0x0;var _0xf97807=_0xb10b[_0x282442];return _0xf97807;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime;
\ No newline at end of file
index 89ffe36..aedb159 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x131d=['../client','update','Request','UpdateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0x55ed9c,_0x312431){var _0x43c649=function(_0x27441e){while(--_0x27441e){_0x55ed9c['push'](_0x55ed9c['shift']());}};_0x43c649(++_0x312431);}(_0x131d,0x10a));var _0xd131=function(_0x5f1918,_0x3c8c3f){_0x5f1918=_0x5f1918-0x0;var _0xedbd83=_0x131d[_0x5f1918];return _0xedbd83;};'use strict';var client=require(_0xd131('0x0'));exports[_0xd131('0x1')]=function(_0x51b8c2,_0xfafbe2){return client[_0xd131('0x2')](_0xd131('0x3'),{'body':_0xfafbe2,'options':{'where':{'id':_0x51b8c2}},'log':'updateChatInteraction'});};exports[_0xd131('0x4')]=function(_0xc5f15e,_0x49f5b9){return client[_0xd131('0x2')](_0xd131('0x5'),{'body':_0x49f5b9,'options':{'where':{'id':_0xc5f15e}},'log':_0xd131('0x6')});};
\ No newline at end of file
+var _0xa695=['UpdateChatInteraction','updateChatInteraction','addTags','Request','addTagsToChatInteraction'];(function(_0x1d79df,_0x29a662){var _0x140b59=function(_0x511f98){while(--_0x511f98){_0x1d79df['push'](_0x1d79df['shift']());}};_0x140b59(++_0x29a662);}(_0xa695,0x195));var _0x5a69=function(_0x3dbb93,_0x31a255){_0x3dbb93=_0x3dbb93-0x0;var _0x3ae2e3=_0xa695[_0x3dbb93];return _0x3ae2e3;};'use strict';var client=require('../client');exports['update']=function(_0x3bf93c,_0x5f51f5){return client['Request'](_0x5a69('0x0'),{'body':_0x5f51f5,'options':{'where':{'id':_0x3bf93c}},'log':_0x5a69('0x1')});};exports[_0x5a69('0x2')]=function(_0x5cffde,_0x2a3df7){return client[_0x5a69('0x3')]('AddTagsToChatInteraction',{'body':_0x2a3df7,'options':{'where':{'id':_0x5cffde}},'log':_0x5a69('0x4')});};
\ No newline at end of file
index 46a71ab..3829824 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5716=['../client','create','Request','CreateChatMessage','createChatMessage'];(function(_0x9861ff,_0x41fb17){var _0x48852b=function(_0x557001){while(--_0x557001){_0x9861ff['push'](_0x9861ff['shift']());}};_0x48852b(++_0x41fb17);}(_0x5716,0x8c));var _0x6571=function(_0x430459,_0x58519c){_0x430459=_0x430459-0x0;var _0x3a2439=_0x5716[_0x430459];return _0x3a2439;};'use strict';var client=require(_0x6571('0x0'));exports[_0x6571('0x1')]=function(_0x524b9c){return client[_0x6571('0x2')](_0x6571('0x3'),{'body':_0x524b9c,'log':_0x6571('0x4')});};
\ No newline at end of file
+var _0x5250=['createChatMessage','Request','CreateChatMessage'];(function(_0x374779,_0x3d43df){var _0x37675a=function(_0x55ef1e){while(--_0x55ef1e){_0x374779['push'](_0x374779['shift']());}};_0x37675a(++_0x3d43df);}(_0x5250,0x157));var _0x0525=function(_0x208d75,_0x92d742){_0x208d75=_0x208d75-0x0;var _0x382d27=_0x5250[_0x208d75];return _0x382d27;};'use strict';var client=require('../client');exports['create']=function(_0x200bbc){return client[_0x0525('0x0')](_0x0525('0x1'),{'body':_0x200bbc,'log':_0x0525('0x2')});};
\ No newline at end of file
index 94bfdc7..a2bba62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8375=['name','timeout','strategy','User','Agents','chatPause','../client','getChatQueues','Request'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x8375,0xa8));var _0x5837=function(_0xd85640,_0x2cec9f){_0xd85640=_0xd85640-0x0;var _0x3c170b=_0x8375[_0xd85640];return _0x3c170b;};'use strict';var client=require(_0x5837('0x0'));exports[_0x5837('0x1')]=function(){return function(){return client[_0x5837('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x5837('0x3'),_0x5837('0x4'),_0x5837('0x5')],'include':[{'model':_0x5837('0x6'),'as':_0x5837('0x7'),'attributes':['id',_0x5837('0x3'),'online',_0x5837('0x8')]}]},'log':_0x5837('0x1')});};};
\ No newline at end of file
+var _0x85d0=['Agents','chatPause','name','timeout','strategy','User'];(function(_0x360f17,_0xf88d45){var _0x128eb3=function(_0x465432){while(--_0x465432){_0x360f17['push'](_0x360f17['shift']());}};_0x128eb3(++_0xf88d45);}(_0x85d0,0x164));var _0x085d=function(_0x429c8b,_0x31f238){_0x429c8b=_0x429c8b-0x0;var _0x473671=_0x85d0[_0x429c8b];return _0x473671;};'use strict';var client=require('../client');exports['getChatQueues']=function(){return function(){return client['Request']('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x085d('0x0'),_0x085d('0x1'),_0x085d('0x2')],'include':[{'model':_0x085d('0x3'),'as':_0x085d('0x4'),'attributes':['id',_0x085d('0x0'),'online',_0x085d('0x5')]}]},'log':'getChatQueues'});};};
\ No newline at end of file
index 9c0deb8..7387d8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc1e=['UpdateChatQueueReport','Request','CreateChatQueueReport','update'];(function(_0x390d3a,_0x5eaf16){var _0x294503=function(_0x25afa6){while(--_0x25afa6){_0x390d3a['push'](_0x390d3a['shift']());}};_0x294503(++_0x5eaf16);}(_0xfc1e,0x1c9));var _0xefc1=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xfc1e[_0x21549c];return _0x426cbd;};'use strict';var client=require('../client');exports['create']=function(_0x5407e7){return client[_0xefc1('0x0')](_0xefc1('0x1'),{'body':_0x5407e7,'log':_0xefc1('0x1')});};exports[_0xefc1('0x2')]=function(_0xbe8efc,_0x4960a1){return client[_0xefc1('0x0')](_0xefc1('0x3'),{'body':_0x4960a1,'options':{'where':{'uniqueid':_0xbe8efc},'order':[['id','DESC']],'limit':0x1},'log':'UpdateChatQueueReport'});};
\ No newline at end of file
+var _0x330c=['../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x20174f,_0x44c8cb){var _0x30f03d=function(_0x37dc8b){while(--_0x37dc8b){_0x20174f['push'](_0x20174f['shift']());}};_0x30f03d(++_0x44c8cb);}(_0x330c,0x186));var _0xc330=function(_0x5313fa,_0x7242c5){_0x5313fa=_0x5313fa-0x0;var _0x5bac88=_0x330c[_0x5313fa];return _0x5bac88;};'use strict';var client=require(_0xc330('0x0'));exports[_0xc330('0x1')]=function(_0x38be68){return client[_0xc330('0x2')]('CreateChatQueueReport',{'body':_0x38be68,'log':_0xc330('0x3')});};exports[_0xc330('0x4')]=function(_0x4552ee,_0x207daa){return client[_0xc330('0x2')](_0xc330('0x5'),{'body':_0x207daa,'options':{'where':{'uniqueid':_0x4552ee},'order':[['id','DESC']],'limit':0x1},'log':'UpdateChatQueueReport'});};
\ No newline at end of file
index 53ffdec..505ba54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x4ee964,_0x15b946){var _0x43827e=function(_0x2041d8){while(--_0x2041d8){_0x4ee964['push'](_0x4ee964['shift']());}};_0x43827e(++_0x15b946);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});};
\ No newline at end of file
+var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x1ebc6c,_0x58a00b){var _0x3a826d=function(_0x27d7eb){while(--_0x27d7eb){_0x1ebc6c['push'](_0x1ebc6c['shift']());}};_0x3a826d(++_0x58a00b);}(_0x7a54,0x106));var _0x47a5=function(_0x21b8c,_0x1c10e6){_0x21b8c=_0x21b8c-0x0;var _0x5741bb=_0x7a54[_0x21b8c];return _0x5741bb;};'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 fb7aeff..f02d241 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6589=['../client','CreateFaxMessage'];(function(_0x36dc35,_0xc4ca23){var _0x4b2659=function(_0xf93f48){while(--_0xf93f48){_0x36dc35['push'](_0x36dc35['shift']());}};_0x4b2659(++_0xc4ca23);}(_0x6589,0x16c));var _0x9658=function(_0x5ae8f7,_0x330d91){_0x5ae8f7=_0x5ae8f7-0x0;var _0x54c636=_0x6589[_0x5ae8f7];return _0x54c636;};'use strict';var client=require(_0x9658('0x0'));exports['create']=function(_0x5f3243){return client['Request'](_0x9658('0x1'),{'body':_0x5f3243,'log':'createFaxMessage'});};
\ No newline at end of file
+var _0xff06=['create','CreateFaxMessage','createFaxMessage','../client'];(function(_0x3e2fef,_0x29592e){var _0x1b5288=function(_0x4c8cb5){while(--_0x4c8cb5){_0x3e2fef['push'](_0x3e2fef['shift']());}};_0x1b5288(++_0x29592e);}(_0xff06,0x7f));var _0x6ff0=function(_0x34e481,_0x1f0d05){_0x34e481=_0x34e481-0x0;var _0x195d01=_0xff06[_0x34e481];return _0x195d01;};'use strict';var client=require(_0x6ff0('0x0'));exports[_0x6ff0('0x1')]=function(_0x5d91fc){return client['Request'](_0x6ff0('0x2'),{'body':_0x5d91fc,'log':_0x6ff0('0x3')});};
\ No newline at end of file
index 0a006f6..a42b76d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x620d=['User','online','faxPause','getFaxQueues','GetFaxQueue','name','timeout','strategy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x620d,0x1c3));var _0xd620=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x620d[_0x2d7f0e];return _0x110b07;};'use strict';var client=require('../client');exports[_0xd620('0x0')]=function(){return function(){return client['Request'](_0xd620('0x1'),{'options':{'raw':![],'attributes':['id',_0xd620('0x2'),_0xd620('0x3'),_0xd620('0x4')],'include':[{'model':_0xd620('0x5'),'as':'Agents','attributes':['id',_0xd620('0x2'),_0xd620('0x6'),_0xd620('0x7')]}]},'log':_0xd620('0x0')});};};
\ No newline at end of file
+var _0xc8cb=['strategy','Agents','online','faxPause','../client','getFaxQueues','GetFaxQueue','name'];(function(_0x1c9438,_0x45e960){var _0x450f63=function(_0x2aefb4){while(--_0x2aefb4){_0x1c9438['push'](_0x1c9438['shift']());}};_0x450f63(++_0x45e960);}(_0xc8cb,0x174));var _0xbc8c=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0xc8cb[_0x381589];return _0x2a075d;};'use strict';var client=require(_0xbc8c('0x0'));exports[_0xbc8c('0x1')]=function(){return function(){return client['Request'](_0xbc8c('0x2'),{'options':{'raw':![],'attributes':['id',_0xbc8c('0x3'),'timeout',_0xbc8c('0x4')],'include':[{'model':'User','as':_0xbc8c('0x5'),'attributes':['id','name',_0xbc8c('0x6'),_0xbc8c('0x7')]}]},'log':'getFaxQueues'});};};
\ No newline at end of file
index d9822f5..9595e43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8898=['Request','../client','create','update'];(function(_0x5ce766,_0x495d80){var _0x4a68f3=function(_0x39aa58){while(--_0x39aa58){_0x5ce766['push'](_0x5ce766['shift']());}};_0x4a68f3(++_0x495d80);}(_0x8898,0x6d));var _0x8889=function(_0x319611,_0x35e4b2){_0x319611=_0x319611-0x0;var _0x290734=_0x8898[_0x319611];return _0x290734;};'use strict';var client=require(_0x8889('0x0'));exports[_0x8889('0x1')]=function(_0xa2071a){return client['Request']('CreateFaxQueueReport',{'body':_0xa2071a,'log':'CreateFaxQueueReport'});};exports[_0x8889('0x2')]=function(_0x55b4fd,_0x312b42){return client[_0x8889('0x3')]('UpdateFaxQueueReport',{'body':_0x312b42,'options':{'where':{'uniqueid':_0x55b4fd},'order':[['id','DESC']],'limit':0x1},'log':'UpdateFaxQueueReport'});};
\ No newline at end of file
+var _0x4ed4=['DESC','../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x4ed4,0x1b3));var _0x44ed=function(_0x2a875,_0x40e43e){_0x2a875=_0x2a875-0x0;var _0x373fd0=_0x4ed4[_0x2a875];return _0x373fd0;};'use strict';var client=require(_0x44ed('0x0'));exports[_0x44ed('0x1')]=function(_0x4a1b05){return client[_0x44ed('0x2')](_0x44ed('0x3'),{'body':_0x4a1b05,'log':_0x44ed('0x3')});};exports[_0x44ed('0x4')]=function(_0x4c87b2,_0x3a14fd){return client['Request'](_0x44ed('0x5'),{'body':_0x3a14fd,'options':{'where':{'uniqueid':_0x4c87b2},'order':[['id',_0x44ed('0x6')]],'limit':0x1},'log':_0x44ed('0x5')});};
\ No newline at end of file
index 77130c2..f2fd8f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa7e=['Interval','Intervals','interval','getIntervals','Request','GetInterval','name'];(function(_0x321ba5,_0x5b2d3a){var _0x4c3d68=function(_0xbfe274){while(--_0xbfe274){_0x321ba5['push'](_0x321ba5['shift']());}};_0x4c3d68(++_0x5b2d3a);}(_0xfa7e,0x12a));var _0xefa7=function(_0x2c1dcd,_0x350452){_0x2c1dcd=_0x2c1dcd-0x0;var _0x158ce5=_0xfa7e[_0x2c1dcd];return _0x158ce5;};'use strict';var client=require('../client');exports['getIntervals']=function(){return function(){return client[_0xefa7('0x0')](_0xefa7('0x1'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xefa7('0x2')],'include':[{'model':_0xefa7('0x3'),'as':_0xefa7('0x4'),'attributes':['id',_0xefa7('0x2'),_0xefa7('0x5')]}]},'log':_0xefa7('0x6')});};};
\ No newline at end of file
+var _0xd7e3=['Interval','name','interval','../client','getIntervals','Request'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xd7e3,0x1b9));var _0x3d7e=function(_0x21799b,_0x4694af){_0x21799b=_0x21799b-0x0;var _0x317530=_0xd7e3[_0x21799b];return _0x317530;};'use strict';var client=require(_0x3d7e('0x0'));exports[_0x3d7e('0x1')]=function(){return function(){return client[_0x3d7e('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x3d7e('0x3'),'as':'Intervals','attributes':['id',_0x3d7e('0x4'),_0x3d7e('0x5')]}]},'log':'getIntervals'});};};
\ No newline at end of file
index f9cce61..a46e7d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93e9=['addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction','AddTagsToMailInteraction'];(function(_0x4a4812,_0x5871b2){var _0x398037=function(_0x5f893e){while(--_0x5f893e){_0x4a4812['push'](_0x4a4812['shift']());}};_0x398037(++_0x5871b2);}(_0x93e9,0xcc));var _0x993e=function(_0x4ee140,_0xddce08){_0x4ee140=_0x4ee140-0x0;var _0x1c14bd=_0x93e9[_0x4ee140];return _0x1c14bd;};'use strict';var client=require(_0x993e('0x0'));exports[_0x993e('0x1')]=function(_0x444623,_0x4405ca){return client[_0x993e('0x2')](_0x993e('0x3'),{'body':_0x4405ca,'options':{'where':{'id':_0x444623}},'log':_0x993e('0x4')});};exports['addTags']=function(_0x55f739,_0x1b762e){return client[_0x993e('0x2')](_0x993e('0x5'),{'body':_0x1b762e,'options':{'where':{'id':_0x55f739}},'log':_0x993e('0x6')});};
\ No newline at end of file
+var _0x0b0e=['Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client'];(function(_0x5182f9,_0x4acf0c){var _0x4c9fad=function(_0x453b0e){while(--_0x453b0e){_0x5182f9['push'](_0x5182f9['shift']());}};_0x4c9fad(++_0x4acf0c);}(_0x0b0e,0x187));var _0xe0b0=function(_0x244862,_0x3da79e){_0x244862=_0x244862-0x0;var _0x2bce23=_0x0b0e[_0x244862];return _0x2bce23;};'use strict';var client=require(_0xe0b0('0x0'));exports['update']=function(_0xc416e3,_0x536e9b){return client[_0xe0b0('0x1')](_0xe0b0('0x2'),{'body':_0x536e9b,'options':{'where':{'id':_0xc416e3}},'log':_0xe0b0('0x3')});};exports[_0xe0b0('0x4')]=function(_0x28040c,_0x38a058){return client[_0xe0b0('0x1')](_0xe0b0('0x5'),{'body':_0x38a058,'options':{'where':{'id':_0x28040c}},'log':_0xe0b0('0x6')});};
\ No newline at end of file
index 6080da8..449cb97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcce0=['createMailMessage','create','Request'];(function(_0xe0e9a4,_0x359e29){var _0x47e93c=function(_0x5835a7){while(--_0x5835a7){_0xe0e9a4['push'](_0xe0e9a4['shift']());}};_0x47e93c(++_0x359e29);}(_0xcce0,0x1ae));var _0x0cce=function(_0x3fb4b4,_0x202910){_0x3fb4b4=_0x3fb4b4-0x0;var _0x3acabb=_0xcce0[_0x3fb4b4];return _0x3acabb;};'use strict';var client=require('../client');exports[_0x0cce('0x0')]=function(_0x547335){return client[_0x0cce('0x1')]('CreateMailMessage',{'body':_0x547335,'log':_0x0cce('0x2')});};
\ No newline at end of file
+var _0xa392=['CreateMailMessage','create','Request'];(function(_0x3703fb,_0x1c6a78){var _0x27181a=function(_0x280fee){while(--_0x280fee){_0x3703fb['push'](_0x3703fb['shift']());}};_0x27181a(++_0x1c6a78);}(_0xa392,0x1c0));var _0x2a39=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xa392[_0x1928c9];return _0x51b5fb;};'use strict';var client=require('../client');exports[_0x2a39('0x0')]=function(_0x137f97){return client[_0x2a39('0x1')](_0x2a39('0x2'),{'body':_0x137f97,'log':'createMailMessage'});};
\ No newline at end of file
index a983189..bdb5216 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab33=['../client','getMailQueues','Request','GetMailQueue','name','strategy','User','Agents','online','mailPause'];(function(_0x483603,_0x1ada16){var _0x3ae351=function(_0x4c549e){while(--_0x4c549e){_0x483603['push'](_0x483603['shift']());}};_0x3ae351(++_0x1ada16);}(_0xab33,0xf0));var _0x3ab3=function(_0x11ef33,_0x1d0c94){_0x11ef33=_0x11ef33-0x0;var _0xff86fd=_0xab33[_0x11ef33];return _0xff86fd;};'use strict';var client=require(_0x3ab3('0x0'));exports[_0x3ab3('0x1')]=function(){return function(){return client[_0x3ab3('0x2')](_0x3ab3('0x3'),{'options':{'raw':![],'attributes':['id',_0x3ab3('0x4'),'timeout',_0x3ab3('0x5')],'include':[{'model':_0x3ab3('0x6'),'as':_0x3ab3('0x7'),'attributes':['id',_0x3ab3('0x4'),_0x3ab3('0x8'),_0x3ab3('0x9')]}]},'log':'getMailQueues'});};};
\ No newline at end of file
+var _0xc1ed=['getMailQueues','Request','GetMailQueue','name','User','Agents','online','mailPause'];(function(_0x2361a3,_0x24b613){var _0x40a829=function(_0x379565){while(--_0x379565){_0x2361a3['push'](_0x2361a3['shift']());}};_0x40a829(++_0x24b613);}(_0xc1ed,0xe0));var _0xdc1e=function(_0x4bf4d7,_0x17f6d2){_0x4bf4d7=_0x4bf4d7-0x0;var _0x3130c4=_0xc1ed[_0x4bf4d7];return _0x3130c4;};'use strict';var client=require('../client');exports[_0xdc1e('0x0')]=function(){return function(){return client[_0xdc1e('0x1')](_0xdc1e('0x2'),{'options':{'raw':![],'attributes':['id',_0xdc1e('0x3'),'timeout','strategy'],'include':[{'model':_0xdc1e('0x4'),'as':_0xdc1e('0x5'),'attributes':['id',_0xdc1e('0x3'),_0xdc1e('0x6'),_0xdc1e('0x7')]}]},'log':'getMailQueues'});};};
\ No newline at end of file
index 7a2384e..b884df1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x094b=['UpdateMailQueueReport','DESC','../client','create','CreateMailQueueReport','update'];(function(_0x1c36b1,_0x251ea5){var _0x1aefd6=function(_0x1ea5e1){while(--_0x1ea5e1){_0x1c36b1['push'](_0x1c36b1['shift']());}};_0x1aefd6(++_0x251ea5);}(_0x094b,0x1ee));var _0xb094=function(_0x5bd022,_0x34ae02){_0x5bd022=_0x5bd022-0x0;var _0x207041=_0x094b[_0x5bd022];return _0x207041;};'use strict';var client=require(_0xb094('0x0'));exports[_0xb094('0x1')]=function(_0x1ad102){return client['Request']('CreateMailQueueReport',{'body':_0x1ad102,'log':_0xb094('0x2')});};exports[_0xb094('0x3')]=function(_0x25ddf1,_0x5400bf){return client['Request'](_0xb094('0x4'),{'body':_0x5400bf,'options':{'where':{'uniqueid':_0x25ddf1},'order':[['id',_0xb094('0x5')]],'limit':0x1},'log':_0xb094('0x4')});};
\ No newline at end of file
+var _0x0eb8=['CreateMailQueueReport','update','Request','UpdateMailQueueReport','DESC','../client','create'];(function(_0x932a31,_0x4ca734){var _0x244dea=function(_0x5c137c){while(--_0x5c137c){_0x932a31['push'](_0x932a31['shift']());}};_0x244dea(++_0x4ca734);}(_0x0eb8,0xb4));var _0x80eb=function(_0x37fcc2,_0x25d689){_0x37fcc2=_0x37fcc2-0x0;var _0x186f58=_0x0eb8[_0x37fcc2];return _0x186f58;};'use strict';var client=require(_0x80eb('0x0'));exports[_0x80eb('0x1')]=function(_0x1147cc){return client['Request']('CreateMailQueueReport',{'body':_0x1147cc,'log':_0x80eb('0x2')});};exports[_0x80eb('0x3')]=function(_0x454232,_0x1c90eb){return client[_0x80eb('0x4')](_0x80eb('0x5'),{'body':_0x1c90eb,'options':{'where':{'uniqueid':_0x454232},'order':[['id',_0x80eb('0x6')]],'limit':0x1},'log':_0x80eb('0x5')});};
\ No newline at end of file
index ee56dd9..fb001de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0028=['addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request','updateOpenchannelInteraction'];(function(_0x532a03,_0x1064a1){var _0x1d8711=function(_0x53324e){while(--_0x53324e){_0x532a03['push'](_0x532a03['shift']());}};_0x1d8711(++_0x1064a1);}(_0x0028,0xdc));var _0x8002=function(_0x142d3e,_0x353e86){_0x142d3e=_0x142d3e-0x0;var _0x493084=_0x0028[_0x142d3e];return _0x493084;};'use strict';var client=require(_0x8002('0x0'));exports[_0x8002('0x1')]=function(_0x10dc30,_0x2dea68){return client[_0x8002('0x2')]('UpdateOpenchannelInteraction',{'body':_0x2dea68,'options':{'where':{'id':_0x10dc30}},'log':_0x8002('0x3')});};exports[_0x8002('0x4')]=function(_0x2c0493,_0x18e3d1){return client[_0x8002('0x2')](_0x8002('0x5'),{'body':_0x18e3d1,'options':{'where':{'id':_0x2c0493}},'log':_0x8002('0x6')});};
\ No newline at end of file
+var _0x16d9=['Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update'];(function(_0x242782,_0x234e08){var _0x5a6057=function(_0x2c3906){while(--_0x2c3906){_0x242782['push'](_0x242782['shift']());}};_0x5a6057(++_0x234e08);}(_0x16d9,0x1ae));var _0x916d=function(_0xc17d60,_0x4d3616){_0xc17d60=_0xc17d60-0x0;var _0x462396=_0x16d9[_0xc17d60];return _0x462396;};'use strict';var client=require(_0x916d('0x0'));exports[_0x916d('0x1')]=function(_0x3c38e2,_0x4eec28){return client[_0x916d('0x2')](_0x916d('0x3'),{'body':_0x4eec28,'options':{'where':{'id':_0x3c38e2}},'log':_0x916d('0x4')});};exports[_0x916d('0x5')]=function(_0x3e3520,_0x93aace){return client[_0x916d('0x2')](_0x916d('0x6'),{'body':_0x93aace,'options':{'where':{'id':_0x3e3520}},'log':_0x916d('0x7')});};
\ No newline at end of file
index daed39c..c05f65f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f9b=['../client','create','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x50521f,_0x4375b3){var _0x29b4be=function(_0x1cb06e){while(--_0x1cb06e){_0x50521f['push'](_0x50521f['shift']());}};_0x29b4be(++_0x4375b3);}(_0x8f9b,0x136));var _0xb8f9=function(_0x1d2323,_0x26a478){_0x1d2323=_0x1d2323-0x0;var _0x570644=_0x8f9b[_0x1d2323];return _0x570644;};'use strict';var client=require(_0xb8f9('0x0'));exports[_0xb8f9('0x1')]=function(_0x37160a){return client[_0xb8f9('0x2')](_0xb8f9('0x3'),{'body':_0x37160a,'log':_0xb8f9('0x4')});};
\ No newline at end of file
+var _0xb740=['Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xb740,0xdf));var _0x0b74=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb740[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x0b74('0x0'));exports['create']=function(_0x327f56){return client[_0x0b74('0x1')](_0x0b74('0x2'),{'body':_0x327f56,'log':_0x0b74('0x3')});};
\ No newline at end of file
index c2ec663..9779a71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa920=['timeout','User','online','openchannelPause','getOpenchannelQueues','Request','GetOpenchannelQueue','name'];(function(_0x566a46,_0x1c9d7a){var _0x1483d9=function(_0x37a16a){while(--_0x37a16a){_0x566a46['push'](_0x566a46['shift']());}};_0x1483d9(++_0x1c9d7a);}(_0xa920,0x7c));var _0x0a92=function(_0x3f936b,_0x4832f){_0x3f936b=_0x3f936b-0x0;var _0x5303f9=_0xa920[_0x3f936b];return _0x5303f9;};'use strict';var client=require('../client');exports[_0x0a92('0x0')]=function(){return function(){return client[_0x0a92('0x1')](_0x0a92('0x2'),{'options':{'raw':![],'attributes':['id',_0x0a92('0x3'),_0x0a92('0x4'),'strategy'],'include':[{'model':_0x0a92('0x5'),'as':'Agents','attributes':['id',_0x0a92('0x3'),_0x0a92('0x6'),_0x0a92('0x7')]}]},'log':_0x0a92('0x0')});};};
\ No newline at end of file
+var _0x066f=['Agents','openchannelPause','getOpenchannelQueues','Request','name','timeout','User'];(function(_0x492535,_0x46524a){var _0x256620=function(_0x3015f8){while(--_0x3015f8){_0x492535['push'](_0x492535['shift']());}};_0x256620(++_0x46524a);}(_0x066f,0x137));var _0xf066=function(_0x44e349,_0xb833a0){_0x44e349=_0x44e349-0x0;var _0x3d6486=_0x066f[_0x44e349];return _0x3d6486;};'use strict';var client=require('../client');exports['getOpenchannelQueues']=function(){return function(){return client[_0xf066('0x0')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xf066('0x1'),_0xf066('0x2'),'strategy'],'include':[{'model':_0xf066('0x3'),'as':_0xf066('0x4'),'attributes':['id',_0xf066('0x1'),'online',_0xf066('0x5')]}]},'log':_0xf066('0x6')});};};
\ No newline at end of file
index 95418c0..6f6c1b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90db=['create','Request','UpdateOpenchannelQueueReport','DESC'];(function(_0x128443,_0x2fe025){var _0x1a4ce1=function(_0x12d72c){while(--_0x12d72c){_0x128443['push'](_0x128443['shift']());}};_0x1a4ce1(++_0x2fe025);}(_0x90db,0x1c0));var _0xb90d=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x90db[_0x220dbb];return _0x2b77de;};'use strict';var client=require('../client');exports[_0xb90d('0x0')]=function(_0x289d0e){return client[_0xb90d('0x1')]('CreateOpenchannelQueueReport',{'body':_0x289d0e,'log':'CreateOpenchannelQueueReport'});};exports['update']=function(_0x50a80e,_0x4aaef1){return client[_0xb90d('0x1')](_0xb90d('0x2'),{'body':_0x4aaef1,'options':{'where':{'uniqueid':_0x50a80e},'order':[['id',_0xb90d('0x3')]],'limit':0x1},'log':_0xb90d('0x2')});};
\ No newline at end of file
+var _0x0b1e=['../client','create','Request','CreateOpenchannelQueueReport','DESC'];(function(_0x4fe35d,_0x21fee1){var _0x5bb28e=function(_0x214051){while(--_0x214051){_0x4fe35d['push'](_0x4fe35d['shift']());}};_0x5bb28e(++_0x21fee1);}(_0x0b1e,0x1ef));var _0xe0b1=function(_0x5ecadc,_0x1cf9f1){_0x5ecadc=_0x5ecadc-0x0;var _0x565037=_0x0b1e[_0x5ecadc];return _0x565037;};'use strict';var client=require(_0xe0b1('0x0'));exports[_0xe0b1('0x1')]=function(_0x2e9887){return client[_0xe0b1('0x2')](_0xe0b1('0x3'),{'body':_0x2e9887,'log':_0xe0b1('0x3')});};exports['update']=function(_0x40effc,_0x25cad1){return client[_0xe0b1('0x2')]('UpdateOpenchannelQueueReport',{'body':_0x25cad1,'options':{'where':{'uniqueid':_0x40effc},'order':[['id',_0xe0b1('0x4')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});};
\ No newline at end of file
index 1f96846..68c0f71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07c3=['update','Request','UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0x4ba9d7,_0x2ec6cc){var _0x45866e=function(_0x19036a){while(--_0x19036a){_0x4ba9d7['push'](_0x4ba9d7['shift']());}};_0x45866e(++_0x2ec6cc);}(_0x07c3,0x1bf));var _0x307c=function(_0x493cea,_0x144c6a){_0x493cea=_0x493cea-0x0;var _0x1c32ba=_0x07c3[_0x493cea];return _0x1c32ba;};'use strict';var client=require(_0x307c('0x0'));exports[_0x307c('0x1')]=function(_0x44b77c,_0xc54e42){return client[_0x307c('0x2')](_0x307c('0x3'),{'body':_0xc54e42,'options':{'where':{'id':_0x44b77c}},'log':_0x307c('0x4')});};exports[_0x307c('0x5')]=function(_0x52cf54,_0x37adf4){return client[_0x307c('0x2')](_0x307c('0x6'),{'body':_0x37adf4,'options':{'where':{'id':_0x52cf54}},'log':_0x307c('0x7')});};
\ No newline at end of file
+var _0xaab2=['addTags','AddTagsToSmsInteraction','update','UpdateSmsInteraction','updateSmsInteraction'];(function(_0x2120e0,_0x591baf){var _0x116e96=function(_0xfc9bd){while(--_0xfc9bd){_0x2120e0['push'](_0x2120e0['shift']());}};_0x116e96(++_0x591baf);}(_0xaab2,0xca));var _0x2aab=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xaab2[_0x1facfa];return _0x9ec701;};'use strict';var client=require('../client');exports[_0x2aab('0x0')]=function(_0x341c15,_0x1d1057){return client['Request'](_0x2aab('0x1'),{'body':_0x1d1057,'options':{'where':{'id':_0x341c15}},'log':_0x2aab('0x2')});};exports[_0x2aab('0x3')]=function(_0x342fe5,_0x3d6ee0){return client['Request'](_0x2aab('0x4'),{'body':_0x3d6ee0,'options':{'where':{'id':_0x342fe5}},'log':'addTagsToSmsInteraction'});};
\ No newline at end of file
index e717139..ba14ca5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c96=['createSmsMessage','../client'];(function(_0x22bdd3,_0x552e50){var _0x44d9d9=function(_0x2b4ab9){while(--_0x2b4ab9){_0x22bdd3['push'](_0x22bdd3['shift']());}};_0x44d9d9(++_0x552e50);}(_0x6c96,0xf1));var _0x66c9=function(_0x3b8884,_0x2b45bc){_0x3b8884=_0x3b8884-0x0;var _0x4ef77e=_0x6c96[_0x3b8884];return _0x4ef77e;};'use strict';var client=require(_0x66c9('0x0'));exports['create']=function(_0x291fae){return client['Request']('CreateSmsMessage',{'body':_0x291fae,'log':_0x66c9('0x1')});};
\ No newline at end of file
+var _0xd83d=['../client','create','Request'];(function(_0x46efd7,_0x43f84d){var _0x5637e4=function(_0x54e078){while(--_0x54e078){_0x46efd7['push'](_0x46efd7['shift']());}};_0x5637e4(++_0x43f84d);}(_0xd83d,0x13b));var _0xdd83=function(_0x13c738,_0x30dee6){_0x13c738=_0x13c738-0x0;var _0x2248fc=_0xd83d[_0x13c738];return _0x2248fc;};'use strict';var client=require(_0xdd83('0x0'));exports[_0xdd83('0x1')]=function(_0x41f881){return client[_0xdd83('0x2')]('CreateSmsMessage',{'body':_0x41f881,'log':'createSmsMessage'});};
\ No newline at end of file
index f43946e..08a2f4e 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(_0x340781,_0x32b659){var _0x1a6ab9=function(_0x17823c){while(--_0x17823c){_0x340781['push'](_0x340781['shift']());}};_0x1a6ab9(++_0x32b659);}(_0x70e0,0x17b));var _0x070e=function(_0x2d6e7d,_0x2220e7){_0x2d6e7d=_0x2d6e7d-0x0;var _0x57e226=_0x70e0[_0x2d6e7d];return _0x57e226;};'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 _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x3b55a6,_0x36cd7c){var _0x2da6da=function(_0x64909a){while(--_0x64909a){_0x3b55a6['push'](_0x3b55a6['shift']());}};_0x2da6da(++_0x36cd7c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2a4095,_0x13f4f0){_0x2a4095=_0x2a4095-0x0;var _0x52eeab=_0xcb91[_0x2a4095];return _0x52eeab;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};};
\ No newline at end of file
index 0dc5ff3..de75097 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x5c17cc,_0x17d1a2){var _0x187cf5=function(_0x558f51){while(--_0x558f51){_0x5c17cc['push'](_0x5c17cc['shift']());}};_0x187cf5(++_0x17d1a2);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'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 _0x55ca=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0x41d523,_0x5f2a67){var _0x3719cc=function(_0x109d4a){while(--_0x109d4a){_0x41d523['push'](_0x41d523['shift']());}};_0x3719cc(++_0x5f2a67);}(_0x55ca,0x126));var _0xa55c=function(_0x2ed51e,_0x20d606){_0x2ed51e=_0x2ed51e-0x0;var _0x44318c=_0x55ca[_0x2ed51e];return _0x44318c;};'use strict';var client=require(_0xa55c('0x0'));exports[_0xa55c('0x1')]=function(_0x4e78b4){return client['Request']('CreateSmsQueueReport',{'body':_0x4e78b4,'log':_0xa55c('0x2')});};exports[_0xa55c('0x3')]=function(_0x5dc716,_0x3b478a){return client[_0xa55c('0x4')](_0xa55c('0x5'),{'body':_0x3b478a,'options':{'where':{'uniqueid':_0x5dc716},'order':[['id',_0xa55c('0x6')]],'limit':0x1},'log':_0xa55c('0x5')});};
\ No newline at end of file
index 451a4fe..5142f48 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(_0x2328ac,_0x6ee6fa){var _0x4de2a3=function(_0x5946e7){while(--_0x5946e7){_0x2328ac['push'](_0x2328ac['shift']());}};_0x4de2a3(++_0x6ee6fa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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(_0x240776,_0xeefa88){var _0x58d284=function(_0x282097){while(--_0x282097){_0x240776['push'](_0x240776['shift']());}};_0x58d284(++_0xeefa88);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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 dce77d3..1097cad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f02=['addTags','addTagsToWhatsappInteraction','../client','Request','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x53bcfa,_0x20eb6e){var _0x25e64e=function(_0x1d9515){while(--_0x1d9515){_0x53bcfa['push'](_0x53bcfa['shift']());}};_0x25e64e(++_0x20eb6e);}(_0x9f02,0x68));var _0x29f0=function(_0x47133f,_0x4e69e3){_0x47133f=_0x47133f-0x0;var _0x1982d4=_0x9f02[_0x47133f];return _0x1982d4;};'use strict';var client=require(_0x29f0('0x0'));exports['update']=function(_0x51f5c2,_0x4bb7b2){return client[_0x29f0('0x1')](_0x29f0('0x2'),{'body':_0x4bb7b2,'options':{'where':{'id':_0x51f5c2}},'log':_0x29f0('0x3')});};exports[_0x29f0('0x4')]=function(_0x1a49c1,_0x47e569){return client[_0x29f0('0x1')]('AddTagsToWhatsappInteraction',{'body':_0x47e569,'options':{'where':{'id':_0x1a49c1}},'log':_0x29f0('0x5')});};
\ No newline at end of file
+var _0x5ae0=['AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','update','Request','UpdateWhatsappInteraction','addTags'];(function(_0x227b64,_0x1c6f72){var _0xc84cb5=function(_0x12e690){while(--_0x12e690){_0x227b64['push'](_0x227b64['shift']());}};_0xc84cb5(++_0x1c6f72);}(_0x5ae0,0xf8));var _0x05ae=function(_0x1cac25,_0x292606){_0x1cac25=_0x1cac25-0x0;var _0x2695f4=_0x5ae0[_0x1cac25];return _0x2695f4;};'use strict';var client=require('../client');exports[_0x05ae('0x0')]=function(_0x267a88,_0x529b07){return client[_0x05ae('0x1')](_0x05ae('0x2'),{'body':_0x529b07,'options':{'where':{'id':_0x267a88}},'log':'updateWhatsappInteraction'});};exports[_0x05ae('0x3')]=function(_0xaae02b,_0x4aac85){return client['Request'](_0x05ae('0x4'),{'body':_0x4aac85,'options':{'where':{'id':_0xaae02b}},'log':_0x05ae('0x5')});};
\ No newline at end of file
index 0f1598c..d08ab9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x208f=['createWhatsappMessage','create','Request','CreateWhatsappMessage'];(function(_0x1b7ab6,_0x4323b0){var _0x3d1e62=function(_0x4874c9){while(--_0x4874c9){_0x1b7ab6['push'](_0x1b7ab6['shift']());}};_0x3d1e62(++_0x4323b0);}(_0x208f,0xa1));var _0xf208=function(_0x124be1,_0x3d5b4f){_0x124be1=_0x124be1-0x0;var _0x624ea5=_0x208f[_0x124be1];return _0x624ea5;};'use strict';var client=require('../client');exports[_0xf208('0x0')]=function(_0x2fc03c){return client[_0xf208('0x1')](_0xf208('0x2'),{'body':_0x2fc03c,'log':_0xf208('0x3')});};
\ No newline at end of file
+var _0x8e40=['../client','create','Request','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x8e40,0x17c));var _0x08e4=function(_0x54a28a,_0x1ba1fe){_0x54a28a=_0x54a28a-0x0;var _0x3da1f1=_0x8e40[_0x54a28a];return _0x3da1f1;};'use strict';var client=require(_0x08e4('0x0'));exports[_0x08e4('0x1')]=function(_0x34dc3c){return client[_0x08e4('0x2')](_0x08e4('0x3'),{'body':_0x34dc3c,'log':_0x08e4('0x4')});};
\ No newline at end of file
index 4a2486e..4a499c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90ae=['getWhatsappQueues','Request','GetWhatsappQueue','name','timeout','strategy','User','online','whatsappPause'];(function(_0x18b2a6,_0x9a66ec){var _0x78b233=function(_0x45fa24){while(--_0x45fa24){_0x18b2a6['push'](_0x18b2a6['shift']());}};_0x78b233(++_0x9a66ec);}(_0x90ae,0xbd));var _0xe90a=function(_0x2a0ab7,_0x14ea1d){_0x2a0ab7=_0x2a0ab7-0x0;var _0x2fb6f7=_0x90ae[_0x2a0ab7];return _0x2fb6f7;};'use strict';var client=require('../client');exports[_0xe90a('0x0')]=function(){return function(){return client[_0xe90a('0x1')](_0xe90a('0x2'),{'options':{'raw':![],'attributes':['id',_0xe90a('0x3'),_0xe90a('0x4'),_0xe90a('0x5')],'include':[{'model':_0xe90a('0x6'),'as':'Agents','attributes':['id','name',_0xe90a('0x7'),_0xe90a('0x8')]}]},'log':_0xe90a('0x0')});};};
\ No newline at end of file
+var _0xdd4b=['timeout','User','Agents','whatsappPause','../client','getWhatsappQueues','GetWhatsappQueue','name'];(function(_0x225e24,_0x478574){var _0x526038=function(_0xfe2533){while(--_0xfe2533){_0x225e24['push'](_0x225e24['shift']());}};_0x526038(++_0x478574);}(_0xdd4b,0x164));var _0xbdd4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xdd4b[_0x8c43de];return _0xa6591b;};'use strict';var client=require(_0xbdd4('0x0'));exports[_0xbdd4('0x1')]=function(){return function(){return client['Request'](_0xbdd4('0x2'),{'options':{'raw':![],'attributes':['id',_0xbdd4('0x3'),_0xbdd4('0x4'),'strategy'],'include':[{'model':_0xbdd4('0x5'),'as':_0xbdd4('0x6'),'attributes':['id',_0xbdd4('0x3'),'online',_0xbdd4('0x7')]}]},'log':_0xbdd4('0x1')});};};
\ No newline at end of file
index 8699e53..427f5e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63d4=['update','UpdateWhatsappQueueReport','DESC','../client','create','Request','CreateWhatsappQueueReport'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x63d4,0x1b5));var _0x463d=function(_0x23320c,_0x236158){_0x23320c=_0x23320c-0x0;var _0x1d8207=_0x63d4[_0x23320c];return _0x1d8207;};'use strict';var client=require(_0x463d('0x0'));exports[_0x463d('0x1')]=function(_0x14b44d){return client[_0x463d('0x2')](_0x463d('0x3'),{'body':_0x14b44d,'log':_0x463d('0x3')});};exports[_0x463d('0x4')]=function(_0x4d8959,_0x15c17a){return client[_0x463d('0x2')](_0x463d('0x5'),{'body':_0x15c17a,'options':{'where':{'uniqueid':_0x4d8959},'order':[['id',_0x463d('0x6')]],'limit':0x1},'log':_0x463d('0x5')});};
\ No newline at end of file
+var _0x9132=['Request','UpdateWhatsappQueueReport','create','CreateWhatsappQueueReport','update'];(function(_0x3e973f,_0x318928){var _0x19e5ac=function(_0x215f17){while(--_0x215f17){_0x3e973f['push'](_0x3e973f['shift']());}};_0x19e5ac(++_0x318928);}(_0x9132,0x89));var _0x2913=function(_0x3c2d4f,_0x2b6c4c){_0x3c2d4f=_0x3c2d4f-0x0;var _0x380ed3=_0x9132[_0x3c2d4f];return _0x380ed3;};'use strict';var client=require('../client');exports[_0x2913('0x0')]=function(_0x3afd19){return client['Request']('CreateWhatsappQueueReport',{'body':_0x3afd19,'log':_0x2913('0x1')});};exports[_0x2913('0x2')]=function(_0x1b8db8,_0x4441ba){return client[_0x2913('0x3')](_0x2913('0x4'),{'body':_0x4441ba,'options':{'where':{'uniqueid':_0x1b8db8},'order':[['id','DESC']],'limit':0x1},'log':_0x2913('0x4')});};
\ No newline at end of file
index 80ace4e..6a7c37b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4438=['timeout','createQueue','atimeout','channel','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','close','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','seq-queue','../../../../config/logger','routing','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','validate','error','[%s][AGENT]\x20%s','message','join','stop','find'];(function(_0x419dc6,_0x176a99){var _0x5b6c56=function(_0x535ea5){while(--_0x535ea5){_0x419dc6['push'](_0x419dc6['shift']());}};_0x5b6c56(++_0x176a99);}(_0x4438,0xc6));var _0x8443=function(_0x5b1c50,_0x56e694){_0x5b1c50=_0x5b1c50-0x0;var _0x2d379b=_0x4438[_0x5b1c50];return _0x2d379b;};'use strict';var schema=require('validate');var _=require('lodash');var util=require('util');var seqqueue=require(_0x8443('0x0'));var logger=require(_0x8443('0x1'))(_0x8443('0x2'));var strategy=require(_0x8443('0x3'));var queue=schema({'name':{'type':'string','required':!![],'message':_0x8443('0x4')},'timeout':{'type':_0x8443('0x5'),'message':_0x8443('0x6')}});function writeLog(_0x188942,_0x2b1d8b,_0x486480){return logger[_0x8443('0x7')](util[_0x8443('0x8')](_0x8443('0x9'),_0x188942,_0x2b1d8b[_0x8443('0xa')],_0x486480));}function handleFindAgent(_0x1ca642){return function(_0xe696df){return _0xe696df[_0x8443('0xa')][_0x8443('0xb')]()===_0x1ca642['toLowerCase']();};}exports['consequence']=function(_0x1ab65f,_0x24893f,_0x3733a2,_0x15da2e){return function(_0x53a848){try{var _0x2e69d4={'name':_0x24893f[0x0],'timeout':_0x24893f[0x1]};var _0x390a43=queue[_0x8443('0xc')](_0x2e69d4,{'typecast':!![]});if(_0x390a43['length']){logger[_0x8443('0xd')](_0x8443('0xe'),_0x1ab65f,_['map'](_0x390a43,_0x8443('0xf'))[_0x8443('0x10')](',\x20'));_0x53a848[_0x8443('0x11')]();}else{var _0x50c00f=_[_0x8443('0x12')](_0x3733a2['agents'],handleFindAgent(_0x2e69d4[_0x8443('0xa')]));if(_0x50c00f){var _0x1355dc=(_0x2e69d4[_0x8443('0x13')]||0xa)*0x3e8;var _0x165e42,_0x5b5491;var _0x221530=seqqueue[_0x8443('0x14')](_0x1355dc);_0x221530['id']=_0x1ab65f;_0x221530[_0x8443('0x15')]=_0x1355dc;_0x221530[_0x8443('0x16')]=_0x15da2e[_0x8443('0x16')];writeLog(_0x1ab65f,_0x50c00f,util[_0x8443('0x8')](_0x8443('0x17'),_0x1355dc));_0x3733a2[_0x8443('0x18')][_0x1ab65f]['on']('end',function(){logger[_0x8443('0x7')](_0x8443('0x19'),_0x1ab65f);clearTimeout(_0x5b5491);_0x5b5491=undefined;_0x221530[_0x8443('0x1a')]();if(_0x3733a2['rules'][_0x1ab65f]){delete _0x3733a2[_0x8443('0x18')][_0x1ab65f];}_0x53a848[_0x8443('0x11')]();});_0x3733a2[_0x8443('0x18')][_0x1ab65f]['on']('complete',function(){if(_0x3733a2[_0x8443('0x18')][_0x1ab65f]){delete _0x3733a2[_0x8443('0x18')][_0x1ab65f];}});_0x5b5491=setTimeout(function(){logger['info']('[%s][AGENT]\x20ROUTING\x20END',_0x1ab65f);clearTimeout(_0x5b5491);_0x221530[_0x8443('0x1a')]();_0x53a848['next']();},_0x1355dc);strategy[_0x8443('0x1b')](_0x221530,_0x50c00f,_0x3733a2,_0x15da2e);}else{logger[_0x8443('0xd')](_0x8443('0x1c'),_0x1ab65f,_0x2e69d4['name']);_0x53a848[_0x8443('0x11')]();}}}catch(_0x35fa4b){console['log'](_0x35fa4b);logger[_0x8443('0xd')](_0x8443('0x1d'),_0x1ab65f,_0x35fa4b[_0x8443('0x1e')]);_0x53a848['stop']();}};};
\ No newline at end of file
+var _0x5ddb=['agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','util','seq-queue','../../../../config/logger','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','length','error','[%s][AGENT]\x20%s','map','find','agents','atimeout','channel','rules','end','close','stop','complete','[%s][AGENT]\x20ROUTING\x20END','next'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x5ddb,0xec));var _0xb5dd=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x5ddb[_0x5f3f88];return _0xd08119;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0xb5dd('0x0'));var seqqueue=require(_0xb5dd('0x1'));var logger=require(_0xb5dd('0x2'))(_0xb5dd('0x3'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0xb5dd('0x4'),'required':!![],'message':_0xb5dd('0x5')},'timeout':{'type':_0xb5dd('0x6'),'message':_0xb5dd('0x7')}});function writeLog(_0x4922c1,_0x8f50c1,_0x4c2b7b){return logger[_0xb5dd('0x8')](util[_0xb5dd('0x9')](_0xb5dd('0xa'),_0x4922c1,_0x8f50c1[_0xb5dd('0xb')],_0x4c2b7b));}function handleFindAgent(_0x216bb){return function(_0x3ce2cf){return _0x3ce2cf[_0xb5dd('0xb')][_0xb5dd('0xc')]()===_0x216bb[_0xb5dd('0xc')]();};}exports['consequence']=function(_0x54b298,_0x438a48,_0x4170cd,_0x2f46d1){return function(_0x609e6f){try{var _0x47370c={'name':_0x438a48[0x0],'timeout':_0x438a48[0x1]};var _0x2e76d5=queue['validate'](_0x47370c,{'typecast':!![]});if(_0x2e76d5[_0xb5dd('0xd')]){logger[_0xb5dd('0xe')](_0xb5dd('0xf'),_0x54b298,_[_0xb5dd('0x10')](_0x2e76d5,'message')['join'](',\x20'));_0x609e6f['stop']();}else{var _0x775b4e=_[_0xb5dd('0x11')](_0x4170cd[_0xb5dd('0x12')],handleFindAgent(_0x47370c[_0xb5dd('0xb')]));if(_0x775b4e){var _0x337ba0=(_0x47370c['timeout']||0xa)*0x3e8;var _0x22c538,_0x33aec7;var _0x3100fb=seqqueue['createQueue'](_0x337ba0);_0x3100fb['id']=_0x54b298;_0x3100fb[_0xb5dd('0x13')]=_0x337ba0;_0x3100fb['channel']=_0x2f46d1[_0xb5dd('0x14')];writeLog(_0x54b298,_0x775b4e,util['format']('START:%s',_0x337ba0));_0x4170cd[_0xb5dd('0x15')][_0x54b298]['on'](_0xb5dd('0x16'),function(){logger[_0xb5dd('0x8')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x54b298);clearTimeout(_0x33aec7);_0x33aec7=undefined;_0x3100fb[_0xb5dd('0x17')]();if(_0x4170cd[_0xb5dd('0x15')][_0x54b298]){delete _0x4170cd[_0xb5dd('0x15')][_0x54b298];}_0x609e6f[_0xb5dd('0x18')]();});_0x4170cd['rules'][_0x54b298]['on'](_0xb5dd('0x19'),function(){if(_0x4170cd['rules'][_0x54b298]){delete _0x4170cd['rules'][_0x54b298];}});_0x33aec7=setTimeout(function(){logger['info'](_0xb5dd('0x1a'),_0x54b298);clearTimeout(_0x33aec7);_0x3100fb[_0xb5dd('0x17')]();_0x609e6f[_0xb5dd('0x1b')]();},_0x337ba0);strategy[_0xb5dd('0x1c')](_0x3100fb,_0x775b4e,_0x4170cd,_0x2f46d1);}else{logger[_0xb5dd('0xe')](_0xb5dd('0x1d'),_0x54b298,_0x47370c[_0xb5dd('0xb')]);_0x609e6f['stop']();}}}catch(_0x19e764){console[_0xb5dd('0x1e')](_0x19e764);logger[_0xb5dd('0xe')](_0xb5dd('0x1f'),_0x54b298,_0x19e764[_0xb5dd('0x20')]);_0x609e6f[_0xb5dd('0x18')]();}};};
\ No newline at end of file
index c3432d0..9aed1cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48b4=['Message','create','then','catch','error','stringify','stop','LexRuntime','$LATEST','message','toString','postText','providerName','amazonlex','providerResponse','body','Failed','moment','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','interaction','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','isEmpty','getMustacheRender'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0x48b4,0xf2));var _0x448b=function(_0x36eef9,_0x5cf5c7){_0x36eef9=_0x36eef9-0x0;var _0xfd543f=_0x48b4[_0x36eef9];return _0xfd543f;};'use strict';var _=require('lodash');var moment=require(_0x448b('0x0'));var AWS=require('aws-sdk');var utils=require(_0x448b('0x1'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x448b('0x2')),'openchannelMessage':require(_0x448b('0x3')),'mailMessage':require(_0x448b('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x448b('0x5')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x448b('0x6')]=function(_0x456cf1,_0x33b8c4){return function(_0x2d12d9){try{if(!_['isNil'](this['interaction'][_0x448b('0x7')])){logger[_0x448b('0x8')](_0x448b('0x9'),_0x456cf1,_0x448b('0xa'));return _0x2d12d9[_0x448b('0xb')]();}var _0x14ed20={'ContactId':this[_0x448b('0xc')]['id'],'sentAt':moment()[_0x448b('0xd')](_0x448b('0xe')),'direction':'out'};if(this[_0x448b('0xf')]===_0x448b('0x10')||this[_0x448b('0xf')]===_0x448b('0x11')){_0x14ed20[_0x448b('0x12')]=this[_0x448b('0x13')]['phone'];}var _0x5cdfde=this['channel'];if(_0x5cdfde===_0x448b('0x14')){_0x14ed20[_0x448b('0x15')]=this['account']['id'];}else{_0x14ed20[_[_0x448b('0x16')](_0x5cdfde)+_0x448b('0x17')]=this[_0x448b('0x18')]['id'];}_0x14ed20[_[_0x448b('0x16')](_0x5cdfde)+_0x448b('0x19')]=this[_0x448b('0x13')]['id'];if(this[_0x448b('0x13')]['created']){var _0x58d5a9=_0x33b8c4[0x4];if(!_[_0x448b('0x1a')](_0x58d5a9)){_0x14ed20['body']=utils[_0x448b('0x1b')](_0x58d5a9,this);return rpc[_0x5cdfde+_0x448b('0x1c')][_0x448b('0x1d')](_0x14ed20)[_0x448b('0x1e')](function(_0x4c7e12){logger[_0x448b('0x8')](_0x448b('0x9'),_0x456cf1,_0x14ed20['body']);})[_0x448b('0x1f')](function(_0x11f5ae){logger[_0x448b('0x20')](_0x448b('0x9'),_0x456cf1,JSON[_0x448b('0x21')](_0x11f5ae));})['finally'](function(){logger[_0x448b('0x8')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x456cf1);_0x2d12d9[_0x448b('0x22')]();});}else{logger[_0x448b('0x8')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x456cf1);_0x2d12d9[_0x448b('0x22')]();}}else{var _0x279c01=this;var _0x3421cf=new AWS[(_0x448b('0x23'))]({'accessKeyId':_0x33b8c4[0x0],'secretAccessKey':_0x33b8c4[0x1],'region':_0x33b8c4[0x2]});var _0x66bced={'botAlias':_0x448b('0x24'),'botName':_0x33b8c4[0x3],'inputText':this[_0x448b('0x25')]['body'],'userId':this[_0x448b('0xf')]+':'+this[_0x448b('0x13')]['id'][_0x448b('0x26')]()};_0x3421cf[_0x448b('0x27')](_0x66bced,function(_0x1d3fbb,_0x2cb438){if(_0x1d3fbb){logger[_0x448b('0x20')](_0x448b('0x9'),_0x456cf1,_0x1d3fbb[_0x448b('0x25')]);_0x2d12d9[_0x448b('0xb')]();}else if(_0x2cb438&&_0x2cb438[_0x448b('0x25')]){_0x279c01['body']['amazonlex']=_0x2cb438;_0x14ed20['body']=_0x2cb438[_0x448b('0x25')];_0x14ed20[_0x448b('0x28')]=_0x448b('0x29');_0x14ed20[_0x448b('0x2a')]=JSON[_0x448b('0x21')](_0x2cb438);return rpc[_0x5cdfde+_0x448b('0x1c')][_0x448b('0x1d')](_0x14ed20)[_0x448b('0x1e')](function(_0x454a12){logger[_0x448b('0x8')]('[%s][AMAZONLEX]\x20%s',_0x456cf1,_0x14ed20[_0x448b('0x2b')]);if(_0x2cb438['dialogState']==_0x448b('0x2c')){_0x2d12d9[_0x448b('0xb')]();}else{_0x2d12d9[_0x448b('0x22')]();}})[_0x448b('0x1f')](function(_0x27e89b){logger['error'](_0x448b('0x9'),_0x456cf1,JSON[_0x448b('0x21')](_0x27e89b));_0x2d12d9[_0x448b('0xb')]();});}else{_0x2d12d9[_0x448b('0xb')]();}});}}catch(_0x729994){logger[_0x448b('0x20')](_0x448b('0x9'),_0x456cf1,JSON[_0x448b('0x21')](_0x729994));_0x2d12d9['stop']();}};};
\ No newline at end of file
+var _0xd36f=['[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','toString','next','message','amazonlex','providerName','providerResponse','dialogState','Failed','catch','lodash','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','body','Message','create','then','[%s][AMAZONLEX]\x20%s','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xd36f,0x169));var _0xfd36=function(_0x2cd9ae,_0x42707b){_0x2cd9ae=_0x2cd9ae-0x0;var _0x1c3d31=_0xd36f[_0x2cd9ae];return _0x1c3d31;};'use strict';var _=require(_0xfd36('0x0'));var moment=require('moment');var AWS=require(_0xfd36('0x1'));var utils=require(_0xfd36('0x2'));var logger=require(_0xfd36('0x3'))(_0xfd36('0x4'));var rpc={'chatMessage':require(_0xfd36('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xfd36('0x6')),'smsMessage':require(_0xfd36('0x7')),'faxMessage':require(_0xfd36('0x8')),'whatsappMessage':require(_0xfd36('0x9'))};exports['consequence']=function(_0x550c1c,_0x278f5d){return function(_0x3d670f){try{if(!_[_0xfd36('0xa')](this[_0xfd36('0xb')][_0xfd36('0xc')])){logger[_0xfd36('0xd')]('[%s][AMAZONLEX]\x20%s',_0x550c1c,_0xfd36('0xe'));return _0x3d670f['next']();}var _0x55abe4={'ContactId':this['contact']['id'],'sentAt':moment()[_0xfd36('0xf')](_0xfd36('0x10')),'direction':_0xfd36('0x11')};if(this['channel']===_0xfd36('0x12')||this[_0xfd36('0x13')]===_0xfd36('0x14')){_0x55abe4[_0xfd36('0x15')]=this['interaction'][_0xfd36('0x15')];}var _0x99db99=this['channel'];if(_0x99db99===_0xfd36('0x16')){_0x55abe4[_0xfd36('0x17')]=this['account']['id'];}else{_0x55abe4[_[_0xfd36('0x18')](_0x99db99)+_0xfd36('0x19')]=this[_0xfd36('0x1a')]['id'];}_0x55abe4[_[_0xfd36('0x18')](_0x99db99)+_0xfd36('0x1b')]=this[_0xfd36('0xb')]['id'];if(this[_0xfd36('0xb')][_0xfd36('0x1c')]){var _0x4159b2=_0x278f5d[0x4];if(!_['isEmpty'](_0x4159b2)){_0x55abe4[_0xfd36('0x1d')]=utils['getMustacheRender'](_0x4159b2,this);return rpc[_0x99db99+_0xfd36('0x1e')][_0xfd36('0x1f')](_0x55abe4)[_0xfd36('0x20')](function(_0x2a53ba){logger[_0xfd36('0xd')](_0xfd36('0x21'),_0x550c1c,_0x55abe4[_0xfd36('0x1d')]);})['catch'](function(_0x2257a5){logger[_0xfd36('0x22')](_0xfd36('0x21'),_0x550c1c,JSON[_0xfd36('0x23')](_0x2257a5));})[_0xfd36('0x24')](function(){logger[_0xfd36('0xd')](_0xfd36('0x25'),_0x550c1c);_0x3d670f[_0xfd36('0x26')]();});}else{logger['info'](_0xfd36('0x27'),_0x550c1c);_0x3d670f[_0xfd36('0x26')]();}}else{var _0x272808=this;var _0xc68815=new AWS[(_0xfd36('0x28'))]({'accessKeyId':_0x278f5d[0x0],'secretAccessKey':_0x278f5d[0x1],'region':_0x278f5d[0x2]});var _0x36009f={'botAlias':'$LATEST','botName':_0x278f5d[0x3],'inputText':this['message'][_0xfd36('0x1d')],'userId':this['channel']+':'+this[_0xfd36('0xb')]['id'][_0xfd36('0x29')]()};_0xc68815['postText'](_0x36009f,function(_0x7c1a35,_0x589c47){if(_0x7c1a35){logger[_0xfd36('0x22')](_0xfd36('0x21'),_0x550c1c,_0x7c1a35['message']);_0x3d670f[_0xfd36('0x2a')]();}else if(_0x589c47&&_0x589c47[_0xfd36('0x2b')]){_0x272808[_0xfd36('0x1d')][_0xfd36('0x2c')]=_0x589c47;_0x55abe4[_0xfd36('0x1d')]=_0x589c47[_0xfd36('0x2b')];_0x55abe4[_0xfd36('0x2d')]='amazonlex';_0x55abe4[_0xfd36('0x2e')]=JSON[_0xfd36('0x23')](_0x589c47);return rpc[_0x99db99+_0xfd36('0x1e')][_0xfd36('0x1f')](_0x55abe4)[_0xfd36('0x20')](function(_0x1e6f65){logger['info'](_0xfd36('0x21'),_0x550c1c,_0x55abe4['body']);if(_0x589c47[_0xfd36('0x2f')]==_0xfd36('0x30')){_0x3d670f[_0xfd36('0x2a')]();}else{_0x3d670f[_0xfd36('0x26')]();}})[_0xfd36('0x31')](function(_0x1e2219){logger[_0xfd36('0x22')](_0xfd36('0x21'),_0x550c1c,JSON[_0xfd36('0x23')](_0x1e2219));_0x3d670f['next']();});}else{_0x3d670f[_0xfd36('0x2a')]();}});}}catch(_0x1c81b6){logger[_0xfd36('0x22')](_0xfd36('0x21'),_0x550c1c,JSON[_0xfd36('0x23')](_0x1c81b6));_0x3d670f[_0xfd36('0x26')]();}};};
\ No newline at end of file
index cfde517..187bdf6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ed2=['created','Autoreply\x20already\x20sent','autoreplyExecuted','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','body','getMustacheRender','message','from','phone','subject','startsWith','Re:','chat','account','upperFirst','AccountId','InteractionId','Smtp','service','host','secure','user','pass','inReplyTo','messageId','html','<div\x20id=\x22xm-mail-content\x22>','<div\x20id=\x22xm-mail-content\x22','</div>','auto-replied','All','auto_reply','sendMailMessage','then','create','catch','error','[RPC][%s][AUTOREPLY]\x20%s','stringify','finally','resolve','Interaction','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','./utils','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction'];(function(_0x3cfa8d,_0x4c50b2){var _0x48c43b=function(_0x1cbdcb){while(--_0x1cbdcb){_0x3cfa8d['push'](_0x3cfa8d['shift']());}};_0x48c43b(++_0x4c50b2);}(_0x1ed2,0x106));var _0x21ed=function(_0x7c645f,_0x4177ab){_0x7c645f=_0x7c645f-0x0;var _0x1ae9c0=_0x1ed2[_0x7c645f];return _0x1ae9c0;};'use strict';var _=require(_0x21ed('0x0'));var moment=require('moment');var utils=require(_0x21ed('0x1'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x21ed('0x2')),'mailMessage':require(_0x21ed('0x3')),'smsMessage':require(_0x21ed('0x4')),'faxMessage':require(_0x21ed('0x5')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x21ed('0x6')),'openchannelInteraction':require(_0x21ed('0x7')),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0x21ed('0x8')),'faxInteraction':require(_0x21ed('0x9')),'whatsappInteraction':require(_0x21ed('0xa'))};var mailRpc=require(_0x21ed('0xb'));exports[_0x21ed('0xc')]=function(_0x2ff6f2,_0x39b9a8,_0x95a23f,_0x1e7ae6){return function(_0x5383aa){try{var _0x3e88d3=this[_0x21ed('0xd')];if(_0x3e88d3===_0x21ed('0xe')&&_0x1e7ae6['body'][_0x21ed('0xf')]){logger[_0x21ed('0x10')](_0x21ed('0x11'),_0x2ff6f2,_0x21ed('0x12'));return _0x5383aa[_0x21ed('0x13')]();}if(_0x39b9a8[0x0]==='1'&&(_[_0x21ed('0x14')](this[_0x21ed('0x15')][_0x21ed('0x16')])||!this[_0x21ed('0x15')]['created'])){logger[_0x21ed('0x10')](_0x21ed('0x11'),_0x2ff6f2,_0x21ed('0x17'));return _0x5383aa[_0x21ed('0x13')]();}if(_0x39b9a8[0x0]==='2'&&this['interaction'][_0x21ed('0x18')]){logger[_0x21ed('0x10')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x2ff6f2,_0x21ed('0x19'));return _0x5383aa[_0x21ed('0x13')]();}var _0x42eb2f={'ContactId':this[_0x21ed('0x1a')]['id'],'sentAt':moment()[_0x21ed('0x1b')](_0x21ed('0x1c')),'direction':'out'};if(this[_0x21ed('0xd')]===_0x21ed('0xe')){_0x42eb2f[_0x21ed('0x1d')]=utils['getMustacheRender'](_0x39b9a8[0x2],this);}else{_0x42eb2f[_0x21ed('0x1d')]=utils[_0x21ed('0x1e')](_0x39b9a8[0x1],this);}if(this[_0x21ed('0x1f')]){_0x42eb2f['to']=this['message'][_0x21ed('0x20')]||'';if(this[_0x21ed('0xd')]===_0x21ed('0xe')&&_0x39b9a8[0x1]==='1'){_0x42eb2f['cc']=this[_0x21ed('0x1f')]['cc']||'';}_0x42eb2f[_0x21ed('0x20')]=this['message']['to']||'';_0x42eb2f['phone']=this[_0x21ed('0x1f')][_0x21ed('0x21')]||'';_0x42eb2f['read']=!![];if(this[_0x21ed('0x1f')]['subject']){_0x42eb2f['subject']='';_0x42eb2f[_0x21ed('0x22')]+=_[_0x21ed('0x23')](this[_0x21ed('0x1f')][_0x21ed('0x22')],_0x21ed('0x24'))?'':'Re:\x20';_0x42eb2f[_0x21ed('0x22')]+=this[_0x21ed('0x1f')][_0x21ed('0x22')];}}if(this['channel']===_0x21ed('0x25')){_0x42eb2f['ChatWebsiteId']=this[_0x21ed('0x26')]['id'];}else{_0x42eb2f[_[_0x21ed('0x27')](this[_0x21ed('0xd')])+_0x21ed('0x28')]=this[_0x21ed('0x26')]['id'];}_0x42eb2f[_[_0x21ed('0x27')](this[_0x21ed('0xd')])+_0x21ed('0x29')]=this[_0x21ed('0x15')]['id'];var _0x176204=this['interaction'];if(rpc[this[_0x21ed('0xd')]+'Message']){if(this[_0x21ed('0xd')]===_0x21ed('0xe')){var _0x308138={'tls':{'rejectUnauthorized':![]}};if(this[_0x21ed('0x26')][_0x21ed('0x2a')][_0x21ed('0x2b')]){_0x308138['service']=this[_0x21ed('0x26')][_0x21ed('0x2a')][_0x21ed('0x2b')];}else{_0x308138[_0x21ed('0x2c')]=this['account'][_0x21ed('0x2a')]['host'];_0x308138['port']=this[_0x21ed('0x26')][_0x21ed('0x2a')]['port'];_0x308138[_0x21ed('0x2d')]=this[_0x21ed('0x26')][_0x21ed('0x2a')][_0x21ed('0x2d')];}if(this[_0x21ed('0x26')]['Smtp']['authentication']){_0x308138['auth']={'user':this['account'][_0x21ed('0x2a')][_0x21ed('0x2e')],'pass':this[_0x21ed('0x26')][_0x21ed('0x2a')][_0x21ed('0x2f')]};}_0x42eb2f[_0x21ed('0x30')]=this['message'][_0x21ed('0x31')];_0x42eb2f[_0x21ed('0x32')]=_0x21ed('0x33')+_['replace'](_0x42eb2f[_0x21ed('0x1d')],_0x21ed('0x34'),'<div')+_0x21ed('0x35');_0x42eb2f['headers']={'Auto-Submitted':_0x21ed('0x36'),'X-Auto-Response-Suppress':_0x21ed('0x37'),'Precedence':_0x21ed('0x38')};return mailRpc[_0x21ed('0x39')](_0x308138,_0x42eb2f)[_0x21ed('0x3a')](function(_0x3acf42){logger[_0x21ed('0x10')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x2ff6f2);_0x42eb2f[_0x21ed('0x31')]=_0x3acf42[_0x21ed('0x1f')][_0x21ed('0x31')];return rpc[_0x3e88d3+'Message'][_0x21ed('0x3b')](_0x42eb2f);})[_0x21ed('0x3a')](function(_0x51430f){logger[_0x21ed('0x10')](_0x21ed('0x11'),_0x2ff6f2,JSON['stringify'](_0x51430f));})[_0x21ed('0x3c')](function(_0x44fd49){logger[_0x21ed('0x3d')](_0x21ed('0x3e'),_0x2ff6f2,JSON[_0x21ed('0x3f')](_0x44fd49));})[_0x21ed('0x40')](function(){Promise[_0x21ed('0x41')]()['then'](function(){if(_0x39b9a8[0x0]!=='2'||_0x176204[_0x21ed('0x18')])return;return rpc[_0x3e88d3+_0x21ed('0x42')]['update'](_0x176204['id'],{'autoreplyExecuted':!![]})[_0x21ed('0x3a')](function(_0x5ae9b3){logger[_0x21ed('0x10')](_0x21ed('0x43'),_0x2ff6f2,JSON[_0x21ed('0x3f')](_0x5ae9b3));})[_0x21ed('0x3c')](function(_0x361f54){logger[_0x21ed('0x3d')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x2ff6f2,JSON['stringify'](_0x361f54));});})['then'](function(){_0x5383aa[_0x21ed('0x13')]();});});}else{return rpc[this['channel']+'Message'][_0x21ed('0x3b')](_0x42eb2f)[_0x21ed('0x3a')](function(_0xa33493){logger['info']('[%s][AUTOREPLY]\x20%s',_0x2ff6f2,_0x42eb2f[_0x21ed('0x1d')]);})['catch'](function(_0x25b150){logger[_0x21ed('0x3d')](_0x21ed('0x11'),_0x2ff6f2,JSON[_0x21ed('0x3f')](_0x25b150));})[_0x21ed('0x40')](function(){Promise[_0x21ed('0x41')]()['then'](function(){if(_0x39b9a8[0x0]!=='2'||_0x176204['autoreplyExecuted'])return;return rpc[_0x3e88d3+_0x21ed('0x42')][_0x21ed('0x44')](_0x176204['id'],{'autoreplyExecuted':!![]})['then'](function(_0x5dc0c9){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x2ff6f2,JSON[_0x21ed('0x3f')](_0x5dc0c9));})[_0x21ed('0x3c')](function(_0x3484a2){logger[_0x21ed('0x3d')](_0x21ed('0x45'),_0x2ff6f2,JSON[_0x21ed('0x3f')](_0x3484a2));});})[_0x21ed('0x3a')](function(){_0x5383aa['next']();});});}}}catch(_0x3a586a){logger[_0x21ed('0x3d')](_0x21ed('0x11'),_0x2ff6f2,JSON[_0x21ed('0x3f')](_0x3a586a));_0x5383aa[_0x21ed('0x46')]();}};};
\ No newline at end of file
+var _0x8ca7=['catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','channel','mail','isAutoreply','[%s][AUTOREPLY]\x20%s','isNil','interaction','created','info','Autoreply\x20already\x20sent','next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','contact','format','YYYY-MM-DD\x20HH:mm:ss','body','getMustacheRender','from','message','phone','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','AccountId','InteractionId','Message','account','Smtp','service','port','secure','authentication','pass','inReplyTo','messageId','html','<div\x20id=\x22xm-mail-content\x22>','replace','<div\x20id=\x22xm-mail-content\x22','<div','</div>','headers','auto-replied','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify'];(function(_0x3bd269,_0x264451){var _0x38f86d=function(_0x35fed3){while(--_0x35fed3){_0x3bd269['push'](_0x3bd269['shift']());}};_0x38f86d(++_0x264451);}(_0x8ca7,0xf0));var _0x78ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ca7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x78ca('0x0'));var moment=require(_0x78ca('0x1'));var utils=require(_0x78ca('0x2'));var logger=require(_0x78ca('0x3'))('routing');var rpc={'chatMessage':require(_0x78ca('0x4')),'openchannelMessage':require(_0x78ca('0x5')),'mailMessage':require(_0x78ca('0x6')),'smsMessage':require(_0x78ca('0x7')),'faxMessage':require(_0x78ca('0x8')),'whatsappMessage':require(_0x78ca('0x9')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x78ca('0xa')),'mailInteraction':require(_0x78ca('0xb')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0x78ca('0xc')),'whatsappInteraction':require(_0x78ca('0xd'))};var mailRpc=require(_0x78ca('0xe'));exports['consequence']=function(_0x435db9,_0x100913,_0x5e68ef,_0xa3ef3a){return function(_0x1c3495){try{var _0x341688=this[_0x78ca('0xf')];if(_0x341688===_0x78ca('0x10')&&_0xa3ef3a['body'][_0x78ca('0x11')]){logger['info'](_0x78ca('0x12'),_0x435db9,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x1c3495['next']();}if(_0x100913[0x0]==='1'&&(_[_0x78ca('0x13')](this[_0x78ca('0x14')][_0x78ca('0x15')])||!this[_0x78ca('0x14')][_0x78ca('0x15')])){logger[_0x78ca('0x16')]('[%s][AUTOREPLY]\x20%s',_0x435db9,_0x78ca('0x17'));return _0x1c3495[_0x78ca('0x18')]();}if(_0x100913[0x0]==='2'&&this[_0x78ca('0x14')][_0x78ca('0x19')]){logger[_0x78ca('0x16')](_0x78ca('0x1a'),_0x435db9,'One\x20Time\x20already\x20sent');return _0x1c3495['next']();}var _0x3940d0={'ContactId':this[_0x78ca('0x1b')]['id'],'sentAt':moment()[_0x78ca('0x1c')](_0x78ca('0x1d')),'direction':'out'};if(this['channel']===_0x78ca('0x10')){_0x3940d0[_0x78ca('0x1e')]=utils[_0x78ca('0x1f')](_0x100913[0x2],this);}else{_0x3940d0['body']=utils[_0x78ca('0x1f')](_0x100913[0x1],this);}if(this['message']){_0x3940d0['to']=this['message'][_0x78ca('0x20')]||'';if(this[_0x78ca('0xf')]===_0x78ca('0x10')&&_0x100913[0x1]==='1'){_0x3940d0['cc']=this[_0x78ca('0x21')]['cc']||'';}_0x3940d0[_0x78ca('0x20')]=this['message']['to']||'';_0x3940d0[_0x78ca('0x22')]=this['message']['phone']||'';_0x3940d0['read']=!![];if(this[_0x78ca('0x21')]['subject']){_0x3940d0[_0x78ca('0x23')]='';_0x3940d0[_0x78ca('0x23')]+=_[_0x78ca('0x24')](this[_0x78ca('0x21')]['subject'],_0x78ca('0x25'))?'':_0x78ca('0x26');_0x3940d0['subject']+=this[_0x78ca('0x21')][_0x78ca('0x23')];}}if(this[_0x78ca('0xf')]===_0x78ca('0x27')){_0x3940d0[_0x78ca('0x28')]=this['account']['id'];}else{_0x3940d0[_['upperFirst'](this['channel'])+_0x78ca('0x29')]=this['account']['id'];}_0x3940d0[_['upperFirst'](this['channel'])+_0x78ca('0x2a')]=this[_0x78ca('0x14')]['id'];var _0x5c86b7=this['interaction'];if(rpc[this['channel']+_0x78ca('0x2b')]){if(this['channel']===_0x78ca('0x10')){var _0x39588e={'tls':{'rejectUnauthorized':![]}};if(this[_0x78ca('0x2c')][_0x78ca('0x2d')][_0x78ca('0x2e')]){_0x39588e['service']=this[_0x78ca('0x2c')][_0x78ca('0x2d')]['service'];}else{_0x39588e['host']=this[_0x78ca('0x2c')][_0x78ca('0x2d')]['host'];_0x39588e['port']=this[_0x78ca('0x2c')][_0x78ca('0x2d')][_0x78ca('0x2f')];_0x39588e[_0x78ca('0x30')]=this[_0x78ca('0x2c')][_0x78ca('0x2d')][_0x78ca('0x30')];}if(this[_0x78ca('0x2c')][_0x78ca('0x2d')][_0x78ca('0x31')]){_0x39588e['auth']={'user':this['account'][_0x78ca('0x2d')]['user'],'pass':this['account'][_0x78ca('0x2d')][_0x78ca('0x32')]};}_0x3940d0[_0x78ca('0x33')]=this[_0x78ca('0x21')][_0x78ca('0x34')];_0x3940d0[_0x78ca('0x35')]=_0x78ca('0x36')+_[_0x78ca('0x37')](_0x3940d0[_0x78ca('0x1e')],_0x78ca('0x38'),_0x78ca('0x39'))+_0x78ca('0x3a');_0x3940d0[_0x78ca('0x3b')]={'Auto-Submitted':_0x78ca('0x3c'),'X-Auto-Response-Suppress':_0x78ca('0x3d'),'Precedence':_0x78ca('0x3e')};return mailRpc[_0x78ca('0x3f')](_0x39588e,_0x3940d0)[_0x78ca('0x40')](function(_0x4b3d8f){logger['info'](_0x78ca('0x41'),_0x435db9);_0x3940d0[_0x78ca('0x34')]=_0x4b3d8f[_0x78ca('0x21')]['messageId'];return rpc[_0x341688+_0x78ca('0x2b')][_0x78ca('0x42')](_0x3940d0);})[_0x78ca('0x40')](function(_0x469d7c){logger[_0x78ca('0x16')](_0x78ca('0x12'),_0x435db9,JSON[_0x78ca('0x43')](_0x469d7c));})[_0x78ca('0x44')](function(_0x194349){logger[_0x78ca('0x45')](_0x78ca('0x46'),_0x435db9,JSON['stringify'](_0x194349));})[_0x78ca('0x47')](function(){Promise[_0x78ca('0x48')]()[_0x78ca('0x40')](function(){if(_0x100913[0x0]!=='2'||_0x5c86b7[_0x78ca('0x19')])return;return rpc[_0x341688+_0x78ca('0x49')][_0x78ca('0x4a')](_0x5c86b7['id'],{'autoreplyExecuted':!![]})[_0x78ca('0x40')](function(_0xa3ec9){logger[_0x78ca('0x16')](_0x78ca('0x1a'),_0x435db9,JSON[_0x78ca('0x43')](_0xa3ec9));})[_0x78ca('0x44')](function(_0x493e0f){logger[_0x78ca('0x45')](_0x78ca('0x4b'),_0x435db9,JSON['stringify'](_0x493e0f));});})[_0x78ca('0x40')](function(){_0x1c3495[_0x78ca('0x18')]();});});}else{return rpc[this['channel']+_0x78ca('0x2b')]['create'](_0x3940d0)[_0x78ca('0x40')](function(_0x271d0f){logger[_0x78ca('0x16')](_0x78ca('0x12'),_0x435db9,_0x3940d0[_0x78ca('0x1e')]);})[_0x78ca('0x44')](function(_0x3ec5cd){logger['error'](_0x78ca('0x12'),_0x435db9,JSON[_0x78ca('0x43')](_0x3ec5cd));})[_0x78ca('0x47')](function(){Promise[_0x78ca('0x48')]()[_0x78ca('0x40')](function(){if(_0x100913[0x0]!=='2'||_0x5c86b7[_0x78ca('0x19')])return;return rpc[_0x341688+'Interaction'][_0x78ca('0x4a')](_0x5c86b7['id'],{'autoreplyExecuted':!![]})['then'](function(_0x2a5d54){logger[_0x78ca('0x16')](_0x78ca('0x1a'),_0x435db9,JSON[_0x78ca('0x43')](_0x2a5d54));})[_0x78ca('0x44')](function(_0x46cabb){logger[_0x78ca('0x45')](_0x78ca('0x4b'),_0x435db9,JSON[_0x78ca('0x43')](_0x46cabb));});})[_0x78ca('0x40')](function(){_0x1c3495[_0x78ca('0x18')]();});});}}}catch(_0x42df1b){logger[_0x78ca('0x45')](_0x78ca('0x12'),_0x435db9,JSON[_0x78ca('0x43')](_0x42df1b));_0x1c3495[_0x78ca('0x4c')]();}};};
\ No newline at end of file
index d531a3b..9ddc249 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3df4=['stop','moment','../../../../config/logger','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally'];(function(_0x11eb1f,_0x826f0b){var _0x2121e9=function(_0x5b84a9){while(--_0x5b84a9){_0x11eb1f['push'](_0x11eb1f['shift']());}};_0x2121e9(++_0x826f0b);}(_0x3df4,0xe7));var _0x43df=function(_0x4e08f0,_0x260d82){_0x4e08f0=_0x4e08f0-0x0;var _0x27321b=_0x3df4[_0x4e08f0];return _0x27321b;};'use strict';var moment=require(_0x43df('0x0'));var logger=require(_0x43df('0x1'))('routing');var rpc={'chatInteraction':require(_0x43df('0x2')),'openchannelInteraction':require(_0x43df('0x3')),'smsInteraction':require(_0x43df('0x4')),'mailInteraction':require(_0x43df('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x43df('0x6'))};exports[_0x43df('0x7')]=function(_0x581113,_0x3258bf,_0x3c8634,_0x42d7af){return function(_0x269c9b){try{logger[_0x43df('0x8')](_0x43df('0x9'),_0x581113,_0x3258bf[0x0]);var _0x109ecd={'closed':0x1,'closedAt':moment()['format'](_0x43df('0xa')),'closeReason':_0x43df('0xb'),'disposition':_0x3258bf[0x0]};if(rpc[_0x42d7af[_0x43df('0xc')]+_0x43df('0xd')]){rpc[_0x42d7af[_0x43df('0xc')]+_0x43df('0xd')][_0x43df('0xe')](_0x42d7af[_0x43df('0xf')]['id'],_0x109ecd)['then'](function(_0x5b3a81){logger['info'](_0x43df('0x10'),_0x581113,_0x42d7af[_0x43df('0xf')]['id']);})[_0x43df('0x11')](function(_0x258bea){logger[_0x43df('0x12')](_0x43df('0x13'),_0x581113,JSON[_0x43df('0x14')](_0x258bea));})[_0x43df('0x15')](function(){_0x269c9b['stop']();});}}catch(_0x5e5f31){logger['error'](_0x43df('0x13'),_0x581113,JSON[_0x43df('0x14')](_0x5e5f31));_0x269c9b[_0x43df('0x16')]();}};};
\ No newline at end of file
+var _0x98a9=['YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','finally','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','format'];(function(_0x2ae2ad,_0xac5b0c){var _0x26dbd7=function(_0x5e685b){while(--_0x5e685b){_0x2ae2ad['push'](_0x2ae2ad['shift']());}};_0x26dbd7(++_0xac5b0c);}(_0x98a9,0x7a));var _0x998a=function(_0x1e75d,_0x2f948f){_0x1e75d=_0x1e75d-0x0;var _0x384205=_0x98a9[_0x1e75d];return _0x384205;};'use strict';var moment=require('moment');var logger=require(_0x998a('0x0'))(_0x998a('0x1'));var rpc={'chatInteraction':require(_0x998a('0x2')),'openchannelInteraction':require(_0x998a('0x3')),'smsInteraction':require(_0x998a('0x4')),'mailInteraction':require(_0x998a('0x5')),'faxInteraction':require(_0x998a('0x6')),'whatsappInteraction':require(_0x998a('0x7'))};exports[_0x998a('0x8')]=function(_0x4dfaae,_0x1bfd5d,_0x3730da,_0x4eef61){return function(_0x4170c7){try{logger['info']('[%s][CLOSE]\x20reason\x20%s',_0x4dfaae,_0x1bfd5d[0x0]);var _0x5bc13e={'closed':0x1,'closedAt':moment()[_0x998a('0x9')](_0x998a('0xa')),'closeReason':_0x998a('0xb'),'disposition':_0x1bfd5d[0x0]};if(rpc[_0x4eef61['channel']+'Interaction']){rpc[_0x4eef61[_0x998a('0xc')]+_0x998a('0xd')][_0x998a('0xe')](_0x4eef61[_0x998a('0xf')]['id'],_0x5bc13e)['then'](function(_0x6201b9){logger[_0x998a('0x10')](_0x998a('0x11'),_0x4dfaae,_0x4eef61[_0x998a('0xf')]['id']);})[_0x998a('0x12')](function(_0x36ca7b){logger[_0x998a('0x13')](_0x998a('0x14'),_0x4dfaae,JSON['stringify'](_0x36ca7b));})[_0x998a('0x15')](function(){_0x4170c7['stop']();});}}catch(_0xd700a9){logger['error'](_0x998a('0x14'),_0x4dfaae,JSON['stringify'](_0xd700a9));_0x4170c7['stop']();}};};
\ No newline at end of file
index 0a833e5..9643f6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e2e=['dialogflow','result','fulfillment','speech','providerName','providerResponse','create','metadata','endConversation','error','lodash','moment','apiai-promise','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','info','[%s][DIALOGFLOW]\x20%s','next','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','then','catch','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message'];(function(_0x4cde67,_0x1f58b8){var _0xd80b56=function(_0x3f222f){while(--_0x3f222f){_0x4cde67['push'](_0x4cde67['shift']());}};_0xd80b56(++_0x1f58b8);}(_0x9e2e,0xd6));var _0xe9e2=function(_0x580d49,_0x26b2be){_0x580d49=_0x580d49-0x0;var _0x2d8101=_0x9e2e[_0x580d49];return _0x2d8101;};'use strict';var _=require(_0xe9e2('0x0'));var moment=require(_0xe9e2('0x1'));var apiai=require(_0xe9e2('0x2'));var md5=require('md5');var utils=require(_0xe9e2('0x3'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0xe9e2('0x4')),'openchannelMessage':require(_0xe9e2('0x5')),'mailMessage':require(_0xe9e2('0x6')),'smsMessage':require(_0xe9e2('0x7')),'faxMessage':require(_0xe9e2('0x8')),'whatsappMessage':require(_0xe9e2('0x9'))};exports[_0xe9e2('0xa')]=function(_0x5ca0aa,_0x118600){return function(_0x4f1ef7){try{if(!_[_0xe9e2('0xb')](this[_0xe9e2('0xc')]['UserId'])){logger[_0xe9e2('0xd')](_0xe9e2('0xe'),_0x5ca0aa,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x4f1ef7[_0xe9e2('0xf')]();}var _0xe1c4d3={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0xe9e2('0x10')),'direction':_0xe9e2('0x11')};if(this[_0xe9e2('0x12')]===_0xe9e2('0x13')||this['channel']==='whatsapp'){_0xe1c4d3[_0xe9e2('0x14')]=this[_0xe9e2('0xc')][_0xe9e2('0x14')];}var _0x2f11d1=this[_0xe9e2('0x12')];if(_0x2f11d1===_0xe9e2('0x15')){_0xe1c4d3[_0xe9e2('0x16')]=this[_0xe9e2('0x17')]['id'];}else{_0xe1c4d3[_[_0xe9e2('0x18')](_0x2f11d1)+_0xe9e2('0x19')]=this['account']['id'];}_0xe1c4d3[_['upperFirst'](_0x2f11d1)+_0xe9e2('0x1a')]=this['interaction']['id'];if(this['interaction'][_0xe9e2('0x1b')]){var _0x28aff7=_0x118600[0x2];if(!_[_0xe9e2('0x1c')](_0x28aff7)){_0xe1c4d3[_0xe9e2('0x1d')]=utils[_0xe9e2('0x1e')](_0x28aff7,this);return rpc[_0x2f11d1+_0xe9e2('0x1f')]['create'](_0xe1c4d3)[_0xe9e2('0x20')](function(_0x2094fc){logger[_0xe9e2('0xd')]('[%s][DIALOGFLOW]\x20%s',_0x5ca0aa,_0xe1c4d3[_0xe9e2('0x1d')]);})[_0xe9e2('0x21')](function(_0x20dfcd){logger['error'](_0xe9e2('0xe'),_0x5ca0aa,JSON[_0xe9e2('0x22')](_0x20dfcd));})[_0xe9e2('0x23')](function(){logger['info'](_0xe9e2('0x24'),_0x5ca0aa);_0x4f1ef7[_0xe9e2('0x25')]();});}else{logger[_0xe9e2('0xd')](_0xe9e2('0x26'),_0x5ca0aa);_0x4f1ef7['stop']();}}else{var _0x183680=this;var _0x1655fe=apiai(_0x118600[0x0],{'language':_0x118600[0x1]||'en'});return _0x1655fe[_0xe9e2('0x27')](this[_0xe9e2('0x28')][_0xe9e2('0x1d')],{'sessionId':md5(this[_0xe9e2('0xc')]['id'])})[_0xe9e2('0x20')](function(_0x26239c){_0x183680[_0xe9e2('0x1d')][_0xe9e2('0x29')]=_0x26239c;_0xe1c4d3[_0xe9e2('0x1d')]=_0x26239c[_0xe9e2('0x2a')][_0xe9e2('0x2b')][_0xe9e2('0x2c')];_0xe1c4d3[_0xe9e2('0x2d')]=_0xe9e2('0x29');_0xe1c4d3[_0xe9e2('0x2e')]=JSON['stringify'](_0x26239c);return rpc[_0x2f11d1+_0xe9e2('0x1f')][_0xe9e2('0x2f')](_0xe1c4d3)[_0xe9e2('0x20')](function(_0x3094f0){logger['info'](_0xe9e2('0xe'),_0x5ca0aa,_0xe1c4d3[_0xe9e2('0x1d')]);if(_0x26239c[_0xe9e2('0x2a')][_0xe9e2('0x30')][_0xe9e2('0x31')]){_0x4f1ef7['next']();}else{_0x4f1ef7['stop']();}})[_0xe9e2('0x21')](function(_0x242319){logger[_0xe9e2('0x32')](_0xe9e2('0xe'),_0x5ca0aa,JSON[_0xe9e2('0x22')](_0x242319));_0x4f1ef7[_0xe9e2('0xf')]();});})[_0xe9e2('0x21')](function(_0x29d238){logger[_0xe9e2('0x32')](_0xe9e2('0xe'),_0x5ca0aa,_0x29d238[_0xe9e2('0x28')]);_0x4f1ef7[_0xe9e2('0xf')]();});}}catch(_0x43b730){logger[_0xe9e2('0x32')]('[%s][DIALOGFLOW]\x20%s',_0x5ca0aa,JSON['stringify'](_0x43b730));_0x4f1ef7[_0xe9e2('0x25')]();}};};
\ No newline at end of file
+var _0xe9e7=['../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','phone','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','isEmpty','body','getMustacheRender','Message','create','then','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','fulfillment','speech','providerResponse','endConversation','catch','error','lodash','moment','apiai-promise','./utils'];(function(_0x1a6694,_0x10c892){var _0x1b0121=function(_0x27f672){while(--_0x27f672){_0x1a6694['push'](_0x1a6694['shift']());}};_0x1b0121(++_0x10c892);}(_0xe9e7,0x1f0));var _0x7e9e=function(_0x14b20d,_0x217324){_0x14b20d=_0x14b20d-0x0;var _0x3477cd=_0xe9e7[_0x14b20d];return _0x3477cd;};'use strict';var _=require(_0x7e9e('0x0'));var moment=require(_0x7e9e('0x1'));var apiai=require(_0x7e9e('0x2'));var md5=require('md5');var utils=require(_0x7e9e('0x3'));var logger=require(_0x7e9e('0x4'))(_0x7e9e('0x5'));var rpc={'chatMessage':require(_0x7e9e('0x6')),'openchannelMessage':require(_0x7e9e('0x7')),'mailMessage':require(_0x7e9e('0x8')),'smsMessage':require(_0x7e9e('0x9')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x7e9e('0xa'))};exports[_0x7e9e('0xb')]=function(_0xba25,_0x508a97){return function(_0x366350){try{if(!_['isNil'](this[_0x7e9e('0xc')][_0x7e9e('0xd')])){logger[_0x7e9e('0xe')](_0x7e9e('0xf'),_0xba25,_0x7e9e('0x10'));return _0x366350[_0x7e9e('0x11')]();}var _0x7a18bd={'ContactId':this[_0x7e9e('0x12')]['id'],'sentAt':moment()[_0x7e9e('0x13')](_0x7e9e('0x14')),'direction':_0x7e9e('0x15')};if(this[_0x7e9e('0x16')]==='sms'||this['channel']==='whatsapp'){_0x7a18bd[_0x7e9e('0x17')]=this[_0x7e9e('0xc')][_0x7e9e('0x17')];}var _0x32b012=this['channel'];if(_0x32b012==='chat'){_0x7a18bd[_0x7e9e('0x18')]=this[_0x7e9e('0x19')]['id'];}else{_0x7a18bd[_[_0x7e9e('0x1a')](_0x32b012)+_0x7e9e('0x1b')]=this[_0x7e9e('0x19')]['id'];}_0x7a18bd[_[_0x7e9e('0x1a')](_0x32b012)+_0x7e9e('0x1c')]=this['interaction']['id'];if(this[_0x7e9e('0xc')]['created']){var _0x3a1a89=_0x508a97[0x2];if(!_[_0x7e9e('0x1d')](_0x3a1a89)){_0x7a18bd[_0x7e9e('0x1e')]=utils[_0x7e9e('0x1f')](_0x3a1a89,this);return rpc[_0x32b012+_0x7e9e('0x20')][_0x7e9e('0x21')](_0x7a18bd)[_0x7e9e('0x22')](function(_0x5a2a77){logger[_0x7e9e('0xe')](_0x7e9e('0xf'),_0xba25,_0x7a18bd['body']);})['catch'](function(_0x4ea3f){logger['error']('[%s][DIALOGFLOW]\x20%s',_0xba25,JSON[_0x7e9e('0x23')](_0x4ea3f));})[_0x7e9e('0x24')](function(){logger[_0x7e9e('0xe')](_0x7e9e('0x25'),_0xba25);_0x366350[_0x7e9e('0x26')]();});}else{logger[_0x7e9e('0xe')](_0x7e9e('0x27'),_0xba25);_0x366350[_0x7e9e('0x26')]();}}else{var _0x18c975=this;var _0x5206df=apiai(_0x508a97[0x0],{'language':_0x508a97[0x1]||'en'});return _0x5206df[_0x7e9e('0x28')](this[_0x7e9e('0x29')][_0x7e9e('0x1e')],{'sessionId':md5(this[_0x7e9e('0xc')]['id'])})['then'](function(_0x15bb40){_0x18c975[_0x7e9e('0x1e')][_0x7e9e('0x2a')]=_0x15bb40;_0x7a18bd[_0x7e9e('0x1e')]=_0x15bb40[_0x7e9e('0x2b')][_0x7e9e('0x2c')][_0x7e9e('0x2d')];_0x7a18bd['providerName']=_0x7e9e('0x2a');_0x7a18bd[_0x7e9e('0x2e')]=JSON[_0x7e9e('0x23')](_0x15bb40);return rpc[_0x32b012+_0x7e9e('0x20')]['create'](_0x7a18bd)[_0x7e9e('0x22')](function(_0x3f6655){logger[_0x7e9e('0xe')](_0x7e9e('0xf'),_0xba25,_0x7a18bd['body']);if(_0x15bb40[_0x7e9e('0x2b')]['metadata'][_0x7e9e('0x2f')]){_0x366350[_0x7e9e('0x11')]();}else{_0x366350[_0x7e9e('0x26')]();}})[_0x7e9e('0x30')](function(_0x12de96){logger[_0x7e9e('0x31')](_0x7e9e('0xf'),_0xba25,JSON[_0x7e9e('0x23')](_0x12de96));_0x366350['next']();});})['catch'](function(_0x2d9c81){logger['error'](_0x7e9e('0xf'),_0xba25,_0x2d9c81[_0x7e9e('0x29')]);_0x366350['next']();});}}catch(_0x4a53ac){logger[_0x7e9e('0x31')](_0x7e9e('0xf'),_0xba25,JSON['stringify'](_0x4a53ac));_0x366350['stop']();}};};
\ No newline at end of file
index 7f07c5f..2b4fbc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d25=['./utils','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','info','[%s][DIALOGFLOWV2]\x20%s','catch','stringify','isNil','interaction','UserId','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','getMustacheRender','then','error','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','detectIntent','length','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','queryText','providerName','fulfillmentText','push','all','lodash','dialogflow','md5','moment','bluebird','routing'];(function(_0x44e4b0,_0x45032e){var _0x1be780=function(_0x4c2f56){while(--_0x4c2f56){_0x44e4b0['push'](_0x44e4b0['shift']());}};_0x1be780(++_0x45032e);}(_0x1d25,0xba));var _0x51d2=function(_0x5a7dd3,_0x26b7cf){_0x5a7dd3=_0x5a7dd3-0x0;var _0x2f4d07=_0x1d25[_0x5a7dd3];return _0x2f4d07;};'use strict';var _=require(_0x51d2('0x0'));var dialogflow=require(_0x51d2('0x1'));var md5=require(_0x51d2('0x2'));var moment=require(_0x51d2('0x3'));var Promise=require(_0x51d2('0x4'));var logger=require('../../../../config/logger')(_0x51d2('0x5'));var utils=require(_0x51d2('0x6'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x51d2('0x7')),'mailMessage':require(_0x51d2('0x8')),'smsMessage':require(_0x51d2('0x9')),'faxMessage':require(_0x51d2('0xa')),'whatsappMessage':require(_0x51d2('0xb'))};function createMessage(_0x2e6956,_0x56edda,_0x18e8a9,_0x5a6b5f){return new Promise(function(_0x419156,_0x4dfc7e){var _0x532061=_[_0x51d2('0xc')](_0x18e8a9);_0x532061[_0x51d2('0xd')]=_0x5a6b5f;return rpc[_0x56edda+_0x51d2('0xe')][_0x51d2('0xf')](_0x532061)['then'](function(){logger[_0x51d2('0x10')](_0x51d2('0x11'),_0x2e6956,_0x532061[_0x51d2('0xd')]);_0x419156();})[_0x51d2('0x12')](function(_0x23d231){logger['error'](_0x51d2('0x11'),_0x2e6956,JSON[_0x51d2('0x13')](_0x23d231));_0x4dfc7e(_0x23d231);});});}exports['consequence']=function(_0x53073e,_0x1ecda0){return function(_0x1f81e4){try{if(!_[_0x51d2('0x14')](this[_0x51d2('0x15')][_0x51d2('0x16')])){logger['info'](_0x51d2('0x11'),_0x53073e,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x1f81e4[_0x51d2('0x17')]();}var _0x36bfd3={'ContactId':this[_0x51d2('0x18')]['id'],'sentAt':moment()['format'](_0x51d2('0x19')),'direction':_0x51d2('0x1a')};if(this[_0x51d2('0x1b')]===_0x51d2('0x1c')||this[_0x51d2('0x1b')]===_0x51d2('0x1d')){_0x36bfd3[_0x51d2('0x1e')]=this[_0x51d2('0x15')]['phone'];}var _0x2d40ed=this[_0x51d2('0x1b')];if(_0x2d40ed===_0x51d2('0x1f')){_0x36bfd3[_0x51d2('0x20')]=this[_0x51d2('0x21')]['id'];}else{_0x36bfd3[_[_0x51d2('0x22')](_0x2d40ed)+_0x51d2('0x23')]=this[_0x51d2('0x21')]['id'];}_0x36bfd3[_[_0x51d2('0x22')](_0x2d40ed)+'InteractionId']=this[_0x51d2('0x15')]['id'];if(this['interaction'][_0x51d2('0x24')]){var _0x1fcadc=_0x1ecda0[0x4];if(!_[_0x51d2('0x25')](_0x1fcadc)){_0x36bfd3[_0x51d2('0xd')]=utils[_0x51d2('0x26')](_0x1fcadc,this);return rpc[_0x2d40ed+_0x51d2('0xe')][_0x51d2('0xf')](_0x36bfd3)[_0x51d2('0x27')](function(_0x4ad33f){logger[_0x51d2('0x10')](_0x51d2('0x11'),_0x53073e,_0x36bfd3[_0x51d2('0xd')]);})['catch'](function(_0x7bf33a){logger[_0x51d2('0x28')](_0x51d2('0x11'),_0x53073e,JSON[_0x51d2('0x13')](_0x7bf33a));})['finally'](function(){logger[_0x51d2('0x10')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x53073e);_0x1f81e4[_0x51d2('0x29')]();});}else{logger[_0x51d2('0x10')](_0x51d2('0x2a'),_0x53073e);_0x1f81e4[_0x51d2('0x29')]();}}else{var _0x16bc70=this;var _0x423039=_0x1ecda0[0x2][_0x51d2('0x2b')](/\\n/g,'\x0a');var _0x72081a={'credentials':{'private_key':_0x423039,'client_email':_0x1ecda0[0x1]}};var _0x3c3b2b=new dialogflow[(_0x51d2('0x2c'))](_0x72081a);var _0x49652b=_0x3c3b2b['sessionPath'](_0x1ecda0[0x0],md5(_0x16bc70[_0x51d2('0x15')]['id']));var _0x127ed1={'session':_0x49652b,'queryInput':{'text':{'text':_0x16bc70['message']['body'],'languageCode':_0x1ecda0[0x3]||'en'}}};return _0x3c3b2b[_0x51d2('0x2d')](_0x127ed1)[_0x51d2('0x27')](function(_0x2f533a){if(_0x2f533a&&_0x2f533a[_0x51d2('0x2e')]){_0x16bc70[_0x51d2('0xd')]['dialogflowV2']=_0x2f533a;var _0x49bb14=_0x2f533a[0x0];var _0x442f8b=_0x49bb14[_0x51d2('0x2f')][_0x51d2('0x30')]&&_0x49bb14[_0x51d2('0x2f')]['diagnosticInfo']['fields']?_0x49bb14[_0x51d2('0x2f')][_0x51d2('0x30')][_0x51d2('0x31')][_0x51d2('0x32')][_0x51d2('0x33')]:![];_0x16bc70['body'][_0x51d2('0x34')]=_0x49bb14['queryResult']['action'];_0x16bc70[_0x51d2('0xd')][_0x51d2('0x35')]=_0x49bb14['queryResult']['allRequiredParamsPresent'];_0x16bc70[_0x51d2('0xd')][_0x51d2('0x36')]=_0x49bb14['queryResult'][_0x51d2('0x30')]&&_0x49bb14[_0x51d2('0x2f')][_0x51d2('0x30')][_0x51d2('0x31')]?_0x49bb14[_0x51d2('0x2f')][_0x51d2('0x30')][_0x51d2('0x31')][_0x51d2('0x32')][_0x51d2('0x33')]:![];_0x16bc70[_0x51d2('0xd')][_0x51d2('0x37')]=_0x49bb14[_0x51d2('0x2f')][_0x51d2('0x38')]['name'];_0x16bc70['body'][_0x51d2('0x39')]=_0x49bb14[_0x51d2('0x2f')]['intent'][_0x51d2('0x3a')];_0x16bc70['body']['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x49bb14[_0x51d2('0x2f')]['intent']['isFallback'];_0x16bc70[_0x51d2('0xd')]['DIALOGFLOWV2_LANGUAGECODE']=_0x49bb14['queryResult']['languageCode'];_0x16bc70['body']['DIALOGFLOWV2_QUERYTEXT']=_0x49bb14[_0x51d2('0x2f')][_0x51d2('0x3b')];_0x16bc70[_0x51d2('0xd')]['DIALOGFLOWV2_SCORE']=_0x49bb14[_0x51d2('0x2f')]['intentDetectionConfidence'];_0x36bfd3[_0x51d2('0x3c')]='dialogflowV2';_0x36bfd3['providerResponse']=JSON[_0x51d2('0x13')](_0x2f533a);var _0x3038ef=[];for(var _0x596da6=0x0;_0x596da6<_0x2f533a[_0x51d2('0x2e')];_0x596da6++){var _0x253a37=_0x2f533a[_0x596da6];if(_0x253a37&&_0x253a37[_0x51d2('0x2f')]&&_0x253a37[_0x51d2('0x2f')][_0x51d2('0x3d')]){_0x3038ef[_0x51d2('0x3e')](createMessage(_0x53073e,_0x2d40ed,_0x36bfd3,_0x253a37[_0x51d2('0x2f')][_0x51d2('0x3d')]));}}return Promise[_0x51d2('0x3f')](_0x3038ef)[_0x51d2('0x27')](function(){if(_0x442f8b){_0x1f81e4[_0x51d2('0x17')]();}else{_0x1f81e4['stop']();}})[_0x51d2('0x12')](function(_0x1b1e50){logger[_0x51d2('0x28')]('[%s][DIALOGFLOWV2]\x20%s',_0x53073e,JSON[_0x51d2('0x13')](_0x1b1e50));_0x1f81e4[_0x51d2('0x17')]();});}})[_0x51d2('0x12')](function(_0x541e08){logger[_0x51d2('0x28')]('[%s][DIALOGFLOWV2]\x20%s',_0x53073e,_0x541e08['message']);_0x1f81e4[_0x51d2('0x17')]();});}}catch(_0x494389){logger[_0x51d2('0x28')](_0x51d2('0x11'),_0x53073e,JSON['stringify'](_0x494389));_0x1f81e4[_0x51d2('0x29')]();}};};
\ No newline at end of file
+var _0x59c3=['fulfillmentText','push','all','lodash','dialogflow','md5','moment','bluebird','../../../../config/logger','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','clone','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','body','error','stringify','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','getMustacheRender','catch','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','SessionsClient','message','detectIntent','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','boolValue','intent','DIALOGFLOWV2_INTENTDISPLAYNAME','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','length'];(function(_0x4a310d,_0x33322d){var _0x5eaf36=function(_0x233014){while(--_0x233014){_0x4a310d['push'](_0x4a310d['shift']());}};_0x5eaf36(++_0x33322d);}(_0x59c3,0x133));var _0x359c=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x59c3[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x359c('0x0'));var dialogflow=require(_0x359c('0x1'));var md5=require(_0x359c('0x2'));var moment=require(_0x359c('0x3'));var Promise=require(_0x359c('0x4'));var logger=require(_0x359c('0x5'))('routing');var utils=require(_0x359c('0x6'));var rpc={'chatMessage':require(_0x359c('0x7')),'openchannelMessage':require(_0x359c('0x8')),'mailMessage':require(_0x359c('0x9')),'smsMessage':require(_0x359c('0xa')),'faxMessage':require(_0x359c('0xb')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x9c107b,_0x58b390,_0x3a7d8e,_0x335963){return new Promise(function(_0x44ae3a,_0x682720){var _0x536426=_[_0x359c('0xc')](_0x3a7d8e);_0x536426['body']=_0x335963;return rpc[_0x58b390+_0x359c('0xd')][_0x359c('0xe')](_0x536426)[_0x359c('0xf')](function(){logger[_0x359c('0x10')](_0x359c('0x11'),_0x9c107b,_0x536426[_0x359c('0x12')]);_0x44ae3a();})['catch'](function(_0x17943b){logger[_0x359c('0x13')](_0x359c('0x11'),_0x9c107b,JSON[_0x359c('0x14')](_0x17943b));_0x682720(_0x17943b);});});}exports[_0x359c('0x15')]=function(_0x29d295,_0x1a9d72){return function(_0x246dc1){try{if(!_[_0x359c('0x16')](this[_0x359c('0x17')][_0x359c('0x18')])){logger[_0x359c('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x29d295,_0x359c('0x19'));return _0x246dc1[_0x359c('0x1a')]();}var _0x4d4860={'ContactId':this[_0x359c('0x1b')]['id'],'sentAt':moment()[_0x359c('0x1c')](_0x359c('0x1d')),'direction':_0x359c('0x1e')};if(this[_0x359c('0x1f')]===_0x359c('0x20')||this[_0x359c('0x1f')]===_0x359c('0x21')){_0x4d4860[_0x359c('0x22')]=this[_0x359c('0x17')][_0x359c('0x22')];}var _0x2ae8ee=this[_0x359c('0x1f')];if(_0x2ae8ee===_0x359c('0x23')){_0x4d4860[_0x359c('0x24')]=this[_0x359c('0x25')]['id'];}else{_0x4d4860[_[_0x359c('0x26')](_0x2ae8ee)+_0x359c('0x27')]=this['account']['id'];}_0x4d4860[_[_0x359c('0x26')](_0x2ae8ee)+'InteractionId']=this[_0x359c('0x17')]['id'];if(this['interaction'][_0x359c('0x28')]){var _0x23efb2=_0x1a9d72[0x4];if(!_[_0x359c('0x29')](_0x23efb2)){_0x4d4860[_0x359c('0x12')]=utils[_0x359c('0x2a')](_0x23efb2,this);return rpc[_0x2ae8ee+_0x359c('0xd')][_0x359c('0xe')](_0x4d4860)[_0x359c('0xf')](function(_0x15b7c7){logger[_0x359c('0x10')](_0x359c('0x11'),_0x29d295,_0x4d4860[_0x359c('0x12')]);})[_0x359c('0x2b')](function(_0x2186dc){logger[_0x359c('0x13')](_0x359c('0x11'),_0x29d295,JSON['stringify'](_0x2186dc));})[_0x359c('0x2c')](function(){logger[_0x359c('0x10')](_0x359c('0x2d'),_0x29d295);_0x246dc1['stop']();});}else{logger[_0x359c('0x10')](_0x359c('0x2e'),_0x29d295);_0x246dc1[_0x359c('0x2f')]();}}else{var _0x532b85=this;var _0x1a174a=_0x1a9d72[0x2]['replace'](/\\n/g,'\x0a');var _0x450e19={'credentials':{'private_key':_0x1a174a,'client_email':_0x1a9d72[0x1]}};var _0x11b0c1=new dialogflow[(_0x359c('0x30'))](_0x450e19);var _0x31d65c=_0x11b0c1['sessionPath'](_0x1a9d72[0x0],md5(_0x532b85[_0x359c('0x17')]['id']));var _0x366733={'session':_0x31d65c,'queryInput':{'text':{'text':_0x532b85[_0x359c('0x31')][_0x359c('0x12')],'languageCode':_0x1a9d72[0x3]||'en'}}};return _0x11b0c1[_0x359c('0x32')](_0x366733)[_0x359c('0xf')](function(_0x5f31fe){if(_0x5f31fe&&_0x5f31fe['length']){_0x532b85['body'][_0x359c('0x33')]=_0x5f31fe;var _0x8719ce=_0x5f31fe[0x0];var _0x575a51=_0x8719ce[_0x359c('0x34')][_0x359c('0x35')]&&_0x8719ce[_0x359c('0x34')][_0x359c('0x35')][_0x359c('0x36')]?_0x8719ce['queryResult'][_0x359c('0x35')][_0x359c('0x36')][_0x359c('0x37')]['boolValue']:![];_0x532b85['body']['DIALOGFLOWV2_ACTION']=_0x8719ce[_0x359c('0x34')][_0x359c('0x38')];_0x532b85['body'][_0x359c('0x39')]=_0x8719ce[_0x359c('0x34')][_0x359c('0x3a')];_0x532b85[_0x359c('0x12')][_0x359c('0x3b')]=_0x8719ce[_0x359c('0x34')]['diagnosticInfo']&&_0x8719ce[_0x359c('0x34')][_0x359c('0x35')][_0x359c('0x36')]?_0x8719ce[_0x359c('0x34')][_0x359c('0x35')][_0x359c('0x36')]['end_conversation'][_0x359c('0x3c')]:![];_0x532b85['body']['DIALOGFLOWV2_INTENTNAME']=_0x8719ce[_0x359c('0x34')][_0x359c('0x3d')]['name'];_0x532b85[_0x359c('0x12')][_0x359c('0x3e')]=_0x8719ce[_0x359c('0x34')][_0x359c('0x3d')]['displayName'];_0x532b85[_0x359c('0x12')][_0x359c('0x3f')]=_0x8719ce[_0x359c('0x34')]['intent'][_0x359c('0x40')];_0x532b85['body'][_0x359c('0x41')]=_0x8719ce['queryResult'][_0x359c('0x42')];_0x532b85[_0x359c('0x12')]['DIALOGFLOWV2_QUERYTEXT']=_0x8719ce['queryResult'][_0x359c('0x43')];_0x532b85[_0x359c('0x12')][_0x359c('0x44')]=_0x8719ce[_0x359c('0x34')][_0x359c('0x45')];_0x4d4860[_0x359c('0x46')]=_0x359c('0x33');_0x4d4860[_0x359c('0x47')]=JSON['stringify'](_0x5f31fe);var _0x169289=[];for(var _0x3c81de=0x0;_0x3c81de<_0x5f31fe[_0x359c('0x48')];_0x3c81de++){var _0x33fde7=_0x5f31fe[_0x3c81de];if(_0x33fde7&&_0x33fde7[_0x359c('0x34')]&&_0x33fde7[_0x359c('0x34')][_0x359c('0x49')]){_0x169289[_0x359c('0x4a')](createMessage(_0x29d295,_0x2ae8ee,_0x4d4860,_0x33fde7[_0x359c('0x34')]['fulfillmentText']));}}return Promise[_0x359c('0x4b')](_0x169289)[_0x359c('0xf')](function(){if(_0x575a51){_0x246dc1[_0x359c('0x1a')]();}else{_0x246dc1[_0x359c('0x2f')]();}})[_0x359c('0x2b')](function(_0x3abcc4){logger['error'](_0x359c('0x11'),_0x29d295,JSON['stringify'](_0x3abcc4));_0x246dc1[_0x359c('0x1a')]();});}})['catch'](function(_0x52a93a){logger[_0x359c('0x13')](_0x359c('0x11'),_0x29d295,_0x52a93a[_0x359c('0x31')]);_0x246dc1['next']();});}}catch(_0x40b282){logger[_0x359c('0x13')](_0x359c('0x11'),_0x29d295,JSON['stringify'](_0x40b282));_0x246dc1[_0x359c('0x2f')]();}};};
\ No newline at end of file
index a3121ac..41875d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe563=['lodash','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','replace','length','error','[%s][GOTOIF]\x20%s','message','join','condition','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','rules','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','stringify','validate'];(function(_0xec7013,_0x1b3e63){var _0x205820=function(_0x21a4b7){while(--_0x21a4b7){_0xec7013['push'](_0xec7013['shift']());}};_0x205820(++_0x1b3e63);}(_0xe563,0xb5));var _0x3e56=function(_0x4611af,_0x19a973){_0x4611af=_0x4611af-0x0;var _0x5bf8d5=_0xe563[_0x4611af];return _0x5bf8d5;};'use strict';var schema=require(_0x3e56('0x0'));var _=require(_0x3e56('0x1'));var htmlToText=require('html-to-text');var utils=require(_0x3e56('0x2'));var logger=require(_0x3e56('0x3'))(_0x3e56('0x4'));var gotoif=schema({'condition':{'type':_0x3e56('0x5'),'required':!![],'message':_0x3e56('0x6')},'priorityTrue':{'type':_0x3e56('0x7'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x3e56('0x7'),'message':_0x3e56('0x8')}});exports[_0x3e56('0x9')]=function(_0x1dbdcf,_0x5c0a26){return function(_0xbf62a3){try{var _0x1a7df3={'condition':htmlToText[_0x3e56('0xa')](utils['getMustacheRender'](_0x5c0a26[0x0],this),{'wordwrap':![]})[_0x3e56('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x5c0a26[0x1],'priorityFalse':_0x5c0a26[0x2]};var _0x1b5b6d=gotoif[_0x3e56('0x0')](_0x1a7df3,{'typecast':!![]});if(_0x1b5b6d[_0x3e56('0xc')]){logger[_0x3e56('0xd')](_0x3e56('0xe'),_0x1dbdcf,_['map'](_0x1b5b6d,_0x3e56('0xf'))[_0x3e56('0x10')](',\x20'));_0xbf62a3['stop']();}else{try{var _0x3b3b51=eval('('+_0x1a7df3[_0x3e56('0x11')]+')');var _0x194879=_0x3b3b51?_0x1a7df3['priorityTrue']:_0x1a7df3[_0x3e56('0x12')];logger[_0x3e56('0x13')](_0x3e56('0x14'),_0x1dbdcf,_0x1a7df3[_0x3e56('0x11')],_0x3b3b51,_0x194879||'next');if(_0x194879){var _0x873129=_['findIndex'](_0xbf62a3[_0x3e56('0x15')](),{'p':_0x194879});if(_0x873129>=0x0){logger[_0x3e56('0x13')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x1dbdcf,_0x194879||_0x3e56('0x16'),_0x873129);_0xbf62a3[_0x3e56('0x16')](_0x873129);}else{logger['info'](_0x3e56('0x17'),_0x1dbdcf,_0x194879||_0x3e56('0x16'));_0xbf62a3[_0x3e56('0x18')]();}}else{_0xbf62a3[_0x3e56('0x16')]();}}catch(_0x1431e7){logger[_0x3e56('0xd')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x1dbdcf,_0x1431e7['message']);_0xbf62a3['stop']();}}}catch(_0x1d148d){logger[_0x3e56('0xd')]('[%s][GOTOIF]\x20%s',_0x1dbdcf,JSON[_0x3e56('0x19')](_0x1d148d));_0xbf62a3[_0x3e56('0x18')]();}};};
\ No newline at end of file
+var _0xf300=['rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','validate','html-to-text','./utils','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','replace','length','error','[%s][GOTOIF]\x20%s','map','message','stop','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next','findIndex'];(function(_0x38cc36,_0x30970f){var _0x3213b5=function(_0x331d9c){while(--_0x331d9c){_0x38cc36['push'](_0x38cc36['shift']());}};_0x3213b5(++_0x30970f);}(_0xf300,0x1e8));var _0x0f30=function(_0x4c6cf0,_0x826f70){_0x4c6cf0=_0x4c6cf0-0x0;var _0x108145=_0xf300[_0x4c6cf0];return _0x108145;};'use strict';var schema=require(_0x0f30('0x0'));var _=require('lodash');var htmlToText=require(_0x0f30('0x1'));var utils=require(_0x0f30('0x2'));var logger=require(_0x0f30('0x3'))('routing');var gotoif=schema({'condition':{'type':_0x0f30('0x4'),'required':!![],'message':_0x0f30('0x5')},'priorityTrue':{'type':_0x0f30('0x6'),'message':_0x0f30('0x7')},'priorityFalse':{'type':_0x0f30('0x6'),'message':_0x0f30('0x8')}});exports[_0x0f30('0x9')]=function(_0x946d97,_0x3888f1){return function(_0x4796f8){try{var _0x3ca1c3={'condition':htmlToText[_0x0f30('0xa')](utils['getMustacheRender'](_0x3888f1[0x0],this),{'wordwrap':![]})[_0x0f30('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3888f1[0x1],'priorityFalse':_0x3888f1[0x2]};var _0x42f61b=gotoif['validate'](_0x3ca1c3,{'typecast':!![]});if(_0x42f61b[_0x0f30('0xc')]){logger[_0x0f30('0xd')](_0x0f30('0xe'),_0x946d97,_[_0x0f30('0xf')](_0x42f61b,_0x0f30('0x10'))['join'](',\x20'));_0x4796f8[_0x0f30('0x11')]();}else{try{var _0x4a178e=eval('('+_0x3ca1c3['condition']+')');var _0x59e3a5=_0x4a178e?_0x3ca1c3[_0x0f30('0x12')]:_0x3ca1c3[_0x0f30('0x13')];logger[_0x0f30('0x14')](_0x0f30('0x15'),_0x946d97,_0x3ca1c3[_0x0f30('0x16')],_0x4a178e,_0x59e3a5||_0x0f30('0x17'));if(_0x59e3a5){var _0x436b17=_[_0x0f30('0x18')](_0x4796f8[_0x0f30('0x19')](),{'p':_0x59e3a5});if(_0x436b17>=0x0){logger['info'](_0x0f30('0x1a'),_0x946d97,_0x59e3a5||_0x0f30('0x17'),_0x436b17);_0x4796f8[_0x0f30('0x17')](_0x436b17);}else{logger[_0x0f30('0x14')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x946d97,_0x59e3a5||'next');_0x4796f8[_0x0f30('0x11')]();}}else{_0x4796f8[_0x0f30('0x17')]();}}catch(_0x4ff3cd){logger[_0x0f30('0xd')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x946d97,_0x4ff3cd[_0x0f30('0x10')]);_0x4796f8['stop']();}}}catch(_0x41ef3d){logger['error'](_0x0f30('0xe'),_0x946d97,JSON['stringify'](_0x41ef3d));_0x4796f8[_0x0f30('0x11')]();}};};
\ No newline at end of file
index 61e8d3f..2f5a784 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe76d=['join','[%s][GOTOP]\x20priority\x20%s','priority','rules','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','[%s][GOTOP]\x20%s','stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','message'];(function(_0x1ac38c,_0x56e1da){var _0x2d48d2=function(_0x374a79){while(--_0x374a79){_0x1ac38c['push'](_0x1ac38c['shift']());}};_0x2d48d2(++_0x56e1da);}(_0xe76d,0x170));var _0xde76=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xe76d[_0x4c12ec];return _0x3ae42c;};'use strict';var schema=require(_0xde76('0x0'));var _=require(_0xde76('0x1'));var logger=require(_0xde76('0x2'))(_0xde76('0x3'));var gotop=schema({'priority':{'type':_0xde76('0x4'),'required':!![],'message':_0xde76('0x5')}});exports[_0xde76('0x6')]=function(_0xefcbd8,_0x31e27e){return function(_0x3612c3){try{var _0xb6b88b={'priority':_0x31e27e[0x0]};var _0x1481c7=gotop[_0xde76('0x0')](_0xb6b88b,{'typecast':!![]});if(_0x1481c7[_0xde76('0x7')]){logger[_0xde76('0x8')]('[%s][GOTOP]\x20%s',_0xefcbd8,_['map'](_0x1481c7,_0xde76('0x9'))[_0xde76('0xa')](',\x20'));_0x3612c3['stop']();}else{logger['info'](_0xde76('0xb'),_0xefcbd8,_0xb6b88b[_0xde76('0xc')]);if(_0xb6b88b[_0xde76('0xc')]){var _0x6ff740=_['findIndex'](_0x3612c3[_0xde76('0xd')](),{'p':_0xb6b88b[_0xde76('0xc')]});if(_0x6ff740>=0x0){logger[_0xde76('0xe')](_0xde76('0xf'),_0xefcbd8,_0xb6b88b[_0xde76('0xc')]||'next',_0x6ff740);_0x3612c3[_0xde76('0x10')](_0x6ff740);}else{logger[_0xde76('0xe')](_0xde76('0x11'),_0xefcbd8,_0xb6b88b['priority']||_0xde76('0x10'));_0x3612c3[_0xde76('0x12')]();}}else{_0x3612c3[_0xde76('0x10')]();}}}catch(_0x25b92d){logger[_0xde76('0x8')](_0xde76('0x13'),_0xefcbd8,JSON[_0xde76('0x14')](_0x25b92d));_0x3612c3['stop']();}};};
\ No newline at end of file
+var _0x82e0=['rules','next','info','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error','[%s][GOTOP]\x20%s','message','join','stop','priority','findIndex'];(function(_0x286480,_0x9181e8){var _0x26907b=function(_0x2017d5){while(--_0x2017d5){_0x286480['push'](_0x286480['shift']());}};_0x26907b(++_0x9181e8);}(_0x82e0,0x6a));var _0x082e=function(_0x104662,_0x53a7a7){_0x104662=_0x104662-0x0;var _0x19cba7=_0x82e0[_0x104662];return _0x19cba7;};'use strict';var schema=require('validate');var _=require(_0x082e('0x0'));var logger=require(_0x082e('0x1'))(_0x082e('0x2'));var gotop=schema({'priority':{'type':_0x082e('0x3'),'required':!![],'message':_0x082e('0x4')}});exports[_0x082e('0x5')]=function(_0x3557bc,_0x30a76a){return function(_0x22e3ac){try{var _0x4664d8={'priority':_0x30a76a[0x0]};var _0x21fb3e=gotop['validate'](_0x4664d8,{'typecast':!![]});if(_0x21fb3e['length']){logger[_0x082e('0x6')](_0x082e('0x7'),_0x3557bc,_['map'](_0x21fb3e,_0x082e('0x8'))[_0x082e('0x9')](',\x20'));_0x22e3ac[_0x082e('0xa')]();}else{logger['info']('[%s][GOTOP]\x20priority\x20%s',_0x3557bc,_0x4664d8[_0x082e('0xb')]);if(_0x4664d8[_0x082e('0xb')]){var _0xfd8750=_[_0x082e('0xc')](_0x22e3ac[_0x082e('0xd')](),{'p':_0x4664d8[_0x082e('0xb')]});if(_0xfd8750>=0x0){logger['info']('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x3557bc,_0x4664d8[_0x082e('0xb')]||_0x082e('0xe'),_0xfd8750);_0x22e3ac[_0x082e('0xe')](_0xfd8750);}else{logger[_0x082e('0xf')](_0x082e('0x10'),_0x3557bc,_0x4664d8[_0x082e('0xb')]||'next');_0x22e3ac['stop']();}}else{_0x22e3ac['next']();}}}catch(_0x2d9c38){logger['error'](_0x082e('0x7'),_0x3557bc,JSON['stringify'](_0x2d9c38));_0x22e3ac[_0x082e('0xa')]();}};};
\ No newline at end of file
index 323a826..baa0754 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8c7=['[%s][MESSAGE]\x20%s','body','next','error','stringify','./utils','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','ChatWebsiteId','account','upperFirst','AccountId','interaction','Message','create','then','info'];(function(_0x1590ce,_0x127795){var _0x37ea1e=function(_0x511300){while(--_0x511300){_0x1590ce['push'](_0x1590ce['shift']());}};_0x37ea1e(++_0x127795);}(_0xa8c7,0x1a3));var _0x7a8c=function(_0x367bf8,_0x31a041){_0x367bf8=_0x367bf8-0x0;var _0x58f63e=_0xa8c7[_0x367bf8];return _0x58f63e;};'use strict';var _=require('lodash');var utils=require(_0x7a8c('0x0'));var logger=require('../../../../config/logger')(_0x7a8c('0x1'));var rpc={'chatMessage':require(_0x7a8c('0x2')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x7a8c('0x3')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x7a8c('0x4')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x7a8c('0x5')]=function(_0xf239ac,_0x661ee7){return function(_0x2296cd){try{var _0x1c80c9={'body':utils[_0x7a8c('0x6')](_0x661ee7[0x0],this),'ContactId':this[_0x7a8c('0x7')]['id']};if(this[_0x7a8c('0x8')]==='chat'){_0x1c80c9[_0x7a8c('0x9')]=this[_0x7a8c('0xa')]['id'];}else{_0x1c80c9[_[_0x7a8c('0xb')](this[_0x7a8c('0x8')])+_0x7a8c('0xc')]=this[_0x7a8c('0xa')]['id'];}_0x1c80c9[_[_0x7a8c('0xb')](this[_0x7a8c('0x8')])+'InteractionId']=this[_0x7a8c('0xd')]['id'];if(rpc[this[_0x7a8c('0x8')]+'Message']){return rpc[this[_0x7a8c('0x8')]+_0x7a8c('0xe')][_0x7a8c('0xf')](_0x1c80c9)[_0x7a8c('0x10')](function(_0x4cae79){logger[_0x7a8c('0x11')](_0x7a8c('0x12'),_0xf239ac,_0x1c80c9[_0x7a8c('0x13')]);_0x2296cd[_0x7a8c('0x14')]();})['catch'](function(_0x421d1a){logger[_0x7a8c('0x15')]('[%s][MESSAGE]\x20%s',_0xf239ac,JSON['stringify'](_0x421d1a));_0x2296cd['stop']();});}}catch(_0x290f6a){logger[_0x7a8c('0x15')](_0x7a8c('0x12'),_0xf239ac,JSON[_0x7a8c('0x16')](_0x290f6a));_0x2296cd['stop']();}};};
\ No newline at end of file
+var _0x4373=['stop','[%s][MESSAGE]\x20%s','lodash','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','contact','ChatWebsiteId','account','channel','AccountId','interaction','Message','info','next','catch','error','stringify'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x4373,0xfe));var _0x3437=function(_0x3036c7,_0x1268d1){_0x3036c7=_0x3036c7-0x0;var _0x4bc963=_0x4373[_0x3036c7];return _0x4bc963;};'use strict';var _=require(_0x3437('0x0'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x3437('0x1'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x3437('0x2')),'smsMessage':require(_0x3437('0x3')),'faxMessage':require(_0x3437('0x4')),'whatsappMessage':require(_0x3437('0x5'))};exports['consequence']=function(_0x21e3e5,_0x386e02){return function(_0x2a5840){try{var _0x3333db={'body':utils[_0x3437('0x6')](_0x386e02[0x0],this),'ContactId':this[_0x3437('0x7')]['id']};if(this['channel']==='chat'){_0x3333db[_0x3437('0x8')]=this[_0x3437('0x9')]['id'];}else{_0x3333db[_['upperFirst'](this[_0x3437('0xa')])+_0x3437('0xb')]=this[_0x3437('0x9')]['id'];}_0x3333db[_['upperFirst'](this[_0x3437('0xa')])+'InteractionId']=this[_0x3437('0xc')]['id'];if(rpc[this['channel']+_0x3437('0xd')]){return rpc[this[_0x3437('0xa')]+_0x3437('0xd')]['create'](_0x3333db)['then'](function(_0xbd1db7){logger[_0x3437('0xe')]('[%s][MESSAGE]\x20%s',_0x21e3e5,_0x3333db['body']);_0x2a5840[_0x3437('0xf')]();})[_0x3437('0x10')](function(_0x5cbe11){logger[_0x3437('0x11')]('[%s][MESSAGE]\x20%s',_0x21e3e5,JSON[_0x3437('0x12')](_0x5cbe11));_0x2a5840[_0x3437('0x13')]();});}}catch(_0x557d95){logger['error'](_0x3437('0x14'),_0x21e3e5,JSON[_0x3437('0x12')](_0x557d95));_0x2a5840['stop']();}};};
\ No newline at end of file
index d596c3e..ba0d92f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d2b=['consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify','./utils','../../../../config/logger'];(function(_0x51b0dc,_0x5307b7){var _0x13fa89=function(_0x2c880f){while(--_0x2c880f){_0x51b0dc['push'](_0x51b0dc['shift']());}};_0x13fa89(++_0x5307b7);}(_0x2d2b,0x1c9));var _0xb2d2=function(_0x1fced3,_0x2aa7cb){_0x1fced3=_0x1fced3-0x0;var _0xd009be=_0x2d2b[_0x1fced3];return _0xd009be;};'use strict';var utils=require(_0xb2d2('0x0'));var logger=require(_0xb2d2('0x1'))('routing');exports[_0xb2d2('0x2')]=function(_0x38ea01,_0xb58b27){return function(_0x1bd751){try{logger[_0xb2d2('0x3')](_0xb2d2('0x4'),_0x38ea01,utils[_0xb2d2('0x5')](_0xb58b27[0x0],this));_0x1bd751[_0xb2d2('0x6')]();}catch(_0x2f746a){logger[_0xb2d2('0x7')](_0xb2d2('0x4'),_0x38ea01,JSON[_0xb2d2('0x8')](_0x2f746a));_0x1bd751['stop']();}};};
\ No newline at end of file
+var _0x8e37=['error','stringify','./utils','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s'];(function(_0x2ad3e4,_0x5e8d39){var _0x5015f1=function(_0xdabd05){while(--_0xdabd05){_0x2ad3e4['push'](_0x2ad3e4['shift']());}};_0x5015f1(++_0x5e8d39);}(_0x8e37,0x192));var _0x78e3=function(_0x398b0e,_0x14d102){_0x398b0e=_0x398b0e-0x0;var _0x3d03ea=_0x8e37[_0x398b0e];return _0x3d03ea;};'use strict';var utils=require(_0x78e3('0x0'));var logger=require(_0x78e3('0x1'))(_0x78e3('0x2'));exports[_0x78e3('0x3')]=function(_0x337d36,_0x52467a){return function(_0x5ea124){try{logger[_0x78e3('0x4')](_0x78e3('0x5'),_0x337d36,utils['getMustacheRender'](_0x52467a[0x0],this));_0x5ea124['next']();}catch(_0x22a818){logger[_0x78e3('0x6')](_0x78e3('0x5'),_0x337d36,JSON[_0x78e3('0x7')](_0x22a818));_0x5ea124['stop']();}};};
\ No newline at end of file
index 2dedcd7..a17ea92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43fd=['[%s][QUEUE]\x20ROUTING\x20STOPPED','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','util','seq-queue','moment','../../../../config/logger','routing','./strategy','redis','defaults','queue_id','account','queue','from','clone','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','upperFirst','InteractionId','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','toLowerCase','length','[%s][QUEUE]\x20%s','map','join','find','Queues','createQueue','atimeout','rules','end'];(function(_0xb3a9a,_0x2cb55a){var _0x4efe6b=function(_0x3dfc6f){while(--_0x3dfc6f){_0xb3a9a['push'](_0xb3a9a['shift']());}};_0x4efe6b(++_0x2cb55a);}(_0x43fd,0x186));var _0xd43f=function(_0x4c886a,_0x52f1ae){_0x4c886a=_0x4c886a-0x0;var _0x486e20=_0x43fd[_0x4c886a];return _0x486e20;};'use strict';var schema=require(_0xd43f('0x0'));var _=require(_0xd43f('0x1'));var util=require(_0xd43f('0x2'));var seqqueue=require(_0xd43f('0x3'));var moment=require(_0xd43f('0x4'));var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require(_0xd43f('0x5'))(_0xd43f('0x6'));var strategy=require(_0xd43f('0x7'));config[_0xd43f('0x8')]=_[_0xd43f('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd43f('0x8')]));var attributes=['id',_0xd43f('0xa'),_0xd43f('0xb'),_0xd43f('0xc'),_0xd43f('0xd'),'joinAt'];function emit(_0x23c350,_0x49fa49,_0x1175b8){io['to'](_0x23c350)['emit'](_0x49fa49,_0x1175b8);}function emitChannelQueueInteraction(_0x4bcbd3,_0x5da5d0,_0x25a13a,_0x47cf7b,_0x5cacf3,_0x39d753,_0x44a556,_0x44beb3){var _0xd8bf5d=_[_0xd43f('0xe')](_0x25a13a);_0xd8bf5d[_0xd43f('0xa')]=_0x44beb3;_0xd8bf5d[_0xd43f('0xc')]=_0x5da5d0;_0xd8bf5d[_0xd43f('0xb')]=_0x47cf7b;_0xd8bf5d['id']=_0x5cacf3;if(_0x39d753){_0x44a556[util[_0xd43f('0xf')](_0xd43f('0x10'),_0x4bcbd3)][_0x5cacf3]=_[_0xd43f('0x11')](_0xd8bf5d,attributes);}else{delete _0x44a556[util[_0xd43f('0xf')](_0xd43f('0x10'),_0x4bcbd3)][_0x5cacf3];}emit(util['format'](_0xd43f('0x12'),_0x4bcbd3,_0x5da5d0),util[_0xd43f('0xf')](_0xd43f('0x13'),_0x4bcbd3,_0x39d753?_0xd43f('0x14'):_0xd43f('0x15')),_[_0xd43f('0x11')](_0xd8bf5d,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xd43f('0x16')),'chatQueueReport':require(_0xd43f('0x17')),'smsQueueReport':require(_0xd43f('0x18')),'faxQueueReport':require(_0xd43f('0x19')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':'string','required':!![],'message':_0xd43f('0x1a')},'timeout':{'type':_0xd43f('0x1b'),'message':_0xd43f('0x1c')}});function startRouting(_0x20237b,_0x205030,_0x3887ca,_0x246eb2){if(_0x20237b&&_0x205030&&_0x3887ca){_0x205030[_0xd43f('0x1d')]+=0x1;var _0x5577bd={'uniqueid':_0x20237b,'from':_0x3887ca[_0xd43f('0x1e')]?_0x3887ca[_0xd43f('0x1e')][_0xd43f('0xd')]:'','joinAt':moment()[_0xd43f('0xf')](_0xd43f('0x1f')),'ContactId':_0x3887ca['contact']?_0x3887ca[_0xd43f('0x20')]['id']:null,'ListId':_0x3887ca['list']?_0x3887ca[_0xd43f('0x21')]['id']:null};_0x5577bd[_['upperFirst'](_0x3887ca[_0xd43f('0x22')])+_0xd43f('0x23')]=_0x205030['id']||null;_0x5577bd[_[_0xd43f('0x24')](_0x3887ca[_0xd43f('0x22')])+_0xd43f('0x25')]=_0x3887ca['interaction']?_0x3887ca['interaction']['id']:null;_0x5577bd[_[_0xd43f('0x24')](_0x3887ca[_0xd43f('0x22')])+_0xd43f('0x26')]=_0x3887ca[_0xd43f('0x27')]?_0x3887ca[_0xd43f('0x27')]['id']:null;_0x5577bd[_['upperFirst'](_0x3887ca[_0xd43f('0x22')])+(_0x3887ca['channel']!==_0xd43f('0x28')?_0xd43f('0x29'):_0xd43f('0x2a'))]=_0x3887ca['account']?_0x3887ca['account']['id']:null;logger[_0xd43f('0x2b')](util[_0xd43f('0xf')](_0xd43f('0x2c'),_0x20237b,_0x205030[_0xd43f('0x2d')]));emitChannelQueueInteraction(_0x3887ca[_0xd43f('0x22')],_0x205030[_0xd43f('0x2d')],_0x5577bd,_0x3887ca[_0xd43f('0xb')]['name'],_0x3887ca['message']['id'],!![],_0x246eb2,_0x205030['id']);if(rpc[_0x3887ca[_0xd43f('0x22')]+_0xd43f('0x2e')]){return rpc[_0x3887ca[_0xd43f('0x22')]+'QueueReport'][_0xd43f('0x2f')](_0x5577bd)[_0xd43f('0x30')](function(_0x44b3cf){logger[_0xd43f('0x31')]('create\x20queue\x20report');});}}}function stopRouting(_0x597374,_0x4df495,_0x528ea1,_0x471f6b){if(_0x597374&&_0x4df495){_0x4df495[_0xd43f('0x1d')]-=0x1;var _0x3e0106={'leaveAt':moment()[_0xd43f('0xf')](_0xd43f('0x1f')),'acceptAt':moment()[_0xd43f('0xf')](_0xd43f('0x1f')),'reason':_0xd43f('0x32')};logger[_0xd43f('0x2b')](util[_0xd43f('0xf')](_0xd43f('0x33'),_0x597374,_0x4df495[_0xd43f('0x2d')]));emitChannelQueueInteraction(_0x528ea1[_0xd43f('0x22')],_0x4df495['name'],_0x528ea1[_0xd43f('0x1e')],_0x528ea1[_0xd43f('0xb')][_0xd43f('0x2d')],_0x528ea1[_0xd43f('0x27')]['id'],![],_0x471f6b,_0x4df495['id']);if(rpc[_0x528ea1[_0xd43f('0x22')]+_0xd43f('0x2e')]){return rpc[_0x528ea1[_0xd43f('0x22')]+_0xd43f('0x2e')][_0xd43f('0x34')](_0x597374,_0x3e0106)[_0xd43f('0x30')](function(_0x280b1a){logger['error'](_0xd43f('0x35'));});}}}function endRouting(_0x2648f0,_0x52db47,_0x3e7fd4,_0x149bd0){if(_0x2648f0&&_0x52db47){_0x52db47[_0xd43f('0x1d')]-=0x1;var _0x42b267={'leaveAt':moment()[_0xd43f('0xf')](_0xd43f('0x1f')),'exitAt':moment()['format'](_0xd43f('0x1f')),'reason':_0xd43f('0x36')};logger[_0xd43f('0x2b')](util[_0xd43f('0xf')]('[%s][END:QUEUE][NAME:%s]',_0x2648f0,_0x52db47[_0xd43f('0x2d')]));emitChannelQueueInteraction(_0x3e7fd4[_0xd43f('0x22')],_0x52db47[_0xd43f('0x2d')],_0x3e7fd4[_0xd43f('0x1e')],_0x3e7fd4[_0xd43f('0xb')]['name'],_0x3e7fd4[_0xd43f('0x27')]['id'],![],_0x149bd0);if(rpc[_0x3e7fd4[_0xd43f('0x22')]+_0xd43f('0x2e')]){return rpc[_0x3e7fd4[_0xd43f('0x22')]+_0xd43f('0x2e')][_0xd43f('0x34')](_0x2648f0,_0x42b267)['catch'](function(_0xb5771f){logger[_0xd43f('0x31')](_0xd43f('0x35'));});}}}function handleFindQueue(_0x56462b){return function(_0x2b5a44){return _0x2b5a44[_0xd43f('0x2d')][_0xd43f('0x37')]()===_0x56462b[_0xd43f('0x37')]();};}exports['consequence']=function(_0x1b3713,_0x1a81d1,_0x486d9d,_0x4c98aa){return function(_0x17cdf6){try{var _0x2f163a={'name':_0x1a81d1[0x0],'timeout':_0x1a81d1[0x1]};var _0x4c57d4=queue['validate'](_0x2f163a,{'typecast':!![]});if(_0x4c57d4[_0xd43f('0x38')]){logger[_0xd43f('0x31')](_0xd43f('0x39'),_0x1b3713,_[_0xd43f('0x3a')](_0x4c57d4,'message')[_0xd43f('0x3b')](',\x20'));_0x17cdf6['stop']();}else{var _0x19cd6a=_[_0xd43f('0x3c')](_0x486d9d[_0x4c98aa[_0xd43f('0x22')]+_0xd43f('0x3d')],handleFindQueue(_0x2f163a['name']));if(_0x19cd6a){startRouting(_0x1b3713,_0x19cd6a,_0x4c98aa,_0x486d9d);var _0x1eb13f=(_0x19cd6a[_0xd43f('0x36')]||0xa)*0x3e8;var _0x5adc40=(_0x2f163a[_0xd43f('0x36')]||0x14)*0x3e8;var _0x2cc3b2,_0x40217d;if(_0x1eb13f>_0x5adc40){_0x5adc40=_0x1eb13f;}var _0x23e73b=seqqueue[_0xd43f('0x3e')](_0x1eb13f);_0x23e73b['id']=_0x1b3713;_0x23e73b[_0xd43f('0x3f')]=_0x1eb13f;_0x23e73b['qtimeout']=_0x5adc40;_0x23e73b[_0xd43f('0x22')]=_0x4c98aa[_0xd43f('0x22')];_0x486d9d[_0xd43f('0x40')][_0x1b3713]['on'](_0xd43f('0x41'),function(){logger[_0xd43f('0x2b')](_0xd43f('0x42'),_0x1b3713);stopRouting(_0x1b3713,_0x19cd6a,_0x4c98aa,_0x486d9d);clearTimeout(_0x2cc3b2);_0x2cc3b2=undefined;_0x23e73b['close'](!![]);if(_0x486d9d[_0xd43f('0x40')][_0x1b3713]){delete _0x486d9d[_0xd43f('0x40')][_0x1b3713];}_0x17cdf6[_0xd43f('0x43')]();});_0x486d9d[_0xd43f('0x40')][_0x1b3713]['on'](_0xd43f('0x44'),function(){if(_0x486d9d[_0xd43f('0x40')][_0x1b3713]){delete _0x486d9d[_0xd43f('0x40')][_0x1b3713];}});_0x2cc3b2=setTimeout(function(){logger[_0xd43f('0x2b')](_0xd43f('0x45'),_0x1b3713);endRouting(_0x1b3713,_0x19cd6a,_0x4c98aa,_0x486d9d);clearTimeout(_0x2cc3b2);_0x23e73b['close'](!![]);_0x17cdf6[_0xd43f('0x46')]();},_0x5adc40);switch(_0x19cd6a[_0xd43f('0x47')]){case _0xd43f('0x48'):strategy[_0xd43f('0x48')](_0x23e73b,_0x19cd6a,_0x486d9d,_0x4c98aa);break;default:strategy[_0xd43f('0x49')](_0x23e73b,_0x19cd6a,_0x486d9d,_0x4c98aa);}}else{logger[_0xd43f('0x31')](_0xd43f('0x4a'),_0x1b3713,_0x2f163a[_0xd43f('0x2d')]);_0x17cdf6[_0xd43f('0x43')]();}}}catch(_0x197809){console['log'](_0x197809);logger[_0xd43f('0x31')](_0xd43f('0x39'),_0x1b3713,_0x197809[_0xd43f('0x4b')]);_0x17cdf6['stop']();}};};
\ No newline at end of file
+var _0x37da=['format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/faxQueueReport','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','interaction','MessageId','message','chat','WebsiteId','info','name','QueueReport','catch','error','create\x20queue\x20report','accepted','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','length','[%s][QUEUE]\x20%s','map','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','stop','complete','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','./strategy','defaults','redis','localhost','account','queue','from','joinAt','emit','clone','queue_id','%sQueuesWaitingInteractions','pick'];(function(_0x464878,_0x2e315d){var _0x144c25=function(_0x4eeca0){while(--_0x4eeca0){_0x464878['push'](_0x464878['shift']());}};_0x144c25(++_0x2e315d);}(_0x37da,0x11f));var _0xa37d=function(_0x1c2b58,_0x458f68){_0x1c2b58=_0x1c2b58-0x0;var _0x109bc1=_0x37da[_0x1c2b58];return _0x109bc1;};'use strict';var schema=require(_0xa37d('0x0'));var _=require(_0xa37d('0x1'));var util=require(_0xa37d('0x2'));var seqqueue=require(_0xa37d('0x3'));var moment=require(_0xa37d('0x4'));var Redis=require(_0xa37d('0x5'));var config=require(_0xa37d('0x6'));var logger=require(_0xa37d('0x7'))('routing');var strategy=require(_0xa37d('0x8'));config['redis']=_[_0xa37d('0x9')](config[_0xa37d('0xa')],{'host':_0xa37d('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa37d('0xa')]));var attributes=['id','queue_id',_0xa37d('0xc'),_0xa37d('0xd'),_0xa37d('0xe'),_0xa37d('0xf')];function emit(_0x57b6d9,_0x26b72a,_0x250370){io['to'](_0x57b6d9)[_0xa37d('0x10')](_0x26b72a,_0x250370);}function emitChannelQueueInteraction(_0x21d9c1,_0x4caa89,_0x10c993,_0x53fef6,_0x5854ea,_0x433230,_0x2dbfd9,_0x4f2514){var _0x262390=_[_0xa37d('0x11')](_0x10c993);_0x262390[_0xa37d('0x12')]=_0x4f2514;_0x262390[_0xa37d('0xd')]=_0x4caa89;_0x262390[_0xa37d('0xc')]=_0x53fef6;_0x262390['id']=_0x5854ea;if(_0x433230){_0x2dbfd9[util['format'](_0xa37d('0x13'),_0x21d9c1)][_0x5854ea]=_[_0xa37d('0x14')](_0x262390,attributes);}else{delete _0x2dbfd9[util[_0xa37d('0x15')](_0xa37d('0x13'),_0x21d9c1)][_0x5854ea];}emit(util['format'](_0xa37d('0x16'),_0x21d9c1,_0x4caa89),util['format'](_0xa37d('0x17'),_0x21d9c1,_0x433230?_0xa37d('0x18'):_0xa37d('0x19')),_['pick'](_0x262390,attributes));}var rpc={'openchannelQueueReport':require(_0xa37d('0x1a')),'mailQueueReport':require(_0xa37d('0x1b')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0xa37d('0x1c')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':'string','required':!![],'message':_0xa37d('0x1d')},'timeout':{'type':_0xa37d('0x1e'),'message':_0xa37d('0x1f')}});function startRouting(_0x3e26cc,_0x2e9441,_0x1beb0b,_0xb09e77){if(_0x3e26cc&&_0x2e9441&&_0x1beb0b){_0x2e9441[_0xa37d('0x20')]+=0x1;var _0x28244f={'uniqueid':_0x3e26cc,'from':_0x1beb0b[_0xa37d('0x21')]?_0x1beb0b[_0xa37d('0x21')]['from']:'','joinAt':moment()[_0xa37d('0x15')](_0xa37d('0x22')),'ContactId':_0x1beb0b[_0xa37d('0x23')]?_0x1beb0b[_0xa37d('0x23')]['id']:null,'ListId':_0x1beb0b['list']?_0x1beb0b[_0xa37d('0x24')]['id']:null};_0x28244f[_[_0xa37d('0x25')](_0x1beb0b[_0xa37d('0x26')])+_0xa37d('0x27')]=_0x2e9441['id']||null;_0x28244f[_[_0xa37d('0x25')](_0x1beb0b[_0xa37d('0x26')])+'InteractionId']=_0x1beb0b[_0xa37d('0x28')]?_0x1beb0b[_0xa37d('0x28')]['id']:null;_0x28244f[_[_0xa37d('0x25')](_0x1beb0b[_0xa37d('0x26')])+_0xa37d('0x29')]=_0x1beb0b['message']?_0x1beb0b[_0xa37d('0x2a')]['id']:null;_0x28244f[_[_0xa37d('0x25')](_0x1beb0b[_0xa37d('0x26')])+(_0x1beb0b[_0xa37d('0x26')]!==_0xa37d('0x2b')?'AccountId':_0xa37d('0x2c'))]=_0x1beb0b['account']?_0x1beb0b[_0xa37d('0xc')]['id']:null;logger[_0xa37d('0x2d')](util[_0xa37d('0x15')]('[%s][START:QUEUE][NAME:%s]',_0x3e26cc,_0x2e9441[_0xa37d('0x2e')]));emitChannelQueueInteraction(_0x1beb0b[_0xa37d('0x26')],_0x2e9441['name'],_0x28244f,_0x1beb0b[_0xa37d('0xc')][_0xa37d('0x2e')],_0x1beb0b[_0xa37d('0x2a')]['id'],!![],_0xb09e77,_0x2e9441['id']);if(rpc[_0x1beb0b[_0xa37d('0x26')]+_0xa37d('0x2f')]){return rpc[_0x1beb0b[_0xa37d('0x26')]+_0xa37d('0x2f')]['create'](_0x28244f)[_0xa37d('0x30')](function(_0x17bb85){logger[_0xa37d('0x31')](_0xa37d('0x32'));});}}}function stopRouting(_0x456f96,_0x239b86,_0x47f726,_0x107e96){if(_0x456f96&&_0x239b86){_0x239b86[_0xa37d('0x20')]-=0x1;var _0x704ff8={'leaveAt':moment()[_0xa37d('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xa37d('0x15')](_0xa37d('0x22')),'reason':_0xa37d('0x33')};logger[_0xa37d('0x2d')](util[_0xa37d('0x15')]('[%s][STOP:QUEUE][NAME:%s]',_0x456f96,_0x239b86['name']));emitChannelQueueInteraction(_0x47f726[_0xa37d('0x26')],_0x239b86['name'],_0x47f726[_0xa37d('0x21')],_0x47f726['account']['name'],_0x47f726[_0xa37d('0x2a')]['id'],![],_0x107e96,_0x239b86['id']);if(rpc[_0x47f726[_0xa37d('0x26')]+'QueueReport']){return rpc[_0x47f726[_0xa37d('0x26')]+_0xa37d('0x2f')][_0xa37d('0x34')](_0x456f96,_0x704ff8)['catch'](function(_0x12b61f){logger[_0xa37d('0x31')](_0xa37d('0x35'));});}}}function endRouting(_0x482a08,_0x1613a5,_0x336743,_0x4af855){if(_0x482a08&&_0x1613a5){_0x1613a5[_0xa37d('0x20')]-=0x1;var _0x15eae2={'leaveAt':moment()['format'](_0xa37d('0x22')),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xa37d('0x36')};logger[_0xa37d('0x2d')](util[_0xa37d('0x15')](_0xa37d('0x37'),_0x482a08,_0x1613a5['name']));emitChannelQueueInteraction(_0x336743[_0xa37d('0x26')],_0x1613a5['name'],_0x336743[_0xa37d('0x21')],_0x336743[_0xa37d('0xc')]['name'],_0x336743[_0xa37d('0x2a')]['id'],![],_0x4af855);if(rpc[_0x336743['channel']+_0xa37d('0x2f')]){return rpc[_0x336743[_0xa37d('0x26')]+'QueueReport'][_0xa37d('0x34')](_0x482a08,_0x15eae2)[_0xa37d('0x30')](function(_0xae00e2){logger[_0xa37d('0x31')](_0xa37d('0x35'));});}}}function handleFindQueue(_0x570d70){return function(_0x1bcf8a){return _0x1bcf8a[_0xa37d('0x2e')][_0xa37d('0x38')]()===_0x570d70[_0xa37d('0x38')]();};}exports['consequence']=function(_0x4777da,_0x25953d,_0x31b9ea,_0x3caa65){return function(_0x1d680b){try{var _0x30b60f={'name':_0x25953d[0x0],'timeout':_0x25953d[0x1]};var _0x2d7470=queue[_0xa37d('0x0')](_0x30b60f,{'typecast':!![]});if(_0x2d7470[_0xa37d('0x39')]){logger['error'](_0xa37d('0x3a'),_0x4777da,_[_0xa37d('0x3b')](_0x2d7470,_0xa37d('0x2a'))['join'](',\x20'));_0x1d680b['stop']();}else{var _0x3093dc=_['find'](_0x31b9ea[_0x3caa65['channel']+_0xa37d('0x3c')],handleFindQueue(_0x30b60f[_0xa37d('0x2e')]));if(_0x3093dc){startRouting(_0x4777da,_0x3093dc,_0x3caa65,_0x31b9ea);var _0x207804=(_0x3093dc[_0xa37d('0x36')]||0xa)*0x3e8;var _0x4c59c2=(_0x30b60f['timeout']||0x14)*0x3e8;var _0x3cf01e,_0xd156fb;if(_0x207804>_0x4c59c2){_0x4c59c2=_0x207804;}var _0xf6c234=seqqueue[_0xa37d('0x3d')](_0x207804);_0xf6c234['id']=_0x4777da;_0xf6c234[_0xa37d('0x3e')]=_0x207804;_0xf6c234[_0xa37d('0x3f')]=_0x4c59c2;_0xf6c234[_0xa37d('0x26')]=_0x3caa65[_0xa37d('0x26')];_0x31b9ea[_0xa37d('0x40')][_0x4777da]['on'](_0xa37d('0x41'),function(){logger[_0xa37d('0x2d')](_0xa37d('0x42'),_0x4777da);stopRouting(_0x4777da,_0x3093dc,_0x3caa65,_0x31b9ea);clearTimeout(_0x3cf01e);_0x3cf01e=undefined;_0xf6c234[_0xa37d('0x43')](!![]);if(_0x31b9ea[_0xa37d('0x40')][_0x4777da]){delete _0x31b9ea[_0xa37d('0x40')][_0x4777da];}_0x1d680b[_0xa37d('0x44')]();});_0x31b9ea[_0xa37d('0x40')][_0x4777da]['on'](_0xa37d('0x45'),function(){if(_0x31b9ea[_0xa37d('0x40')][_0x4777da]){delete _0x31b9ea[_0xa37d('0x40')][_0x4777da];}});_0x3cf01e=setTimeout(function(){logger[_0xa37d('0x2d')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x4777da);endRouting(_0x4777da,_0x3093dc,_0x3caa65,_0x31b9ea);clearTimeout(_0x3cf01e);_0xf6c234[_0xa37d('0x43')](!![]);_0x1d680b[_0xa37d('0x46')]();},_0x4c59c2);switch(_0x3093dc[_0xa37d('0x47')]){case _0xa37d('0x48'):strategy[_0xa37d('0x48')](_0xf6c234,_0x3093dc,_0x31b9ea,_0x3caa65);break;default:strategy[_0xa37d('0x49')](_0xf6c234,_0x3093dc,_0x31b9ea,_0x3caa65);}}else{logger[_0xa37d('0x31')](_0xa37d('0x4a'),_0x4777da,_0x30b60f[_0xa37d('0x2e')]);_0x1d680b[_0xa37d('0x44')]();}}}catch(_0x5895ba){console[_0xa37d('0x4b')](_0x5895ba);logger[_0xa37d('0x31')](_0xa37d('0x3a'),_0x4777da,_0x5895ba[_0xa37d('0x4c')]);_0x1d680b[_0xa37d('0x44')]();}};};
\ No newline at end of file
index 838e055..bf8d521 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf75=['handleDrained','prototype','squeue','handleRun','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','RINGING','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','writeLog','STOP','TIMEOUT','exports','uuid','../../../../../config/logger','routing','notificationId','agent','realtime','push','bind','handleTimeout','timeout','drained'];(function(_0x3f6631,_0x25ca40){var _0xa4fadb=function(_0x179a77){while(--_0x179a77){_0x3f6631['push'](_0x3f6631['shift']());}};_0xa4fadb(++_0x25ca40);}(_0xdf75,0x95));var _0x5df7=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xdf75[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var uuid=require(_0x5df7('0x0'));var util=require('./util');var logger=require(_0x5df7('0x1'))(_0x5df7('0x2'));var Agent=function(_0x564ce2,_0x2389dc,_0x2fb752,_0x19641c){this[_0x5df7('0x3')]=uuid['v4']();this['squeue']=_0x564ce2;this[_0x5df7('0x4')]=_0x2389dc;this[_0x5df7('0x5')]=_0x2fb752;this[_0x5df7('0x2')]=_0x19641c;this['squeue'][_0x5df7('0x6')](this['handleRun'][_0x5df7('0x7')](this),this[_0x5df7('0x8')][_0x5df7('0x7')](this));this['squeue']['on'](_0x5df7('0x9'),this[_0x5df7('0x8')][_0x5df7('0x7')](this));this['squeue']['on'](_0x5df7('0xa'),this[_0x5df7('0xb')]['bind'](this));};Agent[_0x5df7('0xc')][_0x5df7('0x6')]=function(){this[_0x5df7('0xd')]['push'](this[_0x5df7('0xe')][_0x5df7('0x7')](this),this[_0x5df7('0x8')]['bind'](this));};Agent[_0x5df7('0xc')][_0x5df7('0xb')]=function(){this[_0x5df7('0x8')](!![]);};Agent['prototype'][_0x5df7('0xe')]=function(_0x1053f9){logger[_0x5df7('0xf')](_0x5df7('0x10'),this['squeue']['id'],this[_0x5df7('0x4')]['id']);if(_[_0x5df7('0x11')](this[_0x5df7('0x5')][_0x5df7('0x12')][this[_0x5df7('0x4')]['id']])){logger[_0x5df7('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x5df7('0xd')]['id'],this[_0x5df7('0x4')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}else{if(this[_0x5df7('0x2')][_0x5df7('0x13')]||util[_0x5df7('0x14')](this['squeue']['id'],this[_0x5df7('0x5')][_0x5df7('0x12')][this[_0x5df7('0x4')]['id']],this[_0x5df7('0xd')][_0x5df7('0x15')],![])){this[_0x5df7('0x5')][_0x5df7('0x12')][this[_0x5df7('0x4')]['id']][_0x5df7('0x16')]=!![];this[_0x5df7('0x5')][_0x5df7('0x12')][this[_0x5df7('0x4')]['id']][_0x5df7('0x17')]=undefined;util[_0x5df7('0x18')](this[_0x5df7('0x3')],this[_0x5df7('0xd')]['id'],this[_0x5df7('0x5')][_0x5df7('0x12')][this[_0x5df7('0x4')]['id']],null,this[_0x5df7('0x2')]);util['writeLog'](this[_0x5df7('0xd')]['id'],this[_0x5df7('0x5')][_0x5df7('0x12')][this[_0x5df7('0x4')]['id']],_0x5df7('0x19')+(this[_0x5df7('0x2')][_0x5df7('0x13')]?':FORCED':''));}else{logger[_0x5df7('0xf')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x5df7('0xd')]['id'],this[_0x5df7('0x4')]['id']);setTimeout(this[_0x5df7('0x6')]['bind'](this),0x3e8);}}};Agent['prototype'][_0x5df7('0x8')]=function(_0x3f00ff){if(_[_0x5df7('0x11')](this['realtime'][_0x5df7('0x12')][this[_0x5df7('0x4')]['id']])){return logger[_0x5df7('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x5df7('0xd')]['id'],this[_0x5df7('0x4')]['id']);}else{logger[_0x5df7('0xf')](_0x5df7('0x1a'),this[_0x5df7('0xd')]['id'],this['agent']['id']);util[_0x5df7('0x1b')](this[_0x5df7('0x3')],this[_0x5df7('0xd')]['id'],this[_0x5df7('0x5')][_0x5df7('0x12')][this[_0x5df7('0x4')]['id']],null,this['routing']);this[_0x5df7('0x5')][_0x5df7('0x12')][this[_0x5df7('0x4')]['id']][_0x5df7('0x16')]=![];this[_0x5df7('0x5')][_0x5df7('0x12')][this[_0x5df7('0x4')]['id']][_0x5df7('0x17')]=undefined;util[_0x5df7('0x1c')](this[_0x5df7('0xd')]['id'],this[_0x5df7('0x5')]['agents'][this[_0x5df7('0x4')]['id']],_0x3f00ff?_0x5df7('0x1d'):_0x5df7('0x1e'));}if(!_0x3f00ff){setTimeout(this[_0x5df7('0x6')][_0x5df7('0x7')](this),0x3e8);}};function agent(_0x41e86f,_0x1c041e,_0x188838,_0x1684d2){return new Agent(_0x41e86f,_0x1c041e,_0x188838,_0x1684d2);}module[_0x5df7('0x1f')]=agent;
\ No newline at end of file
+var _0x3ea0=['busyQueue','showNotification','writeLog','RINGING','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','uuid','./util','routing','notificationId','squeue','agent','realtime','handleRun','bind','timeout','handleTimeout','drained','handleDrained','prototype','push','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','info','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x3ea0,0x153));var _0x03ea=function(_0x34edec,_0x228935){_0x34edec=_0x34edec-0x0;var _0x2d276d=_0x3ea0[_0x34edec];return _0x2d276d;};'use strict';var _=require('lodash');var uuid=require(_0x03ea('0x0'));var util=require(_0x03ea('0x1'));var logger=require('../../../../../config/logger')(_0x03ea('0x2'));var Agent=function(_0x47632e,_0x55f91f,_0x58952f,_0x14873d){this[_0x03ea('0x3')]=uuid['v4']();this[_0x03ea('0x4')]=_0x47632e;this[_0x03ea('0x5')]=_0x55f91f;this[_0x03ea('0x6')]=_0x58952f;this[_0x03ea('0x2')]=_0x14873d;this[_0x03ea('0x4')]['push'](this[_0x03ea('0x7')][_0x03ea('0x8')](this),this['handleTimeout']['bind'](this));this[_0x03ea('0x4')]['on'](_0x03ea('0x9'),this[_0x03ea('0xa')][_0x03ea('0x8')](this));this[_0x03ea('0x4')]['on'](_0x03ea('0xb'),this[_0x03ea('0xc')][_0x03ea('0x8')](this));};Agent[_0x03ea('0xd')][_0x03ea('0xe')]=function(){this[_0x03ea('0x4')][_0x03ea('0xe')](this[_0x03ea('0x7')][_0x03ea('0x8')](this),this[_0x03ea('0xa')][_0x03ea('0x8')](this));};Agent['prototype'][_0x03ea('0xc')]=function(){this[_0x03ea('0xa')](!![]);};Agent['prototype'][_0x03ea('0x7')]=function(_0x547329){logger['info'](_0x03ea('0xf'),this[_0x03ea('0x4')]['id'],this[_0x03ea('0x5')]['id']);if(_[_0x03ea('0x10')](this['realtime'][_0x03ea('0x11')][this[_0x03ea('0x5')]['id']])){logger[_0x03ea('0x12')](_0x03ea('0x13'),this[_0x03ea('0x4')]['id'],this['agent']['id']);setTimeout(this[_0x03ea('0xe')][_0x03ea('0x8')](this),0x3e8);}else{if(this[_0x03ea('0x2')][_0x03ea('0x14')]||util[_0x03ea('0x15')](this[_0x03ea('0x4')]['id'],this[_0x03ea('0x6')][_0x03ea('0x11')][this[_0x03ea('0x5')]['id']],this['squeue'][_0x03ea('0x16')],![])){this[_0x03ea('0x6')][_0x03ea('0x11')][this['agent']['id']][_0x03ea('0x17')]=!![];this[_0x03ea('0x6')][_0x03ea('0x11')][this[_0x03ea('0x5')]['id']][_0x03ea('0x18')]=undefined;util[_0x03ea('0x19')](this[_0x03ea('0x3')],this[_0x03ea('0x4')]['id'],this[_0x03ea('0x6')][_0x03ea('0x11')][this['agent']['id']],null,this[_0x03ea('0x2')]);util[_0x03ea('0x1a')](this[_0x03ea('0x4')]['id'],this[_0x03ea('0x6')][_0x03ea('0x11')][this[_0x03ea('0x5')]['id']],_0x03ea('0x1b')+(this[_0x03ea('0x2')][_0x03ea('0x14')]?':FORCED':''));}else{logger['info']('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this['squeue']['id'],this[_0x03ea('0x5')]['id']);setTimeout(this[_0x03ea('0xe')]['bind'](this),0x3e8);}}};Agent[_0x03ea('0xd')][_0x03ea('0xa')]=function(_0x308d0f){if(_[_0x03ea('0x10')](this[_0x03ea('0x6')][_0x03ea('0x11')][this[_0x03ea('0x5')]['id']])){return logger[_0x03ea('0x12')](_0x03ea('0x13'),this[_0x03ea('0x4')]['id'],this[_0x03ea('0x5')]['id']);}else{logger[_0x03ea('0x12')](_0x03ea('0x1c'),this[_0x03ea('0x4')]['id'],this[_0x03ea('0x5')]['id']);util[_0x03ea('0x1d')](this[_0x03ea('0x3')],this[_0x03ea('0x4')]['id'],this[_0x03ea('0x6')][_0x03ea('0x11')][this['agent']['id']],null,this[_0x03ea('0x2')]);this[_0x03ea('0x6')][_0x03ea('0x11')][this[_0x03ea('0x5')]['id']]['busy']=![];this['realtime'][_0x03ea('0x11')][this['agent']['id']][_0x03ea('0x18')]=undefined;util[_0x03ea('0x1a')](this[_0x03ea('0x4')]['id'],this[_0x03ea('0x6')]['agents'][this[_0x03ea('0x5')]['id']],_0x308d0f?_0x03ea('0x1e'):_0x03ea('0x1f'));}if(!_0x308d0f){setTimeout(this[_0x03ea('0xe')][_0x03ea('0x8')](this),0x3e8);}};function agent(_0x4389a1,_0x29b0f8,_0x434f95,_0x2b7d35){return new Agent(_0x4389a1,_0x29b0f8,_0x434f95,_0x2b7d35);}module[_0x03ea('0x20')]=agent;
\ No newline at end of file
index 5856707..e841e8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x05bc=['realtime','push','handleRun','bind','handleTimeout','drained','handleDrained','prototype','isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','writeLog','RINGING','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','TIMEOUT','busy','busyQueue','exports','uuid','../../../../../config/logger','routing','notificationId','squeue','queue'];(function(_0x1a2bff,_0x5c2276){var _0x3b09c5=function(_0xeb9f90){while(--_0xeb9f90){_0x1a2bff['push'](_0x1a2bff['shift']());}};_0x3b09c5(++_0x5c2276);}(_0x05bc,0xae));var _0xc05b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x05bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var uuid=require(_0xc05b('0x0'));var util=require('./util');var logger=require(_0xc05b('0x1'))(_0xc05b('0x2'));var Beepall=function(_0x59d194,_0x36c0ca,_0x2deceb,_0xf971c9){this[_0xc05b('0x3')]=uuid['v4']();this[_0xc05b('0x4')]=_0x59d194;this[_0xc05b('0x5')]=_0x36c0ca;this[_0xc05b('0x6')]=_0x2deceb;this[_0xc05b('0x2')]=_0xf971c9;this[_0xc05b('0x4')][_0xc05b('0x7')](this[_0xc05b('0x8')][_0xc05b('0x9')](this),this[_0xc05b('0xa')][_0xc05b('0x9')](this));this['squeue']['on']('timeout',this[_0xc05b('0xa')][_0xc05b('0x9')](this));this[_0xc05b('0x4')]['on'](_0xc05b('0xb'),this[_0xc05b('0xc')][_0xc05b('0x9')](this));};Beepall[_0xc05b('0xd')][_0xc05b('0x7')]=function(){this[_0xc05b('0x4')]['push'](this[_0xc05b('0x8')][_0xc05b('0x9')](this),this[_0xc05b('0xa')][_0xc05b('0x9')](this));};Beepall[_0xc05b('0xd')][_0xc05b('0xc')]=function(_0x55c1d3){this[_0xc05b('0xa')](!![]);};Beepall[_0xc05b('0xd')]['handleRun']=function(_0x4d4698){var _0x356b76=!![];if(!_[_0xc05b('0xe')](this[_0xc05b('0x5')])&&!_[_0xc05b('0xe')](this[_0xc05b('0x5')][_0xc05b('0xf')])&&this[_0xc05b('0x5')]['Agents'][_0xc05b('0x10')]>0x0){for(var _0x13c79f=0x0,_0xee4d8;_0x13c79f<this[_0xc05b('0x5')][_0xc05b('0xf')][_0xc05b('0x10')];_0x13c79f+=0x1){_0xee4d8=this['queue'][_0xc05b('0xf')][_0x13c79f]['id'];if(_['isNil'](this[_0xc05b('0x6')][_0xc05b('0x11')][_0xee4d8])){logger[_0xc05b('0x12')](_0xc05b('0x13'),this[_0xc05b('0x4')]['id'],_0xee4d8);}else{if(util['isAgentAvailable'](this[_0xc05b('0x4')]['id'],this[_0xc05b('0x6')][_0xc05b('0x11')][_0xee4d8],this[_0xc05b('0x4')]['channel'],!![])){_0x356b76=![];util[_0xc05b('0x14')](this[_0xc05b('0x4')]['id'],this[_0xc05b('0x6')][_0xc05b('0x11')][_0xee4d8],_0xc05b('0x15'));this[_0xc05b('0x6')]['agents'][_0xee4d8]['busy']=!![];this[_0xc05b('0x6')][_0xc05b('0x11')][_0xee4d8]['busyQueue']=this[_0xc05b('0x5')]['name'];util['showNotification'](this[_0xc05b('0x3')],this['squeue']['id'],this['realtime']['agents'][_0xee4d8],this[_0xc05b('0x5')],this['routing']);}}}if(_0x356b76){logger[_0xc05b('0x12')](_0xc05b('0x16'),this['squeue']['id']);setTimeout(this[_0xc05b('0x7')][_0xc05b('0x9')](this),0x3e8);}}else{logger[_0xc05b('0x12')](_0xc05b('0x17'),this[_0xc05b('0x4')]['id']);setTimeout(this[_0xc05b('0x7')][_0xc05b('0x9')](this),0x3e8);}};Beepall[_0xc05b('0xd')][_0xc05b('0xa')]=function(_0x12e0d3){if(!_[_0xc05b('0xe')](this[_0xc05b('0x5')])&&!_['isNil'](this[_0xc05b('0x5')]['Agents'])){for(var _0x370d05=0x0,_0x54286a;_0x370d05<this['queue'][_0xc05b('0xf')][_0xc05b('0x10')];_0x370d05+=0x1){_0x54286a=this[_0xc05b('0x5')]['Agents'][_0x370d05]['id'];if(_[_0xc05b('0xe')](this['realtime']['agents'][_0x54286a])){logger['info'](_0xc05b('0x13'),this[_0xc05b('0x4')]['id'],_0x54286a);}else{util[_0xc05b('0x18')](this['notificationId'],this[_0xc05b('0x4')]['id'],this[_0xc05b('0x6')][_0xc05b('0x11')][_0x54286a],this[_0xc05b('0x5')],this['routing']);util[_0xc05b('0x14')](this[_0xc05b('0x4')]['id'],this[_0xc05b('0x6')]['agents'][_0x54286a],_0x12e0d3?_0xc05b('0x19'):_0xc05b('0x1a'));this['realtime'][_0xc05b('0x11')][_0x54286a][_0xc05b('0x1b')]=![];this['realtime']['agents'][_0x54286a][_0xc05b('0x1c')]=undefined;}}}if(!_0x12e0d3){setTimeout(this[_0xc05b('0x7')][_0xc05b('0x9')](this),0x3e8);}};function beepall(_0x2add2a,_0x549899,_0x19cff2,_0x4883c2){return new Beepall(_0x2add2a,_0x549899,_0x19cff2,_0x4883c2);}module[_0xc05b('0x1d')]=beepall;
\ No newline at end of file
+var _0x2d17=['showNotification','[%s][QUEUE]\x20EMPTY','hideNotification','writeLog','STOP','TIMEOUT','busyQueue','exports','lodash','uuid','../../../../../config/logger','routing','notificationId','queue','squeue','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','push','isNil','length','Agents','realtime','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','RINGING','busy','name'];(function(_0x4b5f83,_0x2dd2b9){var _0x1fa204=function(_0x509a63){while(--_0x509a63){_0x4b5f83['push'](_0x4b5f83['shift']());}};_0x1fa204(++_0x2dd2b9);}(_0x2d17,0x17e));var _0x72d1=function(_0x42ebf5,_0x1c236f){_0x42ebf5=_0x42ebf5-0x0;var _0x54cb38=_0x2d17[_0x42ebf5];return _0x54cb38;};'use strict';var _=require(_0x72d1('0x0'));var uuid=require(_0x72d1('0x1'));var util=require('./util');var logger=require(_0x72d1('0x2'))(_0x72d1('0x3'));var Beepall=function(_0x531f4e,_0x3687bc,_0x38fec7,_0x55b722){this[_0x72d1('0x4')]=uuid['v4']();this['squeue']=_0x531f4e;this[_0x72d1('0x5')]=_0x3687bc;this['realtime']=_0x38fec7;this[_0x72d1('0x3')]=_0x55b722;this[_0x72d1('0x6')]['push'](this[_0x72d1('0x7')][_0x72d1('0x8')](this),this[_0x72d1('0x9')]['bind'](this));this[_0x72d1('0x6')]['on'](_0x72d1('0xa'),this[_0x72d1('0x9')]['bind'](this));this[_0x72d1('0x6')]['on'](_0x72d1('0xb'),this[_0x72d1('0xc')][_0x72d1('0x8')](this));};Beepall[_0x72d1('0xd')][_0x72d1('0xe')]=function(){this[_0x72d1('0x6')][_0x72d1('0xe')](this[_0x72d1('0x7')][_0x72d1('0x8')](this),this['handleTimeout'][_0x72d1('0x8')](this));};Beepall[_0x72d1('0xd')][_0x72d1('0xc')]=function(_0x115cd7){this[_0x72d1('0x9')](!![]);};Beepall[_0x72d1('0xd')][_0x72d1('0x7')]=function(_0x383bb){var _0x172fae=!![];if(!_[_0x72d1('0xf')](this[_0x72d1('0x5')])&&!_[_0x72d1('0xf')](this[_0x72d1('0x5')]['Agents'])&&this[_0x72d1('0x5')]['Agents'][_0x72d1('0x10')]>0x0){for(var _0x2c9851=0x0,_0x59d7b5;_0x2c9851<this[_0x72d1('0x5')][_0x72d1('0x11')][_0x72d1('0x10')];_0x2c9851+=0x1){_0x59d7b5=this['queue']['Agents'][_0x2c9851]['id'];if(_[_0x72d1('0xf')](this[_0x72d1('0x12')][_0x72d1('0x13')][_0x59d7b5])){logger[_0x72d1('0x14')](_0x72d1('0x15'),this[_0x72d1('0x6')]['id'],_0x59d7b5);}else{if(util[_0x72d1('0x16')](this['squeue']['id'],this[_0x72d1('0x12')]['agents'][_0x59d7b5],this['squeue']['channel'],!![])){_0x172fae=![];util['writeLog'](this[_0x72d1('0x6')]['id'],this[_0x72d1('0x12')]['agents'][_0x59d7b5],_0x72d1('0x17'));this[_0x72d1('0x12')][_0x72d1('0x13')][_0x59d7b5][_0x72d1('0x18')]=!![];this[_0x72d1('0x12')]['agents'][_0x59d7b5]['busyQueue']=this[_0x72d1('0x5')][_0x72d1('0x19')];util[_0x72d1('0x1a')](this[_0x72d1('0x4')],this[_0x72d1('0x6')]['id'],this[_0x72d1('0x12')][_0x72d1('0x13')][_0x59d7b5],this['queue'],this['routing']);}}}if(_0x172fae){logger[_0x72d1('0x14')]('[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY',this[_0x72d1('0x6')]['id']);setTimeout(this[_0x72d1('0xe')][_0x72d1('0x8')](this),0x3e8);}}else{logger['info'](_0x72d1('0x1b'),this['squeue']['id']);setTimeout(this[_0x72d1('0xe')][_0x72d1('0x8')](this),0x3e8);}};Beepall[_0x72d1('0xd')][_0x72d1('0x9')]=function(_0x51242b){if(!_[_0x72d1('0xf')](this['queue'])&&!_[_0x72d1('0xf')](this[_0x72d1('0x5')]['Agents'])){for(var _0x14d653=0x0,_0x358b0c;_0x14d653<this[_0x72d1('0x5')][_0x72d1('0x11')][_0x72d1('0x10')];_0x14d653+=0x1){_0x358b0c=this['queue'][_0x72d1('0x11')][_0x14d653]['id'];if(_[_0x72d1('0xf')](this[_0x72d1('0x12')]['agents'][_0x358b0c])){logger[_0x72d1('0x14')](_0x72d1('0x15'),this['squeue']['id'],_0x358b0c);}else{util[_0x72d1('0x1c')](this[_0x72d1('0x4')],this[_0x72d1('0x6')]['id'],this['realtime'][_0x72d1('0x13')][_0x358b0c],this['queue'],this[_0x72d1('0x3')]);util[_0x72d1('0x1d')](this[_0x72d1('0x6')]['id'],this[_0x72d1('0x12')][_0x72d1('0x13')][_0x358b0c],_0x51242b?_0x72d1('0x1e'):_0x72d1('0x1f'));this[_0x72d1('0x12')][_0x72d1('0x13')][_0x358b0c][_0x72d1('0x18')]=![];this[_0x72d1('0x12')]['agents'][_0x358b0c][_0x72d1('0x20')]=undefined;}}}if(!_0x51242b){setTimeout(this[_0x72d1('0xe')][_0x72d1('0x8')](this),0x3e8);}};function beepall(_0x325209,_0x49e074,_0x3eb3da,_0x3ae025){return new Beepall(_0x325209,_0x49e074,_0x3eb3da,_0x3ae025);}module[_0x72d1('0x21')]=beepall;
\ No newline at end of file
index 372ad54..d0993c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x684a=['./rrmemory','./beepall','./agent'];(function(_0x584c22,_0x64b414){var _0x4c104a=function(_0xa5146){while(--_0xa5146){_0x584c22['push'](_0x584c22['shift']());}};_0x4c104a(++_0x64b414);}(_0x684a,0x16b));var _0xa684=function(_0x39c769,_0xf580d1){_0x39c769=_0x39c769-0x0;var _0x43e042=_0x684a[_0x39c769];return _0x43e042;};'use strict';module['exports']={'rrmemory':require(_0xa684('0x0')),'beepall':require(_0xa684('0x1')),'agent':require(_0xa684('0x2'))};
\ No newline at end of file
+var _0x9341=['exports','./rrmemory','./beepall'];(function(_0x518dfb,_0x4fd248){var _0x59e613=function(_0x38e248){while(--_0x38e248){_0x518dfb['push'](_0x518dfb['shift']());}};_0x59e613(++_0x4fd248);}(_0x9341,0x1d4));var _0x1934=function(_0x57ca21,_0x112cdc){_0x57ca21=_0x57ca21-0x0;var _0x3ada21=_0x9341[_0x57ca21];return _0x3ada21;};'use strict';module[_0x1934('0x0')]={'rrmemory':require(_0x1934('0x1')),'beepall':require(_0x1934('0x2')),'agent':require('./agent')};
\ No newline at end of file
index 000bf12..a345abe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1374=['timeout','handleTimeout','drained','handleDrained','prototype','push','agents','agentId','channel','info','[%s][QUEUE]\x20available\x20again\x20%s','intervals','done','mapAgentsId','[%s][QUEUE]\x20try\x20with\x20%s','isNil','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','busyQueue','name','showNotification','writeLog','RINGING','handleCheckReject','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','[%s][QUEUE]\x20timeout\x20with\x20%s','hideNotification','TIMEOUT','busy','lodash','uuid','./util','../../../../../config/logger','notificationId','squeue','queue','realtime','routing','handleRun','bind'];(function(_0x1c07ee,_0x4a3b77){var _0x35713d=function(_0x27c9c1){while(--_0x27c9c1){_0x1c07ee['push'](_0x1c07ee['shift']());}};_0x35713d(++_0x4a3b77);}(_0x1374,0x1d5));var _0x4137=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x1374[_0x4c12ec];return _0x3ae42c;};'use strict';var rr=require('rr');var _=require(_0x4137('0x0'));var uuid=require(_0x4137('0x1'));var util=require(_0x4137('0x2'));var logger=require(_0x4137('0x3'))('routing');var RRMemory=function(_0x3aa76e,_0x394e3a,_0x36ea0d,_0x124380){this[_0x4137('0x4')]=uuid['v4']();this[_0x4137('0x5')]=_0x3aa76e;this[_0x4137('0x6')]=_0x394e3a;this[_0x4137('0x7')]=_0x36ea0d;this[_0x4137('0x8')]=_0x124380;this['intervals']={};this['squeue']['push'](this[_0x4137('0x9')]['bind'](this),this['handleTimeout'][_0x4137('0xa')](this),this['module']);this[_0x4137('0x5')]['on'](_0x4137('0xb'),this[_0x4137('0xc')][_0x4137('0xa')](this));this[_0x4137('0x5')]['on'](_0x4137('0xd'),this[_0x4137('0xe')][_0x4137('0xa')](this));};RRMemory[_0x4137('0xf')][_0x4137('0x10')]=function(){this[_0x4137('0x5')][_0x4137('0x10')](this[_0x4137('0x9')][_0x4137('0xa')](this),this[_0x4137('0xc')][_0x4137('0xa')](this));};RRMemory[_0x4137('0xf')]['handleDrained']=function(_0x3246a6){this[_0x4137('0xc')](!![]);};RRMemory[_0x4137('0xf')]['handleCheckReject']=function(_0x2321b7){if(util['isAgentAvailable'](this[_0x4137('0x5')]['id'],this[_0x4137('0x7')][_0x4137('0x11')][this[_0x4137('0x12')]],this[_0x4137('0x5')][_0x4137('0x13')],!![])){logger[_0x4137('0x14')](_0x4137('0x15'),this['squeue']['id'],this[_0x4137('0x12')]);clearInterval(this[_0x4137('0x16')][this[_0x4137('0x12')]]);_0x2321b7[_0x4137('0x17')]();setTimeout(this[_0x4137('0x10')][_0x4137('0xa')](this),0x3e8);}};RRMemory[_0x4137('0xf')][_0x4137('0x9')]=function(_0x18c662){this[_0x4137('0x12')]=rr(this[_0x4137('0x6')][_0x4137('0x18')]);logger['info'](_0x4137('0x19'),this[_0x4137('0x5')]['id'],this[_0x4137('0x12')]);if(_[_0x4137('0x1a')](this[_0x4137('0x7')][_0x4137('0x11')][this[_0x4137('0x12')]])){logger[_0x4137('0x14')](_0x4137('0x1b'),this['squeue']['id'],this['agentId']);_0x18c662['done']();setTimeout(this[_0x4137('0x10')][_0x4137('0xa')](this),0x3e8);}else{if(util[_0x4137('0x1c')](this[_0x4137('0x5')]['id'],this[_0x4137('0x7')][_0x4137('0x11')][this[_0x4137('0x12')]],this[_0x4137('0x5')][_0x4137('0x13')],!![])){this[_0x4137('0x7')]['agents'][this[_0x4137('0x12')]]['busy']=!![];this['realtime']['agents'][this[_0x4137('0x12')]][_0x4137('0x1d')]=this[_0x4137('0x6')][_0x4137('0x1e')];util[_0x4137('0x1f')](this[_0x4137('0x4')],this[_0x4137('0x5')]['id'],this['realtime']['agents'][this[_0x4137('0x12')]],this['queue'],this[_0x4137('0x8')]);util[_0x4137('0x20')](this[_0x4137('0x5')]['id'],this[_0x4137('0x7')][_0x4137('0x11')][this[_0x4137('0x12')]],_0x4137('0x21'));this[_0x4137('0x16')][this[_0x4137('0x12')]]=setInterval(this[_0x4137('0x22')][_0x4137('0xa')](this,_0x18c662),0x3e8);}else{logger['info'](_0x4137('0x23'),this[_0x4137('0x5')]['id'],this['agentId']);_0x18c662[_0x4137('0x17')]();setTimeout(this[_0x4137('0x10')]['bind'](this),0x3e8);}}};RRMemory[_0x4137('0xf')][_0x4137('0xc')]=function(_0x1dcfb8){logger[_0x4137('0x14')](_0x4137('0x24'),this[_0x4137('0x5')]['id'],this[_0x4137('0x12')]);if(_[_0x4137('0x1a')](this[_0x4137('0x7')][_0x4137('0x11')][this[_0x4137('0x12')]])){logger['info'](_0x4137('0x1b'),this['squeue']['id'],this[_0x4137('0x12')]);}else{clearInterval(this[_0x4137('0x16')][this[_0x4137('0x12')]]);util[_0x4137('0x25')](this[_0x4137('0x4')],this[_0x4137('0x5')]['id'],this[_0x4137('0x7')]['agents'][this[_0x4137('0x12')]],this['queue'],this['routing']);util[_0x4137('0x20')](this[_0x4137('0x5')]['id'],this[_0x4137('0x7')][_0x4137('0x11')][this[_0x4137('0x12')]],_0x4137('0x26'));this[_0x4137('0x7')]['agents'][this['agentId']][_0x4137('0x27')]=![];this[_0x4137('0x7')][_0x4137('0x11')][this['agentId']][_0x4137('0x1d')]=undefined;}if(!_0x1dcfb8){setTimeout(this['push'][_0x4137('0xa')](this),0x3e8);}};function rrmemory(_0xf98262,_0x192e20,_0x510829,_0x12bc53){return new RRMemory(_0xf98262,_0x192e20,_0x510829,_0x12bc53);}module['exports']=rrmemory;
\ No newline at end of file
+var _0x4b6e=['agents','channel','agentId','intervals','mapAgentsId','info','[%s][QUEUE]\x20try\x20with\x20%s','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','done','busy','name','showNotification','writeLog','RINGING','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','[%s][QUEUE]\x20timeout\x20with\x20%s','isNil','hideNotification','TIMEOUT','busyQueue','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','queue','handleRun','bind','handleTimeout','module','timeout','drained','handleDrained','prototype','push','handleCheckReject','isAgentAvailable','realtime'];(function(_0x32107e,_0x33ff3){var _0x2eede5=function(_0x428411){while(--_0x428411){_0x32107e['push'](_0x32107e['shift']());}};_0x2eede5(++_0x33ff3);}(_0x4b6e,0xe2));var _0xe4b6=function(_0x526e5f,_0x57bd2f){_0x526e5f=_0x526e5f-0x0;var _0x4a83c6=_0x4b6e[_0x526e5f];return _0x4a83c6;};'use strict';var rr=require('rr');var _=require(_0xe4b6('0x0'));var uuid=require(_0xe4b6('0x1'));var util=require(_0xe4b6('0x2'));var logger=require(_0xe4b6('0x3'))(_0xe4b6('0x4'));var RRMemory=function(_0xf937e2,_0x4b46d2,_0x10d00c,_0x1ba7e5){this[_0xe4b6('0x5')]=uuid['v4']();this[_0xe4b6('0x6')]=_0xf937e2;this[_0xe4b6('0x7')]=_0x4b46d2;this['realtime']=_0x10d00c;this[_0xe4b6('0x4')]=_0x1ba7e5;this['intervals']={};this[_0xe4b6('0x6')]['push'](this[_0xe4b6('0x8')][_0xe4b6('0x9')](this),this[_0xe4b6('0xa')]['bind'](this),this[_0xe4b6('0xb')]);this[_0xe4b6('0x6')]['on'](_0xe4b6('0xc'),this[_0xe4b6('0xa')][_0xe4b6('0x9')](this));this[_0xe4b6('0x6')]['on'](_0xe4b6('0xd'),this[_0xe4b6('0xe')][_0xe4b6('0x9')](this));};RRMemory[_0xe4b6('0xf')]['push']=function(){this[_0xe4b6('0x6')][_0xe4b6('0x10')](this[_0xe4b6('0x8')][_0xe4b6('0x9')](this),this[_0xe4b6('0xa')][_0xe4b6('0x9')](this));};RRMemory[_0xe4b6('0xf')]['handleDrained']=function(_0x2407d0){this['handleTimeout'](!![]);};RRMemory[_0xe4b6('0xf')][_0xe4b6('0x11')]=function(_0x32858e){if(util[_0xe4b6('0x12')](this[_0xe4b6('0x6')]['id'],this[_0xe4b6('0x13')][_0xe4b6('0x14')][this['agentId']],this[_0xe4b6('0x6')][_0xe4b6('0x15')],!![])){logger['info']('[%s][QUEUE]\x20available\x20again\x20%s',this[_0xe4b6('0x6')]['id'],this[_0xe4b6('0x16')]);clearInterval(this[_0xe4b6('0x17')][this['agentId']]);_0x32858e['done']();setTimeout(this[_0xe4b6('0x10')]['bind'](this),0x3e8);}};RRMemory[_0xe4b6('0xf')]['handleRun']=function(_0xac5577){this['agentId']=rr(this[_0xe4b6('0x7')][_0xe4b6('0x18')]);logger[_0xe4b6('0x19')](_0xe4b6('0x1a'),this[_0xe4b6('0x6')]['id'],this[_0xe4b6('0x16')]);if(_['isNil'](this['realtime'][_0xe4b6('0x14')][this[_0xe4b6('0x16')]])){logger['info'](_0xe4b6('0x1b'),this[_0xe4b6('0x6')]['id'],this[_0xe4b6('0x16')]);_0xac5577[_0xe4b6('0x1c')]();setTimeout(this[_0xe4b6('0x10')][_0xe4b6('0x9')](this),0x3e8);}else{if(util[_0xe4b6('0x12')](this['squeue']['id'],this[_0xe4b6('0x13')][_0xe4b6('0x14')][this[_0xe4b6('0x16')]],this['squeue'][_0xe4b6('0x15')],!![])){this[_0xe4b6('0x13')][_0xe4b6('0x14')][this['agentId']][_0xe4b6('0x1d')]=!![];this[_0xe4b6('0x13')]['agents'][this[_0xe4b6('0x16')]]['busyQueue']=this[_0xe4b6('0x7')][_0xe4b6('0x1e')];util[_0xe4b6('0x1f')](this[_0xe4b6('0x5')],this[_0xe4b6('0x6')]['id'],this[_0xe4b6('0x13')]['agents'][this['agentId']],this[_0xe4b6('0x7')],this['routing']);util[_0xe4b6('0x20')](this[_0xe4b6('0x6')]['id'],this[_0xe4b6('0x13')][_0xe4b6('0x14')][this[_0xe4b6('0x16')]],_0xe4b6('0x21'));this[_0xe4b6('0x17')][this[_0xe4b6('0x16')]]=setInterval(this[_0xe4b6('0x11')]['bind'](this,_0xac5577),0x3e8);}else{logger[_0xe4b6('0x19')](_0xe4b6('0x22'),this['squeue']['id'],this[_0xe4b6('0x16')]);_0xac5577[_0xe4b6('0x1c')]();setTimeout(this[_0xe4b6('0x10')]['bind'](this),0x3e8);}}};RRMemory[_0xe4b6('0xf')][_0xe4b6('0xa')]=function(_0x2527b6){logger[_0xe4b6('0x19')](_0xe4b6('0x23'),this[_0xe4b6('0x6')]['id'],this[_0xe4b6('0x16')]);if(_[_0xe4b6('0x24')](this['realtime'][_0xe4b6('0x14')][this[_0xe4b6('0x16')]])){logger[_0xe4b6('0x19')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0xe4b6('0x16')]);}else{clearInterval(this[_0xe4b6('0x17')][this[_0xe4b6('0x16')]]);util[_0xe4b6('0x25')](this[_0xe4b6('0x5')],this[_0xe4b6('0x6')]['id'],this[_0xe4b6('0x13')][_0xe4b6('0x14')][this[_0xe4b6('0x16')]],this['queue'],this[_0xe4b6('0x4')]);util[_0xe4b6('0x20')](this[_0xe4b6('0x6')]['id'],this[_0xe4b6('0x13')][_0xe4b6('0x14')][this[_0xe4b6('0x16')]],_0xe4b6('0x26'));this[_0xe4b6('0x13')][_0xe4b6('0x14')][this[_0xe4b6('0x16')]][_0xe4b6('0x1d')]=![];this[_0xe4b6('0x13')]['agents'][this[_0xe4b6('0x16')]][_0xe4b6('0x27')]=undefined;}if(!_0x2527b6){setTimeout(this[_0xe4b6('0x10')][_0xe4b6('0x9')](this),0x3e8);}};function rrmemory(_0x7698e0,_0x1527c1,_0x4bd467,_0x28f4d9){return new RRMemory(_0x7698e0,_0x1527c1,_0x4bd467,_0x28f4d9);}module[_0xe4b6('0x28')]=rrmemory;
\ No newline at end of file
index 18932bf..79de7b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacf4=['body','queue','msg','getMustacheRender','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','user:%s','notification:%s','save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','BUSY','online','Pause','PAUSE','Capacity','hasOwnProperty','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','localhost','emit','format','name','\x20interaction','account','notificationSound','notificationShake'];(function(_0xbf337c,_0x41b7de){var _0x2dc44a=function(_0x339df2){while(--_0x339df2){_0xbf337c['push'](_0xbf337c['shift']());}};_0x2dc44a(++_0x41b7de);}(_0xacf4,0xe7));var _0x4acf=function(_0x24374c,_0x3db2a5){_0x24374c=_0x24374c-0x0;var _0x294ed5=_0xacf4[_0x24374c];return _0x294ed5;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x4acf('0x0'));var Mustache=require(_0x4acf('0x1'));var Redis=require(_0x4acf('0x2'));var config=require(_0x4acf('0x3'));var logger=require(_0x4acf('0x4'))(_0x4acf('0x5'));config[_0x4acf('0x6')]=_['defaults'](config[_0x4acf('0x6')],{'host':_0x4acf('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4acf('0x6')]));function emit(_0x2ba08a,_0x649ad2,_0x45a5a4){io['to'](_0x2ba08a)[_0x4acf('0x8')](_0x649ad2,_0x45a5a4);}function sendNotification(_0x50f5f4,_0x55f61d,_0x41970b,_0x59f559,_0x425c8d,_0x2c2cb4){io['to'](util[_0x4acf('0x9')]('user:%s',_0x59f559[_0x4acf('0xa')]))[_0x4acf('0x8')]('user:save',_0x59f559);var _0x5f22d9=_0x2c2cb4||{};var _0x1fe474=_0x41970b['split']('.');var _0x5bca4e={'uniqueid':_0x55f61d,'channel':_0x1fe474[0x0],'id':_0x1fe474[0x1],'title':_0x1fe474[0x0]+_0x4acf('0xb'),'interactionId':_0x1fe474[0x2],'queue':_0x425c8d?_0x425c8d[_0x4acf('0xa')]:null,'sound':_0x5f22d9[_0x4acf('0xc')][_0x4acf('0xd')],'shake':_0x5f22d9[_0x4acf('0xc')][_0x4acf('0xe')]};try{if(!_0x5f22d9[_0x4acf('0xf')]){_0x5f22d9[_0x4acf('0xf')]={};}if(_0x425c8d){_0x5f22d9[_0x4acf('0xf')][_0x4acf('0x10')]=_0x425c8d;}else if(_0x5f22d9[_0x4acf('0xf')]['queue']){delete _0x5f22d9[_0x4acf('0xf')]['queue'];}_0x5bca4e[_0x4acf('0x11')]=utils[_0x4acf('0x12')](_0x5f22d9[_0x4acf('0xc')]['notificationTemplate'],_0x5f22d9);}catch(_0x5207e7){_0x5bca4e[_0x4acf('0x11')]=_0x4acf('0x13');logger[_0x4acf('0x14')](util['format'](_0x4acf('0x15'),_0x55f61d,_0x5207e7[_0x4acf('0x16')]));}io['to'](util[_0x4acf('0x9')](_0x4acf('0x17'),_0x59f559[_0x4acf('0xa')]))[_0x4acf('0x8')](util[_0x4acf('0x9')](_0x4acf('0x18'),_0x50f5f4?_0x4acf('0x19'):_0x4acf('0x1a')),_0x5bca4e);}function writeLog(_0x1a3118,_0x5f0284,_0x28d698){return logger[_0x4acf('0x1b')](util['format'](_0x4acf('0x1c'),_0x1a3118,_0x5f0284[_0x4acf('0xa')],_0x28d698));}exports['isAgentAvailable']=function(_0x3b26ac,_0x34d154,_0x433b7a,_0x454555){if(_0x34d154['busy']){writeLog(_0x3b26ac,_0x34d154,_0x4acf('0x1d'));return![];}if(!_0x34d154[_0x4acf('0x1e')]){writeLog(_0x3b26ac,_0x34d154,'OFFLINE');return![];}if(_0x34d154[_0x433b7a+_0x4acf('0x1f')]){writeLog(_0x3b26ac,_0x34d154,_0x4acf('0x20'));return![];}if(_0x454555&&_0x34d154['hasOwnProperty'](_0x433b7a+_0x4acf('0x21'))&&_0x34d154[_0x4acf('0x22')](_0x433b7a+_0x4acf('0x23'))){if(_0x34d154[_0x433b7a+_0x4acf('0x21')]>0x0&&_0x34d154[_0x433b7a+'CurrentCapacity']>=_0x34d154[_0x433b7a+'Capacity']){writeLog(_0x3b26ac,_0x34d154,_0x433b7a[_0x4acf('0x24')]()+_0x4acf('0x25'));return![];}}return!![];};exports[_0x4acf('0x26')]=function(_0x42c90c,_0x14086c,_0x1b4da6,_0xb83274,_0x7a1e79){return sendNotification(!![],_0x42c90c,_0x14086c,_0x1b4da6,_0xb83274,_0x7a1e79);};exports[_0x4acf('0x27')]=function(_0x2a3830,_0x57989e,_0x3521c2,_0x3f5614,_0xd027c7){return sendNotification(![],_0x2a3830,_0x57989e,_0x3521c2,_0x3f5614,_0xd027c7);};exports[_0x4acf('0x28')]=writeLog;
\ No newline at end of file
+var _0x68b3=['hideNotification','writeLog','lodash','util','../utils','mustache','ioredis','../../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','emit','format','user:%s','user:save','split','name','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','I\x20can\x27t\x20render\x20your\x20template','[%s][QUEUE]\x20%s','message','notification:%s','save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification'];(function(_0xe861b,_0x507de2){var _0x4a72d3=function(_0x56aebc){while(--_0x56aebc){_0xe861b['push'](_0xe861b['shift']());}};_0x4a72d3(++_0x507de2);}(_0x68b3,0x1d8));var _0x368b=function(_0x405d74,_0x2f645a){_0x405d74=_0x405d74-0x0;var _0x2409a5=_0x68b3[_0x405d74];return _0x2409a5;};'use strict';var _=require(_0x368b('0x0'));var util=require(_0x368b('0x1'));var utils=require(_0x368b('0x2'));var Mustache=require(_0x368b('0x3'));var Redis=require(_0x368b('0x4'));var config=require('../../../../../config/environment');var logger=require(_0x368b('0x5'))(_0x368b('0x6'));config[_0x368b('0x7')]=_[_0x368b('0x8')](config['redis'],{'host':_0x368b('0x9'),'port':0x18eb});var io=require(_0x368b('0xa'))(new Redis(config[_0x368b('0x7')]));function emit(_0x23584a,_0x4406c8,_0x127c1e){io['to'](_0x23584a)[_0x368b('0xb')](_0x4406c8,_0x127c1e);}function sendNotification(_0x142d05,_0x23622f,_0x1f64d8,_0x2a7b9f,_0x5a46f9,_0x160e12){io['to'](util[_0x368b('0xc')](_0x368b('0xd'),_0x2a7b9f['name']))[_0x368b('0xb')](_0x368b('0xe'),_0x2a7b9f);var _0x253e4b=_0x160e12||{};var _0x5924a6=_0x1f64d8[_0x368b('0xf')]('.');var _0x847dcb={'uniqueid':_0x23622f,'channel':_0x5924a6[0x0],'id':_0x5924a6[0x1],'title':_0x5924a6[0x0]+'\x20interaction','interactionId':_0x5924a6[0x2],'queue':_0x5a46f9?_0x5a46f9[_0x368b('0x10')]:null,'sound':_0x253e4b[_0x368b('0x11')][_0x368b('0x12')],'shake':_0x253e4b[_0x368b('0x11')][_0x368b('0x13')]};try{if(!_0x253e4b['body']){_0x253e4b[_0x368b('0x14')]={};}if(_0x5a46f9){_0x253e4b[_0x368b('0x14')]['queue']=_0x5a46f9;}else if(_0x253e4b[_0x368b('0x14')][_0x368b('0x15')]){delete _0x253e4b[_0x368b('0x14')]['queue'];}_0x847dcb[_0x368b('0x16')]=utils[_0x368b('0x17')](_0x253e4b[_0x368b('0x11')]['notificationTemplate'],_0x253e4b);}catch(_0x102407){_0x847dcb[_0x368b('0x16')]=_0x368b('0x18');logger['error'](util['format'](_0x368b('0x19'),_0x23622f,_0x102407[_0x368b('0x1a')]));}io['to'](util[_0x368b('0xc')](_0x368b('0xd'),_0x2a7b9f[_0x368b('0x10')]))['emit'](util[_0x368b('0xc')](_0x368b('0x1b'),_0x142d05?_0x368b('0x1c'):_0x368b('0x1d')),_0x847dcb);}function writeLog(_0x23da8f,_0x26b206,_0x397185){return logger[_0x368b('0x1e')](util['format'](_0x368b('0x1f'),_0x23da8f,_0x26b206[_0x368b('0x10')],_0x397185));}exports[_0x368b('0x20')]=function(_0xc0f7af,_0x286853,_0x4c2fca,_0x286641){if(_0x286853[_0x368b('0x21')]){writeLog(_0xc0f7af,_0x286853,_0x368b('0x22'));return![];}if(!_0x286853[_0x368b('0x23')]){writeLog(_0xc0f7af,_0x286853,_0x368b('0x24'));return![];}if(_0x286853[_0x4c2fca+_0x368b('0x25')]){writeLog(_0xc0f7af,_0x286853,_0x368b('0x26'));return![];}if(_0x286641&&_0x286853[_0x368b('0x27')](_0x4c2fca+_0x368b('0x28'))&&_0x286853[_0x368b('0x27')](_0x4c2fca+_0x368b('0x29'))){if(_0x286853[_0x4c2fca+_0x368b('0x28')]>0x0&&_0x286853[_0x4c2fca+_0x368b('0x29')]>=_0x286853[_0x4c2fca+_0x368b('0x28')]){writeLog(_0xc0f7af,_0x286853,_0x4c2fca[_0x368b('0x2a')]()+_0x368b('0x2b'));return![];}}return!![];};exports[_0x368b('0x2c')]=function(_0x9f192e,_0x39ef94,_0x1e0e46,_0x2b036e,_0xc12627){return sendNotification(!![],_0x9f192e,_0x39ef94,_0x1e0e46,_0x2b036e,_0xc12627);};exports[_0x368b('0x2d')]=function(_0x3c80b5,_0x5db0b4,_0x4af77a,_0x381324,_0x2f1d52){return sendNotification(![],_0x3c80b5,_0x5db0b4,_0x4af77a,_0x381324,_0x2f1d52);};exports[_0x368b('0x2e')]=writeLog;
\ No newline at end of file
index 5809b55..6594496 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc69c=['validate','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','isNil','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','stringify'];(function(_0x1057cb,_0x7b8162){var _0x7fbf7e=function(_0x5fa6a3){while(--_0x5fa6a3){_0x1057cb['push'](_0x1057cb['shift']());}};_0x7fbf7e(++_0x7b8162);}(_0xc69c,0x1ee));var _0xcc69=function(_0x44d809,_0x1f76fb){_0x44d809=_0x44d809-0x0;var _0x5361b9=_0xc69c[_0x44d809];return _0x5361b9;};'use strict';var schema=require(_0xcc69('0x0'));var sh=require('shelljs');var _=require(_0xcc69('0x1'));var utils=require(_0xcc69('0x2'));var logger=require(_0xcc69('0x3'))(_0xcc69('0x4'));var system=schema({'command':{'type':_0xcc69('0x5'),'required':!![],'message':_0xcc69('0x6')}});exports[_0xcc69('0x7')]=function(_0xda03e9,_0x546674){return function(_0x2deaf){try{var _0x3182cc={'command':_0x546674[0x0]};var _0x56fde8=system[_0xcc69('0x0')](_0x3182cc,{'typecast':!![]});if(_0x56fde8[_0xcc69('0x8')]){logger[_0xcc69('0x9')](_0xcc69('0xa'),_0xda03e9,_[_0xcc69('0xb')](_0x56fde8,_0xcc69('0xc'))[_0xcc69('0xd')](',\x20'));logger[_0xcc69('0xe')](_0xcc69('0xf'),_0xda03e9);_0x2deaf[_0xcc69('0x10')]();}else{var _0x486112=this;var _0x330f8c=utils[_0xcc69('0x11')](_0x546674[0x0],this);logger[_0xcc69('0xe')](_0xcc69('0x12'),_0xda03e9,_0x330f8c);sh[_0xcc69('0x13')](_[_0xcc69('0x14')](_0x330f8c),function(_0x3abfc4,_0x1ab146){logger['info']('[%s][SYSTEM]\x20result\x20code:\x20%s',_0xda03e9,_0x3abfc4);if(_0x3abfc4==0x0){var _0x46287b=_0x1ab146['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0xcc69('0x15')](_0x546674[0x1])||_[_0xcc69('0x16')](_0x546674[0x1])){logger[_0xcc69('0xe')]('[%s][SYSTEM]\x20no\x20variable',_0xda03e9);_0x486112[_0xcc69('0x17')][_0x546674[0x1]]=_0x46287b;}else{logger[_0xcc69('0xe')](_0xcc69('0x18'),_0xda03e9,_0x546674[0x1],_0x46287b);_0x486112[_0xcc69('0x17')][_0x546674[0x1]]=_0x46287b;}}_0x2deaf['next']();});}}catch(_0x2163fa){logger[_0xcc69('0x9')](_0xcc69('0xa'),_0xda03e9,_['isObject'](_0x2163fa)?JSON[_0xcc69('0x19')](_0x2163fa):_0x2163fa);logger[_0xcc69('0xe')](_0xcc69('0xf'),_0xda03e9);_0x2deaf[_0xcc69('0x10')]();}};};
\ No newline at end of file
+var _0x03cf=['[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','isObject','shelljs','lodash','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','validate','length','error','[%s][SYSTEM]\x20%s','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil'];(function(_0x867b0a,_0x587ccf){var _0x137438=function(_0xbeafa6){while(--_0xbeafa6){_0x867b0a['push'](_0x867b0a['shift']());}};_0x137438(++_0x587ccf);}(_0x03cf,0x64));var _0xf03c=function(_0x40814b,_0x1fe819){_0x40814b=_0x40814b-0x0;var _0x5c9dbb=_0x03cf[_0x40814b];return _0x5c9dbb;};'use strict';var schema=require('validate');var sh=require(_0xf03c('0x0'));var _=require(_0xf03c('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0xf03c('0x2'));var system=schema({'command':{'type':'string','required':!![],'message':_0xf03c('0x3')}});exports['consequence']=function(_0x18341c,_0x1129c9){return function(_0x404b44){try{var _0x4c2af5={'command':_0x1129c9[0x0]};var _0x11841d=system[_0xf03c('0x4')](_0x4c2af5,{'typecast':!![]});if(_0x11841d[_0xf03c('0x5')]){logger[_0xf03c('0x6')](_0xf03c('0x7'),_0x18341c,_[_0xf03c('0x8')](_0x11841d,'message')[_0xf03c('0x9')](',\x20'));logger[_0xf03c('0xa')](_0xf03c('0xb'),_0x18341c);_0x404b44[_0xf03c('0xc')]();}else{var _0x15d5c6=this;var _0x36c6c3=utils[_0xf03c('0xd')](_0x1129c9[0x0],this);logger[_0xf03c('0xa')](_0xf03c('0xe'),_0x18341c,_0x36c6c3);sh[_0xf03c('0xf')](_[_0xf03c('0x10')](_0x36c6c3),function(_0x3eab9c,_0x41081d){logger['info'](_0xf03c('0x11'),_0x18341c,_0x3eab9c);if(_0x3eab9c==0x0){var _0x41c4bf=_0x41081d[_0xf03c('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0xf03c('0x13')](_0x1129c9[0x1])||_['isEmpty'](_0x1129c9[0x1])){logger[_0xf03c('0xa')](_0xf03c('0x14'),_0x18341c);_0x15d5c6['body'][_0x1129c9[0x1]]=_0x41c4bf;}else{logger[_0xf03c('0xa')](_0xf03c('0x15'),_0x18341c,_0x1129c9[0x1],_0x41c4bf);_0x15d5c6[_0xf03c('0x16')][_0x1129c9[0x1]]=_0x41c4bf;}}_0x404b44['next']();});}}catch(_0x416f48){logger['error'](_0xf03c('0x7'),_0x18341c,_[_0xf03c('0x17')](_0x416f48)?JSON['stringify'](_0x416f48):_0x416f48);logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x18341c);_0x404b44[_0xf03c('0xc')]();}};};
\ No newline at end of file
index d25443c..b7a11a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d59=['isObject','validate','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','interaction','then','catch','stringify'];(function(_0x4cd297,_0x3ea87d){var _0x3f71e1=function(_0x5b483c){while(--_0x5b483c){_0x4cd297['push'](_0x4cd297['shift']());}};_0x3f71e1(++_0x3ea87d);}(_0x6d59,0x91));var _0x96d5=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x6d59[_0xfae23b];return _0x200640;};'use strict';var schema=require(_0x96d5('0x0'));var _=require(_0x96d5('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x96d5('0x2')),'smsInteraction':require(_0x96d5('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x96d5('0x4')),'whatsappInteraction':require(_0x96d5('0x5'))};var logger=require('../../../../config/logger')(_0x96d5('0x6'));var tag=schema({'tag':{'type':_0x96d5('0x7'),'required':!![],'message':_0x96d5('0x8')}});exports['consequence']=function(_0x253310,_0x5edcc5,_0x12de30,_0x5951f5){return function(_0x53bd5b){try{var _0xdda5d4={'tag':_0x5edcc5[0x0]};var _0x593de3=tag[_0x96d5('0x0')](_0xdda5d4,{'typecast':!![]});if(_0x593de3['length']){logger[_0x96d5('0x9')](_0x96d5('0xa'),_0x253310,_[_0x96d5('0xb')](_0x593de3,_0x96d5('0xc'))[_0x96d5('0xd')](',\x20'));logger[_0x96d5('0xe')](_0x96d5('0xf'),_0x253310);_0x53bd5b[_0x96d5('0x10')]();}else{var _0xaa22b6={'ids':[_0x5edcc5[0x0]]};if(rpc[_0x5951f5[_0x96d5('0x11')]+_0x96d5('0x12')]){rpc[_0x5951f5['channel']+'Interaction']['addTags'](_0x5951f5[_0x96d5('0x13')]['id'],_0xaa22b6)[_0x96d5('0x14')](function(_0x505fe6){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x253310,_0x5edcc5[0x1],_0x5951f5[_0x96d5('0x11')],_0x5951f5[_0x96d5('0x13')]['id']);})[_0x96d5('0x15')](function(_0x1a661b){logger[_0x96d5('0x9')](_0x96d5('0xa'),_0x253310,JSON[_0x96d5('0x16')](_0x1a661b));logger[_0x96d5('0xe')](_0x96d5('0xf'),_0x253310);})['finally'](function(){_0x53bd5b[_0x96d5('0x10')]();});}}}catch(_0x16fca0){logger[_0x96d5('0x9')]('[%s][TAG]\x20%s',_0x253310,_[_0x96d5('0x17')](_0x16fca0)?JSON[_0x96d5('0x16')](_0x16fca0):_0x16fca0);logger['info'](_0x96d5('0xf'),_0x253310);_0x53bd5b[_0x96d5('0x10')]();}};};
\ No newline at end of file
+var _0xcbfc=['../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','number','consequence','length','error','message','info','next','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','channel','catch','[%s][TAG]\x20%s','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','isObject','validate','lodash'];(function(_0x87239,_0x38c793){var _0x53af1e=function(_0x11eb5f){while(--_0x11eb5f){_0x87239['push'](_0x87239['shift']());}};_0x53af1e(++_0x38c793);}(_0xcbfc,0xa0));var _0xccbf=function(_0x3a8e7d,_0x1bfcd8){_0x3a8e7d=_0x3a8e7d-0x0;var _0x5d12db=_0xcbfc[_0x3a8e7d];return _0x5d12db;};'use strict';var schema=require(_0xccbf('0x0'));var _=require(_0xccbf('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xccbf('0x2')),'smsInteraction':require(_0xccbf('0x3')),'mailInteraction':require(_0xccbf('0x4')),'faxInteraction':require(_0xccbf('0x5')),'whatsappInteraction':require(_0xccbf('0x6'))};var logger=require('../../../../config/logger')(_0xccbf('0x7'));var tag=schema({'tag':{'type':_0xccbf('0x8'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xccbf('0x9')]=function(_0xbbdfc7,_0x5aae46,_0x45ec70,_0x14725c){return function(_0xbdecfc){try{var _0x5abaf7={'tag':_0x5aae46[0x0]};var _0x194be5=tag['validate'](_0x5abaf7,{'typecast':!![]});if(_0x194be5[_0xccbf('0xa')]){logger[_0xccbf('0xb')]('[%s][TAG]\x20%s',_0xbbdfc7,_['map'](_0x194be5,_0xccbf('0xc'))['join'](',\x20'));logger[_0xccbf('0xd')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0xbbdfc7);_0xbdecfc[_0xccbf('0xe')]();}else{var _0x179a8d={'ids':[_0x5aae46[0x0]]};if(rpc[_0x14725c['channel']+_0xccbf('0xf')]){rpc[_0x14725c['channel']+_0xccbf('0xf')][_0xccbf('0x10')](_0x14725c[_0xccbf('0x11')]['id'],_0x179a8d)[_0xccbf('0x12')](function(_0x437f73){logger['info'](_0xccbf('0x13'),_0xbbdfc7,_0x5aae46[0x1],_0x14725c[_0xccbf('0x14')],_0x14725c[_0xccbf('0x11')]['id']);})[_0xccbf('0x15')](function(_0xb9bd73){logger[_0xccbf('0xb')](_0xccbf('0x16'),_0xbbdfc7,JSON[_0xccbf('0x17')](_0xb9bd73));logger[_0xccbf('0xd')](_0xccbf('0x18'),_0xbbdfc7);})[_0xccbf('0x19')](function(){_0xbdecfc[_0xccbf('0xe')]();});}}}catch(_0x29e947){logger[_0xccbf('0xb')]('[%s][TAG]\x20%s',_0xbbdfc7,_[_0xccbf('0x1a')](_0x29e947)?JSON[_0xccbf('0x17')](_0x29e947):_0x29e947);logger[_0xccbf('0xd')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0xbbdfc7);_0xbdecfc[_0xccbf('0xe')]();}};};
\ No newline at end of file
index f03dc26..e9651b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x23d59f,_0x3c3d73){var _0x4976ca=function(_0x1c3456){while(--_0x1c3456){_0x23d59f['push'](_0x23d59f['shift']());}};_0x4976ca(++_0x3c3d73);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}};
\ No newline at end of file
+var _0x9c44=['merge','body','account','list','exports','render'];(function(_0xd2062,_0x4a2c29){var _0x2a07fb=function(_0x21925e){while(--_0x21925e){_0xd2062['push'](_0xd2062['shift']());}};_0x2a07fb(++_0x4a2c29);}(_0x9c44,0x178));var _0x49c4=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x9c44[_0x6cf19c];return _0xce14f3;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}};
\ No newline at end of file
index 2188df2..972495c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6878=['emit','complete','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busyQueue','QueueReport','UserId','catch','stack','message\x20is\x20empty','end','hasOwnProperty','CurrentCapacity','updateRealtime','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','listen','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','path','jayson/promise','bluebird','uuid','../../../config/environment','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','format','isNil','IntervalId','Intervals','map','interval','rules','channel','interaction','applications','isArray','length','join','app','.js','toLowerCase','autoreply','split','mail','push','slice','appdata','dialogflowv2','amazonlex','message','tag','TagId','%s:%s:%s','./interval','condition','intervals','./applications/','priority','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','execute','info','Applications\x20executed','stringify','matchPath'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x6878,0x185));var _0x8687=function(_0x199208,_0x57146f){_0x199208=_0x199208-0x0;var _0x47a7d3=_0x6878[_0x199208];return _0x47a7d3;};'use strict';var _=require(_0x8687('0x0'));var util=require('util');var path=require(_0x8687('0x1'));var fs=require('fs');var jayson=require(_0x8687('0x2'));var BPromise=require(_0x8687('0x3'));var uuid=require(_0x8687('0x4'));var config=require(_0x8687('0x5'));var logger=require('../../../config/logger')('routing');var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x8687('0x6')),'chatQueueReport':require(_0x8687('0x7')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x8687('0x8')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require('../lib/rule-engine');function getId(_0x2520f3,_0x44e4cc,_0x53cc29){return util[_0x8687('0x9')]('%s.%s.%s',_0x2520f3,_0x44e4cc||0x0,_0x53cc29||0x0);}function getIntervals(_0x3fed85,_0x448e8b){var _0x2d87da=[];if(!_[_0x8687('0xa')](_0x448e8b[_0x8687('0xb')])&&!_[_0x8687('0xa')](_0x3fed85[_0x448e8b[_0x8687('0xb')]])&&!_[_0x8687('0xa')](_0x3fed85[_0x448e8b[_0x8687('0xb')]][_0x8687('0xc')])){_0x2d87da=_[_0x8687('0xd')](_0x3fed85[_0x448e8b['IntervalId']][_0x8687('0xc')],_0x8687('0xe'));}else if(!_[_0x8687('0xa')](_0x448e8b['interval'])){_0x2d87da=[_0x448e8b['interval']];}return _0x2d87da;}exports['listen']=function(_0x2562c2){_0x2562c2[_0x8687('0xf')]={};return new BPromise(function(_0x1edf6a,_0x5e2859){var _0x37b8ce={'Start':function(_0x17e5d1){var _0x5eca4e=this;return new Promise(function(_0x5ab942,_0x1ba6d4){if(_0x17e5d1){try{var _0x4d5ab3=[];var _0xd7779f=getId(_0x17e5d1[_0x8687('0x10')],_0x17e5d1['message']?_0x17e5d1['message']['id']:0x0,_0x17e5d1[_0x8687('0x11')]?_0x17e5d1[_0x8687('0x11')]['id']:0x0);if(_0x17e5d1[_0x8687('0x12')]&&_[_0x8687('0x13')](_0x17e5d1['applications'])&&_0x17e5d1['applications'][_0x8687('0x14')]){for(var _0x108c49=0x0;_0x108c49<_0x17e5d1['applications']['length'];_0x108c49+=0x1){var _0x46c396=_0x17e5d1[_0x8687('0x12')][_0x108c49];if(fs['existsSync'](path[_0x8687('0x15')](__dirname,_0x8687('0x12'),_0x46c396[_0x8687('0x16')]+_0x8687('0x17')))){var _0x3850a0=[];switch(_0x46c396[_0x8687('0x16')][_0x8687('0x18')]()){case _0x8687('0x19'):var _0x3beb0c=_0x46c396['appdata'][_0x8687('0x1a')](',');if(_0x17e5d1['channel']===_0x8687('0x1b')){_0x3850a0[_0x8687('0x1c')](_0x3beb0c[0x0]);_0x3850a0[_0x8687('0x1c')](_0x3beb0c[0x1]);_0x3850a0[_0x8687('0x1c')](_0x3beb0c['slice'](0x2,_0x3beb0c['length'])[_0x8687('0x15')](','));}else{_0x3850a0['push'](_0x3beb0c[0x0]);_0x3850a0[_0x8687('0x1c')](_0x3beb0c[_0x8687('0x1d')](0x1,_0x3beb0c['length'])[_0x8687('0x15')](','));}break;case'dialogflow':var _0x45a8e7=_0x46c396[_0x8687('0x1e')][_0x8687('0x1a')](',');_0x3850a0[_0x8687('0x1c')](_0x45a8e7[0x0]);_0x3850a0[_0x8687('0x1c')](_0x45a8e7[0x1]);_0x3850a0[_0x8687('0x1c')](_0x45a8e7[_0x8687('0x1d')](0x2,_0x45a8e7['length'])[_0x8687('0x15')](','));break;case _0x8687('0x1f'):var _0x3bf77e=_0x46c396[_0x8687('0x1e')][_0x8687('0x1a')](',');_0x3850a0['push'](_0x3bf77e[0x0]);_0x3850a0['push'](_0x3bf77e[0x1]);_0x3850a0[_0x8687('0x1c')](_0x3bf77e[0x2]);_0x3850a0['push'](_0x3bf77e[0x3]);_0x3850a0['push'](_0x3bf77e[_0x8687('0x1d')](0x4,_0x3bf77e[_0x8687('0x14')])[_0x8687('0x15')](','));break;case _0x8687('0x20'):var _0x529630=_0x46c396[_0x8687('0x1e')][_0x8687('0x1a')](',');_0x3850a0[_0x8687('0x1c')](_0x529630[0x0]);_0x3850a0[_0x8687('0x1c')](_0x529630[0x1]);_0x3850a0[_0x8687('0x1c')](_0x529630[0x2]);_0x3850a0['push'](_0x529630[0x3]);_0x3850a0['push'](_0x529630[_0x8687('0x1d')](0x4,_0x529630[_0x8687('0x14')])[_0x8687('0x15')](','));break;case _0x8687('0x21'):_0x3850a0[_0x8687('0x1c')](_0x46c396['appdata']);break;case _0x8687('0x22'):_0x3850a0[_0x8687('0x1c')](_0x46c396[_0x8687('0x23')]);_0x3850a0[_0x8687('0x1c')](_0x46c396[_0x8687('0x1e')]);break;default:_0x3850a0=_[_0x8687('0xa')](_0x46c396['appdata'])?[]:_0x46c396[_0x8687('0x1e')][_0x8687('0x1a')](',');}var _0x6d97aa={'id':util['format'](_0x8687('0x24'),_0xd7779f,_0x46c396['id'],_0x46c396[_0x8687('0x16')]),'condition':require(_0x8687('0x25'))[_0x8687('0x26')](_0xd7779f,getIntervals(_0x2562c2[_0x8687('0x27')],_0x46c396),_0x2562c2),'consequence':require(_0x8687('0x28')+_0x46c396[_0x8687('0x16')])['consequence'](_0xd7779f,_0x3850a0,_0x2562c2,_0x17e5d1),'p':_0x46c396[_0x8687('0x29')]||0x0};logger['info'](_0x8687('0x2a'),_0x6d97aa['id'],_0x8687('0x2b'),getIntervals(_0x2562c2['intervals'],_0x46c396)[_0x8687('0x15')](_0x8687('0x2c')));_0x4d5ab3[_0x8687('0x1c')](_0x6d97aa);}else{logger[_0x8687('0x2d')]('Please\x20create\x20a\x20new\x20file\x20under',path['join'](__dirname,'applications',_0x46c396[_0x8687('0x16')]+_0x8687('0x17')));}}_0x2562c2[_0x8687('0xf')][_0xd7779f]=new RuleEngine(_0x4d5ab3);_0x2562c2[_0x8687('0xf')][_0xd7779f][_0x8687('0x2e')](_0x17e5d1,function(_0x2c90df){logger[_0x8687('0x2f')](_0x8687('0x30'),JSON[_0x8687('0x31')](_0x2c90df[_0x8687('0x32')]));if(_0x2562c2[_0x8687('0xf')][_0xd7779f]){_0x2562c2['rules'][_0xd7779f][_0x8687('0x33')](_0x8687('0x34'));}});return _0x5ab942({'code':0xc8,'message':_0x17e5d1});}else{logger[_0x8687('0x2f')](_0x8687('0x35'));return _0x5ab942({'code':0xc8,'message':_0x17e5d1});}}catch(_0x50aa92){logger[_0x8687('0x2d')](_0x50aa92['stack']);return _0x1ba6d4(_0x5eca4e['error'](0x1f4,_0x50aa92));}}return _0x1ba6d4(_0x8687('0x36'));});},'AcceptMessage':function(_0x425aa6){var _0x13c3ed=this;return new Promise(function(_0x2ff6fa,_0x57743b){if(_0x425aa6[_0x8687('0x37')]&&_0x425aa6[_0x8687('0x37')]['id']){if(_0x2562c2['agents'][_0x425aa6[_0x8687('0x37')]['id']]){_0x2562c2[_0x8687('0x38')][_0x425aa6[_0x8687('0x37')]['id']]['busy']=![];_0x2562c2['agents'][_0x425aa6[_0x8687('0x37')]['id']][_0x8687('0x39')]=undefined;}}if(_0x425aa6['message']&&_0x425aa6[_0x8687('0x21')]['id']){try{var _0x36bee9=getId(_0x425aa6[_0x8687('0x10')],_0x425aa6[_0x8687('0x21')]?_0x425aa6[_0x8687('0x21')]['id']:0x0,_0x425aa6['interaction']?_0x425aa6[_0x8687('0x11')]['id']:0x0);if(_0x2562c2[_0x8687('0xf')][_0x36bee9]){_0x2562c2['rules'][_0x36bee9][_0x8687('0x33')]('end');if(rpc[_0x425aa6[_0x8687('0x10')]+_0x8687('0x3a')]){rpc[_0x425aa6[_0x8687('0x10')]+'QueueReport']['update'](_0x36bee9,{'UserId':_0x425aa6[_0x8687('0x21')][_0x8687('0x3b')]})[_0x8687('0x3c')](function(_0x12c02d){logger['error']('error\x20update\x20queue\x20report');});}}return _0x2ff6fa({'code':0xc8,'message':_0x425aa6});}catch(_0x382560){logger[_0x8687('0x2d')](_0x382560[_0x8687('0x3d')]);return _0x57743b(_0x13c3ed[_0x8687('0x2d')](0x1f4,_0x382560));}}logger[_0x8687('0x2d')](_0x8687('0x3e'));return _0x57743b(_0x13c3ed[_0x8687('0x2d')](0x1f4,_0x8687('0x3e')));});},'RejectMessage':function(_0x465462){var _0x5904c7=this;return new Promise(function(_0x2cee23,_0x32ce22){if(_0x465462[_0x8687('0x37')]&&_0x465462[_0x8687('0x37')]['id']){try{if(_0x2562c2['agents'][_0x465462[_0x8687('0x37')]['id']]){_0x2562c2[_0x8687('0x38')][_0x465462[_0x8687('0x37')]['id']]['busy']=![];_0x2562c2[_0x8687('0x38')][_0x465462[_0x8687('0x37')]['id']][_0x8687('0x39')]=undefined;}return _0x2cee23({'code':0xc8,'message':_0x465462});}catch(_0x240d1c){logger[_0x8687('0x2d')](_0x240d1c['stack']);return _0x32ce22(_0x5904c7['error'](0x1f4,_0x240d1c));}}logger[_0x8687('0x2d')](_0x8687('0x3e'));return _0x32ce22(_0x5904c7[_0x8687('0x2d')](0x1f4,_0x8687('0x3e')));});},'AbandonInteraction':function(_0x28cd11){var _0x3767e7=this;return new Promise(function(_0x298a68,_0x42c7e0){if(_0x28cd11[_0x8687('0x10')]&&_0x28cd11[_0x8687('0x11')]&&_0x28cd11['interaction']['id']){try{var _0x179c02=getId(_0x28cd11['channel'],_0x28cd11['message']?_0x28cd11['message']['id']:0x0,_0x28cd11[_0x8687('0x11')]?_0x28cd11[_0x8687('0x11')]['id']:0x0);if(_0x2562c2[_0x8687('0xf')][_0x179c02]){_0x2562c2[_0x8687('0xf')][_0x179c02]['emit'](_0x8687('0x3f'));}return _0x298a68({'code':0xc8,'message':_0x28cd11});}catch(_0x40a522){logger[_0x8687('0x2d')](_0x40a522[_0x8687('0x3d')]);return _0x42c7e0(_0x3767e7['error'](0x1f4,_0x40a522));}}logger[_0x8687('0x2d')](_0x8687('0x3e'));return _0x42c7e0(_0x3767e7[_0x8687('0x2d')](0x1f4,_0x8687('0x3e')));});},'AgentCapacity':function(_0x7bb4dc){var _0x3912f8=this;return new Promise(function(_0x259ecb,_0x4fdb47){if(_0x2562c2[_0x8687('0x38')]['hasOwnProperty'](_0x7bb4dc['id'])){for(var _0x175f63 in _0x7bb4dc['capacity']){if(_0x7bb4dc['capacity']['hasOwnProperty'](_0x175f63)){if(_0x2562c2[_0x8687('0x38')][_0x7bb4dc['id']][_0x8687('0x40')](_0x175f63+_0x8687('0x41'))){_0x2562c2[_0x8687('0x38')][_0x7bb4dc['id']][_0x175f63+_0x8687('0x41')]=parseInt(_0x7bb4dc['capacity'][_0x175f63],0xa);}}}_0x2562c2['agents'][_0x7bb4dc['id']][_0x8687('0x42')]();return _0x259ecb({'code':0xc8,'message':_0x2562c2[_0x8687('0x38')][_0x7bb4dc['id']]});}else{return _0x4fdb47(_0x3912f8['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x52ce92){return new Promise(function(_0x16ff0b,_0x2be1ff){var _0x598fa3=_['values'](_0x2562c2[_0x8687('0x38')]);_0x16ff0b({'count':_0x598fa3[_0x8687('0x14')],'rows':_0x598fa3});});},'ChatQueues':function(_0x4312d5){return new Promise(function(_0x489227,_0x2ab638){var _0x4535bc=[];for(var _0x31d0e7 in _0x2562c2['chatQueues']){if(_0x2562c2[_0x8687('0x43')][_0x8687('0x40')](_0x31d0e7)){var _0x6800d3=_0x2562c2[_0x8687('0x43')][_0x31d0e7];var _0x42ba54={'id':_0x6800d3['id'],'available':_0x6800d3[_0x8687('0x44')],'loggedIn':_0x6800d3[_0x8687('0x45')],'name':_0x6800d3[_0x8687('0x46')],'paused':_0x6800d3[_0x8687('0x47')],'waiting':_0x6800d3[_0x8687('0x48')]};_0x4535bc['push'](_0x42ba54);}}_0x489227({'count':_0x4535bc[_0x8687('0x14')],'rows':_0x4535bc});});},'MailQueues':function(_0x2c49ed){return new Promise(function(_0x12b25b,_0x26b64b){var _0x151f08=[];for(var _0x1e2cd0 in _0x2562c2[_0x8687('0x49')]){if(_0x2562c2[_0x8687('0x49')][_0x8687('0x40')](_0x1e2cd0)){var _0x17459c=_0x2562c2[_0x8687('0x49')][_0x1e2cd0];var _0x792894={'id':_0x17459c['id'],'available':_0x17459c[_0x8687('0x44')],'loggedIn':_0x17459c[_0x8687('0x45')],'name':_0x17459c['name'],'paused':_0x17459c[_0x8687('0x47')],'waiting':_0x17459c[_0x8687('0x48')]};_0x151f08[_0x8687('0x1c')](_0x792894);}}_0x12b25b({'count':_0x151f08[_0x8687('0x14')],'rows':_0x151f08});});},'OpenchannelQueues':function(_0x207876){return new Promise(function(_0x28e6ee,_0x579b77){var _0x4c01d5=[];for(var _0x38e086 in _0x2562c2[_0x8687('0x4a')]){if(_0x2562c2[_0x8687('0x4a')][_0x8687('0x40')](_0x38e086)){var _0x3650bd=_0x2562c2[_0x8687('0x4a')][_0x38e086];var _0x565415={'id':_0x3650bd['id'],'available':_0x3650bd[_0x8687('0x44')],'loggedIn':_0x3650bd['loggedIn'],'name':_0x3650bd[_0x8687('0x46')],'paused':_0x3650bd['paused'],'waiting':_0x3650bd['waiting']};_0x4c01d5[_0x8687('0x1c')](_0x565415);}}_0x28e6ee({'count':_0x4c01d5['length'],'rows':_0x4c01d5});});},'SmsQueues':function(_0x12d0d3){return new Promise(function(_0x441f90,_0x415c56){var _0x5c7f38=[];for(var _0x53359b in _0x2562c2[_0x8687('0x4b')]){if(_0x2562c2[_0x8687('0x4b')]['hasOwnProperty'](_0x53359b)){var _0x54da36=_0x2562c2[_0x8687('0x4b')][_0x53359b];var _0x56e8b4={'id':_0x54da36['id'],'available':_0x54da36[_0x8687('0x44')],'loggedIn':_0x54da36[_0x8687('0x45')],'name':_0x54da36['name'],'paused':_0x54da36[_0x8687('0x47')],'waiting':_0x54da36[_0x8687('0x48')]};_0x5c7f38[_0x8687('0x1c')](_0x56e8b4);}}_0x441f90({'count':_0x5c7f38['length'],'rows':_0x5c7f38});});},'FaxQueues':function(_0x1f8302){return new Promise(function(_0x1d9921,_0x25ef00){var _0x222f45=[];for(var _0x13d81c in _0x2562c2[_0x8687('0x4c')]){if(_0x2562c2['faxQueues']['hasOwnProperty'](_0x13d81c)){var _0x516f13=_0x2562c2[_0x8687('0x4c')][_0x13d81c];var _0x1f5732={'id':_0x516f13['id'],'available':_0x516f13[_0x8687('0x44')],'loggedIn':_0x516f13['loggedIn'],'name':_0x516f13[_0x8687('0x46')],'paused':_0x516f13[_0x8687('0x47')],'waiting':_0x516f13[_0x8687('0x48')]};_0x222f45[_0x8687('0x1c')](_0x1f5732);}}_0x1d9921({'count':_0x222f45['length'],'rows':_0x222f45});});},'WhatsappQueues':function(_0x3510d1){return new Promise(function(_0x139aac,_0xa3f9eb){var _0xd7e4f6=[];for(var _0x548b22 in _0x2562c2[_0x8687('0x4d')]){if(_0x2562c2[_0x8687('0x4d')]['hasOwnProperty'](_0x548b22)){var _0x10a879=_0x2562c2[_0x8687('0x4d')][_0x548b22];var _0x231061={'id':_0x10a879['id'],'available':_0x10a879['available'],'loggedIn':_0x10a879['loggedIn'],'name':_0x10a879[_0x8687('0x46')],'paused':_0x10a879[_0x8687('0x47')],'waiting':_0x10a879[_0x8687('0x48')]};_0xd7e4f6[_0x8687('0x1c')](_0x231061);}}_0x139aac({'count':_0xd7e4f6[_0x8687('0x14')],'rows':_0xd7e4f6});});},'ChatQueuesWaitingInteractions':function(_0x1671db){return new Promise(function(_0x2a9e40,_0x43a154){var _0xb37b63=_['values'](_0x2562c2['chatQueuesWaitingInteractions']);_0x2a9e40({'count':_0xb37b63[_0x8687('0x14')],'rows':_0xb37b63});});},'MailQueuesWaitingInteractions':function(_0x5ac207){return new Promise(function(_0x465229,_0x5509a0){var _0x2a9fbb=_['values'](_0x2562c2['mailQueuesWaitingInteractions']);_0x465229({'count':_0x2a9fbb['length'],'rows':_0x2a9fbb});});},'OpenchannelQueuesWaitingInteractions':function(_0xab4454){return new Promise(function(_0x6196bb,_0x42f569){var _0x1a61f2=_[_0x8687('0x4e')](_0x2562c2[_0x8687('0x4f')]);_0x6196bb({'count':_0x1a61f2['length'],'rows':_0x1a61f2});});},'SmsQueuesWaitingInteractions':function(_0x2b4eda){return new Promise(function(_0x5aa0e4,_0xcda13c){var _0x5f593d=_[_0x8687('0x4e')](_0x2562c2['smsQueuesWaitingInteractions']);_0x5aa0e4({'count':_0x5f593d[_0x8687('0x14')],'rows':_0x5f593d});});},'FaxQueuesWaitingInteractions':function(_0x84d0e5){return new Promise(function(_0x176b4b,_0x114b25){var _0x1fb170=_[_0x8687('0x4e')](_0x2562c2[_0x8687('0x50')]);_0x176b4b({'count':_0x1fb170[_0x8687('0x14')],'rows':_0x1fb170});});},'WhatsappQueuesWaitingInteractions':function(_0x4a5728){return new Promise(function(_0x1b3869,_0x429cdc){var _0x5df5db=_[_0x8687('0x4e')](_0x2562c2[_0x8687('0x51')]);_0x1b3869({'count':_0x5df5db[_0x8687('0x14')],'rows':_0x5df5db});});}};var _0x2a5bdd=jayson[_0x8687('0x52')](_0x37b8ce)[_0x8687('0x53')]();_0x2a5bdd['on'](_0x8687('0x2d'),function(_0x396794){logger[_0x8687('0x2d')](JSON[_0x8687('0x31')](_0x396794));return _0x5e2859(_0x396794);});_0x2a5bdd[_0x8687('0x54')](0x232c,_0x8687('0x55'),function(){console['log'](_0x8687('0x56'),0x232c);return _0x1edf6a(_0x8687('0x57')+0x232c);});});};
\ No newline at end of file
+var _0x6f83=['interaction','applications','isArray','length','existsSync','join','.js','toLowerCase','autoreply','split','push','slice','dialogflow','appdata','dialogflowv2','amazonlex','tag','TagId','%s:%s:%s','./interval','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','app','execute','stringify','matchPath','emit','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busy','busyQueue','QueueReport','update','catch','stack','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise','bluebird','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x6f83,0x154));var _0x36f8=function(_0x54dd6d,_0x85cc69){_0x54dd6d=_0x54dd6d-0x0;var _0x2aa5bb=_0x6f83[_0x54dd6d];return _0x2aa5bb;};'use strict';var _=require('lodash');var util=require(_0x36f8('0x0'));var path=require('path');var fs=require('fs');var jayson=require(_0x36f8('0x1'));var BPromise=require(_0x36f8('0x2'));var uuid=require('uuid');var config=require('../../../config/environment');var logger=require(_0x36f8('0x3'))(_0x36f8('0x4'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x36f8('0x5')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x36f8('0x6')),'faxQueueReport':require(_0x36f8('0x7')),'whatsappQueueReport':require(_0x36f8('0x8'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x4e5419,_0xac949c,_0x1c2f57){return util[_0x36f8('0x9')](_0x36f8('0xa'),_0x4e5419,_0xac949c||0x0,_0x1c2f57||0x0);}function getIntervals(_0x3e76ab,_0x1b9f87){var _0x442a37=[];if(!_[_0x36f8('0xb')](_0x1b9f87['IntervalId'])&&!_[_0x36f8('0xb')](_0x3e76ab[_0x1b9f87[_0x36f8('0xc')]])&&!_['isNil'](_0x3e76ab[_0x1b9f87[_0x36f8('0xc')]][_0x36f8('0xd')])){_0x442a37=_[_0x36f8('0xe')](_0x3e76ab[_0x1b9f87['IntervalId']][_0x36f8('0xd')],'interval');}else if(!_[_0x36f8('0xb')](_0x1b9f87['interval'])){_0x442a37=[_0x1b9f87[_0x36f8('0xf')]];}return _0x442a37;}exports[_0x36f8('0x10')]=function(_0x1f618b){_0x1f618b[_0x36f8('0x11')]={};return new BPromise(function(_0x28f99a,_0x40560a){var _0x4278de={'Start':function(_0x4706ec){var _0xac3b22=this;return new Promise(function(_0x27704d,_0x3bec0d){if(_0x4706ec){try{var _0x3e06ef=[];var _0x2e1dbd=getId(_0x4706ec[_0x36f8('0x12')],_0x4706ec[_0x36f8('0x13')]?_0x4706ec[_0x36f8('0x13')]['id']:0x0,_0x4706ec[_0x36f8('0x14')]?_0x4706ec[_0x36f8('0x14')]['id']:0x0);if(_0x4706ec[_0x36f8('0x15')]&&_[_0x36f8('0x16')](_0x4706ec[_0x36f8('0x15')])&&_0x4706ec[_0x36f8('0x15')][_0x36f8('0x17')]){for(var _0xf2bbe5=0x0;_0xf2bbe5<_0x4706ec['applications'][_0x36f8('0x17')];_0xf2bbe5+=0x1){var _0x5bdb06=_0x4706ec['applications'][_0xf2bbe5];if(fs[_0x36f8('0x18')](path[_0x36f8('0x19')](__dirname,_0x36f8('0x15'),_0x5bdb06['app']+_0x36f8('0x1a')))){var _0x432667=[];switch(_0x5bdb06['app'][_0x36f8('0x1b')]()){case _0x36f8('0x1c'):var _0x4e369a=_0x5bdb06['appdata'][_0x36f8('0x1d')](',');if(_0x4706ec[_0x36f8('0x12')]==='mail'){_0x432667[_0x36f8('0x1e')](_0x4e369a[0x0]);_0x432667['push'](_0x4e369a[0x1]);_0x432667['push'](_0x4e369a[_0x36f8('0x1f')](0x2,_0x4e369a[_0x36f8('0x17')])[_0x36f8('0x19')](','));}else{_0x432667['push'](_0x4e369a[0x0]);_0x432667[_0x36f8('0x1e')](_0x4e369a[_0x36f8('0x1f')](0x1,_0x4e369a[_0x36f8('0x17')])['join'](','));}break;case _0x36f8('0x20'):var _0x13b828=_0x5bdb06[_0x36f8('0x21')][_0x36f8('0x1d')](',');_0x432667[_0x36f8('0x1e')](_0x13b828[0x0]);_0x432667[_0x36f8('0x1e')](_0x13b828[0x1]);_0x432667['push'](_0x13b828['slice'](0x2,_0x13b828['length'])[_0x36f8('0x19')](','));break;case _0x36f8('0x22'):var _0x5cd606=_0x5bdb06[_0x36f8('0x21')][_0x36f8('0x1d')](',');_0x432667[_0x36f8('0x1e')](_0x5cd606[0x0]);_0x432667[_0x36f8('0x1e')](_0x5cd606[0x1]);_0x432667[_0x36f8('0x1e')](_0x5cd606[0x2]);_0x432667[_0x36f8('0x1e')](_0x5cd606[0x3]);_0x432667[_0x36f8('0x1e')](_0x5cd606[_0x36f8('0x1f')](0x4,_0x5cd606[_0x36f8('0x17')])[_0x36f8('0x19')](','));break;case _0x36f8('0x23'):var _0x46fd55=_0x5bdb06[_0x36f8('0x21')][_0x36f8('0x1d')](',');_0x432667[_0x36f8('0x1e')](_0x46fd55[0x0]);_0x432667[_0x36f8('0x1e')](_0x46fd55[0x1]);_0x432667[_0x36f8('0x1e')](_0x46fd55[0x2]);_0x432667[_0x36f8('0x1e')](_0x46fd55[0x3]);_0x432667[_0x36f8('0x1e')](_0x46fd55[_0x36f8('0x1f')](0x4,_0x46fd55['length'])[_0x36f8('0x19')](','));break;case _0x36f8('0x13'):_0x432667[_0x36f8('0x1e')](_0x5bdb06[_0x36f8('0x21')]);break;case _0x36f8('0x24'):_0x432667['push'](_0x5bdb06[_0x36f8('0x25')]);_0x432667[_0x36f8('0x1e')](_0x5bdb06[_0x36f8('0x21')]);break;default:_0x432667=_[_0x36f8('0xb')](_0x5bdb06[_0x36f8('0x21')])?[]:_0x5bdb06[_0x36f8('0x21')][_0x36f8('0x1d')](',');}var _0xd80543={'id':util['format'](_0x36f8('0x26'),_0x2e1dbd,_0x5bdb06['id'],_0x5bdb06['app']),'condition':require(_0x36f8('0x27'))['condition'](_0x2e1dbd,getIntervals(_0x1f618b[_0x36f8('0x28')],_0x5bdb06),_0x1f618b),'consequence':require(_0x36f8('0x29')+_0x5bdb06['app'])[_0x36f8('0x2a')](_0x2e1dbd,_0x432667,_0x1f618b,_0x4706ec),'p':_0x5bdb06[_0x36f8('0x2b')]||0x0};logger[_0x36f8('0x2c')](_0x36f8('0x2d'),_0xd80543['id'],_0x36f8('0x2e'),getIntervals(_0x1f618b['intervals'],_0x5bdb06)[_0x36f8('0x19')](_0x36f8('0x2f')));_0x3e06ef['push'](_0xd80543);}else{logger[_0x36f8('0x30')](_0x36f8('0x31'),path['join'](__dirname,'applications',_0x5bdb06[_0x36f8('0x32')]+_0x36f8('0x1a')));}}_0x1f618b[_0x36f8('0x11')][_0x2e1dbd]=new RuleEngine(_0x3e06ef);_0x1f618b['rules'][_0x2e1dbd][_0x36f8('0x33')](_0x4706ec,function(_0x2902bd){logger[_0x36f8('0x2c')]('Applications\x20executed',JSON[_0x36f8('0x34')](_0x2902bd[_0x36f8('0x35')]));if(_0x1f618b[_0x36f8('0x11')][_0x2e1dbd]){_0x1f618b[_0x36f8('0x11')][_0x2e1dbd][_0x36f8('0x36')]('complete');}});return _0x27704d({'code':0xc8,'message':_0x4706ec});}else{logger['info'](_0x36f8('0x37'));return _0x27704d({'code':0xc8,'message':_0x4706ec});}}catch(_0x4888b8){logger['error'](_0x4888b8['stack']);return _0x3bec0d(_0xac3b22[_0x36f8('0x30')](0x1f4,_0x4888b8));}}return _0x3bec0d(_0x36f8('0x38'));});},'AcceptMessage':function(_0x514e54){var _0x517a93=this;return new Promise(function(_0x1f6201,_0x9711a){if(_0x514e54[_0x36f8('0x39')]&&_0x514e54['agent']['id']){if(_0x1f618b['agents'][_0x514e54[_0x36f8('0x39')]['id']]){_0x1f618b[_0x36f8('0x3a')][_0x514e54[_0x36f8('0x39')]['id']][_0x36f8('0x3b')]=![];_0x1f618b[_0x36f8('0x3a')][_0x514e54[_0x36f8('0x39')]['id']][_0x36f8('0x3c')]=undefined;}}if(_0x514e54[_0x36f8('0x13')]&&_0x514e54['message']['id']){try{var _0xa8299a=getId(_0x514e54[_0x36f8('0x12')],_0x514e54[_0x36f8('0x13')]?_0x514e54[_0x36f8('0x13')]['id']:0x0,_0x514e54['interaction']?_0x514e54[_0x36f8('0x14')]['id']:0x0);if(_0x1f618b[_0x36f8('0x11')][_0xa8299a]){_0x1f618b[_0x36f8('0x11')][_0xa8299a][_0x36f8('0x36')]('end');if(rpc[_0x514e54[_0x36f8('0x12')]+_0x36f8('0x3d')]){rpc[_0x514e54[_0x36f8('0x12')]+_0x36f8('0x3d')][_0x36f8('0x3e')](_0xa8299a,{'UserId':_0x514e54['message']['UserId']})[_0x36f8('0x3f')](function(_0x12ace6){logger['error']('error\x20update\x20queue\x20report');});}}return _0x1f6201({'code':0xc8,'message':_0x514e54});}catch(_0x4ca7f6){logger[_0x36f8('0x30')](_0x4ca7f6[_0x36f8('0x40')]);return _0x9711a(_0x517a93[_0x36f8('0x30')](0x1f4,_0x4ca7f6));}}logger['error'](_0x36f8('0x41'));return _0x9711a(_0x517a93[_0x36f8('0x30')](0x1f4,_0x36f8('0x41')));});},'RejectMessage':function(_0x5d00b0){var _0x209adc=this;return new Promise(function(_0x2c0b39,_0x48f048){if(_0x5d00b0['agent']&&_0x5d00b0[_0x36f8('0x39')]['id']){try{if(_0x1f618b[_0x36f8('0x3a')][_0x5d00b0[_0x36f8('0x39')]['id']]){_0x1f618b[_0x36f8('0x3a')][_0x5d00b0[_0x36f8('0x39')]['id']][_0x36f8('0x3b')]=![];_0x1f618b[_0x36f8('0x3a')][_0x5d00b0[_0x36f8('0x39')]['id']]['busyQueue']=undefined;}return _0x2c0b39({'code':0xc8,'message':_0x5d00b0});}catch(_0x36c02a){logger[_0x36f8('0x30')](_0x36c02a['stack']);return _0x48f048(_0x209adc[_0x36f8('0x30')](0x1f4,_0x36c02a));}}logger[_0x36f8('0x30')](_0x36f8('0x41'));return _0x48f048(_0x209adc[_0x36f8('0x30')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x2a06ee){var _0x2e7d7f=this;return new Promise(function(_0x4601d0,_0x25a787){if(_0x2a06ee[_0x36f8('0x12')]&&_0x2a06ee[_0x36f8('0x14')]&&_0x2a06ee[_0x36f8('0x14')]['id']){try{var _0x1f5a1e=getId(_0x2a06ee[_0x36f8('0x12')],_0x2a06ee[_0x36f8('0x13')]?_0x2a06ee[_0x36f8('0x13')]['id']:0x0,_0x2a06ee['interaction']?_0x2a06ee[_0x36f8('0x14')]['id']:0x0);if(_0x1f618b[_0x36f8('0x11')][_0x1f5a1e]){_0x1f618b[_0x36f8('0x11')][_0x1f5a1e]['emit']('end');}return _0x4601d0({'code':0xc8,'message':_0x2a06ee});}catch(_0x5cfcc5){logger[_0x36f8('0x30')](_0x5cfcc5[_0x36f8('0x40')]);return _0x25a787(_0x2e7d7f[_0x36f8('0x30')](0x1f4,_0x5cfcc5));}}logger[_0x36f8('0x30')](_0x36f8('0x41'));return _0x25a787(_0x2e7d7f[_0x36f8('0x30')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x3a037e){var _0x49dcd5=this;return new Promise(function(_0x1a284d,_0x41da43){if(_0x1f618b[_0x36f8('0x3a')][_0x36f8('0x42')](_0x3a037e['id'])){for(var _0x514d01 in _0x3a037e[_0x36f8('0x43')]){if(_0x3a037e[_0x36f8('0x43')]['hasOwnProperty'](_0x514d01)){if(_0x1f618b[_0x36f8('0x3a')][_0x3a037e['id']][_0x36f8('0x42')](_0x514d01+_0x36f8('0x44'))){_0x1f618b[_0x36f8('0x3a')][_0x3a037e['id']][_0x514d01+_0x36f8('0x44')]=parseInt(_0x3a037e[_0x36f8('0x43')][_0x514d01],0xa);}}}_0x1f618b['agents'][_0x3a037e['id']][_0x36f8('0x45')]();return _0x1a284d({'code':0xc8,'message':_0x1f618b[_0x36f8('0x3a')][_0x3a037e['id']]});}else{return _0x41da43(_0x49dcd5[_0x36f8('0x30')](0x1f4,_0x36f8('0x46')));}});},'Agents':function(_0x6afd2f){return new Promise(function(_0x5e09aa,_0x28451d){var _0xbebe4c=_[_0x36f8('0x47')](_0x1f618b[_0x36f8('0x3a')]);_0x5e09aa({'count':_0xbebe4c['length'],'rows':_0xbebe4c});});},'ChatQueues':function(_0x3f2d31){return new Promise(function(_0x340de5,_0x10dc35){var _0x20039c=[];for(var _0x25c6b0 in _0x1f618b[_0x36f8('0x48')]){if(_0x1f618b[_0x36f8('0x48')][_0x36f8('0x42')](_0x25c6b0)){var _0x49bc6c=_0x1f618b[_0x36f8('0x48')][_0x25c6b0];var _0x40f0cf={'id':_0x49bc6c['id'],'available':_0x49bc6c[_0x36f8('0x49')],'loggedIn':_0x49bc6c[_0x36f8('0x4a')],'name':_0x49bc6c[_0x36f8('0x4b')],'paused':_0x49bc6c[_0x36f8('0x4c')],'waiting':_0x49bc6c[_0x36f8('0x4d')]};_0x20039c['push'](_0x40f0cf);}}_0x340de5({'count':_0x20039c[_0x36f8('0x17')],'rows':_0x20039c});});},'MailQueues':function(_0xe2fd87){return new Promise(function(_0x366769,_0x3c6a4b){var _0x21f1e5=[];for(var _0x381f26 in _0x1f618b[_0x36f8('0x4e')]){if(_0x1f618b[_0x36f8('0x4e')][_0x36f8('0x42')](_0x381f26)){var _0xf3f9ad=_0x1f618b[_0x36f8('0x4e')][_0x381f26];var _0x3bcb6c={'id':_0xf3f9ad['id'],'available':_0xf3f9ad['available'],'loggedIn':_0xf3f9ad['loggedIn'],'name':_0xf3f9ad[_0x36f8('0x4b')],'paused':_0xf3f9ad[_0x36f8('0x4c')],'waiting':_0xf3f9ad[_0x36f8('0x4d')]};_0x21f1e5[_0x36f8('0x1e')](_0x3bcb6c);}}_0x366769({'count':_0x21f1e5['length'],'rows':_0x21f1e5});});},'OpenchannelQueues':function(_0x1d2bb8){return new Promise(function(_0x407749,_0x217ad9){var _0x4dfeef=[];for(var _0x132e5b in _0x1f618b[_0x36f8('0x4f')]){if(_0x1f618b['openchannelQueues']['hasOwnProperty'](_0x132e5b)){var _0x5279c8=_0x1f618b[_0x36f8('0x4f')][_0x132e5b];var _0x190c7e={'id':_0x5279c8['id'],'available':_0x5279c8[_0x36f8('0x49')],'loggedIn':_0x5279c8['loggedIn'],'name':_0x5279c8['name'],'paused':_0x5279c8[_0x36f8('0x4c')],'waiting':_0x5279c8[_0x36f8('0x4d')]};_0x4dfeef[_0x36f8('0x1e')](_0x190c7e);}}_0x407749({'count':_0x4dfeef[_0x36f8('0x17')],'rows':_0x4dfeef});});},'SmsQueues':function(_0x3bbece){return new Promise(function(_0x2624d2,_0x30a786){var _0x55f533=[];for(var _0x2ecfab in _0x1f618b[_0x36f8('0x50')]){if(_0x1f618b[_0x36f8('0x50')]['hasOwnProperty'](_0x2ecfab)){var _0x435ddf=_0x1f618b[_0x36f8('0x50')][_0x2ecfab];var _0x1278dd={'id':_0x435ddf['id'],'available':_0x435ddf[_0x36f8('0x49')],'loggedIn':_0x435ddf[_0x36f8('0x4a')],'name':_0x435ddf[_0x36f8('0x4b')],'paused':_0x435ddf[_0x36f8('0x4c')],'waiting':_0x435ddf[_0x36f8('0x4d')]};_0x55f533[_0x36f8('0x1e')](_0x1278dd);}}_0x2624d2({'count':_0x55f533[_0x36f8('0x17')],'rows':_0x55f533});});},'FaxQueues':function(_0x157c5b){return new Promise(function(_0x26fd93,_0x1f3522){var _0x3b7335=[];for(var _0x1ef70c in _0x1f618b[_0x36f8('0x51')]){if(_0x1f618b[_0x36f8('0x51')][_0x36f8('0x42')](_0x1ef70c)){var _0x4a2e48=_0x1f618b[_0x36f8('0x51')][_0x1ef70c];var _0x49bc9b={'id':_0x4a2e48['id'],'available':_0x4a2e48[_0x36f8('0x49')],'loggedIn':_0x4a2e48[_0x36f8('0x4a')],'name':_0x4a2e48[_0x36f8('0x4b')],'paused':_0x4a2e48['paused'],'waiting':_0x4a2e48['waiting']};_0x3b7335[_0x36f8('0x1e')](_0x49bc9b);}}_0x26fd93({'count':_0x3b7335[_0x36f8('0x17')],'rows':_0x3b7335});});},'WhatsappQueues':function(_0x27a387){return new Promise(function(_0xe21bd,_0x3e5a9c){var _0x1fa54e=[];for(var _0x560947 in _0x1f618b[_0x36f8('0x52')]){if(_0x1f618b[_0x36f8('0x52')][_0x36f8('0x42')](_0x560947)){var _0x358043=_0x1f618b[_0x36f8('0x52')][_0x560947];var _0x4499e3={'id':_0x358043['id'],'available':_0x358043[_0x36f8('0x49')],'loggedIn':_0x358043[_0x36f8('0x4a')],'name':_0x358043[_0x36f8('0x4b')],'paused':_0x358043[_0x36f8('0x4c')],'waiting':_0x358043[_0x36f8('0x4d')]};_0x1fa54e[_0x36f8('0x1e')](_0x4499e3);}}_0xe21bd({'count':_0x1fa54e[_0x36f8('0x17')],'rows':_0x1fa54e});});},'ChatQueuesWaitingInteractions':function(_0xae1a81){return new Promise(function(_0xc8252a,_0x474b5c){var _0x508629=_[_0x36f8('0x47')](_0x1f618b['chatQueuesWaitingInteractions']);_0xc8252a({'count':_0x508629['length'],'rows':_0x508629});});},'MailQueuesWaitingInteractions':function(_0x566a64){return new Promise(function(_0x5e7cab,_0x45854c){var _0x4e4e2b=_[_0x36f8('0x47')](_0x1f618b['mailQueuesWaitingInteractions']);_0x5e7cab({'count':_0x4e4e2b[_0x36f8('0x17')],'rows':_0x4e4e2b});});},'OpenchannelQueuesWaitingInteractions':function(_0x4581ea){return new Promise(function(_0x5e0d25,_0x748321){var _0x3149bf=_[_0x36f8('0x47')](_0x1f618b['openchannelQueuesWaitingInteractions']);_0x5e0d25({'count':_0x3149bf[_0x36f8('0x17')],'rows':_0x3149bf});});},'SmsQueuesWaitingInteractions':function(_0xd2c6ca){return new Promise(function(_0x4a7754,_0x27a370){var _0x43bf61=_[_0x36f8('0x47')](_0x1f618b[_0x36f8('0x53')]);_0x4a7754({'count':_0x43bf61[_0x36f8('0x17')],'rows':_0x43bf61});});},'FaxQueuesWaitingInteractions':function(_0x1c4ac3){return new Promise(function(_0x5a9aa5,_0x57190e){var _0x3c589e=_[_0x36f8('0x47')](_0x1f618b[_0x36f8('0x54')]);_0x5a9aa5({'count':_0x3c589e[_0x36f8('0x17')],'rows':_0x3c589e});});},'WhatsappQueuesWaitingInteractions':function(_0x247237){return new Promise(function(_0x9964b9,_0x385e16){var _0x2b4beb=_[_0x36f8('0x47')](_0x1f618b[_0x36f8('0x55')]);_0x9964b9({'count':_0x2b4beb['length'],'rows':_0x2b4beb});});}};var _0x4f89c1=jayson[_0x36f8('0x56')](_0x4278de)['http']();_0x4f89c1['on'](_0x36f8('0x30'),function(_0x4a2861){logger[_0x36f8('0x30')](JSON['stringify'](_0x4a2861));return _0x40560a(_0x4a2861);});_0x4f89c1[_0x36f8('0x10')](0x232c,_0x36f8('0x57'),function(){console['log'](_0x36f8('0x58'),0x232c);return _0x28f99a(_0x36f8('0x59')+0x232c);});});};
\ No newline at end of file
index 6bf5a0a..87895ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49ca=['catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','message','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','when','log','join','\x20|\x20','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','client','http','request','then','error','result'];(function(_0x58dfbc,_0x4c5c67){var _0x5d2758=function(_0xf1cb53){while(--_0xf1cb53){_0x58dfbc['push'](_0x58dfbc['shift']());}};_0x5d2758(++_0x4c5c67);}(_0x49ca,0x1d1));var _0xa49c=function(_0x599998,_0x542413){_0x599998=_0x599998-0x0;var _0x371a27=_0x49ca[_0x599998];return _0x371a27;};'use strict';var util=require(_0xa49c('0x0'));var BPromise=require(_0xa49c('0x1'));var jayson=require(_0xa49c('0x2'));var _=require(_0xa49c('0x3'));var logger=require(_0xa49c('0x4'))('routing');var client=jayson[_0xa49c('0x5')][_0xa49c('0x6')]({'port':0x232a});function request(_0x4cb980,_0x2364c0){return new BPromise(function(_0x2be14b,_0x3ab1a6){return client[_0xa49c('0x7')](_0x4cb980,_0x2364c0)[_0xa49c('0x8')](function(_0x2e2c23){if(_0x2e2c23[_0xa49c('0x9')]){return _0x3ab1a6(_0x2e2c23['error']['message']);}else{return _0x2be14b(_0x2e2c23[_0xa49c('0xa')]);}})[_0xa49c('0xb')](function(_0x492b77){return _0x3ab1a6(_0x492b77);});});}exports[_0xa49c('0xc')]=function(_0x5cadcd,_0x206272,_0x5412b0){return function(_0x21649f){if(_0x5412b0[_0xa49c('0xd')]&&!_0x5412b0[_0xa49c('0xd')][_0x5cadcd]){logger[_0xa49c('0xe')](_0xa49c('0xf'),_0x5cadcd);return _0x21649f[_0xa49c('0x10')]();}var _0x4859a8=[];for(var _0x319ed4=0x0;_0x319ed4<_0x206272[_0xa49c('0x11')];_0x319ed4+=0x1){_0x4859a8[_0xa49c('0x12')](request(_0xa49c('0x13'),{'command':util[_0xa49c('0x14')](_0xa49c('0x15'),_0x206272[_0x319ed4])})[_0xa49c('0x8')](function(_0x45c0f0){return _0x45c0f0&&_0x45c0f0[_0xa49c('0x16')]&&_0x45c0f0[_0xa49c('0x16')][_0xa49c('0x17')](_0xa49c('0x18'))>=0x0?!![]:![];})[_0xa49c('0xb')](function(_0x147bb6){logger[_0xa49c('0x9')](_0xa49c('0x19'),_0x5cadcd,_0x206272[_0x319ed4]);}));}BPromise[_0xa49c('0x1a')](_0x4859a8)[_0xa49c('0x8')](function(_0x249e20){var _0x5a3924=_[_0xa49c('0x1b')](_0x249e20);logger[_0xa49c('0xe')](_0xa49c('0x1c'),_0x5cadcd,_0x206272['join']('\x20|\x20'),_0x5a3924);_0x21649f[_0xa49c('0x1d')](_0x5a3924);})['catch'](function(_0x1bc58f){console[_0xa49c('0x1e')](_0x1bc58f);logger[_0xa49c('0x9')](_0xa49c('0x1c'),_0x5cadcd,_0x206272[_0xa49c('0x1f')](_0xa49c('0x20')),_0x1bc58f[_0xa49c('0x21')]);_0x21649f['stop']();});};};
\ No newline at end of file
+var _0xa3aa=['stack','util','lodash','../../../config/logger','routing','client','http','request','error','message','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','Command','format','iftime\x20%s','then','indexOf','[%s][INTERVAL]\x20%s','all','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','log'];(function(_0x8a19ac,_0x5b1872){var _0x2cef9a=function(_0x107415){while(--_0x107415){_0x8a19ac['push'](_0x8a19ac['shift']());}};_0x2cef9a(++_0x5b1872);}(_0xa3aa,0x1c1));var _0xaa3a=function(_0x2f59fe,_0x538ea7){_0x2f59fe=_0x2f59fe-0x0;var _0x574db1=_0xa3aa[_0x2f59fe];return _0x574db1;};'use strict';var util=require(_0xaa3a('0x0'));var BPromise=require('bluebird');var jayson=require('jayson/promise');var _=require(_0xaa3a('0x1'));var logger=require(_0xaa3a('0x2'))(_0xaa3a('0x3'));var client=jayson[_0xaa3a('0x4')][_0xaa3a('0x5')]({'port':0x232a});function request(_0x8f34ba,_0x576a3c){return new BPromise(function(_0x47270d,_0x18c0cd){return client[_0xaa3a('0x6')](_0x8f34ba,_0x576a3c)['then'](function(_0x4e11a8){if(_0x4e11a8[_0xaa3a('0x7')]){return _0x18c0cd(_0x4e11a8[_0xaa3a('0x7')][_0xaa3a('0x8')]);}else{return _0x47270d(_0x4e11a8['result']);}})[_0xaa3a('0x9')](function(_0x189a55){return _0x18c0cd(_0x189a55);});});}exports[_0xaa3a('0xa')]=function(_0x10d004,_0xc6340,_0x410c16){return function(_0x2436cb){if(_0x410c16[_0xaa3a('0xb')]&&!_0x410c16[_0xaa3a('0xb')][_0x10d004]){logger[_0xaa3a('0xc')](_0xaa3a('0xd'),_0x10d004);return _0x2436cb[_0xaa3a('0xe')]();}var _0x5931ce=[];for(var _0x1a479d=0x0;_0x1a479d<_0xc6340[_0xaa3a('0xf')];_0x1a479d+=0x1){_0x5931ce['push'](request(_0xaa3a('0x10'),{'command':util[_0xaa3a('0x11')](_0xaa3a('0x12'),_0xc6340[_0x1a479d])})[_0xaa3a('0x13')](function(_0x37eae7){return _0x37eae7&&_0x37eae7[_0xaa3a('0x8')]&&_0x37eae7[_0xaa3a('0x8')][_0xaa3a('0x14')]('true')>=0x0?!![]:![];})[_0xaa3a('0x9')](function(_0xd33221){logger[_0xaa3a('0x7')](_0xaa3a('0x15'),_0x10d004,_0xc6340[_0x1a479d]);}));}BPromise[_0xaa3a('0x16')](_0x5931ce)['then'](function(_0x14a31b){var _0x44413f=_['some'](_0x14a31b);logger['info'](_0xaa3a('0x17'),_0x10d004,_0xc6340[_0xaa3a('0x18')](_0xaa3a('0x19')),_0x44413f);_0x2436cb['when'](_0x44413f);})[_0xaa3a('0x9')](function(_0x99f1fc){console[_0xaa3a('0x1a')](_0x99f1fc);logger[_0xaa3a('0x7')]('[%s][INTERVAL]\x20%s\x20%s',_0x10d004,_0xc6340['join']('\x20|\x20'),_0x99f1fc[_0xaa3a('0x1b')]);_0x2436cb['stop']();});};};
\ No newline at end of file
index 8307d84..9697ce4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3d1=['transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','ATTENDED','transfereeuniqueid','agententerreason','clone','calleridname','agentcalledAt','secondtransfererlinkedid','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','util','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','[%s][agents][agentcalled]','now','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','isNil','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','reason','holdtime','ringtime','talktime','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','agentringnoanswer','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','[%s][agents][agentcomplete]','transfereruniqueid','[%s][agents][blindtransfer]','transfer','transfertype','blind','transferexten','extension'];(function(_0x133655,_0x392340){var _0x38815a=function(_0x44c6ff){while(--_0x44c6ff){_0x133655['push'](_0x133655['shift']());}};_0x38815a(++_0x392340);}(_0xd3d1,0x172));var _0x1d3d=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xd3d1[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x1d3d('0x0'));var util=require(_0x1d3d('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x56f01c,_0x2d0605){utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x4'),_0x56f01c[_0x1d3d('0x5')],_0x56f01c[_0x1d3d('0x6')],_0x56f01c[_0x1d3d('0x7')],_0x56f01c[_0x1d3d('0x8')],_0x56f01c[_0x1d3d('0x9')],_0x56f01c[_0x1d3d('0xa')],_0x56f01c[_0x1d3d('0xb')],_0x56f01c[_0x1d3d('0xc')]));if(_0x56f01c[_0x1d3d('0x7')]){utils[_0x1d3d('0xd')](_0x56f01c[_0x1d3d('0x7')])[_0x1d3d('0xe')](function(_0x3683c9){if(_0x3683c9){_0x56f01c['type']=_0x3683c9[_0x1d3d('0xf')];_0x56f01c[_0x1d3d('0x10')]=_0x56f01c[_0x1d3d('0x11')]?_0x3683c9[_0x1d3d('0x12')]:![];_0x56f01c[_0x1d3d('0x13')]=_0x56f01c[_0x1d3d('0x10')]?_0x3683c9[_0x1d3d('0x14')]:0x0;}utils[_0x1d3d('0x15')](_0x1d3d('0x16'),_0x56f01c);});}else{utils[_0x1d3d('0x15')](_0x1d3d('0x16'),_0x56f01c);}if(_0x2d0605){delete transfers[_0x56f01c['uniqueid']];}else{delete agents[_0x56f01c[_0x1d3d('0x17')]];}}exports[_0x1d3d('0x18')]=function(_0x494b82){try{utils['debug'](util[_0x1d3d('0x3')](_0x1d3d('0x19'),_0x494b82[_0x1d3d('0x5')]),_0x494b82);agents[_0x494b82['destuniqueid']]=_0x494b82;agents[_0x494b82[_0x1d3d('0x17')]]['agentcalledAt']=utils[_0x1d3d('0x1a')]();agents[_0x494b82[_0x1d3d('0x17')]][_0x1d3d('0xc')]=_0x1d3d('0x1b');agents[_0x494b82[_0x1d3d('0x17')]][_0x1d3d('0xb')]=null;agents[_0x494b82[_0x1d3d('0x17')]]['connectedlinename']=null;utils['info'](util[_0x1d3d('0x3')](_0x1d3d('0x1c'),_0x494b82['uniqueid'],agents[_0x494b82[_0x1d3d('0x17')]]['membername'],_0x494b82[_0x1d3d('0x17')]));}catch(_0x392e92){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')]('[%s][agents][agentcalled]',_0x494b82[_0x1d3d('0x5')]),_0x392e92);}};exports['agentringnoanswer']=function(_0x56c424){try{if(!_[_0x1d3d('0x1e')](agents[_0x56c424[_0x1d3d('0x17')]])){utils[_0x1d3d('0x1f')](util[_0x1d3d('0x3')](_0x1d3d('0x20'),_0x56c424[_0x1d3d('0x5')]),_0x56c424);utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x21'),_0x56c424[_0x1d3d('0x5')],agents[_0x56c424[_0x1d3d('0x17')]]['membername'],_0x56c424[_0x1d3d('0x17')]));agents[_0x56c424[_0x1d3d('0x17')]]['agentringnoanswer']=!![];agents[_0x56c424[_0x1d3d('0x17')]]['agentringnoanswerAt']=utils[_0x1d3d('0x1a')]();agents[_0x56c424[_0x1d3d('0x17')]][_0x1d3d('0xc')]=_0x1d3d('0x22');agents[_0x56c424[_0x1d3d('0x17')]][_0x1d3d('0x23')]=_0x1d3d('0x22');agents[_0x56c424[_0x1d3d('0x17')]][_0x1d3d('0x24')]=_0x56c424[_0x1d3d('0x25')]?parseInt(_0x56c424[_0x1d3d('0x25')])/0x3e8:0x0;agents[_0x56c424['destuniqueid']][_0x1d3d('0x26')]=0x0;unanswered['push'](_0x56c424[_0x1d3d('0x17')]);}}catch(_0x2bcc2){utils['error'](util[_0x1d3d('0x3')](_0x1d3d('0x20'),_0x56c424[_0x1d3d('0x5')]),_0x2bcc2);}};exports[_0x1d3d('0x27')]=function(_0x4abbfc){try{_[_0x1d3d('0x28')](agents,function(_0x235ef3,_0x5d1b6c){if(_0x235ef3[_0x1d3d('0x5')]==_0x4abbfc['uniqueid']&&!_[_0x1d3d('0x29')](unanswered,_0x235ef3[_0x1d3d('0x17')])){utils['debug'](util[_0x1d3d('0x3')](_0x1d3d('0x2a'),_0x4abbfc[_0x1d3d('0x5')]),_0x4abbfc);utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x2b'),_0x4abbfc[_0x1d3d('0x5')],_0x235ef3[_0x1d3d('0x8')],_0x235ef3[_0x1d3d('0x17')]));_0x235ef3['agentringnoanswer']=!![];_0x235ef3[_0x1d3d('0x2c')]=utils[_0x1d3d('0x1a')]();_0x235ef3[_0x1d3d('0xc')]=_0x1d3d('0x2d');_0x235ef3['reason']='abandoned';_0x235ef3[_0x1d3d('0x24')]=_0x4abbfc[_0x1d3d('0x24')];_0x235ef3['talktime']=0x0;writeDB(_0x235ef3);}});}catch(_0x43ef5d){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')](_0x1d3d('0x2a'),_0x4abbfc['uniqueid']),_0x43ef5d);}};exports['agentconnect']=function(_0x29fa6c){try{if(agents[_0x29fa6c['destuniqueid']]){utils[_0x1d3d('0x1f')](util[_0x1d3d('0x3')](_0x1d3d('0x2e'),_0x29fa6c[_0x1d3d('0x5')]),_0x29fa6c);utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x2f'),_0x29fa6c[_0x1d3d('0x5')],agents[_0x29fa6c['destuniqueid']][_0x1d3d('0x8')],_0x29fa6c['destuniqueid']));agents[_0x29fa6c[_0x1d3d('0x17')]][_0x1d3d('0x30')]=utils['now']();agents[_0x29fa6c[_0x1d3d('0x17')]][_0x1d3d('0xb')]=_0x29fa6c[_0x1d3d('0xb')];agents[_0x29fa6c[_0x1d3d('0x17')]]['connectedlinename']=_0x29fa6c['connectedlinename'];agents[_0x29fa6c[_0x1d3d('0x17')]]['holdtime']=_0x29fa6c[_0x1d3d('0x25')];agents[_0x29fa6c[_0x1d3d('0x17')]]['lastevent']=_0x1d3d('0x31');_[_0x1d3d('0x28')](agents,function(_0x51be79,_0x2d5015){if(_0x51be79[_0x1d3d('0x17')]!=_0x29fa6c[_0x1d3d('0x17')]&&_0x51be79[_0x1d3d('0x5')]==_0x29fa6c[_0x1d3d('0x5')]){_0x51be79[_0x1d3d('0x26')]=0x0;_0x51be79['holdtime']=_0x29fa6c[_0x1d3d('0x25')];_0x51be79[_0x1d3d('0x32')]=!![];_0x51be79[_0x1d3d('0x2c')]=utils[_0x1d3d('0x1a')]();_0x51be79[_0x1d3d('0xc')]='answered_elsewhere';_0x51be79[_0x1d3d('0x23')]=_0x1d3d('0x33');_0x51be79[_0x1d3d('0x34')]=_0x29fa6c[_0x1d3d('0x17')];_0x51be79['answeredelsewheremembername']=_0x29fa6c[_0x1d3d('0x8')];writeDB(_0x51be79);}});}}catch(_0x977ea8){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')](_0x1d3d('0x2e'),_0x29fa6c['uniqueid']),_0x977ea8);}};exports['agentcomplete']=function(_0x229f48){try{if(!_[_0x1d3d('0x1e')](agents[_0x229f48[_0x1d3d('0x17')]])){utils[_0x1d3d('0x1f')](util[_0x1d3d('0x3')]('[%s][agents][agentcomplete]',_0x229f48[_0x1d3d('0x5')]),_0x229f48);utils['info'](util[_0x1d3d('0x3')](_0x1d3d('0x35'),_0x229f48[_0x1d3d('0x5')],agents[_0x229f48[_0x1d3d('0x17')]]['membername'],_0x229f48[_0x1d3d('0x17')]));agents[_0x229f48[_0x1d3d('0x17')]][_0x1d3d('0x11')]=!![];agents[_0x229f48[_0x1d3d('0x17')]][_0x1d3d('0x36')]=utils[_0x1d3d('0x1a')]();agents[_0x229f48[_0x1d3d('0x17')]]['talktime']=utils[_0x1d3d('0x37')](agents[_0x229f48['destuniqueid']][_0x1d3d('0x36')],agents[_0x229f48[_0x1d3d('0x17')]]['agentconnectAt']);agents[_0x229f48[_0x1d3d('0x17')]]['reason']=_0x229f48[_0x1d3d('0x23')];agents[_0x229f48['destuniqueid']][_0x1d3d('0xc')]=_0x1d3d('0x38');writeDB(agents[_0x229f48[_0x1d3d('0x17')]]);}}catch(_0x25b547){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')](_0x1d3d('0x39'),_0x229f48[_0x1d3d('0x5')]),_0x25b547);}};exports['blindtransfer']=function(_0x5899cc){try{if(!_['isNil'](agents[_0x5899cc[_0x1d3d('0x3a')]])){utils[_0x1d3d('0x1f')](util[_0x1d3d('0x3')](_0x1d3d('0x3b'),_0x5899cc[_0x1d3d('0x5')]),_0x5899cc);utils[_0x1d3d('0x2')](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x5899cc['uniqueid'],agents[_0x5899cc['transfereruniqueid']][_0x1d3d('0x8')],agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x5')]));agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x3c')]=!![];agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x3d')]=_0x1d3d('0x3e');agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x3f')]=_0x5899cc[_0x1d3d('0x40')];agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x41')]=agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x5')];}}catch(_0x5ce0d3){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')](_0x1d3d('0x3b'),_0x5899cc[_0x1d3d('0x5')]),_0x5ce0d3);}};exports['attendedtransfer']=function(_0x41930f){try{utils['debug'](util['format'](_0x1d3d('0x42'),_0x41930f[_0x1d3d('0x43')]),_0x41930f);if(_0x41930f['origtransfereruniqueid']==_0x41930f[_0x1d3d('0x44')]){if(!_[_0x1d3d('0x1e')](agents[_0x41930f['secondtransfereruniqueid']])){utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x45'),_0x41930f[_0x1d3d('0x43')],agents[_0x41930f[_0x1d3d('0x46')]][_0x1d3d('0x8')]));agents[_0x41930f[_0x1d3d('0x46')]][_0x1d3d('0x3c')]=!![];agents[_0x41930f[_0x1d3d('0x46')]]['transfertype']=_0x1d3d('0x47');agents[_0x41930f['secondtransfereruniqueid']]['transferexten']=_0x41930f['origtransfererexten'];agents[_0x41930f['secondtransfereruniqueid']][_0x1d3d('0x41')]=_0x41930f[_0x1d3d('0x43')];}if(_0x41930f[_0x1d3d('0x48')]&&agents[_0x41930f[_0x1d3d('0x48')]]){agents[_0x41930f['transfereeuniqueid']][_0x1d3d('0x49')]=0x1;transfers[_0x41930f['transfereeuniqueid']]=_[_0x1d3d('0x4a')](agents[_0x41930f[_0x1d3d('0x48')]]);transfers[_0x41930f['transfereeuniqueid']][_0x1d3d('0xa')]=agents[_0x41930f[_0x1d3d('0x46')]]['calleridnum'];transfers[_0x41930f[_0x1d3d('0x48')]][_0x1d3d('0x4b')]=agents[_0x41930f[_0x1d3d('0x46')]][_0x1d3d('0x4b')];transfers[_0x41930f[_0x1d3d('0x48')]][_0x1d3d('0x4c')]=utils['now']();transfers[_0x41930f[_0x1d3d('0x48')]][_0x1d3d('0x30')]=utils[_0x1d3d('0x1a')]();transfers[_0x41930f[_0x1d3d('0x48')]][_0x1d3d('0x24')]=0x0;transfers[_0x41930f['transfereeuniqueid']][_0x1d3d('0x49')]=0x2;}}else if(_0x41930f['secondtransfereruniqueid']==_0x41930f[_0x1d3d('0x4d')]){if(!_['isNil'](agents[_0x41930f[_0x1d3d('0x43')]])){utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x45'),_0x41930f[_0x1d3d('0x43')],agents[_0x41930f[_0x1d3d('0x43')]][_0x1d3d('0x8')]));agents[_0x41930f['origtransfereruniqueid']][_0x1d3d('0x3c')]=!![];agents[_0x41930f[_0x1d3d('0x43')]][_0x1d3d('0x3d')]=_0x1d3d('0x47');agents[_0x41930f[_0x1d3d('0x43')]][_0x1d3d('0x3f')]=_0x41930f['secondtransfererexten'];agents[_0x41930f[_0x1d3d('0x43')]][_0x1d3d('0x41')]=_0x41930f[_0x1d3d('0x46')];}if(_0x41930f[_0x1d3d('0x4e')]&&agents[_0x41930f[_0x1d3d('0x4e')]]){agents[_0x41930f['transfertargetuniqueid']][_0x1d3d('0x49')]=0x1;transfers[_0x41930f[_0x1d3d('0x4e')]]=_[_0x1d3d('0x4a')](agents[_0x41930f['transfertargetuniqueid']]);transfers[_0x41930f[_0x1d3d('0x4e')]]['calleridnum']=agents[_0x41930f[_0x1d3d('0x43')]]['calleridnum'];transfers[_0x41930f[_0x1d3d('0x4e')]][_0x1d3d('0x4b')]=agents[_0x41930f[_0x1d3d('0x43')]]['calleridname'];transfers[_0x41930f[_0x1d3d('0x4e')]][_0x1d3d('0x4c')]=utils[_0x1d3d('0x1a')]();transfers[_0x41930f['transfertargetuniqueid']][_0x1d3d('0x30')]=utils[_0x1d3d('0x1a')]();transfers[_0x41930f[_0x1d3d('0x4e')]]['holdtime']=0x0;transfers[_0x41930f[_0x1d3d('0x4e')]][_0x1d3d('0x49')]=0x2;}}}catch(_0x37667d){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')]('[%s][agents][attendedtransfer]',_0x41930f[_0x1d3d('0x43')]),_0x37667d);}};exports[_0x1d3d('0x4f')]=function(_0x25f4e0){try{utils['debug'](util[_0x1d3d('0x3')](_0x1d3d('0x50'),_0x25f4e0[_0x1d3d('0x5')]),_0x25f4e0);if(agents[_0x25f4e0[_0x1d3d('0x5')]]&&agents[_0x25f4e0[_0x1d3d('0x5')]]['reason']===_0x1d3d('0x22')){if(_0x25f4e0[_0x1d3d('0x51')]==='21'){agents[_0x25f4e0['uniqueid']][_0x1d3d('0x23')]=_0x1d3d('0x52');agents[_0x25f4e0['uniqueid']][_0x1d3d('0xc')]=_0x1d3d('0x52');}utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x25f4e0[_0x1d3d('0x5')],agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x8')],agents[_0x25f4e0[_0x1d3d('0x5')]]['reason'],agents[_0x25f4e0['uniqueid']][_0x1d3d('0xc')]));writeDB(agents[_0x25f4e0[_0x1d3d('0x5')]]);var _0x4604cc=unanswered[_0x1d3d('0x53')](_0x25f4e0[_0x1d3d('0x5')]);if(_0x4604cc>-0x1){unanswered[_0x1d3d('0x54')](_0x4604cc,0x1);}}if(transfers[_0x25f4e0[_0x1d3d('0x5')]]){transfers[_0x25f4e0['uniqueid']][_0x1d3d('0x11')]=!![];transfers[_0x25f4e0[_0x1d3d('0x5')]]['agentcompleteAt']=utils[_0x1d3d('0x1a')]();transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x26')]=utils['diffTime'](transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x36')],transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x30')]);transfers[_0x25f4e0['uniqueid']][_0x1d3d('0x23')]=_0x1d3d('0x55');transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0xc')]='complete';utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x56'),_0x25f4e0['uniqueid'],transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x8')],transfers[_0x25f4e0['uniqueid']][_0x1d3d('0x23')],transfers[_0x25f4e0['uniqueid']][_0x1d3d('0xc')]));writeDB(transfers[_0x25f4e0[_0x1d3d('0x5')]],!![]);}if(agents[_0x25f4e0['uniqueid']]&&agents[_0x25f4e0['uniqueid']][_0x1d3d('0x30')]){agents[_0x25f4e0[_0x1d3d('0x5')]]['agentcomplete']=!![];agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x36')]=utils[_0x1d3d('0x1a')]();agents[_0x25f4e0[_0x1d3d('0x5')]]['talktime']=utils[_0x1d3d('0x37')](agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x36')],agents[_0x25f4e0['uniqueid']][_0x1d3d('0x30')]);agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x23')]=agents[_0x25f4e0['uniqueid']][_0x1d3d('0x3c')]?_0x1d3d('0x3c'):_0x1d3d('0x55');agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0xc')]=_0x1d3d('0x38');utils['info'](util[_0x1d3d('0x3')](_0x1d3d('0x56'),_0x25f4e0['uniqueid'],agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x8')],agents[_0x25f4e0[_0x1d3d('0x5')]]['reason'],agents[_0x25f4e0[_0x1d3d('0x5')]]['lastevent']));writeDB(agents[_0x25f4e0['uniqueid']]);}}catch(_0x49d1e7){utils[_0x1d3d('0x1d')](util['format'](_0x1d3d('0x50'),_0x25f4e0[_0x1d3d('0x5')]),_0x49d1e7);}};
\ No newline at end of file
+var _0xd3d1=['transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','ATTENDED','transfereeuniqueid','agententerreason','clone','calleridname','agentcalledAt','secondtransfererlinkedid','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','util','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','[%s][agents][agentcalled]','now','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','isNil','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','reason','holdtime','ringtime','talktime','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','agentringnoanswer','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','[%s][agents][agentcomplete]','transfereruniqueid','[%s][agents][blindtransfer]','transfer','transfertype','blind','transferexten','extension'];(function(_0x3c77b7,_0x33d55d){var _0x594577=function(_0x37c52b){while(--_0x37c52b){_0x3c77b7['push'](_0x3c77b7['shift']());}};_0x594577(++_0x33d55d);}(_0xd3d1,0x172));var _0x1d3d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd3d1[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1d3d('0x0'));var util=require(_0x1d3d('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x56f01c,_0x2d0605){utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x4'),_0x56f01c[_0x1d3d('0x5')],_0x56f01c[_0x1d3d('0x6')],_0x56f01c[_0x1d3d('0x7')],_0x56f01c[_0x1d3d('0x8')],_0x56f01c[_0x1d3d('0x9')],_0x56f01c[_0x1d3d('0xa')],_0x56f01c[_0x1d3d('0xb')],_0x56f01c[_0x1d3d('0xc')]));if(_0x56f01c[_0x1d3d('0x7')]){utils[_0x1d3d('0xd')](_0x56f01c[_0x1d3d('0x7')])[_0x1d3d('0xe')](function(_0x3683c9){if(_0x3683c9){_0x56f01c['type']=_0x3683c9[_0x1d3d('0xf')];_0x56f01c[_0x1d3d('0x10')]=_0x56f01c[_0x1d3d('0x11')]?_0x3683c9[_0x1d3d('0x12')]:![];_0x56f01c[_0x1d3d('0x13')]=_0x56f01c[_0x1d3d('0x10')]?_0x3683c9[_0x1d3d('0x14')]:0x0;}utils[_0x1d3d('0x15')](_0x1d3d('0x16'),_0x56f01c);});}else{utils[_0x1d3d('0x15')](_0x1d3d('0x16'),_0x56f01c);}if(_0x2d0605){delete transfers[_0x56f01c['uniqueid']];}else{delete agents[_0x56f01c[_0x1d3d('0x17')]];}}exports[_0x1d3d('0x18')]=function(_0x494b82){try{utils['debug'](util[_0x1d3d('0x3')](_0x1d3d('0x19'),_0x494b82[_0x1d3d('0x5')]),_0x494b82);agents[_0x494b82['destuniqueid']]=_0x494b82;agents[_0x494b82[_0x1d3d('0x17')]]['agentcalledAt']=utils[_0x1d3d('0x1a')]();agents[_0x494b82[_0x1d3d('0x17')]][_0x1d3d('0xc')]=_0x1d3d('0x1b');agents[_0x494b82[_0x1d3d('0x17')]][_0x1d3d('0xb')]=null;agents[_0x494b82[_0x1d3d('0x17')]]['connectedlinename']=null;utils['info'](util[_0x1d3d('0x3')](_0x1d3d('0x1c'),_0x494b82['uniqueid'],agents[_0x494b82[_0x1d3d('0x17')]]['membername'],_0x494b82[_0x1d3d('0x17')]));}catch(_0x392e92){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')]('[%s][agents][agentcalled]',_0x494b82[_0x1d3d('0x5')]),_0x392e92);}};exports['agentringnoanswer']=function(_0x56c424){try{if(!_[_0x1d3d('0x1e')](agents[_0x56c424[_0x1d3d('0x17')]])){utils[_0x1d3d('0x1f')](util[_0x1d3d('0x3')](_0x1d3d('0x20'),_0x56c424[_0x1d3d('0x5')]),_0x56c424);utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x21'),_0x56c424[_0x1d3d('0x5')],agents[_0x56c424[_0x1d3d('0x17')]]['membername'],_0x56c424[_0x1d3d('0x17')]));agents[_0x56c424[_0x1d3d('0x17')]]['agentringnoanswer']=!![];agents[_0x56c424[_0x1d3d('0x17')]]['agentringnoanswerAt']=utils[_0x1d3d('0x1a')]();agents[_0x56c424[_0x1d3d('0x17')]][_0x1d3d('0xc')]=_0x1d3d('0x22');agents[_0x56c424[_0x1d3d('0x17')]][_0x1d3d('0x23')]=_0x1d3d('0x22');agents[_0x56c424[_0x1d3d('0x17')]][_0x1d3d('0x24')]=_0x56c424[_0x1d3d('0x25')]?parseInt(_0x56c424[_0x1d3d('0x25')])/0x3e8:0x0;agents[_0x56c424['destuniqueid']][_0x1d3d('0x26')]=0x0;unanswered['push'](_0x56c424[_0x1d3d('0x17')]);}}catch(_0x2bcc2){utils['error'](util[_0x1d3d('0x3')](_0x1d3d('0x20'),_0x56c424[_0x1d3d('0x5')]),_0x2bcc2);}};exports[_0x1d3d('0x27')]=function(_0x4abbfc){try{_[_0x1d3d('0x28')](agents,function(_0x235ef3,_0x5d1b6c){if(_0x235ef3[_0x1d3d('0x5')]==_0x4abbfc['uniqueid']&&!_[_0x1d3d('0x29')](unanswered,_0x235ef3[_0x1d3d('0x17')])){utils['debug'](util[_0x1d3d('0x3')](_0x1d3d('0x2a'),_0x4abbfc[_0x1d3d('0x5')]),_0x4abbfc);utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x2b'),_0x4abbfc[_0x1d3d('0x5')],_0x235ef3[_0x1d3d('0x8')],_0x235ef3[_0x1d3d('0x17')]));_0x235ef3['agentringnoanswer']=!![];_0x235ef3[_0x1d3d('0x2c')]=utils[_0x1d3d('0x1a')]();_0x235ef3[_0x1d3d('0xc')]=_0x1d3d('0x2d');_0x235ef3['reason']='abandoned';_0x235ef3[_0x1d3d('0x24')]=_0x4abbfc[_0x1d3d('0x24')];_0x235ef3['talktime']=0x0;writeDB(_0x235ef3);}});}catch(_0x43ef5d){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')](_0x1d3d('0x2a'),_0x4abbfc['uniqueid']),_0x43ef5d);}};exports['agentconnect']=function(_0x29fa6c){try{if(agents[_0x29fa6c['destuniqueid']]){utils[_0x1d3d('0x1f')](util[_0x1d3d('0x3')](_0x1d3d('0x2e'),_0x29fa6c[_0x1d3d('0x5')]),_0x29fa6c);utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x2f'),_0x29fa6c[_0x1d3d('0x5')],agents[_0x29fa6c['destuniqueid']][_0x1d3d('0x8')],_0x29fa6c['destuniqueid']));agents[_0x29fa6c[_0x1d3d('0x17')]][_0x1d3d('0x30')]=utils['now']();agents[_0x29fa6c[_0x1d3d('0x17')]][_0x1d3d('0xb')]=_0x29fa6c[_0x1d3d('0xb')];agents[_0x29fa6c[_0x1d3d('0x17')]]['connectedlinename']=_0x29fa6c['connectedlinename'];agents[_0x29fa6c[_0x1d3d('0x17')]]['holdtime']=_0x29fa6c[_0x1d3d('0x25')];agents[_0x29fa6c[_0x1d3d('0x17')]]['lastevent']=_0x1d3d('0x31');_[_0x1d3d('0x28')](agents,function(_0x51be79,_0x2d5015){if(_0x51be79[_0x1d3d('0x17')]!=_0x29fa6c[_0x1d3d('0x17')]&&_0x51be79[_0x1d3d('0x5')]==_0x29fa6c[_0x1d3d('0x5')]){_0x51be79[_0x1d3d('0x26')]=0x0;_0x51be79['holdtime']=_0x29fa6c[_0x1d3d('0x25')];_0x51be79[_0x1d3d('0x32')]=!![];_0x51be79[_0x1d3d('0x2c')]=utils[_0x1d3d('0x1a')]();_0x51be79[_0x1d3d('0xc')]='answered_elsewhere';_0x51be79[_0x1d3d('0x23')]=_0x1d3d('0x33');_0x51be79[_0x1d3d('0x34')]=_0x29fa6c[_0x1d3d('0x17')];_0x51be79['answeredelsewheremembername']=_0x29fa6c[_0x1d3d('0x8')];writeDB(_0x51be79);}});}}catch(_0x977ea8){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')](_0x1d3d('0x2e'),_0x29fa6c['uniqueid']),_0x977ea8);}};exports['agentcomplete']=function(_0x229f48){try{if(!_[_0x1d3d('0x1e')](agents[_0x229f48[_0x1d3d('0x17')]])){utils[_0x1d3d('0x1f')](util[_0x1d3d('0x3')]('[%s][agents][agentcomplete]',_0x229f48[_0x1d3d('0x5')]),_0x229f48);utils['info'](util[_0x1d3d('0x3')](_0x1d3d('0x35'),_0x229f48[_0x1d3d('0x5')],agents[_0x229f48[_0x1d3d('0x17')]]['membername'],_0x229f48[_0x1d3d('0x17')]));agents[_0x229f48[_0x1d3d('0x17')]][_0x1d3d('0x11')]=!![];agents[_0x229f48[_0x1d3d('0x17')]][_0x1d3d('0x36')]=utils[_0x1d3d('0x1a')]();agents[_0x229f48[_0x1d3d('0x17')]]['talktime']=utils[_0x1d3d('0x37')](agents[_0x229f48['destuniqueid']][_0x1d3d('0x36')],agents[_0x229f48[_0x1d3d('0x17')]]['agentconnectAt']);agents[_0x229f48[_0x1d3d('0x17')]]['reason']=_0x229f48[_0x1d3d('0x23')];agents[_0x229f48['destuniqueid']][_0x1d3d('0xc')]=_0x1d3d('0x38');writeDB(agents[_0x229f48[_0x1d3d('0x17')]]);}}catch(_0x25b547){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')](_0x1d3d('0x39'),_0x229f48[_0x1d3d('0x5')]),_0x25b547);}};exports['blindtransfer']=function(_0x5899cc){try{if(!_['isNil'](agents[_0x5899cc[_0x1d3d('0x3a')]])){utils[_0x1d3d('0x1f')](util[_0x1d3d('0x3')](_0x1d3d('0x3b'),_0x5899cc[_0x1d3d('0x5')]),_0x5899cc);utils[_0x1d3d('0x2')](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x5899cc['uniqueid'],agents[_0x5899cc['transfereruniqueid']][_0x1d3d('0x8')],agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x5')]));agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x3c')]=!![];agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x3d')]=_0x1d3d('0x3e');agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x3f')]=_0x5899cc[_0x1d3d('0x40')];agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x41')]=agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x5')];}}catch(_0x5ce0d3){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')](_0x1d3d('0x3b'),_0x5899cc[_0x1d3d('0x5')]),_0x5ce0d3);}};exports['attendedtransfer']=function(_0x41930f){try{utils['debug'](util['format'](_0x1d3d('0x42'),_0x41930f[_0x1d3d('0x43')]),_0x41930f);if(_0x41930f['origtransfereruniqueid']==_0x41930f[_0x1d3d('0x44')]){if(!_[_0x1d3d('0x1e')](agents[_0x41930f['secondtransfereruniqueid']])){utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x45'),_0x41930f[_0x1d3d('0x43')],agents[_0x41930f[_0x1d3d('0x46')]][_0x1d3d('0x8')]));agents[_0x41930f[_0x1d3d('0x46')]][_0x1d3d('0x3c')]=!![];agents[_0x41930f[_0x1d3d('0x46')]]['transfertype']=_0x1d3d('0x47');agents[_0x41930f['secondtransfereruniqueid']]['transferexten']=_0x41930f['origtransfererexten'];agents[_0x41930f['secondtransfereruniqueid']][_0x1d3d('0x41')]=_0x41930f[_0x1d3d('0x43')];}if(_0x41930f[_0x1d3d('0x48')]&&agents[_0x41930f[_0x1d3d('0x48')]]){agents[_0x41930f['transfereeuniqueid']][_0x1d3d('0x49')]=0x1;transfers[_0x41930f['transfereeuniqueid']]=_[_0x1d3d('0x4a')](agents[_0x41930f[_0x1d3d('0x48')]]);transfers[_0x41930f['transfereeuniqueid']][_0x1d3d('0xa')]=agents[_0x41930f[_0x1d3d('0x46')]]['calleridnum'];transfers[_0x41930f[_0x1d3d('0x48')]][_0x1d3d('0x4b')]=agents[_0x41930f[_0x1d3d('0x46')]][_0x1d3d('0x4b')];transfers[_0x41930f[_0x1d3d('0x48')]][_0x1d3d('0x4c')]=utils['now']();transfers[_0x41930f[_0x1d3d('0x48')]][_0x1d3d('0x30')]=utils[_0x1d3d('0x1a')]();transfers[_0x41930f[_0x1d3d('0x48')]][_0x1d3d('0x24')]=0x0;transfers[_0x41930f['transfereeuniqueid']][_0x1d3d('0x49')]=0x2;}}else if(_0x41930f['secondtransfereruniqueid']==_0x41930f[_0x1d3d('0x4d')]){if(!_['isNil'](agents[_0x41930f[_0x1d3d('0x43')]])){utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x45'),_0x41930f[_0x1d3d('0x43')],agents[_0x41930f[_0x1d3d('0x43')]][_0x1d3d('0x8')]));agents[_0x41930f['origtransfereruniqueid']][_0x1d3d('0x3c')]=!![];agents[_0x41930f[_0x1d3d('0x43')]][_0x1d3d('0x3d')]=_0x1d3d('0x47');agents[_0x41930f[_0x1d3d('0x43')]][_0x1d3d('0x3f')]=_0x41930f['secondtransfererexten'];agents[_0x41930f[_0x1d3d('0x43')]][_0x1d3d('0x41')]=_0x41930f[_0x1d3d('0x46')];}if(_0x41930f[_0x1d3d('0x4e')]&&agents[_0x41930f[_0x1d3d('0x4e')]]){agents[_0x41930f['transfertargetuniqueid']][_0x1d3d('0x49')]=0x1;transfers[_0x41930f[_0x1d3d('0x4e')]]=_[_0x1d3d('0x4a')](agents[_0x41930f['transfertargetuniqueid']]);transfers[_0x41930f[_0x1d3d('0x4e')]]['calleridnum']=agents[_0x41930f[_0x1d3d('0x43')]]['calleridnum'];transfers[_0x41930f[_0x1d3d('0x4e')]][_0x1d3d('0x4b')]=agents[_0x41930f[_0x1d3d('0x43')]]['calleridname'];transfers[_0x41930f[_0x1d3d('0x4e')]][_0x1d3d('0x4c')]=utils[_0x1d3d('0x1a')]();transfers[_0x41930f['transfertargetuniqueid']][_0x1d3d('0x30')]=utils[_0x1d3d('0x1a')]();transfers[_0x41930f[_0x1d3d('0x4e')]]['holdtime']=0x0;transfers[_0x41930f[_0x1d3d('0x4e')]][_0x1d3d('0x49')]=0x2;}}}catch(_0x37667d){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')]('[%s][agents][attendedtransfer]',_0x41930f[_0x1d3d('0x43')]),_0x37667d);}};exports[_0x1d3d('0x4f')]=function(_0x25f4e0){try{utils['debug'](util[_0x1d3d('0x3')](_0x1d3d('0x50'),_0x25f4e0[_0x1d3d('0x5')]),_0x25f4e0);if(agents[_0x25f4e0[_0x1d3d('0x5')]]&&agents[_0x25f4e0[_0x1d3d('0x5')]]['reason']===_0x1d3d('0x22')){if(_0x25f4e0[_0x1d3d('0x51')]==='21'){agents[_0x25f4e0['uniqueid']][_0x1d3d('0x23')]=_0x1d3d('0x52');agents[_0x25f4e0['uniqueid']][_0x1d3d('0xc')]=_0x1d3d('0x52');}utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x25f4e0[_0x1d3d('0x5')],agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x8')],agents[_0x25f4e0[_0x1d3d('0x5')]]['reason'],agents[_0x25f4e0['uniqueid']][_0x1d3d('0xc')]));writeDB(agents[_0x25f4e0[_0x1d3d('0x5')]]);var _0x4604cc=unanswered[_0x1d3d('0x53')](_0x25f4e0[_0x1d3d('0x5')]);if(_0x4604cc>-0x1){unanswered[_0x1d3d('0x54')](_0x4604cc,0x1);}}if(transfers[_0x25f4e0[_0x1d3d('0x5')]]){transfers[_0x25f4e0['uniqueid']][_0x1d3d('0x11')]=!![];transfers[_0x25f4e0[_0x1d3d('0x5')]]['agentcompleteAt']=utils[_0x1d3d('0x1a')]();transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x26')]=utils['diffTime'](transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x36')],transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x30')]);transfers[_0x25f4e0['uniqueid']][_0x1d3d('0x23')]=_0x1d3d('0x55');transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0xc')]='complete';utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x56'),_0x25f4e0['uniqueid'],transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x8')],transfers[_0x25f4e0['uniqueid']][_0x1d3d('0x23')],transfers[_0x25f4e0['uniqueid']][_0x1d3d('0xc')]));writeDB(transfers[_0x25f4e0[_0x1d3d('0x5')]],!![]);}if(agents[_0x25f4e0['uniqueid']]&&agents[_0x25f4e0['uniqueid']][_0x1d3d('0x30')]){agents[_0x25f4e0[_0x1d3d('0x5')]]['agentcomplete']=!![];agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x36')]=utils[_0x1d3d('0x1a')]();agents[_0x25f4e0[_0x1d3d('0x5')]]['talktime']=utils[_0x1d3d('0x37')](agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x36')],agents[_0x25f4e0['uniqueid']][_0x1d3d('0x30')]);agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x23')]=agents[_0x25f4e0['uniqueid']][_0x1d3d('0x3c')]?_0x1d3d('0x3c'):_0x1d3d('0x55');agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0xc')]=_0x1d3d('0x38');utils['info'](util[_0x1d3d('0x3')](_0x1d3d('0x56'),_0x25f4e0['uniqueid'],agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x8')],agents[_0x25f4e0[_0x1d3d('0x5')]]['reason'],agents[_0x25f4e0[_0x1d3d('0x5')]]['lastevent']));writeDB(agents[_0x25f4e0['uniqueid']]);}}catch(_0x49d1e7){utils[_0x1d3d('0x1d')](util['format'](_0x1d3d('0x50'),_0x25f4e0[_0x1d3d('0x5')]),_0x49d1e7);}};
\ No newline at end of file
index 055ae56..34b4f35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9aa=['[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','answertime','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','destinationchannel','_attended','transfertargetchannel','origtransfererchannel','userfield','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','variable','xmd-originatecalleridnum','source','value','xmd-phone','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','appdata','cdr','split','substring','lastIndexOf','includes','noop','execif','set','gotoif','lodash','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','UserId','CreateVoiceCallReport','request','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','newstate','debug','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','disposition','toNumber','error','[%s][calls][newstate]','hangup','[%s][calls][hangup]','callerid'];(function(_0x508911,_0x54c10f){var _0x220e7f=function(_0x200dbd){while(--_0x200dbd){_0x508911['push'](_0x508911['shift']());}};_0x220e7f(++_0x54c10f);}(_0xa9aa,0xb2));var _0xaa9a=function(_0x6a579b,_0x3d8402){_0x6a579b=_0x6a579b-0x0;var _0x26f917=_0xa9aa[_0x6a579b];return _0x26f917;};'use strict';var _=require(_0xaa9a('0x0'));var util=require('util');var utils=require(_0xaa9a('0x1'));var transfers=require(_0xaa9a('0x2'));var dispositions=[_0xaa9a('0x3'),_0xaa9a('0x4'),'FAILED',_0xaa9a('0x3'),'NO\x20ANSWER','NO\x20ANSWER',_0xaa9a('0x5'),_0xaa9a('0x6'),_0xaa9a('0x4'),_0xaa9a('0x4'),_0xaa9a('0x4')];var channels={};function writeDB(_0xe98f2f){var _0x537607;if(transfers[_0xaa9a('0x7')][_0xe98f2f[_0xaa9a('0x8')]]){_0x537607=_0xe98f2f['uniqueid'];_0xe98f2f[_0xaa9a('0x8')]=transfers[_0xaa9a('0x7')][_0xe98f2f[_0xaa9a('0x8')]]['transfereeuniqueid'];}utils['info'](util[_0xaa9a('0x9')](_0xaa9a('0xa'),_0xe98f2f[_0xaa9a('0x8')],_0xe98f2f[_0xaa9a('0xb')],_0xe98f2f['queue'],_0xe98f2f[_0xaa9a('0xc')],_0xe98f2f[_0xaa9a('0xd')],_0xe98f2f[_0xaa9a('0xe')],_0xe98f2f[_0xaa9a('0xf')],_0xe98f2f[_0xaa9a('0x10')]));if(_0xe98f2f[_0xaa9a('0x11')]){utils[_0xaa9a('0x12')](_0xe98f2f[_0xaa9a('0x11')])['then'](function(_0x37f686){if(_0x37f686){_0xe98f2f[_0xaa9a('0x13')]=_0x37f686['id'];}utils['request'](_0xaa9a('0x14'),_0xe98f2f);});}else{utils[_0xaa9a('0x15')](_0xaa9a('0x14'),_0xe98f2f);}if(channels[_0xe98f2f[_0xaa9a('0x8')]]){delete channels[_0xe98f2f['uniqueid']];}else if(_0x537607&&channels[_0x537607]){delete transfers['blinds'][_0x537607];delete channels[_0x537607];}}exports['newchannel']=function(_0x39d0dc){try{utils['debug'](util['format'](_0xaa9a('0x16'),_0x39d0dc[_0xaa9a('0x8')]),_0x39d0dc);if(_0x39d0dc['uniqueid']==_0x39d0dc[_0xaa9a('0x17')]&&_0x39d0dc[_0xaa9a('0xb')]!=_0xaa9a('0x18')){utils[_0xaa9a('0x19')](util[_0xaa9a('0x9')](_0xaa9a('0x1a'),_0x39d0dc[_0xaa9a('0x8')],_0x39d0dc[_0xaa9a('0x1b')],_0x39d0dc[_0xaa9a('0x1c')]));channels[_0x39d0dc[_0xaa9a('0x8')]]={'uniqueid':_0x39d0dc[_0xaa9a('0x8')],'accountcode':_0x39d0dc['accountcode'],'source':_0x39d0dc[_0xaa9a('0xe')],'destination':_0x39d0dc['exten'],'destinationcontext':_0x39d0dc[_0xaa9a('0x1b')],'channel':_0x39d0dc[_0xaa9a('0xb')],'starttime':utils[_0xaa9a('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xaa9a('0x3'),'amaflags':_0xaa9a('0x1e')};}}catch(_0x5c8a1a){utils['error'](util[_0xaa9a('0x9')](_0xaa9a('0x16'),_0x39d0dc[_0xaa9a('0x8')]),_0x5c8a1a);}};exports[_0xaa9a('0x1f')]=function(_0x36923f){try{utils[_0xaa9a('0x20')](util[_0xaa9a('0x9')]('[%s][calls][newstate]',_0x36923f[_0xaa9a('0x8')]),_0x36923f);if(!_[_0xaa9a('0x21')](channels[_0x36923f[_0xaa9a('0x8')]])&&_0x36923f[_0xaa9a('0x22')]==0x6){utils[_0xaa9a('0x19')](util[_0xaa9a('0x9')](_0xaa9a('0x23'),_0x36923f[_0xaa9a('0x8')],_0x36923f['context'],_0x36923f[_0xaa9a('0xb')]));if(_['isNil'](channels[_0x36923f['uniqueid']][_0xaa9a('0x24')])){channels[_0x36923f[_0xaa9a('0x8')]]['systemanswertime']=utils[_0xaa9a('0x1d')]();}}else if(!_[_0xaa9a('0x21')](channels[_0x36923f[_0xaa9a('0x17')]])&&_0x36923f['channelstate']==0x6&&_0x36923f['context']!=_0xaa9a('0x25')){utils[_0xaa9a('0x19')](util[_0xaa9a('0x9')](_0xaa9a('0x26'),_0x36923f[_0xaa9a('0x8')],_0x36923f['linkedid'],_0x36923f[_0xaa9a('0x1b')],_0x36923f['channel']));channels[_0x36923f[_0xaa9a('0x17')]][_0xaa9a('0x11')]=_0x36923f[_0xaa9a('0x11')];channels[_0x36923f[_0xaa9a('0x17')]]['destinationchannel']=_0x36923f[_0xaa9a('0xb')];if(_['isNil'](channels[_0x36923f[_0xaa9a('0x17')]]['answertime'])){channels[_0x36923f[_0xaa9a('0x17')]]['answertime']=utils['now']();}channels[_0x36923f[_0xaa9a('0x17')]][_0xaa9a('0x27')]=dispositions[_[_0xaa9a('0x28')](_0x36923f[_0xaa9a('0x22')])]||_0xaa9a('0x5');}}catch(_0x1b8b19){utils[_0xaa9a('0x29')](util[_0xaa9a('0x9')](_0xaa9a('0x2a'),_0x36923f['uniqueid']),_0x1b8b19);}};exports[_0xaa9a('0x2b')]=function(_0x502542){try{if(!_[_0xaa9a('0x21')](channels[_0x502542['uniqueid']])){utils[_0xaa9a('0x20')](util['format'](_0xaa9a('0x2c'),_0x502542[_0xaa9a('0x8')]),_0x502542);if(_[_0xaa9a('0x21')](channels[_0x502542[_0xaa9a('0x8')]]['callerid'])){channels[_0x502542[_0xaa9a('0x8')]][_0xaa9a('0x2d')]=_0x502542['calleridname']+'\x20<'+_0x502542[_0xaa9a('0xe')]+'>';}utils[_0xaa9a('0x19')](util[_0xaa9a('0x9')](_0xaa9a('0x2e'),_0x502542[_0xaa9a('0x8')],channels[_0x502542[_0xaa9a('0x8')]][_0xaa9a('0x2d')],_0x502542[_0xaa9a('0x2f')]));channels[_0x502542['uniqueid']][_0xaa9a('0x30')]=utils[_0xaa9a('0x1d')]();channels[_0x502542[_0xaa9a('0x8')]][_0xaa9a('0x31')]=utils[_0xaa9a('0x32')](channels[_0x502542[_0xaa9a('0x8')]][_0xaa9a('0x30')],channels[_0x502542['uniqueid']][_0xaa9a('0x33')]);channels[_0x502542[_0xaa9a('0x8')]][_0xaa9a('0x34')]=channels[_0x502542[_0xaa9a('0x8')]]['answertime']?utils[_0xaa9a('0x32')](channels[_0x502542[_0xaa9a('0x8')]][_0xaa9a('0x30')],channels[_0x502542[_0xaa9a('0x8')]][_0xaa9a('0x35')]):0x0;writeDB(channels[_0x502542[_0xaa9a('0x8')]]);}}catch(_0x323c0d){utils['error'](util['format']('[%s][calls][hangup]',_0x502542['uniqueid']),_0x323c0d);}};exports['attendedtransfer']=function(_0x4d8db3){try{if(!_[_0xaa9a('0x21')](channels[_0x4d8db3[_0xaa9a('0x36')]])){utils[_0xaa9a('0x20')](util[_0xaa9a('0x9')](_0xaa9a('0x37'),_0x4d8db3[_0xaa9a('0x38')]),_0x4d8db3);if(channels[_0x4d8db3['localtwolinkedid']][_0xaa9a('0xb')]==_0x4d8db3['transfereechannel']){utils[_0xaa9a('0x19')](util[_0xaa9a('0x9')](_0xaa9a('0x39'),_0x4d8db3['origtransfereruniqueid'],_0x4d8db3[_0xaa9a('0x36')],_0x4d8db3[_0xaa9a('0x3a')]));channels[_0x4d8db3['localtwolinkedid']][_0xaa9a('0x3b')]=_0x4d8db3['secondtransfererchannel'];channels[_0x4d8db3['localtwolinkedid']]['userfield']=_0xaa9a('0x3c');}else if(channels[_0x4d8db3['localtwolinkedid']]['channel']=_0x4d8db3[_0xaa9a('0x3d')]){utils[_0xaa9a('0x19')](util['format'](_0xaa9a('0x39'),_0x4d8db3[_0xaa9a('0x38')],_0x4d8db3['localtwolinkedid'],_0x4d8db3[_0xaa9a('0x3e')]));channels[_0x4d8db3[_0xaa9a('0x36')]]['destinationchannel']=_0x4d8db3[_0xaa9a('0x3e')];channels[_0x4d8db3['localtwolinkedid']][_0xaa9a('0x3f')]='_attended';}}}catch(_0x521a55){utils[_0xaa9a('0x29')](util[_0xaa9a('0x9')](_0xaa9a('0x37'),_0x4d8db3[_0xaa9a('0x38')]),_0x521a55);}};exports['musiconholdstart']=function(_0x591840){try{if(!_[_0xaa9a('0x21')](channels[_0x591840['uniqueid']])){utils['debug'](util[_0xaa9a('0x9')](_0xaa9a('0x40'),_0x591840[_0xaa9a('0x8')]),_0x591840);channels[_0x591840[_0xaa9a('0x8')]][_0xaa9a('0x41')]=utils[_0xaa9a('0x1d')]();utils[_0xaa9a('0x19')](util['format'](_0xaa9a('0x42'),_0x591840[_0xaa9a('0x8')],channels[_0x591840[_0xaa9a('0x8')]]['musiconholdstartAt']));}}catch(_0x3a7a92){utils[_0xaa9a('0x29')](util['format'](_0xaa9a('0x40'),_0x591840['uniqueid']),_0x3a7a92);}};exports[_0xaa9a('0x43')]=function(_0x286d29){try{if(!_[_0xaa9a('0x21')](channels[_0x286d29['uniqueid']])){utils[_0xaa9a('0x20')](util[_0xaa9a('0x9')](_0xaa9a('0x44'),_0x286d29[_0xaa9a('0x8')]),_0x286d29);if(!_[_0xaa9a('0x21')](channels[_0x286d29[_0xaa9a('0x8')]][_0xaa9a('0x41')])){channels[_0x286d29[_0xaa9a('0x8')]][_0xaa9a('0x45')]+=utils['diffTime'](utils[_0xaa9a('0x1d')](),channels[_0x286d29['uniqueid']]['musiconholdstartAt']);utils[_0xaa9a('0x19')](util['format'](_0xaa9a('0x46'),_0x286d29[_0xaa9a('0x8')],channels[_0x286d29[_0xaa9a('0x8')]]['mohtime']));delete channels[_0x286d29[_0xaa9a('0x8')]]['musiconholdstartAt'];}}}catch(_0x5b7f9d){utils[_0xaa9a('0x29')](util[_0xaa9a('0x9')](_0xaa9a('0x44'),_0x286d29[_0xaa9a('0x8')]),_0x5b7f9d);}};exports[_0xaa9a('0x47')]=function(_0x510264){try{if(!_[_0xaa9a('0x21')](channels[_0x510264[_0xaa9a('0x8')]])){utils[_0xaa9a('0x20')](util[_0xaa9a('0x9')]('[%s][calls][varset]',_0x510264[_0xaa9a('0x8')]),_0x510264);if(!_[_0xaa9a('0x21')](_0x510264[_0xaa9a('0x48')][_0xaa9a('0x49')])){utils[_0xaa9a('0x19')](util['format']('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x510264[_0xaa9a('0x8')],_0x510264['value']));channels[_0x510264[_0xaa9a('0x8')]][_0xaa9a('0x4a')]=_0x510264[_0xaa9a('0x4b')];}if(!_[_0xaa9a('0x21')](_0x510264[_0xaa9a('0x48')][_0xaa9a('0x4c')])){utils[_0xaa9a('0x19')](util[_0xaa9a('0x9')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x510264['uniqueid'],_0x510264[_0xaa9a('0x4b')]));channels[_0x510264[_0xaa9a('0x8')]][_0xaa9a('0x4d')]=_0x510264[_0xaa9a('0x4b')];channels[_0x510264[_0xaa9a('0x8')]]['callerid']='\x22'+_0x510264[_0xaa9a('0x4b')]+_0xaa9a('0x4e')+_0x510264[_0xaa9a('0x4b')]+'>';}if(!_['isNil'](_0x510264[_0xaa9a('0x48')][_0xaa9a('0x4f')])||!_[_0xaa9a('0x21')](_0x510264[_0xaa9a('0x48')][_0xaa9a('0x50')])){utils['info'](util['format'](_0xaa9a('0x51'),_0x510264[_0xaa9a('0x8')],!_[_0xaa9a('0x21')](_0x510264[_0xaa9a('0x48')]['xmd-callerid-preview'])?_0xaa9a('0x4f'):_0xaa9a('0x50'),_0x510264['value']));channels[_0x510264['uniqueid']][_0xaa9a('0x2d')]=_0x510264[_0xaa9a('0x4b')];}if(!_[_0xaa9a('0x21')](_0x510264[_0xaa9a('0x48')][_0xaa9a('0x52')])||!_['isNil'](_0x510264[_0xaa9a('0x48')][_0xaa9a('0x53')])){utils['info'](util['format'](_0xaa9a('0x51'),_0x510264[_0xaa9a('0x8')],!_[_0xaa9a('0x21')](_0x510264[_0xaa9a('0x48')]['xmd-queue'])?_0xaa9a('0x52'):'xmcs-queue',_0x510264[_0xaa9a('0x4b')]));channels[_0x510264[_0xaa9a('0x8')]][_0xaa9a('0x54')]=_0xaa9a('0x55');channels[_0x510264[_0xaa9a('0x8')]][_0xaa9a('0x56')]=_0x510264[_0xaa9a('0x4b')];channels[_0x510264[_0xaa9a('0x8')]][_0xaa9a('0x57')]=!![];}if(!_[_0xaa9a('0x21')](_0x510264[_0xaa9a('0x48')][_0xaa9a('0x58')])){utils[_0xaa9a('0x19')](util[_0xaa9a('0x9')](_0xaa9a('0x59'),_0x510264[_0xaa9a('0x8')],_0x510264['value']));channels[_0x510264['uniqueid']][_0xaa9a('0x5a')]=_0x510264[_0xaa9a('0x4b')];}if(!_[_0xaa9a('0x21')](_0x510264['variable'][_0xaa9a('0x5b')])){utils[_0xaa9a('0x19')](util[_0xaa9a('0x9')](_0xaa9a('0x5c'),_0x510264[_0xaa9a('0x8')],_0x510264['value']));channels[_0x510264[_0xaa9a('0x8')]][_0xaa9a('0x5d')]=_0x510264[_0xaa9a('0x4b')];}if(!_[_0xaa9a('0x21')](_0x510264['variable'][_0xaa9a('0x5e')])){utils[_0xaa9a('0x19')](util[_0xaa9a('0x9')](_0xaa9a('0x5f'),_0x510264[_0xaa9a('0x8')],_0x510264[_0xaa9a('0x4b')]));channels[_0x510264[_0xaa9a('0x8')]]['routeid']=_0x510264[_0xaa9a('0x4b')];}if(!_['isNil'](_0x510264[_0xaa9a('0x48')]['sipcallid'])){utils[_0xaa9a('0x19')](util['format']('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x510264['uniqueid'],_0x510264[_0xaa9a('0x4b')]));channels[_0x510264[_0xaa9a('0x8')]][_0xaa9a('0x60')]=_0x510264[_0xaa9a('0x4b')];}}}catch(_0x2a99d5){utils[_0xaa9a('0x29')](util['format']('[%s][calls][varset]',_0x510264[_0xaa9a('0x8')]),_0x2a99d5);}};exports[_0xaa9a('0x61')]=function(_0x2f7253){try{if(!_['isNil'](channels[_0x2f7253[_0xaa9a('0x8')]])){utils[_0xaa9a('0x20')](util[_0xaa9a('0x9')](_0xaa9a('0x62'),_0x2f7253[_0xaa9a('0x8')]),_0x2f7253);utils[_0xaa9a('0x19')](util[_0xaa9a('0x9')](_0xaa9a('0x63'),_0x2f7253[_0xaa9a('0x8')],_0x2f7253[_0xaa9a('0x64')],_0x2f7253['appdata']));if(_0x2f7253['application'][_0xaa9a('0x65')]()=='set'&&_['startsWith'](_0x2f7253[_0xaa9a('0x66')][_0xaa9a('0x65')](),_0xaa9a('0x67'))){var _0x224f99=_0x2f7253[_0xaa9a('0x66')][_0xaa9a('0x68')]('=');var _0xa6b81a=_0x224f99[0x0][_0xaa9a('0x69')](_0x224f99[0x0][_0xaa9a('0x6a')]('(')+0x1,_0x224f99[0x0]['lastIndexOf'](')'));var _0x3c5ff2=_0x224f99[0x1];channels[_0x2f7253[_0xaa9a('0x8')]][_0xa6b81a]=_0x3c5ff2;}if(!_[_0xaa9a('0x6b')]([_0xaa9a('0x2b'),_0xaa9a('0x6c'),_0xaa9a('0x6d'),_0xaa9a('0x6e'),_0xaa9a('0x6f')],_0x2f7253[_0xaa9a('0x64')][_0xaa9a('0x65')]())){channels[_0x2f7253[_0xaa9a('0x8')]]['lastapplication']=_0x2f7253[_0xaa9a('0x64')];channels[_0x2f7253['uniqueid']][_0xaa9a('0x56')]=_0x2f7253['appdata'];}}}catch(_0x26c97a){utils[_0xaa9a('0x29')](util['format'](_0xaa9a('0x62'),_0x2f7253['uniqueid']),_0x26c97a);}};
\ No newline at end of file
+var _0xa085=['[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','substring','lastIndexOf','includes','noop','execif','gotoif','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','interface','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','debug','linkedid','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','now','error','[%s][calls][newchannel]','newstate','[%s][calls][newstate]','isNil','channelstate','systemanswertime','transfer','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','calleridnum','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','callerid','cause-txt','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','[%s][calls][attendedtransfer]','localtwolinkedid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','origtransfererchannel','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','musiconholdstartAt','mohtime','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','value','source','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid'];(function(_0x37e799,_0x32625f){var _0x436718=function(_0x3e28a9){while(--_0x3e28a9){_0x37e799['push'](_0x37e799['shift']());}};_0x436718(++_0x32625f);}(_0xa085,0x79));var _0x5a08=function(_0x24e09a,_0x2b7371){_0x24e09a=_0x24e09a-0x0;var _0x42ea15=_0xa085[_0x24e09a];return _0x42ea15;};'use strict';var _=require(_0x5a08('0x0'));var util=require(_0x5a08('0x1'));var utils=require(_0x5a08('0x2'));var transfers=require(_0x5a08('0x3'));var dispositions=[_0x5a08('0x4'),_0x5a08('0x5'),'FAILED',_0x5a08('0x4'),_0x5a08('0x4'),'NO\x20ANSWER',_0x5a08('0x6'),_0x5a08('0x7'),_0x5a08('0x5'),'FAILED','FAILED'];var channels={};function writeDB(_0x37ebe8){var _0x5dfb40;if(transfers[_0x5a08('0x8')][_0x37ebe8[_0x5a08('0x9')]]){_0x5dfb40=_0x37ebe8[_0x5a08('0x9')];_0x37ebe8[_0x5a08('0x9')]=transfers[_0x5a08('0x8')][_0x37ebe8['uniqueid']][_0x5a08('0xa')];}utils['info'](util[_0x5a08('0xb')](_0x5a08('0xc'),_0x37ebe8[_0x5a08('0x9')],_0x37ebe8[_0x5a08('0xd')],_0x37ebe8[_0x5a08('0xe')],_0x37ebe8['membername'],_0x37ebe8[_0x5a08('0xf')],_0x37ebe8['calleridnum'],_0x37ebe8[_0x5a08('0x10')],_0x37ebe8[_0x5a08('0x11')]));if(_0x37ebe8[_0x5a08('0x12')]){utils[_0x5a08('0x13')](_0x37ebe8[_0x5a08('0x12')])[_0x5a08('0x14')](function(_0x215d18){if(_0x215d18){_0x37ebe8[_0x5a08('0x15')]=_0x215d18['id'];}utils[_0x5a08('0x16')](_0x5a08('0x17'),_0x37ebe8);});}else{utils[_0x5a08('0x16')](_0x5a08('0x17'),_0x37ebe8);}if(channels[_0x37ebe8[_0x5a08('0x9')]]){delete channels[_0x37ebe8[_0x5a08('0x9')]];}else if(_0x5dfb40&&channels[_0x5dfb40]){delete transfers['blinds'][_0x5dfb40];delete channels[_0x5dfb40];}}exports['newchannel']=function(_0x3fd2fc){try{utils[_0x5a08('0x18')](util['format']('[%s][calls][newchannel]',_0x3fd2fc[_0x5a08('0x9')]),_0x3fd2fc);if(_0x3fd2fc[_0x5a08('0x9')]==_0x3fd2fc[_0x5a08('0x19')]&&_0x3fd2fc['channel']!='OutgoingSpoolFailed'){utils[_0x5a08('0x1a')](util['format'](_0x5a08('0x1b'),_0x3fd2fc['uniqueid'],_0x3fd2fc['context'],_0x3fd2fc[_0x5a08('0x1c')]));channels[_0x3fd2fc['uniqueid']]={'uniqueid':_0x3fd2fc[_0x5a08('0x9')],'accountcode':_0x3fd2fc[_0x5a08('0x12')],'source':_0x3fd2fc['calleridnum'],'destination':_0x3fd2fc[_0x5a08('0x1c')],'destinationcontext':_0x3fd2fc[_0x5a08('0x1d')],'channel':_0x3fd2fc[_0x5a08('0xd')],'starttime':utils[_0x5a08('0x1e')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x5a08('0x4'),'amaflags':'DOCUMENTATION'};}}catch(_0x56d8ee){utils[_0x5a08('0x1f')](util[_0x5a08('0xb')](_0x5a08('0x20'),_0x3fd2fc[_0x5a08('0x9')]),_0x56d8ee);}};exports[_0x5a08('0x21')]=function(_0x1e087c){try{utils[_0x5a08('0x18')](util[_0x5a08('0xb')](_0x5a08('0x22'),_0x1e087c[_0x5a08('0x9')]),_0x1e087c);if(!_[_0x5a08('0x23')](channels[_0x1e087c[_0x5a08('0x9')]])&&_0x1e087c[_0x5a08('0x24')]==0x6){utils[_0x5a08('0x1a')](util[_0x5a08('0xb')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x1e087c[_0x5a08('0x9')],_0x1e087c['context'],_0x1e087c[_0x5a08('0xd')]));if(_['isNil'](channels[_0x1e087c['uniqueid']][_0x5a08('0x25')])){channels[_0x1e087c[_0x5a08('0x9')]]['systemanswertime']=utils[_0x5a08('0x1e')]();}}else if(!_[_0x5a08('0x23')](channels[_0x1e087c[_0x5a08('0x19')]])&&_0x1e087c[_0x5a08('0x24')]==0x6&&_0x1e087c[_0x5a08('0x1d')]!=_0x5a08('0x26')){utils[_0x5a08('0x1a')](util[_0x5a08('0xb')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x1e087c[_0x5a08('0x9')],_0x1e087c['linkedid'],_0x1e087c['context'],_0x1e087c[_0x5a08('0xd')]));channels[_0x1e087c[_0x5a08('0x19')]]['accountcode']=_0x1e087c[_0x5a08('0x12')];channels[_0x1e087c['linkedid']][_0x5a08('0x27')]=_0x1e087c[_0x5a08('0xd')];if(_[_0x5a08('0x23')](channels[_0x1e087c[_0x5a08('0x19')]][_0x5a08('0x28')])){channels[_0x1e087c[_0x5a08('0x19')]][_0x5a08('0x28')]=utils[_0x5a08('0x1e')]();}channels[_0x1e087c[_0x5a08('0x19')]][_0x5a08('0x29')]=dispositions[_[_0x5a08('0x2a')](_0x1e087c['channelstate'])]||_0x5a08('0x6');}}catch(_0x47a807){utils[_0x5a08('0x1f')](util[_0x5a08('0xb')](_0x5a08('0x22'),_0x1e087c[_0x5a08('0x9')]),_0x47a807);}};exports[_0x5a08('0x2b')]=function(_0x30ab71){try{if(!_['isNil'](channels[_0x30ab71[_0x5a08('0x9')]])){utils[_0x5a08('0x18')](util[_0x5a08('0xb')](_0x5a08('0x2c'),_0x30ab71[_0x5a08('0x9')]),_0x30ab71);if(_['isNil'](channels[_0x30ab71[_0x5a08('0x9')]]['callerid'])){channels[_0x30ab71[_0x5a08('0x9')]]['callerid']=_0x30ab71['calleridname']+'\x20<'+_0x30ab71[_0x5a08('0x2d')]+'>';}utils['info'](util[_0x5a08('0xb')](_0x5a08('0x2e'),_0x30ab71[_0x5a08('0x9')],channels[_0x30ab71['uniqueid']][_0x5a08('0x2f')],_0x30ab71[_0x5a08('0x30')]));channels[_0x30ab71[_0x5a08('0x9')]][_0x5a08('0x31')]=utils[_0x5a08('0x1e')]();channels[_0x30ab71[_0x5a08('0x9')]][_0x5a08('0x32')]=utils[_0x5a08('0x33')](channels[_0x30ab71['uniqueid']][_0x5a08('0x31')],channels[_0x30ab71[_0x5a08('0x9')]][_0x5a08('0x34')]);channels[_0x30ab71['uniqueid']][_0x5a08('0x35')]=channels[_0x30ab71[_0x5a08('0x9')]]['answertime']?utils['diffTime'](channels[_0x30ab71[_0x5a08('0x9')]][_0x5a08('0x31')],channels[_0x30ab71[_0x5a08('0x9')]][_0x5a08('0x28')]):0x0;writeDB(channels[_0x30ab71[_0x5a08('0x9')]]);}}catch(_0xf7c928){utils[_0x5a08('0x1f')](util['format'](_0x5a08('0x2c'),_0x30ab71[_0x5a08('0x9')]),_0xf7c928);}};exports[_0x5a08('0x36')]=function(_0x2e4c1d){try{if(!_[_0x5a08('0x23')](channels[_0x2e4c1d['localtwolinkedid']])){utils[_0x5a08('0x18')](util[_0x5a08('0xb')](_0x5a08('0x37'),_0x2e4c1d['origtransfereruniqueid']),_0x2e4c1d);if(channels[_0x2e4c1d[_0x5a08('0x38')]]['channel']==_0x2e4c1d['transfereechannel']){utils[_0x5a08('0x1a')](util[_0x5a08('0xb')](_0x5a08('0x39'),_0x2e4c1d[_0x5a08('0x3a')],_0x2e4c1d[_0x5a08('0x38')],_0x2e4c1d['secondtransfererchannel']));channels[_0x2e4c1d[_0x5a08('0x38')]][_0x5a08('0x27')]=_0x2e4c1d[_0x5a08('0x3b')];channels[_0x2e4c1d[_0x5a08('0x38')]][_0x5a08('0x3c')]=_0x5a08('0x3d');}else if(channels[_0x2e4c1d[_0x5a08('0x38')]][_0x5a08('0xd')]=_0x2e4c1d['transfertargetchannel']){utils['info'](util[_0x5a08('0xb')](_0x5a08('0x39'),_0x2e4c1d[_0x5a08('0x3a')],_0x2e4c1d[_0x5a08('0x38')],_0x2e4c1d['origtransfererchannel']));channels[_0x2e4c1d[_0x5a08('0x38')]][_0x5a08('0x27')]=_0x2e4c1d[_0x5a08('0x3e')];channels[_0x2e4c1d[_0x5a08('0x38')]][_0x5a08('0x3c')]='_attended';}}}catch(_0x5e49a2){utils[_0x5a08('0x1f')](util[_0x5a08('0xb')](_0x5a08('0x37'),_0x2e4c1d[_0x5a08('0x3a')]),_0x5e49a2);}};exports['musiconholdstart']=function(_0x5936de){try{if(!_[_0x5a08('0x23')](channels[_0x5936de['uniqueid']])){utils[_0x5a08('0x18')](util[_0x5a08('0xb')](_0x5a08('0x3f'),_0x5936de[_0x5a08('0x9')]),_0x5936de);channels[_0x5936de['uniqueid']]['musiconholdstartAt']=utils[_0x5a08('0x1e')]();utils[_0x5a08('0x1a')](util[_0x5a08('0xb')](_0x5a08('0x40'),_0x5936de['uniqueid'],channels[_0x5936de[_0x5a08('0x9')]]['musiconholdstartAt']));}}catch(_0x196b33){utils[_0x5a08('0x1f')](util[_0x5a08('0xb')](_0x5a08('0x3f'),_0x5936de[_0x5a08('0x9')]),_0x196b33);}};exports[_0x5a08('0x41')]=function(_0x435855){try{if(!_['isNil'](channels[_0x435855[_0x5a08('0x9')]])){utils[_0x5a08('0x18')](util['format'](_0x5a08('0x42'),_0x435855[_0x5a08('0x9')]),_0x435855);if(!_['isNil'](channels[_0x435855[_0x5a08('0x9')]][_0x5a08('0x43')])){channels[_0x435855[_0x5a08('0x9')]][_0x5a08('0x44')]+=utils[_0x5a08('0x33')](utils['now'](),channels[_0x435855[_0x5a08('0x9')]][_0x5a08('0x43')]);utils[_0x5a08('0x1a')](util[_0x5a08('0xb')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x435855[_0x5a08('0x9')],channels[_0x435855[_0x5a08('0x9')]][_0x5a08('0x44')]));delete channels[_0x435855[_0x5a08('0x9')]][_0x5a08('0x43')];}}}catch(_0x331e70){utils['error'](util[_0x5a08('0xb')]('[%s][calls][musiconholdstop]',_0x435855[_0x5a08('0x9')]),_0x331e70);}};exports[_0x5a08('0x45')]=function(_0x2a9eea){try{if(!_['isNil'](channels[_0x2a9eea[_0x5a08('0x9')]])){utils[_0x5a08('0x18')](util[_0x5a08('0xb')](_0x5a08('0x46'),_0x2a9eea[_0x5a08('0x9')]),_0x2a9eea);if(!_[_0x5a08('0x23')](_0x2a9eea[_0x5a08('0x47')][_0x5a08('0x48')])){utils[_0x5a08('0x1a')](util['format']('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x2a9eea['uniqueid'],_0x2a9eea[_0x5a08('0x49')]));channels[_0x2a9eea[_0x5a08('0x9')]][_0x5a08('0x4a')]=_0x2a9eea[_0x5a08('0x49')];}if(!_[_0x5a08('0x23')](_0x2a9eea[_0x5a08('0x47')]['xmd-phone'])){utils[_0x5a08('0x1a')](util[_0x5a08('0xb')](_0x5a08('0x4b'),_0x2a9eea[_0x5a08('0x9')],_0x2a9eea[_0x5a08('0x49')]));channels[_0x2a9eea[_0x5a08('0x9')]]['destination']=_0x2a9eea[_0x5a08('0x49')];channels[_0x2a9eea[_0x5a08('0x9')]][_0x5a08('0x2f')]='\x22'+_0x2a9eea['value']+_0x5a08('0x4c')+_0x2a9eea['value']+'>';}if(!_[_0x5a08('0x23')](_0x2a9eea[_0x5a08('0x47')][_0x5a08('0x4d')])||!_[_0x5a08('0x23')](_0x2a9eea[_0x5a08('0x47')][_0x5a08('0x4e')])){utils[_0x5a08('0x1a')](util[_0x5a08('0xb')](_0x5a08('0x4f'),_0x2a9eea[_0x5a08('0x9')],!_[_0x5a08('0x23')](_0x2a9eea[_0x5a08('0x47')][_0x5a08('0x4d')])?_0x5a08('0x4d'):'xmd-callerid',_0x2a9eea[_0x5a08('0x49')]));channels[_0x2a9eea['uniqueid']][_0x5a08('0x2f')]=_0x2a9eea['value'];}if(!_[_0x5a08('0x23')](_0x2a9eea[_0x5a08('0x47')][_0x5a08('0x50')])||!_['isNil'](_0x2a9eea[_0x5a08('0x47')][_0x5a08('0x51')])){utils[_0x5a08('0x1a')](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x2a9eea[_0x5a08('0x9')],!_[_0x5a08('0x23')](_0x2a9eea[_0x5a08('0x47')][_0x5a08('0x50')])?_0x5a08('0x50'):'xmcs-queue',_0x2a9eea['value']));channels[_0x2a9eea[_0x5a08('0x9')]]['lastapplication']=_0x5a08('0x52');channels[_0x2a9eea[_0x5a08('0x9')]][_0x5a08('0x53')]=_0x2a9eea[_0x5a08('0x49')];channels[_0x2a9eea['uniqueid']][_0x5a08('0xe')]=!![];}if(!_[_0x5a08('0x23')](_0x2a9eea[_0x5a08('0x47')][_0x5a08('0x54')])){utils[_0x5a08('0x1a')](util[_0x5a08('0xb')](_0x5a08('0x55'),_0x2a9eea[_0x5a08('0x9')],_0x2a9eea[_0x5a08('0x49')]));channels[_0x2a9eea['uniqueid']][_0x5a08('0x56')]=_0x2a9eea[_0x5a08('0x49')];}if(!_[_0x5a08('0x23')](_0x2a9eea[_0x5a08('0x47')][_0x5a08('0x57')])){utils[_0x5a08('0x1a')](util['format'](_0x5a08('0x58'),_0x2a9eea['uniqueid'],_0x2a9eea[_0x5a08('0x49')]));channels[_0x2a9eea[_0x5a08('0x9')]][_0x5a08('0x59')]=_0x2a9eea[_0x5a08('0x49')];}if(!_['isNil'](_0x2a9eea[_0x5a08('0x47')]['outboundrouteid'])){utils[_0x5a08('0x1a')](util[_0x5a08('0xb')](_0x5a08('0x5a'),_0x2a9eea[_0x5a08('0x9')],_0x2a9eea[_0x5a08('0x49')]));channels[_0x2a9eea[_0x5a08('0x9')]][_0x5a08('0x5b')]=_0x2a9eea['value'];}if(!_['isNil'](_0x2a9eea[_0x5a08('0x47')][_0x5a08('0x5c')])){utils[_0x5a08('0x1a')](util[_0x5a08('0xb')](_0x5a08('0x5d'),_0x2a9eea['uniqueid'],_0x2a9eea[_0x5a08('0x49')]));channels[_0x2a9eea[_0x5a08('0x9')]][_0x5a08('0x5c')]=_0x2a9eea[_0x5a08('0x49')];}}}catch(_0xa0dc8c){utils['error'](util['format'](_0x5a08('0x46'),_0x2a9eea[_0x5a08('0x9')]),_0xa0dc8c);}};exports[_0x5a08('0x5e')]=function(_0x101296){try{if(!_['isNil'](channels[_0x101296[_0x5a08('0x9')]])){utils[_0x5a08('0x18')](util[_0x5a08('0xb')](_0x5a08('0x5f'),_0x101296[_0x5a08('0x9')]),_0x101296);utils[_0x5a08('0x1a')](util['format'](_0x5a08('0x60'),_0x101296[_0x5a08('0x9')],_0x101296[_0x5a08('0x61')],_0x101296[_0x5a08('0x62')]));if(_0x101296[_0x5a08('0x61')][_0x5a08('0x63')]()==_0x5a08('0x64')&&_['startsWith'](_0x101296[_0x5a08('0x62')][_0x5a08('0x63')](),'cdr')){var _0x5584d3=_0x101296[_0x5a08('0x62')]['split']('=');var _0x228b91=_0x5584d3[0x0][_0x5a08('0x65')](_0x5584d3[0x0][_0x5a08('0x66')]('(')+0x1,_0x5584d3[0x0][_0x5a08('0x66')](')'));var _0x4735b9=_0x5584d3[0x1];channels[_0x101296[_0x5a08('0x9')]][_0x228b91]=_0x4735b9;}if(!_[_0x5a08('0x67')]([_0x5a08('0x2b'),_0x5a08('0x68'),_0x5a08('0x69'),_0x5a08('0x64'),_0x5a08('0x6a')],_0x101296[_0x5a08('0x61')][_0x5a08('0x63')]())){channels[_0x101296[_0x5a08('0x9')]]['lastapplication']=_0x101296[_0x5a08('0x61')];channels[_0x101296[_0x5a08('0x9')]][_0x5a08('0x53')]=_0x101296[_0x5a08('0x62')];}}}catch(_0x6949db){utils[_0x5a08('0x1f')](util[_0x5a08('0xb')]('[%s][calls][newexten]',_0x101296['uniqueid']),_0x6949db);}};
\ No newline at end of file
index 3378777..44bca57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13f5=['error','[core]\x20error','close','[core]\x20close','connect','info','[core]\x20connected','shutdown','[core]\x20fullybooted'];(function(_0x535963,_0x326515){var _0x3975f6=function(_0x2e624f){while(--_0x2e624f){_0x535963['push'](_0x535963['shift']());}};_0x3975f6(++_0x326515);}(_0x13f5,0x16c));var _0x513f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x13f5[_0x122ef9];return _0x42fba0;};'use strict';var utils=require('./utils');exports[_0x513f('0x0')]=function(){utils[_0x513f('0x1')](_0x513f('0x2'));};exports[_0x513f('0x3')]=function(){utils[_0x513f('0x1')]('[core]\x20shutdown');};exports['fullybooted']=function(){utils[_0x513f('0x1')](_0x513f('0x4'));};exports[_0x513f('0x5')]=function(_0x3062e4){utils['error'](_0x513f('0x6'),_0x3062e4);};exports[_0x513f('0x7')]=function(){utils[_0x513f('0x1')](_0x513f('0x8'));};exports['managerevent']=function(_0xfac421){};
\ No newline at end of file
+var _0xd93a=['shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','managerevent','info'];(function(_0x26edad,_0x77f137){var _0x45f29b=function(_0x5cf770){while(--_0x5cf770){_0x26edad['push'](_0x26edad['shift']());}};_0x45f29b(++_0x77f137);}(_0xd93a,0x1b7));var _0xad93=function(_0x24d43a,_0x160902){_0x24d43a=_0x24d43a-0x0;var _0x1e7919=_0xd93a[_0x24d43a];return _0x1e7919;};'use strict';var utils=require('./utils');exports['connect']=function(){utils[_0xad93('0x0')]('[core]\x20connected');};exports[_0xad93('0x1')]=function(){utils[_0xad93('0x0')](_0xad93('0x2'));};exports[_0xad93('0x3')]=function(){utils[_0xad93('0x0')](_0xad93('0x4'));};exports['error']=function(_0x52745b){utils[_0xad93('0x5')](_0xad93('0x6'),_0x52745b);};exports['close']=function(){utils['info']('[core]\x20close');};exports[_0xad93('0x7')]=function(_0x1b5a88){};
\ No newline at end of file
index 76039d7..f2b8f85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44d7=['toLowerCase','split','error','varset','debug','[%s][dials][varset]','isNil','variable','outboundrouteid','info','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][dialbegin]','assign','starttime','now','lastevent','dialend','[%s][dials][dialend]','ANSWER','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','complete','endtime','billableseconds','diffTime','util','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','[%s][dials][newexten]','application','appdata','startsWith'];(function(_0x9729d7,_0x1b79a8){var _0x3c4ac6=function(_0x401ba6){while(--_0x401ba6){_0x9729d7['push'](_0x9729d7['shift']());}};_0x3c4ac6(++_0x1b79a8);}(_0x44d7,0x7b));var _0x744d=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x44d7[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0x744d('0x0'));var utils=require(_0x744d('0x1'));var dials={};function writeDB(_0x4a6431){utils['info'](util[_0x744d('0x2')](_0x744d('0x3'),_0x4a6431[_0x744d('0x4')],_0x4a6431['channel'],_0x4a6431[_0x744d('0x5')],_0x4a6431[_0x744d('0x6')],_0x4a6431[_0x744d('0x7')],_0x4a6431[_0x744d('0x8')]));utils[_0x744d('0x9')](_0x744d('0xa'),_0x4a6431);delete dials[_0x4a6431[_0x744d('0x4')]];}exports['newexten']=function(_0x21f0cd){try{utils['debug'](util[_0x744d('0x2')](_0x744d('0xb'),_0x21f0cd[_0x744d('0x4')]),_0x21f0cd);utils['info'](util['format']('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x21f0cd[_0x744d('0x4')],_0x21f0cd[_0x744d('0xc')],_0x21f0cd[_0x744d('0xd')]));if(_0x21f0cd['application']['toLowerCase']()=='set'&&_[_0x744d('0xe')](_0x21f0cd[_0x744d('0xd')][_0x744d('0xf')](),'cdr(routeid)')){var _0x3a1be4=_0x21f0cd[_0x744d('0xd')][_0x744d('0x10')]('=');dials[_0x21f0cd['uniqueid']]={'routeId':_0x3a1be4[0x1]};}}catch(_0x59a312){utils[_0x744d('0x11')](util[_0x744d('0x2')](_0x744d('0xb'),_0x21f0cd[_0x744d('0x4')]),_0x59a312);}};exports[_0x744d('0x12')]=function(_0x5e6405){try{utils[_0x744d('0x13')](util['format'](_0x744d('0x14'),_0x5e6405[_0x744d('0x4')]),_0x5e6405);if(!_[_0x744d('0x15')](_0x5e6405[_0x744d('0x16')][_0x744d('0x17')])){utils[_0x744d('0x18')](util[_0x744d('0x2')](_0x744d('0x19'),_0x5e6405[_0x744d('0x4')],_0x5e6405[_0x744d('0x1a')]));dials[_0x5e6405[_0x744d('0x4')]]={'routeId':_0x5e6405[_0x744d('0x1a')]};}}catch(_0x210797){utils[_0x744d('0x11')](util['format']('[%s][dials][varset]',_0x5e6405[_0x744d('0x4')]),_0x210797);}};exports['dialbegin']=function(_0x4de6af){try{if(!_[_0x744d('0x15')](dials[_0x4de6af[_0x744d('0x4')]])){utils['debug'](util[_0x744d('0x2')](_0x744d('0x1b'),_0x4de6af[_0x744d('0x4')]),_0x4de6af);dials[_0x4de6af['uniqueid']]=_[_0x744d('0x1c')](dials[_0x4de6af['uniqueid']],_0x4de6af);dials[_0x4de6af[_0x744d('0x4')]][_0x744d('0x1d')]=utils[_0x744d('0x1e')]();dials[_0x4de6af['uniqueid']][_0x744d('0x1f')]='called';utils[_0x744d('0x18')](util[_0x744d('0x2')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x4de6af['uniqueid'],dials[_0x4de6af[_0x744d('0x4')]][_0x744d('0x1d')]));}}catch(_0x4e7a81){utils[_0x744d('0x11')](util[_0x744d('0x2')](_0x744d('0x1b'),_0x4de6af['uniqueid']),_0x4e7a81);}};exports[_0x744d('0x20')]=function(_0x19631f){try{if(!_[_0x744d('0x15')](dials[_0x19631f[_0x744d('0x4')]])){utils[_0x744d('0x13')](util[_0x744d('0x2')](_0x744d('0x21'),_0x19631f['uniqueid']),_0x19631f);dials[_0x19631f[_0x744d('0x4')]][_0x744d('0x8')]=_0x19631f[_0x744d('0x8')];if(_0x19631f[_0x744d('0x8')]==_0x744d('0x22')){dials[_0x19631f[_0x744d('0x4')]]=_[_0x744d('0x1c')](dials[_0x19631f['uniqueid']],_0x19631f);dials[_0x19631f[_0x744d('0x4')]]['answertime']=utils[_0x744d('0x1e')]();dials[_0x19631f[_0x744d('0x4')]]['lastevent']=_0x744d('0x23');utils[_0x744d('0x18')](util[_0x744d('0x2')](_0x744d('0x24'),_0x19631f[_0x744d('0x4')],_0x19631f['dialstatus'],dials[_0x19631f[_0x744d('0x4')]][_0x744d('0x25')]));}else{utils[_0x744d('0x18')](util[_0x744d('0x2')](_0x744d('0x26'),_0x19631f[_0x744d('0x4')],_0x19631f[_0x744d('0x8')]));}}}catch(_0x3819c0){utils[_0x744d('0x11')](util[_0x744d('0x2')](_0x744d('0x21'),_0x19631f['uniqueid']),_0x3819c0);}};exports['hangup']=function(_0x36bd9e){try{if(!_[_0x744d('0x15')](dials[_0x36bd9e[_0x744d('0x4')]])){utils['debug'](util[_0x744d('0x2')](_0x744d('0x27'),_0x36bd9e['uniqueid']),_0x36bd9e);utils['info'](util[_0x744d('0x2')](_0x744d('0x28'),_0x36bd9e[_0x744d('0x4')],_0x36bd9e['calleridnum'],_0x36bd9e[_0x744d('0x29')],_0x36bd9e['cause-txt']));dials[_0x36bd9e[_0x744d('0x4')]]=_[_0x744d('0x1c')](dials[_0x36bd9e[_0x744d('0x4')]],{'endtime':utils[_0x744d('0x1e')](),'lastevent':_0x744d('0x2a')});dials[_0x36bd9e[_0x744d('0x4')]]['duration']=utils['diffTime'](dials[_0x36bd9e[_0x744d('0x4')]][_0x744d('0x2b')],dials[_0x36bd9e['uniqueid']][_0x744d('0x1d')]);dials[_0x36bd9e['uniqueid']]['holdtime']=utils['diffTime'](dials[_0x36bd9e[_0x744d('0x4')]][_0x744d('0x25')]||dials[_0x36bd9e[_0x744d('0x4')]][_0x744d('0x2b')],dials[_0x36bd9e[_0x744d('0x4')]]['starttime']);dials[_0x36bd9e[_0x744d('0x4')]][_0x744d('0x2c')]=dials[_0x36bd9e[_0x744d('0x4')]][_0x744d('0x25')]?utils[_0x744d('0x2d')](dials[_0x36bd9e[_0x744d('0x4')]][_0x744d('0x2b')],dials[_0x36bd9e[_0x744d('0x4')]][_0x744d('0x25')]):0x0;writeDB(dials[_0x36bd9e[_0x744d('0x4')]]);}}catch(_0x30d2c1){utils[_0x744d('0x11')](util[_0x744d('0x2')](_0x744d('0x27'),_0x36bd9e[_0x744d('0x4')]),_0x30d2c1);}};
\ No newline at end of file
+var _0x2af3=['CreateVoiceDialReport','debug','format','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','dialend','[%s][dials][dialend]','connect','answertime','[%s][dials][hangup]','calleridname','complete','duration','diffTime','endtime','billableseconds','lodash','util','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','calleridnum','connectedlinenum','dialstatus','request'];(function(_0x2836d3,_0xbd12c3){var _0x543043=function(_0x50ed3f){while(--_0x50ed3f){_0x2836d3['push'](_0x2836d3['shift']());}};_0x543043(++_0xbd12c3);}(_0x2af3,0x19d));var _0x32af=function(_0xc4966b,_0x6cd5e0){_0xc4966b=_0xc4966b-0x0;var _0x1802bb=_0x2af3[_0xc4966b];return _0x1802bb;};'use strict';var _=require(_0x32af('0x0'));var util=require(_0x32af('0x1'));var utils=require(_0x32af('0x2'));var dials={};function writeDB(_0x25671f){utils[_0x32af('0x3')](util['format'](_0x32af('0x4'),_0x25671f[_0x32af('0x5')],_0x25671f['channel'],_0x25671f['dialstring'],_0x25671f[_0x32af('0x6')],_0x25671f[_0x32af('0x7')],_0x25671f[_0x32af('0x8')]));utils[_0x32af('0x9')](_0x32af('0xa'),_0x25671f);delete dials[_0x25671f[_0x32af('0x5')]];}exports['newexten']=function(_0x29cbc5){try{utils[_0x32af('0xb')](util[_0x32af('0xc')](_0x32af('0xd'),_0x29cbc5['uniqueid']),_0x29cbc5);utils['info'](util[_0x32af('0xc')](_0x32af('0xe'),_0x29cbc5[_0x32af('0x5')],_0x29cbc5[_0x32af('0xf')],_0x29cbc5[_0x32af('0x10')]));if(_0x29cbc5['application'][_0x32af('0x11')]()==_0x32af('0x12')&&_[_0x32af('0x13')](_0x29cbc5[_0x32af('0x10')][_0x32af('0x11')](),_0x32af('0x14'))){var _0x58aec9=_0x29cbc5[_0x32af('0x10')][_0x32af('0x15')]('=');dials[_0x29cbc5[_0x32af('0x5')]]={'routeId':_0x58aec9[0x1]};}}catch(_0x7275ae){utils[_0x32af('0x16')](util[_0x32af('0xc')](_0x32af('0xd'),_0x29cbc5[_0x32af('0x5')]),_0x7275ae);}};exports[_0x32af('0x17')]=function(_0x414c2b){try{utils[_0x32af('0xb')](util[_0x32af('0xc')](_0x32af('0x18'),_0x414c2b['uniqueid']),_0x414c2b);if(!_[_0x32af('0x19')](_0x414c2b[_0x32af('0x1a')][_0x32af('0x1b')])){utils['info'](util['format'](_0x32af('0x1c'),_0x414c2b[_0x32af('0x5')],_0x414c2b[_0x32af('0x1d')]));dials[_0x414c2b[_0x32af('0x5')]]={'routeId':_0x414c2b[_0x32af('0x1d')]};}}catch(_0x4818c8){utils[_0x32af('0x16')](util[_0x32af('0xc')]('[%s][dials][varset]',_0x414c2b[_0x32af('0x5')]),_0x4818c8);}};exports['dialbegin']=function(_0x130807){try{if(!_[_0x32af('0x19')](dials[_0x130807[_0x32af('0x5')]])){utils[_0x32af('0xb')](util[_0x32af('0xc')](_0x32af('0x1e'),_0x130807[_0x32af('0x5')]),_0x130807);dials[_0x130807[_0x32af('0x5')]]=_[_0x32af('0x1f')](dials[_0x130807[_0x32af('0x5')]],_0x130807);dials[_0x130807[_0x32af('0x5')]][_0x32af('0x20')]=utils[_0x32af('0x21')]();dials[_0x130807[_0x32af('0x5')]][_0x32af('0x22')]=_0x32af('0x23');utils['info'](util[_0x32af('0xc')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x130807[_0x32af('0x5')],dials[_0x130807[_0x32af('0x5')]]['starttime']));}}catch(_0x4fdc8e){utils['error'](util[_0x32af('0xc')](_0x32af('0x1e'),_0x130807['uniqueid']),_0x4fdc8e);}};exports[_0x32af('0x24')]=function(_0x58f066){try{if(!_[_0x32af('0x19')](dials[_0x58f066['uniqueid']])){utils[_0x32af('0xb')](util[_0x32af('0xc')](_0x32af('0x25'),_0x58f066[_0x32af('0x5')]),_0x58f066);dials[_0x58f066['uniqueid']][_0x32af('0x8')]=_0x58f066[_0x32af('0x8')];if(_0x58f066[_0x32af('0x8')]=='ANSWER'){dials[_0x58f066['uniqueid']]=_[_0x32af('0x1f')](dials[_0x58f066[_0x32af('0x5')]],_0x58f066);dials[_0x58f066[_0x32af('0x5')]]['answertime']=utils[_0x32af('0x21')]();dials[_0x58f066[_0x32af('0x5')]][_0x32af('0x22')]=_0x32af('0x26');utils[_0x32af('0x3')](util['format']('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x58f066[_0x32af('0x5')],_0x58f066['dialstatus'],dials[_0x58f066[_0x32af('0x5')]][_0x32af('0x27')]));}else{utils[_0x32af('0x3')](util[_0x32af('0xc')]('[%s][dials][dialend]\x20dialstatus:%s',_0x58f066[_0x32af('0x5')],_0x58f066['dialstatus']));}}}catch(_0x3bfd1e){utils[_0x32af('0x16')](util[_0x32af('0xc')]('[%s][dials][dialend]',_0x58f066[_0x32af('0x5')]),_0x3bfd1e);}};exports['hangup']=function(_0x4d1b11){try{if(!_[_0x32af('0x19')](dials[_0x4d1b11['uniqueid']])){utils[_0x32af('0xb')](util[_0x32af('0xc')](_0x32af('0x28'),_0x4d1b11[_0x32af('0x5')]),_0x4d1b11);utils['info'](util[_0x32af('0xc')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x4d1b11['uniqueid'],_0x4d1b11[_0x32af('0x6')],_0x4d1b11[_0x32af('0x29')],_0x4d1b11['cause-txt']));dials[_0x4d1b11[_0x32af('0x5')]]=_['assign'](dials[_0x4d1b11[_0x32af('0x5')]],{'endtime':utils[_0x32af('0x21')](),'lastevent':_0x32af('0x2a')});dials[_0x4d1b11[_0x32af('0x5')]][_0x32af('0x2b')]=utils[_0x32af('0x2c')](dials[_0x4d1b11[_0x32af('0x5')]][_0x32af('0x2d')],dials[_0x4d1b11[_0x32af('0x5')]][_0x32af('0x20')]);dials[_0x4d1b11[_0x32af('0x5')]]['holdtime']=utils[_0x32af('0x2c')](dials[_0x4d1b11[_0x32af('0x5')]][_0x32af('0x27')]||dials[_0x4d1b11['uniqueid']][_0x32af('0x2d')],dials[_0x4d1b11[_0x32af('0x5')]][_0x32af('0x20')]);dials[_0x4d1b11[_0x32af('0x5')]][_0x32af('0x2e')]=dials[_0x4d1b11[_0x32af('0x5')]][_0x32af('0x27')]?utils[_0x32af('0x2c')](dials[_0x4d1b11['uniqueid']][_0x32af('0x2d')],dials[_0x4d1b11['uniqueid']][_0x32af('0x27')]):0x0;writeDB(dials[_0x4d1b11['uniqueid']]);}}catch(_0xeb3357){utils[_0x32af('0x16')](util[_0x32af('0xc')](_0x32af('0x28'),_0x4d1b11['uniqueid']),_0xeb3357);}};
\ No newline at end of file
index 8626d9c..9839ec4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb9=['[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','../../config/environment','./utils','asterisk','port','username','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','[%s][index][devicestatechange]','device','format','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten'];(function(_0x567fff,_0xd8acd8){var _0x465a37=function(_0x9d7bf7){while(--_0x9d7bf7){_0x567fff['push'](_0x567fff['shift']());}};_0x465a37(++_0xd8acd8);}(_0xadb9,0x90));var _0x9adb=function(_0x5e2382,_0x2eca83){_0x5e2382=_0x5e2382-0x0;var _0x533a35=_0xadb9[_0x5e2382];return _0x533a35;};var AsteriskManager=require('asterisk-manager');var config=require(_0x9adb('0x0'));var utils=require(_0x9adb('0x1'));var util=require('util');var ami=new AsteriskManager(config[_0x9adb('0x2')][_0x9adb('0x3')],config[_0x9adb('0x2')]['ip'],config['asterisk'][_0x9adb('0x4')],config[_0x9adb('0x2')][_0x9adb('0x5')],!![]);ami[_0x9adb('0x6')]();if(config[_0x9adb('0x7')]&&config[_0x9adb('0x7')][_0x9adb('0x8')]){utils[_0x9adb('0x9')](_0x9adb('0xa'));}else{var agents=require('./agents.controller');var calls=require(_0x9adb('0xb'));var queues=require(_0x9adb('0xc'));var recordings=require(_0x9adb('0xd'));var members=require(_0x9adb('0xe'));var dials=require('./dials.controller');var transfers=require(_0x9adb('0xf'));var core=require(_0x9adb('0x10'));ami['on'](_0x9adb('0x11'),core[_0x9adb('0x11')]);ami['on'](_0x9adb('0x12'),core[_0x9adb('0x12')]);ami['on'](_0x9adb('0x13'),core['fullybooted']);ami['on'](_0x9adb('0x14'),core['error']);ami['on']('close',core[_0x9adb('0x15')]);ami['on'](_0x9adb('0x16'),core[_0x9adb('0x16')]);ami['on'](_0x9adb('0x17'),function(_0x5849f5){try{utils[_0x9adb('0x18')](util['format'](_0x9adb('0x19'),_0x5849f5[_0x9adb('0x1a')]),_0x5849f5);members[_0x9adb('0x17')](_0x5849f5);}catch(_0x310b73){utils[_0x9adb('0x14')](util[_0x9adb('0x1b')](_0x9adb('0x19'),_0x5849f5[_0x9adb('0x1a')]),_0x310b73);}});ami['on'](_0x9adb('0x1c'),function(_0x1f17e5){try{utils[_0x9adb('0x18')](util['format'](_0x9adb('0x1d'),_0x1f17e5['uniqueid']),_0x1f17e5);agents['agentcalled'](_0x1f17e5);}catch(_0x5cc335){utils[_0x9adb('0x14')](util[_0x9adb('0x1b')](_0x9adb('0x1d'),_0x1f17e5[_0x9adb('0x1e')]),_0x5cc335);}});ami['on'](_0x9adb('0x1f'),function(_0x455c6d){try{utils['debug'](util[_0x9adb('0x1b')](_0x9adb('0x20'),_0x455c6d[_0x9adb('0x1e')]),_0x455c6d);agents[_0x9adb('0x1f')](_0x455c6d);}catch(_0x1dbd41){utils[_0x9adb('0x14')](util['format'](_0x9adb('0x20'),_0x455c6d[_0x9adb('0x1e')]),_0x1dbd41);}});ami['on'](_0x9adb('0x21'),function(_0x55b4dc){try{utils[_0x9adb('0x18')](util[_0x9adb('0x1b')](_0x9adb('0x22'),_0x55b4dc[_0x9adb('0x1e')]),_0x55b4dc);agents['agentconnect'](_0x55b4dc);queues['agentconnect'](_0x55b4dc);}catch(_0x2da0c3){utils[_0x9adb('0x14')](util['format'](_0x9adb('0x22'),_0x55b4dc[_0x9adb('0x1e')]),_0x2da0c3);}});ami['on'](_0x9adb('0x23'),function(_0x51b952){try{utils[_0x9adb('0x18')](util['format'](_0x9adb('0x24'),_0x51b952[_0x9adb('0x1e')]),_0x51b952);agents[_0x9adb('0x23')](_0x51b952);queues[_0x9adb('0x23')](_0x51b952);members[_0x9adb('0x23')](_0x51b952);}catch(_0x161f83){utils['error'](util['format'](_0x9adb('0x24'),_0x51b952[_0x9adb('0x1e')]),_0x161f83);}});ami['on']('queuecallerabandon',function(_0x42f435){try{utils['debug'](util[_0x9adb('0x1b')](_0x9adb('0x25'),_0x42f435['uniqueid']),_0x42f435);agents[_0x9adb('0x26')](_0x42f435);queues[_0x9adb('0x26')](_0x42f435);}catch(_0x4a1800){utils[_0x9adb('0x14')](util[_0x9adb('0x1b')](_0x9adb('0x25'),_0x42f435[_0x9adb('0x1e')]),_0x4a1800);}});ami['on'](_0x9adb('0x27'),function(_0x160af8){try{utils[_0x9adb('0x18')](util[_0x9adb('0x1b')](_0x9adb('0x28'),_0x160af8[_0x9adb('0x1e')]),_0x160af8);queues[_0x9adb('0x27')](_0x160af8);recordings[_0x9adb('0x27')](_0x160af8);}catch(_0x5687a1){utils['error'](util['format'](_0x9adb('0x28'),_0x160af8[_0x9adb('0x1e')]),_0x5687a1);}});ami['on'](_0x9adb('0x29'),function(_0x278541){try{utils[_0x9adb('0x18')](util[_0x9adb('0x1b')](_0x9adb('0x2a'),_0x278541[_0x9adb('0x1e')]),_0x278541);queues[_0x9adb('0x29')](_0x278541);}catch(_0x1fefee){utils[_0x9adb('0x14')](util[_0x9adb('0x1b')](_0x9adb('0x2a'),_0x278541[_0x9adb('0x1e')]),_0x1fefee);}});ami['on']('musiconholdstart',function(_0x1610a0){try{utils[_0x9adb('0x18')](util[_0x9adb('0x1b')]('[%s][index][musiconholdstart]',_0x1610a0[_0x9adb('0x1e')]),_0x1610a0);queues[_0x9adb('0x2b')](_0x1610a0);calls[_0x9adb('0x2b')](_0x1610a0);}catch(_0x32f141){utils[_0x9adb('0x14')](util[_0x9adb('0x1b')]('[%s][index][musiconholdstart]',_0x1610a0['uniqueid']),_0x32f141);}});ami['on'](_0x9adb('0x2c'),function(_0x545af0){try{utils[_0x9adb('0x18')](util['format'](_0x9adb('0x2d'),_0x545af0[_0x9adb('0x1e')]),_0x545af0);queues['musiconholdstop'](_0x545af0);calls[_0x9adb('0x2c')](_0x545af0);}catch(_0x2775ba){utils[_0x9adb('0x14')](util[_0x9adb('0x1b')](_0x9adb('0x2d'),_0x545af0[_0x9adb('0x1e')]),_0x2775ba);}});ami['on']('newstate',function(_0x4f93da){try{utils[_0x9adb('0x18')](util['format'](_0x9adb('0x2e'),_0x4f93da[_0x9adb('0x1e')]),_0x4f93da);calls[_0x9adb('0x2f')](_0x4f93da);recordings[_0x9adb('0x2f')](_0x4f93da);}catch(_0x535dcd){utils[_0x9adb('0x14')](util[_0x9adb('0x1b')](_0x9adb('0x2e'),_0x4f93da['uniqueid']),_0x535dcd);}});ami['on'](_0x9adb('0x30'),function(_0x4a716c){try{utils[_0x9adb('0x18')](util[_0x9adb('0x1b')](_0x9adb('0x31'),_0x4a716c[_0x9adb('0x1e')]),_0x4a716c);calls['hangup'](_0x4a716c);recordings[_0x9adb('0x30')](_0x4a716c);dials['hangup'](_0x4a716c);agents[_0x9adb('0x30')](_0x4a716c);queues['hangup'](_0x4a716c);}catch(_0x17d3ef){utils['error'](util[_0x9adb('0x1b')](_0x9adb('0x31'),_0x4a716c[_0x9adb('0x1e')]),_0x17d3ef);}});ami['on'](_0x9adb('0x32'),function(_0x5b1631){try{utils[_0x9adb('0x18')](util[_0x9adb('0x1b')]('[%s][index][cdr]',_0x5b1631[_0x9adb('0x1e')]),_0x5b1631);members[_0x9adb('0x32')](_0x5b1631);}catch(_0x1376b7){utils[_0x9adb('0x14')](util[_0x9adb('0x1b')](_0x9adb('0x33'),_0x5b1631[_0x9adb('0x1e')]),_0x1376b7);}});ami['on'](_0x9adb('0x34'),function(_0x573ed7){try{utils[_0x9adb('0x18')](util[_0x9adb('0x1b')](_0x9adb('0x35'),_0x573ed7[_0x9adb('0x1e')]),_0x573ed7);queues['blindtransfer'](_0x573ed7);agents[_0x9adb('0x34')](_0x573ed7);transfers['blindtransfer'](_0x573ed7);}catch(_0x22438f){utils['error'](util['format'](_0x9adb('0x35'),_0x573ed7[_0x9adb('0x1e')]),_0x22438f);}});ami['on'](_0x9adb('0x36'),function(_0x412818){try{utils[_0x9adb('0x18')](util[_0x9adb('0x1b')]('[%s][index][attendedtransfer]',_0x412818['origtransfereruniqueid']),_0x412818);queues[_0x9adb('0x36')](_0x412818);transfers[_0x9adb('0x36')](_0x412818);agents[_0x9adb('0x36')](_0x412818);calls['attendedtransfer'](_0x412818);}catch(_0x5cf476){utils['error'](util[_0x9adb('0x1b')](_0x9adb('0x37'),_0x412818[_0x9adb('0x38')]),_0x5cf476);}});ami['on'](_0x9adb('0x39'),function(_0x1a4d13){try{utils[_0x9adb('0x18')](util['format']('[%s][index][varset]',_0x1a4d13[_0x9adb('0x1e')]),_0x1a4d13);queues[_0x9adb('0x39')](_0x1a4d13);recordings['varset'](_0x1a4d13);calls[_0x9adb('0x39')](_0x1a4d13);dials['varset'](_0x1a4d13);}catch(_0xa9d525){utils[_0x9adb('0x14')](util[_0x9adb('0x1b')](_0x9adb('0x3a'),_0x1a4d13[_0x9adb('0x1e')]),_0xa9d525);}});ami['on'](_0x9adb('0x3b'),function(_0xe26b69){try{utils[_0x9adb('0x18')](util[_0x9adb('0x1b')](_0x9adb('0x3c'),_0xe26b69[_0x9adb('0x1e')]),_0xe26b69);calls[_0x9adb('0x3b')](_0xe26b69);recordings[_0x9adb('0x3b')](_0xe26b69);dials[_0x9adb('0x3b')](_0xe26b69);}catch(_0x520935){utils['error'](util[_0x9adb('0x1b')](_0x9adb('0x3c'),_0xe26b69[_0x9adb('0x1e')]),_0x520935);}});ami['on'](_0x9adb('0x3d'),function(_0x5e96db){try{utils[_0x9adb('0x18')](util[_0x9adb('0x1b')](_0x9adb('0x3e'),_0x5e96db['uniqueid']),_0x5e96db);calls[_0x9adb('0x3d')](_0x5e96db);recordings[_0x9adb('0x3d')](_0x5e96db);}catch(_0x1ca781){utils['error'](util[_0x9adb('0x1b')](_0x9adb('0x3e'),_0x5e96db[_0x9adb('0x1e')]),_0x1ca781);}});ami['on'](_0x9adb('0x3f'),function(_0x4c12aa){try{utils[_0x9adb('0x18')](util[_0x9adb('0x1b')](_0x9adb('0x40'),_0x4c12aa[_0x9adb('0x1e')]),_0x4c12aa);dials[_0x9adb('0x3f')](_0x4c12aa);}catch(_0x19af1c){utils[_0x9adb('0x14')](util['format'](_0x9adb('0x41'),_0x4c12aa[_0x9adb('0x1e')]),_0x19af1c);}});ami['on'](_0x9adb('0x42'),function(_0x3966b7){try{utils[_0x9adb('0x18')](util[_0x9adb('0x1b')](_0x9adb('0x43'),_0x3966b7[_0x9adb('0x1e')]),_0x3966b7);dials['dialend'](_0x3966b7);}catch(_0x289eb1){utils['error'](util[_0x9adb('0x1b')](_0x9adb('0x43'),_0x3966b7['uniqueid']),_0x289eb1);}});}
\ No newline at end of file
+var _0x9882=['agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','asterisk','port','username','password','keepConnected','disabled','info','XDR\x20DISABLED','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','format','device','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]'];(function(_0x140f23,_0xa0fccf){var _0x522939=function(_0x273437){while(--_0x273437){_0x140f23['push'](_0x140f23['shift']());}};_0x522939(++_0xa0fccf);}(_0x9882,0xa7));var _0x2988=function(_0x4e0bae,_0x4b9ebb){_0x4e0bae=_0x4e0bae-0x0;var _0x5b3f73=_0x9882[_0x4e0bae];return _0x5b3f73;};var AsteriskManager=require(_0x2988('0x0'));var config=require(_0x2988('0x1'));var utils=require(_0x2988('0x2'));var util=require('util');var ami=new AsteriskManager(config[_0x2988('0x3')][_0x2988('0x4')],config[_0x2988('0x3')]['ip'],config[_0x2988('0x3')][_0x2988('0x5')],config[_0x2988('0x3')][_0x2988('0x6')],!![]);ami[_0x2988('0x7')]();if(config['xdr']&&config['xdr'][_0x2988('0x8')]){utils[_0x2988('0x9')](_0x2988('0xa'));}else{var agents=require('./agents.controller');var calls=require(_0x2988('0xb'));var queues=require(_0x2988('0xc'));var recordings=require(_0x2988('0xd'));var members=require(_0x2988('0xe'));var dials=require('./dials.controller');var transfers=require(_0x2988('0xf'));var core=require(_0x2988('0x10'));ami['on'](_0x2988('0x11'),core[_0x2988('0x11')]);ami['on']('shutdown',core[_0x2988('0x12')]);ami['on'](_0x2988('0x13'),core[_0x2988('0x13')]);ami['on']('error',core[_0x2988('0x14')]);ami['on']('close',core[_0x2988('0x15')]);ami['on'](_0x2988('0x16'),core[_0x2988('0x16')]);ami['on']('devicestatechange',function(_0x3914aa){try{utils[_0x2988('0x17')](util[_0x2988('0x18')]('[%s][index][devicestatechange]',_0x3914aa[_0x2988('0x19')]),_0x3914aa);members['devicestatechange'](_0x3914aa);}catch(_0xdb25ba){utils[_0x2988('0x14')](util[_0x2988('0x18')](_0x2988('0x1a'),_0x3914aa[_0x2988('0x19')]),_0xdb25ba);}});ami['on'](_0x2988('0x1b'),function(_0x189174){try{utils['debug'](util[_0x2988('0x18')]('[%s][index][agentcalled]',_0x189174['uniqueid']),_0x189174);agents['agentcalled'](_0x189174);}catch(_0x44f1b0){utils[_0x2988('0x14')](util[_0x2988('0x18')](_0x2988('0x1c'),_0x189174[_0x2988('0x1d')]),_0x44f1b0);}});ami['on'](_0x2988('0x1e'),function(_0x2081e4){try{utils[_0x2988('0x17')](util['format'](_0x2988('0x1f'),_0x2081e4[_0x2988('0x1d')]),_0x2081e4);agents[_0x2988('0x1e')](_0x2081e4);}catch(_0x5b2216){utils['error'](util[_0x2988('0x18')](_0x2988('0x1f'),_0x2081e4[_0x2988('0x1d')]),_0x5b2216);}});ami['on'](_0x2988('0x20'),function(_0x1cf198){try{utils['debug'](util[_0x2988('0x18')](_0x2988('0x21'),_0x1cf198[_0x2988('0x1d')]),_0x1cf198);agents[_0x2988('0x20')](_0x1cf198);queues[_0x2988('0x20')](_0x1cf198);}catch(_0x3c52cd){utils[_0x2988('0x14')](util['format'](_0x2988('0x21'),_0x1cf198[_0x2988('0x1d')]),_0x3c52cd);}});ami['on'](_0x2988('0x22'),function(_0x21faa7){try{utils[_0x2988('0x17')](util['format'](_0x2988('0x23'),_0x21faa7[_0x2988('0x1d')]),_0x21faa7);agents['agentcomplete'](_0x21faa7);queues[_0x2988('0x22')](_0x21faa7);members['agentcomplete'](_0x21faa7);}catch(_0xeb1f7){utils['error'](util[_0x2988('0x18')](_0x2988('0x23'),_0x21faa7[_0x2988('0x1d')]),_0xeb1f7);}});ami['on'](_0x2988('0x24'),function(_0x55e6ec){try{utils[_0x2988('0x17')](util[_0x2988('0x18')](_0x2988('0x25'),_0x55e6ec[_0x2988('0x1d')]),_0x55e6ec);agents['queuecallerabandon'](_0x55e6ec);queues[_0x2988('0x24')](_0x55e6ec);}catch(_0x42f405){utils[_0x2988('0x14')](util['format']('[%s][index][queuecallerabandon]',_0x55e6ec[_0x2988('0x1d')]),_0x42f405);}});ami['on'](_0x2988('0x26'),function(_0x17cc2d){try{utils[_0x2988('0x17')](util['format']('[%s][index][queuecallerjoin]',_0x17cc2d['uniqueid']),_0x17cc2d);queues['queuecallerjoin'](_0x17cc2d);recordings[_0x2988('0x26')](_0x17cc2d);}catch(_0x241c14){utils[_0x2988('0x14')](util[_0x2988('0x18')](_0x2988('0x27'),_0x17cc2d[_0x2988('0x1d')]),_0x241c14);}});ami['on'](_0x2988('0x28'),function(_0xe3c713){try{utils['debug'](util[_0x2988('0x18')](_0x2988('0x29'),_0xe3c713[_0x2988('0x1d')]),_0xe3c713);queues[_0x2988('0x28')](_0xe3c713);}catch(_0x4690bf){utils['error'](util[_0x2988('0x18')](_0x2988('0x29'),_0xe3c713[_0x2988('0x1d')]),_0x4690bf);}});ami['on'](_0x2988('0x2a'),function(_0x53ec70){try{utils[_0x2988('0x17')](util['format'](_0x2988('0x2b'),_0x53ec70['uniqueid']),_0x53ec70);queues[_0x2988('0x2a')](_0x53ec70);calls[_0x2988('0x2a')](_0x53ec70);}catch(_0x10525a){utils[_0x2988('0x14')](util[_0x2988('0x18')]('[%s][index][musiconholdstart]',_0x53ec70[_0x2988('0x1d')]),_0x10525a);}});ami['on'](_0x2988('0x2c'),function(_0x4f44b2){try{utils[_0x2988('0x17')](util['format']('[%s][index][musiconholdstop]',_0x4f44b2[_0x2988('0x1d')]),_0x4f44b2);queues[_0x2988('0x2c')](_0x4f44b2);calls['musiconholdstop'](_0x4f44b2);}catch(_0x11b9fd){utils[_0x2988('0x14')](util[_0x2988('0x18')]('[%s][index][musiconholdstop]',_0x4f44b2[_0x2988('0x1d')]),_0x11b9fd);}});ami['on'](_0x2988('0x2d'),function(_0x1a76c9){try{utils['debug'](util[_0x2988('0x18')](_0x2988('0x2e'),_0x1a76c9[_0x2988('0x1d')]),_0x1a76c9);calls['newstate'](_0x1a76c9);recordings[_0x2988('0x2d')](_0x1a76c9);}catch(_0xc4ee0c){utils[_0x2988('0x14')](util[_0x2988('0x18')](_0x2988('0x2e'),_0x1a76c9[_0x2988('0x1d')]),_0xc4ee0c);}});ami['on'](_0x2988('0x2f'),function(_0x40586c){try{utils[_0x2988('0x17')](util[_0x2988('0x18')](_0x2988('0x30'),_0x40586c['uniqueid']),_0x40586c);calls['hangup'](_0x40586c);recordings[_0x2988('0x2f')](_0x40586c);dials[_0x2988('0x2f')](_0x40586c);agents[_0x2988('0x2f')](_0x40586c);queues[_0x2988('0x2f')](_0x40586c);}catch(_0x1cf7e5){utils[_0x2988('0x14')](util['format'](_0x2988('0x30'),_0x40586c[_0x2988('0x1d')]),_0x1cf7e5);}});ami['on'](_0x2988('0x31'),function(_0x471e4e){try{utils[_0x2988('0x17')](util['format'](_0x2988('0x32'),_0x471e4e[_0x2988('0x1d')]),_0x471e4e);members['cdr'](_0x471e4e);}catch(_0x86276c){utils['error'](util[_0x2988('0x18')](_0x2988('0x32'),_0x471e4e[_0x2988('0x1d')]),_0x86276c);}});ami['on'](_0x2988('0x33'),function(_0x31dc5b){try{utils['debug'](util[_0x2988('0x18')](_0x2988('0x34'),_0x31dc5b[_0x2988('0x1d')]),_0x31dc5b);queues[_0x2988('0x33')](_0x31dc5b);agents[_0x2988('0x33')](_0x31dc5b);transfers[_0x2988('0x33')](_0x31dc5b);}catch(_0x354725){utils[_0x2988('0x14')](util[_0x2988('0x18')](_0x2988('0x34'),_0x31dc5b[_0x2988('0x1d')]),_0x354725);}});ami['on']('attendedtransfer',function(_0x24f489){try{utils[_0x2988('0x17')](util[_0x2988('0x18')](_0x2988('0x35'),_0x24f489[_0x2988('0x36')]),_0x24f489);queues[_0x2988('0x37')](_0x24f489);transfers['attendedtransfer'](_0x24f489);agents[_0x2988('0x37')](_0x24f489);calls[_0x2988('0x37')](_0x24f489);}catch(_0x34647c){utils[_0x2988('0x14')](util[_0x2988('0x18')]('[%s][index][attendedtransfer]',_0x24f489[_0x2988('0x36')]),_0x34647c);}});ami['on'](_0x2988('0x38'),function(_0x25004c){try{utils[_0x2988('0x17')](util['format'](_0x2988('0x39'),_0x25004c[_0x2988('0x1d')]),_0x25004c);queues[_0x2988('0x38')](_0x25004c);recordings[_0x2988('0x38')](_0x25004c);calls[_0x2988('0x38')](_0x25004c);dials[_0x2988('0x38')](_0x25004c);}catch(_0x4d3f3c){utils['error'](util[_0x2988('0x18')]('[%s][index][varset]',_0x25004c[_0x2988('0x1d')]),_0x4d3f3c);}});ami['on'](_0x2988('0x3a'),function(_0xbe176){try{utils[_0x2988('0x17')](util[_0x2988('0x18')](_0x2988('0x3b'),_0xbe176[_0x2988('0x1d')]),_0xbe176);calls[_0x2988('0x3a')](_0xbe176);recordings[_0x2988('0x3a')](_0xbe176);dials[_0x2988('0x3a')](_0xbe176);}catch(_0x251087){utils[_0x2988('0x14')](util[_0x2988('0x18')](_0x2988('0x3b'),_0xbe176['uniqueid']),_0x251087);}});ami['on'](_0x2988('0x3c'),function(_0x5e15ee){try{utils[_0x2988('0x17')](util[_0x2988('0x18')](_0x2988('0x3d'),_0x5e15ee[_0x2988('0x1d')]),_0x5e15ee);calls[_0x2988('0x3c')](_0x5e15ee);recordings['newchannel'](_0x5e15ee);}catch(_0x5dcf2f){utils[_0x2988('0x14')](util['format'](_0x2988('0x3d'),_0x5e15ee[_0x2988('0x1d')]),_0x5dcf2f);}});ami['on'](_0x2988('0x3e'),function(_0x122aa1){try{utils[_0x2988('0x17')](util[_0x2988('0x18')](_0x2988('0x3f'),_0x122aa1['uniqueid']),_0x122aa1);dials[_0x2988('0x3e')](_0x122aa1);}catch(_0x28fb5b){utils[_0x2988('0x14')](util[_0x2988('0x18')](_0x2988('0x40'),_0x122aa1['uniqueid']),_0x28fb5b);}});ami['on'](_0x2988('0x41'),function(_0x42f16f){try{utils[_0x2988('0x17')](util['format'](_0x2988('0x42'),_0x42f16f['uniqueid']),_0x42f16f);dials['dialend'](_0x42f16f);}catch(_0x2efba1){utils[_0x2988('0x14')](util[_0x2988('0x18')](_0x2988('0x42'),_0x42f16f[_0x2988('0x1d')]),_0x2efba1);}});}
\ No newline at end of file
index 1004bb3..69b0d0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8bea=['split','catch','error','[%s][members][writeDB]','uniqueid','some','startsWith','devicestatechange','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','voice','now','agent','isNil','diffTime','exitAt','enterAt','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','[%s][members][agentcomplete]','cdr','debug','[%s][members][cdr]','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','assign','lodash','./utils','Local/_attended@transfer','info','format','interface','channel','data2','membername','type','then','name','internal','request','CreateMemberReport','getUserByName'];(function(_0x2f8000,_0x37c02b){var _0x25cfee=function(_0x56aca2){while(--_0x56aca2){_0x2f8000['push'](_0x2f8000['shift']());}};_0x25cfee(++_0x37c02b);}(_0x8bea,0x116));var _0xa8be=function(_0x5a6a6b,_0x44295a){_0x5a6a6b=_0x5a6a6b-0x0;var _0x3587d2=_0x8bea[_0x5a6a6b];return _0x3587d2;};'use strict';var _=require(_0xa8be('0x0'));var util=require('util');var utils=require(_0xa8be('0x1'));var members={};var exclude=[_0xa8be('0x2'),'Queue:'];function writeDB(_0x3ba70e){utils[_0xa8be('0x3')](util[_0xa8be('0x4')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x3ba70e['uniqueid'],_0x3ba70e[_0xa8be('0x5')],_0x3ba70e[_0xa8be('0x6')],_0x3ba70e[_0xa8be('0x7')],_0x3ba70e[_0xa8be('0x8')],_0x3ba70e[_0xa8be('0x9')]));if(_0x3ba70e['interface']){utils['getUserByInterface'](_0x3ba70e[_0xa8be('0x5')])[_0xa8be('0xa')](function(_0x1de69c){if(_0x1de69c){_0x3ba70e[_0xa8be('0x8')]=_0x1de69c[_0xa8be('0xb')];_0x3ba70e[_0xa8be('0xc')]=_0x1de69c[_0xa8be('0xc')];utils[_0xa8be('0xd')](_0xa8be('0xe'),_0x3ba70e);}else{utils[_0xa8be('0xf')](_0x3ba70e[_0xa8be('0x5')][_0xa8be('0x10')]('/')[0x1])[_0xa8be('0xa')](function(_0x1b651e){if(_0x1b651e){_0x3ba70e['membername']=_0x1b651e[_0xa8be('0xb')];_0x3ba70e[_0xa8be('0xc')]=_0x1b651e[_0xa8be('0xc')];utils['request'](_0xa8be('0xe'),_0x3ba70e);}});}})[_0xa8be('0x11')](function(_0x16aaea){utils[_0xa8be('0x12')](util[_0xa8be('0x4')](_0xa8be('0x13'),_0x3ba70e[_0xa8be('0x14')]),_0x16aaea);});}delete members[_0x3ba70e[_0xa8be('0x5')]];}function startsWith(_0x113cb3,_0x3bc38f){return _[_0xa8be('0x15')](_0x113cb3,function(_0x32ca52){return _[_0xa8be('0x16')](_0x3bc38f,_0x32ca52);});}exports[_0xa8be('0x17')]=function(_0x546cd2){try{utils['debug'](util[_0xa8be('0x4')](_0xa8be('0x18'),members[_0x546cd2[_0xa8be('0x19')]]?members[_0x546cd2[_0xa8be('0x19')]]['uniqueid']:_0x546cd2['device']),_0x546cd2);utils[_0xa8be('0x3')](util[_0xa8be('0x4')](_0xa8be('0x1a'),members[_0x546cd2[_0xa8be('0x19')]]?members[_0x546cd2[_0xa8be('0x19')]][_0xa8be('0x14')]:_0x546cd2[_0xa8be('0x19')],_0x546cd2['state'],_0x546cd2[_0xa8be('0x19')]));switch(_0x546cd2[_0xa8be('0x1b')]){case _0xa8be('0x1c'):case'BUSY':if(!startsWith(exclude,_0x546cd2[_0xa8be('0x19')])){members[_0x546cd2['device']]={'channel':_0xa8be('0x1d'),'interface':_0x546cd2[_0xa8be('0x19')],'type':'TALKING','enterAt':utils[_0xa8be('0x1e')](),'role':_0xa8be('0x1f')};}break;case'NOT_INUSE':if(!_[_0xa8be('0x20')](members[_0x546cd2[_0xa8be('0x19')]])){members[_0x546cd2[_0xa8be('0x19')]]['exitAt']=utils['now']();members[_0x546cd2[_0xa8be('0x19')]]['duration']=utils[_0xa8be('0x21')](members[_0x546cd2['device']][_0xa8be('0x22')],members[_0x546cd2[_0xa8be('0x19')]][_0xa8be('0x23')]);if(members[_0x546cd2[_0xa8be('0x19')]]['uniqueid']){writeDB(members[_0x546cd2[_0xa8be('0x19')]]);}}break;default:break;}}catch(_0xa7cd7a){utils[_0xa8be('0x12')](util[_0xa8be('0x4')]('[%s][members][devicestatechange]',members[_0x546cd2[_0xa8be('0x19')]]?members[_0x546cd2[_0xa8be('0x19')]][_0xa8be('0x14')]:_0x546cd2['device']),_0xa7cd7a);}};exports['agentcomplete']=function(_0x1a5706){try{if(!_[_0xa8be('0x20')](members[_0x1a5706['interface']])){utils['debug'](util[_0xa8be('0x4')]('[%s][members][agentcomplete]',_0x1a5706[_0xa8be('0x14')]),_0x1a5706);utils[_0xa8be('0x3')](util[_0xa8be('0x4')](_0xa8be('0x24'),_0x1a5706[_0xa8be('0x14')],_0x1a5706[_0xa8be('0x5')],_0x1a5706[_0xa8be('0x25')]));members[_0x1a5706['interface']]=_['assign'](members[_0x1a5706['interface']],{'data4':_0x1a5706[_0xa8be('0x25')],'uniqueid':_0x1a5706['uniqueid']});}}catch(_0x46add9){utils[_0xa8be('0x12')](util[_0xa8be('0x4')](_0xa8be('0x26'),_0x1a5706['uniqueid']),_0x46add9);}};exports[_0xa8be('0x27')]=function(_0x53f8d5){try{utils[_0xa8be('0x28')](util[_0xa8be('0x4')](_0xa8be('0x29'),_0x53f8d5[_0xa8be('0x14')]),_0x53f8d5);if(_0x53f8d5[_0xa8be('0x6')]){var _0xbeaafe=_0x53f8d5[_0xa8be('0x6')][_0xa8be('0x10')]('-')[0x0];if(!_['isNil'](members[_0xbeaafe])){members[_0xbeaafe]=_['assign'](members[_0xbeaafe],{'data1':members[_0xbeaafe][_0xa8be('0x2a')]||_0x53f8d5[_0xa8be('0x9')],'data2':members[_0xbeaafe]['data2']||_0x53f8d5[_0xa8be('0x2b')],'data3':members[_0xbeaafe][_0xa8be('0x2c')]||_0x53f8d5[_0xa8be('0x2d')],'uniqueid':members[_0xbeaafe][_0xa8be('0x14')]||_0x53f8d5[_0xa8be('0x14')]});utils['info'](util[_0xa8be('0x4')](_0xa8be('0x2e'),_0x53f8d5[_0xa8be('0x14')],members[_0xbeaafe][_0xa8be('0x2a')],members[_0xbeaafe][_0xa8be('0x7')],members[_0xbeaafe][_0xa8be('0x2c')]));if(members[_0xbeaafe][_0xa8be('0x22')]){writeDB(members[_0xbeaafe]);}}}if(_0x53f8d5[_0xa8be('0x2f')]){var _0xfb6d7e=_0x53f8d5[_0xa8be('0x2f')]['split']('-')[0x0];if(!_[_0xa8be('0x20')](members[_0xfb6d7e])){members[_0xfb6d7e]=_[_0xa8be('0x30')](members[_0xfb6d7e],{'data1':members[_0xfb6d7e][_0xa8be('0x2a')]||_0x53f8d5[_0xa8be('0x9')],'data2':members[_0xfb6d7e][_0xa8be('0x7')]||_0x53f8d5['source'],'data3':members[_0xfb6d7e][_0xa8be('0x2c')]||_0x53f8d5[_0xa8be('0x2d')],'uniqueid':members[_0xfb6d7e][_0xa8be('0x14')]||_0x53f8d5[_0xa8be('0x14')]});utils['info'](util[_0xa8be('0x4')](_0xa8be('0x2e'),_0x53f8d5[_0xa8be('0x14')],members[_0xfb6d7e][_0xa8be('0x2a')],members[_0xfb6d7e]['data2'],members[_0xfb6d7e][_0xa8be('0x2c')]));if(members[_0xfb6d7e][_0xa8be('0x22')]){writeDB(members[_0xfb6d7e]);}}}}catch(_0x9bf4e2){utils[_0xa8be('0x12')](util[_0xa8be('0x4')](_0xa8be('0x29'),_0x53f8d5[_0xa8be('0x14')]),_0x9bf4e2);}};
\ No newline at end of file
+var _0xe18e=['now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','data1','destination','destinationchannel','source','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','util','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','channel','data2','membername','type','getUserByInterface','then','name','request','CreateMemberReport','getUserByName','split','internal','catch','error','uniqueid','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','BUSY','voice','TALKING'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xe18e,0xe5));var _0xee18=function(_0x5e5fdd,_0x2e238a){_0x5e5fdd=_0x5e5fdd-0x0;var _0x5aece7=_0xe18e[_0x5e5fdd];return _0x5aece7;};'use strict';var _=require(_0xee18('0x0'));var util=require(_0xee18('0x1'));var utils=require('./utils');var members={};var exclude=['Local/_attended@transfer',_0xee18('0x2')];function writeDB(_0x8330e){utils[_0xee18('0x3')](util[_0xee18('0x4')](_0xee18('0x5'),_0x8330e['uniqueid'],_0x8330e[_0xee18('0x6')],_0x8330e[_0xee18('0x7')],_0x8330e[_0xee18('0x8')],_0x8330e[_0xee18('0x9')],_0x8330e[_0xee18('0xa')]));if(_0x8330e[_0xee18('0x6')]){utils[_0xee18('0xb')](_0x8330e[_0xee18('0x6')])[_0xee18('0xc')](function(_0xe8b1d7){if(_0xe8b1d7){_0x8330e['membername']=_0xe8b1d7[_0xee18('0xd')];_0x8330e['internal']=_0xe8b1d7['internal'];utils[_0xee18('0xe')](_0xee18('0xf'),_0x8330e);}else{utils[_0xee18('0x10')](_0x8330e[_0xee18('0x6')][_0xee18('0x11')]('/')[0x1])[_0xee18('0xc')](function(_0x19f558){if(_0x19f558){_0x8330e[_0xee18('0x9')]=_0x19f558[_0xee18('0xd')];_0x8330e[_0xee18('0x12')]=_0x19f558['internal'];utils[_0xee18('0xe')](_0xee18('0xf'),_0x8330e);}});}})[_0xee18('0x13')](function(_0xfdc91c){utils[_0xee18('0x14')](util[_0xee18('0x4')]('[%s][members][writeDB]',_0x8330e[_0xee18('0x15')]),_0xfdc91c);});}delete members[_0x8330e['interface']];}function startsWith(_0x143a95,_0x265c7d){return _['some'](_0x143a95,function(_0x2a56dd){return _['startsWith'](_0x265c7d,_0x2a56dd);});}exports[_0xee18('0x16')]=function(_0x467f62){try{utils[_0xee18('0x17')](util[_0xee18('0x4')](_0xee18('0x18'),members[_0x467f62['device']]?members[_0x467f62[_0xee18('0x19')]][_0xee18('0x15')]:_0x467f62[_0xee18('0x19')]),_0x467f62);utils[_0xee18('0x3')](util[_0xee18('0x4')](_0xee18('0x1a'),members[_0x467f62[_0xee18('0x19')]]?members[_0x467f62['device']][_0xee18('0x15')]:_0x467f62[_0xee18('0x19')],_0x467f62[_0xee18('0x1b')],_0x467f62['device']));switch(_0x467f62[_0xee18('0x1b')]){case'INUSE':case _0xee18('0x1c'):if(!startsWith(exclude,_0x467f62[_0xee18('0x19')])){members[_0x467f62[_0xee18('0x19')]]={'channel':_0xee18('0x1d'),'interface':_0x467f62[_0xee18('0x19')],'type':_0xee18('0x1e'),'enterAt':utils[_0xee18('0x1f')](),'role':_0xee18('0x20')};}break;case _0xee18('0x21'):if(!_[_0xee18('0x22')](members[_0x467f62['device']])){members[_0x467f62[_0xee18('0x19')]][_0xee18('0x23')]=utils[_0xee18('0x1f')]();members[_0x467f62[_0xee18('0x19')]][_0xee18('0x24')]=utils[_0xee18('0x25')](members[_0x467f62[_0xee18('0x19')]]['exitAt'],members[_0x467f62[_0xee18('0x19')]][_0xee18('0x26')]);if(members[_0x467f62['device']]['uniqueid']){writeDB(members[_0x467f62['device']]);}}break;default:break;}}catch(_0x2778a3){utils[_0xee18('0x14')](util[_0xee18('0x4')]('[%s][members][devicestatechange]',members[_0x467f62[_0xee18('0x19')]]?members[_0x467f62[_0xee18('0x19')]][_0xee18('0x15')]:_0x467f62[_0xee18('0x19')]),_0x2778a3);}};exports[_0xee18('0x27')]=function(_0x2d57a0){try{if(!_[_0xee18('0x22')](members[_0x2d57a0[_0xee18('0x6')]])){utils['debug'](util[_0xee18('0x4')](_0xee18('0x28'),_0x2d57a0[_0xee18('0x15')]),_0x2d57a0);utils[_0xee18('0x3')](util[_0xee18('0x4')](_0xee18('0x29'),_0x2d57a0[_0xee18('0x15')],_0x2d57a0[_0xee18('0x6')],_0x2d57a0[_0xee18('0x2a')]));members[_0x2d57a0['interface']]=_[_0xee18('0x2b')](members[_0x2d57a0['interface']],{'data4':_0x2d57a0[_0xee18('0x2a')],'uniqueid':_0x2d57a0[_0xee18('0x15')]});}}catch(_0x44cc1d){utils[_0xee18('0x14')](util[_0xee18('0x4')]('[%s][members][agentcomplete]',_0x2d57a0[_0xee18('0x15')]),_0x44cc1d);}};exports[_0xee18('0x2c')]=function(_0x4320d9){try{utils[_0xee18('0x17')](util['format'](_0xee18('0x2d'),_0x4320d9['uniqueid']),_0x4320d9);if(_0x4320d9['channel']){var _0xf04f97=_0x4320d9[_0xee18('0x7')][_0xee18('0x11')]('-')[0x0];if(!_[_0xee18('0x22')](members[_0xf04f97])){members[_0xf04f97]=_[_0xee18('0x2b')](members[_0xf04f97],{'data1':members[_0xf04f97][_0xee18('0x2e')]||_0x4320d9[_0xee18('0xa')],'data2':members[_0xf04f97][_0xee18('0x8')]||_0x4320d9['source'],'data3':members[_0xf04f97]['data3']||_0x4320d9[_0xee18('0x2f')],'uniqueid':members[_0xf04f97][_0xee18('0x15')]||_0x4320d9[_0xee18('0x15')]});utils[_0xee18('0x3')](util[_0xee18('0x4')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x4320d9[_0xee18('0x15')],members[_0xf04f97][_0xee18('0x2e')],members[_0xf04f97][_0xee18('0x8')],members[_0xf04f97]['data3']));if(members[_0xf04f97][_0xee18('0x23')]){writeDB(members[_0xf04f97]);}}}if(_0x4320d9[_0xee18('0x30')]){var _0x30fbc9=_0x4320d9[_0xee18('0x30')][_0xee18('0x11')]('-')[0x0];if(!_[_0xee18('0x22')](members[_0x30fbc9])){members[_0x30fbc9]=_[_0xee18('0x2b')](members[_0x30fbc9],{'data1':members[_0x30fbc9][_0xee18('0x2e')]||_0x4320d9[_0xee18('0xa')],'data2':members[_0x30fbc9][_0xee18('0x8')]||_0x4320d9[_0xee18('0x31')],'data3':members[_0x30fbc9][_0xee18('0x32')]||_0x4320d9[_0xee18('0x2f')],'uniqueid':members[_0x30fbc9][_0xee18('0x15')]||_0x4320d9[_0xee18('0x15')]});utils['info'](util['format'](_0xee18('0x33'),_0x4320d9['uniqueid'],members[_0x30fbc9]['data1'],members[_0x30fbc9]['data2'],members[_0x30fbc9][_0xee18('0x32')]));if(members[_0x30fbc9][_0xee18('0x23')]){writeDB(members[_0x30fbc9]);}}}}catch(_0x22da51){utils[_0xee18('0x14')](util[_0xee18('0x4')](_0xee18('0x2d'),_0x4320d9[_0xee18('0x15')]),_0x22da51);}};
\ No newline at end of file
index 5906785..eddf5f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe78b=['info','position','assign','now','error','isNil','[%s][queues][hangup]','queuecallerabandon','queuecallerexit','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerexitreason','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','value','toUpperCase','CONTINUE','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queuecallerabandonAt','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','count','agentconnect','[%s][queues][agentconnect]','destaccountcode','assigned','membername','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','queuecallercompleteAt','transfer','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','[%s][queues][blindtransfer]','attendedtransfer','origtransfereruniqueid','secondtransfererlinkedid','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','transfertargetuniqueid','calleridname','queuecallerjoinAt','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','queuecallerleaveAt','[%s][queues][attendedtransfer]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','lodash','util','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','lastAssignedTo','calleridnum','accountcode','queue','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','uniqueid'];(function(_0x43db78,_0x36dcdd){var _0x39bbee=function(_0x5f5335){while(--_0x5f5335){_0x43db78['push'](_0x43db78['shift']());}};_0x39bbee(++_0x36dcdd);}(_0xe78b,0x11b));var _0xbe78=function(_0x41e018,_0x54cb55){_0x41e018=_0x41e018-0x0;var _0x52327d=_0xe78b[_0x41e018];return _0x52327d;};'use strict';var _=require(_0xbe78('0x0'));var util=require(_0xbe78('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x2e519e){utils['info'](util[_0xbe78('0x2')](_0xbe78('0x3'),_0x2e519e['uniqueid'],_0x2e519e[_0xbe78('0x4')],_0x2e519e['queue'],_0x2e519e[_0xbe78('0x5')],_0x2e519e[_0xbe78('0x6')],_0x2e519e[_0xbe78('0x7')],_0x2e519e['queuecallerexitreason']));if(_0x2e519e['queue']){utils['getVoiceQueueByName'](_0x2e519e[_0xbe78('0x8')])['then'](function(_0x27bd0b){if(_0x27bd0b){_0x2e519e['type']=_0x27bd0b[_0xbe78('0x9')];}utils[_0xbe78('0xa')](_0xbe78('0xb'),_0x2e519e);});}else{utils[_0xbe78('0xa')](_0xbe78('0xb'),_0x2e519e);}if(_0x2e519e[_0xbe78('0xc')]){delete queues[_0x2e519e[_0xbe78('0xc')]];}else{delete queues[_0x2e519e['uniqueid']];}}exports[_0xbe78('0xd')]=function(_0x4338c7){try{utils[_0xbe78('0xe')](util[_0xbe78('0x2')](_0xbe78('0xf'),_0x4338c7[_0xbe78('0x10')]),_0x4338c7);utils[_0xbe78('0x11')](util[_0xbe78('0x2')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x4338c7[_0xbe78('0x10')],_0x4338c7[_0xbe78('0x8')],_0x4338c7[_0xbe78('0x12')]));queues[_0x4338c7[_0xbe78('0x10')]]=_[_0xbe78('0x13')](_0x4338c7,{'originalposition':_0x4338c7[_0xbe78('0x12')],'queuecallerjoinAt':utils[_0xbe78('0x14')](),'mohtime':0x0});}catch(_0x5ce789){utils[_0xbe78('0x15')](util[_0xbe78('0x2')](_0xbe78('0xf'),_0x4338c7[_0xbe78('0x10')]),_0x5ce789);}};exports['hangup']=function(_0x561fe8){try{if(!_[_0xbe78('0x16')](queues[_0x561fe8[_0xbe78('0x10')]])){utils[_0xbe78('0xe')](util['format'](_0xbe78('0x17'),_0x561fe8[_0xbe78('0x10')]),_0x561fe8);if(queues[_0x561fe8[_0xbe78('0x10')]]['queuecallerleaveAt']){if(!queues[_0x561fe8[_0xbe78('0x10')]][_0xbe78('0x18')]&&!queues[_0x561fe8[_0xbe78('0x10')]][_0xbe78('0x19')]){queues[_0x561fe8[_0xbe78('0x10')]]['queuecallercomplete']=!![];queues[_0x561fe8[_0xbe78('0x10')]]['queuecallercompleteAt']=utils[_0xbe78('0x14')]();queues[_0x561fe8[_0xbe78('0x10')]]['queuecallerexitreason']=_0xbe78('0x1a');}utils[_0xbe78('0x11')](util[_0xbe78('0x2')](_0xbe78('0x1b'),_0x561fe8[_0xbe78('0x10')],queues[_0x561fe8['uniqueid']][_0xbe78('0x1c')],queues[_0x561fe8['uniqueid']][_0xbe78('0x1d')]));writeDB(queues[_0x561fe8[_0xbe78('0x10')]]);}else if(queues[_0x561fe8[_0xbe78('0x10')]][_0xbe78('0xc')]){utils['info'](util['format'](_0xbe78('0x1e'),_0x561fe8[_0xbe78('0x10')],queues[_0x561fe8[_0xbe78('0x10')]][_0xbe78('0x1c')],queues[_0x561fe8[_0xbe78('0x10')]][_0xbe78('0xc')]));queues[queues[_0x561fe8[_0xbe78('0x10')]][_0xbe78('0xc')]]=queues[_0x561fe8[_0xbe78('0x10')]];queues[queues[_0x561fe8['uniqueid']][_0xbe78('0xc')]][_0xbe78('0x1f')]=0x2;delete queues[_0x561fe8[_0xbe78('0x10')]];}}}catch(_0x465729){utils['error'](util[_0xbe78('0x2')](_0xbe78('0x17'),_0x561fe8['uniqueid']),_0x465729);}};exports[_0xbe78('0x20')]=function(_0x3a425b){try{utils[_0xbe78('0xe')](util[_0xbe78('0x2')](_0xbe78('0x21'),_0x3a425b[_0xbe78('0x10')]),_0x3a425b);if(!_[_0xbe78('0x16')](_0x3a425b[_0xbe78('0x22')]['queuestatus'])&&_0x3a425b[_0xbe78('0x23')][_0xbe78('0x24')]()!==_0xbe78('0x25')){if(!_['isNil'](queues[_0x3a425b[_0xbe78('0x10')]])){queues[_0x3a425b['uniqueid']][_0xbe78('0x18')]=![];queues[_0x3a425b[_0xbe78('0x10')]]['queuecallerabandonAt']=null;queues[_0x3a425b[_0xbe78('0x10')]][_0xbe78('0x19')]=!![];queues[_0x3a425b[_0xbe78('0x10')]][_0xbe78('0x26')]=utils[_0xbe78('0x14')]();queues[_0x3a425b['uniqueid']]['queuecallerexitreason']=_0x3a425b[_0xbe78('0x23')][_0xbe78('0x24')]();utils[_0xbe78('0x11')](util['format'](_0xbe78('0x27'),_0x3a425b[_0xbe78('0x10')],queues[_0x3a425b[_0xbe78('0x10')]][_0xbe78('0x1c')],_0x3a425b[_0xbe78('0x23')],queues[_0x3a425b['uniqueid']][_0xbe78('0x1d')]));writeDB(queues[_0x3a425b[_0xbe78('0x10')]]);}}else if(!_[_0xbe78('0x16')](_0x3a425b[_0xbe78('0x22')]['queueposition'])){if(!_[_0xbe78('0x16')](queues[_0x3a425b[_0xbe78('0x10')]])&&!queues[_0x3a425b['uniqueid']][_0xbe78('0x18')]){queues[_0x3a425b[_0xbe78('0x10')]]['queuecallerabandon']=![];queues[_0x3a425b['uniqueid']][_0xbe78('0x28')]=null;queues[_0x3a425b['uniqueid']][_0xbe78('0x19')]=!![];queues[_0x3a425b[_0xbe78('0x10')]][_0xbe78('0x26')]=utils[_0xbe78('0x14')]();queues[_0x3a425b[_0xbe78('0x10')]]['queuecallerexitreason']=_0xbe78('0x29');utils['info'](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x3a425b[_0xbe78('0x10')],queues[_0x3a425b[_0xbe78('0x10')]][_0xbe78('0x1c')],_0x3a425b[_0xbe78('0x23')],queues[_0x3a425b['uniqueid']][_0xbe78('0x1d')]));}}}catch(_0x481fe1){utils[_0xbe78('0x15')](util[_0xbe78('0x2')]('[%s][queues][varset]',_0x3a425b[_0xbe78('0x10')]),_0x481fe1);}};exports[_0xbe78('0x18')]=function(_0x166d62){try{if(!_[_0xbe78('0x16')](queues[_0x166d62['uniqueid']])){utils[_0xbe78('0xe')](util[_0xbe78('0x2')](_0xbe78('0x2a'),_0x166d62[_0xbe78('0x10')]),_0x166d62);queues[_0x166d62[_0xbe78('0x10')]][_0xbe78('0x19')]=![];queues[_0x166d62[_0xbe78('0x10')]][_0xbe78('0x26')]=null;queues[_0x166d62[_0xbe78('0x10')]][_0xbe78('0x18')]=!![];queues[_0x166d62[_0xbe78('0x10')]]['queuecallerabandonAt']=utils[_0xbe78('0x14')]();queues[_0x166d62[_0xbe78('0x10')]][_0xbe78('0x1d')]=_0xbe78('0x2b');utils[_0xbe78('0x11')](util[_0xbe78('0x2')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x166d62[_0xbe78('0x10')],queues[_0x166d62[_0xbe78('0x10')]][_0xbe78('0x1c')],queues[_0x166d62[_0xbe78('0x10')]]['queuecallerexitreason']));}}catch(_0x46199e){utils[_0xbe78('0x15')](util[_0xbe78('0x2')](_0xbe78('0x2a'),_0x166d62[_0xbe78('0x10')]),_0x46199e);}};exports[_0xbe78('0x2c')]=function(_0x3e9eec){try{if(!_[_0xbe78('0x16')](queues[_0x3e9eec[_0xbe78('0x10')]])){utils[_0xbe78('0xe')](util[_0xbe78('0x2')](_0xbe78('0x2d'),_0x3e9eec[_0xbe78('0x10')]),_0x3e9eec);utils['info'](util[_0xbe78('0x2')](_0xbe78('0x2e'),_0x3e9eec[_0xbe78('0x10')],queues[_0x3e9eec[_0xbe78('0x10')]][_0xbe78('0x1c')],_0x3e9eec[_0xbe78('0x2f')],_0x3e9eec[_0xbe78('0x30')]));queues[_0x3e9eec[_0xbe78('0x10')]]['queuecallerleave']=!![];queues[_0x3e9eec[_0xbe78('0x10')]]['queuecallerleaveAt']=utils['now']();queues[_0x3e9eec[_0xbe78('0x10')]][_0xbe78('0x31')]=utils[_0xbe78('0x32')](queues[_0x3e9eec[_0xbe78('0x10')]]['queuecallerleaveAt'],queues[_0x3e9eec['uniqueid']]['queuecallerjoinAt']);queues[_0x3e9eec['uniqueid']][_0xbe78('0x12')]=_0x3e9eec['position'];queues[_0x3e9eec['uniqueid']]['count']=_0x3e9eec[_0xbe78('0x33')];queues[_0x3e9eec[_0xbe78('0x10')]][_0xbe78('0x2f')]=_0x3e9eec['connectedlinenum'];queues[_0x3e9eec['uniqueid']][_0xbe78('0x30')]=_0x3e9eec[_0xbe78('0x30')];}}catch(_0x108af9){utils[_0xbe78('0x15')](util[_0xbe78('0x2')](_0xbe78('0x2d'),_0x3e9eec[_0xbe78('0x10')]),_0x108af9);}};exports[_0xbe78('0x34')]=function(_0x4afe18){try{if(!_[_0xbe78('0x16')](queues[_0x4afe18['uniqueid']])){utils[_0xbe78('0xe')](util[_0xbe78('0x2')](_0xbe78('0x35'),_0x4afe18[_0xbe78('0x10')]),_0x4afe18);utils['info'](util['format']('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x4afe18[_0xbe78('0x10')],queues[_0x4afe18['uniqueid']][_0xbe78('0x1c')],_0x4afe18['membername'],_0x4afe18[_0xbe78('0x36')]));queues[_0x4afe18[_0xbe78('0x10')]][_0xbe78('0x18')]=![];queues[_0x4afe18[_0xbe78('0x10')]][_0xbe78('0x18')]=![];queues[_0x4afe18['uniqueid']]['queuecallerabandonAt']=null;queues[_0x4afe18[_0xbe78('0x10')]]['queuecallerexit']=![];queues[_0x4afe18[_0xbe78('0x10')]][_0xbe78('0x1d')]=null;queues[_0x4afe18['uniqueid']][_0xbe78('0x26')]=null;queues[_0x4afe18[_0xbe78('0x10')]][_0xbe78('0x37')]=!![];queues[_0x4afe18[_0xbe78('0x10')]]['accountcode']=_0x4afe18[_0xbe78('0x36')];queues[_0x4afe18[_0xbe78('0x10')]][_0xbe78('0x5')]=_0x4afe18[_0xbe78('0x38')];}}catch(_0x566a9c){utils[_0xbe78('0x15')](util['format'](_0xbe78('0x35'),_0x4afe18['uniqueid']),_0x566a9c);}};exports[_0xbe78('0x39')]=function(_0x289d32){try{if(!_[_0xbe78('0x16')](queues[_0x289d32[_0xbe78('0x10')]])){if(queues[_0x289d32['uniqueid']]['queuecallerleaveAt']){utils[_0xbe78('0xe')](util[_0xbe78('0x2')](_0xbe78('0x3a'),_0x289d32[_0xbe78('0x10')]),_0x289d32);queues[_0x289d32['uniqueid']]['queuecallerabandon']=![];queues[_0x289d32[_0xbe78('0x10')]][_0xbe78('0x18')]=![];queues[_0x289d32[_0xbe78('0x10')]][_0xbe78('0x28')]=null;queues[_0x289d32['uniqueid']][_0xbe78('0x19')]=![];queues[_0x289d32[_0xbe78('0x10')]][_0xbe78('0x26')]=null;queues[_0x289d32[_0xbe78('0x10')]][_0xbe78('0x37')]=!![];queues[_0x289d32['uniqueid']][_0xbe78('0x5')]=_0x289d32['membername'];queues[_0x289d32[_0xbe78('0x10')]][_0xbe78('0x3b')]=!![];queues[_0x289d32[_0xbe78('0x10')]][_0xbe78('0x3c')]=utils[_0xbe78('0x14')]();if(_0x289d32['reason']==_0xbe78('0x3d')){if(!queues[_0x289d32['uniqueid']][_0xbe78('0x3d')]){queues[_0x289d32[_0xbe78('0x10')]]['queuecallerexitreason']='TRANSFER';}}else{queues[_0x289d32[_0xbe78('0x10')]][_0xbe78('0x1d')]=_0xbe78('0x3e')+_0x289d32[_0xbe78('0x3f')][_0xbe78('0x24')]();}utils[_0xbe78('0x11')](util[_0xbe78('0x2')](_0xbe78('0x40'),_0x289d32[_0xbe78('0x10')],queues[_0x289d32['uniqueid']]['name'],_0x289d32[_0xbe78('0x38')],queues[_0x289d32['uniqueid']][_0xbe78('0x1d')]));writeDB(queues[_0x289d32[_0xbe78('0x10')]]);}}}catch(_0x27302d){utils[_0xbe78('0x15')](util[_0xbe78('0x2')](_0xbe78('0x3a'),_0x289d32[_0xbe78('0x10')]),_0x27302d);}};exports[_0xbe78('0x41')]=function(_0x1fddd3){try{if(!_['isNil'](queues[_0x1fddd3[_0xbe78('0x42')]])){utils['debug'](util[_0xbe78('0x2')]('[%s][queues][blindtransfer]',_0x1fddd3[_0xbe78('0x10')]),_0x1fddd3);queues[_0x1fddd3[_0xbe78('0x42')]][_0xbe78('0x3d')]=!![];queues[_0x1fddd3[_0xbe78('0x42')]][_0xbe78('0x43')]=_0xbe78('0x44');queues[_0x1fddd3['transfereeuniqueid']][_0xbe78('0x45')]=_0x1fddd3['extension'];queues[_0x1fddd3[_0xbe78('0x42')]][_0xbe78('0x46')]=_0x1fddd3[_0xbe78('0x42')];queues[_0x1fddd3['transfereeuniqueid']][_0xbe78('0x1d')]=_0xbe78('0x47');utils[_0xbe78('0x11')](util[_0xbe78('0x2')](_0xbe78('0x48'),_0x1fddd3['uniqueid'],queues[_0x1fddd3[_0xbe78('0x42')]][_0xbe78('0x1c')],_0x1fddd3[_0xbe78('0x42')],_0x1fddd3[_0xbe78('0x49')]));}}catch(_0xf71db5){utils[_0xbe78('0x15')](util[_0xbe78('0x2')](_0xbe78('0x4a'),_0x1fddd3['uniqueid']),_0xf71db5);}};exports[_0xbe78('0x4b')]=function(_0x79d799){try{utils[_0xbe78('0xe')](util[_0xbe78('0x2')]('[%s][queues][attendedtransfer]',_0x79d799['origtransfereruniqueid']),_0x79d799);if(_0x79d799[_0xbe78('0x4c')]==_0x79d799['origtransfererlinkedid']){if(!_['isNil'](queues[_0x79d799['secondtransfererlinkedid']])){utils[_0xbe78('0x11')](util[_0xbe78('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x79d799['origtransfereruniqueid'],queues[_0x79d799[_0xbe78('0x4d')]][_0xbe78('0x1c')],_0x79d799[_0xbe78('0x4e')]));queues[_0x79d799[_0xbe78('0x4d')]][_0xbe78('0x3d')]=!![];queues[_0x79d799[_0xbe78('0x4d')]][_0xbe78('0x43')]=_0xbe78('0x4f');queues[_0x79d799[_0xbe78('0x4d')]]['transferexten']=_0x79d799['origtransfererexten'];queues[_0x79d799[_0xbe78('0x4d')]][_0xbe78('0x46')]=_0x79d799[_0xbe78('0x4c')];queues[_0x79d799[_0xbe78('0x4d')]][_0xbe78('0x1d')]=_0xbe78('0x50');}if(!_['isNil'](queues[_0x79d799[_0xbe78('0x51')]])){if(_0x79d799[_0xbe78('0x52')]&&queues[_0x79d799[_0xbe78('0x52')]]){queues[_0x79d799[_0xbe78('0x52')]][_0xbe78('0x1f')]=0x1;queues[_0x79d799[_0xbe78('0x42')]]=_[_0xbe78('0x53')](queues[_0x79d799[_0xbe78('0x52')]]);queues[_0x79d799[_0xbe78('0x42')]]['transfereduniqueid']=_0x79d799[_0xbe78('0x54')];queues[_0x79d799[_0xbe78('0x42')]][_0xbe78('0x1f')]=0x2;queues[_0x79d799[_0xbe78('0x42')]]['calleridnum']=queues[_0x79d799[_0xbe78('0x4d')]][_0xbe78('0x6')];queues[_0x79d799[_0xbe78('0x42')]][_0xbe78('0x55')]=queues[_0x79d799[_0xbe78('0x4d')]][_0xbe78('0x55')];queues[_0x79d799['transfereeuniqueid']][_0xbe78('0x56')]=utils['now']();queues[_0x79d799[_0xbe78('0x42')]]['queuecallerleaveAt']=utils['now']();queues[_0x79d799[_0xbe78('0x42')]][_0xbe78('0x31')]=0x0;queues[_0x79d799[_0xbe78('0x42')]][_0xbe78('0x57')]=0x0;utils[_0xbe78('0x11')](util[_0xbe78('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x79d799['origtransfereruniqueid'],queues[_0x79d799[_0xbe78('0x42')]][_0xbe78('0x1c')],queues[_0x79d799[_0xbe78('0x42')]]['calleridnum'],queues[_0x79d799['transfereeuniqueid']][_0xbe78('0x55')]));}else{utils['info'](util[_0xbe78('0x2')](_0xbe78('0x58'),_0x79d799['origtransfereruniqueid'],queues[_0x79d799['origtransfererlinkedid']][_0xbe78('0x1c')],_0x79d799[_0xbe78('0x4d')]));queues[_0x79d799[_0xbe78('0x51')]]['transfereduniqueid']=_0x79d799['secondtransfererlinkedid'];}}}else if(_0x79d799[_0xbe78('0x59')]==_0x79d799[_0xbe78('0x4d')]){if(!_['isNil'](queues[_0x79d799[_0xbe78('0x51')]])){utils[_0xbe78('0x11')](util[_0xbe78('0x2')](_0xbe78('0x5a'),_0x79d799[_0xbe78('0x4c')],queues[_0x79d799[_0xbe78('0x51')]]['name'],_0x79d799[_0xbe78('0x59')],_0x79d799[_0xbe78('0x5b')]));queues[_0x79d799[_0xbe78('0x51')]][_0xbe78('0x3d')]=!![];queues[_0x79d799[_0xbe78('0x51')]][_0xbe78('0x43')]=_0xbe78('0x4f');queues[_0x79d799[_0xbe78('0x51')]]['transferexten']=_0x79d799[_0xbe78('0x5b')];queues[_0x79d799['origtransfererlinkedid']][_0xbe78('0x46')]=_0x79d799['secondtransfereruniqueid'];queues[_0x79d799[_0xbe78('0x51')]][_0xbe78('0x1d')]=_0xbe78('0x50');}if(!_[_0xbe78('0x16')](queues[_0x79d799[_0xbe78('0x4d')]])){if(_0x79d799[_0xbe78('0x5c')]&&queues[_0x79d799[_0xbe78('0x5c')]]){queues[_0x79d799[_0xbe78('0x5c')]][_0xbe78('0x1f')]=0x1;queues[_0x79d799[_0xbe78('0x54')]]=_[_0xbe78('0x53')](queues[_0x79d799[_0xbe78('0x5c')]]);queues[_0x79d799['transfertargetuniqueid']][_0xbe78('0xc')]=_0x79d799['transfertargetuniqueid'];queues[_0x79d799[_0xbe78('0x54')]][_0xbe78('0x1f')]=0x2;queues[_0x79d799[_0xbe78('0x54')]]['calleridnum']=queues[_0x79d799['origtransfererlinkedid']][_0xbe78('0x6')];queues[_0x79d799['transfertargetuniqueid']][_0xbe78('0x55')]=queues[_0x79d799[_0xbe78('0x51')]][_0xbe78('0x55')];queues[_0x79d799[_0xbe78('0x54')]][_0xbe78('0x56')]=utils[_0xbe78('0x14')]();queues[_0x79d799[_0xbe78('0x54')]][_0xbe78('0x5d')]=utils[_0xbe78('0x14')]();queues[_0x79d799[_0xbe78('0x54')]]['holdtime']=0x0;queues[_0x79d799[_0xbe78('0x54')]][_0xbe78('0x57')]=0x0;utils['info'](util[_0xbe78('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x79d799[_0xbe78('0x4c')],queues[_0x79d799[_0xbe78('0x54')]]['name'],queues[_0x79d799[_0xbe78('0x54')]][_0xbe78('0xc')],queues[_0x79d799[_0xbe78('0x54')]][_0xbe78('0x6')],queues[_0x79d799[_0xbe78('0x54')]][_0xbe78('0x55')]));}else{utils['info'](util[_0xbe78('0x2')](_0xbe78('0x58'),_0x79d799['origtransfereruniqueid'],queues[_0x79d799[_0xbe78('0x4d')]][_0xbe78('0x1c')],_0x79d799['origtransfererlinkedid']));queues[_0x79d799[_0xbe78('0x4d')]][_0xbe78('0xc')]=_0x79d799['origtransfererlinkedid'];}}}}catch(_0x549dca){utils[_0xbe78('0x15')](util[_0xbe78('0x2')](_0xbe78('0x5e'),_0x79d799[_0xbe78('0x4c')]),_0x549dca);}};exports['musiconholdstart']=function(_0x10aa41){try{if(!_[_0xbe78('0x16')](queues[_0x10aa41[_0xbe78('0x10')]])){utils[_0xbe78('0xe')](util[_0xbe78('0x2')]('[%s][queues][musiconholdstart]',_0x10aa41[_0xbe78('0x10')]),_0x10aa41);queues[_0x10aa41[_0xbe78('0x10')]][_0xbe78('0x5f')]=utils[_0xbe78('0x14')]();utils[_0xbe78('0x11')](util[_0xbe78('0x2')](_0xbe78('0x60'),_0x10aa41['uniqueid'],queues[_0x10aa41[_0xbe78('0x10')]][_0xbe78('0x1c')],queues[_0x10aa41[_0xbe78('0x10')]][_0xbe78('0x5f')]));}}catch(_0x1313dc){utils[_0xbe78('0x15')](util[_0xbe78('0x2')]('[%s][queues][musiconholdstart]',_0x10aa41[_0xbe78('0x10')]),_0x1313dc);}};exports[_0xbe78('0x61')]=function(_0x25b0f9){try{if(!_[_0xbe78('0x16')](queues[_0x25b0f9[_0xbe78('0x10')]])){if(!_[_0xbe78('0x16')](queues[_0x25b0f9['uniqueid']][_0xbe78('0x5f')])){utils['debug'](util[_0xbe78('0x2')]('[%s][queues][musiconholdstop]',_0x25b0f9[_0xbe78('0x10')]),_0x25b0f9);queues[_0x25b0f9[_0xbe78('0x10')]][_0xbe78('0x57')]+=utils[_0xbe78('0x32')](utils[_0xbe78('0x14')](),queues[_0x25b0f9[_0xbe78('0x10')]][_0xbe78('0x5f')]);utils[_0xbe78('0x11')](util[_0xbe78('0x2')](_0xbe78('0x62'),_0x25b0f9[_0xbe78('0x10')],queues[_0x25b0f9[_0xbe78('0x10')]][_0xbe78('0x1c')],queues[_0x25b0f9['uniqueid']][_0xbe78('0x57')]));delete queues[_0x25b0f9[_0xbe78('0x10')]][_0xbe78('0x5f')];}}}catch(_0x568d10){utils[_0xbe78('0x15')](util[_0xbe78('0x2')](_0xbe78('0x63'),_0x25b0f9[_0xbe78('0x10')]),_0x568d10);}};
\ No newline at end of file
+var _0x0ee0=['error','varset','[%s][queues][varset]','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','variable','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','[%s][queues][queuecallerleave]','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','lastAssignedTo','agentcomplete','[%s][queues][agentcomplete]','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','ATTENDED','transferexten','transfereelinkedid','clone','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','lodash','util','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','queue','calleridnum','accountcode','queuecallerexitreason','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','[%s][queues][queuecallerjoin]','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason'];(function(_0x2b6620,_0x482784){var _0x1153cb=function(_0x18780a){while(--_0x18780a){_0x2b6620['push'](_0x2b6620['shift']());}};_0x1153cb(++_0x482784);}(_0x0ee0,0x1ec));var _0x00ee=function(_0x299624,_0x29e829){_0x299624=_0x299624-0x0;var _0x7a49f3=_0x0ee0[_0x299624];return _0x7a49f3;};'use strict';var _=require(_0x00ee('0x0'));var util=require(_0x00ee('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x1f13a3){utils[_0x00ee('0x2')](util[_0x00ee('0x3')](_0x00ee('0x4'),_0x1f13a3[_0x00ee('0x5')],_0x1f13a3['channel'],_0x1f13a3[_0x00ee('0x6')],_0x1f13a3['lastAssignedTo'],_0x1f13a3[_0x00ee('0x7')],_0x1f13a3[_0x00ee('0x8')],_0x1f13a3[_0x00ee('0x9')]));if(_0x1f13a3[_0x00ee('0x6')]){utils['getVoiceQueueByName'](_0x1f13a3[_0x00ee('0x6')])[_0x00ee('0xa')](function(_0x451bcb){if(_0x451bcb){_0x1f13a3['type']=_0x451bcb[_0x00ee('0xb')];}utils[_0x00ee('0xc')](_0x00ee('0xd'),_0x1f13a3);});}else{utils[_0x00ee('0xc')](_0x00ee('0xd'),_0x1f13a3);}if(_0x1f13a3['transfereduniqueid']){delete queues[_0x1f13a3[_0x00ee('0xe')]];}else{delete queues[_0x1f13a3[_0x00ee('0x5')]];}}exports[_0x00ee('0xf')]=function(_0xf36659){try{utils[_0x00ee('0x10')](util[_0x00ee('0x3')]('[%s][queues][queuecallerjoin]',_0xf36659[_0x00ee('0x5')]),_0xf36659);utils[_0x00ee('0x2')](util[_0x00ee('0x3')](_0x00ee('0x11'),_0xf36659['uniqueid'],_0xf36659[_0x00ee('0x6')],_0xf36659[_0x00ee('0x12')]));queues[_0xf36659[_0x00ee('0x5')]]=_[_0x00ee('0x13')](_0xf36659,{'originalposition':_0xf36659[_0x00ee('0x12')],'queuecallerjoinAt':utils[_0x00ee('0x14')](),'mohtime':0x0});}catch(_0x3bb823){utils['error'](util[_0x00ee('0x3')](_0x00ee('0x15'),_0xf36659[_0x00ee('0x5')]),_0x3bb823);}};exports['hangup']=function(_0x1310bc){try{if(!_[_0x00ee('0x16')](queues[_0x1310bc['uniqueid']])){utils['debug'](util[_0x00ee('0x3')](_0x00ee('0x17'),_0x1310bc['uniqueid']),_0x1310bc);if(queues[_0x1310bc[_0x00ee('0x5')]][_0x00ee('0x18')]){if(!queues[_0x1310bc['uniqueid']][_0x00ee('0x19')]&&!queues[_0x1310bc[_0x00ee('0x5')]][_0x00ee('0x1a')]){queues[_0x1310bc[_0x00ee('0x5')]][_0x00ee('0x1b')]=!![];queues[_0x1310bc[_0x00ee('0x5')]]['queuecallercompleteAt']=utils[_0x00ee('0x14')]();queues[_0x1310bc['uniqueid']][_0x00ee('0x9')]=_0x00ee('0x1c');}utils['info'](util[_0x00ee('0x3')](_0x00ee('0x1d'),_0x1310bc[_0x00ee('0x5')],queues[_0x1310bc['uniqueid']][_0x00ee('0x1e')],queues[_0x1310bc[_0x00ee('0x5')]][_0x00ee('0x9')]));writeDB(queues[_0x1310bc[_0x00ee('0x5')]]);}else if(queues[_0x1310bc[_0x00ee('0x5')]]['transfereduniqueid']){utils[_0x00ee('0x2')](util['format'](_0x00ee('0x1f'),_0x1310bc[_0x00ee('0x5')],queues[_0x1310bc[_0x00ee('0x5')]][_0x00ee('0x1e')],queues[_0x1310bc[_0x00ee('0x5')]][_0x00ee('0xe')]));queues[queues[_0x1310bc[_0x00ee('0x5')]][_0x00ee('0xe')]]=queues[_0x1310bc[_0x00ee('0x5')]];queues[queues[_0x1310bc[_0x00ee('0x5')]][_0x00ee('0xe')]][_0x00ee('0x20')]=0x2;delete queues[_0x1310bc[_0x00ee('0x5')]];}}}catch(_0x5d2fca){utils[_0x00ee('0x21')](util['format'](_0x00ee('0x17'),_0x1310bc[_0x00ee('0x5')]),_0x5d2fca);}};exports[_0x00ee('0x22')]=function(_0x1f72be){try{utils[_0x00ee('0x10')](util['format'](_0x00ee('0x23'),_0x1f72be['uniqueid']),_0x1f72be);if(!_[_0x00ee('0x16')](_0x1f72be['variable'][_0x00ee('0x24')])&&_0x1f72be[_0x00ee('0x25')][_0x00ee('0x26')]()!==_0x00ee('0x27')){if(!_[_0x00ee('0x16')](queues[_0x1f72be[_0x00ee('0x5')]])){queues[_0x1f72be[_0x00ee('0x5')]][_0x00ee('0x19')]=![];queues[_0x1f72be[_0x00ee('0x5')]][_0x00ee('0x28')]=null;queues[_0x1f72be[_0x00ee('0x5')]][_0x00ee('0x1a')]=!![];queues[_0x1f72be[_0x00ee('0x5')]][_0x00ee('0x29')]=utils[_0x00ee('0x14')]();queues[_0x1f72be[_0x00ee('0x5')]]['queuecallerexitreason']=_0x1f72be['value']['toUpperCase']();utils[_0x00ee('0x2')](util[_0x00ee('0x3')](_0x00ee('0x2a'),_0x1f72be['uniqueid'],queues[_0x1f72be['uniqueid']]['name'],_0x1f72be[_0x00ee('0x25')],queues[_0x1f72be[_0x00ee('0x5')]][_0x00ee('0x9')]));writeDB(queues[_0x1f72be[_0x00ee('0x5')]]);}}else if(!_['isNil'](_0x1f72be[_0x00ee('0x2b')][_0x00ee('0x2c')])){if(!_['isNil'](queues[_0x1f72be[_0x00ee('0x5')]])&&!queues[_0x1f72be['uniqueid']][_0x00ee('0x19')]){queues[_0x1f72be[_0x00ee('0x5')]][_0x00ee('0x19')]=![];queues[_0x1f72be[_0x00ee('0x5')]][_0x00ee('0x28')]=null;queues[_0x1f72be[_0x00ee('0x5')]][_0x00ee('0x1a')]=!![];queues[_0x1f72be[_0x00ee('0x5')]][_0x00ee('0x29')]=utils[_0x00ee('0x14')]();queues[_0x1f72be[_0x00ee('0x5')]]['queuecallerexitreason']=_0x00ee('0x2d');utils[_0x00ee('0x2')](util['format'](_0x00ee('0x2e'),_0x1f72be[_0x00ee('0x5')],queues[_0x1f72be['uniqueid']][_0x00ee('0x1e')],_0x1f72be[_0x00ee('0x25')],queues[_0x1f72be[_0x00ee('0x5')]][_0x00ee('0x9')]));}}}catch(_0x3c3641){utils[_0x00ee('0x21')](util['format'](_0x00ee('0x23'),_0x1f72be[_0x00ee('0x5')]),_0x3c3641);}};exports[_0x00ee('0x19')]=function(_0x4f0885){try{if(!_[_0x00ee('0x16')](queues[_0x4f0885[_0x00ee('0x5')]])){utils['debug'](util['format'](_0x00ee('0x2f'),_0x4f0885[_0x00ee('0x5')]),_0x4f0885);queues[_0x4f0885[_0x00ee('0x5')]][_0x00ee('0x1a')]=![];queues[_0x4f0885[_0x00ee('0x5')]][_0x00ee('0x29')]=null;queues[_0x4f0885['uniqueid']][_0x00ee('0x19')]=!![];queues[_0x4f0885[_0x00ee('0x5')]][_0x00ee('0x28')]=utils[_0x00ee('0x14')]();queues[_0x4f0885[_0x00ee('0x5')]]['queuecallerexitreason']=_0x00ee('0x30');utils[_0x00ee('0x2')](util['format'](_0x00ee('0x31'),_0x4f0885['uniqueid'],queues[_0x4f0885[_0x00ee('0x5')]][_0x00ee('0x1e')],queues[_0x4f0885['uniqueid']][_0x00ee('0x9')]));}}catch(_0x403eee){utils[_0x00ee('0x21')](util['format'](_0x00ee('0x2f'),_0x4f0885[_0x00ee('0x5')]),_0x403eee);}};exports[_0x00ee('0x32')]=function(_0x33c5c9){try{if(!_['isNil'](queues[_0x33c5c9[_0x00ee('0x5')]])){utils[_0x00ee('0x10')](util[_0x00ee('0x3')]('[%s][queues][queuecallerleave]',_0x33c5c9[_0x00ee('0x5')]),_0x33c5c9);utils['info'](util['format'](_0x00ee('0x33'),_0x33c5c9[_0x00ee('0x5')],queues[_0x33c5c9[_0x00ee('0x5')]][_0x00ee('0x1e')],_0x33c5c9[_0x00ee('0x34')],_0x33c5c9[_0x00ee('0x35')]));queues[_0x33c5c9['uniqueid']][_0x00ee('0x32')]=!![];queues[_0x33c5c9[_0x00ee('0x5')]][_0x00ee('0x18')]=utils[_0x00ee('0x14')]();queues[_0x33c5c9[_0x00ee('0x5')]][_0x00ee('0x36')]=utils[_0x00ee('0x37')](queues[_0x33c5c9[_0x00ee('0x5')]][_0x00ee('0x18')],queues[_0x33c5c9['uniqueid']][_0x00ee('0x38')]);queues[_0x33c5c9[_0x00ee('0x5')]][_0x00ee('0x12')]=_0x33c5c9[_0x00ee('0x12')];queues[_0x33c5c9['uniqueid']][_0x00ee('0x39')]=_0x33c5c9[_0x00ee('0x39')];queues[_0x33c5c9[_0x00ee('0x5')]][_0x00ee('0x34')]=_0x33c5c9[_0x00ee('0x34')];queues[_0x33c5c9[_0x00ee('0x5')]][_0x00ee('0x35')]=_0x33c5c9[_0x00ee('0x35')];}}catch(_0x5d7113){utils[_0x00ee('0x21')](util[_0x00ee('0x3')](_0x00ee('0x3a'),_0x33c5c9[_0x00ee('0x5')]),_0x5d7113);}};exports['agentconnect']=function(_0x2bbaed){try{if(!_[_0x00ee('0x16')](queues[_0x2bbaed[_0x00ee('0x5')]])){utils[_0x00ee('0x10')](util['format'](_0x00ee('0x3b'),_0x2bbaed['uniqueid']),_0x2bbaed);utils[_0x00ee('0x2')](util['format'](_0x00ee('0x3c'),_0x2bbaed[_0x00ee('0x5')],queues[_0x2bbaed[_0x00ee('0x5')]][_0x00ee('0x1e')],_0x2bbaed[_0x00ee('0x3d')],_0x2bbaed[_0x00ee('0x3e')]));queues[_0x2bbaed[_0x00ee('0x5')]][_0x00ee('0x19')]=![];queues[_0x2bbaed[_0x00ee('0x5')]][_0x00ee('0x19')]=![];queues[_0x2bbaed[_0x00ee('0x5')]][_0x00ee('0x28')]=null;queues[_0x2bbaed[_0x00ee('0x5')]][_0x00ee('0x1a')]=![];queues[_0x2bbaed[_0x00ee('0x5')]][_0x00ee('0x9')]=null;queues[_0x2bbaed[_0x00ee('0x5')]][_0x00ee('0x29')]=null;queues[_0x2bbaed['uniqueid']][_0x00ee('0x3f')]=!![];queues[_0x2bbaed[_0x00ee('0x5')]][_0x00ee('0x8')]=_0x2bbaed[_0x00ee('0x3e')];queues[_0x2bbaed[_0x00ee('0x5')]][_0x00ee('0x40')]=_0x2bbaed[_0x00ee('0x3d')];}}catch(_0x33fd89){utils[_0x00ee('0x21')](util[_0x00ee('0x3')]('[%s][queues][agentconnect]',_0x2bbaed[_0x00ee('0x5')]),_0x33fd89);}};exports[_0x00ee('0x41')]=function(_0x97d15f){try{if(!_[_0x00ee('0x16')](queues[_0x97d15f[_0x00ee('0x5')]])){if(queues[_0x97d15f['uniqueid']]['queuecallerleaveAt']){utils['debug'](util[_0x00ee('0x3')](_0x00ee('0x42'),_0x97d15f[_0x00ee('0x5')]),_0x97d15f);queues[_0x97d15f[_0x00ee('0x5')]][_0x00ee('0x19')]=![];queues[_0x97d15f[_0x00ee('0x5')]][_0x00ee('0x19')]=![];queues[_0x97d15f[_0x00ee('0x5')]]['queuecallerabandonAt']=null;queues[_0x97d15f[_0x00ee('0x5')]]['queuecallerexit']=![];queues[_0x97d15f[_0x00ee('0x5')]][_0x00ee('0x29')]=null;queues[_0x97d15f[_0x00ee('0x5')]][_0x00ee('0x3f')]=!![];queues[_0x97d15f['uniqueid']][_0x00ee('0x40')]=_0x97d15f[_0x00ee('0x3d')];queues[_0x97d15f[_0x00ee('0x5')]]['queuecallercomplete']=!![];queues[_0x97d15f['uniqueid']][_0x00ee('0x43')]=utils[_0x00ee('0x14')]();if(_0x97d15f[_0x00ee('0x44')]==_0x00ee('0x45')){if(!queues[_0x97d15f[_0x00ee('0x5')]][_0x00ee('0x45')]){queues[_0x97d15f[_0x00ee('0x5')]][_0x00ee('0x9')]=_0x00ee('0x46');}}else{queues[_0x97d15f['uniqueid']][_0x00ee('0x9')]=_0x00ee('0x47')+_0x97d15f[_0x00ee('0x44')][_0x00ee('0x26')]();}utils[_0x00ee('0x2')](util[_0x00ee('0x3')](_0x00ee('0x48'),_0x97d15f[_0x00ee('0x5')],queues[_0x97d15f[_0x00ee('0x5')]][_0x00ee('0x1e')],_0x97d15f[_0x00ee('0x3d')],queues[_0x97d15f[_0x00ee('0x5')]][_0x00ee('0x9')]));writeDB(queues[_0x97d15f[_0x00ee('0x5')]]);}}}catch(_0xd713cc){utils[_0x00ee('0x21')](util['format'](_0x00ee('0x42'),_0x97d15f['uniqueid']),_0xd713cc);}};exports['blindtransfer']=function(_0x42209b){try{if(!_['isNil'](queues[_0x42209b['transfereeuniqueid']])){utils['debug'](util[_0x00ee('0x3')](_0x00ee('0x49'),_0x42209b['uniqueid']),_0x42209b);queues[_0x42209b[_0x00ee('0x4a')]][_0x00ee('0x45')]=!![];queues[_0x42209b[_0x00ee('0x4a')]][_0x00ee('0x4b')]=_0x00ee('0x4c');queues[_0x42209b[_0x00ee('0x4a')]]['transferexten']=_0x42209b[_0x00ee('0x4d')];queues[_0x42209b[_0x00ee('0x4a')]][_0x00ee('0x4e')]=_0x42209b[_0x00ee('0x4a')];queues[_0x42209b[_0x00ee('0x4a')]]['queuecallerexitreason']=_0x00ee('0x4f');utils[_0x00ee('0x2')](util[_0x00ee('0x3')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x42209b[_0x00ee('0x5')],queues[_0x42209b['transfereeuniqueid']][_0x00ee('0x1e')],_0x42209b[_0x00ee('0x4a')],_0x42209b[_0x00ee('0x4d')]));}}catch(_0x1be62d){utils[_0x00ee('0x21')](util[_0x00ee('0x3')](_0x00ee('0x49'),_0x42209b[_0x00ee('0x5')]),_0x1be62d);}};exports['attendedtransfer']=function(_0x5e5ce6){try{utils[_0x00ee('0x10')](util[_0x00ee('0x3')](_0x00ee('0x50'),_0x5e5ce6['origtransfereruniqueid']),_0x5e5ce6);if(_0x5e5ce6[_0x00ee('0x51')]==_0x5e5ce6[_0x00ee('0x52')]){if(!_['isNil'](queues[_0x5e5ce6[_0x00ee('0x53')]])){utils[_0x00ee('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x5e5ce6['origtransfereruniqueid'],queues[_0x5e5ce6[_0x00ee('0x53')]][_0x00ee('0x1e')],_0x5e5ce6[_0x00ee('0x54')]));queues[_0x5e5ce6[_0x00ee('0x53')]][_0x00ee('0x45')]=!![];queues[_0x5e5ce6[_0x00ee('0x53')]]['transfertype']=_0x00ee('0x55');queues[_0x5e5ce6[_0x00ee('0x53')]][_0x00ee('0x56')]=_0x5e5ce6['origtransfererexten'];queues[_0x5e5ce6[_0x00ee('0x53')]][_0x00ee('0x4e')]=_0x5e5ce6[_0x00ee('0x51')];queues[_0x5e5ce6['secondtransfererlinkedid']][_0x00ee('0x9')]='ATTENDEDTRANSFER';}if(!_[_0x00ee('0x16')](queues[_0x5e5ce6[_0x00ee('0x52')]])){if(_0x5e5ce6[_0x00ee('0x57')]&&queues[_0x5e5ce6[_0x00ee('0x57')]]){queues[_0x5e5ce6[_0x00ee('0x57')]][_0x00ee('0x20')]=0x1;queues[_0x5e5ce6[_0x00ee('0x4a')]]=_[_0x00ee('0x58')](queues[_0x5e5ce6[_0x00ee('0x57')]]);queues[_0x5e5ce6[_0x00ee('0x4a')]][_0x00ee('0xe')]=_0x5e5ce6['transfertargetuniqueid'];queues[_0x5e5ce6[_0x00ee('0x4a')]][_0x00ee('0x20')]=0x2;queues[_0x5e5ce6[_0x00ee('0x4a')]][_0x00ee('0x7')]=queues[_0x5e5ce6[_0x00ee('0x53')]][_0x00ee('0x7')];queues[_0x5e5ce6[_0x00ee('0x4a')]][_0x00ee('0x59')]=queues[_0x5e5ce6[_0x00ee('0x53')]][_0x00ee('0x59')];queues[_0x5e5ce6[_0x00ee('0x4a')]]['queuecallerjoinAt']=utils[_0x00ee('0x14')]();queues[_0x5e5ce6[_0x00ee('0x4a')]][_0x00ee('0x18')]=utils[_0x00ee('0x14')]();queues[_0x5e5ce6['transfereeuniqueid']][_0x00ee('0x36')]=0x0;queues[_0x5e5ce6[_0x00ee('0x4a')]][_0x00ee('0x5a')]=0x0;utils[_0x00ee('0x2')](util[_0x00ee('0x3')](_0x00ee('0x5b'),_0x5e5ce6['origtransfereruniqueid'],queues[_0x5e5ce6['transfereeuniqueid']]['name'],queues[_0x5e5ce6[_0x00ee('0x4a')]][_0x00ee('0x7')],queues[_0x5e5ce6[_0x00ee('0x4a')]]['calleridname']));}else{utils[_0x00ee('0x2')](util[_0x00ee('0x3')](_0x00ee('0x5c'),_0x5e5ce6[_0x00ee('0x51')],queues[_0x5e5ce6['origtransfererlinkedid']][_0x00ee('0x1e')],_0x5e5ce6[_0x00ee('0x53')]));queues[_0x5e5ce6[_0x00ee('0x52')]][_0x00ee('0xe')]=_0x5e5ce6[_0x00ee('0x53')];}}}else if(_0x5e5ce6[_0x00ee('0x5d')]==_0x5e5ce6[_0x00ee('0x53')]){if(!_[_0x00ee('0x16')](queues[_0x5e5ce6['origtransfererlinkedid']])){utils[_0x00ee('0x2')](util['format'](_0x00ee('0x5e'),_0x5e5ce6[_0x00ee('0x51')],queues[_0x5e5ce6[_0x00ee('0x52')]][_0x00ee('0x1e')],_0x5e5ce6[_0x00ee('0x5d')],_0x5e5ce6[_0x00ee('0x5f')]));queues[_0x5e5ce6[_0x00ee('0x52')]][_0x00ee('0x45')]=!![];queues[_0x5e5ce6[_0x00ee('0x52')]][_0x00ee('0x4b')]=_0x00ee('0x55');queues[_0x5e5ce6[_0x00ee('0x52')]][_0x00ee('0x56')]=_0x5e5ce6[_0x00ee('0x5f')];queues[_0x5e5ce6[_0x00ee('0x52')]][_0x00ee('0x4e')]=_0x5e5ce6[_0x00ee('0x5d')];queues[_0x5e5ce6['origtransfererlinkedid']][_0x00ee('0x9')]=_0x00ee('0x60');}if(!_[_0x00ee('0x16')](queues[_0x5e5ce6[_0x00ee('0x53')]])){if(_0x5e5ce6['transfertargetlinkedid']&&queues[_0x5e5ce6[_0x00ee('0x61')]]){queues[_0x5e5ce6[_0x00ee('0x61')]][_0x00ee('0x20')]=0x1;queues[_0x5e5ce6[_0x00ee('0x62')]]=_[_0x00ee('0x58')](queues[_0x5e5ce6[_0x00ee('0x61')]]);queues[_0x5e5ce6[_0x00ee('0x62')]][_0x00ee('0xe')]=_0x5e5ce6[_0x00ee('0x62')];queues[_0x5e5ce6[_0x00ee('0x62')]][_0x00ee('0x20')]=0x2;queues[_0x5e5ce6[_0x00ee('0x62')]]['calleridnum']=queues[_0x5e5ce6[_0x00ee('0x52')]][_0x00ee('0x7')];queues[_0x5e5ce6[_0x00ee('0x62')]]['calleridname']=queues[_0x5e5ce6['origtransfererlinkedid']][_0x00ee('0x59')];queues[_0x5e5ce6[_0x00ee('0x62')]][_0x00ee('0x38')]=utils['now']();queues[_0x5e5ce6[_0x00ee('0x62')]][_0x00ee('0x18')]=utils[_0x00ee('0x14')]();queues[_0x5e5ce6[_0x00ee('0x62')]][_0x00ee('0x36')]=0x0;queues[_0x5e5ce6[_0x00ee('0x62')]][_0x00ee('0x5a')]=0x0;utils[_0x00ee('0x2')](util[_0x00ee('0x3')](_0x00ee('0x63'),_0x5e5ce6['origtransfereruniqueid'],queues[_0x5e5ce6[_0x00ee('0x62')]][_0x00ee('0x1e')],queues[_0x5e5ce6['transfertargetuniqueid']][_0x00ee('0xe')],queues[_0x5e5ce6[_0x00ee('0x62')]][_0x00ee('0x7')],queues[_0x5e5ce6[_0x00ee('0x62')]][_0x00ee('0x59')]));}else{utils[_0x00ee('0x2')](util['format'](_0x00ee('0x5c'),_0x5e5ce6[_0x00ee('0x51')],queues[_0x5e5ce6[_0x00ee('0x53')]][_0x00ee('0x1e')],_0x5e5ce6['origtransfererlinkedid']));queues[_0x5e5ce6[_0x00ee('0x53')]][_0x00ee('0xe')]=_0x5e5ce6[_0x00ee('0x52')];}}}}catch(_0x50c6e7){utils['error'](util[_0x00ee('0x3')](_0x00ee('0x50'),_0x5e5ce6[_0x00ee('0x51')]),_0x50c6e7);}};exports['musiconholdstart']=function(_0x3a2b5a){try{if(!_[_0x00ee('0x16')](queues[_0x3a2b5a[_0x00ee('0x5')]])){utils[_0x00ee('0x10')](util['format']('[%s][queues][musiconholdstart]',_0x3a2b5a['uniqueid']),_0x3a2b5a);queues[_0x3a2b5a[_0x00ee('0x5')]]['musiconholdstartAt']=utils[_0x00ee('0x14')]();utils[_0x00ee('0x2')](util[_0x00ee('0x3')](_0x00ee('0x64'),_0x3a2b5a[_0x00ee('0x5')],queues[_0x3a2b5a[_0x00ee('0x5')]][_0x00ee('0x1e')],queues[_0x3a2b5a[_0x00ee('0x5')]][_0x00ee('0x65')]));}}catch(_0x15ac30){utils[_0x00ee('0x21')](util[_0x00ee('0x3')]('[%s][queues][musiconholdstart]',_0x3a2b5a[_0x00ee('0x5')]),_0x15ac30);}};exports[_0x00ee('0x66')]=function(_0x1cb21d){try{if(!_[_0x00ee('0x16')](queues[_0x1cb21d[_0x00ee('0x5')]])){if(!_['isNil'](queues[_0x1cb21d['uniqueid']][_0x00ee('0x65')])){utils[_0x00ee('0x10')](util['format']('[%s][queues][musiconholdstop]',_0x1cb21d['uniqueid']),_0x1cb21d);queues[_0x1cb21d[_0x00ee('0x5')]][_0x00ee('0x5a')]+=utils[_0x00ee('0x37')](utils[_0x00ee('0x14')](),queues[_0x1cb21d[_0x00ee('0x5')]][_0x00ee('0x65')]);utils[_0x00ee('0x2')](util[_0x00ee('0x3')](_0x00ee('0x67'),_0x1cb21d[_0x00ee('0x5')],queues[_0x1cb21d['uniqueid']]['name'],queues[_0x1cb21d[_0x00ee('0x5')]][_0x00ee('0x5a')]));delete queues[_0x1cb21d[_0x00ee('0x5')]][_0x00ee('0x65')];}}}catch(_0x347aa4){utils['error'](util[_0x00ee('0x3')](_0x00ee('0x68'),_0x1cb21d['uniqueid']),_0x347aa4);}};
\ No newline at end of file
index dfa8673..9de1b9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb032=['.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinename','type','outbound','clone','newexten','application','appdata','toLowerCase','set','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','membername','name','UserId','CreateVoiceRecording','newchannel','[%s][recordings][newchannel]','exten','context','channel','error','newstate','debug','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','linkedid','transfer','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','replace'];(function(_0x21f931,_0x598b2d){var _0x3f083c=function(_0x1c7c49){while(--_0x1c7c49){_0x21f931['push'](_0x21f931['shift']());}};_0x3f083c(++_0x598b2d);}(_0xb032,0x187));var _0x2b03=function(_0x107844,_0x41926f){_0x107844=_0x107844-0x0;var _0x40c2b5=_0xb032[_0x107844];return _0x40c2b5;};'use strict';var _=require(_0x2b03('0x0'));var util=require(_0x2b03('0x1'));var utils=require(_0x2b03('0x2'));var recordings={};function writeDB(_0x1475cf){utils[_0x2b03('0x3')](util[_0x2b03('0x4')](_0x2b03('0x5'),_0x1475cf[_0x2b03('0x6')]));if(_0x1475cf[_0x2b03('0x7')]){utils[_0x2b03('0x8')](_0x1475cf[_0x2b03('0x7')])[_0x2b03('0x9')](function(_0x315001){if(_0x315001){_0x1475cf[_0x2b03('0xa')]=_0x315001[_0x2b03('0xb')];_0x1475cf[_0x2b03('0xc')]=_0x315001['id'];}utils['request'](_0x2b03('0xd'),_0x1475cf);});}else{utils['request'](_0x2b03('0xd'),_0x1475cf);}}exports[_0x2b03('0xe')]=function(_0x5ddc23){try{utils['debug'](util[_0x2b03('0x4')](_0x2b03('0xf'),_0x5ddc23['uniqueid']),_0x5ddc23);if(_0x5ddc23[_0x2b03('0x6')]==_0x5ddc23['linkedid']){utils[_0x2b03('0x3')](util[_0x2b03('0x4')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x5ddc23[_0x2b03('0x6')],_0x5ddc23['context'],_0x5ddc23[_0x2b03('0x10')]));recordings[_0x5ddc23[_0x2b03('0x6')]]={'uniqueid':_0x5ddc23[_0x2b03('0x6')],'accountcode':_0x5ddc23[_0x2b03('0x7')],'exten':_0x5ddc23[_0x2b03('0x10')],'context':_0x5ddc23[_0x2b03('0x11')],'channel':_0x5ddc23[_0x2b03('0x12')],'monitors':[]};}}catch(_0x115af8){utils[_0x2b03('0x13')](util[_0x2b03('0x4')](_0x2b03('0xf'),_0x5ddc23[_0x2b03('0x6')]),_0x115af8);}};exports[_0x2b03('0x14')]=function(_0x580149){try{utils[_0x2b03('0x15')](util[_0x2b03('0x4')](_0x2b03('0x16'),_0x580149[_0x2b03('0x6')]),_0x580149);if(!_[_0x2b03('0x17')](recordings[_0x580149[_0x2b03('0x6')]])&&_0x580149[_0x2b03('0x18')]==0x6){utils[_0x2b03('0x3')](util[_0x2b03('0x4')](_0x2b03('0x19'),_0x580149[_0x2b03('0x6')],_0x580149['context'],_0x580149[_0x2b03('0x12')]));}else if(!_['isNil'](recordings[_0x580149[_0x2b03('0x1a')]])&&_0x580149[_0x2b03('0x18')]==0x6&&_0x580149[_0x2b03('0x11')]!=_0x2b03('0x1b')){utils[_0x2b03('0x3')](util[_0x2b03('0x4')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x580149['uniqueid'],_0x580149[_0x2b03('0x1a')],_0x580149['context'],_0x580149[_0x2b03('0x12')]));recordings[_0x580149[_0x2b03('0x1a')]][_0x2b03('0x7')]=_0x580149[_0x2b03('0x7')];}}catch(_0x3faa54){utils[_0x2b03('0x13')](util[_0x2b03('0x4')]('[%s][recordings][newstate]',_0x580149[_0x2b03('0x6')]),_0x3faa54);}};exports[_0x2b03('0x1c')]=function(_0x42b387){try{if(!_['isNil'](_0x42b387['variable'])&&!_[_0x2b03('0x17')](_0x42b387[_0x2b03('0x1d')][_0x2b03('0x1e')])){utils[_0x2b03('0x15')](util[_0x2b03('0x4')](_0x2b03('0x1f'),_0x42b387['uniqueid']),_0x42b387);utils[_0x2b03('0x3')](util[_0x2b03('0x4')](_0x2b03('0x20'),_0x42b387[_0x2b03('0x6')],_0x42b387[_0x2b03('0x1d')],_0x42b387[_0x2b03('0x21')]));if(_['endsWith'](_0x42b387[_0x2b03('0x21')],_0x2b03('0x22'))){_0x42b387[_0x2b03('0x21')]=_0x42b387[_0x2b03('0x21')][_0x2b03('0x23')](_0x2b03('0x22'),_0x2b03('0x24'));}if(recordings[_0x42b387[_0x2b03('0x1a')]]){var _0x538bc2=_[_0x2b03('0x25')](recordings[_0x42b387[_0x2b03('0x1a')]][_0x2b03('0x26')],{'value':_0x42b387[_0x2b03('0x21')]});if(_['isNil'](_0x538bc2)){recordings[_0x42b387['linkedid']][_0x2b03('0x26')][_0x2b03('0x27')]({'value':_0x42b387[_0x2b03('0x21')]});}}}}catch(_0xdf1411){utils[_0x2b03('0x13')](util['format'](_0x2b03('0x1f'),_0x42b387['uniqueid']),_0xdf1411);}};exports[_0x2b03('0x28')]=function(_0x3246b5){try{if(!_[_0x2b03('0x17')](recordings[_0x3246b5[_0x2b03('0x6')]])){utils[_0x2b03('0x15')](util[_0x2b03('0x4')](_0x2b03('0x29'),_0x3246b5[_0x2b03('0x6')]),_0x3246b5);utils[_0x2b03('0x3')](util[_0x2b03('0x4')](_0x2b03('0x2a'),_0x3246b5[_0x2b03('0x6')],_0x3246b5[_0x2b03('0x2b')],_0x3246b5[_0x2b03('0x2c')],_0x3246b5[_0x2b03('0x2d')]));recordings[_0x3246b5[_0x2b03('0x6')]]['calleridnum']=_0x3246b5[_0x2b03('0x2b')];recordings[_0x3246b5[_0x2b03('0x6')]][_0x2b03('0x2c')]=_0x3246b5['calleridname'];recordings[_0x3246b5['uniqueid']]['connectedlinenum']=_0x3246b5['connectedlinenum'];recordings[_0x3246b5['uniqueid']][_0x2b03('0x2e')]=_0x3246b5[_0x2b03('0x2e')];if(recordings[_0x3246b5[_0x2b03('0x6')]][_0x2b03('0x2f')]==_0x2b03('0x30')&&recordings[_0x3246b5[_0x2b03('0x6')]][_0x2b03('0x7')]){recordings[_0x3246b5[_0x2b03('0x6')]]['connectedlinenum']=recordings[_0x3246b5[_0x2b03('0x6')]][_0x2b03('0x7')];recordings[_0x3246b5[_0x2b03('0x6')]][_0x2b03('0x2e')]='';}recordings[_0x3246b5[_0x2b03('0x6')]][_0x2b03('0x26')]['forEach'](function(_0x1ce678){var _0xb9dbf7=_[_0x2b03('0x31')](recordings[_0x3246b5['uniqueid']]);_0xb9dbf7[_0x2b03('0x21')]=_0x1ce678[_0x2b03('0x21')];writeDB(_0xb9dbf7);});delete recordings[_0x3246b5['uniqueid']];}}catch(_0x5c0445){utils[_0x2b03('0x13')](util[_0x2b03('0x4')](_0x2b03('0x29'),_0x3246b5[_0x2b03('0x6')]),_0x5c0445);}};exports[_0x2b03('0x32')]=function(_0x4626fe){try{if(!_[_0x2b03('0x17')](recordings[_0x4626fe[_0x2b03('0x6')]])){utils['debug'](util[_0x2b03('0x4')]('[%s][recordings][newexten]',_0x4626fe[_0x2b03('0x6')]),_0x4626fe);utils[_0x2b03('0x3')](util[_0x2b03('0x4')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x4626fe[_0x2b03('0x6')],_0x4626fe[_0x2b03('0x33')],_0x4626fe[_0x2b03('0x34')]));if(_0x4626fe[_0x2b03('0x33')][_0x2b03('0x35')]()==_0x2b03('0x36')&&_['startsWith'](_0x4626fe[_0x2b03('0x34')][_0x2b03('0x35')](),'cdr')){var _0x16def8=_0x4626fe[_0x2b03('0x34')]['split']('=');var _0x5b4229=_0x16def8[0x0][_0x2b03('0x37')](_0x16def8[0x0][_0x2b03('0x38')]('(')+0x1,_0x16def8[0x0]['lastIndexOf'](')'));var _0x468a63=_0x16def8[0x1];recordings[_0x4626fe[_0x2b03('0x6')]][_0x5b4229]=_0x468a63;}}}catch(_0x9a9e66){utils['error'](util[_0x2b03('0x4')]('[%s][recordings][newexten]',_0x4626fe[_0x2b03('0x6')]),_0x9a9e66);}};exports[_0x2b03('0x39')]=function(_0x1fef41){try{if(!_[_0x2b03('0x17')](recordings[_0x1fef41[_0x2b03('0x6')]])){utils[_0x2b03('0x15')](util[_0x2b03('0x4')](_0x2b03('0x3a'),_0x1fef41[_0x2b03('0x6')]),_0x1fef41);utils['info'](util[_0x2b03('0x4')](_0x2b03('0x3b'),_0x1fef41['uniqueid'],_0x1fef41[_0x2b03('0x3c')]));recordings[_0x1fef41[_0x2b03('0x6')]][_0x2b03('0x3c')]=_0x1fef41[_0x2b03('0x3c')];}}catch(_0x1741bf){utils[_0x2b03('0x13')](util['format'](_0x2b03('0x3a'),_0x1fef41[_0x2b03('0x6')]),_0x1741bf);}};
\ No newline at end of file
+var _0x9558=['find','monitors','push','debug','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','type','forEach','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','set','startsWith','appdata','toLowerCase','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','request','CreateVoiceRecording','newchannel','[%s][recordings][newchannel]','linkedid','exten','context','channel','error','isNil','channelstate','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9558,0xf2));var _0x8955=function(_0xb5da76,_0x272ceb){_0xb5da76=_0xb5da76-0x0;var _0x443e26=_0x9558[_0xb5da76];return _0x443e26;};'use strict';var _=require(_0x8955('0x0'));var util=require(_0x8955('0x1'));var utils=require('./utils');var recordings={};function writeDB(_0x3d804d){utils[_0x8955('0x2')](util[_0x8955('0x3')](_0x8955('0x4'),_0x3d804d[_0x8955('0x5')]));if(_0x3d804d[_0x8955('0x6')]){utils[_0x8955('0x7')](_0x3d804d[_0x8955('0x6')])[_0x8955('0x8')](function(_0x381aaf){if(_0x381aaf){_0x3d804d['membername']=_0x381aaf['name'];_0x3d804d['UserId']=_0x381aaf['id'];}utils[_0x8955('0x9')](_0x8955('0xa'),_0x3d804d);});}else{utils[_0x8955('0x9')](_0x8955('0xa'),_0x3d804d);}}exports[_0x8955('0xb')]=function(_0x2dc5fd){try{utils['debug'](util[_0x8955('0x3')](_0x8955('0xc'),_0x2dc5fd[_0x8955('0x5')]),_0x2dc5fd);if(_0x2dc5fd['uniqueid']==_0x2dc5fd[_0x8955('0xd')]){utils[_0x8955('0x2')](util[_0x8955('0x3')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x2dc5fd[_0x8955('0x5')],_0x2dc5fd['context'],_0x2dc5fd['exten']));recordings[_0x2dc5fd[_0x8955('0x5')]]={'uniqueid':_0x2dc5fd[_0x8955('0x5')],'accountcode':_0x2dc5fd[_0x8955('0x6')],'exten':_0x2dc5fd[_0x8955('0xe')],'context':_0x2dc5fd[_0x8955('0xf')],'channel':_0x2dc5fd[_0x8955('0x10')],'monitors':[]};}}catch(_0x56bdd4){utils[_0x8955('0x11')](util[_0x8955('0x3')](_0x8955('0xc'),_0x2dc5fd['uniqueid']),_0x56bdd4);}};exports['newstate']=function(_0x2c456a){try{utils['debug'](util['format']('[%s][recordings][newstate]',_0x2c456a[_0x8955('0x5')]),_0x2c456a);if(!_[_0x8955('0x12')](recordings[_0x2c456a[_0x8955('0x5')]])&&_0x2c456a[_0x8955('0x13')]==0x6){utils[_0x8955('0x2')](util[_0x8955('0x3')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x2c456a['uniqueid'],_0x2c456a[_0x8955('0xf')],_0x2c456a[_0x8955('0x10')]));}else if(!_['isNil'](recordings[_0x2c456a[_0x8955('0xd')]])&&_0x2c456a[_0x8955('0x13')]==0x6&&_0x2c456a[_0x8955('0xf')]!='transfer'){utils['info'](util['format'](_0x8955('0x14'),_0x2c456a[_0x8955('0x5')],_0x2c456a[_0x8955('0xd')],_0x2c456a[_0x8955('0xf')],_0x2c456a[_0x8955('0x10')]));recordings[_0x2c456a[_0x8955('0xd')]]['accountcode']=_0x2c456a[_0x8955('0x6')];}}catch(_0x14ae16){utils[_0x8955('0x11')](util['format']('[%s][recordings][newstate]',_0x2c456a['uniqueid']),_0x14ae16);}};exports['varset']=function(_0xf5b3fb){try{if(!_['isNil'](_0xf5b3fb[_0x8955('0x15')])&&!_[_0x8955('0x12')](_0xf5b3fb[_0x8955('0x15')]['mixmonitor_filename'])){utils['debug'](util[_0x8955('0x3')](_0x8955('0x16'),_0xf5b3fb[_0x8955('0x5')]),_0xf5b3fb);utils[_0x8955('0x2')](util['format'](_0x8955('0x17'),_0xf5b3fb[_0x8955('0x5')],_0xf5b3fb[_0x8955('0x15')],_0xf5b3fb[_0x8955('0x18')]));if(_[_0x8955('0x19')](_0xf5b3fb['value'],_0x8955('0x1a'))){_0xf5b3fb[_0x8955('0x18')]=_0xf5b3fb['value'][_0x8955('0x1b')]('.wav49','.WAV');}if(recordings[_0xf5b3fb[_0x8955('0xd')]]){var _0x6b8be5=_[_0x8955('0x1c')](recordings[_0xf5b3fb['linkedid']][_0x8955('0x1d')],{'value':_0xf5b3fb[_0x8955('0x18')]});if(_[_0x8955('0x12')](_0x6b8be5)){recordings[_0xf5b3fb[_0x8955('0xd')]][_0x8955('0x1d')][_0x8955('0x1e')]({'value':_0xf5b3fb[_0x8955('0x18')]});}}}}catch(_0x3a1b29){utils[_0x8955('0x11')](util['format'](_0x8955('0x16'),_0xf5b3fb[_0x8955('0x5')]),_0x3a1b29);}};exports['hangup']=function(_0x39fb2e){try{if(!_['isNil'](recordings[_0x39fb2e[_0x8955('0x5')]])){utils[_0x8955('0x1f')](util[_0x8955('0x3')]('[%s][recordings][hangup]',_0x39fb2e[_0x8955('0x5')]),_0x39fb2e);utils[_0x8955('0x2')](util[_0x8955('0x3')](_0x8955('0x20'),_0x39fb2e[_0x8955('0x5')],_0x39fb2e[_0x8955('0x21')],_0x39fb2e[_0x8955('0x22')],_0x39fb2e['cause-txt']));recordings[_0x39fb2e['uniqueid']][_0x8955('0x21')]=_0x39fb2e['calleridnum'];recordings[_0x39fb2e[_0x8955('0x5')]][_0x8955('0x22')]=_0x39fb2e[_0x8955('0x22')];recordings[_0x39fb2e[_0x8955('0x5')]][_0x8955('0x23')]=_0x39fb2e['connectedlinenum'];recordings[_0x39fb2e[_0x8955('0x5')]]['connectedlinename']=_0x39fb2e[_0x8955('0x24')];if(recordings[_0x39fb2e['uniqueid']][_0x8955('0x25')]=='outbound'&&recordings[_0x39fb2e[_0x8955('0x5')]][_0x8955('0x6')]){recordings[_0x39fb2e[_0x8955('0x5')]][_0x8955('0x23')]=recordings[_0x39fb2e['uniqueid']]['accountcode'];recordings[_0x39fb2e[_0x8955('0x5')]][_0x8955('0x24')]='';}recordings[_0x39fb2e['uniqueid']][_0x8955('0x1d')][_0x8955('0x26')](function(_0x1cebc0){var _0x5a9a6a=_['clone'](recordings[_0x39fb2e[_0x8955('0x5')]]);_0x5a9a6a[_0x8955('0x18')]=_0x1cebc0['value'];writeDB(_0x5a9a6a);});delete recordings[_0x39fb2e[_0x8955('0x5')]];}}catch(_0xacceac){utils[_0x8955('0x11')](util[_0x8955('0x3')]('[%s][recordings][hangup]',_0x39fb2e['uniqueid']),_0xacceac);}};exports[_0x8955('0x27')]=function(_0x2be81b){try{if(!_[_0x8955('0x12')](recordings[_0x2be81b['uniqueid']])){utils[_0x8955('0x1f')](util[_0x8955('0x3')](_0x8955('0x28'),_0x2be81b[_0x8955('0x5')]),_0x2be81b);utils[_0x8955('0x2')](util[_0x8955('0x3')](_0x8955('0x29'),_0x2be81b[_0x8955('0x5')],_0x2be81b[_0x8955('0x2a')],_0x2be81b['appdata']));if(_0x2be81b[_0x8955('0x2a')]['toLowerCase']()==_0x8955('0x2b')&&_[_0x8955('0x2c')](_0x2be81b[_0x8955('0x2d')][_0x8955('0x2e')](),'cdr')){var _0x419915=_0x2be81b[_0x8955('0x2d')][_0x8955('0x2f')]('=');var _0x12a813=_0x419915[0x0][_0x8955('0x30')](_0x419915[0x0]['lastIndexOf']('(')+0x1,_0x419915[0x0][_0x8955('0x31')](')'));var _0x160385=_0x419915[0x1];recordings[_0x2be81b[_0x8955('0x5')]][_0x12a813]=_0x160385;}}}catch(_0x320b40){utils[_0x8955('0x11')](util[_0x8955('0x3')]('[%s][recordings][newexten]',_0x2be81b[_0x8955('0x5')]),_0x320b40);}};exports[_0x8955('0x32')]=function(_0x2c4439){try{if(!_['isNil'](recordings[_0x2c4439[_0x8955('0x5')]])){utils[_0x8955('0x1f')](util[_0x8955('0x3')](_0x8955('0x33'),_0x2c4439[_0x8955('0x5')]),_0x2c4439);utils['info'](util['format'](_0x8955('0x34'),_0x2c4439[_0x8955('0x5')],_0x2c4439[_0x8955('0x35')]));recordings[_0x2c4439[_0x8955('0x5')]]['queue']=_0x2c4439['queue'];}}catch(_0x2ad1e7){utils[_0x8955('0x11')](util[_0x8955('0x3')]('[%s][recordings][queuecallerjoin]',_0x2c4439[_0x8955('0x5')]),_0x2ad1e7);}};
\ No newline at end of file
index 4b7614e..e405bf3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x456d=['CreateVoiceTransferReport','blindtransfer','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridname','blind','blinds','error','attendedtransfer','debug','info','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridnum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','util','./utils','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request'];(function(_0x1c3cc4,_0x11d2d3){var _0x2a7c1c=function(_0x3094f5){while(--_0x3094f5){_0x1c3cc4['push'](_0x1c3cc4['shift']());}};_0x2a7c1c(++_0x11d2d3);}(_0x456d,0x9b));var _0xd456=function(_0x2500c8,_0x2ad65e){_0x2500c8=_0x2500c8-0x0;var _0x59ec4e=_0x456d[_0x2500c8];return _0x59ec4e;};'use strict';var _=require('lodash');var util=require(_0xd456('0x0'));var utils=require(_0xd456('0x1'));function writeDB(_0x3af9f3){utils['info'](util[_0xd456('0x2')](_0xd456('0x3'),_0x3af9f3[_0xd456('0x4')]===_0xd456('0x5')?_0x3af9f3[_0xd456('0x6')]:_0x3af9f3[_0xd456('0x7')],_0x3af9f3[_0xd456('0x4')]));utils[_0xd456('0x8')](_0xd456('0x9'),_0x3af9f3);}exports['blinds']={};exports[_0xd456('0xa')]=function(_0x28b027){try{utils['debug'](util['format'](_0xd456('0xb'),_0x28b027[_0xd456('0x7')]),_0x28b027);utils['info'](util['format'](_0xd456('0xc'),_0x28b027[_0xd456('0x7')],_0x28b027[_0xd456('0xd')],_0x28b027['transferercalleridname'],_0x28b027['transfereecalleridnum'],_0x28b027[_0xd456('0xe')]));_0x28b027['type']=_0xd456('0xf');exports[_0xd456('0x10')][_0x28b027['transfereruniqueid']]=_0x28b027;writeDB(_0x28b027);}catch(_0x5a9f40){utils[_0xd456('0x11')](util[_0xd456('0x2')](_0xd456('0xb'),_0x28b027['uniqueid']),_0x5a9f40);}};exports[_0xd456('0x12')]=function(_0x105223){try{utils[_0xd456('0x13')](util['format']('[%s][transfers][attendedtransfer]',_0x105223[_0xd456('0x6')]),_0x105223);utils[_0xd456('0x14')](util[_0xd456('0x2')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x105223[_0xd456('0x6')],_0x105223['origtransferercalleridnum'],_0x105223[_0xd456('0x15')],_0x105223[_0xd456('0x16')],_0x105223[_0xd456('0x17')]));_0x105223=_[_0xd456('0x18')](_0x105223,{'transfererchannel':_0x105223[_0xd456('0x19')],'transferercalleridnum':_0x105223[_0xd456('0x1a')],'transferercalleridname':_0x105223[_0xd456('0x15')],'transfererconnectedlinenum':_0x105223['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x105223['secondtransfererconnectedlinename'],'transfereraccountcode':_0x105223[_0xd456('0x1b')],'transferercontext':_0x105223[_0xd456('0x1c')],'transfererexten':_0x105223[_0xd456('0x1d')],'transfererlinkedid':_0x105223[_0xd456('0x1e')],'context':_0x105223['origtransferercontext'],'extension':_0x105223[_0xd456('0x1f')],'type':_0xd456('0x5')});if(_[_0xd456('0x20')](_0x105223[_0xd456('0x21')])){_0x105223=_[_0xd456('0x18')](_0x105223,{'transfereechannel':_0x105223[_0xd456('0x22')],'transfereecalleridnum':_0x105223[_0xd456('0x16')],'transfereecalleridname':_0x105223[_0xd456('0x17')],'transfereeconnectedlinenum':_0x105223[_0xd456('0x23')],'transfereeconnectedlinename':_0x105223[_0xd456('0x24')],'transfereeaccountcode':_0x105223[_0xd456('0x25')],'transfereecontext':_0x105223[_0xd456('0x26')],'transfereeexten':_0x105223[_0xd456('0x27')],'transfereelinkedid':_0x105223[_0xd456('0x28')]});}writeDB(_0x105223);}catch(_0x185603){utils['error'](util[_0xd456('0x2')]('[%s][transfers][attendedtransfer]',_0x105223['origtransfereruniqueid']),_0x185603);}};
\ No newline at end of file
+var _0x93cf=['[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','request','CreateVoiceTransferReport','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','uniqueid','transferercalleridnum','transferercalleridname','transfereecalleridname','blind','blinds','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetlinkedid','util','info','format'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x93cf,0x179));var _0xf93c=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x93cf[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0xf93c('0x0'));var utils=require('./utils');function writeDB(_0x3c91e0){utils[_0xf93c('0x1')](util[_0xf93c('0x2')](_0xf93c('0x3'),_0x3c91e0[_0xf93c('0x4')]===_0xf93c('0x5')?_0x3c91e0[_0xf93c('0x6')]:_0x3c91e0['uniqueid'],_0x3c91e0[_0xf93c('0x4')]));utils[_0xf93c('0x7')](_0xf93c('0x8'),_0x3c91e0);}exports['blinds']={};exports['blindtransfer']=function(_0x124778){try{utils['debug'](util['format'](_0xf93c('0x9'),_0x124778['uniqueid']),_0x124778);utils[_0xf93c('0x1')](util['format'](_0xf93c('0xa'),_0x124778[_0xf93c('0xb')],_0x124778[_0xf93c('0xc')],_0x124778[_0xf93c('0xd')],_0x124778['transfereecalleridnum'],_0x124778[_0xf93c('0xe')]));_0x124778[_0xf93c('0x4')]=_0xf93c('0xf');exports[_0xf93c('0x10')][_0x124778[_0xf93c('0x11')]]=_0x124778;writeDB(_0x124778);}catch(_0x3ed422){utils[_0xf93c('0x12')](util[_0xf93c('0x2')](_0xf93c('0x9'),_0x124778[_0xf93c('0xb')]),_0x3ed422);}};exports[_0xf93c('0x13')]=function(_0x120694){try{utils['debug'](util[_0xf93c('0x2')](_0xf93c('0x14'),_0x120694[_0xf93c('0x6')]),_0x120694);utils[_0xf93c('0x1')](util[_0xf93c('0x2')](_0xf93c('0x15'),_0x120694['origtransfereruniqueid'],_0x120694['origtransferercalleridnum'],_0x120694[_0xf93c('0x16')],_0x120694[_0xf93c('0x17')],_0x120694[_0xf93c('0x18')]));_0x120694=_[_0xf93c('0x19')](_0x120694,{'transfererchannel':_0x120694[_0xf93c('0x1a')],'transferercalleridnum':_0x120694[_0xf93c('0x1b')],'transferercalleridname':_0x120694[_0xf93c('0x16')],'transfererconnectedlinenum':_0x120694['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x120694[_0xf93c('0x1c')],'transfereraccountcode':_0x120694[_0xf93c('0x1d')],'transferercontext':_0x120694[_0xf93c('0x1e')],'transfererexten':_0x120694['secondtransfererexten'],'transfererlinkedid':_0x120694['origtransfererlinkedid'],'context':_0x120694[_0xf93c('0x1f')],'extension':_0x120694[_0xf93c('0x20')],'type':_0xf93c('0x5')});if(_[_0xf93c('0x21')](_0x120694[_0xf93c('0x22')])){_0x120694=_[_0xf93c('0x19')](_0x120694,{'transfereechannel':_0x120694['transfertargetchannel'],'transfereecalleridnum':_0x120694[_0xf93c('0x17')],'transfereecalleridname':_0x120694['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x120694[_0xf93c('0x23')],'transfereeconnectedlinename':_0x120694['transfertargetconnectedlinename'],'transfereeaccountcode':_0x120694[_0xf93c('0x24')],'transfereecontext':_0x120694['transfertargetcontext'],'transfereeexten':_0x120694['transfertargetexten'],'transfereelinkedid':_0x120694[_0xf93c('0x25')]});}writeDB(_0x120694);}catch(_0xe114c8){utils[_0xf93c('0x12')](util[_0xf93c('0x2')](_0xf93c('0x14'),_0x120694[_0xf93c('0x6')]),_0xe114c8);}};
\ No newline at end of file
index 2ea9cb4..519ca7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x681a=['getVoiceQueueByName','type','acw','acwTimeout','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diffTime','diff','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','xdr','info','debug','inspect','error','request','then','[utils][request]\x20name:%s','name','interface','[utils][getUser]\x20where:%s','stringify','length','result','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','catch','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','found','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]'];(function(_0x2d4b18,_0x1e3f5d){var _0x3242b4=function(_0x30e4f8){while(--_0x30e4f8){_0x2d4b18['push'](_0x2d4b18['shift']());}};_0x3242b4(++_0x1e3f5d);}(_0x681a,0xbf));var _0xa681=function(_0x2302a1,_0x4bc33d){_0x2302a1=_0x2302a1-0x0;var _0x413cae=_0x681a[_0x2302a1];return _0x413cae;};'use strict';var BPromise=require(_0xa681('0x0'));var jayson=require(_0xa681('0x1'));var moment=require(_0xa681('0x2'));var util=require(_0xa681('0x3'));var client=jayson[_0xa681('0x4')]['http']({'port':0x2329});var logger=require('../../config/logger')(_0xa681('0x5'));exports[_0xa681('0x6')]=function(_0x20b7ef,_0xd72b3){logger['info'](_0x20b7ef,_0xd72b3?util['inspect'](_0xd72b3,{'showHidden':![],'depth':null}):'');};exports[_0xa681('0x7')]=function(_0xf29660,_0x3f2657){logger[_0xa681('0x7')](_0xf29660,_0x3f2657?util[_0xa681('0x8')](_0x3f2657,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x2e1fe2,_0x1d392b){logger[_0xa681('0x9')](_0x2e1fe2,_0x1d392b?util[_0xa681('0x8')](_0x1d392b,{'showHidden':![],'depth':null}):'');};exports[_0xa681('0xa')]=function(_0x5dd2fe,_0x39124b){return client[_0xa681('0xa')](_0x5dd2fe,{'body':_0x39124b})[_0xa681('0xb')](function(_0x202b6c){logger[_0xa681('0x7')](_0xa681('0xc'),_0x5dd2fe,_0x202b6c?util[_0xa681('0x8')](_0x202b6c,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x374fb6){logger['error'](_0xa681('0xc'),_0x5dd2fe,_0x374fb6?util[_0xa681('0x8')](_0x374fb6,{'showHidden':![],'depth':null}):'');});};function getUser(_0x5e1b4e){return client['request']('GetUser',{'options':{'raw':!![],'attributes':['id','internal',_0xa681('0xd'),_0xa681('0xe')],'where':_0x5e1b4e,'limit':0x1}})[_0xa681('0xb')](function(_0xfd251e){logger['debug'](_0xa681('0xf'),JSON[_0xa681('0x10')](_0x5e1b4e),_0xfd251e?util[_0xa681('0x8')](_0xfd251e,{'showHidden':![],'depth':null}):'');return _0xfd251e['result'][_0xa681('0x11')]?_0xfd251e[_0xa681('0x12')][0x0]:null;});}exports['getUserByInternal']=function(_0x55b4dc){return new BPromise(function(_0x3bf396,_0x51f036){if(_0x55b4dc){return getUser({'internal':_0x55b4dc})[_0xa681('0xb')](function(_0x34302e){logger[_0xa681('0x6')](_0xa681('0x13'),_0x55b4dc,_0x34302e?'found':_0xa681('0x14'));return _0x3bf396(_0x34302e);})[_0xa681('0x15')](function(_0x2b6642){logger[_0xa681('0x9')](_0xa681('0x16'),_0x2b6642?util['inspect'](_0x2b6642,{'showHidden':![],'depth':null}):'');return _0x3bf396(null);});}return _0x3bf396(null);});};exports[_0xa681('0x17')]=function(_0x418854){return new BPromise(function(_0x1f7f9a,_0xf1311b){if(_0x418854){return getUser({'interface':_0x418854})[_0xa681('0xb')](function(_0x3e8fc6){logger[_0xa681('0x6')](_0xa681('0x18'),_0x418854,_0x3e8fc6?_0xa681('0x19'):_0xa681('0x14'));return _0x1f7f9a(_0x3e8fc6);})[_0xa681('0x15')](function(_0x51b06a){logger[_0xa681('0x9')]('[utils][getUserByInterface]',_0x51b06a?util[_0xa681('0x8')](_0x51b06a,{'showHidden':![],'depth':null}):'');return _0x1f7f9a(null);});}return _0x1f7f9a(null);});};exports[_0xa681('0x1a')]=function(_0x439d13){return new BPromise(function(_0x3212ec,_0x3fd364){if(_0x439d13){return getUser({'name':_0x439d13})[_0xa681('0xb')](function(_0x7358d3){logger[_0xa681('0x6')](_0xa681('0x1b'),_0x439d13,_0x7358d3?_0xa681('0x19'):_0xa681('0x14'));return _0x3212ec(_0x7358d3);})['catch'](function(_0x45b290){logger[_0xa681('0x9')](_0xa681('0x1c'),_0x45b290?util[_0xa681('0x8')](_0x45b290,{'showHidden':![],'depth':null}):'');return _0x3212ec(null);});}return _0x3212ec(null);});};exports[_0xa681('0x1d')]=function(_0x15caad){return new BPromise(function(_0x311c11,_0x17a00b){if(_0x15caad){return client[_0xa681('0xa')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0xa681('0xd'),_0xa681('0x1e'),_0xa681('0x1f'),_0xa681('0x20')],'where':{'name':_0x15caad},'limit':0x1}})['then'](function(_0x2e5fad){logger[_0xa681('0x7')]('[utils][getVoiceQueueByName]\x20name:%s',_0x15caad,_0x2e5fad?util[_0xa681('0x8')](_0x2e5fad,{'showHidden':![],'depth':null}):'');logger[_0xa681('0x6')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x15caad,_0x2e5fad?_0xa681('0x19'):_0xa681('0x14'));return _0x311c11(_0x2e5fad[_0xa681('0x12')]['length']?_0x2e5fad['result'][0x0]:null);})[_0xa681('0x15')](function(_0x367c3f){logger[_0xa681('0x9')]('[utils][getVoiceQueueByName]',_0x367c3f?util['inspect'](_0x367c3f,{'showHidden':![],'depth':null}):'');return _0x311c11(null);});}return _0x311c11(null);});};exports[_0xa681('0x21')]=function(_0x310700,_0x5aabe5){return moment(_0x310700)[_0xa681('0x22')](_0x5aabe5,_0xa681('0x23'))[_0xa681('0x24')](_0xa681('0x25'));};exports['subtractTime']=function(_0x2ed2d6,_0x2ed17e){return moment(_0x2ed2d6)[_0xa681('0x26')](_0x2ed17e,_0xa681('0x23'))[_0xa681('0x24')](_0xa681('0x25'));};exports[_0xa681('0x27')]=function(_0x3ce5bd,_0x51dcf0){return moment(_0x3ce5bd)[_0xa681('0x28')](moment(_0x51dcf0),_0xa681('0x23'));};exports['sumTime']=function(_0x4c97d6,_0x4f51bf){return parseInt(_0x4c97d6,0xa)+parseInt(_0x4f51bf,0xa);};exports[_0xa681('0x29')]=function(){return moment()[_0xa681('0x24')](_0xa681('0x25'));};exports[_0xa681('0x2a')]=function(_0x17d8e,_0x2d6c0f){if(_0x2d6c0f){return moment(_0x17d8e)[_0xa681('0x2a')](_0x2d6c0f);}return!![];};exports[_0xa681('0x2b')]=function(_0x1252b0,_0x15e807){if(_0x15e807){return moment(_0x1252b0)[_0xa681('0x2b')](_0x15e807);}else if(_0x1252b0){return!![];}return![];};
\ No newline at end of file
+var _0x4745=['result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','[utils][getUserByInterface]\x20interface:%s\x20%s','found','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','seconds','diffTime','diff','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','xdr','info','debug','error','inspect','request','then','[utils][request]\x20name:%s','catch','internal','name','interface'];(function(_0x4576aa,_0x46c8a8){var _0x1ec6ba=function(_0x356675){while(--_0x356675){_0x4576aa['push'](_0x4576aa['shift']());}};_0x1ec6ba(++_0x46c8a8);}(_0x4745,0x1e7));var _0x5474=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x4745[_0x13ea00];return _0x1f7347;};'use strict';var BPromise=require(_0x5474('0x0'));var jayson=require(_0x5474('0x1'));var moment=require(_0x5474('0x2'));var util=require(_0x5474('0x3'));var client=jayson[_0x5474('0x4')][_0x5474('0x5')]({'port':0x2329});var logger=require(_0x5474('0x6'))(_0x5474('0x7'));exports[_0x5474('0x8')]=function(_0x39fb9b,_0x45a895){logger[_0x5474('0x8')](_0x39fb9b,_0x45a895?util['inspect'](_0x45a895,{'showHidden':![],'depth':null}):'');};exports[_0x5474('0x9')]=function(_0x431f81,_0x57add7){logger[_0x5474('0x9')](_0x431f81,_0x57add7?util['inspect'](_0x57add7,{'showHidden':![],'depth':null}):'');};exports[_0x5474('0xa')]=function(_0x3c8860,_0x4fae2b){logger[_0x5474('0xa')](_0x3c8860,_0x4fae2b?util[_0x5474('0xb')](_0x4fae2b,{'showHidden':![],'depth':null}):'');};exports[_0x5474('0xc')]=function(_0x26cceb,_0x4444dd){return client[_0x5474('0xc')](_0x26cceb,{'body':_0x4444dd})[_0x5474('0xd')](function(_0x2fc637){logger['debug'](_0x5474('0xe'),_0x26cceb,_0x2fc637?util[_0x5474('0xb')](_0x2fc637,{'showHidden':![],'depth':null}):'');})[_0x5474('0xf')](function(_0x12cd7f){logger[_0x5474('0xa')](_0x5474('0xe'),_0x26cceb,_0x12cd7f?util[_0x5474('0xb')](_0x12cd7f,{'showHidden':![],'depth':null}):'');});};function getUser(_0xc05a28){return client[_0x5474('0xc')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x5474('0x10'),_0x5474('0x11'),_0x5474('0x12')],'where':_0xc05a28,'limit':0x1}})[_0x5474('0xd')](function(_0x5a6353){logger['debug']('[utils][getUser]\x20where:%s',JSON['stringify'](_0xc05a28),_0x5a6353?util[_0x5474('0xb')](_0x5a6353,{'showHidden':![],'depth':null}):'');return _0x5a6353[_0x5474('0x13')][_0x5474('0x14')]?_0x5a6353['result'][0x0]:null;});}exports[_0x5474('0x15')]=function(_0x2be746){return new BPromise(function(_0x56dbfa,_0x22b37d){if(_0x2be746){return getUser({'internal':_0x2be746})[_0x5474('0xd')](function(_0x18b0fe){logger[_0x5474('0x8')](_0x5474('0x16'),_0x2be746,_0x18b0fe?'found':_0x5474('0x17'));return _0x56dbfa(_0x18b0fe);})['catch'](function(_0x3023cd){logger[_0x5474('0xa')]('[utils][getUserByInternal]',_0x3023cd?util['inspect'](_0x3023cd,{'showHidden':![],'depth':null}):'');return _0x56dbfa(null);});}return _0x56dbfa(null);});};exports['getUserByInterface']=function(_0x1f81d6){return new BPromise(function(_0x2c7593,_0x475374){if(_0x1f81d6){return getUser({'interface':_0x1f81d6})[_0x5474('0xd')](function(_0x36b389){logger[_0x5474('0x8')](_0x5474('0x18'),_0x1f81d6,_0x36b389?_0x5474('0x19'):_0x5474('0x17'));return _0x2c7593(_0x36b389);})[_0x5474('0xf')](function(_0x542d1f){logger['error'](_0x5474('0x1a'),_0x542d1f?util[_0x5474('0xb')](_0x542d1f,{'showHidden':![],'depth':null}):'');return _0x2c7593(null);});}return _0x2c7593(null);});};exports[_0x5474('0x1b')]=function(_0x4b40e0){return new BPromise(function(_0x24997a,_0x49f691){if(_0x4b40e0){return getUser({'name':_0x4b40e0})[_0x5474('0xd')](function(_0x23dbc5){logger['info'](_0x5474('0x1c'),_0x4b40e0,_0x23dbc5?'found':_0x5474('0x17'));return _0x24997a(_0x23dbc5);})['catch'](function(_0xe9dcbf){logger[_0x5474('0xa')](_0x5474('0x1d'),_0xe9dcbf?util['inspect'](_0xe9dcbf,{'showHidden':![],'depth':null}):'');return _0x24997a(null);});}return _0x24997a(null);});};exports[_0x5474('0x1e')]=function(_0x42b99a){return new BPromise(function(_0x479e44,_0x57731b){if(_0x42b99a){return client['request']('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x5474('0x11'),_0x5474('0x1f'),'acw',_0x5474('0x20')],'where':{'name':_0x42b99a},'limit':0x1}})['then'](function(_0xc1e0ce){logger['debug'](_0x5474('0x21'),_0x42b99a,_0xc1e0ce?util['inspect'](_0xc1e0ce,{'showHidden':![],'depth':null}):'');logger[_0x5474('0x8')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x42b99a,_0xc1e0ce?_0x5474('0x19'):_0x5474('0x17'));return _0x479e44(_0xc1e0ce[_0x5474('0x13')][_0x5474('0x14')]?_0xc1e0ce['result'][0x0]:null);})['catch'](function(_0x44e089){logger[_0x5474('0xa')](_0x5474('0x22'),_0x44e089?util[_0x5474('0xb')](_0x44e089,{'showHidden':![],'depth':null}):'');return _0x479e44(null);});}return _0x479e44(null);});};exports['addTime']=function(_0x5e001d,_0x258d66){return moment(_0x5e001d)[_0x5474('0x23')](_0x258d66,'seconds')[_0x5474('0x24')](_0x5474('0x25'));};exports[_0x5474('0x26')]=function(_0xc5fb7,_0x4d32ce){return moment(_0xc5fb7)[_0x5474('0x27')](_0x4d32ce,_0x5474('0x28'))[_0x5474('0x24')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x5474('0x29')]=function(_0x2b8d66,_0xc3d6af){return moment(_0x2b8d66)[_0x5474('0x2a')](moment(_0xc3d6af),'seconds');};exports['sumTime']=function(_0x30d4a2,_0x3eccef){return parseInt(_0x30d4a2,0xa)+parseInt(_0x3eccef,0xa);};exports[_0x5474('0x2b')]=function(){return moment()[_0x5474('0x24')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x5474('0x2c')]=function(_0x42a122,_0x13b56b){if(_0x13b56b){return moment(_0x42a122)[_0x5474('0x2c')](_0x13b56b);}return!![];};exports['isBefore']=function(_0x5b1b70,_0x573c28){if(_0x573c28){return moment(_0x5b1b70)[_0x5474('0x2d')](_0x573c28);}else if(_0x5b1b70){return!![];}return![];};
\ No newline at end of file